summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--3rdparty/bgfx/.appveyor.yml25
-rw-r--r--3rdparty/bgfx/.editorconfig4
-rw-r--r--3rdparty/bgfx/.gitattributes9
-rw-r--r--3rdparty/bgfx/.github/ISSUE_TEMPLATE/bug_report.md54
-rw-r--r--3rdparty/bgfx/.github/workflows/main.yml250
-rw-r--r--3rdparty/bgfx/.gitignore10
-rw-r--r--3rdparty/bgfx/3rdparty/cgltf/cgltf.h681
-rw-r--r--3rdparty/bgfx/3rdparty/cgltf/cgltf_write.h205
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h2
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp4986
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui.h928
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp1156
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp298
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h1028
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_tables.cpp146
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp1507
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.h301
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.inl2186
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/widgets/memory_editor.inl4
-rw-r--r--3rdparty/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/LICENSE21
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/PIXEventsCommon.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/PIXEventsCommon.h)0
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/PIXEventsGenerated.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/PIXEventsGenerated.h)0
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10.h1
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1.h1
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1shader.h1
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10effect.h1
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10misc.h1
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10sdklayers.h1
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10shader.h1
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_1.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_1.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_2.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_2.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_3.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_3.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_4.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_4.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11sdklayers.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11sdklayers.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11shader.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shader.h)0
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11shadertracing.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shadertracing.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3d12.h)11715
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12compatibility.h739
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12sdklayers.h4110
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12shader.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3d12shader.h)47
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12video.h8584
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d9.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3d9.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d9caps.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3d9caps.h)0
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d9types.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3d9types.h)0
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3dcommon.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h)174
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3dcompiler.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/d3dcompiler.h)0
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore.h41
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore_interface.h316
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi.h)4
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_2.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_2.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_3.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_3.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_4.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_4.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_5.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_5.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_6.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_6.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgicommon.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/dxgicommon.h)3
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgidebug.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/dxgidebug.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgiformat.h142
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgitype.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/dxgitype.h)0
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxva2api.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/dxva2api.h)2
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/pix3.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/pix3.h)0
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/pix3_win.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/pix3_win.h)0
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/directx/winapifamily.h (renamed from 3rdparty/bgfx/3rdparty/dxsdk/include/winapifamily.h)6
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/basetsd.h347
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/oaidl.h5
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/objbase.h1
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/ocidl.h5
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpc.h5
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpcndr.h82
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwn.h3
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwnbase.h124
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/winapifamily.h6
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/windows.h18
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/client.h6
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/implements.h6
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/winadapter.h6
-rw-r--r--3rdparty/bgfx/3rdparty/directx-headers/include/wsl/wrladapter.h803
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/directx-sdk-eula.txt77
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d12_1.h2539
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h3225
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3d12video.h3352
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/d3dx12.h1522
-rw-r--r--3rdparty/bgfx/3rdparty/dxsdk/include/dxgiformat.h137
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/.gitattributes4
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/.gitignore78
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/.npmignore2
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/CMakeLists.txt51
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md238
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/README.md102
-rwxr-xr-x3rdparty/bgfx/3rdparty/glsl-optimizer/autogen.sh14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/binding.gyp28
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Main.cpp159
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Makefile16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Readme13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/SourceFiles105
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.bdgcfg10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.sln26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.vcproj897
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/SourceFiles90
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/glsloptlib.bdgcfg9
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/glsloptlib.vcproj829
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/package.json38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer.sln36
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj372
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters518
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_tests.vcxproj186
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj882
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_tests.xcodeproj/project.pbxproj272
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/removeDeletedByUs.sh15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/getopt/SConscript15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/.gitignore8
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/.npmignore0
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/README228
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/SConscript112
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/TODO12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.npmignore0
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/README30
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c911
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c1141
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.h8
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.cpp1360
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser.cpp2436
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser.h15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/.gitignore11
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/program/.gitignore4
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/util/.gitignore1
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/src/util/SConscript38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/target_defaults.gypi28
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-in.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-inES.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-inES3.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt22
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-in.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES3.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt22
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-in.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-inES3.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt28
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt39
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-in.txt8
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-inES.txt9
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-out.txt8
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-outES.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-inES3.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-outES3.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-outES3Metal.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-in.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-out.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-in.txt6
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-out.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-in.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-out.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-in.txt9
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-out.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-in.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt33
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-inES3.txt78
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3.txt88
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3Metal.txt98
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-in.txt8
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-inES3.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3Metal.txt27
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-inES3.txt118
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3.txt161
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3Metal.txt172
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-in.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-out.txt22
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-inES3.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3Metal.txt38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-inES3.txt41
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-outES3.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-outES3Metal.txt46
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-in.txt59
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-inES.txt61
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-out.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-outES.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/estest1-in.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/estest1-out.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-in.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-out.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-in.txt11
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES3.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-out.txt8
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES.txt9
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3Metal.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES3.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3.txt22
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3Metal.txt30
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-inES3.txt685
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-outES3.txt187
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-outES3Metal.txt199
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-in.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-inES3.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-out.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3Metal.txt27
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-in.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-in.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-inES.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-out.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-outES.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-inES.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-outES.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-in.txt77
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES.txt77
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt97
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-out.txt116
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt132
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt154
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt164
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3.txt31
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3Metal.txt41
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES.txt32
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3Metal.txt44
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-inES.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-outES.txt36
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-inES.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-outES.txt32
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-inES.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-inES.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-in.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-out.txt51
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-inES.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-outES.txt31
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-inES3.txt94
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3.txt78
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3Metal.txt94
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-inES3.txt30
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3Metal.txt71
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-in.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-inES.txt9
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-inES3.txt9
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-inES3.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3.txt11
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3Metal.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-out.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt11
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3Metal.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-inES3.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3Metal.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-in.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-out.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-in.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-out.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-in.txt8
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-out.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-in.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-out.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-inES3.txt85
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3.txt9
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3Metal.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-in.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-out.txt9
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-in.txt11
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-out.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES3.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3Metal.txt33
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-in.txt11
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-out.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-in.txt11
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-out.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-inES.txt22
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-outES.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-inES.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-inES.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-outES.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-in.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-out.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-in.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-out.txt31
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-in.txt22
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-in.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/pp-basic-in.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/pp-basic-out.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-inES.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-inES3.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3Metal.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-inES.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt27
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-inES.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt27
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-inES3.txt28
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3Metal.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-temps-inES.txt42
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-temps-outES.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-inES.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-outES.txt31
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-inES.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-outES.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-inES3.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3Metal.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt50
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/small-float-in.txt6
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/small-float-out.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-in.txt9
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-out.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-in.txt78
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-out.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-unused-in.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-unused-out.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-in.txt6
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/syntax-inES.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/syntax-outES.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-in.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-inES.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-inES3.txt18
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-out.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3.txt51
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3Metal.txt61
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-in.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES3.txt28
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-out.txt172
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES.txt174
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3.txt176
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3Metal.txt186
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-in.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-inES3.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-out.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3.txt33
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3Metal.txt43
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-in.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES.txt8
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES3.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-out.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3Metal.txt36
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-in.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES3.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-out.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt27
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3Metal.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-in.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES3.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-in.txt5
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES3.txt8
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES__.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-out.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3Metal.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-inES3.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3.txt18
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3Metal.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-inES3.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3Metal.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-inES.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-inES3.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt41
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-inES3.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-outES3.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-outES3Metal.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texelFetchMSAA-in.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texelFetchMSAA-out.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/types-writemask-in.txt6
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/types-writemask-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-inES3.txt44
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-outES3.txt32
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-outES3Metal.txt42
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-in.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-inES.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-out.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-outES.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-in.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-inES.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-out.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-outES.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-in.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-inES.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-out.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-outES.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-inES3.txt136
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3.txt55
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3Metal.txt65
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-inES3.txt98
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt128
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3Metal.txt139
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-in.txt111
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt118
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-out.txt54
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt67
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt79
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-in.txt77
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES.txt79
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt81
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-out.txt65
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES.txt89
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3.txt91
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3Metal.txt101
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-in.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-inES.txt11
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-out.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-outES.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-in.txt188
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-out.txt294
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-in.txt138
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt139
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt292
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt293
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt303
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-in.txt107
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-inES.txt106
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-out.txt79
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt100
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-in.txt567
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-inES.txt567
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-out.txt541
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt654
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-in.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-inES.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-out.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-outES.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-in.txt145
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES.txt145
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt147
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-out.txt124
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt176
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt178
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt188
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-inES3.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3.txt46
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3Metal.txt56
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-in.txt137
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-inES.txt137
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-out.txt79
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-outES.txt97
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES.txt81
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt81
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES.txt87
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3.txt89
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3Metal.txt99
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-in.txt258
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt259
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-out.txt204
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt207
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt217
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-inES3.txt101
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3.txt71
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3Metal.txt81
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-in.txt90
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-out.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-in.txt96
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-out.txt27
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-in.txt120
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-out.txt56
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-in.txt112
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-out.txt54
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-in.txt136
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-in.txt96
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-out.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-in.txt99
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-out.txt39
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-in.txt93
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-out.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-in.txt93
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-out.txt33
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-in.txt69
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-in.txt120
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-out.txt31
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt90
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt31
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-in.txt106
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-out.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-in.txt72
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-in.txt58
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-out.txt31
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-in.txt62
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-out.txt32
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-in.txt30
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-in.txt71
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-in.txt72
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-in.txt42
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-in.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-in.txt48
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-out.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-in.txt38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-out.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-in.txt43
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-out.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-in.txt41
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-out.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-in.txt73
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-out.txt46
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-in.txt43
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt18
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-in.txt43
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt18
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-in.txt39
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-out.txt18
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-in.txt95
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt65
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-in.txt146
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-out.txt97
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-in.txt45
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-out.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-in.txt52
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-out.txt36
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-in.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-in.txt73
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt79
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-in.txt61
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-out.txt30
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-in.txt41
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-out.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-in.txt48
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-in.txt98
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-in.txt102
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt43
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-in.txt74
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-in.txt96
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt32
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-in.txt123
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-in.txt108
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt39
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-in.txt110
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt43
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-in.txt94
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt33
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-in.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-in.txt45
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-in.txt51
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-in.txt119
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt46
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-in.txt106
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt42
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-in.txt106
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt42
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-in.txt140
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt45
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt44
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt66
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-in.txt127
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt53
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt88
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt7
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt156
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt67
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt161
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt75
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-in.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-in.txt75
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-out.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt103
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt39
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-in.txt101
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt36
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-in.txt105
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt36
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES.txt83
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt86
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES.txt46
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3.txt48
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3Metal.txt58
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-in.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-in.txt102
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-in.txt92
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-out.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-in.txt76
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-in.txt127
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-out.txt50
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-in.txt105
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-out.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-in.txt91
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-out.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-in.txt125
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-out.txt38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-in.txt84
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-out.txt33
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-in.txt45
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-in.txt128
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-out.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-in.txt117
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-out.txt42
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-in.txt151
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-out.txt46
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-in.txt140
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-out.txt75
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-in.txt38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-out.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-in.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-out.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-in.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-in.txt39
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-out.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-in.txt42
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-out.txt18
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-in.txt43
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-in.txt111
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-out.txt43
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-in.txt156
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-out.txt65
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-in.txt124
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-out.txt61
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-in.txt104
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-out.txt27
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-in.txt128
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt65
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-in.txt75
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-in.txt111
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-out.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-in.txt99
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-out.txt36
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-in.txt141
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-out.txt60
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-in.txt142
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt72
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-in.txt140
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-out.txt74
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-in.txt139
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-out.txt72
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-in.txt123
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-out.txt60
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-in.txt81
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-out.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-in.txt105
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-out.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-in.txt44
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-out.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-in.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-in.txt100
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-inES3.txt79
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-out.txt100
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt79
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt90
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-inES.txt131
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt96
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-in.txt115
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-out.txt44
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-in.txt95
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-in.txt103
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-out.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-in.txt98
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-out.txt27
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-in.txt109
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-out.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-in.txt97
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-out.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-in.txt127
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-out.txt38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-in.txt134
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-out.txt55
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-in.txt124
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-out.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-in.txt125
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-out.txt45
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-in.txt137
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-out.txt71
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-in.txt138
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-out.txt73
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-in.txt119
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-out.txt57
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-in.txt77
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-out.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-in.txt133
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-out.txt44
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-in.txt114
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-out.txt55
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-in.txt72
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-out.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-in.txt126
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-in.txt101
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-in.txt85
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-out.txt27
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-in.txt122
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-out.txt47
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-in.txt78
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-in.txt89
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-out.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-in.txt87
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-out.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-in.txt115
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-out.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-in.txt88
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-out.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-in.txt104
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-out.txt36
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-in.txt97
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-out.txt38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-in.txt90
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-in.txt112
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-out.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-in.txt116
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-out.txt32
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-in.txt129
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-out.txt36
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-in.txt131
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-out.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-in.txt123
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-out.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-in.txt99
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-out.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-in.txt91
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-out.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-in.txt69
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-in.txt68
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-in.txt85
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-out.txt28
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-in.txt106
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-out.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-in.txt90
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-out.txt32
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-in.txt124
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-in.txt131
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-out.txt59
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-in.txt85
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-out.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-in.txt65
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-in.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-out.txt9
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-in.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-out.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-in.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-in.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-in.txt67
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-out.txt60
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-in.txt85
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-in.txt64
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-in.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-out.txt12
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-in.txt43
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-out.txt22
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-in.txt95
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-out.txt31
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-in.txt114
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-out.txt60
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-in.txt102
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-out.txt45
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-in.txt101
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-in.txt99
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-out.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-in.txt107
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-out.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-in.txt107
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-out.txt44
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-in.txt106
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-out.txt52
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-in.txt111
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-out.txt60
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-in.txt131
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-out.txt44
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-in.txt94
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-out.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-in.txt104
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-out.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-in.txt66
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-out.txt67
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-in.txt120
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-out.txt47
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-in.txt125
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-out.txt55
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-in.txt160
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-out.txt79
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-in.txt162
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-out.txt60
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-in.txt43
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-out.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-in.txt42
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-out.txt30
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-in.txt46
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-out.txt105
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES.txt31
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES3.txt68
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3.txt54
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3Metal.txt63
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp706
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/tests.gyp0
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/tests.js40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES.txt154
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES3.txt161
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt167
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt168
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3Metal.txt179
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-in.txt13
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-out.txt30
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-in.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-out.txt30
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-in.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-out.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-inES3.txt53
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt50
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt61
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-in.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-out.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-in.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES3.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-out.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3.txt22
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3Metal.txt36
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/estest1-in.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/estest1-out.txt23
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-in.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-in.txt26
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-out.txt31
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-inES3.txt36
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt42
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-in.txt55
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-out.txt50
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-in.txt188
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-inES3.txt188
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt123
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt123
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt134
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-inES3.txt86
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt91
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt102
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES.txt63
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES3.txt66
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES.txt65
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3.txt77
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3Metal.txt86
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-in.txt9
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-out.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES.txt71
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES3.txt74
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES.txt44
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3.txt45
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3Metal.txt56
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-in.txt9
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-out.txt19
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-inES3.txt32
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3Metal.txt54
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-in.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-out.txt11
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-in.txt6
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-out.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES.txt81
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES3.txt83
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES.txt70
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt73
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3Metal.txt84
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-in.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-out.txt32
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-in.txt6
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt11
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-in.txt42
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-out.txt57
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-in.txt10
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-out.txt15
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-inES3.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3.txt24
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3Metal.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-in.txt9
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-out.txt14
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-in.txt41
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-inES.txt41
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-inES3.txt47
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-out.txt22
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES.txt30
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES3.txt29
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES3Metal.txt40
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-inES3.txt54
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt88
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3Metal.txt99
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-in.txt187
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-out.txt227
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-in.txt121
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES.txt139
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES3.txt134
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-out.txt109
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt163
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt164
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt175
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-in.txt132
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-out.txt106
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-in.txt33
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-inES.txt33
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-out.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-outES.txt25
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-in.txt41
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES.txt41
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES3.txt45
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES.txt39
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3.txt38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3Metal.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-in.txt148
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES.txt148
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES3.txt155
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-out.txt139
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES.txt148
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt157
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3Metal.txt168
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-in.txt109
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-out.txt71
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-in.txt77
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-out.txt46
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-in.txt80
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-in.txt188
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-out.txt158
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-in.txt87
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-out.txt50
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-in.txt88
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-out.txt46
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-in.txt89
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-out.txt52
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-in.txt86
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-out.txt50
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt107
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt75
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-in.txt55
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-in.txt64
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-out.txt47
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-in.txt33
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-out.txt17
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-in.txt77
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-out.txt54
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-in.txt111
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-out.txt56
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-in.txt71
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt51
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-in.txt56
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-out.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-in.txt51
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-out.txt27
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-in.txt52
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-out.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-in.txt50
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-out.txt32
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-in.txt78
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-out.txt60
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-in.txt233
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt179
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-in.txt171
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt112
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-in.txt146
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt90
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-in.txt157
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt88
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-in.txt101
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt80
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-in.txt101
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt80
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-in.txt179
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt143
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-in.txt102
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt66
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt63
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt41
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt94
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt53
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-in.txt175
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt137
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt135
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt75
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt185
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt148
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt189
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt156
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-in.txt48
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-out.txt28
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt91
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt58
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-in.txt118
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-out.txt72
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-in.txt89
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt44
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-in.txt111
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt76
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-in.txt108
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-out.txt60
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-in.txt93
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-out.txt51
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-in.txt189
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-out.txt158
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-in.txt99
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-out.txt67
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-in.txt106
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-out.txt82
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-in.txt44
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-out.txt20
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-in.txt91
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-out.txt58
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-in.txt123
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-out.txt98
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-in.txt102
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-out.txt73
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-in.txt78
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-out.txt46
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-in.txt116
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-out.txt83
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-in.txt79
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-out.txt68
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-in.txt90
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-out.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-in.txt100
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-out.txt59
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-in.txt103
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-out.txt70
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-in.txt120
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-out.txt92
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-in.txt103
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-out.txt73
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-in.txt103
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-out.txt71
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-in.txt98
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-out.txt55
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-in.txt63
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-in.txt100
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-out.txt59
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-in.txt38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt16
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-in.txt92
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt59
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-in.txt83
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-out.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-in.txt89
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-out.txt52
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-in.txt103
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-out.txt70
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-in.txt103
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-out.txt73
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-in.txt63
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-in.txt33
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-out.txt11
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-in.txt97
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-out.txt55
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-in.txt62
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-in.txt86
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-out.txt50
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-in.txt92
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-out.txt52
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-in.txt82
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-out.txt38
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-in.txt108
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-out.txt57
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-in.txt71
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-in.txt94
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-out.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-in.txt94
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-out.txt47
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-in.txt91
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-out.txt48
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-in.txt85
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-out.txt44
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-in.txt79
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-in.txt85
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-out.txt34
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-in.txt134
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-out.txt105
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-in.txt89
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-out.txt50
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-in.txt86
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-out.txt44
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-in.txt99
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-out.txt69
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-in.txt106
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-out.txt84
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-in.txt89
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-out.txt57
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-in.txt89
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-out.txt60
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-in.txt85
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-out.txt42
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-in.txt85
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-out.txt45
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-in.txt62
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-in.txt62
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-in.txt78
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-out.txt36
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-in.txt93
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-out.txt53
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-in.txt84
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-out.txt41
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-in.txt91
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-out.txt56
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-in.txt86
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-out.txt55
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-in.txt96
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-out.txt56
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-in.txt62
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-in.txt46
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-out.txt21
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-in.txt47
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt22
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-in.txt47
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-out.txt22
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-in.txt56
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-out.txt37
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-in.txt45
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-out.txt27
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-in.txt101
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-out.txt73
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-in.txt85
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-out.txt50
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-in.txt80
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-in.txt79
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-out.txt48
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-in.txt80
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-out.txt35
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-in.txt89
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-out.txt49
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-in.txt93
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-out.txt50
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-in.txt97
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-out.txt58
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-in.txt91
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-out.txt127
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-in.txt171
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-out.txt129
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-in.txt175
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-out.txt137
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-in.txt189
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-out.txt156
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-in.txt177
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-out.txt130
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-in.txt57
-rw-r--r--3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-out.txt32
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/CHANGES.md84
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/LICENSE.txt692
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp40
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h1
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp566
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/NonSemanticShaderDebugInfo100.h171
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.cpp53
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.h8
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.cpp777
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h111
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp39
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.h16
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/disassemble.cpp47
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/doc.cpp83
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/spirv.hpp249
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/SPIRV/spvIR.h40
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/StandAlone/ResourceLimits.cpp50
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp188
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/StandAlone/resource_limits_c.cpp15
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/StandAlone/spirv-remap.cpp46
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/build_info.h26
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/build_info.h.tmpl62
-rwxr-xr-x3rdparty/bgfx/3rdparty/glslang/build_info.py226
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp68
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl (renamed from 3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Windows/main.cpp)44
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp130
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.h3
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Include/BaseTypes.h24
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Include/Common.h37
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Include/PoolAlloc.h2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Include/ResourceLimits.h9
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h18
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h573
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Include/glslang_c_interface.h30
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Include/glslang_c_shader_types.h79
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Include/intermediate.h7
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp33
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp552
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp14
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp3
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp439
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h1
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp19
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp85
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp33
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp17
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h17
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp43
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h16
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m446
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y48
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp7432
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h15
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp46
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp89
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h19
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp385
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h75
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h7
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.h4
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp54
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.after.js26
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.js.cpp287
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.pre.js56
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/osinclude.h2
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Public/ResourceLimits.h (renamed from 3rdparty/bgfx/3rdparty/glslang/StandAlone/ResourceLimits.h)10
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h47
-rw-r--r--3rdparty/bgfx/3rdparty/glslang/glslang/Public/resource_limits_c.h (renamed from 3rdparty/bgfx/3rdparty/glslang/StandAlone/resource_limits_c.h)5
-rw-r--r--3rdparty/bgfx/3rdparty/iconfontheaders/.gitignore58
-rw-r--r--3rdparty/bgfx/3rdparty/iconfontheaders/README.md53
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_icd.h9
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_platform.h4
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_sdk_platform.h2
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan.h3
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_android.h17
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_beta.h823
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_core.h4633
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_directfb.h2
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_fuchsia.h139
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_ggp.h2
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_ios.h2
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_macos.h2
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_metal.h143
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_screen.h2
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_vi.h2
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_wayland.h2
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_win32.h2
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xcb.h2
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib.h2
-rw-r--r--3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib_xrandr.h2
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/LICENSE.md2
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/allocator.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/clusterizer.cpp152
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/indexgenerator.cpp6
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h121
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/overdrawanalyzer.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/overdrawoptimizer.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp30
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/spatialorder.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/vcacheoptimizer.cpp28
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp92
-rw-r--r--3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexfilter.cpp3
-rw-r--r--3rdparty/bgfx/3rdparty/native_app_glue/LICENSE13
-rw-r--r--3rdparty/bgfx/3rdparty/native_app_glue/android_native_app_glue.c457
-rw-r--r--3rdparty/bgfx/3rdparty/native_app_glue/android_native_app_glue.h350
-rw-r--r--3rdparty/bgfx/3rdparty/renderdoc/renderdoc_app.h66
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/main.cpp271
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv.h392
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv.hpp392
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.cpp44
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.hpp5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_common.hpp96
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cpp.cpp7
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.cpp544
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.hpp49
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp175
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.h85
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_containers.hpp23
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp52
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp11
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp2098
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp84
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp992
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.hpp33
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.cpp2823
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.hpp190
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_parser.cpp153
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_parser.hpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/SPIRV-Headers.pc.in9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.cs993
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp1002
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp111002
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.lua949
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.py949
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.cs1015
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp1024
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp111024
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.lua971
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.py971
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.cs1021
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp1030
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp111030
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.lua977
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.py977
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/spir-v.xml44
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h13
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json117
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json863
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.cs1812
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h149
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp2467
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp112467
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.json118
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.lua1757
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.py1757
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spv.d1814
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc62
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc70
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/include/generated/extension_enum.inc11
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/include/generated/generators.inc7
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/include/generated/nonsemantic.clspvreflection.insts.inc13
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc166
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.h16
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.hpp9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp79
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/assembly_grammar.cpp6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp39
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/binary.h7
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/cfa.h75
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/diff/diff.cpp2869
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/diff/diff.h48
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/diff/lcs.h224
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/disassemble.cpp488
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/disassemble.h66
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/ext_inst.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/ext_inst.h4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/extensions.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/libspirv.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/link/linker.cpp222
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/name_mapper.cpp11
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opcode.cpp14
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opcode.h10
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/operand.cpp14
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp597
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h84
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.cpp24
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/basic_block.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/block_merge_pass.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/block_merge_util.cpp37
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ccp_pass.cpp48
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ccp_pass.h16
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/cfg.cpp22
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/cfg.h10
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/combine_access_chains.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/compact_ids_pass.cpp8
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp328
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/constants.cpp23
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/constants.h43
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp36
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.cpp174
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.h38
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.cpp20
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.h4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_insert_elim_pass.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.cpp65
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.h22
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.cpp8
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.h4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.cpp47
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.h50
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.cpp231
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.h50
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.cpp117
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.h54
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dominator_tree.cpp34
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dominator_tree.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.cpp189
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.h65
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_members_pass.cpp35
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/feature_manager.cpp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.cpp90
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.h47
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp125
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.h11
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp392
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/function.cpp8
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/function.h44
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp16
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/if_conversion.cpp7
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_exhaustive_pass.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_opaque_pass.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.cpp58
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.h12
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp7
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.h4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp12
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.cpp54
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.h36
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.cpp70
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.h19
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interface_var_sroa.cpp968
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interface_var_sroa.h401
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interp_fixup_pass.cpp7
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_builder.h31
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp30
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.h41
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_loader.cpp5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/iterator.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp91
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.h18
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp16
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp40
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp13
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_descriptor.h5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fission.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fission.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion_pass.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_peeling.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unroller.cpp29
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_utils.h4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/mem_pass.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/merge_return_pass.cpp22
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/merge_return_pass.h10
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/module.cpp11
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/module.h25
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp66
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass.h9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass_manager.cpp14
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass_manager.h4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/passes.h8
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/private_to_local_pass.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/private_to_local_pass.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/reduce_load_size.cpp11
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/redundancy_elimination.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/redundancy_elimination.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/reflect.h3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/register_pressure.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/relax_float_ops_pass.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.cpp49
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.h42
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_duplicates_pass.cpp5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.cpp429
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.h205
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_invalid_opc.cpp5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis_nodes.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis_simplification.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp29
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.h33
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp33
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.cpp298
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.h116
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.cpp74
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.h9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strength_reduction_pass.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_debug_info_pass.cpp13
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp (renamed from 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_reflect_info_pass.cpp)47
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.h (renamed from 3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_reflect_info_pass.h)10
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp11
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.h7
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.cpp193
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.h111
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/unify_const_pass.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/upgrade_memory_model.cpp8
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/opt/vector_dce.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/parsed_operand.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/print.cpp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_struct_member_reduction_opportunity.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unused_struct_member_reduction_opportunity_finder.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_constant.h1
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_definition.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_endian.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_target_env.cpp93
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_target_env.h5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_validator_options.cpp5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_validator_options.h4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/table.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/text.cpp25
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/text_handler.cpp57
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/util/bit_vector.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/util/hash_combine.h53
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/util/hex_float.h92
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/util/ilist.h3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/util/parse_number.h2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/util/small_vector.h21
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/util/string_utils.h63
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/util/timer.h6
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/basic_block.cpp83
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/basic_block.h109
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/construct.cpp86
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/decoration.h9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/function.cpp41
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/function.h18
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/instruction.cpp10
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/instruction.h3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate.cpp34
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate.h11
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_annotation.cpp368
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_arithmetics.cpp2
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_atomics.cpp10
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_barriers.cpp3
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_bitwise.cpp83
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_builtins.cpp230
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp252
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp4
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_constants.cpp102
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_conversion.cpp18
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_debug.cpp14
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_decorations.cpp425
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp12
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_execution_limitations.cpp9
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_extensions.cpp137
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_function.cpp68
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_image.cpp337
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_instruction.cpp27
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_interfaces.cpp75
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_layout.cpp1
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_logicals.cpp13
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_memory.cpp484
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_mesh_shading.cpp123
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp5
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp147
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp55
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_ray_query.cpp273
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_ray_tracing.cpp209
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_scopes.cpp69
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_type.cpp131
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validation_state.cpp339
-rw-r--r--3rdparty/bgfx/3rdparty/spirv-tools/source/val/validation_state.h114
-rw-r--r--3rdparty/bgfx/3rdparty/stb/LICENSE37
-rw-r--r--3rdparty/bgfx/3rdparty/stb/stb_rect_pack.h41
-rw-r--r--3rdparty/bgfx/LICENSE2
-rw-r--r--3rdparty/bgfx/README.md64
-rw-r--r--3rdparty/bgfx/bindings/bf/bgfx.bf193
-rw-r--r--3rdparty/bgfx/bindings/cs/bgfx.cs193
-rw-r--r--3rdparty/bgfx/bindings/cs/bgfx_dllname.cs2
-rw-r--r--3rdparty/bgfx/bindings/d/funcs.d450
-rw-r--r--3rdparty/bgfx/bindings/d/types.d139
-rw-r--r--3rdparty/bgfx/bindings/zig/bgfx.zig3705
-rw-r--r--3rdparty/bgfx/docs/bgfx.rst605
-rw-r--r--3rdparty/bgfx/docs/build.rst215
-rw-r--r--3rdparty/bgfx/docs/examples.rst706
-rw-r--r--3rdparty/bgfx/docs/index.rst22
-rw-r--r--3rdparty/bgfx/docs/internals.rst50
-rw-r--r--3rdparty/bgfx/docs/license.rst132
-rw-r--r--3rdparty/bgfx/docs/overview.rst300
-rw-r--r--3rdparty/bgfx/docs/tools.rst243
-rw-r--r--3rdparty/bgfx/examples/00-helloworld/helloworld.cpp6
-rw-r--r--3rdparty/bgfx/examples/01-cubes/cubes.cpp8
-rw-r--r--3rdparty/bgfx/examples/01-cubes/fs_cubes.sc4
-rw-r--r--3rdparty/bgfx/examples/01-cubes/makefile4
-rw-r--r--3rdparty/bgfx/examples/01-cubes/vs_cubes.sc4
-rw-r--r--3rdparty/bgfx/examples/02-metaballs/fs_metaballs.sc4
-rw-r--r--3rdparty/bgfx/examples/02-metaballs/makefile4
-rw-r--r--3rdparty/bgfx/examples/02-metaballs/metaballs.cpp6
-rw-r--r--3rdparty/bgfx/examples/02-metaballs/vs_metaballs.sc4
-rw-r--r--3rdparty/bgfx/examples/03-raymarch/fs_raymarching.sc4
-rw-r--r--3rdparty/bgfx/examples/03-raymarch/makefile4
-rw-r--r--3rdparty/bgfx/examples/03-raymarch/raymarch.cpp6
-rw-r--r--3rdparty/bgfx/examples/03-raymarch/vs_raymarching.sc4
-rw-r--r--3rdparty/bgfx/examples/04-mesh/fs_mesh.sc4
-rw-r--r--3rdparty/bgfx/examples/04-mesh/makefile4
-rw-r--r--3rdparty/bgfx/examples/04-mesh/mesh.cpp6
-rw-r--r--3rdparty/bgfx/examples/04-mesh/vs_mesh.sc4
-rw-r--r--3rdparty/bgfx/examples/05-instancing/fs_instancing.sc4
-rw-r--r--3rdparty/bgfx/examples/05-instancing/instancing.cpp8
-rw-r--r--3rdparty/bgfx/examples/05-instancing/makefile4
-rw-r--r--3rdparty/bgfx/examples/05-instancing/vs_instancing.sc4
-rw-r--r--3rdparty/bgfx/examples/06-bump/bump.cpp6
-rw-r--r--3rdparty/bgfx/examples/06-bump/fs_bump.sc4
-rw-r--r--3rdparty/bgfx/examples/06-bump/makefile4
-rw-r--r--3rdparty/bgfx/examples/06-bump/vs_bump.sc4
-rw-r--r--3rdparty/bgfx/examples/06-bump/vs_bump_instanced.sc4
-rw-r--r--3rdparty/bgfx/examples/07-callback/callback.cpp9
-rw-r--r--3rdparty/bgfx/examples/07-callback/fs_callback.sc4
-rw-r--r--3rdparty/bgfx/examples/07-callback/makefile4
-rw-r--r--3rdparty/bgfx/examples/07-callback/vs_callback.sc4
-rw-r--r--3rdparty/bgfx/examples/08-update/cs_update.sc2
-rw-r--r--3rdparty/bgfx/examples/08-update/fs_update.sc4
-rw-r--r--3rdparty/bgfx/examples/08-update/fs_update_3d.sc4
-rw-r--r--3rdparty/bgfx/examples/08-update/fs_update_cmp.sc4
-rw-r--r--3rdparty/bgfx/examples/08-update/makefile4
-rw-r--r--3rdparty/bgfx/examples/08-update/update.cpp64
-rw-r--r--3rdparty/bgfx/examples/08-update/vs_update.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/common.sh4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc8
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc6
-rw-r--r--3rdparty/bgfx/examples/09-hdr/hdr.cpp8
-rw-r--r--3rdparty/bgfx/examples/09-hdr/makefile4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_blur.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_bright.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_lum.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_lumavg.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_skybox.sc4
-rw-r--r--3rdparty/bgfx/examples/09-hdr/vs_hdr_tonemap.sc4
-rw-r--r--3rdparty/bgfx/examples/10-font/font.cpp9
-rw-r--r--3rdparty/bgfx/examples/11-fontsdf/fontsdf.cpp9
-rw-r--r--3rdparty/bgfx/examples/12-lod/fs_tree.sc2
-rw-r--r--3rdparty/bgfx/examples/12-lod/lod.cpp4
-rw-r--r--3rdparty/bgfx/examples/12-lod/makefile4
-rw-r--r--3rdparty/bgfx/examples/12-lod/vs_tree.sc2
-rw-r--r--3rdparty/bgfx/examples/13-stencil/fs_stencil_color_black.sc2
-rw-r--r--3rdparty/bgfx/examples/13-stencil/fs_stencil_color_lighting.sc2
-rw-r--r--3rdparty/bgfx/examples/13-stencil/fs_stencil_color_texture.sc2
-rw-r--r--3rdparty/bgfx/examples/13-stencil/fs_stencil_texture.sc2
-rw-r--r--3rdparty/bgfx/examples/13-stencil/fs_stencil_texture_lighting.sc2
-rw-r--r--3rdparty/bgfx/examples/13-stencil/makefile4
-rw-r--r--3rdparty/bgfx/examples/13-stencil/stencil.cpp55
-rw-r--r--3rdparty/bgfx/examples/13-stencil/vs_stencil_color.sc2
-rw-r--r--3rdparty/bgfx/examples/13-stencil/vs_stencil_color_lighting.sc2
-rw-r--r--3rdparty/bgfx/examples/13-stencil/vs_stencil_color_texture.sc2
-rw-r--r--3rdparty/bgfx/examples/13-stencil/vs_stencil_texture.sc2
-rw-r--r--3rdparty/bgfx/examples/13-stencil/vs_stencil_texture_lighting.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_lighting.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_texture.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbackblank.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbackcolor.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex1.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex2.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontblank.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontcolor.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex1.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex2.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svside.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsideblank.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsidecolor.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsidetex.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lighting.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/makefile4
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp25
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_lighting.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_texture.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svback.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svfront.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svside.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture.sc2
-rw-r--r--3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture_lighting.sc2
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_mesh.sc2
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_mesh_pd.sc2
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sc2
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sh2
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow_pd.sc2
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/makefile4
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp32
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_mesh.sc2
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_shadow.sc2
-rw-r--r--3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_shadow_pd.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/common.sh2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_black.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting.sh2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_csm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_csm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_omni.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_omni.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_csm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_csm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_omni.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_omni.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_csm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_csm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_omni.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_omni.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_csm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_csm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_omni.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_omni.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_texture.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_hblur.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_hblur_vsm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_linear.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_vsm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_vsm_linear.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_texture.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_unpackdepth.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_unpackdepth_vsm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_vblur.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_vblur_vsm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/makefile4
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp6
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_csm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear_csm.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear_omni.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_omni.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_texture.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_depth.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_hblur.sc4
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_packdepth.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_packdepth_linear.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_texture.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_texture_lighting.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_unpackdepth.sc2
-rw-r--r--3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_vblur.sc2
-rw-r--r--3rdparty/bgfx/examples/17-drawstress/drawstress.cpp6
-rw-r--r--3rdparty/bgfx/examples/17-drawstress/fs_drawstress.sc4
-rw-r--r--3rdparty/bgfx/examples/17-drawstress/makefile4
-rw-r--r--3rdparty/bgfx/examples/17-drawstress/vs_drawstress.sc4
-rw-r--r--3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc2
-rw-r--r--3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc2
-rw-r--r--3rdparty/bgfx/examples/18-ibl/ibl.cpp10
-rw-r--r--3rdparty/bgfx/examples/18-ibl/makefile4
-rw-r--r--3rdparty/bgfx/examples/18-ibl/uniforms.sh2
-rw-r--r--3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc2
-rw-r--r--3rdparty/bgfx/examples/18-ibl/vs_ibl_skybox.sc2
-rw-r--r--3rdparty/bgfx/examples/19-oit/fs_oit.sc4
-rw-r--r--3rdparty/bgfx/examples/19-oit/fs_oit_wb.sc4
-rw-r--r--3rdparty/bgfx/examples/19-oit/fs_oit_wb_blit.sc4
-rw-r--r--3rdparty/bgfx/examples/19-oit/fs_oit_wb_separate.sc4
-rw-r--r--3rdparty/bgfx/examples/19-oit/fs_oit_wb_separate_blit.sc4
-rw-r--r--3rdparty/bgfx/examples/19-oit/makefile4
-rw-r--r--3rdparty/bgfx/examples/19-oit/oit.cpp6
-rw-r--r--3rdparty/bgfx/examples/19-oit/vs_oit.sc4
-rw-r--r--3rdparty/bgfx/examples/19-oit/vs_oit_blit.sc4
-rw-r--r--3rdparty/bgfx/examples/20-nanovg/blendish.h8
-rw-r--r--3rdparty/bgfx/examples/20-nanovg/nanovg.cpp18
-rw-r--r--3rdparty/bgfx/examples/21-deferred/common.sh4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/deferred.cpp68
-rw-r--r--3rdparty/bgfx/examples/21-deferred/fs_deferred_clear_uav.sc6
-rw-r--r--3rdparty/bgfx/examples/21-deferred/fs_deferred_combine.sc4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/fs_deferred_combine_ta.sc18
-rw-r--r--3rdparty/bgfx/examples/21-deferred/fs_deferred_debug.sc4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/fs_deferred_debug_line.sc4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/fs_deferred_debug_ta.sc17
-rw-r--r--3rdparty/bgfx/examples/21-deferred/fs_deferred_geom.sc4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/fs_deferred_light.sc4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/fs_deferred_light_ta.sc4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/fs_deferred_light_uav.sc4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/makefile4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/vs_deferred_combine.sc4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/vs_deferred_debug.sc4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/vs_deferred_debug_line.sc4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/vs_deferred_geom.sc4
-rw-r--r--3rdparty/bgfx/examples/21-deferred/vs_deferred_light.sc4
-rw-r--r--3rdparty/bgfx/examples/22-windows/windows.cpp6
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/main.cpp4
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/makefile4
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp2
-rw-r--r--3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h6
-rw-r--r--3rdparty/bgfx/examples/24-nbody/cs_indirect.sc2
-rw-r--r--3rdparty/bgfx/examples/24-nbody/cs_init_instances.sc2
-rw-r--r--3rdparty/bgfx/examples/24-nbody/cs_update_instances.sc2
-rw-r--r--3rdparty/bgfx/examples/24-nbody/fs_particle.sc2
-rw-r--r--3rdparty/bgfx/examples/24-nbody/makefile4
-rw-r--r--3rdparty/bgfx/examples/24-nbody/nbody.cpp4
-rw-r--r--3rdparty/bgfx/examples/24-nbody/uniforms.sh2
-rw-r--r--3rdparty/bgfx/examples/24-nbody/vs_particle.sc2
-rw-r--r--3rdparty/bgfx/examples/25-c99/helloworld.c5
-rw-r--r--3rdparty/bgfx/examples/26-occlusion/occlusion.cpp6
-rw-r--r--3rdparty/bgfx/examples/27-terrain/fs_terrain.sc2
-rw-r--r--3rdparty/bgfx/examples/27-terrain/makefile4
-rw-r--r--3rdparty/bgfx/examples/27-terrain/terrain.cpp11
-rw-r--r--3rdparty/bgfx/examples/27-terrain/vs_terrain.sc2
-rw-r--r--3rdparty/bgfx/examples/27-terrain/vs_terrain_height_texture.sc2
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/fs_wf_mesh.sc2
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/fs_wf_wireframe.sc2
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/makefile4
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/uniforms.sh2
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/vs_wf_mesh.sc2
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/vs_wf_wireframe.sc2
-rw-r--r--3rdparty/bgfx/examples/28-wireframe/wireframe.cpp10
-rw-r--r--3rdparty/bgfx/examples/29-debugdraw/debugdraw.cpp150
-rw-r--r--3rdparty/bgfx/examples/30-picking/fs_picking_id.sc4
-rw-r--r--3rdparty/bgfx/examples/30-picking/fs_picking_shaded.sc4
-rw-r--r--3rdparty/bgfx/examples/30-picking/makefile4
-rw-r--r--3rdparty/bgfx/examples/30-picking/picking.cpp6
-rw-r--r--3rdparty/bgfx/examples/30-picking/vs_picking_shaded.sc4
-rw-r--r--3rdparty/bgfx/examples/31-rsm/fs_rsm_combine.sc2
-rw-r--r--3rdparty/bgfx/examples/31-rsm/fs_rsm_gbuffer.sc2
-rw-r--r--3rdparty/bgfx/examples/31-rsm/fs_rsm_lbuffer.sc2
-rw-r--r--3rdparty/bgfx/examples/31-rsm/fs_rsm_shadow.sc2
-rw-r--r--3rdparty/bgfx/examples/31-rsm/makefile4
-rw-r--r--3rdparty/bgfx/examples/31-rsm/reflectiveshadowmap.cpp8
-rw-r--r--3rdparty/bgfx/examples/31-rsm/vs_rsm_combine.sc2
-rw-r--r--3rdparty/bgfx/examples/31-rsm/vs_rsm_gbuffer.sc2
-rw-r--r--3rdparty/bgfx/examples/31-rsm/vs_rsm_lbuffer.sc2
-rw-r--r--3rdparty/bgfx/examples/31-rsm/vs_rsm_shadow.sc2
-rw-r--r--3rdparty/bgfx/examples/32-particles/particles.cpp8
-rw-r--r--3rdparty/bgfx/examples/33-pom/makefile4
-rw-r--r--3rdparty/bgfx/examples/33-pom/pom.cpp6
-rw-r--r--3rdparty/bgfx/examples/34-mvs/mvs.cpp6
-rw-r--r--3rdparty/bgfx/examples/35-dynamic/dynamic.cpp6
-rw-r--r--3rdparty/bgfx/examples/36-sky/fs_sky.sc2
-rw-r--r--3rdparty/bgfx/examples/36-sky/fs_sky_color_banding_fix.sc2
-rw-r--r--3rdparty/bgfx/examples/36-sky/fs_sky_landscape.sc2
-rw-r--r--3rdparty/bgfx/examples/36-sky/makefile4
-rw-r--r--3rdparty/bgfx/examples/36-sky/sky.cpp971
-rw-r--r--3rdparty/bgfx/examples/36-sky/vs_sky.sc2
-rw-r--r--3rdparty/bgfx/examples/36-sky/vs_sky_landscape.sc4
-rw-r--r--3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_copy_z.sc2
-rw-r--r--3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_downscale_hi_z.sc2
-rw-r--r--3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc2
-rw-r--r--3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_stream_compaction.sc2
-rw-r--r--3rdparty/bgfx/examples/37-gpudrivenrendering/fs_gdr_instanced_indirect_rendering.sc2
-rw-r--r--3rdparty/bgfx/examples/37-gpudrivenrendering/gpudrivenrendering.cpp10
-rw-r--r--3rdparty/bgfx/examples/37-gpudrivenrendering/makefile4
-rw-r--r--3rdparty/bgfx/examples/37-gpudrivenrendering/vs_gdr_instanced_indirect_rendering.sc2
-rw-r--r--3rdparty/bgfx/examples/37-gpudrivenrendering/vs_gdr_render_occlusion.sc2
-rw-r--r--3rdparty/bgfx/examples/38-bloom/bloom.cpp45
-rw-r--r--3rdparty/bgfx/examples/38-bloom/fs_albedo_output.sc2
-rw-r--r--3rdparty/bgfx/examples/38-bloom/fs_bloom_combine.sc4
-rw-r--r--3rdparty/bgfx/examples/38-bloom/fs_downsample.sc2
-rw-r--r--3rdparty/bgfx/examples/38-bloom/fs_upsample.sc2
-rw-r--r--3rdparty/bgfx/examples/38-bloom/makefile4
-rw-r--r--3rdparty/bgfx/examples/38-bloom/vs_albedo_output.sc2
-rw-r--r--3rdparty/bgfx/examples/38-bloom/vs_deferred_combine.sc4
-rw-r--r--3rdparty/bgfx/examples/38-bloom/vs_fullscreen.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/assao.cpp11
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_apply.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_generate_importance_map.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_generate_q.sh2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_generate_q0.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_generate_q1.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_generate_q2.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_generate_q3.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_generate_q3base.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_load_counter_clear.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_apply.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_blur.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_half_apply.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_a.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_b.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depth_mip.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals_half.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_half.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_smart_blur.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/cs_assao_smart_blur_wide.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/fs_assao_deferred_combine.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/fs_assao_gbuffer.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/makefile4
-rw-r--r--3rdparty/bgfx/examples/39-assao/vs_assao.sc2
-rw-r--r--3rdparty/bgfx/examples/39-assao/vs_assao_gbuffer.sc2
-rw-r--r--3rdparty/bgfx/examples/40-svt/fs_vt_mip.sc4
-rw-r--r--3rdparty/bgfx/examples/40-svt/fs_vt_unlit.sc4
-rw-r--r--3rdparty/bgfx/examples/40-svt/makefile4
-rw-r--r--3rdparty/bgfx/examples/40-svt/svt.cpp12
-rw-r--r--3rdparty/bgfx/examples/40-svt/virtualtexture.sh4
-rw-r--r--3rdparty/bgfx/examples/40-svt/vs_vt_generic.sc4
-rw-r--r--3rdparty/bgfx/examples/40-svt/vt.cpp6
-rw-r--r--3rdparty/bgfx/examples/40-svt/vt.h2
-rw-r--r--3rdparty/bgfx/examples/41-tess/makefile4
-rw-r--r--3rdparty/bgfx/examples/41-tess/tess.cpp1518
-rw-r--r--3rdparty/bgfx/examples/42-bunnylod/bunnylod.cpp56
-rw-r--r--3rdparty/bgfx/examples/42-bunnylod/fs_bunnylod.sc4
-rw-r--r--3rdparty/bgfx/examples/42-bunnylod/makefile4
-rw-r--r--3rdparty/bgfx/examples/42-bunnylod/progmesh.c5
-rw-r--r--3rdparty/bgfx/examples/42-bunnylod/vs_bunnylod.sc4
-rw-r--r--3rdparty/bgfx/examples/43-denoise/denoise.cpp13
-rw-r--r--3rdparty/bgfx/examples/43-denoise/fs_denoise_apply_lighting.sc2
-rw-r--r--3rdparty/bgfx/examples/43-denoise/fs_denoise_copy.sc2
-rw-r--r--3rdparty/bgfx/examples/43-denoise/fs_denoise_deferred_combine.sc2
-rw-r--r--3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_3x3.sc2
-rw-r--r--3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_5x5.sc2
-rw-r--r--3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_implementation.sh2
-rw-r--r--3rdparty/bgfx/examples/43-denoise/fs_denoise_temporal.sc2
-rw-r--r--3rdparty/bgfx/examples/43-denoise/fs_denoise_txaa.sc2
-rw-r--r--3rdparty/bgfx/examples/43-denoise/makefile2
-rw-r--r--3rdparty/bgfx/examples/43-denoise/normal_encoding.sh2
-rw-r--r--3rdparty/bgfx/examples/43-denoise/parameters.sh2
-rw-r--r--3rdparty/bgfx/examples/43-denoise/shared_functions.sh2
-rw-r--r--3rdparty/bgfx/examples/43-denoise/vs_denoise_gbuffer.sc2
-rw-r--r--3rdparty/bgfx/examples/44-sss/fs_screen_space_shadows.sc2
-rw-r--r--3rdparty/bgfx/examples/44-sss/fs_sss_deferred_combine.sc2
-rw-r--r--3rdparty/bgfx/examples/44-sss/fs_sss_linear_depth.sc2
-rw-r--r--3rdparty/bgfx/examples/44-sss/makefile2
-rw-r--r--3rdparty/bgfx/examples/44-sss/normal_encoding.sh2
-rw-r--r--3rdparty/bgfx/examples/44-sss/parameters.sh2
-rw-r--r--3rdparty/bgfx/examples/44-sss/screen_space_shadows.cpp24
-rw-r--r--3rdparty/bgfx/examples/44-sss/vs_sss_gbuffer.sc2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/bokeh.cpp28
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/bokeh_dof.sh2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/fs_bokeh_copy.sc2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/fs_bokeh_copy_linear_to_gamma.sc2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_combine.sc2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_debug.sc2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_downsample.sc2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_second_pass.sc2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_single_pass.sc2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/fs_bokeh_forward.sc2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/fs_bokeh_forward_grid.sc2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/fs_bokeh_linear_depth.sc2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/makefile2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/parameters.sh2
-rw-r--r--3rdparty/bgfx/examples/45-bokeh/vs_bokeh_forward.sc2
-rw-r--r--3rdparty/bgfx/examples/46-fsr/app.cpp858
-rw-r--r--3rdparty/bgfx/examples/46-fsr/cs_fsr.h127
-rw-r--r--3rdparty/bgfx/examples/46-fsr/cs_fsr_bilinear_16.sc3
-rw-r--r--3rdparty/bgfx/examples/46-fsr/cs_fsr_bilinear_32.sc4
-rw-r--r--3rdparty/bgfx/examples/46-fsr/cs_fsr_easu_16.sc3
-rw-r--r--3rdparty/bgfx/examples/46-fsr/cs_fsr_easu_32.sc4
-rw-r--r--3rdparty/bgfx/examples/46-fsr/cs_fsr_rcas_16.sc3
-rw-r--r--3rdparty/bgfx/examples/46-fsr/cs_fsr_rcas_32.sc4
-rw-r--r--3rdparty/bgfx/examples/46-fsr/ffx_a.h2637
-rw-r--r--3rdparty/bgfx/examples/46-fsr/ffx_fsr1.h1199
-rw-r--r--3rdparty/bgfx/examples/46-fsr/fs_fsr_copy_linear_to_gamma.sc21
-rw-r--r--3rdparty/bgfx/examples/46-fsr/fs_fsr_forward.sc79
-rw-r--r--3rdparty/bgfx/examples/46-fsr/fs_fsr_forward_grid.sc58
-rw-r--r--3rdparty/bgfx/examples/46-fsr/fsr.cpp346
-rw-r--r--3rdparty/bgfx/examples/46-fsr/fsr.h46
-rw-r--r--3rdparty/bgfx/examples/46-fsr/makefile10
-rw-r--r--3rdparty/bgfx/examples/46-fsr/screenshot.pngbin0 -> 194145 bytes
-rw-r--r--3rdparty/bgfx/examples/46-fsr/varying.def.sc9
-rw-r--r--3rdparty/bgfx/examples/46-fsr/vs_fsr_forward.sc34
-rw-r--r--3rdparty/bgfx/examples/46-fsr/vs_fsr_screenquad.sc10
-rw-r--r--3rdparty/bgfx/examples/47-pixelformats/makefile10
-rw-r--r--3rdparty/bgfx/examples/47-pixelformats/pixelformats.cpp827
-rw-r--r--3rdparty/bgfx/examples/47-pixelformats/screenshot.pngbin0 -> 154208 bytes
-rw-r--r--3rdparty/bgfx/examples/48-drawindirect/cs_drawindirect.sc93
-rw-r--r--3rdparty/bgfx/examples/48-drawindirect/cs_drawindirect_count.sc2
-rw-r--r--3rdparty/bgfx/examples/48-drawindirect/drawindirect.cpp468
-rw-r--r--3rdparty/bgfx/examples/48-drawindirect/makefile10
-rw-r--r--3rdparty/bgfx/examples/48-drawindirect/screenshot.pngbin0 -> 211827 bytes
-rw-r--r--3rdparty/bgfx/examples/49-hextile/fs_hextile.binbin0 -> 8741 bytes
-rw-r--r--3rdparty/bgfx/examples/49-hextile/fs_hextile.sc226
-rw-r--r--3rdparty/bgfx/examples/49-hextile/hextile.cpp327
-rw-r--r--3rdparty/bgfx/examples/49-hextile/makefile10
-rw-r--r--3rdparty/bgfx/examples/49-hextile/screenshot.pngbin0 -> 2552337 bytes
-rw-r--r--3rdparty/bgfx/examples/49-hextile/varying.def.sc13
-rw-r--r--3rdparty/bgfx/examples/49-hextile/vs_hextile.sc18
-rw-r--r--3rdparty/bgfx/examples/assets/textures/aerial_rocks_04_diff_2k.jpgbin0 -> 3001368 bytes
-rw-r--r--3rdparty/bgfx/examples/assets/textures/textures.ninja32
-rw-r--r--3rdparty/bgfx/examples/common/aviwriter.h161
-rw-r--r--3rdparty/bgfx/examples/common/bgfx_utils.cpp117
-rw-r--r--3rdparty/bgfx/examples/common/bgfx_utils.h18
-rw-r--r--3rdparty/bgfx/examples/common/bounds.cpp2104
-rw-r--r--3rdparty/bgfx/examples/common/bounds.h450
-rw-r--r--3rdparty/bgfx/examples/common/bounds.inl188
-rw-r--r--3rdparty/bgfx/examples/common/camera.cpp3
-rw-r--r--3rdparty/bgfx/examples/common/camera.h2
-rw-r--r--3rdparty/bgfx/examples/common/common.h4
-rw-r--r--3rdparty/bgfx/examples/common/common.sh4
-rw-r--r--3rdparty/bgfx/examples/common/cube_atlas.cpp38
-rw-r--r--3rdparty/bgfx/examples/common/cube_atlas.h5
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp72
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/debugdraw.h22
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc4
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc4
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.sc4
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc4
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc4
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/makefile4
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc4
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc4
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc4
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc4
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.sc4
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc4
-rw-r--r--3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc4
-rw-r--r--3rdparty/bgfx/examples/common/entry/cmd.cpp23
-rw-r--r--3rdparty/bgfx/examples/common/entry/cmd.h7
-rw-r--r--3rdparty/bgfx/examples/common/entry/dbg.h4
-rw-r--r--3rdparty/bgfx/examples/common/entry/dialog.cpp27
-rw-r--r--3rdparty/bgfx/examples/common/entry/dialog.h4
-rw-r--r--3rdparty/bgfx/examples/common/entry/dialog_darwin.mm2
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry.cpp71
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry.h63
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_android.cpp34
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_glfw.cpp88
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_html5.cpp48
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_ios.mm43
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_noop.cpp15
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_osx.mm28
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_p.h4
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_sdl.cpp61
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_windows.cpp26
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_winrt.cx237
-rw-r--r--3rdparty/bgfx/examples/common/entry/entry_x11.cpp126
-rw-r--r--3rdparty/bgfx/examples/common/entry/input.cpp8
-rw-r--r--3rdparty/bgfx/examples/common/entry/input.h4
-rw-r--r--3rdparty/bgfx/examples/common/example-glue.cpp14
-rw-r--r--3rdparty/bgfx/examples/common/font/font_manager.cpp31
-rw-r--r--3rdparty/bgfx/examples/common/font/font_manager.h4
-rw-r--r--3rdparty/bgfx/examples/common/font/makefile4
-rw-r--r--3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp49
-rw-r--r--3rdparty/bgfx/examples/common/font/text_buffer_manager.h2
-rw-r--r--3rdparty/bgfx/examples/common/font/text_metrics.cpp2
-rw-r--r--3rdparty/bgfx/examples/common/font/text_metrics.h2
-rw-r--r--3rdparty/bgfx/examples/common/imgui/fs_imgui_image.sc2
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.cpp175
-rw-r--r--3rdparty/bgfx/examples/common/imgui/imgui.h10
-rw-r--r--3rdparty/bgfx/examples/common/imgui/makefile4
-rw-r--r--3rdparty/bgfx/examples/common/imgui/varying.def.sc2
-rw-r--r--3rdparty/bgfx/examples/common/imgui/vs_imgui_image.sc2
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/makefile4
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/nanovg.h2
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp17
-rw-r--r--3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.h4
-rw-r--r--3rdparty/bgfx/examples/common/packrect.h4
-rw-r--r--3rdparty/bgfx/examples/common/ps/fs_particle.sc4
-rw-r--r--3rdparty/bgfx/examples/common/ps/makefile4
-rw-r--r--3rdparty/bgfx/examples/common/ps/particle_system.cpp20
-rw-r--r--3rdparty/bgfx/examples/common/ps/particle_system.h9
-rw-r--r--3rdparty/bgfx/examples/common/ps/vs_particle.sc4
-rw-r--r--3rdparty/bgfx/examples/common/shaderlib.sh4
-rw-r--r--3rdparty/bgfx/examples/makefile12
-rwxr-xr-x3rdparty/bgfx/examples/runtime/shaders/dx11/cs_drawindirect.binbin0 -> 2589 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_drawindirect_count.binbin0 -> 2637 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_bilinear_16.binbin0 -> 1304 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_bilinear_32.binbin0 -> 1304 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_easu_16.binbin0 -> 33504 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_easu_32.binbin0 -> 38344 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_rcas_16.binbin0 -> 7729 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_rcas_32.binbin0 -> 6129 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_copy_z.binbin422 -> 456 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_downscale_hi_z.binbin910 -> 914 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_occlude_props.binbin4971 -> 5017 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_stream_compaction.binbin3252 -> 3256 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_clear_uav.binbin294 -> 294 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine.binbin768 -> 776 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine_ta.binbin0 -> 816 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug.binbin364 -> 368 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_line.binbin270 -> 270 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_ta.binbin0 -> 454 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_geom.binbin1530 -> 1540 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light.binbin1448 -> 1462 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light_ta.binbin1488 -> 1502 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light_uav.binbin1564 -> 1578 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_copy_linear_to_gamma.binbin0 -> 474 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_forward.binbin0 -> 2158 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_forward_grid.binbin0 -> 1318 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_gdr_instanced_indirect_rendering.binbin664 -> 672 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hextile.binbin0 -> 8741 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_combine.binbin530 -> 532 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug.binbin530 -> 532 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug_line.binbin522 -> 524 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_geom.binbin2104 -> 2110 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_light.binbin530 -> 532 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_fsr_forward.binbin0 -> 1262 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_fsr_screenquad.binbin0 -> 532 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_gdr_instanced_indirect_rendering.binbin1093 -> 1101 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_gdr_render_occlusion.binbin701 -> 709 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hextile.binbin0 -> 1181 bytes
-rwxr-xr-x3rdparty/bgfx/examples/runtime/shaders/essl/cs_drawindirect.binbin0 -> 3029 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/essl/fs_hextile.binbin0 -> 8061 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/essl/vs_hextile.binbin0 -> 664 bytes
-rwxr-xr-x3rdparty/bgfx/examples/runtime/shaders/glsl/cs_drawindirect.binbin0 -> 3197 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_drawindirect_count.binbin0 -> 3352 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_bilinear_16.binbin0 -> 58590 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_bilinear_32.binbin0 -> 32439 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_easu_16.binbin0 -> 64067 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_easu_32.binbin0 -> 37251 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_rcas_16.binbin0 -> 61163 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_rcas_32.binbin0 -> 34671 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_copy_z.binbin1746 -> 1910 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_downscale_hi_z.binbin2180 -> 2350 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_occlude_props.binbin3735 -> 3885 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_stream_compaction.binbin3800 -> 4057 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_init.binbin2726 -> 2726 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_lod.binbin8013 -> 8011 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_update_draw.binbin1982 -> 1982 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_update_indirect.binbin2032 -> 2032 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_clear_uav.binbin1934 -> 2027 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.binbin695 -> 699 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine_ta.binbin0 -> 772 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug.binbin166 -> 168 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_line.binbin87 -> 87 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_ta.binbin0 -> 287 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_geom.binbin914 -> 920 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.binbin1766 -> 1778 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_ta.binbin1844 -> 1856 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_uav.binbin11904 -> 11996 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_copy_linear_to_gamma.binbin0 -> 324 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_forward.binbin0 -> 1888 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_forward_grid.binbin0 -> 1039 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_gdr_instanced_indirect_rendering.binbin389 -> 407 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hextile.binbin0 -> 7628 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_terrain_render.binbin6032 -> 6144 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/fs_terrain_render_normal.binbin5971 -> 6083 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_combine.binbin313 -> 315 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug.binbin313 -> 315 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug_line.binbin301 -> 303 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_geom.binbin1603 -> 1609 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_light.binbin313 -> 315 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_fsr_forward.binbin0 -> 1034 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_fsr_screenquad.binbin0 -> 319 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_gdr_instanced_indirect_rendering.binbin506 -> 527 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_gdr_render_occlusion.binbin398 -> 402 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hextile.binbin0 -> 610 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/glsl/vs_terrain_render.binbin6655 -> 6706 bytes
-rwxr-xr-x3rdparty/bgfx/examples/runtime/shaders/metal/cs_drawindirect.binbin0 -> 2579 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_drawindirect_count.binbin0 -> 2798 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_16.binbin0 -> 2536 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_32.binbin0 -> 2536 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_16.binbin0 -> 38078 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_32.binbin0 -> 48593 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_16.binbin0 -> 9686 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_32.binbin0 -> 8968 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_copy_z.binbin689 -> 816 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_downscale_hi_z.binbin1148 -> 1235 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_occlude_props.binbin4104 -> 4852 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_stream_compaction.binbin4171 -> 4092 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_indirect.binbin589 -> 562 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_init_instances.binbin8343 -> 7775 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_init.binbin1890 -> 1737 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_lod.binbin11328 -> 11143 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_update_draw.binbin743 -> 682 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_update_indirect.binbin935 -> 872 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_update.binbin1810 -> 1807 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/cs_update_instances.binbin2339 -> 2209 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_albedo_output.binbin470 -> 472 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bloom_combine.binbin865 -> 877 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy.binbin566 -> 572 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy_linear_to_gamma.binbin649 -> 663 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_combine.binbin1012 -> 1196 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_debug.binbin1331 -> 1428 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_downsample.binbin984 -> 998 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_second_pass.binbin2468 -> 2502 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_single_pass.binbin2883 -> 2931 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward.binbin2045 -> 2281 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward_grid.binbin1165 -> 1218 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_linear_depth.binbin727 -> 735 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bump.binbin2706 -> 2843 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_bunnylod.binbin628 -> 634 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_callback.binbin628 -> 634 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_cubes.binbin386 -> 386 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_clear_uav.binbin464 -> 295 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine.binbin1031 -> 1043 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine_ta.binbin0 -> 1110 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug.binbin587 -> 593 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_line.binbin386 -> 386 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_ta.binbin0 -> 772 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_geom.binbin1445 -> 1524 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light.binbin1607 -> 1518 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light_ta.binbin1674 -> 1585 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light_uav.binbin1722 -> 1579 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_apply_lighting.binbin862 -> 888 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_copy.binbin566 -> 572 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_deferred_combine.binbin1694 -> 1754 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_gbuffer.binbin2299 -> 2510 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_3x3.binbin3630 -> 3635 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_5x5.binbin3676 -> 3681 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_temporal.binbin3812 -> 3882 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_txaa.binbin8341 -> 8394 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_downsample.binbin1799 -> 1829 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_copy_linear_to_gamma.binbin0 -> 663 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_forward.binbin0 -> 2281 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_forward_grid.binbin0 -> 1218 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_gdr_instanced_indirect_rendering.binbin763 -> 767 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_blur.binbin1523 -> 1529 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_bright.binbin2654 -> 2714 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lum.binbin3020 -> 3046 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lumavg.binbin3093 -> 3139 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_mesh.binbin2076 -> 1985 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_skybox.binbin1048 -> 947 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_tonemap.binbin3776 -> 3433 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_hextile.binbin0 -> 6819 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.binbin3970 -> 3658 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.binbin2575 -> 2507 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_mesh.binbin1854 -> 1757 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit.binbin389 -> 391 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.binbin884 -> 923 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.binbin928 -> 940 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.binbin807 -> 809 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.binbin928 -> 940 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_particle.binbin795 -> 797 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_picking_id.binbin498 -> 399 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_picking_shaded.binbin1086 -> 984 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_pom.binbin4067 -> 4228 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_raymarching.binbin6901 -> 6915 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_combine.binbin6707 -> 6769 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_gbuffer.binbin679 -> 576 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_lbuffer.binbin1683 -> 1590 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_shadow.binbin660 -> 559 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_screen_space_shadows.binbin3120 -> 3223 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_black.binbin291 -> 291 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.binbin4539 -> 4432 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.binbin9057 -> 8952 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.binbin4556 -> 4445 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.binbin9109 -> 9004 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.binbin6795 -> 6696 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.binbin6779 -> 6679 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.binbin4468 -> 4357 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.binbin8773 -> 8668 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.binbin4481 -> 4374 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.binbin8825 -> 8720 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.binbin6721 -> 6621 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.binbin6708 -> 6605 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.binbin12489 -> 12404 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.binbin48070 -> 47989 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.binbin12400 -> 12315 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.binbin47891 -> 47781 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.binbin14657 -> 14580 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.binbin14592 -> 14515 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.binbin4844 -> 4759 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.binbin10621 -> 10620 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.binbin4857 -> 4772 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.binbin10673 -> 10672 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.binbin7106 -> 7032 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.binbin7087 -> 7016 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.binbin1024 -> 1032 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.binbin2347 -> 2355 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.binbin2709 -> 2719 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.binbin565 -> 564 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.binbin520 -> 522 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm.binbin652 -> 655 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm_linear.binbin598 -> 602 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.binbin587 -> 593 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.binbin829 -> 837 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.binbin789 -> 797 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.binbin2347 -> 2355 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.binbin2709 -> 2719 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_lighting.binbin2507 -> 2454 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_texture.binbin1024 -> 1032 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.binbin291 -> 291 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackcolor.binbin528 -> 428 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex1.binbin897 -> 837 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex2.binbin897 -> 837 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.binbin406 -> 306 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontcolor.binbin528 -> 428 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex1.binbin894 -> 836 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex2.binbin894 -> 836 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svside.binbin934 -> 934 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsideblank.binbin291 -> 291 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidecolor.binbin528 -> 428 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidetex.binbin1165 -> 1167 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture.binbin587 -> 593 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture_lighting.binbin2804 -> 2756 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky.binbin935 -> 951 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky_color_banding_fix.binbin1522 -> 1538 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky_landscape.binbin2025 -> 2009 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.binbin6434 -> 6479 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.binbin6448 -> 6496 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.binbin291 -> 291 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.binbin732 -> 733 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_deferred_combine.binbin3103 -> 3136 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_gbuffer.binbin2329 -> 2577 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_linear_depth.binbin727 -> 735 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_unlit.binbin1046 -> 1075 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_black.binbin291 -> 291 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.binbin2195 -> 2114 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_texture.binbin1024 -> 1032 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture.binbin587 -> 593 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.binbin2528 -> 2454 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain.binbin494 -> 494 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain_render.binbin916 -> 940 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain_render_normal.binbin839 -> 857 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.binbin1638 -> 1796 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_update.binbin582 -> 588 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.binbin761 -> 770 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_cmp.binbin614 -> 620 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_upsample.binbin1550 -> 1560 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blit.binbin791 -> 799 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blur.binbin2185 -> 2233 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_fb.binbin782 -> 790 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_vt_mip.binbin1131 -> 1143 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_vt_unlit.binbin1656 -> 1673 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_mesh.binbin2665 -> 2524 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_wireframe.binbin872 -> 876 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_albedo_output.binbin1320 -> 1324 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_bokeh_forward.binbin1377 -> 1395 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_bokeh_screenquad.binbin699 -> 701 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump.binbin1787 -> 1816 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump_instanced.binbin2146 -> 1990 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_bunnylod.binbin882 -> 886 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_callback.binbin869 -> 873 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_cubes.binbin683 -> 685 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_combine.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug_line.binbin683 -> 685 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_geom.binbin1819 -> 1837 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_light.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_denoise_gbuffer.binbin1720 -> 1734 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_denoise_screenquad.binbin699 -> 701 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_fsr_forward.binbin0 -> 1368 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_fsr_screenquad.binbin0 -> 701 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_fullscreen.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_gdr_instanced_indirect_rendering.binbin1054 -> 1058 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_gdr_render_occlusion.binbin924 -> 928 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_blur.binbin1683 -> 1696 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_bright.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lum.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lumavg.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_mesh.binbin1054 -> 1058 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_skybox.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_tonemap.binbin1702 -> 1721 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_hextile.binbin0 -> 936 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.binbin995 -> 1001 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.binbin1205 -> 1025 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_mesh.binbin1627 -> 1633 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit.binbin858 -> 864 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit_blit.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_particle.binbin1086 -> 1033 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_picking_shaded.binbin1293 -> 1299 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_pom.binbin1652 -> 1678 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_raymarching.binbin840 -> 842 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_combine.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_gbuffer.binbin820 -> 830 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_lbuffer.binbin1760 -> 1800 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_shadow.binbin803 -> 813 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color.binbin538 -> 540 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting.binbin1241 -> 1255 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_csm.binbin2053 -> 2075 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear.binbin1316 -> 1306 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear_csm.binbin2353 -> 2279 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear_omni.binbin2291 -> 2217 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_omni.binbin1991 -> 2013 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_texture.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_depth.binbin538 -> 540 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_hblur.binbin1682 -> 1796 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth.binbin661 -> 663 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.binbin670 -> 673 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture_lighting.binbin1097 -> 1101 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_unpackdepth.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_vblur.binbin1682 -> 1796 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_lighting.binbin944 -> 948 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_texture.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svback.binbin739 -> 749 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svfront.binbin538 -> 540 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svside.binbin1015 -> 1025 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture_lighting.binbin1097 -> 1101 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_sky.binbin2928 -> 2809 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_sky_landscape.binbin947 -> 951 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_mesh.binbin1218 -> 1230 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow.binbin538 -> 540 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow_pd.binbin661 -> 663 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_sss_gbuffer.binbin1127 -> 1137 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_sss_screenquad.binbin699 -> 701 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color.binbin538 -> 540 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_lighting.binbin942 -> 946 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_texture.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture_lighting.binbin1097 -> 1101 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain.binbin806 -> 808 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_height_texture.binbin1159 -> 1173 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_render.binbin2530 -> 2431 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_tree.binbin1228 -> 1232 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_update.binbin695 -> 697 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_vectordisplay_fb.binbin840 -> 842 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_vt_generic.binbin761 -> 765 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_mesh.binbin1131 -> 1137 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_wireframe.binbin925 -> 931 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_apply.binbin4751 -> 4803 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_importance_map.binbin2950 -> 3002 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q0.binbin10535 -> 10617 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q1.binbin13983 -> 14093 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q2.binbin16903 -> 17045 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3.binbin18532 -> 18692 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3base.binbin10447 -> 10585 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_load_counter_clear.binbin554 -> 558 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_apply.binbin2487 -> 2527 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_blur.binbin3451 -> 3523 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_half_apply.binbin2135 -> 2175 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_a.binbin2714 -> 2794 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_b.binbin3346 -> 3422 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depth_mip.binbin5354 -> 5578 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths.binbin3129 -> 3201 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals.binbin14222 -> 15058 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals_half.binbin9406 -> 9954 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_half.binbin2233 -> 2289 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur.binbin3839 -> 3851 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur_wide.binbin4991 -> 5039 bytes
-rwxr-xr-x3rdparty/bgfx/examples/runtime/shaders/spirv/cs_drawindirect.binbin0 -> 4227 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_drawindirect_count.binbin0 -> 4593 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_16.binbin0 -> 4216 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_32.binbin0 -> 4216 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_16.binbin0 -> 66088 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_32.binbin0 -> 68352 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_16.binbin0 -> 17976 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_32.binbin0 -> 12984 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_copy_z.binbin1361 -> 1385 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_downscale_hi_z.binbin2119 -> 2183 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_occlude_props.binbin5781 -> 5581 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_stream_compaction.binbin7007 -> 7075 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_indirect.binbin1226 -> 1230 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_init_instances.binbin10561 -> 10395 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_init.binbin2540 -> 2552 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_lod.binbin12424 -> 12314 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_draw.binbin1626 -> 1632 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_indirect.binbin1173 -> 1177 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_update.binbin1726 -> 1708 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/cs_update_instances.binbin3801 -> 3811 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_albedo_output.binbin1158 -> 692 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_assao_deferred_combine.binbin2700 -> 2708 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_assao_gbuffer.binbin1005 -> 1105 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bloom_combine.binbin1513 -> 1347 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy.binbin864 -> 744 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy_linear_to_gamma.binbin1112 -> 992 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_combine.binbin1591 -> 1629 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_debug.binbin2435 -> 2273 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_downsample.binbin1907 -> 1745 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_second_pass.binbin3860 -> 3722 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_single_pass.binbin4786 -> 4604 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward.binbin3534 -> 3572 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward_grid.binbin2388 -> 2242 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_linear_depth.binbin1369 -> 1251 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bump.binbin5121 -> 5015 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bunnylod.binbin986 -> 926 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_callback.binbin986 -> 926 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_cubes.binbin466 -> 406 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_clear_uav.binbin725 -> 624 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine.binbin1837 -> 1671 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine_ta.binbin0 -> 1815 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug.binbin881 -> 755 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_line.binbin466 -> 406 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_ta.binbin0 -> 1137 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_geom.binbin2749 -> 2513 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light.binbin3004 -> 2862 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_ta.binbin3132 -> 2990 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_uav.binbin3243 -> 3148 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_apply_lighting.binbin1533 -> 1367 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_copy.binbin864 -> 744 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_deferred_combine.binbin2986 -> 2872 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_gbuffer.binbin3900 -> 3902 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_3x3.binbin4308 -> 4070 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_5x5.binbin4420 -> 4182 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_temporal.binbin4738 -> 4444 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_txaa.binbin11172 -> 10586 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_downsample.binbin3378 -> 3264 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_copy_linear_to_gamma.binbin0 -> 992 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward.binbin0 -> 3572 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward_grid.binbin0 -> 2242 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_gdr_instanced_indirect_rendering.binbin1252 -> 1264 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_blur.binbin2133 -> 2023 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_bright.binbin5281 -> 5033 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_lum.binbin4330 -> 4150 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_lumavg.binbin5970 -> 5614 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_mesh.binbin3304 -> 3118 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_skybox.binbin1868 -> 1762 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_tonemap.binbin5036 -> 4706 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hextile.binbin0 -> 7895 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_ibl_mesh.binbin6128 -> 5864 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_ibl_skybox.binbin3632 -> 3456 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_instancing.binbin466 -> 406 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_mesh.binbin2817 -> 2695 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit.binbin710 -> 584 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb.binbin1306 -> 1332 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_blit.binbin1466 -> 1286 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate.binbin1162 -> 1104 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate_blit.binbin1466 -> 1286 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_particle.binbin1439 -> 1365 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_picking_id.binbin991 -> 685 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_picking_shaded.binbin1586 -> 1482 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_pom.binbin4845 -> 4663 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_raymarching.binbin10175 -> 10111 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_combine.binbin9436 -> 9314 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_gbuffer.binbin921 -> 863 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_lbuffer.binbin2738 -> 2644 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_shadow.binbin937 -> 881 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_screen_space_shadows.binbin5177 -> 5197 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_black.binbin438 -> 362 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm.binbin6852 -> 6588 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_csm.binbin11615 -> 11301 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear.binbin6908 -> 6644 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_csm.binbin11839 -> 11525 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_omni.binbin9370 -> 9114 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_omni.binbin9314 -> 9058 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard.binbin6668 -> 6404 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_csm.binbin10927 -> 10613 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear.binbin6724 -> 6460 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_csm.binbin11151 -> 10837 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_omni.binbin9186 -> 8930 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_omni.binbin9130 -> 8874 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf.binbin16472 -> 16208 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_csm.binbin48799 -> 48485 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear.binbin16628 -> 16364 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_csm.binbin49423 -> 49109 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_omni.binbin19126 -> 18870 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_omni.binbin18970 -> 18714 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm.binbin7160 -> 6924 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_csm.binbin12967 -> 12765 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear.binbin7216 -> 6980 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_csm.binbin13191 -> 12989 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_omni.binbin9678 -> 9450 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_omni.binbin9622 -> 9394 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_texture.binbin1737 -> 1613 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur.binbin2651 -> 2545 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur_vsm.binbin3679 -> 3581 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth.binbin854 -> 794 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_linear.binbin750 -> 682 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm.binbin1054 -> 1002 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm_linear.binbin950 -> 890 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_texture.binbin881 -> 755 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth.binbin1485 -> 1357 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth_vsm.binbin1473 -> 1345 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur.binbin2651 -> 2545 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur_vsm.binbin3679 -> 3581 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_lighting.binbin4911 -> 4879 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_texture.binbin1737 -> 1613 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackblank.binbin438 -> 362 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackcolor.binbin746 -> 688 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex1.binbin1158 -> 1082 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex2.binbin1158 -> 1082 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontblank.binbin538 -> 378 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontcolor.binbin746 -> 688 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex1.binbin1142 -> 1066 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex2.binbin1142 -> 1066 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svside.binbin1238 -> 1162 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsideblank.binbin502 -> 362 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidecolor.binbin810 -> 688 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidetex.binbin1661 -> 1587 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture.binbin881 -> 755 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture_lighting.binbin5406 -> 5322 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky.binbin1822 -> 1662 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky_color_banding_fix.binbin2770 -> 2682 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky_landscape.binbin3448 -> 3496 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh.binbin9145 -> 9025 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh_pd.binbin9163 -> 9053 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow.binbin306 -> 362 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow_pd.binbin1217 -> 1159 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_deferred_combine.binbin5024 -> 4788 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_gbuffer.binbin4136 -> 4124 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_linear_depth.binbin1385 -> 1267 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_unlit.binbin2278 -> 2074 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_black.binbin438 -> 362 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_lighting.binbin4029 -> 3985 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_texture.binbin1737 -> 1613 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture.binbin881 -> 755 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture_lighting.binbin4704 -> 4610 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain.binbin742 -> 666 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain_render.binbin1553 -> 1441 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain_render_normal.binbin1533 -> 1421 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_tree.binbin3171 -> 3127 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update.binbin878 -> 754 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update_3d.binbin1476 -> 1344 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update_cmp.binbin1001 -> 875 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_upsample.binbin2702 -> 2590 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blit.binbin1486 -> 1306 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blur.binbin3986 -> 3758 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_fb.binbin1342 -> 1234 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vt_mip.binbin1908 -> 1706 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vt_unlit.binbin2875 -> 2669 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_wf_mesh.binbin3887 -> 3761 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/fs_wf_wireframe.binbin1731 -> 1605 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_albedo_output.binbin2093 -> 1969 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_assao.binbin1128 -> 1080 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_assao_gbuffer.binbin1940 -> 1896 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bokeh_forward.binbin2570 -> 2576 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bokeh_screenquad.binbin1078 -> 1080 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bump.binbin2968 -> 2990 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bump_instanced.binbin3180 -> 3104 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bunnylod.binbin1586 -> 1590 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_callback.binbin1514 -> 1518 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_cubes.binbin1058 -> 1060 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_combine.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug_line.binbin1058 -> 1060 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_geom.binbin3296 -> 3302 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_light.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_denoise_gbuffer.binbin3399 -> 3407 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_denoise_screenquad.binbin1078 -> 1080 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fsr_forward.binbin0 -> 2570 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fsr_screenquad.binbin0 -> 1080 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fullscreen.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_gdr_instanced_indirect_rendering.binbin1577 -> 1529 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_gdr_render_occlusion.binbin1349 -> 1301 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_blur.binbin2658 -> 2662 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_bright.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_lum.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_lumavg.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_mesh.binbin1822 -> 1826 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_skybox.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_tonemap.binbin2414 -> 2438 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hextile.binbin0 -> 1705 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_ibl_mesh.binbin2027 -> 2033 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_ibl_skybox.binbin2050 -> 1976 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_instancing.binbin1485 -> 1485 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_mesh.binbin2713 -> 2671 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_oit.binbin1578 -> 1584 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_oit_blit.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_particle.binbin1985 -> 1975 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_picking_shaded.binbin2097 -> 2103 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_pom.binbin3048 -> 3056 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_raymarching.binbin1268 -> 1270 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_combine.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_gbuffer.binbin1630 -> 1634 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_lbuffer.binbin2813 -> 2779 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_shadow.binbin1490 -> 1494 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color.binbin884 -> 886 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting.binbin2347 -> 2355 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_csm.binbin3624 -> 3640 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear.binbin2427 -> 2435 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_csm.binbin3896 -> 3912 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_omni.binbin3707 -> 3723 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_omni.binbin3435 -> 3451 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_texture.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_depth.binbin884 -> 886 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_hblur.binbin2553 -> 2599 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth.binbin972 -> 974 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth_linear.binbin1060 -> 1054 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture_lighting.binbin1940 -> 1944 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_unpackdepth.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_vblur.binbin2553 -> 2599 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_lighting.binbin1878 -> 1738 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_texture.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svback.binbin1264 -> 1268 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svfront.binbin884 -> 886 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svside.binbin1614 -> 1618 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture_lighting.binbin1940 -> 1944 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sky.binbin4685 -> 4603 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sky_landscape.binbin1768 -> 1772 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_mesh.binbin2193 -> 2199 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow.binbin884 -> 886 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow_pd.binbin972 -> 974 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sss_gbuffer.binbin2084 -> 2088 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sss_screenquad.binbin1078 -> 1080 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color.binbin884 -> 886 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_lighting.binbin1820 -> 1736 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_texture.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture.binbin1094 -> 1096 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture_lighting.binbin1940 -> 1944 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain.binbin1198 -> 1200 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain_height_texture.binbin1688 -> 1630 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain_render.binbin4093 -> 3981 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_tree.binbin2096 -> 2100 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_update.binbin1062 -> 1064 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_vectordisplay_fb.binbin1268 -> 1270 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_vt_generic.binbin1409 -> 1413 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_wf_mesh.binbin2165 -> 2171 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/shaders/spirv/vs_wf_wireframe.binbin1731 -> 1737 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/aerial_rocks_04_diff_2k.ktxbin0 -> 16777327 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/pf_alpha_test.ddsbin0 -> 262272 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/pf_uv_filtering_test.ddsbin0 -> 65664 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x10.ddsbin0 -> 4000 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x5.ddsbin7648 -> 7648 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x6.ddsbin0 -> 6496 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x8.ddsbin0 -> 4736 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_12x10.ddsbin0 -> 3408 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_12x12.ddsbin0 -> 2912 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_4x4.ddsbin22000 -> 22000 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_5x4.ddsbin0 -> 18032 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_5x5.ddsbin14800 -> 14800 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_6x5.ddsbin0 -> 12544 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_6x6.ddsbin10640 -> 10640 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x5.ddsbin9104 -> 9104 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x6.ddsbin7728 -> 7728 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x8.ddsbin0 -> 5632 bytes
-rw-r--r--3rdparty/bgfx/examples/runtime/textures/texture_compression_rgba8.ddsbin0 -> 65664 bytes
-rw-r--r--3rdparty/bgfx/include/bgfx/bgfx.h665
-rw-r--r--3rdparty/bgfx/include/bgfx/c99/bgfx.h282
-rw-r--r--3rdparty/bgfx/include/bgfx/defines.h32
-rw-r--r--3rdparty/bgfx/include/bgfx/embedded_shader.h4
-rw-r--r--3rdparty/bgfx/include/bgfx/platform.h17
-rw-r--r--3rdparty/bgfx/makefile29
-rw-r--r--3rdparty/bgfx/scripts/bgfx.idl244
-rw-r--r--3rdparty/bgfx/scripts/bgfx.lua23
-rw-r--r--3rdparty/bgfx/scripts/bindings-bf.lua2
-rw-r--r--3rdparty/bgfx/scripts/bindings-cs.lua4
-rw-r--r--3rdparty/bgfx/scripts/bindings-d.lua36
-rw-r--r--3rdparty/bgfx/scripts/bindings-zig.lua491
-rw-r--r--3rdparty/bgfx/scripts/build.ninja45
-rw-r--r--3rdparty/bgfx/scripts/codegen.lua4
-rw-r--r--3rdparty/bgfx/scripts/example-common.lua19
-rw-r--r--3rdparty/bgfx/scripts/genie.lua65
-rw-r--r--3rdparty/bgfx/scripts/geometryc.lua8
-rw-r--r--3rdparty/bgfx/scripts/geometryv.lua11
-rw-r--r--3rdparty/bgfx/scripts/shader-embeded.mk14
-rw-r--r--3rdparty/bgfx/scripts/shader.mk6
-rw-r--r--3rdparty/bgfx/scripts/shaderc.lua18
-rw-r--r--3rdparty/bgfx/scripts/temp.bgfx.h4
-rw-r--r--3rdparty/bgfx/scripts/temp.bgfx.idl.inl4
-rw-r--r--3rdparty/bgfx/scripts/temp.defines.h4
-rw-r--r--3rdparty/bgfx/scripts/texturec.lua8
-rw-r--r--3rdparty/bgfx/scripts/texturev.lua11
-rw-r--r--3rdparty/bgfx/scripts/tools.mk4
-rw-r--r--3rdparty/bgfx/src/amalgamated.cpp4
-rw-r--r--3rdparty/bgfx/src/amalgamated.mm4
-rw-r--r--3rdparty/bgfx/src/bgfx.cpp388
-rw-r--r--3rdparty/bgfx/src/bgfx.idl.inl23
-rw-r--r--3rdparty/bgfx/src/bgfx_compute.sh4
-rw-r--r--3rdparty/bgfx/src/bgfx_p.h444
-rw-r--r--3rdparty/bgfx/src/bgfx_shader.sh17
-rw-r--r--3rdparty/bgfx/src/charset.h4
-rw-r--r--3rdparty/bgfx/src/config.h15
-rw-r--r--3rdparty/bgfx/src/debug_renderdoc.cpp8
-rw-r--r--3rdparty/bgfx/src/debug_renderdoc.h4
-rw-r--r--3rdparty/bgfx/src/dxgi.cpp82
-rw-r--r--3rdparty/bgfx/src/dxgi.h9
-rw-r--r--3rdparty/bgfx/src/emscripten.h4
-rw-r--r--3rdparty/bgfx/src/fs_clear0.sc4
-rw-r--r--3rdparty/bgfx/src/fs_clear1.sc4
-rw-r--r--3rdparty/bgfx/src/fs_clear2.sc4
-rw-r--r--3rdparty/bgfx/src/fs_clear3.sc4
-rw-r--r--3rdparty/bgfx/src/fs_clear4.sc4
-rw-r--r--3rdparty/bgfx/src/fs_clear5.sc4
-rw-r--r--3rdparty/bgfx/src/fs_clear6.sc4
-rw-r--r--3rdparty/bgfx/src/fs_clear7.sc4
-rw-r--r--3rdparty/bgfx/src/fs_debugfont.sc4
-rw-r--r--3rdparty/bgfx/src/glcontext_eagl.h9
-rw-r--r--3rdparty/bgfx/src/glcontext_eagl.mm6
-rw-r--r--3rdparty/bgfx/src/glcontext_egl.cpp31
-rw-r--r--3rdparty/bgfx/src/glcontext_egl.h9
-rw-r--r--3rdparty/bgfx/src/glcontext_glx.cpp9
-rw-r--r--3rdparty/bgfx/src/glcontext_glx.h9
-rw-r--r--3rdparty/bgfx/src/glcontext_html5.cpp31
-rw-r--r--3rdparty/bgfx/src/glcontext_html5.h9
-rw-r--r--3rdparty/bgfx/src/glcontext_nsgl.h10
-rw-r--r--3rdparty/bgfx/src/glcontext_nsgl.mm35
-rw-r--r--3rdparty/bgfx/src/glcontext_wgl.cpp8
-rw-r--r--3rdparty/bgfx/src/glcontext_wgl.h9
-rw-r--r--3rdparty/bgfx/src/glimports.h41
-rw-r--r--3rdparty/bgfx/src/makefile4
-rw-r--r--3rdparty/bgfx/src/nvapi.cpp4
-rw-r--r--3rdparty/bgfx/src/nvapi.h4
-rw-r--r--3rdparty/bgfx/src/renderer.h7
-rw-r--r--3rdparty/bgfx/src/renderer_agc.cpp4
-rw-r--r--3rdparty/bgfx/src/renderer_d3d.h8
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.cpp198
-rw-r--r--3rdparty/bgfx/src/renderer_d3d11.h12
-rw-r--r--3rdparty/bgfx/src/renderer_d3d12.cpp875
-rw-r--r--3rdparty/bgfx/src/renderer_d3d12.h38
-rw-r--r--3rdparty/bgfx/src/renderer_d3d9.cpp135
-rw-r--r--3rdparty/bgfx/src/renderer_d3d9.h18
-rw-r--r--3rdparty/bgfx/src/renderer_gl.cpp1183
-rw-r--r--3rdparty/bgfx/src/renderer_gl.h136
-rw-r--r--3rdparty/bgfx/src/renderer_gnm.cpp4
-rw-r--r--3rdparty/bgfx/src/renderer_mtl.h20
-rw-r--r--3rdparty/bgfx/src/renderer_mtl.mm604
-rw-r--r--3rdparty/bgfx/src/renderer_noop.cpp5
-rw-r--r--3rdparty/bgfx/src/renderer_nvn.cpp4
-rw-r--r--3rdparty/bgfx/src/renderer_vk.cpp537
-rw-r--r--3rdparty/bgfx/src/renderer_vk.h232
-rw-r--r--3rdparty/bgfx/src/renderer_webgpu.cpp61
-rw-r--r--3rdparty/bgfx/src/renderer_webgpu.h6
-rw-r--r--3rdparty/bgfx/src/shader.cpp32
-rw-r--r--3rdparty/bgfx/src/shader.h4
-rw-r--r--3rdparty/bgfx/src/shader_dx9bc.cpp6
-rw-r--r--3rdparty/bgfx/src/shader_dx9bc.h4
-rw-r--r--3rdparty/bgfx/src/shader_dxbc.cpp143
-rw-r--r--3rdparty/bgfx/src/shader_dxbc.h74
-rw-r--r--3rdparty/bgfx/src/shader_spirv.cpp4
-rw-r--r--3rdparty/bgfx/src/shader_spirv.h4
-rw-r--r--3rdparty/bgfx/src/topology.cpp4
-rw-r--r--3rdparty/bgfx/src/topology.h4
-rw-r--r--3rdparty/bgfx/src/version.h8
-rw-r--r--3rdparty/bgfx/src/vertexlayout.cpp73
-rw-r--r--3rdparty/bgfx/src/vertexlayout.h7
-rw-r--r--3rdparty/bgfx/src/vs_clear.sc4
-rw-r--r--3rdparty/bgfx/src/vs_debugfont.sc4
-rw-r--r--3rdparty/bgfx/tools/geometryc/geometryc.cpp224
-rw-r--r--3rdparty/bgfx/tools/geometryv/fs_mesh.sc2
-rw-r--r--3rdparty/bgfx/tools/geometryv/geometryv.cpp77
-rw-r--r--3rdparty/bgfx/tools/geometryv/makefile2
-rw-r--r--3rdparty/bgfx/tools/geometryv/vs_mesh.sc2
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc.cpp262
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc.h33
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp47
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp43
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc_metal.cpp66
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc_pssl.cpp4
-rw-r--r--3rdparty/bgfx/tools/shaderc/shaderc_spirv.cpp65
-rw-r--r--3rdparty/bgfx/tools/texturev/common.sh4
-rw-r--r--3rdparty/bgfx/tools/texturev/fs_texture.sc4
-rw-r--r--3rdparty/bgfx/tools/texturev/fs_texture_3d.sc4
-rw-r--r--3rdparty/bgfx/tools/texturev/fs_texture_array.sc4
-rw-r--r--3rdparty/bgfx/tools/texturev/fs_texture_cube.sc4
-rw-r--r--3rdparty/bgfx/tools/texturev/fs_texture_cube2.sc4
-rw-r--r--3rdparty/bgfx/tools/texturev/fs_texture_msdf.sc4
-rw-r--r--3rdparty/bgfx/tools/texturev/fs_texture_sdf.sc4
-rw-r--r--3rdparty/bgfx/tools/texturev/makefile4
-rw-r--r--3rdparty/bgfx/tools/texturev/texturev.cpp52
-rw-r--r--3rdparty/bgfx/tools/texturev/vs_texture.sc4
-rw-r--r--3rdparty/bgfx/tools/texturev/vs_texture_cube.sc4
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/.gitignore5
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/BUILD.bazel29
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/CMakeLists.txt46
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/CONTRIBUTING.md28
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/GoogleTest-CMakeLists.txt.in15
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/README.md71
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/WORKSPACE37
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/cmake-format.json38
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/include/astc-codec/astc-codec.h75
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/.clang-format4
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/BUILD.bazel49
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/CMakeLists.txt27
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/bit_stream.h77
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/bottom_n.h78
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/math_utils.h80
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/optional.h520
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/string_utils.h69
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/test/bit_stream_test.cpp141
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/test/bottom_n_test.cpp108
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/test/math_utils_test.cpp78
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/test/optional_test.cpp481
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/test/string_utils_test.cpp110
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/test/type_traits_test.cpp130
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/test/uint128_test.cpp140
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/type_traits.h172
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/uint128.h175
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/base/utils.h35
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/BUILD.bazel246
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/CMakeLists.txt95
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/astc_file.cc185
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/astc_file.h97
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/codec.cc132
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/codec.h41
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/endpoint_codec.cc963
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/endpoint_codec.h90
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/footprint.cc162
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/footprint.h106
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/integer_sequence_codec.cc574
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/integer_sequence_codec.h169
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/intermediate_astc_block.cc591
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/intermediate_astc_block.h128
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/logical_astc_block.cc262
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/logical_astc_block.h127
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/partition.cc601
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/partition.h97
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/physical_astc_block.cc761
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/physical_astc_block.h128
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/quantization.cc462
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/quantization.h65
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/astc_fuzzer.cc36
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/codec_test.cc181
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/endpoint_codec_test.cc463
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/footprint_test.cc97
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/image_utils.h217
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/integer_sequence_codec_test.cc336
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/intermediate_astc_block_test.cc454
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/logical_astc_block_test.cc273
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/partition_test.cc263
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/physical_astc_block_test.cc361
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/quantization_test.cc288
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/weight_infill_test.cc69
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_4x4.astcbin65552 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_4x4.bmpbin262282 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_5x5.astcbin43280 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_5x5.bmpbin262282 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_6x6.astcbin29600 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_6x6.bmpbin262282 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_8x8.astcbin16400 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_8x8.bmpbin262282 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkerboard.astcbin80 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_10.astcbin1616 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_11.astcbin1952 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_12.astcbin2320 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_4.astcbin272 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_5.astcbin416 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_6.astcbin592 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_7.astcbin800 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_8.astcbin1040 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_9.astcbin1312 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x10.astcbin272 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x10.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x5.astcbin464 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x5.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x6.astcbin400 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x6.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x8.astcbin272 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x8.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x10.astcbin208 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x10.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x12.astcbin160 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x12.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_4x4.astcbin1040 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_4x4.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x4.astcbin912 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x4.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x5.astcbin800 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x5.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x5.astcbin688 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x5.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x6.astcbin592 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x6.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x5.astcbin464 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x5.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x6.astcbin400 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x6.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x8.astcbin272 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x8.bmpbin3210 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_12x12.astcbin7312 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_12x12.bmpbin193674 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_4x4.astcbin64528 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_4x4.bmpbin193674 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_5x4.astcbin51856 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_5x4.bmpbin193674 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_6x6.astcbin29200 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_6x6.bmpbin193674 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_8x8.astcbin16144 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_8x8.bmpbin193674 -> 0 bytes
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/tools/astc_inspector_cli.cc785
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/types.h74
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/weight_infill.cc122
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/src/decoder/weight_infill.h38
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/third_party/BUILD0
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/third_party/honggfuzz.BUILD39
-rwxr-xr-x3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/build.sh76
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/continuous.cfg3
-rw-r--r--3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/presubmit.cfg3
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/LICENSE.txt (renamed from 3rdparty/bimg/3rdparty/astc-codec/LICENSE)29
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/include/astcenc.h834
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_averages_and_directions.cpp995
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_block_sizes.cpp1210
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_color_quantize.cpp2071
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_color_unquantize.cpp941
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_compress_symbolic.cpp1459
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_compute_variance.cpp472
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_decompress_symbolic.cpp623
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_diagnostic_trace.cpp230
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_diagnostic_trace.h219
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_entry.cpp1442
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_find_best_partitioning.cpp776
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_ideal_endpoints_and_weights.cpp1656
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_image.cpp558
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_integer_sequence.cpp744
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_internal.h2185
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_internal_entry.h273
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.cpp48
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.h478
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib_softfloat.cpp (renamed from 3rdparty/bimg/3rdparty/astc/softfloat.cpp)171
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_partition_tables.cpp461
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_percentile_tables.cpp1251
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_pick_best_endpoint_format.cpp1357
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_platform_isa_detection.cpp166
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_quantization.cpp904
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_symbolic_physical.cpp530
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib.h570
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_avx2_8.h1204
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_common_4.h423
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_neon_4.h1073
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_none_4.h1169
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_sse_4.h1283
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_weight_align.cpp479
-rw-r--r--3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_weight_quant_xfer_tables.cpp159
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_averages_and_directions.cpp627
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_block_sizes2.cpp977
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_codec_internals.h816
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_color_quantize.cpp2096
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_color_unquantize.cpp970
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_compress_symbolic.cpp1792
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_compute_variance.cpp524
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_decompress_symbolic.cpp317
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_encoding_choice_error.cpp310
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_find_best_partitioning.cpp865
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_ideal_endpoints_and_weights.cpp2163
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_imageblock.cpp324
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_integer_sequence.cpp649
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_kmeans_partitioning.cpp520
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_lib.cpp565
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_lib.h75
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_partition_tables.cpp323
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_percentile_tables.cpp4768
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_pick_best_endpoint_format.cpp938
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_quantization.cpp558
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_symbolic_physical.cpp431
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_weight_align.cpp600
-rw-r--r--3rdparty/bimg/3rdparty/astc/astc_weight_quant_xfer_tables.cpp1003
-rw-r--r--3rdparty/bimg/3rdparty/astc/license.txt137
-rw-r--r--3rdparty/bimg/3rdparty/astc/mathlib.cpp781
-rw-r--r--3rdparty/bimg/3rdparty/astc/mathlib.h200
-rw-r--r--3rdparty/bimg/3rdparty/astc/readme.txt1
-rw-r--r--3rdparty/bimg/3rdparty/astc/softfloat.h95
-rw-r--r--3rdparty/bimg/3rdparty/astc/vectypes.h16209
-rw-r--r--3rdparty/bimg/3rdparty/nvtt/nvtt.cpp4
-rw-r--r--3rdparty/bimg/LICENSE2
-rw-r--r--3rdparty/bimg/README.md2
-rw-r--r--3rdparty/bimg/include/bimg/bimg.h15
-rw-r--r--3rdparty/bimg/include/bimg/decode.h4
-rw-r--r--3rdparty/bimg/include/bimg/encode.h4
-rw-r--r--3rdparty/bimg/makefile12
-rw-r--r--3rdparty/bimg/scripts/bimg.lua29
-rw-r--r--3rdparty/bimg/scripts/bimg_decode.lua5
-rw-r--r--3rdparty/bimg/scripts/bimg_encode.lua16
-rw-r--r--3rdparty/bimg/scripts/genie.lua8
-rw-r--r--3rdparty/bimg/scripts/texturec.lua8
-rw-r--r--3rdparty/bimg/src/bimg_p.h39
-rw-r--r--3rdparty/bimg/src/config.h4
-rw-r--r--3rdparty/bimg/src/image.cpp312
-rw-r--r--3rdparty/bimg/src/image_cubemap_filter.cpp22
-rw-r--r--3rdparty/bimg/src/image_decode.cpp8
-rw-r--r--3rdparty/bimg/src/image_encode.cpp116
-rw-r--r--3rdparty/bimg/src/image_gnf.cpp6
-rw-r--r--3rdparty/bimg/tools/texturec/texturec.cpp8
-rw-r--r--3rdparty/bx/3rdparty/catch/catch.hpp17881
-rw-r--r--3rdparty/bx/3rdparty/catch/catch_amalgamated.cpp10360
-rw-r--r--3rdparty/bx/3rdparty/catch/catch_amalgamated.hpp12233
-rw-r--r--3rdparty/bx/LICENSE2
-rw-r--r--3rdparty/bx/README.md2
-rw-r--r--3rdparty/bx/include/bx/allocator.h27
-rw-r--r--3rdparty/bx/include/bx/bounds.h526
-rw-r--r--3rdparty/bx/include/bx/bx.h150
-rw-r--r--3rdparty/bx/include/bx/commandline.h4
-rw-r--r--3rdparty/bx/include/bx/config.h12
-rw-r--r--3rdparty/bx/include/bx/constants.h70
-rw-r--r--3rdparty/bx/include/bx/cpu.h4
-rw-r--r--3rdparty/bx/include/bx/debug.h8
-rw-r--r--3rdparty/bx/include/bx/easing.h4
-rw-r--r--3rdparty/bx/include/bx/endian.h12
-rw-r--r--3rdparty/bx/include/bx/error.h37
-rw-r--r--3rdparty/bx/include/bx/file.h14
-rw-r--r--3rdparty/bx/include/bx/filepath.h4
-rw-r--r--3rdparty/bx/include/bx/float4x4_t.h4
-rw-r--r--3rdparty/bx/include/bx/handlealloc.h4
-rw-r--r--3rdparty/bx/include/bx/hash.h98
-rw-r--r--3rdparty/bx/include/bx/inline/allocator.inl6
-rw-r--r--3rdparty/bx/include/bx/inline/bounds.inl257
-rw-r--r--3rdparty/bx/include/bx/inline/bx.inl102
-rw-r--r--3rdparty/bx/include/bx/inline/cpu.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/easing.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/endian.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/error.inl56
-rw-r--r--3rdparty/bx/include/bx/inline/float4x4_t.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/handlealloc.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/hash.inl182
-rw-r--r--3rdparty/bx/include/bx/inline/math.inl139
-rw-r--r--3rdparty/bx/include/bx/inline/mpscqueue.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/mutex.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/os.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/pixelformat.inl39
-rw-r--r--3rdparty/bx/include/bx/inline/readerwriter.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/ringbuffer.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/rng.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/simd128_langext.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/simd128_neon.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/simd128_ref.inl12
-rw-r--r--3rdparty/bx/include/bx/inline/simd128_sse.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/simd128_swizzle.inl2
-rw-r--r--3rdparty/bx/include/bx/inline/simd256_avx.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/simd256_ref.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/simd_ni.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/sort.inl110
-rw-r--r--3rdparty/bx/include/bx/inline/spscqueue.inl4
-rw-r--r--3rdparty/bx/include/bx/inline/string.inl115
-rw-r--r--3rdparty/bx/include/bx/inline/typetraits.inl462
-rw-r--r--3rdparty/bx/include/bx/inline/uint32_t.inl73
-rw-r--r--3rdparty/bx/include/bx/macros.h72
-rw-r--r--3rdparty/bx/include/bx/maputil.h4
-rw-r--r--3rdparty/bx/include/bx/math.h120
-rw-r--r--3rdparty/bx/include/bx/mpscqueue.h8
-rw-r--r--3rdparty/bx/include/bx/mutex.h6
-rw-r--r--3rdparty/bx/include/bx/os.h8
-rw-r--r--3rdparty/bx/include/bx/pixelformat.h10
-rw-r--r--3rdparty/bx/include/bx/platform.h39
-rw-r--r--3rdparty/bx/include/bx/process.h4
-rw-r--r--3rdparty/bx/include/bx/readerwriter.h50
-rw-r--r--3rdparty/bx/include/bx/ringbuffer.h10
-rw-r--r--3rdparty/bx/include/bx/rng.h4
-rw-r--r--3rdparty/bx/include/bx/semaphore.h5
-rw-r--r--3rdparty/bx/include/bx/settings.h8
-rw-r--r--3rdparty/bx/include/bx/simd_t.h4
-rw-r--r--3rdparty/bx/include/bx/sort.h277
-rw-r--r--3rdparty/bx/include/bx/spscqueue.h12
-rw-r--r--3rdparty/bx/include/bx/string.h72
-rw-r--r--3rdparty/bx/include/bx/thread.h5
-rw-r--r--3rdparty/bx/include/bx/timer.h4
-rw-r--r--3rdparty/bx/include/bx/typetraits.h285
-rw-r--r--3rdparty/bx/include/bx/uint32_t.h40
-rw-r--r--3rdparty/bx/include/bx/url.h4
-rw-r--r--3rdparty/bx/include/compat/linux/sal.h1
-rw-r--r--3rdparty/bx/include/compat/mingw/salieri.h16
-rw-r--r--3rdparty/bx/makefile12
-rw-r--r--3rdparty/bx/scripts/bin2c.lua16
-rw-r--r--3rdparty/bx/scripts/bx.lua42
-rw-r--r--3rdparty/bx/scripts/genie.lua24
-rw-r--r--3rdparty/bx/scripts/lemon.lua4
-rw-r--r--3rdparty/bx/scripts/toolchain.lua305
-rw-r--r--3rdparty/bx/src/allocator.cpp11
-rw-r--r--3rdparty/bx/src/amalgamated.cpp5
-rw-r--r--3rdparty/bx/src/bounds.cpp2039
-rw-r--r--3rdparty/bx/src/bx.cpp25
-rw-r--r--3rdparty/bx/src/bx_p.h45
-rw-r--r--3rdparty/bx/src/commandline.cpp7
-rw-r--r--3rdparty/bx/src/crtnone.cpp20
-rw-r--r--3rdparty/bx/src/debug.cpp5
-rw-r--r--3rdparty/bx/src/dtoa.cpp7
-rw-r--r--3rdparty/bx/src/easing.cpp5
-rw-r--r--3rdparty/bx/src/file.cpp15
-rw-r--r--3rdparty/bx/src/filepath.cpp5
-rw-r--r--3rdparty/bx/src/hash.cpp125
-rw-r--r--3rdparty/bx/src/math.cpp63
-rw-r--r--3rdparty/bx/src/mutex.cpp17
-rw-r--r--3rdparty/bx/src/os.cpp32
-rw-r--r--3rdparty/bx/src/process.cpp5
-rw-r--r--3rdparty/bx/src/semaphore.cpp8
-rw-r--r--3rdparty/bx/src/settings.cpp5
-rw-r--r--3rdparty/bx/src/sort.cpp124
-rw-r--r--3rdparty/bx/src/string.cpp148
-rw-r--r--3rdparty/bx/src/thread.cpp17
-rw-r--r--3rdparty/bx/src/timer.cpp8
-rw-r--r--3rdparty/bx/src/url.cpp3
-rw-r--r--3rdparty/bx/tests/allocator_test.cpp78
-rw-r--r--3rdparty/bx/tests/atomic_test.cpp4
-rw-r--r--3rdparty/bx/tests/crt_test.cpp27
-rw-r--r--3rdparty/bx/tests/dbg.h4
-rw-r--r--3rdparty/bx/tests/easing_test.cpp6
-rw-r--r--3rdparty/bx/tests/filepath_test.cpp4
-rw-r--r--3rdparty/bx/tests/handle_bench.cpp4
-rw-r--r--3rdparty/bx/tests/handle_test.cpp4
-rw-r--r--3rdparty/bx/tests/hash_test.cpp111
-rw-r--r--3rdparty/bx/tests/macros_test.cpp31
-rw-r--r--3rdparty/bx/tests/main_test.cpp4
-rw-r--r--3rdparty/bx/tests/math_bench.cpp4
-rw-r--r--3rdparty/bx/tests/math_test.cpp188
-rw-r--r--3rdparty/bx/tests/nlalloc_test.cpp229
-rw-r--r--3rdparty/bx/tests/os_test.cpp18
-rw-r--r--3rdparty/bx/tests/queue_test.cpp4
-rw-r--r--3rdparty/bx/tests/readerwriter_test.cpp4
-rw-r--r--3rdparty/bx/tests/ringbuffer_test.cpp4
-rw-r--r--3rdparty/bx/tests/rng_test.cpp4
-rw-r--r--3rdparty/bx/tests/run_test.cpp16
-rw-r--r--3rdparty/bx/tests/settings_test.cpp12
-rw-r--r--3rdparty/bx/tests/simd_bench.cpp4
-rw-r--r--3rdparty/bx/tests/simd_test.cpp28
-rw-r--r--3rdparty/bx/tests/sort_test.cpp148
-rw-r--r--3rdparty/bx/tests/string_test.cpp65
-rw-r--r--3rdparty/bx/tests/test.h12
-rw-r--r--3rdparty/bx/tests/thread_test.cpp8
-rw-r--r--3rdparty/bx/tests/tokenizecmd_test.cpp4
-rw-r--r--3rdparty/bx/tests/typetraits_test.cpp688
-rw-r--r--3rdparty/bx/tests/uint32_test.cpp6
-rw-r--r--3rdparty/bx/tests/url_test.cpp4
-rw-r--r--3rdparty/bx/tests/vsnprintf_test.cpp104
-rwxr-xr-x3rdparty/bx/tools/bin/darwin/geniebin549136 -> 549032 bytes
-rw-r--r--3rdparty/bx/tools/bin/darwin/lempar.c2
-rwxr-xr-x3rdparty/bx/tools/bin/linux/bin2cbin88112 -> 96464 bytes
-rwxr-xr-x3rdparty/bx/tools/bin/linux/geniebin543624 -> 547720 bytes
-rwxr-xr-x3rdparty/bx/tools/bin/linux/lemonbin84576 -> 84728 bytes
-rw-r--r--3rdparty/bx/tools/bin/linux/lempar.c2
-rw-r--r--3rdparty/bx/tools/bin/windows/genie.exebin547328 -> 551936 bytes
-rw-r--r--3rdparty/bx/tools/bin/windows/lempar.c2
-rw-r--r--3rdparty/bx/tools/bin2c/bin2c.cpp12
-rw-r--r--3rdparty/bx/tools/lemon/lemon.c6
-rw-r--r--3rdparty/bx/tools/lemon/lempar.c2
-rw-r--r--bgfx/shaders/essl/chains/blurs/vs_smart-blur.binbin1190 -> 1190 bytes
-rw-r--r--bgfx/shaders/essl/chains/crt-geom/vs_crt-geom.binbin5042 -> 5042 bytes
-rw-r--r--bgfx/shaders/essl/chains/crt-geom/vs_gaussx.binbin832 -> 832 bytes
-rw-r--r--bgfx/shaders/essl/chains/crt-geom/vs_gaussy.binbin832 -> 832 bytes
-rw-r--r--bgfx/shaders/essl/chains/crt-geom/vs_lowpass.binbin2722 -> 2722 bytes
-rw-r--r--bgfx/shaders/essl/chains/crt-geom/vs_mipmap8.binbin342 -> 342 bytes
-rw-r--r--bgfx/shaders/essl/chains/crt-geom/vs_phosphor_apply.binbin342 -> 342 bytes
-rw-r--r--bgfx/shaders/essl/chains/crt-geom/vs_phosphor_update.binbin342 -> 342 bytes
-rw-r--r--bgfx/shaders/essl/chains/crt/vs_crt-caligari.binbin741 -> 741 bytes
-rw-r--r--bgfx/shaders/essl/chains/default/vs_blit.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/eagle/vs_eagle.binbin2453 -> 2453 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/vs_chroma.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/vs_color.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/vs_deconverge.binbin1506 -> 1506 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/vs_defocus.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/vs_distortion.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/vs_ntsc_decode.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/vs_ntsc_encode.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/vs_phosphor.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/vs_post.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/vs_prescale.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/hlsl/vs_scanline.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/hqx/vs_hq2x.binbin1190 -> 1190 bytes
-rw-r--r--bgfx/shaders/essl/chains/hqx/vs_hq3x.binbin1190 -> 1190 bytes
-rw-r--r--bgfx/shaders/essl/chains/hqx/vs_hq4x.binbin1190 -> 1190 bytes
-rw-r--r--bgfx/shaders/essl/chains/lcd-grid/vs_lcd-grid.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/lcd-grid/vs_persistence.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/misc/vs_blit.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/misc/vs_bob-and-ghost-deinterlace.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/misc/vs_deposterize-pass0.binbin755 -> 755 bytes
-rw-r--r--bgfx/shaders/essl/chains/misc/vs_deposterize-pass1.binbin755 -> 755 bytes
-rw-r--r--bgfx/shaders/essl/chains/misc/vs_lut.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/misc/vs_saturation.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/pillarbox_left_horizontal/vs_gaussian.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/pillarbox_left_horizontal/vs_offset_sat.binbin466 -> 466 bytes
-rw-r--r--bgfx/shaders/essl/chains/pillarbox_left_vertical/vs_gaussian.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/pillarbox_left_vertical/vs_offset_sat.binbin471 -> 471 bytes
-rw-r--r--bgfx/shaders/essl/chains/pillarbox_right_horizontal/vs_gaussian.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/pillarbox_right_horizontal/vs_offset_sat.binbin467 -> 467 bytes
-rw-r--r--bgfx/shaders/essl/chains/pillarbox_right_vertical/vs_gaussian.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/pillarbox_right_vertical/vs_offset_sat.binbin477 -> 477 bytes
-rw-r--r--bgfx/shaders/essl/chains/unfiltered/vs_blit.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/warp/vs_dilation-horizontal-fast.binbin634 -> 634 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_custom-jinc2-sharper.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.binbin1427 -> 1427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.binbin1427 -> 1427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.binbin1427 -> 1427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass0.binbin1448 -> 1448 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass1.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass2.binbin1427 -> 1427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass3.binbin1427 -> 1427 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/vs_xbr-lv1-noblend.binbin777 -> 777 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-3d.binbin2152 -> 2152 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-fast.binbin1190 -> 1190 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-noblend.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/vs_xbr-lv2.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/vs_xbr-lv3-noblend.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/vs_xbr-lv3.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.binbin923 -> 923 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.binbin923 -> 923 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.binbin923 -> 923 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.binbin987 -> 987 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.binbin555 -> 555 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.binbin2099 -> 2099 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.binbin708 -> 708 bytes
-rw-r--r--bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.binbin708 -> 708 bytes
-rw-r--r--bgfx/shaders/essl/vs_gui.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/essl/vs_screen.binbin427 -> 427 bytes
-rw-r--r--bgfx/shaders/glsl/chains/blurs/vs_smart-blur.binbin1094 -> 1094 bytes
-rw-r--r--bgfx/shaders/glsl/chains/crt-geom/vs_crt-geom.binbin4730 -> 4730 bytes
-rw-r--r--bgfx/shaders/glsl/chains/crt-geom/vs_gaussx.binbin766 -> 766 bytes
-rw-r--r--bgfx/shaders/glsl/chains/crt-geom/vs_gaussy.binbin766 -> 766 bytes
-rw-r--r--bgfx/shaders/glsl/chains/crt-geom/vs_lowpass.binbin2632 -> 2632 bytes
-rw-r--r--bgfx/shaders/glsl/chains/crt-geom/vs_mipmap8.binbin312 -> 312 bytes
-rw-r--r--bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_apply.binbin312 -> 312 bytes
-rw-r--r--bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_update.binbin312 -> 312 bytes
-rw-r--r--bgfx/shaders/glsl/chains/crt/vs_crt-caligari.binbin675 -> 675 bytes
-rw-r--r--bgfx/shaders/glsl/chains/default/vs_blit.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/eagle/vs_eagle.binbin2261 -> 2261 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/vs_chroma.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/vs_color.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/vs_deconverge.binbin1392 -> 1392 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/vs_defocus.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/vs_distortion.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/vs_ntsc_decode.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/vs_ntsc_encode.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/vs_phosphor.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/vs_post.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/vs_prescale.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hlsl/vs_scanline.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hqx/vs_hq2x.binbin1094 -> 1094 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hqx/vs_hq3x.binbin1094 -> 1094 bytes
-rw-r--r--bgfx/shaders/glsl/chains/hqx/vs_hq4x.binbin1094 -> 1094 bytes
-rw-r--r--bgfx/shaders/glsl/chains/lcd-grid/vs_lcd-grid.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/lcd-grid/vs_persistence.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/misc/vs_blit.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/misc/vs_bob-and-ghost-deinterlace.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/misc/vs_deposterize-pass0.binbin689 -> 689 bytes
-rw-r--r--bgfx/shaders/glsl/chains/misc/vs_deposterize-pass1.binbin689 -> 689 bytes
-rw-r--r--bgfx/shaders/glsl/chains/misc/vs_lut.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/misc/vs_saturation.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/pillarbox_left_horizontal/vs_gaussian.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/pillarbox_left_horizontal/vs_offset_sat.binbin424 -> 424 bytes
-rw-r--r--bgfx/shaders/glsl/chains/pillarbox_left_vertical/vs_gaussian.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/pillarbox_left_vertical/vs_offset_sat.binbin429 -> 429 bytes
-rw-r--r--bgfx/shaders/glsl/chains/pillarbox_right_horizontal/vs_gaussian.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/pillarbox_right_horizontal/vs_offset_sat.binbin425 -> 425 bytes
-rw-r--r--bgfx/shaders/glsl/chains/pillarbox_right_vertical/vs_gaussian.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/pillarbox_right_vertical/vs_offset_sat.binbin435 -> 435 bytes
-rw-r--r--bgfx/shaders/glsl/chains/unfiltered/vs_blit.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/warp/vs_dilation-horizontal-fast.binbin574 -> 574 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_custom-jinc2-sharper.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.binbin1313 -> 1313 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.binbin1313 -> 1313 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.binbin1313 -> 1313 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass0.binbin1334 -> 1334 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass1.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass2.binbin1313 -> 1313 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass3.binbin1313 -> 1313 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/vs_xbr-lv1-noblend.binbin705 -> 705 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-3d.binbin1996 -> 1996 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-fast.binbin1094 -> 1094 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-noblend.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/vs_xbr-lv3-noblend.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/vs_xbr-lv3.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.binbin845 -> 845 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.binbin845 -> 845 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.binbin845 -> 845 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.binbin903 -> 903 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.binbin501 -> 501 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.binbin1949 -> 1949 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.binbin642 -> 642 bytes
-rw-r--r--bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.binbin642 -> 642 bytes
-rw-r--r--bgfx/shaders/glsl/vs_gui.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/glsl/vs_screen.binbin385 -> 385 bytes
-rw-r--r--bgfx/shaders/metal/chains/blurs/fs_smart-blur.binbin2919 -> 2939 bytes
-rw-r--r--bgfx/shaders/metal/chains/crt-geom/fs_crt-geom-deluxe.binbin15960 -> 15906 bytes
-rw-r--r--bgfx/shaders/metal/chains/crt-geom/fs_crt-geom.binbin12535 -> 12613 bytes
-rw-r--r--bgfx/shaders/metal/chains/crt-geom/fs_gaussx.binbin3485 -> 3535 bytes
-rw-r--r--bgfx/shaders/metal/chains/crt-geom/fs_gaussy.binbin3485 -> 3535 bytes
-rw-r--r--bgfx/shaders/metal/chains/crt-geom/fs_lowpass.binbin4650 -> 4656 bytes
-rw-r--r--bgfx/shaders/metal/chains/crt-geom/fs_mipmap8.binbin18279 -> 18204 bytes
-rw-r--r--bgfx/shaders/metal/chains/crt-geom/fs_phosphor_apply.binbin1711 -> 1711 bytes
-rw-r--r--bgfx/shaders/metal/chains/crt-geom/fs_phosphor_update.binbin2107 -> 2106 bytes
-rw-r--r--bgfx/shaders/metal/chains/crt-geom/vs_crt-geom.binbin4154 -> 4134 bytes
-rw-r--r--bgfx/shaders/metal/chains/crt-geom/vs_lowpass.binbin4327 -> 3457 bytes
-rw-r--r--bgfx/shaders/metal/chains/crt/fs_crt-caligari.binbin2744 -> 2745 bytes
-rw-r--r--bgfx/shaders/metal/chains/crt/vs_crt-caligari.binbin1214 -> 1061 bytes
-rw-r--r--bgfx/shaders/metal/chains/eagle/fs_eagle.binbin11380 -> 11318 bytes
-rw-r--r--bgfx/shaders/metal/chains/eagle/vs_eagle.binbin3943 -> 2372 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_chroma.binbin1797 -> 1741 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_color.binbin1317 -> 1318 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_defocus.binbin1938 -> 1906 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_distortion.binbin4626 -> 4478 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_ntsc_decode.binbin4769 -> 4599 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_ntsc_encode.binbin3231 -> 3230 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_post.binbin5209 -> 4865 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/fs_scanline.binbin3113 -> 3030 bytes
-rw-r--r--bgfx/shaders/metal/chains/hlsl/vs_deconverge.binbin2064 -> 2046 bytes
-rw-r--r--bgfx/shaders/metal/chains/hqx/fs_hq2x.binbin8133 -> 8117 bytes
-rw-r--r--bgfx/shaders/metal/chains/hqx/fs_hq3x.binbin8188 -> 8172 bytes
-rw-r--r--bgfx/shaders/metal/chains/hqx/fs_hq4x.binbin8113 -> 8097 bytes
-rw-r--r--bgfx/shaders/metal/chains/lcd-grid/fs_lcd-grid.binbin10120 -> 9976 bytes
-rw-r--r--bgfx/shaders/metal/chains/misc/fs_blit_palette16.binbin2007 -> 1815 bytes
-rw-r--r--bgfx/shaders/metal/chains/misc/fs_blit_yuy16.binbin1923 -> 2036 bytes
-rw-r--r--bgfx/shaders/metal/chains/misc/fs_bob-and-ghost-deinterlace.binbin1733 -> 1733 bytes
-rw-r--r--bgfx/shaders/metal/chains/misc/fs_lut.binbin1434 -> 1490 bytes
-rw-r--r--bgfx/shaders/metal/chains/pillarbox_left_horizontal/fs_gaussian.binbin3335 -> 3354 bytes
-rw-r--r--bgfx/shaders/metal/chains/pillarbox_left_horizontal/vs_offset_sat.binbin944 -> 945 bytes
-rw-r--r--bgfx/shaders/metal/chains/pillarbox_left_vertical/fs_gaussian.binbin3335 -> 3354 bytes
-rw-r--r--bgfx/shaders/metal/chains/pillarbox_left_vertical/vs_offset_sat.binbin942 -> 943 bytes
-rw-r--r--bgfx/shaders/metal/chains/pillarbox_right_horizontal/fs_gaussian.binbin3335 -> 3354 bytes
-rw-r--r--bgfx/shaders/metal/chains/pillarbox_right_horizontal/vs_offset_sat.binbin950 -> 951 bytes
-rw-r--r--bgfx/shaders/metal/chains/pillarbox_right_vertical/fs_gaussian.binbin3335 -> 3354 bytes
-rw-r--r--bgfx/shaders/metal/chains/pillarbox_right_vertical/vs_offset_sat.binbin971 -> 972 bytes
-rw-r--r--bgfx/shaders/metal/chains/warp/fs_dilation-horizontal-fast.binbin820 -> 818 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/fs_xbr-lv1-noblend.binbin4547 -> 4785 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-3d.binbin8137 -> 7968 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-fast.binbin4660 -> 4471 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-noblend.binbin5602 -> 5462 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/fs_xbr-lv2.binbin6071 -> 5902 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/fs_xbr-lv3-noblend.binbin7543 -> 7114 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/fs_xbr-lv3.binbin10102 -> 9531 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_custom-jinc2-sharper.binbin5447 -> 5805 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.binbin7161 -> 7199 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.binbin7532 -> 7580 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.binbin6799 -> 6841 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.binbin7163 -> 7201 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.binbin7522 -> 7570 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.binbin6788 -> 6830 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.binbin7161 -> 7199 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.binbin7520 -> 7568 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.binbin6787 -> 6829 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.binbin5089 -> 5105 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.binbin4869 -> 4895 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.binbin4536 -> 4550 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass0.binbin5337 -> 5341 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass1.binbin6754 -> 6772 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass2.binbin5167 -> 5183 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/vs_xbr-lv1-noblend.binbin1223 -> 1070 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.binbin16386 -> 16011 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.binbin8185 -> 7802 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.binbin8028 -> 7645 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.binbin9749 -> 9206 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.binbin9310 -> 8853 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.binbin9096 -> 8617 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.binbin9899 -> 9520 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.binbin16342 -> 15967 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.binbin3676 -> 3368 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.binbin13828 -> 14206 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.binbin6195 -> 5690 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.binbin3947 -> 3610 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.binbin4301 -> 3986 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.binbin4383 -> 3854 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.binbin4421 -> 3959 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.binbin5136 -> 4648 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.binbin16852 -> 16171 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.binbin5624 -> 5575 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.binbin12120 -> 11490 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.binbin6985 -> 6349 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.binbin7618 -> 6581 bytes
-rw-r--r--bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.binbin7036 -> 6087 bytes
-rw-r--r--bgfx/shaders/spirv/chains/blurs/fs_smart-blur.binbin5391 -> 5203 bytes
-rw-r--r--bgfx/shaders/spirv/chains/blurs/vs_smart-blur.binbin2083 -> 2083 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom-deluxe.binbin24660 -> 24512 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom.binbin19259 -> 19139 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/fs_gaussx.binbin7294 -> 7106 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/fs_gaussy.binbin7310 -> 7122 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/fs_lowpass.binbin7779 -> 7607 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/fs_mipmap8.binbin25947 -> 25863 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_apply.binbin3094 -> 3002 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_update.binbin3495 -> 3395 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/vs_crt-geom.binbin8384 -> 8328 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/vs_gaussx.binbin2224 -> 2152 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/vs_gaussy.binbin2240 -> 2168 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/vs_lowpass.binbin4700 -> 4424 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/vs_mipmap8.binbin1157 -> 1085 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_apply.binbin1157 -> 1085 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_update.binbin1157 -> 1085 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt/fs_crt-caligari.binbin4656 -> 4548 bytes
-rw-r--r--bgfx/shaders/spirv/chains/crt/vs_crt-caligari.binbin1745 -> 1649 bytes
-rw-r--r--bgfx/shaders/spirv/chains/default/fs_blit.binbin910 -> 850 bytes
-rw-r--r--bgfx/shaders/spirv/chains/default/vs_blit.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/eagle/fs_eagle.binbin9068 -> 8904 bytes
-rw-r--r--bgfx/shaders/spirv/chains/eagle/vs_eagle.binbin4355 -> 3879 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_chroma.binbin3156 -> 3096 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_color.binbin2459 -> 2319 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_deconverge.binbin1354 -> 1294 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_defocus.binbin2446 -> 2322 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_distortion.binbin7738 -> 7594 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_ntsc_decode.binbin7320 -> 7204 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_ntsc_encode.binbin3805 -> 3617 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_phosphor.binbin1940 -> 1808 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_post.binbin7919 -> 7851 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_prescale.binbin956 -> 896 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/fs_scanline.binbin5375 -> 5259 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_chroma.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_color.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_deconverge.binbin3294 -> 3246 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_defocus.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_distortion.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_phosphor.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_post.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_prescale.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hlsl/vs_scanline.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hqx/fs_hq2x.binbin12130 -> 11934 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hqx/fs_hq3x.binbin12162 -> 11966 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hqx/fs_hq4x.binbin12098 -> 11902 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hqx/vs_hq2x.binbin2083 -> 2083 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hqx/vs_hq3x.binbin2083 -> 2083 bytes
-rw-r--r--bgfx/shaders/spirv/chains/hqx/vs_hq4x.binbin2083 -> 2083 bytes
-rw-r--r--bgfx/shaders/spirv/chains/lcd-grid/fs_lcd-grid.binbin14483 -> 13747 bytes
-rw-r--r--bgfx/shaders/spirv/chains/lcd-grid/fs_persistence.binbin1500 -> 1368 bytes
-rw-r--r--bgfx/shaders/spirv/chains/lcd-grid/vs_lcd-grid.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/lcd-grid/vs_persistence.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/fs_blit.binbin910 -> 850 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/fs_blit_bcg.binbin2072 -> 2012 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/fs_blit_palette16.binbin3392 -> 3216 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/fs_blit_rgb32.binbin1014 -> 954 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/fs_blit_yuy16.binbin2950 -> 2890 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/fs_bob-and-ghost-deinterlace.binbin2833 -> 2709 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/fs_deposterize-pass0.binbin2586 -> 2398 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/fs_deposterize-pass1.binbin2586 -> 2398 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/fs_lut.binbin2464 -> 2424 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/fs_saturation.binbin1545 -> 1413 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/vs_blit.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/vs_bob-and-ghost-deinterlace.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/vs_deposterize-pass0.binbin1727 -> 1727 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/vs_deposterize-pass1.binbin1727 -> 1727 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/vs_lut.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/misc/vs_saturation.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_left_horizontal/fs_gaussian.binbin4985 -> 4785 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_left_horizontal/fs_offset_sat.binbin1545 -> 1413 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_gaussian.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_offset_sat.binbin1385 -> 1377 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_left_vertical/fs_gaussian.binbin4985 -> 4785 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_left_vertical/fs_offset_sat.binbin1545 -> 1413 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_gaussian.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_offset_sat.binbin1385 -> 1377 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_right_horizontal/fs_gaussian.binbin4985 -> 4785 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_right_horizontal/fs_offset_sat.binbin1545 -> 1413 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_gaussian.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_offset_sat.binbin1401 -> 1393 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_right_vertical/fs_gaussian.binbin4985 -> 4785 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_right_vertical/fs_offset_sat.binbin1545 -> 1413 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_gaussian.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_offset_sat.binbin1401 -> 1393 bytes
-rw-r--r--bgfx/shaders/spirv/chains/unfiltered/fs_blit.binbin910 -> 850 bytes
-rw-r--r--bgfx/shaders/spirv/chains/unfiltered/vs_blit.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/warp/fs_dilation-horizontal-fast.binbin1506 -> 1374 bytes
-rw-r--r--bgfx/shaders/spirv/chains/warp/vs_dilation-horizontal-fast.binbin1619 -> 1619 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/fs_xbr-lv1-noblend.binbin6970 -> 7110 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-3d.binbin14834 -> 14694 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-fast.binbin8456 -> 8332 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-noblend.binbin9225 -> 9093 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2.binbin10992 -> 10852 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/fs_xbr-lv3-noblend.binbin13289 -> 13117 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/fs_xbr-lv3.binbin14076 -> 13984 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_custom-jinc2-sharper.binbin8391 -> 8619 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.binbin10436 -> 10224 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.binbin10143 -> 9947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.binbin9539 -> 9375 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.binbin10472 -> 10260 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.binbin10543 -> 10347 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.binbin9939 -> 9775 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.binbin10436 -> 10224 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.binbin10523 -> 10327 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.binbin9919 -> 9755 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.binbin6628 -> 6448 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.binbin6468 -> 6304 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.binbin6208 -> 6044 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass0.binbin7754 -> 7486 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass1.binbin8875 -> 8679 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass2.binbin7274 -> 7038 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_custom-jinc2-sharper.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.binbin2351 -> 2351 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.binbin2351 -> 2351 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.binbin2351 -> 2351 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass0.binbin2351 -> 2351 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass1.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass2.binbin2351 -> 2351 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass3.binbin2351 -> 2351 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/vs_xbr-lv1-noblend.binbin1747 -> 1651 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-3d.binbin3069 -> 3069 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-fast.binbin2083 -> 2083 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-noblend.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3-noblend.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.binbin16480 -> 16340 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.binbin11884 -> 11752 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.binbin11688 -> 11556 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.binbin13216 -> 13084 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.binbin12788 -> 12656 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.binbin12356 -> 12240 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.binbin12840 -> 12708 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.binbin16880 -> 16740 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.binbin5334 -> 5086 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.binbin20911 -> 21923 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.binbin9235 -> 9131 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.binbin5814 -> 5558 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.binbin6598 -> 6326 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.binbin6398 -> 6126 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.binbin6895 -> 6635 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.binbin7289 -> 7029 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.binbin1879 -> 1879 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.binbin1879 -> 1879 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.binbin1879 -> 1879 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.binbin15198 -> 14986 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.binbin8399 -> 8411 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.binbin2111 -> 2111 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.binbin16730 -> 16278 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.binbin10345 -> 9817 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.binbin7851 -> 7591 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.binbin10511 -> 10159 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.binbin1567 -> 1567 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.binbin2947 -> 2947 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.binbin1619 -> 1619 bytes
-rw-r--r--bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.binbin1619 -> 1619 bytes
-rw-r--r--bgfx/shaders/spirv/fs_gui.binbin910 -> 850 bytes
-rw-r--r--bgfx/shaders/spirv/fs_screen.binbin910 -> 850 bytes
-rw-r--r--bgfx/shaders/spirv/vs_gui.binbin1257 -> 1257 bytes
-rw-r--r--bgfx/shaders/spirv/vs_screen.binbin1257 -> 1257 bytes
-rw-r--r--scripts/src/3rdparty.lua65
-rw-r--r--scripts/src/osd/modules.lua1
-rw-r--r--scripts/src/osd/sdl.lua1
-rw-r--r--src/osd/modules/debugger/debugimgui.cpp119
-rw-r--r--src/osd/modules/render/bgfx/chainmanager.cpp3
-rw-r--r--src/osd/modules/render/bgfx/effectmanager.cpp3
-rw-r--r--src/osd/modules/render/bgfx/shadermanager.cpp6
3677 files changed, 158081 insertions, 213651 deletions
diff --git a/3rdparty/bgfx/.appveyor.yml b/3rdparty/bgfx/.appveyor.yml
deleted file mode 100644
index 8c1698d8b05..00000000000
--- a/3rdparty/bgfx/.appveyor.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-shallow_clone: true
-
-os:
- - Visual Studio 2019
-
-environment:
- matrix:
- - TOOLSET: vs2017
-# - TOOLSET: vs2019
-
-platform:
- - Win32
- - x64
-
-configuration:
- - Debug
- - Release
-
-install:
- - git clone --depth 1 https://github.com/bkaradzic/bx ..\bx
- - git clone --depth 1 https://github.com/bkaradzic/bimg ..\bimg
- - ..\bx\tools\bin\windows\genie --with-tools --with-examples %TOOLSET%
-
-build:
- project: .build/projects/$(TOOLSET)/bgfx.sln
diff --git a/3rdparty/bgfx/.editorconfig b/3rdparty/bgfx/.editorconfig
index a1395a709b8..1fd7d0ccec8 100644
--- a/3rdparty/bgfx/.editorconfig
+++ b/3rdparty/bgfx/.editorconfig
@@ -18,3 +18,7 @@ indent_style = space
[*.md]
trim_trailing_whitespace = false
max_line_length = 80
+
+[.github/workflows/*.yml]
+indent_style = space
+indent_size = 2
diff --git a/3rdparty/bgfx/.gitattributes b/3rdparty/bgfx/.gitattributes
index e89cf41267e..dde21f78733 100644
--- a/3rdparty/bgfx/.gitattributes
+++ b/3rdparty/bgfx/.gitattributes
@@ -1,11 +1,12 @@
+*.bin binary diff=hex
*.c eol=lf
*.cpp eol=lf
*.h eol=lf
-*.sc eol=lf
-*.sh eol=lf
+*.lua eol=lf
*.m eol=lf
-*.mm eol=lf
*.md eol=lf
-*.lua eol=lf
*.mk eol=lf
+*.mm eol=lf
+*.sc eol=lf
+*.sh eol=lf
makefile eol=lf
diff --git a/3rdparty/bgfx/.github/ISSUE_TEMPLATE/bug_report.md b/3rdparty/bgfx/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 00000000000..9a1f2e73ad4
--- /dev/null
+++ b/3rdparty/bgfx/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,54 @@
+---
+name: Bug report (FOR BUGS ONLY! DO NOT SUBMIT QUESTIONS HERE!)
+about: Create a report to help us improve
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+<!---
+###########################################################################
+
+**BEWARE!**
+
+If you completely disregard this guidance, and submit random question as issue
+(bug report), the issue will be deleted. If you submit the same issue after
+deletion, you'll be blocked.
+
+**IMPORTANT: READ FIRST!**
+
+Issue tracker is **ONLY** used for reporting bugs.
+
+If you have any questions please **do not** open issue, rather:
+
+ - If you have quick question, ask on Discord: https://discord.gg/9eMbv7J
+ - Ask in discussions: https://github.com/bkaradzic/bgfx/discussions
+ - Search documentation: https://bkaradzic.github.io/bgfx/
+
+New features should be discussed on:
+
+ - GitHub Discussions https://github.com/bkaradzic/bgfx/discussions
+ - Discord Chat https://discord.gg/9eMbv7J
+
+###########################################################################
+-->
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+1. Go to '...'
+2. Click on '....'
+3. Scroll down to '....'
+4. See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Additional context**
+Add any other context about the problem here. OS, drivers, etc.
diff --git a/3rdparty/bgfx/.github/workflows/main.yml b/3rdparty/bgfx/.github/workflows/main.yml
new file mode 100644
index 00000000000..63772b046ee
--- /dev/null
+++ b/3rdparty/bgfx/.github/workflows/main.yml
@@ -0,0 +1,250 @@
+name: CI
+
+concurrency:
+ group: ${{ github.ref }}
+ cancel-in-progress: true
+
+on:
+ push:
+ pull_request:
+
+jobs:
+ msvc:
+ strategy:
+ fail-fast: true
+ matrix:
+ include: [
+ { config: Debug, platform: Win32, bindir: 'win32_vs2019' },
+ { config: Debug, platform: x64, bindir: 'win64_vs2019' },
+ { config: Release, platform: Win32, bindir: 'win32_vs2019' },
+ { config: Release, platform: x64, bindir: 'win64_vs2019' },
+ ]
+ name: msvc-${{ matrix.config }}-${{ matrix.platform }}
+ runs-on: windows-2019
+ steps:
+ - name: Checkout bgfx
+ uses: actions/checkout@v3
+ with:
+ path: bgfx
+ - name: Checkout bx
+ uses: actions/checkout@v3
+ with:
+ repository: bkaradzic/bx
+ path: bx
+ - name: Checkout bimg
+ uses: actions/checkout@v3
+ with:
+ repository: bkaradzic/bimg
+ path: bimg
+ - name: Prepare
+ uses: microsoft/setup-msbuild@v1.1
+ - name: Build
+ shell: cmd
+ run: |
+ cd bgfx
+ ..\bx\tools\bin\windows\genie.exe --with-tools --with-combined-examples --with-shared-lib vs2019
+ msbuild ".build/projects/vs2019/bgfx.sln" /m /v:minimal /p:Configuration=${{ matrix.config }} /p:Platform=${{ matrix.platform }}
+ - name: Check
+ shell: cmd
+ run: |
+ cd bgfx
+ dir /s ".build\${{ matrix.bindir }}\bin"
+ ".build\${{ matrix.bindir }}\bin\geometryc${{ matrix.config }}.exe" --version
+ ".build\${{ matrix.bindir }}\bin\shaderc${{ matrix.config }}.exe" --version
+ ".build\${{ matrix.bindir }}\bin\texturec${{ matrix.config }}.exe" --version
+ mingw:
+ strategy:
+ fail-fast: true
+ matrix:
+ include: [
+ { msystem: MINGW64, project: 'mingw-gcc', bindir: 'win64_mingw-gcc' },
+ { msystem: CLANG64, project: 'mingw-clang', bindir: 'win64_mingw-clang' },
+ ]
+ name: mingw-${{ matrix.msystem }}
+ runs-on: windows-latest
+ steps:
+ - name: Checkout bgfx
+ uses: actions/checkout@v3
+ with:
+ path: bgfx
+ - name: Checkout bx
+ uses: actions/checkout@v3
+ with:
+ repository: bkaradzic/bx
+ path: bx
+ - name: Checkout bimg
+ uses: actions/checkout@v3
+ with:
+ repository: bkaradzic/bimg
+ path: bimg
+ - name: Prepare
+ uses: msys2/setup-msys2@v2
+ with:
+ msystem: ${{ matrix.msystem }}
+ update: true
+ install: make
+ pacboy: cc:p
+ - name: Build
+ shell: msys2 {0}
+ run: |
+ cd bgfx
+ make ${{ matrix.project }}-release64 -j$(nproc) AR=ar CC=cc CXX=c++ MINGW=$MINGW_PREFIX
+ - name: Check
+ shell: cmd
+ run: |
+ cd bgfx
+ dir /s ".build\${{ matrix.bindir }}\bin"
+ ".build\${{ matrix.bindir }}\bin\geometrycRelease.exe" --version
+ ".build\${{ matrix.bindir }}\bin\shadercRelease.exe" --version
+ ".build\${{ matrix.bindir }}\bin\texturecRelease.exe" --version
+ linux:
+ strategy:
+ fail-fast: true
+ matrix:
+ include: [
+ { config: debug, binsuffix: Debug },
+ { config: release, binsuffix: Release },
+ ]
+ name: linux-${{ matrix.config }}64
+ runs-on: ubuntu-22.04
+ steps:
+ - name: Checkout bgfx
+ uses: actions/checkout@v3
+ with:
+ path: bgfx
+ - name: Checkout bx
+ uses: actions/checkout@v3
+ with:
+ repository: bkaradzic/bx
+ path: bx
+ - name: Checkout bimg
+ uses: actions/checkout@v3
+ with:
+ repository: bkaradzic/bimg
+ path: bimg
+ - name: Build
+ run: |
+ sudo apt install libgl-dev
+ cd bgfx
+ make -j$(nproc) linux-${{ matrix.config }}64
+ - name: Check
+ run: |
+ cd bgfx
+ ls -lash ".build/linux64_gcc/bin"
+ ".build/linux64_gcc/bin/geometryc${{ matrix.binsuffix}}" --version
+ ".build/linux64_gcc/bin/shaderc${{ matrix.binsuffix}}" --version
+ ".build/linux64_gcc/bin/texturec${{ matrix.binsuffix}}" --version
+ wasm:
+ strategy:
+ fail-fast: true
+ matrix:
+ config: [ debug, release]
+ name: wasm-${{ matrix.config }}
+ runs-on: ubuntu-22.04
+ steps:
+ - name: Checkout bgfx
+ uses: actions/checkout@v3
+ with:
+ path: bgfx
+ - name: Checkout bx
+ uses: actions/checkout@v3
+ with:
+ repository: bkaradzic/bx
+ path: bx
+ - name: Checkout bimg
+ uses: actions/checkout@v3
+ with:
+ repository: bkaradzic/bimg
+ path: bimg
+ - name: Prepare
+ run: |
+ docker pull emscripten/emsdk
+ docker run --rm emscripten/emsdk which emcc em++ emar
+ cd bgfx
+ EMSCRIPTEN=/emsdk/upstream/emscripten ../bx/tools/bin/linux/genie --with-examples --gcc=wasm gmake
+ - name: Build
+ run: >
+ docker run --rm -u $(id -u):$(id -g) -v $(pwd):/bgfx emscripten/emsdk
+ make -C /bgfx/bgfx wasm-${{ matrix.config }} -j$(nproc) EMSCRIPTEN=/emsdk/upstream/emscripten
+ - name: Check
+ run: |
+ cd bgfx
+ ls -lash ".build/wasm/bin"
+ osx:
+ strategy:
+ fail-fast: true
+ matrix:
+ include: [
+ { config: debug, binsuffix: Debug },
+ { config: release, binsuffix: Release },
+ ]
+ name: osx-x64-${{ matrix.config }}
+ runs-on: macos-latest
+ steps:
+ - name: Checkout bgfx
+ uses: actions/checkout@v3
+ with:
+ path: bgfx
+ - name: Checkout bx
+ uses: actions/checkout@v3
+ with:
+ repository: bkaradzic/bx
+ path: bx
+ - name: Checkout bimg
+ uses: actions/checkout@v3
+ with:
+ repository: bkaradzic/bimg
+ path: bimg
+ - name: Build
+ run: |
+ cd bgfx
+ make -j$(sysctl -n hw.physicalcpu) osx-x64-${{ matrix.config }}
+ - name: Check
+ run: |
+ cd bgfx
+ ls -lash ".build/osx-x64/bin"
+ ".build/osx-x64/bin/geometryc${{ matrix.binsuffix}}" --version
+ ".build/osx-x64/bin/shaderc${{ matrix.binsuffix}}" --version
+ ".build/osx-x64/bin/texturec${{ matrix.binsuffix}}" --version
+ android:
+ strategy:
+ fail-fast: true
+ matrix:
+ include: [
+ { platform: arm },
+ { platform: arm64 },
+ { platform: x86 },
+ { platform: x86_64 },
+ ]
+ name: android-${{ matrix.platform }}
+ runs-on: ubuntu-22.04
+ steps:
+ - uses: nttld/setup-ndk@v1
+ id: setup-ndk
+ with:
+ ndk-version: r25b
+ add-to-path: false
+ - name: Checkout bgfx
+ uses: actions/checkout@v3
+ with:
+ path: bgfx
+ - name: Checkout bx
+ uses: actions/checkout@v3
+ with:
+ repository: bkaradzic/bx
+ path: bx
+ - name: Checkout bimg
+ uses: actions/checkout@v3
+ with:
+ repository: bkaradzic/bimg
+ path: bimg
+ - name: Build
+ run: |
+ cd bgfx
+ make -j$(sysctl -n hw.physicalcpu) android-${{ matrix.platform }}
+ env:
+ ANDROID_NDK_ROOT: ${{ steps.setup-ndk.outputs.ndk-path }}
+ - name: Check
+ run: |
+ cd bgfx
+ ls -lash ".build/android-${{ matrix.platform }}/bin"
diff --git a/3rdparty/bgfx/.gitignore b/3rdparty/bgfx/.gitignore
index 362a7c691a6..0e292f5cfec 100644
--- a/3rdparty/bgfx/.gitignore
+++ b/3rdparty/bgfx/.gitignore
@@ -1,9 +1,11 @@
+*.TMP
+*.dxvk-cache
+*.log
+.DS_Store
.build
.debug
-.DS_Store
+.gdb_history
.git
.svn
-tags
-.gdb_history
.vscode
-*.TMP
+tags
diff --git a/3rdparty/bgfx/3rdparty/cgltf/cgltf.h b/3rdparty/bgfx/3rdparty/cgltf/cgltf.h
index 5650038019d..0e9c67eaa55 100644
--- a/3rdparty/bgfx/3rdparty/cgltf/cgltf.h
+++ b/3rdparty/bgfx/3rdparty/cgltf/cgltf.h
@@ -1,7 +1,7 @@
/**
* cgltf - a single-file glTF 2.0 parser written in C99.
*
- * Version: 1.11
+ * Version: 1.13
*
* Website: https://github.com/jkuhlmann/cgltf
*
@@ -63,7 +63,7 @@
* By passing null for the output pointer, users can find out how many floats are required in the
* output buffer.
*
- * `cgltf_accessor_num_components` is a tiny utility that tells you the dimensionality of
+ * `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.
*
@@ -80,25 +80,23 @@
* `cgltf_accessor_read_index` is similar to its floating-point counterpart, but it returns size_t
* and only works with single-component data types.
*
- * `cgltf_result cgltf_copy_extras_json(const cgltf_data*, const cgltf_extras*,
- * char* dest, cgltf_size* dest_size)` allows users to retrieve the "extras" data that
- * can be attached to many glTF objects (which can be arbitrary JSON data). The
- * `cgltf_extras` struct stores the offsets of the start and end of the extras JSON data
- * as it appears in the complete glTF JSON data. This function copies the extras data
- * into the provided buffer. If `dest` is NULL, the length of the data is written into
- * `dest_size`. You can then parse this data using your own JSON parser
+ * `cgltf_copy_extras_json` allows users to retrieve the "extras" data that can be attached to many
+ * glTF objects (which can be arbitrary JSON data). This is a legacy function, consider using
+ * cgltf_extras::data directly instead. You can parse this data using your own JSON parser
* or, if you've included the cgltf implementation using the integrated JSMN JSON parser.
*/
#ifndef CGLTF_H_INCLUDED__
#define CGLTF_H_INCLUDED__
#include <stddef.h>
+#include <stdint.h> /* For uint8_t, uint32_t */
#ifdef __cplusplus
extern "C" {
#endif
typedef size_t cgltf_size;
+typedef long long int cgltf_ssize;
typedef float cgltf_float;
typedef int cgltf_int;
typedef unsigned int cgltf_uint;
@@ -109,6 +107,7 @@ typedef enum cgltf_file_type
cgltf_file_type_invalid,
cgltf_file_type_gltf,
cgltf_file_type_glb,
+ cgltf_file_type_max_enum
} cgltf_file_type;
typedef enum cgltf_result
@@ -123,12 +122,13 @@ typedef enum cgltf_result
cgltf_result_io_error,
cgltf_result_out_of_memory,
cgltf_result_legacy_gltf,
+ cgltf_result_max_enum
} cgltf_result;
typedef struct cgltf_memory_options
{
- void* (*alloc)(void* user, cgltf_size size);
- void (*free) (void* user, void* ptr);
+ void* (*alloc_func)(void* user, cgltf_size size);
+ void (*free_func) (void* user, void* ptr);
void* user_data;
} cgltf_memory_options;
@@ -152,6 +152,7 @@ typedef enum cgltf_buffer_view_type
cgltf_buffer_view_type_invalid,
cgltf_buffer_view_type_indices,
cgltf_buffer_view_type_vertices,
+ cgltf_buffer_view_type_max_enum
} cgltf_buffer_view_type;
typedef enum cgltf_attribute_type
@@ -164,6 +165,8 @@ typedef enum cgltf_attribute_type
cgltf_attribute_type_color,
cgltf_attribute_type_joints,
cgltf_attribute_type_weights,
+ cgltf_attribute_type_custom,
+ cgltf_attribute_type_max_enum
} cgltf_attribute_type;
typedef enum cgltf_component_type
@@ -175,6 +178,7 @@ typedef enum cgltf_component_type
cgltf_component_type_r_16u, /* UNSIGNED_SHORT */
cgltf_component_type_r_32u, /* UNSIGNED_INT */
cgltf_component_type_r_32f, /* FLOAT */
+ cgltf_component_type_max_enum
} cgltf_component_type;
typedef enum cgltf_type
@@ -187,6 +191,7 @@ typedef enum cgltf_type
cgltf_type_mat2,
cgltf_type_mat3,
cgltf_type_mat4,
+ cgltf_type_max_enum
} cgltf_type;
typedef enum cgltf_primitive_type
@@ -198,6 +203,7 @@ typedef enum cgltf_primitive_type
cgltf_primitive_type_triangles,
cgltf_primitive_type_triangle_strip,
cgltf_primitive_type_triangle_fan,
+ cgltf_primitive_type_max_enum
} cgltf_primitive_type;
typedef enum cgltf_alpha_mode
@@ -205,6 +211,7 @@ typedef enum cgltf_alpha_mode
cgltf_alpha_mode_opaque,
cgltf_alpha_mode_mask,
cgltf_alpha_mode_blend,
+ cgltf_alpha_mode_max_enum
} cgltf_alpha_mode;
typedef enum cgltf_animation_path_type {
@@ -213,18 +220,21 @@ typedef enum cgltf_animation_path_type {
cgltf_animation_path_type_rotation,
cgltf_animation_path_type_scale,
cgltf_animation_path_type_weights,
+ cgltf_animation_path_type_max_enum
} cgltf_animation_path_type;
typedef enum cgltf_interpolation_type {
cgltf_interpolation_type_linear,
cgltf_interpolation_type_step,
cgltf_interpolation_type_cubic_spline,
+ cgltf_interpolation_type_max_enum
} cgltf_interpolation_type;
typedef enum cgltf_camera_type {
cgltf_camera_type_invalid,
cgltf_camera_type_perspective,
cgltf_camera_type_orthographic,
+ cgltf_camera_type_max_enum
} cgltf_camera_type;
typedef enum cgltf_light_type {
@@ -232,17 +242,21 @@ typedef enum cgltf_light_type {
cgltf_light_type_directional,
cgltf_light_type_point,
cgltf_light_type_spot,
+ cgltf_light_type_max_enum
} cgltf_light_type;
typedef enum cgltf_data_free_method {
cgltf_data_free_method_none,
cgltf_data_free_method_file_release,
cgltf_data_free_method_memory_free,
+ cgltf_data_free_method_max_enum
} cgltf_data_free_method;
typedef struct cgltf_extras {
- cgltf_size start_offset;
- cgltf_size end_offset;
+ cgltf_size start_offset; /* this field is deprecated and will be removed in the future; use data instead */
+ cgltf_size end_offset; /* this field is deprecated and will be removed in the future; use data instead */
+
+ char* data;
} cgltf_extras;
typedef struct cgltf_extension {
@@ -267,6 +281,7 @@ typedef enum cgltf_meshopt_compression_mode {
cgltf_meshopt_compression_mode_attributes,
cgltf_meshopt_compression_mode_triangles,
cgltf_meshopt_compression_mode_indices,
+ cgltf_meshopt_compression_mode_max_enum
} cgltf_meshopt_compression_mode;
typedef enum cgltf_meshopt_compression_filter {
@@ -274,6 +289,7 @@ typedef enum cgltf_meshopt_compression_filter {
cgltf_meshopt_compression_filter_octahedral,
cgltf_meshopt_compression_filter_quaternion,
cgltf_meshopt_compression_filter_exponential,
+ cgltf_meshopt_compression_filter_max_enum
} cgltf_meshopt_compression_filter;
typedef struct cgltf_meshopt_compression
@@ -415,8 +431,6 @@ typedef struct cgltf_pbr_metallic_roughness
cgltf_float base_color_factor[4];
cgltf_float metallic_factor;
cgltf_float roughness_factor;
-
- cgltf_extras extras;
} cgltf_pbr_metallic_roughness;
typedef struct cgltf_pbr_specular_glossiness
@@ -474,6 +488,21 @@ typedef struct cgltf_sheen
cgltf_float sheen_roughness_factor;
} cgltf_sheen;
+typedef struct cgltf_emissive_strength
+{
+ cgltf_float emissive_strength;
+} cgltf_emissive_strength;
+
+typedef struct cgltf_iridescence
+{
+ cgltf_float iridescence_factor;
+ cgltf_texture_view iridescence_texture;
+ cgltf_float iridescence_ior;
+ cgltf_float iridescence_thickness_min;
+ cgltf_float iridescence_thickness_max;
+ cgltf_texture_view iridescence_thickness_texture;
+} cgltf_iridescence;
+
typedef struct cgltf_material
{
char* name;
@@ -485,6 +514,8 @@ typedef struct cgltf_material
cgltf_bool has_ior;
cgltf_bool has_specular;
cgltf_bool has_sheen;
+ cgltf_bool has_emissive_strength;
+ cgltf_bool has_iridescence;
cgltf_pbr_metallic_roughness pbr_metallic_roughness;
cgltf_pbr_specular_glossiness pbr_specular_glossiness;
cgltf_clearcoat clearcoat;
@@ -493,6 +524,8 @@ typedef struct cgltf_material
cgltf_sheen sheen;
cgltf_transmission transmission;
cgltf_volume volume;
+ cgltf_emissive_strength emissive_strength;
+ cgltf_iridescence iridescence;
cgltf_texture_view normal_texture;
cgltf_texture_view occlusion_texture;
cgltf_texture_view emissive_texture;
@@ -524,6 +557,12 @@ typedef struct cgltf_draco_mesh_compression {
cgltf_size attributes_count;
} cgltf_draco_mesh_compression;
+typedef struct cgltf_mesh_gpu_instancing {
+ cgltf_buffer_view* buffer_view;
+ cgltf_attribute* attributes;
+ cgltf_size attributes_count;
+} cgltf_mesh_gpu_instancing;
+
typedef struct cgltf_primitive {
cgltf_primitive_type type;
cgltf_accessor* indices;
@@ -628,6 +667,8 @@ struct cgltf_node {
cgltf_float scale[3];
cgltf_float matrix[16];
cgltf_extras extras;
+ cgltf_bool has_mesh_gpu_instancing;
+ cgltf_mesh_gpu_instancing mesh_gpu_instancing;
cgltf_size extensions_count;
cgltf_extension* extensions;
};
@@ -779,8 +820,8 @@ cgltf_result cgltf_load_buffers(
cgltf_result cgltf_load_buffer_base64(const cgltf_options* options, cgltf_size size, const char* base64, void** out_data);
-void cgltf_decode_string(char* string);
-void cgltf_decode_uri(char* uri);
+cgltf_size cgltf_decode_string(char* string);
+cgltf_size cgltf_decode_uri(char* uri);
cgltf_result cgltf_validate(cgltf_data* data);
@@ -789,6 +830,8 @@ void cgltf_free(cgltf_data* data);
void cgltf_node_transform_local(const cgltf_node* node, cgltf_float* out_matrix);
void cgltf_node_transform_world(const cgltf_node* node, cgltf_float* out_matrix);
+const uint8_t* cgltf_buffer_view_data(const cgltf_buffer_view* view);
+
cgltf_bool cgltf_accessor_read_float(const cgltf_accessor* accessor, cgltf_size index, cgltf_float* out, cgltf_size element_size);
cgltf_bool cgltf_accessor_read_uint(const cgltf_accessor* accessor, cgltf_size index, cgltf_uint* out, cgltf_size element_size);
cgltf_size cgltf_accessor_read_index(const cgltf_accessor* accessor, cgltf_size index);
@@ -797,6 +840,7 @@ cgltf_size cgltf_num_components(cgltf_type type);
cgltf_size cgltf_accessor_unpack_floats(const cgltf_accessor* accessor, cgltf_float* out, cgltf_size float_count);
+/* this function is deprecated and will be removed in the future; use cgltf_extras::data instead */
cgltf_result cgltf_copy_extras_json(const cgltf_data* data, const cgltf_extras* extras, char* dest, cgltf_size* dest_size);
#ifdef __cplusplus
@@ -819,7 +863,6 @@ cgltf_result cgltf_copy_extras_json(const cgltf_data* data, const cgltf_extras*
#ifdef CGLTF_IMPLEMENTATION
-#include <stdint.h> /* For uint8_t, uint32_t */
#include <string.h> /* For strncpy */
#include <stdio.h> /* For fopen */
#include <limits.h> /* For UINT_MAX etc */
@@ -829,6 +872,10 @@ cgltf_result cgltf_copy_extras_json(const cgltf_data* data, const cgltf_extras*
#include <stdlib.h> /* For malloc, free, atoi, atof */
#endif
+#if CGLTF_VALIDATE_ENABLE_ASSERTS
+#include <assert.h>
+#endif
+
/* JSMN_PARENT_LINKS is necessary to make parsing large structures linear in input size */
#define JSMN_PARENT_LINKS
@@ -876,12 +923,15 @@ static int jsmn_parse(jsmn_parser *parser, const char *js, size_t len, jsmntok_t
*/
+#ifndef CGLTF_CONSTS
static const cgltf_size GlbHeaderSize = 12;
static const cgltf_size GlbChunkHeaderSize = 8;
static const uint32_t GlbVersion = 2;
static const uint32_t GlbMagic = 0x46546C67;
static const uint32_t GlbMagicJsonChunk = 0x4E4F534A;
static const uint32_t GlbMagicBinChunk = 0x004E4942;
+#define CGLTF_CONSTS
+#endif
#ifndef CGLTF_MALLOC
#define CGLTF_MALLOC(size) malloc(size)
@@ -920,7 +970,7 @@ static void* cgltf_calloc(cgltf_options* options, size_t element_size, cgltf_siz
{
return NULL;
}
- void* result = options->memory.alloc(options->memory.user_data, element_size * count);
+ void* result = options->memory.alloc_func(options->memory.user_data, element_size * count);
if (!result)
{
return NULL;
@@ -932,8 +982,8 @@ static void* cgltf_calloc(cgltf_options* options, size_t element_size, cgltf_siz
static cgltf_result cgltf_default_file_read(const struct cgltf_memory_options* memory_options, const struct cgltf_file_options* file_options, const char* path, cgltf_size* size, void** data)
{
(void)file_options;
- void* (*memory_alloc)(void*, cgltf_size) = memory_options->alloc ? memory_options->alloc : &cgltf_default_alloc;
- void (*memory_free)(void*, void*) = memory_options->free ? memory_options->free : &cgltf_default_free;
+ void* (*memory_alloc)(void*, cgltf_size) = memory_options->alloc_func ? memory_options->alloc_func : &cgltf_default_alloc;
+ void (*memory_free)(void*, void*) = memory_options->free_func ? memory_options->free_func : &cgltf_default_free;
FILE* file = fopen(path, "rb");
if (!file)
@@ -995,7 +1045,7 @@ static cgltf_result cgltf_default_file_read(const struct cgltf_memory_options* m
static void cgltf_default_file_release(const struct cgltf_memory_options* memory_options, const struct cgltf_file_options* file_options, void* data)
{
(void)file_options;
- void (*memfree)(void*, void*) = memory_options->free ? memory_options->free : &cgltf_default_free;
+ void (*memfree)(void*, void*) = memory_options->free_func ? memory_options->free_func : &cgltf_default_free;
memfree(memory_options->user_data, data);
}
@@ -1014,13 +1064,13 @@ cgltf_result cgltf_parse(const cgltf_options* options, const void* data, cgltf_s
}
cgltf_options fixed_options = *options;
- if (fixed_options.memory.alloc == NULL)
+ if (fixed_options.memory.alloc_func == NULL)
{
- fixed_options.memory.alloc = &cgltf_default_alloc;
+ fixed_options.memory.alloc_func = &cgltf_default_alloc;
}
- if (fixed_options.memory.free == NULL)
+ if (fixed_options.memory.free_func == NULL)
{
- fixed_options.memory.free = &cgltf_default_free;
+ fixed_options.memory.free_func = &cgltf_default_free;
}
uint32_t tmp;
@@ -1185,8 +1235,8 @@ static void cgltf_combine_paths(char* path, const char* base, const char* uri)
static cgltf_result cgltf_load_buffer_file(const cgltf_options* options, cgltf_size size, const char* uri, const char* gltf_path, void** out_data)
{
- void* (*memory_alloc)(void*, cgltf_size) = options->memory.alloc ? options->memory.alloc : &cgltf_default_alloc;
- void (*memory_free)(void*, void*) = options->memory.free ? options->memory.free : &cgltf_default_free;
+ void* (*memory_alloc)(void*, cgltf_size) = options->memory.alloc_func ? options->memory.alloc_func : &cgltf_default_alloc;
+ void (*memory_free)(void*, void*) = options->memory.free_func ? options->memory.free_func : &cgltf_default_free;
cgltf_result (*file_read)(const struct cgltf_memory_options*, const struct cgltf_file_options*, const char*, cgltf_size*, void**) = options->file.read ? options->file.read : &cgltf_default_file_read;
char* path = (char*)memory_alloc(options->memory.user_data, strlen(uri) + strlen(gltf_path) + 1);
@@ -1212,8 +1262,8 @@ static cgltf_result cgltf_load_buffer_file(const cgltf_options* options, cgltf_s
cgltf_result cgltf_load_buffer_base64(const cgltf_options* options, cgltf_size size, const char* base64, void** out_data)
{
- void* (*memory_alloc)(void*, cgltf_size) = options->memory.alloc ? options->memory.alloc : &cgltf_default_alloc;
- void (*memory_free)(void*, void*) = options->memory.free ? options->memory.free : &cgltf_default_free;
+ void* (*memory_alloc)(void*, cgltf_size) = options->memory.alloc_func ? options->memory.alloc_func : &cgltf_default_alloc;
+ void (*memory_free)(void*, void*) = options->memory.free_func ? options->memory.free_func : &cgltf_default_free;
unsigned char* data = (unsigned char*)memory_alloc(options->memory.user_data, size);
if (!data)
@@ -1266,25 +1316,29 @@ static int cgltf_unhex(char ch)
-1;
}
-void cgltf_decode_string(char* string)
+cgltf_size cgltf_decode_string(char* string)
{
- char* read = strchr(string, '\\');
- if (read == NULL)
+ char* read = string + strcspn(string, "\\");
+ if (*read == 0)
{
- return;
+ return read - string;
}
char* write = string;
char* last = string;
- while (read)
+ for (;;)
{
// Copy characters since last escaped sequence
cgltf_size written = read - last;
- strncpy(write, last, written);
+ memmove(write, last, written);
write += written;
+ if (*read++ == 0)
+ {
+ break;
+ }
+
// jsmn already checked that all escape sequences are valid
- ++read;
switch (*read++)
{
case '\"': *write++ = '\"'; break;
@@ -1326,13 +1380,14 @@ void cgltf_decode_string(char* string)
}
last = read;
- read = strchr(read, '\\');
+ read += strcspn(read, "\\");
}
- strcpy(write, last);
+ *write = 0;
+ return write - string;
}
-void cgltf_decode_uri(char* uri)
+cgltf_size cgltf_decode_uri(char* uri)
{
char* write = uri;
char* i = uri;
@@ -1360,6 +1415,7 @@ void cgltf_decode_uri(char* uri)
}
*write = 0;
+ return write - uri;
}
cgltf_result cgltf_load_buffers(const cgltf_options* options, cgltf_data* data, const char* gltf_path)
@@ -1691,14 +1747,25 @@ cgltf_result cgltf_copy_extras_json(const cgltf_data* data, const cgltf_extras*
return cgltf_result_success;
}
-void cgltf_free_extensions(cgltf_data* data, cgltf_extension* extensions, cgltf_size extensions_count)
+static void cgltf_free_extras(cgltf_data* data, cgltf_extras* extras)
+{
+ data->memory.free_func(data->memory.user_data, extras->data);
+}
+
+static void cgltf_free_extensions(cgltf_data* data, cgltf_extension* extensions, cgltf_size extensions_count)
{
for (cgltf_size i = 0; i < extensions_count; ++i)
{
- data->memory.free(data->memory.user_data, extensions[i].name);
- data->memory.free(data->memory.user_data, extensions[i].data);
+ data->memory.free_func(data->memory.user_data, extensions[i].name);
+ data->memory.free_func(data->memory.user_data, extensions[i].data);
}
- data->memory.free(data->memory.user_data, extensions);
+ data->memory.free_func(data->memory.user_data, extensions);
+}
+
+static void cgltf_free_texture_view(cgltf_data* data, cgltf_texture_view* view)
+{
+ cgltf_free_extensions(data, view->extensions, view->extensions_count);
+ cgltf_free_extras(data, &view->extras);
}
void cgltf_free(cgltf_data* data)
@@ -1710,39 +1777,45 @@ void cgltf_free(cgltf_data* data)
void (*file_release)(const struct cgltf_memory_options*, const struct cgltf_file_options*, void* data) = data->file.release ? data->file.release : cgltf_default_file_release;
- data->memory.free(data->memory.user_data, data->asset.copyright);
- data->memory.free(data->memory.user_data, data->asset.generator);
- data->memory.free(data->memory.user_data, data->asset.version);
- data->memory.free(data->memory.user_data, data->asset.min_version);
+ data->memory.free_func(data->memory.user_data, data->asset.copyright);
+ data->memory.free_func(data->memory.user_data, data->asset.generator);
+ data->memory.free_func(data->memory.user_data, data->asset.version);
+ data->memory.free_func(data->memory.user_data, data->asset.min_version);
cgltf_free_extensions(data, data->asset.extensions, data->asset.extensions_count);
+ cgltf_free_extras(data, &data->asset.extras);
for (cgltf_size i = 0; i < data->accessors_count; ++i)
{
- data->memory.free(data->memory.user_data, data->accessors[i].name);
+ data->memory.free_func(data->memory.user_data, data->accessors[i].name);
if(data->accessors[i].is_sparse)
{
cgltf_free_extensions(data, data->accessors[i].sparse.extensions, data->accessors[i].sparse.extensions_count);
cgltf_free_extensions(data, data->accessors[i].sparse.indices_extensions, data->accessors[i].sparse.indices_extensions_count);
cgltf_free_extensions(data, data->accessors[i].sparse.values_extensions, data->accessors[i].sparse.values_extensions_count);
+ cgltf_free_extras(data, &data->accessors[i].sparse.extras);
+ cgltf_free_extras(data, &data->accessors[i].sparse.indices_extras);
+ cgltf_free_extras(data, &data->accessors[i].sparse.values_extras);
}
cgltf_free_extensions(data, data->accessors[i].extensions, data->accessors[i].extensions_count);
+ cgltf_free_extras(data, &data->accessors[i].extras);
}
- data->memory.free(data->memory.user_data, data->accessors);
+ data->memory.free_func(data->memory.user_data, data->accessors);
for (cgltf_size i = 0; i < data->buffer_views_count; ++i)
{
- data->memory.free(data->memory.user_data, data->buffer_views[i].name);
- data->memory.free(data->memory.user_data, data->buffer_views[i].data);
+ data->memory.free_func(data->memory.user_data, data->buffer_views[i].name);
+ data->memory.free_func(data->memory.user_data, data->buffer_views[i].data);
cgltf_free_extensions(data, data->buffer_views[i].extensions, data->buffer_views[i].extensions_count);
+ cgltf_free_extras(data, &data->buffer_views[i].extras);
}
- data->memory.free(data->memory.user_data, data->buffer_views);
+ data->memory.free_func(data->memory.user_data, data->buffer_views);
for (cgltf_size i = 0; i < data->buffers_count; ++i)
{
- data->memory.free(data->memory.user_data, data->buffers[i].name);
+ data->memory.free_func(data->memory.user_data, data->buffers[i].name);
if (data->buffers[i].data_free_method == cgltf_data_free_method_file_release)
{
@@ -1750,237 +1823,288 @@ void cgltf_free(cgltf_data* data)
}
else if (data->buffers[i].data_free_method == cgltf_data_free_method_memory_free)
{
- data->memory.free(data->memory.user_data, data->buffers[i].data);
+ data->memory.free_func(data->memory.user_data, data->buffers[i].data);
}
- data->memory.free(data->memory.user_data, data->buffers[i].uri);
+ data->memory.free_func(data->memory.user_data, data->buffers[i].uri);
cgltf_free_extensions(data, data->buffers[i].extensions, data->buffers[i].extensions_count);
+ cgltf_free_extras(data, &data->buffers[i].extras);
}
-
- data->memory.free(data->memory.user_data, data->buffers);
+ data->memory.free_func(data->memory.user_data, data->buffers);
for (cgltf_size i = 0; i < data->meshes_count; ++i)
{
- data->memory.free(data->memory.user_data, data->meshes[i].name);
+ data->memory.free_func(data->memory.user_data, data->meshes[i].name);
for (cgltf_size j = 0; j < data->meshes[i].primitives_count; ++j)
{
for (cgltf_size k = 0; k < data->meshes[i].primitives[j].attributes_count; ++k)
{
- data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].attributes[k].name);
+ data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].attributes[k].name);
}
- data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].attributes);
+ data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].attributes);
for (cgltf_size k = 0; k < data->meshes[i].primitives[j].targets_count; ++k)
{
for (cgltf_size m = 0; m < data->meshes[i].primitives[j].targets[k].attributes_count; ++m)
{
- data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].targets[k].attributes[m].name);
+ data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].targets[k].attributes[m].name);
}
- data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].targets[k].attributes);
+ data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].targets[k].attributes);
}
- data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].targets);
+ data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].targets);
if (data->meshes[i].primitives[j].has_draco_mesh_compression)
{
for (cgltf_size k = 0; k < data->meshes[i].primitives[j].draco_mesh_compression.attributes_count; ++k)
{
- data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].draco_mesh_compression.attributes[k].name);
+ data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].draco_mesh_compression.attributes[k].name);
}
- data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].draco_mesh_compression.attributes);
+ data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].draco_mesh_compression.attributes);
+ }
+
+ for (cgltf_size k = 0; k < data->meshes[i].primitives[j].mappings_count; ++k)
+ {
+ cgltf_free_extras(data, &data->meshes[i].primitives[j].mappings[k].extras);
}
- data->memory.free(data->memory.user_data, data->meshes[i].primitives[j].mappings);
+ data->memory.free_func(data->memory.user_data, data->meshes[i].primitives[j].mappings);
cgltf_free_extensions(data, data->meshes[i].primitives[j].extensions, data->meshes[i].primitives[j].extensions_count);
+ cgltf_free_extras(data, &data->meshes[i].primitives[j].extras);
}
- data->memory.free(data->memory.user_data, data->meshes[i].primitives);
- data->memory.free(data->memory.user_data, data->meshes[i].weights);
+ data->memory.free_func(data->memory.user_data, data->meshes[i].primitives);
+ data->memory.free_func(data->memory.user_data, data->meshes[i].weights);
for (cgltf_size j = 0; j < data->meshes[i].target_names_count; ++j)
{
- data->memory.free(data->memory.user_data, data->meshes[i].target_names[j]);
+ data->memory.free_func(data->memory.user_data, data->meshes[i].target_names[j]);
}
cgltf_free_extensions(data, data->meshes[i].extensions, data->meshes[i].extensions_count);
+ cgltf_free_extras(data, &data->meshes[i].extras);
- data->memory.free(data->memory.user_data, data->meshes[i].target_names);
+ data->memory.free_func(data->memory.user_data, data->meshes[i].target_names);
}
- data->memory.free(data->memory.user_data, data->meshes);
+ data->memory.free_func(data->memory.user_data, data->meshes);
for (cgltf_size i = 0; i < data->materials_count; ++i)
{
- data->memory.free(data->memory.user_data, data->materials[i].name);
+ data->memory.free_func(data->memory.user_data, data->materials[i].name);
if(data->materials[i].has_pbr_metallic_roughness)
{
- cgltf_free_extensions(data, data->materials[i].pbr_metallic_roughness.metallic_roughness_texture.extensions, data->materials[i].pbr_metallic_roughness.metallic_roughness_texture.extensions_count);
- cgltf_free_extensions(data, data->materials[i].pbr_metallic_roughness.base_color_texture.extensions, data->materials[i].pbr_metallic_roughness.base_color_texture.extensions_count);
+ cgltf_free_texture_view(data, &data->materials[i].pbr_metallic_roughness.metallic_roughness_texture);
+ cgltf_free_texture_view(data, &data->materials[i].pbr_metallic_roughness.base_color_texture);
}
if(data->materials[i].has_pbr_specular_glossiness)
{
- cgltf_free_extensions(data, data->materials[i].pbr_specular_glossiness.diffuse_texture.extensions, data->materials[i].pbr_specular_glossiness.diffuse_texture.extensions_count);
- cgltf_free_extensions(data, data->materials[i].pbr_specular_glossiness.specular_glossiness_texture.extensions, data->materials[i].pbr_specular_glossiness.specular_glossiness_texture.extensions_count);
+ cgltf_free_texture_view(data, &data->materials[i].pbr_specular_glossiness.diffuse_texture);
+ cgltf_free_texture_view(data, &data->materials[i].pbr_specular_glossiness.specular_glossiness_texture);
}
if(data->materials[i].has_clearcoat)
{
- cgltf_free_extensions(data, data->materials[i].clearcoat.clearcoat_texture.extensions, data->materials[i].clearcoat.clearcoat_texture.extensions_count);
- cgltf_free_extensions(data, data->materials[i].clearcoat.clearcoat_roughness_texture.extensions, data->materials[i].clearcoat.clearcoat_roughness_texture.extensions_count);
- cgltf_free_extensions(data, data->materials[i].clearcoat.clearcoat_normal_texture.extensions, data->materials[i].clearcoat.clearcoat_normal_texture.extensions_count);
+ cgltf_free_texture_view(data, &data->materials[i].clearcoat.clearcoat_texture);
+ cgltf_free_texture_view(data, &data->materials[i].clearcoat.clearcoat_roughness_texture);
+ cgltf_free_texture_view(data, &data->materials[i].clearcoat.clearcoat_normal_texture);
}
if(data->materials[i].has_specular)
{
- cgltf_free_extensions(data, data->materials[i].specular.specular_texture.extensions, data->materials[i].specular.specular_texture.extensions_count);
- cgltf_free_extensions(data, data->materials[i].specular.specular_color_texture.extensions, data->materials[i].specular.specular_color_texture.extensions_count);
+ cgltf_free_texture_view(data, &data->materials[i].specular.specular_texture);
+ cgltf_free_texture_view(data, &data->materials[i].specular.specular_color_texture);
}
if(data->materials[i].has_transmission)
{
- cgltf_free_extensions(data, data->materials[i].transmission.transmission_texture.extensions, data->materials[i].transmission.transmission_texture.extensions_count);
+ cgltf_free_texture_view(data, &data->materials[i].transmission.transmission_texture);
}
if (data->materials[i].has_volume)
{
- cgltf_free_extensions(data, data->materials[i].volume.thickness_texture.extensions, data->materials[i].volume.thickness_texture.extensions_count);
+ cgltf_free_texture_view(data, &data->materials[i].volume.thickness_texture);
}
if(data->materials[i].has_sheen)
{
- cgltf_free_extensions(data, data->materials[i].sheen.sheen_color_texture.extensions, data->materials[i].sheen.sheen_color_texture.extensions_count);
- cgltf_free_extensions(data, data->materials[i].sheen.sheen_roughness_texture.extensions, data->materials[i].sheen.sheen_roughness_texture.extensions_count);
+ cgltf_free_texture_view(data, &data->materials[i].sheen.sheen_color_texture);
+ cgltf_free_texture_view(data, &data->materials[i].sheen.sheen_roughness_texture);
+ }
+ if(data->materials[i].has_iridescence)
+ {
+ cgltf_free_texture_view(data, &data->materials[i].iridescence.iridescence_texture);
+ cgltf_free_texture_view(data, &data->materials[i].iridescence.iridescence_thickness_texture);
}
- cgltf_free_extensions(data, data->materials[i].normal_texture.extensions, data->materials[i].normal_texture.extensions_count);
- cgltf_free_extensions(data, data->materials[i].occlusion_texture.extensions, data->materials[i].occlusion_texture.extensions_count);
- cgltf_free_extensions(data, data->materials[i].emissive_texture.extensions, data->materials[i].emissive_texture.extensions_count);
+ cgltf_free_texture_view(data, &data->materials[i].normal_texture);
+ cgltf_free_texture_view(data, &data->materials[i].occlusion_texture);
+ cgltf_free_texture_view(data, &data->materials[i].emissive_texture);
cgltf_free_extensions(data, data->materials[i].extensions, data->materials[i].extensions_count);
+ cgltf_free_extras(data, &data->materials[i].extras);
}
- data->memory.free(data->memory.user_data, data->materials);
+ data->memory.free_func(data->memory.user_data, data->materials);
for (cgltf_size i = 0; i < data->images_count; ++i)
{
- data->memory.free(data->memory.user_data, data->images[i].name);
- data->memory.free(data->memory.user_data, data->images[i].uri);
- data->memory.free(data->memory.user_data, data->images[i].mime_type);
+ data->memory.free_func(data->memory.user_data, data->images[i].name);
+ data->memory.free_func(data->memory.user_data, data->images[i].uri);
+ data->memory.free_func(data->memory.user_data, data->images[i].mime_type);
cgltf_free_extensions(data, data->images[i].extensions, data->images[i].extensions_count);
+ cgltf_free_extras(data, &data->images[i].extras);
}
- data->memory.free(data->memory.user_data, data->images);
+ data->memory.free_func(data->memory.user_data, data->images);
for (cgltf_size i = 0; i < data->textures_count; ++i)
{
- data->memory.free(data->memory.user_data, data->textures[i].name);
+ data->memory.free_func(data->memory.user_data, data->textures[i].name);
+
cgltf_free_extensions(data, data->textures[i].extensions, data->textures[i].extensions_count);
+ cgltf_free_extras(data, &data->textures[i].extras);
}
- data->memory.free(data->memory.user_data, data->textures);
+ data->memory.free_func(data->memory.user_data, data->textures);
for (cgltf_size i = 0; i < data->samplers_count; ++i)
{
- data->memory.free(data->memory.user_data, data->samplers[i].name);
+ data->memory.free_func(data->memory.user_data, data->samplers[i].name);
+
cgltf_free_extensions(data, data->samplers[i].extensions, data->samplers[i].extensions_count);
+ cgltf_free_extras(data, &data->samplers[i].extras);
}
- data->memory.free(data->memory.user_data, data->samplers);
+ data->memory.free_func(data->memory.user_data, data->samplers);
for (cgltf_size i = 0; i < data->skins_count; ++i)
{
- data->memory.free(data->memory.user_data, data->skins[i].name);
- data->memory.free(data->memory.user_data, data->skins[i].joints);
+ data->memory.free_func(data->memory.user_data, data->skins[i].name);
+ data->memory.free_func(data->memory.user_data, data->skins[i].joints);
cgltf_free_extensions(data, data->skins[i].extensions, data->skins[i].extensions_count);
+ cgltf_free_extras(data, &data->skins[i].extras);
}
- data->memory.free(data->memory.user_data, data->skins);
+ data->memory.free_func(data->memory.user_data, data->skins);
for (cgltf_size i = 0; i < data->cameras_count; ++i)
{
- data->memory.free(data->memory.user_data, data->cameras[i].name);
+ data->memory.free_func(data->memory.user_data, data->cameras[i].name);
+
+ if (data->cameras[i].type == cgltf_camera_type_perspective)
+ {
+ cgltf_free_extras(data, &data->cameras[i].data.perspective.extras);
+ }
+ else if (data->cameras[i].type == cgltf_camera_type_orthographic)
+ {
+ cgltf_free_extras(data, &data->cameras[i].data.orthographic.extras);
+ }
+
cgltf_free_extensions(data, data->cameras[i].extensions, data->cameras[i].extensions_count);
+ cgltf_free_extras(data, &data->cameras[i].extras);
}
- data->memory.free(data->memory.user_data, data->cameras);
+ data->memory.free_func(data->memory.user_data, data->cameras);
for (cgltf_size i = 0; i < data->lights_count; ++i)
{
- data->memory.free(data->memory.user_data, data->lights[i].name);
+ data->memory.free_func(data->memory.user_data, data->lights[i].name);
+
+ cgltf_free_extras(data, &data->lights[i].extras);
}
- data->memory.free(data->memory.user_data, data->lights);
+ data->memory.free_func(data->memory.user_data, data->lights);
for (cgltf_size i = 0; i < data->nodes_count; ++i)
{
- data->memory.free(data->memory.user_data, data->nodes[i].name);
- data->memory.free(data->memory.user_data, data->nodes[i].children);
- data->memory.free(data->memory.user_data, data->nodes[i].weights);
+ data->memory.free_func(data->memory.user_data, data->nodes[i].name);
+ data->memory.free_func(data->memory.user_data, data->nodes[i].children);
+ data->memory.free_func(data->memory.user_data, data->nodes[i].weights);
+
+ if (data->nodes[i].has_mesh_gpu_instancing)
+ {
+ for (cgltf_size j = 0; j < data->nodes[i].mesh_gpu_instancing.attributes_count; ++j)
+ {
+ data->memory.free_func(data->memory.user_data, data->nodes[i].mesh_gpu_instancing.attributes[j].name);
+ }
+
+ data->memory.free_func(data->memory.user_data, data->nodes[i].mesh_gpu_instancing.attributes);
+ }
+
cgltf_free_extensions(data, data->nodes[i].extensions, data->nodes[i].extensions_count);
+ cgltf_free_extras(data, &data->nodes[i].extras);
}
- data->memory.free(data->memory.user_data, data->nodes);
+ data->memory.free_func(data->memory.user_data, data->nodes);
for (cgltf_size i = 0; i < data->scenes_count; ++i)
{
- data->memory.free(data->memory.user_data, data->scenes[i].name);
- data->memory.free(data->memory.user_data, data->scenes[i].nodes);
+ data->memory.free_func(data->memory.user_data, data->scenes[i].name);
+ data->memory.free_func(data->memory.user_data, data->scenes[i].nodes);
cgltf_free_extensions(data, data->scenes[i].extensions, data->scenes[i].extensions_count);
+ cgltf_free_extras(data, &data->scenes[i].extras);
}
- data->memory.free(data->memory.user_data, data->scenes);
+ data->memory.free_func(data->memory.user_data, data->scenes);
for (cgltf_size i = 0; i < data->animations_count; ++i)
{
- data->memory.free(data->memory.user_data, data->animations[i].name);
+ data->memory.free_func(data->memory.user_data, data->animations[i].name);
for (cgltf_size j = 0; j < data->animations[i].samplers_count; ++j)
{
cgltf_free_extensions(data, data->animations[i].samplers[j].extensions, data->animations[i].samplers[j].extensions_count);
+ cgltf_free_extras(data, &data->animations[i].samplers[j].extras);
}
- data->memory.free(data->memory.user_data, data->animations[i].samplers);
+ data->memory.free_func(data->memory.user_data, data->animations[i].samplers);
for (cgltf_size j = 0; j < data->animations[i].channels_count; ++j)
{
cgltf_free_extensions(data, data->animations[i].channels[j].extensions, data->animations[i].channels[j].extensions_count);
+ cgltf_free_extras(data, &data->animations[i].channels[j].extras);
}
- data->memory.free(data->memory.user_data, data->animations[i].channels);
+ data->memory.free_func(data->memory.user_data, data->animations[i].channels);
cgltf_free_extensions(data, data->animations[i].extensions, data->animations[i].extensions_count);
+ cgltf_free_extras(data, &data->animations[i].extras);
}
- data->memory.free(data->memory.user_data, data->animations);
+ data->memory.free_func(data->memory.user_data, data->animations);
for (cgltf_size i = 0; i < data->variants_count; ++i)
{
- data->memory.free(data->memory.user_data, data->variants[i].name);
+ data->memory.free_func(data->memory.user_data, data->variants[i].name);
+
+ cgltf_free_extras(data, &data->variants[i].extras);
}
- data->memory.free(data->memory.user_data, data->variants);
+ data->memory.free_func(data->memory.user_data, data->variants);
cgltf_free_extensions(data, data->data_extensions, data->data_extensions_count);
+ cgltf_free_extras(data, &data->extras);
for (cgltf_size i = 0; i < data->extensions_used_count; ++i)
{
- data->memory.free(data->memory.user_data, data->extensions_used[i]);
+ data->memory.free_func(data->memory.user_data, data->extensions_used[i]);
}
- data->memory.free(data->memory.user_data, data->extensions_used);
+ data->memory.free_func(data->memory.user_data, data->extensions_used);
for (cgltf_size i = 0; i < data->extensions_required_count; ++i)
{
- data->memory.free(data->memory.user_data, data->extensions_required[i]);
+ data->memory.free_func(data->memory.user_data, data->extensions_required[i]);
}
- data->memory.free(data->memory.user_data, data->extensions_required);
+ data->memory.free_func(data->memory.user_data, data->extensions_required);
file_release(&data->memory, &data->file, data->file_data);
- data->memory.free(data->memory.user_data, data);
+ data->memory.free_func(data->memory.user_data, data);
}
void cgltf_node_transform_local(const cgltf_node* node, cgltf_float* out_matrix)
@@ -2063,7 +2187,7 @@ void cgltf_node_transform_world(const cgltf_node* node, cgltf_float* out_matrix)
}
}
-static cgltf_size cgltf_component_read_index(const void* in, cgltf_component_type component_type)
+static cgltf_ssize cgltf_component_read_integer(const void* in, cgltf_component_type component_type)
{
switch (component_type)
{
@@ -2074,7 +2198,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_ssize)*((const float*) in);
case cgltf_component_type_r_8:
return *((const int8_t*) in);
case cgltf_component_type_r_8u:
@@ -2084,6 +2208,23 @@ static cgltf_size cgltf_component_read_index(const void* in, cgltf_component_typ
}
}
+static cgltf_size cgltf_component_read_index(const void* in, cgltf_component_type component_type)
+{
+ switch (component_type)
+ {
+ case cgltf_component_type_r_16u:
+ return *((const uint16_t*) in);
+ case cgltf_component_type_r_32u:
+ return *((const uint32_t*) in);
+ case cgltf_component_type_r_32f:
+ return (cgltf_size)*((const float*) in);
+ case cgltf_component_type_r_8u:
+ return *((const uint8_t*) in);
+ default:
+ return 0;
+ }
+}
+
static cgltf_float cgltf_component_read_float(const void* in, cgltf_component_type component_type, cgltf_bool normalized)
{
if (component_type == cgltf_component_type_r_32f)
@@ -2109,7 +2250,7 @@ static cgltf_float cgltf_component_read_float(const void* in, cgltf_component_ty
}
}
- return (cgltf_float)cgltf_component_read_index(in, component_type);
+ return (cgltf_float)cgltf_component_read_integer(in, component_type);
}
static cgltf_size cgltf_component_size(cgltf_component_type component_type);
@@ -2467,7 +2608,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;
- char* result = (char*)options->memory.alloc(options->memory.user_data, size + 1);
+ char* result = (char*)options->memory.alloc_func(options->memory.user_data, size + 1);
if (!result)
{
return CGLTF_ERROR_NOMEM;
@@ -2522,6 +2663,12 @@ static int cgltf_parse_json_string_array(cgltf_options* options, jsmntok_t const
static void cgltf_parse_attribute_type(const char* name, cgltf_attribute_type* out_type, int* out_index)
{
+ if (*name == '_')
+ {
+ *out_type = cgltf_attribute_type_custom;
+ return;
+ }
+
const char* us = strchr(name, '_');
size_t len = us ? (size_t)(us - name) : strlen(name);
@@ -2601,11 +2748,27 @@ static int cgltf_parse_json_attribute_list(cgltf_options* options, jsmntok_t con
return i;
}
-static int cgltf_parse_json_extras(jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_extras* out_extras)
+static int cgltf_parse_json_extras(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_extras* out_extras)
{
- (void)json_chunk;
+ if (out_extras->data)
+ {
+ return CGLTF_ERROR_JSON;
+ }
+
+ /* fill deprecated fields for now, this will be removed in the future */
out_extras->start_offset = tokens[i].start;
out_extras->end_offset = tokens[i].end;
+
+ size_t start = tokens[i].start;
+ size_t size = tokens[i].end - start;
+ out_extras->data = (char*)options->memory.alloc_func(options->memory.user_data, size + 1);
+ if (!out_extras->data)
+ {
+ return CGLTF_ERROR_NOMEM;
+ }
+ strncpy(out_extras->data, (const char*)json_chunk + start, size);
+ out_extras->data[size] = '\0';
+
i = cgltf_skip_json(tokens, i);
return i;
}
@@ -2620,7 +2783,7 @@ static int cgltf_parse_json_unprocessed_extension(cgltf_options* options, jsmnto
}
cgltf_size name_length = tokens[i].end - tokens[i].start;
- out_extension->name = (char*)options->memory.alloc(options->memory.user_data, name_length + 1);
+ out_extension->name = (char*)options->memory.alloc_func(options->memory.user_data, name_length + 1);
if (!out_extension->name)
{
return CGLTF_ERROR_NOMEM;
@@ -2631,7 +2794,7 @@ static int cgltf_parse_json_unprocessed_extension(cgltf_options* options, jsmnto
size_t start = tokens[i].start;
size_t size = tokens[i].end - start;
- out_extension->data = (char*)options->memory.alloc(options->memory.user_data, size + 1);
+ out_extension->data = (char*)options->memory.alloc_func(options->memory.user_data, size + 1);
if (!out_extension->data)
{
return CGLTF_ERROR_NOMEM;
@@ -2712,6 +2875,37 @@ static int cgltf_parse_json_draco_mesh_compression(cgltf_options* options, jsmnt
return i;
}
+static int cgltf_parse_json_mesh_gpu_instancing(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_mesh_gpu_instancing* out_mesh_gpu_instancing)
+{
+ CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT);
+
+ int size = tokens[i].size;
+ ++i;
+
+ for (int j = 0; j < size; ++j)
+ {
+ CGLTF_CHECK_KEY(tokens[i]);
+
+ if (cgltf_json_strcmp(tokens + i, json_chunk, "attributes") == 0)
+ {
+ i = cgltf_parse_json_attribute_list(options, tokens, i + 1, json_chunk, &out_mesh_gpu_instancing->attributes, &out_mesh_gpu_instancing->attributes_count);
+ }
+ else if (cgltf_json_strcmp(tokens + i, json_chunk, "bufferView") == 0)
+ {
+ ++i;
+ out_mesh_gpu_instancing->buffer_view = CGLTF_PTRINDEX(cgltf_buffer_view, cgltf_json_to_int(tokens + i, json_chunk));
+ ++i;
+ }
+
+ if (i < 0)
+ {
+ return i;
+ }
+ }
+
+ return i;
+}
+
static int cgltf_parse_json_material_mapping_data(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_material_mapping* out_mappings, cgltf_size* offset)
{
(void)options;
@@ -2729,7 +2923,7 @@ static int cgltf_parse_json_material_mapping_data(cgltf_options* options, jsmnto
int material = -1;
int variants_tok = -1;
- cgltf_extras extras = {0, 0};
+ int extras_tok = -1;
for (int k = 0; k < obj_size; ++k)
{
@@ -2750,7 +2944,8 @@ static int cgltf_parse_json_material_mapping_data(cgltf_options* options, jsmnto
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &extras);
+ extras_tok = i + 1;
+ i = cgltf_skip_json(tokens, extras_tok);
}
else
{
@@ -2778,7 +2973,13 @@ static int cgltf_parse_json_material_mapping_data(cgltf_options* options, jsmnto
out_mappings[*offset].material = CGLTF_PTRINDEX(cgltf_material, material);
out_mappings[*offset].variant = variant;
- out_mappings[*offset].extras = extras;
+
+ if (extras_tok >= 0)
+ {
+ int e = cgltf_parse_json_extras(options, tokens, extras_tok, json_chunk, &out_mappings[*offset].extras);
+ if (e < 0)
+ return e;
+ }
(*offset)++;
}
@@ -2893,7 +3094,7 @@ static int cgltf_parse_json_primitive(cgltf_options* options, jsmntok_t const* t
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_prim->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_prim->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -3140,7 +3341,7 @@ static int cgltf_parse_json_accessor_sparse(cgltf_options* options, jsmntok_t co
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_sparse->indices_extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_sparse->indices_extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -3183,7 +3384,7 @@ static int cgltf_parse_json_accessor_sparse(cgltf_options* options, jsmntok_t co
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_sparse->values_extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_sparse->values_extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -3202,7 +3403,7 @@ static int cgltf_parse_json_accessor_sparse(cgltf_options* options, jsmntok_t co
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_sparse->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_sparse->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -3325,7 +3526,7 @@ static int cgltf_parse_json_accessor(cgltf_options* options, jsmntok_t const* to
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_accessor->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_accessor->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -3431,7 +3632,7 @@ static int cgltf_parse_json_texture_view(cgltf_options* options, jsmntok_t const
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_texture_view->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_texture_view->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -3527,10 +3728,6 @@ static int cgltf_parse_json_pbr_metallic_roughness(cgltf_options* options, jsmnt
i = cgltf_parse_json_texture_view(options, tokens, i + 1, json_chunk,
&out_pbr->metallic_roughness_texture);
}
- else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
- {
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_pbr->extras);
- }
else
{
i = cgltf_skip_json(tokens, i+1);
@@ -3838,6 +4035,100 @@ static int cgltf_parse_json_sheen(cgltf_options* options, jsmntok_t const* token
return i;
}
+static int cgltf_parse_json_emissive_strength(jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_emissive_strength* out_emissive_strength)
+{
+ CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT);
+ int size = tokens[i].size;
+ ++i;
+
+ // Default
+ out_emissive_strength->emissive_strength = 1.f;
+
+ for (int j = 0; j < size; ++j)
+ {
+ CGLTF_CHECK_KEY(tokens[i]);
+
+ if (cgltf_json_strcmp(tokens + i, json_chunk, "emissiveStrength") == 0)
+ {
+ ++i;
+ out_emissive_strength->emissive_strength = cgltf_json_to_float(tokens + i, json_chunk);
+ ++i;
+ }
+ else
+ {
+ i = cgltf_skip_json(tokens, i + 1);
+ }
+
+ if (i < 0)
+ {
+ return i;
+ }
+ }
+
+ return i;
+}
+
+static int cgltf_parse_json_iridescence(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_iridescence* out_iridescence)
+{
+ CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT);
+ int size = tokens[i].size;
+ ++i;
+
+ // Default
+ out_iridescence->iridescence_ior = 1.3f;
+ out_iridescence->iridescence_thickness_min = 100.f;
+ out_iridescence->iridescence_thickness_max = 400.f;
+
+ for (int j = 0; j < size; ++j)
+ {
+ CGLTF_CHECK_KEY(tokens[i]);
+
+ if (cgltf_json_strcmp(tokens + i, json_chunk, "iridescenceFactor") == 0)
+ {
+ ++i;
+ out_iridescence->iridescence_factor = cgltf_json_to_float(tokens + i, json_chunk);
+ ++i;
+ }
+ else if (cgltf_json_strcmp(tokens + i, json_chunk, "iridescenceTexture") == 0)
+ {
+ i = cgltf_parse_json_texture_view(options, tokens, i + 1, json_chunk, &out_iridescence->iridescence_texture);
+ }
+ else if (cgltf_json_strcmp(tokens + i, json_chunk, "iridescenceIor") == 0)
+ {
+ ++i;
+ out_iridescence->iridescence_ior = cgltf_json_to_float(tokens + i, json_chunk);
+ ++i;
+ }
+ else if (cgltf_json_strcmp(tokens + i, json_chunk, "iridescenceThicknessMinimum") == 0)
+ {
+ ++i;
+ out_iridescence->iridescence_thickness_min = cgltf_json_to_float(tokens + i, json_chunk);
+ ++i;
+ }
+ else if (cgltf_json_strcmp(tokens + i, json_chunk, "iridescenceThicknessMaximum") == 0)
+ {
+ ++i;
+ out_iridescence->iridescence_thickness_max = cgltf_json_to_float(tokens + i, json_chunk);
+ ++i;
+ }
+ else if (cgltf_json_strcmp(tokens + i, json_chunk, "iridescenceThicknessTexture") == 0)
+ {
+ i = cgltf_parse_json_texture_view(options, tokens, i + 1, json_chunk, &out_iridescence->iridescence_thickness_texture);
+ }
+ else
+ {
+ i = cgltf_skip_json(tokens, i + 1);
+ }
+
+ if (i < 0)
+ {
+ return i;
+ }
+ }
+
+ return i;
+}
+
static int cgltf_parse_json_image(cgltf_options* options, jsmntok_t const* tokens, int i, const uint8_t* json_chunk, cgltf_image* out_image)
{
CGLTF_CHECK_TOKTYPE(tokens[i], JSMN_OBJECT);
@@ -3869,7 +4160,7 @@ static int cgltf_parse_json_image(cgltf_options* options, jsmntok_t const* token
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_image->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_image->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -3938,7 +4229,7 @@ static int cgltf_parse_json_sampler(cgltf_options* options, jsmntok_t const* tok
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_sampler->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_sampler->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -3987,7 +4278,7 @@ static int cgltf_parse_json_texture(cgltf_options* options, jsmntok_t const* tok
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_texture->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_texture->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -4035,6 +4326,10 @@ static int cgltf_parse_json_texture(cgltf_options* options, jsmntok_t const* tok
{
i = cgltf_skip_json(tokens, i + 1);
}
+ if (i < 0)
+ {
+ return i;
+ }
}
}
else
@@ -4146,7 +4441,7 @@ static int cgltf_parse_json_material(cgltf_options* options, jsmntok_t const* to
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_material->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_material->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -4212,6 +4507,16 @@ static int cgltf_parse_json_material(cgltf_options* options, jsmntok_t const* to
out_material->has_sheen = 1;
i = cgltf_parse_json_sheen(options, tokens, i + 1, json_chunk, &out_material->sheen);
}
+ else if (cgltf_json_strcmp(tokens + i, json_chunk, "KHR_materials_emissive_strength") == 0)
+ {
+ out_material->has_emissive_strength = 1;
+ i = cgltf_parse_json_emissive_strength(tokens, i + 1, json_chunk, &out_material->emissive_strength);
+ }
+ else if (cgltf_json_strcmp(tokens + i, json_chunk, "KHR_materials_iridescence") == 0)
+ {
+ out_material->has_iridescence = 1;
+ i = cgltf_parse_json_iridescence(options, tokens, i + 1, json_chunk, &out_material->iridescence);
+ }
else
{
i = cgltf_parse_json_unprocessed_extension(options, tokens, i, json_chunk, &(out_material->extensions[out_material->extensions_count++]));
@@ -4489,7 +4794,7 @@ static int cgltf_parse_json_buffer_view(cgltf_options* options, jsmntok_t const*
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_buffer_view->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_buffer_view->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -4592,7 +4897,7 @@ static int cgltf_parse_json_buffer(cgltf_options* options, jsmntok_t const* toke
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_buffer->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_buffer->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -4676,7 +4981,7 @@ static int cgltf_parse_json_skin(cgltf_options* options, jsmntok_t const* tokens
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_skin->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_skin->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -4730,19 +5035,6 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke
{
i = cgltf_parse_json_string(options, tokens, i + 1, json_chunk, &out_camera->name);
}
- else if (cgltf_json_strcmp(tokens+i, json_chunk, "type") == 0)
- {
- ++i;
- if (cgltf_json_strcmp(tokens + i, json_chunk, "perspective") == 0)
- {
- out_camera->type = cgltf_camera_type_perspective;
- }
- else if (cgltf_json_strcmp(tokens + i, json_chunk, "orthographic") == 0)
- {
- out_camera->type = cgltf_camera_type_orthographic;
- }
- ++i;
- }
else if (cgltf_json_strcmp(tokens+i, json_chunk, "perspective") == 0)
{
++i;
@@ -4752,6 +5044,11 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke
int data_size = tokens[i].size;
++i;
+ if (out_camera->type != cgltf_camera_type_invalid)
+ {
+ return CGLTF_ERROR_JSON;
+ }
+
out_camera->type = cgltf_camera_type_perspective;
for (int k = 0; k < data_size; ++k)
@@ -4786,7 +5083,7 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_camera->data.perspective.extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_camera->data.perspective.extras);
}
else
{
@@ -4808,6 +5105,11 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke
int data_size = tokens[i].size;
++i;
+ if (out_camera->type != cgltf_camera_type_invalid)
+ {
+ return CGLTF_ERROR_JSON;
+ }
+
out_camera->type = cgltf_camera_type_orthographic;
for (int k = 0; k < data_size; ++k)
@@ -4840,7 +5142,7 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_camera->data.orthographic.extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_camera->data.orthographic.extras);
}
else
{
@@ -4855,7 +5157,7 @@ static int cgltf_parse_json_camera(cgltf_options* options, jsmntok_t const* toke
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_camera->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_camera->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -4988,7 +5290,7 @@ static int cgltf_parse_json_light(cgltf_options* options, jsmntok_t const* token
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_light->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_light->extras);
}
else
{
@@ -5114,7 +5416,7 @@ static int cgltf_parse_json_node(cgltf_options* options, jsmntok_t const* tokens
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_node->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_node->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -5172,6 +5474,11 @@ static int cgltf_parse_json_node(cgltf_options* options, jsmntok_t const* tokens
}
}
}
+ else if (cgltf_json_strcmp(tokens + i, json_chunk, "EXT_mesh_gpu_instancing") == 0)
+ {
+ out_node->has_mesh_gpu_instancing = 1;
+ i = cgltf_parse_json_mesh_gpu_instancing(options, tokens, i + 1, json_chunk, &out_node->mesh_gpu_instancing);
+ }
else
{
i = cgltf_parse_json_unprocessed_extension(options, tokens, i, json_chunk, &(out_node->extensions[out_node->extensions_count++]));
@@ -5247,7 +5554,7 @@ static int cgltf_parse_json_scene(cgltf_options* options, jsmntok_t const* token
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_scene->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_scene->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -5329,7 +5636,7 @@ static int cgltf_parse_json_animation_sampler(cgltf_options* options, jsmntok_t
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_sampler->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_sampler->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -5409,7 +5716,7 @@ static int cgltf_parse_json_animation_channel(cgltf_options* options, jsmntok_t
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_channel->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_channel->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -5491,7 +5798,7 @@ static int cgltf_parse_json_animation(cgltf_options* options, jsmntok_t const* t
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_animation->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_animation->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -5547,7 +5854,7 @@ static int cgltf_parse_json_variant(cgltf_options* options, jsmntok_t const* tok
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_variant->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_variant->extras);
}
else
{
@@ -5611,7 +5918,7 @@ static int cgltf_parse_json_asset(cgltf_options* options, jsmntok_t const* token
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_asset->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_asset->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -5767,7 +6074,7 @@ static int cgltf_parse_json_root(cgltf_options* options, jsmntok_t const* tokens
}
else if (cgltf_json_strcmp(tokens+i, json_chunk, "extras") == 0)
{
- i = cgltf_parse_json_extras(tokens, i + 1, json_chunk, &out_data->extras);
+ i = cgltf_parse_json_extras(options, tokens, i + 1, json_chunk, &out_data->extras);
}
else if (cgltf_json_strcmp(tokens + i, json_chunk, "extensions") == 0)
{
@@ -5899,7 +6206,7 @@ cgltf_result cgltf_parse_json(cgltf_options* options, const uint8_t* json_chunk,
options->json_token_count = token_count;
}
- jsmntok_t* tokens = (jsmntok_t*)options->memory.alloc(options->memory.user_data, sizeof(jsmntok_t) * (options->json_token_count + 1));
+ jsmntok_t* tokens = (jsmntok_t*)options->memory.alloc_func(options->memory.user_data, sizeof(jsmntok_t) * (options->json_token_count + 1));
if (!tokens)
{
@@ -5912,7 +6219,7 @@ cgltf_result cgltf_parse_json(cgltf_options* options, const uint8_t* json_chunk,
if (token_count <= 0)
{
- options->memory.free(options->memory.user_data, tokens);
+ options->memory.free_func(options->memory.user_data, tokens);
return cgltf_result_invalid_json;
}
@@ -5920,11 +6227,11 @@ cgltf_result cgltf_parse_json(cgltf_options* options, const uint8_t* json_chunk,
// for invalid JSON inputs this makes sure we don't perform out of bound reads of token data
tokens[token_count].type = JSMN_UNDEFINED;
- cgltf_data* data = (cgltf_data*)options->memory.alloc(options->memory.user_data, sizeof(cgltf_data));
+ cgltf_data* data = (cgltf_data*)options->memory.alloc_func(options->memory.user_data, sizeof(cgltf_data));
if (!data)
{
- options->memory.free(options->memory.user_data, tokens);
+ options->memory.free_func(options->memory.user_data, tokens);
return cgltf_result_out_of_memory;
}
@@ -5934,7 +6241,7 @@ cgltf_result cgltf_parse_json(cgltf_options* options, const uint8_t* json_chunk,
int i = cgltf_parse_json_root(options, tokens, 0, json_chunk, data);
- options->memory.free(options->memory.user_data, tokens);
+ options->memory.free_func(options->memory.user_data, tokens);
if (i < 0)
{
@@ -6058,6 +6365,9 @@ static int cgltf_fixup_pointers(cgltf_data* data)
CGLTF_PTRFIXUP(data->materials[i].sheen.sheen_color_texture.texture, data->textures, data->textures_count);
CGLTF_PTRFIXUP(data->materials[i].sheen.sheen_roughness_texture.texture, data->textures, data->textures_count);
+
+ CGLTF_PTRFIXUP(data->materials[i].iridescence.iridescence_texture.texture, data->textures, data->textures_count);
+ CGLTF_PTRFIXUP(data->materials[i].iridescence.iridescence_thickness_texture.texture, data->textures, data->textures_count);
}
for (cgltf_size i = 0; i < data->buffer_views_count; ++i)
@@ -6099,6 +6409,15 @@ static int cgltf_fixup_pointers(cgltf_data* data)
CGLTF_PTRFIXUP(data->nodes[i].skin, data->skins, data->skins_count);
CGLTF_PTRFIXUP(data->nodes[i].camera, data->cameras, data->cameras_count);
CGLTF_PTRFIXUP(data->nodes[i].light, data->lights, data->lights_count);
+
+ if (data->nodes[i].has_mesh_gpu_instancing)
+ {
+ CGLTF_PTRFIXUP_REQ(data->nodes[i].mesh_gpu_instancing.buffer_view, data->buffer_views, data->buffer_views_count);
+ for (cgltf_size m = 0; m < data->nodes[i].mesh_gpu_instancing.attributes_count; ++m)
+ {
+ CGLTF_PTRFIXUP_REQ(data->nodes[i].mesh_gpu_instancing.attributes[m].data, data->accessors, data->accessors_count);
+ }
+ }
}
for (cgltf_size i = 0; i < data->scenes_count; ++i)
diff --git a/3rdparty/bgfx/3rdparty/cgltf/cgltf_write.h b/3rdparty/bgfx/3rdparty/cgltf/cgltf_write.h
index 8b96eb2b664..033b0d1ccab 100644
--- a/3rdparty/bgfx/3rdparty/cgltf/cgltf_write.h
+++ b/3rdparty/bgfx/3rdparty/cgltf/cgltf_write.h
@@ -1,7 +1,7 @@
/**
* cgltf_write - a single-file glTF 2.0 writer written in C99.
*
- * Version: 1.11
+ * Version: 1.13
*
* Website: https://github.com/jkuhlmann/cgltf
*
@@ -15,19 +15,17 @@
*
* Reference:
* `cgltf_result cgltf_write_file(const cgltf_options* options, const char*
- * path, const cgltf_data* data)` writes JSON to the given file path. Buffer
- * files and external images are not written out. `data` is not deallocated.
+ * path, const cgltf_data* data)` writes a glTF data to the given file path.
+ * If `options->type` is `cgltf_file_type_glb`, both JSON content and binary
+ * buffer of the given glTF data will be written in a GLB format.
+ * Otherwise, only the JSON part will be written.
+ * External buffers and images are not written out. `data` is not deallocated.
*
* `cgltf_size cgltf_write(const cgltf_options* options, char* buffer,
* cgltf_size size, const cgltf_data* data)` writes JSON into the given memory
* buffer. Returns the number of bytes written to `buffer`, including a null
* terminator. If buffer is null, returns the number of bytes that would have
* been written. `data` is not deallocated.
- *
- * To write custom JSON into the `extras` field, aggregate all the custom JSON
- * into a single buffer, then set `file_data` to this buffer. By supplying
- * start_offset and end_offset values for various objects, you can select a
- * range of characters within the aggregated buffer.
*/
#ifndef CGLTF_WRITE_H_INCLUDED__
#define CGLTF_WRITE_H_INCLUDED__
@@ -59,7 +57,7 @@ cgltf_size cgltf_write(const cgltf_options* options, char* buffer, cgltf_size si
#if defined(__INTELLISENSE__) || defined(__JETBRAINS_IDE__)
/* This makes MSVC/CLion intellisense work. */
-#define CGLTF_IMPLEMENTATION
+#define CGLTF_WRITE_IMPLEMENTATION
#endif
#ifdef CGLTF_WRITE_IMPLEMENTATION
@@ -84,6 +82,9 @@ cgltf_size cgltf_write(const cgltf_options* options, char* buffer, cgltf_size si
#define CGLTF_EXTENSION_FLAG_MATERIALS_VARIANTS (1 << 10)
#define CGLTF_EXTENSION_FLAG_MATERIALS_VOLUME (1 << 11)
#define CGLTF_EXTENSION_FLAG_TEXTURE_BASISU (1 << 12)
+#define CGLTF_EXTENSION_FLAG_MATERIALS_EMISSIVE_STRENGTH (1 << 13)
+#define CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING (1 << 14)
+#define CGLTF_EXTENSION_FLAG_MATERIALS_IRIDESCENCE (1 << 15)
typedef struct {
char* buffer;
@@ -147,6 +148,17 @@ typedef struct {
cgltf_write_line(context, "\"" label "\": {"); \
CGLTF_WRITE_IDXPROP("index", info.texture, context->data->textures); \
cgltf_write_intprop(context, "texCoord", info.texcoord, 0); \
+ if (info.has_transform) { \
+ context->extension_flags |= CGLTF_EXTENSION_FLAG_TEXTURE_TRANSFORM; \
+ cgltf_write_texture_transform(context, &info.transform); \
+ } \
+ cgltf_write_extras(context, &info.extras); \
+ cgltf_write_line(context, "}"); }
+
+#define CGLTF_WRITE_NORMAL_TEXTURE_INFO(label, info) if (info.texture) { \
+ cgltf_write_line(context, "\"" label "\": {"); \
+ CGLTF_WRITE_IDXPROP("index", info.texture, context->data->textures); \
+ cgltf_write_intprop(context, "texCoord", info.texcoord, 0); \
cgltf_write_floatprop(context, "scale", info.scale, 1.0f); \
if (info.has_transform) { \
context->extension_flags |= CGLTF_EXTENSION_FLAG_TEXTURE_TRANSFORM; \
@@ -155,6 +167,28 @@ typedef struct {
cgltf_write_extras(context, &info.extras); \
cgltf_write_line(context, "}"); }
+#define CGLTF_WRITE_OCCLUSION_TEXTURE_INFO(label, info) if (info.texture) { \
+ cgltf_write_line(context, "\"" label "\": {"); \
+ CGLTF_WRITE_IDXPROP("index", info.texture, context->data->textures); \
+ cgltf_write_intprop(context, "texCoord", info.texcoord, 0); \
+ cgltf_write_floatprop(context, "strength", info.scale, 1.0f); \
+ if (info.has_transform) { \
+ context->extension_flags |= CGLTF_EXTENSION_FLAG_TEXTURE_TRANSFORM; \
+ cgltf_write_texture_transform(context, &info.transform); \
+ } \
+ cgltf_write_extras(context, &info.extras); \
+ cgltf_write_line(context, "}"); }
+
+#ifndef CGLTF_CONSTS
+static const cgltf_size GlbHeaderSize = 12;
+static const cgltf_size GlbChunkHeaderSize = 8;
+static const uint32_t GlbVersion = 2;
+static const uint32_t GlbMagic = 0x46546C67;
+static const uint32_t GlbMagicJsonChunk = 0x4E4F534A;
+static const uint32_t GlbMagicBinChunk = 0x004E4942;
+#define CGLTF_CONSTS
+#endif
+
static void cgltf_write_indent(cgltf_write_context* context)
{
if (context->needs_comma)
@@ -205,15 +239,24 @@ static void cgltf_write_strprop(cgltf_write_context* context, const char* label,
static void cgltf_write_extras(cgltf_write_context* context, const cgltf_extras* extras)
{
- cgltf_size length = extras->end_offset - extras->start_offset;
- if (length > 0 && context->data->file_data)
+ if (extras->data)
{
- char* json_string = ((char*) context->data->file_data) + extras->start_offset;
cgltf_write_indent(context);
- CGLTF_SPRINTF("%s", "\"extras\": ");
- CGLTF_SNPRINTF(length, "%.*s", (int)(extras->end_offset - extras->start_offset), json_string);
+ CGLTF_SPRINTF("\"extras\": %s", extras->data);
context->needs_comma = 1;
}
+ else
+ {
+ cgltf_size length = extras->end_offset - extras->start_offset;
+ if (length > 0 && context->data->json)
+ {
+ char* json_string = ((char*) context->data->json) + extras->start_offset;
+ cgltf_write_indent(context);
+ CGLTF_SPRINTF("%s", "\"extras\": ");
+ CGLTF_SNPRINTF(length, "%.*s", (int)(extras->end_offset - extras->start_offset), json_string);
+ context->needs_comma = 1;
+ }
+ }
}
static void cgltf_write_stritem(cgltf_write_context* context, const char* item)
@@ -508,6 +551,7 @@ static void cgltf_write_mesh(cgltf_write_context* context, const cgltf_mesh* mes
{
cgltf_write_floatarrayprop(context, "weights", mesh->weights, mesh->weights_count);
}
+
cgltf_write_extras(context, &mesh->extras);
cgltf_write_line(context, "}");
}
@@ -544,7 +588,7 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater
{
cgltf_write_floatprop(context, "alphaCutoff", material->alpha_cutoff, 0.5f);
}
- cgltf_write_boolprop_optional(context, "doubleSided", material->double_sided, false);
+ cgltf_write_boolprop_optional(context, "doubleSided", (bool)material->double_sided, false);
// cgltf_write_boolprop_optional(context, "unlit", material->unlit, false);
if (material->unlit)
@@ -587,6 +631,16 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater
context->extension_flags |= CGLTF_EXTENSION_FLAG_MATERIALS_SHEEN;
}
+ if (material->has_emissive_strength)
+ {
+ context->extension_flags |= CGLTF_EXTENSION_FLAG_MATERIALS_EMISSIVE_STRENGTH;
+ }
+
+ if (material->has_iridescence)
+ {
+ context->extension_flags |= CGLTF_EXTENSION_FLAG_MATERIALS_IRIDESCENCE;
+ }
+
if (material->has_pbr_metallic_roughness)
{
const cgltf_pbr_metallic_roughness* params = &material->pbr_metallic_roughness;
@@ -599,11 +653,10 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater
{
cgltf_write_floatarrayprop(context, "baseColorFactor", params->base_color_factor, 4);
}
- cgltf_write_extras(context, &params->extras);
cgltf_write_line(context, "}");
}
- if (material->unlit || material->has_pbr_specular_glossiness || material->has_clearcoat || material->has_ior || material->has_specular || material->has_transmission || material->has_sheen || material->has_volume)
+ if (material->unlit || material->has_pbr_specular_glossiness || material->has_clearcoat || material->has_ior || material->has_specular || material->has_transmission || material->has_sheen || material->has_volume || material->has_emissive_strength || material->has_iridescence)
{
cgltf_write_line(context, "\"extensions\": {");
if (material->has_clearcoat)
@@ -612,7 +665,7 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater
cgltf_write_line(context, "\"KHR_materials_clearcoat\": {");
CGLTF_WRITE_TEXTURE_INFO("clearcoatTexture", params->clearcoat_texture);
CGLTF_WRITE_TEXTURE_INFO("clearcoatRoughnessTexture", params->clearcoat_roughness_texture);
- CGLTF_WRITE_TEXTURE_INFO("clearcoatNormalTexture", params->clearcoat_normal_texture);
+ CGLTF_WRITE_NORMAL_TEXTURE_INFO("clearcoatNormalTexture", params->clearcoat_normal_texture);
cgltf_write_floatprop(context, "clearcoatFactor", params->clearcoat_factor, 0.0f);
cgltf_write_floatprop(context, "clearcoatRoughnessFactor", params->clearcoat_roughness_factor, 0.0f);
cgltf_write_line(context, "}");
@@ -695,11 +748,30 @@ static void cgltf_write_material(cgltf_write_context* context, const cgltf_mater
{
cgltf_write_line(context, "\"KHR_materials_unlit\": {}");
}
+ if (material->has_emissive_strength)
+ {
+ cgltf_write_line(context, "\"KHR_materials_emissive_strength\": {");
+ const cgltf_emissive_strength* params = &material->emissive_strength;
+ cgltf_write_floatprop(context, "emissiveStrength", params->emissive_strength, 1.f);
+ cgltf_write_line(context, "}");
+ }
+ if (material->has_iridescence)
+ {
+ cgltf_write_line(context, "\"KHR_materials_iridescence\": {");
+ const cgltf_iridescence* params = &material->iridescence;
+ cgltf_write_floatprop(context, "iridescenceFactor", params->iridescence_factor, 0.f);
+ CGLTF_WRITE_TEXTURE_INFO("iridescenceTexture", params->iridescence_texture);
+ cgltf_write_floatprop(context, "iridescenceIor", params->iridescence_ior, 1.3f);
+ cgltf_write_floatprop(context, "iridescenceThicknessMinimum", params->iridescence_thickness_min, 100.f);
+ cgltf_write_floatprop(context, "iridescenceThicknessMaximum", params->iridescence_thickness_max, 400.f);
+ CGLTF_WRITE_TEXTURE_INFO("iridescenceThicknessTexture", params->iridescence_thickness_texture);
+ cgltf_write_line(context, "}");
+ }
cgltf_write_line(context, "}");
}
- CGLTF_WRITE_TEXTURE_INFO("normalTexture", material->normal_texture);
- CGLTF_WRITE_TEXTURE_INFO("occlusionTexture", material->occlusion_texture);
+ CGLTF_WRITE_NORMAL_TEXTURE_INFO("normalTexture", material->normal_texture);
+ CGLTF_WRITE_OCCLUSION_TEXTURE_INFO("occlusionTexture", material->occlusion_texture);
CGLTF_WRITE_TEXTURE_INFO("emissiveTexture", material->emissive_texture);
if (cgltf_check_floatarray(material->emissive_factor, 3, 0.0f))
{
@@ -766,7 +838,7 @@ static const char* cgltf_write_str_path_type(cgltf_animation_path_type path_type
return "scale";
case cgltf_animation_path_type_weights:
return "weights";
- case cgltf_animation_path_type_invalid:
+ default:
break;
}
return "invalid";
@@ -782,6 +854,8 @@ static const char* cgltf_write_str_interpolation_type(cgltf_interpolation_type i
return "STEP";
case cgltf_interpolation_type_cubic_spline:
return "CUBICSPLINE";
+ default:
+ break;
}
return "invalid";
}
@@ -884,16 +958,42 @@ static void cgltf_write_node(cgltf_write_context* context, const cgltf_node* nod
CGLTF_WRITE_IDXPROP("skin", node->skin, context->data->skins);
}
+ bool has_extension = node->light || (node->has_mesh_gpu_instancing && node->mesh_gpu_instancing.attributes_count > 0);
+ if(has_extension)
+ cgltf_write_line(context, "\"extensions\": {");
+
if (node->light)
{
context->extension_flags |= CGLTF_EXTENSION_FLAG_LIGHTS_PUNCTUAL;
- cgltf_write_line(context, "\"extensions\": {");
cgltf_write_line(context, "\"KHR_lights_punctual\": {");
CGLTF_WRITE_IDXPROP("light", node->light, context->data->lights);
cgltf_write_line(context, "}");
+ }
+
+ if (node->has_mesh_gpu_instancing && node->mesh_gpu_instancing.attributes_count > 0)
+ {
+ context->extension_flags |= CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING;
+ context->required_extension_flags |= CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING;
+
+ cgltf_write_line(context, "\"EXT_mesh_gpu_instancing\": {");
+ {
+ CGLTF_WRITE_IDXPROP("bufferView", node->mesh_gpu_instancing.buffer_view, context->data->buffer_views);
+ cgltf_write_line(context, "\"attributes\": {");
+ {
+ for (cgltf_size i = 0; i < node->mesh_gpu_instancing.attributes_count; ++i)
+ {
+ const cgltf_attribute* attr = node->mesh_gpu_instancing.attributes + i;
+ CGLTF_WRITE_IDXPROP(attr->name, attr->data, context->data->accessors);
+ }
+ }
+ cgltf_write_line(context, "}");
+ }
cgltf_write_line(context, "}");
}
+ if (has_extension)
+ cgltf_write_line(context, "}");
+
if (node->weights_count > 0)
{
cgltf_write_floatarrayprop(context, "weights", node->weights, node->weights_count);
@@ -925,7 +1025,7 @@ static void cgltf_write_accessor(cgltf_write_context* context, const cgltf_acces
cgltf_write_intprop(context, "componentType", cgltf_int_from_component_type(accessor->component_type), 0);
cgltf_write_strprop(context, "type", cgltf_str_from_type(accessor->type));
cgltf_size dim = cgltf_dim_from_type(accessor->type);
- cgltf_write_boolprop_optional(context, "normalized", accessor->normalized, false);
+ cgltf_write_boolprop_optional(context, "normalized", (bool)accessor->normalized, false);
cgltf_write_sizeprop(context, "byteOffset", (int)accessor->offset, 0);
cgltf_write_intprop(context, "count", (int)accessor->count, -1);
if (accessor->has_min)
@@ -1036,6 +1136,47 @@ static void cgltf_write_variant(cgltf_write_context* context, const cgltf_materi
cgltf_write_line(context, "}");
}
+static void cgltf_write_glb(FILE* file, const void* json_buf, const cgltf_size json_size, const void* bin_buf, const cgltf_size bin_size)
+{
+ char header[GlbHeaderSize];
+ char chunk_header[GlbChunkHeaderSize];
+ char json_pad[3] = { 0x20, 0x20, 0x20 };
+ char bin_pad[3] = { 0, 0, 0 };
+
+ cgltf_size json_padsize = (json_size % 4 != 0) ? 4 - json_size % 4 : 0;
+ cgltf_size bin_padsize = (bin_size % 4 != 0) ? 4 - bin_size % 4 : 0;
+ cgltf_size total_size = GlbHeaderSize + GlbChunkHeaderSize + json_size + json_padsize;
+ if (bin_buf != NULL && bin_size > 0) {
+ total_size += GlbChunkHeaderSize + bin_size + bin_padsize;
+ }
+
+ // Write a GLB header
+ memcpy(header, &GlbMagic, 4);
+ memcpy(header + 4, &GlbVersion, 4);
+ memcpy(header + 8, &total_size, 4);
+ fwrite(header, 1, GlbHeaderSize, file);
+
+ // Write a JSON chunk (header & data)
+ uint32_t json_chunk_size = (uint32_t)(json_size + json_padsize);
+ memcpy(chunk_header, &json_chunk_size, 4);
+ memcpy(chunk_header + 4, &GlbMagicJsonChunk, 4);
+ fwrite(chunk_header, 1, GlbChunkHeaderSize, file);
+
+ fwrite(json_buf, 1, json_size, file);
+ fwrite(json_pad, 1, json_padsize, file);
+
+ if (bin_buf != NULL && bin_size > 0) {
+ // Write a binary chunk (header & data)
+ uint32_t bin_chunk_size = (uint32_t)(bin_size + bin_padsize);
+ memcpy(chunk_header, &bin_chunk_size, 4);
+ memcpy(chunk_header + 4, &GlbMagicBinChunk, 4);
+ fwrite(chunk_header, 1, GlbChunkHeaderSize, file);
+
+ fwrite(bin_buf, 1, bin_size, file);
+ fwrite(bin_pad, 1, bin_padsize, file);
+ }
+}
+
cgltf_result cgltf_write_file(const cgltf_options* options, const char* path, const cgltf_data* data)
{
cgltf_size expected = cgltf_write(options, NULL, 0, data);
@@ -1044,13 +1185,18 @@ cgltf_result cgltf_write_file(const cgltf_options* options, const char* path, co
if (expected != actual) {
fprintf(stderr, "Error: expected %zu bytes but wrote %zu bytes.\n", expected, actual);
}
- FILE* file = fopen(path, "wt");
+ FILE* file = fopen(path, "wb");
if (!file)
{
return cgltf_result_file_not_found;
}
// Note that cgltf_write() includes a null terminator, which we omit from the file content.
- fwrite(buffer, actual - 1, 1, file);
+ if (options->type == cgltf_file_type_glb) {
+ cgltf_write_glb(file, buffer, actual - 1, data->bin, data->bin_size);
+ } else {
+ // Write a plain JSON file.
+ fwrite(buffer, actual - 1, 1, file);
+ }
fclose(file);
free(buffer);
return cgltf_result_success;
@@ -1097,6 +1243,15 @@ static void cgltf_write_extensions(cgltf_write_context* context, uint32_t extens
if (extension_flags & CGLTF_EXTENSION_FLAG_TEXTURE_BASISU) {
cgltf_write_stritem(context, "KHR_texture_basisu");
}
+ if (extension_flags & CGLTF_EXTENSION_FLAG_MATERIALS_EMISSIVE_STRENGTH) {
+ cgltf_write_stritem(context, "KHR_materials_emissive_strength");
+ }
+ if (extension_flags & CGLTF_EXTENSION_FLAG_MATERIALS_IRIDESCENCE) {
+ cgltf_write_stritem(context, "KHR_materials_iridescence");
+ }
+ if (extension_flags & CGLTF_EXTENSION_FLAG_MESH_GPU_INSTANCING) {
+ cgltf_write_stritem(context, "EXT_mesh_gpu_instancing");
+ }
}
cgltf_size cgltf_write(const cgltf_options* options, char* buffer, cgltf_size size, const cgltf_data* data)
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt b/3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt
new file mode 100644
index 00000000000..4023e0caa85
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/LICENSE.txt
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014-2022 Omar Cornut
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+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 Software.
+
+THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h b/3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h
index bd3bea7cecc..bb52b2380ec 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imconfig.h
@@ -7,6 +7,8 @@
#pragma once
#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+#define IMGUI_DISABLE_OBSOLETE_KEYIO
+#define IMGUI_DISABLE_DEFAULT_ALLOCATORS
//---- Define your own ImVector<> type if you don't want to use the provided implementation defined in imgui.h
//#include <vector>
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp
index 4d8b3673cde..bd3f95d77ae 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.cpp
@@ -1,4 +1,4 @@
-// dear imgui, v1.85 WIP
+// dear imgui, v1.90 WIP
// (main code and documentation)
// Help:
@@ -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/4451 (please post your screenshots/video there!)
+// - Gallery https://github.com/ocornut/imgui/issues/5243 (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
@@ -65,11 +65,12 @@ CODE
// [SECTION] MISC HELPERS/UTILITIES (Color functions)
// [SECTION] ImGuiStorage
// [SECTION] ImGuiTextFilter
-// [SECTION] ImGuiTextBuffer
+// [SECTION] ImGuiTextBuffer, ImGuiTextIndex
// [SECTION] ImGuiListClipper
// [SECTION] STYLING
// [SECTION] RENDER HELPERS
// [SECTION] MAIN CODE (most of the code! lots of stuff, needs tidying up!)
+// [SECTION] INPUTS
// [SECTION] ERROR CHECKING
// [SECTION] LAYOUT
// [SECTION] SCROLLING
@@ -79,9 +80,12 @@ CODE
// [SECTION] DRAG AND DROP
// [SECTION] LOGGING/CAPTURING
// [SECTION] SETTINGS
-// [SECTION] VIEWPORTS
+// [SECTION] LOCALIZATION
+// [SECTION] VIEWPORTS, PLATFORM WINDOWS
// [SECTION] PLATFORM DEPENDENT HELPERS
// [SECTION] METRICS/DEBUGGER WINDOW
+// [SECTION] DEBUG LOG WINDOW
+// [SECTION] OTHER DEBUG TOOLS (ITEM PICKER, STACK TOOL)
*/
@@ -99,6 +103,7 @@ CODE
- Easy to hack and improve.
- Minimize setup and maintenance.
- Minimize state storage on user side.
+ - Minimize state synchronization.
- Portable, minimize dependencies, run on target (consoles, phones, etc.).
- Efficient runtime and memory consumption.
@@ -122,14 +127,13 @@ CODE
- Hold SHIFT or use mouse to select text.
- CTRL+Left/Right to word jump.
- CTRL+Shift+Left/Right to select words.
- - CTRL+A our Double-Click to select all.
+ - 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.
- - You can apply arithmetic operators +,*,/ on numerical values. Use +- to subtract (because - would set a negative 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. See suggested mappings in imgui.h ImGuiNavInput_ + download PNG/PSD at http://dearimgui.org/controls_sheets
+ - General Gamepad controls: enable with ImGuiConfigFlags_NavEnableGamepad. Download controller mapping PNG/PSD at http://dearimgui.org/controls_sheets
PROGRAMMER GUIDE
@@ -253,9 +257,9 @@ CODE
io.DeltaTime = 1.0f/60.0f; // set the time elapsed since the previous frame (in seconds)
io.DisplaySize.x = 1920.0f; // set the current display width
io.DisplaySize.y = 1280.0f; // set the current display height here
- io.MousePos = my_mouse_pos; // set the mouse position
- io.MouseDown[0] = my_mouse_buttons[0]; // set the mouse button states
- io.MouseDown[1] = my_mouse_buttons[1];
+ io.AddMousePosEvent(mouse_x, mouse_y); // update mouse position
+ io.AddMouseButtonEvent(0, mouse_b[0]); // update mouse button states
+ io.AddMouseButtonEvent(1, mouse_b[1]); // update mouse button states
// Call NewFrame(), after this point you can use ImGui::* functions anytime
// (So you want to try calling NewFrame() as early as you can in your main loop to be able to use Dear ImGui everywhere)
@@ -287,12 +291,14 @@ CODE
---------------------------------------------
The backends in impl_impl_XXX.cpp files contain many working implementations of a rendering function.
- void void MyImGuiRenderFunction(ImDrawData* draw_data)
+ void MyImGuiRenderFunction(ImDrawData* draw_data)
{
// TODO: Setup render state: alpha-blending enabled, no face culling, no depth testing, scissor enabled
+ // TODO: Setup texture sampling state: sample with bilinear filtering (NOT point/nearest filtering). Use 'io.Fonts->Flags |= ImFontAtlasFlags_NoBakedLines;' to allow point/nearest filtering.
// TODO: Setup viewport covering draw_data->DisplayPos to draw_data->DisplayPos + draw_data->DisplaySize
// TODO: Setup orthographic projection matrix cover draw_data->DisplayPos to draw_data->DisplayPos + draw_data->DisplaySize
// TODO: Setup shader: vertex { float2 pos, float2 uv, u32 color }, fragment shader sample color from 1 texture, multiply by vertex color.
+ ImVec2 clip_off = draw_data->DisplayPos;
for (int n = 0; n < draw_data->CmdListsCount; n++)
{
const ImDrawList* cmd_list = draw_data->CmdLists[n];
@@ -307,9 +313,11 @@ CODE
}
else
{
- // The texture for the draw call is specified by pcmd->GetTexID().
- // The vast majority of draw calls will use the Dear ImGui texture atlas, which value you have set yourself during initialization.
- MyEngineBindTexture((MyTexture*)pcmd->GetTexID());
+ // Project scissor/clipping rectangles into framebuffer space
+ ImVec2 clip_min(pcmd->ClipRect.x - clip_off.x, pcmd->ClipRect.y - clip_off.y);
+ ImVec2 clip_max(pcmd->ClipRect.z - clip_off.x, pcmd->ClipRect.w - clip_off.y);
+ if (clip_max.x <= clip_min.x || clip_max.y <= clip_min.y)
+ continue;
// We are using scissoring to clip some objects. All low-level graphics API should support it.
// - If your engine doesn't support scissoring yet, you may ignore this at first. You will get some small glitches
@@ -320,14 +328,16 @@ CODE
// - In the interest of supporting multi-viewport applications (see 'docking' branch on github),
// always subtract draw_data->DisplayPos from clipping bounds to convert them to your viewport space.
// - Note that pcmd->ClipRect contains Min+Max bounds. Some graphics API may use Min+Max, other may use Min+Size (size being Max-Min)
- ImVec2 pos = draw_data->DisplayPos;
- MyEngineScissor((int)(pcmd->ClipRect.x - pos.x), (int)(pcmd->ClipRect.y - pos.y), (int)(pcmd->ClipRect.z - pos.x), (int)(pcmd->ClipRect.w - pos.y));
+ MyEngineSetScissor(clip_min.x, clip_min.y, clip_max.x, clip_max.y);
+
+ // The texture for the draw call is specified by pcmd->GetTexID().
+ // The vast majority of draw calls will use the Dear ImGui texture atlas, which value you have set yourself during initialization.
+ MyEngineBindTexture((MyTexture*)pcmd->GetTexID());
// Render 'pcmd->ElemCount/3' indexed triangles.
// By default the indices ImDrawIdx are 16-bit, you can change them to 32-bit in imconfig.h if your engine doesn't support 16-bit indices.
- MyEngineDrawIndexedTriangles(pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer, vtx_buffer);
+ MyEngineDrawIndexedTriangles(pcmd->ElemCount, sizeof(ImDrawIdx) == 2 ? GL_UNSIGNED_SHORT : GL_UNSIGNED_INT, idx_buffer + pcmd->IdxOffset, vtx_buffer, pcmd->VtxOffset);
}
- idx_buffer += pcmd->ElemCount;
}
}
}
@@ -336,31 +346,27 @@ 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. PS4, Switch, XB1) without a mouse!
- - You can ask questions and report issues at https://github.com/ocornut/imgui/issues/787
+ - 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:
- - Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable.
- NewFrame() will automatically fill io.NavInputs[] based on your io.KeysDown[] + io.KeyMap[] arrays.
- - 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:
+ - 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:
- - Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable.
- - Backend: Set io.BackendFlags |= ImGuiBackendFlags_HasGamepad + fill the io.NavInputs[] fields before calling NewFrame().
- Note that io.NavInputs[] is cleared by EndFrame().
- - See 'enum ImGuiNavInput_' in imgui.h for a description of inputs. For each entry of io.NavInputs[], set the following values:
- 0.0f= not held. 1.0f= fully held. Pass intermediate 0.0f..1.0f values for analog triggers/sticks.
- - We use a simple >0.0f test for activation testing, and won't attempt to test for a dead-zone.
- Your 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.).
+ - 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 imgui parts, 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.
+ - 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 users: Consider emulating a mouse cursor with DualShock4 touch pad or a spare analog stick as a mouse-emulation fallback.
+ - 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.
@@ -379,7 +385,77 @@ 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.
- - 2021/08/23 (1.85) - removed GetWindowContentRegionWidth() function. keep inline redirection helper. can use 'GetWindowContentRegionMax().x - GetWindowContentRegionMin().x' instead.
+ - 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/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.
+ - SliderScalar(), SliderScalarN(), SliderFloat(), SliderFloat2(), SliderFloat3(), SliderFloat4(): For old signatures ending with (..., const char* format, float power = 1.0f) -> use (..., format ImGuiSliderFlags_Logarithmic) if power != 1.0f.
+ - BeginPopupContextWindow(const char*, ImGuiMouseButton, bool) -> use BeginPopupContextWindow(const char*, ImGuiPopupFlags)
+ - 2022/09/02 (1.89) - obsoleted using SetCursorPos()/SetCursorScreenPos() to extend parent window/cell boundaries.
+ this relates to when moving the cursor position beyond current boundaries WITHOUT submitting an item.
+ - previously this would make the window content size ~200x200:
+ Begin(...) + SetCursorScreenPos(GetCursorScreenPos() + ImVec2(200,200)) + End();
+ - instead, please submit an item:
+ Begin(...) + SetCursorScreenPos(GetCursorScreenPos() + ImVec2(200,200)) + Dummy(ImVec2(0,0)) + End();
+ - alternative:
+ Begin(...) + Dummy(ImVec2(200,200)) + End();
+ - content size is now only extended when submitting an item!
+ - with '#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS' this will now be detected and assert.
+ - without '#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS' this will silently be fixed until we obsolete it.
+ - 2022/08/03 (1.89) - changed signature of ImageButton() function. Kept redirection function (will obsolete).
+ - added 'const char* str_id' parameter + removed 'int frame_padding = -1' parameter.
+ - old signature: bool ImageButton(ImTextureID tex_id, ImVec2 size, ImVec2 uv0 = ImVec2(0,0), ImVec2 uv1 = ImVec2(1,1), int frame_padding = -1, ImVec4 bg_col = ImVec4(0,0,0,0), ImVec4 tint_col = ImVec4(1,1,1,1));
+ - used the ImTextureID value to create an ID. This was inconsistent with other functions, led to ID conflicts, and caused problems with engines using transient ImTextureID values.
+ - had a FramePadding override which was inconsistent with other functions and made the already-long signature even longer.
+ - new signature: bool ImageButton(const char* str_id, ImTextureID tex_id, ImVec2 size, ImVec2 uv0 = ImVec2(0,0), ImVec2 uv1 = ImVec2(1,1), ImVec4 bg_col = ImVec4(0,0,0,0), ImVec4 tint_col = ImVec4(1,1,1,1));
+ - requires an explicit identifier. You may still use e.g. PushID() calls and then pass an empty identifier.
+ - always uses style.FramePadding for padding, to be consistent with other buttons. You may use PushStyleVar() to alter this.
+ - 2022/07/08 (1.89) - inputs: removed io.NavInputs[] and ImGuiNavInput enum (following 1.87 changes).
+ - Official backends from 1.87+ -> no issue.
+ - Official backends from 1.60 to 1.86 -> will build and convert gamepad inputs, unless IMGUI_DISABLE_OBSOLETE_KEYIO is defined. Need updating!
+ - Custom backends not writing to io.NavInputs[] -> no issue.
+ - Custom backends writing to io.NavInputs[] -> will build and convert gamepad inputs, unless IMGUI_DISABLE_OBSOLETE_KEYIO is defined. Need fixing!
+ - TL;DR: Backends should call io.AddKeyEvent()/io.AddKeyAnalogEvent() with ImGuiKey_GamepadXXX values instead of filling io.NavInput[].
+ - 2022/06/15 (1.88) - renamed IMGUI_DISABLE_METRICS_WINDOW to IMGUI_DISABLE_DEBUG_TOOLS for correctness. kept support for old define (will obsolete).
+ - 2022/05/03 (1.88) - backends: osx: removed ImGui_ImplOSX_HandleEvent() from backend API in favor of backend automatically handling event capture. All ImGui_ImplOSX_HandleEvent() calls should be removed as they are now unnecessary.
+ - 2022/04/05 (1.88) - inputs: renamed ImGuiKeyModFlags to ImGuiModFlags. Kept inline redirection enums (will obsolete). This was never used in public API functions but technically present in imgui.h and ImGuiIO.
+ - 2022/01/20 (1.87) - inputs: reworded gamepad IO.
+ - Backend writing to io.NavInputs[] -> backend should call io.AddKeyEvent()/io.AddKeyAnalogEvent() with ImGuiKey_GamepadXXX values.
+ - 2022/01/19 (1.87) - sliders, drags: removed support for legacy arithmetic operators (+,+-,*,/) when inputing text. This doesn't break any api/code but a feature that used to be accessible by end-users (which seemingly no one used).
+ - 2022/01/17 (1.87) - inputs: reworked mouse IO.
+ - Backend writing to io.MousePos -> backend should call io.AddMousePosEvent()
+ - Backend writing to io.MouseDown[] -> backend should call io.AddMouseButtonEvent()
+ - Backend writing to io.MouseWheel -> backend should call io.AddMouseWheelEvent()
+ - Backend writing to io.MouseHoveredViewport -> backend should call io.AddMouseViewportEvent() [Docking branch w/ multi-viewports only]
+ note: for all calls to IO new functions, the Dear ImGui context should be bound/current.
+ read https://github.com/ocornut/imgui/issues/4921 for details.
+ - 2022/01/10 (1.87) - inputs: reworked keyboard IO. Removed io.KeyMap[], io.KeysDown[] in favor of calling io.AddKeyEvent(). Removed GetKeyIndex(), now unecessary. All IsKeyXXX() functions now take ImGuiKey values. All features are still functional until IMGUI_DISABLE_OBSOLETE_KEYIO is defined. Read Changelog and Release Notes for details.
+ - IsKeyPressed(MY_NATIVE_KEY_XXX) -> use IsKeyPressed(ImGuiKey_XXX)
+ - IsKeyPressed(GetKeyIndex(ImGuiKey_XXX)) -> use IsKeyPressed(ImGuiKey_XXX)
+ - Backend writing to io.KeyMap[],io.KeysDown[] -> backend should call io.AddKeyEvent() (+ call io.SetKeyEventNativeData() if you want legacy user code to stil function with legacy key codes).
+ - Backend writing to io.KeyCtrl, io.KeyShift.. -> backend should call io.AddKeyEvent() with ImGuiMod_XXX values. *IF YOU PULLED CODE BETWEEN 2021/01/10 and 2021/01/27: We used to have a io.AddKeyModsEvent() function which was now replaced by io.AddKeyEvent() with ImGuiMod_XXX values.*
+ - one case won't work with backward compatibility: if your custom backend used ImGuiKey as mock native indices (e.g. "io.KeyMap[ImGuiKey_A] = ImGuiKey_A") because those values are now larger than the legacy KeyDown[] array. Will assert.
+ - inputs: added ImGuiKey_ModCtrl/ImGuiKey_ModShift/ImGuiKey_ModAlt/ImGuiKey_ModSuper values to submit keyboard modifiers using io.AddKeyEvent(), instead of writing directly to io.KeyCtrl, io.KeyShift, io.KeyAlt, io.KeySuper.
+ - 2022/01/05 (1.87) - inputs: renamed ImGuiKey_KeyPadEnter to ImGuiKey_KeypadEnter to align with new symbols. Kept redirection enum.
+ - 2022/01/05 (1.87) - removed io.ImeSetInputScreenPosFn() in favor of more flexible io.SetPlatformImeDataFn(). Removed 'void* io.ImeWindowHandle' in favor of writing to 'void* ImGuiViewport::PlatformHandleRaw'.
+ - 2022/01/01 (1.87) - commented out redirecting functions/enums names that were marked obsolete in 1.69, 1.70, 1.71, 1.72 (March-July 2019)
+ - ImGui::SetNextTreeNodeOpen() -> use ImGui::SetNextItemOpen()
+ - ImGui::GetContentRegionAvailWidth() -> use ImGui::GetContentRegionAvail().x
+ - ImGui::TreeAdvanceToLabelPos() -> use ImGui::SetCursorPosX(ImGui::GetCursorPosX() + ImGui::GetTreeNodeToLabelSpacing());
+ - ImFontAtlas::CustomRect -> use ImFontAtlasCustomRect
+ - ImGuiColorEditFlags_RGB/HSV/HEX -> use ImGuiColorEditFlags_DisplayRGB/HSV/Hex
+ - 2021/12/20 (1.86) - backends: removed obsolete Marmalade backend (imgui_impl_marmalade.cpp) + example. Find last supported version at https://github.com/ocornut/imgui/wiki/Bindings
+ - 2021/11/04 (1.86) - removed CalcListClipping() function. Prefer using ImGuiListClipper which can return non-contiguous ranges. Please open an issue if you think you really need this function.
+ - 2021/08/23 (1.85) - removed GetWindowContentRegionWidth() function. keep inline redirection helper. can use 'GetWindowContentRegionMax().x - GetWindowContentRegionMin().x' instead for generally 'GetContentRegionAvail().x' is more useful.
- 2021/07/26 (1.84) - commented out redirecting functions/enums names that were marked obsolete in 1.67 and 1.69 (March 2019):
- ImGui::GetOverlayDrawList() -> use ImGui::GetForegroundDrawList()
- ImFont::GlyphRangesBuilder -> use ImFontGlyphRangesBuilder
@@ -722,10 +798,12 @@ CODE
Q&A: Usage
----------
- Q: Why is my widget not reacting when I click on it?
- Q: How can I have widgets with an empty label?
- Q: How can I have multiple widgets with the same label?
- Q: How can I display an image? What is ImTextureID, how does it works?
+ Q: About the ID Stack system..
+ - Why is my widget not reacting when I click on it?
+ - How can I have widgets with an empty label?
+ - How can I have multiple widgets with the same label?
+ - How can I have multiple windows with the same label?
+ Q: How can I display an image? What is ImTextureID, how does it work?
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)
@@ -784,7 +862,6 @@ CODE
#include "imgui_internal.h"
// System includes
-#include <ctype.h> // toupper
#include <stdio.h> // vsnprintf, sscanf, printf
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
#include <stddef.h> // intptr_t
@@ -833,7 +910,7 @@ CODE
#if defined(_MSC_VER) && _MSC_VER >= 1922 // MSVC 2019 16.2 or later
#pragma warning (disable: 5054) // operator '|': deprecated between enumerations of different types
#endif
-#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
+#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to an 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
#pragma warning (disable: 26495) // [Static Analyzer] Variable 'XXX' is uninitialized. Always initialize a member variable (type.6).
#pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
#endif
@@ -856,7 +933,7 @@ CODE
#pragma clang diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function // using printf() is a misery with this as C++ va_arg ellipsis changes float to double.
#pragma clang diagnostic ignored "-Wimplicit-int-float-conversion" // warning: implicit conversion from 'xxx' to 'float' may lose precision
#elif defined(__GNUC__)
-// We disable -Wpragmas because GCC doesn't provide an has_warning equivalent and some forks/patches may not following the warning/version association.
+// We disable -Wpragmas because GCC doesn't provide a has_warning equivalent and some forks/patches may not follow the warning/version association.
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
@@ -880,7 +957,7 @@ static const float NAV_WINDOWING_LIST_APPEAR_DELAY = 0.15f; // Time
// Window resizing from edges (when io.ConfigWindowsResizeFromEdges = true and ImGuiBackendFlags_HasMouseCursors is set in io.BackendFlags by backend)
static const float WINDOWS_HOVER_PADDING = 4.0f; // Extend outside window for hovering/resizing (maxxed with TouchPadding) and inside windows for borders. Affect FindHoveredWindow().
static const float WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER = 0.04f; // Reduce visual noise by only highlighting the border after a certain time.
-static const float WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER = 2.00f; // Lock scrolled window (so it doesn't pick child windows that are scrolling through) for a certain time, unless mouse moved.
+static const float WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER = 0.70f; // Lock scrolled window (so it doesn't pick child windows that are scrolling through) for a certain time, unless mouse moved.
//-------------------------------------------------------------------------
// [SECTION] FORWARD DECLARATIONS
@@ -904,7 +981,7 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext*, ImGuiSetti
// 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 void ImeSetInputScreenPosFn_DefaultImpl(int x, int y);
+static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport* viewport, ImGuiPlatformImeData* data);
namespace ImGui
{
@@ -914,32 +991,40 @@ static void NavUpdateWindowing();
static void NavUpdateWindowingOverlay();
static void NavUpdateCancelRequest();
static void NavUpdateCreateMoveRequest();
+static void NavUpdateCreateTabbingRequest();
static float NavUpdatePageUpPageDown();
static inline void NavUpdateAnyRequestFlag();
+static void NavUpdateCreateWrappingRequest();
static void NavEndFrame();
static bool NavScoreItem(ImGuiNavItemData* result);
static void NavApplyItemToResult(ImGuiNavItemData* result);
static void NavProcessItem();
+static void NavProcessItemForTabbingRequest(ImGuiID id);
static ImVec2 NavCalcPreferredRefPos();
static void NavSaveLastChildNavWindowIntoParent(ImGuiWindow* nav_window);
static ImGuiWindow* NavRestoreLastChildNavWindow(ImGuiWindow* window);
static void NavRestoreLayer(ImGuiNavLayer layer);
+static void NavRestoreHighlightAfterMove();
static int FindWindowFocusIndex(ImGuiWindow* window);
-// Error Checking
+// Error Checking and Debug Tools
static void ErrorCheckNewFrameSanityChecks();
static void ErrorCheckEndFrameSanityChecks();
+static void UpdateDebugToolItemPicker();
+static void UpdateDebugToolStackQueries();
// Misc
static void UpdateSettings();
+static void UpdateKeyboardInputs();
static void UpdateMouseInputs();
static void UpdateMouseWheel();
-static void UpdateTabFocus();
-static void UpdateDebugToolItemPicker();
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 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();
@@ -1017,12 +1102,12 @@ ImGuiStyle::ImGuiStyle()
ColumnsMinSpacing = 6.0f; // Minimum horizontal spacing between two columns. Preferably > (FramePadding.x + 1).
ScrollbarSize = 14.0f; // Width of the vertical scrollbar, Height of the horizontal scrollbar
ScrollbarRounding = 9.0f; // Radius of grab corners rounding for scrollbar
- GrabMinSize = 10.0f; // Minimum width/height of a grab box for slider/scrollbar
+ GrabMinSize = 12.0f; // Minimum width/height of a grab box for slider/scrollbar
GrabRounding = 0.0f; // Radius of grabs corners rounding. Set to 0.0f to have rectangular slider grabs.
LogSliderDeadzone = 4.0f; // The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero.
TabRounding = 4.0f; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.
TabBorderSize = 0.0f; // Thickness of border around tabs.
- TabMinWidthForCloseButton = 0.0f; // Minimum width for close button to appears on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected.
+ TabMinWidthForCloseButton = 0.0f; // Minimum width for close button to appear on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected.
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.
@@ -1030,7 +1115,7 @@ ImGuiStyle::ImGuiStyle()
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.
AntiAliasedLines = true; // Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU.
- AntiAliasedLinesUseTex = true; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering.
+ AntiAliasedLinesUseTex = true; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering (NOT point/nearest filtering).
AntiAliasedFill = true; // Enable anti-aliased filled shapes (rounded rectangles, circles, etc.).
CurveTessellationTol = 1.25f; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
CircleTessellationMaxError = 0.30f; // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry.
@@ -1072,7 +1157,7 @@ ImGuiIO::ImGuiIO()
{
// Most fields are initialized with zero
memset(this, 0, sizeof(*this));
- IM_ASSERT(IM_ARRAYSIZE(ImGuiIO::MouseDown) == ImGuiMouseButton_COUNT && IM_ARRAYSIZE(ImGuiIO::MouseClicked) == ImGuiMouseButton_COUNT); // Our pre-C++11 IM_STATIC_ASSERT() macros triggers warning on modern compilers so we don't use it here.
+ IM_STATIC_ASSERT(IM_ARRAYSIZE(ImGuiIO::MouseDown) == ImGuiMouseButton_COUNT && IM_ARRAYSIZE(ImGuiIO::MouseClicked) == ImGuiMouseButton_COUNT);
// Settings
ConfigFlags = ImGuiConfigFlags_None;
@@ -1084,10 +1169,14 @@ ImGuiIO::ImGuiIO()
LogFilename = "imgui_log.txt";
MouseDoubleClickTime = 0.30f;
MouseDoubleClickMaxDist = 6.0f;
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
for (int i = 0; i < ImGuiKey_COUNT; i++)
KeyMap[i] = -1;
+#endif
KeyRepeatDelay = 0.275f;
KeyRepeatRate = 0.050f;
+ HoverDelayNormal = 0.30f;
+ HoverDelayShort = 0.10f;
UserData = NULL;
Fonts = NULL;
@@ -1103,7 +1192,10 @@ ImGuiIO::ImGuiIO()
#else
ConfigMacOSXBehaviors = false;
#endif
+ ConfigInputTrickleEventQueue = true;
ConfigInputTextCursorBlink = true;
+ ConfigInputTextEnterKeepActive = false;
+ ConfigDragClickToInputText = false;
ConfigWindowsResizeFromEdges = true;
ConfigWindowsMoveFromTitleBarOnly = false;
ConfigMemoryCompactTimer = 60.0f;
@@ -1114,38 +1206,48 @@ ImGuiIO::ImGuiIO()
GetClipboardTextFn = GetClipboardTextFn_DefaultImpl; // Platform dependent default implementations
SetClipboardTextFn = SetClipboardTextFn_DefaultImpl;
ClipboardUserData = NULL;
- ImeSetInputScreenPosFn = ImeSetInputScreenPosFn_DefaultImpl;
- ImeWindowHandle = NULL;
+ SetPlatformImeDataFn = SetPlatformImeDataFn_DefaultImpl;
// Input (NB: we already have memset zero the entire structure!)
MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
MousePosPrev = ImVec2(-FLT_MAX, -FLT_MAX);
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(KeysDownDuration); i++) KeysDownDuration[i] = KeysDownDurationPrev[i] = -1.0f;
- for (int i = 0; i < IM_ARRAYSIZE(NavInputsDownDuration); i++) NavInputsDownDuration[i] = -1.0f;
+ for (int i = 0; i < IM_ARRAYSIZE(KeysData); i++) { KeysData[i].DownDuration = KeysData[i].DownDurationPrev = -1.0f; }
+ AppAcceptingEvents = true;
+ BackendUsingLegacyKeyArrays = (ImS8)-1;
+ BackendUsingLegacyNavInputArray = true; // assume using legacy array until proven wrong
}
// Pass in translated ASCII characters for text input.
// - with glfw you can get those from the callback set in glfwSetCharCallback()
// - on Windows you can get those using ToAscii+keyboard state, or via the WM_CHAR message
+// FIXME: Should in theory be called "AddCharacterEvent()" to be consistent with new API
void ImGuiIO::AddInputCharacter(unsigned int c)
{
- if (c != 0)
- InputQueueCharacters.push_back(c <= IM_UNICODE_CODEPOINT_MAX ? (ImWchar)c : IM_UNICODE_CODEPOINT_INVALID);
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(&g.IO == this && "Can only add events to current context.");
+ if (c == 0 || !AppAcceptingEvents)
+ return;
+
+ ImGuiInputEvent e;
+ e.Type = ImGuiInputEventType_Text;
+ e.Source = ImGuiInputSource_Keyboard;
+ e.Text.Char = c;
+ g.InputEventsQueue.push_back(e);
}
// UTF16 strings use surrogate pairs to encode codepoints >= 0x10000, so
// we should save the high surrogate.
void ImGuiIO::AddInputCharacterUTF16(ImWchar16 c)
{
- if (c == 0 && InputQueueSurrogate == 0)
+ if ((c == 0 && InputQueueSurrogate == 0) || !AppAcceptingEvents)
return;
if ((c & 0xFC00) == 0xD800) // High surrogate, must save
{
if (InputQueueSurrogate != 0)
- InputQueueCharacters.push_back(IM_UNICODE_CODEPOINT_INVALID);
+ AddInputCharacter(IM_UNICODE_CODEPOINT_INVALID);
InputQueueSurrogate = c;
return;
}
@@ -1155,7 +1257,7 @@ void ImGuiIO::AddInputCharacterUTF16(ImWchar16 c)
{
if ((c & 0xFC00) != 0xDC00) // Invalid low surrogate
{
- InputQueueCharacters.push_back(IM_UNICODE_CODEPOINT_INVALID);
+ AddInputCharacter(IM_UNICODE_CODEPOINT_INVALID);
}
else
{
@@ -1168,41 +1270,229 @@ void ImGuiIO::AddInputCharacterUTF16(ImWchar16 c)
InputQueueSurrogate = 0;
}
- InputQueueCharacters.push_back(cp);
+ AddInputCharacter((unsigned)cp);
}
void ImGuiIO::AddInputCharactersUTF8(const char* utf8_chars)
{
+ if (!AppAcceptingEvents)
+ return;
while (*utf8_chars != 0)
{
unsigned int c = 0;
utf8_chars += ImTextCharFromUtf8(&c, utf8_chars, NULL);
if (c != 0)
- InputQueueCharacters.push_back((ImWchar)c);
+ AddInputCharacter(c);
}
}
+// FIXME: Perhaps we could clear queued events as well?
void ImGuiIO::ClearInputCharacters()
{
InputQueueCharacters.resize(0);
}
+// FIXME: Perhaps we could clear queued events as well?
void ImGuiIO::ClearInputKeys()
{
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
memset(KeysDown, 0, sizeof(KeysDown));
- for (int n = 0; n < IM_ARRAYSIZE(KeysDownDuration); n++)
- KeysDownDuration[n] = KeysDownDurationPrev[n] = -1.0f;
+#endif
+ for (int n = 0; n < IM_ARRAYSIZE(KeysData); n++)
+ {
+ KeysData[n].Down = false;
+ KeysData[n].DownDuration = -1.0f;
+ KeysData[n].DownDurationPrev = -1.0f;
+ }
KeyCtrl = KeyShift = KeyAlt = KeySuper = false;
- KeyMods = KeyModsPrev = ImGuiKeyModFlags_None;
- for (int n = 0; n < IM_ARRAYSIZE(NavInputsDownDuration); n++)
- NavInputsDownDuration[n] = NavInputsDownDurationPrev[n] = -1.0f;
+ KeyMods = ImGuiMod_None;
+ MousePos = ImVec2(-FLT_MAX, -FLT_MAX);
+ for (int n = 0; n < IM_ARRAYSIZE(MouseDown); n++)
+ {
+ MouseDown[n] = false;
+ MouseDownDuration[n] = MouseDownDurationPrev[n] = -1.0f;
+ }
+ MouseWheel = MouseWheelH = 0.0f;
+}
+
+static ImGuiInputEvent* FindLatestInputEvent(ImGuiInputEventType type, int arg = -1)
+{
+ ImGuiContext& g = *GImGui;
+ for (int n = g.InputEventsQueue.Size - 1; n >= 0; n--)
+ {
+ ImGuiInputEvent* e = &g.InputEventsQueue[n];
+ if (e->Type != type)
+ continue;
+ if (type == ImGuiInputEventType_Key && e->Key.Key != arg)
+ continue;
+ if (type == ImGuiInputEventType_MouseButton && e->MouseButton.Button != arg)
+ continue;
+ return e;
+ }
+ return NULL;
+}
+
+// Queue a new key down/up event.
+// - 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
+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); }
+ if (key == ImGuiKey_None || !AppAcceptingEvents)
+ return;
+ ImGuiContext& g = *GImGui;
+ 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.
+
+ // Verify that backend isn't mixing up using new io.AddKeyEvent() api and old io.KeysDown[] + io.KeyMap[] data.
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
+ IM_ASSERT((BackendUsingLegacyKeyArrays == -1 || BackendUsingLegacyKeyArrays == 0) && "Backend needs to either only use io.AddKeyEvent(), either only fill legacy io.KeysDown[] + io.KeyMap[]. Not both!");
+ if (BackendUsingLegacyKeyArrays == -1)
+ for (int n = ImGuiKey_NamedKey_BEGIN; n < ImGuiKey_NamedKey_END; n++)
+ IM_ASSERT(KeyMap[n] == -1 && "Backend needs to either only use io.AddKeyEvent(), either only fill legacy io.KeysDown[] + io.KeyMap[]. Not both!");
+ BackendUsingLegacyKeyArrays = 0;
+#endif
+ if (ImGui::IsGamepadKey(key))
+ 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 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)
+ return;
+
+ // Add event
+ ImGuiInputEvent e;
+ e.Type = ImGuiInputEventType_Key;
+ e.Source = ImGui::IsGamepadKey(key) ? ImGuiInputSource_Gamepad : ImGuiInputSource_Keyboard;
+ e.Key.Key = key;
+ e.Key.Down = down;
+ e.Key.AnalogValue = analog_value;
+ g.InputEventsQueue.push_back(e);
+}
+
+void ImGuiIO::AddKeyEvent(ImGuiKey key, bool down)
+{
+ if (!AppAcceptingEvents)
+ return;
+ AddKeyAnalogEvent(key, down, down ? 1.0f : 0.0f);
+}
+
+// [Optional] Call after AddKeyEvent().
+// Specify native keycode, scancode + Specify index for legacy <1.87 IsKeyXXX() functions with native indices.
+// If you are writing a backend in 2022 or don't use IsKeyXXX() with native values that are not ImGuiKey values, you can avoid calling this.
+void ImGuiIO::SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native_scancode, int native_legacy_index)
+{
+ if (key == ImGuiKey_None)
+ return;
+ IM_ASSERT(ImGui::IsNamedKey(key)); // >= 512
+ IM_ASSERT(native_legacy_index == -1 || ImGui::IsLegacyKey((ImGuiKey)native_legacy_index)); // >= 0 && <= 511
+ IM_UNUSED(native_keycode); // Yet unused
+ IM_UNUSED(native_scancode); // Yet unused
+
+ // Build native->imgui map so old user code can still call key functions with native 0..511 values.
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
+ const int legacy_key = (native_legacy_index != -1) ? native_legacy_index : native_keycode;
+ if (!ImGui::IsLegacyKey((ImGuiKey)legacy_key))
+ return;
+ KeyMap[legacy_key] = key;
+ KeyMap[key] = legacy_key;
+#else
+ IM_UNUSED(key);
+ IM_UNUSED(native_legacy_index);
+#endif
+}
+
+// Set master flag for accepting key/mouse/text events (default to true). Useful if you have native dialog boxes that are interrupting your application loop/refresh, and you want to disable events being queued while your app is frozen.
+void ImGuiIO::SetAppAcceptingEvents(bool accepting_events)
+{
+ AppAcceptingEvents = 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.");
+ if (!AppAcceptingEvents)
+ return;
+
+ // Apply same flooring as UpdateMouseInputs()
+ ImVec2 pos((x > -FLT_MAX) ? ImFloorSigned(x) : x, (y > -FLT_MAX) ? ImFloorSigned(y) : y);
+
+ // Filter duplicate
+ const ImGuiInputEvent* latest_event = FindLatestInputEvent(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;
+
+ ImGuiInputEvent e;
+ e.Type = ImGuiInputEventType_MousePos;
+ e.Source = ImGuiInputSource_Mouse;
+ e.MousePos.PosX = pos.x;
+ e.MousePos.PosY = pos.y;
+ g.InputEventsQueue.push_back(e);
+}
+
+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(mouse_button >= 0 && mouse_button < ImGuiMouseButton_COUNT);
+ if (!AppAcceptingEvents)
+ return;
+
+ // Filter duplicate
+ const ImGuiInputEvent* latest_event = FindLatestInputEvent(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;
+
+ ImGuiInputEvent e;
+ e.Type = ImGuiInputEventType_MouseButton;
+ e.Source = ImGuiInputSource_Mouse;
+ e.MouseButton.Button = mouse_button;
+ e.MouseButton.Down = down;
+ g.InputEventsQueue.push_back(e);
+}
+
+// Queue a mouse wheel event (most mouse/API will 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.");
+
+ // Filter duplicate (unlike most events, wheel values are relative and easy to filter)
+ if (!AppAcceptingEvents || (wheel_x == 0.0f && wheel_y == 0.0f))
+ return;
+
+ ImGuiInputEvent e;
+ e.Type = ImGuiInputEventType_MouseWheel;
+ e.Source = ImGuiInputSource_Mouse;
+ e.MouseWheel.WheelX = wheel_x;
+ e.MouseWheel.WheelY = wheel_y;
+ g.InputEventsQueue.push_back(e);
}
void ImGuiIO::AddFocusEvent(bool focused)
{
- // We intentionally overwrite this and process in NewFrame(), in order to give a chance
- // to multi-viewports backends to queue AddFocusEvent(false),AddFocusEvent(true) in same frame.
- AppFocusLost = !focused;
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(&g.IO == this && "Can only add events to current context.");
+
+ // Filter duplicate
+ const ImGuiInputEvent* latest_event = FindLatestInputEvent(ImGuiInputEventType_Focus);
+ const bool latest_focused = latest_event ? latest_event->AppFocused.Focused : !g.IO.AppFocusLost;
+ if (latest_focused == focused)
+ return;
+
+ ImGuiInputEvent e;
+ e.Type = ImGuiInputEventType_Focus;
+ e.AppFocused.Focused = focused;
+ g.InputEventsQueue.push_back(e);
}
//-----------------------------------------------------------------------------
@@ -1333,14 +1623,14 @@ ImVec2 ImTriangleClosestPoint(const ImVec2& a, const ImVec2& b, const ImVec2& c,
int ImStricmp(const char* str1, const char* str2)
{
int d;
- while ((d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; }
+ while ((d = ImToUpper(*str2) - ImToUpper(*str1)) == 0 && *str1) { str1++; str2++; }
return d;
}
int ImStrnicmp(const char* str1, const char* str2, size_t count)
{
int d = 0;
- while (count > 0 && (d = toupper(*str2) - toupper(*str1)) == 0 && *str1) { str1++; str2++; count--; }
+ while (count > 0 && (d = ImToUpper(*str2) - ImToUpper(*str1)) == 0 && *str1) { str1++; str2++; count--; }
return d;
}
@@ -1407,14 +1697,14 @@ const char* ImStristr(const char* haystack, const char* haystack_end, const char
if (!needle_end)
needle_end = needle + strlen(needle);
- const char un0 = (char)toupper(*needle);
+ const char un0 = (char)ImToUpper(*needle);
while ((!haystack_end && *haystack) || (haystack_end && haystack < haystack_end))
{
- if (toupper(*haystack) == un0)
+ if (ImToUpper(*haystack) == un0)
{
const char* b = needle + 1;
for (const char* a = haystack + 1; b < needle_end; a++, b++)
- if (toupper(*a) != toupper(*b))
+ if (ImToUpper(*a) != ImToUpper(*b))
break;
if (b == needle_end)
return haystack;
@@ -1458,8 +1748,12 @@ const char* ImStrSkipBlank(const char* str)
// designed using two-passes worst case, which probably could be improved using the stbsp_vsprintfcb() function.)
#ifdef IMGUI_USE_STB_SPRINTF
#define STB_SPRINTF_IMPLEMENTATION
+#ifdef IMGUI_STB_SPRINTF_FILENAME
+#include IMGUI_STB_SPRINTF_FILENAME
+#else
#include "stb_sprintf.h"
#endif
+#endif
#if defined(_MSC_VER) && !defined(vsnprintf)
#define vsnprintf _vsnprintf
@@ -1499,6 +1793,25 @@ int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args)
}
#endif // #ifdef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
+void ImFormatStringToTempBuffer(const char** out_buf, const char** out_buf_end, const char* fmt, ...)
+{
+ 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; }
+ 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; }
+}
+
// CRC32 needs a 1KB lookup table (not cache friendly)
// Although the code to generate the table is simple and shorter than the table itself, using a const table allows us to easily:
// - avoid an unnecessary branch/memory tap, - keep the ImHashXXX functions usable by static constructors, - make it thread-safe.
@@ -1940,7 +2253,7 @@ void ImGuiStorage::BuildSortByKey()
{
struct StaticFunc
{
- static int IMGUI_CDECL PairCompareByID(const void* lhs, const void* rhs)
+ static int IMGUI_CDECL PairComparerByID(const void* lhs, const void* rhs)
{
// We can't just do a subtraction because qsort uses signed integers and subtracting our ID doesn't play well with that.
if (((const ImGuiStoragePair*)lhs)->key > ((const ImGuiStoragePair*)rhs)->key) return +1;
@@ -1948,8 +2261,7 @@ void ImGuiStorage::BuildSortByKey()
return 0;
}
};
- if (Data.Size > 1)
- ImQsort(Data.Data, (size_t)Data.Size, sizeof(ImGuiStoragePair), StaticFunc::PairCompareByID);
+ ImQsort(Data.Data, (size_t)Data.Size, sizeof(ImGuiStoragePair), StaticFunc::PairComparerByID);
}
int ImGuiStorage::GetInt(ImGuiID key, int default_val) const
@@ -2061,18 +2373,15 @@ void ImGuiStorage::SetAllInt(int v)
//-----------------------------------------------------------------------------
// Helper: Parse and apply text filters. In format "aaaaa[,bbbb][,ccccc]"
-ImGuiTextFilter::ImGuiTextFilter(const char* default_filter)
+ImGuiTextFilter::ImGuiTextFilter(const char* default_filter) //-V1077
{
+ InputBuf[0] = 0;
+ CountGrep = 0;
if (default_filter)
{
ImStrncpy(InputBuf, default_filter, IM_ARRAYSIZE(InputBuf));
Build();
}
- else
- {
- InputBuf[0] = 0;
- CountGrep = 0;
- }
}
bool ImGuiTextFilter::Draw(const char* label, float width)
@@ -2159,7 +2468,7 @@ bool ImGuiTextFilter::PassFilter(const char* text, const char* text_end) const
}
//-----------------------------------------------------------------------------
-// [SECTION] ImGuiTextBuffer
+// [SECTION] ImGuiTextBuffer, ImGuiTextIndex
//-----------------------------------------------------------------------------
// On some platform vsnprintf() takes va_list by reference and modifies it.
@@ -2227,6 +2536,20 @@ void ImGuiTextBuffer::appendfv(const char* fmt, va_list args)
va_end(args_copy);
}
+void ImGuiTextIndex::append(const char* base, int old_size, int new_size)
+{
+ IM_ASSERT(old_size >= 0 && new_size >= old_size && new_size >= EndOffset);
+ if (old_size == new_size)
+ return;
+ if (EndOffset == 0 || base[EndOffset - 1] == '\n')
+ LineOffsets.push_back(EndOffset);
+ const char* base_end = base + new_size;
+ for (const char* p = base + old_size; (p = (const char*)memchr(p, '\n', base_end - p)) != 0; )
+ if (++p < base_end) // Don't push a trailing offset on last \n
+ LineOffsets.push_back((int)(intptr_t)(p - base));
+ EndOffset = ImMax(EndOffset, new_size);
+}
+
//-----------------------------------------------------------------------------
// [SECTION] ImGuiListClipper
// This is currently not as flexible/powerful as it should be and really confusing/spaghetti, mostly because we changed
@@ -2241,9 +2564,10 @@ static bool GetSkipItemForListClipping()
return (g.CurrentTable ? g.CurrentTable->HostSkipItems : g.CurrentWindow->SkipItems);
}
-// Helper to calculate coarse clipping of large list of evenly sized items.
-// NB: Prefer using the ImGuiListClipper higher-level helper if you can! Read comments and instructions there on how those use this sort of pattern.
-// NB: 'items_count' is only used to clamp the result, if you don't know your count you can use INT_MAX
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+// Legacy helper to calculate coarse clipping of large list of evenly sized items.
+// This legacy API is not ideal because it assumes we will return a single contiguous rectangle.
+// Prefer using ImGuiListClipper which can returns non-contiguous ranges.
void ImGui::CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end)
{
ImGuiContext& g = *GImGui;
@@ -2262,20 +2586,23 @@ void ImGui::CalcListClipping(int items_count, float items_height, int* out_items
}
// We create the union of the ClipRect and the scoring rect which at worst should be 1 page away from ClipRect
- ImRect unclipped_rect = window->ClipRect;
+ // We don't include g.NavId's rectangle in there (unless g.NavJustMovedToId is set) because the rectangle enlargement can get costly.
+ ImRect rect = window->ClipRect;
if (g.NavMoveScoringItems)
- unclipped_rect.Add(g.NavScoringRect);
+ rect.Add(g.NavScoringNoClipRect);
if (g.NavJustMovedToId && window->NavLastIds[0] == g.NavJustMovedToId)
- unclipped_rect.Add(ImRect(window->Pos + window->NavRectRel[0].Min, window->Pos + window->NavRectRel[0].Max)); // Could store and use NavJustMovedToRectRel
+ rect.Add(WindowRectRelToAbs(window, window->NavRectRel[0])); // Could store and use NavJustMovedToRectRel
const ImVec2 pos = window->DC.CursorPos;
- int start = (int)((unclipped_rect.Min.y - pos.y) / items_height);
- int end = (int)((unclipped_rect.Max.y - pos.y) / items_height);
+ int start = (int)((rect.Min.y - pos.y) / items_height);
+ int end = (int)((rect.Max.y - pos.y) / items_height);
// When performing a navigation request, ensure we have one item extra in the direction we are moving to
- if (g.NavMoveScoringItems && g.NavMoveClipDir == ImGuiDir_Up)
+ // FIXME: Verify this works with tabbing
+ const bool is_nav_request = (g.NavMoveScoringItems && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav);
+ if (is_nav_request && g.NavMoveClipDir == ImGuiDir_Up)
start--;
- if (g.NavMoveScoringItems && g.NavMoveClipDir == ImGuiDir_Down)
+ if (is_nav_request && g.NavMoveClipDir == ImGuiDir_Down)
end++;
start = ImClamp(start, 0, items_count);
@@ -2283,17 +2610,42 @@ void ImGui::CalcListClipping(int items_count, float items_height, int* out_items
*out_items_display_start = start;
*out_items_display_end = end;
}
+#endif
-static void SetCursorPosYAndSetupForPrevLine(float pos_y, float line_height)
+static void ImGuiListClipper_SortAndFuseRanges(ImVector<ImGuiListClipperRange>& ranges, int offset = 0)
+{
+ if (ranges.Size - offset <= 1)
+ return;
+
+ // Helper to order ranges and fuse them together if possible (bubble sort is fine as we are only sorting 2-3 entries)
+ for (int sort_end = ranges.Size - offset - 1; sort_end > 0; --sort_end)
+ for (int i = offset; i < sort_end + offset; ++i)
+ if (ranges[i].Min > ranges[i + 1].Min)
+ ImSwap(ranges[i], ranges[i + 1]);
+
+ // Now fuse ranges together as much as possible.
+ for (int i = 1 + offset; i < ranges.Size; i++)
+ {
+ IM_ASSERT(!ranges[i].PosToIndexConvert && !ranges[i - 1].PosToIndexConvert);
+ if (ranges[i - 1].Max < ranges[i].Min)
+ continue;
+ ranges[i - 1].Min = ImMin(ranges[i - 1].Min, ranges[i].Min);
+ ranges[i - 1].Max = ImMax(ranges[i - 1].Max, ranges[i].Max);
+ ranges.erase(ranges.Data + i);
+ i--;
+ }
+}
+
+static void ImGuiListClipper_SeekCursorAndSetupPrevLine(float pos_y, float line_height)
{
// Set cursor position and a few other things so that SetScrollHereY() and Columns() can work when seeking cursor.
// FIXME: It is problematic that we have to do that here, because custom/equivalent end-user code would stumble on the same issue.
- // The clipper should probably have a 4th step to display the last item in a regular manner.
+ // The clipper should probably have a final step to display the last item in a regular manner, maybe with an opt-out flag for data sets which may have costly seek?
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
float off_y = pos_y - window->DC.CursorPos.y;
window->DC.CursorPos.y = pos_y;
- window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, pos_y);
+ window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, pos_y - g.Style.ItemSpacing.y);
window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y - line_height; // Setting those fields so that SetScrollHereY() can properly function after the end of our clipper usage.
window->DC.PrevLineSize.y = (line_height - g.Style.ItemSpacing.y); // If we end up needing more accurate data (to e.g. use SameLine) we may as well make the clipper have a fourth step to let user process and display the last item in their list.
if (ImGuiOldColumns* columns = window->DC.CurrentColumns)
@@ -2309,6 +2661,15 @@ static void SetCursorPosYAndSetupForPrevLine(float pos_y, float line_height)
}
}
+static void ImGuiListClipper_SeekCursorForItem(ImGuiListClipper* clipper, int item_n)
+{
+ // StartPosY starts from ItemsFrozen hence the subtraction
+ // Perform the add and multiply with double to allow seeking through larger ranges
+ ImGuiListClipperData* data = (ImGuiListClipperData*)clipper->TempData;
+ float pos_y = (float)((double)clipper->StartPosY + data->LossynessOffset + (double)(item_n - data->ItemsFrozen) * clipper->ItemsHeight);
+ ImGuiListClipper_SeekCursorAndSetupPrevLine(pos_y, clipper->ItemsHeight);
+}
+
ImGuiListClipper::ImGuiListClipper()
{
memset(this, 0, sizeof(*this));
@@ -2317,16 +2678,14 @@ ImGuiListClipper::ImGuiListClipper()
ImGuiListClipper::~ImGuiListClipper()
{
- IM_ASSERT(ItemsCount == -1 && "Forgot to call End(), or to Step() until false?");
+ End();
}
-// Use case A: Begin() called from constructor with items_height<0, then called again from Step() in StepNo 1
-// Use case B: Begin() called from constructor with items_height>0
-// FIXME-LEGACY: Ideally we should remove the Begin/End functions but they are part of the legacy API we still support. This is why some of the code in Step() calling Begin() and reassign some fields, spaghetti style.
void ImGuiListClipper::Begin(int items_count, float items_height)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
+ IMGUI_DEBUG_LOG_CLIPPER("Clipper: Begin(%d,%.2f) in '%s'\n", items_count, items_height, window->Name);
if (ImGuiTable* table = g.CurrentTable)
if (table->IsInsideRow)
@@ -2335,127 +2694,193 @@ void ImGuiListClipper::Begin(int items_count, float items_height)
StartPosY = window->DC.CursorPos.y;
ItemsHeight = items_height;
ItemsCount = items_count;
- ItemsFrozen = 0;
- StepNo = 0;
DisplayStart = -1;
DisplayEnd = 0;
+
+ // Acquire temporary buffer
+ if (++g.ClipperTempDataStacked > g.ClipperTempData.Size)
+ g.ClipperTempData.resize(g.ClipperTempDataStacked, ImGuiListClipperData());
+ ImGuiListClipperData* data = &g.ClipperTempData[g.ClipperTempDataStacked - 1];
+ data->Reset(this);
+ data->LossynessOffset = window->DC.CursorStartPosLossyness.y;
+ TempData = data;
}
void ImGuiListClipper::End()
{
- if (ItemsCount < 0) // Already ended
- return;
+ ImGuiContext& g = *GImGui;
+ 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.
+ IMGUI_DEBUG_LOG_CLIPPER("Clipper: End() in '%s'\n", g.CurrentWindow->Name);
+ if (ItemsCount >= 0 && ItemsCount < INT_MAX && DisplayStart >= 0)
+ ImGuiListClipper_SeekCursorForItem(this, ItemsCount);
- // In theory here we should assert that ImGui::GetCursorPosY() == StartPosY + DisplayEnd * ItemsHeight, but it feels saner to just seek at the end and not assert/crash the user.
- if (ItemsCount < INT_MAX && DisplayStart >= 0)
- SetCursorPosYAndSetupForPrevLine(StartPosY + (ItemsCount - ItemsFrozen) * ItemsHeight, ItemsHeight);
+ // Restore temporary buffer and fix back pointers which may be invalidated when nesting
+ IM_ASSERT(data->ListClipper == this);
+ data->StepNo = data->Ranges.Size;
+ if (--g.ClipperTempDataStacked > 0)
+ {
+ data = &g.ClipperTempData[g.ClipperTempDataStacked - 1];
+ data->ListClipper->TempData = data;
+ }
+ TempData = NULL;
+ }
ItemsCount = -1;
- StepNo = 3;
}
-bool ImGuiListClipper::Step()
+void ImGuiListClipper::ForceDisplayRangeByIndices(int item_min, int item_max)
+{
+ ImGuiListClipperData* data = (ImGuiListClipperData*)TempData;
+ IM_ASSERT(DisplayStart < 0); // Only allowed after Begin() and if there has not been a specified range yet.
+ IM_ASSERT(item_min <= item_max);
+ if (item_min < item_max)
+ data->Ranges.push_back(ImGuiListClipperRange::FromIndices(item_min, item_max));
+}
+
+static bool ImGuiListClipper_StepInternal(ImGuiListClipper* clipper)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
+ ImGuiListClipperData* data = (ImGuiListClipperData*)clipper->TempData;
+ IM_ASSERT(data != NULL && "Called ImGuiListClipper::Step() too many times, or before ImGuiListClipper::Begin() ?");
ImGuiTable* table = g.CurrentTable;
if (table && table->IsInsideRow)
ImGui::TableEndRow(table);
// No items
- if (ItemsCount == 0 || GetSkipItemForListClipping())
- {
- End();
+ if (clipper->ItemsCount == 0 || GetSkipItemForListClipping())
return false;
+
+ // While we are in frozen row state, keep displaying items one by one, unclipped
+ // FIXME: Could be stored as a table-agnostic state.
+ if (data->StepNo == 0 && table != NULL && !table->IsUnfrozenRows)
+ {
+ clipper->DisplayStart = data->ItemsFrozen;
+ clipper->DisplayEnd = ImMin(data->ItemsFrozen + 1, clipper->ItemsCount);
+ if (clipper->DisplayStart < clipper->DisplayEnd)
+ data->ItemsFrozen++;
+ return true;
}
// Step 0: Let you process the first element (regardless of it being visible or not, so we can measure the element height)
- if (StepNo == 0)
+ bool calc_clipping = false;
+ if (data->StepNo == 0)
{
- // While we are in frozen row state, keep displaying items one by one, unclipped
- // FIXME: Could be stored as a table-agnostic state.
- if (table != NULL && !table->IsUnfrozenRows)
+ clipper->StartPosY = window->DC.CursorPos.y;
+ if (clipper->ItemsHeight <= 0.0f)
{
- DisplayStart = ItemsFrozen;
- DisplayEnd = ItemsFrozen + 1;
- ItemsFrozen++;
+ // Submit the first item (or range) so we can measure its height (generally the first range is 0..1)
+ data->Ranges.push_front(ImGuiListClipperRange::FromIndices(data->ItemsFrozen, data->ItemsFrozen + 1));
+ clipper->DisplayStart = ImMax(data->Ranges[0].Min, data->ItemsFrozen);
+ clipper->DisplayEnd = ImMin(data->Ranges[0].Max, clipper->ItemsCount);
+ data->StepNo = 1;
return true;
}
+ calc_clipping = true; // If on the first step with known item height, calculate clipping.
+ }
- StartPosY = window->DC.CursorPos.y;
- if (ItemsHeight <= 0.0f)
- {
- // Submit the first item so we can measure its height (generally it is 0..1)
- DisplayStart = ItemsFrozen;
- DisplayEnd = ItemsFrozen + 1;
- StepNo = 1;
- return true;
- }
+ // Step 1: Let the clipper infer height from first range
+ if (clipper->ItemsHeight <= 0.0f)
+ {
+ IM_ASSERT(data->StepNo == 1);
+ if (table)
+ IM_ASSERT(table->RowPosY1 == clipper->StartPosY && table->RowPosY2 == window->DC.CursorPos.y);
- // Already has item height (given by user in Begin): skip to calculating step
- DisplayStart = DisplayEnd;
- StepNo = 2;
+ clipper->ItemsHeight = (window->DC.CursorPos.y - clipper->StartPosY) / (float)(clipper->DisplayEnd - clipper->DisplayStart);
+ bool affected_by_floating_point_precision = ImIsFloatAboveGuaranteedIntegerPrecision(clipper->StartPosY) || ImIsFloatAboveGuaranteedIntegerPrecision(window->DC.CursorPos.y);
+ if (affected_by_floating_point_precision)
+ clipper->ItemsHeight = window->DC.PrevLineSize.y + g.Style.ItemSpacing.y; // FIXME: Technically wouldn't allow multi-line entries.
+
+ IM_ASSERT(clipper->ItemsHeight > 0.0f && "Unable to calculate item height! First item hasn't moved the cursor vertically!");
+ calc_clipping = true; // If item height had to be calculated, calculate clipping afterwards.
}
- // Step 1: the clipper infer height from first element
- if (StepNo == 1)
+ // Step 0 or 1: Calculate the actual ranges of visible elements.
+ const int already_submitted = clipper->DisplayEnd;
+ if (calc_clipping)
{
- IM_ASSERT(ItemsHeight <= 0.0f);
- if (table)
+ if (g.LogEnabled)
{
- const float pos_y1 = table->RowPosY1; // Using this instead of StartPosY to handle clipper straddling the frozen row
- const float pos_y2 = table->RowPosY2; // Using this instead of CursorPos.y to take account of tallest cell.
- ItemsHeight = pos_y2 - pos_y1;
- window->DC.CursorPos.y = pos_y2;
+ // If logging is active, do not perform any clipping
+ data->Ranges.push_back(ImGuiListClipperRange::FromIndices(0, clipper->ItemsCount));
}
else
{
- ItemsHeight = window->DC.CursorPos.y - StartPosY;
- }
- IM_ASSERT(ItemsHeight > 0.0f && "Unable to calculate item height! First item hasn't moved the cursor vertically!");
- StepNo = 2;
- }
-
- // Reached end of list
- if (DisplayEnd >= ItemsCount)
- {
- End();
- return false;
+ // Add range selected to be included for navigation
+ const bool is_nav_request = (g.NavMoveScoringItems && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav);
+ if (is_nav_request)
+ data->Ranges.push_back(ImGuiListClipperRange::FromPositions(g.NavScoringNoClipRect.Min.y, g.NavScoringNoClipRect.Max.y, 0, 0));
+ if (is_nav_request && (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing) && g.NavTabbingDir == -1)
+ data->Ranges.push_back(ImGuiListClipperRange::FromIndices(clipper->ItemsCount - 1, clipper->ItemsCount));
+
+ // Add focused/active item
+ ImRect nav_rect_abs = ImGui::WindowRectRelToAbs(window, window->NavRectRel[0]);
+ if (g.NavId != 0 && window->NavLastIds[0] == g.NavId)
+ data->Ranges.push_back(ImGuiListClipperRange::FromPositions(nav_rect_abs.Min.y, nav_rect_abs.Max.y, 0, 0));
+
+ // Add visible range
+ const int off_min = (is_nav_request && g.NavMoveClipDir == ImGuiDir_Up) ? -1 : 0;
+ const int off_max = (is_nav_request && g.NavMoveClipDir == ImGuiDir_Down) ? 1 : 0;
+ data->Ranges.push_back(ImGuiListClipperRange::FromPositions(window->ClipRect.Min.y, window->ClipRect.Max.y, off_min, off_max));
+ }
+
+ // Convert position ranges to item index ranges
+ // - Very important: when a starting position is after our maximum item, we set Min to (ItemsCount - 1). This allows us to handle most forms of wrapping.
+ // - Due to how Selectable extra padding they tend to be "unaligned" with exact unit in the item list,
+ // which with the flooring/ceiling tend to lead to 2 items instead of one being submitted.
+ for (int i = 0; i < data->Ranges.Size; i++)
+ if (data->Ranges[i].PosToIndexConvert)
+ {
+ int m1 = (int)(((double)data->Ranges[i].Min - window->DC.CursorPos.y - data->LossynessOffset) / clipper->ItemsHeight);
+ int m2 = (int)((((double)data->Ranges[i].Max - window->DC.CursorPos.y - data->LossynessOffset) / clipper->ItemsHeight) + 0.999999f);
+ data->Ranges[i].Min = ImClamp(already_submitted + m1 + data->Ranges[i].PosToIndexOffsetMin, already_submitted, clipper->ItemsCount - 1);
+ data->Ranges[i].Max = ImClamp(already_submitted + m2 + data->Ranges[i].PosToIndexOffsetMax, data->Ranges[i].Min + 1, clipper->ItemsCount);
+ data->Ranges[i].PosToIndexConvert = false;
+ }
+ ImGuiListClipper_SortAndFuseRanges(data->Ranges, data->StepNo);
}
- // Step 2: calculate the actual range of elements to display, and position the cursor before the first element
- if (StepNo == 2)
+ // Step 0+ (if item height is given in advance) or 1+: Display the next range in line.
+ if (data->StepNo < data->Ranges.Size)
{
- IM_ASSERT(ItemsHeight > 0.0f);
-
- int already_submitted = DisplayEnd;
- ImGui::CalcListClipping(ItemsCount - already_submitted, ItemsHeight, &DisplayStart, &DisplayEnd);
- DisplayStart += already_submitted;
- DisplayEnd += already_submitted;
-
- // Seek cursor
- if (DisplayStart > already_submitted)
- SetCursorPosYAndSetupForPrevLine(StartPosY + (DisplayStart - ItemsFrozen) * ItemsHeight, ItemsHeight);
-
- StepNo = 3;
+ clipper->DisplayStart = ImMax(data->Ranges[data->StepNo].Min, already_submitted);
+ clipper->DisplayEnd = ImMin(data->Ranges[data->StepNo].Max, clipper->ItemsCount);
+ if (clipper->DisplayStart > already_submitted) //-V1051
+ ImGuiListClipper_SeekCursorForItem(clipper, clipper->DisplayStart);
+ data->StepNo++;
return true;
}
- // Step 3: the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd),
+ // After the last step: Let the clipper validate that we have reached the expected Y position (corresponding to element DisplayEnd),
// Advance the cursor to the end of the list and then returns 'false' to end the loop.
- if (StepNo == 3)
- {
- // Seek cursor
- if (ItemsCount < INT_MAX)
- SetCursorPosYAndSetupForPrevLine(StartPosY + (ItemsCount - ItemsFrozen) * ItemsHeight, ItemsHeight); // advance cursor
- ItemsCount = -1;
- return false;
- }
+ if (clipper->ItemsCount < INT_MAX)
+ ImGuiListClipper_SeekCursorForItem(clipper, clipper->ItemsCount);
- IM_ASSERT(0);
return false;
}
+bool ImGuiListClipper::Step()
+{
+ ImGuiContext& g = *GImGui;
+ bool need_items_height = (ItemsHeight <= 0.0f);
+ bool ret = ImGuiListClipper_StepInternal(this);
+ if (ret && (DisplayStart == DisplayEnd))
+ ret = false;
+ if (g.CurrentTable && g.CurrentTable->IsUnfrozenRows == false)
+ IMGUI_DEBUG_LOG_CLIPPER("Clipper: Step(): inside frozen table row.\n");
+ 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;
+}
+
//-----------------------------------------------------------------------------
// [SECTION] STYLING
//-----------------------------------------------------------------------------
@@ -2522,6 +2947,11 @@ void ImGui::PushStyleColor(ImGuiCol idx, const ImVec4& col)
void ImGui::PopStyleColor(int count)
{
ImGuiContext& g = *GImGui;
+ if (g.ColorStack.Size < count)
+ {
+ IM_ASSERT_USER_ERROR(g.ColorStack.Size > count, "Calling PopStyleColor() too many times: stack underflow.");
+ count = g.ColorStack.Size;
+ }
while (count > 0)
{
ImGuiColorMod& backup = g.ColorStack.back();
@@ -2606,6 +3036,11 @@ void ImGui::PushStyleVar(ImGuiStyleVar idx, const ImVec2& val)
void ImGui::PopStyleVar(int count)
{
ImGuiContext& g = *GImGui;
+ if (g.StyleVarStack.Size < count)
+ {
+ IM_ASSERT_USER_ERROR(g.StyleVarStack.Size > count, "Calling PopStyleVar() too many times: stack underflow.");
+ count = g.StyleVarStack.Size;
+ }
while (count > 0)
{
// We avoid a generic memcpy(data, &backup.Backup.., GDataTypeSize[info->Type] * info->Count), the overhead in Debug is not worth it.
@@ -2929,6 +3364,32 @@ void ImGui::RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFl
}
}
+void ImGui::RenderMouseCursor(ImVec2 base_pos, float base_scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(mouse_cursor > ImGuiMouseCursor_None && mouse_cursor < ImGuiMouseCursor_COUNT);
+ 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;
+ 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();
+ }
+ }
+}
+
+
//-----------------------------------------------------------------------------
// [SECTION] MAIN CODE (most of the code! lots of stuff, needs tidying up!)
//-----------------------------------------------------------------------------
@@ -2968,11 +3429,9 @@ 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);
- ImGui::KeepAliveID(id);
-#ifdef IMGUI_ENABLE_TEST_ENGINE
ImGuiContext& g = *GImGui;
- IMGUI_TEST_ENGINE_ID_INFO2(id, ImGuiDataType_String, str, str_end);
-#endif
+ if (g.DebugHookIdInfo == id)
+ ImGui::DebugHookIdInfo(id, ImGuiDataType_String, str, str_end);
return id;
}
@@ -2980,11 +3439,9 @@ ImGuiID ImGuiWindow::GetID(const void* ptr)
{
ImGuiID seed = IDStack.back();
ImGuiID id = ImHashData(&ptr, sizeof(void*), seed);
- ImGui::KeepAliveID(id);
-#ifdef IMGUI_ENABLE_TEST_ENGINE
ImGuiContext& g = *GImGui;
- IMGUI_TEST_ENGINE_ID_INFO(id, ImGuiDataType_Pointer, ptr);
-#endif
+ if (g.DebugHookIdInfo == id)
+ ImGui::DebugHookIdInfo(id, ImGuiDataType_Pointer, ptr, NULL);
return id;
}
@@ -2992,44 +3449,9 @@ ImGuiID ImGuiWindow::GetID(int n)
{
ImGuiID seed = IDStack.back();
ImGuiID id = ImHashData(&n, sizeof(n), seed);
- ImGui::KeepAliveID(id);
-#ifdef IMGUI_ENABLE_TEST_ENGINE
ImGuiContext& g = *GImGui;
- IMGUI_TEST_ENGINE_ID_INFO(id, ImGuiDataType_S32, (intptr_t)n);
-#endif
- return id;
-}
-
-ImGuiID ImGuiWindow::GetIDNoKeepAlive(const char* str, const char* str_end)
-{
- ImGuiID seed = IDStack.back();
- ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed);
-#ifdef IMGUI_ENABLE_TEST_ENGINE
- ImGuiContext& g = *GImGui;
- IMGUI_TEST_ENGINE_ID_INFO2(id, ImGuiDataType_String, str, str_end);
-#endif
- return id;
-}
-
-ImGuiID ImGuiWindow::GetIDNoKeepAlive(const void* ptr)
-{
- ImGuiID seed = IDStack.back();
- ImGuiID id = ImHashData(&ptr, sizeof(void*), seed);
-#ifdef IMGUI_ENABLE_TEST_ENGINE
- ImGuiContext& g = *GImGui;
- IMGUI_TEST_ENGINE_ID_INFO(id, ImGuiDataType_Pointer, ptr);
-#endif
- return id;
-}
-
-ImGuiID ImGuiWindow::GetIDNoKeepAlive(int n)
-{
- ImGuiID seed = IDStack.back();
- ImGuiID id = ImHashData(&n, sizeof(n), seed);
-#ifdef IMGUI_ENABLE_TEST_ENGINE
- ImGuiContext& g = *GImGui;
- IMGUI_TEST_ENGINE_ID_INFO(id, ImGuiDataType_S32, (intptr_t)n);
-#endif
+ if (g.DebugHookIdInfo == id)
+ ImGui::DebugHookIdInfo(id, ImGuiDataType_S32, (void*)(intptr_t)n, NULL);
return id;
}
@@ -3037,9 +3459,8 @@ ImGuiID ImGuiWindow::GetIDNoKeepAlive(int n)
ImGuiID ImGuiWindow::GetIDFromRectangle(const ImRect& r_abs)
{
ImGuiID seed = IDStack.back();
- const int r_rel[4] = { (int)(r_abs.Min.x - Pos.x), (int)(r_abs.Min.y - Pos.y), (int)(r_abs.Max.x - Pos.x), (int)(r_abs.Max.y - Pos.y) };
+ ImRect r_rel = ImGui::WindowRectAbsToRel(this, r_abs);
ImGuiID id = ImHashData(&r_rel, sizeof(r_rel), seed);
- ImGui::KeepAliveID(id);
return id;
}
@@ -3089,9 +3510,21 @@ void ImGui::GcAwakeTransientWindowBuffers(ImGuiWindow* window)
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)
+ {
+ IMGUI_DEBUG_LOG_ACTIVEID("SetActiveID() cancel MovingWindow\n");
+ g.MovingWindow = NULL;
+ }
+
+ // Set active id
g.ActiveIdIsJustActivated = (g.ActiveId != id);
if (g.ActiveIdIsJustActivated)
{
+ IMGUI_DEBUG_LOG_ACTIVEID("SetActiveID() old:0x%08X (window \"%s\") -> new:0x%08X (window \"%s\")\n", g.ActiveId, g.ActiveIdWindow ? g.ActiveIdWindow->Name : "", id, window ? window->Name : "");
g.ActiveIdTimer = 0.0f;
g.ActiveIdHasBeenPressedBefore = false;
g.ActiveIdHasBeenEditedBefore = false;
@@ -3110,15 +3543,16 @@ void ImGui::SetActiveID(ImGuiID id, ImGuiWindow* window)
if (id)
{
g.ActiveIdIsAlive = id;
- g.ActiveIdSource = (g.NavActivateId == id || g.NavActivateInputId == id || g.NavJustTabbedId == id || g.NavJustMovedToId == id) ? ImGuiInputSource_Nav : ImGuiInputSource_Mouse;
+ g.ActiveIdSource = (g.NavActivateId == id || g.NavActivateInputId == id || g.NavJustMovedToId == id) ? (ImGuiInputSource)ImGuiInputSource_Nav : ImGuiInputSource_Mouse;
}
// Clear declaration of inputs claimed by the widget
// (Please note that this is WIP and not all keys/inputs are thoroughly declared by all widgets yet)
- g.ActiveIdUsingMouseWheel = false;
g.ActiveIdUsingNavDirMask = 0x00;
+ g.ActiveIdUsingAllKeyboardKeys = false;
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
g.ActiveIdUsingNavInputMask = 0x00;
- g.ActiveIdUsingKeyInputMask = 0x00;
+#endif
}
void ImGui::ClearActiveID()
@@ -3131,7 +3565,6 @@ void ImGui::SetHoveredID(ImGuiID id)
ImGuiContext& g = *GImGui;
g.HoveredId = id;
g.HoveredIdAllowOverlap = false;
- g.HoveredIdUsingMouseWheel = false;
if (id != 0 && g.HoveredIdPreviousFrame != id)
g.HoveredIdTimer = g.HoveredIdNotActiveTimer = 0.0f;
}
@@ -3142,6 +3575,8 @@ ImGuiID ImGui::GetHoveredID()
return g.HoveredId ? g.HoveredId : g.HoveredIdPreviousFrame;
}
+// This is called by ItemAdd().
+// Code not using ItemAdd() may need to call this manually otherwise ActiveId will be cleared. In IMGUI_VERSION_NUM < 18717 this was called by GetID().
void ImGui::KeepAliveID(ImGuiID id)
{
ImGuiContext& g = *GImGui;
@@ -3154,7 +3589,7 @@ void ImGui::KeepAliveID(ImGuiID id)
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 need to fill the data.
+ // 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.
@@ -3174,11 +3609,17 @@ static inline bool IsWindowContentHoverable(ImGuiWindow* window, ImGuiHoveredFla
if (focused_root_window->WasActive && focused_root_window != window->RootWindow)
{
// For the purpose of those flags we differentiate "standard popup" from "modal popup"
- // NB: The order of those two tests is important because Modal windows are also Popups.
+ // NB: The 'else' is important because Modal windows are also Popups.
+ bool want_inhibit = false;
if (focused_root_window->Flags & ImGuiWindowFlags_Modal)
- return false;
- if ((focused_root_window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiHoveredFlags_AllowWhenBlockedByPopup))
- return false;
+ want_inhibit = true;
+ else if ((focused_root_window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiHoveredFlags_AllowWhenBlockedByPopup))
+ want_inhibit = true;
+
+ // Inhibit hover unless the window is within the stack of our modal/popup
+ if (want_inhibit)
+ if (!ImGui::IsWindowWithinBeginStackOf(window->RootWindow, focused_root_window))
+ return false;
}
return true;
}
@@ -3190,46 +3631,69 @@ bool ImGui::IsItemHovered(ImGuiHoveredFlags flags)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- if (g.NavDisableMouseHover && !g.NavDisableHighlight)
+ if (g.NavDisableMouseHover && !g.NavDisableHighlight && !(flags & ImGuiHoveredFlags_NoNavOverride))
{
if ((g.LastItemData.InFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled))
return false;
- return IsItemFocused();
+ if (!IsItemFocused())
+ return false;
}
+ else
+ {
+ // Test for bounding box overlap, as updated as ItemAdd()
+ ImGuiItemStatusFlags status_flags = g.LastItemData.StatusFlags;
+ if (!(status_flags & ImGuiItemStatusFlags_HoveredRect))
+ return false;
+ IM_ASSERT((flags & (ImGuiHoveredFlags_AnyWindow | ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows | ImGuiHoveredFlags_NoPopupHierarchy)) == 0); // Flags not supported by this function
+
+ // Done with rectangle culling so we can perform heavier checks now
+ // Test if we are hovering the right window (our window could be behind another window)
+ // [2021/03/02] Reworked / reverted the revert, finally. Note we want e.g. BeginGroup/ItemAdd/EndGroup to work as well. (#3851)
+ // [2017/10/16] Reverted commit 344d48be3 and testing RootWindow instead. I believe it is correct to NOT test for RootWindow but this leaves us unable
+ // to use IsItemHovered() after EndChild() itself. Until a solution is found I believe reverting to the test from 2017/09/27 is safe since this was
+ // the test that has been running for a long while.
+ if (g.HoveredWindow != window && (status_flags & ImGuiItemStatusFlags_HoveredWindow) == 0)
+ if ((flags & ImGuiHoveredFlags_AllowWhenOverlapped) == 0)
+ return false;
- // Test for bounding box overlap, as updated as ItemAdd()
- ImGuiItemStatusFlags status_flags = g.LastItemData.StatusFlags;
- if (!(status_flags & ImGuiItemStatusFlags_HoveredRect))
- return false;
- IM_ASSERT((flags & (ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows)) == 0); // Flags not supported by this function
-
- // Test if we are hovering the right window (our window could be behind another window)
- // [2021/03/02] Reworked / reverted the revert, finally. Note we want e.g. BeginGroup/ItemAdd/EndGroup to work as well. (#3851)
- // [2017/10/16] Reverted commit 344d48be3 and testing RootWindow instead. I believe it is correct to NOT test for RootWindow but this leaves us unable
- // to use IsItemHovered() after EndChild() itself. Until a solution is found I believe reverting to the test from 2017/09/27 is safe since this was
- // the test that has been running for a long while.
- if (g.HoveredWindow != window && (status_flags & ImGuiItemStatusFlags_HoveredWindow) == 0)
- if ((flags & ImGuiHoveredFlags_AllowWhenOverlapped) == 0)
+ // Test if another item is active (e.g. being dragged)
+ if ((flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) == 0)
+ if (g.ActiveId != 0 && g.ActiveId != g.LastItemData.ID && !g.ActiveIdAllowOverlap && g.ActiveId != window->MoveId)
+ return false;
+
+ // Test if interactions on this window are blocked by an active popup or modal.
+ // The ImGuiHoveredFlags_AllowWhenBlockedByPopup flag will be tested here.
+ if (!IsWindowContentHoverable(window, flags) && !(g.LastItemData.InFlags & ImGuiItemFlags_NoWindowHoverableCheck))
return false;
- // Test if another item is active (e.g. being dragged)
- if ((flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) == 0)
- if (g.ActiveId != 0 && g.ActiveId != g.LastItemData.ID && !g.ActiveIdAllowOverlap && g.ActiveId != window->MoveId)
+ // Test if the item is disabled
+ if ((g.LastItemData.InFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled))
return false;
- // Test if interactions on this window are blocked by an active popup or modal.
- // The ImGuiHoveredFlags_AllowWhenBlockedByPopup flag will be tested here.
- if (!IsWindowContentHoverable(window, 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.
+ if (g.LastItemData.ID == window->MoveId && window->WriteAccessed)
+ return false;
+ }
- // Test if the item is disabled
- if ((g.LastItemData.InFlags & ImGuiItemFlags_Disabled) && !(flags & ImGuiHoveredFlags_AllowWhenDisabled))
- return false;
+ // Handle hover delay
+ // (some ideas: https://www.nngroup.com/articles/timing-exposing-content)
+ float delay;
+ if (flags & ImGuiHoveredFlags_DelayNormal)
+ delay = g.IO.HoverDelayNormal;
+ else if (flags & ImGuiHoveredFlags_DelayShort)
+ delay = g.IO.HoverDelayShort;
+ else
+ delay = 0.0f;
+ if (delay > 0.0f)
+ {
+ ImGuiID hover_delay_id = (g.LastItemData.ID != 0) ? g.LastItemData.ID : window->GetIDFromRectangle(g.LastItemData.Rect);
+ if ((flags & ImGuiHoveredFlags_NoSharedDelay) && (g.HoverDelayIdPreviousFrame != hover_delay_id))
+ g.HoverDelayTimer = 0.0f;
+ g.HoverDelayId = hover_delay_id;
+ return g.HoverDelayTimer >= delay;
+ }
- // 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.
- if (g.LastItemData.ID == window->MoveId && window->WriteAccessed)
- return false;
return true;
}
@@ -3247,9 +3711,10 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id)
return false;
if (!IsMouseHoveringRect(bb.Min, bb.Max))
return false;
- if (g.NavDisableMouseHover)
- return false;
- if (!IsWindowContentHoverable(window, ImGuiHoveredFlags_None))
+
+ // Done with rectangle culling so we can perform heavier checks now.
+ ImGuiItemFlags item_flags = (g.LastItemData.ID == id ? g.LastItemData.InFlags : g.CurrentItemFlags);
+ if (!(item_flags & ImGuiItemFlags_NoWindowHoverableCheck) && !IsWindowContentHoverable(window, ImGuiHoveredFlags_None))
{
g.HoveredIdDisabled = true;
return false;
@@ -3261,7 +3726,6 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id)
SetHoveredID(id);
// When disabled we'll return false but still set HoveredId
- ImGuiItemFlags item_flags = (g.LastItemData.ID == id ? g.LastItemData.InFlags : g.CurrentItemFlags);
if (item_flags & ImGuiItemFlags_Disabled)
{
// Release active id if turning disabled
@@ -3276,17 +3740,20 @@ bool ImGui::ItemHoverable(const ImRect& bb, ImGuiID id)
// [DEBUG] Item Picker tool!
// We perform the check here because SetHoveredID() is not frequently called (1~ time a frame), making
// the cost of this tool near-zero. We can get slightly better call-stack and support picking non-hovered
- // items if we perform the test in ItemAdd(), but that would incur a small runtime cost.
- // #define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX in imconfig.h if you want this check to also be performed in ItemAdd().
+ // items if we performed the test in ItemAdd(), but that would incur a small runtime cost.
if (g.DebugItemPickerActive && g.HoveredIdPreviousFrame == id)
GetForegroundDrawList()->AddRect(bb.Min, bb.Max, IM_COL32(255, 255, 0, 255));
if (g.DebugItemPickerBreakId == id)
IM_DEBUG_BREAK();
}
+ if (g.NavDisableMouseHover)
+ return false;
+
return true;
}
+// FIXME: This is inlined/duplicated in ItemAdd()
bool ImGui::IsClippedEx(const ImRect& bb, ImGuiID id)
{
ImGuiContext& g = *GImGui;
@@ -3298,52 +3765,15 @@ bool ImGui::IsClippedEx(const ImRect& bb, ImGuiID id)
return false;
}
-// Called by ItemAdd()
-// Process TAB/Shift+TAB. Be mindful that this function may _clear_ the ActiveID when tabbing out.
-// [WIP] This will eventually be refactored and moved into NavProcessItem()
-void ImGui::ItemInputable(ImGuiWindow* window, ImGuiID id)
+// This is also inlined in ItemAdd()
+// Note: if ImGuiItemStatusFlags_HasDisplayRect is set, user needs to set window->DC.LastItemDisplayRect!
+void ImGui::SetLastItemData(ImGuiID item_id, ImGuiItemFlags in_flags, ImGuiItemStatusFlags item_flags, const ImRect& item_rect)
{
ImGuiContext& g = *GImGui;
- IM_ASSERT(id != 0 && id == g.LastItemData.ID);
-
- // Increment counters
- // FIXME: ImGuiItemFlags_Disabled should disable more.
- const bool is_tab_stop = (g.LastItemData.InFlags & (ImGuiItemFlags_NoTabStop | ImGuiItemFlags_Disabled)) == 0;
- window->DC.FocusCounterRegular++;
- if (is_tab_stop)
- {
- window->DC.FocusCounterTabStop++;
- if (g.NavId == id)
- g.NavIdTabCounter = window->DC.FocusCounterTabStop;
- }
-
- // Process TAB/Shift-TAB to tab *OUT* of the currently focused item.
- // (Note that we can always TAB out of a widget that doesn't allow tabbing in)
- if (g.ActiveId == id && g.TabFocusPressed && !IsActiveIdUsingKey(ImGuiKey_Tab) && g.TabFocusRequestNextWindow == NULL)
- {
- g.TabFocusRequestNextWindow = window;
- g.TabFocusRequestNextCounterTabStop = window->DC.FocusCounterTabStop + (g.IO.KeyShift ? (is_tab_stop ? -1 : 0) : +1); // Modulo on index will be applied at the end of frame once we've got the total counter of items.
- }
-
- // Handle focus requests
- if (g.TabFocusRequestCurrWindow == window)
- {
- if (window->DC.FocusCounterRegular == g.TabFocusRequestCurrCounterRegular)
- {
- g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_FocusedByCode;
- return;
- }
- if (is_tab_stop && window->DC.FocusCounterTabStop == g.TabFocusRequestCurrCounterTabStop)
- {
- g.NavJustTabbedId = id; // FIXME-NAV: aim to eventually set in NavUpdate() once we finish the refactor
- g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_FocusedByTabbing;
- return;
- }
-
- // If another item is about to be focused, we clear our own active id
- if (g.ActiveId == id)
- ClearActiveID();
- }
+ g.LastItemData.ID = item_id;
+ g.LastItemData.InFlags = in_flags;
+ g.LastItemData.StatusFlags = item_flags;
+ g.LastItemData.Rect = item_rect;
}
float ImGui::CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x)
@@ -3438,20 +3868,23 @@ void ImGui::GetAllocatorFunctions(ImGuiMemAllocFunc* p_alloc_func, ImGuiMemFreeF
ImGuiContext* ImGui::CreateContext(ImFontAtlas* shared_font_atlas)
{
+ ImGuiContext* prev_ctx = GetCurrentContext();
ImGuiContext* ctx = IM_NEW(ImGuiContext)(shared_font_atlas);
- if (GImGui == NULL)
- SetCurrentContext(ctx);
- Initialize(ctx);
+ 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)
{
- if (ctx == NULL)
- ctx = GImGui;
- Shutdown(ctx);
- if (GImGui == ctx)
- SetCurrentContext(NULL);
+ ImGuiContext* prev_ctx = GetCurrentContext();
+ if (ctx == NULL) //-V1051
+ ctx = prev_ctx;
+ SetCurrentContext(ctx);
+ Shutdown();
+ SetCurrentContext((prev_ctx != ctx) ? prev_ctx : NULL);
IM_DELETE(ctx);
}
@@ -3571,7 +4004,7 @@ void ImGui::StartMouseMovingWindow(ImGuiWindow* window)
g.NavDisableHighlight = true;
g.ActiveIdClickOffset = g.IO.MouseClickedPos[0] - window->RootWindow->Pos;
g.ActiveIdNoClearOnFocusLoss = true;
- SetActiveIdUsingNavAndKeys();
+ SetActiveIdUsingAllKeyboardKeys();
bool can_move_window = true;
if ((window->Flags & ImGuiWindowFlags_NoMove) || (window->RootWindow->Flags & ImGuiWindowFlags_NoMove))
@@ -3598,11 +4031,7 @@ void ImGui::UpdateMouseMovingWindowNewFrame()
if (g.IO.MouseDown[0] && IsMousePosValid(&g.IO.MousePos))
{
ImVec2 pos = g.IO.MousePos - g.ActiveIdClickOffset;
- if (moving_window->Pos.x != pos.x || moving_window->Pos.y != pos.y)
- {
- MarkIniSettingsDirty(moving_window);
- SetWindowPos(moving_window, pos, ImGuiCond_Always);
- }
+ SetWindowPos(moving_window, pos, ImGuiCond_Always);
FocusWindow(g.MovingWindow);
}
else
@@ -3672,7 +4101,7 @@ void ImGui::UpdateMouseMovingWindowEndFrame()
// Find the top-most window between HoveredWindow and the top-most Modal Window.
// This is where we can trim the popup stack.
ImGuiWindow* modal = GetTopMostPopupModal();
- bool hovered_window_above_modal = g.HoveredWindow && IsWindowAbove(g.HoveredWindow, modal);
+ bool hovered_window_above_modal = g.HoveredWindow && (modal == NULL || IsWindowAbove(g.HoveredWindow, modal));
ClosePopupsOverWindow(hovered_window_above_modal ? g.HoveredWindow : modal, true);
}
}
@@ -3682,73 +4111,248 @@ 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(&g.IO.MousePos))
- g.IO.MousePos = g.MouseLastValidPos = ImFloor(g.IO.MousePos);
+ 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(&g.IO.MousePos) && IsMousePosValid(&g.IO.MousePosPrev))
- g.IO.MouseDelta = g.IO.MousePos - g.IO.MousePosPrev;
+ if (IsMousePosValid(&io.MousePos) && IsMousePosValid(&io.MousePosPrev))
+ io.MouseDelta = io.MousePos - io.MousePosPrev;
else
- g.IO.MouseDelta = ImVec2(0.0f, 0.0f);
+ 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 (g.IO.MouseDelta.x != 0.0f || g.IO.MouseDelta.y != 0.0f)
+ if (io.MouseDelta.x != 0.0f || io.MouseDelta.y != 0.0f)
g.NavDisableMouseHover = false;
- g.IO.MousePosPrev = g.IO.MousePos;
- for (int i = 0; i < IM_ARRAYSIZE(g.IO.MouseDown); i++)
+ io.MousePosPrev = io.MousePos;
+ for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++)
{
- g.IO.MouseClicked[i] = g.IO.MouseDown[i] && g.IO.MouseDownDuration[i] < 0.0f;
- g.IO.MouseReleased[i] = !g.IO.MouseDown[i] && g.IO.MouseDownDuration[i] >= 0.0f;
- g.IO.MouseDownDurationPrev[i] = g.IO.MouseDownDuration[i];
- g.IO.MouseDownDuration[i] = g.IO.MouseDown[i] ? (g.IO.MouseDownDuration[i] < 0.0f ? 0.0f : g.IO.MouseDownDuration[i] + g.IO.DeltaTime) : -1.0f;
- g.IO.MouseDoubleClicked[i] = false;
- if (g.IO.MouseClicked[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])
{
- if ((float)(g.Time - g.IO.MouseClickedTime[i]) < g.IO.MouseDoubleClickTime)
+ bool is_repeated_click = false;
+ if ((float)(g.Time - io.MouseClickedTime[i]) < io.MouseDoubleClickTime)
{
- ImVec2 delta_from_click_pos = IsMousePosValid(&g.IO.MousePos) ? (g.IO.MousePos - g.IO.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f);
- if (ImLengthSqr(delta_from_click_pos) < g.IO.MouseDoubleClickMaxDist * g.IO.MouseDoubleClickMaxDist)
- g.IO.MouseDoubleClicked[i] = true;
- g.IO.MouseClickedTime[i] = -g.IO.MouseDoubleClickTime * 2.0f; // Mark as "old enough" so the third click isn't turned into a double-click
+ 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
- {
- g.IO.MouseClickedTime[i] = g.Time;
- }
- g.IO.MouseClickedPos[i] = g.IO.MousePos;
- g.IO.MouseDownWasDoubleClick[i] = g.IO.MouseDoubleClicked[i];
- g.IO.MouseDragMaxDistanceAbs[i] = ImVec2(0.0f, 0.0f);
- g.IO.MouseDragMaxDistanceSqr[i] = 0.0f;
+ 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 (g.IO.MouseDown[i])
+ else if (io.MouseDown[i])
{
// Maintain the maximum distance we reaching from the initial click position, which is used with dragging threshold
- ImVec2 delta_from_click_pos = IsMousePosValid(&g.IO.MousePos) ? (g.IO.MousePos - g.IO.MouseClickedPos[i]) : ImVec2(0.0f, 0.0f);
- g.IO.MouseDragMaxDistanceSqr[i] = ImMax(g.IO.MouseDragMaxDistanceSqr[i], ImLengthSqr(delta_from_click_pos));
- g.IO.MouseDragMaxDistanceAbs[i].x = ImMax(g.IO.MouseDragMaxDistanceAbs[i].x, delta_from_click_pos.x < 0.0f ? -delta_from_click_pos.x : delta_from_click_pos.x);
- g.IO.MouseDragMaxDistanceAbs[i].y = ImMax(g.IO.MouseDragMaxDistanceAbs[i].y, delta_from_click_pos.y < 0.0f ? -delta_from_click_pos.y : delta_from_click_pos.y);
- }
- if (!g.IO.MouseDown[i] && !g.IO.MouseReleased[i])
- g.IO.MouseDownWasDoubleClick[i] = false;
- if (g.IO.MouseClicked[i]) // Clicking any mouse button reactivate mouse hovering which may have been deactivated by gamepad/keyboard navigation
+ 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 StartLockWheelingWindow(ImGuiWindow* window)
+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;
- g.WheelingWindowTimer = WINDOWS_MOUSE_WHEEL_SCROLL_LOCK_TIMER;
}
void ImGui::UpdateMouseWheel()
@@ -3758,31 +4362,30 @@ void ImGui::UpdateMouseWheel()
// Reset the locked window if we move the mouse or after the timer elapses
if (g.WheelingWindow != NULL)
{
- g.WheelingWindowTimer -= g.IO.DeltaTime;
+ g.WheelingWindowReleaseTimer -= g.IO.DeltaTime;
if (IsMousePosValid() && ImLengthSqr(g.IO.MousePos - g.WheelingWindowRefMousePos) > g.IO.MouseDragThreshold * g.IO.MouseDragThreshold)
- g.WheelingWindowTimer = 0.0f;
- if (g.WheelingWindowTimer <= 0.0f)
- {
- g.WheelingWindow = NULL;
- g.WheelingWindowTimer = 0.0f;
- }
+ g.WheelingWindowReleaseTimer = 0.0f;
+ if (g.WheelingWindowReleaseTimer <= 0.0f)
+ LockWheelingWindow(NULL, 0.0f);
}
- if (g.IO.MouseWheel == 0.0f && g.IO.MouseWheelH == 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;
- if ((g.ActiveId != 0 && g.ActiveIdUsingMouseWheel) || (g.HoveredIdPreviousFrame != 0 && g.HoveredIdPreviousFrameUsingMouseWheel))
- return;
-
- ImGuiWindow* window = g.WheelingWindow ? g.WheelingWindow : g.HoveredWindow;
- if (!window || window->Collapsed)
+ //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 (g.IO.MouseWheel != 0.0f && g.IO.KeyCtrl && g.IO.FontAllowUserScaling)
+ if (wheel.y != 0.0f && g.IO.KeyCtrl && g.IO.FontAllowUserScaling)
{
- StartLockWheelingWindow(window);
+ 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;
@@ -3795,85 +4398,54 @@ void ImGui::UpdateMouseWheel()
}
return;
}
-
- // Mouse wheel scrolling
- // If a child window has the ImGuiWindowFlags_NoScrollWithMouse flag, we give a chance to scroll its parent
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;
- const float wheel_y = swap_axis ? 0.0f : g.IO.MouseWheel;
- const float wheel_x = swap_axis ? g.IO.MouseWheel : g.IO.MouseWheelH;
+ if (swap_axis)
+ {
+ wheel.x = wheel.y;
+ wheel.y = 0.0f;
+ }
// Vertical Mouse Wheel scrolling
- if (wheel_y != 0.0f)
+ // 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)
{
- StartLockWheelingWindow(window);
+ 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);
+ 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)
+ if (wheel.x != 0.0f)
{
- StartLockWheelingWindow(window);
+ 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);
+ SetScrollX(window, window->Scroll.x - wheel.x * scroll_step);
}
}
}
-void ImGui::UpdateTabFocus()
-{
- ImGuiContext& g = *GImGui;
-
- // Pressing TAB activate widget focus
- g.TabFocusPressed = (g.NavWindow && g.NavWindow->Active && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs) && !g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab));
- if (g.ActiveId == 0 && g.TabFocusPressed)
- {
- // - This path is only taken when no widget are active/tabbed-into yet.
- // Subsequent tabbing will be processed by FocusableItemRegister()
- // - Note that SetKeyboardFocusHere() sets the Next fields mid-frame. To be consistent we also
- // manipulate the Next fields here even though they will be turned into Curr fields below.
- g.TabFocusRequestNextWindow = g.NavWindow;
- g.TabFocusRequestNextCounterRegular = INT_MAX;
- if (g.NavId != 0 && g.NavIdTabCounter != INT_MAX)
- g.TabFocusRequestNextCounterTabStop = g.NavIdTabCounter + (g.IO.KeyShift ? -1 : 0);
- else
- g.TabFocusRequestNextCounterTabStop = g.IO.KeyShift ? -1 : 0;
- }
-
- // Turn queued focus request into current one
- g.TabFocusRequestCurrWindow = NULL;
- g.TabFocusRequestCurrCounterRegular = g.TabFocusRequestCurrCounterTabStop = INT_MAX;
- if (g.TabFocusRequestNextWindow != NULL)
- {
- ImGuiWindow* window = g.TabFocusRequestNextWindow;
- g.TabFocusRequestCurrWindow = window;
- if (g.TabFocusRequestNextCounterRegular != INT_MAX && window->DC.FocusCounterRegular != -1)
- g.TabFocusRequestCurrCounterRegular = ImModPositive(g.TabFocusRequestNextCounterRegular, window->DC.FocusCounterRegular + 1);
- if (g.TabFocusRequestNextCounterTabStop != INT_MAX && window->DC.FocusCounterTabStop != -1)
- g.TabFocusRequestCurrCounterTabStop = ImModPositive(g.TabFocusRequestNextCounterTabStop, window->DC.FocusCounterTabStop + 1);
- g.TabFocusRequestNextWindow = NULL;
- g.TabFocusRequestNextCounterRegular = g.TabFocusRequestNextCounterTabStop = INT_MAX;
- }
-
- g.NavIdTabCounter = INT_MAX;
-}
-
// 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()
{
@@ -3890,7 +4462,7 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags()
// Modal windows prevents mouse from hovering behind them.
ImGuiWindow* modal_window = GetTopMostPopupModal();
- if (modal_window && g.HoveredWindow && !IsWindowChildOf(g.HoveredWindow->RootWindow, modal_window, true))
+ if (modal_window && g.HoveredWindow && !IsWindowWithinBeginStackOf(g.HoveredWindow->RootWindow, modal_window))
clear_hovered_windows = true;
// Disabled mouse?
@@ -3951,17 +4523,6 @@ void ImGui::UpdateHoveredWindowAndCaptureFlags()
io.WantTextInput = (g.WantTextInputNextFrame != -1) ? (g.WantTextInputNextFrame != 0) : false;
}
-ImGuiKeyModFlags ImGui::GetMergedKeyModFlags()
-{
- ImGuiContext& g = *GImGui;
- ImGuiKeyModFlags key_mod_flags = ImGuiKeyModFlags_None;
- if (g.IO.KeyCtrl) { key_mod_flags |= ImGuiKeyModFlags_Ctrl; }
- if (g.IO.KeyShift) { key_mod_flags |= ImGuiKeyModFlags_Shift; }
- if (g.IO.KeyAlt) { key_mod_flags |= ImGuiKeyModFlags_Alt; }
- if (g.IO.KeySuper) { key_mod_flags |= ImGuiKeyModFlags_Super; }
- return key_mod_flags;
-}
-
void ImGui::NewFrame()
{
IM_ASSERT(GImGui != NULL && "No current context. Did you call ImGui::CreateContext() and ImGui::SetCurrentContext() ?");
@@ -4038,15 +4599,20 @@ void ImGui::NewFrame()
if (g.HoveredId && g.ActiveId != g.HoveredId)
g.HoveredIdNotActiveTimer += g.IO.DeltaTime;
g.HoveredIdPreviousFrame = g.HoveredId;
- g.HoveredIdPreviousFrameUsingMouseWheel = g.HoveredIdUsingMouseWheel;
g.HoveredId = 0;
g.HoveredIdAllowOverlap = false;
- g.HoveredIdUsingMouseWheel = false;
g.HoveredIdDisabled = false;
- // Update ActiveId data (clear reference to active widget if the widget isn't alive anymore)
- if (g.ActiveIdIsAlive != g.ActiveId && g.ActiveIdPreviousFrame == g.ActiveId && g.ActiveId != 0)
+ // Clear ActiveID if the item is not alive anymore.
+ // In 1.87, the common most call to KeepAliveID() was moved from GetID() to ItemAdd().
+ // As a result, custom widget using ButtonBehavior() _without_ ItemAdd() need to call KeepAliveID() themselves.
+ if (g.ActiveId != 0 && g.ActiveIdIsAlive != g.ActiveId && g.ActiveIdPreviousFrame == g.ActiveId)
+ {
+ IMGUI_DEBUG_LOG_ACTIVEID("NewFrame(): ClearActiveID() because it isn't marked alive anymore!\n");
ClearActiveID();
+ }
+
+ // Update ActiveId data (clear reference to active widget if the widget isn't alive anymore)
if (g.ActiveId)
g.ActiveIdTimer += g.IO.DeltaTime;
g.LastActiveIdTimer += g.IO.DeltaTime;
@@ -4062,8 +4628,41 @@ void ImGui::NewFrame()
if (g.ActiveId == 0)
{
g.ActiveIdUsingNavDirMask = 0x00;
+ g.ActiveIdUsingAllKeyboardKeys = false;
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
g.ActiveIdUsingNavInputMask = 0x00;
- g.ActiveIdUsingKeyInputMask = 0x00;
+#endif
+ }
+
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
+ if (g.ActiveId == 0)
+ g.ActiveIdUsingNavInputMask = 0;
+ else if (g.ActiveIdUsingNavInputMask != 0)
+ {
+ // If your custom widget code used: { g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel); }
+ // Since IMGUI_VERSION_NUM >= 18804 it should be: { SetKeyOwner(ImGuiKey_Escape, g.ActiveId); SetKeyOwner(ImGuiKey_NavGamepadCancel, g.ActiveId); }
+ if (g.ActiveIdUsingNavInputMask & (1 << ImGuiNavInput_Cancel))
+ SetKeyOwner(ImGuiKey_Escape, g.ActiveId);
+ if (g.ActiveIdUsingNavInputMask & ~(1 << ImGuiNavInput_Cancel))
+ IM_ASSERT(0); // Other values unsupported
+ }
+#endif
+
+ // Update hover delay for IsItemHovered() with delays and tooltips
+ g.HoverDelayIdPreviousFrame = g.HoverDelayId;
+ if (g.HoverDelayId != 0)
+ {
+ //if (g.IO.MouseDelta.x == 0.0f && g.IO.MouseDelta.y == 0.0f) // Need design/flags
+ g.HoverDelayTimer += g.IO.DeltaTime;
+ g.HoverDelayClearTimer = 0.0f;
+ g.HoverDelayId = 0;
+ }
+ else if (g.HoverDelayTimer > 0.0f)
+ {
+ // This gives a little bit of leeway before clearing the hover timer, allowing mouse to cross gaps
+ g.HoverDelayClearTimer += g.IO.DeltaTime;
+ if (g.HoverDelayClearTimer >= ImMax(0.20f, g.IO.DeltaTime * 2.0f)) // ~6 frames at 30 Hz + allow for low framerate
+ g.HoverDelayTimer = g.HoverDelayClearTimer = 0.0f; // May want a decaying timer, in which case need to clamp at max first, based on max of caller last requested timer.
}
// Drag and drop
@@ -4078,20 +4677,17 @@ void ImGui::NewFrame()
//if (g.IO.AppFocusLost)
// ClosePopupsExceptModals();
- // Clear buttons state when focus is lost
- // (this is useful so e.g. releasing Alt after focus loss on Alt-Tab doesn't trigger the Alt menu toggle)
- if (g.IO.AppFocusLost)
- {
- g.IO.ClearInputKeys();
- g.IO.AppFocusLost = false;
- }
+ // Process input queue (trickle as many events as possible)
+ g.InputEventsTrail.resize(0);
+ UpdateInputEvents(g.IO.ConfigInputTrickleEventQueue);
// Update keyboard input state
- // Synchronize io.KeyMods with individual modifiers io.KeyXXX bools
- g.IO.KeyMods = GetMergedKeyModFlags();
- memcpy(g.IO.KeysDownDurationPrev, g.IO.KeysDownDuration, sizeof(g.IO.KeysDownDuration));
- for (int i = 0; i < IM_ARRAYSIZE(g.IO.KeysDown); i++)
- g.IO.KeysDownDuration[i] = g.IO.KeysDown[i] ? (g.IO.KeysDownDuration[i] < 0.0f ? 0.0f : g.IO.KeysDownDuration[i] + g.IO.DeltaTime) : -1.0f;
+ UpdateKeyboardInputs();
+
+ //IM_ASSERT(g.IO.KeyCtrl == IsKeyDown(ImGuiKey_LeftCtrl) || IsKeyDown(ImGuiKey_RightCtrl));
+ //IM_ASSERT(g.IO.KeyShift == IsKeyDown(ImGuiKey_LeftShift) || IsKeyDown(ImGuiKey_RightShift));
+ //IM_ASSERT(g.IO.KeyAlt == IsKeyDown(ImGuiKey_LeftAlt) || IsKeyDown(ImGuiKey_RightAlt));
+ //IM_ASSERT(g.IO.KeySuper == IsKeyDown(ImGuiKey_LeftSuper) || IsKeyDown(ImGuiKey_RightSuper));
// Update gamepad/keyboard navigation
NavUpdate();
@@ -4114,14 +4710,14 @@ void ImGui::NewFrame()
g.MouseCursor = ImGuiMouseCursor_Arrow;
g.WantCaptureMouseNextFrame = g.WantCaptureKeyboardNextFrame = g.WantTextInputNextFrame = -1;
- g.PlatformImePos = ImVec2(1.0f, 1.0f); // OS Input Method Editor showing on top-left of our window by default
+
+ // Platform IME data: reset for the frame
+ g.PlatformImeDataPrev = g.PlatformImeData;
+ g.PlatformImeData.WantVisible = false;
// Mouse wheel scrolling, scale
UpdateMouseWheel();
- // Update legacy TAB focus
- UpdateTabFocus();
-
// Mark all windows as not visible and compact unused memory.
IM_ASSERT(g.WindowsFocusOrder.Size <= g.Windows.Size);
const float memory_compact_start_time = (g.GcCompactAll || g.IO.ConfigMemoryCompactTimer < 0.0f) ? FLT_MAX : (float)g.Time - g.IO.ConfigMemoryCompactTimer;
@@ -4129,9 +4725,10 @@ void ImGui::NewFrame()
{
ImGuiWindow* window = g.Windows[i];
window->WasActive = window->Active;
- window->BeginCount = 0;
window->Active = false;
window->WriteAccessed = false;
+ window->BeginCountPreviousFrame = window->BeginCount;
+ window->BeginCount = 0;
// Garbage collect transient buffers of recently unused windows
if (!window->WasActive && !window->MemoryCompacted && window->LastTimeActive < memory_compact_start_time)
@@ -4142,9 +4739,9 @@ void ImGui::NewFrame()
for (int i = 0; i < g.TablesLastTimeActive.Size; i++)
if (g.TablesLastTimeActive[i] >= 0.0f && g.TablesLastTimeActive[i] < memory_compact_start_time)
TableGcCompactTransientBuffers(g.Tables.GetByIndex(i));
- for (int i = 0; i < g.TablesTempDataStack.Size; i++)
- if (g.TablesTempDataStack[i].LastTimeActive >= 0.0f && g.TablesTempDataStack[i].LastTimeActive < memory_compact_start_time)
- TableGcCompactTransientBuffers(&g.TablesTempDataStack[i]);
+ for (int i = 0; i < g.TablesTempData.Size; i++)
+ if (g.TablesTempData[i].LastTimeActive >= 0.0f && g.TablesTempData[i].LastTimeActive < memory_compact_start_time)
+ TableGcCompactTransientBuffers(&g.TablesTempData[i]);
if (g.GcCompactAll)
GcCompactTransientMiscBuffers();
g.GcCompactAll = false;
@@ -4161,12 +4758,15 @@ void ImGui::NewFrame()
g.ItemFlagsStack.push_back(ImGuiItemFlags_None);
g.GroupStack.resize(0);
- // [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack.
+ // [DEBUG] Update debug features
UpdateDebugToolItemPicker();
+ UpdateDebugToolStackQueries();
+ if (g.DebugLocateFrames > 0 && --g.DebugLocateFrames == 0)
+ g.DebugLocateId = 0;
// 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.
- // This fallback is particularly important as it avoid ImGui:: calls from crashing.
+ // This fallback is particularly important as it prevents ImGui:: calls from crashing.
g.WithinFrameScopeWithImplicitWindow = true;
SetNextWindowSize(ImVec2(400, 400), ImGuiCond_FirstUseEver);
Begin("Debug##Default");
@@ -4175,37 +4775,24 @@ void ImGui::NewFrame()
CallContextHooks(&g, ImGuiContextHookType_NewFramePost);
}
-// [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack.
-void ImGui::UpdateDebugToolItemPicker()
+// IMPORTANT: ###xxx suffixes must be same in ALL languages
+static const ImGuiLocEntry GLocalizationEntriesEnUS[] =
{
- ImGuiContext& g = *GImGui;
- g.DebugItemPickerBreakId = 0;
- if (g.DebugItemPickerActive)
- {
- const ImGuiID hovered_id = g.HoveredIdPreviousFrame;
- SetMouseCursor(ImGuiMouseCursor_Hand);
- if (IsKeyPressedMap(ImGuiKey_Escape))
- g.DebugItemPickerActive = false;
- if (IsMouseClicked(0) && hovered_id)
- {
- g.DebugItemPickerBreakId = hovered_id;
- g.DebugItemPickerActive = false;
- }
- SetNextWindowBgAlpha(0.60f);
- BeginTooltip();
- Text("HoveredId: 0x%08X", hovered_id);
- Text("Press ESC to abort picking.");
- TextColored(GetStyleColorVec4(hovered_id ? ImGuiCol_Text : ImGuiCol_TextDisabled), "Click to break in debugger!");
- EndTooltip();
- }
-}
+ { 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* context)
+void ImGui::Initialize()
{
- ImGuiContext& g = *context;
+ ImGuiContext& g = *GImGui;
IM_ASSERT(!g.Initialized && !g.SettingsLoaded);
- // Add .ini handle for ImGuiWindow type
+ // Add .ini handle for ImGuiWindow and ImGuiTable types
{
ImGuiSettingsHandler ini_handler;
ini_handler.TypeName = "Window";
@@ -4215,15 +4802,17 @@ void ImGui::Initialize(ImGuiContext* context)
ini_handler.ReadLineFn = WindowSettingsHandler_ReadLine;
ini_handler.ApplyAllFn = WindowSettingsHandler_ApplyAll;
ini_handler.WriteAllFn = WindowSettingsHandler_WriteAll;
- g.SettingsHandlers.push_back(ini_handler);
+ AddSettingsHandler(&ini_handler);
}
+ TableSettingsAddSettingsHandler();
- // Add .ini handle for ImGuiTable type
- TableSettingsInstallHandler(context);
+ // 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
@@ -4232,16 +4821,17 @@ void ImGui::Initialize(ImGuiContext* context)
}
// This function is merely here to free heap allocations.
-void ImGui::Shutdown(ImGuiContext* context)
+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 = *context;
+ 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)
@@ -4249,12 +4839,7 @@ void ImGui::Shutdown(ImGuiContext* context)
// 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)
- {
- ImGuiContext* backup_context = GImGui;
- SetCurrentContext(&g);
SaveIniSettingsToDisk(g.IO.IniFilename);
- SetCurrentContext(backup_context);
- }
CallContextHooks(&g, ImGuiContextHookType_Shutdown);
@@ -4269,6 +4854,9 @@ void ImGui::Shutdown(ImGuiContext* context)
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();
@@ -4281,8 +4869,10 @@ void ImGui::Shutdown(ImGuiContext* context)
g.CurrentTabBarStack.clear();
g.ShrinkWidthBuffer.clear();
+ g.ClipperTempData.clear_destruct();
+
g.Tables.Clear();
- g.TablesTempDataStack.clear_destruct();
+ g.TablesTempData.clear_destruct();
g.DrawChannelsTempMergeBuffer.clear();
g.ClipboardHandlerData.clear();
@@ -4301,6 +4891,8 @@ void ImGui::Shutdown(ImGuiContext* context)
g.LogFile = NULL;
}
g.LogBuffer.clear();
+ g.DebugLogBuf.clear();
+ g.DebugLogIndex.clear();
g.Initialized = false;
}
@@ -4323,8 +4915,7 @@ static void AddWindowToSortBuffer(ImVector<ImGuiWindow*>* out_sorted_windows, Im
if (window->Active)
{
int count = window->DC.ChildWindows.Size;
- if (count > 1)
- ImQsort(window->DC.ChildWindows.Data, (size_t)count, sizeof(ImGuiWindow*), ChildWindowComparer);
+ ImQsort(window->DC.ChildWindows.Data, (size_t)count, sizeof(ImGuiWindow*), ChildWindowComparer);
for (int i = 0; i < count; i++)
{
ImGuiWindow* child = window->DC.ChildWindows[i];
@@ -4336,11 +4927,10 @@ static void AddWindowToSortBuffer(ImVector<ImGuiWindow*>* out_sorted_windows, Im
static void AddDrawListToDrawData(ImVector<ImDrawList*>* out_list, ImDrawList* draw_list)
{
- // Remove trailing command if unused.
- // Technically we could return directly instead of popping, but this make things looks neat in Metrics/Debugger window as well.
- draw_list->_PopUnusedDrawCmd();
if (draw_list->CmdBuffer.Size == 0)
return;
+ if (draw_list->CmdBuffer.Size == 1 && draw_list->CmdBuffer[0].ElemCount == 0 && draw_list->CmdBuffer[0].UserCallback == NULL)
+ return;
// Draw list sanity check. Detect mismatch between PrimReserve() calls and incrementing _VtxCurrentIdx, _VtxWritePtr etc.
// May trigger for you if you are using PrimXXX functions incorrectly.
@@ -4384,11 +4974,15 @@ static void AddWindowToDrawData(ImGuiWindow* window, int layer)
}
}
+static inline int GetWindowDisplayLayer(ImGuiWindow* window)
+{
+ return (window->Flags & ImGuiWindowFlags_Tooltip) ? 1 : 0;
+}
+
// Layer is locked for the root window, however child windows may use a different viewport (e.g. extruding menu)
-static void AddRootWindowToDrawData(ImGuiWindow* window)
+static inline void AddRootWindowToDrawData(ImGuiWindow* window)
{
- int layer = (window->Flags & ImGuiWindowFlags_Tooltip) ? 1 : 0;
- AddWindowToDrawData(window, layer);
+ AddWindowToDrawData(window, GetWindowDisplayLayer(window));
}
void ImDrawDataBuilder::FlattenIntoSingleLayer()
@@ -4422,8 +5016,10 @@ static void SetupViewportDrawData(ImGuiViewportP* viewport, ImVector<ImDrawList*
draw_data->FramebufferScale = io.DisplayFramebufferScale;
for (int n = 0; n < draw_lists->Size; n++)
{
- draw_data->TotalVtxCount += draw_lists->Data[n]->VtxBuffer.Size;
- draw_data->TotalIdxCount += draw_lists->Data[n]->IdxBuffer.Size;
+ ImDrawList* draw_list = draw_lists->Data[n];
+ draw_list->_PopUnusedDrawCmd();
+ draw_data->TotalVtxCount += draw_list->VtxBuffer.Size;
+ draw_data->TotalIdxCount += draw_list->IdxBuffer.Size;
}
}
@@ -4447,6 +5043,88 @@ void ImGui::PopClipRect()
window->ClipRect = window->DrawList->_ClipRectStack.back();
}
+static void ImGui::RenderDimmedBackgroundBehindWindow(ImGuiWindow* window, ImU32 col)
+{
+ if ((col & IM_COL32_A_MASK) == 0)
+ return;
+
+ ImGuiViewportP* viewport = (ImGuiViewportP*)GetMainViewport();
+ ImRect viewport_rect = viewport->GetMainRect();
+
+ // Draw behind window by moving the draw command at the FRONT of the draw list
+ {
+ // We've already called AddWindowToDrawData() which called DrawList->ChannelsMerge() on DockNodeHost windows,
+ // and draw list have been trimmed already, hence the explicit recreation of a draw command if missing.
+ // FIXME: This is creating complication, might be simpler if we could inject a drawlist in drawdata at a given position and not attempt to manipulate ImDrawCmd order.
+ ImDrawList* draw_list = window->RootWindow->DrawList;
+ if (draw_list->CmdBuffer.Size == 0)
+ draw_list->AddDrawCmd();
+ draw_list->PushClipRect(viewport_rect.Min - ImVec2(1, 1), viewport_rect.Max + ImVec2(1, 1), false); // Ensure ImDrawCmd are not merged
+ draw_list->AddRectFilled(viewport_rect.Min, viewport_rect.Max, col);
+ ImDrawCmd cmd = draw_list->CmdBuffer.back();
+ IM_ASSERT(cmd.ElemCount == 6);
+ draw_list->CmdBuffer.pop_back();
+ draw_list->CmdBuffer.push_front(cmd);
+ draw_list->PopClipRect();
+ draw_list->AddDrawCmd(); // We need to create a command as CmdBuffer.back().IdxOffset won't be correct if we append to same command.
+ }
+}
+
+ImGuiWindow* ImGui::FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* parent_window)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* bottom_most_visible_window = parent_window;
+ for (int i = FindWindowDisplayIndex(parent_window); i >= 0; i--)
+ {
+ ImGuiWindow* window = g.Windows[i];
+ if (window->Flags & ImGuiWindowFlags_ChildWindow)
+ continue;
+ if (!IsWindowWithinBeginStackOf(window, parent_window))
+ break;
+ if (IsWindowActiveAndVisible(window) && GetWindowDisplayLayer(window) <= GetWindowDisplayLayer(parent_window))
+ bottom_most_visible_window = window;
+ }
+ return bottom_most_visible_window;
+}
+
+static void ImGui::RenderDimmedBackgrounds()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* modal_window = GetTopMostAndVisiblePopupModal();
+ if (g.DimBgRatio <= 0.0f && g.NavWindowingHighlightAlpha <= 0.0f)
+ return;
+ const bool dim_bg_for_modal = (modal_window != NULL);
+ const bool dim_bg_for_window_list = (g.NavWindowingTargetAnim != NULL && g.NavWindowingTargetAnim->Active);
+ if (!dim_bg_for_modal && !dim_bg_for_window_list)
+ return;
+
+ if (dim_bg_for_modal)
+ {
+ // Draw dimming behind modal or a begin stack child, whichever comes first in draw order.
+ ImGuiWindow* dim_behind_window = FindBottomMostVisibleWindowWithinBeginStack(modal_window);
+ RenderDimmedBackgroundBehindWindow(dim_behind_window, GetColorU32(ImGuiCol_ModalWindowDimBg, g.DimBgRatio));
+ }
+ else if (dim_bg_for_window_list)
+ {
+ // Draw dimming behind CTRL+Tab target window
+ RenderDimmedBackgroundBehindWindow(g.NavWindowingTargetAnim, GetColorU32(ImGuiCol_NavWindowingDimBg, g.DimBgRatio));
+
+ // Draw border around CTRL+Tab target window
+ ImGuiWindow* window = g.NavWindowingTargetAnim;
+ ImGuiViewport* viewport = GetMainViewport();
+ float distance = g.FontSize;
+ ImRect bb = window->Rect();
+ bb.Expand(distance);
+ if (bb.GetWidth() >= viewport->Size.x && bb.GetHeight() >= viewport->Size.y)
+ bb.Expand(-distance - 1.0f); // If a window fits the entire viewport, adjust its highlight inward
+ if (window->DrawList->CmdBuffer.Size == 0)
+ window->DrawList->AddDrawCmd();
+ window->DrawList->PushClipRect(viewport->Pos, viewport->Pos + viewport->Size);
+ window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha), window->WindowRounding, 0, 3.0f);
+ window->DrawList->PopClipRect();
+ }
+}
+
// This is normally called by Render(). You may want to call it directly if you want to avoid calling Render() but the gain will be very minimal.
void ImGui::EndFrame()
{
@@ -4462,12 +5140,9 @@ void ImGui::EndFrame()
ErrorCheckEndFrameSanityChecks();
- // Notify OS when our Input Method Editor cursor has moved (e.g. CJK inputs using Microsoft IME)
- if (g.IO.ImeSetInputScreenPosFn && (g.PlatformImeLastPos.x == FLT_MAX || ImLengthSqr(g.PlatformImeLastPos - g.PlatformImePos) > 0.0001f))
- {
- g.IO.ImeSetInputScreenPosFn((int)g.PlatformImePos.x, (int)g.PlatformImePos.y);
- g.PlatformImeLastPos = g.PlatformImePos;
- }
+ // 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);
// Hide implicit/fallback "Debug" window if it hasn't been used
g.WithinFrameScopeWithImplicitWindow = false;
@@ -4523,10 +5198,9 @@ void ImGui::EndFrame()
g.IO.Fonts->Locked = false;
// Clear Input data for next frame
+ g.IO.AppFocusLost = false;
g.IO.MouseWheel = g.IO.MouseWheelH = 0.0f;
g.IO.InputQueueCharacters.resize(0);
- g.IO.KeyModsPrev = g.IO.KeyMods; // doing it here is better than in NewFrame() as we'll tolerate backend writing to KeyMods. If we want to firmly disallow it we should detect it.
- memset(g.IO.NavInputs, 0, sizeof(g.IO.NavInputs));
CallContextHooks(&g, ImGuiContextHookType_EndFramePost);
}
@@ -4541,6 +5215,7 @@ void ImGui::Render()
if (g.FrameCountEnded != g.FrameCount)
EndFrame();
+ const bool first_render_of_frame = (g.FrameCountRendered != g.FrameCount);
g.FrameCountRendered = g.FrameCount;
g.IO.MetricsRenderWindows = 0;
@@ -4555,6 +5230,10 @@ void ImGui::Render()
AddDrawListToDrawData(&viewport->DrawDataBuilder.Layers[0], GetBackgroundDrawList(viewport));
}
+ // Draw modal/window whitening backgrounds
+ if (first_render_of_frame)
+ RenderDimmedBackgrounds();
+
// Add ImDrawList to render
ImGuiWindow* windows_to_render_top_most[2];
windows_to_render_top_most[0] = (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoBringToFrontOnFocus)) ? g.NavWindowingTarget->RootWindow : NULL;
@@ -4570,6 +5249,10 @@ void ImGui::Render()
if (windows_to_render_top_most[n] && IsWindowActiveAndVisible(windows_to_render_top_most[n])) // NavWindowingTarget is always temporarily displayed as the top-most window
AddRootWindowToDrawData(windows_to_render_top_most[n]);
+ // Draw software mouse cursor if requested by io.MouseDrawCursor flag
+ if (g.IO.MouseDrawCursor && first_render_of_frame && g.MouseCursor != ImGuiMouseCursor_None)
+ RenderMouseCursor(g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor, IM_COL32_WHITE, IM_COL32_BLACK, IM_COL32(0, 0, 0, 48));
+
// Setup ImDrawData structures for end-user
g.IO.MetricsRenderVertices = g.IO.MetricsRenderIndices = 0;
for (int n = 0; n < g.Viewports.Size; n++)
@@ -4577,10 +5260,6 @@ void ImGui::Render()
ImGuiViewportP* viewport = g.Viewports[n];
viewport->DrawDataBuilder.FlattenIntoSingleLayer();
- // Draw software mouse cursor if requested by io.MouseDrawCursor flag
- if (g.IO.MouseDrawCursor)
- RenderMouseCursor(GetForegroundDrawList(viewport), g.IO.MousePos, g.Style.MouseCursorScale, g.MouseCursor, IM_COL32_WHITE, IM_COL32_BLACK, IM_COL32(0, 0, 0, 48));
-
// Add foreground ImDrawList (for each active viewport)
if (viewport->DrawLists[1] != NULL)
AddDrawListToDrawData(&viewport->DrawDataBuilder.Layers[0], GetForegroundDrawList(viewport));
@@ -4678,231 +5357,6 @@ static void FindHoveredWindow()
g.HoveredWindowUnderMovingWindow = hovered_window_ignoring_moving_window;
}
-// 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;
-}
-
-int ImGui::GetKeyIndex(ImGuiKey imgui_key)
-{
- IM_ASSERT(imgui_key >= 0 && imgui_key < ImGuiKey_COUNT);
- ImGuiContext& g = *GImGui;
- return g.IO.KeyMap[imgui_key];
-}
-
-// Note that dear imgui doesn't know the semantic of each entry of io.KeysDown[]!
-// Use your own indices/enums according to how your backend/engine stored them into io.KeysDown[]!
-bool ImGui::IsKeyDown(int user_key_index)
-{
- if (user_key_index < 0)
- return false;
- ImGuiContext& g = *GImGui;
- IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown));
- return g.IO.KeysDown[user_key_index];
-}
-
-// t0 = previous time (e.g.: g.Time - g.IO.DeltaTime)
-// t1 = current time (e.g.: g.Time)
-// An event is triggered at:
-// t = 0.0f t = repeat_delay, t = repeat_delay + repeat_rate*N
-int ImGui::CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate)
-{
- if (t1 == 0.0f)
- return 1;
- if (t0 >= t1)
- return 0;
- if (repeat_rate <= 0.0f)
- return (t0 < repeat_delay) && (t1 >= repeat_delay);
- const int count_t0 = (t0 < repeat_delay) ? -1 : (int)((t0 - repeat_delay) / repeat_rate);
- const int count_t1 = (t1 < repeat_delay) ? -1 : (int)((t1 - repeat_delay) / repeat_rate);
- const int count = count_t1 - count_t0;
- return count;
-}
-
-int ImGui::GetKeyPressedAmount(int key_index, float repeat_delay, float repeat_rate)
-{
- ImGuiContext& g = *GImGui;
- if (key_index < 0)
- return 0;
- IM_ASSERT(key_index >= 0 && key_index < IM_ARRAYSIZE(g.IO.KeysDown));
- const float t = g.IO.KeysDownDuration[key_index];
- return CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, repeat_delay, repeat_rate);
-}
-
-bool ImGui::IsKeyPressed(int user_key_index, bool repeat)
-{
- ImGuiContext& g = *GImGui;
- if (user_key_index < 0)
- return false;
- IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown));
- const float t = g.IO.KeysDownDuration[user_key_index];
- if (t == 0.0f)
- return true;
- if (repeat && t > g.IO.KeyRepeatDelay)
- return GetKeyPressedAmount(user_key_index, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate) > 0;
- return false;
-}
-
-bool ImGui::IsKeyReleased(int user_key_index)
-{
- ImGuiContext& g = *GImGui;
- if (user_key_index < 0) return false;
- IM_ASSERT(user_key_index >= 0 && user_key_index < IM_ARRAYSIZE(g.IO.KeysDown));
- return g.IO.KeysDownDurationPrev[user_key_index] >= 0.0f && !g.IO.KeysDown[user_key_index];
-}
-
-bool ImGui::IsMouseDown(ImGuiMouseButton button)
-{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
- return g.IO.MouseDown[button];
-}
-
-bool ImGui::IsMouseClicked(ImGuiMouseButton button, bool repeat)
-{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
- const float t = g.IO.MouseDownDuration[button];
- if (t == 0.0f)
- return true;
-
- if (repeat && t > g.IO.KeyRepeatDelay)
- {
- // FIXME: 2019/05/03: Our old repeat code was wrong here and led to doubling the repeat rate, which made it an ok rate for repeat on mouse hold.
- int amount = CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate * 0.50f);
- if (amount > 0)
- return true;
- }
- return false;
-}
-
-bool ImGui::IsMouseReleased(ImGuiMouseButton button)
-{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
- return g.IO.MouseReleased[button];
-}
-
-bool ImGui::IsMouseDoubleClicked(ImGuiMouseButton button)
-{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
- return g.IO.MouseDoubleClicked[button];
-}
-
-// 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)
-{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
- if (lock_threshold < 0.0f)
- lock_threshold = g.IO.MouseDragThreshold;
- return g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold;
-}
-
-bool ImGui::IsMouseDragging(ImGuiMouseButton button, float lock_threshold)
-{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
- if (!g.IO.MouseDown[button])
- return false;
- return IsMouseDragPastThreshold(button, lock_threshold);
-}
-
-ImVec2 ImGui::GetMousePos()
-{
- ImGuiContext& g = *GImGui;
- return g.IO.MousePos;
-}
-
-// NB: prefer to call right after BeginPopup(). At the time Selectable/MenuItem is activated, the popup is already closed!
-ImVec2 ImGui::GetMousePosOnOpeningCurrentPopup()
-{
- ImGuiContext& g = *GImGui;
- if (g.BeginPopupStack.Size > 0)
- return g.OpenPopupStack[g.BeginPopupStack.Size - 1].OpenMousePos;
- return g.IO.MousePos;
-}
-
-// We typically use ImVec2(-FLT_MAX,-FLT_MAX) to denote an invalid mouse position.
-bool ImGui::IsMousePosValid(const ImVec2* mouse_pos)
-{
- // The assert is only to silence a false-positive in XCode Static Analysis.
- // Because GImGui is not dereferenced in every code path, the static analyzer assume that it may be NULL (which it doesn't for other functions).
- IM_ASSERT(GImGui != NULL);
- const float MOUSE_INVALID = -256000.0f;
- ImVec2 p = mouse_pos ? *mouse_pos : GImGui->IO.MousePos;
- return p.x >= MOUSE_INVALID && p.y >= MOUSE_INVALID;
-}
-
-bool ImGui::IsAnyMouseDown()
-{
- ImGuiContext& g = *GImGui;
- for (int n = 0; n < IM_ARRAYSIZE(g.IO.MouseDown); n++)
- if (g.IO.MouseDown[n])
- return true;
- return false;
-}
-
-// Return the delta from the initial clicking position while the mouse button is clicked or was just released.
-// This is locked and return 0.0f until the mouse moves past a distance threshold at least once.
-// NB: This is only valid if IsMousePosValid(). backends in theory should always keep mouse position valid when dragging even outside the client window.
-ImVec2 ImGui::GetMouseDragDelta(ImGuiMouseButton button, float lock_threshold)
-{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
- if (lock_threshold < 0.0f)
- lock_threshold = g.IO.MouseDragThreshold;
- if (g.IO.MouseDown[button] || g.IO.MouseReleased[button])
- if (g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold)
- if (IsMousePosValid(&g.IO.MousePos) && IsMousePosValid(&g.IO.MouseClickedPos[button]))
- return g.IO.MousePos - g.IO.MouseClickedPos[button];
- return ImVec2(0.0f, 0.0f);
-}
-
-void ImGui::ResetMouseDragDelta(ImGuiMouseButton button)
-{
- ImGuiContext& g = *GImGui;
- IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
- // NB: We don't need to reset g.IO.MouseDragMaxDistanceSqr
- g.IO.MouseClickedPos[button] = g.IO.MousePos;
-}
-
-ImGuiMouseCursor ImGui::GetMouseCursor()
-{
- return GImGui->MouseCursor;
-}
-
-void ImGui::SetMouseCursor(ImGuiMouseCursor cursor_type)
-{
- GImGui->MouseCursor = cursor_type;
-}
-
-void ImGui::CaptureKeyboardFromApp(bool capture)
-{
- GImGui->WantCaptureKeyboardNextFrame = capture ? 1 : 0;
-}
-
-void ImGui::CaptureMouseFromApp(bool capture)
-{
- GImGui->WantCaptureMouseNextFrame = capture ? 1 : 0;
-}
-
bool ImGui::IsItemActive()
{
ImGuiContext& g = *GImGui;
@@ -4983,7 +5437,7 @@ bool ImGui::IsAnyItemFocused()
bool ImGui::IsItemVisible()
{
ImGuiContext& g = *GImGui;
- return g.CurrentWindow->ClipRect.Overlaps(g.LastItemData.Rect);
+ return (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Visible) != 0;
}
bool ImGui::IsItemEdited()
@@ -5004,23 +5458,13 @@ void ImGui::SetItemAllowOverlap()
g.ActiveIdAllowOverlap = true;
}
-void ImGui::SetItemUsingMouseWheel()
-{
- ImGuiContext& g = *GImGui;
- ImGuiID id = g.LastItemData.ID;
- if (g.HoveredId == id)
- g.HoveredIdUsingMouseWheel = true;
- if (g.ActiveId == id)
- g.ActiveIdUsingMouseWheel = true;
-}
-
-void ImGui::SetActiveIdUsingNavAndKeys()
+// FIXME: It might be undesirable that this will likely disable KeyOwner-aware shortcuts systems. Consider a more fine-tuned version for the two users of this function.
+void ImGui::SetActiveIdUsingAllKeyboardKeys()
{
ImGuiContext& g = *GImGui;
IM_ASSERT(g.ActiveId != 0);
- g.ActiveIdUsingNavDirMask = ~(ImU32)0;
- g.ActiveIdUsingNavInputMask = ~(ImU32)0;
- g.ActiveIdUsingKeyInputMask = ~(ImU64)0;
+ g.ActiveIdUsingNavDirMask = (1 << ImGuiDir_COUNT) - 1;
+ g.ActiveIdUsingAllKeyboardKeys = true;
NavMoveRequestCancel();
}
@@ -5055,21 +5499,22 @@ bool ImGui::BeginChildEx(const char* name, ImGuiID id, const ImVec2& size_arg, b
ImVec2 size = ImFloor(size_arg);
const int auto_fit_axises = ((size.x == 0.0f) ? (1 << ImGuiAxis_X) : 0x00) | ((size.y == 0.0f) ? (1 << ImGuiAxis_Y) : 0x00);
if (size.x <= 0.0f)
- size.x = ImMax(content_avail.x + size.x, 4.0f); // Arbitrary minimum child size (0.0f causing too much issues)
+ size.x = ImMax(content_avail.x + size.x, 4.0f); // Arbitrary minimum child size (0.0f causing too many issues)
if (size.y <= 0.0f)
size.y = ImMax(content_avail.y + size.y, 4.0f);
SetNextWindowSize(size);
// Build up name. If you need to append to a same child from multiple location in the ID stack, use BeginChild(ImGuiID id) with a stable value.
+ const char* temp_window_name;
if (name)
- ImFormatString(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), "%s/%s_%08X", parent_window->Name, name, id);
+ ImFormatStringToTempBuffer(&temp_window_name, NULL, "%s/%s_%08X", parent_window->Name, name, id);
else
- ImFormatString(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), "%s/%08X", parent_window->Name, id);
+ ImFormatStringToTempBuffer(&temp_window_name, NULL, "%s/%08X", parent_window->Name, id);
const float backup_border_size = g.Style.ChildBorderSize;
if (!border)
g.Style.ChildBorderSize = 0.0f;
- bool ret = Begin(g.TempBuffer, NULL, flags);
+ bool ret = Begin(temp_window_name, NULL, flags);
g.Style.ChildBorderSize = backup_border_size;
ImGuiWindow* child_window = g.CurrentWindow;
@@ -5197,6 +5642,29 @@ static void ApplyWindowSettings(ImGuiWindow* window, ImGuiWindowSettings* settin
window->Collapsed = settings->Collapsed;
}
+static void UpdateWindowInFocusOrderList(ImGuiWindow* window, bool just_created, ImGuiWindowFlags new_flags)
+{
+ ImGuiContext& g = *GImGui;
+
+ const bool new_is_explicit_child = (new_flags & ImGuiWindowFlags_ChildWindow) != 0 && ((new_flags & ImGuiWindowFlags_Popup) == 0 || (new_flags & ImGuiWindowFlags_ChildMenu) != 0);
+ const bool child_flag_changed = new_is_explicit_child != window->IsExplicitChild;
+ if ((just_created || child_flag_changed) && !new_is_explicit_child)
+ {
+ IM_ASSERT(!g.WindowsFocusOrder.contains(window));
+ g.WindowsFocusOrder.push_back(window);
+ window->FocusOrder = (short)(g.WindowsFocusOrder.Size - 1);
+ }
+ else if (!just_created && child_flag_changed && new_is_explicit_child)
+ {
+ IM_ASSERT(g.WindowsFocusOrder[window->FocusOrder] == window);
+ for (int n = window->FocusOrder + 1; n < g.WindowsFocusOrder.Size; n++)
+ g.WindowsFocusOrder[n]->FocusOrder--;
+ g.WindowsFocusOrder.erase(g.WindowsFocusOrder.Data + window->FocusOrder);
+ window->FocusOrder = -1;
+ }
+ window->IsExplicitChild = new_is_explicit_child;
+}
+
static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags)
{
ImGuiContext& g = *GImGui;
@@ -5220,7 +5688,7 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags)
SetWindowConditionAllowFlags(window, ImGuiCond_FirstUseEver, false);
ApplyWindowSettings(window, settings);
}
- window->DC.CursorStartPos = window->DC.CursorMaxPos = window->Pos; // So first call to CalcContentSize() doesn't return crazy values
+ 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)
{
@@ -5236,16 +5704,11 @@ static ImGuiWindow* CreateNewWindow(const char* name, ImGuiWindowFlags flags)
window->AutoFitOnlyGrows = (window->AutoFitFramesX > 0) || (window->AutoFitFramesY > 0);
}
- if (!(flags & ImGuiWindowFlags_ChildWindow))
- {
- g.WindowsFocusOrder.push_back(window);
- window->FocusOrder = (short)(g.WindowsFocusOrder.Size - 1);
- }
-
if (flags & ImGuiWindowFlags_NoBringToFrontOnFocus)
g.Windows.push_front(window); // Quite slow but rare and only once
else
g.Windows.push_back(window);
+
return window;
}
@@ -5325,8 +5788,7 @@ static ImVec2 CalcWindowAutoFitSize(ImGuiWindow* window, const ImVec2& size_cont
if (is_popup || is_menu) // Popups and menus bypass style.WindowMinSize by default, but we give then a non-zero minimum size to facilitate understanding problematic cases (e.g. empty popups)
size_min = ImMin(size_min, ImVec2(4.0f, 4.0f));
- // FIXME-VIEWPORT-WORKAREA: May want to use GetWorkSize() instead of Size depending on the type of windows?
- ImVec2 avail_size = ImGui::GetMainViewport()->Size;
+ ImVec2 avail_size = ImGui::GetMainViewport()->WorkSize;
ImVec2 size_auto_fit = ImClamp(size_desired, size_min, ImMax(size_min, avail_size - style.DisplaySafeAreaPadding * 2.0f));
// When the window cannot fit all contents (either because of constraints, either because screen is too small),
@@ -5352,11 +5814,11 @@ ImVec2 ImGui::CalcWindowNextAutoFitSize(ImGuiWindow* window)
return size_final;
}
-static ImGuiCol GetWindowBgColorIdxFromFlags(ImGuiWindowFlags flags)
+static ImGuiCol GetWindowBgColorIdx(ImGuiWindow* window)
{
- if (flags & (ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_Popup))
+ if (window->Flags & (ImGuiWindowFlags_Tooltip | ImGuiWindowFlags_Popup))
return ImGuiCol_PopupBg;
- if (flags & ImGuiWindowFlags_ChildWindow)
+ if (window->Flags & ImGuiWindowFlags_ChildWindow)
return ImGuiCol_ChildBg;
return ImGuiCol_WindowBg;
}
@@ -5440,7 +5902,7 @@ ImGuiID ImGui::GetWindowResizeBorderID(ImGuiWindow* window, ImGuiDir dir)
}
// Handle resize for: Resize Grips, Borders, Gamepad
-// Return true when using auto-fit (double click on resize grip)
+// Return true when using auto-fit (double-click on resize grip)
static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& size_auto_fit, int* border_held, int resize_grip_count, ImU32 resize_grip_col[4], const ImRect& visibility_rect)
{
ImGuiContext& g = *GImGui;
@@ -5448,7 +5910,7 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
if ((flags & ImGuiWindowFlags_NoResize) || (flags & ImGuiWindowFlags_AlwaysAutoResize) || window->AutoFitFramesX > 0 || window->AutoFitFramesY > 0)
return false;
- if (window->WasActive == false) // Early out to avoid running this code for e.g. an hidden implicit/fallback Debug window.
+ if (window->WasActive == false) // Early out to avoid running this code for e.g. a hidden implicit/fallback Debug window.
return false;
bool ret_auto_fit = false;
@@ -5476,12 +5938,13 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
if (resize_rect.Min.x > resize_rect.Max.x) ImSwap(resize_rect.Min.x, resize_rect.Max.x);
if (resize_rect.Min.y > resize_rect.Max.y) ImSwap(resize_rect.Min.y, resize_rect.Max.y);
ImGuiID resize_grip_id = window->GetID(resize_grip_n); // == GetWindowResizeCornerID()
+ ItemAdd(resize_rect, resize_grip_id, NULL, ImGuiItemFlags_NoNav);
ButtonBehavior(resize_rect, resize_grip_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus);
//GetForegroundDrawList(window)->AddRect(resize_rect.Min, resize_rect.Max, IM_COL32(255, 255, 0, 255));
if (hovered || held)
g.MouseCursor = (resize_grip_n & 1) ? ImGuiMouseCursor_ResizeNESW : ImGuiMouseCursor_ResizeNWSE;
- if (held && g.IO.MouseDoubleClicked[0] && resize_grip_n == 0)
+ if (held && g.IO.MouseClickedCount[0] == 2 && resize_grip_n == 0)
{
// Manual auto-fit when double-clicking
size_target = CalcWindowSizeAfterConstraint(window, size_auto_fit);
@@ -5511,7 +5974,8 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
bool hovered, held;
ImRect border_rect = GetResizeBorderRect(window, border_n, grip_hover_inner_size, WINDOWS_HOVER_PADDING);
ImGuiID border_id = window->GetID(border_n + 4); // == GetWindowResizeBorderID()
- ButtonBehavior(border_rect, border_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren);
+ ItemAdd(border_rect, border_id, NULL, ImGuiItemFlags_NoNav);
+ ButtonBehavior(border_rect, border_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_NoNavFocus);
//GetForegroundDrawLists(window)->AddRect(border_rect.Min, border_rect.Max, IM_COL32(255, 255, 0, 255));
if ((hovered && g.HoveredIdTimer > WINDOWS_RESIZE_FROM_EDGES_FEEDBACK_TIMER) || held)
{
@@ -5535,23 +5999,31 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
window->DC.NavLayerCurrent = ImGuiNavLayer_Main;
// Navigation resize (keyboard/gamepad)
+ // FIXME: This cannot be moved to NavUpdateWindowing() because CalcWindowSizeAfterConstraint() need to callback into user.
+ // Not even sure the callback works here.
if (g.NavWindowingTarget && g.NavWindowingTarget->RootWindow == window)
{
- ImVec2 nav_resize_delta;
+ ImVec2 nav_resize_dir;
if (g.NavInputSource == ImGuiInputSource_Keyboard && g.IO.KeyShift)
- nav_resize_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard, ImGuiInputReadMode_Down);
+ nav_resize_dir = GetKeyVector2d(ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow);
if (g.NavInputSource == ImGuiInputSource_Gamepad)
- nav_resize_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_PadDPad, ImGuiInputReadMode_Down);
- if (nav_resize_delta.x != 0.0f || nav_resize_delta.y != 0.0f)
+ nav_resize_dir = GetKeyVector2d(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;
- nav_resize_delta *= ImFloor(NAV_RESIZE_SPEED * g.IO.DeltaTime * ImMin(g.IO.DisplayFramebufferScale.x, g.IO.DisplayFramebufferScale.y));
- nav_resize_delta = ImMax(nav_resize_delta, visibility_rect.Min - window->Pos - window->Size);
+ const float resize_step = NAV_RESIZE_SPEED * g.IO.DeltaTime * ImMin(g.IO.DisplayFramebufferScale.x, g.IO.DisplayFramebufferScale.y);
+ g.NavWindowingAccumDeltaSize += nav_resize_dir * resize_step;
+ g.NavWindowingAccumDeltaSize = ImMax(g.NavWindowingAccumDeltaSize, visibility_rect.Min - window->Pos - window->Size); // We need Pos+Size >= visibility_rect.Min, so Size >= visibility_rect.Min - Pos, so size_delta >= visibility_rect.Min - window->Pos - window->Size
g.NavWindowingToggleLayer = false;
g.NavDisableMouseHover = true;
resize_grip_col[0] = GetColorU32(ImGuiCol_ResizeGripActive);
- // FIXME-NAV: Should store and accumulate into a separate size buffer to handle sizing constraints properly, right now a constraint will make us stuck.
- size_target = CalcWindowSizeAfterConstraint(window, window->SizeFull + nav_resize_delta);
+ ImVec2 accum_floored = ImFloor(g.NavWindowingAccumDeltaSize);
+ if (accum_floored.x != 0.0f || accum_floored.y != 0.0f)
+ {
+ // FIXME-NAV: Should store and accumulate into a separate size buffer to handle sizing constraints properly, right now a constraint will make us stuck.
+ size_target = CalcWindowSizeAfterConstraint(window, window->SizeFull + accum_floored);
+ g.NavWindowingAccumDeltaSize -= accum_floored;
+ }
}
}
@@ -5571,7 +6043,7 @@ static bool ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& s
return ret_auto_fit;
}
-static inline void ClampWindowRect(ImGuiWindow* window, const ImRect& visibility_rect)
+static inline void ClampWindowPos(ImGuiWindow* window, const ImRect& visibility_rect)
{
ImGuiContext& g = *GImGui;
ImVec2 size_for_clamping = window->Size;
@@ -5617,7 +6089,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
window->SkipItems = false;
// Draw window + handle manual resize
- // As we highlight the title bar when want_focus is set, multiple reappearing windows will have have their title bar highlighted on their reappearing frame.
+ // As we highlight the title bar when want_focus is set, multiple reappearing windows will have their title bar highlighted on their reappearing frame.
const float window_rounding = window->WindowRounding;
const float window_border_size = window->WindowBorderSize;
if (window->Collapsed)
@@ -5634,7 +6106,7 @@ void ImGui::RenderWindowDecorations(ImGuiWindow* window, const ImRect& title_bar
// Window background
if (!(flags & ImGuiWindowFlags_NoBackground))
{
- ImU32 bg_col = GetColorU32(GetWindowBgColorIdxFromFlags(flags));
+ ImU32 bg_col = GetColorU32(GetWindowBgColorIdx(window));
bool override_alpha = false;
float alpha = 1.0f;
if (g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasBgAlpha)
@@ -5700,6 +6172,7 @@ void ImGui::RenderWindowTitleBarContents(ImGuiWindow* window, const ImRect& titl
const bool has_collapse_button = !(flags & ImGuiWindowFlags_NoCollapse) && (style.WindowMenuButtonPosition != ImGuiDir_None);
// Close & Collapse button are on the Menu NavLayer and don't default focus (unless there's nothing else on that layer)
+ // FIXME-NAV: Might want (or not?) to set the equivalent of ImGuiButtonFlags_NoNavFocus so that mouse clicks on standard title bar items don't necessarily set nav/keyboard ref?
const ImGuiItemFlags item_flags_backup = g.CurrentItemFlags;
g.CurrentItemFlags |= ImGuiItemFlags_NoNavDefaultFocus;
window->DC.NavLayerCurrent = ImGuiNavLayer_Menu;
@@ -5794,6 +6267,38 @@ void ImGui::UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags
}
}
+// When a modal popup is open, newly created windows that want focus (i.e. are not popups and do not specify ImGuiWindowFlags_NoFocusOnAppearing)
+// should be positioned behind that modal window, unless the window was created inside the modal begin-stack.
+// In case of multiple stacked modals newly created window honors begin stack order and does not go below its own modal parent.
+// - Window // FindBlockingModal() returns Modal1
+// - Window // .. returns Modal1
+// - Modal1 // .. returns Modal2
+// - Window // .. returns Modal2
+// - Window // .. returns Modal2
+// - Modal2 // .. returns Modal2
+static ImGuiWindow* ImGui::FindBlockingModal(ImGuiWindow* window)
+{
+ ImGuiContext& g = *GImGui;
+ if (g.OpenPopupStack.Size <= 0)
+ return NULL;
+
+ // Find a modal that has common parent with specified window. Specified window should be positioned behind that modal.
+ for (int i = g.OpenPopupStack.Size - 1; i >= 0; i--)
+ {
+ ImGuiWindow* popup_window = g.OpenPopupStack.Data[i].Window;
+ if (popup_window == NULL || !(popup_window->Flags & ImGuiWindowFlags_Modal))
+ 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 (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)
+ if (IsWindowWithinBeginStackOf(window, parent))
+ return popup_window; // Place window above its begin stack parent.
+ }
+ return NULL;
+}
+
// Push a new Dear ImGui window to add widgets to.
// - A default window called "Debug" is automatically stacked at the beginning of every frame so you can use widgets without explicitly calling a Begin/End pair.
// - Begin/End can be called multiple times during the frame with the same window name to append content.
@@ -5841,6 +6346,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Update Flags, LastFrameActive, BeginOrderXXX fields
if (first_begin_of_the_frame)
{
+ UpdateWindowInFocusOrderList(window, window_just_created, flags);
window->Flags = (ImGuiWindowFlags)flags;
window->LastFrameActive = current_frame;
window->LastTimeActive = (float)g.Time;
@@ -5869,20 +6375,31 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window_stack_data.ParentLastItemDataBackup = g.LastItemData;
window_stack_data.StackSizesOnBegin.SetToCurrentState();
g.CurrentWindowStack.push_back(window_stack_data);
+ if (flags & ImGuiWindowFlags_ChildMenu)
+ g.BeginMenuCount++;
+
+ // Update ->RootWindow and others pointers (before any possible call to FocusWindow)
+ if (first_begin_of_the_frame)
+ {
+ UpdateWindowParentAndRootLinks(window, flags, parent_window);
+ window->ParentWindowInBeginStack = parent_window_in_stack;
+ }
+
+ // Add to focus scope stack
+ PushFocusScope(window->ID);
+ window->NavRootFocusScopeId = g.CurrentFocusScopeId;
g.CurrentWindow = NULL;
+ // Add to popup stack
if (flags & ImGuiWindowFlags_Popup)
{
ImGuiPopupData& popup_ref = g.OpenPopupStack[g.BeginPopupStack.Size];
popup_ref.Window = window;
+ popup_ref.ParentNavLayer = parent_window_in_stack->DC.NavLayerCurrent;
g.BeginPopupStack.push_back(popup_ref);
window->PopupId = popup_ref.PopupId;
}
- // Update ->RootWindow and others pointers (before any possible call to FocusWindow)
- if (first_begin_of_the_frame)
- UpdateWindowParentAndRootLinks(window, flags, parent_window);
-
// Process SetNextWindow***() calls
// (FIXME: Consider splitting the HasXXX flags into X/Y components
bool window_pos_set_by_api = false;
@@ -5938,6 +6455,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
{
// Initialize
const bool window_is_child_tooltip = (flags & ImGuiWindowFlags_ChildWindow) && (flags & ImGuiWindowFlags_Tooltip); // FIXME-WIP: Undocumented behavior of Child+Tooltip for pinned tooltip (#1345)
+ const bool window_just_appearing_after_hidden_for_resize = (window->HiddenFramesCannotSkipItems > 0);
window->Active = true;
window->HasCloseButton = (p_open != NULL);
window->ClipRect = ImVec4(-FLT_MAX, -FLT_MAX, +FLT_MAX, +FLT_MAX);
@@ -5964,7 +6482,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// UPDATE CONTENTS SIZE, UPDATE HIDDEN STATUS
// Update contents size from last frame for auto-fitting (or use explicit size)
- const bool window_just_appearing_after_hidden_for_resize = (window->HiddenFramesCannotSkipItems > 0);
CalcWindowContentSizes(window, &window->ContentSize, &window->ContentSizeIdeal);
if (window->HiddenFramesCanSkipItems > 0)
window->HiddenFramesCanSkipItems--;
@@ -5994,6 +6511,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// SELECT VIEWPORT
// FIXME-VIEWPORT: In the docking/viewport branch, this is the point where we select the current viewport (which may affect the style)
+
+ ImGuiViewportP* viewport = (ImGuiViewportP*)(void*)GetMainViewport();
+ SetWindowViewport(window, viewport);
SetCurrentWindow(window);
// LOCK BORDER SIZE AND PADDING FOR THE FRAME (so that altering them doesn't cause inconsistencies)
@@ -6010,17 +6530,22 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->DC.MenuBarOffset.x = ImMax(ImMax(window->WindowPadding.x, style.ItemSpacing.x), g.NextWindowData.MenuBarOffsetMinVal.x);
window->DC.MenuBarOffset.y = g.NextWindowData.MenuBarOffsetMinVal.y;
+ bool use_current_size_for_scrollbar_x = window_just_created;
+ bool use_current_size_for_scrollbar_y = window_just_created;
+
// Collapse window by double-clicking on title bar
// At this point we don't have a clipping rectangle setup yet, so we can use the title bar area for hit detection and drawing
if (!(flags & ImGuiWindowFlags_NoTitleBar) && !(flags & ImGuiWindowFlags_NoCollapse))
{
// We don't use a regular button+id to test for double-click on title bar (mostly due to legacy reason, could be fixed), so verify that we don't have items over the title bar.
ImRect title_bar_rect = window->TitleBarRect();
- if (g.HoveredWindow == window && g.HoveredId == 0 && g.HoveredIdPreviousFrame == 0 && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max) && g.IO.MouseDoubleClicked[0])
+ if (g.HoveredWindow == window && g.HoveredId == 0 && g.HoveredIdPreviousFrame == 0 && IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max) && g.IO.MouseClickedCount[0] == 2)
window->WantCollapseToggle = true;
if (window->WantCollapseToggle)
{
window->Collapsed = !window->Collapsed;
+ if (!window->Collapsed)
+ use_current_size_for_scrollbar_y = true;
MarkIniSettingsDirty(window);
}
}
@@ -6034,8 +6559,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Calculate auto-fit size, handle automatic resize
const ImVec2 size_auto_fit = CalcWindowAutoFitSize(window, window->ContentSizeIdeal);
- bool use_current_size_for_scrollbar_x = window_just_created;
- bool use_current_size_for_scrollbar_y = window_just_created;
if ((flags & ImGuiWindowFlags_AlwaysAutoResize) && !window->Collapsed)
{
// Using SetNextWindowSize() overrides ImGuiWindowFlags_AlwaysAutoResize, so it can be used on tooltips/popups, etc.
@@ -6107,7 +6630,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Calculate the range of allowed position for that window (to be movable and visible past safe area padding)
// When clamping to stay visible, we will enforce that window->Pos stays inside of visibility_rect.
- ImGuiViewportP* viewport = (ImGuiViewportP*)(void*)GetMainViewport();
ImRect viewport_rect(viewport->GetMainRect());
ImRect viewport_work_rect(viewport->GetWorkRect());
ImVec2 visibility_padding = ImMax(style.DisplayWindowPadding, style.DisplaySafeAreaPadding);
@@ -6115,9 +6637,9 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Clamp position/size so window stays visible within its viewport or monitor
// Ignore zero-sized display explicitly to avoid losing positions if a window manager reports zero-sized window when initializing or minimizing.
- if (!window_pos_set_by_api && !(flags & ImGuiWindowFlags_ChildWindow) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0)
+ if (!window_pos_set_by_api && !(flags & ImGuiWindowFlags_ChildWindow))
if (viewport_rect.GetWidth() > 0.0f && viewport_rect.GetHeight() > 0.0f)
- ClampWindowRect(window, visibility_rect);
+ ClampWindowPos(window, visibility_rect);
window->Pos = ImFloor(window->Pos);
// Lock window rounding for the frame (so that altering them doesn't cause inconsistencies)
@@ -6136,8 +6658,36 @@ 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
+#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_INFO(window->ID, window->Name, (g.HoveredWindow == window) ? ImGuiItemStatusFlags_HoveredRect : 0);
+ window->IDStack.Size = 1;
+ }
+#endif
+
// Handle manual resize: Resize Grips, Borders, Gamepad
int border_held = -1;
ImU32 resize_grip_col[4] = {};
@@ -6169,7 +6719,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
}
// UPDATE RECTANGLES (1- THOSE NOT AFFECTED BY SCROLLING)
- // Update various regions. Variables they depends on should be set above in this function.
+ // Update various regions. Variables they depend on should be set above in this function.
// We set this up after processing the resize grip so that our rectangles doesn't lag by a frame.
// Outer rectangle
@@ -6186,7 +6736,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Inner rectangle
// Not affected by window border size. Used by:
// - InnerClipRect
- // - ScrollToBringRectIntoView()
+ // - ScrollToRectEx()
// - NavUpdatePageUpPageDown()
// - Scrollbar()
window->InnerRect.Min.x = window->Pos.x;
@@ -6233,24 +6783,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->DrawList->PushTextureID(g.Font->ContainerAtlas->TexID);
PushClipRect(host_rect.Min, host_rect.Max, false);
- // Draw modal window background (darkens what is behind them, all viewports)
- const bool dim_bg_for_modal = (flags & ImGuiWindowFlags_Modal) && window == GetTopMostPopupModal() && window->HiddenFramesCannotSkipItems <= 0;
- const bool dim_bg_for_window_list = g.NavWindowingTargetAnim && (window == g.NavWindowingTargetAnim->RootWindow);
- if (dim_bg_for_modal || dim_bg_for_window_list)
- {
- const ImU32 dim_bg_col = GetColorU32(dim_bg_for_modal ? ImGuiCol_ModalWindowDimBg : ImGuiCol_NavWindowingDimBg, g.DimBgRatio);
- window->DrawList->AddRectFilled(viewport_rect.Min, viewport_rect.Max, dim_bg_col);
- }
-
- // Draw navigation selection/windowing rectangle background
- if (dim_bg_for_window_list && window == g.NavWindowingTargetAnim)
- {
- ImRect bb = window->Rect();
- bb.Expand(g.FontSize);
- if (!bb.Contains(viewport_rect)) // Avoid drawing if the window covers all the viewport anyway
- window->DrawList->AddRectFilled(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha * 0.25f), g.Style.WindowRounding);
- }
-
// Child windows can render their decoration (bg color, border, scrollbars, etc.) within their parent to save a draw call (since 1.71)
// When using overlapping child windows, this will break the assumption that child z-order is mapped to submission order.
// FIXME: User code may rely on explicit sorting of overlapping child window and would need to disable this somehow. Please get in contact if you are affected (github #4493)
@@ -6278,20 +6810,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->DrawList = &window->DrawListInst;
}
- // Draw navigation selection/windowing rectangle border
- if (g.NavWindowingTargetAnim == window)
- {
- float rounding = ImMax(window->WindowRounding, g.Style.WindowRounding);
- ImRect bb = window->Rect();
- bb.Expand(g.FontSize);
- if (bb.Contains(viewport_rect)) // If a window fits the entire viewport, adjust its highlight inward
- {
- bb.Expand(-g.FontSize - 1.0f);
- rounding = window->WindowRounding;
- }
- window->DrawList->AddRect(bb.Min, bb.Max, GetColorU32(ImGuiCol_NavWindowingHighlight, g.NavWindowingHighlightAlpha), rounding, 0, 3.0f);
- }
-
// UPDATE RECTANGLES (2- THOSE AFFECTED BY SCROLLING)
// Work rectangle.
@@ -6323,13 +6841,20 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->DC.Indent.x = 0.0f + window->WindowPadding.x - window->Scroll.x;
window->DC.GroupOffset.x = 0.0f;
window->DC.ColumnsOffset.x = 0.0f;
- window->DC.CursorStartPos = window->Pos + ImVec2(window->DC.Indent.x + window->DC.ColumnsOffset.x, decoration_up_height + window->WindowPadding.y - window->Scroll.y);
+
+ // 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;
+ 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;
window->DC.CursorPosPrevLine = window->DC.CursorPos;
window->DC.CursorMaxPos = window->DC.CursorStartPos;
window->DC.IdealMaxPos = window->DC.CursorStartPos;
window->DC.CurrLineSize = window->DC.PrevLineSize = ImVec2(0.0f, 0.0f);
window->DC.CurrLineTextBaseOffset = window->DC.PrevLineTextBaseOffset = 0.0f;
+ window->DC.IsSameLine = window->DC.IsSetPos = false;
window->DC.NavLayerCurrent = ImGuiNavLayer_Main;
window->DC.NavLayersActiveMask = window->DC.NavLayersActiveMaskNext;
@@ -6346,7 +6871,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->DC.CurrentColumns = NULL;
window->DC.LayoutType = ImGuiLayoutType_Vertical;
window->DC.ParentLayoutType = parent_window ? parent_window->DC.LayoutType : ImGuiLayoutType_Vertical;
- window->DC.FocusCounterRegular = window->DC.FocusCounterTabStop = -1;
window->DC.ItemWidth = window->ItemWidthDefault;
window->DC.TextWrapPos = -1.0f; // disabled
@@ -6378,17 +6902,21 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
/*
//if (g.NavWindow == window && g.ActiveId == 0)
if (g.ActiveId == window->MoveId)
- if (g.IO.KeyCtrl && IsKeyPressedMap(ImGuiKey_C))
+ if (g.IO.KeyCtrl && IsKeyPressed(ImGuiKey_C))
LogToClipboard();
*/
// We fill last item data based on Title Bar/Tab, in order for IsItemHovered() and IsItemActive() to be usable after Begin().
// This is useful to allow creating context menus on title bar only, etc.
- g.LastItemData.ID = window->MoveId;
- g.LastItemData.InFlags = g.CurrentItemFlags;
- g.LastItemData.StatusFlags = IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max, false) ? ImGuiItemStatusFlags_HoveredRect : 0;
- g.LastItemData.Rect = title_bar_rect;
+ SetLastItemData(window->MoveId, g.CurrentItemFlags, IsMouseHoveringRect(title_bar_rect.Min, title_bar_rect.Max, false) ? ImGuiItemStatusFlags_HoveredRect : 0, title_bar_rect);
+ // [DEBUG]
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ if (g.DebugLocateId != 0 && (window->ID == g.DebugLocateId || window->MoveId == g.DebugLocateId))
+ DebugLocateItemResolveWithLastItem();
+#endif
+
+ // [Test Engine] Register title bar / tab
#ifdef IMGUI_ENABLE_TEST_ENGINE
if (!(window->Flags & ImGuiWindowFlags_NoTitleBar))
IMGUI_TEST_ENGINE_ITEM_ADD(g.LastItemData.Rect, g.LastItemData.ID);
@@ -6400,9 +6928,6 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
SetCurrentWindow(window);
}
- // Pull/inherit current state
- window->DC.NavFocusScopeIdCurrent = (flags & ImGuiWindowFlags_ChildWindow) ? parent_window->DC.NavFocusScopeIdCurrent : window->GetID("#FOCUSSCOPE"); // Inherit from parent only // -V595
-
PushClipRect(window->InnerClipRect.Min, window->InnerClipRect.Max, true);
// Clear 'accessed' flag last thing (After PushClipRect which will set the flag. We want the flag to stay false when the default "Debug" window is unused)
@@ -6419,9 +6944,12 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Mark them as collapsed so commands are skipped earlier (we can't manually collapse them because they have no title bar).
IM_ASSERT((flags & ImGuiWindowFlags_NoTitleBar) != 0);
if (!(flags & ImGuiWindowFlags_AlwaysAutoResize) && window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0) // FIXME: Doesn't make sense for ChildWindow??
- if (!g.LogEnabled)
+ {
+ const bool nav_request = (flags & ImGuiWindowFlags_NavFlattened) && (g.NavAnyRequest && g.NavWindow && g.NavWindow->RootWindowForNav == window->RootWindowForNav);
+ if (!g.LogEnabled && !nav_request)
if (window->OuterRectClipped.Min.x >= window->OuterRectClipped.Max.x || window->OuterRectClipped.Min.y >= window->OuterRectClipped.Max.y)
window->HiddenFramesCanSkipItems = 1;
+ }
// Hide along with parent or if parent is collapsed
if (parent_window && (parent_window->Collapsed || parent_window->HiddenFramesCanSkipItems > 0))
@@ -6435,7 +6963,8 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
window->HiddenFramesCanSkipItems = 1;
// Update the Hidden flag
- window->Hidden = (window->HiddenFramesCanSkipItems > 0) || (window->HiddenFramesCannotSkipItems > 0) || (window->HiddenFramesForRenderOnly > 0);
+ bool hidden_regular = (window->HiddenFramesCanSkipItems > 0) || (window->HiddenFramesCannotSkipItems > 0);
+ window->Hidden = hidden_regular || (window->HiddenFramesForRenderOnly > 0);
// Disable inputs for requested number of frames
if (window->DisableInputsFrames > 0)
@@ -6446,7 +6975,7 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
// Update the SkipItems flag, used to early out of all items functions (no layout required)
bool skip_items = false;
- if (window->Collapsed || !window->Active || window->Hidden)
+ if (window->Collapsed || !window->Active || hidden_regular)
if (window->AutoFitFramesX <= 0 && window->AutoFitFramesY <= 0 && window->HiddenFramesCannotSkipItems <= 0)
skip_items = true;
window->SkipItems = skip_items;
@@ -6476,13 +7005,19 @@ void ImGui::End()
if (window->DC.CurrentColumns)
EndColumns();
PopClipRect(); // Inner window clip rectangle
+ PopFocusScope();
// Stop logging
if (!(window->Flags & ImGuiWindowFlags_ChildWindow)) // FIXME: add more options for scope of logging
LogFinish();
+ if (window->DC.IsSetPos)
+ ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
+
// Pop from window stack
g.LastItemData = g.CurrentWindowStack.back().ParentLastItemDataBackup;
+ if (window->Flags & ImGuiWindowFlags_ChildMenu)
+ g.BeginMenuCount--;
if (window->Flags & ImGuiWindowFlags_Popup)
g.BeginPopupStack.pop_back();
g.CurrentWindowStack.back().StackSizesOnBegin.CompareWithCurrentState();
@@ -6540,6 +7075,34 @@ void ImGui::BringWindowToDisplayBack(ImGuiWindow* window)
}
}
+void ImGui::BringWindowToDisplayBehind(ImGuiWindow* window, ImGuiWindow* behind_window)
+{
+ IM_ASSERT(window != NULL && behind_window != NULL);
+ ImGuiContext& g = *GImGui;
+ window = window->RootWindow;
+ behind_window = behind_window->RootWindow;
+ int pos_wnd = FindWindowDisplayIndex(window);
+ int pos_beh = FindWindowDisplayIndex(behind_window);
+ if (pos_wnd < pos_beh)
+ {
+ size_t copy_bytes = (pos_beh - pos_wnd - 1) * sizeof(ImGuiWindow*);
+ memmove(&g.Windows.Data[pos_wnd], &g.Windows.Data[pos_wnd + 1], copy_bytes);
+ g.Windows[pos_beh - 1] = window;
+ }
+ else
+ {
+ size_t copy_bytes = (pos_wnd - pos_beh) * sizeof(ImGuiWindow*);
+ memmove(&g.Windows.Data[pos_beh + 1], &g.Windows.Data[pos_beh], copy_bytes);
+ g.Windows[pos_beh] = window;
+ }
+}
+
+int ImGui::FindWindowDisplayIndex(ImGuiWindow* window)
+{
+ ImGuiContext& g = *GImGui;
+ return g.Windows.index_from_ptr(g.Windows.find(window));
+}
+
// Moving window to front of display and set focus (which happens to be back of our sorted list)
void ImGui::FocusWindow(ImGuiWindow* window)
{
@@ -6547,20 +7110,17 @@ void ImGui::FocusWindow(ImGuiWindow* window)
if (g.NavWindow != window)
{
- g.NavWindow = window;
+ SetNavWindow(window);
if (window && g.NavDisableMouseHover)
g.NavMousePosDirty = true;
g.NavId = window ? window->NavLastIds[0] : 0; // Restore NavId
- g.NavFocusScopeId = 0;
- g.NavIdIsAlive = false;
g.NavLayer = ImGuiNavLayer_Main;
- g.NavInitRequest = g.NavMoveSubmitted = g.NavMoveScoringItems = false;
- NavUpdateAnyRequestFlag();
- //IMGUI_DEBUG_LOG("FocusWindow(\"%s\")\n", window ? window->Name : NULL);
- }
+ g.NavFocusScopeId = window ? window->NavRootFocusScopeId : 0;
+ g.NavIdIsAlive = false;
- // Close popups if any
- ClosePopupsOverWindow(window, false);
+ // Close popups if any
+ ClosePopupsOverWindow(window, false);
+ }
// Move the root window to the top of the pile
IM_ASSERT(window == NULL || window->RootWindow != NULL);
@@ -6587,8 +7147,18 @@ void ImGui::FocusWindow(ImGuiWindow* window)
void ImGui::FocusTopMostWindowUnderOne(ImGuiWindow* under_this_window, ImGuiWindow* ignore_window)
{
ImGuiContext& g = *GImGui;
-
- const int start_idx = ((under_this_window != NULL) ? FindWindowFocusIndex(under_this_window) : g.WindowsFocusOrder.Size) - 1;
+ int start_idx = g.WindowsFocusOrder.Size - 1;
+ if (under_this_window != NULL)
+ {
+ // Aim at root window behind us, if we are in a child window that's our own root (see #4640)
+ int offset = -1;
+ while (under_this_window->Flags & ImGuiWindowFlags_ChildWindow)
+ {
+ under_this_window = under_this_window->ParentWindow;
+ offset = 0;
+ }
+ start_idx = FindWindowFocusIndex(under_this_window) + offset;
+ }
for (int i = start_idx; i >= 0; i--)
{
// 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.
@@ -6732,9 +7302,14 @@ void ImGui::PopTextWrapPos()
static ImGuiWindow* GetCombinedRootWindow(ImGuiWindow* window, bool popup_hierarchy)
{
- window = window->RootWindow;
- if (popup_hierarchy)
- window = window->RootWindowPopupTree;
+ ImGuiWindow* last_window = NULL;
+ while (last_window != window)
+ {
+ last_window = window;
+ window = window->RootWindow;
+ if (popup_hierarchy)
+ window = window->RootWindowPopupTree;
+ }
return window;
}
@@ -6754,9 +7329,28 @@ bool ImGui::IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent,
return false;
}
+bool ImGui::IsWindowWithinBeginStackOf(ImGuiWindow* window, ImGuiWindow* potential_parent)
+{
+ if (window->RootWindow == potential_parent)
+ return true;
+ while (window != NULL)
+ {
+ if (window == potential_parent)
+ return true;
+ window = window->ParentWindowInBeginStack;
+ }
+ return false;
+}
+
bool ImGui::IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_below)
{
ImGuiContext& g = *GImGui;
+
+ // It would be saner to ensure that display layer is always reflected in the g.Windows[] order, which would likely requires altering all manipulations of that array
+ const int display_layer_delta = GetWindowDisplayLayer(potential_above) - GetWindowDisplayLayer(potential_below);
+ if (display_layer_delta != 0)
+ return display_layer_delta > 0;
+
for (int i = g.Windows.Size - 1; i >= 0; i--)
{
ImGuiWindow* candidate_window = g.Windows[i];
@@ -6770,7 +7364,7 @@ bool ImGui::IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_b
bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags)
{
- IM_ASSERT((flags & ImGuiHoveredFlags_AllowWhenOverlapped) == 0); // Flags not supported by this function
+ IM_ASSERT((flags & (ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled)) == 0); // Flags not supported by this function
ImGuiContext& g = *GImGui;
ImGuiWindow* ref_window = g.HoveredWindow;
ImGuiWindow* cur_window = g.CurrentWindow;
@@ -6811,8 +7405,8 @@ bool ImGui::IsWindowFocused(ImGuiFocusedFlags flags)
return false;
if (flags & ImGuiFocusedFlags_AnyWindow)
return true;
- IM_ASSERT(cur_window); // Not inside a Begin()/End()
+ IM_ASSERT(cur_window); // Not inside a Begin()/End()
const bool popup_hierarchy = (flags & ImGuiFocusedFlags_NoPopupHierarchy) == 0;
if (flags & ImGuiHoveredFlags_RootWindow)
cur_window = GetCombinedRootWindow(cur_window, popup_hierarchy);
@@ -6864,6 +7458,9 @@ void ImGui::SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond)
const ImVec2 old_pos = window->Pos;
window->Pos = ImFloor(pos);
ImVec2 offset = window->Pos - old_pos;
+ if (offset.x == 0.0f && offset.y == 0.0f)
+ return;
+ MarkIniSettingsDirty(window);
window->DC.CursorPos += offset; // As we happen to move the window while it is being appended to (which is a bad idea - will smear) let's at least offset the cursor
window->DC.CursorMaxPos += offset; // And more importantly we need to offset CursorMaxPos/CursorStartPos this so ContentSize calculation doesn't get affected.
window->DC.IdealMaxPos += offset;
@@ -6898,26 +7495,19 @@ void ImGui::SetWindowSize(ImGuiWindow* window, const ImVec2& size, ImGuiCond con
window->SetWindowSizeAllowFlags &= ~(ImGuiCond_Once | ImGuiCond_FirstUseEver | ImGuiCond_Appearing);
// Set
- if (size.x > 0.0f)
- {
- window->AutoFitFramesX = 0;
- window->SizeFull.x = IM_FLOOR(size.x);
- }
- else
- {
- window->AutoFitFramesX = 2;
+ ImVec2 old_size = window->SizeFull;
+ window->AutoFitFramesX = (size.x <= 0.0f) ? 2 : 0;
+ window->AutoFitFramesY = (size.y <= 0.0f) ? 2 : 0;
+ if (size.x <= 0.0f)
window->AutoFitOnlyGrows = false;
- }
- if (size.y > 0.0f)
- {
- window->AutoFitFramesY = 0;
- window->SizeFull.y = IM_FLOOR(size.y);
- }
else
- {
- window->AutoFitFramesY = 2;
+ window->SizeFull.x = IM_FLOOR(size.x);
+ if (size.y <= 0.0f)
window->AutoFitOnlyGrows = false;
- }
+ else
+ window->SizeFull.y = IM_FLOOR(size.y);
+ if (old_size.x != window->SizeFull.x || old_size.y != window->SizeFull.y)
+ MarkIniSettingsDirty(window);
}
void ImGui::SetWindowSize(const ImVec2& size, ImGuiCond cond)
@@ -7096,28 +7686,49 @@ void ImGui::ActivateItem(ImGuiID id)
void ImGui::PushFocusScope(ImGuiID id)
{
ImGuiContext& g = *GImGui;
- ImGuiWindow* window = g.CurrentWindow;
- g.FocusScopeStack.push_back(window->DC.NavFocusScopeIdCurrent);
- window->DC.NavFocusScopeIdCurrent = id;
+ g.FocusScopeStack.push_back(id);
+ g.CurrentFocusScopeId = id;
}
void ImGui::PopFocusScope()
{
ImGuiContext& g = *GImGui;
- ImGuiWindow* window = g.CurrentWindow;
IM_ASSERT(g.FocusScopeStack.Size > 0); // Too many PopFocusScope() ?
- window->DC.NavFocusScopeIdCurrent = g.FocusScopeStack.back();
g.FocusScopeStack.pop_back();
+ g.CurrentFocusScopeId = g.FocusScopeStack.Size ? g.FocusScopeStack.back() : 0;
}
+// Note: this will likely be called ActivateItem() once we rework our Focus/Activation system!
void ImGui::SetKeyboardFocusHere(int offset)
{
- IM_ASSERT(offset >= -1); // -1 is allowed but not below
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- g.TabFocusRequestNextWindow = window;
- g.TabFocusRequestNextCounterRegular = window->DC.FocusCounterRegular + 1 + offset;
- g.TabFocusRequestNextCounterTabStop = INT_MAX;
+ IM_ASSERT(offset >= -1); // -1 is allowed but not below
+ IMGUI_DEBUG_LOG_ACTIVEID("SetKeyboardFocusHere(%d) in window \"%s\"\n", offset, window->Name);
+
+ // It makes sense in the vast majority of cases to never interrupt a drag and drop.
+ // When we refactor this function into ActivateItem() we may want to make this an option.
+ // MovingWindow is protected from most user inputs using SetActiveIdUsingNavAndKeys(), but
+ // is also automatically dropped in the event g.ActiveId is stolen.
+ if (g.DragDropActive || g.MovingWindow != NULL)
+ {
+ IMGUI_DEBUG_LOG_ACTIVEID("SetKeyboardFocusHere() ignored while DragDropActive!\n");
+ return;
+ }
+
+ SetNavWindow(window);
+
+ ImGuiScrollFlags scroll_flags = window->Appearing ? ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_AlwaysCenterY : ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleEdgeY;
+ NavMoveRequestSubmit(ImGuiDir_None, offset < 0 ? ImGuiDir_Up : ImGuiDir_Down, ImGuiNavMoveFlags_Tabbing | ImGuiNavMoveFlags_FocusApi, scroll_flags); // FIXME-NAV: Once we refactor tabbing, add LegacyApi flag to not activate non-inputable.
+ if (offset == -1)
+ {
+ NavMoveRequestResolveWithLastItem(&g.NavMoveResultLocal);
+ }
+ else
+ {
+ g.NavTabbingDir = 1;
+ g.NavTabbingCounter = offset + 1;
+ }
}
void ImGui::SetItemDefaultFocus()
@@ -7126,15 +7737,17 @@ void ImGui::SetItemDefaultFocus()
ImGuiWindow* window = g.CurrentWindow;
if (!window->Appearing)
return;
- if (g.NavWindow == window->RootWindowForNav && (g.NavInitRequest || g.NavInitResultId != 0) && g.NavLayer == window->DC.NavLayerCurrent)
- {
- g.NavInitRequest = false;
- g.NavInitResultId = g.LastItemData.ID;
- g.NavInitResultRectRel = ImRect(g.LastItemData.Rect.Min - window->Pos, g.LastItemData.Rect.Max - window->Pos);
- NavUpdateAnyRequestFlag();
- if (!IsItemVisible())
- SetScrollHereY();
- }
+ if (g.NavWindow != window->RootWindowForNav || (!g.NavInitRequest && g.NavInitResultId == 0) || g.NavLayer != window->DC.NavLayerCurrent)
+ return;
+
+ g.NavInitRequest = false;
+ g.NavInitResultId = g.LastItemData.ID;
+ g.NavInitResultRectRel = WindowRectAbsToRel(window, g.LastItemData.Rect);
+ NavUpdateAnyRequestFlag();
+
+ // Scroll could be done in NavInitRequestApplyResult() via an opt-in flag (we however don't want regular init requests to scroll)
+ if (!IsItemVisible())
+ ScrollToRectEx(window, g.LastItemData.Rect, ImGuiScrollFlags_None);
}
void ImGui::SetStateStorage(ImGuiStorage* tree)
@@ -7153,7 +7766,7 @@ void ImGui::PushID(const char* str_id)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- ImGuiID id = window->GetIDNoKeepAlive(str_id);
+ ImGuiID id = window->GetID(str_id);
window->IDStack.push_back(id);
}
@@ -7161,7 +7774,7 @@ void ImGui::PushID(const char* str_id_begin, const char* str_id_end)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- ImGuiID id = window->GetIDNoKeepAlive(str_id_begin, str_id_end);
+ ImGuiID id = window->GetID(str_id_begin, str_id_end);
window->IDStack.push_back(id);
}
@@ -7169,7 +7782,7 @@ void ImGui::PushID(const void* ptr_id)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- ImGuiID id = window->GetIDNoKeepAlive(ptr_id);
+ ImGuiID id = window->GetID(ptr_id);
window->IDStack.push_back(id);
}
@@ -7177,7 +7790,7 @@ void ImGui::PushID(int int_id)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- ImGuiID id = window->GetIDNoKeepAlive(int_id);
+ ImGuiID id = window->GetID(int_id);
window->IDStack.push_back(id);
}
@@ -7186,6 +7799,8 @@ void ImGui::PushOverrideID(ImGuiID id)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
+ if (g.DebugHookIdInfo == id)
+ DebugHookIdInfo(id, ImGuiDataType_ID, NULL, NULL);
window->IDStack.push_back(id);
}
@@ -7195,11 +7810,9 @@ void ImGui::PushOverrideID(ImGuiID id)
ImGuiID ImGui::GetIDWithSeed(const char* str, const char* str_end, ImGuiID seed)
{
ImGuiID id = ImHashStr(str, str_end ? (str_end - str) : 0, seed);
- ImGui::KeepAliveID(id);
-#ifdef IMGUI_ENABLE_TEST_ENGINE
ImGuiContext& g = *GImGui;
- IMGUI_TEST_ENGINE_ID_INFO2(id, ImGuiDataType_String, str, str_end);
-#endif
+ if (g.DebugHookIdInfo == id)
+ DebugHookIdInfo(id, ImGuiDataType_String, str, str_end);
return id;
}
@@ -7242,14 +7855,824 @@ 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;
+}
+
+ImGuiKeyData* ImGui::GetKeyData(ImGuiKey key)
+{
+ ImGuiContext& g = *GImGui;
+
+ // Special storage location for mods
+ 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;
+#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];
+}
+
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
+ImGuiKey ImGui::GetKeyIndex(ImGuiKey key)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(IsNamedKey(key));
+ const ImGuiKeyData* key_data = GetKeyData(key);
+ return (ImGuiKey)(key_data - g.IO.KeysData);
+}
+#endif
+
+// Those names a provided for debugging purpose and are not meant to be saved persistently not compared.
+static const char* const GKeyNames[] =
+{
+ "Tab", "LeftArrow", "RightArrow", "UpArrow", "DownArrow", "PageUp", "PageDown",
+ "Home", "End", "Insert", "Delete", "Backspace", "Space", "Enter", "Escape",
+ "LeftCtrl", "LeftShift", "LeftAlt", "LeftSuper", "RightCtrl", "RightShift", "RightAlt", "RightSuper", "Menu",
+ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "A", "B", "C", "D", "E", "F", "G", "H",
+ "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z",
+ "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12",
+ "Apostrophe", "Comma", "Minus", "Period", "Slash", "Semicolon", "Equal", "LeftBracket",
+ "Backslash", "RightBracket", "GraveAccent", "CapsLock", "ScrollLock", "NumLock", "PrintScreen",
+ "Pause", "Keypad0", "Keypad1", "Keypad2", "Keypad3", "Keypad4", "Keypad5", "Keypad6",
+ "Keypad7", "Keypad8", "Keypad9", "KeypadDecimal", "KeypadDivide", "KeypadMultiply",
+ "KeypadSubtract", "KeypadAdd", "KeypadEnter", "KeypadEqual",
+ "GamepadStart", "GamepadBack",
+ "GamepadFaceLeft", "GamepadFaceRight", "GamepadFaceUp", "GamepadFaceDown",
+ "GamepadDpadLeft", "GamepadDpadRight", "GamepadDpadUp", "GamepadDpadDown",
+ "GamepadL1", "GamepadR1", "GamepadL2", "GamepadR2", "GamepadL3", "GamepadR3",
+ "GamepadLStickLeft", "GamepadLStickRight", "GamepadLStickUp", "GamepadLStickDown",
+ "GamepadRStickLeft", "GamepadRStickRight", "GamepadRStickUp", "GamepadRStickDown",
+ "MouseLeft", "MouseRight", "MouseMiddle", "MouseX1", "MouseX2", "MouseWheelX", "MouseWheelY",
+ "ModCtrl", "ModShift", "ModAlt", "ModSuper", // ReservedForModXXX are showing the ModXXX names.
+};
+IM_STATIC_ASSERT(ImGuiKey_NamedKey_COUNT == IM_ARRAYSIZE(GKeyNames));
+
+const char* ImGui::GetKeyName(ImGuiKey key)
+{
+#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)
+ return "N/A";
+ IM_ASSERT(IsNamedKey((ImGuiKey)io.KeyMap[key]));
+ key = (ImGuiKey)io.KeyMap[key];
+ }
+#endif
+ if (key == ImGuiKey_None)
+ return "None";
+ if (key & ImGuiMod_Mask_)
+ key = ConvertSingleModFlagToKey(key);
+ if (!IsNamedKey(key))
+ return "Unknown";
+
+ return GKeyNames[key - ImGuiKey_NamedKey_BEGIN];
+}
+
+void ImGui::GetKeyChordName(ImGuiKeyChord key_chord, char* out_buf, int out_buf_size)
+{
+ ImGuiContext& g = *GImGui;
+ ImFormatString(out_buf, (size_t)out_buf_size, "%s%s%s%s%s",
+ (key_chord & ImGuiMod_Ctrl) ? "Ctrl+" : "",
+ (key_chord & ImGuiMod_Shift) ? "Shift+" : "",
+ (key_chord & ImGuiMod_Alt) ? "Alt+" : "",
+ (key_chord & ImGuiMod_Super) ? (g.IO.ConfigMacOSXBehaviors ? "Cmd+" : "Super+") : "",
+ GetKeyName((ImGuiKey)(key_chord & ~ImGuiMod_Mask_)));
+}
+
+// t0 = previous time (e.g.: g.Time - g.IO.DeltaTime)
+// t1 = current time (e.g.: g.Time)
+// An event is triggered at:
+// t = 0.0f t = repeat_delay, t = repeat_delay + repeat_rate*N
+int ImGui::CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate)
+{
+ if (t1 == 0.0f)
+ return 1;
+ if (t0 >= t1)
+ return 0;
+ if (repeat_rate <= 0.0f)
+ return (t0 < repeat_delay) && (t1 >= repeat_delay);
+ const int count_t0 = (t0 < repeat_delay) ? -1 : (int)((t0 - repeat_delay) / repeat_rate);
+ const int count_t1 = (t1 < repeat_delay) ? -1 : (int)((t1 - repeat_delay) / repeat_rate);
+ const int count = count_t1 - count_t0;
+ return count;
+}
+
+void ImGui::GetTypematicRepeatRate(ImGuiInputFlags flags, float* repeat_delay, float* repeat_rate)
+{
+ ImGuiContext& g = *GImGui;
+ switch (flags & ImGuiInputFlags_RepeatRateMask_)
+ {
+ case ImGuiInputFlags_RepeatRateNavMove: *repeat_delay = g.IO.KeyRepeatDelay * 0.72f; *repeat_rate = g.IO.KeyRepeatRate * 0.80f; return;
+ case ImGuiInputFlags_RepeatRateNavTweak: *repeat_delay = g.IO.KeyRepeatDelay * 0.72f; *repeat_rate = g.IO.KeyRepeatRate * 0.30f; return;
+ case ImGuiInputFlags_RepeatRateDefault: default: *repeat_delay = g.IO.KeyRepeatDelay * 1.00f; *repeat_rate = g.IO.KeyRepeatRate * 1.00f; return;
+ }
+}
+
+// Return value representing the number of presses in the last time period, for the given repeat rate
+// (most often returns 0 or 1. The result is generally only >1 when RepeatRate is smaller than DeltaTime, aka large DeltaTime or fast RepeatRate)
+int ImGui::GetKeyPressedAmount(ImGuiKey key, float repeat_delay, float repeat_rate)
+{
+ ImGuiContext& g = *GImGui;
+ const ImGuiKeyData* key_data = GetKeyData(key);
+ if (!key_data->Down) // In theory this should already be encoded as (DownDuration < 0.0f), but testing this facilitates eating mechanism (until we finish work on key ownership)
+ return 0;
+ const float t = key_data->DownDuration;
+ return CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, repeat_delay, repeat_rate);
+}
+
+// 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)
+{
+ return ImVec2(
+ GetKeyData(key_right)->AnalogValue - GetKeyData(key_left)->AnalogValue,
+ GetKeyData(key_down)->AnalogValue - GetKeyData(key_up)->AnalogValue);
+}
+
+// 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)
+{
+ ImGuiContext& g = *GImGui;
+ return (owner_id != ImGuiKeyOwner_None && owner_id != ImGuiKeyOwner_Any) ? owner_id : g.CurrentFocusScopeId;
+}
+
+ImGuiKeyRoutingData* ImGui::GetShortcutRoutingData(ImGuiKeyChord key_chord)
+{
+ // Majority of shortcuts will be Key + any number of Mods
+ // We accept _Single_ mod with ImGuiKey_None.
+ // - Shortcut(ImGuiKey_S | ImGuiMod_Ctrl); // Legal
+ // - Shortcut(ImGuiKey_S | ImGuiMod_Ctrl | ImGuiMod_Shift); // Legal
+ // - Shortcut(ImGuiMod_Ctrl); // Legal
+ // - Shortcut(ImGuiMod_Ctrl | ImGuiMod_Shift); // Not legal
+ ImGuiContext& g = *GImGui;
+ ImGuiKeyRoutingTable* rt = &g.KeysRoutingTable;
+ ImGuiKeyRoutingData* routing_data;
+ ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_);
+ ImGuiKey mods = (ImGuiKey)(key_chord & ImGuiMod_Mask_);
+ if (key == ImGuiKey_None)
+ key = ConvertSingleModFlagToKey(mods);
+ IM_ASSERT(IsNamedKey(key));
+
+ // Get (in the majority of case, the linked list will have one element so this should be 2 reads.
+ // Subsequent elements will be contiguous in memory as list is sorted/rebuilt in NewFrame).
+ for (ImGuiKeyRoutingIndex idx = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; idx != -1; idx = routing_data->NextEntryIndex)
+ {
+ routing_data = &rt->Entries[idx];
+ if (routing_data->Mods == mods)
+ return routing_data;
+ }
+
+ // Add to linked-list
+ ImGuiKeyRoutingIndex routing_data_idx = (ImGuiKeyRoutingIndex)rt->Entries.Size;
+ rt->Entries.push_back(ImGuiKeyRoutingData());
+ routing_data = &rt->Entries[routing_data_idx];
+ routing_data->Mods = (ImU16)mods;
+ routing_data->NextEntryIndex = rt->Index[key - ImGuiKey_NamedKey_BEGIN]; // Setup linked list
+ rt->Index[key - ImGuiKey_NamedKey_BEGIN] = routing_data_idx;
+ return routing_data;
+}
+
+// Current score encoding (lower is highest priority):
+// - 0: ImGuiInputFlags_RouteGlobalHigh
+// - 1: ImGuiInputFlags_RouteFocused (if item active)
+// - 2: ImGuiInputFlags_RouteGlobal
+// - 3+: ImGuiInputFlags_RouteFocused (if window in focus-stack)
+// - 254: ImGuiInputFlags_RouteGlobalLow
+// - 255: never route
+// 'flags' should include an explicit routing policy
+static int CalcRoutingScore(ImGuiWindow* location, ImGuiID owner_id, ImGuiInputFlags flags)
+{
+ if (flags & ImGuiInputFlags_RouteFocused)
+ {
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* focused = g.NavWindow;
+
+ // ActiveID gets top priority
+ // (we don't check g.ActiveIdUsingAllKeys here. Routing is applied but if input ownership is tested later it may discard it)
+ if (owner_id != 0 && g.ActiveId == owner_id)
+ return 1;
+
+ // Score based on distance to focused window (lower is better)
+ // Assuming both windows are submitting a routing request,
+ // - When Window....... is focused -> Window scores 3 (best), Window/ChildB scores 255 (no match)
+ // - When Window/ChildB is focused -> Window scores 4, Window/ChildB scores 3 (best)
+ // Assuming only WindowA is submitting a routing request,
+ // - When Window/ChildB is focused -> Window scores 4 (best), Window/ChildB doesn't have a score.
+ if (focused != NULL && focused->RootWindow == location->RootWindow)
+ for (int next_score = 3; focused != NULL; next_score++)
+ {
+ if (focused == location)
+ {
+ IM_ASSERT(next_score < 255);
+ return next_score;
+ }
+ focused = (focused->RootWindow != focused) ? focused->ParentWindow : NULL; // FIXME: This could be later abstracted as a focus path
+ }
+ return 255;
+ }
+
+ // ImGuiInputFlags_RouteGlobalHigh is default, so calls without flags are not conditional
+ if (flags & ImGuiInputFlags_RouteGlobal)
+ return 2;
+ if (flags & ImGuiInputFlags_RouteGlobalLow)
+ return 254;
+ return 0;
+}
+
+// Request a desired route for an input chord (key + mods).
+// Return true if the route is available this frame.
+// - Routes and key ownership are attributed at the beginning of next frame based on best score and mod state.
+// (Conceptually this does a "Submit for next frame" + "Test for current frame".
+// As such, it could be called TrySetXXX or SubmitXXX, or the Submit and Test operations should be separate.)
+// - Using 'owner_id == ImGuiKeyOwner_Any/0': auto-assign an owner based on current focus scope (each window has its focus scope by default)
+// - Using 'owner_id == ImGuiKeyOwner_None': allows disabling/locking a shortcut.
+bool ImGui::SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id, ImGuiInputFlags flags)
+{
+ ImGuiContext& g = *GImGui;
+ if ((flags & ImGuiInputFlags_RouteMask_) == 0)
+ flags |= ImGuiInputFlags_RouteGlobalHigh; // IMPORTANT: This is the default for SetShortcutRouting() but NOT Shortcut()
+ else
+ IM_ASSERT(ImIsPowerOfTwo(flags & ImGuiInputFlags_RouteMask_)); // Check that only 1 routing flag is used
+
+ if (flags & ImGuiInputFlags_RouteUnlessBgFocused)
+ if (g.NavWindow == NULL)
+ return false;
+ if (flags & ImGuiInputFlags_RouteAlways)
+ return true;
+
+ const int score = CalcRoutingScore(g.CurrentWindow, owner_id, flags);
+ if (score == 255)
+ return false;
+
+ // Submit routing for NEXT frame (assuming score is sufficient)
+ // FIXME: Could expose a way to use a "serve last" policy for same score resolution (using <= instead of <).
+ ImGuiKeyRoutingData* routing_data = GetShortcutRoutingData(key_chord);
+ const ImGuiID routing_id = GetRoutingIdFromOwnerId(owner_id);
+ //const bool set_route = (flags & ImGuiInputFlags_ServeLast) ? (score <= routing_data->RoutingNextScore) : (score < routing_data->RoutingNextScore);
+ if (score < routing_data->RoutingNextScore)
+ {
+ routing_data->RoutingNext = routing_id;
+ routing_data->RoutingNextScore = (ImU8)score;
+ }
+
+ // Return routing state for CURRENT frame
+ return routing_data->RoutingCurr == routing_id;
+}
+
+// Currently unused by core (but used by tests)
+// Note: this cannot be turned into GetShortcutRouting() because we do the owner_id->routing_id translation, name would be more misleading.
+bool ImGui::TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id)
+{
+ const ImGuiID routing_id = GetRoutingIdFromOwnerId(owner_id);
+ ImGuiKeyRoutingData* routing_data = GetShortcutRoutingData(key_chord);
+ return routing_data->RoutingCurr == routing_id;
+}
+
+// Note that Dear ImGui doesn't know the meaning/semantic of ImGuiKey from 0..511: they are legacy native keycodes.
+// Consider transitioning from 'IsKeyDown(MY_ENGINE_KEY_A)' (<1.87) to IsKeyDown(ImGuiKey_A) (>= 1.87)
+bool ImGui::IsKeyDown(ImGuiKey key)
+{
+ return IsKeyDown(key, ImGuiKeyOwner_Any);
+}
+
+bool ImGui::IsKeyDown(ImGuiKey key, ImGuiID owner_id)
+{
+ const ImGuiKeyData* key_data = GetKeyData(key);
+ if (!key_data->Down)
+ return false;
+ if (!TestKeyOwner(key, owner_id))
+ return false;
+ return true;
+}
+
+bool ImGui::IsKeyPressed(ImGuiKey key, bool repeat)
+{
+ return IsKeyPressed(key, ImGuiKeyOwner_Any, repeat ? ImGuiInputFlags_Repeat : ImGuiInputFlags_None);
+}
+
+// Important: unless legacy IsKeyPressed(ImGuiKey, bool repeat=true) which DEFAULT to repeat, this requires EXPLICIT repeat.
+bool ImGui::IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags)
+{
+ const ImGuiKeyData* key_data = GetKeyData(key);
+ if (!key_data->Down) // In theory this should already be encoded as (DownDuration < 0.0f), but testing this facilitates eating mechanism (until we finish work on key ownership)
+ return false;
+ const float t = key_data->DownDuration;
+ if (t < 0.0f)
+ return false;
+ IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByIsKeyPressed) == 0); // Passing flags not supported by this function!
+
+ bool pressed = (t == 0.0f);
+ if (!pressed && ((flags & ImGuiInputFlags_Repeat) != 0))
+ {
+ float repeat_delay, repeat_rate;
+ GetTypematicRepeatRate(flags, &repeat_delay, &repeat_rate);
+ pressed = (t > repeat_delay) && GetKeyPressedAmount(key, repeat_delay, repeat_rate) > 0;
+ }
+ if (!pressed)
+ return false;
+ if (!TestKeyOwner(key, owner_id))
+ return false;
+ return true;
+}
+
+bool ImGui::IsKeyReleased(ImGuiKey key)
+{
+ return IsKeyReleased(key, ImGuiKeyOwner_Any);
+}
+
+bool ImGui::IsKeyReleased(ImGuiKey key, ImGuiID owner_id)
+{
+ const ImGuiKeyData* key_data = GetKeyData(key);
+ if (key_data->DownDurationPrev < 0.0f || key_data->Down)
+ return false;
+ if (!TestKeyOwner(key, owner_id))
+ return false;
+ return true;
+}
+
+bool ImGui::IsMouseDown(ImGuiMouseButton button)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ return g.IO.MouseDown[button] && TestKeyOwner(MouseButtonToKey(button), ImGuiKeyOwner_Any); // should be same as IsKeyDown(MouseButtonToKey(button), ImGuiKeyOwner_Any), but this allows legacy code hijacking the io.Mousedown[] array.
+}
+
+bool ImGui::IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ return g.IO.MouseDown[button] && TestKeyOwner(MouseButtonToKey(button), owner_id); // Should be same as IsKeyDown(MouseButtonToKey(button), owner_id), but this allows legacy code hijacking the io.Mousedown[] array.
+}
+
+bool ImGui::IsMouseClicked(ImGuiMouseButton button, bool repeat)
+{
+ return IsMouseClicked(button, ImGuiKeyOwner_Any, repeat ? ImGuiInputFlags_Repeat : ImGuiInputFlags_None);
+}
+
+bool ImGui::IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ if (!g.IO.MouseDown[button]) // In theory this should already be encoded as (DownDuration < 0.0f), but testing this facilitates eating mechanism (until we finish work on key ownership)
+ return false;
+ const float t = g.IO.MouseDownDuration[button];
+ if (t < 0.0f)
+ return false;
+ IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByIsKeyPressed) == 0); // Passing flags not supported by this function!
+
+ const bool repeat = (flags & ImGuiInputFlags_Repeat) != 0;
+ const bool pressed = (t == 0.0f) || (repeat && t > g.IO.KeyRepeatDelay && CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay, g.IO.KeyRepeatRate) > 0);
+ if (!pressed)
+ return false;
+
+ if (!TestKeyOwner(MouseButtonToKey(button), owner_id))
+ return false;
+
+ return true;
+}
+
+bool ImGui::IsMouseReleased(ImGuiMouseButton button)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ return g.IO.MouseReleased[button] && TestKeyOwner(MouseButtonToKey(button), ImGuiKeyOwner_Any); // Should be same as IsKeyReleased(MouseButtonToKey(button), ImGuiKeyOwner_Any)
+}
+
+bool ImGui::IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ return g.IO.MouseReleased[button] && TestKeyOwner(MouseButtonToKey(button), owner_id); // Should be same as IsKeyReleased(MouseButtonToKey(button), owner_id)
+}
+
+bool ImGui::IsMouseDoubleClicked(ImGuiMouseButton button)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ return g.IO.MouseClickedCount[button] == 2 && TestKeyOwner(MouseButtonToKey(button), ImGuiKeyOwner_Any);
+}
+
+int ImGui::GetMouseClickedCount(ImGuiMouseButton button)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ return g.IO.MouseClickedCount[button];
+}
+
+// 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)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ if (lock_threshold < 0.0f)
+ lock_threshold = g.IO.MouseDragThreshold;
+ return g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold;
+}
+
+bool ImGui::IsMouseDragging(ImGuiMouseButton button, float lock_threshold)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ if (!g.IO.MouseDown[button])
+ return false;
+ return IsMouseDragPastThreshold(button, lock_threshold);
+}
+
+ImVec2 ImGui::GetMousePos()
+{
+ ImGuiContext& g = *GImGui;
+ return g.IO.MousePos;
+}
+
+// NB: prefer to call right after BeginPopup(). At the time Selectable/MenuItem is activated, the popup is already closed!
+ImVec2 ImGui::GetMousePosOnOpeningCurrentPopup()
+{
+ ImGuiContext& g = *GImGui;
+ if (g.BeginPopupStack.Size > 0)
+ return g.OpenPopupStack[g.BeginPopupStack.Size - 1].OpenMousePos;
+ return g.IO.MousePos;
+}
+
+// We typically use ImVec2(-FLT_MAX,-FLT_MAX) to denote an invalid mouse position.
+bool ImGui::IsMousePosValid(const ImVec2* mouse_pos)
+{
+ // The assert is only to silence a false-positive in XCode Static Analysis.
+ // Because GImGui is not dereferenced in every code path, the static analyzer assume that it may be NULL (which it doesn't for other functions).
+ IM_ASSERT(GImGui != NULL);
+ const float MOUSE_INVALID = -256000.0f;
+ ImVec2 p = mouse_pos ? *mouse_pos : GImGui->IO.MousePos;
+ return p.x >= MOUSE_INVALID && p.y >= MOUSE_INVALID;
+}
+
+// [WILL OBSOLETE] This was designed for backends, but prefer having backend maintain a mask of held mouse buttons, because upcoming input queue system will make this invalid.
+bool ImGui::IsAnyMouseDown()
+{
+ ImGuiContext& g = *GImGui;
+ for (int n = 0; n < IM_ARRAYSIZE(g.IO.MouseDown); n++)
+ if (g.IO.MouseDown[n])
+ return true;
+ return false;
+}
+
+// Return the delta from the initial clicking position while the mouse button is clicked or was just released.
+// This is locked and return 0.0f until the mouse moves past a distance threshold at least once.
+// NB: This is only valid if IsMousePosValid(). backends in theory should always keep mouse position valid when dragging even outside the client window.
+ImVec2 ImGui::GetMouseDragDelta(ImGuiMouseButton button, float lock_threshold)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ if (lock_threshold < 0.0f)
+ lock_threshold = g.IO.MouseDragThreshold;
+ if (g.IO.MouseDown[button] || g.IO.MouseReleased[button])
+ if (g.IO.MouseDragMaxDistanceSqr[button] >= lock_threshold * lock_threshold)
+ if (IsMousePosValid(&g.IO.MousePos) && IsMousePosValid(&g.IO.MouseClickedPos[button]))
+ return g.IO.MousePos - g.IO.MouseClickedPos[button];
+ return ImVec2(0.0f, 0.0f);
+}
+
+void ImGui::ResetMouseDragDelta(ImGuiMouseButton button)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(button >= 0 && button < IM_ARRAYSIZE(g.IO.MouseDown));
+ // NB: We don't need to reset g.IO.MouseDragMaxDistanceSqr
+ g.IO.MouseClickedPos[button] = g.IO.MousePos;
+}
+
+// Get desired mouse cursor shape.
+// Important: this is meant to be used by a platform backend, it is reset in ImGui::NewFrame(),
+// updated during the frame, and locked in EndFrame()/Render().
+// If you use software rendering by setting io.MouseDrawCursor then Dear ImGui will render those for you
+ImGuiMouseCursor ImGui::GetMouseCursor()
+{
+ ImGuiContext& g = *GImGui;
+ return g.MouseCursor;
+}
+
+void ImGui::SetMouseCursor(ImGuiMouseCursor cursor_type)
+{
+ ImGuiContext& g = *GImGui;
+ g.MouseCursor = cursor_type;
+}
+
+void ImGui::SetNextFrameWantCaptureKeyboard(bool want_capture_keyboard)
+{
+ ImGuiContext& g = *GImGui;
+ g.WantCaptureKeyboardNextFrame = want_capture_keyboard ? 1 : 0;
+}
+
+void ImGui::SetNextFrameWantCaptureMouse(bool want_capture_mouse)
+{
+ ImGuiContext& g = *GImGui;
+ g.WantCaptureMouseNextFrame = want_capture_mouse ? 1 : 0;
+}
+
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+static const char* GetInputSourceName(ImGuiInputSource source)
+{
+ const char* input_source_names[] = { "None", "Mouse", "Keyboard", "Gamepad", "Nav", "Clipboard" };
+ IM_ASSERT(IM_ARRAYSIZE(input_source_names) == ImGuiInputSource_COUNT && source >= 0 && source < ImGuiInputSource_COUNT);
+ return input_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 (%.1f, %.1f)\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; }
+}
+#endif
+
+// Process input queue
+// We always call this with the value of 'bool g.IO.ConfigInputTrickleEventQueue'.
+// - trickle_fast_inputs = false : process all events, turn into flattened input state (e.g. successive down/up/down/up will be lost)
+// - trickle_fast_inputs = true : process as many events as possible (successive down/up/down/up will be trickled over several frames so nothing is lost) (new feature in 1.87)
+void ImGui::UpdateInputEvents(bool trickle_fast_inputs)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiIO& io = g.IO;
+
+ // Only trickle chars<>key when working with InputText()
+ // FIXME: InputText() could parse event trail?
+ // FIXME: Could specialize chars<>keys trickling rules for control keys (those not typically associated to characters)
+ const bool trickle_interleaved_keys_and_text = (trickle_fast_inputs && g.WantTextInputNextFrame == 1);
+
+ bool mouse_moved = false, mouse_wheeled = false, key_changed = false, text_inputted = false;
+ int mouse_button_changed = 0x00;
+ ImBitArray<ImGuiKey_KeysData_SIZE> key_changed_mask;
+
+ int event_n = 0;
+ for (; event_n < g.InputEventsQueue.Size; event_n++)
+ {
+ ImGuiInputEvent* e = &g.InputEventsQueue[event_n];
+ if (e->Type == ImGuiInputEventType_MousePos)
+ {
+ // Trickling Rule: Stop processing queued events if we already handled a mouse button change
+ ImVec2 event_pos(e->MousePos.PosX, e->MousePos.PosY);
+ if (trickle_fast_inputs && (mouse_button_changed != 0 || mouse_wheeled || key_changed || text_inputted))
+ break;
+ io.MousePos = event_pos;
+ mouse_moved = true;
+ }
+ else if (e->Type == ImGuiInputEventType_MouseButton)
+ {
+ // Trickling Rule: Stop processing queued events if we got multiple action on the same button
+ const ImGuiMouseButton button = e->MouseButton.Button;
+ IM_ASSERT(button >= 0 && button < ImGuiMouseButton_COUNT);
+ if (trickle_fast_inputs && ((mouse_button_changed & (1 << button)) || mouse_wheeled))
+ break;
+ io.MouseDown[button] = e->MouseButton.Down;
+ mouse_button_changed |= (1 << button);
+ }
+ else if (e->Type == ImGuiInputEventType_MouseWheel)
+ {
+ // Trickling Rule: Stop processing queued events if we got multiple action on the event
+ if (trickle_fast_inputs && (mouse_moved || mouse_button_changed != 0))
+ break;
+ io.MouseWheelH += e->MouseWheel.WheelX;
+ io.MouseWheel += e->MouseWheel.WheelY;
+ mouse_wheeled = true;
+ }
+ else if (e->Type == ImGuiInputEventType_Key)
+ {
+ // Trickling Rule: Stop processing queued events if we got multiple action on the same button
+ ImGuiKey key = e->Key.Key;
+ IM_ASSERT(key != ImGuiKey_None);
+ ImGuiKeyData* key_data = GetKeyData(key);
+ const int key_data_index = (int)(key_data - g.IO.KeysData);
+ if (trickle_fast_inputs && key_data->Down != e->Key.Down && (key_changed_mask.TestBit(key_data_index) || text_inputted || mouse_button_changed != 0))
+ break;
+ key_data->Down = e->Key.Down;
+ key_data->AnalogValue = e->Key.AnalogValue;
+ 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;
+ if (io.KeyMap[key_data_index] != -1)
+ io.KeysDown[io.KeyMap[key_data_index]] = key_data->Down;
+#endif
+ }
+ else if (e->Type == ImGuiInputEventType_Text)
+ {
+ // Trickling Rule: Stop processing queued events if keys/mouse have been interacted with
+ if (trickle_fast_inputs && ((key_changed && trickle_interleaved_keys_and_text) || mouse_button_changed != 0 || mouse_moved || mouse_wheeled))
+ break;
+ unsigned int c = e->Text.Char;
+ io.InputQueueCharacters.push_back(c <= IM_UNICODE_CODEPOINT_MAX ? (ImWchar)c : IM_UNICODE_CODEPOINT_INVALID);
+ if (trickle_interleaved_keys_and_text)
+ text_inputted = true;
+ }
+ else if (e->Type == ImGuiInputEventType_Focus)
+ {
+ // We intentionally overwrite this and process in NewFrame(), in order to give a chance
+ // to multi-viewports backends to queue AddFocusEvent(false) + AddFocusEvent(true) in same frame.
+ const bool focus_lost = !e->AppFocused.Focused;
+ io.AppFocusLost = focus_lost;
+ }
+ else
+ {
+ IM_ASSERT(0 && "Unknown event!");
+ }
+ }
+
+ // Record trail (for domain-specific applications wanting to access a precise trail)
+ //if (event_n != 0) IMGUI_DEBUG_LOG_IO("Processed: %d / Remaining: %d\n", event_n, g.InputEventsQueue.Size - event_n);
+ for (int n = 0; n < event_n; n++)
+ g.InputEventsTrail.push_back(g.InputEventsQueue[n]);
+
+ // [DEBUG]
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ if (event_n != 0 && (g.DebugLogFlags & ImGuiDebugLogFlags_EventIO))
+ for (int n = 0; n < g.InputEventsQueue.Size; n++)
+ DebugPrintInputEvent(n < event_n ? "Processed" : "Remaining", &g.InputEventsQueue[n]);
+#endif
+
+ // Remaining events will be processed on the next frame
+ if (event_n == g.InputEventsQueue.Size)
+ g.InputEventsQueue.resize(0);
+ else
+ g.InputEventsQueue.erase(g.InputEventsQueue.Data, g.InputEventsQueue.Data + event_n);
+
+ // Clear buttons state when focus is lost
+ // - this is useful so e.g. releasing Alt after focus loss on Alt-Tab doesn't trigger the Alt menu toggle.
+ // - we clear in EndFrame() and not now in order allow application/user code polling this flag
+ // (e.g. custom backend may want to clear additional data, custom widgets may want to react with a "canceling" event).
+ if (g.IO.AppFocusLost)
+ g.IO.ClearInputKeys();
+}
+
+ImGuiID ImGui::GetKeyOwner(ImGuiKey key)
+{
+ if (!IsNamedKeyOrModKey(key))
+ return ImGuiKeyOwner_None;
+
+ ImGuiContext& g = *GImGui;
+ ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key);
+ ImGuiID owner_id = owner_data->OwnerCurr;
+
+ if (g.ActiveIdUsingAllKeyboardKeys && owner_id != g.ActiveId && owner_id != ImGuiKeyOwner_Any)
+ if (key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END)
+ return ImGuiKeyOwner_None;
+
+ return owner_id;
+}
+
+// TestKeyOwner(..., ID) : (owner == None || owner == ID)
+// TestKeyOwner(..., None) : (owner == None)
+// TestKeyOwner(..., Any) : no owner test
+// All paths are also testing for key not being locked, for the rare cases that key have been locked with using ImGuiInputFlags_LockXXX flags.
+bool ImGui::TestKeyOwner(ImGuiKey key, ImGuiID owner_id)
+{
+ if (!IsNamedKeyOrModKey(key))
+ return true;
+
+ ImGuiContext& g = *GImGui;
+ if (g.ActiveIdUsingAllKeyboardKeys && owner_id != g.ActiveId && owner_id != ImGuiKeyOwner_Any)
+ if (key >= ImGuiKey_Keyboard_BEGIN && key < ImGuiKey_Keyboard_END)
+ return false;
+
+ ImGuiKeyOwnerData* owner_data = GetKeyOwnerData(key);
+ if (owner_id == ImGuiKeyOwner_Any)
+ return (owner_data->LockThisFrame == false);
+
+ // Note: SetKeyOwner() sets OwnerCurr. It is not strictly required for most mouse routing overlap (because of ActiveId/HoveredId
+ // are acting as filter before this has a chance to filter), but sane as soon as user tries to look into things.
+ // Setting OwnerCurr in SetKeyOwner() is more consistent than testing OwnerNext here: would be inconsistent with getter and other functions.
+ if (owner_data->OwnerCurr != owner_id)
+ {
+ if (owner_data->LockThisFrame)
+ return false;
+ if (owner_data->OwnerCurr != ImGuiKeyOwner_None)
+ return false;
+ }
+
+ return true;
+}
+
+// _LockXXX flags are useful to lock keys away from code which is not input-owner aware.
+// When using _LockXXX flags, you can use ImGuiKeyOwner_Any to lock keys from everyone.
+// - SetKeyOwner(..., None) : clears owner
+// - SetKeyOwner(..., Any, !Lock) : illegal (assert)
+// - SetKeyOwner(..., Any or None, Lock) : set lock
+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);
+ owner_data->OwnerCurr = owner_data->OwnerNext = owner_id;
+
+ // We cannot lock by default as it would likely break lots of legacy code.
+ // In the case of using LockUntilRelease while key is not down we still lock during the frame (no key_data->Down test)
+ owner_data->LockUntilRelease = (flags & ImGuiInputFlags_LockUntilRelease) != 0;
+ owner_data->LockThisFrame = (flags & ImGuiInputFlags_LockThisFrame) != 0 || (owner_data->LockUntilRelease);
+}
+
+// This is more or less equivalent to:
+// if (IsItemHovered() || IsItemActive())
+// SetKeyOwner(key, GetItemID());
+// Extensive uses of that (e.g. many calls for a single item) may want to manually perform the tests once and then call SetKeyOwner() multiple times.
+// More advanced usage scenarios may want to call SetKeyOwner() manually based on different condition.
+// Worth noting is that only one item can be hovered and only one item can be active, therefore this usage pattern doesn't need to bother with routing and priority.
+void ImGui::SetItemKeyOwner(ImGuiKey key, ImGuiInputFlags flags)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiID id = g.LastItemData.ID;
+ if (id == 0 || (g.HoveredId != id && g.ActiveId != id))
+ return;
+ if ((flags & ImGuiInputFlags_CondMask_) == 0)
+ flags |= ImGuiInputFlags_CondDefault_;
+ if ((g.HoveredId == id && (flags & ImGuiInputFlags_CondHovered)) || (g.ActiveId == id && (flags & ImGuiInputFlags_CondActive)))
+ {
+ IM_ASSERT((flags & ~ImGuiInputFlags_SupportedBySetItemKeyOwner) == 0); // Passing flags not supported by this function!
+ SetKeyOwner(key, id, flags & ~ImGuiInputFlags_CondMask_);
+ }
+}
+
+// - 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;
+
+ // When using (owner_id == 0/Any): SetShortcutRouting() will use CurrentFocusScopeId and filter with this, so IsKeyPressed() is fine with he 0/Any.
+ if ((flags & ImGuiInputFlags_RouteMask_) == 0)
+ flags |= ImGuiInputFlags_RouteFocused;
+ if (!SetShortcutRouting(key_chord, owner_id, flags))
+ return false;
+
+ ImGuiKey key = (ImGuiKey)(key_chord & ~ImGuiMod_Mask_);
+ ImGuiKey mods = (ImGuiKey)(key_chord & ImGuiMod_Mask_);
+ if (g.IO.KeyMods != mods)
+ return false;
+
+ // Special storage location for mods
+ if (key == ImGuiKey_None)
+ key = ConvertSingleModFlagToKey(mods);
+
+ if (!IsKeyPressed(key, owner_id, (flags & (ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_))))
+ return false;
+ IM_ASSERT((flags & ~ImGuiInputFlags_SupportedByShortcut) == 0); // Passing flags not supported by this function!
+
+ return true;
+}
+
+
+//-----------------------------------------------------------------------------
// [SECTION] ERROR CHECKING
//-----------------------------------------------------------------------------
// Helper function to verify ABI compatibility between caller code and compiled version of Dear ImGui.
// Verify that the type sizes are matching between the calling file's compilation unit and imgui.cpp's compilation unit
-// If the user has inconsistent compilation settings, imgui configuration #define, packing pragma, etc. your user code
-// may see different structures than what imgui.cpp sees, which is problematic.
-// We usually require settings to be in imconfig.h to make sure that they are accessible to all compilation units involved with Dear ImGui.
+// If this triggers you have an issue:
+// - Most commonly: mismatched headers and compiled code version.
+// - Or: mismatched configuration #define, compilation settings, packing pragma etc.
+// The configuration settings mentioned in imconfig.h must be set for all compilation units involved with Dear ImGui,
+// which is way it is required you put them in your imconfig file (and not just before including imgui.h).
+// Otherwise it is possible that different compilation units would see different structure layout
bool ImGui::DebugCheckVersionAndDataLayout(const char* version, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_vert, size_t sz_idx)
{
bool error = false;
@@ -7263,6 +8686,38 @@ bool ImGui::DebugCheckVersionAndDataLayout(const char* version, size_t sz_io, si
return !error;
}
+// Until 1.89 (IMGUI_VERSION_NUM < 18814) it was legal to use SetCursorPos() to extend the boundary of a parent (e.g. window or table cell)
+// This is causing issues and ambiguity and we need to retire that.
+// See https://github.com/ocornut/imgui/issues/5548 for more details.
+// [Scenario 1]
+// Previously this would make the window content size ~200x200:
+// Begin(...) + SetCursorScreenPos(GetCursorScreenPos() + ImVec2(200,200)) + End(); // NOT OK
+// Instead, please submit an item:
+// Begin(...) + SetCursorScreenPos(GetCursorScreenPos() + ImVec2(200,200)) + Dummy(ImVec2(0,0)) + End(); // OK
+// Alternative:
+// Begin(...) + Dummy(ImVec2(200,200)) + End(); // OK
+// [Scenario 2]
+// For reference this is one of the issue what we aim to fix with this change:
+// BeginGroup() + SomeItem("foobar") + SetCursorScreenPos(GetCursorScreenPos()) + EndGroup()
+// The previous logic made SetCursorScreenPos(GetCursorScreenPos()) have a side-effect! It would erroneously incorporate ItemSpacing.y after the item into content size, making the group taller!
+// While this code is a little twisted, no-one would expect SetXXX(GetXXX()) to have a side-effect. Using vertical alignment patterns could trigger this issue.
+void ImGui::ErrorCheckUsingSetCursorPosToExtendParentBoundaries()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ IM_ASSERT(window->DC.IsSetPos);
+ window->DC.IsSetPos = false;
+#ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ if (window->DC.CursorPos.x <= window->DC.CursorMaxPos.x && window->DC.CursorPos.y <= window->DC.CursorMaxPos.y)
+ return;
+ if (window->SkipItems)
+ return;
+ IM_ASSERT(0 && "Code uses SetCursorPos()/SetCursorScreenPos() to extend window/parent boundaries. Please submit an item e.g. Dummy() to validate extent.");
+#else
+ window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos);
+#endif
+}
+
static void ImGui::ErrorCheckNewFrameSanityChecks()
{
ImGuiContext& g = *GImGui;
@@ -7283,16 +8738,19 @@ static void ImGui::ErrorCheckNewFrameSanityChecks()
IM_ASSERT(g.IO.DisplaySize.x >= 0.0f && g.IO.DisplaySize.y >= 0.0f && "Invalid DisplaySize value!");
IM_ASSERT(g.IO.Fonts->IsBuilt() && "Font Atlas not built! Make sure you called ImGui_ImplXXXX_NewFrame() function for renderer backend, which should call io.Fonts->GetTexDataAsRGBA32() / GetTexDataAsAlpha8()");
IM_ASSERT(g.Style.CurveTessellationTol > 0.0f && "Invalid style setting!");
- IM_ASSERT(g.Style.CircleTessellationMaxError > 0.0f && "Invalid style setting!");
+ IM_ASSERT(g.Style.CircleTessellationMaxError > 0.0f && "Invalid style setting!");
IM_ASSERT(g.Style.Alpha >= 0.0f && g.Style.Alpha <= 1.0f && "Invalid style setting!"); // Allows us to avoid a few clamps in color computations
IM_ASSERT(g.Style.WindowMinSize.x >= 1.0f && g.Style.WindowMinSize.y >= 1.0f && "Invalid style setting.");
IM_ASSERT(g.Style.WindowMenuButtonPosition == ImGuiDir_None || g.Style.WindowMenuButtonPosition == ImGuiDir_Left || g.Style.WindowMenuButtonPosition == ImGuiDir_Right);
- for (int n = 0; n < ImGuiKey_COUNT; n++)
- IM_ASSERT(g.IO.KeyMap[n] >= -1 && g.IO.KeyMap[n] < IM_ARRAYSIZE(g.IO.KeysDown) && "io.KeyMap[] contains an out of bound value (need to be 0..512, or -1 for unmapped key)");
+ IM_ASSERT(g.Style.ColorButtonPosition == ImGuiDir_Left || g.Style.ColorButtonPosition == ImGuiDir_Right);
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
+ for (int n = ImGuiKey_NamedKey_BEGIN; n < ImGuiKey_COUNT; n++)
+ IM_ASSERT(g.IO.KeyMap[n] >= -1 && g.IO.KeyMap[n] < ImGuiKey_LegacyNativeKey_END && "io.KeyMap[] contains an out of bound value (need to be 0..511, or -1 for unmapped key)");
// Check: required key mapping (we intentionally do NOT check all keys to not pressure user into setting up everything, but Space is required and was only added in 1.60 WIP)
- if (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard)
+ if ((g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) && g.IO.BackendUsingLegacyKeyArrays == 1)
IM_ASSERT(g.IO.KeyMap[ImGuiKey_Space] != -1 && "ImGuiKey_Space is not mapped, required for keyboard navigation.");
+#endif
// Check: the io.ConfigWindowsResizeFromEdges option requires backend to honor mouse cursor changes and set the ImGuiBackendFlags_HasMouseCursors flag accordingly.
if (g.IO.ConfigWindowsResizeFromEdges && !(g.IO.BackendFlags & ImGuiBackendFlags_HasMouseCursors))
@@ -7309,11 +8767,11 @@ static void ImGui::ErrorCheckEndFrameSanityChecks()
// 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),
// while still correctly asserting on mid-frame key press events.
- const ImGuiKeyModFlags key_mod_flags = GetMergedKeyModFlags();
- IM_ASSERT((key_mod_flags == 0 || g.IO.KeyMods == key_mod_flags) && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods");
- IM_UNUSED(key_mod_flags);
+ const ImGuiKeyChord key_mods = GetMergedModsFromBools();
+ 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);
- // Recover from errors
+ // [EXPERIMENTAL] Recover from errors: You may call this yourself before EndFrame().
//ErrorCheckEndFrameRecover();
// Report when there is a mismatch of Begin/BeginChild vs End/EndChild calls. Important: Remember that the Begin/BeginChild API requires you
@@ -7353,7 +8811,6 @@ void ImGui::ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, voi
IM_ASSERT(window->IsFallbackWindow);
break;
}
- IM_ASSERT(window == g.CurrentWindow);
if (window->Flags & ImGuiWindowFlags_ChildWindow)
{
if (log_callback) log_callback(user_data, "Recovered from missing EndChild() for '%s'", window->Name);
@@ -7420,7 +8877,7 @@ void ImGui::ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, vo
if (log_callback) log_callback(user_data, "Recovered from missing PopStyleVar() in '%s'", window->Name);
PopStyleVar();
}
- while (g.FocusScopeStack.Size > stack_sizes->SizeOfFocusScopeStack) //-V1044
+ while (g.FocusScopeStack.Size > stack_sizes->SizeOfFocusScopeStack + 1) //-V1044
{
if (log_callback) log_callback(user_data, "Recovered from missing PopFocusScope() in '%s'", window->Name);
PopFocusScope();
@@ -7496,7 +8953,7 @@ void ImGuiStackSizes::CompareWithCurrentState()
// - GetWindowContentRegionMin(), GetWindowContentRegionMax()
// - BeginGroup()
// - EndGroup()
-// Also see in imgui_widgets: tab bars, columns.
+// Also see in imgui_widgets: tab bars, and in imgui_tables: tables, columns.
//-----------------------------------------------------------------------------
// Advance cursor given item size for layout.
@@ -7513,14 +8970,16 @@ void ImGui::ItemSize(const ImVec2& size, float text_baseline_y)
// In theory we should be offsetting the starting position (window->DC.CursorPos), that will be the topic of a larger refactor,
// but since ItemSize() is not yet an API that moves the cursor (to handle e.g. wrapping) enlarging the height has the same effect.
const float offset_to_match_baseline_y = (text_baseline_y >= 0) ? ImMax(0.0f, window->DC.CurrLineTextBaseOffset - text_baseline_y) : 0.0f;
- const float line_height = ImMax(window->DC.CurrLineSize.y, size.y + offset_to_match_baseline_y);
+
+ const float line_y1 = window->DC.IsSameLine ? window->DC.CursorPosPrevLine.y : window->DC.CursorPos.y;
+ const float line_height = ImMax(window->DC.CurrLineSize.y, /*ImMax(*/window->DC.CursorPos.y - line_y1/*, 0.0f)*/ + size.y + offset_to_match_baseline_y);
// Always align ourselves on pixel boundaries
//if (g.IO.KeyAlt) window->DrawList->AddRect(window->DC.CursorPos, window->DC.CursorPos + ImVec2(size.x, line_height), IM_COL32(255,0,0,200)); // [DEBUG]
window->DC.CursorPosPrevLine.x = window->DC.CursorPos.x + size.x;
- window->DC.CursorPosPrevLine.y = window->DC.CursorPos.y;
+ 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(window->DC.CursorPos.y + 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]
@@ -7529,17 +8988,13 @@ void ImGui::ItemSize(const ImVec2& size, float text_baseline_y)
window->DC.CurrLineSize.y = 0.0f;
window->DC.PrevLineTextBaseOffset = ImMax(window->DC.CurrLineTextBaseOffset, text_baseline_y);
window->DC.CurrLineTextBaseOffset = 0.0f;
+ window->DC.IsSameLine = window->DC.IsSetPos = false;
// Horizontal layout mode
if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
SameLine();
}
-void ImGui::ItemSize(const ImRect& bb, float text_baseline_y)
-{
- ItemSize(bb.GetSize(), text_baseline_y);
-}
-
// Declare item bounding box for clipping and interaction.
// Note that the size can be different than the one provided to ItemSize(). Typically, widgets that spread over available surface
// declare their minimum size requirement to ItemSize() and provide a larger region to ItemAdd() which is used drawing/interaction.
@@ -7559,6 +9014,8 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
// Directional navigation processing
if (id != 0)
{
+ KeepAliveID(id);
+
// Runs prior to clipping early-out
// (a) So that NavInitRequest can be honored, for newly opened windows to select a default widget
// (b) So that we can scroll up/down past clipped items. This adds a small O(N) cost to regular navigation requests
@@ -7568,20 +9025,19 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
// to reach unclipped widgets. This would work if user had explicit scrolling control (e.g. mapped on a stick).
// We intentionally don't check if g.NavWindow != NULL because g.NavAnyRequest should only be set when it is non null.
// If we crash on a NULL g.NavWindow we need to fix the bug elsewhere.
- window->DC.NavLayersActiveMaskNext |= (1 << window->DC.NavLayerCurrent);
- if (g.NavId == id || g.NavAnyRequest)
- if (g.NavWindow->RootWindowForNav == window->RootWindowForNav)
- if (window == g.NavWindow || ((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened))
- NavProcessItem();
-
- // [DEBUG] Item Picker tool, when enabling the "extended" version we perform the check in ItemAdd()
-#ifdef IMGUI_DEBUG_TOOL_ITEM_PICKER_EX
- if (id == g.DebugItemPickerBreakId)
+ if (!(g.LastItemData.InFlags & ImGuiItemFlags_NoNav))
{
- IM_DEBUG_BREAK();
- g.DebugItemPickerBreakId = 0;
+ window->DC.NavLayersActiveMaskNext |= (1 << window->DC.NavLayerCurrent);
+ if (g.NavId == id || g.NavAnyRequest)
+ if (g.NavWindow->RootWindowForNav == window->RootWindowForNav)
+ if (window == g.NavWindow || ((window->Flags | g.NavWindow->Flags) & ImGuiWindowFlags_NavFlattened))
+ NavProcessItem();
}
-#endif
+
+ // [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
+ 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;
@@ -7591,17 +9047,26 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
#endif
// Clipping test
- const bool is_clipped = IsClippedEx(bb, id);
- if (is_clipped)
- return false;
- //if (g.IO.KeyAlt) window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255,255,0,120)); // [DEBUG]
+ // (FIXME: This is a modified copy of IsClippedEx() so we can reuse the is_rect_visible value)
+ //const bool is_clipped = IsClippedEx(bb, id);
+ //if (is_clipped)
+ // 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 (!g.LogEnabled)
+ return false;
- // [WIP] Tab stop handling (previously was using internal FocusableItemRegister() api)
- // FIXME-NAV: We would now want to move this before the clipping test, but this would require being able to scroll and currently this would mean an extra frame. (#4079, #343)
- if (extra_flags & ImGuiItemFlags_Inputable)
- ItemInputable(window, id);
+ // [DEBUG]
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ if (id != 0 && id == g.DebugLocateId)
+ DebugLocateItemResolveWithLastItem();
+#endif
+ //if (g.IO.KeyAlt) window->DrawList->AddRect(bb.Min, bb.Max, IM_COL32(255,255,0,120)); // [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)
+ g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_Visible;
if (IsMouseHoveringRect(bb.Min, bb.Max))
g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredRect;
return true;
@@ -7614,25 +9079,28 @@ bool ImGui::ItemAdd(const ImRect& bb, ImGuiID id, const ImRect* nav_bb_arg, ImGu
// spacing_w >= 0 : enforce spacing amount
void ImGui::SameLine(float offset_from_start_x, float spacing_w)
{
- ImGuiWindow* window = GetCurrentWindow();
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
if (window->SkipItems)
return;
- ImGuiContext& g = *GImGui;
if (offset_from_start_x != 0.0f)
{
- if (spacing_w < 0.0f) spacing_w = 0.0f;
+ if (spacing_w < 0.0f)
+ spacing_w = 0.0f;
window->DC.CursorPos.x = window->Pos.x - window->Scroll.x + offset_from_start_x + spacing_w + window->DC.GroupOffset.x + window->DC.ColumnsOffset.x;
window->DC.CursorPos.y = window->DC.CursorPosPrevLine.y;
}
else
{
- if (spacing_w < 0.0f) spacing_w = g.Style.ItemSpacing.x;
+ if (spacing_w < 0.0f)
+ spacing_w = g.Style.ItemSpacing.x;
window->DC.CursorPos.x = window->DC.CursorPosPrevLine.x + spacing_w;
window->DC.CursorPos.y = window->DC.CursorPosPrevLine.y;
}
window->DC.CurrLineSize = window->DC.PrevLineSize;
window->DC.CurrLineTextBaseOffset = window->DC.PrevLineTextBaseOffset;
+ window->DC.IsSameLine = true;
}
ImVec2 ImGui::GetCursorScreenPos()
@@ -7641,11 +9109,15 @@ ImVec2 ImGui::GetCursorScreenPos()
return window->DC.CursorPos;
}
+// 2022/08/05: Setting cursor position also extend boundaries (via modifying CursorMaxPos) used to compute window size, group size etc.
+// I believe this was is a judicious choice but it's probably being relied upon (it has been the case since 1.31 and 1.50)
+// It would be sane if we requested user to use SetCursorPos() + Dummy(ImVec2(0,0)) to extend CursorMaxPos...
void ImGui::SetCursorScreenPos(const ImVec2& pos)
{
ImGuiWindow* window = GetCurrentWindow();
window->DC.CursorPos = pos;
- window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos);
+ //window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos);
+ window->DC.IsSetPos = true;
}
// User generally sees positions in window coordinates. Internally we store CursorPos in absolute screen coordinates because it is more convenient.
@@ -7672,21 +9144,24 @@ void ImGui::SetCursorPos(const ImVec2& local_pos)
{
ImGuiWindow* window = GetCurrentWindow();
window->DC.CursorPos = window->Pos - window->Scroll + local_pos;
- window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos);
+ //window->DC.CursorMaxPos = ImMax(window->DC.CursorMaxPos, window->DC.CursorPos);
+ window->DC.IsSetPos = true;
}
void ImGui::SetCursorPosX(float x)
{
ImGuiWindow* window = GetCurrentWindow();
window->DC.CursorPos.x = window->Pos.x - window->Scroll.x + x;
- window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPos.x);
+ //window->DC.CursorMaxPos.x = ImMax(window->DC.CursorMaxPos.x, window->DC.CursorPos.x);
+ window->DC.IsSetPos = true;
}
void ImGui::SetCursorPosY(float y)
{
ImGuiWindow* window = GetCurrentWindow();
window->DC.CursorPos.y = window->Pos.y - window->Scroll.y + y;
- window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y);
+ //window->DC.CursorMaxPos.y = ImMax(window->DC.CursorMaxPos.y, window->DC.CursorPos.y);
+ window->DC.IsSetPos = true;
}
ImVec2 ImGui::GetCursorStartPos()
@@ -7777,7 +9252,8 @@ float ImGui::CalcItemWidth()
// The 4.0f here may be changed to match CalcItemWidth() and/or BeginChild() (right now we have a mismatch which is harmless but undesirable)
ImVec2 ImGui::CalcItemSize(ImVec2 size, float default_w, float default_h)
{
- ImGuiWindow* window = GImGui->CurrentWindow;
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
ImVec2 region_max;
if (size.x < 0.0f || size.y < 0.0f)
@@ -7902,6 +9378,9 @@ void ImGui::EndGroup()
ImGuiGroupData& group_data = g.GroupStack.back();
IM_ASSERT(group_data.WindowID == window->ID); // EndGroup() in wrong window?
+ if (window->DC.IsSetPos)
+ ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
+
ImRect group_bb(group_data.BackupCursorPos, ImMax(window->DC.CursorMaxPos, group_data.BackupCursorPos));
window->DC.CursorPos = group_data.BackupCursorPos;
@@ -7921,10 +9400,10 @@ void ImGui::EndGroup()
window->DC.CurrLineTextBaseOffset = ImMax(window->DC.PrevLineTextBaseOffset, group_data.BackupCurrLineTextBaseOffset); // FIXME: Incorrect, we should grab the base offset from the *first line* of the group but it is hard to obtain now.
ItemSize(group_bb.GetSize());
- ItemAdd(group_bb, 0);
+ ItemAdd(group_bb, 0, NULL, ImGuiItemFlags_NoTabStop);
// If the current ActiveId was declared within the boundary of our group, we copy it to LastItemId so IsItemActive(), IsItemDeactivated() etc. will be functional on the entire group.
- // It would be be neater if we replaced window.DC.LastItemId by e.g. 'bool LastItemIsActive', but would put a little more burden on individual widgets.
+ // It would be neater if we replaced window.DC.LastItemId by e.g. 'bool LastItemIsActive', but would put a little more burden on individual widgets.
// Also if you grep for LastItemId you'll notice it is only used in that context.
// (The two tests not the same because ActiveIdIsAlive is an ID itself, in order to be able to handle ActiveId being overwritten during the frame.)
const bool group_contains_curr_active_id = (group_data.BackupActiveIdIsAlive != g.ActiveId) && (g.ActiveIdIsAlive == g.ActiveId) && g.ActiveId;
@@ -8010,32 +9489,80 @@ static ImVec2 CalcNextScrollFromScrollTargetAndClamp(ImGuiWindow* window)
return scroll;
}
+void ImGui::ScrollToItem(ImGuiScrollFlags flags)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ ScrollToRectEx(window, g.LastItemData.NavRect, flags);
+}
+
+void ImGui::ScrollToRect(ImGuiWindow* window, const ImRect& item_rect, ImGuiScrollFlags flags)
+{
+ ScrollToRectEx(window, item_rect, flags);
+}
+
// Scroll to keep newly navigated item fully into view
-ImVec2 ImGui::ScrollToBringRectIntoView(ImGuiWindow* window, const ImRect& item_rect)
+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]
- ImVec2 delta_scroll;
- if (!window_rect.Contains(item_rect))
+ // Check that only one behavior is selected per axis
+ IM_ASSERT((flags & ImGuiScrollFlags_MaskX_) == 0 || ImIsPowerOfTwo(flags & ImGuiScrollFlags_MaskX_));
+ IM_ASSERT((flags & ImGuiScrollFlags_MaskY_) == 0 || ImIsPowerOfTwo(flags & ImGuiScrollFlags_MaskY_));
+
+ // Defaults
+ ImGuiScrollFlags in_flags = flags;
+ if ((flags & ImGuiScrollFlags_MaskX_) == 0 && window->ScrollbarX)
+ flags |= ImGuiScrollFlags_KeepVisibleEdgeX;
+ 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();
+
+ if ((flags & ImGuiScrollFlags_KeepVisibleEdgeX) && !fully_visible_x)
{
- if (window->ScrollbarX && item_rect.Min.x < window_rect.Min.x)
- SetScrollFromPosX(window, item_rect.Min.x - window->Pos.x - g.Style.ItemSpacing.x, 0.0f);
- else if (window->ScrollbarX && item_rect.Max.x >= window_rect.Max.x)
- SetScrollFromPosX(window, item_rect.Max.x - window->Pos.x + g.Style.ItemSpacing.x, 1.0f);
- if (item_rect.Min.y < window_rect.Min.y)
- SetScrollFromPosY(window, item_rect.Min.y - window->Pos.y - g.Style.ItemSpacing.y, 0.0f);
- else if (item_rect.Max.y >= window_rect.Max.y)
- SetScrollFromPosY(window, item_rect.Max.y - window->Pos.y + g.Style.ItemSpacing.y, 1.0f);
+ if (item_rect.Min.x < window_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)
+ 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);
+ }
- ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window);
- delta_scroll = next_scroll - window->Scroll;
+ if ((flags & ImGuiScrollFlags_KeepVisibleEdgeY) && !fully_visible_y)
+ {
+ if (item_rect.Min.y < window_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)
+ 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);
+ }
+
+ ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window);
+ ImVec2 delta_scroll = next_scroll - window->Scroll;
// Also scroll parent window to keep us into view if necessary
- if (window->Flags & ImGuiWindowFlags_ChildWindow)
- delta_scroll += ScrollToBringRectIntoView(window->ParentWindow, ImRect(item_rect.Min - delta_scroll, item_rect.Max - delta_scroll));
+ if (!(flags & ImGuiScrollFlags_NoScrollParent) && (window->Flags & ImGuiWindowFlags_ChildWindow))
+ {
+ // FIXME-SCROLL: May be an option?
+ if ((in_flags & (ImGuiScrollFlags_AlwaysCenterX | ImGuiScrollFlags_KeepVisibleCenterX)) != 0)
+ in_flags = (in_flags & ~ImGuiScrollFlags_MaskX_) | ImGuiScrollFlags_KeepVisibleEdgeX;
+ if ((in_flags & (ImGuiScrollFlags_AlwaysCenterY | ImGuiScrollFlags_KeepVisibleCenterY)) != 0)
+ in_flags = (in_flags & ~ImGuiScrollFlags_MaskY_) | ImGuiScrollFlags_KeepVisibleEdgeY;
+ delta_scroll += ScrollToRectEx(window->ParentWindow, ImRect(item_rect.Min - delta_scroll, item_rect.Max - delta_scroll), in_flags);
+ }
return delta_scroll;
}
@@ -8095,7 +9622,7 @@ void ImGui::SetScrollY(float scroll_y)
// - local_pos = (absolution_pos - window->Pos)
// - So local_x/local_y are 0.0f for a position at the upper-left corner of a window,
// and generally local_x/local_y are >(padding+decoration) && <(size-padding-decoration) when in the visible area.
-// - They mostly exists because of legacy API.
+// - They mostly exist because of legacy API.
// Following the rules above, when trying to work with scrolling code, consider that:
// - SetScrollFromPosY(0.0f) == SetScrollY(0.0f + scroll.y) == has no effect!
// - SetScrollFromPosY(-scroll.y) == SetScrollY(-scroll.y + scroll.y) == SetScrollY(0.0f) == reset scroll. Of course writing SetScrollY(0.0f) directly then makes more sense
@@ -8162,10 +9689,10 @@ void ImGui::SetScrollHereY(float center_y_ratio)
void ImGui::BeginTooltip()
{
- BeginTooltipEx(ImGuiWindowFlags_None, ImGuiTooltipFlags_None);
+ BeginTooltipEx(ImGuiTooltipFlags_None, ImGuiWindowFlags_None);
}
-void ImGui::BeginTooltipEx(ImGuiWindowFlags extra_flags, ImGuiTooltipFlags tooltip_flags)
+void ImGui::BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags)
{
ImGuiContext& g = *GImGui;
@@ -8194,7 +9721,7 @@ void ImGui::BeginTooltipEx(ImGuiWindowFlags extra_flags, ImGuiTooltipFlags toolt
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_flags);
+ Begin(window_name, NULL, flags | extra_window_flags);
}
void ImGui::EndTooltip()
@@ -8205,7 +9732,7 @@ void ImGui::EndTooltip()
void ImGui::SetTooltipV(const char* fmt, va_list args)
{
- BeginTooltipEx(0, ImGuiTooltipFlags_OverridePreviousTooltip);
+ BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None);
TextV(fmt, args);
EndTooltip();
}
@@ -8273,10 +9800,22 @@ ImGuiWindow* ImGui::GetTopMostPopupModal()
return NULL;
}
+ImGuiWindow* ImGui::GetTopMostAndVisiblePopupModal()
+{
+ ImGuiContext& g = *GImGui;
+ for (int n = g.OpenPopupStack.Size - 1; n >= 0; n--)
+ if (ImGuiWindow* popup = g.OpenPopupStack.Data[n].Window)
+ if ((popup->Flags & ImGuiWindowFlags_Modal) && IsWindowActiveAndVisible(popup))
+ return popup;
+ return NULL;
+}
+
void ImGui::OpenPopup(const char* str_id, ImGuiPopupFlags popup_flags)
{
ImGuiContext& g = *GImGui;
- OpenPopupEx(g.CurrentWindow->GetID(str_id), popup_flags);
+ ImGuiID id = g.CurrentWindow->GetID(str_id);
+ IMGUI_DEBUG_LOG_POPUP("[popup] OpenPopup(\"%s\" -> 0x%08X\n", str_id, id);
+ OpenPopupEx(id, popup_flags);
}
void ImGui::OpenPopup(ImGuiID id, ImGuiPopupFlags popup_flags)
@@ -8301,13 +9840,13 @@ void ImGui::OpenPopupEx(ImGuiID id, ImGuiPopupFlags popup_flags)
ImGuiPopupData popup_ref; // Tagged as new ref as Window will be set back to NULL if we write this into OpenPopupStack.
popup_ref.PopupId = id;
popup_ref.Window = NULL;
- popup_ref.SourceWindow = g.NavWindow;
+ popup_ref.BackupNavWindow = g.NavWindow; // When popup closes focus may be restored to NavWindow (depend on window type).
popup_ref.OpenFrameCount = g.FrameCount;
popup_ref.OpenParentId = parent_window->IDStack.back();
popup_ref.OpenPopupPos = NavCalcPreferredRefPos();
popup_ref.OpenMousePos = IsMousePosValid(&g.IO.MousePos) ? g.IO.MousePos : popup_ref.OpenPopupPos;
- IMGUI_DEBUG_LOG_POPUP("OpenPopupEx(0x%08X)\n", id);
+ IMGUI_DEBUG_LOG_POPUP("[popup] OpenPopupEx(0x%08X)\n", id);
if (g.OpenPopupStack.Size < current_stack_size + 1)
{
g.OpenPopupStack.push_back(popup_ref);
@@ -8365,7 +9904,7 @@ void ImGui::ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to
bool ref_window_is_descendent_of_popup = false;
for (int n = popup_count_to_keep; n < g.OpenPopupStack.Size; n++)
if (ImGuiWindow* popup_window = g.OpenPopupStack[n].Window)
- if (popup_window->RootWindow == ref_window->RootWindow)
+ if (IsWindowWithinBeginStackOf(ref_window, popup_window))
{
ref_window_is_descendent_of_popup = true;
break;
@@ -8376,7 +9915,7 @@ void ImGui::ClosePopupsOverWindow(ImGuiWindow* ref_window, bool restore_focus_to
}
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
{
- IMGUI_DEBUG_LOG_POPUP("ClosePopupsOverWindow(\"%s\") -> ClosePopupToLevel(%d)\n", ref_window->Name, popup_count_to_keep);
+ IMGUI_DEBUG_LOG_POPUP("[popup] ClosePopupsOverWindow(\"%s\")\n", ref_window ? ref_window->Name : "<NULL>");
ClosePopupToLevel(popup_count_to_keep, restore_focus_to_window_under_popup);
}
}
@@ -8399,16 +9938,17 @@ void ImGui::ClosePopupsExceptModals()
void ImGui::ClosePopupToLevel(int remaining, bool restore_focus_to_window_under_popup)
{
ImGuiContext& g = *GImGui;
- IMGUI_DEBUG_LOG_POPUP("ClosePopupToLevel(%d), restore_focus_to_window_under_popup=%d\n", remaining, restore_focus_to_window_under_popup);
+ IMGUI_DEBUG_LOG_POPUP("[popup] ClosePopupToLevel(%d), restore_focus_to_window_under_popup=%d\n", remaining, restore_focus_to_window_under_popup);
IM_ASSERT(remaining >= 0 && remaining < g.OpenPopupStack.Size);
// Trim open popup stack
- ImGuiWindow* focus_window = g.OpenPopupStack[remaining].SourceWindow;
ImGuiWindow* popup_window = g.OpenPopupStack[remaining].Window;
+ ImGuiWindow* popup_backup_nav_window = g.OpenPopupStack[remaining].BackupNavWindow;
g.OpenPopupStack.resize(remaining);
if (restore_focus_to_window_under_popup)
{
+ 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
@@ -8438,13 +9978,13 @@ void ImGui::CloseCurrentPopup()
ImGuiWindow* parent_popup_window = g.OpenPopupStack[popup_idx - 1].Window;
bool close_parent = false;
if (popup_window && (popup_window->Flags & ImGuiWindowFlags_ChildMenu))
- if (parent_popup_window == NULL || !(parent_popup_window->Flags & ImGuiWindowFlags_Modal))
+ if (parent_popup_window && !(parent_popup_window->Flags & ImGuiWindowFlags_MenuBar))
close_parent = true;
if (!close_parent)
break;
popup_idx--;
}
- IMGUI_DEBUG_LOG_POPUP("CloseCurrentPopup %d -> %d\n", g.BeginPopupStack.Size - 1, popup_idx);
+ IMGUI_DEBUG_LOG_POPUP("[popup] CloseCurrentPopup %d -> %d\n", g.BeginPopupStack.Size - 1, popup_idx);
ClosePopupToLevel(popup_idx, true);
// A common pattern is to close a popup when selecting a menu item/selectable that will open another window.
@@ -8466,7 +10006,7 @@ bool ImGui::BeginPopupEx(ImGuiID id, ImGuiWindowFlags flags)
char name[20];
if (flags & ImGuiWindowFlags_ChildMenu)
- ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.BeginPopupStack.Size); // Recycle windows based on depth
+ ImFormatString(name, IM_ARRAYSIZE(name), "##Menu_%02d", g.BeginMenuCount); // Recycle windows based on depth
else
ImFormatString(name, IM_ARRAYSIZE(name), "##Popup_%08x", id); // Not recycling, so we can close/open during the same frame
@@ -8487,7 +10027,8 @@ bool ImGui::BeginPopup(const char* str_id, ImGuiWindowFlags flags)
return false;
}
flags |= ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings;
- return BeginPopupEx(g.CurrentWindow->GetID(str_id), flags);
+ ImGuiID id = g.CurrentWindow->GetID(str_id);
+ return BeginPopupEx(id, flags);
}
// If 'p_open' is specified for a modal popup window, the popup will have a regular close button which will close the popup.
@@ -8566,7 +10107,7 @@ void ImGui::OpenPopupOnItemClick(const char* str_id, ImGuiPopupFlags popup_flags
// - You may want to handle the whole on user side if you have specific needs (e.g. tweaking IsItemHovered() parameters).
// This is essentially the same as:
// id = str_id ? GetID(str_id) : GetItemID();
-// OpenPopupOnItemClick(str_id);
+// OpenPopupOnItemClick(str_id, ImGuiPopupFlags_MouseButtonRight);
// return BeginPopup(id);
// Which is essentially the same as:
// id = str_id ? GetID(str_id) : GetItemID();
@@ -8662,7 +10203,7 @@ ImVec2 ImGui::FindBestWindowPosForPopupEx(const ImVec2& ref_pos, const ImVec2& s
const float avail_w = (dir == ImGuiDir_Left ? r_avoid.Min.x : r_outer.Max.x) - (dir == ImGuiDir_Right ? r_avoid.Max.x : r_outer.Min.x);
const float avail_h = (dir == ImGuiDir_Up ? r_avoid.Min.y : r_outer.Max.y) - (dir == ImGuiDir_Down ? r_avoid.Max.y : r_outer.Min.y);
- // If there not enough room on one axis, there's no point in positioning on a side on this axis (e.g. when not enough width, use a top/bottom position to maximize available width)
+ // If there's not enough room on one axis, there's no point in positioning on a side on this axis (e.g. when not enough width, use a top/bottom position to maximize available width)
if (avail_w < size.x && (dir == ImGuiDir_Left || dir == ImGuiDir_Right))
continue;
if (avail_h < size.y && (dir == ImGuiDir_Up || dir == ImGuiDir_Down))
@@ -8727,8 +10268,7 @@ ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window)
}
if (window->Flags & ImGuiWindowFlags_Popup)
{
- ImRect r_avoid = ImRect(window->Pos.x - 1, window->Pos.y - 1, window->Pos.x + 1, window->Pos.y + 1);
- return FindBestWindowPosForPopupEx(window->Pos, window->Size, &window->AutoPosLastDirection, r_outer, r_avoid, ImGuiPopupPositionPolicy_Default);
+ return FindBestWindowPosForPopupEx(window->Pos, window->Size, &window->AutoPosLastDirection, r_outer, ImRect(window->Pos, window->Pos), ImGuiPopupPositionPolicy_Default); // Ideally we'd disable r_avoid here
}
if (window->Flags & ImGuiWindowFlags_Tooltip)
{
@@ -8750,8 +10290,22 @@ ImVec2 ImGui::FindBestWindowPosForPopup(ImGuiWindow* window)
// [SECTION] KEYBOARD/GAMEPAD NAVIGATION
//-----------------------------------------------------------------------------
-// FIXME-NAV: The existence of SetNavID vs SetFocusID properly needs to be clarified/reworked.
-// In our terminology those should be interchangeable. Those two functions are merely a legacy artifact, so at minimum naming should be clarified.
+// FIXME-NAV: The existence of SetNavID vs SetFocusID vs FocusWindow() needs to be clarified/reworked.
+// In our terminology those should be interchangeable, yet right now this is super confusing.
+// Those two functions are merely a legacy artifact, so at minimum naming should be clarified.
+
+void ImGui::SetNavWindow(ImGuiWindow* window)
+{
+ ImGuiContext& g = *GImGui;
+ if (g.NavWindow != window)
+ {
+ IMGUI_DEBUG_LOG_FOCUS("[focus] SetNavWindow(\"%s\")\n", window ? window->Name : "<NULL>");
+ g.NavWindow = window;
+ }
+ g.NavInitRequest = g.NavMoveSubmitted = g.NavMoveScoringItems = false;
+ NavUpdateAnyRequestFlag();
+}
+
void ImGui::SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id, const ImRect& rect_rel)
{
ImGuiContext& g = *GImGui;
@@ -8762,8 +10316,6 @@ void ImGui::SetNavID(ImGuiID id, ImGuiNavLayer nav_layer, ImGuiID focus_scope_id
g.NavFocusScopeId = focus_scope_id;
g.NavWindow->NavLastIds[nav_layer] = id;
g.NavWindow->NavRectRel[nav_layer] = rect_rel;
- //g.NavDisableHighlight = false;
- //g.NavDisableMouseHover = g.NavMousePosDirty = true;
}
void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window)
@@ -8771,18 +10323,18 @@ void ImGui::SetFocusID(ImGuiID id, ImGuiWindow* window)
ImGuiContext& g = *GImGui;
IM_ASSERT(id != 0);
- // Assume that SetFocusID() is called in the context where its window->DC.NavLayerCurrent and window->DC.NavFocusScopeIdCurrent are valid.
+ if (g.NavWindow != window)
+ SetNavWindow(window);
+
+ // Assume that SetFocusID() is called in the context where its window->DC.NavLayerCurrent and g.CurrentFocusScopeId are valid.
// Note that window may be != g.CurrentWindow (e.g. SetFocusID call in InputTextEx for multi-line text)
const ImGuiNavLayer nav_layer = window->DC.NavLayerCurrent;
- if (g.NavWindow != window)
- g.NavInitRequest = false;
- g.NavWindow = window;
g.NavId = id;
g.NavLayer = nav_layer;
- g.NavFocusScopeId = window->DC.NavFocusScopeIdCurrent;
+ g.NavFocusScopeId = g.CurrentFocusScopeId;
window->NavLastIds[nav_layer] = id;
if (g.LastItemData.ID == id)
- window->NavRectRel[nav_layer] = ImRect(g.LastItemData.NavRect.Min - window->Pos, g.LastItemData.NavRect.Max - window->Pos);
+ window->NavRectRel[nav_layer] = WindowRectAbsToRel(window, g.LastItemData.NavRect);
if (g.ActiveIdSource == ImGuiInputSource_Nav)
g.NavDisableMouseHover = true;
@@ -8843,7 +10395,7 @@ static bool ImGui::NavScoreItem(ImGuiNavItemData* result)
}
// 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 ensure that items in one column are not reached when moving vertically from items in another column.
+ // 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
@@ -8907,7 +10459,7 @@ static bool ImGui::NavScoreItem(ImGuiNavItemData* result)
}
#endif
- // Is it in the quadrant we're interesting in moving to?
+ // 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)
@@ -8960,8 +10512,9 @@ static void ImGui::NavApplyItemToResult(ImGuiNavItemData* result)
ImGuiWindow* window = g.CurrentWindow;
result->Window = window;
result->ID = g.LastItemData.ID;
- result->FocusScopeId = window->DC.NavFocusScopeIdCurrent;
- result->RectRel = ImRect(g.LastItemData.NavRect.Min - window->Pos, g.LastItemData.NavRect.Max - window->Pos);
+ result->FocusScopeId = g.CurrentFocusScopeId;
+ result->InFlags = g.LastItemData.InFlags;
+ result->RectRel = WindowRectAbsToRel(window, g.LastItemData.NavRect);
}
// We get there when either NavId == id, or when g.NavAnyRequest is set (which is updated by NavUpdateAnyRequestFlag above)
@@ -8975,14 +10528,14 @@ static void ImGui::NavProcessItem()
const ImGuiItemFlags item_flags = g.LastItemData.InFlags;
// Process Init Request
- if (g.NavInitRequest && g.NavLayer == window->DC.NavLayerCurrent)
+ if (g.NavInitRequest && g.NavLayer == window->DC.NavLayerCurrent && (item_flags & ImGuiItemFlags_Disabled) == 0)
{
// Even if 'ImGuiItemFlags_NoNavDefaultFocus' is on (typically collapse/close button) we record the first ResultId so they can be used as a fallback
- const bool candidate_for_nav_default_focus = (item_flags & (ImGuiItemFlags_NoNavDefaultFocus | ImGuiItemFlags_Disabled)) == 0;
+ const bool candidate_for_nav_default_focus = (item_flags & ImGuiItemFlags_NoNavDefaultFocus) == 0;
if (candidate_for_nav_default_focus || g.NavInitResultId == 0)
{
g.NavInitResultId = id;
- g.NavInitResultRectRel = ImRect(nav_bb.Min - window->Pos, nav_bb.Max - window->Pos);
+ g.NavInitResultRectRel = WindowRectAbsToRel(window, nav_bb);
}
if (candidate_for_nav_default_focus)
{
@@ -8995,29 +10548,87 @@ static void ImGui::NavProcessItem()
// 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.NavId != id || (g.NavMoveFlags & ImGuiNavMoveFlags_AllowCurrentNavId)) && !(item_flags & (ImGuiItemFlags_Disabled | ImGuiItemFlags_NoNav)))
+ 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);
+ }
+ else if ((g.NavId != id || (g.NavMoveFlags & ImGuiNavMoveFlags_AllowCurrentNavId)) && !(item_flags & ImGuiItemFlags_Disabled))
{
ImGuiNavItemData* result = (window == g.NavWindow) ? &g.NavMoveResultLocal : &g.NavMoveResultOther;
- 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);
+ if (!is_tabbing)
+ {
+ 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);
+ }
}
}
// Update window-relative bounding box of navigated item
if (g.NavId == id)
{
- g.NavWindow = window; // Always refresh g.NavWindow, because some operations such as FocusItem() don't have a window.
+ if (g.NavWindow != window)
+ SetNavWindow(window); // Always refresh g.NavWindow, because some operations such as FocusItem() may not have a window.
g.NavLayer = window->DC.NavLayerCurrent;
- g.NavFocusScopeId = window->DC.NavFocusScopeIdCurrent;
+ g.NavFocusScopeId = g.CurrentFocusScopeId;
g.NavIdIsAlive = true;
- window->NavRectRel[window->DC.NavLayerCurrent] = ImRect(nav_bb.Min - window->Pos, nav_bb.Max - window->Pos); // 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)
+ }
+}
+
+// Handle "scoring" of an item for a tabbing/focusing request initiated by NavUpdateCreateTabbingRequest().
+// Note that SetKeyboardFocusHere() API calls are considered tabbing requests!
+// - Case 1: no nav/active id: set result to first eligible item, stop storing.
+// - Case 2: tab forward: on ref id set counter, on counter elapse store result
+// - 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)
+{
+ ImGuiContext& g = *GImGui;
+
+ // 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)
+ NavApplyItemToResult(&g.NavTabbingResultFirst);
+ if (--g.NavTabbingCounter == 0)
+ NavMoveRequestResolveWithLastItem(result);
+ else if (g.NavId == id)
+ g.NavTabbingCounter = 1;
+ }
+ else if (g.NavTabbingDir == -1)
+ {
+ // Tab Backward
+ if (g.NavId == id)
+ {
+ if (result->ID)
+ {
+ g.NavMoveScoringItems = false;
+ NavUpdateAnyRequestFlag();
+ }
+ }
+ else
+ {
+ NavApplyItemToResult(result);
+ }
+ }
+ else if (g.NavTabbingDir == 0)
+ {
+ // Tab Init
+ if (g.NavTabbingResultFirst.ID == 0)
+ NavMoveRequestResolveWithLastItem(&g.NavTabbingResultFirst);
}
}
@@ -9028,20 +10639,35 @@ bool ImGui::NavMoveRequestButNoResultYet()
}
// FIXME: ScoringRect is not set
-void ImGui::NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags)
+void ImGui::NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags)
{
ImGuiContext& g = *GImGui;
IM_ASSERT(g.NavWindow != NULL);
+
+ if (move_flags & ImGuiNavMoveFlags_Tabbing)
+ move_flags |= ImGuiNavMoveFlags_AllowCurrentNavId;
+
g.NavMoveSubmitted = g.NavMoveScoringItems = true;
g.NavMoveDir = move_dir;
g.NavMoveDirForDebug = move_dir;
g.NavMoveClipDir = clip_dir;
g.NavMoveFlags = move_flags;
+ g.NavMoveScrollFlags = scroll_flags;
g.NavMoveForwardToNextFrame = false;
g.NavMoveKeyMods = g.IO.KeyMods;
g.NavMoveResultLocal.Clear();
g.NavMoveResultLocalVisible.Clear();
g.NavMoveResultOther.Clear();
+ g.NavTabbingCounter = 0;
+ g.NavTabbingResultFirst.Clear();
+ NavUpdateAnyRequestFlag();
+}
+
+void ImGui::NavMoveRequestResolveWithLastItem(ImGuiNavItemData* result)
+{
+ ImGuiContext& g = *GImGui;
+ g.NavMoveScoringItems = false; // Ensure request doesn't need more processing
+ NavApplyItemToResult(result);
NavUpdateAnyRequestFlag();
}
@@ -9053,7 +10679,7 @@ void ImGui::NavMoveRequestCancel()
}
// Forward will reuse the move request again on the next frame (generally with modifications done to it)
-void ImGui::NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags)
+void ImGui::NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags)
{
ImGuiContext& g = *GImGui;
IM_ASSERT(g.NavMoveForwardToNextFrame == false);
@@ -9062,6 +10688,7 @@ void ImGui::NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNav
g.NavMoveDir = move_dir;
g.NavMoveClipDir = clip_dir;
g.NavMoveFlags = move_flags | ImGuiNavMoveFlags_Forwarded;
+ g.NavMoveScrollFlags = scroll_flags;
}
// Navigation wrap-around logic is delayed to the end of the frame because this operation is only valid after entire
@@ -9099,7 +10726,12 @@ void ImGui::NavRestoreLayer(ImGuiNavLayer layer)
{
ImGuiContext& g = *GImGui;
if (layer == ImGuiNavLayer_Main)
- g.NavWindow = NavRestoreLastChildNavWindow(g.NavWindow);
+ {
+ ImGuiWindow* prev_nav_window = g.NavWindow;
+ g.NavWindow = NavRestoreLastChildNavWindow(g.NavWindow); // FIXME-NAV: Should clear ongoing nav requests?
+ if (prev_nav_window)
+ IMGUI_DEBUG_LOG_FOCUS("[focus] NavRestoreLayer: from \"%s\" to SetNavWindow(\"%s\")\n", prev_nav_window->Name, g.NavWindow->Name);
+ }
ImGuiWindow* window = g.NavWindow;
if (window->NavLastIds[layer] != 0)
{
@@ -9110,6 +10742,11 @@ void ImGui::NavRestoreLayer(ImGuiNavLayer layer)
g.NavLayer = layer;
NavInitWindow(window, true);
}
+}
+
+void ImGui::NavRestoreHighlightAfterMove()
+{
+ ImGuiContext& g = *GImGui;
g.NavDisableHighlight = false;
g.NavDisableMouseHover = g.NavMousePosDirty = true;
}
@@ -9130,7 +10767,8 @@ void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit)
if (window->Flags & ImGuiWindowFlags_NoNavInputs)
{
- g.NavId = g.NavFocusScopeId = 0;
+ g.NavId = 0;
+ g.NavFocusScopeId = window->NavRootFocusScopeId;
return;
}
@@ -9140,7 +10778,7 @@ void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit)
IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: from NavInitWindow(), init_for_nav=%d, window=\"%s\", layer=%d\n", init_for_nav, window->Name, g.NavLayer);
if (init_for_nav)
{
- SetNavID(0, g.NavLayer, 0, ImRect());
+ SetNavID(0, g.NavLayer, window->NavRootFocusScopeId, ImRect());
g.NavInitRequest = true;
g.NavInitRequestFromMove = false;
g.NavInitResultId = 0;
@@ -9150,66 +10788,59 @@ void ImGui::NavInitWindow(ImGuiWindow* window, bool force_reinit)
else
{
g.NavId = window->NavLastIds[0];
- g.NavFocusScopeId = 0;
+ g.NavFocusScopeId = window->NavRootFocusScopeId;
}
}
static ImVec2 ImGui::NavCalcPreferredRefPos()
{
ImGuiContext& g = *GImGui;
- if (g.NavDisableHighlight || !g.NavDisableMouseHover || !g.NavWindow)
+ ImGuiWindow* window = g.NavWindow;
+ if (g.NavDisableHighlight || !g.NavDisableMouseHover || !window)
{
// Mouse (we need a fallback in case the mouse becomes invalid after being used)
- if (IsMousePosValid(&g.IO.MousePos))
- return g.IO.MousePos;
- return g.MouseLastValidPos;
+ // The +1.0f offset when stored by OpenPopupEx() allows reopening this or another popup (same or another mouse button) while not moving the mouse, it is pretty standard.
+ // In theory we could move that +1.0f offset in OpenPopupEx()
+ ImVec2 p = IsMousePosValid(&g.IO.MousePos) ? g.IO.MousePos : g.MouseLastValidPos;
+ return ImVec2(p.x + 1.0f, p.y);
}
else
{
- // When navigation is active and mouse is disabled, decide on an arbitrary position around the bottom left of the currently navigated item.
- const ImRect& rect_rel = g.NavWindow->NavRectRel[g.NavLayer];
- ImVec2 pos = g.NavWindow->Pos + ImVec2(rect_rel.Min.x + ImMin(g.Style.FramePadding.x * 4, rect_rel.GetWidth()), rect_rel.Max.y - ImMin(g.Style.FramePadding.y, rect_rel.GetHeight()));
+ // When navigation is active and mouse is disabled, pick a position around the bottom left of the currently navigated item
+ // Take account of upcoming scrolling (maybe set mouse pos should be done in EndFrame?)
+ ImRect rect_rel = WindowRectRelToAbs(window, window->NavRectRel[g.NavLayer]);
+ if (window->LastFrameActive != g.FrameCount && (window->ScrollTarget.x != FLT_MAX || window->ScrollTarget.y != FLT_MAX))
+ {
+ ImVec2 next_scroll = CalcNextScrollFromScrollTargetAndClamp(window);
+ rect_rel.Translate(window->Scroll - next_scroll);
+ }
+ ImVec2 pos = ImVec2(rect_rel.Min.x + ImMin(g.Style.FramePadding.x * 4, rect_rel.GetWidth()), rect_rel.Max.y - ImMin(g.Style.FramePadding.y, rect_rel.GetHeight()));
ImGuiViewport* viewport = GetMainViewport();
return ImFloor(ImClamp(pos, viewport->Pos, viewport->Pos + viewport->Size)); // ImFloor() is important because non-integer mouse position application in backend might be lossy and result in undesirable non-zero delta.
}
}
-float ImGui::GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode)
+float ImGui::GetNavTweakPressedAmount(ImGuiAxis axis)
{
ImGuiContext& g = *GImGui;
- if (mode == ImGuiInputReadMode_Down)
- return g.IO.NavInputs[n]; // Instant, read analog input (0.0f..1.0f, as provided by user)
+ float repeat_delay, repeat_rate;
+ GetTypematicRepeatRate(ImGuiInputFlags_RepeatRateNavTweak, &repeat_delay, &repeat_rate);
- const float t = g.IO.NavInputsDownDuration[n];
- if (t < 0.0f && mode == ImGuiInputReadMode_Released) // Return 1.0f when just released, no repeat, ignore analog input.
- return (g.IO.NavInputsDownDurationPrev[n] >= 0.0f ? 1.0f : 0.0f);
- if (t < 0.0f)
- return 0.0f;
- if (mode == ImGuiInputReadMode_Pressed) // Return 1.0f when just pressed, no repeat, ignore analog input.
- return (t == 0.0f) ? 1.0f : 0.0f;
- if (mode == ImGuiInputReadMode_Repeat)
- return (float)CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay * 0.72f, g.IO.KeyRepeatRate * 0.80f);
- if (mode == ImGuiInputReadMode_RepeatSlow)
- return (float)CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay * 1.25f, g.IO.KeyRepeatRate * 2.00f);
- if (mode == ImGuiInputReadMode_RepeatFast)
- return (float)CalcTypematicRepeatAmount(t - g.IO.DeltaTime, t, g.IO.KeyRepeatDelay * 0.72f, g.IO.KeyRepeatRate * 0.30f);
- return 0.0f;
-}
-
-ImVec2 ImGui::GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInputReadMode mode, float slow_factor, float fast_factor)
-{
- ImVec2 delta(0.0f, 0.0f);
- if (dir_sources & ImGuiNavDirSourceFlags_Keyboard)
- delta += ImVec2(GetNavInputAmount(ImGuiNavInput_KeyRight_, mode) - GetNavInputAmount(ImGuiNavInput_KeyLeft_, mode), GetNavInputAmount(ImGuiNavInput_KeyDown_, mode) - GetNavInputAmount(ImGuiNavInput_KeyUp_, mode));
- if (dir_sources & ImGuiNavDirSourceFlags_PadDPad)
- delta += ImVec2(GetNavInputAmount(ImGuiNavInput_DpadRight, mode) - GetNavInputAmount(ImGuiNavInput_DpadLeft, mode), GetNavInputAmount(ImGuiNavInput_DpadDown, mode) - GetNavInputAmount(ImGuiNavInput_DpadUp, mode));
- if (dir_sources & ImGuiNavDirSourceFlags_PadLStick)
- delta += ImVec2(GetNavInputAmount(ImGuiNavInput_LStickRight, mode) - GetNavInputAmount(ImGuiNavInput_LStickLeft, mode), GetNavInputAmount(ImGuiNavInput_LStickDown, mode) - GetNavInputAmount(ImGuiNavInput_LStickUp, mode));
- if (slow_factor != 0.0f && IsNavInputDown(ImGuiNavInput_TweakSlow))
- delta *= slow_factor;
- if (fast_factor != 0.0f && IsNavInputDown(ImGuiNavInput_TweakFast))
- delta *= fast_factor;
- return delta;
+ ImGuiKey key_less, key_more;
+ if (g.NavInputSource == ImGuiInputSource_Gamepad)
+ {
+ key_less = (axis == ImGuiAxis_X) ? ImGuiKey_GamepadDpadLeft : ImGuiKey_GamepadDpadUp;
+ key_more = (axis == ImGuiAxis_X) ? ImGuiKey_GamepadDpadRight : ImGuiKey_GamepadDpadDown;
+ }
+ else
+ {
+ key_less = (axis == ImGuiAxis_X) ? ImGuiKey_LeftArrow : ImGuiKey_UpArrow;
+ key_more = (axis == ImGuiAxis_X) ? ImGuiKey_RightArrow : ImGuiKey_DownArrow;
+ }
+ float amount = (float)GetKeyPressedAmount(key_more, repeat_delay, repeat_rate) - (float)GetKeyPressedAmount(key_less, repeat_delay, repeat_rate);
+ if (amount != 0.0f && IsKeyDown(key_less) && IsKeyDown(key_more)) // Cancel when opposite directions are held, regardless of repeat phase
+ amount = 0.0f;
+ return amount;
}
static void ImGui::NavUpdate()
@@ -9218,39 +10849,22 @@ static void ImGui::NavUpdate()
ImGuiIO& io = g.IO;
io.WantSetMousePos = false;
- //if (g.NavScoringDebugCount > 0) IMGUI_DEBUG_LOG("NavScoringDebugCount %d for '%s' layer %d (Init:%d, Move:%d)\n", g.NavScoringDebugCount, g.NavWindow ? g.NavWindow->Name : "NULL", g.NavLayer, g.NavInitRequest || g.NavInitResultId != 0, g.NavMoveRequest);
+ //if (g.NavScoringDebugCount > 0) IMGUI_DEBUG_LOG_NAV("[nav] NavScoringDebugCount %d for '%s' layer %d (Init:%d, Move:%d)\n", g.NavScoringDebugCount, g.NavWindow ? g.NavWindow->Name : "NULL", g.NavLayer, g.NavInitRequest || g.NavInitResultId != 0, g.NavMoveRequest);
- // Set input source as Gamepad when buttons are pressed (as some features differs when used with Gamepad vs Keyboard)
- // (do it before we map Keyboard input!)
- const bool nav_keyboard_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
+ // Set input source based on which keys are last pressed (as some features differs when used with Gamepad vs Keyboard)
+ // FIXME-NAV: Now that keys are separated maybe we can get rid of NavInputSource?
const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0;
- if (nav_gamepad_active && g.NavInputSource != ImGuiInputSource_Gamepad)
- {
- if (io.NavInputs[ImGuiNavInput_Activate] > 0.0f || io.NavInputs[ImGuiNavInput_Input] > 0.0f || io.NavInputs[ImGuiNavInput_Cancel] > 0.0f || io.NavInputs[ImGuiNavInput_Menu] > 0.0f
- || io.NavInputs[ImGuiNavInput_DpadLeft] > 0.0f || io.NavInputs[ImGuiNavInput_DpadRight] > 0.0f || io.NavInputs[ImGuiNavInput_DpadUp] > 0.0f || io.NavInputs[ImGuiNavInput_DpadDown] > 0.0f)
- g.NavInputSource = ImGuiInputSource_Gamepad;
- }
-
- // Update Keyboard->Nav inputs mapping
+ const ImGuiKey nav_gamepad_keys_to_change_source[] = { ImGuiKey_GamepadFaceRight, ImGuiKey_GamepadFaceLeft, ImGuiKey_GamepadFaceUp, ImGuiKey_GamepadFaceDown, ImGuiKey_GamepadDpadRight, ImGuiKey_GamepadDpadLeft, ImGuiKey_GamepadDpadUp, ImGuiKey_GamepadDpadDown };
+ if (nav_gamepad_active)
+ for (ImGuiKey key : nav_gamepad_keys_to_change_source)
+ if (IsKeyDown(key))
+ g.NavInputSource = ImGuiInputSource_Gamepad;
+ const bool nav_keyboard_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
+ const ImGuiKey nav_keyboard_keys_to_change_source[] = { ImGuiKey_Space, ImGuiKey_Enter, ImGuiKey_Escape, ImGuiKey_RightArrow, ImGuiKey_LeftArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow };
if (nav_keyboard_active)
- {
- #define NAV_MAP_KEY(_KEY, _NAV_INPUT) do { if (IsKeyDown(io.KeyMap[_KEY])) { io.NavInputs[_NAV_INPUT] = 1.0f; g.NavInputSource = ImGuiInputSource_Keyboard; } } while (0)
- NAV_MAP_KEY(ImGuiKey_Space, ImGuiNavInput_Activate );
- NAV_MAP_KEY(ImGuiKey_Enter, ImGuiNavInput_Input );
- NAV_MAP_KEY(ImGuiKey_Escape, ImGuiNavInput_Cancel );
- NAV_MAP_KEY(ImGuiKey_LeftArrow, ImGuiNavInput_KeyLeft_ );
- NAV_MAP_KEY(ImGuiKey_RightArrow,ImGuiNavInput_KeyRight_);
- NAV_MAP_KEY(ImGuiKey_UpArrow, ImGuiNavInput_KeyUp_ );
- NAV_MAP_KEY(ImGuiKey_DownArrow, ImGuiNavInput_KeyDown_ );
- if (io.KeyCtrl)
- io.NavInputs[ImGuiNavInput_TweakSlow] = 1.0f;
- if (io.KeyShift)
- io.NavInputs[ImGuiNavInput_TweakFast] = 1.0f;
- #undef NAV_MAP_KEY
- }
- memcpy(io.NavInputsDownDurationPrev, io.NavInputsDownDuration, sizeof(io.NavInputsDownDuration));
- for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++)
- io.NavInputsDownDuration[i] = (io.NavInputs[i] > 0.0f) ? (io.NavInputsDownDuration[i] < 0.0f ? 0.0f : io.NavInputsDownDuration[i] + io.DeltaTime) : -1.0f;
+ for (ImGuiKey key : nav_keyboard_keys_to_change_source)
+ if (IsKeyDown(key))
+ g.NavInputSource = ImGuiInputSource_Keyboard;
// Process navigation init request (select first/default focus)
if (g.NavInitResultId != 0)
@@ -9263,24 +10877,16 @@ static void ImGui::NavUpdate()
// Process navigation move request
if (g.NavMoveSubmitted)
NavMoveRequestApplyResult();
+ g.NavTabbingCounter = 0;
g.NavMoveSubmitted = g.NavMoveScoringItems = false;
- // Apply application mouse position movement, after we had a chance to process move request result.
+ // Schedule mouse position update (will be done at the bottom of this function, after 1) processing all move requests and 2) updating scrolling)
+ bool set_mouse_pos = false;
if (g.NavMousePosDirty && g.NavIdIsAlive)
- {
- // Set mouse position given our knowledge of the navigated item position from last frame
- if ((io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) && (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos))
- if (!g.NavDisableHighlight && g.NavDisableMouseHover && g.NavWindow)
- {
- io.MousePos = io.MousePosPrev = NavCalcPreferredRefPos();
- io.WantSetMousePos = true;
- //IMGUI_DEBUG_LOG("SetMousePos: (%.1f,%.1f)\n", io.MousePos.x, io.MousePos.y);
- }
- g.NavMousePosDirty = false;
- }
- g.NavIdIsAlive = false;
- g.NavJustTabbedId = 0;
- IM_ASSERT(g.NavLayer == 0 || g.NavLayer == 1);
+ if (!g.NavDisableHighlight && g.NavDisableMouseHover && g.NavWindow)
+ set_mouse_pos = true;
+ g.NavMousePosDirty = false;
+ IM_ASSERT(g.NavLayer == ImGuiNavLayer_Main || g.NavLayer == ImGuiNavLayer_Menu);
// Store our return window (for returning from Menu Layer to Main Layer) and clear it as soon as we step back in our own Layer 0
if (g.NavWindow)
@@ -9303,10 +10909,10 @@ static void ImGui::NavUpdate()
g.NavActivateFlags = ImGuiActivateFlags_None;
if (g.NavId != 0 && !g.NavDisableHighlight && !g.NavWindowingTarget && g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs))
{
- bool activate_down = IsNavInputDown(ImGuiNavInput_Activate);
- bool input_down = IsNavInputDown(ImGuiNavInput_Input);
- bool activate_pressed = activate_down && IsNavInputTest(ImGuiNavInput_Activate, ImGuiInputReadMode_Pressed);
- bool input_pressed = input_down && IsNavInputTest(ImGuiNavInput_Input, ImGuiInputReadMode_Pressed);
+ const bool activate_down = (nav_keyboard_active && IsKeyDown(ImGuiKey_Space)) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadActivate));
+ const bool activate_pressed = activate_down && ((nav_keyboard_active && IsKeyPressed(ImGuiKey_Space, false)) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadActivate, false)));
+ const bool input_down = (nav_keyboard_active && IsKeyDown(ImGuiKey_Enter)) || (nav_gamepad_active && IsKeyDown(ImGuiKey_NavGamepadInput));
+ const bool input_pressed = input_down && ((nav_keyboard_active && IsKeyPressed(ImGuiKey_Enter, false)) || (nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadInput, false)));
if (g.ActiveId == 0 && activate_pressed)
{
g.NavActivateId = g.NavId;
@@ -9341,7 +10947,10 @@ static void ImGui::NavUpdate()
// Process move requests
NavUpdateCreateMoveRequest();
+ if (g.NavMoveDir == ImGuiDir_None)
+ NavUpdateCreateTabbingRequest();
NavUpdateAnyRequestFlag();
+ g.NavIdIsAlive = false;
// Scrolling
if (g.NavWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_NoNavInputs) && !g.NavWindowingTarget)
@@ -9358,20 +10967,33 @@ static void ImGui::NavUpdate()
SetScrollY(window, ImFloor(window->Scroll.y + ((move_dir == ImGuiDir_Up) ? -1.0f : +1.0f) * scroll_speed));
}
- // *Normal* Manual scroll with NavScrollXXX keys
+ // *Normal* Manual scroll with LStick
// Next movement request will clamp the NavId reference rectangle to the visible area, so navigation will resume within those bounds.
- ImVec2 scroll_dir = GetNavInputAmount2d(ImGuiNavDirSourceFlags_PadLStick, ImGuiInputReadMode_Down, 1.0f / 10.0f, 10.0f);
- if (scroll_dir.x != 0.0f && window->ScrollbarX)
- SetScrollX(window, ImFloor(window->Scroll.x + scroll_dir.x * scroll_speed));
- if (scroll_dir.y != 0.0f)
- SetScrollY(window, ImFloor(window->Scroll.y + scroll_dir.y * scroll_speed));
+ if (nav_gamepad_active)
+ {
+ const ImVec2 scroll_dir = GetKeyVector2d(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));
+ if (scroll_dir.y != 0.0f)
+ SetScrollY(window, ImFloor(window->Scroll.y + scroll_dir.y * scroll_speed * tweak_factor));
+ }
}
// Always prioritize mouse highlight if navigation is disabled
if (!nav_keyboard_active && !nav_gamepad_active)
{
g.NavDisableHighlight = true;
- g.NavDisableMouseHover = g.NavMousePosDirty = false;
+ g.NavDisableMouseHover = set_mouse_pos = false;
+ }
+
+ // Update mouse position if requested
+ // (This will take into account the possibility that a Scroll was queued in the window to offset our absolute mouse position before scroll has been applied)
+ if (set_mouse_pos && (io.ConfigFlags & ImGuiConfigFlags_NavEnableSetMousePos) && (io.BackendFlags & ImGuiBackendFlags_HasSetMousePos))
+ {
+ io.MousePos = io.MousePosPrev = NavCalcPreferredRefPos();
+ io.WantSetMousePos = true;
+ //IMGUI_DEBUG_LOG_IO("SetMousePos: (%.1f,%.1f)\n", io.MousePos.x, io.MousePos.y);
}
// [DEBUG]
@@ -9380,7 +11002,7 @@ static void ImGui::NavUpdate()
if (g.NavWindow)
{
ImDrawList* draw_list = GetForegroundDrawList(g.NavWindow);
- if (1) { for (int layer = 0; layer < 2; layer++) draw_list->AddRect(g.NavWindow->Pos + g.NavWindow->NavRectRel[layer].Min, g.NavWindow->Pos + g.NavWindow->NavRectRel[layer].Max, IM_COL32(255,200,0,255)); } // [DEBUG]
+ if (1) { for (int layer = 0; layer < 2; layer++) { ImRect r = WindowRectRelToAbs(g.NavWindow, g.NavWindow->NavRectRel[layer]); draw_list->AddRect(r.Min, r.Max, IM_COL32(255,200,0,255)); } } // [DEBUG]
if (1) { ImU32 col = (!g.NavWindow->Hidden) ? IM_COL32(255,0,255,255) : IM_COL32(255,0,0,255); ImVec2 p = NavCalcPreferredRefPos(); char buf[32]; ImFormatString(buf, 32, "%d", g.NavLayer); draw_list->AddCircleFilled(p, 3.0f, col); draw_list->AddText(NULL, 13.0f, p + ImVec2(8,-4), col, buf); }
}
#endif
@@ -9395,14 +11017,11 @@ void ImGui::NavInitRequestApplyResult()
// Apply result from previous navigation init request (will typically select the first item, unless SetItemDefaultFocus() has been called)
// FIXME-NAV: On _NavFlattened windows, g.NavWindow will only be updated during subsequent frame. Not a problem currently.
- IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: result NavID 0x%08X in Layer %d Window \"%s\"\n", g.NavInitResultId, g.NavLayer, g.NavWindow->Name);
+ IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: ApplyResult: NavID 0x%08X in Layer %d Window \"%s\"\n", g.NavInitResultId, g.NavLayer, g.NavWindow->Name);
SetNavID(g.NavInitResultId, g.NavLayer, 0, g.NavInitResultRectRel);
g.NavIdIsAlive = true; // Mark as alive from previous frame as we got a result
if (g.NavInitRequestFromMove)
- {
- g.NavDisableHighlight = false;
- g.NavDisableMouseHover = g.NavMousePosDirty = true;
- }
+ NavRestoreHighlightAfterMove();
}
void ImGui::NavUpdateCreateMoveRequest()
@@ -9410,6 +11029,8 @@ void ImGui::NavUpdateCreateMoveRequest()
ImGuiContext& g = *GImGui;
ImGuiIO& io = g.IO;
ImGuiWindow* window = g.NavWindow;
+ 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;
if (g.NavMoveForwardToNextFrame && window != NULL)
{
@@ -9424,27 +11045,33 @@ void ImGui::NavUpdateCreateMoveRequest()
// Initiate directional inputs request
g.NavMoveDir = ImGuiDir_None;
g.NavMoveFlags = ImGuiNavMoveFlags_None;
+ g.NavMoveScrollFlags = ImGuiScrollFlags_None;
if (window && !g.NavWindowingTarget && !(window->Flags & ImGuiWindowFlags_NoNavInputs))
{
- const ImGuiInputReadMode read_mode = ImGuiInputReadMode_Repeat;
- if (!IsActiveIdUsingNavDir(ImGuiDir_Left) && (IsNavInputTest(ImGuiNavInput_DpadLeft, read_mode) || IsNavInputTest(ImGuiNavInput_KeyLeft_, read_mode))) { g.NavMoveDir = ImGuiDir_Left; }
- if (!IsActiveIdUsingNavDir(ImGuiDir_Right) && (IsNavInputTest(ImGuiNavInput_DpadRight, read_mode) || IsNavInputTest(ImGuiNavInput_KeyRight_, read_mode))) { g.NavMoveDir = ImGuiDir_Right; }
- if (!IsActiveIdUsingNavDir(ImGuiDir_Up) && (IsNavInputTest(ImGuiNavInput_DpadUp, read_mode) || IsNavInputTest(ImGuiNavInput_KeyUp_, read_mode))) { g.NavMoveDir = ImGuiDir_Up; }
- if (!IsActiveIdUsingNavDir(ImGuiDir_Down) && (IsNavInputTest(ImGuiNavInput_DpadDown, read_mode) || IsNavInputTest(ImGuiNavInput_KeyDown_, read_mode))) { g.NavMoveDir = ImGuiDir_Down; }
+ const ImGuiInputFlags repeat_mode = ImGuiInputFlags_Repeat | 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; }
+ if (!IsActiveIdUsingNavDir(ImGuiDir_Down) && ((nav_gamepad_active && IsKeyPressed(ImGuiKey_GamepadDpadDown, ImGuiKeyOwner_None, repeat_mode)) || (nav_keyboard_active && IsKeyPressed(ImGuiKey_DownArrow, ImGuiKeyOwner_None, repeat_mode)))) { g.NavMoveDir = ImGuiDir_Down; }
}
g.NavMoveClipDir = g.NavMoveDir;
+ g.NavScoringNoClipRect = ImRect(+FLT_MAX, +FLT_MAX, -FLT_MAX, -FLT_MAX);
}
// Update PageUp/PageDown/Home/End scroll
// FIXME-NAV: Consider enabling those keys even without the master ImGuiConfigFlags_NavEnableKeyboard flag?
- const bool nav_keyboard_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
float scoring_rect_offset_y = 0.0f;
if (window && g.NavMoveDir == ImGuiDir_None && nav_keyboard_active)
scoring_rect_offset_y = NavUpdatePageUpPageDown();
+ if (scoring_rect_offset_y != 0.0f)
+ {
+ g.NavScoringNoClipRect = window->InnerRect;
+ g.NavScoringNoClipRect.TranslateY(scoring_rect_offset_y);
+ }
// [DEBUG] Always send a request
#if IMGUI_DEBUG_NAV_SCORING
- if (io.KeyCtrl && IsKeyPressedMap(ImGuiKey_C))
+ if (io.KeyCtrl && IsKeyPressed(ImGuiKey_C))
g.NavMoveDirForDebug = (ImGuiDir)((g.NavMoveDirForDebug + 1) & 3);
if (io.KeyCtrl && g.NavMoveDir == ImGuiDir_None)
{
@@ -9456,30 +11083,36 @@ void ImGui::NavUpdateCreateMoveRequest()
// Submit
g.NavMoveForwardToNextFrame = false;
if (g.NavMoveDir != ImGuiDir_None)
- NavMoveRequestSubmit(g.NavMoveDir, g.NavMoveClipDir, g.NavMoveFlags);
+ NavMoveRequestSubmit(g.NavMoveDir, g.NavMoveClipDir, g.NavMoveFlags, g.NavMoveScrollFlags);
- // Moving with no reference triggers a init request (will be used as a fallback if the direction fails to find a match)
+ // Moving with no reference triggers an init request (will be used as a fallback if the direction fails to find a match)
if (g.NavMoveSubmitted && g.NavId == 0)
{
- IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: from move, window \"%s\", layer=%d\n", g.NavWindow->Name, g.NavLayer);
+ IMGUI_DEBUG_LOG_NAV("[nav] NavInitRequest: from move, window \"%s\", layer=%d\n", window ? window->Name : "<NULL>", g.NavLayer);
g.NavInitRequest = g.NavInitRequestFromMove = true;
g.NavInitResultId = 0;
g.NavDisableHighlight = false;
}
// 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 every movements are relative
+ // 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)
+ if (g.NavMoveSubmitted && g.NavInputSource == ImGuiInputSource_Gamepad && g.NavLayer == ImGuiNavLayer_Main && window != NULL)// && (g.NavMoveFlags & ImGuiNavMoveFlags_Forwarded))
{
- ImRect window_rect_rel(window->InnerRect.Min - window->Pos - ImVec2(1, 1), window->InnerRect.Max - window->Pos + ImVec2(1, 1));
- if (!window_rect_rel.Contains(window->NavRectRel[g.NavLayer]))
+ 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)));
+ if ((clamp_x || clamp_y) && !inner_rect_rel.Contains(window->NavRectRel[g.NavLayer]))
{
- IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: clamp NavRectRel\n");
- float pad = window->CalcFontSize() * 0.5f;
- window_rect_rel.Expand(ImVec2(-ImMin(window_rect_rel.GetWidth(), pad), -ImMin(window_rect_rel.GetHeight(), pad))); // Terrible approximation for the intent of starting navigation from first fully visible item
- window->NavRectRel[g.NavLayer].ClipWithFull(window_rect_rel);
- g.NavId = g.NavFocusScopeId = 0;
+ //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;
+ inner_rect_rel.Max.x = clamp_x ? (inner_rect_rel.Max.x - pad_x) : +FLT_MAX;
+ inner_rect_rel.Min.y = clamp_y ? (inner_rect_rel.Min.y + pad_y) : -FLT_MAX;
+ inner_rect_rel.Max.y = clamp_y ? (inner_rect_rel.Max.y - pad_y) : +FLT_MAX;
+ window->NavRectRel[g.NavLayer].ClipWithFull(inner_rect_rel);
+ g.NavId = 0;
}
}
@@ -9488,14 +11121,40 @@ void ImGui::NavUpdateCreateMoveRequest()
if (window != NULL)
{
ImRect nav_rect_rel = !window->NavRectRel[g.NavLayer].IsInverted() ? window->NavRectRel[g.NavLayer] : ImRect(0, 0, 0, 0);
- scoring_rect = ImRect(window->Pos + nav_rect_rel.Min, window->Pos + nav_rect_rel.Max);
+ scoring_rect = WindowRectRelToAbs(window, nav_rect_rel);
scoring_rect.TranslateY(scoring_rect_offset_y);
scoring_rect.Min.x = ImMin(scoring_rect.Min.x + 1.0f, scoring_rect.Max.x);
scoring_rect.Max.x = scoring_rect.Min.x;
- IM_ASSERT(!scoring_rect.IsInverted()); // Ensure if we have a finite, non-inverted bounding box here will allows us to remove extraneous ImFabs() calls in NavScoreItem().
+ IM_ASSERT(!scoring_rect.IsInverted()); // Ensure if we have a finite, non-inverted bounding box here will allow us to remove extraneous ImFabs() calls in NavScoreItem().
//GetForegroundDrawList()->AddRect(scoring_rect.Min, scoring_rect.Max, IM_COL32(255,200,0,255)); // [DEBUG]
+ //if (!g.NavScoringNoClipRect.IsInverted()) { GetForegroundDrawList()->AddRect(g.NavScoringNoClipRect.Min, g.NavScoringNoClipRect.Max, IM_COL32(255, 200, 0, 255)); } // [DEBUG]
}
g.NavScoringRect = scoring_rect;
+ g.NavScoringNoClipRect.Add(scoring_rect);
+}
+
+void ImGui::NavUpdateCreateTabbingRequest()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.NavWindow;
+ IM_ASSERT(g.NavMoveDir == ImGuiDir_None);
+ if (window == NULL || g.NavWindowingTarget != NULL || (window->Flags & ImGuiWindowFlags_NoNavInputs))
+ return;
+
+ const bool tab_pressed = IsKeyPressed(ImGuiKey_Tab, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat) && !g.IO.KeyCtrl && !g.IO.KeyAlt;
+ if (!tab_pressed)
+ return;
+
+ // Initiate tabbing request
+ // (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;
+ 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.
+ g.NavTabbingCounter = -1;
}
// Apply result from previous frame navigation directional move request. Always called from NavUpdate()
@@ -9510,14 +11169,18 @@ void ImGui::NavMoveRequestApplyResult()
// Select which result to use
ImGuiNavItemData* result = (g.NavMoveResultLocal.ID != 0) ? &g.NavMoveResultLocal : (g.NavMoveResultOther.ID != 0) ? &g.NavMoveResultOther : NULL;
- // In a situation when there is no results but NavId != 0, re-enable the Navigation highlight (because g.NavId is not considered as a possible result)
+ // Tabbing forward wrap
+ if (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing)
+ if ((g.NavTabbingCounter == 1 || g.NavTabbingDir == 0) && g.NavTabbingResultFirst.ID)
+ result = &g.NavTabbingResultFirst;
+
+ // In a situation when there are no results but NavId != 0, re-enable the Navigation highlight (because g.NavId is not considered as a possible result)
if (result == NULL)
{
- if (g.NavId != 0)
- {
- g.NavDisableHighlight = false;
- g.NavDisableMouseHover = true;
- }
+ if (g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing)
+ g.NavMoveFlags |= ImGuiNavMoveFlags_DontSetNavHighlight;
+ if (g.NavId != 0 && (g.NavMoveFlags & ImGuiNavMoveFlags_DontSetNavHighlight) == 0)
+ NavRestoreHighlightAfterMove();
return;
}
@@ -9535,26 +11198,26 @@ void ImGui::NavMoveRequestApplyResult()
// Scroll to keep newly navigated item fully into view.
if (g.NavLayer == ImGuiNavLayer_Main)
{
- ImVec2 delta_scroll;
- if (g.NavMoveFlags & ImGuiNavMoveFlags_ScrollToEdge)
+ if (g.NavMoveFlags & ImGuiNavMoveFlags_ScrollToEdgeY)
{
+ // FIXME: Should remove this
float scroll_target = (g.NavMoveDir == ImGuiDir_Up) ? result->Window->ScrollMax.y : 0.0f;
- delta_scroll.y = result->Window->Scroll.y - scroll_target;
SetScrollY(result->Window, scroll_target);
}
else
{
- ImRect rect_abs = ImRect(result->RectRel.Min + result->Window->Pos, result->RectRel.Max + result->Window->Pos);
- delta_scroll = ScrollToBringRectIntoView(result->Window, rect_abs);
+ ImRect rect_abs = WindowRectRelToAbs(result->Window, result->RectRel);
+ ScrollToRectEx(result->Window, rect_abs, g.NavMoveScrollFlags);
}
-
- // Offset our result position so mouse position can be applied immediately after in NavUpdate()
- result->RectRel.TranslateX(-delta_scroll.x);
- result->RectRel.TranslateY(-delta_scroll.y);
}
- ClearActiveID();
- g.NavWindow = result->Window;
+ if (g.NavWindow != result->Window)
+ {
+ IMGUI_DEBUG_LOG_FOCUS("[focus] NavMoveRequest: SetNavWindow(\"%s\")\n", result->Window->Name);
+ g.NavWindow = result->Window;
+ }
+ if (g.ActiveId != result->ID)
+ ClearActiveID();
if (g.NavId != result->ID)
{
// Don't set NavJustMovedToId if just landed on the same spot (which may happen with ImGuiNavMoveFlags_AllowCurrentNavId)
@@ -9567,9 +11230,24 @@ void ImGui::NavMoveRequestApplyResult()
IMGUI_DEBUG_LOG_NAV("[nav] NavMoveRequest: result NavID 0x%08X in Layer %d Window \"%s\"\n", result->ID, g.NavLayer, g.NavWindow->Name);
SetNavID(result->ID, g.NavLayer, result->FocusScopeId, result->RectRel);
+ // Tabbing: Activates Inputable or Focus non-Inputable
+ if ((g.NavMoveFlags & ImGuiNavMoveFlags_Tabbing) && (result->InFlags & ImGuiItemFlags_Inputable))
+ {
+ g.NavNextActivateId = result->ID;
+ g.NavNextActivateFlags = ImGuiActivateFlags_PreferInput | ImGuiActivateFlags_TryToPreserveState;
+ g.NavMoveFlags |= ImGuiNavMoveFlags_DontSetNavHighlight;
+ }
+
+ // Activate
+ if (g.NavMoveFlags & ImGuiNavMoveFlags_Activate)
+ {
+ g.NavNextActivateId = result->ID;
+ g.NavNextActivateFlags = ImGuiActivateFlags_None;
+ }
+
// Enable nav highlight
- g.NavDisableHighlight = false;
- g.NavDisableMouseHover = g.NavMousePosDirty = true;
+ if ((g.NavMoveFlags & ImGuiNavMoveFlags_DontSetNavHighlight) == 0)
+ NavRestoreHighlightAfterMove();
}
// Process NavCancel input (to close a popup, get back to parent, clear focus)
@@ -9579,19 +11257,21 @@ void ImGui::NavMoveRequestApplyResult()
static void ImGui::NavUpdateCancelRequest()
{
ImGuiContext& g = *GImGui;
- if (!IsNavInputTest(ImGuiNavInput_Cancel, ImGuiInputReadMode_Pressed))
+ const bool nav_gamepad_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (g.IO.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0;
+ const bool nav_keyboard_active = (g.IO.ConfigFlags & ImGuiConfigFlags_NavEnableKeyboard) != 0;
+ if (!(nav_keyboard_active && IsKeyPressed(ImGuiKey_Escape, ImGuiKeyOwner_None)) && !(nav_gamepad_active && IsKeyPressed(ImGuiKey_NavGamepadCancel, ImGuiKeyOwner_None)))
return;
- IMGUI_DEBUG_LOG_NAV("[nav] ImGuiNavInput_Cancel\n");
+ IMGUI_DEBUG_LOG_NAV("[nav] NavUpdateCancelRequest()\n");
if (g.ActiveId != 0)
{
- if (!IsActiveIdUsingNavInput(ImGuiNavInput_Cancel))
- ClearActiveID();
+ ClearActiveID();
}
else if (g.NavLayer != ImGuiNavLayer_Main)
{
// Leave the "menu" layer
NavRestoreLayer(ImGuiNavLayer_Main);
+ NavRestoreHighlightAfterMove();
}
else if (g.NavWindow && g.NavWindow != g.NavWindow->RootWindow && !(g.NavWindow->Flags & ImGuiWindowFlags_Popup) && g.NavWindow->ParentWindow)
{
@@ -9601,20 +11281,20 @@ static void ImGui::NavUpdateCancelRequest()
IM_ASSERT(child_window->ChildId != 0);
ImRect child_rect = child_window->Rect();
FocusWindow(parent_window);
- SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, ImRect(child_rect.Min - parent_window->Pos, child_rect.Max - parent_window->Pos));
+ SetNavID(child_window->ChildId, ImGuiNavLayer_Main, 0, WindowRectAbsToRel(parent_window, child_rect));
+ NavRestoreHighlightAfterMove();
}
- else if (g.OpenPopupStack.Size > 0)
+ else if (g.OpenPopupStack.Size > 0 && g.OpenPopupStack.back().Window != NULL && !(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal))
{
// Close open popup/menu
- if (!(g.OpenPopupStack.back().Window->Flags & ImGuiWindowFlags_Modal))
- ClosePopupToLevel(g.OpenPopupStack.Size - 1, true);
+ ClosePopupToLevel(g.OpenPopupStack.Size - 1, true);
}
else
{
// Clear NavLastId for popups but keep it for regular child window so we can leave one and come back where we were
if (g.NavWindow && ((g.NavWindow->Flags & ImGuiWindowFlags_Popup) || !(g.NavWindow->Flags & ImGuiWindowFlags_ChildWindow)))
g.NavWindow->NavLastIds[0] = 0;
- g.NavId = g.NavFocusScopeId = 0;
+ g.NavId = 0;
}
}
@@ -9625,25 +11305,26 @@ static void ImGui::NavUpdateCancelRequest()
static float ImGui::NavUpdatePageUpPageDown()
{
ImGuiContext& g = *GImGui;
- ImGuiIO& io = g.IO;
-
ImGuiWindow* window = g.NavWindow;
- if ((window->Flags & ImGuiWindowFlags_NoNavInputs) || g.NavWindowingTarget != NULL || g.NavLayer != ImGuiNavLayer_Main)
+ if ((window->Flags & ImGuiWindowFlags_NoNavInputs) || g.NavWindowingTarget != NULL)
return 0.0f;
- const bool page_up_held = IsKeyDown(io.KeyMap[ImGuiKey_PageUp]) && !IsActiveIdUsingKey(ImGuiKey_PageUp);
- const bool page_down_held = IsKeyDown(io.KeyMap[ImGuiKey_PageDown]) && !IsActiveIdUsingKey(ImGuiKey_PageDown);
- const bool home_pressed = IsKeyPressed(io.KeyMap[ImGuiKey_Home]) && !IsActiveIdUsingKey(ImGuiKey_Home);
- const bool end_pressed = IsKeyPressed(io.KeyMap[ImGuiKey_End]) && !IsActiveIdUsingKey(ImGuiKey_End);
+ const bool page_up_held = IsKeyDown(ImGuiKey_PageUp, ImGuiKeyOwner_None);
+ const bool page_down_held = IsKeyDown(ImGuiKey_PageDown, ImGuiKeyOwner_None);
+ const bool home_pressed = IsKeyPressed(ImGuiKey_Home, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat);
+ const bool end_pressed = IsKeyPressed(ImGuiKey_End, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat);
if (page_up_held == page_down_held && home_pressed == end_pressed) // Proceed if either (not both) are pressed, otherwise early out
return 0.0f;
+ if (g.NavLayer != ImGuiNavLayer_Main)
+ NavRestoreLayer(ImGuiNavLayer_Main);
+
if (window->DC.NavLayersActiveMask == 0x00 && window->DC.NavHasScroll)
{
// Fallback manual-scroll when window has no navigable item
- if (IsKeyPressed(io.KeyMap[ImGuiKey_PageUp], true))
+ if (IsKeyPressed(ImGuiKey_PageUp, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat))
SetScrollY(window, window->Scroll.y - window->InnerRect.GetHeight());
- else if (IsKeyPressed(io.KeyMap[ImGuiKey_PageDown], true))
+ else if (IsKeyPressed(ImGuiKey_PageDown, ImGuiKeyOwner_None, ImGuiInputFlags_Repeat))
SetScrollY(window, window->Scroll.y + window->InnerRect.GetHeight());
else if (home_pressed)
SetScrollY(window, 0.0f);
@@ -9655,14 +11336,14 @@ static float ImGui::NavUpdatePageUpPageDown()
ImRect& nav_rect_rel = window->NavRectRel[g.NavLayer];
const float page_offset_y = ImMax(0.0f, window->InnerRect.GetHeight() - window->CalcFontSize() * 1.0f + nav_rect_rel.GetHeight());
float nav_scoring_rect_offset_y = 0.0f;
- if (IsKeyPressed(io.KeyMap[ImGuiKey_PageUp], true))
+ if (IsKeyPressed(ImGuiKey_PageUp, true))
{
nav_scoring_rect_offset_y = -page_offset_y;
g.NavMoveDir = ImGuiDir_Down; // Because our scoring rect is offset up, we request the down direction (so we can always land on the last item)
g.NavMoveClipDir = ImGuiDir_Up;
g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_AlsoScoreVisibleSet;
}
- else if (IsKeyPressed(io.KeyMap[ImGuiKey_PageDown], true))
+ else if (IsKeyPressed(ImGuiKey_PageDown, true))
{
nav_scoring_rect_offset_y = +page_offset_y;
g.NavMoveDir = ImGuiDir_Up; // Because our scoring rect is offset down, we request the up direction (so we can always land on the last item)
@@ -9672,22 +11353,22 @@ static float ImGui::NavUpdatePageUpPageDown()
else if (home_pressed)
{
// FIXME-NAV: handling of Home/End is assuming that the top/bottom most item will be visible with Scroll.y == 0/ScrollMax.y
- // Scrolling will be handled via the ImGuiNavMoveFlags_ScrollToEdge flag, we don't scroll immediately to avoid scrolling happening before nav result.
+ // Scrolling will be handled via the ImGuiNavMoveFlags_ScrollToEdgeY flag, we don't scroll immediately to avoid scrolling happening before nav result.
// Preserve current horizontal position if we have any.
- nav_rect_rel.Min.y = nav_rect_rel.Max.y = -window->Scroll.y;
+ nav_rect_rel.Min.y = nav_rect_rel.Max.y = 0.0f;
if (nav_rect_rel.IsInverted())
nav_rect_rel.Min.x = nav_rect_rel.Max.x = 0.0f;
g.NavMoveDir = ImGuiDir_Down;
- g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_ScrollToEdge;
+ g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_ScrollToEdgeY;
// FIXME-NAV: MoveClipDir left to _None, intentional?
}
else if (end_pressed)
{
- nav_rect_rel.Min.y = nav_rect_rel.Max.y = window->ScrollMax.y + window->SizeFull.y - window->Scroll.y;
+ nav_rect_rel.Min.y = nav_rect_rel.Max.y = window->ContentSize.y;
if (nav_rect_rel.IsInverted())
nav_rect_rel.Min.x = nav_rect_rel.Max.x = 0.0f;
g.NavMoveDir = ImGuiDir_Up;
- g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_ScrollToEdge;
+ g.NavMoveFlags = ImGuiNavMoveFlags_AllowCurrentNavId | ImGuiNavMoveFlags_ScrollToEdgeY;
// FIXME-NAV: MoveClipDir left to _None, intentional?
}
return nav_scoring_rect_offset_y;
@@ -9704,63 +11385,66 @@ static void ImGui::NavEndFrame()
NavUpdateWindowingOverlay();
// 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)
+ NavUpdateCreateWrappingRequest();
+}
+
+static void ImGui::NavUpdateCreateWrappingRequest()
+{
+ ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.NavWindow;
+
+ bool do_forward = false;
+ ImRect bb_rel = window->NavRectRel[g.NavLayer];
+ ImGuiDir clip_dir = g.NavMoveDir;
const ImGuiNavMoveFlags move_flags = g.NavMoveFlags;
- const ImGuiNavMoveFlags wanted_flags = ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX | ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY;
- if (window && NavMoveRequestButNoResultYet() && (g.NavMoveFlags & wanted_flags) && (g.NavMoveFlags & ImGuiNavMoveFlags_Forwarded) == 0)
+ if (g.NavMoveDir == ImGuiDir_Left && (move_flags & (ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX)))
{
- bool do_forward = false;
- ImRect bb_rel = window->NavRectRel[g.NavLayer];
- ImGuiDir clip_dir = g.NavMoveDir;
- if (g.NavMoveDir == ImGuiDir_Left && (move_flags & (ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX)))
+ bb_rel.Min.x = bb_rel.Max.x = window->ContentSize.x + window->WindowPadding.x;
+ if (move_flags & ImGuiNavMoveFlags_WrapX)
{
- bb_rel.Min.x = bb_rel.Max.x =
- ImMax(window->SizeFull.x, window->ContentSize.x + window->WindowPadding.x * 2.0f) - window->Scroll.x;
- if (move_flags & ImGuiNavMoveFlags_WrapX)
- {
- bb_rel.TranslateY(-bb_rel.GetHeight());
- clip_dir = ImGuiDir_Up;
- }
- do_forward = true;
+ bb_rel.TranslateY(-bb_rel.GetHeight()); // Previous row
+ clip_dir = ImGuiDir_Up;
}
- if (g.NavMoveDir == ImGuiDir_Right && (move_flags & (ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX)))
- {
- bb_rel.Min.x = bb_rel.Max.x = -window->Scroll.x;
- if (move_flags & ImGuiNavMoveFlags_WrapX)
- {
- bb_rel.TranslateY(+bb_rel.GetHeight());
- clip_dir = ImGuiDir_Down;
- }
- do_forward = true;
- }
- if (g.NavMoveDir == ImGuiDir_Up && (move_flags & (ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY)))
+ do_forward = true;
+ }
+ if (g.NavMoveDir == ImGuiDir_Right && (move_flags & (ImGuiNavMoveFlags_WrapX | ImGuiNavMoveFlags_LoopX)))
+ {
+ bb_rel.Min.x = bb_rel.Max.x = -window->WindowPadding.x;
+ if (move_flags & ImGuiNavMoveFlags_WrapX)
{
- bb_rel.Min.y = bb_rel.Max.y =
- ImMax(window->SizeFull.y, window->ContentSize.y + window->WindowPadding.y * 2.0f) - window->Scroll.y;
- if (move_flags & ImGuiNavMoveFlags_WrapY)
- {
- bb_rel.TranslateX(-bb_rel.GetWidth());
- clip_dir = ImGuiDir_Left;
- }
- do_forward = true;
+ bb_rel.TranslateY(+bb_rel.GetHeight()); // Next row
+ clip_dir = ImGuiDir_Down;
}
- if (g.NavMoveDir == ImGuiDir_Down && (move_flags & (ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY)))
+ do_forward = true;
+ }
+ if (g.NavMoveDir == ImGuiDir_Up && (move_flags & (ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY)))
+ {
+ bb_rel.Min.y = bb_rel.Max.y = window->ContentSize.y + window->WindowPadding.y;
+ if (move_flags & ImGuiNavMoveFlags_WrapY)
{
- bb_rel.Min.y = bb_rel.Max.y = -window->Scroll.y;
- if (move_flags & ImGuiNavMoveFlags_WrapY)
- {
- bb_rel.TranslateX(+bb_rel.GetWidth());
- clip_dir = ImGuiDir_Right;
- }
- do_forward = true;
+ bb_rel.TranslateX(-bb_rel.GetWidth()); // Previous column
+ clip_dir = ImGuiDir_Left;
}
- if (do_forward)
+ do_forward = true;
+ }
+ if (g.NavMoveDir == ImGuiDir_Down && (move_flags & (ImGuiNavMoveFlags_WrapY | ImGuiNavMoveFlags_LoopY)))
+ {
+ bb_rel.Min.y = bb_rel.Max.y = -window->WindowPadding.y;
+ if (move_flags & ImGuiNavMoveFlags_WrapY)
{
- window->NavRectRel[g.NavLayer] = bb_rel;
- NavMoveRequestForward(g.NavMoveDir, clip_dir, move_flags);
+ bb_rel.TranslateX(+bb_rel.GetWidth()); // Next column
+ clip_dir = ImGuiDir_Right;
}
+ do_forward = true;
}
+ if (!do_forward)
+ return;
+ window->NavRectRel[g.NavLayer] = bb_rel;
+ NavMoveRequestForward(g.NavMoveDir, clip_dir, move_flags, g.NavMoveScrollFlags);
}
static int ImGui::FindWindowFocusIndex(ImGuiWindow* window)
@@ -9768,6 +11452,7 @@ static int ImGui::FindWindowFocusIndex(ImGuiWindow* window)
ImGuiContext& g = *GImGui;
IM_UNUSED(g);
int order = window->FocusOrder;
+ IM_ASSERT(window->RootWindow == window); // No child window (not testing _ChildWindow because of docking)
IM_ASSERT(g.WindowsFocusOrder[order] == window);
return order;
}
@@ -9793,7 +11478,10 @@ static void NavUpdateWindowingHighlightWindow(int focus_change_dir)
if (!window_target)
window_target = FindWindowNavFocusable((focus_change_dir < 0) ? (g.WindowsFocusOrder.Size - 1) : 0, i_current, focus_change_dir);
if (window_target) // Don't reset windowing target if there's a single window in the list
+ {
g.NavWindowingTarget = g.NavWindowingTargetAnim = window_target;
+ g.NavWindowingAccumDeltaPos = g.NavWindowingAccumDeltaSize = ImVec2(0.0f, 0.0f);
+ }
g.NavWindowingToggleLayer = false;
}
@@ -9821,15 +11509,19 @@ static void ImGui::NavUpdateWindowing()
g.NavWindowingTargetAnim = NULL;
}
- // Start CTRL-TAB or Square+L/R window selection
+ // Start CTRL+Tab or Square+L/R window selection
+ 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 start_windowing_with_gamepad = allow_windowing && !g.NavWindowingTarget && IsNavInputTest(ImGuiNavInput_Menu, ImGuiInputReadMode_Pressed);
- const bool start_windowing_with_keyboard = allow_windowing && !g.NavWindowingTarget && nav_keyboard_active && io.KeyCtrl && IsKeyPressedMap(ImGuiKey_Tab);
+ 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 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)
if (ImGuiWindow* window = g.NavWindow ? g.NavWindow : FindWindowNavFocusable(g.WindowsFocusOrder.Size - 1, -INT_MAX, -1))
{
g.NavWindowingTarget = g.NavWindowingTargetAnim = window->RootWindow;
g.NavWindowingTimer = g.NavWindowingHighlightAlpha = 0.0f;
+ 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;
}
@@ -9842,7 +11534,7 @@ static void ImGui::NavUpdateWindowing()
g.NavWindowingHighlightAlpha = ImMax(g.NavWindowingHighlightAlpha, ImSaturate((g.NavWindowingTimer - NAV_WINDOWING_HIGHLIGHT_DELAY) / 0.05f));
// Select window to focus
- const int focus_change_dir = (int)IsNavInputTest(ImGuiNavInput_FocusPrev, ImGuiInputReadMode_RepeatSlow) - (int)IsNavInputTest(ImGuiNavInput_FocusNext, ImGuiInputReadMode_RepeatSlow);
+ const int focus_change_dir = (int)IsKeyPressed(ImGuiKey_GamepadL1) - (int)IsKeyPressed(ImGuiKey_GamepadR1);
if (focus_change_dir != 0)
{
NavUpdateWindowingHighlightWindow(focus_change_dir);
@@ -9850,7 +11542,7 @@ static void ImGui::NavUpdateWindowing()
}
// Single press toggles NavLayer, long press with L/R apply actual focus on release (until then the window was merely rendered top-most)
- if (!IsNavInputDown(ImGuiNavInput_Menu))
+ if (!IsKeyDown(ImGuiKey_NavGamepadMenu))
{
g.NavWindowingToggleLayer &= (g.NavWindowingHighlightAlpha < 1.0f); // Once button was held long enough we don't consider it a tap-to-toggle-layer press anymore.
if (g.NavWindowingToggleLayer && g.NavWindow)
@@ -9865,17 +11557,19 @@ static void ImGui::NavUpdateWindowing()
if (g.NavWindowingTarget && g.NavInputSource == ImGuiInputSource_Keyboard)
{
// Visuals only appears after a brief time after pressing TAB the first time, so that a fast CTRL+TAB doesn't add visual noise
+ ImGuiKeyChord shared_mods = ((g.ConfigNavWindowingKeyNext ? g.ConfigNavWindowingKeyNext : ImGuiMod_Mask_) & (g.ConfigNavWindowingKeyPrev ? g.ConfigNavWindowingKeyPrev : ImGuiMod_Mask_)) & ImGuiMod_Mask_;
+ IM_ASSERT(shared_mods != 0); // Next/Prev shortcut currently needs a shared modifier to "hold", otherwise Prev actions would keep cycling between two windows.
g.NavWindowingHighlightAlpha = ImMax(g.NavWindowingHighlightAlpha, ImSaturate((g.NavWindowingTimer - NAV_WINDOWING_HIGHLIGHT_DELAY) / 0.05f)); // 1.0f
- if (IsKeyPressedMap(ImGuiKey_Tab, true))
- NavUpdateWindowingHighlightWindow(io.KeyShift ? +1 : -1);
- if (!io.KeyCtrl)
+ if (keyboard_next_window || keyboard_prev_window)
+ NavUpdateWindowingHighlightWindow(keyboard_next_window ? -1 : +1);
+ else if ((io.KeyMods & shared_mods) != shared_mods)
apply_focus_window = g.NavWindowingTarget;
}
// Keyboard: Press and Release ALT to toggle menu layer
// - Testing that only Alt is tested prevents Alt+Shift or AltGR from toggling menu layer.
// - AltGR is normally Alt+Ctrl but we can't reliably detect it (not all backends/systems/layout emit it as Alt+Ctrl). But even on keyboards without AltGR we don't want Alt+Ctrl to open menu anyway.
- if (nav_keyboard_active && io.KeyMods == ImGuiKeyModFlags_Alt && (io.KeyModsPrev & ImGuiKeyModFlags_Alt) == 0)
+ if (nav_keyboard_active && IsKeyPressed(ImGuiMod_Alt, ImGuiKeyOwner_None))
{
g.NavWindowingToggleLayer = true;
g.NavInputSource = ImGuiInputSource_Keyboard;
@@ -9884,36 +11578,41 @@ static void ImGui::NavUpdateWindowing()
{
// We cancel toggling nav layer when any text has been typed (generally while holding Alt). (See #370)
// We cancel toggling nav layer when other modifiers are pressed. (See #4439)
- if (io.InputQueueCharacters.Size > 0 || io.KeyCtrl || io.KeyShift || io.KeySuper)
+ // We cancel toggling nav layer if an owner has claimed the key.
+ if (io.InputQueueCharacters.Size > 0 || io.KeyCtrl || io.KeyShift || io.KeySuper || TestKeyOwner(ImGuiMod_Alt, ImGuiKeyOwner_None) == false)
g.NavWindowingToggleLayer = false;
// Apply layer toggle on release
- // Important: we don't assume that Alt was previously held in order to handle loss of focus when backend calls io.AddFocusEvent(false)
// Important: as before version <18314 we lacked an explicit IO event for focus gain/loss, we also compare mouse validity to detect old backends clearing mouse pos on focus loss.
- if (!(io.KeyMods & ImGuiKeyModFlags_Alt) && (io.KeyModsPrev & ImGuiKeyModFlags_Alt) && g.NavWindowingToggleLayer)
+ if (IsKeyReleased(ImGuiMod_Alt) && g.NavWindowingToggleLayer)
if (g.ActiveId == 0 || g.ActiveIdAllowOverlap)
if (IsMousePosValid(&io.MousePos) == IsMousePosValid(&io.MousePosPrev))
apply_toggle_layer = true;
- if (!io.KeyAlt)
+ if (!IsKeyDown(ImGuiMod_Alt))
g.NavWindowingToggleLayer = false;
}
// Move window
if (g.NavWindowingTarget && !(g.NavWindowingTarget->Flags & ImGuiWindowFlags_NoMove))
{
- ImVec2 move_delta;
+ ImVec2 nav_move_dir;
if (g.NavInputSource == ImGuiInputSource_Keyboard && !io.KeyShift)
- move_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard, ImGuiInputReadMode_Down);
+ nav_move_dir = GetKeyVector2d(ImGuiKey_LeftArrow, ImGuiKey_RightArrow, ImGuiKey_UpArrow, ImGuiKey_DownArrow);
if (g.NavInputSource == ImGuiInputSource_Gamepad)
- move_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_PadLStick, ImGuiInputReadMode_Down);
- if (move_delta.x != 0.0f || move_delta.y != 0.0f)
+ nav_move_dir = GetKeyVector2d(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;
- const float move_speed = ImFloor(NAV_MOVE_SPEED * io.DeltaTime * ImMin(io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y)); // FIXME: Doesn't handle variable framerate very well
- ImGuiWindow* moving_window = g.NavWindowingTarget->RootWindow;
- SetWindowPos(moving_window, moving_window->Pos + move_delta * move_speed, ImGuiCond_Always);
- MarkIniSettingsDirty(moving_window);
+ const float move_step = NAV_MOVE_SPEED * io.DeltaTime * ImMin(io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y);
+ g.NavWindowingAccumDeltaPos += nav_move_dir * move_step;
g.NavDisableMouseHover = true;
+ ImVec2 accum_floored = ImFloor(g.NavWindowingAccumDeltaPos);
+ if (accum_floored.x != 0.0f || accum_floored.y != 0.0f)
+ {
+ ImGuiWindow* moving_window = g.NavWindowingTarget->RootWindow;
+ SetWindowPos(moving_window, moving_window->Pos + accum_floored, ImGuiCond_Always);
+ g.NavWindowingAccumDeltaPos -= accum_floored;
+ }
}
}
@@ -9921,8 +11620,7 @@ static void ImGui::NavUpdateWindowing()
if (apply_focus_window && (g.NavWindow == NULL || apply_focus_window != g.NavWindow->RootWindow))
{
ClearActiveID();
- g.NavDisableHighlight = false;
- g.NavDisableMouseHover = true;
+ NavRestoreHighlightAfterMove();
apply_focus_window = NavRestoreLastChildNavWindow(apply_focus_window);
ClosePopupsOverWindow(apply_focus_window, false);
FocusWindow(apply_focus_window);
@@ -9969,6 +11667,7 @@ static void ImGui::NavUpdateWindowing()
if (new_nav_layer == ImGuiNavLayer_Menu)
g.NavWindow->NavLastIds[new_nav_layer] = 0;
NavRestoreLayer(new_nav_layer);
+ NavRestoreHighlightAfterMove();
}
}
}
@@ -9977,10 +11676,10 @@ static void ImGui::NavUpdateWindowing()
static const char* GetFallbackWindowNameForWindowingList(ImGuiWindow* window)
{
if (window->Flags & ImGuiWindowFlags_Popup)
- return "(Popup)";
+ return ImGui::LocalizeGetMsg(ImGuiLocKey_WindowingPopup);
if ((window->Flags & ImGuiWindowFlags_MenuBar) && strcmp(window->Name, "##MainMenuBar") == 0)
- return "(Main menu bar)";
- return "(Untitled)";
+ return ImGui::LocalizeGetMsg(ImGuiLocKey_WindowingMainMenuBar);
+ return ImGui::LocalizeGetMsg(ImGuiLocKey_WindowingUntitled);
}
// Overlay displayed when using CTRL+TAB. Called by EndFrame().
@@ -10019,6 +11718,12 @@ void ImGui::NavUpdateWindowingOverlay()
// [SECTION] DRAG AND DROP
//-----------------------------------------------------------------------------
+bool ImGui::IsDragDropActive()
+{
+ ImGuiContext& g = *GImGui;
+ return g.DragDropActive;
+}
+
void ImGui::ClearDragDrop()
{
ImGuiContext& g = *GImGui;
@@ -10075,19 +11780,20 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags)
return false;
// If you want to use BeginDragDropSource() on an item with no unique identifier for interaction, such as Text() or Image(), you need to:
- // A) Read the explanation below, B) Use the ImGuiDragDropFlags_SourceAllowNullID flag, C) Swallow your programmer pride.
+ // A) Read the explanation below, B) Use the ImGuiDragDropFlags_SourceAllowNullID flag.
if (!(flags & ImGuiDragDropFlags_SourceAllowNullID))
{
IM_ASSERT(0);
return false;
}
- // Magic fallback (=somehow reprehensible) to handle items with no assigned ID, e.g. Text(), Image()
+ // Magic fallback to handle items with no assigned ID, e.g. Text(), Image()
// We build a throwaway ID based on current ID stack + relative AABB of items in window.
- // THE IDENTIFIER WON'T SURVIVE ANY REPOSITIONING OF THE WIDGET, so if your widget moves your dragging operation will be canceled.
+ // THE IDENTIFIER WON'T SURVIVE ANY REPOSITIONING/RESIZINGG OF THE WIDGET, so if your widget moves your dragging operation will be canceled.
// We don't need to maintain/call ClearActiveID() as releasing the button will early out this function and trigger !ActiveIdIsAlive.
// Rely on keeping other window->LastItemXXX fields intact.
source_id = g.LastItemData.ID = window->GetIDFromRectangle(g.LastItemData.Rect);
+ KeepAliveID(source_id);
bool is_hovered = ItemHoverable(g.LastItemData.Rect, source_id);
if (is_hovered && g.IO.MouseClicked[mouse_button])
{
@@ -10103,7 +11809,7 @@ bool ImGui::BeginDragDropSource(ImGuiDragDropFlags flags)
source_drag_active = IsMouseDragging(mouse_button);
// Disable navigation and key inputs while dragging + cancel existing request if any
- SetActiveIdUsingNavAndKeys();
+ SetActiveIdUsingAllKeyboardKeys();
}
else
{
@@ -10207,6 +11913,7 @@ bool ImGui::SetDragDropPayload(const char* type, const void* data, size_t data_s
}
payload.DataFrameCount = g.FrameCount;
+ // Return whether the payload has been accepted
return (g.DragDropAcceptFrameCount == g.FrameCount) || (g.DragDropAcceptFrameCount == g.FrameCount - 1);
}
@@ -10234,7 +11941,7 @@ bool ImGui::BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id)
}
// We don't use BeginDragDropTargetCustom() and duplicate its code because:
-// 1) we use LastItemRectHoveredRect which handles items that pushes a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them.
+// 1) we use LastItemRectHoveredRect which handles items that push a temporarily clip rectangle in their code. Calling BeginDragDropTargetCustom(LastItemRect) would not handle them.
// 2) and it's faster. as this code may be very frequently called, we want to early out as fast as we can.
// Also note how the HoveredWindow test is positioned differently in both functions (in both functions we optimize for the cheapest early out case)
bool ImGui::BeginDragDropTarget()
@@ -10253,7 +11960,10 @@ bool ImGui::BeginDragDropTarget()
const ImRect& display_rect = (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HasDisplayRect) ? g.LastItemData.DisplayRect : g.LastItemData.Rect;
ImGuiID id = g.LastItemData.ID;
if (id == 0)
+ {
id = window->GetIDFromRectangle(display_rect);
+ KeepAliveID(id);
+ }
if (g.DragDropPayload.SourceId == id)
return false;
@@ -10293,9 +12003,8 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop
}
// Render default drop visuals
- // FIXME-DRAGDROP: Settle on a proper default visuals for drop target.
payload.Preview = was_accepted_previously;
- flags |= (g.DragDropSourceFlags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect); // Source can also inhibit the preview (useful for external sources that lives for 1 frame)
+ flags |= (g.DragDropSourceFlags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect); // Source can also inhibit the preview (useful for external sources that live for 1 frame)
if (!(flags & ImGuiDragDropFlags_AcceptNoDrawDefaultRect) && payload.Preview)
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);
@@ -10307,10 +12016,16 @@ const ImGuiPayload* ImGui::AcceptDragDropPayload(const char* type, ImGuiDragDrop
return &payload;
}
+// FIXME-DRAGDROP: Settle on a proper default visuals for drop target.
+void ImGui::RenderDragDropTargetRect(const ImRect& bb)
+{
+ GetWindowDrawList()->AddRect(bb.Min - ImVec2(3.5f, 3.5f), bb.Max + ImVec2(3.5f, 3.5f), GetColorU32(ImGuiCol_DragDropTarget), 0.0f, 0, 2.0f);
+}
+
const ImGuiPayload* ImGui::GetDragDropPayload()
{
ImGuiContext& g = *GImGui;
- return g.DragDropActive ? &g.DragDropPayload : NULL;
+ 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.
@@ -10667,6 +12382,20 @@ ImGuiWindowSettings* ImGui::FindOrCreateWindowSettings(const char* name)
return CreateNewWindowSettings(name);
}
+void ImGui::AddSettingsHandler(const ImGuiSettingsHandler* handler)
+{
+ ImGuiContext& g = *GImGui;
+ IM_ASSERT(FindSettingsHandler(handler->TypeName) == NULL);
+ g.SettingsHandlers.push_back(*handler);
+}
+
+void ImGui::RemoveSettingsHandler(const char* type_name)
+{
+ ImGuiContext& g = *GImGui;
+ if (ImGuiSettingsHandler* handler = FindSettingsHandler(type_name))
+ g.SettingsHandlers.erase(handler);
+}
+
ImGuiSettingsHandler* ImGui::FindSettingsHandler(const char* type_name)
{
ImGuiContext& g = *GImGui;
@@ -10692,7 +12421,8 @@ void ImGui::LoadIniSettingsFromDisk(const char* ini_filename)
char* file_data = (char*)ImFileLoadToMemory(ini_filename, "rb", &file_data_size);
if (!file_data)
return;
- LoadIniSettingsFromMemory(file_data, (size_t)file_data_size);
+ if (file_data_size > 0)
+ LoadIniSettingsFromMemory(file_data, (size_t)file_data_size);
IM_FREE(file_data);
}
@@ -10880,9 +12610,22 @@ static void WindowSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandl
//-----------------------------------------------------------------------------
+// [SECTION] LOCALIZATION
+//-----------------------------------------------------------------------------
+
+void ImGui::LocalizeRegisterEntries(const ImGuiLocEntry* entries, int count)
+{
+ ImGuiContext& g = *GImGui;
+ for (int n = 0; n < count; n++)
+ g.LocalizationTable[entries[n].Key] = entries[n].Text;
+}
+
+
+//-----------------------------------------------------------------------------
// [SECTION] VIEWPORTS, PLATFORM WINDOWS
//-----------------------------------------------------------------------------
// - GetMainViewport()
+// - SetWindowViewport() [Internal]
// - UpdateViewportsNewFrame() [Internal]
// (this section is more complete in the 'docking' branch)
//-----------------------------------------------------------------------------
@@ -10893,6 +12636,11 @@ ImGuiViewport* ImGui::GetMainViewport()
return g.Viewports[0];
}
+void ImGui::SetWindowViewport(ImGuiWindow* window, ImGuiViewportP* viewport)
+{
+ window->Viewport = viewport;
+}
+
// Update viewports and monitor infos
static void ImGui::UpdateViewportsNewFrame()
{
@@ -11063,25 +12811,37 @@ static void SetClipboardTextFn_DefaultImpl(void*, const char* text)
#pragma comment(lib, "imm32")
#endif
-static void ImeSetInputScreenPosFn_DefaultImpl(int x, int y)
+static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport* viewport, ImGuiPlatformImeData* data)
{
// Notify OS Input Method Editor of text input position
- ImGuiIO& io = ImGui::GetIO();
- if (HWND hwnd = (HWND)io.ImeWindowHandle)
- if (HIMC himc = ::ImmGetContext(hwnd))
- {
- COMPOSITIONFORM cf;
- cf.ptCurrentPos.x = x;
- cf.ptCurrentPos.y = y;
- cf.dwStyle = CFS_FORCE_POSITION;
- ::ImmSetCompositionWindow(himc, &cf);
- ::ImmReleaseContext(hwnd, himc);
- }
+ HWND hwnd = (HWND)viewport->PlatformHandleRaw;
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ if (hwnd == 0)
+ hwnd = (HWND)ImGui::GetIO().ImeWindowHandle;
+#endif
+ if (hwnd == 0)
+ return;
+
+ //::ImmAssociateContextEx(hwnd, NULL, data->WantVisible ? IACE_DEFAULT : 0);
+ if (HIMC himc = ::ImmGetContext(hwnd))
+ {
+ COMPOSITIONFORM composition_form = {};
+ composition_form.ptCurrentPos.x = (LONG)data->InputPos.x;
+ composition_form.ptCurrentPos.y = (LONG)data->InputPos.y;
+ composition_form.dwStyle = CFS_FORCE_POSITION;
+ ::ImmSetCompositionWindow(himc, &composition_form);
+ CANDIDATEFORM candidate_form = {};
+ candidate_form.dwStyle = CFS_CANDIDATEPOS;
+ candidate_form.ptCurrentPos.x = (LONG)data->InputPos.x;
+ candidate_form.ptCurrentPos.y = (LONG)data->InputPos.y;
+ ::ImmSetCandidateWindow(himc, &candidate_form);
+ ::ImmReleaseContext(hwnd, himc);
+ }
}
#else
-static void ImeSetInputScreenPosFn_DefaultImpl(int, int) {}
+static void SetPlatformImeDataFn_DefaultImpl(ImGuiViewport*, ImGuiPlatformImeData*) {}
#endif
@@ -11090,20 +12850,25 @@ static void ImeSetInputScreenPosFn_DefaultImpl(int, int) {}
//-----------------------------------------------------------------------------
// - RenderViewportThumbnail() [Internal]
// - RenderViewportsThumbnails() [Internal]
+// - DebugTextEncoding()
// - MetricsHelpMarker() [Internal]
+// - ShowFontAtlas() [Internal]
// - ShowMetricsWindow()
// - DebugNodeColumns() [Internal]
// - DebugNodeDrawList() [Internal]
// - DebugNodeDrawCmdShowMeshAndBoundingBox() [Internal]
+// - DebugNodeFont() [Internal]
+// - DebugNodeFontGlyph() [Internal]
// - DebugNodeStorage() [Internal]
// - DebugNodeTabBar() [Internal]
// - DebugNodeViewport() [Internal]
// - DebugNodeWindow() [Internal]
// - DebugNodeWindowSettings() [Internal]
// - DebugNodeWindowsList() [Internal]
+// - DebugNodeWindowsListByBeginStackParent() [Internal]
//-----------------------------------------------------------------------------
-#ifndef IMGUI_DISABLE_METRICS_WINDOW
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
void ImGui::DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* viewport, const ImRect& bb)
{
@@ -11156,11 +12921,47 @@ static void RenderViewportsThumbnails()
ImGui::Dummy(bb_full.GetSize() * SCALE);
}
+// 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)
+{
+ Text("Text: \"%s\"", str);
+ if (!BeginTable("list", 4, ImGuiTableFlags_Borders | ImGuiTableFlags_RowBg | ImGuiTableFlags_SizingFixedFit))
+ return;
+ TableSetupColumn("Offset");
+ TableSetupColumn("UTF-8");
+ TableSetupColumn("Glyph");
+ TableSetupColumn("Codepoint");
+ TableHeadersRow();
+ for (const char* p = str; *p != 0; )
+ {
+ unsigned int c;
+ const int c_utf8_len = ImTextCharFromUtf8(&c, p, NULL);
+ TableNextColumn();
+ Text("%d", (int)(p - str));
+ TableNextColumn();
+ for (int byte_index = 0; byte_index < c_utf8_len; byte_index++)
+ {
+ if (byte_index > 0)
+ SameLine();
+ Text("0x%02X", (int)(unsigned char)p[byte_index]);
+ }
+ TableNextColumn();
+ if (GetFont()->FindGlyphNoFallback((ImWchar)c))
+ TextUnformatted(p, p + c_utf8_len);
+ else
+ TextUnformatted((c == IM_UNICODE_CODEPOINT_INVALID) ? "[invalid]" : "[missing]");
+ TableNextColumn();
+ Text("U+%04X", (int)c);
+ p += c_utf8_len;
+ }
+ EndTable();
+}
+
// Avoid naming collision with imgui_demo.cpp's HelpMarker() for unity builds.
static void MetricsHelpMarker(const char* desc)
{
ImGui::TextDisabled("(?)");
- if (ImGui::IsItemHovered())
+ if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort))
{
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
@@ -11170,28 +12971,46 @@ static void MetricsHelpMarker(const char* desc)
}
}
-#ifndef IMGUI_DISABLE_DEMO_WINDOWS
-namespace ImGui { void ShowFontAtlas(ImFontAtlas* atlas); }
-#endif
-
-void ImGui::ShowMetricsWindow(bool* p_open)
+// [DEBUG] List fonts in a font atlas and display its texture
+void ImGui::ShowFontAtlas(ImFontAtlas* atlas)
{
- if (!Begin("Dear ImGui Metrics/Debugger", p_open))
+ for (int i = 0; i < atlas->Fonts.Size; i++)
{
- End();
- return;
+ ImFont* font = atlas->Fonts[i];
+ PushID(font);
+ DebugNodeFont(font);
+ PopID();
}
+ if (TreeNode("Atlas texture", "Atlas texture (%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);
+ 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();
+ }
+}
+void ImGui::ShowMetricsWindow(bool* p_open)
+{
ImGuiContext& g = *GImGui;
ImGuiIO& io = g.IO;
ImGuiMetricsConfig* cfg = &g.DebugMetricsConfig;
+ if (cfg->ShowDebugLog)
+ ShowDebugLogWindow(&cfg->ShowDebugLog);
+ if (cfg->ShowStackTool)
+ ShowStackToolWindow(&cfg->ShowStackTool);
+
+ if (!Begin("Dear ImGui Metrics/Debugger", p_open) || GetCurrentWindow()->BeginCount > 1)
+ {
+ End();
+ return;
+ }
// Basic info
Text("Dear ImGui %s", GetVersion());
Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate);
Text("%d vertices, %d indices (%d triangles)", io.MetricsRenderVertices, io.MetricsRenderIndices, io.MetricsRenderIndices / 3);
- Text("%d active windows (%d visible)", io.MetricsActiveWindows, io.MetricsRenderWindows);
- Text("%d active allocations", io.MetricsActiveAllocations);
+ Text("%d visible windows, %d active allocations", io.MetricsRenderWindows, io.MetricsActiveAllocations);
//SameLine(); if (SmallButton("GC")) { g.GcCompactAll = true; }
Separator();
@@ -11210,19 +13029,20 @@ void ImGui::ShowMetricsWindow(bool* p_open)
{
static ImRect GetTableRect(ImGuiTable* table, int rect_type, int n)
{
+ ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent); // Always using last submitted instance
if (rect_type == TRT_OuterRect) { return table->OuterRect; }
else if (rect_type == TRT_InnerRect) { return table->InnerRect; }
else if (rect_type == TRT_WorkRect) { return table->WorkRect; }
else if (rect_type == TRT_HostClipRect) { return table->HostClipRect; }
else if (rect_type == TRT_InnerClipRect) { return table->InnerClipRect; }
else if (rect_type == TRT_BackgroundClipRect) { return table->BgClipRect; }
- else if (rect_type == TRT_ColumnsRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->MinX, table->InnerClipRect.Min.y, c->MaxX, table->InnerClipRect.Min.y + table->LastOuterHeight); }
+ else if (rect_type == TRT_ColumnsRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->MinX, table->InnerClipRect.Min.y, c->MaxX, table->InnerClipRect.Min.y + table_instance->LastOuterHeight); }
else if (rect_type == TRT_ColumnsWorkRect) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->WorkRect.Min.y, c->WorkMaxX, table->WorkRect.Max.y); }
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->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->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->LastFirstRowHeight); }
- else if (rect_type == TRT_ColumnsContentUnfrozen) { ImGuiTableColumn* c = &table->Columns[n]; return ImRect(c->WorkMinX, table->InnerClipRect.Min.y + table->LastFirstRowHeight, c->ContentMaxXUnfrozen, table->InnerClipRect.Max.y); }
+ 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); }
IM_ASSERT(0);
return ImRect();
}
@@ -11245,12 +13065,35 @@ void ImGui::ShowMetricsWindow(bool* p_open)
// Tools
if (TreeNode("Tools"))
{
+ bool show_encoding_viewer = TreeNode("UTF-8 Encoding viewer");
+ SameLine();
+ MetricsHelpMarker("You can also call ImGui::DebugTextEncoding() from your code with a given string to test that your UTF-8 encoding settings are correct.");
+ if (show_encoding_viewer)
+ {
+ static char buf[100] = "";
+ SetNextItemWidth(-FLT_MIN);
+ InputText("##Text", buf, IM_ARRAYSIZE(buf));
+ if (buf[0] != 0)
+ DebugTextEncoding(buf);
+ TreePop();
+ }
+
// The Item Picker tool is super useful to visually select an item and break into the call-stack of where it was submitted.
- if (Button("Item Picker.."))
+ if (Checkbox("Show Item Picker", &g.DebugItemPickerActive) && g.DebugItemPickerActive)
DebugStartItemPicker();
SameLine();
MetricsHelpMarker("Will call the IM_DEBUG_BREAK() macro to break in debugger.\nWarning: If you don't have a debugger attached, this will probably crash.");
+ // Stack Tool is your best friend!
+ Checkbox("Show Debug Log", &cfg->ShowDebugLog);
+ SameLine();
+ MetricsHelpMarker("You can also call ImGui::ShowDebugLogWindow() from your code.");
+
+ // Stack Tool is your best friend!
+ Checkbox("Show Stack Tool", &cfg->ShowStackTool);
+ SameLine();
+ MetricsHelpMarker("You can also call ImGui::ShowStackToolWindow() from your code.");
+
Checkbox("Show windows begin order", &cfg->ShowWindowsBeginOrder);
Checkbox("Show windows rectangles", &cfg->ShowWindowsRects);
SameLine();
@@ -11267,8 +13110,6 @@ void ImGui::ShowMetricsWindow(bool* p_open)
}
Unindent();
}
- Checkbox("Show ImDrawCmd mesh when hovering", &cfg->ShowDrawCmdMesh);
- Checkbox("Show ImDrawCmd bounding boxes when hovering", &cfg->ShowDrawCmdBoundingBoxes);
Checkbox("Show tables rectangles", &cfg->ShowTablesRects);
SameLine();
@@ -11319,8 +13160,27 @@ void ImGui::ShowMetricsWindow(bool* p_open)
}
// Windows
- DebugNodeWindowsList(&g.Windows, "Windows");
- //DebugNodeWindowsList(&g.WindowsFocusOrder, "WindowsFocusOrder");
+ if (TreeNode("Windows", "Windows (%d)", g.Windows.Size))
+ {
+ //SetNextItemOpen(true, ImGuiCond_Once);
+ DebugNodeWindowsList(&g.Windows, "By display order");
+ DebugNodeWindowsList(&g.WindowsFocusOrder, "By focus order (root windows)");
+ if (TreeNode("By submission order (begin stack)"))
+ {
+ // Here we display windows in their submitted order/hierarchy, however note that the Begin stack doesn't constitute a Parent<>Child relationship!
+ ImVector<ImGuiWindow*>& temp_buffer = g.WindowsTempSortBuffer;
+ temp_buffer.resize(0);
+ for (int i = 0; i < g.Windows.Size; i++)
+ if (g.Windows[i]->LastFrameActive + 1 >= g.FrameCount)
+ temp_buffer.push_back(g.Windows[i]);
+ struct Func { static int IMGUI_CDECL WindowComparerByBeginOrder(const void* lhs, const void* rhs) { return ((int)(*(const ImGuiWindow* const *)lhs)->BeginOrderWithinContext - (*(const ImGuiWindow* const*)rhs)->BeginOrderWithinContext); } };
+ ImQsort(temp_buffer.Data, (size_t)temp_buffer.Size, sizeof(ImGuiWindow*), Func::WindowComparerByBeginOrder);
+ DebugNodeWindowsListByBeginStackParent(temp_buffer.Data, temp_buffer.Size, NULL);
+ TreePop();
+ }
+
+ TreePop();
+ }
// DrawLists
int drawlist_count = 0;
@@ -11328,6 +13188,8 @@ void ImGui::ShowMetricsWindow(bool* p_open)
drawlist_count += g.Viewports[viewport_i]->DrawDataBuilder.GetDrawListCount();
if (TreeNode("DrawLists", "DrawLists (%d)", drawlist_count))
{
+ Checkbox("Show ImDrawCmd mesh when hovering", &cfg->ShowDrawCmdMesh);
+ Checkbox("Show ImDrawCmd bounding boxes when hovering", &cfg->ShowDrawCmdBoundingBoxes);
for (int viewport_i = 0; viewport_i < g.Viewports.Size; viewport_i++)
{
ImGuiViewportP* viewport = g.Viewports[viewport_i];
@@ -11354,8 +13216,12 @@ void ImGui::ShowMetricsWindow(bool* p_open)
{
for (int i = 0; i < g.OpenPopupStack.Size; i++)
{
- ImGuiWindow* window = g.OpenPopupStack[i].Window;
- BulletText("PopupID: %08x, Window: '%s'%s%s", g.OpenPopupStack[i].PopupId, window ? window->Name : "NULL", window && (window->Flags & ImGuiWindowFlags_ChildWindow) ? " ChildWindow" : "", window && (window->Flags & ImGuiWindowFlags_ChildMenu) ? " ChildMenu" : "");
+ // As it's difficult to interact with tree nodes while popups are open, we display everything inline.
+ const ImGuiPopupData* popup_data = &g.OpenPopupStack[i];
+ ImGuiWindow* window = popup_data->Window;
+ BulletText("PopupID: %08x, Window: '%s' (%s%s), BackupNavWindow '%s', ParentWindow '%s'",
+ popup_data->PopupId, window ? window->Name : "NULL", window && (window->Flags & ImGuiWindowFlags_ChildWindow) ? "Child;" : "", window && (window->Flags & ImGuiWindowFlags_ChildMenu) ? "Menu;" : "",
+ popup_data->BackupNavWindow ? popup_data->BackupNavWindow->Name : "NULL", window && window->ParentWindow ? window->ParentWindow->Name : "NULL");
}
TreePop();
}
@@ -11383,14 +13249,19 @@ void ImGui::ShowMetricsWindow(bool* p_open)
}
// Details for Fonts
-#ifndef IMGUI_DISABLE_DEMO_WINDOWS
ImFontAtlas* atlas = g.IO.Fonts;
if (TreeNode("Fonts", "Fonts (%d)", atlas->Fonts.Size))
{
ShowFontAtlas(atlas);
TreePop();
}
-#endif
+
+ // Details for InputText
+ if (TreeNode("InputText"))
+ {
+ DebugNodeInputTextState(&g.InputTextState);
+ TreePop();
+ }
// Details for Docking
#ifdef IMGUI_HAS_DOCK
@@ -11448,11 +13319,46 @@ void ImGui::ShowMetricsWindow(bool* p_open)
TreePop();
}
- // Misc Details
- if (TreeNode("Internal state"))
+ if (TreeNode("Key Owners & Shortcut Routing"))
{
- const char* input_source_names[] = { "None", "Mouse", "Keyboard", "Gamepad", "Nav", "Clipboard" }; IM_ASSERT(IM_ARRAYSIZE(input_source_names) == ImGuiInputSource_COUNT);
+ TextUnformatted("Key Owners:");
+ if (BeginListBox("##owners", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 8)))
+ {
+ 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();
+ }
+ TextUnformatted("Shortcut Routing:");
+ if (BeginListBox("##routes", ImVec2(-FLT_MIN, GetTextLineHeightWithSpacing() * 8)))
+ {
+ 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);
+ TreePop();
+ }
+ if (TreeNode("Internal state"))
+ {
Text("WINDOWING");
Indent();
Text("HoveredWindow: '%s'", g.HoveredWindow ? g.HoveredWindow->Name : "NULL");
@@ -11463,18 +13369,22 @@ void ImGui::ShowMetricsWindow(bool* p_open)
Text("ITEMS");
Indent();
- Text("ActiveId: 0x%08X/0x%08X (%.2f sec), AllowOverlap: %d, Source: %s", g.ActiveId, g.ActiveIdPreviousFrame, g.ActiveIdTimer, g.ActiveIdAllowOverlap, input_source_names[g.ActiveIdSource]);
+ Text("ActiveId: 0x%08X/0x%08X (%.2f sec), AllowOverlap: %d, Source: %s", g.ActiveId, g.ActiveIdPreviousFrame, g.ActiveIdTimer, g.ActiveIdAllowOverlap, GetInputSourceName(g.ActiveIdSource));
+ DebugLocateItemOnHover(g.ActiveId);
Text("ActiveIdWindow: '%s'", g.ActiveIdWindow ? g.ActiveIdWindow->Name : "NULL");
- Text("ActiveIdUsing: Wheel: %d, NavDirMask: %X, NavInputMask: %X, KeyInputMask: %llX", g.ActiveIdUsingMouseWheel, g.ActiveIdUsingNavDirMask, g.ActiveIdUsingNavInputMask, g.ActiveIdUsingKeyInputMask);
+ Text("ActiveIdUsing: AllKeyboardKeys: %d, NavDirMask: %X", g.ActiveIdUsingAllKeyboardKeys, g.ActiveIdUsingNavDirMask);
Text("HoveredId: 0x%08X (%.2f sec), AllowOverlap: %d", g.HoveredIdPreviousFrame, g.HoveredIdTimer, g.HoveredIdAllowOverlap); // Not displaying g.HoveredId as it is update mid-frame
+ Text("HoverDelayId: 0x%08X, Timer: %.2f, ClearTimer: %.2f", g.HoverDelayId, g.HoverDelayTimer, g.HoverDelayClearTimer);
Text("DragDrop: %d, SourceId = 0x%08X, Payload \"%s\" (%d bytes)", g.DragDropActive, g.DragDropPayload.SourceId, g.DragDropPayload.DataType, g.DragDropPayload.DataSize);
+ DebugLocateItemOnHover(g.DragDropPayload.SourceId);
Unindent();
Text("NAV,FOCUS");
Indent();
Text("NavWindow: '%s'", g.NavWindow ? g.NavWindow->Name : "NULL");
Text("NavId: 0x%08X, NavLayer: %d", g.NavId, g.NavLayer);
- Text("NavInputSource: %s", input_source_names[g.NavInputSource]);
+ 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("NavActivateFlags: %04X", g.NavActivateFlags);
@@ -11548,25 +13458,6 @@ void ImGui::ShowMetricsWindow(bool* p_open)
End();
}
-// [DEBUG] List fonts in a font atlas and display its texture
-void ImGui::ShowFontAtlas(ImFontAtlas* atlas)
-{
- for (int i = 0; i < atlas->Fonts.Size; i++)
- {
- ImFont* font = atlas->Fonts[i];
- PushID(font);
- DebugNodeFont(font);
- PopID();
- }
- if (TreeNode("Atlas texture", "Atlas texture (%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);
- 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();
- }
-}
-
// [DEBUG] Display contents of Columns
void ImGui::DebugNodeColumns(ImGuiOldColumns* columns)
{
@@ -11597,7 +13488,7 @@ void ImGui::DebugNodeDrawList(ImGuiWindow* window, const ImDrawList* draw_list,
}
ImDrawList* fg_draw_list = GetForegroundDrawList(window); // Render additional visuals into the top-most draw list
- if (window && IsItemHovered())
+ if (window && IsItemHovered() && fg_draw_list)
fg_draw_list->AddRect(window->Pos, window->Pos + window->Size, IM_COL32(255, 255, 0, 255));
if (!node_open)
return;
@@ -11776,17 +13667,13 @@ void ImGui::DebugNodeFont(ImFont* font)
ImVec2 cell_p2(cell_p1.x + cell_size, cell_p1.y + cell_size);
const ImFontGlyph* glyph = font->FindGlyphNoFallback((ImWchar)(base + n));
draw_list->AddRect(cell_p1, cell_p2, glyph ? IM_COL32(255, 255, 255, 100) : IM_COL32(255, 255, 255, 50));
- if (glyph)
- font->RenderChar(draw_list, cell_size, cell_p1, glyph_col, (ImWchar)(base + n));
- if (glyph && IsMouseHoveringRect(cell_p1, cell_p2))
+ if (!glyph)
+ continue;
+ font->RenderChar(draw_list, cell_size, cell_p1, glyph_col, (ImWchar)(base + n));
+ if (IsMouseHoveringRect(cell_p1, cell_p2))
{
BeginTooltip();
- Text("Codepoint: U+%04X", base + n);
- Separator();
- Text("Visible: %d", glyph->Visible);
- Text("AdvanceX: %.1f", glyph->AdvanceX);
- Text("Pos: (%.2f,%.2f)->(%.2f,%.2f)", glyph->X0, glyph->Y0, glyph->X1, glyph->Y1);
- Text("UV: (%.3f,%.3f)->(%.3f,%.3f)", glyph->U0, glyph->V0, glyph->U1, glyph->V1);
+ DebugNodeFontGlyph(font, glyph);
EndTooltip();
}
}
@@ -11798,6 +13685,16 @@ void ImGui::DebugNodeFont(ImFont* font)
TreePop();
}
+void ImGui::DebugNodeFontGlyph(ImFont*, const ImFontGlyph* glyph)
+{
+ Text("Codepoint: U+%04X", glyph->Codepoint);
+ Separator();
+ Text("Visible: %d", glyph->Visible);
+ Text("AdvanceX: %.1f", glyph->AdvanceX);
+ Text("Pos: (%.2f,%.2f)->(%.2f,%.2f)", glyph->X0, glyph->Y0, glyph->X1, glyph->Y1);
+ Text("UV: (%.3f,%.3f)->(%.3f,%.3f)", glyph->U0, glyph->V0, glyph->U1, glyph->V1);
+}
+
// [DEBUG] Display contents of ImGuiStorage
void ImGui::DebugNodeStorage(ImGuiStorage* storage, const char* label)
{
@@ -11846,7 +13743,7 @@ void ImGui::DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label)
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: %.1f, Width: %.1f/%.1f",
+ 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);
PopID();
}
@@ -11910,13 +13807,10 @@ void ImGui::DebugNodeWindow(ImGuiWindow* window, const char* label)
{
ImRect r = window->NavRectRel[layer];
if (r.Min.x >= r.Max.y && r.Min.y >= r.Max.y)
- {
BulletText("NavLastIds[%d]: 0x%08X", layer, window->NavLastIds[layer]);
- continue;
- }
- BulletText("NavLastIds[%d]: 0x%08X at +(%.1f,%.1f)(%.1f,%.1f)", layer, window->NavLastIds[layer], r.Min.x, r.Min.y, r.Max.x, r.Max.y);
- if (IsItemHovered())
- GetForegroundDrawList(window)->AddRect(r.Min + window->Pos, r.Max + window->Pos, IM_COL32(255, 255, 0, 255));
+ else
+ BulletText("NavLastIds[%d]: 0x%08X at +(%.1f,%.1f)(%.1f,%.1f)", layer, window->NavLastIds[layer], r.Min.x, r.Min.y, r.Max.x, r.Max.y);
+ DebugLocateItemOnHover(window->NavLastIds[layer]);
}
BulletText("NavLayersActiveMask: %X, NavLastChildNavWindow: %s", window->DC.NavLayersActiveMask, window->NavLastChildNavWindow ? window->NavLastChildNavWindow->Name : "NULL");
if (window->RootWindow != window) { DebugNodeWindow(window->RootWindow, "RootWindow"); }
@@ -11942,7 +13836,6 @@ void ImGui::DebugNodeWindowsList(ImVector<ImGuiWindow*>* windows, const char* la
{
if (!TreeNode(label, "%s (%d)", label, windows->Size))
return;
- Text("(In front-to-back order:)");
for (int i = windows->Size - 1; i >= 0; i--) // Iterate front to back
{
PushID((*windows)[i]);
@@ -11952,6 +13845,359 @@ void ImGui::DebugNodeWindowsList(ImVector<ImGuiWindow*>* windows, const char* la
TreePop();
}
+// FIXME-OPT: This is technically suboptimal, but it is simpler this way.
+void ImGui::DebugNodeWindowsListByBeginStackParent(ImGuiWindow** windows, int windows_size, ImGuiWindow* parent_in_begin_stack)
+{
+ for (int i = 0; i < windows_size; i++)
+ {
+ ImGuiWindow* window = windows[i];
+ if (window->ParentWindowInBeginStack != parent_in_begin_stack)
+ continue;
+ char buf[20];
+ ImFormatString(buf, IM_ARRAYSIZE(buf), "[%04d] Window", window->BeginOrderWithinContext);
+ //BulletText("[%04d] Window '%s'", window->BeginOrderWithinContext, window->Name);
+ DebugNodeWindow(window, buf);
+ Indent();
+ DebugNodeWindowsListByBeginStackParent(windows + i + 1, windows_size - i - 1, window);
+ Unindent();
+ }
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] DEBUG LOG WINDOW
+//-----------------------------------------------------------------------------
+
+void ImGui::DebugLog(const char* fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ DebugLogV(fmt, args);
+ va_end(args);
+}
+
+void ImGui::DebugLogV(const char* fmt, va_list args)
+{
+ ImGuiContext& g = *GImGui;
+ const int old_size = g.DebugLogBuf.size();
+ g.DebugLogBuf.appendf("[%05d] ", g.FrameCount);
+ g.DebugLogBuf.appendfv(fmt, args);
+ if (g.DebugLogFlags & ImGuiDebugLogFlags_OutputToTTY)
+ IMGUI_DEBUG_PRINTF("%s", g.DebugLogBuf.begin() + old_size);
+ g.DebugLogIndex.append(g.DebugLogBuf.c_str(), old_size, g.DebugLogBuf.size());
+}
+
+void ImGui::ShowDebugLogWindow(bool* p_open)
+{
+ ImGuiContext& g = *GImGui;
+ if (!(g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize))
+ SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 12.0f), ImGuiCond_FirstUseEver);
+ if (!Begin("Dear ImGui Debug Log", p_open) || GetCurrentWindow()->BeginCount > 1)
+ {
+ End();
+ return;
+ }
+
+ AlignTextToFramePadding();
+ Text("Log events:");
+ SameLine(); 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(); CheckboxFlags("Clipper", &g.DebugLogFlags, ImGuiDebugLogFlags_EventClipper);
+ SameLine(); CheckboxFlags("IO", &g.DebugLogFlags, ImGuiDebugLogFlags_EventIO);
+
+ if (SmallButton("Clear"))
+ {
+ g.DebugLogBuf.clear();
+ g.DebugLogIndex.clear();
+ }
+ SameLine();
+ if (SmallButton("Copy"))
+ SetClipboardText(g.DebugLogBuf.c_str());
+ BeginChild("##log", ImVec2(0.0f, 0.0f), true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar);
+
+ ImGuiListClipper clipper;
+ clipper.Begin(g.DebugLogIndex.size());
+ while (clipper.Step())
+ for (int line_no = clipper.DisplayStart; line_no < clipper.DisplayEnd; line_no++)
+ {
+ const char* line_begin = g.DebugLogIndex.get_line_begin(g.DebugLogBuf.c_str(), line_no);
+ const char* line_end = g.DebugLogIndex.get_line_end(g.DebugLogBuf.c_str(), line_no);
+ TextUnformatted(line_begin, line_end);
+ ImRect text_rect = g.LastItemData.Rect;
+ if (IsItemHovered())
+ 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)
+ continue;
+ ImVec2 p0 = CalcTextSize(line_begin, p);
+ ImVec2 p1 = CalcTextSize(p, p + 10);
+ g.LastItemData.Rect = ImRect(text_rect.Min + ImVec2(p0.x, 0.0f), text_rect.Min + ImVec2(p0.x + p1.x, p1.y));
+ if (IsMouseHoveringRect(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, true))
+ DebugLocateItemOnHover(id);
+ p += 10;
+ }
+ }
+ if (GetScrollY() >= GetScrollMaxY())
+ SetScrollHereY(1.0f);
+ EndChild();
+
+ End();
+}
+
+//-----------------------------------------------------------------------------
+// [SECTION] OTHER DEBUG TOOLS (ITEM PICKER, STACK TOOL)
+//-----------------------------------------------------------------------------
+
+static const ImU32 DEBUG_LOCATE_ITEM_COLOR = IM_COL32(0, 255, 0, 255); // Green
+
+void ImGui::DebugLocateItem(ImGuiID target_id)
+{
+ ImGuiContext& g = *GImGui;
+ g.DebugLocateId = target_id;
+ g.DebugLocateFrames = 2;
+}
+
+void ImGui::DebugLocateItemOnHover(ImGuiID target_id)
+{
+ if (target_id == 0 || !IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenBlockedByPopup))
+ return;
+ ImGuiContext& g = *GImGui;
+ DebugLocateItem(target_id);
+ GetForegroundDrawList(g.CurrentWindow)->AddRect(g.LastItemData.Rect.Min - ImVec2(3.0f, 3.0f), g.LastItemData.Rect.Max + ImVec2(3.0f, 3.0f), DEBUG_LOCATE_ITEM_COLOR);
+}
+
+void ImGui::DebugLocateItemResolveWithLastItem()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiLastItemData item_data = g.LastItemData;
+ g.DebugLocateId = 0;
+ ImDrawList* draw_list = GetForegroundDrawList(g.CurrentWindow);
+ ImRect r = item_data.Rect;
+ r.Expand(3.0f);
+ ImVec2 p1 = g.IO.MousePos;
+ ImVec2 p2 = ImVec2((p1.x < r.Min.x) ? r.Min.x : (p1.x > r.Max.x) ? r.Max.x : p1.x, (p1.y < r.Min.y) ? r.Min.y : (p1.y > r.Max.y) ? r.Max.y : p1.y);
+ draw_list->AddRect(r.Min, r.Max, DEBUG_LOCATE_ITEM_COLOR);
+ draw_list->AddLine(p1, p2, DEBUG_LOCATE_ITEM_COLOR);
+}
+
+// [DEBUG] Item picker tool - start with DebugStartItemPicker() - useful to visually select an item and break into its call-stack.
+void ImGui::UpdateDebugToolItemPicker()
+{
+ ImGuiContext& g = *GImGui;
+ g.DebugItemPickerBreakId = 0;
+ if (!g.DebugItemPickerActive)
+ return;
+
+ const ImGuiID hovered_id = g.HoveredIdPreviousFrame;
+ SetMouseCursor(ImGuiMouseCursor_Hand);
+ if (IsKeyPressed(ImGuiKey_Escape))
+ g.DebugItemPickerActive = false;
+ const bool change_mapping = g.IO.KeyMods == (ImGuiMod_Ctrl | ImGuiMod_Shift);
+ if (!change_mapping && IsMouseClicked(g.DebugItemPickerMouseButton) && hovered_id)
+ {
+ g.DebugItemPickerBreakId = hovered_id;
+ g.DebugItemPickerActive = false;
+ }
+ for (int mouse_button = 0; mouse_button < 3; mouse_button++)
+ if (change_mapping && IsMouseClicked(mouse_button))
+ g.DebugItemPickerMouseButton = (ImU8)mouse_button;
+ SetNextWindowBgAlpha(0.70f);
+ BeginTooltip();
+ Text("HoveredId: 0x%08X", hovered_id);
+ Text("Press ESC to abort picking.");
+ const char* mouse_button_names[] = { "Left", "Right", "Middle" };
+ if (change_mapping)
+ Text("Remap w/ Ctrl+Shift: click anywhere to select new mouse button.");
+ else
+ TextColored(GetStyleColorVec4(hovered_id ? ImGuiCol_Text : ImGuiCol_TextDisabled), "Click %s Button to break in debugger! (remap w/ Ctrl+Shift)", mouse_button_names[g.DebugItemPickerMouseButton]);
+ EndTooltip();
+}
+
+// [DEBUG] Stack Tool: update queries. Called by NewFrame()
+void ImGui::UpdateDebugToolStackQueries()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiStackTool* tool = &g.DebugStackTool;
+
+ // Clear hook when stack tool is not visible
+ g.DebugHookIdInfo = 0;
+ if (g.FrameCount != tool->LastActiveFrame + 1)
+ return;
+
+ // Update queries. The steps are: -1: query Stack, >= 0: query each stack item
+ // We can only perform 1 ID Info query every frame. This is designed so the GetID() tests are cheap and constant-time
+ const ImGuiID query_id = g.HoveredIdPreviousFrame ? g.HoveredIdPreviousFrame : g.ActiveId;
+ if (tool->QueryId != query_id)
+ {
+ tool->QueryId = query_id;
+ tool->StackLevel = -1;
+ tool->Results.resize(0);
+ }
+ if (query_id == 0)
+ return;
+
+ // Advance to next stack level when we got our result, or after 2 frames (in case we never get a result)
+ int stack_level = tool->StackLevel;
+ if (stack_level >= 0 && stack_level < tool->Results.Size)
+ if (tool->Results[stack_level].QuerySuccess || tool->Results[stack_level].QueryFrameCount > 2)
+ tool->StackLevel++;
+
+ // Update hook
+ stack_level = tool->StackLevel;
+ if (stack_level == -1)
+ g.DebugHookIdInfo = query_id;
+ if (stack_level >= 0 && stack_level < tool->Results.Size)
+ {
+ g.DebugHookIdInfo = tool->Results[stack_level].ID;
+ tool->Results[stack_level].QueryFrameCount++;
+ }
+}
+
+// [DEBUG] Stack tool: hooks called by GetID() family functions
+void ImGui::DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* data_id, const void* data_id_end)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ ImGuiStackTool* tool = &g.DebugStackTool;
+
+ // Step 0: stack query
+ // This assumes that the ID was computed with the current ID stack, which tends to be the case for our widget.
+ if (tool->StackLevel == -1)
+ {
+ tool->StackLevel++;
+ tool->Results.resize(window->IDStack.Size + 1, ImGuiStackLevelInfo());
+ for (int n = 0; n < window->IDStack.Size + 1; n++)
+ tool->Results[n].ID = (n < window->IDStack.Size) ? window->IDStack[n] : id;
+ return;
+ }
+
+ // Step 1+: query for individual level
+ IM_ASSERT(tool->StackLevel >= 0);
+ if (tool->StackLevel != window->IDStack.Size)
+ return;
+ ImGuiStackLevelInfo* info = &tool->Results[tool->StackLevel];
+ IM_ASSERT(info->ID == id && info->QueryFrameCount > 0);
+
+ switch (data_type)
+ {
+ case ImGuiDataType_S32:
+ ImFormatString(info->Desc, IM_ARRAYSIZE(info->Desc), "%d", (int)(intptr_t)data_id);
+ break;
+ case ImGuiDataType_String:
+ ImFormatString(info->Desc, IM_ARRAYSIZE(info->Desc), "%.*s", data_id_end ? (int)((const char*)data_id_end - (const char*)data_id) : (int)strlen((const char*)data_id), (const char*)data_id);
+ break;
+ case ImGuiDataType_Pointer:
+ ImFormatString(info->Desc, IM_ARRAYSIZE(info->Desc), "(void*)0x%p", data_id);
+ break;
+ case ImGuiDataType_ID:
+ if (info->Desc[0] != 0) // PushOverrideID() is often used to avoid hashing twice, which would lead to 2 calls to DebugHookIdInfo(). We prioritize the first one.
+ return;
+ ImFormatString(info->Desc, IM_ARRAYSIZE(info->Desc), "0x%08X [override]", id);
+ break;
+ default:
+ IM_ASSERT(0);
+ }
+ info->QuerySuccess = true;
+ info->DataType = data_type;
+}
+
+static int StackToolFormatLevelInfo(ImGuiStackTool* tool, int n, bool format_for_ui, char* buf, size_t buf_size)
+{
+ ImGuiStackLevelInfo* info = &tool->Results[n];
+ ImGuiWindow* window = (info->Desc[0] == 0 && n == 0) ? ImGui::FindWindowByID(info->ID) : NULL;
+ if (window) // Source: window name (because the root ID don't call GetID() and so doesn't get hooked)
+ return ImFormatString(buf, buf_size, format_for_ui ? "\"%s\" [window]" : "%s", window->Name);
+ if (info->QuerySuccess) // Source: GetID() hooks (prioritize over ItemInfo() because we frequently use patterns like: PushID(str), Button("") where they both have same id)
+ return ImFormatString(buf, buf_size, (format_for_ui && info->DataType == ImGuiDataType_String) ? "\"%s\"" : "%s", info->Desc);
+ if (tool->StackLevel < tool->Results.Size) // Only start using fallback below when all queries are done, so during queries we don't flickering ??? markers.
+ return (*buf = 0);
+#ifdef IMGUI_ENABLE_TEST_ENGINE
+ if (const char* label = ImGuiTestEngine_FindItemDebugLabel(GImGui, info->ID)) // Source: ImGuiTestEngine's ItemInfo()
+ return ImFormatString(buf, buf_size, format_for_ui ? "??? \"%s\"" : "%s", label);
+#endif
+ return ImFormatString(buf, buf_size, "???");
+}
+
+// Stack Tool: Display UI
+void ImGui::ShowStackToolWindow(bool* p_open)
+{
+ ImGuiContext& g = *GImGui;
+ if (!(g.NextWindowData.Flags & ImGuiNextWindowDataFlags_HasSize))
+ SetNextWindowSize(ImVec2(0.0f, GetFontSize() * 8.0f), ImGuiCond_FirstUseEver);
+ if (!Begin("Dear ImGui Stack Tool", p_open) || GetCurrentWindow()->BeginCount > 1)
+ {
+ End();
+ return;
+ }
+
+ // Display hovered/active status
+ ImGuiStackTool* tool = &g.DebugStackTool;
+ const ImGuiID hovered_id = g.HoveredIdPreviousFrame;
+ const ImGuiID active_id = g.ActiveId;
+#ifdef IMGUI_ENABLE_TEST_ENGINE
+ Text("HoveredId: 0x%08X (\"%s\"), ActiveId: 0x%08X (\"%s\")", hovered_id, hovered_id ? ImGuiTestEngine_FindItemDebugLabel(&g, hovered_id) : "", active_id, active_id ? ImGuiTestEngine_FindItemDebugLabel(&g, active_id) : "");
+#else
+ Text("HoveredId: 0x%08X, ActiveId: 0x%08X", hovered_id, active_id);
+#endif
+ SameLine();
+ MetricsHelpMarker("Hover an item with the mouse to display elements of the ID Stack leading to the item's final ID.\nEach level of the stack correspond to a PushID() call.\nAll levels of the stack are hashed together to make the final ID of a widget (ID displayed at the bottom level of the stack).\nRead FAQ entry about the ID stack for details.");
+
+ // CTRL+C to copy path
+ const float time_since_copy = (float)g.Time - tool->CopyToClipboardLastTime;
+ Checkbox("Ctrl+C: copy path to clipboard", &tool->CopyToClipboardOnCtrlC);
+ SameLine();
+ TextColored((time_since_copy >= 0.0f && time_since_copy < 0.75f && ImFmod(time_since_copy, 0.25f) < 0.25f * 0.5f) ? ImVec4(1.f, 1.f, 0.3f, 1.f) : ImVec4(), "*COPIED*");
+ if (tool->CopyToClipboardOnCtrlC && IsKeyDown(ImGuiMod_Ctrl) && IsKeyPressed(ImGuiKey_C))
+ {
+ tool->CopyToClipboardLastTime = (float)g.Time;
+ char* p = g.TempBuffer.Data;
+ char* p_end = p + g.TempBuffer.Size;
+ for (int stack_n = 0; stack_n < tool->Results.Size && p + 3 < p_end; stack_n++)
+ {
+ *p++ = '/';
+ char level_desc[256];
+ StackToolFormatLevelInfo(tool, stack_n, false, level_desc, IM_ARRAYSIZE(level_desc));
+ for (int n = 0; level_desc[n] && p + 2 < p_end; n++)
+ {
+ if (level_desc[n] == '/')
+ *p++ = '\\';
+ *p++ = level_desc[n];
+ }
+ }
+ *p = '\0';
+ SetClipboardText(g.TempBuffer.Data);
+ }
+
+ // Display decorated stack
+ tool->LastActiveFrame = g.FrameCount;
+ if (tool->Results.Size > 0 && BeginTable("##table", 3, ImGuiTableFlags_Borders))
+ {
+ const float id_width = CalcTextSize("0xDDDDDDDD").x;
+ TableSetupColumn("Seed", ImGuiTableColumnFlags_WidthFixed, id_width);
+ TableSetupColumn("PushID", ImGuiTableColumnFlags_WidthStretch);
+ TableSetupColumn("Result", ImGuiTableColumnFlags_WidthFixed, id_width);
+ TableHeadersRow();
+ for (int n = 0; n < tool->Results.Size; n++)
+ {
+ ImGuiStackLevelInfo* info = &tool->Results[n];
+ TableNextColumn();
+ Text("0x%08X", (n > 0) ? tool->Results[n - 1].ID : 0);
+ TableNextColumn();
+ StackToolFormatLevelInfo(tool, n, true, g.TempBuffer.Data, g.TempBuffer.Size);
+ TextUnformatted(g.TempBuffer.Data);
+ TableNextColumn();
+ Text("0x%08X", info->ID);
+ if (n == tool->Results.Size - 1)
+ TableSetBgColor(ImGuiTableBgTarget_CellBg, GetColorU32(ImGuiCol_Header));
+ }
+ EndTable();
+ }
+ End();
+}
+
#else
void ImGui::ShowMetricsWindow(bool*) {}
@@ -11967,7 +14213,15 @@ void ImGui::DebugNodeWindowSettings(ImGuiWindowSettings*) {}
void ImGui::DebugNodeWindowsList(ImVector<ImGuiWindow*>*, const char*) {}
void ImGui::DebugNodeViewport(ImGuiViewportP*) {}
-#endif
+void ImGui::DebugLog(const char*, ...) {}
+void ImGui::DebugLogV(const char*, va_list) {}
+void ImGui::ShowDebugLogWindow(bool*) {}
+void ImGui::ShowStackToolWindow(bool*) {}
+void ImGui::DebugHookIdInfo(ImGuiID, ImGuiDataType, const void*, const void*) {}
+void ImGui::UpdateDebugToolItemPicker() {}
+void ImGui::UpdateDebugToolStackQueries() {}
+
+#endif // #ifndef IMGUI_DISABLE_DEBUG_TOOLS
//-----------------------------------------------------------------------------
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h
index f679762e5ae..a626c79f4b0 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui.h
@@ -1,4 +1,4 @@
-// dear imgui, v1.85 WIP
+// dear imgui, v1.89.1 WIP
// (headers)
// Help:
@@ -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/4451 (please post your screenshots/video there!)
+// - Gallery https://github.com/ocornut/imgui/issues/5243 (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
@@ -20,6 +20,12 @@
// - For first-time users having issues compiling/linking/running or issues loading fonts:
// please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above.
+// 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_HAS_TABLE
+
/*
Index of this file:
@@ -35,19 +41,19 @@ Index of this file:
// [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)
+// [SECTION] Platform Dependent Interfaces (ImGuiPlatformImeData)
// [SECTION] Obsolete functions and types
*/
#pragma once
-// Configuration file with compile-time options (edit imconfig.h or '#define IMGUI_USER_CONFIG "myfilename.h" from your build system')
+// Configuration file with compile-time options
+// (edit imconfig.h or '#define IMGUI_USER_CONFIG "myfilename.h" from your build system')
#ifdef IMGUI_USER_CONFIG
#include IMGUI_USER_CONFIG
#endif
-#if !defined(IMGUI_DISABLE_INCLUDE_IMCONFIG_H) || defined(IMGUI_INCLUDE_IMCONFIG_H)
#include "imconfig.h"
-#endif
#ifndef IMGUI_DISABLE
@@ -61,13 +67,6 @@ Index of this file:
#include <stddef.h> // ptrdiff_t, NULL
#include <string.h> // memset, memmove, memcpy, strlen, strchr, strcpy, strcmp
-// Version
-// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
-#define IMGUI_VERSION "1.85 WIP"
-#define IMGUI_VERSION_NUM 18417
-#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
-#define IMGUI_HAS_TABLE
-
// Define attributes of all API symbols declarations (e.g. for DLL under Windows)
// IMGUI_API is used for core imgui functions, IMGUI_IMPL_API is used for the default backends files (imgui_impl_xxx.h)
// Using dear imgui via a shared library is not recommended, because we don't guarantee backward nor forward ABI compatibility (also function call overhead, as dear imgui is a call-heavy API)
@@ -85,14 +84,11 @@ Index of this file:
#endif
#define IM_ARRAYSIZE(_ARR) ((int)(sizeof(_ARR) / sizeof(*(_ARR)))) // Size of a static C-style array. Don't use on pointers!
#define IM_UNUSED(_VAR) ((void)(_VAR)) // Used to silence "unused variable warnings". Often useful as asserts may be stripped out from final builds.
-#if (__cplusplus >= 201100) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201100)
#define IM_OFFSETOF(_TYPE,_MEMBER) offsetof(_TYPE, _MEMBER) // Offset of _MEMBER within _TYPE. Standardized as offsetof() in C++11
-#else
-#define IM_OFFSETOF(_TYPE,_MEMBER) ((size_t)&(((_TYPE*)0)->_MEMBER)) // Offset of _MEMBER within _TYPE. Old style macro.
-#endif
+#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
// Helper Macros - IM_FMTARGS, IM_FMTLIST: Apply printf-style warnings to our formatting functions.
-#if !defined(IMGUI_USE_STB_SPRINTF) && defined(__MINGW32__)
+#if !defined(IMGUI_USE_STB_SPRINTF) && defined(__MINGW32__) && !defined(__clang__)
#define IM_FMTARGS(FMT) __attribute__((format(gnu_printf, FMT, FMT+1)))
#define IM_FMTLIST(FMT) __attribute__((format(gnu_printf, FMT, 0)))
#elif !defined(IMGUI_USE_STB_SPRINTF) && (defined(__clang__) || defined(__GNUC__))
@@ -104,7 +100,7 @@ Index of this file:
#endif
// Disable some of MSVC most aggressive Debug runtime checks in function header/footer (used in some simple/low-level functions)
-#if defined(_MSC_VER) && !defined(__clang__) && !defined(IMGUI_DEBUG_PARANOID)
+#if defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(IMGUI_DEBUG_PARANOID)
#define IM_MSVC_RUNTIME_CHECKS_OFF __pragma(runtime_checks("",off)) __pragma(check_stack(off)) __pragma(strict_gs_check(push,off))
#define IM_MSVC_RUNTIME_CHECKS_RESTORE __pragma(runtime_checks("",restore)) __pragma(check_stack()) __pragma(strict_gs_check(pop))
#else
@@ -151,9 +147,11 @@ struct ImColor; // Helper functions to create a color that c
struct ImGuiContext; // Dear ImGui context (opaque structure, unless including imgui_internal.h)
struct ImGuiIO; // Main configuration and I/O between your application and ImGui
struct ImGuiInputTextCallbackData; // Shared state of InputText() when using custom ImGuiInputTextCallback (rare/advanced use)
+struct ImGuiKeyData; // Storage for ImGuiIO and IsKeyDown(), IsKeyPressed() etc functions.
struct ImGuiListClipper; // Helper to manually clip large list of items
-struct ImGuiOnceUponAFrame; // Helper for running a block of code not more than once a frame, used by IMGUI_ONCE_UPON_A_FRAME macro
+struct ImGuiOnceUponAFrame; // Helper for running a block of code not more than once a frame
struct ImGuiPayload; // User data payload for drag and drop operations
+struct ImGuiPlatformImeData; // Platform IME data for io.SetPlatformImeDataFn() function.
struct ImGuiSizeCallbackData; // Callback data when using SetNextWindowSizeConstraints() (rare/advanced use)
struct ImGuiStorage; // Helper for key->value storage
struct ImGuiStyle; // Runtime data for styling/colors
@@ -163,21 +161,26 @@ struct ImGuiTextBuffer; // Helper to hold and append into a text buf
struct ImGuiTextFilter; // Helper to parse and apply text filters (e.g. "aaaaa[,bbbbb][,ccccc]")
struct ImGuiViewport; // A Platform Window (always only one in 'master' branch), in the future may represent Platform Monitor
-// Enums/Flags (declared as int for compatibility with old C++, to allow using as flags without overhead, and to not pollute the top of this file)
+// Enumerations
+// - We don't use strongly typed enums much because they add constraints (can't extend in private code, can't store typed in bit fields, extra casting on iteration)
// - Tip: Use your programming IDE navigation facilities on the names in the _central column_ below to find the actual flags/enum lists!
-// In Visual Studio IDE: CTRL+comma ("Edit.NavigateTo") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
+// 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)
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
typedef int ImGuiDir; // -> enum ImGuiDir_ // Enum: A cardinal direction
-typedef int ImGuiKey; // -> enum ImGuiKey_ // Enum: A key identifier (ImGui-side enum)
-typedef int ImGuiNavInput; // -> enum ImGuiNavInput_ // Enum: An input identifier for navigation
typedef int ImGuiMouseButton; // -> enum ImGuiMouseButton_ // Enum: A mouse button identifier (0=left, 1=right, 2=middle)
-typedef int ImGuiMouseCursor; // -> enum ImGuiMouseCursor_ // Enum: A mouse cursor identifier
+typedef int ImGuiMouseCursor; // -> enum ImGuiMouseCursor_ // Enum: A mouse cursor shape
typedef int ImGuiSortDirection; // -> enum ImGuiSortDirection_ // Enum: A sorting direction (ascending or descending)
typedef int ImGuiStyleVar; // -> enum ImGuiStyleVar_ // Enum: A variable identifier for styling
typedef int ImGuiTableBgTarget; // -> enum ImGuiTableBgTarget_ // Enum: A color target for TableSetBgColor()
+
+// Flags (declared as int for compatibility with old C++, to allow using as flags without overhead, and to not pollute the top of this file)
+// - Tip: Use your programming IDE navigation facilities on the names in the _central column_ below to find the actual flags/enum lists!
+// 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.
typedef int ImDrawFlags; // -> enum ImDrawFlags_ // Flags: for ImDrawList functions
typedef int ImDrawListFlags; // -> enum ImDrawListFlags_ // Flags: for ImDrawList instance
typedef int ImFontAtlasFlags; // -> enum ImFontAtlasFlags_ // Flags: for ImFontAtlas build
@@ -190,7 +193,7 @@ typedef int ImGuiDragDropFlags; // -> enum ImGuiDragDropFlags_ // Flags: f
typedef int ImGuiFocusedFlags; // -> enum ImGuiFocusedFlags_ // Flags: for IsWindowFocused()
typedef int ImGuiHoveredFlags; // -> enum ImGuiHoveredFlags_ // Flags: for IsItemHovered(), IsWindowHovered() etc.
typedef int ImGuiInputTextFlags; // -> enum ImGuiInputTextFlags_ // Flags: for InputText(), InputTextMultiline()
-typedef int ImGuiKeyModFlags; // -> enum ImGuiKeyModFlags_ // Flags: for io.KeyMods (Ctrl/Shift/Alt/Super)
+typedef int ImGuiKeyChord; // -> ImGuiKey | ImGuiMod_XXX // Flags: for storage only for now: an ImGuiKey optionally OR-ed with one or more ImGuiMod_XXX values.
typedef int ImGuiPopupFlags; // -> enum ImGuiPopupFlags_ // Flags: for OpenPopup*(), BeginPopupContext*(), IsPopupOpen()
typedef int ImGuiSelectableFlags; // -> enum ImGuiSelectableFlags_ // Flags: for Selectable()
typedef int ImGuiSliderFlags; // -> enum ImGuiSliderFlags_ // Flags: for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc.
@@ -225,17 +228,8 @@ typedef signed short ImS16; // 16-bit signed integer
typedef unsigned short ImU16; // 16-bit unsigned integer
typedef signed int ImS32; // 32-bit signed integer == int
typedef unsigned int ImU32; // 32-bit unsigned integer (often used to store packed colors)
-#if defined(_MSC_VER) && !defined(__clang__)
-typedef signed __int64 ImS64; // 64-bit signed integer (pre and post C++11 with Visual Studio)
-typedef unsigned __int64 ImU64; // 64-bit unsigned integer (pre and post C++11 with Visual Studio)
-#elif (defined(__clang__) || defined(__GNUC__)) && (__cplusplus < 201100)
-#include <stdint.h>
-typedef int64_t ImS64; // 64-bit signed integer (pre C++11)
-typedef uint64_t ImU64; // 64-bit unsigned integer (pre C++11)
-#else
-typedef signed long long ImS64; // 64-bit signed integer (post C++11)
-typedef unsigned long long ImU64; // 64-bit unsigned integer (post C++11)
-#endif
+typedef signed long long ImS64; // 64-bit signed integer
+typedef unsigned long long ImU64; // 64-bit unsigned integer
// Character types
// (we generally use UTF-8 encoded string in the API. This is storage specifically for a decoded character used for keyboard input and display)
@@ -259,8 +253,8 @@ IM_MSVC_RUNTIME_CHECKS_OFF
struct ImVec2
{
float x, y;
- ImVec2() { x = y = 0.0f; }
- ImVec2(float _x, float _y) { x = _x; y = _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.
#ifdef IM_VEC2_CLASS_EXTRA
@@ -271,9 +265,9 @@ struct ImVec2
// ImVec4: 4D vector used to store clipping rectangles, colors etc. [Compile-time configurable type]
struct ImVec4
{
- float x, y, z, w;
- ImVec4() { x = y = z = w = 0.0f; }
- ImVec4(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; }
+ float x, y, z, w;
+ constexpr ImVec4() : x(0.0f), y(0.0f), z(0.0f), w(0.0f) { }
+ constexpr ImVec4(float _x, float _y, float _z, float _w) : x(_x), y(_y), z(_z), w(_w) { }
#ifdef IM_VEC4_CLASS_EXTRA
IM_VEC4_CLASS_EXTRA // Define additional constructors and implicit cast operators in imconfig.h to convert back and forth between your math types and ImVec4.
#endif
@@ -307,11 +301,13 @@ namespace ImGui
// Demo, Debug, Information
IMGUI_API void ShowDemoWindow(bool* p_open = NULL); // create Demo window. demonstrate most ImGui features. call this to learn about the library! try to make it always available in your application!
IMGUI_API void ShowMetricsWindow(bool* p_open = NULL); // create Metrics/Debugger window. display Dear ImGui internals: windows, draw commands, various internal state, etc.
+ IMGUI_API void ShowDebugLogWindow(bool* p_open = NULL); // create Debug Log window. display a simplified log of important dear imgui events.
+ IMGUI_API void ShowStackToolWindow(bool* p_open = NULL); // create Stack Tool window. hover items with mouse to query information about the source of their unique ID.
IMGUI_API void ShowAboutWindow(bool* p_open = NULL); // create About window. display Dear ImGui version, credits and build/system information.
IMGUI_API void ShowStyleEditor(ImGuiStyle* ref = NULL); // add style editor block (not a window). you can pass in a reference ImGuiStyle structure to compare to, revert to and save to (else it uses the default style)
IMGUI_API bool ShowStyleSelector(const char* label); // add style selector block (not a window), essentially a combo listing the default styles.
IMGUI_API void ShowFontSelector(const char* label); // add font selector block (not a window), essentially a combo listing the loaded fonts.
- IMGUI_API void ShowUserGuide(); // add basic help/info block (not a window): how to manipulate ImGui as a end-user (mouse/keyboard controls).
+ IMGUI_API void ShowUserGuide(); // add basic help/info block (not a window): how to manipulate ImGui as an end-user (mouse/keyboard controls).
IMGUI_API const char* GetVersion(); // get the compiled version string e.g. "1.80 WIP" (essentially the value for IMGUI_VERSION from the compiled version of imgui.cpp)
// Styles
@@ -366,6 +362,7 @@ namespace ImGui
IMGUI_API void SetNextWindowContentSize(const ImVec2& size); // set next window content size (~ scrollable client area, which enforce the range of scrollbars). Not including window decorations (title bar, menu bar, etc.) nor WindowPadding. set an axis to 0.0f to leave it automatic. call before Begin()
IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // set next window collapsed state. call before Begin()
IMGUI_API void SetNextWindowFocus(); // set next window to be focused / top-most. call before Begin()
+ IMGUI_API void SetNextWindowScroll(const ImVec2& scroll); // set next window scrolling value (use < 0.0f to not affect a given axis).
IMGUI_API void SetNextWindowBgAlpha(float alpha); // set next window background color alpha. helper to easily override the Alpha component of ImGuiCol_WindowBg/ChildBg/PopupBg. you may also use ImGuiWindowFlags_NoBackground.
IMGUI_API void SetWindowPos(const ImVec2& pos, ImGuiCond cond = 0); // (not recommended) set current window position - call within Begin()/End(). prefer using SetNextWindowPos(), as this may incur tearing and side-effects.
IMGUI_API void SetWindowSize(const ImVec2& size, ImGuiCond cond = 0); // (not recommended) set current window size - call within Begin()/End(). set to ImVec2(0, 0) to force an auto-fit. prefer using SetNextWindowSize(), as this may incur tearing and minor side-effects.
@@ -383,9 +380,11 @@ namespace ImGui
IMGUI_API ImVec2 GetContentRegionAvail(); // == GetContentRegionMax() - GetCursorPos()
IMGUI_API ImVec2 GetContentRegionMax(); // current content boundaries (typically window boundaries including scrolling, or current column boundaries), in windows coordinates
IMGUI_API ImVec2 GetWindowContentRegionMin(); // content boundaries min for the full window (roughly (0,0)-Scroll), in window coordinates
- IMGUI_API ImVec2 GetWindowContentRegionMax(); // content boundaries max for the full window (roughly (0,0)+Size-Scroll) where Size can be override with SetNextWindowContentSize(), in window coordinates
+ IMGUI_API ImVec2 GetWindowContentRegionMax(); // content boundaries max for the full window (roughly (0,0)+Size-Scroll) where Size can be overridden with SetNextWindowContentSize(), in window coordinates
// Windows Scrolling
+ // - Any change of Scroll will be applied at the beginning of next frame in the first call to Begin().
+ // - You may instead use SetNextWindowScroll() prior to calling Begin() to avoid this delay, as an alternative to using SetScrollX()/SetScrollY().
IMGUI_API float GetScrollX(); // get scrolling amount [0 .. GetScrollMaxX()]
IMGUI_API float GetScrollY(); // get scrolling amount [0 .. GetScrollMaxY()]
IMGUI_API void SetScrollX(float scroll_x); // set scrolling amount [0 .. GetScrollMaxX()]
@@ -438,7 +437,7 @@ namespace ImGui
// Absolute coordinate: GetCursorScreenPos(), SetCursorScreenPos(), all ImDrawList:: functions.
IMGUI_API void Separator(); // separator, generally horizontal. inside a menu bar or in horizontal layout mode, this becomes a vertical separator.
IMGUI_API void SameLine(float offset_from_start_x=0.0f, float spacing=-1.0f); // call between widgets or groups to layout them horizontally. X position given in window coordinates.
- IMGUI_API void NewLine(); // undo a SameLine() or force a new line when in an horizontal-layout context.
+ IMGUI_API void NewLine(); // undo a SameLine() or force a new line when in a horizontal-layout context.
IMGUI_API void Spacing(); // add vertical spacing.
IMGUI_API void Dummy(const ImVec2& size); // add a dummy item of given size. unlike InvisibleButton(), Dummy() won't take the mouse click or be navigable into.
IMGUI_API void Indent(float indent_w = 0.0f); // move content position toward the right, by indent_w, or style.IndentSpacing if indent_w <= 0
@@ -502,8 +501,6 @@ namespace ImGui
IMGUI_API bool SmallButton(const char* label); // button with FramePadding=(0,0) to easily embed within text
IMGUI_API bool InvisibleButton(const char* str_id, const ImVec2& size, ImGuiButtonFlags flags = 0); // flexible button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.)
IMGUI_API bool ArrowButton(const char* str_id, ImGuiDir dir); // square button with an arrow shape
- IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1,1), const ImVec4& tint_col = ImVec4(1,1,1,1), const ImVec4& border_col = ImVec4(0,0,0,0));
- 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)); // <0 frame_padding uses default frame padding settings. 0 for no padding
IMGUI_API bool Checkbox(const char* label, bool* v);
IMGUI_API bool CheckboxFlags(const char* label, int* flags, int flags_value);
IMGUI_API bool CheckboxFlags(const char* label, unsigned int* flags, unsigned int flags_value);
@@ -512,7 +509,12 @@ namespace ImGui
IMGUI_API void ProgressBar(float fraction, const ImVec2& size_arg = ImVec2(-FLT_MIN, 0), const char* overlay = NULL);
IMGUI_API void Bullet(); // draw a small circle + keep the cursor on the same line. advance cursor x position by GetTreeNodeToLabelSpacing(), same distance that TreeNode() uses
- // Widgets: Combo Box
+ // Widgets: Images
+ // - Read about ImTextureID here: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
+ IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& tint_col = ImVec4(1, 1, 1, 1), const ImVec4& border_col = ImVec4(0, 0, 0, 0));
+ IMGUI_API bool ImageButton(const char* str_id, ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1, 1), const ImVec4& bg_col = ImVec4(0, 0, 0, 0), const ImVec4& tint_col = ImVec4(1, 1, 1, 1));
+
+ // Widgets: Combo Box (Dropdown)
// - The BeginCombo()/EndCombo() api allows you to manage your contents and selection state however you want it, by creating e.g. Selectable() items.
// - The old Combo() api are helpers over BeginCombo()/EndCombo() which are kept available for convenience purpose. This is analogous to how ListBox are created.
IMGUI_API bool BeginCombo(const char* label, const char* preview_value, ImGuiComboFlags flags = 0);
@@ -523,14 +525,15 @@ namespace ImGui
// Widgets: Drag Sliders
// - CTRL+Click on any drag box to turn them into an input box. Manually input values aren't clamped by default and can go off-bounds. Use ImGuiSliderFlags_AlwaysClamp to always clamp.
- // - For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every functions, note that a 'float v[X]' function argument is the same as 'float* v', the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x
+ // - For all the Float2/Float3/Float4/Int2/Int3/Int4 versions of every function, note that a 'float v[X]' function argument is the same as 'float* v',
+ // the array syntax is just a way to document the number of elements that are expected to be accessible. You can pass address of your first element out of a contiguous set, e.g. &myvector.x
// - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc.
// - Format string may also be set to NULL or use the default format ("%f" or "%d").
// - Speed are per-pixel of mouse movement (v_speed=0.2f: mouse needs to move by 5 pixels to increase value by 1). For gamepad/keyboard navigation, minimum speed is Max(v_speed, minimum_step_at_given_precision).
// - Use v_min < v_max to clamp edits to given limits. Note that CTRL+Click manual input can override those limits if ImGuiSliderFlags_AlwaysClamp is not used.
// - Use v_max = FLT_MAX / INT_MAX etc to avoid clamping to a maximum, same with v_min = -FLT_MAX / INT_MIN to avoid clamping to a minimum.
// - We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them.
- // - Legacy: Pre-1.78 there are DragXXX() function signatures that takes a final `float power=1.0f' argument instead of the `ImGuiSliderFlags flags=0' argument.
+ // - Legacy: Pre-1.78 there are DragXXX() function signatures that take a final `float power=1.0f' argument instead of the `ImGuiSliderFlags flags=0' argument.
// If you get a warning converting a float to ImGuiSliderFlags, read https://github.com/ocornut/imgui/issues/3361
IMGUI_API bool DragFloat(const char* label, float* v, float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", ImGuiSliderFlags flags = 0); // If v_min >= v_max we have no bound
IMGUI_API bool DragFloat2(const char* label, float v[2], float v_speed = 1.0f, float v_min = 0.0f, float v_max = 0.0f, const char* format = "%.3f", ImGuiSliderFlags flags = 0);
@@ -549,7 +552,7 @@ namespace ImGui
// - CTRL+Click on any slider to turn them into an input box. Manually input values aren't clamped by default and can go off-bounds. Use ImGuiSliderFlags_AlwaysClamp to always clamp.
// - Adjust format string to decorate the value with a prefix, a suffix, or adapt the editing and display precision e.g. "%.3f" -> 1.234; "%5.2f secs" -> 01.23 secs; "Biscuit: %.0f" -> Biscuit: 1; etc.
// - Format string may also be set to NULL or use the default format ("%f" or "%d").
- // - Legacy: Pre-1.78 there are SliderXXX() function signatures that takes a final `float power=1.0f' argument instead of the `ImGuiSliderFlags flags=0' argument.
+ // - Legacy: Pre-1.78 there are SliderXXX() function signatures that take a final `float power=1.0f' argument instead of the `ImGuiSliderFlags flags=0' argument.
// If you get a warning converting a float to ImGuiSliderFlags, read https://github.com/ocornut/imgui/issues/3361
IMGUI_API bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* format = "%.3f", ImGuiSliderFlags flags = 0); // adjust format to decorate the value with a prefix or a suffix for in-slider labels or unit display.
IMGUI_API bool SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* format = "%.3f", ImGuiSliderFlags flags = 0);
@@ -591,7 +594,7 @@ namespace ImGui
IMGUI_API bool ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flags = 0);
IMGUI_API bool ColorPicker3(const char* label, float col[3], ImGuiColorEditFlags flags = 0);
IMGUI_API bool ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags flags = 0, const float* ref_col = NULL);
- IMGUI_API bool ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFlags flags = 0, ImVec2 size = ImVec2(0, 0)); // display a color square/button, hover for details, return true when pressed.
+ IMGUI_API bool ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFlags flags = 0, const ImVec2& size = ImVec2(0, 0)); // display a color square/button, hover for details, return true when pressed.
IMGUI_API void SetColorEditOptions(ImGuiColorEditFlags flags); // initialize current options (generally on application startup) if you want to select a default format, picker type, etc. User will be able to change many settings, unless you pass the _NoOptions flag to your calls.
// Widgets: Trees
@@ -607,7 +610,7 @@ namespace ImGui
IMGUI_API bool TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3);
IMGUI_API bool TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args) IM_FMTLIST(3);
IMGUI_API void TreePush(const char* str_id); // ~ Indent()+PushId(). Already called by TreeNode() when returning true, but you can call TreePush/TreePop yourself if desired.
- IMGUI_API void TreePush(const void* ptr_id = NULL); // "
+ IMGUI_API void TreePush(const void* ptr_id); // "
IMGUI_API void TreePop(); // ~ Unindent()+PopId()
IMGUI_API float GetTreeNodeToLabelSpacing(); // horizontal distance preceding label when using TreeNode*() or Bullet() == (g.FontSize + style.FramePadding.x*2) for a regular unframed TreeNode
IMGUI_API bool CollapsingHeader(const char* label, ImGuiTreeNodeFlags flags = 0); // if returning 'true' the header is open. doesn't indent nor push on ID stack. user doesn't have to call TreePop().
@@ -677,7 +680,7 @@ namespace ImGui
// Popups: begin/end functions
// - BeginPopup(): query popup state, if open start appending into the window. Call EndPopup() afterwards. ImGuiWindowFlags are forwarded to the window.
- // - BeginPopupModal(): block every interactions behind the window, cannot be closed by user, add a dimming background, has a title bar.
+ // - BeginPopupModal(): block every interaction behind the window, cannot be closed by user, add a dimming background, has a title bar.
IMGUI_API bool BeginPopup(const char* str_id, ImGuiWindowFlags flags = 0); // return true if the popup is open, and you can start outputting to it.
IMGUI_API bool BeginPopupModal(const char* name, bool* p_open = NULL, ImGuiWindowFlags flags = 0); // return true if the modal is open, and you can start outputting to it.
IMGUI_API void EndPopup(); // only call EndPopup() if BeginPopupXXX() returns true!
@@ -689,6 +692,7 @@ namespace ImGui
// - CloseCurrentPopup() is called by default by Selectable()/MenuItem() when activated (FIXME: need some options).
// - Use ImGuiPopupFlags_NoOpenOverExistingPopup to avoid opening a popup if there's already one at the same level. This is equivalent to e.g. testing for !IsAnyPopupOpen() prior to OpenPopup().
// - Use IsWindowAppearing() after BeginPopup() to tell if a window just opened.
+ // - IMPORTANT: Notice that for OpenPopupOnItemClick() we exceptionally default flags to 1 (== ImGuiPopupFlags_MouseButtonRight) for backward compatibility with older API taking 'int mouse_button = 1' parameter
IMGUI_API void OpenPopup(const char* str_id, ImGuiPopupFlags popup_flags = 0); // call to mark popup as open (don't call every frame!).
IMGUI_API void OpenPopup(ImGuiID id, ImGuiPopupFlags popup_flags = 0); // id overload to facilitate calling from nested stacks
IMGUI_API void OpenPopupOnItemClick(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 1); // helper to open popup when clicked on last item. Default to ImGuiPopupFlags_MouseButtonRight == 1. (note: actually triggers on the mouse _released_ event to be consistent with popup behaviors)
@@ -698,7 +702,7 @@ namespace ImGui
// - Helpers to do OpenPopup+BeginPopup where the Open action is triggered by e.g. hovering an item and right-clicking.
// - They are convenient to easily create context menus, hence the name.
// - IMPORTANT: Notice that BeginPopupContextXXX takes ImGuiPopupFlags just like OpenPopup() and unlike BeginPopup(). For full consistency, we may add ImGuiWindowFlags to the BeginPopupContextXXX functions in the future.
- // - IMPORTANT: we exceptionally default their flags to 1 (== ImGuiPopupFlags_MouseButtonRight) for backward compatibility with older API taking 'int mouse_button = 1' parameter, so if you add other flags remember to re-add the ImGuiPopupFlags_MouseButtonRight.
+ // - IMPORTANT: Notice that we exceptionally default their flags to 1 (== ImGuiPopupFlags_MouseButtonRight) for backward compatibility with older API taking 'int mouse_button = 1' parameter, so if you add other flags remember to re-add the ImGuiPopupFlags_MouseButtonRight.
IMGUI_API bool BeginPopupContextItem(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 1); // open+begin popup when clicked on last item. Use str_id==NULL to associate the popup to previous item. If you want to use that on a non-interactive item such as Text() you need to pass in an explicit ID here. read comments in .cpp!
IMGUI_API bool BeginPopupContextWindow(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 1);// open+begin popup when clicked on current window.
IMGUI_API bool BeginPopupContextVoid(const char* str_id = NULL, ImGuiPopupFlags popup_flags = 1); // open+begin popup when clicked in void (where there are no windows).
@@ -710,19 +714,17 @@ namespace ImGui
IMGUI_API bool IsPopupOpen(const char* str_id, ImGuiPopupFlags flags = 0); // return true if the popup is open.
// Tables
- // [BETA API] API may evolve slightly! If you use this, please update to the next version when it comes out!
// - Full-featured replacement for old Columns API.
- // - See Demo->Tables for demo code.
- // - See top of imgui_tables.cpp for general commentary.
+ // - See Demo->Tables for demo code. See top of imgui_tables.cpp for general commentary.
// - See ImGuiTableFlags_ and ImGuiTableColumnFlags_ enums for a description of available flags.
// The typical call flow is:
- // - 1. Call BeginTable().
+ // - 1. Call BeginTable(), early out if returning false.
// - 2. Optionally call TableSetupColumn() to submit column name/flags/defaults.
// - 3. Optionally call TableSetupScrollFreeze() to request scroll freezing of columns/rows.
// - 4. Optionally call TableHeadersRow() to submit a header row. Names are pulled from TableSetupColumn() data.
// - 5. Populate contents:
// - In most situations you can use TableNextRow() + TableSetColumnIndex(N) to start appending into a column.
- // - If you are using tables as a sort of grid, where every columns is holding the same type of contents,
+ // - If you are using tables as a sort of grid, where every column is holding the same type of contents,
// you may prefer using TableNextColumn() instead of TableNextRow() + TableSetColumnIndex().
// TableNextColumn() will automatically wrap-around into the next row if needed.
// - IMPORTANT: Comparatively to the old Columns() API, we need to call TableNextColumn() for the first column!
@@ -735,10 +737,10 @@ namespace ImGui
// --------------------------------------------------------------------------------------------------------
// - 5. Call EndTable()
IMGUI_API bool BeginTable(const char* str_id, int column, ImGuiTableFlags flags = 0, const ImVec2& outer_size = ImVec2(0.0f, 0.0f), float inner_width = 0.0f);
- IMGUI_API void EndTable(); // only call EndTable() if BeginTable() returns true!
+ IMGUI_API void EndTable(); // only call EndTable() if BeginTable() returns true!
IMGUI_API void TableNextRow(ImGuiTableRowFlags row_flags = 0, float min_row_height = 0.0f); // append into the first cell of a new row.
- IMGUI_API bool TableNextColumn(); // append into the next column (or first column of next row if currently in last column). Return true when column is visible.
- IMGUI_API bool TableSetColumnIndex(int column_n); // append into the specified column. Return true when column is visible.
+ IMGUI_API bool TableNextColumn(); // append into the next column (or first column of next row if currently in last column). Return true when column is visible.
+ IMGUI_API bool TableSetColumnIndex(int column_n); // append into the specified column. Return true when column is visible.
// Tables: Headers & Columns declaration
// - Use TableSetupColumn() to specify label, resizing policy, default width/weight, id, various other flags etc.
@@ -749,20 +751,17 @@ namespace ImGui
// some advanced use cases (e.g. adding custom widgets in header row).
// - Use TableSetupScrollFreeze() to lock columns/rows so they stay visible when scrolled.
IMGUI_API void TableSetupColumn(const char* label, ImGuiTableColumnFlags flags = 0, float init_width_or_weight = 0.0f, ImGuiID user_id = 0);
- IMGUI_API void TableSetupScrollFreeze(int cols, int rows); // lock columns/rows so they stay visible when scrolled.
- IMGUI_API void TableHeadersRow(); // submit all headers cells based on data provided to TableSetupColumn() + submit context menu
- IMGUI_API void TableHeader(const char* label); // submit one header cell manually (rarely used)
-
- // Tables: Sorting
- // - Call TableGetSortSpecs() to retrieve latest sort specs for the table. NULL when not sorting.
- // - When 'SpecsDirty == true' you should sort your data. It will be true when sorting specs have changed
- // since last call, or the first time. Make sure to set 'SpecsDirty = false' after sorting, else you may
- // wastefully sort your data every frame!
- // - Lifetime: don't hold on this pointer over multiple frames or past any subsequent call to BeginTable().
- IMGUI_API ImGuiTableSortSpecs* TableGetSortSpecs(); // get latest sort specs for the table (NULL if not sorting).
-
- // Tables: Miscellaneous functions
+ IMGUI_API void TableSetupScrollFreeze(int cols, int rows); // lock columns/rows so they stay visible when scrolled.
+ IMGUI_API void TableHeadersRow(); // submit all headers cells based on data provided to TableSetupColumn() + submit context menu
+ IMGUI_API void TableHeader(const char* label); // submit one header cell manually (rarely used)
+
+ // Tables: Sorting & Miscellaneous functions
+ // - Sorting: call TableGetSortSpecs() to retrieve latest sort specs for the table. NULL when not sorting.
+ // When 'sort_specs->SpecsDirty == true' you should sort your data. It will be true when sorting specs have
+ // changed since last call, or the first time. Make sure to set 'SpecsDirty = false' after sorting,
+ // else you may wastefully sort your data every frame!
// - Functions args 'int column_n' treat the default value of -1 as the same as passing the current column index.
+ IMGUI_API ImGuiTableSortSpecs* TableGetSortSpecs(); // get latest sort specs for the table (NULL if not sorting). Lifetime: don't hold on this pointer over multiple frames or past any subsequent call to BeginTable().
IMGUI_API int TableGetColumnCount(); // return number of columns (value passed to BeginTable)
IMGUI_API int TableGetColumnIndex(); // return current column index.
IMGUI_API int TableGetRowIndex(); // return current row index.
@@ -806,7 +805,7 @@ namespace ImGui
// - If you stop calling BeginDragDropSource() the payload is preserved however it won't have a preview tooltip (we currently display a fallback "..." tooltip, see #1725)
// - An item can be both drag source and drop target.
IMGUI_API bool BeginDragDropSource(ImGuiDragDropFlags flags = 0); // call after submitting an item which may be dragged. when this return true, you can call SetDragDropPayload() + EndDragDropSource()
- IMGUI_API bool SetDragDropPayload(const char* type, const void* data, size_t sz, ImGuiCond cond = 0); // type is a user defined string of maximum 32 characters. Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui.
+ IMGUI_API bool SetDragDropPayload(const char* type, const void* data, size_t sz, ImGuiCond cond = 0); // type is a user defined string of maximum 32 characters. Strings starting with '_' are reserved for dear imgui internal types. Data is copied and held by imgui. Return true when payload has been accepted.
IMGUI_API void EndDragDropSource(); // only call EndDragDropSource() if BeginDragDropSource() returns true!
IMGUI_API bool BeginDragDropTarget(); // call after submitting an item that may receive a payload. If this returns true, you can call AcceptDragDropPayload() + EndDragDropTarget()
IMGUI_API const ImGuiPayload* AcceptDragDropPayload(const char* type, ImGuiDragDropFlags flags = 0); // accept contents of a given type. If ImGuiDragDropFlags_AcceptBeforeDelivery is set you can peek into the payload before the mouse button is released.
@@ -836,12 +835,12 @@ namespace ImGui
IMGUI_API bool IsItemHovered(ImGuiHoveredFlags flags = 0); // is the last item hovered? (and usable, aka not blocked by a popup, etc.). See ImGuiHoveredFlags for more options.
IMGUI_API bool IsItemActive(); // is the last item active? (e.g. button being held, text field being edited. This will continuously return true while holding mouse button on an item. Items that don't interact will always return false)
IMGUI_API bool IsItemFocused(); // is the last item focused for keyboard/gamepad navigation?
- IMGUI_API bool IsItemClicked(ImGuiMouseButton mouse_button = 0); // is the last item hovered and mouse clicked on? (**) == IsMouseClicked(mouse_button) && IsItemHovered()Important. (**) this it NOT equivalent to the behavior of e.g. Button(). Read comments in function definition.
+ IMGUI_API bool IsItemClicked(ImGuiMouseButton mouse_button = 0); // is the last item hovered and mouse clicked on? (**) == IsMouseClicked(mouse_button) && IsItemHovered()Important. (**) this is NOT equivalent to the behavior of e.g. Button(). Read comments in function definition.
IMGUI_API bool IsItemVisible(); // is the last item visible? (items may be out of sight because of clipping/scrolling)
IMGUI_API bool IsItemEdited(); // did the last item modify its underlying value this frame? or was pressed? This is generally the same as the "bool" return value of many widgets.
IMGUI_API bool IsItemActivated(); // was the last item just made active (item was previously inactive).
- IMGUI_API bool IsItemDeactivated(); // was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that requires continuous editing.
- IMGUI_API bool IsItemDeactivatedAfterEdit(); // was the last item just made inactive and made a value change when it was active? (e.g. Slider/Drag moved). Useful for Undo/Redo patterns with widgets that requires continuous editing. Note that you may get false positives (some widgets such as Combo()/ListBox()/Selectable() will return true even when clicking an already selected item).
+ IMGUI_API bool IsItemDeactivated(); // was the last item just made inactive (item was previously active). Useful for Undo/Redo patterns with widgets that require continuous editing.
+ IMGUI_API bool IsItemDeactivatedAfterEdit(); // was the last item just made inactive and made a value change when it was active? (e.g. Slider/Drag moved). Useful for Undo/Redo patterns with widgets that require continuous editing. Note that you may get false positives (some widgets such as Combo()/ListBox()/Selectable() will return true even when clicking an already selected item).
IMGUI_API bool IsItemToggledOpen(); // was the last item open state toggled? set by TreeNode().
IMGUI_API bool IsAnyItemHovered(); // is any item hovered?
IMGUI_API bool IsAnyItemActive(); // is any item active?
@@ -857,18 +856,19 @@ namespace ImGui
// - In the future we will extend this concept further to also represent Platform Monitor and support a "no main platform window" operation mode.
IMGUI_API ImGuiViewport* GetMainViewport(); // return primary/default viewport. This can never be NULL.
+ // Background/Foreground Draw Lists
+ IMGUI_API ImDrawList* GetBackgroundDrawList(); // this draw list will be the first rendered one. Useful to quickly draw shapes/text behind dear imgui contents.
+ IMGUI_API ImDrawList* GetForegroundDrawList(); // this draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents.
+
// Miscellaneous Utilities
IMGUI_API bool IsRectVisible(const ImVec2& size); // test if rectangle (of given size, starting from cursor position) is visible / not clipped.
IMGUI_API bool IsRectVisible(const ImVec2& rect_min, const ImVec2& rect_max); // test if rectangle (in screen space) is visible / not clipped. to perform coarse clipping on user's side.
IMGUI_API double GetTime(); // get global imgui time. incremented by io.DeltaTime every frame.
IMGUI_API int GetFrameCount(); // get global imgui frame count. incremented by 1 every frame.
- IMGUI_API ImDrawList* GetBackgroundDrawList(); // this draw list will be the first rendering one. Useful to quickly draw shapes/text behind dear imgui contents.
- IMGUI_API ImDrawList* GetForegroundDrawList(); // this draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents.
IMGUI_API ImDrawListSharedData* GetDrawListSharedData(); // you may use this when creating your own ImDrawList instances.
IMGUI_API const char* GetStyleColorName(ImGuiCol idx); // get a string corresponding to the enum value (for display, saving, etc.).
IMGUI_API void SetStateStorage(ImGuiStorage* storage); // replace current window storage with our own (if you want to manipulate it yourself, typically clear subsection of it)
IMGUI_API ImGuiStorage* GetStateStorage();
- IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // calculate coarse clipping for large list of evenly sized items. Prefer using the ImGuiListClipper higher-level helper if you can.
IMGUI_API bool BeginChildFrame(ImGuiID id, const ImVec2& size, ImGuiWindowFlags flags = 0); // helper to create a child window / scrolling region that looks like a normal widget frame
IMGUI_API void EndChildFrame(); // always call EndChildFrame() regardless of BeginChildFrame() return values (which indicates a collapsed/clipped window)
@@ -882,34 +882,38 @@ namespace ImGui
IMGUI_API void ColorConvertHSVtoRGB(float h, float s, float v, float& out_r, float& out_g, float& out_b);
// Inputs Utilities: Keyboard
- // - For 'int user_key_index' you can use your own indices/enums according to how your backend/engine stored them in io.KeysDown[].
- // - We don't know the meaning of those value. You can use GetKeyIndex() to map a ImGuiKey_ value into the user index.
- IMGUI_API int GetKeyIndex(ImGuiKey imgui_key); // map ImGuiKey_* values into user's key index. == io.KeyMap[key]
- IMGUI_API bool IsKeyDown(int user_key_index); // is key being held. == io.KeysDown[user_key_index].
- IMGUI_API bool IsKeyPressed(int user_key_index, bool repeat = true); // was key pressed (went from !Down to Down)? if repeat=true, uses io.KeyRepeatDelay / KeyRepeatRate
- IMGUI_API bool IsKeyReleased(int user_key_index); // was key released (went from Down to !Down)?
- IMGUI_API int GetKeyPressedAmount(int key_index, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate
- IMGUI_API void CaptureKeyboardFromApp(bool want_capture_keyboard_value = true); // attention: misleading name! manually override io.WantCaptureKeyboard flag next frame (said flag is entirely left for your application to handle). e.g. force capture keyboard when your widget is being hovered. This is equivalent to setting "io.WantCaptureKeyboard = want_capture_keyboard_value"; after the next NewFrame() call.
+ // 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)
+ 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)?
+ IMGUI_API int GetKeyPressedAmount(ImGuiKey key, float repeat_delay, float rate); // uses provided repeat rate/delay. return a count, most often 0 or 1 but might be >1 if RepeatRate is small enough that DeltaTime > RepeatRate
+ 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
// - 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')
IMGUI_API bool IsMouseDown(ImGuiMouseButton button); // is mouse button held?
- IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, bool repeat = false); // did mouse button clicked? (went from !Down to Down)
+ IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, bool repeat = false); // did mouse button clicked? (went from !Down to Down). Same as GetMouseClickedCount() == 1.
IMGUI_API bool IsMouseReleased(ImGuiMouseButton button); // did mouse button released? (went from Down to !Down)
- IMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button); // did mouse button double-clicked? (note that a double-click will also report IsMouseClicked() == true)
+ IMGUI_API bool IsMouseDoubleClicked(ImGuiMouseButton button); // did mouse button double-clicked? Same as GetMouseClickedCount() == 2. (note that a double-click will also report IsMouseClicked() == true)
+ IMGUI_API int GetMouseClickedCount(ImGuiMouseButton button); // return the number of successive mouse-clicks at the time where a click happen (otherwise 0).
IMGUI_API bool IsMouseHoveringRect(const ImVec2& r_min, const ImVec2& r_max, bool clip = true);// is mouse hovering given bounding rect (in screen space). clipped by current clipping settings, but disregarding of other consideration of focus/window ordering/popup-block.
IMGUI_API bool IsMousePosValid(const ImVec2* mouse_pos = NULL); // by convention we use (-FLT_MAX,-FLT_MAX) to denote that there is no mouse available
- IMGUI_API bool IsAnyMouseDown(); // is any mouse button held?
+ IMGUI_API bool IsAnyMouseDown(); // [WILL OBSOLETE] is any mouse button held? This was designed for backends, but prefer having backend maintain a mask of held mouse buttons, because upcoming input queue system will make this invalid.
IMGUI_API ImVec2 GetMousePos(); // shortcut to ImGui::GetIO().MousePos provided by user, to be consistent with other calls
IMGUI_API ImVec2 GetMousePosOnOpeningCurrentPopup(); // retrieve mouse position at the time of opening popup we have BeginPopup() into (helper to avoid user backing that value themselves)
IMGUI_API bool IsMouseDragging(ImGuiMouseButton button, float lock_threshold = -1.0f); // is mouse dragging? (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)
IMGUI_API ImVec2 GetMouseDragDelta(ImGuiMouseButton button = 0, float lock_threshold = -1.0f); // return the delta from the initial clicking position while the mouse button is pressed or was just released. This is locked and return 0.0f until the mouse moves past a distance threshold at least once (if lock_threshold < -1.0f, uses io.MouseDraggingThreshold)
IMGUI_API void ResetMouseDragDelta(ImGuiMouseButton button = 0); //
- IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired cursor type, reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
- IMGUI_API void SetMouseCursor(ImGuiMouseCursor cursor_type); // set desired cursor type
- IMGUI_API void CaptureMouseFromApp(bool want_capture_mouse_value = true); // attention: misleading name! manually override io.WantCaptureMouse flag next frame (said flag is entirely left for your application to handle). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse_value;" after the next NewFrame() call.
+ IMGUI_API ImGuiMouseCursor GetMouseCursor(); // get desired mouse cursor shape. Important: reset in ImGui::NewFrame(), this is updated during the frame. valid before Render(). If you use software rendering by setting io.MouseDrawCursor ImGui will render those for you
+ IMGUI_API void SetMouseCursor(ImGuiMouseCursor cursor_type); // set desired mouse cursor shape
+ IMGUI_API void SetNextFrameWantCaptureMouse(bool want_capture_mouse); // Override io.WantCaptureMouse flag next frame (said flag is left for your application to handle, typical when true it instucts your app to ignore inputs). This is equivalent to setting "io.WantCaptureMouse = want_capture_mouse;" after the next NewFrame() call.
// Clipboard Utilities
// - Also see the LogToClipboard() function to capture GUI into clipboard, or easily output text data to the clipboard.
@@ -926,7 +930,7 @@ namespace ImGui
IMGUI_API const char* SaveIniSettingsToMemory(size_t* out_ini_size = NULL); // return a zero-terminated string with the .ini data which you can save by your own mean. call when io.WantSaveIniSettings is set, then save data by your own mean and clear io.WantSaveIniSettings.
// Debug Utilities
- // - This is used by the IMGUI_CHECKVERSION() macro.
+ IMGUI_API void DebugTextEncoding(const char* text);
IMGUI_API bool DebugCheckVersionAndDataLayout(const char* version_str, size_t sz_io, size_t sz_style, size_t sz_vec2, size_t sz_vec4, size_t sz_drawvert, size_t sz_drawidx); // This is called by IMGUI_CHECKVERSION() macro.
// Memory Allocators
@@ -945,6 +949,7 @@ namespace ImGui
//-----------------------------------------------------------------------------
// Flags for ImGui::Begin()
+// (Those are per-window flags. There are shared flags in ImGuiIO: io.ConfigWindowsResizeFromEdges and io.ConfigWindowsMoveFromTitleBarOnly)
enum ImGuiWindowFlags_
{
ImGuiWindowFlags_None = 0,
@@ -953,7 +958,7 @@ enum ImGuiWindowFlags_
ImGuiWindowFlags_NoMove = 1 << 2, // Disable user moving the window
ImGuiWindowFlags_NoScrollbar = 1 << 3, // Disable scrollbars (window can still scroll with mouse or programmatically)
ImGuiWindowFlags_NoScrollWithMouse = 1 << 4, // Disable user vertically scrolling with mouse wheel. On child window, mouse wheel will be forwarded to the parent unless NoScrollbar is also set.
- ImGuiWindowFlags_NoCollapse = 1 << 5, // Disable user collapsing window by double-clicking on it
+ ImGuiWindowFlags_NoCollapse = 1 << 5, // Disable user collapsing window by double-clicking on it. Also referred to as Window Menu Button (e.g. within a docking node).
ImGuiWindowFlags_AlwaysAutoResize = 1 << 6, // Resize every window to its content every frame
ImGuiWindowFlags_NoBackground = 1 << 7, // Disable drawing background color (WindowBg, etc.) and outside border. Similar as using SetNextWindowBgAlpha(0.0f).
ImGuiWindowFlags_NoSavedSettings = 1 << 8, // Never load/save settings in .ini file
@@ -973,18 +978,16 @@ enum ImGuiWindowFlags_
ImGuiWindowFlags_NoInputs = ImGuiWindowFlags_NoMouseInputs | ImGuiWindowFlags_NoNavInputs | ImGuiWindowFlags_NoNavFocus,
// [Internal]
- ImGuiWindowFlags_NavFlattened = 1 << 23, // [BETA] Allow gamepad/keyboard navigation to cross over parent border to this child (only use on child that have no scrolling!)
+ ImGuiWindowFlags_NavFlattened = 1 << 23, // [BETA] On child window: allow gamepad/keyboard navigation to cross over parent border to this child or between sibling child windows.
ImGuiWindowFlags_ChildWindow = 1 << 24, // Don't use! For internal use by BeginChild()
ImGuiWindowFlags_Tooltip = 1 << 25, // Don't use! For internal use by BeginTooltip()
ImGuiWindowFlags_Popup = 1 << 26, // Don't use! For internal use by BeginPopup()
ImGuiWindowFlags_Modal = 1 << 27, // Don't use! For internal use by BeginPopupModal()
- ImGuiWindowFlags_ChildMenu = 1 << 28 // Don't use! For internal use by BeginMenu()
-
- // [Obsolete]
- //ImGuiWindowFlags_ResizeFromAnySide = 1 << 17, // --> Set io.ConfigWindowsResizeFromEdges=true and make sure mouse cursors are supported by backend (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors)
+ ImGuiWindowFlags_ChildMenu = 1 << 28, // Don't use! For internal use by BeginMenu()
};
// Flags for ImGui::InputText()
+// (Those are per-item flags. There are shared flags in ImGuiIO: io.ConfigInputTextCursorBlink and io.ConfigInputTextEnterKeepActive)
enum ImGuiInputTextFlags_
{
ImGuiInputTextFlags_None = 0,
@@ -1007,11 +1010,12 @@ enum ImGuiInputTextFlags_
ImGuiInputTextFlags_NoUndoRedo = 1 << 16, // Disable undo/redo. Note that input text owns the text data while active, if you want to provide your own undo/redo stack you need e.g. to call ClearActiveID().
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_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)
// Obsolete names (will be removed soon)
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- , ImGuiInputTextFlags_AlwaysInsertMode = ImGuiInputTextFlags_AlwaysOverwrite // [renamed in 1.82] name was not matching behavior
+ ImGuiInputTextFlags_AlwaysInsertMode = ImGuiInputTextFlags_AlwaysOverwrite // [renamed in 1.82] name was not matching behavior
#endif
};
@@ -1034,7 +1038,7 @@ enum ImGuiTreeNodeFlags_
ImGuiTreeNodeFlags_SpanFullWidth = 1 << 12, // Extend hit box to the left-most and right-most edges (bypass the indented area).
ImGuiTreeNodeFlags_NavLeftJumpsBackHere = 1 << 13, // (WIP) Nav: left direction may move to this TreeNode() from any of its child (items submitted between TreeNode and TreePop)
//ImGuiTreeNodeFlags_NoScrollOnOpen = 1 << 14, // FIXME: TODO: Disable automatic scroll on TreePop() if node got just open and contents is not visible
- ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog
+ ImGuiTreeNodeFlags_CollapsingHeader = ImGuiTreeNodeFlags_Framed | ImGuiTreeNodeFlags_NoTreePushOnOpen | ImGuiTreeNodeFlags_NoAutoOpenOnLog,
};
// Flags for OpenPopup*(), BeginPopupContext*(), IsPopupOpen() functions.
@@ -1043,7 +1047,7 @@ enum ImGuiTreeNodeFlags_
// It is therefore guaranteed to be legal to pass a mouse button index in ImGuiPopupFlags.
// - For the same reason, we exceptionally default the ImGuiPopupFlags argument of BeginPopupContextXXX functions to 1 instead of 0.
// IMPORTANT: because the default parameter is 1 (==ImGuiPopupFlags_MouseButtonRight), if you rely on the default parameter
-// and want to another another flag, you need to pass in the ImGuiPopupFlags_MouseButtonRight flag.
+// and want to use another flag, you need to pass in the ImGuiPopupFlags_MouseButtonRight flag explicitly.
// - Multiple buttons currently cannot be combined/or-ed in those functions (we could allow it later).
enum ImGuiPopupFlags_
{
@@ -1057,18 +1061,18 @@ enum ImGuiPopupFlags_
ImGuiPopupFlags_NoOpenOverItems = 1 << 6, // For BeginPopupContextWindow(): don't return true when hovering items, only when hovering empty space
ImGuiPopupFlags_AnyPopupId = 1 << 7, // For IsPopupOpen(): ignore the ImGuiID parameter and test for any popup.
ImGuiPopupFlags_AnyPopupLevel = 1 << 8, // For IsPopupOpen(): search/test at any level of the popup stack (default test in the current level)
- ImGuiPopupFlags_AnyPopup = ImGuiPopupFlags_AnyPopupId | ImGuiPopupFlags_AnyPopupLevel
+ ImGuiPopupFlags_AnyPopup = ImGuiPopupFlags_AnyPopupId | ImGuiPopupFlags_AnyPopupLevel,
};
// Flags for ImGui::Selectable()
enum ImGuiSelectableFlags_
{
ImGuiSelectableFlags_None = 0,
- ImGuiSelectableFlags_DontClosePopups = 1 << 0, // Clicking this don't close parent popup window
+ ImGuiSelectableFlags_DontClosePopups = 1 << 0, // Clicking this doesn't close parent popup window
ImGuiSelectableFlags_SpanAllColumns = 1 << 1, // Selectable frame can span all columns (text will still fit in current column)
ImGuiSelectableFlags_AllowDoubleClick = 1 << 2, // Generate press events on double clicks too
ImGuiSelectableFlags_Disabled = 1 << 3, // Cannot be selected, display grayed out text
- ImGuiSelectableFlags_AllowItemOverlap = 1 << 4 // (WIP) Hit testing to allow subsequent widgets to overlap this one
+ ImGuiSelectableFlags_AllowItemOverlap = 1 << 4, // (WIP) Hit testing to allow subsequent widgets to overlap this one
};
// Flags for ImGui::BeginCombo()
@@ -1082,7 +1086,7 @@ enum ImGuiComboFlags_
ImGuiComboFlags_HeightLargest = 1 << 4, // As many fitting items as possible
ImGuiComboFlags_NoArrowButton = 1 << 5, // Display on the preview box without the square arrow button
ImGuiComboFlags_NoPreview = 1 << 6, // Display only a square arrow button
- ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest
+ ImGuiComboFlags_HeightMask_ = ImGuiComboFlags_HeightSmall | ImGuiComboFlags_HeightRegular | ImGuiComboFlags_HeightLarge | ImGuiComboFlags_HeightLargest,
};
// Flags for ImGui::BeginTabBar()
@@ -1098,7 +1102,7 @@ enum ImGuiTabBarFlags_
ImGuiTabBarFlags_FittingPolicyResizeDown = 1 << 6, // Resize tabs when they don't fit
ImGuiTabBarFlags_FittingPolicyScroll = 1 << 7, // Add scroll buttons when tabs don't fit
ImGuiTabBarFlags_FittingPolicyMask_ = ImGuiTabBarFlags_FittingPolicyResizeDown | ImGuiTabBarFlags_FittingPolicyScroll,
- ImGuiTabBarFlags_FittingPolicyDefault_ = ImGuiTabBarFlags_FittingPolicyResizeDown
+ ImGuiTabBarFlags_FittingPolicyDefault_ = ImGuiTabBarFlags_FittingPolicyResizeDown,
};
// Flags for ImGui::BeginTabItem()
@@ -1112,12 +1116,11 @@ enum ImGuiTabItemFlags_
ImGuiTabItemFlags_NoTooltip = 1 << 4, // Disable tooltip for the given tab
ImGuiTabItemFlags_NoReorder = 1 << 5, // Disable reordering this tab or having another tab cross over this tab
ImGuiTabItemFlags_Leading = 1 << 6, // Enforce the tab position to the left of the tab bar (after the tab list popup button)
- ImGuiTabItemFlags_Trailing = 1 << 7 // Enforce the tab position to the right of the tab bar (before the scrolling buttons)
+ ImGuiTabItemFlags_Trailing = 1 << 7, // Enforce the tab position to the right of the tab bar (before the scrolling buttons)
};
// Flags for ImGui::BeginTable()
-// [BETA API] API may evolve slightly! If you use this, please update to the next version when it comes out!
-// - Important! Sizing policies have complex and subtle side effects, more so than you would expect.
+// - Important! Sizing policies have complex and subtle side effects, much more so than you would expect.
// Read comments/demos carefully + experiment with live demos to get acquainted with them.
// - The DEFAULT sizing policies are:
// - Default to ImGuiTableFlags_SizingFixedFit if ScrollX is on, or if host window has ImGuiWindowFlags_AlwaysAutoResize.
@@ -1125,15 +1128,15 @@ enum ImGuiTabItemFlags_
// - When ScrollX is off:
// - Table defaults to ImGuiTableFlags_SizingStretchSame -> all Columns defaults to ImGuiTableColumnFlags_WidthStretch with same weight.
// - Columns sizing policy allowed: Stretch (default), Fixed/Auto.
-// - Fixed Columns will generally obtain their requested width (unless the table cannot fit them all).
-// - Stretch Columns will share the remaining width.
+// - Fixed Columns (if any) will generally obtain their requested width (unless the table cannot fit them all).
+// - Stretch Columns will share the remaining width according to their respective weight.
// - Mixed Fixed/Stretch columns is possible but has various side-effects on resizing behaviors.
// The typical use of mixing sizing policies is: any number of LEADING Fixed columns, followed by one or two TRAILING Stretch columns.
// (this is because the visible order of columns have subtle but necessary effects on how they react to manual resizing).
// - When ScrollX is on:
// - Table defaults to ImGuiTableFlags_SizingFixedFit -> all Columns defaults to ImGuiTableColumnFlags_WidthFixed
// - Columns sizing policy allowed: Fixed/Auto mostly.
-// - Fixed Columns can be enlarged as needed. Table will show an horizontal scrollbar if needed.
+// - Fixed Columns can be enlarged as needed. Table will show a horizontal scrollbar if needed.
// - When using auto-resizing (non-resizable) fixed columns, querying the content width to use item right-alignment e.g. SetNextItemWidth(-FLT_MIN) doesn't make sense, would create a feedback loop.
// - Using Stretch columns OFTEN DOES NOT MAKE SENSE if ScrollX is on, UNLESS you have specified a value for 'inner_width' in BeginTable().
// If you specify a value for 'inner_width' then effectively the scrolling space is known and Stretch or mixed Fixed/Stretch columns become meaningful again.
@@ -1159,8 +1162,8 @@ enum ImGuiTableFlags_
ImGuiTableFlags_BordersInner = ImGuiTableFlags_BordersInnerV | ImGuiTableFlags_BordersInnerH, // Draw inner borders.
ImGuiTableFlags_BordersOuter = ImGuiTableFlags_BordersOuterV | ImGuiTableFlags_BordersOuterH, // Draw outer borders.
ImGuiTableFlags_Borders = ImGuiTableFlags_BordersInner | ImGuiTableFlags_BordersOuter, // Draw all borders.
- ImGuiTableFlags_NoBordersInBody = 1 << 11, // [ALPHA] Disable vertical borders in columns Body (borders will always appears in Headers). -> May move to style
- ImGuiTableFlags_NoBordersInBodyUntilResize = 1 << 12, // [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers). -> May move to style
+ ImGuiTableFlags_NoBordersInBody = 1 << 11, // [ALPHA] Disable vertical borders in columns Body (borders will always appear in Headers). -> May move to style
+ ImGuiTableFlags_NoBordersInBodyUntilResize = 1 << 12, // [ALPHA] Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers). -> May move to style
// Sizing Policy (read above for defaults)
ImGuiTableFlags_SizingFixedFit = 1 << 13, // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching contents width.
ImGuiTableFlags_SizingFixedSame = 2 << 13, // Columns default to _WidthFixed or _WidthAuto (if resizable or not resizable), matching the maximum contents width of all columns. Implicitly enable ImGuiTableFlags_NoKeepColumnsVisible.
@@ -1174,24 +1177,18 @@ enum ImGuiTableFlags_
// Clipping
ImGuiTableFlags_NoClip = 1 << 20, // Disable clipping rectangle for every individual columns (reduce draw command count, items will be able to overflow into other columns). Generally incompatible with TableSetupScrollFreeze().
// Padding
- ImGuiTableFlags_PadOuterX = 1 << 21, // Default if BordersOuterV is on. Enable outer-most padding. Generally desirable if you have headers.
- ImGuiTableFlags_NoPadOuterX = 1 << 22, // Default if BordersOuterV is off. Disable outer-most padding.
+ ImGuiTableFlags_PadOuterX = 1 << 21, // Default if BordersOuterV is on. Enable outermost padding. Generally desirable if you have headers.
+ ImGuiTableFlags_NoPadOuterX = 1 << 22, // Default if BordersOuterV is off. Disable outermost padding.
ImGuiTableFlags_NoPadInnerX = 1 << 23, // Disable inner padding between columns (double inner padding if BordersOuterV is on, single inner padding if BordersOuterV is off).
// Scrolling
- ImGuiTableFlags_ScrollX = 1 << 24, // Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this create a child window, ScrollY is currently generally recommended when using ScrollX.
+ ImGuiTableFlags_ScrollX = 1 << 24, // Enable horizontal scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size. Changes default sizing policy. Because this creates a child window, ScrollY is currently generally recommended when using ScrollX.
ImGuiTableFlags_ScrollY = 1 << 25, // Enable vertical scrolling. Require 'outer_size' parameter of BeginTable() to specify the container size.
// Sorting
ImGuiTableFlags_SortMulti = 1 << 26, // Hold shift when clicking headers to sort on multiple column. TableGetSortSpecs() may return specs where (SpecsCount > 1).
ImGuiTableFlags_SortTristate = 1 << 27, // Allow no sorting, disable default sorting. TableGetSortSpecs() may return specs where (SpecsCount == 0).
// [Internal] Combinations and masks
- ImGuiTableFlags_SizingMask_ = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_SizingStretchSame
-
- // Obsolete names (will be removed soon)
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- //, ImGuiTableFlags_ColumnsWidthFixed = ImGuiTableFlags_SizingFixedFit, ImGuiTableFlags_ColumnsWidthStretch = ImGuiTableFlags_SizingStretchSame // WIP Tables 2020/12
- //, ImGuiTableFlags_SizingPolicyFixed = ImGuiTableFlags_SizingFixedFit, ImGuiTableFlags_SizingPolicyStretch = ImGuiTableFlags_SizingStretchSame // WIP Tables 2021/01
-#endif
+ ImGuiTableFlags_SizingMask_ = ImGuiTableFlags_SizingFixedFit | ImGuiTableFlags_SizingFixedSame | ImGuiTableFlags_SizingStretchProp | ImGuiTableFlags_SizingStretchSame,
};
// Flags for ImGui::TableSetupColumn()
@@ -1228,19 +1225,14 @@ enum ImGuiTableColumnFlags_
ImGuiTableColumnFlags_WidthMask_ = ImGuiTableColumnFlags_WidthStretch | ImGuiTableColumnFlags_WidthFixed,
ImGuiTableColumnFlags_IndentMask_ = ImGuiTableColumnFlags_IndentEnable | ImGuiTableColumnFlags_IndentDisable,
ImGuiTableColumnFlags_StatusMask_ = ImGuiTableColumnFlags_IsEnabled | ImGuiTableColumnFlags_IsVisible | ImGuiTableColumnFlags_IsSorted | ImGuiTableColumnFlags_IsHovered,
- ImGuiTableColumnFlags_NoDirectResize_ = 1 << 30 // [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge)
-
- // Obsolete names (will be removed soon)
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- //ImGuiTableColumnFlags_WidthAuto = ImGuiTableColumnFlags_WidthFixed | ImGuiTableColumnFlags_NoResize, // Column will not stretch and keep resizing based on submitted contents.
-#endif
+ ImGuiTableColumnFlags_NoDirectResize_ = 1 << 30, // [Internal] Disable user resizing this column directly (it may however we resized indirectly from its left edge)
};
// Flags for ImGui::TableNextRow()
enum ImGuiTableRowFlags_
{
- ImGuiTableRowFlags_None = 0,
- ImGuiTableRowFlags_Headers = 1 << 0 // Identify header row (set default background color + width of its contents accounted different for auto column width)
+ ImGuiTableRowFlags_None = 0,
+ ImGuiTableRowFlags_Headers = 1 << 0, // Identify header row (set default background color + width of its contents accounted differently for auto column width)
};
// Enum for ImGui::TableSetBgColor()
@@ -1248,16 +1240,16 @@ enum ImGuiTableRowFlags_
// - Layer 0: draw with RowBg0 color if set, otherwise draw with ColumnBg0 if set.
// - Layer 1: draw with RowBg1 color if set, otherwise draw with ColumnBg1 if set.
// - Layer 2: draw with CellBg color if set.
-// The purpose of the two row/columns layers is to let you decide if a background color changes should override or blend with the existing color.
+// The purpose of the two row/columns layers is to let you decide if a background color change should override or blend with the existing color.
// When using ImGuiTableFlags_RowBg on the table, each row has the RowBg0 color automatically set for odd/even rows.
// If you set the color of RowBg0 target, your color will override the existing RowBg0 color.
// If you set the color of RowBg1 or ColumnBg1 target, your color will blend over the RowBg0 color.
enum ImGuiTableBgTarget_
{
- ImGuiTableBgTarget_None = 0,
- ImGuiTableBgTarget_RowBg0 = 1, // Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used)
- ImGuiTableBgTarget_RowBg1 = 2, // Set row background color 1 (generally used for selection marking)
- ImGuiTableBgTarget_CellBg = 3 // Set cell background color (top-most color)
+ ImGuiTableBgTarget_None = 0,
+ ImGuiTableBgTarget_RowBg0 = 1, // Set row background color 0 (generally used for background, automatically set when ImGuiTableFlags_RowBg is used)
+ ImGuiTableBgTarget_RowBg1 = 2, // Set row background color 1 (generally used for selection marking)
+ ImGuiTableBgTarget_CellBg = 3, // Set cell background color (top-most color)
};
// Flags for ImGui::IsWindowFocused()
@@ -1269,7 +1261,7 @@ enum ImGuiFocusedFlags_
ImGuiFocusedFlags_AnyWindow = 1 << 2, // Return true if any window is focused. Important: If you are trying to tell how to dispatch your low-level inputs, do NOT use this. Use 'io.WantCaptureMouse' instead! Please read the FAQ!
ImGuiFocusedFlags_NoPopupHierarchy = 1 << 3, // Do not consider popup hierarchy (do not treat popup emitter as parent of popup) (when used with _ChildWindows or _RootWindow)
//ImGuiFocusedFlags_DockHierarchy = 1 << 4, // Consider docking hierarchy (treat dockspace host as parent of docked window) (when used with _ChildWindows or _RootWindow)
- ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows
+ ImGuiFocusedFlags_RootAndChildWindows = ImGuiFocusedFlags_RootWindow | ImGuiFocusedFlags_ChildWindows,
};
// Flags for ImGui::IsItemHovered(), ImGui::IsWindowHovered()
@@ -1286,10 +1278,16 @@ enum ImGuiHoveredFlags_
ImGuiHoveredFlags_AllowWhenBlockedByPopup = 1 << 5, // Return true even if a popup window is normally blocking access to this item/window
//ImGuiHoveredFlags_AllowWhenBlockedByModal = 1 << 6, // Return true even if a modal popup window is normally blocking access to this item/window. FIXME-TODO: Unavailable yet.
ImGuiHoveredFlags_AllowWhenBlockedByActiveItem = 1 << 7, // Return true even if an active item is blocking access to this item/window. Useful for Drag and Drop patterns.
- ImGuiHoveredFlags_AllowWhenOverlapped = 1 << 8, // Return true even if the position is obstructed or overlapped by another window
- ImGuiHoveredFlags_AllowWhenDisabled = 1 << 9, // Return true even if the item is disabled
+ ImGuiHoveredFlags_AllowWhenOverlapped = 1 << 8, // IsItemHovered() only: Return true even if the position is obstructed or overlapped by another window
+ ImGuiHoveredFlags_AllowWhenDisabled = 1 << 9, // IsItemHovered() only: Return true even if the item is disabled
+ ImGuiHoveredFlags_NoNavOverride = 1 << 10, // Disable using gamepad/keyboard navigation state when active, always query mouse.
ImGuiHoveredFlags_RectOnly = ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem | ImGuiHoveredFlags_AllowWhenOverlapped,
- ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows
+ ImGuiHoveredFlags_RootAndChildWindows = ImGuiHoveredFlags_RootWindow | ImGuiHoveredFlags_ChildWindows,
+
+ // Hovering delays (for tooltips)
+ ImGuiHoveredFlags_DelayNormal = 1 << 11, // Return true after io.HoverDelayNormal elapsed (~0.30 sec)
+ ImGuiHoveredFlags_DelayShort = 1 << 12, // Return true after io.HoverDelayShort elapsed (~0.10 sec)
+ ImGuiHoveredFlags_NoSharedDelay = 1 << 13, // Disable shared delay system where moving from one item to the next keeps the previous timer for a short time (standard for tooltips with long delays)
};
// Flags for ImGui::BeginDragDropSource(), ImGui::AcceptDragDropPayload()
@@ -1297,8 +1295,8 @@ 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 disable 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 disable this behavior so you can still call IsItemHovered() on the source item.
+ 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_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.
ImGuiDragDropFlags_SourceExtern = 1 << 4, // External source (from outside of dear imgui), won't attempt to read current item/window info. Will always return true. Only one Extern source can be active simultaneously.
@@ -1307,7 +1305,7 @@ enum ImGuiDragDropFlags_
ImGuiDragDropFlags_AcceptBeforeDelivery = 1 << 10, // AcceptDragDropPayload() will returns true even before the mouse button is released. You can then call IsDelivery() to test if the payload needs to be delivered.
ImGuiDragDropFlags_AcceptNoDrawDefaultRect = 1 << 11, // Do not draw the default highlight rectangle when hovering over target.
ImGuiDragDropFlags_AcceptNoPreviewTooltip = 1 << 12, // Request hiding the BeginDragDropSource tooltip from the BeginDragDropTarget site.
- ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect // For peeking ahead and inspecting the payload before delivery.
+ ImGuiDragDropFlags_AcceptPeekOnly = ImGuiDragDropFlags_AcceptBeforeDelivery | ImGuiDragDropFlags_AcceptNoDrawDefaultRect, // For peeking ahead and inspecting the payload before delivery.
};
// Standard Drag and Drop payload types. You can define you own payload types using short strings. Types starting with '_' are defined by Dear ImGui.
@@ -1349,10 +1347,14 @@ enum ImGuiSortDirection_
ImGuiSortDirection_Descending = 2 // Descending = 9->0, Z->A etc.
};
-// User fill ImGuiIO.KeyMap[] array with indices into the ImGuiIO.KeysDown[512] array
-enum ImGuiKey_
+// 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)
+// Since >= 1.89 we increased typing (went from int to enum), some legacy code may need a cast to ImGuiKey.
+enum ImGuiKey : int
{
- ImGuiKey_Tab,
+ // Keyboard
+ ImGuiKey_None = 0,
+ ImGuiKey_Tab = 512, // == ImGuiKey_NamedKey_BEGIN
ImGuiKey_LeftArrow,
ImGuiKey_RightArrow,
ImGuiKey_UpArrow,
@@ -1367,74 +1369,141 @@ enum ImGuiKey_
ImGuiKey_Space,
ImGuiKey_Enter,
ImGuiKey_Escape,
- ImGuiKey_KeyPadEnter,
- ImGuiKey_A, // for text edit CTRL+A: select all
- ImGuiKey_C, // for text edit CTRL+C: copy
- ImGuiKey_V, // for text edit CTRL+V: paste
- ImGuiKey_X, // for text edit CTRL+X: cut
- ImGuiKey_Y, // for text edit CTRL+Y: redo
- ImGuiKey_Z, // for text edit CTRL+Z: undo
- ImGuiKey_COUNT
-};
-
-// To test io.KeyMods (which is a combination of individual fields io.KeyCtrl, io.KeyShift, io.KeyAlt set by user/backend)
-enum ImGuiKeyModFlags_
-{
- ImGuiKeyModFlags_None = 0,
- ImGuiKeyModFlags_Ctrl = 1 << 0,
- ImGuiKeyModFlags_Shift = 1 << 1,
- ImGuiKeyModFlags_Alt = 1 << 2,
- ImGuiKeyModFlags_Super = 1 << 3
-};
-
-// Gamepad/Keyboard navigation
-// Keyboard: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard to enable. NewFrame() will automatically fill io.NavInputs[] based on your io.KeysDown[] + io.KeyMap[] arrays.
-// Gamepad: Set io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad to enable. Backend: set ImGuiBackendFlags_HasGamepad and fill the io.NavInputs[] fields before calling NewFrame(). Note that io.NavInputs[] is cleared by EndFrame().
-// Read instructions in imgui.cpp for more details. Download PNG/PSD at http://dearimgui.org/controls_sheets.
-enum ImGuiNavInput_
-{
- // Gamepad Mapping
- ImGuiNavInput_Activate, // activate / open / toggle / tweak value // e.g. Cross (PS4), A (Xbox), A (Switch), Space (Keyboard)
- ImGuiNavInput_Cancel, // cancel / close / exit // e.g. Circle (PS4), B (Xbox), B (Switch), Escape (Keyboard)
- ImGuiNavInput_Input, // text input / on-screen keyboard // e.g. Triang.(PS4), Y (Xbox), X (Switch), Return (Keyboard)
- ImGuiNavInput_Menu, // tap: toggle menu / hold: focus, move, resize // e.g. Square (PS4), X (Xbox), Y (Switch), Alt (Keyboard)
- ImGuiNavInput_DpadLeft, // move / tweak / resize window (w/ PadMenu) // e.g. D-pad Left/Right/Up/Down (Gamepads), Arrow keys (Keyboard)
- ImGuiNavInput_DpadRight, //
- ImGuiNavInput_DpadUp, //
- ImGuiNavInput_DpadDown, //
- ImGuiNavInput_LStickLeft, // scroll / move window (w/ PadMenu) // e.g. Left Analog Stick Left/Right/Up/Down
- ImGuiNavInput_LStickRight, //
- ImGuiNavInput_LStickUp, //
- ImGuiNavInput_LStickDown, //
- ImGuiNavInput_FocusPrev, // next window (w/ PadMenu) // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch)
- ImGuiNavInput_FocusNext, // prev window (w/ PadMenu) // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch)
- ImGuiNavInput_TweakSlow, // slower tweaks // e.g. L1 or L2 (PS4), LB or LT (Xbox), L or ZL (Switch)
- ImGuiNavInput_TweakFast, // faster tweaks // e.g. R1 or R2 (PS4), RB or RT (Xbox), R or ZL (Switch)
-
- // [Internal] Don't use directly! This is used internally to differentiate keyboard from gamepad inputs for behaviors that require to differentiate them.
- // Keyboard behavior that have no corresponding gamepad mapping (e.g. CTRL+TAB) will be directly reading from io.KeysDown[] instead of io.NavInputs[].
- ImGuiNavInput_KeyLeft_, // move left // = Arrow keys
- ImGuiNavInput_KeyRight_, // move right
- ImGuiNavInput_KeyUp_, // move up
- ImGuiNavInput_KeyDown_, // move down
+ ImGuiKey_LeftCtrl, ImGuiKey_LeftShift, ImGuiKey_LeftAlt, ImGuiKey_LeftSuper,
+ ImGuiKey_RightCtrl, ImGuiKey_RightShift, ImGuiKey_RightAlt, ImGuiKey_RightSuper,
+ ImGuiKey_Menu,
+ ImGuiKey_0, ImGuiKey_1, ImGuiKey_2, ImGuiKey_3, ImGuiKey_4, ImGuiKey_5, ImGuiKey_6, ImGuiKey_7, ImGuiKey_8, ImGuiKey_9,
+ ImGuiKey_A, ImGuiKey_B, ImGuiKey_C, ImGuiKey_D, ImGuiKey_E, ImGuiKey_F, ImGuiKey_G, ImGuiKey_H, ImGuiKey_I, ImGuiKey_J,
+ ImGuiKey_K, ImGuiKey_L, ImGuiKey_M, ImGuiKey_N, ImGuiKey_O, ImGuiKey_P, ImGuiKey_Q, ImGuiKey_R, ImGuiKey_S, ImGuiKey_T,
+ ImGuiKey_U, ImGuiKey_V, ImGuiKey_W, ImGuiKey_X, ImGuiKey_Y, ImGuiKey_Z,
+ ImGuiKey_F1, ImGuiKey_F2, ImGuiKey_F3, ImGuiKey_F4, ImGuiKey_F5, ImGuiKey_F6,
+ ImGuiKey_F7, ImGuiKey_F8, ImGuiKey_F9, ImGuiKey_F10, ImGuiKey_F11, ImGuiKey_F12,
+ ImGuiKey_Apostrophe, // '
+ ImGuiKey_Comma, // ,
+ ImGuiKey_Minus, // -
+ ImGuiKey_Period, // .
+ ImGuiKey_Slash, // /
+ ImGuiKey_Semicolon, // ;
+ ImGuiKey_Equal, // =
+ ImGuiKey_LeftBracket, // [
+ ImGuiKey_Backslash, // \ (this text inhibit multiline comment caused by backslash)
+ ImGuiKey_RightBracket, // ]
+ ImGuiKey_GraveAccent, // `
+ ImGuiKey_CapsLock,
+ ImGuiKey_ScrollLock,
+ ImGuiKey_NumLock,
+ ImGuiKey_PrintScreen,
+ ImGuiKey_Pause,
+ ImGuiKey_Keypad0, ImGuiKey_Keypad1, ImGuiKey_Keypad2, ImGuiKey_Keypad3, ImGuiKey_Keypad4,
+ ImGuiKey_Keypad5, ImGuiKey_Keypad6, ImGuiKey_Keypad7, ImGuiKey_Keypad8, ImGuiKey_Keypad9,
+ ImGuiKey_KeypadDecimal,
+ ImGuiKey_KeypadDivide,
+ ImGuiKey_KeypadMultiply,
+ ImGuiKey_KeypadSubtract,
+ ImGuiKey_KeypadAdd,
+ ImGuiKey_KeypadEnter,
+ ImGuiKey_KeypadEqual,
+
+ // Gamepad (some of those are analog values, 0.0f to 1.0f) // GAME 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)
+ ImGuiKey_GamepadFaceLeft, // X (Xbox) Y (Switch) Square (PS) // Tap: Toggle Menu. Hold: Windowing mode (Focus/Move/Resize windows)
+ ImGuiKey_GamepadFaceRight, // B (Xbox) A (Switch) Circle (PS) // Cancel / Close / Exit
+ ImGuiKey_GamepadFaceUp, // Y (Xbox) X (Switch) Triangle (PS) // Text Input / On-screen Keyboard
+ ImGuiKey_GamepadFaceDown, // A (Xbox) B (Switch) Cross (PS) // Activate / Open / Toggle / Tweak
+ ImGuiKey_GamepadDpadLeft, // D-pad Left // Move / Tweak / Resize Window (in Windowing mode)
+ ImGuiKey_GamepadDpadRight, // D-pad Right // Move / Tweak / Resize Window (in Windowing mode)
+ ImGuiKey_GamepadDpadUp, // D-pad Up // Move / Tweak / Resize Window (in Windowing mode)
+ ImGuiKey_GamepadDpadDown, // D-pad Down // Move / Tweak / Resize Window (in Windowing mode)
+ ImGuiKey_GamepadL1, // L Bumper (Xbox) L (Switch) L1 (PS) // Tweak Slower / Focus Previous (in Windowing mode)
+ ImGuiKey_GamepadR1, // R Bumper (Xbox) R (Switch) R1 (PS) // Tweak Faster / Focus Next (in Windowing mode)
+ ImGuiKey_GamepadL2, // L Trig. (Xbox) ZL (Switch) L2 (PS) [Analog]
+ ImGuiKey_GamepadR2, // R Trig. (Xbox) ZR (Switch) R2 (PS) [Analog]
+ ImGuiKey_GamepadL3, // L Stick (Xbox) L3 (Switch) L3 (PS)
+ ImGuiKey_GamepadR3, // R Stick (Xbox) R3 (Switch) R3 (PS)
+ ImGuiKey_GamepadLStickLeft, // [Analog] // Move Window (in Windowing mode)
+ ImGuiKey_GamepadLStickRight, // [Analog] // Move Window (in Windowing mode)
+ ImGuiKey_GamepadLStickUp, // [Analog] // Move Window (in Windowing mode)
+ ImGuiKey_GamepadLStickDown, // [Analog] // Move Window (in Windowing mode)
+ ImGuiKey_GamepadRStickLeft, // [Analog]
+ ImGuiKey_GamepadRStickRight, // [Analog]
+ ImGuiKey_GamepadRStickUp, // [Analog]
+ ImGuiKey_GamepadRStickDown, // [Analog]
+
+ // 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,
+
+ // [Internal] Reserved for mod storage
+ ImGuiKey_ReservedForModCtrl, ImGuiKey_ReservedForModShift, ImGuiKey_ReservedForModAlt, ImGuiKey_ReservedForModSuper,
+ ImGuiKey_COUNT,
+
+ // Keyboard Modifiers (explicitly submitted by backend via AddKeyEvent() calls)
+ // - This is mirroring the data also written to io.KeyCtrl, io.KeyShift, io.KeyAlt, io.KeySuper, in a format allowing
+ // them to be accessed via standard key API, allowing calls such as IsKeyPressed(), IsKeyReleased(), querying duration etc.
+ // - Code polling every key (e.g. an interface to detect a key press for input mapping) might want to ignore those
+ // and prefer using the real keys (e.g. ImGuiKey_LeftCtrl, ImGuiKey_RightCtrl instead of ImGuiMod_Ctrl).
+ // - In theory the value of keyboard modifiers should be roughly equivalent to a logical or of the equivalent left/right keys.
+ // 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_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
+
+ // [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)
+ 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).
+#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).
+#endif
+
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ ImGuiKey_ModCtrl = ImGuiMod_Ctrl, ImGuiKey_ModShift = ImGuiMod_Shift, ImGuiKey_ModAlt = ImGuiMod_Alt, ImGuiKey_ModSuper = ImGuiMod_Super, // Renamed in 1.89
+ ImGuiKey_KeyPadEnter = ImGuiKey_KeypadEnter, // Renamed in 1.87
+#endif
+};
+
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
+// OBSOLETED in 1.88 (from July 2022): ImGuiNavInput and io.NavInputs[].
+// Official backends between 1.60 and 1.86: will keep working and feed gamepad inputs as long as IMGUI_DISABLE_OBSOLETE_KEYIO is not set.
+// Custom backends: feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums.
+enum ImGuiNavInput
+{
+ ImGuiNavInput_Activate, ImGuiNavInput_Cancel, ImGuiNavInput_Input, ImGuiNavInput_Menu, ImGuiNavInput_DpadLeft, ImGuiNavInput_DpadRight, ImGuiNavInput_DpadUp, ImGuiNavInput_DpadDown,
+ ImGuiNavInput_LStickLeft, ImGuiNavInput_LStickRight, ImGuiNavInput_LStickUp, ImGuiNavInput_LStickDown, ImGuiNavInput_FocusPrev, ImGuiNavInput_FocusNext, ImGuiNavInput_TweakSlow, ImGuiNavInput_TweakFast,
ImGuiNavInput_COUNT,
- ImGuiNavInput_InternalStart_ = ImGuiNavInput_KeyLeft_
};
+#endif
// Configuration flags stored in io.ConfigFlags. Set by user/application.
enum ImGuiConfigFlags_
{
ImGuiConfigFlags_None = 0,
- ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, // Master keyboard navigation enable flag. NewFrame() will automatically fill io.NavInputs[] based on io.KeysDown[].
- ImGuiConfigFlags_NavEnableGamepad = 1 << 1, // Master gamepad navigation enable flag. This is mostly to instruct your imgui backend to fill io.NavInputs[]. Backend also needs to set ImGuiBackendFlags_HasGamepad.
+ ImGuiConfigFlags_NavEnableKeyboard = 1 << 0, // Master keyboard navigation enable flag.
+ 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.
ImGuiConfigFlags_NoMouse = 1 << 4, // Instruct imgui to clear mouse position/buttons in NewFrame(). This allows ignoring the mouse information set by the backend.
ImGuiConfigFlags_NoMouseCursorChange = 1 << 5, // Instruct backend to not alter mouse cursor shape and visibility. Use if the backend cursor changes are interfering with yours and you don't want to use SetMouseCursor() to change mouse cursor. You may want to honor requests from imgui by reading GetMouseCursor() yourself instead.
- // User storage (to allow your backend/engine to communicate to code that may be shared between multiple projects. Those flags are not used by core Dear ImGui)
+ // User storage (to allow your backend/engine to communicate to code that may be shared between multiple projects. Those flags are NOT used by core Dear ImGui)
ImGuiConfigFlags_IsSRGB = 1 << 20, // Application is SRGB-aware.
- ImGuiConfigFlags_IsTouchScreen = 1 << 21 // Application is using a touch screen instead of a mouse.
+ ImGuiConfigFlags_IsTouchScreen = 1 << 21, // Application is using a touch screen instead of a mouse.
};
// Backend capabilities flags stored in io.BackendFlags. Set by imgui_impl_xxx or custom backend.
@@ -1444,7 +1513,7 @@ enum ImGuiBackendFlags_
ImGuiBackendFlags_HasGamepad = 1 << 0, // Backend Platform supports gamepad and currently has one connected.
ImGuiBackendFlags_HasMouseCursors = 1 << 1, // Backend Platform supports honoring GetMouseCursor() value to change the OS cursor shape.
ImGuiBackendFlags_HasSetMousePos = 1 << 2, // Backend Platform supports io.WantSetMousePos requests to reposition the OS mouse position (only used if ImGuiConfigFlags_NavEnableSetMousePos is set).
- ImGuiBackendFlags_RendererHasVtxOffset = 1 << 3 // Backend Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bit indices.
+ ImGuiBackendFlags_RendererHasVtxOffset = 1 << 3, // Backend Renderer supports ImDrawCmd::VtxOffset. This enables output of large meshes (64K+ vertices) while still using 16-bit indices.
};
// Enumeration for PushStyleColor() / PopStyleColor()
@@ -1480,10 +1549,10 @@ enum ImGuiCol_
ImGuiCol_Separator,
ImGuiCol_SeparatorHovered,
ImGuiCol_SeparatorActive,
- ImGuiCol_ResizeGrip,
+ ImGuiCol_ResizeGrip, // Resize grip in lower-right and lower-left corners of windows.
ImGuiCol_ResizeGripHovered,
ImGuiCol_ResizeGripActive,
- ImGuiCol_Tab,
+ ImGuiCol_Tab, // TabItem in a TabBar
ImGuiCol_TabHovered,
ImGuiCol_TabActive,
ImGuiCol_TabUnfocused,
@@ -1498,7 +1567,7 @@ enum ImGuiCol_
ImGuiCol_TableRowBg, // Table row background (even rows)
ImGuiCol_TableRowBgAlt, // Table row background (odd rows)
ImGuiCol_TextSelectedBg,
- ImGuiCol_DragDropTarget,
+ ImGuiCol_DragDropTarget, // Rectangle highlighting a drop target
ImGuiCol_NavHighlight, // Gamepad/keyboard: current highlighted item
ImGuiCol_NavWindowingHighlight, // Highlight window when using CTRL+TAB
ImGuiCol_NavWindowingDimBg, // Darken/colorize entire screen behind the CTRL+TAB window list, when active
@@ -1510,7 +1579,7 @@ enum ImGuiCol_
// - The enum only refers to fields of ImGuiStyle which makes sense to be pushed/popped inside UI code.
// During initialization or between frames, feel free to just poke into ImGuiStyle directly.
// - Tip: Use your programming IDE navigation facilities on the names in the _second column_ below to find the actual members and their description.
-// In Visual Studio IDE: CTRL+comma ("Edit.NavigateTo") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
+// 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.
// - When changing this enum, you need to update the associated internal table GStyleVarInfo[] accordingly. This is where we link enum values to members offset/type.
enum ImGuiStyleVar_
@@ -1554,7 +1623,7 @@ enum ImGuiButtonFlags_
// [Internal]
ImGuiButtonFlags_MouseButtonMask_ = ImGuiButtonFlags_MouseButtonLeft | ImGuiButtonFlags_MouseButtonRight | ImGuiButtonFlags_MouseButtonMiddle,
- ImGuiButtonFlags_MouseButtonDefault_ = ImGuiButtonFlags_MouseButtonLeft
+ ImGuiButtonFlags_MouseButtonDefault_ = ImGuiButtonFlags_MouseButtonLeft,
};
// Flags for ColorEdit3() / ColorEdit4() / ColorPicker3() / ColorPicker4() / ColorButton()
@@ -1595,16 +1664,15 @@ enum ImGuiColorEditFlags_
ImGuiColorEditFlags_DisplayMask_ = ImGuiColorEditFlags_DisplayRGB | ImGuiColorEditFlags_DisplayHSV | ImGuiColorEditFlags_DisplayHex,
ImGuiColorEditFlags_DataTypeMask_ = ImGuiColorEditFlags_Uint8 | ImGuiColorEditFlags_Float,
ImGuiColorEditFlags_PickerMask_ = ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_PickerHueBar,
- ImGuiColorEditFlags_InputMask_ = ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_InputHSV
+ ImGuiColorEditFlags_InputMask_ = ImGuiColorEditFlags_InputRGB | ImGuiColorEditFlags_InputHSV,
// Obsolete names (will be removed)
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- , ImGuiColorEditFlags_RGB = ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_HSV = ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_HEX = ImGuiColorEditFlags_DisplayHex // [renamed in 1.69]
-#endif
+ // ImGuiColorEditFlags_RGB = ImGuiColorEditFlags_DisplayRGB, ImGuiColorEditFlags_HSV = ImGuiColorEditFlags_DisplayHSV, ImGuiColorEditFlags_HEX = ImGuiColorEditFlags_DisplayHex // [renamed in 1.69]
};
// Flags for DragFloat(), DragInt(), SliderFloat(), SliderInt() etc.
// We use the same sets of flags for DragXXX() and SliderXXX() functions as the features are the same and it makes it easier to swap them.
+// (Those are per-item flags. There are shared flags in ImGuiIO: io.ConfigDragClickToInputText)
enum ImGuiSliderFlags_
{
ImGuiSliderFlags_None = 0,
@@ -1612,11 +1680,11 @@ enum ImGuiSliderFlags_
ImGuiSliderFlags_Logarithmic = 1 << 5, // Make the widget logarithmic (linear otherwise). Consider using ImGuiSliderFlags_NoRoundToFormat with this if using a format-string with small amount of digits.
ImGuiSliderFlags_NoRoundToFormat = 1 << 6, // Disable rounding underlying value to match precision of the display format string (e.g. %.3f values are rounded to those 3 digits)
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.
+ 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]
+ ImGuiSliderFlags_ClampOnInput = ImGuiSliderFlags_AlwaysClamp, // [renamed in 1.79]
#endif
};
@@ -1638,7 +1706,7 @@ enum ImGuiMouseCursor_
ImGuiMouseCursor_Arrow = 0,
ImGuiMouseCursor_TextInput, // When hovering over InputText, etc.
ImGuiMouseCursor_ResizeAll, // (Unused by Dear ImGui functions)
- ImGuiMouseCursor_ResizeNS, // When hovering over an horizontal border
+ ImGuiMouseCursor_ResizeNS, // When hovering over a horizontal border
ImGuiMouseCursor_ResizeEW, // When hovering over a vertical border or a column
ImGuiMouseCursor_ResizeNESW, // When hovering over the bottom-left corner of a window
ImGuiMouseCursor_ResizeNWSE, // When hovering over the bottom-right corner of a window
@@ -1653,10 +1721,10 @@ enum ImGuiMouseCursor_
enum ImGuiCond_
{
ImGuiCond_None = 0, // No condition (always set the variable), same as _Always
- ImGuiCond_Always = 1 << 0, // No condition (always set the variable)
+ ImGuiCond_Always = 1 << 0, // No condition (always set the variable), same as _None
ImGuiCond_Once = 1 << 1, // Set the variable once per runtime session (only the first call will succeed)
ImGuiCond_FirstUseEver = 1 << 2, // Set the variable if the object/window has no persistently saved data (no entry in .ini file)
- ImGuiCond_Appearing = 1 << 3 // Set the variable if the object/window is appearing after being hidden/inactive (or the first time)
+ ImGuiCond_Appearing = 1 << 3, // Set the variable if the object/window is appearing after being hidden/inactive (or the first time)
};
//-----------------------------------------------------------------------------
@@ -1705,7 +1773,7 @@ struct ImVector
// Constructors, destructor
inline ImVector() { Size = Capacity = 0; Data = NULL; }
inline ImVector(const ImVector<T>& src) { Size = Capacity = 0; Data = NULL; operator=(src); }
- inline ImVector<T>& operator=(const ImVector<T>& src) { clear(); resize(src.Size); memcpy(Data, src.Data, (size_t)Size * sizeof(T)); return *this; }
+ inline ImVector<T>& operator=(const ImVector<T>& src) { clear(); resize(src.Size); if (src.Data) memcpy(Data, src.Data, (size_t)Size * sizeof(T)); return *this; }
inline ~ImVector() { if (Data) IM_FREE(Data); } // Important: does not destruct anything
inline void clear() { if (Data) { Size = Capacity = 0; IM_FREE(Data); Data = NULL; } } // Important: does not destruct anything
@@ -1735,13 +1803,14 @@ struct ImVector
inline void resize(int new_size, const T& v) { if (new_size > Capacity) reserve(_grow_capacity(new_size)); if (new_size > Size) for (int n = Size; n < new_size; n++) memcpy(&Data[n], &v, sizeof(v)); Size = new_size; }
inline void shrink(int new_size) { IM_ASSERT(new_size <= Size); Size = new_size; } // Resize a vector to a smaller size, guaranteed not to cause a reallocation
inline void reserve(int new_capacity) { if (new_capacity <= Capacity) return; T* new_data = (T*)IM_ALLOC((size_t)new_capacity * sizeof(T)); if (Data) { memcpy(new_data, Data, (size_t)Size * sizeof(T)); IM_FREE(Data); } Data = new_data; Capacity = new_capacity; }
+ inline void reserve_discard(int new_capacity) { if (new_capacity <= Capacity) return; if (Data) IM_FREE(Data); Data = (T*)IM_ALLOC((size_t)new_capacity * sizeof(T)); Capacity = new_capacity; }
// NB: It is illegal to call push_back/push_front/insert with a reference pointing inside the ImVector data itself! e.g. v.push_back(v[10]) is forbidden.
inline void push_back(const T& v) { if (Size == Capacity) reserve(_grow_capacity(Size + 1)); memcpy(&Data[Size], &v, sizeof(v)); Size++; }
inline void pop_back() { IM_ASSERT(Size > 0); Size--; }
inline void push_front(const T& v) { if (Size == 0) push_back(v); else insert(Data, v); }
inline T* erase(const T* it) { IM_ASSERT(it >= Data && it < Data + Size); const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + 1, ((size_t)Size - (size_t)off - 1) * sizeof(T)); Size--; return Data + off; }
- inline T* erase(const T* it, const T* it_last){ IM_ASSERT(it >= Data && it < Data + Size && it_last > it && it_last <= Data + Size); const ptrdiff_t count = it_last - it; const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + count, ((size_t)Size - (size_t)off - count) * sizeof(T)); Size -= (int)count; return Data + off; }
+ inline T* erase(const T* it, const T* it_last){ IM_ASSERT(it >= Data && it < Data + Size && it_last >= it && it_last <= Data + Size); const ptrdiff_t count = it_last - it; const ptrdiff_t off = it - Data; memmove(Data + off, Data + off + count, ((size_t)Size - (size_t)off - (size_t)count) * sizeof(T)); Size -= (int)count; return Data + off; }
inline T* erase_unsorted(const T* it) { IM_ASSERT(it >= Data && it < Data + Size); const ptrdiff_t off = it - Data; if (it < Data + Size - 1) memcpy(Data + off, Data + Size - 1, sizeof(T)); Size--; return Data + off; }
inline T* insert(const T* it, const T& v) { IM_ASSERT(it >= Data && it <= Data + Size); const ptrdiff_t off = it - Data; if (Size == Capacity) reserve(_grow_capacity(Size + 1)); if (off < (int)Size) memmove(Data + off + 1, Data + off, ((size_t)Size - (size_t)off) * sizeof(T)); memcpy(&Data[off], &v, sizeof(v)); Size++; return Data + off; }
inline bool contains(const T& v) const { const T* data = Data; const T* data_end = Data + Size; while (data < data_end) if (*data++ == v) return true; return false; }
@@ -1768,7 +1837,7 @@ struct ImGuiStyle
ImVec2 WindowPadding; // Padding within a window.
float WindowRounding; // Radius of window corners rounding. Set to 0.0f to have rectangular windows. Large values tend to lead to variety of artifacts and are not recommended.
float WindowBorderSize; // Thickness of border around windows. Generally set to 0.0f or 1.0f. (Other values are not well tested and more CPU/GPU costly).
- ImVec2 WindowMinSize; // Minimum window size. This is a global setting. If you want to constraint individual windows, use SetNextWindowSizeConstraints().
+ ImVec2 WindowMinSize; // Minimum window size. This is a global setting. If you want to constrain individual windows, use SetNextWindowSizeConstraints().
ImVec2 WindowTitleAlign; // Alignment for title bar text. Defaults to (0.0f,0.5f) for left-aligned,vertically centered.
ImGuiDir WindowMenuButtonPosition; // Side of the collapsing/docking button in the title bar (None/Left/Right). Defaults to ImGuiDir_Left.
float ChildRounding; // Radius of child window corners rounding. Set to 0.0f to have rectangular windows.
@@ -1791,7 +1860,7 @@ struct ImGuiStyle
float LogSliderDeadzone; // The size in pixels of the dead-zone around zero on logarithmic sliders that cross zero.
float TabRounding; // Radius of upper corners of a tab. Set to 0.0f to have rectangular tabs.
float TabBorderSize; // Thickness of border around tabs.
- float TabMinWidthForCloseButton; // Minimum width for close button to appears on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected.
+ float TabMinWidthForCloseButton; // Minimum width for close button to appear on an unselected tab when hovered. Set to 0.0f to always show when hovering, set to FLT_MAX to never show close button unless selected.
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.
@@ -1799,7 +1868,7 @@ struct ImGuiStyle
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.
bool AntiAliasedLines; // Enable anti-aliased lines/borders. Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList).
- bool AntiAliasedLinesUseTex; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering. Latched at the beginning of the frame (copied to ImDrawList).
+ bool AntiAliasedLinesUseTex; // Enable anti-aliased lines/borders using textures where possible. Require backend to render with bilinear filtering (NOT point/nearest filtering). Latched at the beginning of the frame (copied to ImDrawList).
bool AntiAliasedFill; // Enable anti-aliased edges around filled shapes (rounded rectangles, circles, etc.). Disable if you are really tight on CPU/GPU. Latched at the beginning of the frame (copied to ImDrawList).
float CurveTessellationTol; // Tessellation tolerance when using PathBezierCurveTo() without a specific number of segments. Decrease for highly tessellated curves (higher quality, more polygons), increase to reduce quality.
float CircleTessellationMaxError; // Maximum error (in pixels) allowed when using AddCircle()/AddCircleFilled() or drawing rounded corner rectangles with no explicit segment count specified. Decrease for higher quality but more geometry.
@@ -1816,25 +1885,36 @@ struct ImGuiStyle
// Access via ImGui::GetIO(). Read 'Programmer guide' section in .cpp file for general usage.
//-----------------------------------------------------------------------------
+// [Internal] Storage used by IsKeyDown(), IsKeyPressed() etc functions.
+// If prior to 1.87 you used io.KeysDownDuration[] (which was marked as internal), you should use GetKeyData(key)->DownDuration and *NOT* io.KeysData[key]->DownDuration.
+struct ImGuiKeyData
+{
+ bool Down; // True for if key is down
+ float DownDuration; // Duration the key has been down (<0.0f: not pressed, 0.0f: just pressed, >0.0f: time held)
+ float DownDurationPrev; // Last frame duration the key has been down
+ float AnalogValue; // 0.0f..1.0f for gamepad values
+};
+
struct ImGuiIO
{
//------------------------------------------------------------------
- // Configuration (fill once) // Default value
+ // Configuration // Default value
//------------------------------------------------------------------
ImGuiConfigFlags ConfigFlags; // = 0 // See ImGuiConfigFlags_ enum. Set by user/application. Gamepad/keyboard navigation options, etc.
ImGuiBackendFlags BackendFlags; // = 0 // See ImGuiBackendFlags_ enum. Set by backend (imgui_impl_xxx files or custom backend) to communicate features supported by the backend.
- ImVec2 DisplaySize; // <unset> // Main display size, in pixels (generally == GetMainViewport()->Size)
- float DeltaTime; // = 1.0f/60.0f // Time elapsed since last frame, in seconds.
+ ImVec2 DisplaySize; // <unset> // Main display size, in pixels (generally == GetMainViewport()->Size). May change every frame.
+ float DeltaTime; // = 1.0f/60.0f // Time elapsed since last frame, in seconds. May change every frame.
float IniSavingRate; // = 5.0f // Minimum time between saving positions/sizes to .ini file, in seconds.
const char* IniFilename; // = "imgui.ini" // Path to .ini file (important: default "imgui.ini" is relative to current working dir!). Set NULL to disable automatic .ini loading/saving or if you want to manually call LoadIniSettingsXXX() / SaveIniSettingsXXX() functions.
const char* LogFilename; // = "imgui_log.txt"// Path to .log file (default parameter to ImGui::LogToFile when no file is specified).
float MouseDoubleClickTime; // = 0.30f // Time for a double-click, in seconds.
float MouseDoubleClickMaxDist; // = 6.0f // Distance threshold to stay in to validate a double-click, in pixels.
float MouseDragThreshold; // = 6.0f // Distance threshold before considering we are dragging.
- int KeyMap[ImGuiKey_COUNT]; // <unset> // Map of indices into the KeysDown[512] entries array which represent your "native" keyboard state.
- float KeyRepeatDelay; // = 0.250f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
+ float KeyRepeatDelay; // = 0.275f // When holding a key/button, time before it starts repeating, in seconds (for buttons in Repeat mode, etc.).
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.
ImFontAtlas*Fonts; // <auto> // Font atlas: load, rasterize and pack one or more fonts into a single texture.
@@ -1846,7 +1926,9 @@ struct ImGuiIO
// Miscellaneous options
bool MouseDrawCursor; // = false // Request ImGui to draw a mouse cursor for you (if you are on a platform without a mouse cursor). Cannot be easily renamed to 'io.ConfigXXX' because this is frequently used by backend implementations.
bool ConfigMacOSXBehaviors; // = defined(__APPLE__) // OS X style: Text editing cursor movement using Alt instead of Ctrl, Shortcuts using Cmd/Super instead of Ctrl, Line/Text Start and End using Cmd+Arrows instead of Home/End, Double click selects by word instead of selecting whole text, Multi-selection in lists uses Cmd/Super instead of Ctrl.
+ bool ConfigInputTrickleEventQueue; // = true // 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.
bool ConfigInputTextCursorBlink; // = true // Enable blinking cursor (optional as some users consider it to be distracting).
+ bool ConfigInputTextEnterKeepActive; // = false // [BETA] Pressing Enter will keep item active and select contents (single-line only).
bool ConfigDragClickToInputText; // = false // [BETA] Enable turning DragXXX widgets into text input with a simple mouse click-release (without moving). Not desirable on devices without a keyboard.
bool ConfigWindowsResizeFromEdges; // = true // Enable resizing of windows from their edges and from the lower-left corner. This requires (io.BackendFlags & ImGuiBackendFlags_HasMouseCursors) because it needs mouse cursor feedback. (This used to be a per-window ImGuiWindowFlags_ResizeFromAnySide flag)
bool ConfigWindowsMoveFromTitleBarOnly; // = false // Enable allowing to move windows only when clicking on their title bar. Does not apply to windows without a title bar.
@@ -1872,31 +1954,32 @@ struct ImGuiIO
// Optional: Notify OS Input Method Editor of the screen position of your cursor for text input position (e.g. when using Japanese/Chinese IME on Windows)
// (default to use native imm32 api on Windows)
- void (*ImeSetInputScreenPosFn)(int x, int y);
- void* ImeWindowHandle; // = NULL // (Windows) Set this to your HWND to get automatic IME cursor positioning.
+ void (*SetPlatformImeDataFn)(ImGuiViewport* viewport, ImGuiPlatformImeData* data);
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ void* ImeWindowHandle; // = NULL // [Obsolete] Set ImGuiViewport::PlatformHandleRaw instead. Set this to your HWND to get automatic IME cursor positioning.
+#else
+ void* _UnusedPadding; // Unused field to keep data structure the same size.
+#endif
//------------------------------------------------------------------
- // Input - Fill before calling NewFrame()
+ // Input - Call before calling NewFrame()
//------------------------------------------------------------------
- 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. Others buttons allows 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 an horizontal wheel, may not be filled by all backends.
- bool KeyCtrl; // Keyboard modifier pressed: Control
- bool KeyShift; // Keyboard modifier pressed: Shift
- bool KeyAlt; // Keyboard modifier pressed: Alt
- bool KeySuper; // Keyboard modifier pressed: Cmd/Super/Windows
- bool KeysDown[512]; // Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys).
- float NavInputs[ImGuiNavInput_COUNT]; // Gamepad inputs. Cleared back to zero by EndFrame(). Keyboard keys will be auto-mapped and be written here by NewFrame().
-
- // Functions
- IMGUI_API void AddInputCharacter(unsigned int c); // Queue new character input
- IMGUI_API void AddInputCharacterUTF16(ImWchar16 c); // Queue new character input from an UTF-16 character, it can be a surrogate
- IMGUI_API void AddInputCharactersUTF8(const char* str); // Queue new characters input from an UTF-8 string
- IMGUI_API void AddFocusEvent(bool focused); // Notifies Dear ImGui when hosting platform windows lose or gain input focus
- IMGUI_API void ClearInputCharacters(); // [Internal] Clear the text input buffer manually
- IMGUI_API void ClearInputKeys(); // [Internal] Release all keys
+ // Input Functions
+ IMGUI_API void AddKeyEvent(ImGuiKey key, bool down); // Queue a new key down/up event. Key should be "translated" (as in, generally ImGuiKey_A matches the key end-user would use to emit an 'A' character)
+ 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 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
+ IMGUI_API void AddInputCharactersUTF8(const char* str); // Queue a new characters input from a UTF-8 string
+
+ IMGUI_API void SetKeyEventNativeData(ImGuiKey key, int native_keycode, int native_scancode, int native_legacy_index = -1); // [Optional] Specify index for legacy <1.87 IsKeyXXX() functions with native indices + specify native keycode, scancode.
+ IMGUI_API void SetAppAcceptingEvents(bool accepting_events); // Set master flag for accepting key/mouse/text events (default to true). Useful if you have native dialog boxes that are interrupting your application loop/refresh, and you want to disable events being queued while your app is frozen.
+ IMGUI_API void ClearInputCharacters(); // [Internal] Clear the text input buffer manually
+ IMGUI_API void ClearInputKeys(); // [Internal] Release all keys
//------------------------------------------------------------------
// Output - Updated by NewFrame() or EndFrame()/Render()
@@ -1904,49 +1987,70 @@ struct ImGuiIO
// generally easier and more correct to use their state BEFORE calling NewFrame(). See FAQ for details!)
//------------------------------------------------------------------
- bool WantCaptureMouse; // Set when Dear ImGui will use mouse inputs, in this case do not dispatch them to your main game/application (either way, always pass on mouse inputs to imgui). (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.).
- bool WantCaptureKeyboard; // Set when Dear ImGui will use keyboard inputs, in this case do not dispatch them to your main game/application (either way, always pass keyboard inputs to imgui). (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.).
- bool WantTextInput; // Mobile/console: when set, you may display an on-screen keyboard. This is set by Dear ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active).
- bool WantSetMousePos; // MousePos has been altered, backend should reposition mouse on next frame. Rarely used! Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled.
- bool WantSaveIniSettings; // When manual .ini load/save is active (io.IniFilename == NULL), this will be set to notify your application that you can call SaveIniSettingsToMemory() and save yourself. Important: clear io.WantSaveIniSettings yourself after saving!
- bool NavActive; // Keyboard/Gamepad navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag.
- bool NavVisible; // Keyboard/Gamepad navigation is visible and allowed (will handle ImGuiKey_NavXXX events).
- float Framerate; // Rough estimate of application framerate, in frame per second. Solely for convenience. Rolling average estimation based on io.DeltaTime over 120 frames.
- int MetricsRenderVertices; // Vertices output during last call to Render()
- int MetricsRenderIndices; // Indices output during last call to Render() = number of triangles * 3
- int MetricsRenderWindows; // Number of visible windows
- int MetricsActiveWindows; // Number of active windows
- int MetricsActiveAllocations; // Number of active allocations, updated by MemAlloc/MemFree based on current context. May be off if you have multiple imgui contexts.
- ImVec2 MouseDelta; // Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta.
+ bool WantCaptureMouse; // Set when Dear ImGui will use mouse inputs, in this case do not dispatch them to your main game/application (either way, always pass on mouse inputs to imgui). (e.g. unclicked mouse is hovering over an imgui window, widget is active, mouse was clicked over an imgui window, etc.).
+ bool WantCaptureKeyboard; // Set when Dear ImGui will use keyboard inputs, in this case do not dispatch them to your main game/application (either way, always pass keyboard inputs to imgui). (e.g. InputText active, or an imgui window is focused and navigation is enabled, etc.).
+ bool WantTextInput; // Mobile/console: when set, you may display an on-screen keyboard. This is set by Dear ImGui when it wants textual keyboard input to happen (e.g. when a InputText widget is active).
+ bool WantSetMousePos; // MousePos has been altered, backend should reposition mouse on next frame. Rarely used! Set only when ImGuiConfigFlags_NavEnableSetMousePos flag is enabled.
+ bool WantSaveIniSettings; // When manual .ini load/save is active (io.IniFilename == NULL), this will be set to notify your application that you can call SaveIniSettingsToMemory() and save yourself. Important: clear io.WantSaveIniSettings yourself after saving!
+ bool NavActive; // Keyboard/Gamepad navigation is currently allowed (will handle ImGuiKey_NavXXX events) = a window is focused and it doesn't use the ImGuiWindowFlags_NoNavInputs flag.
+ bool NavVisible; // Keyboard/Gamepad navigation is visible and allowed (will handle ImGuiKey_NavXXX events).
+ float Framerate; // Estimate of application framerate (rolling average over 60 frames, based on io.DeltaTime), in frame per second. Solely for convenience. Slow applications may not want to use a moving average or may want to reset underlying buffers occasionally.
+ int MetricsRenderVertices; // Vertices output during last call to Render()
+ int MetricsRenderIndices; // Indices output during last call to Render() = number of triangles * 3
+ int MetricsRenderWindows; // Number of visible windows
+ int MetricsActiveWindows; // Number of active windows
+ int MetricsActiveAllocations; // Number of active allocations, updated by MemAlloc/MemFree based on current context. May be off if you have multiple imgui contexts.
+ ImVec2 MouseDelta; // Mouse delta. Note that this is zero if either current or previous position are invalid (-FLT_MAX,-FLT_MAX), so a disappearing/reappearing mouse won't have a huge delta.
+
+ // Legacy: before 1.87, we required backend to fill io.KeyMap[] (imgui->native map) during initialization and io.KeysDown[] (native indices) every frame.
+ // This is still temporarily supported as a legacy feature. However the new preferred scheme is for backend to call io.AddKeyEvent().
+ // Old (<1.87): ImGui::IsKeyPressed(ImGui::GetIO().KeyMap[ImGuiKey_Space]) --> New (1.87+) ImGui::IsKeyPressed(ImGuiKey_Space)
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
+ int KeyMap[ImGuiKey_COUNT]; // [LEGACY] Input: map of indices into the KeysDown[512] entries array which represent your "native" keyboard state. The first 512 are now unused and should be kept zero. Legacy backend will write into KeyMap[] using ImGuiKey_ indices which are always >512.
+ bool KeysDown[ImGuiKey_COUNT]; // [LEGACY] Input: Keyboard keys that are pressed (ideally left in the "native" order your engine has access to keyboard keys, so you can use your own defines/enums for keys). This used to be [512] sized. It is now ImGuiKey_COUNT to allow legacy io.KeysDown[GetKeyIndex(...)] to work without an overflow.
+ float NavInputs[ImGuiNavInput_COUNT]; // [LEGACY] Since 1.88, NavInputs[] was removed. Backends from 1.60 to 1.86 won't build. Feed gamepad inputs via io.AddKeyEvent() and ImGuiKey_GamepadXXX enums.
+#endif
//------------------------------------------------------------------
// [Internal] Dear ImGui will maintain those fields. Forward compatibility not guaranteed!
//------------------------------------------------------------------
- bool WantCaptureMouseUnlessPopupClose;// Alternative to WantCaptureMouse: (WantCaptureMouse == true && WantCaptureMouseUnlessPopupClose == false) when a click over void is expected to close a popup.
- ImGuiKeyModFlags KeyMods; // Key mods flags (same as io.KeyCtrl/KeyShift/KeyAlt/KeySuper but merged into flags), updated by NewFrame()
- ImGuiKeyModFlags KeyModsPrev; // Previous key mods
- ImVec2 MousePosPrev; // Previous mouse position (note that MouseDelta is not necessary == MousePos-MousePosPrev, in case either position is invalid)
- ImVec2 MouseClickedPos[5]; // Position at time of clicking
- double MouseClickedTime[5]; // Time of last click (used to figure out double-click)
- bool MouseClicked[5]; // Mouse button went from !Down to Down
- bool MouseDoubleClicked[5]; // Has mouse button been double-clicked?
- 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 MouseDownWasDoubleClick[5]; // Track if button down was a double-click
- 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
- ImVec2 MouseDragMaxDistanceAbs[5]; // Maximum distance, absolute, on each axis, of how much mouse has traveled from the clicking point
- float MouseDragMaxDistanceSqr[5]; // Squared maximum distance of how much mouse has traveled from the clicking point
- float KeysDownDuration[512]; // Duration the keyboard key has been down (0.0f == just pressed)
- float KeysDownDurationPrev[512]; // Previous duration the key has been down
- float NavInputsDownDuration[ImGuiNavInput_COUNT];
- float NavInputsDownDurationPrev[ImGuiNavInput_COUNT];
- float PenPressure; // Touch/Pen pressure (0.0f to 1.0f, should be >0.0f only when MouseDown[0] == true). Helper storage currently unused by Dear ImGui.
- bool AppFocusLost;
- ImWchar16 InputQueueSurrogate; // For AddInputCharacterUTF16
- ImVector<ImWchar> InputQueueCharacters; // Queue of _characters_ input (obtained by platform backend). Fill using AddInputCharacter() helper.
+ // 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)
+ 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.
+ bool KeyCtrl; // Keyboard modifier down: Control
+ bool KeyShift; // Keyboard modifier down: Shift
+ bool KeyAlt; // Keyboard modifier down: Alt
+ 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()
+ 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)
+ ImVec2 MouseClickedPos[5]; // Position at time of clicking
+ double MouseClickedTime[5]; // Time of last click (used to figure out double-click)
+ bool MouseClicked[5]; // Mouse button went from !Down to Down (same as MouseClickedCount[x] != 0)
+ bool MouseDoubleClicked[5]; // Has mouse button been double-clicked? (same as MouseClickedCount[x] == 2)
+ ImU16 MouseClickedCount[5]; // == 0 (not clicked), == 1 (same as MouseClicked[]), == 2 (double-clicked), == 3 (triple-clicked) etc. when going from !Down to Down
+ ImU16 MouseClickedLastCount[5]; // Count successive number of clicks. Stays valid after mouse release. Reset after another click is done.
+ 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.
+ 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)
+ float PenPressure; // Touch/Pen pressure (0.0f to 1.0f, should be >0.0f only when MouseDown[0] == true). Helper storage currently unused by Dear ImGui.
+ bool AppFocusLost; // Only modify via AddFocusEvent()
+ bool AppAcceptingEvents; // Only modify via SetAppAcceptingEvents()
+ ImS8 BackendUsingLegacyKeyArrays; // -1: unknown, 0: using AddKeyEvent(), 1: using legacy io.KeysDown[]
+ bool BackendUsingLegacyNavInputArray; // 0: using AddKeyAnalogEvent(), 1: writing to legacy io.NavInputs[] directly
+ ImWchar16 InputQueueSurrogate; // For AddInputCharacterUTF16()
+ ImVector<ImWchar> InputQueueCharacters; // Queue of _characters_ input (obtained by platform backend). Fill using AddInputCharacter() helper.
IMGUI_API ImGuiIO();
};
@@ -1997,7 +2101,7 @@ struct ImGuiInputTextCallbackData
// NB: For basic min/max size constraint on each axis you don't need to use the callback! The SetNextWindowSizeConstraints() parameters are enough.
struct ImGuiSizeCallbackData
{
- void* UserData; // Read-only. What user passed to SetNextWindowSizeConstraints()
+ void* UserData; // Read-only. What user passed to SetNextWindowSizeConstraints(). Generally store an integer or float in here (need reinterpret_cast<>).
ImVec2 Pos; // Read-only. Window position, for reference.
ImVec2 CurrentSize; // Read-only. Current window size.
ImVec2 DesiredSize; // Read-write. Desired size, based on user's mouse position. Write to this field to restrain resizing.
@@ -2061,7 +2165,7 @@ struct ImGuiTableSortSpecs
#define IM_UNICODE_CODEPOINT_MAX 0xFFFF // Maximum Unicode code point supported by this build.
#endif
-// Helper: Execute a block of code at maximum once a frame. Convenient if you want to quickly create an UI within deep-nested code that runs multiple times every frame.
+// Helper: Execute a block of code at maximum once a frame. Convenient if you want to quickly create a UI within deep-nested code that runs multiple times every frame.
// Usage: static ImGuiOnceUponAFrame oaf; if (oaf) ImGui::Text("This will be called only once per frame");
struct ImGuiOnceUponAFrame
{
@@ -2169,10 +2273,12 @@ struct ImGuiStorage
};
// Helper: Manually clip large list of items.
-// If you are submitting lots of evenly spaced items and you have a random access to the list, you can perform coarse
-// clipping based on visibility to save yourself from processing those items at all.
+// If you have lots evenly spaced items and you have random access to the list, you can perform coarse
+// clipping based on visibility to only submit items that are in view.
// The clipper calculates the range of visible items and advance the cursor to compensate for the non-visible items we have skipped.
-// (Dear ImGui already clip items based on their bounds but it needs to measure text size to do so, whereas manual coarse clipping before submission makes this cost and your own data fetching/submission cost almost null)
+// (Dear ImGui already clip items based on their bounds but: it needs to first layout the item to do so, and generally
+// fetching/submitting your own data incurs additional cost. Coarse clipping using ImGuiListClipper allows you to easily
+// scale using lists with tens of thousands of items without a problem)
// Usage:
// ImGuiListClipper clipper;
// clipper.Begin(1000); // We have 1000 elements, evenly spaced.
@@ -2181,30 +2287,30 @@ struct ImGuiStorage
// ImGui::Text("line number %d", i);
// Generally what happens is:
// - Clipper lets you process the first element (DisplayStart = 0, DisplayEnd = 1) regardless of it being visible or not.
-// - User code submit one element.
+// - User code submit that one element.
// - Clipper can measure the height of the first element
// - Clipper calculate the actual range of elements to display based on the current clipping rectangle, position the cursor before the first visible element.
// - User code submit visible elements.
+// - The clipper also handles various subtleties related to keyboard/gamepad navigation, wrapping etc.
struct ImGuiListClipper
{
- int DisplayStart;
- int DisplayEnd;
-
- // [Internal]
- int ItemsCount;
- int StepNo;
- int ItemsFrozen;
- float ItemsHeight;
- float StartPosY;
+ 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
+ float ItemsHeight; // [Internal] Height of item after a first step and item submission can calculate it
+ float StartPosY; // [Internal] Cursor position at the time of Begin() or after table frozen rows are all processed
+ void* TempData; // [Internal] Internal data
+ // items_count: Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step)
+ // items_height: Use -1.0f to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing().
IMGUI_API ImGuiListClipper();
IMGUI_API ~ImGuiListClipper();
+ IMGUI_API void Begin(int items_count, float items_height = -1.0f);
+ IMGUI_API void End(); // Automatically called on the last call of Step() that returns false.
+ IMGUI_API bool Step(); // Call until it returns false. The DisplayStart/DisplayEnd fields will be set and you can process/draw those items.
- // items_count: Use INT_MAX if you don't know how many items you have (in which case the cursor won't be advanced in the final step)
- // items_height: Use -1.0f to be calculated automatically on first step. Otherwise pass in the distance between your items, typically GetTextLineHeightWithSpacing() or GetFrameHeightWithSpacing().
- IMGUI_API void Begin(int items_count, float items_height = -1.0f); // Automatically called by constructor if you passed 'items_count' or by Step() in Step 1.
- IMGUI_API void End(); // Automatically called on the last call of Step() that returns false.
- IMGUI_API bool Step(); // Call until it returns false. The DisplayStart/DisplayEnd fields will be set and you can process/draw those items.
+ // Call ForceDisplayRangeByIndices() before first call to Step() if you need a range of items to be displayed regardless of visibility.
+ IMGUI_API void ForceDisplayRangeByIndices(int item_min, int item_max); // item_max is exclusive e.g. use (42, 42+1) to make item 42 always visible BUT due to alignment/padding of certain items it is likely that an extra item may be included on either end of the display range.
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
inline ImGuiListClipper(int items_count, float items_height = -1.0f) { memset(this, 0, sizeof(*this)); ItemsCount = -1; Begin(items_count, items_height); } // [removed in 1.79]
@@ -2212,6 +2318,8 @@ struct ImGuiListClipper
};
// 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
#ifdef IMGUI_USE_BGRA_PACKED_COLOR
#define IM_COL32_R_SHIFT 16
#define IM_COL32_G_SHIFT 8
@@ -2225,6 +2333,7 @@ struct ImGuiListClipper
#define IM_COL32_A_SHIFT 24
#define IM_COL32_A_MASK 0xFF000000
#endif
+#endif
#define IM_COL32(R,G,B,A) (((ImU32)(A)<<IM_COL32_A_SHIFT) | ((ImU32)(B)<<IM_COL32_B_SHIFT) | ((ImU32)(G)<<IM_COL32_G_SHIFT) | ((ImU32)(R)<<IM_COL32_R_SHIFT))
#define IM_COL32_WHITE IM_COL32(255,255,255,255) // Opaque white = 0xFFFFFFFF
#define IM_COL32_BLACK IM_COL32(0,0,0,255) // Opaque black
@@ -2236,13 +2345,13 @@ struct ImGuiListClipper
// **None of the ImGui API are using ImColor directly but you can use it as a convenience to pass colors in either ImU32 or ImVec4 formats. Explicitly cast to ImU32 or ImVec4 if needed.
struct ImColor
{
- ImVec4 Value;
+ ImVec4 Value;
- ImColor() { Value.x = Value.y = Value.z = Value.w = 0.0f; }
+ constexpr ImColor() { }
+ constexpr ImColor(float r, float g, float b, float a = 1.0f) : Value(r, g, b, a) { }
+ constexpr ImColor(const ImVec4& col) : Value(col) {}
ImColor(int r, int g, int b, int a = 255) { float sc = 1.0f / 255.0f; Value.x = (float)r * sc; Value.y = (float)g * sc; Value.z = (float)b * sc; Value.w = (float)a * sc; }
ImColor(ImU32 rgba) { float sc = 1.0f / 255.0f; Value.x = (float)((rgba >> IM_COL32_R_SHIFT) & 0xFF) * sc; Value.y = (float)((rgba >> IM_COL32_G_SHIFT) & 0xFF) * sc; Value.z = (float)((rgba >> IM_COL32_B_SHIFT) & 0xFF) * sc; Value.w = (float)((rgba >> IM_COL32_A_SHIFT) & 0xFF) * sc; }
- ImColor(float r, float g, float b, float a = 1.0f) { Value.x = r; Value.y = g; Value.z = b; Value.w = a; }
- ImColor(const ImVec4& col) { Value = col; }
inline operator ImU32() const { return ImGui::ColorConvertFloat4ToU32(Value); }
inline operator ImVec4() const { return Value; }
@@ -2279,16 +2388,16 @@ typedef void (*ImDrawCallback)(const ImDrawList* parent_list, const ImDrawCmd* c
#define ImDrawCallback_ResetRenderState (ImDrawCallback)(-1)
// Typically, 1 command = 1 GPU draw call (unless command is a callback)
-// - VtxOffset/IdxOffset: When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset' is enabled,
-// those fields allow us to render meshes larger than 64K vertices while keeping 16-bit indices.
-// Pre-1.71 backends will typically ignore the VtxOffset/IdxOffset fields.
+// - VtxOffset: When 'io.BackendFlags & ImGuiBackendFlags_RendererHasVtxOffset' is enabled,
+// this fields allow us to render meshes larger than 64K vertices while keeping 16-bit indices.
+// Backends made for <1.71. will typically ignore the VtxOffset fields.
// - The ClipRect/TextureId/VtxOffset fields must be contiguous as we memcmp() them together (this is asserted for).
struct ImDrawCmd
{
ImVec4 ClipRect; // 4*4 // Clipping rectangle (x1, y1, x2, y2). Subtract ImDrawData->DisplayPos to get clipping rectangle in "viewport" coordinates
ImTextureID TextureId; // 4-8 // User-provided texture ID. Set by user in ImfontAtlas::SetTexID() for fonts or passed to Image*() functions. Ignore if never using images or multiple fonts atlas.
unsigned int VtxOffset; // 4 // Start offset in vertex buffer. ImGuiBackendFlags_RendererHasVtxOffset: always 0, otherwise may be >0 to support meshes larger than 64K vertices with 16-bit indices.
- unsigned int IdxOffset; // 4 // Start offset in index buffer. Always equal to sum of ElemCount drawn so far.
+ unsigned int IdxOffset; // 4 // Start offset in index buffer.
unsigned int ElemCount; // 4 // Number of indices (multiple of 3) to be rendered as triangles. Vertices are stored in the callee ImDrawList's vtx_buffer[] array, indices in idx_buffer[].
ImDrawCallback UserCallback; // 4-8 // If != NULL, call the function instead of rendering the vertices. clip_rect and texture_id will be set normally.
void* UserCallbackData; // 4-8 // The draw callback code can access this.
@@ -2310,7 +2419,7 @@ struct ImDrawVert
#else
// You can override the vertex format layout by defining IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT in imconfig.h
// The code expect ImVec2 pos (8 bytes), ImVec2 uv (8 bytes), ImU32 col (4 bytes), but you can re-order them or add other fields as needed to simplify integration in your engine.
-// The type has to be described within the macro (you can either declare the struct or use a typedef). This is because ImVec2/ImU32 are likely not declared a the time you'd want to set your type up.
+// The type has to be described within the macro (you can either declare the struct or use a typedef). This is because ImVec2/ImU32 are likely not declared at the time you'd want to set your type up.
// NOTE: IMGUI DOESN'T CLEAR THE STRUCTURE AND DOESN'T CALL A CONSTRUCTOR SO ANY CUSTOM FIELD WILL BE UNINITIALIZED. IF YOU ADD EXTRA FIELDS (SUCH AS A 'Z' COORDINATES) YOU WILL NEED TO CLEAR THEM DURING RENDER OR TO IGNORE THEM.
IMGUI_OVERRIDE_DRAWVERT_STRUCT_LAYOUT;
#endif
@@ -2365,7 +2474,7 @@ enum ImDrawFlags_
ImDrawFlags_RoundCornersRight = ImDrawFlags_RoundCornersBottomRight | ImDrawFlags_RoundCornersTopRight,
ImDrawFlags_RoundCornersAll = ImDrawFlags_RoundCornersTopLeft | ImDrawFlags_RoundCornersTopRight | ImDrawFlags_RoundCornersBottomLeft | ImDrawFlags_RoundCornersBottomRight,
ImDrawFlags_RoundCornersDefault_ = ImDrawFlags_RoundCornersAll, // Default to ALL corners if none of the _RoundCornersXX flags are specified.
- ImDrawFlags_RoundCornersMask_ = ImDrawFlags_RoundCornersAll | ImDrawFlags_RoundCornersNone
+ ImDrawFlags_RoundCornersMask_ = ImDrawFlags_RoundCornersAll | ImDrawFlags_RoundCornersNone,
};
// Flags for ImDrawList instance. Those are set automatically by ImGui:: functions from ImGuiIO settings, and generally not manipulated directly.
@@ -2374,9 +2483,9 @@ enum ImDrawListFlags_
{
ImDrawListFlags_None = 0,
ImDrawListFlags_AntiAliasedLines = 1 << 0, // Enable anti-aliased lines/borders (*2 the number of triangles for 1.0f wide line or lines thin enough to be drawn using textures, otherwise *3 the number of triangles)
- ImDrawListFlags_AntiAliasedLinesUseTex = 1 << 1, // Enable anti-aliased lines/borders using textures when possible. Require backend to render with bilinear filtering.
+ ImDrawListFlags_AntiAliasedLinesUseTex = 1 << 1, // Enable anti-aliased lines/borders using textures when possible. Require backend to render with bilinear filtering (NOT point/nearest filtering).
ImDrawListFlags_AntiAliasedFill = 1 << 2, // Enable anti-aliased edge around filled shapes (rounded rectangles, circles).
- ImDrawListFlags_AllowVtxOffset = 1 << 3 // Can emit 'VtxOffset > 0' to allow large meshes. Set when 'ImGuiBackendFlags_RendererHasVtxOffset' is enabled.
+ ImDrawListFlags_AllowVtxOffset = 1 << 3, // Can emit 'VtxOffset > 0' to allow large meshes. Set when 'ImGuiBackendFlags_RendererHasVtxOffset' is enabled.
};
// Draw command list
@@ -2398,7 +2507,7 @@ struct ImDrawList
// [Internal, used while building lists]
unsigned int _VtxCurrentIdx; // [Internal] generally == VtxBuffer.Size unless we are past 64K vertices, in which case this gets reset to 0.
- const ImDrawListSharedData* _Data; // Pointer to shared draw data (you can use ImGui::GetDrawListSharedData() to get the one from current ImGui context)
+ ImDrawListSharedData* _Data; // Pointer to shared draw data (you can use ImGui::GetDrawListSharedData() to get the one from current ImGui context)
const char* _OwnerName; // Pointer to owner window's name for debugging
ImDrawVert* _VtxWritePtr; // [Internal] point within VtxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
ImDrawIdx* _IdxWritePtr; // [Internal] point within IdxBuffer.Data after each add command (to avoid using the ImVector<> operators too much)
@@ -2410,10 +2519,10 @@ struct ImDrawList
float _FringeScale; // [Internal] anti-alias fringe is scaled by this value, this helps to keep things sharp while zooming at vertex buffer content
// If you want to create ImDrawList instances, pass them ImGui::GetDrawListSharedData() or create and use your own ImDrawListSharedData (so you can use ImDrawList without ImGui)
- ImDrawList(const ImDrawListSharedData* shared_data) { memset(this, 0, sizeof(*this)); _Data = shared_data; }
+ ImDrawList(ImDrawListSharedData* shared_data) { memset(this, 0, sizeof(*this)); _Data = shared_data; }
~ImDrawList() { _ClearFreeMemory(); }
- IMGUI_API void PushClipRect(ImVec2 clip_rect_min, ImVec2 clip_rect_max, bool intersect_with_current_clip_rect = false); // Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
+ IMGUI_API void PushClipRect(const ImVec2& clip_rect_min, const ImVec2& clip_rect_max, bool intersect_with_current_clip_rect = false); // Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
IMGUI_API void PushClipRectFullScreen();
IMGUI_API void PopClipRect();
IMGUI_API void PushTextureID(ImTextureID texture_id);
@@ -2422,11 +2531,12 @@ struct ImDrawList
inline ImVec2 GetClipRectMax() const { const ImVec4& cr = _ClipRectStack.back(); return ImVec2(cr.z, cr.w); }
// Primitives
+ // - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
// - For rectangular primitives, "p_min" and "p_max" represent the upper-left and lower-right corners.
// - For circle primitives, use "num_segments == 0" to automatically calculate tessellation (preferred).
// In older versions (until Dear ImGui 1.77) the AddCircle functions defaulted to num_segments == 12.
// In future versions we will use textures to provide cheaper and higher-quality circles.
- // Use AddNgon() and AddNgonFilled() functions if you need to guaranteed a specific number of sides.
+ // Use AddNgon() and AddNgonFilled() functions if you need to guarantee a specific number of sides.
IMGUI_API void AddLine(const ImVec2& p1, const ImVec2& p2, ImU32 col, float thickness = 1.0f);
IMGUI_API void AddRect(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawFlags flags = 0, float thickness = 1.0f); // a: upper-left, b: lower-right (== upper-left + size)
IMGUI_API void AddRectFilled(const ImVec2& p_min, const ImVec2& p_max, ImU32 col, float rounding = 0.0f, ImDrawFlags flags = 0); // a: upper-left, b: lower-right (== upper-left + size)
@@ -2442,7 +2552,7 @@ struct ImDrawList
IMGUI_API void AddText(const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL);
IMGUI_API void AddText(const ImFont* font, float font_size, const ImVec2& pos, ImU32 col, const char* text_begin, const char* text_end = NULL, float wrap_width = 0.0f, const ImVec4* cpu_fine_clip_rect = NULL);
IMGUI_API void AddPolyline(const ImVec2* points, int num_points, ImU32 col, ImDrawFlags flags, float thickness);
- IMGUI_API void AddConvexPolyFilled(const ImVec2* points, int num_points, ImU32 col); // Note: Anti-aliased filling requires points to be in clockwise order.
+ IMGUI_API void AddConvexPolyFilled(const ImVec2* points, int num_points, ImU32 col);
IMGUI_API void AddBezierCubic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, ImU32 col, float thickness, int num_segments = 0); // Cubic Bezier (4 control points)
IMGUI_API void AddBezierQuadratic(const ImVec2& p1, const ImVec2& p2, const ImVec2& p3, ImU32 col, float thickness, int num_segments = 0); // Quadratic Bezier (3 control points)
@@ -2455,10 +2565,11 @@ struct ImDrawList
IMGUI_API void AddImageRounded(ImTextureID user_texture_id, const ImVec2& p_min, const ImVec2& p_max, const ImVec2& uv_min, const ImVec2& uv_max, ImU32 col, float rounding, ImDrawFlags flags = 0);
// Stateful path API, add points then finish with PathFillConvex() or PathStroke()
+ // - Filled shapes must always use clockwise winding order. The anti-aliasing fringe depends on it. Counter-clockwise shapes will have "inward" anti-aliasing.
inline void PathClear() { _Path.Size = 0; }
inline void PathLineTo(const ImVec2& pos) { _Path.push_back(pos); }
inline void PathLineToMergeDuplicate(const ImVec2& pos) { if (_Path.Size == 0 || memcmp(&_Path.Data[_Path.Size - 1], &pos, 8) != 0) _Path.push_back(pos); }
- inline void PathFillConvex(ImU32 col) { AddConvexPolyFilled(_Path.Data, _Path.Size, col); _Path.Size = 0; } // Note: Anti-aliased filling requires points to be in clockwise order.
+ inline void PathFillConvex(ImU32 col) { AddConvexPolyFilled(_Path.Data, _Path.Size, col); _Path.Size = 0; }
inline void PathStroke(ImU32 col, ImDrawFlags flags = 0, float thickness = 1.0f) { AddPolyline(_Path.Data, _Path.Size, col, flags, thickness); _Path.Size = 0; }
IMGUI_API void PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments = 0);
IMGUI_API void PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12); // Use precomputed angles for a 12 steps circle
@@ -2494,8 +2605,8 @@ struct ImDrawList
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); }
- inline void PathBezierCurveTo(const ImVec2& p2, const ImVec2& p3, const ImVec2& p4, int num_segments = 0) { PathBezierCubicCurveTo(p2, p3, p4, num_segments); }
+ 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
// [Internal helpers]
@@ -2610,7 +2721,7 @@ enum ImFontAtlasFlags_
ImFontAtlasFlags_None = 0,
ImFontAtlasFlags_NoPowerOfTwoHeight = 1 << 0, // Don't round the height to next power of two
ImFontAtlasFlags_NoMouseCursors = 1 << 1, // Don't build software mouse cursors into the atlas (save a little texture memory)
- ImFontAtlasFlags_NoBakedLines = 1 << 2 // Don't build thick line textures into the atlas (save a little texture memory). The AntiAliasedLinesUseTex features uses them, otherwise they will be rendered using polygons (more expensive for CPU/GPU).
+ ImFontAtlasFlags_NoBakedLines = 1 << 2, // Don't build thick line textures into the atlas (save a little texture memory, allow support for point/nearest filtering). The AntiAliasedLinesUseTex features uses them, otherwise they will be rendered using polygons (more expensive for CPU/GPU).
};
// Load and rasterize multiple TTF/OTF fonts into a same texture. The font atlas will build a single texture holding:
@@ -2629,7 +2740,7 @@ enum ImFontAtlasFlags_
// - Important: By default, AddFontFromMemoryTTF() takes ownership of the data. Even though we are not writing to it, we will free the pointer on destruction.
// You can set font_cfg->FontDataOwnedByAtlas=false to keep ownership of your data and it won't be freed,
// - Even though many functions are suffixed with "TTF", OTF data is supported just as well.
-// - This is an old API and it is currently awkward for those and and various other reasons! We will address them in the future!
+// - This is an old API and it is currently awkward for those and various other reasons! We will address them in the future!
struct ImFontAtlas
{
IMGUI_API ImFontAtlas();
@@ -2653,7 +2764,7 @@ struct ImFontAtlas
IMGUI_API bool Build(); // Build pixels data. This is called automatically for you by the GetTexData*** functions.
IMGUI_API void GetTexDataAsAlpha8(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 1 byte per-pixel
IMGUI_API void GetTexDataAsRGBA32(unsigned char** out_pixels, int* out_width, int* out_height, int* out_bytes_per_pixel = NULL); // 4 bytes-per-pixel
- bool IsBuilt() const { return Fonts.Size > 0 && TexReady; } // Bit ambiguous: used to detect when user didn't built texture but effectively we should check TexID != 0 except that would be backend dependent...
+ bool IsBuilt() const { return Fonts.Size > 0 && TexReady; } // Bit ambiguous: used to detect when user didn't build texture but effectively we should check TexID != 0 except that would be backend dependent...
void SetTexID(ImTextureID id) { TexID = id; }
//-------------------------------------------
@@ -2664,6 +2775,7 @@ struct ImFontAtlas
// NB: Make sure that your string are UTF-8 and NOT in your local code page. In C++11, you can create UTF-8 string literal using the u8"Hello world" syntax. See FAQ for details.
// NB: Consider using ImFontGlyphRangesBuilder to build glyph ranges from textual data.
IMGUI_API const ImWchar* GetGlyphRangesDefault(); // Basic Latin, Extended Latin
+ IMGUI_API const ImWchar* GetGlyphRangesGreek(); // Default + Greek and Coptic
IMGUI_API const ImWchar* GetGlyphRangesKorean(); // Default + Korean characters
IMGUI_API const ImWchar* GetGlyphRangesJapanese(); // Default + Hiragana, Katakana, Half-Width, Selection of 2999 Ideographs
IMGUI_API const ImWchar* GetGlyphRangesChineseFull(); // Default + Half-Width + Japanese Hiragana/Katakana + full set of about 21000 CJK Unified Ideographs
@@ -2698,7 +2810,7 @@ struct ImFontAtlas
ImFontAtlasFlags Flags; // Build flags (see ImFontAtlasFlags_)
ImTextureID TexID; // User data to refer to the texture once it has been uploaded to user's graphic systems. It is passed back to you during rendering via the ImDrawCmd structure.
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.
+ 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.
// [Internal]
@@ -2724,10 +2836,9 @@ struct ImFontAtlas
int PackIdMouseCursors; // Custom texture rectangle ID for white pixel and mouse cursors
int PackIdLines; // Custom texture rectangle ID for baked anti-aliased lines
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- typedef ImFontAtlasCustomRect CustomRect; // OBSOLETED in 1.72+
+ // [Obsolete]
+ //typedef ImFontAtlasCustomRect CustomRect; // OBSOLETED in 1.72+
//typedef ImFontGlyphRangesBuilder GlyphRangesBuilder; // OBSOLETED in 1.67+
-#endif
};
// Font runtime data and rendering
@@ -2770,8 +2881,8 @@ struct ImFont
// 'wrap_width' enable automatic word-wrapping across multiple lines to fit into given width. 0.0f to disable.
IMGUI_API ImVec2 CalcTextSizeA(float size, float max_width, float wrap_width, const char* text_begin, const char* text_end = NULL, const char** remaining = NULL) const; // utf8
IMGUI_API const char* CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const;
- IMGUI_API void RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, ImWchar c) const;
- IMGUI_API void RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width = 0.0f, bool cpu_fine_clip = false) const;
+ IMGUI_API void RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, ImWchar c) const;
+ IMGUI_API void RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width = 0.0f, bool cpu_fine_clip = false) const;
// [Internal] Don't use!
IMGUI_API void BuildLookupTable();
@@ -2793,7 +2904,7 @@ enum ImGuiViewportFlags_
ImGuiViewportFlags_None = 0,
ImGuiViewportFlags_IsPlatformWindow = 1 << 0, // Represent a Platform Window
ImGuiViewportFlags_IsPlatformMonitor = 1 << 1, // Represent a Platform Monitor (unused yet)
- ImGuiViewportFlags_OwnedByApp = 1 << 2 // Platform Window: is created/managed by the application (rather than a dear imgui backend)
+ ImGuiViewportFlags_OwnedByApp = 1 << 2, // Platform Window: is created/managed by the application (rather than a dear imgui backend)
};
// - Currently represents the Platform Window created by the application which is hosting our Dear ImGui windows.
@@ -2811,6 +2922,9 @@ struct ImGuiViewport
ImVec2 WorkPos; // Work Area: Position of the viewport minus task bars, menus bars, status bars (>= Pos)
ImVec2 WorkSize; // Work Area: Size of the viewport minus task bars, menu bars, status bars (<= Size)
+ // Platform/Backend Dependent Data
+ void* PlatformHandleRaw; // void* to hold lower-level, platform-native window handle (under Win32 this is expected to be a HWND, unused for other platforms)
+
ImGuiViewport() { memset(this, 0, sizeof(*this)); }
// Helpers
@@ -2819,57 +2933,96 @@ struct ImGuiViewport
};
//-----------------------------------------------------------------------------
+// [SECTION] Platform Dependent Interfaces
+//-----------------------------------------------------------------------------
+
+// (Optional) Support for IME (Input Method Editor) via the io.SetPlatformImeDataFn() function.
+struct ImGuiPlatformImeData
+{
+ bool WantVisible; // A widget wants the IME to be visible
+ ImVec2 InputPos; // Position of the input cursor
+ float InputLineHeight; // Line height
+
+ ImGuiPlatformImeData() { memset(this, 0, sizeof(*this)); }
+};
+
+//-----------------------------------------------------------------------------
// [SECTION] Obsolete functions and types
// (Will be removed! Read 'API BREAKING CHANGES' section in imgui.cpp for details)
// Please keep your copy of dear imgui up to date! Occasionally set '#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS' in imconfig.h to stay ahead.
//-----------------------------------------------------------------------------
+namespace ImGui
+{
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
+ IMGUI_API ImGuiKey GetKeyIndex(ImGuiKey key); // map ImGuiKey_* values into legacy native key index. == io.KeyMap[key]
+#else
+ static inline ImGuiKey GetKeyIndex(ImGuiKey key) { IM_ASSERT(key >= ImGuiKey_NamedKey_BEGIN && key < ImGuiKey_NamedKey_END && "ImGuiKey and native_index was merged together and native_index is disabled by IMGUI_DISABLE_OBSOLETE_KEYIO. Please switch to ImGuiKey."); return key; }
+#endif
+}
+
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
namespace ImGui
{
+ // 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)
+ static inline void CaptureKeyboardFromApp(bool want_capture_keyboard = true) { SetNextFrameWantCaptureKeyboard(want_capture_keyboard); } // Renamed as name was misleading + removed default value.
+ static inline void CaptureMouseFromApp(bool want_capture_mouse = true) { SetNextFrameWantCaptureMouse(want_capture_mouse); } // Renamed as name was misleading + removed default value.
+ // OBSOLETED in 1.86 (from November 2021)
+ IMGUI_API void CalcListClipping(int items_count, float items_height, int* out_items_display_start, int* out_items_display_end); // Calculate coarse clipping for large list of evenly sized items. Prefer using ImGuiListClipper.
// OBSOLETED in 1.85 (from August 2021)
- static inline float GetWindowContentRegionWidth() { return GetWindowContentRegionMax().x - GetWindowContentRegionMin().x; }
+ static inline float GetWindowContentRegionWidth() { return GetWindowContentRegionMax().x - GetWindowContentRegionMin().x; }
// OBSOLETED in 1.81 (from February 2021)
IMGUI_API bool ListBoxHeader(const char* label, int items_count, int height_in_items = -1); // Helper to calculate size from items_count and height_in_items
static inline bool ListBoxHeader(const char* label, const ImVec2& size = ImVec2(0, 0)) { return BeginListBox(label, size); }
- static inline void ListBoxFooter() { EndListBox(); }
- // OBSOLETED in 1.79 (from August 2020)
- static inline void OpenPopupContextItem(const char* str_id = NULL, ImGuiMouseButton mb = 1) { OpenPopupOnItemClick(str_id, mb); } // Bool return value removed. Use IsWindowAppearing() in BeginPopup() instead. Renamed in 1.77, renamed back in 1.79. Sorry!
- // OBSOLETED in 1.78 (from June 2020)
- // Old drag/sliders functions that took a 'float power = 1.0' argument instead of flags.
- // For shared code, you can version check at compile-time with `#if IMGUI_VERSION_NUM >= 17704`.
- IMGUI_API bool DragScalar(const char* label, ImGuiDataType data_type, void* p_data, float v_speed, const void* p_min, const void* p_max, const char* format, float power);
- IMGUI_API bool DragScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, float v_speed, const void* p_min, const void* p_max, const char* format, float power);
- static inline bool DragFloat(const char* label, float* v, float v_speed, float v_min, float v_max, const char* format, float power) { return DragScalar(label, ImGuiDataType_Float, v, v_speed, &v_min, &v_max, format, power); }
- static inline bool DragFloat2(const char* label, float v[2], float v_speed, float v_min, float v_max, const char* format, float power) { return DragScalarN(label, ImGuiDataType_Float, v, 2, v_speed, &v_min, &v_max, format, power); }
- static inline bool DragFloat3(const char* label, float v[3], float v_speed, float v_min, float v_max, const char* format, float power) { return DragScalarN(label, ImGuiDataType_Float, v, 3, v_speed, &v_min, &v_max, format, power); }
- static inline bool DragFloat4(const char* label, float v[4], float v_speed, float v_min, float v_max, const char* format, float power) { return DragScalarN(label, ImGuiDataType_Float, v, 4, v_speed, &v_min, &v_max, format, power); }
- IMGUI_API bool SliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format, float power);
- IMGUI_API bool SliderScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, const void* p_min, const void* p_max, const char* format, float power);
- static inline bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* format, float power) { return SliderScalar(label, ImGuiDataType_Float, v, &v_min, &v_max, format, power); }
- static inline bool SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* format, float power) { return SliderScalarN(label, ImGuiDataType_Float, v, 2, &v_min, &v_max, format, power); }
- static inline bool SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* format, float power) { return SliderScalarN(label, ImGuiDataType_Float, v, 3, &v_min, &v_max, format, power); }
- static inline bool SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* format, float power) { return SliderScalarN(label, ImGuiDataType_Float, v, 4, &v_min, &v_max, format, power); }
- // OBSOLETED in 1.77 (from June 2020)
- static inline bool BeginPopupContextWindow(const char* str_id, ImGuiMouseButton mb, bool over_items) { return BeginPopupContextWindow(str_id, mb | (over_items ? 0 : ImGuiPopupFlags_NoOpenOverItems)); }
- // OBSOLETED in 1.72 (from April 2019)
- static inline void TreeAdvanceToLabelPos() { SetCursorPosX(GetCursorPosX() + GetTreeNodeToLabelSpacing()); }
- // OBSOLETED in 1.71 (from June 2019)
- static inline void SetNextTreeNodeOpen(bool open, ImGuiCond cond = 0) { SetNextItemOpen(open, cond); }
- // OBSOLETED in 1.70 (from May 2019)
- static inline float GetContentRegionAvailWidth() { return GetContentRegionAvail().x; }
+ static inline void ListBoxFooter() { EndListBox(); }
// Some of the older obsolete names along with their replacement (commented out so they are not reported in IDE)
- //static inline ImDrawList* GetOverlayDrawList() { return GetForegroundDrawList(); } // OBSOLETED in 1.69 (from Mar 2019)
- //static inline void SetScrollHere(float ratio = 0.5f) { SetScrollHereY(ratio); } // OBSOLETED in 1.66 (from Nov 2018)
- //static inline bool IsItemDeactivatedAfterChange() { return IsItemDeactivatedAfterEdit(); } // OBSOLETED in 1.63 (from Aug 2018)
- //static inline bool IsAnyWindowFocused() { return IsWindowFocused(ImGuiFocusedFlags_AnyWindow); } // OBSOLETED in 1.60 (from Apr 2018)
- //static inline bool IsAnyWindowHovered() { return IsWindowHovered(ImGuiHoveredFlags_AnyWindow); } // OBSOLETED in 1.60 (between Dec 2017 and Apr 2018)
- //static inline void ShowTestWindow() { return ShowDemoWindow(); } // OBSOLETED in 1.53 (between Oct 2017 and Dec 2017)
- //static inline bool IsRootWindowFocused() { return IsWindowFocused(ImGuiFocusedFlags_RootWindow); } // OBSOLETED in 1.53 (between Oct 2017 and Dec 2017)
- //static inline bool IsRootWindowOrAnyChildFocused() { return IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows); } // OBSOLETED in 1.53 (between Oct 2017 and Dec 2017)
- //static inline void SetNextWindowContentWidth(float w) { SetNextWindowContentSize(ImVec2(w, 0.0f)); } // OBSOLETED in 1.53 (between Oct 2017 and Dec 2017)
- //static inline float GetItemsLineHeightWithSpacing() { return GetFrameHeightWithSpacing(); } // OBSOLETED in 1.53 (between Oct 2017 and Dec 2017)
+ //-- OBSOLETED in 1.79 (from August 2020)
+ //static inline void OpenPopupContextItem(const char* str_id = NULL, ImGuiMouseButton mb = 1) { OpenPopupOnItemClick(str_id, mb); } // Bool return value removed. Use IsWindowAppearing() in BeginPopup() instead. Renamed in 1.77, renamed back in 1.79. Sorry!
+ //-- OBSOLETED in 1.78 (from June 2020): Old drag/sliders functions that took a 'float power > 1.0f' argument instead of ImGuiSliderFlags_Logarithmic. See github.com/ocornut/imgui/issues/3361 for details.
+ //IMGUI_API bool DragScalar(const char* label, ImGuiDataType data_type, void* p_data, float v_speed, const void* p_min, const void* p_max, const char* format, float power = 1.0f) // OBSOLETED in 1.78 (from June 2020)
+ //IMGUI_API bool DragScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, float v_speed, const void* p_min, const void* p_max, const char* format, float power = 1.0f); // OBSOLETED in 1.78 (from June 2020)
+ //IMGUI_API bool SliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format, float power = 1.0f); // OBSOLETED in 1.78 (from June 2020)
+ //IMGUI_API bool SliderScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, const void* p_min, const void* p_max, const char* format, float power = 1.0f); // OBSOLETED in 1.78 (from June 2020)
+ //static inline bool DragFloat(const char* label, float* v, float v_speed, float v_min, float v_max, const char* format, float power = 1.0f) { return DragScalar(label, ImGuiDataType_Float, v, v_speed, &v_min, &v_max, format, power); } // OBSOLETED in 1.78 (from June 2020)
+ //static inline bool DragFloat2(const char* label, float v[2], float v_speed, float v_min, float v_max, const char* format, float power = 1.0f) { return DragScalarN(label, ImGuiDataType_Float, v, 2, v_speed, &v_min, &v_max, format, power); } // OBSOLETED in 1.78 (from June 2020)
+ //static inline bool DragFloat3(const char* label, float v[3], float v_speed, float v_min, float v_max, const char* format, float power = 1.0f) { return DragScalarN(label, ImGuiDataType_Float, v, 3, v_speed, &v_min, &v_max, format, power); } // OBSOLETED in 1.78 (from June 2020)
+ //static inline bool DragFloat4(const char* label, float v[4], float v_speed, float v_min, float v_max, const char* format, float power = 1.0f) { return DragScalarN(label, ImGuiDataType_Float, v, 4, v_speed, &v_min, &v_max, format, power); } // OBSOLETED in 1.78 (from June 2020)
+ //static inline bool SliderFloat(const char* label, float* v, float v_min, float v_max, const char* format, float power = 1.0f) { return SliderScalar(label, ImGuiDataType_Float, v, &v_min, &v_max, format, power); } // OBSOLETED in 1.78 (from June 2020)
+ //static inline bool SliderFloat2(const char* label, float v[2], float v_min, float v_max, const char* format, float power = 1.0f) { return SliderScalarN(label, ImGuiDataType_Float, v, 2, &v_min, &v_max, format, power); } // OBSOLETED in 1.78 (from June 2020)
+ //static inline bool SliderFloat3(const char* label, float v[3], float v_min, float v_max, const char* format, float power = 1.0f) { return SliderScalarN(label, ImGuiDataType_Float, v, 3, &v_min, &v_max, format, power); } // OBSOLETED in 1.78 (from June 2020)
+ //static inline bool SliderFloat4(const char* label, float v[4], float v_min, float v_max, const char* format, float power = 1.0f) { return SliderScalarN(label, ImGuiDataType_Float, v, 4, &v_min, &v_max, format, power); } // OBSOLETED in 1.78 (from June 2020)
+ //-- OBSOLETED in 1.77 and before
+ //static inline bool BeginPopupContextWindow(const char* str_id, ImGuiMouseButton mb, bool over_items) { return BeginPopupContextWindow(str_id, mb | (over_items ? 0 : ImGuiPopupFlags_NoOpenOverItems)); } // OBSOLETED in 1.77 (from June 2020)
+ //static inline void TreeAdvanceToLabelPos() { SetCursorPosX(GetCursorPosX() + GetTreeNodeToLabelSpacing()); } // OBSOLETED in 1.72 (from July 2019)
+ //static inline void SetNextTreeNodeOpen(bool open, ImGuiCond cond = 0) { SetNextItemOpen(open, cond); } // OBSOLETED in 1.71 (from June 2019)
+ //static inline float GetContentRegionAvailWidth() { return GetContentRegionAvail().x; } // OBSOLETED in 1.70 (from May 2019)
+ //static inline ImDrawList* GetOverlayDrawList() { return GetForegroundDrawList(); } // OBSOLETED in 1.69 (from Mar 2019)
+ //static inline void SetScrollHere(float ratio = 0.5f) { SetScrollHereY(ratio); } // OBSOLETED in 1.66 (from Nov 2018)
+ //static inline bool IsItemDeactivatedAfterChange() { return IsItemDeactivatedAfterEdit(); } // OBSOLETED in 1.63 (from Aug 2018)
+ //-- OBSOLETED in 1.60 and before
+ //static inline bool IsAnyWindowFocused() { return IsWindowFocused(ImGuiFocusedFlags_AnyWindow); } // OBSOLETED in 1.60 (from Apr 2018)
+ //static inline bool IsAnyWindowHovered() { return IsWindowHovered(ImGuiHoveredFlags_AnyWindow); } // OBSOLETED in 1.60 (between Dec 2017 and Apr 2018)
+ //static inline void ShowTestWindow() { return ShowDemoWindow(); } // OBSOLETED in 1.53 (between Oct 2017 and Dec 2017)
+ //static inline bool IsRootWindowFocused() { return IsWindowFocused(ImGuiFocusedFlags_RootWindow); } // OBSOLETED in 1.53 (between Oct 2017 and Dec 2017)
+ //static inline bool IsRootWindowOrAnyChildFocused() { return IsWindowFocused(ImGuiFocusedFlags_RootAndChildWindows); } // OBSOLETED in 1.53 (between Oct 2017 and Dec 2017)
+ //static inline void SetNextWindowContentWidth(float w) { SetNextWindowContentSize(ImVec2(w, 0.0f)); } // OBSOLETED in 1.53 (between Oct 2017 and Dec 2017)
+ //static inline float GetItemsLineHeightWithSpacing() { return GetFrameHeightWithSpacing(); } // OBSOLETED in 1.53 (between Oct 2017 and Dec 2017)
+ //IMGUI_API bool Begin(char* name, bool* p_open, ImVec2 size_first_use, float bg_alpha = -1.0f, ImGuiWindowFlags flags=0); // OBSOLETED in 1.52 (between Aug 2017 and Oct 2017): Equivalent of using SetNextWindowSize(size, ImGuiCond_FirstUseEver) and SetNextWindowBgAlpha().
+ //static inline bool IsRootWindowOrAnyChildHovered() { return IsWindowHovered(ImGuiHoveredFlags_RootAndChildWindows); } // OBSOLETED in 1.52 (between Aug 2017 and Oct 2017)
+ //static inline void AlignFirstTextHeightToWidgets() { AlignTextToFramePadding(); } // OBSOLETED in 1.52 (between Aug 2017 and Oct 2017)
+ //static inline void SetNextWindowPosCenter(ImGuiCond c=0) { SetNextWindowPos(GetMainViewport()->GetCenter(), c, ImVec2(0.5f,0.5f)); } // OBSOLETED in 1.52 (between Aug 2017 and Oct 2017)
+ //static inline bool IsItemHoveredRect() { return IsItemHovered(ImGuiHoveredFlags_RectOnly); } // OBSOLETED in 1.51 (between Jun 2017 and Aug 2017)
+ //static inline bool IsPosHoveringAnyWindow(const ImVec2&) { IM_ASSERT(0); return false; } // OBSOLETED in 1.51 (between Jun 2017 and Aug 2017): This was misleading and partly broken. You probably want to use the io.WantCaptureMouse flag instead.
+ //static inline bool IsMouseHoveringAnyWindow() { return IsWindowHovered(ImGuiHoveredFlags_AnyWindow); } // OBSOLETED in 1.51 (between Jun 2017 and Aug 2017)
+ //static inline bool IsMouseHoveringWindow() { return IsWindowHovered(ImGuiHoveredFlags_AllowWhenBlockedByPopup | ImGuiHoveredFlags_AllowWhenBlockedByActiveItem); } // OBSOLETED in 1.51 (between Jun 2017 and Aug 2017)
+ //-- OBSOLETED in 1.50 and before
+ //static inline bool CollapsingHeader(char* label, const char* str_id, bool framed = true, bool default_open = false) { return CollapsingHeader(label, (default_open ? (1 << 5) : 0)); } // OBSOLETED in 1.49
+ //static inline ImFont*GetWindowFont() { return GetFont(); } // OBSOLETED in 1.48
+ //static inline float GetWindowFontSize() { return GetFontSize(); } // OBSOLETED in 1.48
+ //static inline void SetScrollPosHere() { SetScrollHere(); } // OBSOLETED in 1.42
}
// OBSOLETED in 1.82 (from Mars 2021): flags for AddRect(), AddRectFilled(), AddImageRounded(), PathRect()
@@ -2885,11 +3038,26 @@ enum ImDrawCornerFlags_
ImDrawCornerFlags_Top = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_TopRight,
ImDrawCornerFlags_Bot = ImDrawCornerFlags_BotLeft | ImDrawCornerFlags_BotRight,
ImDrawCornerFlags_Left = ImDrawCornerFlags_TopLeft | ImDrawCornerFlags_BotLeft,
- ImDrawCornerFlags_Right = ImDrawCornerFlags_TopRight | ImDrawCornerFlags_BotRight
+ ImDrawCornerFlags_Right = ImDrawCornerFlags_TopRight | ImDrawCornerFlags_BotRight,
};
+// RENAMED and MERGED both ImGuiKey_ModXXX and ImGuiModFlags_XXX into ImGuiMod_XXX (from September 2022)
+// RENAMED ImGuiKeyModFlags -> ImGuiModFlags in 1.88 (from April 2022). Exceptionally commented out ahead of obscolescence schedule to reduce confusion and because they were not meant to be used in the first place.
+typedef ImGuiKeyChord ImGuiModFlags; // == int. We generally use ImGuiKeyChord to mean "a ImGuiKey or-ed with any number of ImGuiMod_XXX value", but you may store only mods in there.
+enum ImGuiModFlags_ { ImGuiModFlags_None = 0, ImGuiModFlags_Ctrl = ImGuiMod_Ctrl, ImGuiModFlags_Shift = ImGuiMod_Shift, ImGuiModFlags_Alt = ImGuiMod_Alt, ImGuiModFlags_Super = ImGuiMod_Super };
+//typedef ImGuiKeyChord ImGuiKeyModFlags; // == int
+//enum ImGuiKeyModFlags_ { ImGuiKeyModFlags_None = 0, ImGuiKeyModFlags_Ctrl = ImGuiMod_Ctrl, ImGuiKeyModFlags_Shift = ImGuiMod_Shift, ImGuiKeyModFlags_Alt = ImGuiMod_Alt, ImGuiKeyModFlags_Super = ImGuiMod_Super };
+
#endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+// RENAMED IMGUI_DISABLE_METRICS_WINDOW > IMGUI_DISABLE_DEBUG_TOOLS in 1.88 (from June 2022)
+#if defined(IMGUI_DISABLE_METRICS_WINDOW) && !defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS) && !defined(IMGUI_DISABLE_DEBUG_TOOLS)
+#define IMGUI_DISABLE_DEBUG_TOOLS
+#endif
+#if defined(IMGUI_DISABLE_METRICS_WINDOW) && defined(IMGUI_DISABLE_OBSOLETE_FUNCTIONS)
+#error IMGUI_DISABLE_METRICS_WINDOW was renamed to IMGUI_DISABLE_DEBUG_TOOLS, please use new name.
+#endif
+
//-----------------------------------------------------------------------------
#if defined(__clang__)
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp
index febca565f28..56058693377 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_demo.cpp
@@ -1,4 +1,4 @@
-// dear imgui, v1.85 WIP
+// dear imgui, v1.89.1 WIP
// (demo code)
// Help:
@@ -8,11 +8,15 @@
// Read imgui.cpp for more details, documentation and comments.
// Get the latest version at https://github.com/ocornut/imgui
+// -------------------------------------------------
+// PLEASE DO NOT REMOVE THIS FILE FROM YOUR PROJECT!
+// -------------------------------------------------
// Message to the person tempted to delete this file when integrating Dear ImGui into their codebase:
-// Do NOT remove this file from your project! Think again! It is the most useful reference code that you and other
-// coders will want to refer to and call. Have the ImGui::ShowDemoWindow() function wired in an always-available
-// debug menu of your game/app! Removing this file from your project is hindering access to documentation for everyone
-// in your team, likely leading you to poorer usage of the library.
+// Think again! It is the most useful reference code that you and other coders will want to refer to and call.
+// Have the ImGui::ShowDemoWindow() function wired in an always-available debug menu of your game/app!
+// Also include Metrics! ItemPicker! DebugLog! and other debug features.
+// Removing this file from your project is hindering access to documentation for everyone in your team,
+// likely leading you to poorer usage of the library.
// Everything in this file will be stripped out by the linker if you don't call ImGui::ShowDemoWindow().
// If you want to link core Dear ImGui in your shipped builds but want a thorough guarantee that the demo will not be
// linked, you can setup your imconfig.h with #define IMGUI_DISABLE_DEMO_WINDOWS and those functions will be empty.
@@ -39,22 +43,25 @@
// Because we can't assume anything about your support of maths operators, we cannot use them in imgui_demo.cpp.
// Navigating this file:
-// - In Visual Studio IDE: CTRL+comma ("Edit.NavigateTo") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
+// - 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.
/*
Index of this file:
-// [SECTION] Forward Declarations, Helpers
+// [SECTION] Forward Declarations
+// [SECTION] Helpers
// [SECTION] Demo Window / ShowDemoWindow()
+// - ShowDemoWindow()
// - sub section: ShowDemoWindowWidgets()
// - sub section: ShowDemoWindowLayout()
// - sub section: ShowDemoWindowPopups()
// - sub section: ShowDemoWindowTables()
-// - sub section: ShowDemoWindowMisc()
+// - sub section: ShowDemoWindowInputs()
// [SECTION] About Window / ShowAboutWindow()
// [SECTION] Style Editor / ShowStyleEditor()
+// [SECTION] User Guide / ShowUserGuide()
// [SECTION] Example App: Main Menu Bar / ShowExampleAppMainMenuBar()
// [SECTION] Example App: Debug Console / ShowExampleAppConsole()
// [SECTION] Example App: Debug Log / ShowExampleAppLog()
@@ -92,8 +99,9 @@ Index of this file:
// Visual Studio warnings
#ifdef _MSC_VER
+#pragma warning (disable: 4127) // condition expression is constant
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
-#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
+#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to an 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
#endif
// Clang/GCC warnings with -Weverything
@@ -185,12 +193,25 @@ static void ShowExampleAppWindowTitles(bool* p_open);
static void ShowExampleAppCustomRendering(bool* p_open);
static void ShowExampleMenuFile();
+// We split the contents of the big ShowDemoWindow() function into smaller functions
+// (because the link time of very large functions grow non-linearly)
+static void ShowDemoWindowWidgets();
+static void ShowDemoWindowLayout();
+static void ShowDemoWindowPopups();
+static void ShowDemoWindowTables();
+static void ShowDemoWindowColumns();
+static void ShowDemoWindowInputs();
+
+//-----------------------------------------------------------------------------
+// [SECTION] Helpers
+//-----------------------------------------------------------------------------
+
// Helper to display a little (?) mark which shows a tooltip when hovered.
// In your own code you may want to display an actual icon if you are using a merged icon fonts (see docs/FONTS.md)
static void HelpMarker(const char* desc)
{
ImGui::TextDisabled("(?)");
- if (ImGui::IsItemHovered())
+ if (ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort))
{
ImGui::BeginTooltip();
ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
@@ -200,71 +221,38 @@ static void HelpMarker(const char* desc)
}
}
-// Helper to display basic user controls.
-void ImGui::ShowUserGuide()
-{
- ImGuiIO& io = ImGui::GetIO();
- ImGui::BulletText("Double-click on title bar to collapse window.");
- ImGui::BulletText(
- "Click and drag on lower corner to resize window\n"
- "(double-click to auto fit window to its contents).");
- ImGui::BulletText("CTRL+Click on a slider or drag box to input value as text.");
- ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields.");
- if (io.FontAllowUserScaling)
- ImGui::BulletText("CTRL+Mouse Wheel to zoom window contents.");
- ImGui::BulletText("While inputing text:\n");
- ImGui::Indent();
- ImGui::BulletText("CTRL+Left/Right to word jump.");
- ImGui::BulletText("CTRL+A or double-click to select all.");
- ImGui::BulletText("CTRL+X/C/V to use clipboard cut/copy/paste.");
- ImGui::BulletText("CTRL+Z,CTRL+Y to undo/redo.");
- ImGui::BulletText("ESCAPE to revert.");
- ImGui::BulletText("You can apply arithmetic operators +,*,/ on numerical values.\nUse +- to subtract.");
- ImGui::Unindent();
- ImGui::BulletText("With keyboard navigation enabled:");
- ImGui::Indent();
- ImGui::BulletText("Arrow keys to navigate.");
- ImGui::BulletText("Space to activate a widget.");
- ImGui::BulletText("Return to input text into a widget.");
- ImGui::BulletText("Escape to deactivate a widget, close popup, exit child window.");
- ImGui::BulletText("Alt to jump to the menu layer of a window.");
- ImGui::BulletText("CTRL+Tab to select a window.");
- ImGui::Unindent();
-}
+// Helper to wire demo markers located in code to an interactive browser
+typedef void (*ImGuiDemoMarkerCallback)(const char* file, int line, const char* section, void* user_data);
+extern ImGuiDemoMarkerCallback GImGuiDemoMarkerCallback;
+extern void* GImGuiDemoMarkerCallbackUserData;
+ImGuiDemoMarkerCallback GImGuiDemoMarkerCallback = NULL;
+void* GImGuiDemoMarkerCallbackUserData = NULL;
+#define IMGUI_DEMO_MARKER(section) do { if (GImGuiDemoMarkerCallback != NULL) GImGuiDemoMarkerCallback(__FILE__, __LINE__, section, GImGuiDemoMarkerCallbackUserData); } while (0)
//-----------------------------------------------------------------------------
// [SECTION] Demo Window / ShowDemoWindow()
//-----------------------------------------------------------------------------
+// - ShowDemoWindow()
// - ShowDemoWindowWidgets()
// - ShowDemoWindowLayout()
// - ShowDemoWindowPopups()
// - ShowDemoWindowTables()
// - ShowDemoWindowColumns()
-// - ShowDemoWindowMisc()
+// - ShowDemoWindowInputs()
//-----------------------------------------------------------------------------
-// We split the contents of the big ShowDemoWindow() function into smaller functions
-// (because the link time of very large functions grow non-linearly)
-static void ShowDemoWindowWidgets();
-static void ShowDemoWindowLayout();
-static void ShowDemoWindowPopups();
-static void ShowDemoWindowTables();
-static void ShowDemoWindowColumns();
-static void ShowDemoWindowMisc();
-
// Demonstrate most Dear ImGui features (this is big function!)
// You may execute this function to experiment with the UI and understand what it does.
// You may then search for keywords in the code when you are interested by a specific feature.
void ImGui::ShowDemoWindow(bool* p_open)
{
// Exceptionally add an extra assert here for people confused about initial Dear ImGui setup
- // Most ImGui functions would normally just crash if the context is missing.
+ // Most functions would normally just crash if the context is missing.
IM_ASSERT(ImGui::GetCurrentContext() != NULL && "Missing dear imgui context. Refer to examples app!");
// Examples Apps (accessible from the "Examples" menu)
static bool show_app_main_menu_bar = false;
static bool show_app_documents = false;
-
static bool show_app_console = false;
static bool show_app_log = false;
static bool show_app_layout = false;
@@ -279,7 +267,6 @@ void ImGui::ShowDemoWindow(bool* p_open)
if (show_app_main_menu_bar) ShowExampleAppMainMenuBar();
if (show_app_documents) ShowExampleAppDocuments(&show_app_documents);
-
if (show_app_console) ShowExampleAppConsole(&show_app_console);
if (show_app_log) ShowExampleAppLog(&show_app_log);
if (show_app_layout) ShowExampleAppLayout(&show_app_layout);
@@ -292,13 +279,21 @@ void ImGui::ShowDemoWindow(bool* p_open)
if (show_app_window_titles) ShowExampleAppWindowTitles(&show_app_window_titles);
if (show_app_custom_rendering) ShowExampleAppCustomRendering(&show_app_custom_rendering);
- // Dear ImGui Apps (accessible from the "Tools" menu)
+ // Dear ImGui Tools/Apps (accessible from the "Tools" menu)
static bool show_app_metrics = false;
- static bool show_app_style_editor = false;
+ static bool show_app_debug_log = false;
+ static bool show_app_stack_tool = false;
static bool show_app_about = false;
+ static bool show_app_style_editor = false;
- if (show_app_metrics) { ImGui::ShowMetricsWindow(&show_app_metrics); }
- if (show_app_about) { ImGui::ShowAboutWindow(&show_app_about); }
+ if (show_app_metrics)
+ ImGui::ShowMetricsWindow(&show_app_metrics);
+ if (show_app_debug_log)
+ ImGui::ShowDebugLogWindow(&show_app_debug_log);
+ if (show_app_stack_tool)
+ ImGui::ShowStackToolWindow(&show_app_stack_tool);
+ if (show_app_about)
+ ImGui::ShowAboutWindow(&show_app_about);
if (show_app_style_editor)
{
ImGui::Begin("Dear ImGui Style Editor", &show_app_style_editor);
@@ -347,10 +342,8 @@ void ImGui::ShowDemoWindow(bool* p_open)
}
// Most "big" widgets share a common width settings by default. See 'Demo->Layout->Widgets Width' for details.
-
// e.g. Use 2/3 of the space for widgets and 1/3 for labels (right align)
//ImGui::PushItemWidth(-ImGui::GetWindowWidth() * 0.35f);
-
// e.g. Leave a fixed amount of width for labels (by passing a negative value), the rest goes to widgets.
ImGui::PushItemWidth(ImGui::GetFontSize() * -12);
@@ -359,11 +352,13 @@ void ImGui::ShowDemoWindow(bool* p_open)
{
if (ImGui::BeginMenu("Menu"))
{
+ IMGUI_DEMO_MARKER("Menu/File");
ShowExampleMenuFile();
ImGui::EndMenu();
}
if (ImGui::BeginMenu("Examples"))
{
+ IMGUI_DEMO_MARKER("Menu/Examples");
ImGui::MenuItem("Main menu bar", NULL, &show_app_main_menu_bar);
ImGui::MenuItem("Console", NULL, &show_app_console);
ImGui::MenuItem("Log", NULL, &show_app_log);
@@ -382,7 +377,15 @@ void ImGui::ShowDemoWindow(bool* p_open)
//if (ImGui::MenuItem("MenuItem")) {} // You can also use MenuItem() inside a menu bar!
if (ImGui::BeginMenu("Tools"))
{
- ImGui::MenuItem("Metrics/Debugger", NULL, &show_app_metrics);
+ IMGUI_DEMO_MARKER("Menu/Tools");
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ const bool has_debug_tools = true;
+#else
+ const bool has_debug_tools = false;
+#endif
+ ImGui::MenuItem("Metrics/Debugger", NULL, &show_app_metrics, has_debug_tools);
+ ImGui::MenuItem("Debug Log", NULL, &show_app_debug_log, has_debug_tools);
+ ImGui::MenuItem("Stack Tool", NULL, &show_app_stack_tool, has_debug_tools);
ImGui::MenuItem("Style Editor", NULL, &show_app_style_editor);
ImGui::MenuItem("About Dear ImGui", NULL, &show_app_about);
ImGui::EndMenu();
@@ -390,9 +393,10 @@ void ImGui::ShowDemoWindow(bool* p_open)
ImGui::EndMenuBar();
}
- ImGui::Text("dear imgui says hello. (%s)", IMGUI_VERSION);
+ ImGui::Text("dear imgui says hello! (%s) (%d)", IMGUI_VERSION, IMGUI_VERSION_NUM);
ImGui::Spacing();
+ IMGUI_DEMO_MARKER("Help");
if (ImGui::CollapsingHeader("Help"))
{
ImGui::Text("ABOUT THIS DEMO:");
@@ -415,6 +419,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
ImGui::ShowUserGuide();
}
+ IMGUI_DEMO_MARKER("Configuration");
if (ImGui::CollapsingHeader("Configuration"))
{
ImGuiIO& io = ImGui::GetIO();
@@ -436,13 +441,17 @@ void ImGui::ShowDemoWindow(bool* p_open)
ImGui::SameLine();
ImGui::Text("<<PRESS SPACE TO DISABLE>>");
}
- if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_Space)))
+ if (ImGui::IsKeyPressed(ImGuiKey_Space))
io.ConfigFlags &= ~ImGuiConfigFlags_NoMouse;
}
ImGui::CheckboxFlags("io.ConfigFlags: NoMouseCursorChange", &io.ConfigFlags, ImGuiConfigFlags_NoMouseCursorChange);
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.ConfigInputTextCursorBlink", &io.ConfigInputTextCursorBlink);
- ImGui::SameLine(); HelpMarker("Enable blinking cursor (optional as some users consider it to be distracting)");
+ ImGui::SameLine(); HelpMarker("Enable blinking cursor (optional as some users consider it to be distracting).");
+ ImGui::Checkbox("io.ConfigInputTextEnterKeepActive", &io.ConfigInputTextEnterKeepActive);
+ ImGui::SameLine(); HelpMarker("Pressing Enter will keep item active and select contents (single-line only).");
ImGui::Checkbox("io.ConfigDragClickToInputText", &io.ConfigDragClickToInputText);
ImGui::SameLine(); HelpMarker("Enable turning DragXXX widgets into text input with a simple mouse click-release (without moving).");
ImGui::Checkbox("io.ConfigWindowsResizeFromEdges", &io.ConfigWindowsResizeFromEdges);
@@ -455,6 +464,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
ImGui::Separator();
}
+ IMGUI_DEMO_MARKER("Configuration/Backend Flags");
if (ImGui::TreeNode("Backend Flags"))
{
HelpMarker(
@@ -462,6 +472,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
"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);
@@ -471,6 +482,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
ImGui::Separator();
}
+ IMGUI_DEMO_MARKER("Configuration/Style");
if (ImGui::TreeNode("Style"))
{
HelpMarker("The same contents can be accessed in 'Tools->Style Editor' or by calling the ShowStyleEditor() function.");
@@ -479,6 +491,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
ImGui::Separator();
}
+ IMGUI_DEMO_MARKER("Configuration/Capture, Logging");
if (ImGui::TreeNode("Capture/Logging"))
{
HelpMarker(
@@ -498,6 +511,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
}
}
+ IMGUI_DEMO_MARKER("Window options");
if (ImGui::CollapsingHeader("Window options"))
{
if (ImGui::BeginTable("split", 3))
@@ -522,7 +536,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
ShowDemoWindowLayout();
ShowDemoWindowPopups();
ShowDemoWindowTables();
- ShowDemoWindowMisc();
+ ShowDemoWindowInputs();
// End of ShowDemoWindow()
ImGui::PopItemWidth();
@@ -531,6 +545,7 @@ void ImGui::ShowDemoWindow(bool* p_open)
static void ShowDemoWindowWidgets()
{
+ IMGUI_DEMO_MARKER("Widgets");
if (!ImGui::CollapsingHeader("Widgets"))
return;
@@ -538,8 +553,10 @@ static void ShowDemoWindowWidgets()
if (disable_all)
ImGui::BeginDisabled();
+ IMGUI_DEMO_MARKER("Widgets/Basic");
if (ImGui::TreeNode("Basic"))
{
+ IMGUI_DEMO_MARKER("Widgets/Basic/Button");
static int clicked = 0;
if (ImGui::Button("Button"))
clicked++;
@@ -549,15 +566,18 @@ static void ShowDemoWindowWidgets()
ImGui::Text("Thanks for clicking me!");
}
+ IMGUI_DEMO_MARKER("Widgets/Basic/Checkbox");
static bool check = true;
ImGui::Checkbox("checkbox", &check);
+ IMGUI_DEMO_MARKER("Widgets/Basic/RadioButton");
static int e = 0;
ImGui::RadioButton("radio a", &e, 0); ImGui::SameLine();
ImGui::RadioButton("radio b", &e, 1); ImGui::SameLine();
ImGui::RadioButton("radio c", &e, 2);
// Color buttons, demonstrate using PushID() to add unique identifier in the ID stack, and changing style.
+ IMGUI_DEMO_MARKER("Widgets/Basic/Buttons (Colored)");
for (int i = 0; i < 7; i++)
{
if (i > 0)
@@ -579,6 +599,7 @@ static void ShowDemoWindowWidgets()
ImGui::SameLine();
// Arrow buttons with Repeater
+ IMGUI_DEMO_MARKER("Widgets/Basic/Buttons (Repeating)");
static int counter = 0;
float spacing = ImGui::GetStyle().ItemInnerSpacing.x;
ImGui::PushButtonRepeat(true);
@@ -589,28 +610,13 @@ static void ShowDemoWindowWidgets()
ImGui::SameLine();
ImGui::Text("%d", counter);
- ImGui::Text("Hover over me");
- if (ImGui::IsItemHovered())
- ImGui::SetTooltip("I am a tooltip");
-
- ImGui::SameLine();
- ImGui::Text("- or me");
- 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::EndTooltip();
- }
-
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));
@@ -621,13 +627,14 @@ static void ShowDemoWindowWidgets()
{
// 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.
+ IMGUI_DEMO_MARKER("Widgets/Basic/InputText");
static char str0[128] = "Hello, world!";
ImGui::InputText("input text", str0, IM_ARRAYSIZE(str0));
ImGui::SameLine(); HelpMarker(
"USER:\n"
"Hold SHIFT or use mouse to select text.\n"
"CTRL+Left/Right to word jump.\n"
- "CTRL+A or double-click to select all.\n"
+ "CTRL+A or Double-Click to select all.\n"
"CTRL+X,CTRL+C,CTRL+V clipboard.\n"
"CTRL+Z,CTRL+Y undo/redo.\n"
"ESCAPE to revert.\n\n"
@@ -639,12 +646,9 @@ static void ShowDemoWindowWidgets()
static char str1[128] = "";
ImGui::InputTextWithHint("input text (w/ hint)", "enter text here", str1, IM_ARRAYSIZE(str1));
+ IMGUI_DEMO_MARKER("Widgets/Basic/InputInt, InputFloat");
static int i0 = 123;
ImGui::InputInt("input int", &i0);
- ImGui::SameLine(); HelpMarker(
- "You can apply arithmetic operators +,*,/ on numerical values.\n"
- " e.g. [ 100 ], input \'*2\', result becomes [ 200 ]\n"
- "Use +- to subtract.");
static float f0 = 0.001f;
ImGui::InputFloat("input float", &f0, 0.01f, 1.0f, "%.3f");
@@ -663,6 +667,7 @@ static void ShowDemoWindowWidgets()
}
{
+ IMGUI_DEMO_MARKER("Widgets/Basic/DragInt, DragFloat");
static int i1 = 50, i2 = 42;
ImGui::DragInt("drag int", &i1, 1);
ImGui::SameLine(); HelpMarker(
@@ -678,6 +683,7 @@ static void ShowDemoWindowWidgets()
}
{
+ IMGUI_DEMO_MARKER("Widgets/Basic/SliderInt, SliderFloat");
static int i1 = 0;
ImGui::SliderInt("slider int", &i1, -1, 3);
ImGui::SameLine(); HelpMarker("CTRL+click to input value.");
@@ -686,12 +692,14 @@ static void ShowDemoWindowWidgets()
ImGui::SliderFloat("slider float", &f1, 0.0f, 1.0f, "ratio = %.3f");
ImGui::SliderFloat("slider float (log)", &f2, -10.0f, 10.0f, "%.4f", ImGuiSliderFlags_Logarithmic);
+ IMGUI_DEMO_MARKER("Widgets/Basic/SliderAngle");
static float angle = 0.0f;
ImGui::SliderAngle("slider angle", &angle);
// Using the format string to display a name instead of an integer.
// Here we completely omit '%d' from the format string, so it'll only display a name.
// This technique can also be used with DragInt().
+ IMGUI_DEMO_MARKER("Widgets/Basic/Slider (enum)");
enum Element { Element_Fire, Element_Earth, Element_Air, Element_Water, Element_COUNT };
static int elem = Element_Fire;
const char* elems_names[Element_COUNT] = { "Fire", "Earth", "Air", "Water" };
@@ -701,6 +709,7 @@ static void ShowDemoWindowWidgets()
}
{
+ IMGUI_DEMO_MARKER("Widgets/Basic/ColorEdit3, ColorEdit4");
static float col1[3] = { 1.0f, 0.0f, 0.2f };
static float col2[4] = { 0.4f, 0.7f, 0.0f, 0.5f };
ImGui::ColorEdit3("color 1", col1);
@@ -716,6 +725,7 @@ static void ShowDemoWindowWidgets()
{
// Using the _simplified_ one-liner ListBox() api here
// See "List boxes" section for examples of how to use the more flexible BeginListBox()/EndListBox() api.
+ IMGUI_DEMO_MARKER("Widgets/Basic/ListBox");
const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi", "Mango", "Orange", "Pineapple", "Strawberry", "Watermelon" };
static int item_current = 1;
ImGui::ListBox("listbox", &item_current, items, IM_ARRAYSIZE(items), 4);
@@ -723,6 +733,40 @@ 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();
}
@@ -732,8 +776,10 @@ static void ShowDemoWindowWidgets()
// if (once)
// ImGui::Text("This will be displayed only once.");
+ IMGUI_DEMO_MARKER("Widgets/Trees");
if (ImGui::TreeNode("Trees"))
{
+ IMGUI_DEMO_MARKER("Widgets/Trees/Basic trees");
if (ImGui::TreeNode("Basic trees"))
{
for (int i = 0; i < 5; i++)
@@ -754,6 +800,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Trees/Advanced, with Selectable nodes");
if (ImGui::TreeNode("Advanced, with Selectable nodes"))
{
HelpMarker(
@@ -781,6 +828,7 @@ static void ShowDemoWindowWidgets()
for (int i = 0; i < 6; i++)
{
// Disable the default "open on single-click behavior" + set Selected flag according to our selection.
+ // To alter selection we use IsItemClicked() && !IsItemToggledOpen(), so clicking on an arrow doesn't alter selection.
ImGuiTreeNodeFlags node_flags = base_flags;
const bool is_selected = (selection_mask & (1 << i)) != 0;
if (is_selected)
@@ -789,7 +837,7 @@ static void ShowDemoWindowWidgets()
{
// Items 0..2 are Tree Node
bool node_open = ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Node %d", i);
- if (ImGui::IsItemClicked())
+ if (ImGui::IsItemClicked() && !ImGui::IsItemToggledOpen())
node_clicked = i;
if (test_drag_and_drop && ImGui::BeginDragDropSource())
{
@@ -810,7 +858,7 @@ static void ShowDemoWindowWidgets()
// use BulletText() or advance the cursor by GetTreeNodeToLabelSpacing() and call Text().
node_flags |= ImGuiTreeNodeFlags_Leaf | ImGuiTreeNodeFlags_NoTreePushOnOpen; // ImGuiTreeNodeFlags_Bullet
ImGui::TreeNodeEx((void*)(intptr_t)i, node_flags, "Selectable Leaf %d", i);
- if (ImGui::IsItemClicked())
+ if (ImGui::IsItemClicked() && !ImGui::IsItemToggledOpen())
node_clicked = i;
if (test_drag_and_drop && ImGui::BeginDragDropSource())
{
@@ -836,6 +884,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Collapsing Headers");
if (ImGui::TreeNode("Collapsing Headers"))
{
static bool closable_group = true;
@@ -859,6 +908,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Bullets");
if (ImGui::TreeNode("Bullets"))
{
ImGui::BulletText("Bullet point 1");
@@ -873,8 +923,10 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Text");
if (ImGui::TreeNode("Text"))
{
+ IMGUI_DEMO_MARKER("Widgets/Text/Colored Text");
if (ImGui::TreeNode("Colorful Text"))
{
// Using shortcut. You can use PushStyleColor()/PopStyleColor() for more flexibility.
@@ -885,6 +937,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Text/Word Wrapping");
if (ImGui::TreeNode("Word Wrapping"))
{
// Using shortcut. You can use PushTextWrapPos()/PopTextWrapPos() for more flexibility.
@@ -918,6 +971,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Text/UTF-8 Text");
if (ImGui::TreeNode("UTF-8 Text"))
{
// UTF-8 test with Japanese characters
@@ -931,7 +985,7 @@ static void ShowDemoWindowWidgets()
// Note that characters values are preserved even by InputText() if the font cannot be displayed,
// so you can safely copy & paste garbled characters into another application.
ImGui::TextWrapped(
- "CJK text will only appears if the font was loaded with the appropriate CJK character ranges. "
+ "CJK text will only appear if the font was loaded with the appropriate CJK character ranges. "
"Call io.Fonts->AddFontFromFileTTF() manually to load extra character ranges. "
"Read docs/FONTS.md for details.");
ImGui::Text("Hiragana: \xe3\x81\x8b\xe3\x81\x8d\xe3\x81\x8f\xe3\x81\x91\xe3\x81\x93 (kakikukeko)"); // Normally we would use u8"blah blah" with the proper characters directly in the string.
@@ -944,6 +998,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Images");
if (ImGui::TreeNode("Images"))
{
ImGuiIO& io = ImGui::GetIO();
@@ -997,19 +1052,27 @@ static void ShowDemoWindowWidgets()
ImGui::EndTooltip();
}
}
+
+ IMGUI_DEMO_MARKER("Widgets/Images/Textured buttons");
ImGui::TextWrapped("And now some textured buttons..");
static int pressed_count = 0;
for (int i = 0; i < 8; i++)
{
+ // UV coordinates are often (0.0f, 0.0f) and (1.0f, 1.0f) to display an entire textures.
+ // Here are trying to display only a 32x32 pixels area of the texture, hence the UV computation.
+ // Read about UV coordinates here: https://github.com/ocornut/imgui/wiki/Image-Loading-and-Displaying-Examples
ImGui::PushID(i);
- int frame_padding = -1 + i; // -1 == uses default padding (style.FramePadding)
- ImVec2 size = ImVec2(32.0f, 32.0f); // Size of the image we want to make visible
- ImVec2 uv0 = ImVec2(0.0f, 0.0f); // UV coordinates for lower-left
- ImVec2 uv1 = ImVec2(32.0f / my_tex_w, 32.0f / my_tex_h);// UV coordinates for (32,32) in our texture
- ImVec4 bg_col = ImVec4(0.0f, 0.0f, 0.0f, 1.0f); // Black background
- ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); // No tint
- if (ImGui::ImageButton(my_tex_id, size, uv0, uv1, frame_padding, bg_col, tint_col))
+ if (i > 0)
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(i - 1.0f, i - 1.0f));
+ ImVec2 size = ImVec2(32.0f, 32.0f); // Size of the image we want to make visible
+ ImVec2 uv0 = ImVec2(0.0f, 0.0f); // UV coordinates for lower-left
+ ImVec2 uv1 = ImVec2(32.0f / my_tex_w, 32.0f / my_tex_h); // UV coordinates for (32,32) in our texture
+ ImVec4 bg_col = ImVec4(0.0f, 0.0f, 0.0f, 1.0f); // Black background
+ ImVec4 tint_col = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); // No tint
+ if (ImGui::ImageButton("", my_tex_id, size, uv0, uv1, bg_col, tint_col))
pressed_count += 1;
+ if (i > 0)
+ ImGui::PopStyleVar();
ImGui::PopID();
ImGui::SameLine();
}
@@ -1018,8 +1081,10 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Combo");
if (ImGui::TreeNode("Combo"))
{
+ // Combo Boxes are also called "Dropdown" in other systems
// Expose flags as checkbox for the demo
static ImGuiComboFlags flags = 0;
ImGui::CheckboxFlags("ImGuiComboFlags_PopupAlignLeft", &flags, ImGuiComboFlags_PopupAlignLeft);
@@ -1068,6 +1133,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/List Boxes");
if (ImGui::TreeNode("List boxes"))
{
// Using the generic BeginListBox() API, you have full control over how to display the combo contents.
@@ -1110,6 +1176,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Selectables");
if (ImGui::TreeNode("Selectables"))
{
// Selectable() has 2 overloads:
@@ -1118,6 +1185,7 @@ static void ShowDemoWindowWidgets()
// - The one taking "bool* p_selected" as a read-write selection information (convenient in some cases)
// The earlier is more flexible, as in real application your selection may be stored in many different ways
// and not necessarily inside a bool value (e.g. in flags within objects, as an external list, etc).
+ IMGUI_DEMO_MARKER("Widgets/Selectables/Basic");
if (ImGui::TreeNode("Basic"))
{
static bool selection[5] = { false, true, false, false, false };
@@ -1130,6 +1198,7 @@ static void ShowDemoWindowWidgets()
selection[4] = !selection[4];
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Selectables/Single Selection");
if (ImGui::TreeNode("Selection State: Single Selection"))
{
static int selected = -1;
@@ -1142,6 +1211,7 @@ static void ShowDemoWindowWidgets()
}
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Selectables/Multiple Selection");
if (ImGui::TreeNode("Selection State: Multiple Selection"))
{
HelpMarker("Hold CTRL and click to select multiple items.");
@@ -1159,6 +1229,7 @@ static void ShowDemoWindowWidgets()
}
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Selectables/Rendering more text into the same line");
if (ImGui::TreeNode("Rendering more text into the same line"))
{
// Using the Selectable() override that takes "bool* p_selected" parameter,
@@ -1169,6 +1240,7 @@ static void ShowDemoWindowWidgets()
ImGui::Selectable("Hello.h", &selected[2]); ImGui::SameLine(300); ImGui::Text(" 2,345 bytes");
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Selectables/In columns");
if (ImGui::TreeNode("In columns"))
{
static bool selected[10] = {};
@@ -1203,6 +1275,7 @@ static void ShowDemoWindowWidgets()
}
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Selectables/Grid");
if (ImGui::TreeNode("Grid"))
{
static char selected[4][4] = { { 1, 0, 0, 0 }, { 0, 1, 0, 0 }, { 0, 0, 1, 0 }, { 0, 0, 0, 1 } };
@@ -1235,6 +1308,7 @@ static void ShowDemoWindowWidgets()
ImGui::PopStyleVar();
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Selectables/Alignment");
if (ImGui::TreeNode("Alignment"))
{
HelpMarker(
@@ -1262,8 +1336,10 @@ static void ShowDemoWindowWidgets()
// 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.
+ IMGUI_DEMO_MARKER("Widgets/Text Input");
if (ImGui::TreeNode("Text Input"))
{
+ IMGUI_DEMO_MARKER("Widgets/Text Input/Multi-line Text Input");
if (ImGui::TreeNode("Multi-line Text Input"))
{
// Note: we are using a fixed-sized buffer for simplicity here. See ImGuiInputTextFlags_CallbackResize
@@ -1289,6 +1365,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Text Input/Filtered Text Input");
if (ImGui::TreeNode("Filtered Text Input"))
{
struct TextFilters
@@ -1311,6 +1388,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Text Input/Password input");
if (ImGui::TreeNode("Password Input"))
{
static char password[64] = "password123";
@@ -1371,12 +1449,13 @@ static void ShowDemoWindowWidgets()
static char buf3[64];
static int edit_count = 0;
ImGui::InputText("Edit", buf3, 64, ImGuiInputTextFlags_CallbackEdit, Funcs::MyCallback, (void*)&edit_count);
- ImGui::SameLine(); HelpMarker("Here we toggle the casing of the first character on every edits + count edits.");
+ ImGui::SameLine(); HelpMarker("Here we toggle the casing of the first character on every edit + count edits.");
ImGui::SameLine(); ImGui::Text("(%d)", edit_count);
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Text Input/Resize Callback");
if (ImGui::TreeNode("Resize Callback"))
{
// To wire InputText() with std::string or any other custom string type,
@@ -1423,8 +1502,10 @@ static void ShowDemoWindowWidgets()
}
// Tabs
+ IMGUI_DEMO_MARKER("Widgets/Tabs");
if (ImGui::TreeNode("Tabs"))
{
+ IMGUI_DEMO_MARKER("Widgets/Tabs/Basic");
if (ImGui::TreeNode("Basic"))
{
ImGuiTabBarFlags tab_bar_flags = ImGuiTabBarFlags_None;
@@ -1451,6 +1532,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Tabs/Advanced & Close Button");
if (ImGui::TreeNode("Advanced & Close Button"))
{
// Expose a couple of the available flags. In most cases you may just call BeginTabBar() with no flags (0).
@@ -1493,6 +1575,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Tabs/TabItemButton & Leading-Trailing flags");
if (ImGui::TreeNode("TabItemButton & Leading/Trailing flags"))
{
static ImVector<int> active_tabs;
@@ -1564,12 +1647,14 @@ static void ShowDemoWindowWidgets()
// Plot/Graph widgets are not very good.
// Consider using a third-party library such as ImPlot: https://github.com/epezent/implot
// (see others https://github.com/ocornut/imgui/wiki/Useful-Extensions)
- if (ImGui::TreeNode("Plots Widgets"))
+ IMGUI_DEMO_MARKER("Widgets/Plotting");
+ if (ImGui::TreeNode("Plotting"))
{
static bool animate = true;
ImGui::Checkbox("Animate", &animate);
// Plot as lines and plot as histogram
+ IMGUI_DEMO_MARKER("Widgets/Plotting/PlotLines, PlotHistogram");
static float arr[] = { 0.6f, 0.1f, 1.0f, 0.5f, 0.92f, 0.1f, 0.2f };
ImGui::PlotLines("Frame Times", arr, IM_ARRAYSIZE(arr));
ImGui::PlotHistogram("Histogram", arr, IM_ARRAYSIZE(arr), 0, NULL, 0.0f, 1.0f, ImVec2(0, 80.0f));
@@ -1623,6 +1708,7 @@ static void ShowDemoWindowWidgets()
ImGui::Separator();
// Animate a simple progress bar
+ IMGUI_DEMO_MARKER("Widgets/Plotting/ProgressBar");
static float progress = 0.0f, progress_dir = 1.0f;
if (animate)
{
@@ -1644,6 +1730,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Color");
if (ImGui::TreeNode("Color/Picker Widgets"))
{
static ImVec4 color = ImVec4(114.0f / 255.0f, 144.0f / 255.0f, 154.0f / 255.0f, 200.0f / 255.0f);
@@ -1660,18 +1747,22 @@ static void ShowDemoWindowWidgets()
ImGui::Checkbox("With HDR", &hdr); ImGui::SameLine(); HelpMarker("Currently all this does is to lift the 0..1 limits on dragging widgets.");
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::Text("Color widget:");
ImGui::SameLine(); HelpMarker(
"Click on the color square to open a color picker.\n"
"CTRL+click on individual component to input value.\n");
ImGui::ColorEdit3("MyColor##1", (float*)&color, misc_flags);
+ IMGUI_DEMO_MARKER("Widgets/Color/ColorEdit (HSV, with Alpha)");
ImGui::Text("Color widget HSV with Alpha:");
ImGui::ColorEdit4("MyColor##2", (float*)&color, ImGuiColorEditFlags_DisplayHSV | misc_flags);
+ IMGUI_DEMO_MARKER("Widgets/Color/ColorEdit (float display)");
ImGui::Text("Color widget with Float Display:");
ImGui::ColorEdit4("MyColor##2f", (float*)&color, ImGuiColorEditFlags_Float | misc_flags);
+ IMGUI_DEMO_MARKER("Widgets/Color/ColorButton (with Picker)");
ImGui::Text("Color button with Picker:");
ImGui::SameLine(); HelpMarker(
"With the ImGuiColorEditFlags_NoInputs flag you can hide all the slider/text inputs.\n"
@@ -1679,6 +1770,7 @@ static void ShowDemoWindowWidgets()
"be used for the tooltip and picker popup.");
ImGui::ColorEdit4("MyColor##3", (float*)&color, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel | misc_flags);
+ IMGUI_DEMO_MARKER("Widgets/Color/ColorButton (with custom Picker popup)");
ImGui::Text("Color button with Custom Picker Popup:");
// Generate a default palette. The palette will persist and can be edited.
@@ -1746,11 +1838,13 @@ static void ShowDemoWindowWidgets()
ImGui::EndPopup();
}
+ IMGUI_DEMO_MARKER("Widgets/Color/ColorButton (simple)");
ImGui::Text("Color button only:");
static bool no_border = false;
ImGui::Checkbox("ImGuiColorEditFlags_NoBorder", &no_border);
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:");
static bool alpha = true;
static bool alpha_bar = true;
@@ -1775,10 +1869,9 @@ static void ShowDemoWindowWidgets()
ImGui::Combo("Display Mode", &display_mode, "Auto/Current\0None\0RGB Only\0HSV Only\0Hex Only\0");
ImGui::SameLine(); HelpMarker(
"ColorEdit defaults to displaying RGB inputs if you don't specify a display mode, "
- "but the user can change it with a right-click.\n\nColorPicker defaults to displaying RGB+HSV+Hex "
+ "but the user can change it with a right-click on those inputs.\n\nColorPicker defaults to displaying RGB+HSV+Hex "
"if you don't specify a display mode.\n\nYou can change the defaults using SetColorEditOptions().");
- ImGui::Combo("Picker Mode", &picker_mode, "Auto/Current\0Hue bar + SV rect\0Hue wheel + SV triangle\0");
- ImGui::SameLine(); HelpMarker("User can right-click the picker to change mode.");
+ ImGui::SameLine(); HelpMarker("When not specified explicitly (Auto/Current mode), user can right-click the picker to change mode.");
ImGuiColorEditFlags flags = misc_flags;
if (!alpha) flags |= ImGuiColorEditFlags_NoAlpha; // This is by default if you call ColorPicker3() instead of ColorPicker4()
if (alpha_bar) flags |= ImGuiColorEditFlags_AlphaBar;
@@ -1802,6 +1895,15 @@ static void ShowDemoWindowWidgets()
if (ImGui::Button("Default: Float + HDR + Hue Wheel"))
ImGui::SetColorEditOptions(ImGuiColorEditFlags_Float | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_PickerHueWheel);
+ // Always both a small version of both types of pickers (to make it more visible in the demo to people who are skimming quickly through it)
+ ImGui::Text("Both types:");
+ float w = (ImGui::GetContentRegionAvail().x - ImGui::GetStyle().ItemSpacing.y) * 0.40f;
+ ImGui::SetNextItemWidth(w);
+ ImGui::ColorPicker3("##MyColor##5", (float*)&color, ImGuiColorEditFlags_PickerHueBar | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoAlpha);
+ ImGui::SameLine();
+ ImGui::SetNextItemWidth(w);
+ ImGui::ColorPicker3("##MyColor##6", (float*)&color, ImGuiColorEditFlags_PickerHueWheel | ImGuiColorEditFlags_NoSidePreview | ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoAlpha);
+
// HSV encoded support (to avoid RGB<>HSV round trips and singularities when S==0 or V==0)
static ImVec4 color_hsv(0.23f, 1.0f, 1.0f, 1.0f); // Stored as HSV!
ImGui::Spacing();
@@ -1818,6 +1920,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Drag and Slider Flags");
if (ImGui::TreeNode("Drag/Slider Flags"))
{
// Demonstrate using advanced flags for DragXXX and SliderXXX functions. Note that the flags are the same!
@@ -1851,6 +1954,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Range Widgets");
if (ImGui::TreeNode("Range Widgets"))
{
static float begin = 10, end = 90;
@@ -1861,6 +1965,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Data Types");
if (ImGui::TreeNode("Data Types"))
{
// DragScalar/InputScalar/SliderScalar functions allow various data types
@@ -1869,7 +1974,7 @@ static void ShowDemoWindowWidgets()
// - integer/float/double
// To avoid polluting the public API with all possible combinations, we use the ImGuiDataType enum
// to pass the type, and passing all arguments by pointer.
- // This is the reason the test code below creates local variables to hold "zero" "one" etc. for each types.
+ // This is the reason the test code below creates local variables to hold "zero" "one" etc. for each type.
// In practice, if you frequently use a given type that is not covered by the normal API entry points,
// you can wrap it yourself inside a 1 line function which can take typed argument as value instead of void*,
// and then pass their address to the generic function. For example:
@@ -1910,16 +2015,18 @@ 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::Checkbox("Clamp integers to 0..50", &drag_clamp);
ImGui::SameLine(); HelpMarker(
- "As with every widgets in dear imgui, we never modify values unless there is a user interaction.\n"
+ "As with every widget in dear imgui, we never modify values unless there is a user interaction.\n"
"You can override the clamping limits by using CTRL+Click to input a value.");
ImGui::DragScalar("drag s8", ImGuiDataType_S8, &s8_v, drag_speed, drag_clamp ? &s8_zero : NULL, drag_clamp ? &s8_fifty : NULL);
ImGui::DragScalar("drag u8", ImGuiDataType_U8, &u8_v, drag_speed, drag_clamp ? &u8_zero : NULL, drag_clamp ? &u8_fifty : NULL, "%u ms");
ImGui::DragScalar("drag s16", ImGuiDataType_S16, &s16_v, drag_speed, drag_clamp ? &s16_zero : NULL, drag_clamp ? &s16_fifty : NULL);
ImGui::DragScalar("drag u16", ImGuiDataType_U16, &u16_v, drag_speed, drag_clamp ? &u16_zero : NULL, drag_clamp ? &u16_fifty : NULL, "%u ms");
ImGui::DragScalar("drag s32", ImGuiDataType_S32, &s32_v, drag_speed, drag_clamp ? &s32_zero : NULL, drag_clamp ? &s32_fifty : NULL);
+ ImGui::DragScalar("drag s32 hex", ImGuiDataType_S32, &s32_v, drag_speed, drag_clamp ? &s32_zero : NULL, drag_clamp ? &s32_fifty : NULL, "0x%08X");
ImGui::DragScalar("drag u32", ImGuiDataType_U32, &u32_v, drag_speed, drag_clamp ? &u32_zero : NULL, drag_clamp ? &u32_fifty : NULL, "%u ms");
ImGui::DragScalar("drag s64", ImGuiDataType_S64, &s64_v, drag_speed, drag_clamp ? &s64_zero : NULL, drag_clamp ? &s64_fifty : NULL);
ImGui::DragScalar("drag u64", ImGuiDataType_U64, &u64_v, drag_speed, drag_clamp ? &u64_zero : NULL, drag_clamp ? &u64_fifty : NULL);
@@ -1928,6 +2035,7 @@ static void ShowDemoWindowWidgets()
ImGui::DragScalar("drag double", ImGuiDataType_Double, &f64_v, 0.0005f, &f64_zero, NULL, "%.10f grams");
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::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");
@@ -1936,6 +2044,7 @@ static void ShowDemoWindowWidgets()
ImGui::SliderScalar("slider s32 low", ImGuiDataType_S32, &s32_v, &s32_zero, &s32_fifty,"%d");
ImGui::SliderScalar("slider s32 high", ImGuiDataType_S32, &s32_v, &s32_hi_a, &s32_hi_b, "%d");
ImGui::SliderScalar("slider s32 full", ImGuiDataType_S32, &s32_v, &s32_min, &s32_max, "%d");
+ ImGui::SliderScalar("slider s32 hex", ImGuiDataType_S32, &s32_v, &s32_zero, &s32_fifty, "0x%04X");
ImGui::SliderScalar("slider u32 low", ImGuiDataType_U32, &u32_v, &u32_zero, &u32_fifty,"%u");
ImGui::SliderScalar("slider u32 high", ImGuiDataType_U32, &u32_v, &u32_hi_a, &u32_hi_b, "%u");
ImGui::SliderScalar("slider u32 full", ImGuiDataType_U32, &u32_v, &u32_min, &u32_max, "%u");
@@ -1960,6 +2069,7 @@ static void ShowDemoWindowWidgets()
ImGui::SliderScalar("slider s64 reverse", ImGuiDataType_S64, &s64_v, &s64_fifty, &s64_zero, "%" IM_PRId64);
ImGui::SliderScalar("slider u64 reverse", ImGuiDataType_U64, &u64_v, &u64_fifty, &u64_zero, "%" IM_PRIu64 " ms");
+ IMGUI_DEMO_MARKER("Widgets/Data Types/Inputs");
static bool inputs_step = true;
ImGui::Text("Inputs");
ImGui::Checkbox("Show step buttons", &inputs_step);
@@ -1968,9 +2078,9 @@ static void ShowDemoWindowWidgets()
ImGui::InputScalar("input s16", ImGuiDataType_S16, &s16_v, inputs_step ? &s16_one : NULL, NULL, "%d");
ImGui::InputScalar("input u16", ImGuiDataType_U16, &u16_v, inputs_step ? &u16_one : NULL, NULL, "%u");
ImGui::InputScalar("input s32", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%d");
- ImGui::InputScalar("input s32 hex", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%08X", ImGuiInputTextFlags_CharsHexadecimal);
+ ImGui::InputScalar("input s32 hex", ImGuiDataType_S32, &s32_v, inputs_step ? &s32_one : NULL, NULL, "%04X");
ImGui::InputScalar("input u32", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%u");
- ImGui::InputScalar("input u32 hex", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%08X", ImGuiInputTextFlags_CharsHexadecimal);
+ ImGui::InputScalar("input u32 hex", ImGuiDataType_U32, &u32_v, inputs_step ? &u32_one : NULL, NULL, "%08X");
ImGui::InputScalar("input s64", ImGuiDataType_S64, &s64_v, inputs_step ? &s64_one : NULL);
ImGui::InputScalar("input u64", ImGuiDataType_U64, &u64_v, inputs_step ? &u64_one : NULL);
ImGui::InputScalar("input float", ImGuiDataType_Float, &f32_v, inputs_step ? &f32_one : NULL);
@@ -1979,6 +2089,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Multi-component Widgets");
if (ImGui::TreeNode("Multi-component Widgets"))
{
static float vec4f[4] = { 0.10f, 0.20f, 0.30f, 0.44f };
@@ -2010,6 +2121,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Vertical Sliders");
if (ImGui::TreeNode("Vertical Sliders"))
{
const float spacing = 4;
@@ -2074,8 +2186,10 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Drag and drop");
if (ImGui::TreeNode("Drag and Drop"))
{
+ IMGUI_DEMO_MARKER("Widgets/Drag and drop/Standard widgets");
if (ImGui::TreeNode("Drag and drop in standard widgets"))
{
// ColorEdit widgets automatically act as drag source and drag target.
@@ -2090,6 +2204,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Drag and drop/Copy-swap items");
if (ImGui::TreeNode("Drag and drop to copy/swap items"))
{
enum Mode
@@ -2157,6 +2272,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Drag and Drop/Drag to reorder items (simple)");
if (ImGui::TreeNode("Drag to reorder items (simple)"))
{
// Simple reordering
@@ -2186,12 +2302,13 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Querying Item Status (Edited,Active,Hovered etc.)");
if (ImGui::TreeNode("Querying Item Status (Edited/Active/Hovered etc.)"))
{
// Select an item type
const char* item_names[] =
{
- "Text", "Button", "Button (w/ repeat)", "Checkbox", "SliderFloat", "InputText", "InputFloat",
+ "Text", "Button", "Button (w/ repeat)", "Checkbox", "SliderFloat", "InputText", "InputTextMultiline", "InputFloat",
"InputFloat3", "ColorEdit4", "Selectable", "MenuItem", "TreeNode", "TreeNode (w/ double-click)", "Combo", "ListBox"
};
static int item_type = 4;
@@ -2201,7 +2318,7 @@ static void ShowDemoWindowWidgets()
HelpMarker("Testing how various types of items are interacting with the IsItemXXX functions. Note that the bool return value of most ImGui function is generally equivalent to calling ImGui::IsItemHovered().");
ImGui::Checkbox("Item Disabled", &item_disabled);
- // Submit selected item item so we can query their status in the code following it.
+ // Submit selected items so we can query their status in the code following it.
bool ret = false;
static bool b = false;
static float col4f[4] = { 1.0f, 0.5, 0.0f, 1.0f };
@@ -2214,15 +2331,20 @@ static void ShowDemoWindowWidgets()
if (item_type == 3) { ret = ImGui::Checkbox("ITEM: Checkbox", &b); } // Testing checkbox
if (item_type == 4) { ret = ImGui::SliderFloat("ITEM: SliderFloat", &col4f[0], 0.0f, 1.0f); } // Testing basic item
if (item_type == 5) { ret = ImGui::InputText("ITEM: InputText", &str[0], IM_ARRAYSIZE(str)); } // Testing input text (which handles tabbing)
- if (item_type == 6) { ret = ImGui::InputFloat("ITEM: InputFloat", col4f, 1.0f); } // Testing +/- buttons on scalar input
- if (item_type == 7) { ret = ImGui::InputFloat3("ITEM: InputFloat3", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged)
- if (item_type == 8) { ret = ImGui::ColorEdit4("ITEM: ColorEdit4", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged)
- if (item_type == 9) { ret = ImGui::Selectable("ITEM: Selectable"); } // Testing selectable item
- if (item_type == 10){ ret = ImGui::MenuItem("ITEM: MenuItem"); } // Testing menu item (they use ImGuiButtonFlags_PressedOnRelease button policy)
- if (item_type == 11){ ret = ImGui::TreeNode("ITEM: TreeNode"); if (ret) ImGui::TreePop(); } // Testing tree node
- if (item_type == 12){ ret = ImGui::TreeNodeEx("ITEM: TreeNode w/ ImGuiTreeNodeFlags_OpenOnDoubleClick", ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_NoTreePushOnOpen); } // Testing tree node with ImGuiButtonFlags_PressedOnDoubleClick button policy.
- if (item_type == 13){ const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::Combo("ITEM: Combo", &current, items, IM_ARRAYSIZE(items)); }
- if (item_type == 14){ const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::ListBox("ITEM: ListBox", &current, items, IM_ARRAYSIZE(items), IM_ARRAYSIZE(items)); }
+ if (item_type == 6) { ret = ImGui::InputTextMultiline("ITEM: InputTextMultiline", &str[0], IM_ARRAYSIZE(str)); } // Testing input text (which uses a child window)
+ if (item_type == 7) { ret = ImGui::InputFloat("ITEM: InputFloat", col4f, 1.0f); } // Testing +/- buttons on scalar input
+ if (item_type == 8) { ret = ImGui::InputFloat3("ITEM: InputFloat3", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged)
+ if (item_type == 9) { ret = ImGui::ColorEdit4("ITEM: ColorEdit4", col4f); } // Testing multi-component items (IsItemXXX flags are reported merged)
+ if (item_type == 10){ ret = ImGui::Selectable("ITEM: Selectable"); } // Testing selectable item
+ if (item_type == 11){ ret = ImGui::MenuItem("ITEM: MenuItem"); } // Testing menu item (they use ImGuiButtonFlags_PressedOnRelease button policy)
+ if (item_type == 12){ ret = ImGui::TreeNode("ITEM: TreeNode"); if (ret) ImGui::TreePop(); } // Testing tree node
+ if (item_type == 13){ ret = ImGui::TreeNodeEx("ITEM: TreeNode w/ ImGuiTreeNodeFlags_OpenOnDoubleClick", ImGuiTreeNodeFlags_OpenOnDoubleClick | ImGuiTreeNodeFlags_NoTreePushOnOpen); } // Testing tree node with ImGuiButtonFlags_PressedOnDoubleClick button policy.
+ if (item_type == 14){ const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::Combo("ITEM: Combo", &current, items, IM_ARRAYSIZE(items)); }
+ if (item_type == 15){ const char* items[] = { "Apple", "Banana", "Cherry", "Kiwi" }; static int current = 1; ret = ImGui::ListBox("ITEM: ListBox", &current, items, IM_ARRAYSIZE(items), IM_ARRAYSIZE(items)); }
+
+ bool hovered_delay_none = ImGui::IsItemHovered();
+ bool hovered_delay_short = ImGui::IsItemHovered(ImGuiHoveredFlags_DelayShort);
+ bool hovered_delay_normal = ImGui::IsItemHovered(ImGuiHoveredFlags_DelayNormal);
// Display the values of IsItemHovered() and other common item state functions.
// Note that the ImGuiHoveredFlags_XXX flags can be combined.
@@ -2268,6 +2390,8 @@ static void ShowDemoWindowWidgets()
ImGui::GetItemRectMax().x, ImGui::GetItemRectMax().y,
ImGui::GetItemRectSize().x, ImGui::GetItemRectSize().y
);
+ ImGui::BulletText(
+ "w/ Hovering Delay: None = %d, Fast %d, Normal = %d", hovered_delay_none, hovered_delay_short, hovered_delay_normal);
if (item_disabled)
ImGui::EndDisabled();
@@ -2280,6 +2404,7 @@ static void ShowDemoWindowWidgets()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Widgets/Querying Window Status (Focused,Hovered etc.)");
if (ImGui::TreeNode("Querying Window Status (Focused/Hovered etc.)"))
{
static bool embed_all_inside_a_child_window = false;
@@ -2364,19 +2489,42 @@ static void ShowDemoWindowWidgets()
if (disable_all)
ImGui::EndDisabled();
+ IMGUI_DEMO_MARKER("Widgets/Disable Block");
if (ImGui::TreeNode("Disable block"))
{
ImGui::Checkbox("Disable entire section above", &disable_all);
ImGui::SameLine(); HelpMarker("Demonstrate using BeginDisabled()/EndDisabled() across this section.");
ImGui::TreePop();
}
+
+ IMGUI_DEMO_MARKER("Widgets/Text Filter");
+ if (ImGui::TreeNode("Text Filter"))
+ {
+ // Helper class to easy setup a text filter.
+ // You may want to implement a more feature-full filtering scheme in your own application.
+ HelpMarker("Not a widget per-se, but ImGuiTextFilter is a helper to perform simple filtering on text strings.");
+ static ImGuiTextFilter filter;
+ ImGui::Text("Filter usage:\n"
+ " \"\" display all lines\n"
+ " \"xxx\" display lines containing \"xxx\"\n"
+ " \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n"
+ " \"-xxx\" hide lines containing \"xxx\"");
+ filter.Draw();
+ const char* lines[] = { "aaa1.c", "bbb1.c", "ccc1.c", "aaa2.cpp", "bbb2.cpp", "ccc2.cpp", "abc.h", "hello, world" };
+ for (int i = 0; i < IM_ARRAYSIZE(lines); i++)
+ if (filter.PassFilter(lines[i]))
+ ImGui::BulletText("%s", lines[i]);
+ ImGui::TreePop();
+ }
}
static void ShowDemoWindowLayout()
{
+ IMGUI_DEMO_MARKER("Layout");
if (!ImGui::CollapsingHeader("Layout & Scrolling"))
return;
+ IMGUI_DEMO_MARKER("Layout/Child windows");
if (ImGui::TreeNode("Child windows"))
{
HelpMarker("Use child windows to begin into a self-contained independent scrolling/clipping regions within a host window.");
@@ -2462,6 +2610,7 @@ static void ShowDemoWindowLayout()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Layout/Widgets Width");
if (ImGui::TreeNode("Widgets Width"))
{
static float f = 0.0f;
@@ -2538,11 +2687,13 @@ static void ShowDemoWindowLayout()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Layout/Basic Horizontal Layout");
if (ImGui::TreeNode("Basic Horizontal Layout"))
{
ImGui::TextWrapped("(Use ImGui::SameLine() to keep adding items to the right of the preceding item)");
// Text
+ IMGUI_DEMO_MARKER("Layout/Basic Horizontal Layout/SameLine");
ImGui::Text("Two items: Hello"); ImGui::SameLine();
ImGui::TextColored(ImVec4(1,1,0,1), "Sailor");
@@ -2563,6 +2714,7 @@ static void ShowDemoWindowLayout()
ImGui::Text("can fit within a text block.");
// Aligned to arbitrary position. Easy/cheap column.
+ IMGUI_DEMO_MARKER("Layout/Basic Horizontal Layout/SameLine (with offset)");
ImGui::Text("Aligned");
ImGui::SameLine(150); ImGui::Text("x=150");
ImGui::SameLine(300); ImGui::Text("x=300");
@@ -2571,6 +2723,7 @@ static void ShowDemoWindowLayout()
ImGui::SameLine(300); ImGui::SmallButton("x=300");
// Checkbox
+ IMGUI_DEMO_MARKER("Layout/Basic Horizontal Layout/SameLine (more)");
static bool c1 = false, c2 = false, c3 = false, c4 = false;
ImGui::Checkbox("My", &c1); ImGui::SameLine();
ImGui::Checkbox("Tailor", &c2); ImGui::SameLine();
@@ -2602,6 +2755,7 @@ static void ShowDemoWindowLayout()
ImGui::PopItemWidth();
// Dummy
+ IMGUI_DEMO_MARKER("Layout/Basic Horizontal Layout/Dummy");
ImVec2 button_sz(40, 40);
ImGui::Button("A", button_sz); ImGui::SameLine();
ImGui::Dummy(button_sz); ImGui::SameLine();
@@ -2609,7 +2763,8 @@ static void ShowDemoWindowLayout()
// Manually wrapping
// (we should eventually provide this as an automatic layout feature, but for now you can do it manually)
- ImGui::Text("Manually wrapping:");
+ IMGUI_DEMO_MARKER("Layout/Basic Horizontal Layout/Manual wrapping");
+ ImGui::Text("Manual wrapping:");
ImGuiStyle& style = ImGui::GetStyle();
int buttons_count = 20;
float window_visible_x2 = ImGui::GetWindowPos().x + ImGui::GetWindowContentRegionMax().x;
@@ -2627,6 +2782,7 @@ static void ShowDemoWindowLayout()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Layout/Groups");
if (ImGui::TreeNode("Groups"))
{
HelpMarker(
@@ -2674,6 +2830,7 @@ static void ShowDemoWindowLayout()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Layout/Text Baseline Alignment");
if (ImGui::TreeNode("Text Baseline Alignment"))
{
{
@@ -2792,9 +2949,11 @@ static void ShowDemoWindowLayout()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Layout/Scrolling");
if (ImGui::TreeNode("Scrolling"))
{
// Vertical scroll functions
+ IMGUI_DEMO_MARKER("Layout/Scrolling/Vertical");
HelpMarker("Use SetScrollHereY() or SetScrollFromPosY() to scroll to a given vertical position.");
static int track_item = 50;
@@ -2867,6 +3026,7 @@ static void ShowDemoWindowLayout()
ImGui::PopID();
// Horizontal scroll functions
+ IMGUI_DEMO_MARKER("Layout/Scrolling/Horizontal");
ImGui::Spacing();
HelpMarker(
"Use SetScrollHereX() or SetScrollFromPosX() to scroll to a given horizontal position.\n\n"
@@ -2912,6 +3072,7 @@ static void ShowDemoWindowLayout()
ImGui::PopID();
// Miscellaneous Horizontal Scrolling Demo
+ IMGUI_DEMO_MARKER("Layout/Scrolling/Horizontal (more)");
HelpMarker(
"Horizontal scrolling for a window is enabled via the ImGuiWindowFlags_HorizontalScrollbar flag.\n\n"
"You may want to also explicitly specify content width by using SetNextWindowContentWidth() before Begin().");
@@ -2986,6 +3147,7 @@ static void ShowDemoWindowLayout()
if (explicit_content_size)
ImGui::SetNextWindowContentSize(ImVec2(contents_size_x, 0.0f));
ImGui::Begin("Horizontal contents size demo window", &show_horizontal_contents_size_demo_window, show_h_scrollbar ? ImGuiWindowFlags_HorizontalScrollbar : 0);
+ IMGUI_DEMO_MARKER("Layout/Scrolling/Horizontal contents size demo window");
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(2, 0));
ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2, 0));
HelpMarker("Test of different widgets react and impact the work rectangle growing when horizontal scrolling is enabled.\n\nUse 'Metrics->Tools->Show windows rectangles' to visualize rectangles.");
@@ -3072,6 +3234,7 @@ static void ShowDemoWindowLayout()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Layout/Clipping");
if (ImGui::TreeNode("Clipping"))
{
static ImVec2 size(100.0f, 100.0f);
@@ -3079,59 +3242,58 @@ static void ShowDemoWindowLayout()
ImGui::DragFloat2("size", (float*)&size, 0.5f, 1.0f, 200.0f, "%.0f");
ImGui::TextWrapped("(Click and drag to scroll)");
+ HelpMarker(
+ "(Left) Using ImGui::PushClipRect():\n"
+ "Will alter ImGui hit-testing logic + ImDrawList rendering.\n"
+ "(use this if you want your clipping rectangle to affect interactions)\n\n"
+ "(Center) Using ImDrawList::PushClipRect():\n"
+ "Will alter ImDrawList rendering only.\n"
+ "(use this as a shortcut if you are only using ImDrawList calls)\n\n"
+ "(Right) Using ImDrawList::AddText() with a fine ClipRect:\n"
+ "Will alter only this specific ImDrawList::AddText() rendering.\n"
+ "This is often used internally to avoid altering the clipping rectangle and minimize draw calls.");
+
for (int n = 0; n < 3; n++)
{
if (n > 0)
ImGui::SameLine();
- ImGui::PushID(n);
- ImGui::BeginGroup(); // Lock X position
- ImGui::InvisibleButton("##empty", size);
+ ImGui::PushID(n);
+ ImGui::InvisibleButton("##canvas", size);
if (ImGui::IsItemActive() && ImGui::IsMouseDragging(ImGuiMouseButton_Left))
{
offset.x += ImGui::GetIO().MouseDelta.x;
offset.y += ImGui::GetIO().MouseDelta.y;
}
+ ImGui::PopID();
+ if (!ImGui::IsItemVisible()) // Skip rendering as ImDrawList elements are not clipped.
+ continue;
+
const ImVec2 p0 = ImGui::GetItemRectMin();
const ImVec2 p1 = ImGui::GetItemRectMax();
const char* text_str = "Line 1 hello\nLine 2 clip me!";
const ImVec2 text_pos = ImVec2(p0.x + offset.x, p0.y + offset.y);
ImDrawList* draw_list = ImGui::GetWindowDrawList();
-
switch (n)
{
case 0:
- HelpMarker(
- "Using ImGui::PushClipRect():\n"
- "Will alter ImGui hit-testing logic + ImDrawList rendering.\n"
- "(use this if you want your clipping rectangle to affect interactions)");
ImGui::PushClipRect(p0, p1, true);
draw_list->AddRectFilled(p0, p1, IM_COL32(90, 90, 120, 255));
draw_list->AddText(text_pos, IM_COL32_WHITE, text_str);
ImGui::PopClipRect();
break;
case 1:
- HelpMarker(
- "Using ImDrawList::PushClipRect():\n"
- "Will alter ImDrawList rendering only.\n"
- "(use this as a shortcut if you are only using ImDrawList calls)");
draw_list->PushClipRect(p0, p1, true);
draw_list->AddRectFilled(p0, p1, IM_COL32(90, 90, 120, 255));
draw_list->AddText(text_pos, IM_COL32_WHITE, text_str);
draw_list->PopClipRect();
break;
case 2:
- HelpMarker(
- "Using ImDrawList::AddText() with a fine ClipRect:\n"
- "Will alter only this specific ImDrawList::AddText() rendering.\n"
- "(this is often used internally to avoid altering the clipping rectangle and minimize draw calls)");
ImVec4 clip_rect(p0.x, p0.y, p1.x, p1.y); // AddText() takes a ImVec4* here so let's convert.
draw_list->AddRectFilled(p0, p1, IM_COL32(90, 90, 120, 255));
draw_list->AddText(ImGui::GetFont(), ImGui::GetFontSize(), text_pos, IM_COL32_WHITE, text_str, NULL, 0.0f, &clip_rect);
break;
}
- ImGui::EndGroup();
- ImGui::PopID();
}
ImGui::TreePop();
@@ -3140,6 +3302,7 @@ static void ShowDemoWindowLayout()
static void ShowDemoWindowPopups()
{
+ IMGUI_DEMO_MARKER("Popups");
if (!ImGui::CollapsingHeader("Popups & Modal windows"))
return;
@@ -3161,6 +3324,7 @@ static void ShowDemoWindowPopups()
// With popups we have to go through a library call (here OpenPopup) to manipulate the visibility state.
// This may be a bit confusing at first but it should quickly make sense. Follow on the examples below.
+ IMGUI_DEMO_MARKER("Popups/Popups");
if (ImGui::TreeNode("Popups"))
{
ImGui::TextWrapped(
@@ -3229,17 +3393,33 @@ static void ShowDemoWindowPopups()
}
// Call the more complete ShowExampleMenuFile which we use in various places of this demo
- if (ImGui::Button("File Menu.."))
+ if (ImGui::Button("With a menu.."))
ImGui::OpenPopup("my_file_popup");
- if (ImGui::BeginPopup("my_file_popup"))
+ if (ImGui::BeginPopup("my_file_popup", ImGuiWindowFlags_MenuBar))
{
- ShowExampleMenuFile();
+ if (ImGui::BeginMenuBar())
+ {
+ if (ImGui::BeginMenu("File"))
+ {
+ ShowExampleMenuFile();
+ ImGui::EndMenu();
+ }
+ if (ImGui::BeginMenu("Edit"))
+ {
+ ImGui::MenuItem("Dummy");
+ ImGui::EndMenu();
+ }
+ ImGui::EndMenuBar();
+ }
+ ImGui::Text("Hello from popup!");
+ ImGui::Button("This is a dummy button..");
ImGui::EndPopup();
}
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Popups/Context menus");
if (ImGui::TreeNode("Context menus"))
{
HelpMarker("\"Context\" functions are simple helpers to associate a Popup to a given Item or Window identifier.");
@@ -3250,7 +3430,7 @@ static void ShowDemoWindowPopups()
// if (IsItemHovered() && IsMouseReleased(ImGuiMouseButton_Right))
// OpenPopup(id);
// return BeginPopup(id);
- // For advanced advanced uses you may want to replicate and customize this code.
+ // For advanced uses you may want to replicate and customize this code.
// See more details in BeginPopupContextItem().
// Example 1
@@ -3279,7 +3459,7 @@ static void ShowDemoWindowPopups()
{
HelpMarker("Text() elements don't have stable identifiers so we need to provide one.");
static float value = 0.5f;
- ImGui::Text("Value = %.3f <-- (1) right-click this value", value);
+ ImGui::Text("Value = %.3f <-- (1) right-click this text", value);
if (ImGui::BeginPopupContextItem("my popup"))
{
if (ImGui::Selectable("Set to zero")) value = 0.0f;
@@ -3324,6 +3504,7 @@ static void ShowDemoWindowPopups()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Popups/Modals");
if (ImGui::TreeNode("Modals"))
{
ImGui::TextWrapped("Modal windows are like popups but the user cannot close them by clicking outside.");
@@ -3399,31 +3580,25 @@ static void ShowDemoWindowPopups()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Popups/Menus inside a regular window");
if (ImGui::TreeNode("Menus inside a regular window"))
{
ImGui::TextWrapped("Below we are testing adding menu items to a regular window. It's rather unusual but should work!");
ImGui::Separator();
- // Note: As a quirk in this very specific example, we want to differentiate the parent of this menu from the
- // parent of the various popup menus above. To do so we are encloding the items in a PushID()/PopID() block
- // to make them two different menusets. If we don't, opening any popup above and hovering our menu here would
- // open it. This is because once a menu is active, we allow to switch to a sibling menu by just hovering on it,
- // which is the desired behavior for regular menus.
- ImGui::PushID("foo");
ImGui::MenuItem("Menu item", "CTRL+M");
if (ImGui::BeginMenu("Menu inside a regular window"))
{
ShowExampleMenuFile();
ImGui::EndMenu();
}
- ImGui::PopID();
ImGui::Separator();
ImGui::TreePop();
}
}
// Dummy data structure that we use for the Table demo.
-// (pre-C++11 doesn't allow us to instantiate ImVector<MyItem> template if this structure if defined inside the demo function)
+// (pre-C++11 doesn't allow us to instantiate ImVector<MyItem> template if this structure is defined inside the demo function)
namespace
{
// We are passing our own identifier to TableSetupColumn() to facilitate identifying columns in the sorting code.
@@ -3578,6 +3753,7 @@ static void ShowTableColumnsStatusFlags(ImGuiTableColumnFlags flags)
static void ShowDemoWindowTables()
{
//ImGui::SetNextItemOpen(true, ImGuiCond_Once);
+ IMGUI_DEMO_MARKER("Tables");
if (!ImGui::CollapsingHeader("Tables & Columns"))
return;
@@ -3617,6 +3793,7 @@ static void ShowDemoWindowTables()
// Demos
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Basic");
if (ImGui::TreeNode("Basic"))
{
// Here we will showcase three different ways to output a table.
@@ -3640,7 +3817,7 @@ static void ShowDemoWindowTables()
}
// [Method 2] Using TableNextColumn() called multiple times, instead of using a for loop + TableSetColumnIndex().
- // This is generally more convenient when you have code manually submitting the contents of each columns.
+ // This is generally more convenient when you have code manually submitting the contents of each column.
HelpMarker("Using TableNextRow() + calling TableNextColumn() _before_ each cell, manually.");
if (ImGui::BeginTable("table2", 3))
{
@@ -3658,10 +3835,10 @@ static void ShowDemoWindowTables()
}
// [Method 3] We call TableNextColumn() _before_ each cell. We never call TableNextRow(),
- // as TableNextColumn() will automatically wrap around and create new roes as needed.
+ // as TableNextColumn() will automatically wrap around and create new rows as needed.
// This is generally more convenient when your cells all contains the same type of data.
HelpMarker(
- "Only using TableNextColumn(), which tends to be convenient for tables where every cells contains the same type of contents.\n"
+ "Only using TableNextColumn(), which tends to be convenient for tables where every cell contains the same type of contents.\n"
"This is also more similar to the old NextColumn() function of the Columns API, and provided to facilitate the Columns->Tables API transition.");
if (ImGui::BeginTable("table3", 3))
{
@@ -3678,6 +3855,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Borders, background");
if (ImGui::TreeNode("Borders, background"))
{
// Expose a few Borders related flags interactively
@@ -3712,7 +3890,7 @@ static void ShowDemoWindowTables()
ImGui::SameLine(); ImGui::RadioButton("Text", &contents_type, CT_Text);
ImGui::SameLine(); ImGui::RadioButton("FillButton", &contents_type, CT_FillButton);
ImGui::Checkbox("Display headers", &display_headers);
- ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBody", &flags, ImGuiTableFlags_NoBordersInBody); ImGui::SameLine(); HelpMarker("Disable vertical borders in columns Body (borders will always appears in Headers");
+ ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBody", &flags, ImGuiTableFlags_NoBordersInBody); ImGui::SameLine(); HelpMarker("Disable vertical borders in columns Body (borders will always appear in Headers");
PopStyleCompact();
if (ImGui::BeginTable("table1", 3, flags))
@@ -3737,7 +3915,7 @@ static void ShowDemoWindowTables()
sprintf(buf, "Hello %d,%d", column, row);
if (contents_type == CT_Text)
ImGui::TextUnformatted(buf);
- else if (contents_type)
+ else if (contents_type == CT_FillButton)
ImGui::Button(buf, ImVec2(-FLT_MIN, 0.0f));
}
}
@@ -3748,10 +3926,11 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Resizable, stretch");
if (ImGui::TreeNode("Resizable, stretch"))
{
- // By default, if we don't enable ScrollX the sizing policy for each columns is "Stretch"
- // Each columns maintain a sizing weight, and they will occupy all available width.
+ // By default, if we don't enable ScrollX the sizing policy for each column is "Stretch"
+ // All columns maintain a sizing weight, and they will occupy all available width.
static ImGuiTableFlags flags = ImGuiTableFlags_SizingStretchSame | ImGuiTableFlags_Resizable | ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersV | ImGuiTableFlags_ContextMenuInBody;
PushStyleCompact();
ImGui::CheckboxFlags("ImGuiTableFlags_Resizable", &flags, ImGuiTableFlags_Resizable);
@@ -3777,6 +3956,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Resizable, fixed");
if (ImGui::TreeNode("Resizable, fixed"))
{
// Here we use ImGuiTableFlags_SizingFixedFit (even though _ScrollX is not set)
@@ -3810,6 +3990,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Resizable, mixed");
if (ImGui::TreeNode("Resizable, mixed"))
{
HelpMarker(
@@ -3859,6 +4040,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Reorderable, hideable, with headers");
if (ImGui::TreeNode("Reorderable, hideable, with headers"))
{
HelpMarker(
@@ -3870,7 +4052,7 @@ static void ShowDemoWindowTables()
ImGui::CheckboxFlags("ImGuiTableFlags_Reorderable", &flags, ImGuiTableFlags_Reorderable);
ImGui::CheckboxFlags("ImGuiTableFlags_Hideable", &flags, ImGuiTableFlags_Hideable);
ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBody", &flags, ImGuiTableFlags_NoBordersInBody);
- ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBodyUntilResize", &flags, ImGuiTableFlags_NoBordersInBodyUntilResize); ImGui::SameLine(); HelpMarker("Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers)");
+ ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBodyUntilResize", &flags, ImGuiTableFlags_NoBordersInBodyUntilResize); ImGui::SameLine(); HelpMarker("Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers)");
PopStyleCompact();
if (ImGui::BeginTable("table1", 3, flags))
@@ -3916,6 +4098,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Padding");
if (ImGui::TreeNode("Padding"))
{
// First example: showcase use of padding flags and effect of BorderOuterV/BorderInnerV on X padding.
@@ -3927,7 +4110,7 @@ static void ShowDemoWindowTables()
"- any form of row selection\n"
"Because of this, activating BorderOuterV sets the default to PadOuterX. Using PadOuterX or NoPadOuterX you can override the default.\n\n"
"Actual padding values are using style.CellPadding.\n\n"
- "In this demo we don't show horizontal borders to emphasis how they don't affect default horizontal padding.");
+ "In this demo we don't show horizontal borders to emphasize how they don't affect default horizontal padding.");
static ImGuiTableFlags flags1 = ImGuiTableFlags_BordersV;
PushStyleCompact();
@@ -4024,6 +4207,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Explicit widths");
if (ImGui::TreeNode("Sizing policies"))
{
static ImGuiTableFlags flags1 = ImGuiTableFlags_BordersV | ImGuiTableFlags_BordersOuterH | ImGuiTableFlags_RowBg | ImGuiTableFlags_ContextMenuInBody;
@@ -4127,6 +4311,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Vertical scrolling, with clipping");
if (ImGui::TreeNode("Vertical scrolling, with clipping"))
{
HelpMarker("Here we activate ScrollY, which will create a child window container to allow hosting scrollable contents.\n\nWe also demonstrate using ImGuiListClipper to virtualize the submission of many items.");
@@ -4169,6 +4354,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Horizontal scrolling");
if (ImGui::TreeNode("Horizontal scrolling"))
{
HelpMarker(
@@ -4257,6 +4443,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Columns flags");
if (ImGui::TreeNode("Columns flags"))
{
// Create a first table just to show all the options/flags we want to make visible in our example!
@@ -4272,14 +4459,16 @@ static void ShowDemoWindowTables()
{
ImGui::TableNextColumn();
ImGui::PushID(column);
- ImGui::AlignTextToFramePadding(); // FIXME-TABLE: Workaround for wrong text baseline propagation
+ ImGui::AlignTextToFramePadding(); // FIXME-TABLE: Workaround for wrong text baseline propagation across columns
ImGui::Text("'%s'", column_names[column]);
ImGui::Spacing();
ImGui::Text("Input flags:");
EditTableColumnsFlags(&column_flags[column]);
ImGui::Spacing();
ImGui::Text("Output flags:");
+ ImGui::BeginDisabled();
ShowTableColumnsStatusFlags(column_flags_out[column]);
+ ImGui::EndDisabled();
ImGui::PopID();
}
PopStyleCompact();
@@ -4321,6 +4510,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Columns widths");
if (ImGui::TreeNode("Columns widths"))
{
HelpMarker("Using TableSetupColumn() to setup default width.");
@@ -4386,9 +4576,10 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Nested tables");
if (ImGui::TreeNode("Nested tables"))
{
- HelpMarker("This demonstrate embedding a table into another table cell.");
+ HelpMarker("This demonstrates embedding a table into another table cell.");
if (ImGui::BeginTable("table_nested1", 2, ImGuiTableFlags_Borders | ImGuiTableFlags_Resizable | ImGuiTableFlags_Reorderable | ImGuiTableFlags_Hideable))
{
@@ -4430,9 +4621,10 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Row height");
if (ImGui::TreeNode("Row height"))
{
- HelpMarker("You can pass a 'min_row_height' to TableNextRow().\n\nRows are padded with 'style.CellPadding.y' on top and bottom, so effectively the minimum row height will always be >= 'style.CellPadding.y * 2.0f'.\n\nWe cannot honor a _maximum_ row height as that would requires a unique clipping rectangle per row.");
+ HelpMarker("You can pass a 'min_row_height' to TableNextRow().\n\nRows are padded with 'style.CellPadding.y' on top and bottom, so effectively the minimum row height will always be >= 'style.CellPadding.y * 2.0f'.\n\nWe cannot honor a _maximum_ row height as that would require a unique clipping rectangle per row.");
if (ImGui::BeginTable("table_row_height", 1, ImGuiTableFlags_BordersOuter | ImGuiTableFlags_BordersInnerV))
{
for (int row = 0; row < 10; row++)
@@ -4449,6 +4641,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Outer size");
if (ImGui::TreeNode("Outer size"))
{
// Showcasing use of ImGuiTableFlags_NoHostExtendX and ImGuiTableFlags_NoHostExtendY
@@ -4515,6 +4708,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Background color");
if (ImGui::TreeNode("Background color"))
{
static ImGuiTableFlags flags = ImGuiTableFlags_RowBg;
@@ -4572,6 +4766,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Tree view");
if (ImGui::TreeNode("Tree view"))
{
static ImGuiTableFlags flags = ImGuiTableFlags_BordersV | ImGuiTableFlags_BordersOuterH | ImGuiTableFlags_Resizable | ImGuiTableFlags_RowBg | ImGuiTableFlags_NoBordersInBody;
@@ -4643,6 +4838,7 @@ static void ShowDemoWindowTables()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Item width");
if (ImGui::TreeNode("Item width"))
{
HelpMarker(
@@ -4677,7 +4873,7 @@ static void ShowDemoWindowTables()
ImGui::TableSetColumnIndex(1);
ImGui::SliderFloat("float1", &dummy_f, 0.0f, 1.0f);
ImGui::TableSetColumnIndex(2);
- ImGui::SliderFloat("float2", &dummy_f, 0.0f, 1.0f);
+ ImGui::SliderFloat("##float2", &dummy_f, 0.0f, 1.0f); // No visible label since right-aligned
ImGui::PopID();
}
ImGui::EndTable();
@@ -4688,6 +4884,7 @@ static void ShowDemoWindowTables()
// Demonstrate using TableHeader() calls instead of TableHeadersRow()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Custom headers");
if (ImGui::TreeNode("Custom headers"))
{
const int COLUMNS_COUNT = 3;
@@ -4735,6 +4932,7 @@ static void ShowDemoWindowTables()
// Demonstrate creating custom context menus inside columns, while playing it nice with context menus provided by TableHeadersRow()/TableHeader()
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Context menus");
if (ImGui::TreeNode("Context menus"))
{
HelpMarker("By default, right-clicking over a TableHeadersRow()/TableHeader() line will open the default context-menu.\nUsing ImGuiTableFlags_ContextMenuInBody we also allow right-clicking over columns body.");
@@ -4841,6 +5039,7 @@ static void ShowDemoWindowTables()
// Demonstrate creating multiple tables with the same ID
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Synced instances");
if (ImGui::TreeNode("Synced instances"))
{
HelpMarker("Multiple tables with the same identifier will share their settings, width, visibility, order etc.");
@@ -4876,6 +5075,7 @@ static void ShowDemoWindowTables()
};
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Sorting");
if (ImGui::TreeNode("Sorting"))
{
// Create item list
@@ -4963,6 +5163,7 @@ static void ShowDemoWindowTables()
//ImGui::SetNextItemOpen(true, ImGuiCond_Once); // [DEBUG]
if (open_action != -1)
ImGui::SetNextItemOpen(open_action != 0);
+ IMGUI_DEMO_MARKER("Tables/Advanced");
if (ImGui::TreeNode("Advanced"))
{
static ImGuiTableFlags flags =
@@ -4985,7 +5186,7 @@ static void ShowDemoWindowTables()
static bool show_headers = true;
static bool show_wrapped_text = false;
//static ImGuiTextFilter filter;
- //ImGui::SetNextItemOpen(true, ImGuiCond_Once); // FIXME-TABLE: Enabling this results in initial clipped first pass on table which tend to affects column sizing
+ //ImGui::SetNextItemOpen(true, ImGuiCond_Once); // FIXME-TABLE: Enabling this results in initial clipped first pass on table which tend to affect column sizing
if (ImGui::TreeNode("Options"))
{
// Make the UI compact because there are so many fields
@@ -5012,8 +5213,8 @@ static void ShowDemoWindowTables()
ImGui::CheckboxFlags("ImGuiTableFlags_BordersH", &flags, ImGuiTableFlags_BordersH);
ImGui::CheckboxFlags("ImGuiTableFlags_BordersOuterH", &flags, ImGuiTableFlags_BordersOuterH);
ImGui::CheckboxFlags("ImGuiTableFlags_BordersInnerH", &flags, ImGuiTableFlags_BordersInnerH);
- ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBody", &flags, ImGuiTableFlags_NoBordersInBody); ImGui::SameLine(); HelpMarker("Disable vertical borders in columns Body (borders will always appears in Headers");
- ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBodyUntilResize", &flags, ImGuiTableFlags_NoBordersInBodyUntilResize); ImGui::SameLine(); HelpMarker("Disable vertical borders in columns Body until hovered for resize (borders will always appears in Headers)");
+ ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBody", &flags, ImGuiTableFlags_NoBordersInBody); ImGui::SameLine(); HelpMarker("Disable vertical borders in columns Body (borders will always appear in Headers");
+ ImGui::CheckboxFlags("ImGuiTableFlags_NoBordersInBodyUntilResize", &flags, ImGuiTableFlags_NoBordersInBodyUntilResize); ImGui::SameLine(); HelpMarker("Disable vertical borders in columns Body until hovered for resize (borders will always appear in Headers)");
ImGui::TreePop();
}
@@ -5076,7 +5277,7 @@ static void ShowDemoWindowTables()
HelpMarker("If scrolling is disabled (ScrollX and ScrollY not set):\n"
"- The table is output directly in the parent window.\n"
"- OuterSize.x < 0.0f will right-align the table.\n"
- "- OuterSize.x = 0.0f will narrow fit the table unless there are any Stretch column.\n"
+ "- OuterSize.x = 0.0f will narrow fit the table unless there are any Stretch columns.\n"
"- OuterSize.y then becomes the minimum size for the table, which will extend vertically if there are more rows (unless NoHostExtendY is set).");
// From a user point of view we will tend to use 'inner_width' differently depending on whether our table is embedding scrolling.
@@ -5279,6 +5480,7 @@ static void ShowDemoWindowTables()
// [2020: Columns are under-featured and not maintained. Prefer using the more flexible and powerful BeginTable() API!]
static void ShowDemoWindowColumns()
{
+ IMGUI_DEMO_MARKER("Columns (legacy API)");
bool open = ImGui::TreeNode("Legacy Columns API");
ImGui::SameLine();
HelpMarker("Columns() is an old API! Prefer using the more flexible and powerful BeginTable() API!");
@@ -5286,6 +5488,7 @@ static void ShowDemoWindowColumns()
return;
// Basic columns
+ IMGUI_DEMO_MARKER("Columns (legacy API)/Basic");
if (ImGui::TreeNode("Basic"))
{
ImGui::Text("Without border:");
@@ -5330,6 +5533,7 @@ static void ShowDemoWindowColumns()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Columns (legacy API)/Borders");
if (ImGui::TreeNode("Borders"))
{
// NB: Future columns API should allow automatic horizontal borders.
@@ -5365,6 +5569,7 @@ static void ShowDemoWindowColumns()
}
// Create multiple items in a same cell before switching to next column
+ IMGUI_DEMO_MARKER("Columns (legacy API)/Mixed items");
if (ImGui::TreeNode("Mixed items"))
{
ImGui::Columns(3, "mixed");
@@ -5396,6 +5601,7 @@ static void ShowDemoWindowColumns()
}
// Word wrapping
+ IMGUI_DEMO_MARKER("Columns (legacy API)/Word-wrapping");
if (ImGui::TreeNode("Word-wrapping"))
{
ImGui::Columns(2, "word-wrapping");
@@ -5410,6 +5616,7 @@ static void ShowDemoWindowColumns()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Columns (legacy API)/Horizontal Scrolling");
if (ImGui::TreeNode("Horizontal Scrolling"))
{
ImGui::SetNextWindowContentSize(ImVec2(1500.0f, 0.0f));
@@ -5435,6 +5642,7 @@ static void ShowDemoWindowColumns()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Columns (legacy API)/Tree");
if (ImGui::TreeNode("Tree"))
{
ImGui::Columns(2, "tree", true);
@@ -5474,38 +5682,31 @@ static void ShowDemoWindowColumns()
ImGui::TreePop();
}
-static void ShowDemoWindowMisc()
-{
- if (ImGui::CollapsingHeader("Filtering"))
- {
- // Helper class to easy setup a text filter.
- // You may want to implement a more feature-full filtering scheme in your own application.
- static ImGuiTextFilter filter;
- ImGui::Text("Filter usage:\n"
- " \"\" display all lines\n"
- " \"xxx\" display lines containing \"xxx\"\n"
- " \"xxx,yyy\" display lines containing \"xxx\" or \"yyy\"\n"
- " \"-xxx\" hide lines containing \"xxx\"");
- filter.Draw();
- const char* lines[] = { "aaa1.c", "bbb1.c", "ccc1.c", "aaa2.cpp", "bbb2.cpp", "ccc2.cpp", "abc.h", "hello, world" };
- for (int i = 0; i < IM_ARRAYSIZE(lines); i++)
- if (filter.PassFilter(lines[i]))
- ImGui::BulletText("%s", lines[i]);
- }
+namespace ImGui { extern ImGuiKeyData* GetKeyData(ImGuiKey key); }
+static void ShowDemoWindowInputs()
+{
+ IMGUI_DEMO_MARKER("Inputs, Navigation & Focus");
if (ImGui::CollapsingHeader("Inputs, Navigation & Focus"))
{
ImGuiIO& io = ImGui::GetIO();
// Display ImGuiIO output flags
- ImGui::Text("WantCaptureMouse: %d", io.WantCaptureMouse);
- ImGui::Text("WantCaptureMouseUnlessPopupClose: %d", io.WantCaptureMouseUnlessPopupClose);
- ImGui::Text("WantCaptureKeyboard: %d", io.WantCaptureKeyboard);
- ImGui::Text("WantTextInput: %d", io.WantTextInput);
- ImGui::Text("WantSetMousePos: %d", io.WantSetMousePos);
- ImGui::Text("NavActive: %d, NavVisible: %d", io.NavActive, io.NavVisible);
+ IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Output");
+ ImGui::SetNextItemOpen(true, ImGuiCond_Once);
+ if (ImGui::TreeNode("Output"))
+ {
+ 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())
@@ -5513,37 +5714,152 @@ static void ShowDemoWindowMisc()
else
ImGui::Text("Mouse pos: <INVALID>");
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 clicked:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseClicked(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); }
- ImGui::Text("Mouse dblclick:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseDoubleClicked(i)){ ImGui::SameLine(); ImGui::Text("b%d", i); }
- ImGui::Text("Mouse released:"); for (int i = 0; i < IM_ARRAYSIZE(io.MouseDown); i++) if (ImGui::IsMouseReleased(i)) { ImGui::SameLine(); ImGui::Text("b%d", i); }
+
+ 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::TreePop();
}
- // Display Keyboard/Mouse state
- if (ImGui::TreeNode("Keyboard & Navigation State"))
+ // Display mouse cursors
+ IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Mouse Cursors");
+ if (ImGui::TreeNode("Mouse Cursors"))
{
- ImGui::Text("Keys down:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (ImGui::IsKeyDown(i)) { ImGui::SameLine(); ImGui::Text("%d (0x%X) (%.02f secs)", i, i, io.KeysDownDuration[i]); }
- ImGui::Text("Keys pressed:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (ImGui::IsKeyPressed(i)) { ImGui::SameLine(); ImGui::Text("%d (0x%X)", i, i); }
- ImGui::Text("Keys release:"); for (int i = 0; i < IM_ARRAYSIZE(io.KeysDown); i++) if (ImGui::IsKeyReleased(i)) { ImGui::SameLine(); ImGui::Text("%d (0x%X)", i, i); }
+ const char* mouse_cursors_names[] = { "Arrow", "TextInput", "ResizeAll", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE", "Hand", "NotAllowed" };
+ IM_ASSERT(IM_ARRAYSIZE(mouse_cursors_names) == ImGuiMouseCursor_COUNT);
+
+ ImGuiMouseCursor current = ImGui::GetMouseCursor();
+ ImGui::Text("Current mouse cursor = %d: %s", current, mouse_cursors_names[current]);
+ ImGui::BeginDisabled(true);
+ ImGui::CheckboxFlags("io.BackendFlags: HasMouseCursors", &io.BackendFlags, ImGuiBackendFlags_HasMouseCursors);
+ ImGui::EndDisabled();
+
+ ImGui::Text("Hover to see mouse cursors:");
+ ImGui::SameLine(); HelpMarker(
+ "Your application can render a different mouse cursor based on what ImGui::GetMouseCursor() returns. "
+ "If software cursor rendering (io.MouseDrawCursor) is set ImGui will draw the right cursor for you, "
+ "otherwise your backend needs to handle it.");
+ for (int i = 0; i < ImGuiMouseCursor_COUNT; i++)
+ {
+ char label[32];
+ sprintf(label, "Mouse cursor %d: %s", i, mouse_cursors_names[i]);
+ ImGui::Bullet(); ImGui::Selectable(label, false);
+ if (ImGui::IsItemHovered())
+ ImGui::SetMouseCursor(i);
+ }
+ 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.
- ImGui::Text("NavInputs down:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputs[i] > 0.0f) { ImGui::SameLine(); ImGui::Text("[%d] %.2f (%.02f secs)", i, io.NavInputs[i], io.NavInputsDownDuration[i]); }
- ImGui::Text("NavInputs pressed:"); for (int i = 0; i < IM_ARRAYSIZE(io.NavInputs); i++) if (io.NavInputsDownDuration[i] == 0.0f) { ImGui::SameLine(); ImGui::Text("[%d]", i); }
+ // 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::Button("Hovering me sets the\nkeyboard capture flag");
- if (ImGui::IsItemHovered())
- ImGui::CaptureKeyboardFromApp(true);
- ImGui::SameLine();
- ImGui::Button("Holding me clears the\nthe keyboard capture flag");
- if (ImGui::IsItemActive())
- ImGui::CaptureKeyboardFromApp(false);
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Tabbing");
if (ImGui::TreeNode("Tabbing"))
{
ImGui::Text("Use TAB/SHIFT+TAB to cycle through keyboard editable fields.");
@@ -5559,6 +5875,7 @@ static void ShowDemoWindowMisc()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Focus from code");
if (ImGui::TreeNode("Focus from code"))
{
bool focus_1 = ImGui::Button("Focus on 1"); ImGui::SameLine();
@@ -5600,6 +5917,7 @@ static void ShowDemoWindowMisc()
ImGui::TreePop();
}
+ IMGUI_DEMO_MARKER("Inputs, Navigation & Focus/Dragging");
if (ImGui::TreeNode("Dragging"))
{
ImGui::TextWrapped("You can use ImGui::GetMouseDragDelta(0) to query for the dragged amount on any widget.");
@@ -5627,29 +5945,6 @@ static void ShowDemoWindowMisc()
ImGui::Text("io.MouseDelta: (%.1f, %.1f)", mouse_delta.x, mouse_delta.y);
ImGui::TreePop();
}
-
- if (ImGui::TreeNode("Mouse cursors"))
- {
- const char* mouse_cursors_names[] = { "Arrow", "TextInput", "ResizeAll", "ResizeNS", "ResizeEW", "ResizeNESW", "ResizeNWSE", "Hand", "NotAllowed" };
- IM_ASSERT(IM_ARRAYSIZE(mouse_cursors_names) == ImGuiMouseCursor_COUNT);
-
- ImGuiMouseCursor current = ImGui::GetMouseCursor();
- ImGui::Text("Current mouse cursor = %d: %s", current, mouse_cursors_names[current]);
- ImGui::Text("Hover to see mouse cursors:");
- ImGui::SameLine(); HelpMarker(
- "Your application can render a different mouse cursor based on what ImGui::GetMouseCursor() returns. "
- "If software cursor rendering (io.MouseDrawCursor) is set ImGui will draw the right cursor for you, "
- "otherwise your backend needs to handle it.");
- for (int i = 0; i < ImGuiMouseCursor_COUNT; i++)
- {
- char label[32];
- sprintf(label, "Mouse cursor %d: %s", i, mouse_cursors_names[i]);
- ImGui::Bullet(); ImGui::Selectable(label, false);
- if (ImGui::IsItemHovered())
- ImGui::SetMouseCursor(i);
- }
- ImGui::TreePop();
- }
}
}
@@ -5665,6 +5960,7 @@ void ImGui::ShowAboutWindow(bool* p_open)
ImGui::End();
return;
}
+ IMGUI_DEMO_MARKER("Tools/About Dear ImGui");
ImGui::Text("Dear ImGui %s", ImGui::GetVersion());
ImGui::Separator();
ImGui::Text("By Omar Cornut and all Dear ImGui contributors.");
@@ -5693,6 +5989,9 @@ void ImGui::ShowAboutWindow(bool* p_open)
#ifdef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
ImGui::Text("define: IMGUI_DISABLE_OBSOLETE_FUNCTIONS");
#endif
+#ifdef IMGUI_DISABLE_OBSOLETE_KEYIO
+ ImGui::Text("define: IMGUI_DISABLE_OBSOLETE_KEYIO");
+#endif
#ifdef IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS
ImGui::Text("define: IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS");
#endif
@@ -5806,7 +6105,7 @@ void ImGui::ShowAboutWindow(bool* p_open)
namespace ImGui { IMGUI_API void ShowFontAtlas(ImFontAtlas* atlas); }
// Demo helper function to select among loaded fonts.
-// Here we use the regular BeginCombo()/EndCombo() api which is more the more flexible one.
+// Here we use the regular BeginCombo()/EndCombo() api which is the more flexible one.
void ImGui::ShowFontSelector(const char* label)
{
ImGuiIO& io = ImGui::GetIO();
@@ -5852,6 +6151,7 @@ bool ImGui::ShowStyleSelector(const char* label)
void ImGui::ShowStyleEditor(ImGuiStyle* ref)
{
+ IMGUI_DEMO_MARKER("Tools/Style Editor");
// You can pass in a reference ImGuiStyle structure to compare to, revert to and save to
// (without a reference style pointer, we will use one compared locally as a reference)
ImGuiStyle& style = ImGui::GetStyle();
@@ -6098,6 +6398,40 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref)
}
//-----------------------------------------------------------------------------
+// [SECTION] User Guide / ShowUserGuide()
+//-----------------------------------------------------------------------------
+
+void ImGui::ShowUserGuide()
+{
+ ImGuiIO& io = ImGui::GetIO();
+ ImGui::BulletText("Double-click on title bar to collapse window.");
+ ImGui::BulletText(
+ "Click and drag on lower corner to resize window\n"
+ "(double-click to auto fit window to its contents).");
+ ImGui::BulletText("CTRL+Click on a slider or drag box to input value as text.");
+ ImGui::BulletText("TAB/SHIFT+TAB to cycle through keyboard editable fields.");
+ ImGui::BulletText("CTRL+Tab to select a window.");
+ if (io.FontAllowUserScaling)
+ ImGui::BulletText("CTRL+Mouse Wheel to zoom window contents.");
+ ImGui::BulletText("While inputing text:\n");
+ ImGui::Indent();
+ ImGui::BulletText("CTRL+Left/Right to word jump.");
+ ImGui::BulletText("CTRL+A or double-click to select all.");
+ ImGui::BulletText("CTRL+X/C/V to use clipboard cut/copy/paste.");
+ ImGui::BulletText("CTRL+Z,CTRL+Y to undo/redo.");
+ ImGui::BulletText("ESCAPE to revert.");
+ ImGui::Unindent();
+ ImGui::BulletText("With keyboard navigation enabled:");
+ ImGui::Indent();
+ ImGui::BulletText("Arrow keys to navigate.");
+ ImGui::BulletText("Space to activate a widget.");
+ ImGui::BulletText("Return to input text into a widget.");
+ ImGui::BulletText("Escape to deactivate a widget, close popup, exit child window.");
+ ImGui::BulletText("Alt to jump to the menu layer of a window.");
+ ImGui::Unindent();
+}
+
+//-----------------------------------------------------------------------------
// [SECTION] Example App: Main Menu Bar / ShowExampleAppMainMenuBar()
//-----------------------------------------------------------------------------
// - ShowExampleAppMainMenuBar()
@@ -6135,6 +6469,7 @@ static void ShowExampleAppMainMenuBar()
// (future version will add explicit flags to BeginMenu() to request processing shortcuts)
static void ShowExampleMenuFile()
{
+ IMGUI_DEMO_MARKER("Examples/Menu");
ImGui::MenuItem("(demo menu)", NULL, false, false);
if (ImGui::MenuItem("New")) {}
if (ImGui::MenuItem("Open", "Ctrl+O")) {}
@@ -6160,6 +6495,7 @@ static void ShowExampleMenuFile()
if (ImGui::MenuItem("Save As..")) {}
ImGui::Separator();
+ IMGUI_DEMO_MARKER("Examples/Menu/Options");
if (ImGui::BeginMenu("Options"))
{
static bool enabled = true;
@@ -6176,6 +6512,7 @@ static void ShowExampleMenuFile()
ImGui::EndMenu();
}
+ IMGUI_DEMO_MARKER("Examples/Menu/Colors");
if (ImGui::BeginMenu("Colors"))
{
float sz = ImGui::GetTextLineHeight();
@@ -6196,6 +6533,7 @@ static void ShowExampleMenuFile()
// In a real code-base using it would make senses to use this feature from very different code locations.
if (ImGui::BeginMenu("Options")) // <-- Append!
{
+ IMGUI_DEMO_MARKER("Examples/Menu/Append to an existing menu");
static bool b = true;
ImGui::Checkbox("SomeOption", &b);
ImGui::EndMenu();
@@ -6228,6 +6566,7 @@ struct ExampleAppConsole
ExampleAppConsole()
{
+ IMGUI_DEMO_MARKER("Examples/Console");
ClearLog();
memset(InputBuf, 0, sizeof(InputBuf));
HistoryPos = -1;
@@ -6326,72 +6665,76 @@ struct ExampleAppConsole
// Reserve enough left-over height for 1 separator + 1 input text
const float footer_height_to_reserve = ImGui::GetStyle().ItemSpacing.y + ImGui::GetFrameHeightWithSpacing();
- ImGui::BeginChild("ScrollingRegion", ImVec2(0, -footer_height_to_reserve), false, ImGuiWindowFlags_HorizontalScrollbar);
- if (ImGui::BeginPopupContextWindow())
+ if (ImGui::BeginChild("ScrollingRegion", ImVec2(0, -footer_height_to_reserve), false, ImGuiWindowFlags_HorizontalScrollbar))
{
- if (ImGui::Selectable("Clear")) ClearLog();
- ImGui::EndPopup();
- }
+ if (ImGui::BeginPopupContextWindow())
+ {
+ if (ImGui::Selectable("Clear")) ClearLog();
+ ImGui::EndPopup();
+ }
- // Display every line as a separate entry so we can change their color or add custom widgets.
- // If you only want raw text you can use ImGui::TextUnformatted(log.begin(), log.end());
- // NB- if you have thousands of entries this approach may be too inefficient and may require user-side clipping
- // to only process visible items. The clipper will automatically measure the height of your first item and then
- // "seek" to display only items in the visible area.
- // To use the clipper we can replace your standard loop:
- // for (int i = 0; i < Items.Size; i++)
- // With:
- // ImGuiListClipper clipper;
- // clipper.Begin(Items.Size);
- // while (clipper.Step())
- // for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
- // - That your items are evenly spaced (same height)
- // - That you have cheap random access to your elements (you can access them given their index,
- // without processing all the ones before)
- // You cannot this code as-is if a filter is active because it breaks the 'cheap random-access' property.
- // We would need random-access on the post-filtered list.
- // A typical application wanting coarse clipping and filtering may want to pre-compute an array of indices
- // or offsets of items that passed the filtering test, recomputing this array when user changes the filter,
- // and appending newly elements as they are inserted. This is left as a task to the user until we can manage
- // to improve this example code!
- // If your items are of variable height:
- // - Split them into same height items would be simpler and facilitate random-seeking into your list.
- // - Consider using manual call to IsRectVisible() and skipping extraneous decoration from your items.
- ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4, 1)); // Tighten spacing
- if (copy_to_clipboard)
- ImGui::LogToClipboard();
- for (int i = 0; i < Items.Size; i++)
- {
- const char* item = Items[i];
- if (!Filter.PassFilter(item))
- continue;
+ // Display every line as a separate entry so we can change their color or add custom widgets.
+ // If you only want raw text you can use ImGui::TextUnformatted(log.begin(), log.end());
+ // NB- if you have thousands of entries this approach may be too inefficient and may require user-side clipping
+ // to only process visible items. The clipper will automatically measure the height of your first item and then
+ // "seek" to display only items in the visible area.
+ // To use the clipper we can replace your standard loop:
+ // for (int i = 0; i < Items.Size; i++)
+ // With:
+ // ImGuiListClipper clipper;
+ // clipper.Begin(Items.Size);
+ // while (clipper.Step())
+ // for (int i = clipper.DisplayStart; i < clipper.DisplayEnd; i++)
+ // - That your items are evenly spaced (same height)
+ // - That you have cheap random access to your elements (you can access them given their index,
+ // without processing all the ones before)
+ // You cannot this code as-is if a filter is active because it breaks the 'cheap random-access' property.
+ // We would need random-access on the post-filtered list.
+ // A typical application wanting coarse clipping and filtering may want to pre-compute an array of indices
+ // or offsets of items that passed the filtering test, recomputing this array when user changes the filter,
+ // and appending newly elements as they are inserted. This is left as a task to the user until we can manage
+ // to improve this example code!
+ // If your items are of variable height:
+ // - Split them into same height items would be simpler and facilitate random-seeking into your list.
+ // - Consider using manual call to IsRectVisible() and skipping extraneous decoration from your items.
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(4, 1)); // Tighten spacing
+ if (copy_to_clipboard)
+ ImGui::LogToClipboard();
+ for (int i = 0; i < Items.Size; i++)
+ {
+ const char* item = Items[i];
+ if (!Filter.PassFilter(item))
+ continue;
- // Normally you would store more information in your item than just a string.
- // (e.g. make Items[] an array of structure, store color/type etc.)
- ImVec4 color;
- bool has_color = false;
- if (strstr(item, "[error]")) { color = ImVec4(1.0f, 0.4f, 0.4f, 1.0f); has_color = true; }
- else if (strncmp(item, "# ", 2) == 0) { color = ImVec4(1.0f, 0.8f, 0.6f, 1.0f); has_color = true; }
- if (has_color)
- ImGui::PushStyleColor(ImGuiCol_Text, color);
- ImGui::TextUnformatted(item);
- if (has_color)
- ImGui::PopStyleColor();
- }
- if (copy_to_clipboard)
- ImGui::LogFinish();
+ // Normally you would store more information in your item than just a string.
+ // (e.g. make Items[] an array of structure, store color/type etc.)
+ ImVec4 color;
+ bool has_color = false;
+ if (strstr(item, "[error]")) { color = ImVec4(1.0f, 0.4f, 0.4f, 1.0f); has_color = true; }
+ else if (strncmp(item, "# ", 2) == 0) { color = ImVec4(1.0f, 0.8f, 0.6f, 1.0f); has_color = true; }
+ if (has_color)
+ ImGui::PushStyleColor(ImGuiCol_Text, color);
+ ImGui::TextUnformatted(item);
+ if (has_color)
+ ImGui::PopStyleColor();
+ }
+ if (copy_to_clipboard)
+ ImGui::LogFinish();
- if (ScrollToBottom || (AutoScroll && ImGui::GetScrollY() >= ImGui::GetScrollMaxY()))
- ImGui::SetScrollHereY(1.0f);
- ScrollToBottom = false;
+ // Keep up at the bottom of the scroll region if we were already at the bottom at the beginning of the frame.
+ // Using a scrollbar or mouse-wheel will take away from the bottom edge.
+ if (ScrollToBottom || (AutoScroll && ImGui::GetScrollY() >= ImGui::GetScrollMaxY()))
+ ImGui::SetScrollHereY(1.0f);
+ ScrollToBottom = false;
- ImGui::PopStyleVar();
+ ImGui::PopStyleVar();
+ }
ImGui::EndChild();
ImGui::Separator();
// Command-line
bool reclaim_focus = false;
- ImGuiInputTextFlags input_text_flags = ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_CallbackHistory;
+ ImGuiInputTextFlags input_text_flags = ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_EscapeClearsAll | ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_CallbackHistory;
if (ImGui::InputText("Input", InputBuf, IM_ARRAYSIZE(InputBuf), input_text_flags, &TextEditCallbackStub, (void*)this))
{
char* s = InputBuf;
@@ -6633,63 +6976,66 @@ struct ExampleAppLog
Filter.Draw("Filter", -100.0f);
ImGui::Separator();
- ImGui::BeginChild("scrolling", ImVec2(0, 0), false, ImGuiWindowFlags_HorizontalScrollbar);
-
- if (clear)
- Clear();
- if (copy)
- ImGui::LogToClipboard();
- ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
- const char* buf = Buf.begin();
- const char* buf_end = Buf.end();
- if (Filter.IsActive())
- {
- // In this example we don't use the clipper when Filter is enabled.
- // This is because we don't have a random access on the result on our filter.
- // A real application processing logs with ten of thousands of entries may want to store the result of
- // search/filter.. especially if the filtering function is not trivial (e.g. reg-exp).
- for (int line_no = 0; line_no < LineOffsets.Size; line_no++)
- {
- const char* line_start = buf + LineOffsets[line_no];
- const char* line_end = (line_no + 1 < LineOffsets.Size) ? (buf + LineOffsets[line_no + 1] - 1) : buf_end;
- if (Filter.PassFilter(line_start, line_end))
- ImGui::TextUnformatted(line_start, line_end);
- }
- }
- else
+ if (ImGui::BeginChild("scrolling", ImVec2(0, 0), false, ImGuiWindowFlags_HorizontalScrollbar))
{
- // The simplest and easy way to display the entire buffer:
- // ImGui::TextUnformatted(buf_begin, buf_end);
- // And it'll just work. TextUnformatted() has specialization for large blob of text and will fast-forward
- // to skip non-visible lines. Here we instead demonstrate using the clipper to only process lines that are
- // within the visible area.
- // If you have tens of thousands of items and their processing cost is non-negligible, coarse clipping them
- // on your side is recommended. Using ImGuiListClipper requires
- // - A) random access into your data
- // - B) items all being the same height,
- // both of which we can handle since we an array pointing to the beginning of each line of text.
- // When using the filter (in the block of code above) we don't have random access into the data to display
- // anymore, which is why we don't use the clipper. Storing or skimming through the search result would make
- // it possible (and would be recommended if you want to search through tens of thousands of entries).
- ImGuiListClipper clipper;
- clipper.Begin(LineOffsets.Size);
- while (clipper.Step())
- {
- for (int line_no = clipper.DisplayStart; line_no < clipper.DisplayEnd; line_no++)
+ if (clear)
+ Clear();
+ if (copy)
+ ImGui::LogToClipboard();
+
+ ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
+ const char* buf = Buf.begin();
+ const char* buf_end = Buf.end();
+ if (Filter.IsActive())
+ {
+ // In this example we don't use the clipper when Filter is enabled.
+ // This is because we don't have random access to the result of our filter.
+ // A real application processing logs with ten of thousands of entries may want to store the result of
+ // search/filter.. especially if the filtering function is not trivial (e.g. reg-exp).
+ for (int line_no = 0; line_no < LineOffsets.Size; line_no++)
{
const char* line_start = buf + LineOffsets[line_no];
const char* line_end = (line_no + 1 < LineOffsets.Size) ? (buf + LineOffsets[line_no + 1] - 1) : buf_end;
- ImGui::TextUnformatted(line_start, line_end);
+ if (Filter.PassFilter(line_start, line_end))
+ ImGui::TextUnformatted(line_start, line_end);
}
}
- clipper.End();
- }
- ImGui::PopStyleVar();
-
- if (AutoScroll && ImGui::GetScrollY() >= ImGui::GetScrollMaxY())
- ImGui::SetScrollHereY(1.0f);
+ else
+ {
+ // The simplest and easy way to display the entire buffer:
+ // ImGui::TextUnformatted(buf_begin, buf_end);
+ // And it'll just work. TextUnformatted() has specialization for large blob of text and will fast-forward
+ // to skip non-visible lines. Here we instead demonstrate using the clipper to only process lines that are
+ // within the visible area.
+ // If you have tens of thousands of items and their processing cost is non-negligible, coarse clipping them
+ // on your side is recommended. Using ImGuiListClipper requires
+ // - A) random access into your data
+ // - B) items all being the same height,
+ // both of which we can handle since we have an array pointing to the beginning of each line of text.
+ // When using the filter (in the block of code above) we don't have random access into the data to display
+ // anymore, which is why we don't use the clipper. Storing or skimming through the search result would make
+ // it possible (and would be recommended if you want to search through tens of thousands of entries).
+ ImGuiListClipper clipper;
+ clipper.Begin(LineOffsets.Size);
+ while (clipper.Step())
+ {
+ for (int line_no = clipper.DisplayStart; line_no < clipper.DisplayEnd; line_no++)
+ {
+ const char* line_start = buf + LineOffsets[line_no];
+ const char* line_end = (line_no + 1 < LineOffsets.Size) ? (buf + LineOffsets[line_no + 1] - 1) : buf_end;
+ ImGui::TextUnformatted(line_start, line_end);
+ }
+ }
+ clipper.End();
+ }
+ ImGui::PopStyleVar();
+ // Keep up at the bottom of the scroll region if we were already at the bottom at the beginning of the frame.
+ // Using a scrollbar or mouse-wheel will take away from the bottom edge.
+ if (AutoScroll && ImGui::GetScrollY() >= ImGui::GetScrollMaxY())
+ ImGui::SetScrollHereY(1.0f);
+ }
ImGui::EndChild();
ImGui::End();
}
@@ -6705,6 +7051,7 @@ static void ShowExampleAppLog(bool* p_open)
// Most of the contents of the window will be added by the log.Draw() call.
ImGui::SetNextWindowSize(ImVec2(500, 400), ImGuiCond_FirstUseEver);
ImGui::Begin("Example: Log", p_open);
+ IMGUI_DEMO_MARKER("Examples/Log");
if (ImGui::SmallButton("[Debug] Add 5 entries"))
{
static int counter = 0;
@@ -6735,6 +7082,7 @@ static void ShowExampleAppLayout(bool* p_open)
ImGui::SetNextWindowSize(ImVec2(500, 440), ImGuiCond_FirstUseEver);
if (ImGui::Begin("Example: Simple layout", p_open, ImGuiWindowFlags_MenuBar))
{
+ IMGUI_DEMO_MARKER("Examples/Simple layout");
if (ImGui::BeginMenuBar())
{
if (ImGui::BeginMenu("File"))
@@ -6851,6 +7199,7 @@ static void ShowExampleAppPropertyEditor(bool* p_open)
ImGui::End();
return;
}
+ IMGUI_DEMO_MARKER("Examples/Property Editor");
HelpMarker(
"This example shows how you may implement a property editor using two columns.\n"
@@ -6886,6 +7235,7 @@ static void ShowExampleAppLongText(bool* p_open)
ImGui::End();
return;
}
+ IMGUI_DEMO_MARKER("Examples/Long text display");
static int test_type = 0;
static ImGuiTextBuffer log;
@@ -6947,6 +7297,7 @@ static void ShowExampleAppAutoResize(bool* p_open)
ImGui::End();
return;
}
+ IMGUI_DEMO_MARKER("Examples/Auto-resizing window");
static int lines = 10;
ImGui::TextUnformatted(
@@ -6964,50 +7315,82 @@ static void ShowExampleAppAutoResize(bool* p_open)
//-----------------------------------------------------------------------------
// Demonstrate creating a window with custom resize constraints.
+// Note that size constraints currently don't work on a docked window (when in 'docking' branch)
static void ShowExampleAppConstrainedResize(bool* p_open)
{
struct CustomConstraints
{
// Helper functions to demonstrate programmatic constraints
- static void Square(ImGuiSizeCallbackData* data) { data->DesiredSize.x = data->DesiredSize.y = IM_MAX(data->DesiredSize.x, data->DesiredSize.y); }
- static void Step(ImGuiSizeCallbackData* data) { float step = (float)(int)(intptr_t)data->UserData; data->DesiredSize = ImVec2((int)(data->DesiredSize.x / step + 0.5f) * step, (int)(data->DesiredSize.y / step + 0.5f) * step); }
+ // FIXME: This doesn't take account of decoration size (e.g. title bar), library should make this easier.
+ static void AspectRatio(ImGuiSizeCallbackData* data) { float aspect_ratio = *(float*)data->UserData; data->DesiredSize.x = IM_MAX(data->CurrentSize.x, data->CurrentSize.y); data->DesiredSize.y = (float)(int)(data->DesiredSize.x / aspect_ratio); }
+ static void Square(ImGuiSizeCallbackData* data) { data->DesiredSize.x = data->DesiredSize.y = IM_MAX(data->CurrentSize.x, data->CurrentSize.y); }
+ static void Step(ImGuiSizeCallbackData* data) { float step = *(float*)data->UserData; data->DesiredSize = ImVec2((int)(data->CurrentSize.x / step + 0.5f) * step, (int)(data->CurrentSize.y / step + 0.5f) * step); }
};
const char* test_desc[] =
{
+ "Between 100x100 and 500x500",
+ "At least 100x100",
"Resize vertical only",
"Resize horizontal only",
- "Width > 100, Height > 100",
- "Width 400-500",
- "Height 400-500",
+ "Width Between 400 and 500",
+ "Custom: Aspect Ratio 16:9",
"Custom: Always Square",
"Custom: Fixed Steps (100)",
};
+ // Options
static bool auto_resize = false;
- static int type = 0;
+ static bool window_padding = true;
+ static int type = 5; // Aspect Ratio
static int display_lines = 10;
- if (type == 0) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 0), ImVec2(-1, FLT_MAX)); // Vertical only
- if (type == 1) ImGui::SetNextWindowSizeConstraints(ImVec2(0, -1), ImVec2(FLT_MAX, -1)); // Horizontal only
- if (type == 2) ImGui::SetNextWindowSizeConstraints(ImVec2(100, 100), ImVec2(FLT_MAX, FLT_MAX)); // Width > 100, Height > 100
- if (type == 3) ImGui::SetNextWindowSizeConstraints(ImVec2(400, -1), ImVec2(500, -1)); // Width 400-500
- if (type == 4) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 400), ImVec2(-1, 500)); // Height 400-500
- if (type == 5) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Square); // Always Square
- if (type == 6) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Step, (void*)(intptr_t)100); // Fixed Step
-
- ImGuiWindowFlags flags = auto_resize ? ImGuiWindowFlags_AlwaysAutoResize : 0;
- if (ImGui::Begin("Example: Constrained Resize", p_open, flags))
- {
- if (ImGui::Button("200x200")) { ImGui::SetWindowSize(ImVec2(200, 200)); } ImGui::SameLine();
- if (ImGui::Button("500x500")) { ImGui::SetWindowSize(ImVec2(500, 500)); } ImGui::SameLine();
- if (ImGui::Button("800x200")) { ImGui::SetWindowSize(ImVec2(800, 200)); }
- ImGui::SetNextItemWidth(200);
- ImGui::Combo("Constraint", &type, test_desc, IM_ARRAYSIZE(test_desc));
- ImGui::SetNextItemWidth(200);
- ImGui::DragInt("Lines", &display_lines, 0.2f, 1, 100);
- ImGui::Checkbox("Auto-resize", &auto_resize);
- for (int i = 0; i < display_lines; i++)
- ImGui::Text("%*sHello, sailor! Making this line long enough for the example.", i * 4, "");
+
+ // Submit constraint
+ float aspect_ratio = 16.0f / 9.0f;
+ float fixed_step = 100.0f;
+ if (type == 0) ImGui::SetNextWindowSizeConstraints(ImVec2(100, 100), ImVec2(500, 500)); // Between 100x100 and 500x500
+ if (type == 1) ImGui::SetNextWindowSizeConstraints(ImVec2(100, 100), ImVec2(FLT_MAX, FLT_MAX)); // Width > 100, Height > 100
+ if (type == 2) ImGui::SetNextWindowSizeConstraints(ImVec2(-1, 0), ImVec2(-1, FLT_MAX)); // Vertical only
+ if (type == 3) ImGui::SetNextWindowSizeConstraints(ImVec2(0, -1), ImVec2(FLT_MAX, -1)); // Horizontal only
+ if (type == 4) ImGui::SetNextWindowSizeConstraints(ImVec2(400, -1), ImVec2(500, -1)); // Width Between and 400 and 500
+ if (type == 5) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::AspectRatio, (void*)&aspect_ratio); // Aspect ratio
+ if (type == 6) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Square); // Always Square
+ if (type == 7) ImGui::SetNextWindowSizeConstraints(ImVec2(0, 0), ImVec2(FLT_MAX, FLT_MAX), CustomConstraints::Step, (void*)&fixed_step); // Fixed Step
+
+ // Submit window
+ if (!window_padding)
+ ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f));
+ const ImGuiWindowFlags window_flags = auto_resize ? ImGuiWindowFlags_AlwaysAutoResize : 0;
+ const bool window_open = ImGui::Begin("Example: Constrained Resize", p_open, window_flags);
+ if (!window_padding)
+ ImGui::PopStyleVar();
+ if (window_open)
+ {
+ IMGUI_DEMO_MARKER("Examples/Constrained Resizing window");
+ if (ImGui::GetIO().KeyShift)
+ {
+ // Display a dummy viewport (in your real app you would likely use ImageButton() to display a texture.
+ ImVec2 avail_size = ImGui::GetContentRegionAvail();
+ ImVec2 pos = ImGui::GetCursorScreenPos();
+ ImGui::ColorButton("viewport", ImVec4(0.5f, 0.2f, 0.5f, 1.0f), ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_NoDragDrop, avail_size);
+ ImGui::SetCursorScreenPos(ImVec2(pos.x + 10, pos.y + 10));
+ ImGui::Text("%.2f x %.2f", avail_size.x, avail_size.y);
+ }
+ else
+ {
+ ImGui::Text("(Hold SHIFT to display a dummy viewport)");
+ if (ImGui::Button("Set 200x200")) { ImGui::SetWindowSize(ImVec2(200, 200)); } ImGui::SameLine();
+ if (ImGui::Button("Set 500x500")) { ImGui::SetWindowSize(ImVec2(500, 500)); } ImGui::SameLine();
+ if (ImGui::Button("Set 800x200")) { ImGui::SetWindowSize(ImVec2(800, 200)); }
+ ImGui::SetNextItemWidth(ImGui::GetFontSize() * 20);
+ ImGui::Combo("Constraint", &type, test_desc, IM_ARRAYSIZE(test_desc));
+ ImGui::SetNextItemWidth(ImGui::GetFontSize() * 20);
+ ImGui::DragInt("Lines", &display_lines, 0.2f, 1, 100);
+ ImGui::Checkbox("Auto-resize", &auto_resize);
+ ImGui::Checkbox("Window padding", &window_padding);
+ for (int i = 0; i < display_lines; i++)
+ ImGui::Text("%*sHello, sailor! Making this line long enough for the example.", i * 4, "");
+ }
}
ImGui::End();
}
@@ -7020,27 +7403,34 @@ static void ShowExampleAppConstrainedResize(bool* p_open)
// + a context-menu to choose which corner of the screen to use.
static void ShowExampleAppSimpleOverlay(bool* p_open)
{
- static int corner = 0;
+ static int location = 0;
ImGuiIO& io = ImGui::GetIO();
ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoNav;
- if (corner != -1)
+ if (location >= 0)
{
const float PAD = 10.0f;
const ImGuiViewport* viewport = ImGui::GetMainViewport();
ImVec2 work_pos = viewport->WorkPos; // Use work area to avoid menu-bar/task-bar, if any!
ImVec2 work_size = viewport->WorkSize;
ImVec2 window_pos, window_pos_pivot;
- window_pos.x = (corner & 1) ? (work_pos.x + work_size.x - PAD) : (work_pos.x + PAD);
- window_pos.y = (corner & 2) ? (work_pos.y + work_size.y - PAD) : (work_pos.y + PAD);
- window_pos_pivot.x = (corner & 1) ? 1.0f : 0.0f;
- window_pos_pivot.y = (corner & 2) ? 1.0f : 0.0f;
+ window_pos.x = (location & 1) ? (work_pos.x + work_size.x - PAD) : (work_pos.x + PAD);
+ window_pos.y = (location & 2) ? (work_pos.y + work_size.y - PAD) : (work_pos.y + PAD);
+ window_pos_pivot.x = (location & 1) ? 1.0f : 0.0f;
+ window_pos_pivot.y = (location & 2) ? 1.0f : 0.0f;
ImGui::SetNextWindowPos(window_pos, ImGuiCond_Always, window_pos_pivot);
window_flags |= ImGuiWindowFlags_NoMove;
}
+ else if (location == -2)
+ {
+ // Center window
+ ImGui::SetNextWindowPos(ImGui::GetMainViewport()->GetCenter(), ImGuiCond_Always, ImVec2(0.5f, 0.5f));
+ window_flags |= ImGuiWindowFlags_NoMove;
+ }
ImGui::SetNextWindowBgAlpha(0.35f); // Transparent background
if (ImGui::Begin("Example: Simple overlay", p_open, window_flags))
{
- ImGui::Text("Simple overlay\n" "in the corner of the screen.\n" "(right-click to change position)");
+ IMGUI_DEMO_MARKER("Examples/Simple Overlay");
+ ImGui::Text("Simple overlay\n" "(right-click to change position)");
ImGui::Separator();
if (ImGui::IsMousePosValid())
ImGui::Text("Mouse Position: (%.1f,%.1f)", io.MousePos.x, io.MousePos.y);
@@ -7048,11 +7438,12 @@ static void ShowExampleAppSimpleOverlay(bool* p_open)
ImGui::Text("Mouse Position: <invalid>");
if (ImGui::BeginPopupContextWindow())
{
- if (ImGui::MenuItem("Custom", NULL, corner == -1)) corner = -1;
- if (ImGui::MenuItem("Top-left", NULL, corner == 0)) corner = 0;
- if (ImGui::MenuItem("Top-right", NULL, corner == 1)) corner = 1;
- if (ImGui::MenuItem("Bottom-left", NULL, corner == 2)) corner = 2;
- if (ImGui::MenuItem("Bottom-right", NULL, corner == 3)) corner = 3;
+ if (ImGui::MenuItem("Custom", NULL, location == -1)) location = -1;
+ if (ImGui::MenuItem("Center", NULL, location == -2)) location = -2;
+ if (ImGui::MenuItem("Top-left", NULL, location == 0)) location = 0;
+ if (ImGui::MenuItem("Top-right", NULL, location == 1)) location = 1;
+ if (ImGui::MenuItem("Bottom-left", NULL, location == 2)) location = 2;
+ if (ImGui::MenuItem("Bottom-right", NULL, location == 3)) location = 3;
if (p_open && ImGui::MenuItem("Close")) *p_open = false;
ImGui::EndPopup();
}
@@ -7068,7 +7459,7 @@ static void ShowExampleAppSimpleOverlay(bool* p_open)
static void ShowExampleAppFullscreen(bool* p_open)
{
static bool use_work_area = true;
- static ImGuiWindowFlags flags = ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoSavedSettings;
+ 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.
@@ -7100,8 +7491,8 @@ static void ShowExampleAppFullscreen(bool* p_open)
// [SECTION] Example App: Manipulating Window Titles / ShowExampleAppWindowTitles()
//-----------------------------------------------------------------------------
-// Demonstrate using "##" and "###" in identifiers to manipulate ID generation.
-// This apply to all regular items as well.
+// Demonstrate the use of "##" and "###" in identifiers to manipulate ID generation.
+// This applies to all regular items as well.
// Read FAQ section "How can I have multiple widgets with the same label?" for details.
static void ShowExampleAppWindowTitles(bool*)
{
@@ -7114,6 +7505,7 @@ static void ShowExampleAppWindowTitles(bool*)
// Using "##" to display same title but have unique identifier.
ImGui::SetNextWindowPos(ImVec2(base_pos.x + 100, base_pos.y + 100), ImGuiCond_FirstUseEver);
ImGui::Begin("Same title as another window##1");
+ IMGUI_DEMO_MARKER("Examples/Manipulating window titles");
ImGui::Text("This is window 1.\nMy title is the same as window 2, but my identifier is unique.");
ImGui::End();
@@ -7143,6 +7535,7 @@ static void ShowExampleAppCustomRendering(bool* p_open)
ImGui::End();
return;
}
+ IMGUI_DEMO_MARKER("Examples/Custom Rendering");
// Tip: If you do a lot of custom rendering, you probably want to use your own geometrical types and benefit of
// overloaded operators, etc. Define IM_VEC2_CLASS_EXTRA in imconfig.h to create implicit conversions between your
@@ -7319,8 +7712,8 @@ static void ShowExampleAppCustomRendering(bool* p_open)
// Context menu (under default mouse threshold)
ImVec2 drag_delta = ImGui::GetMouseDragDelta(ImGuiMouseButton_Right);
- if (opt_enable_context_menu && ImGui::IsMouseReleased(ImGuiMouseButton_Right) && drag_delta.x == 0.0f && drag_delta.y == 0.0f)
- ImGui::OpenPopupOnItemClick("context");
+ if (opt_enable_context_menu && drag_delta.x == 0.0f && drag_delta.y == 0.0f)
+ ImGui::OpenPopupOnItemClick("context", ImGuiPopupFlags_MouseButtonRight);
if (ImGui::BeginPopup("context"))
{
if (adding_line)
@@ -7504,7 +7897,8 @@ void ShowExampleAppDocuments(bool* p_open)
if (ImGui::MenuItem("Close All Documents", NULL, false, open_count > 0))
for (int doc_n = 0; doc_n < app.Documents.Size; doc_n++)
app.Documents[doc_n].DoQueueClose();
- if (ImGui::MenuItem("Exit", "Alt+F4")) {}
+ if (ImGui::MenuItem("Exit", "Ctrl+F4") && p_open)
+ *p_open = false;
ImGui::EndMenu();
}
ImGui::EndMenuBar();
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp
index 0abc75f343a..859b62e7e97 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_draw.cpp
@@ -1,4 +1,4 @@
-// dear imgui, v1.85 WIP
+// dear imgui, v1.89.1 WIP
// (drawing and font code)
/*
@@ -39,25 +39,12 @@ Index of this file:
#endif
#include <stdio.h> // vsnprintf, sscanf, printf
-#if !defined(alloca)
-#if defined(__GLIBC__) || defined(__sun) || defined(__APPLE__) || defined(__NEWLIB__)
-#include <alloca.h> // alloca (glibc uses <alloca.h>. Note that Cygwin may have _WIN32 defined, so the order matters here)
-#elif defined(_WIN32)
-#include <malloc.h> // alloca
-#if !defined(alloca)
-#define alloca _alloca // for clang with MS Codegen
-#endif
-#else
-#include <stdlib.h> // alloca
-#endif
-#endif
// Visual Studio warnings
#ifdef _MSC_VER
#pragma warning (disable: 4127) // condition expression is constant
#pragma warning (disable: 4505) // unreferenced local function has been removed (stb stuff)
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
-#pragma warning (disable: 6255) // [Static Analyzer] _alloca indicates failure by raising a stack overflow exception. Consider using _malloca instead.
#pragma warning (disable: 26451) // [Static Analyzer] Arithmetic overflow : Using operator 'xxx' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator 'xxx' to avoid overflow(io.2).
#pragma warning (disable: 26812) // [Static Analyzer] The enum type 'xxx' is unscoped. Prefer 'enum class' over 'enum' (Enum.3). [MSVC Static Analyzer)
#endif
@@ -67,9 +54,6 @@ Index of this file:
#if __has_warning("-Wunknown-warning-option")
#pragma clang diagnostic ignored "-Wunknown-warning-option" // warning: unknown warning group 'xxx' // not all warnings are known by all Clang versions and they tend to be rename-happy.. so ignoring warnings triggers new warnings on some configuration. Great!
#endif
-#if __has_warning("-Walloca")
-#pragma clang diagnostic ignored "-Walloca" // warning: use of function '__builtin_alloca' is discouraged
-#endif
#pragma clang diagnostic ignored "-Wunknown-pragmas" // warning: unknown warning group 'xxx'
#pragma clang diagnostic ignored "-Wold-style-cast" // warning: use of old-style cast // yes, they are more terse.
#pragma clang diagnostic ignored "-Wfloat-equal" // warning: comparing floating point with == or != is unsafe // storing and comparing against same constants ok.
@@ -90,7 +74,7 @@ Index of this file:
#endif
//-------------------------------------------------------------------------
-// [SECTION] STB libraries implementation
+// [SECTION] STB libraries implementation (for stb_truetype and stb_rect_pack)
//-------------------------------------------------------------------------
// Compile time options:
@@ -393,7 +377,7 @@ void ImDrawListSharedData::SetCircleTessellationMaxError(float max_error)
for (int i = 0; i < IM_ARRAYSIZE(CircleSegmentCounts); i++)
{
const float radius = (float)i;
- CircleSegmentCounts[i] = (ImU8)((i > 0) ? IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, CircleSegmentMaxError) : 0);
+ CircleSegmentCounts[i] = (ImU8)((i > 0) ? IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC(radius, CircleSegmentMaxError) : IM_DRAWLIST_ARCFAST_SAMPLE_MAX);
}
ArcFastRadiusCutoff = IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_CALC_R(IM_DRAWLIST_ARCFAST_SAMPLE_MAX, CircleSegmentMaxError);
}
@@ -402,10 +386,9 @@ void ImDrawListSharedData::SetCircleTessellationMaxError(float max_error)
void ImDrawList::_ResetForNewFrame()
{
// Verify that the ImDrawCmd fields we want to memcmp() are contiguous in memory.
- // (those should be IM_STATIC_ASSERT() in theory but with our pre C++11 setup the whole check doesn't compile with GCC)
- IM_ASSERT(IM_OFFSETOF(ImDrawCmd, ClipRect) == 0);
- IM_ASSERT(IM_OFFSETOF(ImDrawCmd, TextureId) == sizeof(ImVec4));
- IM_ASSERT(IM_OFFSETOF(ImDrawCmd, VtxOffset) == sizeof(ImVec4) + sizeof(ImTextureID));
+ 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));
CmdBuffer.resize(0);
IdxBuffer.resize(0);
@@ -473,6 +456,7 @@ void ImDrawList::_PopUnusedDrawCmd()
void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data)
{
+ IM_ASSERT_PARANOID(CmdBuffer.Size > 0);
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
IM_ASSERT(curr_cmd->UserCallback == NULL);
if (curr_cmd->ElemCount != 0)
@@ -487,16 +471,18 @@ void ImDrawList::AddCallback(ImDrawCallback callback, void* callback_data)
}
// Compare ClipRect, TextureId and VtxOffset with a single memcmp()
-#define ImDrawCmd_HeaderSize (IM_OFFSETOF(ImDrawCmd, VtxOffset) + sizeof(unsigned int))
-#define ImDrawCmd_HeaderCompare(CMD_LHS, CMD_RHS) (memcmp(CMD_LHS, CMD_RHS, ImDrawCmd_HeaderSize)) // Compare ClipRect, TextureId, VtxOffset
-#define ImDrawCmd_HeaderCopy(CMD_DST, CMD_SRC) (memcpy(CMD_DST, CMD_SRC, ImDrawCmd_HeaderSize)) // Copy ClipRect, TextureId, VtxOffset
+#define ImDrawCmd_HeaderSize (IM_OFFSETOF(ImDrawCmd, VtxOffset) + sizeof(unsigned int))
+#define ImDrawCmd_HeaderCompare(CMD_LHS, CMD_RHS) (memcmp(CMD_LHS, CMD_RHS, ImDrawCmd_HeaderSize)) // Compare ClipRect, TextureId, VtxOffset
+#define ImDrawCmd_HeaderCopy(CMD_DST, CMD_SRC) (memcpy(CMD_DST, CMD_SRC, ImDrawCmd_HeaderSize)) // Copy ClipRect, TextureId, VtxOffset
+#define ImDrawCmd_AreSequentialIdxOffset(CMD_0, CMD_1) (CMD_0->IdxOffset + CMD_0->ElemCount == CMD_1->IdxOffset)
// Try to merge two last draw commands
void ImDrawList::_TryMergeDrawCmds()
{
+ IM_ASSERT_PARANOID(CmdBuffer.Size > 0);
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
ImDrawCmd* prev_cmd = curr_cmd - 1;
- if (ImDrawCmd_HeaderCompare(curr_cmd, prev_cmd) == 0 && curr_cmd->UserCallback == NULL && prev_cmd->UserCallback == NULL)
+ if (ImDrawCmd_HeaderCompare(curr_cmd, prev_cmd) == 0 && ImDrawCmd_AreSequentialIdxOffset(prev_cmd, curr_cmd) && curr_cmd->UserCallback == NULL && prev_cmd->UserCallback == NULL)
{
prev_cmd->ElemCount += curr_cmd->ElemCount;
CmdBuffer.pop_back();
@@ -508,6 +494,7 @@ void ImDrawList::_TryMergeDrawCmds()
void ImDrawList::_OnChangedClipRect()
{
// If current command is used with different settings we need to add a new command
+ IM_ASSERT_PARANOID(CmdBuffer.Size > 0);
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
if (curr_cmd->ElemCount != 0 && memcmp(&curr_cmd->ClipRect, &_CmdHeader.ClipRect, sizeof(ImVec4)) != 0)
{
@@ -518,7 +505,7 @@ void ImDrawList::_OnChangedClipRect()
// Try to merge with previous command if it matches, else use current command
ImDrawCmd* prev_cmd = curr_cmd - 1;
- if (curr_cmd->ElemCount == 0 && CmdBuffer.Size > 1 && ImDrawCmd_HeaderCompare(&_CmdHeader, prev_cmd) == 0 && prev_cmd->UserCallback == NULL)
+ if (curr_cmd->ElemCount == 0 && CmdBuffer.Size > 1 && ImDrawCmd_HeaderCompare(&_CmdHeader, prev_cmd) == 0 && ImDrawCmd_AreSequentialIdxOffset(prev_cmd, curr_cmd) && prev_cmd->UserCallback == NULL)
{
CmdBuffer.pop_back();
return;
@@ -530,6 +517,7 @@ void ImDrawList::_OnChangedClipRect()
void ImDrawList::_OnChangedTextureID()
{
// If current command is used with different settings we need to add a new command
+ IM_ASSERT_PARANOID(CmdBuffer.Size > 0);
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
if (curr_cmd->ElemCount != 0 && curr_cmd->TextureId != _CmdHeader.TextureId)
{
@@ -540,7 +528,7 @@ void ImDrawList::_OnChangedTextureID()
// Try to merge with previous command if it matches, else use current command
ImDrawCmd* prev_cmd = curr_cmd - 1;
- if (curr_cmd->ElemCount == 0 && CmdBuffer.Size > 1 && ImDrawCmd_HeaderCompare(&_CmdHeader, prev_cmd) == 0 && prev_cmd->UserCallback == NULL)
+ if (curr_cmd->ElemCount == 0 && CmdBuffer.Size > 1 && ImDrawCmd_HeaderCompare(&_CmdHeader, prev_cmd) == 0 && ImDrawCmd_AreSequentialIdxOffset(prev_cmd, curr_cmd) && prev_cmd->UserCallback == NULL)
{
CmdBuffer.pop_back();
return;
@@ -553,6 +541,7 @@ void ImDrawList::_OnChangedVtxOffset()
{
// We don't need to compare curr_cmd->VtxOffset != _CmdHeader.VtxOffset because we know it'll be different at the time we call this.
_VtxCurrentIdx = 0;
+ IM_ASSERT_PARANOID(CmdBuffer.Size > 0);
ImDrawCmd* curr_cmd = &CmdBuffer.Data[CmdBuffer.Size - 1];
//IM_ASSERT(curr_cmd->VtxOffset != _CmdHeader.VtxOffset); // See #3349
if (curr_cmd->ElemCount != 0)
@@ -575,7 +564,7 @@ int ImDrawList::_CalcCircleAutoSegmentCount(float radius) const
}
// Render-level scissoring. This is passed down to your render function but not used for CPU-side coarse clipping. Prefer using higher-level ImGui::PushClipRect() to affect logic (hit-testing and widget culling)
-void ImDrawList::PushClipRect(ImVec2 cr_min, ImVec2 cr_max, bool intersect_with_current_clip_rect)
+void ImDrawList::PushClipRect(const ImVec2& cr_min, const ImVec2& cr_max, bool intersect_with_current_clip_rect)
{
ImVec4 cr(cr_min.x, cr_min.y, cr_max.x, cr_max.y);
if (intersect_with_current_clip_rect)
@@ -748,7 +737,8 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32
// Temporary buffer
// The first <points_count> items are normals at each line point, then after that there are either 2 or 4 temp points for each line point
- ImVec2* temp_normals = (ImVec2*)alloca(points_count * ((use_texture || !thick_line) ? 3 : 5) * sizeof(ImVec2)); //-V630
+ _Data->TempBuffer.reserve_discard(points_count * ((use_texture || !thick_line) ? 3 : 5));
+ ImVec2* temp_normals = _Data->TempBuffer.Data;
ImVec2* temp_points = temp_normals + points_count;
// Calculate normals (tangents) for each line segment
@@ -968,7 +958,8 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32
}
}
-// We intentionally avoid using ImVec2 and its math operators here to reduce cost to a minimum for debug/non-inlined builds.
+// - We intentionally avoid using ImVec2 and its math operators here to reduce cost to a minimum for debug/non-inlined builds.
+// - 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)
@@ -995,7 +986,8 @@ void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_coun
}
// Compute normals
- ImVec2* temp_normals = (ImVec2*)alloca(points_count * sizeof(ImVec2)); //-V630
+ _Data->TempBuffer.reserve_discard(points_count);
+ ImVec2* temp_normals = _Data->TempBuffer.Data;
for (int i0 = points_count - 1, i1 = 0; i1 < points_count; i0 = i1++)
{
const ImVec2& p0 = points[i0];
@@ -1052,7 +1044,7 @@ void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_coun
void ImDrawList::_PathArcToFastEx(const ImVec2& center, float radius, int a_min_sample, int a_max_sample, int a_step)
{
- if (radius <= 0.0f)
+ if (radius < 0.5f)
{
_Path.push_back(center);
return;
@@ -1144,7 +1136,7 @@ void ImDrawList::_PathArcToFastEx(const ImVec2& center, float radius, int a_min_
void ImDrawList::_PathArcToN(const ImVec2& center, float radius, float a_min, float a_max, int num_segments)
{
- if (radius <= 0.0f)
+ if (radius < 0.5f)
{
_Path.push_back(center);
return;
@@ -1163,7 +1155,7 @@ void ImDrawList::_PathArcToN(const ImVec2& center, float radius, float a_min, fl
// 0: East, 3: South, 6: West, 9: North, 12: East
void ImDrawList::PathArcToFast(const ImVec2& center, float radius, int a_min_of_12, int a_max_of_12)
{
- if (radius <= 0.0f)
+ if (radius < 0.5f)
{
_Path.push_back(center);
return;
@@ -1173,7 +1165,7 @@ void ImDrawList::PathArcToFast(const ImVec2& center, float radius, int a_min_of_
void ImDrawList::PathArcTo(const ImVec2& center, float radius, float a_min, float a_max, int num_segments)
{
- if (radius <= 0.0f)
+ if (radius < 0.5f)
{
_Path.push_back(center);
return;
@@ -1201,8 +1193,8 @@ void ImDrawList::PathArcTo(const ImVec2& center, float radius, float a_min, floa
const float a_min_segment_angle = a_min_sample * IM_PI * 2.0f / IM_DRAWLIST_ARCFAST_SAMPLE_MAX;
const float a_max_segment_angle = a_max_sample * IM_PI * 2.0f / IM_DRAWLIST_ARCFAST_SAMPLE_MAX;
- const bool a_emit_start = (a_min_segment_angle - a_min) != 0.0f;
- const bool a_emit_end = (a_max - a_max_segment_angle) != 0.0f;
+ const bool a_emit_start = ImAbs(a_min_segment_angle - a_min) >= 1e-5f;
+ const bool a_emit_end = ImAbs(a_max - a_max_segment_angle) >= 1e-5f;
_Path.reserve(_Path.Size + (a_mid_samples + 1 + (a_emit_start ? 1 : 0) + (a_emit_end ? 1 : 0)));
if (a_emit_start)
@@ -1289,6 +1281,7 @@ void ImDrawList::PathBezierCubicCurveTo(const ImVec2& p2, const ImVec2& p3, cons
ImVec2 p1 = _Path.back();
if (num_segments == 0)
{
+ IM_ASSERT(_Data->CurveTessellationTol > 0.0f);
PathBezierCubicCurveToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, p4.x, p4.y, _Data->CurveTessellationTol, 0); // Auto-tessellated
}
else
@@ -1304,6 +1297,7 @@ void ImDrawList::PathBezierQuadraticCurveTo(const ImVec2& p2, const ImVec2& p3,
ImVec2 p1 = _Path.back();
if (num_segments == 0)
{
+ IM_ASSERT(_Data->CurveTessellationTol > 0.0f);
PathBezierQuadraticCurveToCasteljau(&_Path, p1.x, p1.y, p2.x, p2.y, p3.x, p3.y, _Data->CurveTessellationTol, 0);// Auto-tessellated
}
else
@@ -1318,6 +1312,7 @@ IM_STATIC_ASSERT(ImDrawFlags_RoundCornersTopLeft == (1 << 4));
static inline ImDrawFlags FixRectCornerFlags(ImDrawFlags flags)
{
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ // Obsoleted in 1.82 (from February 2021)
// Legacy Support for hard coded ~0 (used to be a suggested equivalent to ImDrawCornerFlags_All)
// ~0 --> ImDrawFlags_RoundCornersAll or 0
if (flags == ~0)
@@ -1354,7 +1349,7 @@ void ImDrawList::PathRect(const ImVec2& a, const ImVec2& b, float rounding, ImDr
rounding = ImMin(rounding, ImFabs(b.x - a.x) * ( ((flags & ImDrawFlags_RoundCornersTop) == ImDrawFlags_RoundCornersTop) || ((flags & ImDrawFlags_RoundCornersBottom) == ImDrawFlags_RoundCornersBottom) ? 0.5f : 1.0f ) - 1.0f);
rounding = ImMin(rounding, ImFabs(b.y - a.y) * ( ((flags & ImDrawFlags_RoundCornersLeft) == ImDrawFlags_RoundCornersLeft) || ((flags & ImDrawFlags_RoundCornersRight) == ImDrawFlags_RoundCornersRight) ? 0.5f : 1.0f ) - 1.0f);
- if (rounding <= 0.0f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
+ if (rounding < 0.5f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
{
PathLineTo(a);
PathLineTo(ImVec2(b.x, a.y));
@@ -1400,7 +1395,7 @@ void ImDrawList::AddRectFilled(const ImVec2& p_min, const ImVec2& p_max, ImU32 c
{
if ((col & IM_COL32_A_MASK) == 0)
return;
- if (rounding <= 0.0f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
+ if (rounding < 0.5f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
{
PrimReserve(6, 4);
PrimRect(p_min, p_max, col);
@@ -1476,7 +1471,7 @@ void ImDrawList::AddTriangleFilled(const ImVec2& p1, const ImVec2& p2, const ImV
void ImDrawList::AddCircle(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness)
{
- if ((col & IM_COL32_A_MASK) == 0 || radius <= 0.0f)
+ if ((col & IM_COL32_A_MASK) == 0 || radius < 0.5f)
return;
if (num_segments <= 0)
@@ -1500,7 +1495,7 @@ void ImDrawList::AddCircle(const ImVec2& center, float radius, ImU32 col, int nu
void ImDrawList::AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments)
{
- if ((col & IM_COL32_A_MASK) == 0 || radius <= 0.0f)
+ if ((col & IM_COL32_A_MASK) == 0 || radius < 0.5f)
return;
if (num_segments <= 0)
@@ -1640,7 +1635,7 @@ void ImDrawList::AddImageRounded(ImTextureID user_texture_id, const ImVec2& p_mi
return;
flags = FixRectCornerFlags(flags);
- if (rounding <= 0.0f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
+ if (rounding < 0.5f || (flags & ImDrawFlags_RoundCornersMask_) == ImDrawFlags_RoundCornersNone)
{
AddImage(user_texture_id, p_min, p_max, uv_min, uv_max, col);
return;
@@ -1728,13 +1723,13 @@ void ImDrawListSplitter::Merge(ImDrawList* draw_list)
for (int i = 1; i < _Count; i++)
{
ImDrawChannel& ch = _Channels[i];
-
- // Equivalent of PopUnusedDrawCmd() for this channel's cmdbuffer and except we don't need to test for UserCallback.
- if (ch._CmdBuffer.Size > 0 && ch._CmdBuffer.back().ElemCount == 0)
+ if (ch._CmdBuffer.Size > 0 && ch._CmdBuffer.back().ElemCount == 0 && ch._CmdBuffer.back().UserCallback == NULL) // Equivalent of PopUnusedDrawCmd()
ch._CmdBuffer.pop_back();
if (ch._CmdBuffer.Size > 0 && last_cmd != NULL)
{
+ // Do not include ImDrawCmd_AreSequentialIdxOffset() in the compare as we rebuild IdxOffset values ourselves.
+ // Manipulating IdxOffset (e.g. by reordering draw commands like done by RenderDimmedBackgroundBehindWindow()) is not supported within a splitter.
ImDrawCmd* next_cmd = &ch._CmdBuffer[0];
if (ImDrawCmd_HeaderCompare(last_cmd, next_cmd) == 0 && last_cmd->UserCallback == NULL && next_cmd->UserCallback == NULL)
{
@@ -1919,37 +1914,38 @@ ImFontConfig::ImFontConfig()
// A work of art lies ahead! (. = white layer, X = black layer, others are blank)
// The 2x2 white texels on the top left are the ones we'll use everywhere in Dear ImGui to render filled shapes.
-const int FONT_ATLAS_DEFAULT_TEX_DATA_W = 108; // Actual texture will be 2 times that + 1 spacing.
+// (This is used when io.MouseDrawCursor = true)
+const int FONT_ATLAS_DEFAULT_TEX_DATA_W = 122; // Actual texture will be 2 times that + 1 spacing.
const int FONT_ATLAS_DEFAULT_TEX_DATA_H = 27;
static const char FONT_ATLAS_DEFAULT_TEX_DATA_PIXELS[FONT_ATLAS_DEFAULT_TEX_DATA_W * FONT_ATLAS_DEFAULT_TEX_DATA_H + 1] =
{
- "..- -XXXXXXX- X - X -XXXXXXX - XXXXXXX- XX "
- "..- -X.....X- X.X - X.X -X.....X - X.....X- X..X "
- "--- -XXX.XXX- X...X - X...X -X....X - X....X- X..X "
- "X - X.X - X.....X - X.....X -X...X - X...X- X..X "
- "XX - X.X -X.......X- X.......X -X..X.X - X.X..X- X..X "
- "X.X - X.X -XXXX.XXXX- XXXX.XXXX -X.X X.X - X.X X.X- X..XXX "
- "X..X - X.X - X.X - X.X -XX X.X - X.X XX- X..X..XXX "
- "X...X - X.X - X.X - XX X.X XX - X.X - X.X - X..X..X..XX "
- "X....X - X.X - X.X - X.X X.X X.X - X.X - X.X - X..X..X..X.X "
- "X.....X - X.X - X.X - X..X X.X X..X - X.X - X.X -XXX X..X..X..X..X"
- "X......X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X XX-XX X.X -X..XX........X..X"
- "X.......X - X.X - X.X -X.....................X- X.X X.X-X.X X.X -X...X...........X"
- "X........X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X..X-X..X.X - X..............X"
- "X.........X -XXX.XXX- X.X - X..X X.X X..X - X...X-X...X - X.............X"
- "X..........X-X.....X- X.X - X.X X.X X.X - X....X-X....X - X.............X"
- "X......XXXXX-XXXXXXX- X.X - XX X.X XX - X.....X-X.....X - X............X"
- "X...X..X --------- X.X - X.X - XXXXXXX-XXXXXXX - X...........X "
- "X..X X..X - -XXXX.XXXX- XXXX.XXXX ------------------------------------- X..........X "
- "X.X X..X - -X.......X- X.......X - XX XX - - X..........X "
- "XX X..X - - X.....X - X.....X - X.X X.X - - X........X "
- " X..X - X...X - X...X - X..X X..X - - X........X "
- " XX - X.X - X.X - X...XXXXXXXXXXXXX...X - - XXXXXXXXXX "
- "------------ - X - X -X.....................X- ------------------"
- " ----------------------------------- X...XXXXXXXXXXXXX...X - "
- " - X..X X..X - "
- " - X.X X.X - "
- " - XX XX - "
+ "..- -XXXXXXX- X - X -XXXXXXX - XXXXXXX- XX - XX XX "
+ "..- -X.....X- X.X - X.X -X.....X - X.....X- X..X -X..X X..X"
+ "--- -XXX.XXX- X...X - X...X -X....X - X....X- X..X -X...X X...X"
+ "X - X.X - X.....X - X.....X -X...X - X...X- X..X - X...X X...X "
+ "XX - X.X -X.......X- X.......X -X..X.X - X.X..X- X..X - X...X...X "
+ "X.X - X.X -XXXX.XXXX- XXXX.XXXX -X.X X.X - X.X X.X- X..XXX - X.....X "
+ "X..X - X.X - X.X - X.X -XX X.X - X.X XX- X..X..XXX - X...X "
+ "X...X - X.X - X.X - XX X.X XX - X.X - X.X - X..X..X..XX - X.X "
+ "X....X - X.X - X.X - X.X X.X X.X - X.X - X.X - X..X..X..X.X - X...X "
+ "X.....X - X.X - X.X - X..X X.X X..X - X.X - X.X -XXX X..X..X..X..X- X.....X "
+ "X......X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X XX-XX X.X -X..XX........X..X- X...X...X "
+ "X.......X - X.X - X.X -X.....................X- X.X X.X-X.X X.X -X...X...........X- X...X X...X "
+ "X........X - X.X - X.X - X...XXXXXX.XXXXXX...X - X.X..X-X..X.X - X..............X-X...X X...X"
+ "X.........X -XXX.XXX- X.X - X..X X.X X..X - X...X-X...X - X.............X-X..X X..X"
+ "X..........X-X.....X- X.X - X.X X.X X.X - X....X-X....X - X.............X- XX XX "
+ "X......XXXXX-XXXXXXX- X.X - XX X.X XX - X.....X-X.....X - X............X--------------"
+ "X...X..X --------- X.X - X.X - XXXXXXX-XXXXXXX - X...........X - "
+ "X..X X..X - -XXXX.XXXX- XXXX.XXXX ------------------------------------- X..........X - "
+ "X.X X..X - -X.......X- X.......X - XX XX - - X..........X - "
+ "XX X..X - - X.....X - X.....X - X.X X.X - - X........X - "
+ " X..X - - X...X - X...X - X..X X..X - - X........X - "
+ " XX - - X.X - X.X - X...XXXXXXXXXXXXX...X - - XXXXXXXXXX - "
+ "------------- - X - X -X.....................X- ------------------- "
+ " ----------------------------------- X...XXXXXXXXXXXXX...X - "
+ " - X..X X..X - "
+ " - X.X X.X - "
+ " - XX XX - "
};
static const ImVec2 FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[ImGuiMouseCursor_COUNT][3] =
@@ -1963,6 +1959,7 @@ static const ImVec2 FONT_ATLAS_DEFAULT_TEX_CURSOR_DATA[ImGuiMouseCursor_COUNT][3
{ ImVec2(73,0), ImVec2(17,17), ImVec2( 8, 8) }, // ImGuiMouseCursor_ResizeNESW
{ ImVec2(55,0), ImVec2(17,17), ImVec2( 8, 8) }, // ImGuiMouseCursor_ResizeNWSE
{ ImVec2(91,0), ImVec2(17,22), ImVec2( 5, 0) }, // ImGuiMouseCursor_Hand
+ { ImVec2(109,0),ImVec2(13,15), ImVec2( 6, 7) }, // ImGuiMouseCursor_NotAllowed
};
ImFontAtlas::ImFontAtlas()
@@ -2290,10 +2287,11 @@ void ImFontAtlasBuildMultiplyCalcLookupTable(unsigned char out_table[256], fl
void ImFontAtlasBuildMultiplyRectAlpha8(const unsigned char table[256], unsigned char* pixels, int x, int y, int w, int h, int stride)
{
+ IM_ASSERT_PARANOID(w <= stride);
unsigned char* data = pixels + x + y * stride;
- for (int j = h; j > 0; j--, data += stride)
- for (int i = 0; i < w; i++)
- data[i] = table[data[i]];
+ for (int j = h; j > 0; j--, data += stride - w)
+ for (int i = w; i > 0; i--, data++)
+ *data = table[*data];
}
#ifdef IMGUI_ENABLE_STB_TRUETYPE
@@ -2310,7 +2308,7 @@ struct ImFontBuildSrcData
int GlyphsHighest; // Highest requested codepoint
int GlyphsCount; // Glyph count (excluding missing glyphs and glyphs already set by an earlier source font)
ImBitVector GlyphsSet; // Glyph bit map (random access, 1-bit per codepoint. This will be a maximum of 8KB)
- ImVector<int> GlyphsList; // Glyph codepoints list (flattened version of GlyphsMap)
+ ImVector<int> GlyphsList; // Glyph codepoints list (flattened version of GlyphsSet)
};
// Temporary data for one destination ImFont* (multiple source fonts can be merged into one destination ImFont)
@@ -2630,8 +2628,8 @@ void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opa
for (int i = 0; i < pack_rects.Size; i++)
if (pack_rects[i].was_packed)
{
- user_rects[i].X = pack_rects[i].x;
- user_rects[i].Y = pack_rects[i].y;
+ user_rects[i].X = (unsigned short)pack_rects[i].x;
+ user_rects[i].Y = (unsigned short)pack_rects[i].y;
IM_ASSERT(pack_rects[i].w == user_rects[i].Width && pack_rects[i].h == user_rects[i].Height);
atlas->TexHeight = ImMax(atlas->TexHeight, pack_rects[i].y + pack_rects[i].h);
}
@@ -2731,13 +2729,13 @@ static void ImFontAtlasBuildRenderLinesTexData(ImFontAtlas* atlas)
{
unsigned int* write_ptr = &atlas->TexPixelsRGBA32[r->X + ((r->Y + y) * atlas->TexWidth)];
for (unsigned int i = 0; i < pad_left; i++)
- *(write_ptr + i) = IM_COL32_BLACK_TRANS;
+ *(write_ptr + i) = IM_COL32(255, 255, 255, 0);
for (unsigned int i = 0; i < line_width; i++)
*(write_ptr + pad_left + i) = IM_COL32_WHITE;
for (unsigned int i = 0; i < pad_right; i++)
- *(write_ptr + pad_left + line_width + i) = IM_COL32_BLACK_TRANS;
+ *(write_ptr + pad_left + line_width + i) = IM_COL32(255, 255, 255, 0);
}
// Calculate UVs for this line
@@ -2810,6 +2808,17 @@ const ImWchar* ImFontAtlas::GetGlyphRangesDefault()
return &ranges[0];
}
+const ImWchar* ImFontAtlas::GetGlyphRangesGreek()
+{
+ static const ImWchar ranges[] =
+ {
+ 0x0020, 0x00FF, // Basic Latin + Latin Supplement
+ 0x0370, 0x03FF, // Greek and Coptic
+ 0,
+ };
+ return &ranges[0];
+}
+
const ImWchar* ImFontAtlas::GetGlyphRangesKorean()
{
static const ImWchar ranges[] =
@@ -3073,8 +3082,8 @@ void ImFontGlyphRangesBuilder::AddText(const char* text, const char* text_end)
void ImFontGlyphRangesBuilder::AddRanges(const ImWchar* ranges)
{
for (; ranges[0]; ranges += 2)
- for (ImWchar c = ranges[0]; c <= ranges[1]; c++)
- AddChar(c);
+ for (unsigned int c = ranges[0]; c <= ranges[1] && c <= IM_UNICODE_CODEPOINT_MAX; c++) //-V560
+ AddChar((ImWchar)c);
}
void ImFontGlyphRangesBuilder::BuildRanges(ImVector<ImWchar>* out_ranges)
@@ -3322,11 +3331,21 @@ const ImFontGlyph* ImFont::FindGlyphNoFallback(ImWchar c) const
return &Glyphs.Data[i];
}
-const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const
+// Wrapping skips upcoming blanks
+static inline const char* CalcWordWrapNextLineStartA(const char* text, const char* text_end)
{
- // Simple word-wrapping for English, not full-featured. Please submit failing cases!
- // FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.)
+ while (text < text_end && ImCharIsBlankA(*text))
+ text++;
+ if (*text == '\n')
+ text++;
+ return text;
+}
+// Simple word-wrapping for English, not full-featured. Please submit failing cases!
+// This will return the next location to wrap from. If no wrapping if necessary, this will fast-forward to e.g. text_end.
+// FIXME: Much possible improvements (don't cut things like "word !", "word!!!" but cut within "word,,,,", more sensible support for punctuations, support for Unicode punctuations, etc.)
+const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const char* text_end, float wrap_width) const
+{
// For references, possible wrap point marked with ^
// "aaa bbb, ccc,ddd. eee fff. ggg!"
// ^ ^ ^ ^ ^__ ^ ^
@@ -3338,7 +3357,6 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
// Cut words that cannot possibly fit within one line.
// e.g.: "The tropical fish" with ~5 characters worth of width --> "The tr" "opical" "fish"
-
float line_width = 0.0f;
float word_width = 0.0f;
float blank_width = 0.0f;
@@ -3418,6 +3436,10 @@ const char* ImFont::CalcWordWrapPositionA(float scale, const char* text, const c
s = next_s;
}
+ // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
+ // +1 may not be a character start point in UTF-8 but it's ok because caller loops use (text >= word_wrap_eol).
+ if (s == text && text < text_end)
+ return s + 1;
return s;
}
@@ -3442,11 +3464,7 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
{
// Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature.
if (!word_wrap_eol)
- {
word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - line_width);
- if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
- word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below
- }
if (s >= word_wrap_eol)
{
@@ -3455,13 +3473,7 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
text_size.y += line_height;
line_width = 0.0f;
word_wrap_eol = NULL;
-
- // Wrapping skips upcoming blanks
- while (s < text_end)
- {
- const char c = *s;
- if (ImCharIsBlankA(c)) { s++; } else if (c == '\n') { s++; break; } else { break; }
- }
+ s = CalcWordWrapNextLineStartA(s, text_end); // Wrapping skips upcoming blanks
continue;
}
}
@@ -3516,7 +3528,7 @@ ImVec2 ImFont::CalcTextSizeA(float size, float max_width, float wrap_width, cons
}
// Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound.
-void ImFont::RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, ImWchar c) const
+void ImFont::RenderChar(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, ImWchar c) const
{
const ImFontGlyph* glyph = FindGlyph(c);
if (!glyph || !glyph->Visible)
@@ -3524,38 +3536,47 @@ void ImFont::RenderChar(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
if (glyph->Colored)
col |= ~IM_COL32_A_MASK;
float scale = (size >= 0.0f) ? (size / FontSize) : 1.0f;
- pos.x = IM_FLOOR(pos.x);
- pos.y = IM_FLOOR(pos.y);
+ float x = IM_FLOOR(pos.x);
+ float y = IM_FLOOR(pos.y);
draw_list->PrimReserve(6, 4);
- draw_list->PrimRectUV(ImVec2(pos.x + glyph->X0 * scale, pos.y + glyph->Y0 * scale), ImVec2(pos.x + glyph->X1 * scale, pos.y + glyph->Y1 * scale), ImVec2(glyph->U0, glyph->V0), ImVec2(glyph->U1, glyph->V1), col);
+ draw_list->PrimRectUV(ImVec2(x + glyph->X0 * scale, y + glyph->Y0 * scale), ImVec2(x + glyph->X1 * scale, y + glyph->Y1 * scale), ImVec2(glyph->U0, glyph->V0), ImVec2(glyph->U1, glyph->V1), col);
}
// Note: as with every ImDrawList drawing function, this expects that the font atlas texture is bound.
-void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, bool cpu_fine_clip) const
+void ImFont::RenderText(ImDrawList* draw_list, float size, const ImVec2& pos, ImU32 col, const ImVec4& clip_rect, const char* text_begin, const char* text_end, float wrap_width, bool cpu_fine_clip) const
{
if (!text_end)
text_end = text_begin + strlen(text_begin); // ImGui:: functions generally already provides a valid text_end, so this is merely to handle direct calls.
// Align to be pixel perfect
- pos.x = IM_FLOOR(pos.x);
- pos.y = IM_FLOOR(pos.y);
- float x = pos.x;
- float y = pos.y;
+ float x = IM_FLOOR(pos.x);
+ float y = IM_FLOOR(pos.y);
if (y > clip_rect.w)
return;
+ const float start_x = x;
const float scale = size / FontSize;
const float line_height = FontSize * scale;
const bool word_wrap_enabled = (wrap_width > 0.0f);
- const char* word_wrap_eol = NULL;
// Fast-forward to first visible line
const char* s = text_begin;
- if (y + line_height < clip_rect.y && !word_wrap_enabled)
+ if (y + line_height < clip_rect.y)
while (y + line_height < clip_rect.y && s < text_end)
{
- s = (const char*)memchr(s, '\n', text_end - s);
- s = s ? s + 1 : text_end;
+ const char* line_end = (const char*)memchr(s, '\n', text_end - s);
+ 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 = CalcWordWrapNextLineStartA(s, text_end);
+ }
+ else
+ {
+ s = line_end ? line_end + 1 : text_end;
+ }
y += line_height;
}
@@ -3587,6 +3608,7 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
unsigned int vtx_current_idx = draw_list->_VtxCurrentIdx;
const ImU32 col_untinted = col | ~IM_COL32_A_MASK;
+ const char* word_wrap_eol = NULL;
while (s < text_end)
{
@@ -3594,24 +3616,14 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
{
// Calculate how far we can render. Requires two passes on the string data but keeps the code simple and not intrusive for what's essentially an uncommon feature.
if (!word_wrap_eol)
- {
- word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - (x - pos.x));
- if (word_wrap_eol == s) // Wrap_width is too small to fit anything. Force displaying 1 character to minimize the height discontinuity.
- word_wrap_eol++; // +1 may not be a character start point in UTF-8 but it's ok because we use s >= word_wrap_eol below
- }
+ word_wrap_eol = CalcWordWrapPositionA(scale, s, text_end, wrap_width - (x - start_x));
if (s >= word_wrap_eol)
{
- x = pos.x;
+ x = start_x;
y += line_height;
word_wrap_eol = NULL;
-
- // Wrapping skips upcoming blanks
- while (s < text_end)
- {
- const char c = *s;
- if (ImCharIsBlankA(c)) { s++; } else if (c == '\n') { s++; break; } else { break; }
- }
+ s = CalcWordWrapNextLineStartA(s, text_end); // Wrapping skips upcoming blanks
continue;
}
}
@@ -3633,7 +3645,7 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
{
if (c == '\n')
{
- x = pos.x;
+ x = start_x;
y += line_height;
if (y > clip_rect.w)
break; // break out of main loop
@@ -3729,7 +3741,6 @@ void ImFont::RenderText(ImDrawList* draw_list, float size, ImVec2 pos, ImU32 col
// - RenderArrow()
// - RenderBullet()
// - RenderCheckMark()
-// - RenderMouseCursor()
// - RenderArrowPointingAt()
// - RenderRectFilledRangeH()
// - RenderRectFilledWithHole()
@@ -3790,27 +3801,6 @@ void ImGui::RenderCheckMark(ImDrawList* draw_list, ImVec2 pos, ImU32 col, float
draw_list->PathStroke(col, 0, thickness);
}
-void ImGui::RenderMouseCursor(ImDrawList* draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow)
-{
- if (mouse_cursor == ImGuiMouseCursor_None)
- return;
- IM_ASSERT(mouse_cursor > ImGuiMouseCursor_None && mouse_cursor < ImGuiMouseCursor_COUNT);
-
- ImFontAtlas* font_atlas = draw_list->_Data->Font->ContainerAtlas;
- ImVec2 offset, size, uv[4];
- if (font_atlas->GetMouseCursorTexData(mouse_cursor, &offset, &size, &uv[0], &uv[2]))
- {
- pos -= offset;
- 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();
- }
-}
-
// Render an arrow. 'pos' is position of the arrow tip. half_sz.x is length from base to tip. half_sz.y is length on each side.
void ImGui::RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col)
{
@@ -3893,16 +3883,16 @@ void ImGui::RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, Im
draw_list->PathFillConvex(col);
}
-void ImGui::RenderRectFilledWithHole(ImDrawList* draw_list, ImRect outer, ImRect inner, ImU32 col, float rounding)
+void ImGui::RenderRectFilledWithHole(ImDrawList* draw_list, const ImRect& outer, const ImRect& inner, ImU32 col, float rounding)
{
const bool fill_L = (inner.Min.x > outer.Min.x);
const bool fill_R = (inner.Max.x < outer.Max.x);
const bool fill_U = (inner.Min.y > outer.Min.y);
const bool fill_D = (inner.Max.y < outer.Max.y);
- if (fill_L) draw_list->AddRectFilled(ImVec2(outer.Min.x, inner.Min.y), ImVec2(inner.Min.x, inner.Max.y), col, rounding, (fill_U ? 0 : ImDrawFlags_RoundCornersTopLeft) | (fill_D ? 0 : ImDrawFlags_RoundCornersBottomLeft));
- if (fill_R) draw_list->AddRectFilled(ImVec2(inner.Max.x, inner.Min.y), ImVec2(outer.Max.x, inner.Max.y), col, rounding, (fill_U ? 0 : ImDrawFlags_RoundCornersTopRight) | (fill_D ? 0 : ImDrawFlags_RoundCornersBottomRight));
- if (fill_U) draw_list->AddRectFilled(ImVec2(inner.Min.x, outer.Min.y), ImVec2(inner.Max.x, inner.Min.y), col, rounding, (fill_L ? 0 : ImDrawFlags_RoundCornersTopLeft) | (fill_R ? 0 : ImDrawFlags_RoundCornersTopRight));
- if (fill_D) draw_list->AddRectFilled(ImVec2(inner.Min.x, inner.Max.y), ImVec2(inner.Max.x, outer.Max.y), col, rounding, (fill_L ? 0 : ImDrawFlags_RoundCornersBottomLeft) | (fill_R ? 0 : ImDrawFlags_RoundCornersBottomRight));
+ if (fill_L) draw_list->AddRectFilled(ImVec2(outer.Min.x, inner.Min.y), ImVec2(inner.Min.x, inner.Max.y), col, rounding, ImDrawFlags_RoundCornersNone | (fill_U ? 0 : ImDrawFlags_RoundCornersTopLeft) | (fill_D ? 0 : ImDrawFlags_RoundCornersBottomLeft));
+ if (fill_R) draw_list->AddRectFilled(ImVec2(inner.Max.x, inner.Min.y), ImVec2(outer.Max.x, inner.Max.y), col, rounding, ImDrawFlags_RoundCornersNone | (fill_U ? 0 : ImDrawFlags_RoundCornersTopRight) | (fill_D ? 0 : ImDrawFlags_RoundCornersBottomRight));
+ if (fill_U) draw_list->AddRectFilled(ImVec2(inner.Min.x, outer.Min.y), ImVec2(inner.Max.x, inner.Min.y), col, rounding, ImDrawFlags_RoundCornersNone | (fill_L ? 0 : ImDrawFlags_RoundCornersTopLeft) | (fill_R ? 0 : ImDrawFlags_RoundCornersTopRight));
+ if (fill_D) draw_list->AddRectFilled(ImVec2(inner.Min.x, inner.Max.y), ImVec2(inner.Max.x, outer.Max.y), col, rounding, ImDrawFlags_RoundCornersNone | (fill_L ? 0 : ImDrawFlags_RoundCornersBottomLeft) | (fill_R ? 0 : ImDrawFlags_RoundCornersBottomRight));
if (fill_L && fill_U) draw_list->AddRectFilled(ImVec2(outer.Min.x, outer.Min.y), ImVec2(inner.Min.x, inner.Min.y), col, rounding, ImDrawFlags_RoundCornersTopLeft);
if (fill_R && fill_U) draw_list->AddRectFilled(ImVec2(inner.Max.x, outer.Min.y), ImVec2(outer.Max.x, inner.Min.y), col, rounding, ImDrawFlags_RoundCornersTopRight);
if (fill_L && fill_D) draw_list->AddRectFilled(ImVec2(outer.Min.x, inner.Max.y), ImVec2(inner.Min.x, outer.Max.y), col, rounding, ImDrawFlags_RoundCornersBottomLeft);
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h
index 2fa71314fc1..015f6b65756 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_internal.h
@@ -1,4 +1,4 @@
-// dear imgui, v1.85 WIP
+// dear imgui, v1.89.1 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!
@@ -18,13 +18,16 @@ Index of this file:
// [SECTION] Generic helpers
// [SECTION] ImDrawList support
// [SECTION] Widgets support: flags, enums, data structures
+// [SECTION] Inputs support
+// [SECTION] Clipper support
// [SECTION] Navigation support
// [SECTION] Columns support
// [SECTION] Multi-select support
// [SECTION] Docking support
// [SECTION] Viewport support
// [SECTION] Settings support
-// [SECTION] Metrics, Debug
+// [SECTION] Localization support
+// [SECTION] Metrics, Debug tools
// [SECTION] Generic context hooks
// [SECTION] ImGuiContext (main imgui context)
// [SECTION] ImGuiWindowTempData, ImGuiWindow
@@ -119,6 +122,7 @@ struct ImGuiDataTypeInfo; // Type information associated to a ImGuiDat
struct ImGuiGroupData; // Stacked storage data for BeginGroup()/EndGroup()
struct ImGuiInputTextState; // Internal state of the currently focused/edited text input box
struct ImGuiLastItemData; // Status storage for last submitted items
+struct ImGuiLocEntry; // A localization entry.
struct ImGuiMenuColumns; // Simple column measurement, currently used for MenuItem() only
struct ImGuiNavItemData; // Result of a gamepad/keyboard directional navigation move query result
struct ImGuiMetricsConfig; // Storage for ShowMetricsWindow() and DebugNodeXXX() functions
@@ -134,6 +138,7 @@ struct ImGuiTabBar; // Storage for a tab bar
struct ImGuiTabItem; // Storage for a tab item (within a tab bar)
struct ImGuiTable; // Storage for a table
struct ImGuiTableColumn; // Storage for one column of a table
+struct ImGuiTableInstanceData; // Storage for one instance of a same table
struct ImGuiTableTempData; // Temporary storage for one table (one per table in the stack), shared between tables.
struct ImGuiTableSettings; // Storage for a table .ini settings
struct ImGuiTableColumnsSettings; // Storage for a column .ini settings
@@ -141,17 +146,23 @@ struct ImGuiWindow; // Storage for one window
struct ImGuiWindowTempData; // Temporary storage for one window (that's the data which in theory we could ditch at the end of the frame, in practice we currently keep it for each window)
struct ImGuiWindowSettings; // Storage for a window .ini settings (we keep one of those even if the actual window wasn't instanced during this session)
+// Enumerations
// Use your programming IDE "Go to definition" facility on the names of the center columns to find the actual flags/enum lists.
+enum ImGuiLocKey : int; // -> enum ImGuiLocKey // Enum: a localization entry for translation.
typedef int ImGuiLayoutType; // -> enum ImGuiLayoutType_ // Enum: Horizontal or vertical
+
+// Flags
typedef int ImGuiActivateFlags; // -> enum ImGuiActivateFlags_ // Flags: for navigation/focus function (will be for ActivateItem() later)
-typedef int ImGuiItemFlags; // -> enum ImGuiItemFlags_ // Flags: for PushItemFlag()
-typedef int ImGuiItemStatusFlags; // -> enum ImGuiItemStatusFlags_ // Flags: for DC.LastItemStatusFlags
+typedef int ImGuiDebugLogFlags; // -> enum ImGuiDebugLogFlags_ // Flags: for ShowDebugLogWindow(), g.DebugLogFlags
+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
typedef int ImGuiOldColumnFlags; // -> enum ImGuiOldColumnFlags_ // Flags: for BeginColumns()
typedef int ImGuiNavHighlightFlags; // -> enum ImGuiNavHighlightFlags_ // Flags: for RenderNavHighlight()
-typedef int ImGuiNavDirSourceFlags; // -> enum ImGuiNavDirSourceFlags_ // Flags: for GetNavInputAmount2d()
typedef int ImGuiNavMoveFlags; // -> enum ImGuiNavMoveFlags_ // Flags: for navigation requests
typedef int ImGuiNextItemDataFlags; // -> enum ImGuiNextItemDataFlags_ // Flags: for SetNextItemXXX() functions
typedef int ImGuiNextWindowDataFlags; // -> enum ImGuiNextWindowDataFlags_// Flags: for SetNextWindowXXX() functions
+typedef int ImGuiScrollFlags; // -> enum ImGuiScrollFlags_ // Flags: for ScrollToItem() and navigation requests
typedef int ImGuiSeparatorFlags; // -> enum ImGuiSeparatorFlags_ // Flags: for SeparatorEx()
typedef int ImGuiTextFlags; // -> enum ImGuiTextFlags_ // Flags: for TextEx()
typedef int ImGuiTooltipFlags; // -> enum ImGuiTooltipFlags_ // Flags: for BeginTooltipEx()
@@ -189,23 +200,27 @@ namespace ImStb
// [SECTION] Macros
//-----------------------------------------------------------------------------
-// Debug Logging
-#ifndef IMGUI_DEBUG_LOG
-#define IMGUI_DEBUG_LOG(_FMT,...) printf("[%05d] " _FMT, GImGui->FrameCount, __VA_ARGS__)
+// Debug Printing Into TTY
+// (since IMGUI_VERSION_NUM >= 18729: IMGUI_DEBUG_LOG was reworked into IMGUI_DEBUG_PRINTF (and removed framecount from it). If you were using a #define IMGUI_DEBUG_LOG please rename)
+#ifndef IMGUI_DEBUG_PRINTF
+#ifndef IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS
+#define IMGUI_DEBUG_PRINTF(_FMT,...) printf(_FMT, __VA_ARGS__)
+#else
+#define IMGUI_DEBUG_PRINTF(_FMT,...)
+#endif
#endif
-// Debug Logging for selected systems. Remove the '((void)0) //' to enable.
-//#define IMGUI_DEBUG_LOG_POPUP IMGUI_DEBUG_LOG // Enable log
-//#define IMGUI_DEBUG_LOG_NAV IMGUI_DEBUG_LOG // Enable log
-#define IMGUI_DEBUG_LOG_POPUP(...) ((void)0) // Disable log
-#define IMGUI_DEBUG_LOG_NAV(...) ((void)0) // Disable log
+// Debug Logging for ShowDebugLogWindow(). This is designed for relatively rare events so please don't spam.
+#define IMGUI_DEBUG_LOG(...) ImGui::DebugLog(__VA_ARGS__)
+#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)
+#define IMGUI_DEBUG_LOG_NAV(...) do { if (g.DebugLogFlags & ImGuiDebugLogFlags_EventNav) 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)
// Static Asserts
-#if (__cplusplus >= 201100) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201100)
#define IM_STATIC_ASSERT(_COND) static_assert(_COND, "")
-#else
-#define IM_STATIC_ASSERT(_COND) typedef char static_assertion_##__line__[(_COND)?1:-1]
-#endif
// "Paranoid" Debug Asserts are meant to only be enabled during specific debugging/work, otherwise would slow down the code too much.
// We currently don't have many of those so the effect is currently negligible, but onward intent to add more aggressive ones in the code.
@@ -229,8 +244,10 @@ namespace ImStb
#else
#define IM_NEWLINE "\n"
#endif
+#ifndef IM_TABSIZE // Until we move this to runtime and/or add proper tab support, at least allow users to compile-time override
#define IM_TABSIZE (4)
-#define IM_MEMALIGN(_OFF,_ALIGN) (((_OFF) + (_ALIGN - 1)) & ~(_ALIGN - 1)) // Memory align e.g. IM_ALIGN(0,4)=0, IM_ALIGN(1,4)=4, IM_ALIGN(4,4)=4, IM_ALIGN(5,4)=8
+#endif
+#define IM_MEMALIGN(_OFF,_ALIGN) (((_OFF) + ((_ALIGN) - 1)) & ~((_ALIGN) - 1)) // Memory align e.g. IM_ALIGN(0,4)=0, IM_ALIGN(1,4)=4, IM_ALIGN(4,4)=4, IM_ALIGN(5,4)=8
#define IM_F32_TO_INT8_UNBOUND(_VAL) ((int)((_VAL) * 255.0f + ((_VAL)>=0 ? 0.5f : -0.5f))) // Unsaturated, for display purpose
#define IM_F32_TO_INT8_SAT(_VAL) ((int)(ImSaturate(_VAL) * 255.0f + 0.5f)) // Saturated, always output 0..255
#define IM_FLOOR(_VAL) ((float)(int)(_VAL)) // ImFloor() is not inlined in MSVC debug builds
@@ -251,12 +268,19 @@ namespace ImStb
#endif
// Debug Tools
-// Use 'Metrics->Tools->Item Picker' to break into the call-stack of a specific item.
+// Use 'Metrics/Debugger->Tools->Item Picker' to break into the call-stack of a specific item.
+// This will call IM_DEBUG_BREAK() which you may redefine yourself. See https://github.com/scottt/debugbreak for more reference.
#ifndef IM_DEBUG_BREAK
-#if defined(__clang__)
-#define IM_DEBUG_BREAK() __builtin_debugtrap()
-#elif defined (_MSC_VER)
+#if defined (_MSC_VER)
#define IM_DEBUG_BREAK() __debugbreak()
+#elif defined(__clang__)
+#define IM_DEBUG_BREAK() __builtin_debugtrap()
+#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
+#define IM_DEBUG_BREAK() __asm__ volatile("int $0x03")
+#elif defined(__GNUC__) && defined(__thumb__)
+#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xde01")
+#elif defined(__GNUC__) && defined(__arm__) && !defined(__thumb__)
+#define IM_DEBUG_BREAK() __asm__ volatile(".inst 0xe7f001f0");
#else
#define IM_DEBUG_BREAK() IM_ASSERT(0) // It is expected that you define IM_DEBUG_BREAK() into something that will break nicely in a debugger!
#endif
@@ -270,7 +294,8 @@ namespace ImStb
// - Helpers: Hashing
// - Helpers: Sorting
// - Helpers: Bit manipulation
-// - Helpers: String, Formatting
+// - Helpers: String
+// - Helpers: Formatting
// - Helpers: UTF-8 <> wchar conversions
// - Helpers: ImVec2/ImVec4 operators
// - Helpers: Maths
@@ -283,17 +308,17 @@ namespace ImStb
// - Helper: ImSpan<>, ImSpanAllocator<>
// - Helper: ImPool<>
// - Helper: ImChunkStream<>
+// - Helper: ImGuiTextIndex
//-----------------------------------------------------------------------------
// 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);
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
-static inline ImGuiID ImHash(const void* data, int size, ImU32 seed = 0) { return size ? ImHashData(data, (size_t)size, seed) : ImHashStr((const char*)data, 0, seed); } // [moved to ImHashStr/ImHashData in 1.68]
-#endif
// Helpers: Sorting
-#define ImQsort qsort
+#ifndef ImQsort
+static inline void ImQsort(void* base, size_t count, size_t size_of_element, int(IMGUI_CDECL *compare_func)(void const*, void const*)) { if (count > 1) qsort(base, count, size_of_element, compare_func); }
+#endif
// Helpers: Color Blending
IMGUI_API ImU32 ImAlphaBlendColors(ImU32 col_a, ImU32 col_b);
@@ -303,7 +328,7 @@ static inline bool ImIsPowerOfTwo(int v) { return v != 0 && (v &
static inline bool ImIsPowerOfTwo(ImU64 v) { return v != 0 && (v & (v - 1)) == 0; }
static inline int ImUpperPowerOfTwo(int v) { v--; v |= v >> 1; v |= v >> 2; v |= v >> 4; v |= v >> 8; v |= v >> 16; v++; return v; }
-// Helpers: String, Formatting
+// Helpers: String
IMGUI_API int ImStricmp(const char* str1, const char* str2);
IMGUI_API int ImStrnicmp(const char* str1, const char* str2, size_t count);
IMGUI_API void ImStrncpy(char* dst, const char* src, size_t count);
@@ -316,14 +341,23 @@ IMGUI_API const ImWchar*ImStrbolW(const ImWchar* buf_mid_line, const ImWchar* bu
IMGUI_API const char* ImStristr(const char* haystack, const char* haystack_end, const char* needle, const char* needle_end);
IMGUI_API void ImStrTrimBlanks(char* str);
IMGUI_API const char* ImStrSkipBlank(const char* str);
+IM_MSVC_RUNTIME_CHECKS_OFF
+static inline char ImToUpper(char c) { return (c >= 'a' && c <= 'z') ? c &= ~32 : c; }
+static inline bool ImCharIsBlankA(char c) { return c == ' ' || c == '\t'; }
+static inline bool ImCharIsBlankW(unsigned int c) { return c == ' ' || c == '\t' || c == 0x3000; }
+IM_MSVC_RUNTIME_CHECKS_RESTORE
+
+// Helpers: Formatting
IMGUI_API int ImFormatString(char* buf, size_t buf_size, const char* fmt, ...) IM_FMTARGS(3);
IMGUI_API int ImFormatStringV(char* buf, size_t buf_size, const char* fmt, va_list args) IM_FMTLIST(3);
+IMGUI_API void ImFormatStringToTempBuffer(const char** out_buf, const char** out_buf_end, const char* fmt, ...) IM_FMTARGS(3);
+IMGUI_API void ImFormatStringToTempBufferV(const char** out_buf, const char** out_buf_end, const char* fmt, va_list args) IM_FMTLIST(3);
IMGUI_API const char* ImParseFormatFindStart(const char* format);
IMGUI_API const char* ImParseFormatFindEnd(const char* format);
IMGUI_API const char* ImParseFormatTrimDecorations(const char* format, char* buf, size_t buf_size);
+IMGUI_API void ImParseFormatSanitizeForPrinting(const char* fmt_in, char* fmt_out, size_t fmt_out_size);
+IMGUI_API const char* ImParseFormatSanitizeForScanning(const char* fmt_in, char* fmt_out, size_t fmt_out_size);
IMGUI_API int ImParseFormatPrecision(const char* format, int default_value);
-static inline bool ImCharIsBlankA(char c) { return c == ' ' || c == '\t'; }
-static inline bool ImCharIsBlankW(unsigned int c) { return c == ' ' || c == '\t' || c == 0x3000; }
// Helpers: UTF-8 <> wchar conversions
IMGUI_API const char* ImTextCharToUtf8(char out_buf[5], unsigned int c); // return out_buf
@@ -400,8 +434,8 @@ static inline double ImLog(double x) { return log(x); }
static inline int ImAbs(int x) { return x < 0 ? -x : x; }
static inline float ImAbs(float x) { return fabsf(x); }
static inline double ImAbs(double x) { return fabs(x); }
-static inline float ImSign(float x) { return (x < 0.0f) ? -1.0f : ((x > 0.0f) ? 1.0f : 0.0f); } // Sign operator - returns -1, 0 or 1 based on sign of argument
-static inline double ImSign(double x) { return (x < 0.0) ? -1.0 : ((x > 0.0) ? 1.0 : 0.0); }
+static inline float ImSign(float x) { return (x < 0.0f) ? -1.0f : (x > 0.0f) ? 1.0f : 0.0f; } // Sign operator - returns -1, 0 or 1 based on sign of argument
+static inline double ImSign(double x) { return (x < 0.0) ? -1.0 : (x > 0.0) ? 1.0 : 0.0; }
#ifdef IMGUI_ENABLE_SSE
static inline float ImRsqrt(float x) { return _mm_cvtss_f32(_mm_rsqrt_ss(_mm_set_ss(x))); }
#else
@@ -430,13 +464,15 @@ static inline float ImLengthSqr(const ImVec2& lhs)
static inline float ImLengthSqr(const ImVec4& lhs) { return (lhs.x * lhs.x) + (lhs.y * lhs.y) + (lhs.z * lhs.z) + (lhs.w * lhs.w); }
static inline float ImInvLength(const ImVec2& lhs, float fail_value) { float d = (lhs.x * lhs.x) + (lhs.y * lhs.y); if (d > 0.0f) return ImRsqrt(d); return fail_value; }
static inline float ImFloor(float f) { return (float)(int)(f); }
-static inline float ImFloorSigned(float f) { return (float)((f >= 0 || (int)f == f) ? (int)f : (int)f - 1); } // Decent replacement for floorf()
+static inline float ImFloorSigned(float f) { return (float)((f >= 0 || (float)(int)f == f) ? (int)f : (int)f - 1); } // Decent replacement for floorf()
static inline ImVec2 ImFloor(const ImVec2& v) { return ImVec2((float)(int)(v.x), (float)(int)(v.y)); }
+static inline ImVec2 ImFloorSigned(const ImVec2& v) { return ImVec2(ImFloorSigned(v.x), ImFloorSigned(v.y)); }
static inline int ImModPositive(int a, int b) { return (a + b) % b; }
static inline float ImDot(const ImVec2& a, const ImVec2& b) { return a.x * b.x + a.y * b.y; }
static inline ImVec2 ImRotate(const ImVec2& v, float cos_a, float sin_a) { return ImVec2(v.x * cos_a - v.y * sin_a, v.x * sin_a + v.y * cos_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; }
IM_MSVC_RUNTIME_CHECKS_RESTORE
// Helpers: Geometry
@@ -457,17 +493,17 @@ IM_MSVC_RUNTIME_CHECKS_OFF
struct ImVec1
{
float x;
- ImVec1() { x = 0.0f; }
- ImVec1(float _x) { x = _x; }
+ constexpr ImVec1() : x(0.0f) { }
+ constexpr ImVec1(float _x) : x(_x) { }
};
// Helper: ImVec2ih (2D vector, half-size integer, for long-term packed storage)
struct ImVec2ih
{
short x, y;
- ImVec2ih() { x = y = 0; }
- ImVec2ih(short _x, short _y) { x = _x; y = _y; }
- explicit ImVec2ih(const ImVec2& rhs) { x = (short)rhs.x; y = (short)rhs.y; }
+ constexpr ImVec2ih() : x(0), y(0) {}
+ constexpr ImVec2ih(short _x, short _y) : x(_x), y(_y) {}
+ constexpr explicit ImVec2ih(const ImVec2& rhs) : x((short)rhs.x), y((short)rhs.y) {}
};
// Helper: ImRect (2D axis aligned bounding-box)
@@ -477,10 +513,10 @@ struct IMGUI_API ImRect
ImVec2 Min; // Upper-left
ImVec2 Max; // Lower-right
- ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f) {}
- ImRect(const ImVec2& min, const ImVec2& max) : Min(min), Max(max) {}
- ImRect(const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {}
- ImRect(float x1, float y1, float x2, float y2) : Min(x1, y1), Max(x2, y2) {}
+ constexpr ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f) {}
+ constexpr ImRect(const ImVec2& min, const ImVec2& max) : Min(min), Max(max) {}
+ constexpr ImRect(const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {}
+ constexpr ImRect(float x1, float y1, float x2, float y2) : Min(x1, y1), Max(x2, y2) {}
ImVec2 GetCenter() const { return ImVec2((Min.x + Max.x) * 0.5f, (Min.y + Max.y) * 0.5f); }
ImVec2 GetSize() const { return ImVec2(Max.x - Min.x, Max.y - Min.y); }
@@ -528,17 +564,18 @@ inline void ImBitArraySetBitRange(ImU32* arr, int n, int n2) // Works on ran
// Helper: ImBitArray class (wrapper over ImBitArray functions)
// Store 1-bit per value.
-template<int BITCOUNT>
-struct IMGUI_API ImBitArray
+template<int BITCOUNT, int OFFSET = 0>
+struct ImBitArray
{
ImU32 Storage[(BITCOUNT + 31) >> 5];
ImBitArray() { ClearAllBits(); }
void ClearAllBits() { memset(Storage, 0, sizeof(Storage)); }
void SetAllBits() { memset(Storage, 255, sizeof(Storage)); }
- bool TestBit(int n) const { IM_ASSERT(n < BITCOUNT); return ImBitArrayTestBit(Storage, n); }
- void SetBit(int n) { IM_ASSERT(n < BITCOUNT); ImBitArraySetBit(Storage, n); }
- void ClearBit(int n) { IM_ASSERT(n < BITCOUNT); ImBitArrayClearBit(Storage, n); }
- void SetBitRange(int n, int n2) { ImBitArraySetBitRange(Storage, n, n2); } // Works on range [n..n2)
+ bool TestBit(int n) const { n += OFFSET; IM_ASSERT(n >= 0 && n < BITCOUNT); return ImBitArrayTestBit(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); }
};
// Helper: ImBitVector
@@ -609,7 +646,7 @@ struct ImSpanAllocator
// Honor constructor/destructor. Add/remove invalidate all pointers. Indexes have the same lifetime as the associated object.
typedef int ImPoolIdx;
template<typename T>
-struct IMGUI_API ImPool
+struct ImPool
{
ImVector<T> Buf; // Contiguous data
ImGuiStorage Map; // ID->Index
@@ -646,7 +683,7 @@ struct IMGUI_API ImPool
// We store the chunk size first, and align the final size on 4 bytes boundaries.
// The tedious/zealous amount of casting is to avoid -Wcast-align warnings.
template<typename T>
-struct IMGUI_API ImChunkStream
+struct ImChunkStream
{
ImVector<char> Buf;
@@ -664,6 +701,20 @@ struct IMGUI_API ImChunkStream
};
+// Helper: ImGuiTextIndex<>
+// Maintain a line index for a text buffer. This is a strong candidate to be moved into the public API.
+struct ImGuiTextIndex
+{
+ ImVector<int> LineOffsets;
+ int EndOffset = 0; // Because we don't own text buffer we need to maintain EndOffset (may bake in LineOffsets?)
+
+ void clear() { LineOffsets.clear(); EndOffset = 0; }
+ int size() { return LineOffsets.Size; }
+ const char* get_line_begin(const char* base, int n) { return base + LineOffsets[n]; }
+ const char* get_line_end(const char* base, int n) { return base + (n + 1 < LineOffsets.Size ? (LineOffsets[n + 1] - 1) : EndOffset); }
+ void append(const char* base, int old_size, int new_size);
+};
+
//-----------------------------------------------------------------------------
// [SECTION] ImDrawList support
//-----------------------------------------------------------------------------
@@ -678,7 +729,6 @@ struct IMGUI_API ImChunkStream
//
// Rendering circles with an odd number of segments, while mathematically correct will produce
// asymmetrical results on the raster grid. Therefore we're rounding N to next even number (7->8, 8->8, 9->10 etc.)
-//
#define IM_ROUNDUP_TO_EVEN(_V) ((((_V) + 1) / 2) * 2)
#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MIN 4
#define IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX 512
@@ -706,6 +756,9 @@ struct IMGUI_API ImDrawListSharedData
ImVec4 ClipRectFullscreen; // Value for PushClipRectFullscreen()
ImDrawListFlags InitialFlags; // Initial flags at the beginning of the frame (it is possible to alter flags on a per-drawlist basis afterwards)
+ // [Internal] Temp write buffer
+ ImVector<ImVec2> TempBuffer;
+
// [Internal] Lookup tables
ImVec2 ArcFastVtx[IM_DRAWLIST_ARCFAST_TABLE_SIZE]; // Sample points on the quarter of the circle.
float ArcFastRadiusCutoff; // Cutoff radius after which arc drawing will fallback to slower PathArcTo()
@@ -730,10 +783,14 @@ struct ImDrawDataBuilder
// [SECTION] Widgets support: flags, enums, data structures
//-----------------------------------------------------------------------------
-// Transient per-window flags, reset at the beginning of the frame. For child window, inherited from parent on first Begin().
+// Flags used by upcoming items
+// - input: PushItemFlag() manipulates g.CurrentItemFlags, ItemAdd() calls may add extra flags.
+// - output: stored in g.LastItemData.InFlags
+// Current window shared by all windows.
// This is going to be exposed in imgui.h when stabilized enough.
enum ImGuiItemFlags_
{
+ // Controlled by user
ImGuiItemFlags_None = 0,
ImGuiItemFlags_NoTabStop = 1 << 0, // false // Disable keyboard tabbing (FIXME: should merge with _NoNav)
ImGuiItemFlags_ButtonRepeat = 1 << 1, // false // Button() will return true multiple times based on io.KeyRepeatDelay and io.KeyRepeatRate settings.
@@ -743,10 +800,14 @@ enum ImGuiItemFlags_
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)
ImGuiItemFlags_ReadOnly = 1 << 7, // false // [ALPHA] Allow hovering interactions but underlying value is not changed.
- ImGuiItemFlags_Inputable = 1 << 8 // false // [WIP] Auto-activate item when focused. Currently only used and supported by a few items before it becomes a generic feature.
+ ImGuiItemFlags_NoWindowHoverableCheck = 1 << 8, // false // Disable hoverable check in ItemHoverable()
+
+ // Controlled by widget code
+ ImGuiItemFlags_Inputable = 1 << 10, // false // [WIP] Auto-activate input mode when tab focused. Currently only used and supported by a few items before it becomes a generic feature.
};
-// Storage for LastItem data
+// Status flags for an already submitted item
+// - output: stored in g.LastItemData.StatusFlags
enum ImGuiItemStatusFlags_
{
ImGuiItemStatusFlags_None = 0,
@@ -758,16 +819,14 @@ enum ImGuiItemStatusFlags_
ImGuiItemStatusFlags_HasDeactivated = 1 << 5, // Set if the widget/group is able to provide data for the ImGuiItemStatusFlags_Deactivated flag.
ImGuiItemStatusFlags_Deactivated = 1 << 6, // Only valid if ImGuiItemStatusFlags_HasDeactivated is set.
ImGuiItemStatusFlags_HoveredWindow = 1 << 7, // Override the HoveredWindow test to allow cross-window hover testing.
- ImGuiItemStatusFlags_FocusedByCode = 1 << 8, // Set when the Focusable item just got focused from code.
- ImGuiItemStatusFlags_FocusedByTabbing = 1 << 9, // Set when the Focusable item just got focused by Tabbing.
- ImGuiItemStatusFlags_Focused = ImGuiItemStatusFlags_FocusedByCode | ImGuiItemStatusFlags_FocusedByTabbing
+ 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()).
#ifdef IMGUI_ENABLE_TEST_ENGINE
- , // [imgui_tests only]
- ImGuiItemStatusFlags_Openable = 1 << 20, //
+ ImGuiItemStatusFlags_Openable = 1 << 20, // Item is an openable (e.g. TreeNode)
ImGuiItemStatusFlags_Opened = 1 << 21, //
- ImGuiItemStatusFlags_Checkable = 1 << 22, //
- ImGuiItemStatusFlags_Checked = 1 << 23 //
+ ImGuiItemStatusFlags_Checkable = 1 << 22, // Item is a checkable (e.g. CheckBox, MenuItem)
+ ImGuiItemStatusFlags_Checked = 1 << 23, //
#endif
};
@@ -777,7 +836,7 @@ enum ImGuiInputTextFlagsPrivate_
// [Internal]
ImGuiInputTextFlags_Multiline = 1 << 26, // For internal use by InputTextMultiline()
ImGuiInputTextFlags_NoMarkEdited = 1 << 27, // For internal use by functions using InputText() before reformatting data
- ImGuiInputTextFlags_MergedItem = 1 << 28 // For internal use by TempInputText(), will skip calling ItemAdd(). Require bounding-box to strictly match.
+ ImGuiInputTextFlags_MergedItem = 1 << 28, // For internal use by TempInputText(), will skip calling ItemAdd(). Require bounding-box to strictly match.
};
// Extend ImGuiButtonFlags_
@@ -797,23 +856,25 @@ enum ImGuiButtonFlagsPrivate_
ImGuiButtonFlags_AlignTextBaseLine = 1 << 15, // vertically align button to match text baseline - ButtonEx() only // FIXME: Should be removed and handled by SmallButton(), not possible currently because of DC.CursorPosPrevLine
ImGuiButtonFlags_NoKeyModifiers = 1 << 16, // disable mouse interaction if a key modifier is held
ImGuiButtonFlags_NoHoldingActiveId = 1 << 17, // don't set ActiveId while holding the mouse (ImGuiButtonFlags_PressedOnClick only)
- ImGuiButtonFlags_NoNavFocus = 1 << 18, // don't override navigation focus when activated
+ ImGuiButtonFlags_NoNavFocus = 1 << 18, // don't override navigation focus when activated (FIXME: this is essentially used everytime an item uses ImGuiItemFlags_NoNav, but because legacy specs don't requires LastItemData to be set ButtonBehavior(), we can't poll g.LastItemData.InFlags)
ImGuiButtonFlags_NoHoveredOnFocus = 1 << 19, // don't report as hovered when nav focus is on this item
+ ImGuiButtonFlags_NoSetKeyOwner = 1 << 20, // don't set key/input owner on the initial click (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
+ ImGuiButtonFlags_NoTestKeyOwner = 1 << 21, // don't test key/input owner when polling the key (note: mouse buttons are keys! often, the key in question will be ImGuiKey_MouseLeft!)
ImGuiButtonFlags_PressedOnMask_ = ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere | ImGuiButtonFlags_PressedOnRelease | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_PressedOnDragDropHold,
- ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease
+ ImGuiButtonFlags_PressedOnDefault_ = ImGuiButtonFlags_PressedOnClickRelease,
};
// Extend ImGuiComboFlags_
enum ImGuiComboFlagsPrivate_
{
- ImGuiComboFlags_CustomPreview = 1 << 20 // enable BeginComboPreview()
+ ImGuiComboFlags_CustomPreview = 1 << 20, // enable BeginComboPreview()
};
// Extend ImGuiSliderFlags_
enum ImGuiSliderFlagsPrivate_
{
ImGuiSliderFlags_Vertical = 1 << 20, // Should this slider be orientated vertically?
- ImGuiSliderFlags_ReadOnly = 1 << 21
+ ImGuiSliderFlags_ReadOnly = 1 << 21,
};
// Extend ImGuiSelectableFlags_
@@ -827,33 +888,34 @@ enum ImGuiSelectableFlagsPrivate_
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_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!)
};
// Extend ImGuiTreeNodeFlags_
enum ImGuiTreeNodeFlagsPrivate_
{
- ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 20
+ ImGuiTreeNodeFlags_ClipLabelForTrailingButton = 1 << 20,
};
enum ImGuiSeparatorFlags_
{
- ImGuiSeparatorFlags_None = 0,
- ImGuiSeparatorFlags_Horizontal = 1 << 0, // Axis default to current layout type, so generally Horizontal unless e.g. in a menu bar
- ImGuiSeparatorFlags_Vertical = 1 << 1,
- ImGuiSeparatorFlags_SpanAllColumns = 1 << 2
+ ImGuiSeparatorFlags_None = 0,
+ ImGuiSeparatorFlags_Horizontal = 1 << 0, // Axis default to current layout type, so generally Horizontal unless e.g. in a menu bar
+ ImGuiSeparatorFlags_Vertical = 1 << 1,
+ ImGuiSeparatorFlags_SpanAllColumns = 1 << 2,
};
enum ImGuiTextFlags_
{
- ImGuiTextFlags_None = 0,
- ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0
+ ImGuiTextFlags_None = 0,
+ ImGuiTextFlags_NoWidthForLargeClippedText = 1 << 0,
};
enum ImGuiTooltipFlags_
{
- ImGuiTooltipFlags_None = 0,
- ImGuiTooltipFlags_OverridePreviousTooltip = 1 << 0 // Override will clear/ignore previously submitted tooltip (defaults to append)
+ ImGuiTooltipFlags_None = 0,
+ ImGuiTooltipFlags_OverridePreviousTooltip = 1 << 0, // Override will clear/ignore previously submitted tooltip (defaults to append)
};
// FIXME: this is in development, not exposed/functional as a generic feature yet.
@@ -870,7 +932,7 @@ enum ImGuiLogType
ImGuiLogType_TTY,
ImGuiLogType_File,
ImGuiLogType_Buffer,
- ImGuiLogType_Clipboard
+ ImGuiLogType_Clipboard,
};
// X/Y enums are fixed to 0/1 so they may be used to index ImVec2
@@ -884,36 +946,14 @@ enum ImGuiAxis
enum ImGuiPlotType
{
ImGuiPlotType_Lines,
- ImGuiPlotType_Histogram
-};
-
-enum ImGuiInputSource
-{
- ImGuiInputSource_None = 0,
- ImGuiInputSource_Mouse,
- ImGuiInputSource_Keyboard,
- ImGuiInputSource_Gamepad,
- ImGuiInputSource_Nav, // Stored in g.ActiveIdSource only
- ImGuiInputSource_Clipboard, // Currently only used by InputText()
- ImGuiInputSource_COUNT
-};
-
-// FIXME-NAV: Clarify/expose various repeat delay/rate
-enum ImGuiInputReadMode
-{
- ImGuiInputReadMode_Down,
- ImGuiInputReadMode_Pressed,
- ImGuiInputReadMode_Released,
- ImGuiInputReadMode_Repeat,
- ImGuiInputReadMode_RepeatSlow,
- ImGuiInputReadMode_RepeatFast
+ ImGuiPlotType_Histogram,
};
enum ImGuiPopupPositionPolicy
{
ImGuiPopupPositionPolicy_Default,
ImGuiPopupPositionPolicy_ComboBox,
- ImGuiPopupPositionPolicy_Tooltip
+ ImGuiPopupPositionPolicy_Tooltip,
};
struct ImGuiDataTypeTempStorage
@@ -935,14 +975,14 @@ enum ImGuiDataTypePrivate_
{
ImGuiDataType_String = ImGuiDataType_COUNT + 1,
ImGuiDataType_Pointer,
- ImGuiDataType_ID
+ ImGuiDataType_ID,
};
// Stacked color modifier, backup of modified data so we can restore it
struct ImGuiColorMod
{
- ImGuiCol Col;
- ImVec4 BackupValue;
+ ImGuiCol Col;
+ ImVec4 BackupValue;
};
// Stacked style modifier, backup of modified data so we can restore it. Data type inferred from the variable.
@@ -1019,9 +1059,7 @@ struct IMGUI_API ImGuiInputTextState
bool CursorFollow; // set when we want scrolling to follow the current cursor position (not always!)
bool SelectedAllMouseLock; // after a double-click to select all, we ignore further mouse drags to update selection
bool Edited; // edited this frame
- ImGuiInputTextFlags Flags; // copy of InputText() flags
- ImGuiInputTextCallback UserCallback; // "
- void* UserCallbackData; // "
+ ImGuiInputTextFlags Flags; // copy of InputText() flags. may be used to check if e.g. ImGuiInputTextFlags_Password is set.
ImGuiInputTextState() { memset(this, 0, sizeof(*this)); }
void ClearText() { CurLenW = CurLenA = 0; TextW[0] = 0; TextA[0] = 0; CursorClamp(); }
@@ -1046,13 +1084,14 @@ struct ImGuiPopupData
{
ImGuiID PopupId; // Set on OpenPopup()
ImGuiWindow* Window; // Resolved on BeginPopup() - may stay unresolved if user never calls OpenPopup()
- ImGuiWindow* SourceWindow; // Set on OpenPopup() copy of NavWindow at the time of opening the popup
+ ImGuiWindow* BackupNavWindow;// Set on OpenPopup(), a NavWindow that will be restored on popup close
+ int ParentNavLayer; // Resolved on BeginPopup(). Actually a ImGuiNavLayer type (declared down below), initialized to -1 which is not part of an enum, but serves well-enough as "not any of layers" value
int OpenFrameCount; // Set on OpenPopup()
ImGuiID OpenParentId; // Set on OpenPopup(), we need this to differentiate multiple menu sets from each others (e.g. inside menu bar vs loose menu items)
ImVec2 OpenPopupPos; // Set on OpenPopup(), preferred popup position (typically == OpenMousePos when using mouse)
ImVec2 OpenMousePos; // Set on OpenPopup(), copy of mouse position at the time of opening popup
- ImGuiPopupData() { memset(this, 0, sizeof(*this)); OpenFrameCount = -1; }
+ ImGuiPopupData() { memset(this, 0, sizeof(*this)); ParentNavLayer = OpenFrameCount = -1; }
};
enum ImGuiNextWindowDataFlags_
@@ -1065,7 +1104,7 @@ enum ImGuiNextWindowDataFlags_
ImGuiNextWindowDataFlags_HasSizeConstraint = 1 << 4,
ImGuiNextWindowDataFlags_HasFocus = 1 << 5,
ImGuiNextWindowDataFlags_HasBgAlpha = 1 << 6,
- ImGuiNextWindowDataFlags_HasScroll = 1 << 7
+ ImGuiNextWindowDataFlags_HasScroll = 1 << 7,
};
// Storage for SetNexWindow** functions
@@ -1095,7 +1134,7 @@ enum ImGuiNextItemDataFlags_
{
ImGuiNextItemDataFlags_None = 0,
ImGuiNextItemDataFlags_HasWidth = 1 << 0,
- ImGuiNextItemDataFlags_HasOpen = 1 << 1
+ ImGuiNextItemDataFlags_HasOpen = 1 << 1,
};
struct ImGuiNextItemData
@@ -1152,6 +1191,7 @@ struct ImGuiShrinkWidthItem
{
int Index;
float Width;
+ float InitialWidth;
};
struct ImGuiPtrOrIndex
@@ -1164,6 +1204,203 @@ struct ImGuiPtrOrIndex
};
//-----------------------------------------------------------------------------
+// [SECTION] Inputs support
+//-----------------------------------------------------------------------------
+
+typedef ImBitArray<ImGuiKey_NamedKey_COUNT, -ImGuiKey_NamedKey_BEGIN> ImBitArrayForNamedKeys;
+
+// [Internal] Key ranges
+#define ImGuiKey_LegacyNativeKey_BEGIN 0
+#define ImGuiKey_LegacyNativeKey_END 512
+#define ImGuiKey_Keyboard_BEGIN (ImGuiKey_NamedKey_BEGIN)
+#define ImGuiKey_Keyboard_END (ImGuiKey_GamepadStart)
+#define ImGuiKey_Gamepad_BEGIN (ImGuiKey_GamepadStart)
+#define ImGuiKey_Gamepad_END (ImGuiKey_GamepadRStickDown + 1)
+#define ImGuiKey_Mouse_BEGIN (ImGuiKey_MouseLeft)
+#define ImGuiKey_Mouse_END (ImGuiKey_MouseWheelY + 1)
+#define ImGuiKey_Aliases_BEGIN (ImGuiKey_Mouse_BEGIN)
+#define ImGuiKey_Aliases_END (ImGuiKey_Mouse_END)
+
+// [Internal] Named shortcuts for Navigation
+#define ImGuiKey_NavKeyboardTweakSlow ImGuiMod_Ctrl
+#define ImGuiKey_NavKeyboardTweakFast ImGuiMod_Shift
+#define ImGuiKey_NavGamepadTweakSlow ImGuiKey_GamepadL1
+#define ImGuiKey_NavGamepadTweakFast ImGuiKey_GamepadR1
+#define ImGuiKey_NavGamepadActivate ImGuiKey_GamepadFaceDown
+#define ImGuiKey_NavGamepadCancel ImGuiKey_GamepadFaceRight
+#define ImGuiKey_NavGamepadMenu ImGuiKey_GamepadFaceLeft
+#define ImGuiKey_NavGamepadInput ImGuiKey_GamepadFaceUp
+
+enum ImGuiInputEventType
+{
+ ImGuiInputEventType_None = 0,
+ ImGuiInputEventType_MousePos,
+ ImGuiInputEventType_MouseWheel,
+ ImGuiInputEventType_MouseButton,
+ ImGuiInputEventType_Key,
+ ImGuiInputEventType_Text,
+ ImGuiInputEventType_Focus,
+ ImGuiInputEventType_COUNT
+};
+
+enum ImGuiInputSource
+{
+ ImGuiInputSource_None = 0,
+ ImGuiInputSource_Mouse,
+ ImGuiInputSource_Keyboard,
+ ImGuiInputSource_Gamepad,
+ ImGuiInputSource_Clipboard, // Currently only used by InputText()
+ ImGuiInputSource_Nav, // Stored in g.ActiveIdSource only
+ ImGuiInputSource_COUNT
+};
+
+// 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 ImGuiInputEventKey { ImGuiKey Key; bool Down; float AnalogValue; };
+struct ImGuiInputEventText { unsigned int Char; };
+struct ImGuiInputEventAppFocused { bool Focused; };
+
+struct ImGuiInputEvent
+{
+ ImGuiInputEventType Type;
+ ImGuiInputSource Source;
+ union
+ {
+ ImGuiInputEventMousePos MousePos; // if Type == ImGuiInputEventType_MousePos
+ ImGuiInputEventMouseWheel MouseWheel; // if Type == ImGuiInputEventType_MouseWheel
+ ImGuiInputEventMouseButton MouseButton; // if Type == ImGuiInputEventType_MouseButton
+ ImGuiInputEventKey Key; // if Type == ImGuiInputEventType_Key
+ ImGuiInputEventText Text; // if Type == ImGuiInputEventType_Text
+ ImGuiInputEventAppFocused AppFocused; // if Type == ImGuiInputEventType_Focus
+ };
+ bool AddedByTestEngine;
+
+ ImGuiInputEvent() { memset(this, 0, sizeof(*this)); }
+};
+
+// Input function taking an 'ImGuiID owner_id' argument defaults to (ImGuiKeyOwner_Any == 0) aka don't test ownership, which matches legacy behavior.
+#define ImGuiKeyOwner_Any ((ImGuiID)0) // Accept key that have an owner, UNLESS a call to SetKeyOwner() explicitly used ImGuiInputFlags_LockThisFrame or ImGuiInputFlags_LockUntilRelease.
+#define ImGuiKeyOwner_None ((ImGuiID)-1) // Require key to have no owner.
+
+typedef ImS16 ImGuiKeyRoutingIndex;
+
+// Routing table entry (sizeof() == 16 bytes)
+struct ImGuiKeyRoutingData
+{
+ ImGuiKeyRoutingIndex NextEntryIndex;
+ ImU16 Mods; // Technically we'd only need 4 bits but for simplify we store ImGuiMod_ values which need 16 bits.
+ ImU8 RoutingNextScore; // Lower is better (0: perfect score)
+ ImGuiID RoutingCurr;
+ ImGuiID RoutingNext;
+
+ ImGuiKeyRoutingData() { NextEntryIndex = -1; Mods = 0; RoutingNextScore = 255; RoutingCurr = RoutingNext = ImGuiKeyOwner_None; }
+};
+
+// Routing table: maintain a desired owner for each possible key-chord (key + mods), and setup owner in NewFrame() when mods are matching.
+// Stored in main context (1 instance)
+struct ImGuiKeyRoutingTable
+{
+ ImGuiKeyRoutingIndex Index[ImGuiKey_NamedKey_COUNT]; // Index of first entry in Entries[]
+ ImVector<ImGuiKeyRoutingData> Entries;
+ ImVector<ImGuiKeyRoutingData> EntriesNext; // Double-buffer to avoid reallocation (could use a shared buffer)
+
+ ImGuiKeyRoutingTable() { Clear(); }
+ void Clear() { for (int n = 0; n < IM_ARRAYSIZE(Index); n++) Index[n] = -1; Entries.clear(); EntriesNext.clear(); }
+};
+
+// This extends ImGuiKeyData but only for named keys (legacy keys don't support the new features)
+// Stored in main context (1 per named key). In the future it might be merged into ImGuiKeyData.
+struct ImGuiKeyOwnerData
+{
+ ImGuiID OwnerCurr;
+ ImGuiID OwnerNext;
+ bool LockThisFrame; // Reading this key requires explicit owner id (until end of frame). Set by ImGuiInputFlags_LockThisFrame.
+ bool LockUntilRelease; // Reading this key requires explicit owner id (until key is released). Set by ImGuiInputFlags_LockUntilRelease. When this is true LockThisFrame is always true as well.
+
+ ImGuiKeyOwnerData() { OwnerCurr = OwnerNext = ImGuiKeyOwner_None; LockThisFrame = LockUntilRelease = false; }
+};
+
+// Flags for extended versions of IsKeyPressed(), IsMouseClicked(), Shortcut(), SetKeyOwner(), SetItemKeyOwner()
+// Don't mistake with ImGuiInputTextFlags! (for ImGui::InputText() function)
+enum ImGuiInputFlags_
+{
+ // Flags for IsKeyPressed(), IsMouseClicked(), Shortcut()
+ ImGuiInputFlags_None = 0,
+ ImGuiInputFlags_Repeat = 1 << 0, // Return true on successive repeats. Default for legacy IsKeyPressed(). NOT Default for legacy IsMouseClicked(). MUST BE == 1.
+ ImGuiInputFlags_RepeatRateDefault = 1 << 1, // Repeat rate: Regular (default)
+ ImGuiInputFlags_RepeatRateNavMove = 1 << 2, // Repeat rate: Fast
+ ImGuiInputFlags_RepeatRateNavTweak = 1 << 3, // Repeat rate: Faster
+ ImGuiInputFlags_RepeatRateMask_ = ImGuiInputFlags_RepeatRateDefault | ImGuiInputFlags_RepeatRateNavMove | ImGuiInputFlags_RepeatRateNavTweak,
+
+ // Flags for SetItemKeyOwner()
+ ImGuiInputFlags_CondHovered = 1 << 4, // Only set if item is hovered (default to both)
+ ImGuiInputFlags_CondActive = 1 << 5, // Only set if item is active (default to both)
+ ImGuiInputFlags_CondDefault_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
+ ImGuiInputFlags_CondMask_ = ImGuiInputFlags_CondHovered | ImGuiInputFlags_CondActive,
+
+ // Flags for SetKeyOwner(), SetItemKeyOwner()
+ ImGuiInputFlags_LockThisFrame = 1 << 6, // Access to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared at end of frame. This is useful to make input-owner-aware code steal keys from non-input-owner-aware code.
+ ImGuiInputFlags_LockUntilRelease = 1 << 7, // Access to key data will require EXPLICIT owner ID (ImGuiKeyOwner_Any/0 will NOT accepted for polling). Cleared when the key is released or at end of each frame if key is released. This is useful to make input-owner-aware code steal keys from non-input-owner-aware code.
+
+ // Routing policies for Shortcut() + low-level SetShortcutRouting()
+ // - The general idea is that several callers register interest in a shortcut, and only one owner gets it.
+ // - When a policy (other than _RouteAlways) is set, Shortcut() will register itself with SetShortcutRouting(),
+ // allowing the system to decide where to route the input among other route-aware calls.
+ // - Shortcut() uses ImGuiInputFlags_RouteFocused by default: meaning that a simple Shortcut() poll
+ // will register a route and only succeed when parent window is in the focus stack and if no-one
+ // with a higher priority is claiming the shortcut.
+ // - Using ImGuiInputFlags_RouteAlways is roughly equivalent to doing e.g. IsKeyPressed(key) + testing mods.
+ // - Priorities: GlobalHigh > Focused (when owner is active item) > Global > Focused (when focused window) > GlobalLow.
+ // - Can select only 1 policy among all available.
+ ImGuiInputFlags_RouteFocused = 1 << 8, // (Default) Register focused route: Accept inputs if window is in focus stack. Deep-most focused window takes inputs. ActiveId takes inputs over deep-most focused window.
+ ImGuiInputFlags_RouteGlobalLow = 1 << 9, // Register route globally (lowest priority: unless a focused window or active item registered the route) -> recommended Global priority.
+ ImGuiInputFlags_RouteGlobal = 1 << 10, // Register route globally (medium priority: unless an active item registered the route, e.g. CTRL+A registered by InputText).
+ ImGuiInputFlags_RouteGlobalHigh = 1 << 11, // Register route globally (highest priority: unlikely you need to use that: will interfere with every active items)
+ ImGuiInputFlags_RouteMask_ = ImGuiInputFlags_RouteFocused | ImGuiInputFlags_RouteGlobal | ImGuiInputFlags_RouteGlobalLow | ImGuiInputFlags_RouteGlobalHigh, // _Always not part of this!
+ ImGuiInputFlags_RouteAlways = 1 << 12, // Do not register route, poll keys directly.
+ ImGuiInputFlags_RouteUnlessBgFocused= 1 << 13, // Global routes will not be applied if underlying background/void is focused (== no Dear ImGui windows are focused). Useful for overlay applications.
+ ImGuiInputFlags_RouteExtraMask_ = ImGuiInputFlags_RouteAlways | ImGuiInputFlags_RouteUnlessBgFocused,
+
+ // [Internal] Mask of which function support which flags
+ ImGuiInputFlags_SupportedByIsKeyPressed = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_,
+ ImGuiInputFlags_SupportedByShortcut = ImGuiInputFlags_Repeat | ImGuiInputFlags_RepeatRateMask_ | ImGuiInputFlags_RouteMask_ | ImGuiInputFlags_RouteExtraMask_,
+ ImGuiInputFlags_SupportedBySetKeyOwner = ImGuiInputFlags_LockThisFrame | ImGuiInputFlags_LockUntilRelease,
+ ImGuiInputFlags_SupportedBySetItemKeyOwner = ImGuiInputFlags_SupportedBySetKeyOwner | ImGuiInputFlags_CondMask_,
+};
+
+//-----------------------------------------------------------------------------
+// [SECTION] Clipper support
+//-----------------------------------------------------------------------------
+
+struct ImGuiListClipperRange
+{
+ int Min;
+ int Max;
+ bool PosToIndexConvert; // Begin/End are absolute position (will be converted to indices later)
+ ImS8 PosToIndexOffsetMin; // Add to Min after converting to indices
+ ImS8 PosToIndexOffsetMax; // Add to Min after converting to indices
+
+ static ImGuiListClipperRange FromIndices(int min, int max) { ImGuiListClipperRange r = { min, max, false, 0, 0 }; return r; }
+ static ImGuiListClipperRange FromPositions(float y1, float y2, int off_min, int off_max) { ImGuiListClipperRange r = { (int)y1, (int)y2, true, (ImS8)off_min, (ImS8)off_max }; return r; }
+};
+
+// Temporary clipper data, buffers shared/reused between instances
+struct ImGuiListClipperData
+{
+ ImGuiListClipper* ListClipper;
+ float LossynessOffset;
+ int StepNo;
+ int ItemsFrozen;
+ ImVector<ImGuiListClipperRange> Ranges;
+
+ ImGuiListClipperData() { memset(this, 0, sizeof(*this)); }
+ void Reset(ImGuiListClipper* clipper) { ListClipper = clipper; StepNo = ItemsFrozen = 0; Ranges.resize(0); }
+};
+
+//-----------------------------------------------------------------------------
// [SECTION] Navigation support
//-----------------------------------------------------------------------------
@@ -1172,7 +1409,22 @@ 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_TryToPreserveState = 1 << 2 // Request widget to preserve state if it can (e.g. InputText will try to preserve cursor/selection)
+ ImGuiActivateFlags_TryToPreserveState = 1 << 2, // Request widget to preserve state if it can (e.g. InputText will try to preserve cursor/selection)
+};
+
+// Early work-in-progress API for ScrollToItem()
+enum ImGuiScrollFlags_
+{
+ ImGuiScrollFlags_None = 0,
+ ImGuiScrollFlags_KeepVisibleEdgeX = 1 << 0, // If item is not visible: scroll as little as possible on X axis to bring item back into view [default for X axis]
+ ImGuiScrollFlags_KeepVisibleEdgeY = 1 << 1, // If item is not visible: scroll as little as possible on Y axis to bring item back into view [default for Y axis for windows that are already visible]
+ ImGuiScrollFlags_KeepVisibleCenterX = 1 << 2, // If item is not visible: scroll to make the item centered on X axis [rarely used]
+ ImGuiScrollFlags_KeepVisibleCenterY = 1 << 3, // If item is not visible: scroll to make the item centered on Y axis
+ ImGuiScrollFlags_AlwaysCenterX = 1 << 4, // Always center the result item on X axis [rarely used]
+ ImGuiScrollFlags_AlwaysCenterY = 1 << 5, // Always center the result item on Y axis [default for Y axis for appearing window)
+ ImGuiScrollFlags_NoScrollParent = 1 << 6, // Disable forwarding scrolling to parent window if required to keep item/rect visible (only scroll window the function was applied to).
+ ImGuiScrollFlags_MaskX_ = ImGuiScrollFlags_KeepVisibleEdgeX | ImGuiScrollFlags_KeepVisibleCenterX | ImGuiScrollFlags_AlwaysCenterX,
+ ImGuiScrollFlags_MaskY_ = ImGuiScrollFlags_KeepVisibleEdgeY | ImGuiScrollFlags_KeepVisibleCenterY | ImGuiScrollFlags_AlwaysCenterY,
};
enum ImGuiNavHighlightFlags_
@@ -1181,15 +1433,7 @@ enum ImGuiNavHighlightFlags_
ImGuiNavHighlightFlags_TypeDefault = 1 << 0,
ImGuiNavHighlightFlags_TypeThin = 1 << 1,
ImGuiNavHighlightFlags_AlwaysDraw = 1 << 2, // Draw rectangular highlight if (g.NavId == id) _even_ when using the mouse.
- ImGuiNavHighlightFlags_NoRounding = 1 << 3
-};
-
-enum ImGuiNavDirSourceFlags_
-{
- ImGuiNavDirSourceFlags_None = 0,
- ImGuiNavDirSourceFlags_Keyboard = 1 << 0,
- ImGuiNavDirSourceFlags_PadDPad = 1 << 1,
- ImGuiNavDirSourceFlags_PadLStick = 1 << 2
+ ImGuiNavHighlightFlags_NoRounding = 1 << 3,
};
enum ImGuiNavMoveFlags_
@@ -1201,15 +1445,19 @@ enum ImGuiNavMoveFlags_
ImGuiNavMoveFlags_WrapY = 1 << 3, // This is not super useful but provided for completeness
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_ScrollToEdge = 1 << 6,
+ ImGuiNavMoveFlags_ScrollToEdgeY = 1 << 6, // Force scrolling to min/max (used by Home/End) // FIXME-NAV: Aim to remove or reword, probably unnecessary
ImGuiNavMoveFlags_Forwarded = 1 << 7,
- ImGuiNavMoveFlags_DebugNoResult = 1 << 8
+ ImGuiNavMoveFlags_DebugNoResult = 1 << 8, // Dummy scoring for debug purpose, don't apply result
+ ImGuiNavMoveFlags_FocusApi = 1 << 9,
+ ImGuiNavMoveFlags_Tabbing = 1 << 10, // == Focus + Activate if item is Inputable + DontChangeNavHighlight
+ ImGuiNavMoveFlags_Activate = 1 << 11,
+ ImGuiNavMoveFlags_DontSetNavHighlight = 1 << 12, // Do not alter the visible state of keyboard vs mouse nav highlight
};
enum ImGuiNavLayer
{
ImGuiNavLayer_Main = 0, // Main scrolling layer
- ImGuiNavLayer_Menu = 1, // Menu layer (access with Alt/ImGuiNavInput_Menu)
+ ImGuiNavLayer_Menu = 1, // Menu layer (access with Alt)
ImGuiNavLayer_COUNT
};
@@ -1219,12 +1467,13 @@ struct ImGuiNavItemData
ImGuiID ID; // Init,Move // Best candidate item ID
ImGuiID FocusScopeId; // Init,Move // Best candidate focus scope ID
ImRect RectRel; // Init,Move // Best candidate bounding box in window relative space
+ ImGuiItemFlags InFlags; // ????,Move // Best candidate item flags
float DistBox; // Move // Best candidate box distance to current NavId
float DistCenter; // Move // Best candidate center distance to current NavId
float DistAxial; // Move // Best candidate axial distance to current NavId
ImGuiNavItemData() { Clear(); }
- void Clear() { Window = NULL; ID = FocusScopeId = 0; RectRel = ImRect(); DistBox = DistCenter = DistAxial = FLT_MAX; }
+ void Clear() { Window = NULL; ID = FocusScopeId = 0; InFlags = 0; DistBox = DistCenter = DistAxial = FLT_MAX; }
};
//-----------------------------------------------------------------------------
@@ -1239,24 +1488,24 @@ enum ImGuiOldColumnFlags_
ImGuiOldColumnFlags_NoResize = 1 << 1, // Disable resizing columns when clicking on the dividers
ImGuiOldColumnFlags_NoPreserveWidths = 1 << 2, // Disable column width preservation when adjusting columns
ImGuiOldColumnFlags_NoForceWithinWindow = 1 << 3, // Disable forcing columns to fit within window
- ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4 // (WIP) Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove.
+ ImGuiOldColumnFlags_GrowParentContentsSize = 1 << 4, // (WIP) Restore pre-1.51 behavior of extending the parent window contents size but _without affecting the columns width at all_. Will eventually remove.
// Obsolete names (will be removed)
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- , ImGuiColumnsFlags_None = ImGuiOldColumnFlags_None,
+ ImGuiColumnsFlags_None = ImGuiOldColumnFlags_None,
ImGuiColumnsFlags_NoBorder = ImGuiOldColumnFlags_NoBorder,
ImGuiColumnsFlags_NoResize = ImGuiOldColumnFlags_NoResize,
ImGuiColumnsFlags_NoPreserveWidths = ImGuiOldColumnFlags_NoPreserveWidths,
ImGuiColumnsFlags_NoForceWithinWindow = ImGuiOldColumnFlags_NoForceWithinWindow,
- ImGuiColumnsFlags_GrowParentContentsSize = ImGuiOldColumnFlags_GrowParentContentsSize
+ ImGuiColumnsFlags_GrowParentContentsSize = ImGuiOldColumnFlags_GrowParentContentsSize,
#endif
};
struct ImGuiOldColumnData
{
- float OffsetNorm; // Column start offset, normalized 0.0 (far left) -> 1.0 (far right)
+ float OffsetNorm; // Column start offset, normalized 0.0 (far left) -> 1.0 (far right)
float OffsetNormBeforeResize;
- ImGuiOldColumnFlags Flags; // Not exposed
+ ImGuiOldColumnFlags Flags; // Not exposed
ImRect ClipRect;
ImGuiOldColumnData() { memset(this, 0, sizeof(*this)); }
@@ -1366,11 +1615,51 @@ struct ImGuiSettingsHandler
};
//-----------------------------------------------------------------------------
-// [SECTION] Metrics, Debug
+// [SECTION] Localization support
//-----------------------------------------------------------------------------
+// This is experimental and not officially supported, it'll probably fall short of features, if/when it does we may backtrack.
+enum ImGuiLocKey : int
+{
+ ImGuiLocKey_TableSizeOne,
+ ImGuiLocKey_TableSizeAllFit,
+ ImGuiLocKey_TableSizeAllDefault,
+ ImGuiLocKey_TableResetOrder,
+ ImGuiLocKey_WindowingMainMenuBar,
+ ImGuiLocKey_WindowingPopup,
+ ImGuiLocKey_WindowingUntitled,
+ ImGuiLocKey_COUNT
+};
+
+struct ImGuiLocEntry
+{
+ ImGuiLocKey Key;
+ const char* Text;
+};
+
+
+//-----------------------------------------------------------------------------
+// [SECTION] Metrics, Debug Tools
+//-----------------------------------------------------------------------------
+
+enum ImGuiDebugLogFlags_
+{
+ // Event types
+ ImGuiDebugLogFlags_None = 0,
+ ImGuiDebugLogFlags_EventActiveId = 1 << 0,
+ ImGuiDebugLogFlags_EventFocus = 1 << 1,
+ 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_OutputToTTY = 1 << 10, // Also send output to TTY
+};
+
struct ImGuiMetricsConfig
{
+ bool ShowDebugLog;
+ bool ShowStackTool;
bool ShowWindowsRects;
bool ShowWindowsBeginOrder;
bool ShowTablesRects;
@@ -1381,16 +1670,37 @@ struct ImGuiMetricsConfig
ImGuiMetricsConfig()
{
- ShowWindowsRects = false;
- ShowWindowsBeginOrder = false;
- ShowTablesRects = false;
+ ShowDebugLog = ShowStackTool = ShowWindowsRects = ShowWindowsBeginOrder = ShowTablesRects = false;
ShowDrawCmdMesh = true;
ShowDrawCmdBoundingBoxes = true;
- ShowWindowsRectsType = -1;
- ShowTablesRectsType = -1;
+ ShowWindowsRectsType = ShowTablesRectsType = -1;
}
};
+struct ImGuiStackLevelInfo
+{
+ ImGuiID ID;
+ ImS8 QueryFrameCount; // >= 1: Query in progress
+ bool QuerySuccess; // Obtained result from DebugHookIdInfo()
+ ImGuiDataType DataType : 8;
+ char Desc[57]; // Arbitrarily sized buffer to hold a result (FIXME: could replace Results[] with a chunk stream?) FIXME: Now that we added CTRL+C this should be fixed.
+
+ ImGuiStackLevelInfo() { memset(this, 0, sizeof(*this)); }
+};
+
+// State for Stack tool queries
+struct ImGuiStackTool
+{
+ int LastActiveFrame;
+ int StackLevel; // -1: query stack and resize Results, >= 0: individual stack level
+ ImGuiID QueryId; // ID to query details for
+ ImVector<ImGuiStackLevelInfo> Results;
+ bool CopyToClipboardOnCtrlC;
+ float CopyToClipboardLastTime;
+
+ ImGuiStackTool() { memset(this, 0, sizeof(*this)); CopyToClipboardLastTime = -FLT_MAX; }
+};
+
//-----------------------------------------------------------------------------
// [SECTION] Generic context hooks
//-----------------------------------------------------------------------------
@@ -1410,7 +1720,7 @@ struct ImGuiContextHook
};
//-----------------------------------------------------------------------------
-// [SECTION] ImGuiContext (main imgui context)
+// [SECTION] ImGuiContext (main Dear ImGui context)
//-----------------------------------------------------------------------------
struct ImGuiContext
@@ -1418,6 +1728,8 @@ struct ImGuiContext
bool Initialized;
bool FontAtlasOwnedByContext; // IO.Fonts-> is owned by the ImGuiContext and will be destructed along with it.
ImGuiIO IO;
+ ImVector<ImGuiInputEvent> InputEventsQueue; // Input events which will be tricked/written into IO structure.
+ ImVector<ImGuiInputEvent> 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.
@@ -1432,7 +1744,6 @@ struct ImGuiContext
bool WithinEndChild; // Set within EndChild()
bool GcCompactAll; // Request full GC
bool TestEngineHookItems; // Will call test engine hooks: ImGuiTestEngineHook_ItemAdd(), ImGuiTestEngineHook_ItemInfo(), ImGuiTestEngineHook_Log()
- ImGuiID TestEngineHookIdInfo; // Will call test engine hooks: ImGuiTestEngineHook_IdInfo() from GetID()
void* TestEngine; // Test engine user data
// Windows state
@@ -1449,14 +1760,13 @@ 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;
- float WheelingWindowTimer;
+ float WheelingWindowReleaseTimer;
// 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]
ImGuiID HoveredId; // Hovered widget, filled during the frame
ImGuiID HoveredIdPreviousFrame;
bool HoveredIdAllowOverlap;
- bool HoveredIdUsingMouseWheel; // Hovered widget will use mouse wheel. Blocks scrolling the underlying window.
- bool HoveredIdPreviousFrameUsingMouseWheel;
bool HoveredIdDisabled; // At least one widget passed the rect test, but has been discarded by disabled flag or popup inhibit. May be true even if HoveredId == 0.
float HoveredIdTimer; // Measure contiguous hovering time
float HoveredIdNotActiveTimer; // Measure contiguous hovering time where the item has not been active
@@ -1469,10 +1779,6 @@ struct ImGuiContext
bool ActiveIdHasBeenPressedBefore; // Track whether the active id led to a press (this is to allow changing between PressOnClick and PressOnRelease without pressing twice). Used by range_select branch.
bool ActiveIdHasBeenEditedBefore; // Was the value associated to the widget Edited over the course of the Active state.
bool ActiveIdHasBeenEditedThisFrame;
- bool ActiveIdUsingMouseWheel; // Active widget will want to read mouse wheel. Blocks scrolling the underlying window.
- ImU32 ActiveIdUsingNavDirMask; // Active widget will want to read those nav move requests (e.g. can activate a button and move away from it)
- ImU32 ActiveIdUsingNavInputMask; // Active widget will want to read those nav inputs.
- ImU64 ActiveIdUsingKeyInputMask; // Active widget will want to read those key inputs. When we grow the ImGuiKey enum we'll need to either to order the enum to make useful keys come first, either redesign this into e.g. a small array.
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)
@@ -1484,8 +1790,22 @@ struct ImGuiContext
ImGuiID LastActiveId; // Store the last non-zero ActiveId, useful for animation.
float LastActiveIdTimer; // Store the last non-zero ActiveId timer since the beginning of activation, useful for animation.
+ // [EXPERIMENTAL] Key/Input Ownership + Shortcut Routing system
+ // - The idea is that instead of "eating" a given key, we can link to an owner.
+ // - Input query can then read input by specifying ImGuiKeyOwner_Any (== 0), ImGuiKeyOwner_None (== -1) or a custom ID.
+ // - Routing is requested ahead of time for a given chord (Key + Mods) and granted in NewFrame().
+ ImGuiKeyOwnerData KeysOwnerData[ImGuiKey_NamedKey_COUNT];
+ ImGuiKeyRoutingTable KeysRoutingTable;
+ ImU32 ActiveIdUsingNavDirMask; // Active widget will want to read those nav move requests (e.g. can activate a button and move away from it)
+ bool ActiveIdUsingAllKeyboardKeys; // Active widget will want to read all keyboard keys inputs. (FIXME: This is a shortcut for not taking ownership of 100+ keys but perhaps best to not have the inconsistency)
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
+ ImU32 ActiveIdUsingNavInputMask; // If you used this. Since (IMGUI_VERSION_NUM >= 18804) : 'g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel);' becomes 'SetKeyOwner(ImGuiKey_Escape, g.ActiveId) and/or SetKeyOwner(ImGuiKey_NavGamepadCancel, g.ActiveId);'
+#endif
+
// Next window/item data
- ImGuiItemFlags CurrentItemFlags; // == g.ItemFlagsStack.back()
+ ImGuiID CurrentFocusScopeId; // == g.FocusScopeStack.back()
+ ImGuiItemFlags CurrentItemFlags; // == g.ItemFlagsStack.back()
+ ImGuiID DebugLocateId; // Storage for DebugLocateItemOnHover() feature: this is read by ItemAdd() so we keep it in a hot/cached location
ImGuiNextItemData NextItemData; // Storage for SetNextItem** functions
ImGuiLastItemData LastItemData; // Storage for last submitted item (setup by ItemAdd)
ImGuiNextWindowData NextWindowData; // Storage for SetNextWindow** functions
@@ -1494,33 +1814,32 @@ struct ImGuiContext
ImVector<ImGuiColorMod> ColorStack; // Stack for PushStyleColor()/PopStyleColor() - inherited by Begin()
ImVector<ImGuiStyleMod> StyleVarStack; // Stack for PushStyleVar()/PopStyleVar() - inherited by Begin()
ImVector<ImFont*> FontStack; // Stack for PushFont()/PopFont() - inherited by Begin()
- ImVector<ImGuiID> FocusScopeStack; // Stack for PushFocusScope()/PopFocusScope() - not inherited by Begin(), unless child window
+ ImVector<ImGuiID> FocusScopeStack; // Stack for PushFocusScope()/PopFocusScope() - inherited by BeginChild(), pushed into by Begin()
ImVector<ImGuiItemFlags>ItemFlagsStack; // Stack for PushItemFlag()/PopItemFlag() - inherited by Begin()
ImVector<ImGuiGroupData>GroupStack; // Stack for BeginGroup()/EndGroup() - not inherited by Begin()
ImVector<ImGuiPopupData>OpenPopupStack; // Which popups are open (persistent)
ImVector<ImGuiPopupData>BeginPopupStack; // Which level of BeginPopup() we are in (reset every frame)
+ int BeginMenuCount;
// Viewports
ImVector<ImGuiViewportP*> Viewports; // Active viewports (Size==1 in 'master' branch). Each viewports hold their copy of ImDrawData.
// Gamepad/keyboard Navigation
- ImGuiWindow* NavWindow; // Focused window for navigation. Could be called 'FocusWindow'
+ 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) && IsNavInputPressed(ImGuiNavInput_Activate) ? NavId : 0, also set when calling ActivateItem()
- ImGuiID NavActivateDownId; // ~~ IsNavInputDown(ImGuiNavInput_Activate) ? NavId : 0
- ImGuiID NavActivatePressedId; // ~~ IsNavInputPressed(ImGuiNavInput_Activate) ? NavId : 0
- ImGuiID NavActivateInputId; // ~~ IsNavInputPressed(ImGuiNavInput_Input) ? NavId : 0; ImGuiActivateFlags_PreferInput will be set and NavActivateId will be 0.
+ 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.
ImGuiActivateFlags NavActivateFlags;
- ImGuiID NavJustTabbedId; // Just tabbed to this id.
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).
- ImGuiKeyModFlags NavJustMovedToKeyMods;
+ 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.
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.
- int NavIdTabCounter; // == NavWindow->DC.FocusIdxTabCounter at time of NavId processing
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)
bool NavDisableHighlight; // When user starts using mouse, we hide gamepad/keyboard highlight (NB: but they are still available, which is why NavDisableHighlight isn't always != NavDisableMouseHover)
@@ -1536,32 +1855,32 @@ struct ImGuiContext
bool NavMoveScoringItems; // Move request submitted, still scoring incoming items
bool NavMoveForwardToNextFrame;
ImGuiNavMoveFlags NavMoveFlags;
- ImGuiKeyModFlags NavMoveKeyMods;
+ ImGuiScrollFlags NavMoveScrollFlags;
+ ImGuiKeyChord NavMoveKeyMods;
ImGuiDir NavMoveDir; // Direction of the move request (left/right/up/down)
ImGuiDir NavMoveDirForDebug;
ImGuiDir NavMoveClipDir; // FIXME-NAV: Describe the purpose of this better. Might want to rename?
ImRect NavScoringRect; // Rectangle used for scoring, in screen space. Based of window->NavRectRel[], modified for directional navigation scoring.
+ ImRect NavScoringNoClipRect; // Some nav operations (such as PageUp/PageDown) enforce a region which clipper will attempt to always keep submitted
int NavScoringDebugCount; // Metrics for debugging
+ int NavTabbingDir; // Generally -1 or +1, 0 when tabbing without a nav id
+ int NavTabbingCounter; // >0 when counting items for tabbing
ImGuiNavItemData NavMoveResultLocal; // Best move request candidate within NavWindow
ImGuiNavItemData NavMoveResultLocalVisible; // Best move request candidate within NavWindow that are mostly visible (when using ImGuiNavMoveFlags_AlsoScoreVisibleSet flag)
ImGuiNavItemData NavMoveResultOther; // Best move request candidate within NavWindow's flattened hierarchy (when using ImGuiWindowFlags_NavFlattened flag)
+ ImGuiNavItemData NavTabbingResultFirst; // First tabbing request candidate within NavWindow and flattened hierarchy
// Navigation: Windowing (CTRL+TAB for list, or Menu button + keys or directional pads to move/resize)
+ ImGuiKeyChord ConfigNavWindowingKeyNext; // = ImGuiMod_Ctrl | ImGuiKey_Tab, for reconfiguration (see #4828)
+ ImGuiKeyChord ConfigNavWindowingKeyPrev; // = ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab
ImGuiWindow* NavWindowingTarget; // Target window when doing CTRL+Tab (or Pad Menu + FocusPrev/Next), this window is temporarily displayed top-most!
ImGuiWindow* NavWindowingTargetAnim; // Record of last valid NavWindowingTarget until DimBgRatio and NavWindowingHighlightAlpha becomes 0.0f, so the fade-out can stay on it.
ImGuiWindow* NavWindowingListWindow; // Internal window actually listing the CTRL+Tab contents
float NavWindowingTimer;
float NavWindowingHighlightAlpha;
bool NavWindowingToggleLayer;
-
- // Legacy Focus/Tabbing system (older than Nav, active even if Nav is disabled, misnamed. FIXME-NAV: This needs a redesign!)
- ImGuiWindow* TabFocusRequestCurrWindow; //
- ImGuiWindow* TabFocusRequestNextWindow; //
- int TabFocusRequestCurrCounterRegular; // Any item being requested for focus, stored as an index (we on layout to be stable between the frame pressing TAB and the next frame, semi-ouch)
- int TabFocusRequestCurrCounterTabStop; // Tab item being requested for focus, stored as an index
- int TabFocusRequestNextCounterRegular; // Stored for next frame
- int TabFocusRequestNextCounterTabStop; // "
- bool TabFocusPressed; // Set in NewFrame() when user pressed Tab
+ ImVec2 NavWindowingAccumDeltaPos;
+ ImVec2 NavWindowingAccumDeltaSize;
// Render
float DimBgRatio; // 0.0..1.0 animation when fading in a dimming background (for modal window and CTRL+TAB list)
@@ -1586,11 +1905,15 @@ struct ImGuiContext
ImVector<unsigned char> DragDropPayloadBufHeap; // We don't expose the ImVector<> directly, ImGuiPayload only holds pointer+size
unsigned char DragDropPayloadBufLocal[16]; // Local buffer for small payloads
- // Table
+ // Clipper
+ int ClipperTempDataStacked;
+ ImVector<ImGuiListClipperData> ClipperTempData;
+
+ // Tables
ImGuiTable* CurrentTable;
- int CurrentTableStackIdx;
- ImPool<ImGuiTable> Tables;
- ImVector<ImGuiTableTempData> TablesTempDataStack;
+ int TablesTempDataStacked; // Temporary table data size (because we leave previous instances undestructed, we generally don't use TablesTempData.Size)
+ ImVector<ImGuiTableTempData> TablesTempData; // Temporary table data (buffers reused/shared across instances, support nesting)
+ ImPool<ImGuiTable> Tables; // Persistent table data
ImVector<float> TablesLastTimeActive; // Last used timestamp of each tables (SOA, for efficient GC)
ImVector<ImDrawChannel> DrawChannelsTempMergeBuffer;
@@ -1600,6 +1923,12 @@ struct ImGuiContext
ImVector<ImGuiPtrOrIndex> CurrentTabBarStack;
ImVector<ImGuiShrinkWidthItem> ShrinkWidthBuffer;
+ // Hover Delay system
+ ImGuiID HoverDelayId;
+ ImGuiID HoverDelayIdPreviousFrame;
+ float HoverDelayTimer; // Currently used IsItemHovered(), generally inferred from g.HoveredIdTimer but kept uncleared until clear timer elapse.
+ float HoverDelayClearTimer; // Currently used IsItemHovered(): grace time before g.TooltipHoverTimer gets cleared.
+
// Widget state
ImVec2 MouseLastValidPos;
ImGuiInputTextState InputTextState;
@@ -1611,6 +1940,7 @@ struct ImGuiContext
ImU32 ColorEditLastColor; // RGB value with alpha set to 0.
ImVec4 ColorPickerRef; // Initial/reference color at the time of opening the color picker.
ImGuiComboPreviewData ComboPreviewData;
+ float SliderGrabClickOffset;
float SliderCurrentAccum; // Accumulated slider delta when using navigation controls.
bool SliderCurrentAccumDirty; // Has the accumulated slider delta changed since last time we tried to apply it?
bool DragCurrentAccumDirty;
@@ -1620,13 +1950,12 @@ struct ImGuiContext
float DisabledAlphaBackup; // Backup for style.Alpha for BeginDisabled()
short DisabledStackSize;
short TooltipOverrideCount;
- float TooltipSlowDelay; // Time before slow tooltips appears (FIXME: This is temporary until we merge in tooltip timer+priority work)
ImVector<char> ClipboardHandlerData; // If no custom clipboard handler is defined
ImVector<ImGuiID> MenusIdSubmittedThisFrame; // A list of menu IDs that were rendered at least once
// Platform support
- ImVec2 PlatformImePos; // Cursor position request & last passed to the OS Input Method Editor
- ImVec2 PlatformImeLastPos;
+ ImGuiPlatformImeData PlatformImeData; // Data updated by current frame
+ ImGuiPlatformImeData PlatformImeDataPrev; // Previous frame data (when changing we will call io.SetPlatformImeDataFn
char PlatformLocaleDecimalPoint; // '.' or *localeconv()->decimal_point
// Settings
@@ -1639,6 +1968,9 @@ struct ImGuiContext
ImVector<ImGuiContextHook> Hooks; // Hooks for extensions (e.g. test engine)
ImGuiID HookIdNext; // Next available HookId
+ // Localization
+ const char* LocalizationTable[ImGuiLocKey_COUNT];
+
// Capture/Logging
bool LogEnabled; // Currently capturing
ImGuiLogType LogType; // Capture target
@@ -1653,19 +1985,25 @@ struct ImGuiContext
int LogDepthToExpandDefault; // Default/stored value for LogDepthMaxExpand if not specified in the LogXXX function call.
// Debug Tools
+ ImGuiDebugLogFlags DebugLogFlags;
+ ImGuiTextBuffer DebugLogBuf;
+ ImGuiTextIndex DebugLogIndex;
+ ImU8 DebugLocateFrames; // For DebugLocateItemOnHover(). This is used together with DebugLocateId which is in a hot/cached spot above.
bool DebugItemPickerActive; // Item picker is active (started with DebugStartItemPicker())
- ImGuiID DebugItemPickerBreakId; // Will call IM_DEBUG_BREAK() when encountering this id
+ ImU8 DebugItemPickerMouseButton;
+ ImGuiID DebugItemPickerBreakId; // Will call IM_DEBUG_BREAK() when encountering this ID
ImGuiMetricsConfig DebugMetricsConfig;
+ ImGuiStackTool DebugStackTool;
// Misc
- float FramerateSecPerFrame[120]; // Calculate estimate of framerate for user over the last 2 seconds.
+ float FramerateSecPerFrame[60]; // Calculate estimate of framerate for user over the last 60 frames..
int FramerateSecPerFrameIdx;
int FramerateSecPerFrameCount;
float FramerateSecPerFrameAccum;
- int WantCaptureMouseNextFrame; // Explicit capture via CaptureKeyboardFromApp()/CaptureMouseFromApp() sets those flags
- int WantCaptureKeyboardNextFrame;
+ int WantCaptureMouseNextFrame; // Explicit capture override via SetNextFrameWantCaptureMouse()/SetNextFrameWantCaptureKeyboard(). Default to -1.
+ int WantCaptureKeyboardNextFrame; // "
int WantTextInputNextFrame;
- char TempBuffer[1024 * 3 + 1]; // Temporary text buffer
+ ImVector<char> TempBuffer; // Temporary text buffer
ImGuiContext(ImFontAtlas* shared_font_atlas)
{
@@ -1680,7 +2018,6 @@ struct ImGuiContext
WithinFrameScope = WithinFrameScopeWithImplicitWindow = WithinEndChild = false;
GcCompactAll = false;
TestEngineHookItems = false;
- TestEngineHookIdInfo = 0;
TestEngine = NULL;
WindowsActiveCount = 0;
@@ -1689,11 +2026,11 @@ struct ImGuiContext
HoveredWindowUnderMovingWindow = NULL;
MovingWindow = NULL;
WheelingWindow = NULL;
- WheelingWindowTimer = 0.0f;
+ WheelingWindowReleaseTimer = 0.0f;
+ DebugHookIdInfo = 0;
HoveredId = HoveredIdPreviousFrame = 0;
HoveredIdAllowOverlap = false;
- HoveredIdUsingMouseWheel = HoveredIdPreviousFrameUsingMouseWheel = false;
HoveredIdDisabled = false;
HoveredIdTimer = HoveredIdNotActiveTimer = 0.0f;
ActiveId = 0;
@@ -1705,10 +2042,6 @@ struct ImGuiContext
ActiveIdHasBeenPressedBefore = false;
ActiveIdHasBeenEditedBefore = false;
ActiveIdHasBeenEditedThisFrame = false;
- ActiveIdUsingMouseWheel = false;
- ActiveIdUsingNavDirMask = 0x00;
- ActiveIdUsingNavInputMask = 0x00;
- ActiveIdUsingKeyInputMask = 0x00;
ActiveIdClickOffset = ImVec2(-1, -1);
ActiveIdWindow = NULL;
ActiveIdSource = ImGuiInputSource_None;
@@ -1720,16 +2053,23 @@ struct ImGuiContext
LastActiveId = 0;
LastActiveIdTimer = 0.0f;
+ ActiveIdUsingNavDirMask = 0x00;
+ ActiveIdUsingAllKeyboardKeys = false;
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
+ ActiveIdUsingNavInputMask = 0x00;
+#endif
+
+ CurrentFocusScopeId = 0;
CurrentItemFlags = ImGuiItemFlags_None;
+ BeginMenuCount = 0;
NavWindow = NULL;
NavId = NavFocusScopeId = NavActivateId = NavActivateDownId = NavActivatePressedId = NavActivateInputId = 0;
- NavJustTabbedId = NavJustMovedToId = NavJustMovedToFocusScopeId = NavNextActivateId = 0;
+ NavJustMovedToId = NavJustMovedToFocusScopeId = NavNextActivateId = 0;
NavActivateFlags = NavNextActivateFlags = ImGuiActivateFlags_None;
- NavJustMovedToKeyMods = ImGuiKeyModFlags_None;
+ NavJustMovedToKeyMods = ImGuiMod_None;
NavInputSource = ImGuiInputSource_None;
NavLayer = ImGuiNavLayer_Main;
- NavIdTabCounter = INT_MAX;
NavIdIsAlive = false;
NavMousePosDirty = false;
NavDisableHighlight = true;
@@ -1742,19 +2082,19 @@ struct ImGuiContext
NavMoveScoringItems = false;
NavMoveForwardToNextFrame = false;
NavMoveFlags = ImGuiNavMoveFlags_None;
- NavMoveKeyMods = ImGuiKeyModFlags_None;
+ NavMoveScrollFlags = ImGuiScrollFlags_None;
+ NavMoveKeyMods = ImGuiMod_None;
NavMoveDir = NavMoveDirForDebug = NavMoveClipDir = ImGuiDir_None;
NavScoringDebugCount = 0;
+ NavTabbingDir = 0;
+ NavTabbingCounter = 0;
+ ConfigNavWindowingKeyNext = ImGuiMod_Ctrl | ImGuiKey_Tab;
+ ConfigNavWindowingKeyPrev = ImGuiMod_Ctrl | ImGuiMod_Shift | ImGuiKey_Tab;
NavWindowingTarget = NavWindowingTargetAnim = NavWindowingListWindow = NULL;
NavWindowingTimer = NavWindowingHighlightAlpha = 0.0f;
NavWindowingToggleLayer = false;
- TabFocusRequestCurrWindow = TabFocusRequestNextWindow = NULL;
- TabFocusRequestCurrCounterRegular = TabFocusRequestCurrCounterTabStop = INT_MAX;
- TabFocusRequestNextCounterRegular = TabFocusRequestNextCounterTabStop = INT_MAX;
- TabFocusPressed = false;
-
DimBgRatio = 0.0f;
MouseCursor = ImGuiMouseCursor_Arrow;
@@ -1770,32 +2110,40 @@ struct ImGuiContext
DragDropHoldJustPressedId = 0;
memset(DragDropPayloadBufLocal, 0, sizeof(DragDropPayloadBufLocal));
+ ClipperTempDataStacked = 0;
+
CurrentTable = NULL;
- CurrentTableStackIdx = -1;
+ TablesTempDataStacked = 0;
CurrentTabBar = NULL;
+ HoverDelayId = HoverDelayIdPreviousFrame = 0;
+ HoverDelayTimer = HoverDelayClearTimer = 0.0f;
+
TempInputId = 0;
ColorEditOptions = ImGuiColorEditFlags_DefaultOptions_;
ColorEditLastHue = ColorEditLastSat = 0.0f;
ColorEditLastColor = 0;
+ SliderGrabClickOffset = 0.0f;
SliderCurrentAccum = 0.0f;
SliderCurrentAccumDirty = false;
DragCurrentAccumDirty = false;
DragCurrentAccum = 0.0f;
DragSpeedDefaultRatio = 1.0f / 100.0f;
+ ScrollbarClickDeltaToGrabCenter = 0.0f;
DisabledAlphaBackup = 0.0f;
DisabledStackSize = 0;
- ScrollbarClickDeltaToGrabCenter = 0.0f;
TooltipOverrideCount = 0;
- TooltipSlowDelay = 0.50f;
- PlatformImePos = PlatformImeLastPos = ImVec2(FLT_MAX, FLT_MAX);
+ PlatformImeData.InputPos = ImVec2(0.0f, 0.0f);
+ PlatformImeDataPrev.InputPos = ImVec2(-1.0f, -1.0f); // Different to ensure initial submission
PlatformLocaleDecimalPoint = '.';
SettingsLoaded = false;
SettingsDirtyTimer = 0.0f;
HookIdNext = 0;
+ memset(LocalizationTable, 0, sizeof(LocalizationTable));
+
LogEnabled = false;
LogType = ImGuiLogType_None;
LogNextPrefix = LogNextSuffix = NULL;
@@ -1805,14 +2153,17 @@ struct ImGuiContext
LogDepthRef = 0;
LogDepthToExpand = LogDepthToExpandDefault = 2;
+ DebugLogFlags = ImGuiDebugLogFlags_OutputToTTY;
+ DebugLocateId = 0;
+ DebugLocateFrames = 0;
DebugItemPickerActive = false;
+ DebugItemPickerMouseButton = ImGuiMouseButton_Left;
DebugItemPickerBreakId = 0;
memset(FramerateSecPerFrame, 0, sizeof(FramerateSecPerFrame));
FramerateSecPerFrameIdx = FramerateSecPerFrameCount = 0;
FramerateSecPerFrameAccum = 0.0f;
WantCaptureMouseNextFrame = WantCaptureKeyboardNextFrame = WantTextInputNextFrame = -1;
- memset(TempBuffer, 0, sizeof(TempBuffer));
}
};
@@ -1835,15 +2186,17 @@ struct IMGUI_API ImGuiWindowTempData
ImVec2 PrevLineSize;
float CurrLineTextBaseOffset; // Baseline offset (0.0f by default on a new line, generally == style.FramePadding.y when a framed item has been added).
float PrevLineTextBaseOffset;
+ bool IsSameLine;
+ bool IsSetPos;
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.
// 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)
- ImGuiID NavFocusScopeIdCurrent; // Current focus scope ID while appending
bool NavHideHighlightOneFrame;
bool NavHasScroll; // Set when scrolling can be used (ScrollMax > 0.0f)
@@ -1859,8 +2212,6 @@ struct IMGUI_API ImGuiWindowTempData
int CurrentTableIdx; // Current table index (into g.Tables)
ImGuiLayoutType LayoutType;
ImGuiLayoutType ParentLayoutType; // Layout type of parent window at the time of Begin()
- int FocusCounterRegular; // (Legacy Focus/Tabbing system) Sequential counter, start at -1 and increase when ImGuiItemFlags_Inputable (FIXME-NAV: Needs redesign)
- int FocusCounterTabStop; // (Legacy Focus/Tabbing system) Same, but only count widgets which you can Tab through.
// Local parameters stacks
// We store the current settings outside of the vectors to increase memory locality (reduce cache misses). The vectors are rarely modified. Also it allows us to not heap allocate for short-lived windows which are not using those settings.
@@ -1876,6 +2227,7 @@ struct IMGUI_API ImGuiWindow
char* Name; // Window name, owned by the window.
ImGuiID ID; // == ImHashStr(Name)
ImGuiWindowFlags Flags; // See enum ImGuiWindowFlags_
+ ImGuiViewportP* Viewport; // Always set in Begin(). Inactive windows may have a NULL value here if their viewport was discarded.
ImVec2 Pos; // Position (always rounded-up to nearest pixel)
ImVec2 Size; // Current size (==SizeFull or collapsed title bar size)
ImVec2 SizeFull; // Size when non collapsed
@@ -1904,9 +2256,11 @@ struct IMGUI_API ImGuiWindow
bool Appearing; // Set during the frame where the window is appearing (or re-appearing)
bool Hidden; // Do not display (== HiddenFrames*** > 0)
bool IsFallbackWindow; // Set on the "Debug##Default" window.
+ bool IsExplicitChild; // Set when passed _ChildWindow, left to false by BeginDocked()
bool HasCloseButton; // Set when the window has a close button (p_open != NULL)
signed char ResizeBorderHeld; // Current border being held for resize (-1: none, otherwise 0-3)
short BeginCount; // Number of Begin() during the current frame (generally 0 or 1, 1+ if appending via multiple Begin/End pairs)
+ short BeginCountPreviousFrame; // Number of Begin() during the previous frame
short BeginOrderWithinParent; // Begin() order within immediate parent window, if we are a child window. Otherwise 0.
short BeginOrderWithinContext; // Begin() order within entire imgui context. This is mostly used for debugging submission order related issues.
short FocusOrder; // Order within WindowsFocusOrder[], altered when windows are focused.
@@ -1951,6 +2305,7 @@ struct IMGUI_API ImGuiWindow
ImDrawList* DrawList; // == &DrawListInst (for backward compatibility reason with code using imgui_internal.h we keep this a pointer)
ImDrawList DrawListInst;
ImGuiWindow* ParentWindow; // If we are a child _or_ popup _or_ docked window, this is pointing to our parent. Otherwise NULL.
+ ImGuiWindow* ParentWindowInBeginStack;
ImGuiWindow* RootWindow; // Point to ourself or first ancestor that is not a child window. Doesn't cross through popups/dock nodes.
ImGuiWindow* RootWindowPopupTree; // Point to ourself or first ancestor that is not a child window. Cross through popups parent<>child.
ImGuiWindow* RootWindowForTitleBarHighlight; // Point to ourself or first ancestor which will display TitleBgActive color when this window is active.
@@ -1959,6 +2314,7 @@ struct IMGUI_API ImGuiWindow
ImGuiWindow* NavLastChildNavWindow; // When going to the menu bar, we remember the child window we came from. (This could probably be made implicit if we kept g.Windows sorted by last focused including child window.)
ImGuiID NavLastIds[ImGuiNavLayer_COUNT]; // Last known NavId for this window, per layer (0/1)
ImRect NavRectRel[ImGuiNavLayer_COUNT]; // Reference rectangle, in window relative space
+ ImGuiID NavRootFocusScopeId; // Focus Scope ID at the time of Begin()
int MemoryDrawListIdxCapacity; // Backup of last idx/vtx count, so when waking up the window we can preallocate and avoid iterative alloc/copy
int MemoryDrawListVtxCapacity;
@@ -1971,12 +2327,9 @@ public:
ImGuiID GetID(const char* str, const char* str_end = NULL);
ImGuiID GetID(const void* ptr);
ImGuiID GetID(int n);
- ImGuiID GetIDNoKeepAlive(const char* str, const char* str_end = NULL);
- ImGuiID GetIDNoKeepAlive(const void* ptr);
- ImGuiID GetIDNoKeepAlive(int n);
ImGuiID GetIDFromRectangle(const ImRect& r_abs);
- // We don't use g.FontSize because the window may be != g.CurrentWidow.
+ // 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; }
@@ -1994,7 +2347,7 @@ enum ImGuiTabBarFlagsPrivate_
{
ImGuiTabBarFlags_DockNode = 1 << 20, // Part of a dock node [we don't use this in the master branch but it facilitate branch syncing to keep this around]
ImGuiTabBarFlags_IsFocused = 1 << 21,
- ImGuiTabBarFlags_SaveSettings = 1 << 22 // FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs
+ ImGuiTabBarFlags_SaveSettings = 1 << 22, // FIXME: Settings are handled by the docking system, this only request the tab bar to mark settings dirty when reordering tabs
};
// Extend ImGuiTabItemFlags_
@@ -2002,7 +2355,7 @@ enum ImGuiTabItemFlagsPrivate_
{
ImGuiTabItemFlags_SectionMask_ = ImGuiTabItemFlags_Leading | ImGuiTabItemFlags_Trailing,
ImGuiTabItemFlags_NoCloseButton = 1 << 20, // Track whether p_open was set or not (we'll need this info on the next frame to recompute ContentWidth during layout)
- ImGuiTabItemFlags_Button = 1 << 21 // Used by TabItemButton, change the tab item behavior to mimic a button
+ ImGuiTabItemFlags_Button = 1 << 21, // Used by TabItemButton, change the tab item behavior to mimic a button
};
// Storage for one active tab item (sizeof() 40 bytes)
@@ -2015,16 +2368,17 @@ struct ImGuiTabItem
float Offset; // Position relative to beginning of tab
float Width; // Width currently displayed
float ContentWidth; // Width of label, stored during BeginTabItem() call
+ 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()
bool WantClose; // Marked as closed by SetTabItemClosed()
- ImGuiTabItem() { memset(this, 0, sizeof(*this)); LastFrameVisible = LastFrameSelected = -1; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; }
+ ImGuiTabItem() { memset(this, 0, sizeof(*this)); LastFrameVisible = LastFrameSelected = -1; RequestedWidth = -1.0f; NameOffset = -1; BeginOrder = IndexDuringLayout = -1; }
};
// Storage for a tab bar (sizeof() 152 bytes)
-struct ImGuiTabBar
+struct IMGUI_API ImGuiTabBar
{
ImVector<ImGuiTabItem> Tabs;
ImGuiTabBarFlags Flags;
@@ -2148,8 +2502,17 @@ 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 ?)
+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?
+
+ ImGuiTableInstanceData() { LastOuterHeight = LastFirstRowHeight = 0.0f; }
+};
+
// FIXME-TABLE: more transient data could be stored in a per-stacked table structure: DrawSplitter, SortSpecs, incoming RowData
-struct ImGuiTable
+struct IMGUI_API ImGuiTable
{
ImGuiID ID;
ImGuiTableFlags Flags;
@@ -2190,11 +2553,10 @@ struct ImGuiTable
float CellPaddingY;
float CellSpacingX1; // Spacing between non-bordered cells
float CellSpacingX2;
- float LastOuterHeight; // Outer height from last frame
- float LastFirstRowHeight; // Height of first row from last frame
float InnerWidth; // User value passed to BeginTable(), see comments at the top of BeginTable() for details.
float ColumnsGivenWidth; // Sum of current column width
float ColumnsAutoFitWidth; // Sum of ideal column width in order nothing to be clipped, used for auto-fitting and content width submission in outer window
+ float ColumnsStretchSumWeights; // Sum of weight of all enabled stretching columns
float ResizedColumnNextWidth;
float ResizeLockMinContentsX2; // Lock minimum contents width while resizing down in order to not create feedback loops. But we allow growing the table.
float RefScale; // Reference scale to be able to rescale columns on font/dpi changes.
@@ -2202,7 +2564,7 @@ struct ImGuiTable
ImRect InnerRect; // InnerRect but without decoration. As with OuterRect, for non-scrolling tables, InnerRect.Max.y is
ImRect WorkRect;
ImRect InnerClipRect;
- ImRect BgClipRect; // We use this to cpu-clip cell background color fill
+ ImRect BgClipRect; // We use this to cpu-clip cell background color fill, evolve during the frame as we cross frozen rows boundaries
ImRect Bg0ClipRectForDrawCmd; // Actual ImDrawCmd clip rect for BG0/1 channel. This tends to be == OuterWindow->ClipRect at BeginTable() because output in BG0/BG1 is cpu-clipped
ImRect Bg2ClipRectForDrawCmd; // Actual ImDrawCmd clip rect for BG2 channel. This tends to be a correct, tight-fit, because output to BG2 are done by widgets relying on regular ClipRect.
ImRect HostClipRect; // This is used to check if we can eventually merge our columns draw calls into the current draw call of the current window.
@@ -2211,6 +2573,8 @@ struct ImGuiTable
ImGuiWindow* InnerWindow; // Window holding the table data (== OuterWindow or a child window)
ImGuiTextBuffer ColumnsNames; // Contiguous buffer holding columns names
ImDrawListSplitter* DrawSplitter; // Shortcut to TempData->DrawSplitter while in table. Isolate draw commands per columns to avoid switching clip rect constantly
+ ImGuiTableInstanceData InstanceDataFirst;
+ ImVector<ImGuiTableInstanceData> InstanceDataExtra; // FIXME-OPT: Using a small-vector pattern would be good.
ImGuiTableColumnSortSpecs SortSpecsSingle;
ImVector<ImGuiTableColumnSortSpecs> SortSpecsMulti; // FIXME-OPT: Using a small-vector pattern would be good.
ImGuiTableSortSpecs SortSpecs; // Public facing sorts specs, this is what we return in TableGetSortSpecs()
@@ -2255,14 +2619,14 @@ struct ImGuiTable
bool MemoryCompacted;
bool HostSkipItems; // Backup of InnerWindow->SkipItem at the end of BeginTable(), because we will overwrite InnerWindow->SkipItem on a per-column basis
- IMGUI_API ImGuiTable() { memset(this, 0, sizeof(*this)); LastFrameActive = -1; }
- IMGUI_API ~ImGuiTable() { IM_FREE(RawData); }
+ ImGuiTable() { memset(this, 0, sizeof(*this)); LastFrameActive = -1; }
+ ~ImGuiTable() { IM_FREE(RawData); }
};
// Transient data that are only needed between BeginTable() and EndTable(), those buffers are shared (1 per level of stacked table).
// - Accessing those requires chasing an extra pointer so for very frequently used data we leave them in the main table structure.
// - We also leave out of this structure data that tend to be particularly useful for debugging/metrics.
-struct ImGuiTableTempData
+struct IMGUI_API ImGuiTableTempData
{
int TableIndex; // Index in g.Tables.Buf[] pool
float LastTimeActive; // Last timestamp this structure was used
@@ -2279,7 +2643,7 @@ struct ImGuiTableTempData
float HostBackupItemWidth; // Backup of OuterWindow->DC.ItemWidth at the end of BeginTable()
int HostBackupItemWidthStackSize;//Backup of OuterWindow->DC.ItemWidthStack.Size at the end of BeginTable()
- IMGUI_API ImGuiTableTempData() { memset(this, 0, sizeof(*this)); LastTimeActive = -1.0f; }
+ ImGuiTableTempData() { memset(this, 0, sizeof(*this)); LastTimeActive = -1.0f; }
};
// sizeof() ~ 12
@@ -2339,12 +2703,15 @@ namespace ImGui
IMGUI_API void UpdateWindowParentAndRootLinks(ImGuiWindow* window, ImGuiWindowFlags flags, ImGuiWindow* parent_window);
IMGUI_API ImVec2 CalcWindowNextAutoFitSize(ImGuiWindow* window);
IMGUI_API bool IsWindowChildOf(ImGuiWindow* window, ImGuiWindow* potential_parent, bool popup_hierarchy);
+ IMGUI_API bool IsWindowWithinBeginStackOf(ImGuiWindow* window, ImGuiWindow* potential_parent);
IMGUI_API bool IsWindowAbove(ImGuiWindow* potential_above, ImGuiWindow* potential_below);
IMGUI_API bool IsWindowNavFocusable(ImGuiWindow* window);
IMGUI_API void SetWindowPos(ImGuiWindow* window, const ImVec2& pos, ImGuiCond cond = 0);
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);
+ 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); }
// Windows: Display Order and Focus Order
IMGUI_API void FocusWindow(ImGuiWindow* window);
@@ -2352,6 +2719,9 @@ namespace ImGui
IMGUI_API void BringWindowToFocusFront(ImGuiWindow* window);
IMGUI_API void BringWindowToDisplayFront(ImGuiWindow* window);
IMGUI_API void BringWindowToDisplayBack(ImGuiWindow* window);
+ IMGUI_API void BringWindowToDisplayBehind(ImGuiWindow* window, ImGuiWindow* above_window);
+ IMGUI_API int FindWindowDisplayIndex(ImGuiWindow* window);
+ IMGUI_API ImGuiWindow* FindBottomMostVisibleWindowWithinBeginStack(ImGuiWindow* window);
// Fonts, drawing
IMGUI_API void SetCurrentFont(ImFont* font);
@@ -2361,10 +2731,11 @@ namespace ImGui
IMGUI_API ImDrawList* GetForegroundDrawList(ImGuiViewport* viewport); // get foreground draw list for the given viewport. this draw list will be the last rendered one. Useful to quickly draw shapes/text over dear imgui contents.
// Init
- IMGUI_API void Initialize(ImGuiContext* context);
- IMGUI_API void Shutdown(ImGuiContext* context); // Since 1.60 this is a _private_ function. You can call DestroyContext() to destroy the context created by CreateContext().
+ IMGUI_API void Initialize();
+ IMGUI_API void Shutdown(); // Since 1.60 this is a _private_ function. You can call DestroyContext() to destroy the context created by CreateContext().
// NewFrame
+ IMGUI_API void UpdateInputEvents(bool trickle_fast_inputs);
IMGUI_API void UpdateHoveredWindowAndCaptureFlags();
IMGUI_API void StartMouseMovingWindow(ImGuiWindow* window);
IMGUI_API void UpdateMouseMovingWindowNewFrame();
@@ -2375,6 +2746,9 @@ namespace ImGui
IMGUI_API void RemoveContextHook(ImGuiContext* context, ImGuiID hook_to_remove);
IMGUI_API void CallContextHooks(ImGuiContext* context, ImGuiContextHookType type);
+ // Viewports
+ IMGUI_API void SetWindowViewport(ImGuiWindow* window, ImGuiViewportP* viewport);
+
// Settings
IMGUI_API void MarkIniSettingsDirty();
IMGUI_API void MarkIniSettingsDirty(ImGuiWindow* window);
@@ -2382,15 +2756,27 @@ namespace ImGui
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);
+ // 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*"; }
+
// Scrolling
- IMGUI_API void SetNextWindowScroll(const ImVec2& scroll); // Use -1.0f on one axis to leave as-is
IMGUI_API void SetScrollX(ImGuiWindow* window, float scroll_x);
IMGUI_API void SetScrollY(ImGuiWindow* window, float scroll_y);
IMGUI_API void SetScrollFromPosX(ImGuiWindow* window, float local_x, float center_x_ratio);
IMGUI_API void SetScrollFromPosY(ImGuiWindow* window, float local_y, float center_y_ratio);
- IMGUI_API ImVec2 ScrollToBringRectIntoView(ImGuiWindow* window, const ImRect& item_rect);
+
+ // Early work-in-progress API (ScrollToItem() will become public)
+ IMGUI_API void ScrollToItem(ImGuiScrollFlags flags = 0);
+ IMGUI_API void ScrollToRect(ImGuiWindow* window, const ImRect& rect, ImGuiScrollFlags flags = 0);
+ IMGUI_API ImVec2 ScrollToRectEx(ImGuiWindow* window, const ImRect& rect, ImGuiScrollFlags flags = 0);
+//#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ inline void ScrollToBringRectIntoView(ImGuiWindow* window, const ImRect& rect) { ScrollToRect(window, rect, ImGuiScrollFlags_KeepVisibleEdgeY); }
+//#endif
// Basic Accessors
inline ImGuiID GetItemID() { ImGuiContext& g = *GImGui; return g.LastItemData.ID; } // Get ID of last item (~~ often same ImGui::GetID(label) beforehand)
@@ -2410,11 +2796,11 @@ namespace ImGui
// Basic Helpers for widget code
IMGUI_API void ItemSize(const ImVec2& size, float text_baseline_y = -1.0f);
- IMGUI_API void ItemSize(const ImRect& bb, float text_baseline_y = -1.0f);
+ 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 void ItemInputable(ImGuiWindow* window, ImGuiID id);
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);
IMGUI_API float CalcWrapWidthForPos(const ImVec2& pos, float wrap_pos_x);
IMGUI_API void PushMultiItemsWidths(int components, float width_full);
@@ -2422,21 +2808,10 @@ namespace ImGui
IMGUI_API ImVec2 GetContentRegionMaxAbs();
IMGUI_API void ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_excess);
- // Parameter stacks
+ // Parameter stacks (shared)
IMGUI_API void PushItemFlag(ImGuiItemFlags option, bool enabled);
IMGUI_API void PopItemFlag();
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- // Currently refactoring focus/nav/tabbing system
- // If you have old/custom copy-and-pasted widgets that used FocusableItemRegister():
- // (Old) IMGUI_VERSION_NUM < 18209: using 'ItemAdd(....)' and 'bool focused = FocusableItemRegister(...)'
- // (Old) IMGUI_VERSION_NUM >= 18209: using 'ItemAdd(..., ImGuiItemAddFlags_Focusable)' and 'bool focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0'
- // (New) IMGUI_VERSION_NUM >= 18411: using 'ItemAdd(..., ImGuiItemAddFlags_Inputable)' and 'bool focused = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0'
- // 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
-#endif
-
// 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.
IMGUI_API void LogToBuffer(int auto_open_depth = -1); // Start logging/capturing to internal buffer
@@ -2451,9 +2826,10 @@ 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(ImGuiWindowFlags extra_flags, ImGuiTooltipFlags tooltip_flags);
+ IMGUI_API void BeginTooltipEx(ImGuiTooltipFlags tooltip_flags, ImGuiWindowFlags extra_window_flags);
IMGUI_API ImRect GetPopupAllowedExtentRect(ImGuiWindow* window);
IMGUI_API ImGuiWindow* GetTopMostPopupModal();
+ IMGUI_API ImGuiWindow* GetTopMostAndVisiblePopupModal();
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);
@@ -2471,42 +2847,108 @@ namespace ImGui
IMGUI_API void NavInitWindow(ImGuiWindow* window, bool force_reinit);
IMGUI_API void NavInitRequestApplyResult();
IMGUI_API bool NavMoveRequestButNoResultYet();
- IMGUI_API void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags);
- IMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags);
+ IMGUI_API void NavMoveRequestSubmit(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
+ IMGUI_API void NavMoveRequestForward(ImGuiDir move_dir, ImGuiDir clip_dir, ImGuiNavMoveFlags move_flags, ImGuiScrollFlags scroll_flags);
+ IMGUI_API void NavMoveRequestResolveWithLastItem(ImGuiNavItemData* result);
IMGUI_API void NavMoveRequestCancel();
IMGUI_API void NavMoveRequestApplyResult();
IMGUI_API void NavMoveRequestTryWrapping(ImGuiWindow* window, ImGuiNavMoveFlags move_flags);
- IMGUI_API float GetNavInputAmount(ImGuiNavInput n, ImGuiInputReadMode mode);
- IMGUI_API ImVec2 GetNavInputAmount2d(ImGuiNavDirSourceFlags dir_sources, ImGuiInputReadMode mode, float slow_factor = 0.0f, float fast_factor = 0.0f);
- IMGUI_API int CalcTypematicRepeatAmount(float t0, float t1, float repeat_delay, float repeat_rate);
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);
- // Focus Scope (WIP)
- // This is generally used to identify a selection set (multiple of which may be in the same window), as selection
- // patterns generally need to react (e.g. clear selection) when landing on an item of the set.
- IMGUI_API void PushFocusScope(ImGuiID id);
- IMGUI_API void PopFocusScope();
- inline ImGuiID GetFocusedFocusScope() { ImGuiContext& g = *GImGui; return g.NavFocusScopeId; } // Focus scope which is actually active
- inline ImGuiID GetFocusScope() { ImGuiContext& g = *GImGui; return g.CurrentWindow->DC.NavFocusScopeIdCurrent; } // Focus scope we are outputting into, set by PushFocusScope()
-
// Inputs
// FIXME: Eventually we should aim to move e.g. IsActiveIdUsingKey() into IsKeyXXX functions.
- IMGUI_API void SetItemUsingMouseWheel();
- IMGUI_API void SetActiveIdUsingNavAndKeys();
- inline bool IsActiveIdUsingNavDir(ImGuiDir dir) { ImGuiContext& g = *GImGui; return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; }
- inline bool IsActiveIdUsingNavInput(ImGuiNavInput input) { ImGuiContext& g = *GImGui; return (g.ActiveIdUsingNavInputMask & (1 << input)) != 0; }
- inline bool IsActiveIdUsingKey(ImGuiKey key) { ImGuiContext& g = *GImGui; IM_ASSERT(key < 64); return (g.ActiveIdUsingKeyInputMask & ((ImU64)1 << key)) != 0; }
+ 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 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 ImGuiKey ConvertSingleModFlagToKey(ImGuiKey key)
+ {
+ 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;
+ return key;
+ }
+
+ IMGUI_API ImGuiKeyData* GetKeyData(ImGuiKey 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);
- inline bool IsKeyPressedMap(ImGuiKey key, bool repeat = true) { ImGuiContext& g = *GImGui; const int key_index = g.IO.KeyMap[key]; return (key_index >= 0) ? IsKeyPressed(key_index, repeat) : false; }
- inline bool IsNavInputDown(ImGuiNavInput n) { ImGuiContext& g = *GImGui; return g.IO.NavInputs[n] > 0.0f; }
- inline bool IsNavInputTest(ImGuiNavInput n, ImGuiInputReadMode rm) { return (GetNavInputAmount(n, rm) > 0.0f); }
- IMGUI_API ImGuiKeyModFlags GetMergedKeyModFlags();
+ IMGUI_API ImVec2 GetKeyVector2d(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);
+ IMGUI_API void SetActiveIdUsingAllKeyboardKeys();
+ inline bool IsActiveIdUsingNavDir(ImGuiDir dir) { ImGuiContext& g = *GImGui; return (g.ActiveIdUsingNavDirMask & (1 << dir)) != 0; }
+
+ // [EXPERIMENTAL] Low-Level: Key/Input Ownership
+ // - The idea is that instead of "eating" a given input, we can link to an owner id.
+ // - Ownership is most often claimed as a result of reacting to a press/down event (but occasionally may be claimed ahead).
+ // - Input queries can then read input by specifying ImGuiKeyOwner_Any (== 0), ImGuiKeyOwner_None (== -1) or a custom ID.
+ // - Legacy input queries (without specifying an owner or _Any or _None) are equivalent to using ImGuiKeyOwner_Any (== 0).
+ // - Input ownership is automatically released on the frame after a key is released. Therefore:
+ // - for ownership registration happening as a result of a down/press event, the SetKeyOwner() call may be done once (common case).
+ // - for ownership registration happening ahead of a down/press event, the SetKeyOwner() call needs to be made every frame (happens if e.g. claiming ownership on hover).
+ // - SetItemKeyOwner() is a shortcut for common simple case. A custom widget will probably want to call SetKeyOwner() multiple times directly based on its interaction state.
+ // - This is marked experimental because not all widgets are fully honoring the Set/Test idioms. We will need to move forward step by step.
+ // 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 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]; }
+
+ // [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.
+ // - Expected to be later promoted to public API, the prototypes are designed to replace existing ones (since owner_id can default to Any == 0)
+ // - Specifying a value for 'ImGuiID owner' will test that EITHER the key is NOT owned (UNLESS locked), EITHER the key is owned by 'owner'.
+ // Legacy functions use ImGuiKeyOwner_Any meaning that they typically ignore ownership, unless a call to SetKeyOwner() explicitly used ImGuiInputFlags_LockThisFrame or ImGuiInputFlags_LockUntilRelease.
+ // - Binding generators may want to ignore those for now, or suffix them with Ex() until we decide if this gets moved into public API.
+ IMGUI_API bool IsKeyDown(ImGuiKey key, ImGuiID owner_id);
+ IMGUI_API bool IsKeyPressed(ImGuiKey key, ImGuiID owner_id, ImGuiInputFlags flags = 0); // Important: when transitioning from old to new IsKeyPressed(): old API has "bool repeat = true", so would default to repeat. New API requiress explicit ImGuiInputFlags_Repeat.
+ IMGUI_API bool IsKeyReleased(ImGuiKey key, ImGuiID owner_id);
+ IMGUI_API bool IsMouseDown(ImGuiMouseButton button, ImGuiID owner_id);
+ IMGUI_API bool IsMouseClicked(ImGuiMouseButton button, ImGuiID owner_id, ImGuiInputFlags flags = 0);
+ IMGUI_API bool IsMouseReleased(ImGuiMouseButton button, ImGuiID owner_id);
+
+ // [EXPERIMENTAL] Shortcut Routing
+ // - ImGuiKeyChord = a ImGuiKey optionally OR-red with ImGuiMod_Alt/ImGuiMod_Ctrl/ImGuiMod_Shift/ImGuiMod_Super.
+ // ImGuiKey_C (accepted by functions taking ImGuiKey or ImGuiKeyChord)
+ // ImGuiKey_C | ImGuiMod_Ctrl (accepted by functions taking ImGuiKeyChord)
+ // ONLY ImGuiMod_XXX values are legal to 'OR' with an ImGuiKey. You CANNOT 'OR' two ImGuiKey values.
+ // - When using one of the routing flags (e.g. ImGuiInputFlags_RouteFocused): routes requested ahead of time given a chord (key + modifiers) and a routing policy.
+ // - Routes are resolved during NewFrame(): if keyboard modifiers are matching current ones: SetKeyOwner() is called + route is granted for the frame.
+ // - Route is granted to a single owner. When multiple requests are made we have policies to select the winning route.
+ // - Multiple read sites may use the same owner id and will all get the granted route.
+ // - For routing: when owner_id is 0 we use the current Focus Scope ID as a default owner in order to identify our location.
+ IMGUI_API bool Shortcut(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0);
+ IMGUI_API bool SetShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id = 0, ImGuiInputFlags flags = 0);
+ IMGUI_API bool TestShortcutRouting(ImGuiKeyChord key_chord, ImGuiID owner_id);
+ IMGUI_API ImGuiKeyRoutingData* GetShortcutRoutingData(ImGuiKeyChord key_chord);
+
+ // [EXPERIMENTAL] Focus Scope
+ // This is generally used to identify a unique input location (for e.g. a selection set)
+ // There is one per window (automatically set in Begin), but:
+ // - Selection patterns generally need to react (e.g. clear a selection) when landing on one item of the set.
+ // So in order to identify a set multiple lists in same window may each need a focus scope.
+ // If you imagine an hypothetical BeginSelectionGroup()/EndSelectionGroup() api, it would likely call PushFocusScope()/EndFocusScope()
+ // - Shortcut routing also use focus scope as a default location identifier if an owner is not provided.
+ // We don't use the ID Stack for this as it is common to want them separate.
+ IMGUI_API void PushFocusScope(ImGuiID id);
+ IMGUI_API void PopFocusScope();
+ inline ImGuiID GetCurrentFocusScope() { ImGuiContext& g = *GImGui; return g.CurrentFocusScopeId; } // Focus scope we are outputting into, set by PushFocusScope()
// Drag and Drop
+ IMGUI_API bool IsDragDropActive();
IMGUI_API bool BeginDragDropTargetCustom(const ImRect& bb, ImGuiID id);
IMGUI_API void ClearDragDrop();
IMGUI_API bool IsDragDropPayloadBeingAccepted();
+ IMGUI_API void RenderDragDropTargetRect(const ImRect& bb);
// Internal Columns API (this is not exposed because we will encourage transitioning to the Tables API)
IMGUI_API void SetWindowClipRectBeforeSetChannel(ImGuiWindow* window, const ImRect& clip_rect);
@@ -2541,7 +2983,9 @@ namespace ImGui
IMGUI_API void TableUpdateColumnsWeightFromWidth(ImGuiTable* table);
IMGUI_API void TableDrawBorders(ImGuiTable* table);
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]; }
IMGUI_API void TableSortSpecsSanitize(ImGuiTable* table);
IMGUI_API void TableSortSpecsBuild(ImGuiTable* table);
IMGUI_API ImGuiSortDirection TableGetColumnNextSortDirection(ImGuiTableColumn* column);
@@ -2567,7 +3011,7 @@ namespace ImGui
IMGUI_API void TableSaveSettings(ImGuiTable* table);
IMGUI_API void TableResetSettings(ImGuiTable* table);
IMGUI_API ImGuiTableSettings* TableGetBoundSettings(ImGuiTable* table);
- IMGUI_API void TableSettingsInstallHandler(ImGuiContext* context);
+ IMGUI_API void TableSettingsAddSettingsHandler();
IMGUI_API ImGuiTableSettings* TableSettingsCreate(ImGuiID id, int columns_count);
IMGUI_API ImGuiTableSettings* TableSettingsFindByID(ImGuiID id);
@@ -2580,7 +3024,7 @@ namespace ImGui
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 ImVec2 TabItemCalcSize(const char* label, bool has_close_button);
+ IMGUI_API ImVec2 TabItemCalcSize(const char* label, bool has_close_button_or_unsaved_marker);
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);
@@ -2597,21 +3041,15 @@ namespace ImGui
IMGUI_API void RenderColorRectWithAlphaCheckerboard(ImDrawList* draw_list, ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, float grid_step, ImVec2 grid_off, float rounding = 0.0f, ImDrawFlags flags = 0);
IMGUI_API void RenderNavHighlight(const ImRect& bb, ImGuiID id, ImGuiNavHighlightFlags flags = ImGuiNavHighlightFlags_TypeDefault); // Navigation highlight
IMGUI_API const char* FindRenderedTextEnd(const char* text, const char* text_end = NULL); // Find the optional ## from which we stop displaying text.
+ IMGUI_API void RenderMouseCursor(ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);
// Render helpers (those functions don't access any ImGui state!)
IMGUI_API void RenderArrow(ImDrawList* draw_list, ImVec2 pos, ImU32 col, ImGuiDir dir, float scale = 1.0f);
IMGUI_API void RenderBullet(ImDrawList* draw_list, ImVec2 pos, ImU32 col);
IMGUI_API void RenderCheckMark(ImDrawList* draw_list, ImVec2 pos, ImU32 col, float sz);
- IMGUI_API void RenderMouseCursor(ImDrawList* draw_list, ImVec2 pos, float scale, ImGuiMouseCursor mouse_cursor, ImU32 col_fill, ImU32 col_border, ImU32 col_shadow);
IMGUI_API void RenderArrowPointingAt(ImDrawList* draw_list, ImVec2 pos, ImVec2 half_sz, ImGuiDir direction, ImU32 col);
IMGUI_API void RenderRectFilledRangeH(ImDrawList* draw_list, const ImRect& rect, ImU32 col, float x_start_norm, float x_end_norm, float rounding);
- IMGUI_API void RenderRectFilledWithHole(ImDrawList* draw_list, ImRect outer, ImRect inner, ImU32 col, float rounding);
-
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- // [1.71: 2019/06/07: Updating prototypes of some of the internal functions. Leaving those for reference for a short while]
- inline void RenderArrow(ImVec2 pos, ImGuiDir dir, float scale=1.0f) { ImGuiWindow* window = GetCurrentWindow(); RenderArrow(window->DrawList, pos, GetColorU32(ImGuiCol_Text), dir, scale); }
- inline void RenderBullet(ImVec2 pos) { ImGuiWindow* window = GetCurrentWindow(); RenderBullet(window->DrawList, pos, GetColorU32(ImGuiCol_Text)); }
-#endif
+ IMGUI_API void RenderRectFilledWithHole(ImDrawList* draw_list, const ImRect& outer, const ImRect& inner, ImU32 col, float rounding);
// Widgets
IMGUI_API void TextEx(const char* text, const char* text_end = NULL, ImGuiTextFlags flags = 0);
@@ -2620,8 +3058,8 @@ namespace ImGui
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, float* p_scroll_v, float avail_v, float contents_v, ImDrawFlags flags);
- IMGUI_API bool ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec2& padding, const ImVec4& bg_col, const ImVec4& tint_col);
+ 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
@@ -2636,8 +3074,9 @@ namespace ImGui
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 TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* label, const char* label_end = NULL);
- IMGUI_API bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0); // Consume previous SetNextItemOpen() data, if any. May return true when logging
IMGUI_API void TreePushOverrideID(ImGuiID id);
+ IMGUI_API void TreeNodeSetOpen(ImGuiID id, bool open);
+ IMGUI_API bool TreeNodeUpdateNextOpen(ImGuiID id, ImGuiTreeNodeFlags flags); // Return open state. Consume previous SetNextItemOpen() data, if any. May return true when logging.
// Template functions are instantiated in imgui_widgets.cpp for a finite number of types.
// To use them externally (for custom widget) you may need an "extern template" statement in your code in order to link to existing instances and silence Clang warnings (see #2036).
@@ -2646,14 +3085,14 @@ namespace ImGui
template<typename T, typename SIGNED_T, typename FLOAT_T> IMGUI_API T ScaleValueFromRatioT(ImGuiDataType data_type, float t, T v_min, T v_max, bool is_logarithmic, float logarithmic_zero_epsilon, float zero_deadzone_size);
template<typename T, typename SIGNED_T, typename FLOAT_T> IMGUI_API bool DragBehaviorT(ImGuiDataType data_type, T* v, float v_speed, T v_min, T v_max, const char* format, ImGuiSliderFlags flags);
template<typename T, typename SIGNED_T, typename FLOAT_T> IMGUI_API bool SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, T* v, T v_min, T v_max, const char* format, ImGuiSliderFlags flags, ImRect* out_grab_bb);
- template<typename T, typename SIGNED_T> IMGUI_API T RoundScalarWithFormatT(const char* format, ImGuiDataType data_type, T v);
+ template<typename T> IMGUI_API T RoundScalarWithFormatT(const char* format, ImGuiDataType data_type, T v);
template<typename T> IMGUI_API bool CheckboxFlagsT(const char* label, T* flags, T flags_value);
// Data type helpers
IMGUI_API const ImGuiDataTypeInfo* DataTypeGetInfo(ImGuiDataType data_type);
IMGUI_API int DataTypeFormatString(char* buf, int buf_size, ImGuiDataType data_type, const void* p_data, const char* format);
IMGUI_API void DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, const void* arg_1, const void* arg_2);
- IMGUI_API bool DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* p_data, const char* format);
+ IMGUI_API bool DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void* p_data, const char* format);
IMGUI_API int DataTypeCompare(ImGuiDataType data_type, const void* arg_1, const void* arg_2);
IMGUI_API bool DataTypeClamp(ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max);
@@ -2662,7 +3101,7 @@ namespace ImGui
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); }
- inline ImGuiInputTextState* GetInputTextState(ImGuiID id) { ImGuiContext& g = *GImGui; return (g.InputTextState.ID == id) ? &g.InputTextState : NULL; } // Get input text state if active
+ inline ImGuiInputTextState* GetInputTextState(ImGuiID id) { ImGuiContext& g = *GImGui; return (id != 0 && g.InputTextState.ID == id) ? &g.InputTextState : NULL; } // Get input text state if active
// Color
IMGUI_API void ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags flags);
@@ -2681,27 +3120,55 @@ namespace ImGui
IMGUI_API void GcCompactTransientWindowBuffers(ImGuiWindow* window);
IMGUI_API void GcAwakeTransientWindowBuffers(ImGuiWindow* window);
+ // Debug Log
+ IMGUI_API void DebugLog(const char* fmt, ...) IM_FMTARGS(1);
+ IMGUI_API void DebugLogV(const char* fmt, va_list args) IM_FMTLIST(1);
+
// Debug Tools
IMGUI_API void ErrorCheckEndFrameRecover(ImGuiErrorLogCallback log_callback, void* user_data = NULL);
IMGUI_API void ErrorCheckEndWindowRecover(ImGuiErrorLogCallback log_callback, void* user_data = NULL);
+ IMGUI_API void ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
+ IMGUI_API void DebugLocateItem(ImGuiID target_id); // Call sparingly: only 1 at the same time!
+ IMGUI_API void DebugLocateItemOnHover(ImGuiID target_id); // Only call on reaction to a mouse Hover: because only 1 at the same time!
+ IMGUI_API void DebugLocateItemResolveWithLastItem();
inline void DebugDrawItemRect(ImU32 col = IM_COL32(255,0,0,255)) { ImGuiContext& g = *GImGui; ImGuiWindow* window = g.CurrentWindow; GetForegroundDrawList(window)->AddRect(g.LastItemData.Rect.Min, g.LastItemData.Rect.Max, col); }
inline void DebugStartItemPicker() { ImGuiContext& g = *GImGui; g.DebugItemPickerActive = true; }
-
IMGUI_API void ShowFontAtlas(ImFontAtlas* atlas);
+ IMGUI_API void DebugHookIdInfo(ImGuiID id, ImGuiDataType data_type, const void* data_id, const void* data_id_end);
IMGUI_API void DebugNodeColumns(ImGuiOldColumns* columns);
IMGUI_API void DebugNodeDrawList(ImGuiWindow* window, const ImDrawList* draw_list, const char* label);
IMGUI_API void DebugNodeDrawCmdShowMeshAndBoundingBox(ImDrawList* out_draw_list, const ImDrawList* draw_list, const ImDrawCmd* draw_cmd, bool show_mesh, bool show_aabb);
IMGUI_API void DebugNodeFont(ImFont* font);
+ IMGUI_API void DebugNodeFontGlyph(ImFont* font, const ImFontGlyph* glyph);
IMGUI_API void DebugNodeStorage(ImGuiStorage* storage, const char* label);
IMGUI_API void DebugNodeTabBar(ImGuiTabBar* tab_bar, const char* label);
IMGUI_API void DebugNodeTable(ImGuiTable* table);
IMGUI_API void DebugNodeTableSettings(ImGuiTableSettings* settings);
+ IMGUI_API void DebugNodeInputTextState(ImGuiInputTextState* state);
IMGUI_API void DebugNodeWindow(ImGuiWindow* window, const char* label);
IMGUI_API void DebugNodeWindowSettings(ImGuiWindowSettings* settings);
IMGUI_API void DebugNodeWindowsList(ImVector<ImGuiWindow*>* 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 DebugRenderViewportThumbnail(ImDrawList* draw_list, ImGuiViewportP* viewport, const ImRect& bb);
+ // Obsolete functions
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+ inline void SetItemUsingMouseWheel() { SetItemKeyOwner(ImGuiKey_MouseWheelY); } // Changed in 1.89
+ inline bool TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags = 0) { return TreeNodeUpdateNextOpen(id, flags); } // Renamed in 1.89
+
+ // 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)
+ // 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
+#endif
+#ifndef IMGUI_DISABLE_OBSOLETE_KEYIO
+ inline bool IsKeyPressedMap(ImGuiKey key, bool repeat = true) { IM_ASSERT(IsNamedKey(key)); return IsKeyPressed(key, repeat); } // Removed in 1.87: Mapping from named key is always identity!
+#endif
+
} // namespace ImGui
@@ -2716,7 +3183,9 @@ struct ImFontBuilderIO
};
// Helper for font builder
+#ifdef IMGUI_ENABLE_STB_TRUETYPE
IMGUI_API const ImFontBuilderIO* ImFontAtlasGetBuilderForStbTruetype();
+#endif
IMGUI_API void ImFontAtlasBuildInit(ImFontAtlas* atlas);
IMGUI_API void ImFontAtlasBuildSetupFont(ImFontAtlas* atlas, ImFont* font, ImFontConfig* font_config, float ascent, float descent);
IMGUI_API void ImFontAtlasBuildPackCustomRects(ImFontAtlas* atlas, void* stbrp_context_opaque);
@@ -2733,16 +3202,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_ItemInfo(ImGuiContext* ctx, ImGuiID id, const char* label, ImGuiItemStatusFlags flags);
-extern void ImGuiTestEngineHook_IdInfo(ImGuiContext* ctx, ImGuiDataType data_type, ImGuiID id, const void* data_id);
-extern void ImGuiTestEngineHook_IdInfo(ImGuiContext* ctx, ImGuiDataType data_type, ImGuiID id, const void* data_id, const void* data_id_end);
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
-#define IMGUI_TEST_ENGINE_ID_INFO(_ID,_TYPE,_DATA) if (g.TestEngineHookIdInfo == _ID) ImGuiTestEngineHook_IdInfo(&g, _TYPE, _ID, (const void*)(_DATA));
-#define IMGUI_TEST_ENGINE_ID_INFO2(_ID,_TYPE,_DATA,_DATA2) if (g.TestEngineHookIdInfo == _ID) ImGuiTestEngineHook_IdInfo(&g, _TYPE, _ID, (const void*)(_DATA), (const void*)(_DATA2));
#else
-#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)0)
+#define IMGUI_TEST_ENGINE_ITEM_ADD(_BB,_ID) ((void)0)
+#define IMGUI_TEST_ENGINE_ITEM_INFO(_ID,_LABEL,_FLAGS) ((void)g)
#endif
//-----------------------------------------------------------------------------
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_tables.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_tables.cpp
index 945e739a700..66a46573b95 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_tables.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_tables.cpp
@@ -1,4 +1,4 @@
-// dear imgui, v1.85 WIP
+// dear imgui, v1.89.1 WIP
// (tables and columns code)
/*
@@ -24,7 +24,7 @@ Index of this file:
*/
// Navigating this file:
-// - In Visual Studio IDE: CTRL+comma ("Edit.NavigateTo") can follow symbols in comments, whereas CTRL+F12 ("Edit.GoToImplementation") cannot.
+// - 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.
//-----------------------------------------------------------------------------
@@ -340,10 +340,9 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
// Acquire temporary buffers
const int table_idx = g.Tables.GetIndex(table);
- g.CurrentTableStackIdx++;
- if (g.CurrentTableStackIdx + 1 > g.TablesTempDataStack.Size)
- g.TablesTempDataStack.resize(g.CurrentTableStackIdx + 1, ImGuiTableTempData());
- ImGuiTableTempData* temp_data = table->TempData = &g.TablesTempDataStack[g.CurrentTableStackIdx];
+ if (++g.TablesTempDataStacked > g.TablesTempData.Size)
+ g.TablesTempData.resize(g.TablesTempDataStacked, ImGuiTableTempData());
+ ImGuiTableTempData* temp_data = table->TempData = &g.TablesTempData[g.TablesTempDataStacked - 1];
temp_data->TableIndex = table_idx;
table->DrawSplitter = &table->TempData->DrawSplitter;
table->DrawSplitter->Clear();
@@ -362,6 +361,8 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
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());
// When not using a child window, WorkRect.Max will grow as we append contents.
if (use_child_window)
@@ -538,7 +539,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
if (table->RefScale != 0.0f && table->RefScale != new_ref_scale_unit)
{
const float scale_factor = new_ref_scale_unit / table->RefScale;
- //IMGUI_DEBUG_LOG("[table] %08X RefScaleUnit %.3f -> %.3f, scaling width by %.3f\n", table->ID, table->RefScaleUnit, new_ref_scale_unit, scale_factor);
+ //IMGUI_DEBUG_PRINT("[table] %08X RefScaleUnit %.3f -> %.3f, scaling width by %.3f\n", table->ID, table->RefScaleUnit, new_ref_scale_unit, scale_factor);
for (int n = 0; n < columns_count; n++)
table->Columns[n].WidthRequest = table->Columns[n].WidthRequest * scale_factor;
}
@@ -564,6 +565,7 @@ bool ImGui::BeginTableEx(const char* name, ImGuiID id, int columns_count, ImG
// + 0 (for ImGuiTable instance, we are pooling allocations in g.Tables)
// + 1 (for table->RawData allocated below)
// + 1 (for table->ColumnsNames, if names are used)
+// Shared allocations per number of nested tables
// + 1 (for table->Splitter._Channels)
// + 2 * active_channels_count (for ImDrawCmd and ImDrawIdx buffers inside channels)
// Where active_channels_count is variable but often == columns_count or columns_count + 1, see TableSetupDrawChannels() for details.
@@ -886,6 +888,7 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
sum_width_requests += table->CellPaddingX * 2.0f;
}
table->ColumnsEnabledFixedCount = (ImGuiTableColumnIdx)count_fixed;
+ table->ColumnsStretchSumWeights = stretch_sum_weights;
// [Part 4] Apply final widths based on requested widths
const ImRect work_rect = table->WorkRect;
@@ -933,10 +936,19 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
width_remaining_for_stretched_columns -= 1.0f;
}
+ // Determine if table is hovered which will be used to flag columns as hovered.
+ // - In principle we'd like to use the equivalent of IsItemHovered(ImGuiHoveredFlags_AllowWhenBlockedByActiveItem),
+ // but because our item is partially submitted at this point we use ItemHoverable() and a workaround (temporarily
+ // clear ActiveId, which is equivalent to the change provided by _AllowWhenBLockedByActiveItem).
+ // - This allows columns to be marked as hovered when e.g. clicking a button inside the column, or using drag and drop.
+ ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
table->HoveredColumnBody = -1;
table->HoveredColumnBorder = -1;
- const ImRect mouse_hit_rect(table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.Max.x, ImMax(table->OuterRect.Max.y, table->OuterRect.Min.y + table->LastOuterHeight));
+ const ImRect mouse_hit_rect(table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.Max.x, ImMax(table->OuterRect.Max.y, table->OuterRect.Min.y + table_instance->LastOuterHeight));
+ const ImGuiID backup_active_id = g.ActiveId;
+ g.ActiveId = 0;
const bool is_hovering_table = ItemHoverable(mouse_hit_rect, 0);
+ g.ActiveId = backup_active_id;
// [Part 6] Setup final position, offset, skip/clip states and clipping rectangles, detect hovered column
// Process columns in their visible orders as we are comparing the visible order and adjusting host_clip_rect while looping.
@@ -1096,23 +1108,15 @@ void ImGui::TableUpdateLayout(ImGuiTable* table)
// [Part 10] Hit testing on borders
if (table->Flags & ImGuiTableFlags_Resizable)
TableUpdateBorders(table);
- table->LastFirstRowHeight = 0.0f;
+ table_instance->LastFirstRowHeight = 0.0f;
table->IsLayoutLocked = true;
table->IsUsingHeaders = false;
// [Part 11] Context menu
- if (table->IsContextPopupOpen && table->InstanceCurrent == table->InstanceInteracted)
+ if (TableBeginContextMenuPopup(table))
{
- const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->ID);
- if (BeginPopupEx(context_menu_id, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings))
- {
- TableDrawContextMenu(table);
- EndPopup();
- }
- else
- {
- table->IsContextPopupOpen = false;
- }
+ TableDrawContextMenu(table);
+ EndPopup();
}
// [Part 13] Sanitize and build sort specs before we have a change to use them for display.
@@ -1141,10 +1145,11 @@ void ImGui::TableUpdateBorders(ImGuiTable* table)
// use the final height from last frame. Because this is only affecting _interaction_ with columns, it is not
// really problematic (whereas the actual visual will be displayed in EndTable() and using the current frame height).
// Actual columns highlight/render will be performed in EndTable() and not be affected.
+ ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
const float hit_half_width = TABLE_RESIZE_SEPARATOR_HALF_THICKNESS;
const float hit_y1 = table->OuterRect.Min.y;
- const float hit_y2_body = ImMax(table->OuterRect.Max.y, hit_y1 + table->LastOuterHeight);
- const float hit_y2_head = hit_y1 + table->LastFirstRowHeight;
+ const float hit_y2_body = ImMax(table->OuterRect.Max.y, hit_y1 + table_instance->LastOuterHeight);
+ const float hit_y2_head = hit_y1 + table_instance->LastFirstRowHeight;
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
{
@@ -1166,8 +1171,8 @@ void ImGui::TableUpdateBorders(ImGuiTable* table)
ImGuiID column_id = TableGetColumnResizeID(table, column_n, table->InstanceCurrent);
ImRect hit_rect(column->MaxX - hit_half_width, hit_y1, column->MaxX + hit_half_width, border_y2_hit);
+ ItemAdd(hit_rect, column_id, NULL, ImGuiItemFlags_NoNav);
//GetForegroundDrawList()->AddRect(hit_rect.Min, hit_rect.Max, IM_COL32(255, 0, 0, 100));
- KeepAliveID(column_id);
bool hovered = false, held = false;
bool pressed = ButtonBehavior(hit_rect, column_id, &hovered, &held, ImGuiButtonFlags_FlattenChildren | ImGuiButtonFlags_AllowItemOverlap | ImGuiButtonFlags_PressedOnClick | ImGuiButtonFlags_PressedOnDoubleClick | ImGuiButtonFlags_NoNavFocus);
@@ -1223,6 +1228,7 @@ void ImGui::EndTable()
TableOpenContextMenu((int)table->HoveredColumnBody);
// Finalize table height
+ ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
inner_window->DC.PrevLineSize = temp_data->HostBackupPrevLineSize;
inner_window->DC.CurrLineSize = temp_data->HostBackupCurrLineSize;
inner_window->DC.CursorMaxPos = temp_data->HostBackupCursorMaxPos;
@@ -1233,7 +1239,7 @@ void ImGui::EndTable()
else if (!(flags & ImGuiTableFlags_NoHostExtendY))
table->OuterRect.Max.y = table->InnerRect.Max.y = ImMax(table->OuterRect.Max.y, inner_content_max_y); // Patch OuterRect/InnerRect height
table->WorkRect.Max.y = ImMax(table->WorkRect.Max.y, table->OuterRect.Max.y);
- table->LastOuterHeight = table->OuterRect.GetHeight();
+ table_instance->LastOuterHeight = table->OuterRect.GetHeight();
// Setup inner scrolling range
// FIXME: This ideally should be done earlier, in BeginTable() SetNextWindowContentSize call, just like writing to inner_window->DC.CursorMaxPos.y,
@@ -1279,17 +1285,23 @@ void ImGui::EndTable()
splitter->Merge(inner_window->DrawList);
// Update ColumnsAutoFitWidth to get us ahead for host using our size to auto-resize without waiting for next BeginTable()
- const float width_spacings = (table->OuterPaddingX * 2.0f) + (table->CellSpacingX1 + table->CellSpacingX2) * (table->ColumnsEnabledCount - 1);
- table->ColumnsAutoFitWidth = width_spacings + (table->CellPaddingX * 2.0f) * table->ColumnsEnabledCount;
+ float auto_fit_width_for_fixed = 0.0f;
+ 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))
{
ImGuiTableColumn* column = &table->Columns[column_n];
- if ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !(column->Flags & ImGuiTableColumnFlags_NoResize))
- table->ColumnsAutoFitWidth += column->WidthRequest;
+ float column_width_request = ((column->Flags & ImGuiTableColumnFlags_WidthFixed) && !(column->Flags & ImGuiTableColumnFlags_NoResize)) ? column->WidthRequest : TableGetColumnWidthAuto(table, column);
+ if (column->Flags & ImGuiTableColumnFlags_WidthFixed)
+ auto_fit_width_for_fixed += column_width_request;
else
- table->ColumnsAutoFitWidth += TableGetColumnWidthAuto(table, column);
+ auto_fit_width_for_stretched += column_width_request;
+ if ((column->Flags & ImGuiTableColumnFlags_WidthStretch) && (column->Flags & ImGuiTableColumnFlags_NoResize) != 0)
+ auto_fit_width_for_stretched_min = ImMax(auto_fit_width_for_stretched_min, column_width_request / (column->StretchWeight / table->ColumnsStretchSumWeights));
}
+ const float width_spacings = (table->OuterPaddingX * 2.0f) + (table->CellSpacingX1 + table->CellSpacingX2) * (table->ColumnsEnabledCount - 1);
+ table->ColumnsAutoFitWidth = width_spacings + (table->CellPaddingX * 2.0f) * table->ColumnsEnabledCount + auto_fit_width_for_fixed + ImMax(auto_fit_width_for_stretched, auto_fit_width_for_stretched_min);
// Update scroll
if ((table->Flags & ImGuiTableFlags_ScrollX) == 0 && inner_window != outer_window)
@@ -1381,9 +1393,8 @@ void ImGui::EndTable()
// Clear or restore current table, if any
IM_ASSERT(g.CurrentWindow == outer_window && g.CurrentTable == table);
- IM_ASSERT(g.CurrentTableStackIdx >= 0);
- g.CurrentTableStackIdx--;
- temp_data = g.CurrentTableStackIdx >= 0 ? &g.TablesTempDataStack[g.CurrentTableStackIdx] : NULL;
+ IM_ASSERT(g.TablesTempDataStacked > 0);
+ temp_data = (--g.TablesTempDataStacked > 0) ? &g.TablesTempData[g.TablesTempDataStacked - 1] : NULL;
g.CurrentTable = temp_data ? g.Tables.GetByIndex(temp_data->TableIndex) : NULL;
if (g.CurrentTable)
{
@@ -1570,18 +1581,21 @@ ImGuiTableColumnFlags ImGui::TableGetColumnFlags(int column_n)
// Return the cell rectangle based on currently known height.
// - Important: we generally don't know our row height until the end of the row, so Max.y will be incorrect in many situations.
-// The only case where this is correct is if we provided a min_row_height to TableNextRow() and don't go below it.
+// The only case where this is correct is if we provided a min_row_height to TableNextRow() and don't go below it, or in TableEndRow() when we locked that height.
// - Important: if ImGuiTableFlags_PadOuterX is set but ImGuiTableFlags_PadInnerX is not set, the outer-most left and right
// columns report a small offset so their CellBgRect can extend up to the outer border.
+// FIXME: But the rendering code in TableEndRow() nullifies that with clamping required for scrolling.
ImRect ImGui::TableGetCellBgRect(const ImGuiTable* table, int column_n)
{
const ImGuiTableColumn* column = &table->Columns[column_n];
float x1 = column->MinX;
float x2 = column->MaxX;
- if (column->PrevEnabledColumn == -1)
- x1 -= table->CellSpacingX1;
- if (column->NextEnabledColumn == -1)
- x2 += table->CellSpacingX2;
+ //if (column->PrevEnabledColumn == -1)
+ // x1 -= table->OuterPaddingX;
+ //if (column->NextEnabledColumn == -1)
+ // x2 += table->OuterPaddingX;
+ x1 = ImMax(x1, table->WorkRect.Min.x);
+ x2 = ImMin(x2, table->WorkRect.Max.x);
return ImRect(x1, table->RowPosY1, x2, table->RowPosY2);
}
@@ -1711,6 +1725,8 @@ void ImGui::TableBeginRow(ImGuiTable* table)
table->RowTextBaseline = 0.0f;
table->RowIndentOffsetX = window->DC.Indent.x - table->HostIndentX; // Lock indent
window->DC.PrevLineTextBaseOffset = 0.0f;
+ window->DC.CurrLineSize = ImVec2(0.0f, 0.0f);
+ window->DC.IsSameLine = window->DC.IsSetPos = false;
window->DC.CursorMaxPos.y = next_y1;
// Making the header BG color non-transparent will allow us to overlay it multiple times when handling smooth dragging.
@@ -1747,7 +1763,7 @@ void ImGui::TableEndRow(ImGuiTable* table)
const bool unfreeze_rows_actual = (table->CurrentRow + 1 == table->FreezeRowsCount);
const bool unfreeze_rows_request = (table->CurrentRow + 1 == table->FreezeRowsRequest);
if (table->CurrentRow == 0)
- table->LastFirstRowHeight = bg_y2 - bg_y1;
+ TableGetInstanceData(table, table->InstanceCurrent)->LastFirstRowHeight = bg_y2 - bg_y1;
const bool is_visible = (bg_y2 >= table->InnerClipRect.Min.y && bg_y1 <= table->InnerClipRect.Max.y);
if (is_visible)
@@ -1798,10 +1814,12 @@ void ImGui::TableEndRow(ImGuiTable* table)
ImGuiTableCellData* cell_data_end = &table->RowCellData[table->RowCellDataCurrent];
for (ImGuiTableCellData* cell_data = &table->RowCellData[0]; cell_data <= cell_data_end; cell_data++)
{
+ // As we render the BG here we need to clip things (for layout we would not)
+ // FIXME: This cancels the OuterPadding addition done by TableGetCellBgRect(), need to keep it while rendering correctly while scrolling.
const ImGuiTableColumn* column = &table->Columns[cell_data->Column];
ImRect cell_bg_rect = TableGetCellBgRect(table, cell_data->Column);
cell_bg_rect.ClipWith(table->BgClipRect);
- cell_bg_rect.Min.x = ImMax(cell_bg_rect.Min.x, column->ClipRect.Min.x); // So that first column after frozen one gets clipped
+ cell_bg_rect.Min.x = ImMax(cell_bg_rect.Min.x, column->ClipRect.Min.x); // So that first column after frozen one gets clipped when scrolling
cell_bg_rect.Max.x = ImMin(cell_bg_rect.Max.x, column->MaxX);
window->DrawList->AddRectFilled(cell_bg_rect.Min, cell_bg_rect.Max, cell_data->BgColor);
}
@@ -1990,6 +2008,9 @@ void ImGui::TableEndCell(ImGuiTable* table)
ImGuiTableColumn* column = &table->Columns[table->CurrentColumn];
ImGuiWindow* window = table->InnerWindow;
+ if (window->DC.IsSetPos)
+ ErrorCheckUsingSetCursorPosToExtendParentBoundaries();
+
// Report maximum position so we can infer content size per column.
float* p_max_pos_x;
if (table->RowFlags & ImGuiTableRowFlags_Headers)
@@ -2084,7 +2105,7 @@ void ImGui::TableSetColumnWidth(int column_n, float width)
if (column_0->WidthGiven == column_0_width || column_0->WidthRequest == column_0_width)
return;
- //IMGUI_DEBUG_LOG("TableSetColumnWidth(%d, %.1f->%.1f)\n", column_0_idx, column_0->WidthGiven, column_0_width);
+ //IMGUI_DEBUG_PRINT("TableSetColumnWidth(%d, %.1f->%.1f)\n", column_0_idx, column_0->WidthGiven, column_0_width);
ImGuiTableColumn* column_1 = (column_0->NextEnabledColumn != -1) ? &table->Columns[column_0->NextEnabledColumn] : NULL;
// In this surprisingly not simple because of how we support mixing Fixed and multiple Stretch columns.
@@ -2354,7 +2375,7 @@ void ImGui::TableMergeDrawChannels(ImGuiTable* table)
// Don't attempt to merge if there are multiple draw calls within the column
ImDrawChannel* src_channel = &splitter->_Channels[channel_no];
- if (src_channel->_CmdBuffer.Size > 0 && src_channel->_CmdBuffer.back().ElemCount == 0)
+ if (src_channel->_CmdBuffer.Size > 0 && src_channel->_CmdBuffer.back().ElemCount == 0 && src_channel->_CmdBuffer.back().UserCallback == NULL) // Equivalent of PopUnusedDrawCmd()
src_channel->_CmdBuffer.pop_back();
if (src_channel->_CmdBuffer.Size != 1)
continue;
@@ -2498,10 +2519,11 @@ void ImGui::TableDrawBorders(ImGuiTable* table)
inner_drawlist->PushClipRect(table->Bg0ClipRectForDrawCmd.Min, table->Bg0ClipRectForDrawCmd.Max, false);
// Draw inner border and resizing feedback
+ ImGuiTableInstanceData* table_instance = TableGetInstanceData(table, table->InstanceCurrent);
const float border_size = TABLE_BORDER_SIZE;
const float draw_y1 = table->InnerRect.Min.y;
const float draw_y2_body = table->InnerRect.Max.y;
- const float draw_y2_head = table->IsUsingHeaders ? ImMin(table->InnerRect.Max.y, (table->FreezeRowsCount >= 1 ? table->InnerRect.Min.y : table->WorkRect.Min.y) + table->LastFirstRowHeight) : draw_y1;
+ const float draw_y2_head = table->IsUsingHeaders ? ImMin(table->InnerRect.Max.y, (table->FreezeRowsCount >= 1 ? table->InnerRect.Min.y : table->WorkRect.Min.y) + table_instance->LastFirstRowHeight) : draw_y1;
if (table->Flags & ImGuiTableFlags_BordersInnerV)
{
for (int order_n = 0; order_n < table->ColumnsCount; order_n++)
@@ -2983,7 +3005,7 @@ void ImGui::TableHeader(const char* label)
RenderTextEllipsis(window->DrawList, label_pos, ImVec2(ellipsis_max, label_pos.y + label_height + g.Style.FramePadding.y), ellipsis_max, ellipsis_max, label, label_end, &label_size);
const bool text_clipped = label_size.x > (ellipsis_max - label_pos.x);
- if (text_clipped && hovered && g.HoveredIdNotActiveTimer > g.TooltipSlowDelay)
+ if (text_clipped && hovered && g.ActiveId == 0 && IsItemHovered(ImGuiHoveredFlags_DelayNormal))
SetTooltip("%.*s", (int)(label_end - label), label);
// We don't use BeginPopupContextItem() because we want the popup to stay up even after the column is hidden
@@ -3018,6 +3040,17 @@ void ImGui::TableOpenContextMenu(int column_n)
}
}
+bool ImGui::TableBeginContextMenuPopup(ImGuiTable* table)
+{
+ if (!table->IsContextPopupOpen || table->InstanceCurrent != table->InstanceInteracted)
+ return false;
+ const ImGuiID context_menu_id = ImHashStr("##ContextMenu", 0, table->ID);
+ if (BeginPopupEx(context_menu_id, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings))
+ return true;
+ table->IsContextPopupOpen = false;
+ return false;
+}
+
// Output context menu into current window (generally a popup)
// FIXME-TABLE: Ideally this should be writable by the user. Full programmatic access to that data?
void ImGui::TableDrawContextMenu(ImGuiTable* table)
@@ -3037,15 +3070,15 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table)
if (column != NULL)
{
const bool can_resize = !(column->Flags & ImGuiTableColumnFlags_NoResize) && column->IsEnabled;
- if (MenuItem("Size column to fit###SizeOne", NULL, false, can_resize))
+ if (MenuItem(LocalizeGetMsg(ImGuiLocKey_TableSizeOne), NULL, false, can_resize)) // "###SizeOne"
TableSetColumnWidthAutoSingle(table, column_n);
}
const char* size_all_desc;
if (table->ColumnsEnabledFixedCount == table->ColumnsEnabledCount && (table->Flags & ImGuiTableFlags_SizingMask_) != ImGuiTableFlags_SizingFixedSame)
- size_all_desc = "Size all columns to fit###SizeAll"; // All fixed
+ size_all_desc = LocalizeGetMsg(ImGuiLocKey_TableSizeAllFit); // "###SizeAll" All fixed
else
- size_all_desc = "Size all columns to default###SizeAll"; // All stretch or mixed
+ size_all_desc = LocalizeGetMsg(ImGuiLocKey_TableSizeAllDefault); // "###SizeAll" All stretch or mixed
if (MenuItem(size_all_desc, NULL))
TableSetColumnWidthAutoAll(table);
want_separator = true;
@@ -3054,7 +3087,7 @@ void ImGui::TableDrawContextMenu(ImGuiTable* table)
// Ordering
if (table->Flags & ImGuiTableFlags_Reorderable)
{
- if (MenuItem("Reset order", NULL, false, !table->IsDefaultDisplayOrder))
+ if (MenuItem(LocalizeGetMsg(ImGuiLocKey_TableResetOrder), NULL, false, !table->IsDefaultDisplayOrder))
table->IsResetDisplayOrderRequest = true;
want_separator = true;
}
@@ -3423,9 +3456,8 @@ static void TableSettingsHandler_WriteAll(ImGuiContext* ctx, ImGuiSettingsHandle
}
}
-void ImGui::TableSettingsInstallHandler(ImGuiContext* context)
+void ImGui::TableSettingsAddSettingsHandler()
{
- ImGuiContext& g = *context;
ImGuiSettingsHandler ini_handler;
ini_handler.TypeName = "Table";
ini_handler.TypeHash = ImHashStr("Table");
@@ -3434,7 +3466,7 @@ void ImGui::TableSettingsInstallHandler(ImGuiContext* context)
ini_handler.ReadLineFn = TableSettingsHandler_ReadLine;
ini_handler.ApplyAllFn = TableSettingsHandler_ApplyAll;
ini_handler.WriteAllFn = TableSettingsHandler_WriteAll;
- g.SettingsHandlers.push_back(ini_handler);
+ AddSettingsHandler(&ini_handler);
}
//-------------------------------------------------------------------------
@@ -3448,7 +3480,7 @@ void ImGui::TableSettingsInstallHandler(ImGuiContext* context)
// Remove Table (currently only used by TestEngine)
void ImGui::TableRemove(ImGuiTable* table)
{
- //IMGUI_DEBUG_LOG("TableRemove() id=0x%08X\n", table->ID);
+ //IMGUI_DEBUG_PRINT("TableRemove() id=0x%08X\n", table->ID);
ImGuiContext& g = *GImGui;
int table_idx = g.Tables.GetIndex(table);
//memset(table->RawData.Data, 0, table->RawData.size_in_bytes());
@@ -3460,7 +3492,7 @@ void ImGui::TableRemove(ImGuiTable* table)
// Free up/compact internal Table buffers for when it gets unused
void ImGui::TableGcCompactTransientBuffers(ImGuiTable* table)
{
- //IMGUI_DEBUG_LOG("TableGcCompactTransientBuffers() id=0x%08X\n", table->ID);
+ //IMGUI_DEBUG_PRINT("TableGcCompactTransientBuffers() id=0x%08X\n", table->ID);
ImGuiContext& g = *GImGui;
IM_ASSERT(table->MemoryCompacted == false);
table->SortSpecs.Specs = NULL;
@@ -3504,7 +3536,7 @@ void ImGui::TableGcCompactSettings()
// - DebugNodeTable() [Internal]
//-------------------------------------------------------------------------
-#ifndef IMGUI_DISABLE_METRICS_WINDOW
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
static const char* DebugNodeTableGetSizingPolicyDesc(ImGuiTableFlags sizing_policy)
{
@@ -3532,6 +3564,8 @@ void ImGui::DebugNodeTable(ImGuiTable* table)
GetForegroundDrawList()->AddRect(GetItemRectMin(), GetItemRectMax(), IM_COL32(255, 255, 0, 255));
if (!open)
return;
+ if (table->InstanceCurrent > 0)
+ ImGui::Text("** %d instances of same table! Some data below will refer to last instance.", table->InstanceCurrent + 1);
bool clear_settings = SmallButton("Clear settings");
BulletText("OuterRect: Pos: (%.1f,%.1f) Size: (%.1f,%.1f) Sizing: '%s'", table->OuterRect.Min.x, table->OuterRect.Min.y, table->OuterRect.GetWidth(), table->OuterRect.GetHeight(), DebugNodeTableGetSizingPolicyDesc(table->Flags));
BulletText("ColumnsGivenWidth: %.1f, ColumnsAutoFitWidth: %.1f, InnerWidth: %.1f%s", table->ColumnsGivenWidth, table->ColumnsAutoFitWidth, table->InnerWidth, table->InnerWidth == 0.0f ? " (auto)" : "");
@@ -3596,7 +3630,7 @@ void ImGui::DebugNodeTableSettings(ImGuiTableSettings* settings)
TreePop();
}
-#else // #ifndef IMGUI_DISABLE_METRICS_WINDOW
+#else // #ifndef IMGUI_DISABLE_DEBUG_TOOLS
void ImGui::DebugNodeTable(ImGuiTable*) {}
void ImGui::DebugNodeTableSettings(ImGuiTableSettings*) {}
@@ -3936,6 +3970,7 @@ void ImGui::NextColumn()
{
// New row/line: column 0 honor IndentX.
window->DC.ColumnsOffset.x = ImMax(column_padding - window->WindowPadding.x, 0.0f);
+ window->DC.IsSameLine = false;
columns->LineMinY = columns->LineMaxY;
}
window->DC.CursorPos.x = IM_FLOOR(window->Pos.x + window->DC.Indent.x + window->DC.ColumnsOffset.x);
@@ -3987,8 +4022,7 @@ void ImGui::EndColumns()
const ImGuiID column_id = columns->ID + ImGuiID(n);
const float column_hit_hw = COLUMNS_HIT_RECT_HALF_WIDTH;
const ImRect column_hit_rect(ImVec2(x - column_hit_hw, y1), ImVec2(x + column_hit_hw, y2));
- KeepAliveID(column_id);
- if (IsClippedEx(column_hit_rect, column_id)) // FIXME: Can be removed or replaced with a lower-level test
+ if (!ItemAdd(column_hit_rect, column_id, NULL, ImGuiItemFlags_NoNav))
continue;
bool hovered = false, held = false;
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp
index 2bb418c590c..3b8be01e7d4 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/imgui_widgets.cpp
@@ -1,4 +1,4 @@
-// dear imgui, v1.85 WIP
+// dear imgui, v1.89.1 WIP
// (widgets code)
/*
@@ -41,7 +41,6 @@ Index of this file:
#include "imgui_internal.h"
// System includes
-#include <ctype.h> // toupper
#if defined(_MSC_VER) && _MSC_VER <= 1500 // MSVC 2008 or earlier
#include <stddef.h> // intptr_t
#else
@@ -82,6 +81,7 @@ Index of this file:
#pragma GCC diagnostic ignored "-Wpragmas" // warning: unknown option after '#pragma GCC diagnostic' kind
#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked
#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
+#pragma GCC diagnostic ignored "-Wdeprecated-enum-enum-conversion" // warning: bitwise operation between different enumeration types ('XXXFlags_' and 'XXXFlagsPrivate_') is deprecated
#endif
//-------------------------------------------------------------------------
@@ -166,7 +166,21 @@ void ImGui::TextEx(const char* text, const char* text_end, ImGuiTextFlags flags)
const ImVec2 text_pos(window->DC.CursorPos.x, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset);
const float wrap_pos_x = window->DC.TextWrapPos;
const bool wrap_enabled = (wrap_pos_x >= 0.0f);
- if (text_end - text > 2000 && !wrap_enabled)
+ if (text_end - text <= 2000 || wrap_enabled)
+ {
+ // Common case
+ const float wrap_width = wrap_enabled ? CalcWrapWidthForPos(window->DC.CursorPos, wrap_pos_x) : 0.0f;
+ const ImVec2 text_size = CalcTextSize(text_begin, text_end, false, wrap_width);
+
+ ImRect bb(text_pos, text_pos + text_size);
+ ItemSize(text_size, 0.0f);
+ if (!ItemAdd(bb, 0))
+ return;
+
+ // Render (we don't hide text after ## in this end-user function)
+ RenderTextWrapped(bb.Min, text_begin, text_end, wrap_width);
+ }
+ else
{
// Long text!
// Perform manual coarse clipping to optimize for long multi-line text
@@ -239,19 +253,6 @@ void ImGui::TextEx(const char* text, const char* text_end, ImGuiTextFlags flags)
ItemSize(text_size, 0.0f);
ItemAdd(bb, 0);
}
- else
- {
- const float wrap_width = wrap_enabled ? CalcWrapWidthForPos(window->DC.CursorPos, wrap_pos_x) : 0.0f;
- const ImVec2 text_size = CalcTextSize(text_begin, text_end, false, wrap_width);
-
- ImRect bb(text_pos, text_pos + text_size);
- ItemSize(text_size, 0.0f);
- if (!ItemAdd(bb, 0))
- return;
-
- // Render (we don't hide text after ## in this end-user function)
- RenderTextWrapped(bb.Min, text_begin, text_end, wrap_width);
- }
}
void ImGui::TextUnformatted(const char* text, const char* text_end)
@@ -274,9 +275,9 @@ void ImGui::TextV(const char* fmt, va_list args)
return;
// FIXME-OPT: Handle the %s shortcut?
- ImGuiContext& g = *GImGui;
- const char* text_end = g.TempBuffer + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
- TextEx(g.TempBuffer, text_end, ImGuiTextFlags_NoWidthForLargeClippedText);
+ const char* text, *text_end;
+ ImFormatStringToTempBufferV(&text, &text_end, fmt, args);
+ TextEx(text, text_end, ImGuiTextFlags_NoWidthForLargeClippedText);
}
void ImGui::TextColored(const ImVec4& col, const char* fmt, ...)
@@ -357,8 +358,8 @@ void ImGui::LabelTextV(const char* label, const char* fmt, va_list args)
const ImGuiStyle& style = g.Style;
const float w = CalcItemWidth();
- const char* value_text_begin = &g.TempBuffer[0];
- const char* value_text_end = value_text_begin + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
+ const char* value_text_begin, *value_text_end;
+ ImFormatStringToTempBufferV(&value_text_begin, &value_text_end, fmt, args);
const ImVec2 value_size = CalcTextSize(value_text_begin, value_text_end, false);
const ImVec2 label_size = CalcTextSize(label, NULL, true);
@@ -393,8 +394,8 @@ void ImGui::BulletTextV(const char* fmt, va_list args)
ImGuiContext& g = *GImGui;
const ImGuiStyle& style = g.Style;
- const char* text_begin = g.TempBuffer;
- const char* text_end = text_begin + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
+ const char* text_begin, *text_end;
+ ImFormatStringToTempBufferV(&text_begin, &text_end, fmt, args);
const ImVec2 label_size = CalcTextSize(text_begin, text_end, false);
const ImVec2 total_size = ImVec2(g.FontSize + (label_size.x > 0.0f ? (label_size.x + style.FramePadding.x * 2) : 0.0f), label_size.y); // Empty text doesn't add padding
ImVec2 pos = window->DC.CursorPos;
@@ -540,22 +541,20 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
hovered = false;
// Mouse handling
+ const ImGuiID test_owner_id = (flags & ImGuiButtonFlags_NoTestKeyOwner) ? ImGuiKeyOwner_Any : id;
if (hovered)
{
if (!(flags & ImGuiButtonFlags_NoKeyModifiers) || (!g.IO.KeyCtrl && !g.IO.KeyShift && !g.IO.KeyAlt))
{
// Poll buttons
int mouse_button_clicked = -1;
- int mouse_button_released = -1;
- if ((flags & ImGuiButtonFlags_MouseButtonLeft) && g.IO.MouseClicked[0]) { mouse_button_clicked = 0; }
- else if ((flags & ImGuiButtonFlags_MouseButtonRight) && g.IO.MouseClicked[1]) { mouse_button_clicked = 1; }
- else if ((flags & ImGuiButtonFlags_MouseButtonMiddle) && g.IO.MouseClicked[2]) { mouse_button_clicked = 2; }
- if ((flags & ImGuiButtonFlags_MouseButtonLeft) && g.IO.MouseReleased[0]) { mouse_button_released = 0; }
- else if ((flags & ImGuiButtonFlags_MouseButtonRight) && g.IO.MouseReleased[1]) { mouse_button_released = 1; }
- else if ((flags & ImGuiButtonFlags_MouseButtonMiddle) && g.IO.MouseReleased[2]) { mouse_button_released = 2; }
-
+ 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))
+ SetKeyOwner(MouseButtonToKey(mouse_button_clicked), id);
if (flags & (ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnClickReleaseAnywhere))
{
SetActiveID(id, window);
@@ -564,7 +563,7 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
SetFocusID(id, window);
FocusWindow(window);
}
- if ((flags & ImGuiButtonFlags_PressedOnClick) || ((flags & ImGuiButtonFlags_PressedOnDoubleClick) && g.IO.MouseDoubleClicked[mouse_button_clicked]))
+ if ((flags & ImGuiButtonFlags_PressedOnClick) || ((flags & ImGuiButtonFlags_PressedOnDoubleClick) && g.IO.MouseClickedCount[mouse_button_clicked] == 2))
{
pressed = true;
if (flags & ImGuiButtonFlags_NoHoldingActiveId)
@@ -577,21 +576,27 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
FocusWindow(window);
}
}
- if ((flags & ImGuiButtonFlags_PressedOnRelease) && mouse_button_released != -1)
+ if (flags & ImGuiButtonFlags_PressedOnRelease)
{
- // Repeat mode trumps on release behavior
- const bool has_repeated_at_least_once = (flags & ImGuiButtonFlags_Repeat) && g.IO.MouseDownDurationPrev[mouse_button_released] >= g.IO.KeyRepeatDelay;
- if (!has_repeated_at_least_once)
- pressed = true;
- if (!(flags & ImGuiButtonFlags_NoNavFocus))
- SetFocusID(id, window);
- ClearActiveID();
+ 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
+ if (!has_repeated_at_least_once)
+ pressed = true;
+ if (!(flags & ImGuiButtonFlags_NoNavFocus))
+ SetFocusID(id, window);
+ ClearActiveID();
+ }
}
// 'Repeat' mode acts when held regardless of _PressedOn flags (see table above).
// Relies on repeat logic of IsMouseClicked() but we may as well do it ourselves if we end up exposing finer RepeatDelay/RepeatRate settings.
if (g.ActiveId == id && (flags & ImGuiButtonFlags_Repeat))
- if (g.IO.MouseDownDuration[g.ActiveIdMouseButton] > 0.0f && IsMouseClicked(g.ActiveIdMouseButton, true))
+ if (g.IO.MouseDownDuration[g.ActiveIdMouseButton] > 0.0f && IsMouseClicked(g.ActiveIdMouseButton, test_owner_id, ImGuiInputFlags_Repeat))
pressed = true;
}
@@ -607,7 +612,15 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
if (g.NavActivateDownId == id)
{
bool nav_activated_by_code = (g.NavActivateId == id);
- bool nav_activated_by_inputs = IsNavInputTest(ImGuiNavInput_Activate, (flags & ImGuiButtonFlags_Repeat) ? ImGuiInputReadMode_Repeat : ImGuiInputReadMode_Pressed);
+ 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
+ const ImGuiKeyData* key1 = GetKeyData(ImGuiKey_Space);
+ const ImGuiKeyData* key2 = GetKeyData(ImGuiKey_NavGamepadActivate);
+ const float t1 = ImMax(key1->DownDuration, key2->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)
{
// Set active id so it can be queried by user via IsItemActive(), equivalent of holding the mouse button.
@@ -629,8 +642,7 @@ 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;
- IM_ASSERT(mouse_button >= 0 && mouse_button < ImGuiMouseButton_COUNT);
- if (g.IO.MouseDown[mouse_button])
+ if (IsMouseDown(mouse_button, test_owner_id))
{
held = true;
}
@@ -641,9 +653,10 @@ bool ImGui::ButtonBehavior(const ImRect& bb, ImGuiID id, bool* out_hovered, bool
if ((release_in || release_anywhere) && !g.DragDropActive)
{
// Report as pressed when releasing the mouse (this is the most common path)
- bool is_double_click_release = (flags & ImGuiButtonFlags_PressedOnDoubleClick) && g.IO.MouseDownWasDoubleClick[mouse_button];
+ bool is_double_click_release = (flags & ImGuiButtonFlags_PressedOnDoubleClick) && g.IO.MouseReleased[mouse_button] && g.IO.MouseClickedLastCount[mouse_button] == 2;
bool is_repeating_already = (flags & ImGuiButtonFlags_Repeat) && g.IO.MouseDownDurationPrev[mouse_button] >= g.IO.KeyRepeatDelay; // Repeat mode trumps <on release>
- if (!is_double_click_release && !is_repeating_already)
+ bool is_button_avail_or_owned = TestKeyOwner(MouseButtonToKey(mouse_button), test_owner_id);
+ if (!is_double_click_release && !is_repeating_already && is_button_avail_or_owned)
pressed = true;
}
ClearActiveID();
@@ -731,6 +744,7 @@ bool ImGui::SmallButton(const char* label)
// Then you can keep 'str_id' empty or the same for all your buttons (instead of creating a string based on a non-string id)
bool ImGui::InvisibleButton(const char* str_id, const ImVec2& size_arg, ImGuiButtonFlags flags)
{
+ ImGuiContext& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
@@ -748,16 +762,17 @@ bool ImGui::InvisibleButton(const char* str_id, const ImVec2& size_arg, ImGuiBut
bool hovered, held;
bool pressed = ButtonBehavior(bb, id, &hovered, &held, flags);
+ IMGUI_TEST_ENGINE_ITEM_INFO(id, str_id, g.LastItemData.StatusFlags);
return pressed;
}
bool ImGui::ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size, ImGuiButtonFlags flags)
{
+ ImGuiContext& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
- ImGuiContext& g = *GImGui;
const ImGuiID id = window->GetID(str_id);
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
const float default_size = GetFrameHeight();
@@ -778,6 +793,7 @@ bool ImGui::ArrowButtonEx(const char* str_id, ImGuiDir dir, ImVec2 size, ImGuiBu
RenderFrame(bb.Min, bb.Max, bg_col, true, g.Style.FrameRounding);
RenderArrow(window->DrawList, bb.Min + ImVec2(ImMax(0.0f, (size.x - g.FontSize) * 0.5f), ImMax(0.0f, (size.y - g.FontSize) * 0.5f)), text_col, dir);
+ IMGUI_TEST_ENGINE_ITEM_INFO(id, str_id, g.LastItemData.StatusFlags);
return pressed;
}
@@ -839,9 +855,8 @@ bool ImGui::CollapseButton(ImGuiID id, const ImVec2& pos)
// Render
ImU32 bg_col = GetColorU32((held && hovered) ? ImGuiCol_ButtonActive : hovered ? ImGuiCol_ButtonHovered : ImGuiCol_Button);
ImU32 text_col = GetColorU32(ImGuiCol_Text);
- ImVec2 center = bb.GetCenter();
if (hovered || held)
- window->DrawList->AddCircleFilled(center/*+ 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, 12);
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
@@ -853,7 +868,7 @@ bool ImGui::CollapseButton(ImGuiID id, const ImVec2& pos)
ImGuiID ImGui::GetWindowScrollbarID(ImGuiWindow* window, ImGuiAxis axis)
{
- return window->GetIDNoKeepAlive(axis == ImGuiAxis_X ? "#SCROLLX" : "#SCROLLY");
+ return window->GetID(axis == ImGuiAxis_X ? "#SCROLLX" : "#SCROLLY");
}
// Return scrollbar rectangle, must only be called for corresponding axis if window->ScrollbarX/Y is set.
@@ -874,9 +889,7 @@ void ImGui::Scrollbar(ImGuiAxis axis)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
-
const ImGuiID id = GetWindowScrollbarID(window, axis);
- KeepAliveID(id);
// Calculate scrollbar bounding box
ImRect bb = GetWindowScrollbarRect(window, axis);
@@ -896,7 +909,9 @@ void ImGui::Scrollbar(ImGuiAxis axis)
}
float size_avail = window->InnerRect.Max[axis] - window->InnerRect.Min[axis];
float size_contents = window->ContentSize[axis] + window->WindowPadding[axis] * 2.0f;
- ScrollbarEx(bb, id, axis, &window->Scroll[axis], size_avail, size_contents, rounding_corners);
+ ImS64 scroll = (ImS64)window->Scroll[axis];
+ ScrollbarEx(bb, id, axis, &scroll, (ImS64)size_avail, (ImS64)size_contents, rounding_corners);
+ window->Scroll[axis] = (float)scroll;
}
// Vertical/Horizontal scrollbar
@@ -905,7 +920,7 @@ void ImGui::Scrollbar(ImGuiAxis axis)
// - We store values as normalized ratio and in a form that allows the window content to change while we are holding on a scrollbar
// - We handle both horizontal and vertical scrollbars, which makes the terminology not ideal.
// Still, the code should probably be made simpler..
-bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, float* p_scroll_v, float size_avail_v, float size_contents_v, ImDrawFlags flags)
+bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS64* p_scroll_v, ImS64 size_avail_v, ImS64 size_contents_v, ImDrawFlags flags)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
@@ -936,22 +951,23 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, floa
// Calculate the height of our grabbable box. It generally represent the amount visible (vs the total scrollable amount)
// But we maintain a minimum size in pixel to allow for the user to still aim inside.
IM_ASSERT(ImMax(size_contents_v, size_avail_v) > 0.0f); // Adding this assert to check if the ImMax(XXX,1.0f) is still needed. PLEASE CONTACT ME if this triggers.
- const float win_size_v = ImMax(ImMax(size_contents_v, size_avail_v), 1.0f);
- const float grab_h_pixels = ImClamp(scrollbar_size_v * (size_avail_v / win_size_v), style.GrabMinSize, scrollbar_size_v);
+ const ImS64 win_size_v = ImMax(ImMax(size_contents_v, size_avail_v), (ImS64)1);
+ const float grab_h_pixels = ImClamp(scrollbar_size_v * ((float)size_avail_v / (float)win_size_v), style.GrabMinSize, scrollbar_size_v);
const float grab_h_norm = grab_h_pixels / scrollbar_size_v;
// Handle input right away. None of the code of Begin() is relying on scrolling position before calling Scrollbar().
bool held = false;
bool hovered = false;
+ ItemAdd(bb_frame, id, NULL, ImGuiItemFlags_NoNav);
ButtonBehavior(bb, id, &hovered, &held, ImGuiButtonFlags_NoNavFocus);
- float scroll_max = ImMax(1.0f, size_contents_v - size_avail_v);
- float scroll_ratio = ImSaturate(*p_scroll_v / scroll_max);
+ const ImS64 scroll_max = ImMax((ImS64)1, size_contents_v - size_avail_v);
+ float scroll_ratio = ImSaturate((float)*p_scroll_v / (float)scroll_max);
float grab_v_norm = scroll_ratio * (scrollbar_size_v - grab_h_pixels) / scrollbar_size_v; // Grab position in normalized space
if (held && allow_interaction && grab_h_norm < 1.0f)
{
- float scrollbar_pos_v = bb.Min[axis];
- float mouse_pos_v = g.IO.MousePos[axis];
+ const float scrollbar_pos_v = bb.Min[axis];
+ const float mouse_pos_v = g.IO.MousePos[axis];
// Click position in scrollbar normalized space (0.0f->1.0f)
const float clicked_v_norm = ImSaturate((mouse_pos_v - scrollbar_pos_v) / scrollbar_size_v);
@@ -971,10 +987,10 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, floa
// Apply scroll (p_scroll_v will generally point on one member of window->Scroll)
// It is ok to modify Scroll here because we are being called in Begin() after the calculation of ContentSize and before setting up our starting position
const float scroll_v_norm = ImSaturate((clicked_v_norm - g.ScrollbarClickDeltaToGrabCenter - grab_h_norm * 0.5f) / (1.0f - grab_h_norm));
- *p_scroll_v = IM_ROUND(scroll_v_norm * scroll_max);//(win_size_contents_v - win_size_v));
+ *p_scroll_v = (ImS64)(scroll_v_norm * scroll_max);
// Update values for rendering
- scroll_ratio = ImSaturate(*p_scroll_v / scroll_max);
+ scroll_ratio = ImSaturate((float)*p_scroll_v / (float)scroll_max);
grab_v_norm = scroll_ratio * (scrollbar_size_v - grab_h_pixels) / scrollbar_size_v;
// Update distance to grab now that we have seeked and saturated
@@ -1022,14 +1038,15 @@ 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 ImVec2& padding, 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)
{
ImGuiContext& g = *GImGui;
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
return false;
- const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size + padding * 2);
+ const ImVec2 padding = g.Style.FramePadding;
+ const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size + padding * 2.0f);
ItemSize(bb);
if (!ItemAdd(bb, id))
return false;
@@ -1048,9 +1065,21 @@ bool ImGui::ImageButtonEx(ImGuiID id, ImTextureID texture_id, const ImVec2& size
return pressed;
}
-// frame_padding < 0: uses FramePadding from style (default)
-// frame_padding = 0: no framing
-// frame_padding > 0: set framing size
+bool ImGui::ImageButton(const char* str_id, ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& bg_col, const ImVec4& tint_col)
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ if (window->SkipItems)
+ return false;
+
+ return ImageButtonEx(window->GetID(str_id), user_texture_id, size, uv0, uv1, bg_col, tint_col);
+}
+
+#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
+// Legacy API obsoleted in 1.89. Two differences with new ImageButton()
+// - new ImageButton() requires an explicit 'const char* str_id' Old ImageButton() used opaque imTextureId (created issue with: multiple buttons with same image, transient texture id values, opaque computation of ID)
+// - new ImageButton() always use style.FramePadding Old ImageButton() had an override argument.
+// If you need to change padding with new ImageButton() you can use PushStyleVar(ImGuiStyleVar_FramePadding, value), consistent with other Button functions.
bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, int frame_padding, const ImVec4& bg_col, const ImVec4& tint_col)
{
ImGuiContext& g = *GImGui;
@@ -1063,9 +1092,14 @@ bool ImGui::ImageButton(ImTextureID user_texture_id, const ImVec2& size, const I
const ImGuiID id = window->GetID("#image");
PopID();
- const ImVec2 padding = (frame_padding >= 0) ? ImVec2((float)frame_padding, (float)frame_padding) : g.Style.FramePadding;
- return ImageButtonEx(id, user_texture_id, size, uv0, uv1, padding, bg_col, tint_col);
+ if (frame_padding >= 0)
+ PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2((float)frame_padding, (float)frame_padding));
+ bool ret = ImageButtonEx(id, user_texture_id, size, uv0, uv1, bg_col, tint_col);
+ if (frame_padding >= 0)
+ PopStyleVar();
+ return ret;
}
+#endif // #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
bool ImGui::Checkbox(const char* label, bool* v)
{
@@ -1280,7 +1314,7 @@ void ImGui::Bullet()
ImGuiContext& g = *GImGui;
const ImGuiStyle& style = g.Style;
- const float line_height = ImMax(ImMin(window->DC.CurrLineSize.y, g.FontSize + g.Style.FramePadding.y * 2), g.FontSize);
+ const float line_height = ImMax(ImMin(window->DC.CurrLineSize.y, g.FontSize + style.FramePadding.y * 2), g.FontSize);
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + ImVec2(g.FontSize, line_height));
ItemSize(bb);
if (!ItemAdd(bb, 0))
@@ -1336,6 +1370,7 @@ void ImGui::NewLine()
ImGuiContext& g = *GImGui;
const ImGuiLayoutType backup_layout_type = window->DC.LayoutType;
window->DC.LayoutType = ImGuiLayoutType_Vertical;
+ window->DC.IsSameLine = false;
if (window->DC.CurrLineSize.y > 0.0f) // In the event that we are on a line with items that is smaller that FontSize high, we will preserve its height.
ItemSize(ImVec2(0, 0));
else
@@ -1391,11 +1426,20 @@ void ImGui::SeparatorEx(ImGuiSeparatorFlags flags)
if (g.GroupStack.Size > 0 && g.GroupStack.back().WindowID == window->ID)
x1 += window->DC.Indent.x;
+ // FIXME-WORKRECT: In theory we should simply be using WorkRect.Min.x/Max.x everywhere but it isn't aesthetically what we want,
+ // need to introduce a variant of WorkRect for that purpose. (#4787)
+ if (ImGuiTable* table = g.CurrentTable)
+ {
+ x1 = table->Columns[table->CurrentColumn].MinX;
+ x2 = table->Columns[table->CurrentColumn].MaxX;
+ }
+
ImGuiOldColumns* columns = (flags & ImGuiSeparatorFlags_SpanAllColumns) ? window->DC.CurrentColumns : NULL;
if (columns)
PushColumnsBackground();
// 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 bool item_visible = ItemAdd(bb, 0);
@@ -1424,7 +1468,7 @@ void ImGui::Separator()
// Those flags should eventually be overridable by the user
ImGuiSeparatorFlags flags = (window->DC.LayoutType == ImGuiLayoutType_Horizontal) ? ImGuiSeparatorFlags_Vertical : ImGuiSeparatorFlags_Horizontal;
- flags |= ImGuiSeparatorFlags_SpanAllColumns;
+ flags |= ImGuiSeparatorFlags_SpanAllColumns; // NB: this only applies to legacy Columns() api as they relied on Separator() a lot.
SeparatorEx(flags);
}
@@ -1434,11 +1478,7 @@ bool ImGui::SplitterBehavior(const ImRect& bb, ImGuiID id, ImGuiAxis axis, float
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- const ImGuiItemFlags item_flags_backup = g.CurrentItemFlags;
- g.CurrentItemFlags |= ImGuiItemFlags_NoNav | ImGuiItemFlags_NoNavDefaultFocus;
- bool item_add = ItemAdd(bb, id);
- g.CurrentItemFlags = item_flags_backup;
- if (!item_add)
+ if (!ItemAdd(bb, id, NULL, ImGuiItemFlags_NoNav))
return false;
bool hovered, held;
@@ -1522,7 +1562,7 @@ void ImGui::ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_exc
width_excess -= width_to_remove_per_item * count_same_width;
}
- // Round width and redistribute remainder left-to-right (could make it an option of the function?)
+ // Round width and redistribute remainder
// Ensure that e.g. the right-most tab of a shrunk tab-bar always reaches exactly at the same distance from the right-most edge of the tab bar separator.
width_excess = 0.0f;
for (int n = 0; n < count; n++)
@@ -1531,10 +1571,13 @@ void ImGui::ShrinkWidths(ImGuiShrinkWidthItem* items, int count, float width_exc
width_excess += items[n].Width - width_rounded;
items[n].Width = width_rounded;
}
- if (width_excess > 0.0f)
- for (int n = 0; n < count; n++)
- if (items[n].Index < (int)(width_excess + 0.01f))
- items[n].Width += 1.0f;
+ while (width_excess > 0.0f)
+ for (int n = 0; n < count && width_excess > 0.0f; n++)
+ {
+ float width_to_add = ImMin(items[n].InitialWidth - items[n].Width, 1.0f);
+ items[n].Width += width_to_add;
+ width_excess -= width_to_add;
+ }
}
//-------------------------------------------------------------------------
@@ -1704,7 +1747,7 @@ bool ImGui::BeginComboPreview()
ImGuiWindow* window = g.CurrentWindow;
ImGuiComboPreviewData* preview_data = &g.ComboPreviewData;
- if (window->SkipItems || !window->ClipRect.Overlaps(g.LastItemData.Rect)) // FIXME: Because we don't have a ImGuiItemStatusFlags_Visible flag to test last ItemAdd() result
+ if (window->SkipItems || !(g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Visible))
return false;
IM_ASSERT(g.LastItemData.Rect.Min.x == preview_data->PreviewRect.Min.x && g.LastItemData.Rect.Min.y == preview_data->PreviewRect.Min.y); // Didn't call after BeginCombo/EndCombo block or forgot to pass ImGuiComboFlags_CustomPreview flag?
if (!window->ClipRect.Contains(preview_data->PreviewRect)) // Narrower test (optional)
@@ -1719,6 +1762,7 @@ bool ImGui::BeginComboPreview()
window->DC.CursorPos = preview_data->PreviewRect.Min + g.Style.FramePadding;
window->DC.CursorMaxPos = window->DC.CursorPos;
window->DC.LayoutType = ImGuiLayoutType_Horizontal;
+ window->DC.IsSameLine = false;
PushClipRect(preview_data->PreviewRect.Min, preview_data->PreviewRect.Max, true);
return true;
@@ -1744,6 +1788,7 @@ void ImGui::EndComboPreview()
window->DC.CursorPosPrevLine = preview_data->BackupCursorPosPrevLine;
window->DC.PrevLineTextBaseOffset = preview_data->BackupPrevLineTextBaseOffset;
window->DC.LayoutType = preview_data->BackupLayout;
+ window->DC.IsSameLine = false;
preview_data->PreviewRect = ImRect();
}
@@ -1799,7 +1844,7 @@ bool ImGui::Combo(const char* label, int* current_item, bool (*items_getter)(voi
bool value_changed = false;
for (int i = 0; i < items_count; i++)
{
- PushID((void*)(intptr_t)i);
+ PushID(i);
const bool item_selected = (i == *current_item);
const char* item_text;
if (!items_getter(data, i, &item_text))
@@ -1846,11 +1891,11 @@ bool ImGui::Combo(const char* label, int* current_item, const char* items_separa
//-------------------------------------------------------------------------
// [SECTION] Data Type and Data Formatting Helpers [Internal]
//-------------------------------------------------------------------------
-// - PatchFormatStringFloatToInt()
// - DataTypeGetInfo()
// - DataTypeFormatString()
// - DataTypeApplyOp()
// - DataTypeApplyOpFromText()
+// - DataTypeCompare()
// - DataTypeClamp()
// - GetMinimumStepAtDecimalPrecision
// - RoundScalarWithFormat<>()
@@ -1876,30 +1921,6 @@ static const ImGuiDataTypeInfo GDataTypeInfo[] =
};
IM_STATIC_ASSERT(IM_ARRAYSIZE(GDataTypeInfo) == ImGuiDataType_COUNT);
-// FIXME-LEGACY: Prior to 1.61 our DragInt() function internally used floats and because of this the compile-time default value for format was "%.0f".
-// Even though we changed the compile-time default, we expect users to have carried %f around, which would break the display of DragInt() calls.
-// To honor backward compatibility we are rewriting the format string, unless IMGUI_DISABLE_OBSOLETE_FUNCTIONS is enabled. What could possibly go wrong?!
-static const char* PatchFormatStringFloatToInt(const char* fmt)
-{
- if (fmt[0] == '%' && fmt[1] == '.' && fmt[2] == '0' && fmt[3] == 'f' && fmt[4] == 0) // Fast legacy path for "%.0f" which is expected to be the most common case.
- return "%d";
- const char* fmt_start = ImParseFormatFindStart(fmt); // Find % (if any, and ignore %%)
- const char* fmt_end = ImParseFormatFindEnd(fmt_start); // Find end of format specifier, which itself is an exercise of confidence/recklessness (because snprintf is dependent on libc or user).
- if (fmt_end > fmt_start && fmt_end[-1] == 'f')
- {
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
- if (fmt_start == fmt && fmt_end[0] == 0)
- return "%d";
- ImGuiContext& g = *GImGui;
- ImFormatString(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), "%.*s%%d%s", (int)(fmt_start - fmt), fmt, fmt_end); // Honor leading and trailing decorations, but lose alignment/precision.
- return g.TempBuffer;
-#else
- IM_ASSERT(0 && "DragInt(): Invalid format string!"); // Old versions used a default parameter of "%.0f", please replace with e.g. "%d"
-#endif
- }
- return fmt;
-}
-
const ImGuiDataTypeInfo* ImGui::DataTypeGetInfo(ImGuiDataType data_type)
{
IM_ASSERT(data_type >= 0 && data_type < ImGuiDataType_COUNT);
@@ -1981,24 +2002,10 @@ void ImGui::DataTypeApplyOp(ImGuiDataType data_type, int op, void* output, const
// User can input math operators (e.g. +100) to edit a numerical values.
// NB: This is _not_ a full expression evaluator. We should probably add one and replace this dumb mess..
-bool ImGui::DataTypeApplyOpFromText(const char* buf, const char* initial_value_buf, ImGuiDataType data_type, void* p_data, const char* format)
+bool ImGui::DataTypeApplyFromText(const char* buf, ImGuiDataType data_type, void* p_data, const char* format)
{
while (ImCharIsBlankA(*buf))
buf++;
-
- // We don't support '-' op because it would conflict with inputing negative value.
- // Instead you can use +-100 to subtract from an existing value
- char op = buf[0];
- if (op == '+' || op == '*' || op == '/')
- {
- buf++;
- while (ImCharIsBlankA(*buf))
- buf++;
- }
- else
- {
- op = 0;
- }
if (!buf[0])
return false;
@@ -2007,66 +2014,20 @@ bool ImGui::DataTypeApplyOpFromText(const char* buf, const char* initial_value_b
ImGuiDataTypeTempStorage data_backup;
memcpy(&data_backup, p_data, type_info->Size);
- if (format == NULL)
+ // Sanitize format
+ // For float/double we have to ignore format with precision (e.g. "%.2f") because sscanf doesn't take them in, so force them into %f and %lf
+ char format_sanitized[32];
+ if (data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double)
format = type_info->ScanFmt;
-
- // FIXME-LEGACY: The aim is to remove those operators and write a proper expression evaluator at some point..
- int arg1i = 0;
- if (data_type == ImGuiDataType_S32)
- {
- int* v = (int*)p_data;
- int arg0i = *v;
- float arg1f = 0.0f;
- if (op && sscanf(initial_value_buf, format, &arg0i) < 1)
- return false;
- // Store operand in a float so we can use fractional value for multipliers (*1.1), but constant always parsed as integer so we can fit big integers (e.g. 2000000003) past float precision
- if (op == '+') { if (sscanf(buf, "%d", &arg1i)) *v = (int)(arg0i + arg1i); } // Add (use "+-" to subtract)
- else if (op == '*') { if (sscanf(buf, "%f", &arg1f)) *v = (int)(arg0i * arg1f); } // Multiply
- else if (op == '/') { if (sscanf(buf, "%f", &arg1f) && arg1f != 0.0f) *v = (int)(arg0i / arg1f); } // Divide
- else { if (sscanf(buf, format, &arg1i) == 1) *v = arg1i; } // Assign constant
- }
- else if (data_type == ImGuiDataType_Float)
- {
- // For floats we have to ignore format with precision (e.g. "%.2f") because sscanf doesn't take them in
- format = "%f";
- float* v = (float*)p_data;
- float arg0f = *v, arg1f = 0.0f;
- if (op && sscanf(initial_value_buf, format, &arg0f) < 1)
- return false;
- if (sscanf(buf, format, &arg1f) < 1)
- return false;
- if (op == '+') { *v = arg0f + arg1f; } // Add (use "+-" to subtract)
- else if (op == '*') { *v = arg0f * arg1f; } // Multiply
- else if (op == '/') { if (arg1f != 0.0f) *v = arg0f / arg1f; } // Divide
- else { *v = arg1f; } // Assign constant
- }
- else if (data_type == ImGuiDataType_Double)
- {
- format = "%lf"; // scanf differentiate float/double unlike printf which forces everything to double because of ellipsis
- double* v = (double*)p_data;
- double arg0f = *v, arg1f = 0.0;
- if (op && sscanf(initial_value_buf, format, &arg0f) < 1)
- return false;
- if (sscanf(buf, format, &arg1f) < 1)
- return false;
- if (op == '+') { *v = arg0f + arg1f; } // Add (use "+-" to subtract)
- else if (op == '*') { *v = arg0f * arg1f; } // Multiply
- else if (op == '/') { if (arg1f != 0.0f) *v = arg0f / arg1f; } // Divide
- else { *v = arg1f; } // Assign constant
- }
- else if (data_type == ImGuiDataType_U32 || data_type == ImGuiDataType_S64 || data_type == ImGuiDataType_U64)
- {
- // All other types assign constant
- // We don't bother handling support for legacy operators since they are a little too crappy. Instead we will later implement a proper expression evaluator in the future.
- if (sscanf(buf, format, p_data) < 1)
- return false;
- }
else
+ format = ImParseFormatSanitizeForScanning(format, format_sanitized, IM_ARRAYSIZE(format_sanitized));
+
+ // Small types need a 32-bit buffer to receive the result from scanf()
+ int v32 = 0;
+ if (sscanf(buf, format, type_info->Size >= 4 ? p_data : &v32) < 1)
+ return false;
+ if (type_info->Size < 4)
{
- // Small types need a 32-bit buffer to receive the result from scanf()
- int v32;
- if (sscanf(buf, format, &v32) < 1)
- return false;
if (data_type == ImGuiDataType_S8)
*(ImS8*)p_data = (ImS8)ImClamp(v32, (int)IM_S8_MIN, (int)IM_S8_MAX);
else if (data_type == ImGuiDataType_U8)
@@ -2148,45 +2109,17 @@ static float GetMinimumStepAtDecimalPrecision(int decimal_precision)
}
template<typename TYPE>
-static const char* ImAtoi(const char* src, TYPE* output)
-{
- int negative = 0;
- if (*src == '-') { negative = 1; src++; }
- if (*src == '+') { src++; }
- TYPE v = 0;
- while (*src >= '0' && *src <= '9')
- v = (v * 10) + (*src++ - '0');
- *output = negative ? -v : v;
- return src;
-}
-
-// Sanitize format
-// - Zero terminate so extra characters after format (e.g. "%f123") don't confuse atof/atoi
-// - stb_sprintf.h supports several new modifiers which format numbers in a way that also makes them incompatible atof/atoi.
-static void SanitizeFormatString(const char* fmt, char* fmt_out, size_t fmt_out_size)
-{
- IM_UNUSED(fmt_out_size);
- const char* fmt_end = ImParseFormatFindEnd(fmt);
- IM_ASSERT((size_t)(fmt_end - fmt + 1) < fmt_out_size); // Format is too long, let us know if this happens to you!
- while (fmt < fmt_end)
- {
- char c = *(fmt++);
- if (c != '\'' && c != '$' && c != '_') // Custom flags provided by stb_sprintf.h. POSIX 2008 also supports '.
- *(fmt_out++) = c;
- }
- *fmt_out = 0; // Zero-terminate
-}
-
-template<typename TYPE, typename SIGNEDTYPE>
TYPE ImGui::RoundScalarWithFormatT(const char* format, ImGuiDataType data_type, TYPE v)
{
+ IM_UNUSED(data_type);
+ IM_ASSERT(data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double);
const char* fmt_start = ImParseFormatFindStart(format);
if (fmt_start[0] != '%' || fmt_start[1] == '%') // Don't apply if the value is not visible in the format string
return v;
// Sanitize format
char fmt_sanitized[32];
- SanitizeFormatString(fmt_start, fmt_sanitized, IM_ARRAYSIZE(fmt_sanitized));
+ ImParseFormatSanitizeForPrinting(fmt_start, fmt_sanitized, IM_ARRAYSIZE(fmt_sanitized));
fmt_start = fmt_sanitized;
// Format value with our rounding, and read back
@@ -2195,10 +2128,8 @@ TYPE ImGui::RoundScalarWithFormatT(const char* format, ImGuiDataType data_type,
const char* p = v_str;
while (*p == ' ')
p++;
- if (data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double)
- v = (TYPE)ImAtof(p);
- else
- ImAtoi(p, (SIGNEDTYPE*)&v);
+ v = (TYPE)ImAtof(p);
+
return v;
}
@@ -2248,7 +2179,10 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const
else if (g.ActiveIdSource == ImGuiInputSource_Nav)
{
const int decimal_precision = is_floating_point ? ImParseFormatPrecision(format, 3) : 0;
- adjust_delta = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard | ImGuiNavDirSourceFlags_PadDPad, ImGuiInputReadMode_RepeatFast, 1.0f / 10.0f, 10.0f)[axis];
+ const bool tweak_slow = IsKeyDown((g.NavInputSource == ImGuiInputSource_Gamepad) ? ImGuiKey_NavGamepadTweakSlow : ImGuiKey_NavKeyboardTweakSlow);
+ const bool tweak_fast = IsKeyDown((g.NavInputSource == ImGuiInputSource_Gamepad) ? ImGuiKey_NavGamepadTweakFast : ImGuiKey_NavKeyboardTweakFast);
+ const float tweak_factor = tweak_slow ? 1.0f / 1.0f : tweak_fast ? 10.0f : 1.0f;
+ adjust_delta = GetNavTweakPressedAmount(axis) * tweak_factor;
v_speed = ImMax(v_speed, GetMinimumStepAtDecimalPrecision(decimal_precision));
}
adjust_delta *= v_speed;
@@ -2302,8 +2236,8 @@ bool ImGui::DragBehaviorT(ImGuiDataType data_type, TYPE* v, float v_speed, const
}
// Round to user desired precision based on format string
- if (!(flags & ImGuiSliderFlags_NoRoundToFormat))
- v_cur = RoundScalarWithFormatT<TYPE, SIGNEDTYPE>(format, data_type, v_cur);
+ if (is_floating_point && !(flags & ImGuiSliderFlags_NoRoundToFormat))
+ v_cur = RoundScalarWithFormatT<TYPE>(format, data_type, v_cur);
// Preserve remainder after rounding has been applied. This also allow slow tweaking of values.
g.DragCurrentAccumDirty = false;
@@ -2346,6 +2280,7 @@ bool ImGui::DragBehavior(ImGuiID id, ImGuiDataType data_type, void* p_v, float v
ImGuiContext& g = *GImGui;
if (g.ActiveId == id)
{
+ // 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)
@@ -2399,29 +2334,23 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data,
// Default format string when passing NULL
if (format == NULL)
format = DataTypeGetInfo(data_type)->PrintFmt;
- else if (data_type == ImGuiDataType_S32 && strcmp(format, "%d") != 0) // (FIXME-LEGACY: Patch old "%.0f" format string to use "%d", read function more details.)
- format = PatchFormatStringFloatToInt(format);
- // Tabbing or CTRL-clicking on Drag turns it into an InputText
const bool hovered = ItemHoverable(frame_bb, id);
bool temp_input_is_active = temp_input_allowed && TempInputIsActive(id);
if (!temp_input_is_active)
{
- const bool focus_requested = temp_input_allowed && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Focused) != 0;
- const bool clicked = (hovered && g.IO.MouseClicked[0]);
- const bool double_clicked = (hovered && g.IO.MouseDoubleClicked[0]);
- if (focus_requested || clicked || double_clicked || g.NavActivateId == id || g.NavActivateInputId == id)
- {
- SetActiveID(id, window);
- SetFocusID(id, window);
- FocusWindow(window);
- g.ActiveIdUsingNavDirMask = (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right);
- if (temp_input_allowed)
- if (focus_requested || (clicked && g.IO.KeyCtrl) || double_clicked || g.NavActivateInputId == id)
- temp_input_is_active = true;
- }
+ // Tabbing or CTRL-clicking on Drag turns it into an InputText
+ 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);
+ 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)
+ temp_input_is_active = true;
- // Experimental: simple click (without moving) turns Drag into an InputText
+ // (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))
{
@@ -2429,6 +2358,14 @@ bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data,
g.NavActivateFlags = ImGuiActivateFlags_PreferInput;
temp_input_is_active = true;
}
+
+ if (make_active && !temp_input_is_active)
+ {
+ SetActiveID(id, window);
+ SetFocusID(id, window);
+ FocusWindow(window);
+ g.ActiveIdUsingNavDirMask = (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right);
+ }
}
if (temp_input_is_active)
@@ -2604,35 +2541,6 @@ bool ImGui::DragIntRange2(const char* label, int* v_current_min, int* v_current_
return value_changed;
}
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
-
-// Obsolete versions with power parameter. See https://github.com/ocornut/imgui/issues/3361 for details.
-bool ImGui::DragScalar(const char* label, ImGuiDataType data_type, void* p_data, float v_speed, const void* p_min, const void* p_max, const char* format, float power)
-{
- ImGuiSliderFlags drag_flags = ImGuiSliderFlags_None;
- if (power != 1.0f)
- {
- IM_ASSERT(power == 1.0f && "Call function with ImGuiSliderFlags_Logarithmic flags instead of using the old 'float power' function!");
- IM_ASSERT(p_min != NULL && p_max != NULL); // When using a power curve the drag needs to have known bounds
- drag_flags |= ImGuiSliderFlags_Logarithmic; // Fallback for non-asserting paths
- }
- return DragScalar(label, data_type, p_data, v_speed, p_min, p_max, format, drag_flags);
-}
-
-bool ImGui::DragScalarN(const char* label, ImGuiDataType data_type, void* p_data, int components, float v_speed, const void* p_min, const void* p_max, const char* format, float power)
-{
- ImGuiSliderFlags drag_flags = ImGuiSliderFlags_None;
- if (power != 1.0f)
- {
- IM_ASSERT(power == 1.0f && "Call function with ImGuiSliderFlags_Logarithmic flags instead of using the old 'float power' function!");
- IM_ASSERT(p_min != NULL && p_max != NULL); // When using a power curve the drag needs to have known bounds
- drag_flags |= ImGuiSliderFlags_Logarithmic; // Fallback for non-asserting paths
- }
- return DragScalarN(label, data_type, p_data, components, v_speed, p_min, p_max, format, drag_flags);
-}
-
-#endif // IMGUI_DISABLE_OBSOLETE_FUNCTIONS
-
//-------------------------------------------------------------------------
// [SECTION] Widgets: SliderScalar, SliderFloat, SliderInt, etc.
//-------------------------------------------------------------------------
@@ -2683,7 +2591,6 @@ float ImGui::ScaleRatioFromValueT(ImGuiDataType data_type, TYPE v, TYPE v_min, T
v_max_fudged = -logarithmic_zero_epsilon;
float result;
-
if (v_clamped <= v_min_fudged)
result = 0.0f; // Workaround for values that are in-range but below our fudge
else if (v_clamped >= v_max_fudged)
@@ -2707,84 +2614,74 @@ float ImGui::ScaleRatioFromValueT(ImGuiDataType data_type, TYPE v, TYPE v_min, T
return flipped ? (1.0f - result) : result;
}
-
- // Linear slider
- return (float)((FLOATTYPE)(SIGNEDTYPE)(v_clamped - v_min) / (FLOATTYPE)(SIGNEDTYPE)(v_max - v_min));
+ else
+ {
+ // Linear slider
+ return (float)((FLOATTYPE)(SIGNEDTYPE)(v_clamped - v_min) / (FLOATTYPE)(SIGNEDTYPE)(v_max - v_min));
+ }
}
// Convert a parametric position on a slider into a value v in the output space (the logical opposite of ScaleRatioFromValueT)
template<typename TYPE, typename SIGNEDTYPE, typename FLOATTYPE>
TYPE ImGui::ScaleValueFromRatioT(ImGuiDataType data_type, float t, TYPE v_min, TYPE v_max, bool is_logarithmic, float logarithmic_zero_epsilon, float zero_deadzone_halfsize)
{
- if (v_min == v_max)
+ // We special-case the extents because otherwise our logarithmic fudging can lead to "mathematically correct"
+ // but non-intuitive behaviors like a fully-left slider not actually reaching the minimum value. Also generally simpler.
+ if (t <= 0.0f || v_min == v_max)
return v_min;
- const bool is_floating_point = (data_type == ImGuiDataType_Float) || (data_type == ImGuiDataType_Double);
+ if (t >= 1.0f)
+ return v_max;
- TYPE result;
+ TYPE result = (TYPE)0;
if (is_logarithmic)
{
- // We special-case the extents because otherwise our fudging can lead to "mathematically correct" but non-intuitive behaviors like a fully-left slider not actually reaching the minimum value
- if (t <= 0.0f)
- result = v_min;
- else if (t >= 1.0f)
- result = v_max;
- else
- {
- bool flipped = v_max < v_min; // Check if range is "backwards"
-
- // Fudge min/max to avoid getting silly results close to zero
- FLOATTYPE v_min_fudged = (ImAbs((FLOATTYPE)v_min) < logarithmic_zero_epsilon) ? ((v_min < 0.0f) ? -logarithmic_zero_epsilon : logarithmic_zero_epsilon) : (FLOATTYPE)v_min;
- FLOATTYPE v_max_fudged = (ImAbs((FLOATTYPE)v_max) < logarithmic_zero_epsilon) ? ((v_max < 0.0f) ? -logarithmic_zero_epsilon : logarithmic_zero_epsilon) : (FLOATTYPE)v_max;
+ // Fudge min/max to avoid getting silly results close to zero
+ FLOATTYPE v_min_fudged = (ImAbs((FLOATTYPE)v_min) < logarithmic_zero_epsilon) ? ((v_min < 0.0f) ? -logarithmic_zero_epsilon : logarithmic_zero_epsilon) : (FLOATTYPE)v_min;
+ FLOATTYPE v_max_fudged = (ImAbs((FLOATTYPE)v_max) < logarithmic_zero_epsilon) ? ((v_max < 0.0f) ? -logarithmic_zero_epsilon : logarithmic_zero_epsilon) : (FLOATTYPE)v_max;
- if (flipped)
- ImSwap(v_min_fudged, v_max_fudged);
+ const bool flipped = v_max < v_min; // Check if range is "backwards"
+ if (flipped)
+ ImSwap(v_min_fudged, v_max_fudged);
- // Awkward special case - we need ranges of the form (-100 .. 0) to convert to (-100 .. -epsilon), not (-100 .. epsilon)
- if ((v_max == 0.0f) && (v_min < 0.0f))
- v_max_fudged = -logarithmic_zero_epsilon;
+ // Awkward special case - we need ranges of the form (-100 .. 0) to convert to (-100 .. -epsilon), not (-100 .. epsilon)
+ if ((v_max == 0.0f) && (v_min < 0.0f))
+ v_max_fudged = -logarithmic_zero_epsilon;
- float t_with_flip = flipped ? (1.0f - t) : t; // t, but flipped if necessary to account for us flipping the range
+ float t_with_flip = flipped ? (1.0f - t) : t; // t, but flipped if necessary to account for us flipping the range
- if ((v_min * v_max) < 0.0f) // Range crosses zero, so we have to do this in two parts
- {
- float zero_point_center = (-(float)ImMin(v_min, v_max)) / ImAbs((float)v_max - (float)v_min); // The zero point in parametric space
- float zero_point_snap_L = zero_point_center - zero_deadzone_halfsize;
- float zero_point_snap_R = zero_point_center + zero_deadzone_halfsize;
- if (t_with_flip >= zero_point_snap_L && t_with_flip <= zero_point_snap_R)
- result = (TYPE)0.0f; // Special case to make getting exactly zero possible (the epsilon prevents it otherwise)
- else if (t_with_flip < zero_point_center)
- result = (TYPE)-(logarithmic_zero_epsilon * ImPow(-v_min_fudged / logarithmic_zero_epsilon, (FLOATTYPE)(1.0f - (t_with_flip / zero_point_snap_L))));
- else
- result = (TYPE)(logarithmic_zero_epsilon * ImPow(v_max_fudged / logarithmic_zero_epsilon, (FLOATTYPE)((t_with_flip - zero_point_snap_R) / (1.0f - zero_point_snap_R))));
- }
- else if ((v_min < 0.0f) || (v_max < 0.0f)) // Entirely negative slider
- result = (TYPE)-(-v_max_fudged * ImPow(-v_min_fudged / -v_max_fudged, (FLOATTYPE)(1.0f - t_with_flip)));
+ if ((v_min * v_max) < 0.0f) // Range crosses zero, so we have to do this in two parts
+ {
+ float zero_point_center = (-(float)ImMin(v_min, v_max)) / ImAbs((float)v_max - (float)v_min); // The zero point in parametric space
+ float zero_point_snap_L = zero_point_center - zero_deadzone_halfsize;
+ float zero_point_snap_R = zero_point_center + zero_deadzone_halfsize;
+ if (t_with_flip >= zero_point_snap_L && t_with_flip <= zero_point_snap_R)
+ result = (TYPE)0.0f; // Special case to make getting exactly zero possible (the epsilon prevents it otherwise)
+ else if (t_with_flip < zero_point_center)
+ result = (TYPE)-(logarithmic_zero_epsilon * ImPow(-v_min_fudged / logarithmic_zero_epsilon, (FLOATTYPE)(1.0f - (t_with_flip / zero_point_snap_L))));
else
- result = (TYPE)(v_min_fudged * ImPow(v_max_fudged / v_min_fudged, (FLOATTYPE)t_with_flip));
+ result = (TYPE)(logarithmic_zero_epsilon * ImPow(v_max_fudged / logarithmic_zero_epsilon, (FLOATTYPE)((t_with_flip - zero_point_snap_R) / (1.0f - zero_point_snap_R))));
}
+ else if ((v_min < 0.0f) || (v_max < 0.0f)) // Entirely negative slider
+ result = (TYPE)-(-v_max_fudged * ImPow(-v_min_fudged / -v_max_fudged, (FLOATTYPE)(1.0f - t_with_flip)));
+ else
+ result = (TYPE)(v_min_fudged * ImPow(v_max_fudged / v_min_fudged, (FLOATTYPE)t_with_flip));
}
else
{
// Linear slider
+ const bool is_floating_point = (data_type == ImGuiDataType_Float) || (data_type == ImGuiDataType_Double);
if (is_floating_point)
{
result = ImLerp(v_min, v_max, t);
}
- else
+ else if (t < 1.0)
{
// - For integer values we want the clicking position to match the grab box so we round above
// This code is carefully tuned to work with large values (e.g. high ranges of U64) while preserving this property..
// - Not doing a *1.0 multiply at the end of a range as it tends to be lossy. While absolute aiming at a large s64/u64
// range is going to be imprecise anyway, with this check we at least make the edge values matches expected limits.
- if (t < 1.0)
- {
- FLOATTYPE v_new_off_f = (SIGNEDTYPE)(v_max - v_min) * t;
- result = (TYPE)((SIGNEDTYPE)v_min + (SIGNEDTYPE)(v_new_off_f + (FLOATTYPE)(v_min > v_max ? -0.5 : 0.5)));
- }
- else
- {
- result = v_max;
- }
+ FLOATTYPE v_new_off_f = (SIGNEDTYPE)(v_max - v_min) * t;
+ result = (TYPE)((SIGNEDTYPE)v_min + (SIGNEDTYPE)(v_new_off_f + (FLOATTYPE)(v_min > v_max ? -0.5 : 0.5)));
}
}
@@ -2796,7 +2693,7 @@ namespace ImGui
float RoundScalarWithFormatFloat(const char* format, ImGuiDataType data_type, float v)
{
- return RoundScalarWithFormatT<float, float>(format, data_type, v);
+ return RoundScalarWithFormatT<float>(format, data_type, v);
}
float SliderCalcRatioFromValueFloat(ImGuiDataType data_type, float v, float v_min, float v_max, float power, float linear_zero_pos)
@@ -2806,7 +2703,7 @@ float SliderCalcRatioFromValueFloat(ImGuiDataType data_type, float v, float v_mi
} // namespace ImGui
-// FIXME: Move more of the code into SliderBehavior()
+// FIXME: Try to move more of the code into shared SliderBehavior()
template<typename TYPE, typename SIGNEDTYPE, typename FLOATTYPE>
bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_type, TYPE* v, const TYPE v_min, const TYPE v_max, const char* format, ImGuiSliderFlags flags, ImRect* out_grab_bb)
{
@@ -2816,13 +2713,14 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
const ImGuiAxis axis = (flags & ImGuiSliderFlags_Vertical) ? ImGuiAxis_Y : ImGuiAxis_X;
const bool is_logarithmic = (flags & ImGuiSliderFlags_Logarithmic) != 0;
const bool is_floating_point = (data_type == ImGuiDataType_Float) || (data_type == ImGuiDataType_Double);
+ const SIGNEDTYPE v_range = (v_min < v_max ? v_max - v_min : v_min - v_max);
- const float grab_padding = 2.0f;
+ // Calculate bounds
+ const float grab_padding = 2.0f; // FIXME: Should be part of style.
const float slider_sz = (bb.Max[axis] - bb.Min[axis]) - grab_padding * 2.0f;
float grab_sz = style.GrabMinSize;
- SIGNEDTYPE v_range = (v_min < v_max ? v_max - v_min : v_min - v_max);
- if (!is_floating_point && v_range >= 0) // v_range < 0 may happen on integer overflows
- grab_sz = ImMax((float)(slider_sz / (v_range + 1)), style.GrabMinSize); // For integer sliders: if possible have the grab size represent 1 unit
+ if (!is_floating_point && v_range >= 0) // v_range < 0 may happen on integer overflows
+ grab_sz = ImMax((float)(slider_sz / (v_range + 1)), style.GrabMinSize); // For integer sliders: if possible have the grab size represent 1 unit
grab_sz = ImMin(grab_sz, slider_sz);
const float slider_usable_sz = slider_sz - grab_sz;
const float slider_usable_pos_min = bb.Min[axis] + grab_padding + grab_sz * 0.5f;
@@ -2853,7 +2751,17 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
else
{
const float mouse_abs_pos = g.IO.MousePos[axis];
- clicked_t = (slider_usable_sz > 0.0f) ? ImClamp((mouse_abs_pos - slider_usable_pos_min) / slider_usable_sz, 0.0f, 1.0f) : 0.0f;
+ if (g.ActiveIdIsJustActivated)
+ {
+ float grab_t = ScaleRatioFromValueT<TYPE, SIGNEDTYPE, FLOATTYPE>(data_type, *v, v_min, v_max, is_logarithmic, logarithmic_zero_epsilon, zero_deadzone_halfsize);
+ if (axis == ImGuiAxis_Y)
+ grab_t = 1.0f - grab_t;
+ const float grab_pos = ImLerp(slider_usable_pos_min, slider_usable_pos_max, grab_t);
+ const bool clicked_around_grab = (mouse_abs_pos >= grab_pos - grab_sz * 0.5f - 1.0f) && (mouse_abs_pos <= grab_pos + grab_sz * 0.5f + 1.0f); // No harm being extra generous here.
+ g.SliderGrabClickOffset = (clicked_around_grab && is_floating_point) ? mouse_abs_pos - grab_pos : 0.0f;
+ }
+ if (slider_usable_sz > 0.0f)
+ clicked_t = ImSaturate((mouse_abs_pos - g.SliderGrabClickOffset - slider_usable_pos_min) / slider_usable_sz);
if (axis == ImGuiAxis_Y)
clicked_t = 1.0f - clicked_t;
set_new_value = true;
@@ -2867,25 +2775,26 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
g.SliderCurrentAccumDirty = false;
}
- const ImVec2 input_delta2 = GetNavInputAmount2d(ImGuiNavDirSourceFlags_Keyboard | ImGuiNavDirSourceFlags_PadDPad, ImGuiInputReadMode_RepeatFast, 0.0f, 0.0f);
- float input_delta = (axis == ImGuiAxis_X) ? input_delta2.x : -input_delta2.y;
+ float input_delta = (axis == ImGuiAxis_X) ? GetNavTweakPressedAmount(axis) : -GetNavTweakPressedAmount(axis);
if (input_delta != 0.0f)
{
+ const bool tweak_slow = IsKeyDown((g.NavInputSource == ImGuiInputSource_Gamepad) ? ImGuiKey_NavGamepadTweakSlow : ImGuiKey_NavKeyboardTweakSlow);
+ const bool tweak_fast = IsKeyDown((g.NavInputSource == ImGuiInputSource_Gamepad) ? ImGuiKey_NavGamepadTweakFast : ImGuiKey_NavKeyboardTweakFast);
const int decimal_precision = is_floating_point ? ImParseFormatPrecision(format, 3) : 0;
if (decimal_precision > 0)
{
input_delta /= 100.0f; // Gamepad/keyboard tweak speeds in % of slider bounds
- if (IsNavInputDown(ImGuiNavInput_TweakSlow))
+ if (tweak_slow)
input_delta /= 10.0f;
}
else
{
- if ((v_range >= -100.0f && v_range <= 100.0f) || IsNavInputDown(ImGuiNavInput_TweakSlow))
+ if ((v_range >= -100.0f && v_range <= 100.0f) || tweak_slow)
input_delta = ((input_delta < 0.0f) ? -1.0f : +1.0f) / (float)v_range; // Gamepad/keyboard tweak speeds in integer steps
else
input_delta /= 100.0f;
}
- if (IsNavInputDown(ImGuiNavInput_TweakFast))
+ if (tweak_fast)
input_delta *= 10.0f;
g.SliderCurrentAccum += input_delta;
@@ -2914,8 +2823,8 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
// Calculate what our "new" clicked_t will be, and thus how far we actually moved the slider, and subtract this from the accumulator
TYPE v_new = ScaleValueFromRatioT<TYPE, SIGNEDTYPE, FLOATTYPE>(data_type, clicked_t, v_min, v_max, is_logarithmic, logarithmic_zero_epsilon, zero_deadzone_halfsize);
- if (!(flags & ImGuiSliderFlags_NoRoundToFormat))
- v_new = RoundScalarWithFormatT<TYPE, SIGNEDTYPE>(format, data_type, v_new);
+ if (is_floating_point && !(flags & ImGuiSliderFlags_NoRoundToFormat))
+ v_new = RoundScalarWithFormatT<TYPE>(format, data_type, v_new);
float new_clicked_t = ScaleRatioFromValueT<TYPE, SIGNEDTYPE, FLOATTYPE>(data_type, v_new, v_min, v_max, is_logarithmic, logarithmic_zero_epsilon, zero_deadzone_halfsize);
if (delta > 0)
@@ -2933,8 +2842,8 @@ bool ImGui::SliderBehaviorT(const ImRect& bb, ImGuiID id, ImGuiDataType data_typ
TYPE v_new = ScaleValueFromRatioT<TYPE, SIGNEDTYPE, FLOATTYPE>(data_type, clicked_t, v_min, v_max, is_logarithmic, logarithmic_zero_epsilon, zero_deadzone_halfsize);
// Round to user desired precision based on format string
- if (!(flags & ImGuiSliderFlags_NoRoundToFormat))
- v_new = RoundScalarWithFormatT<TYPE, SIGNEDTYPE>(format, data_type, v_new);
+ if (is_floating_point && !(flags & ImGuiSliderFlags_NoRoundToFormat))
+ v_new = RoundScalarWithFormatT<TYPE>(format, data_type, v_new);
// Apply result
if (*v != v_new)
@@ -2973,6 +2882,7 @@ bool ImGui::SliderBehavior(const ImRect& bb, ImGuiID id, ImGuiDataType data_type
// Read imgui.cpp "API BREAKING CHANGES" section for 1.78 if you hit this assert.
IM_ASSERT((flags == 1 || (flags & ImGuiSliderFlags_InvalidMask_) == 0) && "Invalid ImGuiSliderFlags flag! Has the 'float power' argument been mistakenly cast to flags? Call function with ImGuiSliderFlags_Logarithmic flags instead.");
+ // Those are the things we can do easily outside the SliderBehaviorT<> template, saves code generation.
ImGuiContext& g = *GImGui;
if ((g.LastItemData.InFlags & ImGuiItemFlags_ReadOnly) || (flags & ImGuiSliderFlags_ReadOnly))
return false;
@@ -3032,24 +2942,27 @@ bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_dat
// Default format string when passing NULL
if (format == NULL)
format = DataTypeGetInfo(data_type)->PrintFmt;
- else if (data_type == ImGuiDataType_S32 && strcmp(format, "%d") != 0) // (FIXME-LEGACY: Patch old "%.0f" format string to use "%d", read function more details.)
- format = PatchFormatStringFloatToInt(format);
- // Tabbing or CTRL-clicking on Slider turns it into an input box
const bool hovered = ItemHoverable(frame_bb, id);
bool temp_input_is_active = temp_input_allowed && TempInputIsActive(id);
if (!temp_input_is_active)
{
- const bool focus_requested = temp_input_allowed && (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Focused) != 0;
- const bool clicked = (hovered && g.IO.MouseClicked[0]);
- if (focus_requested || clicked || g.NavActivateId == id || g.NavActivateInputId == id)
+ // 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);
+ 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)
+ temp_input_is_active = true;
+
+ if (make_active && !temp_input_is_active)
{
SetActiveID(id, window);
SetFocusID(id, window);
FocusWindow(window);
g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right);
- if (temp_input_allowed && (focus_requested || (clicked && g.IO.KeyCtrl) || g.NavActivateInputId == id))
- temp_input_is_active = true;
}
}
@@ -3196,12 +3109,13 @@ bool ImGui::VSliderScalar(const char* label, const ImVec2& size, ImGuiDataType d
// Default format string when passing NULL
if (format == NULL)
format = DataTypeGetInfo(data_type)->PrintFmt;
- else if (data_type == ImGuiDataType_S32 && strcmp(format, "%d") != 0) // (FIXME-LEGACY: Patch old "%.0f" format string to use "%d", read function more details.)
- format = PatchFormatStringFloatToInt(format);
const bool hovered = ItemHoverable(frame_bb, id);
- if ((hovered && g.IO.MouseClicked[0]) || g.NavActivateId == id || g.NavActivateInputId == id)
+ const bool clicked = hovered && IsMouseClicked(0, id);
+ if (clicked || g.NavActivateId == id || g.NavActivateInputId == id)
{
+ if (clicked)
+ SetKeyOwner(ImGuiKey_MouseLeft, id);
SetActiveID(id, window);
SetFocusID(id, window);
FocusWindow(window);
@@ -3244,39 +3158,14 @@ bool ImGui::VSliderInt(const char* label, const ImVec2& size, int* v, int v_min,
return VSliderScalar(label, size, ImGuiDataType_S32, v, &v_min, &v_max, format, flags);
}
-#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
-
-// Obsolete versions with power parameter. See https://github.com/ocornut/imgui/issues/3361 for details.
-bool ImGui::SliderScalar(const char* label, ImGuiDataType data_type, void* p_data, const void* p_min, const void* p_max, const char* format, float power)
-{
- ImGuiSliderFlags slider_flags = ImGuiSliderFlags_None;
- if (power != 1.0f)
- {
- IM_ASSERT(power == 1.0f && "Call function with ImGuiSliderFlags_Logarithmic flags instead of using the old 'float power' function!");
- slider_flags |= ImGuiSliderFlags_Logarithmic; // Fallback for non-asserting paths
- }
- return SliderScalar(label, data_type, p_data, p_min, p_max, format, slider_flags);
-}
-
-bool ImGui::SliderScalarN(const char* label, ImGuiDataType data_type, void* v, int components, const void* v_min, const void* v_max, const char* format, float power)
-{
- ImGuiSliderFlags slider_flags = ImGuiSliderFlags_None;
- if (power != 1.0f)
- {
- IM_ASSERT(power == 1.0f && "Call function with ImGuiSliderFlags_Logarithmic flags instead of using the old 'float power' function!");
- slider_flags |= ImGuiSliderFlags_Logarithmic; // Fallback for non-asserting paths
- }
- return SliderScalarN(label, data_type, v, components, v_min, v_max, format, slider_flags);
-}
-
-#endif // IMGUI_DISABLE_OBSOLETE_FUNCTIONS
-
//-------------------------------------------------------------------------
// [SECTION] Widgets: InputScalar, InputFloat, InputInt, etc.
//-------------------------------------------------------------------------
// - ImParseFormatFindStart() [Internal]
// - ImParseFormatFindEnd() [Internal]
// - ImParseFormatTrimDecorations() [Internal]
+// - ImParseFormatSanitizeForPrinting() [Internal]
+// - ImParseFormatSanitizeForScanning() [Internal]
// - ImParseFormatPrecision() [Internal]
// - TempInputTextScalar() [Internal]
// - InputScalar()
@@ -3340,6 +3229,57 @@ const char* ImParseFormatTrimDecorations(const char* fmt, char* buf, size_t buf_
return buf;
}
+// Sanitize format
+// - Zero terminate so extra characters after format (e.g. "%f123") don't confuse atof/atoi
+// - stb_sprintf.h supports several new modifiers which format numbers in a way that also makes them incompatible atof/atoi.
+void ImParseFormatSanitizeForPrinting(const char* fmt_in, char* fmt_out, size_t fmt_out_size)
+{
+ const char* fmt_end = ImParseFormatFindEnd(fmt_in);
+ IM_UNUSED(fmt_out_size);
+ IM_ASSERT((size_t)(fmt_end - fmt_in + 1) < fmt_out_size); // Format is too long, let us know if this happens to you!
+ while (fmt_in < fmt_end)
+ {
+ char c = *fmt_in++;
+ if (c != '\'' && c != '$' && c != '_') // Custom flags provided by stb_sprintf.h. POSIX 2008 also supports '.
+ *(fmt_out++) = c;
+ }
+ *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"
+const char* ImParseFormatSanitizeForScanning(const char* fmt_in, char* fmt_out, size_t fmt_out_size)
+{
+ const char* fmt_end = ImParseFormatFindEnd(fmt_in);
+ const char* fmt_out_begin = fmt_out;
+ IM_UNUSED(fmt_out_size);
+ IM_ASSERT((size_t)(fmt_end - fmt_in + 1) < fmt_out_size); // Format is too long, let us know if this happens to you!
+ bool has_type = false;
+ while (fmt_in < fmt_end)
+ {
+ char c = *fmt_in++;
+ if (!has_type && ((c >= '0' && c <= '9') || 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 '.
+ *(fmt_out++) = c;
+ }
+ *fmt_out = 0; // Zero-terminate
+ return fmt_out_begin;
+}
+
+template<typename TYPE>
+static const char* ImAtoi(const char* src, TYPE* output)
+{
+ int negative = 0;
+ if (*src == '-') { negative = 1; src++; }
+ if (*src == '+') { src++; }
+ TYPE v = 0;
+ while (*src >= '0' && *src <= '9')
+ v = (v * 10) + (*src++ - '0');
+ *output = negative ? -v : v;
+ return src;
+}
+
// Parse display precision back from the display format string
// FIXME: This is still used by some navigation code path to infer a minimum tweak step, but we should aim to rework widgets so it isn't needed.
int ImParseFormatPrecision(const char* fmt, int default_precision)
@@ -3386,13 +3326,19 @@ bool ImGui::TempInputText(const ImRect& bb, ImGuiID id, const char* label, char*
return value_changed;
}
+static inline ImGuiInputTextFlags InputScalar_DefaultCharsFilter(ImGuiDataType data_type, const char* format)
+{
+ if (data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double)
+ return ImGuiInputTextFlags_CharsScientific;
+ const char format_last_char = format[0] ? format[strlen(format) - 1] : 0;
+ return (format_last_char == 'x' || format_last_char == 'X') ? ImGuiInputTextFlags_CharsHexadecimal : ImGuiInputTextFlags_CharsDecimal;
+}
+
// Note that Drag/Slider functions are only forwarding the min/max values clamping values if the ImGuiSliderFlags_AlwaysClamp flag is set!
// This is intended: this way we allow CTRL+Click manual input to set a value out of bounds, for maximum flexibility.
// However this may not be ideal for all uses, as some user code may break on out of bound values.
bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImGuiDataType data_type, void* p_data, const char* format, const void* p_clamp_min, const void* p_clamp_max)
{
- ImGuiContext& g = *GImGui;
-
char fmt_buf[32];
char data_buf[32];
format = ImParseFormatTrimDecorations(format, fmt_buf, IM_ARRAYSIZE(fmt_buf));
@@ -3400,7 +3346,8 @@ bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImG
ImStrTrimBlanks(data_buf);
ImGuiInputTextFlags flags = ImGuiInputTextFlags_AutoSelectAll | ImGuiInputTextFlags_NoMarkEdited;
- flags |= ((data_type == ImGuiDataType_Float || data_type == ImGuiDataType_Double) ? ImGuiInputTextFlags_CharsScientific : ImGuiInputTextFlags_CharsDecimal);
+ flags |= InputScalar_DefaultCharsFilter(data_type, format);
+
bool value_changed = false;
if (TempInputText(bb, id, label, data_buf, IM_ARRAYSIZE(data_buf), flags))
{
@@ -3410,7 +3357,7 @@ bool ImGui::TempInputScalar(const ImRect& bb, ImGuiID id, const char* label, ImG
memcpy(&data_backup, p_data, data_type_size);
// Apply new value (or operations) then clamp
- DataTypeApplyOpFromText(data_buf, g.InputTextState.InitialTextA.Data, data_type, p_data, NULL);
+ DataTypeApplyFromText(data_buf, data_type, p_data, format);
if (p_clamp_min || p_clamp_max)
{
if (p_clamp_min && p_clamp_max && DataTypeCompare(data_type, p_clamp_min, p_clamp_max) > 0)
@@ -3443,12 +3390,12 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data
char buf[64];
DataTypeFormatString(buf, IM_ARRAYSIZE(buf), data_type, p_data, format);
- bool value_changed = false;
- if ((flags & (ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsScientific)) == 0)
- flags |= ImGuiInputTextFlags_CharsDecimal;
- flags |= ImGuiInputTextFlags_AutoSelectAll;
- flags |= ImGuiInputTextFlags_NoMarkEdited; // We call MarkItemEdited() ourselves by comparing the actual data rather than the string.
+ // Testing ActiveId as a minor optimization as filtering is not needed until active
+ if (g.ActiveId == 0 && (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsScientific)) == 0)
+ flags |= InputScalar_DefaultCharsFilter(data_type, format);
+ 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)
{
const float button_size = GetFrameHeight();
@@ -3457,7 +3404,8 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data
PushID(label);
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 = DataTypeApplyOpFromText(buf, g.InputTextState.InitialTextA.Data, data_type, p_data, format);
+ value_changed = DataTypeApplyFromText(buf, data_type, p_data, format);
+ IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags);
// Step buttons
const ImVec2 backup_frame_padding = style.FramePadding;
@@ -3494,7 +3442,7 @@ bool ImGui::InputScalar(const char* label, ImGuiDataType data_type, void* p_data
else
{
if (InputText(label, buf, IM_ARRAYSIZE(buf), flags))
- value_changed = DataTypeApplyOpFromText(buf, g.InputTextState.InitialTextA.Data, data_type, p_data, format);
+ value_changed = DataTypeApplyFromText(buf, data_type, p_data, format);
}
if (value_changed)
MarkItemEdited(g.LastItemData.ID);
@@ -3592,7 +3540,11 @@ bool ImGui::InputDouble(const char* label, double* v, double step, double step_f
// - InputText()
// - InputTextWithHint()
// - InputTextMultiline()
+// - InputTextGetCharInfo() [Internal]
+// - InputTextReindexLines() [Internal]
+// - InputTextReindexLinesRange() [Internal]
// - InputTextEx() [Internal]
+// - DebugNodeInputTextState() [Internal]
//-------------------------------------------------------------------------
bool ImGui::InputText(const char* label, char* buf, size_t buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
@@ -3608,7 +3560,7 @@ bool ImGui::InputTextMultiline(const char* label, char* buf, size_t buf_size, co
bool ImGui::InputTextWithHint(const char* label, const char* hint, char* buf, size_t buf_size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data)
{
- IM_ASSERT(!(flags & ImGuiInputTextFlags_Multiline)); // call InputTextMultiline()
+ IM_ASSERT(!(flags & ImGuiInputTextFlags_Multiline)); // call InputTextMultiline() or InputTextEx() manually if you need multi-line + hint.
return InputTextEx(label, hint, buf, (int)buf_size, ImVec2(0, 0), flags, callback, user_data);
}
@@ -3694,16 +3646,14 @@ static void STB_TEXTEDIT_LAYOUTROW(StbTexteditRow* r, ImGuiInputTextState* ob
}
// 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=='|'; }
+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 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; }
-#ifdef __APPLE__ // FIXME: Move setting to IO structure
-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 int STB_TEXTEDIT_MOVEWORDRIGHT_IMPL(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; }
-#else
-static int STB_TEXTEDIT_MOVEWORDRIGHT_IMPL(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; }
-#endif
-#define STB_TEXTEDIT_MOVEWORDLEFT STB_TEXTEDIT_MOVEWORDLEFT_IMPL // They need to be #define for stb_textedit.h
+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); }
+#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
static void STB_TEXTEDIT_DELETECHARS(ImGuiInputTextState* obj, int pos, int n)
@@ -3782,11 +3732,12 @@ static void stb_textedit_replace(ImGuiInputTextState* str, STB_TexteditState* st
{
stb_text_makeundo_replace(str, state, 0, str->CurLenW, text_len);
ImStb::STB_TEXTEDIT_DELETECHARS(str, 0, str->CurLenW);
+ state->cursor = state->select_start = state->select_end = 0;
if (text_len <= 0)
return;
if (ImStb::STB_TEXTEDIT_INSERTCHARS(str, 0, text, text_len))
{
- state->cursor = text_len;
+ state->cursor = state->select_start = state->select_end = text_len;
state->has_preferred_x = 0;
return;
}
@@ -3871,7 +3822,7 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
if (c < 0x20)
{
bool pass = false;
- pass |= (c == '\n' && (flags & ImGuiInputTextFlags_Multiline));
+ pass |= (c == '\n' && (flags & ImGuiInputTextFlags_Multiline)); // Note that an Enter KEY will emit \r and be ignored (we poll for KEY in InputText() code)
pass |= (c == '\t' && (flags & ImGuiInputTextFlags_AllowTabInput));
if (!pass)
return false;
@@ -3896,14 +3847,22 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
// Generic named filters
if (apply_named_filters && (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsHexadecimal | ImGuiInputTextFlags_CharsUppercase | ImGuiInputTextFlags_CharsNoBlank | ImGuiInputTextFlags_CharsScientific)))
{
- // The libc allows overriding locale, with e.g. 'setlocale(LC_NUMERIC, "de_DE.UTF-8");' which affect the output/input of printf/scanf.
+ // The libc allows overriding locale, with e.g. 'setlocale(LC_NUMERIC, "de_DE.UTF-8");' which affect the output/input of printf/scanf to use e.g. ',' instead of '.'.
// The standard mandate that programs starts in the "C" locale where the decimal point is '.'.
// We don't really intend to provide widespread support for it, but out of empathy for people stuck with using odd API, we support the bare minimum aka overriding the decimal point.
// Change the default decimal_point with:
// ImGui::GetCurrentContext()->PlatformLocaleDecimalPoint = *localeconv()->decimal_point;
+ // Users of non-default decimal point (in particular ',') may be affected by word-selection logic (is_word_boundary_from_right/is_word_boundary_from_left) functions.
ImGuiContext& g = *GImGui;
const unsigned c_decimal_point = (unsigned int)g.PlatformLocaleDecimalPoint;
+ // Full-width -> half-width conversion for numeric fields (https://en.wikipedia.org/wiki/Halfwidth_and_Fullwidth_Forms_(Unicode_block)
+ // While this is mostly convenient, this has the side-effect for uninformed users accidentally inputting full-width characters that they may
+ // scratch their head as to why it works in numerical fields vs in generic text fields it would require support in the font.
+ if (flags & (ImGuiInputTextFlags_CharsDecimal | ImGuiInputTextFlags_CharsScientific | ImGuiInputTextFlags_CharsHexadecimal))
+ if (c >= 0xFF01 && c <= 0xFF5E)
+ c = c - 0xFF01 + 0x21;
+
// Allow 0-9 . - + * /
if (flags & ImGuiInputTextFlags_CharsDecimal)
if (!(c >= '0' && c <= '9') && (c != c_decimal_point) && (c != '-') && (c != '+') && (c != '*') && (c != '/'))
@@ -3922,11 +3881,13 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
// Turn a-z into A-Z
if (flags & ImGuiInputTextFlags_CharsUppercase)
if (c >= 'a' && c <= 'z')
- *p_char = (c += (unsigned int)('A' - 'a'));
+ c += (unsigned int)('A' - 'a');
if (flags & ImGuiInputTextFlags_CharsNoBlank)
if (ImCharIsBlankW(c))
return false;
+
+ *p_char = c;
}
// Custom callback filter
@@ -3948,6 +3909,41 @@ static bool InputTextFilterCharacter(unsigned int* p_char, ImGuiInputTextFlags f
return true;
}
+// Find the shortest single replacement we can make to get the new text from the old text.
+// Important: needs to be run before TextW is rewritten with the new characters because calling STB_TEXTEDIT_GETCHAR() at the end.
+// FIXME: Ideally we should transition toward (1) making InsertChars()/DeleteChars() update undo-stack (2) discourage (and keep reconcile) or obsolete (and remove reconcile) accessing buffer directly.
+static void InputTextReconcileUndoStateAfterUserCallback(ImGuiInputTextState* state, const char* new_buf_a, int new_length_a)
+{
+ ImGuiContext& g = *GImGui;
+ const ImWchar* old_buf = state->TextW.Data;
+ const int old_length = state->CurLenW;
+ const int new_length = ImTextCountCharsFromUtf8(new_buf_a, new_buf_a + new_length_a);
+ g.TempBuffer.reserve_discard((new_length + 1) * sizeof(ImWchar));
+ ImWchar* new_buf = (ImWchar*)(void*)g.TempBuffer.Data;
+ ImTextStrFromUtf8(new_buf, new_length + 1, new_buf_a, new_buf_a + new_length_a);
+
+ const int shorter_length = ImMin(old_length, new_length);
+ int first_diff;
+ for (first_diff = 0; first_diff < shorter_length; first_diff++)
+ if (old_buf[first_diff] != new_buf[first_diff])
+ break;
+ if (first_diff == old_length && first_diff == new_length)
+ return;
+
+ int old_last_diff = old_length - 1;
+ int new_last_diff = new_length - 1;
+ for (; old_last_diff >= first_diff && new_last_diff >= first_diff; old_last_diff--, new_last_diff--)
+ if (old_buf[old_last_diff] != new_buf[new_last_diff])
+ break;
+
+ const int insert_len = new_last_diff - first_diff + 1;
+ const int delete_len = old_last_diff - first_diff + 1;
+ if (insert_len > 0 || delete_len > 0)
+ if (STB_TEXTEDIT_CHARTYPE* p = stb_text_createundo(&state->Stb.undostate, first_diff, delete_len, insert_len))
+ for (int i = 0; i < delete_len; i++)
+ p[i] = ImStb::STB_TEXTEDIT_GETCHAR(state, first_diff + i);
+}
+
// 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
@@ -3979,7 +3975,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (is_resizable)
IM_ASSERT(callback != NULL); // Must provide a callback if you set the ImGuiInputTextFlags_CallbackResize flag!
- if (is_multiline) // Open group before calling GetID() because groups tracks id created within their scope,
+ if (is_multiline) // Open group before calling GetID() because groups tracks id created within their scope (including the scrollbar)
BeginGroup();
const ImGuiID id = window->GetID(label);
const ImVec2 label_size = CalcTextSize(label, NULL, true);
@@ -3992,6 +3988,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
ImGuiWindow* draw_window = window;
ImVec2 inner_size = frame_size;
ImGuiItemStatusFlags item_status_flags = 0;
+ ImGuiLastItemData item_data_backup;
if (is_multiline)
{
ImVec2 backup_pos = window->DC.CursorPos;
@@ -4002,6 +3999,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
return false;
}
item_status_flags = g.LastItemData.StatusFlags;
+ item_data_backup = g.LastItemData;
window->DC.CursorPos = backup_pos;
// We reproduce the contents of BeginChildFrame() in order to provide 'label' so our window internal data are easier to read/debug.
@@ -4009,8 +4007,9 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
PushStyleColor(ImGuiCol_ChildBg, style.Colors[ImGuiCol_FrameBg]);
PushStyleVar(ImGuiStyleVar_ChildRounding, style.FrameRounding);
PushStyleVar(ImGuiStyleVar_ChildBorderSize, style.FrameBorderSize);
+ PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0)); // Ensure no clip rect so mouse hover can reach FramePadding edges
bool child_visible = BeginChildEx(label, id, frame_bb.GetSize(), true, ImGuiWindowFlags_NoMove);
- PopStyleVar(2);
+ PopStyleVar(3);
PopStyleColor();
if (!child_visible)
{
@@ -4039,21 +4038,19 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
// We are only allowed to access the state if we are already the active widget.
ImGuiInputTextState* state = GetInputTextState(id);
- const bool focus_requested_by_code = (item_status_flags & ImGuiItemStatusFlags_FocusedByCode) != 0;
- const bool focus_requested_by_tabbing = (item_status_flags & ImGuiItemStatusFlags_FocusedByTabbing) != 0;
+ 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 user_clicked = hovered && io.MouseClicked[0];
- const bool user_nav_input_start = (g.ActiveId != id) && (g.NavActivateInputId == id || g.NavActivateId == id);
const bool user_scroll_finish = is_multiline && state != NULL && g.ActiveId == 0 && g.ActiveIdPreviousFrame == GetWindowScrollbarID(draw_window, ImGuiAxis_Y);
const bool user_scroll_active = is_multiline && state != NULL && g.ActiveId == GetWindowScrollbarID(draw_window, ImGuiAxis_Y);
-
bool clear_active_id = false;
- bool select_all = (g.ActiveId != id) && ((flags & ImGuiInputTextFlags_AutoSelectAll) != 0 || user_nav_input_start) && (!is_multiline);
+ bool select_all = false;
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_make_active = (user_clicked || user_scroll_finish || user_nav_input_start || focus_requested_by_code || focus_requested_by_tabbing);
+ 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)
{
@@ -4067,17 +4064,21 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
state->InitialTextA.resize(buf_len + 1); // UTF-8. we use +1 to make sure that .Data is always pointing to at least an empty string.
memcpy(state->InitialTextA.Data, buf, buf_len + 1);
+ // Preserve cursor position and undo/redo stack if we come back to same widget
+ // FIXME: Since we reworked this on 2022/06, may want to differenciate recycle_cursor vs recycle_undostate?
+ bool recycle_state = (state->ID == id && !init_changed_specs);
+ if (recycle_state && (state->CurLenA != buf_len || (state->TextAIsValid && strncmp(state->TextA.Data, buf, buf_len) != 0)))
+ recycle_state = false;
+
// Start edition
const char* buf_end = NULL;
+ state->ID = id;
state->TextW.resize(buf_size + 1); // wchar count <= UTF-8 count. we use +1 to make sure that .Data is always pointing to at least an empty string.
state->TextA.resize(0);
state->TextAIsValid = false; // TextA is not valid yet (we will display buf until then)
state->CurLenW = ImTextStrFromUtf8(state->TextW.Data, buf_size, buf, NULL, &buf_end);
state->CurLenA = (int)(buf_end - buf); // We can't get the result from ImStrncpy() above because it is not UTF-8 aware. Here we'll cut off malformed UTF-8.
- // Preserve cursor position and undo/redo stack if we come back to same widget
- // FIXME: For non-readonly widgets we might be able to require that TextAIsValid && TextA == buf ? (untested) and discard undo stack if user buffer has changed.
- const bool recycle_state = (state->ID == id && !init_changed_specs);
if (recycle_state)
{
// Recycle existing cursor/selection/undo stack but clamp position
@@ -4086,16 +4087,22 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
}
else
{
- state->ID = id;
state->ScrollX = 0.0f;
stb_textedit_initialize_state(&state->Stb, !is_multiline);
- if (!is_multiline && focus_requested_by_code)
+ }
+
+ if (!is_multiline)
+ {
+ if (flags & ImGuiInputTextFlags_AutoSelectAll)
+ select_all = true;
+ if (input_requested_by_nav && (!recycle_state || !(g.NavActivateFlags & ImGuiActivateFlags_TryToPreserveState)))
+ select_all = true;
+ if (input_requested_by_tabbing || (user_clicked && io.KeyCtrl))
select_all = true;
}
+
if (flags & ImGuiInputTextFlags_AlwaysOverwrite)
state->Stb.insert_mode = 1; // stb field name is indeed incorrect (see #2863)
- if (!is_multiline && (focus_requested_by_tabbing || (user_clicked && io.KeyCtrl)))
- select_all = true;
}
if (g.ActiveId != id && init_make_active)
@@ -4104,18 +4111,24 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
SetActiveID(id, window);
SetFocusID(id, window);
FocusWindow(window);
-
- // Declare our inputs
- IM_ASSERT(ImGuiNavInput_COUNT < 32);
+ }
+ if (g.ActiveId == id)
+ {
+ // Declare some inputs, the other are registered and polled via Shortcut() routing system.
+ if (user_clicked)
+ SetKeyOwner(ImGuiKey_MouseLeft, id);
g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Left) | (1 << ImGuiDir_Right);
if (is_multiline || (flags & ImGuiInputTextFlags_CallbackHistory))
g.ActiveIdUsingNavDirMask |= (1 << ImGuiDir_Up) | (1 << ImGuiDir_Down);
- g.ActiveIdUsingNavInputMask |= (1 << ImGuiNavInput_Cancel);
- g.ActiveIdUsingKeyInputMask |= ((ImU64)1 << ImGuiKey_Home) | ((ImU64)1 << ImGuiKey_End);
+ SetKeyOwner(ImGuiKey_Home, id);
+ SetKeyOwner(ImGuiKey_End, id);
if (is_multiline)
- g.ActiveIdUsingKeyInputMask |= ((ImU64)1 << ImGuiKey_PageUp) | ((ImU64)1 << ImGuiKey_PageDown);
- if (flags & (ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_AllowTabInput)) // Disable keyboard tabbing out as we will use the \t character.
- g.ActiveIdUsingKeyInputMask |= ((ImU64)1 << ImGuiKey_Tab);
+ {
+ SetKeyOwner(ImGuiKey_PageUp, id);
+ SetKeyOwner(ImGuiKey_PageDown, id);
+ }
+ if (flags & (ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_AllowTabInput)) // Disable keyboard tabbing out as we will use the \t character.
+ SetKeyOwner(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)
@@ -4127,10 +4140,10 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
clear_active_id = true;
// Lock the decision of whether we are going to take the path displaying the cursor or selection
- const bool render_cursor = (g.ActiveId == id) || (state && user_scroll_active);
- bool render_selection = state && state->HasSelection() && (RENDER_SELECTION_WHEN_INACTIVE || render_cursor);
+ bool render_cursor = (g.ActiveId == id) || (state && user_scroll_active);
+ bool render_selection = state && (state->HasSelection() || select_all) && (RENDER_SELECTION_WHEN_INACTIVE || render_cursor);
bool value_changed = false;
- bool enter_pressed = false;
+ bool validated = false;
// When read-only we always use the live data passed to the function
// FIXME-OPT: Because our selection/cursor code currently needs the wide text we need to convert it when active, which is not ideal :(
@@ -4173,8 +4186,6 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
state->Edited = false;
state->BufCapacityA = buf_size;
state->Flags = flags;
- state->UserCallback = callback;
- state->UserCallbackData = callback_user_data;
// 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.
@@ -4186,22 +4197,54 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
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 || (hovered && !is_osx && io.MouseDoubleClicked[0]))
+ if (select_all)
{
state->SelectAll();
state->SelectedAllMouseLock = true;
}
- else if (hovered && is_osx && io.MouseDoubleClicked[0])
+ else if (hovered && io.MouseClickedCount[0] >= 2 && !io.KeyShift)
{
- // Double-click select a word only, OS X style (by simulating keystrokes)
- state->OnKeyPressed(STB_TEXTEDIT_K_WORDLEFT);
- state->OnKeyPressed(STB_TEXTEDIT_K_WORDRIGHT | STB_TEXTEDIT_K_SHIFT);
+ stb_textedit_click(state, &state->Stb, mouse_x, mouse_y);
+ const int multiclick_count = (io.MouseClickedCount[0] - 2);
+ if ((multiclick_count % 2) == 0)
+ {
+ // Double-click: Select word
+ // We always use the "Mac" word advance for double-click select vs CTRL+Right which use the platform dependent variant:
+ // FIXME: There are likely many ways to improve this behavior, but there's no "right" behavior (depends on use-case, software, OS)
+ const bool is_bol = (state->Stb.cursor == 0) || ImStb::STB_TEXTEDIT_GETCHAR(state, state->Stb.cursor - 1) == '\n';
+ if (STB_TEXT_HAS_SELECTION(&state->Stb) || !is_bol)
+ state->OnKeyPressed(STB_TEXTEDIT_K_WORDLEFT);
+ //state->OnKeyPressed(STB_TEXTEDIT_K_WORDRIGHT | STB_TEXTEDIT_K_SHIFT);
+ if (!STB_TEXT_HAS_SELECTION(&state->Stb))
+ ImStb::stb_textedit_prep_selection_at_cursor(&state->Stb);
+ state->Stb.cursor = ImStb::STB_TEXTEDIT_MOVEWORDRIGHT_MAC(state, state->Stb.cursor);
+ state->Stb.select_end = state->Stb.cursor;
+ ImStb::stb_textedit_clamp(state, &state->Stb);
+ }
+ else
+ {
+ // Triple-click: Select line
+ const bool is_eol = ImStb::STB_TEXTEDIT_GETCHAR(state, state->Stb.cursor) == '\n';
+ state->OnKeyPressed(STB_TEXTEDIT_K_LINESTART);
+ state->OnKeyPressed(STB_TEXTEDIT_K_LINEEND | STB_TEXTEDIT_K_SHIFT);
+ state->OnKeyPressed(STB_TEXTEDIT_K_RIGHT | STB_TEXTEDIT_K_SHIFT);
+ if (!is_eol && is_multiline)
+ {
+ ImSwap(state->Stb.select_start, state->Stb.select_end);
+ state->Stb.cursor = state->Stb.select_end;
+ }
+ state->CursorFollow = false;
+ }
+ state->CursorAnimReset();
}
else if (io.MouseClicked[0] && !state->SelectedAllMouseLock)
{
if (hovered)
{
- stb_textedit_click(state, &state->Stb, mouse_x, mouse_y);
+ if (io.KeyShift)
+ stb_textedit_drag(state, &state->Stb, mouse_x, mouse_y);
+ else
+ stb_textedit_click(state, &state->Stb, mouse_x, mouse_y);
state->CursorAnimReset();
}
}
@@ -4214,27 +4257,26 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (state->SelectedAllMouseLock && !io.MouseDown[0])
state->SelectedAllMouseLock = false;
- // It is ill-defined whether the backend needs to send a \t character when pressing the TAB keys.
- // Win32 and GLFW naturally do it but not SDL.
+ // 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) && IsKeyPressedMap(ImGuiKey_Tab) && !ignore_char_inputs && !io.KeyShift && !is_readonly)
- if (!io.InputQueueCharacters.contains('\t'))
- {
- unsigned int c = '\t'; // Insert TAB
- if (InputTextFilterCharacter(&c, flags, callback, callback_user_data, ImGuiInputSource_Keyboard))
- state->OnKeyPressed((int)c);
- }
+ if ((flags & ImGuiInputTextFlags_AllowTabInput) && IsKeyPressed(ImGuiKey_Tab) && !ignore_char_inputs && !io.KeyShift && !is_readonly)
+ {
+ unsigned int c = '\t'; // Insert TAB
+ if (InputTextFilterCharacter(&c, flags, callback, callback_user_data, ImGuiInputSource_Keyboard))
+ state->OnKeyPressed((int)c);
+ }
// 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.
if (io.InputQueueCharacters.Size > 0)
{
- if (!ignore_char_inputs && !is_readonly && !user_nav_input_start)
+ if (!ignore_char_inputs && !is_readonly && !input_requested_by_nav)
for (int n = 0; n < io.InputQueueCharacters.Size; n++)
{
// Insert character if they pass filtering
unsigned int c = (unsigned int)io.InputQueueCharacters[n];
- if (c == '\t' && io.KeyShift)
+ if (c == '\t') // Skip Tab, see above.
continue;
if (InputTextFilterCharacter(&c, flags, callback, callback_user_data, ImGuiInputSource_Keyboard))
state->OnKeyPressed((int)c);
@@ -4246,45 +4288,46 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
}
// Process other shortcuts/key-presses
- bool cancel_edit = false;
+ bool revert_edit = false;
if (g.ActiveId == id && !g.ActiveIdIsJustActivated && !clear_active_id)
{
IM_ASSERT(state != NULL);
- IM_ASSERT(io.KeyMods == GetMergedKeyModFlags() && "Mismatching io.KeyCtrl/io.KeyShift/io.KeyAlt/io.KeySuper vs io.KeyMods"); // We rarely do this check, but if anything let's do it here.
const int row_count_per_page = ImMax((int)((inner_size.y - style.FramePadding.y) / g.FontSize), 1);
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_osx_shift_shortcut = is_osx && (io.KeyMods == (ImGuiKeyModFlags_Super | ImGuiKeyModFlags_Shift));
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
- const bool is_ctrl_key_only = (io.KeyMods == ImGuiKeyModFlags_Ctrl);
- const bool is_shift_key_only = (io.KeyMods == ImGuiKeyModFlags_Shift);
- const bool is_shortcut_key = g.IO.ConfigMacOSXBehaviors ? (io.KeyMods == ImGuiKeyModFlags_Super) : (io.KeyMods == ImGuiKeyModFlags_Ctrl);
- const bool is_cut = ((is_shortcut_key && IsKeyPressedMap(ImGuiKey_X)) || (is_shift_key_only && IsKeyPressedMap(ImGuiKey_Delete))) && !is_readonly && !is_password && (!is_multiline || state->HasSelection());
- const bool is_copy = ((is_shortcut_key && IsKeyPressedMap(ImGuiKey_C)) || (is_ctrl_key_only && IsKeyPressedMap(ImGuiKey_Insert))) && !is_password && (!is_multiline || state->HasSelection());
- const bool is_paste = ((is_shortcut_key && IsKeyPressedMap(ImGuiKey_V)) || (is_shift_key_only && IsKeyPressedMap(ImGuiKey_Insert))) && !is_readonly;
- const bool is_undo = ((is_shortcut_key && IsKeyPressedMap(ImGuiKey_Z)) && !is_readonly && is_undoable);
- const bool is_redo = ((is_shortcut_key && IsKeyPressedMap(ImGuiKey_Y)) || (is_osx_shift_shortcut && IsKeyPressedMap(ImGuiKey_Z))) && !is_readonly && is_undoable;
+ // Using Shortcut() with ImGuiInputFlags_RouteFocused (default policy) to allow routing operations for other code (e.g. calling window trying to use CTRL+A and CTRL+B: formet would be handled by InputText)
+ // Otherwise we could simply assume that we own the keys as we are active.
+ const ImGuiInputFlags f_repeat = ImGuiInputFlags_Repeat;
+ const bool is_cut = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_X, id, f_repeat) || Shortcut(ImGuiMod_Shift | ImGuiKey_Delete, id, f_repeat)) && !is_readonly && !is_password && (!is_multiline || state->HasSelection());
+ const bool is_copy = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_C, id) || Shortcut(ImGuiMod_Ctrl | ImGuiKey_Insert, id)) && !is_password && (!is_multiline || state->HasSelection());
+ const bool is_paste = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_V, id, f_repeat) || Shortcut(ImGuiMod_Shift | ImGuiKey_Insert, id, f_repeat)) && !is_readonly;
+ const bool is_undo = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_Z, id, f_repeat)) && !is_readonly && is_undoable;
+ const bool is_redo = (Shortcut(ImGuiMod_Shortcut | ImGuiKey_Y, id, f_repeat) || (is_osx && Shortcut(ImGuiMod_Shortcut | ImGuiMod_Shift | ImGuiKey_Z, id, f_repeat))) && !is_readonly && is_undoable;
+ const bool is_select_all = Shortcut(ImGuiMod_Shortcut | ImGuiKey_A, id);
// We allow validate/cancel with Nav source (gamepad) to makes it easier to undo an accidental NavInput press with no keyboard wired, but otherwise it isn't very useful.
- const bool is_validate_enter = IsKeyPressedMap(ImGuiKey_Enter) || IsKeyPressedMap(ImGuiKey_KeyPadEnter);
- const bool is_validate_nav = (IsNavInputTest(ImGuiNavInput_Activate, ImGuiInputReadMode_Pressed) && !IsKeyPressedMap(ImGuiKey_Space)) || IsNavInputTest(ImGuiNavInput_Input, ImGuiInputReadMode_Pressed);
- const bool is_cancel = IsKeyPressedMap(ImGuiKey_Escape) || IsNavInputTest(ImGuiNavInput_Cancel, ImGuiInputReadMode_Pressed);
-
- if (IsKeyPressedMap(ImGuiKey_LeftArrow)) { state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_LINESTART : is_wordmove_key_down ? STB_TEXTEDIT_K_WORDLEFT : STB_TEXTEDIT_K_LEFT) | k_mask); }
- else if (IsKeyPressedMap(ImGuiKey_RightArrow)) { state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_LINEEND : is_wordmove_key_down ? STB_TEXTEDIT_K_WORDRIGHT : STB_TEXTEDIT_K_RIGHT) | k_mask); }
- else if (IsKeyPressedMap(ImGuiKey_UpArrow) && is_multiline) { if (io.KeyCtrl) SetScrollY(draw_window, ImMax(draw_window->Scroll.y - g.FontSize, 0.0f)); else state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_TEXTSTART : STB_TEXTEDIT_K_UP) | k_mask); }
- else if (IsKeyPressedMap(ImGuiKey_DownArrow) && is_multiline) { if (io.KeyCtrl) SetScrollY(draw_window, ImMin(draw_window->Scroll.y + g.FontSize, GetScrollMaxY())); else state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_TEXTEND : STB_TEXTEDIT_K_DOWN) | k_mask); }
- else if (IsKeyPressedMap(ImGuiKey_PageUp) && is_multiline) { state->OnKeyPressed(STB_TEXTEDIT_K_PGUP | k_mask); scroll_y -= row_count_per_page * g.FontSize; }
- else if (IsKeyPressedMap(ImGuiKey_PageDown) && is_multiline) { state->OnKeyPressed(STB_TEXTEDIT_K_PGDOWN | k_mask); scroll_y += row_count_per_page * g.FontSize; }
- else if (IsKeyPressedMap(ImGuiKey_Home)) { state->OnKeyPressed(io.KeyCtrl ? STB_TEXTEDIT_K_TEXTSTART | k_mask : STB_TEXTEDIT_K_LINESTART | k_mask); }
- else if (IsKeyPressedMap(ImGuiKey_End)) { state->OnKeyPressed(io.KeyCtrl ? STB_TEXTEDIT_K_TEXTEND | k_mask : STB_TEXTEDIT_K_LINEEND | k_mask); }
- else if (IsKeyPressedMap(ImGuiKey_Delete) && !is_readonly) { state->OnKeyPressed(STB_TEXTEDIT_K_DELETE | k_mask); }
- else if (IsKeyPressedMap(ImGuiKey_Backspace) && !is_readonly)
+ const bool nav_gamepad_active = (io.ConfigFlags & ImGuiConfigFlags_NavEnableGamepad) != 0 && (io.BackendFlags & ImGuiBackendFlags_HasGamepad) != 0;
+ const bool is_enter_pressed = IsKeyPressed(ImGuiKey_Enter, true) || IsKeyPressed(ImGuiKey_KeypadEnter, true);
+ const bool is_gamepad_validate = nav_gamepad_active && (IsKeyPressed(ImGuiKey_NavGamepadActivate, false) || IsKeyPressed(ImGuiKey_NavGamepadInput, false));
+ const bool is_cancel = Shortcut(ImGuiKey_Escape, id, f_repeat) || (nav_gamepad_active && Shortcut(ImGuiKey_NavGamepadCancel, id, f_repeat));
+
+ // FIXME: Should use more Shortcut() and reduce IsKeyPressed()+SetKeyOwner(), but requires modifiers combination to be taken account of.
+ if (IsKeyPressed(ImGuiKey_LeftArrow)) { state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_LINESTART : is_wordmove_key_down ? STB_TEXTEDIT_K_WORDLEFT : STB_TEXTEDIT_K_LEFT) | k_mask); }
+ else if (IsKeyPressed(ImGuiKey_RightArrow)) { state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_LINEEND : is_wordmove_key_down ? STB_TEXTEDIT_K_WORDRIGHT : STB_TEXTEDIT_K_RIGHT) | k_mask); }
+ else if (IsKeyPressed(ImGuiKey_UpArrow) && is_multiline) { if (io.KeyCtrl) SetScrollY(draw_window, ImMax(draw_window->Scroll.y - g.FontSize, 0.0f)); else state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_TEXTSTART : STB_TEXTEDIT_K_UP) | k_mask); }
+ else if (IsKeyPressed(ImGuiKey_DownArrow) && is_multiline) { if (io.KeyCtrl) SetScrollY(draw_window, ImMin(draw_window->Scroll.y + g.FontSize, GetScrollMaxY())); else state->OnKeyPressed((is_startend_key_down ? STB_TEXTEDIT_K_TEXTEND : STB_TEXTEDIT_K_DOWN) | k_mask); }
+ else if (IsKeyPressed(ImGuiKey_PageUp) && is_multiline) { state->OnKeyPressed(STB_TEXTEDIT_K_PGUP | k_mask); scroll_y -= row_count_per_page * g.FontSize; }
+ 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_Backspace) && !is_readonly)
{
if (!state->HasSelection())
{
@@ -4295,12 +4338,17 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
}
state->OnKeyPressed(STB_TEXTEDIT_K_BACKSPACE | k_mask);
}
- else if (is_validate_enter)
+ else if (is_enter_pressed || is_gamepad_validate)
{
+ // Determine if we turn Enter into a \n character
bool ctrl_enter_for_new_line = (flags & ImGuiInputTextFlags_CtrlEnterForNewLine) != 0;
- if (!is_multiline || (ctrl_enter_for_new_line && !io.KeyCtrl) || (!ctrl_enter_for_new_line && io.KeyCtrl))
+ if (!is_multiline || is_gamepad_validate || (ctrl_enter_for_new_line && !io.KeyCtrl) || (!ctrl_enter_for_new_line && io.KeyCtrl))
{
- enter_pressed = clear_active_id = true;
+ validated = true;
+ if (io.ConfigInputTextEnterKeepActive && !is_multiline)
+ state->SelectAll(); // No need to scroll
+ else
+ clear_active_id = true;
}
else if (!is_readonly)
{
@@ -4309,21 +4357,32 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
state->OnKeyPressed((int)c);
}
}
- else if (is_validate_nav)
- {
- IM_ASSERT(!is_validate_enter);
- enter_pressed = clear_active_id = true;
- }
else if (is_cancel)
{
- clear_active_id = cancel_edit = true;
+ if (flags & ImGuiInputTextFlags_EscapeClearsAll)
+ {
+ if (state->CurLenA > 0)
+ {
+ revert_edit = true;
+ }
+ else
+ {
+ render_cursor = render_selection = false;
+ clear_active_id = true;
+ }
+ }
+ else
+ {
+ clear_active_id = revert_edit = true;
+ render_cursor = render_selection = false;
+ }
}
else if (is_undo || is_redo)
{
state->OnKeyPressed(is_undo ? STB_TEXTEDIT_K_UNDO : STB_TEXTEDIT_K_REDO);
state->ClearSelection();
}
- else if (is_shortcut_key && IsKeyPressedMap(ImGuiKey_A))
+ else if (is_select_all)
{
state->SelectAll();
state->CursorFollow = true;
@@ -4382,16 +4441,24 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
}
// Process callbacks and apply result back to user's buffer.
+ const char* apply_new_text = NULL;
+ int apply_new_text_length = 0;
if (g.ActiveId == id)
{
IM_ASSERT(state != NULL);
- const char* apply_new_text = NULL;
- int apply_new_text_length = 0;
- if (cancel_edit)
+ if (revert_edit && !is_readonly)
{
- // Restore initial value. Only return true if restoring to the initial value changes the current buffer contents.
- if (!is_readonly && strcmp(buf, state->InitialTextA.Data) != 0)
+ if (flags & ImGuiInputTextFlags_EscapeClearsAll)
{
+ // Clear input
+ apply_new_text = "";
+ apply_new_text_length = 0;
+ STB_TEXTEDIT_CHARTYPE empty_string;
+ stb_textedit_replace(state, &state->Stb, &empty_string, 0);
+ }
+ else if (strcmp(buf, state->InitialTextA.Data) != 0)
+ {
+ // Restore initial value. Only return true if restoring to the initial value changes the current buffer contents.
// 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;
@@ -4405,22 +4472,24 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
}
}
+ // Apply ASCII value
+ if (!is_readonly)
+ {
+ state->TextAIsValid = true;
+ state->TextA.resize(state->TextW.Size * 4 + 1);
+ ImTextStrToUtf8(state->TextA.Data, state->TextA.Size, state->TextW.Data, NULL);
+ }
+
// When using 'ImGuiInputTextFlags_EnterReturnsTrue' as a special case we reapply the live buffer back to the input buffer before clearing ActiveId, even though strictly speaking it wasn't modified on this frame.
// If we didn't do that, code like InputInt() with ImGuiInputTextFlags_EnterReturnsTrue would fail.
// This also allows the user to use InputText() with ImGuiInputTextFlags_EnterReturnsTrue without maintaining any user-side storage (please note that if you use this property along ImGuiInputTextFlags_CallbackResize you can end up with your temporary string object unnecessarily allocating once a frame, either store your string data, either if you don't then don't use ImGuiInputTextFlags_CallbackResize).
- bool apply_edit_back_to_user_buffer = !cancel_edit || (enter_pressed && (flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0);
+ const bool apply_edit_back_to_user_buffer = !revert_edit || (validated && (flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0);
if (apply_edit_back_to_user_buffer)
{
// Apply new value immediately - copy modified buffer back
// Note that as soon as the input box is active, the in-widget value gets priority over any underlying modification of the input buffer
// FIXME: We actually always render 'buf' when calling DrawList->AddText, making the comment above incorrect.
// FIXME-OPT: CPU waste to do this every time the widget is active, should mark dirty state from the stb_textedit callbacks.
- if (!is_readonly)
- {
- state->TextAIsValid = true;
- state->TextA.resize(state->TextW.Size * 4 + 1);
- ImTextStrToUtf8(state->TextA.Data, state->TextA.Size, state->TextW.Data, NULL);
- }
// User callback
if ((flags & (ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_CallbackHistory | ImGuiInputTextFlags_CallbackEdit | ImGuiInputTextFlags_CallbackAlways)) != 0)
@@ -4429,18 +4498,18 @@ 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_COUNT;
- if ((flags & ImGuiInputTextFlags_CallbackCompletion) != 0 && IsKeyPressedMap(ImGuiKey_Tab))
+ ImGuiKey event_key = ImGuiKey_None;
+ if ((flags & ImGuiInputTextFlags_CallbackCompletion) != 0 && IsKeyPressed(ImGuiKey_Tab))
{
event_flag = ImGuiInputTextFlags_CallbackCompletion;
event_key = ImGuiKey_Tab;
}
- else if ((flags & ImGuiInputTextFlags_CallbackHistory) != 0 && IsKeyPressedMap(ImGuiKey_UpArrow))
+ else if ((flags & ImGuiInputTextFlags_CallbackHistory) != 0 && IsKeyPressed(ImGuiKey_UpArrow))
{
event_flag = ImGuiInputTextFlags_CallbackHistory;
event_key = ImGuiKey_UpArrow;
}
- else if ((flags & ImGuiInputTextFlags_CallbackHistory) != 0 && IsKeyPressedMap(ImGuiKey_DownArrow))
+ else if ((flags & ImGuiInputTextFlags_CallbackHistory) != 0 && IsKeyPressed(ImGuiKey_DownArrow))
{
event_flag = ImGuiInputTextFlags_CallbackHistory;
event_key = ImGuiKey_DownArrow;
@@ -4462,8 +4531,9 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
callback_data.Flags = flags;
callback_data.UserData = callback_user_data;
+ char* callback_buf = is_readonly ? buf : state->TextA.Data;
callback_data.EventKey = event_key;
- callback_data.Buf = state->TextA.Data;
+ callback_data.Buf = callback_buf;
callback_data.BufTextLen = state->CurLenA;
callback_data.BufSize = state->BufCapacityA;
callback_data.BufDirty = false;
@@ -4478,7 +4548,8 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
callback(&callback_data);
// Read back what user may have modified
- IM_ASSERT(callback_data.Buf == state->TextA.Data); // Invalid to modify those fields
+ callback_buf = is_readonly ? buf : state->TextA.Data; // Pointer may have been invalidated by a resize callback
+ IM_ASSERT(callback_data.Buf == callback_buf); // Invalid to modify those fields
IM_ASSERT(callback_data.BufSize == state->BufCapacityA);
IM_ASSERT(callback_data.Flags == flags);
const bool buf_dirty = callback_data.BufDirty;
@@ -4487,9 +4558,11 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (callback_data.SelectionEnd != utf8_selection_end || buf_dirty) { state->Stb.select_end = (callback_data.SelectionEnd == callback_data.SelectionStart) ? state->Stb.select_start : ImTextCountCharsFromUtf8(callback_data.Buf, callback_data.Buf + callback_data.SelectionEnd); }
if (buf_dirty)
{
+ IM_ASSERT((flags & ImGuiInputTextFlags_ReadOnly) == 0);
IM_ASSERT(callback_data.BufTextLen == (int)strlen(callback_data.Buf)); // You need to maintain BufTextLen if you change the text!
+ InputTextReconcileUndoStateAfterUserCallback(state, callback_data.Buf, callback_data.BufTextLen); // FIXME: Move the rest of this block inside function and rename to InputTextReconcileStateAfterUserCallback() ?
if (callback_data.BufTextLen > backup_current_text_length && is_resizable)
- state->TextW.resize(state->TextW.Size + (callback_data.BufTextLen - backup_current_text_length));
+ state->TextW.resize(state->TextW.Size + (callback_data.BufTextLen - backup_current_text_length)); // Worse case scenario resize
state->CurLenW = ImTextStrFromUtf8(state->TextW.Data, state->TextW.Size, callback_data.Buf, NULL);
state->CurLenA = callback_data.BufTextLen; // Assume correct length and valid UTF-8 from user, saves us an extra strlen()
state->CursorAnimReset();
@@ -4504,40 +4577,35 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
apply_new_text_length = state->CurLenA;
}
}
+ }
- // Copy result to user buffer
- if (apply_new_text)
+ // Copy result to user buffer. This can currently only happen when (g.ActiveId == id)
+ if (apply_new_text != NULL)
+ {
+ // We cannot test for 'backup_current_text_length != apply_new_text_length' here because we have no guarantee that the size
+ // of our owned buffer matches the size of the string object held by the user, and by design we allow InputText() to be used
+ // without any storage on user's side.
+ IM_ASSERT(apply_new_text_length >= 0);
+ if (is_resizable)
{
- // We cannot test for 'backup_current_text_length != apply_new_text_length' here because we have no guarantee that the size
- // of our owned buffer matches the size of the string object held by the user, and by design we allow InputText() to be used
- // without any storage on user's side.
- IM_ASSERT(apply_new_text_length >= 0);
- if (is_resizable)
- {
- ImGuiInputTextCallbackData callback_data;
- callback_data.EventFlag = ImGuiInputTextFlags_CallbackResize;
- callback_data.Flags = flags;
- callback_data.Buf = buf;
- callback_data.BufTextLen = apply_new_text_length;
- callback_data.BufSize = ImMax(buf_size, apply_new_text_length + 1);
- callback_data.UserData = callback_user_data;
- callback(&callback_data);
- buf = callback_data.Buf;
- buf_size = callback_data.BufSize;
- apply_new_text_length = ImMin(callback_data.BufTextLen, buf_size - 1);
- IM_ASSERT(apply_new_text_length <= buf_size);
- }
- //IMGUI_DEBUG_LOG("InputText(\"%s\"): apply_new_text length %d\n", label, apply_new_text_length);
-
- // 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;
+ ImGuiInputTextCallbackData callback_data;
+ callback_data.EventFlag = ImGuiInputTextFlags_CallbackResize;
+ callback_data.Flags = flags;
+ callback_data.Buf = buf;
+ callback_data.BufTextLen = apply_new_text_length;
+ callback_data.BufSize = ImMax(buf_size, apply_new_text_length + 1);
+ callback_data.UserData = callback_user_data;
+ callback(&callback_data);
+ buf = callback_data.Buf;
+ buf_size = callback_data.BufSize;
+ apply_new_text_length = ImMin(callback_data.BufTextLen, buf_size - 1);
+ IM_ASSERT(apply_new_text_length <= buf_size);
}
+ //IMGUI_DEBUG_PRINT("InputText(\"%s\"): apply_new_text length %d\n", label, apply_new_text_length);
- // Clear temporary user storage
- state->Flags = ImGuiInputTextFlags_None;
- state->UserCallback = NULL;
- state->UserCallbackData = NULL;
+ // 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)
@@ -4659,7 +4727,7 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
// Test if cursor is vertically visible
if (cursor_offset.y - g.FontSize < scroll_y)
scroll_y = ImMax(0.0f, cursor_offset.y - g.FontSize);
- else if (cursor_offset.y - inner_size.y >= scroll_y)
+ else if (cursor_offset.y - (inner_size.y - style.FramePadding.y * 2.0f) >= scroll_y)
scroll_y = cursor_offset.y - inner_size.y + style.FramePadding.y * 2.0f;
const float scroll_max_y = ImMax((text_size.y + style.FramePadding.y * 2.0f) - inner_size.y, 0.0f);
scroll_y = ImClamp(scroll_y, 0.0f, scroll_max_y);
@@ -4726,7 +4794,11 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
// Notify OS of text input position for advanced IME (-1 x offset so that Windows IME can cover our cursor. Bit of an extra nicety.)
if (!is_readonly)
- g.PlatformImePos = ImVec2(cursor_screen_pos.x - 1.0f, cursor_screen_pos.y - g.FontSize);
+ {
+ g.PlatformImeData.WantVisible = true;
+ g.PlatformImeData.InputPos = ImVec2(cursor_screen_pos.x - 1.0f, cursor_screen_pos.y - g.FontSize);
+ g.PlatformImeData.InputLineHeight = g.FontSize;
+ }
}
}
else
@@ -4751,9 +4823,23 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
if (is_multiline)
{
+ // For focus requests to work on our multiline we need to ensure our child ItemAdd() call specifies the ImGuiItemFlags_Inputable (ref issue #4761)...
Dummy(ImVec2(text_size.x, text_size.y + style.FramePadding.y));
+ ImGuiItemFlags backup_item_flags = g.CurrentItemFlags;
+ g.CurrentItemFlags |= ImGuiItemFlags_Inputable | ImGuiItemFlags_NoTabStop;
EndChild();
+ item_data_backup.StatusFlags |= (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_HoveredWindow);
+ g.CurrentItemFlags = backup_item_flags;
+
+ // ...and then we need to undo the group overriding last item data, which gets a bit messy as EndGroup() tries to forward scrollbar being active...
+ // FIXME: This quite messy/tricky, should attempt to get rid of the child window.
EndGroup();
+ if (g.LastItemData.ID == 0)
+ {
+ g.LastItemData.ID = id;
+ g.LastItemData.InFlags = item_data_backup.InFlags;
+ g.LastItemData.StatusFlags = item_data_backup.StatusFlags;
+ }
}
// Log as text
@@ -4771,11 +4857,46 @@ bool ImGui::InputTextEx(const char* label, const char* hint, char* buf, int buf_
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags);
if ((flags & ImGuiInputTextFlags_EnterReturnsTrue) != 0)
- return enter_pressed;
+ return validated;
else
return value_changed;
}
+void ImGui::DebugNodeInputTextState(ImGuiInputTextState* state)
+{
+#ifndef IMGUI_DISABLE_DEBUG_TOOLS
+ ImGuiContext& g = *GImGui;
+ ImStb::STB_TexteditState* stb_state = &state->Stb;
+ 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("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
+ {
+ PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0));
+ for (int n = 0; n < STB_TEXTEDIT_UNDOSTATECOUNT; n++)
+ {
+ ImStb::StbUndoRecord* undo_rec = &undo_state->undo_rec[n];
+ const char undo_rec_type = (n < undo_state->undo_point) ? 'u' : (n >= undo_state->redo_point) ? 'r' : ' ';
+ if (undo_rec_type == ' ')
+ BeginDisabled();
+ char buf[64] = "";
+ if (undo_rec_type != ' ' && undo_rec->char_storage != -1)
+ ImTextStrToUtf8(buf, IM_ARRAYSIZE(buf), undo_state->undo_char + undo_rec->char_storage, undo_state->undo_char + undo_rec->char_storage + undo_rec->insert_length);
+ Text("%c [%02d] where %03d, insert %03d, delete %03d, char_storage %03d \"%s\"",
+ undo_rec_type, n, undo_rec->where, undo_rec->insert_length, undo_rec->delete_length, undo_rec->char_storage, buf);
+ if (undo_rec_type == ' ')
+ EndDisabled();
+ }
+ PopStyleVar();
+ }
+ EndChild();
+#else
+ IM_UNUSED(state);
+#endif
+}
+
//-------------------------------------------------------------------------
// [SECTION] Widgets: ColorEdit, ColorPicker, ColorButton, etc.
//-------------------------------------------------------------------------
@@ -4925,7 +5046,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
value_changed |= DragInt(ids[n], &i[n], 1.0f, 0, hdr ? 0 : 255, fmt_table_int[fmt_idx][n]);
}
if (!(flags & ImGuiColorEditFlags_NoOptions))
- OpenPopupOnItemClick("context");
+ OpenPopupOnItemClick("context", ImGuiPopupFlags_MouseButtonRight);
}
}
else if ((flags & ImGuiColorEditFlags_DisplayHex) != 0 && (flags & ImGuiColorEditFlags_NoInputs) == 0)
@@ -4953,7 +5074,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
IM_UNUSED(r); // Fixes C6031: Return value ignored: 'sscanf'.
}
if (!(flags & ImGuiColorEditFlags_NoOptions))
- OpenPopupOnItemClick("context");
+ OpenPopupOnItemClick("context", ImGuiPopupFlags_MouseButtonRight);
}
ImGuiWindow* picker_active_window = NULL;
@@ -4970,32 +5091,37 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
// Store current color and open a picker
g.ColorPickerRef = col_v4;
OpenPopup("picker");
- SetNextWindowPos(g.LastItemData.Rect.GetBL() + ImVec2(-1, style.ItemSpacing.y));
+ SetNextWindowPos(g.LastItemData.Rect.GetBL() + ImVec2(0.0f, style.ItemSpacing.y));
}
}
if (!(flags & ImGuiColorEditFlags_NoOptions))
- OpenPopupOnItemClick("context");
+ OpenPopupOnItemClick("context", ImGuiPopupFlags_MouseButtonRight);
if (BeginPopup("picker"))
{
- picker_active_window = g.CurrentWindow;
- if (label != label_display_end)
+ if (g.CurrentWindow->BeginCount == 1)
{
- TextEx(label, label_display_end);
- Spacing();
+ picker_active_window = g.CurrentWindow;
+ if (label != label_display_end)
+ {
+ TextEx(label, label_display_end);
+ Spacing();
+ }
+ ImGuiColorEditFlags picker_flags_to_forward = ImGuiColorEditFlags_DataTypeMask_ | ImGuiColorEditFlags_PickerMask_ | ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaBar;
+ ImGuiColorEditFlags picker_flags = (flags_untouched & picker_flags_to_forward) | ImGuiColorEditFlags_DisplayMask_ | ImGuiColorEditFlags_NoLabel | ImGuiColorEditFlags_AlphaPreviewHalf;
+ SetNextItemWidth(square_sz * 12.0f); // Use 256 + bar sizes?
+ value_changed |= ColorPicker4("##picker", col, picker_flags, &g.ColorPickerRef.x);
}
- ImGuiColorEditFlags picker_flags_to_forward = ImGuiColorEditFlags_DataTypeMask_ | ImGuiColorEditFlags_PickerMask_ | ImGuiColorEditFlags_InputMask_ | ImGuiColorEditFlags_HDR | ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_AlphaBar;
- ImGuiColorEditFlags picker_flags = (flags_untouched & picker_flags_to_forward) | ImGuiColorEditFlags_DisplayMask_ | ImGuiColorEditFlags_NoLabel | ImGuiColorEditFlags_AlphaPreviewHalf;
- SetNextItemWidth(square_sz * 12.0f); // Use 256 + bar sizes?
- value_changed |= ColorPicker4("##picker", col, picker_flags, &g.ColorPickerRef.x);
EndPopup();
}
}
if (label != label_display_end && !(flags & ImGuiColorEditFlags_NoLabel))
{
- const float text_offset_x = (flags & ImGuiColorEditFlags_NoInputs) ? w_button : w_full + style.ItemInnerSpacing.x;
- window->DC.CursorPos = ImVec2(pos.x + text_offset_x, pos.y + style.FramePadding.y);
+ // Position not necessarily next to last submitted button (e.g. if style.ColorButtonPosition == ImGuiDir_Left),
+ // but we need to use SameLine() to setup baseline correctly. Might want to refactor SameLine() to simplify this.
+ SameLine(0.0f, style.ItemInnerSpacing.x);
+ window->DC.CursorPos.x = pos.x + ((flags & ImGuiColorEditFlags_NoInputs) ? w_button : w_full + style.ItemInnerSpacing.x);
TextEx(label, label_display_end);
}
@@ -5032,7 +5158,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
bool accepted_drag_drop = false;
if (const ImGuiPayload* payload = AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_3F))
{
- memcpy((float*)col, payload->Data, sizeof(float) * 3); // Preserve alpha if any //-V512
+ memcpy((float*)col, payload->Data, sizeof(float) * 3); // Preserve alpha if any //-V512 //-V1086
value_changed = accepted_drag_drop = true;
}
if (const ImGuiPayload* payload = AcceptDragDropPayload(IMGUI_PAYLOAD_TYPE_COLOR_4F))
@@ -5051,7 +5177,7 @@ bool ImGui::ColorEdit4(const char* label, float col[4], ImGuiColorEditFlags flag
if (picker_active_window && g.ActiveId != 0 && g.ActiveIdWindow == picker_active_window)
g.LastItemData.ID = g.ActiveId;
- if (value_changed)
+ if (value_changed && g.LastItemData.ID != 0) // In case of ID collision, the second EndGroup() won't catch g.ActiveId
MarkItemEdited(g.LastItemData.ID);
return value_changed;
@@ -5188,7 +5314,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
}
}
if (!(flags & ImGuiColorEditFlags_NoOptions))
- OpenPopupOnItemClick("context");
+ OpenPopupOnItemClick("context", ImGuiPopupFlags_MouseButtonRight);
}
else if (flags & ImGuiColorEditFlags_PickerHueBar)
{
@@ -5205,7 +5331,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
value_changed = value_changed_sv = true;
}
if (!(flags & ImGuiColorEditFlags_NoOptions))
- OpenPopupOnItemClick("context");
+ OpenPopupOnItemClick("context", ImGuiPopupFlags_MouseButtonRight);
// Hue bar logic
SetCursorScreenPos(ImVec2(bar0_pos_x, picker_pos.y));
@@ -5439,7 +5565,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
if (value_changed && memcmp(backup_initial_col, col, components * sizeof(float)) == 0)
value_changed = false;
- if (value_changed)
+ if (value_changed && g.LastItemData.ID != 0) // In case of ID collision, the second EndGroup() won't catch g.ActiveId
MarkItemEdited(g.LastItemData.ID);
PopID();
@@ -5451,7 +5577,7 @@ bool ImGui::ColorPicker4(const char* label, float col[4], ImGuiColorEditFlags fl
// FIXME: May want to display/ignore the alpha component in the color display? Yet show it in the tooltip.
// 'desc_id' is not called 'label' because we don't display it next to the button, but only in the tooltip.
// Note that 'col' may be encoded in HSV if ImGuiColorEditFlags_InputHSV is set.
-bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFlags flags, ImVec2 size)
+bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFlags flags, const ImVec2& size_arg)
{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
@@ -5459,11 +5585,8 @@ bool ImGui::ColorButton(const char* desc_id, const ImVec4& col, ImGuiColorEditFl
ImGuiContext& g = *GImGui;
const ImGuiID id = window->GetID(desc_id);
- float default_size = GetFrameHeight();
- if (size.x == 0.0f)
- size.x = default_size;
- if (size.y == 0.0f)
- size.y = default_size;
+ const float default_size = GetFrameHeight();
+ const ImVec2 size(size_arg.x == 0.0f ? default_size : size_arg.x, size_arg.y == 0.0f ? default_size : size_arg.y);
const ImRect bb(window->DC.CursorPos, window->DC.CursorPos + size);
ItemSize(bb, (size.y >= default_size) ? g.Style.FramePadding.y : 0.0f);
if (!ItemAdd(bb, id))
@@ -5558,7 +5681,7 @@ void ImGui::ColorTooltip(const char* text, const float* col, ImGuiColorEditFlags
{
ImGuiContext& g = *GImGui;
- BeginTooltipEx(0, ImGuiTooltipFlags_OverridePreviousTooltip);
+ BeginTooltipEx(ImGuiTooltipFlags_OverridePreviousTooltip, ImGuiWindowFlags_None);
const char* text_end = text ? FindRenderedTextEnd(text, NULL) : text;
if (text_end > text)
{
@@ -5761,9 +5884,9 @@ bool ImGui::TreeNodeExV(const char* str_id, ImGuiTreeNodeFlags flags, const char
if (window->SkipItems)
return false;
- ImGuiContext& g = *GImGui;
- const char* label_end = g.TempBuffer + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
- return TreeNodeBehavior(window->GetID(str_id), flags, g.TempBuffer, label_end);
+ const char* label, *label_end;
+ ImFormatStringToTempBufferV(&label, &label_end, fmt, args);
+ return TreeNodeBehavior(window->GetID(str_id), flags, label, label_end);
}
bool ImGui::TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char* fmt, va_list args)
@@ -5772,12 +5895,19 @@ bool ImGui::TreeNodeExV(const void* ptr_id, ImGuiTreeNodeFlags flags, const char
if (window->SkipItems)
return false;
+ const char* label, *label_end;
+ ImFormatStringToTempBufferV(&label, &label_end, fmt, args);
+ return TreeNodeBehavior(window->GetID(ptr_id), flags, label, label_end);
+}
+
+void ImGui::TreeNodeSetOpen(ImGuiID id, bool open)
+{
ImGuiContext& g = *GImGui;
- const char* label_end = g.TempBuffer + ImFormatStringV(g.TempBuffer, IM_ARRAYSIZE(g.TempBuffer), fmt, args);
- return TreeNodeBehavior(window->GetID(ptr_id), flags, g.TempBuffer, label_end);
+ ImGuiStorage* storage = g.CurrentWindow->DC.StateStorage;
+ storage->SetInt(id, open ? 1 : 0);
}
-bool ImGui::TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags)
+bool ImGui::TreeNodeUpdateNextOpen(ImGuiID id, ImGuiTreeNodeFlags flags)
{
if (flags & ImGuiTreeNodeFlags_Leaf)
return true;
@@ -5793,7 +5923,7 @@ bool ImGui::TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags)
if (g.NextItemData.OpenCond & ImGuiCond_Always)
{
is_open = g.NextItemData.OpenVal;
- storage->SetInt(id, is_open);
+ TreeNodeSetOpen(id, is_open);
}
else
{
@@ -5802,7 +5932,7 @@ bool ImGui::TreeNodeBehaviorIsOpen(ImGuiID id, ImGuiTreeNodeFlags flags)
if (stored_value == -1)
{
is_open = g.NextItemData.OpenVal;
- storage->SetInt(id, is_open);
+ TreeNodeSetOpen(id, is_open);
}
else
{
@@ -5868,7 +5998,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
// For this purpose we essentially compare if g.NavIdIsAlive went from 0 to 1 between TreeNode() and TreePop().
// This is currently only support 32 level deep and we are fine with (1 << Depth) overflowing into a zero.
const bool is_leaf = (flags & ImGuiTreeNodeFlags_Leaf) != 0;
- bool is_open = TreeNodeBehaviorIsOpen(id, flags);
+ bool is_open = TreeNodeUpdateNextOpen(id, flags);
if (is_open && !g.NavIdIsAlive && (flags & ImGuiTreeNodeFlags_NavLeftJumpsBackHere) && !(flags & ImGuiTreeNodeFlags_NoTreePushOnOpen))
window->DC.TreeJumpToParentOnPopMask |= (1 << window->DC.TreeDepth);
@@ -5929,7 +6059,7 @@ bool ImGui::TreeNodeBehavior(ImGuiID id, ImGuiTreeNodeFlags flags, const char* l
toggled = true;
if (flags & ImGuiTreeNodeFlags_OpenOnArrow)
toggled |= is_mouse_x_over_arrow && !g.NavDisableMouseHover; // Lightweight equivalent of IsMouseHoveringRect() since ButtonBehavior() already did the job
- if ((flags & ImGuiTreeNodeFlags_OpenOnDoubleClick) && g.IO.MouseDoubleClicked[0])
+ if ((flags & ImGuiTreeNodeFlags_OpenOnDoubleClick) && g.IO.MouseClickedCount[0] == 2)
toggled = true;
}
else if (pressed && g.DragDropHoldJustPressedId == id)
@@ -6032,7 +6162,7 @@ void ImGui::TreePushOverrideID(ImGuiID id)
ImGuiWindow* window = g.CurrentWindow;
Indent();
window->DC.TreeDepth++;
- window->IDStack.push_back(id);
+ PushOverrideID(id);
}
void ImGui::TreePop()
@@ -6211,6 +6341,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
// We use NoHoldingActiveID on menus so user can click and _hold_ on a menu then drag to browse child entries
ImGuiButtonFlags button_flags = 0;
if (flags & ImGuiSelectableFlags_NoHoldingActiveID) { button_flags |= ImGuiButtonFlags_NoHoldingActiveId; }
+ if (flags & ImGuiSelectableFlags_NoSetKeyOwner) { button_flags |= ImGuiButtonFlags_NoSetKeyOwner; }
if (flags & ImGuiSelectableFlags_SelectOnClick) { button_flags |= ImGuiButtonFlags_PressedOnClick; }
if (flags & ImGuiSelectableFlags_SelectOnRelease) { button_flags |= ImGuiButtonFlags_PressedOnRelease; }
if (flags & ImGuiSelectableFlags_AllowDoubleClick) { button_flags |= ImGuiButtonFlags_PressedOnClickRelease | ImGuiButtonFlags_PressedOnDoubleClick; }
@@ -6227,7 +6358,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
// - (1) it would require focus scope to be set, need exposing PushFocusScope() or equivalent (e.g. BeginSelection() calling PushFocusScope())
// - (2) usage will fail with clipped items
// The multi-select API aim to fix those issues, e.g. may be replaced with a BeginSelection() API.
- if ((flags & ImGuiSelectableFlags_SelectOnNav) && g.NavJustMovedToId != 0 && g.NavJustMovedToFocusScopeId == window->DC.NavFocusScopeIdCurrent)
+ if ((flags & ImGuiSelectableFlags_SelectOnNav) && g.NavJustMovedToId != 0 && g.NavJustMovedToFocusScopeId == g.CurrentFocusScopeId)
if (g.NavJustMovedToId == id)
selected = pressed = true;
@@ -6236,7 +6367,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
{
if (!g.NavDisableMouseHover && g.NavWindow == window && g.NavLayer == window->DC.NavLayerCurrent)
{
- SetNavID(id, window->DC.NavLayerCurrent, window->DC.NavFocusScopeIdCurrent, ImRect(bb.Min - window->Pos, bb.Max - window->Pos)); // (bb == NavRect)
+ SetNavID(id, window->DC.NavLayerCurrent, g.CurrentFocusScopeId, WindowRectAbsToRel(window, bb)); // (bb == NavRect)
g.NavDisableHighlight = true;
}
}
@@ -6701,6 +6832,7 @@ bool ImGui::BeginMenuBar()
// We overwrite CursorMaxPos because BeginGroup sets it to CursorPos (essentially the .EmitItem hack in EndMenuBar() would need something analogous here, maybe a BeginGroupEx() with flags).
window->DC.CursorPos = window->DC.CursorMaxPos = ImVec2(bar_rect.Min.x + window->DC.MenuBarOffset.x, bar_rect.Min.y + window->DC.MenuBarOffset.y);
window->DC.LayoutType = ImGuiLayoutType_Horizontal;
+ window->DC.IsSameLine = false;
window->DC.NavLayerCurrent = ImGuiNavLayer_Menu;
window->DC.MenuBarAppending = true;
AlignTextToFramePadding();
@@ -6726,12 +6858,12 @@ void ImGui::EndMenuBar()
// To do so we claim focus back, restore NavId and then process the movement request for yet another frame.
// This involve a one-frame delay which isn't very problematic in this situation. We could remove it by scoring in advance for multiple window (probably not worth bothering)
const ImGuiNavLayer layer = ImGuiNavLayer_Menu;
- IM_ASSERT(window->DC.NavLayersActiveMaskNext & (1 << layer)); // Sanity check
+ IM_ASSERT(window->DC.NavLayersActiveMaskNext & (1 << layer)); // Sanity check (FIXME: Seems unnecessary)
FocusWindow(window);
SetNavID(window->NavLastIds[layer], layer, 0, window->NavRectRel[layer]);
g.NavDisableHighlight = true; // Hide highlight for the current frame so we don't see the intermediary selection.
g.NavDisableMouseHover = g.NavMousePosDirty = true;
- NavMoveRequestForward(g.NavMoveDir, g.NavMoveClipDir, g.NavMoveFlags); // Repeat
+ NavMoveRequestForward(g.NavMoveDir, g.NavMoveClipDir, g.NavMoveFlags, g.NavMoveScrollFlags); // Repeat
}
}
@@ -6744,6 +6876,7 @@ void ImGui::EndMenuBar()
g.GroupStack.back().EmitItem = false;
EndGroup(); // Restore position on layer 0
window->DC.LayoutType = ImGuiLayoutType_Vertical;
+ window->DC.IsSameLine = false;
window->DC.NavLayerCurrent = ImGuiNavLayer_Main;
window->DC.MenuBarAppending = false;
}
@@ -6820,6 +6953,28 @@ void ImGui::EndMainMenuBar()
End();
}
+static bool IsRootOfOpenMenuSet()
+{
+ ImGuiContext& g = *GImGui;
+ ImGuiWindow* window = g.CurrentWindow;
+ if ((g.OpenPopupStack.Size <= g.BeginPopupStack.Size) || (window->Flags & ImGuiWindowFlags_ChildMenu))
+ return false;
+
+ // 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.
+ // 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.
+ // 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.
+ // This fixes the most common case of menu opening on hover when moving between window content and menu bar. Multiple different menu sets in same nav layer would still
+ // 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));
+}
+
bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
{
ImGuiWindow* window = GetCurrentWindow();
@@ -6832,9 +6987,10 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
bool menu_is_open = IsPopupOpen(id, ImGuiPopupFlags_None);
// Sub-menus are ChildWindow so that mouse can be hovering across them (otherwise top-most popup menu would steal focus and not allow hovering on parent menu)
- ImGuiWindowFlags flags = ImGuiWindowFlags_ChildMenu | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoNavFocus;
- if (window->Flags & (ImGuiWindowFlags_Popup | ImGuiWindowFlags_ChildMenu))
- flags |= ImGuiWindowFlags_ChildWindow;
+ // The first menu in a hierarchy isn't so hovering doesn't get across (otherwise e.g. resizing borders with ImGuiButtonFlags_FlattenChildren would react), but top-most BeginMenu() will bypass that limitation.
+ ImGuiWindowFlags window_flags = ImGuiWindowFlags_ChildMenu | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoNavFocus;
+ if (window->Flags & ImGuiWindowFlags_ChildMenu)
+ window_flags |= ImGuiWindowFlags_ChildWindow;
// If a menu with same the ID was already submitted, we will append to it, matching the behavior of Begin().
// We are relying on a O(N) search - so O(N log N) over the frame - which seems like the most efficient for the expected small amount of BeginMenu() calls per frame.
@@ -6842,7 +6998,7 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
if (g.MenusIdSubmittedThisFrame.contains(id))
{
if (menu_is_open)
- menu_is_open = BeginPopupEx(id, flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
+ menu_is_open = BeginPopupEx(id, window_flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
else
g.NextWindowData.ClearFlags(); // we behave like Begin() and need to consume those values
return menu_is_open;
@@ -6852,11 +7008,12 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
g.MenusIdSubmittedThisFrame.push_back(id);
ImVec2 label_size = CalcTextSize(label, NULL, true);
- bool pressed;
- bool menuset_is_open = !(window->Flags & ImGuiWindowFlags_Popup) && (g.OpenPopupStack.Size > g.BeginPopupStack.Size && g.OpenPopupStack[g.BeginPopupStack.Size].OpenParentId == window->IDStack.back());
- ImGuiWindow* backed_nav_window = g.NavWindow;
+
+ // Odd hack to allow hovering across menus of a same menu-set (otherwise we wouldn't be able to hover parent without always being a Child window)
+ // This is only done for items for the menu set and not the full parent window.
+ const bool menuset_is_open = IsRootOfOpenMenuSet();
if (menuset_is_open)
- g.NavWindow = window; // Odd hack to allow hovering across menus of a same menu-set (otherwise we wouldn't be able to hover parent)
+ PushItemFlag(ImGuiItemFlags_NoWindowHoverableCheck, true);
// The reference position stored in popup_pos will be used by Begin() to find a suitable position for the child menu,
// However the final position is going to be different! It is chosen by FindBestWindowPosForPopup().
@@ -6866,6 +7023,10 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
if (!enabled)
BeginDisabled();
const ImGuiMenuColumns* offsets = &window->DC.MenuColumns;
+ bool pressed;
+
+ // We use ImGuiSelectableFlags_NoSetKeyOwner to allow down on one menu item, move, up on another.
+ const ImGuiSelectableFlags selectable_flags = ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_NoSetKeyOwner | ImGuiSelectableFlags_SelectOnClick | ImGuiSelectableFlags_DontClosePopups;
if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
{
// Menu inside an horizontal menu bar
@@ -6876,7 +7037,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, ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_SelectOnClick | ImGuiSelectableFlags_DontClosePopups, ImVec2(w, 0.0f));
+ pressed = Selectable("", menu_is_open, selectable_flags, ImVec2(w, 0.0f));
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().
@@ -6892,7 +7053,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, ImGuiSelectableFlags_NoHoldingActiveID | ImGuiSelectableFlags_SelectOnClick | ImGuiSelectableFlags_DontClosePopups | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, 0.0f));
+ pressed = Selectable("", menu_is_open, selectable_flags | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, 0.0f));
RenderText(text_pos, label);
if (icon_w > 0.0f)
RenderText(pos + ImVec2(offsets->OffsetIcon, 0.0f), icon);
@@ -6901,9 +7062,9 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
if (!enabled)
EndDisabled();
- const bool hovered = (g.HoveredId == id) && enabled;
+ const bool hovered = (g.HoveredId == id) && enabled && !g.NavDisableMouseHover;
if (menuset_is_open)
- g.NavWindow = backed_nav_window;
+ PopItemFlag();
bool want_open = false;
bool want_close = false;
@@ -6911,29 +7072,37 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
{
// Close menu when not hovering it anymore unless we are moving roughly in the direction of the menu
// Implement http://bjk5.com/post/44698559168/breaking-down-amazons-mega-dropdown to avoid using timers, so menus feels more reactive.
- bool moving_toward_other_child_menu = false;
- ImGuiWindow* child_menu_window = (g.BeginPopupStack.Size < g.OpenPopupStack.Size && g.OpenPopupStack[g.BeginPopupStack.Size].SourceWindow == window) ? g.OpenPopupStack[g.BeginPopupStack.Size].Window : NULL;
- if (g.HoveredWindow == window && child_menu_window != NULL && !(window->Flags & ImGuiWindowFlags_MenuBar))
+ bool moving_toward_child_menu = false;
+ ImGuiPopupData* child_popup = (g.BeginPopupStack.Size < g.OpenPopupStack.Size) ? &g.OpenPopupStack[g.BeginPopupStack.Size] : NULL; // Popup candidate (testing below)
+ ImGuiWindow* child_menu_window = (child_popup && child_popup->Window && child_popup->Window->ParentWindow == window) ? child_popup->Window : NULL;
+ if (g.HoveredWindow == window && child_menu_window != NULL)
{
float ref_unit = g.FontSize; // FIXME-DPI
+ float child_dir = (window->Pos.x < child_menu_window->Pos.x) ? 1.0f : -1.0f;
ImRect next_window_rect = child_menu_window->Rect();
ImVec2 ta = (g.IO.MousePos - g.IO.MouseDelta);
- ImVec2 tb = (window->Pos.x < child_menu_window->Pos.x) ? next_window_rect.GetTL() : next_window_rect.GetTR();
- ImVec2 tc = (window->Pos.x < child_menu_window->Pos.x) ? next_window_rect.GetBL() : next_window_rect.GetBR();
+ ImVec2 tb = (child_dir > 0.0f) ? next_window_rect.GetTL() : next_window_rect.GetTR();
+ ImVec2 tc = (child_dir > 0.0f) ? next_window_rect.GetBL() : next_window_rect.GetBR();
float extra = ImClamp(ImFabs(ta.x - tb.x) * 0.30f, ref_unit * 0.5f, ref_unit * 2.5f); // add a bit of extra slack.
- ta.x += (window->Pos.x < child_menu_window->Pos.x) ? -0.5f : +0.5f; // to avoid numerical issues (FIXME: ??)
- tb.y = ta.y + ImMax((tb.y - extra) - ta.y, -ref_unit * 8.0f); // triangle is maximum 200 high to limit the slope and the bias toward large sub-menus // FIXME: Multiply by fb_scale?
+ ta.x += child_dir * -0.5f;
+ tb.x += child_dir * ref_unit;
+ tc.x += child_dir * ref_unit;
+ tb.y = ta.y + ImMax((tb.y - extra) - ta.y, -ref_unit * 8.0f); // triangle has maximum height to limit the slope and the bias toward large sub-menus
tc.y = ta.y + ImMin((tc.y + extra) - ta.y, +ref_unit * 8.0f);
- moving_toward_other_child_menu = ImTriangleContainsPoint(ta, tb, tc, g.IO.MousePos);
- //GetForegroundDrawList()->AddTriangleFilled(ta, tb, tc, moving_toward_other_child_menu ? IM_COL32(0,128,0,128) : IM_COL32(128,0,0,128)); // [DEBUG]
+ moving_toward_child_menu = ImTriangleContainsPoint(ta, tb, tc, g.IO.MousePos);
+ //GetForegroundDrawList()->AddTriangleFilled(ta, tb, tc, moving_toward_child_menu ? IM_COL32(0,128,0,128) : IM_COL32(128,0,0,128)); // [DEBUG]
}
- if (menu_is_open && !hovered && g.HoveredWindow == window && g.HoveredIdPreviousFrame != 0 && g.HoveredIdPreviousFrame != id && !moving_toward_other_child_menu)
+
+ // The 'HovereWindow == window' check creates an inconsistency (e.g. moving away from menu slowly tends to hit same window, whereas moving away fast does not)
+ // But we also need to not close the top-menu menu when moving over void. Perhaps we should extend the triangle check to a larger polygon.
+ // (Remember to test this on BeginPopup("A")->BeginMenu("B") sequence which behaves slightly differently as B isn't a Child of A and hovering isn't shared.)
+ if (menu_is_open && !hovered && g.HoveredWindow == window && !moving_toward_child_menu && !g.NavDisableMouseHover)
want_close = true;
// Open
if (!menu_is_open && pressed) // Click/activate to open
want_open = true;
- else if (!menu_is_open && hovered && !moving_toward_other_child_menu) // Hover to open
+ else if (!menu_is_open && hovered && !moving_toward_child_menu) // Hover to open
want_open = true;
if (g.NavId == id && g.NavMoveDir == ImGuiDir_Right) // Nav-Right to open
{
@@ -6968,21 +7137,32 @@ bool ImGui::BeginMenuEx(const char* label, const char* icon, bool enabled)
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Openable | (menu_is_open ? ImGuiItemStatusFlags_Opened : 0));
PopID();
- if (!menu_is_open && want_open && g.OpenPopupStack.Size > g.BeginPopupStack.Size)
+ if (want_open && !menu_is_open && g.OpenPopupStack.Size > g.BeginPopupStack.Size)
{
- // Don't recycle same menu level in the same frame, first close the other menu and yield for a frame.
+ // Don't reopen/recycle same menu level in the same frame, first close the other menu and yield for a frame.
OpenPopup(label);
- return false;
}
-
- menu_is_open |= want_open;
- if (want_open)
+ else if (want_open)
+ {
+ menu_is_open = true;
OpenPopup(label);
+ }
if (menu_is_open)
{
- SetNextWindowPos(popup_pos, ImGuiCond_Always); // Note: this is super misleading! The value will serve as reference for FindBestWindowPosForPopup(), not actual pos.
- menu_is_open = BeginPopupEx(id, flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
+ ImGuiLastItemData last_item_in_parent = g.LastItemData;
+ SetNextWindowPos(popup_pos, ImGuiCond_Always); // Note: misleading: the value will serve as reference for FindBestWindowPosForPopup(), not actual pos.
+ PushStyleVar(ImGuiStyleVar_ChildRounding, style.PopupRounding); // First level will use _PopupRounding, subsequent will use _ChildRounding
+ menu_is_open = BeginPopupEx(id, window_flags); // menu_is_open can be 'false' when the popup is completely clipped (e.g. zero size display)
+ PopStyleVar();
+ if (menu_is_open)
+ {
+ // Restore LastItemData so IsItemXXXX functions can work after BeginMenu()/EndMenu()
+ // (This fixes using IsItemClicked() and IsItemHovered(), but IsItemHovered() also relies on its support for ImGuiItemFlags_NoWindowHoverableCheck)
+ g.LastItemData = last_item_in_parent;
+ if (g.HoveredWindow == window)
+ g.LastItemData.StatusFlags |= ImGuiItemStatusFlags_HoveredWindow;
+ }
}
else
{
@@ -6999,17 +7179,18 @@ bool ImGui::BeginMenu(const char* label, bool enabled)
void ImGui::EndMenu()
{
- // Nav: When a left move request _within our child menu_ failed, close ourselves (the _parent_ menu).
- // A menu doesn't close itself because EndMenuBar() wants the catch the last Left<>Right inputs.
- // However, it means that with the current code, a BeginMenu() from outside another menu or a menu-bar won't be closable with the Left direction.
+ // Nav: When a left move request our menu failed, close ourselves.
ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
- if (g.NavMoveDir == ImGuiDir_Left && NavMoveRequestButNoResultYet() && window->DC.LayoutType == ImGuiLayoutType_Vertical)
- if (g.NavWindow && (g.NavWindow->RootWindowForNav->Flags & ImGuiWindowFlags_Popup) && g.NavWindow->RootWindowForNav->ParentWindow == window)
- {
- ClosePopupToLevel(g.BeginPopupStack.Size, true);
- NavMoveRequestCancel();
- }
+ IM_ASSERT(window->Flags & ImGuiWindowFlags_Popup); // Mismatched BeginMenu()/EndMenu() calls
+ ImGuiWindow* parent_window = window->ParentWindow; // Should always be != NULL is we passed assert.
+ if (window->BeginCount == window->BeginCountPreviousFrame)
+ if (g.NavMoveDir == ImGuiDir_Left && NavMoveRequestButNoResultYet())
+ if (g.NavWindow && (g.NavWindow->RootWindowForNav == window) && parent_window->DC.LayoutType == ImGuiLayoutType_Vertical)
+ {
+ ClosePopupToLevel(g.BeginPopupStack.Size - 1, true);
+ NavMoveRequestCancel();
+ }
EndPopup();
}
@@ -7025,13 +7206,20 @@ bool ImGui::MenuItemEx(const char* label, const char* icon, const char* shortcut
ImVec2 pos = window->DC.CursorPos;
ImVec2 label_size = CalcTextSize(label, NULL, true);
+ // See BeginMenuEx() for comments about this.
+ const bool menuset_is_open = IsRootOfOpenMenuSet();
+ if (menuset_is_open)
+ PushItemFlag(ImGuiItemFlags_NoWindowHoverableCheck, true);
+
// We've been using the equivalent of ImGuiSelectableFlags_SetNavIdOnHover on all Selectable() since early Nav system days (commit 43ee5d73),
// but I am unsure whether this should be kept at all. For now moved it to be an opt-in feature used by menus only.
bool pressed;
PushID(label);
if (!enabled)
BeginDisabled();
- const ImGuiSelectableFlags flags = ImGuiSelectableFlags_SelectOnRelease | ImGuiSelectableFlags_SetNavIdOnHover;
+
+ // We use ImGuiSelectableFlags_NoSetKeyOwner to allow down on one menu item, move, up on another.
+ const ImGuiSelectableFlags selectable_flags = ImGuiSelectableFlags_SelectOnRelease | ImGuiSelectableFlags_NoSetKeyOwner | ImGuiSelectableFlags_SetNavIdOnHover;
const ImGuiMenuColumns* offsets = &window->DC.MenuColumns;
if (window->DC.LayoutType == ImGuiLayoutType_Horizontal)
{
@@ -7041,9 +7229,10 @@ bool ImGui::MenuItemEx(const char* label, const char* icon, const char* shortcut
window->DC.CursorPos.x += IM_FLOOR(style.ItemSpacing.x * 0.5f);
ImVec2 text_pos(window->DC.CursorPos.x + offsets->OffsetLabel, window->DC.CursorPos.y + window->DC.CurrLineTextBaseOffset);
PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(style.ItemSpacing.x * 2.0f, style.ItemSpacing.y));
- pressed = Selectable("", selected, flags, ImVec2(w, 0.0f));
+ pressed = Selectable("", selected, selectable_flags, ImVec2(w, 0.0f));
PopStyleVar();
- RenderText(text_pos, label);
+ if (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Visible)
+ RenderText(text_pos, label);
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().
}
else
@@ -7056,23 +7245,28 @@ 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, flags | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, 0.0f));
- RenderText(pos + ImVec2(offsets->OffsetLabel, 0.0f), label);
- if (icon_w > 0.0f)
- RenderText(pos + ImVec2(offsets->OffsetIcon, 0.0f), icon);
- if (shortcut_w > 0.0f)
+ pressed = Selectable("", false, selectable_flags | ImGuiSelectableFlags_SpanAvailWidth, ImVec2(min_w, 0.0f));
+ if (g.LastItemData.StatusFlags & ImGuiItemStatusFlags_Visible)
{
- PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]);
- RenderText(pos + ImVec2(offsets->OffsetShortcut + stretch_w, 0.0f), shortcut, NULL, false);
- PopStyleColor();
+ RenderText(pos + ImVec2(offsets->OffsetLabel, 0.0f), label);
+ if (icon_w > 0.0f)
+ RenderText(pos + ImVec2(offsets->OffsetIcon, 0.0f), icon);
+ if (shortcut_w > 0.0f)
+ {
+ PushStyleColor(ImGuiCol_Text, style.Colors[ImGuiCol_TextDisabled]);
+ RenderText(pos + ImVec2(offsets->OffsetShortcut + stretch_w, 0.0f), shortcut, NULL, false);
+ PopStyleColor();
+ }
+ if (selected)
+ RenderCheckMark(window->DrawList, pos + ImVec2(offsets->OffsetMark + stretch_w + g.FontSize * 0.40f, g.FontSize * 0.134f * 0.5f), GetColorU32(ImGuiCol_Text), g.FontSize * 0.866f);
}
- if (selected)
- RenderCheckMark(window->DrawList, pos + ImVec2(offsets->OffsetMark + stretch_w + g.FontSize * 0.40f, g.FontSize * 0.134f * 0.5f), GetColorU32(ImGuiCol_Text), g.FontSize * 0.866f);
}
IMGUI_TEST_ENGINE_ITEM_INFO(g.LastItemData.ID, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (selected ? ImGuiItemStatusFlags_Checked : 0));
if (!enabled)
EndDisabled();
PopID();
+ if (menuset_is_open)
+ PopItemFlag();
return pressed;
}
@@ -7215,8 +7409,7 @@ bool ImGui::BeginTabBarEx(ImGuiTabBar* tab_bar, const ImRect& tab_bar_bb, ImG
// Ensure correct ordering when toggling ImGuiTabBarFlags_Reorderable flag, or when a new tab was added while being not reorderable
if ((flags & ImGuiTabBarFlags_Reorderable) != (tab_bar->Flags & ImGuiTabBarFlags_Reorderable) || (tab_bar->TabsAddedNew && !(flags & ImGuiTabBarFlags_Reorderable)))
- if (tab_bar->Tabs.Size > 1)
- ImQsort(tab_bar->Tabs.Data, tab_bar->Tabs.Size, sizeof(ImGuiTabItem), TabItemComparerByBeginOrder);
+ ImQsort(tab_bar->Tabs.Data, tab_bar->Tabs.Size, sizeof(ImGuiTabItem), TabItemComparerByBeginOrder);
tab_bar->TabsAddedNew = false;
// Flags
@@ -7391,8 +7584,8 @@ static void ImGui::TabBarLayout(ImGuiTabBar* 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 bool has_close_button = (tab->Flags & ImGuiTabItemFlags_NoCloseButton) ? false : true;
- tab->ContentWidth = TabItemCalcSize(tab_name, has_close_button).x;
+ 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;
int section_n = TabItemGetSectionIdx(tab);
ImGuiTabBarSection* section = &sections[section_n];
@@ -7401,12 +7594,10 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
// Store data so we can build an array sorted by width if we need to shrink tabs down
IM_MSVC_WARNING_SUPPRESS(6385);
- int shrink_buffer_index = shrink_buffer_indexes[section_n]++;
- g.ShrinkWidthBuffer[shrink_buffer_index].Index = tab_n;
- g.ShrinkWidthBuffer[shrink_buffer_index].Width = tab->ContentWidth;
-
- IM_ASSERT(tab->ContentWidth > 0.0f);
- tab->Width = tab->ContentWidth;
+ ImGuiShrinkWidthItem* shrink_width_item = &g.ShrinkWidthBuffer[shrink_buffer_indexes[section_n]++];
+ shrink_width_item->Index = tab_n;
+ shrink_width_item->Width = shrink_width_item->InitialWidth = tab->ContentWidth;
+ tab->Width = ImMax(tab->ContentWidth, 1.0f);
}
// Compute total ideal width (used for e.g. auto-resizing a window)
@@ -7436,7 +7627,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
width_excess = (section_0_w + section_2_w) - tab_bar->BarRect.GetWidth(); // Excess used to shrink leading/trailing section
// With ImGuiTabBarFlags_FittingPolicyScroll policy, we will only shrink leading/trailing if the central section is not visible anymore
- if (width_excess > 0.0f && ((tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyResizeDown) || !central_section_is_visible))
+ if (width_excess >= 1.0f && ((tab_bar->Flags & ImGuiTabBarFlags_FittingPolicyResizeDown) || !central_section_is_visible))
{
int shrink_data_count = (central_section_is_visible ? sections[1].TabCount : sections[0].TabCount + sections[2].TabCount);
int shrink_data_offset = (central_section_is_visible ? sections[0].TabCount + sections[2].TabCount : 0);
@@ -7450,6 +7641,7 @@ static void ImGui::TabBarLayout(ImGuiTabBar* tab_bar)
if (shrinked_width < 0.0f)
continue;
+ shrinked_width = ImMax(1.0f, shrinked_width);
int section_n = TabItemGetSectionIdx(tab);
sections[section_n].Width -= (tab->Width - shrinked_width);
tab->Width = shrinked_width;
@@ -7563,7 +7755,9 @@ void ImGui::TabBarRemoveTab(ImGuiTabBar* tab_bar, ImGuiID tab_id)
// Called on manual closure attempt
void ImGui::TabBarCloseTab(ImGuiTabBar* tab_bar, ImGuiTabItem* tab)
{
- IM_ASSERT(!(tab->Flags & ImGuiTabItemFlags_Button));
+ if (tab->Flags & ImGuiTabItemFlags_Button)
+ return; // A button appended with TabItemButton().
+
if (!(tab->Flags & ImGuiTabItemFlags_UnsavedDocument))
{
// This will remove a frame of lag for selecting another tab on closure.
@@ -7873,10 +8067,13 @@ bool ImGui::TabItemButton(const char* label, ImGuiTabItemFlags flags)
bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open, ImGuiTabItemFlags flags)
{
// Layout whole tab bar if not already done
+ ImGuiContext& g = *GImGui;
if (tab_bar->WantLayout)
+ {
+ ImGuiNextItemData backup_next_item_data = g.NextItemData;
TabBarLayout(tab_bar);
-
- ImGuiContext& g = *GImGui;
+ g.NextItemData = backup_next_item_data;
+ }
ImGuiWindow* window = g.CurrentWindow;
if (window->SkipItems)
return false;
@@ -7889,9 +8086,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags);
if (p_open && !*p_open)
{
- PushItemFlag(ImGuiItemFlags_NoNav | ImGuiItemFlags_NoNavDefaultFocus, true);
- ItemAdd(ImRect(), id);
- PopItemFlag();
+ ItemAdd(ImRect(), id, NULL, ImGuiItemFlags_NoNav);
return false;
}
@@ -7904,9 +8099,6 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
else if (p_open == NULL)
flags |= ImGuiTabItemFlags_NoCloseButton;
- // Calculate tab contents size
- ImVec2 size = TabItemCalcSize(label, p_open != NULL);
-
// Acquire tab data
ImGuiTabItem* tab = TabBarFindTabByID(tab_bar, id);
bool tab_is_new = false;
@@ -7915,17 +8107,24 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
tab_bar->Tabs.push_back(ImGuiTabItem());
tab = &tab_bar->Tabs.back();
tab->ID = id;
- tab->Width = size.x;
- tab_bar->TabsAddedNew = true;
- tab_is_new = true;
+ tab_bar->TabsAddedNew = tab_is_new = true;
}
tab_bar->LastTabItemIdx = (ImS16)tab_bar->Tabs.index_from_ptr(tab);
+
+ // Calculate tab contents size
+ ImVec2 size = TabItemCalcSize(label, (p_open != NULL) || (flags & ImGuiTabItemFlags_UnsavedDocument));
+ tab->RequestedWidth = -1.0f;
+ if (g.NextItemData.Flags & ImGuiNextItemDataFlags_HasWidth)
+ size.x = tab->RequestedWidth = g.NextItemData.Width;
+ if (tab_is_new)
+ tab->Width = ImMax(1.0f, size.x);
tab->ContentWidth = size.x;
tab->BeginOrder = tab_bar->TabsActiveCount++;
const bool tab_bar_appearing = (tab_bar->PrevFrameVisible + 1 < g.FrameCount);
const bool tab_bar_focused = (tab_bar->Flags & ImGuiTabBarFlags_IsFocused) != 0;
const bool tab_appearing = (tab->LastFrameVisible + 1 < g.FrameCount);
+ const bool tab_just_unsaved = (flags & ImGuiTabItemFlags_UnsavedDocument) && !(tab->Flags & ImGuiTabItemFlags_UnsavedDocument);
const bool is_tab_button = (flags & ImGuiTabItemFlags_Button) != 0;
tab->LastFrameVisible = g.FrameCount;
tab->Flags = flags;
@@ -7935,13 +8134,14 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
tab_bar->TabsNames.append(label, label + strlen(label) + 1);
// Update selected tab
- if (tab_appearing && (tab_bar->Flags & ImGuiTabBarFlags_AutoSelectNewTabs) && tab_bar->NextSelectedTabId == 0)
- if (!tab_bar_appearing || tab_bar->SelectedTabId == 0)
- if (!is_tab_button)
+ if (!is_tab_button)
+ {
+ 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
- if ((flags & ImGuiTabItemFlags_SetSelected) && (tab_bar->SelectedTabId != id)) // SetSelected can only be passed on explicit tab bar
- if (!is_tab_button)
+ if ((flags & ImGuiTabItemFlags_SetSelected) && (tab_bar->SelectedTabId != id)) // _SetSelected can only be passed on explicit tab bar
tab_bar->NextSelectedTabId = id;
+ }
// Lock visibility
// (Note: tab_contents_visible != tab_selected... because CTRL+TAB operations may preview some tabs without selecting them!)
@@ -7958,9 +8158,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
// and then gets submitted again, the tabs will have 'tab_appearing=true' but 'tab_is_new=false'.
if (tab_appearing && (!tab_bar_appearing || tab_is_new))
{
- PushItemFlag(ImGuiItemFlags_NoNav | ImGuiItemFlags_NoNavDefaultFocus, true);
- ItemAdd(ImRect(), id);
- PopItemFlag();
+ ItemAdd(ImRect(), id, NULL, ImGuiItemFlags_NoNav);
if (is_tab_button)
return false;
return tab_contents_visible;
@@ -8058,7 +8256,7 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
const ImGuiID close_button_id = p_open ? GetIDWithSeed("#CLOSE", NULL, id) : 0;
bool just_closed;
bool text_clipped;
- TabItemLabelAndCloseButton(display_draw_list, bb, flags, tab_bar->FramePadding, label, id, close_button_id, tab_contents_visible, &just_closed, &text_clipped);
+ TabItemLabelAndCloseButton(display_draw_list, bb, tab_just_unsaved ? (flags & ~ImGuiTabItemFlags_UnsavedDocument) : flags, tab_bar->FramePadding, label, id, close_button_id, tab_contents_visible, &just_closed, &text_clipped);
if (just_closed && p_open != NULL)
{
*p_open = false;
@@ -8075,9 +8273,10 @@ bool ImGui::TabItemEx(ImGuiTabBar* tab_bar, const char* label, bool* p_open,
// (We test IsItemHovered() to discard e.g. when another item is active or drag and drop over the tab bar, which g.HoveredId ignores)
// FIXME: This is a mess.
// FIXME: We may want disabled tab to still display the tooltip?
- if (text_clipped && g.HoveredId == id && !held && g.HoveredIdNotActiveTimer > g.TooltipSlowDelay && IsItemHovered())
+ if (text_clipped && g.HoveredId == id && !held)
if (!(tab_bar->Flags & ImGuiTabBarFlags_NoTooltip) && !(tab->Flags & ImGuiTabItemFlags_NoTooltip))
- SetTooltip("%.*s", (int)(FindRenderedTextEnd(label) - label), label);
+ if (IsItemHovered(ImGuiHoveredFlags_DelayNormal))
+ SetTooltip("%.*s", (int)(FindRenderedTextEnd(label) - label), label);
IM_ASSERT(!is_tab_button || !(tab_bar->SelectedTabId == tab->ID && is_tab_button)); // TabItemButton should not be selected
if (is_tab_button)
@@ -8101,12 +8300,12 @@ void ImGui::SetTabItemClosed(const char* label)
}
}
-ImVec2 ImGui::TabItemCalcSize(const char* label, bool has_close_button)
+ImVec2 ImGui::TabItemCalcSize(const char* label, bool has_close_button_or_unsaved_marker)
{
ImGuiContext& g = *GImGui;
ImVec2 label_size = CalcTextSize(label, NULL, true);
ImVec2 size = ImVec2(label_size.x + g.Style.FramePadding.x, label_size.y + g.Style.FramePadding.y * 2.0f);
- if (has_close_button)
+ if (has_close_button_or_unsaved_marker)
size.x += g.Style.FramePadding.x + (g.Style.ItemInnerSpacing.x + g.FontSize); // We use Y intentionally to fit the close button circle.
else
size.x += g.Style.FramePadding.x + 1.0f;
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.h b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.h
index 718d1b45603..8859c61bba1 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.h
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.h
@@ -1,20 +1,20 @@
// https://github.com/CedricGuillemet/ImGuizmo
-// v 1.61 WIP
+// v 1.84 WIP
//
// The MIT License(MIT)
-//
-// Copyright(c) 2016 Cedric Guillemet
-//
+//
+// Copyright(c) 2021 Cedric Guillemet
+//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
// copies of the Software, and to permit persons to whom the Software is
// 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 Software.
-//
+//
// THE SOFTWARE IS 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
@@ -24,7 +24,8 @@
// SOFTWARE.
//
// -------------------------------------------------------------------------------------------
-// History :
+// History :
+// 2019/11/03 View gizmo
// 2016/09/11 Behind camera culling. Scaling Delta matrix not multiplied by source matrix scales. local/world rotation and translation fixed. Display message is incorrect (X: ... Y:...) in local mode.
// 2016/09/09 Hatched negative axis. Snapping. Documentation update.
// 2016/09/04 Axis switch and translation plan autohiding. Scale transform stability improved
@@ -44,123 +45,179 @@
#if 0
void EditTransform(const Camera& camera, matrix_t& matrix)
{
- static ImGuizmo::OPERATION mCurrentGizmoOperation(ImGuizmo::ROTATE);
- static ImGuizmo::MODE mCurrentGizmoMode(ImGuizmo::WORLD);
- if (ImGui::IsKeyPressed(90))
- mCurrentGizmoOperation = ImGuizmo::TRANSLATE;
- if (ImGui::IsKeyPressed(69))
- mCurrentGizmoOperation = ImGuizmo::ROTATE;
- if (ImGui::IsKeyPressed(82)) // r Key
- mCurrentGizmoOperation = ImGuizmo::SCALE;
- if (ImGui::RadioButton("Translate", mCurrentGizmoOperation == ImGuizmo::TRANSLATE))
- mCurrentGizmoOperation = ImGuizmo::TRANSLATE;
- ImGui::SameLine();
- if (ImGui::RadioButton("Rotate", mCurrentGizmoOperation == ImGuizmo::ROTATE))
- mCurrentGizmoOperation = ImGuizmo::ROTATE;
- ImGui::SameLine();
- if (ImGui::RadioButton("Scale", mCurrentGizmoOperation == ImGuizmo::SCALE))
- mCurrentGizmoOperation = ImGuizmo::SCALE;
- float matrixTranslation[3], matrixRotation[3], matrixScale[3];
- ImGuizmo::DecomposeMatrixToComponents(matrix.m16, matrixTranslation, matrixRotation, matrixScale);
- ImGui::InputFloat3("Tr", matrixTranslation, 3);
- ImGui::InputFloat3("Rt", matrixRotation, 3);
- ImGui::InputFloat3("Sc", matrixScale, 3);
- ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, matrix.m16);
-
- if (mCurrentGizmoOperation != ImGuizmo::SCALE)
- {
- if (ImGui::RadioButton("Local", mCurrentGizmoMode == ImGuizmo::LOCAL))
- mCurrentGizmoMode = ImGuizmo::LOCAL;
- ImGui::SameLine();
- if (ImGui::RadioButton("World", mCurrentGizmoMode == ImGuizmo::WORLD))
- mCurrentGizmoMode = ImGuizmo::WORLD;
- }
- static bool useSnap(false);
- if (ImGui::IsKeyPressed(83))
- useSnap = !useSnap;
- ImGui::Checkbox("", &useSnap);
- ImGui::SameLine();
- vec_t snap;
- switch (mCurrentGizmoOperation)
- {
- case ImGuizmo::TRANSLATE:
- snap = config.mSnapTranslation;
- ImGui::InputFloat3("Snap", &snap.x);
- break;
- case ImGuizmo::ROTATE:
- snap = config.mSnapRotation;
- ImGui::InputFloat("Angle Snap", &snap.x);
- break;
- case ImGuizmo::SCALE:
- snap = config.mSnapScale;
- ImGui::InputFloat("Scale Snap", &snap.x);
- break;
- }
- ImGuiIO& io = ImGui::GetIO();
- ImGuizmo::SetRect(0, 0, io.DisplaySize.x, io.DisplaySize.y);
- ImGuizmo::Manipulate(camera.mView.m16, camera.mProjection.m16, mCurrentGizmoOperation, mCurrentGizmoMode, matrix.m16, NULL, useSnap ? &snap.x : NULL);
+ static ImGuizmo::OPERATION mCurrentGizmoOperation(ImGuizmo::ROTATE);
+ static ImGuizmo::MODE mCurrentGizmoMode(ImGuizmo::WORLD);
+ if (ImGui::IsKeyPressed(90))
+ mCurrentGizmoOperation = ImGuizmo::TRANSLATE;
+ if (ImGui::IsKeyPressed(69))
+ mCurrentGizmoOperation = ImGuizmo::ROTATE;
+ if (ImGui::IsKeyPressed(82)) // r Key
+ mCurrentGizmoOperation = ImGuizmo::SCALE;
+ if (ImGui::RadioButton("Translate", mCurrentGizmoOperation == ImGuizmo::TRANSLATE))
+ mCurrentGizmoOperation = ImGuizmo::TRANSLATE;
+ ImGui::SameLine();
+ if (ImGui::RadioButton("Rotate", mCurrentGizmoOperation == ImGuizmo::ROTATE))
+ mCurrentGizmoOperation = ImGuizmo::ROTATE;
+ ImGui::SameLine();
+ if (ImGui::RadioButton("Scale", mCurrentGizmoOperation == ImGuizmo::SCALE))
+ mCurrentGizmoOperation = ImGuizmo::SCALE;
+ float matrixTranslation[3], matrixRotation[3], matrixScale[3];
+ ImGuizmo::DecomposeMatrixToComponents(matrix.m16, matrixTranslation, matrixRotation, matrixScale);
+ ImGui::InputFloat3("Tr", matrixTranslation, 3);
+ ImGui::InputFloat3("Rt", matrixRotation, 3);
+ ImGui::InputFloat3("Sc", matrixScale, 3);
+ ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, matrix.m16);
+
+ if (mCurrentGizmoOperation != ImGuizmo::SCALE)
+ {
+ if (ImGui::RadioButton("Local", mCurrentGizmoMode == ImGuizmo::LOCAL))
+ mCurrentGizmoMode = ImGuizmo::LOCAL;
+ ImGui::SameLine();
+ if (ImGui::RadioButton("World", mCurrentGizmoMode == ImGuizmo::WORLD))
+ mCurrentGizmoMode = ImGuizmo::WORLD;
+ }
+ static bool useSnap(false);
+ if (ImGui::IsKeyPressed(83))
+ useSnap = !useSnap;
+ ImGui::Checkbox("", &useSnap);
+ ImGui::SameLine();
+ vec_t snap;
+ switch (mCurrentGizmoOperation)
+ {
+ case ImGuizmo::TRANSLATE:
+ snap = config.mSnapTranslation;
+ ImGui::InputFloat3("Snap", &snap.x);
+ break;
+ case ImGuizmo::ROTATE:
+ snap = config.mSnapRotation;
+ ImGui::InputFloat("Angle Snap", &snap.x);
+ break;
+ case ImGuizmo::SCALE:
+ snap = config.mSnapScale;
+ ImGui::InputFloat("Scale Snap", &snap.x);
+ break;
+ }
+ ImGuiIO& io = ImGui::GetIO();
+ ImGuizmo::SetRect(0, 0, io.DisplaySize.x, io.DisplaySize.y);
+ ImGuizmo::Manipulate(camera.mView.m16, camera.mProjection.m16, mCurrentGizmoOperation, mCurrentGizmoMode, matrix.m16, NULL, useSnap ? &snap.x : NULL);
}
#endif
#pragma once
-namespace ImGuizmo
+#ifdef USE_IMGUI_API
+#include "imconfig.h"
+#endif
+#ifndef IMGUI_API
+#define IMGUI_API
+#endif
+
+#ifndef IMGUIZMO_NAMESPACE
+#define IMGUIZMO_NAMESPACE ImGuizmo
+#endif
+
+namespace IMGUIZMO_NAMESPACE
{
- // call inside your own window and before Manipulate() in order to draw gizmo to that window.
- IMGUI_API void SetDrawlist();
-
- // call BeginFrame right after ImGui_XXXX_NewFrame();
- IMGUI_API void BeginFrame();
-
- // return true if mouse cursor is over any gizmo control (axis, plan or screen component)
- IMGUI_API bool IsOver();
-
- // return true if mouse IsOver or if the gizmo is in moving state
- IMGUI_API bool IsUsing();
-
- // enable/disable the gizmo. Stay in the state until next call to Enable.
- // gizmo is rendered with gray half transparent color when disabled
- IMGUI_API void Enable(bool enable);
-
- // helper functions for manualy editing translation/rotation/scale with an input float
- // translation, rotation and scale float points to 3 floats each
- // Angles are in degrees (more suitable for human editing)
- // example:
- // float matrixTranslation[3], matrixRotation[3], matrixScale[3];
- // ImGuizmo::DecomposeMatrixToComponents(gizmoMatrix.m16, matrixTranslation, matrixRotation, matrixScale);
- // ImGui::InputFloat3("Tr", matrixTranslation, 3);
- // ImGui::InputFloat3("Rt", matrixRotation, 3);
- // ImGui::InputFloat3("Sc", matrixScale, 3);
- // ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, gizmoMatrix.m16);
- //
- // These functions have some numerical stability issues for now. Use with caution.
- IMGUI_API void DecomposeMatrixToComponents(const float *matrix, float *translation, float *rotation, float *scale);
- IMGUI_API void RecomposeMatrixFromComponents(const float *translation, const float *rotation, const float *scale, float *matrix);
-
- IMGUI_API void SetRect(float x, float y, float width, float height);
- // default is false
- IMGUI_API void SetOrthographic(bool isOrthographic);
-
- // Render a cube with face color corresponding to face normal. Usefull for debug/tests
- IMGUI_API void DrawCube(const float *view, const float *projection, const float *matrix);
- IMGUI_API void DrawGrid(const float *view, const float *projection, const float *matrix, const float gridSize);
-
- // call it when you want a gizmo
- // Needs view and projection matrices.
- // matrix parameter is the source matrix (where will be gizmo be drawn) and might be transformed by the function. Return deltaMatrix is optional
- // translation is applied in world space
- enum OPERATION
- {
- TRANSLATE,
- ROTATE,
- SCALE,
- BOUNDS,
- };
-
- enum MODE
- {
- LOCAL,
- WORLD
- };
-
- IMGUI_API void Manipulate(const float *view, const float *projection, OPERATION operation, MODE mode, float *matrix, float *deltaMatrix = 0, float *snap = 0, float *localBounds = NULL, float *boundsSnap = NULL);
-};
+ // call inside your own window and before Manipulate() in order to draw gizmo to that window.
+ // Or pass a specific ImDrawList to draw to (e.g. ImGui::GetForegroundDrawList()).
+ IMGUI_API void SetDrawlist(ImDrawList* drawlist = nullptr);
+
+ // call BeginFrame right after ImGui_XXXX_NewFrame();
+ IMGUI_API void BeginFrame();
+
+ // this is necessary because when imguizmo is compiled into a dll, and imgui into another
+ // globals are not shared between them.
+ // More details at https://stackoverflow.com/questions/19373061/what-happens-to-global-and-static-variables-in-a-shared-library-when-it-is-dynam
+ // expose method to set imgui context
+ IMGUI_API void SetImGuiContext(ImGuiContext* ctx);
+
+ // return true if mouse cursor is over any gizmo control (axis, plan or screen component)
+ IMGUI_API bool IsOver();
+
+ // return true if mouse IsOver or if the gizmo is in moving state
+ IMGUI_API bool IsUsing();
+
+ // enable/disable the gizmo. Stay in the state until next call to Enable.
+ // gizmo is rendered with gray half transparent color when disabled
+ IMGUI_API void Enable(bool enable);
+
+ // helper functions for manualy editing translation/rotation/scale with an input float
+ // translation, rotation and scale float points to 3 floats each
+ // Angles are in degrees (more suitable for human editing)
+ // example:
+ // float matrixTranslation[3], matrixRotation[3], matrixScale[3];
+ // ImGuizmo::DecomposeMatrixToComponents(gizmoMatrix.m16, matrixTranslation, matrixRotation, matrixScale);
+ // ImGui::InputFloat3("Tr", matrixTranslation, 3);
+ // ImGui::InputFloat3("Rt", matrixRotation, 3);
+ // ImGui::InputFloat3("Sc", matrixScale, 3);
+ // ImGuizmo::RecomposeMatrixFromComponents(matrixTranslation, matrixRotation, matrixScale, gizmoMatrix.m16);
+ //
+ // These functions have some numerical stability issues for now. Use with caution.
+ IMGUI_API void DecomposeMatrixToComponents(const float* matrix, float* translation, float* rotation, float* scale);
+ IMGUI_API void RecomposeMatrixFromComponents(const float* translation, const float* rotation, const float* scale, float* matrix);
+
+ IMGUI_API void SetRect(float x, float y, float width, float height);
+ // default is false
+ IMGUI_API void SetOrthographic(bool isOrthographic);
+
+ // Render a cube with face color corresponding to face normal. Usefull for debug/tests
+ IMGUI_API void DrawCubes(const float* view, const float* projection, const float* matrices, int matrixCount);
+ IMGUI_API void DrawGrid(const float* view, const float* projection, const float* matrix, const float gridSize);
+
+ // call it when you want a gizmo
+ // Needs view and projection matrices.
+ // matrix parameter is the source matrix (where will be gizmo be drawn) and might be transformed by the function. Return deltaMatrix is optional
+ // translation is applied in world space
+ enum OPERATION
+ {
+ TRANSLATE_X = (1u << 0),
+ TRANSLATE_Y = (1u << 1),
+ TRANSLATE_Z = (1u << 2),
+ ROTATE_X = (1u << 3),
+ ROTATE_Y = (1u << 4),
+ ROTATE_Z = (1u << 5),
+ ROTATE_SCREEN = (1u << 6),
+ SCALE_X = (1u << 7),
+ SCALE_Y = (1u << 8),
+ SCALE_Z = (1u << 9),
+ BOUNDS = (1u << 10),
+ SCALE_XU = (1u << 11),
+ SCALE_YU = (1u << 12),
+ SCALE_ZU = (1u << 13),
+
+ TRANSLATE = TRANSLATE_X | TRANSLATE_Y | TRANSLATE_Z,
+ ROTATE = ROTATE_X | ROTATE_Y | ROTATE_Z | ROTATE_SCREEN,
+ SCALE = SCALE_X | SCALE_Y | SCALE_Z,
+ SCALEU = SCALE_XU | SCALE_YU | SCALE_ZU, // universal
+ UNIVERSAL = TRANSLATE | ROTATE | SCALEU
+ };
+
+ inline OPERATION operator|(OPERATION lhs, OPERATION rhs)
+ {
+ return static_cast<OPERATION>(static_cast<int>(lhs) | static_cast<int>(rhs));
+ }
+
+ enum MODE
+ {
+ LOCAL,
+ WORLD
+ };
+
+ IMGUI_API bool Manipulate(const float* view, const float* projection, OPERATION operation, MODE mode, float* matrix, float* deltaMatrix = NULL, const float* snap = NULL, const float* localBounds = NULL, const float* boundsSnap = NULL);
+ //
+ // Please note that this cubeview is patented by Autodesk : https://patents.google.com/patent/US7782319B2/en
+ // It seems to be a defensive patent in the US. I don't think it will bring troubles using it as
+ // other software are using the same mechanics. But just in case, you are now warned!
+ //
+ IMGUI_API void ViewManipulate(float* view, float length, ImVec2 position, ImVec2 size, ImU32 backgroundColor);
+
+ IMGUI_API void SetID(int id);
+
+ // return true if the cursor is over the operation's gizmo
+ IMGUI_API bool IsOver(OPERATION op);
+ IMGUI_API void SetGizmoSizeClipSpace(float value);
+
+ // Allow axis to flip
+ // When true (default), the guizmo axis flip for better visibility
+ // When false, they always stay along the positive world/local axis
+ IMGUI_API void AllowAxisFlip(bool value);
+}
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.inl b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.inl
index 86336f2bd37..72339a9b423 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.inl
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/gizmo.inl
@@ -1,6 +1,9 @@
+// https://github.com/CedricGuillemet/ImGuizmo
+// v 1.84 WIP
+//
// The MIT License(MIT)
//
-// Copyright(c) 2016 Cedric Guillemet
+// Copyright(c) 2021 Cedric Guillemet
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
@@ -19,24 +22,65 @@
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
+//
+//#include "imgui.h"
+#ifndef IMGUI_DEFINE_MATH_OPERATORS
#define IMGUI_DEFINE_MATH_OPERATORS
+#endif
+//#include "imgui_internal.h"
+#include "gizmo.h"
+
+#if defined(_MSC_VER) || defined(__MINGW32__)
+#include <malloc.h>
+#endif
+#if !defined(_MSC_VER) && !defined(__MINGW64_VERSION_MAJOR)
+#define _malloca(x) alloca(x)
+#define _freea(x)
+#endif
// includes patches for multiview from
// https://github.com/CedricGuillemet/ImGuizmo/issues/15
-namespace ImGuizmo
+namespace IMGUIZMO_NAMESPACE
{
static const float ZPI = 3.14159265358979323846f;
static const float RAD2DEG = (180.f / ZPI);
static const float DEG2RAD = (ZPI / 180.f);
- static const float gGizmoSizeClipSpace = 0.1f;
const float screenRotateSize = 0.06f;
+ // scale a bit so translate axis do not touch when in universal
+ const float rotationDisplayFactor = 1.2f;
+
+ static OPERATION operator&(OPERATION lhs, OPERATION rhs)
+ {
+ return static_cast<OPERATION>(static_cast<int>(lhs) & static_cast<int>(rhs));
+ }
+
+ static bool operator!=(OPERATION lhs, int rhs)
+ {
+ return static_cast<int>(lhs) != rhs;
+ }
+
+ static bool operator==(OPERATION lhs, int rhs)
+ {
+ return static_cast<int>(lhs) == rhs;
+ }
+
+ static bool Intersects(OPERATION lhs, OPERATION rhs)
+ {
+ return (lhs & rhs) != 0;
+ }
+
+ // True if lhs contains rhs
+ static bool Contains(OPERATION lhs, OPERATION rhs)
+ {
+ return (lhs & rhs) == rhs;
+ }
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// utility and math
- void FPU_MatrixF_x_MatrixF(const float *a, const float *b, float *r)
+ void FPU_MatrixF_x_MatrixF(const float* a, const float* b, float* r)
{
r[0] = a[0] * b[0] + a[1] * b[4] + a[2] * b[8] + a[3] * b[12];
r[1] = a[0] * b[1] + a[1] * b[5] + a[2] * b[9] + a[3] * b[13];
@@ -59,11 +103,95 @@ namespace ImGuizmo
r[15] = a[12] * b[3] + a[13] * b[7] + a[14] * b[11] + a[15] * b[15];
}
- //template <typename T> T LERP(T x, T y, float z) { return (x + (y - x)*z); }
- template <typename T> T Clamp(T x, T y, T z) { return ((x<y) ? y : ((x>z) ? z : x)); }
+ void Frustum(float left, float right, float bottom, float top, float znear, float zfar, float* m16)
+ {
+ float temp, temp2, temp3, temp4;
+ temp = 2.0f * znear;
+ temp2 = right - left;
+ temp3 = top - bottom;
+ temp4 = zfar - znear;
+ m16[0] = temp / temp2;
+ m16[1] = 0.0;
+ m16[2] = 0.0;
+ m16[3] = 0.0;
+ m16[4] = 0.0;
+ m16[5] = temp / temp3;
+ m16[6] = 0.0;
+ m16[7] = 0.0;
+ m16[8] = (right + left) / temp2;
+ m16[9] = (top + bottom) / temp3;
+ m16[10] = (-zfar - znear) / temp4;
+ m16[11] = -1.0f;
+ m16[12] = 0.0;
+ m16[13] = 0.0;
+ m16[14] = (-temp * zfar) / temp4;
+ m16[15] = 0.0;
+ }
+
+ void Perspective(float fovyInDegrees, float aspectRatio, float znear, float zfar, float* m16)
+ {
+ float ymax, xmax;
+ ymax = znear * tanf(fovyInDegrees * DEG2RAD);
+ xmax = ymax * aspectRatio;
+ Frustum(-xmax, xmax, -ymax, ymax, znear, zfar, m16);
+ }
+
+ void Cross(const float* a, const float* b, float* r)
+ {
+ r[0] = a[1] * b[2] - a[2] * b[1];
+ r[1] = a[2] * b[0] - a[0] * b[2];
+ r[2] = a[0] * b[1] - a[1] * b[0];
+ }
+
+ float Dot(const float* a, const float* b)
+ {
+ return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
+ }
+
+ void Normalize(const float* a, float* r)
+ {
+ float il = 1.f / (sqrtf(Dot(a, a)) + FLT_EPSILON);
+ r[0] = a[0] * il;
+ r[1] = a[1] * il;
+ r[2] = a[2] * il;
+ }
+
+ void LookAt(const float* eye, const float* at, const float* up, float* m16)
+ {
+ float X[3], Y[3], Z[3], tmp[3];
+
+ tmp[0] = eye[0] - at[0];
+ tmp[1] = eye[1] - at[1];
+ tmp[2] = eye[2] - at[2];
+ Normalize(tmp, Z);
+ Normalize(up, Y);
+ Cross(Y, Z, tmp);
+ Normalize(tmp, X);
+ Cross(Z, X, tmp);
+ Normalize(tmp, Y);
+
+ m16[0] = X[0];
+ m16[1] = Y[0];
+ m16[2] = Z[0];
+ m16[3] = 0.0f;
+ m16[4] = X[1];
+ m16[5] = Y[1];
+ m16[6] = Z[1];
+ m16[7] = 0.0f;
+ m16[8] = X[2];
+ m16[9] = Y[2];
+ m16[10] = Z[2];
+ m16[11] = 0.0f;
+ m16[12] = -Dot(X, eye);
+ m16[13] = -Dot(Y, eye);
+ m16[14] = -Dot(Z, eye);
+ m16[15] = 1.0f;
+ }
+
+ template <typename T> T Clamp(T x, T y, T z) { return ((x < y) ? y : ((x > z) ? z : x)); }
template <typename T> T max(T x, T y) { return (x > y) ? x : y; }
template <typename T> T min(T x, T y) { return (x < y) ? x : y; }
- template <typename T> bool IsWithin(T x, T y, T z) { return (x>=y) && (x<=z); }
+ template <typename T> bool IsWithin(T x, T y, T z) { return (x >= y) && (x <= z); }
struct matrix_t;
struct vec_t
@@ -94,11 +222,12 @@ namespace ImGuizmo
vec_t operator * (const vec_t& v) const;
const vec_t& operator + () const { return (*this); }
- float Length() const { return sqrtf(x*x + y*y + z*z); };
- float LengthSq() const { return (x*x + y*y + z*z); };
- vec_t Normalize() { (*this) *= (1.f / Length()); return (*this); }
+ float Length() const { return sqrtf(x * x + y * y + z * z); };
+ float LengthSq() const { return (x * x + y * y + z * z); };
+ vec_t Normalize() { (*this) *= (1.f / ( Length() > FLT_EPSILON ? Length() : FLT_EPSILON ) ); return (*this); }
vec_t Normalize(const vec_t& v) { this->Set(v.x, v.y, v.z, v.w); this->Normalize(); return (*this); }
vec_t Abs() const;
+
void Cross(const vec_t& v)
{
vec_t res;
@@ -111,6 +240,7 @@ namespace ImGuizmo
z = res.z;
w = 0.f;
}
+
void Cross(const vec_t& v1, const vec_t& v2)
{
x = v1.y * v2.z - v1.z * v2.y;
@@ -118,17 +248,19 @@ namespace ImGuizmo
z = v1.x * v2.y - v1.y * v2.x;
w = 0.f;
}
- float Dot(const vec_t &v) const
+
+ float Dot(const vec_t& v) const
{
return (x * v.x) + (y * v.y) + (z * v.z) + (w * v.w);
}
- float Dot3(const vec_t &v) const
+
+ float Dot3(const vec_t& v) const
{
return (x * v.x) + (y * v.y) + (z * v.z);
}
void Transform(const matrix_t& matrix);
- void Transform(const vec_t & s, const matrix_t& matrix);
+ void Transform(const vec_t& s, const matrix_t& matrix);
void TransformVector(const matrix_t& matrix);
void TransformPoint(const matrix_t& matrix);
@@ -137,11 +269,12 @@ namespace ImGuizmo
float& operator [] (size_t index) { return ((float*)&x)[index]; }
const float& operator [] (size_t index) const { return ((float*)&x)[index]; }
+ bool operator!=(const vec_t& other) const { return memcmp(this, &other, sizeof(vec_t)); }
};
vec_t makeVect(float _x, float _y, float _z = 0.f, float _w = 0.f) { vec_t res; res.x = _x; res.y = _y; res.z = _z; res.w = _w; return res; }
vec_t makeVect(ImVec2 v) { vec_t res; res.x = v.x; res.y = v.y; res.z = 0.f; res.w = 0.f; return res; }
- vec_t vec_t::operator * (float f) const { return makeVect(x * f, y * f, z * f, w *f); }
+ vec_t vec_t::operator * (float f) const { return makeVect(x * f, y * f, z * f, w * f); }
vec_t vec_t::operator - () const { return makeVect(-x, -y, -z, -w); }
vec_t vec_t::operator - (const vec_t& v) const { return makeVect(x - v.x, y - v.y, z - v.z, w - v.w); }
vec_t vec_t::operator + (const vec_t& v) const { return makeVect(x + v.x, y + v.y, z + v.z, w + v.w); }
@@ -159,12 +292,12 @@ namespace ImGuizmo
return res;
}
- float Dot(const vec_t &v1, const vec_t &v2)
+ float Dot(const vec_t& v1, const vec_t& v2)
{
return (v1.x * v2.x) + (v1.y * v2.y) + (v1.z * v2.z);
}
- vec_t BuildPlan(const vec_t & p_point1, const vec_t & p_normal)
+ vec_t BuildPlan(const vec_t& p_point1, const vec_t& p_normal)
{
vec_t normal, res;
normal.Normalize(p_normal);
@@ -193,7 +326,7 @@ namespace ImGuizmo
matrix_t(const matrix_t& other) { memcpy(&m16[0], &other.m16[0], sizeof(float) * 16); }
matrix_t() {}
- operator float * () { return m16; }
+ operator float* () { return m16; }
operator const float* () const { return m16; }
void Translation(float _x, float _y, float _z) { this->Translation(makeVect(_x, _y, _z)); }
@@ -229,7 +362,7 @@ namespace ImGuizmo
return matT;
}
- void Multiply(const matrix_t &matrix)
+ void Multiply(const matrix_t& matrix)
{
matrix_t tmp;
tmp = *this;
@@ -237,7 +370,7 @@ namespace ImGuizmo
FPU_MatrixF_x_MatrixF((float*)&tmp, (float*)&matrix, (float*)this);
}
- void Multiply(const matrix_t &m1, const matrix_t &m2)
+ void Multiply(const matrix_t& m1, const matrix_t& m2)
{
FPU_MatrixF_x_MatrixF((float*)&m1, (float*)&m2, (float*)this);
}
@@ -248,7 +381,7 @@ namespace ImGuizmo
m[0][2] * m[1][1] * m[2][0] - m[0][1] * m[1][0] * m[2][2] - m[0][0] * m[1][2] * m[2][1];
}
- float Inverse(const matrix_t &srcMatrix, bool affine = false);
+ float Inverse(const matrix_t& srcMatrix, bool affine = false);
void SetToIdentity()
{
v.right.Set(1.f, 0.f, 0.f, 0.f);
@@ -269,7 +402,7 @@ namespace ImGuizmo
(*this) = tmpm;
}
- void RotationAxis(const vec_t & axis, float angle);
+ void RotationAxis(const vec_t& axis, float angle);
void OrthoNormalize()
{
@@ -294,7 +427,7 @@ namespace ImGuizmo
w = out.w;
}
- void vec_t::Transform(const vec_t & s, const matrix_t& matrix)
+ void vec_t::Transform(const vec_t& s, const matrix_t& matrix)
{
*this = s;
Transform(matrix);
@@ -315,7 +448,6 @@ namespace ImGuizmo
w = out.w;
}
-
void vec_t::TransformVector(const matrix_t& matrix)
{
vec_t out;
@@ -331,7 +463,7 @@ namespace ImGuizmo
w = out.w;
}
- float matrix_t::Inverse(const matrix_t &srcMatrix, bool affine)
+ float matrix_t::Inverse(const matrix_t& srcMatrix, bool affine)
{
float det = 0;
@@ -427,7 +559,7 @@ namespace ImGuizmo
return det;
}
- void matrix_t::RotationAxis(const vec_t & axis, float angle)
+ void matrix_t::RotationAxis(const vec_t& axis, float angle)
{
float length2 = axis.LengthSq();
if (length2 < FLT_EPSILON)
@@ -474,24 +606,42 @@ namespace ImGuizmo
enum MOVETYPE
{
- NONE,
- MOVE_X,
- MOVE_Y,
- MOVE_Z,
- MOVE_YZ,
- MOVE_ZX,
- MOVE_XY,
- MOVE_SCREEN,
- ROTATE_X,
- ROTATE_Y,
- ROTATE_Z,
- ROTATE_SCREEN,
- SCALE_X,
- SCALE_Y,
- SCALE_Z,
- SCALE_XYZ
+ MT_NONE,
+ MT_MOVE_X,
+ MT_MOVE_Y,
+ MT_MOVE_Z,
+ MT_MOVE_YZ,
+ MT_MOVE_ZX,
+ MT_MOVE_XY,
+ MT_MOVE_SCREEN,
+ MT_ROTATE_X,
+ MT_ROTATE_Y,
+ MT_ROTATE_Z,
+ MT_ROTATE_SCREEN,
+ MT_SCALE_X,
+ MT_SCALE_Y,
+ MT_SCALE_Z,
+ MT_SCALE_XYZ
};
+ static bool IsTranslateType(int type)
+ {
+ return type >= MT_MOVE_X && type <= MT_MOVE_SCREEN;
+ }
+
+ static bool IsRotateType(int type)
+ {
+ return type >= MT_ROTATE_X && type <= MT_ROTATE_SCREEN;
+ }
+
+ static bool IsScaleType(int type)
+ {
+ return type >= MT_SCALE_X && type <= MT_SCALE_XYZ;
+ }
+
+ // Matches MT_MOVE_AB order
+ static const OPERATION TRANSLATE_PLANS[3] = { TRANSLATE_Y | TRANSLATE_Z, TRANSLATE_X | TRANSLATE_Z, TRANSLATE_X | TRANSLATE_Y };
+
struct Context
{
Context() : mbUsing(false), mbEnable(true), mbUsingBounds(false)
@@ -504,10 +654,12 @@ namespace ImGuizmo
matrix_t mViewMat;
matrix_t mProjectionMat;
matrix_t mModel;
+ matrix_t mModelLocal; // orthonormalized model
matrix_t mModelInverse;
matrix_t mModelSource;
matrix_t mModelSourceInverse;
matrix_t mMVP;
+ matrix_t mMVPLocal; // MVP with full model matrix whereas mMVP's model matrix might only be translation in case of World space edition
matrix_t mViewProjection;
vec_t mModelScaleOrigin;
@@ -529,10 +681,13 @@ namespace ImGuizmo
bool mbUsing;
bool mbEnable;
+ bool mReversed; // reversed projection matrix
+
// translation
vec_t mTranslationPlan;
vec_t mTranslationPlanOrigin;
vec_t mMatrixOrigin;
+ vec_t mTranslationLastDelta;
// rotation
vec_t mRotationVectorSource;
@@ -543,6 +698,7 @@ namespace ImGuizmo
// scale
vec_t mScale;
vec_t mScaleValueOrigin;
+ vec_t mScaleLast;
float mSaveMousePosx;
// save axis factor when using gizmo
@@ -569,29 +725,33 @@ namespace ImGuizmo
float mHeight = 0.f;
float mXMax = 0.f;
float mYMax = 0.f;
- float mDisplayRatio = 1.f;
+ float mDisplayRatio = 1.f;
+
+ bool mIsOrthographic = false;
- bool mIsOrthographic = false;
+ int mActualID = -1;
+ int mEditingID = -1;
+ OPERATION mOperation = OPERATION(-1);
+
+ bool mAllowAxisFlip = true;
+ float mGizmoSizeClipSpace = 0.1f;
};
static Context gContext;
- static const float angleLimit = 0.96f;
- static const float planeLimit = 0.2f;
-
static const vec_t directionUnary[3] = { makeVect(1.f, 0.f, 0.f), makeVect(0.f, 1.f, 0.f), makeVect(0.f, 0.f, 1.f) };
- static const ImU32 directionColor[3] = { 0xFF0000AA, 0xFF00AA00, 0xFFAA0000 };
+ static const ImU32 directionColor[3] = { IM_COL32(0xAA, 0, 0, 0xFF), IM_COL32(0, 0xAA, 0, 0xFF), IM_COL32(0, 0, 0xAA, 0XFF) };
// Alpha: 100%: FF, 87%: DE, 70%: B3, 54%: 8A, 50%: 80, 38%: 61, 12%: 1F
- static const ImU32 planeColor[3] = { 0x610000AA, 0x6100AA00, 0x61AA0000 };
- static const ImU32 selectionColor = 0x8A1080FF;
- static const ImU32 inactiveColor = 0x99999999;
- static const ImU32 translationLineColor = 0xAAAAAAAA;
- static const char *translationInfoMask[] = { "X : %5.3f", "Y : %5.3f", "Z : %5.3f",
+ static const ImU32 planeColor[3] = { IM_COL32(0xAA, 0, 0, 0x61), IM_COL32(0, 0xAA, 0, 0x61), IM_COL32(0, 0, 0xAA, 0x61) };
+ static const ImU32 selectionColor = IM_COL32(0xFF, 0x80, 0x10, 0x8A);
+ static const ImU32 inactiveColor = IM_COL32(0x99, 0x99, 0x99, 0x99);
+ static const ImU32 translationLineColor = IM_COL32(0xAA, 0xAA, 0xAA, 0xAA);
+ static const char* translationInfoMask[] = { "X : %5.3f", "Y : %5.3f", "Z : %5.3f",
"Y : %5.3f Z : %5.3f", "X : %5.3f Z : %5.3f", "X : %5.3f Y : %5.3f",
"X : %5.3f Y : %5.3f Z : %5.3f" };
- static const char *scaleInfoMask[] = { "X : %5.2f", "Y : %5.2f", "Z : %5.2f", "XYZ : %5.2f" };
- static const char *rotationInfoMask[] = { "X : %5.2f deg %5.2f rad", "Y : %5.2f deg %5.2f rad", "Z : %5.2f deg %5.2f rad", "Screen : %5.2f deg %5.2f rad" };
+ static const char* scaleInfoMask[] = { "X : %5.2f", "Y : %5.2f", "Z : %5.2f", "XYZ : %5.2f" };
+ static const char* rotationInfoMask[] = { "X : %5.2f deg %5.2f rad", "Y : %5.2f deg %5.2f rad", "Z : %5.2f deg %5.2f rad", "Screen : %5.2f deg %5.2f rad" };
static const int translationInfoIndex[] = { 0,0,0, 1,0,0, 2,0,0, 1,2,0, 0,2,0, 0,1,0, 0,1,2 };
static const float quadMin = 0.5f;
static const float quadMax = 0.8f;
@@ -601,57 +761,65 @@ namespace ImGuizmo
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
- static int GetMoveType(vec_t *gizmoHitProportion);
- static int GetRotateType();
- static int GetScaleType();
+ static int GetMoveType(OPERATION op, vec_t* gizmoHitProportion);
+ static int GetRotateType(OPERATION op);
+ static int GetScaleType(OPERATION op);
- static ImVec2 worldToPos(const vec_t& worldPos, const matrix_t& mat)
+ static ImVec2 worldToPos(const vec_t& worldPos, const matrix_t& mat, ImVec2 position = ImVec2(gContext.mX, gContext.mY), ImVec2 size = ImVec2(gContext.mWidth, gContext.mHeight))
{
vec_t trans;
trans.TransformPoint(worldPos, mat);
trans *= 0.5f / trans.w;
trans += makeVect(0.5f, 0.5f);
trans.y = 1.f - trans.y;
- trans.x *= gContext.mWidth;
- trans.y *= gContext.mHeight;
- trans.x += gContext.mX;
- trans.y += gContext.mY;
+ trans.x *= size.x;
+ trans.y *= size.y;
+ trans.x += position.x;
+ trans.y += position.y;
return ImVec2(trans.x, trans.y);
}
- static void ComputeCameraRay(vec_t &rayOrigin, vec_t &rayDir)
+ static void ComputeCameraRay(vec_t& rayOrigin, vec_t& rayDir, ImVec2 position = ImVec2(gContext.mX, gContext.mY), ImVec2 size = ImVec2(gContext.mWidth, gContext.mHeight))
{
ImGuiIO& io = ImGui::GetIO();
matrix_t mViewProjInverse;
mViewProjInverse.Inverse(gContext.mViewMat * gContext.mProjectionMat);
- float mox = ((io.MousePos.x - gContext.mX) / gContext.mWidth) * 2.f - 1.f;
- float moy = (1.f - ((io.MousePos.y - gContext.mY) / gContext.mHeight)) * 2.f - 1.f;
+ const float mox = ((io.MousePos.x - position.x) / size.x) * 2.f - 1.f;
+ const float moy = (1.f - ((io.MousePos.y - position.y) / size.y)) * 2.f - 1.f;
+
+ const float zNear = gContext.mReversed ? (1.f - FLT_EPSILON) : 0.f;
+ const float zFar = gContext.mReversed ? 0.f : (1.f - FLT_EPSILON);
- rayOrigin.Transform(makeVect(mox, moy, 0.f, 1.f), mViewProjInverse);
+ rayOrigin.Transform(makeVect(mox, moy, zNear, 1.f), mViewProjInverse);
rayOrigin *= 1.f / rayOrigin.w;
vec_t rayEnd;
- rayEnd.Transform(makeVect(mox, moy, 1.f, 1.f), mViewProjInverse);
+ rayEnd.Transform(makeVect(mox, moy, zFar, 1.f), mViewProjInverse);
rayEnd *= 1.f / rayEnd.w;
rayDir = Normalized(rayEnd - rayOrigin);
}
- static float GetSegmentLengthClipSpace(const vec_t& start, const vec_t& end)
+ static float GetSegmentLengthClipSpace(const vec_t& start, const vec_t& end, const bool localCoordinates = false)
{
vec_t startOfSegment = start;
- startOfSegment.TransformPoint(gContext.mMVP);
- if (fabsf(startOfSegment.w)> FLT_EPSILON) // check for axis aligned with camera direction
+ const matrix_t& mvp = localCoordinates ? gContext.mMVPLocal : gContext.mMVP;
+ startOfSegment.TransformPoint(mvp);
+ if (fabsf(startOfSegment.w) > FLT_EPSILON) // check for axis aligned with camera direction
+ {
startOfSegment *= 1.f / startOfSegment.w;
+ }
vec_t endOfSegment = end;
- endOfSegment.TransformPoint(gContext.mMVP);
- if (fabsf(endOfSegment.w)> FLT_EPSILON) // check for axis aligned with camera direction
+ endOfSegment.TransformPoint(mvp);
+ if (fabsf(endOfSegment.w) > FLT_EPSILON) // check for axis aligned with camera direction
+ {
endOfSegment *= 1.f / endOfSegment.w;
+ }
vec_t clipSpaceAxis = endOfSegment - startOfSegment;
clipSpaceAxis.y /= gContext.mDisplayRatio;
- float segmentLengthInClipSpace = sqrtf(clipSpaceAxis.x*clipSpaceAxis.x + clipSpaceAxis.y*clipSpaceAxis.y);
+ float segmentLengthInClipSpace = sqrtf(clipSpaceAxis.x * clipSpaceAxis.x + clipSpaceAxis.y * clipSpaceAxis.y);
return segmentLengthInClipSpace;
}
@@ -661,8 +829,10 @@ namespace ImGuizmo
for (unsigned int i = 0; i < 3; i++)
{
pts[i].TransformPoint(gContext.mMVP);
- if (fabsf(pts[i].w)> FLT_EPSILON) // check for axis aligned with camera direction
+ if (fabsf(pts[i].w) > FLT_EPSILON) // check for axis aligned with camera direction
+ {
pts[i] *= 1.f / pts[i].w;
+ }
}
vec_t segA = pts[1] - pts[0];
vec_t segB = pts[2] - pts[0];
@@ -671,11 +841,11 @@ namespace ImGuizmo
vec_t segAOrtho = makeVect(-segA.y, segA.x);
segAOrtho.Normalize();
float dt = segAOrtho.Dot3(segB);
- float surface = sqrtf(segA.x*segA.x + segA.y*segA.y) * fabsf(dt);
+ float surface = sqrtf(segA.x * segA.x + segA.y * segA.y) * fabsf(dt);
return surface;
}
- inline vec_t PointOnSegment(const vec_t & point, const vec_t & vertPos1, const vec_t & vertPos2)
+ inline vec_t PointOnSegment(const vec_t& point, const vec_t& vertPos1, const vec_t& vertPos2)
{
vec_t c = point - vertPos1;
vec_t V;
@@ -685,63 +855,84 @@ namespace ImGuizmo
float t = V.Dot3(c);
if (t < 0.f)
+ {
return vertPos1;
+ }
if (t > d)
+ {
return vertPos2;
+ }
return vertPos1 + V * t;
}
- static float IntersectRayPlane(const vec_t & rOrigin, const vec_t& rVector, const vec_t& plan)
+ static float IntersectRayPlane(const vec_t& rOrigin, const vec_t& rVector, const vec_t& plan)
{
- float numer = plan.Dot3(rOrigin) - plan.w;
- float denom = plan.Dot3(rVector);
+ const float numer = plan.Dot3(rOrigin) - plan.w;
+ const float denom = plan.Dot3(rVector);
if (fabsf(denom) < FLT_EPSILON) // normal is orthogonal to vector, cant intersect
+ {
return -1.0f;
+ }
return -(numer / denom);
}
- static bool IsInContextRect( ImVec2 p )
+ static float DistanceToPlane(const vec_t& point, const vec_t& plan)
+ {
+ return plan.Dot3(point) + plan.w;
+ }
+
+ static bool IsInContextRect(ImVec2 p)
{
- return IsWithin( p.x, gContext.mX, gContext.mXMax ) && IsWithin(p.y, gContext.mY, gContext.mYMax );
+ return IsWithin(p.x, gContext.mX, gContext.mXMax) && IsWithin(p.y, gContext.mY, gContext.mYMax);
}
void SetRect(float x, float y, float width, float height)
{
- gContext.mX = x;
- gContext.mY = y;
- gContext.mWidth = width;
- gContext.mHeight = height;
- gContext.mXMax = gContext.mX + gContext.mWidth;
- gContext.mYMax = gContext.mY + gContext.mXMax;
+ gContext.mX = x;
+ gContext.mY = y;
+ gContext.mWidth = width;
+ gContext.mHeight = height;
+ gContext.mXMax = gContext.mX + gContext.mWidth;
+ gContext.mYMax = gContext.mY + gContext.mXMax;
gContext.mDisplayRatio = width / height;
}
- IMGUI_API void SetOrthographic(bool isOrthographic)
+ void SetOrthographic(bool isOrthographic)
{
gContext.mIsOrthographic = isOrthographic;
}
- void SetDrawlist()
+ void SetDrawlist(ImDrawList* drawlist)
{
- gContext.mDrawList = ImGui::GetWindowDrawList();
+ gContext.mDrawList = drawlist ? drawlist : ImGui::GetWindowDrawList();
}
- void BeginFrame()
+ void SetImGuiContext(ImGuiContext* ctx)
{
- ImGuiIO& io = ImGui::GetIO();
+ ImGui::SetCurrentContext(ctx);
+ }
+ void BeginFrame()
+ {
const ImU32 flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoBringToFrontOnFocus;
+
+#ifdef IMGUI_HAS_VIEWPORT
+ ImGui::SetNextWindowSize(ImGui::GetMainViewport()->Size);
+ ImGui::SetNextWindowPos(ImGui::GetMainViewport()->Pos);
+#else
+ ImGuiIO& io = ImGui::GetIO();
ImGui::SetNextWindowSize(io.DisplaySize);
ImGui::SetNextWindowPos(ImVec2(0, 0));
-
+#endif
+
ImGui::PushStyleColor(ImGuiCol_WindowBg, 0);
ImGui::PushStyleColor(ImGuiCol_Border, 0);
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
-
+
ImGui::Begin("gizmo", NULL, flags);
gContext.mDrawList = ImGui::GetWindowDrawList();
ImGui::End();
@@ -751,12 +942,35 @@ namespace ImGuizmo
bool IsUsing()
{
- return gContext.mbUsing||gContext.mbUsingBounds;
+ return gContext.mbUsing || gContext.mbUsingBounds;
}
bool IsOver()
{
- return (GetMoveType(NULL) != NONE) || GetRotateType() != NONE || GetScaleType() != NONE || IsUsing();
+ return (Intersects(gContext.mOperation, TRANSLATE) && GetMoveType(gContext.mOperation, NULL) != MT_NONE) ||
+ (Intersects(gContext.mOperation, ROTATE) && GetRotateType(gContext.mOperation) != MT_NONE) ||
+ (Intersects(gContext.mOperation, SCALE) && GetScaleType(gContext.mOperation) != MT_NONE) || IsUsing();
+ }
+
+ bool IsOver(OPERATION op)
+ {
+ if(IsUsing())
+ {
+ return true;
+ }
+ if(Intersects(op, SCALE) && GetScaleType(op) != MT_NONE)
+ {
+ return true;
+ }
+ if(Intersects(op, ROTATE) && GetRotateType(op) != MT_NONE)
+ {
+ return true;
+ }
+ if(Intersects(op, TRANSLATE) && GetMoveType(op, NULL) != MT_NONE)
+ {
+ return true;
+ }
+ return false;
}
void Enable(bool enable)
@@ -764,21 +978,23 @@ namespace ImGuizmo
gContext.mbEnable = enable;
if (!enable)
{
- gContext.mbUsing = false;
- gContext.mbUsingBounds = false;
+ gContext.mbUsing = false;
+ gContext.mbUsingBounds = false;
}
}
- static void ComputeContext(const float *view, const float *projection, float *matrix, MODE mode)
+ static void ComputeContext(const float* view, const float* projection, float* matrix, MODE mode)
{
gContext.mMode = mode;
gContext.mViewMat = *(matrix_t*)view;
gContext.mProjectionMat = *(matrix_t*)projection;
+ gContext.mModelLocal = *(matrix_t*)matrix;
+ gContext.mModelLocal.OrthoNormalize();
+
if (mode == LOCAL)
{
- gContext.mModel = *(matrix_t*)matrix;
- gContext.mModel.OrthoNormalize();
+ gContext.mModel = gContext.mModelLocal;
}
else
{
@@ -791,6 +1007,7 @@ namespace ImGuizmo
gContext.mModelSourceInverse.Inverse(gContext.mModelSource);
gContext.mViewProjection = gContext.mViewMat * gContext.mProjectionMat;
gContext.mMVP = gContext.mModel * gContext.mViewProjection;
+ gContext.mMVPLocal = gContext.mModelLocal * gContext.mViewProjection;
matrix_t viewInverse;
viewInverse.Inverse(gContext.mViewMat);
@@ -799,15 +1016,22 @@ namespace ImGuizmo
gContext.mCameraRight = viewInverse.v.right;
gContext.mCameraUp = viewInverse.v.up;
- // compute scale from the size of camera right vector projected on screen at the matrix position
- vec_t pointRight = viewInverse.v.right;
- pointRight.TransformPoint(gContext.mViewProjection);
- gContext.mScreenFactor = gGizmoSizeClipSpace / (pointRight.x / pointRight.w - gContext.mMVP.v.position.x / gContext.mMVP.v.position.w);
+ // projection reverse
+ vec_t nearPos, farPos;
+ nearPos.Transform(makeVect(0, 0, 1.f, 1.f), gContext.mProjectionMat);
+ farPos.Transform(makeVect(0, 0, 2.f, 1.f), gContext.mProjectionMat);
+
+ gContext.mReversed = (nearPos.z/nearPos.w) > (farPos.z / farPos.w);
- vec_t rightViewInverse = viewInverse.v.right;
- rightViewInverse.TransformVector(gContext.mModelInverse);
- float rightLength = GetSegmentLengthClipSpace(makeVect(0.f, 0.f), rightViewInverse);
- gContext.mScreenFactor = gGizmoSizeClipSpace / rightLength;
+ // compute scale from the size of camera right vector projected on screen at the matrix position
+ vec_t pointRight = viewInverse.v.right;
+ pointRight.TransformPoint(gContext.mViewProjection);
+ gContext.mScreenFactor = gContext.mGizmoSizeClipSpace / (pointRight.x / pointRight.w - gContext.mMVP.v.position.x / gContext.mMVP.v.position.w);
+
+ vec_t rightViewInverse = viewInverse.v.right;
+ rightViewInverse.TransformVector(gContext.mModelInverse);
+ float rightLength = GetSegmentLengthClipSpace(makeVect(0.f, 0.f), rightViewInverse);
+ gContext.mScreenFactor = gContext.mGizmoSizeClipSpace / rightLength;
ImVec2 centerSSpace = worldToPos(makeVect(0.f, 0.f), gContext.mMVP);
gContext.mScreenSquareCenter = centerSSpace;
@@ -817,49 +1041,57 @@ namespace ImGuizmo
ComputeCameraRay(gContext.mRayOrigin, gContext.mRayVector);
}
- static void ComputeColors(ImU32 *colors, int type, OPERATION operation)
+ static void ComputeColors(ImU32* colors, int type, OPERATION operation)
{
if (gContext.mbEnable)
{
switch (operation)
{
case TRANSLATE:
- colors[0] = (type == MOVE_SCREEN) ? selectionColor : 0xFFFFFFFF;
+ colors[0] = (type == MT_MOVE_SCREEN) ? selectionColor : IM_COL32_WHITE;
for (int i = 0; i < 3; i++)
{
- colors[i + 1] = (type == (int)(MOVE_X + i)) ? selectionColor : directionColor[i];
- colors[i + 4] = (type == (int)(MOVE_YZ + i)) ? selectionColor : planeColor[i];
- colors[i + 4] = (type == MOVE_SCREEN) ? selectionColor : colors[i + 4];
+ colors[i + 1] = (type == (int)(MT_MOVE_X + i)) ? selectionColor : directionColor[i];
+ colors[i + 4] = (type == (int)(MT_MOVE_YZ + i)) ? selectionColor : planeColor[i];
+ colors[i + 4] = (type == MT_MOVE_SCREEN) ? selectionColor : colors[i + 4];
}
break;
case ROTATE:
- colors[0] = (type == ROTATE_SCREEN) ? selectionColor : 0xFFFFFFFF;
+ colors[0] = (type == MT_ROTATE_SCREEN) ? selectionColor : IM_COL32_WHITE;
for (int i = 0; i < 3; i++)
- colors[i + 1] = (type == (int)(ROTATE_X + i)) ? selectionColor : directionColor[i];
+ {
+ colors[i + 1] = (type == (int)(MT_ROTATE_X + i)) ? selectionColor : directionColor[i];
+ }
break;
+ case SCALEU:
case SCALE:
- colors[0] = (type == SCALE_XYZ) ? selectionColor : 0xFFFFFFFF;
+ colors[0] = (type == MT_SCALE_XYZ) ? selectionColor : IM_COL32_WHITE;
for (int i = 0; i < 3; i++)
- colors[i + 1] = (type == (int)(SCALE_X + i)) ? selectionColor : directionColor[i];
+ {
+ colors[i + 1] = (type == (int)(MT_SCALE_X + i)) ? selectionColor : directionColor[i];
+ }
break;
- case BOUNDS:
+ // note: this internal function is only called with three possible values for operation
+ default:
break;
}
}
else
{
for (int i = 0; i < 7; i++)
+ {
colors[i] = inactiveColor;
+ }
}
}
- static void ComputeTripodAxisAndVisibility(int axisIndex, vec_t& dirAxis, vec_t& dirPlaneX, vec_t& dirPlaneY, bool& belowAxisLimit, bool& belowPlaneLimit)
+ static void ComputeTripodAxisAndVisibility(const int axisIndex, vec_t& dirAxis, vec_t& dirPlaneX, vec_t& dirPlaneY, bool& belowAxisLimit, bool& belowPlaneLimit, const bool localCoordinates = false)
{
dirAxis = directionUnary[axisIndex];
dirPlaneX = directionUnary[(axisIndex + 1) % 3];
dirPlaneY = directionUnary[(axisIndex + 2) % 3];
- if (gContext.mbUsing)
+ if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID))
{
// when using, use stored factors so the gizmo doesn't flip when we translate
belowAxisLimit = gContext.mBelowAxisLimit[axisIndex];
@@ -872,24 +1104,26 @@ namespace ImGuizmo
else
{
// new method
- float lenDir = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), dirAxis);
- float lenDirMinus = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), -dirAxis);
+ float lenDir = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), dirAxis, localCoordinates);
+ float lenDirMinus = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), -dirAxis, localCoordinates);
- float lenDirPlaneX = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), dirPlaneX);
- float lenDirMinusPlaneX = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), -dirPlaneX);
+ float lenDirPlaneX = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), dirPlaneX, localCoordinates);
+ float lenDirMinusPlaneX = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), -dirPlaneX, localCoordinates);
- float lenDirPlaneY = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), dirPlaneY);
- float lenDirMinusPlaneY = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), -dirPlaneY);
+ float lenDirPlaneY = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), dirPlaneY, localCoordinates);
+ float lenDirMinusPlaneY = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), -dirPlaneY, localCoordinates);
- float mulAxis = (lenDir < lenDirMinus && fabsf(lenDir - lenDirMinus) > FLT_EPSILON) ? -1.f : 1.f;
- float mulAxisX = (lenDirPlaneX < lenDirMinusPlaneX && fabsf(lenDirPlaneX - lenDirMinusPlaneX) > FLT_EPSILON) ? -1.f : 1.f;
- float mulAxisY = (lenDirPlaneY < lenDirMinusPlaneY && fabsf(lenDirPlaneY - lenDirMinusPlaneY) > FLT_EPSILON) ? -1.f : 1.f;
+ // For readability
+ bool & allowFlip = gContext.mAllowAxisFlip;
+ float mulAxis = (allowFlip && lenDir < lenDirMinus&& fabsf(lenDir - lenDirMinus) > FLT_EPSILON) ? -1.f : 1.f;
+ float mulAxisX = (allowFlip && lenDirPlaneX < lenDirMinusPlaneX&& fabsf(lenDirPlaneX - lenDirMinusPlaneX) > FLT_EPSILON) ? -1.f : 1.f;
+ float mulAxisY = (allowFlip && lenDirPlaneY < lenDirMinusPlaneY&& fabsf(lenDirPlaneY - lenDirMinusPlaneY) > FLT_EPSILON) ? -1.f : 1.f;
dirAxis *= mulAxis;
dirPlaneX *= mulAxisX;
dirPlaneY *= mulAxisY;
// for axis
- float axisLengthInClipSpace = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), dirAxis * gContext.mScreenFactor);
+ float axisLengthInClipSpace = GetSegmentLengthClipSpace(makeVect(0.f, 0.f, 0.f), dirAxis * gContext.mScreenFactor, localCoordinates);
float paraSurf = GetParallelogram(makeVect(0.f, 0.f, 0.f), dirPlaneX * gContext.mScreenFactor, dirPlaneY * gContext.mScreenFactor);
belowPlaneLimit = (paraSurf > 0.0025f);
@@ -904,18 +1138,25 @@ namespace ImGuizmo
}
}
- static void ComputeSnap(float*value, float snap)
+ static void ComputeSnap(float* value, float snap)
{
if (snap <= FLT_EPSILON)
+ {
return;
+ }
+
float modulo = fmodf(*value, snap);
float moduloRatio = fabsf(modulo) / snap;
if (moduloRatio < snapTension)
+ {
*value -= modulo;
- else if (moduloRatio >(1.f - snapTension))
- *value = *value - modulo + snap * ((*value<0.f) ? -1.f : 1.f);
+ }
+ else if (moduloRatio > (1.f - snapTension))
+ {
+ *value = *value - modulo + snap * ((*value < 0.f) ? -1.f : 1.f);
+ }
}
- static void ComputeSnap(vec_t& value, float *snap)
+ static void ComputeSnap(vec_t& value, const float* snap)
{
for (int i = 0; i < 3; i++)
{
@@ -931,81 +1172,100 @@ namespace ImGuizmo
vec_t perpendicularVector;
perpendicularVector.Cross(gContext.mRotationVectorSource, gContext.mTranslationPlan);
perpendicularVector.Normalize();
- float acosAngle = Clamp(Dot(localPos, gContext.mRotationVectorSource), -0.9999f, 0.9999f);
+ float acosAngle = Clamp(Dot(localPos, gContext.mRotationVectorSource), -1.f, 1.f);
float angle = acosf(acosAngle);
angle *= (Dot(localPos, perpendicularVector) < 0.f) ? 1.f : -1.f;
return angle;
}
- static void DrawRotationGizmo(int type)
+ static void DrawRotationGizmo(OPERATION op, int type)
{
+ if(!Intersects(op, ROTATE))
+ {
+ return;
+ }
ImDrawList* drawList = gContext.mDrawList;
// colors
ImU32 colors[7];
ComputeColors(colors, type, ROTATE);
- vec_t cameraToModelNormalized;
- if (gContext.mIsOrthographic)
- {
- matrix_t viewInverse;
- viewInverse.Inverse(*(matrix_t*)&gContext.mViewMat);
- cameraToModelNormalized = viewInverse.v.dir;
- }
- else
- {
- cameraToModelNormalized = Normalized(gContext.mModel.v.position - gContext.mCameraEye);
- }
+ vec_t cameraToModelNormalized;
+ if (gContext.mIsOrthographic)
+ {
+ matrix_t viewInverse;
+ viewInverse.Inverse(*(matrix_t*)&gContext.mViewMat);
+ cameraToModelNormalized = viewInverse.v.dir;
+ }
+ else
+ {
+ cameraToModelNormalized = Normalized(gContext.mModel.v.position - gContext.mCameraEye);
+ }
cameraToModelNormalized.TransformVector(gContext.mModelInverse);
gContext.mRadiusSquareCenter = screenRotateSize * gContext.mHeight;
- for (int axis = 0; axis < 3; axis++)
+ bool hasRSC = Intersects(op, ROTATE_SCREEN);
+ for (int axis = 0; axis < 3; axis++)
{
- ImVec2 circlePos[halfCircleSegmentCount];
+ if(!Intersects(op, static_cast<OPERATION>(ROTATE_Z >> axis)))
+ {
+ continue;
+ }
+ const bool usingAxis = (gContext.mbUsing && type == MT_ROTATE_Z - axis);
+ const int circleMul = (hasRSC && !usingAxis ) ? 1 : 2;
+
+ ImVec2* circlePos = (ImVec2*)alloca(sizeof(ImVec2) * (circleMul * halfCircleSegmentCount + 1));
- float angleStart = atan2f(cameraToModelNormalized[(4-axis)%3], cameraToModelNormalized[(3 - axis) % 3]) + ZPI * 0.5f;
+ float angleStart = atan2f(cameraToModelNormalized[(4 - axis) % 3], cameraToModelNormalized[(3 - axis) % 3]) + ZPI * 0.5f;
- for (unsigned int i = 0; i < halfCircleSegmentCount; i++)
+ for (int i = 0; i < circleMul * halfCircleSegmentCount + 1; i++)
{
- float ng = angleStart + ZPI * ((float)i / (float)halfCircleSegmentCount);
+ float ng = angleStart + circleMul * ZPI * ((float)i / (float)halfCircleSegmentCount);
vec_t axisPos = makeVect(cosf(ng), sinf(ng), 0.f);
- vec_t pos = makeVect(axisPos[axis], axisPos[(axis+1)%3], axisPos[(axis+2)%3]) * gContext.mScreenFactor;
+ vec_t pos = makeVect(axisPos[axis], axisPos[(axis + 1) % 3], axisPos[(axis + 2) % 3]) * gContext.mScreenFactor * rotationDisplayFactor;
circlePos[i] = worldToPos(pos, gContext.mMVP);
}
+ if (!gContext.mbUsing || usingAxis)
+ {
+ drawList->AddPolyline(circlePos, circleMul* halfCircleSegmentCount + 1, colors[3 - axis], false, 2);
+ }
- float radiusAxis = sqrtf( (ImLengthSqr(worldToPos(gContext.mModel.v.position, gContext.mViewProjection) - circlePos[0]) ));
- if(radiusAxis > gContext.mRadiusSquareCenter)
- gContext.mRadiusSquareCenter = radiusAxis;
-
- drawList->AddPolyline(circlePos, halfCircleSegmentCount, colors[3 - axis], false, 2);
+ float radiusAxis = sqrtf((ImLengthSqr(worldToPos(gContext.mModel.v.position, gContext.mViewProjection) - circlePos[0])));
+ if (radiusAxis > gContext.mRadiusSquareCenter)
+ {
+ gContext.mRadiusSquareCenter = radiusAxis;
+ }
+ }
+ if(hasRSC && (!gContext.mbUsing || type == MT_ROTATE_SCREEN))
+ {
+ drawList->AddCircle(worldToPos(gContext.mModel.v.position, gContext.mViewProjection), gContext.mRadiusSquareCenter, colors[0], 64, 3.f);
}
- drawList->AddCircle(worldToPos(gContext.mModel.v.position, gContext.mViewProjection), gContext.mRadiusSquareCenter, colors[0], 64, 3.f);
- if (gContext.mbUsing)
+ if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID) && IsRotateType(type))
{
- ImVec2 circlePos[halfCircleSegmentCount +1];
+ ImVec2 circlePos[halfCircleSegmentCount + 1];
circlePos[0] = worldToPos(gContext.mModel.v.position, gContext.mViewProjection);
for (unsigned int i = 1; i < halfCircleSegmentCount; i++)
{
- float ng = gContext.mRotationAngle * ((float)(i-1) / (float)(halfCircleSegmentCount -1));
+ float ng = gContext.mRotationAngle * ((float)(i - 1) / (float)(halfCircleSegmentCount - 1));
matrix_t rotateVectorMatrix;
rotateVectorMatrix.RotationAxis(gContext.mTranslationPlan, ng);
vec_t pos;
pos.TransformPoint(gContext.mRotationVectorSource, rotateVectorMatrix);
- pos *= gContext.mScreenFactor;
+ pos *= gContext.mScreenFactor * rotationDisplayFactor;
circlePos[i] = worldToPos(pos + gContext.mModel.v.position, gContext.mViewProjection);
}
- drawList->AddConvexPolyFilled(circlePos, halfCircleSegmentCount, 0x801080FF);
- drawList->AddPolyline(circlePos, halfCircleSegmentCount, 0xFF1080FF, true, 2);
+ drawList->AddConvexPolyFilled(circlePos, halfCircleSegmentCount, IM_COL32(0xFF, 0x80, 0x10, 0x80));
+ drawList->AddPolyline(circlePos, halfCircleSegmentCount, IM_COL32(0xFF, 0x80, 0x10, 0xFF), true, 2);
ImVec2 destinationPosOnScreen = circlePos[1];
char tmps[512];
- ImFormatString(tmps, sizeof(tmps), rotationInfoMask[type - ROTATE_X], (gContext.mRotationAngle/ZPI)*180.f, gContext.mRotationAngle);
- drawList->AddText(ImVec2(destinationPosOnScreen.x + 15, destinationPosOnScreen.y + 15), 0xFF000000, tmps);
- drawList->AddText(ImVec2(destinationPosOnScreen.x + 14, destinationPosOnScreen.y + 14), 0xFFFFFFFF, tmps);
+ ImFormatString(tmps, sizeof(tmps), rotationInfoMask[type - MT_ROTATE_X], (gContext.mRotationAngle / ZPI) * 180.f, gContext.mRotationAngle);
+ drawList->AddText(ImVec2(destinationPosOnScreen.x + 15, destinationPosOnScreen.y + 15), IM_COL32_BLACK, tmps);
+ drawList->AddText(ImVec2(destinationPosOnScreen.x + 14, destinationPosOnScreen.y + 14), IM_COL32_WHITE, tmps);
}
}
@@ -1015,14 +1275,19 @@ namespace ImGuizmo
{
ImVec2 baseSSpace2 = worldToPos(axis * 0.05f * (float)(j * 2) * gContext.mScreenFactor, gContext.mMVP);
ImVec2 worldDirSSpace2 = worldToPos(axis * 0.05f * (float)(j * 2 + 1) * gContext.mScreenFactor, gContext.mMVP);
- gContext.mDrawList->AddLine(baseSSpace2, worldDirSSpace2, 0x80000000, 6.f);
+ gContext.mDrawList->AddLine(baseSSpace2, worldDirSSpace2, IM_COL32(0, 0, 0, 0x80), 6.f);
}
}
- static void DrawScaleGizmo(int type)
+ static void DrawScaleGizmo(OPERATION op, int type)
{
ImDrawList* drawList = gContext.mDrawList;
+ if(!Intersects(op, SCALE))
+ {
+ return;
+ }
+
// colors
ImU32 colors[7];
ComputeColors(colors, type, SCALE);
@@ -1030,40 +1295,57 @@ namespace ImGuizmo
// draw
vec_t scaleDisplay = { 1.f, 1.f, 1.f, 1.f };
- if (gContext.mbUsing)
+ if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID))
+ {
scaleDisplay = gContext.mScale;
+ }
for (unsigned int i = 0; i < 3; i++)
{
- vec_t dirPlaneX, dirPlaneY, dirAxis;
- bool belowAxisLimit, belowPlaneLimit;
- ComputeTripodAxisAndVisibility(i, dirAxis, dirPlaneX, dirPlaneY, belowAxisLimit, belowPlaneLimit);
-
- // draw axis
- if (belowAxisLimit)
+ if(!Intersects(op, static_cast<OPERATION>(SCALE_X << i)))
{
- ImVec2 baseSSpace = worldToPos(dirAxis * 0.1f * gContext.mScreenFactor, gContext.mMVP);
- ImVec2 worldDirSSpaceNoScale = worldToPos(dirAxis * gContext.mScreenFactor, gContext.mMVP);
- ImVec2 worldDirSSpace = worldToPos((dirAxis * scaleDisplay[i]) * gContext.mScreenFactor, gContext.mMVP);
+ continue;
+ }
+ const bool usingAxis = (gContext.mbUsing && type == MT_SCALE_X + i);
+ if (!gContext.mbUsing || usingAxis)
+ {
+ vec_t dirPlaneX, dirPlaneY, dirAxis;
+ bool belowAxisLimit, belowPlaneLimit;
+ ComputeTripodAxisAndVisibility(i, dirAxis, dirPlaneX, dirPlaneY, belowAxisLimit, belowPlaneLimit, true);
- if (gContext.mbUsing)
+ // draw axis
+ if (belowAxisLimit)
{
- drawList->AddLine(baseSSpace, worldDirSSpaceNoScale, 0xFF404040, 3.f);
- drawList->AddCircleFilled(worldDirSSpaceNoScale, 6.f, 0xFF404040);
- }
+ bool hasTranslateOnAxis = Contains(op, static_cast<OPERATION>(TRANSLATE_X << i));
+ float markerScale = hasTranslateOnAxis ? 1.4f : 1.0f;
+ ImVec2 baseSSpace = worldToPos(dirAxis * 0.1f * gContext.mScreenFactor, gContext.mMVP);
+ ImVec2 worldDirSSpaceNoScale = worldToPos(dirAxis * markerScale * gContext.mScreenFactor, gContext.mMVP);
+ ImVec2 worldDirSSpace = worldToPos((dirAxis * markerScale * scaleDisplay[i]) * gContext.mScreenFactor, gContext.mMVP);
- drawList->AddLine(baseSSpace, worldDirSSpace, colors[i + 1], 3.f);
- drawList->AddCircleFilled(worldDirSSpace, 6.f, colors[i + 1]);
+ if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID))
+ {
+ drawList->AddLine(baseSSpace, worldDirSSpaceNoScale, IM_COL32(0x40, 0x40, 0x40, 0xFF), 3.f);
+ drawList->AddCircleFilled(worldDirSSpaceNoScale, 6.f, IM_COL32(0x40, 0x40, 0x40, 0xFF));
+ }
+
+ if (!hasTranslateOnAxis || gContext.mbUsing)
+ {
+ drawList->AddLine(baseSSpace, worldDirSSpace, colors[i + 1], 3.f);
+ }
+ drawList->AddCircleFilled(worldDirSSpace, 6.f, colors[i + 1]);
- if (gContext.mAxisFactor[i] < 0.f)
- DrawHatchedAxis(dirAxis * scaleDisplay[i]);
+ if (gContext.mAxisFactor[i] < 0.f)
+ {
+ DrawHatchedAxis(dirAxis * scaleDisplay[i]);
+ }
+ }
}
}
// draw screen cirle
drawList->AddCircleFilled(gContext.mScreenSquareCenter, 6.f, colors[0], 32);
- if (gContext.mbUsing)
+ if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID) && IsScaleType(type))
{
//ImVec2 sourcePosOnScreen = worldToPos(gContext.mMatrixOrigin, gContext.mViewProjection);
ImVec2 destinationPosOnScreen = worldToPos(gContext.mModel.v.position, gContext.mViewProjection);
@@ -1076,19 +1358,109 @@ namespace ImGuizmo
*/
char tmps[512];
//vec_t deltaInfo = gContext.mModel.v.position - gContext.mMatrixOrigin;
- int componentInfoIndex = (type - SCALE_X) * 3;
- ImFormatString(tmps, sizeof(tmps), scaleInfoMask[type - SCALE_X], scaleDisplay[translationInfoIndex[componentInfoIndex]]);
- drawList->AddText(ImVec2(destinationPosOnScreen.x + 15, destinationPosOnScreen.y + 15), 0xFF000000, tmps);
- drawList->AddText(ImVec2(destinationPosOnScreen.x + 14, destinationPosOnScreen.y + 14), 0xFFFFFFFF, tmps);
+ int componentInfoIndex = (type - MT_SCALE_X) * 3;
+ ImFormatString(tmps, sizeof(tmps), scaleInfoMask[type - MT_SCALE_X], scaleDisplay[translationInfoIndex[componentInfoIndex]]);
+ drawList->AddText(ImVec2(destinationPosOnScreen.x + 15, destinationPosOnScreen.y + 15), IM_COL32_BLACK, tmps);
+ drawList->AddText(ImVec2(destinationPosOnScreen.x + 14, destinationPosOnScreen.y + 14), IM_COL32_WHITE, tmps);
}
}
- static void DrawTranslationGizmo(int type)
+ static void DrawScaleUniveralGizmo(OPERATION op, int type)
+ {
+ ImDrawList* drawList = gContext.mDrawList;
+
+ if (!Intersects(op, SCALEU))
+ {
+ return;
+ }
+
+ // colors
+ ImU32 colors[7];
+ ComputeColors(colors, type, SCALEU);
+
+ // draw
+ vec_t scaleDisplay = { 1.f, 1.f, 1.f, 1.f };
+
+ if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID))
+ {
+ scaleDisplay = gContext.mScale;
+ }
+
+ for (unsigned int i = 0; i < 3; i++)
+ {
+ if (!Intersects(op, static_cast<OPERATION>(SCALE_XU << i)))
+ {
+ continue;
+ }
+ const bool usingAxis = (gContext.mbUsing && type == MT_SCALE_X + i);
+ if (!gContext.mbUsing || usingAxis)
+ {
+ vec_t dirPlaneX, dirPlaneY, dirAxis;
+ bool belowAxisLimit, belowPlaneLimit;
+ ComputeTripodAxisAndVisibility(i, dirAxis, dirPlaneX, dirPlaneY, belowAxisLimit, belowPlaneLimit, true);
+
+ // draw axis
+ if (belowAxisLimit)
+ {
+ bool hasTranslateOnAxis = Contains(op, static_cast<OPERATION>(TRANSLATE_X << i));
+ float markerScale = hasTranslateOnAxis ? 1.4f : 1.0f;
+ ImVec2 baseSSpace = worldToPos(dirAxis * 0.1f * gContext.mScreenFactor, gContext.mMVPLocal);
+ //ImVec2 worldDirSSpaceNoScale = worldToPos(dirAxis * markerScale * gContext.mScreenFactor, gContext.mMVP);
+ ImVec2 worldDirSSpace = worldToPos((dirAxis * markerScale * scaleDisplay[i]) * gContext.mScreenFactor, gContext.mMVPLocal);
+
+ /*if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID))
+ {
+ drawList->AddLine(baseSSpace, worldDirSSpaceNoScale, IM_COL32(0x40, 0x40, 0x40, 0xFF), 3.f);
+ drawList->AddCircleFilled(worldDirSSpaceNoScale, 6.f, IM_COL32(0x40, 0x40, 0x40, 0xFF));
+ }
+ */
+ /*
+ if (!hasTranslateOnAxis || gContext.mbUsing)
+ {
+ drawList->AddLine(baseSSpace, worldDirSSpace, colors[i + 1], 3.f);
+ }
+ */
+ drawList->AddCircleFilled(worldDirSSpace, 12.f, colors[i + 1]);
+ }
+ }
+ }
+
+ // draw screen cirle
+ drawList->AddCircle(gContext.mScreenSquareCenter, 20.f, colors[0], 32, 3.f);
+
+ if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID) && IsScaleType(type))
+ {
+ //ImVec2 sourcePosOnScreen = worldToPos(gContext.mMatrixOrigin, gContext.mViewProjection);
+ ImVec2 destinationPosOnScreen = worldToPos(gContext.mModel.v.position, gContext.mViewProjection);
+ /*vec_t dif(destinationPosOnScreen.x - sourcePosOnScreen.x, destinationPosOnScreen.y - sourcePosOnScreen.y);
+ dif.Normalize();
+ dif *= 5.f;
+ drawList->AddCircle(sourcePosOnScreen, 6.f, translationLineColor);
+ drawList->AddCircle(destinationPosOnScreen, 6.f, translationLineColor);
+ drawList->AddLine(ImVec2(sourcePosOnScreen.x + dif.x, sourcePosOnScreen.y + dif.y), ImVec2(destinationPosOnScreen.x - dif.x, destinationPosOnScreen.y - dif.y), translationLineColor, 2.f);
+ */
+ char tmps[512];
+ //vec_t deltaInfo = gContext.mModel.v.position - gContext.mMatrixOrigin;
+ int componentInfoIndex = (type - MT_SCALE_X) * 3;
+ ImFormatString(tmps, sizeof(tmps), scaleInfoMask[type - MT_SCALE_X], scaleDisplay[translationInfoIndex[componentInfoIndex]]);
+ drawList->AddText(ImVec2(destinationPosOnScreen.x + 15, destinationPosOnScreen.y + 15), IM_COL32_BLACK, tmps);
+ drawList->AddText(ImVec2(destinationPosOnScreen.x + 14, destinationPosOnScreen.y + 14), IM_COL32_WHITE, tmps);
+ }
+ }
+
+ static void DrawTranslationGizmo(OPERATION op, int type)
{
ImDrawList* drawList = gContext.mDrawList;
if (!drawList)
- return;
+ {
+ return;
+ }
+
+ if(!Intersects(op, TRANSLATE))
+ {
+ return;
+ }
// colors
ImU32 colors[7];
@@ -1104,47 +1476,54 @@ namespace ImGuizmo
vec_t dirPlaneX, dirPlaneY, dirAxis;
ComputeTripodAxisAndVisibility(i, dirAxis, dirPlaneX, dirPlaneY, belowAxisLimit, belowPlaneLimit);
- // draw axis
- if (belowAxisLimit)
+ if (!gContext.mbUsing || (gContext.mbUsing && type == MT_MOVE_X + i))
{
- ImVec2 baseSSpace = worldToPos(dirAxis * 0.1f * gContext.mScreenFactor, gContext.mMVP);
- ImVec2 worldDirSSpace = worldToPos(dirAxis * gContext.mScreenFactor, gContext.mMVP);
+ // draw axis
+ if (belowAxisLimit && Intersects(op, static_cast<OPERATION>(TRANSLATE_X << i)))
+ {
+ ImVec2 baseSSpace = worldToPos(dirAxis * 0.1f * gContext.mScreenFactor, gContext.mMVP);
+ ImVec2 worldDirSSpace = worldToPos(dirAxis * gContext.mScreenFactor, gContext.mMVP);
- drawList->AddLine(baseSSpace, worldDirSSpace, colors[i + 1], 3.f);
+ drawList->AddLine(baseSSpace, worldDirSSpace, colors[i + 1], 3.f);
- // Arrow head begin
- ImVec2 dir(origin - worldDirSSpace);
+ // Arrow head begin
+ ImVec2 dir(origin - worldDirSSpace);
- float d = sqrtf(ImLengthSqr(dir));
- dir /= d; // Normalize
- dir *= 6.0f;
+ float d = sqrtf(ImLengthSqr(dir));
+ dir /= d; // Normalize
+ dir *= 6.0f;
- ImVec2 ortogonalDir(dir.y, -dir.x); // Perpendicular vector
- ImVec2 a(worldDirSSpace + dir);
- drawList->AddTriangleFilled(worldDirSSpace - dir, a + ortogonalDir, a - ortogonalDir, colors[i + 1]);
- // Arrow head end
+ ImVec2 ortogonalDir(dir.y, -dir.x); // Perpendicular vector
+ ImVec2 a(worldDirSSpace + dir);
+ drawList->AddTriangleFilled(worldDirSSpace - dir, a + ortogonalDir, a - ortogonalDir, colors[i + 1]);
+ // Arrow head end
- if (gContext.mAxisFactor[i] < 0.f)
- DrawHatchedAxis(dirAxis);
+ if (gContext.mAxisFactor[i] < 0.f)
+ {
+ DrawHatchedAxis(dirAxis);
+ }
+ }
}
-
// draw plane
- if (belowPlaneLimit)
+ if (!gContext.mbUsing || (gContext.mbUsing && type == MT_MOVE_YZ + i))
{
- ImVec2 screenQuadPts[4];
- for (int j = 0; j < 4; ++j)
+ if (belowPlaneLimit && Contains(op, TRANSLATE_PLANS[i]))
{
- vec_t cornerWorldPos = (dirPlaneX * quadUV[j * 2] + dirPlaneY * quadUV[j * 2 + 1]) * gContext.mScreenFactor;
- screenQuadPts[j] = worldToPos(cornerWorldPos, gContext.mMVP);
+ ImVec2 screenQuadPts[4];
+ for (int j = 0; j < 4; ++j)
+ {
+ vec_t cornerWorldPos = (dirPlaneX * quadUV[j * 2] + dirPlaneY * quadUV[j * 2 + 1]) * gContext.mScreenFactor;
+ screenQuadPts[j] = worldToPos(cornerWorldPos, gContext.mMVP);
+ }
+ drawList->AddPolyline(screenQuadPts, 4, directionColor[i], true, 1.0f);
+ drawList->AddConvexPolyFilled(screenQuadPts, 4, colors[i + 4]);
}
- drawList->AddPolyline(screenQuadPts, 4, directionColor[i], true, 1.0f);
- drawList->AddConvexPolyFilled(screenQuadPts, 4, colors[i + 4]);
}
}
drawList->AddCircleFilled(gContext.mScreenSquareCenter, 6.f, colors[0], 32);
- if (gContext.mbUsing)
+ if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID) && IsTranslateType(type))
{
ImVec2 sourcePosOnScreen = worldToPos(gContext.mMatrixOrigin, gContext.mViewProjection);
ImVec2 destinationPosOnScreen = worldToPos(gContext.mModel.v.position, gContext.mViewProjection);
@@ -1157,402 +1536,513 @@ namespace ImGuizmo
char tmps[512];
vec_t deltaInfo = gContext.mModel.v.position - gContext.mMatrixOrigin;
- int componentInfoIndex = (type - MOVE_X) * 3;
- ImFormatString(tmps, sizeof(tmps), translationInfoMask[type - MOVE_X], deltaInfo[translationInfoIndex[componentInfoIndex]], deltaInfo[translationInfoIndex[componentInfoIndex + 1]], deltaInfo[translationInfoIndex[componentInfoIndex + 2]]);
- drawList->AddText(ImVec2(destinationPosOnScreen.x + 15, destinationPosOnScreen.y + 15), 0xFF000000, tmps);
- drawList->AddText(ImVec2(destinationPosOnScreen.x + 14, destinationPosOnScreen.y + 14), 0xFFFFFFFF, tmps);
+ int componentInfoIndex = (type - MT_MOVE_X) * 3;
+ ImFormatString(tmps, sizeof(tmps), translationInfoMask[type - MT_MOVE_X], deltaInfo[translationInfoIndex[componentInfoIndex]], deltaInfo[translationInfoIndex[componentInfoIndex + 1]], deltaInfo[translationInfoIndex[componentInfoIndex + 2]]);
+ drawList->AddText(ImVec2(destinationPosOnScreen.x + 15, destinationPosOnScreen.y + 15), IM_COL32_BLACK, tmps);
+ drawList->AddText(ImVec2(destinationPosOnScreen.x + 14, destinationPosOnScreen.y + 14), IM_COL32_WHITE, tmps);
}
}
static bool CanActivate()
{
if (ImGui::IsMouseClicked(0) && !ImGui::IsAnyItemHovered() && !ImGui::IsAnyItemActive())
+ {
return true;
+ }
return false;
}
- static void HandleAndDrawLocalBounds(float *bounds, matrix_t *matrix, float *snapValues, OPERATION operation)
- {
- ImGuiIO& io = ImGui::GetIO();
- ImDrawList* drawList = gContext.mDrawList;
-
- // compute best projection axis
- vec_t axesWorldDirections[3];
- vec_t bestAxisWorldDirection = { 0.0f, 0.0f, 0.0f, 0.0f };
- int axes[3];
- unsigned int numAxes = 1;
- axes[0] = gContext.mBoundsBestAxis;
- int bestAxis = axes[0];
- if (!gContext.mbUsingBounds)
- {
- numAxes = 0;
- float bestDot = 0.f;
- for (unsigned int i = 0; i < 3; i++)
- {
- vec_t dirPlaneNormalWorld;
- dirPlaneNormalWorld.TransformVector(directionUnary[i], gContext.mModelSource);
- dirPlaneNormalWorld.Normalize();
-
- float dt = fabsf( Dot(Normalized(gContext.mCameraEye - gContext.mModelSource.v.position), dirPlaneNormalWorld) );
- if ( dt >= bestDot )
- {
- bestDot = dt;
- bestAxis = i;
- bestAxisWorldDirection = dirPlaneNormalWorld;
- }
+ static void HandleAndDrawLocalBounds(const float* bounds, matrix_t* matrix, const float* snapValues, OPERATION operation)
+ {
+ ImGuiIO& io = ImGui::GetIO();
+ ImDrawList* drawList = gContext.mDrawList;
- if( dt >= 0.1f )
- {
- axes[numAxes] = i;
- axesWorldDirections[numAxes] = dirPlaneNormalWorld;
- ++numAxes;
- }
- }
- }
-
- if( numAxes == 0 )
- {
- axes[0] = bestAxis;
- axesWorldDirections[0] = bestAxisWorldDirection;
- numAxes = 1;
- }
- else if( bestAxis != axes[0] )
- {
- unsigned int bestIndex = 0;
- for (unsigned int i = 0; i < numAxes; i++)
- {
- if( axes[i] == bestAxis )
- {
- bestIndex = i;
- break;
- }
- }
- int tempAxis = axes[0];
- axes[0] = axes[bestIndex];
- axes[bestIndex] = tempAxis;
- vec_t tempDirection = axesWorldDirections[0];
- axesWorldDirections[0] = axesWorldDirections[bestIndex];
- axesWorldDirections[bestIndex] = tempDirection;
- }
-
- for (unsigned int axisIndex = 0; axisIndex < numAxes; ++axisIndex)
- {
- bestAxis = axes[axisIndex];
- bestAxisWorldDirection = axesWorldDirections[axisIndex];
-
- // corners
- vec_t aabb[4];
-
- int secondAxis = (bestAxis + 1) % 3;
- int thirdAxis = (bestAxis + 2) % 3;
-
- for (int i = 0; i < 4; i++)
- {
- aabb[i][3] = aabb[i][bestAxis] = 0.f;
- aabb[i][secondAxis] = bounds[secondAxis + 3 * (i >> 1)];
- aabb[i][thirdAxis] = bounds[thirdAxis + 3 * ((i >> 1) ^ (i & 1))];
- }
-
- // draw bounds
- unsigned int anchorAlpha = gContext.mbEnable ? 0xFF000000 : 0x80000000;
-
- matrix_t boundsMVP = gContext.mModelSource * gContext.mViewProjection;
- for (int i = 0; i < 4;i++)
- {
- ImVec2 worldBound1 = worldToPos(aabb[i], boundsMVP);
- ImVec2 worldBound2 = worldToPos(aabb[(i+1)%4], boundsMVP);
- if( !IsInContextRect( worldBound1 ) || !IsInContextRect( worldBound2 ) )
- {
- continue;
- }
- float boundDistance = sqrtf(ImLengthSqr(worldBound1 - worldBound2));
- int stepCount = (int)(boundDistance / 10.f);
- stepCount = min( stepCount, 1000 );
- float stepLength = 1.f / (float)stepCount;
- for (int j = 0; j < stepCount; j++)
- {
- float t1 = (float)j * stepLength;
- float t2 = (float)j * stepLength + stepLength * 0.5f;
- ImVec2 worldBoundSS1 = ImLerp(worldBound1, worldBound2, ImVec2(t1, t1));
- ImVec2 worldBoundSS2 = ImLerp(worldBound1, worldBound2, ImVec2(t2, t2));
- //drawList->AddLine(worldBoundSS1, worldBoundSS2, 0x000000 + anchorAlpha, 3.f);
- drawList->AddLine(worldBoundSS1, worldBoundSS2, 0xAAAAAA + anchorAlpha, 2.f);
- }
- vec_t midPoint = (aabb[i] + aabb[(i + 1) % 4] ) * 0.5f;
- ImVec2 midBound = worldToPos(midPoint, boundsMVP);
- static const float AnchorBigRadius = 8.f;
- static const float AnchorSmallRadius = 6.f;
- bool overBigAnchor = ImLengthSqr(worldBound1 - io.MousePos) <= (AnchorBigRadius*AnchorBigRadius);
- bool overSmallAnchor = ImLengthSqr(midBound - io.MousePos) <= (AnchorBigRadius*AnchorBigRadius);
-
- int type = NONE;
+ // compute best projection axis
+ vec_t axesWorldDirections[3];
+ vec_t bestAxisWorldDirection = { 0.0f, 0.0f, 0.0f, 0.0f };
+ int axes[3];
+ unsigned int numAxes = 1;
+ axes[0] = gContext.mBoundsBestAxis;
+ int bestAxis = axes[0];
+ if (!gContext.mbUsingBounds)
+ {
+ numAxes = 0;
+ float bestDot = 0.f;
+ for (unsigned int i = 0; i < 3; i++)
+ {
+ vec_t dirPlaneNormalWorld;
+ dirPlaneNormalWorld.TransformVector(directionUnary[i], gContext.mModelSource);
+ dirPlaneNormalWorld.Normalize();
+
+ float dt = fabsf(Dot(Normalized(gContext.mCameraEye - gContext.mModelSource.v.position), dirPlaneNormalWorld));
+ if (dt >= bestDot)
+ {
+ bestDot = dt;
+ bestAxis = i;
+ bestAxisWorldDirection = dirPlaneNormalWorld;
+ }
+
+ if (dt >= 0.1f)
+ {
+ axes[numAxes] = i;
+ axesWorldDirections[numAxes] = dirPlaneNormalWorld;
+ ++numAxes;
+ }
+ }
+ }
+
+ if (numAxes == 0)
+ {
+ axes[0] = bestAxis;
+ axesWorldDirections[0] = bestAxisWorldDirection;
+ numAxes = 1;
+ }
+
+ else if (bestAxis != axes[0])
+ {
+ unsigned int bestIndex = 0;
+ for (unsigned int i = 0; i < numAxes; i++)
+ {
+ if (axes[i] == bestAxis)
+ {
+ bestIndex = i;
+ break;
+ }
+ }
+ int tempAxis = axes[0];
+ axes[0] = axes[bestIndex];
+ axes[bestIndex] = tempAxis;
+ vec_t tempDirection = axesWorldDirections[0];
+ axesWorldDirections[0] = axesWorldDirections[bestIndex];
+ axesWorldDirections[bestIndex] = tempDirection;
+ }
+
+ for (unsigned int axisIndex = 0; axisIndex < numAxes; ++axisIndex)
+ {
+ bestAxis = axes[axisIndex];
+ bestAxisWorldDirection = axesWorldDirections[axisIndex];
+
+ // corners
+ vec_t aabb[4];
+
+ int secondAxis = (bestAxis + 1) % 3;
+ int thirdAxis = (bestAxis + 2) % 3;
+
+ for (int i = 0; i < 4; i++)
+ {
+ aabb[i][3] = aabb[i][bestAxis] = 0.f;
+ aabb[i][secondAxis] = bounds[secondAxis + 3 * (i >> 1)];
+ aabb[i][thirdAxis] = bounds[thirdAxis + 3 * ((i >> 1) ^ (i & 1))];
+ }
+
+ // draw bounds
+ unsigned int anchorAlpha = gContext.mbEnable ? IM_COL32_BLACK : IM_COL32(0, 0, 0, 0x80);
+
+ matrix_t boundsMVP = gContext.mModelSource * gContext.mViewProjection;
+ for (int i = 0; i < 4; i++)
+ {
+ ImVec2 worldBound1 = worldToPos(aabb[i], boundsMVP);
+ ImVec2 worldBound2 = worldToPos(aabb[(i + 1) % 4], boundsMVP);
+ if (!IsInContextRect(worldBound1) || !IsInContextRect(worldBound2))
+ {
+ continue;
+ }
+ float boundDistance = sqrtf(ImLengthSqr(worldBound1 - worldBound2));
+ int stepCount = (int)(boundDistance / 10.f);
+ stepCount = min(stepCount, 1000);
+ float stepLength = 1.f / (float)stepCount;
+ for (int j = 0; j < stepCount; j++)
+ {
+ float t1 = (float)j * stepLength;
+ float t2 = (float)j * stepLength + stepLength * 0.5f;
+ ImVec2 worldBoundSS1 = ImLerp(worldBound1, worldBound2, ImVec2(t1, t1));
+ ImVec2 worldBoundSS2 = ImLerp(worldBound1, worldBound2, ImVec2(t2, t2));
+ //drawList->AddLine(worldBoundSS1, worldBoundSS2, IM_COL32(0, 0, 0, 0) + anchorAlpha, 3.f);
+ drawList->AddLine(worldBoundSS1, worldBoundSS2, IM_COL32(0xAA, 0xAA, 0xAA, 0) + anchorAlpha, 2.f);
+ }
+ vec_t midPoint = (aabb[i] + aabb[(i + 1) % 4]) * 0.5f;
+ ImVec2 midBound = worldToPos(midPoint, boundsMVP);
+ static const float AnchorBigRadius = 8.f;
+ static const float AnchorSmallRadius = 6.f;
+ bool overBigAnchor = ImLengthSqr(worldBound1 - io.MousePos) <= (AnchorBigRadius * AnchorBigRadius);
+ bool overSmallAnchor = ImLengthSqr(midBound - io.MousePos) <= (AnchorBigRadius * AnchorBigRadius);
+
+ int type = MT_NONE;
vec_t gizmoHitProportion;
- switch (operation)
+ if(Intersects(operation, TRANSLATE))
+ {
+ type = GetMoveType(operation, &gizmoHitProportion);
+ }
+ if(Intersects(operation, ROTATE) && type == MT_NONE)
{
- case TRANSLATE: type = GetMoveType(&gizmoHitProportion); break;
- case ROTATE: type = GetRotateType(); break;
- case SCALE: type = GetScaleType(); break;
- case BOUNDS: break;
+ type = GetRotateType(operation);
}
- if (type != NONE)
+ if(Intersects(operation, SCALE) && type == MT_NONE)
+ {
+ type = GetScaleType(operation);
+ }
+
+ if (type != MT_NONE)
{
overBigAnchor = false;
overSmallAnchor = false;
}
+ unsigned int bigAnchorColor = overBigAnchor ? selectionColor : (IM_COL32(0xAA, 0xAA, 0xAA, 0) + anchorAlpha);
+ unsigned int smallAnchorColor = overSmallAnchor ? selectionColor : (IM_COL32(0xAA, 0xAA, 0xAA, 0) + anchorAlpha);
+
+ drawList->AddCircleFilled(worldBound1, AnchorBigRadius, IM_COL32_BLACK);
+ drawList->AddCircleFilled(worldBound1, AnchorBigRadius - 1.2f, bigAnchorColor);
+
+ drawList->AddCircleFilled(midBound, AnchorSmallRadius, IM_COL32_BLACK);
+ drawList->AddCircleFilled(midBound, AnchorSmallRadius - 1.2f, smallAnchorColor);
+ int oppositeIndex = (i + 2) % 4;
+ // big anchor on corners
+ if (!gContext.mbUsingBounds && gContext.mbEnable && overBigAnchor && CanActivate())
+ {
+ gContext.mBoundsPivot.TransformPoint(aabb[(i + 2) % 4], gContext.mModelSource);
+ gContext.mBoundsAnchor.TransformPoint(aabb[i], gContext.mModelSource);
+ gContext.mBoundsPlan = BuildPlan(gContext.mBoundsAnchor, bestAxisWorldDirection);
+ gContext.mBoundsBestAxis = bestAxis;
+ gContext.mBoundsAxis[0] = secondAxis;
+ gContext.mBoundsAxis[1] = thirdAxis;
+
+ gContext.mBoundsLocalPivot.Set(0.f);
+ gContext.mBoundsLocalPivot[secondAxis] = aabb[oppositeIndex][secondAxis];
+ gContext.mBoundsLocalPivot[thirdAxis] = aabb[oppositeIndex][thirdAxis];
+
+ gContext.mbUsingBounds = true;
+ gContext.mEditingID = gContext.mActualID;
+ gContext.mBoundsMatrix = gContext.mModelSource;
+ }
+ // small anchor on middle of segment
+ if (!gContext.mbUsingBounds && gContext.mbEnable && overSmallAnchor && CanActivate())
+ {
+ vec_t midPointOpposite = (aabb[(i + 2) % 4] + aabb[(i + 3) % 4]) * 0.5f;
+ gContext.mBoundsPivot.TransformPoint(midPointOpposite, gContext.mModelSource);
+ gContext.mBoundsAnchor.TransformPoint(midPoint, gContext.mModelSource);
+ gContext.mBoundsPlan = BuildPlan(gContext.mBoundsAnchor, bestAxisWorldDirection);
+ gContext.mBoundsBestAxis = bestAxis;
+ int indices[] = { secondAxis , thirdAxis };
+ gContext.mBoundsAxis[0] = indices[i % 2];
+ gContext.mBoundsAxis[1] = -1;
+
+ gContext.mBoundsLocalPivot.Set(0.f);
+ gContext.mBoundsLocalPivot[gContext.mBoundsAxis[0]] = aabb[oppositeIndex][indices[i % 2]];// bounds[gContext.mBoundsAxis[0]] * (((i + 1) & 2) ? 1.f : -1.f);
+
+ gContext.mbUsingBounds = true;
+ gContext.mEditingID = gContext.mActualID;
+ gContext.mBoundsMatrix = gContext.mModelSource;
+ }
+ }
+
+ if (gContext.mbUsingBounds && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID))
+ {
+ matrix_t scale;
+ scale.SetToIdentity();
- unsigned int bigAnchorColor = overBigAnchor ? selectionColor : (0xAAAAAA + anchorAlpha);
- unsigned int smallAnchorColor = overSmallAnchor ? selectionColor : (0xAAAAAA + anchorAlpha);
+ // compute projected mouse position on plan
+ const float len = IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, gContext.mBoundsPlan);
+ vec_t newPos = gContext.mRayOrigin + gContext.mRayVector * len;
- drawList->AddCircleFilled(worldBound1, AnchorBigRadius, 0xFF000000);
- drawList->AddCircleFilled(worldBound1, AnchorBigRadius-1.2f, bigAnchorColor);
+ // compute a reference and delta vectors base on mouse move
+ vec_t deltaVector = (newPos - gContext.mBoundsPivot).Abs();
+ vec_t referenceVector = (gContext.mBoundsAnchor - gContext.mBoundsPivot).Abs();
- drawList->AddCircleFilled(midBound, AnchorSmallRadius, 0xFF000000);
- drawList->AddCircleFilled(midBound, AnchorSmallRadius-1.2f, smallAnchorColor);
- int oppositeIndex = (i + 2) % 4;
- // big anchor on corners
- if (!gContext.mbUsingBounds && gContext.mbEnable && overBigAnchor && CanActivate())
- {
- gContext.mBoundsPivot.TransformPoint(aabb[(i + 2) % 4], gContext.mModelSource);
- gContext.mBoundsAnchor.TransformPoint(aabb[i], gContext.mModelSource);
- gContext.mBoundsPlan = BuildPlan(gContext.mBoundsAnchor, bestAxisWorldDirection);
- gContext.mBoundsBestAxis = bestAxis;
- gContext.mBoundsAxis[0] = secondAxis;
- gContext.mBoundsAxis[1] = thirdAxis;
-
- gContext.mBoundsLocalPivot.Set(0.f);
- gContext.mBoundsLocalPivot[secondAxis] = aabb[oppositeIndex][secondAxis];
- gContext.mBoundsLocalPivot[thirdAxis] = aabb[oppositeIndex][thirdAxis];
-
- gContext.mbUsingBounds = true;
- gContext.mBoundsMatrix = gContext.mModelSource;
- }
- // small anchor on middle of segment
- if (!gContext.mbUsingBounds && gContext.mbEnable && overSmallAnchor && CanActivate())
+ // for 1 or 2 axes, compute a ratio that's used for scale and snap it based on resulting length
+ for (int i = 0; i < 2; i++)
+ {
+ int axisIndex1 = gContext.mBoundsAxis[i];
+ if (axisIndex1 == -1)
{
- vec_t midPointOpposite = (aabb[(i + 2) % 4] + aabb[(i + 3) % 4]) * 0.5f;
- gContext.mBoundsPivot.TransformPoint(midPointOpposite, gContext.mModelSource);
- gContext.mBoundsAnchor.TransformPoint(midPoint, gContext.mModelSource);
- gContext.mBoundsPlan = BuildPlan(gContext.mBoundsAnchor, bestAxisWorldDirection);
- gContext.mBoundsBestAxis = bestAxis;
- int indices[] = { secondAxis , thirdAxis };
- gContext.mBoundsAxis[0] = indices[i%2];
- gContext.mBoundsAxis[1] = -1;
-
- gContext.mBoundsLocalPivot.Set(0.f);
- gContext.mBoundsLocalPivot[gContext.mBoundsAxis[0]] = aabb[oppositeIndex][indices[i % 2]];// bounds[gContext.mBoundsAxis[0]] * (((i + 1) & 2) ? 1.f : -1.f);
-
- gContext.mbUsingBounds = true;
- gContext.mBoundsMatrix = gContext.mModelSource;
+ continue;
}
- }
-
- if (gContext.mbUsingBounds)
- {
- matrix_t scale;
- scale.SetToIdentity();
-
- // compute projected mouse position on plan
- const float len = IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, gContext.mBoundsPlan);
- vec_t newPos = gContext.mRayOrigin + gContext.mRayVector * len;
- // compute a reference and delta vectors base on mouse move
- vec_t deltaVector = (newPos - gContext.mBoundsPivot).Abs();
- vec_t referenceVector = (gContext.mBoundsAnchor - gContext.mBoundsPivot).Abs();
+ float ratioAxis = 1.f;
+ vec_t axisDir = gContext.mBoundsMatrix.component[axisIndex1].Abs();
- // for 1 or 2 axes, compute a ratio that's used for scale and snap it based on resulting length
- for (int i = 0; i < 2; i++)
+ float dtAxis = axisDir.Dot(referenceVector);
+ float boundSize = bounds[axisIndex1 + 3] - bounds[axisIndex1];
+ if (dtAxis > FLT_EPSILON)
{
- int axisIndex1 = gContext.mBoundsAxis[i];
- if (axisIndex1 == -1)
- continue;
-
- float ratioAxis = 1.f;
- vec_t axisDir = gContext.mBoundsMatrix.component[axisIndex1].Abs();
-
- float dtAxis = axisDir.Dot(referenceVector);
- float boundSize = bounds[axisIndex1 + 3] - bounds[axisIndex1];
- if (dtAxis > FLT_EPSILON)
- ratioAxis = axisDir.Dot(deltaVector) / dtAxis;
-
- if (snapValues)
- {
- float length = boundSize * ratioAxis;
- ComputeSnap(&length, snapValues[axisIndex1]);
- if (boundSize > FLT_EPSILON)
- ratioAxis = length / boundSize;
- }
- scale.component[axisIndex1] *= ratioAxis;
+ ratioAxis = axisDir.Dot(deltaVector) / dtAxis;
}
- // transform matrix
- matrix_t preScale, postScale;
- preScale.Translation(-gContext.mBoundsLocalPivot);
- postScale.Translation(gContext.mBoundsLocalPivot);
- matrix_t res = preScale * scale * postScale * gContext.mBoundsMatrix;
- *matrix = res;
-
- // info text
- char tmps[512];
- ImVec2 destinationPosOnScreen = worldToPos(gContext.mModel.v.position, gContext.mViewProjection);
- ImFormatString(tmps, sizeof(tmps), "X: %.2f Y: %.2f Z:%.2f"
- , (bounds[3] - bounds[0]) * gContext.mBoundsMatrix.component[0].Length() * scale.component[0].Length()
- , (bounds[4] - bounds[1]) * gContext.mBoundsMatrix.component[1].Length() * scale.component[1].Length()
- , (bounds[5] - bounds[2]) * gContext.mBoundsMatrix.component[2].Length() * scale.component[2].Length()
- );
- drawList->AddText(ImVec2(destinationPosOnScreen.x + 15, destinationPosOnScreen.y + 15), 0xFF000000, tmps);
- drawList->AddText(ImVec2(destinationPosOnScreen.x + 14, destinationPosOnScreen.y + 14), 0xFFFFFFFF, tmps);
+ if (snapValues)
+ {
+ float length = boundSize * ratioAxis;
+ ComputeSnap(&length, snapValues[axisIndex1]);
+ if (boundSize > FLT_EPSILON)
+ {
+ ratioAxis = length / boundSize;
+ }
+ }
+ scale.component[axisIndex1] *= ratioAxis;
}
- if (!io.MouseDown[0])
- gContext.mbUsingBounds = false;
+ // transform matrix
+ matrix_t preScale, postScale;
+ preScale.Translation(-gContext.mBoundsLocalPivot);
+ postScale.Translation(gContext.mBoundsLocalPivot);
+ matrix_t res = preScale * scale * postScale * gContext.mBoundsMatrix;
+ *matrix = res;
+
+ // info text
+ char tmps[512];
+ ImVec2 destinationPosOnScreen = worldToPos(gContext.mModel.v.position, gContext.mViewProjection);
+ ImFormatString(tmps, sizeof(tmps), "X: %.2f Y: %.2f Z:%.2f"
+ , (bounds[3] - bounds[0]) * gContext.mBoundsMatrix.component[0].Length() * scale.component[0].Length()
+ , (bounds[4] - bounds[1]) * gContext.mBoundsMatrix.component[1].Length() * scale.component[1].Length()
+ , (bounds[5] - bounds[2]) * gContext.mBoundsMatrix.component[2].Length() * scale.component[2].Length()
+ );
+ drawList->AddText(ImVec2(destinationPosOnScreen.x + 15, destinationPosOnScreen.y + 15), IM_COL32_BLACK, tmps);
+ drawList->AddText(ImVec2(destinationPosOnScreen.x + 14, destinationPosOnScreen.y + 14), IM_COL32_WHITE, tmps);
+ }
- if( gContext.mbUsingBounds )
- break;
- }
+ if (!io.MouseDown[0]) {
+ gContext.mbUsingBounds = false;
+ gContext.mEditingID = -1;
+ }
+ if (gContext.mbUsingBounds)
+ {
+ break;
+ }
+ }
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
- static int GetScaleType()
+ static int GetScaleType(OPERATION op)
{
+ if (gContext.mbUsing)
+ {
+ return MT_NONE;
+ }
ImGuiIO& io = ImGui::GetIO();
- int type = NONE;
+ int type = MT_NONE;
// screen
if (io.MousePos.x >= gContext.mScreenSquareMin.x && io.MousePos.x <= gContext.mScreenSquareMax.x &&
- io.MousePos.y >= gContext.mScreenSquareMin.y && io.MousePos.y <= gContext.mScreenSquareMax.y)
- type = SCALE_XYZ;
+ io.MousePos.y >= gContext.mScreenSquareMin.y && io.MousePos.y <= gContext.mScreenSquareMax.y &&
+ Contains(op, SCALE))
+ {
+ type = MT_SCALE_XYZ;
+ }
// compute
- for (unsigned int i = 0; i < 3 && type == NONE; i++)
+ for (unsigned int i = 0; i < 3 && type == MT_NONE; i++)
{
+ if(!Intersects(op, static_cast<OPERATION>(SCALE_X << i)))
+ {
+ continue;
+ }
vec_t dirPlaneX, dirPlaneY, dirAxis;
bool belowAxisLimit, belowPlaneLimit;
- ComputeTripodAxisAndVisibility(i, dirAxis, dirPlaneX, dirPlaneY, belowAxisLimit, belowPlaneLimit);
+ ComputeTripodAxisAndVisibility(i, dirAxis, dirPlaneX, dirPlaneY, belowAxisLimit, belowPlaneLimit, true);
+ dirAxis.TransformVector(gContext.mModelLocal);
+ dirPlaneX.TransformVector(gContext.mModelLocal);
+ dirPlaneY.TransformVector(gContext.mModelLocal);
- dirAxis.TransformVector(gContext.mModel);
- const float len = IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, BuildPlan(gContext.mModel.v.position, dirAxis));
- vec_t posOnPlan = gContext.mRayOrigin + gContext.mRayVector * len;
+ const float len = IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, BuildPlan(gContext.mModelLocal.v.position, dirAxis));
+ vec_t posOnPlan = gContext.mRayOrigin + gContext.mRayVector * len;
+
+ const float startOffset = Contains(op, static_cast<OPERATION>(TRANSLATE_X << i)) ? 1.0f : 0.1f;
+ const float endOffset = Contains(op, static_cast<OPERATION>(TRANSLATE_X << i)) ? 1.4f : 1.0f;
+ const ImVec2 posOnPlanScreen = worldToPos(posOnPlan, gContext.mViewProjection);
+ const ImVec2 axisStartOnScreen = worldToPos(gContext.mModelLocal.v.position + dirAxis * gContext.mScreenFactor * startOffset, gContext.mViewProjection);
+ const ImVec2 axisEndOnScreen = worldToPos(gContext.mModelLocal.v.position + dirAxis * gContext.mScreenFactor * endOffset, gContext.mViewProjection);
+
+ vec_t closestPointOnAxis = PointOnSegment(makeVect(posOnPlanScreen), makeVect(axisStartOnScreen), makeVect(axisEndOnScreen));
+
+ if ((closestPointOnAxis - makeVect(posOnPlanScreen)).Length() < 12.f) // pixel size
+ {
+ type = MT_SCALE_X + i;
+ }
+ }
- const ImVec2 posOnPlanScreen = worldToPos(posOnPlan, gContext.mViewProjection);
- const ImVec2 axisStartOnScreen = worldToPos(gContext.mModel.v.position + dirAxis * gContext.mScreenFactor * 0.1f, gContext.mViewProjection);
- const ImVec2 axisEndOnScreen = worldToPos(gContext.mModel.v.position + dirAxis * gContext.mScreenFactor, gContext.mViewProjection);
+ // universal
+
+ vec_t deltaScreen = { io.MousePos.x - gContext.mScreenSquareCenter.x, io.MousePos.y - gContext.mScreenSquareCenter.y, 0.f, 0.f };
+ float dist = deltaScreen.Length();
+ if (Contains(op, SCALEU) && dist >= 17.0f && dist < 23.0f)
+ {
+ type = MT_SCALE_XYZ;
+ }
+
+ for (unsigned int i = 0; i < 3 && type == MT_NONE; i++)
+ {
+ if (!Intersects(op, static_cast<OPERATION>(SCALE_XU << i)))
+ {
+ continue;
+ }
- vec_t closestPointOnAxis = PointOnSegment(makeVect(posOnPlanScreen), makeVect(axisStartOnScreen), makeVect(axisEndOnScreen));
+ vec_t dirPlaneX, dirPlaneY, dirAxis;
+ bool belowAxisLimit, belowPlaneLimit;
+ ComputeTripodAxisAndVisibility(i, dirAxis, dirPlaneX, dirPlaneY, belowAxisLimit, belowPlaneLimit, true);
- if ((closestPointOnAxis - makeVect(posOnPlanScreen)).Length() < 12.f) // pixel size
- type = SCALE_X + i;
+ // draw axis
+ if (belowAxisLimit)
+ {
+ bool hasTranslateOnAxis = Contains(op, static_cast<OPERATION>(TRANSLATE_X << i));
+ float markerScale = hasTranslateOnAxis ? 1.4f : 1.0f;
+ ImVec2 baseSSpace = worldToPos(dirAxis * 0.1f * gContext.mScreenFactor, gContext.mMVPLocal);
+ //ImVec2 worldDirSSpaceNoScale = worldToPos(dirAxis * markerScale * gContext.mScreenFactor, gContext.mMVP);
+ ImVec2 worldDirSSpace = worldToPos((dirAxis * markerScale) * gContext.mScreenFactor, gContext.mMVPLocal);
+
+ float distance = sqrtf(ImLengthSqr(worldDirSSpace - io.MousePos));
+ if (distance < 12.f)
+ {
+ type = MT_SCALE_X + i;
+ }
+ }
}
return type;
}
- static int GetRotateType()
+ static int GetRotateType(OPERATION op)
{
+ if (gContext.mbUsing)
+ {
+ return MT_NONE;
+ }
ImGuiIO& io = ImGui::GetIO();
- int type = NONE;
+ int type = MT_NONE;
vec_t deltaScreen = { io.MousePos.x - gContext.mScreenSquareCenter.x, io.MousePos.y - gContext.mScreenSquareCenter.y, 0.f, 0.f };
float dist = deltaScreen.Length();
- if (dist >= (gContext.mRadiusSquareCenter - 1.0f) && dist < (gContext.mRadiusSquareCenter + 1.0f))
- type = ROTATE_SCREEN;
+ if (Intersects(op, ROTATE_SCREEN) && dist >= (gContext.mRadiusSquareCenter - 4.0f) && dist < (gContext.mRadiusSquareCenter + 4.0f))
+ {
+ type = MT_ROTATE_SCREEN;
+ }
- const vec_t planNormals[] = { gContext.mModel.v.right, gContext.mModel.v.up, gContext.mModel.v.dir};
+ const vec_t planNormals[] = { gContext.mModel.v.right, gContext.mModel.v.up, gContext.mModel.v.dir };
- for (unsigned int i = 0; i < 3 && type == NONE; i++)
+ vec_t modelViewPos;
+ modelViewPos.TransformPoint(gContext.mModel.v.position, gContext.mViewMat);
+
+ for (unsigned int i = 0; i < 3 && type == MT_NONE; i++)
{
+ if(!Intersects(op, static_cast<OPERATION>(ROTATE_X << i)))
+ {
+ continue;
+ }
// pickup plan
vec_t pickupPlan = BuildPlan(gContext.mModel.v.position, planNormals[i]);
const float len = IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, pickupPlan);
- vec_t localPos = gContext.mRayOrigin + gContext.mRayVector * len - gContext.mModel.v.position;
+ const vec_t intersectWorldPos = gContext.mRayOrigin + gContext.mRayVector * len;
+ vec_t intersectViewPos;
+ intersectViewPos.TransformPoint(intersectWorldPos, gContext.mViewMat);
- if (Dot(Normalized(localPos), gContext.mRayVector) > FLT_EPSILON)
+ if (ImAbs(modelViewPos.z) - ImAbs(intersectViewPos.z) < -FLT_EPSILON)
+ {
continue;
- vec_t idealPosOnCircle = Normalized(localPos);
- idealPosOnCircle.TransformVector(gContext.mModelInverse);
- ImVec2 idealPosOnCircleScreen = worldToPos(idealPosOnCircle * gContext.mScreenFactor, gContext.mMVP);
+ }
+
+ const vec_t localPos = intersectWorldPos - gContext.mModel.v.position;
+ vec_t idealPosOnCircle = Normalized(localPos);
+ idealPosOnCircle.TransformVector(gContext.mModelInverse);
+ const ImVec2 idealPosOnCircleScreen = worldToPos(idealPosOnCircle * rotationDisplayFactor * gContext.mScreenFactor, gContext.mMVP);
- //gContext.mDrawList->AddCircle(idealPosOnCircleScreen, 5.f, 0xFFFFFFFF);
- ImVec2 distanceOnScreen = idealPosOnCircleScreen - io.MousePos;
+ //gContext.mDrawList->AddCircle(idealPosOnCircleScreen, 5.f, IM_COL32_WHITE);
+ const ImVec2 distanceOnScreen = idealPosOnCircleScreen - io.MousePos;
- float distance = makeVect(distanceOnScreen).Length();
+ const float distance = makeVect(distanceOnScreen).Length();
if (distance < 8.f) // pixel size
- type = ROTATE_X + i;
+ {
+ type = MT_ROTATE_X + i;
+ }
}
return type;
}
- static int GetMoveType(vec_t *gizmoHitProportion)
+ static int GetMoveType(OPERATION op, vec_t* gizmoHitProportion)
{
+ if(!Intersects(op, TRANSLATE) || gContext.mbUsing)
+ {
+ return MT_NONE;
+ }
ImGuiIO& io = ImGui::GetIO();
- int type = NONE;
+ int type = MT_NONE;
// screen
if (io.MousePos.x >= gContext.mScreenSquareMin.x && io.MousePos.x <= gContext.mScreenSquareMax.x &&
- io.MousePos.y >= gContext.mScreenSquareMin.y && io.MousePos.y <= gContext.mScreenSquareMax.y)
- type = MOVE_SCREEN;
+ io.MousePos.y >= gContext.mScreenSquareMin.y && io.MousePos.y <= gContext.mScreenSquareMax.y &&
+ Contains(op, TRANSLATE))
+ {
+ type = MT_MOVE_SCREEN;
+ }
+
+ const vec_t screenCoord = makeVect(io.MousePos - ImVec2(gContext.mX, gContext.mY));
// compute
- for (unsigned int i = 0; i < 3 && type == NONE; i++)
+ for (unsigned int i = 0; i < 3 && type == MT_NONE; i++)
{
vec_t dirPlaneX, dirPlaneY, dirAxis;
bool belowAxisLimit, belowPlaneLimit;
ComputeTripodAxisAndVisibility(i, dirAxis, dirPlaneX, dirPlaneY, belowAxisLimit, belowPlaneLimit);
- dirAxis.TransformVector(gContext.mModel);
+ dirAxis.TransformVector(gContext.mModel);
dirPlaneX.TransformVector(gContext.mModel);
dirPlaneY.TransformVector(gContext.mModel);
const float len = IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, BuildPlan(gContext.mModel.v.position, dirAxis));
vec_t posOnPlan = gContext.mRayOrigin + gContext.mRayVector * len;
- const ImVec2 posOnPlanScreen = worldToPos(posOnPlan, gContext.mViewProjection);
- const ImVec2 axisStartOnScreen = worldToPos(gContext.mModel.v.position + dirAxis * gContext.mScreenFactor * 0.1f, gContext.mViewProjection);
- const ImVec2 axisEndOnScreen = worldToPos(gContext.mModel.v.position + dirAxis * gContext.mScreenFactor, gContext.mViewProjection);
-
- vec_t closestPointOnAxis = PointOnSegment(makeVect(posOnPlanScreen), makeVect(axisStartOnScreen), makeVect(axisEndOnScreen));
+ const ImVec2 axisStartOnScreen = worldToPos(gContext.mModel.v.position + dirAxis * gContext.mScreenFactor * 0.1f, gContext.mViewProjection) - ImVec2(gContext.mX, gContext.mY);
+ const ImVec2 axisEndOnScreen = worldToPos(gContext.mModel.v.position + dirAxis * gContext.mScreenFactor, gContext.mViewProjection) - ImVec2(gContext.mX, gContext.mY);
- if ((closestPointOnAxis - makeVect(posOnPlanScreen)).Length() < 12.f) // pixel size
- type = MOVE_X + i;
+ vec_t closestPointOnAxis = PointOnSegment(screenCoord, makeVect(axisStartOnScreen), makeVect(axisEndOnScreen));
+ if ((closestPointOnAxis - screenCoord).Length() < 12.f && Intersects(op, static_cast<OPERATION>(TRANSLATE_X << i))) // pixel size
+ {
+ type = MT_MOVE_X + i;
+ }
- const float dx = dirPlaneX.Dot3((posOnPlan - gContext.mModel.v.position) * (1.f / gContext.mScreenFactor));
- const float dy = dirPlaneY.Dot3((posOnPlan - gContext.mModel.v.position) * (1.f / gContext.mScreenFactor));
- if (belowPlaneLimit && dx >= quadUV[0] && dx <= quadUV[4] && dy >= quadUV[1] && dy <= quadUV[3])
- type = MOVE_YZ + i;
+ const float dx = dirPlaneX.Dot3((posOnPlan - gContext.mModel.v.position) * (1.f / gContext.mScreenFactor));
+ const float dy = dirPlaneY.Dot3((posOnPlan - gContext.mModel.v.position) * (1.f / gContext.mScreenFactor));
+ if (belowPlaneLimit && dx >= quadUV[0] && dx <= quadUV[4] && dy >= quadUV[1] && dy <= quadUV[3] && Contains(op, TRANSLATE_PLANS[i]))
+ {
+ type = MT_MOVE_YZ + i;
+ }
if (gizmoHitProportion)
+ {
*gizmoHitProportion = makeVect(dx, dy, 0.f);
+ }
}
return type;
}
- static void HandleTranslation(float *matrix, float *deltaMatrix, int& type, float *snap)
+ static bool HandleTranslation(float* matrix, float* deltaMatrix, OPERATION op, int& type, const float* snap)
{
- ImGuiIO& io = ImGui::GetIO();
- bool applyRotationLocaly = gContext.mMode == LOCAL || type == MOVE_SCREEN;
+ if(!Intersects(op, TRANSLATE) || type != MT_NONE)
+ {
+ return false;
+ }
+ const ImGuiIO& io = ImGui::GetIO();
+ const bool applyRotationLocaly = gContext.mMode == LOCAL || type == MT_MOVE_SCREEN;
+ bool modified = false;
// move
- if (gContext.mbUsing)
+ if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID) && IsTranslateType(gContext.mCurrentOperation))
{
- ImGui::CaptureMouseFromApp();
- const float len = fabsf(IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, gContext.mTranslationPlan)); // near plan
- vec_t newPos = gContext.mRayOrigin + gContext.mRayVector * len;
-
-
+ ImGui::SetNextFrameWantCaptureMouse(true);
+ const float signedLength = IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, gContext.mTranslationPlan);
+ const float len = fabsf(signedLength); // near plan
+ const vec_t newPos = gContext.mRayOrigin + gContext.mRayVector * len;
// compute delta
- vec_t newOrigin = newPos - gContext.mRelativeOrigin * gContext.mScreenFactor;
+ const vec_t newOrigin = newPos - gContext.mRelativeOrigin * gContext.mScreenFactor;
vec_t delta = newOrigin - gContext.mModel.v.position;
// 1 axis constraint
- if (gContext.mCurrentOperation >= MOVE_X && gContext.mCurrentOperation <= MOVE_Z)
+ if (gContext.mCurrentOperation >= MT_MOVE_X && gContext.mCurrentOperation <= MT_MOVE_Z)
{
- int axisIndex = gContext.mCurrentOperation - MOVE_X;
+ const int axisIndex = gContext.mCurrentOperation - MT_MOVE_X;
const vec_t& axisValue = *(vec_t*)&gContext.mModel.m[axisIndex];
- float lengthOnAxis = Dot(axisValue, delta);
+ const float lengthOnAxis = Dot(axisValue, delta);
delta = axisValue * lengthOnAxis;
}
@@ -1578,18 +2068,27 @@ namespace ImGuizmo
}
+ if (delta != gContext.mTranslationLastDelta)
+ {
+ modified = true;
+ }
+ gContext.mTranslationLastDelta = delta;
+
// compute matrix & delta
matrix_t deltaMatrixTranslation;
deltaMatrixTranslation.Translation(delta);
if (deltaMatrix)
+ {
memcpy(deltaMatrix, deltaMatrixTranslation.m16, sizeof(float) * 16);
+ }
-
- matrix_t res = gContext.mModelSource * deltaMatrixTranslation;
+ const matrix_t res = gContext.mModelSource * deltaMatrixTranslation;
*(matrix_t*)matrix = res;
if (!io.MouseDown[0])
+ {
gContext.mbUsing = false;
+ }
type = gContext.mCurrentOperation;
}
@@ -1597,28 +2096,29 @@ namespace ImGuizmo
{
// find new possible way to move
vec_t gizmoHitProportion;
- type = GetMoveType(&gizmoHitProportion);
- if(type != NONE)
- {
- ImGui::CaptureMouseFromApp();
- }
- if (CanActivate() && type != NONE)
- {
- gContext.mbUsing = true;
- gContext.mCurrentOperation = type;
- vec_t movePlanNormal[] = { gContext.mModel.v.right, gContext.mModel.v.up, gContext.mModel.v.dir,
- gContext.mModel.v.right, gContext.mModel.v.up, gContext.mModel.v.dir,
- -gContext.mCameraDir };
-
- vec_t cameraToModelNormalized = Normalized(gContext.mModel.v.position - gContext.mCameraEye);
- for (unsigned int i = 0; i < 3; i++)
- {
- vec_t orthoVector = Cross(movePlanNormal[i], cameraToModelNormalized);
- movePlanNormal[i].Cross(orthoVector);
- movePlanNormal[i].Normalize();
- }
+ type = GetMoveType(op, &gizmoHitProportion);
+ if (type != MT_NONE)
+ {
+ ImGui::SetNextFrameWantCaptureMouse(true);
+ }
+ if (CanActivate() && type != MT_NONE)
+ {
+ gContext.mbUsing = true;
+ gContext.mEditingID = gContext.mActualID;
+ gContext.mCurrentOperation = type;
+ vec_t movePlanNormal[] = { gContext.mModel.v.right, gContext.mModel.v.up, gContext.mModel.v.dir,
+ gContext.mModel.v.right, gContext.mModel.v.up, gContext.mModel.v.dir,
+ -gContext.mCameraDir };
+
+ vec_t cameraToModelNormalized = Normalized(gContext.mModel.v.position - gContext.mCameraEye);
+ for (unsigned int i = 0; i < 3; i++)
+ {
+ vec_t orthoVector = Cross(movePlanNormal[i], cameraToModelNormalized);
+ movePlanNormal[i].Cross(orthoVector);
+ movePlanNormal[i].Normalize();
+ }
// pickup plan
- gContext.mTranslationPlan = BuildPlan(gContext.mModel.v.position, movePlanNormal[type - MOVE_X]);
+ gContext.mTranslationPlan = BuildPlan(gContext.mModel.v.position, movePlanNormal[type - MT_MOVE_X]);
const float len = IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, gContext.mTranslationPlan);
gContext.mTranslationPlanOrigin = gContext.mRayOrigin + gContext.mRayVector * len;
gContext.mMatrixOrigin = gContext.mModel.v.position;
@@ -1626,28 +2126,35 @@ namespace ImGuizmo
gContext.mRelativeOrigin = (gContext.mTranslationPlanOrigin - gContext.mModel.v.position) * (1.f / gContext.mScreenFactor);
}
}
+ return modified;
}
- static void HandleScale(float *matrix, float *deltaMatrix, int& type, float *snap)
+ static bool HandleScale(float* matrix, float* deltaMatrix, OPERATION op, int& type, const float* snap)
{
+ if((!Intersects(op, SCALE) && !Intersects(op, SCALEU)) || type != MT_NONE)
+ {
+ return false;
+ }
ImGuiIO& io = ImGui::GetIO();
+ bool modified = false;
if (!gContext.mbUsing)
{
// find new possible way to scale
- type = GetScaleType();
- if(type != NONE)
+ type = GetScaleType(op);
+ if (type != MT_NONE)
{
- ImGui::CaptureMouseFromApp();
+ ImGui::SetNextFrameWantCaptureMouse(true);
}
- if (CanActivate() && type != NONE)
+ if (CanActivate() && type != MT_NONE)
{
gContext.mbUsing = true;
+ gContext.mEditingID = gContext.mActualID;
gContext.mCurrentOperation = type;
const vec_t movePlanNormal[] = { gContext.mModel.v.up, gContext.mModel.v.dir, gContext.mModel.v.right, gContext.mModel.v.dir, gContext.mModel.v.up, gContext.mModel.v.right, -gContext.mCameraDir };
// pickup plan
- gContext.mTranslationPlan = BuildPlan(gContext.mModel.v.position, movePlanNormal[type - SCALE_X]);
+ gContext.mTranslationPlan = BuildPlan(gContext.mModel.v.position, movePlanNormal[type - MT_SCALE_X]);
const float len = IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, gContext.mTranslationPlan);
gContext.mTranslationPlanOrigin = gContext.mRayOrigin + gContext.mRayVector * len;
gContext.mMatrixOrigin = gContext.mModel.v.position;
@@ -1658,30 +2165,30 @@ namespace ImGuizmo
}
}
// scale
- if (gContext.mbUsing)
+ if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID) && IsScaleType(gContext.mCurrentOperation))
{
- ImGui::CaptureMouseFromApp();
+ ImGui::SetNextFrameWantCaptureMouse(true);
const float len = IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, gContext.mTranslationPlan);
vec_t newPos = gContext.mRayOrigin + gContext.mRayVector * len;
vec_t newOrigin = newPos - gContext.mRelativeOrigin * gContext.mScreenFactor;
- vec_t delta = newOrigin - gContext.mModel.v.position;
+ vec_t delta = newOrigin - gContext.mModelLocal.v.position;
// 1 axis constraint
- if (gContext.mCurrentOperation >= SCALE_X && gContext.mCurrentOperation <= SCALE_Z)
+ if (gContext.mCurrentOperation >= MT_SCALE_X && gContext.mCurrentOperation <= MT_SCALE_Z)
{
- int axisIndex = gContext.mCurrentOperation - SCALE_X;
- const vec_t& axisValue = *(vec_t*)&gContext.mModel.m[axisIndex];
+ int axisIndex = gContext.mCurrentOperation - MT_SCALE_X;
+ const vec_t& axisValue = *(vec_t*)&gContext.mModelLocal.m[axisIndex];
float lengthOnAxis = Dot(axisValue, delta);
delta = axisValue * lengthOnAxis;
- vec_t baseVector = gContext.mTranslationPlanOrigin - gContext.mModel.v.position;
+ vec_t baseVector = gContext.mTranslationPlanOrigin - gContext.mModelLocal.v.position;
float ratio = Dot(axisValue, baseVector + delta) / Dot(axisValue, baseVector);
gContext.mScale[axisIndex] = max(ratio, 0.001f);
}
else
{
- float scaleDelta = (io.MousePos.x - gContext.mSaveMousePosx) * 0.01f;
+ float scaleDelta = (io.MousePos.x - gContext.mSaveMousePosx) * 0.01f;
gContext.mScale.Set(max(1.f + scaleDelta, 0.001f));
}
@@ -1693,61 +2200,86 @@ namespace ImGuizmo
}
// no 0 allowed
- for (int i = 0; i < 3;i++)
+ for (int i = 0; i < 3; i++)
gContext.mScale[i] = max(gContext.mScale[i], 0.001f);
+ if (gContext.mScaleLast != gContext.mScale)
+ {
+ modified = true;
+ }
+ gContext.mScaleLast = gContext.mScale;
+
// compute matrix & delta
matrix_t deltaMatrixScale;
deltaMatrixScale.Scale(gContext.mScale * gContext.mScaleValueOrigin);
- matrix_t res = deltaMatrixScale * gContext.mModel;
+ matrix_t res = deltaMatrixScale * gContext.mModelLocal;
*(matrix_t*)matrix = res;
if (deltaMatrix)
{
- deltaMatrixScale.Scale(gContext.mScale);
+ vec_t deltaScale = gContext.mScale * gContext.mScaleValueOrigin;
+
+ vec_t originalScaleDivider;
+ originalScaleDivider.x = 1 / gContext.mModelScaleOrigin.x;
+ originalScaleDivider.y = 1 / gContext.mModelScaleOrigin.y;
+ originalScaleDivider.z = 1 / gContext.mModelScaleOrigin.z;
+
+ deltaScale = deltaScale * originalScaleDivider;
+
+ deltaMatrixScale.Scale(deltaScale);
memcpy(deltaMatrix, deltaMatrixScale.m16, sizeof(float) * 16);
}
if (!io.MouseDown[0])
+ {
gContext.mbUsing = false;
+ gContext.mScale.Set(1.f, 1.f, 1.f);
+ }
type = gContext.mCurrentOperation;
}
+ return modified;
}
- static void HandleRotation(float *matrix, float *deltaMatrix, int& type, float *snap)
+ static bool HandleRotation(float* matrix, float* deltaMatrix, OPERATION op, int& type, const float* snap)
{
+ if(!Intersects(op, ROTATE) || type != MT_NONE)
+ {
+ return false;
+ }
ImGuiIO& io = ImGui::GetIO();
bool applyRotationLocaly = gContext.mMode == LOCAL;
+ bool modified = false;
if (!gContext.mbUsing)
{
- type = GetRotateType();
+ type = GetRotateType(op);
- if(type != NONE)
+ if (type != MT_NONE)
{
- ImGui::CaptureMouseFromApp();
+ ImGui::SetNextFrameWantCaptureMouse(true);
}
- if (type == ROTATE_SCREEN)
+ if (type == MT_ROTATE_SCREEN)
{
applyRotationLocaly = true;
}
- if (CanActivate() && type != NONE)
+ if (CanActivate() && type != MT_NONE)
{
gContext.mbUsing = true;
+ gContext.mEditingID = gContext.mActualID;
gContext.mCurrentOperation = type;
const vec_t rotatePlanNormal[] = { gContext.mModel.v.right, gContext.mModel.v.up, gContext.mModel.v.dir, -gContext.mCameraDir };
// pickup plan
if (applyRotationLocaly)
{
- gContext.mTranslationPlan = BuildPlan(gContext.mModel.v.position, rotatePlanNormal[type - ROTATE_X]);
+ gContext.mTranslationPlan = BuildPlan(gContext.mModel.v.position, rotatePlanNormal[type - MT_ROTATE_X]);
}
else
{
- gContext.mTranslationPlan = BuildPlan(gContext.mModelSource.v.position, directionUnary[type - ROTATE_X]);
+ gContext.mTranslationPlan = BuildPlan(gContext.mModelSource.v.position, directionUnary[type - MT_ROTATE_X]);
}
const float len = IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, gContext.mTranslationPlan);
@@ -1758,9 +2290,9 @@ namespace ImGuizmo
}
// rotation
- if (gContext.mbUsing)
+ if (gContext.mbUsing && (gContext.mActualID == -1 || gContext.mActualID == gContext.mEditingID) && IsRotateType(gContext.mCurrentOperation))
{
- ImGui::CaptureMouseFromApp();
+ ImGui::SetNextFrameWantCaptureMouse(true);
gContext.mRotationAngle = ComputeAngleOnPlan();
if (snap)
{
@@ -1774,6 +2306,10 @@ namespace ImGuizmo
matrix_t deltaRotation;
deltaRotation.RotationAxis(rotationAxisLocalSpace, gContext.mRotationAngle - gContext.mRotationAngleOrigin);
+ if (gContext.mRotationAngle != gContext.mRotationAngleOrigin)
+ {
+ modified = true;
+ }
gContext.mRotationAngleOrigin = gContext.mRotationAngle;
matrix_t scaleOrigin;
@@ -1781,7 +2317,7 @@ namespace ImGuizmo
if (applyRotationLocaly)
{
- *(matrix_t*)matrix = scaleOrigin * deltaRotation * gContext.mModel;
+ *(matrix_t*)matrix = scaleOrigin * deltaRotation * gContext.mModelLocal;
}
else
{
@@ -1798,13 +2334,16 @@ namespace ImGuizmo
}
if (!io.MouseDown[0])
+ {
gContext.mbUsing = false;
-
+ gContext.mEditingID = -1;
+ }
type = gContext.mCurrentOperation;
}
+ return modified;
}
- void DecomposeMatrixToComponents(const float *matrix, float *translation, float *rotation, float *scale)
+ void DecomposeMatrixToComponents(const float* matrix, float* translation, float* rotation, float* scale)
{
matrix_t mat = *(matrix_t*)matrix;
@@ -1815,7 +2354,7 @@ namespace ImGuizmo
mat.OrthoNormalize();
rotation[0] = RAD2DEG * atan2f(mat.m[1][2], mat.m[2][2]);
- rotation[1] = RAD2DEG * atan2f(-mat.m[0][2], sqrtf(mat.m[1][2] * mat.m[1][2] + mat.m[2][2]* mat.m[2][2]));
+ rotation[1] = RAD2DEG * atan2f(-mat.m[0][2], sqrtf(mat.m[1][2] * mat.m[1][2] + mat.m[2][2] * mat.m[2][2]));
rotation[2] = RAD2DEG * atan2f(mat.m[0][1], mat.m[0][0]);
translation[0] = mat.v.position.x;
@@ -1823,13 +2362,15 @@ namespace ImGuizmo
translation[2] = mat.v.position.z;
}
- void RecomposeMatrixFromComponents(const float *translation, const float *rotation, const float *scale, float *matrix)
+ void RecomposeMatrixFromComponents(const float* translation, const float* rotation, const float* scale, float* matrix)
{
matrix_t& mat = *(matrix_t*)matrix;
matrix_t rot[3];
- for (int i = 0; i < 3;i++)
+ for (int i = 0; i < 3; i++)
+ {
rot[i].RotationAxis(directionUnary[i], rotation[i] * DEG2RAD);
+ }
mat = rot[0] * rot[1] * rot[2];
@@ -1837,9 +2378,13 @@ namespace ImGuizmo
for (int i = 0; i < 3; i++)
{
if (fabsf(scale[i]) < FLT_EPSILON)
+ {
validScale[i] = 0.001f;
+ }
else
+ {
validScale[i] = scale[i];
+ }
}
mat.v.right *= validScale[0];
mat.v.up *= validScale[1];
@@ -1847,127 +2392,492 @@ namespace ImGuizmo
mat.v.position.Set(translation[0], translation[1], translation[2], 1.f);
}
- void Manipulate(const float *view, const float *projection, OPERATION operation, MODE mode, float *matrix, float *deltaMatrix, float *snap, float *localBounds, float *boundsSnap)
+ void SetID(int id)
+ {
+ gContext.mActualID = id;
+ }
+
+ void AllowAxisFlip(bool value)
+ {
+ gContext.mAllowAxisFlip = value;
+ }
+
+ bool Manipulate(const float* view, const float* projection, OPERATION operation, MODE mode, float* matrix, float* deltaMatrix, const float* snap, const float* localBounds, const float* boundsSnap)
{
- ComputeContext(view, projection, matrix, mode);
+ // Scale is always local or matrix will be skewed when applying world scale or oriented matrix
+ ComputeContext(view, projection, matrix, (operation & SCALE) ? LOCAL : mode);
// set delta to identity
if (deltaMatrix)
+ {
((matrix_t*)deltaMatrix)->SetToIdentity();
+ }
// behind camera
vec_t camSpacePosition;
- camSpacePosition.TransformPoint(makeVect(0.f, 0.f, 0.f), gContext.mMVP);
+ camSpacePosition.TransformPoint(makeVect(0.f, 0.f, 0.f), gContext.mModel * gContext.mViewMat);
if (!gContext.mIsOrthographic && camSpacePosition.z < 0.001f)
- return;
+ {
+ return false;
+ }
// --
- int type = NONE;
+ int type = MT_NONE;
+ bool manipulated = false;
if (gContext.mbEnable)
{
- if (!gContext.mbUsingBounds)
- {
- switch (operation)
- {
- case ROTATE:
- HandleRotation(matrix, deltaMatrix, type, snap);
- break;
- case TRANSLATE:
- HandleTranslation(matrix, deltaMatrix, type, snap);
- break;
- case SCALE:
- HandleScale(matrix, deltaMatrix, type, snap);
- break;
- case BOUNDS:
- break;
- }
- }
+ if (!gContext.mbUsingBounds)
+ {
+ manipulated = HandleTranslation(matrix, deltaMatrix, operation, type, snap) ||
+ HandleScale(matrix, deltaMatrix, operation, type, snap) ||
+ HandleRotation(matrix, deltaMatrix, operation, type, snap);
+ }
}
if (localBounds && !gContext.mbUsing)
- HandleAndDrawLocalBounds(localBounds, (matrix_t*)matrix, boundsSnap, operation);
+ {
+ HandleAndDrawLocalBounds(localBounds, (matrix_t*)matrix, boundsSnap, operation);
+ }
+ gContext.mOperation = operation;
if (!gContext.mbUsingBounds)
{
- switch (operation)
- {
- case ROTATE:
- DrawRotationGizmo(type);
- break;
- case TRANSLATE:
- DrawTranslationGizmo(type);
- break;
- case SCALE:
- DrawScaleGizmo(type);
- break;
- case BOUNDS:
- break;
- }
+ DrawRotationGizmo(operation, type);
+ DrawTranslationGizmo(operation, type);
+ DrawScaleGizmo(operation, type);
+ DrawScaleUniveralGizmo(operation, type);
}
+ return manipulated;
+ }
+
+ void SetGizmoSizeClipSpace(float value)
+ {
+ gContext.mGizmoSizeClipSpace = value;
}
- void DrawCube(const float *view, const float *projection, const float *matrix)
+ ///////////////////////////////////////////////////////////////////////////////////////////////////
+ void ComputeFrustumPlanes(vec_t* frustum, const float* clip)
+ {
+ frustum[0].x = clip[3] - clip[0];
+ frustum[0].y = clip[7] - clip[4];
+ frustum[0].z = clip[11] - clip[8];
+ frustum[0].w = clip[15] - clip[12];
+
+ frustum[1].x = clip[3] + clip[0];
+ frustum[1].y = clip[7] + clip[4];
+ frustum[1].z = clip[11] + clip[8];
+ frustum[1].w = clip[15] + clip[12];
+
+ frustum[2].x = clip[3] + clip[1];
+ frustum[2].y = clip[7] + clip[5];
+ frustum[2].z = clip[11] + clip[9];
+ frustum[2].w = clip[15] + clip[13];
+
+ frustum[3].x = clip[3] - clip[1];
+ frustum[3].y = clip[7] - clip[5];
+ frustum[3].z = clip[11] - clip[9];
+ frustum[3].w = clip[15] - clip[13];
+
+ frustum[4].x = clip[3] - clip[2];
+ frustum[4].y = clip[7] - clip[6];
+ frustum[4].z = clip[11] - clip[10];
+ frustum[4].w = clip[15] - clip[14];
+
+ frustum[5].x = clip[3] + clip[2];
+ frustum[5].y = clip[7] + clip[6];
+ frustum[5].z = clip[11] + clip[10];
+ frustum[5].w = clip[15] + clip[14];
+
+ for (int i = 0; i < 6; i++)
+ {
+ frustum[i].Normalize();
+ }
+ }
+
+ void DrawCubes(const float* view, const float* projection, const float* matrices, int matrixCount)
{
matrix_t viewInverse;
viewInverse.Inverse(*(matrix_t*)view);
- const matrix_t& model = *(matrix_t*)matrix;
- matrix_t res = *(matrix_t*)matrix * *(matrix_t*)view * *(matrix_t*)projection;
- for (int iFace = 0; iFace < 6; iFace++)
+ struct CubeFace
{
- const int normalIndex = (iFace % 3);
- const int perpXIndex = (normalIndex + 1) % 3;
- const int perpYIndex = (normalIndex + 2) % 3;
- const float invert = (iFace > 2) ? -1.f : 1.f;
+ float z;
+ ImVec2 faceCoordsScreen[4];
+ ImU32 color;
+ };
+ CubeFace* faces = (CubeFace*)_malloca(sizeof(CubeFace) * matrixCount * 6);
- const vec_t faceCoords[4] = { directionUnary[normalIndex] + directionUnary[perpXIndex] + directionUnary[perpYIndex],
- directionUnary[normalIndex] + directionUnary[perpXIndex] - directionUnary[perpYIndex],
- directionUnary[normalIndex] - directionUnary[perpXIndex] - directionUnary[perpYIndex],
- directionUnary[normalIndex] - directionUnary[perpXIndex] + directionUnary[perpYIndex],
- };
+ if (!faces)
+ {
+ return;
+ }
+
+ vec_t frustum[6];
+ matrix_t viewProjection = *(matrix_t*)view * *(matrix_t*)projection;
+ ComputeFrustumPlanes(frustum, viewProjection.m16);
+
+ int cubeFaceCount = 0;
+ for (int cube = 0; cube < matrixCount; cube++)
+ {
+ const float* matrix = &matrices[cube * 16];
- // clipping
- bool skipFace = false;
- for (unsigned int iCoord = 0; iCoord < 4; iCoord++)
+ matrix_t res = *(matrix_t*)matrix * *(matrix_t*)view * *(matrix_t*)projection;
+
+ for (int iFace = 0; iFace < 6; iFace++)
{
- vec_t camSpacePosition;
- camSpacePosition.TransformPoint(faceCoords[iCoord] * 0.5f * invert, gContext.mMVP);
- if (camSpacePosition.z < 0.001f)
+ const int normalIndex = (iFace % 3);
+ const int perpXIndex = (normalIndex + 1) % 3;
+ const int perpYIndex = (normalIndex + 2) % 3;
+ const float invert = (iFace > 2) ? -1.f : 1.f;
+
+ const vec_t faceCoords[4] = { directionUnary[normalIndex] + directionUnary[perpXIndex] + directionUnary[perpYIndex],
+ directionUnary[normalIndex] + directionUnary[perpXIndex] - directionUnary[perpYIndex],
+ directionUnary[normalIndex] - directionUnary[perpXIndex] - directionUnary[perpYIndex],
+ directionUnary[normalIndex] - directionUnary[perpXIndex] + directionUnary[perpYIndex],
+ };
+
+ // clipping
+ /*
+ bool skipFace = false;
+ for (unsigned int iCoord = 0; iCoord < 4; iCoord++)
{
- skipFace = true;
- break;
+ vec_t camSpacePosition;
+ camSpacePosition.TransformPoint(faceCoords[iCoord] * 0.5f * invert, res);
+ if (camSpacePosition.z < 0.001f)
+ {
+ skipFace = true;
+ break;
+ }
}
- }
- if (skipFace)
- continue;
+ if (skipFace)
+ {
+ continue;
+ }
+ */
+ vec_t centerPosition, centerPositionVP;
+ centerPosition.TransformPoint(directionUnary[normalIndex] * 0.5f * invert, *(matrix_t*)matrix);
+ centerPositionVP.TransformPoint(directionUnary[normalIndex] * 0.5f * invert, res);
- // 3D->2D
- ImVec2 faceCoordsScreen[4];
- for (unsigned int iCoord = 0; iCoord < 4; iCoord++)
- faceCoordsScreen[iCoord] = worldToPos(faceCoords[iCoord] * 0.5f * invert, res);
-
- // back face culling
- vec_t cullPos, cullNormal;
- cullPos.TransformPoint(faceCoords[0] * 0.5f * invert, model);
- cullNormal.TransformVector(directionUnary[normalIndex] * invert, model);
- float dt = Dot(Normalized(cullPos - viewInverse.v.position), Normalized(cullNormal));
- if (dt>0.f)
- continue;
+ bool inFrustum = true;
+ for (int iFrustum = 0; iFrustum < 6; iFrustum++)
+ {
+ float dist = DistanceToPlane(centerPosition, frustum[iFrustum]);
+ if (dist < 0.f)
+ {
+ inFrustum = false;
+ break;
+ }
+ }
- // draw face with lighter color
- gContext.mDrawList->AddConvexPolyFilled(faceCoordsScreen, 4, directionColor[normalIndex] | 0x808080);
+ if (!inFrustum)
+ {
+ continue;
+ }
+ CubeFace& cubeFace = faces[cubeFaceCount];
+
+ // 3D->2D
+ //ImVec2 faceCoordsScreen[4];
+ for (unsigned int iCoord = 0; iCoord < 4; iCoord++)
+ {
+ cubeFace.faceCoordsScreen[iCoord] = worldToPos(faceCoords[iCoord] * 0.5f * invert, res);
+ }
+ cubeFace.color = directionColor[normalIndex] | IM_COL32(0x80, 0x80, 0x80, 0);
+
+ cubeFace.z = centerPositionVP.z / centerPositionVP.w;
+ cubeFaceCount++;
+ }
+ }
+ qsort(faces, cubeFaceCount, sizeof(CubeFace), [](void const* _a, void const* _b) {
+ CubeFace* a = (CubeFace*)_a;
+ CubeFace* b = (CubeFace*)_b;
+ if (a->z < b->z)
+ {
+ return 1;
+ }
+ return -1;
+ });
+ // draw face with lighter color
+ for (int iFace = 0; iFace < cubeFaceCount; iFace++)
+ {
+ const CubeFace& cubeFace = faces[iFace];
+ gContext.mDrawList->AddConvexPolyFilled(cubeFace.faceCoordsScreen, 4, cubeFace.color);
}
+
+ _freea(faces);
}
- void DrawGrid(const float *view, const float *projection, const float *matrix, const float gridSize)
+ void DrawGrid(const float* view, const float* projection, const float* matrix, const float gridSize)
{
- matrix_t res = *(matrix_t*)matrix * *(matrix_t*)view * *(matrix_t*)projection;
+ matrix_t viewProjection = *(matrix_t*)view * *(matrix_t*)projection;
+ vec_t frustum[6];
+ ComputeFrustumPlanes(frustum, viewProjection.m16);
+ matrix_t res = *(matrix_t*)matrix * viewProjection;
for (float f = -gridSize; f <= gridSize; f += 1.f)
{
- gContext.mDrawList->AddLine(worldToPos(makeVect(f, 0.f, -gridSize), res), worldToPos(makeVect(f, 0.f, gridSize), res), 0xFF808080);
- gContext.mDrawList->AddLine(worldToPos(makeVect(-gridSize, 0.f, f), res), worldToPos(makeVect(gridSize, 0.f, f), res), 0xFF808080);
+ for (int dir = 0; dir < 2; dir++)
+ {
+ vec_t ptA = makeVect(dir ? -gridSize : f, 0.f, dir ? f : -gridSize);
+ vec_t ptB = makeVect(dir ? gridSize : f, 0.f, dir ? f : gridSize);
+ bool visible = true;
+ for (int i = 0; i < 6; i++)
+ {
+ float dA = DistanceToPlane(ptA, frustum[i]);
+ float dB = DistanceToPlane(ptB, frustum[i]);
+ if (dA < 0.f && dB < 0.f)
+ {
+ visible = false;
+ break;
+ }
+ if (dA > 0.f && dB > 0.f)
+ {
+ continue;
+ }
+ if (dA < 0.f)
+ {
+ float len = fabsf(dA - dB);
+ float t = fabsf(dA) / len;
+ ptA.Lerp(ptB, t);
+ }
+ if (dB < 0.f)
+ {
+ float len = fabsf(dB - dA);
+ float t = fabsf(dB) / len;
+ ptB.Lerp(ptA, t);
+ }
+ }
+ if (visible)
+ {
+ ImU32 col = IM_COL32(0x80, 0x80, 0x80, 0xFF);
+ col = (fmodf(fabsf(f), 10.f) < FLT_EPSILON) ? IM_COL32(0x90, 0x90, 0x90, 0xFF) : col;
+ col = (fabsf(f) < FLT_EPSILON) ? IM_COL32(0x40, 0x40, 0x40, 0xFF): col;
+
+ float thickness = 1.f;
+ thickness = (fmodf(fabsf(f), 10.f) < FLT_EPSILON) ? 1.5f : thickness;
+ thickness = (fabsf(f) < FLT_EPSILON) ? 2.3f : thickness;
+
+ gContext.mDrawList->AddLine(worldToPos(ptA, res), worldToPos(ptB, res), col, thickness);
+ }
+ }
}
}
-};
+ void ViewManipulate(float* view, float length, ImVec2 position, ImVec2 size, ImU32 backgroundColor)
+ {
+ static bool isDraging = false;
+ static bool isClicking = false;
+ static bool isInside = false;
+ static vec_t interpolationUp;
+ static vec_t interpolationDir;
+ static int interpolationFrames = 0;
+ const vec_t referenceUp = makeVect(0.f, 1.f, 0.f);
+
+ matrix_t svgView, svgProjection;
+ svgView = gContext.mViewMat;
+ svgProjection = gContext.mProjectionMat;
+
+ ImGuiIO& io = ImGui::GetIO();
+ gContext.mDrawList->AddRectFilled(position, position + size, backgroundColor);
+ matrix_t viewInverse;
+ viewInverse.Inverse(*(matrix_t*)view);
+
+ const vec_t camTarget = viewInverse.v.position - viewInverse.v.dir * length;
+
+ // view/projection matrices
+ const float distance = 3.f;
+ matrix_t cubeProjection, cubeView;
+ float fov = acosf(distance / (sqrtf(distance * distance + 3.f))) * RAD2DEG;
+ Perspective(fov / sqrtf(2.f), size.x / size.y, 0.01f, 1000.f, cubeProjection.m16);
+
+ vec_t dir = makeVect(viewInverse.m[2][0], viewInverse.m[2][1], viewInverse.m[2][2]);
+ vec_t up = makeVect(viewInverse.m[1][0], viewInverse.m[1][1], viewInverse.m[1][2]);
+ vec_t eye = dir * distance;
+ vec_t zero = makeVect(0.f, 0.f);
+ LookAt(&eye.x, &zero.x, &up.x, cubeView.m16);
+
+ // set context
+ gContext.mViewMat = cubeView;
+ gContext.mProjectionMat = cubeProjection;
+ ComputeCameraRay(gContext.mRayOrigin, gContext.mRayVector, position, size);
+
+ const matrix_t res = cubeView * cubeProjection;
+
+ // panels
+ static const ImVec2 panelPosition[9] = { ImVec2(0.75f,0.75f), ImVec2(0.25f, 0.75f), ImVec2(0.f, 0.75f),
+ ImVec2(0.75f, 0.25f), ImVec2(0.25f, 0.25f), ImVec2(0.f, 0.25f),
+ ImVec2(0.75f, 0.f), ImVec2(0.25f, 0.f), ImVec2(0.f, 0.f) };
+
+ static const ImVec2 panelSize[9] = { ImVec2(0.25f,0.25f), ImVec2(0.5f, 0.25f), ImVec2(0.25f, 0.25f),
+ ImVec2(0.25f, 0.5f), ImVec2(0.5f, 0.5f), ImVec2(0.25f, 0.5f),
+ ImVec2(0.25f, 0.25f), ImVec2(0.5f, 0.25f), ImVec2(0.25f, 0.25f) };
+
+ // tag faces
+ bool boxes[27]{};
+ for (int iPass = 0; iPass < 2; iPass++)
+ {
+ for (int iFace = 0; iFace < 6; iFace++)
+ {
+ const int normalIndex = (iFace % 3);
+ const int perpXIndex = (normalIndex + 1) % 3;
+ const int perpYIndex = (normalIndex + 2) % 3;
+ const float invert = (iFace > 2) ? -1.f : 1.f;
+ const vec_t indexVectorX = directionUnary[perpXIndex] * invert;
+ const vec_t indexVectorY = directionUnary[perpYIndex] * invert;
+ const vec_t boxOrigin = directionUnary[normalIndex] * -invert - indexVectorX - indexVectorY;
+
+ // plan local space
+ const vec_t n = directionUnary[normalIndex] * invert;
+ vec_t viewSpaceNormal = n;
+ vec_t viewSpacePoint = n * 0.5f;
+ viewSpaceNormal.TransformVector(cubeView);
+ viewSpaceNormal.Normalize();
+ viewSpacePoint.TransformPoint(cubeView);
+ const vec_t viewSpaceFacePlan = BuildPlan(viewSpacePoint, viewSpaceNormal);
+
+ // back face culling
+ if (viewSpaceFacePlan.w > 0.f)
+ {
+ continue;
+ }
+
+ const vec_t facePlan = BuildPlan(n * 0.5f, n);
+
+ const float len = IntersectRayPlane(gContext.mRayOrigin, gContext.mRayVector, facePlan);
+ vec_t posOnPlan = gContext.mRayOrigin + gContext.mRayVector * len - (n * 0.5f);
+
+ float localx = Dot(directionUnary[perpXIndex], posOnPlan) * invert + 0.5f;
+ float localy = Dot(directionUnary[perpYIndex], posOnPlan) * invert + 0.5f;
+
+ // panels
+ const vec_t dx = directionUnary[perpXIndex];
+ const vec_t dy = directionUnary[perpYIndex];
+ const vec_t origin = directionUnary[normalIndex] - dx - dy;
+ for (int iPanel = 0; iPanel < 9; iPanel++)
+ {
+ vec_t boxCoord = boxOrigin + indexVectorX * float(iPanel % 3) + indexVectorY * float(iPanel / 3) + makeVect(1.f, 1.f, 1.f);
+ const ImVec2 p = panelPosition[iPanel] * 2.f;
+ const ImVec2 s = panelSize[iPanel] * 2.f;
+ ImVec2 faceCoordsScreen[4];
+ vec_t panelPos[4] = { dx * p.x + dy * p.y,
+ dx * p.x + dy * (p.y + s.y),
+ dx * (p.x + s.x) + dy * (p.y + s.y),
+ dx * (p.x + s.x) + dy * p.y };
+
+ for (unsigned int iCoord = 0; iCoord < 4; iCoord++)
+ {
+ faceCoordsScreen[iCoord] = worldToPos((panelPos[iCoord] + origin) * 0.5f * invert, res, position, size);
+ }
+
+ const ImVec2 panelCorners[2] = { panelPosition[iPanel], panelPosition[iPanel] + panelSize[iPanel] };
+ bool insidePanel = localx > panelCorners[0].x && localx < panelCorners[1].x&& localy > panelCorners[0].y && localy < panelCorners[1].y;
+ int boxCoordInt = int(boxCoord.x * 9.f + boxCoord.y * 3.f + boxCoord.z);
+ assert(boxCoordInt < 27);
+ boxes[boxCoordInt] |= insidePanel && (!isDraging);
+
+ // draw face with lighter color
+ if (iPass)
+ {
+ gContext.mDrawList->AddConvexPolyFilled(faceCoordsScreen, 4, (directionColor[normalIndex] | IM_COL32(0x80, 0x80, 0x80, 0x80)) | (isInside ? IM_COL32(0x08, 0x08, 0x08, 0) : 0));
+ if (boxes[boxCoordInt])
+ {
+ gContext.mDrawList->AddConvexPolyFilled(faceCoordsScreen, 4, IM_COL32(0xF0, 0xA0, 0x60, 0x80));
+
+ if (!io.MouseDown[0] && !isDraging && isClicking)
+ {
+ // apply new view direction
+ int cx = boxCoordInt / 9;
+ int cy = (boxCoordInt - cx * 9) / 3;
+ int cz = boxCoordInt % 3;
+ interpolationDir = makeVect(1.f - cx, 1.f - cy, 1.f - cz);
+ interpolationDir.Normalize();
+
+ if (fabsf(Dot(interpolationDir, referenceUp)) > 1.0f - 0.01f)
+ {
+ vec_t right = viewInverse.v.right;
+ if (fabsf(right.x) > fabsf(right.z))
+ {
+ right.z = 0.f;
+ }
+ else
+ {
+ right.x = 0.f;
+ }
+ right.Normalize();
+ interpolationUp = Cross(interpolationDir, right);
+ interpolationUp.Normalize();
+ }
+ else
+ {
+ interpolationUp = referenceUp;
+ }
+ interpolationFrames = 40;
+ isClicking = false;
+ }
+ if (io.MouseDown[0] && !isDraging)
+ {
+ isClicking = true;
+ }
+ }
+ }
+ }
+ }
+ }
+ if (interpolationFrames)
+ {
+ interpolationFrames--;
+ vec_t newDir = viewInverse.v.dir;
+ newDir.Lerp(interpolationDir, 0.2f);
+ newDir.Normalize();
+
+ vec_t newUp = viewInverse.v.up;
+ newUp.Lerp(interpolationUp, 0.3f);
+ newUp.Normalize();
+ newUp = interpolationUp;
+ vec_t newEye = camTarget + newDir * length;
+ LookAt(&newEye.x, &camTarget.x, &newUp.x, view);
+ }
+ isInside = ImRect(position, position + size).Contains(io.MousePos);
+
+ // drag view
+ if (!isDraging && io.MouseDown[0] && isInside && (fabsf(io.MouseDelta.x) > 0.f || fabsf(io.MouseDelta.y) > 0.f))
+ {
+ isDraging = true;
+ isClicking = false;
+ }
+ else if (isDraging && !io.MouseDown[0])
+ {
+ isDraging = false;
+ }
+
+ if (isDraging)
+ {
+ matrix_t rx, ry, roll;
+
+ rx.RotationAxis(referenceUp, -io.MouseDelta.x * 0.01f);
+ ry.RotationAxis(viewInverse.v.right, -io.MouseDelta.y * 0.01f);
+
+ roll = rx * ry;
+
+ vec_t newDir = viewInverse.v.dir;
+ newDir.TransformVector(roll);
+ newDir.Normalize();
+
+ // clamp
+ vec_t planDir = Cross(viewInverse.v.right, referenceUp);
+ planDir.y = 0.f;
+ planDir.Normalize();
+ float dt = Dot(planDir, newDir);
+ if (dt < 0.0f)
+ {
+ newDir += planDir * dt;
+ newDir.Normalize();
+ }
+
+ vec_t newEye = camTarget + newDir * length;
+ LookAt(&newEye.x, &camTarget.x, &referenceUp.x, view);
+ }
+
+ // restore view/projection because it was used to compute ray
+ ComputeContext(svgView.m16, svgProjection.m16, gContext.mModelSource.m16, gContext.mMode);
+ }
+};
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/memory_editor.inl b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/memory_editor.inl
index 907e0313e2e..ce34f5d6427 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/memory_editor.inl
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/memory_editor.inl
@@ -1,3 +1,5 @@
+#include <bx/string.h>
+
#ifdef _MSC_VER
# define snprintf _snprintf
#endif
@@ -142,7 +144,7 @@ namespace ImGui
if (HexII)
{
unsigned char byte = mem_data[addr];
- if (isprint(byte) )
+ if (bx::isPrint(byte) )
{
Text(".%c ", byte);
}
diff --git a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl
index 3cec7ace632..419ec763872 100644
--- a/3rdparty/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl
+++ b/3rdparty/bgfx/3rdparty/dear-imgui/widgets/range_slider.inl
@@ -183,7 +183,7 @@ bool RangeSliderFloat(const char* label, float* v1, float* v2, float v_min, floa
// Tabbing or CTRL-clicking on Slider turns it into an input box
bool start_text_input = false;
- const bool tab_focus_requested = (GetItemStatusFlags() & ImGuiItemStatusFlags_Focused) != 0;
+ const bool tab_focus_requested = (GetItemStatusFlags() & ImGuiItemStatusFlags_FocusedByTabbing) != 0;
if (tab_focus_requested || (hovered && g.IO.MouseClicked[0]))
{
SetActiveID(id, window);
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/LICENSE b/3rdparty/bgfx/3rdparty/directx-headers/LICENSE
new file mode 100644
index 00000000000..63447fd8bbb
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/LICENSE
@@ -0,0 +1,21 @@
+Copyright (c) Microsoft Corporation.
+
+MIT License
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+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 Software.
+
+THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE. \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/PIXEventsCommon.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/PIXEventsCommon.h
index 515d1743472..515d1743472 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/PIXEventsCommon.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/PIXEventsCommon.h
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/PIXEventsGenerated.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/PIXEventsGenerated.h
index e963c485549..e963c485549 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/PIXEventsGenerated.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/PIXEventsGenerated.h
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10.h
new file mode 100644
index 00000000000..6f70f09beec
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1.h
new file mode 100644
index 00000000000..6f70f09beec
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1shader.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1shader.h
new file mode 100644
index 00000000000..6f70f09beec
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10_1shader.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10effect.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10effect.h
new file mode 100644
index 00000000000..6f70f09beec
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10effect.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10misc.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10misc.h
new file mode 100644
index 00000000000..6f70f09beec
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10misc.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10sdklayers.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10sdklayers.h
new file mode 100644
index 00000000000..6f70f09beec
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10sdklayers.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10shader.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10shader.h
new file mode 100644
index 00000000000..6f70f09beec
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d10shader.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11.h
index 7b52a904331..03e8f268ee9 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11.h
@@ -15,7 +15,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_1.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_1.h
index 76a1596d761..3c39a2496b8 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_1.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_1.h
@@ -15,7 +15,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_2.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_2.h
index eb7a1bfefa4..73209f243cd 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_2.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_2.h
@@ -15,7 +15,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_3.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_3.h
index b0d88befd88..c6c56245744 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_3.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_3.h
@@ -15,7 +15,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_4.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_4.h
index 27c15f1828f..6dd8fa1d6f9 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11_4.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11_4.h
@@ -15,7 +15,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11sdklayers.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11sdklayers.h
index 7d12f3e084b..b6d5dcd5216 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11sdklayers.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11sdklayers.h
@@ -15,7 +15,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shader.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11shader.h
index 84c36cf64c2..84c36cf64c2 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shader.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11shader.h
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shadertracing.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11shadertracing.h
index 95528f4374b..3dd4a5b5284 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d11shadertracing.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d11shadertracing.h
@@ -10,7 +10,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12.h
index bfe4b16fb46..66cfa4c4d66 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12.h
@@ -1,6 +1,7 @@
/*-------------------------------------------------------------------------------------
*
* Copyright (c) Microsoft Corporation
+ * Licensed under the MIT license
*
*-------------------------------------------------------------------------------------*/
@@ -8,13 +9,13 @@
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
- /* File created by MIDL compiler version 8.01.0622 */
+ /* File created by MIDL compiler version 8.01.0628 */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
@@ -41,6 +42,14 @@
#pragma once
#endif
+#ifndef DECLSPEC_XFGVIRT
+#if defined(_CONTROL_FLOW_GUARD_XFG)
+#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func))
+#else
+#define DECLSPEC_XFGVIRT(base, func)
+#endif
+#endif
+
/* Forward Declarations */
#ifndef __ID3D12Object_FWD_DEFINED__
@@ -295,6 +304,20 @@ typedef interface ID3D12DeviceRemovedExtendedDataSettings ID3D12DeviceRemovedExt
#endif /* __ID3D12DeviceRemovedExtendedDataSettings_FWD_DEFINED__ */
+#ifndef __ID3D12DeviceRemovedExtendedDataSettings1_FWD_DEFINED__
+#define __ID3D12DeviceRemovedExtendedDataSettings1_FWD_DEFINED__
+typedef interface ID3D12DeviceRemovedExtendedDataSettings1 ID3D12DeviceRemovedExtendedDataSettings1;
+
+#endif /* __ID3D12DeviceRemovedExtendedDataSettings1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceRemovedExtendedDataSettings2_FWD_DEFINED__
+#define __ID3D12DeviceRemovedExtendedDataSettings2_FWD_DEFINED__
+typedef interface ID3D12DeviceRemovedExtendedDataSettings2 ID3D12DeviceRemovedExtendedDataSettings2;
+
+#endif /* __ID3D12DeviceRemovedExtendedDataSettings2_FWD_DEFINED__ */
+
+
#ifndef __ID3D12DeviceRemovedExtendedData_FWD_DEFINED__
#define __ID3D12DeviceRemovedExtendedData_FWD_DEFINED__
typedef interface ID3D12DeviceRemovedExtendedData ID3D12DeviceRemovedExtendedData;
@@ -302,6 +325,20 @@ typedef interface ID3D12DeviceRemovedExtendedData ID3D12DeviceRemovedExtendedDat
#endif /* __ID3D12DeviceRemovedExtendedData_FWD_DEFINED__ */
+#ifndef __ID3D12DeviceRemovedExtendedData1_FWD_DEFINED__
+#define __ID3D12DeviceRemovedExtendedData1_FWD_DEFINED__
+typedef interface ID3D12DeviceRemovedExtendedData1 ID3D12DeviceRemovedExtendedData1;
+
+#endif /* __ID3D12DeviceRemovedExtendedData1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceRemovedExtendedData2_FWD_DEFINED__
+#define __ID3D12DeviceRemovedExtendedData2_FWD_DEFINED__
+typedef interface ID3D12DeviceRemovedExtendedData2 ID3D12DeviceRemovedExtendedData2;
+
+#endif /* __ID3D12DeviceRemovedExtendedData2_FWD_DEFINED__ */
+
+
#ifndef __ID3D12Device6_FWD_DEFINED__
#define __ID3D12Device6_FWD_DEFINED__
typedef interface ID3D12Device6 ID3D12Device6;
@@ -309,6 +346,27 @@ typedef interface ID3D12Device6 ID3D12Device6;
#endif /* __ID3D12Device6_FWD_DEFINED__ */
+#ifndef __ID3D12ProtectedResourceSession1_FWD_DEFINED__
+#define __ID3D12ProtectedResourceSession1_FWD_DEFINED__
+typedef interface ID3D12ProtectedResourceSession1 ID3D12ProtectedResourceSession1;
+
+#endif /* __ID3D12ProtectedResourceSession1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device7_FWD_DEFINED__
+#define __ID3D12Device7_FWD_DEFINED__
+typedef interface ID3D12Device7 ID3D12Device7;
+
+#endif /* __ID3D12Device7_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device8_FWD_DEFINED__
+#define __ID3D12Device8_FWD_DEFINED__
+typedef interface ID3D12Device8 ID3D12Device8;
+
+#endif /* __ID3D12Device8_FWD_DEFINED__ */
+
+
#ifndef __ID3D12Resource1_FWD_DEFINED__
#define __ID3D12Resource1_FWD_DEFINED__
typedef interface ID3D12Resource1 ID3D12Resource1;
@@ -316,6 +374,13 @@ typedef interface ID3D12Resource1 ID3D12Resource1;
#endif /* __ID3D12Resource1_FWD_DEFINED__ */
+#ifndef __ID3D12Resource2_FWD_DEFINED__
+#define __ID3D12Resource2_FWD_DEFINED__
+typedef interface ID3D12Resource2 ID3D12Resource2;
+
+#endif /* __ID3D12Resource2_FWD_DEFINED__ */
+
+
#ifndef __ID3D12Heap1_FWD_DEFINED__
#define __ID3D12Heap1_FWD_DEFINED__
typedef interface ID3D12Heap1 ID3D12Heap1;
@@ -344,6 +409,41 @@ typedef interface ID3D12GraphicsCommandList4 ID3D12GraphicsCommandList4;
#endif /* __ID3D12GraphicsCommandList4_FWD_DEFINED__ */
+#ifndef __ID3D12ShaderCacheSession_FWD_DEFINED__
+#define __ID3D12ShaderCacheSession_FWD_DEFINED__
+typedef interface ID3D12ShaderCacheSession ID3D12ShaderCacheSession;
+
+#endif /* __ID3D12ShaderCacheSession_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device9_FWD_DEFINED__
+#define __ID3D12Device9_FWD_DEFINED__
+typedef interface ID3D12Device9 ID3D12Device9;
+
+#endif /* __ID3D12Device9_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device10_FWD_DEFINED__
+#define __ID3D12Device10_FWD_DEFINED__
+typedef interface ID3D12Device10 ID3D12Device10;
+
+#endif /* __ID3D12Device10_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Device11_FWD_DEFINED__
+#define __ID3D12Device11_FWD_DEFINED__
+typedef interface ID3D12Device11 ID3D12Device11;
+
+#endif /* __ID3D12Device11_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VirtualizationGuestDevice_FWD_DEFINED__
+#define __ID3D12VirtualizationGuestDevice_FWD_DEFINED__
+typedef interface ID3D12VirtualizationGuestDevice ID3D12VirtualizationGuestDevice;
+
+#endif /* __ID3D12VirtualizationGuestDevice_FWD_DEFINED__ */
+
+
#ifndef __ID3D12Tools_FWD_DEFINED__
#define __ID3D12Tools_FWD_DEFINED__
typedef interface ID3D12Tools ID3D12Tools;
@@ -351,6 +451,34 @@ typedef interface ID3D12Tools ID3D12Tools;
#endif /* __ID3D12Tools_FWD_DEFINED__ */
+#ifndef __ID3D12SDKConfiguration_FWD_DEFINED__
+#define __ID3D12SDKConfiguration_FWD_DEFINED__
+typedef interface ID3D12SDKConfiguration ID3D12SDKConfiguration;
+
+#endif /* __ID3D12SDKConfiguration_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12SDKConfiguration1_FWD_DEFINED__
+#define __ID3D12SDKConfiguration1_FWD_DEFINED__
+typedef interface ID3D12SDKConfiguration1 ID3D12SDKConfiguration1;
+
+#endif /* __ID3D12SDKConfiguration1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceFactory_FWD_DEFINED__
+#define __ID3D12DeviceFactory_FWD_DEFINED__
+typedef interface ID3D12DeviceFactory ID3D12DeviceFactory;
+
+#endif /* __ID3D12DeviceFactory_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceConfiguration_FWD_DEFINED__
+#define __ID3D12DeviceConfiguration_FWD_DEFINED__
+typedef interface ID3D12DeviceConfiguration ID3D12DeviceConfiguration;
+
+#endif /* __ID3D12DeviceConfiguration_FWD_DEFINED__ */
+
+
#ifndef __ID3D12GraphicsCommandList5_FWD_DEFINED__
#define __ID3D12GraphicsCommandList5_FWD_DEFINED__
typedef interface ID3D12GraphicsCommandList5 ID3D12GraphicsCommandList5;
@@ -358,6 +486,27 @@ typedef interface ID3D12GraphicsCommandList5 ID3D12GraphicsCommandList5;
#endif /* __ID3D12GraphicsCommandList5_FWD_DEFINED__ */
+#ifndef __ID3D12GraphicsCommandList6_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList6_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList6 ID3D12GraphicsCommandList6;
+
+#endif /* __ID3D12GraphicsCommandList6_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList7_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList7_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList7 ID3D12GraphicsCommandList7;
+
+#endif /* __ID3D12GraphicsCommandList7_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList8_FWD_DEFINED__
+#define __ID3D12GraphicsCommandList8_FWD_DEFINED__
+typedef interface ID3D12GraphicsCommandList8 ID3D12GraphicsCommandList8;
+
+#endif /* __ID3D12GraphicsCommandList8_FWD_DEFINED__ */
+
+
/* header files for imported files */
#include "oaidl.h"
#include "ocidl.h"
@@ -373,6 +522,9 @@ extern "C"{
/* interface __MIDL_itf_d3d12_0000_0000 */
/* [local] */
+#include <winapifamily.h>
+//#pragma region App Family
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES)
#ifndef _D3D12_CONSTANTS
#define _D3D12_CONSTANTS
#define D3D12_16BIT_INDEX_STRIP_CUT_VALUE ( 0xffff )
@@ -887,6 +1039,8 @@ extern "C"{
#define D3D12_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 15 )
+#define D3D12_PREVIEW_SDK_VERSION ( 706 )
+
#define D3D12_PRE_SCISSOR_PIXEL_ADDRESS_RANGE_BIT_COUNT ( 16 )
#define D3D12_PS_CS_UAV_REGISTER_COMPONENTS ( 1 )
@@ -1018,6 +1172,8 @@ extern "C"{
#define D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT ( 2 )
+#define D3D12_SDK_VERSION ( 606 )
+
#define D3D12_SHADER_IDENTIFIER_SIZE_IN_BYTES ( 32 )
#define D3D12_SHADER_MAJOR_VERSION ( 5 )
@@ -1181,7 +1337,8 @@ enum D3D12_COMMAND_LIST_TYPE
D3D12_COMMAND_LIST_TYPE_COPY = 3,
D3D12_COMMAND_LIST_TYPE_VIDEO_DECODE = 4,
D3D12_COMMAND_LIST_TYPE_VIDEO_PROCESS = 5,
- D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE = 6
+ D3D12_COMMAND_LIST_TYPE_VIDEO_ENCODE = 6,
+ D3D12_COMMAND_LIST_TYPE_NONE = -1
} D3D12_COMMAND_LIST_TYPE;
typedef
@@ -1290,6 +1447,7 @@ typedef struct D3D12_BOX
typedef
enum D3D12_COMPARISON_FUNC
{
+ D3D12_COMPARISON_FUNC_NONE = 0,
D3D12_COMPARISON_FUNC_NEVER = 1,
D3D12_COMPARISON_FUNC_LESS = 2,
D3D12_COMPARISON_FUNC_EQUAL = 3,
@@ -1353,6 +1511,27 @@ typedef struct D3D12_DEPTH_STENCIL_DESC1
BOOL DepthBoundsTestEnable;
} D3D12_DEPTH_STENCIL_DESC1;
+typedef struct D3D12_DEPTH_STENCILOP_DESC1
+ {
+ D3D12_STENCIL_OP StencilFailOp;
+ D3D12_STENCIL_OP StencilDepthFailOp;
+ D3D12_STENCIL_OP StencilPassOp;
+ D3D12_COMPARISON_FUNC StencilFunc;
+ UINT8 StencilReadMask;
+ UINT8 StencilWriteMask;
+ } D3D12_DEPTH_STENCILOP_DESC1;
+
+typedef struct D3D12_DEPTH_STENCIL_DESC2
+ {
+ BOOL DepthEnable;
+ D3D12_DEPTH_WRITE_MASK DepthWriteMask;
+ D3D12_COMPARISON_FUNC DepthFunc;
+ BOOL StencilEnable;
+ D3D12_DEPTH_STENCILOP_DESC1 FrontFace;
+ D3D12_DEPTH_STENCILOP_DESC1 BackFace;
+ BOOL DepthBoundsTestEnable;
+ } D3D12_DEPTH_STENCIL_DESC2;
+
typedef
enum D3D12_BLEND
{
@@ -1372,7 +1551,9 @@ enum D3D12_BLEND
D3D12_BLEND_SRC1_COLOR = 16,
D3D12_BLEND_INV_SRC1_COLOR = 17,
D3D12_BLEND_SRC1_ALPHA = 18,
- D3D12_BLEND_INV_SRC1_ALPHA = 19
+ D3D12_BLEND_INV_SRC1_ALPHA = 19,
+ D3D12_BLEND_ALPHA_FACTOR = 20,
+ D3D12_BLEND_INV_ALPHA_FACTOR = 21
} D3D12_BLEND;
typedef
@@ -1507,34 +1688,41 @@ EXTERN_C const IID IID_ID3D12Object;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Object * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Object * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Object * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Object * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Object * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Object * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Object * This,
_In_z_ LPCWSTR Name);
@@ -1613,38 +1801,46 @@ EXTERN_C const IID IID_ID3D12DeviceChild;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12DeviceChild * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12DeviceChild * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12DeviceChild * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12DeviceChild * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12DeviceChild * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12DeviceChild * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12DeviceChild * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12DeviceChild * This,
REFIID riid,
@@ -1724,38 +1920,46 @@ EXTERN_C const IID IID_ID3D12RootSignature;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12RootSignature * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12RootSignature * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12RootSignature * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12RootSignature * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12RootSignature * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12RootSignature * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12RootSignature * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12RootSignature * This,
REFIID riid,
@@ -1929,7 +2133,10 @@ enum D3D12_PIPELINE_STATE_SUBOBJECT_TYPE
D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_CACHED_PSO + 1 ) ,
D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1 = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_FLAGS + 1 ) ,
D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL1 + 1 ) ,
- D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_VIEW_INSTANCING + 1 )
+ D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_AS = 24,
+ D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MS = 25,
+ D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 = 26,
+ D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_PIPELINE_STATE_SUBOBJECT_TYPE_DEPTH_STENCIL2 + 1 )
} D3D12_PIPELINE_STATE_SUBOBJECT_TYPE;
typedef
@@ -1956,8 +2163,20 @@ enum D3D12_FEATURE
D3D12_FEATURE_SERIALIZATION = 24,
D3D12_FEATURE_CROSS_NODE = 25,
D3D12_FEATURE_D3D12_OPTIONS5 = 27,
+ D3D12_FEATURE_DISPLAYABLE = 28,
D3D12_FEATURE_D3D12_OPTIONS6 = 30,
- D3D12_FEATURE_QUERY_META_COMMAND = 31
+ D3D12_FEATURE_QUERY_META_COMMAND = 31,
+ D3D12_FEATURE_D3D12_OPTIONS7 = 32,
+ D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPE_COUNT = 33,
+ D3D12_FEATURE_PROTECTED_RESOURCE_SESSION_TYPES = 34,
+ D3D12_FEATURE_D3D12_OPTIONS8 = 36,
+ D3D12_FEATURE_D3D12_OPTIONS9 = 37,
+ D3D12_FEATURE_D3D12_OPTIONS10 = 39,
+ D3D12_FEATURE_D3D12_OPTIONS11 = 40,
+ D3D12_FEATURE_D3D12_OPTIONS12 = 41,
+ D3D12_FEATURE_D3D12_OPTIONS13 = 42,
+ D3D12_FEATURE_D3D12_OPTIONS14 = 43,
+ D3D12_FEATURE_D3D12_OPTIONS15 = 44
} D3D12_FEATURE;
typedef
@@ -2046,7 +2265,8 @@ enum D3D12_FORMAT_SUPPORT2
D3D12_FORMAT_SUPPORT2_UAV_TYPED_STORE = 0x80,
D3D12_FORMAT_SUPPORT2_OUTPUT_MERGER_LOGIC_OP = 0x100,
D3D12_FORMAT_SUPPORT2_TILED = 0x200,
- D3D12_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x4000
+ D3D12_FORMAT_SUPPORT2_MULTIPLANE_OVERLAY = 0x4000,
+ D3D12_FORMAT_SUPPORT2_SAMPLER_FEEDBACK = 0x8000
} D3D12_FORMAT_SUPPORT2;
DEFINE_ENUM_FLAG_OPERATORS( D3D12_FORMAT_SUPPORT2 );
@@ -2173,7 +2393,11 @@ enum D3D_SHADER_MODEL
D3D_SHADER_MODEL_6_2 = 0x62,
D3D_SHADER_MODEL_6_3 = 0x63,
D3D_SHADER_MODEL_6_4 = 0x64,
- D3D_SHADER_MODEL_6_5 = 0x65
+ D3D_SHADER_MODEL_6_5 = 0x65,
+ D3D_SHADER_MODEL_6_6 = 0x66,
+ D3D_SHADER_MODEL_6_7 = 0x67,
+ D3D_SHADER_MODEL_6_8 = 0x68,
+ D3D_HIGHEST_SHADER_MODEL = D3D_SHADER_MODEL_6_8
} D3D_SHADER_MODEL;
typedef struct D3D12_FEATURE_DATA_SHADER_MODEL
@@ -2215,7 +2439,10 @@ enum D3D12_SHADER_CACHE_SUPPORT_FLAGS
D3D12_SHADER_CACHE_SUPPORT_SINGLE_PSO = 0x1,
D3D12_SHADER_CACHE_SUPPORT_LIBRARY = 0x2,
D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_INPROC_CACHE = 0x4,
- D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE = 0x8
+ D3D12_SHADER_CACHE_SUPPORT_AUTOMATIC_DISK_CACHE = 0x8,
+ D3D12_SHADER_CACHE_SUPPORT_DRIVER_MANAGED_CACHE = 0x10,
+ D3D12_SHADER_CACHE_SUPPORT_SHADER_CONTROL_CLEAR = 0x20,
+ D3D12_SHADER_CACHE_SUPPORT_SHADER_SESSION_DELETE = 0x40
} D3D12_SHADER_CACHE_SUPPORT_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_SUPPORT_FLAGS );
@@ -2263,9 +2490,16 @@ typedef
enum D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER
{
D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0 = 0,
- D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_1 = ( D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0 + 1 )
+ D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_1 = ( D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_0 + 1 ) ,
+ D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_2 = ( D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER_1 + 1 )
} D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER;
+typedef struct D3D12_FEATURE_DATA_DISPLAYABLE
+ {
+ _Out_ BOOL DisplayableTexture;
+ _Out_ D3D12_SHARED_RESOURCE_COMPATIBILITY_TIER SharedResourceCompatibilityTier;
+ } D3D12_FEATURE_DATA_DISPLAYABLE;
+
typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS4
{
_Out_ BOOL MSAA64KBAlignedTextureSupported;
@@ -2304,7 +2538,8 @@ typedef
enum D3D12_RAYTRACING_TIER
{
D3D12_RAYTRACING_TIER_NOT_SUPPORTED = 0,
- D3D12_RAYTRACING_TIER_1_0 = 10
+ D3D12_RAYTRACING_TIER_1_0 = 10,
+ D3D12_RAYTRACING_TIER_1_1 = 11
} D3D12_RAYTRACING_TIER;
typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS5
@@ -2331,6 +2566,27 @@ typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS6
_Out_ BOOL BackgroundProcessingSupported;
} D3D12_FEATURE_DATA_D3D12_OPTIONS6;
+typedef
+enum D3D12_MESH_SHADER_TIER
+ {
+ D3D12_MESH_SHADER_TIER_NOT_SUPPORTED = 0,
+ D3D12_MESH_SHADER_TIER_1 = 10
+ } D3D12_MESH_SHADER_TIER;
+
+typedef
+enum D3D12_SAMPLER_FEEDBACK_TIER
+ {
+ D3D12_SAMPLER_FEEDBACK_TIER_NOT_SUPPORTED = 0,
+ D3D12_SAMPLER_FEEDBACK_TIER_0_9 = 90,
+ D3D12_SAMPLER_FEEDBACK_TIER_1_0 = 100
+ } D3D12_SAMPLER_FEEDBACK_TIER;
+
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS7
+ {
+ _Out_ D3D12_MESH_SHADER_TIER MeshShaderTier;
+ _Out_ D3D12_SAMPLER_FEEDBACK_TIER SamplerFeedbackTier;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS7;
+
typedef struct D3D12_FEATURE_DATA_QUERY_META_COMMAND
{
_In_ GUID CommandId;
@@ -2341,6 +2597,77 @@ typedef struct D3D12_FEATURE_DATA_QUERY_META_COMMAND
_In_ SIZE_T QueryOutputDataSizeInBytes;
} D3D12_FEATURE_DATA_QUERY_META_COMMAND;
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS8
+ {
+ _Out_ BOOL UnalignedBlockTexturesSupported;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS8;
+
+typedef
+enum D3D12_WAVE_MMA_TIER
+ {
+ D3D12_WAVE_MMA_TIER_NOT_SUPPORTED = 0,
+ D3D12_WAVE_MMA_TIER_1_0 = 10
+ } D3D12_WAVE_MMA_TIER;
+
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS9
+ {
+ _Out_ BOOL MeshShaderPipelineStatsSupported;
+ _Out_ BOOL MeshShaderSupportsFullRangeRenderTargetArrayIndex;
+ _Out_ BOOL AtomicInt64OnTypedResourceSupported;
+ _Out_ BOOL AtomicInt64OnGroupSharedSupported;
+ _Out_ BOOL DerivativesInMeshAndAmplificationShadersSupported;
+ _Out_ D3D12_WAVE_MMA_TIER WaveMMATier;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS9;
+
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS10
+ {
+ _Out_ BOOL VariableRateShadingSumCombinerSupported;
+ _Out_ BOOL MeshShaderPerPrimitiveShadingRateSupported;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS10;
+
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS11
+ {
+ _Out_ BOOL AtomicInt64OnDescriptorHeapResourceSupported;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS11;
+
+typedef
+enum D3D12_TRI_STATE
+ {
+ D3D12_TRI_STATE_UNKNOWN = -1,
+ D3D12_TRI_STATE_FALSE = 0,
+ D3D12_TRI_STATE_TRUE = 1
+ } D3D12_TRI_STATE;
+
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS12
+ {
+ _Out_ D3D12_TRI_STATE MSPrimitivesPipelineStatisticIncludesCulledPrimitives;
+ _Out_ BOOL EnhancedBarriersSupported;
+ _Out_ BOOL RelaxedFormatCastingSupported;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS12;
+
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS13
+ {
+ _Out_ BOOL UnrestrictedBufferTextureCopyPitchSupported;
+ _Out_ BOOL UnrestrictedVertexElementAlignmentSupported;
+ _Out_ BOOL InvertedViewportHeightFlipsYSupported;
+ _Out_ BOOL InvertedViewportDepthFlipsZSupported;
+ _Out_ BOOL TextureCopyBetweenDimensionsSupported;
+ _Out_ BOOL AlphaBlendFactorSupported;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS13;
+
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS14
+ {
+ _Out_ BOOL AdvancedTextureOpsSupported;
+ _Out_ BOOL WriteableMSAATexturesSupported;
+ _Out_ BOOL IndependentFrontAndBackStencilRefMaskSupported;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS14;
+
+typedef struct D3D12_FEATURE_DATA_D3D12_OPTIONS15
+ {
+ _Out_ BOOL TriangleFanSupported;
+ _Out_ BOOL DynamicIndexBufferStripCutSupported;
+ } D3D12_FEATURE_DATA_D3D12_OPTIONS15;
+
typedef struct D3D12_RESOURCE_ALLOCATION_INFO
{
UINT64 SizeInBytes;
@@ -2402,6 +2729,8 @@ enum D3D12_HEAP_FLAGS
D3D12_HEAP_FLAG_HARDWARE_PROTECTED = 0x100,
D3D12_HEAP_FLAG_ALLOW_WRITE_WATCH = 0x200,
D3D12_HEAP_FLAG_ALLOW_SHADER_ATOMICS = 0x400,
+ D3D12_HEAP_FLAG_CREATE_NOT_RESIDENT = 0x800,
+ D3D12_HEAP_FLAG_CREATE_NOT_ZEROED = 0x1000,
D3D12_HEAP_FLAG_ALLOW_ALL_BUFFERS_AND_TEXTURES = 0,
D3D12_HEAP_FLAG_ALLOW_ONLY_BUFFERS = 0xc0,
D3D12_HEAP_FLAG_ALLOW_ONLY_NON_RT_DS_TEXTURES = 0x44,
@@ -2446,10 +2775,19 @@ enum D3D12_RESOURCE_FLAGS
D3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE = 0x8,
D3D12_RESOURCE_FLAG_ALLOW_CROSS_ADAPTER = 0x10,
D3D12_RESOURCE_FLAG_ALLOW_SIMULTANEOUS_ACCESS = 0x20,
- D3D12_RESOURCE_FLAG_VIDEO_DECODE_REFERENCE_ONLY = 0x40
+ D3D12_RESOURCE_FLAG_VIDEO_DECODE_REFERENCE_ONLY = 0x40,
+ D3D12_RESOURCE_FLAG_VIDEO_ENCODE_REFERENCE_ONLY = 0x80,
+ D3D12_RESOURCE_FLAG_RAYTRACING_ACCELERATION_STRUCTURE = 0x100
} D3D12_RESOURCE_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS( D3D12_RESOURCE_FLAGS );
+typedef struct D3D12_MIP_REGION
+ {
+ UINT Width;
+ UINT Height;
+ UINT Depth;
+ } D3D12_MIP_REGION;
+
typedef struct D3D12_RESOURCE_DESC
{
D3D12_RESOURCE_DIMENSION Dimension;
@@ -2464,6 +2802,21 @@ typedef struct D3D12_RESOURCE_DESC
D3D12_RESOURCE_FLAGS Flags;
} D3D12_RESOURCE_DESC;
+typedef struct D3D12_RESOURCE_DESC1
+ {
+ D3D12_RESOURCE_DIMENSION Dimension;
+ UINT64 Alignment;
+ UINT64 Width;
+ UINT Height;
+ UINT16 DepthOrArraySize;
+ UINT16 MipLevels;
+ DXGI_FORMAT Format;
+ DXGI_SAMPLE_DESC SampleDesc;
+ D3D12_TEXTURE_LAYOUT Layout;
+ D3D12_RESOURCE_FLAGS Flags;
+ D3D12_MIP_REGION SamplerFeedbackMipRegion;
+ } D3D12_RESOURCE_DESC1;
+
typedef struct D3D12_DEPTH_STENCIL_VALUE
{
FLOAT Depth;
@@ -2593,6 +2946,7 @@ enum D3D12_RESOURCE_STATES
D3D12_RESOURCE_STATE_RAYTRACING_ACCELERATION_STRUCTURE = 0x400000,
D3D12_RESOURCE_STATE_SHADING_RATE_SOURCE = 0x1000000,
D3D12_RESOURCE_STATE_GENERIC_READ = ( ( ( ( ( 0x1 | 0x2 ) | 0x40 ) | 0x80 ) | 0x200 ) | 0x800 ) ,
+ D3D12_RESOURCE_STATE_ALL_SHADER_RESOURCE = ( 0x40 | 0x80 ) ,
D3D12_RESOURCE_STATE_PRESENT = 0,
D3D12_RESOURCE_STATE_PREDICATION = 0x200,
D3D12_RESOURCE_STATE_VIDEO_DECODE_READ = 0x10000,
@@ -2692,7 +3046,9 @@ enum D3D12_RESOLVE_MODE
D3D12_RESOLVE_MODE_DECOMPRESS = 0,
D3D12_RESOLVE_MODE_MIN = 1,
D3D12_RESOLVE_MODE_MAX = 2,
- D3D12_RESOLVE_MODE_AVERAGE = 3
+ D3D12_RESOLVE_MODE_AVERAGE = 3,
+ D3D12_RESOLVE_MODE_ENCODE_SAMPLER_FEEDBACK = 4,
+ D3D12_RESOLVE_MODE_DECODE_SAMPLER_FEEDBACK = 5
} D3D12_RESOLVE_MODE;
typedef struct D3D12_SAMPLE_POSITION
@@ -3004,6 +3360,33 @@ typedef struct D3D12_SAMPLER_DESC
} D3D12_SAMPLER_DESC;
typedef
+enum D3D12_SAMPLER_FLAGS
+ {
+ D3D12_SAMPLER_FLAG_NONE = 0,
+ D3D12_SAMPLER_FLAG_UINT_BORDER_COLOR = 0x1
+ } D3D12_SAMPLER_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_SAMPLER_FLAGS );
+typedef struct D3D12_SAMPLER_DESC2
+ {
+ D3D12_FILTER Filter;
+ D3D12_TEXTURE_ADDRESS_MODE AddressU;
+ D3D12_TEXTURE_ADDRESS_MODE AddressV;
+ D3D12_TEXTURE_ADDRESS_MODE AddressW;
+ FLOAT MipLODBias;
+ UINT MaxAnisotropy;
+ D3D12_COMPARISON_FUNC ComparisonFunc;
+ union
+ {
+ FLOAT FloatBorderColor[ 4 ];
+ UINT UintBorderColor[ 4 ];
+ } ;
+ FLOAT MinLOD;
+ FLOAT MaxLOD;
+ D3D12_SAMPLER_FLAGS Flags;
+ } D3D12_SAMPLER_DESC2;
+
+typedef
enum D3D12_BUFFER_UAV_FLAGS
{
D3D12_BUFFER_UAV_FLAG_NONE = 0,
@@ -3046,6 +3429,17 @@ typedef struct D3D12_TEX2D_ARRAY_UAV
UINT PlaneSlice;
} D3D12_TEX2D_ARRAY_UAV;
+typedef struct D3D12_TEX2DMS_UAV
+ {
+ UINT UnusedField_NothingToDefine;
+ } D3D12_TEX2DMS_UAV;
+
+typedef struct D3D12_TEX2DMS_ARRAY_UAV
+ {
+ UINT FirstArraySlice;
+ UINT ArraySize;
+ } D3D12_TEX2DMS_ARRAY_UAV;
+
typedef struct D3D12_TEX3D_UAV
{
UINT MipSlice;
@@ -3062,6 +3456,8 @@ enum D3D12_UAV_DIMENSION
D3D12_UAV_DIMENSION_TEXTURE1DARRAY = 3,
D3D12_UAV_DIMENSION_TEXTURE2D = 4,
D3D12_UAV_DIMENSION_TEXTURE2DARRAY = 5,
+ D3D12_UAV_DIMENSION_TEXTURE2DMS = 6,
+ D3D12_UAV_DIMENSION_TEXTURE2DMSARRAY = 7,
D3D12_UAV_DIMENSION_TEXTURE3D = 8
} D3D12_UAV_DIMENSION;
@@ -3076,6 +3472,8 @@ typedef struct D3D12_UNORDERED_ACCESS_VIEW_DESC
D3D12_TEX1D_ARRAY_UAV Texture1DArray;
D3D12_TEX2D_UAV Texture2D;
D3D12_TEX2D_ARRAY_UAV Texture2DArray;
+ D3D12_TEX2DMS_UAV Texture2DMS;
+ D3D12_TEX2DMS_ARRAY_UAV Texture2DMSArray;
D3D12_TEX3D_UAV Texture3D;
} ;
} D3D12_UNORDERED_ACCESS_VIEW_DESC;
@@ -3322,7 +3720,9 @@ enum D3D12_SHADER_VISIBILITY
D3D12_SHADER_VISIBILITY_HULL = 2,
D3D12_SHADER_VISIBILITY_DOMAIN = 3,
D3D12_SHADER_VISIBILITY_GEOMETRY = 4,
- D3D12_SHADER_VISIBILITY_PIXEL = 5
+ D3D12_SHADER_VISIBILITY_PIXEL = 5,
+ D3D12_SHADER_VISIBILITY_AMPLIFICATION = 6,
+ D3D12_SHADER_VISIBILITY_MESH = 7
} D3D12_SHADER_VISIBILITY;
typedef
@@ -3358,7 +3758,11 @@ enum D3D12_ROOT_SIGNATURE_FLAGS
D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS = 0x10,
D3D12_ROOT_SIGNATURE_FLAG_DENY_PIXEL_SHADER_ROOT_ACCESS = 0x20,
D3D12_ROOT_SIGNATURE_FLAG_ALLOW_STREAM_OUTPUT = 0x40,
- D3D12_ROOT_SIGNATURE_FLAG_LOCAL_ROOT_SIGNATURE = 0x80
+ D3D12_ROOT_SIGNATURE_FLAG_LOCAL_ROOT_SIGNATURE = 0x80,
+ D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS = 0x100,
+ D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS = 0x200,
+ D3D12_ROOT_SIGNATURE_FLAG_CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED = 0x400,
+ D3D12_ROOT_SIGNATURE_FLAG_SAMPLER_HEAP_DIRECTLY_INDEXED = 0x800
} D3D12_ROOT_SIGNATURE_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS( D3D12_ROOT_SIGNATURE_FLAGS );
@@ -3367,7 +3771,9 @@ enum D3D12_STATIC_BORDER_COLOR
{
D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK = 0,
D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK = ( D3D12_STATIC_BORDER_COLOR_TRANSPARENT_BLACK + 1 ) ,
- D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE = ( D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK + 1 )
+ D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE = ( D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK + 1 ) ,
+ D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK_UINT = ( D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE + 1 ) ,
+ D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE_UINT = ( D3D12_STATIC_BORDER_COLOR_OPAQUE_BLACK_UINT + 1 )
} D3D12_STATIC_BORDER_COLOR;
typedef struct D3D12_STATIC_SAMPLER_DESC
@@ -3503,17 +3909,21 @@ EXTERN_C const IID IID_ID3D12RootSignatureDeserializer;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12RootSignatureDeserializer * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12RootSignatureDeserializer * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12RootSignatureDeserializer * This);
+ DECLSPEC_XFGVIRT(ID3D12RootSignatureDeserializer, GetRootSignatureDesc)
const D3D12_ROOT_SIGNATURE_DESC *( STDMETHODCALLTYPE *GetRootSignatureDesc )(
ID3D12RootSignatureDeserializer * This);
@@ -3584,22 +3994,27 @@ EXTERN_C const IID IID_ID3D12VersionedRootSignatureDeserializer;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12VersionedRootSignatureDeserializer * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12VersionedRootSignatureDeserializer * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12VersionedRootSignatureDeserializer * This);
+ DECLSPEC_XFGVIRT(ID3D12VersionedRootSignatureDeserializer, GetRootSignatureDescAtVersion)
HRESULT ( STDMETHODCALLTYPE *GetRootSignatureDescAtVersion )(
ID3D12VersionedRootSignatureDeserializer * This,
D3D_ROOT_SIGNATURE_VERSION convertToVersion,
_Out_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC **ppDesc);
+ DECLSPEC_XFGVIRT(ID3D12VersionedRootSignatureDeserializer, GetUnconvertedRootSignatureDesc)
const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *( STDMETHODCALLTYPE *GetUnconvertedRootSignatureDesc )(
ID3D12VersionedRootSignatureDeserializer * This);
@@ -3720,7 +4135,8 @@ enum D3D12_QUERY_HEAP_TYPE
D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS = 2,
D3D12_QUERY_HEAP_TYPE_SO_STATISTICS = 3,
D3D12_QUERY_HEAP_TYPE_VIDEO_DECODE_STATISTICS = 4,
- D3D12_QUERY_HEAP_TYPE_COPY_QUEUE_TIMESTAMP = 5
+ D3D12_QUERY_HEAP_TYPE_COPY_QUEUE_TIMESTAMP = 5,
+ D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS1 = 7
} D3D12_QUERY_HEAP_TYPE;
typedef struct D3D12_QUERY_HEAP_DESC
@@ -3741,7 +4157,8 @@ enum D3D12_QUERY_TYPE
D3D12_QUERY_TYPE_SO_STATISTICS_STREAM1 = 5,
D3D12_QUERY_TYPE_SO_STATISTICS_STREAM2 = 6,
D3D12_QUERY_TYPE_SO_STATISTICS_STREAM3 = 7,
- D3D12_QUERY_TYPE_VIDEO_DECODE_STATISTICS = 8
+ D3D12_QUERY_TYPE_VIDEO_DECODE_STATISTICS = 8,
+ D3D12_QUERY_TYPE_PIPELINE_STATISTICS1 = 10
} D3D12_QUERY_TYPE;
typedef
@@ -3766,6 +4183,24 @@ typedef struct D3D12_QUERY_DATA_PIPELINE_STATISTICS
UINT64 CSInvocations;
} D3D12_QUERY_DATA_PIPELINE_STATISTICS;
+typedef struct D3D12_QUERY_DATA_PIPELINE_STATISTICS1
+ {
+ UINT64 IAVertices;
+ UINT64 IAPrimitives;
+ UINT64 VSInvocations;
+ UINT64 GSInvocations;
+ UINT64 GSPrimitives;
+ UINT64 CInvocations;
+ UINT64 CPrimitives;
+ UINT64 PSInvocations;
+ UINT64 HSInvocations;
+ UINT64 DSInvocations;
+ UINT64 CSInvocations;
+ UINT64 ASInvocations;
+ UINT64 MSInvocations;
+ UINT64 MSPrimitives;
+ } D3D12_QUERY_DATA_PIPELINE_STATISTICS1;
+
typedef struct D3D12_QUERY_DATA_SO_STATISTICS
{
UINT64 NumPrimitivesWritten;
@@ -3828,7 +4263,9 @@ enum D3D12_INDIRECT_ARGUMENT_TYPE
D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT = ( D3D12_INDIRECT_ARGUMENT_TYPE_INDEX_BUFFER_VIEW + 1 ) ,
D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT + 1 ) ,
D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_CONSTANT_BUFFER_VIEW + 1 ) ,
- D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW + 1 )
+ D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW = ( D3D12_INDIRECT_ARGUMENT_TYPE_SHADER_RESOURCE_VIEW + 1 ) ,
+ D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_RAYS = ( D3D12_INDIRECT_ARGUMENT_TYPE_UNORDERED_ACCESS_VIEW + 1 ) ,
+ D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_MESH = ( D3D12_INDIRECT_ARGUMENT_TYPE_DISPATCH_RAYS + 1 )
} D3D12_INDIRECT_ARGUMENT_TYPE;
typedef struct D3D12_INDIRECT_ARGUMENT_DESC
@@ -3899,38 +4336,46 @@ EXTERN_C const IID IID_ID3D12Pageable;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Pageable * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Pageable * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Pageable * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Pageable * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Pageable * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Pageable * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Pageable * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12Pageable * This,
REFIID riid,
@@ -4002,7 +4447,12 @@ EXTERN_C const IID IID_ID3D12Heap;
ID3D12Heap : public ID3D12Pageable
{
public:
+#if defined(_MSC_VER)
virtual D3D12_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+#else
+ virtual D3D12_HEAP_DESC *STDMETHODCALLTYPE GetDesc(
+ D3D12_HEAP_DESC * RetVal) = 0;
+#endif
};
@@ -4013,46 +4463,63 @@ EXTERN_C const IID IID_ID3D12Heap;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Heap * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Heap * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Heap * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Heap * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Heap * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Heap * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Heap * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12Heap * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12Heap, GetDesc)
+#if !defined(_WIN32)
D3D12_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )(
ID3D12Heap * This);
+#else
+ D3D12_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12Heap * This,
+ D3D12_HEAP_DESC * RetVal);
+
+#endif
+
END_INTERFACE
} ID3D12HeapVtbl;
@@ -4093,9 +4560,14 @@ EXTERN_C const IID IID_ID3D12Heap;
( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+#if !defined(_WIN32)
#define ID3D12Heap_GetDesc(This) \
( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12Heap_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
#endif /* COBJMACROS */
@@ -4105,10 +4577,6 @@ EXTERN_C const IID IID_ID3D12Heap;
-
-
-
-
#endif /* __ID3D12Heap_INTERFACE_DEFINED__ */
@@ -4136,7 +4604,12 @@ EXTERN_C const IID IID_ID3D12Resource;
UINT Subresource,
_In_opt_ const D3D12_RANGE *pWrittenRange) = 0;
+#if defined(_MSC_VER)
virtual D3D12_RESOURCE_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+#else
+ virtual D3D12_RESOURCE_DESC *STDMETHODCALLTYPE GetDesc(
+ D3D12_RESOURCE_DESC * RetVal) = 0;
+#endif
virtual D3D12_GPU_VIRTUAL_ADDRESS STDMETHODCALLTYPE GetGPUVirtualAddress( void) = 0;
@@ -4167,60 +4640,81 @@ EXTERN_C const IID IID_ID3D12Resource;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Resource * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Resource * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Resource * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Resource * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Resource * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Resource * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Resource * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12Resource * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12Resource, Map)
HRESULT ( STDMETHODCALLTYPE *Map )(
ID3D12Resource * This,
UINT Subresource,
_In_opt_ const D3D12_RANGE *pReadRange,
_Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData);
+ DECLSPEC_XFGVIRT(ID3D12Resource, Unmap)
void ( STDMETHODCALLTYPE *Unmap )(
ID3D12Resource * This,
UINT Subresource,
_In_opt_ const D3D12_RANGE *pWrittenRange);
+ DECLSPEC_XFGVIRT(ID3D12Resource, GetDesc)
+#if !defined(_WIN32)
D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )(
ID3D12Resource * This);
+#else
+ D3D12_RESOURCE_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12Resource * This,
+ D3D12_RESOURCE_DESC * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Resource, GetGPUVirtualAddress)
D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )(
ID3D12Resource * This);
+ DECLSPEC_XFGVIRT(ID3D12Resource, WriteToSubresource)
HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )(
ID3D12Resource * This,
UINT DstSubresource,
@@ -4229,6 +4723,7 @@ EXTERN_C const IID IID_ID3D12Resource;
UINT SrcRowPitch,
UINT SrcDepthPitch);
+ DECLSPEC_XFGVIRT(ID3D12Resource, ReadFromSubresource)
HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )(
ID3D12Resource * This,
_Out_ void *pDstData,
@@ -4237,6 +4732,7 @@ EXTERN_C const IID IID_ID3D12Resource;
UINT SrcSubresource,
_In_opt_ const D3D12_BOX *pSrcBox);
+ DECLSPEC_XFGVIRT(ID3D12Resource, GetHeapProperties)
HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )(
ID3D12Resource * This,
_Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties,
@@ -4288,9 +4784,14 @@ EXTERN_C const IID IID_ID3D12Resource;
#define ID3D12Resource_Unmap(This,Subresource,pWrittenRange) \
( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) )
+#if !defined(_WIN32)
#define ID3D12Resource_GetDesc(This) \
( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12Resource_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
#define ID3D12Resource_GetGPUVirtualAddress(This) \
( (This)->lpVtbl -> GetGPUVirtualAddress(This) )
@@ -4312,10 +4813,6 @@ EXTERN_C const IID IID_ID3D12Resource;
-
-
-
-
#endif /* __ID3D12Resource_INTERFACE_DEFINED__ */
@@ -4345,43 +4842,52 @@ EXTERN_C const IID IID_ID3D12CommandAllocator;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12CommandAllocator * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12CommandAllocator * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12CommandAllocator * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12CommandAllocator * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12CommandAllocator * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12CommandAllocator * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12CommandAllocator * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12CommandAllocator * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12CommandAllocator, Reset)
HRESULT ( STDMETHODCALLTYPE *Reset )(
ID3D12CommandAllocator * This);
@@ -4473,51 +4979,62 @@ EXTERN_C const IID IID_ID3D12Fence;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Fence * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Fence * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Fence * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Fence * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Fence * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Fence * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Fence * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12Fence * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12Fence, GetCompletedValue)
UINT64 ( STDMETHODCALLTYPE *GetCompletedValue )(
ID3D12Fence * This);
+ DECLSPEC_XFGVIRT(ID3D12Fence, SetEventOnCompletion)
HRESULT ( STDMETHODCALLTYPE *SetEventOnCompletion )(
ID3D12Fence * This,
UINT64 Value,
HANDLE hEvent);
+ DECLSPEC_XFGVIRT(ID3D12Fence, Signal)
HRESULT ( STDMETHODCALLTYPE *Signal )(
ID3D12Fence * This,
UINT64 Value);
@@ -4609,55 +5126,67 @@ EXTERN_C const IID IID_ID3D12Fence1;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Fence1 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Fence1 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Fence1 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Fence1 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Fence1 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Fence1 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Fence1 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12Fence1 * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12Fence, GetCompletedValue)
UINT64 ( STDMETHODCALLTYPE *GetCompletedValue )(
ID3D12Fence1 * This);
+ DECLSPEC_XFGVIRT(ID3D12Fence, SetEventOnCompletion)
HRESULT ( STDMETHODCALLTYPE *SetEventOnCompletion )(
ID3D12Fence1 * This,
UINT64 Value,
HANDLE hEvent);
+ DECLSPEC_XFGVIRT(ID3D12Fence, Signal)
HRESULT ( STDMETHODCALLTYPE *Signal )(
ID3D12Fence1 * This,
UINT64 Value);
+ DECLSPEC_XFGVIRT(ID3D12Fence1, GetCreationFlags)
D3D12_FENCE_FLAGS ( STDMETHODCALLTYPE *GetCreationFlags )(
ID3D12Fence1 * This);
@@ -4753,43 +5282,52 @@ EXTERN_C const IID IID_ID3D12PipelineState;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12PipelineState * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12PipelineState * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12PipelineState * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12PipelineState * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12PipelineState * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12PipelineState * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12PipelineState * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12PipelineState * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12PipelineState, GetCachedBlob)
HRESULT ( STDMETHODCALLTYPE *GetCachedBlob )(
ID3D12PipelineState * This,
_COM_Outptr_ ID3DBlob **ppBlob);
@@ -4864,11 +5402,26 @@ EXTERN_C const IID IID_ID3D12DescriptorHeap;
ID3D12DescriptorHeap : public ID3D12Pageable
{
public:
+#if defined(_MSC_VER)
virtual D3D12_DESCRIPTOR_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+#else
+ virtual D3D12_DESCRIPTOR_HEAP_DESC *STDMETHODCALLTYPE GetDesc(
+ D3D12_DESCRIPTOR_HEAP_DESC * RetVal) = 0;
+#endif
+#if defined(_MSC_VER)
virtual D3D12_CPU_DESCRIPTOR_HANDLE STDMETHODCALLTYPE GetCPUDescriptorHandleForHeapStart( void) = 0;
+#else
+ virtual D3D12_CPU_DESCRIPTOR_HANDLE *STDMETHODCALLTYPE GetCPUDescriptorHandleForHeapStart(
+ D3D12_CPU_DESCRIPTOR_HANDLE * RetVal) = 0;
+#endif
+#if defined(_MSC_VER)
virtual D3D12_GPU_DESCRIPTOR_HANDLE STDMETHODCALLTYPE GetGPUDescriptorHandleForHeapStart( void) = 0;
+#else
+ virtual D3D12_GPU_DESCRIPTOR_HANDLE *STDMETHODCALLTYPE GetGPUDescriptorHandleForHeapStart(
+ D3D12_GPU_DESCRIPTOR_HANDLE * RetVal) = 0;
+#endif
};
@@ -4879,52 +5432,87 @@ EXTERN_C const IID IID_ID3D12DescriptorHeap;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12DescriptorHeap * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12DescriptorHeap * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12DescriptorHeap * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12DescriptorHeap * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12DescriptorHeap * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12DescriptorHeap * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12DescriptorHeap * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12DescriptorHeap * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12DescriptorHeap, GetDesc)
+#if !defined(_WIN32)
D3D12_DESCRIPTOR_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )(
ID3D12DescriptorHeap * This);
+#else
+ D3D12_DESCRIPTOR_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12DescriptorHeap * This,
+ D3D12_DESCRIPTOR_HEAP_DESC * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12DescriptorHeap, GetCPUDescriptorHandleForHeapStart)
+#if !defined(_WIN32)
D3D12_CPU_DESCRIPTOR_HANDLE ( STDMETHODCALLTYPE *GetCPUDescriptorHandleForHeapStart )(
ID3D12DescriptorHeap * This);
+#else
+ D3D12_CPU_DESCRIPTOR_HANDLE *( STDMETHODCALLTYPE *GetCPUDescriptorHandleForHeapStart )(
+ ID3D12DescriptorHeap * This,
+ D3D12_CPU_DESCRIPTOR_HANDLE * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12DescriptorHeap, GetGPUDescriptorHandleForHeapStart)
+#if !defined(_WIN32)
D3D12_GPU_DESCRIPTOR_HANDLE ( STDMETHODCALLTYPE *GetGPUDescriptorHandleForHeapStart )(
ID3D12DescriptorHeap * This);
+#else
+ D3D12_GPU_DESCRIPTOR_HANDLE *( STDMETHODCALLTYPE *GetGPUDescriptorHandleForHeapStart )(
+ ID3D12DescriptorHeap * This,
+ D3D12_GPU_DESCRIPTOR_HANDLE * RetVal);
+
+#endif
+
END_INTERFACE
} ID3D12DescriptorHeapVtbl;
@@ -4965,15 +5553,30 @@ EXTERN_C const IID IID_ID3D12DescriptorHeap;
( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+#if !defined(_WIN32)
#define ID3D12DescriptorHeap_GetDesc(This) \
( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12DescriptorHeap_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
+#if !defined(_WIN32)
#define ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(This) \
( (This)->lpVtbl -> GetCPUDescriptorHandleForHeapStart(This) )
+#else
+#define ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(This,RetVal) \
+ ( (This)->lpVtbl -> GetCPUDescriptorHandleForHeapStart(This,RetVal) )
+#endif
+#if !defined(_WIN32)
#define ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(This) \
( (This)->lpVtbl -> GetGPUDescriptorHandleForHeapStart(This) )
+#else
+#define ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(This,RetVal) \
+ ( (This)->lpVtbl -> GetGPUDescriptorHandleForHeapStart(This,RetVal) )
+#endif
#endif /* COBJMACROS */
@@ -4983,18 +5586,6 @@ EXTERN_C const IID IID_ID3D12DescriptorHeap;
-
-
-
-
-
-
-
-
-
-
-
-
#endif /* __ID3D12DescriptorHeap_INTERFACE_DEFINED__ */
@@ -5022,38 +5613,46 @@ EXTERN_C const IID IID_ID3D12QueryHeap;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12QueryHeap * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12QueryHeap * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12QueryHeap * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12QueryHeap * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12QueryHeap * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12QueryHeap * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12QueryHeap * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12QueryHeap * This,
REFIID riid,
@@ -5135,38 +5734,46 @@ EXTERN_C const IID IID_ID3D12CommandSignature;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12CommandSignature * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12CommandSignature * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12CommandSignature * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12CommandSignature * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12CommandSignature * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12CommandSignature * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12CommandSignature * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12CommandSignature * This,
REFIID riid,
@@ -5250,43 +5857,52 @@ EXTERN_C const IID IID_ID3D12CommandList;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12CommandList * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12CommandList * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12CommandList * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12CommandList * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12CommandList * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12CommandList * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12CommandList * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12CommandList * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
ID3D12CommandList * This);
@@ -5616,58 +6232,71 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12GraphicsCommandList * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12GraphicsCommandList * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12GraphicsCommandList * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12GraphicsCommandList * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12GraphicsCommandList * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12GraphicsCommandList * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12GraphicsCommandList * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12GraphicsCommandList * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
ID3D12GraphicsCommandList * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close)
HRESULT ( STDMETHODCALLTYPE *Close )(
ID3D12GraphicsCommandList * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset)
HRESULT ( STDMETHODCALLTYPE *Reset )(
ID3D12GraphicsCommandList * This,
_In_ ID3D12CommandAllocator *pAllocator,
_In_opt_ ID3D12PipelineState *pInitialState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState)
void ( STDMETHODCALLTYPE *ClearState )(
ID3D12GraphicsCommandList * This,
_In_opt_ ID3D12PipelineState *pPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced)
void ( STDMETHODCALLTYPE *DrawInstanced )(
ID3D12GraphicsCommandList * This,
_In_ UINT VertexCountPerInstance,
@@ -5675,6 +6304,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
_In_ UINT StartVertexLocation,
_In_ UINT StartInstanceLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced)
void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
ID3D12GraphicsCommandList * This,
_In_ UINT IndexCountPerInstance,
@@ -5683,12 +6313,14 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
_In_ INT BaseVertexLocation,
_In_ UINT StartInstanceLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch)
void ( STDMETHODCALLTYPE *Dispatch )(
ID3D12GraphicsCommandList * This,
_In_ UINT ThreadGroupCountX,
_In_ UINT ThreadGroupCountY,
_In_ UINT ThreadGroupCountZ);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion)
void ( STDMETHODCALLTYPE *CopyBufferRegion )(
ID3D12GraphicsCommandList * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -5697,6 +6329,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
UINT64 SrcOffset,
UINT64 NumBytes);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion)
void ( STDMETHODCALLTYPE *CopyTextureRegion )(
ID3D12GraphicsCommandList * This,
_In_ const D3D12_TEXTURE_COPY_LOCATION *pDst,
@@ -5706,11 +6339,13 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
_In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc,
_In_opt_ const D3D12_BOX *pSrcBox);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource)
void ( STDMETHODCALLTYPE *CopyResource )(
ID3D12GraphicsCommandList * This,
_In_ ID3D12Resource *pDstResource,
_In_ ID3D12Resource *pSrcResource);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles)
void ( STDMETHODCALLTYPE *CopyTiles )(
ID3D12GraphicsCommandList * This,
_In_ ID3D12Resource *pTiledResource,
@@ -5720,6 +6355,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
UINT64 BufferStartOffsetInBytes,
D3D12_TILE_COPY_FLAGS Flags);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource)
void ( STDMETHODCALLTYPE *ResolveSubresource )(
ID3D12GraphicsCommandList * This,
_In_ ID3D12Resource *pDstResource,
@@ -5728,76 +6364,92 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
_In_ UINT SrcSubresource,
_In_ DXGI_FORMAT Format);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology)
void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
ID3D12GraphicsCommandList * This,
_In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports)
void ( STDMETHODCALLTYPE *RSSetViewports )(
ID3D12GraphicsCommandList * This,
_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
_In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects)
void ( STDMETHODCALLTYPE *RSSetScissorRects )(
ID3D12GraphicsCommandList * This,
_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
_In_reads_( NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor)
void ( STDMETHODCALLTYPE *OMSetBlendFactor )(
ID3D12GraphicsCommandList * This,
_In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef)
void ( STDMETHODCALLTYPE *OMSetStencilRef )(
ID3D12GraphicsCommandList * This,
_In_ UINT StencilRef);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState)
void ( STDMETHODCALLTYPE *SetPipelineState )(
ID3D12GraphicsCommandList * This,
_In_ ID3D12PipelineState *pPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier)
void ( STDMETHODCALLTYPE *ResourceBarrier )(
ID3D12GraphicsCommandList * This,
_In_ UINT NumBarriers,
_In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle)
void ( STDMETHODCALLTYPE *ExecuteBundle )(
ID3D12GraphicsCommandList * This,
_In_ ID3D12GraphicsCommandList *pCommandList);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps)
void ( STDMETHODCALLTYPE *SetDescriptorHeaps )(
ID3D12GraphicsCommandList * This,
_In_ UINT NumDescriptorHeaps,
_In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature)
void ( STDMETHODCALLTYPE *SetComputeRootSignature )(
ID3D12GraphicsCommandList * This,
_In_opt_ ID3D12RootSignature *pRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature)
void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )(
ID3D12GraphicsCommandList * This,
_In_opt_ ID3D12RootSignature *pRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable)
void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )(
ID3D12GraphicsCommandList * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable)
void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )(
ID3D12GraphicsCommandList * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant)
void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )(
ID3D12GraphicsCommandList * This,
_In_ UINT RootParameterIndex,
_In_ UINT SrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant)
void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )(
ID3D12GraphicsCommandList * This,
_In_ UINT RootParameterIndex,
_In_ UINT SrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants)
void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )(
ID3D12GraphicsCommandList * This,
_In_ UINT RootParameterIndex,
@@ -5805,6 +6457,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
_In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants)
void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )(
ID3D12GraphicsCommandList * This,
_In_ UINT RootParameterIndex,
@@ -5812,52 +6465,62 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
_In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView)
void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )(
ID3D12GraphicsCommandList * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView)
void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )(
ID3D12GraphicsCommandList * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView)
void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )(
ID3D12GraphicsCommandList * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView)
void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )(
ID3D12GraphicsCommandList * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView)
void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )(
ID3D12GraphicsCommandList * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView)
void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )(
ID3D12GraphicsCommandList * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer)
void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
ID3D12GraphicsCommandList * This,
_In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers)
void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
ID3D12GraphicsCommandList * This,
_In_ UINT StartSlot,
_In_ UINT NumViews,
_In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets)
void ( STDMETHODCALLTYPE *SOSetTargets )(
ID3D12GraphicsCommandList * This,
_In_ UINT StartSlot,
_In_ UINT NumViews,
_In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets)
void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
ID3D12GraphicsCommandList * This,
_In_ UINT NumRenderTargetDescriptors,
@@ -5865,6 +6528,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
_In_ BOOL RTsSingleHandleToDescriptorRange,
_In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView)
void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
ID3D12GraphicsCommandList * This,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView,
@@ -5874,6 +6538,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView)
void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
ID3D12GraphicsCommandList * This,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView,
@@ -5881,6 +6546,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint)
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
ID3D12GraphicsCommandList * This,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
@@ -5890,6 +6556,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat)
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
ID3D12GraphicsCommandList * This,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
@@ -5899,23 +6566,27 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource)
void ( STDMETHODCALLTYPE *DiscardResource )(
ID3D12GraphicsCommandList * This,
_In_ ID3D12Resource *pResource,
_In_opt_ const D3D12_DISCARD_REGION *pRegion);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery)
void ( STDMETHODCALLTYPE *BeginQuery )(
ID3D12GraphicsCommandList * This,
_In_ ID3D12QueryHeap *pQueryHeap,
_In_ D3D12_QUERY_TYPE Type,
_In_ UINT Index);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery)
void ( STDMETHODCALLTYPE *EndQuery )(
ID3D12GraphicsCommandList * This,
_In_ ID3D12QueryHeap *pQueryHeap,
_In_ D3D12_QUERY_TYPE Type,
_In_ UINT Index);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData)
void ( STDMETHODCALLTYPE *ResolveQueryData )(
ID3D12GraphicsCommandList * This,
_In_ ID3D12QueryHeap *pQueryHeap,
@@ -5925,27 +6596,32 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList;
_In_ ID3D12Resource *pDestinationBuffer,
_In_ UINT64 AlignedDestinationBufferOffset);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication)
void ( STDMETHODCALLTYPE *SetPredication )(
ID3D12GraphicsCommandList * This,
_In_opt_ ID3D12Resource *pBuffer,
_In_ UINT64 AlignedBufferOffset,
_In_ D3D12_PREDICATION_OP Operation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker)
void ( STDMETHODCALLTYPE *SetMarker )(
ID3D12GraphicsCommandList * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent)
void ( STDMETHODCALLTYPE *BeginEvent )(
ID3D12GraphicsCommandList * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent)
void ( STDMETHODCALLTYPE *EndEvent )(
ID3D12GraphicsCommandList * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect)
void ( STDMETHODCALLTYPE *ExecuteIndirect )(
ID3D12GraphicsCommandList * This,
_In_ ID3D12CommandSignature *pCommandSignature,
@@ -6228,58 +6904,71 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12GraphicsCommandList1 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12GraphicsCommandList1 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12GraphicsCommandList1 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12GraphicsCommandList1 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12GraphicsCommandList1 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12GraphicsCommandList1 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12GraphicsCommandList1 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12GraphicsCommandList1 * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
ID3D12GraphicsCommandList1 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close)
HRESULT ( STDMETHODCALLTYPE *Close )(
ID3D12GraphicsCommandList1 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset)
HRESULT ( STDMETHODCALLTYPE *Reset )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12CommandAllocator *pAllocator,
_In_opt_ ID3D12PipelineState *pInitialState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState)
void ( STDMETHODCALLTYPE *ClearState )(
ID3D12GraphicsCommandList1 * This,
_In_opt_ ID3D12PipelineState *pPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced)
void ( STDMETHODCALLTYPE *DrawInstanced )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT VertexCountPerInstance,
@@ -6287,6 +6976,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_ UINT StartVertexLocation,
_In_ UINT StartInstanceLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced)
void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT IndexCountPerInstance,
@@ -6295,12 +6985,14 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_ INT BaseVertexLocation,
_In_ UINT StartInstanceLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch)
void ( STDMETHODCALLTYPE *Dispatch )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT ThreadGroupCountX,
_In_ UINT ThreadGroupCountY,
_In_ UINT ThreadGroupCountZ);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion)
void ( STDMETHODCALLTYPE *CopyBufferRegion )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -6309,6 +7001,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
UINT64 SrcOffset,
UINT64 NumBytes);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion)
void ( STDMETHODCALLTYPE *CopyTextureRegion )(
ID3D12GraphicsCommandList1 * This,
_In_ const D3D12_TEXTURE_COPY_LOCATION *pDst,
@@ -6318,11 +7011,13 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc,
_In_opt_ const D3D12_BOX *pSrcBox);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource)
void ( STDMETHODCALLTYPE *CopyResource )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12Resource *pDstResource,
_In_ ID3D12Resource *pSrcResource);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles)
void ( STDMETHODCALLTYPE *CopyTiles )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12Resource *pTiledResource,
@@ -6332,6 +7027,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
UINT64 BufferStartOffsetInBytes,
D3D12_TILE_COPY_FLAGS Flags);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource)
void ( STDMETHODCALLTYPE *ResolveSubresource )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12Resource *pDstResource,
@@ -6340,76 +7036,92 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_ UINT SrcSubresource,
_In_ DXGI_FORMAT Format);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology)
void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
ID3D12GraphicsCommandList1 * This,
_In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports)
void ( STDMETHODCALLTYPE *RSSetViewports )(
ID3D12GraphicsCommandList1 * This,
_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
_In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects)
void ( STDMETHODCALLTYPE *RSSetScissorRects )(
ID3D12GraphicsCommandList1 * This,
_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
_In_reads_( NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor)
void ( STDMETHODCALLTYPE *OMSetBlendFactor )(
ID3D12GraphicsCommandList1 * This,
_In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef)
void ( STDMETHODCALLTYPE *OMSetStencilRef )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT StencilRef);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState)
void ( STDMETHODCALLTYPE *SetPipelineState )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12PipelineState *pPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier)
void ( STDMETHODCALLTYPE *ResourceBarrier )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT NumBarriers,
_In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle)
void ( STDMETHODCALLTYPE *ExecuteBundle )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12GraphicsCommandList *pCommandList);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps)
void ( STDMETHODCALLTYPE *SetDescriptorHeaps )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT NumDescriptorHeaps,
_In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature)
void ( STDMETHODCALLTYPE *SetComputeRootSignature )(
ID3D12GraphicsCommandList1 * This,
_In_opt_ ID3D12RootSignature *pRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature)
void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )(
ID3D12GraphicsCommandList1 * This,
_In_opt_ ID3D12RootSignature *pRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable)
void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable)
void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant)
void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT RootParameterIndex,
_In_ UINT SrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant)
void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT RootParameterIndex,
_In_ UINT SrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants)
void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT RootParameterIndex,
@@ -6417,6 +7129,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants)
void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT RootParameterIndex,
@@ -6424,52 +7137,62 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView)
void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView)
void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView)
void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView)
void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView)
void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView)
void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer)
void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
ID3D12GraphicsCommandList1 * This,
_In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers)
void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT StartSlot,
_In_ UINT NumViews,
_In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets)
void ( STDMETHODCALLTYPE *SOSetTargets )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT StartSlot,
_In_ UINT NumViews,
_In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets)
void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT NumRenderTargetDescriptors,
@@ -6477,6 +7200,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_ BOOL RTsSingleHandleToDescriptorRange,
_In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView)
void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
ID3D12GraphicsCommandList1 * This,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView,
@@ -6486,6 +7210,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView)
void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
ID3D12GraphicsCommandList1 * This,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView,
@@ -6493,6 +7218,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint)
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
ID3D12GraphicsCommandList1 * This,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
@@ -6502,6 +7228,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat)
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
ID3D12GraphicsCommandList1 * This,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
@@ -6511,23 +7238,27 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource)
void ( STDMETHODCALLTYPE *DiscardResource )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12Resource *pResource,
_In_opt_ const D3D12_DISCARD_REGION *pRegion);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery)
void ( STDMETHODCALLTYPE *BeginQuery )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
_In_ D3D12_QUERY_TYPE Type,
_In_ UINT Index);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery)
void ( STDMETHODCALLTYPE *EndQuery )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
_In_ D3D12_QUERY_TYPE Type,
_In_ UINT Index);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData)
void ( STDMETHODCALLTYPE *ResolveQueryData )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
@@ -6537,27 +7268,32 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_ ID3D12Resource *pDestinationBuffer,
_In_ UINT64 AlignedDestinationBufferOffset);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication)
void ( STDMETHODCALLTYPE *SetPredication )(
ID3D12GraphicsCommandList1 * This,
_In_opt_ ID3D12Resource *pBuffer,
_In_ UINT64 AlignedBufferOffset,
_In_ D3D12_PREDICATION_OP Operation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker)
void ( STDMETHODCALLTYPE *SetMarker )(
ID3D12GraphicsCommandList1 * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent)
void ( STDMETHODCALLTYPE *BeginEvent )(
ID3D12GraphicsCommandList1 * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent)
void ( STDMETHODCALLTYPE *EndEvent )(
ID3D12GraphicsCommandList1 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect)
void ( STDMETHODCALLTYPE *ExecuteIndirect )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12CommandSignature *pCommandSignature,
@@ -6567,6 +7303,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_opt_ ID3D12Resource *pCountBuffer,
_In_ UINT64 CountBufferOffset);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT)
void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -6577,6 +7314,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
_In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64)
void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -6587,17 +7325,20 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
_In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds)
void ( STDMETHODCALLTYPE *OMSetDepthBounds )(
ID3D12GraphicsCommandList1 * This,
_In_ FLOAT Min,
_In_ FLOAT Max);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions)
void ( STDMETHODCALLTYPE *SetSamplePositions )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT NumSamplesPerPixel,
_In_ UINT NumPixels,
_In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion)
void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )(
ID3D12GraphicsCommandList1 * This,
_In_ ID3D12Resource *pDstResource,
@@ -6610,6 +7351,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList1;
_In_ DXGI_FORMAT Format,
_In_ D3D12_RESOLVE_MODE ResolveMode);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask)
void ( STDMETHODCALLTYPE *SetViewInstanceMask )(
ID3D12GraphicsCommandList1 * This,
_In_ UINT Mask);
@@ -6892,58 +7634,71 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12GraphicsCommandList2 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12GraphicsCommandList2 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12GraphicsCommandList2 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12GraphicsCommandList2 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12GraphicsCommandList2 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12GraphicsCommandList2 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12GraphicsCommandList2 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12GraphicsCommandList2 * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
ID3D12GraphicsCommandList2 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close)
HRESULT ( STDMETHODCALLTYPE *Close )(
ID3D12GraphicsCommandList2 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset)
HRESULT ( STDMETHODCALLTYPE *Reset )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12CommandAllocator *pAllocator,
_In_opt_ ID3D12PipelineState *pInitialState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState)
void ( STDMETHODCALLTYPE *ClearState )(
ID3D12GraphicsCommandList2 * This,
_In_opt_ ID3D12PipelineState *pPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced)
void ( STDMETHODCALLTYPE *DrawInstanced )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT VertexCountPerInstance,
@@ -6951,6 +7706,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_ UINT StartVertexLocation,
_In_ UINT StartInstanceLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced)
void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT IndexCountPerInstance,
@@ -6959,12 +7715,14 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_ INT BaseVertexLocation,
_In_ UINT StartInstanceLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch)
void ( STDMETHODCALLTYPE *Dispatch )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT ThreadGroupCountX,
_In_ UINT ThreadGroupCountY,
_In_ UINT ThreadGroupCountZ);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion)
void ( STDMETHODCALLTYPE *CopyBufferRegion )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -6973,6 +7731,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
UINT64 SrcOffset,
UINT64 NumBytes);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion)
void ( STDMETHODCALLTYPE *CopyTextureRegion )(
ID3D12GraphicsCommandList2 * This,
_In_ const D3D12_TEXTURE_COPY_LOCATION *pDst,
@@ -6982,11 +7741,13 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc,
_In_opt_ const D3D12_BOX *pSrcBox);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource)
void ( STDMETHODCALLTYPE *CopyResource )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12Resource *pDstResource,
_In_ ID3D12Resource *pSrcResource);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles)
void ( STDMETHODCALLTYPE *CopyTiles )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12Resource *pTiledResource,
@@ -6996,6 +7757,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
UINT64 BufferStartOffsetInBytes,
D3D12_TILE_COPY_FLAGS Flags);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource)
void ( STDMETHODCALLTYPE *ResolveSubresource )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12Resource *pDstResource,
@@ -7004,76 +7766,92 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_ UINT SrcSubresource,
_In_ DXGI_FORMAT Format);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology)
void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
ID3D12GraphicsCommandList2 * This,
_In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports)
void ( STDMETHODCALLTYPE *RSSetViewports )(
ID3D12GraphicsCommandList2 * This,
_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
_In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects)
void ( STDMETHODCALLTYPE *RSSetScissorRects )(
ID3D12GraphicsCommandList2 * This,
_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
_In_reads_( NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor)
void ( STDMETHODCALLTYPE *OMSetBlendFactor )(
ID3D12GraphicsCommandList2 * This,
_In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef)
void ( STDMETHODCALLTYPE *OMSetStencilRef )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT StencilRef);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState)
void ( STDMETHODCALLTYPE *SetPipelineState )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12PipelineState *pPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier)
void ( STDMETHODCALLTYPE *ResourceBarrier )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT NumBarriers,
_In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle)
void ( STDMETHODCALLTYPE *ExecuteBundle )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12GraphicsCommandList *pCommandList);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps)
void ( STDMETHODCALLTYPE *SetDescriptorHeaps )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT NumDescriptorHeaps,
_In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature)
void ( STDMETHODCALLTYPE *SetComputeRootSignature )(
ID3D12GraphicsCommandList2 * This,
_In_opt_ ID3D12RootSignature *pRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature)
void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )(
ID3D12GraphicsCommandList2 * This,
_In_opt_ ID3D12RootSignature *pRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable)
void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable)
void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant)
void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT RootParameterIndex,
_In_ UINT SrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant)
void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT RootParameterIndex,
_In_ UINT SrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants)
void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT RootParameterIndex,
@@ -7081,6 +7859,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants)
void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT RootParameterIndex,
@@ -7088,52 +7867,62 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView)
void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView)
void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView)
void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView)
void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView)
void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView)
void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer)
void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
ID3D12GraphicsCommandList2 * This,
_In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers)
void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT StartSlot,
_In_ UINT NumViews,
_In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets)
void ( STDMETHODCALLTYPE *SOSetTargets )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT StartSlot,
_In_ UINT NumViews,
_In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets)
void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT NumRenderTargetDescriptors,
@@ -7141,6 +7930,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_ BOOL RTsSingleHandleToDescriptorRange,
_In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView)
void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
ID3D12GraphicsCommandList2 * This,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView,
@@ -7150,6 +7940,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView)
void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
ID3D12GraphicsCommandList2 * This,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView,
@@ -7157,6 +7948,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint)
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
ID3D12GraphicsCommandList2 * This,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
@@ -7166,6 +7958,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat)
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
ID3D12GraphicsCommandList2 * This,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
@@ -7175,23 +7968,27 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource)
void ( STDMETHODCALLTYPE *DiscardResource )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12Resource *pResource,
_In_opt_ const D3D12_DISCARD_REGION *pRegion);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery)
void ( STDMETHODCALLTYPE *BeginQuery )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
_In_ D3D12_QUERY_TYPE Type,
_In_ UINT Index);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery)
void ( STDMETHODCALLTYPE *EndQuery )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
_In_ D3D12_QUERY_TYPE Type,
_In_ UINT Index);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData)
void ( STDMETHODCALLTYPE *ResolveQueryData )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
@@ -7201,27 +7998,32 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_ ID3D12Resource *pDestinationBuffer,
_In_ UINT64 AlignedDestinationBufferOffset);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication)
void ( STDMETHODCALLTYPE *SetPredication )(
ID3D12GraphicsCommandList2 * This,
_In_opt_ ID3D12Resource *pBuffer,
_In_ UINT64 AlignedBufferOffset,
_In_ D3D12_PREDICATION_OP Operation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker)
void ( STDMETHODCALLTYPE *SetMarker )(
ID3D12GraphicsCommandList2 * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent)
void ( STDMETHODCALLTYPE *BeginEvent )(
ID3D12GraphicsCommandList2 * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent)
void ( STDMETHODCALLTYPE *EndEvent )(
ID3D12GraphicsCommandList2 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect)
void ( STDMETHODCALLTYPE *ExecuteIndirect )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12CommandSignature *pCommandSignature,
@@ -7231,6 +8033,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_opt_ ID3D12Resource *pCountBuffer,
_In_ UINT64 CountBufferOffset);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT)
void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -7241,6 +8044,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
_In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64)
void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -7251,17 +8055,20 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
_In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds)
void ( STDMETHODCALLTYPE *OMSetDepthBounds )(
ID3D12GraphicsCommandList2 * This,
_In_ FLOAT Min,
_In_ FLOAT Max);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions)
void ( STDMETHODCALLTYPE *SetSamplePositions )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT NumSamplesPerPixel,
_In_ UINT NumPixels,
_In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion)
void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )(
ID3D12GraphicsCommandList2 * This,
_In_ ID3D12Resource *pDstResource,
@@ -7274,10 +8081,12 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList2;
_In_ DXGI_FORMAT Format,
_In_ D3D12_RESOLVE_MODE ResolveMode);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask)
void ( STDMETHODCALLTYPE *SetViewInstanceMask )(
ID3D12GraphicsCommandList2 * This,
_In_ UINT Mask);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate)
void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
ID3D12GraphicsCommandList2 * This,
UINT Count,
@@ -7581,7 +8390,12 @@ EXTERN_C const IID IID_ID3D12CommandQueue;
_Out_ UINT64 *pGpuTimestamp,
_Out_ UINT64 *pCpuTimestamp) = 0;
+#if defined(_MSC_VER)
virtual D3D12_COMMAND_QUEUE_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+#else
+ virtual D3D12_COMMAND_QUEUE_DESC *STDMETHODCALLTYPE GetDesc(
+ D3D12_COMMAND_QUEUE_DESC * RetVal) = 0;
+#endif
};
@@ -7592,43 +8406,52 @@ EXTERN_C const IID IID_ID3D12CommandQueue;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12CommandQueue * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12CommandQueue * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12CommandQueue * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12CommandQueue * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12CommandQueue * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12CommandQueue * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12CommandQueue * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12CommandQueue * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12CommandQueue, UpdateTileMappings)
void ( STDMETHODCALLTYPE *UpdateTileMappings )(
ID3D12CommandQueue * This,
_In_ ID3D12Resource *pResource,
@@ -7642,6 +8465,7 @@ EXTERN_C const IID IID_ID3D12CommandQueue;
_In_reads_opt_(NumRanges) const UINT *pRangeTileCounts,
D3D12_TILE_MAPPING_FLAGS Flags);
+ DECLSPEC_XFGVIRT(ID3D12CommandQueue, CopyTileMappings)
void ( STDMETHODCALLTYPE *CopyTileMappings )(
ID3D12CommandQueue * This,
_In_ ID3D12Resource *pDstResource,
@@ -7651,48 +8475,65 @@ EXTERN_C const IID IID_ID3D12CommandQueue;
_In_ const D3D12_TILE_REGION_SIZE *pRegionSize,
D3D12_TILE_MAPPING_FLAGS Flags);
+ DECLSPEC_XFGVIRT(ID3D12CommandQueue, ExecuteCommandLists)
void ( STDMETHODCALLTYPE *ExecuteCommandLists )(
ID3D12CommandQueue * This,
_In_ UINT NumCommandLists,
_In_reads_(NumCommandLists) ID3D12CommandList *const *ppCommandLists);
+ DECLSPEC_XFGVIRT(ID3D12CommandQueue, SetMarker)
void ( STDMETHODCALLTYPE *SetMarker )(
ID3D12CommandQueue * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12CommandQueue, BeginEvent)
void ( STDMETHODCALLTYPE *BeginEvent )(
ID3D12CommandQueue * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12CommandQueue, EndEvent)
void ( STDMETHODCALLTYPE *EndEvent )(
ID3D12CommandQueue * This);
+ DECLSPEC_XFGVIRT(ID3D12CommandQueue, Signal)
HRESULT ( STDMETHODCALLTYPE *Signal )(
ID3D12CommandQueue * This,
ID3D12Fence *pFence,
UINT64 Value);
+ DECLSPEC_XFGVIRT(ID3D12CommandQueue, Wait)
HRESULT ( STDMETHODCALLTYPE *Wait )(
ID3D12CommandQueue * This,
ID3D12Fence *pFence,
UINT64 Value);
+ DECLSPEC_XFGVIRT(ID3D12CommandQueue, GetTimestampFrequency)
HRESULT ( STDMETHODCALLTYPE *GetTimestampFrequency )(
ID3D12CommandQueue * This,
_Out_ UINT64 *pFrequency);
+ DECLSPEC_XFGVIRT(ID3D12CommandQueue, GetClockCalibration)
HRESULT ( STDMETHODCALLTYPE *GetClockCalibration )(
ID3D12CommandQueue * This,
_Out_ UINT64 *pGpuTimestamp,
_Out_ UINT64 *pCpuTimestamp);
+ DECLSPEC_XFGVIRT(ID3D12CommandQueue, GetDesc)
+#if !defined(_WIN32)
D3D12_COMMAND_QUEUE_DESC ( STDMETHODCALLTYPE *GetDesc )(
ID3D12CommandQueue * This);
+#else
+ D3D12_COMMAND_QUEUE_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12CommandQueue * This,
+ D3D12_COMMAND_QUEUE_DESC * RetVal);
+
+#endif
+
END_INTERFACE
} ID3D12CommandQueueVtbl;
@@ -7763,9 +8604,14 @@ EXTERN_C const IID IID_ID3D12CommandQueue;
#define ID3D12CommandQueue_GetClockCalibration(This,pGpuTimestamp,pCpuTimestamp) \
( (This)->lpVtbl -> GetClockCalibration(This,pGpuTimestamp,pCpuTimestamp) )
+#if !defined(_WIN32)
#define ID3D12CommandQueue_GetDesc(This) \
( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12CommandQueue_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
#endif /* COBJMACROS */
@@ -7775,10 +8621,6 @@ EXTERN_C const IID IID_ID3D12CommandQueue;
-
-
-
-
#endif /* __ID3D12CommandQueue_INTERFACE_DEFINED__ */
@@ -7912,14 +8754,29 @@ EXTERN_C const IID IID_ID3D12Device;
_In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType) = 0;
+#if defined(_MSC_VER)
virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo(
_In_ UINT visibleMask,
_In_ UINT numResourceDescs,
_In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs) = 0;
+#else
+ virtual D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE GetResourceAllocationInfo(
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs) = 0;
+#endif
+#if defined(_MSC_VER)
virtual D3D12_HEAP_PROPERTIES STDMETHODCALLTYPE GetCustomHeapProperties(
_In_ UINT nodeMask,
D3D12_HEAP_TYPE heapType) = 0;
+#else
+ virtual D3D12_HEAP_PROPERTIES *STDMETHODCALLTYPE GetCustomHeapProperties(
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType) = 0;
+#endif
virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource(
_In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
@@ -8018,7 +8875,12 @@ EXTERN_C const IID IID_ID3D12Device;
_In_ UINT FirstSubresourceTilingToGet,
_Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips) = 0;
+#if defined(_MSC_VER)
virtual LUID STDMETHODCALLTYPE GetAdapterLuid( void) = 0;
+#else
+ virtual LUID *STDMETHODCALLTYPE GetAdapterLuid(
+ LUID * RetVal) = 0;
+#endif
};
@@ -8029,65 +8891,78 @@ EXTERN_C const IID IID_ID3D12Device;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Device * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Device * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Device * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Device * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Device * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Device * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Device * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
UINT ( STDMETHODCALLTYPE *GetNodeCount )(
ID3D12Device * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
ID3D12Device * This,
_In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppCommandQueue);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
ID3D12Device * This,
_In_ D3D12_COMMAND_LIST_TYPE type,
REFIID riid,
_COM_Outptr_ void **ppCommandAllocator);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
ID3D12Device * This,
_In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
ID3D12Device * This,
_In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
ID3D12Device * This,
_In_ UINT nodeMask,
@@ -8097,22 +8972,26 @@ EXTERN_C const IID IID_ID3D12Device;
REFIID riid,
_COM_Outptr_ void **ppCommandList);
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
ID3D12Device * This,
D3D12_FEATURE Feature,
_Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
UINT FeatureSupportDataSize);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
ID3D12Device * This,
_In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
ID3D12Device * This,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
ID3D12Device * This,
_In_ UINT nodeMask,
@@ -8121,17 +9000,20 @@ EXTERN_C const IID IID_ID3D12Device;
REFIID riid,
_COM_Outptr_ void **ppvRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
ID3D12Device * This,
_In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
ID3D12Device * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
ID3D12Device * This,
_In_opt_ ID3D12Resource *pResource,
@@ -8139,23 +9021,27 @@ EXTERN_C const IID IID_ID3D12Device;
_In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
ID3D12Device * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
ID3D12Device * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
void ( STDMETHODCALLTYPE *CreateSampler )(
ID3D12Device * This,
_In_ const D3D12_SAMPLER_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
void ( STDMETHODCALLTYPE *CopyDescriptors )(
ID3D12Device * This,
_In_ UINT NumDestDescriptorRanges,
@@ -8166,6 +9052,7 @@ EXTERN_C const IID IID_ID3D12Device;
_In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
ID3D12Device * This,
_In_ UINT NumDescriptors,
@@ -8173,17 +9060,41 @@ EXTERN_C const IID IID_ID3D12Device;
_In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
ID3D12Device * This,
_In_ UINT visibleMask,
_In_ UINT numResourceDescs,
_In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
ID3D12Device * This,
_In_ UINT nodeMask,
D3D12_HEAP_TYPE heapType);
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
ID3D12Device * This,
_In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
@@ -8194,12 +9105,14 @@ EXTERN_C const IID IID_ID3D12Device;
REFIID riidResource,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
ID3D12Device * This,
_In_ const D3D12_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
ID3D12Device * This,
_In_ ID3D12Heap *pHeap,
@@ -8210,6 +9123,7 @@ EXTERN_C const IID IID_ID3D12Device;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
ID3D12Device * This,
_In_ const D3D12_RESOURCE_DESC *pDesc,
@@ -8218,6 +9132,7 @@ EXTERN_C const IID IID_ID3D12Device;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
ID3D12Device * This,
_In_ ID3D12DeviceChild *pObject,
@@ -8226,12 +9141,14 @@ EXTERN_C const IID IID_ID3D12Device;
_In_opt_ LPCWSTR Name,
_Out_ HANDLE *pHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
ID3D12Device * This,
_In_ HANDLE NTHandle,
REFIID riid,
_COM_Outptr_opt_ void **ppvObj);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
ID3D12Device * This,
_In_ LPCWSTR Name,
@@ -8239,16 +9156,19 @@ EXTERN_C const IID IID_ID3D12Device;
/* [annotation][out] */
_Out_ HANDLE *pNTHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
HRESULT ( STDMETHODCALLTYPE *MakeResident )(
ID3D12Device * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
HRESULT ( STDMETHODCALLTYPE *Evict )(
ID3D12Device * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
HRESULT ( STDMETHODCALLTYPE *CreateFence )(
ID3D12Device * This,
UINT64 InitialValue,
@@ -8256,9 +9176,11 @@ EXTERN_C const IID IID_ID3D12Device;
REFIID riid,
_COM_Outptr_ void **ppFence);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
ID3D12Device * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
ID3D12Device * This,
_In_ const D3D12_RESOURCE_DESC *pResourceDesc,
@@ -8270,16 +9192,19 @@ EXTERN_C const IID IID_ID3D12Device;
_Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
_Out_opt_ UINT64 *pTotalBytes);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
ID3D12Device * This,
_In_ const D3D12_QUERY_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
ID3D12Device * This,
BOOL Enable);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
ID3D12Device * This,
_In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
@@ -8287,6 +9212,7 @@ EXTERN_C const IID IID_ID3D12Device;
REFIID riid,
_COM_Outptr_opt_ void **ppvCommandSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
void ( STDMETHODCALLTYPE *GetResourceTiling )(
ID3D12Device * This,
_In_ ID3D12Resource *pTiledResource,
@@ -8297,9 +9223,18 @@ EXTERN_C const IID IID_ID3D12Device;
_In_ UINT FirstSubresourceTilingToGet,
_Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
ID3D12Device * This);
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device * This,
+ LUID * RetVal);
+
+#endif
+
END_INTERFACE
} ID3D12DeviceVtbl;
@@ -8389,12 +9324,22 @@ EXTERN_C const IID IID_ID3D12Device;
#define ID3D12Device_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
#define ID3D12Device_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
#define ID3D12Device_GetCustomHeapProperties(This,nodeMask,heapType) \
( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
#define ID3D12Device_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
@@ -8443,9 +9388,14 @@ EXTERN_C const IID IID_ID3D12Device;
#define ID3D12Device_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
#define ID3D12Device_GetAdapterLuid(This) \
( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
#endif /* COBJMACROS */
@@ -8455,18 +9405,6 @@ EXTERN_C const IID IID_ID3D12Device;
-
-
-
-
-
-
-
-
-
-
-
-
#endif /* __ID3D12Device_INTERFACE_DEFINED__ */
@@ -8516,48 +9454,58 @@ EXTERN_C const IID IID_ID3D12PipelineLibrary;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12PipelineLibrary * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12PipelineLibrary * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12PipelineLibrary * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12PipelineLibrary * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12PipelineLibrary * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12PipelineLibrary * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12PipelineLibrary * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12PipelineLibrary * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, StorePipeline)
HRESULT ( STDMETHODCALLTYPE *StorePipeline )(
ID3D12PipelineLibrary * This,
_In_opt_ LPCWSTR pName,
_In_ ID3D12PipelineState *pPipeline);
+ DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, LoadGraphicsPipeline)
HRESULT ( STDMETHODCALLTYPE *LoadGraphicsPipeline )(
ID3D12PipelineLibrary * This,
_In_ LPCWSTR pName,
@@ -8565,6 +9513,7 @@ EXTERN_C const IID IID_ID3D12PipelineLibrary;
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, LoadComputePipeline)
HRESULT ( STDMETHODCALLTYPE *LoadComputePipeline )(
ID3D12PipelineLibrary * This,
_In_ LPCWSTR pName,
@@ -8572,9 +9521,11 @@ EXTERN_C const IID IID_ID3D12PipelineLibrary;
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, GetSerializedSize)
SIZE_T ( STDMETHODCALLTYPE *GetSerializedSize )(
ID3D12PipelineLibrary * This);
+ DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, Serialize)
HRESULT ( STDMETHODCALLTYPE *Serialize )(
ID3D12PipelineLibrary * This,
_Out_writes_(DataSizeInBytes) void *pData,
@@ -8676,48 +9627,58 @@ EXTERN_C const IID IID_ID3D12PipelineLibrary1;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12PipelineLibrary1 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12PipelineLibrary1 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12PipelineLibrary1 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12PipelineLibrary1 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12PipelineLibrary1 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12PipelineLibrary1 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12PipelineLibrary1 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12PipelineLibrary1 * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, StorePipeline)
HRESULT ( STDMETHODCALLTYPE *StorePipeline )(
ID3D12PipelineLibrary1 * This,
_In_opt_ LPCWSTR pName,
_In_ ID3D12PipelineState *pPipeline);
+ DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, LoadGraphicsPipeline)
HRESULT ( STDMETHODCALLTYPE *LoadGraphicsPipeline )(
ID3D12PipelineLibrary1 * This,
_In_ LPCWSTR pName,
@@ -8725,6 +9686,7 @@ EXTERN_C const IID IID_ID3D12PipelineLibrary1;
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, LoadComputePipeline)
HRESULT ( STDMETHODCALLTYPE *LoadComputePipeline )(
ID3D12PipelineLibrary1 * This,
_In_ LPCWSTR pName,
@@ -8732,14 +9694,17 @@ EXTERN_C const IID IID_ID3D12PipelineLibrary1;
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, GetSerializedSize)
SIZE_T ( STDMETHODCALLTYPE *GetSerializedSize )(
ID3D12PipelineLibrary1 * This);
+ DECLSPEC_XFGVIRT(ID3D12PipelineLibrary, Serialize)
HRESULT ( STDMETHODCALLTYPE *Serialize )(
ID3D12PipelineLibrary1 * This,
_Out_writes_(DataSizeInBytes) void *pData,
SIZE_T DataSizeInBytes);
+ DECLSPEC_XFGVIRT(ID3D12PipelineLibrary1, LoadPipeline)
HRESULT ( STDMETHODCALLTYPE *LoadPipeline )(
ID3D12PipelineLibrary1 * This,
_In_ LPCWSTR pName,
@@ -8886,65 +9851,78 @@ EXTERN_C const IID IID_ID3D12Device1;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Device1 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Device1 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Device1 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Device1 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Device1 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Device1 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Device1 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
UINT ( STDMETHODCALLTYPE *GetNodeCount )(
ID3D12Device1 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
ID3D12Device1 * This,
_In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppCommandQueue);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
ID3D12Device1 * This,
_In_ D3D12_COMMAND_LIST_TYPE type,
REFIID riid,
_COM_Outptr_ void **ppCommandAllocator);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
ID3D12Device1 * This,
_In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
ID3D12Device1 * This,
_In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
ID3D12Device1 * This,
_In_ UINT nodeMask,
@@ -8954,22 +9932,26 @@ EXTERN_C const IID IID_ID3D12Device1;
REFIID riid,
_COM_Outptr_ void **ppCommandList);
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
ID3D12Device1 * This,
D3D12_FEATURE Feature,
_Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
UINT FeatureSupportDataSize);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
ID3D12Device1 * This,
_In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
ID3D12Device1 * This,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
ID3D12Device1 * This,
_In_ UINT nodeMask,
@@ -8978,17 +9960,20 @@ EXTERN_C const IID IID_ID3D12Device1;
REFIID riid,
_COM_Outptr_ void **ppvRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
ID3D12Device1 * This,
_In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
ID3D12Device1 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
ID3D12Device1 * This,
_In_opt_ ID3D12Resource *pResource,
@@ -8996,23 +9981,27 @@ EXTERN_C const IID IID_ID3D12Device1;
_In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
ID3D12Device1 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
ID3D12Device1 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
void ( STDMETHODCALLTYPE *CreateSampler )(
ID3D12Device1 * This,
_In_ const D3D12_SAMPLER_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
void ( STDMETHODCALLTYPE *CopyDescriptors )(
ID3D12Device1 * This,
_In_ UINT NumDestDescriptorRanges,
@@ -9023,6 +10012,7 @@ EXTERN_C const IID IID_ID3D12Device1;
_In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
ID3D12Device1 * This,
_In_ UINT NumDescriptors,
@@ -9030,17 +10020,41 @@ EXTERN_C const IID IID_ID3D12Device1;
_In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
ID3D12Device1 * This,
_In_ UINT visibleMask,
_In_ UINT numResourceDescs,
_In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device1 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
ID3D12Device1 * This,
_In_ UINT nodeMask,
D3D12_HEAP_TYPE heapType);
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device1 * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
ID3D12Device1 * This,
_In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
@@ -9051,12 +10065,14 @@ EXTERN_C const IID IID_ID3D12Device1;
REFIID riidResource,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
ID3D12Device1 * This,
_In_ const D3D12_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
ID3D12Device1 * This,
_In_ ID3D12Heap *pHeap,
@@ -9067,6 +10083,7 @@ EXTERN_C const IID IID_ID3D12Device1;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
ID3D12Device1 * This,
_In_ const D3D12_RESOURCE_DESC *pDesc,
@@ -9075,6 +10092,7 @@ EXTERN_C const IID IID_ID3D12Device1;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
ID3D12Device1 * This,
_In_ ID3D12DeviceChild *pObject,
@@ -9083,12 +10101,14 @@ EXTERN_C const IID IID_ID3D12Device1;
_In_opt_ LPCWSTR Name,
_Out_ HANDLE *pHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
ID3D12Device1 * This,
_In_ HANDLE NTHandle,
REFIID riid,
_COM_Outptr_opt_ void **ppvObj);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
ID3D12Device1 * This,
_In_ LPCWSTR Name,
@@ -9096,16 +10116,19 @@ EXTERN_C const IID IID_ID3D12Device1;
/* [annotation][out] */
_Out_ HANDLE *pNTHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
HRESULT ( STDMETHODCALLTYPE *MakeResident )(
ID3D12Device1 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
HRESULT ( STDMETHODCALLTYPE *Evict )(
ID3D12Device1 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
HRESULT ( STDMETHODCALLTYPE *CreateFence )(
ID3D12Device1 * This,
UINT64 InitialValue,
@@ -9113,9 +10136,11 @@ EXTERN_C const IID IID_ID3D12Device1;
REFIID riid,
_COM_Outptr_ void **ppFence);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
ID3D12Device1 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
ID3D12Device1 * This,
_In_ const D3D12_RESOURCE_DESC *pResourceDesc,
@@ -9127,16 +10152,19 @@ EXTERN_C const IID IID_ID3D12Device1;
_Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
_Out_opt_ UINT64 *pTotalBytes);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
ID3D12Device1 * This,
_In_ const D3D12_QUERY_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
ID3D12Device1 * This,
BOOL Enable);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
ID3D12Device1 * This,
_In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
@@ -9144,6 +10172,7 @@ EXTERN_C const IID IID_ID3D12Device1;
REFIID riid,
_COM_Outptr_opt_ void **ppvCommandSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
void ( STDMETHODCALLTYPE *GetResourceTiling )(
ID3D12Device1 * This,
_In_ ID3D12Resource *pTiledResource,
@@ -9154,9 +10183,19 @@ EXTERN_C const IID IID_ID3D12Device1;
_In_ UINT FirstSubresourceTilingToGet,
_Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
ID3D12Device1 * This);
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device1 * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary)
HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )(
ID3D12Device1 * This,
_In_reads_(BlobLength) const void *pLibraryBlob,
@@ -9164,6 +10203,7 @@ EXTERN_C const IID IID_ID3D12Device1;
REFIID riid,
_COM_Outptr_ void **ppPipelineLibrary);
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion)
HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )(
ID3D12Device1 * This,
_In_reads_(NumFences) ID3D12Fence *const *ppFences,
@@ -9172,6 +10212,7 @@ EXTERN_C const IID IID_ID3D12Device1;
D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
HANDLE hEvent);
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority)
HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )(
ID3D12Device1 * This,
UINT NumObjects,
@@ -9267,12 +10308,22 @@ EXTERN_C const IID IID_ID3D12Device1;
#define ID3D12Device1_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
#define ID3D12Device1_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device1_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
#define ID3D12Device1_GetCustomHeapProperties(This,nodeMask,heapType) \
( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device1_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
#define ID3D12Device1_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
@@ -9321,9 +10372,14 @@ EXTERN_C const IID IID_ID3D12Device1;
#define ID3D12Device1_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
#define ID3D12Device1_GetAdapterLuid(This) \
( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device1_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
#define ID3D12Device1_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \
@@ -9375,65 +10431,78 @@ EXTERN_C const IID IID_ID3D12Device2;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Device2 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Device2 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Device2 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Device2 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Device2 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Device2 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Device2 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
UINT ( STDMETHODCALLTYPE *GetNodeCount )(
ID3D12Device2 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
ID3D12Device2 * This,
_In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppCommandQueue);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
ID3D12Device2 * This,
_In_ D3D12_COMMAND_LIST_TYPE type,
REFIID riid,
_COM_Outptr_ void **ppCommandAllocator);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
ID3D12Device2 * This,
_In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
ID3D12Device2 * This,
_In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
ID3D12Device2 * This,
_In_ UINT nodeMask,
@@ -9443,22 +10512,26 @@ EXTERN_C const IID IID_ID3D12Device2;
REFIID riid,
_COM_Outptr_ void **ppCommandList);
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
ID3D12Device2 * This,
D3D12_FEATURE Feature,
_Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
UINT FeatureSupportDataSize);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
ID3D12Device2 * This,
_In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
ID3D12Device2 * This,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
ID3D12Device2 * This,
_In_ UINT nodeMask,
@@ -9467,17 +10540,20 @@ EXTERN_C const IID IID_ID3D12Device2;
REFIID riid,
_COM_Outptr_ void **ppvRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
ID3D12Device2 * This,
_In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
ID3D12Device2 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
ID3D12Device2 * This,
_In_opt_ ID3D12Resource *pResource,
@@ -9485,23 +10561,27 @@ EXTERN_C const IID IID_ID3D12Device2;
_In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
ID3D12Device2 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
ID3D12Device2 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
void ( STDMETHODCALLTYPE *CreateSampler )(
ID3D12Device2 * This,
_In_ const D3D12_SAMPLER_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
void ( STDMETHODCALLTYPE *CopyDescriptors )(
ID3D12Device2 * This,
_In_ UINT NumDestDescriptorRanges,
@@ -9512,6 +10592,7 @@ EXTERN_C const IID IID_ID3D12Device2;
_In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
ID3D12Device2 * This,
_In_ UINT NumDescriptors,
@@ -9519,17 +10600,41 @@ EXTERN_C const IID IID_ID3D12Device2;
_In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
ID3D12Device2 * This,
_In_ UINT visibleMask,
_In_ UINT numResourceDescs,
_In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device2 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
ID3D12Device2 * This,
_In_ UINT nodeMask,
D3D12_HEAP_TYPE heapType);
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device2 * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
ID3D12Device2 * This,
_In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
@@ -9540,12 +10645,14 @@ EXTERN_C const IID IID_ID3D12Device2;
REFIID riidResource,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
ID3D12Device2 * This,
_In_ const D3D12_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
ID3D12Device2 * This,
_In_ ID3D12Heap *pHeap,
@@ -9556,6 +10663,7 @@ EXTERN_C const IID IID_ID3D12Device2;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
ID3D12Device2 * This,
_In_ const D3D12_RESOURCE_DESC *pDesc,
@@ -9564,6 +10672,7 @@ EXTERN_C const IID IID_ID3D12Device2;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
ID3D12Device2 * This,
_In_ ID3D12DeviceChild *pObject,
@@ -9572,12 +10681,14 @@ EXTERN_C const IID IID_ID3D12Device2;
_In_opt_ LPCWSTR Name,
_Out_ HANDLE *pHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
ID3D12Device2 * This,
_In_ HANDLE NTHandle,
REFIID riid,
_COM_Outptr_opt_ void **ppvObj);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
ID3D12Device2 * This,
_In_ LPCWSTR Name,
@@ -9585,16 +10696,19 @@ EXTERN_C const IID IID_ID3D12Device2;
/* [annotation][out] */
_Out_ HANDLE *pNTHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
HRESULT ( STDMETHODCALLTYPE *MakeResident )(
ID3D12Device2 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
HRESULT ( STDMETHODCALLTYPE *Evict )(
ID3D12Device2 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
HRESULT ( STDMETHODCALLTYPE *CreateFence )(
ID3D12Device2 * This,
UINT64 InitialValue,
@@ -9602,9 +10716,11 @@ EXTERN_C const IID IID_ID3D12Device2;
REFIID riid,
_COM_Outptr_ void **ppFence);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
ID3D12Device2 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
ID3D12Device2 * This,
_In_ const D3D12_RESOURCE_DESC *pResourceDesc,
@@ -9616,16 +10732,19 @@ EXTERN_C const IID IID_ID3D12Device2;
_Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
_Out_opt_ UINT64 *pTotalBytes);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
ID3D12Device2 * This,
_In_ const D3D12_QUERY_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
ID3D12Device2 * This,
BOOL Enable);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
ID3D12Device2 * This,
_In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
@@ -9633,6 +10752,7 @@ EXTERN_C const IID IID_ID3D12Device2;
REFIID riid,
_COM_Outptr_opt_ void **ppvCommandSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
void ( STDMETHODCALLTYPE *GetResourceTiling )(
ID3D12Device2 * This,
_In_ ID3D12Resource *pTiledResource,
@@ -9643,9 +10763,19 @@ EXTERN_C const IID IID_ID3D12Device2;
_In_ UINT FirstSubresourceTilingToGet,
_Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
ID3D12Device2 * This);
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device2 * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary)
HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )(
ID3D12Device2 * This,
_In_reads_(BlobLength) const void *pLibraryBlob,
@@ -9653,6 +10783,7 @@ EXTERN_C const IID IID_ID3D12Device2;
REFIID riid,
_COM_Outptr_ void **ppPipelineLibrary);
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion)
HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )(
ID3D12Device2 * This,
_In_reads_(NumFences) ID3D12Fence *const *ppFences,
@@ -9661,12 +10792,14 @@ EXTERN_C const IID IID_ID3D12Device2;
D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
HANDLE hEvent);
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority)
HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )(
ID3D12Device2 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
_In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities);
+ DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState)
HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )(
ID3D12Device2 * This,
const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc,
@@ -9762,12 +10895,22 @@ EXTERN_C const IID IID_ID3D12Device2;
#define ID3D12Device2_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
#define ID3D12Device2_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device2_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
#define ID3D12Device2_GetCustomHeapProperties(This,nodeMask,heapType) \
( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device2_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
#define ID3D12Device2_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
@@ -9816,9 +10959,14 @@ EXTERN_C const IID IID_ID3D12Device2;
#define ID3D12Device2_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
#define ID3D12Device2_GetAdapterLuid(This) \
( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device2_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
#define ID3D12Device2_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \
@@ -9902,65 +11050,78 @@ EXTERN_C const IID IID_ID3D12Device3;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Device3 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Device3 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Device3 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Device3 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Device3 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Device3 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Device3 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
UINT ( STDMETHODCALLTYPE *GetNodeCount )(
ID3D12Device3 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
ID3D12Device3 * This,
_In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppCommandQueue);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
ID3D12Device3 * This,
_In_ D3D12_COMMAND_LIST_TYPE type,
REFIID riid,
_COM_Outptr_ void **ppCommandAllocator);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
ID3D12Device3 * This,
_In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
ID3D12Device3 * This,
_In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
ID3D12Device3 * This,
_In_ UINT nodeMask,
@@ -9970,22 +11131,26 @@ EXTERN_C const IID IID_ID3D12Device3;
REFIID riid,
_COM_Outptr_ void **ppCommandList);
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
ID3D12Device3 * This,
D3D12_FEATURE Feature,
_Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
UINT FeatureSupportDataSize);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
ID3D12Device3 * This,
_In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
ID3D12Device3 * This,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
ID3D12Device3 * This,
_In_ UINT nodeMask,
@@ -9994,17 +11159,20 @@ EXTERN_C const IID IID_ID3D12Device3;
REFIID riid,
_COM_Outptr_ void **ppvRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
ID3D12Device3 * This,
_In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
ID3D12Device3 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
ID3D12Device3 * This,
_In_opt_ ID3D12Resource *pResource,
@@ -10012,23 +11180,27 @@ EXTERN_C const IID IID_ID3D12Device3;
_In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
ID3D12Device3 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
ID3D12Device3 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
void ( STDMETHODCALLTYPE *CreateSampler )(
ID3D12Device3 * This,
_In_ const D3D12_SAMPLER_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
void ( STDMETHODCALLTYPE *CopyDescriptors )(
ID3D12Device3 * This,
_In_ UINT NumDestDescriptorRanges,
@@ -10039,6 +11211,7 @@ EXTERN_C const IID IID_ID3D12Device3;
_In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
ID3D12Device3 * This,
_In_ UINT NumDescriptors,
@@ -10046,17 +11219,41 @@ EXTERN_C const IID IID_ID3D12Device3;
_In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
ID3D12Device3 * This,
_In_ UINT visibleMask,
_In_ UINT numResourceDescs,
_In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device3 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
ID3D12Device3 * This,
_In_ UINT nodeMask,
D3D12_HEAP_TYPE heapType);
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device3 * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
ID3D12Device3 * This,
_In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
@@ -10067,12 +11264,14 @@ EXTERN_C const IID IID_ID3D12Device3;
REFIID riidResource,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
ID3D12Device3 * This,
_In_ const D3D12_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
ID3D12Device3 * This,
_In_ ID3D12Heap *pHeap,
@@ -10083,6 +11282,7 @@ EXTERN_C const IID IID_ID3D12Device3;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
ID3D12Device3 * This,
_In_ const D3D12_RESOURCE_DESC *pDesc,
@@ -10091,6 +11291,7 @@ EXTERN_C const IID IID_ID3D12Device3;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
ID3D12Device3 * This,
_In_ ID3D12DeviceChild *pObject,
@@ -10099,12 +11300,14 @@ EXTERN_C const IID IID_ID3D12Device3;
_In_opt_ LPCWSTR Name,
_Out_ HANDLE *pHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
ID3D12Device3 * This,
_In_ HANDLE NTHandle,
REFIID riid,
_COM_Outptr_opt_ void **ppvObj);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
ID3D12Device3 * This,
_In_ LPCWSTR Name,
@@ -10112,16 +11315,19 @@ EXTERN_C const IID IID_ID3D12Device3;
/* [annotation][out] */
_Out_ HANDLE *pNTHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
HRESULT ( STDMETHODCALLTYPE *MakeResident )(
ID3D12Device3 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
HRESULT ( STDMETHODCALLTYPE *Evict )(
ID3D12Device3 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
HRESULT ( STDMETHODCALLTYPE *CreateFence )(
ID3D12Device3 * This,
UINT64 InitialValue,
@@ -10129,9 +11335,11 @@ EXTERN_C const IID IID_ID3D12Device3;
REFIID riid,
_COM_Outptr_ void **ppFence);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
ID3D12Device3 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
ID3D12Device3 * This,
_In_ const D3D12_RESOURCE_DESC *pResourceDesc,
@@ -10143,16 +11351,19 @@ EXTERN_C const IID IID_ID3D12Device3;
_Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
_Out_opt_ UINT64 *pTotalBytes);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
ID3D12Device3 * This,
_In_ const D3D12_QUERY_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
ID3D12Device3 * This,
BOOL Enable);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
ID3D12Device3 * This,
_In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
@@ -10160,6 +11371,7 @@ EXTERN_C const IID IID_ID3D12Device3;
REFIID riid,
_COM_Outptr_opt_ void **ppvCommandSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
void ( STDMETHODCALLTYPE *GetResourceTiling )(
ID3D12Device3 * This,
_In_ ID3D12Resource *pTiledResource,
@@ -10170,9 +11382,19 @@ EXTERN_C const IID IID_ID3D12Device3;
_In_ UINT FirstSubresourceTilingToGet,
_Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
ID3D12Device3 * This);
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device3 * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary)
HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )(
ID3D12Device3 * This,
_In_reads_(BlobLength) const void *pLibraryBlob,
@@ -10180,6 +11402,7 @@ EXTERN_C const IID IID_ID3D12Device3;
REFIID riid,
_COM_Outptr_ void **ppPipelineLibrary);
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion)
HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )(
ID3D12Device3 * This,
_In_reads_(NumFences) ID3D12Fence *const *ppFences,
@@ -10188,30 +11411,35 @@ EXTERN_C const IID IID_ID3D12Device3;
D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
HANDLE hEvent);
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority)
HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )(
ID3D12Device3 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
_In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities);
+ DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState)
HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )(
ID3D12Device3 * This,
const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress)
HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )(
ID3D12Device3 * This,
_In_ const void *pAddress,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping)
HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )(
ID3D12Device3 * This,
_In_ HANDLE hFileMapping,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident)
HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )(
ID3D12Device3 * This,
D3D12_RESIDENCY_FLAGS Flags,
@@ -10309,12 +11537,22 @@ EXTERN_C const IID IID_ID3D12Device3;
#define ID3D12Device3_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
#define ID3D12Device3_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device3_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
#define ID3D12Device3_GetCustomHeapProperties(This,nodeMask,heapType) \
( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device3_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
#define ID3D12Device3_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
@@ -10363,9 +11601,14 @@ EXTERN_C const IID IID_ID3D12Device3;
#define ID3D12Device3_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
#define ID3D12Device3_GetAdapterLuid(This) \
( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device3_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
#define ID3D12Device3_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \
@@ -10468,48 +11711,58 @@ EXTERN_C const IID IID_ID3D12ProtectedSession;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12ProtectedSession * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12ProtectedSession * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12ProtectedSession * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12ProtectedSession * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12ProtectedSession * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12ProtectedSession * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12ProtectedSession * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12ProtectedSession * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetStatusFence)
HRESULT ( STDMETHODCALLTYPE *GetStatusFence )(
ID3D12ProtectedSession * This,
REFIID riid,
_COM_Outptr_opt_ void **ppFence);
+ DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetSessionStatus)
D3D12_PROTECTED_SESSION_STATUS ( STDMETHODCALLTYPE *GetSessionStatus )(
ID3D12ProtectedSession * This);
@@ -10620,7 +11873,12 @@ EXTERN_C const IID IID_ID3D12ProtectedResourceSession;
ID3D12ProtectedResourceSession : public ID3D12ProtectedSession
{
public:
+#if defined(_MSC_VER)
virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+#else
+ virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC *STDMETHODCALLTYPE GetDesc(
+ D3D12_PROTECTED_RESOURCE_SESSION_DESC * RetVal) = 0;
+#endif
};
@@ -10631,54 +11889,73 @@ EXTERN_C const IID IID_ID3D12ProtectedResourceSession;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12ProtectedResourceSession * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12ProtectedResourceSession * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12ProtectedResourceSession * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12ProtectedResourceSession * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12ProtectedResourceSession * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12ProtectedResourceSession * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12ProtectedResourceSession * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12ProtectedResourceSession * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetStatusFence)
HRESULT ( STDMETHODCALLTYPE *GetStatusFence )(
ID3D12ProtectedResourceSession * This,
REFIID riid,
_COM_Outptr_opt_ void **ppFence);
+ DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetSessionStatus)
D3D12_PROTECTED_SESSION_STATUS ( STDMETHODCALLTYPE *GetSessionStatus )(
ID3D12ProtectedResourceSession * This);
+ DECLSPEC_XFGVIRT(ID3D12ProtectedResourceSession, GetDesc)
+#if !defined(_WIN32)
D3D12_PROTECTED_RESOURCE_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )(
ID3D12ProtectedResourceSession * This);
+#else
+ D3D12_PROTECTED_RESOURCE_SESSION_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12ProtectedResourceSession * This,
+ D3D12_PROTECTED_RESOURCE_SESSION_DESC * RetVal);
+
+#endif
+
END_INTERFACE
} ID3D12ProtectedResourceSessionVtbl;
@@ -10725,9 +12002,14 @@ EXTERN_C const IID IID_ID3D12ProtectedResourceSession;
#define ID3D12ProtectedResourceSession_GetSessionStatus(This) \
( (This)->lpVtbl -> GetSessionStatus(This) )
+#if !defined(_WIN32)
#define ID3D12ProtectedResourceSession_GetDesc(This) \
( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12ProtectedResourceSession_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
#endif /* COBJMACROS */
@@ -10737,10 +12019,6 @@ EXTERN_C const IID IID_ID3D12ProtectedResourceSession;
-
-
-
-
#endif /* __ID3D12ProtectedResourceSession_INTERFACE_DEFINED__ */
@@ -10795,11 +12073,20 @@ EXTERN_C const IID IID_ID3D12Device4;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource) = 0;
+#if defined(_MSC_VER)
virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo1(
UINT visibleMask,
UINT numResourceDescs,
_In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
_Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0;
+#else
+ virtual D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE GetResourceAllocationInfo1(
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0;
+#endif
};
@@ -10810,65 +12097,78 @@ EXTERN_C const IID IID_ID3D12Device4;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Device4 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Device4 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Device4 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Device4 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Device4 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Device4 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Device4 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
UINT ( STDMETHODCALLTYPE *GetNodeCount )(
ID3D12Device4 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
ID3D12Device4 * This,
_In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppCommandQueue);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
ID3D12Device4 * This,
_In_ D3D12_COMMAND_LIST_TYPE type,
REFIID riid,
_COM_Outptr_ void **ppCommandAllocator);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
ID3D12Device4 * This,
_In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
ID3D12Device4 * This,
_In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
ID3D12Device4 * This,
_In_ UINT nodeMask,
@@ -10878,22 +12178,26 @@ EXTERN_C const IID IID_ID3D12Device4;
REFIID riid,
_COM_Outptr_ void **ppCommandList);
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
ID3D12Device4 * This,
D3D12_FEATURE Feature,
_Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
UINT FeatureSupportDataSize);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
ID3D12Device4 * This,
_In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
ID3D12Device4 * This,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
ID3D12Device4 * This,
_In_ UINT nodeMask,
@@ -10902,17 +12206,20 @@ EXTERN_C const IID IID_ID3D12Device4;
REFIID riid,
_COM_Outptr_ void **ppvRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
ID3D12Device4 * This,
_In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
ID3D12Device4 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
ID3D12Device4 * This,
_In_opt_ ID3D12Resource *pResource,
@@ -10920,23 +12227,27 @@ EXTERN_C const IID IID_ID3D12Device4;
_In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
ID3D12Device4 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
ID3D12Device4 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
void ( STDMETHODCALLTYPE *CreateSampler )(
ID3D12Device4 * This,
_In_ const D3D12_SAMPLER_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
void ( STDMETHODCALLTYPE *CopyDescriptors )(
ID3D12Device4 * This,
_In_ UINT NumDestDescriptorRanges,
@@ -10947,6 +12258,7 @@ EXTERN_C const IID IID_ID3D12Device4;
_In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
ID3D12Device4 * This,
_In_ UINT NumDescriptors,
@@ -10954,17 +12266,41 @@ EXTERN_C const IID IID_ID3D12Device4;
_In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
ID3D12Device4 * This,
_In_ UINT visibleMask,
_In_ UINT numResourceDescs,
_In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device4 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
ID3D12Device4 * This,
_In_ UINT nodeMask,
D3D12_HEAP_TYPE heapType);
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device4 * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
ID3D12Device4 * This,
_In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
@@ -10975,12 +12311,14 @@ EXTERN_C const IID IID_ID3D12Device4;
REFIID riidResource,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
ID3D12Device4 * This,
_In_ const D3D12_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
ID3D12Device4 * This,
_In_ ID3D12Heap *pHeap,
@@ -10991,6 +12329,7 @@ EXTERN_C const IID IID_ID3D12Device4;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
ID3D12Device4 * This,
_In_ const D3D12_RESOURCE_DESC *pDesc,
@@ -10999,6 +12338,7 @@ EXTERN_C const IID IID_ID3D12Device4;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
ID3D12Device4 * This,
_In_ ID3D12DeviceChild *pObject,
@@ -11007,12 +12347,14 @@ EXTERN_C const IID IID_ID3D12Device4;
_In_opt_ LPCWSTR Name,
_Out_ HANDLE *pHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
ID3D12Device4 * This,
_In_ HANDLE NTHandle,
REFIID riid,
_COM_Outptr_opt_ void **ppvObj);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
ID3D12Device4 * This,
_In_ LPCWSTR Name,
@@ -11020,16 +12362,19 @@ EXTERN_C const IID IID_ID3D12Device4;
/* [annotation][out] */
_Out_ HANDLE *pNTHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
HRESULT ( STDMETHODCALLTYPE *MakeResident )(
ID3D12Device4 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
HRESULT ( STDMETHODCALLTYPE *Evict )(
ID3D12Device4 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
HRESULT ( STDMETHODCALLTYPE *CreateFence )(
ID3D12Device4 * This,
UINT64 InitialValue,
@@ -11037,9 +12382,11 @@ EXTERN_C const IID IID_ID3D12Device4;
REFIID riid,
_COM_Outptr_ void **ppFence);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
ID3D12Device4 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
ID3D12Device4 * This,
_In_ const D3D12_RESOURCE_DESC *pResourceDesc,
@@ -11051,16 +12398,19 @@ EXTERN_C const IID IID_ID3D12Device4;
_Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
_Out_opt_ UINT64 *pTotalBytes);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
ID3D12Device4 * This,
_In_ const D3D12_QUERY_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
ID3D12Device4 * This,
BOOL Enable);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
ID3D12Device4 * This,
_In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
@@ -11068,6 +12418,7 @@ EXTERN_C const IID IID_ID3D12Device4;
REFIID riid,
_COM_Outptr_opt_ void **ppvCommandSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
void ( STDMETHODCALLTYPE *GetResourceTiling )(
ID3D12Device4 * This,
_In_ ID3D12Resource *pTiledResource,
@@ -11078,9 +12429,19 @@ EXTERN_C const IID IID_ID3D12Device4;
_In_ UINT FirstSubresourceTilingToGet,
_Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
ID3D12Device4 * This);
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device4 * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary)
HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )(
ID3D12Device4 * This,
_In_reads_(BlobLength) const void *pLibraryBlob,
@@ -11088,6 +12449,7 @@ EXTERN_C const IID IID_ID3D12Device4;
REFIID riid,
_COM_Outptr_ void **ppPipelineLibrary);
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion)
HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )(
ID3D12Device4 * This,
_In_reads_(NumFences) ID3D12Fence *const *ppFences,
@@ -11096,30 +12458,35 @@ EXTERN_C const IID IID_ID3D12Device4;
D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
HANDLE hEvent);
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority)
HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )(
ID3D12Device4 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
_In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities);
+ DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState)
HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )(
ID3D12Device4 * This,
const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress)
HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )(
ID3D12Device4 * This,
_In_ const void *pAddress,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping)
HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )(
ID3D12Device4 * This,
_In_ HANDLE hFileMapping,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident)
HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )(
ID3D12Device4 * This,
D3D12_RESIDENCY_FLAGS Flags,
@@ -11128,6 +12495,7 @@ EXTERN_C const IID IID_ID3D12Device4;
_In_ ID3D12Fence *pFenceToSignal,
UINT64 FenceValueToSignal);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1)
HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )(
ID3D12Device4 * This,
_In_ UINT nodeMask,
@@ -11136,12 +12504,14 @@ EXTERN_C const IID IID_ID3D12Device4;
REFIID riid,
_COM_Outptr_ void **ppCommandList);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession)
HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )(
ID3D12Device4 * This,
_In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc,
_In_ REFIID riid,
_COM_Outptr_ void **ppSession);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1)
HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )(
ID3D12Device4 * This,
_In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
@@ -11153,6 +12523,7 @@ EXTERN_C const IID IID_ID3D12Device4;
REFIID riidResource,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1)
HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )(
ID3D12Device4 * This,
_In_ const D3D12_HEAP_DESC *pDesc,
@@ -11160,6 +12531,7 @@ EXTERN_C const IID IID_ID3D12Device4;
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1)
HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )(
ID3D12Device4 * This,
_In_ const D3D12_RESOURCE_DESC *pDesc,
@@ -11169,6 +12541,8 @@ EXTERN_C const IID IID_ID3D12Device4;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1)
+#if !defined(_WIN32)
D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
ID3D12Device4 * This,
UINT visibleMask,
@@ -11176,6 +12550,17 @@ EXTERN_C const IID IID_ID3D12Device4;
_In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
_Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device4 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
END_INTERFACE
} ID3D12Device4Vtbl;
@@ -11265,12 +12650,22 @@ EXTERN_C const IID IID_ID3D12Device4;
#define ID3D12Device4_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
#define ID3D12Device4_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device4_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
#define ID3D12Device4_GetCustomHeapProperties(This,nodeMask,heapType) \
( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device4_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
#define ID3D12Device4_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
@@ -11319,9 +12714,14 @@ EXTERN_C const IID IID_ID3D12Device4;
#define ID3D12Device4_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
#define ID3D12Device4_GetAdapterLuid(This) \
( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device4_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
#define ID3D12Device4_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \
@@ -11362,9 +12762,14 @@ EXTERN_C const IID IID_ID3D12Device4;
#define ID3D12Device4_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \
( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) )
+#if !defined(_WIN32)
#define ID3D12Device4_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device4_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
#endif /* COBJMACROS */
@@ -11374,10 +12779,6 @@ EXTERN_C const IID IID_ID3D12Device4;
-
-
-
-
#endif /* __ID3D12Device4_INTERFACE_DEFINED__ */
@@ -11424,17 +12825,21 @@ EXTERN_C const IID IID_ID3D12LifetimeOwner;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12LifetimeOwner * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12LifetimeOwner * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12LifetimeOwner * This);
+ DECLSPEC_XFGVIRT(ID3D12LifetimeOwner, LifetimeStateUpdated)
void ( STDMETHODCALLTYPE *LifetimeStateUpdated )(
ID3D12LifetimeOwner * This,
D3D12_LIFETIME_STATE NewState);
@@ -11491,7 +12896,12 @@ EXTERN_C const IID IID_ID3D12SwapChainAssistant;
ID3D12SwapChainAssistant : public IUnknown
{
public:
+#if defined(_MSC_VER)
virtual LUID STDMETHODCALLTYPE GetLUID( void) = 0;
+#else
+ virtual LUID *STDMETHODCALLTYPE GetLUID(
+ LUID * RetVal) = 0;
+#endif
virtual HRESULT STDMETHODCALLTYPE GetSwapChainObject(
REFIID riid,
@@ -11514,25 +12924,39 @@ EXTERN_C const IID IID_ID3D12SwapChainAssistant;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12SwapChainAssistant * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12SwapChainAssistant * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12SwapChainAssistant * This);
+ DECLSPEC_XFGVIRT(ID3D12SwapChainAssistant, GetLUID)
+#if !defined(_WIN32)
LUID ( STDMETHODCALLTYPE *GetLUID )(
ID3D12SwapChainAssistant * This);
+#else
+ LUID *( STDMETHODCALLTYPE *GetLUID )(
+ ID3D12SwapChainAssistant * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12SwapChainAssistant, GetSwapChainObject)
HRESULT ( STDMETHODCALLTYPE *GetSwapChainObject )(
ID3D12SwapChainAssistant * This,
REFIID riid,
_COM_Outptr_ void **ppv);
+ DECLSPEC_XFGVIRT(ID3D12SwapChainAssistant, GetCurrentResourceAndCommandQueue)
HRESULT ( STDMETHODCALLTYPE *GetCurrentResourceAndCommandQueue )(
ID3D12SwapChainAssistant * This,
REFIID riidResource,
@@ -11540,6 +12964,7 @@ EXTERN_C const IID IID_ID3D12SwapChainAssistant;
REFIID riidQueue,
_COM_Outptr_ void **ppvQueue);
+ DECLSPEC_XFGVIRT(ID3D12SwapChainAssistant, InsertImplicitSync)
HRESULT ( STDMETHODCALLTYPE *InsertImplicitSync )(
ID3D12SwapChainAssistant * This);
@@ -11565,9 +12990,14 @@ EXTERN_C const IID IID_ID3D12SwapChainAssistant;
#define ID3D12SwapChainAssistant_Release(This) \
( (This)->lpVtbl -> Release(This) )
+#if !defined(_WIN32)
#define ID3D12SwapChainAssistant_GetLUID(This) \
( (This)->lpVtbl -> GetLUID(This) )
+#else
+#define ID3D12SwapChainAssistant_GetLUID(This,RetVal) \
+ ( (This)->lpVtbl -> GetLUID(This,RetVal) )
+#endif
#define ID3D12SwapChainAssistant_GetSwapChainObject(This,riid,ppv) \
( (This)->lpVtbl -> GetSwapChainObject(This,riid,ppv) )
@@ -11586,10 +13016,6 @@ EXTERN_C const IID IID_ID3D12SwapChainAssistant;
-
-
-
-
#endif /* __ID3D12SwapChainAssistant_INTERFACE_DEFINED__ */
@@ -11620,43 +13046,52 @@ EXTERN_C const IID IID_ID3D12LifetimeTracker;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12LifetimeTracker * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12LifetimeTracker * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12LifetimeTracker * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12LifetimeTracker * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12LifetimeTracker * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12LifetimeTracker * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12LifetimeTracker * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12LifetimeTracker * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12LifetimeTracker, DestroyOwnedObject)
HRESULT ( STDMETHODCALLTYPE *DestroyOwnedObject )(
ID3D12LifetimeTracker * This,
_In_ ID3D12DeviceChild *pObject);
@@ -11814,38 +13249,46 @@ EXTERN_C const IID IID_ID3D12StateObject;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12StateObject * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12StateObject * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12StateObject * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12StateObject * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12StateObject * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12StateObject * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12StateObject * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12StateObject * This,
REFIID riid,
@@ -11938,28 +13381,35 @@ EXTERN_C const IID IID_ID3D12StateObjectProperties;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12StateObjectProperties * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12StateObjectProperties * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12StateObjectProperties * This);
+ DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, GetShaderIdentifier)
void *( STDMETHODCALLTYPE *GetShaderIdentifier )(
ID3D12StateObjectProperties * This,
_In_ LPCWSTR pExportName);
+ DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, GetShaderStackSize)
UINT64 ( STDMETHODCALLTYPE *GetShaderStackSize )(
ID3D12StateObjectProperties * This,
_In_ LPCWSTR pExportName);
+ DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, GetPipelineStackSize)
UINT64 ( STDMETHODCALLTYPE *GetPipelineStackSize )(
ID3D12StateObjectProperties * This);
+ DECLSPEC_XFGVIRT(ID3D12StateObjectProperties, SetPipelineStackSize)
void ( STDMETHODCALLTYPE *SetPipelineStackSize )(
ID3D12StateObjectProperties * This,
UINT64 PipelineStackSizeInBytes);
@@ -12027,7 +13477,8 @@ enum D3D12_STATE_SUBOBJECT_TYPE
D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_SHADER_CONFIG = 9,
D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG = 10,
D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP = 11,
- D3D12_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP + 1 )
+ D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1 = 12,
+ D3D12_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG1 + 1 )
} D3D12_STATE_SUBOBJECT_TYPE;
typedef struct D3D12_STATE_SUBOBJECT
@@ -12041,7 +13492,8 @@ enum D3D12_STATE_OBJECT_FLAGS
{
D3D12_STATE_OBJECT_FLAG_NONE = 0,
D3D12_STATE_OBJECT_FLAG_ALLOW_LOCAL_DEPENDENCIES_ON_EXTERNAL_DEFINITIONS = 0x1,
- D3D12_STATE_OBJECT_FLAG_ALLOW_EXTERNAL_DEPENDENCIES_ON_LOCAL_DEFINITIONS = 0x2
+ D3D12_STATE_OBJECT_FLAG_ALLOW_EXTERNAL_DEPENDENCIES_ON_LOCAL_DEFINITIONS = 0x2,
+ D3D12_STATE_OBJECT_FLAG_ALLOW_STATE_OBJECT_ADDITIONS = 0x4
} D3D12_STATE_OBJECT_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS( D3D12_STATE_OBJECT_FLAGS );
@@ -12135,6 +13587,21 @@ typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG
} D3D12_RAYTRACING_PIPELINE_CONFIG;
typedef
+enum D3D12_RAYTRACING_PIPELINE_FLAGS
+ {
+ D3D12_RAYTRACING_PIPELINE_FLAG_NONE = 0,
+ D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_TRIANGLES = 0x100,
+ D3D12_RAYTRACING_PIPELINE_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200
+ } D3D12_RAYTRACING_PIPELINE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_PIPELINE_FLAGS );
+typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG1
+ {
+ UINT MaxTraceRecursionDepth;
+ D3D12_RAYTRACING_PIPELINE_FLAGS Flags;
+ } D3D12_RAYTRACING_PIPELINE_CONFIG1;
+
+typedef
enum D3D12_STATE_OBJECT_TYPE
{
D3D12_STATE_OBJECT_TYPE_COLLECTION = 0,
@@ -12397,7 +13864,9 @@ enum D3D12_RAY_FLAGS
D3D12_RAY_FLAG_CULL_BACK_FACING_TRIANGLES = 0x10,
D3D12_RAY_FLAG_CULL_FRONT_FACING_TRIANGLES = 0x20,
D3D12_RAY_FLAG_CULL_OPAQUE = 0x40,
- D3D12_RAY_FLAG_CULL_NON_OPAQUE = 0x80
+ D3D12_RAY_FLAG_CULL_NON_OPAQUE = 0x80,
+ D3D12_RAY_FLAG_SKIP_TRIANGLES = 0x100,
+ D3D12_RAY_FLAG_SKIP_PROCEDURAL_PRIMITIVES = 0x200
} D3D12_RAY_FLAGS;
DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAY_FLAGS );
@@ -12476,65 +13945,78 @@ EXTERN_C const IID IID_ID3D12Device5;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Device5 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Device5 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Device5 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Device5 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Device5 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Device5 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Device5 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
UINT ( STDMETHODCALLTYPE *GetNodeCount )(
ID3D12Device5 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
ID3D12Device5 * This,
_In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppCommandQueue);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
ID3D12Device5 * This,
_In_ D3D12_COMMAND_LIST_TYPE type,
REFIID riid,
_COM_Outptr_ void **ppCommandAllocator);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
ID3D12Device5 * This,
_In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
ID3D12Device5 * This,
_In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
ID3D12Device5 * This,
_In_ UINT nodeMask,
@@ -12544,22 +14026,26 @@ EXTERN_C const IID IID_ID3D12Device5;
REFIID riid,
_COM_Outptr_ void **ppCommandList);
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
ID3D12Device5 * This,
D3D12_FEATURE Feature,
_Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
UINT FeatureSupportDataSize);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
ID3D12Device5 * This,
_In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
ID3D12Device5 * This,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
ID3D12Device5 * This,
_In_ UINT nodeMask,
@@ -12568,17 +14054,20 @@ EXTERN_C const IID IID_ID3D12Device5;
REFIID riid,
_COM_Outptr_ void **ppvRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
ID3D12Device5 * This,
_In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
ID3D12Device5 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
ID3D12Device5 * This,
_In_opt_ ID3D12Resource *pResource,
@@ -12586,23 +14075,27 @@ EXTERN_C const IID IID_ID3D12Device5;
_In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
ID3D12Device5 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
ID3D12Device5 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
void ( STDMETHODCALLTYPE *CreateSampler )(
ID3D12Device5 * This,
_In_ const D3D12_SAMPLER_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
void ( STDMETHODCALLTYPE *CopyDescriptors )(
ID3D12Device5 * This,
_In_ UINT NumDestDescriptorRanges,
@@ -12613,6 +14106,7 @@ EXTERN_C const IID IID_ID3D12Device5;
_In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
ID3D12Device5 * This,
_In_ UINT NumDescriptors,
@@ -12620,17 +14114,41 @@ EXTERN_C const IID IID_ID3D12Device5;
_In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
ID3D12Device5 * This,
_In_ UINT visibleMask,
_In_ UINT numResourceDescs,
_In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device5 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
ID3D12Device5 * This,
_In_ UINT nodeMask,
D3D12_HEAP_TYPE heapType);
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device5 * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
ID3D12Device5 * This,
_In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
@@ -12641,12 +14159,14 @@ EXTERN_C const IID IID_ID3D12Device5;
REFIID riidResource,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
ID3D12Device5 * This,
_In_ const D3D12_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
ID3D12Device5 * This,
_In_ ID3D12Heap *pHeap,
@@ -12657,6 +14177,7 @@ EXTERN_C const IID IID_ID3D12Device5;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
ID3D12Device5 * This,
_In_ const D3D12_RESOURCE_DESC *pDesc,
@@ -12665,6 +14186,7 @@ EXTERN_C const IID IID_ID3D12Device5;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
ID3D12Device5 * This,
_In_ ID3D12DeviceChild *pObject,
@@ -12673,12 +14195,14 @@ EXTERN_C const IID IID_ID3D12Device5;
_In_opt_ LPCWSTR Name,
_Out_ HANDLE *pHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
ID3D12Device5 * This,
_In_ HANDLE NTHandle,
REFIID riid,
_COM_Outptr_opt_ void **ppvObj);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
ID3D12Device5 * This,
_In_ LPCWSTR Name,
@@ -12686,16 +14210,19 @@ EXTERN_C const IID IID_ID3D12Device5;
/* [annotation][out] */
_Out_ HANDLE *pNTHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
HRESULT ( STDMETHODCALLTYPE *MakeResident )(
ID3D12Device5 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
HRESULT ( STDMETHODCALLTYPE *Evict )(
ID3D12Device5 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
HRESULT ( STDMETHODCALLTYPE *CreateFence )(
ID3D12Device5 * This,
UINT64 InitialValue,
@@ -12703,9 +14230,11 @@ EXTERN_C const IID IID_ID3D12Device5;
REFIID riid,
_COM_Outptr_ void **ppFence);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
ID3D12Device5 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
ID3D12Device5 * This,
_In_ const D3D12_RESOURCE_DESC *pResourceDesc,
@@ -12717,16 +14246,19 @@ EXTERN_C const IID IID_ID3D12Device5;
_Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
_Out_opt_ UINT64 *pTotalBytes);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
ID3D12Device5 * This,
_In_ const D3D12_QUERY_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
ID3D12Device5 * This,
BOOL Enable);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
ID3D12Device5 * This,
_In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
@@ -12734,6 +14266,7 @@ EXTERN_C const IID IID_ID3D12Device5;
REFIID riid,
_COM_Outptr_opt_ void **ppvCommandSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
void ( STDMETHODCALLTYPE *GetResourceTiling )(
ID3D12Device5 * This,
_In_ ID3D12Resource *pTiledResource,
@@ -12744,9 +14277,19 @@ EXTERN_C const IID IID_ID3D12Device5;
_In_ UINT FirstSubresourceTilingToGet,
_Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
ID3D12Device5 * This);
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device5 * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary)
HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )(
ID3D12Device5 * This,
_In_reads_(BlobLength) const void *pLibraryBlob,
@@ -12754,6 +14297,7 @@ EXTERN_C const IID IID_ID3D12Device5;
REFIID riid,
_COM_Outptr_ void **ppPipelineLibrary);
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion)
HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )(
ID3D12Device5 * This,
_In_reads_(NumFences) ID3D12Fence *const *ppFences,
@@ -12762,30 +14306,35 @@ EXTERN_C const IID IID_ID3D12Device5;
D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
HANDLE hEvent);
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority)
HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )(
ID3D12Device5 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
_In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities);
+ DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState)
HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )(
ID3D12Device5 * This,
const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress)
HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )(
ID3D12Device5 * This,
_In_ const void *pAddress,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping)
HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )(
ID3D12Device5 * This,
_In_ HANDLE hFileMapping,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident)
HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )(
ID3D12Device5 * This,
D3D12_RESIDENCY_FLAGS Flags,
@@ -12794,6 +14343,7 @@ EXTERN_C const IID IID_ID3D12Device5;
_In_ ID3D12Fence *pFenceToSignal,
UINT64 FenceValueToSignal);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1)
HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )(
ID3D12Device5 * This,
_In_ UINT nodeMask,
@@ -12802,12 +14352,14 @@ EXTERN_C const IID IID_ID3D12Device5;
REFIID riid,
_COM_Outptr_ void **ppCommandList);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession)
HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )(
ID3D12Device5 * This,
_In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc,
_In_ REFIID riid,
_COM_Outptr_ void **ppSession);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1)
HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )(
ID3D12Device5 * This,
_In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
@@ -12819,6 +14371,7 @@ EXTERN_C const IID IID_ID3D12Device5;
REFIID riidResource,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1)
HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )(
ID3D12Device5 * This,
_In_ const D3D12_HEAP_DESC *pDesc,
@@ -12826,6 +14379,7 @@ EXTERN_C const IID IID_ID3D12Device5;
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1)
HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )(
ID3D12Device5 * This,
_In_ const D3D12_RESOURCE_DESC *pDesc,
@@ -12835,6 +14389,8 @@ EXTERN_C const IID IID_ID3D12Device5;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1)
+#if !defined(_WIN32)
D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
ID3D12Device5 * This,
UINT visibleMask,
@@ -12842,20 +14398,35 @@ EXTERN_C const IID IID_ID3D12Device5;
_In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
_Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device5 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker)
HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )(
ID3D12Device5 * This,
_In_ ID3D12LifetimeOwner *pOwner,
REFIID riid,
_COM_Outptr_ void **ppvTracker);
+ DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice)
void ( STDMETHODCALLTYPE *RemoveDevice )(
ID3D12Device5 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands)
HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )(
ID3D12Device5 * This,
_Inout_ UINT *pNumMetaCommands,
_Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs);
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters)
HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )(
ID3D12Device5 * This,
_In_ REFGUID CommandId,
@@ -12864,6 +14435,7 @@ EXTERN_C const IID IID_ID3D12Device5;
_Inout_ UINT *pParameterCount,
_Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs);
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand)
HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )(
ID3D12Device5 * This,
_In_ REFGUID CommandId,
@@ -12873,17 +14445,20 @@ EXTERN_C const IID IID_ID3D12Device5;
REFIID riid,
_COM_Outptr_ void **ppMetaCommand);
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject)
HRESULT ( STDMETHODCALLTYPE *CreateStateObject )(
ID3D12Device5 * This,
const D3D12_STATE_OBJECT_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppStateObject);
+ DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo)
void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )(
ID3D12Device5 * This,
_In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc,
_Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo);
+ DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier)
D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )(
ID3D12Device5 * This,
_In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType,
@@ -12978,12 +14553,22 @@ EXTERN_C const IID IID_ID3D12Device5;
#define ID3D12Device5_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
#define ID3D12Device5_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device5_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
#define ID3D12Device5_GetCustomHeapProperties(This,nodeMask,heapType) \
( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device5_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
#define ID3D12Device5_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
@@ -13032,9 +14617,14 @@ EXTERN_C const IID IID_ID3D12Device5;
#define ID3D12Device5_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
#define ID3D12Device5_GetAdapterLuid(This) \
( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device5_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
#define ID3D12Device5_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \
@@ -13075,9 +14665,14 @@ EXTERN_C const IID IID_ID3D12Device5;
#define ID3D12Device5_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \
( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) )
+#if !defined(_WIN32)
#define ID3D12Device5_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device5_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
#define ID3D12Device5_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \
@@ -13162,7 +14757,10 @@ enum D3D12_AUTO_BREADCRUMB_OP
D3D12_AUTO_BREADCRUMB_OP_RESOLVEMOTIONVECTORHEAP = 38,
D3D12_AUTO_BREADCRUMB_OP_SETPIPELINESTATE1 = 39,
D3D12_AUTO_BREADCRUMB_OP_INITIALIZEEXTENSIONCOMMAND = 40,
- D3D12_AUTO_BREADCRUMB_OP_EXECUTEEXTENSIONCOMMAND = 41
+ D3D12_AUTO_BREADCRUMB_OP_EXECUTEEXTENSIONCOMMAND = 41,
+ D3D12_AUTO_BREADCRUMB_OP_DISPATCHMESH = 42,
+ D3D12_AUTO_BREADCRUMB_OP_ENCODEFRAME = 43,
+ D3D12_AUTO_BREADCRUMB_OP_RESOLVEENCODEROUTPUTMETADATA = 44
} D3D12_AUTO_BREADCRUMB_OP;
typedef struct D3D12_AUTO_BREADCRUMB_NODE
@@ -13179,11 +14777,35 @@ typedef struct D3D12_AUTO_BREADCRUMB_NODE
const struct D3D12_AUTO_BREADCRUMB_NODE *pNext;
} D3D12_AUTO_BREADCRUMB_NODE;
+typedef struct D3D12_DRED_BREADCRUMB_CONTEXT
+ {
+ UINT BreadcrumbIndex;
+ const wchar_t *pContextString;
+ } D3D12_DRED_BREADCRUMB_CONTEXT;
+
+typedef struct D3D12_AUTO_BREADCRUMB_NODE1
+ {
+ const char *pCommandListDebugNameA;
+ const wchar_t *pCommandListDebugNameW;
+ const char *pCommandQueueDebugNameA;
+ const wchar_t *pCommandQueueDebugNameW;
+ ID3D12GraphicsCommandList *pCommandList;
+ ID3D12CommandQueue *pCommandQueue;
+ UINT BreadcrumbCount;
+ const UINT *pLastBreadcrumbValue;
+ const D3D12_AUTO_BREADCRUMB_OP *pCommandHistory;
+ const struct D3D12_AUTO_BREADCRUMB_NODE1 *pNext;
+ UINT BreadcrumbContextsCount;
+ D3D12_DRED_BREADCRUMB_CONTEXT *pBreadcrumbContexts;
+ } D3D12_AUTO_BREADCRUMB_NODE1;
+
typedef
enum D3D12_DRED_VERSION
{
D3D12_DRED_VERSION_1_0 = 0x1,
- D3D12_DRED_VERSION_1_1 = 0x2
+ D3D12_DRED_VERSION_1_1 = 0x2,
+ D3D12_DRED_VERSION_1_2 = 0x3,
+ D3D12_DRED_VERSION_1_3 = 0x4
} D3D12_DRED_VERSION;
typedef
@@ -13238,6 +14860,8 @@ enum D3D12_DRED_ALLOCATION_TYPE
D3D12_DRED_ALLOCATION_TYPE_VIDEO_MOTION_ESTIMATOR = 45,
D3D12_DRED_ALLOCATION_TYPE_VIDEO_MOTION_VECTOR_HEAP = 46,
D3D12_DRED_ALLOCATION_TYPE_VIDEO_EXTENSION_COMMAND = 47,
+ D3D12_DRED_ALLOCATION_TYPE_VIDEO_ENCODER = 48,
+ D3D12_DRED_ALLOCATION_TYPE_VIDEO_ENCODER_HEAP = 49,
D3D12_DRED_ALLOCATION_TYPE_INVALID = 0xffffffff
} D3D12_DRED_ALLOCATION_TYPE;
@@ -13249,11 +14873,25 @@ typedef struct D3D12_DRED_ALLOCATION_NODE
const struct D3D12_DRED_ALLOCATION_NODE *pNext;
} D3D12_DRED_ALLOCATION_NODE;
+typedef struct D3D12_DRED_ALLOCATION_NODE1
+ {
+ const char *ObjectNameA;
+ const wchar_t *ObjectNameW;
+ D3D12_DRED_ALLOCATION_TYPE AllocationType;
+ const struct D3D12_DRED_ALLOCATION_NODE1 *pNext;
+ const IUnknown *pObject;
+ } D3D12_DRED_ALLOCATION_NODE1;
+
typedef struct D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT
{
_Out_ const D3D12_AUTO_BREADCRUMB_NODE *pHeadAutoBreadcrumbNode;
} D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT;
+typedef struct D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1
+ {
+ _Out_ const D3D12_AUTO_BREADCRUMB_NODE1 *pHeadAutoBreadcrumbNode;
+ } D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1;
+
typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT
{
D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA;
@@ -13261,6 +14899,37 @@ typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT
_Out_ const D3D12_DRED_ALLOCATION_NODE *pHeadRecentFreedAllocationNode;
} D3D12_DRED_PAGE_FAULT_OUTPUT;
+typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT1
+ {
+ D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA;
+ _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadExistingAllocationNode;
+ _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadRecentFreedAllocationNode;
+ } D3D12_DRED_PAGE_FAULT_OUTPUT1;
+
+typedef
+enum D3D12_DRED_PAGE_FAULT_FLAGS
+ {
+ D3D12_DRED_PAGE_FAULT_FLAGS_NONE = 0
+ } D3D12_DRED_PAGE_FAULT_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_DRED_PAGE_FAULT_FLAGS );
+typedef
+enum D3D12_DRED_DEVICE_STATE
+ {
+ D3D12_DRED_DEVICE_STATE_UNKNOWN = 0,
+ D3D12_DRED_DEVICE_STATE_HUNG = 3,
+ D3D12_DRED_DEVICE_STATE_FAULT = 6,
+ D3D12_DRED_DEVICE_STATE_PAGEFAULT = 7
+ } D3D12_DRED_DEVICE_STATE;
+
+typedef struct D3D12_DRED_PAGE_FAULT_OUTPUT2
+ {
+ D3D12_GPU_VIRTUAL_ADDRESS PageFaultVA;
+ _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadExistingAllocationNode;
+ _Out_ const D3D12_DRED_ALLOCATION_NODE1 *pHeadRecentFreedAllocationNode;
+ D3D12_DRED_PAGE_FAULT_FLAGS PageFaultFlags;
+ } D3D12_DRED_PAGE_FAULT_OUTPUT2;
+
typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA1
{
HRESULT DeviceRemovedReason;
@@ -13268,6 +14937,21 @@ typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA1
D3D12_DRED_PAGE_FAULT_OUTPUT PageFaultOutput;
} D3D12_DEVICE_REMOVED_EXTENDED_DATA1;
+typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA2
+ {
+ HRESULT DeviceRemovedReason;
+ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 AutoBreadcrumbsOutput;
+ D3D12_DRED_PAGE_FAULT_OUTPUT1 PageFaultOutput;
+ } D3D12_DEVICE_REMOVED_EXTENDED_DATA2;
+
+typedef struct D3D12_DEVICE_REMOVED_EXTENDED_DATA3
+ {
+ HRESULT DeviceRemovedReason;
+ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 AutoBreadcrumbsOutput;
+ D3D12_DRED_PAGE_FAULT_OUTPUT2 PageFaultOutput;
+ D3D12_DRED_DEVICE_STATE DeviceState;
+ } D3D12_DEVICE_REMOVED_EXTENDED_DATA3;
+
typedef struct D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA
{
D3D12_DRED_VERSION Version;
@@ -13275,6 +14959,8 @@ typedef struct D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA
{
D3D12_DEVICE_REMOVED_EXTENDED_DATA Dred_1_0;
D3D12_DEVICE_REMOVED_EXTENDED_DATA1 Dred_1_1;
+ D3D12_DEVICE_REMOVED_EXTENDED_DATA2 Dred_1_2;
+ D3D12_DEVICE_REMOVED_EXTENDED_DATA3 Dred_1_3;
} ;
} D3D12_VERSIONED_DEVICE_REMOVED_EXTENDED_DATA;
@@ -13299,13 +14985,13 @@ EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings;
{
public:
virtual void STDMETHODCALLTYPE SetAutoBreadcrumbsEnablement(
- D3D12_DRED_ENABLEMENT __MIDL__ID3D12DeviceRemovedExtendedDataSettings0000) = 0;
+ D3D12_DRED_ENABLEMENT Enablement) = 0;
virtual void STDMETHODCALLTYPE SetPageFaultEnablement(
- D3D12_DRED_ENABLEMENT __MIDL__ID3D12DeviceRemovedExtendedDataSettings0001) = 0;
+ D3D12_DRED_ENABLEMENT Enablement) = 0;
virtual void STDMETHODCALLTYPE SetWatsonDumpEnablement(
- D3D12_DRED_ENABLEMENT __MIDL__ID3D12DeviceRemovedExtendedDataSettings0002) = 0;
+ D3D12_DRED_ENABLEMENT Enablement) = 0;
};
@@ -13316,28 +15002,34 @@ EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12DeviceRemovedExtendedDataSettings * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12DeviceRemovedExtendedDataSettings * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12DeviceRemovedExtendedDataSettings * This);
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement)
void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )(
ID3D12DeviceRemovedExtendedDataSettings * This,
- D3D12_DRED_ENABLEMENT __MIDL__ID3D12DeviceRemovedExtendedDataSettings0000);
+ D3D12_DRED_ENABLEMENT Enablement);
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement)
void ( STDMETHODCALLTYPE *SetPageFaultEnablement )(
ID3D12DeviceRemovedExtendedDataSettings * This,
- D3D12_DRED_ENABLEMENT __MIDL__ID3D12DeviceRemovedExtendedDataSettings0001);
+ D3D12_DRED_ENABLEMENT Enablement);
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement)
void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )(
ID3D12DeviceRemovedExtendedDataSettings * This,
- D3D12_DRED_ENABLEMENT __MIDL__ID3D12DeviceRemovedExtendedDataSettings0002);
+ D3D12_DRED_ENABLEMENT Enablement);
END_INTERFACE
} ID3D12DeviceRemovedExtendedDataSettingsVtbl;
@@ -13362,14 +15054,14 @@ EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings;
( (This)->lpVtbl -> Release(This) )
-#define ID3D12DeviceRemovedExtendedDataSettings_SetAutoBreadcrumbsEnablement(This,__MIDL__ID3D12DeviceRemovedExtendedDataSettings0000) \
- ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,__MIDL__ID3D12DeviceRemovedExtendedDataSettings0000) )
+#define ID3D12DeviceRemovedExtendedDataSettings_SetAutoBreadcrumbsEnablement(This,Enablement) \
+ ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) )
-#define ID3D12DeviceRemovedExtendedDataSettings_SetPageFaultEnablement(This,__MIDL__ID3D12DeviceRemovedExtendedDataSettings0001) \
- ( (This)->lpVtbl -> SetPageFaultEnablement(This,__MIDL__ID3D12DeviceRemovedExtendedDataSettings0001) )
+#define ID3D12DeviceRemovedExtendedDataSettings_SetPageFaultEnablement(This,Enablement) \
+ ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) )
-#define ID3D12DeviceRemovedExtendedDataSettings_SetWatsonDumpEnablement(This,__MIDL__ID3D12DeviceRemovedExtendedDataSettings0002) \
- ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,__MIDL__ID3D12DeviceRemovedExtendedDataSettings0002) )
+#define ID3D12DeviceRemovedExtendedDataSettings_SetWatsonDumpEnablement(This,Enablement) \
+ ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) )
#endif /* COBJMACROS */
@@ -13382,6 +15074,231 @@ EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings;
#endif /* __ID3D12DeviceRemovedExtendedDataSettings_INTERFACE_DEFINED__ */
+#ifndef __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__
+#define __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__
+
+/* interface ID3D12DeviceRemovedExtendedDataSettings1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("DBD5AE51-3317-4F0A-ADF9-1D7CEDCAAE0B")
+ ID3D12DeviceRemovedExtendedDataSettings1 : public ID3D12DeviceRemovedExtendedDataSettings
+ {
+ public:
+ virtual void STDMETHODCALLTYPE SetBreadcrumbContextEnablement(
+ D3D12_DRED_ENABLEMENT Enablement) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DeviceRemovedExtendedDataSettings1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DeviceRemovedExtendedDataSettings1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DeviceRemovedExtendedDataSettings1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DeviceRemovedExtendedDataSettings1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement)
+ void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )(
+ ID3D12DeviceRemovedExtendedDataSettings1 * This,
+ D3D12_DRED_ENABLEMENT Enablement);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement)
+ void ( STDMETHODCALLTYPE *SetPageFaultEnablement )(
+ ID3D12DeviceRemovedExtendedDataSettings1 * This,
+ D3D12_DRED_ENABLEMENT Enablement);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement)
+ void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )(
+ ID3D12DeviceRemovedExtendedDataSettings1 * This,
+ D3D12_DRED_ENABLEMENT Enablement);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings1, SetBreadcrumbContextEnablement)
+ void ( STDMETHODCALLTYPE *SetBreadcrumbContextEnablement )(
+ ID3D12DeviceRemovedExtendedDataSettings1 * This,
+ D3D12_DRED_ENABLEMENT Enablement);
+
+ END_INTERFACE
+ } ID3D12DeviceRemovedExtendedDataSettings1Vtbl;
+
+ interface ID3D12DeviceRemovedExtendedDataSettings1
+ {
+ CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettings1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DeviceRemovedExtendedDataSettings1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DeviceRemovedExtendedDataSettings1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DeviceRemovedExtendedDataSettings1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DeviceRemovedExtendedDataSettings1_SetAutoBreadcrumbsEnablement(This,Enablement) \
+ ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) )
+
+#define ID3D12DeviceRemovedExtendedDataSettings1_SetPageFaultEnablement(This,Enablement) \
+ ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) )
+
+#define ID3D12DeviceRemovedExtendedDataSettings1_SetWatsonDumpEnablement(This,Enablement) \
+ ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) )
+
+
+#define ID3D12DeviceRemovedExtendedDataSettings1_SetBreadcrumbContextEnablement(This,Enablement) \
+ ( (This)->lpVtbl -> SetBreadcrumbContextEnablement(This,Enablement) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DeviceRemovedExtendedDataSettings1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__
+#define __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__
+
+/* interface ID3D12DeviceRemovedExtendedDataSettings2 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedDataSettings2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("61552388-01ab-4008-a436-83db189566ea")
+ ID3D12DeviceRemovedExtendedDataSettings2 : public ID3D12DeviceRemovedExtendedDataSettings1
+ {
+ public:
+ virtual void STDMETHODCALLTYPE UseMarkersOnlyAutoBreadcrumbs(
+ BOOL MarkersOnly) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DeviceRemovedExtendedDataSettings2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DeviceRemovedExtendedDataSettings2 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DeviceRemovedExtendedDataSettings2 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DeviceRemovedExtendedDataSettings2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetAutoBreadcrumbsEnablement)
+ void ( STDMETHODCALLTYPE *SetAutoBreadcrumbsEnablement )(
+ ID3D12DeviceRemovedExtendedDataSettings2 * This,
+ D3D12_DRED_ENABLEMENT Enablement);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetPageFaultEnablement)
+ void ( STDMETHODCALLTYPE *SetPageFaultEnablement )(
+ ID3D12DeviceRemovedExtendedDataSettings2 * This,
+ D3D12_DRED_ENABLEMENT Enablement);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings, SetWatsonDumpEnablement)
+ void ( STDMETHODCALLTYPE *SetWatsonDumpEnablement )(
+ ID3D12DeviceRemovedExtendedDataSettings2 * This,
+ D3D12_DRED_ENABLEMENT Enablement);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings1, SetBreadcrumbContextEnablement)
+ void ( STDMETHODCALLTYPE *SetBreadcrumbContextEnablement )(
+ ID3D12DeviceRemovedExtendedDataSettings2 * This,
+ D3D12_DRED_ENABLEMENT Enablement);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedDataSettings2, UseMarkersOnlyAutoBreadcrumbs)
+ void ( STDMETHODCALLTYPE *UseMarkersOnlyAutoBreadcrumbs )(
+ ID3D12DeviceRemovedExtendedDataSettings2 * This,
+ BOOL MarkersOnly);
+
+ END_INTERFACE
+ } ID3D12DeviceRemovedExtendedDataSettings2Vtbl;
+
+ interface ID3D12DeviceRemovedExtendedDataSettings2
+ {
+ CONST_VTBL struct ID3D12DeviceRemovedExtendedDataSettings2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DeviceRemovedExtendedDataSettings2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DeviceRemovedExtendedDataSettings2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DeviceRemovedExtendedDataSettings2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DeviceRemovedExtendedDataSettings2_SetAutoBreadcrumbsEnablement(This,Enablement) \
+ ( (This)->lpVtbl -> SetAutoBreadcrumbsEnablement(This,Enablement) )
+
+#define ID3D12DeviceRemovedExtendedDataSettings2_SetPageFaultEnablement(This,Enablement) \
+ ( (This)->lpVtbl -> SetPageFaultEnablement(This,Enablement) )
+
+#define ID3D12DeviceRemovedExtendedDataSettings2_SetWatsonDumpEnablement(This,Enablement) \
+ ( (This)->lpVtbl -> SetWatsonDumpEnablement(This,Enablement) )
+
+
+#define ID3D12DeviceRemovedExtendedDataSettings2_SetBreadcrumbContextEnablement(This,Enablement) \
+ ( (This)->lpVtbl -> SetBreadcrumbContextEnablement(This,Enablement) )
+
+
+#define ID3D12DeviceRemovedExtendedDataSettings2_UseMarkersOnlyAutoBreadcrumbs(This,MarkersOnly) \
+ ( (This)->lpVtbl -> UseMarkersOnlyAutoBreadcrumbs(This,MarkersOnly) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DeviceRemovedExtendedDataSettings2_INTERFACE_DEFINED__ */
+
+
#ifndef __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__
#define __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__
@@ -13398,10 +15315,10 @@ EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData;
{
public:
virtual HRESULT STDMETHODCALLTYPE GetAutoBreadcrumbsOutput(
- D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput) = 0;
+ _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput) = 0;
virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput(
- D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput) = 0;
+ _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput) = 0;
};
@@ -13412,24 +15329,29 @@ EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12DeviceRemovedExtendedData * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12DeviceRemovedExtendedData * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12DeviceRemovedExtendedData * This);
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput)
HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )(
ID3D12DeviceRemovedExtendedData * This,
- D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput);
+ _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput);
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput)
HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )(
ID3D12DeviceRemovedExtendedData * This,
- D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput);
+ _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput);
END_INTERFACE
} ID3D12DeviceRemovedExtendedDataVtbl;
@@ -13471,7 +15393,244 @@ EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData;
#endif /* __ID3D12DeviceRemovedExtendedData_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12_0000_0037 */
+#ifndef __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__
+#define __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__
+
+/* interface ID3D12DeviceRemovedExtendedData1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("9727A022-CF1D-4DDA-9EBA-EFFA653FC506")
+ ID3D12DeviceRemovedExtendedData1 : public ID3D12DeviceRemovedExtendedData
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetAutoBreadcrumbsOutput1(
+ _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput1(
+ _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DeviceRemovedExtendedData1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DeviceRemovedExtendedData1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DeviceRemovedExtendedData1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DeviceRemovedExtendedData1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput)
+ HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )(
+ ID3D12DeviceRemovedExtendedData1 * This,
+ _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput)
+ HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )(
+ ID3D12DeviceRemovedExtendedData1 * This,
+ _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetAutoBreadcrumbsOutput1)
+ HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput1 )(
+ ID3D12DeviceRemovedExtendedData1 * This,
+ _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetPageFaultAllocationOutput1)
+ HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput1 )(
+ ID3D12DeviceRemovedExtendedData1 * This,
+ _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput);
+
+ END_INTERFACE
+ } ID3D12DeviceRemovedExtendedData1Vtbl;
+
+ interface ID3D12DeviceRemovedExtendedData1
+ {
+ CONST_VTBL struct ID3D12DeviceRemovedExtendedData1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DeviceRemovedExtendedData1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DeviceRemovedExtendedData1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DeviceRemovedExtendedData1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DeviceRemovedExtendedData1_GetAutoBreadcrumbsOutput(This,pOutput) \
+ ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) )
+
+#define ID3D12DeviceRemovedExtendedData1_GetPageFaultAllocationOutput(This,pOutput) \
+ ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) )
+
+
+#define ID3D12DeviceRemovedExtendedData1_GetAutoBreadcrumbsOutput1(This,pOutput) \
+ ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput1(This,pOutput) )
+
+#define ID3D12DeviceRemovedExtendedData1_GetPageFaultAllocationOutput1(This,pOutput) \
+ ( (This)->lpVtbl -> GetPageFaultAllocationOutput1(This,pOutput) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DeviceRemovedExtendedData1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__
+#define __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__
+
+/* interface ID3D12DeviceRemovedExtendedData2 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DeviceRemovedExtendedData2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("67FC5816-E4CA-4915-BF18-42541272DA54")
+ ID3D12DeviceRemovedExtendedData2 : public ID3D12DeviceRemovedExtendedData1
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetPageFaultAllocationOutput2(
+ _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT2 *pOutput) = 0;
+
+ virtual D3D12_DRED_DEVICE_STATE STDMETHODCALLTYPE GetDeviceState( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DeviceRemovedExtendedData2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DeviceRemovedExtendedData2 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DeviceRemovedExtendedData2 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DeviceRemovedExtendedData2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetAutoBreadcrumbsOutput)
+ HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput )(
+ ID3D12DeviceRemovedExtendedData2 * This,
+ _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT *pOutput);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData, GetPageFaultAllocationOutput)
+ HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput )(
+ ID3D12DeviceRemovedExtendedData2 * This,
+ _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT *pOutput);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetAutoBreadcrumbsOutput1)
+ HRESULT ( STDMETHODCALLTYPE *GetAutoBreadcrumbsOutput1 )(
+ ID3D12DeviceRemovedExtendedData2 * This,
+ _Out_ D3D12_DRED_AUTO_BREADCRUMBS_OUTPUT1 *pOutput);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData1, GetPageFaultAllocationOutput1)
+ HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput1 )(
+ ID3D12DeviceRemovedExtendedData2 * This,
+ _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT1 *pOutput);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData2, GetPageFaultAllocationOutput2)
+ HRESULT ( STDMETHODCALLTYPE *GetPageFaultAllocationOutput2 )(
+ ID3D12DeviceRemovedExtendedData2 * This,
+ _Out_ D3D12_DRED_PAGE_FAULT_OUTPUT2 *pOutput);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceRemovedExtendedData2, GetDeviceState)
+ D3D12_DRED_DEVICE_STATE ( STDMETHODCALLTYPE *GetDeviceState )(
+ ID3D12DeviceRemovedExtendedData2 * This);
+
+ END_INTERFACE
+ } ID3D12DeviceRemovedExtendedData2Vtbl;
+
+ interface ID3D12DeviceRemovedExtendedData2
+ {
+ CONST_VTBL struct ID3D12DeviceRemovedExtendedData2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DeviceRemovedExtendedData2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DeviceRemovedExtendedData2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DeviceRemovedExtendedData2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DeviceRemovedExtendedData2_GetAutoBreadcrumbsOutput(This,pOutput) \
+ ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput(This,pOutput) )
+
+#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput(This,pOutput) \
+ ( (This)->lpVtbl -> GetPageFaultAllocationOutput(This,pOutput) )
+
+
+#define ID3D12DeviceRemovedExtendedData2_GetAutoBreadcrumbsOutput1(This,pOutput) \
+ ( (This)->lpVtbl -> GetAutoBreadcrumbsOutput1(This,pOutput) )
+
+#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput1(This,pOutput) \
+ ( (This)->lpVtbl -> GetPageFaultAllocationOutput1(This,pOutput) )
+
+
+#define ID3D12DeviceRemovedExtendedData2_GetPageFaultAllocationOutput2(This,pOutput) \
+ ( (This)->lpVtbl -> GetPageFaultAllocationOutput2(This,pOutput) )
+
+#define ID3D12DeviceRemovedExtendedData2_GetDeviceState(This) \
+ ( (This)->lpVtbl -> GetDeviceState(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DeviceRemovedExtendedData2_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12_0000_0041 */
/* [local] */
typedef
@@ -13494,8 +15653,8 @@ enum D3D12_MEASUREMENTS_ACTION
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0037_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0037_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0041_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0041_v0_0_s_ifspec;
#ifndef __ID3D12Device6_INTERFACE_DEFINED__
#define __ID3D12Device6_INTERFACE_DEFINED__
@@ -13527,65 +15686,78 @@ EXTERN_C const IID IID_ID3D12Device6;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Device6 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Device6 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Device6 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Device6 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Device6 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Device6 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Device6 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
UINT ( STDMETHODCALLTYPE *GetNodeCount )(
ID3D12Device6 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
ID3D12Device6 * This,
_In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppCommandQueue);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
ID3D12Device6 * This,
_In_ D3D12_COMMAND_LIST_TYPE type,
REFIID riid,
_COM_Outptr_ void **ppCommandAllocator);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
ID3D12Device6 * This,
_In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
ID3D12Device6 * This,
_In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
ID3D12Device6 * This,
_In_ UINT nodeMask,
@@ -13595,22 +15767,26 @@ EXTERN_C const IID IID_ID3D12Device6;
REFIID riid,
_COM_Outptr_ void **ppCommandList);
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
ID3D12Device6 * This,
D3D12_FEATURE Feature,
_Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
UINT FeatureSupportDataSize);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
ID3D12Device6 * This,
_In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
ID3D12Device6 * This,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
ID3D12Device6 * This,
_In_ UINT nodeMask,
@@ -13619,17 +15795,20 @@ EXTERN_C const IID IID_ID3D12Device6;
REFIID riid,
_COM_Outptr_ void **ppvRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
ID3D12Device6 * This,
_In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
ID3D12Device6 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
ID3D12Device6 * This,
_In_opt_ ID3D12Resource *pResource,
@@ -13637,23 +15816,27 @@ EXTERN_C const IID IID_ID3D12Device6;
_In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
ID3D12Device6 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
ID3D12Device6 * This,
_In_opt_ ID3D12Resource *pResource,
_In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
void ( STDMETHODCALLTYPE *CreateSampler )(
ID3D12Device6 * This,
_In_ const D3D12_SAMPLER_DESC *pDesc,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
void ( STDMETHODCALLTYPE *CopyDescriptors )(
ID3D12Device6 * This,
_In_ UINT NumDestDescriptorRanges,
@@ -13664,6 +15847,7 @@ EXTERN_C const IID IID_ID3D12Device6;
_In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
ID3D12Device6 * This,
_In_ UINT NumDescriptors,
@@ -13671,17 +15855,41 @@ EXTERN_C const IID IID_ID3D12Device6;
_In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
_In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
ID3D12Device6 * This,
_In_ UINT visibleMask,
_In_ UINT numResourceDescs,
_In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device6 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
ID3D12Device6 * This,
_In_ UINT nodeMask,
D3D12_HEAP_TYPE heapType);
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device6 * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
ID3D12Device6 * This,
_In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
@@ -13692,12 +15900,14 @@ EXTERN_C const IID IID_ID3D12Device6;
REFIID riidResource,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
ID3D12Device6 * This,
_In_ const D3D12_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
ID3D12Device6 * This,
_In_ ID3D12Heap *pHeap,
@@ -13708,6 +15918,7 @@ EXTERN_C const IID IID_ID3D12Device6;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
ID3D12Device6 * This,
_In_ const D3D12_RESOURCE_DESC *pDesc,
@@ -13716,6 +15927,7 @@ EXTERN_C const IID IID_ID3D12Device6;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
ID3D12Device6 * This,
_In_ ID3D12DeviceChild *pObject,
@@ -13724,12 +15936,14 @@ EXTERN_C const IID IID_ID3D12Device6;
_In_opt_ LPCWSTR Name,
_Out_ HANDLE *pHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
ID3D12Device6 * This,
_In_ HANDLE NTHandle,
REFIID riid,
_COM_Outptr_opt_ void **ppvObj);
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
ID3D12Device6 * This,
_In_ LPCWSTR Name,
@@ -13737,16 +15951,19 @@ EXTERN_C const IID IID_ID3D12Device6;
/* [annotation][out] */
_Out_ HANDLE *pNTHandle);
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
HRESULT ( STDMETHODCALLTYPE *MakeResident )(
ID3D12Device6 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
HRESULT ( STDMETHODCALLTYPE *Evict )(
ID3D12Device6 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
HRESULT ( STDMETHODCALLTYPE *CreateFence )(
ID3D12Device6 * This,
UINT64 InitialValue,
@@ -13754,9 +15971,11 @@ EXTERN_C const IID IID_ID3D12Device6;
REFIID riid,
_COM_Outptr_ void **ppFence);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
ID3D12Device6 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
ID3D12Device6 * This,
_In_ const D3D12_RESOURCE_DESC *pResourceDesc,
@@ -13768,16 +15987,19 @@ EXTERN_C const IID IID_ID3D12Device6;
_Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
_Out_opt_ UINT64 *pTotalBytes);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
ID3D12Device6 * This,
_In_ const D3D12_QUERY_HEAP_DESC *pDesc,
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
ID3D12Device6 * This,
BOOL Enable);
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
ID3D12Device6 * This,
_In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
@@ -13785,6 +16007,7 @@ EXTERN_C const IID IID_ID3D12Device6;
REFIID riid,
_COM_Outptr_opt_ void **ppvCommandSignature);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
void ( STDMETHODCALLTYPE *GetResourceTiling )(
ID3D12Device6 * This,
_In_ ID3D12Resource *pTiledResource,
@@ -13795,9 +16018,19 @@ EXTERN_C const IID IID_ID3D12Device6;
_In_ UINT FirstSubresourceTilingToGet,
_Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
ID3D12Device6 * This);
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device6 * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary)
HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )(
ID3D12Device6 * This,
_In_reads_(BlobLength) const void *pLibraryBlob,
@@ -13805,6 +16038,7 @@ EXTERN_C const IID IID_ID3D12Device6;
REFIID riid,
_COM_Outptr_ void **ppPipelineLibrary);
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion)
HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )(
ID3D12Device6 * This,
_In_reads_(NumFences) ID3D12Fence *const *ppFences,
@@ -13813,30 +16047,35 @@ EXTERN_C const IID IID_ID3D12Device6;
D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
HANDLE hEvent);
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority)
HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )(
ID3D12Device6 * This,
UINT NumObjects,
_In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
_In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities);
+ DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState)
HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )(
ID3D12Device6 * This,
const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress)
HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )(
ID3D12Device6 * This,
_In_ const void *pAddress,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping)
HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )(
ID3D12Device6 * This,
_In_ HANDLE hFileMapping,
REFIID riid,
_COM_Outptr_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident)
HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )(
ID3D12Device6 * This,
D3D12_RESIDENCY_FLAGS Flags,
@@ -13845,6 +16084,7 @@ EXTERN_C const IID IID_ID3D12Device6;
_In_ ID3D12Fence *pFenceToSignal,
UINT64 FenceValueToSignal);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1)
HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )(
ID3D12Device6 * This,
_In_ UINT nodeMask,
@@ -13853,12 +16093,14 @@ EXTERN_C const IID IID_ID3D12Device6;
REFIID riid,
_COM_Outptr_ void **ppCommandList);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession)
HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )(
ID3D12Device6 * This,
_In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc,
_In_ REFIID riid,
_COM_Outptr_ void **ppSession);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1)
HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )(
ID3D12Device6 * This,
_In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
@@ -13870,6 +16112,7 @@ EXTERN_C const IID IID_ID3D12Device6;
REFIID riidResource,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1)
HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )(
ID3D12Device6 * This,
_In_ const D3D12_HEAP_DESC *pDesc,
@@ -13877,6 +16120,7 @@ EXTERN_C const IID IID_ID3D12Device6;
REFIID riid,
_COM_Outptr_opt_ void **ppvHeap);
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1)
HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )(
ID3D12Device6 * This,
_In_ const D3D12_RESOURCE_DESC *pDesc,
@@ -13886,6 +16130,8 @@ EXTERN_C const IID IID_ID3D12Device6;
REFIID riid,
_COM_Outptr_opt_ void **ppvResource);
+ DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1)
+#if !defined(_WIN32)
D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
ID3D12Device6 * This,
UINT visibleMask,
@@ -13893,20 +16139,35 @@ EXTERN_C const IID IID_ID3D12Device6;
_In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
_Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device6 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker)
HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )(
ID3D12Device6 * This,
_In_ ID3D12LifetimeOwner *pOwner,
REFIID riid,
_COM_Outptr_ void **ppvTracker);
+ DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice)
void ( STDMETHODCALLTYPE *RemoveDevice )(
ID3D12Device6 * This);
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands)
HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )(
ID3D12Device6 * This,
_Inout_ UINT *pNumMetaCommands,
_Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs);
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters)
HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )(
ID3D12Device6 * This,
_In_ REFGUID CommandId,
@@ -13915,6 +16176,7 @@ EXTERN_C const IID IID_ID3D12Device6;
_Inout_ UINT *pParameterCount,
_Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs);
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand)
HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )(
ID3D12Device6 * This,
_In_ REFGUID CommandId,
@@ -13924,22 +16186,26 @@ EXTERN_C const IID IID_ID3D12Device6;
REFIID riid,
_COM_Outptr_ void **ppMetaCommand);
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject)
HRESULT ( STDMETHODCALLTYPE *CreateStateObject )(
ID3D12Device6 * This,
const D3D12_STATE_OBJECT_DESC *pDesc,
REFIID riid,
_COM_Outptr_ void **ppStateObject);
+ DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo)
void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )(
ID3D12Device6 * This,
_In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc,
_Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo);
+ DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier)
D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )(
ID3D12Device6 * This,
_In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType,
_In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck);
+ DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode)
HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )(
ID3D12Device6 * This,
D3D12_BACKGROUND_PROCESSING_MODE Mode,
@@ -14036,12 +16302,22 @@ EXTERN_C const IID IID_ID3D12Device6;
#define ID3D12Device6_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
#define ID3D12Device6_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device6_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
#define ID3D12Device6_GetCustomHeapProperties(This,nodeMask,heapType) \
( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device6_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
#define ID3D12Device6_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
@@ -14090,9 +16366,14 @@ EXTERN_C const IID IID_ID3D12Device6;
#define ID3D12Device6_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
#define ID3D12Device6_GetAdapterLuid(This) \
( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device6_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
#define ID3D12Device6_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \
@@ -14133,9 +16414,14 @@ EXTERN_C const IID IID_ID3D12Device6;
#define ID3D12Device6_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \
( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) )
+#if !defined(_WIN32)
#define ID3D12Device6_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device6_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
#define ID3D12Device6_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \
@@ -14177,6 +16463,2009 @@ EXTERN_C const IID IID_ID3D12Device6;
#endif /* __ID3D12Device6_INTERFACE_DEFINED__ */
+/* interface __MIDL_itf_d3d12_0000_0042 */
+/* [local] */
+
+DEFINE_GUID(D3D12_PROTECTED_RESOURCES_SESSION_HARDWARE_PROTECTED, 0x62B0084E, 0xC70E, 0x4DAA, 0xA1, 0x09, 0x30, 0xFF, 0x8D, 0x5A, 0x04, 0x82);
+typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT
+ {
+ UINT NodeIndex;
+ UINT Count;
+ } D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPE_COUNT;
+
+typedef struct D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES
+ {
+ UINT NodeIndex;
+ UINT Count;
+ GUID *pTypes;
+ } D3D12_FEATURE_DATA_PROTECTED_RESOURCE_SESSION_TYPES;
+
+typedef struct D3D12_PROTECTED_RESOURCE_SESSION_DESC1
+ {
+ UINT NodeMask;
+ D3D12_PROTECTED_RESOURCE_SESSION_FLAGS Flags;
+ GUID ProtectionType;
+ } D3D12_PROTECTED_RESOURCE_SESSION_DESC1;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0042_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0042_v0_0_s_ifspec;
+
+#ifndef __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__
+#define __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__
+
+/* interface ID3D12ProtectedResourceSession1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12ProtectedResourceSession1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("D6F12DD6-76FB-406E-8961-4296EEFC0409")
+ ID3D12ProtectedResourceSession1 : public ID3D12ProtectedResourceSession
+ {
+ public:
+#if defined(_MSC_VER)
+ virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC1 STDMETHODCALLTYPE GetDesc1( void) = 0;
+#else
+ virtual D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *STDMETHODCALLTYPE GetDesc1(
+ D3D12_PROTECTED_RESOURCE_SESSION_DESC1 * RetVal) = 0;
+#endif
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12ProtectedResourceSession1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12ProtectedResourceSession1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12ProtectedResourceSession1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12ProtectedResourceSession1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12ProtectedResourceSession1 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12ProtectedResourceSession1 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12ProtectedResourceSession1 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12ProtectedResourceSession1 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12ProtectedResourceSession1 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetStatusFence)
+ HRESULT ( STDMETHODCALLTYPE *GetStatusFence )(
+ ID3D12ProtectedResourceSession1 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppFence);
+
+ DECLSPEC_XFGVIRT(ID3D12ProtectedSession, GetSessionStatus)
+ D3D12_PROTECTED_SESSION_STATUS ( STDMETHODCALLTYPE *GetSessionStatus )(
+ ID3D12ProtectedResourceSession1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12ProtectedResourceSession, GetDesc)
+#if !defined(_WIN32)
+ D3D12_PROTECTED_RESOURCE_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12ProtectedResourceSession1 * This);
+
+#else
+ D3D12_PROTECTED_RESOURCE_SESSION_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12ProtectedResourceSession1 * This,
+ D3D12_PROTECTED_RESOURCE_SESSION_DESC * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12ProtectedResourceSession1, GetDesc1)
+#if !defined(_WIN32)
+ D3D12_PROTECTED_RESOURCE_SESSION_DESC1 ( STDMETHODCALLTYPE *GetDesc1 )(
+ ID3D12ProtectedResourceSession1 * This);
+
+#else
+ D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *( STDMETHODCALLTYPE *GetDesc1 )(
+ ID3D12ProtectedResourceSession1 * This,
+ D3D12_PROTECTED_RESOURCE_SESSION_DESC1 * RetVal);
+
+#endif
+
+ END_INTERFACE
+ } ID3D12ProtectedResourceSession1Vtbl;
+
+ interface ID3D12ProtectedResourceSession1
+ {
+ CONST_VTBL struct ID3D12ProtectedResourceSession1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12ProtectedResourceSession1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12ProtectedResourceSession1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12ProtectedResourceSession1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12ProtectedResourceSession1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12ProtectedResourceSession1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12ProtectedResourceSession1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12ProtectedResourceSession1_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12ProtectedResourceSession1_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12ProtectedResourceSession1_GetStatusFence(This,riid,ppFence) \
+ ( (This)->lpVtbl -> GetStatusFence(This,riid,ppFence) )
+
+#define ID3D12ProtectedResourceSession1_GetSessionStatus(This) \
+ ( (This)->lpVtbl -> GetSessionStatus(This) )
+
+#if !defined(_WIN32)
+
+#define ID3D12ProtectedResourceSession1_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12ProtectedResourceSession1_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
+
+#if !defined(_WIN32)
+
+#define ID3D12ProtectedResourceSession1_GetDesc1(This) \
+ ( (This)->lpVtbl -> GetDesc1(This) )
+#else
+#define ID3D12ProtectedResourceSession1_GetDesc1(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc1(This,RetVal) )
+#endif
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12ProtectedResourceSession1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Device7_INTERFACE_DEFINED__
+#define __ID3D12Device7_INTERFACE_DEFINED__
+
+/* interface ID3D12Device7 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Device7;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("5c014b53-68a1-4b9b-8bd1-dd6046b9358b")
+ ID3D12Device7 : public ID3D12Device6
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE AddToStateObject(
+ const D3D12_STATE_OBJECT_DESC *pAddition,
+ ID3D12StateObject *pStateObjectToGrowFrom,
+ REFIID riid,
+ _COM_Outptr_ void **ppNewStateObject) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateProtectedResourceSession1(
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Device7Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Device7 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Device7 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Device7 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Device7 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Device7 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Device7 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Device7 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
+ UINT ( STDMETHODCALLTYPE *GetNodeCount )(
+ ID3D12Device7 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
+ ID3D12Device7 * This,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
+ ID3D12Device7 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ ID3D12CommandAllocator *pCommandAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D12Device7 * This,
+ D3D12_FEATURE Feature,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
+ UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
+ ID3D12Device7 * This,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
+ ID3D12Device7 * This,
+ _In_ UINT nodeMask,
+ _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature,
+ _In_ SIZE_T blobLengthInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppvRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
+ void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
+ ID3D12Device7 * This,
+ _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
+ void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
+ ID3D12Device7 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
+ ID3D12Device7 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ ID3D12Resource *pCounterResource,
+ _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
+ void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
+ ID3D12Device7 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
+ void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
+ ID3D12Device7 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
+ void ( STDMETHODCALLTYPE *CreateSampler )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_SAMPLER_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
+ void ( STDMETHODCALLTYPE *CopyDescriptors )(
+ ID3D12Device7 * This,
+ _In_ UINT NumDestDescriptorRanges,
+ _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts,
+ _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes,
+ _In_ UINT NumSrcDescriptorRanges,
+ _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts,
+ _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
+ void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
+ ID3D12Device7 * This,
+ _In_ UINT NumDescriptors,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device7 * This,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device7 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
+ D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device7 * This,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device7 * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
+ ID3D12Device7 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
+ ID3D12Device7 * This,
+ _In_ ID3D12DeviceChild *pObject,
+ _In_opt_ const SECURITY_ATTRIBUTES *pAttributes,
+ DWORD Access,
+ _In_opt_ LPCWSTR Name,
+ _Out_ HANDLE *pHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
+ ID3D12Device7 * This,
+ _In_ HANDLE NTHandle,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvObj);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
+ ID3D12Device7 * This,
+ _In_ LPCWSTR Name,
+ DWORD Access,
+ /* [annotation][out] */
+ _Out_ HANDLE *pNTHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
+ HRESULT ( STDMETHODCALLTYPE *MakeResident )(
+ ID3D12Device7 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
+ HRESULT ( STDMETHODCALLTYPE *Evict )(
+ ID3D12Device7 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
+ HRESULT ( STDMETHODCALLTYPE *CreateFence )(
+ ID3D12Device7 * This,
+ UINT64 InitialValue,
+ D3D12_FENCE_FLAGS Flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppFence);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
+ HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
+ ID3D12Device7 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_RESOURCE_DESC *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_QUERY_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
+ HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
+ ID3D12Device7 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
+ _In_opt_ ID3D12RootSignature *pRootSignature,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvCommandSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
+ void ( STDMETHODCALLTYPE *GetResourceTiling )(
+ ID3D12Device7 * This,
+ _In_ ID3D12Resource *pTiledResource,
+ _Out_opt_ UINT *pNumTilesForEntireResource,
+ _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc,
+ _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips,
+ _Inout_opt_ UINT *pNumSubresourceTilings,
+ _In_ UINT FirstSubresourceTilingToGet,
+ _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
+ LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device7 * This);
+
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device7 * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )(
+ ID3D12Device7 * This,
+ _In_reads_(BlobLength) const void *pLibraryBlob,
+ SIZE_T BlobLength,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineLibrary);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion)
+ HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )(
+ ID3D12Device7 * This,
+ _In_reads_(NumFences) ID3D12Fence *const *ppFences,
+ _In_reads_(NumFences) const UINT64 *pFenceValues,
+ UINT NumFences,
+ D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
+ HANDLE hEvent);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority)
+ HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )(
+ ID3D12Device7 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities);
+
+ DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )(
+ ID3D12Device7 * This,
+ const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )(
+ ID3D12Device7 * This,
+ _In_ const void *pAddress,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )(
+ ID3D12Device7 * This,
+ _In_ HANDLE hFileMapping,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident)
+ HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )(
+ ID3D12Device7 * This,
+ D3D12_RESIDENCY_FLAGS Flags,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_ ID3D12Fence *pFenceToSignal,
+ UINT64 FenceValueToSignal);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )(
+ ID3D12Device7 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ D3D12_COMMAND_LIST_FLAGS flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device7 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device7 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker)
+ HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )(
+ ID3D12Device7 * This,
+ _In_ ID3D12LifetimeOwner *pOwner,
+ REFIID riid,
+ _COM_Outptr_ void **ppvTracker);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice)
+ void ( STDMETHODCALLTYPE *RemoveDevice )(
+ ID3D12Device7 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )(
+ ID3D12Device7 * This,
+ _Inout_ UINT *pNumMetaCommands,
+ _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )(
+ ID3D12Device7 * This,
+ _In_ REFGUID CommandId,
+ _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage,
+ _Out_opt_ UINT *pTotalStructureSizeInBytes,
+ _Inout_ UINT *pParameterCount,
+ _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand)
+ HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )(
+ ID3D12Device7 * This,
+ _In_ REFGUID CommandId,
+ _In_ UINT NodeMask,
+ _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData,
+ _In_ SIZE_T CreationParametersDataSizeInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppMetaCommand);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject)
+ HRESULT ( STDMETHODCALLTYPE *CreateStateObject )(
+ ID3D12Device7 * This,
+ const D3D12_STATE_OBJECT_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo)
+ void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc,
+ _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier)
+ D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )(
+ ID3D12Device7 * This,
+ _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType,
+ _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck);
+
+ DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode)
+ HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )(
+ ID3D12Device7 * This,
+ D3D12_BACKGROUND_PROCESSING_MODE Mode,
+ D3D12_MEASUREMENTS_ACTION MeasurementsAction,
+ _In_opt_ HANDLE hEventToSignalUponCompletion,
+ _Out_opt_ BOOL *pbFurtherMeasurementsDesired);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject)
+ HRESULT ( STDMETHODCALLTYPE *AddToStateObject )(
+ ID3D12Device7 * This,
+ const D3D12_STATE_OBJECT_DESC *pAddition,
+ ID3D12StateObject *pStateObjectToGrowFrom,
+ REFIID riid,
+ _COM_Outptr_ void **ppNewStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )(
+ ID3D12Device7 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ END_INTERFACE
+ } ID3D12Device7Vtbl;
+
+ interface ID3D12Device7
+ {
+ CONST_VTBL struct ID3D12Device7Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Device7_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Device7_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Device7_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Device7_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Device7_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Device7_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Device7_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12Device7_GetNodeCount(This) \
+ ( (This)->lpVtbl -> GetNodeCount(This) )
+
+#define ID3D12Device7_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \
+ ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) )
+
+#define ID3D12Device7_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \
+ ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) )
+
+#define ID3D12Device7_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device7_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device7_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) )
+
+#define ID3D12Device7_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D12Device7_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) )
+
+#define ID3D12Device7_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \
+ ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) )
+
+#define ID3D12Device7_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \
+ ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) )
+
+#define ID3D12Device7_CreateConstantBufferView(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device7_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device7_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device7_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device7_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device7_CreateSampler(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device7_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) )
+
+#define ID3D12Device7_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
+
+#define ID3D12Device7_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device7_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
+
+#define ID3D12Device7_GetCustomHeapProperties(This,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device7_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
+
+#define ID3D12Device7_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
+
+#define ID3D12Device7_CreateHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device7_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device7_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device7_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \
+ ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) )
+
+#define ID3D12Device7_OpenSharedHandle(This,NTHandle,riid,ppvObj) \
+ ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) )
+
+#define ID3D12Device7_OpenSharedHandleByName(This,Name,Access,pNTHandle) \
+ ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) )
+
+#define ID3D12Device7_MakeResident(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) )
+
+#define ID3D12Device7_Evict(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) )
+
+#define ID3D12Device7_CreateFence(This,InitialValue,Flags,riid,ppFence) \
+ ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) )
+
+#define ID3D12Device7_GetDeviceRemovedReason(This) \
+ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) )
+
+#define ID3D12Device7_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+#define ID3D12Device7_CreateQueryHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device7_SetStablePowerState(This,Enable) \
+ ( (This)->lpVtbl -> SetStablePowerState(This,Enable) )
+
+#define ID3D12Device7_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \
+ ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) )
+
+#define ID3D12Device7_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
+ ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
+
+#define ID3D12Device7_GetAdapterLuid(This) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device7_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
+
+
+#define ID3D12Device7_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \
+ ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) )
+
+#define ID3D12Device7_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \
+ ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) )
+
+#define ID3D12Device7_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \
+ ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) )
+
+
+#define ID3D12Device7_CreatePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) )
+
+
+#define ID3D12Device7_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) )
+
+#define ID3D12Device7_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) )
+
+#define ID3D12Device7_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \
+ ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) )
+
+
+#define ID3D12Device7_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) )
+
+#define ID3D12Device7_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) )
+
+#define ID3D12Device7_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) )
+
+#define ID3D12Device7_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) )
+
+#define ID3D12Device7_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) )
+#if !defined(_WIN32)
+
+#define ID3D12Device7_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device7_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
+
+
+#define ID3D12Device7_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \
+ ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) )
+
+#define ID3D12Device7_RemoveDevice(This) \
+ ( (This)->lpVtbl -> RemoveDevice(This) )
+
+#define ID3D12Device7_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) )
+
+#define ID3D12Device7_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) )
+
+#define ID3D12Device7_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \
+ ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) )
+
+#define ID3D12Device7_CreateStateObject(This,pDesc,riid,ppStateObject) \
+ ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) )
+
+#define ID3D12Device7_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \
+ ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) )
+
+#define ID3D12Device7_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \
+ ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) )
+
+
+#define ID3D12Device7_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \
+ ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) )
+
+
+#define ID3D12Device7_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \
+ ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) )
+
+#define ID3D12Device7_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Device7_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Device8_INTERFACE_DEFINED__
+#define __ID3D12Device8_INTERFACE_DEFINED__
+
+/* interface ID3D12Device8 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Device8;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("9218E6BB-F944-4F7E-A75C-B1B2C7B701F3")
+ ID3D12Device8 : public ID3D12Device7
+ {
+ public:
+#if defined(_MSC_VER)
+ virtual D3D12_RESOURCE_ALLOCATION_INFO STDMETHODCALLTYPE GetResourceAllocationInfo2(
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0;
+#else
+ virtual D3D12_RESOURCE_ALLOCATION_INFO *STDMETHODCALLTYPE GetResourceAllocationInfo2(
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1) = 0;
+#endif
+
+ virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource2(
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource1(
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource) = 0;
+
+ virtual void STDMETHODCALLTYPE CreateSamplerFeedbackUnorderedAccessView(
+ _In_opt_ ID3D12Resource *pTargetedResource,
+ _In_opt_ ID3D12Resource *pFeedbackResource,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0;
+
+ virtual void STDMETHODCALLTYPE GetCopyableFootprints1(
+ _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Device8Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Device8 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Device8 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Device8 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Device8 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Device8 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Device8 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Device8 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
+ UINT ( STDMETHODCALLTYPE *GetNodeCount )(
+ ID3D12Device8 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
+ ID3D12Device8 * This,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
+ ID3D12Device8 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ ID3D12CommandAllocator *pCommandAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D12Device8 * This,
+ D3D12_FEATURE Feature,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
+ UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
+ ID3D12Device8 * This,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
+ ID3D12Device8 * This,
+ _In_ UINT nodeMask,
+ _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature,
+ _In_ SIZE_T blobLengthInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppvRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
+ void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
+ ID3D12Device8 * This,
+ _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
+ void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
+ ID3D12Device8 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
+ ID3D12Device8 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ ID3D12Resource *pCounterResource,
+ _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
+ void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
+ ID3D12Device8 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
+ void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
+ ID3D12Device8 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
+ void ( STDMETHODCALLTYPE *CreateSampler )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_SAMPLER_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
+ void ( STDMETHODCALLTYPE *CopyDescriptors )(
+ ID3D12Device8 * This,
+ _In_ UINT NumDestDescriptorRanges,
+ _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts,
+ _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes,
+ _In_ UINT NumSrcDescriptorRanges,
+ _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts,
+ _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
+ void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
+ ID3D12Device8 * This,
+ _In_ UINT NumDescriptors,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device8 * This,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device8 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
+ D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device8 * This,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device8 * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
+ ID3D12Device8 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
+ ID3D12Device8 * This,
+ _In_ ID3D12DeviceChild *pObject,
+ _In_opt_ const SECURITY_ATTRIBUTES *pAttributes,
+ DWORD Access,
+ _In_opt_ LPCWSTR Name,
+ _Out_ HANDLE *pHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
+ ID3D12Device8 * This,
+ _In_ HANDLE NTHandle,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvObj);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
+ ID3D12Device8 * This,
+ _In_ LPCWSTR Name,
+ DWORD Access,
+ /* [annotation][out] */
+ _Out_ HANDLE *pNTHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
+ HRESULT ( STDMETHODCALLTYPE *MakeResident )(
+ ID3D12Device8 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
+ HRESULT ( STDMETHODCALLTYPE *Evict )(
+ ID3D12Device8 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
+ HRESULT ( STDMETHODCALLTYPE *CreateFence )(
+ ID3D12Device8 * This,
+ UINT64 InitialValue,
+ D3D12_FENCE_FLAGS Flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppFence);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
+ HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
+ ID3D12Device8 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_RESOURCE_DESC *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_QUERY_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
+ HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
+ ID3D12Device8 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
+ _In_opt_ ID3D12RootSignature *pRootSignature,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvCommandSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
+ void ( STDMETHODCALLTYPE *GetResourceTiling )(
+ ID3D12Device8 * This,
+ _In_ ID3D12Resource *pTiledResource,
+ _Out_opt_ UINT *pNumTilesForEntireResource,
+ _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc,
+ _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips,
+ _Inout_opt_ UINT *pNumSubresourceTilings,
+ _In_ UINT FirstSubresourceTilingToGet,
+ _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
+ LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device8 * This);
+
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device8 * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )(
+ ID3D12Device8 * This,
+ _In_reads_(BlobLength) const void *pLibraryBlob,
+ SIZE_T BlobLength,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineLibrary);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion)
+ HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )(
+ ID3D12Device8 * This,
+ _In_reads_(NumFences) ID3D12Fence *const *ppFences,
+ _In_reads_(NumFences) const UINT64 *pFenceValues,
+ UINT NumFences,
+ D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
+ HANDLE hEvent);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority)
+ HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )(
+ ID3D12Device8 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities);
+
+ DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )(
+ ID3D12Device8 * This,
+ const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )(
+ ID3D12Device8 * This,
+ _In_ const void *pAddress,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )(
+ ID3D12Device8 * This,
+ _In_ HANDLE hFileMapping,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident)
+ HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )(
+ ID3D12Device8 * This,
+ D3D12_RESIDENCY_FLAGS Flags,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_ ID3D12Fence *pFenceToSignal,
+ UINT64 FenceValueToSignal);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )(
+ ID3D12Device8 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ D3D12_COMMAND_LIST_FLAGS flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device8 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device8 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker)
+ HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )(
+ ID3D12Device8 * This,
+ _In_ ID3D12LifetimeOwner *pOwner,
+ REFIID riid,
+ _COM_Outptr_ void **ppvTracker);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice)
+ void ( STDMETHODCALLTYPE *RemoveDevice )(
+ ID3D12Device8 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )(
+ ID3D12Device8 * This,
+ _Inout_ UINT *pNumMetaCommands,
+ _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )(
+ ID3D12Device8 * This,
+ _In_ REFGUID CommandId,
+ _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage,
+ _Out_opt_ UINT *pTotalStructureSizeInBytes,
+ _Inout_ UINT *pParameterCount,
+ _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand)
+ HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )(
+ ID3D12Device8 * This,
+ _In_ REFGUID CommandId,
+ _In_ UINT NodeMask,
+ _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData,
+ _In_ SIZE_T CreationParametersDataSizeInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppMetaCommand);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject)
+ HRESULT ( STDMETHODCALLTYPE *CreateStateObject )(
+ ID3D12Device8 * This,
+ const D3D12_STATE_OBJECT_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo)
+ void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc,
+ _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier)
+ D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )(
+ ID3D12Device8 * This,
+ _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType,
+ _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck);
+
+ DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode)
+ HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )(
+ ID3D12Device8 * This,
+ D3D12_BACKGROUND_PROCESSING_MODE Mode,
+ D3D12_MEASUREMENTS_ACTION MeasurementsAction,
+ _In_opt_ HANDLE hEventToSignalUponCompletion,
+ _Out_opt_ BOOL *pbFurtherMeasurementsDesired);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject)
+ HRESULT ( STDMETHODCALLTYPE *AddToStateObject )(
+ ID3D12Device8 * This,
+ const D3D12_STATE_OBJECT_DESC *pAddition,
+ ID3D12StateObject *pStateObjectToGrowFrom,
+ REFIID riid,
+ _COM_Outptr_ void **ppNewStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )(
+ ID3D12Device8 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )(
+ ID3D12Device8 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )(
+ ID3D12Device8 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )(
+ ID3D12Device8 * This,
+ _In_opt_ ID3D12Resource *pTargetedResource,
+ _In_opt_ ID3D12Resource *pFeedbackResource,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1)
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )(
+ ID3D12Device8 * This,
+ _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ END_INTERFACE
+ } ID3D12Device8Vtbl;
+
+ interface ID3D12Device8
+ {
+ CONST_VTBL struct ID3D12Device8Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Device8_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Device8_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Device8_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Device8_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Device8_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Device8_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Device8_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12Device8_GetNodeCount(This) \
+ ( (This)->lpVtbl -> GetNodeCount(This) )
+
+#define ID3D12Device8_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \
+ ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) )
+
+#define ID3D12Device8_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \
+ ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) )
+
+#define ID3D12Device8_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device8_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device8_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) )
+
+#define ID3D12Device8_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D12Device8_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) )
+
+#define ID3D12Device8_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \
+ ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) )
+
+#define ID3D12Device8_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \
+ ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) )
+
+#define ID3D12Device8_CreateConstantBufferView(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device8_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device8_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device8_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device8_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device8_CreateSampler(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device8_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) )
+
+#define ID3D12Device8_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
+
+#define ID3D12Device8_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device8_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
+
+#define ID3D12Device8_GetCustomHeapProperties(This,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device8_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
+
+#define ID3D12Device8_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
+
+#define ID3D12Device8_CreateHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device8_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device8_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device8_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \
+ ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) )
+
+#define ID3D12Device8_OpenSharedHandle(This,NTHandle,riid,ppvObj) \
+ ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) )
+
+#define ID3D12Device8_OpenSharedHandleByName(This,Name,Access,pNTHandle) \
+ ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) )
+
+#define ID3D12Device8_MakeResident(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) )
+
+#define ID3D12Device8_Evict(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) )
+
+#define ID3D12Device8_CreateFence(This,InitialValue,Flags,riid,ppFence) \
+ ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) )
+
+#define ID3D12Device8_GetDeviceRemovedReason(This) \
+ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) )
+
+#define ID3D12Device8_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+#define ID3D12Device8_CreateQueryHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device8_SetStablePowerState(This,Enable) \
+ ( (This)->lpVtbl -> SetStablePowerState(This,Enable) )
+
+#define ID3D12Device8_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \
+ ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) )
+
+#define ID3D12Device8_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
+ ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
+
+#define ID3D12Device8_GetAdapterLuid(This) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device8_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
+
+
+#define ID3D12Device8_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \
+ ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) )
+
+#define ID3D12Device8_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \
+ ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) )
+
+#define ID3D12Device8_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \
+ ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) )
+
+
+#define ID3D12Device8_CreatePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) )
+
+
+#define ID3D12Device8_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) )
+
+#define ID3D12Device8_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) )
+
+#define ID3D12Device8_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \
+ ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) )
+
+
+#define ID3D12Device8_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) )
+
+#define ID3D12Device8_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) )
+
+#define ID3D12Device8_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) )
+
+#define ID3D12Device8_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) )
+
+#define ID3D12Device8_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) )
+#if !defined(_WIN32)
+
+#define ID3D12Device8_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device8_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
+
+
+#define ID3D12Device8_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \
+ ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) )
+
+#define ID3D12Device8_RemoveDevice(This) \
+ ( (This)->lpVtbl -> RemoveDevice(This) )
+
+#define ID3D12Device8_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) )
+
+#define ID3D12Device8_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) )
+
+#define ID3D12Device8_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \
+ ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) )
+
+#define ID3D12Device8_CreateStateObject(This,pDesc,riid,ppStateObject) \
+ ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) )
+
+#define ID3D12Device8_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \
+ ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) )
+
+#define ID3D12Device8_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \
+ ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) )
+
+
+#define ID3D12Device8_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \
+ ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) )
+
+
+#define ID3D12Device8_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \
+ ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) )
+
+#define ID3D12Device8_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) )
+
+#if !defined(_WIN32)
+
+#define ID3D12Device8_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device8_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
+
+#define ID3D12Device8_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) )
+
+#define ID3D12Device8_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device8_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) )
+
+#define ID3D12Device8_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Device8_INTERFACE_DEFINED__ */
+
+
#ifndef __ID3D12Resource1_INTERFACE_DEFINED__
#define __ID3D12Resource1_INTERFACE_DEFINED__
@@ -14205,60 +18494,81 @@ EXTERN_C const IID IID_ID3D12Resource1;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Resource1 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Resource1 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Resource1 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Resource1 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Resource1 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Resource1 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Resource1 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12Resource1 * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12Resource, Map)
HRESULT ( STDMETHODCALLTYPE *Map )(
ID3D12Resource1 * This,
UINT Subresource,
_In_opt_ const D3D12_RANGE *pReadRange,
_Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData);
+ DECLSPEC_XFGVIRT(ID3D12Resource, Unmap)
void ( STDMETHODCALLTYPE *Unmap )(
ID3D12Resource1 * This,
UINT Subresource,
_In_opt_ const D3D12_RANGE *pWrittenRange);
+ DECLSPEC_XFGVIRT(ID3D12Resource, GetDesc)
+#if !defined(_WIN32)
D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )(
ID3D12Resource1 * This);
+#else
+ D3D12_RESOURCE_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12Resource1 * This,
+ D3D12_RESOURCE_DESC * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Resource, GetGPUVirtualAddress)
D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )(
ID3D12Resource1 * This);
+ DECLSPEC_XFGVIRT(ID3D12Resource, WriteToSubresource)
HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )(
ID3D12Resource1 * This,
UINT DstSubresource,
@@ -14267,6 +18577,7 @@ EXTERN_C const IID IID_ID3D12Resource1;
UINT SrcRowPitch,
UINT SrcDepthPitch);
+ DECLSPEC_XFGVIRT(ID3D12Resource, ReadFromSubresource)
HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )(
ID3D12Resource1 * This,
_Out_ void *pDstData,
@@ -14275,11 +18586,13 @@ EXTERN_C const IID IID_ID3D12Resource1;
UINT SrcSubresource,
_In_opt_ const D3D12_BOX *pSrcBox);
+ DECLSPEC_XFGVIRT(ID3D12Resource, GetHeapProperties)
HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )(
ID3D12Resource1 * This,
_Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties,
_Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags);
+ DECLSPEC_XFGVIRT(ID3D12Resource1, GetProtectedResourceSession)
HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )(
ID3D12Resource1 * This,
REFIID riid,
@@ -14331,9 +18644,14 @@ EXTERN_C const IID IID_ID3D12Resource1;
#define ID3D12Resource1_Unmap(This,Subresource,pWrittenRange) \
( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) )
+#if !defined(_WIN32)
#define ID3D12Resource1_GetDesc(This) \
( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12Resource1_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
#define ID3D12Resource1_GetGPUVirtualAddress(This) \
( (This)->lpVtbl -> GetGPUVirtualAddress(This) )
@@ -14362,6 +18680,244 @@ EXTERN_C const IID IID_ID3D12Resource1;
#endif /* __ID3D12Resource1_INTERFACE_DEFINED__ */
+#ifndef __ID3D12Resource2_INTERFACE_DEFINED__
+#define __ID3D12Resource2_INTERFACE_DEFINED__
+
+/* interface ID3D12Resource2 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Resource2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("BE36EC3B-EA85-4AEB-A45A-E9D76404A495")
+ ID3D12Resource2 : public ID3D12Resource1
+ {
+ public:
+#if defined(_MSC_VER)
+ virtual D3D12_RESOURCE_DESC1 STDMETHODCALLTYPE GetDesc1( void) = 0;
+#else
+ virtual D3D12_RESOURCE_DESC1 *STDMETHODCALLTYPE GetDesc1(
+ D3D12_RESOURCE_DESC1 * RetVal) = 0;
+#endif
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Resource2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Resource2 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Resource2 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Resource2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Resource2 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Resource2 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Resource2 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Resource2 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12Resource2 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12Resource, Map)
+ HRESULT ( STDMETHODCALLTYPE *Map )(
+ ID3D12Resource2 * This,
+ UINT Subresource,
+ _In_opt_ const D3D12_RANGE *pReadRange,
+ _Outptr_opt_result_bytebuffer_(_Inexpressible_("Dependent on resource")) void **ppData);
+
+ DECLSPEC_XFGVIRT(ID3D12Resource, Unmap)
+ void ( STDMETHODCALLTYPE *Unmap )(
+ ID3D12Resource2 * This,
+ UINT Subresource,
+ _In_opt_ const D3D12_RANGE *pWrittenRange);
+
+ DECLSPEC_XFGVIRT(ID3D12Resource, GetDesc)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12Resource2 * This);
+
+#else
+ D3D12_RESOURCE_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12Resource2 * This,
+ D3D12_RESOURCE_DESC * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Resource, GetGPUVirtualAddress)
+ D3D12_GPU_VIRTUAL_ADDRESS ( STDMETHODCALLTYPE *GetGPUVirtualAddress )(
+ ID3D12Resource2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Resource, WriteToSubresource)
+ HRESULT ( STDMETHODCALLTYPE *WriteToSubresource )(
+ ID3D12Resource2 * This,
+ UINT DstSubresource,
+ _In_opt_ const D3D12_BOX *pDstBox,
+ _In_ const void *pSrcData,
+ UINT SrcRowPitch,
+ UINT SrcDepthPitch);
+
+ DECLSPEC_XFGVIRT(ID3D12Resource, ReadFromSubresource)
+ HRESULT ( STDMETHODCALLTYPE *ReadFromSubresource )(
+ ID3D12Resource2 * This,
+ _Out_ void *pDstData,
+ UINT DstRowPitch,
+ UINT DstDepthPitch,
+ UINT SrcSubresource,
+ _In_opt_ const D3D12_BOX *pSrcBox);
+
+ DECLSPEC_XFGVIRT(ID3D12Resource, GetHeapProperties)
+ HRESULT ( STDMETHODCALLTYPE *GetHeapProperties )(
+ ID3D12Resource2 * This,
+ _Out_opt_ D3D12_HEAP_PROPERTIES *pHeapProperties,
+ _Out_opt_ D3D12_HEAP_FLAGS *pHeapFlags);
+
+ DECLSPEC_XFGVIRT(ID3D12Resource1, GetProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )(
+ ID3D12Resource2 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppProtectedSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Resource2, GetDesc1)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_DESC1 ( STDMETHODCALLTYPE *GetDesc1 )(
+ ID3D12Resource2 * This);
+
+#else
+ D3D12_RESOURCE_DESC1 *( STDMETHODCALLTYPE *GetDesc1 )(
+ ID3D12Resource2 * This,
+ D3D12_RESOURCE_DESC1 * RetVal);
+
+#endif
+
+ END_INTERFACE
+ } ID3D12Resource2Vtbl;
+
+ interface ID3D12Resource2
+ {
+ CONST_VTBL struct ID3D12Resource2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Resource2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Resource2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Resource2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Resource2_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Resource2_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Resource2_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Resource2_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12Resource2_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#define ID3D12Resource2_Map(This,Subresource,pReadRange,ppData) \
+ ( (This)->lpVtbl -> Map(This,Subresource,pReadRange,ppData) )
+
+#define ID3D12Resource2_Unmap(This,Subresource,pWrittenRange) \
+ ( (This)->lpVtbl -> Unmap(This,Subresource,pWrittenRange) )
+#if !defined(_WIN32)
+
+#define ID3D12Resource2_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12Resource2_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
+
+#define ID3D12Resource2_GetGPUVirtualAddress(This) \
+ ( (This)->lpVtbl -> GetGPUVirtualAddress(This) )
+
+#define ID3D12Resource2_WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) \
+ ( (This)->lpVtbl -> WriteToSubresource(This,DstSubresource,pDstBox,pSrcData,SrcRowPitch,SrcDepthPitch) )
+
+#define ID3D12Resource2_ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) \
+ ( (This)->lpVtbl -> ReadFromSubresource(This,pDstData,DstRowPitch,DstDepthPitch,SrcSubresource,pSrcBox) )
+
+#define ID3D12Resource2_GetHeapProperties(This,pHeapProperties,pHeapFlags) \
+ ( (This)->lpVtbl -> GetHeapProperties(This,pHeapProperties,pHeapFlags) )
+
+
+#define ID3D12Resource2_GetProtectedResourceSession(This,riid,ppProtectedSession) \
+ ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) )
+
+#if !defined(_WIN32)
+
+#define ID3D12Resource2_GetDesc1(This) \
+ ( (This)->lpVtbl -> GetDesc1(This) )
+#else
+#define ID3D12Resource2_GetDesc1(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc1(This,RetVal) )
+#endif
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Resource2_INTERFACE_DEFINED__ */
+
+
#ifndef __ID3D12Heap1_INTERFACE_DEFINED__
#define __ID3D12Heap1_INTERFACE_DEFINED__
@@ -14390,46 +18946,64 @@ EXTERN_C const IID IID_ID3D12Heap1;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Heap1 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Heap1 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Heap1 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12Heap1 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12Heap1 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12Heap1 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12Heap1 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12Heap1 * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12Heap, GetDesc)
+#if !defined(_WIN32)
D3D12_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )(
ID3D12Heap1 * This);
+#else
+ D3D12_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12Heap1 * This,
+ D3D12_HEAP_DESC * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Heap1, GetProtectedResourceSession)
HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )(
ID3D12Heap1 * This,
REFIID riid,
@@ -14475,9 +19049,14 @@ EXTERN_C const IID IID_ID3D12Heap1;
( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+#if !defined(_WIN32)
#define ID3D12Heap1_GetDesc(This) \
( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12Heap1_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
#define ID3D12Heap1_GetProtectedResourceSession(This,riid,ppProtectedSession) \
@@ -14521,58 +19100,71 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12GraphicsCommandList3 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12GraphicsCommandList3 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12GraphicsCommandList3 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12GraphicsCommandList3 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12GraphicsCommandList3 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12GraphicsCommandList3 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12GraphicsCommandList3 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12GraphicsCommandList3 * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
ID3D12GraphicsCommandList3 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close)
HRESULT ( STDMETHODCALLTYPE *Close )(
ID3D12GraphicsCommandList3 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset)
HRESULT ( STDMETHODCALLTYPE *Reset )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12CommandAllocator *pAllocator,
_In_opt_ ID3D12PipelineState *pInitialState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState)
void ( STDMETHODCALLTYPE *ClearState )(
ID3D12GraphicsCommandList3 * This,
_In_opt_ ID3D12PipelineState *pPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced)
void ( STDMETHODCALLTYPE *DrawInstanced )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT VertexCountPerInstance,
@@ -14580,6 +19172,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_ UINT StartVertexLocation,
_In_ UINT StartInstanceLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced)
void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT IndexCountPerInstance,
@@ -14588,12 +19181,14 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_ INT BaseVertexLocation,
_In_ UINT StartInstanceLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch)
void ( STDMETHODCALLTYPE *Dispatch )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT ThreadGroupCountX,
_In_ UINT ThreadGroupCountY,
_In_ UINT ThreadGroupCountZ);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion)
void ( STDMETHODCALLTYPE *CopyBufferRegion )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -14602,6 +19197,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
UINT64 SrcOffset,
UINT64 NumBytes);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion)
void ( STDMETHODCALLTYPE *CopyTextureRegion )(
ID3D12GraphicsCommandList3 * This,
_In_ const D3D12_TEXTURE_COPY_LOCATION *pDst,
@@ -14611,11 +19207,13 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc,
_In_opt_ const D3D12_BOX *pSrcBox);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource)
void ( STDMETHODCALLTYPE *CopyResource )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12Resource *pDstResource,
_In_ ID3D12Resource *pSrcResource);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles)
void ( STDMETHODCALLTYPE *CopyTiles )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12Resource *pTiledResource,
@@ -14625,6 +19223,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
UINT64 BufferStartOffsetInBytes,
D3D12_TILE_COPY_FLAGS Flags);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource)
void ( STDMETHODCALLTYPE *ResolveSubresource )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12Resource *pDstResource,
@@ -14633,76 +19232,92 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_ UINT SrcSubresource,
_In_ DXGI_FORMAT Format);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology)
void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
ID3D12GraphicsCommandList3 * This,
_In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports)
void ( STDMETHODCALLTYPE *RSSetViewports )(
ID3D12GraphicsCommandList3 * This,
_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
_In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects)
void ( STDMETHODCALLTYPE *RSSetScissorRects )(
ID3D12GraphicsCommandList3 * This,
_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
_In_reads_( NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor)
void ( STDMETHODCALLTYPE *OMSetBlendFactor )(
ID3D12GraphicsCommandList3 * This,
_In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef)
void ( STDMETHODCALLTYPE *OMSetStencilRef )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT StencilRef);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState)
void ( STDMETHODCALLTYPE *SetPipelineState )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12PipelineState *pPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier)
void ( STDMETHODCALLTYPE *ResourceBarrier )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT NumBarriers,
_In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle)
void ( STDMETHODCALLTYPE *ExecuteBundle )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12GraphicsCommandList *pCommandList);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps)
void ( STDMETHODCALLTYPE *SetDescriptorHeaps )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT NumDescriptorHeaps,
_In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature)
void ( STDMETHODCALLTYPE *SetComputeRootSignature )(
ID3D12GraphicsCommandList3 * This,
_In_opt_ ID3D12RootSignature *pRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature)
void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )(
ID3D12GraphicsCommandList3 * This,
_In_opt_ ID3D12RootSignature *pRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable)
void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable)
void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant)
void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT RootParameterIndex,
_In_ UINT SrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant)
void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT RootParameterIndex,
_In_ UINT SrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants)
void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT RootParameterIndex,
@@ -14710,6 +19325,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants)
void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT RootParameterIndex,
@@ -14717,52 +19333,62 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView)
void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView)
void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView)
void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView)
void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView)
void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView)
void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer)
void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
ID3D12GraphicsCommandList3 * This,
_In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers)
void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT StartSlot,
_In_ UINT NumViews,
_In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets)
void ( STDMETHODCALLTYPE *SOSetTargets )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT StartSlot,
_In_ UINT NumViews,
_In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets)
void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT NumRenderTargetDescriptors,
@@ -14770,6 +19396,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_ BOOL RTsSingleHandleToDescriptorRange,
_In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView)
void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
ID3D12GraphicsCommandList3 * This,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView,
@@ -14779,6 +19406,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView)
void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
ID3D12GraphicsCommandList3 * This,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView,
@@ -14786,6 +19414,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint)
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
ID3D12GraphicsCommandList3 * This,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
@@ -14795,6 +19424,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat)
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
ID3D12GraphicsCommandList3 * This,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
@@ -14804,23 +19434,27 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource)
void ( STDMETHODCALLTYPE *DiscardResource )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12Resource *pResource,
_In_opt_ const D3D12_DISCARD_REGION *pRegion);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery)
void ( STDMETHODCALLTYPE *BeginQuery )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
_In_ D3D12_QUERY_TYPE Type,
_In_ UINT Index);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery)
void ( STDMETHODCALLTYPE *EndQuery )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
_In_ D3D12_QUERY_TYPE Type,
_In_ UINT Index);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData)
void ( STDMETHODCALLTYPE *ResolveQueryData )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
@@ -14830,27 +19464,32 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_ ID3D12Resource *pDestinationBuffer,
_In_ UINT64 AlignedDestinationBufferOffset);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication)
void ( STDMETHODCALLTYPE *SetPredication )(
ID3D12GraphicsCommandList3 * This,
_In_opt_ ID3D12Resource *pBuffer,
_In_ UINT64 AlignedBufferOffset,
_In_ D3D12_PREDICATION_OP Operation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker)
void ( STDMETHODCALLTYPE *SetMarker )(
ID3D12GraphicsCommandList3 * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent)
void ( STDMETHODCALLTYPE *BeginEvent )(
ID3D12GraphicsCommandList3 * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent)
void ( STDMETHODCALLTYPE *EndEvent )(
ID3D12GraphicsCommandList3 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect)
void ( STDMETHODCALLTYPE *ExecuteIndirect )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12CommandSignature *pCommandSignature,
@@ -14860,6 +19499,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_opt_ ID3D12Resource *pCountBuffer,
_In_ UINT64 CountBufferOffset);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT)
void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -14870,6 +19510,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
_In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64)
void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -14880,17 +19521,20 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
_In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds)
void ( STDMETHODCALLTYPE *OMSetDepthBounds )(
ID3D12GraphicsCommandList3 * This,
_In_ FLOAT Min,
_In_ FLOAT Max);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions)
void ( STDMETHODCALLTYPE *SetSamplePositions )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT NumSamplesPerPixel,
_In_ UINT NumPixels,
_In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion)
void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )(
ID3D12GraphicsCommandList3 * This,
_In_ ID3D12Resource *pDstResource,
@@ -14903,16 +19547,19 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
_In_ DXGI_FORMAT Format,
_In_ D3D12_RESOLVE_MODE ResolveMode);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask)
void ( STDMETHODCALLTYPE *SetViewInstanceMask )(
ID3D12GraphicsCommandList3 * This,
_In_ UINT Mask);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate)
void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
ID3D12GraphicsCommandList3 * This,
UINT Count,
_In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
_In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession)
void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
ID3D12GraphicsCommandList3 * This,
_In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
@@ -15152,7 +19799,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList3;
#endif /* __ID3D12GraphicsCommandList3_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12_0000_0041 */
+/* interface __MIDL_itf_d3d12_0000_0049 */
/* [local] */
typedef
@@ -15244,8 +19891,8 @@ enum D3D12_RENDER_PASS_FLAGS
DEFINE_ENUM_FLAG_OPERATORS( D3D12_RENDER_PASS_FLAGS );
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0041_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0041_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0049_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0049_v0_0_s_ifspec;
#ifndef __ID3D12MetaCommand_INTERFACE_DEFINED__
#define __ID3D12MetaCommand_INTERFACE_DEFINED__
@@ -15275,43 +19922,52 @@ EXTERN_C const IID IID_ID3D12MetaCommand;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12MetaCommand * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12MetaCommand * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12MetaCommand * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12MetaCommand * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12MetaCommand * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12MetaCommand * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12MetaCommand * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12MetaCommand * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12MetaCommand, GetRequiredParameterResourceSize)
UINT64 ( STDMETHODCALLTYPE *GetRequiredParameterResourceSize )(
ID3D12MetaCommand * This,
_In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage,
@@ -15372,7 +20028,7 @@ EXTERN_C const IID IID_ID3D12MetaCommand;
#endif /* __ID3D12MetaCommand_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12_0000_0042 */
+/* interface __MIDL_itf_d3d12_0000_0050 */
/* [local] */
typedef struct D3D12_DISPATCH_RAYS_DESC
@@ -15388,8 +20044,8 @@ typedef struct D3D12_DISPATCH_RAYS_DESC
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0042_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0042_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0050_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0050_v0_0_s_ifspec;
#ifndef __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__
#define __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__
@@ -15454,58 +20110,71 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12GraphicsCommandList4 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12GraphicsCommandList4 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12GraphicsCommandList4 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12GraphicsCommandList4 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12GraphicsCommandList4 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12GraphicsCommandList4 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12GraphicsCommandList4 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12GraphicsCommandList4 * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
ID3D12GraphicsCommandList4 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close)
HRESULT ( STDMETHODCALLTYPE *Close )(
ID3D12GraphicsCommandList4 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset)
HRESULT ( STDMETHODCALLTYPE *Reset )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12CommandAllocator *pAllocator,
_In_opt_ ID3D12PipelineState *pInitialState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState)
void ( STDMETHODCALLTYPE *ClearState )(
ID3D12GraphicsCommandList4 * This,
_In_opt_ ID3D12PipelineState *pPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced)
void ( STDMETHODCALLTYPE *DrawInstanced )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT VertexCountPerInstance,
@@ -15513,6 +20182,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_ UINT StartVertexLocation,
_In_ UINT StartInstanceLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced)
void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT IndexCountPerInstance,
@@ -15521,12 +20191,14 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_ INT BaseVertexLocation,
_In_ UINT StartInstanceLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch)
void ( STDMETHODCALLTYPE *Dispatch )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT ThreadGroupCountX,
_In_ UINT ThreadGroupCountY,
_In_ UINT ThreadGroupCountZ);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion)
void ( STDMETHODCALLTYPE *CopyBufferRegion )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -15535,6 +20207,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
UINT64 SrcOffset,
UINT64 NumBytes);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion)
void ( STDMETHODCALLTYPE *CopyTextureRegion )(
ID3D12GraphicsCommandList4 * This,
_In_ const D3D12_TEXTURE_COPY_LOCATION *pDst,
@@ -15544,11 +20217,13 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc,
_In_opt_ const D3D12_BOX *pSrcBox);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource)
void ( STDMETHODCALLTYPE *CopyResource )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12Resource *pDstResource,
_In_ ID3D12Resource *pSrcResource);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles)
void ( STDMETHODCALLTYPE *CopyTiles )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12Resource *pTiledResource,
@@ -15558,6 +20233,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
UINT64 BufferStartOffsetInBytes,
D3D12_TILE_COPY_FLAGS Flags);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource)
void ( STDMETHODCALLTYPE *ResolveSubresource )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12Resource *pDstResource,
@@ -15566,76 +20242,92 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_ UINT SrcSubresource,
_In_ DXGI_FORMAT Format);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology)
void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
ID3D12GraphicsCommandList4 * This,
_In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports)
void ( STDMETHODCALLTYPE *RSSetViewports )(
ID3D12GraphicsCommandList4 * This,
_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
_In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects)
void ( STDMETHODCALLTYPE *RSSetScissorRects )(
ID3D12GraphicsCommandList4 * This,
_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
_In_reads_( NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor)
void ( STDMETHODCALLTYPE *OMSetBlendFactor )(
ID3D12GraphicsCommandList4 * This,
_In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef)
void ( STDMETHODCALLTYPE *OMSetStencilRef )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT StencilRef);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState)
void ( STDMETHODCALLTYPE *SetPipelineState )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12PipelineState *pPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier)
void ( STDMETHODCALLTYPE *ResourceBarrier )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT NumBarriers,
_In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle)
void ( STDMETHODCALLTYPE *ExecuteBundle )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12GraphicsCommandList *pCommandList);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps)
void ( STDMETHODCALLTYPE *SetDescriptorHeaps )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT NumDescriptorHeaps,
_In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature)
void ( STDMETHODCALLTYPE *SetComputeRootSignature )(
ID3D12GraphicsCommandList4 * This,
_In_opt_ ID3D12RootSignature *pRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature)
void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )(
ID3D12GraphicsCommandList4 * This,
_In_opt_ ID3D12RootSignature *pRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable)
void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable)
void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant)
void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT RootParameterIndex,
_In_ UINT SrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant)
void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT RootParameterIndex,
_In_ UINT SrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants)
void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT RootParameterIndex,
@@ -15643,6 +20335,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants)
void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT RootParameterIndex,
@@ -15650,52 +20343,62 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView)
void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView)
void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView)
void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView)
void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView)
void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView)
void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer)
void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
ID3D12GraphicsCommandList4 * This,
_In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers)
void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT StartSlot,
_In_ UINT NumViews,
_In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets)
void ( STDMETHODCALLTYPE *SOSetTargets )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT StartSlot,
_In_ UINT NumViews,
_In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets)
void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT NumRenderTargetDescriptors,
@@ -15703,6 +20406,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_ BOOL RTsSingleHandleToDescriptorRange,
_In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView)
void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
ID3D12GraphicsCommandList4 * This,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView,
@@ -15712,6 +20416,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView)
void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
ID3D12GraphicsCommandList4 * This,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView,
@@ -15719,6 +20424,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint)
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
ID3D12GraphicsCommandList4 * This,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
@@ -15728,6 +20434,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat)
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
ID3D12GraphicsCommandList4 * This,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
@@ -15737,23 +20444,27 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource)
void ( STDMETHODCALLTYPE *DiscardResource )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12Resource *pResource,
_In_opt_ const D3D12_DISCARD_REGION *pRegion);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery)
void ( STDMETHODCALLTYPE *BeginQuery )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
_In_ D3D12_QUERY_TYPE Type,
_In_ UINT Index);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery)
void ( STDMETHODCALLTYPE *EndQuery )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
_In_ D3D12_QUERY_TYPE Type,
_In_ UINT Index);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData)
void ( STDMETHODCALLTYPE *ResolveQueryData )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
@@ -15763,27 +20474,32 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_ ID3D12Resource *pDestinationBuffer,
_In_ UINT64 AlignedDestinationBufferOffset);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication)
void ( STDMETHODCALLTYPE *SetPredication )(
ID3D12GraphicsCommandList4 * This,
_In_opt_ ID3D12Resource *pBuffer,
_In_ UINT64 AlignedBufferOffset,
_In_ D3D12_PREDICATION_OP Operation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker)
void ( STDMETHODCALLTYPE *SetMarker )(
ID3D12GraphicsCommandList4 * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent)
void ( STDMETHODCALLTYPE *BeginEvent )(
ID3D12GraphicsCommandList4 * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent)
void ( STDMETHODCALLTYPE *EndEvent )(
ID3D12GraphicsCommandList4 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect)
void ( STDMETHODCALLTYPE *ExecuteIndirect )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12CommandSignature *pCommandSignature,
@@ -15793,6 +20509,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_opt_ ID3D12Resource *pCountBuffer,
_In_ UINT64 CountBufferOffset);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT)
void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -15803,6 +20520,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
_In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64)
void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -15813,17 +20531,20 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
_In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds)
void ( STDMETHODCALLTYPE *OMSetDepthBounds )(
ID3D12GraphicsCommandList4 * This,
_In_ FLOAT Min,
_In_ FLOAT Max);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions)
void ( STDMETHODCALLTYPE *SetSamplePositions )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT NumSamplesPerPixel,
_In_ UINT NumPixels,
_In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion)
void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12Resource *pDstResource,
@@ -15836,20 +20557,24 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_ DXGI_FORMAT Format,
_In_ D3D12_RESOLVE_MODE ResolveMode);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask)
void ( STDMETHODCALLTYPE *SetViewInstanceMask )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT Mask);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate)
void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
ID3D12GraphicsCommandList4 * This,
UINT Count,
_In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
_In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession)
void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
ID3D12GraphicsCommandList4 * This,
_In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass)
void ( STDMETHODCALLTYPE *BeginRenderPass )(
ID3D12GraphicsCommandList4 * This,
_In_ UINT NumRenderTargets,
@@ -15857,43 +20582,51 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
_In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil,
D3D12_RENDER_PASS_FLAGS Flags);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass)
void ( STDMETHODCALLTYPE *EndRenderPass )(
ID3D12GraphicsCommandList4 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand)
void ( STDMETHODCALLTYPE *InitializeMetaCommand )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12MetaCommand *pMetaCommand,
_In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData,
_In_ SIZE_T InitializationParametersDataSizeInBytes);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand)
void ( STDMETHODCALLTYPE *ExecuteMetaCommand )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12MetaCommand *pMetaCommand,
_In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData,
_In_ SIZE_T ExecutionParametersDataSizeInBytes);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure)
void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )(
ID3D12GraphicsCommandList4 * This,
_In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc,
_In_ UINT NumPostbuildInfoDescs,
_In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo)
void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )(
ID3D12GraphicsCommandList4 * This,
_In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc,
_In_ UINT NumSourceAccelerationStructures,
_In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure)
void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )(
ID3D12GraphicsCommandList4 * This,
_In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData,
_In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData,
_In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1)
void ( STDMETHODCALLTYPE *SetPipelineState1 )(
ID3D12GraphicsCommandList4 * This,
_In_ ID3D12StateObject *pStateObject);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays)
void ( STDMETHODCALLTYPE *DispatchRays )(
ID3D12GraphicsCommandList4 * This,
_In_ const D3D12_DISPATCH_RAYS_DESC *pDesc);
@@ -16161,6 +20894,3507 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList4;
#endif /* __ID3D12GraphicsCommandList4_INTERFACE_DEFINED__ */
+/* interface __MIDL_itf_d3d12_0000_0051 */
+/* [local] */
+
+typedef
+enum D3D12_SHADER_CACHE_MODE
+ {
+ D3D12_SHADER_CACHE_MODE_MEMORY = 0,
+ D3D12_SHADER_CACHE_MODE_DISK = ( D3D12_SHADER_CACHE_MODE_MEMORY + 1 )
+ } D3D12_SHADER_CACHE_MODE;
+
+typedef
+enum D3D12_SHADER_CACHE_FLAGS
+ {
+ D3D12_SHADER_CACHE_FLAG_NONE = 0,
+ D3D12_SHADER_CACHE_FLAG_DRIVER_VERSIONED = 0x1,
+ D3D12_SHADER_CACHE_FLAG_USE_WORKING_DIR = 0x2
+ } D3D12_SHADER_CACHE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_FLAGS );
+typedef struct D3D12_SHADER_CACHE_SESSION_DESC
+ {
+ GUID Identifier;
+ D3D12_SHADER_CACHE_MODE Mode;
+ D3D12_SHADER_CACHE_FLAGS Flags;
+ UINT MaximumInMemoryCacheSizeBytes;
+ UINT MaximumInMemoryCacheEntries;
+ UINT MaximumValueFileSizeBytes;
+ UINT64 Version;
+ } D3D12_SHADER_CACHE_SESSION_DESC;
+
+typedef
+enum D3D12_BARRIER_LAYOUT
+ {
+ D3D12_BARRIER_LAYOUT_UNDEFINED = 0xffffffff,
+ D3D12_BARRIER_LAYOUT_COMMON = 0,
+ D3D12_BARRIER_LAYOUT_PRESENT = 0,
+ D3D12_BARRIER_LAYOUT_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_PRESENT + 1 ) ,
+ D3D12_BARRIER_LAYOUT_RENDER_TARGET = ( D3D12_BARRIER_LAYOUT_GENERIC_READ + 1 ) ,
+ D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_RENDER_TARGET + 1 ) ,
+ D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE = ( D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS + 1 ) ,
+ D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_READ = ( D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE + 1 ) ,
+ D3D12_BARRIER_LAYOUT_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_DEPTH_STENCIL_READ + 1 ) ,
+ D3D12_BARRIER_LAYOUT_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_SHADER_RESOURCE + 1 ) ,
+ D3D12_BARRIER_LAYOUT_COPY_DEST = ( D3D12_BARRIER_LAYOUT_COPY_SOURCE + 1 ) ,
+ D3D12_BARRIER_LAYOUT_RESOLVE_SOURCE = ( D3D12_BARRIER_LAYOUT_COPY_DEST + 1 ) ,
+ D3D12_BARRIER_LAYOUT_RESOLVE_DEST = ( D3D12_BARRIER_LAYOUT_RESOLVE_SOURCE + 1 ) ,
+ D3D12_BARRIER_LAYOUT_SHADING_RATE_SOURCE = ( D3D12_BARRIER_LAYOUT_RESOLVE_DEST + 1 ) ,
+ D3D12_BARRIER_LAYOUT_VIDEO_DECODE_READ = ( D3D12_BARRIER_LAYOUT_SHADING_RATE_SOURCE + 1 ) ,
+ D3D12_BARRIER_LAYOUT_VIDEO_DECODE_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_DECODE_READ + 1 ) ,
+ D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_READ = ( D3D12_BARRIER_LAYOUT_VIDEO_DECODE_WRITE + 1 ) ,
+ D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_READ + 1 ) ,
+ D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_READ = ( D3D12_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE + 1 ) ,
+ D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE = ( D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_READ + 1 ) ,
+ D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE + 1 ) ,
+ D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON + 1 ) ,
+ D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ + 1 ) ,
+ D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS + 1 ) ,
+ D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE + 1 ) ,
+ D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE + 1 ) ,
+ D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST + 1 ) ,
+ D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON + 1 ) ,
+ D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ + 1 ) ,
+ D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS + 1 ) ,
+ D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE + 1 ) ,
+ D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE + 1 ) ,
+ D3D12_BARRIER_LAYOUT_VIDEO_QUEUE_COMMON = ( D3D12_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST + 1 )
+ } D3D12_BARRIER_LAYOUT;
+
+typedef
+enum D3D12_BARRIER_SYNC
+ {
+ D3D12_BARRIER_SYNC_NONE = 0,
+ D3D12_BARRIER_SYNC_ALL = 0x1,
+ D3D12_BARRIER_SYNC_DRAW = 0x2,
+ D3D12_BARRIER_SYNC_INPUT_ASSEMBLER = 0x4,
+ D3D12_BARRIER_SYNC_VERTEX_SHADING = 0x8,
+ D3D12_BARRIER_SYNC_PIXEL_SHADING = 0x10,
+ D3D12_BARRIER_SYNC_DEPTH_STENCIL = 0x20,
+ D3D12_BARRIER_SYNC_RENDER_TARGET = 0x40,
+ D3D12_BARRIER_SYNC_COMPUTE_SHADING = 0x80,
+ D3D12_BARRIER_SYNC_RAYTRACING = 0x100,
+ D3D12_BARRIER_SYNC_COPY = 0x200,
+ D3D12_BARRIER_SYNC_RESOLVE = 0x400,
+ D3D12_BARRIER_SYNC_EXECUTE_INDIRECT = 0x800,
+ D3D12_BARRIER_SYNC_PREDICATION = 0x800,
+ D3D12_BARRIER_SYNC_ALL_SHADING = 0x1000,
+ D3D12_BARRIER_SYNC_NON_PIXEL_SHADING = 0x2000,
+ D3D12_BARRIER_SYNC_EMIT_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO = 0x4000,
+ D3D12_BARRIER_SYNC_CLEAR_UNORDERED_ACCESS_VIEW = 0x8000,
+ D3D12_BARRIER_SYNC_VIDEO_DECODE = 0x100000,
+ D3D12_BARRIER_SYNC_VIDEO_PROCESS = 0x200000,
+ D3D12_BARRIER_SYNC_VIDEO_ENCODE = 0x400000,
+ D3D12_BARRIER_SYNC_BUILD_RAYTRACING_ACCELERATION_STRUCTURE = 0x800000,
+ D3D12_BARRIER_SYNC_COPY_RAYTRACING_ACCELERATION_STRUCTURE = 0x1000000,
+ D3D12_BARRIER_SYNC_SPLIT = 0x80000000
+ } D3D12_BARRIER_SYNC;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_SYNC );
+typedef
+enum D3D12_BARRIER_ACCESS
+ {
+ D3D12_BARRIER_ACCESS_COMMON = 0,
+ D3D12_BARRIER_ACCESS_VERTEX_BUFFER = 0x1,
+ D3D12_BARRIER_ACCESS_CONSTANT_BUFFER = 0x2,
+ D3D12_BARRIER_ACCESS_INDEX_BUFFER = 0x4,
+ D3D12_BARRIER_ACCESS_RENDER_TARGET = 0x8,
+ D3D12_BARRIER_ACCESS_UNORDERED_ACCESS = 0x10,
+ D3D12_BARRIER_ACCESS_DEPTH_STENCIL_WRITE = 0x20,
+ D3D12_BARRIER_ACCESS_DEPTH_STENCIL_READ = 0x40,
+ D3D12_BARRIER_ACCESS_SHADER_RESOURCE = 0x80,
+ D3D12_BARRIER_ACCESS_STREAM_OUTPUT = 0x100,
+ D3D12_BARRIER_ACCESS_INDIRECT_ARGUMENT = 0x200,
+ D3D12_BARRIER_ACCESS_PREDICATION = 0x200,
+ D3D12_BARRIER_ACCESS_COPY_DEST = 0x400,
+ D3D12_BARRIER_ACCESS_COPY_SOURCE = 0x800,
+ D3D12_BARRIER_ACCESS_RESOLVE_DEST = 0x1000,
+ D3D12_BARRIER_ACCESS_RESOLVE_SOURCE = 0x2000,
+ D3D12_BARRIER_ACCESS_RAYTRACING_ACCELERATION_STRUCTURE_READ = 0x4000,
+ D3D12_BARRIER_ACCESS_RAYTRACING_ACCELERATION_STRUCTURE_WRITE = 0x8000,
+ D3D12_BARRIER_ACCESS_SHADING_RATE_SOURCE = 0x10000,
+ D3D12_BARRIER_ACCESS_VIDEO_DECODE_READ = 0x20000,
+ D3D12_BARRIER_ACCESS_VIDEO_DECODE_WRITE = 0x40000,
+ D3D12_BARRIER_ACCESS_VIDEO_PROCESS_READ = 0x80000,
+ D3D12_BARRIER_ACCESS_VIDEO_PROCESS_WRITE = 0x100000,
+ D3D12_BARRIER_ACCESS_VIDEO_ENCODE_READ = 0x200000,
+ D3D12_BARRIER_ACCESS_VIDEO_ENCODE_WRITE = 0x400000,
+ D3D12_BARRIER_ACCESS_NO_ACCESS = 0x80000000
+ } D3D12_BARRIER_ACCESS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_BARRIER_ACCESS );
+typedef
+enum D3D12_BARRIER_TYPE
+ {
+ D3D12_BARRIER_TYPE_GLOBAL = 0,
+ D3D12_BARRIER_TYPE_TEXTURE = ( D3D12_BARRIER_TYPE_GLOBAL + 1 ) ,
+ D3D12_BARRIER_TYPE_BUFFER = ( D3D12_BARRIER_TYPE_TEXTURE + 1 )
+ } D3D12_BARRIER_TYPE;
+
+typedef
+enum D3D12_TEXTURE_BARRIER_FLAGS
+ {
+ D3D12_TEXTURE_BARRIER_FLAG_NONE = 0,
+ D3D12_TEXTURE_BARRIER_FLAG_DISCARD = 0x1
+ } D3D12_TEXTURE_BARRIER_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_TEXTURE_BARRIER_FLAGS );
+typedef struct D3D12_BARRIER_SUBRESOURCE_RANGE
+ {
+ UINT IndexOrFirstMipLevel;
+ UINT NumMipLevels;
+ UINT FirstArraySlice;
+ UINT NumArraySlices;
+ UINT FirstPlane;
+ UINT NumPlanes;
+ } D3D12_BARRIER_SUBRESOURCE_RANGE;
+
+typedef struct D3D12_GLOBAL_BARRIER
+ {
+ D3D12_BARRIER_SYNC SyncBefore;
+ D3D12_BARRIER_SYNC SyncAfter;
+ D3D12_BARRIER_ACCESS AccessBefore;
+ D3D12_BARRIER_ACCESS AccessAfter;
+ } D3D12_GLOBAL_BARRIER;
+
+typedef struct D3D12_TEXTURE_BARRIER
+ {
+ D3D12_BARRIER_SYNC SyncBefore;
+ D3D12_BARRIER_SYNC SyncAfter;
+ D3D12_BARRIER_ACCESS AccessBefore;
+ D3D12_BARRIER_ACCESS AccessAfter;
+ D3D12_BARRIER_LAYOUT LayoutBefore;
+ D3D12_BARRIER_LAYOUT LayoutAfter;
+ _In_ ID3D12Resource *pResource;
+ D3D12_BARRIER_SUBRESOURCE_RANGE Subresources;
+ D3D12_TEXTURE_BARRIER_FLAGS Flags;
+ } D3D12_TEXTURE_BARRIER;
+
+typedef struct D3D12_BUFFER_BARRIER
+ {
+ D3D12_BARRIER_SYNC SyncBefore;
+ D3D12_BARRIER_SYNC SyncAfter;
+ D3D12_BARRIER_ACCESS AccessBefore;
+ D3D12_BARRIER_ACCESS AccessAfter;
+ _In_ ID3D12Resource *pResource;
+ UINT64 Offset;
+ UINT64 Size;
+ } D3D12_BUFFER_BARRIER;
+
+typedef struct D3D12_BARRIER_GROUP
+ {
+ D3D12_BARRIER_TYPE Type;
+ UINT32 NumBarriers;
+ union
+ {
+ _In_reads_(NumBarriers) const D3D12_GLOBAL_BARRIER *pGlobalBarriers;
+ _In_reads_(NumBarriers) const D3D12_TEXTURE_BARRIER *pTextureBarriers;
+ _In_reads_(NumBarriers) const D3D12_BUFFER_BARRIER *pBufferBarriers;
+ } ;
+ } D3D12_BARRIER_GROUP;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0051_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0051_v0_0_s_ifspec;
+
+#ifndef __ID3D12ShaderCacheSession_INTERFACE_DEFINED__
+#define __ID3D12ShaderCacheSession_INTERFACE_DEFINED__
+
+/* interface ID3D12ShaderCacheSession */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12ShaderCacheSession;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("28e2495d-0f64-4ae4-a6ec-129255dc49a8")
+ ID3D12ShaderCacheSession : public ID3D12DeviceChild
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE FindValue(
+ /* [annotation][in] */
+ _In_reads_bytes_(KeySize) const void *pKey,
+ UINT KeySize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pValueSize) void *pValue,
+ _Inout_ UINT *pValueSize) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE StoreValue(
+ /* [annotation][in] */
+ _In_reads_bytes_(KeySize) const void *pKey,
+ UINT KeySize,
+ /* [annotation][in] */
+ _In_reads_bytes_(ValueSize) const void *pValue,
+ UINT ValueSize) = 0;
+
+ virtual void STDMETHODCALLTYPE SetDeleteOnDestroy( void) = 0;
+
+#if defined(_MSC_VER)
+ virtual D3D12_SHADER_CACHE_SESSION_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+#else
+ virtual D3D12_SHADER_CACHE_SESSION_DESC *STDMETHODCALLTYPE GetDesc(
+ D3D12_SHADER_CACHE_SESSION_DESC * RetVal) = 0;
+#endif
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12ShaderCacheSessionVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12ShaderCacheSession * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12ShaderCacheSession * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12ShaderCacheSession * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12ShaderCacheSession * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12ShaderCacheSession * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12ShaderCacheSession * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12ShaderCacheSession * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12ShaderCacheSession * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, FindValue)
+ HRESULT ( STDMETHODCALLTYPE *FindValue )(
+ ID3D12ShaderCacheSession * This,
+ /* [annotation][in] */
+ _In_reads_bytes_(KeySize) const void *pKey,
+ UINT KeySize,
+ /* [annotation][out] */
+ _Out_writes_bytes_(*pValueSize) void *pValue,
+ _Inout_ UINT *pValueSize);
+
+ DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, StoreValue)
+ HRESULT ( STDMETHODCALLTYPE *StoreValue )(
+ ID3D12ShaderCacheSession * This,
+ /* [annotation][in] */
+ _In_reads_bytes_(KeySize) const void *pKey,
+ UINT KeySize,
+ /* [annotation][in] */
+ _In_reads_bytes_(ValueSize) const void *pValue,
+ UINT ValueSize);
+
+ DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, SetDeleteOnDestroy)
+ void ( STDMETHODCALLTYPE *SetDeleteOnDestroy )(
+ ID3D12ShaderCacheSession * This);
+
+ DECLSPEC_XFGVIRT(ID3D12ShaderCacheSession, GetDesc)
+#if !defined(_WIN32)
+ D3D12_SHADER_CACHE_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12ShaderCacheSession * This);
+
+#else
+ D3D12_SHADER_CACHE_SESSION_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12ShaderCacheSession * This,
+ D3D12_SHADER_CACHE_SESSION_DESC * RetVal);
+
+#endif
+
+ END_INTERFACE
+ } ID3D12ShaderCacheSessionVtbl;
+
+ interface ID3D12ShaderCacheSession
+ {
+ CONST_VTBL struct ID3D12ShaderCacheSessionVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12ShaderCacheSession_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12ShaderCacheSession_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12ShaderCacheSession_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12ShaderCacheSession_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12ShaderCacheSession_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12ShaderCacheSession_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12ShaderCacheSession_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12ShaderCacheSession_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12ShaderCacheSession_FindValue(This,pKey,KeySize,pValue,pValueSize) \
+ ( (This)->lpVtbl -> FindValue(This,pKey,KeySize,pValue,pValueSize) )
+
+#define ID3D12ShaderCacheSession_StoreValue(This,pKey,KeySize,pValue,ValueSize) \
+ ( (This)->lpVtbl -> StoreValue(This,pKey,KeySize,pValue,ValueSize) )
+
+#define ID3D12ShaderCacheSession_SetDeleteOnDestroy(This) \
+ ( (This)->lpVtbl -> SetDeleteOnDestroy(This) )
+#if !defined(_WIN32)
+
+#define ID3D12ShaderCacheSession_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12ShaderCacheSession_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12ShaderCacheSession_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12_0000_0052 */
+/* [local] */
+
+typedef
+enum D3D12_SHADER_CACHE_KIND_FLAGS
+ {
+ D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CACHE_FOR_DRIVER = 0x1,
+ D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_D3D_CONVERSIONS = 0x2,
+ D3D12_SHADER_CACHE_KIND_FLAG_IMPLICIT_DRIVER_MANAGED = 0x4,
+ D3D12_SHADER_CACHE_KIND_FLAG_APPLICATION_MANAGED = 0x8
+ } D3D12_SHADER_CACHE_KIND_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_KIND_FLAGS );
+typedef
+enum D3D12_SHADER_CACHE_CONTROL_FLAGS
+ {
+ D3D12_SHADER_CACHE_CONTROL_FLAG_DISABLE = 0x1,
+ D3D12_SHADER_CACHE_CONTROL_FLAG_ENABLE = 0x2,
+ D3D12_SHADER_CACHE_CONTROL_FLAG_CLEAR = 0x4
+ } D3D12_SHADER_CACHE_CONTROL_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_SHADER_CACHE_CONTROL_FLAGS );
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0052_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0052_v0_0_s_ifspec;
+
+#ifndef __ID3D12Device9_INTERFACE_DEFINED__
+#define __ID3D12Device9_INTERFACE_DEFINED__
+
+/* interface ID3D12Device9 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Device9;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("4c80e962-f032-4f60-bc9e-ebc2cfa1d83c")
+ ID3D12Device9 : public ID3D12Device8
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CreateShaderCacheSession(
+ _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvSession) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ShaderCacheControl(
+ D3D12_SHADER_CACHE_KIND_FLAGS Kinds,
+ D3D12_SHADER_CACHE_CONTROL_FLAGS Control) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateCommandQueue1(
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID CreatorID,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Device9Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Device9 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Device9 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Device9 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Device9 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Device9 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Device9 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Device9 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
+ UINT ( STDMETHODCALLTYPE *GetNodeCount )(
+ ID3D12Device9 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
+ ID3D12Device9 * This,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
+ ID3D12Device9 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ ID3D12CommandAllocator *pCommandAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D12Device9 * This,
+ D3D12_FEATURE Feature,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
+ UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
+ ID3D12Device9 * This,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
+ ID3D12Device9 * This,
+ _In_ UINT nodeMask,
+ _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature,
+ _In_ SIZE_T blobLengthInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppvRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
+ void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
+ ID3D12Device9 * This,
+ _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
+ void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
+ ID3D12Device9 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
+ ID3D12Device9 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ ID3D12Resource *pCounterResource,
+ _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
+ void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
+ ID3D12Device9 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
+ void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
+ ID3D12Device9 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
+ void ( STDMETHODCALLTYPE *CreateSampler )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_SAMPLER_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
+ void ( STDMETHODCALLTYPE *CopyDescriptors )(
+ ID3D12Device9 * This,
+ _In_ UINT NumDestDescriptorRanges,
+ _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts,
+ _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes,
+ _In_ UINT NumSrcDescriptorRanges,
+ _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts,
+ _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
+ void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
+ ID3D12Device9 * This,
+ _In_ UINT NumDescriptors,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device9 * This,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device9 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
+ D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device9 * This,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device9 * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
+ ID3D12Device9 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
+ ID3D12Device9 * This,
+ _In_ ID3D12DeviceChild *pObject,
+ _In_opt_ const SECURITY_ATTRIBUTES *pAttributes,
+ DWORD Access,
+ _In_opt_ LPCWSTR Name,
+ _Out_ HANDLE *pHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
+ ID3D12Device9 * This,
+ _In_ HANDLE NTHandle,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvObj);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
+ ID3D12Device9 * This,
+ _In_ LPCWSTR Name,
+ DWORD Access,
+ /* [annotation][out] */
+ _Out_ HANDLE *pNTHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
+ HRESULT ( STDMETHODCALLTYPE *MakeResident )(
+ ID3D12Device9 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
+ HRESULT ( STDMETHODCALLTYPE *Evict )(
+ ID3D12Device9 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
+ HRESULT ( STDMETHODCALLTYPE *CreateFence )(
+ ID3D12Device9 * This,
+ UINT64 InitialValue,
+ D3D12_FENCE_FLAGS Flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppFence);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
+ HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
+ ID3D12Device9 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_RESOURCE_DESC *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_QUERY_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
+ HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
+ ID3D12Device9 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
+ _In_opt_ ID3D12RootSignature *pRootSignature,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvCommandSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
+ void ( STDMETHODCALLTYPE *GetResourceTiling )(
+ ID3D12Device9 * This,
+ _In_ ID3D12Resource *pTiledResource,
+ _Out_opt_ UINT *pNumTilesForEntireResource,
+ _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc,
+ _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips,
+ _Inout_opt_ UINT *pNumSubresourceTilings,
+ _In_ UINT FirstSubresourceTilingToGet,
+ _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
+ LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device9 * This);
+
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device9 * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )(
+ ID3D12Device9 * This,
+ _In_reads_(BlobLength) const void *pLibraryBlob,
+ SIZE_T BlobLength,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineLibrary);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion)
+ HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )(
+ ID3D12Device9 * This,
+ _In_reads_(NumFences) ID3D12Fence *const *ppFences,
+ _In_reads_(NumFences) const UINT64 *pFenceValues,
+ UINT NumFences,
+ D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
+ HANDLE hEvent);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority)
+ HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )(
+ ID3D12Device9 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities);
+
+ DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )(
+ ID3D12Device9 * This,
+ const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )(
+ ID3D12Device9 * This,
+ _In_ const void *pAddress,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )(
+ ID3D12Device9 * This,
+ _In_ HANDLE hFileMapping,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident)
+ HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )(
+ ID3D12Device9 * This,
+ D3D12_RESIDENCY_FLAGS Flags,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_ ID3D12Fence *pFenceToSignal,
+ UINT64 FenceValueToSignal);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )(
+ ID3D12Device9 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ D3D12_COMMAND_LIST_FLAGS flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device9 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device9 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker)
+ HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )(
+ ID3D12Device9 * This,
+ _In_ ID3D12LifetimeOwner *pOwner,
+ REFIID riid,
+ _COM_Outptr_ void **ppvTracker);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice)
+ void ( STDMETHODCALLTYPE *RemoveDevice )(
+ ID3D12Device9 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )(
+ ID3D12Device9 * This,
+ _Inout_ UINT *pNumMetaCommands,
+ _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )(
+ ID3D12Device9 * This,
+ _In_ REFGUID CommandId,
+ _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage,
+ _Out_opt_ UINT *pTotalStructureSizeInBytes,
+ _Inout_ UINT *pParameterCount,
+ _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand)
+ HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )(
+ ID3D12Device9 * This,
+ _In_ REFGUID CommandId,
+ _In_ UINT NodeMask,
+ _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData,
+ _In_ SIZE_T CreationParametersDataSizeInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppMetaCommand);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject)
+ HRESULT ( STDMETHODCALLTYPE *CreateStateObject )(
+ ID3D12Device9 * This,
+ const D3D12_STATE_OBJECT_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo)
+ void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc,
+ _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier)
+ D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )(
+ ID3D12Device9 * This,
+ _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType,
+ _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck);
+
+ DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode)
+ HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )(
+ ID3D12Device9 * This,
+ D3D12_BACKGROUND_PROCESSING_MODE Mode,
+ D3D12_MEASUREMENTS_ACTION MeasurementsAction,
+ _In_opt_ HANDLE hEventToSignalUponCompletion,
+ _Out_opt_ BOOL *pbFurtherMeasurementsDesired);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject)
+ HRESULT ( STDMETHODCALLTYPE *AddToStateObject )(
+ ID3D12Device9 * This,
+ const D3D12_STATE_OBJECT_DESC *pAddition,
+ ID3D12StateObject *pStateObjectToGrowFrom,
+ REFIID riid,
+ _COM_Outptr_ void **ppNewStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )(
+ ID3D12Device9 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )(
+ ID3D12Device9 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )(
+ ID3D12Device9 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )(
+ ID3D12Device9 * This,
+ _In_opt_ ID3D12Resource *pTargetedResource,
+ _In_opt_ ID3D12Resource *pFeedbackResource,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1)
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession)
+ HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl)
+ HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )(
+ ID3D12Device9 * This,
+ D3D12_SHADER_CACHE_KIND_FLAGS Kinds,
+ D3D12_SHADER_CACHE_CONTROL_FLAGS Control);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )(
+ ID3D12Device9 * This,
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID CreatorID,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue);
+
+ END_INTERFACE
+ } ID3D12Device9Vtbl;
+
+ interface ID3D12Device9
+ {
+ CONST_VTBL struct ID3D12Device9Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Device9_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Device9_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Device9_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Device9_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Device9_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Device9_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Device9_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12Device9_GetNodeCount(This) \
+ ( (This)->lpVtbl -> GetNodeCount(This) )
+
+#define ID3D12Device9_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \
+ ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) )
+
+#define ID3D12Device9_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \
+ ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) )
+
+#define ID3D12Device9_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device9_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device9_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) )
+
+#define ID3D12Device9_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D12Device9_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) )
+
+#define ID3D12Device9_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \
+ ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) )
+
+#define ID3D12Device9_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \
+ ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) )
+
+#define ID3D12Device9_CreateConstantBufferView(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device9_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device9_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device9_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device9_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device9_CreateSampler(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device9_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) )
+
+#define ID3D12Device9_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
+
+#define ID3D12Device9_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device9_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
+
+#define ID3D12Device9_GetCustomHeapProperties(This,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device9_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
+
+#define ID3D12Device9_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
+
+#define ID3D12Device9_CreateHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device9_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device9_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device9_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \
+ ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) )
+
+#define ID3D12Device9_OpenSharedHandle(This,NTHandle,riid,ppvObj) \
+ ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) )
+
+#define ID3D12Device9_OpenSharedHandleByName(This,Name,Access,pNTHandle) \
+ ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) )
+
+#define ID3D12Device9_MakeResident(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) )
+
+#define ID3D12Device9_Evict(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) )
+
+#define ID3D12Device9_CreateFence(This,InitialValue,Flags,riid,ppFence) \
+ ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) )
+
+#define ID3D12Device9_GetDeviceRemovedReason(This) \
+ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) )
+
+#define ID3D12Device9_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+#define ID3D12Device9_CreateQueryHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device9_SetStablePowerState(This,Enable) \
+ ( (This)->lpVtbl -> SetStablePowerState(This,Enable) )
+
+#define ID3D12Device9_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \
+ ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) )
+
+#define ID3D12Device9_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
+ ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
+
+#define ID3D12Device9_GetAdapterLuid(This) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device9_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
+
+
+#define ID3D12Device9_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \
+ ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) )
+
+#define ID3D12Device9_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \
+ ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) )
+
+#define ID3D12Device9_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \
+ ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) )
+
+
+#define ID3D12Device9_CreatePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) )
+
+
+#define ID3D12Device9_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) )
+
+#define ID3D12Device9_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) )
+
+#define ID3D12Device9_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \
+ ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) )
+
+
+#define ID3D12Device9_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) )
+
+#define ID3D12Device9_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) )
+
+#define ID3D12Device9_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) )
+
+#define ID3D12Device9_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) )
+
+#define ID3D12Device9_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) )
+#if !defined(_WIN32)
+
+#define ID3D12Device9_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device9_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
+
+
+#define ID3D12Device9_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \
+ ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) )
+
+#define ID3D12Device9_RemoveDevice(This) \
+ ( (This)->lpVtbl -> RemoveDevice(This) )
+
+#define ID3D12Device9_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) )
+
+#define ID3D12Device9_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) )
+
+#define ID3D12Device9_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \
+ ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) )
+
+#define ID3D12Device9_CreateStateObject(This,pDesc,riid,ppStateObject) \
+ ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) )
+
+#define ID3D12Device9_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \
+ ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) )
+
+#define ID3D12Device9_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \
+ ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) )
+
+
+#define ID3D12Device9_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \
+ ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) )
+
+
+#define ID3D12Device9_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \
+ ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) )
+
+#define ID3D12Device9_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) )
+
+#if !defined(_WIN32)
+
+#define ID3D12Device9_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device9_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
+
+#define ID3D12Device9_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) )
+
+#define ID3D12Device9_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device9_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) )
+
+#define ID3D12Device9_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+
+#define ID3D12Device9_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \
+ ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) )
+
+#define ID3D12Device9_ShaderCacheControl(This,Kinds,Control) \
+ ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) )
+
+#define ID3D12Device9_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \
+ ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Device9_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Device10_INTERFACE_DEFINED__
+#define __ID3D12Device10_INTERFACE_DEFINED__
+
+/* interface ID3D12Device10 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Device10;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("517f8718-aa66-49f9-b02b-a7ab89c06031")
+ ID3D12Device10 : public ID3D12Device9
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CreateCommittedResource3(
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreatePlacedResource2(
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateReservedResource2(
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Device10Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Device10 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Device10 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Device10 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Device10 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Device10 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Device10 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Device10 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
+ UINT ( STDMETHODCALLTYPE *GetNodeCount )(
+ ID3D12Device10 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
+ ID3D12Device10 * This,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
+ ID3D12Device10 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ ID3D12CommandAllocator *pCommandAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D12Device10 * This,
+ D3D12_FEATURE Feature,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
+ UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
+ ID3D12Device10 * This,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
+ ID3D12Device10 * This,
+ _In_ UINT nodeMask,
+ _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature,
+ _In_ SIZE_T blobLengthInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppvRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
+ void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
+ ID3D12Device10 * This,
+ _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
+ void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
+ ID3D12Device10 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
+ ID3D12Device10 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ ID3D12Resource *pCounterResource,
+ _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
+ void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
+ ID3D12Device10 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
+ void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
+ ID3D12Device10 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
+ void ( STDMETHODCALLTYPE *CreateSampler )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_SAMPLER_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
+ void ( STDMETHODCALLTYPE *CopyDescriptors )(
+ ID3D12Device10 * This,
+ _In_ UINT NumDestDescriptorRanges,
+ _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts,
+ _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes,
+ _In_ UINT NumSrcDescriptorRanges,
+ _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts,
+ _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
+ void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
+ ID3D12Device10 * This,
+ _In_ UINT NumDescriptors,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device10 * This,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device10 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
+ D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device10 * This,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device10 * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
+ ID3D12Device10 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
+ ID3D12Device10 * This,
+ _In_ ID3D12DeviceChild *pObject,
+ _In_opt_ const SECURITY_ATTRIBUTES *pAttributes,
+ DWORD Access,
+ _In_opt_ LPCWSTR Name,
+ _Out_ HANDLE *pHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
+ ID3D12Device10 * This,
+ _In_ HANDLE NTHandle,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvObj);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
+ ID3D12Device10 * This,
+ _In_ LPCWSTR Name,
+ DWORD Access,
+ /* [annotation][out] */
+ _Out_ HANDLE *pNTHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
+ HRESULT ( STDMETHODCALLTYPE *MakeResident )(
+ ID3D12Device10 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
+ HRESULT ( STDMETHODCALLTYPE *Evict )(
+ ID3D12Device10 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
+ HRESULT ( STDMETHODCALLTYPE *CreateFence )(
+ ID3D12Device10 * This,
+ UINT64 InitialValue,
+ D3D12_FENCE_FLAGS Flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppFence);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
+ HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
+ ID3D12Device10 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_RESOURCE_DESC *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_QUERY_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
+ HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
+ ID3D12Device10 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
+ _In_opt_ ID3D12RootSignature *pRootSignature,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvCommandSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
+ void ( STDMETHODCALLTYPE *GetResourceTiling )(
+ ID3D12Device10 * This,
+ _In_ ID3D12Resource *pTiledResource,
+ _Out_opt_ UINT *pNumTilesForEntireResource,
+ _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc,
+ _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips,
+ _Inout_opt_ UINT *pNumSubresourceTilings,
+ _In_ UINT FirstSubresourceTilingToGet,
+ _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
+ LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device10 * This);
+
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device10 * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )(
+ ID3D12Device10 * This,
+ _In_reads_(BlobLength) const void *pLibraryBlob,
+ SIZE_T BlobLength,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineLibrary);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion)
+ HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )(
+ ID3D12Device10 * This,
+ _In_reads_(NumFences) ID3D12Fence *const *ppFences,
+ _In_reads_(NumFences) const UINT64 *pFenceValues,
+ UINT NumFences,
+ D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
+ HANDLE hEvent);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority)
+ HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )(
+ ID3D12Device10 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities);
+
+ DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )(
+ ID3D12Device10 * This,
+ const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )(
+ ID3D12Device10 * This,
+ _In_ const void *pAddress,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )(
+ ID3D12Device10 * This,
+ _In_ HANDLE hFileMapping,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident)
+ HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )(
+ ID3D12Device10 * This,
+ D3D12_RESIDENCY_FLAGS Flags,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_ ID3D12Fence *pFenceToSignal,
+ UINT64 FenceValueToSignal);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )(
+ ID3D12Device10 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ D3D12_COMMAND_LIST_FLAGS flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device10 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device10 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker)
+ HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )(
+ ID3D12Device10 * This,
+ _In_ ID3D12LifetimeOwner *pOwner,
+ REFIID riid,
+ _COM_Outptr_ void **ppvTracker);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice)
+ void ( STDMETHODCALLTYPE *RemoveDevice )(
+ ID3D12Device10 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )(
+ ID3D12Device10 * This,
+ _Inout_ UINT *pNumMetaCommands,
+ _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )(
+ ID3D12Device10 * This,
+ _In_ REFGUID CommandId,
+ _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage,
+ _Out_opt_ UINT *pTotalStructureSizeInBytes,
+ _Inout_ UINT *pParameterCount,
+ _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand)
+ HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )(
+ ID3D12Device10 * This,
+ _In_ REFGUID CommandId,
+ _In_ UINT NodeMask,
+ _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData,
+ _In_ SIZE_T CreationParametersDataSizeInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppMetaCommand);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject)
+ HRESULT ( STDMETHODCALLTYPE *CreateStateObject )(
+ ID3D12Device10 * This,
+ const D3D12_STATE_OBJECT_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo)
+ void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc,
+ _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier)
+ D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )(
+ ID3D12Device10 * This,
+ _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType,
+ _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck);
+
+ DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode)
+ HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )(
+ ID3D12Device10 * This,
+ D3D12_BACKGROUND_PROCESSING_MODE Mode,
+ D3D12_MEASUREMENTS_ACTION MeasurementsAction,
+ _In_opt_ HANDLE hEventToSignalUponCompletion,
+ _Out_opt_ BOOL *pbFurtherMeasurementsDesired);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject)
+ HRESULT ( STDMETHODCALLTYPE *AddToStateObject )(
+ ID3D12Device10 * This,
+ const D3D12_STATE_OBJECT_DESC *pAddition,
+ ID3D12StateObject *pStateObjectToGrowFrom,
+ REFIID riid,
+ _COM_Outptr_ void **ppNewStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )(
+ ID3D12Device10 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )(
+ ID3D12Device10 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )(
+ ID3D12Device10 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )(
+ ID3D12Device10 * This,
+ _In_opt_ ID3D12Resource *pTargetedResource,
+ _In_opt_ ID3D12Resource *pFeedbackResource,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1)
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession)
+ HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl)
+ HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )(
+ ID3D12Device10 * This,
+ D3D12_SHADER_CACHE_KIND_FLAGS Kinds,
+ D3D12_SHADER_CACHE_CONTROL_FLAGS Control);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID CreatorID,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue);
+
+ DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )(
+ ID3D12Device10 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )(
+ ID3D12Device10 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ END_INTERFACE
+ } ID3D12Device10Vtbl;
+
+ interface ID3D12Device10
+ {
+ CONST_VTBL struct ID3D12Device10Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Device10_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Device10_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Device10_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Device10_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Device10_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Device10_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Device10_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12Device10_GetNodeCount(This) \
+ ( (This)->lpVtbl -> GetNodeCount(This) )
+
+#define ID3D12Device10_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \
+ ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) )
+
+#define ID3D12Device10_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \
+ ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) )
+
+#define ID3D12Device10_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device10_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device10_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) )
+
+#define ID3D12Device10_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D12Device10_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) )
+
+#define ID3D12Device10_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \
+ ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) )
+
+#define ID3D12Device10_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \
+ ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) )
+
+#define ID3D12Device10_CreateConstantBufferView(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device10_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device10_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device10_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device10_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device10_CreateSampler(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device10_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) )
+
+#define ID3D12Device10_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
+
+#define ID3D12Device10_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device10_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
+
+#define ID3D12Device10_GetCustomHeapProperties(This,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device10_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
+
+#define ID3D12Device10_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
+
+#define ID3D12Device10_CreateHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device10_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device10_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device10_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \
+ ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) )
+
+#define ID3D12Device10_OpenSharedHandle(This,NTHandle,riid,ppvObj) \
+ ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) )
+
+#define ID3D12Device10_OpenSharedHandleByName(This,Name,Access,pNTHandle) \
+ ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) )
+
+#define ID3D12Device10_MakeResident(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) )
+
+#define ID3D12Device10_Evict(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) )
+
+#define ID3D12Device10_CreateFence(This,InitialValue,Flags,riid,ppFence) \
+ ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) )
+
+#define ID3D12Device10_GetDeviceRemovedReason(This) \
+ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) )
+
+#define ID3D12Device10_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+#define ID3D12Device10_CreateQueryHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device10_SetStablePowerState(This,Enable) \
+ ( (This)->lpVtbl -> SetStablePowerState(This,Enable) )
+
+#define ID3D12Device10_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \
+ ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) )
+
+#define ID3D12Device10_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
+ ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
+
+#define ID3D12Device10_GetAdapterLuid(This) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device10_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
+
+
+#define ID3D12Device10_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \
+ ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) )
+
+#define ID3D12Device10_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \
+ ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) )
+
+#define ID3D12Device10_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \
+ ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) )
+
+
+#define ID3D12Device10_CreatePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) )
+
+
+#define ID3D12Device10_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) )
+
+#define ID3D12Device10_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) )
+
+#define ID3D12Device10_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \
+ ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) )
+
+
+#define ID3D12Device10_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) )
+
+#define ID3D12Device10_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) )
+
+#define ID3D12Device10_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) )
+
+#define ID3D12Device10_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) )
+
+#define ID3D12Device10_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) )
+#if !defined(_WIN32)
+
+#define ID3D12Device10_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device10_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
+
+
+#define ID3D12Device10_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \
+ ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) )
+
+#define ID3D12Device10_RemoveDevice(This) \
+ ( (This)->lpVtbl -> RemoveDevice(This) )
+
+#define ID3D12Device10_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) )
+
+#define ID3D12Device10_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) )
+
+#define ID3D12Device10_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \
+ ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) )
+
+#define ID3D12Device10_CreateStateObject(This,pDesc,riid,ppStateObject) \
+ ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) )
+
+#define ID3D12Device10_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \
+ ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) )
+
+#define ID3D12Device10_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \
+ ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) )
+
+
+#define ID3D12Device10_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \
+ ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) )
+
+
+#define ID3D12Device10_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \
+ ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) )
+
+#define ID3D12Device10_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) )
+
+#if !defined(_WIN32)
+
+#define ID3D12Device10_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device10_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
+
+#define ID3D12Device10_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) )
+
+#define ID3D12Device10_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device10_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) )
+
+#define ID3D12Device10_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+
+#define ID3D12Device10_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \
+ ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) )
+
+#define ID3D12Device10_ShaderCacheControl(This,Kinds,Control) \
+ ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) )
+
+#define ID3D12Device10_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \
+ ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) )
+
+
+#define ID3D12Device10_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) )
+
+#define ID3D12Device10_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) )
+
+#define ID3D12Device10_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Device10_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Device11_INTERFACE_DEFINED__
+#define __ID3D12Device11_INTERFACE_DEFINED__
+
+/* interface ID3D12Device11 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Device11;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("5405c344-d457-444e-b4dd-2366e45aee39")
+ ID3D12Device11 : public ID3D12Device10
+ {
+ public:
+ virtual void STDMETHODCALLTYPE CreateSampler2(
+ _In_ const D3D12_SAMPLER_DESC2 *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Device11Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Device11 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Device11 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Device11 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12Device11 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12Device11 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12Device11 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12Device11 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetNodeCount)
+ UINT ( STDMETHODCALLTYPE *GetNodeCount )(
+ ID3D12Device11 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandQueue)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandAllocator)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandAllocator )(
+ ID3D12Device11 * This,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateGraphicsPipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateGraphicsPipelineState )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_GRAPHICS_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateComputePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreateComputePipelineState )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_COMPUTE_PIPELINE_STATE_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandList)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList )(
+ ID3D12Device11 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ ID3D12CommandAllocator *pCommandAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CheckFeatureSupport)
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D12Device11 * This,
+ D3D12_FEATURE Feature,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDescriptorHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateDescriptorHeap )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_DESCRIPTOR_HEAP_DESC *pDescriptorHeapDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDescriptorHandleIncrementSize)
+ UINT ( STDMETHODCALLTYPE *GetDescriptorHandleIncrementSize )(
+ ID3D12Device11 * This,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRootSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateRootSignature )(
+ ID3D12Device11 * This,
+ _In_ UINT nodeMask,
+ _In_reads_(blobLengthInBytes) const void *pBlobWithRootSignature,
+ _In_ SIZE_T blobLengthInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppvRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateConstantBufferView)
+ void ( STDMETHODCALLTYPE *CreateConstantBufferView )(
+ ID3D12Device11 * This,
+ _In_opt_ const D3D12_CONSTANT_BUFFER_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateShaderResourceView)
+ void ( STDMETHODCALLTYPE *CreateShaderResourceView )(
+ ID3D12Device11 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_SHADER_RESOURCE_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *CreateUnorderedAccessView )(
+ ID3D12Device11 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ ID3D12Resource *pCounterResource,
+ _In_opt_ const D3D12_UNORDERED_ACCESS_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateRenderTargetView)
+ void ( STDMETHODCALLTYPE *CreateRenderTargetView )(
+ ID3D12Device11 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_RENDER_TARGET_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateDepthStencilView)
+ void ( STDMETHODCALLTYPE *CreateDepthStencilView )(
+ ID3D12Device11 * This,
+ _In_opt_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DEPTH_STENCIL_VIEW_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSampler)
+ void ( STDMETHODCALLTYPE *CreateSampler )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_SAMPLER_DESC *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptors)
+ void ( STDMETHODCALLTYPE *CopyDescriptors )(
+ ID3D12Device11 * This,
+ _In_ UINT NumDestDescriptorRanges,
+ _In_reads_(NumDestDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pDestDescriptorRangeStarts,
+ _In_reads_opt_(NumDestDescriptorRanges) const UINT *pDestDescriptorRangeSizes,
+ _In_ UINT NumSrcDescriptorRanges,
+ _In_reads_(NumSrcDescriptorRanges) const D3D12_CPU_DESCRIPTOR_HANDLE *pSrcDescriptorRangeStarts,
+ _In_reads_opt_(NumSrcDescriptorRanges) const UINT *pSrcDescriptorRangeSizes,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CopyDescriptorsSimple)
+ void ( STDMETHODCALLTYPE *CopyDescriptorsSimple )(
+ ID3D12Device11 * This,
+ _In_ UINT NumDescriptors,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptorRangeStart,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE SrcDescriptorRangeStart,
+ _In_ D3D12_DESCRIPTOR_HEAP_TYPE DescriptorHeapsType);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceAllocationInfo)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device11 * This,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo )(
+ ID3D12Device11 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ _In_ UINT visibleMask,
+ _In_ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCustomHeapProperties)
+#if !defined(_WIN32)
+ D3D12_HEAP_PROPERTIES ( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device11 * This,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#else
+ D3D12_HEAP_PROPERTIES *( STDMETHODCALLTYPE *GetCustomHeapProperties )(
+ ID3D12Device11 * This,
+ D3D12_HEAP_PROPERTIES * RetVal,
+ _In_ UINT nodeMask,
+ D3D12_HEAP_TYPE heapType);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommittedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreatePlacedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource )(
+ ID3D12Device11 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateReservedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *CreateSharedHandle )(
+ ID3D12Device11 * This,
+ _In_ ID3D12DeviceChild *pObject,
+ _In_opt_ const SECURITY_ATTRIBUTES *pAttributes,
+ DWORD Access,
+ _In_opt_ LPCWSTR Name,
+ _Out_ HANDLE *pHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandle)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandle )(
+ ID3D12Device11 * This,
+ _In_ HANDLE NTHandle,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvObj);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, OpenSharedHandleByName)
+ HRESULT ( STDMETHODCALLTYPE *OpenSharedHandleByName )(
+ ID3D12Device11 * This,
+ _In_ LPCWSTR Name,
+ DWORD Access,
+ /* [annotation][out] */
+ _Out_ HANDLE *pNTHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, MakeResident)
+ HRESULT ( STDMETHODCALLTYPE *MakeResident )(
+ ID3D12Device11 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, Evict)
+ HRESULT ( STDMETHODCALLTYPE *Evict )(
+ ID3D12Device11 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateFence)
+ HRESULT ( STDMETHODCALLTYPE *CreateFence )(
+ ID3D12Device11 * This,
+ UINT64 InitialValue,
+ D3D12_FENCE_FLAGS Flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppFence);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetDeviceRemovedReason)
+ HRESULT ( STDMETHODCALLTYPE *GetDeviceRemovedReason )(
+ ID3D12Device11 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetCopyableFootprints)
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_RESOURCE_DESC *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateQueryHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateQueryHeap )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_QUERY_HEAP_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, SetStablePowerState)
+ HRESULT ( STDMETHODCALLTYPE *SetStablePowerState )(
+ ID3D12Device11 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, CreateCommandSignature)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandSignature )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_COMMAND_SIGNATURE_DESC *pDesc,
+ _In_opt_ ID3D12RootSignature *pRootSignature,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvCommandSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetResourceTiling)
+ void ( STDMETHODCALLTYPE *GetResourceTiling )(
+ ID3D12Device11 * This,
+ _In_ ID3D12Resource *pTiledResource,
+ _Out_opt_ UINT *pNumTilesForEntireResource,
+ _Out_opt_ D3D12_PACKED_MIP_INFO *pPackedMipDesc,
+ _Out_opt_ D3D12_TILE_SHAPE *pStandardTileShapeForNonPackedMips,
+ _Inout_opt_ UINT *pNumSubresourceTilings,
+ _In_ UINT FirstSubresourceTilingToGet,
+ _Out_writes_(*pNumSubresourceTilings) D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips);
+
+ DECLSPEC_XFGVIRT(ID3D12Device, GetAdapterLuid)
+#if !defined(_WIN32)
+ LUID ( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device11 * This);
+
+#else
+ LUID *( STDMETHODCALLTYPE *GetAdapterLuid )(
+ ID3D12Device11 * This,
+ LUID * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, CreatePipelineLibrary)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineLibrary )(
+ ID3D12Device11 * This,
+ _In_reads_(BlobLength) const void *pLibraryBlob,
+ SIZE_T BlobLength,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineLibrary);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetEventOnMultipleFenceCompletion)
+ HRESULT ( STDMETHODCALLTYPE *SetEventOnMultipleFenceCompletion )(
+ ID3D12Device11 * This,
+ _In_reads_(NumFences) ID3D12Fence *const *ppFences,
+ _In_reads_(NumFences) const UINT64 *pFenceValues,
+ UINT NumFences,
+ D3D12_MULTIPLE_FENCE_WAIT_FLAGS Flags,
+ HANDLE hEvent);
+
+ DECLSPEC_XFGVIRT(ID3D12Device1, SetResidencyPriority)
+ HRESULT ( STDMETHODCALLTYPE *SetResidencyPriority )(
+ ID3D12Device11 * This,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_reads_(NumObjects) const D3D12_RESIDENCY_PRIORITY *pPriorities);
+
+ DECLSPEC_XFGVIRT(ID3D12Device2, CreatePipelineState)
+ HRESULT ( STDMETHODCALLTYPE *CreatePipelineState )(
+ ID3D12Device11 * This,
+ const D3D12_PIPELINE_STATE_STREAM_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromAddress)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromAddress )(
+ ID3D12Device11 * This,
+ _In_ const void *pAddress,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, OpenExistingHeapFromFileMapping)
+ HRESULT ( STDMETHODCALLTYPE *OpenExistingHeapFromFileMapping )(
+ ID3D12Device11 * This,
+ _In_ HANDLE hFileMapping,
+ REFIID riid,
+ _COM_Outptr_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device3, EnqueueMakeResident)
+ HRESULT ( STDMETHODCALLTYPE *EnqueueMakeResident )(
+ ID3D12Device11 * This,
+ D3D12_RESIDENCY_FLAGS Flags,
+ UINT NumObjects,
+ _In_reads_(NumObjects) ID3D12Pageable *const *ppObjects,
+ _In_ ID3D12Fence *pFenceToSignal,
+ UINT64 FenceValueToSignal);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommandList1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandList1 )(
+ ID3D12Device11 * This,
+ _In_ UINT nodeMask,
+ _In_ D3D12_COMMAND_LIST_TYPE type,
+ _In_ D3D12_COMMAND_LIST_FLAGS flags,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateCommittedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource1 )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateHeap1)
+ HRESULT ( STDMETHODCALLTYPE *CreateHeap1 )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_HEAP_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, CreateReservedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource1 )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device4, GetResourceAllocationInfo1)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device11 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo1 )(
+ ID3D12Device11 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateLifetimeTracker)
+ HRESULT ( STDMETHODCALLTYPE *CreateLifetimeTracker )(
+ ID3D12Device11 * This,
+ _In_ ID3D12LifetimeOwner *pOwner,
+ REFIID riid,
+ _COM_Outptr_ void **ppvTracker);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, RemoveDevice)
+ void ( STDMETHODCALLTYPE *RemoveDevice )(
+ ID3D12Device11 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommands)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )(
+ ID3D12Device11 * This,
+ _Inout_ UINT *pNumMetaCommands,
+ _Out_writes_opt_(*pNumMetaCommands) D3D12_META_COMMAND_DESC *pDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, EnumerateMetaCommandParameters)
+ HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandParameters )(
+ ID3D12Device11 * This,
+ _In_ REFGUID CommandId,
+ _In_ D3D12_META_COMMAND_PARAMETER_STAGE Stage,
+ _Out_opt_ UINT *pTotalStructureSizeInBytes,
+ _Inout_ UINT *pParameterCount,
+ _Out_writes_opt_(*pParameterCount) D3D12_META_COMMAND_PARAMETER_DESC *pParameterDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateMetaCommand)
+ HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )(
+ ID3D12Device11 * This,
+ _In_ REFGUID CommandId,
+ _In_ UINT NodeMask,
+ _In_reads_bytes_opt_(CreationParametersDataSizeInBytes) const void *pCreationParametersData,
+ _In_ SIZE_T CreationParametersDataSizeInBytes,
+ REFIID riid,
+ _COM_Outptr_ void **ppMetaCommand);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CreateStateObject)
+ HRESULT ( STDMETHODCALLTYPE *CreateStateObject )(
+ ID3D12Device11 * This,
+ const D3D12_STATE_OBJECT_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_ void **ppStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, GetRaytracingAccelerationStructurePrebuildInfo)
+ void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INPUTS *pDesc,
+ _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo);
+
+ DECLSPEC_XFGVIRT(ID3D12Device5, CheckDriverMatchingIdentifier)
+ D3D12_DRIVER_MATCHING_IDENTIFIER_STATUS ( STDMETHODCALLTYPE *CheckDriverMatchingIdentifier )(
+ ID3D12Device11 * This,
+ _In_ D3D12_SERIALIZED_DATA_TYPE SerializedDataType,
+ _In_ const D3D12_SERIALIZED_DATA_DRIVER_MATCHING_IDENTIFIER *pIdentifierToCheck);
+
+ DECLSPEC_XFGVIRT(ID3D12Device6, SetBackgroundProcessingMode)
+ HRESULT ( STDMETHODCALLTYPE *SetBackgroundProcessingMode )(
+ ID3D12Device11 * This,
+ D3D12_BACKGROUND_PROCESSING_MODE Mode,
+ D3D12_MEASUREMENTS_ACTION MeasurementsAction,
+ _In_opt_ HANDLE hEventToSignalUponCompletion,
+ _Out_opt_ BOOL *pbFurtherMeasurementsDesired);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, AddToStateObject)
+ HRESULT ( STDMETHODCALLTYPE *AddToStateObject )(
+ ID3D12Device11 * This,
+ const D3D12_STATE_OBJECT_DESC *pAddition,
+ ID3D12StateObject *pStateObjectToGrowFrom,
+ REFIID riid,
+ _COM_Outptr_ void **ppNewStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12Device7, CreateProtectedResourceSession1)
+ HRESULT ( STDMETHODCALLTYPE *CreateProtectedResourceSession1 )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_PROTECTED_RESOURCE_SESSION_DESC1 *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, GetResourceAllocationInfo2)
+#if !defined(_WIN32)
+ D3D12_RESOURCE_ALLOCATION_INFO ( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )(
+ ID3D12Device11 * This,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#else
+ D3D12_RESOURCE_ALLOCATION_INFO *( STDMETHODCALLTYPE *GetResourceAllocationInfo2 )(
+ ID3D12Device11 * This,
+ D3D12_RESOURCE_ALLOCATION_INFO * RetVal,
+ UINT visibleMask,
+ UINT numResourceDescs,
+ _In_reads_(numResourceDescs) const D3D12_RESOURCE_DESC1 *pResourceDescs,
+ _Out_writes_opt_(numResourceDescs) D3D12_RESOURCE_ALLOCATION_INFO1 *pResourceAllocationInfo1);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreateCommittedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource2 )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreatePlacedResource1)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource1 )(
+ ID3D12Device11 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_RESOURCE_STATES InitialState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, CreateSamplerFeedbackUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *CreateSamplerFeedbackUnorderedAccessView )(
+ ID3D12Device11 * This,
+ _In_opt_ ID3D12Resource *pTargetedResource,
+ _In_opt_ ID3D12Resource *pFeedbackResource,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12Device8, GetCopyableFootprints1)
+ void ( STDMETHODCALLTYPE *GetCopyableFootprints1 )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_RESOURCE_DESC1 *pResourceDesc,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
+ _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
+ UINT64 BaseOffset,
+ _Out_writes_opt_(NumSubresources) D3D12_PLACED_SUBRESOURCE_FOOTPRINT *pLayouts,
+ _Out_writes_opt_(NumSubresources) UINT *pNumRows,
+ _Out_writes_opt_(NumSubresources) UINT64 *pRowSizeInBytes,
+ _Out_opt_ UINT64 *pTotalBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, CreateShaderCacheSession)
+ HRESULT ( STDMETHODCALLTYPE *CreateShaderCacheSession )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_SHADER_CACHE_SESSION_DESC *pDesc,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvSession);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, ShaderCacheControl)
+ HRESULT ( STDMETHODCALLTYPE *ShaderCacheControl )(
+ ID3D12Device11 * This,
+ D3D12_SHADER_CACHE_KIND_FLAGS Kinds,
+ D3D12_SHADER_CACHE_CONTROL_FLAGS Control);
+
+ DECLSPEC_XFGVIRT(ID3D12Device9, CreateCommandQueue1)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommandQueue1 )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_COMMAND_QUEUE_DESC *pDesc,
+ REFIID CreatorID,
+ REFIID riid,
+ _COM_Outptr_ void **ppCommandQueue);
+
+ DECLSPEC_XFGVIRT(ID3D12Device10, CreateCommittedResource3)
+ HRESULT ( STDMETHODCALLTYPE *CreateCommittedResource3 )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ REFIID riidResource,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device10, CreatePlacedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreatePlacedResource2 )(
+ ID3D12Device11 * This,
+ _In_ ID3D12Heap *pHeap,
+ UINT64 HeapOffset,
+ _In_ const D3D12_RESOURCE_DESC1 *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device10, CreateReservedResource2)
+ HRESULT ( STDMETHODCALLTYPE *CreateReservedResource2 )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_BARRIER_LAYOUT InitialLayout,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedSession,
+ UINT32 NumCastableFormats,
+ _In_opt_count_(NumCastableFormats) DXGI_FORMAT *pCastableFormats,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvResource);
+
+ DECLSPEC_XFGVIRT(ID3D12Device11, CreateSampler2)
+ void ( STDMETHODCALLTYPE *CreateSampler2 )(
+ ID3D12Device11 * This,
+ _In_ const D3D12_SAMPLER_DESC2 *pDesc,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DestDescriptor);
+
+ END_INTERFACE
+ } ID3D12Device11Vtbl;
+
+ interface ID3D12Device11
+ {
+ CONST_VTBL struct ID3D12Device11Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Device11_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Device11_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Device11_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Device11_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12Device11_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12Device11_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12Device11_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12Device11_GetNodeCount(This) \
+ ( (This)->lpVtbl -> GetNodeCount(This) )
+
+#define ID3D12Device11_CreateCommandQueue(This,pDesc,riid,ppCommandQueue) \
+ ( (This)->lpVtbl -> CreateCommandQueue(This,pDesc,riid,ppCommandQueue) )
+
+#define ID3D12Device11_CreateCommandAllocator(This,type,riid,ppCommandAllocator) \
+ ( (This)->lpVtbl -> CreateCommandAllocator(This,type,riid,ppCommandAllocator) )
+
+#define ID3D12Device11_CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateGraphicsPipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device11_CreateComputePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreateComputePipelineState(This,pDesc,riid,ppPipelineState) )
+
+#define ID3D12Device11_CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList(This,nodeMask,type,pCommandAllocator,pInitialState,riid,ppCommandList) )
+
+#define ID3D12Device11_CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,Feature,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D12Device11_CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateDescriptorHeap(This,pDescriptorHeapDesc,riid,ppvHeap) )
+
+#define ID3D12Device11_GetDescriptorHandleIncrementSize(This,DescriptorHeapType) \
+ ( (This)->lpVtbl -> GetDescriptorHandleIncrementSize(This,DescriptorHeapType) )
+
+#define ID3D12Device11_CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) \
+ ( (This)->lpVtbl -> CreateRootSignature(This,nodeMask,pBlobWithRootSignature,blobLengthInBytes,riid,ppvRootSignature) )
+
+#define ID3D12Device11_CreateConstantBufferView(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateConstantBufferView(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device11_CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateShaderResourceView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device11_CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateUnorderedAccessView(This,pResource,pCounterResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device11_CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateRenderTargetView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device11_CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateDepthStencilView(This,pResource,pDesc,DestDescriptor) )
+
+#define ID3D12Device11_CreateSampler(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSampler(This,pDesc,DestDescriptor) )
+
+#define ID3D12Device11_CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptors(This,NumDestDescriptorRanges,pDestDescriptorRangeStarts,pDestDescriptorRangeSizes,NumSrcDescriptorRanges,pSrcDescriptorRangeStarts,pSrcDescriptorRangeSizes,DescriptorHeapsType) )
+
+#define ID3D12Device11_CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) \
+ ( (This)->lpVtbl -> CopyDescriptorsSimple(This,NumDescriptors,DestDescriptorRangeStart,SrcDescriptorRangeStart,DescriptorHeapsType) )
+#if !defined(_WIN32)
+
+#define ID3D12Device11_GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,visibleMask,numResourceDescs,pResourceDescs) )
+#else
+#define ID3D12Device11_GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo(This,RetVal,visibleMask,numResourceDescs,pResourceDescs) )
+#endif
+#if !defined(_WIN32)
+
+#define ID3D12Device11_GetCustomHeapProperties(This,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,nodeMask,heapType) )
+#else
+#define ID3D12Device11_GetCustomHeapProperties(This,RetVal,nodeMask,heapType) \
+ ( (This)->lpVtbl -> GetCustomHeapProperties(This,RetVal,nodeMask,heapType) )
+#endif
+
+#define ID3D12Device11_CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,riidResource,ppvResource) )
+
+#define ID3D12Device11_CreateHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device11_CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device11_CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource(This,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device11_CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) \
+ ( (This)->lpVtbl -> CreateSharedHandle(This,pObject,pAttributes,Access,Name,pHandle) )
+
+#define ID3D12Device11_OpenSharedHandle(This,NTHandle,riid,ppvObj) \
+ ( (This)->lpVtbl -> OpenSharedHandle(This,NTHandle,riid,ppvObj) )
+
+#define ID3D12Device11_OpenSharedHandleByName(This,Name,Access,pNTHandle) \
+ ( (This)->lpVtbl -> OpenSharedHandleByName(This,Name,Access,pNTHandle) )
+
+#define ID3D12Device11_MakeResident(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> MakeResident(This,NumObjects,ppObjects) )
+
+#define ID3D12Device11_Evict(This,NumObjects,ppObjects) \
+ ( (This)->lpVtbl -> Evict(This,NumObjects,ppObjects) )
+
+#define ID3D12Device11_CreateFence(This,InitialValue,Flags,riid,ppFence) \
+ ( (This)->lpVtbl -> CreateFence(This,InitialValue,Flags,riid,ppFence) )
+
+#define ID3D12Device11_GetDeviceRemovedReason(This) \
+ ( (This)->lpVtbl -> GetDeviceRemovedReason(This) )
+
+#define ID3D12Device11_GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+#define ID3D12Device11_CreateQueryHeap(This,pDesc,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateQueryHeap(This,pDesc,riid,ppvHeap) )
+
+#define ID3D12Device11_SetStablePowerState(This,Enable) \
+ ( (This)->lpVtbl -> SetStablePowerState(This,Enable) )
+
+#define ID3D12Device11_CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) \
+ ( (This)->lpVtbl -> CreateCommandSignature(This,pDesc,pRootSignature,riid,ppvCommandSignature) )
+
+#define ID3D12Device11_GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) \
+ ( (This)->lpVtbl -> GetResourceTiling(This,pTiledResource,pNumTilesForEntireResource,pPackedMipDesc,pStandardTileShapeForNonPackedMips,pNumSubresourceTilings,FirstSubresourceTilingToGet,pSubresourceTilingsForNonPackedMips) )
+#if !defined(_WIN32)
+
+#define ID3D12Device11_GetAdapterLuid(This) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This) )
+#else
+#define ID3D12Device11_GetAdapterLuid(This,RetVal) \
+ ( (This)->lpVtbl -> GetAdapterLuid(This,RetVal) )
+#endif
+
+
+#define ID3D12Device11_CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) \
+ ( (This)->lpVtbl -> CreatePipelineLibrary(This,pLibraryBlob,BlobLength,riid,ppPipelineLibrary) )
+
+#define ID3D12Device11_SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) \
+ ( (This)->lpVtbl -> SetEventOnMultipleFenceCompletion(This,ppFences,pFenceValues,NumFences,Flags,hEvent) )
+
+#define ID3D12Device11_SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) \
+ ( (This)->lpVtbl -> SetResidencyPriority(This,NumObjects,ppObjects,pPriorities) )
+
+
+#define ID3D12Device11_CreatePipelineState(This,pDesc,riid,ppPipelineState) \
+ ( (This)->lpVtbl -> CreatePipelineState(This,pDesc,riid,ppPipelineState) )
+
+
+#define ID3D12Device11_OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromAddress(This,pAddress,riid,ppvHeap) )
+
+#define ID3D12Device11_OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) \
+ ( (This)->lpVtbl -> OpenExistingHeapFromFileMapping(This,hFileMapping,riid,ppvHeap) )
+
+#define ID3D12Device11_EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) \
+ ( (This)->lpVtbl -> EnqueueMakeResident(This,Flags,NumObjects,ppObjects,pFenceToSignal,FenceValueToSignal) )
+
+
+#define ID3D12Device11_CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) \
+ ( (This)->lpVtbl -> CreateCommandList1(This,nodeMask,type,flags,riid,ppCommandList) )
+
+#define ID3D12Device11_CreateProtectedResourceSession(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession(This,pDesc,riid,ppSession) )
+
+#define ID3D12Device11_CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource1(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) )
+
+#define ID3D12Device11_CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) \
+ ( (This)->lpVtbl -> CreateHeap1(This,pDesc,pProtectedSession,riid,ppvHeap) )
+
+#define ID3D12Device11_CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource1(This,pDesc,InitialState,pOptimizedClearValue,pProtectedSession,riid,ppvResource) )
+#if !defined(_WIN32)
+
+#define ID3D12Device11_GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device11_GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo1(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
+
+
+#define ID3D12Device11_CreateLifetimeTracker(This,pOwner,riid,ppvTracker) \
+ ( (This)->lpVtbl -> CreateLifetimeTracker(This,pOwner,riid,ppvTracker) )
+
+#define ID3D12Device11_RemoveDevice(This) \
+ ( (This)->lpVtbl -> RemoveDevice(This) )
+
+#define ID3D12Device11_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) )
+
+#define ID3D12Device11_EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) \
+ ( (This)->lpVtbl -> EnumerateMetaCommandParameters(This,CommandId,Stage,pTotalStructureSizeInBytes,pParameterCount,pParameterDescs) )
+
+#define ID3D12Device11_CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) \
+ ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,NodeMask,pCreationParametersData,CreationParametersDataSizeInBytes,riid,ppMetaCommand) )
+
+#define ID3D12Device11_CreateStateObject(This,pDesc,riid,ppStateObject) \
+ ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) )
+
+#define ID3D12Device11_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \
+ ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) )
+
+#define ID3D12Device11_CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) \
+ ( (This)->lpVtbl -> CheckDriverMatchingIdentifier(This,SerializedDataType,pIdentifierToCheck) )
+
+
+#define ID3D12Device11_SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) \
+ ( (This)->lpVtbl -> SetBackgroundProcessingMode(This,Mode,MeasurementsAction,hEventToSignalUponCompletion,pbFurtherMeasurementsDesired) )
+
+
+#define ID3D12Device11_AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) \
+ ( (This)->lpVtbl -> AddToStateObject(This,pAddition,pStateObjectToGrowFrom,riid,ppNewStateObject) )
+
+#define ID3D12Device11_CreateProtectedResourceSession1(This,pDesc,riid,ppSession) \
+ ( (This)->lpVtbl -> CreateProtectedResourceSession1(This,pDesc,riid,ppSession) )
+
+#if !defined(_WIN32)
+
+#define ID3D12Device11_GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#else
+#define ID3D12Device11_GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) \
+ ( (This)->lpVtbl -> GetResourceAllocationInfo2(This,RetVal,visibleMask,numResourceDescs,pResourceDescs,pResourceAllocationInfo1) )
+#endif
+
+#define ID3D12Device11_CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource2(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pProtectedSession,riidResource,ppvResource) )
+
+#define ID3D12Device11_CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource1(This,pHeap,HeapOffset,pDesc,InitialState,pOptimizedClearValue,riid,ppvResource) )
+
+#define ID3D12Device11_CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSamplerFeedbackUnorderedAccessView(This,pTargetedResource,pFeedbackResource,DestDescriptor) )
+
+#define ID3D12Device11_GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) \
+ ( (This)->lpVtbl -> GetCopyableFootprints1(This,pResourceDesc,FirstSubresource,NumSubresources,BaseOffset,pLayouts,pNumRows,pRowSizeInBytes,pTotalBytes) )
+
+
+#define ID3D12Device11_CreateShaderCacheSession(This,pDesc,riid,ppvSession) \
+ ( (This)->lpVtbl -> CreateShaderCacheSession(This,pDesc,riid,ppvSession) )
+
+#define ID3D12Device11_ShaderCacheControl(This,Kinds,Control) \
+ ( (This)->lpVtbl -> ShaderCacheControl(This,Kinds,Control) )
+
+#define ID3D12Device11_CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) \
+ ( (This)->lpVtbl -> CreateCommandQueue1(This,pDesc,CreatorID,riid,ppCommandQueue) )
+
+
+#define ID3D12Device11_CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) \
+ ( (This)->lpVtbl -> CreateCommittedResource3(This,pHeapProperties,HeapFlags,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riidResource,ppvResource) )
+
+#define ID3D12Device11_CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreatePlacedResource2(This,pHeap,HeapOffset,pDesc,InitialLayout,pOptimizedClearValue,NumCastableFormats,pCastableFormats,riid,ppvResource) )
+
+#define ID3D12Device11_CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) \
+ ( (This)->lpVtbl -> CreateReservedResource2(This,pDesc,InitialLayout,pOptimizedClearValue,pProtectedSession,NumCastableFormats,pCastableFormats,riid,ppvResource) )
+
+
+#define ID3D12Device11_CreateSampler2(This,pDesc,DestDescriptor) \
+ ( (This)->lpVtbl -> CreateSampler2(This,pDesc,DestDescriptor) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Device11_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__
+#define __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__
+
+/* interface ID3D12VirtualizationGuestDevice */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VirtualizationGuestDevice;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("bc66d368-7373-4943-8757-fc87dc79e476")
+ ID3D12VirtualizationGuestDevice : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE ShareWithHost(
+ _In_ ID3D12DeviceChild *pObject,
+ _Out_ HANDLE *pHandle) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateFenceFd(
+ _In_ ID3D12Fence *pFence,
+ UINT64 FenceValue,
+ _Out_ int *pFenceFd) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VirtualizationGuestDeviceVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VirtualizationGuestDevice * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VirtualizationGuestDevice * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VirtualizationGuestDevice * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VirtualizationGuestDevice, ShareWithHost)
+ HRESULT ( STDMETHODCALLTYPE *ShareWithHost )(
+ ID3D12VirtualizationGuestDevice * This,
+ _In_ ID3D12DeviceChild *pObject,
+ _Out_ HANDLE *pHandle);
+
+ DECLSPEC_XFGVIRT(ID3D12VirtualizationGuestDevice, CreateFenceFd)
+ HRESULT ( STDMETHODCALLTYPE *CreateFenceFd )(
+ ID3D12VirtualizationGuestDevice * This,
+ _In_ ID3D12Fence *pFence,
+ UINT64 FenceValue,
+ _Out_ int *pFenceFd);
+
+ END_INTERFACE
+ } ID3D12VirtualizationGuestDeviceVtbl;
+
+ interface ID3D12VirtualizationGuestDevice
+ {
+ CONST_VTBL struct ID3D12VirtualizationGuestDeviceVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VirtualizationGuestDevice_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VirtualizationGuestDevice_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VirtualizationGuestDevice_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VirtualizationGuestDevice_ShareWithHost(This,pObject,pHandle) \
+ ( (This)->lpVtbl -> ShareWithHost(This,pObject,pHandle) )
+
+#define ID3D12VirtualizationGuestDevice_CreateFenceFd(This,pFence,FenceValue,pFenceFd) \
+ ( (This)->lpVtbl -> CreateFenceFd(This,pFence,FenceValue,pFenceFd) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VirtualizationGuestDevice_INTERFACE_DEFINED__ */
+
+
#ifndef __ID3D12Tools_INTERFACE_DEFINED__
#define __ID3D12Tools_INTERFACE_DEFINED__
@@ -16190,21 +24424,26 @@ EXTERN_C const IID IID_ID3D12Tools;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12Tools * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12Tools * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12Tools * This);
+ DECLSPEC_XFGVIRT(ID3D12Tools, EnableShaderInstrumentation)
void ( STDMETHODCALLTYPE *EnableShaderInstrumentation )(
ID3D12Tools * This,
BOOL bEnable);
+ DECLSPEC_XFGVIRT(ID3D12Tools, ShaderInstrumentationEnabled)
BOOL ( STDMETHODCALLTYPE *ShaderInstrumentationEnabled )(
ID3D12Tools * This);
@@ -16248,7 +24487,7 @@ EXTERN_C const IID IID_ID3D12Tools;
#endif /* __ID3D12Tools_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12_0000_0044 */
+/* interface __MIDL_itf_d3d12_0000_0057 */
/* [local] */
typedef struct D3D12_SUBRESOURCE_DATA
@@ -16331,9 +24570,9 @@ HRESULT WINAPI D3D12GetDebugInterface( _In_ REFIID riid, _COM_Outptr_opt_ void**
// --------------------------------------------------------------------------------------------------------------------------------
HRESULT WINAPI D3D12EnableExperimentalFeatures(
UINT NumFeatures,
- __in_ecount(NumFeatures) const IID* pIIDs,
- __in_ecount_opt(NumFeatures) void* pConfigurationStructs,
- __in_ecount_opt(NumFeatures) UINT* pConfigurationStructSizes);
+ _In_count_(NumFeatures) const IID* pIIDs,
+ _In_opt_count_(NumFeatures) void* pConfigurationStructs,
+ _In_opt_count_(NumFeatures) UINT* pConfigurationStructSizes);
// --------------------------------------------------------------------------------------------------------------------------------
// Experimental Feature: D3D12ExperimentalShaderModels
@@ -16366,33 +24605,577 @@ static const UUID D3D12TiledResourceTier4 = { /* c9c4725f-a81a-4f56-8c5b-c51039d
{ 0x8c, 0x5b, 0xc5, 0x10, 0x39, 0xd6, 0x94, 0xfb }
};
// --------------------------------------------------------------------------------------------------------------------------------
-// Experimental Feature: D3D12MetaCommand
+// D3D12GetInterface
//
-// Use with D3D12EnableExperimentalFeatures to enable the D3D12 Meta Command.
+// Retrieve Global D3D12 Interface.
//
-// Enabling D3D12MetaCommand needs no configuration struct, pass NULL in the pConfigurationStructs array.
-//
-// --------------------------------------------------------------------------------------------------------------------------------
-static const UUID D3D12MetaCommand = { /* C734C97E-8077-48C8-9FDC-D9D1DD31DD77 */
- 0xc734c97e,
- 0x8077,
- 0x48c8,
- { 0x9f, 0xdc, 0xd9, 0xd1, 0xdd, 0x31, 0xdd, 0x77 }
-};
-// --------------------------------------------------------------------------------------------------------------------------------
-// Experimental Feature: D3D12ComputeOnlyDevices
-//
-// Use with D3D12EnableExperimentalFeatures to enable compute only devices (D3D_FEATURE_LEVEL_1_0_CORE).
-//
-// Enabling D3D12ComputeOnlyDevices needs no configuration struct, pass NULL in the pConfigurationStructs array.
-//
-// --------------------------------------------------------------------------------------------------------------------------------
-static const UUID D3D12ComputeOnlyDevices = { /* 50f7ab08-4b6d-4e14-89a5-5d16cd272594 */
- 0x50f7ab08,
- 0x4b6d,
- 0x4e14,
- {0x89, 0xa5, 0x5d, 0x16, 0xcd, 0x27, 0x25, 0x94}
-};
+
+DEFINE_GUID(CLSID_D3D12Debug, 0xf2352aeb, 0xdd84, 0x49fe, 0xb9, 0x7b, 0xa9, 0xdc, 0xfd, 0xcc, 0x1b, 0x4f);
+DEFINE_GUID(CLSID_D3D12Tools, 0xe38216b1, 0x3c8c, 0x4833, 0xaa, 0x09, 0x0a, 0x06, 0xb6, 0x5d, 0x96, 0xc8);
+DEFINE_GUID(CLSID_D3D12DeviceRemovedExtendedData, 0x4a75bbc4, 0x9ff4, 0x4ad8, 0x9f, 0x18, 0xab, 0xae, 0x84, 0xdc, 0x5f, 0xf2);
+DEFINE_GUID(CLSID_D3D12SDKConfiguration, 0x7cda6aca, 0xa03e, 0x49c8, 0x94, 0x58, 0x03, 0x34, 0xd2, 0x0e, 0x07, 0xce);
+DEFINE_GUID(CLSID_D3D12DeviceFactory, 0x114863bf, 0xc386, 0x4aee, 0xb3, 0x9d, 0x8f, 0x0b, 0xbb, 0x06, 0x29, 0x55);
+
+typedef HRESULT (WINAPI* PFN_D3D12_GET_INTERFACE)( _In_ REFCLSID, _In_ REFIID, _COM_Outptr_opt_ void** );
+
+HRESULT WINAPI D3D12GetInterface( _In_ REFCLSID rclsid, _In_ REFIID riid, _COM_Outptr_opt_ void** ppvDebug );
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0057_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0057_v0_0_s_ifspec;
+
+#ifndef __ID3D12SDKConfiguration_INTERFACE_DEFINED__
+#define __ID3D12SDKConfiguration_INTERFACE_DEFINED__
+
+/* interface ID3D12SDKConfiguration */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12SDKConfiguration;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("e9eb5314-33aa-42b2-a718-d77f58b1f1c7")
+ ID3D12SDKConfiguration : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetSDKVersion(
+ UINT SDKVersion,
+ _In_z_ LPCSTR SDKPath) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12SDKConfigurationVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12SDKConfiguration * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12SDKConfiguration * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12SDKConfiguration * This);
+
+ DECLSPEC_XFGVIRT(ID3D12SDKConfiguration, SetSDKVersion)
+ HRESULT ( STDMETHODCALLTYPE *SetSDKVersion )(
+ ID3D12SDKConfiguration * This,
+ UINT SDKVersion,
+ _In_z_ LPCSTR SDKPath);
+
+ END_INTERFACE
+ } ID3D12SDKConfigurationVtbl;
+
+ interface ID3D12SDKConfiguration
+ {
+ CONST_VTBL struct ID3D12SDKConfigurationVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12SDKConfiguration_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12SDKConfiguration_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12SDKConfiguration_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12SDKConfiguration_SetSDKVersion(This,SDKVersion,SDKPath) \
+ ( (This)->lpVtbl -> SetSDKVersion(This,SDKVersion,SDKPath) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12SDKConfiguration_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12SDKConfiguration1_INTERFACE_DEFINED__
+#define __ID3D12SDKConfiguration1_INTERFACE_DEFINED__
+
+/* interface ID3D12SDKConfiguration1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12SDKConfiguration1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("8aaf9303-ad25-48b9-9a57-d9c37e009d9f")
+ ID3D12SDKConfiguration1 : public ID3D12SDKConfiguration
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CreateDeviceFactory(
+ UINT SDKVersion,
+ _In_ LPCSTR SDKPath,
+ REFIID riid,
+ _COM_Outptr_ void **ppvFactory) = 0;
+
+ virtual void STDMETHODCALLTYPE FreeUnusedSDKs( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12SDKConfiguration1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12SDKConfiguration1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12SDKConfiguration1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12SDKConfiguration1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12SDKConfiguration, SetSDKVersion)
+ HRESULT ( STDMETHODCALLTYPE *SetSDKVersion )(
+ ID3D12SDKConfiguration1 * This,
+ UINT SDKVersion,
+ _In_z_ LPCSTR SDKPath);
+
+ DECLSPEC_XFGVIRT(ID3D12SDKConfiguration1, CreateDeviceFactory)
+ HRESULT ( STDMETHODCALLTYPE *CreateDeviceFactory )(
+ ID3D12SDKConfiguration1 * This,
+ UINT SDKVersion,
+ _In_ LPCSTR SDKPath,
+ REFIID riid,
+ _COM_Outptr_ void **ppvFactory);
+
+ DECLSPEC_XFGVIRT(ID3D12SDKConfiguration1, FreeUnusedSDKs)
+ void ( STDMETHODCALLTYPE *FreeUnusedSDKs )(
+ ID3D12SDKConfiguration1 * This);
+
+ END_INTERFACE
+ } ID3D12SDKConfiguration1Vtbl;
+
+ interface ID3D12SDKConfiguration1
+ {
+ CONST_VTBL struct ID3D12SDKConfiguration1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12SDKConfiguration1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12SDKConfiguration1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12SDKConfiguration1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12SDKConfiguration1_SetSDKVersion(This,SDKVersion,SDKPath) \
+ ( (This)->lpVtbl -> SetSDKVersion(This,SDKVersion,SDKPath) )
+
+
+#define ID3D12SDKConfiguration1_CreateDeviceFactory(This,SDKVersion,SDKPath,riid,ppvFactory) \
+ ( (This)->lpVtbl -> CreateDeviceFactory(This,SDKVersion,SDKPath,riid,ppvFactory) )
+
+#define ID3D12SDKConfiguration1_FreeUnusedSDKs(This) \
+ ( (This)->lpVtbl -> FreeUnusedSDKs(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12SDKConfiguration1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12_0000_0059 */
+/* [local] */
+
+typedef
+enum D3D12_DEVICE_FACTORY_FLAGS
+ {
+ D3D12_DEVICE_FACTORY_FLAG_NONE = 0,
+ D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_EXISTING_DEVICE = 0x1,
+ D3D12_DEVICE_FACTORY_FLAG_ALLOW_RETURNING_INCOMPATIBLE_EXISTING_DEVICE = 0x2,
+ D3D12_DEVICE_FACTORY_FLAG_DISALLOW_STORING_NEW_DEVICE_AS_SINGLETON = 0x4
+ } D3D12_DEVICE_FACTORY_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FACTORY_FLAGS );
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0059_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0059_v0_0_s_ifspec;
+
+#ifndef __ID3D12DeviceFactory_INTERFACE_DEFINED__
+#define __ID3D12DeviceFactory_INTERFACE_DEFINED__
+
+/* interface ID3D12DeviceFactory */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DeviceFactory;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("61f307d3-d34e-4e7c-8374-3ba4de23cccb")
+ ID3D12DeviceFactory : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE InitializeFromGlobalState( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ApplyToGlobalState( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetFlags(
+ D3D12_DEVICE_FACTORY_FLAGS flags) = 0;
+
+ virtual D3D12_DEVICE_FACTORY_FLAGS STDMETHODCALLTYPE GetFlags( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetConfigurationInterface(
+ REFCLSID clsid,
+ REFIID iid,
+ _COM_Outptr_ void **ppv) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE EnableExperimentalFeatures(
+ UINT NumFeatures,
+ _In_reads_(NumFeatures) const IID *pIIDs,
+ _In_reads_opt_(NumFeatures) void *pConfigurationStructs,
+ _In_reads_opt_(NumFeatures) UINT *pConfigurationStructSizes) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateDevice(
+ _In_opt_ IUnknown *adapter,
+ D3D_FEATURE_LEVEL FeatureLevel,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DeviceFactoryVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DeviceFactory * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DeviceFactory * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DeviceFactory * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceFactory, InitializeFromGlobalState)
+ HRESULT ( STDMETHODCALLTYPE *InitializeFromGlobalState )(
+ ID3D12DeviceFactory * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceFactory, ApplyToGlobalState)
+ HRESULT ( STDMETHODCALLTYPE *ApplyToGlobalState )(
+ ID3D12DeviceFactory * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceFactory, SetFlags)
+ HRESULT ( STDMETHODCALLTYPE *SetFlags )(
+ ID3D12DeviceFactory * This,
+ D3D12_DEVICE_FACTORY_FLAGS flags);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceFactory, GetFlags)
+ D3D12_DEVICE_FACTORY_FLAGS ( STDMETHODCALLTYPE *GetFlags )(
+ ID3D12DeviceFactory * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceFactory, GetConfigurationInterface)
+ HRESULT ( STDMETHODCALLTYPE *GetConfigurationInterface )(
+ ID3D12DeviceFactory * This,
+ REFCLSID clsid,
+ REFIID iid,
+ _COM_Outptr_ void **ppv);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceFactory, EnableExperimentalFeatures)
+ HRESULT ( STDMETHODCALLTYPE *EnableExperimentalFeatures )(
+ ID3D12DeviceFactory * This,
+ UINT NumFeatures,
+ _In_reads_(NumFeatures) const IID *pIIDs,
+ _In_reads_opt_(NumFeatures) void *pConfigurationStructs,
+ _In_reads_opt_(NumFeatures) UINT *pConfigurationStructSizes);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceFactory, CreateDevice)
+ HRESULT ( STDMETHODCALLTYPE *CreateDevice )(
+ ID3D12DeviceFactory * This,
+ _In_opt_ IUnknown *adapter,
+ D3D_FEATURE_LEVEL FeatureLevel,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ END_INTERFACE
+ } ID3D12DeviceFactoryVtbl;
+
+ interface ID3D12DeviceFactory
+ {
+ CONST_VTBL struct ID3D12DeviceFactoryVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DeviceFactory_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DeviceFactory_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DeviceFactory_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DeviceFactory_InitializeFromGlobalState(This) \
+ ( (This)->lpVtbl -> InitializeFromGlobalState(This) )
+
+#define ID3D12DeviceFactory_ApplyToGlobalState(This) \
+ ( (This)->lpVtbl -> ApplyToGlobalState(This) )
+
+#define ID3D12DeviceFactory_SetFlags(This,flags) \
+ ( (This)->lpVtbl -> SetFlags(This,flags) )
+
+#define ID3D12DeviceFactory_GetFlags(This) \
+ ( (This)->lpVtbl -> GetFlags(This) )
+
+#define ID3D12DeviceFactory_GetConfigurationInterface(This,clsid,iid,ppv) \
+ ( (This)->lpVtbl -> GetConfigurationInterface(This,clsid,iid,ppv) )
+
+#define ID3D12DeviceFactory_EnableExperimentalFeatures(This,NumFeatures,pIIDs,pConfigurationStructs,pConfigurationStructSizes) \
+ ( (This)->lpVtbl -> EnableExperimentalFeatures(This,NumFeatures,pIIDs,pConfigurationStructs,pConfigurationStructSizes) )
+
+#define ID3D12DeviceFactory_CreateDevice(This,adapter,FeatureLevel,riid,ppvDevice) \
+ ( (This)->lpVtbl -> CreateDevice(This,adapter,FeatureLevel,riid,ppvDevice) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DeviceFactory_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12_0000_0060 */
+/* [local] */
+
+typedef
+enum D3D12_DEVICE_FLAGS
+ {
+ D3D12_DEVICE_FLAG_NONE = 0,
+ D3D12_DEVICE_FLAG_DEBUG_LAYER_ENABLED = 0x1,
+ D3D12_DEVICE_FLAG_GPU_BASED_VALIDATION_ENABLED = 0x2,
+ D3D12_DEVICE_FLAG_SYNCHRONIZED_COMMAND_QUEUE_VALIDATION_DISABLED = 0x4,
+ D3D12_DEVICE_FLAG_DRED_AUTO_BREADCRUMBS_ENABLED = 0x8,
+ D3D12_DEVICE_FLAG_DRED_PAGE_FAULT_REPORTING_ENABLED = 0x10,
+ D3D12_DEVICE_FLAG_DRED_WATSON_REPORTING_ENABLED = 0x20,
+ D3D12_DEVICE_FLAG_DRED_BREADCRUMB_CONTEXT_ENABLED = 0x40,
+ D3D12_DEVICE_FLAG_DRED_USE_MARKERS_ONLY_BREADCRUMBS = 0x80,
+ D3D12_DEVICE_FLAG_SHADER_INSTRUMENTATION_ENABLED = 0x100,
+ D3D12_DEVICE_FLAG_AUTO_DEBUG_NAME_ENABLED = 0x200,
+ D3D12_DEVICE_FLAG_FORCE_LEGACY_STATE_VALIDATION = 0x400
+ } D3D12_DEVICE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_DEVICE_FLAGS );
+typedef struct D3D12_DEVICE_CONFIGURATION_DESC
+ {
+ D3D12_DEVICE_FLAGS Flags;
+ UINT GpuBasedValidationFlags;
+ UINT SDKVersion;
+ UINT NumEnabledExperimentalFeatures;
+ } D3D12_DEVICE_CONFIGURATION_DESC;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0060_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0060_v0_0_s_ifspec;
+
+#ifndef __ID3D12DeviceConfiguration_INTERFACE_DEFINED__
+#define __ID3D12DeviceConfiguration_INTERFACE_DEFINED__
+
+/* interface ID3D12DeviceConfiguration */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DeviceConfiguration;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("78dbf87b-f766-422b-a61c-c8c446bdb9ad")
+ ID3D12DeviceConfiguration : public IUnknown
+ {
+ public:
+#if defined(_MSC_VER)
+ virtual D3D12_DEVICE_CONFIGURATION_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+#else
+ virtual D3D12_DEVICE_CONFIGURATION_DESC *STDMETHODCALLTYPE GetDesc(
+ D3D12_DEVICE_CONFIGURATION_DESC * RetVal) = 0;
+#endif
+
+ virtual HRESULT STDMETHODCALLTYPE GetEnabledExperimentalFeatures(
+ _Out_writes_(NumGuids) GUID *pGuids,
+ UINT NumGuids) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SerializeVersionedRootSignature(
+ _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *pDesc,
+ _COM_Outptr_ ID3DBlob **ppResult,
+ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob **ppError) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVersionedRootSignatureDeserializer(
+ _In_reads_bytes_(Size) const void *pBlob,
+ SIZE_T Size,
+ REFIID riid,
+ _COM_Outptr_ void **ppvDeserializer) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DeviceConfigurationVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DeviceConfiguration * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DeviceConfiguration * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DeviceConfiguration * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, GetDesc)
+#if !defined(_WIN32)
+ D3D12_DEVICE_CONFIGURATION_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12DeviceConfiguration * This);
+
+#else
+ D3D12_DEVICE_CONFIGURATION_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12DeviceConfiguration * This,
+ D3D12_DEVICE_CONFIGURATION_DESC * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, GetEnabledExperimentalFeatures)
+ HRESULT ( STDMETHODCALLTYPE *GetEnabledExperimentalFeatures )(
+ ID3D12DeviceConfiguration * This,
+ _Out_writes_(NumGuids) GUID *pGuids,
+ UINT NumGuids);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, SerializeVersionedRootSignature)
+ HRESULT ( STDMETHODCALLTYPE *SerializeVersionedRootSignature )(
+ ID3D12DeviceConfiguration * This,
+ _In_ const D3D12_VERSIONED_ROOT_SIGNATURE_DESC *pDesc,
+ _COM_Outptr_ ID3DBlob **ppResult,
+ _Always_(_Outptr_opt_result_maybenull_) ID3DBlob **ppError);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceConfiguration, CreateVersionedRootSignatureDeserializer)
+ HRESULT ( STDMETHODCALLTYPE *CreateVersionedRootSignatureDeserializer )(
+ ID3D12DeviceConfiguration * This,
+ _In_reads_bytes_(Size) const void *pBlob,
+ SIZE_T Size,
+ REFIID riid,
+ _COM_Outptr_ void **ppvDeserializer);
+
+ END_INTERFACE
+ } ID3D12DeviceConfigurationVtbl;
+
+ interface ID3D12DeviceConfiguration
+ {
+ CONST_VTBL struct ID3D12DeviceConfigurationVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DeviceConfiguration_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DeviceConfiguration_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DeviceConfiguration_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+#if !defined(_WIN32)
+
+#define ID3D12DeviceConfiguration_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12DeviceConfiguration_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
+
+#define ID3D12DeviceConfiguration_GetEnabledExperimentalFeatures(This,pGuids,NumGuids) \
+ ( (This)->lpVtbl -> GetEnabledExperimentalFeatures(This,pGuids,NumGuids) )
+
+#define ID3D12DeviceConfiguration_SerializeVersionedRootSignature(This,pDesc,ppResult,ppError) \
+ ( (This)->lpVtbl -> SerializeVersionedRootSignature(This,pDesc,ppResult,ppError) )
+
+#define ID3D12DeviceConfiguration_CreateVersionedRootSignatureDeserializer(This,pBlob,Size,riid,ppvDeserializer) \
+ ( (This)->lpVtbl -> CreateVersionedRootSignatureDeserializer(This,pBlob,Size,riid,ppvDeserializer) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DeviceConfiguration_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12_0000_0061 */
+/* [local] */
+
typedef
enum D3D12_AXIS_SHADING_RATE
{
@@ -16430,8 +25213,8 @@ enum D3D12_SHADING_RATE_COMBINER
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0044_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0044_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0061_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0061_v0_0_s_ifspec;
#ifndef __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__
#define __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__
@@ -16464,58 +25247,71 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D12GraphicsCommandList5 * This,
REFIID riid,
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D12GraphicsCommandList5 * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D12GraphicsCommandList5 * This);
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
ID3D12GraphicsCommandList5 * This,
_In_ REFGUID guid,
_Inout_ UINT *pDataSize,
_Out_writes_bytes_opt_( *pDataSize ) void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
ID3D12GraphicsCommandList5 * This,
_In_ REFGUID guid,
_In_ UINT DataSize,
_In_reads_bytes_opt_( DataSize ) const void *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
ID3D12GraphicsCommandList5 * This,
_In_ REFGUID guid,
_In_opt_ const IUnknown *pData);
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
HRESULT ( STDMETHODCALLTYPE *SetName )(
ID3D12GraphicsCommandList5 * This,
_In_z_ LPCWSTR Name);
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
HRESULT ( STDMETHODCALLTYPE *GetDevice )(
ID3D12GraphicsCommandList5 * This,
REFIID riid,
_COM_Outptr_opt_ void **ppvDevice);
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
ID3D12GraphicsCommandList5 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close)
HRESULT ( STDMETHODCALLTYPE *Close )(
ID3D12GraphicsCommandList5 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset)
HRESULT ( STDMETHODCALLTYPE *Reset )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12CommandAllocator *pAllocator,
_In_opt_ ID3D12PipelineState *pInitialState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState)
void ( STDMETHODCALLTYPE *ClearState )(
ID3D12GraphicsCommandList5 * This,
_In_opt_ ID3D12PipelineState *pPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced)
void ( STDMETHODCALLTYPE *DrawInstanced )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT VertexCountPerInstance,
@@ -16523,6 +25319,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_ UINT StartVertexLocation,
_In_ UINT StartInstanceLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced)
void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT IndexCountPerInstance,
@@ -16531,12 +25328,14 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_ INT BaseVertexLocation,
_In_ UINT StartInstanceLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch)
void ( STDMETHODCALLTYPE *Dispatch )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT ThreadGroupCountX,
_In_ UINT ThreadGroupCountY,
_In_ UINT ThreadGroupCountZ);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion)
void ( STDMETHODCALLTYPE *CopyBufferRegion )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -16545,6 +25344,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
UINT64 SrcOffset,
UINT64 NumBytes);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion)
void ( STDMETHODCALLTYPE *CopyTextureRegion )(
ID3D12GraphicsCommandList5 * This,
_In_ const D3D12_TEXTURE_COPY_LOCATION *pDst,
@@ -16554,11 +25354,13 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc,
_In_opt_ const D3D12_BOX *pSrcBox);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource)
void ( STDMETHODCALLTYPE *CopyResource )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12Resource *pDstResource,
_In_ ID3D12Resource *pSrcResource);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles)
void ( STDMETHODCALLTYPE *CopyTiles )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12Resource *pTiledResource,
@@ -16568,6 +25370,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
UINT64 BufferStartOffsetInBytes,
D3D12_TILE_COPY_FLAGS Flags);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource)
void ( STDMETHODCALLTYPE *ResolveSubresource )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12Resource *pDstResource,
@@ -16576,76 +25379,92 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_ UINT SrcSubresource,
_In_ DXGI_FORMAT Format);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology)
void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
ID3D12GraphicsCommandList5 * This,
_In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports)
void ( STDMETHODCALLTYPE *RSSetViewports )(
ID3D12GraphicsCommandList5 * This,
_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
_In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects)
void ( STDMETHODCALLTYPE *RSSetScissorRects )(
ID3D12GraphicsCommandList5 * This,
_In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
_In_reads_( NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor)
void ( STDMETHODCALLTYPE *OMSetBlendFactor )(
ID3D12GraphicsCommandList5 * This,
_In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef)
void ( STDMETHODCALLTYPE *OMSetStencilRef )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT StencilRef);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState)
void ( STDMETHODCALLTYPE *SetPipelineState )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12PipelineState *pPipelineState);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier)
void ( STDMETHODCALLTYPE *ResourceBarrier )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT NumBarriers,
_In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle)
void ( STDMETHODCALLTYPE *ExecuteBundle )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12GraphicsCommandList *pCommandList);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps)
void ( STDMETHODCALLTYPE *SetDescriptorHeaps )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT NumDescriptorHeaps,
_In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature)
void ( STDMETHODCALLTYPE *SetComputeRootSignature )(
ID3D12GraphicsCommandList5 * This,
_In_opt_ ID3D12RootSignature *pRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature)
void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )(
ID3D12GraphicsCommandList5 * This,
_In_opt_ ID3D12RootSignature *pRootSignature);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable)
void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable)
void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant)
void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT RootParameterIndex,
_In_ UINT SrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant)
void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT RootParameterIndex,
_In_ UINT SrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants)
void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT RootParameterIndex,
@@ -16653,6 +25472,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants)
void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT RootParameterIndex,
@@ -16660,52 +25480,62 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
_In_ UINT DestOffsetIn32BitValues);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView)
void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView)
void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView)
void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView)
void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView)
void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView)
void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT RootParameterIndex,
_In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer)
void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
ID3D12GraphicsCommandList5 * This,
_In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers)
void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT StartSlot,
_In_ UINT NumViews,
_In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets)
void ( STDMETHODCALLTYPE *SOSetTargets )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT StartSlot,
_In_ UINT NumViews,
_In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets)
void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT NumRenderTargetDescriptors,
@@ -16713,6 +25543,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_ BOOL RTsSingleHandleToDescriptorRange,
_In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView)
void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
ID3D12GraphicsCommandList5 * This,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView,
@@ -16722,6 +25553,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView)
void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
ID3D12GraphicsCommandList5 * This,
_In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView,
@@ -16729,6 +25561,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint)
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
ID3D12GraphicsCommandList5 * This,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
@@ -16738,6 +25571,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat)
void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
ID3D12GraphicsCommandList5 * This,
_In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
@@ -16747,23 +25581,27 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_ UINT NumRects,
_In_reads_(NumRects) const D3D12_RECT *pRects);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource)
void ( STDMETHODCALLTYPE *DiscardResource )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12Resource *pResource,
_In_opt_ const D3D12_DISCARD_REGION *pRegion);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery)
void ( STDMETHODCALLTYPE *BeginQuery )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
_In_ D3D12_QUERY_TYPE Type,
_In_ UINT Index);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery)
void ( STDMETHODCALLTYPE *EndQuery )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
_In_ D3D12_QUERY_TYPE Type,
_In_ UINT Index);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData)
void ( STDMETHODCALLTYPE *ResolveQueryData )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12QueryHeap *pQueryHeap,
@@ -16773,27 +25611,32 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_ ID3D12Resource *pDestinationBuffer,
_In_ UINT64 AlignedDestinationBufferOffset);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication)
void ( STDMETHODCALLTYPE *SetPredication )(
ID3D12GraphicsCommandList5 * This,
_In_opt_ ID3D12Resource *pBuffer,
_In_ UINT64 AlignedBufferOffset,
_In_ D3D12_PREDICATION_OP Operation);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker)
void ( STDMETHODCALLTYPE *SetMarker )(
ID3D12GraphicsCommandList5 * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent)
void ( STDMETHODCALLTYPE *BeginEvent )(
ID3D12GraphicsCommandList5 * This,
UINT Metadata,
_In_reads_bytes_opt_(Size) const void *pData,
UINT Size);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent)
void ( STDMETHODCALLTYPE *EndEvent )(
ID3D12GraphicsCommandList5 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect)
void ( STDMETHODCALLTYPE *ExecuteIndirect )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12CommandSignature *pCommandSignature,
@@ -16803,6 +25646,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_opt_ ID3D12Resource *pCountBuffer,
_In_ UINT64 CountBufferOffset);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT)
void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -16813,6 +25657,7 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
_In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64)
void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12Resource *pDstBuffer,
@@ -16823,17 +25668,20 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
_In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds)
void ( STDMETHODCALLTYPE *OMSetDepthBounds )(
ID3D12GraphicsCommandList5 * This,
_In_ FLOAT Min,
_In_ FLOAT Max);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions)
void ( STDMETHODCALLTYPE *SetSamplePositions )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT NumSamplesPerPixel,
_In_ UINT NumPixels,
_In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion)
void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12Resource *pDstResource,
@@ -16846,20 +25694,24 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_ DXGI_FORMAT Format,
_In_ D3D12_RESOLVE_MODE ResolveMode);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask)
void ( STDMETHODCALLTYPE *SetViewInstanceMask )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT Mask);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate)
void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
ID3D12GraphicsCommandList5 * This,
UINT Count,
_In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
_In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession)
void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
ID3D12GraphicsCommandList5 * This,
_In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass)
void ( STDMETHODCALLTYPE *BeginRenderPass )(
ID3D12GraphicsCommandList5 * This,
_In_ UINT NumRenderTargets,
@@ -16867,52 +25719,62 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
_In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil,
D3D12_RENDER_PASS_FLAGS Flags);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass)
void ( STDMETHODCALLTYPE *EndRenderPass )(
ID3D12GraphicsCommandList5 * This);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand)
void ( STDMETHODCALLTYPE *InitializeMetaCommand )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12MetaCommand *pMetaCommand,
_In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData,
_In_ SIZE_T InitializationParametersDataSizeInBytes);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand)
void ( STDMETHODCALLTYPE *ExecuteMetaCommand )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12MetaCommand *pMetaCommand,
_In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData,
_In_ SIZE_T ExecutionParametersDataSizeInBytes);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure)
void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )(
ID3D12GraphicsCommandList5 * This,
_In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc,
_In_ UINT NumPostbuildInfoDescs,
_In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo)
void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )(
ID3D12GraphicsCommandList5 * This,
_In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc,
_In_ UINT NumSourceAccelerationStructures,
_In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure)
void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )(
ID3D12GraphicsCommandList5 * This,
_In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData,
_In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData,
_In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1)
void ( STDMETHODCALLTYPE *SetPipelineState1 )(
ID3D12GraphicsCommandList5 * This,
_In_ ID3D12StateObject *pStateObject);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays)
void ( STDMETHODCALLTYPE *DispatchRays )(
ID3D12GraphicsCommandList5 * This,
_In_ const D3D12_DISPATCH_RAYS_DESC *pDesc);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate)
void ( STDMETHODCALLTYPE *RSSetShadingRate )(
ID3D12GraphicsCommandList5 * This,
_In_ D3D12_SHADING_RATE baseShadingRate,
_In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners);
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage)
void ( STDMETHODCALLTYPE *RSSetShadingRateImage )(
ID3D12GraphicsCommandList5 * This,
_In_opt_ ID3D12Resource *shadingRateImage);
@@ -17187,9 +26049,2580 @@ EXTERN_C const IID IID_ID3D12GraphicsCommandList5;
#endif /* __ID3D12GraphicsCommandList5_INTERFACE_DEFINED__ */
-/* interface __MIDL_itf_d3d12_0000_0045 */
+/* interface __MIDL_itf_d3d12_0000_0062 */
+/* [local] */
+
+typedef struct D3D12_DISPATCH_MESH_ARGUMENTS
+ {
+ UINT ThreadGroupCountX;
+ UINT ThreadGroupCountY;
+ UINT ThreadGroupCountZ;
+ } D3D12_DISPATCH_MESH_ARGUMENTS;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0062_v0_0_s_ifspec;
+
+#ifndef __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__
+#define __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__
+
+/* interface ID3D12GraphicsCommandList6 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12GraphicsCommandList6;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("c3827890-e548-4cfa-96cf-5689a9370f80")
+ ID3D12GraphicsCommandList6 : public ID3D12GraphicsCommandList5
+ {
+ public:
+ virtual void STDMETHODCALLTYPE DispatchMesh(
+ _In_ UINT ThreadGroupCountX,
+ _In_ UINT ThreadGroupCountY,
+ _In_ UINT ThreadGroupCountZ) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12GraphicsCommandList6Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12GraphicsCommandList6 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12GraphicsCommandList6 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12GraphicsCommandList6 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12GraphicsCommandList6 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12GraphicsCommandList6 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12GraphicsCommandList6 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12CommandAllocator *pAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_opt_ ID3D12PipelineState *pPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced)
+ void ( STDMETHODCALLTYPE *DrawInstanced )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT VertexCountPerInstance,
+ _In_ UINT InstanceCount,
+ _In_ UINT StartVertexLocation,
+ _In_ UINT StartInstanceLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced)
+ void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT IndexCountPerInstance,
+ _In_ UINT InstanceCount,
+ _In_ UINT StartIndexLocation,
+ _In_ INT BaseVertexLocation,
+ _In_ UINT StartInstanceLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch)
+ void ( STDMETHODCALLTYPE *Dispatch )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT ThreadGroupCountX,
+ _In_ UINT ThreadGroupCountY,
+ _In_ UINT ThreadGroupCountZ);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion)
+ void ( STDMETHODCALLTYPE *CopyBufferRegion )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT64 NumBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion)
+ void ( STDMETHODCALLTYPE *CopyTextureRegion )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst,
+ UINT DstX,
+ UINT DstY,
+ UINT DstZ,
+ _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc,
+ _In_opt_ const D3D12_BOX *pSrcBox);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource)
+ void ( STDMETHODCALLTYPE *CopyResource )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ ID3D12Resource *pSrcResource);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles)
+ void ( STDMETHODCALLTYPE *CopyTiles )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12Resource *pTiledResource,
+ _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate,
+ _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize,
+ _In_ ID3D12Resource *pBuffer,
+ UINT64 BufferStartOffsetInBytes,
+ D3D12_TILE_COPY_FLAGS Flags);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource)
+ void ( STDMETHODCALLTYPE *ResolveSubresource )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ UINT DstSubresource,
+ _In_ ID3D12Resource *pSrcResource,
+ _In_ UINT SrcSubresource,
+ _In_ DXGI_FORMAT Format);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology)
+ void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports)
+ void ( STDMETHODCALLTYPE *RSSetViewports )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects)
+ void ( STDMETHODCALLTYPE *RSSetScissorRects )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ _In_reads_( NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor)
+ void ( STDMETHODCALLTYPE *OMSetBlendFactor )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef)
+ void ( STDMETHODCALLTYPE *OMSetStencilRef )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT StencilRef);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState)
+ void ( STDMETHODCALLTYPE *SetPipelineState )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12PipelineState *pPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle)
+ void ( STDMETHODCALLTYPE *ExecuteBundle )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12GraphicsCommandList *pCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps)
+ void ( STDMETHODCALLTYPE *SetDescriptorHeaps )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT NumDescriptorHeaps,
+ _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature)
+ void ( STDMETHODCALLTYPE *SetComputeRootSignature )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_opt_ ID3D12RootSignature *pRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_opt_ ID3D12RootSignature *pRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable)
+ void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant)
+ void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT SrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant)
+ void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT SrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants)
+ void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT Num32BitValuesToSet,
+ _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants)
+ void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT Num32BitValuesToSet,
+ _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView)
+ void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView)
+ void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer)
+ void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers)
+ void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT StartSlot,
+ _In_ UINT NumViews,
+ _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets)
+ void ( STDMETHODCALLTYPE *SOSetTargets )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT StartSlot,
+ _In_ UINT NumViews,
+ _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets)
+ void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT NumRenderTargetDescriptors,
+ _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors,
+ _In_ BOOL RTsSingleHandleToDescriptorRange,
+ _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView)
+ void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView,
+ _In_ D3D12_CLEAR_FLAGS ClearFlags,
+ _In_ FLOAT Depth,
+ _In_ UINT8 Stencil,
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView)
+ void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView,
+ _In_ const FLOAT ColorRGBA[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint)
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle,
+ _In_ ID3D12Resource *pResource,
+ _In_ const UINT Values[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat)
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle,
+ _In_ ID3D12Resource *pResource,
+ _In_ const FLOAT Values[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12GraphicsCommandList6 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12GraphicsCommandList6 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12GraphicsCommandList6 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect)
+ void ( STDMETHODCALLTYPE *ExecuteIndirect )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12CommandSignature *pCommandSignature,
+ _In_ UINT MaxCommandCount,
+ _In_ ID3D12Resource *pArgumentBuffer,
+ _In_ UINT64 ArgumentBufferOffset,
+ _In_opt_ ID3D12Resource *pCountBuffer,
+ _In_ UINT64 CountBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT)
+ void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT Dependencies,
+ _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
+ _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64)
+ void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT Dependencies,
+ _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
+ _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds)
+ void ( STDMETHODCALLTYPE *OMSetDepthBounds )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ FLOAT Min,
+ _In_ FLOAT Max);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions)
+ void ( STDMETHODCALLTYPE *SetSamplePositions )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT NumSamplesPerPixel,
+ _In_ UINT NumPixels,
+ _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion)
+ void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ UINT DstSubresource,
+ _In_ UINT DstX,
+ _In_ UINT DstY,
+ _In_ ID3D12Resource *pSrcResource,
+ _In_ UINT SrcSubresource,
+ _In_opt_ D3D12_RECT *pSrcRect,
+ _In_ DXGI_FORMAT Format,
+ _In_ D3D12_RESOLVE_MODE ResolveMode);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask)
+ void ( STDMETHODCALLTYPE *SetViewInstanceMask )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT Mask);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12GraphicsCommandList6 * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession)
+ void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass)
+ void ( STDMETHODCALLTYPE *BeginRenderPass )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT NumRenderTargets,
+ _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets,
+ _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil,
+ D3D12_RENDER_PASS_FLAGS Flags);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass)
+ void ( STDMETHODCALLTYPE *EndRenderPass )(
+ ID3D12GraphicsCommandList6 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand)
+ void ( STDMETHODCALLTYPE *InitializeMetaCommand )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12MetaCommand *pMetaCommand,
+ _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData,
+ _In_ SIZE_T InitializationParametersDataSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand)
+ void ( STDMETHODCALLTYPE *ExecuteMetaCommand )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12MetaCommand *pMetaCommand,
+ _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData,
+ _In_ SIZE_T ExecutionParametersDataSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure)
+ void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc,
+ _In_ UINT NumPostbuildInfoDescs,
+ _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo)
+ void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc,
+ _In_ UINT NumSourceAccelerationStructures,
+ _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure)
+ void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData,
+ _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1)
+ void ( STDMETHODCALLTYPE *SetPipelineState1 )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ ID3D12StateObject *pStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays)
+ void ( STDMETHODCALLTYPE *DispatchRays )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate)
+ void ( STDMETHODCALLTYPE *RSSetShadingRate )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ D3D12_SHADING_RATE baseShadingRate,
+ _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage)
+ void ( STDMETHODCALLTYPE *RSSetShadingRateImage )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_opt_ ID3D12Resource *shadingRateImage);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh)
+ void ( STDMETHODCALLTYPE *DispatchMesh )(
+ ID3D12GraphicsCommandList6 * This,
+ _In_ UINT ThreadGroupCountX,
+ _In_ UINT ThreadGroupCountY,
+ _In_ UINT ThreadGroupCountZ);
+
+ END_INTERFACE
+ } ID3D12GraphicsCommandList6Vtbl;
+
+ interface ID3D12GraphicsCommandList6
+ {
+ CONST_VTBL struct ID3D12GraphicsCommandList6Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12GraphicsCommandList6_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12GraphicsCommandList6_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12GraphicsCommandList6_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12GraphicsCommandList6_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12GraphicsCommandList6_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12GraphicsCommandList6_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12GraphicsCommandList6_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12GraphicsCommandList6_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12GraphicsCommandList6_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12GraphicsCommandList6_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12GraphicsCommandList6_Reset(This,pAllocator,pInitialState) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) )
+
+#define ID3D12GraphicsCommandList6_ClearState(This,pPipelineState) \
+ ( (This)->lpVtbl -> ClearState(This,pPipelineState) )
+
+#define ID3D12GraphicsCommandList6_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) )
+
+#define ID3D12GraphicsCommandList6_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) )
+
+#define ID3D12GraphicsCommandList6_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \
+ ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) )
+
+#define ID3D12GraphicsCommandList6_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \
+ ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) )
+
+#define ID3D12GraphicsCommandList6_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \
+ ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) )
+
+#define ID3D12GraphicsCommandList6_CopyResource(This,pDstResource,pSrcResource) \
+ ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) )
+
+#define ID3D12GraphicsCommandList6_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \
+ ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) )
+
+#define ID3D12GraphicsCommandList6_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \
+ ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) )
+
+#define ID3D12GraphicsCommandList6_IASetPrimitiveTopology(This,PrimitiveTopology) \
+ ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) )
+
+#define ID3D12GraphicsCommandList6_RSSetViewports(This,NumViewports,pViewports) \
+ ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) )
+
+#define ID3D12GraphicsCommandList6_RSSetScissorRects(This,NumRects,pRects) \
+ ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList6_OMSetBlendFactor(This,BlendFactor) \
+ ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) )
+
+#define ID3D12GraphicsCommandList6_OMSetStencilRef(This,StencilRef) \
+ ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) )
+
+#define ID3D12GraphicsCommandList6_SetPipelineState(This,pPipelineState) \
+ ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) )
+
+#define ID3D12GraphicsCommandList6_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12GraphicsCommandList6_ExecuteBundle(This,pCommandList) \
+ ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) )
+
+#define ID3D12GraphicsCommandList6_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \
+ ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) )
+
+#define ID3D12GraphicsCommandList6_SetComputeRootSignature(This,pRootSignature) \
+ ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) )
+
+#define ID3D12GraphicsCommandList6_SetGraphicsRootSignature(This,pRootSignature) \
+ ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) )
+
+#define ID3D12GraphicsCommandList6_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \
+ ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) )
+
+#define ID3D12GraphicsCommandList6_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \
+ ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) )
+
+#define ID3D12GraphicsCommandList6_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList6_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList6_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList6_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList6_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList6_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList6_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList6_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList6_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList6_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList6_IASetIndexBuffer(This,pView) \
+ ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) )
+
+#define ID3D12GraphicsCommandList6_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \
+ ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) )
+
+#define ID3D12GraphicsCommandList6_SOSetTargets(This,StartSlot,NumViews,pViews) \
+ ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) )
+
+#define ID3D12GraphicsCommandList6_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \
+ ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) )
+
+#define ID3D12GraphicsCommandList6_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList6_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList6_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList6_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList6_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12GraphicsCommandList6_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12GraphicsCommandList6_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12GraphicsCommandList6_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12GraphicsCommandList6_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12GraphicsCommandList6_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12GraphicsCommandList6_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12GraphicsCommandList6_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12GraphicsCommandList6_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \
+ ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) )
+
+
+#define ID3D12GraphicsCommandList6_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \
+ ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) )
+
+#define ID3D12GraphicsCommandList6_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \
+ ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) )
+
+#define ID3D12GraphicsCommandList6_OMSetDepthBounds(This,Min,Max) \
+ ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) )
+
+#define ID3D12GraphicsCommandList6_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \
+ ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) )
+
+#define ID3D12GraphicsCommandList6_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \
+ ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) )
+
+#define ID3D12GraphicsCommandList6_SetViewInstanceMask(This,Mask) \
+ ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) )
+
+
+#define ID3D12GraphicsCommandList6_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+
+#define ID3D12GraphicsCommandList6_SetProtectedResourceSession(This,pProtectedResourceSession) \
+ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
+
+
+#define ID3D12GraphicsCommandList6_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \
+ ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) )
+
+#define ID3D12GraphicsCommandList6_EndRenderPass(This) \
+ ( (This)->lpVtbl -> EndRenderPass(This) )
+
+#define ID3D12GraphicsCommandList6_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \
+ ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) )
+
+#define ID3D12GraphicsCommandList6_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \
+ ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) )
+
+#define ID3D12GraphicsCommandList6_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \
+ ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) )
+
+#define ID3D12GraphicsCommandList6_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \
+ ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) )
+
+#define ID3D12GraphicsCommandList6_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \
+ ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) )
+
+#define ID3D12GraphicsCommandList6_SetPipelineState1(This,pStateObject) \
+ ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) )
+
+#define ID3D12GraphicsCommandList6_DispatchRays(This,pDesc) \
+ ( (This)->lpVtbl -> DispatchRays(This,pDesc) )
+
+
+#define ID3D12GraphicsCommandList6_RSSetShadingRate(This,baseShadingRate,combiners) \
+ ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) )
+
+#define ID3D12GraphicsCommandList6_RSSetShadingRateImage(This,shadingRateImage) \
+ ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) )
+
+
+#define ID3D12GraphicsCommandList6_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \
+ ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12GraphicsCommandList6_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__
+#define __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__
+
+/* interface ID3D12GraphicsCommandList7 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12GraphicsCommandList7;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("dd171223-8b61-4769-90e3-160ccde4e2c1")
+ ID3D12GraphicsCommandList7 : public ID3D12GraphicsCommandList6
+ {
+ public:
+ virtual void STDMETHODCALLTYPE Barrier(
+ UINT32 NumBarrierGroups,
+ _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12GraphicsCommandList7Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12GraphicsCommandList7 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12GraphicsCommandList7 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12GraphicsCommandList7 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12GraphicsCommandList7 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12GraphicsCommandList7 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12GraphicsCommandList7 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12CommandAllocator *pAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_opt_ ID3D12PipelineState *pPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced)
+ void ( STDMETHODCALLTYPE *DrawInstanced )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT VertexCountPerInstance,
+ _In_ UINT InstanceCount,
+ _In_ UINT StartVertexLocation,
+ _In_ UINT StartInstanceLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced)
+ void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT IndexCountPerInstance,
+ _In_ UINT InstanceCount,
+ _In_ UINT StartIndexLocation,
+ _In_ INT BaseVertexLocation,
+ _In_ UINT StartInstanceLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch)
+ void ( STDMETHODCALLTYPE *Dispatch )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT ThreadGroupCountX,
+ _In_ UINT ThreadGroupCountY,
+ _In_ UINT ThreadGroupCountZ);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion)
+ void ( STDMETHODCALLTYPE *CopyBufferRegion )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT64 NumBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion)
+ void ( STDMETHODCALLTYPE *CopyTextureRegion )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst,
+ UINT DstX,
+ UINT DstY,
+ UINT DstZ,
+ _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc,
+ _In_opt_ const D3D12_BOX *pSrcBox);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource)
+ void ( STDMETHODCALLTYPE *CopyResource )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ ID3D12Resource *pSrcResource);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles)
+ void ( STDMETHODCALLTYPE *CopyTiles )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12Resource *pTiledResource,
+ _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate,
+ _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize,
+ _In_ ID3D12Resource *pBuffer,
+ UINT64 BufferStartOffsetInBytes,
+ D3D12_TILE_COPY_FLAGS Flags);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource)
+ void ( STDMETHODCALLTYPE *ResolveSubresource )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ UINT DstSubresource,
+ _In_ ID3D12Resource *pSrcResource,
+ _In_ UINT SrcSubresource,
+ _In_ DXGI_FORMAT Format);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology)
+ void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports)
+ void ( STDMETHODCALLTYPE *RSSetViewports )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects)
+ void ( STDMETHODCALLTYPE *RSSetScissorRects )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ _In_reads_( NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor)
+ void ( STDMETHODCALLTYPE *OMSetBlendFactor )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef)
+ void ( STDMETHODCALLTYPE *OMSetStencilRef )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT StencilRef);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState)
+ void ( STDMETHODCALLTYPE *SetPipelineState )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12PipelineState *pPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle)
+ void ( STDMETHODCALLTYPE *ExecuteBundle )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12GraphicsCommandList *pCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps)
+ void ( STDMETHODCALLTYPE *SetDescriptorHeaps )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT NumDescriptorHeaps,
+ _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature)
+ void ( STDMETHODCALLTYPE *SetComputeRootSignature )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_opt_ ID3D12RootSignature *pRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_opt_ ID3D12RootSignature *pRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable)
+ void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant)
+ void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT SrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant)
+ void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT SrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants)
+ void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT Num32BitValuesToSet,
+ _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants)
+ void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT Num32BitValuesToSet,
+ _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView)
+ void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView)
+ void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer)
+ void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers)
+ void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT StartSlot,
+ _In_ UINT NumViews,
+ _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets)
+ void ( STDMETHODCALLTYPE *SOSetTargets )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT StartSlot,
+ _In_ UINT NumViews,
+ _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets)
+ void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT NumRenderTargetDescriptors,
+ _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors,
+ _In_ BOOL RTsSingleHandleToDescriptorRange,
+ _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView)
+ void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView,
+ _In_ D3D12_CLEAR_FLAGS ClearFlags,
+ _In_ FLOAT Depth,
+ _In_ UINT8 Stencil,
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView)
+ void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView,
+ _In_ const FLOAT ColorRGBA[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint)
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle,
+ _In_ ID3D12Resource *pResource,
+ _In_ const UINT Values[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat)
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle,
+ _In_ ID3D12Resource *pResource,
+ _In_ const FLOAT Values[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12GraphicsCommandList7 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12GraphicsCommandList7 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12GraphicsCommandList7 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect)
+ void ( STDMETHODCALLTYPE *ExecuteIndirect )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12CommandSignature *pCommandSignature,
+ _In_ UINT MaxCommandCount,
+ _In_ ID3D12Resource *pArgumentBuffer,
+ _In_ UINT64 ArgumentBufferOffset,
+ _In_opt_ ID3D12Resource *pCountBuffer,
+ _In_ UINT64 CountBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT)
+ void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT Dependencies,
+ _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
+ _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64)
+ void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT Dependencies,
+ _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
+ _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds)
+ void ( STDMETHODCALLTYPE *OMSetDepthBounds )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ FLOAT Min,
+ _In_ FLOAT Max);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions)
+ void ( STDMETHODCALLTYPE *SetSamplePositions )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT NumSamplesPerPixel,
+ _In_ UINT NumPixels,
+ _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion)
+ void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ UINT DstSubresource,
+ _In_ UINT DstX,
+ _In_ UINT DstY,
+ _In_ ID3D12Resource *pSrcResource,
+ _In_ UINT SrcSubresource,
+ _In_opt_ D3D12_RECT *pSrcRect,
+ _In_ DXGI_FORMAT Format,
+ _In_ D3D12_RESOLVE_MODE ResolveMode);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask)
+ void ( STDMETHODCALLTYPE *SetViewInstanceMask )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT Mask);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12GraphicsCommandList7 * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession)
+ void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass)
+ void ( STDMETHODCALLTYPE *BeginRenderPass )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT NumRenderTargets,
+ _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets,
+ _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil,
+ D3D12_RENDER_PASS_FLAGS Flags);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass)
+ void ( STDMETHODCALLTYPE *EndRenderPass )(
+ ID3D12GraphicsCommandList7 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand)
+ void ( STDMETHODCALLTYPE *InitializeMetaCommand )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12MetaCommand *pMetaCommand,
+ _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData,
+ _In_ SIZE_T InitializationParametersDataSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand)
+ void ( STDMETHODCALLTYPE *ExecuteMetaCommand )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12MetaCommand *pMetaCommand,
+ _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData,
+ _In_ SIZE_T ExecutionParametersDataSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure)
+ void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc,
+ _In_ UINT NumPostbuildInfoDescs,
+ _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo)
+ void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc,
+ _In_ UINT NumSourceAccelerationStructures,
+ _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure)
+ void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData,
+ _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1)
+ void ( STDMETHODCALLTYPE *SetPipelineState1 )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ ID3D12StateObject *pStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays)
+ void ( STDMETHODCALLTYPE *DispatchRays )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate)
+ void ( STDMETHODCALLTYPE *RSSetShadingRate )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ D3D12_SHADING_RATE baseShadingRate,
+ _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage)
+ void ( STDMETHODCALLTYPE *RSSetShadingRateImage )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_opt_ ID3D12Resource *shadingRateImage);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh)
+ void ( STDMETHODCALLTYPE *DispatchMesh )(
+ ID3D12GraphicsCommandList7 * This,
+ _In_ UINT ThreadGroupCountX,
+ _In_ UINT ThreadGroupCountY,
+ _In_ UINT ThreadGroupCountZ);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList7, Barrier)
+ void ( STDMETHODCALLTYPE *Barrier )(
+ ID3D12GraphicsCommandList7 * This,
+ UINT32 NumBarrierGroups,
+ _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups);
+
+ END_INTERFACE
+ } ID3D12GraphicsCommandList7Vtbl;
+
+ interface ID3D12GraphicsCommandList7
+ {
+ CONST_VTBL struct ID3D12GraphicsCommandList7Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12GraphicsCommandList7_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12GraphicsCommandList7_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12GraphicsCommandList7_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12GraphicsCommandList7_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12GraphicsCommandList7_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12GraphicsCommandList7_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12GraphicsCommandList7_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12GraphicsCommandList7_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12GraphicsCommandList7_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12GraphicsCommandList7_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12GraphicsCommandList7_Reset(This,pAllocator,pInitialState) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) )
+
+#define ID3D12GraphicsCommandList7_ClearState(This,pPipelineState) \
+ ( (This)->lpVtbl -> ClearState(This,pPipelineState) )
+
+#define ID3D12GraphicsCommandList7_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) )
+
+#define ID3D12GraphicsCommandList7_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) )
+
+#define ID3D12GraphicsCommandList7_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \
+ ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) )
+
+#define ID3D12GraphicsCommandList7_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \
+ ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) )
+
+#define ID3D12GraphicsCommandList7_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \
+ ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) )
+
+#define ID3D12GraphicsCommandList7_CopyResource(This,pDstResource,pSrcResource) \
+ ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) )
+
+#define ID3D12GraphicsCommandList7_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \
+ ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) )
+
+#define ID3D12GraphicsCommandList7_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \
+ ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) )
+
+#define ID3D12GraphicsCommandList7_IASetPrimitiveTopology(This,PrimitiveTopology) \
+ ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) )
+
+#define ID3D12GraphicsCommandList7_RSSetViewports(This,NumViewports,pViewports) \
+ ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) )
+
+#define ID3D12GraphicsCommandList7_RSSetScissorRects(This,NumRects,pRects) \
+ ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList7_OMSetBlendFactor(This,BlendFactor) \
+ ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) )
+
+#define ID3D12GraphicsCommandList7_OMSetStencilRef(This,StencilRef) \
+ ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) )
+
+#define ID3D12GraphicsCommandList7_SetPipelineState(This,pPipelineState) \
+ ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) )
+
+#define ID3D12GraphicsCommandList7_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12GraphicsCommandList7_ExecuteBundle(This,pCommandList) \
+ ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) )
+
+#define ID3D12GraphicsCommandList7_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \
+ ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) )
+
+#define ID3D12GraphicsCommandList7_SetComputeRootSignature(This,pRootSignature) \
+ ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) )
+
+#define ID3D12GraphicsCommandList7_SetGraphicsRootSignature(This,pRootSignature) \
+ ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) )
+
+#define ID3D12GraphicsCommandList7_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \
+ ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) )
+
+#define ID3D12GraphicsCommandList7_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \
+ ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) )
+
+#define ID3D12GraphicsCommandList7_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList7_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList7_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList7_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList7_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList7_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList7_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList7_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList7_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList7_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList7_IASetIndexBuffer(This,pView) \
+ ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) )
+
+#define ID3D12GraphicsCommandList7_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \
+ ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) )
+
+#define ID3D12GraphicsCommandList7_SOSetTargets(This,StartSlot,NumViews,pViews) \
+ ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) )
+
+#define ID3D12GraphicsCommandList7_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \
+ ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) )
+
+#define ID3D12GraphicsCommandList7_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList7_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList7_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList7_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList7_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12GraphicsCommandList7_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12GraphicsCommandList7_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12GraphicsCommandList7_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12GraphicsCommandList7_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12GraphicsCommandList7_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12GraphicsCommandList7_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12GraphicsCommandList7_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12GraphicsCommandList7_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \
+ ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) )
+
+
+#define ID3D12GraphicsCommandList7_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \
+ ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) )
+
+#define ID3D12GraphicsCommandList7_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \
+ ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) )
+
+#define ID3D12GraphicsCommandList7_OMSetDepthBounds(This,Min,Max) \
+ ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) )
+
+#define ID3D12GraphicsCommandList7_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \
+ ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) )
+
+#define ID3D12GraphicsCommandList7_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \
+ ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) )
+
+#define ID3D12GraphicsCommandList7_SetViewInstanceMask(This,Mask) \
+ ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) )
+
+
+#define ID3D12GraphicsCommandList7_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+
+#define ID3D12GraphicsCommandList7_SetProtectedResourceSession(This,pProtectedResourceSession) \
+ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
+
+
+#define ID3D12GraphicsCommandList7_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \
+ ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) )
+
+#define ID3D12GraphicsCommandList7_EndRenderPass(This) \
+ ( (This)->lpVtbl -> EndRenderPass(This) )
+
+#define ID3D12GraphicsCommandList7_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \
+ ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) )
+
+#define ID3D12GraphicsCommandList7_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \
+ ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) )
+
+#define ID3D12GraphicsCommandList7_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \
+ ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) )
+
+#define ID3D12GraphicsCommandList7_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \
+ ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) )
+
+#define ID3D12GraphicsCommandList7_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \
+ ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) )
+
+#define ID3D12GraphicsCommandList7_SetPipelineState1(This,pStateObject) \
+ ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) )
+
+#define ID3D12GraphicsCommandList7_DispatchRays(This,pDesc) \
+ ( (This)->lpVtbl -> DispatchRays(This,pDesc) )
+
+
+#define ID3D12GraphicsCommandList7_RSSetShadingRate(This,baseShadingRate,combiners) \
+ ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) )
+
+#define ID3D12GraphicsCommandList7_RSSetShadingRateImage(This,shadingRateImage) \
+ ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) )
+
+
+#define ID3D12GraphicsCommandList7_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \
+ ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) )
+
+
+#define ID3D12GraphicsCommandList7_Barrier(This,NumBarrierGroups,pBarrierGroups) \
+ ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12GraphicsCommandList7_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__
+#define __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__
+
+/* interface ID3D12GraphicsCommandList8 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12GraphicsCommandList8;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("ee936ef9-599d-4d28-938e-23c4ad05ce51")
+ ID3D12GraphicsCommandList8 : public ID3D12GraphicsCommandList7
+ {
+ public:
+ virtual void STDMETHODCALLTYPE OMSetFrontAndBackStencilRef(
+ _In_ UINT FrontStencilRef,
+ _In_ UINT BackStencilRef) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12GraphicsCommandList8Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12GraphicsCommandList8 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12GraphicsCommandList8 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12GraphicsCommandList8 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12GraphicsCommandList8 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12GraphicsCommandList8 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12GraphicsCommandList8 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12CommandAllocator *pAllocator,
+ _In_opt_ ID3D12PipelineState *pInitialState);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_opt_ ID3D12PipelineState *pPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawInstanced)
+ void ( STDMETHODCALLTYPE *DrawInstanced )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT VertexCountPerInstance,
+ _In_ UINT InstanceCount,
+ _In_ UINT StartVertexLocation,
+ _In_ UINT StartInstanceLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DrawIndexedInstanced)
+ void ( STDMETHODCALLTYPE *DrawIndexedInstanced )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT IndexCountPerInstance,
+ _In_ UINT InstanceCount,
+ _In_ UINT StartIndexLocation,
+ _In_ INT BaseVertexLocation,
+ _In_ UINT StartInstanceLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, Dispatch)
+ void ( STDMETHODCALLTYPE *Dispatch )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT ThreadGroupCountX,
+ _In_ UINT ThreadGroupCountY,
+ _In_ UINT ThreadGroupCountZ);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyBufferRegion)
+ void ( STDMETHODCALLTYPE *CopyBufferRegion )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT64 NumBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTextureRegion)
+ void ( STDMETHODCALLTYPE *CopyTextureRegion )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ const D3D12_TEXTURE_COPY_LOCATION *pDst,
+ UINT DstX,
+ UINT DstY,
+ UINT DstZ,
+ _In_ const D3D12_TEXTURE_COPY_LOCATION *pSrc,
+ _In_opt_ const D3D12_BOX *pSrcBox);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyResource)
+ void ( STDMETHODCALLTYPE *CopyResource )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ ID3D12Resource *pSrcResource);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, CopyTiles)
+ void ( STDMETHODCALLTYPE *CopyTiles )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12Resource *pTiledResource,
+ _In_ const D3D12_TILED_RESOURCE_COORDINATE *pTileRegionStartCoordinate,
+ _In_ const D3D12_TILE_REGION_SIZE *pTileRegionSize,
+ _In_ ID3D12Resource *pBuffer,
+ UINT64 BufferStartOffsetInBytes,
+ D3D12_TILE_COPY_FLAGS Flags);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveSubresource)
+ void ( STDMETHODCALLTYPE *ResolveSubresource )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ UINT DstSubresource,
+ _In_ ID3D12Resource *pSrcResource,
+ _In_ UINT SrcSubresource,
+ _In_ DXGI_FORMAT Format);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetPrimitiveTopology)
+ void ( STDMETHODCALLTYPE *IASetPrimitiveTopology )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ D3D12_PRIMITIVE_TOPOLOGY PrimitiveTopology);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetViewports)
+ void ( STDMETHODCALLTYPE *RSSetViewports )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumViewports,
+ _In_reads_( NumViewports) const D3D12_VIEWPORT *pViewports);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, RSSetScissorRects)
+ void ( STDMETHODCALLTYPE *RSSetScissorRects )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_range_(0, D3D12_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE) UINT NumRects,
+ _In_reads_( NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetBlendFactor)
+ void ( STDMETHODCALLTYPE *OMSetBlendFactor )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_reads_opt_(4) const FLOAT BlendFactor[ 4 ]);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetStencilRef)
+ void ( STDMETHODCALLTYPE *OMSetStencilRef )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT StencilRef);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPipelineState)
+ void ( STDMETHODCALLTYPE *SetPipelineState )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12PipelineState *pPipelineState);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteBundle)
+ void ( STDMETHODCALLTYPE *ExecuteBundle )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12GraphicsCommandList *pCommandList);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetDescriptorHeaps)
+ void ( STDMETHODCALLTYPE *SetDescriptorHeaps )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT NumDescriptorHeaps,
+ _In_reads_(NumDescriptorHeaps) ID3D12DescriptorHeap *const *ppDescriptorHeaps);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootSignature)
+ void ( STDMETHODCALLTYPE *SetComputeRootSignature )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_opt_ ID3D12RootSignature *pRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootSignature)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootSignature )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_opt_ ID3D12RootSignature *pRootSignature);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootDescriptorTable)
+ void ( STDMETHODCALLTYPE *SetComputeRootDescriptorTable )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootDescriptorTable)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootDescriptorTable )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE BaseDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstant)
+ void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstant )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT SrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstant)
+ void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstant )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT SrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRoot32BitConstants)
+ void ( STDMETHODCALLTYPE *SetComputeRoot32BitConstants )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT Num32BitValuesToSet,
+ _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRoot32BitConstants)
+ void ( STDMETHODCALLTYPE *SetGraphicsRoot32BitConstants )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ UINT Num32BitValuesToSet,
+ _In_reads_(Num32BitValuesToSet*sizeof(UINT)) const void *pSrcData,
+ _In_ UINT DestOffsetIn32BitValues);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootConstantBufferView)
+ void ( STDMETHODCALLTYPE *SetComputeRootConstantBufferView )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootConstantBufferView)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootConstantBufferView )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootShaderResourceView)
+ void ( STDMETHODCALLTYPE *SetComputeRootShaderResourceView )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootShaderResourceView)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootShaderResourceView )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetComputeRootUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *SetComputeRootUnorderedAccessView )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetGraphicsRootUnorderedAccessView)
+ void ( STDMETHODCALLTYPE *SetGraphicsRootUnorderedAccessView )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT RootParameterIndex,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS BufferLocation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetIndexBuffer)
+ void ( STDMETHODCALLTYPE *IASetIndexBuffer )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_opt_ const D3D12_INDEX_BUFFER_VIEW *pView);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, IASetVertexBuffers)
+ void ( STDMETHODCALLTYPE *IASetVertexBuffers )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT StartSlot,
+ _In_ UINT NumViews,
+ _In_reads_opt_(NumViews) const D3D12_VERTEX_BUFFER_VIEW *pViews);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SOSetTargets)
+ void ( STDMETHODCALLTYPE *SOSetTargets )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT StartSlot,
+ _In_ UINT NumViews,
+ _In_reads_opt_(NumViews) const D3D12_STREAM_OUTPUT_BUFFER_VIEW *pViews);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, OMSetRenderTargets)
+ void ( STDMETHODCALLTYPE *OMSetRenderTargets )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT NumRenderTargetDescriptors,
+ _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pRenderTargetDescriptors,
+ _In_ BOOL RTsSingleHandleToDescriptorRange,
+ _In_opt_ const D3D12_CPU_DESCRIPTOR_HANDLE *pDepthStencilDescriptor);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearDepthStencilView)
+ void ( STDMETHODCALLTYPE *ClearDepthStencilView )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE DepthStencilView,
+ _In_ D3D12_CLEAR_FLAGS ClearFlags,
+ _In_ FLOAT Depth,
+ _In_ UINT8 Stencil,
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearRenderTargetView)
+ void ( STDMETHODCALLTYPE *ClearRenderTargetView )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE RenderTargetView,
+ _In_ const FLOAT ColorRGBA[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewUint)
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewUint )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle,
+ _In_ ID3D12Resource *pResource,
+ _In_ const UINT Values[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ClearUnorderedAccessViewFloat)
+ void ( STDMETHODCALLTYPE *ClearUnorderedAccessViewFloat )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ D3D12_GPU_DESCRIPTOR_HANDLE ViewGPUHandleInCurrentHeap,
+ _In_ D3D12_CPU_DESCRIPTOR_HANDLE ViewCPUHandle,
+ _In_ ID3D12Resource *pResource,
+ _In_ const FLOAT Values[ 4 ],
+ _In_ UINT NumRects,
+ _In_reads_(NumRects) const D3D12_RECT *pRects);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12GraphicsCommandList8 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12GraphicsCommandList8 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12GraphicsCommandList8 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList, ExecuteIndirect)
+ void ( STDMETHODCALLTYPE *ExecuteIndirect )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12CommandSignature *pCommandSignature,
+ _In_ UINT MaxCommandCount,
+ _In_ ID3D12Resource *pArgumentBuffer,
+ _In_ UINT64 ArgumentBufferOffset,
+ _In_opt_ ID3D12Resource *pCountBuffer,
+ _In_ UINT64 CountBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT)
+ void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT Dependencies,
+ _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
+ _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, AtomicCopyBufferUINT64)
+ void ( STDMETHODCALLTYPE *AtomicCopyBufferUINT64 )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12Resource *pDstBuffer,
+ UINT64 DstOffset,
+ _In_ ID3D12Resource *pSrcBuffer,
+ UINT64 SrcOffset,
+ UINT Dependencies,
+ _In_reads_(Dependencies) ID3D12Resource *const *ppDependentResources,
+ _In_reads_(Dependencies) const D3D12_SUBRESOURCE_RANGE_UINT64 *pDependentSubresourceRanges);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, OMSetDepthBounds)
+ void ( STDMETHODCALLTYPE *OMSetDepthBounds )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ FLOAT Min,
+ _In_ FLOAT Max);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetSamplePositions)
+ void ( STDMETHODCALLTYPE *SetSamplePositions )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT NumSamplesPerPixel,
+ _In_ UINT NumPixels,
+ _In_reads_(NumSamplesPerPixel*NumPixels) D3D12_SAMPLE_POSITION *pSamplePositions);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, ResolveSubresourceRegion)
+ void ( STDMETHODCALLTYPE *ResolveSubresourceRegion )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12Resource *pDstResource,
+ _In_ UINT DstSubresource,
+ _In_ UINT DstX,
+ _In_ UINT DstY,
+ _In_ ID3D12Resource *pSrcResource,
+ _In_ UINT SrcSubresource,
+ _In_opt_ D3D12_RECT *pSrcRect,
+ _In_ DXGI_FORMAT Format,
+ _In_ D3D12_RESOLVE_MODE ResolveMode);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList1, SetViewInstanceMask)
+ void ( STDMETHODCALLTYPE *SetViewInstanceMask )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT Mask);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList2, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12GraphicsCommandList8 * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList3, SetProtectedResourceSession)
+ void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BeginRenderPass)
+ void ( STDMETHODCALLTYPE *BeginRenderPass )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT NumRenderTargets,
+ _In_reads_opt_(NumRenderTargets) const D3D12_RENDER_PASS_RENDER_TARGET_DESC *pRenderTargets,
+ _In_opt_ const D3D12_RENDER_PASS_DEPTH_STENCIL_DESC *pDepthStencil,
+ D3D12_RENDER_PASS_FLAGS Flags);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EndRenderPass)
+ void ( STDMETHODCALLTYPE *EndRenderPass )(
+ ID3D12GraphicsCommandList8 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, InitializeMetaCommand)
+ void ( STDMETHODCALLTYPE *InitializeMetaCommand )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12MetaCommand *pMetaCommand,
+ _In_reads_bytes_opt_(InitializationParametersDataSizeInBytes) const void *pInitializationParametersData,
+ _In_ SIZE_T InitializationParametersDataSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, ExecuteMetaCommand)
+ void ( STDMETHODCALLTYPE *ExecuteMetaCommand )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12MetaCommand *pMetaCommand,
+ _In_reads_bytes_opt_(ExecutionParametersDataSizeInBytes) const void *pExecutionParametersData,
+ _In_ SIZE_T ExecutionParametersDataSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, BuildRaytracingAccelerationStructure)
+ void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc,
+ _In_ UINT NumPostbuildInfoDescs,
+ _In_reads_opt_(NumPostbuildInfoDescs) const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pPostbuildInfoDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, EmitRaytracingAccelerationStructurePostbuildInfo)
+ void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostbuildInfo )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ const D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_DESC *pDesc,
+ _In_ UINT NumSourceAccelerationStructures,
+ _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, CopyRaytracingAccelerationStructure)
+ void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS DestAccelerationStructureData,
+ _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData,
+ _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, SetPipelineState1)
+ void ( STDMETHODCALLTYPE *SetPipelineState1 )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ ID3D12StateObject *pStateObject);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList4, DispatchRays)
+ void ( STDMETHODCALLTYPE *DispatchRays )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRate)
+ void ( STDMETHODCALLTYPE *RSSetShadingRate )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ D3D12_SHADING_RATE baseShadingRate,
+ _In_reads_opt_(D3D12_RS_SET_SHADING_RATE_COMBINER_COUNT) const D3D12_SHADING_RATE_COMBINER *combiners);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList5, RSSetShadingRateImage)
+ void ( STDMETHODCALLTYPE *RSSetShadingRateImage )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_opt_ ID3D12Resource *shadingRateImage);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList6, DispatchMesh)
+ void ( STDMETHODCALLTYPE *DispatchMesh )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT ThreadGroupCountX,
+ _In_ UINT ThreadGroupCountY,
+ _In_ UINT ThreadGroupCountZ);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList7, Barrier)
+ void ( STDMETHODCALLTYPE *Barrier )(
+ ID3D12GraphicsCommandList8 * This,
+ UINT32 NumBarrierGroups,
+ _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups);
+
+ DECLSPEC_XFGVIRT(ID3D12GraphicsCommandList8, OMSetFrontAndBackStencilRef)
+ void ( STDMETHODCALLTYPE *OMSetFrontAndBackStencilRef )(
+ ID3D12GraphicsCommandList8 * This,
+ _In_ UINT FrontStencilRef,
+ _In_ UINT BackStencilRef);
+
+ END_INTERFACE
+ } ID3D12GraphicsCommandList8Vtbl;
+
+ interface ID3D12GraphicsCommandList8
+ {
+ CONST_VTBL struct ID3D12GraphicsCommandList8Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12GraphicsCommandList8_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12GraphicsCommandList8_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12GraphicsCommandList8_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12GraphicsCommandList8_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12GraphicsCommandList8_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12GraphicsCommandList8_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12GraphicsCommandList8_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12GraphicsCommandList8_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12GraphicsCommandList8_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12GraphicsCommandList8_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12GraphicsCommandList8_Reset(This,pAllocator,pInitialState) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator,pInitialState) )
+
+#define ID3D12GraphicsCommandList8_ClearState(This,pPipelineState) \
+ ( (This)->lpVtbl -> ClearState(This,pPipelineState) )
+
+#define ID3D12GraphicsCommandList8_DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawInstanced(This,VertexCountPerInstance,InstanceCount,StartVertexLocation,StartInstanceLocation) )
+
+#define ID3D12GraphicsCommandList8_DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) \
+ ( (This)->lpVtbl -> DrawIndexedInstanced(This,IndexCountPerInstance,InstanceCount,StartIndexLocation,BaseVertexLocation,StartInstanceLocation) )
+
+#define ID3D12GraphicsCommandList8_Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \
+ ( (This)->lpVtbl -> Dispatch(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) )
+
+#define ID3D12GraphicsCommandList8_CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) \
+ ( (This)->lpVtbl -> CopyBufferRegion(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,NumBytes) )
+
+#define ID3D12GraphicsCommandList8_CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) \
+ ( (This)->lpVtbl -> CopyTextureRegion(This,pDst,DstX,DstY,DstZ,pSrc,pSrcBox) )
+
+#define ID3D12GraphicsCommandList8_CopyResource(This,pDstResource,pSrcResource) \
+ ( (This)->lpVtbl -> CopyResource(This,pDstResource,pSrcResource) )
+
+#define ID3D12GraphicsCommandList8_CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) \
+ ( (This)->lpVtbl -> CopyTiles(This,pTiledResource,pTileRegionStartCoordinate,pTileRegionSize,pBuffer,BufferStartOffsetInBytes,Flags) )
+
+#define ID3D12GraphicsCommandList8_ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) \
+ ( (This)->lpVtbl -> ResolveSubresource(This,pDstResource,DstSubresource,pSrcResource,SrcSubresource,Format) )
+
+#define ID3D12GraphicsCommandList8_IASetPrimitiveTopology(This,PrimitiveTopology) \
+ ( (This)->lpVtbl -> IASetPrimitiveTopology(This,PrimitiveTopology) )
+
+#define ID3D12GraphicsCommandList8_RSSetViewports(This,NumViewports,pViewports) \
+ ( (This)->lpVtbl -> RSSetViewports(This,NumViewports,pViewports) )
+
+#define ID3D12GraphicsCommandList8_RSSetScissorRects(This,NumRects,pRects) \
+ ( (This)->lpVtbl -> RSSetScissorRects(This,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList8_OMSetBlendFactor(This,BlendFactor) \
+ ( (This)->lpVtbl -> OMSetBlendFactor(This,BlendFactor) )
+
+#define ID3D12GraphicsCommandList8_OMSetStencilRef(This,StencilRef) \
+ ( (This)->lpVtbl -> OMSetStencilRef(This,StencilRef) )
+
+#define ID3D12GraphicsCommandList8_SetPipelineState(This,pPipelineState) \
+ ( (This)->lpVtbl -> SetPipelineState(This,pPipelineState) )
+
+#define ID3D12GraphicsCommandList8_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12GraphicsCommandList8_ExecuteBundle(This,pCommandList) \
+ ( (This)->lpVtbl -> ExecuteBundle(This,pCommandList) )
+
+#define ID3D12GraphicsCommandList8_SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) \
+ ( (This)->lpVtbl -> SetDescriptorHeaps(This,NumDescriptorHeaps,ppDescriptorHeaps) )
+
+#define ID3D12GraphicsCommandList8_SetComputeRootSignature(This,pRootSignature) \
+ ( (This)->lpVtbl -> SetComputeRootSignature(This,pRootSignature) )
+
+#define ID3D12GraphicsCommandList8_SetGraphicsRootSignature(This,pRootSignature) \
+ ( (This)->lpVtbl -> SetGraphicsRootSignature(This,pRootSignature) )
+
+#define ID3D12GraphicsCommandList8_SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \
+ ( (This)->lpVtbl -> SetComputeRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) )
+
+#define ID3D12GraphicsCommandList8_SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) \
+ ( (This)->lpVtbl -> SetGraphicsRootDescriptorTable(This,RootParameterIndex,BaseDescriptor) )
+
+#define ID3D12GraphicsCommandList8_SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetComputeRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList8_SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstant(This,RootParameterIndex,SrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList8_SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetComputeRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList8_SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) \
+ ( (This)->lpVtbl -> SetGraphicsRoot32BitConstants(This,RootParameterIndex,Num32BitValuesToSet,pSrcData,DestOffsetIn32BitValues) )
+
+#define ID3D12GraphicsCommandList8_SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootConstantBufferView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList8_SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootConstantBufferView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList8_SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootShaderResourceView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList8_SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootShaderResourceView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList8_SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetComputeRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList8_SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) \
+ ( (This)->lpVtbl -> SetGraphicsRootUnorderedAccessView(This,RootParameterIndex,BufferLocation) )
+
+#define ID3D12GraphicsCommandList8_IASetIndexBuffer(This,pView) \
+ ( (This)->lpVtbl -> IASetIndexBuffer(This,pView) )
+
+#define ID3D12GraphicsCommandList8_IASetVertexBuffers(This,StartSlot,NumViews,pViews) \
+ ( (This)->lpVtbl -> IASetVertexBuffers(This,StartSlot,NumViews,pViews) )
+
+#define ID3D12GraphicsCommandList8_SOSetTargets(This,StartSlot,NumViews,pViews) \
+ ( (This)->lpVtbl -> SOSetTargets(This,StartSlot,NumViews,pViews) )
+
+#define ID3D12GraphicsCommandList8_OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) \
+ ( (This)->lpVtbl -> OMSetRenderTargets(This,NumRenderTargetDescriptors,pRenderTargetDescriptors,RTsSingleHandleToDescriptorRange,pDepthStencilDescriptor) )
+
+#define ID3D12GraphicsCommandList8_ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearDepthStencilView(This,DepthStencilView,ClearFlags,Depth,Stencil,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList8_ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearRenderTargetView(This,RenderTargetView,ColorRGBA,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList8_ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewUint(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList8_ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) \
+ ( (This)->lpVtbl -> ClearUnorderedAccessViewFloat(This,ViewGPUHandleInCurrentHeap,ViewCPUHandle,pResource,Values,NumRects,pRects) )
+
+#define ID3D12GraphicsCommandList8_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12GraphicsCommandList8_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12GraphicsCommandList8_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12GraphicsCommandList8_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12GraphicsCommandList8_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12GraphicsCommandList8_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12GraphicsCommandList8_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12GraphicsCommandList8_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12GraphicsCommandList8_ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) \
+ ( (This)->lpVtbl -> ExecuteIndirect(This,pCommandSignature,MaxCommandCount,pArgumentBuffer,ArgumentBufferOffset,pCountBuffer,CountBufferOffset) )
+
+
+#define ID3D12GraphicsCommandList8_AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \
+ ( (This)->lpVtbl -> AtomicCopyBufferUINT(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) )
+
+#define ID3D12GraphicsCommandList8_AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) \
+ ( (This)->lpVtbl -> AtomicCopyBufferUINT64(This,pDstBuffer,DstOffset,pSrcBuffer,SrcOffset,Dependencies,ppDependentResources,pDependentSubresourceRanges) )
+
+#define ID3D12GraphicsCommandList8_OMSetDepthBounds(This,Min,Max) \
+ ( (This)->lpVtbl -> OMSetDepthBounds(This,Min,Max) )
+
+#define ID3D12GraphicsCommandList8_SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) \
+ ( (This)->lpVtbl -> SetSamplePositions(This,NumSamplesPerPixel,NumPixels,pSamplePositions) )
+
+#define ID3D12GraphicsCommandList8_ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) \
+ ( (This)->lpVtbl -> ResolveSubresourceRegion(This,pDstResource,DstSubresource,DstX,DstY,pSrcResource,SrcSubresource,pSrcRect,Format,ResolveMode) )
+
+#define ID3D12GraphicsCommandList8_SetViewInstanceMask(This,Mask) \
+ ( (This)->lpVtbl -> SetViewInstanceMask(This,Mask) )
+
+
+#define ID3D12GraphicsCommandList8_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+
+#define ID3D12GraphicsCommandList8_SetProtectedResourceSession(This,pProtectedResourceSession) \
+ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
+
+
+#define ID3D12GraphicsCommandList8_BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) \
+ ( (This)->lpVtbl -> BeginRenderPass(This,NumRenderTargets,pRenderTargets,pDepthStencil,Flags) )
+
+#define ID3D12GraphicsCommandList8_EndRenderPass(This) \
+ ( (This)->lpVtbl -> EndRenderPass(This) )
+
+#define ID3D12GraphicsCommandList8_InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) \
+ ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,pInitializationParametersData,InitializationParametersDataSizeInBytes) )
+
+#define ID3D12GraphicsCommandList8_ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) \
+ ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,pExecutionParametersData,ExecutionParametersDataSizeInBytes) )
+
+#define ID3D12GraphicsCommandList8_BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) \
+ ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc,NumPostbuildInfoDescs,pPostbuildInfoDescs) )
+
+#define ID3D12GraphicsCommandList8_EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \
+ ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostbuildInfo(This,pDesc,NumSourceAccelerationStructures,pSourceAccelerationStructureData) )
+
+#define ID3D12GraphicsCommandList8_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \
+ ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) )
+
+#define ID3D12GraphicsCommandList8_SetPipelineState1(This,pStateObject) \
+ ( (This)->lpVtbl -> SetPipelineState1(This,pStateObject) )
+
+#define ID3D12GraphicsCommandList8_DispatchRays(This,pDesc) \
+ ( (This)->lpVtbl -> DispatchRays(This,pDesc) )
+
+
+#define ID3D12GraphicsCommandList8_RSSetShadingRate(This,baseShadingRate,combiners) \
+ ( (This)->lpVtbl -> RSSetShadingRate(This,baseShadingRate,combiners) )
+
+#define ID3D12GraphicsCommandList8_RSSetShadingRateImage(This,shadingRateImage) \
+ ( (This)->lpVtbl -> RSSetShadingRateImage(This,shadingRateImage) )
+
+
+#define ID3D12GraphicsCommandList8_DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) \
+ ( (This)->lpVtbl -> DispatchMesh(This,ThreadGroupCountX,ThreadGroupCountY,ThreadGroupCountZ) )
+
+
+#define ID3D12GraphicsCommandList8_Barrier(This,NumBarrierGroups,pBarrierGroups) \
+ ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) )
+
+
+#define ID3D12GraphicsCommandList8_OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) \
+ ( (This)->lpVtbl -> OMSetFrontAndBackStencilRef(This,FrontStencilRef,BackStencilRef) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12GraphicsCommandList8_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12_0000_0065 */
/* [local] */
+#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */
+//#pragma endregion
DEFINE_GUID(IID_ID3D12Object,0xc4fec28f,0x7966,0x4e95,0x9f,0x94,0xf4,0x31,0xcb,0x56,0xc3,0xb8);
DEFINE_GUID(IID_ID3D12DeviceChild,0x905db94b,0xa00c,0x4140,0x9d,0xf5,0x2b,0x64,0xca,0x9e,0xa3,0x57);
DEFINE_GUID(IID_ID3D12RootSignature,0xc54a6b66,0x72df,0x4ee8,0x8b,0xe5,0xa9,0x46,0xa1,0x42,0x92,0x14);
@@ -17226,19 +28659,39 @@ DEFINE_GUID(IID_ID3D12StateObject,0x47016943,0xfca8,0x4594,0x93,0xea,0xaf,0x25,0
DEFINE_GUID(IID_ID3D12StateObjectProperties,0xde5fa827,0x9bf9,0x4f26,0x89,0xff,0xd7,0xf5,0x6f,0xde,0x38,0x60);
DEFINE_GUID(IID_ID3D12Device5,0x8b4f173b,0x2fea,0x4b80,0x8f,0x58,0x43,0x07,0x19,0x1a,0xb9,0x5d);
DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings,0x82BC481C,0x6B9B,0x4030,0xAE,0xDB,0x7E,0xE3,0xD1,0xDF,0x1E,0x63);
+DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings1,0xDBD5AE51,0x3317,0x4F0A,0xAD,0xF9,0x1D,0x7C,0xED,0xCA,0xAE,0x0B);
+DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedDataSettings2,0x61552388,0x01ab,0x4008,0xa4,0x36,0x83,0xdb,0x18,0x95,0x66,0xea);
DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedData,0x98931D33,0x5AE8,0x4791,0xAA,0x3C,0x1A,0x73,0xA2,0x93,0x4E,0x71);
+DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedData1,0x9727A022,0xCF1D,0x4DDA,0x9E,0xBA,0xEF,0xFA,0x65,0x3F,0xC5,0x06);
+DEFINE_GUID(IID_ID3D12DeviceRemovedExtendedData2,0x67FC5816,0xE4CA,0x4915,0xBF,0x18,0x42,0x54,0x12,0x72,0xDA,0x54);
DEFINE_GUID(IID_ID3D12Device6,0xc70b221b,0x40e4,0x4a17,0x89,0xaf,0x02,0x5a,0x07,0x27,0xa6,0xdc);
+DEFINE_GUID(IID_ID3D12ProtectedResourceSession1,0xD6F12DD6,0x76FB,0x406E,0x89,0x61,0x42,0x96,0xEE,0xFC,0x04,0x09);
+DEFINE_GUID(IID_ID3D12Device7,0x5c014b53,0x68a1,0x4b9b,0x8b,0xd1,0xdd,0x60,0x46,0xb9,0x35,0x8b);
+DEFINE_GUID(IID_ID3D12Device8,0x9218E6BB,0xF944,0x4F7E,0xA7,0x5C,0xB1,0xB2,0xC7,0xB7,0x01,0xF3);
DEFINE_GUID(IID_ID3D12Resource1,0x9D5E227A,0x4430,0x4161,0x88,0xB3,0x3E,0xCA,0x6B,0xB1,0x6E,0x19);
+DEFINE_GUID(IID_ID3D12Resource2,0xBE36EC3B,0xEA85,0x4AEB,0xA4,0x5A,0xE9,0xD7,0x64,0x04,0xA4,0x95);
DEFINE_GUID(IID_ID3D12Heap1,0x572F7389,0x2168,0x49E3,0x96,0x93,0xD6,0xDF,0x58,0x71,0xBF,0x6D);
DEFINE_GUID(IID_ID3D12GraphicsCommandList3,0x6FDA83A7,0xB84C,0x4E38,0x9A,0xC8,0xC7,0xBD,0x22,0x01,0x6B,0x3D);
DEFINE_GUID(IID_ID3D12MetaCommand,0xDBB84C27,0x36CE,0x4FC9,0xB8,0x01,0xF0,0x48,0xC4,0x6A,0xC5,0x70);
DEFINE_GUID(IID_ID3D12GraphicsCommandList4,0x8754318e,0xd3a9,0x4541,0x98,0xcf,0x64,0x5b,0x50,0xdc,0x48,0x74);
+DEFINE_GUID(IID_ID3D12ShaderCacheSession,0x28e2495d,0x0f64,0x4ae4,0xa6,0xec,0x12,0x92,0x55,0xdc,0x49,0xa8);
+DEFINE_GUID(IID_ID3D12Device9,0x4c80e962,0xf032,0x4f60,0xbc,0x9e,0xeb,0xc2,0xcf,0xa1,0xd8,0x3c);
+DEFINE_GUID(IID_ID3D12Device10,0x517f8718,0xaa66,0x49f9,0xb0,0x2b,0xa7,0xab,0x89,0xc0,0x60,0x31);
+DEFINE_GUID(IID_ID3D12Device11,0x5405c344,0xd457,0x444e,0xb4,0xdd,0x23,0x66,0xe4,0x5a,0xee,0x39);
+DEFINE_GUID(IID_ID3D12VirtualizationGuestDevice,0xbc66d368,0x7373,0x4943,0x87,0x57,0xfc,0x87,0xdc,0x79,0xe4,0x76);
DEFINE_GUID(IID_ID3D12Tools,0x7071e1f0,0xe84b,0x4b33,0x97,0x4f,0x12,0xfa,0x49,0xde,0x65,0xc5);
+DEFINE_GUID(IID_ID3D12SDKConfiguration,0xe9eb5314,0x33aa,0x42b2,0xa7,0x18,0xd7,0x7f,0x58,0xb1,0xf1,0xc7);
+DEFINE_GUID(IID_ID3D12SDKConfiguration1,0x8aaf9303,0xad25,0x48b9,0x9a,0x57,0xd9,0xc3,0x7e,0x00,0x9d,0x9f);
+DEFINE_GUID(IID_ID3D12DeviceFactory,0x61f307d3,0xd34e,0x4e7c,0x83,0x74,0x3b,0xa4,0xde,0x23,0xcc,0xcb);
+DEFINE_GUID(IID_ID3D12DeviceConfiguration,0x78dbf87b,0xf766,0x422b,0xa6,0x1c,0xc8,0xc4,0x46,0xbd,0xb9,0xad);
DEFINE_GUID(IID_ID3D12GraphicsCommandList5,0x55050859,0x4024,0x474c,0x87,0xf5,0x64,0x72,0xea,0xee,0x44,0xea);
+DEFINE_GUID(IID_ID3D12GraphicsCommandList6,0xc3827890,0xe548,0x4cfa,0x96,0xcf,0x56,0x89,0xa9,0x37,0x0f,0x80);
+DEFINE_GUID(IID_ID3D12GraphicsCommandList7,0xdd171223,0x8b61,0x4769,0x90,0xe3,0x16,0x0c,0xcd,0xe4,0xe2,0xc1);
+DEFINE_GUID(IID_ID3D12GraphicsCommandList8,0xee936ef9,0x599d,0x4d28,0x93,0x8e,0x23,0xc4,0xad,0x05,0xce,0x51);
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0045_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0045_v0_0_s_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0065_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12_0000_0065_v0_0_s_ifspec;
/* Additional Prototypes for ALL interfaces */
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12compatibility.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12compatibility.h
new file mode 100644
index 00000000000..1a9430e5c92
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12compatibility.h
@@ -0,0 +1,739 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ * Licensed under the MIT license
+ *
+ *-------------------------------------------------------------------------------------*/
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.01.0628 */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __d3d12compatibility_h__
+#define __d3d12compatibility_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+#ifndef DECLSPEC_XFGVIRT
+#if defined(_CONTROL_FLOW_GUARD_XFG)
+#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func))
+#else
+#define DECLSPEC_XFGVIRT(base, func)
+#endif
+#endif
+
+/* Forward Declarations */
+
+#ifndef __ID3D12CompatibilityDevice_FWD_DEFINED__
+#define __ID3D12CompatibilityDevice_FWD_DEFINED__
+typedef interface ID3D12CompatibilityDevice ID3D12CompatibilityDevice;
+
+#endif /* __ID3D12CompatibilityDevice_FWD_DEFINED__ */
+
+
+#ifndef __D3D11On12CreatorID_FWD_DEFINED__
+#define __D3D11On12CreatorID_FWD_DEFINED__
+typedef interface D3D11On12CreatorID D3D11On12CreatorID;
+
+#endif /* __D3D11On12CreatorID_FWD_DEFINED__ */
+
+
+#ifndef __D3D9On12CreatorID_FWD_DEFINED__
+#define __D3D9On12CreatorID_FWD_DEFINED__
+typedef interface D3D9On12CreatorID D3D9On12CreatorID;
+
+#endif /* __D3D9On12CreatorID_FWD_DEFINED__ */
+
+
+#ifndef __OpenGLOn12CreatorID_FWD_DEFINED__
+#define __OpenGLOn12CreatorID_FWD_DEFINED__
+typedef interface OpenGLOn12CreatorID OpenGLOn12CreatorID;
+
+#endif /* __OpenGLOn12CreatorID_FWD_DEFINED__ */
+
+
+#ifndef __OpenCLOn12CreatorID_FWD_DEFINED__
+#define __OpenCLOn12CreatorID_FWD_DEFINED__
+typedef interface OpenCLOn12CreatorID OpenCLOn12CreatorID;
+
+#endif /* __OpenCLOn12CreatorID_FWD_DEFINED__ */
+
+
+#ifndef __DirectMLTensorFlowCreatorID_FWD_DEFINED__
+#define __DirectMLTensorFlowCreatorID_FWD_DEFINED__
+typedef interface DirectMLTensorFlowCreatorID DirectMLTensorFlowCreatorID;
+
+#endif /* __DirectMLTensorFlowCreatorID_FWD_DEFINED__ */
+
+
+#ifndef __DirectMLPyTorchCreatorID_FWD_DEFINED__
+#define __DirectMLPyTorchCreatorID_FWD_DEFINED__
+typedef interface DirectMLPyTorchCreatorID DirectMLPyTorchCreatorID;
+
+#endif /* __DirectMLPyTorchCreatorID_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+#include "d3d11on12.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_d3d12compatibility_0000_0000 */
+/* [local] */
+
+#include <winapifamily.h>
+#pragma region Desktop Family
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES)
+typedef
+enum D3D12_COMPATIBILITY_SHARED_FLAGS
+ {
+ D3D12_COMPATIBILITY_SHARED_FLAG_NONE = 0,
+ D3D12_COMPATIBILITY_SHARED_FLAG_NON_NT_HANDLE = 0x1,
+ D3D12_COMPATIBILITY_SHARED_FLAG_KEYED_MUTEX = 0x2,
+ D3D12_COMPATIBILITY_SHARED_FLAG_9_ON_12 = 0x4
+ } D3D12_COMPATIBILITY_SHARED_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_COMPATIBILITY_SHARED_FLAGS );
+typedef
+enum D3D12_REFLECT_SHARED_PROPERTY
+ {
+ D3D12_REFLECT_SHARED_PROPERTY_D3D11_RESOURCE_FLAGS = 0,
+ D3D12_REFELCT_SHARED_PROPERTY_COMPATIBILITY_SHARED_FLAGS = ( D3D12_REFLECT_SHARED_PROPERTY_D3D11_RESOURCE_FLAGS + 1 ) ,
+ D3D12_REFLECT_SHARED_PROPERTY_NON_NT_SHARED_HANDLE = ( D3D12_REFELCT_SHARED_PROPERTY_COMPATIBILITY_SHARED_FLAGS + 1 )
+ } D3D12_REFLECT_SHARED_PROPERTY;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0000_v0_0_s_ifspec;
+
+#ifndef __ID3D12CompatibilityDevice_INTERFACE_DEFINED__
+#define __ID3D12CompatibilityDevice_INTERFACE_DEFINED__
+
+/* interface ID3D12CompatibilityDevice */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12CompatibilityDevice;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("8f1c0e3c-fae3-4a82-b098-bfe1708207ff")
+ ID3D12CompatibilityDevice : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CreateSharedResource(
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ const D3D11_RESOURCE_FLAGS *pFlags11,
+ D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags,
+ _In_opt_ ID3D12LifetimeTracker *pLifetimeTracker,
+ _In_opt_ ID3D12SwapChainAssistant *pOwningSwapchain,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppResource) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateSharedHeap(
+ _In_ const D3D12_HEAP_DESC *pHeapDesc,
+ D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppHeap) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ReflectSharedProperties(
+ _In_ ID3D12Object *pHeapOrResource,
+ D3D12_REFLECT_SHARED_PROPERTY ReflectType,
+ _Out_writes_bytes_(DataSize) void *pData,
+ UINT DataSize) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12CompatibilityDeviceVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12CompatibilityDevice * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12CompatibilityDevice * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12CompatibilityDevice * This);
+
+ DECLSPEC_XFGVIRT(ID3D12CompatibilityDevice, CreateSharedResource)
+ HRESULT ( STDMETHODCALLTYPE *CreateSharedResource )(
+ ID3D12CompatibilityDevice * This,
+ _In_ const D3D12_HEAP_PROPERTIES *pHeapProperties,
+ D3D12_HEAP_FLAGS HeapFlags,
+ _In_ const D3D12_RESOURCE_DESC *pDesc,
+ D3D12_RESOURCE_STATES InitialResourceState,
+ _In_opt_ const D3D12_CLEAR_VALUE *pOptimizedClearValue,
+ _In_opt_ const D3D11_RESOURCE_FLAGS *pFlags11,
+ D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags,
+ _In_opt_ ID3D12LifetimeTracker *pLifetimeTracker,
+ _In_opt_ ID3D12SwapChainAssistant *pOwningSwapchain,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppResource);
+
+ DECLSPEC_XFGVIRT(ID3D12CompatibilityDevice, CreateSharedHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateSharedHeap )(
+ ID3D12CompatibilityDevice * This,
+ _In_ const D3D12_HEAP_DESC *pHeapDesc,
+ D3D12_COMPATIBILITY_SHARED_FLAGS CompatibilityFlags,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12CompatibilityDevice, ReflectSharedProperties)
+ HRESULT ( STDMETHODCALLTYPE *ReflectSharedProperties )(
+ ID3D12CompatibilityDevice * This,
+ _In_ ID3D12Object *pHeapOrResource,
+ D3D12_REFLECT_SHARED_PROPERTY ReflectType,
+ _Out_writes_bytes_(DataSize) void *pData,
+ UINT DataSize);
+
+ END_INTERFACE
+ } ID3D12CompatibilityDeviceVtbl;
+
+ interface ID3D12CompatibilityDevice
+ {
+ CONST_VTBL struct ID3D12CompatibilityDeviceVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12CompatibilityDevice_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12CompatibilityDevice_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12CompatibilityDevice_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12CompatibilityDevice_CreateSharedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pFlags11,CompatibilityFlags,pLifetimeTracker,pOwningSwapchain,riid,ppResource) \
+ ( (This)->lpVtbl -> CreateSharedResource(This,pHeapProperties,HeapFlags,pDesc,InitialResourceState,pOptimizedClearValue,pFlags11,CompatibilityFlags,pLifetimeTracker,pOwningSwapchain,riid,ppResource) )
+
+#define ID3D12CompatibilityDevice_CreateSharedHeap(This,pHeapDesc,CompatibilityFlags,riid,ppHeap) \
+ ( (This)->lpVtbl -> CreateSharedHeap(This,pHeapDesc,CompatibilityFlags,riid,ppHeap) )
+
+#define ID3D12CompatibilityDevice_ReflectSharedProperties(This,pHeapOrResource,ReflectType,pData,DataSize) \
+ ( (This)->lpVtbl -> ReflectSharedProperties(This,pHeapOrResource,ReflectType,pData,DataSize) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12CompatibilityDevice_INTERFACE_DEFINED__ */
+
+
+#ifndef __D3D11On12CreatorID_INTERFACE_DEFINED__
+#define __D3D11On12CreatorID_INTERFACE_DEFINED__
+
+/* interface D3D11On12CreatorID */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_D3D11On12CreatorID;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("edbf5678-2960-4e81-8429-99d4b2630c4e")
+ D3D11On12CreatorID : public IUnknown
+ {
+ public:
+ };
+
+
+#else /* C style interface */
+
+ typedef struct D3D11On12CreatorIDVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ D3D11On12CreatorID * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ D3D11On12CreatorID * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ D3D11On12CreatorID * This);
+
+ END_INTERFACE
+ } D3D11On12CreatorIDVtbl;
+
+ interface D3D11On12CreatorID
+ {
+ CONST_VTBL struct D3D11On12CreatorIDVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define D3D11On12CreatorID_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define D3D11On12CreatorID_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define D3D11On12CreatorID_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __D3D11On12CreatorID_INTERFACE_DEFINED__ */
+
+
+#ifndef __D3D9On12CreatorID_INTERFACE_DEFINED__
+#define __D3D9On12CreatorID_INTERFACE_DEFINED__
+
+/* interface D3D9On12CreatorID */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_D3D9On12CreatorID;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("fffcbb7f-15d3-42a2-841e-9d8d32f37ddd")
+ D3D9On12CreatorID : public IUnknown
+ {
+ public:
+ };
+
+
+#else /* C style interface */
+
+ typedef struct D3D9On12CreatorIDVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ D3D9On12CreatorID * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ D3D9On12CreatorID * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ D3D9On12CreatorID * This);
+
+ END_INTERFACE
+ } D3D9On12CreatorIDVtbl;
+
+ interface D3D9On12CreatorID
+ {
+ CONST_VTBL struct D3D9On12CreatorIDVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define D3D9On12CreatorID_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define D3D9On12CreatorID_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define D3D9On12CreatorID_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __D3D9On12CreatorID_INTERFACE_DEFINED__ */
+
+
+#ifndef __OpenGLOn12CreatorID_INTERFACE_DEFINED__
+#define __OpenGLOn12CreatorID_INTERFACE_DEFINED__
+
+/* interface OpenGLOn12CreatorID */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_OpenGLOn12CreatorID;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("6bb3cd34-0d19-45ab-97ed-d720ba3dfc80")
+ OpenGLOn12CreatorID : public IUnknown
+ {
+ public:
+ };
+
+
+#else /* C style interface */
+
+ typedef struct OpenGLOn12CreatorIDVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ OpenGLOn12CreatorID * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ OpenGLOn12CreatorID * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ OpenGLOn12CreatorID * This);
+
+ END_INTERFACE
+ } OpenGLOn12CreatorIDVtbl;
+
+ interface OpenGLOn12CreatorID
+ {
+ CONST_VTBL struct OpenGLOn12CreatorIDVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define OpenGLOn12CreatorID_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define OpenGLOn12CreatorID_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define OpenGLOn12CreatorID_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __OpenGLOn12CreatorID_INTERFACE_DEFINED__ */
+
+
+#ifndef __OpenCLOn12CreatorID_INTERFACE_DEFINED__
+#define __OpenCLOn12CreatorID_INTERFACE_DEFINED__
+
+/* interface OpenCLOn12CreatorID */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_OpenCLOn12CreatorID;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("3f76bb74-91b5-4a88-b126-20ca0331cd60")
+ OpenCLOn12CreatorID : public IUnknown
+ {
+ public:
+ };
+
+
+#else /* C style interface */
+
+ typedef struct OpenCLOn12CreatorIDVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ OpenCLOn12CreatorID * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ OpenCLOn12CreatorID * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ OpenCLOn12CreatorID * This);
+
+ END_INTERFACE
+ } OpenCLOn12CreatorIDVtbl;
+
+ interface OpenCLOn12CreatorID
+ {
+ CONST_VTBL struct OpenCLOn12CreatorIDVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define OpenCLOn12CreatorID_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define OpenCLOn12CreatorID_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define OpenCLOn12CreatorID_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __OpenCLOn12CreatorID_INTERFACE_DEFINED__ */
+
+
+#ifndef __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__
+#define __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__
+
+/* interface DirectMLTensorFlowCreatorID */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_DirectMLTensorFlowCreatorID;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("cb7490ac-8a0f-44ec-9b7b-6f4cafe8e9ab")
+ DirectMLTensorFlowCreatorID : public IUnknown
+ {
+ public:
+ };
+
+
+#else /* C style interface */
+
+ typedef struct DirectMLTensorFlowCreatorIDVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ DirectMLTensorFlowCreatorID * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ DirectMLTensorFlowCreatorID * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ DirectMLTensorFlowCreatorID * This);
+
+ END_INTERFACE
+ } DirectMLTensorFlowCreatorIDVtbl;
+
+ interface DirectMLTensorFlowCreatorID
+ {
+ CONST_VTBL struct DirectMLTensorFlowCreatorIDVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define DirectMLTensorFlowCreatorID_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define DirectMLTensorFlowCreatorID_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define DirectMLTensorFlowCreatorID_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __DirectMLTensorFlowCreatorID_INTERFACE_DEFINED__ */
+
+
+#ifndef __DirectMLPyTorchCreatorID_INTERFACE_DEFINED__
+#define __DirectMLPyTorchCreatorID_INTERFACE_DEFINED__
+
+/* interface DirectMLPyTorchCreatorID */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_DirectMLPyTorchCreatorID;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("af029192-fba1-4b05-9116-235e06560354")
+ DirectMLPyTorchCreatorID : public IUnknown
+ {
+ public:
+ };
+
+
+#else /* C style interface */
+
+ typedef struct DirectMLPyTorchCreatorIDVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ DirectMLPyTorchCreatorID * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ DirectMLPyTorchCreatorID * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ DirectMLPyTorchCreatorID * This);
+
+ END_INTERFACE
+ } DirectMLPyTorchCreatorIDVtbl;
+
+ interface DirectMLPyTorchCreatorID
+ {
+ CONST_VTBL struct DirectMLPyTorchCreatorIDVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define DirectMLPyTorchCreatorID_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define DirectMLPyTorchCreatorID_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define DirectMLPyTorchCreatorID_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __DirectMLPyTorchCreatorID_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12compatibility_0000_0007 */
+/* [local] */
+
+#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */
+#pragma endregion
+DEFINE_GUID(IID_ID3D12CompatibilityDevice,0x8f1c0e3c,0xfae3,0x4a82,0xb0,0x98,0xbf,0xe1,0x70,0x82,0x07,0xff);
+DEFINE_GUID(IID_D3D11On12CreatorID,0xedbf5678,0x2960,0x4e81,0x84,0x29,0x99,0xd4,0xb2,0x63,0x0c,0x4e);
+DEFINE_GUID(IID_D3D9On12CreatorID,0xfffcbb7f,0x15d3,0x42a2,0x84,0x1e,0x9d,0x8d,0x32,0xf3,0x7d,0xdd);
+DEFINE_GUID(IID_OpenGLOn12CreatorID,0x6bb3cd34,0x0d19,0x45ab,0x97,0xed,0xd7,0x20,0xba,0x3d,0xfc,0x80);
+DEFINE_GUID(IID_OpenCLOn12CreatorID,0x3f76bb74,0x91b5,0x4a88,0xb1,0x26,0x20,0xca,0x03,0x31,0xcd,0x60);
+DEFINE_GUID(IID_DirectMLTensorFlowCreatorID,0xcb7490ac,0x8a0f,0x44ec,0x9b,0x7b,0x6f,0x4c,0xaf,0xe8,0xe9,0xab);
+DEFINE_GUID(IID_DirectMLPyTorchCreatorID,0xaf029192,0xfba1,0x4b05,0x91,0x16,0x23,0x5e,0x06,0x56,0x03,0x54);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0007_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12compatibility_0000_0007_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12sdklayers.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12sdklayers.h
new file mode 100644
index 00000000000..8de3ef13a17
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12sdklayers.h
@@ -0,0 +1,4110 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ * Licensed under the MIT license
+ *
+ *-------------------------------------------------------------------------------------*/
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.01.0628 */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __d3d12sdklayers_h__
+#define __d3d12sdklayers_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+#ifndef DECLSPEC_XFGVIRT
+#if defined(_CONTROL_FLOW_GUARD_XFG)
+#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func))
+#else
+#define DECLSPEC_XFGVIRT(base, func)
+#endif
+#endif
+
+/* Forward Declarations */
+
+#ifndef __ID3D12Debug_FWD_DEFINED__
+#define __ID3D12Debug_FWD_DEFINED__
+typedef interface ID3D12Debug ID3D12Debug;
+
+#endif /* __ID3D12Debug_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Debug1_FWD_DEFINED__
+#define __ID3D12Debug1_FWD_DEFINED__
+typedef interface ID3D12Debug1 ID3D12Debug1;
+
+#endif /* __ID3D12Debug1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Debug2_FWD_DEFINED__
+#define __ID3D12Debug2_FWD_DEFINED__
+typedef interface ID3D12Debug2 ID3D12Debug2;
+
+#endif /* __ID3D12Debug2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Debug3_FWD_DEFINED__
+#define __ID3D12Debug3_FWD_DEFINED__
+typedef interface ID3D12Debug3 ID3D12Debug3;
+
+#endif /* __ID3D12Debug3_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Debug4_FWD_DEFINED__
+#define __ID3D12Debug4_FWD_DEFINED__
+typedef interface ID3D12Debug4 ID3D12Debug4;
+
+#endif /* __ID3D12Debug4_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Debug5_FWD_DEFINED__
+#define __ID3D12Debug5_FWD_DEFINED__
+typedef interface ID3D12Debug5 ID3D12Debug5;
+
+#endif /* __ID3D12Debug5_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12Debug6_FWD_DEFINED__
+#define __ID3D12Debug6_FWD_DEFINED__
+typedef interface ID3D12Debug6 ID3D12Debug6;
+
+#endif /* __ID3D12Debug6_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DebugDevice1_FWD_DEFINED__
+#define __ID3D12DebugDevice1_FWD_DEFINED__
+typedef interface ID3D12DebugDevice1 ID3D12DebugDevice1;
+
+#endif /* __ID3D12DebugDevice1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DebugDevice_FWD_DEFINED__
+#define __ID3D12DebugDevice_FWD_DEFINED__
+typedef interface ID3D12DebugDevice ID3D12DebugDevice;
+
+#endif /* __ID3D12DebugDevice_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DebugDevice2_FWD_DEFINED__
+#define __ID3D12DebugDevice2_FWD_DEFINED__
+typedef interface ID3D12DebugDevice2 ID3D12DebugDevice2;
+
+#endif /* __ID3D12DebugDevice2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DebugCommandQueue_FWD_DEFINED__
+#define __ID3D12DebugCommandQueue_FWD_DEFINED__
+typedef interface ID3D12DebugCommandQueue ID3D12DebugCommandQueue;
+
+#endif /* __ID3D12DebugCommandQueue_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DebugCommandQueue1_FWD_DEFINED__
+#define __ID3D12DebugCommandQueue1_FWD_DEFINED__
+typedef interface ID3D12DebugCommandQueue1 ID3D12DebugCommandQueue1;
+
+#endif /* __ID3D12DebugCommandQueue1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DebugCommandList1_FWD_DEFINED__
+#define __ID3D12DebugCommandList1_FWD_DEFINED__
+typedef interface ID3D12DebugCommandList1 ID3D12DebugCommandList1;
+
+#endif /* __ID3D12DebugCommandList1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DebugCommandList_FWD_DEFINED__
+#define __ID3D12DebugCommandList_FWD_DEFINED__
+typedef interface ID3D12DebugCommandList ID3D12DebugCommandList;
+
+#endif /* __ID3D12DebugCommandList_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DebugCommandList2_FWD_DEFINED__
+#define __ID3D12DebugCommandList2_FWD_DEFINED__
+typedef interface ID3D12DebugCommandList2 ID3D12DebugCommandList2;
+
+#endif /* __ID3D12DebugCommandList2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12DebugCommandList3_FWD_DEFINED__
+#define __ID3D12DebugCommandList3_FWD_DEFINED__
+typedef interface ID3D12DebugCommandList3 ID3D12DebugCommandList3;
+
+#endif /* __ID3D12DebugCommandList3_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12SharingContract_FWD_DEFINED__
+#define __ID3D12SharingContract_FWD_DEFINED__
+typedef interface ID3D12SharingContract ID3D12SharingContract;
+
+#endif /* __ID3D12SharingContract_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12InfoQueue_FWD_DEFINED__
+#define __ID3D12InfoQueue_FWD_DEFINED__
+typedef interface ID3D12InfoQueue ID3D12InfoQueue;
+
+#endif /* __ID3D12InfoQueue_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12InfoQueue1_FWD_DEFINED__
+#define __ID3D12InfoQueue1_FWD_DEFINED__
+typedef interface ID3D12InfoQueue1 ID3D12InfoQueue1;
+
+#endif /* __ID3D12InfoQueue1_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+#include "d3d12.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0000 */
+/* [local] */
+
+#include <winapifamily.h>
+//#pragma region App Family
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES)
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0000_v0_0_s_ifspec;
+
+#ifndef __ID3D12Debug_INTERFACE_DEFINED__
+#define __ID3D12Debug_INTERFACE_DEFINED__
+
+/* interface ID3D12Debug */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Debug;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("344488b7-6846-474b-b989-f027448245e0")
+ ID3D12Debug : public IUnknown
+ {
+ public:
+ virtual void STDMETHODCALLTYPE EnableDebugLayer( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Debug * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Debug * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Debug * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer)
+ void ( STDMETHODCALLTYPE *EnableDebugLayer )(
+ ID3D12Debug * This);
+
+ END_INTERFACE
+ } ID3D12DebugVtbl;
+
+ interface ID3D12Debug
+ {
+ CONST_VTBL struct ID3D12DebugVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Debug_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Debug_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Debug_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Debug_EnableDebugLayer(This) \
+ ( (This)->lpVtbl -> EnableDebugLayer(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Debug_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0001 */
+/* [local] */
+
+typedef
+enum D3D12_GPU_BASED_VALIDATION_FLAGS
+ {
+ D3D12_GPU_BASED_VALIDATION_FLAGS_NONE = 0,
+ D3D12_GPU_BASED_VALIDATION_FLAGS_DISABLE_STATE_TRACKING = 0x1
+ } D3D12_GPU_BASED_VALIDATION_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_GPU_BASED_VALIDATION_FLAGS)
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0001_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0001_v0_0_s_ifspec;
+
+#ifndef __ID3D12Debug1_INTERFACE_DEFINED__
+#define __ID3D12Debug1_INTERFACE_DEFINED__
+
+/* interface ID3D12Debug1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Debug1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("affaa4ca-63fe-4d8e-b8ad-159000af4304")
+ ID3D12Debug1 : public IUnknown
+ {
+ public:
+ virtual void STDMETHODCALLTYPE EnableDebugLayer( void) = 0;
+
+ virtual void STDMETHODCALLTYPE SetEnableGPUBasedValidation(
+ BOOL Enable) = 0;
+
+ virtual void STDMETHODCALLTYPE SetEnableSynchronizedCommandQueueValidation(
+ BOOL Enable) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Debug1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Debug1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Debug1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Debug1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug1, EnableDebugLayer)
+ void ( STDMETHODCALLTYPE *EnableDebugLayer )(
+ ID3D12Debug1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug1, SetEnableGPUBasedValidation)
+ void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )(
+ ID3D12Debug1 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug1, SetEnableSynchronizedCommandQueueValidation)
+ void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )(
+ ID3D12Debug1 * This,
+ BOOL Enable);
+
+ END_INTERFACE
+ } ID3D12Debug1Vtbl;
+
+ interface ID3D12Debug1
+ {
+ CONST_VTBL struct ID3D12Debug1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Debug1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Debug1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Debug1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Debug1_EnableDebugLayer(This) \
+ ( (This)->lpVtbl -> EnableDebugLayer(This) )
+
+#define ID3D12Debug1_SetEnableGPUBasedValidation(This,Enable) \
+ ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) )
+
+#define ID3D12Debug1_SetEnableSynchronizedCommandQueueValidation(This,Enable) \
+ ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Debug1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Debug2_INTERFACE_DEFINED__
+#define __ID3D12Debug2_INTERFACE_DEFINED__
+
+/* interface ID3D12Debug2 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Debug2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("93a665c4-a3b2-4e5d-b692-a26ae14e3374")
+ ID3D12Debug2 : public IUnknown
+ {
+ public:
+ virtual void STDMETHODCALLTYPE SetGPUBasedValidationFlags(
+ D3D12_GPU_BASED_VALIDATION_FLAGS Flags) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Debug2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Debug2 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Debug2 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Debug2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug2, SetGPUBasedValidationFlags)
+ void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )(
+ ID3D12Debug2 * This,
+ D3D12_GPU_BASED_VALIDATION_FLAGS Flags);
+
+ END_INTERFACE
+ } ID3D12Debug2Vtbl;
+
+ interface ID3D12Debug2
+ {
+ CONST_VTBL struct ID3D12Debug2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Debug2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Debug2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Debug2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Debug2_SetGPUBasedValidationFlags(This,Flags) \
+ ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Debug2_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Debug3_INTERFACE_DEFINED__
+#define __ID3D12Debug3_INTERFACE_DEFINED__
+
+/* interface ID3D12Debug3 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Debug3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("5cf4e58f-f671-4ff1-a542-3686e3d153d1")
+ ID3D12Debug3 : public ID3D12Debug
+ {
+ public:
+ virtual void STDMETHODCALLTYPE SetEnableGPUBasedValidation(
+ BOOL Enable) = 0;
+
+ virtual void STDMETHODCALLTYPE SetEnableSynchronizedCommandQueueValidation(
+ BOOL Enable) = 0;
+
+ virtual void STDMETHODCALLTYPE SetGPUBasedValidationFlags(
+ D3D12_GPU_BASED_VALIDATION_FLAGS Flags) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Debug3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Debug3 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Debug3 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Debug3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer)
+ void ( STDMETHODCALLTYPE *EnableDebugLayer )(
+ ID3D12Debug3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableGPUBasedValidation)
+ void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )(
+ ID3D12Debug3 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableSynchronizedCommandQueueValidation)
+ void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )(
+ ID3D12Debug3 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug3, SetGPUBasedValidationFlags)
+ void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )(
+ ID3D12Debug3 * This,
+ D3D12_GPU_BASED_VALIDATION_FLAGS Flags);
+
+ END_INTERFACE
+ } ID3D12Debug3Vtbl;
+
+ interface ID3D12Debug3
+ {
+ CONST_VTBL struct ID3D12Debug3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Debug3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Debug3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Debug3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Debug3_EnableDebugLayer(This) \
+ ( (This)->lpVtbl -> EnableDebugLayer(This) )
+
+
+#define ID3D12Debug3_SetEnableGPUBasedValidation(This,Enable) \
+ ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) )
+
+#define ID3D12Debug3_SetEnableSynchronizedCommandQueueValidation(This,Enable) \
+ ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) )
+
+#define ID3D12Debug3_SetGPUBasedValidationFlags(This,Flags) \
+ ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Debug3_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Debug4_INTERFACE_DEFINED__
+#define __ID3D12Debug4_INTERFACE_DEFINED__
+
+/* interface ID3D12Debug4 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Debug4;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("014b816e-9ec5-4a2f-a845-ffbe441ce13a")
+ ID3D12Debug4 : public ID3D12Debug3
+ {
+ public:
+ virtual void STDMETHODCALLTYPE DisableDebugLayer( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Debug4Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Debug4 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Debug4 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Debug4 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer)
+ void ( STDMETHODCALLTYPE *EnableDebugLayer )(
+ ID3D12Debug4 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableGPUBasedValidation)
+ void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )(
+ ID3D12Debug4 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableSynchronizedCommandQueueValidation)
+ void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )(
+ ID3D12Debug4 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug3, SetGPUBasedValidationFlags)
+ void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )(
+ ID3D12Debug4 * This,
+ D3D12_GPU_BASED_VALIDATION_FLAGS Flags);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug4, DisableDebugLayer)
+ void ( STDMETHODCALLTYPE *DisableDebugLayer )(
+ ID3D12Debug4 * This);
+
+ END_INTERFACE
+ } ID3D12Debug4Vtbl;
+
+ interface ID3D12Debug4
+ {
+ CONST_VTBL struct ID3D12Debug4Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Debug4_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Debug4_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Debug4_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Debug4_EnableDebugLayer(This) \
+ ( (This)->lpVtbl -> EnableDebugLayer(This) )
+
+
+#define ID3D12Debug4_SetEnableGPUBasedValidation(This,Enable) \
+ ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) )
+
+#define ID3D12Debug4_SetEnableSynchronizedCommandQueueValidation(This,Enable) \
+ ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) )
+
+#define ID3D12Debug4_SetGPUBasedValidationFlags(This,Flags) \
+ ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) )
+
+
+#define ID3D12Debug4_DisableDebugLayer(This) \
+ ( (This)->lpVtbl -> DisableDebugLayer(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Debug4_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Debug5_INTERFACE_DEFINED__
+#define __ID3D12Debug5_INTERFACE_DEFINED__
+
+/* interface ID3D12Debug5 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Debug5;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("548d6b12-09fa-40e0-9069-5dcd589a52c9")
+ ID3D12Debug5 : public ID3D12Debug4
+ {
+ public:
+ virtual void STDMETHODCALLTYPE SetEnableAutoName(
+ BOOL Enable) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Debug5Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Debug5 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Debug5 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Debug5 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer)
+ void ( STDMETHODCALLTYPE *EnableDebugLayer )(
+ ID3D12Debug5 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableGPUBasedValidation)
+ void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )(
+ ID3D12Debug5 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableSynchronizedCommandQueueValidation)
+ void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )(
+ ID3D12Debug5 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug3, SetGPUBasedValidationFlags)
+ void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )(
+ ID3D12Debug5 * This,
+ D3D12_GPU_BASED_VALIDATION_FLAGS Flags);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug4, DisableDebugLayer)
+ void ( STDMETHODCALLTYPE *DisableDebugLayer )(
+ ID3D12Debug5 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug5, SetEnableAutoName)
+ void ( STDMETHODCALLTYPE *SetEnableAutoName )(
+ ID3D12Debug5 * This,
+ BOOL Enable);
+
+ END_INTERFACE
+ } ID3D12Debug5Vtbl;
+
+ interface ID3D12Debug5
+ {
+ CONST_VTBL struct ID3D12Debug5Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Debug5_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Debug5_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Debug5_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Debug5_EnableDebugLayer(This) \
+ ( (This)->lpVtbl -> EnableDebugLayer(This) )
+
+
+#define ID3D12Debug5_SetEnableGPUBasedValidation(This,Enable) \
+ ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) )
+
+#define ID3D12Debug5_SetEnableSynchronizedCommandQueueValidation(This,Enable) \
+ ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) )
+
+#define ID3D12Debug5_SetGPUBasedValidationFlags(This,Flags) \
+ ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) )
+
+
+#define ID3D12Debug5_DisableDebugLayer(This) \
+ ( (This)->lpVtbl -> DisableDebugLayer(This) )
+
+
+#define ID3D12Debug5_SetEnableAutoName(This,Enable) \
+ ( (This)->lpVtbl -> SetEnableAutoName(This,Enable) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Debug5_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12Debug6_INTERFACE_DEFINED__
+#define __ID3D12Debug6_INTERFACE_DEFINED__
+
+/* interface ID3D12Debug6 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12Debug6;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("82a816d6-5d01-4157-97d0-4975463fd1ed")
+ ID3D12Debug6 : public ID3D12Debug5
+ {
+ public:
+ virtual void STDMETHODCALLTYPE SetForceLegacyBarrierValidation(
+ BOOL Enable) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12Debug6Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12Debug6 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12Debug6 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12Debug6 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug, EnableDebugLayer)
+ void ( STDMETHODCALLTYPE *EnableDebugLayer )(
+ ID3D12Debug6 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableGPUBasedValidation)
+ void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )(
+ ID3D12Debug6 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug3, SetEnableSynchronizedCommandQueueValidation)
+ void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )(
+ ID3D12Debug6 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug3, SetGPUBasedValidationFlags)
+ void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )(
+ ID3D12Debug6 * This,
+ D3D12_GPU_BASED_VALIDATION_FLAGS Flags);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug4, DisableDebugLayer)
+ void ( STDMETHODCALLTYPE *DisableDebugLayer )(
+ ID3D12Debug6 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug5, SetEnableAutoName)
+ void ( STDMETHODCALLTYPE *SetEnableAutoName )(
+ ID3D12Debug6 * This,
+ BOOL Enable);
+
+ DECLSPEC_XFGVIRT(ID3D12Debug6, SetForceLegacyBarrierValidation)
+ void ( STDMETHODCALLTYPE *SetForceLegacyBarrierValidation )(
+ ID3D12Debug6 * This,
+ BOOL Enable);
+
+ END_INTERFACE
+ } ID3D12Debug6Vtbl;
+
+ interface ID3D12Debug6
+ {
+ CONST_VTBL struct ID3D12Debug6Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12Debug6_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12Debug6_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12Debug6_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12Debug6_EnableDebugLayer(This) \
+ ( (This)->lpVtbl -> EnableDebugLayer(This) )
+
+
+#define ID3D12Debug6_SetEnableGPUBasedValidation(This,Enable) \
+ ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) )
+
+#define ID3D12Debug6_SetEnableSynchronizedCommandQueueValidation(This,Enable) \
+ ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) )
+
+#define ID3D12Debug6_SetGPUBasedValidationFlags(This,Flags) \
+ ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) )
+
+
+#define ID3D12Debug6_DisableDebugLayer(This) \
+ ( (This)->lpVtbl -> DisableDebugLayer(This) )
+
+
+#define ID3D12Debug6_SetEnableAutoName(This,Enable) \
+ ( (This)->lpVtbl -> SetEnableAutoName(This,Enable) )
+
+
+#define ID3D12Debug6_SetForceLegacyBarrierValidation(This,Enable) \
+ ( (This)->lpVtbl -> SetForceLegacyBarrierValidation(This,Enable) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12Debug6_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0007 */
+/* [local] */
+
+DEFINE_GUID(WKPDID_D3DAutoDebugObjectNameW, 0xd4902e36, 0x757a, 0x4942, 0x95, 0x94, 0xb6, 0x76, 0x9a, 0xfa, 0x43, 0xcd);
+typedef
+enum D3D12_RLDO_FLAGS
+ {
+ D3D12_RLDO_NONE = 0,
+ D3D12_RLDO_SUMMARY = 0x1,
+ D3D12_RLDO_DETAIL = 0x2,
+ D3D12_RLDO_IGNORE_INTERNAL = 0x4
+ } D3D12_RLDO_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_RLDO_FLAGS)
+typedef
+enum D3D12_DEBUG_DEVICE_PARAMETER_TYPE
+ {
+ D3D12_DEBUG_DEVICE_PARAMETER_FEATURE_FLAGS = 0,
+ D3D12_DEBUG_DEVICE_PARAMETER_GPU_BASED_VALIDATION_SETTINGS = ( D3D12_DEBUG_DEVICE_PARAMETER_FEATURE_FLAGS + 1 ) ,
+ D3D12_DEBUG_DEVICE_PARAMETER_GPU_SLOWDOWN_PERFORMANCE_FACTOR = ( D3D12_DEBUG_DEVICE_PARAMETER_GPU_BASED_VALIDATION_SETTINGS + 1 )
+ } D3D12_DEBUG_DEVICE_PARAMETER_TYPE;
+
+typedef
+enum D3D12_DEBUG_FEATURE
+ {
+ D3D12_DEBUG_FEATURE_NONE = 0,
+ D3D12_DEBUG_FEATURE_ALLOW_BEHAVIOR_CHANGING_DEBUG_AIDS = 0x1,
+ D3D12_DEBUG_FEATURE_CONSERVATIVE_RESOURCE_STATE_TRACKING = 0x2,
+ D3D12_DEBUG_FEATURE_DISABLE_VIRTUALIZED_BUNDLES_VALIDATION = 0x4,
+ D3D12_DEBUG_FEATURE_EMULATE_WINDOWS7 = 0x8
+ } D3D12_DEBUG_FEATURE;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_DEBUG_FEATURE)
+typedef
+enum D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE
+ {
+ D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_NONE = 0,
+ D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_STATE_TRACKING_ONLY = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_NONE + 1 ) ,
+ D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_STATE_TRACKING_ONLY + 1 ) ,
+ D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_GUARDED_VALIDATION = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION + 1 ) ,
+ NUM_D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODES = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_GUARDED_VALIDATION + 1 )
+ } D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE;
+
+typedef
+enum D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS
+ {
+ D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_NONE = 0,
+ D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_TRACKING_ONLY_SHADERS = 0x1,
+ D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_UNGUARDED_VALIDATION_SHADERS = 0x2,
+ D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_GUARDED_VALIDATION_SHADERS = 0x4,
+ D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS_VALID_MASK = 0x7
+ } D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS)
+typedef struct D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS
+ {
+ UINT MaxMessagesPerCommandList;
+ D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE DefaultShaderPatchMode;
+ D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS PipelineStateCreateFlags;
+ } D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS;
+
+typedef struct D3D12_DEBUG_DEVICE_GPU_SLOWDOWN_PERFORMANCE_FACTOR
+ {
+ FLOAT SlowdownFactor;
+ } D3D12_DEBUG_DEVICE_GPU_SLOWDOWN_PERFORMANCE_FACTOR;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0007_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0007_v0_0_s_ifspec;
+
+#ifndef __ID3D12DebugDevice1_INTERFACE_DEFINED__
+#define __ID3D12DebugDevice1_INTERFACE_DEFINED__
+
+/* interface ID3D12DebugDevice1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DebugDevice1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("a9b71770-d099-4a65-a698-3dee10020f88")
+ ID3D12DebugDevice1 : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetDebugParameter(
+ D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
+ _In_reads_bytes_(DataSize) const void *pData,
+ UINT DataSize) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetDebugParameter(
+ D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
+ _Out_writes_bytes_(DataSize) void *pData,
+ UINT DataSize) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects(
+ D3D12_RLDO_FLAGS Flags) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugDevice1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DebugDevice1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DebugDevice1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DebugDevice1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugDevice1, SetDebugParameter)
+ HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )(
+ ID3D12DebugDevice1 * This,
+ D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
+ _In_reads_bytes_(DataSize) const void *pData,
+ UINT DataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugDevice1, GetDebugParameter)
+ HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )(
+ ID3D12DebugDevice1 * This,
+ D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
+ _Out_writes_bytes_(DataSize) void *pData,
+ UINT DataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugDevice1, ReportLiveDeviceObjects)
+ HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )(
+ ID3D12DebugDevice1 * This,
+ D3D12_RLDO_FLAGS Flags);
+
+ END_INTERFACE
+ } ID3D12DebugDevice1Vtbl;
+
+ interface ID3D12DebugDevice1
+ {
+ CONST_VTBL struct ID3D12DebugDevice1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DebugDevice1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DebugDevice1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DebugDevice1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DebugDevice1_SetDebugParameter(This,Type,pData,DataSize) \
+ ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) )
+
+#define ID3D12DebugDevice1_GetDebugParameter(This,Type,pData,DataSize) \
+ ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) )
+
+#define ID3D12DebugDevice1_ReportLiveDeviceObjects(This,Flags) \
+ ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DebugDevice1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12DebugDevice_INTERFACE_DEFINED__
+#define __ID3D12DebugDevice_INTERFACE_DEFINED__
+
+/* interface ID3D12DebugDevice */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DebugDevice;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("3febd6dd-4973-4787-8194-e45f9e28923e")
+ ID3D12DebugDevice : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetFeatureMask(
+ D3D12_DEBUG_FEATURE Mask) = 0;
+
+ virtual D3D12_DEBUG_FEATURE STDMETHODCALLTYPE GetFeatureMask( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects(
+ D3D12_RLDO_FLAGS Flags) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugDeviceVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DebugDevice * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DebugDevice * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DebugDevice * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugDevice, SetFeatureMask)
+ HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
+ ID3D12DebugDevice * This,
+ D3D12_DEBUG_FEATURE Mask);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugDevice, GetFeatureMask)
+ D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )(
+ ID3D12DebugDevice * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugDevice, ReportLiveDeviceObjects)
+ HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )(
+ ID3D12DebugDevice * This,
+ D3D12_RLDO_FLAGS Flags);
+
+ END_INTERFACE
+ } ID3D12DebugDeviceVtbl;
+
+ interface ID3D12DebugDevice
+ {
+ CONST_VTBL struct ID3D12DebugDeviceVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DebugDevice_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DebugDevice_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DebugDevice_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DebugDevice_SetFeatureMask(This,Mask) \
+ ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
+
+#define ID3D12DebugDevice_GetFeatureMask(This) \
+ ( (This)->lpVtbl -> GetFeatureMask(This) )
+
+#define ID3D12DebugDevice_ReportLiveDeviceObjects(This,Flags) \
+ ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DebugDevice_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12DebugDevice2_INTERFACE_DEFINED__
+#define __ID3D12DebugDevice2_INTERFACE_DEFINED__
+
+/* interface ID3D12DebugDevice2 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DebugDevice2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("60eccbc1-378d-4df1-894c-f8ac5ce4d7dd")
+ ID3D12DebugDevice2 : public ID3D12DebugDevice
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetDebugParameter(
+ D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
+ _In_reads_bytes_(DataSize) const void *pData,
+ UINT DataSize) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetDebugParameter(
+ D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
+ _Out_writes_bytes_(DataSize) void *pData,
+ UINT DataSize) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugDevice2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DebugDevice2 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DebugDevice2 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DebugDevice2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugDevice, SetFeatureMask)
+ HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
+ ID3D12DebugDevice2 * This,
+ D3D12_DEBUG_FEATURE Mask);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugDevice, GetFeatureMask)
+ D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )(
+ ID3D12DebugDevice2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugDevice, ReportLiveDeviceObjects)
+ HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )(
+ ID3D12DebugDevice2 * This,
+ D3D12_RLDO_FLAGS Flags);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugDevice2, SetDebugParameter)
+ HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )(
+ ID3D12DebugDevice2 * This,
+ D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
+ _In_reads_bytes_(DataSize) const void *pData,
+ UINT DataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugDevice2, GetDebugParameter)
+ HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )(
+ ID3D12DebugDevice2 * This,
+ D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
+ _Out_writes_bytes_(DataSize) void *pData,
+ UINT DataSize);
+
+ END_INTERFACE
+ } ID3D12DebugDevice2Vtbl;
+
+ interface ID3D12DebugDevice2
+ {
+ CONST_VTBL struct ID3D12DebugDevice2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DebugDevice2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DebugDevice2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DebugDevice2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DebugDevice2_SetFeatureMask(This,Mask) \
+ ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
+
+#define ID3D12DebugDevice2_GetFeatureMask(This) \
+ ( (This)->lpVtbl -> GetFeatureMask(This) )
+
+#define ID3D12DebugDevice2_ReportLiveDeviceObjects(This,Flags) \
+ ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) )
+
+
+#define ID3D12DebugDevice2_SetDebugParameter(This,Type,pData,DataSize) \
+ ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) )
+
+#define ID3D12DebugDevice2_GetDebugParameter(This,Type,pData,DataSize) \
+ ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DebugDevice2_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0010 */
+/* [local] */
+
+DEFINE_GUID(DXGI_DEBUG_D3D12, 0xcf59a98c, 0xa950, 0x4326, 0x91, 0xef, 0x9b, 0xba, 0xa1, 0x7b, 0xfd, 0x95);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0010_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0010_v0_0_s_ifspec;
+
+#ifndef __ID3D12DebugCommandQueue_INTERFACE_DEFINED__
+#define __ID3D12DebugCommandQueue_INTERFACE_DEFINED__
+
+/* interface ID3D12DebugCommandQueue */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DebugCommandQueue;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("09e0bf36-54ac-484f-8847-4baeeab6053a")
+ ID3D12DebugCommandQueue : public IUnknown
+ {
+ public:
+ virtual BOOL STDMETHODCALLTYPE AssertResourceState(
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ UINT State) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugCommandQueueVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DebugCommandQueue * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DebugCommandQueue * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DebugCommandQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandQueue, AssertResourceState)
+ BOOL ( STDMETHODCALLTYPE *AssertResourceState )(
+ ID3D12DebugCommandQueue * This,
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ UINT State);
+
+ END_INTERFACE
+ } ID3D12DebugCommandQueueVtbl;
+
+ interface ID3D12DebugCommandQueue
+ {
+ CONST_VTBL struct ID3D12DebugCommandQueueVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DebugCommandQueue_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DebugCommandQueue_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DebugCommandQueue_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DebugCommandQueue_AssertResourceState(This,pResource,Subresource,State) \
+ ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DebugCommandQueue_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12DebugCommandQueue1_INTERFACE_DEFINED__
+#define __ID3D12DebugCommandQueue1_INTERFACE_DEFINED__
+
+/* interface ID3D12DebugCommandQueue1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DebugCommandQueue1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("16be35a2-bfd6-49f2-bcae-eaae4aff862d")
+ ID3D12DebugCommandQueue1 : public ID3D12DebugCommandQueue
+ {
+ public:
+ virtual void STDMETHODCALLTYPE AssertResourceAccess(
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ D3D12_BARRIER_ACCESS Access) = 0;
+
+ virtual void STDMETHODCALLTYPE AssertTextureLayout(
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ D3D12_BARRIER_LAYOUT Layout) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugCommandQueue1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DebugCommandQueue1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DebugCommandQueue1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DebugCommandQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandQueue, AssertResourceState)
+ BOOL ( STDMETHODCALLTYPE *AssertResourceState )(
+ ID3D12DebugCommandQueue1 * This,
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ UINT State);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandQueue1, AssertResourceAccess)
+ void ( STDMETHODCALLTYPE *AssertResourceAccess )(
+ ID3D12DebugCommandQueue1 * This,
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ D3D12_BARRIER_ACCESS Access);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandQueue1, AssertTextureLayout)
+ void ( STDMETHODCALLTYPE *AssertTextureLayout )(
+ ID3D12DebugCommandQueue1 * This,
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ D3D12_BARRIER_LAYOUT Layout);
+
+ END_INTERFACE
+ } ID3D12DebugCommandQueue1Vtbl;
+
+ interface ID3D12DebugCommandQueue1
+ {
+ CONST_VTBL struct ID3D12DebugCommandQueue1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DebugCommandQueue1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DebugCommandQueue1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DebugCommandQueue1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DebugCommandQueue1_AssertResourceState(This,pResource,Subresource,State) \
+ ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) )
+
+
+#define ID3D12DebugCommandQueue1_AssertResourceAccess(This,pResource,Subresource,Access) \
+ ( (This)->lpVtbl -> AssertResourceAccess(This,pResource,Subresource,Access) )
+
+#define ID3D12DebugCommandQueue1_AssertTextureLayout(This,pResource,Subresource,Layout) \
+ ( (This)->lpVtbl -> AssertTextureLayout(This,pResource,Subresource,Layout) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DebugCommandQueue1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0012 */
+/* [local] */
+
+typedef
+enum D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE
+ {
+ D3D12_DEBUG_COMMAND_LIST_PARAMETER_GPU_BASED_VALIDATION_SETTINGS = 0
+ } D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE;
+
+typedef struct D3D12_DEBUG_COMMAND_LIST_GPU_BASED_VALIDATION_SETTINGS
+ {
+ D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE ShaderPatchMode;
+ } D3D12_DEBUG_COMMAND_LIST_GPU_BASED_VALIDATION_SETTINGS;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0012_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0012_v0_0_s_ifspec;
+
+#ifndef __ID3D12DebugCommandList1_INTERFACE_DEFINED__
+#define __ID3D12DebugCommandList1_INTERFACE_DEFINED__
+
+/* interface ID3D12DebugCommandList1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DebugCommandList1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("102ca951-311b-4b01-b11f-ecb83e061b37")
+ ID3D12DebugCommandList1 : public IUnknown
+ {
+ public:
+ virtual BOOL STDMETHODCALLTYPE AssertResourceState(
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ UINT State) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetDebugParameter(
+ D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
+ _In_reads_bytes_(DataSize) const void *pData,
+ UINT DataSize) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetDebugParameter(
+ D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
+ _Out_writes_bytes_(DataSize) void *pData,
+ UINT DataSize) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugCommandList1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DebugCommandList1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DebugCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DebugCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList1, AssertResourceState)
+ BOOL ( STDMETHODCALLTYPE *AssertResourceState )(
+ ID3D12DebugCommandList1 * This,
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ UINT State);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList1, SetDebugParameter)
+ HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )(
+ ID3D12DebugCommandList1 * This,
+ D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
+ _In_reads_bytes_(DataSize) const void *pData,
+ UINT DataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList1, GetDebugParameter)
+ HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )(
+ ID3D12DebugCommandList1 * This,
+ D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
+ _Out_writes_bytes_(DataSize) void *pData,
+ UINT DataSize);
+
+ END_INTERFACE
+ } ID3D12DebugCommandList1Vtbl;
+
+ interface ID3D12DebugCommandList1
+ {
+ CONST_VTBL struct ID3D12DebugCommandList1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DebugCommandList1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DebugCommandList1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DebugCommandList1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DebugCommandList1_AssertResourceState(This,pResource,Subresource,State) \
+ ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) )
+
+#define ID3D12DebugCommandList1_SetDebugParameter(This,Type,pData,DataSize) \
+ ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) )
+
+#define ID3D12DebugCommandList1_GetDebugParameter(This,Type,pData,DataSize) \
+ ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DebugCommandList1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12DebugCommandList_INTERFACE_DEFINED__
+#define __ID3D12DebugCommandList_INTERFACE_DEFINED__
+
+/* interface ID3D12DebugCommandList */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DebugCommandList;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("09e0bf36-54ac-484f-8847-4baeeab6053f")
+ ID3D12DebugCommandList : public IUnknown
+ {
+ public:
+ virtual BOOL STDMETHODCALLTYPE AssertResourceState(
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ UINT State) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetFeatureMask(
+ D3D12_DEBUG_FEATURE Mask) = 0;
+
+ virtual D3D12_DEBUG_FEATURE STDMETHODCALLTYPE GetFeatureMask( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugCommandListVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DebugCommandList * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DebugCommandList * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DebugCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList, AssertResourceState)
+ BOOL ( STDMETHODCALLTYPE *AssertResourceState )(
+ ID3D12DebugCommandList * This,
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ UINT State);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList, SetFeatureMask)
+ HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
+ ID3D12DebugCommandList * This,
+ D3D12_DEBUG_FEATURE Mask);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList, GetFeatureMask)
+ D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )(
+ ID3D12DebugCommandList * This);
+
+ END_INTERFACE
+ } ID3D12DebugCommandListVtbl;
+
+ interface ID3D12DebugCommandList
+ {
+ CONST_VTBL struct ID3D12DebugCommandListVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DebugCommandList_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DebugCommandList_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DebugCommandList_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DebugCommandList_AssertResourceState(This,pResource,Subresource,State) \
+ ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) )
+
+#define ID3D12DebugCommandList_SetFeatureMask(This,Mask) \
+ ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
+
+#define ID3D12DebugCommandList_GetFeatureMask(This) \
+ ( (This)->lpVtbl -> GetFeatureMask(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DebugCommandList_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12DebugCommandList2_INTERFACE_DEFINED__
+#define __ID3D12DebugCommandList2_INTERFACE_DEFINED__
+
+/* interface ID3D12DebugCommandList2 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DebugCommandList2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("aeb575cf-4e06-48be-ba3b-c450fc96652e")
+ ID3D12DebugCommandList2 : public ID3D12DebugCommandList
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetDebugParameter(
+ D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
+ _In_reads_bytes_(DataSize) const void *pData,
+ UINT DataSize) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetDebugParameter(
+ D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
+ _Out_writes_bytes_(DataSize) void *pData,
+ UINT DataSize) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugCommandList2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DebugCommandList2 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DebugCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DebugCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList, AssertResourceState)
+ BOOL ( STDMETHODCALLTYPE *AssertResourceState )(
+ ID3D12DebugCommandList2 * This,
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ UINT State);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList, SetFeatureMask)
+ HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
+ ID3D12DebugCommandList2 * This,
+ D3D12_DEBUG_FEATURE Mask);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList, GetFeatureMask)
+ D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )(
+ ID3D12DebugCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList2, SetDebugParameter)
+ HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )(
+ ID3D12DebugCommandList2 * This,
+ D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
+ _In_reads_bytes_(DataSize) const void *pData,
+ UINT DataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList2, GetDebugParameter)
+ HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )(
+ ID3D12DebugCommandList2 * This,
+ D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
+ _Out_writes_bytes_(DataSize) void *pData,
+ UINT DataSize);
+
+ END_INTERFACE
+ } ID3D12DebugCommandList2Vtbl;
+
+ interface ID3D12DebugCommandList2
+ {
+ CONST_VTBL struct ID3D12DebugCommandList2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DebugCommandList2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DebugCommandList2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DebugCommandList2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DebugCommandList2_AssertResourceState(This,pResource,Subresource,State) \
+ ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) )
+
+#define ID3D12DebugCommandList2_SetFeatureMask(This,Mask) \
+ ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
+
+#define ID3D12DebugCommandList2_GetFeatureMask(This) \
+ ( (This)->lpVtbl -> GetFeatureMask(This) )
+
+
+#define ID3D12DebugCommandList2_SetDebugParameter(This,Type,pData,DataSize) \
+ ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) )
+
+#define ID3D12DebugCommandList2_GetDebugParameter(This,Type,pData,DataSize) \
+ ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DebugCommandList2_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12DebugCommandList3_INTERFACE_DEFINED__
+#define __ID3D12DebugCommandList3_INTERFACE_DEFINED__
+
+/* interface ID3D12DebugCommandList3 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12DebugCommandList3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("197d5e15-4d37-4d34-af78-724cd70fdb1f")
+ ID3D12DebugCommandList3 : public ID3D12DebugCommandList2
+ {
+ public:
+ virtual void STDMETHODCALLTYPE AssertResourceAccess(
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ D3D12_BARRIER_ACCESS Access) = 0;
+
+ virtual void STDMETHODCALLTYPE AssertTextureLayout(
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ D3D12_BARRIER_LAYOUT Layout) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12DebugCommandList3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12DebugCommandList3 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12DebugCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12DebugCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList, AssertResourceState)
+ BOOL ( STDMETHODCALLTYPE *AssertResourceState )(
+ ID3D12DebugCommandList3 * This,
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ UINT State);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList, SetFeatureMask)
+ HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
+ ID3D12DebugCommandList3 * This,
+ D3D12_DEBUG_FEATURE Mask);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList, GetFeatureMask)
+ D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )(
+ ID3D12DebugCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList2, SetDebugParameter)
+ HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )(
+ ID3D12DebugCommandList3 * This,
+ D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
+ _In_reads_bytes_(DataSize) const void *pData,
+ UINT DataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList2, GetDebugParameter)
+ HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )(
+ ID3D12DebugCommandList3 * This,
+ D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
+ _Out_writes_bytes_(DataSize) void *pData,
+ UINT DataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList3, AssertResourceAccess)
+ void ( STDMETHODCALLTYPE *AssertResourceAccess )(
+ ID3D12DebugCommandList3 * This,
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ D3D12_BARRIER_ACCESS Access);
+
+ DECLSPEC_XFGVIRT(ID3D12DebugCommandList3, AssertTextureLayout)
+ void ( STDMETHODCALLTYPE *AssertTextureLayout )(
+ ID3D12DebugCommandList3 * This,
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ D3D12_BARRIER_LAYOUT Layout);
+
+ END_INTERFACE
+ } ID3D12DebugCommandList3Vtbl;
+
+ interface ID3D12DebugCommandList3
+ {
+ CONST_VTBL struct ID3D12DebugCommandList3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12DebugCommandList3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12DebugCommandList3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12DebugCommandList3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12DebugCommandList3_AssertResourceState(This,pResource,Subresource,State) \
+ ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) )
+
+#define ID3D12DebugCommandList3_SetFeatureMask(This,Mask) \
+ ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
+
+#define ID3D12DebugCommandList3_GetFeatureMask(This) \
+ ( (This)->lpVtbl -> GetFeatureMask(This) )
+
+
+#define ID3D12DebugCommandList3_SetDebugParameter(This,Type,pData,DataSize) \
+ ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) )
+
+#define ID3D12DebugCommandList3_GetDebugParameter(This,Type,pData,DataSize) \
+ ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) )
+
+
+#define ID3D12DebugCommandList3_AssertResourceAccess(This,pResource,Subresource,Access) \
+ ( (This)->lpVtbl -> AssertResourceAccess(This,pResource,Subresource,Access) )
+
+#define ID3D12DebugCommandList3_AssertTextureLayout(This,pResource,Subresource,Layout) \
+ ( (This)->lpVtbl -> AssertTextureLayout(This,pResource,Subresource,Layout) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12DebugCommandList3_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12SharingContract_INTERFACE_DEFINED__
+#define __ID3D12SharingContract_INTERFACE_DEFINED__
+
+/* interface ID3D12SharingContract */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12SharingContract;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("0adf7d52-929c-4e61-addb-ffed30de66ef")
+ ID3D12SharingContract : public IUnknown
+ {
+ public:
+ virtual void STDMETHODCALLTYPE Present(
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ _In_ HWND window) = 0;
+
+ virtual void STDMETHODCALLTYPE SharedFenceSignal(
+ _In_ ID3D12Fence *pFence,
+ UINT64 FenceValue) = 0;
+
+ virtual void STDMETHODCALLTYPE BeginCapturableWork(
+ _In_ REFGUID guid) = 0;
+
+ virtual void STDMETHODCALLTYPE EndCapturableWork(
+ _In_ REFGUID guid) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12SharingContractVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12SharingContract * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12SharingContract * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12SharingContract * This);
+
+ DECLSPEC_XFGVIRT(ID3D12SharingContract, Present)
+ void ( STDMETHODCALLTYPE *Present )(
+ ID3D12SharingContract * This,
+ _In_ ID3D12Resource *pResource,
+ UINT Subresource,
+ _In_ HWND window);
+
+ DECLSPEC_XFGVIRT(ID3D12SharingContract, SharedFenceSignal)
+ void ( STDMETHODCALLTYPE *SharedFenceSignal )(
+ ID3D12SharingContract * This,
+ _In_ ID3D12Fence *pFence,
+ UINT64 FenceValue);
+
+ DECLSPEC_XFGVIRT(ID3D12SharingContract, BeginCapturableWork)
+ void ( STDMETHODCALLTYPE *BeginCapturableWork )(
+ ID3D12SharingContract * This,
+ _In_ REFGUID guid);
+
+ DECLSPEC_XFGVIRT(ID3D12SharingContract, EndCapturableWork)
+ void ( STDMETHODCALLTYPE *EndCapturableWork )(
+ ID3D12SharingContract * This,
+ _In_ REFGUID guid);
+
+ END_INTERFACE
+ } ID3D12SharingContractVtbl;
+
+ interface ID3D12SharingContract
+ {
+ CONST_VTBL struct ID3D12SharingContractVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12SharingContract_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12SharingContract_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12SharingContract_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12SharingContract_Present(This,pResource,Subresource,window) \
+ ( (This)->lpVtbl -> Present(This,pResource,Subresource,window) )
+
+#define ID3D12SharingContract_SharedFenceSignal(This,pFence,FenceValue) \
+ ( (This)->lpVtbl -> SharedFenceSignal(This,pFence,FenceValue) )
+
+#define ID3D12SharingContract_BeginCapturableWork(This,guid) \
+ ( (This)->lpVtbl -> BeginCapturableWork(This,guid) )
+
+#define ID3D12SharingContract_EndCapturableWork(This,guid) \
+ ( (This)->lpVtbl -> EndCapturableWork(This,guid) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12SharingContract_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0017 */
+/* [local] */
+
+typedef
+enum D3D12_MESSAGE_CATEGORY
+ {
+ D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0,
+ D3D12_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_INITIALIZATION = ( D3D12_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_CLEANUP = ( D3D12_MESSAGE_CATEGORY_INITIALIZATION + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_COMPILATION = ( D3D12_MESSAGE_CATEGORY_CLEANUP + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_STATE_CREATION = ( D3D12_MESSAGE_CATEGORY_COMPILATION + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_STATE_SETTING = ( D3D12_MESSAGE_CATEGORY_STATE_CREATION + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_STATE_GETTING = ( D3D12_MESSAGE_CATEGORY_STATE_SETTING + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D12_MESSAGE_CATEGORY_STATE_GETTING + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_EXECUTION = ( D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 ) ,
+ D3D12_MESSAGE_CATEGORY_SHADER = ( D3D12_MESSAGE_CATEGORY_EXECUTION + 1 )
+ } D3D12_MESSAGE_CATEGORY;
+
+typedef
+enum D3D12_MESSAGE_SEVERITY
+ {
+ D3D12_MESSAGE_SEVERITY_CORRUPTION = 0,
+ D3D12_MESSAGE_SEVERITY_ERROR = ( D3D12_MESSAGE_SEVERITY_CORRUPTION + 1 ) ,
+ D3D12_MESSAGE_SEVERITY_WARNING = ( D3D12_MESSAGE_SEVERITY_ERROR + 1 ) ,
+ D3D12_MESSAGE_SEVERITY_INFO = ( D3D12_MESSAGE_SEVERITY_WARNING + 1 ) ,
+ D3D12_MESSAGE_SEVERITY_MESSAGE = ( D3D12_MESSAGE_SEVERITY_INFO + 1 )
+ } D3D12_MESSAGE_SEVERITY;
+
+typedef
+enum D3D12_MESSAGE_ID
+ {
+ D3D12_MESSAGE_ID_UNKNOWN = 0,
+ D3D12_MESSAGE_ID_STRING_FROM_APPLICATION = 1,
+ D3D12_MESSAGE_ID_CORRUPTED_THIS = 2,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER1 = 3,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER2 = 4,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER3 = 5,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER4 = 6,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER5 = 7,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER6 = 8,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER7 = 9,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER8 = 10,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER9 = 11,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER10 = 12,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER11 = 13,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER12 = 14,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER13 = 15,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER14 = 16,
+ D3D12_MESSAGE_ID_CORRUPTED_PARAMETER15 = 17,
+ D3D12_MESSAGE_ID_CORRUPTED_MULTITHREADING = 18,
+ D3D12_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = 19,
+ D3D12_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = 20,
+ D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = 21,
+ D3D12_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = 24,
+ D3D12_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = 25,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = 26,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = 27,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = 28,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANESLICE = 29,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANESLICE = 30,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = 31,
+ D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = 32,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = 35,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = 36,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = 37,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = 38,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANESLICE = 39,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANESLICE = 40,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = 41,
+ D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = 42,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = 45,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = 46,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = 47,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = 48,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = 49,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = 52,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = 53,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = 54,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = 55,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = 56,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = 57,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = 58,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = 59,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = 60,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = 61,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = 62,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = 63,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = 64,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = 65,
+ D3D12_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = 66,
+ D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = 67,
+ D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = 68,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = 69,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = 70,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = 71,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = 72,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = 73,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = 74,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = 75,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = 76,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = 79,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = 80,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = 81,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = 82,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = 83,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = 84,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = 85,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = 86,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = 87,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = 88,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = 89,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = 90,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = 91,
+ D3D12_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = 92,
+ D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = 93,
+ D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = 94,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = 95,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = 96,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = 97,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = 98,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = 100,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = 101,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = 102,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = 103,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = 104,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = 105,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = 106,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = 107,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = 108,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = 109,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = 111,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = 112,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = 113,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = 114,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = 115,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = 116,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = 117,
+ D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = 135,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_NOT_SET = 200,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_MISMATCH = 201,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_NOT_SET = 202,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = 209,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_TOO_SMALL = 210,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_NOT_SET = 211,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_FORMAT_INVALID = 212,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_TOO_SMALL = 213,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INVALID_PRIMITIVETOPOLOGY = 219,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_STRIDE_UNALIGNED = 221,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_OFFSET_UNALIGNED = 222,
+ D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = 232,
+ D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = 233,
+ D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = 234,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = 239,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = 240,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = 245,
+ D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = 253,
+ D3D12_MESSAGE_ID_LIVE_OBJECT_SUMMARY = 255,
+ D3D12_MESSAGE_ID_LIVE_DEVICE = 274,
+ D3D12_MESSAGE_ID_LIVE_SWAPCHAIN = 275,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS = 276,
+ D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE = 277,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE = 278,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER = 280,
+ D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE = 283,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM = 284,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES = 285,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES = 286,
+ D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES = 287,
+ D3D12_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY = 289,
+ D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE = 290,
+ D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE = 291,
+ D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE = 292,
+ D3D12_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY = 294,
+ D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE = 295,
+ D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE = 296,
+ D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE = 297,
+ D3D12_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED = 310,
+ D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE = 318,
+ D3D12_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY = 321,
+ D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE = 322,
+ D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE = 323,
+ D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 331,
+ D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 332,
+ D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 333,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 334,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED = 335,
+ D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED = 336,
+ D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED = 337,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE = 340,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC = 341,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT = 342,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANESLICE = 343,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANESLICE = 344,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS = 345,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT = 346,
+ D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS = 354,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT = 401,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS = 403,
+ D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 410,
+ D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 412,
+ D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 414,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 416,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED = 418,
+ D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 420,
+ D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED = 422,
+ D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED = 425,
+ D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED = 426,
+ D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED = 427,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED = 428,
+ D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED = 429,
+ D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED = 430,
+ D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED = 431,
+ D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT = 447,
+ D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT = 448,
+ D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_INVALID_PARAMETER = 493,
+ D3D12_MESSAGE_ID_COPYTILEMAPPINGS_INVALID_PARAMETER = 494,
+ D3D12_MESSAGE_ID_CREATEDEVICE_INVALIDARGS = 506,
+ D3D12_MESSAGE_ID_CREATEDEVICE_WARNING = 507,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_TYPE = 519,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_NULL_POINTER = 520,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SUBRESOURCE = 521,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_RESERVED_BITS = 522,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISSING_BIND_FLAGS = 523,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_MISC_FLAGS = 524,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_MATCHING_STATES = 525,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINATION = 526,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH = 527,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_RESOURCE = 528,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_SAMPLE_COUNT = 529,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS = 530,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINED_FLAGS = 531,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS_FOR_FORMAT = 532,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SPLIT_BARRIER = 533,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_END = 534,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_BEGIN = 535,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAG = 536,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMMAND_LIST_TYPE = 537,
+ D3D12_MESSAGE_ID_INVALID_SUBRESOURCE_STATE = 538,
+ D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CONTENTION = 540,
+ D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET = 541,
+ D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET_BUNDLE = 542,
+ D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CANNOT_RESET = 543,
+ D3D12_MESSAGE_ID_COMMAND_LIST_OPEN = 544,
+ D3D12_MESSAGE_ID_INVALID_BUNDLE_API = 546,
+ D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED = 547,
+ D3D12_MESSAGE_ID_WRONG_COMMAND_ALLOCATOR_TYPE = 549,
+ D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_SYNC = 552,
+ D3D12_MESSAGE_ID_COMMAND_LIST_SYNC = 553,
+ D3D12_MESSAGE_ID_SET_DESCRIPTOR_HEAP_INVALID = 554,
+ D3D12_MESSAGE_ID_CREATE_COMMANDQUEUE = 557,
+ D3D12_MESSAGE_ID_CREATE_COMMANDALLOCATOR = 558,
+ D3D12_MESSAGE_ID_CREATE_PIPELINESTATE = 559,
+ D3D12_MESSAGE_ID_CREATE_COMMANDLIST12 = 560,
+ D3D12_MESSAGE_ID_CREATE_RESOURCE = 562,
+ D3D12_MESSAGE_ID_CREATE_DESCRIPTORHEAP = 563,
+ D3D12_MESSAGE_ID_CREATE_ROOTSIGNATURE = 564,
+ D3D12_MESSAGE_ID_CREATE_LIBRARY = 565,
+ D3D12_MESSAGE_ID_CREATE_HEAP = 566,
+ D3D12_MESSAGE_ID_CREATE_MONITOREDFENCE = 567,
+ D3D12_MESSAGE_ID_CREATE_QUERYHEAP = 568,
+ D3D12_MESSAGE_ID_CREATE_COMMANDSIGNATURE = 569,
+ D3D12_MESSAGE_ID_LIVE_COMMANDQUEUE = 570,
+ D3D12_MESSAGE_ID_LIVE_COMMANDALLOCATOR = 571,
+ D3D12_MESSAGE_ID_LIVE_PIPELINESTATE = 572,
+ D3D12_MESSAGE_ID_LIVE_COMMANDLIST12 = 573,
+ D3D12_MESSAGE_ID_LIVE_RESOURCE = 575,
+ D3D12_MESSAGE_ID_LIVE_DESCRIPTORHEAP = 576,
+ D3D12_MESSAGE_ID_LIVE_ROOTSIGNATURE = 577,
+ D3D12_MESSAGE_ID_LIVE_LIBRARY = 578,
+ D3D12_MESSAGE_ID_LIVE_HEAP = 579,
+ D3D12_MESSAGE_ID_LIVE_MONITOREDFENCE = 580,
+ D3D12_MESSAGE_ID_LIVE_QUERYHEAP = 581,
+ D3D12_MESSAGE_ID_LIVE_COMMANDSIGNATURE = 582,
+ D3D12_MESSAGE_ID_DESTROY_COMMANDQUEUE = 583,
+ D3D12_MESSAGE_ID_DESTROY_COMMANDALLOCATOR = 584,
+ D3D12_MESSAGE_ID_DESTROY_PIPELINESTATE = 585,
+ D3D12_MESSAGE_ID_DESTROY_COMMANDLIST12 = 586,
+ D3D12_MESSAGE_ID_DESTROY_RESOURCE = 588,
+ D3D12_MESSAGE_ID_DESTROY_DESCRIPTORHEAP = 589,
+ D3D12_MESSAGE_ID_DESTROY_ROOTSIGNATURE = 590,
+ D3D12_MESSAGE_ID_DESTROY_LIBRARY = 591,
+ D3D12_MESSAGE_ID_DESTROY_HEAP = 592,
+ D3D12_MESSAGE_ID_DESTROY_MONITOREDFENCE = 593,
+ D3D12_MESSAGE_ID_DESTROY_QUERYHEAP = 594,
+ D3D12_MESSAGE_ID_DESTROY_COMMANDSIGNATURE = 595,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONS = 597,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMISCFLAGS = 599,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDARG_RETURN = 602,
+ D3D12_MESSAGE_ID_CREATERESOURCE_OUTOFMEMORY_RETURN = 603,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDESC = 604,
+ D3D12_MESSAGE_ID_POSSIBLY_INVALID_SUBRESOURCE_STATE = 607,
+ D3D12_MESSAGE_ID_INVALID_USE_OF_NON_RESIDENT_RESOURCE = 608,
+ D3D12_MESSAGE_ID_POSSIBLE_INVALID_USE_OF_NON_RESIDENT_RESOURCE = 609,
+ D3D12_MESSAGE_ID_BUNDLE_PIPELINE_STATE_MISMATCH = 610,
+ D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_MISMATCH_PIPELINE_STATE = 611,
+ D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_PIPELINE_STATE = 613,
+ D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = 614,
+ D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_PIPELINE_STATE = 615,
+ D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = 616,
+ D3D12_MESSAGE_ID_CREATESHADER_INVALIDBYTECODE = 622,
+ D3D12_MESSAGE_ID_CREATEHEAP_NULLDESC = 623,
+ D3D12_MESSAGE_ID_CREATEHEAP_INVALIDSIZE = 624,
+ D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDHEAPTYPE = 625,
+ D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = 626,
+ D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMEMORYPOOL = 627,
+ D3D12_MESSAGE_ID_CREATEHEAP_INVALIDPROPERTIES = 628,
+ D3D12_MESSAGE_ID_CREATEHEAP_INVALIDALIGNMENT = 629,
+ D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMISCFLAGS = 630,
+ D3D12_MESSAGE_ID_CREATEHEAP_INVALIDMISCFLAGS = 631,
+ D3D12_MESSAGE_ID_CREATEHEAP_INVALIDARG_RETURN = 632,
+ D3D12_MESSAGE_ID_CREATEHEAP_OUTOFMEMORY_RETURN = 633,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAPPROPERTIES = 634,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPTYPE = 635,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = 636,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDMEMORYPOOL = 637,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPPROPERTIES = 638,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPMISCFLAGS = 639,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPMISCFLAGS = 640,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDARG_RETURN = 641,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_OUTOFMEMORY_RETURN = 642,
+ D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_UNRECOGNIZEDHEAPTYPE = 643,
+ D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_INVALIDHEAPTYPE = 644,
+ D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_INVALID_DESC = 645,
+ D3D12_MESSAGE_ID_INVALID_DESCRIPTOR_HANDLE = 646,
+ D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_CONSERVATIVERASTERMODE = 647,
+ D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_RESOURCE = 649,
+ D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_DESC = 650,
+ D3D12_MESSAGE_ID_CREATE_UNORDEREDACCESS_VIEW_INVALID_COUNTER_USAGE = 652,
+ D3D12_MESSAGE_ID_COPY_DESCRIPTORS_INVALID_RANGES = 653,
+ D3D12_MESSAGE_ID_COPY_DESCRIPTORS_WRITE_ONLY_DESCRIPTOR = 654,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RTV_FORMAT_NOT_UNKNOWN = 655,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_RENDER_TARGET_COUNT = 656,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VERTEX_SHADER_NOT_SET = 657,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INPUTLAYOUT_NOT_SET = 658,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_HS_DS_SIGNATURE_MISMATCH = 659,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERINDEX = 660,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_COMPONENTTYPE = 661,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERMASK = 662,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SYSTEMVALUE = 663,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = 664,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_MINPRECISION = 665,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = 666,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_XOR_DS_MISMATCH = 667,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = 668,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_CONTROL_POINT_COUNT_MISMATCH = 669,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = 670,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = 671,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_FORCED_SAMPLE_COUNT = 672,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_PRIMITIVETOPOLOGY = 673,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SYSTEMVALUE = 674,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = 675,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = 676,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_TYPE_MISMATCH = 677,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS = 678,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RENDERTARGETVIEW_NOT_SET = 679,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DEPTHSTENCILVIEW_NOT_SET = 680,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_INPUT_PRIMITIVE_MISMATCH = 681,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_POSITION_NOT_PRESENT = 682,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE_FLAGS = 683,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_INDEX_BUFFER_PROPERTIES = 684,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SAMPLE_DESC = 685,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_ROOT_SIGNATURE_MISMATCH = 686,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DS_ROOT_SIGNATURE_MISMATCH = 687,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VS_ROOT_SIGNATURE_MISMATCH = 688,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_ROOT_SIGNATURE_MISMATCH = 689,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_ROOT_SIGNATURE_MISMATCH = 690,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE = 691,
+ D3D12_MESSAGE_ID_EXECUTE_BUNDLE_OPEN_BUNDLE = 692,
+ D3D12_MESSAGE_ID_EXECUTE_BUNDLE_DESCRIPTOR_HEAP_MISMATCH = 693,
+ D3D12_MESSAGE_ID_EXECUTE_BUNDLE_TYPE = 694,
+ D3D12_MESSAGE_ID_DRAW_EMPTY_SCISSOR_RECTANGLE = 695,
+ D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_BLOB_NOT_FOUND = 696,
+ D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_DESERIALIZE_FAILED = 697,
+ D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_INVALID_CONFIGURATION = 698,
+ D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_SUPPORTED_ON_DEVICE = 699,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLRESOURCEPROPERTIES = 700,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAP = 701,
+ D3D12_MESSAGE_ID_GETRESOURCEALLOCATIONINFO_INVALIDRDESCS = 702,
+ D3D12_MESSAGE_ID_MAKERESIDENT_NULLOBJECTARRAY = 703,
+ D3D12_MESSAGE_ID_EVICT_NULLOBJECTARRAY = 705,
+ D3D12_MESSAGE_ID_SET_DESCRIPTOR_TABLE_INVALID = 708,
+ D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_INVALID = 709,
+ D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_BUFFER_VIEW_INVALID = 710,
+ D3D12_MESSAGE_ID_SET_ROOT_SHADER_RESOURCE_VIEW_INVALID = 711,
+ D3D12_MESSAGE_ID_SET_ROOT_UNORDERED_ACCESS_VIEW_INVALID = 712,
+ D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID_DESC = 713,
+ D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID_DESC = 715,
+ D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID_DESC = 717,
+ D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDDIMENSIONALITY = 718,
+ D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDLAYOUT = 719,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONALITY = 720,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDALIGNMENT = 721,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMIPLEVELS = 722,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDSAMPLEDESC = 723,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDLAYOUT = 724,
+ D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID = 725,
+ D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID = 726,
+ D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID = 727,
+ D3D12_MESSAGE_ID_SET_RENDER_TARGETS_INVALID = 728,
+ D3D12_MESSAGE_ID_CREATEQUERY_HEAP_INVALID_PARAMETERS = 729,
+ D3D12_MESSAGE_ID_BEGIN_END_QUERY_INVALID_PARAMETERS = 731,
+ D3D12_MESSAGE_ID_CLOSE_COMMAND_LIST_OPEN_QUERY = 732,
+ D3D12_MESSAGE_ID_RESOLVE_QUERY_DATA_INVALID_PARAMETERS = 733,
+ D3D12_MESSAGE_ID_SET_PREDICATION_INVALID_PARAMETERS = 734,
+ D3D12_MESSAGE_ID_TIMESTAMPS_NOT_SUPPORTED = 735,
+ D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDFORMAT = 737,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDFORMAT = 738,
+ D3D12_MESSAGE_ID_GETCOPYABLEFOOTPRINTS_INVALIDSUBRESOURCERANGE = 739,
+ D3D12_MESSAGE_ID_GETCOPYABLEFOOTPRINTS_INVALIDBASEOFFSET = 740,
+ D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDSUBRESOURCERANGE = 739,
+ D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDBASEOFFSET = 740,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_HEAP = 741,
+ D3D12_MESSAGE_ID_CREATE_SAMPLER_INVALID = 742,
+ D3D12_MESSAGE_ID_CREATECOMMANDSIGNATURE_INVALID = 743,
+ D3D12_MESSAGE_ID_EXECUTE_INDIRECT_INVALID_PARAMETERS = 744,
+ D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_RESOURCE_DIMENSION = 745,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUE = 815,
+ D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDCLEARVALUEFORMAT = 816,
+ D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUEFORMAT = 817,
+ D3D12_MESSAGE_ID_CREATERESOURCE_CLEARVALUEDENORMFLUSH = 818,
+ D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_MISMATCHINGCLEARVALUE = 820,
+ D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_MISMATCHINGCLEARVALUE = 821,
+ D3D12_MESSAGE_ID_MAP_INVALIDHEAP = 822,
+ D3D12_MESSAGE_ID_UNMAP_INVALIDHEAP = 823,
+ D3D12_MESSAGE_ID_MAP_INVALIDRESOURCE = 824,
+ D3D12_MESSAGE_ID_UNMAP_INVALIDRESOURCE = 825,
+ D3D12_MESSAGE_ID_MAP_INVALIDSUBRESOURCE = 826,
+ D3D12_MESSAGE_ID_UNMAP_INVALIDSUBRESOURCE = 827,
+ D3D12_MESSAGE_ID_MAP_INVALIDRANGE = 828,
+ D3D12_MESSAGE_ID_UNMAP_INVALIDRANGE = 829,
+ D3D12_MESSAGE_ID_MAP_INVALIDDATAPOINTER = 832,
+ D3D12_MESSAGE_ID_MAP_INVALIDARG_RETURN = 833,
+ D3D12_MESSAGE_ID_MAP_OUTOFMEMORY_RETURN = 834,
+ D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_BUNDLENOTSUPPORTED = 835,
+ D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_COMMANDLISTMISMATCH = 836,
+ D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_OPENCOMMANDLIST = 837,
+ D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_FAILEDCOMMANDLIST = 838,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLDST = 839,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDDSTRESOURCEDIMENSION = 840,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_DSTRANGEOUTOFBOUNDS = 841,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLSRC = 842,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDSRCRESOURCEDIMENSION = 843,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_SRCRANGEOUTOFBOUNDS = 844,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDCOPYFLAGS = 845,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLDST = 846,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTTYPE = 847,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCEDIMENSION = 848,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCE = 849,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTSUBRESOURCE = 850,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTOFFSET = 851,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTFORMAT = 852,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTFORMAT = 853,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDIMENSIONS = 854,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTROWPITCH = 855,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTPLACEMENT = 856,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDSPLACEDFOOTPRINTFORMAT = 857,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_DSTREGIONOUTOFBOUNDS = 858,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLSRC = 859,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCTYPE = 860,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCEDIMENSION = 861,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCE = 862,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCSUBRESOURCE = 863,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCOFFSET = 864,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCFORMAT = 865,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCFORMAT = 866,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDIMENSIONS = 867,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCROWPITCH = 868,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCPLACEMENT = 869,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDSPLACEDFOOTPRINTFORMAT = 870,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_SRCREGIONOUTOFBOUNDS = 871,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTCOORDINATES = 872,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCBOX = 873,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_FORMATMISMATCH = 874,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_EMPTYBOX = 875,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDCOPYFLAGS = 876,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SUBRESOURCE_INDEX = 877,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_FORMAT = 878,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_MISMATCH = 879,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SAMPLE_COUNT = 880,
+ D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_INVALID_SHADER = 881,
+ D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_CS_ROOT_SIGNATURE_MISMATCH = 882,
+ D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_MISSING_ROOT_SIGNATURE = 883,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALIDCACHEDBLOB = 884,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBADAPTERMISMATCH = 885,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDRIVERVERSIONMISMATCH = 886,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDESCMISMATCH = 887,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBIGNORED = 888,
+ D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDHEAP = 889,
+ D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDRESOURCE = 890,
+ D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDBOX = 891,
+ D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDSUBRESOURCE = 892,
+ D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_EMPTYBOX = 893,
+ D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDHEAP = 894,
+ D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDRESOURCE = 895,
+ D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDBOX = 896,
+ D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDSUBRESOURCE = 897,
+ D3D12_MESSAGE_ID_READFROMSUBRESOURCE_EMPTYBOX = 898,
+ D3D12_MESSAGE_ID_TOO_MANY_NODES_SPECIFIED = 899,
+ D3D12_MESSAGE_ID_INVALID_NODE_INDEX = 900,
+ D3D12_MESSAGE_ID_GETHEAPPROPERTIES_INVALIDRESOURCE = 901,
+ D3D12_MESSAGE_ID_NODE_MASK_MISMATCH = 902,
+ D3D12_MESSAGE_ID_COMMAND_LIST_OUTOFMEMORY = 903,
+ D3D12_MESSAGE_ID_COMMAND_LIST_MULTIPLE_SWAPCHAIN_BUFFER_REFERENCES = 904,
+ D3D12_MESSAGE_ID_COMMAND_LIST_TOO_MANY_SWAPCHAIN_REFERENCES = 905,
+ D3D12_MESSAGE_ID_COMMAND_QUEUE_TOO_MANY_SWAPCHAIN_REFERENCES = 906,
+ D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_WRONGSWAPCHAINBUFFERREFERENCE = 907,
+ D3D12_MESSAGE_ID_COMMAND_LIST_SETRENDERTARGETS_INVALIDNUMRENDERTARGETS = 908,
+ D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_TYPE = 909,
+ D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_FLAGS = 910,
+ D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFLAGS = 911,
+ D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFORMAT = 912,
+ D3D12_MESSAGE_ID_CREATESHAREDHEAP_INVALIDFLAGS = 913,
+ D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_UNRECOGNIZEDPROPERTIES = 914,
+ D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDSIZE = 915,
+ D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDOBJECT = 916,
+ D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDOBJECT = 917,
+ D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDKEY = 918,
+ D3D12_MESSAGE_ID_KEYEDMUTEX_WRONGSTATE = 919,
+ D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_PRIORITY = 920,
+ D3D12_MESSAGE_ID_OBJECT_DELETED_WHILE_STILL_IN_USE = 921,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_FLAGS = 922,
+ D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_HAS_NO_RESOURCE = 923,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RENDER_TARGET_DELETED = 924,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_ALL_RENDER_TARGETS_HAVE_UNKNOWN_FORMAT = 925,
+ D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_INTERSECTS_MULTIPLE_BUFFERS = 926,
+ D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_GPU_WRITTEN_READBACK_RESOURCE_MAPPED = 927,
+ D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_EMPTY = 929,
+ D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE = 930,
+ D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE = 931,
+ D3D12_MESSAGE_ID_NO_GRAPHICS_API_SUPPORT = 932,
+ D3D12_MESSAGE_ID_NO_COMPUTE_API_SUPPORT = 933,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_FLAGS_NOT_SUPPORTED = 934,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_ARGUMENT_UNINITIALIZED = 935,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_HEAP_INDEX_OUT_OF_BOUNDS = 936,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TABLE_REGISTER_INDEX_OUT_OF_BOUNDS = 937,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_UNINITIALIZED = 938,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TYPE_MISMATCH = 939,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SRV_RESOURCE_DIMENSION_MISMATCH = 940,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UAV_RESOURCE_DIMENSION_MISMATCH = 941,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE = 942,
+ D3D12_MESSAGE_ID_COPYRESOURCE_NULLDST = 943,
+ D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDSTRESOURCE = 944,
+ D3D12_MESSAGE_ID_COPYRESOURCE_NULLSRC = 945,
+ D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSRCRESOURCE = 946,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLDST = 947,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDDSTRESOURCE = 948,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLSRC = 949,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDSRCRESOURCE = 950,
+ D3D12_MESSAGE_ID_PIPELINE_STATE_TYPE_MISMATCH = 951,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_NOT_SET = 952,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_MISMATCH = 953,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_ZERO_BARRIERS = 954,
+ D3D12_MESSAGE_ID_BEGIN_END_EVENT_MISMATCH = 955,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_POSSIBLE_BEFORE_AFTER_MISMATCH = 956,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_BEGIN_END = 957,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INVALID_RESOURCE = 958,
+ D3D12_MESSAGE_ID_USE_OF_ZERO_REFCOUNT_OBJECT = 959,
+ D3D12_MESSAGE_ID_OBJECT_EVICTED_WHILE_STILL_IN_USE = 960,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_DESCRIPTOR_ACCESS_OUT_OF_BOUNDS = 961,
+ D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_INVALIDLIBRARYBLOB = 962,
+ D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_DRIVERVERSIONMISMATCH = 963,
+ D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_ADAPTERVERSIONMISMATCH = 964,
+ D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_UNSUPPORTED = 965,
+ D3D12_MESSAGE_ID_CREATE_PIPELINELIBRARY = 966,
+ D3D12_MESSAGE_ID_LIVE_PIPELINELIBRARY = 967,
+ D3D12_MESSAGE_ID_DESTROY_PIPELINELIBRARY = 968,
+ D3D12_MESSAGE_ID_STOREPIPELINE_NONAME = 969,
+ D3D12_MESSAGE_ID_STOREPIPELINE_DUPLICATENAME = 970,
+ D3D12_MESSAGE_ID_LOADPIPELINE_NAMENOTFOUND = 971,
+ D3D12_MESSAGE_ID_LOADPIPELINE_INVALIDDESC = 972,
+ D3D12_MESSAGE_ID_PIPELINELIBRARY_SERIALIZE_NOTENOUGHMEMORY = 973,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_RT_OUTPUT_MISMATCH = 974,
+ D3D12_MESSAGE_ID_SETEVENTONMULTIPLEFENCECOMPLETION_INVALIDFLAGS = 975,
+ D3D12_MESSAGE_ID_CREATE_QUEUE_VIDEO_NOT_SUPPORTED = 976,
+ D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_VIDEO_NOT_SUPPORTED = 977,
+ D3D12_MESSAGE_ID_CREATEQUERY_HEAP_VIDEO_DECODE_STATISTICS_NOT_SUPPORTED = 978,
+ D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDLIST = 979,
+ D3D12_MESSAGE_ID_CREATE_VIDEODECODER = 980,
+ D3D12_MESSAGE_ID_CREATE_VIDEODECODESTREAM = 981,
+ D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDLIST = 982,
+ D3D12_MESSAGE_ID_LIVE_VIDEODECODER = 983,
+ D3D12_MESSAGE_ID_LIVE_VIDEODECODESTREAM = 984,
+ D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDLIST = 985,
+ D3D12_MESSAGE_ID_DESTROY_VIDEODECODER = 986,
+ D3D12_MESSAGE_ID_DESTROY_VIDEODECODESTREAM = 987,
+ D3D12_MESSAGE_ID_DECODE_FRAME_INVALID_PARAMETERS = 988,
+ D3D12_MESSAGE_ID_DEPRECATED_API = 989,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_COMMAND_LIST_TYPE = 990,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DESCRIPTOR_TABLE_NOT_SET = 991,
+ D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_CONSTANT_BUFFER_VIEW_NOT_SET = 992,
+ D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_SHADER_RESOURCE_VIEW_NOT_SET = 993,
+ D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_UNORDERED_ACCESS_VIEW_NOT_SET = 994,
+ D3D12_MESSAGE_ID_DISCARD_INVALID_SUBRESOURCE_RANGE = 995,
+ D3D12_MESSAGE_ID_DISCARD_ONE_SUBRESOURCE_FOR_MIPS_WITH_RECTS = 996,
+ D3D12_MESSAGE_ID_DISCARD_NO_RECTS_FOR_NON_TEXTURE2D = 997,
+ D3D12_MESSAGE_ID_COPY_ON_SAME_SUBRESOURCE = 998,
+ D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PAGEABLE = 999,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UNSUPPORTED = 1000,
+ D3D12_MESSAGE_ID_STATIC_DESCRIPTOR_INVALID_DESCRIPTOR_CHANGE = 1001,
+ D3D12_MESSAGE_ID_DATA_STATIC_DESCRIPTOR_INVALID_DATA_CHANGE = 1002,
+ D3D12_MESSAGE_ID_DATA_STATIC_WHILE_SET_AT_EXECUTE_DESCRIPTOR_INVALID_DATA_CHANGE = 1003,
+ D3D12_MESSAGE_ID_EXECUTE_BUNDLE_STATIC_DESCRIPTOR_DATA_STATIC_NOT_SET = 1004,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_ACCESS_OUT_OF_BOUNDS = 1005,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SAMPLER_MODE_MISMATCH = 1006,
+ D3D12_MESSAGE_ID_CREATE_FENCE_INVALID_FLAGS = 1007,
+ D3D12_MESSAGE_ID_RESOURCE_BARRIER_DUPLICATE_SUBRESOURCE_TRANSITIONS = 1008,
+ D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PRIORITY = 1009,
+ D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_LARGE_NUM_DESCRIPTORS = 1013,
+ D3D12_MESSAGE_ID_BEGIN_EVENT = 1014,
+ D3D12_MESSAGE_ID_END_EVENT = 1015,
+ D3D12_MESSAGE_ID_CREATEDEVICE_DEBUG_LAYER_STARTUP_OPTIONS = 1016,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_DEPTHBOUNDSTEST_UNSUPPORTED = 1017,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_DUPLICATE_SUBOBJECT = 1018,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_UNKNOWN_SUBOBJECT = 1019,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_ZERO_SIZE_STREAM = 1020,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_STREAM = 1021,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CANNOT_DEDUCE_TYPE = 1022,
+ D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_RESOURCE_DIMENSION_MISMATCH = 1023,
+ D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_PRIVILEGE_FOR_GLOBAL_REALTIME = 1024,
+ D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_HARDWARE_SUPPORT_FOR_GLOBAL_REALTIME = 1025,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_ARCHITECTURE = 1026,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DST = 1027,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE_DIMENSION = 1028,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DST_RANGE_OUT_OF_BOUNDS = 1029,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_SRC = 1030,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE_DIMENSION = 1031,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_SRC_RANGE_OUT_OF_BOUNDS = 1032,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_OFFSET_ALIGNMENT = 1033,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_RESOURCES = 1034,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_SUBRESOURCE_RANGES = 1035,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_RESOURCE = 1036,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_SUBRESOURCE_RANGE = 1037,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_SUBRESOURCE_OUT_OF_BOUNDS = 1038,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_RANGE_OUT_OF_BOUNDS = 1039,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_ZERO_DEPENDENCIES = 1040,
+ D3D12_MESSAGE_ID_DEVICE_CREATE_SHARED_HANDLE_INVALIDARG = 1041,
+ D3D12_MESSAGE_ID_DESCRIPTOR_HANDLE_WITH_INVALID_RESOURCE = 1042,
+ D3D12_MESSAGE_ID_SETDEPTHBOUNDS_INVALIDARGS = 1043,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_STATE_IMPRECISE = 1044,
+ D3D12_MESSAGE_ID_COMMAND_LIST_PIPELINE_STATE_NOT_SET = 1045,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_MODEL_MISMATCH = 1046,
+ D3D12_MESSAGE_ID_OBJECT_ACCESSED_WHILE_STILL_IN_USE = 1047,
+ D3D12_MESSAGE_ID_PROGRAMMABLE_MSAA_UNSUPPORTED = 1048,
+ D3D12_MESSAGE_ID_SETSAMPLEPOSITIONS_INVALIDARGS = 1049,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCEREGION_INVALID_RECT = 1050,
+ D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDQUEUE = 1051,
+ D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDLIST = 1052,
+ D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDQUEUE = 1053,
+ D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDQUEUE = 1054,
+ D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDLIST = 1055,
+ D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDQUEUE = 1056,
+ D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDQUEUE = 1057,
+ D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDLIST = 1058,
+ D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDQUEUE = 1059,
+ D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSOR = 1060,
+ D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSSTREAM = 1061,
+ D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSOR = 1062,
+ D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSSTREAM = 1063,
+ D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSOR = 1064,
+ D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSSTREAM = 1065,
+ D3D12_MESSAGE_ID_PROCESS_FRAME_INVALID_PARAMETERS = 1066,
+ D3D12_MESSAGE_ID_COPY_INVALIDLAYOUT = 1067,
+ D3D12_MESSAGE_ID_CREATE_CRYPTO_SESSION = 1068,
+ D3D12_MESSAGE_ID_CREATE_CRYPTO_SESSION_POLICY = 1069,
+ D3D12_MESSAGE_ID_CREATE_PROTECTED_RESOURCE_SESSION = 1070,
+ D3D12_MESSAGE_ID_LIVE_CRYPTO_SESSION = 1071,
+ D3D12_MESSAGE_ID_LIVE_CRYPTO_SESSION_POLICY = 1072,
+ D3D12_MESSAGE_ID_LIVE_PROTECTED_RESOURCE_SESSION = 1073,
+ D3D12_MESSAGE_ID_DESTROY_CRYPTO_SESSION = 1074,
+ D3D12_MESSAGE_ID_DESTROY_CRYPTO_SESSION_POLICY = 1075,
+ D3D12_MESSAGE_ID_DESTROY_PROTECTED_RESOURCE_SESSION = 1076,
+ D3D12_MESSAGE_ID_PROTECTED_RESOURCE_SESSION_UNSUPPORTED = 1077,
+ D3D12_MESSAGE_ID_FENCE_INVALIDOPERATION = 1078,
+ D3D12_MESSAGE_ID_CREATEQUERY_HEAP_COPY_QUEUE_TIMESTAMPS_NOT_SUPPORTED = 1079,
+ D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_DEFERRED = 1080,
+ D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_RECORDTIME_ASSUMEDFROMFIRSTUSE = 1081,
+ D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_RECORDTIME_ASSUMEDFROMCLEAR = 1082,
+ D3D12_MESSAGE_ID_CREATE_VIDEODECODERHEAP = 1083,
+ D3D12_MESSAGE_ID_LIVE_VIDEODECODERHEAP = 1084,
+ D3D12_MESSAGE_ID_DESTROY_VIDEODECODERHEAP = 1085,
+ D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDARG_RETURN = 1086,
+ D3D12_MESSAGE_ID_OPENEXISTINGHEAP_OUTOFMEMORY_RETURN = 1087,
+ D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDADDRESS = 1088,
+ D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDHANDLE = 1089,
+ D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_DEST = 1090,
+ D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_MODE = 1091,
+ D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_ALIGNMENT = 1092,
+ D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_NOT_SUPPORTED = 1093,
+ D3D12_MESSAGE_ID_SETVIEWINSTANCEMASK_INVALIDARGS = 1094,
+ D3D12_MESSAGE_ID_VIEW_INSTANCING_UNSUPPORTED = 1095,
+ D3D12_MESSAGE_ID_VIEW_INSTANCING_INVALIDARGS = 1096,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_MISMATCH_DECODE_REFERENCE_ONLY_FLAG = 1097,
+ D3D12_MESSAGE_ID_COPYRESOURCE_MISMATCH_DECODE_REFERENCE_ONLY_FLAG = 1098,
+ D3D12_MESSAGE_ID_CREATE_VIDEO_DECODE_HEAP_CAPS_FAILURE = 1099,
+ D3D12_MESSAGE_ID_CREATE_VIDEO_DECODE_HEAP_CAPS_UNSUPPORTED = 1100,
+ D3D12_MESSAGE_ID_VIDEO_DECODE_SUPPORT_INVALID_INPUT = 1101,
+ D3D12_MESSAGE_ID_CREATE_VIDEO_DECODER_UNSUPPORTED = 1102,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_METADATA_ERROR = 1103,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VIEW_INSTANCING_VERTEX_SIZE_EXCEEDED = 1104,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RUNTIME_INTERNAL_ERROR = 1105,
+ D3D12_MESSAGE_ID_NO_VIDEO_API_SUPPORT = 1106,
+ D3D12_MESSAGE_ID_VIDEO_PROCESS_SUPPORT_INVALID_INPUT = 1107,
+ D3D12_MESSAGE_ID_CREATE_VIDEO_PROCESSOR_CAPS_FAILURE = 1108,
+ D3D12_MESSAGE_ID_VIDEO_PROCESS_SUPPORT_UNSUPPORTED_FORMAT = 1109,
+ D3D12_MESSAGE_ID_VIDEO_DECODE_FRAME_INVALID_ARGUMENT = 1110,
+ D3D12_MESSAGE_ID_ENQUEUE_MAKE_RESIDENT_INVALID_FLAGS = 1111,
+ D3D12_MESSAGE_ID_OPENEXISTINGHEAP_UNSUPPORTED = 1112,
+ D3D12_MESSAGE_ID_VIDEO_PROCESS_FRAMES_INVALID_ARGUMENT = 1113,
+ D3D12_MESSAGE_ID_VIDEO_DECODE_SUPPORT_UNSUPPORTED = 1114,
+ D3D12_MESSAGE_ID_CREATE_COMMANDRECORDER = 1115,
+ D3D12_MESSAGE_ID_LIVE_COMMANDRECORDER = 1116,
+ D3D12_MESSAGE_ID_DESTROY_COMMANDRECORDER = 1117,
+ D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_VIDEO_NOT_SUPPORTED = 1118,
+ D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_INVALID_SUPPORT_FLAGS = 1119,
+ D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_INVALID_FLAGS = 1120,
+ D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_MORE_RECORDERS_THAN_LOGICAL_PROCESSORS = 1121,
+ D3D12_MESSAGE_ID_CREATE_COMMANDPOOL = 1122,
+ D3D12_MESSAGE_ID_LIVE_COMMANDPOOL = 1123,
+ D3D12_MESSAGE_ID_DESTROY_COMMANDPOOL = 1124,
+ D3D12_MESSAGE_ID_CREATE_COMMAND_POOL_INVALID_FLAGS = 1125,
+ D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_VIDEO_NOT_SUPPORTED = 1126,
+ D3D12_MESSAGE_ID_COMMAND_RECORDER_SUPPORT_FLAGS_MISMATCH = 1127,
+ D3D12_MESSAGE_ID_COMMAND_RECORDER_CONTENTION = 1128,
+ D3D12_MESSAGE_ID_COMMAND_RECORDER_USAGE_WITH_CREATECOMMANDLIST_COMMAND_LIST = 1129,
+ D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_USAGE_WITH_CREATECOMMANDLIST1_COMMAND_LIST = 1130,
+ D3D12_MESSAGE_ID_CANNOT_EXECUTE_EMPTY_COMMAND_LIST = 1131,
+ D3D12_MESSAGE_ID_CANNOT_RESET_COMMAND_POOL_WITH_OPEN_COMMAND_LISTS = 1132,
+ D3D12_MESSAGE_ID_CANNOT_USE_COMMAND_RECORDER_WITHOUT_CURRENT_TARGET = 1133,
+ D3D12_MESSAGE_ID_CANNOT_CHANGE_COMMAND_RECORDER_TARGET_WHILE_RECORDING = 1134,
+ D3D12_MESSAGE_ID_COMMAND_POOL_SYNC = 1135,
+ D3D12_MESSAGE_ID_EVICT_UNDERFLOW = 1136,
+ D3D12_MESSAGE_ID_CREATE_META_COMMAND = 1137,
+ D3D12_MESSAGE_ID_LIVE_META_COMMAND = 1138,
+ D3D12_MESSAGE_ID_DESTROY_META_COMMAND = 1139,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALID_DST_RESOURCE = 1140,
+ D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALID_SRC_RESOURCE = 1141,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE = 1142,
+ D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE = 1143,
+ D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_NULL_BUFFER = 1144,
+ D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_NULL_RESOURCE_DESC = 1145,
+ D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_UNSUPPORTED = 1146,
+ D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_DIMENSION = 1147,
+ D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_FLAGS = 1148,
+ D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_OFFSET = 1149,
+ D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_RESOURCE_DIMENSION = 1150,
+ D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_RESOURCE_FLAGS = 1151,
+ D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_OUTOFMEMORY_RETURN = 1152,
+ D3D12_MESSAGE_ID_CANNOT_CREATE_GRAPHICS_AND_VIDEO_COMMAND_RECORDER = 1153,
+ D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_POSSIBLY_MISMATCHING_PROPERTIES = 1154,
+ D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_INVALID_COMMAND_LIST_TYPE = 1155,
+ D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_INCOMPATIBLE_WITH_STRUCTURED_BUFFERS = 1156,
+ D3D12_MESSAGE_ID_COMPUTE_ONLY_DEVICE_OPERATION_UNSUPPORTED = 1157,
+ D3D12_MESSAGE_ID_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INVALID = 1158,
+ D3D12_MESSAGE_ID_EMIT_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_INVALID = 1159,
+ D3D12_MESSAGE_ID_COPY_RAYTRACING_ACCELERATION_STRUCTURE_INVALID = 1160,
+ D3D12_MESSAGE_ID_DISPATCH_RAYS_INVALID = 1161,
+ D3D12_MESSAGE_ID_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_INVALID = 1162,
+ D3D12_MESSAGE_ID_CREATE_LIFETIMETRACKER = 1163,
+ D3D12_MESSAGE_ID_LIVE_LIFETIMETRACKER = 1164,
+ D3D12_MESSAGE_ID_DESTROY_LIFETIMETRACKER = 1165,
+ D3D12_MESSAGE_ID_DESTROYOWNEDOBJECT_OBJECTNOTOWNED = 1166,
+ D3D12_MESSAGE_ID_CREATE_TRACKEDWORKLOAD = 1167,
+ D3D12_MESSAGE_ID_LIVE_TRACKEDWORKLOAD = 1168,
+ D3D12_MESSAGE_ID_DESTROY_TRACKEDWORKLOAD = 1169,
+ D3D12_MESSAGE_ID_RENDER_PASS_ERROR = 1170,
+ D3D12_MESSAGE_ID_META_COMMAND_ID_INVALID = 1171,
+ D3D12_MESSAGE_ID_META_COMMAND_UNSUPPORTED_PARAMS = 1172,
+ D3D12_MESSAGE_ID_META_COMMAND_FAILED_ENUMERATION = 1173,
+ D3D12_MESSAGE_ID_META_COMMAND_PARAMETER_SIZE_MISMATCH = 1174,
+ D3D12_MESSAGE_ID_UNINITIALIZED_META_COMMAND = 1175,
+ D3D12_MESSAGE_ID_META_COMMAND_INVALID_GPU_VIRTUAL_ADDRESS = 1176,
+ D3D12_MESSAGE_ID_CREATE_VIDEOENCODECOMMANDLIST = 1177,
+ D3D12_MESSAGE_ID_LIVE_VIDEOENCODECOMMANDLIST = 1178,
+ D3D12_MESSAGE_ID_DESTROY_VIDEOENCODECOMMANDLIST = 1179,
+ D3D12_MESSAGE_ID_CREATE_VIDEOENCODECOMMANDQUEUE = 1180,
+ D3D12_MESSAGE_ID_LIVE_VIDEOENCODECOMMANDQUEUE = 1181,
+ D3D12_MESSAGE_ID_DESTROY_VIDEOENCODECOMMANDQUEUE = 1182,
+ D3D12_MESSAGE_ID_CREATE_VIDEOMOTIONESTIMATOR = 1183,
+ D3D12_MESSAGE_ID_LIVE_VIDEOMOTIONESTIMATOR = 1184,
+ D3D12_MESSAGE_ID_DESTROY_VIDEOMOTIONESTIMATOR = 1185,
+ D3D12_MESSAGE_ID_CREATE_VIDEOMOTIONVECTORHEAP = 1186,
+ D3D12_MESSAGE_ID_LIVE_VIDEOMOTIONVECTORHEAP = 1187,
+ D3D12_MESSAGE_ID_DESTROY_VIDEOMOTIONVECTORHEAP = 1188,
+ D3D12_MESSAGE_ID_MULTIPLE_TRACKED_WORKLOADS = 1189,
+ D3D12_MESSAGE_ID_MULTIPLE_TRACKED_WORKLOAD_PAIRS = 1190,
+ D3D12_MESSAGE_ID_OUT_OF_ORDER_TRACKED_WORKLOAD_PAIR = 1191,
+ D3D12_MESSAGE_ID_CANNOT_ADD_TRACKED_WORKLOAD = 1192,
+ D3D12_MESSAGE_ID_INCOMPLETE_TRACKED_WORKLOAD_PAIR = 1193,
+ D3D12_MESSAGE_ID_CREATE_STATE_OBJECT_ERROR = 1194,
+ D3D12_MESSAGE_ID_GET_SHADER_IDENTIFIER_ERROR = 1195,
+ D3D12_MESSAGE_ID_GET_SHADER_STACK_SIZE_ERROR = 1196,
+ D3D12_MESSAGE_ID_GET_PIPELINE_STACK_SIZE_ERROR = 1197,
+ D3D12_MESSAGE_ID_SET_PIPELINE_STACK_SIZE_ERROR = 1198,
+ D3D12_MESSAGE_ID_GET_SHADER_IDENTIFIER_SIZE_INVALID = 1199,
+ D3D12_MESSAGE_ID_CHECK_DRIVER_MATCHING_IDENTIFIER_INVALID = 1200,
+ D3D12_MESSAGE_ID_CHECK_DRIVER_MATCHING_IDENTIFIER_DRIVER_REPORTED_ISSUE = 1201,
+ D3D12_MESSAGE_ID_RENDER_PASS_INVALID_RESOURCE_BARRIER = 1202,
+ D3D12_MESSAGE_ID_RENDER_PASS_DISALLOWED_API_CALLED = 1203,
+ D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_NEST_RENDER_PASSES = 1204,
+ D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_END_WITHOUT_BEGIN = 1205,
+ D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_CLOSE_COMMAND_LIST = 1206,
+ D3D12_MESSAGE_ID_RENDER_PASS_GPU_WORK_WHILE_SUSPENDED = 1207,
+ D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_SUSPEND_RESUME = 1208,
+ D3D12_MESSAGE_ID_RENDER_PASS_NO_PRIOR_SUSPEND_WITHIN_EXECUTECOMMANDLISTS = 1209,
+ D3D12_MESSAGE_ID_RENDER_PASS_NO_SUBSEQUENT_RESUME_WITHIN_EXECUTECOMMANDLISTS = 1210,
+ D3D12_MESSAGE_ID_TRACKED_WORKLOAD_COMMAND_QUEUE_MISMATCH = 1211,
+ D3D12_MESSAGE_ID_TRACKED_WORKLOAD_NOT_SUPPORTED = 1212,
+ D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_NO_ACCESS = 1213,
+ D3D12_MESSAGE_ID_RENDER_PASS_UNSUPPORTED_RESOLVE = 1214,
+ D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_INVALID_RESOURCE_PTR = 1215,
+ D3D12_MESSAGE_ID_WINDOWS7_FENCE_OUTOFORDER_SIGNAL = 1216,
+ D3D12_MESSAGE_ID_WINDOWS7_FENCE_OUTOFORDER_WAIT = 1217,
+ D3D12_MESSAGE_ID_VIDEO_CREATE_MOTION_ESTIMATOR_INVALID_ARGUMENT = 1218,
+ D3D12_MESSAGE_ID_VIDEO_CREATE_MOTION_VECTOR_HEAP_INVALID_ARGUMENT = 1219,
+ D3D12_MESSAGE_ID_ESTIMATE_MOTION_INVALID_ARGUMENT = 1220,
+ D3D12_MESSAGE_ID_RESOLVE_MOTION_VECTOR_HEAP_INVALID_ARGUMENT = 1221,
+ D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_HEAP_TYPE = 1222,
+ D3D12_MESSAGE_ID_SET_BACKGROUND_PROCESSING_MODE_INVALID_ARGUMENT = 1223,
+ D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_INVALID_COMMAND_LIST_TYPE_FOR_FEATURE_LEVEL = 1224,
+ D3D12_MESSAGE_ID_CREATE_VIDEOEXTENSIONCOMMAND = 1225,
+ D3D12_MESSAGE_ID_LIVE_VIDEOEXTENSIONCOMMAND = 1226,
+ D3D12_MESSAGE_ID_DESTROY_VIDEOEXTENSIONCOMMAND = 1227,
+ D3D12_MESSAGE_ID_INVALID_VIDEO_EXTENSION_COMMAND_ID = 1228,
+ D3D12_MESSAGE_ID_VIDEO_EXTENSION_COMMAND_INVALID_ARGUMENT = 1229,
+ D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_UNIQUE_IN_DXIL_LIBRARY = 1230,
+ D3D12_MESSAGE_ID_VARIABLE_SHADING_RATE_NOT_ALLOWED_WITH_TIR = 1231,
+ D3D12_MESSAGE_ID_GEOMETRY_SHADER_OUTPUTTING_BOTH_VIEWPORT_ARRAY_INDEX_AND_SHADING_RATE_NOT_SUPPORTED_ON_DEVICE = 1232,
+ D3D12_MESSAGE_ID_RSSETSHADING_RATE_INVALID_SHADING_RATE = 1233,
+ D3D12_MESSAGE_ID_RSSETSHADING_RATE_SHADING_RATE_NOT_PERMITTED_BY_CAP = 1234,
+ D3D12_MESSAGE_ID_RSSETSHADING_RATE_INVALID_COMBINER = 1235,
+ D3D12_MESSAGE_ID_RSSETSHADINGRATEIMAGE_REQUIRES_TIER_2 = 1236,
+ D3D12_MESSAGE_ID_RSSETSHADINGRATE_REQUIRES_TIER_1 = 1237,
+ D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_FORMAT = 1238,
+ D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_ARRAY_SIZE = 1239,
+ D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_MIP_LEVEL = 1240,
+ D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_SAMPLE_COUNT = 1241,
+ D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_SAMPLE_QUALITY = 1242,
+ D3D12_MESSAGE_ID_NON_RETAIL_SHADER_MODEL_WONT_VALIDATE = 1243,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_AS_ROOT_SIGNATURE_MISMATCH = 1244,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MS_ROOT_SIGNATURE_MISMATCH = 1245,
+ D3D12_MESSAGE_ID_ADD_TO_STATE_OBJECT_ERROR = 1246,
+ D3D12_MESSAGE_ID_CREATE_PROTECTED_RESOURCE_SESSION_INVALID_ARGUMENT = 1247,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MS_PSO_DESC_MISMATCH = 1248,
+ D3D12_MESSAGE_ID_CREATEPIPELINESTATE_MS_INCOMPLETE_TYPE = 1249,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_AS_NOT_MS_MISMATCH = 1250,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MS_NOT_PS_MISMATCH = 1251,
+ D3D12_MESSAGE_ID_NONZERO_SAMPLER_FEEDBACK_MIP_REGION_WITH_INCOMPATIBLE_FORMAT = 1252,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INPUTLAYOUT_SHADER_MISMATCH = 1253,
+ D3D12_MESSAGE_ID_EMPTY_DISPATCH = 1254,
+ D3D12_MESSAGE_ID_RESOURCE_FORMAT_REQUIRES_SAMPLER_FEEDBACK_CAPABILITY = 1255,
+ D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_MIP_REGION = 1256,
+ D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_DIMENSION = 1257,
+ D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_SAMPLE_COUNT = 1258,
+ D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_SAMPLE_QUALITY = 1259,
+ D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_INVALID_LAYOUT = 1260,
+ D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_MAP_REQUIRES_UNORDERED_ACCESS_FLAG = 1261,
+ D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_CREATE_UAV_NULL_ARGUMENTS = 1262,
+ D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_UAV_REQUIRES_SAMPLER_FEEDBACK_CAPABILITY = 1263,
+ D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_CREATE_UAV_REQUIRES_FEEDBACK_MAP_FORMAT = 1264,
+ D3D12_MESSAGE_ID_CREATEMESHSHADER_INVALIDSHADERBYTECODE = 1265,
+ D3D12_MESSAGE_ID_CREATEMESHSHADER_OUTOFMEMORY = 1266,
+ D3D12_MESSAGE_ID_CREATEMESHSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = 1267,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_SAMPLER_FEEDBACK_TRANSCODE_INVALID_FORMAT = 1268,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_SAMPLER_FEEDBACK_INVALID_MIP_LEVEL_COUNT = 1269,
+ D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_SAMPLER_FEEDBACK_TRANSCODE_ARRAY_SIZE_MISMATCH = 1270,
+ D3D12_MESSAGE_ID_SAMPLER_FEEDBACK_CREATE_UAV_MISMATCHING_TARGETED_RESOURCE = 1271,
+ D3D12_MESSAGE_ID_CREATEMESHSHADER_OUTPUTEXCEEDSMAXSIZE = 1272,
+ D3D12_MESSAGE_ID_CREATEMESHSHADER_GROUPSHAREDEXCEEDSMAXSIZE = 1273,
+ D3D12_MESSAGE_ID_VERTEX_SHADER_OUTPUTTING_BOTH_VIEWPORT_ARRAY_INDEX_AND_SHADING_RATE_NOT_SUPPORTED_ON_DEVICE = 1274,
+ D3D12_MESSAGE_ID_MESH_SHADER_OUTPUTTING_BOTH_VIEWPORT_ARRAY_INDEX_AND_SHADING_RATE_NOT_SUPPORTED_ON_DEVICE = 1275,
+ D3D12_MESSAGE_ID_CREATEMESHSHADER_MISMATCHEDASMSPAYLOADSIZE = 1276,
+ D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_UNBOUNDED_STATIC_DESCRIPTORS = 1277,
+ D3D12_MESSAGE_ID_CREATEAMPLIFICATIONSHADER_INVALIDSHADERBYTECODE = 1278,
+ D3D12_MESSAGE_ID_CREATEAMPLIFICATIONSHADER_OUTOFMEMORY = 1279,
+ D3D12_MESSAGE_ID_CREATE_SHADERCACHESESSION = 1280,
+ D3D12_MESSAGE_ID_LIVE_SHADERCACHESESSION = 1281,
+ D3D12_MESSAGE_ID_DESTROY_SHADERCACHESESSION = 1282,
+ D3D12_MESSAGE_ID_CREATESHADERCACHESESSION_INVALIDARGS = 1283,
+ D3D12_MESSAGE_ID_CREATESHADERCACHESESSION_DISABLED = 1284,
+ D3D12_MESSAGE_ID_CREATESHADERCACHESESSION_ALREADYOPEN = 1285,
+ D3D12_MESSAGE_ID_SHADERCACHECONTROL_DEVELOPERMODE = 1286,
+ D3D12_MESSAGE_ID_SHADERCACHECONTROL_INVALIDFLAGS = 1287,
+ D3D12_MESSAGE_ID_SHADERCACHECONTROL_STATEALREADYSET = 1288,
+ D3D12_MESSAGE_ID_SHADERCACHECONTROL_IGNOREDFLAG = 1289,
+ D3D12_MESSAGE_ID_SHADERCACHESESSION_STOREVALUE_ALREADYPRESENT = 1290,
+ D3D12_MESSAGE_ID_SHADERCACHESESSION_STOREVALUE_HASHCOLLISION = 1291,
+ D3D12_MESSAGE_ID_SHADERCACHESESSION_STOREVALUE_CACHEFULL = 1292,
+ D3D12_MESSAGE_ID_SHADERCACHESESSION_FINDVALUE_NOTFOUND = 1293,
+ D3D12_MESSAGE_ID_SHADERCACHESESSION_CORRUPT = 1294,
+ D3D12_MESSAGE_ID_SHADERCACHESESSION_DISABLED = 1295,
+ D3D12_MESSAGE_ID_OVERSIZED_DISPATCH = 1296,
+ D3D12_MESSAGE_ID_CREATE_VIDEOENCODER = 1297,
+ D3D12_MESSAGE_ID_LIVE_VIDEOENCODER = 1298,
+ D3D12_MESSAGE_ID_DESTROY_VIDEOENCODER = 1299,
+ D3D12_MESSAGE_ID_CREATE_VIDEOENCODERHEAP = 1300,
+ D3D12_MESSAGE_ID_LIVE_VIDEOENCODERHEAP = 1301,
+ D3D12_MESSAGE_ID_DESTROY_VIDEOENCODERHEAP = 1302,
+ D3D12_MESSAGE_ID_COPYTEXTUREREGION_MISMATCH_ENCODE_REFERENCE_ONLY_FLAG = 1303,
+ D3D12_MESSAGE_ID_COPYRESOURCE_MISMATCH_ENCODE_REFERENCE_ONLY_FLAG = 1304,
+ D3D12_MESSAGE_ID_ENCODE_FRAME_INVALID_PARAMETERS = 1305,
+ D3D12_MESSAGE_ID_ENCODE_FRAME_UNSUPPORTED_PARAMETERS = 1306,
+ D3D12_MESSAGE_ID_RESOLVE_ENCODER_OUTPUT_METADATA_INVALID_PARAMETERS = 1307,
+ D3D12_MESSAGE_ID_RESOLVE_ENCODER_OUTPUT_METADATA_UNSUPPORTED_PARAMETERS = 1308,
+ D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_INVALID_PARAMETERS = 1309,
+ D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_UNSUPPORTED_PARAMETERS = 1310,
+ D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_HEAP_INVALID_PARAMETERS = 1311,
+ D3D12_MESSAGE_ID_CREATE_VIDEO_ENCODER_HEAP_UNSUPPORTED_PARAMETERS = 1312,
+ D3D12_MESSAGE_ID_CREATECOMMANDLIST_NULL_COMMANDALLOCATOR = 1313,
+ D3D12_MESSAGE_ID_CLEAR_UNORDERED_ACCESS_VIEW_INVALID_DESCRIPTOR_HANDLE = 1314,
+ D3D12_MESSAGE_ID_DESCRIPTOR_HEAP_NOT_SHADER_VISIBLE = 1315,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_BLENDOP_WARNING = 1316,
+ D3D12_MESSAGE_ID_CREATEBLENDSTATE_BLENDOPALPHA_WARNING = 1317,
+ D3D12_MESSAGE_ID_WRITE_COMBINE_PERFORMANCE_WARNING = 1318,
+ D3D12_MESSAGE_ID_RESOLVE_QUERY_INVALID_QUERY_STATE = 1319,
+ D3D12_MESSAGE_ID_SETPRIVATEDATA_NO_ACCESS = 1320,
+ D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_SAMPLER_MODE_MISMATCH = 1321,
+ D3D12_MESSAGE_ID_GETCOPYABLEFOOTPRINTS_UNSUPPORTED_BUFFER_WIDTH = 1322,
+ D3D12_MESSAGE_ID_CREATEMESHSHADER_TOPOLOGY_MISMATCH = 1323,
+ D3D12_MESSAGE_ID_VRS_SUM_COMBINER_REQUIRES_CAPABILITY = 1324,
+ D3D12_MESSAGE_ID_SETTING_SHADING_RATE_FROM_MS_REQUIRES_CAPABILITY = 1325,
+ D3D12_MESSAGE_ID_SHADERCACHESESSION_SHADERCACHEDELETE_NOTSUPPORTED = 1326,
+ D3D12_MESSAGE_ID_SHADERCACHECONTROL_SHADERCACHECLEAR_NOTSUPPORTED = 1327,
+ D3D12_MESSAGE_ID_CREATERESOURCE_STATE_IGNORED = 1328,
+ D3D12_MESSAGE_ID_UNUSED_CROSS_EXECUTE_SPLIT_BARRIER = 1329,
+ D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_HANDLE_ACCESS_DENIED = 1330,
+ D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_VALUES = 1331,
+ D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_ACCESS = 1332,
+ D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_SYNC = 1333,
+ D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_LAYOUT = 1334,
+ D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_TYPE = 1335,
+ D3D12_MESSAGE_ID_OUT_OF_BOUNDS_BARRIER_SUBRESOURCE_RANGE = 1336,
+ D3D12_MESSAGE_ID_INCOMPATIBLE_BARRIER_RESOURCE_DIMENSION = 1337,
+ D3D12_MESSAGE_ID_SET_SCISSOR_RECTS_INVALID_RECT = 1338,
+ D3D12_MESSAGE_ID_SHADING_RATE_SOURCE_REQUIRES_DIMENSION_TEXTURE2D = 1339,
+ D3D12_MESSAGE_ID_BUFFER_BARRIER_SUBREGION_OUT_OF_BOUNDS = 1340,
+ D3D12_MESSAGE_ID_UNSUPPORTED_BARRIER_LAYOUT = 1341,
+ D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALID_PARAMETERS = 1342,
+ D3D12_MESSAGE_ID_ENHANCED_BARRIERS_NOT_SUPPORTED = 1343,
+ D3D12_MESSAGE_ID_CAST_TARGET_TEXEL_SIZE_MISMATCH = 1344,
+ D3D12_MESSAGE_ID_CAST_TO_PLANAR_NOT_SUPORTED = 1345,
+ D3D12_MESSAGE_ID_LEGACY_BARRIER_VALIDATION_FORCED_ON = 1346,
+ D3D12_MESSAGE_ID_EMPTY_ROOT_DESCRIPTOR_TABLE = 1347,
+ D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ELEMENT_OFFSET_UNALIGNED = 1348,
+ D3D12_MESSAGE_ID_ALPHA_BLEND_FACTOR_NOT_SUPPORTED = 1349,
+ D3D12_MESSAGE_ID_BARRIER_INTEROP_INVALID_LAYOUT = 1350,
+ D3D12_MESSAGE_ID_BARRIER_INTEROP_INVALID_STATE = 1351,
+ D3D12_MESSAGE_ID_GRAPHICS_PIPELINE_STATE_DESC_ZERO_SAMPLE_MASK = 1352,
+ D3D12_MESSAGE_ID_INDEPENDENT_STENCIL_REF_NOT_SUPPORTED = 1353,
+ D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INDEPENDENT_MASKS_UNSUPPORTED = 1354,
+ D3D12_MESSAGE_ID_TEXTURE_BARRIER_SUBRESOURCES_OUT_OF_BOUNDS = 1355,
+ D3D12_MESSAGE_ID_NON_OPTIMAL_BARRIER_ONLY_EXECUTE_COMMAND_LISTS = 1356,
+ D3D12_MESSAGE_ID_EXECUTE_INDIRECT_ZERO_COMMAND_COUNT = 1357,
+ D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_TEXTURE_LAYOUT = 1358,
+ D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DYNAMIC_INDEX_BUFFER_STRIP_CUT_NOT_SUPPORTED = 1359,
+ D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_TRIANGLE_FANS_NOT_SUPPORTED = 1360,
+ D3D12_MESSAGE_ID_CREATE_SAMPLER_COMPARISON_FUNC_IGNORED = 1361,
+ D3D12_MESSAGE_ID_D3D12_MESSAGES_END = ( D3D12_MESSAGE_ID_CREATE_SAMPLER_COMPARISON_FUNC_IGNORED + 1 )
+ } D3D12_MESSAGE_ID;
+
+typedef struct D3D12_MESSAGE
+ {
+ D3D12_MESSAGE_CATEGORY Category;
+ D3D12_MESSAGE_SEVERITY Severity;
+ D3D12_MESSAGE_ID ID;
+ _Field_size_(DescriptionByteLength) const char *pDescription;
+ SIZE_T DescriptionByteLength;
+ } D3D12_MESSAGE;
+
+typedef struct D3D12_INFO_QUEUE_FILTER_DESC
+ {
+ UINT NumCategories;
+ _Field_size_(NumCategories) D3D12_MESSAGE_CATEGORY *pCategoryList;
+ UINT NumSeverities;
+ _Field_size_(NumSeverities) D3D12_MESSAGE_SEVERITY *pSeverityList;
+ UINT NumIDs;
+ _Field_size_(NumIDs) D3D12_MESSAGE_ID *pIDList;
+ } D3D12_INFO_QUEUE_FILTER_DESC;
+
+typedef struct D3D12_INFO_QUEUE_FILTER
+ {
+ D3D12_INFO_QUEUE_FILTER_DESC AllowList;
+ D3D12_INFO_QUEUE_FILTER_DESC DenyList;
+ } D3D12_INFO_QUEUE_FILTER;
+
+#define D3D12_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0017_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0017_v0_0_s_ifspec;
+
+#ifndef __ID3D12InfoQueue_INTERFACE_DEFINED__
+#define __ID3D12InfoQueue_INTERFACE_DEFINED__
+
+/* interface ID3D12InfoQueue */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12InfoQueue;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("0742a90b-c387-483f-b946-30a7e4e61458")
+ ID3D12InfoQueue : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit(
+ _In_ UINT64 MessageCountLimit) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetMessage(
+ _In_ UINT64 MessageIndex,
+ _Out_writes_bytes_opt_(*pMessageByteLength) D3D12_MESSAGE *pMessage,
+ _Inout_ SIZE_T *pMessageByteLength) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0;
+
+ virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries(
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetStorageFilter(
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
+ _Inout_ SIZE_T *pFilterByteLength) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushStorageFilter(
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries(
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter(
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
+ _Inout_ SIZE_T *pFilterByteLength) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter(
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0;
+
+ virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddMessage(
+ _In_ D3D12_MESSAGE_CATEGORY Category,
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ D3D12_MESSAGE_ID ID,
+ _In_ LPCSTR pDescription) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage(
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ LPCSTR pDescription) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory(
+ _In_ D3D12_MESSAGE_CATEGORY Category,
+ _In_ BOOL bEnable) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity(
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ BOOL bEnable) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetBreakOnID(
+ _In_ D3D12_MESSAGE_ID ID,
+ _In_ BOOL bEnable) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory(
+ _In_ D3D12_MESSAGE_CATEGORY Category) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity(
+ _In_ D3D12_MESSAGE_SEVERITY Severity) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetBreakOnID(
+ _In_ D3D12_MESSAGE_ID ID) = 0;
+
+ virtual void STDMETHODCALLTYPE SetMuteDebugOutput(
+ _In_ BOOL bMute) = 0;
+
+ virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12InfoQueueVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12InfoQueue * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetMessageCountLimit)
+ HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )(
+ ID3D12InfoQueue * This,
+ _In_ UINT64 MessageCountLimit);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearStoredMessages)
+ void ( STDMETHODCALLTYPE *ClearStoredMessages )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMessage)
+ HRESULT ( STDMETHODCALLTYPE *GetMessage )(
+ ID3D12InfoQueue * This,
+ _In_ UINT64 MessageIndex,
+ _Out_writes_bytes_opt_(*pMessageByteLength) D3D12_MESSAGE *pMessage,
+ _Inout_ SIZE_T *pMessageByteLength);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesAllowedByStorageFilter)
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesDeniedByStorageFilter)
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumStoredMessages)
+ UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumStoredMessagesAllowedByRetrievalFilter)
+ UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesDiscardedByMessageCountLimit)
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMessageCountLimit)
+ UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddStorageFilterEntries)
+ HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetStorageFilter)
+ HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )(
+ ID3D12InfoQueue * This,
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
+ _Inout_ SIZE_T *pFilterByteLength);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearStorageFilter)
+ void ( STDMETHODCALLTYPE *ClearStorageFilter )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushEmptyStorageFilter)
+ HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushCopyOfStorageFilter)
+ HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushStorageFilter)
+ HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PopStorageFilter)
+ void ( STDMETHODCALLTYPE *PopStorageFilter )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetStorageFilterStackSize)
+ UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddRetrievalFilterEntries)
+ HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetRetrievalFilter)
+ HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )(
+ ID3D12InfoQueue * This,
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
+ _Inout_ SIZE_T *pFilterByteLength);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearRetrievalFilter)
+ void ( STDMETHODCALLTYPE *ClearRetrievalFilter )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushEmptyRetrievalFilter)
+ HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushCopyOfRetrievalFilter)
+ HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushRetrievalFilter)
+ HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PopRetrievalFilter)
+ void ( STDMETHODCALLTYPE *PopRetrievalFilter )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetRetrievalFilterStackSize)
+ UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )(
+ ID3D12InfoQueue * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddMessage)
+ HRESULT ( STDMETHODCALLTYPE *AddMessage )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_CATEGORY Category,
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ D3D12_MESSAGE_ID ID,
+ _In_ LPCSTR pDescription);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddApplicationMessage)
+ HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ LPCSTR pDescription);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnCategory)
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_CATEGORY Category,
+ _In_ BOOL bEnable);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnSeverity)
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ BOOL bEnable);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnID)
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_ID ID,
+ _In_ BOOL bEnable);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnCategory)
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_CATEGORY Category);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnSeverity)
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_SEVERITY Severity);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnID)
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnID )(
+ ID3D12InfoQueue * This,
+ _In_ D3D12_MESSAGE_ID ID);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetMuteDebugOutput)
+ void ( STDMETHODCALLTYPE *SetMuteDebugOutput )(
+ ID3D12InfoQueue * This,
+ _In_ BOOL bMute);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMuteDebugOutput)
+ BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )(
+ ID3D12InfoQueue * This);
+
+ END_INTERFACE
+ } ID3D12InfoQueueVtbl;
+
+ interface ID3D12InfoQueue
+ {
+ CONST_VTBL struct ID3D12InfoQueueVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12InfoQueue_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12InfoQueue_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12InfoQueue_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \
+ ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) )
+
+#define ID3D12InfoQueue_ClearStoredMessages(This) \
+ ( (This)->lpVtbl -> ClearStoredMessages(This) )
+
+#define ID3D12InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \
+ ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) )
+
+#define ID3D12InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \
+ ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) )
+
+#define ID3D12InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \
+ ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) )
+
+#define ID3D12InfoQueue_GetNumStoredMessages(This) \
+ ( (This)->lpVtbl -> GetNumStoredMessages(This) )
+
+#define ID3D12InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \
+ ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) )
+
+#define ID3D12InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \
+ ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) )
+
+#define ID3D12InfoQueue_GetMessageCountLimit(This) \
+ ( (This)->lpVtbl -> GetMessageCountLimit(This) )
+
+#define ID3D12InfoQueue_AddStorageFilterEntries(This,pFilter) \
+ ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) )
+
+#define ID3D12InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \
+ ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) )
+
+#define ID3D12InfoQueue_ClearStorageFilter(This) \
+ ( (This)->lpVtbl -> ClearStorageFilter(This) )
+
+#define ID3D12InfoQueue_PushEmptyStorageFilter(This) \
+ ( (This)->lpVtbl -> PushEmptyStorageFilter(This) )
+
+#define ID3D12InfoQueue_PushCopyOfStorageFilter(This) \
+ ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) )
+
+#define ID3D12InfoQueue_PushStorageFilter(This,pFilter) \
+ ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) )
+
+#define ID3D12InfoQueue_PopStorageFilter(This) \
+ ( (This)->lpVtbl -> PopStorageFilter(This) )
+
+#define ID3D12InfoQueue_GetStorageFilterStackSize(This) \
+ ( (This)->lpVtbl -> GetStorageFilterStackSize(This) )
+
+#define ID3D12InfoQueue_AddRetrievalFilterEntries(This,pFilter) \
+ ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) )
+
+#define ID3D12InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \
+ ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) )
+
+#define ID3D12InfoQueue_ClearRetrievalFilter(This) \
+ ( (This)->lpVtbl -> ClearRetrievalFilter(This) )
+
+#define ID3D12InfoQueue_PushEmptyRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) )
+
+#define ID3D12InfoQueue_PushCopyOfRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) )
+
+#define ID3D12InfoQueue_PushRetrievalFilter(This,pFilter) \
+ ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) )
+
+#define ID3D12InfoQueue_PopRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PopRetrievalFilter(This) )
+
+#define ID3D12InfoQueue_GetRetrievalFilterStackSize(This) \
+ ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) )
+
+#define ID3D12InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \
+ ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) )
+
+#define ID3D12InfoQueue_AddApplicationMessage(This,Severity,pDescription) \
+ ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) )
+
+#define ID3D12InfoQueue_SetBreakOnCategory(This,Category,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) )
+
+#define ID3D12InfoQueue_SetBreakOnSeverity(This,Severity,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) )
+
+#define ID3D12InfoQueue_SetBreakOnID(This,ID,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) )
+
+#define ID3D12InfoQueue_GetBreakOnCategory(This,Category) \
+ ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) )
+
+#define ID3D12InfoQueue_GetBreakOnSeverity(This,Severity) \
+ ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) )
+
+#define ID3D12InfoQueue_GetBreakOnID(This,ID) \
+ ( (This)->lpVtbl -> GetBreakOnID(This,ID) )
+
+#define ID3D12InfoQueue_SetMuteDebugOutput(This,bMute) \
+ ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) )
+
+#define ID3D12InfoQueue_GetMuteDebugOutput(This) \
+ ( (This)->lpVtbl -> GetMuteDebugOutput(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12InfoQueue_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0018 */
+/* [local] */
+
+typedef
+enum D3D12_MESSAGE_CALLBACK_FLAGS
+ {
+ D3D12_MESSAGE_CALLBACK_FLAG_NONE = 0,
+ D3D12_MESSAGE_CALLBACK_IGNORE_FILTERS = 0x1
+ } D3D12_MESSAGE_CALLBACK_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_MESSAGE_CALLBACK_FLAGS)
+typedef void ( __stdcall *D3D12MessageFunc )(
+ D3D12_MESSAGE_CATEGORY Category,
+ D3D12_MESSAGE_SEVERITY Severity,
+ D3D12_MESSAGE_ID ID,
+ LPCSTR pDescription,
+ void *pContext);
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0018_v0_0_s_ifspec;
+
+#ifndef __ID3D12InfoQueue1_INTERFACE_DEFINED__
+#define __ID3D12InfoQueue1_INTERFACE_DEFINED__
+
+/* interface ID3D12InfoQueue1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12InfoQueue1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("2852dd88-b484-4c0c-b6b1-67168500e600")
+ ID3D12InfoQueue1 : public ID3D12InfoQueue
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE RegisterMessageCallback(
+ _In_ D3D12MessageFunc CallbackFunc,
+ _In_ D3D12_MESSAGE_CALLBACK_FLAGS CallbackFilterFlags,
+ _In_ void *pContext,
+ _Inout_ DWORD *pCallbackCookie) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE UnregisterMessageCallback(
+ _In_ DWORD CallbackCookie) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12InfoQueue1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12InfoQueue1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetMessageCountLimit)
+ HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )(
+ ID3D12InfoQueue1 * This,
+ _In_ UINT64 MessageCountLimit);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearStoredMessages)
+ void ( STDMETHODCALLTYPE *ClearStoredMessages )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMessage)
+ HRESULT ( STDMETHODCALLTYPE *GetMessage )(
+ ID3D12InfoQueue1 * This,
+ _In_ UINT64 MessageIndex,
+ _Out_writes_bytes_opt_(*pMessageByteLength) D3D12_MESSAGE *pMessage,
+ _Inout_ SIZE_T *pMessageByteLength);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesAllowedByStorageFilter)
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesDeniedByStorageFilter)
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumStoredMessages)
+ UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumStoredMessagesAllowedByRetrievalFilter)
+ UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetNumMessagesDiscardedByMessageCountLimit)
+ UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMessageCountLimit)
+ UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddStorageFilterEntries)
+ HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )(
+ ID3D12InfoQueue1 * This,
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetStorageFilter)
+ HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )(
+ ID3D12InfoQueue1 * This,
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
+ _Inout_ SIZE_T *pFilterByteLength);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearStorageFilter)
+ void ( STDMETHODCALLTYPE *ClearStorageFilter )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushEmptyStorageFilter)
+ HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushCopyOfStorageFilter)
+ HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushStorageFilter)
+ HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )(
+ ID3D12InfoQueue1 * This,
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PopStorageFilter)
+ void ( STDMETHODCALLTYPE *PopStorageFilter )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetStorageFilterStackSize)
+ UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddRetrievalFilterEntries)
+ HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )(
+ ID3D12InfoQueue1 * This,
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetRetrievalFilter)
+ HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )(
+ ID3D12InfoQueue1 * This,
+ _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
+ _Inout_ SIZE_T *pFilterByteLength);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, ClearRetrievalFilter)
+ void ( STDMETHODCALLTYPE *ClearRetrievalFilter )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushEmptyRetrievalFilter)
+ HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushCopyOfRetrievalFilter)
+ HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PushRetrievalFilter)
+ HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )(
+ ID3D12InfoQueue1 * This,
+ _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, PopRetrievalFilter)
+ void ( STDMETHODCALLTYPE *PopRetrievalFilter )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetRetrievalFilterStackSize)
+ UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddMessage)
+ HRESULT ( STDMETHODCALLTYPE *AddMessage )(
+ ID3D12InfoQueue1 * This,
+ _In_ D3D12_MESSAGE_CATEGORY Category,
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ D3D12_MESSAGE_ID ID,
+ _In_ LPCSTR pDescription);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, AddApplicationMessage)
+ HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )(
+ ID3D12InfoQueue1 * This,
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ LPCSTR pDescription);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnCategory)
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )(
+ ID3D12InfoQueue1 * This,
+ _In_ D3D12_MESSAGE_CATEGORY Category,
+ _In_ BOOL bEnable);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnSeverity)
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )(
+ ID3D12InfoQueue1 * This,
+ _In_ D3D12_MESSAGE_SEVERITY Severity,
+ _In_ BOOL bEnable);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetBreakOnID)
+ HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )(
+ ID3D12InfoQueue1 * This,
+ _In_ D3D12_MESSAGE_ID ID,
+ _In_ BOOL bEnable);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnCategory)
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )(
+ ID3D12InfoQueue1 * This,
+ _In_ D3D12_MESSAGE_CATEGORY Category);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnSeverity)
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )(
+ ID3D12InfoQueue1 * This,
+ _In_ D3D12_MESSAGE_SEVERITY Severity);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetBreakOnID)
+ BOOL ( STDMETHODCALLTYPE *GetBreakOnID )(
+ ID3D12InfoQueue1 * This,
+ _In_ D3D12_MESSAGE_ID ID);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, SetMuteDebugOutput)
+ void ( STDMETHODCALLTYPE *SetMuteDebugOutput )(
+ ID3D12InfoQueue1 * This,
+ _In_ BOOL bMute);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue, GetMuteDebugOutput)
+ BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )(
+ ID3D12InfoQueue1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue1, RegisterMessageCallback)
+ HRESULT ( STDMETHODCALLTYPE *RegisterMessageCallback )(
+ ID3D12InfoQueue1 * This,
+ _In_ D3D12MessageFunc CallbackFunc,
+ _In_ D3D12_MESSAGE_CALLBACK_FLAGS CallbackFilterFlags,
+ _In_ void *pContext,
+ _Inout_ DWORD *pCallbackCookie);
+
+ DECLSPEC_XFGVIRT(ID3D12InfoQueue1, UnregisterMessageCallback)
+ HRESULT ( STDMETHODCALLTYPE *UnregisterMessageCallback )(
+ ID3D12InfoQueue1 * This,
+ _In_ DWORD CallbackCookie);
+
+ END_INTERFACE
+ } ID3D12InfoQueue1Vtbl;
+
+ interface ID3D12InfoQueue1
+ {
+ CONST_VTBL struct ID3D12InfoQueue1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12InfoQueue1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12InfoQueue1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12InfoQueue1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12InfoQueue1_SetMessageCountLimit(This,MessageCountLimit) \
+ ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) )
+
+#define ID3D12InfoQueue1_ClearStoredMessages(This) \
+ ( (This)->lpVtbl -> ClearStoredMessages(This) )
+
+#define ID3D12InfoQueue1_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \
+ ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) )
+
+#define ID3D12InfoQueue1_GetNumMessagesAllowedByStorageFilter(This) \
+ ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) )
+
+#define ID3D12InfoQueue1_GetNumMessagesDeniedByStorageFilter(This) \
+ ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) )
+
+#define ID3D12InfoQueue1_GetNumStoredMessages(This) \
+ ( (This)->lpVtbl -> GetNumStoredMessages(This) )
+
+#define ID3D12InfoQueue1_GetNumStoredMessagesAllowedByRetrievalFilter(This) \
+ ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) )
+
+#define ID3D12InfoQueue1_GetNumMessagesDiscardedByMessageCountLimit(This) \
+ ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) )
+
+#define ID3D12InfoQueue1_GetMessageCountLimit(This) \
+ ( (This)->lpVtbl -> GetMessageCountLimit(This) )
+
+#define ID3D12InfoQueue1_AddStorageFilterEntries(This,pFilter) \
+ ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) )
+
+#define ID3D12InfoQueue1_GetStorageFilter(This,pFilter,pFilterByteLength) \
+ ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) )
+
+#define ID3D12InfoQueue1_ClearStorageFilter(This) \
+ ( (This)->lpVtbl -> ClearStorageFilter(This) )
+
+#define ID3D12InfoQueue1_PushEmptyStorageFilter(This) \
+ ( (This)->lpVtbl -> PushEmptyStorageFilter(This) )
+
+#define ID3D12InfoQueue1_PushCopyOfStorageFilter(This) \
+ ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) )
+
+#define ID3D12InfoQueue1_PushStorageFilter(This,pFilter) \
+ ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) )
+
+#define ID3D12InfoQueue1_PopStorageFilter(This) \
+ ( (This)->lpVtbl -> PopStorageFilter(This) )
+
+#define ID3D12InfoQueue1_GetStorageFilterStackSize(This) \
+ ( (This)->lpVtbl -> GetStorageFilterStackSize(This) )
+
+#define ID3D12InfoQueue1_AddRetrievalFilterEntries(This,pFilter) \
+ ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) )
+
+#define ID3D12InfoQueue1_GetRetrievalFilter(This,pFilter,pFilterByteLength) \
+ ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) )
+
+#define ID3D12InfoQueue1_ClearRetrievalFilter(This) \
+ ( (This)->lpVtbl -> ClearRetrievalFilter(This) )
+
+#define ID3D12InfoQueue1_PushEmptyRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) )
+
+#define ID3D12InfoQueue1_PushCopyOfRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) )
+
+#define ID3D12InfoQueue1_PushRetrievalFilter(This,pFilter) \
+ ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) )
+
+#define ID3D12InfoQueue1_PopRetrievalFilter(This) \
+ ( (This)->lpVtbl -> PopRetrievalFilter(This) )
+
+#define ID3D12InfoQueue1_GetRetrievalFilterStackSize(This) \
+ ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) )
+
+#define ID3D12InfoQueue1_AddMessage(This,Category,Severity,ID,pDescription) \
+ ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) )
+
+#define ID3D12InfoQueue1_AddApplicationMessage(This,Severity,pDescription) \
+ ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) )
+
+#define ID3D12InfoQueue1_SetBreakOnCategory(This,Category,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) )
+
+#define ID3D12InfoQueue1_SetBreakOnSeverity(This,Severity,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) )
+
+#define ID3D12InfoQueue1_SetBreakOnID(This,ID,bEnable) \
+ ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) )
+
+#define ID3D12InfoQueue1_GetBreakOnCategory(This,Category) \
+ ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) )
+
+#define ID3D12InfoQueue1_GetBreakOnSeverity(This,Severity) \
+ ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) )
+
+#define ID3D12InfoQueue1_GetBreakOnID(This,ID) \
+ ( (This)->lpVtbl -> GetBreakOnID(This,ID) )
+
+#define ID3D12InfoQueue1_SetMuteDebugOutput(This,bMute) \
+ ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) )
+
+#define ID3D12InfoQueue1_GetMuteDebugOutput(This) \
+ ( (This)->lpVtbl -> GetMuteDebugOutput(This) )
+
+
+#define ID3D12InfoQueue1_RegisterMessageCallback(This,CallbackFunc,CallbackFilterFlags,pContext,pCallbackCookie) \
+ ( (This)->lpVtbl -> RegisterMessageCallback(This,CallbackFunc,CallbackFilterFlags,pContext,pCallbackCookie) )
+
+#define ID3D12InfoQueue1_UnregisterMessageCallback(This,CallbackCookie) \
+ ( (This)->lpVtbl -> UnregisterMessageCallback(This,CallbackCookie) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12InfoQueue1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12sdklayers_0000_0019 */
+/* [local] */
+
+#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */
+//#pragma endregion
+DEFINE_GUID(IID_ID3D12Debug,0x344488b7,0x6846,0x474b,0xb9,0x89,0xf0,0x27,0x44,0x82,0x45,0xe0);
+DEFINE_GUID(IID_ID3D12Debug1,0xaffaa4ca,0x63fe,0x4d8e,0xb8,0xad,0x15,0x90,0x00,0xaf,0x43,0x04);
+DEFINE_GUID(IID_ID3D12Debug2,0x93a665c4,0xa3b2,0x4e5d,0xb6,0x92,0xa2,0x6a,0xe1,0x4e,0x33,0x74);
+DEFINE_GUID(IID_ID3D12Debug3,0x5cf4e58f,0xf671,0x4ff1,0xa5,0x42,0x36,0x86,0xe3,0xd1,0x53,0xd1);
+DEFINE_GUID(IID_ID3D12Debug4,0x014b816e,0x9ec5,0x4a2f,0xa8,0x45,0xff,0xbe,0x44,0x1c,0xe1,0x3a);
+DEFINE_GUID(IID_ID3D12Debug5,0x548d6b12,0x09fa,0x40e0,0x90,0x69,0x5d,0xcd,0x58,0x9a,0x52,0xc9);
+DEFINE_GUID(IID_ID3D12Debug6,0x82a816d6,0x5d01,0x4157,0x97,0xd0,0x49,0x75,0x46,0x3f,0xd1,0xed);
+DEFINE_GUID(IID_ID3D12DebugDevice1,0xa9b71770,0xd099,0x4a65,0xa6,0x98,0x3d,0xee,0x10,0x02,0x0f,0x88);
+DEFINE_GUID(IID_ID3D12DebugDevice,0x3febd6dd,0x4973,0x4787,0x81,0x94,0xe4,0x5f,0x9e,0x28,0x92,0x3e);
+DEFINE_GUID(IID_ID3D12DebugDevice2,0x60eccbc1,0x378d,0x4df1,0x89,0x4c,0xf8,0xac,0x5c,0xe4,0xd7,0xdd);
+DEFINE_GUID(IID_ID3D12DebugCommandQueue,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3a);
+DEFINE_GUID(IID_ID3D12DebugCommandQueue1,0x16be35a2,0xbfd6,0x49f2,0xbc,0xae,0xea,0xae,0x4a,0xff,0x86,0x2d);
+DEFINE_GUID(IID_ID3D12DebugCommandList1,0x102ca951,0x311b,0x4b01,0xb1,0x1f,0xec,0xb8,0x3e,0x06,0x1b,0x37);
+DEFINE_GUID(IID_ID3D12DebugCommandList,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3f);
+DEFINE_GUID(IID_ID3D12DebugCommandList2,0xaeb575cf,0x4e06,0x48be,0xba,0x3b,0xc4,0x50,0xfc,0x96,0x65,0x2e);
+DEFINE_GUID(IID_ID3D12DebugCommandList3,0x197d5e15,0x4d37,0x4d34,0xaf,0x78,0x72,0x4c,0xd7,0x0f,0xdb,0x1f);
+DEFINE_GUID(IID_ID3D12SharingContract,0x0adf7d52,0x929c,0x4e61,0xad,0xdb,0xff,0xed,0x30,0xde,0x66,0xef);
+DEFINE_GUID(IID_ID3D12InfoQueue,0x0742a90b,0xc387,0x483f,0xb9,0x46,0x30,0xa7,0xe4,0xe6,0x14,0x58);
+DEFINE_GUID(IID_ID3D12InfoQueue1,0x2852dd88,0xb484,0x4c0c,0xb6,0xb1,0x67,0x16,0x85,0x00,0xe6,0x00);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0019_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12shader.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12shader.h
index fbeb7633d26..0acf584e324 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12shader.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12shader.h
@@ -1,6 +1,7 @@
//////////////////////////////////////////////////////////////////////////////
//
-// Copyright (c) Microsoft Corporation. All rights reserved.
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT license.
//
// File: D3D12Shader.h
// Content: D3D12 Shader Types and APIs
@@ -14,16 +15,29 @@
typedef enum D3D12_SHADER_VERSION_TYPE
{
- D3D12_SHVER_PIXEL_SHADER = 0,
- D3D12_SHVER_VERTEX_SHADER = 1,
- D3D12_SHVER_GEOMETRY_SHADER = 2,
+ D3D12_SHVER_PIXEL_SHADER = 0,
+ D3D12_SHVER_VERTEX_SHADER = 1,
+ D3D12_SHVER_GEOMETRY_SHADER = 2,
// D3D11 Shaders
- D3D12_SHVER_HULL_SHADER = 3,
- D3D12_SHVER_DOMAIN_SHADER = 4,
- D3D12_SHVER_COMPUTE_SHADER = 5,
+ D3D12_SHVER_HULL_SHADER = 3,
+ D3D12_SHVER_DOMAIN_SHADER = 4,
+ D3D12_SHVER_COMPUTE_SHADER = 5,
- D3D12_SHVER_RESERVED0 = 0xFFF0,
+ // D3D12 Shaders
+ D3D12_SHVER_LIBRARY = 6,
+
+ D3D12_SHVER_RAY_GENERATION_SHADER = 7,
+ D3D12_SHVER_INTERSECTION_SHADER = 8,
+ D3D12_SHVER_ANY_HIT_SHADER = 9,
+ D3D12_SHVER_CLOSEST_HIT_SHADER = 10,
+ D3D12_SHVER_MISS_SHADER = 11,
+ D3D12_SHVER_CALLABLE_SHADER = 12,
+
+ D3D12_SHVER_MESH_SHADER = 13,
+ D3D12_SHVER_AMPLIFICATION_SHADER = 14,
+
+ D3D12_SHVER_RESERVED0 = 0xFFF0,
} D3D12_SHADER_VERSION_TYPE;
#define D3D12_SHVER_GET_TYPE(_Version) \
@@ -172,6 +186,23 @@ typedef struct _D3D12_SHADER_INPUT_BIND_DESC
#define D3D_SHADER_REQUIRES_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00000800
#define D3D_SHADER_REQUIRES_ROVS 0x00001000
#define D3D_SHADER_REQUIRES_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x00002000
+#define D3D_SHADER_REQUIRES_WAVE_OPS 0x00004000
+#define D3D_SHADER_REQUIRES_INT64_OPS 0x00008000
+#define D3D_SHADER_REQUIRES_VIEW_ID 0x00010000
+#define D3D_SHADER_REQUIRES_BARYCENTRICS 0x00020000
+#define D3D_SHADER_REQUIRES_NATIVE_16BIT_OPS 0x00040000
+#define D3D_SHADER_REQUIRES_SHADING_RATE 0x00080000
+#define D3D_SHADER_REQUIRES_RAYTRACING_TIER_1_1 0x00100000
+#define D3D_SHADER_REQUIRES_SAMPLER_FEEDBACK 0x00200000
+#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_TYPED_RESOURCE 0x00400000
+#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_GROUP_SHARED 0x00800000
+#define D3D_SHADER_REQUIRES_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS 0x01000000
+#define D3D_SHADER_REQUIRES_RESOURCE_DESCRIPTOR_HEAP_INDEXING 0x02000000
+#define D3D_SHADER_REQUIRES_SAMPLER_DESCRIPTOR_HEAP_INDEXING 0x04000000
+#define D3D_SHADER_REQUIRES_WAVE_MMA 0x08000000
+#define D3D_SHADER_REQUIRES_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000
+#define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000
+#define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000
typedef struct _D3D12_LIBRARY_DESC
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12video.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12video.h
new file mode 100644
index 00000000000..add372e3819
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d12video.h
@@ -0,0 +1,8584 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ * Licensed under the MIT license
+ *
+ *-------------------------------------------------------------------------------------*/
+
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+
+ /* File created by MIDL compiler version 8.01.0628 */
+
+
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __d3d12video_h__
+#define __d3d12video_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+#ifndef DECLSPEC_XFGVIRT
+#if defined(_CONTROL_FLOW_GUARD_XFG)
+#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func))
+#else
+#define DECLSPEC_XFGVIRT(base, func)
+#endif
+#endif
+
+/* Forward Declarations */
+
+#ifndef __ID3D12VideoDecoderHeap_FWD_DEFINED__
+#define __ID3D12VideoDecoderHeap_FWD_DEFINED__
+typedef interface ID3D12VideoDecoderHeap ID3D12VideoDecoderHeap;
+
+#endif /* __ID3D12VideoDecoderHeap_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDevice_FWD_DEFINED__
+#define __ID3D12VideoDevice_FWD_DEFINED__
+typedef interface ID3D12VideoDevice ID3D12VideoDevice;
+
+#endif /* __ID3D12VideoDevice_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDecoder_FWD_DEFINED__
+#define __ID3D12VideoDecoder_FWD_DEFINED__
+typedef interface ID3D12VideoDecoder ID3D12VideoDecoder;
+
+#endif /* __ID3D12VideoDecoder_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoProcessor_FWD_DEFINED__
+#define __ID3D12VideoProcessor_FWD_DEFINED__
+typedef interface ID3D12VideoProcessor ID3D12VideoProcessor;
+
+#endif /* __ID3D12VideoProcessor_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDecodeCommandList_FWD_DEFINED__
+#define __ID3D12VideoDecodeCommandList_FWD_DEFINED__
+typedef interface ID3D12VideoDecodeCommandList ID3D12VideoDecodeCommandList;
+
+#endif /* __ID3D12VideoDecodeCommandList_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoProcessCommandList_FWD_DEFINED__
+#define __ID3D12VideoProcessCommandList_FWD_DEFINED__
+typedef interface ID3D12VideoProcessCommandList ID3D12VideoProcessCommandList;
+
+#endif /* __ID3D12VideoProcessCommandList_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDecodeCommandList1_FWD_DEFINED__
+#define __ID3D12VideoDecodeCommandList1_FWD_DEFINED__
+typedef interface ID3D12VideoDecodeCommandList1 ID3D12VideoDecodeCommandList1;
+
+#endif /* __ID3D12VideoDecodeCommandList1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoProcessCommandList1_FWD_DEFINED__
+#define __ID3D12VideoProcessCommandList1_FWD_DEFINED__
+typedef interface ID3D12VideoProcessCommandList1 ID3D12VideoProcessCommandList1;
+
+#endif /* __ID3D12VideoProcessCommandList1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoMotionEstimator_FWD_DEFINED__
+#define __ID3D12VideoMotionEstimator_FWD_DEFINED__
+typedef interface ID3D12VideoMotionEstimator ID3D12VideoMotionEstimator;
+
+#endif /* __ID3D12VideoMotionEstimator_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoMotionVectorHeap_FWD_DEFINED__
+#define __ID3D12VideoMotionVectorHeap_FWD_DEFINED__
+typedef interface ID3D12VideoMotionVectorHeap ID3D12VideoMotionVectorHeap;
+
+#endif /* __ID3D12VideoMotionVectorHeap_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDevice1_FWD_DEFINED__
+#define __ID3D12VideoDevice1_FWD_DEFINED__
+typedef interface ID3D12VideoDevice1 ID3D12VideoDevice1;
+
+#endif /* __ID3D12VideoDevice1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoEncodeCommandList_FWD_DEFINED__
+#define __ID3D12VideoEncodeCommandList_FWD_DEFINED__
+typedef interface ID3D12VideoEncodeCommandList ID3D12VideoEncodeCommandList;
+
+#endif /* __ID3D12VideoEncodeCommandList_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDecoder1_FWD_DEFINED__
+#define __ID3D12VideoDecoder1_FWD_DEFINED__
+typedef interface ID3D12VideoDecoder1 ID3D12VideoDecoder1;
+
+#endif /* __ID3D12VideoDecoder1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDecoderHeap1_FWD_DEFINED__
+#define __ID3D12VideoDecoderHeap1_FWD_DEFINED__
+typedef interface ID3D12VideoDecoderHeap1 ID3D12VideoDecoderHeap1;
+
+#endif /* __ID3D12VideoDecoderHeap1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoProcessor1_FWD_DEFINED__
+#define __ID3D12VideoProcessor1_FWD_DEFINED__
+typedef interface ID3D12VideoProcessor1 ID3D12VideoProcessor1;
+
+#endif /* __ID3D12VideoProcessor1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoExtensionCommand_FWD_DEFINED__
+#define __ID3D12VideoExtensionCommand_FWD_DEFINED__
+typedef interface ID3D12VideoExtensionCommand ID3D12VideoExtensionCommand;
+
+#endif /* __ID3D12VideoExtensionCommand_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDevice2_FWD_DEFINED__
+#define __ID3D12VideoDevice2_FWD_DEFINED__
+typedef interface ID3D12VideoDevice2 ID3D12VideoDevice2;
+
+#endif /* __ID3D12VideoDevice2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDecodeCommandList2_FWD_DEFINED__
+#define __ID3D12VideoDecodeCommandList2_FWD_DEFINED__
+typedef interface ID3D12VideoDecodeCommandList2 ID3D12VideoDecodeCommandList2;
+
+#endif /* __ID3D12VideoDecodeCommandList2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDecodeCommandList3_FWD_DEFINED__
+#define __ID3D12VideoDecodeCommandList3_FWD_DEFINED__
+typedef interface ID3D12VideoDecodeCommandList3 ID3D12VideoDecodeCommandList3;
+
+#endif /* __ID3D12VideoDecodeCommandList3_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoProcessCommandList2_FWD_DEFINED__
+#define __ID3D12VideoProcessCommandList2_FWD_DEFINED__
+typedef interface ID3D12VideoProcessCommandList2 ID3D12VideoProcessCommandList2;
+
+#endif /* __ID3D12VideoProcessCommandList2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoProcessCommandList3_FWD_DEFINED__
+#define __ID3D12VideoProcessCommandList3_FWD_DEFINED__
+typedef interface ID3D12VideoProcessCommandList3 ID3D12VideoProcessCommandList3;
+
+#endif /* __ID3D12VideoProcessCommandList3_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoEncodeCommandList1_FWD_DEFINED__
+#define __ID3D12VideoEncodeCommandList1_FWD_DEFINED__
+typedef interface ID3D12VideoEncodeCommandList1 ID3D12VideoEncodeCommandList1;
+
+#endif /* __ID3D12VideoEncodeCommandList1_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoEncoder_FWD_DEFINED__
+#define __ID3D12VideoEncoder_FWD_DEFINED__
+typedef interface ID3D12VideoEncoder ID3D12VideoEncoder;
+
+#endif /* __ID3D12VideoEncoder_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoEncoderHeap_FWD_DEFINED__
+#define __ID3D12VideoEncoderHeap_FWD_DEFINED__
+typedef interface ID3D12VideoEncoderHeap ID3D12VideoEncoderHeap;
+
+#endif /* __ID3D12VideoEncoderHeap_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDevice3_FWD_DEFINED__
+#define __ID3D12VideoDevice3_FWD_DEFINED__
+typedef interface ID3D12VideoDevice3 ID3D12VideoDevice3;
+
+#endif /* __ID3D12VideoDevice3_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoEncodeCommandList2_FWD_DEFINED__
+#define __ID3D12VideoEncodeCommandList2_FWD_DEFINED__
+typedef interface ID3D12VideoEncodeCommandList2 ID3D12VideoEncodeCommandList2;
+
+#endif /* __ID3D12VideoEncodeCommandList2_FWD_DEFINED__ */
+
+
+#ifndef __ID3D12VideoEncodeCommandList3_FWD_DEFINED__
+#define __ID3D12VideoEncodeCommandList3_FWD_DEFINED__
+typedef interface ID3D12VideoEncodeCommandList3 ID3D12VideoEncodeCommandList3;
+
+#endif /* __ID3D12VideoEncodeCommandList3_FWD_DEFINED__ */
+
+
+/* header files for imported files */
+#include "oaidl.h"
+#include "ocidl.h"
+#include "dxgicommon.h"
+#include "d3d12.h"
+
+#ifdef __cplusplus
+extern "C"{
+#endif
+
+
+/* interface __MIDL_itf_d3d12video_0000_0000 */
+/* [local] */
+
+#include <winapifamily.h>
+#pragma region App Family
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES)
+typedef
+enum D3D12_VIDEO_FIELD_TYPE
+ {
+ D3D12_VIDEO_FIELD_TYPE_NONE = 0,
+ D3D12_VIDEO_FIELD_TYPE_INTERLACED_TOP_FIELD_FIRST = 1,
+ D3D12_VIDEO_FIELD_TYPE_INTERLACED_BOTTOM_FIELD_FIRST = 2
+ } D3D12_VIDEO_FIELD_TYPE;
+
+typedef
+enum D3D12_VIDEO_FRAME_STEREO_FORMAT
+ {
+ D3D12_VIDEO_FRAME_STEREO_FORMAT_NONE = 0,
+ D3D12_VIDEO_FRAME_STEREO_FORMAT_MONO = 1,
+ D3D12_VIDEO_FRAME_STEREO_FORMAT_HORIZONTAL = 2,
+ D3D12_VIDEO_FRAME_STEREO_FORMAT_VERTICAL = 3,
+ D3D12_VIDEO_FRAME_STEREO_FORMAT_SEPARATE = 4
+ } D3D12_VIDEO_FRAME_STEREO_FORMAT;
+
+typedef struct D3D12_VIDEO_FORMAT
+ {
+ DXGI_FORMAT Format;
+ DXGI_COLOR_SPACE_TYPE ColorSpace;
+ } D3D12_VIDEO_FORMAT;
+
+typedef struct D3D12_VIDEO_SAMPLE
+ {
+ UINT Width;
+ UINT Height;
+ D3D12_VIDEO_FORMAT Format;
+ } D3D12_VIDEO_SAMPLE;
+
+typedef
+enum D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE
+ {
+ D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_NONE = 0,
+ D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_FIELD_BASED = 1
+ } D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE;
+
+typedef
+enum D3D12_FEATURE_VIDEO
+ {
+ D3D12_FEATURE_VIDEO_DECODE_SUPPORT = 0,
+ D3D12_FEATURE_VIDEO_DECODE_PROFILES = 1,
+ D3D12_FEATURE_VIDEO_DECODE_FORMATS = 2,
+ D3D12_FEATURE_VIDEO_DECODE_CONVERSION_SUPPORT = 3,
+ D3D12_FEATURE_VIDEO_PROCESS_SUPPORT = 5,
+ D3D12_FEATURE_VIDEO_PROCESS_MAX_INPUT_STREAMS = 6,
+ D3D12_FEATURE_VIDEO_PROCESS_REFERENCE_INFO = 7,
+ D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE = 8,
+ D3D12_FEATURE_VIDEO_PROCESSOR_SIZE = 9,
+ D3D12_FEATURE_VIDEO_DECODE_PROFILE_COUNT = 10,
+ D3D12_FEATURE_VIDEO_DECODE_FORMAT_COUNT = 11,
+ D3D12_FEATURE_VIDEO_ARCHITECTURE = 17,
+ D3D12_FEATURE_VIDEO_DECODE_HISTOGRAM = 18,
+ D3D12_FEATURE_VIDEO_FEATURE_AREA_SUPPORT = 19,
+ D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR = 20,
+ D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_SIZE = 21,
+ D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_COUNT = 22,
+ D3D12_FEATURE_VIDEO_EXTENSION_COMMANDS = 23,
+ D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT = 24,
+ D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_PARAMETERS = 25,
+ D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SUPPORT = 26,
+ D3D12_FEATURE_VIDEO_EXTENSION_COMMAND_SIZE = 27,
+ D3D12_FEATURE_VIDEO_DECODE_PROTECTED_RESOURCES = 28,
+ D3D12_FEATURE_VIDEO_PROCESS_PROTECTED_RESOURCES = 29,
+ D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES = 30,
+ D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE1 = 31,
+ D3D12_FEATURE_VIDEO_PROCESSOR_SIZE1 = 32,
+ D3D12_FEATURE_VIDEO_ENCODER_CODEC = 33,
+ D3D12_FEATURE_VIDEO_ENCODER_PROFILE_LEVEL = 34,
+ D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT = 35,
+ D3D12_FEATURE_VIDEO_ENCODER_OUTPUT_RESOLUTION = 36,
+ D3D12_FEATURE_VIDEO_ENCODER_INPUT_FORMAT = 37,
+ D3D12_FEATURE_VIDEO_ENCODER_RATE_CONTROL_MODE = 38,
+ D3D12_FEATURE_VIDEO_ENCODER_INTRA_REFRESH_MODE = 39,
+ D3D12_FEATURE_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE = 40,
+ D3D12_FEATURE_VIDEO_ENCODER_HEAP_SIZE = 41,
+ D3D12_FEATURE_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT = 42,
+ D3D12_FEATURE_VIDEO_ENCODER_SUPPORT = 43,
+ D3D12_FEATURE_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT = 44,
+ D3D12_FEATURE_VIDEO_ENCODER_RESOURCE_REQUIREMENTS = 45
+ } D3D12_FEATURE_VIDEO;
+
+typedef
+enum D3D12_BITSTREAM_ENCRYPTION_TYPE
+ {
+ D3D12_BITSTREAM_ENCRYPTION_TYPE_NONE = 0
+ } D3D12_BITSTREAM_ENCRYPTION_TYPE;
+
+typedef struct D3D12_VIDEO_DECODE_CONFIGURATION
+ {
+ GUID DecodeProfile;
+ D3D12_BITSTREAM_ENCRYPTION_TYPE BitstreamEncryption;
+ D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE InterlaceType;
+ } D3D12_VIDEO_DECODE_CONFIGURATION;
+
+typedef struct D3D12_VIDEO_DECODER_DESC
+ {
+ UINT NodeMask;
+ D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
+ } D3D12_VIDEO_DECODER_DESC;
+
+typedef struct D3D12_VIDEO_DECODER_HEAP_DESC
+ {
+ UINT NodeMask;
+ D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
+ UINT DecodeWidth;
+ UINT DecodeHeight;
+ DXGI_FORMAT Format;
+ DXGI_RATIONAL FrameRate;
+ UINT BitRate;
+ UINT MaxDecodePictureBufferCount;
+ } D3D12_VIDEO_DECODER_HEAP_DESC;
+
+typedef struct D3D12_VIDEO_SIZE_RANGE
+ {
+ UINT MaxWidth;
+ UINT MaxHeight;
+ UINT MinWidth;
+ UINT MinHeight;
+ } D3D12_VIDEO_SIZE_RANGE;
+
+typedef
+enum D3D12_VIDEO_PROCESS_FILTER
+ {
+ D3D12_VIDEO_PROCESS_FILTER_BRIGHTNESS = 0,
+ D3D12_VIDEO_PROCESS_FILTER_CONTRAST = 1,
+ D3D12_VIDEO_PROCESS_FILTER_HUE = 2,
+ D3D12_VIDEO_PROCESS_FILTER_SATURATION = 3,
+ D3D12_VIDEO_PROCESS_FILTER_NOISE_REDUCTION = 4,
+ D3D12_VIDEO_PROCESS_FILTER_EDGE_ENHANCEMENT = 5,
+ D3D12_VIDEO_PROCESS_FILTER_ANAMORPHIC_SCALING = 6,
+ D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT = 7
+ } D3D12_VIDEO_PROCESS_FILTER;
+
+typedef
+enum D3D12_VIDEO_PROCESS_FILTER_FLAGS
+ {
+ D3D12_VIDEO_PROCESS_FILTER_FLAG_NONE = 0,
+ D3D12_VIDEO_PROCESS_FILTER_FLAG_BRIGHTNESS = ( 1 << D3D12_VIDEO_PROCESS_FILTER_BRIGHTNESS ) ,
+ D3D12_VIDEO_PROCESS_FILTER_FLAG_CONTRAST = ( 1 << D3D12_VIDEO_PROCESS_FILTER_CONTRAST ) ,
+ D3D12_VIDEO_PROCESS_FILTER_FLAG_HUE = ( 1 << D3D12_VIDEO_PROCESS_FILTER_HUE ) ,
+ D3D12_VIDEO_PROCESS_FILTER_FLAG_SATURATION = ( 1 << D3D12_VIDEO_PROCESS_FILTER_SATURATION ) ,
+ D3D12_VIDEO_PROCESS_FILTER_FLAG_NOISE_REDUCTION = ( 1 << D3D12_VIDEO_PROCESS_FILTER_NOISE_REDUCTION ) ,
+ D3D12_VIDEO_PROCESS_FILTER_FLAG_EDGE_ENHANCEMENT = ( 1 << D3D12_VIDEO_PROCESS_FILTER_EDGE_ENHANCEMENT ) ,
+ D3D12_VIDEO_PROCESS_FILTER_FLAG_ANAMORPHIC_SCALING = ( 1 << D3D12_VIDEO_PROCESS_FILTER_ANAMORPHIC_SCALING ) ,
+ D3D12_VIDEO_PROCESS_FILTER_FLAG_STEREO_ADJUSTMENT = ( 1 << D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT )
+ } D3D12_VIDEO_PROCESS_FILTER_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FILTER_FLAGS );
+typedef
+enum D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS
+ {
+ D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_NONE = 0,
+ D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_BOB = 0x1,
+ D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_CUSTOM = 0x80000000
+ } D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS );
+typedef struct D3D12_VIDEO_PROCESS_ALPHA_BLENDING
+ {
+ BOOL Enable;
+ FLOAT Alpha;
+ } D3D12_VIDEO_PROCESS_ALPHA_BLENDING;
+
+typedef struct D3D12_VIDEO_PROCESS_LUMA_KEY
+ {
+ BOOL Enable;
+ FLOAT Lower;
+ FLOAT Upper;
+ } D3D12_VIDEO_PROCESS_LUMA_KEY;
+
+typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC
+ {
+ DXGI_FORMAT Format;
+ DXGI_COLOR_SPACE_TYPE ColorSpace;
+ DXGI_RATIONAL SourceAspectRatio;
+ DXGI_RATIONAL DestinationAspectRatio;
+ DXGI_RATIONAL FrameRate;
+ D3D12_VIDEO_SIZE_RANGE SourceSizeRange;
+ D3D12_VIDEO_SIZE_RANGE DestinationSizeRange;
+ BOOL EnableOrientation;
+ D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterFlags;
+ D3D12_VIDEO_FRAME_STEREO_FORMAT StereoFormat;
+ D3D12_VIDEO_FIELD_TYPE FieldType;
+ D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode;
+ BOOL EnableAlphaBlending;
+ D3D12_VIDEO_PROCESS_LUMA_KEY LumaKey;
+ UINT NumPastFrames;
+ UINT NumFutureFrames;
+ BOOL EnableAutoProcessing;
+ } D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC;
+
+typedef
+enum D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE
+ {
+ D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_OPAQUE = 0,
+ D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_BACKGROUND = 1,
+ D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_DESTINATION = 2,
+ D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_SOURCE_STREAM = 3
+ } D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE;
+
+typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC
+ {
+ DXGI_FORMAT Format;
+ DXGI_COLOR_SPACE_TYPE ColorSpace;
+ D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE AlphaFillMode;
+ UINT AlphaFillModeSourceStreamIndex;
+ FLOAT BackgroundColor[ 4 ];
+ DXGI_RATIONAL FrameRate;
+ BOOL EnableStereo;
+ } D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0000_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0000_v0_0_s_ifspec;
+
+#ifndef __ID3D12VideoDecoderHeap_INTERFACE_DEFINED__
+#define __ID3D12VideoDecoderHeap_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoDecoderHeap */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoDecoderHeap;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("0946B7C9-EBF6-4047-BB73-8683E27DBB1F")
+ ID3D12VideoDecoderHeap : public ID3D12Pageable
+ {
+ public:
+#if defined(_MSC_VER) || !defined(_WIN32)
+ virtual D3D12_VIDEO_DECODER_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+#else
+ virtual D3D12_VIDEO_DECODER_HEAP_DESC *STDMETHODCALLTYPE GetDesc(
+ D3D12_VIDEO_DECODER_HEAP_DESC * RetVal) = 0;
+#endif
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoDecoderHeapVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoDecoderHeap * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoDecoderHeap * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoDecoderHeap * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoDecoderHeap * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoDecoderHeap * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoDecoderHeap * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoDecoderHeap * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoDecoderHeap * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecoderHeap, GetDesc)
+#if !defined(_WIN32)
+ D3D12_VIDEO_DECODER_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoDecoderHeap * This);
+
+#else
+ D3D12_VIDEO_DECODER_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoDecoderHeap * This,
+ D3D12_VIDEO_DECODER_HEAP_DESC * RetVal);
+
+#endif
+
+ END_INTERFACE
+ } ID3D12VideoDecoderHeapVtbl;
+
+ interface ID3D12VideoDecoderHeap
+ {
+ CONST_VTBL struct ID3D12VideoDecoderHeapVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoDecoderHeap_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoDecoderHeap_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoDecoderHeap_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoDecoderHeap_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoDecoderHeap_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoDecoderHeap_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoDecoderHeap_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoDecoderHeap_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#if !defined(_WIN32)
+
+#define ID3D12VideoDecoderHeap_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12VideoDecoderHeap_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoDecoderHeap_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDevice_INTERFACE_DEFINED__
+#define __ID3D12VideoDevice_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoDevice */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoDevice;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("1F052807-0B46-4ACC-8A89-364F793718A4")
+ ID3D12VideoDevice : public IUnknown
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport(
+ D3D12_FEATURE_VIDEO FeatureVideo,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoder(
+ _In_ const D3D12_VIDEO_DECODER_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoder) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoderHeap(
+ _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoderHeap) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoProcessor(
+ UINT NodeMask,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc,
+ UINT NumInputStreamDescs,
+ _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoProcessor) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoDeviceVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoDevice * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoDevice * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoDevice * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CheckFeatureSupport)
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D12VideoDevice * This,
+ D3D12_FEATURE_VIDEO FeatureVideo,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoder)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )(
+ ID3D12VideoDevice * This,
+ _In_ const D3D12_VIDEO_DECODER_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoder);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoderHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )(
+ ID3D12VideoDevice * This,
+ _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoderHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoProcessor)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )(
+ ID3D12VideoDevice * This,
+ UINT NodeMask,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc,
+ UINT NumInputStreamDescs,
+ _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoProcessor);
+
+ END_INTERFACE
+ } ID3D12VideoDeviceVtbl;
+
+ interface ID3D12VideoDevice
+ {
+ CONST_VTBL struct ID3D12VideoDeviceVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoDevice_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoDevice_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoDevice_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoDevice_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D12VideoDevice_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \
+ ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) )
+
+#define ID3D12VideoDevice_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \
+ ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) )
+
+#define ID3D12VideoDevice_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \
+ ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoDevice_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDecoder_INTERFACE_DEFINED__
+#define __ID3D12VideoDecoder_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoDecoder */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoDecoder;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("C59B6BDC-7720-4074-A136-17A156037470")
+ ID3D12VideoDecoder : public ID3D12Pageable
+ {
+ public:
+#if defined(_MSC_VER) || !defined(_WIN32)
+ virtual D3D12_VIDEO_DECODER_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+#else
+ virtual D3D12_VIDEO_DECODER_DESC *STDMETHODCALLTYPE GetDesc(
+ D3D12_VIDEO_DECODER_DESC * RetVal) = 0;
+#endif
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoDecoderVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoDecoder * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoDecoder * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoDecoder * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoDecoder * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoDecoder * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoDecoder * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoDecoder * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoDecoder * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecoder, GetDesc)
+#if !defined(_WIN32)
+ D3D12_VIDEO_DECODER_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoDecoder * This);
+
+#else
+ D3D12_VIDEO_DECODER_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoDecoder * This,
+ D3D12_VIDEO_DECODER_DESC * RetVal);
+
+#endif
+
+ END_INTERFACE
+ } ID3D12VideoDecoderVtbl;
+
+ interface ID3D12VideoDecoder
+ {
+ CONST_VTBL struct ID3D12VideoDecoderVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoDecoder_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoDecoder_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoDecoder_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoDecoder_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoDecoder_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoDecoder_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoDecoder_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoDecoder_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#if !defined(_WIN32)
+
+#define ID3D12VideoDecoder_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12VideoDecoder_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoDecoder_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12video_0000_0003 */
+/* [local] */
+
+typedef
+enum D3D12_VIDEO_DECODE_TIER
+ {
+ D3D12_VIDEO_DECODE_TIER_NOT_SUPPORTED = 0,
+ D3D12_VIDEO_DECODE_TIER_1 = 1,
+ D3D12_VIDEO_DECODE_TIER_2 = 2,
+ D3D12_VIDEO_DECODE_TIER_3 = 3
+ } D3D12_VIDEO_DECODE_TIER;
+
+typedef
+enum D3D12_VIDEO_DECODE_SUPPORT_FLAGS
+ {
+ D3D12_VIDEO_DECODE_SUPPORT_FLAG_NONE = 0,
+ D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED = 0x1
+ } D3D12_VIDEO_DECODE_SUPPORT_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_SUPPORT_FLAGS );
+typedef
+enum D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS
+ {
+ D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_NONE = 0,
+ D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_HEIGHT_ALIGNMENT_MULTIPLE_32_REQUIRED = 0x1,
+ D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_POST_PROCESSING_SUPPORTED = 0x2,
+ D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_REFERENCE_ONLY_ALLOCATIONS_REQUIRED = 0x4,
+ D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_ALLOW_RESOLUTION_CHANGE_ON_NON_KEY_FRAME = 0x8
+ } D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS );
+typedef
+enum D3D12_VIDEO_DECODE_STATUS
+ {
+ D3D12_VIDEO_DECODE_STATUS_OK = 0,
+ D3D12_VIDEO_DECODE_STATUS_CONTINUE = 1,
+ D3D12_VIDEO_DECODE_STATUS_CONTINUE_SKIP_DISPLAY = 2,
+ D3D12_VIDEO_DECODE_STATUS_RESTART = 3,
+ D3D12_VIDEO_DECODE_STATUS_RATE_EXCEEDED = 4
+ } D3D12_VIDEO_DECODE_STATUS;
+
+typedef
+enum D3D12_VIDEO_DECODE_ARGUMENT_TYPE
+ {
+ D3D12_VIDEO_DECODE_ARGUMENT_TYPE_PICTURE_PARAMETERS = 0,
+ D3D12_VIDEO_DECODE_ARGUMENT_TYPE_INVERSE_QUANTIZATION_MATRIX = 1,
+ D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL = 2,
+ D3D12_VIDEO_DECODE_ARGUMENT_TYPE_MAX_VALID = 3
+ } D3D12_VIDEO_DECODE_ARGUMENT_TYPE;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
+ UINT Width;
+ UINT Height;
+ DXGI_FORMAT DecodeFormat;
+ DXGI_RATIONAL FrameRate;
+ UINT BitRate;
+ D3D12_VIDEO_DECODE_SUPPORT_FLAGS SupportFlags;
+ D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS ConfigurationFlags;
+ D3D12_VIDEO_DECODE_TIER DecodeTier;
+ } D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT
+ {
+ UINT NodeIndex;
+ UINT ProfileCount;
+ } D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES
+ {
+ UINT NodeIndex;
+ UINT ProfileCount;
+ _Field_size_full_(ProfileCount) GUID *pProfiles;
+ } D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
+ UINT FormatCount;
+ } D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
+ UINT FormatCount;
+ _Field_size_full_(FormatCount) DXGI_FORMAT *pOutputFormats;
+ } D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ARCHITECTURE
+ {
+ BOOL IOCoherent;
+ } D3D12_FEATURE_DATA_VIDEO_ARCHITECTURE;
+
+typedef
+enum D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT
+ {
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_Y = 0,
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_U = 1,
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_V = 2,
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_R = 0,
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_G = 1,
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_B = 2,
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_A = 3
+ } D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT;
+
+typedef
+enum D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS
+ {
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_NONE = 0,
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_Y = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_Y ) ,
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_U = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_U ) ,
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_V = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_V ) ,
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_R = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_R ) ,
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_G = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_G ) ,
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_B = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_B ) ,
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_A = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_A )
+ } D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS );
+typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM
+ {
+ UINT NodeIndex;
+ GUID DecodeProfile;
+ UINT Width;
+ UINT Height;
+ DXGI_FORMAT DecodeFormat;
+ D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS Components;
+ UINT BinCount;
+ UINT CounterBitDepth;
+ } D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM;
+
+typedef
+enum D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS
+ {
+ D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAG_NONE = 0,
+ D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAG_SUPPORTED = 0x1
+ } D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS );
+typedef
+enum D3D12_VIDEO_SCALE_SUPPORT_FLAGS
+ {
+ D3D12_VIDEO_SCALE_SUPPORT_FLAG_NONE = 0,
+ D3D12_VIDEO_SCALE_SUPPORT_FLAG_POW2_ONLY = 0x1,
+ D3D12_VIDEO_SCALE_SUPPORT_FLAG_EVEN_DIMENSIONS_ONLY = 0x2
+ } D3D12_VIDEO_SCALE_SUPPORT_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_SCALE_SUPPORT_FLAGS );
+typedef struct D3D12_VIDEO_SCALE_SUPPORT
+ {
+ D3D12_VIDEO_SIZE_RANGE OutputSizeRange;
+ D3D12_VIDEO_SCALE_SUPPORT_FLAGS Flags;
+ } D3D12_VIDEO_SCALE_SUPPORT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
+ D3D12_VIDEO_SAMPLE DecodeSample;
+ D3D12_VIDEO_FORMAT OutputFormat;
+ DXGI_RATIONAL FrameRate;
+ UINT BitRate;
+ D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS SupportFlags;
+ D3D12_VIDEO_SCALE_SUPPORT ScaleSupport;
+ } D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE
+ {
+ D3D12_VIDEO_DECODER_HEAP_DESC VideoDecoderHeapDesc;
+ UINT64 MemoryPoolL0Size;
+ UINT64 MemoryPoolL1Size;
+ } D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE
+ {
+ UINT NodeMask;
+ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc;
+ UINT NumInputStreamDescs;
+ const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs;
+ UINT64 MemoryPoolL0Size;
+ UINT64 MemoryPoolL1Size;
+ } D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE;
+
+typedef struct D3D12_QUERY_DATA_VIDEO_DECODE_STATISTICS
+ {
+ UINT64 Status;
+ UINT64 NumMacroblocksAffected;
+ DXGI_RATIONAL FrameRate;
+ UINT BitRate;
+ } D3D12_QUERY_DATA_VIDEO_DECODE_STATISTICS;
+
+typedef struct D3D12_VIDEO_DECODE_FRAME_ARGUMENT
+ {
+ D3D12_VIDEO_DECODE_ARGUMENT_TYPE Type;
+ UINT Size;
+ _Field_size_bytes_full_(Size) void *pData;
+ } D3D12_VIDEO_DECODE_FRAME_ARGUMENT;
+
+typedef struct D3D12_VIDEO_DECODE_REFERENCE_FRAMES
+ {
+ UINT NumTexture2Ds;
+ _Field_size_full_(NumTexture2Ds) ID3D12Resource **ppTexture2Ds;
+ _Field_size_full_(NumTexture2Ds) UINT *pSubresources;
+ _Field_size_full_opt_(NumTexture2Ds) ID3D12VideoDecoderHeap **ppHeaps;
+ } D3D12_VIDEO_DECODE_REFERENCE_FRAMES;
+
+typedef struct D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM
+ {
+ ID3D12Resource *pBuffer;
+ UINT64 Offset;
+ UINT64 Size;
+ } D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM;
+
+typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS
+ {
+ BOOL Enable;
+ ID3D12Resource *pReferenceTexture2D;
+ UINT ReferenceSubresource;
+ DXGI_COLOR_SPACE_TYPE OutputColorSpace;
+ DXGI_COLOR_SPACE_TYPE DecodeColorSpace;
+ } D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS;
+
+typedef struct D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS
+ {
+ UINT NumFrameArguments;
+ D3D12_VIDEO_DECODE_FRAME_ARGUMENT FrameArguments[ 10 ];
+ D3D12_VIDEO_DECODE_REFERENCE_FRAMES ReferenceFrames;
+ D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM CompressedBitstream;
+ ID3D12VideoDecoderHeap *pHeap;
+ } D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS;
+
+typedef struct D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS
+ {
+ ID3D12Resource *pOutputTexture2D;
+ UINT OutputSubresource;
+ D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS ConversionArguments;
+ } D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0003_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0003_v0_0_s_ifspec;
+
+#ifndef __ID3D12VideoProcessor_INTERFACE_DEFINED__
+#define __ID3D12VideoProcessor_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoProcessor */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoProcessor;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("304FDB32-BEDE-410A-8545-943AC6A46138")
+ ID3D12VideoProcessor : public ID3D12Pageable
+ {
+ public:
+ virtual UINT STDMETHODCALLTYPE GetNodeMask( void) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetNumInputStreamDescs( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetInputStreamDescs(
+ UINT NumInputStreamDescs,
+ _Out_writes_(NumInputStreamDescs) D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs) = 0;
+
+#if defined(_MSC_VER) || !defined(_WIN32)
+ virtual D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC STDMETHODCALLTYPE GetOutputStreamDesc( void) = 0;
+#else
+ virtual D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *STDMETHODCALLTYPE GetOutputStreamDesc(
+ D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC * RetVal) = 0;
+#endif
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoProcessorVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoProcessor * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoProcessor * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoProcessor * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoProcessor * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoProcessor * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoProcessor * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoProcessor * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoProcessor * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetNodeMask)
+ UINT ( STDMETHODCALLTYPE *GetNodeMask )(
+ ID3D12VideoProcessor * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetNumInputStreamDescs)
+ UINT ( STDMETHODCALLTYPE *GetNumInputStreamDescs )(
+ ID3D12VideoProcessor * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetInputStreamDescs)
+ HRESULT ( STDMETHODCALLTYPE *GetInputStreamDescs )(
+ ID3D12VideoProcessor * This,
+ UINT NumInputStreamDescs,
+ _Out_writes_(NumInputStreamDescs) D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetOutputStreamDesc)
+#if !defined(_WIN32)
+ D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC ( STDMETHODCALLTYPE *GetOutputStreamDesc )(
+ ID3D12VideoProcessor * This);
+
+#else
+ D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *( STDMETHODCALLTYPE *GetOutputStreamDesc )(
+ ID3D12VideoProcessor * This,
+ D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC * RetVal);
+
+#endif
+
+ END_INTERFACE
+ } ID3D12VideoProcessorVtbl;
+
+ interface ID3D12VideoProcessor
+ {
+ CONST_VTBL struct ID3D12VideoProcessorVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoProcessor_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoProcessor_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoProcessor_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoProcessor_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoProcessor_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoProcessor_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoProcessor_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoProcessor_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#define ID3D12VideoProcessor_GetNodeMask(This) \
+ ( (This)->lpVtbl -> GetNodeMask(This) )
+
+#define ID3D12VideoProcessor_GetNumInputStreamDescs(This) \
+ ( (This)->lpVtbl -> GetNumInputStreamDescs(This) )
+
+#define ID3D12VideoProcessor_GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) \
+ ( (This)->lpVtbl -> GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) )
+#if !defined(_WIN32)
+
+#define ID3D12VideoProcessor_GetOutputStreamDesc(This) \
+ ( (This)->lpVtbl -> GetOutputStreamDesc(This) )
+#else
+#define ID3D12VideoProcessor_GetOutputStreamDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetOutputStreamDesc(This,RetVal) )
+#endif
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoProcessor_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12video_0000_0004 */
+/* [local] */
+
+typedef
+enum D3D12_VIDEO_PROCESS_FEATURE_FLAGS
+ {
+ D3D12_VIDEO_PROCESS_FEATURE_FLAG_NONE = 0,
+ D3D12_VIDEO_PROCESS_FEATURE_FLAG_ALPHA_FILL = 0x1,
+ D3D12_VIDEO_PROCESS_FEATURE_FLAG_LUMA_KEY = 0x2,
+ D3D12_VIDEO_PROCESS_FEATURE_FLAG_STEREO = 0x4,
+ D3D12_VIDEO_PROCESS_FEATURE_FLAG_ROTATION = 0x8,
+ D3D12_VIDEO_PROCESS_FEATURE_FLAG_FLIP = 0x10,
+ D3D12_VIDEO_PROCESS_FEATURE_FLAG_ALPHA_BLENDING = 0x20,
+ D3D12_VIDEO_PROCESS_FEATURE_FLAG_PIXEL_ASPECT_RATIO = 0x40
+ } D3D12_VIDEO_PROCESS_FEATURE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FEATURE_FLAGS );
+typedef
+enum D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS
+ {
+ D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_NONE = 0,
+ D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_DENOISE = 0x1,
+ D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_DERINGING = 0x2,
+ D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_EDGE_ENHANCEMENT = 0x4,
+ D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_COLOR_CORRECTION = 0x8,
+ D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_FLESH_TONE_MAPPING = 0x10,
+ D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_IMAGE_STABILIZATION = 0x20,
+ D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_SUPER_RESOLUTION = 0x40,
+ D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_ANAMORPHIC_SCALING = 0x80,
+ D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_CUSTOM = 0x80000000
+ } D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS );
+typedef
+enum D3D12_VIDEO_PROCESS_ORIENTATION
+ {
+ D3D12_VIDEO_PROCESS_ORIENTATION_DEFAULT = 0,
+ D3D12_VIDEO_PROCESS_ORIENTATION_FLIP_HORIZONTAL = 1,
+ D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_90 = 2,
+ D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_90_FLIP_HORIZONTAL = 3,
+ D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_180 = 4,
+ D3D12_VIDEO_PROCESS_ORIENTATION_FLIP_VERTICAL = 5,
+ D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_270 = 6,
+ D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_270_FLIP_HORIZONTAL = 7
+ } D3D12_VIDEO_PROCESS_ORIENTATION;
+
+typedef
+enum D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS
+ {
+ D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_NONE = 0,
+ D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_FRAME_DISCONTINUITY = 0x1,
+ D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_FRAME_REPEAT = 0x2
+ } D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS );
+typedef struct D3D12_VIDEO_PROCESS_FILTER_RANGE
+ {
+ INT Minimum;
+ INT Maximum;
+ INT Default;
+ FLOAT Multiplier;
+ } D3D12_VIDEO_PROCESS_FILTER_RANGE;
+
+typedef
+enum D3D12_VIDEO_PROCESS_SUPPORT_FLAGS
+ {
+ D3D12_VIDEO_PROCESS_SUPPORT_FLAG_NONE = 0,
+ D3D12_VIDEO_PROCESS_SUPPORT_FLAG_SUPPORTED = 0x1
+ } D3D12_VIDEO_PROCESS_SUPPORT_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_SUPPORT_FLAGS );
+typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_SAMPLE InputSample;
+ D3D12_VIDEO_FIELD_TYPE InputFieldType;
+ D3D12_VIDEO_FRAME_STEREO_FORMAT InputStereoFormat;
+ DXGI_RATIONAL InputFrameRate;
+ D3D12_VIDEO_FORMAT OutputFormat;
+ D3D12_VIDEO_FRAME_STEREO_FORMAT OutputStereoFormat;
+ DXGI_RATIONAL OutputFrameRate;
+ D3D12_VIDEO_PROCESS_SUPPORT_FLAGS SupportFlags;
+ D3D12_VIDEO_SCALE_SUPPORT ScaleSupport;
+ D3D12_VIDEO_PROCESS_FEATURE_FLAGS FeatureSupport;
+ D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceSupport;
+ D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS AutoProcessingSupport;
+ D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterSupport;
+ D3D12_VIDEO_PROCESS_FILTER_RANGE FilterRangeSupport[ 32 ];
+ } D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_MAX_INPUT_STREAMS
+ {
+ UINT NodeIndex;
+ UINT MaxInputStreams;
+ } D3D12_FEATURE_DATA_VIDEO_PROCESS_MAX_INPUT_STREAMS;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_REFERENCE_INFO
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode;
+ D3D12_VIDEO_PROCESS_FILTER_FLAGS Filters;
+ D3D12_VIDEO_PROCESS_FEATURE_FLAGS FeatureSupport;
+ DXGI_RATIONAL InputFrameRate;
+ DXGI_RATIONAL OutputFrameRate;
+ BOOL EnableAutoProcessing;
+ UINT PastFrames;
+ UINT FutureFrames;
+ } D3D12_FEATURE_DATA_VIDEO_PROCESS_REFERENCE_INFO;
+
+typedef struct D3D12_VIDEO_PROCESS_REFERENCE_SET
+ {
+ UINT NumPastFrames;
+ ID3D12Resource **ppPastFrames;
+ UINT *pPastSubresources;
+ UINT NumFutureFrames;
+ ID3D12Resource **ppFutureFrames;
+ UINT *pFutureSubresources;
+ } D3D12_VIDEO_PROCESS_REFERENCE_SET;
+
+typedef struct D3D12_VIDEO_PROCESS_TRANSFORM
+ {
+ D3D12_RECT SourceRectangle;
+ D3D12_RECT DestinationRectangle;
+ D3D12_VIDEO_PROCESS_ORIENTATION Orientation;
+ } D3D12_VIDEO_PROCESS_TRANSFORM;
+
+typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE
+ {
+ UINT OutputIndex;
+ UINT InputFrameOrField;
+ } D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE;
+
+typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM
+ {
+ ID3D12Resource *pTexture2D;
+ UINT Subresource;
+ D3D12_VIDEO_PROCESS_REFERENCE_SET ReferenceSet;
+ } D3D12_VIDEO_PROCESS_INPUT_STREAM;
+
+typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS
+ {
+ D3D12_VIDEO_PROCESS_INPUT_STREAM InputStream[ 2 ];
+ D3D12_VIDEO_PROCESS_TRANSFORM Transform;
+ D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS Flags;
+ D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE RateInfo;
+ INT FilterLevels[ 32 ];
+ D3D12_VIDEO_PROCESS_ALPHA_BLENDING AlphaBlending;
+ } D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS;
+
+typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM
+ {
+ ID3D12Resource *pTexture2D;
+ UINT Subresource;
+ } D3D12_VIDEO_PROCESS_OUTPUT_STREAM;
+
+typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS
+ {
+ D3D12_VIDEO_PROCESS_OUTPUT_STREAM OutputStream[ 2 ];
+ D3D12_RECT TargetRectangle;
+ } D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0004_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0004_v0_0_s_ifspec;
+
+#ifndef __ID3D12VideoDecodeCommandList_INTERFACE_DEFINED__
+#define __ID3D12VideoDecodeCommandList_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoDecodeCommandList */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoDecodeCommandList;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("3B60536E-AD29-4E64-A269-F853837E5E53")
+ ID3D12VideoDecodeCommandList : public ID3D12CommandList
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE Close( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Reset(
+ _In_ ID3D12CommandAllocator *pAllocator) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearState( void) = 0;
+
+ virtual void STDMETHODCALLTYPE ResourceBarrier(
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0;
+
+ virtual void STDMETHODCALLTYPE DiscardResource(
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0;
+
+ virtual void STDMETHODCALLTYPE BeginQuery(
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index) = 0;
+
+ virtual void STDMETHODCALLTYPE EndQuery(
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index) = 0;
+
+ virtual void STDMETHODCALLTYPE ResolveQueryData(
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset) = 0;
+
+ virtual void STDMETHODCALLTYPE SetPredication(
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation) = 0;
+
+ virtual void STDMETHODCALLTYPE SetMarker(
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size) = 0;
+
+ virtual void STDMETHODCALLTYPE BeginEvent(
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size) = 0;
+
+ virtual void STDMETHODCALLTYPE EndEvent( void) = 0;
+
+ virtual void STDMETHODCALLTYPE DecodeFrame(
+ _In_ ID3D12VideoDecoder *pDecoder,
+ _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments) = 0;
+
+ virtual void STDMETHODCALLTYPE WriteBufferImmediate(
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoDecodeCommandListVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoDecodeCommandList * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoDecodeCommandList * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoDecodeCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoDecodeCommandList * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoDecodeCommandList * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoDecodeCommandList * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoDecodeCommandList * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoDecodeCommandList * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12VideoDecodeCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12VideoDecodeCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12VideoDecodeCommandList * This,
+ _In_ ID3D12CommandAllocator *pAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12VideoDecodeCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12VideoDecodeCommandList * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12VideoDecodeCommandList * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12VideoDecodeCommandList * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12VideoDecodeCommandList * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12VideoDecodeCommandList * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12VideoDecodeCommandList * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12VideoDecodeCommandList * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12VideoDecodeCommandList * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12VideoDecodeCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DecodeFrame)
+ void ( STDMETHODCALLTYPE *DecodeFrame )(
+ ID3D12VideoDecodeCommandList * This,
+ _In_ ID3D12VideoDecoder *pDecoder,
+ _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12VideoDecodeCommandList * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ END_INTERFACE
+ } ID3D12VideoDecodeCommandListVtbl;
+
+ interface ID3D12VideoDecodeCommandList
+ {
+ CONST_VTBL struct ID3D12VideoDecodeCommandListVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoDecodeCommandList_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoDecodeCommandList_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoDecodeCommandList_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoDecodeCommandList_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoDecodeCommandList_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoDecodeCommandList_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoDecodeCommandList_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoDecodeCommandList_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12VideoDecodeCommandList_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12VideoDecodeCommandList_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12VideoDecodeCommandList_Reset(This,pAllocator) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator) )
+
+#define ID3D12VideoDecodeCommandList_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D12VideoDecodeCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12VideoDecodeCommandList_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12VideoDecodeCommandList_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoDecodeCommandList_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoDecodeCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12VideoDecodeCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12VideoDecodeCommandList_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12VideoDecodeCommandList_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12VideoDecodeCommandList_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12VideoDecodeCommandList_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) )
+
+#define ID3D12VideoDecodeCommandList_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoDecodeCommandList_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoProcessCommandList_INTERFACE_DEFINED__
+#define __ID3D12VideoProcessCommandList_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoProcessCommandList */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoProcessCommandList;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("AEB2543A-167F-4682-ACC8-D159ED4A6209")
+ ID3D12VideoProcessCommandList : public ID3D12CommandList
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE Close( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Reset(
+ _In_ ID3D12CommandAllocator *pAllocator) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearState( void) = 0;
+
+ virtual void STDMETHODCALLTYPE ResourceBarrier(
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0;
+
+ virtual void STDMETHODCALLTYPE DiscardResource(
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0;
+
+ virtual void STDMETHODCALLTYPE BeginQuery(
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index) = 0;
+
+ virtual void STDMETHODCALLTYPE EndQuery(
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index) = 0;
+
+ virtual void STDMETHODCALLTYPE ResolveQueryData(
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset) = 0;
+
+ virtual void STDMETHODCALLTYPE SetPredication(
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation) = 0;
+
+ virtual void STDMETHODCALLTYPE SetMarker(
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size) = 0;
+
+ virtual void STDMETHODCALLTYPE BeginEvent(
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size) = 0;
+
+ virtual void STDMETHODCALLTYPE EndEvent( void) = 0;
+
+ virtual void STDMETHODCALLTYPE ProcessFrames(
+ _In_ ID3D12VideoProcessor *pVideoProcessor,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ UINT NumInputStreams,
+ _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments) = 0;
+
+ virtual void STDMETHODCALLTYPE WriteBufferImmediate(
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoProcessCommandListVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoProcessCommandList * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoProcessCommandList * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoProcessCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoProcessCommandList * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoProcessCommandList * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoProcessCommandList * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoProcessCommandList * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoProcessCommandList * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12VideoProcessCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12VideoProcessCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12VideoProcessCommandList * This,
+ _In_ ID3D12CommandAllocator *pAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12VideoProcessCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12VideoProcessCommandList * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12VideoProcessCommandList * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12VideoProcessCommandList * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12VideoProcessCommandList * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12VideoProcessCommandList * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12VideoProcessCommandList * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12VideoProcessCommandList * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12VideoProcessCommandList * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12VideoProcessCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ProcessFrames)
+ void ( STDMETHODCALLTYPE *ProcessFrames )(
+ ID3D12VideoProcessCommandList * This,
+ _In_ ID3D12VideoProcessor *pVideoProcessor,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ UINT NumInputStreams,
+ _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12VideoProcessCommandList * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ END_INTERFACE
+ } ID3D12VideoProcessCommandListVtbl;
+
+ interface ID3D12VideoProcessCommandList
+ {
+ CONST_VTBL struct ID3D12VideoProcessCommandListVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoProcessCommandList_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoProcessCommandList_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoProcessCommandList_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoProcessCommandList_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoProcessCommandList_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoProcessCommandList_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoProcessCommandList_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoProcessCommandList_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12VideoProcessCommandList_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12VideoProcessCommandList_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12VideoProcessCommandList_Reset(This,pAllocator) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator) )
+
+#define ID3D12VideoProcessCommandList_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D12VideoProcessCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12VideoProcessCommandList_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12VideoProcessCommandList_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoProcessCommandList_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoProcessCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12VideoProcessCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12VideoProcessCommandList_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12VideoProcessCommandList_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12VideoProcessCommandList_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12VideoProcessCommandList_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \
+ ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) )
+
+#define ID3D12VideoProcessCommandList_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoProcessCommandList_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12video_0000_0006 */
+/* [local] */
+
+typedef struct D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM
+ {
+ UINT64 Offset;
+ ID3D12Resource *pBuffer;
+ } D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM;
+
+typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1
+ {
+ BOOL Enable;
+ ID3D12Resource *pReferenceTexture2D;
+ UINT ReferenceSubresource;
+ DXGI_COLOR_SPACE_TYPE OutputColorSpace;
+ DXGI_COLOR_SPACE_TYPE DecodeColorSpace;
+ UINT OutputWidth;
+ UINT OutputHeight;
+ } D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1;
+
+typedef struct D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1
+ {
+ ID3D12Resource *pOutputTexture2D;
+ UINT OutputSubresource;
+ D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 ConversionArguments;
+ D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM Histograms[ 4 ];
+ } D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0006_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0006_v0_0_s_ifspec;
+
+#ifndef __ID3D12VideoDecodeCommandList1_INTERFACE_DEFINED__
+#define __ID3D12VideoDecodeCommandList1_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoDecodeCommandList1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoDecodeCommandList1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("D52F011B-B56E-453C-A05A-A7F311C8F472")
+ ID3D12VideoDecodeCommandList1 : public ID3D12VideoDecodeCommandList
+ {
+ public:
+ virtual void STDMETHODCALLTYPE DecodeFrame1(
+ _In_ ID3D12VideoDecoder *pDecoder,
+ _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments,
+ _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoDecodeCommandList1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoDecodeCommandList1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoDecodeCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoDecodeCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoDecodeCommandList1 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoDecodeCommandList1 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoDecodeCommandList1 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoDecodeCommandList1 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoDecodeCommandList1 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12VideoDecodeCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12VideoDecodeCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12VideoDecodeCommandList1 * This,
+ _In_ ID3D12CommandAllocator *pAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12VideoDecodeCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12VideoDecodeCommandList1 * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12VideoDecodeCommandList1 * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12VideoDecodeCommandList1 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12VideoDecodeCommandList1 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12VideoDecodeCommandList1 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12VideoDecodeCommandList1 * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12VideoDecodeCommandList1 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12VideoDecodeCommandList1 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12VideoDecodeCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DecodeFrame)
+ void ( STDMETHODCALLTYPE *DecodeFrame )(
+ ID3D12VideoDecodeCommandList1 * This,
+ _In_ ID3D12VideoDecoder *pDecoder,
+ _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12VideoDecodeCommandList1 * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList1, DecodeFrame1)
+ void ( STDMETHODCALLTYPE *DecodeFrame1 )(
+ ID3D12VideoDecodeCommandList1 * This,
+ _In_ ID3D12VideoDecoder *pDecoder,
+ _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments,
+ _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments);
+
+ END_INTERFACE
+ } ID3D12VideoDecodeCommandList1Vtbl;
+
+ interface ID3D12VideoDecodeCommandList1
+ {
+ CONST_VTBL struct ID3D12VideoDecodeCommandList1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoDecodeCommandList1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoDecodeCommandList1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoDecodeCommandList1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoDecodeCommandList1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoDecodeCommandList1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoDecodeCommandList1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoDecodeCommandList1_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoDecodeCommandList1_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12VideoDecodeCommandList1_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12VideoDecodeCommandList1_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12VideoDecodeCommandList1_Reset(This,pAllocator) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator) )
+
+#define ID3D12VideoDecodeCommandList1_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D12VideoDecodeCommandList1_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12VideoDecodeCommandList1_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12VideoDecodeCommandList1_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoDecodeCommandList1_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoDecodeCommandList1_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12VideoDecodeCommandList1_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12VideoDecodeCommandList1_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12VideoDecodeCommandList1_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12VideoDecodeCommandList1_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12VideoDecodeCommandList1_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) )
+
+#define ID3D12VideoDecodeCommandList1_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+
+#define ID3D12VideoDecodeCommandList1_DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoDecodeCommandList1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12video_0000_0007 */
+/* [local] */
+
+typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1
+ {
+ D3D12_VIDEO_PROCESS_INPUT_STREAM InputStream[ 2 ];
+ D3D12_VIDEO_PROCESS_TRANSFORM Transform;
+ D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS Flags;
+ D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE RateInfo;
+ INT FilterLevels[ 32 ];
+ D3D12_VIDEO_PROCESS_ALPHA_BLENDING AlphaBlending;
+ D3D12_VIDEO_FIELD_TYPE FieldType;
+ } D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0007_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0007_v0_0_s_ifspec;
+
+#ifndef __ID3D12VideoProcessCommandList1_INTERFACE_DEFINED__
+#define __ID3D12VideoProcessCommandList1_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoProcessCommandList1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoProcessCommandList1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("542C5C4D-7596-434F-8C93-4EFA6766F267")
+ ID3D12VideoProcessCommandList1 : public ID3D12VideoProcessCommandList
+ {
+ public:
+ virtual void STDMETHODCALLTYPE ProcessFrames1(
+ _In_ ID3D12VideoProcessor *pVideoProcessor,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ UINT NumInputStreams,
+ _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoProcessCommandList1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoProcessCommandList1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoProcessCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoProcessCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoProcessCommandList1 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoProcessCommandList1 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoProcessCommandList1 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoProcessCommandList1 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoProcessCommandList1 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12VideoProcessCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12VideoProcessCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12VideoProcessCommandList1 * This,
+ _In_ ID3D12CommandAllocator *pAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12VideoProcessCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12VideoProcessCommandList1 * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12VideoProcessCommandList1 * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12VideoProcessCommandList1 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12VideoProcessCommandList1 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12VideoProcessCommandList1 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12VideoProcessCommandList1 * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12VideoProcessCommandList1 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12VideoProcessCommandList1 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12VideoProcessCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ProcessFrames)
+ void ( STDMETHODCALLTYPE *ProcessFrames )(
+ ID3D12VideoProcessCommandList1 * This,
+ _In_ ID3D12VideoProcessor *pVideoProcessor,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ UINT NumInputStreams,
+ _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12VideoProcessCommandList1 * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList1, ProcessFrames1)
+ void ( STDMETHODCALLTYPE *ProcessFrames1 )(
+ ID3D12VideoProcessCommandList1 * This,
+ _In_ ID3D12VideoProcessor *pVideoProcessor,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ UINT NumInputStreams,
+ _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments);
+
+ END_INTERFACE
+ } ID3D12VideoProcessCommandList1Vtbl;
+
+ interface ID3D12VideoProcessCommandList1
+ {
+ CONST_VTBL struct ID3D12VideoProcessCommandList1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoProcessCommandList1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoProcessCommandList1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoProcessCommandList1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoProcessCommandList1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoProcessCommandList1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoProcessCommandList1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoProcessCommandList1_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoProcessCommandList1_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12VideoProcessCommandList1_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12VideoProcessCommandList1_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12VideoProcessCommandList1_Reset(This,pAllocator) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator) )
+
+#define ID3D12VideoProcessCommandList1_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D12VideoProcessCommandList1_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12VideoProcessCommandList1_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12VideoProcessCommandList1_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoProcessCommandList1_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoProcessCommandList1_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12VideoProcessCommandList1_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12VideoProcessCommandList1_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12VideoProcessCommandList1_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12VideoProcessCommandList1_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12VideoProcessCommandList1_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \
+ ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) )
+
+#define ID3D12VideoProcessCommandList1_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+
+#define ID3D12VideoProcessCommandList1_ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \
+ ( (This)->lpVtbl -> ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoProcessCommandList1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12video_0000_0008 */
+/* [local] */
+
+typedef
+enum D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE
+ {
+ D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_8X8 = 0,
+ D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_16X16 = 1
+ } D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE;
+
+typedef
+enum D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS
+ {
+ D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_NONE = 0,
+ D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_8X8 = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_8X8 ) ,
+ D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_16X16 = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_16X16 )
+ } D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS );
+typedef
+enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION
+ {
+ D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_QUARTER_PEL = 0
+ } D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION;
+
+typedef
+enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS
+ {
+ D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAG_NONE = 0,
+ D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAG_QUARTER_PEL = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_QUARTER_PEL )
+ } D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS );
+typedef struct D3D12_FEATURE_DATA_VIDEO_FEATURE_AREA_SUPPORT
+ {
+ UINT NodeIndex;
+ BOOL VideoDecodeSupport;
+ BOOL VideoProcessSupport;
+ BOOL VideoEncodeSupport;
+ } D3D12_FEATURE_DATA_VIDEO_FEATURE_AREA_SUPPORT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR
+ {
+ UINT NodeIndex;
+ DXGI_FORMAT InputFormat;
+ D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS BlockSizeFlags;
+ D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS PrecisionFlags;
+ D3D12_VIDEO_SIZE_RANGE SizeRange;
+ } D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_SIZE
+ {
+ UINT NodeIndex;
+ DXGI_FORMAT InputFormat;
+ D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize;
+ D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision;
+ D3D12_VIDEO_SIZE_RANGE SizeRange;
+ BOOL Protected;
+ UINT64 MotionVectorHeapMemoryPoolL0Size;
+ UINT64 MotionVectorHeapMemoryPoolL1Size;
+ UINT64 MotionEstimatorMemoryPoolL0Size;
+ UINT64 MotionEstimatorMemoryPoolL1Size;
+ } D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_SIZE;
+
+typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_DESC
+ {
+ UINT NodeMask;
+ DXGI_FORMAT InputFormat;
+ D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize;
+ D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision;
+ D3D12_VIDEO_SIZE_RANGE SizeRange;
+ } D3D12_VIDEO_MOTION_ESTIMATOR_DESC;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0008_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0008_v0_0_s_ifspec;
+
+#ifndef __ID3D12VideoMotionEstimator_INTERFACE_DEFINED__
+#define __ID3D12VideoMotionEstimator_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoMotionEstimator */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoMotionEstimator;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("33FDAE0E-098B-428F-87BB-34B695DE08F8")
+ ID3D12VideoMotionEstimator : public ID3D12Pageable
+ {
+ public:
+#if defined(_MSC_VER) || !defined(_WIN32)
+ virtual D3D12_VIDEO_MOTION_ESTIMATOR_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+#else
+ virtual D3D12_VIDEO_MOTION_ESTIMATOR_DESC *STDMETHODCALLTYPE GetDesc(
+ D3D12_VIDEO_MOTION_ESTIMATOR_DESC * RetVal) = 0;
+#endif
+
+ virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession(
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppProtectedSession) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoMotionEstimatorVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoMotionEstimator * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoMotionEstimator * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoMotionEstimator * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoMotionEstimator * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoMotionEstimator * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoMotionEstimator * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoMotionEstimator * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoMotionEstimator * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoMotionEstimator, GetDesc)
+#if !defined(_WIN32)
+ D3D12_VIDEO_MOTION_ESTIMATOR_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoMotionEstimator * This);
+
+#else
+ D3D12_VIDEO_MOTION_ESTIMATOR_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoMotionEstimator * This,
+ D3D12_VIDEO_MOTION_ESTIMATOR_DESC * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12VideoMotionEstimator, GetProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )(
+ ID3D12VideoMotionEstimator * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppProtectedSession);
+
+ END_INTERFACE
+ } ID3D12VideoMotionEstimatorVtbl;
+
+ interface ID3D12VideoMotionEstimator
+ {
+ CONST_VTBL struct ID3D12VideoMotionEstimatorVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoMotionEstimator_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoMotionEstimator_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoMotionEstimator_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoMotionEstimator_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoMotionEstimator_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoMotionEstimator_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoMotionEstimator_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoMotionEstimator_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#if !defined(_WIN32)
+
+#define ID3D12VideoMotionEstimator_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12VideoMotionEstimator_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
+
+#define ID3D12VideoMotionEstimator_GetProtectedResourceSession(This,riid,ppProtectedSession) \
+ ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoMotionEstimator_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12video_0000_0009 */
+/* [local] */
+
+typedef struct D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC
+ {
+ UINT NodeMask;
+ DXGI_FORMAT InputFormat;
+ D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize;
+ D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision;
+ D3D12_VIDEO_SIZE_RANGE SizeRange;
+ } D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0009_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0009_v0_0_s_ifspec;
+
+#ifndef __ID3D12VideoMotionVectorHeap_INTERFACE_DEFINED__
+#define __ID3D12VideoMotionVectorHeap_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoMotionVectorHeap */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoMotionVectorHeap;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("5BE17987-743A-4061-834B-23D22DAEA505")
+ ID3D12VideoMotionVectorHeap : public ID3D12Pageable
+ {
+ public:
+#if defined(_MSC_VER) || !defined(_WIN32)
+ virtual D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+#else
+ virtual D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *STDMETHODCALLTYPE GetDesc(
+ D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC * RetVal) = 0;
+#endif
+
+ virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession(
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppProtectedSession) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoMotionVectorHeapVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoMotionVectorHeap * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoMotionVectorHeap * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoMotionVectorHeap * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoMotionVectorHeap * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoMotionVectorHeap * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoMotionVectorHeap * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoMotionVectorHeap * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoMotionVectorHeap * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoMotionVectorHeap, GetDesc)
+#if !defined(_WIN32)
+ D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoMotionVectorHeap * This);
+
+#else
+ D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoMotionVectorHeap * This,
+ D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12VideoMotionVectorHeap, GetProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )(
+ ID3D12VideoMotionVectorHeap * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppProtectedSession);
+
+ END_INTERFACE
+ } ID3D12VideoMotionVectorHeapVtbl;
+
+ interface ID3D12VideoMotionVectorHeap
+ {
+ CONST_VTBL struct ID3D12VideoMotionVectorHeapVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoMotionVectorHeap_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoMotionVectorHeap_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoMotionVectorHeap_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoMotionVectorHeap_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoMotionVectorHeap_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoMotionVectorHeap_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoMotionVectorHeap_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoMotionVectorHeap_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#if !defined(_WIN32)
+
+#define ID3D12VideoMotionVectorHeap_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12VideoMotionVectorHeap_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
+
+#define ID3D12VideoMotionVectorHeap_GetProtectedResourceSession(This,riid,ppProtectedSession) \
+ ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoMotionVectorHeap_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDevice1_INTERFACE_DEFINED__
+#define __ID3D12VideoDevice1_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoDevice1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoDevice1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("981611AD-A144-4C83-9890-F30E26D658AB")
+ ID3D12VideoDevice1 : public ID3D12VideoDevice
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoMotionEstimator(
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoMotionEstimator) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoMotionVectorHeap(
+ _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoMotionVectorHeap) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoDevice1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoDevice1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoDevice1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoDevice1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CheckFeatureSupport)
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D12VideoDevice1 * This,
+ D3D12_FEATURE_VIDEO FeatureVideo,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoder)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )(
+ ID3D12VideoDevice1 * This,
+ _In_ const D3D12_VIDEO_DECODER_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoder);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoderHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )(
+ ID3D12VideoDevice1 * This,
+ _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoderHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoProcessor)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )(
+ ID3D12VideoDevice1 * This,
+ UINT NodeMask,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc,
+ UINT NumInputStreamDescs,
+ _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoProcessor);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionEstimator)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionEstimator )(
+ ID3D12VideoDevice1 * This,
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoMotionEstimator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionVectorHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionVectorHeap )(
+ ID3D12VideoDevice1 * This,
+ _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoMotionVectorHeap);
+
+ END_INTERFACE
+ } ID3D12VideoDevice1Vtbl;
+
+ interface ID3D12VideoDevice1
+ {
+ CONST_VTBL struct ID3D12VideoDevice1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoDevice1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoDevice1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoDevice1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoDevice1_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D12VideoDevice1_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \
+ ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) )
+
+#define ID3D12VideoDevice1_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \
+ ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) )
+
+#define ID3D12VideoDevice1_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \
+ ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) )
+
+
+#define ID3D12VideoDevice1_CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) \
+ ( (This)->lpVtbl -> CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) )
+
+#define ID3D12VideoDevice1_CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) \
+ ( (This)->lpVtbl -> CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoDevice1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12video_0000_0011 */
+/* [local] */
+
+typedef struct D3D12_RESOURCE_COORDINATE
+ {
+ UINT64 X;
+ UINT Y;
+ UINT Z;
+ UINT SubresourceIndex;
+ } D3D12_RESOURCE_COORDINATE;
+
+typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT
+ {
+ ID3D12VideoMotionVectorHeap *pMotionVectorHeap;
+ } D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT;
+
+typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_INPUT
+ {
+ ID3D12Resource *pInputTexture2D;
+ UINT InputSubresourceIndex;
+ ID3D12Resource *pReferenceTexture2D;
+ UINT ReferenceSubresourceIndex;
+ ID3D12VideoMotionVectorHeap *pHintMotionVectorHeap;
+ } D3D12_VIDEO_MOTION_ESTIMATOR_INPUT;
+
+typedef struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT
+ {
+ ID3D12Resource *pMotionVectorTexture2D;
+ D3D12_RESOURCE_COORDINATE MotionVectorCoordinate;
+ } D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT;
+
+typedef struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT
+ {
+ ID3D12VideoMotionVectorHeap *pMotionVectorHeap;
+ UINT PixelWidth;
+ UINT PixelHeight;
+ } D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0011_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0011_v0_0_s_ifspec;
+
+#ifndef __ID3D12VideoEncodeCommandList_INTERFACE_DEFINED__
+#define __ID3D12VideoEncodeCommandList_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoEncodeCommandList */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoEncodeCommandList;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("8455293A-0CBD-4831-9B39-FBDBAB724723")
+ ID3D12VideoEncodeCommandList : public ID3D12CommandList
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE Close( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE Reset(
+ _In_ ID3D12CommandAllocator *pAllocator) = 0;
+
+ virtual void STDMETHODCALLTYPE ClearState( void) = 0;
+
+ virtual void STDMETHODCALLTYPE ResourceBarrier(
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0;
+
+ virtual void STDMETHODCALLTYPE DiscardResource(
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0;
+
+ virtual void STDMETHODCALLTYPE BeginQuery(
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index) = 0;
+
+ virtual void STDMETHODCALLTYPE EndQuery(
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index) = 0;
+
+ virtual void STDMETHODCALLTYPE ResolveQueryData(
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset) = 0;
+
+ virtual void STDMETHODCALLTYPE SetPredication(
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation) = 0;
+
+ virtual void STDMETHODCALLTYPE SetMarker(
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size) = 0;
+
+ virtual void STDMETHODCALLTYPE BeginEvent(
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size) = 0;
+
+ virtual void STDMETHODCALLTYPE EndEvent( void) = 0;
+
+ virtual void STDMETHODCALLTYPE EstimateMotion(
+ _In_ ID3D12VideoMotionEstimator *pMotionEstimator,
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments,
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments) = 0;
+
+ virtual void STDMETHODCALLTYPE ResolveMotionVectorHeap(
+ const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments,
+ const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments) = 0;
+
+ virtual void STDMETHODCALLTYPE WriteBufferImmediate(
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0;
+
+ virtual void STDMETHODCALLTYPE SetProtectedResourceSession(
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoEncodeCommandListVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoEncodeCommandList * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoEncodeCommandList * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoEncodeCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoEncodeCommandList * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoEncodeCommandList * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoEncodeCommandList * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoEncodeCommandList * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoEncodeCommandList * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12VideoEncodeCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12VideoEncodeCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12VideoEncodeCommandList * This,
+ _In_ ID3D12CommandAllocator *pAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12VideoEncodeCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12VideoEncodeCommandList * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12VideoEncodeCommandList * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12VideoEncodeCommandList * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12VideoEncodeCommandList * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12VideoEncodeCommandList * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12VideoEncodeCommandList * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12VideoEncodeCommandList * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12VideoEncodeCommandList * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12VideoEncodeCommandList * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EstimateMotion)
+ void ( STDMETHODCALLTYPE *EstimateMotion )(
+ ID3D12VideoEncodeCommandList * This,
+ _In_ ID3D12VideoMotionEstimator *pMotionEstimator,
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments,
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveMotionVectorHeap)
+ void ( STDMETHODCALLTYPE *ResolveMotionVectorHeap )(
+ ID3D12VideoEncodeCommandList * This,
+ const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments,
+ const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12VideoEncodeCommandList * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetProtectedResourceSession)
+ void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
+ ID3D12VideoEncodeCommandList * This,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+
+ END_INTERFACE
+ } ID3D12VideoEncodeCommandListVtbl;
+
+ interface ID3D12VideoEncodeCommandList
+ {
+ CONST_VTBL struct ID3D12VideoEncodeCommandListVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoEncodeCommandList_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoEncodeCommandList_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoEncodeCommandList_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoEncodeCommandList_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoEncodeCommandList_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoEncodeCommandList_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoEncodeCommandList_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoEncodeCommandList_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12VideoEncodeCommandList_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12VideoEncodeCommandList_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12VideoEncodeCommandList_Reset(This,pAllocator) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator) )
+
+#define ID3D12VideoEncodeCommandList_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D12VideoEncodeCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12VideoEncodeCommandList_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12VideoEncodeCommandList_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoEncodeCommandList_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoEncodeCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12VideoEncodeCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12VideoEncodeCommandList_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12VideoEncodeCommandList_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12VideoEncodeCommandList_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12VideoEncodeCommandList_EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) )
+
+#define ID3D12VideoEncodeCommandList_ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) )
+
+#define ID3D12VideoEncodeCommandList_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+#define ID3D12VideoEncodeCommandList_SetProtectedResourceSession(This,pProtectedResourceSession) \
+ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoEncodeCommandList_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12video_0000_0012 */
+/* [local] */
+
+typedef
+enum D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS
+ {
+ D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAG_NONE = 0,
+ D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAG_SUPPORTED = 0x1
+ } D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS );
+typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROTECTED_RESOURCES
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
+ D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS SupportFlags;
+ } D3D12_FEATURE_DATA_VIDEO_DECODE_PROTECTED_RESOURCES;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_PROTECTED_RESOURCES
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS SupportFlags;
+ } D3D12_FEATURE_DATA_VIDEO_PROCESS_PROTECTED_RESOURCES;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_PROTECTED_RESOURCE_SUPPORT_FLAGS SupportFlags;
+ } D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_PROTECTED_RESOURCES;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE1
+ {
+ D3D12_VIDEO_DECODER_HEAP_DESC VideoDecoderHeapDesc;
+ BOOL Protected;
+ UINT64 MemoryPoolL0Size;
+ UINT64 MemoryPoolL1Size;
+ } D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE1;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE1
+ {
+ UINT NodeMask;
+ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc;
+ UINT NumInputStreamDescs;
+ const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs;
+ BOOL Protected;
+ UINT64 MemoryPoolL0Size;
+ UINT64 MemoryPoolL1Size;
+ } D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE1;
+
+typedef
+enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE
+ {
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_CREATION = 0,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_INITIALIZATION = 1,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_EXECUTION = 2,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_CAPS_INPUT = 3,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_CAPS_OUTPUT = 4,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_DEVICE_EXECUTE_INPUT = 5,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE_DEVICE_EXECUTE_OUTPUT = 6
+ } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE;
+
+typedef
+enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE
+ {
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT8 = 0,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT16 = 1,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT32 = 2,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_UINT64 = 3,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT8 = 4,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT16 = 5,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT32 = 6,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_SINT64 = 7,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_FLOAT = 8,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_DOUBLE = 9,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE_RESOURCE = 10
+ } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE;
+
+typedef
+enum D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS
+ {
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_NONE = 0,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_READ = 0x1,
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAG_WRITE = 0x2
+ } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS );
+typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_COUNT
+ {
+ UINT NodeIndex;
+ UINT CommandCount;
+ } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_COUNT;
+
+typedef struct D3D12_VIDEO_EXTENSION_COMMAND_INFO
+ {
+ GUID CommandId;
+ LPCWSTR Name;
+ D3D12_COMMAND_LIST_SUPPORT_FLAGS CommandListSupportFlags;
+ } D3D12_VIDEO_EXTENSION_COMMAND_INFO;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMANDS
+ {
+ UINT NodeIndex;
+ UINT CommandCount;
+ _Field_size_full_(CommandCount) D3D12_VIDEO_EXTENSION_COMMAND_INFO *pCommandInfos;
+ } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMANDS;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT
+ {
+ GUID CommandId;
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE Stage;
+ UINT ParameterCount;
+ UINT ParameterPacking;
+ } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETER_COUNT;
+
+typedef struct D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_INFO
+ {
+ LPCWSTR Name;
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_TYPE Type;
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_FLAGS Flags;
+ } D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_INFO;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETERS
+ {
+ GUID CommandId;
+ D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_STAGE Stage;
+ UINT ParameterCount;
+ _Field_size_full_(ParameterCount) D3D12_VIDEO_EXTENSION_COMMAND_PARAMETER_INFO *pParameterInfos;
+ } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_PARAMETERS;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SUPPORT
+ {
+ UINT NodeIndex;
+ GUID CommandId;
+ _Field_size_bytes_full_opt_(InputDataSizeInBytes) const void *pInputData;
+ SIZE_T InputDataSizeInBytes;
+ _Field_size_bytes_full_opt_(OutputDataSizeInBytes) void *pOutputData;
+ SIZE_T OutputDataSizeInBytes;
+ } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SUPPORT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SIZE
+ {
+ UINT NodeIndex;
+ GUID CommandId;
+ _Field_size_bytes_full_(CreationParametersDataSizeInBytes) const void *pCreationParameters;
+ SIZE_T CreationParametersSizeInBytes;
+ UINT64 MemoryPoolL0Size;
+ UINT64 MemoryPoolL1Size;
+ } D3D12_FEATURE_DATA_VIDEO_EXTENSION_COMMAND_SIZE;
+
+typedef struct D3D12_VIDEO_EXTENSION_COMMAND_DESC
+ {
+ UINT NodeMask;
+ GUID CommandId;
+ } D3D12_VIDEO_EXTENSION_COMMAND_DESC;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0012_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0012_v0_0_s_ifspec;
+
+#ifndef __ID3D12VideoDecoder1_INTERFACE_DEFINED__
+#define __ID3D12VideoDecoder1_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoDecoder1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoDecoder1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("79A2E5FB-CCD2-469A-9FDE-195D10951F7E")
+ ID3D12VideoDecoder1 : public ID3D12VideoDecoder
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession(
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppProtectedSession) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoDecoder1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoDecoder1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoDecoder1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoDecoder1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoDecoder1 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoDecoder1 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoDecoder1 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoDecoder1 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoDecoder1 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecoder, GetDesc)
+#if !defined(_WIN32)
+ D3D12_VIDEO_DECODER_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoDecoder1 * This);
+
+#else
+ D3D12_VIDEO_DECODER_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoDecoder1 * This,
+ D3D12_VIDEO_DECODER_DESC * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecoder1, GetProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )(
+ ID3D12VideoDecoder1 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppProtectedSession);
+
+ END_INTERFACE
+ } ID3D12VideoDecoder1Vtbl;
+
+ interface ID3D12VideoDecoder1
+ {
+ CONST_VTBL struct ID3D12VideoDecoder1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoDecoder1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoDecoder1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoDecoder1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoDecoder1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoDecoder1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoDecoder1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoDecoder1_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoDecoder1_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#if !defined(_WIN32)
+
+#define ID3D12VideoDecoder1_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12VideoDecoder1_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
+
+
+#define ID3D12VideoDecoder1_GetProtectedResourceSession(This,riid,ppProtectedSession) \
+ ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoDecoder1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDecoderHeap1_INTERFACE_DEFINED__
+#define __ID3D12VideoDecoderHeap1_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoDecoderHeap1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoDecoderHeap1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("DA1D98C5-539F-41B2-BF6B-1198A03B6D26")
+ ID3D12VideoDecoderHeap1 : public ID3D12VideoDecoderHeap
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession(
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppProtectedSession) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoDecoderHeap1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoDecoderHeap1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoDecoderHeap1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoDecoderHeap1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoDecoderHeap1 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoDecoderHeap1 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoDecoderHeap1 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoDecoderHeap1 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoDecoderHeap1 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecoderHeap, GetDesc)
+#if !defined(_WIN32)
+ D3D12_VIDEO_DECODER_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoDecoderHeap1 * This);
+
+#else
+ D3D12_VIDEO_DECODER_HEAP_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoDecoderHeap1 * This,
+ D3D12_VIDEO_DECODER_HEAP_DESC * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecoderHeap1, GetProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )(
+ ID3D12VideoDecoderHeap1 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppProtectedSession);
+
+ END_INTERFACE
+ } ID3D12VideoDecoderHeap1Vtbl;
+
+ interface ID3D12VideoDecoderHeap1
+ {
+ CONST_VTBL struct ID3D12VideoDecoderHeap1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoDecoderHeap1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoDecoderHeap1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoDecoderHeap1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoDecoderHeap1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoDecoderHeap1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoDecoderHeap1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoDecoderHeap1_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoDecoderHeap1_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#if !defined(_WIN32)
+
+#define ID3D12VideoDecoderHeap1_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12VideoDecoderHeap1_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
+
+
+#define ID3D12VideoDecoderHeap1_GetProtectedResourceSession(This,riid,ppProtectedSession) \
+ ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoDecoderHeap1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoProcessor1_INTERFACE_DEFINED__
+#define __ID3D12VideoProcessor1_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoProcessor1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoProcessor1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("F3CFE615-553F-425C-86D8-EE8C1B1FB01C")
+ ID3D12VideoProcessor1 : public ID3D12VideoProcessor
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession(
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppProtectedSession) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoProcessor1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoProcessor1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoProcessor1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoProcessor1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoProcessor1 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoProcessor1 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoProcessor1 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoProcessor1 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoProcessor1 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetNodeMask)
+ UINT ( STDMETHODCALLTYPE *GetNodeMask )(
+ ID3D12VideoProcessor1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetNumInputStreamDescs)
+ UINT ( STDMETHODCALLTYPE *GetNumInputStreamDescs )(
+ ID3D12VideoProcessor1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetInputStreamDescs)
+ HRESULT ( STDMETHODCALLTYPE *GetInputStreamDescs )(
+ ID3D12VideoProcessor1 * This,
+ UINT NumInputStreamDescs,
+ _Out_writes_(NumInputStreamDescs) D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessor, GetOutputStreamDesc)
+#if !defined(_WIN32)
+ D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC ( STDMETHODCALLTYPE *GetOutputStreamDesc )(
+ ID3D12VideoProcessor1 * This);
+
+#else
+ D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *( STDMETHODCALLTYPE *GetOutputStreamDesc )(
+ ID3D12VideoProcessor1 * This,
+ D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessor1, GetProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )(
+ ID3D12VideoProcessor1 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppProtectedSession);
+
+ END_INTERFACE
+ } ID3D12VideoProcessor1Vtbl;
+
+ interface ID3D12VideoProcessor1
+ {
+ CONST_VTBL struct ID3D12VideoProcessor1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoProcessor1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoProcessor1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoProcessor1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoProcessor1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoProcessor1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoProcessor1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoProcessor1_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoProcessor1_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#define ID3D12VideoProcessor1_GetNodeMask(This) \
+ ( (This)->lpVtbl -> GetNodeMask(This) )
+
+#define ID3D12VideoProcessor1_GetNumInputStreamDescs(This) \
+ ( (This)->lpVtbl -> GetNumInputStreamDescs(This) )
+
+#define ID3D12VideoProcessor1_GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) \
+ ( (This)->lpVtbl -> GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) )
+#if !defined(_WIN32)
+
+#define ID3D12VideoProcessor1_GetOutputStreamDesc(This) \
+ ( (This)->lpVtbl -> GetOutputStreamDesc(This) )
+#else
+#define ID3D12VideoProcessor1_GetOutputStreamDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetOutputStreamDesc(This,RetVal) )
+#endif
+
+
+#define ID3D12VideoProcessor1_GetProtectedResourceSession(This,riid,ppProtectedSession) \
+ ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoProcessor1_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoExtensionCommand_INTERFACE_DEFINED__
+#define __ID3D12VideoExtensionCommand_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoExtensionCommand */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoExtensionCommand;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("554E41E8-AE8E-4A8C-B7D2-5B4F274A30E4")
+ ID3D12VideoExtensionCommand : public ID3D12Pageable
+ {
+ public:
+#if defined(_MSC_VER) || !defined(_WIN32)
+ virtual D3D12_VIDEO_EXTENSION_COMMAND_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
+#else
+ virtual D3D12_VIDEO_EXTENSION_COMMAND_DESC *STDMETHODCALLTYPE GetDesc(
+ D3D12_VIDEO_EXTENSION_COMMAND_DESC * RetVal) = 0;
+#endif
+
+ virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession(
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppProtectedSession) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoExtensionCommandVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoExtensionCommand * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoExtensionCommand * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoExtensionCommand * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoExtensionCommand * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoExtensionCommand * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoExtensionCommand * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoExtensionCommand * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoExtensionCommand * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoExtensionCommand, GetDesc)
+#if !defined(_WIN32)
+ D3D12_VIDEO_EXTENSION_COMMAND_DESC ( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoExtensionCommand * This);
+
+#else
+ D3D12_VIDEO_EXTENSION_COMMAND_DESC *( STDMETHODCALLTYPE *GetDesc )(
+ ID3D12VideoExtensionCommand * This,
+ D3D12_VIDEO_EXTENSION_COMMAND_DESC * RetVal);
+
+#endif
+
+ DECLSPEC_XFGVIRT(ID3D12VideoExtensionCommand, GetProtectedResourceSession)
+ HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )(
+ ID3D12VideoExtensionCommand * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppProtectedSession);
+
+ END_INTERFACE
+ } ID3D12VideoExtensionCommandVtbl;
+
+ interface ID3D12VideoExtensionCommand
+ {
+ CONST_VTBL struct ID3D12VideoExtensionCommandVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoExtensionCommand_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoExtensionCommand_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoExtensionCommand_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoExtensionCommand_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoExtensionCommand_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoExtensionCommand_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoExtensionCommand_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoExtensionCommand_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#if !defined(_WIN32)
+
+#define ID3D12VideoExtensionCommand_GetDesc(This) \
+ ( (This)->lpVtbl -> GetDesc(This) )
+#else
+#define ID3D12VideoExtensionCommand_GetDesc(This,RetVal) \
+ ( (This)->lpVtbl -> GetDesc(This,RetVal) )
+#endif
+
+#define ID3D12VideoExtensionCommand_GetProtectedResourceSession(This,riid,ppProtectedSession) \
+ ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoExtensionCommand_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDevice2_INTERFACE_DEFINED__
+#define __ID3D12VideoDevice2_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoDevice2 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoDevice2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("F019AC49-F838-4A95-9B17-579437C8F513")
+ ID3D12VideoDevice2 : public ID3D12VideoDevice1
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoder1(
+ _In_ const D3D12_VIDEO_DECODER_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoder) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoderHeap1(
+ _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoderHeap) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoProcessor1(
+ UINT NodeMask,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc,
+ UINT NumInputStreamDescs,
+ _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoProcessor) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoExtensionCommand(
+ _In_ const D3D12_VIDEO_EXTENSION_COMMAND_DESC *pDesc,
+ _In_reads_bytes_(CreationParametersDataSizeInBytes) const void *pCreationParameters,
+ SIZE_T CreationParametersDataSizeInBytes,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoExtensionCommand) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE ExecuteExtensionCommand(
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters,
+ SIZE_T ExecutionParametersSizeInBytes,
+ _Out_writes_bytes_(OutputDataSizeInBytes) void *pOutputData,
+ SIZE_T OutputDataSizeInBytes) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoDevice2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoDevice2 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoDevice2 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoDevice2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CheckFeatureSupport)
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D12VideoDevice2 * This,
+ D3D12_FEATURE_VIDEO FeatureVideo,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoder)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )(
+ ID3D12VideoDevice2 * This,
+ _In_ const D3D12_VIDEO_DECODER_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoder);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoderHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )(
+ ID3D12VideoDevice2 * This,
+ _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoderHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoProcessor)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )(
+ ID3D12VideoDevice2 * This,
+ UINT NodeMask,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc,
+ UINT NumInputStreamDescs,
+ _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoProcessor);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionEstimator)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionEstimator )(
+ ID3D12VideoDevice2 * This,
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoMotionEstimator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionVectorHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionVectorHeap )(
+ ID3D12VideoDevice2 * This,
+ _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoMotionVectorHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoDecoder1)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder1 )(
+ ID3D12VideoDevice2 * This,
+ _In_ const D3D12_VIDEO_DECODER_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoder);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoDecoderHeap1)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap1 )(
+ ID3D12VideoDevice2 * This,
+ _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoderHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoProcessor1)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor1 )(
+ ID3D12VideoDevice2 * This,
+ UINT NodeMask,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc,
+ UINT NumInputStreamDescs,
+ _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoProcessor);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoExtensionCommand)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoExtensionCommand )(
+ ID3D12VideoDevice2 * This,
+ _In_ const D3D12_VIDEO_EXTENSION_COMMAND_DESC *pDesc,
+ _In_reads_bytes_(CreationParametersDataSizeInBytes) const void *pCreationParameters,
+ SIZE_T CreationParametersDataSizeInBytes,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoExtensionCommand);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice2, ExecuteExtensionCommand)
+ HRESULT ( STDMETHODCALLTYPE *ExecuteExtensionCommand )(
+ ID3D12VideoDevice2 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters,
+ SIZE_T ExecutionParametersSizeInBytes,
+ _Out_writes_bytes_(OutputDataSizeInBytes) void *pOutputData,
+ SIZE_T OutputDataSizeInBytes);
+
+ END_INTERFACE
+ } ID3D12VideoDevice2Vtbl;
+
+ interface ID3D12VideoDevice2
+ {
+ CONST_VTBL struct ID3D12VideoDevice2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoDevice2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoDevice2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoDevice2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoDevice2_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D12VideoDevice2_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \
+ ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) )
+
+#define ID3D12VideoDevice2_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \
+ ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) )
+
+#define ID3D12VideoDevice2_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \
+ ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) )
+
+
+#define ID3D12VideoDevice2_CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) \
+ ( (This)->lpVtbl -> CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) )
+
+#define ID3D12VideoDevice2_CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) \
+ ( (This)->lpVtbl -> CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) )
+
+
+#define ID3D12VideoDevice2_CreateVideoDecoder1(This,pDesc,pProtectedResourceSession,riid,ppVideoDecoder) \
+ ( (This)->lpVtbl -> CreateVideoDecoder1(This,pDesc,pProtectedResourceSession,riid,ppVideoDecoder) )
+
+#define ID3D12VideoDevice2_CreateVideoDecoderHeap1(This,pVideoDecoderHeapDesc,pProtectedResourceSession,riid,ppVideoDecoderHeap) \
+ ( (This)->lpVtbl -> CreateVideoDecoderHeap1(This,pVideoDecoderHeapDesc,pProtectedResourceSession,riid,ppVideoDecoderHeap) )
+
+#define ID3D12VideoDevice2_CreateVideoProcessor1(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,pProtectedResourceSession,riid,ppVideoProcessor) \
+ ( (This)->lpVtbl -> CreateVideoProcessor1(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,pProtectedResourceSession,riid,ppVideoProcessor) )
+
+#define ID3D12VideoDevice2_CreateVideoExtensionCommand(This,pDesc,pCreationParameters,CreationParametersDataSizeInBytes,pProtectedResourceSession,riid,ppVideoExtensionCommand) \
+ ( (This)->lpVtbl -> CreateVideoExtensionCommand(This,pDesc,pCreationParameters,CreationParametersDataSizeInBytes,pProtectedResourceSession,riid,ppVideoExtensionCommand) )
+
+#define ID3D12VideoDevice2_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes,pOutputData,OutputDataSizeInBytes) \
+ ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes,pOutputData,OutputDataSizeInBytes) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoDevice2_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDecodeCommandList2_INTERFACE_DEFINED__
+#define __ID3D12VideoDecodeCommandList2_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoDecodeCommandList2 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoDecodeCommandList2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("6e120880-c114-4153-8036-d247051e1729")
+ ID3D12VideoDecodeCommandList2 : public ID3D12VideoDecodeCommandList1
+ {
+ public:
+ virtual void STDMETHODCALLTYPE SetProtectedResourceSession(
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0;
+
+ virtual void STDMETHODCALLTYPE InitializeExtensionCommand(
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters,
+ SIZE_T InitializationParametersSizeInBytes) = 0;
+
+ virtual void STDMETHODCALLTYPE ExecuteExtensionCommand(
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters,
+ SIZE_T ExecutionParametersSizeInBytes) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoDecodeCommandList2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoDecodeCommandList2 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoDecodeCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoDecodeCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoDecodeCommandList2 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12VideoDecodeCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12VideoDecodeCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_ ID3D12CommandAllocator *pAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12VideoDecodeCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12VideoDecodeCommandList2 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12VideoDecodeCommandList2 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12VideoDecodeCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DecodeFrame)
+ void ( STDMETHODCALLTYPE *DecodeFrame )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_ ID3D12VideoDecoder *pDecoder,
+ _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12VideoDecodeCommandList2 * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList1, DecodeFrame1)
+ void ( STDMETHODCALLTYPE *DecodeFrame1 )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_ ID3D12VideoDecoder *pDecoder,
+ _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments,
+ _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, SetProtectedResourceSession)
+ void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, InitializeExtensionCommand)
+ void ( STDMETHODCALLTYPE *InitializeExtensionCommand )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters,
+ SIZE_T InitializationParametersSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, ExecuteExtensionCommand)
+ void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )(
+ ID3D12VideoDecodeCommandList2 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters,
+ SIZE_T ExecutionParametersSizeInBytes);
+
+ END_INTERFACE
+ } ID3D12VideoDecodeCommandList2Vtbl;
+
+ interface ID3D12VideoDecodeCommandList2
+ {
+ CONST_VTBL struct ID3D12VideoDecodeCommandList2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoDecodeCommandList2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoDecodeCommandList2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoDecodeCommandList2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoDecodeCommandList2_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoDecodeCommandList2_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoDecodeCommandList2_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoDecodeCommandList2_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoDecodeCommandList2_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12VideoDecodeCommandList2_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12VideoDecodeCommandList2_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12VideoDecodeCommandList2_Reset(This,pAllocator) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator) )
+
+#define ID3D12VideoDecodeCommandList2_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D12VideoDecodeCommandList2_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12VideoDecodeCommandList2_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12VideoDecodeCommandList2_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoDecodeCommandList2_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoDecodeCommandList2_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12VideoDecodeCommandList2_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12VideoDecodeCommandList2_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12VideoDecodeCommandList2_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12VideoDecodeCommandList2_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12VideoDecodeCommandList2_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) )
+
+#define ID3D12VideoDecodeCommandList2_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+
+#define ID3D12VideoDecodeCommandList2_DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) )
+
+
+#define ID3D12VideoDecodeCommandList2_SetProtectedResourceSession(This,pProtectedResourceSession) \
+ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
+
+#define ID3D12VideoDecodeCommandList2_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \
+ ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) )
+
+#define ID3D12VideoDecodeCommandList2_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \
+ ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoDecodeCommandList2_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDecodeCommandList3_INTERFACE_DEFINED__
+#define __ID3D12VideoDecodeCommandList3_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoDecodeCommandList3 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoDecodeCommandList3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("2aee8c37-9562-42da-8abf-61efeb2e4513")
+ ID3D12VideoDecodeCommandList3 : public ID3D12VideoDecodeCommandList2
+ {
+ public:
+ virtual void STDMETHODCALLTYPE Barrier(
+ UINT32 NumBarrierGroups,
+ _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoDecodeCommandList3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoDecodeCommandList3 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoDecodeCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoDecodeCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoDecodeCommandList3 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12VideoDecodeCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12VideoDecodeCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_ ID3D12CommandAllocator *pAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12VideoDecodeCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12VideoDecodeCommandList3 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12VideoDecodeCommandList3 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12VideoDecodeCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, DecodeFrame)
+ void ( STDMETHODCALLTYPE *DecodeFrame )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_ ID3D12VideoDecoder *pDecoder,
+ _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12VideoDecodeCommandList3 * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList1, DecodeFrame1)
+ void ( STDMETHODCALLTYPE *DecodeFrame1 )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_ ID3D12VideoDecoder *pDecoder,
+ _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments,
+ _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, SetProtectedResourceSession)
+ void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, InitializeExtensionCommand)
+ void ( STDMETHODCALLTYPE *InitializeExtensionCommand )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters,
+ SIZE_T InitializationParametersSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList2, ExecuteExtensionCommand)
+ void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )(
+ ID3D12VideoDecodeCommandList3 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters,
+ SIZE_T ExecutionParametersSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDecodeCommandList3, Barrier)
+ void ( STDMETHODCALLTYPE *Barrier )(
+ ID3D12VideoDecodeCommandList3 * This,
+ UINT32 NumBarrierGroups,
+ _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups);
+
+ END_INTERFACE
+ } ID3D12VideoDecodeCommandList3Vtbl;
+
+ interface ID3D12VideoDecodeCommandList3
+ {
+ CONST_VTBL struct ID3D12VideoDecodeCommandList3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoDecodeCommandList3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoDecodeCommandList3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoDecodeCommandList3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoDecodeCommandList3_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoDecodeCommandList3_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoDecodeCommandList3_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoDecodeCommandList3_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoDecodeCommandList3_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12VideoDecodeCommandList3_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12VideoDecodeCommandList3_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12VideoDecodeCommandList3_Reset(This,pAllocator) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator) )
+
+#define ID3D12VideoDecodeCommandList3_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D12VideoDecodeCommandList3_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12VideoDecodeCommandList3_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12VideoDecodeCommandList3_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoDecodeCommandList3_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoDecodeCommandList3_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12VideoDecodeCommandList3_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12VideoDecodeCommandList3_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12VideoDecodeCommandList3_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12VideoDecodeCommandList3_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12VideoDecodeCommandList3_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) )
+
+#define ID3D12VideoDecodeCommandList3_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+
+#define ID3D12VideoDecodeCommandList3_DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) )
+
+
+#define ID3D12VideoDecodeCommandList3_SetProtectedResourceSession(This,pProtectedResourceSession) \
+ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
+
+#define ID3D12VideoDecodeCommandList3_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \
+ ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) )
+
+#define ID3D12VideoDecodeCommandList3_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \
+ ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) )
+
+
+#define ID3D12VideoDecodeCommandList3_Barrier(This,NumBarrierGroups,pBarrierGroups) \
+ ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoDecodeCommandList3_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoProcessCommandList2_INTERFACE_DEFINED__
+#define __ID3D12VideoProcessCommandList2_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoProcessCommandList2 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoProcessCommandList2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("db525ae4-6ad6-473c-baa7-59b2e37082e4")
+ ID3D12VideoProcessCommandList2 : public ID3D12VideoProcessCommandList1
+ {
+ public:
+ virtual void STDMETHODCALLTYPE SetProtectedResourceSession(
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0;
+
+ virtual void STDMETHODCALLTYPE InitializeExtensionCommand(
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters,
+ SIZE_T InitializationParametersSizeInBytes) = 0;
+
+ virtual void STDMETHODCALLTYPE ExecuteExtensionCommand(
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters,
+ SIZE_T ExecutionParametersSizeInBytes) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoProcessCommandList2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoProcessCommandList2 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoProcessCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoProcessCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoProcessCommandList2 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12VideoProcessCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12VideoProcessCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_ ID3D12CommandAllocator *pAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12VideoProcessCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12VideoProcessCommandList2 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12VideoProcessCommandList2 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12VideoProcessCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ProcessFrames)
+ void ( STDMETHODCALLTYPE *ProcessFrames )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_ ID3D12VideoProcessor *pVideoProcessor,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ UINT NumInputStreams,
+ _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12VideoProcessCommandList2 * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList1, ProcessFrames1)
+ void ( STDMETHODCALLTYPE *ProcessFrames1 )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_ ID3D12VideoProcessor *pVideoProcessor,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ UINT NumInputStreams,
+ _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, SetProtectedResourceSession)
+ void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, InitializeExtensionCommand)
+ void ( STDMETHODCALLTYPE *InitializeExtensionCommand )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters,
+ SIZE_T InitializationParametersSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, ExecuteExtensionCommand)
+ void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )(
+ ID3D12VideoProcessCommandList2 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters,
+ SIZE_T ExecutionParametersSizeInBytes);
+
+ END_INTERFACE
+ } ID3D12VideoProcessCommandList2Vtbl;
+
+ interface ID3D12VideoProcessCommandList2
+ {
+ CONST_VTBL struct ID3D12VideoProcessCommandList2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoProcessCommandList2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoProcessCommandList2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoProcessCommandList2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoProcessCommandList2_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoProcessCommandList2_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoProcessCommandList2_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoProcessCommandList2_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoProcessCommandList2_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12VideoProcessCommandList2_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12VideoProcessCommandList2_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12VideoProcessCommandList2_Reset(This,pAllocator) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator) )
+
+#define ID3D12VideoProcessCommandList2_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D12VideoProcessCommandList2_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12VideoProcessCommandList2_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12VideoProcessCommandList2_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoProcessCommandList2_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoProcessCommandList2_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12VideoProcessCommandList2_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12VideoProcessCommandList2_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12VideoProcessCommandList2_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12VideoProcessCommandList2_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12VideoProcessCommandList2_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \
+ ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) )
+
+#define ID3D12VideoProcessCommandList2_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+
+#define ID3D12VideoProcessCommandList2_ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \
+ ( (This)->lpVtbl -> ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) )
+
+
+#define ID3D12VideoProcessCommandList2_SetProtectedResourceSession(This,pProtectedResourceSession) \
+ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
+
+#define ID3D12VideoProcessCommandList2_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \
+ ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) )
+
+#define ID3D12VideoProcessCommandList2_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \
+ ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoProcessCommandList2_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoProcessCommandList3_INTERFACE_DEFINED__
+#define __ID3D12VideoProcessCommandList3_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoProcessCommandList3 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoProcessCommandList3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("1a0a4ca4-9f08-40ce-9558-b411fd2666ff")
+ ID3D12VideoProcessCommandList3 : public ID3D12VideoProcessCommandList2
+ {
+ public:
+ virtual void STDMETHODCALLTYPE Barrier(
+ UINT32 NumBarrierGroups,
+ _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoProcessCommandList3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoProcessCommandList3 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoProcessCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoProcessCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoProcessCommandList3 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12VideoProcessCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12VideoProcessCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_ ID3D12CommandAllocator *pAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12VideoProcessCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12VideoProcessCommandList3 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12VideoProcessCommandList3 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12VideoProcessCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, ProcessFrames)
+ void ( STDMETHODCALLTYPE *ProcessFrames )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_ ID3D12VideoProcessor *pVideoProcessor,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ UINT NumInputStreams,
+ _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12VideoProcessCommandList3 * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList1, ProcessFrames1)
+ void ( STDMETHODCALLTYPE *ProcessFrames1 )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_ ID3D12VideoProcessor *pVideoProcessor,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
+ UINT NumInputStreams,
+ _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, SetProtectedResourceSession)
+ void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, InitializeExtensionCommand)
+ void ( STDMETHODCALLTYPE *InitializeExtensionCommand )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters,
+ SIZE_T InitializationParametersSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList2, ExecuteExtensionCommand)
+ void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )(
+ ID3D12VideoProcessCommandList3 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters,
+ SIZE_T ExecutionParametersSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoProcessCommandList3, Barrier)
+ void ( STDMETHODCALLTYPE *Barrier )(
+ ID3D12VideoProcessCommandList3 * This,
+ UINT32 NumBarrierGroups,
+ _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups);
+
+ END_INTERFACE
+ } ID3D12VideoProcessCommandList3Vtbl;
+
+ interface ID3D12VideoProcessCommandList3
+ {
+ CONST_VTBL struct ID3D12VideoProcessCommandList3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoProcessCommandList3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoProcessCommandList3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoProcessCommandList3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoProcessCommandList3_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoProcessCommandList3_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoProcessCommandList3_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoProcessCommandList3_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoProcessCommandList3_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12VideoProcessCommandList3_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12VideoProcessCommandList3_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12VideoProcessCommandList3_Reset(This,pAllocator) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator) )
+
+#define ID3D12VideoProcessCommandList3_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D12VideoProcessCommandList3_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12VideoProcessCommandList3_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12VideoProcessCommandList3_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoProcessCommandList3_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoProcessCommandList3_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12VideoProcessCommandList3_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12VideoProcessCommandList3_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12VideoProcessCommandList3_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12VideoProcessCommandList3_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12VideoProcessCommandList3_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \
+ ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) )
+
+#define ID3D12VideoProcessCommandList3_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+
+#define ID3D12VideoProcessCommandList3_ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \
+ ( (This)->lpVtbl -> ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) )
+
+
+#define ID3D12VideoProcessCommandList3_SetProtectedResourceSession(This,pProtectedResourceSession) \
+ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
+
+#define ID3D12VideoProcessCommandList3_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \
+ ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) )
+
+#define ID3D12VideoProcessCommandList3_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \
+ ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) )
+
+
+#define ID3D12VideoProcessCommandList3_Barrier(This,NumBarrierGroups,pBarrierGroups) \
+ ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoProcessCommandList3_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoEncodeCommandList1_INTERFACE_DEFINED__
+#define __ID3D12VideoEncodeCommandList1_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoEncodeCommandList1 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoEncodeCommandList1;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("94971eca-2bdb-4769-88cf-3675ea757ebc")
+ ID3D12VideoEncodeCommandList1 : public ID3D12VideoEncodeCommandList
+ {
+ public:
+ virtual void STDMETHODCALLTYPE InitializeExtensionCommand(
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters,
+ SIZE_T InitializationParametersSizeInBytes) = 0;
+
+ virtual void STDMETHODCALLTYPE ExecuteExtensionCommand(
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters,
+ SIZE_T ExecutionParametersSizeInBytes) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoEncodeCommandList1Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoEncodeCommandList1 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoEncodeCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoEncodeCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoEncodeCommandList1 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12VideoEncodeCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12VideoEncodeCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_ ID3D12CommandAllocator *pAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12VideoEncodeCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12VideoEncodeCommandList1 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12VideoEncodeCommandList1 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12VideoEncodeCommandList1 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EstimateMotion)
+ void ( STDMETHODCALLTYPE *EstimateMotion )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_ ID3D12VideoMotionEstimator *pMotionEstimator,
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments,
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveMotionVectorHeap)
+ void ( STDMETHODCALLTYPE *ResolveMotionVectorHeap )(
+ ID3D12VideoEncodeCommandList1 * This,
+ const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments,
+ const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12VideoEncodeCommandList1 * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetProtectedResourceSession)
+ void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, InitializeExtensionCommand)
+ void ( STDMETHODCALLTYPE *InitializeExtensionCommand )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters,
+ SIZE_T InitializationParametersSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, ExecuteExtensionCommand)
+ void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )(
+ ID3D12VideoEncodeCommandList1 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters,
+ SIZE_T ExecutionParametersSizeInBytes);
+
+ END_INTERFACE
+ } ID3D12VideoEncodeCommandList1Vtbl;
+
+ interface ID3D12VideoEncodeCommandList1
+ {
+ CONST_VTBL struct ID3D12VideoEncodeCommandList1Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoEncodeCommandList1_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoEncodeCommandList1_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoEncodeCommandList1_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoEncodeCommandList1_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoEncodeCommandList1_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoEncodeCommandList1_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoEncodeCommandList1_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoEncodeCommandList1_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12VideoEncodeCommandList1_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12VideoEncodeCommandList1_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12VideoEncodeCommandList1_Reset(This,pAllocator) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator) )
+
+#define ID3D12VideoEncodeCommandList1_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D12VideoEncodeCommandList1_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12VideoEncodeCommandList1_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12VideoEncodeCommandList1_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoEncodeCommandList1_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoEncodeCommandList1_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12VideoEncodeCommandList1_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12VideoEncodeCommandList1_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12VideoEncodeCommandList1_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12VideoEncodeCommandList1_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12VideoEncodeCommandList1_EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) )
+
+#define ID3D12VideoEncodeCommandList1_ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) )
+
+#define ID3D12VideoEncodeCommandList1_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+#define ID3D12VideoEncodeCommandList1_SetProtectedResourceSession(This,pProtectedResourceSession) \
+ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
+
+
+#define ID3D12VideoEncodeCommandList1_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \
+ ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) )
+
+#define ID3D12VideoEncodeCommandList1_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \
+ ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoEncodeCommandList1_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12video_0000_0022 */
+/* [local] */
+
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG2, 0xee27417f, 0x5e28, 0x4e65, 0xbe, 0xea, 0x1d, 0x26, 0xb5, 0x08, 0xad, 0xc9);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG1_AND_MPEG2, 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264, 0x1b81be68, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_STEREO_PROGRESSIVE, 0xd79be8da, 0x0cf1, 0x4c81, 0xb8, 0x2a, 0x69, 0xa4, 0xe2, 0x36, 0xf4, 0x3d);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_STEREO, 0xf9aaccbb, 0xc2b6, 0x4cfc, 0x87, 0x79, 0x57, 0x07, 0xb1, 0x76, 0x05, 0x52);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_MULTIVIEW, 0x705b9d82, 0x76cf, 0x49d6, 0xb7, 0xe6, 0xac, 0x88, 0x72, 0xdb, 0x01, 0x3c);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VC1, 0x1b81beA3, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VC1_D2010, 0x1b81beA4, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_SIMPLE, 0xefd64d74, 0xc9e8,0x41d7,0xa5,0xe9,0xe9,0xb0,0xe3,0x9f,0xa3,0x19);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_ADVSIMPLE_NOGMC, 0xed418a9f, 0x010d, 0x4eda, 0x9a, 0xe3, 0x9a, 0x65, 0x35, 0x8d, 0x8d, 0x2e);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN, 0x5b11d51b, 0x2f4c, 0x4452, 0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10, 0x107af0e0, 0xef1a, 0x4d19, 0xab, 0xa8, 0x67, 0xa1, 0x63, 0x07, 0x3d, 0x13);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9, 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9_10BIT_PROFILE2, 0xa4c749ef, 0x6ecf, 0x48aa, 0x84, 0x48, 0x50, 0xa7, 0xa1, 0x16, 0x5f, 0xf7);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP8, 0x90b899ea, 0x3a62, 0x4705, 0x88, 0xb3, 0x8d, 0xf0, 0x4b, 0x27, 0x44, 0xe7);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE0, 0xb8be4ccb, 0xcf53, 0x46ba, 0x8d, 0x59, 0xd6, 0xb8, 0xa6, 0xda, 0x5d, 0x2a);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE1, 0x6936ff0f, 0x45b1, 0x4163, 0x9c, 0xc1, 0x64, 0x6e, 0xf6, 0x94, 0x61, 0x08);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_PROFILE2, 0x0c5f2aa1, 0xe541, 0x4089, 0xbb, 0x7b, 0x98, 0x11, 0x0a, 0x19, 0xd7, 0xc8);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2, 0x17127009, 0xa00f, 0x4ce1, 0x99, 0x4e, 0xbf, 0x40, 0x81, 0xf6, 0xf3, 0xf0);
+DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_AV1_12BIT_PROFILE2_420, 0x2d80bed6, 0x9cac, 0x4835, 0x9e, 0x91, 0x32, 0x7b, 0xbc, 0x4f, 0x9e, 0xe8);
+typedef
+enum D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE
+ {
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_ABSOLUTE_QP_MAP = 0,
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_CQP = 1,
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_CBR = 2,
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_VBR = 3,
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE_QVBR = 4
+ } D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE;
+
+typedef
+enum D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_DELTA_QP = 0x1,
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_FRAME_ANALYSIS = 0x2,
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_QP_RANGE = 0x4,
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_INITIAL_QP = 0x8,
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_MAX_FRAME_SIZE = 0x10,
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAG_ENABLE_VBV_SIZES = 0x20
+ } D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP
+ {
+ UINT ConstantQP_FullIntracodedFrame;
+ UINT ConstantQP_InterPredictedFrame_PrevRefOnly;
+ UINT ConstantQP_InterPredictedFrame_BiDirectionalRef;
+ } D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP;
+
+typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR
+ {
+ UINT InitialQP;
+ UINT MinQP;
+ UINT MaxQP;
+ UINT64 MaxFrameBitSize;
+ UINT64 TargetBitRate;
+ UINT64 VBVCapacity;
+ UINT64 InitialVBVFullness;
+ } D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR;
+
+typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR
+ {
+ UINT InitialQP;
+ UINT MinQP;
+ UINT MaxQP;
+ UINT64 MaxFrameBitSize;
+ UINT64 TargetAvgBitRate;
+ UINT64 PeakBitRate;
+ UINT64 VBVCapacity;
+ UINT64 InitialVBVFullness;
+ } D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR;
+
+typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR
+ {
+ UINT InitialQP;
+ UINT MinQP;
+ UINT MaxQP;
+ UINT64 MaxFrameBitSize;
+ UINT64 TargetAvgBitRate;
+ UINT64 PeakBitRate;
+ UINT ConstantQualityTarget;
+ } D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR;
+
+typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS
+ {
+ UINT DataSize;
+ union
+ {
+ const D3D12_VIDEO_ENCODER_RATE_CONTROL_CQP *pConfiguration_CQP;
+ const D3D12_VIDEO_ENCODER_RATE_CONTROL_CBR *pConfiguration_CBR;
+ const D3D12_VIDEO_ENCODER_RATE_CONTROL_VBR *pConfiguration_VBR;
+ const D3D12_VIDEO_ENCODER_RATE_CONTROL_QVBR *pConfiguration_QVBR;
+ } ;
+ } D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS;
+
+typedef struct D3D12_VIDEO_ENCODER_RATE_CONTROL
+ {
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE Mode;
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_FLAGS Flags;
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_CONFIGURATION_PARAMS ConfigParams;
+ DXGI_RATIONAL TargetFrameRate;
+ } D3D12_VIDEO_ENCODER_RATE_CONTROL;
+
+typedef
+enum D3D12_VIDEO_ENCODER_CODEC
+ {
+ D3D12_VIDEO_ENCODER_CODEC_H264 = 0,
+ D3D12_VIDEO_ENCODER_CODEC_HEVC = 1
+ } D3D12_VIDEO_ENCODER_CODEC;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ BOOL IsSupported;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC;
+
+typedef
+enum D3D12_VIDEO_ENCODER_PROFILE_H264
+ {
+ D3D12_VIDEO_ENCODER_PROFILE_H264_MAIN = 0,
+ D3D12_VIDEO_ENCODER_PROFILE_H264_HIGH = 1,
+ D3D12_VIDEO_ENCODER_PROFILE_H264_HIGH_10 = 2
+ } D3D12_VIDEO_ENCODER_PROFILE_H264;
+
+typedef
+enum D3D12_VIDEO_ENCODER_PROFILE_HEVC
+ {
+ D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN = 0,
+ D3D12_VIDEO_ENCODER_PROFILE_HEVC_MAIN10 = 1
+ } D3D12_VIDEO_ENCODER_PROFILE_HEVC;
+
+typedef struct D3D12_VIDEO_ENCODER_PROFILE_DESC
+ {
+ UINT DataSize;
+ union
+ {
+ D3D12_VIDEO_ENCODER_PROFILE_H264 *pH264Profile;
+ D3D12_VIDEO_ENCODER_PROFILE_HEVC *pHEVCProfile;
+ } ;
+ } D3D12_VIDEO_ENCODER_PROFILE_DESC;
+
+typedef
+enum D3D12_VIDEO_ENCODER_LEVELS_H264
+ {
+ D3D12_VIDEO_ENCODER_LEVELS_H264_1 = 0,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_1b = 1,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_11 = 2,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_12 = 3,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_13 = 4,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_2 = 5,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_21 = 6,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_22 = 7,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_3 = 8,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_31 = 9,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_32 = 10,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_4 = 11,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_41 = 12,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_42 = 13,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_5 = 14,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_51 = 15,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_52 = 16,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_6 = 17,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_61 = 18,
+ D3D12_VIDEO_ENCODER_LEVELS_H264_62 = 19
+ } D3D12_VIDEO_ENCODER_LEVELS_H264;
+
+typedef
+enum D3D12_VIDEO_ENCODER_TIER_HEVC
+ {
+ D3D12_VIDEO_ENCODER_TIER_HEVC_MAIN = 0,
+ D3D12_VIDEO_ENCODER_TIER_HEVC_HIGH = 1
+ } D3D12_VIDEO_ENCODER_TIER_HEVC;
+
+typedef
+enum D3D12_VIDEO_ENCODER_LEVELS_HEVC
+ {
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC_1 = 0,
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC_2 = 1,
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC_21 = 2,
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC_3 = 3,
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC_31 = 4,
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC_4 = 5,
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC_41 = 6,
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC_5 = 7,
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC_51 = 8,
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC_52 = 9,
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC_6 = 10,
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC_61 = 11,
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC_62 = 12
+ } D3D12_VIDEO_ENCODER_LEVELS_HEVC;
+
+typedef struct D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC
+ {
+ D3D12_VIDEO_ENCODER_LEVELS_HEVC Level;
+ D3D12_VIDEO_ENCODER_TIER_HEVC Tier;
+ } D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC;
+
+typedef struct D3D12_VIDEO_ENCODER_LEVEL_SETTING
+ {
+ UINT DataSize;
+ union
+ {
+ D3D12_VIDEO_ENCODER_LEVELS_H264 *pH264LevelSetting;
+ D3D12_VIDEO_ENCODER_LEVEL_TIER_CONSTRAINTS_HEVC *pHEVCLevelSetting;
+ } ;
+ } D3D12_VIDEO_ENCODER_LEVEL_SETTING;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_PROFILE_LEVEL
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ D3D12_VIDEO_ENCODER_PROFILE_DESC Profile;
+ BOOL IsSupported;
+ D3D12_VIDEO_ENCODER_LEVEL_SETTING MinSupportedLevel;
+ D3D12_VIDEO_ENCODER_LEVEL_SETTING MaxSupportedLevel;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_PROFILE_LEVEL;
+
+typedef struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC
+ {
+ UINT Width;
+ UINT Height;
+ } D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC;
+
+typedef struct D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC
+ {
+ UINT WidthRatio;
+ UINT HeightRatio;
+ } D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ UINT ResolutionRatiosCount;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION_RATIOS_COUNT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ UINT ResolutionRatiosCount;
+ BOOL IsSupported;
+ D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MinResolutionSupported;
+ D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC MaxResolutionSupported;
+ UINT ResolutionWidthMultipleRequirement;
+ UINT ResolutionHeightMultipleRequirement;
+ _Field_size_full_(ResolutionRatiosCount) D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_RATIO_DESC *pResolutionRatios;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_OUTPUT_RESOLUTION;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_INPUT_FORMAT
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ D3D12_VIDEO_ENCODER_PROFILE_DESC Profile;
+ DXGI_FORMAT Format;
+ BOOL IsSupported;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_INPUT_FORMAT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RATE_CONTROL_MODE
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ D3D12_VIDEO_ENCODER_RATE_CONTROL_MODE RateControlMode;
+ BOOL IsSupported;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_RATE_CONTROL_MODE;
+
+typedef
+enum D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE
+ {
+ D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE_NONE = 0,
+ D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE_ROW_BASED = 1
+ } D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_INTRA_REFRESH_MODE
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ D3D12_VIDEO_ENCODER_PROFILE_DESC Profile;
+ D3D12_VIDEO_ENCODER_LEVEL_SETTING Level;
+ D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE IntraRefreshMode;
+ BOOL IsSupported;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_INTRA_REFRESH_MODE;
+
+typedef
+enum D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE
+ {
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_FULL_FRAME = 0,
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_BYTES_PER_SUBREGION = 1,
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_SQUARE_UNITS_PER_SUBREGION_ROW_UNALIGNED = 2,
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_ROWS_PER_SUBREGION = 3,
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE_UNIFORM_PARTITIONING_SUBREGIONS_PER_FRAME = 4
+ } D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ D3D12_VIDEO_ENCODER_PROFILE_DESC Profile;
+ D3D12_VIDEO_ENCODER_LEVEL_SETTING Level;
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionMode;
+ BOOL IsSupported;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE;
+
+typedef
+enum D3D12_VIDEO_ENCODER_HEAP_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_HEAP_FLAG_NONE = 0
+ } D3D12_VIDEO_ENCODER_HEAP_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_HEAP_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_HEAP_DESC
+ {
+ UINT NodeMask;
+ D3D12_VIDEO_ENCODER_HEAP_FLAGS Flags;
+ D3D12_VIDEO_ENCODER_CODEC EncodeCodec;
+ D3D12_VIDEO_ENCODER_PROFILE_DESC EncodeProfile;
+ D3D12_VIDEO_ENCODER_LEVEL_SETTING EncodeLevel;
+ UINT ResolutionsListCount;
+ _Field_size_full_(ResolutionsListCount) const D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList;
+ } D3D12_VIDEO_ENCODER_HEAP_DESC;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE
+ {
+ D3D12_VIDEO_ENCODER_HEAP_DESC HeapDesc;
+ BOOL IsSupported;
+ UINT64 MemoryPoolL0Size;
+ UINT64 MemoryPoolL1Size;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_HEAP_SIZE;
+
+typedef
+enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_CABAC_ENCODING_SUPPORT = 0x1,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_INTRA_SLICE_CONSTRAINED_ENCODING_SUPPORT = 0x2,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_BFRAME_LTR_COMBINED_SUPPORT = 0x4,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_ADAPTIVE_8x8_TRANSFORM_ENCODING_SUPPORT = 0x8,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_DIRECT_SPATIAL_ENCODING_SUPPORT = 0x10,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_DIRECT_TEMPORAL_ENCODING_SUPPORT = 0x20,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAG_CONSTRAINED_INTRAPREDICTION_SUPPORT = 0x40
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS);
+typedef
+enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_0_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED = 0,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_1_DISABLE_ALL_SLICE_BLOCK_EDGES = 1,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_2_DISABLE_SLICE_BOUNDARIES_BLOCKS = 2,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_3_USE_TWO_STAGE_DEBLOCKING = 3,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_4_DISABLE_CHROMA_BLOCK_EDGES = 4,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES = 5,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING = 6
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES;
+
+typedef
+enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_0_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_0_ALL_LUMA_CHROMA_SLICE_BLOCK_EDGES_ALWAYS_FILTERED ) ,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_1_DISABLE_ALL_SLICE_BLOCK_EDGES = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_1_DISABLE_ALL_SLICE_BLOCK_EDGES ) ,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_2_DISABLE_SLICE_BOUNDARIES_BLOCKS = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_2_DISABLE_SLICE_BOUNDARIES_BLOCKS ) ,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_3_USE_TWO_STAGE_DEBLOCKING = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_3_USE_TWO_STAGE_DEBLOCKING ) ,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_4_DISABLE_CHROMA_BLOCK_EDGES = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_4_DISABLE_CHROMA_BLOCK_EDGES ) ,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_5_DISABLE_CHROMA_BLOCK_EDGES_AND_LUMA_BOUNDARIES ) ,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAG_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING = ( 1 << D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_6_DISABLE_CHROMA_BLOCK_EDGES_AND_USE_LUMA_TWO_STAGE_DEBLOCKING )
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264_FLAGS SupportFlags;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODE_FLAGS DisableDeblockingFilterSupportedModes;
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264;
+
+typedef
+enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_BFRAME_LTR_COMBINED_SUPPORT = 0x1,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_INTRA_SLICE_CONSTRAINED_ENCODING_SUPPORT = 0x2,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_CONSTRAINED_INTRAPREDICTION_SUPPORT = 0x4,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_SAO_FILTER_SUPPORT = 0x8,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_ASYMETRIC_MOTION_PARTITION_SUPPORT = 0x10,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_ASYMETRIC_MOTION_PARTITION_REQUIRED = 0x20,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_TRANSFORM_SKIP_SUPPORT = 0x40,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_DISABLING_LOOP_FILTER_ACROSS_SLICES_SUPPORT = 0x80,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAG_P_FRAMES_IMPLEMENTED_AS_LOW_DELAY_B_FRAMES = 0x100
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS);
+typedef
+enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_8x8 = 0,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_16x16 = 1,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_32x32 = 2,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE_64x64 = 3
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE;
+
+typedef
+enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_4x4 = 0,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_8x8 = 1,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_16x16 = 2,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE_32x32 = 3
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE;
+
+typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC_FLAGS SupportFlags;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MinLumaCodingUnitSize;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MaxLumaCodingUnitSize;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MinLumaTransformUnitSize;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MaxLumaTransformUnitSize;
+ UCHAR max_transform_hierarchy_depth_inter;
+ UCHAR max_transform_hierarchy_depth_intra;
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC;
+
+typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT
+ {
+ UINT DataSize;
+ union
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_H264 *pH264Support;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT_HEVC *pHEVCSupport;
+ } ;
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ D3D12_VIDEO_ENCODER_PROFILE_DESC Profile;
+ BOOL IsSupported;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT CodecSupportLimits;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_CONFIGURATION_SUPPORT;
+
+typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264
+ {
+ UINT MaxL0ReferencesForP;
+ UINT MaxL0ReferencesForB;
+ UINT MaxL1ReferencesForB;
+ UINT MaxLongTermReferences;
+ UINT MaxDPBCapacity;
+ } D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264;
+
+typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC
+ {
+ UINT MaxL0ReferencesForP;
+ UINT MaxL0ReferencesForB;
+ UINT MaxL1ReferencesForB;
+ UINT MaxLongTermReferences;
+ UINT MaxDPBCapacity;
+ } D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC;
+
+typedef struct D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT
+ {
+ UINT DataSize;
+ union
+ {
+ D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_H264 *pH264Support;
+ D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT_HEVC *pHEVCSupport;
+ } ;
+ } D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ D3D12_VIDEO_ENCODER_PROFILE_DESC Profile;
+ BOOL IsSupported;
+ D3D12_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT PictureSupport;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_CODEC_PICTURE_CONTROL_SUPPORT;
+
+typedef
+enum D3D12_VIDEO_ENCODER_SUPPORT_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_GENERAL_SUPPORT_OK = 0x1,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_RECONFIGURATION_AVAILABLE = 0x2,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RESOLUTION_RECONFIGURATION_AVAILABLE = 0x4,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_VBV_SIZE_CONFIG_AVAILABLE = 0x8,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_FRAME_ANALYSIS_AVAILABLE = 0x10,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RECONSTRUCTED_FRAMES_REQUIRE_TEXTURE_ARRAYS = 0x20,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_DELTA_QP_AVAILABLE = 0x40,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_SUBREGION_LAYOUT_RECONFIGURATION_AVAILABLE = 0x80,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_ADJUSTABLE_QP_RANGE_AVAILABLE = 0x100,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_INITIAL_QP_AVAILABLE = 0x200,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_RATE_CONTROL_MAX_FRAME_SIZE_AVAILABLE = 0x400,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_SEQUENCE_GOP_RECONFIGURATION_AVAILABLE = 0x800,
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAG_MOTION_ESTIMATION_PRECISION_MODE_LIMIT_AVAILABLE = 0x1000
+ } D3D12_VIDEO_ENCODER_SUPPORT_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SUPPORT_FLAGS);
+typedef
+enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_USE_CONSTRAINED_INTRAPREDICTION = 0x1,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_USE_ADAPTIVE_8x8_TRANSFORM = 0x2,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_ENABLE_CABAC_ENCODING = 0x4,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAG_ALLOW_REQUEST_INTRA_CONSTRAINED_SLICES = 0x8
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS);
+typedef
+enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES_DISABLED = 0,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES_TEMPORAL = 1,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES_SPATIAL = 2
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES;
+
+typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_FLAGS ConfigurationFlags;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_DIRECT_MODES DirectModeConfig;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264_SLICES_DEBLOCKING_MODES DisableDeblockingFilterConfig;
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264;
+
+typedef
+enum D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_DISABLE_LOOP_FILTER_ACROSS_SLICES = 0x1,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ALLOW_REQUEST_INTRA_CONSTRAINED_SLICES = 0x2,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_SAO_FILTER = 0x4,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_LONG_TERM_REFERENCES = 0x8,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_ASYMETRIC_MOTION_PARTITION = 0x10,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_ENABLE_TRANSFORM_SKIPPING = 0x20,
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAG_USE_CONSTRAINED_INTRAPREDICTION = 0x40
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_FLAGS ConfigurationFlags;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MinLumaCodingUnitSize;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_CUSIZE MaxLumaCodingUnitSize;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MinLumaTransformUnitSize;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC_TUSIZE MaxLumaTransformUnitSize;
+ UCHAR max_transform_hierarchy_depth_inter;
+ UCHAR max_transform_hierarchy_depth_intra;
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC;
+
+typedef struct D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION
+ {
+ UINT DataSize;
+ union
+ {
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_H264 *pH264Config;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION_HEVC *pHEVCConfig;
+ } ;
+ } D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION;
+
+typedef struct D3D12_VIDEO_ENCODER_INTRA_REFRESH
+ {
+ D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE Mode;
+ UINT IntraRefreshDuration;
+ } D3D12_VIDEO_ENCODER_INTRA_REFRESH;
+
+typedef
+enum D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE
+ {
+ D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_MAXIMUM = 0,
+ D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_FULL_PIXEL = 1,
+ D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_HALF_PIXEL = 2,
+ D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE_QUARTER_PIXEL = 3
+ } D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS
+ {
+ UINT MaxSubregionsNumber;
+ UINT MaxIntraRefreshFrameDuration;
+ UINT SubregionBlockPixelsSize;
+ UINT QPMapRegionPixelsSize;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS;
+
+typedef
+enum D3D12_VIDEO_ENCODER_VALIDATION_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAG_CODEC_NOT_SUPPORTED = 0x1,
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAG_INPUT_FORMAT_NOT_SUPPORTED = 0x8,
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAG_CODEC_CONFIGURATION_NOT_SUPPORTED = 0x10,
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RATE_CONTROL_MODE_NOT_SUPPORTED = 0x20,
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RATE_CONTROL_CONFIGURATION_NOT_SUPPORTED = 0x40,
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAG_INTRA_REFRESH_MODE_NOT_SUPPORTED = 0x80,
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAG_SUBREGION_LAYOUT_MODE_NOT_SUPPORTED = 0x100,
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAG_RESOLUTION_NOT_SUPPORTED_IN_LIST = 0x200,
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAG_GOP_STRUCTURE_NOT_SUPPORTED = 0x800
+ } D3D12_VIDEO_ENCODER_VALIDATION_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_VALIDATION_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264
+ {
+ UINT GOPLength;
+ UINT PPicturePeriod;
+ UCHAR pic_order_cnt_type;
+ UCHAR log2_max_frame_num_minus4;
+ UCHAR log2_max_pic_order_cnt_lsb_minus4;
+ } D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264;
+
+typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC
+ {
+ UINT GOPLength;
+ UINT PPicturePeriod;
+ UCHAR log2_max_pic_order_cnt_lsb_minus4;
+ } D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC;
+
+typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE
+ {
+ UINT DataSize;
+ union
+ {
+ D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_H264 *pH264GroupOfPictures;
+ D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE_HEVC *pHEVCGroupOfPictures;
+ } ;
+ } D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ DXGI_FORMAT InputFormat;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration;
+ D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence;
+ D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl;
+ D3D12_VIDEO_ENCODER_INTRA_REFRESH_MODE IntraRefresh;
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SubregionFrameEncoding;
+ UINT ResolutionsListCount;
+ const D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList;
+ UINT MaxReferenceFramesInDPB;
+ D3D12_VIDEO_ENCODER_VALIDATION_FLAGS ValidationFlags;
+ D3D12_VIDEO_ENCODER_SUPPORT_FLAGS SupportFlags;
+ D3D12_VIDEO_ENCODER_PROFILE_DESC SuggestedProfile;
+ D3D12_VIDEO_ENCODER_LEVEL_SETTING SuggestedLevel;
+ _Field_size_full_(ResolutionsListCount) D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOLUTION_SUPPORT_LIMITS *pResolutionDependentSupport;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_SUPPORT;
+
+typedef struct D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS
+ {
+ UINT NodeIndex;
+ D3D12_VIDEO_ENCODER_CODEC Codec;
+ D3D12_VIDEO_ENCODER_PROFILE_DESC Profile;
+ DXGI_FORMAT InputFormat;
+ D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC PictureTargetResolution;
+ BOOL IsSupported;
+ UINT CompressedBitstreamBufferAccessAlignment;
+ UINT EncoderMetadataBufferAccessAlignment;
+ UINT MaxEncoderOutputMetadataBufferSize;
+ } D3D12_FEATURE_DATA_VIDEO_ENCODER_RESOURCE_REQUIREMENTS;
+
+typedef
+enum D3D12_VIDEO_ENCODER_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_FLAG_NONE = 0
+ } D3D12_VIDEO_ENCODER_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_DESC
+ {
+ UINT NodeMask;
+ D3D12_VIDEO_ENCODER_FLAGS Flags;
+ D3D12_VIDEO_ENCODER_CODEC EncodeCodec;
+ D3D12_VIDEO_ENCODER_PROFILE_DESC EncodeProfile;
+ DXGI_FORMAT InputFormat;
+ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION CodecConfiguration;
+ D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE MaxMotionEstimationPrecision;
+ } D3D12_VIDEO_ENCODER_DESC;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0022_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0022_v0_0_s_ifspec;
+
+#ifndef __ID3D12VideoEncoder_INTERFACE_DEFINED__
+#define __ID3D12VideoEncoder_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoEncoder */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoEncoder;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("2E0D212D-8DF9-44A6-A770-BB289B182737")
+ ID3D12VideoEncoder : public ID3D12Pageable
+ {
+ public:
+ virtual UINT STDMETHODCALLTYPE GetNodeMask( void) = 0;
+
+ virtual D3D12_VIDEO_ENCODER_FLAGS STDMETHODCALLTYPE GetEncoderFlags( void) = 0;
+
+ virtual D3D12_VIDEO_ENCODER_CODEC STDMETHODCALLTYPE GetCodec( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetCodecProfile(
+ _Inout_ D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetCodecConfiguration(
+ _Inout_ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION dstCodecConfig) = 0;
+
+ virtual DXGI_FORMAT STDMETHODCALLTYPE GetInputFormat( void) = 0;
+
+ virtual D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE STDMETHODCALLTYPE GetMaxMotionEstimationPrecision( void) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoEncoderVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoEncoder * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoEncoder * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoEncoder * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoEncoder * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoEncoder * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoEncoder * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoEncoder * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoEncoder * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetNodeMask)
+ UINT ( STDMETHODCALLTYPE *GetNodeMask )(
+ ID3D12VideoEncoder * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetEncoderFlags)
+ D3D12_VIDEO_ENCODER_FLAGS ( STDMETHODCALLTYPE *GetEncoderFlags )(
+ ID3D12VideoEncoder * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetCodec)
+ D3D12_VIDEO_ENCODER_CODEC ( STDMETHODCALLTYPE *GetCodec )(
+ ID3D12VideoEncoder * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetCodecProfile)
+ HRESULT ( STDMETHODCALLTYPE *GetCodecProfile )(
+ ID3D12VideoEncoder * This,
+ _Inout_ D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetCodecConfiguration)
+ HRESULT ( STDMETHODCALLTYPE *GetCodecConfiguration )(
+ ID3D12VideoEncoder * This,
+ _Inout_ D3D12_VIDEO_ENCODER_CODEC_CONFIGURATION dstCodecConfig);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetInputFormat)
+ DXGI_FORMAT ( STDMETHODCALLTYPE *GetInputFormat )(
+ ID3D12VideoEncoder * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoder, GetMaxMotionEstimationPrecision)
+ D3D12_VIDEO_ENCODER_MOTION_ESTIMATION_PRECISION_MODE ( STDMETHODCALLTYPE *GetMaxMotionEstimationPrecision )(
+ ID3D12VideoEncoder * This);
+
+ END_INTERFACE
+ } ID3D12VideoEncoderVtbl;
+
+ interface ID3D12VideoEncoder
+ {
+ CONST_VTBL struct ID3D12VideoEncoderVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoEncoder_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoEncoder_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoEncoder_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoEncoder_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoEncoder_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoEncoder_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoEncoder_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoEncoder_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#define ID3D12VideoEncoder_GetNodeMask(This) \
+ ( (This)->lpVtbl -> GetNodeMask(This) )
+
+#define ID3D12VideoEncoder_GetEncoderFlags(This) \
+ ( (This)->lpVtbl -> GetEncoderFlags(This) )
+
+#define ID3D12VideoEncoder_GetCodec(This) \
+ ( (This)->lpVtbl -> GetCodec(This) )
+
+#define ID3D12VideoEncoder_GetCodecProfile(This,dstProfile) \
+ ( (This)->lpVtbl -> GetCodecProfile(This,dstProfile) )
+
+#define ID3D12VideoEncoder_GetCodecConfiguration(This,dstCodecConfig) \
+ ( (This)->lpVtbl -> GetCodecConfiguration(This,dstCodecConfig) )
+
+#define ID3D12VideoEncoder_GetInputFormat(This) \
+ ( (This)->lpVtbl -> GetInputFormat(This) )
+
+#define ID3D12VideoEncoder_GetMaxMotionEstimationPrecision(This) \
+ ( (This)->lpVtbl -> GetMaxMotionEstimationPrecision(This) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoEncoder_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoEncoderHeap_INTERFACE_DEFINED__
+#define __ID3D12VideoEncoderHeap_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoEncoderHeap */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoEncoderHeap;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("22B35D96-876A-44C0-B25E-FB8C9C7F1C4A")
+ ID3D12VideoEncoderHeap : public ID3D12Pageable
+ {
+ public:
+ virtual UINT STDMETHODCALLTYPE GetNodeMask( void) = 0;
+
+ virtual D3D12_VIDEO_ENCODER_HEAP_FLAGS STDMETHODCALLTYPE GetEncoderHeapFlags( void) = 0;
+
+ virtual D3D12_VIDEO_ENCODER_CODEC STDMETHODCALLTYPE GetCodec( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetCodecProfile(
+ _Inout_ D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetCodecLevel(
+ _Inout_ D3D12_VIDEO_ENCODER_LEVEL_SETTING dstLevel) = 0;
+
+ virtual UINT STDMETHODCALLTYPE GetResolutionListCount( void) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetResolutionList(
+ const UINT ResolutionsListCount,
+ _Out_writes_(ResolutionsListCount) D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoEncoderHeapVtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoEncoderHeap * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoEncoderHeap * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoEncoderHeap * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoEncoderHeap * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoEncoderHeap * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoEncoderHeap * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoEncoderHeap * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoEncoderHeap * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetNodeMask)
+ UINT ( STDMETHODCALLTYPE *GetNodeMask )(
+ ID3D12VideoEncoderHeap * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetEncoderHeapFlags)
+ D3D12_VIDEO_ENCODER_HEAP_FLAGS ( STDMETHODCALLTYPE *GetEncoderHeapFlags )(
+ ID3D12VideoEncoderHeap * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetCodec)
+ D3D12_VIDEO_ENCODER_CODEC ( STDMETHODCALLTYPE *GetCodec )(
+ ID3D12VideoEncoderHeap * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetCodecProfile)
+ HRESULT ( STDMETHODCALLTYPE *GetCodecProfile )(
+ ID3D12VideoEncoderHeap * This,
+ _Inout_ D3D12_VIDEO_ENCODER_PROFILE_DESC dstProfile);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetCodecLevel)
+ HRESULT ( STDMETHODCALLTYPE *GetCodecLevel )(
+ ID3D12VideoEncoderHeap * This,
+ _Inout_ D3D12_VIDEO_ENCODER_LEVEL_SETTING dstLevel);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetResolutionListCount)
+ UINT ( STDMETHODCALLTYPE *GetResolutionListCount )(
+ ID3D12VideoEncoderHeap * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncoderHeap, GetResolutionList)
+ HRESULT ( STDMETHODCALLTYPE *GetResolutionList )(
+ ID3D12VideoEncoderHeap * This,
+ const UINT ResolutionsListCount,
+ _Out_writes_(ResolutionsListCount) D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC *pResolutionList);
+
+ END_INTERFACE
+ } ID3D12VideoEncoderHeapVtbl;
+
+ interface ID3D12VideoEncoderHeap
+ {
+ CONST_VTBL struct ID3D12VideoEncoderHeapVtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoEncoderHeap_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoEncoderHeap_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoEncoderHeap_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoEncoderHeap_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoEncoderHeap_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoEncoderHeap_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoEncoderHeap_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoEncoderHeap_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+
+#define ID3D12VideoEncoderHeap_GetNodeMask(This) \
+ ( (This)->lpVtbl -> GetNodeMask(This) )
+
+#define ID3D12VideoEncoderHeap_GetEncoderHeapFlags(This) \
+ ( (This)->lpVtbl -> GetEncoderHeapFlags(This) )
+
+#define ID3D12VideoEncoderHeap_GetCodec(This) \
+ ( (This)->lpVtbl -> GetCodec(This) )
+
+#define ID3D12VideoEncoderHeap_GetCodecProfile(This,dstProfile) \
+ ( (This)->lpVtbl -> GetCodecProfile(This,dstProfile) )
+
+#define ID3D12VideoEncoderHeap_GetCodecLevel(This,dstLevel) \
+ ( (This)->lpVtbl -> GetCodecLevel(This,dstLevel) )
+
+#define ID3D12VideoEncoderHeap_GetResolutionListCount(This) \
+ ( (This)->lpVtbl -> GetResolutionListCount(This) )
+
+#define ID3D12VideoEncoderHeap_GetResolutionList(This,ResolutionsListCount,pResolutionList) \
+ ( (This)->lpVtbl -> GetResolutionList(This,ResolutionsListCount,pResolutionList) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoEncoderHeap_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoDevice3_INTERFACE_DEFINED__
+#define __ID3D12VideoDevice3_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoDevice3 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoDevice3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("4243ADB4-3A32-4666-973C-0CCC5625DC44")
+ ID3D12VideoDevice3 : public ID3D12VideoDevice2
+ {
+ public:
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoEncoder(
+ _In_ const D3D12_VIDEO_ENCODER_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoEncoder) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE CreateVideoEncoderHeap(
+ _In_ const D3D12_VIDEO_ENCODER_HEAP_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoEncoderHeap) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoDevice3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoDevice3 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoDevice3 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoDevice3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CheckFeatureSupport)
+ HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
+ ID3D12VideoDevice3 * This,
+ D3D12_FEATURE_VIDEO FeatureVideo,
+ _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
+ UINT FeatureSupportDataSize);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoder)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )(
+ ID3D12VideoDevice3 * This,
+ _In_ const D3D12_VIDEO_DECODER_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoder);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoDecoderHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )(
+ ID3D12VideoDevice3 * This,
+ _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoderHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice, CreateVideoProcessor)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )(
+ ID3D12VideoDevice3 * This,
+ UINT NodeMask,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc,
+ UINT NumInputStreamDescs,
+ _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoProcessor);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionEstimator)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionEstimator )(
+ ID3D12VideoDevice3 * This,
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoMotionEstimator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice1, CreateVideoMotionVectorHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionVectorHeap )(
+ ID3D12VideoDevice3 * This,
+ _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoMotionVectorHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoDecoder1)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder1 )(
+ ID3D12VideoDevice3 * This,
+ _In_ const D3D12_VIDEO_DECODER_DESC *pDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoder);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoDecoderHeap1)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap1 )(
+ ID3D12VideoDevice3 * This,
+ _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoDecoderHeap);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoProcessor1)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor1 )(
+ ID3D12VideoDevice3 * This,
+ UINT NodeMask,
+ _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc,
+ UINT NumInputStreamDescs,
+ _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoProcessor);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice2, CreateVideoExtensionCommand)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoExtensionCommand )(
+ ID3D12VideoDevice3 * This,
+ _In_ const D3D12_VIDEO_EXTENSION_COMMAND_DESC *pDesc,
+ _In_reads_bytes_(CreationParametersDataSizeInBytes) const void *pCreationParameters,
+ SIZE_T CreationParametersDataSizeInBytes,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoExtensionCommand);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice2, ExecuteExtensionCommand)
+ HRESULT ( STDMETHODCALLTYPE *ExecuteExtensionCommand )(
+ ID3D12VideoDevice3 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters,
+ SIZE_T ExecutionParametersSizeInBytes,
+ _Out_writes_bytes_(OutputDataSizeInBytes) void *pOutputData,
+ SIZE_T OutputDataSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice3, CreateVideoEncoder)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoEncoder )(
+ ID3D12VideoDevice3 * This,
+ _In_ const D3D12_VIDEO_ENCODER_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoEncoder);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoDevice3, CreateVideoEncoderHeap)
+ HRESULT ( STDMETHODCALLTYPE *CreateVideoEncoderHeap )(
+ ID3D12VideoDevice3 * This,
+ _In_ const D3D12_VIDEO_ENCODER_HEAP_DESC *pDesc,
+ _In_ REFIID riid,
+ _COM_Outptr_ void **ppVideoEncoderHeap);
+
+ END_INTERFACE
+ } ID3D12VideoDevice3Vtbl;
+
+ interface ID3D12VideoDevice3
+ {
+ CONST_VTBL struct ID3D12VideoDevice3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoDevice3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoDevice3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoDevice3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoDevice3_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \
+ ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) )
+
+#define ID3D12VideoDevice3_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \
+ ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) )
+
+#define ID3D12VideoDevice3_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \
+ ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) )
+
+#define ID3D12VideoDevice3_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \
+ ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) )
+
+
+#define ID3D12VideoDevice3_CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) \
+ ( (This)->lpVtbl -> CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) )
+
+#define ID3D12VideoDevice3_CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) \
+ ( (This)->lpVtbl -> CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) )
+
+
+#define ID3D12VideoDevice3_CreateVideoDecoder1(This,pDesc,pProtectedResourceSession,riid,ppVideoDecoder) \
+ ( (This)->lpVtbl -> CreateVideoDecoder1(This,pDesc,pProtectedResourceSession,riid,ppVideoDecoder) )
+
+#define ID3D12VideoDevice3_CreateVideoDecoderHeap1(This,pVideoDecoderHeapDesc,pProtectedResourceSession,riid,ppVideoDecoderHeap) \
+ ( (This)->lpVtbl -> CreateVideoDecoderHeap1(This,pVideoDecoderHeapDesc,pProtectedResourceSession,riid,ppVideoDecoderHeap) )
+
+#define ID3D12VideoDevice3_CreateVideoProcessor1(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,pProtectedResourceSession,riid,ppVideoProcessor) \
+ ( (This)->lpVtbl -> CreateVideoProcessor1(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,pProtectedResourceSession,riid,ppVideoProcessor) )
+
+#define ID3D12VideoDevice3_CreateVideoExtensionCommand(This,pDesc,pCreationParameters,CreationParametersDataSizeInBytes,pProtectedResourceSession,riid,ppVideoExtensionCommand) \
+ ( (This)->lpVtbl -> CreateVideoExtensionCommand(This,pDesc,pCreationParameters,CreationParametersDataSizeInBytes,pProtectedResourceSession,riid,ppVideoExtensionCommand) )
+
+#define ID3D12VideoDevice3_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes,pOutputData,OutputDataSizeInBytes) \
+ ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes,pOutputData,OutputDataSizeInBytes) )
+
+
+#define ID3D12VideoDevice3_CreateVideoEncoder(This,pDesc,riid,ppVideoEncoder) \
+ ( (This)->lpVtbl -> CreateVideoEncoder(This,pDesc,riid,ppVideoEncoder) )
+
+#define ID3D12VideoDevice3_CreateVideoEncoderHeap(This,pDesc,riid,ppVideoEncoderHeap) \
+ ( (This)->lpVtbl -> CreateVideoEncoderHeap(This,pDesc,riid,ppVideoEncoderHeap) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoDevice3_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12video_0000_0025 */
+/* [local] */
+
+typedef
+enum D3D12_VIDEO_ENCODER_FRAME_TYPE_H264
+ {
+ D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_I_FRAME = 0,
+ D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_P_FRAME = 1,
+ D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_B_FRAME = 2,
+ D3D12_VIDEO_ENCODER_FRAME_TYPE_H264_IDR_FRAME = 3
+ } D3D12_VIDEO_ENCODER_FRAME_TYPE_H264;
+
+typedef struct D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264
+ {
+ UINT ReconstructedPictureResourceIndex;
+ BOOL IsLongTermReference;
+ UINT LongTermPictureIdx;
+ UINT PictureOrderCountNumber;
+ UINT FrameDecodingOrderNumber;
+ UINT TemporalLayerIndex;
+ } D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264;
+
+typedef
+enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1
+ } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION
+ {
+ UCHAR memory_management_control_operation;
+ UINT difference_of_pic_nums_minus1;
+ UINT long_term_pic_num;
+ UINT long_term_frame_idx;
+ UINT max_long_term_frame_idx_plus1;
+ } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION;
+
+typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION
+ {
+ UCHAR modification_of_pic_nums_idc;
+ UINT abs_diff_pic_num_minus1;
+ UINT long_term_pic_num;
+ } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION;
+
+typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264
+ {
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_FLAGS Flags;
+ D3D12_VIDEO_ENCODER_FRAME_TYPE_H264 FrameType;
+ UINT pic_parameter_set_id;
+ UINT idr_pic_id;
+ UINT PictureOrderCountNumber;
+ UINT FrameDecodingOrderNumber;
+ UINT TemporalLayerIndex;
+ UINT List0ReferenceFramesCount;
+ _Field_size_full_(List0ReferenceFramesCount) UINT *pList0ReferenceFrames;
+ UINT List1ReferenceFramesCount;
+ _Field_size_full_(List1ReferenceFramesCount) UINT *pList1ReferenceFrames;
+ UINT ReferenceFramesReconPictureDescriptorsCount;
+ _Field_size_full_(ReferenceFramesReconPictureDescriptorsCount) D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_H264 *pReferenceFramesReconPictureDescriptors;
+ UCHAR adaptive_ref_pic_marking_mode_flag;
+ UINT RefPicMarkingOperationsCommandsCount;
+ _Field_size_full_(RefPicMarkingOperationsCommandsCount) D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_MARKING_OPERATION *pRefPicMarkingOperationsCommands;
+ UINT List0RefPicModificationsCount;
+ _Field_size_full_(List0RefPicModificationsCount) D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION *pList0RefPicModifications;
+ UINT List1RefPicModificationsCount;
+ _Field_size_full_(List1RefPicModificationsCount) D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264_REFERENCE_PICTURE_LIST_MODIFICATION_OPERATION *pList1RefPicModifications;
+ UINT QPMapValuesCount;
+ _Field_size_full_(QPMapValuesCount) INT8 *pRateControlQPMap;
+ } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264;
+
+typedef
+enum D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC
+ {
+ D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_I_FRAME = 0,
+ D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_P_FRAME = 1,
+ D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_B_FRAME = 2,
+ D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC_IDR_FRAME = 3
+ } D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC;
+
+typedef struct D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC
+ {
+ UINT ReconstructedPictureResourceIndex;
+ BOOL IsRefUsedByCurrentPic;
+ BOOL IsLongTermReference;
+ UINT PictureOrderCountNumber;
+ UINT TemporalLayerIndex;
+ } D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC;
+
+typedef
+enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAG_REQUEST_INTRA_CONSTRAINED_SLICES = 0x1
+ } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC
+ {
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC_FLAGS Flags;
+ D3D12_VIDEO_ENCODER_FRAME_TYPE_HEVC FrameType;
+ UINT slice_pic_parameter_set_id;
+ UINT PictureOrderCountNumber;
+ UINT TemporalLayerIndex;
+ UINT List0ReferenceFramesCount;
+ _Field_size_full_(List0ReferenceFramesCount) UINT *pList0ReferenceFrames;
+ UINT List1ReferenceFramesCount;
+ _Field_size_full_(List1ReferenceFramesCount) UINT *pList1ReferenceFrames;
+ UINT ReferenceFramesReconPictureDescriptorsCount;
+ _Field_size_full_(ReferenceFramesReconPictureDescriptorsCount) D3D12_VIDEO_ENCODER_REFERENCE_PICTURE_DESCRIPTOR_HEVC *pReferenceFramesReconPictureDescriptors;
+ UINT List0RefPicModificationsCount;
+ _Field_size_full_(List0RefPicModificationsCount) UINT *pList0RefPicModifications;
+ UINT List1RefPicModificationsCount;
+ _Field_size_full_(List1RefPicModificationsCount) UINT *pList1RefPicModifications;
+ UINT QPMapValuesCount;
+ _Field_size_full_(QPMapValuesCount) INT8 *pRateControlQPMap;
+ } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC;
+
+typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA
+ {
+ UINT DataSize;
+ union
+ {
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_H264 *pH264PicData;
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_HEVC *pHEVCPicData;
+ } ;
+ } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA;
+
+typedef struct D3D12_VIDEO_ENCODE_REFERENCE_FRAMES
+ {
+ UINT NumTexture2Ds;
+ _Field_size_full_(NumTexture2Ds) ID3D12Resource **ppTexture2Ds;
+ _Field_size_full_(NumTexture2Ds) UINT *pSubresources;
+ } D3D12_VIDEO_ENCODE_REFERENCE_FRAMES;
+
+typedef
+enum D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAG_USED_AS_REFERENCE_PICTURE = 0x1
+ } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC
+ {
+ UINT IntraRefreshFrameIndex;
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_FLAGS Flags;
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA PictureControlCodecData;
+ D3D12_VIDEO_ENCODE_REFERENCE_FRAMES ReferenceFrames;
+ } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC;
+
+typedef
+enum D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_NONE = 0,
+ D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_RESOLUTION_CHANGE = 0x1,
+ D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_RATE_CONTROL_CHANGE = 0x2,
+ D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_SUBREGION_LAYOUT_CHANGE = 0x4,
+ D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_REQUEST_INTRA_REFRESH = 0x8,
+ D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAG_GOP_SEQUENCE_CHANGE = 0x10
+ } D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES
+ {
+ union
+ {
+ UINT MaxBytesPerSlice;
+ UINT NumberOfCodingUnitsPerSlice;
+ UINT NumberOfRowsPerSlice;
+ UINT NumberOfSlicesPerFrame;
+ } ;
+ } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES;
+
+typedef struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA
+ {
+ UINT DataSize;
+ union
+ {
+ const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_H264;
+ const D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA_SLICES *pSlicesPartition_HEVC;
+ } ;
+ } D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA;
+
+typedef struct D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC
+ {
+ D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_FLAGS Flags;
+ D3D12_VIDEO_ENCODER_INTRA_REFRESH IntraRefreshConfig;
+ D3D12_VIDEO_ENCODER_RATE_CONTROL RateControl;
+ D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC PictureTargetResolution;
+ D3D12_VIDEO_ENCODER_FRAME_SUBREGION_LAYOUT_MODE SelectedLayoutMode;
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_SUBREGIONS_LAYOUT_DATA FrameSubregionsLayoutData;
+ D3D12_VIDEO_ENCODER_SEQUENCE_GOP_STRUCTURE CodecGopSequence;
+ } D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC;
+
+typedef struct D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS
+ {
+ D3D12_VIDEO_ENCODER_SEQUENCE_CONTROL_DESC SequenceControlDesc;
+ D3D12_VIDEO_ENCODER_PICTURE_CONTROL_DESC PictureControlDesc;
+ ID3D12Resource *pInputFrame;
+ UINT InputFrameSubresource;
+ UINT CurrentFrameBitstreamMetadataSize;
+ } D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS;
+
+typedef struct D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM
+ {
+ ID3D12Resource *pBuffer;
+ UINT64 FrameStartOffset;
+ } D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM;
+
+typedef struct D3D12_VIDEO_ENCODER_RECONSTRUCTED_PICTURE
+ {
+ ID3D12Resource *pReconstructedPicture;
+ UINT ReconstructedPictureSubresource;
+ } D3D12_VIDEO_ENCODER_RECONSTRUCTED_PICTURE;
+
+typedef struct D3D12_VIDEO_ENCODER_FRAME_SUBREGION_METADATA
+ {
+ UINT64 bSize;
+ UINT64 bStartOffset;
+ UINT64 bHeaderSize;
+ } D3D12_VIDEO_ENCODER_FRAME_SUBREGION_METADATA;
+
+typedef
+enum D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS
+ {
+ D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_NO_ERROR = 0,
+ D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_CODEC_PICTURE_CONTROL_NOT_SUPPORTED = 0x1,
+ D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_SUBREGION_LAYOUT_CONFIGURATION_NOT_SUPPORTED = 0x2,
+ D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_INVALID_REFERENCE_PICTURES = 0x4,
+ D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_RECONFIGURATION_REQUEST_NOT_SUPPORTED = 0x8,
+ D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAG_INVALID_METADATA_BUFFER_SOURCE = 0x10
+ } D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS;
+
+DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_ENCODER_ENCODE_ERROR_FLAGS);
+typedef struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS
+ {
+ UINT64 AverageQP;
+ UINT64 IntraCodingUnitsCount;
+ UINT64 InterCodingUnitsCount;
+ UINT64 SkipCodingUnitsCount;
+ UINT64 AverageMotionEstimationXDirection;
+ UINT64 AverageMotionEstimationYDirection;
+ } D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS;
+
+typedef struct D3D12_VIDEO_ENCODER_OUTPUT_METADATA
+ {
+ UINT64 EncodeErrorFlags;
+ D3D12_VIDEO_ENCODER_OUTPUT_METADATA_STATISTICS EncodeStats;
+ UINT64 EncodedBitstreamWrittenBytesCount;
+ UINT64 WrittenSubregionsCount;
+ } D3D12_VIDEO_ENCODER_OUTPUT_METADATA;
+
+typedef struct D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER
+ {
+ ID3D12Resource *pBuffer;
+ UINT64 Offset;
+ } D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER;
+
+typedef struct D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS
+ {
+ D3D12_VIDEO_ENCODER_CODEC EncoderCodec;
+ D3D12_VIDEO_ENCODER_PROFILE_DESC EncoderProfile;
+ DXGI_FORMAT EncoderInputFormat;
+ D3D12_VIDEO_ENCODER_PICTURE_RESOLUTION_DESC EncodedPictureEffectiveResolution;
+ D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER HWLayoutMetadata;
+ } D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS;
+
+typedef struct D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS
+ {
+ D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER ResolvedLayoutMetadata;
+ } D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS;
+
+typedef struct D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS
+ {
+ D3D12_VIDEO_ENCODER_COMPRESSED_BITSTREAM Bitstream;
+ D3D12_VIDEO_ENCODER_RECONSTRUCTED_PICTURE ReconstructedPicture;
+ D3D12_VIDEO_ENCODER_ENCODE_OPERATION_METADATA_BUFFER EncoderOutputMetadata;
+ } D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS;
+
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0025_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0025_v0_0_s_ifspec;
+
+#ifndef __ID3D12VideoEncodeCommandList2_INTERFACE_DEFINED__
+#define __ID3D12VideoEncodeCommandList2_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoEncodeCommandList2 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoEncodeCommandList2;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("895491e2-e701-46a9-9a1f-8d3480ed867a")
+ ID3D12VideoEncodeCommandList2 : public ID3D12VideoEncodeCommandList1
+ {
+ public:
+ virtual void STDMETHODCALLTYPE EncodeFrame(
+ _In_ ID3D12VideoEncoder *pEncoder,
+ _In_ ID3D12VideoEncoderHeap *pHeap,
+ _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS *pInputArguments,
+ _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS *pOutputArguments) = 0;
+
+ virtual void STDMETHODCALLTYPE ResolveEncoderOutputMetadata(
+ _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS *pInputArguments,
+ _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS *pOutputArguments) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoEncodeCommandList2Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoEncodeCommandList2 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoEncodeCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoEncodeCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoEncodeCommandList2 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12VideoEncodeCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12VideoEncodeCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ ID3D12CommandAllocator *pAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12VideoEncodeCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12VideoEncodeCommandList2 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12VideoEncodeCommandList2 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12VideoEncodeCommandList2 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EstimateMotion)
+ void ( STDMETHODCALLTYPE *EstimateMotion )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ ID3D12VideoMotionEstimator *pMotionEstimator,
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments,
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveMotionVectorHeap)
+ void ( STDMETHODCALLTYPE *ResolveMotionVectorHeap )(
+ ID3D12VideoEncodeCommandList2 * This,
+ const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments,
+ const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12VideoEncodeCommandList2 * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetProtectedResourceSession)
+ void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, InitializeExtensionCommand)
+ void ( STDMETHODCALLTYPE *InitializeExtensionCommand )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters,
+ SIZE_T InitializationParametersSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, ExecuteExtensionCommand)
+ void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters,
+ SIZE_T ExecutionParametersSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList2, EncodeFrame)
+ void ( STDMETHODCALLTYPE *EncodeFrame )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ ID3D12VideoEncoder *pEncoder,
+ _In_ ID3D12VideoEncoderHeap *pHeap,
+ _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS *pInputArguments,
+ _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS *pOutputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList2, ResolveEncoderOutputMetadata)
+ void ( STDMETHODCALLTYPE *ResolveEncoderOutputMetadata )(
+ ID3D12VideoEncodeCommandList2 * This,
+ _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS *pInputArguments,
+ _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS *pOutputArguments);
+
+ END_INTERFACE
+ } ID3D12VideoEncodeCommandList2Vtbl;
+
+ interface ID3D12VideoEncodeCommandList2
+ {
+ CONST_VTBL struct ID3D12VideoEncodeCommandList2Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoEncodeCommandList2_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoEncodeCommandList2_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoEncodeCommandList2_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoEncodeCommandList2_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoEncodeCommandList2_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoEncodeCommandList2_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoEncodeCommandList2_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoEncodeCommandList2_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12VideoEncodeCommandList2_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12VideoEncodeCommandList2_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12VideoEncodeCommandList2_Reset(This,pAllocator) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator) )
+
+#define ID3D12VideoEncodeCommandList2_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D12VideoEncodeCommandList2_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12VideoEncodeCommandList2_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12VideoEncodeCommandList2_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoEncodeCommandList2_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoEncodeCommandList2_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12VideoEncodeCommandList2_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12VideoEncodeCommandList2_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12VideoEncodeCommandList2_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12VideoEncodeCommandList2_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12VideoEncodeCommandList2_EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) )
+
+#define ID3D12VideoEncodeCommandList2_ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) )
+
+#define ID3D12VideoEncodeCommandList2_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+#define ID3D12VideoEncodeCommandList2_SetProtectedResourceSession(This,pProtectedResourceSession) \
+ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
+
+
+#define ID3D12VideoEncodeCommandList2_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \
+ ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) )
+
+#define ID3D12VideoEncodeCommandList2_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \
+ ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) )
+
+
+#define ID3D12VideoEncodeCommandList2_EncodeFrame(This,pEncoder,pHeap,pInputArguments,pOutputArguments) \
+ ( (This)->lpVtbl -> EncodeFrame(This,pEncoder,pHeap,pInputArguments,pOutputArguments) )
+
+#define ID3D12VideoEncodeCommandList2_ResolveEncoderOutputMetadata(This,pInputArguments,pOutputArguments) \
+ ( (This)->lpVtbl -> ResolveEncoderOutputMetadata(This,pInputArguments,pOutputArguments) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoEncodeCommandList2_INTERFACE_DEFINED__ */
+
+
+#ifndef __ID3D12VideoEncodeCommandList3_INTERFACE_DEFINED__
+#define __ID3D12VideoEncodeCommandList3_INTERFACE_DEFINED__
+
+/* interface ID3D12VideoEncodeCommandList3 */
+/* [unique][local][object][uuid] */
+
+
+EXTERN_C const IID IID_ID3D12VideoEncodeCommandList3;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+
+ MIDL_INTERFACE("7f027b22-1515-4e85-aa0d-026486580576")
+ ID3D12VideoEncodeCommandList3 : public ID3D12VideoEncodeCommandList2
+ {
+ public:
+ virtual void STDMETHODCALLTYPE Barrier(
+ UINT32 NumBarrierGroups,
+ _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups) = 0;
+
+ };
+
+
+#else /* C style interface */
+
+ typedef struct ID3D12VideoEncodeCommandList3Vtbl
+ {
+ BEGIN_INTERFACE
+
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
+ HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
+ ID3D12VideoEncodeCommandList3 * This,
+ REFIID riid,
+ _COM_Outptr_ void **ppvObject);
+
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
+ ULONG ( STDMETHODCALLTYPE *AddRef )(
+ ID3D12VideoEncodeCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(IUnknown, Release)
+ ULONG ( STDMETHODCALLTYPE *Release )(
+ ID3D12VideoEncodeCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, GetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ REFGUID guid,
+ _Inout_ UINT *pDataSize,
+ _Out_writes_bytes_opt_( *pDataSize ) void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateData)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ REFGUID guid,
+ _In_ UINT DataSize,
+ _In_reads_bytes_opt_( DataSize ) const void *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetPrivateDataInterface)
+ HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ REFGUID guid,
+ _In_opt_ const IUnknown *pData);
+
+ DECLSPEC_XFGVIRT(ID3D12Object, SetName)
+ HRESULT ( STDMETHODCALLTYPE *SetName )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_z_ LPCWSTR Name);
+
+ DECLSPEC_XFGVIRT(ID3D12DeviceChild, GetDevice)
+ HRESULT ( STDMETHODCALLTYPE *GetDevice )(
+ ID3D12VideoEncodeCommandList3 * This,
+ REFIID riid,
+ _COM_Outptr_opt_ void **ppvDevice);
+
+ DECLSPEC_XFGVIRT(ID3D12CommandList, GetType)
+ D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
+ ID3D12VideoEncodeCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Close)
+ HRESULT ( STDMETHODCALLTYPE *Close )(
+ ID3D12VideoEncodeCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, Reset)
+ HRESULT ( STDMETHODCALLTYPE *Reset )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ ID3D12CommandAllocator *pAllocator);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ClearState)
+ void ( STDMETHODCALLTYPE *ClearState )(
+ ID3D12VideoEncodeCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResourceBarrier)
+ void ( STDMETHODCALLTYPE *ResourceBarrier )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ UINT NumBarriers,
+ _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, DiscardResource)
+ void ( STDMETHODCALLTYPE *DiscardResource )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ ID3D12Resource *pResource,
+ _In_opt_ const D3D12_DISCARD_REGION *pRegion);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginQuery)
+ void ( STDMETHODCALLTYPE *BeginQuery )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndQuery)
+ void ( STDMETHODCALLTYPE *EndQuery )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT Index);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveQueryData)
+ void ( STDMETHODCALLTYPE *ResolveQueryData )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ ID3D12QueryHeap *pQueryHeap,
+ _In_ D3D12_QUERY_TYPE Type,
+ _In_ UINT StartIndex,
+ _In_ UINT NumQueries,
+ _In_ ID3D12Resource *pDestinationBuffer,
+ _In_ UINT64 AlignedDestinationBufferOffset);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetPredication)
+ void ( STDMETHODCALLTYPE *SetPredication )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_opt_ ID3D12Resource *pBuffer,
+ _In_ UINT64 AlignedBufferOffset,
+ _In_ D3D12_PREDICATION_OP Operation);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetMarker)
+ void ( STDMETHODCALLTYPE *SetMarker )(
+ ID3D12VideoEncodeCommandList3 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, BeginEvent)
+ void ( STDMETHODCALLTYPE *BeginEvent )(
+ ID3D12VideoEncodeCommandList3 * This,
+ UINT Metadata,
+ _In_reads_bytes_opt_(Size) const void *pData,
+ UINT Size);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EndEvent)
+ void ( STDMETHODCALLTYPE *EndEvent )(
+ ID3D12VideoEncodeCommandList3 * This);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, EstimateMotion)
+ void ( STDMETHODCALLTYPE *EstimateMotion )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ ID3D12VideoMotionEstimator *pMotionEstimator,
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments,
+ _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, ResolveMotionVectorHeap)
+ void ( STDMETHODCALLTYPE *ResolveMotionVectorHeap )(
+ ID3D12VideoEncodeCommandList3 * This,
+ const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments,
+ const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, WriteBufferImmediate)
+ void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
+ ID3D12VideoEncodeCommandList3 * This,
+ UINT Count,
+ _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
+ _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList, SetProtectedResourceSession)
+ void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, InitializeExtensionCommand)
+ void ( STDMETHODCALLTYPE *InitializeExtensionCommand )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(InitializationParametersSizeInBytes) const void *pInitializationParameters,
+ SIZE_T InitializationParametersSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList1, ExecuteExtensionCommand)
+ void ( STDMETHODCALLTYPE *ExecuteExtensionCommand )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ ID3D12VideoExtensionCommand *pExtensionCommand,
+ _In_reads_bytes_(ExecutionParametersSizeInBytes) const void *pExecutionParameters,
+ SIZE_T ExecutionParametersSizeInBytes);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList2, EncodeFrame)
+ void ( STDMETHODCALLTYPE *EncodeFrame )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ ID3D12VideoEncoder *pEncoder,
+ _In_ ID3D12VideoEncoderHeap *pHeap,
+ _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_INPUT_ARGUMENTS *pInputArguments,
+ _In_ const D3D12_VIDEO_ENCODER_ENCODEFRAME_OUTPUT_ARGUMENTS *pOutputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList2, ResolveEncoderOutputMetadata)
+ void ( STDMETHODCALLTYPE *ResolveEncoderOutputMetadata )(
+ ID3D12VideoEncodeCommandList3 * This,
+ _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_INPUT_ARGUMENTS *pInputArguments,
+ _In_ const D3D12_VIDEO_ENCODER_RESOLVE_METADATA_OUTPUT_ARGUMENTS *pOutputArguments);
+
+ DECLSPEC_XFGVIRT(ID3D12VideoEncodeCommandList3, Barrier)
+ void ( STDMETHODCALLTYPE *Barrier )(
+ ID3D12VideoEncodeCommandList3 * This,
+ UINT32 NumBarrierGroups,
+ _In_reads_(NumBarrierGroups) const D3D12_BARRIER_GROUP *pBarrierGroups);
+
+ END_INTERFACE
+ } ID3D12VideoEncodeCommandList3Vtbl;
+
+ interface ID3D12VideoEncodeCommandList3
+ {
+ CONST_VTBL struct ID3D12VideoEncodeCommandList3Vtbl *lpVtbl;
+ };
+
+
+
+#ifdef COBJMACROS
+
+
+#define ID3D12VideoEncodeCommandList3_QueryInterface(This,riid,ppvObject) \
+ ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
+
+#define ID3D12VideoEncodeCommandList3_AddRef(This) \
+ ( (This)->lpVtbl -> AddRef(This) )
+
+#define ID3D12VideoEncodeCommandList3_Release(This) \
+ ( (This)->lpVtbl -> Release(This) )
+
+
+#define ID3D12VideoEncodeCommandList3_GetPrivateData(This,guid,pDataSize,pData) \
+ ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
+
+#define ID3D12VideoEncodeCommandList3_SetPrivateData(This,guid,DataSize,pData) \
+ ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
+
+#define ID3D12VideoEncodeCommandList3_SetPrivateDataInterface(This,guid,pData) \
+ ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
+
+#define ID3D12VideoEncodeCommandList3_SetName(This,Name) \
+ ( (This)->lpVtbl -> SetName(This,Name) )
+
+
+#define ID3D12VideoEncodeCommandList3_GetDevice(This,riid,ppvDevice) \
+ ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
+
+
+#define ID3D12VideoEncodeCommandList3_GetType(This) \
+ ( (This)->lpVtbl -> GetType(This) )
+
+
+#define ID3D12VideoEncodeCommandList3_Close(This) \
+ ( (This)->lpVtbl -> Close(This) )
+
+#define ID3D12VideoEncodeCommandList3_Reset(This,pAllocator) \
+ ( (This)->lpVtbl -> Reset(This,pAllocator) )
+
+#define ID3D12VideoEncodeCommandList3_ClearState(This) \
+ ( (This)->lpVtbl -> ClearState(This) )
+
+#define ID3D12VideoEncodeCommandList3_ResourceBarrier(This,NumBarriers,pBarriers) \
+ ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
+
+#define ID3D12VideoEncodeCommandList3_DiscardResource(This,pResource,pRegion) \
+ ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
+
+#define ID3D12VideoEncodeCommandList3_BeginQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoEncodeCommandList3_EndQuery(This,pQueryHeap,Type,Index) \
+ ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
+
+#define ID3D12VideoEncodeCommandList3_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
+ ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
+
+#define ID3D12VideoEncodeCommandList3_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
+ ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
+
+#define ID3D12VideoEncodeCommandList3_SetMarker(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
+
+#define ID3D12VideoEncodeCommandList3_BeginEvent(This,Metadata,pData,Size) \
+ ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
+
+#define ID3D12VideoEncodeCommandList3_EndEvent(This) \
+ ( (This)->lpVtbl -> EndEvent(This) )
+
+#define ID3D12VideoEncodeCommandList3_EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) )
+
+#define ID3D12VideoEncodeCommandList3_ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) \
+ ( (This)->lpVtbl -> ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) )
+
+#define ID3D12VideoEncodeCommandList3_WriteBufferImmediate(This,Count,pParams,pModes) \
+ ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
+
+#define ID3D12VideoEncodeCommandList3_SetProtectedResourceSession(This,pProtectedResourceSession) \
+ ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
+
+
+#define ID3D12VideoEncodeCommandList3_InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) \
+ ( (This)->lpVtbl -> InitializeExtensionCommand(This,pExtensionCommand,pInitializationParameters,InitializationParametersSizeInBytes) )
+
+#define ID3D12VideoEncodeCommandList3_ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) \
+ ( (This)->lpVtbl -> ExecuteExtensionCommand(This,pExtensionCommand,pExecutionParameters,ExecutionParametersSizeInBytes) )
+
+
+#define ID3D12VideoEncodeCommandList3_EncodeFrame(This,pEncoder,pHeap,pInputArguments,pOutputArguments) \
+ ( (This)->lpVtbl -> EncodeFrame(This,pEncoder,pHeap,pInputArguments,pOutputArguments) )
+
+#define ID3D12VideoEncodeCommandList3_ResolveEncoderOutputMetadata(This,pInputArguments,pOutputArguments) \
+ ( (This)->lpVtbl -> ResolveEncoderOutputMetadata(This,pInputArguments,pOutputArguments) )
+
+
+#define ID3D12VideoEncodeCommandList3_Barrier(This,NumBarrierGroups,pBarrierGroups) \
+ ( (This)->lpVtbl -> Barrier(This,NumBarrierGroups,pBarrierGroups) )
+
+#endif /* COBJMACROS */
+
+
+#endif /* C style interface */
+
+
+
+
+#endif /* __ID3D12VideoEncodeCommandList3_INTERFACE_DEFINED__ */
+
+
+/* interface __MIDL_itf_d3d12video_0000_0027 */
+/* [local] */
+
+#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_GAMES) */
+#pragma endregion
+DEFINE_GUID(IID_ID3D12VideoDecoderHeap,0x0946B7C9,0xEBF6,0x4047,0xBB,0x73,0x86,0x83,0xE2,0x7D,0xBB,0x1F);
+DEFINE_GUID(IID_ID3D12VideoDevice,0x1F052807,0x0B46,0x4ACC,0x8A,0x89,0x36,0x4F,0x79,0x37,0x18,0xA4);
+DEFINE_GUID(IID_ID3D12VideoDecoder,0xC59B6BDC,0x7720,0x4074,0xA1,0x36,0x17,0xA1,0x56,0x03,0x74,0x70);
+DEFINE_GUID(IID_ID3D12VideoProcessor,0x304FDB32,0xBEDE,0x410A,0x85,0x45,0x94,0x3A,0xC6,0xA4,0x61,0x38);
+DEFINE_GUID(IID_ID3D12VideoDecodeCommandList,0x3B60536E,0xAD29,0x4E64,0xA2,0x69,0xF8,0x53,0x83,0x7E,0x5E,0x53);
+DEFINE_GUID(IID_ID3D12VideoProcessCommandList,0xAEB2543A,0x167F,0x4682,0xAC,0xC8,0xD1,0x59,0xED,0x4A,0x62,0x09);
+DEFINE_GUID(IID_ID3D12VideoDecodeCommandList1,0xD52F011B,0xB56E,0x453C,0xA0,0x5A,0xA7,0xF3,0x11,0xC8,0xF4,0x72);
+DEFINE_GUID(IID_ID3D12VideoProcessCommandList1,0x542C5C4D,0x7596,0x434F,0x8C,0x93,0x4E,0xFA,0x67,0x66,0xF2,0x67);
+DEFINE_GUID(IID_ID3D12VideoMotionEstimator,0x33FDAE0E,0x098B,0x428F,0x87,0xBB,0x34,0xB6,0x95,0xDE,0x08,0xF8);
+DEFINE_GUID(IID_ID3D12VideoMotionVectorHeap,0x5BE17987,0x743A,0x4061,0x83,0x4B,0x23,0xD2,0x2D,0xAE,0xA5,0x05);
+DEFINE_GUID(IID_ID3D12VideoDevice1,0x981611AD,0xA144,0x4C83,0x98,0x90,0xF3,0x0E,0x26,0xD6,0x58,0xAB);
+DEFINE_GUID(IID_ID3D12VideoEncodeCommandList,0x8455293A,0x0CBD,0x4831,0x9B,0x39,0xFB,0xDB,0xAB,0x72,0x47,0x23);
+DEFINE_GUID(IID_ID3D12VideoDecoder1,0x79A2E5FB,0xCCD2,0x469A,0x9F,0xDE,0x19,0x5D,0x10,0x95,0x1F,0x7E);
+DEFINE_GUID(IID_ID3D12VideoDecoderHeap1,0xDA1D98C5,0x539F,0x41B2,0xBF,0x6B,0x11,0x98,0xA0,0x3B,0x6D,0x26);
+DEFINE_GUID(IID_ID3D12VideoProcessor1,0xF3CFE615,0x553F,0x425C,0x86,0xD8,0xEE,0x8C,0x1B,0x1F,0xB0,0x1C);
+DEFINE_GUID(IID_ID3D12VideoExtensionCommand,0x554E41E8,0xAE8E,0x4A8C,0xB7,0xD2,0x5B,0x4F,0x27,0x4A,0x30,0xE4);
+DEFINE_GUID(IID_ID3D12VideoDevice2,0xF019AC49,0xF838,0x4A95,0x9B,0x17,0x57,0x94,0x37,0xC8,0xF5,0x13);
+DEFINE_GUID(IID_ID3D12VideoDecodeCommandList2,0x6e120880,0xc114,0x4153,0x80,0x36,0xd2,0x47,0x05,0x1e,0x17,0x29);
+DEFINE_GUID(IID_ID3D12VideoDecodeCommandList3,0x2aee8c37,0x9562,0x42da,0x8a,0xbf,0x61,0xef,0xeb,0x2e,0x45,0x13);
+DEFINE_GUID(IID_ID3D12VideoProcessCommandList2,0xdb525ae4,0x6ad6,0x473c,0xba,0xa7,0x59,0xb2,0xe3,0x70,0x82,0xe4);
+DEFINE_GUID(IID_ID3D12VideoProcessCommandList3,0x1a0a4ca4,0x9f08,0x40ce,0x95,0x58,0xb4,0x11,0xfd,0x26,0x66,0xff);
+DEFINE_GUID(IID_ID3D12VideoEncodeCommandList1,0x94971eca,0x2bdb,0x4769,0x88,0xcf,0x36,0x75,0xea,0x75,0x7e,0xbc);
+DEFINE_GUID(IID_ID3D12VideoEncoder,0x2E0D212D,0x8DF9,0x44A6,0xA7,0x70,0xBB,0x28,0x9B,0x18,0x27,0x37);
+DEFINE_GUID(IID_ID3D12VideoEncoderHeap,0x22B35D96,0x876A,0x44C0,0xB2,0x5E,0xFB,0x8C,0x9C,0x7F,0x1C,0x4A);
+DEFINE_GUID(IID_ID3D12VideoDevice3,0x4243ADB4,0x3A32,0x4666,0x97,0x3C,0x0C,0xCC,0x56,0x25,0xDC,0x44);
+DEFINE_GUID(IID_ID3D12VideoEncodeCommandList2,0x895491e2,0xe701,0x46a9,0x9a,0x1f,0x8d,0x34,0x80,0xed,0x86,0x7a);
+DEFINE_GUID(IID_ID3D12VideoEncodeCommandList3,0x7f027b22,0x1515,0x4e85,0xaa,0x0d,0x02,0x64,0x86,0x58,0x05,0x76);
+
+
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0027_v0_0_c_ifspec;
+extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0027_v0_0_s_ifspec;
+
+/* Additional Prototypes for ALL interfaces */
+
+/* end of Additional Prototypes */
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d9.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d9.h
index f6e532b71bc..3a604072256 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d9.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d9.h
@@ -42,7 +42,7 @@
#include <windows.h>
-#if !defined(HMONITOR_DECLARED) && (WINVER < 0x0500)
+#if !defined(HMONITOR_DECLARED) && (!defined(WINVER) || WINVER < 0x0500)
#define HMONITOR_DECLARED
DECLARE_HANDLE(HMONITOR);
#endif
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d9caps.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d9caps.h
index 8298cc4f558..8298cc4f558 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d9caps.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d9caps.h
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d9types.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d9types.h
index d16102bdf54..d16102bdf54 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d9types.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3d9types.h
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3dcommon.h
index 2766cfb6282..f7e455dd551 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcommon.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3dcommon.h
@@ -1,16 +1,22 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ * Licensed under the MIT license
+ *
+ *-------------------------------------------------------------------------------------*/
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
- /* File created by MIDL compiler version 8.01.0622 */
+ /* File created by MIDL compiler version 8.01.0628 */
/* @@MIDL_FILE_HEADING( ) */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
@@ -37,59 +43,13 @@
#pragma once
#endif
-#if defined(_MSC_VER) && _MSC_VER <= 1600
-#ifndef VS2008_SAL_COMPAT
-#define VS2008_SAL_COMPAT
-// BK - SAL compatibility for VS2008
-
-#if _MSC_VER < 1600
-#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
- extern "C++" { \
- inline ENUMTYPE operator | (ENUMTYPE _a, ENUMTYPE _b) { return ENUMTYPE ( ( (int) _a) | ( (int)_b) ); } \
- inline ENUMTYPE operator |= (ENUMTYPE &_a, ENUMTYPE _b) { return (ENUMTYPE &)( ( (int &)_a) |= ( (int)_b) ); } \
- inline ENUMTYPE operator & (ENUMTYPE _a, ENUMTYPE _b) { return ENUMTYPE ( ( (int) _a) & ( (int)_b) ); } \
- inline ENUMTYPE operator &= (ENUMTYPE &_a, ENUMTYPE _b) { return (ENUMTYPE &)( ( (int &)_a) &= ( (int)_b) ); } \
- inline ENUMTYPE operator ~ (ENUMTYPE _a) { return (ENUMTYPE) (~( (int) _a) ); } \
- inline ENUMTYPE operator ^ (ENUMTYPE _a, ENUMTYPE _b) { return ENUMTYPE ( ( (int) _a) ^ ( (int)_b) ); } \
- inline ENUMTYPE operator ^= (ENUMTYPE &_a, ENUMTYPE _b) { return (ENUMTYPE &)( ( (int &)_a) ^= ( (int)_b) ); } \
- }
-#endif // _MSC_VER < 1600
-
-#undef _Out_
-#define _Out_
-#undef _In_
-#define _In_
-#undef _Always_
-#define _Always_(annos)
-#define _In_reads_(size)
-#define _In_reads_opt_(size)
-#define _In_reads_bytes_(size)
-#define _In_reads_bytes_opt_(size)
-#define _Inout_updates_bytes_(size)
-#define _Out_writes_(size)
-#define _Out_writes_opt_(size)
-#define _Out_writes_to_opt_(size,count)
-#define _Out_writes_bytes_(size)
-#define _Out_writes_bytes_opt_(size)
-#define _Out_writes_bytes_to_(size,count)
-#define _Outptr_
-#define _Outptr_opt_
-#define _Outptr_opt_result_maybenull_
-#define _Outptr_opt_result_bytebuffer_(size)
-#define _Outptr_result_maybenull_
-#define _Outptr_result_bytebuffer_(size)
-#define _Out_writes_all_opt_(size)
-#define _COM_Outptr_
-#define _COM_Outptr_opt_
-#define _COM_Outptr_opt_result_maybenull_
-#define _Field_size_(size)
-#define _Field_size_full_(size)
-#define _Field_size_opt_(size)
-#define _Field_size_bytes_full_(size)
-#define nullptr NULL
-
-#endif // BK - VS2008_SAL_COMPAT
-#endif //
+#ifndef DECLSPEC_XFGVIRT
+#if defined(_CONTROL_FLOW_GUARD_XFG)
+#define DECLSPEC_XFGVIRT(base, func) __declspec(xfg_virtual(base, func))
+#else
+#define DECLSPEC_XFGVIRT(base, func)
+#endif
+#endif
/* Forward Declarations */
@@ -133,6 +93,7 @@ enum D3D_DRIVER_TYPE
typedef
enum D3D_FEATURE_LEVEL
{
+ D3D_FEATURE_LEVEL_1_0_CORE = 0x1000,
D3D_FEATURE_LEVEL_9_1 = 0x9100,
D3D_FEATURE_LEVEL_9_2 = 0x9200,
D3D_FEATURE_LEVEL_9_3 = 0x9300,
@@ -141,7 +102,8 @@ enum D3D_FEATURE_LEVEL
D3D_FEATURE_LEVEL_11_0 = 0xb000,
D3D_FEATURE_LEVEL_11_1 = 0xb100,
D3D_FEATURE_LEVEL_12_0 = 0xc000,
- D3D_FEATURE_LEVEL_12_1 = 0xc100
+ D3D_FEATURE_LEVEL_12_1 = 0xc100,
+ D3D_FEATURE_LEVEL_12_2 = 0xc200
} D3D_FEATURE_LEVEL;
#define D3D_FL9_1_REQ_TEXTURE1D_U_DIMENSION 2048
@@ -168,6 +130,7 @@ enum D3D_PRIMITIVE_TOPOLOGY
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP = 3,
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST = 4,
D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP = 5,
+ D3D_PRIMITIVE_TOPOLOGY_TRIANGLEFAN = 6,
D3D_PRIMITIVE_TOPOLOGY_LINELIST_ADJ = 10,
D3D_PRIMITIVE_TOPOLOGY_LINESTRIP_ADJ = 11,
D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST_ADJ = 12,
@@ -395,6 +358,37 @@ enum D3D_SRV_DIMENSION
D3D11_SRV_DIMENSION_BUFFEREX = D3D_SRV_DIMENSION_BUFFEREX
} D3D_SRV_DIMENSION;
+#define D3D_SHADER_FEATURE_DOUBLES 0x00001
+#define D3D_SHADER_FEATURE_COMPUTE_SHADERS_PLUS_RAW_AND_STRUCTURED_BUFFERS_VIA_SHADER_4_X 0x00002
+#define D3D_SHADER_FEATURE_UAVS_AT_EVERY_STAGE 0x00004
+#define D3D_SHADER_FEATURE_64_UAVS 0x00008
+#define D3D_SHADER_FEATURE_MINIMUM_PRECISION 0x00010
+#define D3D_SHADER_FEATURE_11_1_DOUBLE_EXTENSIONS 0x00020
+#define D3D_SHADER_FEATURE_11_1_SHADER_EXTENSIONS 0x00040
+#define D3D_SHADER_FEATURE_LEVEL_9_COMPARISON_FILTERING 0x00080
+#define D3D_SHADER_FEATURE_TILED_RESOURCES 0x00100
+#define D3D_SHADER_FEATURE_STENCIL_REF 0x00200
+#define D3D_SHADER_FEATURE_INNER_COVERAGE 0x00400
+#define D3D_SHADER_FEATURE_TYPED_UAV_LOAD_ADDITIONAL_FORMATS 0x00800
+#define D3D_SHADER_FEATURE_ROVS 0x01000
+#define D3D_SHADER_FEATURE_VIEWPORT_AND_RT_ARRAY_INDEX_FROM_ANY_SHADER_FEEDING_RASTERIZER 0x02000
+#define D3D_SHADER_FEATURE_WAVE_OPS 0x04000
+#define D3D_SHADER_FEATURE_INT64_OPS 0x08000
+#define D3D_SHADER_FEATURE_VIEW_ID 0x10000
+#define D3D_SHADER_FEATURE_BARYCENTRICS 0x20000
+#define D3D_SHADER_FEATURE_NATIVE_16BIT_OPS 0x40000
+#define D3D_SHADER_FEATURE_SHADING_RATE 0x80000
+#define D3D_SHADER_FEATURE_RAYTRACING_TIER_1_1 0x100000
+#define D3D_SHADER_FEATURE_SAMPLER_FEEDBACK 0x200000
+#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_TYPED_RESOURCE 0x400000
+#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_GROUP_SHARED 0x800000
+#define D3D_SHADER_FEATURE_DERIVATIVES_IN_MESH_AND_AMPLIFICATION_SHADERS 0x1000000
+#define D3D_SHADER_FEATURE_RESOURCE_DESCRIPTOR_HEAP_INDEXING 0x2000000
+#define D3D_SHADER_FEATURE_SAMPLER_DESCRIPTOR_HEAP_INDEXING 0x4000000
+#define D3D_SHADER_FEATURE_WAVE_MMA 0x8000000
+#define D3D_SHADER_FEATURE_ATOMIC_INT64_ON_DESCRIPTOR_HEAP_RESOURCE 0x10000000
+#define D3D_SHADER_FEATURE_ADVANCED_TEXTURE_OPS 0x20000000
+#define D3D_SHADER_FEATURE_WRITEABLE_MSAA_TEXTURES 0x40000000
typedef struct _D3D_SHADER_MACRO
{
LPCSTR Name;
@@ -437,21 +431,26 @@ EXTERN_C const IID IID_ID3D10Blob;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3D10Blob * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3D10Blob * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3D10Blob * This);
+ DECLSPEC_XFGVIRT(ID3D10Blob, GetBufferPointer)
LPVOID ( STDMETHODCALLTYPE *GetBufferPointer )(
ID3D10Blob * This);
+ DECLSPEC_XFGVIRT(ID3D10Blob, GetBufferSize)
SIZE_T ( STDMETHODCALLTYPE *GetBufferSize )(
ID3D10Blob * This);
@@ -547,18 +546,22 @@ EXTERN_C const IID IID_ID3DDestructionNotifier;
{
BEGIN_INTERFACE
+ DECLSPEC_XFGVIRT(IUnknown, QueryInterface)
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
ID3DDestructionNotifier * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
+ DECLSPEC_XFGVIRT(IUnknown, AddRef)
ULONG ( STDMETHODCALLTYPE *AddRef )(
ID3DDestructionNotifier * This);
+ DECLSPEC_XFGVIRT(IUnknown, Release)
ULONG ( STDMETHODCALLTYPE *Release )(
ID3DDestructionNotifier * This);
+ DECLSPEC_XFGVIRT(ID3DDestructionNotifier, RegisterDestructionCallback)
HRESULT ( STDMETHODCALLTYPE *RegisterDestructionCallback )(
ID3DDestructionNotifier * This,
/* [annotation] */
@@ -568,6 +571,7 @@ EXTERN_C const IID IID_ID3DDestructionNotifier;
/* [annotation] */
_Out_ UINT *pCallbackID);
+ DECLSPEC_XFGVIRT(ID3DDestructionNotifier, UnregisterDestructionCallback)
HRESULT ( STDMETHODCALLTYPE *UnregisterDestructionCallback )(
ID3DDestructionNotifier * This,
/* [annotation] */
@@ -732,6 +736,11 @@ enum _D3D_SHADER_VARIABLE_TYPE
D3D_SVT_MIN12INT = 55,
D3D_SVT_MIN16INT = 56,
D3D_SVT_MIN16UINT = 57,
+ D3D_SVT_INT16 = 58,
+ D3D_SVT_UINT16 = 59,
+ D3D_SVT_FLOAT16 = 60,
+ D3D_SVT_INT64 = 61,
+ D3D_SVT_UINT64 = 62,
D3D10_SVT_VOID = D3D_SVT_VOID,
D3D10_SVT_BOOL = D3D_SVT_BOOL,
D3D10_SVT_INT = D3D_SVT_INT,
@@ -819,6 +828,8 @@ enum _D3D_SHADER_INPUT_TYPE
D3D_SIT_UAV_APPEND_STRUCTURED = ( D3D_SIT_UAV_RWBYTEADDRESS + 1 ) ,
D3D_SIT_UAV_CONSUME_STRUCTURED = ( D3D_SIT_UAV_APPEND_STRUCTURED + 1 ) ,
D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER = ( D3D_SIT_UAV_CONSUME_STRUCTURED + 1 ) ,
+ D3D_SIT_RTACCELERATIONSTRUCTURE = ( D3D_SIT_UAV_RWSTRUCTURED_WITH_COUNTER + 1 ) ,
+ D3D_SIT_UAV_FEEDBACKTEXTURE = ( D3D_SIT_RTACCELERATIONSTRUCTURE + 1 ) ,
D3D10_SIT_CBUFFER = D3D_SIT_CBUFFER,
D3D10_SIT_TBUFFER = D3D_SIT_TBUFFER,
D3D10_SIT_TEXTURE = D3D_SIT_TEXTURE,
@@ -876,6 +887,9 @@ enum D3D_NAME
D3D_NAME_FINAL_TRI_INSIDE_TESSFACTOR = 14,
D3D_NAME_FINAL_LINE_DETAIL_TESSFACTOR = 15,
D3D_NAME_FINAL_LINE_DENSITY_TESSFACTOR = 16,
+ D3D_NAME_BARYCENTRICS = 23,
+ D3D_NAME_SHADINGRATE = 24,
+ D3D_NAME_CULLPRIMITIVE = 25,
D3D_NAME_TARGET = 64,
D3D_NAME_DEPTH = 65,
D3D_NAME_COVERAGE = 66,
@@ -906,7 +920,10 @@ enum D3D_NAME
D3D11_NAME_DEPTH_GREATER_EQUAL = D3D_NAME_DEPTH_GREATER_EQUAL,
D3D11_NAME_DEPTH_LESS_EQUAL = D3D_NAME_DEPTH_LESS_EQUAL,
D3D11_NAME_STENCIL_REF = D3D_NAME_STENCIL_REF,
- D3D11_NAME_INNER_COVERAGE = D3D_NAME_INNER_COVERAGE
+ D3D11_NAME_INNER_COVERAGE = D3D_NAME_INNER_COVERAGE,
+ D3D12_NAME_BARYCENTRICS = D3D_NAME_BARYCENTRICS,
+ D3D12_NAME_SHADINGRATE = D3D_NAME_SHADINGRATE,
+ D3D12_NAME_CULLPRIMITIVE = D3D_NAME_CULLPRIMITIVE
} D3D_NAME;
typedef
@@ -1027,9 +1044,50 @@ enum _D3D_PARAMETER_FLAGS
D3D_PF_FORCE_DWORD = 0x7fffffff
} D3D_PARAMETER_FLAGS;
+typedef
+enum D3D_FORMAT_LAYOUT
+ {
+ D3DFL_STANDARD = 0,
+ D3DFL_CUSTOM = -1
+ } D3D_FORMAT_LAYOUT;
+
+typedef
+enum D3D_FORMAT_TYPE_LEVEL
+ {
+ D3DFTL_NO_TYPE = 0,
+ D3DFTL_PARTIAL_TYPE = -2,
+ D3DFTL_FULL_TYPE = -1
+ } D3D_FORMAT_TYPE_LEVEL;
+
+typedef
+enum D3D_FORMAT_COMPONENT_NAME
+ {
+ D3DFCN_R = -4,
+ D3DFCN_G = -3,
+ D3DFCN_B = -2,
+ D3DFCN_A = -1,
+ D3DFCN_D = 0,
+ D3DFCN_S = 1,
+ D3DFCN_X = 2
+ } D3D_FORMAT_COMPONENT_NAME;
+
+typedef
+enum D3D_FORMAT_COMPONENT_INTERPRETATION
+ {
+ D3DFCI_TYPELESS = 0,
+ D3DFCI_FLOAT = -4,
+ D3DFCI_SNORM = -3,
+ D3DFCI_UNORM = -2,
+ D3DFCI_SINT = -1,
+ D3DFCI_UINT = 1,
+ D3DFCI_UNORM_SRGB = 2,
+ D3DFCI_BIASED_FIXED_2_8 = 3
+ } D3D_FORMAT_COMPONENT_INTERPRETATION;
+
DEFINE_GUID(WKPDID_D3DDebugObjectName,0x429b8c22,0x9188,0x4b0c,0x87,0x42,0xac,0xb0,0xbf,0x85,0xc2,0x00);
DEFINE_GUID(WKPDID_D3DDebugObjectNameW,0x4cca5fd8,0x921f,0x42c8,0x85,0x66,0x70,0xca,0xf2,0xa9,0xb7,0x41);
DEFINE_GUID(WKPDID_CommentStringW,0xd0149dc0,0x90e8,0x4ec8,0x81, 0x44, 0xe9, 0x00, 0xad, 0x26, 0x6b, 0xb2);
+DEFINE_GUID(WKPDID_D3D12UniqueObjectId, 0x1b39de15, 0xec04, 0x4bae, 0xba, 0x4d, 0x8c, 0xef, 0x79, 0xfc, 0x04, 0xc1);
#define D3D_SET_OBJECT_NAME_N_A(pObject, Chars, pName) (pObject)->SetPrivateData(WKPDID_D3DDebugObjectName, Chars, pName)
#define D3D_SET_OBJECT_NAME_A(pObject, pName) D3D_SET_OBJECT_NAME_N_A(pObject, lstrlenA(pName), pName)
#define D3D_SET_OBJECT_NAME_N_W(pObject, Chars, pName) (pObject)->SetPrivateData(WKPDID_D3DDebugObjectNameW, Chars*2, pName)
@@ -1038,6 +1096,8 @@ DEFINE_GUID(WKPDID_CommentStringW,0xd0149dc0,0x90e8,0x4ec8,0x81, 0x44, 0xe9, 0x0
#define D3D_COMPONENT_MASK_Y 2
#define D3D_COMPONENT_MASK_Z 4
#define D3D_COMPONENT_MASK_W 8
+DEFINE_GUID(D3D_TEXTURE_LAYOUT_ROW_MAJOR,0xb5dc234f,0x72bb,0x4bec,0x97,0x05,0x8c,0xf2,0x58,0xdf,0x6b,0x6c);
+DEFINE_GUID(D3D_TEXTURE_LAYOUT_64KB_STANDARD_SWIZZLE,0x4c0f29e3,0x3f5f,0x4d35,0x84,0xc9,0xbc,0x09,0x83,0xb6,0x2c,0x28);
extern RPC_IF_HANDLE __MIDL_itf_d3dcommon_0000_0002_v0_0_c_ifspec;
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcompiler.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3dcompiler.h
index 881ae755bc1..881ae755bc1 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3dcompiler.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/d3dcompiler.h
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore.h
new file mode 100644
index 00000000000..4244eaa60f9
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore.h
@@ -0,0 +1,41 @@
+/************************************************************
+* *
+* Copyright (c) Microsoft Corporation. *
+* Licensed under the MIT license. *
+* *
+************************************************************/
+
+#ifndef _DXCOREEXTMODULE_H_
+#define _DXCOREEXTMODULE_H_
+
+#include <winapifamily.h>
+#include "dxcore_interface.h"
+
+#pragma region Application Family or OneCore Family
+#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM)
+
+#if (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
+
+STDAPI
+DXCoreCreateAdapterFactory(
+ REFIID riid,
+ _COM_Outptr_ void** ppvFactory
+);
+
+template <class T>
+HRESULT
+DXCoreCreateAdapterFactory(
+ _COM_Outptr_ T** ppvFactory
+)
+{
+ return DXCoreCreateAdapterFactory(IID_PPV_ARGS(ppvFactory));
+}
+
+#endif // (_WIN32_WINNT >= _WIN32_WINNT_WIN10)
+
+#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP | WINAPI_PARTITION_SYSTEM) */
+#pragma endregion
+
+#endif // _DXCOREEXTMODULE_H_
+
+
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore_interface.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore_interface.h
new file mode 100644
index 00000000000..b487fe13fb6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxcore_interface.h
@@ -0,0 +1,316 @@
+//
+// DXCore Interface
+// Copyright (C) Microsoft Corporation.
+// Licensed under the MIT license.
+//
+
+#ifndef __dxcore_interface_h__
+#define __dxcore_interface_h__
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+
+#define _FACDXCORE 0x880
+#define MAKE_DXCORE_HRESULT( code ) MAKE_HRESULT( 1, _FACDXCORE, code )
+
+enum class DXCoreAdapterProperty : uint32_t
+{
+ InstanceLuid = 0,
+ DriverVersion = 1,
+ DriverDescription = 2,
+ HardwareID = 3, // Use HardwareIDParts instead, if available.
+ KmdModelVersion = 4,
+ ComputePreemptionGranularity = 5,
+ GraphicsPreemptionGranularity = 6,
+ DedicatedAdapterMemory = 7,
+ DedicatedSystemMemory = 8,
+ SharedSystemMemory = 9,
+ AcgCompatible = 10,
+ IsHardware = 11,
+ IsIntegrated = 12,
+ IsDetachable = 13,
+ HardwareIDParts = 14
+};
+
+enum class DXCoreAdapterState : uint32_t
+{
+ IsDriverUpdateInProgress = 0,
+ AdapterMemoryBudget = 1
+};
+
+enum class DXCoreSegmentGroup : uint32_t
+{
+ Local = 0,
+ NonLocal = 1
+};
+
+enum class DXCoreNotificationType : uint32_t
+{
+ AdapterListStale = 0,
+ AdapterNoLongerValid = 1,
+ AdapterBudgetChange = 2,
+ AdapterHardwareContentProtectionTeardown = 3
+};
+
+enum class DXCoreAdapterPreference : uint32_t
+{
+ Hardware = 0,
+ MinimumPower = 1,
+ HighPerformance = 2
+};
+
+struct DXCoreHardwareID
+{
+ uint32_t vendorID;
+ uint32_t deviceID;
+ uint32_t subSysID;
+ uint32_t revision;
+};
+
+struct DXCoreHardwareIDParts
+{
+ uint32_t vendorID;
+ uint32_t deviceID;
+ uint32_t subSystemID;
+ uint32_t subVendorID;
+ uint32_t revisionID;
+};
+
+struct DXCoreAdapterMemoryBudgetNodeSegmentGroup
+{
+ uint32_t nodeIndex;
+ DXCoreSegmentGroup segmentGroup;
+};
+
+struct DXCoreAdapterMemoryBudget
+{
+ uint64_t budget;
+ uint64_t currentUsage;
+ uint64_t availableForReservation;
+ uint64_t currentReservation;
+};
+
+typedef void (STDMETHODCALLTYPE *PFN_DXCORE_NOTIFICATION_CALLBACK)(
+ DXCoreNotificationType notificationType,
+ _In_ IUnknown *object,
+ _In_opt_ void *context);
+
+static_assert(sizeof(bool) == 1, "bool assumed as one byte");
+
+DEFINE_GUID(IID_IDXCoreAdapterFactory, 0x78ee5945, 0xc36e, 0x4b13, 0xa6, 0x69, 0x00, 0x5d, 0xd1, 0x1c, 0x0f, 0x06);
+DEFINE_GUID(IID_IDXCoreAdapterList, 0x526c7776, 0x40e9, 0x459b, 0xb7, 0x11, 0xf3, 0x2a, 0xd7, 0x6d, 0xfc, 0x28);
+DEFINE_GUID(IID_IDXCoreAdapter, 0xf0db4c7f, 0xfe5a, 0x42a2, 0xbd, 0x62, 0xf2, 0xa6, 0xcf, 0x6f, 0xc8, 0x3e);
+DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D11_GRAPHICS, 0x8c47866b, 0x7583, 0x450d, 0xf0, 0xf0, 0x6b, 0xad, 0xa8, 0x95, 0xaf, 0x4b);
+DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, 0x0c9ece4d, 0x2f6e, 0x4f01, 0x8c, 0x96, 0xe8, 0x9e, 0x33, 0x1b, 0x47, 0xb1);
+DEFINE_GUID(DXCORE_ADAPTER_ATTRIBUTE_D3D12_CORE_COMPUTE, 0x248e2800, 0xa793, 0x4724, 0xab, 0xaa, 0x23, 0xa6, 0xde, 0x1b, 0xe0, 0x90);
+
+/* interface IDXCoreAdapter */
+MIDL_INTERFACE("f0db4c7f-fe5a-42a2-bd62-f2a6cf6fc83e")
+IDXCoreAdapter : public IUnknown
+{
+public:
+ virtual bool STDMETHODCALLTYPE IsValid() = 0;
+
+ virtual bool STDMETHODCALLTYPE IsAttributeSupported(
+ REFGUID attributeGUID) = 0;
+
+ virtual bool STDMETHODCALLTYPE IsPropertySupported(
+ DXCoreAdapterProperty property) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetProperty(
+ DXCoreAdapterProperty property,
+ size_t bufferSize,
+ _Out_writes_bytes_(bufferSize) void *propertyData) = 0;
+
+ template <class T>
+ HRESULT GetProperty(
+ DXCoreAdapterProperty property,
+ _Out_writes_bytes_(sizeof(T)) T *propertyData)
+ {
+ return GetProperty(property,
+ sizeof(T),
+ (void*)propertyData);
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetPropertySize(
+ DXCoreAdapterProperty property,
+ _Out_ size_t *bufferSize) = 0;
+
+ virtual bool STDMETHODCALLTYPE IsQueryStateSupported(
+ DXCoreAdapterState property) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE QueryState(
+ DXCoreAdapterState state,
+ size_t inputStateDetailsSize,
+ _In_reads_bytes_opt_(inputStateDetailsSize) const void *inputStateDetails,
+ size_t outputBufferSize,
+ _Out_writes_bytes_(outputBufferSize) void *outputBuffer) = 0;
+
+ template <class T1, class T2>
+ HRESULT QueryState(
+ DXCoreAdapterState state,
+ _In_reads_bytes_opt_(sizeof(T1)) const T1 *inputStateDetails,
+ _Out_writes_bytes_(sizeof(T2)) T2 *outputBuffer)
+ {
+ return QueryState(state,
+ sizeof(T1),
+ (const void*)inputStateDetails,
+ sizeof(T2),
+ (void*)outputBuffer);
+ }
+
+ template <class T>
+ HRESULT QueryState(
+ DXCoreAdapterState state,
+ _Out_writes_bytes_(sizeof(T)) T *outputBuffer)
+ {
+ return QueryState(state,
+ 0,
+ nullptr,
+ sizeof(T),
+ (void*)outputBuffer);
+ }
+
+ virtual bool STDMETHODCALLTYPE IsSetStateSupported(
+ DXCoreAdapterState property) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE SetState(
+ DXCoreAdapterState state,
+ size_t inputStateDetailsSize,
+ _In_reads_bytes_opt_(inputStateDetailsSize) const void *inputStateDetails,
+ size_t inputDataSize,
+ _In_reads_bytes_(inputDataSize) const void *inputData) = 0;
+
+ template <class T1, class T2>
+ HRESULT SetState(
+ DXCoreAdapterState state,
+ const T1 *inputStateDetails,
+ const T2 *inputData)
+ {
+ return SetState(state,
+ sizeof(T1),
+ (const void*)inputStateDetails,
+ sizeof(T2),
+ (const void*)inputData);
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetFactory(
+ REFIID riid,
+ _COM_Outptr_ void** ppvFactory
+ ) = 0;
+
+ template <class T>
+ HRESULT GetFactory(
+ _COM_Outptr_ T** ppvFactory
+ )
+ {
+ return GetFactory(IID_PPV_ARGS(ppvFactory));
+ }
+};
+
+/* interface IDXCoreAdapterList */
+MIDL_INTERFACE("526c7776-40e9-459b-b711-f32ad76dfc28")
+IDXCoreAdapterList : public IUnknown
+{
+public:
+ virtual HRESULT STDMETHODCALLTYPE GetAdapter(
+ uint32_t index,
+ REFIID riid,
+ _COM_Outptr_ void **ppvAdapter) = 0;
+
+ template<class T>
+ HRESULT STDMETHODCALLTYPE GetAdapter(
+ uint32_t index,
+ _COM_Outptr_ T **ppvAdapter)
+ {
+ return GetAdapter(index,
+ IID_PPV_ARGS(ppvAdapter));
+ }
+
+ virtual uint32_t STDMETHODCALLTYPE GetAdapterCount() = 0;
+
+ virtual bool STDMETHODCALLTYPE IsStale() = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE GetFactory(
+ REFIID riid,
+ _COM_Outptr_ void** ppvFactory
+ ) = 0;
+
+ template <class T>
+ HRESULT GetFactory(
+ _COM_Outptr_ T** ppvFactory
+ )
+ {
+ return GetFactory(IID_PPV_ARGS(ppvFactory));
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE Sort(
+ uint32_t numPreferences,
+ _In_reads_(numPreferences) const DXCoreAdapterPreference* preferences) = 0;
+
+ virtual bool STDMETHODCALLTYPE IsAdapterPreferenceSupported(
+ DXCoreAdapterPreference preference) = 0;
+};
+
+/* interface IDXCoreAdapterFactory */
+MIDL_INTERFACE("78ee5945-c36e-4b13-a669-005dd11c0f06")
+IDXCoreAdapterFactory : public IUnknown
+{
+public:
+
+ virtual HRESULT STDMETHODCALLTYPE CreateAdapterList(
+ uint32_t numAttributes,
+ _In_reads_(numAttributes) const GUID *filterAttributes,
+ REFIID riid,
+ _COM_Outptr_ void **ppvAdapterList) = 0;
+
+ template<class T>
+ HRESULT STDMETHODCALLTYPE CreateAdapterList(
+ uint32_t numAttributes,
+ _In_reads_(numAttributes) const GUID *filterAttributes,
+ _COM_Outptr_ T **ppvAdapterList)
+ {
+ return CreateAdapterList(numAttributes,
+ filterAttributes,
+ IID_PPV_ARGS(ppvAdapterList));
+ }
+
+ virtual HRESULT STDMETHODCALLTYPE GetAdapterByLuid(
+ const LUID &adapterLUID,
+ REFIID riid,
+ _COM_Outptr_ void **ppvAdapter) = 0;
+
+ template<class T>
+ HRESULT STDMETHODCALLTYPE GetAdapterByLuid(
+ const LUID &adapterLUID,
+ _COM_Outptr_ T **ppvAdapter)
+ {
+ return GetAdapterByLuid(adapterLUID,
+ IID_PPV_ARGS(ppvAdapter));
+ }
+
+ virtual bool STDMETHODCALLTYPE IsNotificationTypeSupported(
+ DXCoreNotificationType notificationType) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE RegisterEventNotification(
+ _In_ IUnknown *dxCoreObject,
+ DXCoreNotificationType notificationType,
+ _In_ PFN_DXCORE_NOTIFICATION_CALLBACK callbackFunction,
+ _In_opt_ void *callbackContext,
+ _Out_ uint32_t *eventCookie) = 0;
+
+ virtual HRESULT STDMETHODCALLTYPE UnregisterEventNotification(
+ uint32_t eventCookie) = 0;
+};
+
+#endif // __cplusplus
+
+#endif // __dxcore_interface_h__
+
+
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi.h
index 62f88aebcd4..39df331700e 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi.h
@@ -10,7 +10,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
@@ -206,7 +206,7 @@ typedef struct DXGI_ADAPTER_DESC
LUID AdapterLuid;
} DXGI_ADAPTER_DESC;
-#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (WINVER < 0x0500)
+#if !defined(HMONITOR_DECLARED) && !defined(HMONITOR) && (!defined(WINVER) || WINVER < 0x0500)
#define HMONITOR_DECLARED
#if 0
typedef HANDLE HMONITOR;
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_2.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_2.h
index fe3430f9aa2..a79d575f318 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_2.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_2.h
@@ -10,7 +10,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_3.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_3.h
index 85a3394f4c7..40826efe7a8 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_3.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_3.h
@@ -10,7 +10,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_4.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_4.h
index dad3874d7c0..0ac2957d71d 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_4.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_4.h
@@ -10,7 +10,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_5.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_5.h
index 59624b55522..bdee56de5b0 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_5.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_5.h
@@ -10,7 +10,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_6.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_6.h
index 068391b0183..35d34b9eee2 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgi1_6.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgi1_6.h
@@ -10,7 +10,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgicommon.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgicommon.h
index bdeab3217fd..f83aa01e61e 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgicommon.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgicommon.h
@@ -1,5 +1,6 @@
//
-// Copyright (C) Microsoft. All rights reserved.
+// Copyright (C) Microsoft Corporation.
+// Licensed under the MIT license
//
#ifndef __dxgicommon_h__
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgidebug.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgidebug.h
index f50d0fd4503..6139a703a55 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgidebug.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgidebug.h
@@ -10,7 +10,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgiformat.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgiformat.h
new file mode 100644
index 00000000000..52aae1b2bed
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgiformat.h
@@ -0,0 +1,142 @@
+//
+// Copyright (C) Microsoft Corporation.
+// Licensed under the MIT license
+//
+
+#ifndef __dxgiformat_h__
+#define __dxgiformat_h__
+
+#define DXGI_FORMAT_DEFINED 1
+
+typedef enum DXGI_FORMAT
+{
+ DXGI_FORMAT_UNKNOWN = 0,
+ DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
+ DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
+ DXGI_FORMAT_R32G32B32A32_UINT = 3,
+ DXGI_FORMAT_R32G32B32A32_SINT = 4,
+ DXGI_FORMAT_R32G32B32_TYPELESS = 5,
+ DXGI_FORMAT_R32G32B32_FLOAT = 6,
+ DXGI_FORMAT_R32G32B32_UINT = 7,
+ DXGI_FORMAT_R32G32B32_SINT = 8,
+ DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
+ DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
+ DXGI_FORMAT_R16G16B16A16_UNORM = 11,
+ DXGI_FORMAT_R16G16B16A16_UINT = 12,
+ DXGI_FORMAT_R16G16B16A16_SNORM = 13,
+ DXGI_FORMAT_R16G16B16A16_SINT = 14,
+ DXGI_FORMAT_R32G32_TYPELESS = 15,
+ DXGI_FORMAT_R32G32_FLOAT = 16,
+ DXGI_FORMAT_R32G32_UINT = 17,
+ DXGI_FORMAT_R32G32_SINT = 18,
+ DXGI_FORMAT_R32G8X24_TYPELESS = 19,
+ DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
+ DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21,
+ DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
+ DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
+ DXGI_FORMAT_R10G10B10A2_UNORM = 24,
+ DXGI_FORMAT_R10G10B10A2_UINT = 25,
+ DXGI_FORMAT_R11G11B10_FLOAT = 26,
+ DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
+ DXGI_FORMAT_R8G8B8A8_UNORM = 28,
+ DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
+ DXGI_FORMAT_R8G8B8A8_UINT = 30,
+ DXGI_FORMAT_R8G8B8A8_SNORM = 31,
+ DXGI_FORMAT_R8G8B8A8_SINT = 32,
+ DXGI_FORMAT_R16G16_TYPELESS = 33,
+ DXGI_FORMAT_R16G16_FLOAT = 34,
+ DXGI_FORMAT_R16G16_UNORM = 35,
+ DXGI_FORMAT_R16G16_UINT = 36,
+ DXGI_FORMAT_R16G16_SNORM = 37,
+ DXGI_FORMAT_R16G16_SINT = 38,
+ DXGI_FORMAT_R32_TYPELESS = 39,
+ DXGI_FORMAT_D32_FLOAT = 40,
+ DXGI_FORMAT_R32_FLOAT = 41,
+ DXGI_FORMAT_R32_UINT = 42,
+ DXGI_FORMAT_R32_SINT = 43,
+ DXGI_FORMAT_R24G8_TYPELESS = 44,
+ DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
+ DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
+ DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
+ DXGI_FORMAT_R8G8_TYPELESS = 48,
+ DXGI_FORMAT_R8G8_UNORM = 49,
+ DXGI_FORMAT_R8G8_UINT = 50,
+ DXGI_FORMAT_R8G8_SNORM = 51,
+ DXGI_FORMAT_R8G8_SINT = 52,
+ DXGI_FORMAT_R16_TYPELESS = 53,
+ DXGI_FORMAT_R16_FLOAT = 54,
+ DXGI_FORMAT_D16_UNORM = 55,
+ DXGI_FORMAT_R16_UNORM = 56,
+ DXGI_FORMAT_R16_UINT = 57,
+ DXGI_FORMAT_R16_SNORM = 58,
+ DXGI_FORMAT_R16_SINT = 59,
+ DXGI_FORMAT_R8_TYPELESS = 60,
+ DXGI_FORMAT_R8_UNORM = 61,
+ DXGI_FORMAT_R8_UINT = 62,
+ DXGI_FORMAT_R8_SNORM = 63,
+ DXGI_FORMAT_R8_SINT = 64,
+ DXGI_FORMAT_A8_UNORM = 65,
+ DXGI_FORMAT_R1_UNORM = 66,
+ DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
+ DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
+ DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
+ DXGI_FORMAT_BC1_TYPELESS = 70,
+ DXGI_FORMAT_BC1_UNORM = 71,
+ DXGI_FORMAT_BC1_UNORM_SRGB = 72,
+ DXGI_FORMAT_BC2_TYPELESS = 73,
+ DXGI_FORMAT_BC2_UNORM = 74,
+ DXGI_FORMAT_BC2_UNORM_SRGB = 75,
+ DXGI_FORMAT_BC3_TYPELESS = 76,
+ DXGI_FORMAT_BC3_UNORM = 77,
+ DXGI_FORMAT_BC3_UNORM_SRGB = 78,
+ DXGI_FORMAT_BC4_TYPELESS = 79,
+ DXGI_FORMAT_BC4_UNORM = 80,
+ DXGI_FORMAT_BC4_SNORM = 81,
+ DXGI_FORMAT_BC5_TYPELESS = 82,
+ DXGI_FORMAT_BC5_UNORM = 83,
+ DXGI_FORMAT_BC5_SNORM = 84,
+ DXGI_FORMAT_B5G6R5_UNORM = 85,
+ DXGI_FORMAT_B5G5R5A1_UNORM = 86,
+ DXGI_FORMAT_B8G8R8A8_UNORM = 87,
+ DXGI_FORMAT_B8G8R8X8_UNORM = 88,
+ DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89,
+ DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
+ DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
+ DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
+ DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
+ DXGI_FORMAT_BC6H_TYPELESS = 94,
+ DXGI_FORMAT_BC6H_UF16 = 95,
+ DXGI_FORMAT_BC6H_SF16 = 96,
+ DXGI_FORMAT_BC7_TYPELESS = 97,
+ DXGI_FORMAT_BC7_UNORM = 98,
+ DXGI_FORMAT_BC7_UNORM_SRGB = 99,
+ DXGI_FORMAT_AYUV = 100,
+ DXGI_FORMAT_Y410 = 101,
+ DXGI_FORMAT_Y416 = 102,
+ DXGI_FORMAT_NV12 = 103,
+ DXGI_FORMAT_P010 = 104,
+ DXGI_FORMAT_P016 = 105,
+ DXGI_FORMAT_420_OPAQUE = 106,
+ DXGI_FORMAT_YUY2 = 107,
+ DXGI_FORMAT_Y210 = 108,
+ DXGI_FORMAT_Y216 = 109,
+ DXGI_FORMAT_NV11 = 110,
+ DXGI_FORMAT_AI44 = 111,
+ DXGI_FORMAT_IA44 = 112,
+ DXGI_FORMAT_P8 = 113,
+ DXGI_FORMAT_A8P8 = 114,
+ DXGI_FORMAT_B4G4R4A4_UNORM = 115,
+
+ DXGI_FORMAT_P208 = 130,
+ DXGI_FORMAT_V208 = 131,
+ DXGI_FORMAT_V408 = 132,
+
+
+ DXGI_FORMAT_SAMPLER_FEEDBACK_MIN_MIP_OPAQUE = 189,
+ DXGI_FORMAT_SAMPLER_FEEDBACK_MIP_REGION_USED_OPAQUE = 190,
+
+
+ DXGI_FORMAT_FORCE_UINT = 0xffffffff
+} DXGI_FORMAT;
+
+#endif // __dxgiformat_h__
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgitype.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgitype.h
index c73616317ac..c73616317ac 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgitype.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxgitype.h
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxva2api.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxva2api.h
index 167d18c486e..529e993f336 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/dxva2api.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/dxva2api.h
@@ -10,7 +10,7 @@
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
/* verify that the <rpcsal.h> version is high enough to compile this file*/
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/pix3.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/pix3.h
index 311d6c240a1..311d6c240a1 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/pix3.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/pix3.h
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/pix3_win.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/pix3_win.h
index 2b3dcd5b9d3..2b3dcd5b9d3 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/pix3_win.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/pix3_win.h
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/winapifamily.h b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/winapifamily.h
index 388d5f068cb..996187b53c1 100644
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/winapifamily.h
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/directx/winapifamily.h
@@ -21,4 +21,10 @@
#define WINAPI_FAMILY_PARTITION(v) ((WINAPI_FAMILY & v) == v)
#define WINAPI_FAMILY_ONE_PARTITION(vset, v) ((WINAPI_FAMILY & vset) == v)
+#define WINAPI_FAMILY_GAMES 6
+
+#ifndef WINAPI_PARTITION_GAMES
+# define WINAPI_PARTITION_GAMES (WINAPI_FAMILY == WINAPI_FAMILY_GAMES || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP)
+#endif // WINAPI_PARTITION_GAMES
+
#endif
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/basetsd.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/basetsd.h
new file mode 100644
index 00000000000..cefc1bd0507
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/basetsd.h
@@ -0,0 +1,347 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#pragma once
+
+// These #defines prevent the idl-generated headers from trying to include
+// Windows.h from the SDK rather than this one.
+#define RPC_NO_WINDOWS_H
+#define COM_NO_WINDOWS_H
+
+// Allcaps type definitions
+#include <stddef.h>
+#include <stdint.h>
+#include <string.h>
+#include <limits.h>
+#include <sal.h>
+
+// Note: using fixed-width here to match Windows widths
+// Specifically this is different for 'long' vs 'LONG'
+typedef uint8_t UINT8;
+typedef int8_t INT8;
+typedef uint16_t UINT16;
+typedef int16_t INT16;
+typedef uint32_t UINT32, UINT, ULONG, DWORD, BOOL, WINBOOL;
+typedef int32_t INT32, INT, LONG;
+typedef uint64_t UINT64, ULONG_PTR;
+typedef int64_t INT64, LONG_PTR;
+typedef void VOID, *HANDLE, *RPC_IF_HANDLE, *LPVOID;
+typedef const void *LPCVOID;
+typedef size_t SIZE_T;
+typedef float FLOAT;
+typedef double DOUBLE;
+typedef unsigned char BYTE;
+typedef HANDLE HWND;
+typedef HANDLE HMODULE;
+typedef size_t SIZE;
+typedef int PALETTEENTRY;
+typedef int HDC;
+typedef uint16_t WORD;
+typedef void* PVOID;
+typedef char BOOLEAN;
+typedef uint64_t ULONGLONG;
+typedef int16_t SHORT, *PSHORT;
+typedef uint16_t USHORT, *PUSHORT;
+typedef int64_t LONGLONG, *PLONGLONG;
+typedef int64_t LONG_PTR, *PLONG_PTR;
+typedef int64_t LONG64, *PLONG64;
+typedef uint64_t ULONG64, *PULONG64;
+typedef wchar_t WCHAR, *PWSTR;
+typedef uint8_t UCHAR, *PUCHAR;
+typedef uint64_t ULONG_PTR, *PULONG_PTR;
+typedef uint64_t UINT_PTR, *PUINT_PTR;
+typedef int64_t INT_PTR, *PINT_PTR;
+
+// Note: WCHAR is not the same between Windows and Linux, to enable
+// string manipulation APIs to work with resulting strings.
+// APIs to D3D/DXCore will work on Linux wchars, but beware with
+// interactions directly with the Windows kernel.
+typedef char CHAR, *PSTR, *LPSTR, TCHAR, *PTSTR;
+typedef const char *LPCSTR, *PCSTR, *LPCTSTR, *PCTSTR;
+typedef wchar_t WCHAR, *PWSTR, *LPWSTR, *PWCHAR;
+typedef const wchar_t *LPCWSTR, *PCWSTR;
+
+#undef LONG_MAX
+#define LONG_MAX INT_MAX
+#undef ULONG_MAX
+#define ULONG_MAX UINT_MAX
+
+// Misc defines
+#define MIDL_INTERFACE(x) interface
+#define __analysis_assume(x)
+#define TRUE 1u
+#define FALSE 0u
+#define DECLSPEC_UUID(x)
+#define DECLSPEC_NOVTABLE
+#define DECLSPEC_SELECTANY
+#ifdef __cplusplus
+#define EXTERN_C extern "C"
+#else
+#define EXTERN_C extern
+#endif
+#define APIENTRY
+#define OUT
+#define IN
+#define CONST const
+#define MAX_PATH 260
+#define GENERIC_ALL 0x10000000L
+#define C_ASSERT(expr) static_assert((expr))
+#define _countof(a) (sizeof(a) / sizeof(*(a)))
+
+typedef struct tagRECTL
+{
+ LONG left;
+ LONG top;
+ LONG right;
+ LONG bottom;
+} RECTL;
+
+typedef struct tagPOINT
+{
+ int x;
+ int y;
+} POINT;
+
+typedef struct _GUID {
+ uint32_t Data1;
+ uint16_t Data2;
+ uint16_t Data3;
+ uint8_t Data4[ 8 ];
+} GUID;
+
+#ifdef INITGUID
+#ifdef __cplusplus
+#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID DECLSPEC_SELECTANY name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
+#else
+#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) const GUID DECLSPEC_SELECTANY name = { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }
+#endif
+#else
+#define DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) EXTERN_C const GUID name
+#endif
+
+typedef GUID IID;
+typedef GUID UUID;
+typedef GUID CLSID;
+#ifdef __cplusplus
+#define REFGUID const GUID &
+#define REFIID const IID &
+#define REFCLSID const IID &
+
+__inline int InlineIsEqualGUID(REFGUID rguid1, REFGUID rguid2)
+{
+ return (
+ ((uint32_t *)&rguid1)[0] == ((uint32_t *)&rguid2)[0] &&
+ ((uint32_t *)&rguid1)[1] == ((uint32_t *)&rguid2)[1] &&
+ ((uint32_t *)&rguid1)[2] == ((uint32_t *)&rguid2)[2] &&
+ ((uint32_t *)&rguid1)[3] == ((uint32_t *)&rguid2)[3]);
+}
+
+inline bool operator==(REFGUID guidOne, REFGUID guidOther)
+{
+ return !!InlineIsEqualGUID(guidOne, guidOther);
+}
+
+inline bool operator!=(REFGUID guidOne, REFGUID guidOther)
+{
+ return !(guidOne == guidOther);
+}
+
+#else
+#define REFGUID const GUID *
+#define REFIID const IID *
+#define REFCLSID const IID *
+#endif
+
+// Calling conventions
+#define __cdecl
+#define __stdcall
+#define STDMETHODCALLTYPE
+#define STDAPICALLTYPE
+#define STDAPI EXTERN_C HRESULT STDAPICALLTYPE
+#define WINAPI
+
+#define interface struct
+#if defined (__cplusplus) && !defined (CINTERFACE)
+#define STDMETHOD(method) virtual HRESULT STDMETHODCALLTYPE method
+#define STDMETHOD_(type, method) virtual type STDMETHODCALLTYPE method
+#define PURE = 0
+#define THIS_
+#define THIS void
+#define DECLARE_INTERFACE(iface) interface DECLSPEC_NOVTABLE iface
+#define DECLARE_INTERFACE_(iface, baseiface) interface DECLSPEC_NOVTABLE iface : public baseiface
+
+interface IUnknown;
+extern "C++"
+{
+ template<typename T> void** IID_PPV_ARGS_Helper(T** pp)
+ {
+ (void)static_cast<IUnknown*>(*pp);
+ return reinterpret_cast<void**>(pp);
+ }
+}
+#define IID_PPV_ARGS(ppType) __uuidof (**(ppType)), IID_PPV_ARGS_Helper (ppType)
+#else
+#define STDMETHOD(method) HRESULT (STDMETHODCALLTYPE *method)
+#define STDMETHOD_(type, method) type (STDMETHODCALLTYPE *method)
+#define PURE
+#define THIS_ INTERFACE *This,
+#define THIS INTERFACE *This
+#ifdef CONST_VTABLE
+#define DECLARE_INTERFACE(iface) typedef interface iface { const struct iface##Vtbl *lpVtbl; } iface; typedef const struct iface##Vtbl iface##Vtbl; const struct iface##Vtbl
+#else
+#define DECLARE_INTERFACE(iface) typedef interface iface { struct iface##Vtbl *lpVtbl; } iface; typedef struct iface##Vtbl iface##Vtbl; struct iface##Vtbl
+#endif
+#define DECLARE_INTERFACE_(iface, baseiface) DECLARE_INTERFACE (iface)
+#endif
+
+#define IFACEMETHOD(method) /*override*/ STDMETHOD (method)
+#define IFACEMETHOD_(type, method) /*override*/ STDMETHOD_(type, method)
+#ifndef BEGIN_INTERFACE
+#define BEGIN_INTERFACE
+#define END_INTERFACE
+#endif
+
+// Error codes
+typedef LONG HRESULT;
+#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0)
+#define FAILED(hr) (((HRESULT)(hr)) < 0)
+#define S_OK ((HRESULT)0L)
+#define S_FALSE ((HRESULT)1L)
+#define E_NOTIMPL ((HRESULT)0x80004001L)
+#define E_OUTOFMEMORY ((HRESULT)0x8007000EL)
+#define E_INVALIDARG ((HRESULT)0x80070057L)
+#define E_NOINTERFACE ((HRESULT)0x80004002L)
+#define E_POINTER ((HRESULT)0x80004003L)
+#define E_HANDLE ((HRESULT)0x80070006L)
+#define E_ABORT ((HRESULT)0x80004004L)
+#define E_FAIL ((HRESULT)0x80004005L)
+#define E_ACCESSDENIED ((HRESULT)0x80070005L)
+#define E_UNEXPECTED ((HRESULT)0x8000FFFFL)
+#define DXGI_ERROR_INVALID_CALL ((HRESULT)0x887A0001L)
+#define DXGI_ERROR_NOT_FOUND ((HRESULT)0x887A0002L)
+#define DXGI_ERROR_MORE_DATA ((HRESULT)0x887A0003L)
+#define DXGI_ERROR_UNSUPPORTED ((HRESULT)0x887A0004L)
+#define DXGI_ERROR_DEVICE_REMOVED ((HRESULT)0x887A0005L)
+#define DXGI_ERROR_DEVICE_HUNG ((HRESULT)0x887A0006L)
+#define DXGI_ERROR_DEVICE_RESET ((HRESULT)0x887A0007L)
+#define DXGI_ERROR_DRIVER_INTERNAL_ERROR ((HRESULT)0x887A0020L)
+
+typedef struct _LUID
+{
+ ULONG LowPart;
+ LONG HighPart;
+} LUID;
+
+typedef struct _RECT
+{
+ int left;
+ int top;
+ int right;
+ int bottom;
+} RECT;
+
+typedef union _LARGE_INTEGER {
+ struct {
+ uint32_t LowPart;
+ uint32_t HighPart;
+ } u;
+ int64_t QuadPart;
+} LARGE_INTEGER;
+typedef LARGE_INTEGER *PLARGE_INTEGER;
+
+typedef union _ULARGE_INTEGER {
+ struct {
+ uint32_t LowPart;
+ uint32_t HighPart;
+ } u;
+ uint64_t QuadPart;
+} ULARGE_INTEGER;
+typedef ULARGE_INTEGER *PULARGE_INTEGER;
+
+#define DECLARE_HANDLE(name) \
+ struct name##__ { \
+ int unused; \
+ }; \
+ typedef struct name##__ *name
+
+typedef struct _SECURITY_ATTRIBUTES {
+ DWORD nLength;
+ LPVOID lpSecurityDescriptor;
+ WINBOOL bInheritHandle;
+} SECURITY_ATTRIBUTES;
+
+struct STATSTG;
+
+#ifdef __cplusplus
+// ENUM_FLAG_OPERATORS
+// Define operator overloads to enable bit operations on enum values that are
+// used to define flags. Use DEFINE_ENUM_FLAG_OPERATORS(YOUR_TYPE) to enable these
+// operators on YOUR_TYPE.
+extern "C++" {
+ template <size_t S>
+ struct _ENUM_FLAG_INTEGER_FOR_SIZE;
+
+ template <>
+ struct _ENUM_FLAG_INTEGER_FOR_SIZE<1>
+ {
+ typedef int8_t type;
+ };
+
+ template <>
+ struct _ENUM_FLAG_INTEGER_FOR_SIZE<2>
+ {
+ typedef int16_t type;
+ };
+
+ template <>
+ struct _ENUM_FLAG_INTEGER_FOR_SIZE<4>
+ {
+ typedef int32_t type;
+ };
+
+ template <>
+ struct _ENUM_FLAG_INTEGER_FOR_SIZE<8>
+ {
+ typedef int64_t type;
+ };
+
+ // used as an approximation of std::underlying_type<T>
+ template <class T>
+ struct _ENUM_FLAG_SIZED_INTEGER
+ {
+ typedef typename _ENUM_FLAG_INTEGER_FOR_SIZE<sizeof(T)>::type type;
+ };
+
+}
+#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) \
+extern "C++" { \
+inline constexpr ENUMTYPE operator | (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)a) | ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
+inline ENUMTYPE &operator |= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type &)a) |= ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
+inline constexpr ENUMTYPE operator & (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)a) & ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
+inline ENUMTYPE &operator &= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type &)a) &= ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
+inline constexpr ENUMTYPE operator ~ (ENUMTYPE a) { return ENUMTYPE(~((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)a)); } \
+inline constexpr ENUMTYPE operator ^ (ENUMTYPE a, ENUMTYPE b) { return ENUMTYPE(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)a) ^ ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
+inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type &)a) ^= ((_ENUM_FLAG_SIZED_INTEGER<ENUMTYPE>::type)b)); } \
+}
+#else
+#define DEFINE_ENUM_FLAG_OPERATORS(ENUMTYPE) /* */
+#endif
+
+// D3DX12 uses these
+#include <stdlib.h>
+#define HeapAlloc(heap, flags, size) malloc(size)
+#define HeapFree(heap, flags, ptr) free(ptr)
+
+#if defined(lint)
+// Note: lint -e530 says don't complain about uninitialized variables for
+// this variable. Error 527 has to do with unreachable code.
+// -restore restores checking to the -save state
+#define UNREFERENCED_PARAMETER(P) \
+ /*lint -save -e527 -e530 */ \
+ { \
+ (P) = (P); \
+ } \
+ /*lint -restore */
+#else
+#define UNREFERENCED_PARAMETER(P) (P)
+#endif
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/oaidl.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/oaidl.h
new file mode 100644
index 00000000000..76f5b5f9511
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/oaidl.h
@@ -0,0 +1,5 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+// Stub header to satisfy d3d12.h include
+#pragma once \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/objbase.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/objbase.h
new file mode 100644
index 00000000000..6f70f09beec
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/objbase.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/ocidl.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/ocidl.h
new file mode 100644
index 00000000000..76f5b5f9511
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/ocidl.h
@@ -0,0 +1,5 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+// Stub header to satisfy d3d12.h include
+#pragma once \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpc.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpc.h
new file mode 100644
index 00000000000..76f5b5f9511
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpc.h
@@ -0,0 +1,5 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+// Stub header to satisfy d3d12.h include
+#pragma once \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpcndr.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpcndr.h
new file mode 100644
index 00000000000..2d4ba600d59
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/rpcndr.h
@@ -0,0 +1,82 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+// Stub header to satisfy d3d12.h include
+#pragma once
+
+#include "basetsd.h"
+
+#define __RPCNDR_H_VERSION__
+
+#ifdef CONST_VTABLE
+#define CONST_VTBL const
+#else
+#define CONST_VTBL
+#endif
+
+#ifndef __cpp_inline_variables
+#define __cpp_inline_variables 0
+#endif
+
+/* Macros for __uuidof template-based emulation */
+#if defined(__cplusplus)
+#if __cpp_constexpr >= 200704l && __cpp_inline_variables >= 201606L
+#define __wsl_stub_uuidof_use_constexpr 1
+#else
+#define __wsl_stub_uuidof_use_constexpr 0
+#endif
+#ifndef __GNUC__
+#error "Only support for compilers that support for `GNU C++ extension`"
+#endif
+extern "C++" {
+#if __wsl_stub_uuidof_use_constexpr
+ __extension__ template<typename T> struct __wsl_stub_uuidof_s;
+ __extension__ template<typename T> constexpr const GUID &__wsl_stub_uuidof();
+#else
+ __extension__ template<typename T> const GUID &__wsl_stub_uuidof();
+#endif
+}
+
+#if __wsl_stub_uuidof_use_constexpr
+#define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+ extern "C++" \
+ { \
+ template <> \
+ struct __wsl_stub_uuidof_s<type> \
+ { \
+ static constexpr IID __uuid_inst = { \
+ l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}; \
+ }; \
+ template <> \
+ constexpr const GUID &__wsl_stub_uuidof<type>() \
+ { \
+ return __wsl_stub_uuidof_s<type>::__uuid_inst; \
+ } \
+ template <> \
+ constexpr const GUID &__wsl_stub_uuidof<type *>() \
+ { \
+ return __wsl_stub_uuidof_s<type>::__uuid_inst; \
+ } \
+ }
+#else
+#define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8) \
+ extern "C++" \
+ { \
+ template <> \
+ inline const GUID &__wsl_stub_uuidof<type>() \
+ { \
+ static const IID __uuid_inst = { \
+ l, w1, w2, {b1, b2, b3, b4, b5, b6, b7, b8}}; \
+ return __uuid_inst; \
+ } \
+ template <> \
+ inline const GUID &__wsl_stub_uuidof<type *>() \
+ { \
+ return __wsl_stub_uuidof<type>(); \
+ } \
+ }
+#endif
+#define __uuidof(type) __wsl_stub_uuidof<__typeof(type)>()
+#else
+#define __CRT_UUID_DECL(type, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8)
+#endif
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwn.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwn.h
new file mode 100644
index 00000000000..e08ad1e602c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwn.h
@@ -0,0 +1,3 @@
+#pragma once
+
+#include "unknwnbase.h"
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwnbase.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwnbase.h
new file mode 100644
index 00000000000..7a546511455
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/unknwnbase.h
@@ -0,0 +1,124 @@
+/*-------------------------------------------------------------------------------------
+ *
+ * Copyright (c) Microsoft Corporation
+ * Licensed under the MIT license
+ *
+ *-------------------------------------------------------------------------------------*/
+
+/* this ALWAYS GENERATED file contains the definitions for the interfaces */
+
+/* File created by MIDL compiler version 8.01.0627 */
+
+/* verify that the <rpcndr.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCNDR_H_VERSION__
+#define __REQUIRED_RPCNDR_H_VERSION__ 500
+#endif
+
+/* verify that the <rpcsal.h> version is high enough to compile this file*/
+#ifndef __REQUIRED_RPCSAL_H_VERSION__
+#define __REQUIRED_RPCSAL_H_VERSION__ 100
+#endif
+
+#include "rpc.h"
+#include "rpcndr.h"
+
+#ifndef __RPCNDR_H_VERSION__
+#error this stub requires an updated version of <rpcndr.h>
+#endif /* __RPCNDR_H_VERSION__ */
+
+#ifndef COM_NO_WINDOWS_H
+#include "windows.h"
+#include "ole2.h"
+#endif /*COM_NO_WINDOWS_H*/
+
+#ifndef __unknwnbase_h__
+#define __unknwnbase_h__
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+#pragma once
+#endif
+
+/* Forward Declarations */
+
+#ifndef __IUnknown_FWD_DEFINED__
+#define __IUnknown_FWD_DEFINED__
+typedef interface IUnknown IUnknown;
+
+#endif /* __IUnknown_FWD_DEFINED__ */
+
+#ifndef __IUnknown_INTERFACE_DEFINED__
+#define __IUnknown_INTERFACE_DEFINED__
+
+/* interface IUnknown */
+/* [unique][uuid][object][local] */
+
+typedef /* [unique] */ IUnknown *LPUNKNOWN;
+
+EXTERN_C const IID IID_IUnknown;
+
+#if defined(__cplusplus) && !defined(CINTERFACE)
+extern "C++"
+{
+ MIDL_INTERFACE("00000000-0000-0000-c000-000000000046")
+ IUnknown
+ {
+ BEGIN_INTERFACE
+
+ virtual HRESULT STDMETHODCALLTYPE QueryInterface(
+ REFIID riid,
+ void **ppvObject) = 0;
+
+ virtual ULONG STDMETHODCALLTYPE AddRef() = 0;
+
+ virtual ULONG STDMETHODCALLTYPE Release() = 0;
+
+ template <class Q>
+ HRESULT
+ STDMETHODCALLTYPE
+ QueryInterface(_COM_Outptr_ Q * *pp)
+ {
+ return QueryInterface(__uuidof(Q), (void **)pp);
+ }
+ END_INTERFACE
+ };
+}
+#ifdef __CRT_UUID_DECL
+__CRT_UUID_DECL(IUnknown, 0x00000000, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46)
+#endif
+#else
+typedef struct IUnknownVtbl {
+ BEGIN_INTERFACE
+
+ /*** IUnknown methods ***/
+ HRESULT (STDMETHODCALLTYPE *QueryInterface)(
+ IUnknown *This,
+ REFIID riid,
+ void **ppvObject);
+
+ ULONG (STDMETHODCALLTYPE *AddRef)(
+ IUnknown *This);
+
+ ULONG (STDMETHODCALLTYPE *Release)(
+ IUnknown *This);
+
+ END_INTERFACE
+} IUnknownVtbl;
+
+interface IUnknown {
+ CONST_VTBL IUnknownVtbl* lpVtbl;
+};
+
+#ifdef COBJMACROS
+/*** IUnknown methods ***/
+#define IUnknown_QueryInterface(This,riid,ppvObject) (This)->lpVtbl->QueryInterface(This,riid,ppvObject)
+#define IUnknown_AddRef(This) (This)->lpVtbl->AddRef(This)
+#define IUnknown_Release(This) (This)->lpVtbl->Release(This)
+#endif
+
+#endif
+
+#endif /* __IUnknown_INTERFACE_DEFINED__ */
+
+DEFINE_GUID(IID_IUnknown, 0x00000000, 0x0000, 0x0000, 0xc0,0x00, 0x00,0x00,0x00,0x00,0x00,0x46);
+
+#endif /* __unknwnbase_h__ */
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/winapifamily.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/winapifamily.h
new file mode 100644
index 00000000000..064c4c2d014
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/winapifamily.h
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+// Stub header to satisfy d3d12.h include. Unconditionally light up all APIs.
+#pragma once
+#define WINAPI_FAMILY_PARTITION(Partitions) 1 \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/windows.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/windows.h
new file mode 100644
index 00000000000..bcb2281439f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/windows.h
@@ -0,0 +1,18 @@
+#pragma once
+#include "basetsd.h"
+
+typedef struct RGNDATAHEADER {
+ DWORD dwSize;
+ DWORD iType;
+ DWORD nCount;
+ DWORD nRgnSize;
+ RECT rcBound;
+} RGNDATAHEADER;
+
+typedef struct RGNDATA {
+ RGNDATAHEADER rdh;
+ char Buffer[1];
+} RGNDATA;
+
+#define MAKE_HRESULT(sev,fac,code) \
+ ((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/client.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/client.h
new file mode 100644
index 00000000000..64293a70b2f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/client.h
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+// Stub to satisfy d3dx12.h include
+#pragma once
+#include <wsl/wrladapter.h> \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/implements.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/implements.h
new file mode 100644
index 00000000000..5a3979e1a4c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs/wrl/implements.h
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+// Stub to satisfy DML TF runtime includes
+#pragma once
+#include <wsl/wrladapter.h> \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/winadapter.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/winadapter.h
new file mode 100644
index 00000000000..ccb2b3c12f3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/winadapter.h
@@ -0,0 +1,6 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#pragma once
+
+#include <unknwn.h>
diff --git a/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/wrladapter.h b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/wrladapter.h
new file mode 100644
index 00000000000..fcfd894ff9c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/directx-headers/include/wsl/wrladapter.h
@@ -0,0 +1,803 @@
+// Copyright (c) Microsoft Corporation.
+// Licensed under the MIT License.
+
+#pragma once
+
+#include "winadapter.h"
+
+// defined by winadapter.h and needed by some windows headers, but conflicts
+// with some libc++ implementation headers
+#ifdef __in
+#undef __in
+#endif
+#ifdef __out
+#undef __out
+#endif
+
+#include <type_traits>
+#include <atomic>
+#include <memory>
+#include <new>
+#include <climits>
+#include <cassert>
+
+namespace Microsoft
+{
+namespace WRL
+{
+ namespace Details
+ {
+ struct BoolStruct { int Member; };
+ typedef int BoolStruct::* BoolType;
+
+ template <typename T> // T should be the ComPtr<T> or a derived type of it, not just the interface
+ class ComPtrRefBase
+ {
+ public:
+ typedef typename T::InterfaceType InterfaceType;
+
+ operator IUnknown**() const throw()
+ {
+ static_assert(__is_base_of(IUnknown, InterfaceType), "Invalid cast: InterfaceType does not derive from IUnknown");
+ return reinterpret_cast<IUnknown**>(ptr_->ReleaseAndGetAddressOf());
+ }
+
+ protected:
+ T* ptr_;
+ };
+
+ template <typename T>
+ class ComPtrRef : public Details::ComPtrRefBase<T> // T should be the ComPtr<T> or a derived type of it, not just the interface
+ {
+ using Super = Details::ComPtrRefBase<T>;
+ using InterfaceType = typename Super::InterfaceType;
+ public:
+ ComPtrRef(_In_opt_ T* ptr) throw()
+ {
+ this->ptr_ = ptr;
+ }
+
+ // Conversion operators
+ operator void**() const throw()
+ {
+ return reinterpret_cast<void**>(this->ptr_->ReleaseAndGetAddressOf());
+ }
+
+ // This is our operator ComPtr<U> (or the latest derived class from ComPtr (e.g. WeakRef))
+ operator T*() throw()
+ {
+ *this->ptr_ = nullptr;
+ return this->ptr_;
+ }
+
+ // We define operator InterfaceType**() here instead of on ComPtrRefBase<T>, since
+ // if InterfaceType is IUnknown or IInspectable, having it on the base will collide.
+ operator InterfaceType**() throw()
+ {
+ return this->ptr_->ReleaseAndGetAddressOf();
+ }
+
+ // This is used for IID_PPV_ARGS in order to do __uuidof(**(ppType)).
+ // It does not need to clear ptr_ at this point, it is done at IID_PPV_ARGS_Helper(ComPtrRef&) later in this file.
+ InterfaceType* operator *() throw()
+ {
+ return this->ptr_->Get();
+ }
+
+ // Explicit functions
+ InterfaceType* const * GetAddressOf() const throw()
+ {
+ return this->ptr_->GetAddressOf();
+ }
+
+ InterfaceType** ReleaseAndGetAddressOf() throw()
+ {
+ return this->ptr_->ReleaseAndGetAddressOf();
+ }
+ };
+ }
+
+ template <typename T>
+ class ComPtr
+ {
+ public:
+ typedef T InterfaceType;
+
+ protected:
+ InterfaceType *ptr_;
+ template<class U> friend class ComPtr;
+
+ void InternalAddRef() const throw()
+ {
+ if (ptr_ != nullptr)
+ {
+ ptr_->AddRef();
+ }
+ }
+
+ unsigned long InternalRelease() throw()
+ {
+ unsigned long ref = 0;
+ T* temp = ptr_;
+
+ if (temp != nullptr)
+ {
+ ptr_ = nullptr;
+ ref = temp->Release();
+ }
+
+ return ref;
+ }
+
+ public:
+ ComPtr() throw() : ptr_(nullptr)
+ {
+ }
+
+ ComPtr(decltype(nullptr)) throw() : ptr_(nullptr)
+ {
+ }
+
+ template<class U>
+ ComPtr(_In_opt_ U *other) throw() : ptr_(other)
+ {
+ InternalAddRef();
+ }
+
+ ComPtr(const ComPtr& other) throw() : ptr_(other.ptr_)
+ {
+ InternalAddRef();
+ }
+
+ // copy constructor that allows to instantiate class when U* is convertible to T*
+ template<class U>
+ ComPtr(const ComPtr<U> &other, typename std::enable_if<std::is_convertible<U*, T*>::value, void *>::type * = 0) throw() :
+ ptr_(other.ptr_)
+ {
+ InternalAddRef();
+ }
+
+ ComPtr(_Inout_ ComPtr &&other) throw() : ptr_(nullptr)
+ {
+ if (this != reinterpret_cast<ComPtr*>(&reinterpret_cast<unsigned char&>(other)))
+ {
+ Swap(other);
+ }
+ }
+
+ // Move constructor that allows instantiation of a class when U* is convertible to T*
+ template<class U>
+ ComPtr(_Inout_ ComPtr<U>&& other, typename std::enable_if<std::is_convertible<U*, T*>::value, void *>::type * = 0) throw() :
+ ptr_(other.ptr_)
+ {
+ other.ptr_ = nullptr;
+ }
+
+ ~ComPtr() throw()
+ {
+ InternalRelease();
+ }
+
+ ComPtr& operator=(decltype(nullptr)) throw()
+ {
+ InternalRelease();
+ return *this;
+ }
+
+ ComPtr& operator=(_In_opt_ T *other) throw()
+ {
+ if (ptr_ != other)
+ {
+ ComPtr(other).Swap(*this);
+ }
+ return *this;
+ }
+
+ template <typename U>
+ ComPtr& operator=(_In_opt_ U *other) throw()
+ {
+ ComPtr(other).Swap(*this);
+ return *this;
+ }
+
+ ComPtr& operator=(const ComPtr &other) throw()
+ {
+ if (ptr_ != other.ptr_)
+ {
+ ComPtr(other).Swap(*this);
+ }
+ return *this;
+ }
+
+ template<class U>
+ ComPtr& operator=(const ComPtr<U>& other) throw()
+ {
+ ComPtr(other).Swap(*this);
+ return *this;
+ }
+
+ ComPtr& operator=(_Inout_ ComPtr &&other) throw()
+ {
+ ComPtr(static_cast<ComPtr&&>(other)).Swap(*this);
+ return *this;
+ }
+
+ template<class U>
+ ComPtr& operator=(_Inout_ ComPtr<U>&& other) throw()
+ {
+ ComPtr(static_cast<ComPtr<U>&&>(other)).Swap(*this);
+ return *this;
+ }
+
+ void Swap(_Inout_ ComPtr&& r) throw()
+ {
+ T* tmp = ptr_;
+ ptr_ = r.ptr_;
+ r.ptr_ = tmp;
+ }
+
+ void Swap(_Inout_ ComPtr& r) throw()
+ {
+ T* tmp = ptr_;
+ ptr_ = r.ptr_;
+ r.ptr_ = tmp;
+ }
+
+ operator Details::BoolType() const throw()
+ {
+ return Get() != nullptr ? &Details::BoolStruct::Member : nullptr;
+ }
+
+ T* Get() const throw()
+ {
+ return ptr_;
+ }
+
+ InterfaceType* operator->() const throw()
+ {
+ return ptr_;
+ }
+
+ Details::ComPtrRef<ComPtr<T>> operator&() throw()
+ {
+ return Details::ComPtrRef<ComPtr<T>>(this);
+ }
+
+ const Details::ComPtrRef<const ComPtr<T>> operator&() const throw()
+ {
+ return Details::ComPtrRef<const ComPtr<T>>(this);
+ }
+
+ T* const* GetAddressOf() const throw()
+ {
+ return &ptr_;
+ }
+
+ T** GetAddressOf() throw()
+ {
+ return &ptr_;
+ }
+
+ T** ReleaseAndGetAddressOf() throw()
+ {
+ InternalRelease();
+ return &ptr_;
+ }
+
+ T* Detach() throw()
+ {
+ T* ptr = ptr_;
+ ptr_ = nullptr;
+ return ptr;
+ }
+
+ void Attach(_In_opt_ InterfaceType* other) throw()
+ {
+ if (ptr_ != nullptr)
+ {
+ auto ref = ptr_->Release();
+ // DBG_UNREFERENCED_LOCAL_VARIABLE(ref);
+ // Attaching to the same object only works if duplicate references are being coalesced. Otherwise
+ // re-attaching will cause the pointer to be released and may cause a crash on a subsequent dereference.
+ assert(ref != 0 || ptr_ != other);
+ }
+
+ ptr_ = other;
+ }
+
+ unsigned long Reset()
+ {
+ return InternalRelease();
+ }
+
+ // Previously, unsafe behavior could be triggered when 'this' is ComPtr<IInspectable> or ComPtr<IUnknown> and CopyTo is used to copy to another type U.
+ // The user will use operator& to convert the destination into a ComPtrRef, which can then implicit cast to IInspectable** and IUnknown**.
+ // If this overload of CopyTo is not present, it will implicitly cast to IInspectable or IUnknown and match CopyTo(InterfaceType**) instead.
+ // A valid polymoprhic downcast requires run-time type checking via QueryInterface, so CopyTo(InterfaceType**) will break type safety.
+ // This overload matches ComPtrRef before the implicit cast takes place, preventing the unsafe downcast.
+ template <typename U>
+ HRESULT CopyTo(Details::ComPtrRef<ComPtr<U>> ptr, typename std::enable_if<
+ (std::is_same<T, IUnknown>::value)
+ && !std::is_same<U*, T*>::value, void *>::type * = 0) const throw()
+ {
+ return ptr_->QueryInterface(__uuidof(U), ptr);
+ }
+
+ HRESULT CopyTo(_Outptr_result_maybenull_ InterfaceType** ptr) const throw()
+ {
+ InternalAddRef();
+ *ptr = ptr_;
+ return S_OK;
+ }
+
+ HRESULT CopyTo(REFIID riid, _Outptr_result_nullonfailure_ void** ptr) const throw()
+ {
+ return ptr_->QueryInterface(riid, ptr);
+ }
+
+ template<typename U>
+ HRESULT CopyTo(_Outptr_result_nullonfailure_ U** ptr) const throw()
+ {
+ return ptr_->QueryInterface(__uuidof(U), reinterpret_cast<void**>(ptr));
+ }
+
+ // query for U interface
+ template<typename U>
+ HRESULT As(_Inout_ Details::ComPtrRef<ComPtr<U>> p) const throw()
+ {
+ return ptr_->QueryInterface(__uuidof(U), p);
+ }
+
+ // query for U interface
+ template<typename U>
+ HRESULT As(_Out_ ComPtr<U>* p) const throw()
+ {
+ return ptr_->QueryInterface(__uuidof(U), reinterpret_cast<void**>(p->ReleaseAndGetAddressOf()));
+ }
+
+ // query for riid interface and return as IUnknown
+ HRESULT AsIID(REFIID riid, _Out_ ComPtr<IUnknown>* p) const throw()
+ {
+ return ptr_->QueryInterface(riid, reinterpret_cast<void**>(p->ReleaseAndGetAddressOf()));
+ }
+
+ }; // ComPtr
+
+
+ namespace Details
+ {
+ // Empty struct used as default template parameter
+ class Nil
+ {
+ };
+
+ // Empty struct used for validating template parameter types in Implements
+ struct ImplementsBase
+ {
+ };
+
+ class RuntimeClassBase
+ {
+ protected:
+ template<typename T>
+ static HRESULT AsIID(_In_ T* implements, REFIID riid, _Outptr_result_nullonfailure_ void **ppvObject) noexcept
+ {
+ *ppvObject = nullptr;
+ bool isRefDelegated = false;
+ // Prefer InlineIsEqualGUID over other forms since it's better perf on 4-byte aligned data, which is almost always the case.
+ if (InlineIsEqualGUID(riid, __uuidof(IUnknown)))
+ {
+ *ppvObject = implements->CastToUnknown();
+ static_cast<IUnknown*>(*ppvObject)->AddRef();
+ return S_OK;
+ }
+
+ HRESULT hr = implements->CanCastTo(riid, ppvObject, &isRefDelegated);
+ if (SUCCEEDED(hr) && !isRefDelegated)
+ {
+ static_cast<IUnknown*>(*ppvObject)->AddRef();
+ }
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable: 6102) // '*ppvObject' is used but may not be initialized
+#endif
+ _Analysis_assume_(SUCCEEDED(hr) || (*ppvObject == nullptr));
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+ return hr;
+ }
+
+ public:
+ HRESULT RuntimeClassInitialize() noexcept
+ {
+ return S_OK;
+ }
+ };
+
+ // Interface traits provides casting and filling iids methods helpers
+ template<typename I0>
+ struct InterfaceTraits
+ {
+ typedef I0 Base;
+
+ template<typename T>
+ static Base* CastToBase(_In_ T* ptr) noexcept
+ {
+ return static_cast<Base*>(ptr);
+ }
+
+ template<typename T>
+ static IUnknown* CastToUnknown(_In_ T* ptr) noexcept
+ {
+ return static_cast<IUnknown*>(static_cast<Base*>(ptr));
+ }
+
+ template <typename T>
+ _Success_(return == true)
+ static bool CanCastTo(_In_ T* ptr, REFIID riid, _Outptr_ void **ppv) noexcept
+ {
+ // Prefer InlineIsEqualGUID over other forms since it's better perf on 4-byte aligned data, which is almost always the case.
+ if (InlineIsEqualGUID(riid, __uuidof(Base)))
+ {
+ *ppv = static_cast<Base*>(ptr);
+ return true;
+ }
+
+ return false;
+ }
+ };
+
+ // Specialization for Nil parameter
+ template<>
+ struct InterfaceTraits<Nil>
+ {
+ typedef Nil Base;
+
+ template <typename T>
+ _Success_(return == true)
+ static bool CanCastTo(_In_ T*, REFIID, _Outptr_ void **) noexcept
+ {
+ return false;
+ }
+ };
+
+ // ChainInterfaces - template allows specifying a derived COM interface along with its class hierarchy to allow QI for the base interfaces
+ template <typename I0, typename I1, typename I2 = Nil, typename I3 = Nil,
+ typename I4 = Nil, typename I5 = Nil, typename I6 = Nil,
+ typename I7 = Nil, typename I8 = Nil, typename I9 = Nil>
+ struct ChainInterfaces : I0
+ {
+ protected:
+ HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv) throw()
+ {
+ typename InterfaceTraits<I0>::Base* ptr = InterfaceTraits<I0>::CastToBase(this);
+
+ return (InterfaceTraits<I0>::CanCastTo(this, riid, ppv) ||
+ InterfaceTraits<I1>::CanCastTo(ptr, riid, ppv) ||
+ InterfaceTraits<I2>::CanCastTo(ptr, riid, ppv) ||
+ InterfaceTraits<I3>::CanCastTo(ptr, riid, ppv) ||
+ InterfaceTraits<I4>::CanCastTo(ptr, riid, ppv) ||
+ InterfaceTraits<I5>::CanCastTo(ptr, riid, ppv) ||
+ InterfaceTraits<I6>::CanCastTo(ptr, riid, ppv) ||
+ InterfaceTraits<I7>::CanCastTo(ptr, riid, ppv) ||
+ InterfaceTraits<I8>::CanCastTo(ptr, riid, ppv) ||
+ InterfaceTraits<I9>::CanCastTo(ptr, riid, ppv)) ? S_OK : E_NOINTERFACE;
+ }
+
+ IUnknown* CastToUnknown() throw()
+ {
+ return InterfaceTraits<I0>::CastToUnknown(this);
+ }
+ };
+
+ // Helper template used by Implements. This template traverses a list of interfaces and adds them as base class and information
+ // to enable QI.
+ template <typename ...TInterfaces>
+ struct ImplementsHelper;
+
+ template <typename T>
+ struct ImplementsMarker
+ {};
+
+ template <typename I0, bool isImplements>
+ struct MarkImplements;
+
+ template <typename I0>
+ struct MarkImplements<I0, false>
+ {
+ typedef I0 Type;
+ };
+
+ template <typename I0>
+ struct MarkImplements<I0, true>
+ {
+ typedef ImplementsMarker<I0> Type;
+ };
+
+ // AdjustImplements pre-processes the type list for more efficient builds.
+ template <typename ...Bases>
+ struct AdjustImplements;
+
+ template <typename I0, typename ...Bases>
+ struct AdjustImplements<I0, Bases...>
+ {
+ typedef ImplementsHelper<typename MarkImplements<I0, std::is_base_of<ImplementsBase, I0>::value>::Type, Bases...> Type;
+ };
+
+ // Use AdjustImplements to remove instances of "Nil" from the type list.
+ template <typename ...Bases>
+ struct AdjustImplements<Nil, Bases...>
+ {
+ typedef typename AdjustImplements<Bases...>::Type Type;
+ };
+
+ template <>
+ struct AdjustImplements<>
+ {
+ typedef ImplementsHelper<> Type;
+ };
+
+ // Specialization handles unadorned interfaces
+ template <typename I0, typename ...TInterfaces>
+ struct ImplementsHelper<I0, TInterfaces...> :
+ I0,
+ AdjustImplements<TInterfaces...>::Type
+ {
+ template <typename ...> friend struct ImplementsHelper;
+ friend class RuntimeClassBase;
+
+ protected:
+
+ HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv, bool *pRefDelegated = nullptr) noexcept
+ {
+ // Prefer InlineIsEqualGUID over other forms since it's better perf on 4-byte aligned data, which is almost always the case.
+ if (InlineIsEqualGUID(riid, __uuidof(I0)))
+ {
+ *ppv = reinterpret_cast<I0*>(reinterpret_cast<void*>(this));
+ return S_OK;
+ }
+ return AdjustImplements<TInterfaces...>::Type::CanCastTo(riid, ppv, pRefDelegated);
+ }
+
+ IUnknown* CastToUnknown() noexcept
+ {
+ return reinterpret_cast<I0*>(reinterpret_cast<void*>(this));
+ }
+ };
+
+
+ // Selector is used to "tag" base interfaces to be used in casting, since a runtime class may indirectly derive from
+ // the same interface or Implements<> template multiple times
+ template <typename base, typename disciminator>
+ struct Selector : public base
+ {
+ };
+
+ // Specialization handles types that derive from ImplementsHelper (e.g. nested Implements).
+ template <typename I0, typename ...TInterfaces>
+ struct ImplementsHelper<ImplementsMarker<I0>, TInterfaces...> :
+ Selector<I0, ImplementsHelper<ImplementsMarker<I0>, TInterfaces...>>,
+ Selector<typename AdjustImplements<TInterfaces...>::Type, ImplementsHelper<ImplementsMarker<I0>, TInterfaces...>>
+ {
+ template <typename ...> friend struct ImplementsHelper;
+ friend class RuntimeClassBase;
+
+ protected:
+ typedef Selector<I0, ImplementsHelper<ImplementsMarker<I0>, TInterfaces...>> CurrentType;
+ typedef Selector<typename AdjustImplements<TInterfaces...>::Type, ImplementsHelper<ImplementsMarker<I0>, TInterfaces...>> BaseType;
+
+ HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv, bool *pRefDelegated = nullptr) noexcept
+ {
+ HRESULT hr = CurrentType::CanCastTo(riid, ppv);
+ if (hr == E_NOINTERFACE)
+ {
+ hr = BaseType::CanCastTo(riid, ppv, pRefDelegated);
+ }
+ return hr;
+ }
+
+ IUnknown* CastToUnknown() noexcept
+ {
+ // First in list wins.
+ return CurrentType::CastToUnknown();
+ }
+ };
+
+ // terminal case specialization.
+ template <>
+ struct ImplementsHelper<>
+ {
+ template <typename ...> friend struct ImplementsHelper;
+ friend class RuntimeClassBase;
+
+ protected:
+ HRESULT CanCastTo(_In_ REFIID /*riid*/, _Outptr_ void ** /*ppv*/, bool * /*pRefDelegated*/ = nullptr) noexcept
+ {
+ return E_NOINTERFACE;
+ }
+
+ // IUnknown* CastToUnknown() noexcept; // not defined for terminal case.
+ };
+
+ // Specialization handles chaining interfaces
+ template <typename C0, typename C1, typename C2, typename C3, typename C4, typename C5, typename C6, typename C7, typename C8, typename C9, typename ...TInterfaces>
+ struct ImplementsHelper<ChainInterfaces<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9>, TInterfaces...> :
+ ChainInterfaces<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9>,
+ AdjustImplements<TInterfaces...>::Type
+ {
+ template <typename ...> friend struct ImplementsHelper;
+ friend class RuntimeClassBase;
+
+ protected:
+ typedef typename AdjustImplements<TInterfaces...>::Type BaseType;
+
+ HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv, bool *pRefDelegated = nullptr) noexcept
+ {
+ HRESULT hr = ChainInterfaces<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9>::CanCastTo(riid, ppv);
+ if (FAILED(hr))
+ {
+ hr = BaseType::CanCastTo(riid, ppv, pRefDelegated);
+ }
+
+ return hr;
+ }
+
+ IUnknown* CastToUnknown() noexcept
+ {
+ return ChainInterfaces<C0, C1, C2, C3, C4, C5, C6, C7, C8, C9>::CastToUnknown();
+ }
+ };
+
+ // Implements - template implementing QI using the information provided through its template parameters
+ // Each template parameter has to be one of the following:
+ // * COM Interface
+ // * A class that implements one or more COM interfaces
+ // * ChainInterfaces template
+ template <typename I0, typename ...TInterfaces>
+ struct Implements :
+ AdjustImplements<I0, TInterfaces...>::Type,
+ ImplementsBase
+ {
+ public:
+ typedef I0 FirstInterface;
+ protected:
+ typedef typename AdjustImplements<I0, TInterfaces...>::Type BaseType;
+ template <typename ...> friend struct ImplementsHelper;
+ friend class RuntimeClassBase;
+
+ HRESULT CanCastTo(REFIID riid, _Outptr_ void **ppv) noexcept
+ {
+ return BaseType::CanCastTo(riid, ppv);
+ }
+
+ IUnknown* CastToUnknown() noexcept
+ {
+ return BaseType::CastToUnknown();
+ }
+ };
+
+ // Used on RuntimeClass to protect it from being constructed with new
+ class DontUseNewUseMake
+ {
+ private:
+ void* operator new(size_t) noexcept
+ {
+ assert(false);
+ return 0;
+ }
+
+ public:
+ void* operator new(size_t, _In_ void* placement) noexcept
+ {
+ return placement;
+ }
+ };
+
+ template <typename ...TInterfaces>
+ class RuntimeClassImpl :
+ public AdjustImplements<TInterfaces...>::Type,
+ public RuntimeClassBase,
+ public DontUseNewUseMake
+ {
+ public:
+ STDMETHOD(QueryInterface)(REFIID riid, _Outptr_result_nullonfailure_ void **ppvObject)
+ {
+ return Super::AsIID(this, riid, ppvObject);
+ }
+
+ STDMETHOD_(ULONG, AddRef)()
+ {
+ return InternalAddRef();
+ }
+
+ STDMETHOD_(ULONG, Release)()
+ {
+ ULONG ref = InternalRelease();
+ if (ref == 0)
+ {
+ this->~RuntimeClassImpl();
+ delete[] reinterpret_cast<char*>(this);
+ }
+
+ return ref;
+ }
+
+ protected:
+ using Super = RuntimeClassBase;
+ static const LONG c_lProtectDestruction = -(LONG_MAX / 2);
+
+ RuntimeClassImpl() noexcept = default;
+
+ virtual ~RuntimeClassImpl() noexcept
+ {
+ // Set refcount_ to -(LONG_MAX/2) to protect destruction and
+ // also catch mismatched Release in debug builds
+ refcount_ = static_cast<ULONG>(c_lProtectDestruction);
+ }
+
+ ULONG InternalAddRef() noexcept
+ {
+ return ++refcount_;
+ }
+
+ ULONG InternalRelease() noexcept
+ {
+ return --refcount_;
+ }
+
+ unsigned long GetRefCount() const noexcept
+ {
+ return refcount_;
+ }
+
+ std::atomic<ULONG> refcount_{1};
+ };
+ }
+
+ template <typename ...TInterfaces>
+ class Base : public Details::RuntimeClassImpl<TInterfaces...>
+ {
+ Base(const Base&) = delete;
+ Base& operator=(const Base&) = delete;
+
+ protected:
+ HRESULT CustomQueryInterface(REFIID /*riid*/, _Outptr_result_nullonfailure_ void** /*ppvObject*/, _Out_ bool *handled)
+ {
+ *handled = false;
+ return S_OK;
+ }
+
+ public:
+ Base() throw() = default;
+ typedef Base RuntimeClassT;
+ };
+
+ // Creates a Nano-COM object wrapped in a smart pointer.
+ template <typename T, typename ...TArgs>
+ ComPtr<T> Make(TArgs&&... args)
+ {
+ std::unique_ptr<char[]> buffer(new(std::nothrow) char[sizeof(T)]);
+ ComPtr<T> object;
+
+ if (buffer)
+ {
+ T* ptr = new (buffer.get())T(std::forward<TArgs>(args)...);
+ object.Attach(ptr);
+ buffer.release();
+ }
+
+ return object;
+ }
+
+ using Details::ChainInterfaces;
+}
+}
+
+// Overloaded global function to provide to IID_PPV_ARGS that support Details::ComPtrRef
+template<typename T>
+void** IID_PPV_ARGS_Helper(Microsoft::WRL::Details::ComPtrRef<T> pp) throw()
+{
+ return pp;
+}
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/directx-sdk-eula.txt b/3rdparty/bgfx/3rdparty/dxsdk/directx-sdk-eula.txt
deleted file mode 100644
index 6b0f7a3e83e..00000000000
--- a/3rdparty/bgfx/3rdparty/dxsdk/directx-sdk-eula.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-MICROSOFT SOFTWARE LICENSE TERMS
-MICROSOFT DIRECTX SOFTWARE DEVELOPMENT KIT (SDK)
-These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. The terms also apply to any Microsoft
-• updates,
-• supplements,
-• Internet-based services, and
-• support services
-for this software, unless other terms accompany those items. If so, those terms apply.
-BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE.
-If you comply with these license terms, you have the rights below.
-1. INSTALLATION AND USE RIGHTS.
-a. Installation and Use. You may install and use any number of copies of the software on your devices.
-b. Included Microsoft Programs. The software contains other Microsoft programs. The license terms with those programs apply to your use of them.
-2. ADDITIONAL LICENSING REQUIREMENTS AND/OR USE RIGHTS.
-a. Media Elements and Templates. You may copy and use images, clip art, animations, sounds, music, shapes, video clips and templates provided with the software and identified for such use in documents and projects that you create. You may distribute those documents and projects non-commercially. If you wish to use these media elements or templates for any other purpose, go to www.microsoft.com/permission to learn whether that use is allowed.
-b. Distributable Code. The software contains code that you are permitted to distribute in programs you develop if you comply with the terms below.
-i. Right to Use and Distribute. The code and text files listed below are “Distributable Code.”
-• DIRECTX REDIST.TXT Files. You may copy and distribute the object code form of code listed in DIRECTX REDIST.TXT files.
-• Sample Code. You may modify, copy, and distribute the source and object code form of code marked as “sample”, as well as those marked as follows:
-\Utilities\bin\x86\dxerr
-\Utilities\bin\x64\dxerr
-\Utilities\bin\x86\dxtex
-\Utilities\bin\x64\dxtex
-\Utilities\bin\x86\DxViewer
-\Utilities\bin\x64\DxViewer
-\Utilities\bin\x86\GDFTrace
-\Utilities\bin\x64\GDFTrace
-\Utilities\bin\x86\MeshConvert
-\Utilities\bin\x64\MeshConvert
-\Utilities\Source\Sas
-\Utilities\Source\Effects11
-• Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs.
-ii. Distribution Requirements. For any Distributable Code you distribute, you must
-• add significant primary functionality to it in your programs;
-• require distributors and external end users to agree to terms that protect it at least as much as this agreement;
-• display your valid copyright notice on your programs; and
-• indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your programs.
-iii. Distribution Restrictions. You may not
-• alter any copyright, trademark or patent notice in the Distributable Code;
-• use Microsoft’s trademarks in your programs’ names or in a way that suggests your programs come from or are endorsed by Microsoft;
-• distribute Distributable Code to run on a platform other than the Windows, Xbox and Windows Mobile platforms;
-• include Distributable Code in malicious, deceptive or unlawful programs; or
-• modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that
-• the code be disclosed or distributed in source code form; or
-• others have the right to modify it.
-3. SCOPE OF LICENSE. The software is licensed, not sold. This agreement only gives you some rights to use the software. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you may use the software only as expressly permitted in this agreement. In doing so, you must comply with any technical limitations in the software that only allow you to use it in certain ways. You may not
-• disclose the results of any benchmark tests of the software to any third party without Microsoft’s prior written approval;
-• work around any technical limitations in the software;
-• reverse engineer, decompile or disassemble the software, except and only to the extent that applicable law expressly permits, despite this limitation;
-• make more copies of the software than specified in this agreement or allowed by applicable law, despite this limitation;
-• publish the software for others to copy;
-• rent, lease or lend the software; or
-• use the software for commercial software hosting services.
-4. BACKUP COPY. You may make one backup copy of the software. You may use it only to reinstall the software.
-5. DOCUMENTATION. Any person that has valid access to your computer or internal network may copy and use the documentation for your internal, reference purposes.
-6. EXPORT RESTRICTIONS. The software is subject to United States export laws and regulations. You must comply with all domestic and international export laws and regulations that apply to the software. These laws include restrictions on destinations, end users and end use. For additional information, see www.microsoft.com/exporting.
-7. SUPPORT SERVICES. Because this software is “as is,” we may not provide support services for it.
-8. ENTIRE AGREEMENT. This agreement, and the terms for supplements, updates, Internet-based services and support services that you use, are the entire agreement for the software and support services.
-9. APPLICABLE LAW.
-a. United States. If you acquired the software in the United States, Washington state law governs the interpretation of this agreement and applies to claims for breach of it, regardless of conflict of laws principles. The laws of the state where you live govern all other claims, including claims under state consumer protection laws, unfair competition laws, and in tort.
-b. Outside the United States. If you acquired the software in any other country, the laws of that country apply.
-10. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws of your country. You may also have rights with respect to the party from whom you acquired the software. This agreement does not change your rights under the laws of your country if the laws of your country do not permit it to do so.
-11. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS-IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES OR CONDITIONS. YOU MAY HAVE ADDITIONAL CONSUMER RIGHTS UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT EXCLUDES THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
-12. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
-This limitation applies to
-• anything related to the software, services, content (including code) on third party Internet sites, or third party programs; and
-• claims for breach of contract, breach of warranty, guarantee or condition, strict liability, negligence, or other tort to the extent permitted by applicable law.
-It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your country may not allow the exclusion or limitation of incidental, consequential or other damages.
-Please note: As this software is distributed in Quebec, Canada, some of the clauses in this agreement are provided below in French.
-Remarque : Ce logiciel étant distribué au Québec, Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français.
-EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.
-LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices.
-Cette limitation concerne :
-• tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers ; et
-• les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur.
-Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Si votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard.
-EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas. \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12_1.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12_1.h
deleted file mode 100644
index 2f215870642..00000000000
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12_1.h
+++ /dev/null
@@ -1,2539 +0,0 @@
-/*-------------------------------------------------------------------------------------
- *
- * Copyright (c) Microsoft Corporation
- *
- *-------------------------------------------------------------------------------------*/
-
-
-/* this ALWAYS GENERATED file contains the definitions for the interfaces */
-
-
- /* File created by MIDL compiler version 8.01.0622 */
-
-
-
-/* verify that the <rpcndr.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
-#endif
-
-/* verify that the <rpcsal.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCSAL_H_VERSION__
-#define __REQUIRED_RPCSAL_H_VERSION__ 100
-#endif
-
-#include "rpc.h"
-#include "rpcndr.h"
-
-#ifndef __RPCNDR_H_VERSION__
-#error this stub requires an updated version of <rpcndr.h>
-#endif /* __RPCNDR_H_VERSION__ */
-
-#ifndef COM_NO_WINDOWS_H
-#include "windows.h"
-#include "ole2.h"
-#endif /*COM_NO_WINDOWS_H*/
-
-#ifndef __d3d12_1_h__
-#define __d3d12_1_h__
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-#pragma once
-#endif
-
-/* Forward Declarations */
-
-#ifndef __ID3D12CryptoSession_FWD_DEFINED__
-#define __ID3D12CryptoSession_FWD_DEFINED__
-typedef interface ID3D12CryptoSession ID3D12CryptoSession;
-
-#endif /* __ID3D12CryptoSession_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12CryptoSessionPolicy_FWD_DEFINED__
-#define __ID3D12CryptoSessionPolicy_FWD_DEFINED__
-typedef interface ID3D12CryptoSessionPolicy ID3D12CryptoSessionPolicy;
-
-#endif /* __ID3D12CryptoSessionPolicy_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12ContentProtectionDevice_FWD_DEFINED__
-#define __ID3D12ContentProtectionDevice_FWD_DEFINED__
-typedef interface ID3D12ContentProtectionDevice ID3D12ContentProtectionDevice;
-
-#endif /* __ID3D12ContentProtectionDevice_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12VideoDecodeCommandList2_FWD_DEFINED__
-#define __ID3D12VideoDecodeCommandList2_FWD_DEFINED__
-typedef interface ID3D12VideoDecodeCommandList2 ID3D12VideoDecodeCommandList2;
-
-#endif /* __ID3D12VideoDecodeCommandList2_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12VideoProcessCommandList2_FWD_DEFINED__
-#define __ID3D12VideoProcessCommandList2_FWD_DEFINED__
-typedef interface ID3D12VideoProcessCommandList2 ID3D12VideoProcessCommandList2;
-
-#endif /* __ID3D12VideoProcessCommandList2_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12StateObjectPrototype_FWD_DEFINED__
-#define __ID3D12StateObjectPrototype_FWD_DEFINED__
-typedef interface ID3D12StateObjectPrototype ID3D12StateObjectPrototype;
-
-#endif /* __ID3D12StateObjectPrototype_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12StateObjectPropertiesPrototype_FWD_DEFINED__
-#define __ID3D12StateObjectPropertiesPrototype_FWD_DEFINED__
-typedef interface ID3D12StateObjectPropertiesPrototype ID3D12StateObjectPropertiesPrototype;
-
-#endif /* __ID3D12StateObjectPropertiesPrototype_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12DeviceRaytracingPrototype_FWD_DEFINED__
-#define __ID3D12DeviceRaytracingPrototype_FWD_DEFINED__
-typedef interface ID3D12DeviceRaytracingPrototype ID3D12DeviceRaytracingPrototype;
-
-#endif /* __ID3D12DeviceRaytracingPrototype_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12CommandListRaytracingPrototype_FWD_DEFINED__
-#define __ID3D12CommandListRaytracingPrototype_FWD_DEFINED__
-typedef interface ID3D12CommandListRaytracingPrototype ID3D12CommandListRaytracingPrototype;
-
-#endif /* __ID3D12CommandListRaytracingPrototype_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12DeviceMetaCommand_FWD_DEFINED__
-#define __ID3D12DeviceMetaCommand_FWD_DEFINED__
-typedef interface ID3D12DeviceMetaCommand ID3D12DeviceMetaCommand;
-
-#endif /* __ID3D12DeviceMetaCommand_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12MetaCommand_FWD_DEFINED__
-#define __ID3D12MetaCommand_FWD_DEFINED__
-typedef interface ID3D12MetaCommand ID3D12MetaCommand;
-
-#endif /* __ID3D12MetaCommand_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12CommandListMetaCommand_FWD_DEFINED__
-#define __ID3D12CommandListMetaCommand_FWD_DEFINED__
-typedef interface ID3D12CommandListMetaCommand ID3D12CommandListMetaCommand;
-
-#endif /* __ID3D12CommandListMetaCommand_FWD_DEFINED__ */
-
-
-/* header files for imported files */
-#include "oaidl.h"
-#include "ocidl.h"
-#include "dxgicommon.h"
-#include "d3dcommon.h"
-#include "d3d12.h"
-#include "d3d12video.h"
-
-#ifdef __cplusplus
-extern "C"{
-#endif
-
-
-/* interface __MIDL_itf_d3d12_1_0000_0000 */
-/* [local] */
-
-#include <winapifamily.h>
-// BK - pragma region App Family
-#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)
-#define D3D12_FEATURE_VIDEO_DECODE_BITSTREAM_ENCRYPTION_SCHEMES static_cast<D3D12_FEATURE_VIDEO>(4)
-#define D3D12_FEATURE_VIDEO_DECODE_BITSTREAM_ENCRYPTION_SCHEME_COUNT static_cast<D3D12_FEATURE_VIDEO>(12)
-#define D3D12_FEATURE_VIDEO_CRYPTO_SESSION_SUPPORT static_cast<D3D12_FEATURE_VIDEO>(13)
-#define D3D12_FEATURE_VIDEO_CONTENT_PROTECTION_SYSTEM_COUNT static_cast<D3D12_FEATURE_VIDEO>(14)
-#define D3D12_FEATURE_VIDEO_CONTENT_PROTECTION_SYSTEM_SUPPORT static_cast<D3D12_FEATURE_VIDEO>(15)
-#define D3D12_FEATURE_VIDEO_CRYPTO_SESSION_TRANSFORM_SUPPORT static_cast<D3D12_FEATURE_VIDEO>(16)
-#define D3D12_BITSTREAM_ENCRYPTION_TYPE_CENC_AES_CTR_128 static_cast<D3D12_BITSTREAM_ENCRYPTION_TYPE>(1)
-typedef struct D3D12_FEATURE_DATA_VIDEO_CONTENT_PROTECTION_SYSTEM_COUNT
- {
- UINT NodeIndex;
- UINT ContentProtectionSystemCount;
- } D3D12_FEATURE_DATA_VIDEO_CONTENT_PROTECTION_SYSTEM_COUNT;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_CONTENT_PROTECTION_SYSTEM_SUPPORT
- {
- UINT NodeIndex;
- UINT ContentProtectionSystemCount;
- GUID *pContentProtectionSystems;
- } D3D12_FEATURE_DATA_VIDEO_CONTENT_PROTECTION_SYSTEM_SUPPORT;
-
-typedef
-enum D3D12_CRYPTO_SESSION_SUPPORT_FLAGS
- {
- D3D12_CRYPTO_SESSION_SUPPORT_FLAG_NONE = 0,
- D3D12_CRYPTO_SESSION_SUPPORT_FLAG_SUPPORTED = 0x1,
- D3D12_CRYPTO_SESSION_SUPPORT_FLAG_HEADER_DECRYPTION_REQUIRED = 0x2,
- D3D12_CRYPTO_SESSION_SUPPORT_FLAG_INDEPENDENT_DECRYPTION_REQUIRED = 0x4,
- D3D12_CRYPTO_SESSION_SUPPORT_FLAG_TRANSCRYPTION_REQUIRED = 0x8
- } D3D12_CRYPTO_SESSION_SUPPORT_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS( D3D12_CRYPTO_SESSION_SUPPORT_FLAGS );
-typedef
-enum D3D12_CRYPTO_SESSION_FLAGS
- {
- D3D12_CRYPTO_SESSION_FLAG_NONE = 0,
- D3D12_CRYPTO_SESSION_FLAG_HARDWARE = 0x1
- } D3D12_CRYPTO_SESSION_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS( D3D12_CRYPTO_SESSION_FLAGS );
-typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_BITSTREAM_ENCRYPTION_SCHEME_COUNT
- {
- UINT NodeIndex;
- GUID DecodeProfile;
- UINT EncryptionSchemeCount;
- } D3D12_FEATURE_DATA_VIDEO_DECODE_BITSTREAM_ENCRYPTION_SCHEME_COUNT;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_BITSTREAM_ENCRYPTION_SCHEMES
- {
- UINT NodeIndex;
- GUID DecodeProfile;
- UINT EncryptionSchemeCount;
- _Field_size_full_(EncryptionSchemeCount) D3D12_BITSTREAM_ENCRYPTION_TYPE *pEncryptionSchemes;
- } D3D12_FEATURE_DATA_VIDEO_DECODE_BITSTREAM_ENCRYPTION_SCHEMES;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_CRYPTO_SESSION_SUPPORT
- {
- UINT NodeIndex;
- GUID DecodeProfile;
- GUID ContentProtectionSystem;
- D3D12_CRYPTO_SESSION_FLAGS Flags;
- D3D12_BITSTREAM_ENCRYPTION_TYPE BitstreamEncryption;
- UINT KeyBaseDataSize;
- D3D12_CRYPTO_SESSION_SUPPORT_FLAGS Support;
- } D3D12_FEATURE_DATA_VIDEO_CRYPTO_SESSION_SUPPORT;
-
-typedef struct D3D12_CRYPTO_SESSION_DESC
- {
- UINT NodeMask;
- GUID DecodeProfile;
- GUID ContentProtectionSystem;
- D3D12_BITSTREAM_ENCRYPTION_TYPE BitstreamEncryption;
- D3D12_CRYPTO_SESSION_FLAGS Flags;
- } D3D12_CRYPTO_SESSION_DESC;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_1_0000_0000_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_1_0000_0000_v0_0_s_ifspec;
-
-#ifndef __ID3D12CryptoSession_INTERFACE_DEFINED__
-#define __ID3D12CryptoSession_INTERFACE_DEFINED__
-
-/* interface ID3D12CryptoSession */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12CryptoSession;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("FC7C6C9D-C27D-4904-835D-A5F2096EC65F")
- ID3D12CryptoSession : public ID3D12ProtectedSession
- {
- public:
- virtual D3D12_CRYPTO_SESSION_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetKeyBaseData(
- UINT KeyInputDataSize,
- _In_reads_bytes_( KeyInputDataSize ) const void *pKeyInputData,
- UINT KeyBaseDataSize,
- _Out_writes_bytes_( KeyBaseDataSize ) void *pKeyBaseData) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12CryptoSessionVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12CryptoSession * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12CryptoSession * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12CryptoSession * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12CryptoSession * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12CryptoSession * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12CryptoSession * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12CryptoSession * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12CryptoSession * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- HRESULT ( STDMETHODCALLTYPE *GetStatusFence )(
- ID3D12CryptoSession * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppFence);
-
- D3D12_PROTECTED_SESSION_STATUS ( STDMETHODCALLTYPE *GetSessionStatus )(
- ID3D12CryptoSession * This);
-
- D3D12_CRYPTO_SESSION_DESC ( STDMETHODCALLTYPE *GetDesc )(
- ID3D12CryptoSession * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetKeyBaseData )(
- ID3D12CryptoSession * This,
- UINT KeyInputDataSize,
- _In_reads_bytes_( KeyInputDataSize ) const void *pKeyInputData,
- UINT KeyBaseDataSize,
- _Out_writes_bytes_( KeyBaseDataSize ) void *pKeyBaseData);
-
- END_INTERFACE
- } ID3D12CryptoSessionVtbl;
-
- interface ID3D12CryptoSession
- {
- CONST_VTBL struct ID3D12CryptoSessionVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12CryptoSession_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12CryptoSession_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12CryptoSession_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12CryptoSession_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12CryptoSession_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12CryptoSession_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12CryptoSession_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12CryptoSession_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-#define ID3D12CryptoSession_GetStatusFence(This,riid,ppFence) \
- ( (This)->lpVtbl -> GetStatusFence(This,riid,ppFence) )
-
-#define ID3D12CryptoSession_GetSessionStatus(This) \
- ( (This)->lpVtbl -> GetSessionStatus(This) )
-
-
-#define ID3D12CryptoSession_GetDesc(This) \
- ( (This)->lpVtbl -> GetDesc(This) )
-
-#define ID3D12CryptoSession_GetKeyBaseData(This,KeyInputDataSize,pKeyInputData,KeyBaseDataSize,pKeyBaseData) \
- ( (This)->lpVtbl -> GetKeyBaseData(This,KeyInputDataSize,pKeyInputData,KeyBaseDataSize,pKeyBaseData) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12CryptoSession_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12CryptoSessionPolicy_INTERFACE_DEFINED__
-#define __ID3D12CryptoSessionPolicy_INTERFACE_DEFINED__
-
-/* interface ID3D12CryptoSessionPolicy */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12CryptoSessionPolicy;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("69FE3108-01A4-4AC3-AB91-F51E377A62AC")
- ID3D12CryptoSessionPolicy : public ID3D12DeviceChild
- {
- public:
- virtual UINT STDMETHODCALLTYPE GetKeyInfoSize( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetKeyInfo(
- _Out_writes_bytes_( KeyInfoDataSize ) void *pKeyInfo,
- UINT KeyInfoDataSize) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetCryptoSession(
- REFIID riid,
- _COM_Outptr_opt_ void **ppCryptoSession) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12CryptoSessionPolicyVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12CryptoSessionPolicy * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12CryptoSessionPolicy * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12CryptoSessionPolicy * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12CryptoSessionPolicy * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12CryptoSessionPolicy * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12CryptoSessionPolicy * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12CryptoSessionPolicy * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12CryptoSessionPolicy * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- UINT ( STDMETHODCALLTYPE *GetKeyInfoSize )(
- ID3D12CryptoSessionPolicy * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetKeyInfo )(
- ID3D12CryptoSessionPolicy * This,
- _Out_writes_bytes_( KeyInfoDataSize ) void *pKeyInfo,
- UINT KeyInfoDataSize);
-
- HRESULT ( STDMETHODCALLTYPE *GetCryptoSession )(
- ID3D12CryptoSessionPolicy * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppCryptoSession);
-
- END_INTERFACE
- } ID3D12CryptoSessionPolicyVtbl;
-
- interface ID3D12CryptoSessionPolicy
- {
- CONST_VTBL struct ID3D12CryptoSessionPolicyVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12CryptoSessionPolicy_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12CryptoSessionPolicy_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12CryptoSessionPolicy_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12CryptoSessionPolicy_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12CryptoSessionPolicy_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12CryptoSessionPolicy_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12CryptoSessionPolicy_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12CryptoSessionPolicy_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-#define ID3D12CryptoSessionPolicy_GetKeyInfoSize(This) \
- ( (This)->lpVtbl -> GetKeyInfoSize(This) )
-
-#define ID3D12CryptoSessionPolicy_GetKeyInfo(This,pKeyInfo,KeyInfoDataSize) \
- ( (This)->lpVtbl -> GetKeyInfo(This,pKeyInfo,KeyInfoDataSize) )
-
-#define ID3D12CryptoSessionPolicy_GetCryptoSession(This,riid,ppCryptoSession) \
- ( (This)->lpVtbl -> GetCryptoSession(This,riid,ppCryptoSession) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12CryptoSessionPolicy_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12_1_0000_0002 */
-/* [local] */
-
-typedef
-enum D3D12_CRYPTO_SESSION_TRANSFORM_OPERATION
- {
- D3D12_CRYPTO_SESSION_TRANSFORM_OPERATION_NONE = 0,
- D3D12_CRYPTO_SESSION_TRANSFORM_OPERATION_DECRYPT = 1,
- D3D12_CRYPTO_SESSION_TRANSFORM_OPERATION_DECRYPT_WITH_HEADER = 2,
- D3D12_CRYPTO_SESSION_TRANSFORM_OPERATION_TRANSCRYPT = 3,
- D3D12_CRYPTO_SESSION_TRANSFORM_OPERATION_TRANSCRYPT_WITH_HEADER = 4,
- D3D12_CRYPTO_SESSION_TRANSFORM_OPERATION_DECRYPT_HEADER = 5
- } D3D12_CRYPTO_SESSION_TRANSFORM_OPERATION;
-
-typedef
-enum D3D12_CRYPTO_SESSION_TRANSFORM_SUPPORT_FLAGS
- {
- D3D12_CRYPTO_SESSION_TRANSFORM_SUPPORT_FLAG_NONE = 0,
- D3D12_CRYPTO_SESSION_TRANSFORM_SUPPORT_FLAG_SUPPORTED = 0x1
- } D3D12_CRYPTO_SESSION_TRANSFORM_SUPPORT_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS( D3D12_CRYPTO_SESSION_TRANSFORM_SUPPORT_FLAGS );
-typedef struct D3D12_FEATURE_DATA_VIDEO_CRYPTO_SESSION_TRANSFORM_SUPPORT
- {
- UINT NodeIndex;
- GUID DecodeProfile;
- GUID ContentProtectionSystem;
- D3D12_CRYPTO_SESSION_FLAGS Flags;
- D3D12_BITSTREAM_ENCRYPTION_TYPE BitstreamEncryption;
- D3D12_CRYPTO_SESSION_TRANSFORM_OPERATION Operation;
- BOOL ProtectedOutputRequired;
- UINT64 InputAlignment;
- UINT64 InputPreambleSize;
- UINT64 OutputAlignment;
- UINT64 OutputPreambleSize;
- D3D12_CRYPTO_SESSION_TRANSFORM_SUPPORT_FLAGS Support;
- } D3D12_FEATURE_DATA_VIDEO_CRYPTO_SESSION_TRANSFORM_SUPPORT;
-
-typedef struct D3D12_CRYPTO_SESSION_TRANSFORM_DECRYPT_HEADER_INPUT_ARGUMENTS
- {
- BOOL Enable;
- _Field_size_bytes_full_(SliceHeadersSize) const void *pSliceHeaders;
- UINT64 SliceHeadersSize;
- _Field_size_full_(SliceHeaderCount) const DWORD *pSliceHeadersOffsets;
- UINT64 SliceHeaderCount;
- _Field_size_bytes_full_(ContextSize) const void *pContext;
- UINT64 ContextSize;
- } D3D12_CRYPTO_SESSION_TRANSFORM_DECRYPT_HEADER_INPUT_ARGUMENTS;
-
-typedef struct D3D12_CRYPTO_SESSION_TRANSFORM_INPUT_ARGUMENTS
- {
- ID3D12CryptoSessionPolicy *pCryptoSessionPolicy;
- ID3D12Resource *pBuffer;
- UINT64 Size;
- UINT64 Offset;
- _Field_size_bytes_full_(IVSize) const void *pIV;
- UINT IVSize;
- UINT SubSampleMappingCount;
- _Field_size_bytes_full_(SubSampleMappingCount) const void *pSubSampleMappingBlock;
- UINT64 ContextSize;
- _Field_size_bytes_full_(ContextSize) const void *pContext;
- D3D12_CRYPTO_SESSION_TRANSFORM_DECRYPT_HEADER_INPUT_ARGUMENTS EncryptedHeader;
- } D3D12_CRYPTO_SESSION_TRANSFORM_INPUT_ARGUMENTS;
-
-typedef struct D3D12_CRYPTO_SESSION_TRANSFORM_DECRYPT_OUTPUT_ARGUMENTS
- {
- BOOL Enable;
- ID3D12ProtectedSession *pProtectedSession;
- ID3D12Resource *pBuffer;
- UINT64 Size;
- UINT64 Offset;
- } D3D12_CRYPTO_SESSION_TRANSFORM_DECRYPT_OUTPUT_ARGUMENTS;
-
-typedef struct D3D12_CRYPTO_SESSION_TRANSFORM_TRANSCRYPT_OUTPUT_ARGUMENTS
- {
- BOOL Enable;
- _Field_size_bytes_full_(IVSize) void *pIV;
- UINT IVSize;
- } D3D12_CRYPTO_SESSION_TRANSFORM_TRANSCRYPT_OUTPUT_ARGUMENTS;
-
-typedef struct D3D12_CRYPTO_SESSION_TRANSFORM_DECRYPT_HEADER_OUTPUT_ARGUMENTS
- {
- BOOL Enable;
- UINT64 SliceHeadersSize;
- _Field_size_bytes_full_(SliceHeadersSize) const void *pSliceHeaders;
- UINT64 ContextSize;
- _Field_size_bytes_full_(ContextSize) const void *pContext;
- } D3D12_CRYPTO_SESSION_TRANSFORM_DECRYPT_HEADER_OUTPUT_ARGUMENTS;
-
-typedef struct D3D12_CRYPTO_SESSION_TRANSFORM_OUTPUT_ARGUMENTS
- {
- D3D12_CRYPTO_SESSION_TRANSFORM_DECRYPT_OUTPUT_ARGUMENTS Decrypt;
- D3D12_CRYPTO_SESSION_TRANSFORM_TRANSCRYPT_OUTPUT_ARGUMENTS Transcrypt;
- D3D12_CRYPTO_SESSION_TRANSFORM_DECRYPT_HEADER_OUTPUT_ARGUMENTS ClearHeader;
- } D3D12_CRYPTO_SESSION_TRANSFORM_OUTPUT_ARGUMENTS;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_1_0000_0002_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_1_0000_0002_v0_0_s_ifspec;
-
-#ifndef __ID3D12ContentProtectionDevice_INTERFACE_DEFINED__
-#define __ID3D12ContentProtectionDevice_INTERFACE_DEFINED__
-
-/* interface ID3D12ContentProtectionDevice */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12ContentProtectionDevice;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("59975f53-bf5f-42f2-b84f-5e347c1e3d43")
- ID3D12ContentProtectionDevice : public IUnknown
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE CreateCryptoSession(
- _In_ const D3D12_CRYPTO_SESSION_DESC *pDesc,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppSession) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE CreateCryptoSessionPolicy(
- _In_reads_bytes_( KeyInfoSize ) const void *pKeyInfo,
- UINT KeyInfoSize,
- _In_ ID3D12CryptoSession *pCryptoSession,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppCryptoSessionPolicy) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE TransformEncryptedData(
- D3D12_CRYPTO_SESSION_TRANSFORM_OPERATION Operation,
- _In_ const D3D12_CRYPTO_SESSION_TRANSFORM_OUTPUT_ARGUMENTS *pOutputArguments,
- _In_ const D3D12_CRYPTO_SESSION_TRANSFORM_INPUT_ARGUMENTS *pInputArguments) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12ContentProtectionDeviceVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12ContentProtectionDevice * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12ContentProtectionDevice * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12ContentProtectionDevice * This);
-
- HRESULT ( STDMETHODCALLTYPE *CreateCryptoSession )(
- ID3D12ContentProtectionDevice * This,
- _In_ const D3D12_CRYPTO_SESSION_DESC *pDesc,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppSession);
-
- HRESULT ( STDMETHODCALLTYPE *CreateCryptoSessionPolicy )(
- ID3D12ContentProtectionDevice * This,
- _In_reads_bytes_( KeyInfoSize ) const void *pKeyInfo,
- UINT KeyInfoSize,
- _In_ ID3D12CryptoSession *pCryptoSession,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppCryptoSessionPolicy);
-
- HRESULT ( STDMETHODCALLTYPE *TransformEncryptedData )(
- ID3D12ContentProtectionDevice * This,
- D3D12_CRYPTO_SESSION_TRANSFORM_OPERATION Operation,
- _In_ const D3D12_CRYPTO_SESSION_TRANSFORM_OUTPUT_ARGUMENTS *pOutputArguments,
- _In_ const D3D12_CRYPTO_SESSION_TRANSFORM_INPUT_ARGUMENTS *pInputArguments);
-
- END_INTERFACE
- } ID3D12ContentProtectionDeviceVtbl;
-
- interface ID3D12ContentProtectionDevice
- {
- CONST_VTBL struct ID3D12ContentProtectionDeviceVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12ContentProtectionDevice_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12ContentProtectionDevice_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12ContentProtectionDevice_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12ContentProtectionDevice_CreateCryptoSession(This,pDesc,riid,ppSession) \
- ( (This)->lpVtbl -> CreateCryptoSession(This,pDesc,riid,ppSession) )
-
-#define ID3D12ContentProtectionDevice_CreateCryptoSessionPolicy(This,pKeyInfo,KeyInfoSize,pCryptoSession,riid,ppCryptoSessionPolicy) \
- ( (This)->lpVtbl -> CreateCryptoSessionPolicy(This,pKeyInfo,KeyInfoSize,pCryptoSession,riid,ppCryptoSessionPolicy) )
-
-#define ID3D12ContentProtectionDevice_TransformEncryptedData(This,Operation,pOutputArguments,pInputArguments) \
- ( (This)->lpVtbl -> TransformEncryptedData(This,Operation,pOutputArguments,pInputArguments) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12ContentProtectionDevice_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12_1_0000_0003 */
-/* [local] */
-
-typedef struct D3D12_VIDEO_DECODE_DECRYPTION_ARGUMENTS
- {
- ID3D12CryptoSessionPolicy *pCryptoSessionPolicy;
- _Field_size_bytes_full_(IVSize) const void *pIV;
- UINT IVSize;
- _Field_size_bytes_full_(SubSampleMappingCount) const void *pSubSampleMappingBlock;
- UINT SubSampleMappingCount;
- UINT cBlocksStripeEncrypted;
- UINT cBlocksStripeClear;
- } D3D12_VIDEO_DECODE_DECRYPTION_ARGUMENTS;
-
-typedef struct D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS1
- {
- UINT NumFrameArguments;
- D3D12_VIDEO_DECODE_FRAME_ARGUMENT FrameArguments[ 10 ];
- D3D12_VIDEO_DECODE_REFERENCE_FRAMES ReferenceFrames;
- D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM CompressedBitstream;
- D3D12_VIDEO_DECODE_DECRYPTION_ARGUMENTS DecryptionArguments;
- ID3D12VideoDecoderHeap *pHeap;
- } D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS1;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_1_0000_0003_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_1_0000_0003_v0_0_s_ifspec;
-
-#ifndef __ID3D12VideoDecodeCommandList2_INTERFACE_DEFINED__
-#define __ID3D12VideoDecodeCommandList2_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoDecodeCommandList2 */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoDecodeCommandList2;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("EAD05737-EE1D-4442-9B18-7D992E9A8960")
- ID3D12VideoDecodeCommandList2 : public ID3D12VideoDecodeCommandList1
- {
- public:
- virtual void STDMETHODCALLTYPE DecodeFrame2(
- _In_ ID3D12VideoDecoder *pDecoder,
- _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments,
- _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS1 *pInputArguments) = 0;
-
- virtual void STDMETHODCALLTYPE SetProtectedResourceSession(
- _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoDecodeCommandList2Vtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoDecodeCommandList2 * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoDecodeCommandList2 * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoDecodeCommandList2 * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12VideoDecodeCommandList2 * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
- ID3D12VideoDecodeCommandList2 * This);
-
- HRESULT ( STDMETHODCALLTYPE *Close )(
- ID3D12VideoDecodeCommandList2 * This);
-
- HRESULT ( STDMETHODCALLTYPE *Reset )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_ ID3D12CommandAllocator *pAllocator);
-
- void ( STDMETHODCALLTYPE *ClearState )(
- ID3D12VideoDecodeCommandList2 * This);
-
- void ( STDMETHODCALLTYPE *ResourceBarrier )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_ UINT NumBarriers,
- _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
-
- void ( STDMETHODCALLTYPE *DiscardResource )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_ ID3D12Resource *pResource,
- _In_opt_ const D3D12_DISCARD_REGION *pRegion);
-
- void ( STDMETHODCALLTYPE *BeginQuery )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *EndQuery )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *ResolveQueryData )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT StartIndex,
- _In_ UINT NumQueries,
- _In_ ID3D12Resource *pDestinationBuffer,
- _In_ UINT64 AlignedDestinationBufferOffset);
-
- void ( STDMETHODCALLTYPE *SetPredication )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_opt_ ID3D12Resource *pBuffer,
- _In_ UINT64 AlignedBufferOffset,
- _In_ D3D12_PREDICATION_OP Operation);
-
- void ( STDMETHODCALLTYPE *SetMarker )(
- ID3D12VideoDecodeCommandList2 * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *BeginEvent )(
- ID3D12VideoDecodeCommandList2 * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *EndEvent )(
- ID3D12VideoDecodeCommandList2 * This);
-
- void ( STDMETHODCALLTYPE *DecodeFrame )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_ ID3D12VideoDecoder *pDecoder,
- _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
- _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments);
-
- void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
- ID3D12VideoDecodeCommandList2 * This,
- UINT Count,
- _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
- _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
-
- void ( STDMETHODCALLTYPE *DecodeFrame1 )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_ ID3D12VideoDecoder *pDecoder,
- _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments,
- _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments);
-
- void ( STDMETHODCALLTYPE *DecodeFrame2 )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_ ID3D12VideoDecoder *pDecoder,
- _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments,
- _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS1 *pInputArguments);
-
- void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
- ID3D12VideoDecodeCommandList2 * This,
- _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
-
- END_INTERFACE
- } ID3D12VideoDecodeCommandList2Vtbl;
-
- interface ID3D12VideoDecodeCommandList2
- {
- CONST_VTBL struct ID3D12VideoDecodeCommandList2Vtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoDecodeCommandList2_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoDecodeCommandList2_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoDecodeCommandList2_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoDecodeCommandList2_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12VideoDecodeCommandList2_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12VideoDecodeCommandList2_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12VideoDecodeCommandList2_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12VideoDecodeCommandList2_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-#define ID3D12VideoDecodeCommandList2_GetType(This) \
- ( (This)->lpVtbl -> GetType(This) )
-
-
-#define ID3D12VideoDecodeCommandList2_Close(This) \
- ( (This)->lpVtbl -> Close(This) )
-
-#define ID3D12VideoDecodeCommandList2_Reset(This,pAllocator) \
- ( (This)->lpVtbl -> Reset(This,pAllocator) )
-
-#define ID3D12VideoDecodeCommandList2_ClearState(This) \
- ( (This)->lpVtbl -> ClearState(This) )
-
-#define ID3D12VideoDecodeCommandList2_ResourceBarrier(This,NumBarriers,pBarriers) \
- ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
-
-#define ID3D12VideoDecodeCommandList2_DiscardResource(This,pResource,pRegion) \
- ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
-
-#define ID3D12VideoDecodeCommandList2_BeginQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoDecodeCommandList2_EndQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoDecodeCommandList2_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
- ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
-
-#define ID3D12VideoDecodeCommandList2_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
- ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
-
-#define ID3D12VideoDecodeCommandList2_SetMarker(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
-
-#define ID3D12VideoDecodeCommandList2_BeginEvent(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
-
-#define ID3D12VideoDecodeCommandList2_EndEvent(This) \
- ( (This)->lpVtbl -> EndEvent(This) )
-
-#define ID3D12VideoDecodeCommandList2_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \
- ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) )
-
-#define ID3D12VideoDecodeCommandList2_WriteBufferImmediate(This,Count,pParams,pModes) \
- ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
-
-
-#define ID3D12VideoDecodeCommandList2_DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) \
- ( (This)->lpVtbl -> DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) )
-
-
-#define ID3D12VideoDecodeCommandList2_DecodeFrame2(This,pDecoder,pOutputArguments,pInputArguments) \
- ( (This)->lpVtbl -> DecodeFrame2(This,pDecoder,pOutputArguments,pInputArguments) )
-
-#define ID3D12VideoDecodeCommandList2_SetProtectedResourceSession(This,pProtectedResourceSession) \
- ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12VideoDecodeCommandList2_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12VideoProcessCommandList2_INTERFACE_DEFINED__
-#define __ID3D12VideoProcessCommandList2_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoProcessCommandList2 */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoProcessCommandList2;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("569AB919-94DE-4529-8292-35DE97848059")
- ID3D12VideoProcessCommandList2 : public ID3D12VideoProcessCommandList1
- {
- public:
- virtual void STDMETHODCALLTYPE SetProtectedResourceSession(
- _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoProcessCommandList2Vtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoProcessCommandList2 * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoProcessCommandList2 * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoProcessCommandList2 * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12VideoProcessCommandList2 * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12VideoProcessCommandList2 * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12VideoProcessCommandList2 * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12VideoProcessCommandList2 * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12VideoProcessCommandList2 * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
- ID3D12VideoProcessCommandList2 * This);
-
- HRESULT ( STDMETHODCALLTYPE *Close )(
- ID3D12VideoProcessCommandList2 * This);
-
- HRESULT ( STDMETHODCALLTYPE *Reset )(
- ID3D12VideoProcessCommandList2 * This,
- _In_ ID3D12CommandAllocator *pAllocator);
-
- void ( STDMETHODCALLTYPE *ClearState )(
- ID3D12VideoProcessCommandList2 * This);
-
- void ( STDMETHODCALLTYPE *ResourceBarrier )(
- ID3D12VideoProcessCommandList2 * This,
- _In_ UINT NumBarriers,
- _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
-
- void ( STDMETHODCALLTYPE *DiscardResource )(
- ID3D12VideoProcessCommandList2 * This,
- _In_ ID3D12Resource *pResource,
- _In_opt_ const D3D12_DISCARD_REGION *pRegion);
-
- void ( STDMETHODCALLTYPE *BeginQuery )(
- ID3D12VideoProcessCommandList2 * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *EndQuery )(
- ID3D12VideoProcessCommandList2 * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *ResolveQueryData )(
- ID3D12VideoProcessCommandList2 * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT StartIndex,
- _In_ UINT NumQueries,
- _In_ ID3D12Resource *pDestinationBuffer,
- _In_ UINT64 AlignedDestinationBufferOffset);
-
- void ( STDMETHODCALLTYPE *SetPredication )(
- ID3D12VideoProcessCommandList2 * This,
- _In_opt_ ID3D12Resource *pBuffer,
- _In_ UINT64 AlignedBufferOffset,
- _In_ D3D12_PREDICATION_OP Operation);
-
- void ( STDMETHODCALLTYPE *SetMarker )(
- ID3D12VideoProcessCommandList2 * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *BeginEvent )(
- ID3D12VideoProcessCommandList2 * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *EndEvent )(
- ID3D12VideoProcessCommandList2 * This);
-
- void ( STDMETHODCALLTYPE *ProcessFrames )(
- ID3D12VideoProcessCommandList2 * This,
- _In_ ID3D12VideoProcessor *pVideoProcessor,
- _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
- UINT NumInputStreams,
- _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments);
-
- void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
- ID3D12VideoProcessCommandList2 * This,
- UINT Count,
- _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
- _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
-
- void ( STDMETHODCALLTYPE *ProcessFrames1 )(
- ID3D12VideoProcessCommandList2 * This,
- _In_ ID3D12VideoProcessor *pVideoProcessor,
- _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
- UINT NumInputStreams,
- _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments);
-
- void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
- ID3D12VideoProcessCommandList2 * This,
- _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
-
- END_INTERFACE
- } ID3D12VideoProcessCommandList2Vtbl;
-
- interface ID3D12VideoProcessCommandList2
- {
- CONST_VTBL struct ID3D12VideoProcessCommandList2Vtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoProcessCommandList2_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoProcessCommandList2_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoProcessCommandList2_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoProcessCommandList2_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12VideoProcessCommandList2_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12VideoProcessCommandList2_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12VideoProcessCommandList2_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12VideoProcessCommandList2_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-#define ID3D12VideoProcessCommandList2_GetType(This) \
- ( (This)->lpVtbl -> GetType(This) )
-
-
-#define ID3D12VideoProcessCommandList2_Close(This) \
- ( (This)->lpVtbl -> Close(This) )
-
-#define ID3D12VideoProcessCommandList2_Reset(This,pAllocator) \
- ( (This)->lpVtbl -> Reset(This,pAllocator) )
-
-#define ID3D12VideoProcessCommandList2_ClearState(This) \
- ( (This)->lpVtbl -> ClearState(This) )
-
-#define ID3D12VideoProcessCommandList2_ResourceBarrier(This,NumBarriers,pBarriers) \
- ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
-
-#define ID3D12VideoProcessCommandList2_DiscardResource(This,pResource,pRegion) \
- ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
-
-#define ID3D12VideoProcessCommandList2_BeginQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoProcessCommandList2_EndQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoProcessCommandList2_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
- ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
-
-#define ID3D12VideoProcessCommandList2_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
- ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
-
-#define ID3D12VideoProcessCommandList2_SetMarker(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
-
-#define ID3D12VideoProcessCommandList2_BeginEvent(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
-
-#define ID3D12VideoProcessCommandList2_EndEvent(This) \
- ( (This)->lpVtbl -> EndEvent(This) )
-
-#define ID3D12VideoProcessCommandList2_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \
- ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) )
-
-#define ID3D12VideoProcessCommandList2_WriteBufferImmediate(This,Count,pParams,pModes) \
- ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
-
-
-#define ID3D12VideoProcessCommandList2_ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \
- ( (This)->lpVtbl -> ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) )
-
-
-#define ID3D12VideoProcessCommandList2_SetProtectedResourceSession(This,pProtectedResourceSession) \
- ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12VideoProcessCommandList2_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12StateObjectPrototype_INTERFACE_DEFINED__
-#define __ID3D12StateObjectPrototype_INTERFACE_DEFINED__
-
-/* interface ID3D12StateObjectPrototype */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12StateObjectPrototype;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("47016943-fca8-4594-93ea-af258b55346d")
- ID3D12StateObjectPrototype : public ID3D12Pageable
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE GetCachedBlob(
- _COM_Outptr_ ID3DBlob **ppBlob) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12StateObjectPrototypeVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12StateObjectPrototype * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12StateObjectPrototype * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12StateObjectPrototype * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12StateObjectPrototype * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12StateObjectPrototype * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12StateObjectPrototype * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12StateObjectPrototype * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12StateObjectPrototype * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- HRESULT ( STDMETHODCALLTYPE *GetCachedBlob )(
- ID3D12StateObjectPrototype * This,
- _COM_Outptr_ ID3DBlob **ppBlob);
-
- END_INTERFACE
- } ID3D12StateObjectPrototypeVtbl;
-
- interface ID3D12StateObjectPrototype
- {
- CONST_VTBL struct ID3D12StateObjectPrototypeVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12StateObjectPrototype_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12StateObjectPrototype_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12StateObjectPrototype_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12StateObjectPrototype_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12StateObjectPrototype_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12StateObjectPrototype_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12StateObjectPrototype_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12StateObjectPrototype_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-
-#define ID3D12StateObjectPrototype_GetCachedBlob(This,ppBlob) \
- ( (This)->lpVtbl -> GetCachedBlob(This,ppBlob) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12StateObjectPrototype_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12StateObjectPropertiesPrototype_INTERFACE_DEFINED__
-#define __ID3D12StateObjectPropertiesPrototype_INTERFACE_DEFINED__
-
-/* interface ID3D12StateObjectPropertiesPrototype */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12StateObjectPropertiesPrototype;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("de5fa827-9bf9-4f26-89ff-d7f56fde3860")
- ID3D12StateObjectPropertiesPrototype : public IUnknown
- {
- public:
- virtual void *STDMETHODCALLTYPE GetShaderIdentifier(
- _In_ LPCWSTR pExportName) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetShaderStackSize(
- _In_ LPCWSTR pExportName) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetPipelineStackSize( void) = 0;
-
- virtual void STDMETHODCALLTYPE SetPipelineStackSize(
- UINT64 PipelineStackSizeInBytes) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12StateObjectPropertiesPrototypeVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12StateObjectPropertiesPrototype * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12StateObjectPropertiesPrototype * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12StateObjectPropertiesPrototype * This);
-
- void *( STDMETHODCALLTYPE *GetShaderIdentifier )(
- ID3D12StateObjectPropertiesPrototype * This,
- _In_ LPCWSTR pExportName);
-
- UINT64 ( STDMETHODCALLTYPE *GetShaderStackSize )(
- ID3D12StateObjectPropertiesPrototype * This,
- _In_ LPCWSTR pExportName);
-
- UINT64 ( STDMETHODCALLTYPE *GetPipelineStackSize )(
- ID3D12StateObjectPropertiesPrototype * This);
-
- void ( STDMETHODCALLTYPE *SetPipelineStackSize )(
- ID3D12StateObjectPropertiesPrototype * This,
- UINT64 PipelineStackSizeInBytes);
-
- END_INTERFACE
- } ID3D12StateObjectPropertiesPrototypeVtbl;
-
- interface ID3D12StateObjectPropertiesPrototype
- {
- CONST_VTBL struct ID3D12StateObjectPropertiesPrototypeVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12StateObjectPropertiesPrototype_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12StateObjectPropertiesPrototype_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12StateObjectPropertiesPrototype_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12StateObjectPropertiesPrototype_GetShaderIdentifier(This,pExportName) \
- ( (This)->lpVtbl -> GetShaderIdentifier(This,pExportName) )
-
-#define ID3D12StateObjectPropertiesPrototype_GetShaderStackSize(This,pExportName) \
- ( (This)->lpVtbl -> GetShaderStackSize(This,pExportName) )
-
-#define ID3D12StateObjectPropertiesPrototype_GetPipelineStackSize(This) \
- ( (This)->lpVtbl -> GetPipelineStackSize(This) )
-
-#define ID3D12StateObjectPropertiesPrototype_SetPipelineStackSize(This,PipelineStackSizeInBytes) \
- ( (This)->lpVtbl -> SetPipelineStackSize(This,PipelineStackSizeInBytes) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12StateObjectPropertiesPrototype_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12_1_0000_0007 */
-/* [local] */
-
-typedef
-enum D3D12_STATE_SUBOBJECT_TYPE
- {
- D3D12_STATE_SUBOBJECT_TYPE_FLAGS = 0,
- D3D12_STATE_SUBOBJECT_TYPE_ROOT_SIGNATURE = 1,
- D3D12_STATE_SUBOBJECT_TYPE_LOCAL_ROOT_SIGNATURE = 2,
- D3D12_STATE_SUBOBJECT_TYPE_NODE_MASK = 3,
- D3D12_STATE_SUBOBJECT_TYPE_CACHED_STATE_OBJECT = 4,
- D3D12_STATE_SUBOBJECT_TYPE_DXIL_LIBRARY = 5,
- D3D12_STATE_SUBOBJECT_TYPE_EXISTING_COLLECTION = 6,
- D3D12_STATE_SUBOBJECT_TYPE_SUBOBJECT_TO_EXPORTS_ASSOCIATION = 7,
- D3D12_STATE_SUBOBJECT_TYPE_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION = 8,
- D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_SHADER_CONFIG = 9,
- D3D12_STATE_SUBOBJECT_TYPE_RAYTRACING_PIPELINE_CONFIG = 10,
- D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP = 11,
- D3D12_STATE_SUBOBJECT_TYPE_MAX_VALID = ( D3D12_STATE_SUBOBJECT_TYPE_HIT_GROUP + 1 )
- } D3D12_STATE_SUBOBJECT_TYPE;
-
-typedef struct D3D12_STATE_SUBOBJECT
- {
- D3D12_STATE_SUBOBJECT_TYPE Type;
- const void *pDesc;
- } D3D12_STATE_SUBOBJECT;
-
-typedef
-enum D3D12_STATE_OBJECT_FLAGS
- {
- D3D12_STATE_OBJECT_FLAG_NONE = 0
- } D3D12_STATE_OBJECT_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS( D3D12_STATE_OBJECT_FLAGS );
-typedef
-enum D3D12_EXPORT_FLAGS
- {
- D3D12_EXPORT_FLAG_NONE = 0
- } D3D12_EXPORT_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS( D3D12_EXPORT_FLAGS );
-typedef struct D3D12_EXPORT_DESC
- {
- LPCWSTR Name;
- _In_opt_ LPCWSTR ExportToRename;
- D3D12_EXPORT_FLAGS Flags;
- } D3D12_EXPORT_DESC;
-
-typedef struct D3D12_DXIL_LIBRARY_DESC
- {
- D3D12_SHADER_BYTECODE DXILLibrary;
- UINT NumExports;
- _In_reads_(NumExports) D3D12_EXPORT_DESC *pExports;
- } D3D12_DXIL_LIBRARY_DESC;
-
-typedef struct D3D12_EXISTING_COLLECTION_DESC
- {
- ID3D12StateObjectPrototype *pExistingCollection;
- UINT NumExports;
- _In_reads_(NumExports) D3D12_EXPORT_DESC *pExports;
- } D3D12_EXISTING_COLLECTION_DESC;
-
-typedef struct D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION
- {
- const D3D12_STATE_SUBOBJECT *pSubobjectToAssociate;
- UINT NumExports;
- _In_reads_(NumExports) LPCWSTR *pExports;
- } D3D12_SUBOBJECT_TO_EXPORTS_ASSOCIATION;
-
-typedef struct D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION
- {
- LPCWSTR SubobjectToAssociate;
- UINT NumExports;
- _In_reads_(NumExports) LPCWSTR *pExports;
- } D3D12_DXIL_SUBOBJECT_TO_EXPORTS_ASSOCIATION;
-
-typedef struct D3D12_HIT_GROUP_DESC
- {
- LPCWSTR HitGroupExport;
- _In_opt_ LPCWSTR AnyHitShaderImport;
- _In_opt_ LPCWSTR ClosestHitShaderImport;
- _In_opt_ LPCWSTR IntersectionShaderImport;
- } D3D12_HIT_GROUP_DESC;
-
-typedef struct D3D12_RAYTRACING_SHADER_CONFIG
- {
- UINT MaxPayloadSizeInBytes;
- UINT MaxAttributeSizeInBytes;
- } D3D12_RAYTRACING_SHADER_CONFIG;
-
-typedef struct D3D12_RAYTRACING_PIPELINE_CONFIG
- {
- UINT MaxTraceRecursionDepth;
- } D3D12_RAYTRACING_PIPELINE_CONFIG;
-
-typedef
-enum D3D12_STATE_OBJECT_TYPE
- {
- D3D12_STATE_OBJECT_TYPE_COLLECTION = 0,
- D3D12_STATE_OBJECT_TYPE_RAYTRACING_PIPELINE = 3
- } D3D12_STATE_OBJECT_TYPE;
-
-typedef struct D3D12_STATE_OBJECT_DESC
- {
- D3D12_STATE_OBJECT_TYPE Type;
- UINT NumSubobjects;
- _In_reads_(NumSubobjects) const D3D12_STATE_SUBOBJECT *pSubobjects;
- } D3D12_STATE_OBJECT_DESC;
-
-typedef
-enum D3D12_RAYTRACING_GEOMETRY_FLAGS
- {
- D3D12_RAYTRACING_GEOMETRY_FLAG_NONE = 0,
- D3D12_RAYTRACING_GEOMETRY_FLAG_OPAQUE = 0x1,
- D3D12_RAYTRACING_GEOMETRY_FLAG_NO_DUPLICATE_ANYHIT_INVOCATION = 0x2
- } D3D12_RAYTRACING_GEOMETRY_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_GEOMETRY_FLAGS );
-typedef
-enum D3D12_RAYTRACING_GEOMETRY_TYPE
- {
- D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES = 0,
- D3D12_RAYTRACING_GEOMETRY_TYPE_PROCEDURAL_PRIMITIVE_AABBS = ( D3D12_RAYTRACING_GEOMETRY_TYPE_TRIANGLES + 1 )
- } D3D12_RAYTRACING_GEOMETRY_TYPE;
-
-typedef
-enum D3D12_RAYTRACING_INSTANCE_FLAGS
- {
- D3D12_RAYTRACING_INSTANCE_FLAG_NONE = 0,
- D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_CULL_DISABLE = 0x1,
- D3D12_RAYTRACING_INSTANCE_FLAG_TRIANGLE_FRONT_COUNTERCLOCKWISE = 0x2,
- D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_OPAQUE = 0x4,
- D3D12_RAYTRACING_INSTANCE_FLAG_FORCE_NON_OPAQUE = 0x8
- } D3D12_RAYTRACING_INSTANCE_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_INSTANCE_FLAGS );
-typedef struct D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE
- {
- D3D12_GPU_VIRTUAL_ADDRESS StartAddress;
- UINT64 StrideInBytes;
- } D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE;
-
-typedef struct D3D12_GPU_VIRTUAL_ADDRESS_RANGE
- {
- D3D12_GPU_VIRTUAL_ADDRESS StartAddress;
- UINT64 SizeInBytes;
- } D3D12_GPU_VIRTUAL_ADDRESS_RANGE;
-
-typedef struct D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE
- {
- D3D12_GPU_VIRTUAL_ADDRESS StartAddress;
- UINT64 SizeInBytes;
- UINT64 StrideInBytes;
- } D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE;
-
-typedef struct D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC
- {
- D3D12_GPU_VIRTUAL_ADDRESS Transform;
- DXGI_FORMAT IndexFormat;
- DXGI_FORMAT VertexFormat;
- UINT IndexCount;
- UINT VertexCount;
- D3D12_GPU_VIRTUAL_ADDRESS IndexBuffer;
- D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE VertexBuffer;
- } D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC;
-
-typedef struct D3D12_RAYTRACING_AABB
- {
- FLOAT MinX;
- FLOAT MinY;
- FLOAT MinZ;
- FLOAT MaxX;
- FLOAT MaxY;
- FLOAT MaxZ;
- } D3D12_RAYTRACING_AABB;
-
-typedef struct D3D12_RAYTRACING_GEOMETRY_AABBS_DESC
- {
- UINT64 AABBCount;
- D3D12_GPU_VIRTUAL_ADDRESS_AND_STRIDE AABBs;
- } D3D12_RAYTRACING_GEOMETRY_AABBS_DESC;
-
-typedef struct D3D12_RAYTRACING_GEOMETRY_DESC
- {
- D3D12_RAYTRACING_GEOMETRY_TYPE Type;
- D3D12_RAYTRACING_GEOMETRY_FLAGS Flags;
- union
- {
- D3D12_RAYTRACING_GEOMETRY_TRIANGLES_DESC Triangles;
- D3D12_RAYTRACING_GEOMETRY_AABBS_DESC AABBs;
- } ;
- } D3D12_RAYTRACING_GEOMETRY_DESC;
-
-typedef
-enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS
- {
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_NONE = 0,
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_UPDATE = 0x1,
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_ALLOW_COMPACTION = 0x2,
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_TRACE = 0x4,
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PREFER_FAST_BUILD = 0x8,
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_MINIMIZE_MEMORY = 0x10,
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAG_PERFORM_UPDATE = 0x20
- } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS( D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS );
-typedef
-enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE
- {
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_CLONE = 0,
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_COMPACT = 0x1,
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_VISUALIZATION_DECODE_FOR_TOOLS = 0x2,
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_SERIALIZE = 0x3,
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE_DESERIALIZE = 0x4
- } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE;
-
-typedef
-enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE
- {
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_TOP_LEVEL = 0,
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE_BOTTOM_LEVEL = 0x1
- } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE;
-
-typedef struct D3D12_RAYTRACING_INSTANCE_DESC
- {
- FLOAT Transform[ 12 ];
- UINT InstanceID : 24;
- UINT InstanceMask : 8;
- UINT InstanceContributionToHitGroupIndex : 24;
- UINT Flags : 8;
- D3D12_GPU_VIRTUAL_ADDRESS AccelerationStructure;
- } D3D12_RAYTRACING_INSTANCE_DESC;
-
-typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO
- {
- UINT64 ResultDataMaxSizeInBytes;
- UINT64 ScratchDataSizeInBytes;
- UINT64 UpdateScratchDataSizeInBytes;
- } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO;
-
-typedef
-enum D3D12_ELEMENTS_LAYOUT
- {
- D3D12_ELEMENTS_LAYOUT_ARRAY = 0,
- D3D12_ELEMENTS_LAYOUT_ARRAY_OF_POINTERS = 0x1
- } D3D12_ELEMENTS_LAYOUT;
-
-typedef struct D3D12_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_DESC
- {
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type;
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS Flags;
- UINT NumDescs;
- D3D12_ELEMENTS_LAYOUT DescsLayout;
- union
- {
- const D3D12_RAYTRACING_GEOMETRY_DESC *pGeometryDescs;
- const D3D12_RAYTRACING_GEOMETRY_DESC *const *ppGeometryDescs;
- } ;
- } D3D12_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_DESC;
-
-typedef
-enum D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE
- {
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE = 0,
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION = ( D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE + 1 ) ,
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION = ( D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION + 1 )
- } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE;
-
-typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE_DESC
- {
- UINT64 CompactedSizeInBytes;
- } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_COMPACTED_SIZE_DESC;
-
-typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION_DESC
- {
- UINT64 DecodedSizeInBytes;
- } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TOOLS_VISUALIZATION_DESC;
-
-typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER
- {
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type;
- UINT NumDescs;
- } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER;
-
-// Regarding D3D12_BUILD_RAY_TRACING_ACCELERATION_STRUCTURE_TOOLS_VISUALIZATION_HEADER above,
-// depending on Type field, NumDescs above is followed by either:
-// D3D12_RAY_TRACING_INSTANCE_DESC InstanceDescs[NumDescs]
-// or D3D12_RAY_TRACING_GEOMETRY_DESC GeometryDescs[NumDescs].
-// There is 4 bytes of padding between GeometryDesc structs in the array so alignment is natural when viewed by CPU.
-
-typedef struct D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC
- {
- UINT64 SerializedSizeInBytes;
- UINT64 NumBottomLevelAccelerationStructurePointers;
- } D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_SERIALIZATION_DESC;
-
-typedef struct D3D12_SERIALIZED_ACCELERATION_STRUCTURE_HEADER
- {
- UINT64 SerializedSizeInBytesIncludingHeader;
- UINT64 DeserializedSizeInBytes;
- UINT64 NumBottomLevelAccelerationStructurePointersAfterHeader;
- } D3D12_SERIALIZED_ACCELERATION_STRUCTURE_HEADER;
-
-typedef struct D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC
- {
- D3D12_GPU_VIRTUAL_ADDRESS_RANGE DestAccelerationStructureData;
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_TYPE Type;
- UINT NumDescs;
- D3D12_ELEMENTS_LAYOUT DescsLayout;
- union
- {
- D3D12_GPU_VIRTUAL_ADDRESS InstanceDescs;
- const D3D12_RAYTRACING_GEOMETRY_DESC *pGeometryDescs;
- const D3D12_RAYTRACING_GEOMETRY_DESC *const *ppGeometryDescs;
- } ;
- D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BUILD_FLAGS Flags;
- _In_opt_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData;
- D3D12_GPU_VIRTUAL_ADDRESS_RANGE ScratchAccelerationStructureData;
- } D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC;
-
-typedef struct D3D12_DISPATCH_RAYS_DESC
- {
- D3D12_GPU_VIRTUAL_ADDRESS_RANGE RayGenerationShaderRecord;
- D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE MissShaderTable;
- D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE HitGroupTable;
- D3D12_GPU_VIRTUAL_ADDRESS_RANGE_AND_STRIDE CallableShaderTable;
- UINT Width;
- UINT Height;
- } D3D12_DISPATCH_RAYS_DESC;
-
-#define D3D12_RAYTRACING_ACCELERATION_STRUCTURE_BYTE_ALIGNMENT 256
-#define D3D12_RAYTRACING_INSTANCE_DESCS_BYTE_ALIGNMENT 16
-#define D3D12_RAYTRACING_MAX_ATTRIBUTE_SIZE_IN_BYTES 32
-#define D3D12_RAYTRACING_SHADER_RECORD_BYTE_ALIGNMENT 16
-#define D3D12_RAYTRACING_MAX_DECLARABLE_TRACE_RECURSION_DEPTH 31
-#define D3D12_RAYTRACING_AABB_BYTE_ALIGNMENT 4
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_1_0000_0007_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_1_0000_0007_v0_0_s_ifspec;
-
-#ifndef __ID3D12DeviceRaytracingPrototype_INTERFACE_DEFINED__
-#define __ID3D12DeviceRaytracingPrototype_INTERFACE_DEFINED__
-
-/* interface ID3D12DeviceRaytracingPrototype */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12DeviceRaytracingPrototype;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("f52ef3ca-f710-4ee4-b873-a7f504e43995")
- ID3D12DeviceRaytracingPrototype : public IUnknown
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE CreateStateObject(
- const D3D12_STATE_OBJECT_DESC *pDesc,
- REFIID riid,
- _COM_Outptr_ void **ppStateObject) = 0;
-
- virtual UINT STDMETHODCALLTYPE GetShaderIdentifierSize( void) = 0;
-
- virtual void STDMETHODCALLTYPE GetRaytracingAccelerationStructurePrebuildInfo(
- _In_ D3D12_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_DESC *pDesc,
- _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12DeviceRaytracingPrototypeVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12DeviceRaytracingPrototype * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12DeviceRaytracingPrototype * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12DeviceRaytracingPrototype * This);
-
- HRESULT ( STDMETHODCALLTYPE *CreateStateObject )(
- ID3D12DeviceRaytracingPrototype * This,
- const D3D12_STATE_OBJECT_DESC *pDesc,
- REFIID riid,
- _COM_Outptr_ void **ppStateObject);
-
- UINT ( STDMETHODCALLTYPE *GetShaderIdentifierSize )(
- ID3D12DeviceRaytracingPrototype * This);
-
- void ( STDMETHODCALLTYPE *GetRaytracingAccelerationStructurePrebuildInfo )(
- ID3D12DeviceRaytracingPrototype * This,
- _In_ D3D12_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_DESC *pDesc,
- _Out_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO *pInfo);
-
- END_INTERFACE
- } ID3D12DeviceRaytracingPrototypeVtbl;
-
- interface ID3D12DeviceRaytracingPrototype
- {
- CONST_VTBL struct ID3D12DeviceRaytracingPrototypeVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12DeviceRaytracingPrototype_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12DeviceRaytracingPrototype_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12DeviceRaytracingPrototype_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12DeviceRaytracingPrototype_CreateStateObject(This,pDesc,riid,ppStateObject) \
- ( (This)->lpVtbl -> CreateStateObject(This,pDesc,riid,ppStateObject) )
-
-#define ID3D12DeviceRaytracingPrototype_GetShaderIdentifierSize(This) \
- ( (This)->lpVtbl -> GetShaderIdentifierSize(This) )
-
-#define ID3D12DeviceRaytracingPrototype_GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) \
- ( (This)->lpVtbl -> GetRaytracingAccelerationStructurePrebuildInfo(This,pDesc,pInfo) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12DeviceRaytracingPrototype_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12CommandListRaytracingPrototype_INTERFACE_DEFINED__
-#define __ID3D12CommandListRaytracingPrototype_INTERFACE_DEFINED__
-
-/* interface ID3D12CommandListRaytracingPrototype */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12CommandListRaytracingPrototype;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("3c69787a-28fa-4701-970a-37a1ed1f9cab")
- ID3D12CommandListRaytracingPrototype : public IUnknown
- {
- public:
- virtual void STDMETHODCALLTYPE BuildRaytracingAccelerationStructure(
- _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc) = 0;
-
- virtual void STDMETHODCALLTYPE EmitRaytracingAccelerationStructurePostBuildInfo(
- _In_ D3D12_GPU_VIRTUAL_ADDRESS_RANGE DestBuffer,
- _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE InfoType,
- _In_ UINT NumSourceAccelerationStructures,
- _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData) = 0;
-
- virtual void STDMETHODCALLTYPE CopyRaytracingAccelerationStructure(
- _In_ D3D12_GPU_VIRTUAL_ADDRESS_RANGE DestAccelerationStructureData,
- _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData,
- _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode) = 0;
-
- virtual void STDMETHODCALLTYPE DispatchRays(
- _In_ ID3D12StateObjectPrototype *pRaytracingPipelineState,
- _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12CommandListRaytracingPrototypeVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12CommandListRaytracingPrototype * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12CommandListRaytracingPrototype * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12CommandListRaytracingPrototype * This);
-
- void ( STDMETHODCALLTYPE *BuildRaytracingAccelerationStructure )(
- ID3D12CommandListRaytracingPrototype * This,
- _In_ const D3D12_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_DESC *pDesc);
-
- void ( STDMETHODCALLTYPE *EmitRaytracingAccelerationStructurePostBuildInfo )(
- ID3D12CommandListRaytracingPrototype * This,
- _In_ D3D12_GPU_VIRTUAL_ADDRESS_RANGE DestBuffer,
- _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_TYPE InfoType,
- _In_ UINT NumSourceAccelerationStructures,
- _In_reads_( NumSourceAccelerationStructures ) const D3D12_GPU_VIRTUAL_ADDRESS *pSourceAccelerationStructureData);
-
- void ( STDMETHODCALLTYPE *CopyRaytracingAccelerationStructure )(
- ID3D12CommandListRaytracingPrototype * This,
- _In_ D3D12_GPU_VIRTUAL_ADDRESS_RANGE DestAccelerationStructureData,
- _In_ D3D12_GPU_VIRTUAL_ADDRESS SourceAccelerationStructureData,
- _In_ D3D12_RAYTRACING_ACCELERATION_STRUCTURE_COPY_MODE Mode);
-
- void ( STDMETHODCALLTYPE *DispatchRays )(
- ID3D12CommandListRaytracingPrototype * This,
- _In_ ID3D12StateObjectPrototype *pRaytracingPipelineState,
- _In_ const D3D12_DISPATCH_RAYS_DESC *pDesc);
-
- END_INTERFACE
- } ID3D12CommandListRaytracingPrototypeVtbl;
-
- interface ID3D12CommandListRaytracingPrototype
- {
- CONST_VTBL struct ID3D12CommandListRaytracingPrototypeVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12CommandListRaytracingPrototype_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12CommandListRaytracingPrototype_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12CommandListRaytracingPrototype_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12CommandListRaytracingPrototype_BuildRaytracingAccelerationStructure(This,pDesc) \
- ( (This)->lpVtbl -> BuildRaytracingAccelerationStructure(This,pDesc) )
-
-#define ID3D12CommandListRaytracingPrototype_EmitRaytracingAccelerationStructurePostBuildInfo(This,DestBuffer,InfoType,NumSourceAccelerationStructures,pSourceAccelerationStructureData) \
- ( (This)->lpVtbl -> EmitRaytracingAccelerationStructurePostBuildInfo(This,DestBuffer,InfoType,NumSourceAccelerationStructures,pSourceAccelerationStructureData) )
-
-#define ID3D12CommandListRaytracingPrototype_CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) \
- ( (This)->lpVtbl -> CopyRaytracingAccelerationStructure(This,DestAccelerationStructureData,SourceAccelerationStructureData,Mode) )
-
-#define ID3D12CommandListRaytracingPrototype_DispatchRays(This,pRaytracingPipelineState,pDesc) \
- ( (This)->lpVtbl -> DispatchRays(This,pRaytracingPipelineState,pDesc) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12CommandListRaytracingPrototype_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12_1_0000_0009 */
-/* [local] */
-
-typedef
-enum D3D12_METACOMMAND_PARAMETER_TYPE
- {
- D3D12_METACOMMAND_PARAMETER_FLOAT = 0,
- D3D12_METACOMMAND_PARAMETER_UINT64 = 1,
- D3D12_METACOMMAND_PARAMETER_BUFFER_UAV = 2,
- D3D12_METACOMMAND_PARAMETER_BINDPOINT_IN_SHADER = 3
- } D3D12_METACOMMAND_PARAMETER_TYPE;
-
-typedef
-enum D3D12_METACOMMAND_PARAMETER_ATTRIBUTES
- {
- D3D12_METACOMMAND_PARAMETER_INPUT = 0x1,
- D3D12_METACOMMAND_PARAMETER_OUTPUT = 0x2
- } D3D12_METACOMMAND_PARAMETER_ATTRIBUTES;
-
-DEFINE_ENUM_FLAG_OPERATORS( D3D12_METACOMMAND_PARAMETER_ATTRIBUTES );
-typedef
-enum D3D12_METACOMMAND_PARAMETER_MUTABILITY
- {
- D3D12_METACOMMAND_PARAMETER_MUTABILITY_PER_EXECUTE = 0,
- D3D12_METACOMMAND_PARAMETER_MUTABILITY_CREATION_ONLY = 1,
- D3D12_METACOMMAND_PARAMETER_MUTABILITY_INITIALIZATION_ONLY = 2
- } D3D12_METACOMMAND_PARAMETER_MUTABILITY;
-
-typedef struct D3D12_METACOMMAND_PARAMETER_DESC
- {
- char Name[ 128 ];
- D3D12_METACOMMAND_PARAMETER_TYPE Type;
- D3D12_METACOMMAND_PARAMETER_ATTRIBUTES Attributes;
- D3D12_METACOMMAND_PARAMETER_MUTABILITY Mutability;
- } D3D12_METACOMMAND_PARAMETER_DESC;
-
-typedef
-enum D3D12_METACOMMAND_BINDPOINT_PARAMETER_TYPE
- {
- D3D12_METACOMMAND_BINDPOINT_PARAMETER_TYPE_CBV = 0,
- D3D12_METACOMMAND_BINDPOINT_PARAMETER_TYPE_SRV = ( D3D12_METACOMMAND_BINDPOINT_PARAMETER_TYPE_CBV + 1 ) ,
- D3D12_METACOMMAND_BINDPOINT_PARAMETER_TYPE_UAV = ( D3D12_METACOMMAND_BINDPOINT_PARAMETER_TYPE_SRV + 1 )
- } D3D12_METACOMMAND_BINDPOINT_PARAMETER_TYPE;
-
-typedef struct D3D12_BINDPOINT_IN_SHADER
- {
- D3D12_METACOMMAND_BINDPOINT_PARAMETER_TYPE Type;
- UINT Register;
- UINT Space;
- } D3D12_BINDPOINT_IN_SHADER;
-
-typedef struct D3D12_METACOMMAND_PARAMETER_DATA
- {
- UINT ParameterIndex;
- union
- {
- FLOAT FloatValue;
- UINT64 UnsignedInt64Value;
- D3D12_GPU_VIRTUAL_ADDRESS BufferLocation;
- D3D12_BINDPOINT_IN_SHADER BindingInfo;
- } ;
- } D3D12_METACOMMAND_PARAMETER_DATA;
-
-typedef struct D3D12_METACOMMAND_DESCRIPTION
- {
- GUID Id;
- char Name[ 128 ];
- UINT SignatureCount;
- } D3D12_METACOMMAND_DESCRIPTION;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_1_0000_0009_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_1_0000_0009_v0_0_s_ifspec;
-
-#ifndef __ID3D12DeviceMetaCommand_INTERFACE_DEFINED__
-#define __ID3D12DeviceMetaCommand_INTERFACE_DEFINED__
-
-/* interface ID3D12DeviceMetaCommand */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12DeviceMetaCommand;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("547e33c7-ff86-4cd9-bea3-5d4a28375396")
- ID3D12DeviceMetaCommand : public IUnknown
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE EnumerateMetaCommands(
- _Inout_ UINT *pNumMetaCommands,
- _Out_writes_opt_(*pNumMetaCommands) D3D12_METACOMMAND_DESCRIPTION *pDescs) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE EnumerateMetaCommandSignature(
- _In_ REFGUID CommandId,
- _In_ UINT SignatureId,
- _Inout_ UINT *pParameterCount,
- _Out_writes_opt_(*pParameterCount) D3D12_METACOMMAND_PARAMETER_DESC *pParameterDescs) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE CreateMetaCommand(
- _In_ REFGUID CommandId,
- _In_ UINT SignatureId,
- _In_opt_ ID3D12RootSignature *pRootSignature,
- _In_ UINT NumParameters,
- _In_reads_(NumParameters) const D3D12_METACOMMAND_PARAMETER_DATA *pParameters,
- REFIID riid,
- _COM_Outptr_ void **ppMetaCommand) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12DeviceMetaCommandVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12DeviceMetaCommand * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12DeviceMetaCommand * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12DeviceMetaCommand * This);
-
- HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommands )(
- ID3D12DeviceMetaCommand * This,
- _Inout_ UINT *pNumMetaCommands,
- _Out_writes_opt_(*pNumMetaCommands) D3D12_METACOMMAND_DESCRIPTION *pDescs);
-
- HRESULT ( STDMETHODCALLTYPE *EnumerateMetaCommandSignature )(
- ID3D12DeviceMetaCommand * This,
- _In_ REFGUID CommandId,
- _In_ UINT SignatureId,
- _Inout_ UINT *pParameterCount,
- _Out_writes_opt_(*pParameterCount) D3D12_METACOMMAND_PARAMETER_DESC *pParameterDescs);
-
- HRESULT ( STDMETHODCALLTYPE *CreateMetaCommand )(
- ID3D12DeviceMetaCommand * This,
- _In_ REFGUID CommandId,
- _In_ UINT SignatureId,
- _In_opt_ ID3D12RootSignature *pRootSignature,
- _In_ UINT NumParameters,
- _In_reads_(NumParameters) const D3D12_METACOMMAND_PARAMETER_DATA *pParameters,
- REFIID riid,
- _COM_Outptr_ void **ppMetaCommand);
-
- END_INTERFACE
- } ID3D12DeviceMetaCommandVtbl;
-
- interface ID3D12DeviceMetaCommand
- {
- CONST_VTBL struct ID3D12DeviceMetaCommandVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12DeviceMetaCommand_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12DeviceMetaCommand_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12DeviceMetaCommand_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12DeviceMetaCommand_EnumerateMetaCommands(This,pNumMetaCommands,pDescs) \
- ( (This)->lpVtbl -> EnumerateMetaCommands(This,pNumMetaCommands,pDescs) )
-
-#define ID3D12DeviceMetaCommand_EnumerateMetaCommandSignature(This,CommandId,SignatureId,pParameterCount,pParameterDescs) \
- ( (This)->lpVtbl -> EnumerateMetaCommandSignature(This,CommandId,SignatureId,pParameterCount,pParameterDescs) )
-
-#define ID3D12DeviceMetaCommand_CreateMetaCommand(This,CommandId,SignatureId,pRootSignature,NumParameters,pParameters,riid,ppMetaCommand) \
- ( (This)->lpVtbl -> CreateMetaCommand(This,CommandId,SignatureId,pRootSignature,NumParameters,pParameters,riid,ppMetaCommand) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12DeviceMetaCommand_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12MetaCommand_INTERFACE_DEFINED__
-#define __ID3D12MetaCommand_INTERFACE_DEFINED__
-
-/* interface ID3D12MetaCommand */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12MetaCommand;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("8AFDA767-8003-494F-9E9A-4AA8864F3524")
- ID3D12MetaCommand : public ID3D12Pageable
- {
- public:
- virtual void STDMETHODCALLTYPE GetRequiredParameterResourceSize(
- UINT32 ParameterIndex,
- UINT64 *SizeInBytes) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12MetaCommandVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12MetaCommand * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12MetaCommand * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12MetaCommand * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12MetaCommand * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12MetaCommand * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12MetaCommand * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12MetaCommand * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12MetaCommand * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- void ( STDMETHODCALLTYPE *GetRequiredParameterResourceSize )(
- ID3D12MetaCommand * This,
- UINT32 ParameterIndex,
- UINT64 *SizeInBytes);
-
- END_INTERFACE
- } ID3D12MetaCommandVtbl;
-
- interface ID3D12MetaCommand
- {
- CONST_VTBL struct ID3D12MetaCommandVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12MetaCommand_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12MetaCommand_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12MetaCommand_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12MetaCommand_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12MetaCommand_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12MetaCommand_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12MetaCommand_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12MetaCommand_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-
-#define ID3D12MetaCommand_GetRequiredParameterResourceSize(This,ParameterIndex,SizeInBytes) \
- ( (This)->lpVtbl -> GetRequiredParameterResourceSize(This,ParameterIndex,SizeInBytes) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12MetaCommand_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12CommandListMetaCommand_INTERFACE_DEFINED__
-#define __ID3D12CommandListMetaCommand_INTERFACE_DEFINED__
-
-/* interface ID3D12CommandListMetaCommand */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12CommandListMetaCommand;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("5A5F59F3-7124-4766-8E9E-CB637764FB0B")
- ID3D12CommandListMetaCommand : public IUnknown
- {
- public:
- virtual void STDMETHODCALLTYPE InitializeMetaCommand(
- _In_ ID3D12MetaCommand *pMetaCommand,
- _In_ UINT NumParameters,
- _In_reads_(NumParameters) const D3D12_METACOMMAND_PARAMETER_DATA *pParameters) = 0;
-
- virtual void STDMETHODCALLTYPE ExecuteMetaCommand(
- _In_ ID3D12MetaCommand *pMetaCommand,
- _In_ UINT NumParameters,
- _In_reads_(NumParameters) const D3D12_METACOMMAND_PARAMETER_DATA *pParameters) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12CommandListMetaCommandVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12CommandListMetaCommand * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12CommandListMetaCommand * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12CommandListMetaCommand * This);
-
- void ( STDMETHODCALLTYPE *InitializeMetaCommand )(
- ID3D12CommandListMetaCommand * This,
- _In_ ID3D12MetaCommand *pMetaCommand,
- _In_ UINT NumParameters,
- _In_reads_(NumParameters) const D3D12_METACOMMAND_PARAMETER_DATA *pParameters);
-
- void ( STDMETHODCALLTYPE *ExecuteMetaCommand )(
- ID3D12CommandListMetaCommand * This,
- _In_ ID3D12MetaCommand *pMetaCommand,
- _In_ UINT NumParameters,
- _In_reads_(NumParameters) const D3D12_METACOMMAND_PARAMETER_DATA *pParameters);
-
- END_INTERFACE
- } ID3D12CommandListMetaCommandVtbl;
-
- interface ID3D12CommandListMetaCommand
- {
- CONST_VTBL struct ID3D12CommandListMetaCommandVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12CommandListMetaCommand_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12CommandListMetaCommand_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12CommandListMetaCommand_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12CommandListMetaCommand_InitializeMetaCommand(This,pMetaCommand,NumParameters,pParameters) \
- ( (This)->lpVtbl -> InitializeMetaCommand(This,pMetaCommand,NumParameters,pParameters) )
-
-#define ID3D12CommandListMetaCommand_ExecuteMetaCommand(This,pMetaCommand,NumParameters,pParameters) \
- ( (This)->lpVtbl -> ExecuteMetaCommand(This,pMetaCommand,NumParameters,pParameters) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12CommandListMetaCommand_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12_1_0000_0012 */
-/* [local] */
-
-#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */
-// BK - pragma endregion
-DEFINE_GUID(IID_ID3D12CryptoSession,0xFC7C6C9D,0xC27D,0x4904,0x83,0x5D,0xA5,0xF2,0x09,0x6E,0xC6,0x5F);
-DEFINE_GUID(IID_ID3D12CryptoSessionPolicy,0x69FE3108,0x01A4,0x4AC3,0xAB,0x91,0xF5,0x1E,0x37,0x7A,0x62,0xAC);
-DEFINE_GUID(IID_ID3D12ContentProtectionDevice,0x59975f53,0xbf5f,0x42f2,0xb8,0x4f,0x5e,0x34,0x7c,0x1e,0x3d,0x43);
-DEFINE_GUID(IID_ID3D12VideoDecodeCommandList2,0xEAD05737,0xEE1D,0x4442,0x9B,0x18,0x7D,0x99,0x2E,0x9A,0x89,0x60);
-DEFINE_GUID(IID_ID3D12VideoProcessCommandList2,0x569AB919,0x94DE,0x4529,0x82,0x92,0x35,0xDE,0x97,0x84,0x80,0x59);
-DEFINE_GUID(IID_ID3D12StateObjectPrototype,0x47016943,0xfca8,0x4594,0x93,0xea,0xaf,0x25,0x8b,0x55,0x34,0x6d);
-DEFINE_GUID(IID_ID3D12StateObjectPropertiesPrototype,0xde5fa827,0x9bf9,0x4f26,0x89,0xff,0xd7,0xf5,0x6f,0xde,0x38,0x60);
-DEFINE_GUID(IID_ID3D12DeviceRaytracingPrototype,0xf52ef3ca,0xf710,0x4ee4,0xb8,0x73,0xa7,0xf5,0x04,0xe4,0x39,0x95);
-DEFINE_GUID(IID_ID3D12CommandListRaytracingPrototype,0x3c69787a,0x28fa,0x4701,0x97,0x0a,0x37,0xa1,0xed,0x1f,0x9c,0xab);
-DEFINE_GUID(IID_ID3D12DeviceMetaCommand,0x547e33c7,0xff86,0x4cd9,0xbe,0xa3,0x5d,0x4a,0x28,0x37,0x53,0x96);
-DEFINE_GUID(IID_ID3D12MetaCommand,0x8AFDA767,0x8003,0x494F,0x9E,0x9A,0x4A,0xA8,0x86,0x4F,0x35,0x24);
-DEFINE_GUID(IID_ID3D12CommandListMetaCommand,0x5A5F59F3,0x7124,0x4766,0x8E,0x9E,0xCB,0x63,0x77,0x64,0xFB,0x0B);
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_1_0000_0012_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12_1_0000_0012_v0_0_s_ifspec;
-
-/* Additional Prototypes for ALL interfaces */
-
-/* end of Additional Prototypes */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h
deleted file mode 100644
index cb491c0dc02..00000000000
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12sdklayers.h
+++ /dev/null
@@ -1,3225 +0,0 @@
-/*-------------------------------------------------------------------------------------
- *
- * Copyright (c) Microsoft Corporation
- *
- *-------------------------------------------------------------------------------------*/
-
-
-/* this ALWAYS GENERATED file contains the definitions for the interfaces */
-
-
- /* File created by MIDL compiler version 8.01.0622 */
-
-
-
-/* verify that the <rpcndr.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
-#endif
-
-/* verify that the <rpcsal.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCSAL_H_VERSION__
-#define __REQUIRED_RPCSAL_H_VERSION__ 100
-#endif
-
-#include "rpc.h"
-#include "rpcndr.h"
-
-#ifndef __RPCNDR_H_VERSION__
-#error this stub requires an updated version of <rpcndr.h>
-#endif /* __RPCNDR_H_VERSION__ */
-
-#ifndef COM_NO_WINDOWS_H
-#include "windows.h"
-#include "ole2.h"
-#endif /*COM_NO_WINDOWS_H*/
-
-#ifndef __d3d12sdklayers_h__
-#define __d3d12sdklayers_h__
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-#pragma once
-#endif
-
-/* Forward Declarations */
-
-#ifndef __ID3D12Debug_FWD_DEFINED__
-#define __ID3D12Debug_FWD_DEFINED__
-typedef interface ID3D12Debug ID3D12Debug;
-
-#endif /* __ID3D12Debug_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12Debug1_FWD_DEFINED__
-#define __ID3D12Debug1_FWD_DEFINED__
-typedef interface ID3D12Debug1 ID3D12Debug1;
-
-#endif /* __ID3D12Debug1_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12Debug2_FWD_DEFINED__
-#define __ID3D12Debug2_FWD_DEFINED__
-typedef interface ID3D12Debug2 ID3D12Debug2;
-
-#endif /* __ID3D12Debug2_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12Debug3_FWD_DEFINED__
-#define __ID3D12Debug3_FWD_DEFINED__
-typedef interface ID3D12Debug3 ID3D12Debug3;
-
-#endif /* __ID3D12Debug3_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12DebugDevice1_FWD_DEFINED__
-#define __ID3D12DebugDevice1_FWD_DEFINED__
-typedef interface ID3D12DebugDevice1 ID3D12DebugDevice1;
-
-#endif /* __ID3D12DebugDevice1_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12DebugDevice_FWD_DEFINED__
-#define __ID3D12DebugDevice_FWD_DEFINED__
-typedef interface ID3D12DebugDevice ID3D12DebugDevice;
-
-#endif /* __ID3D12DebugDevice_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12DebugDevice2_FWD_DEFINED__
-#define __ID3D12DebugDevice2_FWD_DEFINED__
-typedef interface ID3D12DebugDevice2 ID3D12DebugDevice2;
-
-#endif /* __ID3D12DebugDevice2_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12DebugCommandQueue_FWD_DEFINED__
-#define __ID3D12DebugCommandQueue_FWD_DEFINED__
-typedef interface ID3D12DebugCommandQueue ID3D12DebugCommandQueue;
-
-#endif /* __ID3D12DebugCommandQueue_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12DebugCommandList1_FWD_DEFINED__
-#define __ID3D12DebugCommandList1_FWD_DEFINED__
-typedef interface ID3D12DebugCommandList1 ID3D12DebugCommandList1;
-
-#endif /* __ID3D12DebugCommandList1_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12DebugCommandList_FWD_DEFINED__
-#define __ID3D12DebugCommandList_FWD_DEFINED__
-typedef interface ID3D12DebugCommandList ID3D12DebugCommandList;
-
-#endif /* __ID3D12DebugCommandList_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12DebugCommandList2_FWD_DEFINED__
-#define __ID3D12DebugCommandList2_FWD_DEFINED__
-typedef interface ID3D12DebugCommandList2 ID3D12DebugCommandList2;
-
-#endif /* __ID3D12DebugCommandList2_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12SharingContract_FWD_DEFINED__
-#define __ID3D12SharingContract_FWD_DEFINED__
-typedef interface ID3D12SharingContract ID3D12SharingContract;
-
-#endif /* __ID3D12SharingContract_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12InfoQueue_FWD_DEFINED__
-#define __ID3D12InfoQueue_FWD_DEFINED__
-typedef interface ID3D12InfoQueue ID3D12InfoQueue;
-
-#endif /* __ID3D12InfoQueue_FWD_DEFINED__ */
-
-
-/* header files for imported files */
-#include "oaidl.h"
-#include "ocidl.h"
-#include "d3d12.h"
-
-#ifdef __cplusplus
-extern "C"{
-#endif
-
-
-/* interface __MIDL_itf_d3d12sdklayers_0000_0000 */
-/* [local] */
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0000_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0000_v0_0_s_ifspec;
-
-#ifndef __ID3D12Debug_INTERFACE_DEFINED__
-#define __ID3D12Debug_INTERFACE_DEFINED__
-
-/* interface ID3D12Debug */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12Debug;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("344488b7-6846-474b-b989-f027448245e0")
- ID3D12Debug : public IUnknown
- {
- public:
- virtual void STDMETHODCALLTYPE EnableDebugLayer( void) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12DebugVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12Debug * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12Debug * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12Debug * This);
-
- void ( STDMETHODCALLTYPE *EnableDebugLayer )(
- ID3D12Debug * This);
-
- END_INTERFACE
- } ID3D12DebugVtbl;
-
- interface ID3D12Debug
- {
- CONST_VTBL struct ID3D12DebugVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12Debug_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12Debug_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12Debug_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12Debug_EnableDebugLayer(This) \
- ( (This)->lpVtbl -> EnableDebugLayer(This) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12Debug_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12sdklayers_0000_0001 */
-/* [local] */
-
-typedef
-enum D3D12_GPU_BASED_VALIDATION_FLAGS
- {
- D3D12_GPU_BASED_VALIDATION_FLAGS_NONE = 0,
- D3D12_GPU_BASED_VALIDATION_FLAGS_DISABLE_STATE_TRACKING = 0x1
- } D3D12_GPU_BASED_VALIDATION_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_GPU_BASED_VALIDATION_FLAGS)
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0001_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0001_v0_0_s_ifspec;
-
-#ifndef __ID3D12Debug1_INTERFACE_DEFINED__
-#define __ID3D12Debug1_INTERFACE_DEFINED__
-
-/* interface ID3D12Debug1 */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12Debug1;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("affaa4ca-63fe-4d8e-b8ad-159000af4304")
- ID3D12Debug1 : public IUnknown
- {
- public:
- virtual void STDMETHODCALLTYPE EnableDebugLayer( void) = 0;
-
- virtual void STDMETHODCALLTYPE SetEnableGPUBasedValidation(
- BOOL Enable) = 0;
-
- virtual void STDMETHODCALLTYPE SetEnableSynchronizedCommandQueueValidation(
- BOOL Enable) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12Debug1Vtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12Debug1 * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12Debug1 * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12Debug1 * This);
-
- void ( STDMETHODCALLTYPE *EnableDebugLayer )(
- ID3D12Debug1 * This);
-
- void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )(
- ID3D12Debug1 * This,
- BOOL Enable);
-
- void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )(
- ID3D12Debug1 * This,
- BOOL Enable);
-
- END_INTERFACE
- } ID3D12Debug1Vtbl;
-
- interface ID3D12Debug1
- {
- CONST_VTBL struct ID3D12Debug1Vtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12Debug1_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12Debug1_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12Debug1_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12Debug1_EnableDebugLayer(This) \
- ( (This)->lpVtbl -> EnableDebugLayer(This) )
-
-#define ID3D12Debug1_SetEnableGPUBasedValidation(This,Enable) \
- ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) )
-
-#define ID3D12Debug1_SetEnableSynchronizedCommandQueueValidation(This,Enable) \
- ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12Debug1_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12Debug2_INTERFACE_DEFINED__
-#define __ID3D12Debug2_INTERFACE_DEFINED__
-
-/* interface ID3D12Debug2 */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12Debug2;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("93a665c4-a3b2-4e5d-b692-a26ae14e3374")
- ID3D12Debug2 : public IUnknown
- {
- public:
- virtual void STDMETHODCALLTYPE SetGPUBasedValidationFlags(
- D3D12_GPU_BASED_VALIDATION_FLAGS Flags) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12Debug2Vtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12Debug2 * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12Debug2 * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12Debug2 * This);
-
- void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )(
- ID3D12Debug2 * This,
- D3D12_GPU_BASED_VALIDATION_FLAGS Flags);
-
- END_INTERFACE
- } ID3D12Debug2Vtbl;
-
- interface ID3D12Debug2
- {
- CONST_VTBL struct ID3D12Debug2Vtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12Debug2_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12Debug2_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12Debug2_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12Debug2_SetGPUBasedValidationFlags(This,Flags) \
- ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12Debug2_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12Debug3_INTERFACE_DEFINED__
-#define __ID3D12Debug3_INTERFACE_DEFINED__
-
-/* interface ID3D12Debug3 */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12Debug3;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("5cf4e58f-f671-4ff1-a542-3686e3d153d1")
- ID3D12Debug3 : public ID3D12Debug
- {
- public:
- virtual void STDMETHODCALLTYPE SetEnableGPUBasedValidation(
- BOOL Enable) = 0;
-
- virtual void STDMETHODCALLTYPE SetEnableSynchronizedCommandQueueValidation(
- BOOL Enable) = 0;
-
- virtual void STDMETHODCALLTYPE SetGPUBasedValidationFlags(
- D3D12_GPU_BASED_VALIDATION_FLAGS Flags) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12Debug3Vtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12Debug3 * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12Debug3 * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12Debug3 * This);
-
- void ( STDMETHODCALLTYPE *EnableDebugLayer )(
- ID3D12Debug3 * This);
-
- void ( STDMETHODCALLTYPE *SetEnableGPUBasedValidation )(
- ID3D12Debug3 * This,
- BOOL Enable);
-
- void ( STDMETHODCALLTYPE *SetEnableSynchronizedCommandQueueValidation )(
- ID3D12Debug3 * This,
- BOOL Enable);
-
- void ( STDMETHODCALLTYPE *SetGPUBasedValidationFlags )(
- ID3D12Debug3 * This,
- D3D12_GPU_BASED_VALIDATION_FLAGS Flags);
-
- END_INTERFACE
- } ID3D12Debug3Vtbl;
-
- interface ID3D12Debug3
- {
- CONST_VTBL struct ID3D12Debug3Vtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12Debug3_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12Debug3_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12Debug3_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12Debug3_EnableDebugLayer(This) \
- ( (This)->lpVtbl -> EnableDebugLayer(This) )
-
-
-#define ID3D12Debug3_SetEnableGPUBasedValidation(This,Enable) \
- ( (This)->lpVtbl -> SetEnableGPUBasedValidation(This,Enable) )
-
-#define ID3D12Debug3_SetEnableSynchronizedCommandQueueValidation(This,Enable) \
- ( (This)->lpVtbl -> SetEnableSynchronizedCommandQueueValidation(This,Enable) )
-
-#define ID3D12Debug3_SetGPUBasedValidationFlags(This,Flags) \
- ( (This)->lpVtbl -> SetGPUBasedValidationFlags(This,Flags) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12Debug3_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12sdklayers_0000_0004 */
-/* [local] */
-
-typedef
-enum D3D12_RLDO_FLAGS
- {
- D3D12_RLDO_NONE = 0,
- D3D12_RLDO_SUMMARY = 0x1,
- D3D12_RLDO_DETAIL = 0x2,
- D3D12_RLDO_IGNORE_INTERNAL = 0x4
- } D3D12_RLDO_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_RLDO_FLAGS)
-typedef
-enum D3D12_DEBUG_DEVICE_PARAMETER_TYPE
- {
- D3D12_DEBUG_DEVICE_PARAMETER_FEATURE_FLAGS = 0,
- D3D12_DEBUG_DEVICE_PARAMETER_GPU_BASED_VALIDATION_SETTINGS = ( D3D12_DEBUG_DEVICE_PARAMETER_FEATURE_FLAGS + 1 ) ,
- D3D12_DEBUG_DEVICE_PARAMETER_GPU_SLOWDOWN_PERFORMANCE_FACTOR = ( D3D12_DEBUG_DEVICE_PARAMETER_GPU_BASED_VALIDATION_SETTINGS + 1 )
- } D3D12_DEBUG_DEVICE_PARAMETER_TYPE;
-
-typedef
-enum D3D12_DEBUG_FEATURE
- {
- D3D12_DEBUG_FEATURE_NONE = 0,
- D3D12_DEBUG_FEATURE_ALLOW_BEHAVIOR_CHANGING_DEBUG_AIDS = 0x1,
- D3D12_DEBUG_FEATURE_CONSERVATIVE_RESOURCE_STATE_TRACKING = 0x2,
- D3D12_DEBUG_FEATURE_DISABLE_VIRTUALIZED_BUNDLES_VALIDATION = 0x4,
- D3D12_DEBUG_FEATURE_EMULATE_WINDOWS7 = 0x8
- } D3D12_DEBUG_FEATURE;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_DEBUG_FEATURE)
-typedef
-enum D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE
- {
- D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_NONE = 0,
- D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_STATE_TRACKING_ONLY = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_NONE + 1 ) ,
- D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_STATE_TRACKING_ONLY + 1 ) ,
- D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_GUARDED_VALIDATION = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_UNGUARDED_VALIDATION + 1 ) ,
- NUM_D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODES = ( D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE_GUARDED_VALIDATION + 1 )
- } D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE;
-
-typedef
-enum D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS
- {
- D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_NONE = 0,
- D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_TRACKING_ONLY_SHADERS = 0x1,
- D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_UNGUARDED_VALIDATION_SHADERS = 0x2,
- D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAG_FRONT_LOAD_CREATE_GUARDED_VALIDATION_SHADERS = 0x4,
- D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS_VALID_MASK = 0x7
- } D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS)
-typedef struct D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS
- {
- UINT MaxMessagesPerCommandList;
- D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE DefaultShaderPatchMode;
- D3D12_GPU_BASED_VALIDATION_PIPELINE_STATE_CREATE_FLAGS PipelineStateCreateFlags;
- } D3D12_DEBUG_DEVICE_GPU_BASED_VALIDATION_SETTINGS;
-
-typedef struct D3D12_DEBUG_DEVICE_GPU_SLOWDOWN_PERFORMANCE_FACTOR
- {
- FLOAT SlowdownFactor;
- } D3D12_DEBUG_DEVICE_GPU_SLOWDOWN_PERFORMANCE_FACTOR;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0004_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0004_v0_0_s_ifspec;
-
-#ifndef __ID3D12DebugDevice1_INTERFACE_DEFINED__
-#define __ID3D12DebugDevice1_INTERFACE_DEFINED__
-
-/* interface ID3D12DebugDevice1 */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12DebugDevice1;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("a9b71770-d099-4a65-a698-3dee10020f88")
- ID3D12DebugDevice1 : public IUnknown
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE SetDebugParameter(
- D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
- _In_reads_bytes_(DataSize) const void *pData,
- UINT DataSize) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetDebugParameter(
- D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
- _Out_writes_bytes_(DataSize) void *pData,
- UINT DataSize) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects(
- D3D12_RLDO_FLAGS Flags) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12DebugDevice1Vtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12DebugDevice1 * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12DebugDevice1 * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12DebugDevice1 * This);
-
- HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )(
- ID3D12DebugDevice1 * This,
- D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
- _In_reads_bytes_(DataSize) const void *pData,
- UINT DataSize);
-
- HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )(
- ID3D12DebugDevice1 * This,
- D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
- _Out_writes_bytes_(DataSize) void *pData,
- UINT DataSize);
-
- HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )(
- ID3D12DebugDevice1 * This,
- D3D12_RLDO_FLAGS Flags);
-
- END_INTERFACE
- } ID3D12DebugDevice1Vtbl;
-
- interface ID3D12DebugDevice1
- {
- CONST_VTBL struct ID3D12DebugDevice1Vtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12DebugDevice1_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12DebugDevice1_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12DebugDevice1_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12DebugDevice1_SetDebugParameter(This,Type,pData,DataSize) \
- ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) )
-
-#define ID3D12DebugDevice1_GetDebugParameter(This,Type,pData,DataSize) \
- ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) )
-
-#define ID3D12DebugDevice1_ReportLiveDeviceObjects(This,Flags) \
- ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12DebugDevice1_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12DebugDevice_INTERFACE_DEFINED__
-#define __ID3D12DebugDevice_INTERFACE_DEFINED__
-
-/* interface ID3D12DebugDevice */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12DebugDevice;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("3febd6dd-4973-4787-8194-e45f9e28923e")
- ID3D12DebugDevice : public IUnknown
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE SetFeatureMask(
- D3D12_DEBUG_FEATURE Mask) = 0;
-
- virtual D3D12_DEBUG_FEATURE STDMETHODCALLTYPE GetFeatureMask( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE ReportLiveDeviceObjects(
- D3D12_RLDO_FLAGS Flags) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12DebugDeviceVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12DebugDevice * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12DebugDevice * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12DebugDevice * This);
-
- HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
- ID3D12DebugDevice * This,
- D3D12_DEBUG_FEATURE Mask);
-
- D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )(
- ID3D12DebugDevice * This);
-
- HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )(
- ID3D12DebugDevice * This,
- D3D12_RLDO_FLAGS Flags);
-
- END_INTERFACE
- } ID3D12DebugDeviceVtbl;
-
- interface ID3D12DebugDevice
- {
- CONST_VTBL struct ID3D12DebugDeviceVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12DebugDevice_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12DebugDevice_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12DebugDevice_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12DebugDevice_SetFeatureMask(This,Mask) \
- ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
-
-#define ID3D12DebugDevice_GetFeatureMask(This) \
- ( (This)->lpVtbl -> GetFeatureMask(This) )
-
-#define ID3D12DebugDevice_ReportLiveDeviceObjects(This,Flags) \
- ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12DebugDevice_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12DebugDevice2_INTERFACE_DEFINED__
-#define __ID3D12DebugDevice2_INTERFACE_DEFINED__
-
-/* interface ID3D12DebugDevice2 */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12DebugDevice2;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("60eccbc1-378d-4df1-894c-f8ac5ce4d7dd")
- ID3D12DebugDevice2 : public ID3D12DebugDevice
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE SetDebugParameter(
- D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
- _In_reads_bytes_(DataSize) const void *pData,
- UINT DataSize) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetDebugParameter(
- D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
- _Out_writes_bytes_(DataSize) void *pData,
- UINT DataSize) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12DebugDevice2Vtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12DebugDevice2 * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12DebugDevice2 * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12DebugDevice2 * This);
-
- HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
- ID3D12DebugDevice2 * This,
- D3D12_DEBUG_FEATURE Mask);
-
- D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )(
- ID3D12DebugDevice2 * This);
-
- HRESULT ( STDMETHODCALLTYPE *ReportLiveDeviceObjects )(
- ID3D12DebugDevice2 * This,
- D3D12_RLDO_FLAGS Flags);
-
- HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )(
- ID3D12DebugDevice2 * This,
- D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
- _In_reads_bytes_(DataSize) const void *pData,
- UINT DataSize);
-
- HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )(
- ID3D12DebugDevice2 * This,
- D3D12_DEBUG_DEVICE_PARAMETER_TYPE Type,
- _Out_writes_bytes_(DataSize) void *pData,
- UINT DataSize);
-
- END_INTERFACE
- } ID3D12DebugDevice2Vtbl;
-
- interface ID3D12DebugDevice2
- {
- CONST_VTBL struct ID3D12DebugDevice2Vtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12DebugDevice2_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12DebugDevice2_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12DebugDevice2_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12DebugDevice2_SetFeatureMask(This,Mask) \
- ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
-
-#define ID3D12DebugDevice2_GetFeatureMask(This) \
- ( (This)->lpVtbl -> GetFeatureMask(This) )
-
-#define ID3D12DebugDevice2_ReportLiveDeviceObjects(This,Flags) \
- ( (This)->lpVtbl -> ReportLiveDeviceObjects(This,Flags) )
-
-
-#define ID3D12DebugDevice2_SetDebugParameter(This,Type,pData,DataSize) \
- ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) )
-
-#define ID3D12DebugDevice2_GetDebugParameter(This,Type,pData,DataSize) \
- ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12DebugDevice2_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12sdklayers_0000_0007 */
-/* [local] */
-
-DEFINE_GUID(DXGI_DEBUG_D3D12, 0xcf59a98c, 0xa950, 0x4326, 0x91, 0xef, 0x9b, 0xba, 0xa1, 0x7b, 0xfd, 0x95);
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0007_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0007_v0_0_s_ifspec;
-
-#ifndef __ID3D12DebugCommandQueue_INTERFACE_DEFINED__
-#define __ID3D12DebugCommandQueue_INTERFACE_DEFINED__
-
-/* interface ID3D12DebugCommandQueue */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12DebugCommandQueue;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("09e0bf36-54ac-484f-8847-4baeeab6053a")
- ID3D12DebugCommandQueue : public IUnknown
- {
- public:
- virtual BOOL STDMETHODCALLTYPE AssertResourceState(
- _In_ ID3D12Resource *pResource,
- UINT Subresource,
- UINT State) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12DebugCommandQueueVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12DebugCommandQueue * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12DebugCommandQueue * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12DebugCommandQueue * This);
-
- BOOL ( STDMETHODCALLTYPE *AssertResourceState )(
- ID3D12DebugCommandQueue * This,
- _In_ ID3D12Resource *pResource,
- UINT Subresource,
- UINT State);
-
- END_INTERFACE
- } ID3D12DebugCommandQueueVtbl;
-
- interface ID3D12DebugCommandQueue
- {
- CONST_VTBL struct ID3D12DebugCommandQueueVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12DebugCommandQueue_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12DebugCommandQueue_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12DebugCommandQueue_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12DebugCommandQueue_AssertResourceState(This,pResource,Subresource,State) \
- ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12DebugCommandQueue_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12sdklayers_0000_0008 */
-/* [local] */
-
-typedef
-enum D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE
- {
- D3D12_DEBUG_COMMAND_LIST_PARAMETER_GPU_BASED_VALIDATION_SETTINGS = 0
- } D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE;
-
-typedef struct D3D12_DEBUG_COMMAND_LIST_GPU_BASED_VALIDATION_SETTINGS
- {
- D3D12_GPU_BASED_VALIDATION_SHADER_PATCH_MODE ShaderPatchMode;
- } D3D12_DEBUG_COMMAND_LIST_GPU_BASED_VALIDATION_SETTINGS;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0008_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0008_v0_0_s_ifspec;
-
-#ifndef __ID3D12DebugCommandList1_INTERFACE_DEFINED__
-#define __ID3D12DebugCommandList1_INTERFACE_DEFINED__
-
-/* interface ID3D12DebugCommandList1 */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12DebugCommandList1;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("102ca951-311b-4b01-b11f-ecb83e061b37")
- ID3D12DebugCommandList1 : public IUnknown
- {
- public:
- virtual BOOL STDMETHODCALLTYPE AssertResourceState(
- _In_ ID3D12Resource *pResource,
- UINT Subresource,
- UINT State) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetDebugParameter(
- D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
- _In_reads_bytes_(DataSize) const void *pData,
- UINT DataSize) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetDebugParameter(
- D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
- _Out_writes_bytes_(DataSize) void *pData,
- UINT DataSize) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12DebugCommandList1Vtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12DebugCommandList1 * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12DebugCommandList1 * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12DebugCommandList1 * This);
-
- BOOL ( STDMETHODCALLTYPE *AssertResourceState )(
- ID3D12DebugCommandList1 * This,
- _In_ ID3D12Resource *pResource,
- UINT Subresource,
- UINT State);
-
- HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )(
- ID3D12DebugCommandList1 * This,
- D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
- _In_reads_bytes_(DataSize) const void *pData,
- UINT DataSize);
-
- HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )(
- ID3D12DebugCommandList1 * This,
- D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
- _Out_writes_bytes_(DataSize) void *pData,
- UINT DataSize);
-
- END_INTERFACE
- } ID3D12DebugCommandList1Vtbl;
-
- interface ID3D12DebugCommandList1
- {
- CONST_VTBL struct ID3D12DebugCommandList1Vtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12DebugCommandList1_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12DebugCommandList1_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12DebugCommandList1_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12DebugCommandList1_AssertResourceState(This,pResource,Subresource,State) \
- ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) )
-
-#define ID3D12DebugCommandList1_SetDebugParameter(This,Type,pData,DataSize) \
- ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) )
-
-#define ID3D12DebugCommandList1_GetDebugParameter(This,Type,pData,DataSize) \
- ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12DebugCommandList1_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12DebugCommandList_INTERFACE_DEFINED__
-#define __ID3D12DebugCommandList_INTERFACE_DEFINED__
-
-/* interface ID3D12DebugCommandList */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12DebugCommandList;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("09e0bf36-54ac-484f-8847-4baeeab6053f")
- ID3D12DebugCommandList : public IUnknown
- {
- public:
- virtual BOOL STDMETHODCALLTYPE AssertResourceState(
- _In_ ID3D12Resource *pResource,
- UINT Subresource,
- UINT State) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetFeatureMask(
- D3D12_DEBUG_FEATURE Mask) = 0;
-
- virtual D3D12_DEBUG_FEATURE STDMETHODCALLTYPE GetFeatureMask( void) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12DebugCommandListVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12DebugCommandList * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12DebugCommandList * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12DebugCommandList * This);
-
- BOOL ( STDMETHODCALLTYPE *AssertResourceState )(
- ID3D12DebugCommandList * This,
- _In_ ID3D12Resource *pResource,
- UINT Subresource,
- UINT State);
-
- HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
- ID3D12DebugCommandList * This,
- D3D12_DEBUG_FEATURE Mask);
-
- D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )(
- ID3D12DebugCommandList * This);
-
- END_INTERFACE
- } ID3D12DebugCommandListVtbl;
-
- interface ID3D12DebugCommandList
- {
- CONST_VTBL struct ID3D12DebugCommandListVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12DebugCommandList_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12DebugCommandList_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12DebugCommandList_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12DebugCommandList_AssertResourceState(This,pResource,Subresource,State) \
- ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) )
-
-#define ID3D12DebugCommandList_SetFeatureMask(This,Mask) \
- ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
-
-#define ID3D12DebugCommandList_GetFeatureMask(This) \
- ( (This)->lpVtbl -> GetFeatureMask(This) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12DebugCommandList_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12DebugCommandList2_INTERFACE_DEFINED__
-#define __ID3D12DebugCommandList2_INTERFACE_DEFINED__
-
-/* interface ID3D12DebugCommandList2 */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12DebugCommandList2;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("aeb575cf-4e06-48be-ba3b-c450fc96652e")
- ID3D12DebugCommandList2 : public ID3D12DebugCommandList
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE SetDebugParameter(
- D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
- _In_reads_bytes_(DataSize) const void *pData,
- UINT DataSize) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetDebugParameter(
- D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
- _Out_writes_bytes_(DataSize) void *pData,
- UINT DataSize) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12DebugCommandList2Vtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12DebugCommandList2 * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12DebugCommandList2 * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12DebugCommandList2 * This);
-
- BOOL ( STDMETHODCALLTYPE *AssertResourceState )(
- ID3D12DebugCommandList2 * This,
- _In_ ID3D12Resource *pResource,
- UINT Subresource,
- UINT State);
-
- HRESULT ( STDMETHODCALLTYPE *SetFeatureMask )(
- ID3D12DebugCommandList2 * This,
- D3D12_DEBUG_FEATURE Mask);
-
- D3D12_DEBUG_FEATURE ( STDMETHODCALLTYPE *GetFeatureMask )(
- ID3D12DebugCommandList2 * This);
-
- HRESULT ( STDMETHODCALLTYPE *SetDebugParameter )(
- ID3D12DebugCommandList2 * This,
- D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
- _In_reads_bytes_(DataSize) const void *pData,
- UINT DataSize);
-
- HRESULT ( STDMETHODCALLTYPE *GetDebugParameter )(
- ID3D12DebugCommandList2 * This,
- D3D12_DEBUG_COMMAND_LIST_PARAMETER_TYPE Type,
- _Out_writes_bytes_(DataSize) void *pData,
- UINT DataSize);
-
- END_INTERFACE
- } ID3D12DebugCommandList2Vtbl;
-
- interface ID3D12DebugCommandList2
- {
- CONST_VTBL struct ID3D12DebugCommandList2Vtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12DebugCommandList2_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12DebugCommandList2_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12DebugCommandList2_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12DebugCommandList2_AssertResourceState(This,pResource,Subresource,State) \
- ( (This)->lpVtbl -> AssertResourceState(This,pResource,Subresource,State) )
-
-#define ID3D12DebugCommandList2_SetFeatureMask(This,Mask) \
- ( (This)->lpVtbl -> SetFeatureMask(This,Mask) )
-
-#define ID3D12DebugCommandList2_GetFeatureMask(This) \
- ( (This)->lpVtbl -> GetFeatureMask(This) )
-
-
-#define ID3D12DebugCommandList2_SetDebugParameter(This,Type,pData,DataSize) \
- ( (This)->lpVtbl -> SetDebugParameter(This,Type,pData,DataSize) )
-
-#define ID3D12DebugCommandList2_GetDebugParameter(This,Type,pData,DataSize) \
- ( (This)->lpVtbl -> GetDebugParameter(This,Type,pData,DataSize) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12DebugCommandList2_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12SharingContract_INTERFACE_DEFINED__
-#define __ID3D12SharingContract_INTERFACE_DEFINED__
-
-/* interface ID3D12SharingContract */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12SharingContract;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("0adf7d52-929c-4e61-addb-ffed30de66ef")
- ID3D12SharingContract : public IUnknown
- {
- public:
- virtual void STDMETHODCALLTYPE Present(
- _In_ ID3D12Resource *pResource,
- UINT Subresource,
- _In_ HWND window) = 0;
-
- virtual void STDMETHODCALLTYPE SharedFenceSignal(
- _In_ ID3D12Fence *pFence,
- UINT64 FenceValue) = 0;
-
- virtual void STDMETHODCALLTYPE BeginCapturableWork(
- _In_ REFGUID guid) = 0;
-
- virtual void STDMETHODCALLTYPE EndCapturableWork(
- _In_ REFGUID guid) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12SharingContractVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12SharingContract * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12SharingContract * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12SharingContract * This);
-
- void ( STDMETHODCALLTYPE *Present )(
- ID3D12SharingContract * This,
- _In_ ID3D12Resource *pResource,
- UINT Subresource,
- _In_ HWND window);
-
- void ( STDMETHODCALLTYPE *SharedFenceSignal )(
- ID3D12SharingContract * This,
- _In_ ID3D12Fence *pFence,
- UINT64 FenceValue);
-
- void ( STDMETHODCALLTYPE *BeginCapturableWork )(
- ID3D12SharingContract * This,
- _In_ REFGUID guid);
-
- void ( STDMETHODCALLTYPE *EndCapturableWork )(
- ID3D12SharingContract * This,
- _In_ REFGUID guid);
-
- END_INTERFACE
- } ID3D12SharingContractVtbl;
-
- interface ID3D12SharingContract
- {
- CONST_VTBL struct ID3D12SharingContractVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12SharingContract_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12SharingContract_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12SharingContract_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12SharingContract_Present(This,pResource,Subresource,window) \
- ( (This)->lpVtbl -> Present(This,pResource,Subresource,window) )
-
-#define ID3D12SharingContract_SharedFenceSignal(This,pFence,FenceValue) \
- ( (This)->lpVtbl -> SharedFenceSignal(This,pFence,FenceValue) )
-
-#define ID3D12SharingContract_BeginCapturableWork(This,guid) \
- ( (This)->lpVtbl -> BeginCapturableWork(This,guid) )
-
-#define ID3D12SharingContract_EndCapturableWork(This,guid) \
- ( (This)->lpVtbl -> EndCapturableWork(This,guid) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12SharingContract_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12sdklayers_0000_0012 */
-/* [local] */
-
-typedef
-enum D3D12_MESSAGE_CATEGORY
- {
- D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED = 0,
- D3D12_MESSAGE_CATEGORY_MISCELLANEOUS = ( D3D12_MESSAGE_CATEGORY_APPLICATION_DEFINED + 1 ) ,
- D3D12_MESSAGE_CATEGORY_INITIALIZATION = ( D3D12_MESSAGE_CATEGORY_MISCELLANEOUS + 1 ) ,
- D3D12_MESSAGE_CATEGORY_CLEANUP = ( D3D12_MESSAGE_CATEGORY_INITIALIZATION + 1 ) ,
- D3D12_MESSAGE_CATEGORY_COMPILATION = ( D3D12_MESSAGE_CATEGORY_CLEANUP + 1 ) ,
- D3D12_MESSAGE_CATEGORY_STATE_CREATION = ( D3D12_MESSAGE_CATEGORY_COMPILATION + 1 ) ,
- D3D12_MESSAGE_CATEGORY_STATE_SETTING = ( D3D12_MESSAGE_CATEGORY_STATE_CREATION + 1 ) ,
- D3D12_MESSAGE_CATEGORY_STATE_GETTING = ( D3D12_MESSAGE_CATEGORY_STATE_SETTING + 1 ) ,
- D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION = ( D3D12_MESSAGE_CATEGORY_STATE_GETTING + 1 ) ,
- D3D12_MESSAGE_CATEGORY_EXECUTION = ( D3D12_MESSAGE_CATEGORY_RESOURCE_MANIPULATION + 1 ) ,
- D3D12_MESSAGE_CATEGORY_SHADER = ( D3D12_MESSAGE_CATEGORY_EXECUTION + 1 )
- } D3D12_MESSAGE_CATEGORY;
-
-typedef
-enum D3D12_MESSAGE_SEVERITY
- {
- D3D12_MESSAGE_SEVERITY_CORRUPTION = 0,
- D3D12_MESSAGE_SEVERITY_ERROR = ( D3D12_MESSAGE_SEVERITY_CORRUPTION + 1 ) ,
- D3D12_MESSAGE_SEVERITY_WARNING = ( D3D12_MESSAGE_SEVERITY_ERROR + 1 ) ,
- D3D12_MESSAGE_SEVERITY_INFO = ( D3D12_MESSAGE_SEVERITY_WARNING + 1 ) ,
- D3D12_MESSAGE_SEVERITY_MESSAGE = ( D3D12_MESSAGE_SEVERITY_INFO + 1 )
- } D3D12_MESSAGE_SEVERITY;
-
-typedef
-enum D3D12_MESSAGE_ID
- {
- D3D12_MESSAGE_ID_UNKNOWN = 0,
- D3D12_MESSAGE_ID_STRING_FROM_APPLICATION = ( D3D12_MESSAGE_ID_UNKNOWN + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_THIS = ( D3D12_MESSAGE_ID_STRING_FROM_APPLICATION + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER1 = ( D3D12_MESSAGE_ID_CORRUPTED_THIS + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER2 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER1 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER3 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER2 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER4 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER3 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER5 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER4 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER6 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER5 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER7 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER6 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER8 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER7 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER9 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER8 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER10 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER9 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER11 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER10 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER12 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER11 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER13 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER12 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER14 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER13 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_PARAMETER15 = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER14 + 1 ) ,
- D3D12_MESSAGE_ID_CORRUPTED_MULTITHREADING = ( D3D12_MESSAGE_ID_CORRUPTED_PARAMETER15 + 1 ) ,
- D3D12_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CORRUPTED_MULTITHREADING + 1 ) ,
- D3D12_MESSAGE_ID_GETPRIVATEDATA_MOREDATA = ( D3D12_MESSAGE_ID_MESSAGE_REPORTING_OUTOFMEMORY + 1 ) ,
- D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA = ( D3D12_MESSAGE_ID_GETPRIVATEDATA_MOREDATA + 1 ) ,
- D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN = ( D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFREEDATA + 1 ) ,
- D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS = ( D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDIUNKNOWN + 1 ) ,
- D3D12_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS = ( D3D12_MESSAGE_ID_SETPRIVATEDATA_INVALIDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY = ( D3D12_MESSAGE_ID_SETPRIVATEDATA_CHANGINGPARAMS + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT = ( D3D12_MESSAGE_ID_SETPRIVATEDATA_OUTOFMEMORY + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDESC + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANESLICE = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANESLICE = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANESLICE + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANESLICE + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDDIMENSIONS + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARG_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_OUTOFMEMORY_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_UNSUPPORTEDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDESC + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANESLICE = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANESLICE = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANESLICE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANESLICE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDDIMENSIONS + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARG_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_OUTOFMEMORY_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDESC + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDDIMENSIONS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDARG_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_OUTOFMEMORY_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_OUTOFMEMORY + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TOOMANYELEMENTS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INCOMPATIBLEFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDINPUTSLOTCLASS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_STEPRATESLOTCLASSMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSLOTCLASSCHANGE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDSTEPRATECHANGE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_INVALIDALIGNMENT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_DUPLICATESEMANTIC + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_UNPARSEABLEINPUTSIGNATURE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_NULLSEMANTIC + 1 ) ,
- D3D12_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_MISSINGELEMENT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATEVERTEXSHADER_OUTOFMEMORY + 1 ) ,
- D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE = ( D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_OUTOFMEMORY + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTOFMEMORY + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERBYTECODE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSHADERTYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMENTRIES + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSTREAMSTRIDEUNUSED + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDDECL + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_EXPECTEDDECL + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_OUTPUTSLOT0EXPECTED + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSLOT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_ONLYONEELEMENTPERSLOT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCOMPONENTCOUNT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTARTCOMPONENTANDCOMPONENTCOUNT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDGAPDEFINITION + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_REPEATEDOUTPUT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDOUTPUTSTREAMSTRIDE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGSEMANTIC + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MASKMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_CANTHAVEONLYGAPS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DECLTOOCOMPLEX + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_MISSINGOUTPUTSIGNATURE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATEPIXELSHADER_OUTOFMEMORY + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE = ( D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE = ( D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFILLMODE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDCULLMODE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDDEPTHBIASCLAMP + 1 ) ,
- D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDSLOPESCALEDDEPTHBIAS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_NULLDESC + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHWRITEMASK + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDDEPTHFUNC + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFAILOP + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILZFAILOP + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILPASSOP + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDFRONTFACESTENCILFUNC + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFAILOP + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILZFAILOP + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILPASSOP + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_INVALIDBACKFACESTENCILFUNC + 1 ) ,
- D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_NULLDESC + 1 ) ,
- D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLEND + 1 ) ,
- D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLEND + 1 ) ,
- D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOP + 1 ) ,
- D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDSRCBLENDALPHA + 1 ) ,
- D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDDESTBLENDALPHA + 1 ) ,
- D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDBLENDOPALPHA + 1 ) ,
- D3D12_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDRENDERTARGETWRITEMASK + 1 ) ,
- D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_NULLDESC + 1 ) ,
- D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDFILTER + 1 ) ,
- D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSU + 1 ) ,
- D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSV + 1 ) ,
- D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDADDRESSW + 1 ) ,
- D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMIPLODBIAS + 1 ) ,
- D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXANISOTROPY + 1 ) ,
- D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDCOMPARISONFUNC + 1 ) ,
- D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMINLOD + 1 ) ,
- D3D12_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_INVALIDMAXLOD + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED = ( D3D12_MESSAGE_ID_CREATESAMPLERSTATE_NULLDESC + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED = ( D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNRECOGNIZED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT = ( D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNDEFINED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR = ( D3D12_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_INVALIDVIEWPORT + 1 ) ,
- D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH = ( D3D12_MESSAGE_ID_DEVICE_RSSETSCISSORRECTS_INVALIDSCISSOR + 1 ) ,
- D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH = ( D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_DENORMFLUSH + 1 ) ,
- D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID = ( D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DENORMFLUSH + 1 ) ,
- D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE = ( D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE = ( D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCE + 1 ) ,
- D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE = ( D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
- D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE = ( D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSOURCESTATE + 1 ) ,
- D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX = ( D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE = ( D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONBOX + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID = ( D3D12_MESSAGE_ID_UPDATESUBRESOURCE_INVALIDDESTINATIONSTATE + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID = ( D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID = ( D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_DESTINATION_SUBRESOURCE_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID = ( D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID = ( D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_SOURCE_SUBRESOURCE_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE = ( D3D12_MESSAGE_ID_DEVICE_RESOLVESUBRESOURCE_FORMAT_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS = ( D3D12_MESSAGE_ID_BUFFER_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D12_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED = ( D3D12_MESSAGE_ID_BUFFER_MAP_INVALIDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN = ( D3D12_MESSAGE_ID_BUFFER_MAP_ALREADYMAPPED + 1 ) ,
- D3D12_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED = ( D3D12_MESSAGE_ID_BUFFER_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE = ( D3D12_MESSAGE_ID_BUFFER_UNMAP_NOTMAPPED + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS = ( D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED = ( D3D12_MESSAGE_ID_TEXTURE1D_MAP_INVALIDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN = ( D3D12_MESSAGE_ID_TEXTURE1D_MAP_ALREADYMAPPED + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_TEXTURE1D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED = ( D3D12_MESSAGE_ID_TEXTURE1D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE = ( D3D12_MESSAGE_ID_TEXTURE1D_UNMAP_NOTMAPPED + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS = ( D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED = ( D3D12_MESSAGE_ID_TEXTURE2D_MAP_INVALIDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN = ( D3D12_MESSAGE_ID_TEXTURE2D_MAP_ALREADYMAPPED + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_TEXTURE2D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED = ( D3D12_MESSAGE_ID_TEXTURE2D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE = ( D3D12_MESSAGE_ID_TEXTURE2D_UNMAP_NOTMAPPED + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS = ( D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED = ( D3D12_MESSAGE_ID_TEXTURE3D_MAP_INVALIDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN = ( D3D12_MESSAGE_ID_TEXTURE3D_MAP_ALREADYMAPPED + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_TEXTURE3D_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED = ( D3D12_MESSAGE_ID_TEXTURE3D_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED = ( D3D12_MESSAGE_ID_TEXTURE3D_UNMAP_NOTMAPPED + 1 ) ,
- D3D12_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED = ( D3D12_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_DEPRECATED + 1 ) ,
- D3D12_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS = ( D3D12_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_FORMAT_DEPRECATED + 1 ) ,
- D3D12_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_SETEXCEPTIONMODE_UNRECOGNIZEDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN = ( D3D12_MESSAGE_ID_SETEXCEPTIONMODE_INVALIDARG_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE = ( D3D12_MESSAGE_ID_SETEXCEPTIONMODE_DEVICEREMOVED_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_REF_THREADING_MODE = ( D3D12_MESSAGE_ID_REF_SIMULATING_INFINITELY_FAST_HARDWARE + 1 ) ,
- D3D12_MESSAGE_ID_REF_UMDRIVER_EXCEPTION = ( D3D12_MESSAGE_ID_REF_THREADING_MODE + 1 ) ,
- D3D12_MESSAGE_ID_REF_KMDRIVER_EXCEPTION = ( D3D12_MESSAGE_ID_REF_UMDRIVER_EXCEPTION + 1 ) ,
- D3D12_MESSAGE_ID_REF_HARDWARE_EXCEPTION = ( D3D12_MESSAGE_ID_REF_KMDRIVER_EXCEPTION + 1 ) ,
- D3D12_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE = ( D3D12_MESSAGE_ID_REF_HARDWARE_EXCEPTION + 1 ) ,
- D3D12_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER = ( D3D12_MESSAGE_ID_REF_ACCESSING_INDEXABLE_TEMP_OUT_OF_RANGE + 1 ) ,
- D3D12_MESSAGE_ID_REF_OUT_OF_MEMORY = ( D3D12_MESSAGE_ID_REF_PROBLEM_PARSING_SHADER + 1 ) ,
- D3D12_MESSAGE_ID_REF_INFO = ( D3D12_MESSAGE_ID_REF_OUT_OF_MEMORY + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW = ( D3D12_MESSAGE_ID_REF_INFO + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DRAW_VERTEXPOS_OVERFLOW + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DRAWINDEXED_INDEXPOS_OVERFLOW + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DRAWINSTANCED_VERTEXPOS_OVERFLOW + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DRAWINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INSTANCEPOS_OVERFLOW + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET = ( D3D12_MESSAGE_ID_DEVICE_DRAWINDEXEDINSTANCED_INDEXPOS_OVERFLOW + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = ( D3D12_MESSAGE_ID_DEVICE_DRAW_VERTEX_SHADER_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERINDEX + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_COMPONENTTYPE + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_REGISTERMASK + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_SYSTEMVALUE + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_NOT_SET = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_ROOT_SIGNATURE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INPUTLAYOUT_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_CONSTANT_BUFFER_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INPUTLAYOUT_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_CONSTANT_BUFFER_TOO_SMALL = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_CONSTANT_BUFFER_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SAMPLER_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_CONSTANT_BUFFER_TOO_SMALL + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SHADERRESOURCEVIEW_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SAMPLER_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VIEW_DIMENSION_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SHADERRESOURCEVIEW_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VIEW_DIMENSION_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_TOO_SMALL = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_STRIDE_TOO_SMALL + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_BUFFER_TOO_SMALL + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_FORMAT_INVALID = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_TOO_SMALL = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_FORMAT_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_GS_INPUT_PRIMITIVE_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_BUFFER_TOO_SMALL + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_RETURN_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_GS_INPUT_PRIMITIVE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_POSITION_NOT_PRESENT = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_RETURN_TYPE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OUTPUT_STREAM_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_POSITION_NOT_PRESENT + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_BOUND_RESOURCE_MAPPED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OUTPUT_STREAM_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INVALID_PRIMITIVETOPOLOGY = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_BOUND_RESOURCE_MAPPED + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_OFFSET_UNALIGNED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INVALID_PRIMITIVETOPOLOGY + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_STRIDE_UNALIGNED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_OFFSET_UNALIGNED + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_OFFSET_UNALIGNED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_VERTEX_STRIDE_UNALIGNED + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_INDEX_OFFSET_UNALIGNED + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OUTPUT_STREAM_OFFSET_UNALIGNED + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_LD_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_SAMPLE_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_FORMAT_SAMPLE_C_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RESOURCE_MULTISAMPLE_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SO_STRIDE_LARGER_THAN_BUFFER = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SO_TARGETS_BOUND_WITHOUT_SOURCE + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_SO_STRIDE_LARGER_THAN_BUFFER + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT = ( D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_AT_FAULT + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT = ( D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_POSSIBLY_AT_FAULT + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_DEVICE_REMOVAL_PROCESS_NOT_AT_FAULT + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_INVALIDARG_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN = ( D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_OUTOFMEMORY_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET = ( D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BADINTERFACE_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D12_MESSAGE_ID_DEVICE_DRAW_VIEWPORT_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_TRAILING_DIGIT_IN_SEMANTIC + 1 ) ,
- D3D12_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW = ( D3D12_MESSAGE_ID_DEVICE_RSSETVIEWPORTS_DENORMFLUSH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS = ( D3D12_MESSAGE_ID_OMSETRENDERTARGETS_INVALIDVIEW + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_SETTEXTFILTERSIZE_INVALIDDIMENSIONS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_DRAW_SAMPLER_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_TYPE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY = ( D3D12_MESSAGE_ID_BLENDSTATE_GETDESC_LEGACY + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_SHADERRESOURCEVIEW_GETDESC_LEGACY + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_DRAW_PS_OUTPUT_TYPE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = ( D3D12_MESSAGE_ID_DEVICE_DRAW_RESOURCE_FORMAT_GATHER_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE = ( D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE = ( D3D12_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_STRIDE_TOO_LARGE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT = ( D3D12_MESSAGE_ID_DEVICE_IASETVERTEXBUFFERS_INVALIDRANGE + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_EMPTY_LAYOUT + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_OBJECT_SUMMARY = ( D3D12_MESSAGE_ID_DEVICE_DRAW_RESOURCE_SAMPLE_COUNT_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_BUFFER = ( D3D12_MESSAGE_ID_LIVE_OBJECT_SUMMARY + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_TEXTURE1D = ( D3D12_MESSAGE_ID_LIVE_BUFFER + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_TEXTURE2D = ( D3D12_MESSAGE_ID_LIVE_TEXTURE1D + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_TEXTURE3D = ( D3D12_MESSAGE_ID_LIVE_TEXTURE2D + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW = ( D3D12_MESSAGE_ID_LIVE_TEXTURE3D + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_RENDERTARGETVIEW = ( D3D12_MESSAGE_ID_LIVE_SHADERRESOURCEVIEW + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW = ( D3D12_MESSAGE_ID_LIVE_RENDERTARGETVIEW + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_VERTEXSHADER = ( D3D12_MESSAGE_ID_LIVE_DEPTHSTENCILVIEW + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_GEOMETRYSHADER = ( D3D12_MESSAGE_ID_LIVE_VERTEXSHADER + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_PIXELSHADER = ( D3D12_MESSAGE_ID_LIVE_GEOMETRYSHADER + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_INPUTLAYOUT = ( D3D12_MESSAGE_ID_LIVE_PIXELSHADER + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_SAMPLER = ( D3D12_MESSAGE_ID_LIVE_INPUTLAYOUT + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_BLENDSTATE = ( D3D12_MESSAGE_ID_LIVE_SAMPLER + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE = ( D3D12_MESSAGE_ID_LIVE_BLENDSTATE + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_RASTERIZERSTATE = ( D3D12_MESSAGE_ID_LIVE_DEPTHSTENCILSTATE + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_QUERY = ( D3D12_MESSAGE_ID_LIVE_RASTERIZERSTATE + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_PREDICATE = ( D3D12_MESSAGE_ID_LIVE_QUERY + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_COUNTER = ( D3D12_MESSAGE_ID_LIVE_PREDICATE + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_DEVICE = ( D3D12_MESSAGE_ID_LIVE_COUNTER + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_SWAPCHAIN = ( D3D12_MESSAGE_ID_LIVE_DEVICE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS = ( D3D12_MESSAGE_ID_LIVE_SWAPCHAIN + 1 ) ,
- D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILVIEW_INVALIDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATEVERTEXSHADER_INVALIDCLASSLINKAGE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADER_INVALIDCLASSLINKAGE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTREAMS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAMTORASTERIZER + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTREAMS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDCLASSLINKAGE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM = ( D3D12_MESSAGE_ID_CREATEPIXELSHADER_INVALIDCLASSLINKAGE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDSTREAM + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDENTRIES + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UNEXPECTEDSTRIDES + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL = ( D3D12_MESSAGE_ID_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_INVALIDNUMSTRIDES + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCALL + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATEHULLSHADER_OUTOFMEMORY + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE = ( D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL = ( D3D12_MESSAGE_ID_CREATEHULLSHADER_INVALIDCLASSLINKAGE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCALL + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATEDOMAINSHADER_OUTOFMEMORY + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE = ( D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDSHADERTYPE + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH = ( D3D12_MESSAGE_ID_CREATEDOMAINSHADER_INVALIDCLASSLINKAGE + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER = ( D3D12_MESSAGE_ID_DEVICE_DRAW_HS_XOR_DS_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED = ( D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_INVALID_ARG_BUFFER + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_UNALIGNED + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE = ( D3D12_MESSAGE_ID_DEVICE_DRAWINDIRECT_OFFSET_OVERFLOW + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDMAPTYPE + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS = ( D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED = ( D3D12_MESSAGE_ID_RESOURCE_MAP_INVALIDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN = ( D3D12_MESSAGE_ID_RESOURCE_MAP_ALREADYMAPPED + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_RESOURCE_MAP_DEVICEREMOVED_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD = ( D3D12_MESSAGE_ID_RESOURCE_MAP_OUTOFMEMORY_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_RESOURCE_MAP_WITHOUT_INITIAL_DISCARD + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED = ( D3D12_MESSAGE_ID_RESOURCE_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS = ( D3D12_MESSAGE_ID_RESOURCE_UNMAP_NOTMAPPED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_DRAW_RASTERIZING_CONTROL_POINTS + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_IASETPRIMITIVETOPOLOGY_TOPOLOGY_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_SIGNATURE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_DRAW_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_CONTROL_POINT_COUNT_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE = ( D3D12_MESSAGE_ID_DEVICE_DRAW_HS_DS_TESSELLATOR_DOMAIN_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE = ( D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_UNRECOGNIZED_FEATURE + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_MISMATCHED_DATA_SIZE + 1 ) ,
- D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL = ( D3D12_MESSAGE_ID_DEVICE_CHECKFEATURESUPPORT_INVALIDARG_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY = ( D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCALL + 1 ) ,
- D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE = ( D3D12_MESSAGE_ID_CREATECOMPUTESHADER_OUTOFMEMORY + 1 ) ,
- D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE = ( D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDSHADERBYTECODE + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY = ( D3D12_MESSAGE_ID_CREATECOMPUTESHADER_INVALIDCLASSLINKAGE + 1 ) ,
- D3D12_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER = ( D3D12_MESSAGE_ID_DEVICE_CSSETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D12_MESSAGE_ID_CSSETCONSTANTBUFFERS_INVALIDBUFFER + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY = ( D3D12_MESSAGE_ID_DEVICE_CSSETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY = ( D3D12_MESSAGE_ID_DEVICE_CSSETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY = ( D3D12_MESSAGE_ID_DEVICE_CSGETSHADERRESOURCES_VIEWS_EMPTY + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY = ( D3D12_MESSAGE_ID_DEVICE_CSGETCONSTANTBUFFERS_BUFFERS_EMPTY + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CSGETSAMPLERS_SAMPLERS_EMPTY + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE = ( D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEFLOATOPSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS = ( D3D12_MESSAGE_ID_CREATEBUFFER_INVALIDSTRUCTURESTRIDE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDESC + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANESLICE = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANESLICE = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANESLICE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANESLICE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDDIMENSIONS + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP = ( D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_OVERLAPPING_OLD_SLOTS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_NO_OP + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARG_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_OUTOFMEMORY_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY = ( D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_DENORMFLUSH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY = ( D3D12_MESSAGE_ID_DEVICE_CSSETUNORDEREDACCESSS_VIEWS_EMPTY + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS = ( D3D12_MESSAGE_ID_DEVICE_CSGETUNORDEREDACCESSS_VIEWS_EMPTY + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED = ( D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_INVALID_ARG_BUFFER + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_UNALIGNED + 1 ) ,
- D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY = ( D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_OFFSET_OVERFLOW + 1 ) ,
- D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY = ( D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_DEPTH_READONLY + 1 ) ,
- D3D12_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED = ( D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_STENCIL_READONLY + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_CHECKFEATURESUPPORT_FORMAT_DEPRECATED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RETURN_TYPE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_DRAW_UNORDEREDACCESSVIEW_RENDERTARGETVIEW_OVERLAP + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_DIMENSION_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_APPEND_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMICS_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_STRUCTURE_STRIDE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_BUFFER_TYPE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_RAW_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_LD_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_FORMAT_STORE_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_ADD_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_BITWISE_OPS_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_CMPSTORE_CMPEXCHANGE_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_EXCHANGE_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_SIGNED_MINMAX_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_ATOMIC_UNSIGNED_MINMAX_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW = ( D3D12_MESSAGE_ID_DEVICE_DISPATCH_BOUND_RESOURCE_MAPPED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO = ( D3D12_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_OVERFLOW + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_DISPATCH_THREADGROUPCOUNT_ZERO + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_STRUCTURE_STRIDE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_BUFFER_TYPE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_SHADERRESOURCEVIEW_RAW_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_DISPATCH_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET = ( D3D12_MESSAGE_ID_DEVICE_DISPATCHINDIRECT_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET = ( D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDOFFSET + 1 ) ,
- D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE = ( D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_LARGEOFFSET + 1 ) ,
- D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE = ( D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDDESTINATIONSTATE + 1 ) ,
- D3D12_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_COPYSTRUCTURECOUNT_INVALIDSOURCESTATE + 1 ) ,
- D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CHECKFORMATSUPPORT_FORMAT_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED = ( D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEWFLOAT_INVALIDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_PIXEL_SHADER_WITHOUT_RTV_OR_DSV = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_COUNTER_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_SHADER_ABORT = ( D3D12_MESSAGE_ID_DEVICE_DRAW_PIXEL_SHADER_WITHOUT_RTV_OR_DSV + 1 ) ,
- D3D12_MESSAGE_ID_SHADER_MESSAGE = ( D3D12_MESSAGE_ID_SHADER_ABORT + 1 ) ,
- D3D12_MESSAGE_ID_SHADER_ERROR = ( D3D12_MESSAGE_ID_SHADER_MESSAGE + 1 ) ,
- D3D12_MESSAGE_ID_OFFERRESOURCES_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_SHADER_ERROR + 1 ) ,
- D3D12_MESSAGE_ID_ENQUEUESETEVENT_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_OFFERRESOURCES_INVALIDRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_ENQUEUESETEVENT_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_ENQUEUESETEVENT_INVALIDARG_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_ENQUEUESETEVENT_ACCESSDENIED_RETURN = ( D3D12_MESSAGE_ID_ENQUEUESETEVENT_OUTOFMEMORY_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT = ( D3D12_MESSAGE_ID_ENQUEUESETEVENT_ACCESSDENIED_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_FORCED_SAMPLE_COUNT = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALIDFORCEDSAMPLECOUNT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS = ( D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_USE_OF_FORCED_SAMPLE_COUNT + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARRAYWITHDECODER = ( D3D12_MESSAGE_ID_CREATEBLENDSTATE_INVALIDLOGICOPS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARRAYWITHDECODER = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDARRAYWITHDECODER + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARRAYWITHDECODER = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDARRAYWITHDECODER + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_LOCKEDOUT_INTERFACE = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDARRAYWITHDECODER + 1 ) ,
- D3D12_MESSAGE_ID_OFFERRESOURCES_INVALIDPRIORITY = ( D3D12_MESSAGE_ID_DEVICE_LOCKEDOUT_INTERFACE + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDVIEW = ( D3D12_MESSAGE_ID_OFFERRESOURCES_INVALIDPRIORITY + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDVIEW + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_SHADEREXTENSIONSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_DOUBLEEXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_MINPRECISION = ( D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_SHADEREXTENSIONSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_SHADER_LINKAGE_MINPRECISION + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEVERTEXSHADER_UAVSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEHULLSHADER_UAVSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEDOMAINSHADER_UAVSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADER_UAVSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEGEOMETRYSHADERWITHSTREAMOUTPUT_UAVSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CREATEPIXELSHADER_UAVSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_INVALIDOFFSET = ( D3D12_MESSAGE_ID_DEVICE_CREATECOMPUTESHADER_UAVSNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_TOOMANYVIEWS = ( D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_INVALIDOFFSET + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_NOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_OMSETRENDERTARGETSANDUNORDEREDACCESSVIEWS_TOOMANYVIEWS + 1 ) ,
- D3D12_MESSAGE_ID_SWAPDEVICECONTEXTSTATE_NOTSUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_NOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_UPDATESUBRESOURCE_PREFERUPDATESUBRESOURCE1 = ( D3D12_MESSAGE_ID_SWAPDEVICECONTEXTSTATE_NOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_GETDC_INACCESSIBLE = ( D3D12_MESSAGE_ID_UPDATESUBRESOURCE_PREFERUPDATESUBRESOURCE1 + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDRECT = ( D3D12_MESSAGE_ID_GETDC_INACCESSIBLE + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_SAMPLE_MASK_IGNORED_ON_FL9 = ( D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDRECT + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE1_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_DRAW_SAMPLE_MASK_IGNORED_ON_FL9 + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BY_NAME_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE1_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_ENQUEUESETEVENT_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_DEVICE_OPEN_SHARED_RESOURCE_BY_NAME_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_OFFERRELEASE_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_ENQUEUESETEVENT_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_OFFERRESOURCES_INACCESSIBLE = ( D3D12_MESSAGE_ID_OFFERRELEASE_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMSAA = ( D3D12_MESSAGE_ID_OFFERRESOURCES_INACCESSIBLE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMSAA = ( D3D12_MESSAGE_ID_CREATEVIDEOPROCESSORINPUTVIEW_INVALIDMSAA + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT = ( D3D12_MESSAGE_ID_CREATEVIDEOPROCESSOROUTPUTVIEW_INVALIDMSAA + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT = ( D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_INVALIDSOURCERECT + 1 ) ,
- D3D12_MESSAGE_ID_UPDATESUBRESOURCE_EMPTYDESTBOX = ( D3D12_MESSAGE_ID_DEVICE_CLEARVIEW_EMPTYRECT + 1 ) ,
- D3D12_MESSAGE_ID_COPYSUBRESOURCEREGION_EMPTYSOURCEBOX = ( D3D12_MESSAGE_ID_UPDATESUBRESOURCE_EMPTYDESTBOX + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS = ( D3D12_MESSAGE_ID_COPYSUBRESOURCEREGION_EMPTYSOURCEBOX + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_DEPTHSTENCILVIEW_NOT_SET = ( D3D12_MESSAGE_ID_DEVICE_DRAW_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET = ( D3D12_MESSAGE_ID_DEVICE_DRAW_DEPTHSTENCILVIEW_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET_DUE_TO_FLIP_PRESENT = ( D3D12_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET_DUE_TO_FLIP_PRESENT = ( D3D12_MESSAGE_ID_DEVICE_DRAW_RENDERTARGETVIEW_NOT_SET_DUE_TO_FLIP_PRESENT + 1 ) ,
- D3D12_MESSAGE_ID_GETDATAFORNEWHARDWAREKEY_NULLPARAM = ( D3D12_MESSAGE_ID_DEVICE_UNORDEREDACCESSVIEW_NOT_SET_DUE_TO_FLIP_PRESENT + 1 ) ,
- D3D12_MESSAGE_ID_CHECKCRYPTOSESSIONSTATUS_NULLPARAM = ( D3D12_MESSAGE_ID_GETDATAFORNEWHARDWAREKEY_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_SETEVENTONHARDWARECONTENTPROTECTIONTILT_NULLPARAM = ( D3D12_MESSAGE_ID_CHECKCRYPTOSESSIONSTATUS_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_GETVIDEODECODERCAPS_NULLPARAM = ( D3D12_MESSAGE_ID_SETEVENTONHARDWARECONTENTPROTECTIONTILT_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_GETVIDEODECODERCAPS_ZEROWIDTHHEIGHT = ( D3D12_MESSAGE_ID_GETVIDEODECODERCAPS_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_NULLPARAM = ( D3D12_MESSAGE_ID_GETVIDEODECODERCAPS_ZEROWIDTHHEIGHT + 1 ) ,
- D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE = ( D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT = ( D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE + 1 ) ,
- D3D12_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_NULLPARAM = ( D3D12_MESSAGE_ID_CHECKVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT + 1 ) ,
- D3D12_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_UNSUPPORTED = ( D3D12_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEODECODERENABLEDOWNSAMPLING_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_UNSUPPORTED = ( D3D12_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_CHECKVIDEOPROCESSORFORMATCONVERSION_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEODECODERUPDATEDOWNSAMPLING_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE1_NULLPARAM = ( D3D12_MESSAGE_ID_CHECKVIDEOPROCESSORFORMATCONVERSION_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE1_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTCOLORSPACE1_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTCOLORSPACE1_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_INVALIDSTREAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMCOLORSPACE1_INVALIDSTREAM + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_INVALIDSTREAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_UNSUPPORTED = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_INVALIDSTREAM + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE1_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETSTREAMMIRROR_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORGETSTREAMMIRROR_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETSTREAMCOLORSPACE1_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETSTREAMMIRROR_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE = ( D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT = ( D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_INVALIDCOLORSPACE + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSHADERUSAGE_NULLPARAM = ( D3D12_MESSAGE_ID_RECOMMENDVIDEODECODERDOWNSAMPLING_ZEROWIDTHHEIGHT + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSHADERUSAGE_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORSETOUTPUTSHADERUSAGE_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_NULLPARAM = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETOUTPUTSHADERUSAGE_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSTREAMCOUNT = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_NULLPARAM + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_TARGETRECT = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSTREAMCOUNT + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSOURCERECT = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_TARGETRECT + 1 ) ,
- D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDDESTRECT = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDSOURCERECT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEBUFFER_INVALIDUSAGE = ( D3D12_MESSAGE_ID_VIDEOPROCESSORGETBEHAVIORHINTS_INVALIDDESTRECT + 1 ) ,
- D3D12_MESSAGE_ID_CREATETEXTURE1D_INVALIDUSAGE = ( D3D12_MESSAGE_ID_CREATEBUFFER_INVALIDUSAGE + 1 ) ,
- D3D12_MESSAGE_ID_CREATETEXTURE2D_INVALIDUSAGE = ( D3D12_MESSAGE_ID_CREATETEXTURE1D_INVALIDUSAGE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_STEPRATE_NOT_1 = ( D3D12_MESSAGE_ID_CREATETEXTURE2D_INVALIDUSAGE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_INSTANCING_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_STEPRATE_NOT_1 + 1 ) ,
- D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_INVALID_PARAMETER = ( D3D12_MESSAGE_ID_CREATEINPUTLAYOUT_LEVEL9_INSTANCING_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_COPYTILEMAPPINGS_INVALID_PARAMETER = ( D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_INVALID_PARAMETER + 1 ) ,
- D3D12_MESSAGE_ID_COPYTILES_INVALID_PARAMETER = ( D3D12_MESSAGE_ID_COPYTILEMAPPINGS_INVALID_PARAMETER + 1 ) ,
- D3D12_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_WARNING = ( D3D12_MESSAGE_ID_COPYTILES_INVALID_PARAMETER + 1 ) ,
- D3D12_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_ERROR = ( D3D12_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_WARNING + 1 ) ,
- D3D12_MESSAGE_ID_DIRTY_TILE_MAPPING_ACCESS = ( D3D12_MESSAGE_ID_NULL_TILE_MAPPING_ACCESS_ERROR + 1 ) ,
- D3D12_MESSAGE_ID_DUPLICATE_TILE_MAPPINGS_IN_COVERED_AREA = ( D3D12_MESSAGE_ID_DIRTY_TILE_MAPPING_ACCESS + 1 ) ,
- D3D12_MESSAGE_ID_TILE_MAPPINGS_IN_COVERED_AREA_DUPLICATED_OUTSIDE = ( D3D12_MESSAGE_ID_DUPLICATE_TILE_MAPPINGS_IN_COVERED_AREA + 1 ) ,
- D3D12_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INCOMPATIBLE_RESOURCES = ( D3D12_MESSAGE_ID_TILE_MAPPINGS_IN_COVERED_AREA_DUPLICATED_OUTSIDE + 1 ) ,
- D3D12_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INPUT_AND_OUTPUT = ( D3D12_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INCOMPATIBLE_RESOURCES + 1 ) ,
- D3D12_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_INVALIDFLAGS = ( D3D12_MESSAGE_ID_TILE_MAPPINGS_SHARED_BETWEEN_INPUT_AND_OUTPUT + 1 ) ,
- D3D12_MESSAGE_ID_GETRESOURCETILING_NONTILED_RESOURCE = ( D3D12_MESSAGE_ID_CHECKMULTISAMPLEQUALITYLEVELS_INVALIDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_NEED_TO_CALL_TILEDRESOURCEBARRIER = ( D3D12_MESSAGE_ID_GETRESOURCETILING_NONTILED_RESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEVICE_INVALIDARGS = ( D3D12_MESSAGE_ID_NEED_TO_CALL_TILEDRESOURCEBARRIER + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEVICE_WARNING = ( D3D12_MESSAGE_ID_CREATEDEVICE_INVALIDARGS + 1 ) ,
- D3D12_MESSAGE_ID_TILED_RESOURCE_TIER_1_BUFFER_TEXTURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEDEVICE_WARNING + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_CRYPTOSESSION = ( D3D12_MESSAGE_ID_TILED_RESOURCE_TIER_1_BUFFER_TEXTURE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_AUTHENTICATEDCHANNEL = ( D3D12_MESSAGE_ID_CREATE_CRYPTOSESSION + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_CRYPTOSESSION = ( D3D12_MESSAGE_ID_CREATE_AUTHENTICATEDCHANNEL + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_AUTHENTICATEDCHANNEL = ( D3D12_MESSAGE_ID_LIVE_CRYPTOSESSION + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_CRYPTOSESSION = ( D3D12_MESSAGE_ID_LIVE_AUTHENTICATEDCHANNEL + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_AUTHENTICATEDCHANNEL = ( D3D12_MESSAGE_ID_DESTROY_CRYPTOSESSION + 1 ) ,
- D3D12_MESSAGE_ID_MAP_INVALID_SUBRESOURCE = ( D3D12_MESSAGE_ID_DESTROY_AUTHENTICATEDCHANNEL + 1 ) ,
- D3D12_MESSAGE_ID_MAP_INVALID_TYPE = ( D3D12_MESSAGE_ID_MAP_INVALID_SUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_MAP_UNSUPPORTED_TYPE = ( D3D12_MESSAGE_ID_MAP_INVALID_TYPE + 1 ) ,
- D3D12_MESSAGE_ID_UNMAP_INVALID_SUBRESOURCE = ( D3D12_MESSAGE_ID_MAP_UNSUPPORTED_TYPE + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_TYPE = ( D3D12_MESSAGE_ID_UNMAP_INVALID_SUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_NULL_POINTER = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_TYPE + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SUBRESOURCE = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_NULL_POINTER + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_RESERVED_BITS = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISSING_BIND_FLAGS = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_RESERVED_BITS + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_MISC_FLAGS = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISSING_BIND_FLAGS + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_MATCHING_STATES = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_MISC_FLAGS + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINATION = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_MATCHING_STATES + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINATION + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_RESOURCE = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_BEFORE_AFTER_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_SAMPLE_COUNT = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_RESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_SAMPLE_COUNT + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINED_FLAGS = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS_FOR_FORMAT = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMBINED_FLAGS + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SPLIT_BARRIER = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAGS_FOR_FORMAT + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_END = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_SPLIT_BARRIER + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_BEGIN = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_END + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAG = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_UNMATCHED_BEGIN + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMMAND_LIST_TYPE = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_FLAG + 1 ) ,
- D3D12_MESSAGE_ID_INVALID_SUBRESOURCE_STATE = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_COMMAND_LIST_TYPE + 1 ) ,
- D3D12_MESSAGE_ID_INEFFICIENT_PRESENT = ( D3D12_MESSAGE_ID_INVALID_SUBRESOURCE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CONTENTION = ( D3D12_MESSAGE_ID_INEFFICIENT_PRESENT + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET = ( D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CONTENTION + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET_BUNDLE = ( D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CANNOT_RESET = ( D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_RESET_BUNDLE + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_OPEN = ( D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_CANNOT_RESET + 1 ) ,
- D3D12_MESSAGE_ID_QUERY_STATE_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_OPEN + 1 ) ,
- D3D12_MESSAGE_ID_INVALID_BUNDLE_API = ( D3D12_MESSAGE_ID_QUERY_STATE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED = ( D3D12_MESSAGE_ID_INVALID_BUNDLE_API + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED_WITH_INVALID_RESOURCE = ( D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED + 1 ) ,
- D3D12_MESSAGE_ID_WRONG_COMMAND_ALLOCATOR_TYPE = ( D3D12_MESSAGE_ID_COMMAND_LIST_CLOSED_WITH_INVALID_RESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_INVALID_INDIRECT_ARGUMENT_BUFFER = ( D3D12_MESSAGE_ID_WRONG_COMMAND_ALLOCATOR_TYPE + 1 ) ,
- D3D12_MESSAGE_ID_COMPUTE_AND_GRAPHICS_PIPELINE = ( D3D12_MESSAGE_ID_INVALID_INDIRECT_ARGUMENT_BUFFER + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_SYNC = ( D3D12_MESSAGE_ID_COMPUTE_AND_GRAPHICS_PIPELINE + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_SYNC = ( D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_SYNC + 1 ) ,
- D3D12_MESSAGE_ID_SET_DESCRIPTOR_HEAP_INVALID = ( D3D12_MESSAGE_ID_COMMAND_LIST_SYNC + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_QUEUE_IMAGE_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_SET_DESCRIPTOR_HEAP_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_IMAGE_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_CREATE_QUEUE_IMAGE_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_COMMANDQUEUE = ( D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_IMAGE_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_COMMANDALLOCATOR = ( D3D12_MESSAGE_ID_CREATE_COMMANDQUEUE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_PIPELINESTATE = ( D3D12_MESSAGE_ID_CREATE_COMMANDALLOCATOR + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_COMMANDLIST12 = ( D3D12_MESSAGE_ID_CREATE_PIPELINESTATE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_IMAGECOMMANDLIST = ( D3D12_MESSAGE_ID_CREATE_COMMANDLIST12 + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_RESOURCE = ( D3D12_MESSAGE_ID_CREATE_IMAGECOMMANDLIST + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_DESCRIPTORHEAP = ( D3D12_MESSAGE_ID_CREATE_RESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_ROOTSIGNATURE = ( D3D12_MESSAGE_ID_CREATE_DESCRIPTORHEAP + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_LIBRARY = ( D3D12_MESSAGE_ID_CREATE_ROOTSIGNATURE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_HEAP = ( D3D12_MESSAGE_ID_CREATE_LIBRARY + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_MONITOREDFENCE = ( D3D12_MESSAGE_ID_CREATE_HEAP + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_QUERYHEAP = ( D3D12_MESSAGE_ID_CREATE_MONITOREDFENCE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_COMMANDSIGNATURE = ( D3D12_MESSAGE_ID_CREATE_QUERYHEAP + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_COMMANDQUEUE = ( D3D12_MESSAGE_ID_CREATE_COMMANDSIGNATURE + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_COMMANDALLOCATOR = ( D3D12_MESSAGE_ID_LIVE_COMMANDQUEUE + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_PIPELINESTATE = ( D3D12_MESSAGE_ID_LIVE_COMMANDALLOCATOR + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_COMMANDLIST12 = ( D3D12_MESSAGE_ID_LIVE_PIPELINESTATE + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_IMAGECOMMANDLIST = ( D3D12_MESSAGE_ID_LIVE_COMMANDLIST12 + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_RESOURCE = ( D3D12_MESSAGE_ID_LIVE_IMAGECOMMANDLIST + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_DESCRIPTORHEAP = ( D3D12_MESSAGE_ID_LIVE_RESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_ROOTSIGNATURE = ( D3D12_MESSAGE_ID_LIVE_DESCRIPTORHEAP + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_LIBRARY = ( D3D12_MESSAGE_ID_LIVE_ROOTSIGNATURE + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_HEAP = ( D3D12_MESSAGE_ID_LIVE_LIBRARY + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_MONITOREDFENCE = ( D3D12_MESSAGE_ID_LIVE_HEAP + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_QUERYHEAP = ( D3D12_MESSAGE_ID_LIVE_MONITOREDFENCE + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_COMMANDSIGNATURE = ( D3D12_MESSAGE_ID_LIVE_QUERYHEAP + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_COMMANDQUEUE = ( D3D12_MESSAGE_ID_LIVE_COMMANDSIGNATURE + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_COMMANDALLOCATOR = ( D3D12_MESSAGE_ID_DESTROY_COMMANDQUEUE + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_PIPELINESTATE = ( D3D12_MESSAGE_ID_DESTROY_COMMANDALLOCATOR + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_COMMANDLIST12 = ( D3D12_MESSAGE_ID_DESTROY_PIPELINESTATE + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_IMAGECOMMANDLIST = ( D3D12_MESSAGE_ID_DESTROY_COMMANDLIST12 + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_RESOURCE = ( D3D12_MESSAGE_ID_DESTROY_IMAGECOMMANDLIST + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_DESCRIPTORHEAP = ( D3D12_MESSAGE_ID_DESTROY_RESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_ROOTSIGNATURE = ( D3D12_MESSAGE_ID_DESTROY_DESCRIPTORHEAP + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_LIBRARY = ( D3D12_MESSAGE_ID_DESTROY_ROOTSIGNATURE + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_HEAP = ( D3D12_MESSAGE_ID_DESTROY_LIBRARY + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_MONITOREDFENCE = ( D3D12_MESSAGE_ID_DESTROY_HEAP + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_QUERYHEAP = ( D3D12_MESSAGE_ID_DESTROY_MONITOREDFENCE + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_COMMANDSIGNATURE = ( D3D12_MESSAGE_ID_DESTROY_QUERYHEAP + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDHEAPTYPE = ( D3D12_MESSAGE_ID_DESTROY_COMMANDSIGNATURE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONS = ( D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDHEAPTYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDMISCFLAGS = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONS + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMISCFLAGS = ( D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDMISCFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_LARGEALLOCATION = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMISCFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_SMALLALLOCATION = ( D3D12_MESSAGE_ID_CREATERESOURCE_LARGEALLOCATION + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_CREATERESOURCE_SMALLALLOCATION + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDARG_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDESC = ( D3D12_MESSAGE_ID_CREATERESOURCE_OUTOFMEMORY_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDINITIALSTATE = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDESC + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_HAS_PENDING_INITIAL_DATA = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDINITIALSTATE + 1 ) ,
- D3D12_MESSAGE_ID_POSSIBLY_INVALID_SUBRESOURCE_STATE = ( D3D12_MESSAGE_ID_RESOURCE_HAS_PENDING_INITIAL_DATA + 1 ) ,
- D3D12_MESSAGE_ID_INVALID_USE_OF_NON_RESIDENT_RESOURCE = ( D3D12_MESSAGE_ID_POSSIBLY_INVALID_SUBRESOURCE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_POSSIBLE_INVALID_USE_OF_NON_RESIDENT_RESOURCE = ( D3D12_MESSAGE_ID_INVALID_USE_OF_NON_RESIDENT_RESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_BUNDLE_PIPELINE_STATE_MISMATCH = ( D3D12_MESSAGE_ID_POSSIBLE_INVALID_USE_OF_NON_RESIDENT_RESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_MISMATCH_PIPELINE_STATE = ( D3D12_MESSAGE_ID_BUNDLE_PIPELINE_STATE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_RENDER_TARGET_NUMBER_MISMATCH_PIPELINE_STATE = ( D3D12_MESSAGE_ID_PRIMITIVE_TOPOLOGY_MISMATCH_PIPELINE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_PIPELINE_STATE = ( D3D12_MESSAGE_ID_RENDER_TARGET_NUMBER_MISMATCH_PIPELINE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = ( D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_PIPELINE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_PIPELINE_STATE = ( D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_PIPELINE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_PIPELINE_STATE = ( D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_PIPELINE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_RENDER_TARGET_NUMBER_MISMATCH_BUNDLE_PIPELINE_STATE = ( D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_PIPELINE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_BUNDLE_PIPELINE_STATE = ( D3D12_MESSAGE_ID_RENDER_TARGET_NUMBER_MISMATCH_BUNDLE_PIPELINE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_BUNDLE_PIPELINE_STATE = ( D3D12_MESSAGE_ID_RENDER_TARGET_FORMAT_MISMATCH_BUNDLE_PIPELINE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_BUNDLE_PIPELINE_STATE = ( D3D12_MESSAGE_ID_RENDER_TARGET_SAMPLE_DESC_MISMATCH_BUNDLE_PIPELINE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_BUNDLE_PIPELINE_STATE = ( D3D12_MESSAGE_ID_DEPTH_STENCIL_FORMAT_MISMATCH_BUNDLE_PIPELINE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADER_INVALIDBYTECODE = ( D3D12_MESSAGE_ID_DEPTH_STENCIL_SAMPLE_DESC_MISMATCH_BUNDLE_PIPELINE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHEAP_NULLDESC = ( D3D12_MESSAGE_ID_CREATESHADER_INVALIDBYTECODE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHEAP_INVALIDSIZE = ( D3D12_MESSAGE_ID_CREATEHEAP_NULLDESC + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDHEAPTYPE = ( D3D12_MESSAGE_ID_CREATEHEAP_INVALIDSIZE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = ( D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDHEAPTYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMEMORYPOOL = ( D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHEAP_INVALIDPROPERTIES = ( D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMEMORYPOOL + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHEAP_INVALIDALIGNMENT = ( D3D12_MESSAGE_ID_CREATEHEAP_INVALIDPROPERTIES + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMISCFLAGS = ( D3D12_MESSAGE_ID_CREATEHEAP_INVALIDALIGNMENT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHEAP_INVALIDMISCFLAGS = ( D3D12_MESSAGE_ID_CREATEHEAP_UNRECOGNIZEDMISCFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHEAP_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_CREATEHEAP_INVALIDMISCFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEHEAP_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATEHEAP_INVALIDARG_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAPPROPERTIES = ( D3D12_MESSAGE_ID_CREATEHEAP_OUTOFMEMORY_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPTYPE = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAPPROPERTIES + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPTYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDMEMORYPOOL = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDCPUPAGEPROPERTIES + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPPROPERTIES = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDMEMORYPOOL + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPMISCFLAGS = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPPROPERTIES + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPMISCFLAGS = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_UNRECOGNIZEDHEAPMISCFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDHEAPMISCFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_INVALIDARG_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_UNRECOGNIZEDHEAPTYPE = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_OUTOFMEMORY_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_INVALIDHEAPTYPE = ( D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_UNRECOGNIZEDHEAPTYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_INVALID_DESC = ( D3D12_MESSAGE_ID_GETCUSTOMHEAPPROPERTIES_INVALIDHEAPTYPE + 1 ) ,
- D3D12_MESSAGE_ID_INVALID_DESCRIPTOR_HANDLE = ( D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_INVALID_DESC + 1 ) ,
- D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_CONSERVATIVERASTERMODE = ( D3D12_MESSAGE_ID_INVALID_DESCRIPTOR_HANDLE + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_SYSTEMVALUE = ( D3D12_MESSAGE_ID_CREATERASTERIZERSTATE_INVALID_CONSERVATIVERASTERMODE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_RESOURCE = ( D3D12_MESSAGE_ID_DEVICE_DRAW_INVALID_SYSTEMVALUE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_DESC = ( D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_RESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_LARGE_OFFSET = ( D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_INVALID_DESC + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_UNORDEREDACCESS_VIEW_INVALID_COUNTER_USAGE = ( D3D12_MESSAGE_ID_CREATE_CONSTANT_BUFFER_VIEW_LARGE_OFFSET + 1 ) ,
- D3D12_MESSAGE_ID_COPY_DESCRIPTORS_INVALID_RANGES = ( D3D12_MESSAGE_ID_CREATE_UNORDEREDACCESS_VIEW_INVALID_COUNTER_USAGE + 1 ) ,
- D3D12_MESSAGE_ID_COPY_DESCRIPTORS_WRITE_ONLY_DESCRIPTOR = ( D3D12_MESSAGE_ID_COPY_DESCRIPTORS_INVALID_RANGES + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RTV_FORMAT_NOT_UNKNOWN = ( D3D12_MESSAGE_ID_COPY_DESCRIPTORS_WRITE_ONLY_DESCRIPTOR + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_RENDER_TARGET_COUNT = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RTV_FORMAT_NOT_UNKNOWN + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VERTEX_SHADER_NOT_SET = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_RENDER_TARGET_COUNT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INPUTLAYOUT_NOT_SET = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VERTEX_SHADER_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_HS_DS_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INPUTLAYOUT_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERINDEX = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_HS_DS_SIGNATURE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_COMPONENTTYPE = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERINDEX + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERMASK = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_COMPONENTTYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SYSTEMVALUE = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_REGISTERMASK + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SYSTEMVALUE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_MINPRECISION = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_NEVERWRITTEN_ALWAYSREADS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_MINPRECISION + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_XOR_DS_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_LINKAGE_SEMANTICNAME_NOT_FOUND + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_XOR_DS_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_CONTROL_POINT_COUNT_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HULL_SHADER_INPUT_TOPOLOGY_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_TESSELLATOR_DOMAIN_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_CONTROL_POINT_COUNT_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_DS_TESSELLATOR_DOMAIN_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_FORCED_SAMPLE_COUNT = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_CENTER_MULTISAMPLE_PATTERN + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_PRIMITIVETOPOLOGY = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_USE_OF_FORCED_SAMPLE_COUNT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SYSTEMVALUE = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_PRIMITIVETOPOLOGY + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SYSTEMVALUE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_DUAL_SOURCE_BLENDING_CAN_ONLY_HAVE_RENDER_TARGET_0 + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_BLENDING + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_TYPE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RENDERTARGETVIEW_NOT_SET = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DEPTHSTENCILVIEW_NOT_SET = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RENDERTARGETVIEW_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_INPUT_PRIMITIVE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DEPTHSTENCILVIEW_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_POSITION_NOT_PRESENT = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_INPUT_PRIMITIVE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE_FLAGS = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_POSITION_NOT_PRESENT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_INDEX_BUFFER_PROPERTIES = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE_FLAGS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SAMPLE_DESC = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_INDEX_BUFFER_PROPERTIES + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_INVALID_SAMPLE_DESC + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DS_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_HS_ROOT_SIGNATURE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VS_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_DS_ROOT_SIGNATURE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VS_ROOT_SIGNATURE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_GS_ROOT_SIGNATURE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_ROOT_SIGNATURE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_EXECUTE_BUNDLE_OPEN_BUNDLE = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_MISSING_ROOT_SIGNATURE + 1 ) ,
- D3D12_MESSAGE_ID_EXECUTE_BUNDLE_DESCRIPTOR_HEAP_MISMATCH = ( D3D12_MESSAGE_ID_EXECUTE_BUNDLE_OPEN_BUNDLE + 1 ) ,
- D3D12_MESSAGE_ID_EXECUTE_BUNDLE_TYPE = ( D3D12_MESSAGE_ID_EXECUTE_BUNDLE_DESCRIPTOR_HEAP_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_DRAW_EMPTY_SCISSOR_RECTANGLE = ( D3D12_MESSAGE_ID_EXECUTE_BUNDLE_TYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_BLOB_NOT_FOUND = ( D3D12_MESSAGE_ID_DRAW_EMPTY_SCISSOR_RECTANGLE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_DESERIALIZE_FAILED = ( D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_BLOB_NOT_FOUND + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_INVALID_CONFIGURATION = ( D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_DESERIALIZE_FAILED + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_SUPPORTED_ON_DEVICE = ( D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_INVALID_CONFIGURATION + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLRESOURCEPROPERTIES = ( D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_SUPPORTED_ON_DEVICE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAP = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLRESOURCEPROPERTIES + 1 ) ,
- D3D12_MESSAGE_ID_GETRESOURCEALLOCATIONINFO_INVALIDRDESCS = ( D3D12_MESSAGE_ID_CREATERESOURCEANDHEAP_NULLHEAP + 1 ) ,
- D3D12_MESSAGE_ID_MAKERESIDENT_NULLOBJECTARRAY = ( D3D12_MESSAGE_ID_GETRESOURCEALLOCATIONINFO_INVALIDRDESCS + 1 ) ,
- D3D12_MESSAGE_ID_MAKERESIDENT_INVALIDOBJECT = ( D3D12_MESSAGE_ID_MAKERESIDENT_NULLOBJECTARRAY + 1 ) ,
- D3D12_MESSAGE_ID_EVICT_NULLOBJECTARRAY = ( D3D12_MESSAGE_ID_MAKERESIDENT_INVALIDOBJECT + 1 ) ,
- D3D12_MESSAGE_ID_EVICT_INVALIDOBJECT = ( D3D12_MESSAGE_ID_EVICT_NULLOBJECTARRAY + 1 ) ,
- D3D12_MESSAGE_ID_HEAPS_UNSUPPORTED = ( D3D12_MESSAGE_ID_EVICT_INVALIDOBJECT + 1 ) ,
- D3D12_MESSAGE_ID_SET_DESCRIPTOR_TABLE_INVALID = ( D3D12_MESSAGE_ID_HEAPS_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_INVALID = ( D3D12_MESSAGE_ID_SET_DESCRIPTOR_TABLE_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_BUFFER_VIEW_INVALID = ( D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_SET_ROOT_SHADER_RESOURCE_VIEW_INVALID = ( D3D12_MESSAGE_ID_SET_ROOT_CONSTANT_BUFFER_VIEW_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_SET_ROOT_UNORDERED_ACCESS_VIEW_INVALID = ( D3D12_MESSAGE_ID_SET_ROOT_SHADER_RESOURCE_VIEW_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID_DESC = ( D3D12_MESSAGE_ID_SET_ROOT_UNORDERED_ACCESS_VIEW_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_LARGE_OFFSET = ( D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID_DESC + 1 ) ,
- D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID_DESC = ( D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_LARGE_OFFSET + 1 ) ,
- D3D12_MESSAGE_ID_SET_INDEX_BUFFER_LARGE_OFFSET = ( D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID_DESC + 1 ) ,
- D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID_DESC = ( D3D12_MESSAGE_ID_SET_INDEX_BUFFER_LARGE_OFFSET + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDDIMENSIONALITY = ( D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID_DESC + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDLAYOUT = ( D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDDIMENSIONALITY + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONALITY = ( D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDLAYOUT + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDALIGNMENT = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDDIMENSIONALITY + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMIPLEVELS = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDALIGNMENT + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDSAMPLEDESC = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDMIPLEVELS + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDLAYOUT = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDSAMPLEDESC + 1 ) ,
- D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDLAYOUT + 1 ) ,
- D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID = ( D3D12_MESSAGE_ID_SET_INDEX_BUFFER_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID = ( D3D12_MESSAGE_ID_SET_VERTEX_BUFFERS_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_SET_RENDER_TARGETS_INVALID = ( D3D12_MESSAGE_ID_SET_STREAM_OUTPUT_BUFFERS_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_CREATEQUERY_HEAP_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_SET_RENDER_TARGETS_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_CREATEQUERY_HEAP_JPEG_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_CREATEQUERY_HEAP_INVALID_PARAMETERS + 1 ) ,
- D3D12_MESSAGE_ID_BEGIN_END_QUERY_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_CREATEQUERY_HEAP_JPEG_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_CLOSE_COMMAND_LIST_OPEN_QUERY = ( D3D12_MESSAGE_ID_BEGIN_END_QUERY_INVALID_PARAMETERS + 1 ) ,
- D3D12_MESSAGE_ID_RESOLVE_QUERY_DATA_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_CLOSE_COMMAND_LIST_OPEN_QUERY + 1 ) ,
- D3D12_MESSAGE_ID_SET_PREDICATION_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_RESOLVE_QUERY_DATA_INVALID_PARAMETERS + 1 ) ,
- D3D12_MESSAGE_ID_TIMESTAMPS_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_SET_PREDICATION_INVALID_PARAMETERS + 1 ) ,
- D3D12_MESSAGE_ID_UNSTABLE_POWER_STATE = ( D3D12_MESSAGE_ID_TIMESTAMPS_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDFORMAT = ( D3D12_MESSAGE_ID_UNSTABLE_POWER_STATE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDSUBRESOURCERANGE = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDBASEOFFSET = ( D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDSUBRESOURCERANGE + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_HEAP = ( D3D12_MESSAGE_ID_GETCOPYABLELAYOUT_INVALIDBASEOFFSET + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_SAMPLER_INVALID = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_INVALID_HEAP + 1 ) ,
- D3D12_MESSAGE_ID_CREATECOMMANDSIGNATURE_INVALID = ( D3D12_MESSAGE_ID_CREATE_SAMPLER_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_EXECUTE_INDIRECT_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_CREATECOMMANDSIGNATURE_INVALID + 1 ) ,
- D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_RESOURCE_DIMENSION = ( D3D12_MESSAGE_ID_EXECUTE_INDIRECT_INVALID_PARAMETERS + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANEINDEX = ( D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_RESOURCE_DIMENSION + 4 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDPLANEINDEX + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_AMBIGUOUSVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_INVALIDVIDEOPLANEINDEX + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANEINDEX = ( D3D12_MESSAGE_ID_CREATESHADERRESOURCEVIEW_AMBIGUOUSVIDEOPLANEINDEX + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDPLANEINDEX + 1 ) ,
- D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_AMBIGUOUSVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_INVALIDVIDEOPLANEINDEX + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANEINDEX = ( D3D12_MESSAGE_ID_CREATERENDERTARGETVIEW_AMBIGUOUSVIDEOPLANEINDEX + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDPLANEINDEX + 1 ) ,
- D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_AMBIGUOUSVIDEOPLANEINDEX = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_INVALIDVIDEOPLANEINDEX + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSCANDATAOFFSET = ( D3D12_MESSAGE_ID_CREATEUNORDEREDACCESSVIEW_AMBIGUOUSVIDEOPLANEINDEX + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_NOTSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSCANDATAOFFSET + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_DIMENSIONSTOOLARGE = ( D3D12_MESSAGE_ID_JPEGDECODE_NOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_INVALIDCOMPONENTS = ( D3D12_MESSAGE_ID_JPEGDECODE_DIMENSIONSTOOLARGE + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDCOMPONENTS = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDCOMPONENTS + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_DESTINATIONNOT2D = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDCOMPONENTS + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_TILEDRESOURCESUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_DESTINATIONNOT2D + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_GUARDRECTSUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_TILEDRESOURCESUNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_FORMATUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_GUARDRECTSUNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_JPEGDECODE_FORMATUNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_INVALIDMIPLEVEL = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_EMPTYDESTBOX = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDMIPLEVEL + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXNOT2D = ( D3D12_MESSAGE_ID_JPEGDECODE_EMPTYDESTBOX + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXNOTSUB = ( D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXNOT2D + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXESINTERSECT = ( D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXNOTSUB + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEMISMATCH = ( D3D12_MESSAGE_ID_JPEGDECODE_DESTBOXESINTERSECT + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEMISMATCH = ( D3D12_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEODD = ( D3D12_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEODD = ( D3D12_MESSAGE_ID_JPEGDECODE_XSUBSAMPLEODD + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_UPSCALEUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_YSUBSAMPLEODD + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_TIER4DOWNSCALETOLARGE = ( D3D12_MESSAGE_ID_JPEGDECODE_UPSCALEUNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_TIER3DOWNSCALEUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_TIER4DOWNSCALETOLARGE + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_CHROMASIZEMISMATCH = ( D3D12_MESSAGE_ID_JPEGDECODE_TIER3DOWNSCALEUNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_LUMACHROMASIZEMISMATCH = ( D3D12_MESSAGE_ID_JPEGDECODE_CHROMASIZEMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_INVALIDNUMDESTINATIONS = ( D3D12_MESSAGE_ID_JPEGDECODE_LUMACHROMASIZEMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_SUBBOXUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDNUMDESTINATIONS + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_1DESTUNSUPPORTEDFORMAT = ( D3D12_MESSAGE_ID_JPEGDECODE_SUBBOXUNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_3DESTUNSUPPORTEDFORMAT = ( D3D12_MESSAGE_ID_JPEGDECODE_1DESTUNSUPPORTEDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_SCALEUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_3DESTUNSUPPORTEDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSOURCESIZE = ( D3D12_MESSAGE_ID_JPEGDECODE_SCALEUNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_INVALIDCOPYFLAGS = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDSOURCESIZE + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_HAZARD = ( D3D12_MESSAGE_ID_JPEGDECODE_INVALIDCOPYFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERUSAGE = ( D3D12_MESSAGE_ID_JPEGDECODE_HAZARD + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERMISCFLAGS = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERUSAGE + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDDSTTEXTUREUSAGE = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDSRCBUFFERMISCFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_BACKBUFFERNOTSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDDSTTEXTUREUSAGE + 1 ) ,
- D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDCOPYFLAGS = ( D3D12_MESSAGE_ID_JPEGDECODE_BACKBUFFERNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_NOTSUPPORTED = ( D3D12_MESSAGE_ID_JPEGDECODE_UNSUPPORTEDCOPYFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_INVALIDSCANDATAOFFSET = ( D3D12_MESSAGE_ID_JPEGENCODE_NOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_INVALIDCOMPONENTS = ( D3D12_MESSAGE_ID_JPEGENCODE_INVALIDSCANDATAOFFSET + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_SOURCENOT2D = ( D3D12_MESSAGE_ID_JPEGENCODE_INVALIDCOMPONENTS + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_TILEDRESOURCESUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGENCODE_SOURCENOT2D + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_GUARDRECTSUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGENCODE_TILEDRESOURCESUNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_XSUBSAMPLEMISMATCH = ( D3D12_MESSAGE_ID_JPEGENCODE_GUARDRECTSUNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_YSUBSAMPLEMISMATCH = ( D3D12_MESSAGE_ID_JPEGENCODE_XSUBSAMPLEMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDCOMPONENTS = ( D3D12_MESSAGE_ID_JPEGENCODE_YSUBSAMPLEMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_FORMATUNSUPPORTED = ( D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDCOMPONENTS + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_JPEGENCODE_FORMATUNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_INVALIDMIPLEVEL = ( D3D12_MESSAGE_ID_JPEGENCODE_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_DIMENSIONSTOOLARGE = ( D3D12_MESSAGE_ID_JPEGENCODE_INVALIDMIPLEVEL + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_HAZARD = ( D3D12_MESSAGE_ID_JPEGENCODE_DIMENSIONSTOOLARGE + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERUSAGE = ( D3D12_MESSAGE_ID_JPEGENCODE_HAZARD + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERMISCFLAGS = ( D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERUSAGE + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDSRCTEXTUREUSAGE = ( D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDDSTBUFFERMISCFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_JPEGENCODE_BACKBUFFERNOTSUPPORTED = ( D3D12_MESSAGE_ID_JPEGENCODE_UNSUPPORTEDSRCTEXTUREUSAGE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_UNSUPPORTEDCONTEXTTYPEFORQUERY = ( D3D12_MESSAGE_ID_JPEGENCODE_BACKBUFFERNOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_FLUSH1_INVALIDCONTEXTTYPE = ( D3D12_MESSAGE_ID_CREATEQUERYORPREDICATE_UNSUPPORTEDCONTEXTTYPEFORQUERY + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUE = ( D3D12_MESSAGE_ID_FLUSH1_INVALIDCONTEXTTYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDCLEARVALUEFORMAT = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUE + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUEFORMAT = ( D3D12_MESSAGE_ID_CREATERESOURCE_UNRECOGNIZEDCLEARVALUEFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_CREATERESOURCE_CLEARVALUEDENORMFLUSH = ( D3D12_MESSAGE_ID_CREATERESOURCE_INVALIDCLEARVALUEFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALIDDEPTH = ( D3D12_MESSAGE_ID_CREATERESOURCE_CLEARVALUEDENORMFLUSH + 1 ) ,
- D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_MISMATCHINGCLEARVALUE = ( D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_INVALIDDEPTH + 1 ) ,
- D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_MISMATCHINGCLEARVALUE = ( D3D12_MESSAGE_ID_CLEARRENDERTARGETVIEW_MISMATCHINGCLEARVALUE + 1 ) ,
- D3D12_MESSAGE_ID_MAP_INVALIDHEAP = ( D3D12_MESSAGE_ID_CLEARDEPTHSTENCILVIEW_MISMATCHINGCLEARVALUE + 1 ) ,
- D3D12_MESSAGE_ID_UNMAP_INVALIDHEAP = ( D3D12_MESSAGE_ID_MAP_INVALIDHEAP + 1 ) ,
- D3D12_MESSAGE_ID_MAP_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_UNMAP_INVALIDHEAP + 1 ) ,
- D3D12_MESSAGE_ID_UNMAP_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_MAP_INVALIDRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_MAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_UNMAP_INVALIDRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_UNMAP_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_MAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_MAP_INVALIDRANGE = ( D3D12_MESSAGE_ID_UNMAP_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_UNMAP_INVALIDRANGE = ( D3D12_MESSAGE_ID_MAP_INVALIDRANGE + 1 ) ,
- D3D12_MESSAGE_ID_MAP_NULLRANGE = ( D3D12_MESSAGE_ID_UNMAP_INVALIDRANGE + 1 ) ,
- D3D12_MESSAGE_ID_UNMAP_NULLRANGE = ( D3D12_MESSAGE_ID_MAP_NULLRANGE + 1 ) ,
- D3D12_MESSAGE_ID_MAP_INVALIDDATAPOINTER = ( D3D12_MESSAGE_ID_UNMAP_NULLRANGE + 1 ) ,
- D3D12_MESSAGE_ID_MAP_INVALIDARG_RETURN = ( D3D12_MESSAGE_ID_MAP_INVALIDDATAPOINTER + 1 ) ,
- D3D12_MESSAGE_ID_MAP_OUTOFMEMORY_RETURN = ( D3D12_MESSAGE_ID_MAP_INVALIDARG_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_BUNDLENOTSUPPORTED = ( D3D12_MESSAGE_ID_MAP_OUTOFMEMORY_RETURN + 1 ) ,
- D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_COMMANDLISTMISMATCH = ( D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_BUNDLENOTSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_OPENCOMMANDLIST = ( D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_COMMANDLISTMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_FAILEDCOMMANDLIST = ( D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_OPENCOMMANDLIST + 1 ) ,
- D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLDST = ( D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_FAILEDCOMMANDLIST + 1 ) ,
- D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDDSTRESOURCEDIMENSION = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLDST + 1 ) ,
- D3D12_MESSAGE_ID_COPYBUFFERREGION_DSTRANGEOUTOFBOUNDS = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDDSTRESOURCEDIMENSION + 1 ) ,
- D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLSRC = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_DSTRANGEOUTOFBOUNDS + 1 ) ,
- D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDSRCRESOURCEDIMENSION = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_NULLSRC + 1 ) ,
- D3D12_MESSAGE_ID_COPYBUFFERREGION_SRCRANGEOUTOFBOUNDS = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDSRCRESOURCEDIMENSION + 1 ) ,
- D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDCOPYFLAGS = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_SRCRANGEOUTOFBOUNDS + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLDST = ( D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALIDCOPYFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTTYPE = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLDST + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCEDIMENSION = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTTYPE + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCE = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCEDIMENSION + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTSUBRESOURCE = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTOFFSET = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTFORMAT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTOFFSET + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTFORMAT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDDSTFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDIMENSIONS = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTROWPITCH = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDIMENSIONS + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTPLACEMENT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTROWPITCH + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDSPLACEDFOOTPRINTFORMAT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTPLACEMENT + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_DSTREGIONOUTOFBOUNDS = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTDSPLACEDFOOTPRINTFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLSRC = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_DSTREGIONOUTOFBOUNDS + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCTYPE = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_NULLSRC + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCEDIMENSION = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCTYPE + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCE = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCEDIMENSION + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCSUBRESOURCE = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCOFFSET = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCFORMAT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCOFFSET + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCFORMAT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_UNRECOGNIZEDSRCFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDIMENSIONS = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCROWPITCH = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDIMENSIONS + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCPLACEMENT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCROWPITCH + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDSPLACEDFOOTPRINTFORMAT = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCPLACEMENT + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_SRCREGIONOUTOFBOUNDS = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCDSPLACEDFOOTPRINTFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTCOORDINATES = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_SRCREGIONOUTOFBOUNDS + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCBOX = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDDSTCOORDINATES + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_FORMATMISMATCH = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDSRCBOX + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_EMPTYBOX = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_FORMATMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDCOPYFLAGS = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_EMPTYBOX + 1 ) ,
- D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SUBRESOURCE_INDEX = ( D3D12_MESSAGE_ID_COPYTEXTUREREGION_INVALIDCOPYFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_FORMAT = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SUBRESOURCE_INDEX + 1 ) ,
- D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_MISMATCH = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_FORMAT + 1 ) ,
- D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SAMPLE_COUNT = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_INVALID_SHADER = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALID_SAMPLE_COUNT + 1 ) ,
- D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_CS_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_INVALID_SHADER + 1 ) ,
- D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_MISSING_ROOT_SIGNATURE = ( D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_CS_ROOT_SIGNATURE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALIDCACHEDBLOB = ( D3D12_MESSAGE_ID_CREATECOMPUTEPIPELINESTATE_MISSING_ROOT_SIGNATURE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBADAPTERMISMATCH = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALIDCACHEDBLOB + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDRIVERVERSIONMISMATCH = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBADAPTERMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDESCMISMATCH = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDRIVERVERSIONMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBIGNORED = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBDESCMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDHEAP = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CACHEDBLOBIGNORED + 1 ) ,
- D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDHEAP + 1 ) ,
- D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDBOX = ( D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDBOX + 1 ) ,
- D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_EMPTYBOX = ( D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDHEAP = ( D3D12_MESSAGE_ID_WRITETOSUBRESOURCE_EMPTYBOX + 1 ) ,
- D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDHEAP + 1 ) ,
- D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDBOX = ( D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDSUBRESOURCE = ( D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDBOX + 1 ) ,
- D3D12_MESSAGE_ID_READFROMSUBRESOURCE_EMPTYBOX = ( D3D12_MESSAGE_ID_READFROMSUBRESOURCE_INVALIDSUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_TOO_MANY_NODES_SPECIFIED = ( D3D12_MESSAGE_ID_READFROMSUBRESOURCE_EMPTYBOX + 1 ) ,
- D3D12_MESSAGE_ID_INVALID_NODE_INDEX = ( D3D12_MESSAGE_ID_TOO_MANY_NODES_SPECIFIED + 1 ) ,
- D3D12_MESSAGE_ID_GETHEAPPROPERTIES_INVALIDRESOURCE = ( D3D12_MESSAGE_ID_INVALID_NODE_INDEX + 1 ) ,
- D3D12_MESSAGE_ID_NODE_MASK_MISMATCH = ( D3D12_MESSAGE_ID_GETHEAPPROPERTIES_INVALIDRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_OUTOFMEMORY = ( D3D12_MESSAGE_ID_NODE_MASK_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_MULTIPLE_SWAPCHAIN_BUFFER_REFERENCES = ( D3D12_MESSAGE_ID_COMMAND_LIST_OUTOFMEMORY + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_TOO_MANY_SWAPCHAIN_REFERENCES = ( D3D12_MESSAGE_ID_COMMAND_LIST_MULTIPLE_SWAPCHAIN_BUFFER_REFERENCES + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_QUEUE_TOO_MANY_SWAPCHAIN_REFERENCES = ( D3D12_MESSAGE_ID_COMMAND_LIST_TOO_MANY_SWAPCHAIN_REFERENCES + 1 ) ,
- D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_WRONGSWAPCHAINBUFFERREFERENCE = ( D3D12_MESSAGE_ID_COMMAND_QUEUE_TOO_MANY_SWAPCHAIN_REFERENCES + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_SETRENDERTARGETS_INVALIDNUMRENDERTARGETS = ( D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_WRONGSWAPCHAINBUFFERREFERENCE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_TYPE = ( D3D12_MESSAGE_ID_COMMAND_LIST_SETRENDERTARGETS_INVALIDNUMRENDERTARGETS + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_FLAGS = ( D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_TYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFLAGS = ( D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_FLAGS + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFORMAT = ( D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_CREATESHAREDHEAP_INVALIDFLAGS = ( D3D12_MESSAGE_ID_CREATESHAREDRESOURCE_INVALIDFORMAT + 1 ) ,
- D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_UNRECOGNIZEDPROPERTIES = ( D3D12_MESSAGE_ID_CREATESHAREDHEAP_INVALIDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDSIZE = ( D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_UNRECOGNIZEDPROPERTIES + 1 ) ,
- D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDOBJECT = ( D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDSIZE + 1 ) ,
- D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDOBJECT = ( D3D12_MESSAGE_ID_REFLECTSHAREDPROPERTIES_INVALIDOBJECT + 1 ) ,
- D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDKEY = ( D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDOBJECT + 1 ) ,
- D3D12_MESSAGE_ID_KEYEDMUTEX_WRONGSTATE = ( D3D12_MESSAGE_ID_KEYEDMUTEX_INVALIDKEY + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_PRIORITY = ( D3D12_MESSAGE_ID_KEYEDMUTEX_WRONGSTATE + 1 ) ,
- D3D12_MESSAGE_ID_OBJECT_DELETED_WHILE_STILL_IN_USE = ( D3D12_MESSAGE_ID_CREATE_QUEUE_INVALID_PRIORITY + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_FLAGS = ( D3D12_MESSAGE_ID_OBJECT_DELETED_WHILE_STILL_IN_USE + 1 ) ,
- D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_HAS_NO_RESOURCE = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_FLAGS + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RENDER_TARGET_DELETED = ( D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_HAS_NO_RESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_ALL_RENDER_TARGETS_HAVE_UNKNOWN_FORMAT = ( D3D12_MESSAGE_ID_COMMAND_LIST_DRAW_RENDER_TARGET_DELETED + 1 ) ,
- D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_INTERSECTS_MULTIPLE_BUFFERS = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_ALL_RENDER_TARGETS_HAVE_UNKNOWN_FORMAT + 1 ) ,
- D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_GPU_WRITTEN_READBACK_RESOURCE_MAPPED = ( D3D12_MESSAGE_ID_HEAP_ADDRESS_RANGE_INTERSECTS_MULTIPLE_BUFFERS + 1 ) ,
- D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_NEEDED = ( D3D12_MESSAGE_ID_EXECUTECOMMANDLISTS_GPU_WRITTEN_READBACK_RESOURCE_MAPPED + 1 ) ,
- D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_EMPTY = ( D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_NEEDED + 1 ) ,
- D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE = ( D3D12_MESSAGE_ID_UNMAP_RANGE_NOT_EMPTY + 1 ) ,
- D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE = ( D3D12_MESSAGE_ID_MAP_INVALID_NULLRANGE + 1 ) ,
- D3D12_MESSAGE_ID_NO_GRAPHICS_API_SUPPORT = ( D3D12_MESSAGE_ID_UNMAP_INVALID_NULLRANGE + 1 ) ,
- D3D12_MESSAGE_ID_NO_COMPUTE_API_SUPPORT = ( D3D12_MESSAGE_ID_NO_GRAPHICS_API_SUPPORT + 1 ) ,
- D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_FLAGS_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_NO_COMPUTE_API_SUPPORT + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_ARGUMENT_UNINITIALIZED = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_RESOURCE_FLAGS_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_HEAP_INDEX_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_ARGUMENT_UNINITIALIZED + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TABLE_REGISTER_INDEX_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_HEAP_INDEX_OUT_OF_BOUNDS + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_UNINITIALIZED = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TABLE_REGISTER_INDEX_OUT_OF_BOUNDS + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_UNINITIALIZED + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SRV_RESOURCE_DIMENSION_MISMATCH = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_DESCRIPTOR_TYPE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UAV_RESOURCE_DIMENSION_MISMATCH = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SRV_RESOURCE_DIMENSION_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UAV_RESOURCE_DIMENSION_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_COPYRESOURCE_NULLDST = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INCOMPATIBLE_RESOURCE_STATE + 1 ) ,
- D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDSTRESOURCE = ( D3D12_MESSAGE_ID_COPYRESOURCE_NULLDST + 1 ) ,
- D3D12_MESSAGE_ID_COPYRESOURCE_NULLSRC = ( D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDDSTRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSRCRESOURCE = ( D3D12_MESSAGE_ID_COPYRESOURCE_NULLSRC + 1 ) ,
- D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLDST = ( D3D12_MESSAGE_ID_COPYRESOURCE_INVALIDSRCRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDDSTRESOURCE = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLDST + 1 ) ,
- D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLSRC = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDDSTRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDSRCRESOURCE = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_NULLSRC + 1 ) ,
- D3D12_MESSAGE_ID_PIPELINE_STATE_TYPE_MISMATCH = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCE_INVALIDSRCRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_NOT_SET = ( D3D12_MESSAGE_ID_PIPELINE_STATE_TYPE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_ZERO_BARRIERS = ( D3D12_MESSAGE_ID_COMMAND_LIST_DISPATCH_ROOT_SIGNATURE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_BEGIN_END_EVENT_MISMATCH = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_ZERO_BARRIERS + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_POSSIBLE_BEFORE_AFTER_MISMATCH = ( D3D12_MESSAGE_ID_BEGIN_END_EVENT_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_BEGIN_END = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_POSSIBLE_BEFORE_AFTER_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INVALID_RESOURCE = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_BEGIN_END + 1 ) ,
- D3D12_MESSAGE_ID_USE_OF_ZERO_REFCOUNT_OBJECT = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_INVALID_RESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_OBJECT_EVICTED_WHILE_STILL_IN_USE = ( D3D12_MESSAGE_ID_USE_OF_ZERO_REFCOUNT_OBJECT + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_DESCRIPTOR_ACCESS_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_OBJECT_EVICTED_WHILE_STILL_IN_USE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_INVALIDLIBRARYBLOB = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_ROOT_DESCRIPTOR_ACCESS_OUT_OF_BOUNDS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_DRIVERVERSIONMISMATCH = ( D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_INVALIDLIBRARYBLOB + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_ADAPTERVERSIONMISMATCH = ( D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_DRIVERVERSIONMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_UNSUPPORTED = ( D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_ADAPTERVERSIONMISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_PIPELINELIBRARY = ( D3D12_MESSAGE_ID_CREATEPIPELINELIBRARY_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_PIPELINELIBRARY = ( D3D12_MESSAGE_ID_CREATE_PIPELINELIBRARY + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_PIPELINELIBRARY = ( D3D12_MESSAGE_ID_LIVE_PIPELINELIBRARY + 1 ) ,
- D3D12_MESSAGE_ID_STOREPIPELINE_NONAME = ( D3D12_MESSAGE_ID_DESTROY_PIPELINELIBRARY + 1 ) ,
- D3D12_MESSAGE_ID_STOREPIPELINE_DUPLICATENAME = ( D3D12_MESSAGE_ID_STOREPIPELINE_NONAME + 1 ) ,
- D3D12_MESSAGE_ID_LOADPIPELINE_NAMENOTFOUND = ( D3D12_MESSAGE_ID_STOREPIPELINE_DUPLICATENAME + 1 ) ,
- D3D12_MESSAGE_ID_LOADPIPELINE_INVALIDDESC = ( D3D12_MESSAGE_ID_LOADPIPELINE_NAMENOTFOUND + 1 ) ,
- D3D12_MESSAGE_ID_PIPELINELIBRARY_SERIALIZE_NOTENOUGHMEMORY = ( D3D12_MESSAGE_ID_LOADPIPELINE_INVALIDDESC + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_RT_OUTPUT_MISMATCH = ( D3D12_MESSAGE_ID_PIPELINELIBRARY_SERIALIZE_NOTENOUGHMEMORY + 1 ) ,
- D3D12_MESSAGE_ID_SETEVENTONMULTIPLEFENCECOMPLETION_INVALIDFLAGS = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_PS_OUTPUT_RT_OUTPUT_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_QUEUE_VIDEO_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_SETEVENTONMULTIPLEFENCECOMPLETION_INVALIDFLAGS + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_VIDEO_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_CREATE_QUEUE_VIDEO_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_CREATEQUERY_HEAP_VIDEO_DECODE_STATISTICS_NOT_SUPPORTED = ( D3D12_MESSAGE_ID_CREATE_COMMAND_ALLOCATOR_VIDEO_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDLIST = ( D3D12_MESSAGE_ID_CREATEQUERY_HEAP_VIDEO_DECODE_STATISTICS_NOT_SUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_VIDEODECODER = ( D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDLIST + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_VIDEODECODESTREAM = ( D3D12_MESSAGE_ID_CREATE_VIDEODECODER + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDLIST = ( D3D12_MESSAGE_ID_CREATE_VIDEODECODESTREAM + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_VIDEODECODER = ( D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDLIST + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_VIDEODECODESTREAM = ( D3D12_MESSAGE_ID_LIVE_VIDEODECODER + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDLIST = ( D3D12_MESSAGE_ID_LIVE_VIDEODECODESTREAM + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_VIDEODECODER = ( D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDLIST + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_VIDEODECODESTREAM = ( D3D12_MESSAGE_ID_DESTROY_VIDEODECODER + 1 ) ,
- D3D12_MESSAGE_ID_DECODE_FRAME_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_DESTROY_VIDEODECODESTREAM + 1 ) ,
- D3D12_MESSAGE_ID_DEPRECATED_API = ( D3D12_MESSAGE_ID_DECODE_FRAME_INVALID_PARAMETERS + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_COMMAND_LIST_TYPE = ( D3D12_MESSAGE_ID_DEPRECATED_API + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_DESCRIPTOR_TABLE_NOT_SET = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_MISMATCHING_COMMAND_LIST_TYPE + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_CONSTANT_BUFFER_VIEW_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_DESCRIPTOR_TABLE_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_SHADER_RESOURCE_VIEW_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_CONSTANT_BUFFER_VIEW_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_UNORDERED_ACCESS_VIEW_NOT_SET = ( D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_SHADER_RESOURCE_VIEW_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_DISCARD_INVALID_SUBRESOURCE_RANGE = ( D3D12_MESSAGE_ID_COMMAND_LIST_ROOT_UNORDERED_ACCESS_VIEW_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_DISCARD_ONE_SUBRESOURCE_FOR_MIPS_WITH_RECTS = ( D3D12_MESSAGE_ID_DISCARD_INVALID_SUBRESOURCE_RANGE + 1 ) ,
- D3D12_MESSAGE_ID_DISCARD_NO_RECTS_FOR_NON_TEXTURE2D = ( D3D12_MESSAGE_ID_DISCARD_ONE_SUBRESOURCE_FOR_MIPS_WITH_RECTS + 1 ) ,
- D3D12_MESSAGE_ID_COPY_ON_SAME_SUBRESOURCE = ( D3D12_MESSAGE_ID_DISCARD_NO_RECTS_FOR_NON_TEXTURE2D + 1 ) ,
- D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PAGEABLE = ( D3D12_MESSAGE_ID_COPY_ON_SAME_SUBRESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UNSUPPORTED = ( D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PAGEABLE + 1 ) ,
- D3D12_MESSAGE_ID_STATIC_DESCRIPTOR_INVALID_DESCRIPTOR_CHANGE = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_DATA_STATIC_DESCRIPTOR_INVALID_DATA_CHANGE = ( D3D12_MESSAGE_ID_STATIC_DESCRIPTOR_INVALID_DESCRIPTOR_CHANGE + 1 ) ,
- D3D12_MESSAGE_ID_DATA_STATIC_WHILE_SET_AT_EXECUTE_DESCRIPTOR_INVALID_DATA_CHANGE = ( D3D12_MESSAGE_ID_DATA_STATIC_DESCRIPTOR_INVALID_DATA_CHANGE + 1 ) ,
- D3D12_MESSAGE_ID_EXECUTE_BUNDLE_STATIC_DESCRIPTOR_DATA_STATIC_NOT_SET = ( D3D12_MESSAGE_ID_DATA_STATIC_WHILE_SET_AT_EXECUTE_DESCRIPTOR_INVALID_DATA_CHANGE + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_ACCESS_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_EXECUTE_BUNDLE_STATIC_DESCRIPTOR_DATA_STATIC_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SAMPLER_MODE_MISMATCH = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_ACCESS_OUT_OF_BOUNDS + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_FENCE_INVALID_FLAGS = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_SAMPLER_MODE_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_RESOURCE_BARRIER_DUPLICATE_SUBRESOURCE_TRANSITIONS = ( D3D12_MESSAGE_ID_CREATE_FENCE_INVALID_FLAGS + 1 ) ,
- D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PRIORITY = ( D3D12_MESSAGE_ID_RESOURCE_BARRIER_DUPLICATE_SUBRESOURCE_TRANSITIONS + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_PASS = ( D3D12_MESSAGE_ID_SETRESIDENCYPRIORITY_INVALID_PRIORITY + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_PASS = ( D3D12_MESSAGE_ID_CREATE_PASS + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_PASS = ( D3D12_MESSAGE_ID_DESTROY_PASS + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_LARGE_NUM_DESCRIPTORS = ( D3D12_MESSAGE_ID_LIVE_PASS + 1 ) ,
- D3D12_MESSAGE_ID_BEGIN_EVENT = ( D3D12_MESSAGE_ID_CREATE_DESCRIPTOR_HEAP_LARGE_NUM_DESCRIPTORS + 1 ) ,
- D3D12_MESSAGE_ID_END_EVENT = ( D3D12_MESSAGE_ID_BEGIN_EVENT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEVICE_DEBUG_LAYER_STARTUP_OPTIONS = ( D3D12_MESSAGE_ID_END_EVENT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_DEPTHBOUNDSTEST_UNSUPPORTED = ( D3D12_MESSAGE_ID_CREATEDEVICE_DEBUG_LAYER_STARTUP_OPTIONS + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINESTATE_DUPLICATE_SUBOBJECT = ( D3D12_MESSAGE_ID_CREATEDEPTHSTENCILSTATE_DEPTHBOUNDSTEST_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINESTATE_UNKNOWN_SUBOBJECT = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_DUPLICATE_SUBOBJECT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINESTATE_ZERO_SIZE_STREAM = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_UNKNOWN_SUBOBJECT + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_STREAM = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_ZERO_SIZE_STREAM + 1 ) ,
- D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CANNOT_DEDUCE_TYPE = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_INVALID_STREAM + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_RESOURCE_DIMENSION_MISMATCH = ( D3D12_MESSAGE_ID_CREATEPIPELINESTATE_CANNOT_DEDUCE_TYPE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_PRIVILEGE_FOR_GLOBAL_REALTIME = ( D3D12_MESSAGE_ID_COMMAND_LIST_STATIC_DESCRIPTOR_RESOURCE_DIMENSION_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_HARDWARE_SUPPORT_FOR_GLOBAL_REALTIME = ( D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_PRIVILEGE_FOR_GLOBAL_REALTIME + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_ARCHITECTURE = ( D3D12_MESSAGE_ID_CREATE_COMMAND_QUEUE_INSUFFICIENT_HARDWARE_SUPPORT_FOR_GLOBAL_REALTIME + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DST = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_ARCHITECTURE + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE_DIMENSION = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DST + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DST_RANGE_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE_DIMENSION + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_SRC = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DST_RANGE_OUT_OF_BOUNDS + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE_DIMENSION = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_SRC + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_SRC_RANGE_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE_DIMENSION + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_OFFSET_ALIGNMENT = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_SRC_RANGE_OUT_OF_BOUNDS + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_RESOURCES = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_OFFSET_ALIGNMENT + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_SUBRESOURCE_RANGES = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_RESOURCES + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_RESOURCE = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_NULL_DEPENDENT_SUBRESOURCE_RANGES + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_SUBRESOURCE_RANGE = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_RESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_SUBRESOURCE_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DEPENDENT_SUBRESOURCE_RANGE + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_RANGE_OUT_OF_BOUNDS = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_SUBRESOURCE_OUT_OF_BOUNDS + 1 ) ,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_ZERO_DEPENDENCIES = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_DEPENDENT_RANGE_OUT_OF_BOUNDS + 1 ) ,
- D3D12_MESSAGE_ID_DEVICE_CREATE_SHARED_HANDLE_INVALIDARG = ( D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_ZERO_DEPENDENCIES + 1 ) ,
- D3D12_MESSAGE_ID_DESCRIPTOR_HANDLE_WITH_INVALID_RESOURCE = ( D3D12_MESSAGE_ID_DEVICE_CREATE_SHARED_HANDLE_INVALIDARG + 1 ) ,
- D3D12_MESSAGE_ID_SETDEPTHBOUNDS_INVALIDARGS = ( D3D12_MESSAGE_ID_DESCRIPTOR_HANDLE_WITH_INVALID_RESOURCE + 1 ) ,
- D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_STATE_IMPRECISE = ( D3D12_MESSAGE_ID_SETDEPTHBOUNDS_INVALIDARGS + 1 ) ,
- D3D12_MESSAGE_ID_COMMAND_LIST_PIPELINE_STATE_NOT_SET = ( D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_RESOURCE_STATE_IMPRECISE + 1 ) ,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_MODEL_MISMATCH = ( D3D12_MESSAGE_ID_COMMAND_LIST_PIPELINE_STATE_NOT_SET + 1 ) ,
- D3D12_MESSAGE_ID_OBJECT_ACCESSED_WHILE_STILL_IN_USE = ( D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_SHADER_MODEL_MISMATCH + 1 ) ,
- D3D12_MESSAGE_ID_PROGRAMMABLE_MSAA_UNSUPPORTED = ( D3D12_MESSAGE_ID_OBJECT_ACCESSED_WHILE_STILL_IN_USE + 1 ) ,
- D3D12_MESSAGE_ID_SETSAMPLEPOSITIONS_INVALIDARGS = ( D3D12_MESSAGE_ID_PROGRAMMABLE_MSAA_UNSUPPORTED + 1 ) ,
- D3D12_MESSAGE_ID_RESOLVESUBRESOURCEREGION_INVALID_RECT = ( D3D12_MESSAGE_ID_SETSAMPLEPOSITIONS_INVALIDARGS + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDQUEUE = ( D3D12_MESSAGE_ID_RESOLVESUBRESOURCEREGION_INVALID_RECT + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDLIST = ( D3D12_MESSAGE_ID_CREATE_VIDEODECODECOMMANDQUEUE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDQUEUE = ( D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDLIST + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDQUEUE = ( D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSCOMMANDQUEUE + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDLIST = ( D3D12_MESSAGE_ID_LIVE_VIDEODECODECOMMANDQUEUE + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDQUEUE = ( D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDLIST + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDQUEUE = ( D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSCOMMANDQUEUE + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDLIST = ( D3D12_MESSAGE_ID_DESTROY_VIDEODECODECOMMANDQUEUE + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDQUEUE = ( D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDLIST + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSOR = ( D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSCOMMANDQUEUE + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSSTREAM = ( D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSOR + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSOR = ( D3D12_MESSAGE_ID_CREATE_VIDEOPROCESSSTREAM + 1 ) ,
- D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSSTREAM = ( D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSOR + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSOR = ( D3D12_MESSAGE_ID_LIVE_VIDEOPROCESSSTREAM + 1 ) ,
- D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSSTREAM = ( D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSOR + 1 ) ,
- D3D12_MESSAGE_ID_PROCESS_FRAME_INVALID_PARAMETERS = ( D3D12_MESSAGE_ID_DESTROY_VIDEOPROCESSSTREAM + 1 ) ,
- D3D12_MESSAGE_ID_COPY_INVALIDLAYOUT = ( D3D12_MESSAGE_ID_PROCESS_FRAME_INVALID_PARAMETERS + 1 ) ,
- D3D12_MESSAGE_ID_CREATE_CRYPTO_SESSION = 1068,
- D3D12_MESSAGE_ID_CREATE_CRYPTO_SESSION_POLICY = 1069,
- D3D12_MESSAGE_ID_CREATE_PROTECTED_RESOURCE_SESSION = 1070,
- D3D12_MESSAGE_ID_LIVE_CRYPTO_SESSION = 1071,
- D3D12_MESSAGE_ID_LIVE_CRYPTO_SESSION_POLICY = 1072,
- D3D12_MESSAGE_ID_LIVE_PROTECTED_RESOURCE_SESSION = 1073,
- D3D12_MESSAGE_ID_DESTROY_CRYPTO_SESSION = 1074,
- D3D12_MESSAGE_ID_DESTROY_CRYPTO_SESSION_POLICY = 1075,
- D3D12_MESSAGE_ID_DESTROY_PROTECTED_RESOURCE_SESSION = 1076,
- D3D12_MESSAGE_ID_PROTECTED_RESOURCE_SESSION_UNSUPPORTED = 1077,
- D3D12_MESSAGE_ID_FENCE_INVALIDOPERATION = 1078,
- D3D12_MESSAGE_ID_CREATEQUERY_HEAP_COPY_QUEUE_TIMESTAMPS_NOT_SUPPORTED = 1079,
- D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_DEFERRED = 1080,
- D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_RECORDTIME_ASSUMEDFROMFIRSTUSE = 1081,
- D3D12_MESSAGE_ID_SAMPLEPOSITIONS_MISMATCH_RECORDTIME_ASSUMEDFROMCLEAR = 1082,
- D3D12_MESSAGE_ID_CREATE_VIDEODECODERHEAP = 1083,
- D3D12_MESSAGE_ID_LIVE_VIDEODECODERHEAP = 1084,
- D3D12_MESSAGE_ID_DESTROY_VIDEODECODERHEAP = 1085,
- D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDARG_RETURN = 1086,
- D3D12_MESSAGE_ID_OPENEXISTINGHEAP_OUTOFMEMORY_RETURN = 1087,
- D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDADDRESS = 1088,
- D3D12_MESSAGE_ID_OPENEXISTINGHEAP_INVALIDHANDLE = 1089,
- D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_DEST = 1090,
- D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_MODE = 1091,
- D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_INVALID_ALIGNMENT = 1092,
- D3D12_MESSAGE_ID_WRITEBUFFERIMMEDIATE_NOT_SUPPORTED = 1093,
- D3D12_MESSAGE_ID_SETVIEWINSTANCEMASK_INVALIDARGS = 1094,
- D3D12_MESSAGE_ID_VIEW_INSTANCING_UNSUPPORTED = 1095,
- D3D12_MESSAGE_ID_VIEW_INSTANCING_INVALIDARGS = 1096,
- D3D12_MESSAGE_ID_COPYTEXTUREREGION_MISMATCH_DECODE_REFERENCE_ONLY_FLAG = 1097,
- D3D12_MESSAGE_ID_COPYRESOURCE_MISMATCH_DECODE_REFERENCE_ONLY_FLAG = 1098,
- D3D12_MESSAGE_ID_CREATE_VIDEO_DECODE_HEAP_CAPS_FAILURE = 1099,
- D3D12_MESSAGE_ID_CREATE_VIDEO_DECODE_HEAP_CAPS_UNSUPPORTED = 1100,
- D3D12_MESSAGE_ID_VIDEO_DECODE_SUPPORT_INVALID_INPUT = 1101,
- D3D12_MESSAGE_ID_CREATE_VIDEO_DECODER_UNSUPPORTED = 1102,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_METADATA_ERROR = 1103,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_VIEW_INSTANCING_VERTEX_SIZE_EXCEEDED = 1104,
- D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_RUNTIME_INTERNAL_ERROR = 1105,
- D3D12_MESSAGE_ID_NO_VIDEO_API_SUPPORT = 1106,
- D3D12_MESSAGE_ID_VIDEO_PROCESS_SUPPORT_INVALID_INPUT = 1107,
- D3D12_MESSAGE_ID_CREATE_VIDEO_PROCESSOR_CAPS_FAILURE = 1108,
- D3D12_MESSAGE_ID_VIDEO_PROCESS_SUPPORT_UNSUPPORTED_FORMAT = 1109,
- D3D12_MESSAGE_ID_VIDEO_DECODE_FRAME_INVALID_ARGUMENT = 1110,
- D3D12_MESSAGE_ID_ENQUEUE_MAKE_RESIDENT_INVALID_FLAGS = 1111,
- D3D12_MESSAGE_ID_OPENEXISTINGHEAP_UNSUPPORTED = 1112,
- D3D12_MESSAGE_ID_VIDEO_PROCESS_FRAMES_INVALID_ARGUMENT = 1113,
- D3D12_MESSAGE_ID_VIDEO_DECODE_SUPPORT_UNSUPPORTED = 1114,
- D3D12_MESSAGE_ID_CREATE_COMMANDRECORDER = 1115,
- D3D12_MESSAGE_ID_LIVE_COMMANDRECORDER = 1116,
- D3D12_MESSAGE_ID_DESTROY_COMMANDRECORDER = 1117,
- D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_VIDEO_NOT_SUPPORTED = 1118,
- D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_INVALID_SUPPORT_FLAGS = 1119,
- D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_INVALID_FLAGS = 1120,
- D3D12_MESSAGE_ID_CREATE_COMMAND_RECORDER_MORE_RECORDERS_THAN_LOGICAL_PROCESSORS = 1121,
- D3D12_MESSAGE_ID_CREATE_COMMANDPOOL = 1122,
- D3D12_MESSAGE_ID_LIVE_COMMANDPOOL = 1123,
- D3D12_MESSAGE_ID_DESTROY_COMMANDPOOL = 1124,
- D3D12_MESSAGE_ID_CREATE_COMMAND_POOL_INVALID_FLAGS = 1125,
- D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_VIDEO_NOT_SUPPORTED = 1126,
- D3D12_MESSAGE_ID_COMMAND_RECORDER_SUPPORT_FLAGS_MISMATCH = 1127,
- D3D12_MESSAGE_ID_COMMAND_RECORDER_CONTENTION = 1128,
- D3D12_MESSAGE_ID_COMMAND_RECORDER_USAGE_WITH_CREATECOMMANDLIST_COMMAND_LIST = 1129,
- D3D12_MESSAGE_ID_COMMAND_ALLOCATOR_USAGE_WITH_CREATECOMMANDLIST1_COMMAND_LIST = 1130,
- D3D12_MESSAGE_ID_CANNOT_EXECUTE_EMPTY_COMMAND_LIST = 1131,
- D3D12_MESSAGE_ID_CANNOT_RESET_COMMAND_POOL_WITH_OPEN_COMMAND_LISTS = 1132,
- D3D12_MESSAGE_ID_CANNOT_USE_COMMAND_RECORDER_WITHOUT_CURRENT_TARGET = 1133,
- D3D12_MESSAGE_ID_CANNOT_CHANGE_COMMAND_RECORDER_TARGET_WHILE_RECORDING = 1134,
- D3D12_MESSAGE_ID_COMMAND_POOL_SYNC = 1135,
- D3D12_MESSAGE_ID_EVICT_UNDERFLOW = 1136,
- D3D12_MESSAGE_ID_CREATE_META_COMMAND = 1137,
- D3D12_MESSAGE_ID_LIVE_META_COMMAND = 1138,
- D3D12_MESSAGE_ID_DESTROY_META_COMMAND = 1139,
- D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALID_DST_RESOURCE = 1140,
- D3D12_MESSAGE_ID_COPYBUFFERREGION_INVALID_SRC_RESOURCE = 1141,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_DST_RESOURCE = 1142,
- D3D12_MESSAGE_ID_ATOMICCOPYBUFFER_INVALID_SRC_RESOURCE = 1143,
- D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_NULL_BUFFER = 1144,
- D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_NULL_RESOURCE_DESC = 1145,
- D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_UNSUPPORTED = 1146,
- D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_DIMENSION = 1147,
- D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_FLAGS = 1148,
- D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_BUFFER_OFFSET = 1149,
- D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_RESOURCE_DIMENSION = 1150,
- D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_INVALID_RESOURCE_FLAGS = 1151,
- D3D12_MESSAGE_ID_CREATEPLACEDRESOURCEONBUFFER_OUTOFMEMORY_RETURN = 1152,
- D3D12_MESSAGE_ID_CANNOT_CREATE_GRAPHICS_AND_VIDEO_COMMAND_RECORDER = 1153,
- D3D12_MESSAGE_ID_UPDATETILEMAPPINGS_POSSIBLY_MISMATCHING_PROPERTIES = 1154,
- D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_INVALID_COMMAND_LIST_TYPE = 1155,
- D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_INCOMPATIBLE_WITH_STRUCTURED_BUFFERS = 1156,
- D3D12_MESSAGE_ID_COMPUTE_ONLY_DEVICE_OPERATION_UNSUPPORTED = 1157,
- D3D12_MESSAGE_ID_BUILD_RAYTRACING_ACCELERATION_STRUCTURE_INVALID = 1158,
- D3D12_MESSAGE_ID_EMIT_RAYTRACING_ACCELERATION_STRUCTURE_POSTBUILD_INFO_INVALID = 1159,
- D3D12_MESSAGE_ID_COPY_RAYTRACING_ACCELERATION_STRUCTURE_INVALID = 1160,
- D3D12_MESSAGE_ID_DISPATCH_RAYS_INVALID = 1161,
- D3D12_MESSAGE_ID_GET_RAYTRACING_ACCELERATION_STRUCTURE_PREBUILD_INFO_INVALID = 1162,
- D3D12_MESSAGE_ID_CREATE_LIFETIMETRACKER = 1163,
- D3D12_MESSAGE_ID_LIVE_LIFETIMETRACKER = 1164,
- D3D12_MESSAGE_ID_DESTROY_LIFETIMETRACKER = 1165,
- D3D12_MESSAGE_ID_DESTROYOWNEDOBJECT_OBJECTNOTOWNED = 1166,
- D3D12_MESSAGE_ID_CREATE_TRACKEDWORKLOAD = 1167,
- D3D12_MESSAGE_ID_LIVE_TRACKEDWORKLOAD = 1168,
- D3D12_MESSAGE_ID_DESTROY_TRACKEDWORKLOAD = 1169,
- D3D12_MESSAGE_ID_RENDER_PASS_ERROR = 1170,
- D3D12_MESSAGE_ID_META_COMMAND_ID_INVALID = 1171,
- D3D12_MESSAGE_ID_META_COMMAND_UNSUPPORTED_PARAMS = 1172,
- D3D12_MESSAGE_ID_META_COMMAND_FAILED_ENUMERATION = 1173,
- D3D12_MESSAGE_ID_META_COMMAND_PARAMETER_SIZE_MISMATCH = 1174,
- D3D12_MESSAGE_ID_UNINITIALIZED_META_COMMAND = 1175,
- D3D12_MESSAGE_ID_META_COMMAND_INVALID_GPU_VIRTUAL_ADDRESS = 1176,
- D3D12_MESSAGE_ID_CREATE_VIDEOENCODECOMMANDLIST = 1177,
- D3D12_MESSAGE_ID_LIVE_VIDEOENCODECOMMANDLIST = 1178,
- D3D12_MESSAGE_ID_DESTROY_VIDEOENCODECOMMANDLIST = 1179,
- D3D12_MESSAGE_ID_CREATE_VIDEOENCODECOMMANDQUEUE = 1180,
- D3D12_MESSAGE_ID_LIVE_VIDEOENCODECOMMANDQUEUE = 1181,
- D3D12_MESSAGE_ID_DESTROY_VIDEOENCODECOMMANDQUEUE = 1182,
- D3D12_MESSAGE_ID_CREATE_VIDEOMOTIONESTIMATOR = 1183,
- D3D12_MESSAGE_ID_LIVE_VIDEOMOTIONESTIMATOR = 1184,
- D3D12_MESSAGE_ID_DESTROY_VIDEOMOTIONESTIMATOR = 1185,
- D3D12_MESSAGE_ID_CREATE_VIDEOMOTIONVECTORHEAP = 1186,
- D3D12_MESSAGE_ID_LIVE_VIDEOMOTIONVECTORHEAP = 1187,
- D3D12_MESSAGE_ID_DESTROY_VIDEOMOTIONVECTORHEAP = 1188,
- D3D12_MESSAGE_ID_MULTIPLE_TRACKED_WORKLOADS = 1189,
- D3D12_MESSAGE_ID_MULTIPLE_TRACKED_WORKLOAD_PAIRS = 1190,
- D3D12_MESSAGE_ID_OUT_OF_ORDER_TRACKED_WORKLOAD_PAIR = 1191,
- D3D12_MESSAGE_ID_CANNOT_ADD_TRACKED_WORKLOAD = 1192,
- D3D12_MESSAGE_ID_INCOMPLETE_TRACKED_WORKLOAD_PAIR = 1193,
- D3D12_MESSAGE_ID_CREATE_STATE_OBJECT_ERROR = 1194,
- D3D12_MESSAGE_ID_GET_SHADER_IDENTIFIER_ERROR = 1195,
- D3D12_MESSAGE_ID_GET_SHADER_STACK_SIZE_ERROR = 1196,
- D3D12_MESSAGE_ID_GET_PIPELINE_STACK_SIZE_ERROR = 1197,
- D3D12_MESSAGE_ID_SET_PIPELINE_STACK_SIZE_ERROR = 1198,
- D3D12_MESSAGE_ID_GET_SHADER_IDENTIFIER_SIZE_INVALID = 1199,
- D3D12_MESSAGE_ID_CHECK_DRIVER_MATCHING_IDENTIFIER_INVALID = 1200,
- D3D12_MESSAGE_ID_CHECK_DRIVER_MATCHING_IDENTIFIER_DRIVER_REPORTED_ISSUE = 1201,
- D3D12_MESSAGE_ID_RENDER_PASS_INVALID_RESOURCE_BARRIER = 1202,
- D3D12_MESSAGE_ID_RENDER_PASS_DISALLOWED_API_CALLED = 1203,
- D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_NEST_RENDER_PASSES = 1204,
- D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_END_WITHOUT_BEGIN = 1205,
- D3D12_MESSAGE_ID_RENDER_PASS_CANNOT_CLOSE_COMMAND_LIST = 1206,
- D3D12_MESSAGE_ID_RENDER_PASS_GPU_WORK_WHILE_SUSPENDED = 1207,
- D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_SUSPEND_RESUME = 1208,
- D3D12_MESSAGE_ID_RENDER_PASS_NO_PRIOR_SUSPEND_WITHIN_EXECUTECOMMANDLISTS = 1209,
- D3D12_MESSAGE_ID_RENDER_PASS_NO_SUBSEQUENT_RESUME_WITHIN_EXECUTECOMMANDLISTS = 1210,
- D3D12_MESSAGE_ID_TRACKED_WORKLOAD_COMMAND_QUEUE_MISMATCH = 1211,
- D3D12_MESSAGE_ID_TRACKED_WORKLOAD_NOT_SUPPORTED = 1212,
- D3D12_MESSAGE_ID_RENDER_PASS_MISMATCHING_NO_ACCESS = 1213,
- D3D12_MESSAGE_ID_RENDER_PASS_UNSUPPORTED_RESOLVE = 1214,
- D3D12_MESSAGE_ID_CLEARUNORDEREDACCESSVIEW_INVALID_RESOURCE_PTR = 1215,
- D3D12_MESSAGE_ID_WINDOWS7_FENCE_OUTOFORDER_SIGNAL = 1216,
- D3D12_MESSAGE_ID_WINDOWS7_FENCE_OUTOFORDER_WAIT = 1217,
- D3D12_MESSAGE_ID_VIDEO_CREATE_MOTION_ESTIMATOR_INVALID_ARGUMENT = 1218,
- D3D12_MESSAGE_ID_VIDEO_CREATE_MOTION_VECTOR_HEAP_INVALID_ARGUMENT = 1219,
- D3D12_MESSAGE_ID_ESTIMATE_MOTION_INVALID_ARGUMENT = 1220,
- D3D12_MESSAGE_ID_RESOLVE_MOTION_VECTOR_HEAP_INVALID_ARGUMENT = 1221,
- D3D12_MESSAGE_ID_GETGPUVIRTUALADDRESS_INVALID_HEAP_TYPE = 1222,
- D3D12_MESSAGE_ID_SET_BACKGROUND_PROCESSING_MODE_INVALID_ARGUMENT = 1223,
- D3D12_MESSAGE_ID_CREATE_COMMAND_LIST_INVALID_COMMAND_LIST_TYPE_FOR_FEATURE_LEVEL = 1224,
- D3D12_MESSAGE_ID_CREATE_VIDEOEXTENSIONCOMMAND = 1225,
- D3D12_MESSAGE_ID_LIVE_VIDEOEXTENSIONCOMMAND = 1226,
- D3D12_MESSAGE_ID_DESTROY_VIDEOEXTENSIONCOMMAND = 1227,
- D3D12_MESSAGE_ID_INVALID_VIDEO_EXTENSION_COMMAND_ID = 1228,
- D3D12_MESSAGE_ID_VIDEO_EXTENSION_COMMAND_INVALID_ARGUMENT = 1229,
- D3D12_MESSAGE_ID_CREATE_ROOT_SIGNATURE_NOT_UNIQUE_IN_DXIL_LIBRARY = 1230,
- D3D12_MESSAGE_ID_VARIABLE_SHADING_RATE_NOT_ALLOWED_WITH_TIR = 1231,
- D3D12_MESSAGE_ID_GEOMETRY_SHADER_OUTPUTTING_BOTH_VIEWPORT_ARRAY_INDEX_AND_SHADING_RATE_NOT_SUPPORTED_ON_DEVICE = 1232,
- D3D12_MESSAGE_ID_RSSETSHADING_RATE_INVALID_SHADING_RATE = 1233,
- D3D12_MESSAGE_ID_RSSETSHADING_RATE_SHADING_RATE_NOT_PERMITTED_BY_CAP = 1234,
- D3D12_MESSAGE_ID_RSSETSHADING_RATE_INVALID_COMBINER = 1235,
- D3D12_MESSAGE_ID_RSSETSHADINGRATEIMAGE_REQUIRES_TIER_2 = 1236,
- D3D12_MESSAGE_ID_RSSETSHADINGRATE_REQUIRES_TIER_1 = 1237,
- D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_FORMAT = 1238,
- D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_ARRAY_SIZE = 1239,
- D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_MIP_LEVEL = 1240,
- D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_SAMPLE_COUNT = 1241,
- D3D12_MESSAGE_ID_SHADING_RATE_IMAGE_INCORRECT_SAMPLE_QUALITY = 1242,
- D3D12_MESSAGE_ID_NON_RETAIL_SHADER_MODEL_WONT_VALIDATE = 1243,
- D3D12_MESSAGE_ID_D3D12_MESSAGES_END = ( D3D12_MESSAGE_ID_NON_RETAIL_SHADER_MODEL_WONT_VALIDATE + 1 )
- } D3D12_MESSAGE_ID;
-
-static_assert(D3D12_MESSAGE_ID_GPU_BASED_VALIDATION_UNSUPPORTED == 1000, "Publicly released SDK D3D12_MESSAGE_ID enum values must not be changed. New enum values must be added to the end of the list.");
-static_assert(D3D12_MESSAGE_ID_COPY_INVALIDLAYOUT == 1067, "Publicly released SDK D3D12_MESSAGE_ID enum values must not be changed. New enum values must be added to the end of the list.");
-typedef struct D3D12_MESSAGE
- {
- D3D12_MESSAGE_CATEGORY Category;
- D3D12_MESSAGE_SEVERITY Severity;
- D3D12_MESSAGE_ID ID;
- _Field_size_(DescriptionByteLength) const char *pDescription;
- SIZE_T DescriptionByteLength;
- } D3D12_MESSAGE;
-
-typedef struct D3D12_INFO_QUEUE_FILTER_DESC
- {
- UINT NumCategories;
- _Field_size_(NumCategories) D3D12_MESSAGE_CATEGORY *pCategoryList;
- UINT NumSeverities;
- _Field_size_(NumSeverities) D3D12_MESSAGE_SEVERITY *pSeverityList;
- UINT NumIDs;
- _Field_size_(NumIDs) D3D12_MESSAGE_ID *pIDList;
- } D3D12_INFO_QUEUE_FILTER_DESC;
-
-typedef struct D3D12_INFO_QUEUE_FILTER
- {
- D3D12_INFO_QUEUE_FILTER_DESC AllowList;
- D3D12_INFO_QUEUE_FILTER_DESC DenyList;
- } D3D12_INFO_QUEUE_FILTER;
-
-#define D3D12_INFO_QUEUE_DEFAULT_MESSAGE_COUNT_LIMIT 1024
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0012_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0012_v0_0_s_ifspec;
-
-#ifndef __ID3D12InfoQueue_INTERFACE_DEFINED__
-#define __ID3D12InfoQueue_INTERFACE_DEFINED__
-
-/* interface ID3D12InfoQueue */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12InfoQueue;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("0742a90b-c387-483f-b946-30a7e4e61458")
- ID3D12InfoQueue : public IUnknown
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE SetMessageCountLimit(
- _In_ UINT64 MessageCountLimit) = 0;
-
- virtual void STDMETHODCALLTYPE ClearStoredMessages( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetMessage(
- _In_ UINT64 MessageIndex,
- _Out_writes_bytes_opt_(*pMessageByteLength) D3D12_MESSAGE *pMessage,
- _Inout_ SIZE_T *pMessageByteLength) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumMessagesAllowedByStorageFilter( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDeniedByStorageFilter( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessages( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumStoredMessagesAllowedByRetrievalFilter( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetNumMessagesDiscardedByMessageCountLimit( void) = 0;
-
- virtual UINT64 STDMETHODCALLTYPE GetMessageCountLimit( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE AddStorageFilterEntries(
- _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetStorageFilter(
- _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
- _Inout_ SIZE_T *pFilterByteLength) = 0;
-
- virtual void STDMETHODCALLTYPE ClearStorageFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushEmptyStorageFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushCopyOfStorageFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushStorageFilter(
- _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0;
-
- virtual void STDMETHODCALLTYPE PopStorageFilter( void) = 0;
-
- virtual UINT STDMETHODCALLTYPE GetStorageFilterStackSize( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE AddRetrievalFilterEntries(
- _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetRetrievalFilter(
- _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
- _Inout_ SIZE_T *pFilterByteLength) = 0;
-
- virtual void STDMETHODCALLTYPE ClearRetrievalFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushEmptyRetrievalFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushCopyOfRetrievalFilter( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE PushRetrievalFilter(
- _In_ D3D12_INFO_QUEUE_FILTER *pFilter) = 0;
-
- virtual void STDMETHODCALLTYPE PopRetrievalFilter( void) = 0;
-
- virtual UINT STDMETHODCALLTYPE GetRetrievalFilterStackSize( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE AddMessage(
- _In_ D3D12_MESSAGE_CATEGORY Category,
- _In_ D3D12_MESSAGE_SEVERITY Severity,
- _In_ D3D12_MESSAGE_ID ID,
- _In_ LPCSTR pDescription) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE AddApplicationMessage(
- _In_ D3D12_MESSAGE_SEVERITY Severity,
- _In_ LPCSTR pDescription) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetBreakOnCategory(
- _In_ D3D12_MESSAGE_CATEGORY Category,
- _In_ BOOL bEnable) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetBreakOnSeverity(
- _In_ D3D12_MESSAGE_SEVERITY Severity,
- _In_ BOOL bEnable) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE SetBreakOnID(
- _In_ D3D12_MESSAGE_ID ID,
- _In_ BOOL bEnable) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetBreakOnCategory(
- _In_ D3D12_MESSAGE_CATEGORY Category) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetBreakOnSeverity(
- _In_ D3D12_MESSAGE_SEVERITY Severity) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetBreakOnID(
- _In_ D3D12_MESSAGE_ID ID) = 0;
-
- virtual void STDMETHODCALLTYPE SetMuteDebugOutput(
- _In_ BOOL bMute) = 0;
-
- virtual BOOL STDMETHODCALLTYPE GetMuteDebugOutput( void) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12InfoQueueVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12InfoQueue * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12InfoQueue * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *SetMessageCountLimit )(
- ID3D12InfoQueue * This,
- _In_ UINT64 MessageCountLimit);
-
- void ( STDMETHODCALLTYPE *ClearStoredMessages )(
- ID3D12InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetMessage )(
- ID3D12InfoQueue * This,
- _In_ UINT64 MessageIndex,
- _Out_writes_bytes_opt_(*pMessageByteLength) D3D12_MESSAGE *pMessage,
- _Inout_ SIZE_T *pMessageByteLength);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumMessagesAllowedByStorageFilter )(
- ID3D12InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDeniedByStorageFilter )(
- ID3D12InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessages )(
- ID3D12InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumStoredMessagesAllowedByRetrievalFilter )(
- ID3D12InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetNumMessagesDiscardedByMessageCountLimit )(
- ID3D12InfoQueue * This);
-
- UINT64 ( STDMETHODCALLTYPE *GetMessageCountLimit )(
- ID3D12InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *AddStorageFilterEntries )(
- ID3D12InfoQueue * This,
- _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
-
- HRESULT ( STDMETHODCALLTYPE *GetStorageFilter )(
- ID3D12InfoQueue * This,
- _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
- _Inout_ SIZE_T *pFilterByteLength);
-
- void ( STDMETHODCALLTYPE *ClearStorageFilter )(
- ID3D12InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushEmptyStorageFilter )(
- ID3D12InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushCopyOfStorageFilter )(
- ID3D12InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushStorageFilter )(
- ID3D12InfoQueue * This,
- _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
-
- void ( STDMETHODCALLTYPE *PopStorageFilter )(
- ID3D12InfoQueue * This);
-
- UINT ( STDMETHODCALLTYPE *GetStorageFilterStackSize )(
- ID3D12InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *AddRetrievalFilterEntries )(
- ID3D12InfoQueue * This,
- _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
-
- HRESULT ( STDMETHODCALLTYPE *GetRetrievalFilter )(
- ID3D12InfoQueue * This,
- _Out_writes_bytes_opt_(*pFilterByteLength) D3D12_INFO_QUEUE_FILTER *pFilter,
- _Inout_ SIZE_T *pFilterByteLength);
-
- void ( STDMETHODCALLTYPE *ClearRetrievalFilter )(
- ID3D12InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushEmptyRetrievalFilter )(
- ID3D12InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushCopyOfRetrievalFilter )(
- ID3D12InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *PushRetrievalFilter )(
- ID3D12InfoQueue * This,
- _In_ D3D12_INFO_QUEUE_FILTER *pFilter);
-
- void ( STDMETHODCALLTYPE *PopRetrievalFilter )(
- ID3D12InfoQueue * This);
-
- UINT ( STDMETHODCALLTYPE *GetRetrievalFilterStackSize )(
- ID3D12InfoQueue * This);
-
- HRESULT ( STDMETHODCALLTYPE *AddMessage )(
- ID3D12InfoQueue * This,
- _In_ D3D12_MESSAGE_CATEGORY Category,
- _In_ D3D12_MESSAGE_SEVERITY Severity,
- _In_ D3D12_MESSAGE_ID ID,
- _In_ LPCSTR pDescription);
-
- HRESULT ( STDMETHODCALLTYPE *AddApplicationMessage )(
- ID3D12InfoQueue * This,
- _In_ D3D12_MESSAGE_SEVERITY Severity,
- _In_ LPCSTR pDescription);
-
- HRESULT ( STDMETHODCALLTYPE *SetBreakOnCategory )(
- ID3D12InfoQueue * This,
- _In_ D3D12_MESSAGE_CATEGORY Category,
- _In_ BOOL bEnable);
-
- HRESULT ( STDMETHODCALLTYPE *SetBreakOnSeverity )(
- ID3D12InfoQueue * This,
- _In_ D3D12_MESSAGE_SEVERITY Severity,
- _In_ BOOL bEnable);
-
- HRESULT ( STDMETHODCALLTYPE *SetBreakOnID )(
- ID3D12InfoQueue * This,
- _In_ D3D12_MESSAGE_ID ID,
- _In_ BOOL bEnable);
-
- BOOL ( STDMETHODCALLTYPE *GetBreakOnCategory )(
- ID3D12InfoQueue * This,
- _In_ D3D12_MESSAGE_CATEGORY Category);
-
- BOOL ( STDMETHODCALLTYPE *GetBreakOnSeverity )(
- ID3D12InfoQueue * This,
- _In_ D3D12_MESSAGE_SEVERITY Severity);
-
- BOOL ( STDMETHODCALLTYPE *GetBreakOnID )(
- ID3D12InfoQueue * This,
- _In_ D3D12_MESSAGE_ID ID);
-
- void ( STDMETHODCALLTYPE *SetMuteDebugOutput )(
- ID3D12InfoQueue * This,
- _In_ BOOL bMute);
-
- BOOL ( STDMETHODCALLTYPE *GetMuteDebugOutput )(
- ID3D12InfoQueue * This);
-
- END_INTERFACE
- } ID3D12InfoQueueVtbl;
-
- interface ID3D12InfoQueue
- {
- CONST_VTBL struct ID3D12InfoQueueVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12InfoQueue_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12InfoQueue_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12InfoQueue_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12InfoQueue_SetMessageCountLimit(This,MessageCountLimit) \
- ( (This)->lpVtbl -> SetMessageCountLimit(This,MessageCountLimit) )
-
-#define ID3D12InfoQueue_ClearStoredMessages(This) \
- ( (This)->lpVtbl -> ClearStoredMessages(This) )
-
-#define ID3D12InfoQueue_GetMessage(This,MessageIndex,pMessage,pMessageByteLength) \
- ( (This)->lpVtbl -> GetMessage(This,MessageIndex,pMessage,pMessageByteLength) )
-
-#define ID3D12InfoQueue_GetNumMessagesAllowedByStorageFilter(This) \
- ( (This)->lpVtbl -> GetNumMessagesAllowedByStorageFilter(This) )
-
-#define ID3D12InfoQueue_GetNumMessagesDeniedByStorageFilter(This) \
- ( (This)->lpVtbl -> GetNumMessagesDeniedByStorageFilter(This) )
-
-#define ID3D12InfoQueue_GetNumStoredMessages(This) \
- ( (This)->lpVtbl -> GetNumStoredMessages(This) )
-
-#define ID3D12InfoQueue_GetNumStoredMessagesAllowedByRetrievalFilter(This) \
- ( (This)->lpVtbl -> GetNumStoredMessagesAllowedByRetrievalFilter(This) )
-
-#define ID3D12InfoQueue_GetNumMessagesDiscardedByMessageCountLimit(This) \
- ( (This)->lpVtbl -> GetNumMessagesDiscardedByMessageCountLimit(This) )
-
-#define ID3D12InfoQueue_GetMessageCountLimit(This) \
- ( (This)->lpVtbl -> GetMessageCountLimit(This) )
-
-#define ID3D12InfoQueue_AddStorageFilterEntries(This,pFilter) \
- ( (This)->lpVtbl -> AddStorageFilterEntries(This,pFilter) )
-
-#define ID3D12InfoQueue_GetStorageFilter(This,pFilter,pFilterByteLength) \
- ( (This)->lpVtbl -> GetStorageFilter(This,pFilter,pFilterByteLength) )
-
-#define ID3D12InfoQueue_ClearStorageFilter(This) \
- ( (This)->lpVtbl -> ClearStorageFilter(This) )
-
-#define ID3D12InfoQueue_PushEmptyStorageFilter(This) \
- ( (This)->lpVtbl -> PushEmptyStorageFilter(This) )
-
-#define ID3D12InfoQueue_PushCopyOfStorageFilter(This) \
- ( (This)->lpVtbl -> PushCopyOfStorageFilter(This) )
-
-#define ID3D12InfoQueue_PushStorageFilter(This,pFilter) \
- ( (This)->lpVtbl -> PushStorageFilter(This,pFilter) )
-
-#define ID3D12InfoQueue_PopStorageFilter(This) \
- ( (This)->lpVtbl -> PopStorageFilter(This) )
-
-#define ID3D12InfoQueue_GetStorageFilterStackSize(This) \
- ( (This)->lpVtbl -> GetStorageFilterStackSize(This) )
-
-#define ID3D12InfoQueue_AddRetrievalFilterEntries(This,pFilter) \
- ( (This)->lpVtbl -> AddRetrievalFilterEntries(This,pFilter) )
-
-#define ID3D12InfoQueue_GetRetrievalFilter(This,pFilter,pFilterByteLength) \
- ( (This)->lpVtbl -> GetRetrievalFilter(This,pFilter,pFilterByteLength) )
-
-#define ID3D12InfoQueue_ClearRetrievalFilter(This) \
- ( (This)->lpVtbl -> ClearRetrievalFilter(This) )
-
-#define ID3D12InfoQueue_PushEmptyRetrievalFilter(This) \
- ( (This)->lpVtbl -> PushEmptyRetrievalFilter(This) )
-
-#define ID3D12InfoQueue_PushCopyOfRetrievalFilter(This) \
- ( (This)->lpVtbl -> PushCopyOfRetrievalFilter(This) )
-
-#define ID3D12InfoQueue_PushRetrievalFilter(This,pFilter) \
- ( (This)->lpVtbl -> PushRetrievalFilter(This,pFilter) )
-
-#define ID3D12InfoQueue_PopRetrievalFilter(This) \
- ( (This)->lpVtbl -> PopRetrievalFilter(This) )
-
-#define ID3D12InfoQueue_GetRetrievalFilterStackSize(This) \
- ( (This)->lpVtbl -> GetRetrievalFilterStackSize(This) )
-
-#define ID3D12InfoQueue_AddMessage(This,Category,Severity,ID,pDescription) \
- ( (This)->lpVtbl -> AddMessage(This,Category,Severity,ID,pDescription) )
-
-#define ID3D12InfoQueue_AddApplicationMessage(This,Severity,pDescription) \
- ( (This)->lpVtbl -> AddApplicationMessage(This,Severity,pDescription) )
-
-#define ID3D12InfoQueue_SetBreakOnCategory(This,Category,bEnable) \
- ( (This)->lpVtbl -> SetBreakOnCategory(This,Category,bEnable) )
-
-#define ID3D12InfoQueue_SetBreakOnSeverity(This,Severity,bEnable) \
- ( (This)->lpVtbl -> SetBreakOnSeverity(This,Severity,bEnable) )
-
-#define ID3D12InfoQueue_SetBreakOnID(This,ID,bEnable) \
- ( (This)->lpVtbl -> SetBreakOnID(This,ID,bEnable) )
-
-#define ID3D12InfoQueue_GetBreakOnCategory(This,Category) \
- ( (This)->lpVtbl -> GetBreakOnCategory(This,Category) )
-
-#define ID3D12InfoQueue_GetBreakOnSeverity(This,Severity) \
- ( (This)->lpVtbl -> GetBreakOnSeverity(This,Severity) )
-
-#define ID3D12InfoQueue_GetBreakOnID(This,ID) \
- ( (This)->lpVtbl -> GetBreakOnID(This,ID) )
-
-#define ID3D12InfoQueue_SetMuteDebugOutput(This,bMute) \
- ( (This)->lpVtbl -> SetMuteDebugOutput(This,bMute) )
-
-#define ID3D12InfoQueue_GetMuteDebugOutput(This) \
- ( (This)->lpVtbl -> GetMuteDebugOutput(This) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12InfoQueue_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12sdklayers_0000_0013 */
-/* [local] */
-
-DEFINE_GUID(IID_ID3D12Debug,0x344488b7,0x6846,0x474b,0xb9,0x89,0xf0,0x27,0x44,0x82,0x45,0xe0);
-DEFINE_GUID(IID_ID3D12Debug1,0xaffaa4ca,0x63fe,0x4d8e,0xb8,0xad,0x15,0x90,0x00,0xaf,0x43,0x04);
-DEFINE_GUID(IID_ID3D12Debug2,0x93a665c4,0xa3b2,0x4e5d,0xb6,0x92,0xa2,0x6a,0xe1,0x4e,0x33,0x74);
-DEFINE_GUID(IID_ID3D12Debug3,0x5cf4e58f,0xf671,0x4ff1,0xa5,0x42,0x36,0x86,0xe3,0xd1,0x53,0xd1);
-DEFINE_GUID(IID_ID3D12DebugDevice1,0xa9b71770,0xd099,0x4a65,0xa6,0x98,0x3d,0xee,0x10,0x02,0x0f,0x88);
-DEFINE_GUID(IID_ID3D12DebugDevice,0x3febd6dd,0x4973,0x4787,0x81,0x94,0xe4,0x5f,0x9e,0x28,0x92,0x3e);
-DEFINE_GUID(IID_ID3D12DebugDevice2,0x60eccbc1,0x378d,0x4df1,0x89,0x4c,0xf8,0xac,0x5c,0xe4,0xd7,0xdd);
-DEFINE_GUID(IID_ID3D12DebugCommandQueue,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3a);
-DEFINE_GUID(IID_ID3D12DebugCommandList1,0x102ca951,0x311b,0x4b01,0xb1,0x1f,0xec,0xb8,0x3e,0x06,0x1b,0x37);
-DEFINE_GUID(IID_ID3D12DebugCommandList,0x09e0bf36,0x54ac,0x484f,0x88,0x47,0x4b,0xae,0xea,0xb6,0x05,0x3f);
-DEFINE_GUID(IID_ID3D12DebugCommandList2,0xaeb575cf,0x4e06,0x48be,0xba,0x3b,0xc4,0x50,0xfc,0x96,0x65,0x2e);
-DEFINE_GUID(IID_ID3D12SharingContract,0x0adf7d52,0x929c,0x4e61,0xad,0xdb,0xff,0xed,0x30,0xde,0x66,0xef);
-DEFINE_GUID(IID_ID3D12InfoQueue,0x0742a90b,0xc387,0x483f,0xb9,0x46,0x30,0xa7,0xe4,0xe6,0x14,0x58);
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0013_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12sdklayers_0000_0013_v0_0_s_ifspec;
-
-/* Additional Prototypes for ALL interfaces */
-
-/* end of Additional Prototypes */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12video.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12video.h
deleted file mode 100644
index c515f257d03..00000000000
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3d12video.h
+++ /dev/null
@@ -1,3352 +0,0 @@
-/*-------------------------------------------------------------------------------------
- *
- * Copyright (c) Microsoft Corporation
- *
- *-------------------------------------------------------------------------------------*/
-
-
-/* this ALWAYS GENERATED file contains the definitions for the interfaces */
-
-
- /* File created by MIDL compiler version 8.01.0622 */
-
-
-
-/* verify that the <rpcndr.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCNDR_H_VERSION__
-#define __REQUIRED_RPCNDR_H_VERSION__ 500
-#endif
-
-/* verify that the <rpcsal.h> version is high enough to compile this file*/
-#ifndef __REQUIRED_RPCSAL_H_VERSION__
-#define __REQUIRED_RPCSAL_H_VERSION__ 100
-#endif
-
-#include "rpc.h"
-#include "rpcndr.h"
-
-#ifndef __RPCNDR_H_VERSION__
-#error this stub requires an updated version of <rpcndr.h>
-#endif /* __RPCNDR_H_VERSION__ */
-
-#ifndef COM_NO_WINDOWS_H
-#include "windows.h"
-#include "ole2.h"
-#endif /*COM_NO_WINDOWS_H*/
-
-#ifndef __d3d12video_h__
-#define __d3d12video_h__
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-#pragma once
-#endif
-
-/* Forward Declarations */
-
-#ifndef __ID3D12VideoDecoderHeap_FWD_DEFINED__
-#define __ID3D12VideoDecoderHeap_FWD_DEFINED__
-typedef interface ID3D12VideoDecoderHeap ID3D12VideoDecoderHeap;
-
-#endif /* __ID3D12VideoDecoderHeap_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12VideoDevice_FWD_DEFINED__
-#define __ID3D12VideoDevice_FWD_DEFINED__
-typedef interface ID3D12VideoDevice ID3D12VideoDevice;
-
-#endif /* __ID3D12VideoDevice_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12VideoDecoder_FWD_DEFINED__
-#define __ID3D12VideoDecoder_FWD_DEFINED__
-typedef interface ID3D12VideoDecoder ID3D12VideoDecoder;
-
-#endif /* __ID3D12VideoDecoder_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12VideoProcessor_FWD_DEFINED__
-#define __ID3D12VideoProcessor_FWD_DEFINED__
-typedef interface ID3D12VideoProcessor ID3D12VideoProcessor;
-
-#endif /* __ID3D12VideoProcessor_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12VideoDecodeCommandList_FWD_DEFINED__
-#define __ID3D12VideoDecodeCommandList_FWD_DEFINED__
-typedef interface ID3D12VideoDecodeCommandList ID3D12VideoDecodeCommandList;
-
-#endif /* __ID3D12VideoDecodeCommandList_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12VideoProcessCommandList_FWD_DEFINED__
-#define __ID3D12VideoProcessCommandList_FWD_DEFINED__
-typedef interface ID3D12VideoProcessCommandList ID3D12VideoProcessCommandList;
-
-#endif /* __ID3D12VideoProcessCommandList_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12VideoDecodeCommandList1_FWD_DEFINED__
-#define __ID3D12VideoDecodeCommandList1_FWD_DEFINED__
-typedef interface ID3D12VideoDecodeCommandList1 ID3D12VideoDecodeCommandList1;
-
-#endif /* __ID3D12VideoDecodeCommandList1_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12VideoProcessCommandList1_FWD_DEFINED__
-#define __ID3D12VideoProcessCommandList1_FWD_DEFINED__
-typedef interface ID3D12VideoProcessCommandList1 ID3D12VideoProcessCommandList1;
-
-#endif /* __ID3D12VideoProcessCommandList1_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12VideoMotionEstimator_FWD_DEFINED__
-#define __ID3D12VideoMotionEstimator_FWD_DEFINED__
-typedef interface ID3D12VideoMotionEstimator ID3D12VideoMotionEstimator;
-
-#endif /* __ID3D12VideoMotionEstimator_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12VideoMotionVectorHeap_FWD_DEFINED__
-#define __ID3D12VideoMotionVectorHeap_FWD_DEFINED__
-typedef interface ID3D12VideoMotionVectorHeap ID3D12VideoMotionVectorHeap;
-
-#endif /* __ID3D12VideoMotionVectorHeap_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12VideoDevice1_FWD_DEFINED__
-#define __ID3D12VideoDevice1_FWD_DEFINED__
-typedef interface ID3D12VideoDevice1 ID3D12VideoDevice1;
-
-#endif /* __ID3D12VideoDevice1_FWD_DEFINED__ */
-
-
-#ifndef __ID3D12VideoEncodeCommandList_FWD_DEFINED__
-#define __ID3D12VideoEncodeCommandList_FWD_DEFINED__
-typedef interface ID3D12VideoEncodeCommandList ID3D12VideoEncodeCommandList;
-
-#endif /* __ID3D12VideoEncodeCommandList_FWD_DEFINED__ */
-
-
-/* header files for imported files */
-#include "oaidl.h"
-#include "ocidl.h"
-#include "dxgicommon.h"
-#include "d3d12.h"
-
-#ifdef __cplusplus
-extern "C"{
-#endif
-
-
-/* interface __MIDL_itf_d3d12video_0000_0000 */
-/* [local] */
-
-typedef
-enum D3D12_VIDEO_FIELD_TYPE
- {
- D3D12_VIDEO_FIELD_TYPE_NONE = 0,
- D3D12_VIDEO_FIELD_TYPE_INTERLACED_TOP_FIELD_FIRST = 1,
- D3D12_VIDEO_FIELD_TYPE_INTERLACED_BOTTOM_FIELD_FIRST = 2
- } D3D12_VIDEO_FIELD_TYPE;
-
-typedef
-enum D3D12_VIDEO_FRAME_STEREO_FORMAT
- {
- D3D12_VIDEO_FRAME_STEREO_FORMAT_NONE = 0,
- D3D12_VIDEO_FRAME_STEREO_FORMAT_MONO = 1,
- D3D12_VIDEO_FRAME_STEREO_FORMAT_HORIZONTAL = 2,
- D3D12_VIDEO_FRAME_STEREO_FORMAT_VERTICAL = 3,
- D3D12_VIDEO_FRAME_STEREO_FORMAT_SEPARATE = 4
- } D3D12_VIDEO_FRAME_STEREO_FORMAT;
-
-typedef struct D3D12_VIDEO_FORMAT
- {
- DXGI_FORMAT Format;
- DXGI_COLOR_SPACE_TYPE ColorSpace;
- } D3D12_VIDEO_FORMAT;
-
-typedef struct D3D12_VIDEO_SAMPLE
- {
- UINT Width;
- UINT Height;
- D3D12_VIDEO_FORMAT Format;
- } D3D12_VIDEO_SAMPLE;
-
-typedef
-enum D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE
- {
- D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_NONE = 0,
- D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE_FIELD_BASED = 1
- } D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE;
-
-typedef
-enum D3D12_FEATURE_VIDEO
- {
- D3D12_FEATURE_VIDEO_DECODE_SUPPORT = 0,
- D3D12_FEATURE_VIDEO_DECODE_PROFILES = 1,
- D3D12_FEATURE_VIDEO_DECODE_FORMATS = 2,
- D3D12_FEATURE_VIDEO_DECODE_CONVERSION_SUPPORT = 3,
- D3D12_FEATURE_VIDEO_PROCESS_SUPPORT = 5,
- D3D12_FEATURE_VIDEO_PROCESS_MAX_INPUT_STREAMS = 6,
- D3D12_FEATURE_VIDEO_PROCESS_REFERENCE_INFO = 7,
- D3D12_FEATURE_VIDEO_DECODER_HEAP_SIZE = 8,
- D3D12_FEATURE_VIDEO_PROCESSOR_SIZE = 9,
- D3D12_FEATURE_VIDEO_DECODE_PROFILE_COUNT = 10,
- D3D12_FEATURE_VIDEO_DECODE_FORMAT_COUNT = 11,
- D3D12_FEATURE_VIDEO_ARCHITECTURE = 17,
- D3D12_FEATURE_VIDEO_DECODE_HISTOGRAM = 18,
- D3D12_FEATURE_VIDEO_FEATURE_AREA_SUPPORT = 19,
- D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR = 20,
- D3D12_FEATURE_VIDEO_MOTION_ESTIMATOR_SIZE = 21
- } D3D12_FEATURE_VIDEO;
-
-typedef
-enum D3D12_BITSTREAM_ENCRYPTION_TYPE
- {
- D3D12_BITSTREAM_ENCRYPTION_TYPE_NONE = 0
- } D3D12_BITSTREAM_ENCRYPTION_TYPE;
-
-typedef struct D3D12_VIDEO_DECODE_CONFIGURATION
- {
- GUID DecodeProfile;
- D3D12_BITSTREAM_ENCRYPTION_TYPE BitstreamEncryption;
- D3D12_VIDEO_FRAME_CODED_INTERLACE_TYPE InterlaceType;
- } D3D12_VIDEO_DECODE_CONFIGURATION;
-
-typedef struct D3D12_VIDEO_DECODER_DESC
- {
- UINT NodeMask;
- D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
- } D3D12_VIDEO_DECODER_DESC;
-
-typedef struct D3D12_VIDEO_DECODER_HEAP_DESC
- {
- UINT NodeMask;
- D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
- UINT DecodeWidth;
- UINT DecodeHeight;
- DXGI_FORMAT Format;
- DXGI_RATIONAL FrameRate;
- UINT BitRate;
- UINT MaxDecodePictureBufferCount;
- } D3D12_VIDEO_DECODER_HEAP_DESC;
-
-typedef struct D3D12_VIDEO_SIZE_RANGE
- {
- UINT MaxWidth;
- UINT MaxHeight;
- UINT MinWidth;
- UINT MinHeight;
- } D3D12_VIDEO_SIZE_RANGE;
-
-typedef
-enum D3D12_VIDEO_PROCESS_FILTER
- {
- D3D12_VIDEO_PROCESS_FILTER_BRIGHTNESS = 0,
- D3D12_VIDEO_PROCESS_FILTER_CONTRAST = 1,
- D3D12_VIDEO_PROCESS_FILTER_HUE = 2,
- D3D12_VIDEO_PROCESS_FILTER_SATURATION = 3,
- D3D12_VIDEO_PROCESS_FILTER_NOISE_REDUCTION = 4,
- D3D12_VIDEO_PROCESS_FILTER_EDGE_ENHANCEMENT = 5,
- D3D12_VIDEO_PROCESS_FILTER_ANAMORPHIC_SCALING = 6,
- D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT = 7
- } D3D12_VIDEO_PROCESS_FILTER;
-
-typedef
-enum D3D12_VIDEO_PROCESS_FILTER_FLAGS
- {
- D3D12_VIDEO_PROCESS_FILTER_FLAG_NONE = 0,
- D3D12_VIDEO_PROCESS_FILTER_FLAG_BRIGHTNESS = ( 1 << D3D12_VIDEO_PROCESS_FILTER_BRIGHTNESS ) ,
- D3D12_VIDEO_PROCESS_FILTER_FLAG_CONTRAST = ( 1 << D3D12_VIDEO_PROCESS_FILTER_CONTRAST ) ,
- D3D12_VIDEO_PROCESS_FILTER_FLAG_HUE = ( 1 << D3D12_VIDEO_PROCESS_FILTER_HUE ) ,
- D3D12_VIDEO_PROCESS_FILTER_FLAG_SATURATION = ( 1 << D3D12_VIDEO_PROCESS_FILTER_SATURATION ) ,
- D3D12_VIDEO_PROCESS_FILTER_FLAG_NOISE_REDUCTION = ( 1 << D3D12_VIDEO_PROCESS_FILTER_NOISE_REDUCTION ) ,
- D3D12_VIDEO_PROCESS_FILTER_FLAG_EDGE_ENHANCEMENT = ( 1 << D3D12_VIDEO_PROCESS_FILTER_EDGE_ENHANCEMENT ) ,
- D3D12_VIDEO_PROCESS_FILTER_FLAG_ANAMORPHIC_SCALING = ( 1 << D3D12_VIDEO_PROCESS_FILTER_ANAMORPHIC_SCALING ) ,
- D3D12_VIDEO_PROCESS_FILTER_FLAG_STEREO_ADJUSTMENT = ( 1 << D3D12_VIDEO_PROCESS_FILTER_STEREO_ADJUSTMENT )
- } D3D12_VIDEO_PROCESS_FILTER_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FILTER_FLAGS );
-typedef
-enum D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS
- {
- D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_NONE = 0,
- D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_BOB = 0x1,
- D3D12_VIDEO_PROCESS_DEINTERLACE_FLAG_CUSTOM = 0x80000000
- } D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS );
-typedef struct D3D12_VIDEO_PROCESS_ALPHA_BLENDING
- {
- BOOL Enable;
- FLOAT Alpha;
- } D3D12_VIDEO_PROCESS_ALPHA_BLENDING;
-
-typedef struct D3D12_VIDEO_PROCESS_LUMA_KEY
- {
- BOOL Enable;
- FLOAT Lower;
- FLOAT Upper;
- } D3D12_VIDEO_PROCESS_LUMA_KEY;
-
-typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC
- {
- DXGI_FORMAT Format;
- DXGI_COLOR_SPACE_TYPE ColorSpace;
- DXGI_RATIONAL SourceAspectRatio;
- DXGI_RATIONAL DestinationAspectRatio;
- DXGI_RATIONAL FrameRate;
- D3D12_VIDEO_SIZE_RANGE SourceSizeRange;
- D3D12_VIDEO_SIZE_RANGE DestinationSizeRange;
- BOOL EnableOrientation;
- D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterFlags;
- D3D12_VIDEO_FRAME_STEREO_FORMAT StereoFormat;
- D3D12_VIDEO_FIELD_TYPE FieldType;
- D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode;
- BOOL EnableAlphaBlending;
- D3D12_VIDEO_PROCESS_LUMA_KEY LumaKey;
- UINT NumPastFrames;
- UINT NumFutureFrames;
- BOOL EnableAutoProcessing;
- } D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC;
-
-typedef
-enum D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE
- {
- D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_OPAQUE = 0,
- D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_BACKGROUND = 1,
- D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_DESTINATION = 2,
- D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE_SOURCE_STREAM = 3
- } D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE;
-
-typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC
- {
- DXGI_FORMAT Format;
- DXGI_COLOR_SPACE_TYPE ColorSpace;
- D3D12_VIDEO_PROCESS_ALPHA_FILL_MODE AlphaFillMode;
- UINT AlphaFillModeSourceStreamIndex;
- FLOAT BackgroundColor[ 4 ];
- DXGI_RATIONAL FrameRate;
- BOOL EnableStereo;
- } D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0000_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0000_v0_0_s_ifspec;
-
-#ifndef __ID3D12VideoDecoderHeap_INTERFACE_DEFINED__
-#define __ID3D12VideoDecoderHeap_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoDecoderHeap */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoDecoderHeap;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("0946B7C9-EBF6-4047-BB73-8683E27DBB1F")
- ID3D12VideoDecoderHeap : public ID3D12Pageable
- {
- public:
- virtual D3D12_VIDEO_DECODER_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoDecoderHeapVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoDecoderHeap * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoDecoderHeap * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoDecoderHeap * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12VideoDecoderHeap * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12VideoDecoderHeap * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12VideoDecoderHeap * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12VideoDecoderHeap * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12VideoDecoderHeap * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- D3D12_VIDEO_DECODER_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )(
- ID3D12VideoDecoderHeap * This);
-
- END_INTERFACE
- } ID3D12VideoDecoderHeapVtbl;
-
- interface ID3D12VideoDecoderHeap
- {
- CONST_VTBL struct ID3D12VideoDecoderHeapVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoDecoderHeap_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoDecoderHeap_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoDecoderHeap_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoDecoderHeap_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12VideoDecoderHeap_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12VideoDecoderHeap_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12VideoDecoderHeap_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12VideoDecoderHeap_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-
-#define ID3D12VideoDecoderHeap_GetDesc(This) \
- ( (This)->lpVtbl -> GetDesc(This) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-
-
-
-
-#endif /* __ID3D12VideoDecoderHeap_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12VideoDevice_INTERFACE_DEFINED__
-#define __ID3D12VideoDevice_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoDevice */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoDevice;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("1F052807-0B46-4ACC-8A89-364F793718A4")
- ID3D12VideoDevice : public IUnknown
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE CheckFeatureSupport(
- D3D12_FEATURE_VIDEO FeatureVideo,
- _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
- UINT FeatureSupportDataSize) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoder(
- _In_ const D3D12_VIDEO_DECODER_DESC *pDesc,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppVideoDecoder) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE CreateVideoDecoderHeap(
- _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppVideoDecoderHeap) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE CreateVideoProcessor(
- UINT NodeMask,
- _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc,
- UINT NumInputStreamDescs,
- _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppVideoProcessor) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoDeviceVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoDevice * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoDevice * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoDevice * This);
-
- HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
- ID3D12VideoDevice * This,
- D3D12_FEATURE_VIDEO FeatureVideo,
- _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
- UINT FeatureSupportDataSize);
-
- HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )(
- ID3D12VideoDevice * This,
- _In_ const D3D12_VIDEO_DECODER_DESC *pDesc,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppVideoDecoder);
-
- HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )(
- ID3D12VideoDevice * This,
- _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppVideoDecoderHeap);
-
- HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )(
- ID3D12VideoDevice * This,
- UINT NodeMask,
- _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc,
- UINT NumInputStreamDescs,
- _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppVideoProcessor);
-
- END_INTERFACE
- } ID3D12VideoDeviceVtbl;
-
- interface ID3D12VideoDevice
- {
- CONST_VTBL struct ID3D12VideoDeviceVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoDevice_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoDevice_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoDevice_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoDevice_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \
- ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) )
-
-#define ID3D12VideoDevice_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \
- ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) )
-
-#define ID3D12VideoDevice_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \
- ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) )
-
-#define ID3D12VideoDevice_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \
- ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12VideoDevice_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12VideoDecoder_INTERFACE_DEFINED__
-#define __ID3D12VideoDecoder_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoDecoder */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoDecoder;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("C59B6BDC-7720-4074-A136-17A156037470")
- ID3D12VideoDecoder : public ID3D12Pageable
- {
- public:
- virtual D3D12_VIDEO_DECODER_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoDecoderVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoDecoder * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoDecoder * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoDecoder * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12VideoDecoder * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12VideoDecoder * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12VideoDecoder * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12VideoDecoder * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12VideoDecoder * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- D3D12_VIDEO_DECODER_DESC ( STDMETHODCALLTYPE *GetDesc )(
- ID3D12VideoDecoder * This);
-
- END_INTERFACE
- } ID3D12VideoDecoderVtbl;
-
- interface ID3D12VideoDecoder
- {
- CONST_VTBL struct ID3D12VideoDecoderVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoDecoder_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoDecoder_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoDecoder_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoDecoder_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12VideoDecoder_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12VideoDecoder_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12VideoDecoder_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12VideoDecoder_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-
-#define ID3D12VideoDecoder_GetDesc(This) \
- ( (This)->lpVtbl -> GetDesc(This) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-
-
-
-
-#endif /* __ID3D12VideoDecoder_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12video_0000_0003 */
-/* [local] */
-
-typedef
-enum D3D12_VIDEO_DECODE_TIER
- {
- D3D12_VIDEO_DECODE_TIER_NOT_SUPPORTED = 0,
- D3D12_VIDEO_DECODE_TIER_1 = 1,
- D3D12_VIDEO_DECODE_TIER_2 = 2,
- D3D12_VIDEO_DECODE_TIER_3 = 3
- } D3D12_VIDEO_DECODE_TIER;
-
-typedef
-enum D3D12_VIDEO_DECODE_SUPPORT_FLAGS
- {
- D3D12_VIDEO_DECODE_SUPPORT_FLAG_NONE = 0,
- D3D12_VIDEO_DECODE_SUPPORT_FLAG_SUPPORTED = 0x1
- } D3D12_VIDEO_DECODE_SUPPORT_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_SUPPORT_FLAGS );
-typedef
-enum D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS
- {
- D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_NONE = 0,
- D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_HEIGHT_ALIGNMENT_MULTIPLE_32_REQUIRED = 0x1,
- D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_POST_PROCESSING_SUPPORTED = 0x2,
- D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_REFERENCE_ONLY_ALLOCATIONS_REQUIRED = 0x4,
- D3D12_VIDEO_DECODE_CONFIGURATION_FLAG_ALLOW_RESOLUTION_CHANGE_ON_NON_KEY_FRAME = 0x8
- } D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS );
-typedef
-enum D3D12_VIDEO_DECODE_STATUS
- {
- D3D12_VIDEO_DECODE_STATUS_OK = 0,
- D3D12_VIDEO_DECODE_STATUS_CONTINUE = 1,
- D3D12_VIDEO_DECODE_STATUS_CONTINUE_SKIP_DISPLAY = 2,
- D3D12_VIDEO_DECODE_STATUS_RESTART = 3
- } D3D12_VIDEO_DECODE_STATUS;
-
-typedef
-enum D3D12_VIDEO_DECODE_ARGUMENT_TYPE
- {
- D3D12_VIDEO_DECODE_ARGUMENT_TYPE_PICTURE_PARAMETERS = 0,
- D3D12_VIDEO_DECODE_ARGUMENT_TYPE_INVERSE_QUANTIZATION_MATRIX = 1,
- D3D12_VIDEO_DECODE_ARGUMENT_TYPE_SLICE_CONTROL = 2,
- D3D12_VIDEO_DECODE_ARGUMENT_TYPE_MAX_VALID = 3
- } D3D12_VIDEO_DECODE_ARGUMENT_TYPE;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT
- {
- UINT NodeIndex;
- D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
- UINT Width;
- UINT Height;
- DXGI_FORMAT DecodeFormat;
- DXGI_RATIONAL FrameRate;
- UINT BitRate;
- D3D12_VIDEO_DECODE_SUPPORT_FLAGS SupportFlags;
- D3D12_VIDEO_DECODE_CONFIGURATION_FLAGS ConfigurationFlags;
- D3D12_VIDEO_DECODE_TIER DecodeTier;
- } D3D12_FEATURE_DATA_VIDEO_DECODE_SUPPORT;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT
- {
- UINT NodeIndex;
- UINT ProfileCount;
- } D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILE_COUNT;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES
- {
- UINT NodeIndex;
- UINT ProfileCount;
- _Field_size_full_(ProfileCount) GUID *pProfiles;
- } D3D12_FEATURE_DATA_VIDEO_DECODE_PROFILES;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT
- {
- UINT NodeIndex;
- D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
- UINT FormatCount;
- } D3D12_FEATURE_DATA_VIDEO_DECODE_FORMAT_COUNT;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS
- {
- UINT NodeIndex;
- D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
- UINT FormatCount;
- _Field_size_full_(FormatCount) DXGI_FORMAT *pOutputFormats;
- } D3D12_FEATURE_DATA_VIDEO_DECODE_FORMATS;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_ARCHITECTURE
- {
- BOOL IOCoherent;
- } D3D12_FEATURE_DATA_VIDEO_ARCHITECTURE;
-
-typedef
-enum D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT
- {
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_Y = 0,
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_U = 1,
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_V = 2,
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_R = 0,
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_G = 1,
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_B = 2,
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_A = 3
- } D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT;
-
-typedef
-enum D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS
- {
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_NONE = 0,
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_Y = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_Y ) ,
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_U = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_U ) ,
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_V = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_V ) ,
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_R = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_R ) ,
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_G = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_G ) ,
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_B = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_B ) ,
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAG_A = ( 1 << D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_A )
- } D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS );
-typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM
- {
- UINT NodeIndex;
- GUID DecodeProfile;
- UINT Width;
- UINT Height;
- DXGI_FORMAT DecodeFormat;
- D3D12_VIDEO_DECODE_HISTOGRAM_COMPONENT_FLAGS Components;
- UINT BinCount;
- UINT CounterBitDepth;
- } D3D12_FEATURE_DATA_VIDEO_DECODE_HISTOGRAM;
-
-typedef
-enum D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS
- {
- D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAG_NONE = 0,
- D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAG_SUPPORTED = 0x1
- } D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS );
-typedef
-enum D3D12_VIDEO_SCALE_SUPPORT_FLAGS
- {
- D3D12_VIDEO_SCALE_SUPPORT_FLAG_NONE = 0,
- D3D12_VIDEO_SCALE_SUPPORT_FLAG_POW2_ONLY = 0x1,
- D3D12_VIDEO_SCALE_SUPPORT_FLAG_EVEN_DIMENSIONS_ONLY = 0x2
- } D3D12_VIDEO_SCALE_SUPPORT_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_SCALE_SUPPORT_FLAGS );
-typedef struct D3D12_VIDEO_SCALE_SUPPORT
- {
- D3D12_VIDEO_SIZE_RANGE OutputSizeRange;
- D3D12_VIDEO_SCALE_SUPPORT_FLAGS Flags;
- } D3D12_VIDEO_SCALE_SUPPORT;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT
- {
- UINT NodeIndex;
- D3D12_VIDEO_DECODE_CONFIGURATION Configuration;
- D3D12_VIDEO_SAMPLE DecodeSample;
- D3D12_VIDEO_FORMAT OutputFormat;
- DXGI_RATIONAL FrameRate;
- UINT BitRate;
- D3D12_VIDEO_DECODE_CONVERSION_SUPPORT_FLAGS SupportFlags;
- D3D12_VIDEO_SCALE_SUPPORT ScaleSupport;
- } D3D12_FEATURE_DATA_VIDEO_DECODE_CONVERSION_SUPPORT;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE
- {
- D3D12_VIDEO_DECODER_HEAP_DESC VideoDecoderHeapDesc;
- UINT64 MemoryPoolL0Size;
- UINT64 MemoryPoolL1Size;
- } D3D12_FEATURE_DATA_VIDEO_DECODER_HEAP_SIZE;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE
- {
- UINT NodeMask;
- const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc;
- UINT NumInputStreamDescs;
- const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs;
- UINT64 MemoryPoolL0Size;
- UINT64 MemoryPoolL1Size;
- } D3D12_FEATURE_DATA_VIDEO_PROCESSOR_SIZE;
-
-typedef struct D3D12_QUERY_DATA_VIDEO_DECODE_STATISTICS
- {
- UINT64 Status;
- UINT64 NumMacroblocksAffected;
- DXGI_RATIONAL FrameRate;
- UINT BitRate;
- } D3D12_QUERY_DATA_VIDEO_DECODE_STATISTICS;
-
-typedef struct D3D12_VIDEO_DECODE_SUB_SAMPLE_MAPPING_BLOCK
- {
- UINT ClearSize;
- UINT EncryptedSize;
- } D3D12_VIDEO_DECODE_SUB_SAMPLE_MAPPING_BLOCK;
-
-typedef struct D3D12_VIDEO_DECODE_FRAME_ARGUMENT
- {
- D3D12_VIDEO_DECODE_ARGUMENT_TYPE Type;
- UINT Size;
- _Field_size_bytes_full_(Size) void *pData;
- } D3D12_VIDEO_DECODE_FRAME_ARGUMENT;
-
-typedef struct D3D12_VIDEO_DECODE_REFERENCE_FRAMES
- {
- UINT NumTexture2Ds;
- _Field_size_full_(NumTexture2Ds) ID3D12Resource **ppTexture2Ds;
- _Field_size_full_(NumTexture2Ds) UINT *pSubresources;
- _Field_size_full_opt_(NumTexture2Ds) ID3D12VideoDecoderHeap **ppHeaps;
- } D3D12_VIDEO_DECODE_REFERENCE_FRAMES;
-
-typedef struct D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM
- {
- ID3D12Resource *pBuffer;
- UINT64 Offset;
- UINT64 Size;
- } D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM;
-
-typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS
- {
- BOOL Enable;
- ID3D12Resource *pReferenceTexture2D;
- UINT ReferenceSubresource;
- DXGI_COLOR_SPACE_TYPE OutputColorSpace;
- DXGI_COLOR_SPACE_TYPE DecodeColorSpace;
- } D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS;
-
-typedef struct D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS
- {
- UINT NumFrameArguments;
- D3D12_VIDEO_DECODE_FRAME_ARGUMENT FrameArguments[ 10 ];
- D3D12_VIDEO_DECODE_REFERENCE_FRAMES ReferenceFrames;
- D3D12_VIDEO_DECODE_COMPRESSED_BITSTREAM CompressedBitstream;
- ID3D12VideoDecoderHeap *pHeap;
- } D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS;
-
-typedef struct D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS
- {
- ID3D12Resource *pOutputTexture2D;
- UINT OutputSubresource;
- D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS ConversionArguments;
- } D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0003_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0003_v0_0_s_ifspec;
-
-#ifndef __ID3D12VideoProcessor_INTERFACE_DEFINED__
-#define __ID3D12VideoProcessor_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoProcessor */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoProcessor;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("304FDB32-BEDE-410A-8545-943AC6A46138")
- ID3D12VideoProcessor : public ID3D12Pageable
- {
- public:
- virtual UINT STDMETHODCALLTYPE GetNodeMask( void) = 0;
-
- virtual UINT STDMETHODCALLTYPE GetNumInputStreamDescs( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetInputStreamDescs(
- UINT NumInputStreamDescs,
- _Out_writes_(NumInputStreamDescs) D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs) = 0;
-
- virtual D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC STDMETHODCALLTYPE GetOutputStreamDesc( void) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoProcessorVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoProcessor * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoProcessor * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoProcessor * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12VideoProcessor * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12VideoProcessor * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12VideoProcessor * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12VideoProcessor * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12VideoProcessor * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- UINT ( STDMETHODCALLTYPE *GetNodeMask )(
- ID3D12VideoProcessor * This);
-
- UINT ( STDMETHODCALLTYPE *GetNumInputStreamDescs )(
- ID3D12VideoProcessor * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetInputStreamDescs )(
- ID3D12VideoProcessor * This,
- UINT NumInputStreamDescs,
- _Out_writes_(NumInputStreamDescs) D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs);
-
- D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC ( STDMETHODCALLTYPE *GetOutputStreamDesc )(
- ID3D12VideoProcessor * This);
-
- END_INTERFACE
- } ID3D12VideoProcessorVtbl;
-
- interface ID3D12VideoProcessor
- {
- CONST_VTBL struct ID3D12VideoProcessorVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoProcessor_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoProcessor_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoProcessor_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoProcessor_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12VideoProcessor_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12VideoProcessor_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12VideoProcessor_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12VideoProcessor_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-
-#define ID3D12VideoProcessor_GetNodeMask(This) \
- ( (This)->lpVtbl -> GetNodeMask(This) )
-
-#define ID3D12VideoProcessor_GetNumInputStreamDescs(This) \
- ( (This)->lpVtbl -> GetNumInputStreamDescs(This) )
-
-#define ID3D12VideoProcessor_GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) \
- ( (This)->lpVtbl -> GetInputStreamDescs(This,NumInputStreamDescs,pInputStreamDescs) )
-
-#define ID3D12VideoProcessor_GetOutputStreamDesc(This) \
- ( (This)->lpVtbl -> GetOutputStreamDesc(This) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-
-
-
-
-#endif /* __ID3D12VideoProcessor_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12video_0000_0004 */
-/* [local] */
-
-typedef
-enum D3D12_VIDEO_PROCESS_FEATURE_FLAGS
- {
- D3D12_VIDEO_PROCESS_FEATURE_FLAG_NONE = 0,
- D3D12_VIDEO_PROCESS_FEATURE_FLAG_ALPHA_FILL = 0x1,
- D3D12_VIDEO_PROCESS_FEATURE_FLAG_LUMA_KEY = 0x2,
- D3D12_VIDEO_PROCESS_FEATURE_FLAG_STEREO = 0x4,
- D3D12_VIDEO_PROCESS_FEATURE_FLAG_ROTATION = 0x8,
- D3D12_VIDEO_PROCESS_FEATURE_FLAG_FLIP = 0x10,
- D3D12_VIDEO_PROCESS_FEATURE_FLAG_ALPHA_BLENDING = 0x20,
- D3D12_VIDEO_PROCESS_FEATURE_FLAG_PIXEL_ASPECT_RATIO = 0x40
- } D3D12_VIDEO_PROCESS_FEATURE_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_FEATURE_FLAGS );
-typedef
-enum D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS
- {
- D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_NONE = 0,
- D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_DENOISE = 0x1,
- D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_DERINGING = 0x2,
- D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_EDGE_ENHANCEMENT = 0x4,
- D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_COLOR_CORRECTION = 0x8,
- D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_FLESH_TONE_MAPPING = 0x10,
- D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_IMAGE_STABILIZATION = 0x20,
- D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_SUPER_RESOLUTION = 0x40,
- D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_ANAMORPHIC_SCALING = 0x80,
- D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAG_CUSTOM = 0x80000000
- } D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS );
-typedef
-enum D3D12_VIDEO_PROCESS_ORIENTATION
- {
- D3D12_VIDEO_PROCESS_ORIENTATION_DEFAULT = 0,
- D3D12_VIDEO_PROCESS_ORIENTATION_FLIP_HORIZONTAL = 1,
- D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_90 = 2,
- D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_90_FLIP_HORIZONTAL = 3,
- D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_180 = 4,
- D3D12_VIDEO_PROCESS_ORIENTATION_FLIP_VERTICAL = 5,
- D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_270 = 6,
- D3D12_VIDEO_PROCESS_ORIENTATION_CLOCKWISE_270_FLIP_HORIZONTAL = 7
- } D3D12_VIDEO_PROCESS_ORIENTATION;
-
-typedef
-enum D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS
- {
- D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_NONE = 0,
- D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_FRAME_DISCONTINUITY = 0x1,
- D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAG_FRAME_REPEAT = 0x2
- } D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS );
-typedef struct D3D12_VIDEO_PROCESS_FILTER_RANGE
- {
- INT Minimum;
- INT Maximum;
- INT Default;
- FLOAT Multiplier;
- } D3D12_VIDEO_PROCESS_FILTER_RANGE;
-
-typedef
-enum D3D12_VIDEO_PROCESS_SUPPORT_FLAGS
- {
- D3D12_VIDEO_PROCESS_SUPPORT_FLAG_NONE = 0,
- D3D12_VIDEO_PROCESS_SUPPORT_FLAG_SUPPORTED = 0x1
- } D3D12_VIDEO_PROCESS_SUPPORT_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS(D3D12_VIDEO_PROCESS_SUPPORT_FLAGS );
-typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT
- {
- UINT NodeIndex;
- D3D12_VIDEO_SAMPLE InputSample;
- D3D12_VIDEO_FIELD_TYPE InputFieldType;
- D3D12_VIDEO_FRAME_STEREO_FORMAT InputStereoFormat;
- DXGI_RATIONAL InputFrameRate;
- D3D12_VIDEO_FORMAT OutputFormat;
- D3D12_VIDEO_FRAME_STEREO_FORMAT OutputStereoFormat;
- DXGI_RATIONAL OutputFrameRate;
- D3D12_VIDEO_PROCESS_SUPPORT_FLAGS SupportFlags;
- D3D12_VIDEO_SCALE_SUPPORT ScaleSupport;
- D3D12_VIDEO_PROCESS_FEATURE_FLAGS FeatureSupport;
- D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceSupport;
- D3D12_VIDEO_PROCESS_AUTO_PROCESSING_FLAGS AutoProcessingSupport;
- D3D12_VIDEO_PROCESS_FILTER_FLAGS FilterSupport;
- D3D12_VIDEO_PROCESS_FILTER_RANGE FilterRangeSupport[ 32 ];
- } D3D12_FEATURE_DATA_VIDEO_PROCESS_SUPPORT;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_MAX_INPUT_STREAMS
- {
- UINT NodeIndex;
- UINT MaxInputStreams;
- } D3D12_FEATURE_DATA_VIDEO_PROCESS_MAX_INPUT_STREAMS;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_PROCESS_REFERENCE_INFO
- {
- UINT NodeIndex;
- D3D12_VIDEO_PROCESS_DEINTERLACE_FLAGS DeinterlaceMode;
- D3D12_VIDEO_PROCESS_FILTER_FLAGS Filters;
- D3D12_VIDEO_PROCESS_FEATURE_FLAGS FeatureSupport;
- DXGI_RATIONAL InputFrameRate;
- DXGI_RATIONAL OutputFrameRate;
- BOOL EnableAutoProcessing;
- UINT PastFrames;
- UINT FutureFrames;
- } D3D12_FEATURE_DATA_VIDEO_PROCESS_REFERENCE_INFO;
-
-typedef struct D3D12_VIDEO_PROCESS_REFERENCE_SET
- {
- UINT NumPastFrames;
- ID3D12Resource **ppPastFrames;
- UINT *pPastSubresources;
- UINT NumFutureFrames;
- ID3D12Resource **ppFutureFrames;
- UINT *pFutureSubresources;
- } D3D12_VIDEO_PROCESS_REFERENCE_SET;
-
-typedef struct D3D12_VIDEO_PROCESS_TRANSFORM
- {
- D3D12_RECT SourceRectangle;
- D3D12_RECT DestinationRectangle;
- D3D12_VIDEO_PROCESS_ORIENTATION Orientation;
- } D3D12_VIDEO_PROCESS_TRANSFORM;
-
-typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE
- {
- UINT OutputIndex;
- UINT InputFrameOrField;
- } D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE;
-
-typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM
- {
- ID3D12Resource *pTexture2D;
- UINT Subresource;
- D3D12_VIDEO_PROCESS_REFERENCE_SET ReferenceSet;
- } D3D12_VIDEO_PROCESS_INPUT_STREAM;
-
-typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS
- {
- D3D12_VIDEO_PROCESS_INPUT_STREAM InputStream[ 2 ];
- D3D12_VIDEO_PROCESS_TRANSFORM Transform;
- D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS Flags;
- D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE RateInfo;
- INT FilterLevels[ 32 ];
- D3D12_VIDEO_PROCESS_ALPHA_BLENDING AlphaBlending;
- } D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS;
-
-typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM
- {
- ID3D12Resource *pTexture2D;
- UINT Subresource;
- } D3D12_VIDEO_PROCESS_OUTPUT_STREAM;
-
-typedef struct D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS
- {
- D3D12_VIDEO_PROCESS_OUTPUT_STREAM OutputStream[ 2 ];
- D3D12_RECT TargetRectangle;
- } D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0004_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0004_v0_0_s_ifspec;
-
-#ifndef __ID3D12VideoDecodeCommandList_INTERFACE_DEFINED__
-#define __ID3D12VideoDecodeCommandList_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoDecodeCommandList */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoDecodeCommandList;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("3B60536E-AD29-4E64-A269-F853837E5E53")
- ID3D12VideoDecodeCommandList : public ID3D12CommandList
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE Close( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE Reset(
- _In_ ID3D12CommandAllocator *pAllocator) = 0;
-
- virtual void STDMETHODCALLTYPE ClearState( void) = 0;
-
- virtual void STDMETHODCALLTYPE ResourceBarrier(
- _In_ UINT NumBarriers,
- _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0;
-
- virtual void STDMETHODCALLTYPE DiscardResource(
- _In_ ID3D12Resource *pResource,
- _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0;
-
- virtual void STDMETHODCALLTYPE BeginQuery(
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index) = 0;
-
- virtual void STDMETHODCALLTYPE EndQuery(
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index) = 0;
-
- virtual void STDMETHODCALLTYPE ResolveQueryData(
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT StartIndex,
- _In_ UINT NumQueries,
- _In_ ID3D12Resource *pDestinationBuffer,
- _In_ UINT64 AlignedDestinationBufferOffset) = 0;
-
- virtual void STDMETHODCALLTYPE SetPredication(
- _In_opt_ ID3D12Resource *pBuffer,
- _In_ UINT64 AlignedBufferOffset,
- _In_ D3D12_PREDICATION_OP Operation) = 0;
-
- virtual void STDMETHODCALLTYPE SetMarker(
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size) = 0;
-
- virtual void STDMETHODCALLTYPE BeginEvent(
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size) = 0;
-
- virtual void STDMETHODCALLTYPE EndEvent( void) = 0;
-
- virtual void STDMETHODCALLTYPE DecodeFrame(
- _In_ ID3D12VideoDecoder *pDecoder,
- _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
- _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments) = 0;
-
- virtual void STDMETHODCALLTYPE WriteBufferImmediate(
- UINT Count,
- _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
- _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoDecodeCommandListVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoDecodeCommandList * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoDecodeCommandList * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoDecodeCommandList * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12VideoDecodeCommandList * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12VideoDecodeCommandList * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12VideoDecodeCommandList * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12VideoDecodeCommandList * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12VideoDecodeCommandList * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
- ID3D12VideoDecodeCommandList * This);
-
- HRESULT ( STDMETHODCALLTYPE *Close )(
- ID3D12VideoDecodeCommandList * This);
-
- HRESULT ( STDMETHODCALLTYPE *Reset )(
- ID3D12VideoDecodeCommandList * This,
- _In_ ID3D12CommandAllocator *pAllocator);
-
- void ( STDMETHODCALLTYPE *ClearState )(
- ID3D12VideoDecodeCommandList * This);
-
- void ( STDMETHODCALLTYPE *ResourceBarrier )(
- ID3D12VideoDecodeCommandList * This,
- _In_ UINT NumBarriers,
- _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
-
- void ( STDMETHODCALLTYPE *DiscardResource )(
- ID3D12VideoDecodeCommandList * This,
- _In_ ID3D12Resource *pResource,
- _In_opt_ const D3D12_DISCARD_REGION *pRegion);
-
- void ( STDMETHODCALLTYPE *BeginQuery )(
- ID3D12VideoDecodeCommandList * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *EndQuery )(
- ID3D12VideoDecodeCommandList * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *ResolveQueryData )(
- ID3D12VideoDecodeCommandList * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT StartIndex,
- _In_ UINT NumQueries,
- _In_ ID3D12Resource *pDestinationBuffer,
- _In_ UINT64 AlignedDestinationBufferOffset);
-
- void ( STDMETHODCALLTYPE *SetPredication )(
- ID3D12VideoDecodeCommandList * This,
- _In_opt_ ID3D12Resource *pBuffer,
- _In_ UINT64 AlignedBufferOffset,
- _In_ D3D12_PREDICATION_OP Operation);
-
- void ( STDMETHODCALLTYPE *SetMarker )(
- ID3D12VideoDecodeCommandList * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *BeginEvent )(
- ID3D12VideoDecodeCommandList * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *EndEvent )(
- ID3D12VideoDecodeCommandList * This);
-
- void ( STDMETHODCALLTYPE *DecodeFrame )(
- ID3D12VideoDecodeCommandList * This,
- _In_ ID3D12VideoDecoder *pDecoder,
- _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
- _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments);
-
- void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
- ID3D12VideoDecodeCommandList * This,
- UINT Count,
- _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
- _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
-
- END_INTERFACE
- } ID3D12VideoDecodeCommandListVtbl;
-
- interface ID3D12VideoDecodeCommandList
- {
- CONST_VTBL struct ID3D12VideoDecodeCommandListVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoDecodeCommandList_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoDecodeCommandList_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoDecodeCommandList_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoDecodeCommandList_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12VideoDecodeCommandList_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12VideoDecodeCommandList_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12VideoDecodeCommandList_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12VideoDecodeCommandList_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-#define ID3D12VideoDecodeCommandList_GetType(This) \
- ( (This)->lpVtbl -> GetType(This) )
-
-
-#define ID3D12VideoDecodeCommandList_Close(This) \
- ( (This)->lpVtbl -> Close(This) )
-
-#define ID3D12VideoDecodeCommandList_Reset(This,pAllocator) \
- ( (This)->lpVtbl -> Reset(This,pAllocator) )
-
-#define ID3D12VideoDecodeCommandList_ClearState(This) \
- ( (This)->lpVtbl -> ClearState(This) )
-
-#define ID3D12VideoDecodeCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \
- ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
-
-#define ID3D12VideoDecodeCommandList_DiscardResource(This,pResource,pRegion) \
- ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
-
-#define ID3D12VideoDecodeCommandList_BeginQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoDecodeCommandList_EndQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoDecodeCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
- ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
-
-#define ID3D12VideoDecodeCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
- ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
-
-#define ID3D12VideoDecodeCommandList_SetMarker(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
-
-#define ID3D12VideoDecodeCommandList_BeginEvent(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
-
-#define ID3D12VideoDecodeCommandList_EndEvent(This) \
- ( (This)->lpVtbl -> EndEvent(This) )
-
-#define ID3D12VideoDecodeCommandList_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \
- ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) )
-
-#define ID3D12VideoDecodeCommandList_WriteBufferImmediate(This,Count,pParams,pModes) \
- ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12VideoDecodeCommandList_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12VideoProcessCommandList_INTERFACE_DEFINED__
-#define __ID3D12VideoProcessCommandList_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoProcessCommandList */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoProcessCommandList;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("AEB2543A-167F-4682-ACC8-D159ED4A6209")
- ID3D12VideoProcessCommandList : public ID3D12CommandList
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE Close( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE Reset(
- _In_ ID3D12CommandAllocator *pAllocator) = 0;
-
- virtual void STDMETHODCALLTYPE ClearState( void) = 0;
-
- virtual void STDMETHODCALLTYPE ResourceBarrier(
- _In_ UINT NumBarriers,
- _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0;
-
- virtual void STDMETHODCALLTYPE DiscardResource(
- _In_ ID3D12Resource *pResource,
- _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0;
-
- virtual void STDMETHODCALLTYPE BeginQuery(
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index) = 0;
-
- virtual void STDMETHODCALLTYPE EndQuery(
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index) = 0;
-
- virtual void STDMETHODCALLTYPE ResolveQueryData(
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT StartIndex,
- _In_ UINT NumQueries,
- _In_ ID3D12Resource *pDestinationBuffer,
- _In_ UINT64 AlignedDestinationBufferOffset) = 0;
-
- virtual void STDMETHODCALLTYPE SetPredication(
- _In_opt_ ID3D12Resource *pBuffer,
- _In_ UINT64 AlignedBufferOffset,
- _In_ D3D12_PREDICATION_OP Operation) = 0;
-
- virtual void STDMETHODCALLTYPE SetMarker(
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size) = 0;
-
- virtual void STDMETHODCALLTYPE BeginEvent(
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size) = 0;
-
- virtual void STDMETHODCALLTYPE EndEvent( void) = 0;
-
- virtual void STDMETHODCALLTYPE ProcessFrames(
- _In_ ID3D12VideoProcessor *pVideoProcessor,
- _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
- UINT NumInputStreams,
- _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments) = 0;
-
- virtual void STDMETHODCALLTYPE WriteBufferImmediate(
- UINT Count,
- _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
- _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoProcessCommandListVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoProcessCommandList * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoProcessCommandList * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoProcessCommandList * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12VideoProcessCommandList * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12VideoProcessCommandList * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12VideoProcessCommandList * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12VideoProcessCommandList * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12VideoProcessCommandList * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
- ID3D12VideoProcessCommandList * This);
-
- HRESULT ( STDMETHODCALLTYPE *Close )(
- ID3D12VideoProcessCommandList * This);
-
- HRESULT ( STDMETHODCALLTYPE *Reset )(
- ID3D12VideoProcessCommandList * This,
- _In_ ID3D12CommandAllocator *pAllocator);
-
- void ( STDMETHODCALLTYPE *ClearState )(
- ID3D12VideoProcessCommandList * This);
-
- void ( STDMETHODCALLTYPE *ResourceBarrier )(
- ID3D12VideoProcessCommandList * This,
- _In_ UINT NumBarriers,
- _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
-
- void ( STDMETHODCALLTYPE *DiscardResource )(
- ID3D12VideoProcessCommandList * This,
- _In_ ID3D12Resource *pResource,
- _In_opt_ const D3D12_DISCARD_REGION *pRegion);
-
- void ( STDMETHODCALLTYPE *BeginQuery )(
- ID3D12VideoProcessCommandList * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *EndQuery )(
- ID3D12VideoProcessCommandList * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *ResolveQueryData )(
- ID3D12VideoProcessCommandList * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT StartIndex,
- _In_ UINT NumQueries,
- _In_ ID3D12Resource *pDestinationBuffer,
- _In_ UINT64 AlignedDestinationBufferOffset);
-
- void ( STDMETHODCALLTYPE *SetPredication )(
- ID3D12VideoProcessCommandList * This,
- _In_opt_ ID3D12Resource *pBuffer,
- _In_ UINT64 AlignedBufferOffset,
- _In_ D3D12_PREDICATION_OP Operation);
-
- void ( STDMETHODCALLTYPE *SetMarker )(
- ID3D12VideoProcessCommandList * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *BeginEvent )(
- ID3D12VideoProcessCommandList * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *EndEvent )(
- ID3D12VideoProcessCommandList * This);
-
- void ( STDMETHODCALLTYPE *ProcessFrames )(
- ID3D12VideoProcessCommandList * This,
- _In_ ID3D12VideoProcessor *pVideoProcessor,
- _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
- UINT NumInputStreams,
- _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments);
-
- void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
- ID3D12VideoProcessCommandList * This,
- UINT Count,
- _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
- _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
-
- END_INTERFACE
- } ID3D12VideoProcessCommandListVtbl;
-
- interface ID3D12VideoProcessCommandList
- {
- CONST_VTBL struct ID3D12VideoProcessCommandListVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoProcessCommandList_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoProcessCommandList_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoProcessCommandList_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoProcessCommandList_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12VideoProcessCommandList_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12VideoProcessCommandList_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12VideoProcessCommandList_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12VideoProcessCommandList_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-#define ID3D12VideoProcessCommandList_GetType(This) \
- ( (This)->lpVtbl -> GetType(This) )
-
-
-#define ID3D12VideoProcessCommandList_Close(This) \
- ( (This)->lpVtbl -> Close(This) )
-
-#define ID3D12VideoProcessCommandList_Reset(This,pAllocator) \
- ( (This)->lpVtbl -> Reset(This,pAllocator) )
-
-#define ID3D12VideoProcessCommandList_ClearState(This) \
- ( (This)->lpVtbl -> ClearState(This) )
-
-#define ID3D12VideoProcessCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \
- ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
-
-#define ID3D12VideoProcessCommandList_DiscardResource(This,pResource,pRegion) \
- ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
-
-#define ID3D12VideoProcessCommandList_BeginQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoProcessCommandList_EndQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoProcessCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
- ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
-
-#define ID3D12VideoProcessCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
- ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
-
-#define ID3D12VideoProcessCommandList_SetMarker(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
-
-#define ID3D12VideoProcessCommandList_BeginEvent(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
-
-#define ID3D12VideoProcessCommandList_EndEvent(This) \
- ( (This)->lpVtbl -> EndEvent(This) )
-
-#define ID3D12VideoProcessCommandList_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \
- ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) )
-
-#define ID3D12VideoProcessCommandList_WriteBufferImmediate(This,Count,pParams,pModes) \
- ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12VideoProcessCommandList_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12video_0000_0006 */
-/* [local] */
-
-typedef struct D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM
- {
- UINT64 Offset;
- ID3D12Resource *pBuffer;
- } D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM;
-
-typedef struct D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1
- {
- BOOL Enable;
- ID3D12Resource *pReferenceTexture2D;
- UINT ReferenceSubresource;
- DXGI_COLOR_SPACE_TYPE OutputColorSpace;
- DXGI_COLOR_SPACE_TYPE DecodeColorSpace;
- UINT OutputWidth;
- UINT OutputHeight;
- } D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1;
-
-typedef struct D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1
- {
- ID3D12Resource *pOutputTexture2D;
- UINT OutputSubresource;
- D3D12_VIDEO_DECODE_CONVERSION_ARGUMENTS1 ConversionArguments;
- D3D12_VIDEO_DECODE_OUTPUT_HISTOGRAM Histograms[ 4 ];
- } D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0006_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0006_v0_0_s_ifspec;
-
-#ifndef __ID3D12VideoDecodeCommandList1_INTERFACE_DEFINED__
-#define __ID3D12VideoDecodeCommandList1_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoDecodeCommandList1 */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoDecodeCommandList1;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("D52F011B-B56E-453C-A05A-A7F311C8F472")
- ID3D12VideoDecodeCommandList1 : public ID3D12VideoDecodeCommandList
- {
- public:
- virtual void STDMETHODCALLTYPE DecodeFrame1(
- _In_ ID3D12VideoDecoder *pDecoder,
- _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments,
- _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoDecodeCommandList1Vtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoDecodeCommandList1 * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoDecodeCommandList1 * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoDecodeCommandList1 * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12VideoDecodeCommandList1 * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12VideoDecodeCommandList1 * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12VideoDecodeCommandList1 * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12VideoDecodeCommandList1 * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12VideoDecodeCommandList1 * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
- ID3D12VideoDecodeCommandList1 * This);
-
- HRESULT ( STDMETHODCALLTYPE *Close )(
- ID3D12VideoDecodeCommandList1 * This);
-
- HRESULT ( STDMETHODCALLTYPE *Reset )(
- ID3D12VideoDecodeCommandList1 * This,
- _In_ ID3D12CommandAllocator *pAllocator);
-
- void ( STDMETHODCALLTYPE *ClearState )(
- ID3D12VideoDecodeCommandList1 * This);
-
- void ( STDMETHODCALLTYPE *ResourceBarrier )(
- ID3D12VideoDecodeCommandList1 * This,
- _In_ UINT NumBarriers,
- _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
-
- void ( STDMETHODCALLTYPE *DiscardResource )(
- ID3D12VideoDecodeCommandList1 * This,
- _In_ ID3D12Resource *pResource,
- _In_opt_ const D3D12_DISCARD_REGION *pRegion);
-
- void ( STDMETHODCALLTYPE *BeginQuery )(
- ID3D12VideoDecodeCommandList1 * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *EndQuery )(
- ID3D12VideoDecodeCommandList1 * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *ResolveQueryData )(
- ID3D12VideoDecodeCommandList1 * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT StartIndex,
- _In_ UINT NumQueries,
- _In_ ID3D12Resource *pDestinationBuffer,
- _In_ UINT64 AlignedDestinationBufferOffset);
-
- void ( STDMETHODCALLTYPE *SetPredication )(
- ID3D12VideoDecodeCommandList1 * This,
- _In_opt_ ID3D12Resource *pBuffer,
- _In_ UINT64 AlignedBufferOffset,
- _In_ D3D12_PREDICATION_OP Operation);
-
- void ( STDMETHODCALLTYPE *SetMarker )(
- ID3D12VideoDecodeCommandList1 * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *BeginEvent )(
- ID3D12VideoDecodeCommandList1 * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *EndEvent )(
- ID3D12VideoDecodeCommandList1 * This);
-
- void ( STDMETHODCALLTYPE *DecodeFrame )(
- ID3D12VideoDecodeCommandList1 * This,
- _In_ ID3D12VideoDecoder *pDecoder,
- _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
- _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments);
-
- void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
- ID3D12VideoDecodeCommandList1 * This,
- UINT Count,
- _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
- _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
-
- void ( STDMETHODCALLTYPE *DecodeFrame1 )(
- ID3D12VideoDecodeCommandList1 * This,
- _In_ ID3D12VideoDecoder *pDecoder,
- _In_ const D3D12_VIDEO_DECODE_OUTPUT_STREAM_ARGUMENTS1 *pOutputArguments,
- _In_ const D3D12_VIDEO_DECODE_INPUT_STREAM_ARGUMENTS *pInputArguments);
-
- END_INTERFACE
- } ID3D12VideoDecodeCommandList1Vtbl;
-
- interface ID3D12VideoDecodeCommandList1
- {
- CONST_VTBL struct ID3D12VideoDecodeCommandList1Vtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoDecodeCommandList1_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoDecodeCommandList1_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoDecodeCommandList1_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoDecodeCommandList1_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12VideoDecodeCommandList1_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12VideoDecodeCommandList1_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12VideoDecodeCommandList1_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12VideoDecodeCommandList1_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-#define ID3D12VideoDecodeCommandList1_GetType(This) \
- ( (This)->lpVtbl -> GetType(This) )
-
-
-#define ID3D12VideoDecodeCommandList1_Close(This) \
- ( (This)->lpVtbl -> Close(This) )
-
-#define ID3D12VideoDecodeCommandList1_Reset(This,pAllocator) \
- ( (This)->lpVtbl -> Reset(This,pAllocator) )
-
-#define ID3D12VideoDecodeCommandList1_ClearState(This) \
- ( (This)->lpVtbl -> ClearState(This) )
-
-#define ID3D12VideoDecodeCommandList1_ResourceBarrier(This,NumBarriers,pBarriers) \
- ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
-
-#define ID3D12VideoDecodeCommandList1_DiscardResource(This,pResource,pRegion) \
- ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
-
-#define ID3D12VideoDecodeCommandList1_BeginQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoDecodeCommandList1_EndQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoDecodeCommandList1_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
- ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
-
-#define ID3D12VideoDecodeCommandList1_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
- ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
-
-#define ID3D12VideoDecodeCommandList1_SetMarker(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
-
-#define ID3D12VideoDecodeCommandList1_BeginEvent(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
-
-#define ID3D12VideoDecodeCommandList1_EndEvent(This) \
- ( (This)->lpVtbl -> EndEvent(This) )
-
-#define ID3D12VideoDecodeCommandList1_DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) \
- ( (This)->lpVtbl -> DecodeFrame(This,pDecoder,pOutputArguments,pInputArguments) )
-
-#define ID3D12VideoDecodeCommandList1_WriteBufferImmediate(This,Count,pParams,pModes) \
- ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
-
-
-#define ID3D12VideoDecodeCommandList1_DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) \
- ( (This)->lpVtbl -> DecodeFrame1(This,pDecoder,pOutputArguments,pInputArguments) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12VideoDecodeCommandList1_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12video_0000_0007 */
-/* [local] */
-
-typedef struct D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1
- {
- D3D12_VIDEO_PROCESS_INPUT_STREAM InputStream[ 2 ];
- D3D12_VIDEO_PROCESS_TRANSFORM Transform;
- D3D12_VIDEO_PROCESS_INPUT_STREAM_FLAGS Flags;
- D3D12_VIDEO_PROCESS_INPUT_STREAM_RATE RateInfo;
- INT FilterLevels[ 32 ];
- D3D12_VIDEO_PROCESS_ALPHA_BLENDING AlphaBlending;
- D3D12_VIDEO_FIELD_TYPE FieldType;
- } D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0007_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0007_v0_0_s_ifspec;
-
-#ifndef __ID3D12VideoProcessCommandList1_INTERFACE_DEFINED__
-#define __ID3D12VideoProcessCommandList1_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoProcessCommandList1 */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoProcessCommandList1;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("542C5C4D-7596-434F-8C93-4EFA6766F267")
- ID3D12VideoProcessCommandList1 : public ID3D12VideoProcessCommandList
- {
- public:
- virtual void STDMETHODCALLTYPE ProcessFrames1(
- _In_ ID3D12VideoProcessor *pVideoProcessor,
- _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
- UINT NumInputStreams,
- _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoProcessCommandList1Vtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoProcessCommandList1 * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoProcessCommandList1 * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoProcessCommandList1 * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12VideoProcessCommandList1 * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12VideoProcessCommandList1 * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12VideoProcessCommandList1 * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12VideoProcessCommandList1 * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12VideoProcessCommandList1 * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
- ID3D12VideoProcessCommandList1 * This);
-
- HRESULT ( STDMETHODCALLTYPE *Close )(
- ID3D12VideoProcessCommandList1 * This);
-
- HRESULT ( STDMETHODCALLTYPE *Reset )(
- ID3D12VideoProcessCommandList1 * This,
- _In_ ID3D12CommandAllocator *pAllocator);
-
- void ( STDMETHODCALLTYPE *ClearState )(
- ID3D12VideoProcessCommandList1 * This);
-
- void ( STDMETHODCALLTYPE *ResourceBarrier )(
- ID3D12VideoProcessCommandList1 * This,
- _In_ UINT NumBarriers,
- _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
-
- void ( STDMETHODCALLTYPE *DiscardResource )(
- ID3D12VideoProcessCommandList1 * This,
- _In_ ID3D12Resource *pResource,
- _In_opt_ const D3D12_DISCARD_REGION *pRegion);
-
- void ( STDMETHODCALLTYPE *BeginQuery )(
- ID3D12VideoProcessCommandList1 * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *EndQuery )(
- ID3D12VideoProcessCommandList1 * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *ResolveQueryData )(
- ID3D12VideoProcessCommandList1 * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT StartIndex,
- _In_ UINT NumQueries,
- _In_ ID3D12Resource *pDestinationBuffer,
- _In_ UINT64 AlignedDestinationBufferOffset);
-
- void ( STDMETHODCALLTYPE *SetPredication )(
- ID3D12VideoProcessCommandList1 * This,
- _In_opt_ ID3D12Resource *pBuffer,
- _In_ UINT64 AlignedBufferOffset,
- _In_ D3D12_PREDICATION_OP Operation);
-
- void ( STDMETHODCALLTYPE *SetMarker )(
- ID3D12VideoProcessCommandList1 * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *BeginEvent )(
- ID3D12VideoProcessCommandList1 * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *EndEvent )(
- ID3D12VideoProcessCommandList1 * This);
-
- void ( STDMETHODCALLTYPE *ProcessFrames )(
- ID3D12VideoProcessCommandList1 * This,
- _In_ ID3D12VideoProcessor *pVideoProcessor,
- _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
- UINT NumInputStreams,
- _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS *pInputArguments);
-
- void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
- ID3D12VideoProcessCommandList1 * This,
- UINT Count,
- _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
- _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
-
- void ( STDMETHODCALLTYPE *ProcessFrames1 )(
- ID3D12VideoProcessCommandList1 * This,
- _In_ ID3D12VideoProcessor *pVideoProcessor,
- _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_ARGUMENTS *pOutputArguments,
- UINT NumInputStreams,
- _In_reads_(NumInputStreams) const D3D12_VIDEO_PROCESS_INPUT_STREAM_ARGUMENTS1 *pInputArguments);
-
- END_INTERFACE
- } ID3D12VideoProcessCommandList1Vtbl;
-
- interface ID3D12VideoProcessCommandList1
- {
- CONST_VTBL struct ID3D12VideoProcessCommandList1Vtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoProcessCommandList1_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoProcessCommandList1_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoProcessCommandList1_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoProcessCommandList1_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12VideoProcessCommandList1_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12VideoProcessCommandList1_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12VideoProcessCommandList1_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12VideoProcessCommandList1_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-#define ID3D12VideoProcessCommandList1_GetType(This) \
- ( (This)->lpVtbl -> GetType(This) )
-
-
-#define ID3D12VideoProcessCommandList1_Close(This) \
- ( (This)->lpVtbl -> Close(This) )
-
-#define ID3D12VideoProcessCommandList1_Reset(This,pAllocator) \
- ( (This)->lpVtbl -> Reset(This,pAllocator) )
-
-#define ID3D12VideoProcessCommandList1_ClearState(This) \
- ( (This)->lpVtbl -> ClearState(This) )
-
-#define ID3D12VideoProcessCommandList1_ResourceBarrier(This,NumBarriers,pBarriers) \
- ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
-
-#define ID3D12VideoProcessCommandList1_DiscardResource(This,pResource,pRegion) \
- ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
-
-#define ID3D12VideoProcessCommandList1_BeginQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoProcessCommandList1_EndQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoProcessCommandList1_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
- ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
-
-#define ID3D12VideoProcessCommandList1_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
- ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
-
-#define ID3D12VideoProcessCommandList1_SetMarker(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
-
-#define ID3D12VideoProcessCommandList1_BeginEvent(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
-
-#define ID3D12VideoProcessCommandList1_EndEvent(This) \
- ( (This)->lpVtbl -> EndEvent(This) )
-
-#define ID3D12VideoProcessCommandList1_ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \
- ( (This)->lpVtbl -> ProcessFrames(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) )
-
-#define ID3D12VideoProcessCommandList1_WriteBufferImmediate(This,Count,pParams,pModes) \
- ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
-
-
-#define ID3D12VideoProcessCommandList1_ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) \
- ( (This)->lpVtbl -> ProcessFrames1(This,pVideoProcessor,pOutputArguments,NumInputStreams,pInputArguments) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12VideoProcessCommandList1_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12video_0000_0008 */
-/* [local] */
-
-typedef
-enum D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE
- {
- D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_8X8 = 0,
- D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_16X16 = 1
- } D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE;
-
-typedef
-enum D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS
- {
- D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_NONE = 0,
- D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_8X8 = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_8X8 ) ,
- D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAG_16X16 = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_16X16 )
- } D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS );
-typedef
-enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION
- {
- D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_QUARTER_PEL = 0
- } D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION;
-
-typedef
-enum D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS
- {
- D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAG_NONE = 0,
- D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAG_QUARTER_PEL = ( 1 << D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_QUARTER_PEL )
- } D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS;
-
-DEFINE_ENUM_FLAG_OPERATORS( D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS );
-typedef struct D3D12_FEATURE_DATA_VIDEO_FEATURE_AREA_SUPPORT
- {
- UINT NodeIndex;
- BOOL VideoDecodeSupport;
- BOOL VideoProcessSupport;
- BOOL VideoEncodeSupport;
- } D3D12_FEATURE_DATA_VIDEO_FEATURE_AREA_SUPPORT;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR
- {
- UINT NodeIndex;
- DXGI_FORMAT InputFormat;
- D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE_FLAGS BlockSizeFlags;
- D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION_FLAGS PrecisionFlags;
- D3D12_VIDEO_SIZE_RANGE SizeRange;
- } D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR;
-
-typedef struct D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_SIZE
- {
- UINT NodeIndex;
- DXGI_FORMAT InputFormat;
- D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize;
- D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision;
- D3D12_VIDEO_SIZE_RANGE SizeRange;
- BOOL Protected;
- UINT64 MotionVectorHeapMemoryPoolL0Size;
- UINT64 MotionVectorHeapMemoryPoolL1Size;
- UINT64 MotionEstimatorMemoryPoolL0Size;
- UINT64 MotionEstimatorMemoryPoolL1Size;
- } D3D12_FEATURE_DATA_VIDEO_MOTION_ESTIMATOR_SIZE;
-
-typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_DESC
- {
- UINT NodeMask;
- DXGI_FORMAT InputFormat;
- D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize;
- D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision;
- D3D12_VIDEO_SIZE_RANGE SizeRange;
- } D3D12_VIDEO_MOTION_ESTIMATOR_DESC;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0008_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0008_v0_0_s_ifspec;
-
-#ifndef __ID3D12VideoMotionEstimator_INTERFACE_DEFINED__
-#define __ID3D12VideoMotionEstimator_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoMotionEstimator */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoMotionEstimator;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("33FDAE0E-098B-428F-87BB-34B695DE08F8")
- ID3D12VideoMotionEstimator : public ID3D12Pageable
- {
- public:
- virtual D3D12_VIDEO_MOTION_ESTIMATOR_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession(
- REFIID riid,
- _COM_Outptr_opt_ void **ppProtectedSession) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoMotionEstimatorVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoMotionEstimator * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoMotionEstimator * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoMotionEstimator * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12VideoMotionEstimator * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12VideoMotionEstimator * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12VideoMotionEstimator * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12VideoMotionEstimator * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12VideoMotionEstimator * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- D3D12_VIDEO_MOTION_ESTIMATOR_DESC ( STDMETHODCALLTYPE *GetDesc )(
- ID3D12VideoMotionEstimator * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )(
- ID3D12VideoMotionEstimator * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppProtectedSession);
-
- END_INTERFACE
- } ID3D12VideoMotionEstimatorVtbl;
-
- interface ID3D12VideoMotionEstimator
- {
- CONST_VTBL struct ID3D12VideoMotionEstimatorVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoMotionEstimator_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoMotionEstimator_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoMotionEstimator_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoMotionEstimator_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12VideoMotionEstimator_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12VideoMotionEstimator_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12VideoMotionEstimator_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12VideoMotionEstimator_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-
-#define ID3D12VideoMotionEstimator_GetDesc(This) \
- ( (This)->lpVtbl -> GetDesc(This) )
-
-#define ID3D12VideoMotionEstimator_GetProtectedResourceSession(This,riid,ppProtectedSession) \
- ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-
-
-
-
-#endif /* __ID3D12VideoMotionEstimator_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12video_0000_0009 */
-/* [local] */
-
-typedef struct D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC
- {
- UINT NodeMask;
- DXGI_FORMAT InputFormat;
- D3D12_VIDEO_MOTION_ESTIMATOR_SEARCH_BLOCK_SIZE BlockSize;
- D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION Precision;
- D3D12_VIDEO_SIZE_RANGE SizeRange;
- } D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0009_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0009_v0_0_s_ifspec;
-
-#ifndef __ID3D12VideoMotionVectorHeap_INTERFACE_DEFINED__
-#define __ID3D12VideoMotionVectorHeap_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoMotionVectorHeap */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoMotionVectorHeap;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("5BE17987-743A-4061-834B-23D22DAEA505")
- ID3D12VideoMotionVectorHeap : public ID3D12Pageable
- {
- public:
- virtual D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC STDMETHODCALLTYPE GetDesc( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE GetProtectedResourceSession(
- REFIID riid,
- _COM_Outptr_opt_ void **ppProtectedSession) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoMotionVectorHeapVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoMotionVectorHeap * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoMotionVectorHeap * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoMotionVectorHeap * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12VideoMotionVectorHeap * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12VideoMotionVectorHeap * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12VideoMotionVectorHeap * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12VideoMotionVectorHeap * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12VideoMotionVectorHeap * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC ( STDMETHODCALLTYPE *GetDesc )(
- ID3D12VideoMotionVectorHeap * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetProtectedResourceSession )(
- ID3D12VideoMotionVectorHeap * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppProtectedSession);
-
- END_INTERFACE
- } ID3D12VideoMotionVectorHeapVtbl;
-
- interface ID3D12VideoMotionVectorHeap
- {
- CONST_VTBL struct ID3D12VideoMotionVectorHeapVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoMotionVectorHeap_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoMotionVectorHeap_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoMotionVectorHeap_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoMotionVectorHeap_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12VideoMotionVectorHeap_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12VideoMotionVectorHeap_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12VideoMotionVectorHeap_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12VideoMotionVectorHeap_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-
-#define ID3D12VideoMotionVectorHeap_GetDesc(This) \
- ( (This)->lpVtbl -> GetDesc(This) )
-
-#define ID3D12VideoMotionVectorHeap_GetProtectedResourceSession(This,riid,ppProtectedSession) \
- ( (This)->lpVtbl -> GetProtectedResourceSession(This,riid,ppProtectedSession) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-
-
-
-
-#endif /* __ID3D12VideoMotionVectorHeap_INTERFACE_DEFINED__ */
-
-
-#ifndef __ID3D12VideoDevice1_INTERFACE_DEFINED__
-#define __ID3D12VideoDevice1_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoDevice1 */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoDevice1;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("981611AD-A144-4C83-9890-F30E26D658AB")
- ID3D12VideoDevice1 : public ID3D12VideoDevice
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE CreateVideoMotionEstimator(
- _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc,
- _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppVideoMotionEstimator) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE CreateVideoMotionVectorHeap(
- _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc,
- _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppVideoMotionVectorHeap) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoDevice1Vtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoDevice1 * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoDevice1 * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoDevice1 * This);
-
- HRESULT ( STDMETHODCALLTYPE *CheckFeatureSupport )(
- ID3D12VideoDevice1 * This,
- D3D12_FEATURE_VIDEO FeatureVideo,
- _Inout_updates_bytes_(FeatureSupportDataSize) void *pFeatureSupportData,
- UINT FeatureSupportDataSize);
-
- HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoder )(
- ID3D12VideoDevice1 * This,
- _In_ const D3D12_VIDEO_DECODER_DESC *pDesc,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppVideoDecoder);
-
- HRESULT ( STDMETHODCALLTYPE *CreateVideoDecoderHeap )(
- ID3D12VideoDevice1 * This,
- _In_ const D3D12_VIDEO_DECODER_HEAP_DESC *pVideoDecoderHeapDesc,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppVideoDecoderHeap);
-
- HRESULT ( STDMETHODCALLTYPE *CreateVideoProcessor )(
- ID3D12VideoDevice1 * This,
- UINT NodeMask,
- _In_ const D3D12_VIDEO_PROCESS_OUTPUT_STREAM_DESC *pOutputStreamDesc,
- UINT NumInputStreamDescs,
- _In_reads_(NumInputStreamDescs) const D3D12_VIDEO_PROCESS_INPUT_STREAM_DESC *pInputStreamDescs,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppVideoProcessor);
-
- HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionEstimator )(
- ID3D12VideoDevice1 * This,
- _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_DESC *pDesc,
- _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppVideoMotionEstimator);
-
- HRESULT ( STDMETHODCALLTYPE *CreateVideoMotionVectorHeap )(
- ID3D12VideoDevice1 * This,
- _In_ const D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC *pDesc,
- _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession,
- _In_ REFIID riid,
- _COM_Outptr_ void **ppVideoMotionVectorHeap);
-
- END_INTERFACE
- } ID3D12VideoDevice1Vtbl;
-
- interface ID3D12VideoDevice1
- {
- CONST_VTBL struct ID3D12VideoDevice1Vtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoDevice1_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoDevice1_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoDevice1_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoDevice1_CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) \
- ( (This)->lpVtbl -> CheckFeatureSupport(This,FeatureVideo,pFeatureSupportData,FeatureSupportDataSize) )
-
-#define ID3D12VideoDevice1_CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) \
- ( (This)->lpVtbl -> CreateVideoDecoder(This,pDesc,riid,ppVideoDecoder) )
-
-#define ID3D12VideoDevice1_CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) \
- ( (This)->lpVtbl -> CreateVideoDecoderHeap(This,pVideoDecoderHeapDesc,riid,ppVideoDecoderHeap) )
-
-#define ID3D12VideoDevice1_CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) \
- ( (This)->lpVtbl -> CreateVideoProcessor(This,NodeMask,pOutputStreamDesc,NumInputStreamDescs,pInputStreamDescs,riid,ppVideoProcessor) )
-
-
-#define ID3D12VideoDevice1_CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) \
- ( (This)->lpVtbl -> CreateVideoMotionEstimator(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionEstimator) )
-
-#define ID3D12VideoDevice1_CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) \
- ( (This)->lpVtbl -> CreateVideoMotionVectorHeap(This,pDesc,pProtectedResourceSession,riid,ppVideoMotionVectorHeap) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12VideoDevice1_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12video_0000_0011 */
-/* [local] */
-
-typedef struct D3D12_RESOURCE_COORDINATE
- {
- UINT64 X;
- UINT Y;
- UINT Z;
- UINT SubresourceIndex;
- } D3D12_RESOURCE_COORDINATE;
-
-typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT
- {
- ID3D12VideoMotionVectorHeap *pMotionVectorHeap;
- } D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT;
-
-typedef struct D3D12_VIDEO_MOTION_ESTIMATOR_INPUT
- {
- ID3D12Resource *pInputTexture2D;
- UINT InputSubresourceIndex;
- ID3D12Resource *pReferenceTexture2D;
- UINT ReferenceSubresourceIndex;
- ID3D12VideoMotionVectorHeap *pHintMotionVectorHeap;
- } D3D12_VIDEO_MOTION_ESTIMATOR_INPUT;
-
-typedef struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT
- {
- ID3D12Resource *pMotionVectorTexture2D;
- D3D12_RESOURCE_COORDINATE MotionVectorCoordinate;
- } D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT;
-
-typedef struct D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT
- {
- ID3D12VideoMotionVectorHeap *pMotionVectorHeap;
- UINT PixelWidth;
- UINT PixelHeight;
- } D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT;
-
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0011_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0011_v0_0_s_ifspec;
-
-#ifndef __ID3D12VideoEncodeCommandList_INTERFACE_DEFINED__
-#define __ID3D12VideoEncodeCommandList_INTERFACE_DEFINED__
-
-/* interface ID3D12VideoEncodeCommandList */
-/* [unique][local][object][uuid] */
-
-
-EXTERN_C const IID IID_ID3D12VideoEncodeCommandList;
-
-#if defined(__cplusplus) && !defined(CINTERFACE)
-
- MIDL_INTERFACE("8455293A-0CBD-4831-9B39-FBDBAB724723")
- ID3D12VideoEncodeCommandList : public ID3D12CommandList
- {
- public:
- virtual HRESULT STDMETHODCALLTYPE Close( void) = 0;
-
- virtual HRESULT STDMETHODCALLTYPE Reset(
- _In_ ID3D12CommandAllocator *pAllocator) = 0;
-
- virtual void STDMETHODCALLTYPE ClearState( void) = 0;
-
- virtual void STDMETHODCALLTYPE ResourceBarrier(
- _In_ UINT NumBarriers,
- _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers) = 0;
-
- virtual void STDMETHODCALLTYPE DiscardResource(
- _In_ ID3D12Resource *pResource,
- _In_opt_ const D3D12_DISCARD_REGION *pRegion) = 0;
-
- virtual void STDMETHODCALLTYPE BeginQuery(
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index) = 0;
-
- virtual void STDMETHODCALLTYPE EndQuery(
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index) = 0;
-
- virtual void STDMETHODCALLTYPE ResolveQueryData(
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT StartIndex,
- _In_ UINT NumQueries,
- _In_ ID3D12Resource *pDestinationBuffer,
- _In_ UINT64 AlignedDestinationBufferOffset) = 0;
-
- virtual void STDMETHODCALLTYPE SetPredication(
- _In_opt_ ID3D12Resource *pBuffer,
- _In_ UINT64 AlignedBufferOffset,
- _In_ D3D12_PREDICATION_OP Operation) = 0;
-
- virtual void STDMETHODCALLTYPE SetMarker(
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size) = 0;
-
- virtual void STDMETHODCALLTYPE BeginEvent(
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size) = 0;
-
- virtual void STDMETHODCALLTYPE EndEvent( void) = 0;
-
- virtual void STDMETHODCALLTYPE EstimateMotion(
- _In_ ID3D12VideoMotionEstimator *pMotionEstimator,
- _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments,
- _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments) = 0;
-
- virtual void STDMETHODCALLTYPE ResolveMotionVectorHeap(
- const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments,
- const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments) = 0;
-
- virtual void STDMETHODCALLTYPE WriteBufferImmediate(
- UINT Count,
- _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
- _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes) = 0;
-
- virtual void STDMETHODCALLTYPE SetProtectedResourceSession(
- _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession) = 0;
-
- };
-
-
-#else /* C style interface */
-
- typedef struct ID3D12VideoEncodeCommandListVtbl
- {
- BEGIN_INTERFACE
-
- HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
- ID3D12VideoEncodeCommandList * This,
- REFIID riid,
- _COM_Outptr_ void **ppvObject);
-
- ULONG ( STDMETHODCALLTYPE *AddRef )(
- ID3D12VideoEncodeCommandList * This);
-
- ULONG ( STDMETHODCALLTYPE *Release )(
- ID3D12VideoEncodeCommandList * This);
-
- HRESULT ( STDMETHODCALLTYPE *GetPrivateData )(
- ID3D12VideoEncodeCommandList * This,
- _In_ REFGUID guid,
- _Inout_ UINT *pDataSize,
- _Out_writes_bytes_opt_( *pDataSize ) void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateData )(
- ID3D12VideoEncodeCommandList * This,
- _In_ REFGUID guid,
- _In_ UINT DataSize,
- _In_reads_bytes_opt_( DataSize ) const void *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetPrivateDataInterface )(
- ID3D12VideoEncodeCommandList * This,
- _In_ REFGUID guid,
- _In_opt_ const IUnknown *pData);
-
- HRESULT ( STDMETHODCALLTYPE *SetName )(
- ID3D12VideoEncodeCommandList * This,
- _In_z_ LPCWSTR Name);
-
- HRESULT ( STDMETHODCALLTYPE *GetDevice )(
- ID3D12VideoEncodeCommandList * This,
- REFIID riid,
- _COM_Outptr_opt_ void **ppvDevice);
-
- D3D12_COMMAND_LIST_TYPE ( STDMETHODCALLTYPE *GetType )(
- ID3D12VideoEncodeCommandList * This);
-
- HRESULT ( STDMETHODCALLTYPE *Close )(
- ID3D12VideoEncodeCommandList * This);
-
- HRESULT ( STDMETHODCALLTYPE *Reset )(
- ID3D12VideoEncodeCommandList * This,
- _In_ ID3D12CommandAllocator *pAllocator);
-
- void ( STDMETHODCALLTYPE *ClearState )(
- ID3D12VideoEncodeCommandList * This);
-
- void ( STDMETHODCALLTYPE *ResourceBarrier )(
- ID3D12VideoEncodeCommandList * This,
- _In_ UINT NumBarriers,
- _In_reads_(NumBarriers) const D3D12_RESOURCE_BARRIER *pBarriers);
-
- void ( STDMETHODCALLTYPE *DiscardResource )(
- ID3D12VideoEncodeCommandList * This,
- _In_ ID3D12Resource *pResource,
- _In_opt_ const D3D12_DISCARD_REGION *pRegion);
-
- void ( STDMETHODCALLTYPE *BeginQuery )(
- ID3D12VideoEncodeCommandList * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *EndQuery )(
- ID3D12VideoEncodeCommandList * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT Index);
-
- void ( STDMETHODCALLTYPE *ResolveQueryData )(
- ID3D12VideoEncodeCommandList * This,
- _In_ ID3D12QueryHeap *pQueryHeap,
- _In_ D3D12_QUERY_TYPE Type,
- _In_ UINT StartIndex,
- _In_ UINT NumQueries,
- _In_ ID3D12Resource *pDestinationBuffer,
- _In_ UINT64 AlignedDestinationBufferOffset);
-
- void ( STDMETHODCALLTYPE *SetPredication )(
- ID3D12VideoEncodeCommandList * This,
- _In_opt_ ID3D12Resource *pBuffer,
- _In_ UINT64 AlignedBufferOffset,
- _In_ D3D12_PREDICATION_OP Operation);
-
- void ( STDMETHODCALLTYPE *SetMarker )(
- ID3D12VideoEncodeCommandList * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *BeginEvent )(
- ID3D12VideoEncodeCommandList * This,
- UINT Metadata,
- _In_reads_bytes_opt_(Size) const void *pData,
- UINT Size);
-
- void ( STDMETHODCALLTYPE *EndEvent )(
- ID3D12VideoEncodeCommandList * This);
-
- void ( STDMETHODCALLTYPE *EstimateMotion )(
- ID3D12VideoEncodeCommandList * This,
- _In_ ID3D12VideoMotionEstimator *pMotionEstimator,
- _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_OUTPUT *pOutputArguments,
- _In_ const D3D12_VIDEO_MOTION_ESTIMATOR_INPUT *pInputArguments);
-
- void ( STDMETHODCALLTYPE *ResolveMotionVectorHeap )(
- ID3D12VideoEncodeCommandList * This,
- const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_OUTPUT *pOutputArguments,
- const D3D12_RESOLVE_VIDEO_MOTION_VECTOR_HEAP_INPUT *pInputArguments);
-
- void ( STDMETHODCALLTYPE *WriteBufferImmediate )(
- ID3D12VideoEncodeCommandList * This,
- UINT Count,
- _In_reads_(Count) const D3D12_WRITEBUFFERIMMEDIATE_PARAMETER *pParams,
- _In_reads_opt_(Count) const D3D12_WRITEBUFFERIMMEDIATE_MODE *pModes);
-
- void ( STDMETHODCALLTYPE *SetProtectedResourceSession )(
- ID3D12VideoEncodeCommandList * This,
- _In_opt_ ID3D12ProtectedResourceSession *pProtectedResourceSession);
-
- END_INTERFACE
- } ID3D12VideoEncodeCommandListVtbl;
-
- interface ID3D12VideoEncodeCommandList
- {
- CONST_VTBL struct ID3D12VideoEncodeCommandListVtbl *lpVtbl;
- };
-
-
-
-#ifdef COBJMACROS
-
-
-#define ID3D12VideoEncodeCommandList_QueryInterface(This,riid,ppvObject) \
- ( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
-
-#define ID3D12VideoEncodeCommandList_AddRef(This) \
- ( (This)->lpVtbl -> AddRef(This) )
-
-#define ID3D12VideoEncodeCommandList_Release(This) \
- ( (This)->lpVtbl -> Release(This) )
-
-
-#define ID3D12VideoEncodeCommandList_GetPrivateData(This,guid,pDataSize,pData) \
- ( (This)->lpVtbl -> GetPrivateData(This,guid,pDataSize,pData) )
-
-#define ID3D12VideoEncodeCommandList_SetPrivateData(This,guid,DataSize,pData) \
- ( (This)->lpVtbl -> SetPrivateData(This,guid,DataSize,pData) )
-
-#define ID3D12VideoEncodeCommandList_SetPrivateDataInterface(This,guid,pData) \
- ( (This)->lpVtbl -> SetPrivateDataInterface(This,guid,pData) )
-
-#define ID3D12VideoEncodeCommandList_SetName(This,Name) \
- ( (This)->lpVtbl -> SetName(This,Name) )
-
-
-#define ID3D12VideoEncodeCommandList_GetDevice(This,riid,ppvDevice) \
- ( (This)->lpVtbl -> GetDevice(This,riid,ppvDevice) )
-
-
-#define ID3D12VideoEncodeCommandList_GetType(This) \
- ( (This)->lpVtbl -> GetType(This) )
-
-
-#define ID3D12VideoEncodeCommandList_Close(This) \
- ( (This)->lpVtbl -> Close(This) )
-
-#define ID3D12VideoEncodeCommandList_Reset(This,pAllocator) \
- ( (This)->lpVtbl -> Reset(This,pAllocator) )
-
-#define ID3D12VideoEncodeCommandList_ClearState(This) \
- ( (This)->lpVtbl -> ClearState(This) )
-
-#define ID3D12VideoEncodeCommandList_ResourceBarrier(This,NumBarriers,pBarriers) \
- ( (This)->lpVtbl -> ResourceBarrier(This,NumBarriers,pBarriers) )
-
-#define ID3D12VideoEncodeCommandList_DiscardResource(This,pResource,pRegion) \
- ( (This)->lpVtbl -> DiscardResource(This,pResource,pRegion) )
-
-#define ID3D12VideoEncodeCommandList_BeginQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> BeginQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoEncodeCommandList_EndQuery(This,pQueryHeap,Type,Index) \
- ( (This)->lpVtbl -> EndQuery(This,pQueryHeap,Type,Index) )
-
-#define ID3D12VideoEncodeCommandList_ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) \
- ( (This)->lpVtbl -> ResolveQueryData(This,pQueryHeap,Type,StartIndex,NumQueries,pDestinationBuffer,AlignedDestinationBufferOffset) )
-
-#define ID3D12VideoEncodeCommandList_SetPredication(This,pBuffer,AlignedBufferOffset,Operation) \
- ( (This)->lpVtbl -> SetPredication(This,pBuffer,AlignedBufferOffset,Operation) )
-
-#define ID3D12VideoEncodeCommandList_SetMarker(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> SetMarker(This,Metadata,pData,Size) )
-
-#define ID3D12VideoEncodeCommandList_BeginEvent(This,Metadata,pData,Size) \
- ( (This)->lpVtbl -> BeginEvent(This,Metadata,pData,Size) )
-
-#define ID3D12VideoEncodeCommandList_EndEvent(This) \
- ( (This)->lpVtbl -> EndEvent(This) )
-
-#define ID3D12VideoEncodeCommandList_EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) \
- ( (This)->lpVtbl -> EstimateMotion(This,pMotionEstimator,pOutputArguments,pInputArguments) )
-
-#define ID3D12VideoEncodeCommandList_ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) \
- ( (This)->lpVtbl -> ResolveMotionVectorHeap(This,pOutputArguments,pInputArguments) )
-
-#define ID3D12VideoEncodeCommandList_WriteBufferImmediate(This,Count,pParams,pModes) \
- ( (This)->lpVtbl -> WriteBufferImmediate(This,Count,pParams,pModes) )
-
-#define ID3D12VideoEncodeCommandList_SetProtectedResourceSession(This,pProtectedResourceSession) \
- ( (This)->lpVtbl -> SetProtectedResourceSession(This,pProtectedResourceSession) )
-
-#endif /* COBJMACROS */
-
-
-#endif /* C style interface */
-
-
-
-
-#endif /* __ID3D12VideoEncodeCommandList_INTERFACE_DEFINED__ */
-
-
-/* interface __MIDL_itf_d3d12video_0000_0012 */
-/* [local] */
-
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG2, 0xee27417f, 0x5e28, 0x4e65, 0xbe, 0xea, 0x1d, 0x26, 0xb5, 0x08, 0xad, 0xc9);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG1_AND_MPEG2, 0x86695f12, 0x340e, 0x4f04, 0x9f, 0xd3, 0x92, 0x53, 0xdd, 0x32, 0x74, 0x60);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264, 0x1b81be68, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_STEREO_PROGRESSIVE, 0xd79be8da, 0x0cf1, 0x4c81, 0xb8, 0x2a, 0x69, 0xa4, 0xe2, 0x36, 0xf4, 0x3d);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_STEREO, 0xf9aaccbb, 0xc2b6, 0x4cfc, 0x87, 0x79, 0x57, 0x07, 0xb1, 0x76, 0x05, 0x52);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_H264_MULTIVIEW, 0x705b9d82, 0x76cf, 0x49d6, 0xb7, 0xe6, 0xac, 0x88, 0x72, 0xdb, 0x01, 0x3c);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VC1, 0x1b81beA3, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VC1_D2010, 0x1b81beA4, 0xa0c7, 0x11d3, 0xb9, 0x84, 0x00, 0xc0, 0x4f, 0x2e, 0x73, 0xc5);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_SIMPLE, 0xefd64d74, 0xc9e8,0x41d7,0xa5,0xe9,0xe9,0xb0,0xe3,0x9f,0xa3,0x19);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_MPEG4PT2_ADVSIMPLE_NOGMC, 0xed418a9f, 0x010d, 0x4eda, 0x9a, 0xe3, 0x9a, 0x65, 0x35, 0x8d, 0x8d, 0x2e);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN, 0x5b11d51b, 0x2f4c, 0x4452, 0xbc, 0xc3, 0x09, 0xf2, 0xa1, 0x16, 0x0c, 0xc0);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_HEVC_MAIN10, 0x107af0e0, 0xef1a, 0x4d19, 0xab, 0xa8, 0x67, 0xa1, 0x63, 0x07, 0x3d, 0x13);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9, 0x463707f8, 0xa1d0, 0x4585, 0x87, 0x6d, 0x83, 0xaa, 0x6d, 0x60, 0xb8, 0x9e);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP9_10BIT_PROFILE2, 0xa4c749ef, 0x6ecf, 0x48aa, 0x84, 0x48, 0x50, 0xa7, 0xa1, 0x16, 0x5f, 0xf7);
-DEFINE_GUID(D3D12_VIDEO_DECODE_PROFILE_VP8, 0x90b899ea, 0x3a62, 0x4705, 0x88, 0xb3, 0x8d, 0xf0, 0x4b, 0x27, 0x44, 0xe7);
-DEFINE_GUID(IID_ID3D12VideoDecoderHeap,0x0946B7C9,0xEBF6,0x4047,0xBB,0x73,0x86,0x83,0xE2,0x7D,0xBB,0x1F);
-DEFINE_GUID(IID_ID3D12VideoDevice,0x1F052807,0x0B46,0x4ACC,0x8A,0x89,0x36,0x4F,0x79,0x37,0x18,0xA4);
-DEFINE_GUID(IID_ID3D12VideoDecoder,0xC59B6BDC,0x7720,0x4074,0xA1,0x36,0x17,0xA1,0x56,0x03,0x74,0x70);
-DEFINE_GUID(IID_ID3D12VideoProcessor,0x304FDB32,0xBEDE,0x410A,0x85,0x45,0x94,0x3A,0xC6,0xA4,0x61,0x38);
-DEFINE_GUID(IID_ID3D12VideoDecodeCommandList,0x3B60536E,0xAD29,0x4E64,0xA2,0x69,0xF8,0x53,0x83,0x7E,0x5E,0x53);
-DEFINE_GUID(IID_ID3D12VideoProcessCommandList,0xAEB2543A,0x167F,0x4682,0xAC,0xC8,0xD1,0x59,0xED,0x4A,0x62,0x09);
-DEFINE_GUID(IID_ID3D12VideoDecodeCommandList1,0xD52F011B,0xB56E,0x453C,0xA0,0x5A,0xA7,0xF3,0x11,0xC8,0xF4,0x72);
-DEFINE_GUID(IID_ID3D12VideoProcessCommandList1,0x542C5C4D,0x7596,0x434F,0x8C,0x93,0x4E,0xFA,0x67,0x66,0xF2,0x67);
-DEFINE_GUID(IID_ID3D12VideoMotionEstimator,0x33FDAE0E,0x098B,0x428F,0x87,0xBB,0x34,0xB6,0x95,0xDE,0x08,0xF8);
-DEFINE_GUID(IID_ID3D12VideoMotionVectorHeap,0x5BE17987,0x743A,0x4061,0x83,0x4B,0x23,0xD2,0x2D,0xAE,0xA5,0x05);
-DEFINE_GUID(IID_ID3D12VideoDevice1,0x981611AD,0xA144,0x4C83,0x98,0x90,0xF3,0x0E,0x26,0xD6,0x58,0xAB);
-DEFINE_GUID(IID_ID3D12VideoEncodeCommandList,0x8455293A,0x0CBD,0x4831,0x9B,0x39,0xFB,0xDB,0xAB,0x72,0x47,0x23);
-
-
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0012_v0_0_c_ifspec;
-extern RPC_IF_HANDLE __MIDL_itf_d3d12video_0000_0012_v0_0_s_ifspec;
-
-/* Additional Prototypes for ALL interfaces */
-
-/* end of Additional Prototypes */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-
-
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/d3dx12.h b/3rdparty/bgfx/3rdparty/dxsdk/include/d3dx12.h
deleted file mode 100644
index 36aebf8a614..00000000000
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/d3dx12.h
+++ /dev/null
@@ -1,1522 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// Copyright (C) Microsoft Corporation. All Rights Reserved.
-//
-// File: d3dx12.h
-// Content: D3DX12 utility library
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef __D3DX12_H__
-#define __D3DX12_H__
-
-#include "d3d12.h"
-
-#if defined( __cplusplus )
-
-struct CD3DX12_DEFAULT {};
-extern const DECLSPEC_SELECTANY CD3DX12_DEFAULT D3D12_DEFAULT;
-
-//------------------------------------------------------------------------------------------------
-inline bool operator==( const D3D12_VIEWPORT& l, const D3D12_VIEWPORT& r )
-{
- return l.TopLeftX == r.TopLeftX && l.TopLeftY == r.TopLeftY && l.Width == r.Width &&
- l.Height == r.Height && l.MinDepth == r.MinDepth && l.MaxDepth == r.MaxDepth;
-}
-
-//------------------------------------------------------------------------------------------------
-inline bool operator!=( const D3D12_VIEWPORT& l, const D3D12_VIEWPORT& r )
-{ return !( l == r ); }
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_RECT : public D3D12_RECT
-{
- CD3DX12_RECT()
- {}
- explicit CD3DX12_RECT( const D3D12_RECT& o ) :
- D3D12_RECT( o )
- {}
- explicit CD3DX12_RECT(
- LONG Left,
- LONG Top,
- LONG Right,
- LONG Bottom )
- {
- left = Left;
- top = Top;
- right = Right;
- bottom = Bottom;
- }
- ~CD3DX12_RECT() {}
-// operator const D3D12_RECT&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_BOX : public D3D12_BOX
-{
- CD3DX12_BOX()
- {}
- explicit CD3DX12_BOX( const D3D12_BOX& o ) :
- D3D12_BOX( o )
- {}
- explicit CD3DX12_BOX(
- LONG Left,
- LONG Right )
- {
- left = Left;
- top = 0;
- front = 0;
- right = Right;
- bottom = 1;
- back = 1;
- }
- explicit CD3DX12_BOX(
- LONG Left,
- LONG Top,
- LONG Right,
- LONG Bottom )
- {
- left = Left;
- top = Top;
- front = 0;
- right = Right;
- bottom = Bottom;
- back = 1;
- }
- explicit CD3DX12_BOX(
- LONG Left,
- LONG Top,
- LONG Front,
- LONG Right,
- LONG Bottom,
- LONG Back )
- {
- left = Left;
- top = Top;
- front = Front;
- right = Right;
- bottom = Bottom;
- back = Back;
- }
- ~CD3DX12_BOX() {}
-// operator const D3D12_BOX&() const { return *this; }
-};
-inline bool operator==( const D3D12_BOX& l, const D3D12_BOX& r )
-{
- return l.left == r.left && l.top == r.top && l.front == r.front &&
- l.right == r.right && l.bottom == r.bottom && l.back == r.back;
-}
-inline bool operator!=( const D3D12_BOX& l, const D3D12_BOX& r )
-{ return !( l == r ); }
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_DEPTH_STENCIL_DESC : public D3D12_DEPTH_STENCIL_DESC
-{
- CD3DX12_DEPTH_STENCIL_DESC()
- {}
- explicit CD3DX12_DEPTH_STENCIL_DESC( const D3D12_DEPTH_STENCIL_DESC& o ) :
- D3D12_DEPTH_STENCIL_DESC( o )
- {}
- explicit CD3DX12_DEPTH_STENCIL_DESC( CD3DX12_DEFAULT )
- {
- DepthEnable = TRUE;
- DepthWriteMask = D3D12_DEPTH_WRITE_MASK_ALL;
- DepthFunc = D3D12_COMPARISON_FUNC_LESS;
- StencilEnable = FALSE;
- StencilReadMask = D3D12_DEFAULT_STENCIL_READ_MASK;
- StencilWriteMask = D3D12_DEFAULT_STENCIL_WRITE_MASK;
- const D3D12_DEPTH_STENCILOP_DESC defaultStencilOp =
- { D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_STENCIL_OP_KEEP, D3D12_COMPARISON_FUNC_ALWAYS };
- FrontFace = defaultStencilOp;
- BackFace = defaultStencilOp;
- }
- explicit CD3DX12_DEPTH_STENCIL_DESC(
- BOOL depthEnable,
- D3D12_DEPTH_WRITE_MASK depthWriteMask,
- D3D12_COMPARISON_FUNC depthFunc,
- BOOL stencilEnable,
- UINT8 stencilReadMask,
- UINT8 stencilWriteMask,
- D3D12_STENCIL_OP frontStencilFailOp,
- D3D12_STENCIL_OP frontStencilDepthFailOp,
- D3D12_STENCIL_OP frontStencilPassOp,
- D3D12_COMPARISON_FUNC frontStencilFunc,
- D3D12_STENCIL_OP backStencilFailOp,
- D3D12_STENCIL_OP backStencilDepthFailOp,
- D3D12_STENCIL_OP backStencilPassOp,
- D3D12_COMPARISON_FUNC backStencilFunc )
- {
- DepthEnable = depthEnable;
- DepthWriteMask = depthWriteMask;
- DepthFunc = depthFunc;
- StencilEnable = stencilEnable;
- StencilReadMask = stencilReadMask;
- StencilWriteMask = stencilWriteMask;
- FrontFace.StencilFailOp = frontStencilFailOp;
- FrontFace.StencilDepthFailOp = frontStencilDepthFailOp;
- FrontFace.StencilPassOp = frontStencilPassOp;
- FrontFace.StencilFunc = frontStencilFunc;
- BackFace.StencilFailOp = backStencilFailOp;
- BackFace.StencilDepthFailOp = backStencilDepthFailOp;
- BackFace.StencilPassOp = backStencilPassOp;
- BackFace.StencilFunc = backStencilFunc;
- }
- ~CD3DX12_DEPTH_STENCIL_DESC() {}
-// operator const D3D12_DEPTH_STENCIL_DESC&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_BLEND_DESC : public D3D12_BLEND_DESC
-{
- CD3DX12_BLEND_DESC()
- {}
- explicit CD3DX12_BLEND_DESC( const D3D12_BLEND_DESC& o ) :
- D3D12_BLEND_DESC( o )
- {}
- explicit CD3DX12_BLEND_DESC( CD3DX12_DEFAULT )
- {
- AlphaToCoverageEnable = FALSE;
- IndependentBlendEnable = FALSE;
- const D3D12_RENDER_TARGET_BLEND_DESC defaultRenderTargetBlendDesc =
- {
- FALSE,FALSE,
- D3D12_BLEND_ONE, D3D12_BLEND_ZERO, D3D12_BLEND_OP_ADD,
- D3D12_BLEND_ONE, D3D12_BLEND_ZERO, D3D12_BLEND_OP_ADD,
- D3D12_LOGIC_OP_NOOP,
- D3D12_COLOR_WRITE_ENABLE_ALL,
- };
- for (UINT i = 0; i < D3D12_SIMULTANEOUS_RENDER_TARGET_COUNT; ++i)
- RenderTarget[ i ] = defaultRenderTargetBlendDesc;
- }
- ~CD3DX12_BLEND_DESC() {}
-// operator const D3D12_BLEND_DESC&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_RASTERIZER_DESC : public D3D12_RASTERIZER_DESC
-{
- CD3DX12_RASTERIZER_DESC()
- {}
- explicit CD3DX12_RASTERIZER_DESC( const D3D12_RASTERIZER_DESC& o ) :
- D3D12_RASTERIZER_DESC( o )
- {}
- explicit CD3DX12_RASTERIZER_DESC( CD3DX12_DEFAULT )
- {
- FillMode = D3D12_FILL_MODE_SOLID;
- CullMode = D3D12_CULL_MODE_BACK;
- FrontCounterClockwise = FALSE;
- DepthBias = D3D12_DEFAULT_DEPTH_BIAS;
- DepthBiasClamp = D3D12_DEFAULT_DEPTH_BIAS_CLAMP;
- SlopeScaledDepthBias = D3D12_DEFAULT_SLOPE_SCALED_DEPTH_BIAS;
- DepthClipEnable = TRUE;
- MultisampleEnable = FALSE;
- AntialiasedLineEnable = FALSE;
- ForcedSampleCount = 0;
- ConservativeRaster = D3D12_CONSERVATIVE_RASTERIZATION_MODE_OFF;
- }
- explicit CD3DX12_RASTERIZER_DESC(
- D3D12_FILL_MODE fillMode,
- D3D12_CULL_MODE cullMode,
- BOOL frontCounterClockwise,
- INT depthBias,
- FLOAT depthBiasClamp,
- FLOAT slopeScaledDepthBias,
- BOOL depthClipEnable,
- BOOL multisampleEnable,
- BOOL antialiasedLineEnable,
- UINT forcedSampleCount,
- D3D12_CONSERVATIVE_RASTERIZATION_MODE conservativeRaster)
- {
- FillMode = fillMode;
- CullMode = cullMode;
- FrontCounterClockwise = frontCounterClockwise;
- DepthBias = depthBias;
- DepthBiasClamp = depthBiasClamp;
- SlopeScaledDepthBias = slopeScaledDepthBias;
- DepthClipEnable = depthClipEnable;
- MultisampleEnable = multisampleEnable;
- AntialiasedLineEnable = antialiasedLineEnable;
- ForcedSampleCount = forcedSampleCount;
- ConservativeRaster = conservativeRaster;
- }
- ~CD3DX12_RASTERIZER_DESC() {}
-// operator const D3D12_RASTERIZER_DESC&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_RESOURCE_ALLOCATION_INFO : public D3D12_RESOURCE_ALLOCATION_INFO
-{
- CD3DX12_RESOURCE_ALLOCATION_INFO()
- {}
- explicit CD3DX12_RESOURCE_ALLOCATION_INFO( const D3D12_RESOURCE_ALLOCATION_INFO& o ) :
- D3D12_RESOURCE_ALLOCATION_INFO( o )
- {}
- CD3DX12_RESOURCE_ALLOCATION_INFO(
- UINT64 size,
- UINT64 alignment )
- {
- SizeInBytes = size;
- Alignment = alignment;
- }
-// operator const D3D12_RESOURCE_ALLOCATION_INFO&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_HEAP_PROPERTIES : public D3D12_HEAP_PROPERTIES
-{
- CD3DX12_HEAP_PROPERTIES()
- {}
- explicit CD3DX12_HEAP_PROPERTIES(const D3D12_HEAP_PROPERTIES &o) :
- D3D12_HEAP_PROPERTIES(o)
- {}
- CD3DX12_HEAP_PROPERTIES(
- D3D12_CPU_PAGE_PROPERTY cpuPageProperty,
- D3D12_MEMORY_POOL memoryPoolPreference,
- UINT creationNodeMask = 1,
- UINT nodeMask = 1 )
- {
- Type = D3D12_HEAP_TYPE_CUSTOM;
- CPUPageProperty = cpuPageProperty;
- MemoryPoolPreference = memoryPoolPreference;
- CreationNodeMask = creationNodeMask;
- VisibleNodeMask = nodeMask;
- }
- explicit CD3DX12_HEAP_PROPERTIES(
- D3D12_HEAP_TYPE type,
- UINT creationNodeMask = 1,
- UINT nodeMask = 1 )
- {
- Type = type;
- CPUPageProperty = D3D12_CPU_PAGE_PROPERTY_UNKNOWN;
- MemoryPoolPreference = D3D12_MEMORY_POOL_UNKNOWN;
- CreationNodeMask = creationNodeMask;
- VisibleNodeMask = nodeMask;
- }
-// operator const D3D12_HEAP_PROPERTIES&() const { return *this; }
- bool IsCPUAccessible() const
- {
- return Type == D3D12_HEAP_TYPE_UPLOAD || Type == D3D12_HEAP_TYPE_READBACK || (Type == D3D12_HEAP_TYPE_CUSTOM &&
- (CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_COMBINE || CPUPageProperty == D3D12_CPU_PAGE_PROPERTY_WRITE_BACK));
- }
-};
-inline bool operator==( const D3D12_HEAP_PROPERTIES& l, const D3D12_HEAP_PROPERTIES& r )
-{
- return l.Type == r.Type && l.CPUPageProperty == r.CPUPageProperty &&
- l.MemoryPoolPreference == r.MemoryPoolPreference &&
- l.CreationNodeMask == r.CreationNodeMask &&
- l.VisibleNodeMask == r.VisibleNodeMask;
-}
-inline bool operator!=( const D3D12_HEAP_PROPERTIES& l, const D3D12_HEAP_PROPERTIES& r )
-{ return !( l == r ); }
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_HEAP_DESC : public D3D12_HEAP_DESC
-{
- CD3DX12_HEAP_DESC()
- {}
- explicit CD3DX12_HEAP_DESC(const D3D12_HEAP_DESC &o) :
- D3D12_HEAP_DESC(o)
- {}
- CD3DX12_HEAP_DESC(
- UINT64 size,
- D3D12_HEAP_PROPERTIES properties,
- UINT64 alignment = 0,
- D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
- {
- SizeInBytes = size;
- Properties = properties;
- Alignment = alignment;
- Flags = flags;
- }
- CD3DX12_HEAP_DESC(
- UINT64 size,
- D3D12_HEAP_TYPE type,
- UINT64 alignment = 0,
- D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
- {
- SizeInBytes = size;
- Properties = CD3DX12_HEAP_PROPERTIES( type );
- Alignment = alignment;
- Flags = flags;
- }
- CD3DX12_HEAP_DESC(
- UINT64 size,
- D3D12_CPU_PAGE_PROPERTY cpuPageProperty,
- D3D12_MEMORY_POOL memoryPoolPreference,
- UINT64 alignment = 0,
- D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
- {
- SizeInBytes = size;
- Properties = CD3DX12_HEAP_PROPERTIES( cpuPageProperty, memoryPoolPreference );
- Alignment = alignment;
- Flags = flags;
- }
- CD3DX12_HEAP_DESC(
- const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
- D3D12_HEAP_PROPERTIES properties,
- D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
- {
- SizeInBytes = resAllocInfo.SizeInBytes;
- Properties = properties;
- Alignment = resAllocInfo.Alignment;
- Flags = flags;
- }
- CD3DX12_HEAP_DESC(
- const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
- D3D12_HEAP_TYPE type,
- D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
- {
- SizeInBytes = resAllocInfo.SizeInBytes;
- Properties = CD3DX12_HEAP_PROPERTIES( type );
- Alignment = resAllocInfo.Alignment;
- Flags = flags;
- }
- CD3DX12_HEAP_DESC(
- const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
- D3D12_CPU_PAGE_PROPERTY cpuPageProperty,
- D3D12_MEMORY_POOL memoryPoolPreference,
- D3D12_HEAP_FLAGS flags = D3D12_HEAP_FLAG_NONE )
- {
- SizeInBytes = resAllocInfo.SizeInBytes;
- Properties = CD3DX12_HEAP_PROPERTIES( cpuPageProperty, memoryPoolPreference );
- Alignment = resAllocInfo.Alignment;
- Flags = flags;
- }
-// operator const D3D12_HEAP_DESC&() const { return *this; }
- bool IsCPUAccessible() const
- { return static_cast< const CD3DX12_HEAP_PROPERTIES* >( &Properties )->IsCPUAccessible(); }
-};
-inline bool operator==( const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r )
-{
- return l.SizeInBytes == r.SizeInBytes &&
- l.Properties == r.Properties &&
- l.Alignment == r.Alignment &&
- l.Flags == r.Flags;
-}
-inline bool operator!=( const D3D12_HEAP_DESC& l, const D3D12_HEAP_DESC& r )
-{ return !( l == r ); }
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_CLEAR_VALUE : public D3D12_CLEAR_VALUE
-{
- CD3DX12_CLEAR_VALUE()
- {}
- explicit CD3DX12_CLEAR_VALUE(const D3D12_CLEAR_VALUE &o) :
- D3D12_CLEAR_VALUE(o)
- {}
- CD3DX12_CLEAR_VALUE(
- DXGI_FORMAT format,
- const FLOAT color[4] )
- {
- Format = format;
- memcpy( Color, color, sizeof( Color ) );
- }
- CD3DX12_CLEAR_VALUE(
- DXGI_FORMAT format,
- FLOAT depth,
- UINT8 stencil )
- {
- Format = format;
- /* Use memcpy to preserve NAN values */
- memcpy( &DepthStencil.Depth, &depth, sizeof( depth ) );
- DepthStencil.Stencil = stencil;
- }
-// operator const D3D12_CLEAR_VALUE&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_RANGE : public D3D12_RANGE
-{
- CD3DX12_RANGE()
- {}
- explicit CD3DX12_RANGE(const D3D12_RANGE &o) :
- D3D12_RANGE(o)
- {}
- CD3DX12_RANGE(
- SIZE_T begin,
- SIZE_T end )
- {
- Begin = begin;
- End = end;
- }
-// operator const D3D12_RANGE&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_TILED_RESOURCE_COORDINATE : public D3D12_TILED_RESOURCE_COORDINATE
-{
- CD3DX12_TILED_RESOURCE_COORDINATE()
- {}
- explicit CD3DX12_TILED_RESOURCE_COORDINATE(const D3D12_TILED_RESOURCE_COORDINATE &o) :
- D3D12_TILED_RESOURCE_COORDINATE(o)
- {}
- CD3DX12_TILED_RESOURCE_COORDINATE(
- UINT x,
- UINT y,
- UINT z,
- UINT subresource )
- {
- X = x;
- Y = y;
- Z = z;
- Subresource = subresource;
- }
-// operator const D3D12_TILED_RESOURCE_COORDINATE&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_TILE_REGION_SIZE : public D3D12_TILE_REGION_SIZE
-{
- CD3DX12_TILE_REGION_SIZE()
- {}
- explicit CD3DX12_TILE_REGION_SIZE(const D3D12_TILE_REGION_SIZE &o) :
- D3D12_TILE_REGION_SIZE(o)
- {}
- CD3DX12_TILE_REGION_SIZE(
- UINT numTiles,
- BOOL useBox,
- UINT width,
- UINT16 height,
- UINT16 depth )
- {
- NumTiles = numTiles;
- UseBox = useBox;
- Width = width;
- Height = height;
- Depth = depth;
- }
-// operator const D3D12_TILE_REGION_SIZE&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_SUBRESOURCE_TILING : public D3D12_SUBRESOURCE_TILING
-{
- CD3DX12_SUBRESOURCE_TILING()
- {}
- explicit CD3DX12_SUBRESOURCE_TILING(const D3D12_SUBRESOURCE_TILING &o) :
- D3D12_SUBRESOURCE_TILING(o)
- {}
- CD3DX12_SUBRESOURCE_TILING(
- UINT widthInTiles,
- UINT16 heightInTiles,
- UINT16 depthInTiles,
- UINT startTileIndexInOverallResource )
- {
- WidthInTiles = widthInTiles;
- HeightInTiles = heightInTiles;
- DepthInTiles = depthInTiles;
- StartTileIndexInOverallResource = startTileIndexInOverallResource;
- }
-// operator const D3D12_SUBRESOURCE_TILING&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_TILE_SHAPE : public D3D12_TILE_SHAPE
-{
- CD3DX12_TILE_SHAPE()
- {}
- explicit CD3DX12_TILE_SHAPE(const D3D12_TILE_SHAPE &o) :
- D3D12_TILE_SHAPE(o)
- {}
- CD3DX12_TILE_SHAPE(
- UINT widthInTexels,
- UINT heightInTexels,
- UINT depthInTexels )
- {
- WidthInTexels = widthInTexels;
- HeightInTexels = heightInTexels;
- DepthInTexels = depthInTexels;
- }
-// operator const D3D12_TILE_SHAPE&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_RESOURCE_BARRIER : public D3D12_RESOURCE_BARRIER
-{
- CD3DX12_RESOURCE_BARRIER()
- {}
- explicit CD3DX12_RESOURCE_BARRIER(const D3D12_RESOURCE_BARRIER &o) :
- D3D12_RESOURCE_BARRIER(o)
- {}
- static inline CD3DX12_RESOURCE_BARRIER Transition(
- _In_ ID3D12Resource* pResource,
- D3D12_RESOURCE_STATES stateBefore,
- D3D12_RESOURCE_STATES stateAfter,
- UINT subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES,
- D3D12_RESOURCE_BARRIER_FLAGS flags = D3D12_RESOURCE_BARRIER_FLAG_NONE)
- {
- CD3DX12_RESOURCE_BARRIER result;
- ZeroMemory(&result, sizeof(result));
- D3D12_RESOURCE_BARRIER &barrier = result;
- result.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION;
- result.Flags = flags;
- barrier.Transition.pResource = pResource;
- barrier.Transition.StateBefore = stateBefore;
- barrier.Transition.StateAfter = stateAfter;
- barrier.Transition.Subresource = subresource;
- return result;
- }
- static inline CD3DX12_RESOURCE_BARRIER Aliasing(
- _In_ ID3D12Resource* pResourceBefore,
- _In_ ID3D12Resource* pResourceAfter)
- {
- CD3DX12_RESOURCE_BARRIER result;
- ZeroMemory(&result, sizeof(result));
- D3D12_RESOURCE_BARRIER &barrier = result;
- result.Type = D3D12_RESOURCE_BARRIER_TYPE_ALIASING;
- barrier.Aliasing.pResourceBefore = pResourceBefore;
- barrier.Aliasing.pResourceAfter = pResourceAfter;
- return result;
- }
- static inline CD3DX12_RESOURCE_BARRIER UAV(
- _In_ ID3D12Resource* pResource)
- {
- CD3DX12_RESOURCE_BARRIER result;
- ZeroMemory(&result, sizeof(result));
- D3D12_RESOURCE_BARRIER &barrier = result;
- result.Type = D3D12_RESOURCE_BARRIER_TYPE_UAV;
- barrier.UAV.pResource = pResource;
- return result;
- }
-// operator const D3D12_RESOURCE_BARRIER&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_PACKED_MIP_INFO : public D3D12_PACKED_MIP_INFO
-{
- CD3DX12_PACKED_MIP_INFO()
- {}
- explicit CD3DX12_PACKED_MIP_INFO(const D3D12_PACKED_MIP_INFO &o) :
- D3D12_PACKED_MIP_INFO(o)
- {}
- CD3DX12_PACKED_MIP_INFO(
- UINT8 numStandardMips,
- UINT8 numPackedMips,
- UINT numTilesForPackedMips,
- UINT startTileIndexInOverallResource )
- {
- NumStandardMips = numStandardMips;
- NumPackedMips = numPackedMips;
- NumTilesForPackedMips = numTilesForPackedMips;
- StartTileIndexInOverallResource = startTileIndexInOverallResource;
- }
-// operator const D3D12_PACKED_MIP_INFO&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_SUBRESOURCE_FOOTPRINT : public D3D12_SUBRESOURCE_FOOTPRINT
-{
- CD3DX12_SUBRESOURCE_FOOTPRINT()
- {}
- explicit CD3DX12_SUBRESOURCE_FOOTPRINT(const D3D12_SUBRESOURCE_FOOTPRINT &o) :
- D3D12_SUBRESOURCE_FOOTPRINT(o)
- {}
- CD3DX12_SUBRESOURCE_FOOTPRINT(
- DXGI_FORMAT format,
- UINT width,
- UINT height,
- UINT depth,
- UINT rowPitch )
- {
- Format = format;
- Width = width;
- Height = height;
- Depth = depth;
- RowPitch = rowPitch;
- }
- explicit CD3DX12_SUBRESOURCE_FOOTPRINT(
- const D3D12_RESOURCE_DESC& resDesc,
- UINT rowPitch )
- {
- Format = resDesc.Format;
- Width = UINT( resDesc.Width );
- Height = resDesc.Height;
- Depth = (resDesc.Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? resDesc.DepthOrArraySize : 1);
- RowPitch = rowPitch;
- }
-// operator const D3D12_SUBRESOURCE_FOOTPRINT&() const { return *this; }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_TEXTURE_COPY_LOCATION : public D3D12_TEXTURE_COPY_LOCATION
-{
- CD3DX12_TEXTURE_COPY_LOCATION()
- {}
- explicit CD3DX12_TEXTURE_COPY_LOCATION(const D3D12_TEXTURE_COPY_LOCATION &o) :
- D3D12_TEXTURE_COPY_LOCATION(o)
- {}
- CD3DX12_TEXTURE_COPY_LOCATION(ID3D12Resource* pRes) { pResource = pRes; }
- CD3DX12_TEXTURE_COPY_LOCATION(ID3D12Resource* pRes, D3D12_PLACED_SUBRESOURCE_FOOTPRINT const& Footprint)
- {
- pResource = pRes;
- Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
- PlacedFootprint = Footprint;
- }
- CD3DX12_TEXTURE_COPY_LOCATION(ID3D12Resource* pRes, UINT Sub)
- {
- pResource = pRes;
- Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
- SubresourceIndex = Sub;
- }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_DESCRIPTOR_RANGE : public D3D12_DESCRIPTOR_RANGE
-{
- CD3DX12_DESCRIPTOR_RANGE() { }
- explicit CD3DX12_DESCRIPTOR_RANGE(const D3D12_DESCRIPTOR_RANGE &o) :
- D3D12_DESCRIPTOR_RANGE(o)
- {}
- CD3DX12_DESCRIPTOR_RANGE(
- D3D12_DESCRIPTOR_RANGE_TYPE rangeType,
- UINT numDescriptors,
- UINT baseShaderRegister,
- UINT registerSpace = 0,
- UINT offsetInDescriptorsFromTableStart =
- D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
- {
- Init(rangeType, numDescriptors, baseShaderRegister, registerSpace, offsetInDescriptorsFromTableStart);
- }
-
- inline void Init(
- D3D12_DESCRIPTOR_RANGE_TYPE rangeType,
- UINT numDescriptors,
- UINT baseShaderRegister,
- UINT registerSpace = 0,
- UINT offsetInDescriptorsFromTableStart =
- D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
- {
- Init(*this, rangeType, numDescriptors, baseShaderRegister, registerSpace, offsetInDescriptorsFromTableStart);
- }
-
- static inline void Init(
- _Out_ D3D12_DESCRIPTOR_RANGE &range,
- D3D12_DESCRIPTOR_RANGE_TYPE rangeType,
- UINT numDescriptors,
- UINT baseShaderRegister,
- UINT registerSpace = 0,
- UINT offsetInDescriptorsFromTableStart =
- D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND)
- {
- range.RangeType = rangeType;
- range.NumDescriptors = numDescriptors;
- range.BaseShaderRegister = baseShaderRegister;
- range.RegisterSpace = registerSpace;
- range.OffsetInDescriptorsFromTableStart = offsetInDescriptorsFromTableStart;
- }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_ROOT_DESCRIPTOR_TABLE : public D3D12_ROOT_DESCRIPTOR_TABLE
-{
- CD3DX12_ROOT_DESCRIPTOR_TABLE() {}
- explicit CD3DX12_ROOT_DESCRIPTOR_TABLE(const D3D12_ROOT_DESCRIPTOR_TABLE &o) :
- D3D12_ROOT_DESCRIPTOR_TABLE(o)
- {}
- CD3DX12_ROOT_DESCRIPTOR_TABLE(
- UINT numDescriptorRanges,
- _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges)
- {
- Init(numDescriptorRanges, _pDescriptorRanges);
- }
-
- inline void Init(
- UINT numDescriptorRanges,
- _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges)
- {
- Init(*this, numDescriptorRanges, _pDescriptorRanges);
- }
-
- static inline void Init(
- _Out_ D3D12_ROOT_DESCRIPTOR_TABLE &rootDescriptorTable,
- UINT numDescriptorRanges,
- _In_reads_opt_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* _pDescriptorRanges)
- {
- rootDescriptorTable.NumDescriptorRanges = numDescriptorRanges;
- rootDescriptorTable.pDescriptorRanges = _pDescriptorRanges;
- }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_ROOT_CONSTANTS : public D3D12_ROOT_CONSTANTS
-{
- CD3DX12_ROOT_CONSTANTS() {}
- explicit CD3DX12_ROOT_CONSTANTS(const D3D12_ROOT_CONSTANTS &o) :
- D3D12_ROOT_CONSTANTS(o)
- {}
- CD3DX12_ROOT_CONSTANTS(
- UINT num32BitValues,
- UINT shaderRegister,
- UINT registerSpace = 0)
- {
- Init(num32BitValues, shaderRegister, registerSpace);
- }
-
- inline void Init(
- UINT num32BitValues,
- UINT shaderRegister,
- UINT registerSpace = 0)
- {
- Init(*this, num32BitValues, shaderRegister, registerSpace);
- }
-
- static inline void Init(
- _Out_ D3D12_ROOT_CONSTANTS &rootConstants,
- UINT num32BitValues,
- UINT shaderRegister,
- UINT registerSpace = 0)
- {
- rootConstants.Num32BitValues = num32BitValues;
- rootConstants.ShaderRegister = shaderRegister;
- rootConstants.RegisterSpace = registerSpace;
- }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_ROOT_DESCRIPTOR : public D3D12_ROOT_DESCRIPTOR
-{
- CD3DX12_ROOT_DESCRIPTOR() {}
- explicit CD3DX12_ROOT_DESCRIPTOR(const D3D12_ROOT_DESCRIPTOR &o) :
- D3D12_ROOT_DESCRIPTOR(o)
- {}
- CD3DX12_ROOT_DESCRIPTOR(
- UINT shaderRegister,
- UINT registerSpace = 0)
- {
- Init(shaderRegister, registerSpace);
- }
-
- inline void Init(
- UINT shaderRegister,
- UINT registerSpace = 0)
- {
- Init(*this, shaderRegister, registerSpace);
- }
-
- static inline void Init(_Out_ D3D12_ROOT_DESCRIPTOR &table, UINT shaderRegister, UINT registerSpace = 0)
- {
- table.ShaderRegister = shaderRegister;
- table.RegisterSpace = registerSpace;
- }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_ROOT_PARAMETER : public D3D12_ROOT_PARAMETER
-{
- CD3DX12_ROOT_PARAMETER() {}
- explicit CD3DX12_ROOT_PARAMETER(const D3D12_ROOT_PARAMETER &o) :
- D3D12_ROOT_PARAMETER(o)
- {}
-
- static inline void InitAsDescriptorTable(
- _Out_ D3D12_ROOT_PARAMETER &rootParam,
- UINT numDescriptorRanges,
- _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* pDescriptorRanges,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
- {
- rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_DESCRIPTOR_TABLE;
- rootParam.ShaderVisibility = visibility;
- CD3DX12_ROOT_DESCRIPTOR_TABLE::Init(rootParam.DescriptorTable, numDescriptorRanges, pDescriptorRanges);
- }
-
- static inline void InitAsConstants(
- _Out_ D3D12_ROOT_PARAMETER &rootParam,
- UINT num32BitValues,
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
- {
- rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_32BIT_CONSTANTS;
- rootParam.ShaderVisibility = visibility;
- CD3DX12_ROOT_CONSTANTS::Init(rootParam.Constants, num32BitValues, shaderRegister, registerSpace);
- }
-
- static inline void InitAsConstantBufferView(
- _Out_ D3D12_ROOT_PARAMETER &rootParam,
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
- {
- rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_CBV;
- rootParam.ShaderVisibility = visibility;
- CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace);
- }
-
- static inline void InitAsShaderResourceView(
- _Out_ D3D12_ROOT_PARAMETER &rootParam,
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
- {
- rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_SRV;
- rootParam.ShaderVisibility = visibility;
- CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace);
- }
-
- static inline void InitAsUnorderedAccessView(
- _Out_ D3D12_ROOT_PARAMETER &rootParam,
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
- {
- rootParam.ParameterType = D3D12_ROOT_PARAMETER_TYPE_UAV;
- rootParam.ShaderVisibility = visibility;
- CD3DX12_ROOT_DESCRIPTOR::Init(rootParam.Descriptor, shaderRegister, registerSpace);
- }
-
- inline void InitAsDescriptorTable(
- UINT numDescriptorRanges,
- _In_reads_(numDescriptorRanges) const D3D12_DESCRIPTOR_RANGE* pDescriptorRanges,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
- {
- InitAsDescriptorTable(*this, numDescriptorRanges, pDescriptorRanges, visibility);
- }
-
- inline void InitAsConstants(
- UINT num32BitValues,
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
- {
- InitAsConstants(*this, num32BitValues, shaderRegister, registerSpace, visibility);
- }
-
- inline void InitAsConstantBufferView(
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
- {
- InitAsConstantBufferView(*this, shaderRegister, registerSpace, visibility);
- }
-
- inline void InitAsShaderResourceView(
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
- {
- InitAsShaderResourceView(*this, shaderRegister, registerSpace, visibility);
- }
-
- inline void InitAsUnorderedAccessView(
- UINT shaderRegister,
- UINT registerSpace = 0,
- D3D12_SHADER_VISIBILITY visibility = D3D12_SHADER_VISIBILITY_ALL)
- {
- InitAsUnorderedAccessView(*this, shaderRegister, registerSpace, visibility);
- }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_STATIC_SAMPLER_DESC : public D3D12_STATIC_SAMPLER_DESC
-{
- CD3DX12_STATIC_SAMPLER_DESC() {}
- explicit CD3DX12_STATIC_SAMPLER_DESC(const D3D12_STATIC_SAMPLER_DESC &o) :
- D3D12_STATIC_SAMPLER_DESC(o)
- {}
- CD3DX12_STATIC_SAMPLER_DESC(
- UINT shaderRegister,
- D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC,
- D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
- D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
- D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
- FLOAT mipLODBias = 0,
- UINT maxAnisotropy = 16,
- D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL,
- D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE,
- FLOAT minLOD = 0.f,
- FLOAT maxLOD = D3D12_FLOAT32_MAX,
- D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL,
- UINT registerSpace = 0)
- {
- Init(
- shaderRegister,
- filter,
- addressU,
- addressV,
- addressW,
- mipLODBias,
- maxAnisotropy,
- comparisonFunc,
- borderColor,
- minLOD,
- maxLOD,
- shaderVisibility,
- registerSpace);
- }
-
- static inline void Init(
- _Out_ D3D12_STATIC_SAMPLER_DESC &samplerDesc,
- UINT shaderRegister,
- D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC,
- D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
- D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
- D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
- FLOAT mipLODBias = 0,
- UINT maxAnisotropy = 16,
- D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL,
- D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE,
- FLOAT minLOD = 0.f,
- FLOAT maxLOD = D3D12_FLOAT32_MAX,
- D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL,
- UINT registerSpace = 0)
- {
- samplerDesc.ShaderRegister = shaderRegister;
- samplerDesc.Filter = filter;
- samplerDesc.AddressU = addressU;
- samplerDesc.AddressV = addressV;
- samplerDesc.AddressW = addressW;
- samplerDesc.MipLODBias = mipLODBias;
- samplerDesc.MaxAnisotropy = maxAnisotropy;
- samplerDesc.ComparisonFunc = comparisonFunc;
- samplerDesc.BorderColor = borderColor;
- samplerDesc.MinLOD = minLOD;
- samplerDesc.MaxLOD = maxLOD;
- samplerDesc.ShaderVisibility = shaderVisibility;
- samplerDesc.RegisterSpace = registerSpace;
- }
- inline void Init(
- UINT shaderRegister,
- D3D12_FILTER filter = D3D12_FILTER_ANISOTROPIC,
- D3D12_TEXTURE_ADDRESS_MODE addressU = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
- D3D12_TEXTURE_ADDRESS_MODE addressV = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
- D3D12_TEXTURE_ADDRESS_MODE addressW = D3D12_TEXTURE_ADDRESS_MODE_WRAP,
- FLOAT mipLODBias = 0,
- UINT maxAnisotropy = 16,
- D3D12_COMPARISON_FUNC comparisonFunc = D3D12_COMPARISON_FUNC_LESS_EQUAL,
- D3D12_STATIC_BORDER_COLOR borderColor = D3D12_STATIC_BORDER_COLOR_OPAQUE_WHITE,
- FLOAT minLOD = 0.f,
- FLOAT maxLOD = D3D12_FLOAT32_MAX,
- D3D12_SHADER_VISIBILITY shaderVisibility = D3D12_SHADER_VISIBILITY_ALL,
- UINT registerSpace = 0)
- {
- Init(
- *this,
- shaderRegister,
- filter,
- addressU,
- addressV,
- addressW,
- mipLODBias,
- maxAnisotropy,
- comparisonFunc,
- borderColor,
- minLOD,
- maxLOD,
- shaderVisibility,
- registerSpace);
- }
-
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_ROOT_SIGNATURE_DESC : public D3D12_ROOT_SIGNATURE_DESC
-{
- CD3DX12_ROOT_SIGNATURE_DESC() {}
- explicit CD3DX12_ROOT_SIGNATURE_DESC(const D3D12_ROOT_SIGNATURE_DESC &o) :
- D3D12_ROOT_SIGNATURE_DESC(o)
- {}
- CD3DX12_ROOT_SIGNATURE_DESC(
- UINT numParameters,
- _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters,
- UINT numStaticSamplers = 0,
- _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = NULL,
- D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
- {
- Init(numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
- }
- CD3DX12_ROOT_SIGNATURE_DESC(CD3DX12_DEFAULT)
- {
- Init(0, NULL, 0, NULL, D3D12_ROOT_SIGNATURE_FLAG_NONE);
- }
-
- inline void Init(
- UINT numParameters,
- _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters,
- UINT numStaticSamplers = 0,
- _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = NULL,
- D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
- {
- Init(*this, numParameters, _pParameters, numStaticSamplers, _pStaticSamplers, flags);
- }
-
- static inline void Init(
- _Out_ D3D12_ROOT_SIGNATURE_DESC &desc,
- UINT numParameters,
- _In_reads_opt_(numParameters) const D3D12_ROOT_PARAMETER* _pParameters,
- UINT numStaticSamplers = 0,
- _In_reads_opt_(numStaticSamplers) const D3D12_STATIC_SAMPLER_DESC* _pStaticSamplers = NULL,
- D3D12_ROOT_SIGNATURE_FLAGS flags = D3D12_ROOT_SIGNATURE_FLAG_NONE)
- {
- desc.NumParameters = numParameters;
- desc.pParameters = _pParameters;
- desc.NumStaticSamplers = numStaticSamplers;
- desc.pStaticSamplers = _pStaticSamplers;
- desc.Flags = flags;
- }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_CPU_DESCRIPTOR_HANDLE : public D3D12_CPU_DESCRIPTOR_HANDLE
-{
- CD3DX12_CPU_DESCRIPTOR_HANDLE() {}
- explicit CD3DX12_CPU_DESCRIPTOR_HANDLE(const D3D12_CPU_DESCRIPTOR_HANDLE &o) :
- D3D12_CPU_DESCRIPTOR_HANDLE(o)
- {}
- CD3DX12_CPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) { ptr = 0; }
- CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize)
- {
- InitOffsetted(other, offsetScaledByIncrementSize);
- }
- CD3DX12_CPU_DESCRIPTOR_HANDLE(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize)
- {
- InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize);
- }
- CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize)
- {
- ptr += offsetInDescriptors * descriptorIncrementSize;
- return *this;
- }
- CD3DX12_CPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize)
- {
- ptr += offsetScaledByIncrementSize;
- return *this;
- }
- bool operator==(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other)
- {
- return (ptr == other.ptr);
- }
- bool operator!=(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE& other)
- {
- return (ptr != other.ptr);
- }
- CD3DX12_CPU_DESCRIPTOR_HANDLE &operator=(const D3D12_CPU_DESCRIPTOR_HANDLE &other)
- {
- ptr = other.ptr;
- return *this;
- }
-
- inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize)
- {
- InitOffsetted(*this, base, offsetScaledByIncrementSize);
- }
-
- inline void InitOffsetted(_In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize)
- {
- InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize);
- }
-
- static inline void InitOffsetted(_Out_ D3D12_CPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize)
- {
- handle.ptr = base.ptr + offsetScaledByIncrementSize;
- }
-
- static inline void InitOffsetted(_Out_ D3D12_CPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_CPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize)
- {
- handle.ptr = base.ptr + offsetInDescriptors * descriptorIncrementSize;
- }
-};
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_GPU_DESCRIPTOR_HANDLE : public D3D12_GPU_DESCRIPTOR_HANDLE
-{
- CD3DX12_GPU_DESCRIPTOR_HANDLE() {}
- explicit CD3DX12_GPU_DESCRIPTOR_HANDLE(const D3D12_GPU_DESCRIPTOR_HANDLE &o) :
- D3D12_GPU_DESCRIPTOR_HANDLE(o)
- {}
- CD3DX12_GPU_DESCRIPTOR_HANDLE(CD3DX12_DEFAULT) { ptr = 0; }
- CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetScaledByIncrementSize)
- {
- InitOffsetted(other, offsetScaledByIncrementSize);
- }
- CD3DX12_GPU_DESCRIPTOR_HANDLE(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &other, INT offsetInDescriptors, UINT descriptorIncrementSize)
- {
- InitOffsetted(other, offsetInDescriptors, descriptorIncrementSize);
- }
- CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetInDescriptors, UINT descriptorIncrementSize)
- {
- ptr += offsetInDescriptors * descriptorIncrementSize;
- return *this;
- }
- CD3DX12_GPU_DESCRIPTOR_HANDLE& Offset(INT offsetScaledByIncrementSize)
- {
- ptr += offsetScaledByIncrementSize;
- return *this;
- }
- inline bool operator==(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other)
- {
- return (ptr == other.ptr);
- }
- inline bool operator!=(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE& other)
- {
- return (ptr != other.ptr);
- }
- CD3DX12_GPU_DESCRIPTOR_HANDLE &operator=(const D3D12_GPU_DESCRIPTOR_HANDLE &other)
- {
- ptr = other.ptr;
- return *this;
- }
-
- inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize)
- {
- InitOffsetted(*this, base, offsetScaledByIncrementSize);
- }
-
- inline void InitOffsetted(_In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize)
- {
- InitOffsetted(*this, base, offsetInDescriptors, descriptorIncrementSize);
- }
-
- static inline void InitOffsetted(_Out_ D3D12_GPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetScaledByIncrementSize)
- {
- handle.ptr = base.ptr + offsetScaledByIncrementSize;
- }
-
- static inline void InitOffsetted(_Out_ D3D12_GPU_DESCRIPTOR_HANDLE &handle, _In_ const D3D12_GPU_DESCRIPTOR_HANDLE &base, INT offsetInDescriptors, UINT descriptorIncrementSize)
- {
- handle.ptr = base.ptr + offsetInDescriptors * descriptorIncrementSize;
- }
-};
-
-//------------------------------------------------------------------------------------------------
-inline UINT D3D12CalcSubresource( UINT MipSlice, UINT ArraySlice, UINT PlaneSlice, UINT MipLevels, UINT ArraySize )
-{
- return MipSlice + ArraySlice * MipLevels + PlaneSlice * MipLevels * ArraySize;
-}
-
-//------------------------------------------------------------------------------------------------
-template <typename T, typename U, typename V>
-inline void D3D12DecomposeSubresource( UINT Subresource, UINT MipLevels, UINT ArraySize, _Out_ T& MipSlice, _Out_ U& ArraySlice, _Out_ V& PlaneSlice )
-{
- MipSlice = static_cast<T>(Subresource % MipLevels);
- ArraySlice = static_cast<U>((Subresource / MipLevels) % ArraySize);
- PlaneSlice = static_cast<V>(Subresource / (MipLevels * ArraySize));
-}
-
-//------------------------------------------------------------------------------------------------
-inline UINT8 D3D12GetFormatPlaneCount(
- _In_ ID3D12Device* pDevice,
- DXGI_FORMAT Format
- )
-{
- D3D12_FEATURE_DATA_FORMAT_INFO formatInfo = {Format};
- if (FAILED(pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &formatInfo, sizeof(formatInfo))))
- {
- return 0;
- }
- return formatInfo.PlaneCount;
-}
-
-//------------------------------------------------------------------------------------------------
-struct CD3DX12_RESOURCE_DESC : public D3D12_RESOURCE_DESC
-{
- CD3DX12_RESOURCE_DESC()
- {}
- explicit CD3DX12_RESOURCE_DESC( const D3D12_RESOURCE_DESC& o ) :
- D3D12_RESOURCE_DESC( o )
- {}
- CD3DX12_RESOURCE_DESC(
- D3D12_RESOURCE_DIMENSION dimension,
- UINT64 alignment,
- UINT64 width,
- UINT height,
- UINT16 depthOrArraySize,
- UINT16 mipLevels,
- DXGI_FORMAT format,
- UINT sampleCount,
- UINT sampleQuality,
- D3D12_TEXTURE_LAYOUT layout,
- D3D12_RESOURCE_FLAGS flags )
- {
- Dimension = dimension;
- Alignment = alignment;
- Width = width;
- Height = height;
- DepthOrArraySize = depthOrArraySize;
- MipLevels = mipLevels;
- Format = format;
- SampleDesc.Count = sampleCount;
- SampleDesc.Quality = sampleQuality;
- Layout = layout;
- Flags = flags;
- }
- static inline CD3DX12_RESOURCE_DESC Buffer(
- const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
- D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE )
- {
- return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_BUFFER, resAllocInfo.Alignment, resAllocInfo.SizeInBytes,
- 1, 1, 1, DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags );
- }
- static inline CD3DX12_RESOURCE_DESC Buffer(
- UINT64 width,
- D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
- UINT64 alignment = 0 )
- {
- return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_BUFFER, alignment, width, 1, 1, 1,
- DXGI_FORMAT_UNKNOWN, 1, 0, D3D12_TEXTURE_LAYOUT_ROW_MAJOR, flags );
- }
- static inline CD3DX12_RESOURCE_DESC Tex1D(
- DXGI_FORMAT format,
- UINT64 width,
- UINT16 arraySize = 1,
- UINT16 mipLevels = 0,
- D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
- D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN,
- UINT64 alignment = 0 )
- {
- return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE1D, alignment, width, 1, arraySize,
- mipLevels, format, 1, 0, layout, flags );
- }
- static inline CD3DX12_RESOURCE_DESC Tex2D(
- DXGI_FORMAT format,
- UINT64 width,
- UINT height,
- UINT16 arraySize = 1,
- UINT16 mipLevels = 0,
- UINT sampleCount = 1,
- UINT sampleQuality = 0,
- D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
- D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN,
- UINT64 alignment = 0 )
- {
- return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE2D, alignment, width, height, arraySize,
- mipLevels, format, sampleCount, sampleQuality, layout, flags );
- }
- static inline CD3DX12_RESOURCE_DESC Tex3D(
- DXGI_FORMAT format,
- UINT64 width,
- UINT height,
- UINT16 depth,
- UINT16 mipLevels = 0,
- D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
- D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN,
- UINT64 alignment = 0 )
- {
- return CD3DX12_RESOURCE_DESC( D3D12_RESOURCE_DIMENSION_TEXTURE3D, alignment, width, height, depth,
- mipLevels, format, 1, 0, layout, flags );
- }
- inline UINT16 Depth() const
- { return (Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1); }
- inline UINT16 ArraySize() const
- { return (Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D ? DepthOrArraySize : 1); }
- inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const
- { return D3D12GetFormatPlaneCount(pDevice, Format); }
- inline UINT Subresources(_In_ ID3D12Device* pDevice) const
- { return MipLevels * ArraySize() * PlaneCount(pDevice); }
- inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice)
- { return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize()); }
-// operator const D3D12_RESOURCE_DESC&() const { return *this; }
-};
-inline bool operator==( const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r )
-{
- return l.Dimension == r.Dimension &&
- l.Alignment == r.Alignment &&
- l.Width == r.Width &&
- l.Height == r.Height &&
- l.DepthOrArraySize == r.DepthOrArraySize &&
- l.MipLevels == r.MipLevels &&
- l.Format == r.Format &&
- l.SampleDesc.Count == r.SampleDesc.Count &&
- l.SampleDesc.Quality == r.SampleDesc.Quality &&
- l.Layout == r.Layout &&
- l.Flags == r.Flags;
-}
-inline bool operator!=( const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r )
-{ return !( l == r ); }
-
-//------------------------------------------------------------------------------------------------
-// Row-by-row memcpy
-inline void MemcpySubresource(
- _In_ const D3D12_MEMCPY_DEST* pDest,
- _In_ const D3D12_SUBRESOURCE_DATA* pSrc,
- SIZE_T RowSizeInBytes,
- UINT NumRows,
- UINT NumSlices)
-{
- for (UINT z = 0; z < NumSlices; ++z)
- {
- BYTE* pDestSlice = reinterpret_cast<BYTE*>(pDest->pData) + pDest->SlicePitch * z;
- const BYTE* pSrcSlice = reinterpret_cast<const BYTE*>(pSrc->pData) + pSrc->SlicePitch * z;
- for (UINT y = 0; y < NumRows; ++y)
- {
- memcpy(pDestSlice + pDest->RowPitch * y,
- pSrcSlice + pSrc->RowPitch * y,
- RowSizeInBytes);
- }
- }
-}
-
-namespace MinGW_Workaround
-{
- inline D3D12_RESOURCE_DESC ID3D12ResourceGetDesc(ID3D12Resource* _resource)
- {
- D3D12_RESOURCE_DESC desc;
- union {
- D3D12_RESOURCE_DESC (STDMETHODCALLTYPE ID3D12Resource::*w)();
- void (STDMETHODCALLTYPE ID3D12Resource::*f)(D3D12_RESOURCE_DESC *);
- } conversion = { &ID3D12Resource::GetDesc };
- (_resource->*conversion.f)(&desc);
- return desc;
- }
-}
-
-//------------------------------------------------------------------------------------------------
-// Returns required size of a buffer to be used for data upload
-inline UINT64 GetRequiredIntermediateSize(
- _In_ ID3D12Resource* pDestinationResource,
- _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
- _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources)
-{
- D3D12_RESOURCE_DESC Desc = MinGW_Workaround::ID3D12ResourceGetDesc(pDestinationResource);
- UINT64 RequiredSize = 0;
-
- ID3D12Device* pDevice;
- pDestinationResource->GetDevice(__uuidof(ID3D12Device), reinterpret_cast<void**>(&pDevice));
- pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, 0, nullptr, nullptr, nullptr, &RequiredSize);
- pDevice->Release();
-
- return RequiredSize;
-}
-
-//------------------------------------------------------------------------------------------------
-// All arrays must be populated (e.g. by calling GetCopyableFootprints)
-inline UINT64 UpdateSubresources(
- _In_ ID3D12GraphicsCommandList* pCmdList,
- _In_ ID3D12Resource* pDestinationResource,
- _In_ ID3D12Resource* pIntermediate,
- _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
- _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
- UINT64 RequiredSize,
- _In_reads_(NumSubresources) const D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts,
- _In_reads_(NumSubresources) const UINT* pNumRows,
- _In_reads_(NumSubresources) const UINT64* pRowSizesInBytes,
- _In_reads_(NumSubresources) const D3D12_SUBRESOURCE_DATA* pSrcData)
-{
- // Minor validation
- D3D12_RESOURCE_DESC IntermediateDesc = MinGW_Workaround::ID3D12ResourceGetDesc(pIntermediate);
- D3D12_RESOURCE_DESC DestinationDesc = MinGW_Workaround::ID3D12ResourceGetDesc(pDestinationResource);
- if (IntermediateDesc.Dimension != D3D12_RESOURCE_DIMENSION_BUFFER ||
- IntermediateDesc.Width < RequiredSize + pLayouts[0].Offset ||
- RequiredSize > (SIZE_T)-1 ||
- (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER &&
- (FirstSubresource != 0 || NumSubresources != 1)))
- {
- return 0;
- }
-
- BYTE* pData;
- HRESULT hr = pIntermediate->Map(0, NULL, reinterpret_cast<void**>(&pData));
- if (FAILED(hr))
- {
- return 0;
- }
-
- for (UINT i = 0; i < NumSubresources; ++i)
- {
- if (pRowSizesInBytes[i] > (SIZE_T)-1) return 0;
- D3D12_MEMCPY_DEST DestData = { pData + pLayouts[i].Offset, pLayouts[i].Footprint.RowPitch, pLayouts[i].Footprint.RowPitch * pNumRows[i] };
- MemcpySubresource(&DestData, &pSrcData[i], (SIZE_T)pRowSizesInBytes[i], pNumRows[i], pLayouts[i].Footprint.Depth);
- }
- pIntermediate->Unmap(0, NULL);
-
- if (DestinationDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
- {
- CD3DX12_BOX SrcBox( UINT( pLayouts[0].Offset ), UINT( pLayouts[0].Offset + pLayouts[0].Footprint.Width ) );
- pCmdList->CopyBufferRegion(
- pDestinationResource, 0, pIntermediate, pLayouts[0].Offset, pLayouts[0].Footprint.Width);
- }
- else
- {
- for (UINT i = 0; i < NumSubresources; ++i)
- {
- CD3DX12_TEXTURE_COPY_LOCATION Dst(pDestinationResource, i + FirstSubresource);
- CD3DX12_TEXTURE_COPY_LOCATION Src(pIntermediate, pLayouts[i]);
- pCmdList->CopyTextureRegion(&Dst, 0, 0, 0, &Src, nullptr);
- }
- }
- return RequiredSize;
-}
-
-//------------------------------------------------------------------------------------------------
-// Heap-allocating UpdateSubresources implementation
-inline UINT64 UpdateSubresources(
- _In_ ID3D12GraphicsCommandList* pCmdList,
- _In_ ID3D12Resource* pDestinationResource,
- _In_ ID3D12Resource* pIntermediate,
- UINT64 IntermediateOffset,
- _In_range_(0,D3D12_REQ_SUBRESOURCES) UINT FirstSubresource,
- _In_range_(0,D3D12_REQ_SUBRESOURCES-FirstSubresource) UINT NumSubresources,
- _In_reads_(NumSubresources) D3D12_SUBRESOURCE_DATA* pSrcData)
-{
- UINT64 RequiredSize = 0;
- UINT64 MemToAlloc = static_cast<UINT64>(sizeof(D3D12_PLACED_SUBRESOURCE_FOOTPRINT) + sizeof(UINT) + sizeof(UINT64)) * NumSubresources;
- if (MemToAlloc > SIZE_MAX)
- {
- return 0;
- }
- void* pMem = HeapAlloc(GetProcessHeap(), 0, static_cast<SIZE_T>(MemToAlloc));
- if (pMem == NULL)
- {
- return 0;
- }
- D3D12_PLACED_SUBRESOURCE_FOOTPRINT* pLayouts = reinterpret_cast<D3D12_PLACED_SUBRESOURCE_FOOTPRINT*>(pMem);
- UINT64* pRowSizesInBytes = reinterpret_cast<UINT64*>(pLayouts + NumSubresources);
- UINT* pNumRows = reinterpret_cast<UINT*>(pRowSizesInBytes + NumSubresources);
-
- D3D12_RESOURCE_DESC Desc = MinGW_Workaround::ID3D12ResourceGetDesc(pDestinationResource);
- ID3D12Device* pDevice;
- pDestinationResource->GetDevice(__uuidof(ID3D12Device), reinterpret_cast<void**>(&pDevice));
- pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, pLayouts, pNumRows, pRowSizesInBytes, &RequiredSize);
- pDevice->Release();
-
- UINT64 Result = UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, pLayouts, pNumRows, pRowSizesInBytes, pSrcData);
- HeapFree(GetProcessHeap(), 0, pMem);
- return Result;
-}
-
-//------------------------------------------------------------------------------------------------
-// Stack-allocating UpdateSubresources implementation
-template <UINT MaxSubresources>
-inline UINT64 UpdateSubresources(
- _In_ ID3D12GraphicsCommandList* pCmdList,
- _In_ ID3D12Resource* pDestinationResource,
- _In_ ID3D12Resource* pIntermediate,
- UINT64 IntermediateOffset,
- _In_range_(0, MaxSubresources) UINT FirstSubresource,
- _In_range_(1, MaxSubresources - FirstSubresource) UINT NumSubresources,
- _In_reads_(NumSubresources) D3D12_SUBRESOURCE_DATA* pSrcData)
-{
- UINT64 RequiredSize = 0;
- D3D12_PLACED_SUBRESOURCE_FOOTPRINT Layouts[MaxSubresources];
- UINT NumRows[MaxSubresources];
- UINT64 RowSizesInBytes[MaxSubresources];
-
- D3D12_RESOURCE_DESC Desc = MinGW_Workaround::ID3D12ResourceGetDesc(pDestinationResource);
- ID3D12Device* pDevice;
- pDestinationResource->GetDevice(__uuidof(*pDevice), reinterpret_cast<void**>(&pDevice));
- pDevice->GetCopyableFootprints(&Desc, FirstSubresource, NumSubresources, IntermediateOffset, Layouts, NumRows, RowSizesInBytes, &RequiredSize);
- pDevice->Release();
-
- return UpdateSubresources(pCmdList, pDestinationResource, pIntermediate, FirstSubresource, NumSubresources, RequiredSize, Layouts, NumRows, RowSizesInBytes, pSrcData);
-}
-
-//------------------------------------------------------------------------------------------------
-inline bool D3D12IsLayoutOpaque( D3D12_TEXTURE_LAYOUT Layout )
-{ return Layout == D3D12_TEXTURE_LAYOUT_UNKNOWN || Layout == D3D12_TEXTURE_LAYOUT_64KB_UNDEFINED_SWIZZLE; }
-
-//------------------------------------------------------------------------------------------------
-inline ID3D12CommandList * const * CommandListCast(ID3D12GraphicsCommandList * const * pp)
-{
- // This cast is useful for passing strongly typed command list pointers into
- // ExecuteCommandLists.
- // This cast is valid as long as the const-ness is respected. D3D12 APIs do
- // respect the const-ness of their arguments.
- return reinterpret_cast<ID3D12CommandList * const *>(pp);
-}
-
-
-#endif // defined( __cplusplus )
-
-#endif //__D3DX12_H__
-
-
-
diff --git a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgiformat.h b/3rdparty/bgfx/3rdparty/dxsdk/include/dxgiformat.h
deleted file mode 100644
index 4159caba4b8..00000000000
--- a/3rdparty/bgfx/3rdparty/dxsdk/include/dxgiformat.h
+++ /dev/null
@@ -1,137 +0,0 @@
-//
-// Copyright (C) Microsoft. All rights reserved.
-//
-
-#ifndef __dxgiformat_h__
-#define __dxgiformat_h__
-
-#define DXGI_FORMAT_DEFINED 1
-
-typedef enum DXGI_FORMAT
-{
- DXGI_FORMAT_UNKNOWN = 0,
- DXGI_FORMAT_R32G32B32A32_TYPELESS = 1,
- DXGI_FORMAT_R32G32B32A32_FLOAT = 2,
- DXGI_FORMAT_R32G32B32A32_UINT = 3,
- DXGI_FORMAT_R32G32B32A32_SINT = 4,
- DXGI_FORMAT_R32G32B32_TYPELESS = 5,
- DXGI_FORMAT_R32G32B32_FLOAT = 6,
- DXGI_FORMAT_R32G32B32_UINT = 7,
- DXGI_FORMAT_R32G32B32_SINT = 8,
- DXGI_FORMAT_R16G16B16A16_TYPELESS = 9,
- DXGI_FORMAT_R16G16B16A16_FLOAT = 10,
- DXGI_FORMAT_R16G16B16A16_UNORM = 11,
- DXGI_FORMAT_R16G16B16A16_UINT = 12,
- DXGI_FORMAT_R16G16B16A16_SNORM = 13,
- DXGI_FORMAT_R16G16B16A16_SINT = 14,
- DXGI_FORMAT_R32G32_TYPELESS = 15,
- DXGI_FORMAT_R32G32_FLOAT = 16,
- DXGI_FORMAT_R32G32_UINT = 17,
- DXGI_FORMAT_R32G32_SINT = 18,
- DXGI_FORMAT_R32G8X24_TYPELESS = 19,
- DXGI_FORMAT_D32_FLOAT_S8X24_UINT = 20,
- DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS = 21,
- DXGI_FORMAT_X32_TYPELESS_G8X24_UINT = 22,
- DXGI_FORMAT_R10G10B10A2_TYPELESS = 23,
- DXGI_FORMAT_R10G10B10A2_UNORM = 24,
- DXGI_FORMAT_R10G10B10A2_UINT = 25,
- DXGI_FORMAT_R11G11B10_FLOAT = 26,
- DXGI_FORMAT_R8G8B8A8_TYPELESS = 27,
- DXGI_FORMAT_R8G8B8A8_UNORM = 28,
- DXGI_FORMAT_R8G8B8A8_UNORM_SRGB = 29,
- DXGI_FORMAT_R8G8B8A8_UINT = 30,
- DXGI_FORMAT_R8G8B8A8_SNORM = 31,
- DXGI_FORMAT_R8G8B8A8_SINT = 32,
- DXGI_FORMAT_R16G16_TYPELESS = 33,
- DXGI_FORMAT_R16G16_FLOAT = 34,
- DXGI_FORMAT_R16G16_UNORM = 35,
- DXGI_FORMAT_R16G16_UINT = 36,
- DXGI_FORMAT_R16G16_SNORM = 37,
- DXGI_FORMAT_R16G16_SINT = 38,
- DXGI_FORMAT_R32_TYPELESS = 39,
- DXGI_FORMAT_D32_FLOAT = 40,
- DXGI_FORMAT_R32_FLOAT = 41,
- DXGI_FORMAT_R32_UINT = 42,
- DXGI_FORMAT_R32_SINT = 43,
- DXGI_FORMAT_R24G8_TYPELESS = 44,
- DXGI_FORMAT_D24_UNORM_S8_UINT = 45,
- DXGI_FORMAT_R24_UNORM_X8_TYPELESS = 46,
- DXGI_FORMAT_X24_TYPELESS_G8_UINT = 47,
- DXGI_FORMAT_R8G8_TYPELESS = 48,
- DXGI_FORMAT_R8G8_UNORM = 49,
- DXGI_FORMAT_R8G8_UINT = 50,
- DXGI_FORMAT_R8G8_SNORM = 51,
- DXGI_FORMAT_R8G8_SINT = 52,
- DXGI_FORMAT_R16_TYPELESS = 53,
- DXGI_FORMAT_R16_FLOAT = 54,
- DXGI_FORMAT_D16_UNORM = 55,
- DXGI_FORMAT_R16_UNORM = 56,
- DXGI_FORMAT_R16_UINT = 57,
- DXGI_FORMAT_R16_SNORM = 58,
- DXGI_FORMAT_R16_SINT = 59,
- DXGI_FORMAT_R8_TYPELESS = 60,
- DXGI_FORMAT_R8_UNORM = 61,
- DXGI_FORMAT_R8_UINT = 62,
- DXGI_FORMAT_R8_SNORM = 63,
- DXGI_FORMAT_R8_SINT = 64,
- DXGI_FORMAT_A8_UNORM = 65,
- DXGI_FORMAT_R1_UNORM = 66,
- DXGI_FORMAT_R9G9B9E5_SHAREDEXP = 67,
- DXGI_FORMAT_R8G8_B8G8_UNORM = 68,
- DXGI_FORMAT_G8R8_G8B8_UNORM = 69,
- DXGI_FORMAT_BC1_TYPELESS = 70,
- DXGI_FORMAT_BC1_UNORM = 71,
- DXGI_FORMAT_BC1_UNORM_SRGB = 72,
- DXGI_FORMAT_BC2_TYPELESS = 73,
- DXGI_FORMAT_BC2_UNORM = 74,
- DXGI_FORMAT_BC2_UNORM_SRGB = 75,
- DXGI_FORMAT_BC3_TYPELESS = 76,
- DXGI_FORMAT_BC3_UNORM = 77,
- DXGI_FORMAT_BC3_UNORM_SRGB = 78,
- DXGI_FORMAT_BC4_TYPELESS = 79,
- DXGI_FORMAT_BC4_UNORM = 80,
- DXGI_FORMAT_BC4_SNORM = 81,
- DXGI_FORMAT_BC5_TYPELESS = 82,
- DXGI_FORMAT_BC5_UNORM = 83,
- DXGI_FORMAT_BC5_SNORM = 84,
- DXGI_FORMAT_B5G6R5_UNORM = 85,
- DXGI_FORMAT_B5G5R5A1_UNORM = 86,
- DXGI_FORMAT_B8G8R8A8_UNORM = 87,
- DXGI_FORMAT_B8G8R8X8_UNORM = 88,
- DXGI_FORMAT_R10G10B10_XR_BIAS_A2_UNORM = 89,
- DXGI_FORMAT_B8G8R8A8_TYPELESS = 90,
- DXGI_FORMAT_B8G8R8A8_UNORM_SRGB = 91,
- DXGI_FORMAT_B8G8R8X8_TYPELESS = 92,
- DXGI_FORMAT_B8G8R8X8_UNORM_SRGB = 93,
- DXGI_FORMAT_BC6H_TYPELESS = 94,
- DXGI_FORMAT_BC6H_UF16 = 95,
- DXGI_FORMAT_BC6H_SF16 = 96,
- DXGI_FORMAT_BC7_TYPELESS = 97,
- DXGI_FORMAT_BC7_UNORM = 98,
- DXGI_FORMAT_BC7_UNORM_SRGB = 99,
- DXGI_FORMAT_AYUV = 100,
- DXGI_FORMAT_Y410 = 101,
- DXGI_FORMAT_Y416 = 102,
- DXGI_FORMAT_NV12 = 103,
- DXGI_FORMAT_P010 = 104,
- DXGI_FORMAT_P016 = 105,
- DXGI_FORMAT_420_OPAQUE = 106,
- DXGI_FORMAT_YUY2 = 107,
- DXGI_FORMAT_Y210 = 108,
- DXGI_FORMAT_Y216 = 109,
- DXGI_FORMAT_NV11 = 110,
- DXGI_FORMAT_AI44 = 111,
- DXGI_FORMAT_IA44 = 112,
- DXGI_FORMAT_P8 = 113,
- DXGI_FORMAT_A8P8 = 114,
- DXGI_FORMAT_B4G4R4A4_UNORM = 115,
-
- DXGI_FORMAT_P208 = 130,
- DXGI_FORMAT_V208 = 131,
- DXGI_FORMAT_V408 = 132,
-
-
- DXGI_FORMAT_FORCE_UINT = 0xffffffff
-} DXGI_FORMAT;
-
-#endif // __dxgiformat_h__
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/.gitattributes b/3rdparty/bgfx/3rdparty/glsl-optimizer/.gitattributes
deleted file mode 100644
index 23c6280f6de..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/.gitattributes
+++ /dev/null
@@ -1,4 +0,0 @@
-*.dsp -crlf
-*.dsw -crlf
-*.sln -crlf
-*.vcproj -crlf
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/.gitignore b/3rdparty/bgfx/3rdparty/glsl-optimizer/.gitignore
deleted file mode 100644
index cb7c7ef8a6d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/.gitignore
+++ /dev/null
@@ -1,78 +0,0 @@
-node_modules
-*.a
-*.dll
-*.exe
-*.ilk
-*.sdf
-*.opensdf
-*.la
-*.lo
-*.log
-*.o
-*.obj
-*.os
-*.pc
-*.pdb
-*.pyc
-*.pyo
-*.so
-*.so.*
-*.sw[a-z]
-*.tar
-*.tar.bz2
-*.tar.gz
-*.trs
-*.zip
-*~
-depend
-depend.bak
-bin/ltmain.sh
-lib
-lib64
-configure
-configure.lineno
-autom4te.cache
-aclocal.m4
-config.log
-config.status
-cscope*
-.scon*
-config.py
-build
-libtool
-manifest.txt
-.dir-locals.el
-.deps/
-.dirstamp
-.libs/
-Makefile
-Makefile.in
-
-ipch
-
-*.pbxuser
-*.perspectivev3
-*.mode1v3
-.svn
-*.ncb
-*.user
-*.suo
-*.dSYM
-xcuserdata
-*.xcworkspace
-
-cmake_install.cmake
-Makefile
-CMakeFiles/
-CMakeCache.txt
-.project
-.cproject
-glsl_main
-glsl_test
-glslopt
-glsl_compiler
-.settings/
-.pydevproject
-
-build
-metalTemp.metal
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/.npmignore b/3rdparty/bgfx/3rdparty/glsl-optimizer/.npmignore
deleted file mode 100644
index 16686d20433..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/.npmignore
+++ /dev/null
@@ -1,2 +0,0 @@
-projects
-tests
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/CMakeLists.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/CMakeLists.txt
deleted file mode 100644
index c058bef4096..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/CMakeLists.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-cmake_minimum_required(VERSION 2.8)
-
-include_directories(include)
-include_directories(src/mesa)
-include_directories(src/mapi)
-include_directories(src/glsl)
-include_directories(src)
-
-option (DEBUG "Enable debugging" FALSE)
-
-if(${DEBUG} MATCHES "on")
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O0")
-else()
- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -DNDEBUG")
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -DNDEBUG")
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -s")
-endif()
-
-file(GLOB glcpp-library_sources src/glsl/glcpp/*.c src/util/*.c)
-#file(GLOB glcpp-library_sources_remove src/glsl/glcpp/glcpp.c)
-#list(REMOVE_ITEM glcpp-library_sources ${glcpp-library_sources_remove})
-add_library(glcpp-library ${glcpp-library_sources})
-
-file(GLOB mesa_sources src/mesa/program/*.c src/mesa/main/*.c)
-add_library(mesa ${mesa_sources})
-
-file(GLOB glsl_sources src/glsl/*.cpp src/glsl/*.c)
-file(GLOB glsl_sources_remove src/glsl/main.cpp src/glsl/builtin_stubs.cpp)
-list(REMOVE_ITEM glsl_sources ${glsl_sources_remove})
-add_library(glsl_optimizer ${glsl_sources})
-target_link_libraries(glsl_optimizer glcpp-library mesa)
-
-add_executable(glsl_compiler src/glsl/main.cpp)
-target_link_libraries(glsl_compiler glsl_optimizer)
-
-file(GLOB glsl_test_sources tests/*.cpp)
-add_executable(glsl_test ${glsl_test_sources})
-target_link_libraries(glsl_test glsl_optimizer)
-if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
- # OSX-specific build requirements
- find_library(OpenGL_LIBRARY OpenGL )
- target_link_libraries(glsl_test ${OpenGL_LIBRARY})
-endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
-
-file(GLOB glslopt_sources contrib/glslopt/*.cpp)
-add_executable(glslopt ${glslopt_sources})
-target_link_libraries(glslopt glsl_optimizer)
-
-#add_executable(glcpp src/glsl/glcpp/glcpp.c)
-#target_link_libraries(glcpp glsl_optimizer)
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md b/3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md
deleted file mode 100644
index 23af52c77ef..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/Changelog.md
+++ /dev/null
@@ -1,238 +0,0 @@
-GLSL optimizer Change Log
-=========================
-
-
-2016 10
--------
-
-* Metal/GLES: Fixed bad optimization (all code removed) when framebuffer fetch extension is used, but
- fragment shader does not actually read the incoming color value.
-* Fixed translation of texelSize().
-* Fixed translation of texelFetch().
-
-
-2016 09
--------
-
-* Metal: Fixed constant precision propagation in some cases.
-* Metal: Fixed shadowmap sampling when reference Z value is outside of 0..1 range (now clamps to match GLES specs).
-
-
-2016 06
--------
-
-Fixed:
-
-* Fixed Metal translation in some cases having wrong precision on constants or constant arrays.
-
-
-2016 05
--------
-
-Fixed:
-
-* Fixed Metal translation in some cases having wrong precision on struct members.
-* Fixed Metal translation in some cases emitting struct declarations vs. constant initializers in wrong order.
-
-
-2016 03
--------
-
-Fixed:
-
-* Fixed translation performance regression in loop analysis (regressed in 2015 06 fixes).
-
-
-2015 08
--------
-
-Changes:
-
-* 2D shadow and 2D array uniforms got their own glslopt_basic_type entries.
-
-Fixes:
-
-* Fixed translation of 2D texture arrays (GLSL with EXT_texture_array, GLES3 and Metal).
-
-
-2015 06
--------
-
-Fixes:
-
-* Fixed some cases of different precision matrix assignments being miscompiled on Metal.
-* Fixed yet more issues with translation of weird loops.
-* Fixed translation of matrix+scalar, matrix-scalar, matrix/scalar operations on Metal.
-
-
-2015 05
--------
-
-Fixes:
-
-* Fixes some cases of highp/mediump sampler sampling resulting in resulting temporaries wrongly being lowp.
-
-
-2015 04
--------
-
-Goodies:
-
-* GLES2: support EXT_draw_instanced / gl_InstanceIDEXT.
-* Support gl_VertexID in GLSL < 1.30 when EXT_gpu_shader4 is used.
-
-Fixes:
-
-* Metal: fixed some bugs with translation of weird loops.
-
-
-2015 02
--------
-
-Tweaks:
-
-* Texture LOD sampling functions on GLES2.0 now produce a wrapper call, that does approximation
- (mip bias) on devices that don't support GL_EXT_shader_texture_lod.
-* Undefined precision integers on GLES now default to highp.
-
-
-2015 01
--------
-
-Fixes:
-
-* Float literals are printed with 7 significant digits now.
-* Metal: GLSL mod() is properly translated into Metal's fmod().
-* Metal: Fixed some cases of reciprocal (1/x) printing missing half precision cast.
-* GLES3: textureOffset with a mipmap bias is printed correctly now.
-* Fixed a bug with loop inductor detection if the inductor was used before the loop for some things.
-* Fixed printing of int/float bitcast operations.
-* Improved precision determination of some constructs.
-
-
-2014 10
--------
-
-Goodies:
-
-* Support for translating GLSL shaders into Apple Metal shading language.
- Exactly same process; GLSL in (preferably ES3 variant), optimization passes, Metal out.
- All uniforms currently will be put into one constant buffer.
- Pass kGlslTargetMetal target to get Metal.
-* Shader reflection API. See glslopt_shader_get_* functions. Binding indices
- are only automatically assigned on Metal now; on GL/ES targets the reflection API is only
- useful to get list of inputs/uniforms, their names and types.
-* Improved dead code elimation: some cases of swizzled/masked assignments where same variable was on both sides
- were not eliminated if that variable was totally unused later.
-* Merged with upstream Mesa, comes with new optimizations (min/max pruning, tree rebalancing, vector_insert lowering).
-
-Fixes:
-
-* sampler3D declarations were missing precision qualifier on GLES3.0.
-
-
-2014 09
--------
-
-Goodies:
-
-* Supports GL_EXT_draw_buffers in ES2.0, for MRT.
-
-
-2014 08
--------
-
-Goodies:
-
-* Supports GL_EXT_shader_framebuffer_fetch now, in both ES2.0 & 3.0.
-
-Fixes:
-
-* Fixed printing of infinities & NaNs.
-* Fixed vectorization pass in some cases going wrong on texture lookups.
-
-
-2014 06
--------
-
-Goodies:
-
-* Optimization: split vectors with only some used components into scalars.
-
-Fixes:
-
-* Fixed more issues with for-loop printing.
-* Fixed printing of unsigned integer swizzled & constants.
-
-2014 03
--------
-
-Fixes:
-
-* Fixed missing precision qualifier in some ES shaders (mostly due to expansion of ternary ?: check).
-
-2014 02
--------
-
-Fixes:
-
-* Fixed vectorize pass introduced last month going wrong with dot products.
-
-2014 01
--------
-
-Goodies:
-
-* Better optimization: vectorize assignments to individual vector channels.
-* More OpenGL ES 2.0 conformant printing of complex for-loops (loop inductions printed
- as += or ++; loop initializers inside loop body).
-
-Fixes:
-
-* Fixed array assignments sometimes appearing in pre-GLSL1.20 versions, especially with
- complex loops that couldn't be unrolled.
-* Fixed output of textureOffset and texelFetch.
-* Fixed error messages on MRT outputs on GL & GLES3 (now supports 4 MRTs).
-
-2013 12
--------
-
-Goodies:
-
-* Optimized performance; was spending half of the time in stupid string code.
-* Added glslopt_shader_get_stats to get *very* approximate shader complexity stats.
-* Nicer printing of complicated for-loops.
-
-Fixes:
-
-* Fixed printing of struct initializers.
-
-
-2013 11
--------
-
-Goodies:
-
-* Better optimizations: CSE; `A+(-B) => A-B`; `!A || !B => !(A && B)`.
-* Merged with upstream Mesa.
-
-Fixes:
-
-* Fixed location qualifiers, ES3.0 version printing, samplerCubeShadow sampling operations.
-
-
-2013 10
--------
-
-Goodies:
-
-* Initial OpenGL ES 3.0 support
-* API to query shader input names; glslopt_shader_get_input_count and glslopt_shader_get_input_name
-
-Changes:
-
-* Xcode project files updated to Xcode 5
-
-Fixes:
-
-* VS2013 fixes
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/README.md b/3rdparty/bgfx/3rdparty/glsl-optimizer/README.md
deleted file mode 100644
index 9891c12f5de..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/README.md
+++ /dev/null
@@ -1,102 +0,0 @@
-GLSL optimizer
-==============
-
-A C++ library that takes GLSL shaders, does some GPU-independent optimizations on them
-and outputs GLSL or Metal source back. Optimizations are function inlining, dead code removal, copy propagation,
-constant folding, constant propagation, arithmetic optimizations and so on.
-
-Apparently quite a few mobile platforms are pretty bad at optimizing shaders; and
-unfortunately they *also* lack offline shader compilers. So using a GLSL optimizer offline
-before can make the shader run much faster on a platform like that. See performance numbers
-in [this blog post](http://aras-p.info/blog/2010/09/29/glsl-optimizer/).
-
-Even for drivers that have decent shader optimization, GLSL optimizer could be useful to just strip away
-dead code, make shaders smaller and do uniform/input reflection offline.
-
-Almost all actual code is [Mesa 3D's GLSL](http://cgit.freedesktop.org/mesa/mesa/log/)
-compiler; all this library does is spits out optimized GLSL or Metal back, and adds GLES type precision
-handling to the optimizer.
-
-This GLSL optimizer is made for [Unity's](http://unity3d.com/) purposes and is built-in
-starting with Unity 3.0.
-
-GLSL Optimizer is licensed according to the terms of the MIT license.
-
-See [change log here](Changelog.md).
-
-
-Usage
------
-
-Visual Studio 2010 (Windows, x86/x64) and Xcode 5+ (Mac, i386) project files for a static
-library are provided in `projects/vs2010/glsl_optimizer.sln` and `projects/xcode5/glsl_optimizer_lib`
-respectively.
-
-> Note: only the VS and Xcode project files are maintained and should work at any time.
-> There's also a cmake and gyp build system for Linux et al., and some stuff in contrib folder -
-> all that may or might not work.
-
-For Linux you can use cmake. Just type "cmake . && make" in the root directory.
-This will build the optimizer library and some executable binaries.
-
-Interface for the library is `src/glsl/glsl_optimizer.h`. General usage is:
-
- ctx = glslopt_initialize(targetVersion);
- for (lots of shaders) {
- shader = glslopt_optimize (ctx, shaderType, shaderSource, options);
- if (glslopt_get_status (shader)) {
- newSource = glslopt_get_output (shader);
- } else {
- errorLog = glslopt_get_log (shader);
- }
- glslopt_shader_delete (shader);
- }
- glslopt_cleanup (ctx);
-
-
-Tests
------
-
-There's a testing suite for catching regressions, see `tests` folder. In VS, build
-and run `glsl_optimizer_tests` project; in Xcode use `projects/xcode5/glsl_optimizer_tests`
-project. The test executable requires path to the `tests` folder as an argument.
-
-Each test comes as three text files; input, expected IR dump and expected optimized
-GLSL dump. GLES3 tests are also converted into Metal.
-
-If you're making changes to the project and want pull requests accepted easier, I'd
-appreciate if there would be no test suite regressions. If you are implementing a
-feature, it would be cool to add tests to cover it as well!
-
-
-Notes
------
-
-* GLSL versions 1.10 and 1.20 are supported. 1.10 is the default, use #version 120 to specify
-1.20. Higher GLSL versions might work, but aren't tested now.
-* GLSL ES versions 1.00 and 3.00 are supported.
-
-Status and Future
------------------
-
-**Note**: As of mid-2016, the project is unlikely to have any significant developments. At Unity we are largely moving to a different
-shader compilation pipeline, with glsl-optimizer mostly not used. So from my side there won't be significant work done on it :(
-
-
-Dev Notes
----------
-
-Pulling Mesa upstream:
-
- git fetch upstream
- git merge upstream/master
- sh removeDeletedByUs.sh
- # inspect files, git rm unneeded ones, fix conflicts etc.
- # git commit
-
-Rebuilding flex/bison parsers:
-
-* When .y/.l files are changed, the parsers are *not* rebuilt automatically,
-* Run ./generateParsers.sh to do that. You'll need bison & flex (on Mac, do "Install Command Line Tools" from Xcode)
-* I use bison 2.3 and flex 2.5.35 (in OS X 10.8/10.9)
-
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/autogen.sh b/3rdparty/bgfx/3rdparty/glsl-optimizer/autogen.sh
deleted file mode 100755
index 626d2133499..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/autogen.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-#! /bin/sh
-
-srcdir=`dirname "$0"`
-test -z "$srcdir" && srcdir=.
-
-ORIGDIR=`pwd`
-cd "$srcdir"
-
-autoreconf -v --install || exit 1
-cd $ORIGDIR || exit $?
-
-if test -z "$NOCONFIGURE"; then
- "$srcdir"/configure "$@"
-fi
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/binding.gyp b/3rdparty/bgfx/3rdparty/glsl-optimizer/binding.gyp
deleted file mode 100644
index 50ebc7ab723..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/binding.gyp
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- 'includes': [
- 'target_defaults.gypi',
- ],
- 'targets': [
- {
- "include_dirs" : [
- "<!(node -e \"require('nan')\")"
- ],
- 'target_name': 'glslOptimizer',
- 'dependencies': [
- 'src/glsl_optimizer_lib.gyp:*',
- ],
- 'sources': [
- 'src/node/binding.cpp',
- 'src/node/shader.h',
- 'src/node/shader.cpp',
- 'src/node/compiler.h',
- 'src/node/compiler.cpp'
- ],
- 'conditions': [
- ['OS=="win"', {
- 'msvs_disabled_warnings': [4506],
- }],
- ],
- }
- ]
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Main.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Main.cpp
deleted file mode 100644
index 4f38dfe0dce..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Main.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include "glsl_optimizer.h"
-
-static glslopt_ctx* gContext = 0;
-
-static int printhelp(const char* msg)
-{
- if (msg) printf("%s\n\n\n", msg);
- printf("Usage: glslopt <-f|-v> <input shader> [<output shader>]\n");
- printf("\t-f : fragment shader (default)\n");
- printf("\t-v : vertex shader\n");
- printf("\t-1 : target OpenGL (default)\n");
- printf("\t-2 : target OpenGL ES 2.0\n");
- printf("\t-3 : target OpenGL ES 3.0\n");
- printf("\n\tIf no output specified, output is to [input].out.\n");
- return 1;
-}
-
-static bool init(glslopt_target target)
-{
- gContext = glslopt_initialize(target);
- if( !gContext )
- return false;
- return true;
-}
-
-static void term()
-{
- glslopt_cleanup(gContext);
-}
-
-static char* loadFile(const char* filename)
-{
- FILE* file = fopen(filename, "rt");
- if( !file )
- {
- printf("Failed to open %s for reading\n", filename);
- return 0;
- }
-
- fseek(file, 0, SEEK_END);
- const int size = ftell(file);
- fseek(file, 0, SEEK_SET);
-
- char* result = new char[size+1];
- const int count = (int)fread(result, 1, size, file);
- result[count] = 0;
-
- fclose(file);
- return result;
-}
-
-static bool saveFile(const char* filename, const char* data)
-{
- int size = (int)strlen(data);
-
- FILE* file = fopen(filename, "wt");
- if( !file )
- {
- printf( "Failed to open %s for writing\n", filename);
- return false;
- }
-
- if( 1 != fwrite(data,size,1,file) )
- {
- printf( "Failed to write to %s\n", filename);
- fclose(file);
- return false;
- }
-
- fclose(file);
- return true;
-}
-
-static bool compileShader(const char* dstfilename, const char* srcfilename, bool vertexShader)
-{
- const char* originalShader = loadFile(srcfilename);
- if( !originalShader )
- return false;
-
- const glslopt_shader_type type = vertexShader ? kGlslOptShaderVertex : kGlslOptShaderFragment;
-
- glslopt_shader* shader = glslopt_optimize(gContext, type, originalShader, 0);
- if( !glslopt_get_status(shader) )
- {
- printf( "Failed to compile %s:\n\n%s\n", srcfilename, glslopt_get_log(shader));
- return false;
- }
-
- const char* optimizedShader = glslopt_get_output(shader);
-
- if( !saveFile(dstfilename, optimizedShader) )
- return false;
-
- delete[] originalShader;
- return true;
-}
-
-int main(int argc, char* argv[])
-{
- if( argc < 3 )
- return printhelp(NULL);
-
- bool vertexShader = false, freename = false;
- glslopt_target languageTarget = kGlslTargetOpenGL;
- const char* source = 0;
- char* dest = 0;
-
- for( int i=1; i < argc; i++ )
- {
- if( argv[i][0] == '-' )
- {
- if( 0 == strcmp("-v", argv[i]) )
- vertexShader = true;
- else if( 0 == strcmp("-f", argv[i]) )
- vertexShader = false;
- else if( 0 == strcmp("-1", argv[i]) )
- languageTarget = kGlslTargetOpenGL;
- else if( 0 == strcmp("-2", argv[i]) )
- languageTarget = kGlslTargetOpenGLES20;
- else if( 0 == strcmp("-3", argv[i]) )
- languageTarget = kGlslTargetOpenGLES30;
- }
- else
- {
- if( source == 0 )
- source = argv[i];
- else if( dest == 0 )
- dest = argv[i];
- }
- }
-
- if( !source )
- return printhelp("Must give a source");
-
- if( !init(languageTarget) )
- {
- printf("Failed to initialize glslopt!\n");
- return 1;
- }
-
- if ( !dest ) {
- dest = (char *) calloc(strlen(source)+5, sizeof(char));
- snprintf(dest, strlen(source)+5, "%s.out", source);
- freename = true;
- }
-
- int result = 0;
- if( !compileShader(dest, source, vertexShader) )
- result = 1;
-
- if( freename ) free(dest);
-
- term();
- return result;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Makefile b/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Makefile
deleted file mode 100644
index 0719bfded0f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Makefile
+++ /dev/null
@@ -1,16 +0,0 @@
-# Linux build for the sample app
-
-OBJS = Main.o
-
-.PHONY: clean all
-
-LDFLAGS += -Wl,-O1 -Wl,-gc-sections
-CPPFLAGS += -I ../../src/glsl -L ../../src/glsl
-CXXFLAGS += -Wall -Os -s
-
-all: $(OBJS)
- g++ -o glslopt Main.o $(CPPFLAGS) -lglslopt $(CXXFLAGS) $(LDFLAGS)
-
-clean:
- rm -f glslopt $(OBJS)
-
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Readme b/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Readme
deleted file mode 100644
index 7d28ecdda6f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/Readme
+++ /dev/null
@@ -1,13 +0,0 @@
-This is a small sample program to get you quickly up and running, it transforms an input textfile
-to an output textfile. The input source textfile should be a fully preprocessed GLSL shader and
-the output should be a simple shader in textform.
-
-The project file is generated by BadgerConfig.
-
-VS2005
-BadgerConfig
-
-
-
-
-Jim Tilander, Santa Monica 2010
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/SourceFiles b/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/SourceFiles
deleted file mode 100644
index cb7f2793c79..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/SourceFiles
+++ /dev/null
@@ -1,105 +0,0 @@
-#
-# Console files...
-#
- Main.cpp
- Readme
-
-#
-# Original test program ..
-#
-#../../src/glsl/glsl_optimizer_main.cpp
-
-
-#
-# Mesa GLSL2 + GLSL Optimizer
-#
-
- ../../src/mesa/program/hash_table.c
- ../../src/mesa/program/hash_table.h
- ../../src/mesa/program/symbol_table.c
- ../../src/mesa/program/symbol_table.h
- ../../src/talloc/talloc.c
- ../../src/talloc/talloc.h
- ../../src/glsl/ast.h
- ../../src/glsl/ast_expr.cpp
- ../../src/glsl/ast_function.cpp
- ../../src/glsl/ast_to_hir.cpp
- ../../src/glsl/ast_type.cpp
- ../../src/glsl/builtin_function.cpp
- ../../src/glsl/builtin_types.h
- ../../src/glsl/builtin_variables.h
- ../../src/glsl/glsl_lexer.cpp
- ../../src/glsl/glsl_lexer.lpp
- ../../src/glsl/glsl_optimizer.cpp
- ../../src/glsl/glsl_optimizer.h
- ../../src/glsl/glsl_parser.cpp
- ../../src/glsl/glsl_parser.h
- ../../src/glsl/glsl_parser.ypp
- ../../src/glsl/glsl_parser_extras.cpp
- ../../src/glsl/glsl_parser_extras.h
- ../../src/glsl/glsl_symbol_table.h
- ../../src/glsl/glsl_types.cpp
- ../../src/glsl/glsl_types.h
- ../../src/glsl/hir_field_selection.cpp
- ../../src/glsl/ir.cpp
- ../../src/glsl/ir.h
- ../../src/glsl/ir_algebraic.cpp
- ../../src/glsl/ir_basic_block.cpp
- ../../src/glsl/ir_basic_block.h
- ../../src/glsl/ir_clone.cpp
- ../../src/glsl/ir_constant_expression.cpp
- ../../src/glsl/ir_constant_folding.cpp
- ../../src/glsl/ir_constant_propagation.cpp
- ../../src/glsl/ir_constant_variable.cpp
- ../../src/glsl/ir_copy_propagation.cpp
- ../../src/glsl/ir_dead_code.cpp
- ../../src/glsl/ir_dead_code_local.cpp
- ../../src/glsl/ir_dead_functions.cpp
- ../../src/glsl/ir_div_to_mul_rcp.cpp
- ../../src/glsl/ir_expression_flattening.cpp
- ../../src/glsl/ir_expression_flattening.h
- ../../src/glsl/ir_function.cpp
- ../../src/glsl/ir_function_can_inline.cpp
- ../../src/glsl/ir_function_inlining.cpp
- ../../src/glsl/ir_function_inlining.h
- ../../src/glsl/ir_hierarchical_visitor.cpp
- ../../src/glsl/ir_hierarchical_visitor.h
- ../../src/glsl/ir_hv_accept.cpp
- ../../src/glsl/ir_if_return.cpp
- ../../src/glsl/ir_if_simplification.cpp
- ../../src/glsl/ir_if_to_cond_assign.cpp
- ../../src/glsl/ir_import_prototypes.cpp
- ../../src/glsl/ir_mat_op_to_vec.cpp
- ../../src/glsl/ir_mod_to_fract.cpp
- ../../src/glsl/ir_noop_swizzle.cpp
- ../../src/glsl/ir_optimization.h
- ../../src/glsl/ir_print_glsl_visitor.cpp
- ../../src/glsl/ir_print_glsl_visitor.h
- ../../src/glsl/ir_print_visitor.cpp
- ../../src/glsl/ir_print_visitor.h
- ../../src/glsl/ir_reader.cpp
- ../../src/glsl/ir_reader.h
- ../../src/glsl/ir_rvalue_visitor.cpp
- ../../src/glsl/ir_rvalue_visitor.h
- ../../src/glsl/ir_structure_splitting.cpp
- ../../src/glsl/ir_sub_to_add_neg.cpp
- ../../src/glsl/ir_swizzle_swizzle.cpp
- ../../src/glsl/ir_tree_grafting.cpp
- ../../src/glsl/ir_unused_structs.cpp
- ../../src/glsl/ir_unused_structs.h
- ../../src/glsl/ir_validate.cpp
- ../../src/glsl/ir_variable.cpp
- ../../src/glsl/ir_variable_refcount.cpp
- ../../src/glsl/ir_variable_refcount.h
- ../../src/glsl/ir_vec_index_to_cond_assign.cpp
- ../../src/glsl/ir_vec_index_to_swizzle.cpp
- ../../src/glsl/ir_visitor.h
- ../../src/glsl/link_functions.cpp
- ../../src/glsl/linker.cpp
- ../../src/glsl/linker.h
- ../../src/glsl/list.h
- #../../src/glsl/main.cpp
- ../../src/glsl/program.h
- ../../src/glsl/s_expression.cpp
- ../../src/glsl/s_expression.h
- ../../src/glsl/msvc/msvccompat.h
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.bdgcfg b/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.bdgcfg
deleted file mode 100644
index 50b6936788a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.bdgcfg
+++ /dev/null
@@ -1,10 +0,0 @@
-[General]
-Type = ConsoleApplication
-SourceFiles = SourceFiles
-Platform = Tool
-
-[Project]
-IncludePaths=../../src/talloc;../../include;../../src/mesa;../../src/mapi;../../src/glsl/msvc;../../src/glsl
-Defines=snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE
-DisabledVcWarnings=4291;4996;4800;4099;4244;4018;4245
-Libraries=opengl32.lib \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.sln b/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.sln
deleted file mode 100644
index a57f3179118..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.sln
+++ /dev/null
@@ -1,26 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glslopt", "glslopt.vcproj", "{790F4C89-6715-EB39-C392-3FC1D1DB9618}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Final|Win32 = Final|Win32
- Profile|Win32 = Profile|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {790F4C89-6715-EB39-C392-3FC1D1DB9618}.Debug|Win32.ActiveCfg = Debug|Win32
- {790F4C89-6715-EB39-C392-3FC1D1DB9618}.Debug|Win32.Build.0 = Debug|Win32
- {790F4C89-6715-EB39-C392-3FC1D1DB9618}.Final|Win32.ActiveCfg = Final|Win32
- {790F4C89-6715-EB39-C392-3FC1D1DB9618}.Final|Win32.Build.0 = Final|Win32
- {790F4C89-6715-EB39-C392-3FC1D1DB9618}.Profile|Win32.ActiveCfg = Profile|Win32
- {790F4C89-6715-EB39-C392-3FC1D1DB9618}.Profile|Win32.Build.0 = Profile|Win32
- {790F4C89-6715-EB39-C392-3FC1D1DB9618}.Release|Win32.ActiveCfg = Release|Win32
- {790F4C89-6715-EB39-C392-3FC1D1DB9618}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.vcproj b/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.vcproj
deleted file mode 100644
index dfa36943a70..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/glslopt/glslopt.vcproj
+++ /dev/null
@@ -1,897 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="glslopt"
- ProjectGUID="{790F4C89-6715-EB39-C392-3FC1D1DB9618}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(ProjectDir)$(ConfigurationName)"
- IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
- ConfigurationType="1"
- UseOfMFC="0"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalOptions=""
- AdditionalIncludeDirectories=";../../src/talloc;../../include;../../src/mesa;../../src/mapi;../../src/glsl/msvc;../../src/glsl;../../../../../Shared;../../../../../Tools/Shared;../../../freetype-2.1.10/include;../../../Lua/include;../../../FreeImage;../../../../Include;../../.."
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;AURORA_TOOL;AURORA_DEBUGG"
- StringPooling="false"
- MinimalRebuild="false"
- ExceptionHandling="2"
- BasicRuntimeChecks="3"
- SmallerTypeCheck="true"
- RuntimeLibrary="3"
- StructMemberAlignment="3"
- BufferSecurityCheck="true"
- EnableFunctionLevelLinking="true"
- EnableEnhancedInstructionSet="0"
- FloatingPointExceptions="false"
- DisableLanguageExtensions="false"
- DefaultCharIsUnsigned="true"
- TreatWChar_tAsBuiltInType="true"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- OpenMP="false"
- UsePrecompiledHeader="0"
- PrecompiledHeaderThrough="PreCompiled.h"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="4"
- CallingConvention="0"
- CompileAs="0"
- DisableSpecificWarnings="4512;4127;4996;4291;4291;4996;4800;4099;4244;4018;4245"
- UseFullPaths="false"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkLibraryDependencies="true"
- UseLibraryDependencyInputs="true"
- AdditionalDependencies="opengl32.lib "
- ShowProgress="0"
- OutputFile="$(OutDir)\$(ProjectName).exe"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories="../../../freetype-2.1.10/lib;../../../Lua/lib;../../../FreeImage;../../../../Lib "
- GenerateManifest="true"
- ModuleDefinitionFile=""
- GenerateDebugInformation="true"
- GenerateMapFile="true"
- MapFileName="$(TargetDir)$(TargetName).map"
- MapExports="false"
- SubSystem="1"
- StackReserveSize="8388608"
- StackCommitSize="8388608"
- LargeAddressAware="2"
- TargetMachine="1"
- AllowIsolation="true"
- Profile="false"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- Description=""
- CommandLine=""
- ExcludedFromBuild="false"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(ProjectDir)$(ConfigurationName)"
- IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2"
- UseOfMFC="0"
- WholeProgramOptimization="0"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- AdditionalOptions=""
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="2"
- OmitFramePointers="false"
- WholeProgramOptimization="false"
- AdditionalIncludeDirectories=";../../src/talloc;../../include;../../src/mesa;../../src/mapi;../../src/glsl/msvc;../../src/glsl;../../../../../Shared;../../../../../Tools/Shared;../../../freetype-2.1.10/include;../../../Lua/include;../../../FreeImage;../../../../Include;../../.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;AURORA_TOOL;AURORA_RELEASE"
- StringPooling="false"
- MinimalRebuild="false"
- ExceptionHandling="2"
- BasicRuntimeChecks="0"
- SmallerTypeCheck="false"
- RuntimeLibrary="2"
- StructMemberAlignment="3"
- BufferSecurityCheck="false"
- EnableFunctionLevelLinking="true"
- EnableEnhancedInstructionSet="2"
- FloatingPointExceptions="false"
- DisableLanguageExtensions="false"
- DefaultCharIsUnsigned="true"
- TreatWChar_tAsBuiltInType="true"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- OpenMP="false"
- UsePrecompiledHeader="0"
- PrecompiledHeaderThrough="PreCompiled.h"
- AssemblerOutput="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- CallingConvention="0"
- CompileAs="0"
- DisableSpecificWarnings="4512;4127;4996;4291;4291;4996;4800;4099;4244;4018;4245"
- UseFullPaths="false"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkLibraryDependencies="true"
- UseLibraryDependencyInputs="true"
- AdditionalDependencies="opengl32.lib "
- ShowProgress="0"
- OutputFile="$(OutDir)\$(ProjectName).exe"
- LinkIncremental="2"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories="../../../freetype-2.1.10/lib;../../../Lua/lib;../../../FreeImage;../../../../Lib "
- GenerateManifest="true"
- ModuleDefinitionFile=""
- GenerateDebugInformation="true"
- GenerateMapFile="true"
- MapFileName="$(TargetDir)$(TargetName).map"
- MapExports="false"
- SubSystem="1"
- StackReserveSize="8388608"
- StackCommitSize="8388608"
- LargeAddressAware="2"
- TargetMachine="1"
- AllowIsolation="true"
- Profile="false"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- Description=""
- CommandLine=""
- ExcludedFromBuild="false"
- />
- </Configuration>
- <Configuration
- Name="Profile|Win32"
- OutputDirectory="$(ProjectDir)$(ConfigurationName)"
- IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2"
- UseOfMFC="0"
- WholeProgramOptimization="0"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- AdditionalOptions=""
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="2"
- OmitFramePointers="false"
- WholeProgramOptimization="false"
- AdditionalIncludeDirectories=";../../src/talloc;../../include;../../src/mesa;../../src/mapi;../../src/glsl/msvc;../../src/glsl;../../../../../Shared;../../../../../Tools/Shared;../../../freetype-2.1.10/include;../../../Lua/include;../../../FreeImage;../../../../Include;../../.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;AURORA_TOOL;AURORA_PROFILE"
- StringPooling="false"
- MinimalRebuild="false"
- ExceptionHandling="2"
- BasicRuntimeChecks="0"
- SmallerTypeCheck="false"
- RuntimeLibrary="2"
- StructMemberAlignment="3"
- BufferSecurityCheck="false"
- EnableFunctionLevelLinking="false"
- EnableEnhancedInstructionSet="2"
- FloatingPointExceptions="false"
- DisableLanguageExtensions="false"
- DefaultCharIsUnsigned="true"
- TreatWChar_tAsBuiltInType="true"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- OpenMP="false"
- UsePrecompiledHeader="0"
- PrecompiledHeaderThrough="PreCompiled.h"
- AssemblerOutput="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- CallingConvention="0"
- CompileAs="0"
- DisableSpecificWarnings="4512;4127;4996;4291;4291;4996;4800;4099;4244;4018;4245"
- UseFullPaths="false"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkLibraryDependencies="true"
- UseLibraryDependencyInputs="false"
- AdditionalDependencies="opengl32.lib "
- ShowProgress="0"
- OutputFile="$(OutDir)\$(ProjectName).exe"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories="../../../freetype-2.1.10/lib;../../../Lua/lib;../../../FreeImage;../../../../Lib "
- GenerateManifest="true"
- ModuleDefinitionFile=""
- GenerateDebugInformation="true"
- GenerateMapFile="true"
- MapFileName="$(TargetDir)$(TargetName).map"
- MapExports="false"
- SubSystem="1"
- StackReserveSize="8388608"
- StackCommitSize="8388608"
- LargeAddressAware="2"
- TargetMachine="1"
- AllowIsolation="true"
- Profile="false"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- Description=""
- CommandLine=""
- ExcludedFromBuild="false"
- />
- </Configuration>
- <Configuration
- Name="Final|Win32"
- OutputDirectory="$(ProjectDir)$(ConfigurationName)"
- IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
- ConfigurationType="1"
- CharacterSet="2"
- UseOfMFC="0"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- AdditionalOptions=""
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="2"
- OmitFramePointers="false"
- WholeProgramOptimization="true"
- AdditionalIncludeDirectories=";../../src/talloc;../../include;../../src/mesa;../../src/mapi;../../src/glsl/msvc;../../src/glsl;../../../../../Shared;../../../../../Tools/Shared;../../../freetype-2.1.10/include;../../../Lua/include;../../../FreeImage;../../../../Include;../../.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;AURORA_TOOL;AURORA_FINAL;AURORA_RETAIL"
- StringPooling="false"
- MinimalRebuild="false"
- ExceptionHandling="2"
- BasicRuntimeChecks="0"
- SmallerTypeCheck="false"
- RuntimeLibrary="2"
- StructMemberAlignment="3"
- BufferSecurityCheck="false"
- EnableFunctionLevelLinking="false"
- EnableEnhancedInstructionSet="2"
- FloatingPointExceptions="false"
- DisableLanguageExtensions="false"
- DefaultCharIsUnsigned="true"
- TreatWChar_tAsBuiltInType="true"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- OpenMP="false"
- UsePrecompiledHeader="0"
- PrecompiledHeaderThrough="PreCompiled.h"
- AssemblerOutput="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- CallingConvention="0"
- CompileAs="0"
- DisableSpecificWarnings="4512;4127;4996;4291;4291;4996;4800;4099;4244;4018;4245"
- UseFullPaths="false"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLinkerTool"
- LinkLibraryDependencies="true"
- UseLibraryDependencyInputs="false"
- AdditionalDependencies="opengl32.lib "
- ShowProgress="0"
- OutputFile="$(OutDir)\$(ProjectName).exe"
- LinkIncremental="1"
- SuppressStartupBanner="true"
- AdditionalLibraryDirectories="../../../freetype-2.1.10/lib;../../../Lua/lib;../../../FreeImage;../../../../Lib "
- GenerateManifest="true"
- ModuleDefinitionFile=""
- GenerateDebugInformation="true"
- GenerateMapFile="true"
- MapFileName="$(TargetDir)$(TargetName).map"
- MapExports="false"
- SubSystem="1"
- StackReserveSize="8388608"
- StackCommitSize="8388608"
- LargeAddressAware="2"
- TargetMachine="1"
- AllowIsolation="true"
- Profile="false"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- Description=""
- CommandLine=""
- ExcludedFromBuild="false"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <File
- RelativePath="Main.cpp"
- >
- </File>
- <File
- RelativePath="Readme"
- >
- </File>
- <Filter
- Name="src"
- >
- <Filter
- Name="mesa"
- >
- <Filter
- Name="program"
- >
- <File
- RelativePath="..\..\src\mesa\program\hash_table.c"
- >
- </File>
- <File
- RelativePath="..\..\src\mesa\program\hash_table.h"
- >
- </File>
- <File
- RelativePath="..\..\src\mesa\program\symbol_table.c"
- >
- </File>
- <File
- RelativePath="..\..\src\mesa\program\symbol_table.h"
- >
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="talloc"
- >
- <File
- RelativePath="..\..\src\talloc\talloc.c"
- >
- </File>
- <File
- RelativePath="..\..\src\talloc\talloc.h"
- >
- </File>
- </Filter>
- <Filter
- Name="glsl"
- >
- <File
- RelativePath="..\..\src\glsl\ast.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ast_expr.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ast_function.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ast_to_hir.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ast_type.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\builtin_function.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\builtin_types.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\builtin_variables.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\glsl_lexer.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\glsl_lexer.lpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\glsl_optimizer.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\glsl_optimizer.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\glsl_parser.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\glsl_parser.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\glsl_parser.ypp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\glsl_parser_extras.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\glsl_parser_extras.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\glsl_symbol_table.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\glsl_types.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\glsl_types.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\hir_field_selection.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_algebraic.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_basic_block.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_basic_block.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_clone.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_constant_expression.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_constant_folding.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_constant_propagation.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_constant_variable.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_copy_propagation.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_dead_code.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_dead_code_local.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_dead_functions.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_div_to_mul_rcp.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_expression_flattening.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_expression_flattening.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_function.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_function_can_inline.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_function_inlining.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_function_inlining.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_hierarchical_visitor.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_hierarchical_visitor.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_hv_accept.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_if_return.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_if_simplification.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_if_to_cond_assign.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_import_prototypes.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_mat_op_to_vec.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_mod_to_fract.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_noop_swizzle.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_optimization.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_print_glsl_visitor.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_print_glsl_visitor.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_print_visitor.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_print_visitor.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_reader.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_reader.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_rvalue_visitor.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_rvalue_visitor.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_structure_splitting.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_sub_to_add_neg.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_swizzle_swizzle.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_tree_grafting.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_unused_structs.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_unused_structs.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_validate.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_variable.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_variable_refcount.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_variable_refcount.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_vec_index_to_cond_assign.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_vec_index_to_swizzle.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\ir_visitor.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\link_functions.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\linker.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\linker.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\list.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\program.h"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\s_expression.cpp"
- >
- </File>
- <File
- RelativePath="..\..\src\glsl\s_expression.h"
- >
- </File>
- <Filter
- Name="msvc"
- >
- <File
- RelativePath="..\..\src\glsl\msvc\msvccompat.h"
- >
- </File>
- </Filter>
- </Filter>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/SourceFiles b/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/SourceFiles
deleted file mode 100644
index 61be13694b8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/SourceFiles
+++ /dev/null
@@ -1,90 +0,0 @@
- ../../../../src/mesa/program/hash_table.c
- ../../../../src/mesa/program/hash_table.h
- ../../../../src/mesa/program/symbol_table.c
- ../../../../src/mesa/program/symbol_table.h
- ../../../../src/talloc/talloc.c
- ../../../../src/talloc/talloc.h
- ../../../../src/glsl/ast.h
- ../../../../src/glsl/ast_expr.cpp
- ../../../../src/glsl/ast_function.cpp
- ../../../../src/glsl/ast_to_hir.cpp
- ../../../../src/glsl/ast_type.cpp
- ../../../../src/glsl/builtin_function.cpp
- ../../../../src/glsl/builtin_types.h
- ../../../../src/glsl/builtin_variables.h
- ../../../../src/glsl/glsl_lexer.cpp
- ../../../../src/glsl/glsl_lexer.lpp
- ../../../../src/glsl/glsl_optimizer.cpp
- ../../../../src/glsl/glsl_optimizer.h
-# ../../../../src/glsl/glsl_optimizer_main.cpp
- ../../../../src/glsl/glsl_parser.cpp
- ../../../../src/glsl/glsl_parser.h
- ../../../../src/glsl/glsl_parser.ypp
- ../../../../src/glsl/glsl_parser_extras.cpp
- ../../../../src/glsl/glsl_parser_extras.h
- ../../../../src/glsl/glsl_symbol_table.h
- ../../../../src/glsl/glsl_types.cpp
- ../../../../src/glsl/glsl_types.h
- ../../../../src/glsl/hir_field_selection.cpp
- ../../../../src/glsl/ir.cpp
- ../../../../src/glsl/ir.h
- ../../../../src/glsl/ir_algebraic.cpp
- ../../../../src/glsl/ir_basic_block.cpp
- ../../../../src/glsl/ir_basic_block.h
- ../../../../src/glsl/ir_clone.cpp
- ../../../../src/glsl/ir_constant_expression.cpp
- ../../../../src/glsl/ir_constant_folding.cpp
- ../../../../src/glsl/ir_constant_propagation.cpp
- ../../../../src/glsl/ir_constant_variable.cpp
- ../../../../src/glsl/ir_copy_propagation.cpp
- ../../../../src/glsl/ir_dead_code.cpp
- ../../../../src/glsl/ir_dead_code_local.cpp
- ../../../../src/glsl/ir_dead_functions.cpp
- ../../../../src/glsl/ir_div_to_mul_rcp.cpp
- ../../../../src/glsl/ir_expression_flattening.cpp
- ../../../../src/glsl/ir_expression_flattening.h
- ../../../../src/glsl/ir_function.cpp
- ../../../../src/glsl/ir_function_can_inline.cpp
- ../../../../src/glsl/ir_function_inlining.cpp
- ../../../../src/glsl/ir_function_inlining.h
- ../../../../src/glsl/ir_hierarchical_visitor.cpp
- ../../../../src/glsl/ir_hierarchical_visitor.h
- ../../../../src/glsl/ir_hv_accept.cpp
- ../../../../src/glsl/ir_if_return.cpp
- ../../../../src/glsl/ir_if_simplification.cpp
- ../../../../src/glsl/ir_if_to_cond_assign.cpp
- ../../../../src/glsl/ir_import_prototypes.cpp
- ../../../../src/glsl/ir_mat_op_to_vec.cpp
- ../../../../src/glsl/ir_mod_to_fract.cpp
- ../../../../src/glsl/ir_noop_swizzle.cpp
- ../../../../src/glsl/ir_optimization.h
- ../../../../src/glsl/ir_print_glsl_visitor.cpp
- ../../../../src/glsl/ir_print_glsl_visitor.h
- ../../../../src/glsl/ir_print_visitor.cpp
- ../../../../src/glsl/ir_print_visitor.h
- ../../../../src/glsl/ir_reader.cpp
- ../../../../src/glsl/ir_reader.h
- ../../../../src/glsl/ir_rvalue_visitor.cpp
- ../../../../src/glsl/ir_rvalue_visitor.h
- ../../../../src/glsl/ir_structure_splitting.cpp
- ../../../../src/glsl/ir_sub_to_add_neg.cpp
- ../../../../src/glsl/ir_swizzle_swizzle.cpp
- ../../../../src/glsl/ir_tree_grafting.cpp
- ../../../../src/glsl/ir_unused_structs.cpp
- ../../../../src/glsl/ir_unused_structs.h
- ../../../../src/glsl/ir_validate.cpp
- ../../../../src/glsl/ir_variable.cpp
- ../../../../src/glsl/ir_variable_refcount.cpp
- ../../../../src/glsl/ir_variable_refcount.h
- ../../../../src/glsl/ir_vec_index_to_cond_assign.cpp
- ../../../../src/glsl/ir_vec_index_to_swizzle.cpp
- ../../../../src/glsl/ir_visitor.h
- ../../../../src/glsl/link_functions.cpp
- ../../../../src/glsl/linker.cpp
- ../../../../src/glsl/linker.h
- ../../../../src/glsl/list.h
-# ../../../../src/glsl/main.cpp
- ../../../../src/glsl/program.h
- ../../../../src/glsl/s_expression.cpp
- ../../../../src/glsl/s_expression.h
- ../../../../src/glsl/msvc/msvccompat.h
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/glsloptlib.bdgcfg b/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/glsloptlib.bdgcfg
deleted file mode 100644
index 34d312f5271..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/glsloptlib.bdgcfg
+++ /dev/null
@@ -1,9 +0,0 @@
-[General]
-Type = StaticLibrary
-SourceFiles = SourceFiles
-Platform = Tool
-
-[Project]
-IncludePaths=../../../../src/talloc;../../../../include;../../../../src/mesa;../../../../src/mapi;../../../../src/glsl/msvc;../../../../src/glsl
-Defines=snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE
-DisabledVcWarnings=4291;4996;4800;4099;4244;4018;4245
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/glsloptlib.vcproj b/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/glsloptlib.vcproj
deleted file mode 100644
index 3ff6930473f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/contrib/staticlib/Build/Tool/glsloptlib.vcproj
+++ /dev/null
@@ -1,829 +0,0 @@
-<?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject
- ProjectType="Visual C++"
- Version="8.00"
- Name="glsloptlib"
- ProjectGUID="{793576AD-FB15-5AA1-F2F5-488372B23341}"
- Keyword="Win32Proj"
- >
- <Platforms>
- <Platform
- Name="Win32"
- />
- </Platforms>
- <ToolFiles>
- </ToolFiles>
- <Configurations>
- <Configuration
- Name="Debug|Win32"
- OutputDirectory="$(ProjectDir)$(ConfigurationName)"
- IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
- ConfigurationType="4"
- UseOfMFC="0"
- CharacterSet="2"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="0"
- AdditionalOptions=""
- AdditionalIncludeDirectories=";../../../../src/talloc;../../../../include;../../../../src/mesa;../../../../src/mapi;../../../../src/glsl/msvc;../../../../src/glsl;../../../../../../../Shared;../../../../../../../Tools/Shared;../../../../../freetype-2.1.10/include;../../../../../Lua/include;../../../../../FreeImage;../../../../../../Include;../../../../.."
- PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;AURORA_TOOL;AURORA_DEBUGG"
- StringPooling="false"
- MinimalRebuild="false"
- ExceptionHandling="2"
- BasicRuntimeChecks="3"
- SmallerTypeCheck="true"
- RuntimeLibrary="3"
- StructMemberAlignment="3"
- BufferSecurityCheck="true"
- EnableFunctionLevelLinking="true"
- EnableEnhancedInstructionSet="0"
- FloatingPointExceptions="false"
- DisableLanguageExtensions="false"
- DefaultCharIsUnsigned="true"
- TreatWChar_tAsBuiltInType="true"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- OpenMP="false"
- UsePrecompiledHeader="0"
- PrecompiledHeaderThrough="PreCompiled.h"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="4"
- CallingConvention="0"
- CompileAs="0"
- DisableSpecificWarnings="4512;4127;4996;4291;4291;4996;4800;4099;4244;4018;4245"
- UseFullPaths="false"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- LinkLibraryDependencies="false"
- AdditionalDependencies=" "
- AdditionalLibraryDirectories="../../../../../freetype-2.1.10/lib;../../../../../Lua/lib;../../../../../FreeImage;../../../../../../Lib "
- OutputFile="$(OutDir)\$(ProjectName).lib"
- SuppressStartupBanner="true"
- AdditionalOptions="/IGNORE:4221 /IGNORE:4006"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- Description=""
- CommandLine=""
- ExcludedFromBuild="false"
- />
- </Configuration>
- <Configuration
- Name="Release|Win32"
- OutputDirectory="$(ProjectDir)$(ConfigurationName)"
- IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="2"
- UseOfMFC="0"
- WholeProgramOptimization="0"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- AdditionalOptions=""
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="2"
- OmitFramePointers="false"
- WholeProgramOptimization="false"
- AdditionalIncludeDirectories=";../../../../src/talloc;../../../../include;../../../../src/mesa;../../../../src/mapi;../../../../src/glsl/msvc;../../../../src/glsl;../../../../../../../Shared;../../../../../../../Tools/Shared;../../../../../freetype-2.1.10/include;../../../../../Lua/include;../../../../../FreeImage;../../../../../../Include;../../../../.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;AURORA_TOOL;AURORA_RELEASE"
- StringPooling="false"
- MinimalRebuild="false"
- ExceptionHandling="2"
- BasicRuntimeChecks="0"
- SmallerTypeCheck="false"
- RuntimeLibrary="2"
- StructMemberAlignment="3"
- BufferSecurityCheck="false"
- EnableFunctionLevelLinking="true"
- EnableEnhancedInstructionSet="2"
- FloatingPointExceptions="false"
- DisableLanguageExtensions="false"
- DefaultCharIsUnsigned="true"
- TreatWChar_tAsBuiltInType="true"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- OpenMP="false"
- UsePrecompiledHeader="0"
- PrecompiledHeaderThrough="PreCompiled.h"
- AssemblerOutput="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- CallingConvention="0"
- CompileAs="0"
- DisableSpecificWarnings="4512;4127;4996;4291;4291;4996;4800;4099;4244;4018;4245"
- UseFullPaths="false"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- LinkLibraryDependencies="false"
- AdditionalDependencies=" "
- AdditionalLibraryDirectories="../../../../../freetype-2.1.10/lib;../../../../../Lua/lib;../../../../../FreeImage;../../../../../../Lib "
- OutputFile="$(OutDir)\$(ProjectName).lib"
- SuppressStartupBanner="true"
- AdditionalOptions="/IGNORE:4221 /IGNORE:4006"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- Description=""
- CommandLine=""
- ExcludedFromBuild="false"
- />
- </Configuration>
- <Configuration
- Name="Profile|Win32"
- OutputDirectory="$(ProjectDir)$(ConfigurationName)"
- IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="2"
- UseOfMFC="0"
- WholeProgramOptimization="0"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- AdditionalOptions=""
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="2"
- OmitFramePointers="false"
- WholeProgramOptimization="false"
- AdditionalIncludeDirectories=";../../../../src/talloc;../../../../include;../../../../src/mesa;../../../../src/mapi;../../../../src/glsl/msvc;../../../../src/glsl;../../../../../../../Shared;../../../../../../../Tools/Shared;../../../../../freetype-2.1.10/include;../../../../../Lua/include;../../../../../FreeImage;../../../../../../Include;../../../../.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;AURORA_TOOL;AURORA_PROFILE"
- StringPooling="false"
- MinimalRebuild="false"
- ExceptionHandling="2"
- BasicRuntimeChecks="0"
- SmallerTypeCheck="false"
- RuntimeLibrary="2"
- StructMemberAlignment="3"
- BufferSecurityCheck="false"
- EnableFunctionLevelLinking="false"
- EnableEnhancedInstructionSet="2"
- FloatingPointExceptions="false"
- DisableLanguageExtensions="false"
- DefaultCharIsUnsigned="true"
- TreatWChar_tAsBuiltInType="true"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- OpenMP="false"
- UsePrecompiledHeader="0"
- PrecompiledHeaderThrough="PreCompiled.h"
- AssemblerOutput="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- CallingConvention="0"
- CompileAs="0"
- DisableSpecificWarnings="4512;4127;4996;4291;4291;4996;4800;4099;4244;4018;4245"
- UseFullPaths="false"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- LinkLibraryDependencies="false"
- AdditionalDependencies=" "
- AdditionalLibraryDirectories="../../../../../freetype-2.1.10/lib;../../../../../Lua/lib;../../../../../FreeImage;../../../../../../Lib "
- OutputFile="$(OutDir)\$(ProjectName).lib"
- SuppressStartupBanner="true"
- AdditionalOptions="/IGNORE:4221 /IGNORE:4006"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- Description=""
- CommandLine=""
- ExcludedFromBuild="false"
- />
- </Configuration>
- <Configuration
- Name="Final|Win32"
- OutputDirectory="$(ProjectDir)$(ConfigurationName)"
- IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
- ConfigurationType="4"
- CharacterSet="2"
- UseOfMFC="0"
- WholeProgramOptimization="1"
- >
- <Tool
- Name="VCPreBuildEventTool"
- />
- <Tool
- Name="VCCustomBuildTool"
- />
- <Tool
- Name="VCXMLDataGeneratorTool"
- />
- <Tool
- Name="VCWebServiceProxyGeneratorTool"
- />
- <Tool
- Name="VCMIDLTool"
- />
- <Tool
- Name="VCCLCompilerTool"
- Optimization="3"
- AdditionalOptions=""
- InlineFunctionExpansion="2"
- EnableIntrinsicFunctions="true"
- FavorSizeOrSpeed="2"
- OmitFramePointers="false"
- WholeProgramOptimization="true"
- AdditionalIncludeDirectories=";../../../../src/talloc;../../../../include;../../../../src/mesa;../../../../src/mapi;../../../../src/glsl/msvc;../../../../src/glsl;../../../../../../../Shared;../../../../../../../Tools/Shared;../../../../../freetype-2.1.10/include;../../../../../Lua/include;../../../../../FreeImage;../../../../../../Include;../../../../.."
- PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;snprintf=_snprintf;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;AURORA_TOOL;AURORA_FINAL;AURORA_RETAIL"
- StringPooling="false"
- MinimalRebuild="false"
- ExceptionHandling="2"
- BasicRuntimeChecks="0"
- SmallerTypeCheck="false"
- RuntimeLibrary="2"
- StructMemberAlignment="3"
- BufferSecurityCheck="false"
- EnableFunctionLevelLinking="false"
- EnableEnhancedInstructionSet="2"
- FloatingPointExceptions="false"
- DisableLanguageExtensions="false"
- DefaultCharIsUnsigned="true"
- TreatWChar_tAsBuiltInType="true"
- ForceConformanceInForLoopScope="true"
- RuntimeTypeInfo="true"
- OpenMP="false"
- UsePrecompiledHeader="0"
- PrecompiledHeaderThrough="PreCompiled.h"
- AssemblerOutput="0"
- WarningLevel="4"
- Detect64BitPortabilityProblems="true"
- DebugInformationFormat="3"
- CallingConvention="0"
- CompileAs="0"
- DisableSpecificWarnings="4512;4127;4996;4291;4291;4996;4800;4099;4244;4018;4245"
- UseFullPaths="false"
- />
- <Tool
- Name="VCManagedResourceCompilerTool"
- />
- <Tool
- Name="VCResourceCompilerTool"
- />
- <Tool
- Name="VCPreLinkEventTool"
- />
- <Tool
- Name="VCLibrarianTool"
- LinkLibraryDependencies="false"
- AdditionalDependencies=" "
- AdditionalLibraryDirectories="../../../../../freetype-2.1.10/lib;../../../../../Lua/lib;../../../../../FreeImage;../../../../../../Lib "
- OutputFile="$(OutDir)\$(ProjectName).lib"
- SuppressStartupBanner="true"
- AdditionalOptions="/IGNORE:4221 /IGNORE:4006"
- />
- <Tool
- Name="VCALinkTool"
- />
- <Tool
- Name="VCManifestTool"
- />
- <Tool
- Name="VCXDCMakeTool"
- />
- <Tool
- Name="VCBscMakeTool"
- />
- <Tool
- Name="VCFxCopTool"
- />
- <Tool
- Name="VCAppVerifierTool"
- />
- <Tool
- Name="VCWebDeploymentTool"
- />
- <Tool
- Name="VCPostBuildEventTool"
- Description=""
- CommandLine=""
- ExcludedFromBuild="false"
- />
- </Configuration>
- </Configurations>
- <References>
- </References>
- <Files>
- <Filter
- Name="src"
- >
- <Filter
- Name="mesa"
- >
- <Filter
- Name="program"
- >
- <File
- RelativePath="..\..\..\..\src\mesa\program\hash_table.c"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\program\hash_table.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\program\symbol_table.c"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\mesa\program\symbol_table.h"
- >
- </File>
- </Filter>
- </Filter>
- <Filter
- Name="talloc"
- >
- <File
- RelativePath="..\..\..\..\src\talloc\talloc.c"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\talloc\talloc.h"
- >
- </File>
- </Filter>
- <Filter
- Name="glsl"
- >
- <File
- RelativePath="..\..\..\..\src\glsl\ast.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ast_expr.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ast_function.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ast_to_hir.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ast_type.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\builtin_function.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\builtin_types.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\builtin_variables.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\glsl_lexer.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\glsl_lexer.lpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\glsl_optimizer.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\glsl_optimizer.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\glsl_parser.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\glsl_parser.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\glsl_parser.ypp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\glsl_parser_extras.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\glsl_parser_extras.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\glsl_symbol_table.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\glsl_types.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\glsl_types.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\hir_field_selection.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_algebraic.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_basic_block.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_basic_block.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_clone.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_constant_expression.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_constant_folding.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_constant_propagation.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_constant_variable.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_copy_propagation.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_dead_code.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_dead_code_local.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_dead_functions.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_div_to_mul_rcp.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_expression_flattening.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_expression_flattening.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_function.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_function_can_inline.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_function_inlining.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_function_inlining.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_hierarchical_visitor.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_hierarchical_visitor.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_hv_accept.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_if_return.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_if_simplification.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_if_to_cond_assign.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_import_prototypes.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_mat_op_to_vec.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_mod_to_fract.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_noop_swizzle.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_optimization.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_print_glsl_visitor.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_print_glsl_visitor.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_print_visitor.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_print_visitor.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_reader.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_reader.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_rvalue_visitor.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_rvalue_visitor.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_structure_splitting.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_sub_to_add_neg.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_swizzle_swizzle.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_tree_grafting.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_unused_structs.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_unused_structs.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_validate.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_variable.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_variable_refcount.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_variable_refcount.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_vec_index_to_cond_assign.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_vec_index_to_swizzle.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\ir_visitor.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\link_functions.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\linker.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\linker.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\list.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\program.h"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\s_expression.cpp"
- >
- </File>
- <File
- RelativePath="..\..\..\..\src\glsl\s_expression.h"
- >
- </File>
- <Filter
- Name="msvc"
- >
- <File
- RelativePath="..\..\..\..\src\glsl\msvc\msvccompat.h"
- >
- </File>
- </Filter>
- </Filter>
- </Filter>
- </Files>
- <Globals>
- </Globals>
-</VisualStudioProject>
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/package.json b/3rdparty/bgfx/3rdparty/glsl-optimizer/package.json
deleted file mode 100644
index 017906e33eb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/package.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "name": "glsl-optimizer",
- "version": "0.1.0",
- "description": "GLSL optimizer",
- "main": "build/Release/glslOptimizer.node",
- "scripts": {
- "install": "node-gyp rebuild"
- },
- "repository": {
- "type": "git",
- "url": "https://github.com/aras-p/glsl-optimizer.git"
- },
- "keywords": [
- "glsl",
- "webgl",
- "shader",
- "optimize",
- "optimizer",
- "opengl",
- "essl",
- "es",
- "opengles"
- ],
- "readmeFilename": "README.md",
- "author": "Aras Pranckevičius",
- "license": "MIT",
- "gypfile": true,
- "bugs": {
- "url": "https://github.com/aras-p/glsl-optimizer/issues"
- },
- "homepage": "https://github.com/aras-p/glsl-optimizer",
- "directories": {
- "test": "tests"
- },
- "dependencies": {
- "nan": "~1.2.0"
- }
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer.sln b/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer.sln
deleted file mode 100644
index 8083c8eb7d7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer.sln
+++ /dev/null
@@ -1,36 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 11.00
-# Visual Studio 2010
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glsl_optimizer_lib", "glsl_optimizer_lib.vcxproj", "{B475A403-9D9B-410D-8A93-BA49FC4DD811}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "glsl_optimizer_tests", "glsl_optimizer_tests.vcxproj", "{BB382242-6EBB-445F-989C-B9BA61D17965}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Win32 = Debug|Win32
- Debug|x64 = Debug|x64
- Release|Win32 = Release|Win32
- Release|x64 = Release|x64
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {B475A403-9D9B-410D-8A93-BA49FC4DD811}.Debug|Win32.ActiveCfg = Debug|Win32
- {B475A403-9D9B-410D-8A93-BA49FC4DD811}.Debug|Win32.Build.0 = Debug|Win32
- {B475A403-9D9B-410D-8A93-BA49FC4DD811}.Debug|x64.ActiveCfg = Debug|x64
- {B475A403-9D9B-410D-8A93-BA49FC4DD811}.Debug|x64.Build.0 = Debug|x64
- {B475A403-9D9B-410D-8A93-BA49FC4DD811}.Release|Win32.ActiveCfg = Release|Win32
- {B475A403-9D9B-410D-8A93-BA49FC4DD811}.Release|Win32.Build.0 = Release|Win32
- {B475A403-9D9B-410D-8A93-BA49FC4DD811}.Release|x64.ActiveCfg = Release|x64
- {B475A403-9D9B-410D-8A93-BA49FC4DD811}.Release|x64.Build.0 = Release|x64
- {BB382242-6EBB-445F-989C-B9BA61D17965}.Debug|Win32.ActiveCfg = Debug|Win32
- {BB382242-6EBB-445F-989C-B9BA61D17965}.Debug|Win32.Build.0 = Debug|Win32
- {BB382242-6EBB-445F-989C-B9BA61D17965}.Debug|x64.ActiveCfg = Debug|x64
- {BB382242-6EBB-445F-989C-B9BA61D17965}.Debug|x64.Build.0 = Debug|x64
- {BB382242-6EBB-445F-989C-B9BA61D17965}.Release|Win32.ActiveCfg = Release|Win32
- {BB382242-6EBB-445F-989C-B9BA61D17965}.Release|Win32.Build.0 = Release|Win32
- {BB382242-6EBB-445F-989C-B9BA61D17965}.Release|x64.ActiveCfg = Release|x64
- {BB382242-6EBB-445F-989C-B9BA61D17965}.Release|x64.Build.0 = Release|x64
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj b/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj
deleted file mode 100644
index 92063b3edc8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj
+++ /dev/null
@@ -1,372 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{B475A403-9D9B-410D-8A93-BA49FC4DD811}</ProjectGuid>
- <RootNamespace>glsl_optimizer_lib</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>false</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>false</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>StaticLibrary</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">build/$(ProjectName)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">build/$(ProjectName)\$(Configuration)\</IntDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">build/$(Platform)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">build/$(Platform)\$(Configuration)\</IntDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../src/mesa;../../src;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>false</MinimalRebuild>
- <ExceptionHandling>
- </ExceptionHandling>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
- <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
- </ClCompile>
- <Lib>
- <OutputFile>$(OutDir)$(ProjectName)-win32.lib</OutputFile>
- </Lib>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <Midl>
- <TargetEnvironment>X64</TargetEnvironment>
- </Midl>
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>../../src/mesa;../../src;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>false</MinimalRebuild>
- <ExceptionHandling>
- </ExceptionHandling>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
- <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
- </ClCompile>
- <Lib>
- <OutputFile>$(OutDir)$(ProjectName)-x64.lib</OutputFile>
- </Lib>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../src/mesa;../../src;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <ExceptionHandling>
- </ExceptionHandling>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>OldStyle</DebugInformationFormat>
- <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
- <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
- </ClCompile>
- <Lib>
- <OutputFile>$(OutDir)$(ProjectName)-win32.lib</OutputFile>
- </Lib>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <Midl>
- <TargetEnvironment>X64</TargetEnvironment>
- </Midl>
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>../../src/mesa;../../src;../../include/c99;../../include;../../src/glsl;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;NOMINMAX;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE;__STDC_VERSION__=199901L;__STDC__;strdup=_strdup;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <ExceptionHandling>
- </ExceptionHandling>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <RuntimeTypeInfo>false</RuntimeTypeInfo>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>OldStyle</DebugInformationFormat>
- <DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
- <ForcedIncludeFiles>%(ForcedIncludeFiles)</ForcedIncludeFiles>
- </ClCompile>
- <Lib>
- <OutputFile>$(OutDir)$(ProjectName)-x64.lib</OutputFile>
- </Lib>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClInclude Include="..\..\src\glsl\ast.h" />
- <ClInclude Include="..\..\src\glsl\builtin_type_macros.h" />
- <ClInclude Include="..\..\src\glsl\glsl_optimizer.h" />
- <ClInclude Include="..\..\src\glsl\glsl_parser.h" />
- <ClInclude Include="..\..\src\glsl\glsl_parser_extras.h" />
- <ClInclude Include="..\..\src\glsl\glsl_symbol_table.h" />
- <ClInclude Include="..\..\src\glsl\glsl_types.h" />
- <ClInclude Include="..\..\src\glsl\ir.h" />
- <ClInclude Include="..\..\src\glsl\ir_basic_block.h" />
- <ClInclude Include="..\..\src\glsl\ir_builder.h" />
- <ClInclude Include="..\..\src\glsl\ir_expression_flattening.h" />
- <ClInclude Include="..\..\src\glsl\ir_function_inlining.h" />
- <ClInclude Include="..\..\src\glsl\ir_hierarchical_visitor.h" />
- <ClInclude Include="..\..\src\glsl\ir_optimization.h" />
- <ClInclude Include="..\..\src\glsl\ir_print_glsl_visitor.h" />
- <ClInclude Include="..\..\src\glsl\ir_print_metal_visitor.h" />
- <ClInclude Include="..\..\src\glsl\ir_print_visitor.h" />
- <ClInclude Include="..\..\src\glsl\ir_rvalue_visitor.h" />
- <ClInclude Include="..\..\src\glsl\ir_stats.h" />
- <ClInclude Include="..\..\src\glsl\ir_uniform.h" />
- <ClInclude Include="..\..\src\glsl\ir_unused_structs.h" />
- <ClInclude Include="..\..\src\glsl\ir_variable_refcount.h" />
- <ClInclude Include="..\..\src\glsl\ir_visitor.h" />
- <ClInclude Include="..\..\src\glsl\linker.h" />
- <ClInclude Include="..\..\src\glsl\link_uniform_block_active_visitor.h" />
- <ClInclude Include="..\..\src\glsl\link_varyings.h" />
- <ClInclude Include="..\..\src\glsl\list.h" />
- <ClInclude Include="..\..\src\glsl\loop_analysis.h" />
- <ClInclude Include="..\..\src\glsl\program.h" />
- <ClInclude Include="..\..\src\glsl\s_expression.h" />
- <ClInclude Include="..\..\src\glsl\standalone_scaffolding.h" />
- <ClInclude Include="..\..\src\glsl\strtod.h" />
- <ClInclude Include="..\..\src\glsl\glcpp\glcpp-parse.h" />
- <ClInclude Include="..\..\src\glsl\glcpp\glcpp.h" />
- <ClInclude Include="..\..\src\mesa\program\hash_table.h" />
- <ClInclude Include="..\..\src\mesa\program\prog_instruction.h" />
- <ClInclude Include="..\..\src\mesa\program\prog_parameter.h" />
- <ClInclude Include="..\..\src\mesa\program\prog_statevars.h" />
- <ClInclude Include="..\..\src\mesa\program\symbol_table.h" />
- <ClInclude Include="..\..\src\mesa\main\compiler.h" />
- <ClInclude Include="..\..\src\mesa\main\config.h" />
- <ClInclude Include="..\..\src\mesa\main\context.h" />
- <ClInclude Include="..\..\src\mesa\main\core.h" />
- <ClInclude Include="..\..\src\mesa\main\dd.h" />
- <ClInclude Include="..\..\src\mesa\main\glheader.h" />
- <ClInclude Include="..\..\src\mesa\main\glminimal.h" />
- <ClInclude Include="..\..\src\mesa\main\imports.h" />
- <ClInclude Include="..\..\src\mesa\main\macros.h" />
- <ClInclude Include="..\..\src\mesa\main\mtypes.h" />
- <ClInclude Include="..\..\src\mesa\main\simple_list.h" />
- <ClInclude Include="..\..\src\util\hash_table.h" />
- <ClInclude Include="..\..\src\util\ralloc.h" />
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\..\src\glsl\ast_array_index.cpp" />
- <ClCompile Include="..\..\src\glsl\ast_expr.cpp" />
- <ClCompile Include="..\..\src\glsl\ast_function.cpp" />
- <ClCompile Include="..\..\src\glsl\ast_to_hir.cpp" />
- <ClCompile Include="..\..\src\glsl\ast_type.cpp" />
- <ClCompile Include="..\..\src\glsl\builtin_functions.cpp" />
- <ClCompile Include="..\..\src\glsl\builtin_types.cpp" />
- <ClCompile Include="..\..\src\glsl\builtin_variables.cpp" />
- <ClCompile Include="..\..\src\glsl\glsl_lexer.cpp" />
- <ClCompile Include="..\..\src\glsl\glsl_optimizer.cpp" />
- <ClCompile Include="..\..\src\glsl\glsl_parser.cpp" />
- <ClCompile Include="..\..\src\glsl\glsl_parser_extras.cpp" />
- <ClCompile Include="..\..\src\glsl\glsl_symbol_table.cpp" />
- <ClCompile Include="..\..\src\glsl\glsl_types.cpp" />
- <ClCompile Include="..\..\src\glsl\hir_field_selection.cpp" />
- <ClCompile Include="..\..\src\glsl\ir.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_basic_block.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_builder.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_clone.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_constant_expression.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_equals.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_expression_flattening.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_function.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_function_can_inline.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_function_detect_recursion.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_hierarchical_visitor.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_hv_accept.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_import_prototypes.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_print_glsl_visitor.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_print_metal_visitor.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_print_visitor.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_rvalue_visitor.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_stats.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_unused_structs.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_validate.cpp" />
- <ClCompile Include="..\..\src\glsl\ir_variable_refcount.cpp" />
- <ClCompile Include="..\..\src\glsl\link_atomics.cpp" />
- <ClCompile Include="..\..\src\glsl\link_functions.cpp" />
- <ClCompile Include="..\..\src\glsl\link_interface_blocks.cpp" />
- <ClCompile Include="..\..\src\glsl\link_uniform_blocks.cpp" />
- <ClCompile Include="..\..\src\glsl\link_uniform_block_active_visitor.cpp" />
- <ClCompile Include="..\..\src\glsl\link_uniform_initializers.cpp" />
- <ClCompile Include="..\..\src\glsl\link_uniforms.cpp" />
- <ClCompile Include="..\..\src\glsl\linker.cpp" />
- <ClCompile Include="..\..\src\glsl\link_varyings.cpp" />
- <ClCompile Include="..\..\src\glsl\loop_analysis.cpp" />
- <ClCompile Include="..\..\src\glsl\loop_controls.cpp" />
- <ClCompile Include="..\..\src\glsl\loop_unroll.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_clip_distance.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_discard.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_discard_flow.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_if_to_cond_assign.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_instructions.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_jumps.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_mat_op_to_vec.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_named_interface_blocks.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_noise.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_offset_array.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_output_reads.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_packed_varyings.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_packing_builtins.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_ubo_reference.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_variable_index_to_cond_assign.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_vector_insert.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_vec_index_to_cond_assign.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_vec_index_to_swizzle.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_vector.cpp" />
- <ClCompile Include="..\..\src\glsl\lower_vertex_id.cpp" />
- <ClCompile Include="..\..\src\glsl\main.cpp">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_algebraic.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_array_splitting.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_constant_folding.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_constant_propagation.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_constant_variable.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_copy_propagation.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_copy_propagation_elements.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_cse.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_dead_builtin_variables.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_dead_builtin_varyings.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_dead_code.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_dead_code_local.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_dead_functions.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_flatten_nested_if_blocks.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_flip_matrices.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_function_inlining.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_if_simplification.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_minmax.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_noop_swizzle.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_rebalance_tree.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_redundant_jumps.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_structure_splitting.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_swizzle_swizzle.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_tree_grafting.cpp" />
- <ClCompile Include="..\..\src\glsl\opt_vectorize.cpp" />
- <ClCompile Include="..\..\src\glsl\s_expression.cpp" />
- <ClCompile Include="..\..\src\glsl\standalone_scaffolding.cpp" />
- <ClCompile Include="..\..\src\glsl\strtod.c" />
- <ClCompile Include="..\..\src\glsl\glcpp\glcpp-lex.c" />
- <ClCompile Include="..\..\src\glsl\glcpp\glcpp-parse.c" />
- <ClCompile Include="..\..\src\glsl\glcpp\glcpp.c">
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\glcpp\pp.c" />
- <ClCompile Include="..\..\src\mesa\main\imports.c" />
- <ClCompile Include="..\..\src\mesa\program\prog_hash_table.c" />
- <ClCompile Include="..\..\src\mesa\program\symbol_table.c" />
- <ClCompile Include="..\..\src\util\hash_table.c" />
- <ClCompile Include="..\..\src\util\ralloc.c" />
- </ItemGroup>
- <ItemGroup>
- <CustomBuildStep Include="..\..\src\glsl\glsl_lexer.lpp">
- <FileType>Document</FileType>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- </CustomBuildStep>
- <CustomBuildStep Include="..\..\src\glsl\glsl_parser.ypp">
- <FileType>Document</FileType>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- </CustomBuildStep>
- <CustomBuildStep Include="..\..\src\glsl\glcpp\glcpp-lex.l">
- <FileType>Document</FileType>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- </CustomBuildStep>
- <CustomBuildStep Include="..\..\src\glsl\glcpp\glcpp-parse.y">
- <FileType>Document</FileType>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
- <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
- </CustomBuildStep>
- <None Include="..\..\README.md" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters b/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters
deleted file mode 100644
index 6e9f9443410..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_lib.vcxproj.filters
+++ /dev/null
@@ -1,518 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="src">
- <UniqueIdentifier>{95543dab-5f63-41a8-8860-7e1659edc0b2}</UniqueIdentifier>
- </Filter>
- <Filter Include="src\glsl">
- <UniqueIdentifier>{c4cf23cb-22b9-4496-9cf7-8b25dc1e405f}</UniqueIdentifier>
- </Filter>
- <Filter Include="src\glsl\glcpp">
- <UniqueIdentifier>{7ec0058a-15c6-427d-9fce-27af39000e81}</UniqueIdentifier>
- </Filter>
- <Filter Include="src\mesa">
- <UniqueIdentifier>{28f43e08-dfe8-424d-886c-db6e2ee33957}</UniqueIdentifier>
- </Filter>
- <Filter Include="src\mesa\program">
- <UniqueIdentifier>{fd238409-ea7e-4bbe-8566-d5b8e7330242}</UniqueIdentifier>
- </Filter>
- <Filter Include="src\mesa\main">
- <UniqueIdentifier>{b58605f3-8f5a-4800-838c-a0a04d1bdc96}</UniqueIdentifier>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="..\..\src\glsl\ast.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\glsl_optimizer.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\glsl_parser.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\glsl_parser_extras.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\glsl_symbol_table.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\glsl_types.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_basic_block.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_expression_flattening.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_function_inlining.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_hierarchical_visitor.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_optimization.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_print_glsl_visitor.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_print_metal_visitor.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_print_visitor.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_rvalue_visitor.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_unused_structs.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_variable_refcount.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_visitor.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\linker.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\list.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\loop_analysis.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\program.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\s_expression.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\standalone_scaffolding.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\strtod.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\glcpp\glcpp-parse.h">
- <Filter>src\glsl\glcpp</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\glcpp\glcpp.h">
- <Filter>src\glsl\glcpp</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\program\prog_instruction.h">
- <Filter>src\mesa\program</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\program\prog_parameter.h">
- <Filter>src\mesa\program</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\program\prog_statevars.h">
- <Filter>src\mesa\program</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\program\symbol_table.h">
- <Filter>src\mesa\program</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\main\compiler.h">
- <Filter>src\mesa\main</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\main\config.h">
- <Filter>src\mesa\main</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\main\context.h">
- <Filter>src\mesa\main</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\main\core.h">
- <Filter>src\mesa\main</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\main\dd.h">
- <Filter>src\mesa\main</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\main\glheader.h">
- <Filter>src\mesa\main</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\main\glminimal.h">
- <Filter>src\mesa\main</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\main\imports.h">
- <Filter>src\mesa\main</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\main\macros.h">
- <Filter>src\mesa\main</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\main\mtypes.h">
- <Filter>src\mesa\main</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\main\simple_list.h">
- <Filter>src\mesa\main</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_uniform.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\mesa\program\hash_table.h">
- <Filter>src\mesa\program</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\link_uniform_block_active_visitor.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\link_varyings.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_builder.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\builtin_type_macros.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\glsl\ir_stats.h">
- <Filter>src\glsl</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\util\hash_table.h">
- <Filter>src\util</Filter>
- </ClInclude>
- <ClInclude Include="..\..\src\util\ralloc.h">
- <Filter>src\util</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\..\src\glsl\ast_expr.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ast_function.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ast_to_hir.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ast_type.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\builtin_functions.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\builtin_variables.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\glsl_lexer.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\glsl_optimizer.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\glsl_parser.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\glsl_parser_extras.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\glsl_symbol_table.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\glsl_types.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\hir_field_selection.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_basic_block.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_clone.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_constant_expression.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_equals.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_expression_flattening.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_function.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_function_can_inline.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_function_detect_recursion.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_hierarchical_visitor.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_hv_accept.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_import_prototypes.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_print_glsl_visitor.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_print_metal_visitor.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_print_visitor.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_rvalue_visitor.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_unused_structs.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_validate.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_variable_refcount.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\link_atomics.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\link_functions.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\link_uniform_initializers.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\link_uniforms.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\linker.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\loop_analysis.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\loop_controls.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\loop_unroll.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_clip_distance.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_discard.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_discard_flow.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_if_to_cond_assign.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_instructions.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_jumps.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_mat_op_to_vec.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_noise.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_variable_index_to_cond_assign.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_vec_index_to_cond_assign.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_vec_index_to_swizzle.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_vector.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\main.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_algebraic.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_array_splitting.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_constant_folding.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_constant_propagation.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_constant_variable.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_copy_propagation.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_copy_propagation_elements.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_cse.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_dead_code.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_dead_code_local.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_dead_functions.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_function_inlining.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_if_simplification.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_noop_swizzle.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_redundant_jumps.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_structure_splitting.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_swizzle_swizzle.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_tree_grafting.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_vectorize.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\s_expression.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\standalone_scaffolding.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\strtod.c">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\glcpp\glcpp-lex.c">
- <Filter>src\glsl\glcpp</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\glcpp\glcpp-parse.c">
- <Filter>src\glsl\glcpp</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\glcpp\glcpp.c">
- <Filter>src\glsl\glcpp</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\glcpp\pp.c">
- <Filter>src\glsl\glcpp</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\mesa\program\symbol_table.c">
- <Filter>src\mesa\program</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\mesa\main\imports.c">
- <Filter>src\mesa\main</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\mesa\program\prog_hash_table.c">
- <Filter>src\mesa\program</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ast_array_index.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\link_uniform_block_active_visitor.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\link_uniform_blocks.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\link_varyings.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_flatten_nested_if_blocks.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_builder.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_packed_varyings.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_packing_builtins.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\link_interface_blocks.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_named_interface_blocks.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_offset_array.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_output_reads.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_ubo_reference.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_vector_insert.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\lower_vertex_id.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\builtin_types.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_dead_builtin_variables.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_minmax.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_rebalance_tree.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_dead_builtin_varyings.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\opt_flip_matrices.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\glsl\ir_stats.cpp">
- <Filter>src\glsl</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\util\hash_table.c">
- <Filter>src\util</Filter>
- </ClCompile>
- <ClCompile Include="..\..\src\util\ralloc.c">
- <Filter>src\util</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <None Include="..\..\README.md" />
- </ItemGroup>
- <ItemGroup>
- <CustomBuildStep Include="..\..\src\glsl\glsl_lexer.lpp">
- <Filter>src\glsl</Filter>
- </CustomBuildStep>
- <CustomBuildStep Include="..\..\src\glsl\glsl_parser.ypp">
- <Filter>src\glsl</Filter>
- </CustomBuildStep>
- <CustomBuildStep Include="..\..\src\glsl\glcpp\glcpp-lex.l">
- <Filter>src\glsl\glcpp</Filter>
- </CustomBuildStep>
- <CustomBuildStep Include="..\..\src\glsl\glcpp\glcpp-parse.y">
- <Filter>src\glsl\glcpp</Filter>
- </CustomBuildStep>
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_tests.vcxproj b/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_tests.vcxproj
deleted file mode 100644
index acb72bc7b47..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/vs2010/glsl_optimizer_tests.vcxproj
+++ /dev/null
@@ -1,186 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectGuid>{BB382242-6EBB-445F-989C-B9BA61D17965}</ProjectGuid>
- <RootNamespace>glsl_optimizer_tests</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>false</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- <WholeProgramOptimization>false</WholeProgramOptimization>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
- <ConfigurationType>Application</ConfigurationType>
- <CharacterSet>Unicode</CharacterSet>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">build/$(ProjectName)/$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">build/$(ProjectName)/$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
- <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</GenerateManifest>
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</EmbedManifest>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
- <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</GenerateManifest>
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</EmbedManifest>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">build/$(ProjectName)/$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">build/$(ProjectName)/$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
- <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</GenerateManifest>
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</EmbedManifest>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">build/$(ProjectName)/$(Platform)/$(Configuration)\</IntDir>
- <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
- <GenerateManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</GenerateManifest>
- <EmbedManifest Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</EmbedManifest>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>false</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
- </ClCompile>
- <Link>
- <AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
- <Midl>
- <TargetEnvironment>X64</TargetEnvironment>
- </Midl>
- <ClCompile>
- <Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <MinimalRebuild>false</MinimalRebuild>
- <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
- <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <TargetMachine>MachineX64</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <TargetMachine>MachineX86</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
- <Midl>
- <TargetEnvironment>X64</TargetEnvironment>
- </Midl>
- <ClCompile>
- <Optimization>MaxSpeed</Optimization>
- <IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
- <FunctionLevelLinking>true</FunctionLevelLinking>
- <PrecompiledHeader>
- </PrecompiledHeader>
- <WarningLevel>Level3</WarningLevel>
- <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
- </ClCompile>
- <Link>
- <AdditionalDependencies>opengl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <GenerateDebugInformation>true</GenerateDebugInformation>
- <SubSystem>Console</SubSystem>
- <OptimizeReferences>true</OptimizeReferences>
- <EnableCOMDATFolding>true</EnableCOMDATFolding>
- <TargetMachine>MachineX64</TargetMachine>
- </Link>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ProjectReference Include="glsl_optimizer_lib.vcxproj">
- <Project>{b475a403-9d9b-410d-8a93-ba49fc4dd811}</Project>
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- </ProjectReference>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="..\..\tests\glsl_optimizer_tests.cpp" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj b/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj
deleted file mode 100644
index 0adb4785f4c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_lib.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,882 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 2B38545F1293BE5000F3E692 /* lower_if_to_cond_assign.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854481293BE5000F3E692 /* lower_if_to_cond_assign.cpp */; };
- 2B3854601293BE5000F3E692 /* lower_jumps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854491293BE5000F3E692 /* lower_jumps.cpp */; };
- 2B3854611293BE5000F3E692 /* lower_mat_op_to_vec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38544A1293BE5000F3E692 /* lower_mat_op_to_vec.cpp */; };
- 2B3854641293BE5000F3E692 /* lower_vec_index_to_cond_assign.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38544D1293BE5000F3E692 /* lower_vec_index_to_cond_assign.cpp */; };
- 2B3854651293BE5000F3E692 /* lower_vec_index_to_swizzle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38544E1293BE5000F3E692 /* lower_vec_index_to_swizzle.cpp */; };
- 2B3854661293BE5000F3E692 /* opt_algebraic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38544F1293BE5000F3E692 /* opt_algebraic.cpp */; };
- 2B3854671293BE5000F3E692 /* opt_constant_folding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854501293BE5000F3E692 /* opt_constant_folding.cpp */; };
- 2B3854681293BE5000F3E692 /* opt_constant_propagation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854511293BE5000F3E692 /* opt_constant_propagation.cpp */; };
- 2B3854691293BE5000F3E692 /* opt_constant_variable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854521293BE5000F3E692 /* opt_constant_variable.cpp */; };
- 2B38546A1293BE5000F3E692 /* opt_copy_propagation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854531293BE5000F3E692 /* opt_copy_propagation.cpp */; };
- 2B38546B1293BE5000F3E692 /* opt_dead_code_local.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854541293BE5000F3E692 /* opt_dead_code_local.cpp */; };
- 2B38546C1293BE5000F3E692 /* opt_dead_code.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854551293BE5000F3E692 /* opt_dead_code.cpp */; };
- 2B38546D1293BE5000F3E692 /* opt_dead_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854561293BE5000F3E692 /* opt_dead_functions.cpp */; };
- 2B38546E1293BE5000F3E692 /* opt_function_inlining.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854571293BE5000F3E692 /* opt_function_inlining.cpp */; };
- 2B38546F1293BE5000F3E692 /* opt_if_simplification.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854581293BE5000F3E692 /* opt_if_simplification.cpp */; };
- 2B3854701293BE5000F3E692 /* opt_noop_swizzle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3854591293BE5000F3E692 /* opt_noop_swizzle.cpp */; };
- 2B3854711293BE5000F3E692 /* opt_structure_splitting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38545A1293BE5000F3E692 /* opt_structure_splitting.cpp */; };
- 2B3854721293BE5000F3E692 /* opt_swizzle_swizzle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38545B1293BE5000F3E692 /* opt_swizzle_swizzle.cpp */; };
- 2B3854731293BE5000F3E692 /* opt_tree_grafting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B38545C1293BE5000F3E692 /* opt_tree_grafting.cpp */; };
- 2B39E41519E959F9001C6A17 /* hash_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41019E959F9001C6A17 /* hash_table.c */; };
- 2B39E41619E959F9001C6A17 /* hash_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B39E41119E959F9001C6A17 /* hash_table.h */; };
- 2B39E41719E959F9001C6A17 /* macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B39E41219E959F9001C6A17 /* macros.h */; };
- 2B39E41819E959F9001C6A17 /* ralloc.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41319E959F9001C6A17 /* ralloc.c */; };
- 2B39E41919E959F9001C6A17 /* ralloc.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B39E41419E959F9001C6A17 /* ralloc.h */; };
- 2B39E41F19E95FA7001C6A17 /* lower_offset_array.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41A19E95FA7001C6A17 /* lower_offset_array.cpp */; };
- 2B39E42019E95FA7001C6A17 /* lower_vertex_id.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41B19E95FA7001C6A17 /* lower_vertex_id.cpp */; };
- 2B39E42119E95FA7001C6A17 /* opt_dead_builtin_variables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41C19E95FA7001C6A17 /* opt_dead_builtin_variables.cpp */; };
- 2B39E42219E95FA7001C6A17 /* opt_minmax.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41D19E95FA7001C6A17 /* opt_minmax.cpp */; };
- 2B39E42319E95FA7001C6A17 /* opt_rebalance_tree.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B39E41E19E95FA7001C6A17 /* opt_rebalance_tree.cpp */; };
- 2B3A6B9015FA043D000DCBE1 /* link_uniforms.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B8E15FA043D000DCBE1 /* link_uniforms.cpp */; };
- 2B3A6B9715FA0468000DCBE1 /* link_uniform_initializers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9515FA0468000DCBE1 /* link_uniform_initializers.cpp */; };
- 2B3A6BA815FA0494000DCBE1 /* lower_clip_distance.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9C15FA0494000DCBE1 /* lower_clip_distance.cpp */; };
- 2B3A6BA915FA0494000DCBE1 /* lower_discard_flow.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9D15FA0494000DCBE1 /* lower_discard_flow.cpp */; };
- 2B3A6BAA15FA0494000DCBE1 /* lower_output_reads.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6B9E15FA0494000DCBE1 /* lower_output_reads.cpp */; };
- 2B3A6BAC15FA0494000DCBE1 /* lower_ubo_reference.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6BA015FA0494000DCBE1 /* lower_ubo_reference.cpp */; };
- 2B3A6BAD15FA0494000DCBE1 /* opt_array_splitting.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6BA115FA0494000DCBE1 /* opt_array_splitting.cpp */; };
- 2B3A6BDA15FA08E1000DCBE1 /* ir_builder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B3A6BD715FA08E1000DCBE1 /* ir_builder.cpp */; };
- 2B3A6BDB15FA08E1000DCBE1 /* ir_builder.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B3A6BD815FA08E1000DCBE1 /* ir_builder.h */; };
- 2B47DA011209C87B00937F2C /* prog_hash_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B47D9FD1209C87B00937F2C /* prog_hash_table.c */; };
- 2B47DA021209C87B00937F2C /* hash_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B47D9FE1209C87B00937F2C /* hash_table.h */; };
- 2B47DA031209C87B00937F2C /* symbol_table.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B47D9FF1209C87B00937F2C /* symbol_table.c */; };
- 2B47DA041209C87B00937F2C /* symbol_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B47DA001209C87B00937F2C /* symbol_table.h */; };
- 2B62491112191339003F6EEE /* ir_rvalue_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B62490D12191339003F6EEE /* ir_rvalue_visitor.cpp */; };
- 2B62491212191339003F6EEE /* ir_rvalue_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B62490E12191339003F6EEE /* ir_rvalue_visitor.h */; };
- 2B655A7313E0322E00B5278F /* ir_function_detect_recursion.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B655A7113E0322E00B5278F /* ir_function_detect_recursion.cpp */; };
- 2B655A7913E0324F00B5278F /* standalone_scaffolding.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B655A7613E0324F00B5278F /* standalone_scaffolding.cpp */; };
- 2B655A7A13E0324F00B5278F /* standalone_scaffolding.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B655A7713E0324F00B5278F /* standalone_scaffolding.h */; };
- 2B6A99F41223B1670059FBED /* glcpp-lex.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B6A99EC1223B1670059FBED /* glcpp-lex.c */; };
- 2B6A99F61223B1670059FBED /* glcpp-parse.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B6A99EE1223B1670059FBED /* glcpp-parse.c */; };
- 2B6A99F71223B1670059FBED /* glcpp-parse.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B6A99EF1223B1670059FBED /* glcpp-parse.h */; };
- 2B6A99FA1223B1670059FBED /* glcpp.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B6A99F21223B1670059FBED /* glcpp.h */; };
- 2B6A99FB1223B1670059FBED /* pp.c in Sources */ = {isa = PBXBuildFile; fileRef = 2B6A99F31223B1670059FBED /* pp.c */; };
- 2B6AC7B9161EC99C0094FD86 /* prog_instruction.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B6AC7B5161EC99C0094FD86 /* prog_instruction.h */; };
- 2B6AC7BA161EC99C0094FD86 /* prog_parameter.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B6AC7B6161EC99C0094FD86 /* prog_parameter.h */; };
- 2B6AC7BB161EC99C0094FD86 /* prog_statevars.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B6AC7B7161EC99C0094FD86 /* prog_statevars.h */; };
- 2B6AC7BD161EC9D40094FD86 /* ir_uniform.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B6AC7BC161EC9D40094FD86 /* ir_uniform.h */; };
- 2B6AC8AD161ED9080094FD86 /* glminimal.h in Headers */ = {isa = PBXBuildFile; fileRef = 2B6AC8AC161ED9080094FD86 /* glminimal.h */; };
- 2B78C91D1858B052007F5D2A /* ir_equals.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B78C91C1858B052007F5D2A /* ir_equals.cpp */; };
- 2B8979DE182C0C4700718F8A /* builtin_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B8979DD182C0C4700718F8A /* builtin_functions.cpp */; };
- 2B8979E0182C195C00718F8A /* opt_cse.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B8979DF182C195C00718F8A /* opt_cse.cpp */; };
- 2B8979E2182CB62900718F8A /* link_atomics.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B8979E1182CB62900718F8A /* link_atomics.cpp */; };
- 2B92A05E15F9FF4700CFED4A /* builtin_variables.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B92A05C15F9FF4700CFED4A /* builtin_variables.cpp */; };
- 2B9F0A3D189664F3002FF617 /* opt_vectorize.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B9F0A3C189664F3002FF617 /* opt_vectorize.cpp */; };
- 2BA55A9C1207FEA6002DC82D /* ast_expr.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A511207FEA6002DC82D /* ast_expr.cpp */; };
- 2BA55A9D1207FEA6002DC82D /* ast_function.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A521207FEA6002DC82D /* ast_function.cpp */; };
- 2BA55A9E1207FEA6002DC82D /* ast_to_hir.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A531207FEA6002DC82D /* ast_to_hir.cpp */; };
- 2BA55A9F1207FEA6002DC82D /* ast_type.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A541207FEA6002DC82D /* ast_type.cpp */; };
- 2BA55AA01207FEA6002DC82D /* ast.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A551207FEA6002DC82D /* ast.h */; };
- 2BA55AA41207FEA6002DC82D /* glsl_lexer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A591207FEA6002DC82D /* glsl_lexer.cpp */; };
- 2BA55AA61207FEA6002DC82D /* glsl_optimizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A5B1207FEA6002DC82D /* glsl_optimizer.cpp */; };
- 2BA55AA71207FEA6002DC82D /* glsl_optimizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A5C1207FEA6002DC82D /* glsl_optimizer.h */; };
- 2BA55AA81207FEA6002DC82D /* glsl_parser_extras.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A5D1207FEA6002DC82D /* glsl_parser_extras.cpp */; };
- 2BA55AA91207FEA6002DC82D /* glsl_parser_extras.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A5E1207FEA6002DC82D /* glsl_parser_extras.h */; };
- 2BA55AAA1207FEA6002DC82D /* glsl_parser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A5F1207FEA6002DC82D /* glsl_parser.cpp */; };
- 2BA55AAB1207FEA6002DC82D /* glsl_parser.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A601207FEA6002DC82D /* glsl_parser.h */; };
- 2BA55AAD1207FEA6002DC82D /* glsl_symbol_table.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A621207FEA6002DC82D /* glsl_symbol_table.h */; };
- 2BA55AAE1207FEA6002DC82D /* glsl_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A631207FEA6002DC82D /* glsl_types.cpp */; };
- 2BA55AAF1207FEA6002DC82D /* glsl_types.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A641207FEA6002DC82D /* glsl_types.h */; };
- 2BA55AB01207FEA6002DC82D /* hir_field_selection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A651207FEA6002DC82D /* hir_field_selection.cpp */; };
- 2BA55AB21207FEA6002DC82D /* ir_basic_block.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A671207FEA6002DC82D /* ir_basic_block.cpp */; };
- 2BA55AB31207FEA6002DC82D /* ir_basic_block.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A681207FEA6002DC82D /* ir_basic_block.h */; };
- 2BA55AB41207FEA6002DC82D /* ir_clone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A691207FEA6002DC82D /* ir_clone.cpp */; };
- 2BA55AB51207FEA6002DC82D /* ir_constant_expression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A6A1207FEA6002DC82D /* ir_constant_expression.cpp */; };
- 2BA55ABC1207FEA6002DC82D /* ir_expression_flattening.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A711207FEA6002DC82D /* ir_expression_flattening.cpp */; };
- 2BA55ABD1207FEA6002DC82D /* ir_expression_flattening.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A721207FEA6002DC82D /* ir_expression_flattening.h */; };
- 2BA55ABE1207FEA6002DC82D /* ir_function_can_inline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A731207FEA6002DC82D /* ir_function_can_inline.cpp */; };
- 2BA55AC01207FEA6002DC82D /* ir_function_inlining.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A751207FEA6002DC82D /* ir_function_inlining.h */; };
- 2BA55AC11207FEA6002DC82D /* ir_function.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A761207FEA6002DC82D /* ir_function.cpp */; };
- 2BA55AC21207FEA6002DC82D /* ir_hierarchical_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A771207FEA6002DC82D /* ir_hierarchical_visitor.cpp */; };
- 2BA55AC31207FEA6002DC82D /* ir_hierarchical_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A781207FEA6002DC82D /* ir_hierarchical_visitor.h */; };
- 2BA55AC41207FEA6002DC82D /* ir_hv_accept.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A791207FEA6002DC82D /* ir_hv_accept.cpp */; };
- 2BA55AC81207FEA6002DC82D /* ir_import_prototypes.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A7D1207FEA6002DC82D /* ir_import_prototypes.cpp */; };
- 2BA55ACB1207FEA6002DC82D /* ir_optimization.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A801207FEA6002DC82D /* ir_optimization.h */; };
- 2BA55ACC1207FEA6002DC82D /* ir_print_glsl_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A811207FEA6002DC82D /* ir_print_glsl_visitor.cpp */; };
- 2BA55ACD1207FEA6002DC82D /* ir_print_glsl_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A821207FEA6002DC82D /* ir_print_glsl_visitor.h */; };
- 2BA55ACE1207FEA6002DC82D /* ir_print_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A831207FEA6002DC82D /* ir_print_visitor.cpp */; };
- 2BA55ACF1207FEA6002DC82D /* ir_print_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A841207FEA6002DC82D /* ir_print_visitor.h */; };
- 2BA55AD51207FEA6002DC82D /* ir_unused_structs.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A8A1207FEA6002DC82D /* ir_unused_structs.cpp */; };
- 2BA55AD61207FEA6002DC82D /* ir_unused_structs.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A8B1207FEA6002DC82D /* ir_unused_structs.h */; };
- 2BA55AD71207FEA6002DC82D /* ir_validate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A8C1207FEA6002DC82D /* ir_validate.cpp */; };
- 2BA55AD81207FEA6002DC82D /* ir_variable_refcount.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A8D1207FEA6002DC82D /* ir_variable_refcount.cpp */; };
- 2BA55AD91207FEA6002DC82D /* ir_variable_refcount.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A8E1207FEA6002DC82D /* ir_variable_refcount.h */; };
- 2BA55ADD1207FEA6002DC82D /* ir_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A921207FEA6002DC82D /* ir_visitor.h */; };
- 2BA55ADE1207FEA6002DC82D /* ir.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A931207FEA6002DC82D /* ir.cpp */; };
- 2BA55ADF1207FEA6002DC82D /* ir.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A941207FEA6002DC82D /* ir.h */; };
- 2BA55AE01207FEA6002DC82D /* link_functions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A951207FEA6002DC82D /* link_functions.cpp */; };
- 2BA55AE11207FEA6002DC82D /* linker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A961207FEA6002DC82D /* linker.cpp */; };
- 2BA55AE21207FEA6002DC82D /* linker.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A971207FEA6002DC82D /* linker.h */; };
- 2BA55AE31207FEA6002DC82D /* list.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A981207FEA6002DC82D /* list.h */; };
- 2BA55AE41207FEA6002DC82D /* program.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A991207FEA6002DC82D /* program.h */; };
- 2BA55AE51207FEA6002DC82D /* s_expression.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA55A9A1207FEA6002DC82D /* s_expression.cpp */; };
- 2BA55AE61207FEA6002DC82D /* s_expression.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA55A9B1207FEA6002DC82D /* s_expression.h */; };
- 2BA7E13F17D0AEB200D5C475 /* builtin_type_macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BA7E13817D0AEB200D5C475 /* builtin_type_macros.h */; };
- 2BA7E14017D0AEB200D5C475 /* builtin_types.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13917D0AEB200D5C475 /* builtin_types.cpp */; };
- 2BA7E14217D0AEB200D5C475 /* link_interface_blocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13A17D0AEB200D5C475 /* link_interface_blocks.cpp */; };
- 2BA7E14417D0AEB200D5C475 /* lower_named_interface_blocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13B17D0AEB200D5C475 /* lower_named_interface_blocks.cpp */; };
- 2BA7E14617D0AEB200D5C475 /* lower_vector_insert.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13C17D0AEB200D5C475 /* lower_vector_insert.cpp */; };
- 2BA7E14817D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13D17D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp */; };
- 2BA7E14A17D0AEB200D5C475 /* opt_flip_matrices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BA7E13E17D0AEB200D5C475 /* opt_flip_matrices.cpp */; };
- 2BB2F5B012B8F1580052C6B0 /* lower_discard.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AA12B8F1580052C6B0 /* lower_discard.cpp */; };
- 2BB2F5B112B8F1580052C6B0 /* lower_instructions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AB12B8F1580052C6B0 /* lower_instructions.cpp */; };
- 2BB2F5B212B8F1580052C6B0 /* lower_vector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */; };
- 2BB2F5B412B8F1580052C6B0 /* strtod.c in Sources */ = {isa = PBXBuildFile; fileRef = 2BB2F5AE12B8F1580052C6B0 /* strtod.c */; };
- 2BB2F5B512B8F1580052C6B0 /* strtod.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BB2F5AF12B8F1580052C6B0 /* strtod.h */; };
- 2BB725A9135094BE0057D8B5 /* compiler.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BB7259B135094BE0057D8B5 /* compiler.h */; };
- 2BB725AA135094BE0057D8B5 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BB7259C135094BE0057D8B5 /* config.h */; };
- 2BB725AB135094BE0057D8B5 /* context.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BB7259D135094BE0057D8B5 /* context.h */; };
- 2BB725AC135094BE0057D8B5 /* core.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BB7259E135094BE0057D8B5 /* core.h */; };
- 2BB725AD135094BE0057D8B5 /* dd.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BB7259F135094BE0057D8B5 /* dd.h */; };
- 2BB725AF135094BE0057D8B5 /* glheader.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BB725A1135094BE0057D8B5 /* glheader.h */; };
- 2BB725B0135094BE0057D8B5 /* imports.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BB725A2135094BE0057D8B5 /* imports.h */; };
- 2BB725B1135094BE0057D8B5 /* macros.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BB725A3135094BE0057D8B5 /* macros.h */; };
- 2BB725B3135094BE0057D8B5 /* mtypes.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BB725A5135094BE0057D8B5 /* mtypes.h */; };
- 2BB725B5135094BE0057D8B5 /* simple_list.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BB725A7135094BE0057D8B5 /* simple_list.h */; };
- 2BBA49281254706A00D42573 /* glsl_symbol_table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA491F1254706A00D42573 /* glsl_symbol_table.cpp */; };
- 2BBA492A1254706A00D42573 /* loop_analysis.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49211254706A00D42573 /* loop_analysis.cpp */; };
- 2BBA492B1254706A00D42573 /* loop_analysis.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BBA49221254706A00D42573 /* loop_analysis.h */; };
- 2BBA492C1254706A00D42573 /* loop_controls.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49231254706A00D42573 /* loop_controls.cpp */; };
- 2BBA492D1254706A00D42573 /* loop_unroll.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49241254706A00D42573 /* loop_unroll.cpp */; };
- 2BBA492E1254706A00D42573 /* lower_noise.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49251254706A00D42573 /* lower_noise.cpp */; };
- 2BBA492F1254706A00D42573 /* lower_variable_index_to_cond_assign.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49261254706A00D42573 /* lower_variable_index_to_cond_assign.cpp */; };
- 2BBA49301254706A00D42573 /* opt_redundant_jumps.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBA49271254706A00D42573 /* opt_redundant_jumps.cpp */; };
- 2BBD9DAD1719694100515007 /* ast_array_index.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DA91719693E00515007 /* ast_array_index.cpp */; };
- 2BBD9DAF1719694100515007 /* link_uniform_block_active_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DAA1719693F00515007 /* link_uniform_block_active_visitor.cpp */; };
- 2BBD9DB11719694100515007 /* link_uniform_block_active_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BBD9DAB1719694000515007 /* link_uniform_block_active_visitor.h */; };
- 2BBD9DB21719694100515007 /* link_uniform_blocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DAC1719694100515007 /* link_uniform_blocks.cpp */; };
- 2BBD9DB91719698C00515007 /* link_varyings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DB41719698800515007 /* link_varyings.cpp */; };
- 2BBD9DBB1719698C00515007 /* link_varyings.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BBD9DB51719698900515007 /* link_varyings.h */; };
- 2BBD9DBC1719698C00515007 /* lower_packed_varyings.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DB61719698900515007 /* lower_packed_varyings.cpp */; };
- 2BBD9DBE1719698C00515007 /* lower_packing_builtins.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DB71719698A00515007 /* lower_packing_builtins.cpp */; };
- 2BBD9DC01719698C00515007 /* opt_flatten_nested_if_blocks.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DB81719698B00515007 /* opt_flatten_nested_if_blocks.cpp */; };
- 2BBD9DC817196A3B00515007 /* imports.c in Sources */ = {isa = PBXBuildFile; fileRef = 2BBD9DC717196A3B00515007 /* imports.c */; };
- 2BCF3A8D19ADE1E50057C395 /* ir_print_metal_visitor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BCF3A8B19ADE1E50057C395 /* ir_print_metal_visitor.cpp */; };
- 2BCF3A8E19ADE1E50057C395 /* ir_print_metal_visitor.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BCF3A8C19ADE1E50057C395 /* ir_print_metal_visitor.h */; };
- 2BDCB95D184E182B0075CE6F /* ir_stats.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BDCB95B184E182B0075CE6F /* ir_stats.cpp */; };
- 2BDCB95E184E182B0075CE6F /* ir_stats.h in Headers */ = {isa = PBXBuildFile; fileRef = 2BDCB95C184E182B0075CE6F /* ir_stats.h */; };
- 2BEC22EA1356E98300B5E301 /* opt_copy_propagation_elements.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2BEC22CB1356E94E00B5E301 /* opt_copy_propagation_elements.cpp */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXFileReference section */
- 2B3854481293BE5000F3E692 /* lower_if_to_cond_assign.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_if_to_cond_assign.cpp; path = ../../src/glsl/lower_if_to_cond_assign.cpp; sourceTree = SOURCE_ROOT; };
- 2B3854491293BE5000F3E692 /* lower_jumps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_jumps.cpp; path = ../../src/glsl/lower_jumps.cpp; sourceTree = SOURCE_ROOT; };
- 2B38544A1293BE5000F3E692 /* lower_mat_op_to_vec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_mat_op_to_vec.cpp; path = ../../src/glsl/lower_mat_op_to_vec.cpp; sourceTree = SOURCE_ROOT; };
- 2B38544D1293BE5000F3E692 /* lower_vec_index_to_cond_assign.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vec_index_to_cond_assign.cpp; path = ../../src/glsl/lower_vec_index_to_cond_assign.cpp; sourceTree = SOURCE_ROOT; };
- 2B38544E1293BE5000F3E692 /* lower_vec_index_to_swizzle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vec_index_to_swizzle.cpp; path = ../../src/glsl/lower_vec_index_to_swizzle.cpp; sourceTree = SOURCE_ROOT; };
- 2B38544F1293BE5000F3E692 /* opt_algebraic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_algebraic.cpp; path = ../../src/glsl/opt_algebraic.cpp; sourceTree = SOURCE_ROOT; };
- 2B3854501293BE5000F3E692 /* opt_constant_folding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_constant_folding.cpp; path = ../../src/glsl/opt_constant_folding.cpp; sourceTree = SOURCE_ROOT; };
- 2B3854511293BE5000F3E692 /* opt_constant_propagation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_constant_propagation.cpp; path = ../../src/glsl/opt_constant_propagation.cpp; sourceTree = SOURCE_ROOT; };
- 2B3854521293BE5000F3E692 /* opt_constant_variable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_constant_variable.cpp; path = ../../src/glsl/opt_constant_variable.cpp; sourceTree = SOURCE_ROOT; };
- 2B3854531293BE5000F3E692 /* opt_copy_propagation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_copy_propagation.cpp; path = ../../src/glsl/opt_copy_propagation.cpp; sourceTree = SOURCE_ROOT; };
- 2B3854541293BE5000F3E692 /* opt_dead_code_local.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_code_local.cpp; path = ../../src/glsl/opt_dead_code_local.cpp; sourceTree = SOURCE_ROOT; };
- 2B3854551293BE5000F3E692 /* opt_dead_code.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_code.cpp; path = ../../src/glsl/opt_dead_code.cpp; sourceTree = SOURCE_ROOT; };
- 2B3854561293BE5000F3E692 /* opt_dead_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_functions.cpp; path = ../../src/glsl/opt_dead_functions.cpp; sourceTree = SOURCE_ROOT; };
- 2B3854571293BE5000F3E692 /* opt_function_inlining.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_function_inlining.cpp; path = ../../src/glsl/opt_function_inlining.cpp; sourceTree = SOURCE_ROOT; };
- 2B3854581293BE5000F3E692 /* opt_if_simplification.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_if_simplification.cpp; path = ../../src/glsl/opt_if_simplification.cpp; sourceTree = SOURCE_ROOT; };
- 2B3854591293BE5000F3E692 /* opt_noop_swizzle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_noop_swizzle.cpp; path = ../../src/glsl/opt_noop_swizzle.cpp; sourceTree = SOURCE_ROOT; };
- 2B38545A1293BE5000F3E692 /* opt_structure_splitting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_structure_splitting.cpp; path = ../../src/glsl/opt_structure_splitting.cpp; sourceTree = SOURCE_ROOT; };
- 2B38545B1293BE5000F3E692 /* opt_swizzle_swizzle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_swizzle_swizzle.cpp; path = ../../src/glsl/opt_swizzle_swizzle.cpp; sourceTree = SOURCE_ROOT; };
- 2B38545C1293BE5000F3E692 /* opt_tree_grafting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_tree_grafting.cpp; path = ../../src/glsl/opt_tree_grafting.cpp; sourceTree = SOURCE_ROOT; };
- 2B39E41019E959F9001C6A17 /* hash_table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = hash_table.c; path = ../../src/util/hash_table.c; sourceTree = "<group>"; };
- 2B39E41119E959F9001C6A17 /* hash_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hash_table.h; path = ../../src/util/hash_table.h; sourceTree = "<group>"; };
- 2B39E41219E959F9001C6A17 /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macros.h; path = ../../src/util/macros.h; sourceTree = "<group>"; };
- 2B39E41319E959F9001C6A17 /* ralloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ralloc.c; path = ../../src/util/ralloc.c; sourceTree = "<group>"; };
- 2B39E41419E959F9001C6A17 /* ralloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ralloc.h; path = ../../src/util/ralloc.h; sourceTree = "<group>"; };
- 2B39E41A19E95FA7001C6A17 /* lower_offset_array.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_offset_array.cpp; path = ../../src/glsl/lower_offset_array.cpp; sourceTree = "<group>"; };
- 2B39E41B19E95FA7001C6A17 /* lower_vertex_id.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vertex_id.cpp; path = ../../src/glsl/lower_vertex_id.cpp; sourceTree = "<group>"; };
- 2B39E41C19E95FA7001C6A17 /* opt_dead_builtin_variables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_builtin_variables.cpp; path = ../../src/glsl/opt_dead_builtin_variables.cpp; sourceTree = "<group>"; };
- 2B39E41D19E95FA7001C6A17 /* opt_minmax.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_minmax.cpp; path = ../../src/glsl/opt_minmax.cpp; sourceTree = "<group>"; };
- 2B39E41E19E95FA7001C6A17 /* opt_rebalance_tree.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_rebalance_tree.cpp; path = ../../src/glsl/opt_rebalance_tree.cpp; sourceTree = "<group>"; };
- 2B3A6B8E15FA043D000DCBE1 /* link_uniforms.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_uniforms.cpp; path = ../../src/glsl/link_uniforms.cpp; sourceTree = SOURCE_ROOT; };
- 2B3A6B9515FA0468000DCBE1 /* link_uniform_initializers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_uniform_initializers.cpp; path = ../../src/glsl/link_uniform_initializers.cpp; sourceTree = SOURCE_ROOT; };
- 2B3A6B9C15FA0494000DCBE1 /* lower_clip_distance.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_clip_distance.cpp; path = ../../src/glsl/lower_clip_distance.cpp; sourceTree = SOURCE_ROOT; };
- 2B3A6B9D15FA0494000DCBE1 /* lower_discard_flow.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_discard_flow.cpp; path = ../../src/glsl/lower_discard_flow.cpp; sourceTree = SOURCE_ROOT; };
- 2B3A6B9E15FA0494000DCBE1 /* lower_output_reads.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_output_reads.cpp; path = ../../src/glsl/lower_output_reads.cpp; sourceTree = SOURCE_ROOT; };
- 2B3A6BA015FA0494000DCBE1 /* lower_ubo_reference.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_ubo_reference.cpp; path = ../../src/glsl/lower_ubo_reference.cpp; sourceTree = SOURCE_ROOT; };
- 2B3A6BA115FA0494000DCBE1 /* opt_array_splitting.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_array_splitting.cpp; path = ../../src/glsl/opt_array_splitting.cpp; sourceTree = SOURCE_ROOT; };
- 2B3A6BD715FA08E1000DCBE1 /* ir_builder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_builder.cpp; path = ../../src/glsl/ir_builder.cpp; sourceTree = SOURCE_ROOT; };
- 2B3A6BD815FA08E1000DCBE1 /* ir_builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_builder.h; path = ../../src/glsl/ir_builder.h; sourceTree = SOURCE_ROOT; };
- 2B47D9FD1209C87B00937F2C /* prog_hash_table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = prog_hash_table.c; path = ../../src/mesa/program/prog_hash_table.c; sourceTree = SOURCE_ROOT; };
- 2B47D9FE1209C87B00937F2C /* hash_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = hash_table.h; path = ../../src/mesa/program/hash_table.h; sourceTree = SOURCE_ROOT; };
- 2B47D9FF1209C87B00937F2C /* symbol_table.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = symbol_table.c; path = ../../src/mesa/program/symbol_table.c; sourceTree = SOURCE_ROOT; };
- 2B47DA001209C87B00937F2C /* symbol_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = symbol_table.h; path = ../../src/mesa/program/symbol_table.h; sourceTree = SOURCE_ROOT; };
- 2B62490D12191339003F6EEE /* ir_rvalue_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_rvalue_visitor.cpp; path = ../../src/glsl/ir_rvalue_visitor.cpp; sourceTree = SOURCE_ROOT; };
- 2B62490E12191339003F6EEE /* ir_rvalue_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_rvalue_visitor.h; path = ../../src/glsl/ir_rvalue_visitor.h; sourceTree = SOURCE_ROOT; };
- 2B655A7113E0322E00B5278F /* ir_function_detect_recursion.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_function_detect_recursion.cpp; path = ../../src/glsl/ir_function_detect_recursion.cpp; sourceTree = SOURCE_ROOT; };
- 2B655A7613E0324F00B5278F /* standalone_scaffolding.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = standalone_scaffolding.cpp; path = ../../src/glsl/standalone_scaffolding.cpp; sourceTree = SOURCE_ROOT; };
- 2B655A7713E0324F00B5278F /* standalone_scaffolding.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = standalone_scaffolding.h; path = ../../src/glsl/standalone_scaffolding.h; sourceTree = SOURCE_ROOT; };
- 2B6A99EC1223B1670059FBED /* glcpp-lex.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "glcpp-lex.c"; path = "../../src/glsl/glcpp/glcpp-lex.c"; sourceTree = SOURCE_ROOT; };
- 2B6A99ED1223B1670059FBED /* glcpp-lex.l */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.lex; name = "glcpp-lex.l"; path = "../../src/glsl/glcpp/glcpp-lex.l"; sourceTree = SOURCE_ROOT; };
- 2B6A99EE1223B1670059FBED /* glcpp-parse.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "glcpp-parse.c"; path = "../../src/glsl/glcpp/glcpp-parse.c"; sourceTree = SOURCE_ROOT; };
- 2B6A99EF1223B1670059FBED /* glcpp-parse.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "glcpp-parse.h"; path = "../../src/glsl/glcpp/glcpp-parse.h"; sourceTree = SOURCE_ROOT; };
- 2B6A99F01223B1670059FBED /* glcpp-parse.y */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.yacc; name = "glcpp-parse.y"; path = "../../src/glsl/glcpp/glcpp-parse.y"; sourceTree = SOURCE_ROOT; };
- 2B6A99F21223B1670059FBED /* glcpp.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glcpp.h; path = ../../src/glsl/glcpp/glcpp.h; sourceTree = SOURCE_ROOT; };
- 2B6A99F31223B1670059FBED /* pp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = pp.c; path = ../../src/glsl/glcpp/pp.c; sourceTree = SOURCE_ROOT; };
- 2B6AC7B5161EC99C0094FD86 /* prog_instruction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = prog_instruction.h; path = ../../src/mesa/program/prog_instruction.h; sourceTree = SOURCE_ROOT; };
- 2B6AC7B6161EC99C0094FD86 /* prog_parameter.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = prog_parameter.h; path = ../../src/mesa/program/prog_parameter.h; sourceTree = SOURCE_ROOT; };
- 2B6AC7B7161EC99C0094FD86 /* prog_statevars.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = prog_statevars.h; path = ../../src/mesa/program/prog_statevars.h; sourceTree = SOURCE_ROOT; };
- 2B6AC7BC161EC9D40094FD86 /* ir_uniform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_uniform.h; path = ../../src/glsl/ir_uniform.h; sourceTree = SOURCE_ROOT; };
- 2B6AC8AC161ED9080094FD86 /* glminimal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glminimal.h; path = ../../src/mesa/main/glminimal.h; sourceTree = SOURCE_ROOT; };
- 2B78C91C1858B052007F5D2A /* ir_equals.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_equals.cpp; path = ../../src/glsl/ir_equals.cpp; sourceTree = "<group>"; };
- 2B8979DD182C0C4700718F8A /* builtin_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = builtin_functions.cpp; path = ../../src/glsl/builtin_functions.cpp; sourceTree = "<group>"; };
- 2B8979DF182C195C00718F8A /* opt_cse.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_cse.cpp; path = ../../src/glsl/opt_cse.cpp; sourceTree = "<group>"; };
- 2B8979E1182CB62900718F8A /* link_atomics.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_atomics.cpp; path = ../../src/glsl/link_atomics.cpp; sourceTree = "<group>"; };
- 2B92A05C15F9FF4700CFED4A /* builtin_variables.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = builtin_variables.cpp; path = ../../src/glsl/builtin_variables.cpp; sourceTree = SOURCE_ROOT; };
- 2B9F0A3C189664F3002FF617 /* opt_vectorize.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_vectorize.cpp; path = ../../src/glsl/opt_vectorize.cpp; sourceTree = "<group>"; };
- 2BA0808A1352EBFB00A1C074 /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = ../../src/glsl/main.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A511207FEA6002DC82D /* ast_expr.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_expr.cpp; path = ../../src/glsl/ast_expr.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A521207FEA6002DC82D /* ast_function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_function.cpp; path = ../../src/glsl/ast_function.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A531207FEA6002DC82D /* ast_to_hir.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_to_hir.cpp; path = ../../src/glsl/ast_to_hir.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A541207FEA6002DC82D /* ast_type.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_type.cpp; path = ../../src/glsl/ast_type.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A551207FEA6002DC82D /* ast.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ast.h; path = ../../src/glsl/ast.h; sourceTree = SOURCE_ROOT; };
- 2BA55A591207FEA6002DC82D /* glsl_lexer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_lexer.cpp; path = ../../src/glsl/glsl_lexer.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A5A1207FEA6002DC82D /* glsl_lexer.ll */ = {isa = PBXFileReference; explicitFileType = sourcecode.lex; fileEncoding = 4; name = glsl_lexer.ll; path = ../../src/glsl/glsl_lexer.ll; sourceTree = SOURCE_ROOT; };
- 2BA55A5B1207FEA6002DC82D /* glsl_optimizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_optimizer.cpp; path = ../../src/glsl/glsl_optimizer.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A5C1207FEA6002DC82D /* glsl_optimizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_optimizer.h; path = ../../src/glsl/glsl_optimizer.h; sourceTree = SOURCE_ROOT; };
- 2BA55A5D1207FEA6002DC82D /* glsl_parser_extras.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_parser_extras.cpp; path = ../../src/glsl/glsl_parser_extras.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A5E1207FEA6002DC82D /* glsl_parser_extras.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_parser_extras.h; path = ../../src/glsl/glsl_parser_extras.h; sourceTree = SOURCE_ROOT; };
- 2BA55A5F1207FEA6002DC82D /* glsl_parser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_parser.cpp; path = ../../src/glsl/glsl_parser.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A601207FEA6002DC82D /* glsl_parser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_parser.h; path = ../../src/glsl/glsl_parser.h; sourceTree = SOURCE_ROOT; };
- 2BA55A611207FEA6002DC82D /* glsl_parser.yy */ = {isa = PBXFileReference; explicitFileType = sourcecode.yacc; fileEncoding = 4; name = glsl_parser.yy; path = ../../src/glsl/glsl_parser.yy; sourceTree = SOURCE_ROOT; };
- 2BA55A621207FEA6002DC82D /* glsl_symbol_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_symbol_table.h; path = ../../src/glsl/glsl_symbol_table.h; sourceTree = SOURCE_ROOT; };
- 2BA55A631207FEA6002DC82D /* glsl_types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_types.cpp; path = ../../src/glsl/glsl_types.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A641207FEA6002DC82D /* glsl_types.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glsl_types.h; path = ../../src/glsl/glsl_types.h; sourceTree = SOURCE_ROOT; };
- 2BA55A651207FEA6002DC82D /* hir_field_selection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = hir_field_selection.cpp; path = ../../src/glsl/hir_field_selection.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A671207FEA6002DC82D /* ir_basic_block.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_basic_block.cpp; path = ../../src/glsl/ir_basic_block.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A681207FEA6002DC82D /* ir_basic_block.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_basic_block.h; path = ../../src/glsl/ir_basic_block.h; sourceTree = SOURCE_ROOT; };
- 2BA55A691207FEA6002DC82D /* ir_clone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_clone.cpp; path = ../../src/glsl/ir_clone.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A6A1207FEA6002DC82D /* ir_constant_expression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_constant_expression.cpp; path = ../../src/glsl/ir_constant_expression.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A711207FEA6002DC82D /* ir_expression_flattening.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_expression_flattening.cpp; path = ../../src/glsl/ir_expression_flattening.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A721207FEA6002DC82D /* ir_expression_flattening.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_expression_flattening.h; path = ../../src/glsl/ir_expression_flattening.h; sourceTree = SOURCE_ROOT; };
- 2BA55A731207FEA6002DC82D /* ir_function_can_inline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_function_can_inline.cpp; path = ../../src/glsl/ir_function_can_inline.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A751207FEA6002DC82D /* ir_function_inlining.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_function_inlining.h; path = ../../src/glsl/ir_function_inlining.h; sourceTree = SOURCE_ROOT; };
- 2BA55A761207FEA6002DC82D /* ir_function.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_function.cpp; path = ../../src/glsl/ir_function.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A771207FEA6002DC82D /* ir_hierarchical_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_hierarchical_visitor.cpp; path = ../../src/glsl/ir_hierarchical_visitor.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A781207FEA6002DC82D /* ir_hierarchical_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_hierarchical_visitor.h; path = ../../src/glsl/ir_hierarchical_visitor.h; sourceTree = SOURCE_ROOT; };
- 2BA55A791207FEA6002DC82D /* ir_hv_accept.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_hv_accept.cpp; path = ../../src/glsl/ir_hv_accept.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A7D1207FEA6002DC82D /* ir_import_prototypes.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_import_prototypes.cpp; path = ../../src/glsl/ir_import_prototypes.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A801207FEA6002DC82D /* ir_optimization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_optimization.h; path = ../../src/glsl/ir_optimization.h; sourceTree = SOURCE_ROOT; };
- 2BA55A811207FEA6002DC82D /* ir_print_glsl_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_print_glsl_visitor.cpp; path = ../../src/glsl/ir_print_glsl_visitor.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A821207FEA6002DC82D /* ir_print_glsl_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_print_glsl_visitor.h; path = ../../src/glsl/ir_print_glsl_visitor.h; sourceTree = SOURCE_ROOT; };
- 2BA55A831207FEA6002DC82D /* ir_print_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_print_visitor.cpp; path = ../../src/glsl/ir_print_visitor.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A841207FEA6002DC82D /* ir_print_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_print_visitor.h; path = ../../src/glsl/ir_print_visitor.h; sourceTree = SOURCE_ROOT; };
- 2BA55A8A1207FEA6002DC82D /* ir_unused_structs.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_unused_structs.cpp; path = ../../src/glsl/ir_unused_structs.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A8B1207FEA6002DC82D /* ir_unused_structs.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_unused_structs.h; path = ../../src/glsl/ir_unused_structs.h; sourceTree = SOURCE_ROOT; };
- 2BA55A8C1207FEA6002DC82D /* ir_validate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_validate.cpp; path = ../../src/glsl/ir_validate.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A8D1207FEA6002DC82D /* ir_variable_refcount.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_variable_refcount.cpp; path = ../../src/glsl/ir_variable_refcount.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A8E1207FEA6002DC82D /* ir_variable_refcount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_variable_refcount.h; path = ../../src/glsl/ir_variable_refcount.h; sourceTree = SOURCE_ROOT; };
- 2BA55A921207FEA6002DC82D /* ir_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_visitor.h; path = ../../src/glsl/ir_visitor.h; sourceTree = SOURCE_ROOT; };
- 2BA55A931207FEA6002DC82D /* ir.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir.cpp; path = ../../src/glsl/ir.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A941207FEA6002DC82D /* ir.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir.h; path = ../../src/glsl/ir.h; sourceTree = SOURCE_ROOT; };
- 2BA55A951207FEA6002DC82D /* link_functions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_functions.cpp; path = ../../src/glsl/link_functions.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A961207FEA6002DC82D /* linker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = linker.cpp; path = ../../src/glsl/linker.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A971207FEA6002DC82D /* linker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = linker.h; path = ../../src/glsl/linker.h; sourceTree = SOURCE_ROOT; };
- 2BA55A981207FEA6002DC82D /* list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = list.h; path = ../../src/glsl/list.h; sourceTree = SOURCE_ROOT; };
- 2BA55A991207FEA6002DC82D /* program.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = program.h; path = ../../src/glsl/program.h; sourceTree = SOURCE_ROOT; };
- 2BA55A9A1207FEA6002DC82D /* s_expression.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = s_expression.cpp; path = ../../src/glsl/s_expression.cpp; sourceTree = SOURCE_ROOT; };
- 2BA55A9B1207FEA6002DC82D /* s_expression.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = s_expression.h; path = ../../src/glsl/s_expression.h; sourceTree = SOURCE_ROOT; };
- 2BA7E13817D0AEB200D5C475 /* builtin_type_macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = builtin_type_macros.h; path = ../../src/glsl/builtin_type_macros.h; sourceTree = "<group>"; };
- 2BA7E13917D0AEB200D5C475 /* builtin_types.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = builtin_types.cpp; path = ../../src/glsl/builtin_types.cpp; sourceTree = "<group>"; };
- 2BA7E13A17D0AEB200D5C475 /* link_interface_blocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_interface_blocks.cpp; path = ../../src/glsl/link_interface_blocks.cpp; sourceTree = "<group>"; };
- 2BA7E13B17D0AEB200D5C475 /* lower_named_interface_blocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_named_interface_blocks.cpp; path = ../../src/glsl/lower_named_interface_blocks.cpp; sourceTree = "<group>"; };
- 2BA7E13C17D0AEB200D5C475 /* lower_vector_insert.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vector_insert.cpp; path = ../../src/glsl/lower_vector_insert.cpp; sourceTree = "<group>"; };
- 2BA7E13D17D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_dead_builtin_varyings.cpp; path = ../../src/glsl/opt_dead_builtin_varyings.cpp; sourceTree = "<group>"; };
- 2BA7E13E17D0AEB200D5C475 /* opt_flip_matrices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_flip_matrices.cpp; path = ../../src/glsl/opt_flip_matrices.cpp; sourceTree = "<group>"; };
- 2BB2F5AA12B8F1580052C6B0 /* lower_discard.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_discard.cpp; path = ../../src/glsl/lower_discard.cpp; sourceTree = SOURCE_ROOT; };
- 2BB2F5AB12B8F1580052C6B0 /* lower_instructions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_instructions.cpp; path = ../../src/glsl/lower_instructions.cpp; sourceTree = SOURCE_ROOT; };
- 2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_vector.cpp; path = ../../src/glsl/lower_vector.cpp; sourceTree = SOURCE_ROOT; };
- 2BB2F5AE12B8F1580052C6B0 /* strtod.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = strtod.c; path = ../../src/glsl/strtod.c; sourceTree = SOURCE_ROOT; };
- 2BB2F5AF12B8F1580052C6B0 /* strtod.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = strtod.h; path = ../../src/glsl/strtod.h; sourceTree = SOURCE_ROOT; };
- 2BB7259B135094BE0057D8B5 /* compiler.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = compiler.h; path = ../../src/mesa/main/compiler.h; sourceTree = SOURCE_ROOT; };
- 2BB7259C135094BE0057D8B5 /* config.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = config.h; path = ../../src/mesa/main/config.h; sourceTree = SOURCE_ROOT; };
- 2BB7259D135094BE0057D8B5 /* context.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = context.h; path = ../../src/mesa/main/context.h; sourceTree = SOURCE_ROOT; };
- 2BB7259E135094BE0057D8B5 /* core.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = core.h; path = ../../src/mesa/main/core.h; sourceTree = SOURCE_ROOT; };
- 2BB7259F135094BE0057D8B5 /* dd.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dd.h; path = ../../src/mesa/main/dd.h; sourceTree = SOURCE_ROOT; };
- 2BB725A1135094BE0057D8B5 /* glheader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = glheader.h; path = ../../src/mesa/main/glheader.h; sourceTree = SOURCE_ROOT; };
- 2BB725A2135094BE0057D8B5 /* imports.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = imports.h; path = ../../src/mesa/main/imports.h; sourceTree = SOURCE_ROOT; };
- 2BB725A3135094BE0057D8B5 /* macros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = macros.h; path = ../../src/mesa/main/macros.h; sourceTree = SOURCE_ROOT; };
- 2BB725A5135094BE0057D8B5 /* mtypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = mtypes.h; path = ../../src/mesa/main/mtypes.h; sourceTree = SOURCE_ROOT; };
- 2BB725A7135094BE0057D8B5 /* simple_list.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = simple_list.h; path = ../../src/mesa/main/simple_list.h; sourceTree = SOURCE_ROOT; };
- 2BBA491F1254706A00D42573 /* glsl_symbol_table.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_symbol_table.cpp; path = ../../src/glsl/glsl_symbol_table.cpp; sourceTree = SOURCE_ROOT; };
- 2BBA49211254706A00D42573 /* loop_analysis.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = loop_analysis.cpp; path = ../../src/glsl/loop_analysis.cpp; sourceTree = SOURCE_ROOT; };
- 2BBA49221254706A00D42573 /* loop_analysis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = loop_analysis.h; path = ../../src/glsl/loop_analysis.h; sourceTree = SOURCE_ROOT; };
- 2BBA49231254706A00D42573 /* loop_controls.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = loop_controls.cpp; path = ../../src/glsl/loop_controls.cpp; sourceTree = SOURCE_ROOT; };
- 2BBA49241254706A00D42573 /* loop_unroll.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = loop_unroll.cpp; path = ../../src/glsl/loop_unroll.cpp; sourceTree = SOURCE_ROOT; };
- 2BBA49251254706A00D42573 /* lower_noise.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_noise.cpp; path = ../../src/glsl/lower_noise.cpp; sourceTree = SOURCE_ROOT; };
- 2BBA49261254706A00D42573 /* lower_variable_index_to_cond_assign.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_variable_index_to_cond_assign.cpp; path = ../../src/glsl/lower_variable_index_to_cond_assign.cpp; sourceTree = SOURCE_ROOT; };
- 2BBA49271254706A00D42573 /* opt_redundant_jumps.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_redundant_jumps.cpp; path = ../../src/glsl/opt_redundant_jumps.cpp; sourceTree = SOURCE_ROOT; };
- 2BBD9DA717193BEA00515007 /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = README.md; path = ../../README.md; sourceTree = "<group>"; };
- 2BBD9DA91719693E00515007 /* ast_array_index.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ast_array_index.cpp; path = ../../src/glsl/ast_array_index.cpp; sourceTree = "<group>"; };
- 2BBD9DAA1719693F00515007 /* link_uniform_block_active_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_uniform_block_active_visitor.cpp; path = ../../src/glsl/link_uniform_block_active_visitor.cpp; sourceTree = "<group>"; };
- 2BBD9DAB1719694000515007 /* link_uniform_block_active_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = link_uniform_block_active_visitor.h; path = ../../src/glsl/link_uniform_block_active_visitor.h; sourceTree = "<group>"; };
- 2BBD9DAC1719694100515007 /* link_uniform_blocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_uniform_blocks.cpp; path = ../../src/glsl/link_uniform_blocks.cpp; sourceTree = "<group>"; };
- 2BBD9DB41719698800515007 /* link_varyings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = link_varyings.cpp; path = ../../src/glsl/link_varyings.cpp; sourceTree = "<group>"; };
- 2BBD9DB51719698900515007 /* link_varyings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = link_varyings.h; path = ../../src/glsl/link_varyings.h; sourceTree = "<group>"; };
- 2BBD9DB61719698900515007 /* lower_packed_varyings.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_packed_varyings.cpp; path = ../../src/glsl/lower_packed_varyings.cpp; sourceTree = "<group>"; };
- 2BBD9DB71719698A00515007 /* lower_packing_builtins.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = lower_packing_builtins.cpp; path = ../../src/glsl/lower_packing_builtins.cpp; sourceTree = "<group>"; };
- 2BBD9DB81719698B00515007 /* opt_flatten_nested_if_blocks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_flatten_nested_if_blocks.cpp; path = ../../src/glsl/opt_flatten_nested_if_blocks.cpp; sourceTree = "<group>"; };
- 2BBD9DC717196A3B00515007 /* imports.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = imports.c; path = ../../src/mesa/main/imports.c; sourceTree = "<group>"; };
- 2BCF3A8B19ADE1E50057C395 /* ir_print_metal_visitor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_print_metal_visitor.cpp; path = ../../src/glsl/ir_print_metal_visitor.cpp; sourceTree = "<group>"; };
- 2BCF3A8C19ADE1E50057C395 /* ir_print_metal_visitor.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_print_metal_visitor.h; path = ../../src/glsl/ir_print_metal_visitor.h; sourceTree = "<group>"; };
- 2BDCB95B184E182B0075CE6F /* ir_stats.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ir_stats.cpp; path = ../../src/glsl/ir_stats.cpp; sourceTree = "<group>"; };
- 2BDCB95C184E182B0075CE6F /* ir_stats.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ir_stats.h; path = ../../src/glsl/ir_stats.h; sourceTree = "<group>"; };
- 2BEC22CB1356E94E00B5E301 /* opt_copy_propagation_elements.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = opt_copy_propagation_elements.cpp; path = ../../src/glsl/opt_copy_propagation_elements.cpp; sourceTree = SOURCE_ROOT; };
- D2AAC046055464E500DB518D /* libglsl_optimizer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libglsl_optimizer.a; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- D289987405E68DCB004EDB86 /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 08FB7794FE84155DC02AAC07 /* mesaglsl2 */ = {
- isa = PBXGroup;
- children = (
- 2BBD9DA717193BEA00515007 /* README.md */,
- 08FB7795FE84155DC02AAC07 /* Source */,
- 1AB674ADFE9D54B511CA2CBB /* Products */,
- );
- name = mesaglsl2;
- sourceTree = "<group>";
- };
- 08FB7795FE84155DC02AAC07 /* Source */ = {
- isa = PBXGroup;
- children = (
- 2B39E40F19E959E0001C6A17 /* util */,
- 2BB7259A135094A60057D8B5 /* mesa */,
- 2B47D9FC1209C85400937F2C /* program */,
- 2BA55A501207FE41002DC82D /* glsl */,
- );
- name = Source;
- sourceTree = "<group>";
- };
- 1AB674ADFE9D54B511CA2CBB /* Products */ = {
- isa = PBXGroup;
- children = (
- D2AAC046055464E500DB518D /* libglsl_optimizer.a */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 2B39E40F19E959E0001C6A17 /* util */ = {
- isa = PBXGroup;
- children = (
- 2B39E41019E959F9001C6A17 /* hash_table.c */,
- 2B39E41119E959F9001C6A17 /* hash_table.h */,
- 2B39E41219E959F9001C6A17 /* macros.h */,
- 2B39E41319E959F9001C6A17 /* ralloc.c */,
- 2B39E41419E959F9001C6A17 /* ralloc.h */,
- );
- name = util;
- sourceTree = "<group>";
- };
- 2B47D9FC1209C85400937F2C /* program */ = {
- isa = PBXGroup;
- children = (
- 2B6AC7B5161EC99C0094FD86 /* prog_instruction.h */,
- 2B6AC7B6161EC99C0094FD86 /* prog_parameter.h */,
- 2B6AC7B7161EC99C0094FD86 /* prog_statevars.h */,
- 2B47D9FD1209C87B00937F2C /* prog_hash_table.c */,
- 2B47D9FE1209C87B00937F2C /* hash_table.h */,
- 2B47D9FF1209C87B00937F2C /* symbol_table.c */,
- 2B47DA001209C87B00937F2C /* symbol_table.h */,
- );
- name = program;
- sourceTree = "<group>";
- };
- 2B6A99EB1223B1460059FBED /* glcpp */ = {
- isa = PBXGroup;
- children = (
- 2B6A99EC1223B1670059FBED /* glcpp-lex.c */,
- 2B6A99ED1223B1670059FBED /* glcpp-lex.l */,
- 2B6A99EE1223B1670059FBED /* glcpp-parse.c */,
- 2B6A99EF1223B1670059FBED /* glcpp-parse.h */,
- 2B6A99F01223B1670059FBED /* glcpp-parse.y */,
- 2B6A99F21223B1670059FBED /* glcpp.h */,
- 2B6A99F31223B1670059FBED /* pp.c */,
- );
- name = glcpp;
- sourceTree = "<group>";
- };
- 2BA55A501207FE41002DC82D /* glsl */ = {
- isa = PBXGroup;
- children = (
- 2BA55A551207FEA6002DC82D /* ast.h */,
- 2BBD9DA91719693E00515007 /* ast_array_index.cpp */,
- 2BA55A511207FEA6002DC82D /* ast_expr.cpp */,
- 2BA55A521207FEA6002DC82D /* ast_function.cpp */,
- 2BA55A531207FEA6002DC82D /* ast_to_hir.cpp */,
- 2BA55A541207FEA6002DC82D /* ast_type.cpp */,
- 2B8979DD182C0C4700718F8A /* builtin_functions.cpp */,
- 2BA7E13817D0AEB200D5C475 /* builtin_type_macros.h */,
- 2BA7E13917D0AEB200D5C475 /* builtin_types.cpp */,
- 2B92A05C15F9FF4700CFED4A /* builtin_variables.cpp */,
- 2B6A99EB1223B1460059FBED /* glcpp */,
- 2BA55A591207FEA6002DC82D /* glsl_lexer.cpp */,
- 2BA55A5A1207FEA6002DC82D /* glsl_lexer.ll */,
- 2BA55A5B1207FEA6002DC82D /* glsl_optimizer.cpp */,
- 2BA55A5C1207FEA6002DC82D /* glsl_optimizer.h */,
- 2BA55A5F1207FEA6002DC82D /* glsl_parser.cpp */,
- 2BA55A601207FEA6002DC82D /* glsl_parser.h */,
- 2BA55A611207FEA6002DC82D /* glsl_parser.yy */,
- 2BA55A5D1207FEA6002DC82D /* glsl_parser_extras.cpp */,
- 2BA55A5E1207FEA6002DC82D /* glsl_parser_extras.h */,
- 2BBA491F1254706A00D42573 /* glsl_symbol_table.cpp */,
- 2BA55A621207FEA6002DC82D /* glsl_symbol_table.h */,
- 2BA55A631207FEA6002DC82D /* glsl_types.cpp */,
- 2BA55A641207FEA6002DC82D /* glsl_types.h */,
- 2BA55A651207FEA6002DC82D /* hir_field_selection.cpp */,
- 2BA55A931207FEA6002DC82D /* ir.cpp */,
- 2BA55A941207FEA6002DC82D /* ir.h */,
- 2BA55A671207FEA6002DC82D /* ir_basic_block.cpp */,
- 2BA55A681207FEA6002DC82D /* ir_basic_block.h */,
- 2B3A6BD715FA08E1000DCBE1 /* ir_builder.cpp */,
- 2B3A6BD815FA08E1000DCBE1 /* ir_builder.h */,
- 2BA55A691207FEA6002DC82D /* ir_clone.cpp */,
- 2BA55A6A1207FEA6002DC82D /* ir_constant_expression.cpp */,
- 2BA55A711207FEA6002DC82D /* ir_expression_flattening.cpp */,
- 2BA55A721207FEA6002DC82D /* ir_expression_flattening.h */,
- 2B78C91C1858B052007F5D2A /* ir_equals.cpp */,
- 2BA55A761207FEA6002DC82D /* ir_function.cpp */,
- 2BA55A731207FEA6002DC82D /* ir_function_can_inline.cpp */,
- 2B655A7113E0322E00B5278F /* ir_function_detect_recursion.cpp */,
- 2BA55A751207FEA6002DC82D /* ir_function_inlining.h */,
- 2BA55A771207FEA6002DC82D /* ir_hierarchical_visitor.cpp */,
- 2BA55A781207FEA6002DC82D /* ir_hierarchical_visitor.h */,
- 2BA55A791207FEA6002DC82D /* ir_hv_accept.cpp */,
- 2BA55A7D1207FEA6002DC82D /* ir_import_prototypes.cpp */,
- 2BA55A801207FEA6002DC82D /* ir_optimization.h */,
- 2BA55A811207FEA6002DC82D /* ir_print_glsl_visitor.cpp */,
- 2BA55A821207FEA6002DC82D /* ir_print_glsl_visitor.h */,
- 2BCF3A8B19ADE1E50057C395 /* ir_print_metal_visitor.cpp */,
- 2BCF3A8C19ADE1E50057C395 /* ir_print_metal_visitor.h */,
- 2BA55A831207FEA6002DC82D /* ir_print_visitor.cpp */,
- 2BA55A841207FEA6002DC82D /* ir_print_visitor.h */,
- 2B62490D12191339003F6EEE /* ir_rvalue_visitor.cpp */,
- 2B62490E12191339003F6EEE /* ir_rvalue_visitor.h */,
- 2BDCB95B184E182B0075CE6F /* ir_stats.cpp */,
- 2BDCB95C184E182B0075CE6F /* ir_stats.h */,
- 2B6AC7BC161EC9D40094FD86 /* ir_uniform.h */,
- 2BA55A8A1207FEA6002DC82D /* ir_unused_structs.cpp */,
- 2BA55A8B1207FEA6002DC82D /* ir_unused_structs.h */,
- 2BA55A8C1207FEA6002DC82D /* ir_validate.cpp */,
- 2BA55A8D1207FEA6002DC82D /* ir_variable_refcount.cpp */,
- 2BA55A8E1207FEA6002DC82D /* ir_variable_refcount.h */,
- 2BA55A921207FEA6002DC82D /* ir_visitor.h */,
- 2B8979E1182CB62900718F8A /* link_atomics.cpp */,
- 2BA55A951207FEA6002DC82D /* link_functions.cpp */,
- 2BA7E13A17D0AEB200D5C475 /* link_interface_blocks.cpp */,
- 2BBD9DAA1719693F00515007 /* link_uniform_block_active_visitor.cpp */,
- 2BBD9DAB1719694000515007 /* link_uniform_block_active_visitor.h */,
- 2BBD9DAC1719694100515007 /* link_uniform_blocks.cpp */,
- 2B3A6B9515FA0468000DCBE1 /* link_uniform_initializers.cpp */,
- 2B3A6B8E15FA043D000DCBE1 /* link_uniforms.cpp */,
- 2BBD9DB41719698800515007 /* link_varyings.cpp */,
- 2BBD9DB51719698900515007 /* link_varyings.h */,
- 2BA55A961207FEA6002DC82D /* linker.cpp */,
- 2BA55A971207FEA6002DC82D /* linker.h */,
- 2BA55A981207FEA6002DC82D /* list.h */,
- 2BBA49211254706A00D42573 /* loop_analysis.cpp */,
- 2BBA49221254706A00D42573 /* loop_analysis.h */,
- 2BBA49231254706A00D42573 /* loop_controls.cpp */,
- 2BBA49241254706A00D42573 /* loop_unroll.cpp */,
- 2B3A6B9C15FA0494000DCBE1 /* lower_clip_distance.cpp */,
- 2BB2F5AA12B8F1580052C6B0 /* lower_discard.cpp */,
- 2B3A6B9D15FA0494000DCBE1 /* lower_discard_flow.cpp */,
- 2B3854481293BE5000F3E692 /* lower_if_to_cond_assign.cpp */,
- 2BB2F5AB12B8F1580052C6B0 /* lower_instructions.cpp */,
- 2B3854491293BE5000F3E692 /* lower_jumps.cpp */,
- 2B38544A1293BE5000F3E692 /* lower_mat_op_to_vec.cpp */,
- 2BA7E13B17D0AEB200D5C475 /* lower_named_interface_blocks.cpp */,
- 2BBA49251254706A00D42573 /* lower_noise.cpp */,
- 2B39E41A19E95FA7001C6A17 /* lower_offset_array.cpp */,
- 2B3A6B9E15FA0494000DCBE1 /* lower_output_reads.cpp */,
- 2BBD9DB61719698900515007 /* lower_packed_varyings.cpp */,
- 2BBD9DB71719698A00515007 /* lower_packing_builtins.cpp */,
- 2B3A6BA015FA0494000DCBE1 /* lower_ubo_reference.cpp */,
- 2BBA49261254706A00D42573 /* lower_variable_index_to_cond_assign.cpp */,
- 2B38544D1293BE5000F3E692 /* lower_vec_index_to_cond_assign.cpp */,
- 2B38544E1293BE5000F3E692 /* lower_vec_index_to_swizzle.cpp */,
- 2BB2F5AC12B8F1580052C6B0 /* lower_vector.cpp */,
- 2BA7E13C17D0AEB200D5C475 /* lower_vector_insert.cpp */,
- 2B39E41B19E95FA7001C6A17 /* lower_vertex_id.cpp */,
- 2BA0808A1352EBFB00A1C074 /* main.cpp */,
- 2B38544F1293BE5000F3E692 /* opt_algebraic.cpp */,
- 2B3A6BA115FA0494000DCBE1 /* opt_array_splitting.cpp */,
- 2B3854501293BE5000F3E692 /* opt_constant_folding.cpp */,
- 2B3854511293BE5000F3E692 /* opt_constant_propagation.cpp */,
- 2B3854521293BE5000F3E692 /* opt_constant_variable.cpp */,
- 2B3854531293BE5000F3E692 /* opt_copy_propagation.cpp */,
- 2BEC22CB1356E94E00B5E301 /* opt_copy_propagation_elements.cpp */,
- 2B8979DF182C195C00718F8A /* opt_cse.cpp */,
- 2B39E41C19E95FA7001C6A17 /* opt_dead_builtin_variables.cpp */,
- 2BA7E13D17D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp */,
- 2B3854551293BE5000F3E692 /* opt_dead_code.cpp */,
- 2B3854541293BE5000F3E692 /* opt_dead_code_local.cpp */,
- 2B3854561293BE5000F3E692 /* opt_dead_functions.cpp */,
- 2BBD9DB81719698B00515007 /* opt_flatten_nested_if_blocks.cpp */,
- 2BA7E13E17D0AEB200D5C475 /* opt_flip_matrices.cpp */,
- 2B3854571293BE5000F3E692 /* opt_function_inlining.cpp */,
- 2B3854581293BE5000F3E692 /* opt_if_simplification.cpp */,
- 2B39E41D19E95FA7001C6A17 /* opt_minmax.cpp */,
- 2B3854591293BE5000F3E692 /* opt_noop_swizzle.cpp */,
- 2B39E41E19E95FA7001C6A17 /* opt_rebalance_tree.cpp */,
- 2BBA49271254706A00D42573 /* opt_redundant_jumps.cpp */,
- 2B38545A1293BE5000F3E692 /* opt_structure_splitting.cpp */,
- 2B38545B1293BE5000F3E692 /* opt_swizzle_swizzle.cpp */,
- 2B38545C1293BE5000F3E692 /* opt_tree_grafting.cpp */,
- 2B9F0A3C189664F3002FF617 /* opt_vectorize.cpp */,
- 2BA55A991207FEA6002DC82D /* program.h */,
- 2BA55A9A1207FEA6002DC82D /* s_expression.cpp */,
- 2BA55A9B1207FEA6002DC82D /* s_expression.h */,
- 2B655A7613E0324F00B5278F /* standalone_scaffolding.cpp */,
- 2B655A7713E0324F00B5278F /* standalone_scaffolding.h */,
- 2BB2F5AE12B8F1580052C6B0 /* strtod.c */,
- 2BB2F5AF12B8F1580052C6B0 /* strtod.h */,
- );
- name = glsl;
- sourceTree = "<group>";
- };
- 2BB7259A135094A60057D8B5 /* mesa */ = {
- isa = PBXGroup;
- children = (
- 2BBD9DC717196A3B00515007 /* imports.c */,
- 2BB7259B135094BE0057D8B5 /* compiler.h */,
- 2BB7259C135094BE0057D8B5 /* config.h */,
- 2BB7259D135094BE0057D8B5 /* context.h */,
- 2BB7259E135094BE0057D8B5 /* core.h */,
- 2BB7259F135094BE0057D8B5 /* dd.h */,
- 2BB725A1135094BE0057D8B5 /* glheader.h */,
- 2B6AC8AC161ED9080094FD86 /* glminimal.h */,
- 2BB725A2135094BE0057D8B5 /* imports.h */,
- 2BB725A3135094BE0057D8B5 /* macros.h */,
- 2BB725A5135094BE0057D8B5 /* mtypes.h */,
- 2BB725A7135094BE0057D8B5 /* simple_list.h */,
- );
- name = mesa;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXHeadersBuildPhase section */
- D2AAC043055464E500DB518D /* Headers */ = {
- isa = PBXHeadersBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 2BA55AA01207FEA6002DC82D /* ast.h in Headers */,
- 2BA55AA71207FEA6002DC82D /* glsl_optimizer.h in Headers */,
- 2BA55AA91207FEA6002DC82D /* glsl_parser_extras.h in Headers */,
- 2B39E41619E959F9001C6A17 /* hash_table.h in Headers */,
- 2BA55AAB1207FEA6002DC82D /* glsl_parser.h in Headers */,
- 2BA55AAD1207FEA6002DC82D /* glsl_symbol_table.h in Headers */,
- 2BA55AAF1207FEA6002DC82D /* glsl_types.h in Headers */,
- 2BA55AB31207FEA6002DC82D /* ir_basic_block.h in Headers */,
- 2BA55ABD1207FEA6002DC82D /* ir_expression_flattening.h in Headers */,
- 2BA55AC01207FEA6002DC82D /* ir_function_inlining.h in Headers */,
- 2BA55AC31207FEA6002DC82D /* ir_hierarchical_visitor.h in Headers */,
- 2BA55ACB1207FEA6002DC82D /* ir_optimization.h in Headers */,
- 2BA55ACD1207FEA6002DC82D /* ir_print_glsl_visitor.h in Headers */,
- 2B39E41919E959F9001C6A17 /* ralloc.h in Headers */,
- 2BA55ACF1207FEA6002DC82D /* ir_print_visitor.h in Headers */,
- 2BA55AD61207FEA6002DC82D /* ir_unused_structs.h in Headers */,
- 2BCF3A8E19ADE1E50057C395 /* ir_print_metal_visitor.h in Headers */,
- 2BA55AD91207FEA6002DC82D /* ir_variable_refcount.h in Headers */,
- 2BA55ADD1207FEA6002DC82D /* ir_visitor.h in Headers */,
- 2BA55ADF1207FEA6002DC82D /* ir.h in Headers */,
- 2BA55AE21207FEA6002DC82D /* linker.h in Headers */,
- 2BA55AE31207FEA6002DC82D /* list.h in Headers */,
- 2BA55AE41207FEA6002DC82D /* program.h in Headers */,
- 2BA55AE61207FEA6002DC82D /* s_expression.h in Headers */,
- 2B39E41719E959F9001C6A17 /* macros.h in Headers */,
- 2B47DA021209C87B00937F2C /* hash_table.h in Headers */,
- 2B47DA041209C87B00937F2C /* symbol_table.h in Headers */,
- 2B62491212191339003F6EEE /* ir_rvalue_visitor.h in Headers */,
- 2B6A99F71223B1670059FBED /* glcpp-parse.h in Headers */,
- 2B6A99FA1223B1670059FBED /* glcpp.h in Headers */,
- 2BBA492B1254706A00D42573 /* loop_analysis.h in Headers */,
- 2BB2F5B512B8F1580052C6B0 /* strtod.h in Headers */,
- 2BB725A9135094BE0057D8B5 /* compiler.h in Headers */,
- 2BB725AA135094BE0057D8B5 /* config.h in Headers */,
- 2BB725AB135094BE0057D8B5 /* context.h in Headers */,
- 2BB725AC135094BE0057D8B5 /* core.h in Headers */,
- 2BB725AD135094BE0057D8B5 /* dd.h in Headers */,
- 2BB725AF135094BE0057D8B5 /* glheader.h in Headers */,
- 2BB725B0135094BE0057D8B5 /* imports.h in Headers */,
- 2BB725B1135094BE0057D8B5 /* macros.h in Headers */,
- 2BB725B3135094BE0057D8B5 /* mtypes.h in Headers */,
- 2BA7E13F17D0AEB200D5C475 /* builtin_type_macros.h in Headers */,
- 2BDCB95E184E182B0075CE6F /* ir_stats.h in Headers */,
- 2BB725B5135094BE0057D8B5 /* simple_list.h in Headers */,
- 2B655A7A13E0324F00B5278F /* standalone_scaffolding.h in Headers */,
- 2B3A6BDB15FA08E1000DCBE1 /* ir_builder.h in Headers */,
- 2B6AC7B9161EC99C0094FD86 /* prog_instruction.h in Headers */,
- 2B6AC7BA161EC99C0094FD86 /* prog_parameter.h in Headers */,
- 2B6AC7BB161EC99C0094FD86 /* prog_statevars.h in Headers */,
- 2B6AC7BD161EC9D40094FD86 /* ir_uniform.h in Headers */,
- 2B6AC8AD161ED9080094FD86 /* glminimal.h in Headers */,
- 2BBD9DB11719694100515007 /* link_uniform_block_active_visitor.h in Headers */,
- 2BBD9DBB1719698C00515007 /* link_varyings.h in Headers */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXHeadersBuildPhase section */
-
-/* Begin PBXNativeTarget section */
- D2AAC045055464E500DB518D /* glsl_optimizer */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "glsl_optimizer" */;
- buildPhases = (
- D2AAC043055464E500DB518D /* Headers */,
- D2AAC044055464E500DB518D /* Sources */,
- D289987405E68DCB004EDB86 /* Frameworks */,
- );
- buildRules = (
- );
- dependencies = (
- );
- name = glsl_optimizer;
- productName = mesaglsl2;
- productReference = D2AAC046055464E500DB518D /* libglsl_optimizer.a */;
- productType = "com.apple.product-type.library.static";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 08FB7793FE84155DC02AAC07 /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0500;
- };
- buildConfigurationList = 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "glsl_optimizer_lib" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 1;
- knownRegions = (
- English,
- Japanese,
- French,
- German,
- );
- mainGroup = 08FB7794FE84155DC02AAC07 /* mesaglsl2 */;
- projectDirPath = "";
- projectRoot = "";
- targets = (
- D2AAC045055464E500DB518D /* glsl_optimizer */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXSourcesBuildPhase section */
- D2AAC044055464E500DB518D /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 2BA55A9C1207FEA6002DC82D /* ast_expr.cpp in Sources */,
- 2BA55A9D1207FEA6002DC82D /* ast_function.cpp in Sources */,
- 2BA55A9E1207FEA6002DC82D /* ast_to_hir.cpp in Sources */,
- 2BA7E14417D0AEB200D5C475 /* lower_named_interface_blocks.cpp in Sources */,
- 2BA55A9F1207FEA6002DC82D /* ast_type.cpp in Sources */,
- 2BA55AA41207FEA6002DC82D /* glsl_lexer.cpp in Sources */,
- 2BDCB95D184E182B0075CE6F /* ir_stats.cpp in Sources */,
- 2BA55AA61207FEA6002DC82D /* glsl_optimizer.cpp in Sources */,
- 2B39E41F19E95FA7001C6A17 /* lower_offset_array.cpp in Sources */,
- 2BA55AA81207FEA6002DC82D /* glsl_parser_extras.cpp in Sources */,
- 2BA55AAA1207FEA6002DC82D /* glsl_parser.cpp in Sources */,
- 2BA55AAE1207FEA6002DC82D /* glsl_types.cpp in Sources */,
- 2BA55AB01207FEA6002DC82D /* hir_field_selection.cpp in Sources */,
- 2BCF3A8D19ADE1E50057C395 /* ir_print_metal_visitor.cpp in Sources */,
- 2BA55AB21207FEA6002DC82D /* ir_basic_block.cpp in Sources */,
- 2BA55AB41207FEA6002DC82D /* ir_clone.cpp in Sources */,
- 2BA55AB51207FEA6002DC82D /* ir_constant_expression.cpp in Sources */,
- 2BA55ABC1207FEA6002DC82D /* ir_expression_flattening.cpp in Sources */,
- 2BA55ABE1207FEA6002DC82D /* ir_function_can_inline.cpp in Sources */,
- 2BA55AC11207FEA6002DC82D /* ir_function.cpp in Sources */,
- 2BA55AC21207FEA6002DC82D /* ir_hierarchical_visitor.cpp in Sources */,
- 2BA55AC41207FEA6002DC82D /* ir_hv_accept.cpp in Sources */,
- 2BA55AC81207FEA6002DC82D /* ir_import_prototypes.cpp in Sources */,
- 2BA55ACC1207FEA6002DC82D /* ir_print_glsl_visitor.cpp in Sources */,
- 2BA55ACE1207FEA6002DC82D /* ir_print_visitor.cpp in Sources */,
- 2BA7E14617D0AEB200D5C475 /* lower_vector_insert.cpp in Sources */,
- 2BA55AD51207FEA6002DC82D /* ir_unused_structs.cpp in Sources */,
- 2BA55AD71207FEA6002DC82D /* ir_validate.cpp in Sources */,
- 2BA7E14817D0AEB200D5C475 /* opt_dead_builtin_varyings.cpp in Sources */,
- 2BA55AD81207FEA6002DC82D /* ir_variable_refcount.cpp in Sources */,
- 2BA55ADE1207FEA6002DC82D /* ir.cpp in Sources */,
- 2BA55AE01207FEA6002DC82D /* link_functions.cpp in Sources */,
- 2BA55AE11207FEA6002DC82D /* linker.cpp in Sources */,
- 2BA55AE51207FEA6002DC82D /* s_expression.cpp in Sources */,
- 2B47DA011209C87B00937F2C /* prog_hash_table.c in Sources */,
- 2B47DA031209C87B00937F2C /* symbol_table.c in Sources */,
- 2B62491112191339003F6EEE /* ir_rvalue_visitor.cpp in Sources */,
- 2B6A99F41223B1670059FBED /* glcpp-lex.c in Sources */,
- 2B78C91D1858B052007F5D2A /* ir_equals.cpp in Sources */,
- 2B6A99F61223B1670059FBED /* glcpp-parse.c in Sources */,
- 2B6A99FB1223B1670059FBED /* pp.c in Sources */,
- 2BBA49281254706A00D42573 /* glsl_symbol_table.cpp in Sources */,
- 2BBA492A1254706A00D42573 /* loop_analysis.cpp in Sources */,
- 2BBA492C1254706A00D42573 /* loop_controls.cpp in Sources */,
- 2BBA492D1254706A00D42573 /* loop_unroll.cpp in Sources */,
- 2B9F0A3D189664F3002FF617 /* opt_vectorize.cpp in Sources */,
- 2BBA492E1254706A00D42573 /* lower_noise.cpp in Sources */,
- 2BBA492F1254706A00D42573 /* lower_variable_index_to_cond_assign.cpp in Sources */,
- 2BBA49301254706A00D42573 /* opt_redundant_jumps.cpp in Sources */,
- 2B38545F1293BE5000F3E692 /* lower_if_to_cond_assign.cpp in Sources */,
- 2B3854601293BE5000F3E692 /* lower_jumps.cpp in Sources */,
- 2B39E42319E95FA7001C6A17 /* opt_rebalance_tree.cpp in Sources */,
- 2B3854611293BE5000F3E692 /* lower_mat_op_to_vec.cpp in Sources */,
- 2B3854641293BE5000F3E692 /* lower_vec_index_to_cond_assign.cpp in Sources */,
- 2B3854651293BE5000F3E692 /* lower_vec_index_to_swizzle.cpp in Sources */,
- 2B3854661293BE5000F3E692 /* opt_algebraic.cpp in Sources */,
- 2B3854671293BE5000F3E692 /* opt_constant_folding.cpp in Sources */,
- 2B3854681293BE5000F3E692 /* opt_constant_propagation.cpp in Sources */,
- 2B3854691293BE5000F3E692 /* opt_constant_variable.cpp in Sources */,
- 2B38546A1293BE5000F3E692 /* opt_copy_propagation.cpp in Sources */,
- 2B39E42019E95FA7001C6A17 /* lower_vertex_id.cpp in Sources */,
- 2B38546B1293BE5000F3E692 /* opt_dead_code_local.cpp in Sources */,
- 2B8979E2182CB62900718F8A /* link_atomics.cpp in Sources */,
- 2B38546C1293BE5000F3E692 /* opt_dead_code.cpp in Sources */,
- 2B38546D1293BE5000F3E692 /* opt_dead_functions.cpp in Sources */,
- 2B38546E1293BE5000F3E692 /* opt_function_inlining.cpp in Sources */,
- 2B38546F1293BE5000F3E692 /* opt_if_simplification.cpp in Sources */,
- 2B3854701293BE5000F3E692 /* opt_noop_swizzle.cpp in Sources */,
- 2B3854711293BE5000F3E692 /* opt_structure_splitting.cpp in Sources */,
- 2B3854721293BE5000F3E692 /* opt_swizzle_swizzle.cpp in Sources */,
- 2B3854731293BE5000F3E692 /* opt_tree_grafting.cpp in Sources */,
- 2B8979DE182C0C4700718F8A /* builtin_functions.cpp in Sources */,
- 2BB2F5B012B8F1580052C6B0 /* lower_discard.cpp in Sources */,
- 2BB2F5B112B8F1580052C6B0 /* lower_instructions.cpp in Sources */,
- 2BB2F5B212B8F1580052C6B0 /* lower_vector.cpp in Sources */,
- 2B39E42219E95FA7001C6A17 /* opt_minmax.cpp in Sources */,
- 2BB2F5B412B8F1580052C6B0 /* strtod.c in Sources */,
- 2BA7E14017D0AEB200D5C475 /* builtin_types.cpp in Sources */,
- 2BEC22EA1356E98300B5E301 /* opt_copy_propagation_elements.cpp in Sources */,
- 2B8979E0182C195C00718F8A /* opt_cse.cpp in Sources */,
- 2B655A7313E0322E00B5278F /* ir_function_detect_recursion.cpp in Sources */,
- 2B39E42119E95FA7001C6A17 /* opt_dead_builtin_variables.cpp in Sources */,
- 2B655A7913E0324F00B5278F /* standalone_scaffolding.cpp in Sources */,
- 2BA7E14A17D0AEB200D5C475 /* opt_flip_matrices.cpp in Sources */,
- 2BA7E14217D0AEB200D5C475 /* link_interface_blocks.cpp in Sources */,
- 2B92A05E15F9FF4700CFED4A /* builtin_variables.cpp in Sources */,
- 2B3A6B9015FA043D000DCBE1 /* link_uniforms.cpp in Sources */,
- 2B3A6B9715FA0468000DCBE1 /* link_uniform_initializers.cpp in Sources */,
- 2B3A6BA815FA0494000DCBE1 /* lower_clip_distance.cpp in Sources */,
- 2B39E41819E959F9001C6A17 /* ralloc.c in Sources */,
- 2B3A6BA915FA0494000DCBE1 /* lower_discard_flow.cpp in Sources */,
- 2B3A6BAA15FA0494000DCBE1 /* lower_output_reads.cpp in Sources */,
- 2B3A6BAC15FA0494000DCBE1 /* lower_ubo_reference.cpp in Sources */,
- 2B3A6BAD15FA0494000DCBE1 /* opt_array_splitting.cpp in Sources */,
- 2B3A6BDA15FA08E1000DCBE1 /* ir_builder.cpp in Sources */,
- 2B39E41519E959F9001C6A17 /* hash_table.c in Sources */,
- 2BBD9DAD1719694100515007 /* ast_array_index.cpp in Sources */,
- 2BBD9DAF1719694100515007 /* link_uniform_block_active_visitor.cpp in Sources */,
- 2BBD9DB21719694100515007 /* link_uniform_blocks.cpp in Sources */,
- 2BBD9DB91719698C00515007 /* link_varyings.cpp in Sources */,
- 2BBD9DBC1719698C00515007 /* lower_packed_varyings.cpp in Sources */,
- 2BBD9DBE1719698C00515007 /* lower_packing_builtins.cpp in Sources */,
- 2BBD9DC01719698C00515007 /* opt_flatten_nested_if_blocks.cpp in Sources */,
- 2BBD9DC817196A3B00515007 /* imports.c in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin XCBuildConfiguration section */
- 1DEB91EC08733DB70010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- COMBINE_HIDPI_IMAGES = YES;
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_MODEL_TUNING = G5;
- GCC_OPTIMIZATION_LEVEL = 0;
- INSTALL_PATH = /usr/local/lib;
- PRODUCT_NAME = glsl_optimizer;
- };
- name = Debug;
- };
- 1DEB91ED08733DB70010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- COMBINE_HIDPI_IMAGES = YES;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_MODEL_TUNING = G5;
- INSTALL_PATH = /usr/local/lib;
- PRODUCT_NAME = glsl_optimizer;
- };
- name = Release;
- };
- 1DEB91F008733DB70010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = (
- ../../include,
- ../../src/mesa,
- ../../src,
- );
- MACOSX_DEPLOYMENT_TARGET = 10.6;
- ONLY_ACTIVE_ARCH = YES;
- };
- name = Debug;
- };
- 1DEB91F108733DB70010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- HEADER_SEARCH_PATHS = (
- ../../include,
- ../../src/mesa,
- ../../src,
- );
- MACOSX_DEPLOYMENT_TARGET = 10.6;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 1DEB91EB08733DB70010E9CD /* Build configuration list for PBXNativeTarget "glsl_optimizer" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB91EC08733DB70010E9CD /* Debug */,
- 1DEB91ED08733DB70010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 1DEB91EF08733DB70010E9CD /* Build configuration list for PBXProject "glsl_optimizer_lib" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB91F008733DB70010E9CD /* Debug */,
- 1DEB91F108733DB70010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_tests.xcodeproj/project.pbxproj b/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_tests.xcodeproj/project.pbxproj
deleted file mode 100644
index 398729a65d9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/projects/xcode5/glsl_optimizer_tests.xcodeproj/project.pbxproj
+++ /dev/null
@@ -1,272 +0,0 @@
-// !$*UTF8*$!
-{
- archiveVersion = 1;
- classes = {
- };
- objectVersion = 46;
- objects = {
-
-/* Begin PBXBuildFile section */
- 2B47D9AB1209C6AC00937F2C /* glsl_optimizer_tests.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2B47D9AA1209C6AC00937F2C /* glsl_optimizer_tests.cpp */; };
- 2B88BF721821AEBD007FEFD9 /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2B88BF711821AEBD007FEFD9 /* OpenGL.framework */; };
- 2BBD9DA217193ABA00515007 /* libglsl_optimizer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 2BE167B6171937F4006A0537 /* libglsl_optimizer.a */; };
-/* End PBXBuildFile section */
-
-/* Begin PBXContainerItemProxy section */
- 2BE167B5171937F4006A0537 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 2B47D9C51209C72F00937F2C /* glsl_optimizer_lib.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = D2AAC046055464E500DB518D;
- remoteInfo = glsl_optimizer;
- };
- 2BE167B7171937F4006A0537 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 2B47D9C51209C72F00937F2C /* glsl_optimizer_lib.xcodeproj */;
- proxyType = 2;
- remoteGlobalIDString = 2BA0803D1352EB9300A1C074;
- remoteInfo = builtin_compiler;
- };
- 2BE167B91719383D006A0537 /* PBXContainerItemProxy */ = {
- isa = PBXContainerItemProxy;
- containerPortal = 2B47D9C51209C72F00937F2C /* glsl_optimizer_lib.xcodeproj */;
- proxyType = 1;
- remoteGlobalIDString = D2AAC045055464E500DB518D;
- remoteInfo = glsl_optimizer;
- };
-/* End PBXContainerItemProxy section */
-
-/* Begin PBXCopyFilesBuildPhase section */
- 8DD76FAF0486AB0100D96B5E /* CopyFiles */ = {
- isa = PBXCopyFilesBuildPhase;
- buildActionMask = 8;
- dstPath = /usr/share/man/man1/;
- dstSubfolderSpec = 0;
- files = (
- );
- runOnlyForDeploymentPostprocessing = 1;
- };
-/* End PBXCopyFilesBuildPhase section */
-
-/* Begin PBXFileReference section */
- 2B47D9AA1209C6AC00937F2C /* glsl_optimizer_tests.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = glsl_optimizer_tests.cpp; path = ../../tests/glsl_optimizer_tests.cpp; sourceTree = "<group>"; };
- 2B47D9C51209C72F00937F2C /* glsl_optimizer_lib.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = glsl_optimizer_lib.xcodeproj; sourceTree = SOURCE_ROOT; };
- 2B88BF711821AEBD007FEFD9 /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
- 8DD76FB20486AB0100D96B5E /* glsl_optimizer_tests */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = glsl_optimizer_tests; sourceTree = BUILT_PRODUCTS_DIR; };
-/* End PBXFileReference section */
-
-/* Begin PBXFrameworksBuildPhase section */
- 8DD76FAD0486AB0100D96B5E /* Frameworks */ = {
- isa = PBXFrameworksBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 2BBD9DA217193ABA00515007 /* libglsl_optimizer.a in Frameworks */,
- 2B88BF721821AEBD007FEFD9 /* OpenGL.framework in Frameworks */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXFrameworksBuildPhase section */
-
-/* Begin PBXGroup section */
- 08FB7794FE84155DC02AAC07 /* glsl_optimizer_tests */ = {
- isa = PBXGroup;
- children = (
- 08FB7795FE84155DC02AAC07 /* Source */,
- 1AB674ADFE9D54B511CA2CBB /* Products */,
- 2B88BF711821AEBD007FEFD9 /* OpenGL.framework */,
- 2B47D9C51209C72F00937F2C /* glsl_optimizer_lib.xcodeproj */,
- );
- name = glsl_optimizer_tests;
- sourceTree = "<group>";
- };
- 08FB7795FE84155DC02AAC07 /* Source */ = {
- isa = PBXGroup;
- children = (
- 2B47D9AA1209C6AC00937F2C /* glsl_optimizer_tests.cpp */,
- );
- name = Source;
- sourceTree = "<group>";
- };
- 1AB674ADFE9D54B511CA2CBB /* Products */ = {
- isa = PBXGroup;
- children = (
- 8DD76FB20486AB0100D96B5E /* glsl_optimizer_tests */,
- );
- name = Products;
- sourceTree = "<group>";
- };
- 2BE167B1171937F4006A0537 /* Products */ = {
- isa = PBXGroup;
- children = (
- 2BE167B6171937F4006A0537 /* libglsl_optimizer.a */,
- 2BE167B8171937F4006A0537 /* builtincompiler */,
- );
- name = Products;
- sourceTree = "<group>";
- };
-/* End PBXGroup section */
-
-/* Begin PBXNativeTarget section */
- 8DD76FA90486AB0100D96B5E /* glsl_optimizer_tests */ = {
- isa = PBXNativeTarget;
- buildConfigurationList = 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "glsl_optimizer_tests" */;
- buildPhases = (
- 8DD76FAB0486AB0100D96B5E /* Sources */,
- 8DD76FAD0486AB0100D96B5E /* Frameworks */,
- 8DD76FAF0486AB0100D96B5E /* CopyFiles */,
- );
- buildRules = (
- );
- dependencies = (
- 2BE167BA1719383D006A0537 /* PBXTargetDependency */,
- );
- name = glsl_optimizer_tests;
- productInstallPath = "$(HOME)/bin";
- productName = glsl_optimizer_tests;
- productReference = 8DD76FB20486AB0100D96B5E /* glsl_optimizer_tests */;
- productType = "com.apple.product-type.tool";
- };
-/* End PBXNativeTarget section */
-
-/* Begin PBXProject section */
- 08FB7793FE84155DC02AAC07 /* Project object */ = {
- isa = PBXProject;
- attributes = {
- LastUpgradeCheck = 0500;
- };
- buildConfigurationList = 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "glsl_optimizer_tests" */;
- compatibilityVersion = "Xcode 3.2";
- developmentRegion = English;
- hasScannedForEncodings = 1;
- knownRegions = (
- English,
- Japanese,
- French,
- German,
- );
- mainGroup = 08FB7794FE84155DC02AAC07 /* glsl_optimizer_tests */;
- projectDirPath = "";
- projectReferences = (
- {
- ProductGroup = 2BE167B1171937F4006A0537 /* Products */;
- ProjectRef = 2B47D9C51209C72F00937F2C /* glsl_optimizer_lib.xcodeproj */;
- },
- );
- projectRoot = "";
- targets = (
- 8DD76FA90486AB0100D96B5E /* glsl_optimizer_tests */,
- );
- };
-/* End PBXProject section */
-
-/* Begin PBXReferenceProxy section */
- 2BE167B6171937F4006A0537 /* libglsl_optimizer.a */ = {
- isa = PBXReferenceProxy;
- fileType = archive.ar;
- path = libglsl_optimizer.a;
- remoteRef = 2BE167B5171937F4006A0537 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
- 2BE167B8171937F4006A0537 /* builtincompiler */ = {
- isa = PBXReferenceProxy;
- fileType = "compiled.mach-o.executable";
- path = builtincompiler;
- remoteRef = 2BE167B7171937F4006A0537 /* PBXContainerItemProxy */;
- sourceTree = BUILT_PRODUCTS_DIR;
- };
-/* End PBXReferenceProxy section */
-
-/* Begin PBXSourcesBuildPhase section */
- 8DD76FAB0486AB0100D96B5E /* Sources */ = {
- isa = PBXSourcesBuildPhase;
- buildActionMask = 2147483647;
- files = (
- 2B47D9AB1209C6AC00937F2C /* glsl_optimizer_tests.cpp in Sources */,
- );
- runOnlyForDeploymentPostprocessing = 0;
- };
-/* End PBXSourcesBuildPhase section */
-
-/* Begin PBXTargetDependency section */
- 2BE167BA1719383D006A0537 /* PBXTargetDependency */ = {
- isa = PBXTargetDependency;
- name = glsl_optimizer;
- targetProxy = 2BE167B91719383D006A0537 /* PBXContainerItemProxy */;
- };
-/* End PBXTargetDependency section */
-
-/* Begin XCBuildConfiguration section */
- 1DEB928608733DD80010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- COPY_PHASE_STRIP = NO;
- GCC_DYNAMIC_NO_PIC = NO;
- GCC_MODEL_TUNING = G5;
- GCC_OPTIMIZATION_LEVEL = 0;
- INSTALL_PATH = /usr/local/bin;
- PRODUCT_NAME = glsl_optimizer_tests;
- };
- name = Debug;
- };
- 1DEB928708733DD80010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- ALWAYS_SEARCH_USER_PATHS = NO;
- DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
- GCC_MODEL_TUNING = G5;
- INSTALL_PATH = /usr/local/bin;
- PRODUCT_NAME = glsl_optimizer_tests;
- };
- name = Release;
- };
- 1DEB928A08733DD80010E9CD /* Debug */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_OPTIMIZATION_LEVEL = 0;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.6;
- ONLY_ACTIVE_ARCH = YES;
- };
- name = Debug;
- };
- 1DEB928B08733DD80010E9CD /* Release */ = {
- isa = XCBuildConfiguration;
- buildSettings = {
- GCC_C_LANGUAGE_STANDARD = gnu99;
- GCC_WARN_ABOUT_RETURN_TYPE = YES;
- GCC_WARN_HIDDEN_VIRTUAL_FUNCTIONS = YES;
- GCC_WARN_SHADOW = YES;
- GCC_WARN_UNINITIALIZED_AUTOS = YES;
- GCC_WARN_UNUSED_VARIABLE = YES;
- MACOSX_DEPLOYMENT_TARGET = 10.6;
- };
- name = Release;
- };
-/* End XCBuildConfiguration section */
-
-/* Begin XCConfigurationList section */
- 1DEB928508733DD80010E9CD /* Build configuration list for PBXNativeTarget "glsl_optimizer_tests" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB928608733DD80010E9CD /* Debug */,
- 1DEB928708733DD80010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
- 1DEB928908733DD80010E9CD /* Build configuration list for PBXProject "glsl_optimizer_tests" */ = {
- isa = XCConfigurationList;
- buildConfigurations = (
- 1DEB928A08733DD80010E9CD /* Debug */,
- 1DEB928B08733DD80010E9CD /* Release */,
- );
- defaultConfigurationIsVisible = 0;
- defaultConfigurationName = Release;
- };
-/* End XCConfigurationList section */
- };
- rootObject = 08FB7793FE84155DC02AAC07 /* Project object */;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/removeDeletedByUs.sh b/3rdparty/bgfx/3rdparty/glsl-optimizer/removeDeletedByUs.sh
deleted file mode 100644
index 5777114e1ae..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/removeDeletedByUs.sh
+++ /dev/null
@@ -1,15 +0,0 @@
-#! /bin/sh
-git rm -rf bin
-git rm -rf docs
-git rm -rf m4
-git rm -rf src/egl
-git rm -rf src/glsl/glcpp/tests
-git rm -rf src/loader
-git rm -rf src/mapi
-git rm -rf src/mesa/drivers
-git rm -rf src/mesa/main/tests
-git rm -rf src/mesa/state_tracker
-git rm -rf src/gallium
-git rm -rf src/glx
-git rm -rf src/gtest
-git rm -rf $(git status --porcelain | awk '/^DU/ {print $NF}')
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/getopt/SConscript b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/getopt/SConscript
deleted file mode 100644
index 14cabed4e64..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/getopt/SConscript
+++ /dev/null
@@ -1,15 +0,0 @@
-Import('*')
-
-if not env['msvc']:
- Return()
-
-env = env.Clone()
-
-env.Prepend(CPPPATH = ['.'])
-
-getopt = env.ConvenienceLibrary(
- target = 'getopt',
- source = ['getopt_long.c'],
-)
-
-Export('getopt')
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/.gitignore b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/.gitignore
deleted file mode 100644
index d15b9ec9104..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-glsl_compiler
-glsl_parser.output
-builtincompiler
-glsl_test
-subtest-cr/
-subtest-lf/
-subtest-cr-lf/
-subtest-lf-cr/
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/.npmignore b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/.npmignore
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/.npmignore
+++ /dev/null
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/README b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/README
deleted file mode 100644
index 0a0afccdce8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/README
+++ /dev/null
@@ -1,228 +0,0 @@
-Welcome to Mesa's GLSL compiler. A brief overview of how things flow:
-
-1) lex and yacc-based preprocessor takes the incoming shader string
-and produces a new string containing the preprocessed shader. This
-takes care of things like #if, #ifdef, #define, and preprocessor macro
-invocations. Note that #version, #extension, and some others are
-passed straight through. See glcpp/*
-
-2) lex and yacc-based parser takes the preprocessed string and
-generates the AST (abstract syntax tree). Almost no checking is
-performed in this stage. See glsl_lexer.lpp and glsl_parser.ypp.
-
-3) The AST is converted to "HIR". This is the intermediate
-representation of the compiler. Constructors are generated, function
-calls are resolved to particular function signatures, and all the
-semantic checking is performed. See ast_*.cpp for the conversion, and
-ir.h for the IR structures.
-
-4) The driver (Mesa, or main.cpp for the standalone binary) performs
-optimizations. These include copy propagation, dead code elimination,
-constant folding, and others. Generally the driver will call
-optimizations in a loop, as each may open up opportunities for other
-optimizations to do additional work. See most files called ir_*.cpp
-
-5) linking is performed. This does checking to ensure that the
-outputs of the vertex shader match the inputs of the fragment shader,
-and assigns locations to uniforms, attributes, and varyings. See
-linker.cpp.
-
-6) The driver may perform additional optimization at this point, as
-for example dead code elimination previously couldn't remove functions
-or global variable usage when we didn't know what other code would be
-linked in.
-
-7) The driver performs code generation out of the IR, taking a linked
-shader program and producing a compiled program for each stage. See
-ir_to_mesa.cpp for Mesa IR code generation.
-
-FAQ:
-
-Q: What is HIR versus IR versus LIR?
-
-A: The idea behind the naming was that ast_to_hir would produce a
-high-level IR ("HIR"), with things like matrix operations, structure
-assignments, etc., present. A series of lowering passes would occur
-that do things like break matrix multiplication into a series of dot
-products/MADs, make structure assignment be a series of assignment of
-components, flatten if statements into conditional moves, and such,
-producing a low level IR ("LIR").
-
-However, it now appears that each driver will have different
-requirements from a LIR. A 915-generation chipset wants all functions
-inlined, all loops unrolled, all ifs flattened, no variable array
-accesses, and matrix multiplication broken down. The Mesa IR backend
-for swrast would like matrices and structure assignment broken down,
-but it can support function calls and dynamic branching. A 965 vertex
-shader IR backend could potentially even handle some matrix operations
-without breaking them down, but the 965 fragment shader IR backend
-would want to break to have (almost) all operations down channel-wise
-and perform optimization on that. As a result, there's no single
-low-level IR that will make everyone happy. So that usage has fallen
-out of favor, and each driver will perform a series of lowering passes
-to take the HIR down to whatever restrictions it wants to impose
-before doing codegen.
-
-Q: How is the IR structured?
-
-A: The best way to get started seeing it would be to run the
-standalone compiler against a shader:
-
-./glsl_compiler --dump-lir \
- ~/src/piglit/tests/shaders/glsl-orangebook-ch06-bump.frag
-
-So for example one of the ir_instructions in main() contains:
-
-(assign (constant bool (1)) (var_ref litColor) (expression vec3 * (var_ref Surf
-aceColor) (var_ref __retval) ) )
-
-Or more visually:
- (assign)
- / | \
- (var_ref) (expression *) (constant bool 1)
- / / \
-(litColor) (var_ref) (var_ref)
- / \
- (SurfaceColor) (__retval)
-
-which came from:
-
-litColor = SurfaceColor * max(dot(normDelta, LightDir), 0.0);
-
-(the max call is not represented in this expression tree, as it was a
-function call that got inlined but not brought into this expression
-tree)
-
-Each of those nodes is a subclass of ir_instruction. A particular
-ir_instruction instance may only appear once in the whole IR tree with
-the exception of ir_variables, which appear once as variable
-declarations:
-
-(declare () vec3 normDelta)
-
-and multiple times as the targets of variable dereferences:
-...
-(assign (constant bool (1)) (var_ref __retval) (expression float dot
- (var_ref normDelta) (var_ref LightDir) ) )
-...
-(assign (constant bool (1)) (var_ref __retval) (expression vec3 -
- (var_ref LightDir) (expression vec3 * (constant float (2.000000))
- (expression vec3 * (expression float dot (var_ref normDelta) (var_ref
- LightDir) ) (var_ref normDelta) ) ) ) )
-...
-
-Each node has a type. Expressions may involve several different types:
-(declare (uniform ) mat4 gl_ModelViewMatrix)
-((assign (constant bool (1)) (var_ref constructor_tmp) (expression
- vec4 * (var_ref gl_ModelViewMatrix) (var_ref gl_Vertex) ) )
-
-An expression tree can be arbitrarily deep, and the compiler tries to
-keep them structured like that so that things like algebraic
-optimizations ((color * 1.0 == color) and ((mat1 * mat2) * vec == mat1
-* (mat2 * vec))) or recognizing operation patterns for code generation
-(vec1 * vec2 + vec3 == mad(vec1, vec2, vec3)) are easier. This comes
-at the expense of additional trickery in implementing some
-optimizations like CSE where one must navigate an expression tree.
-
-Q: Why no SSA representation?
-
-A: Converting an IR tree to SSA form makes dead code elmimination,
-common subexpression elimination, and many other optimizations much
-easier. However, in our primarily vector-based language, there's some
-major questions as to how it would work. Do we do SSA on the scalar
-or vector level? If we do it at the vector level, we're going to end
-up with many different versions of the variable when encountering code
-like:
-
-(assign (constant bool (1)) (swiz x (var_ref __retval) ) (var_ref a) )
-(assign (constant bool (1)) (swiz y (var_ref __retval) ) (var_ref b) )
-(assign (constant bool (1)) (swiz z (var_ref __retval) ) (var_ref c) )
-
-If every masked update of a component relies on the previous value of
-the variable, then we're probably going to be quite limited in our
-dead code elimination wins, and recognizing common expressions may
-just not happen. On the other hand, if we operate channel-wise, then
-we'll be prone to optimizing the operation on one of the channels at
-the expense of making its instruction flow different from the other
-channels, and a vector-based GPU would end up with worse code than if
-we didn't optimize operations on that channel!
-
-Once again, it appears that our optimization requirements are driven
-significantly by the target architecture. For now, targeting the Mesa
-IR backend, SSA does not appear to be that important to producing
-excellent code, but we do expect to do some SSA-based optimizations
-for the 965 fragment shader backend when that is developed.
-
-Q: How should I expand instructions that take multiple backend instructions?
-
-Sometimes you'll have to do the expansion in your code generation --
-see, for example, ir_to_mesa.cpp's handling of ir_unop_sqrt. However,
-in many cases you'll want to do a pass over the IR to convert
-non-native instructions to a series of native instructions. For
-example, for the Mesa backend we have ir_div_to_mul_rcp.cpp because
-Mesa IR (and many hardware backends) only have a reciprocal
-instruction, not a divide. Implementing non-native instructions this
-way gives the chance for constant folding to occur, so (a / 2.0)
-becomes (a * 0.5) after codegen instead of (a * (1.0 / 2.0))
-
-Q: How shoud I handle my special hardware instructions with respect to IR?
-
-Our current theory is that if multiple targets have an instruction for
-some operation, then we should probably be able to represent that in
-the IR. Generally this is in the form of an ir_{bin,un}op expression
-type. For example, we initially implemented fract() using (a -
-floor(a)), but both 945 and 965 have instructions to give that result,
-and it would also simplify the implementation of mod(), so
-ir_unop_fract was added. The following areas need updating to add a
-new expression type:
-
-ir.h (new enum)
-ir.cpp:operator_strs (used for ir_reader)
-ir_constant_expression.cpp (you probably want to be able to constant fold)
-ir_validate.cpp (check users have the right types)
-
-You may also need to update the backends if they will see the new expr type:
-
-../mesa/shaders/ir_to_mesa.cpp
-
-You can then use the new expression from builtins (if all backends
-would rather see it), or scan the IR and convert to use your new
-expression type (see ir_mod_to_fract, for example).
-
-Q: How is memory management handled in the compiler?
-
-The hierarchical memory allocator "talloc" developed for the Samba
-project is used, so that things like optimization passes don't have to
-worry about their garbage collection so much. It has a few nice
-features, including low performance overhead and good debugging
-support that's trivially available.
-
-Generally, each stage of the compile creates a talloc context and
-allocates its memory out of that or children of it. At the end of the
-stage, the pieces still live are stolen to a new context and the old
-one freed, or the whole context is kept for use by the next stage.
-
-For IR transformations, a temporary context is used, then at the end
-of all transformations, reparent_ir reparents all live nodes under the
-shader's IR list, and the old context full of dead nodes is freed.
-When developing a single IR transformation pass, this means that you
-want to allocate instruction nodes out of the temporary context, so if
-it becomes dead it doesn't live on as the child of a live node. At
-the moment, optimization passes aren't passed that temporary context,
-so they find it by calling talloc_parent() on a nearby IR node. The
-talloc_parent() call is expensive, so many passes will cache the
-result of the first talloc_parent(). Cleaning up all the optimization
-passes to take a context argument and not call talloc_parent() is left
-as an exercise.
-
-Q: What is the file naming convention in this directory?
-
-Initially, there really wasn't one. We have since adopted one:
-
- - Files that implement code lowering passes should be named lower_*
- (e.g., lower_noise.cpp).
- - Files that implement optimization passes should be named opt_*.
- - Files that implement a class that is used throught the code should
- take the name of that class (e.g., ir_hierarchical_visitor.cpp).
- - Files that contain code not fitting in one of the previous
- categories should have a sensible name (e.g., glsl_parser.ypp).
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/SConscript b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/SConscript
deleted file mode 100644
index 847e9624685..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/SConscript
+++ /dev/null
@@ -1,112 +0,0 @@
-import common
-
-Import('*')
-
-from sys import executable as python_cmd
-
-env = env.Clone()
-
-env.Prepend(CPPPATH = [
- '#include',
- '#src',
- '#src/mapi',
- '#src/mesa',
- '#src/glsl',
- '#src/glsl/glcpp',
-])
-
-env.Prepend(LIBS = [mesautil])
-
-# Make glcpp-parse.h and glsl_parser.h reachable from the include path.
-env.Append(CPPPATH = [Dir('.').abspath, Dir('glcpp').abspath])
-
-env.Append(YACCFLAGS = '-d -p "glcpp_parser_"')
-
-parser_env = env.Clone()
-parser_env.Append(YACCFLAGS = [
- '--defines=%s' % File('glsl_parser.h').abspath,
- '-p', '_mesa_glsl_',
-])
-
-# without this line scons will expect "glsl_parser.hpp" instead of
-# "glsl_parser.h", causing glsl_parser.cpp to be regenerated every time
-parser_env['YACCHXXFILESUFFIX'] = '.h'
-
-glcpp_lexer = env.CFile('glcpp/glcpp-lex.c', 'glcpp/glcpp-lex.l')
-glcpp_parser = env.CFile('glcpp/glcpp-parse.c', 'glcpp/glcpp-parse.y')
-glsl_lexer = parser_env.CXXFile('glsl_lexer.cpp', 'glsl_lexer.ll')
-glsl_parser = parser_env.CXXFile('glsl_parser.cpp', 'glsl_parser.yy')
-
-# common generated sources
-glsl_sources = [
- glcpp_lexer,
- glcpp_parser[0],
- glsl_lexer,
- glsl_parser[0],
-]
-
-# parse Makefile.sources
-source_lists = env.ParseSourceList('Makefile.sources')
-
-# add non-generated sources
-for l in ('LIBGLCPP_FILES', 'LIBGLSL_FILES'):
- glsl_sources += source_lists[l]
-
-if env['msvc']:
- env.Prepend(CPPPATH = ['#/src/getopt'])
- env.PrependUnique(LIBS = [getopt])
-
-# Copy these files to avoid generation object files into src/mesa/program
-env.Prepend(CPPPATH = ['#src/mesa/main'])
-env.Command('imports.c', '#src/mesa/main/imports.c', Copy('$TARGET', '$SOURCE'))
-# Copy these files to avoid generation object files into src/mesa/program
-env.Prepend(CPPPATH = ['#src/mesa/program'])
-env.Command('prog_hash_table.c', '#src/mesa/program/prog_hash_table.c', Copy('$TARGET', '$SOURCE'))
-env.Command('symbol_table.c', '#src/mesa/program/symbol_table.c', Copy('$TARGET', '$SOURCE'))
-
-compiler_objs = env.StaticObject(source_lists['GLSL_COMPILER_CXX_FILES'])
-
-mesa_objs = env.StaticObject([
- 'imports.c',
- 'prog_hash_table.c',
- 'symbol_table.c',
-])
-
-compiler_objs += mesa_objs
-
-glsl = env.ConvenienceLibrary(
- target = 'glsl',
- source = glsl_sources,
-)
-
-# SCons builtin dependency scanner doesn't detect that glsl_lexer.ll depends on
-# glsl_parser.h
-env.Depends(glsl, glsl_parser)
-
-Export('glsl')
-
-# Skip building these programs as they will cause SCons error "Two environments
-# with different actions were specified for the same target"
-if env['crosscompile'] or env['embedded']:
- Return()
-
-env = env.Clone()
-
-if env['platform'] == 'windows':
- env.PrependUnique(LIBS = [
- 'user32',
- ])
-
-env.Prepend(LIBS = [glsl])
-
-glsl_compiler = env.Program(
- target = 'glsl_compiler',
- source = compiler_objs,
-)
-env.Alias('glsl_compiler', glsl_compiler)
-
-glcpp = env.Program(
- target = 'glcpp/glcpp',
- source = ['glcpp/glcpp.c', 'tests/common.c'] + mesa_objs,
-)
-env.Alias('glcpp', glcpp)
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/TODO b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/TODO
deleted file mode 100644
index bd077a85678..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/TODO
+++ /dev/null
@@ -1,12 +0,0 @@
-- Detect code paths in non-void functions that don't reach a return statement
-
-- Improve handling of constants and their initializers. Constant initializers
- should never generate any code. This is trival for scalar constants. It is
- also trivial for arrays, matrices, and vectors that are accessed with
- constant index values. For others it is more complicated. Perhaps these
- cases should be silently converted to uniforms?
-
-- Track source locations throughout the IR. There are currently several
- places where we cannot emit line numbers for errors (and currently emit 0:0)
- because we've "lost" the line number information. This is particularly
- noticeable at link time.
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore
deleted file mode 100644
index 722300c5026..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.gitignore
+++ /dev/null
@@ -1,10 +0,0 @@
-glcpp
-glcpp-parse.output
-
-*.o
-*.lo
-*.la
-.libs
-*~
-
-tests/*.out
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.npmignore b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.npmignore
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/.npmignore
+++ /dev/null
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/README b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/README
deleted file mode 100644
index 0637935e28b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/README
+++ /dev/null
@@ -1,30 +0,0 @@
-glcpp -- GLSL "C" preprocessor
-
-This is a simple preprocessor designed to provide the preprocessing
-needs of the GLSL language. The requirements for this preprocessor are
-specified in the GLSL 1.30 specification availble from:
-
-http://www.opengl.org/registry/doc/GLSLangSpec.Full.1.30.10.pdf
-
-This specification is not precise on some semantics, (for example,
-#define and #if), defining these merely "as is standard for C++
-preprocessors". To fill in these details, I've been using a draft of
-the C99 standard as available from:
-
-http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
-
-Any downstream compiler accepting output from glcpp should be prepared
-to encounter and deal with the following preprocessor macros:
-
- #line
- #pragma
- #extension
-
-All other macros will be handled according to the GLSL specification
-and will not appear in the output.
-
-Known limitations
------------------
-A file that ends with a function-like macro name as the last
-non-whitespace token will result in a parse error, (where it should be
-passed through as is). \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c
index 70eca4be9c5..a2de3dd35c5 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c
@@ -1,5 +1,6 @@
+#line 2 "src/glsl/glcpp/glcpp-lex.c"
-#line 3 "<stdout>"
+#line 4 "src/glsl/glcpp/glcpp-lex.c"
#define YY_INT_ALIGNED short int
@@ -8,11 +9,245 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 0
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
+#ifdef yy_create_buffer
+#define glcpp__create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer glcpp__create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define glcpp__delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer glcpp__delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define glcpp__scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer glcpp__scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define glcpp__scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string glcpp__scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define glcpp__scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes glcpp__scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define glcpp__init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer glcpp__init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define glcpp__flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer glcpp__flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define glcpp__load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state glcpp__load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define glcpp__switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer glcpp__switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define glcpp_push_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state glcpp_push_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define glcpp_pop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state glcpp_pop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define glcpp_ensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack glcpp_ensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define glcpp_lex_ALREADY_DEFINED
+#else
+#define yylex glcpp_lex
+#endif
+
+#ifdef yyrestart
+#define glcpp_restart_ALREADY_DEFINED
+#else
+#define yyrestart glcpp_restart
+#endif
+
+#ifdef yylex_init
+#define glcpp_lex_init_ALREADY_DEFINED
+#else
+#define yylex_init glcpp_lex_init
+#endif
+
+#ifdef yylex_init_extra
+#define glcpp_lex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra glcpp_lex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define glcpp_lex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy glcpp_lex_destroy
+#endif
+
+#ifdef yyget_debug
+#define glcpp_get_debug_ALREADY_DEFINED
+#else
+#define yyget_debug glcpp_get_debug
+#endif
+
+#ifdef yyset_debug
+#define glcpp_set_debug_ALREADY_DEFINED
+#else
+#define yyset_debug glcpp_set_debug
+#endif
+
+#ifdef yyget_extra
+#define glcpp_get_extra_ALREADY_DEFINED
+#else
+#define yyget_extra glcpp_get_extra
+#endif
+
+#ifdef yyset_extra
+#define glcpp_set_extra_ALREADY_DEFINED
+#else
+#define yyset_extra glcpp_set_extra
+#endif
+
+#ifdef yyget_in
+#define glcpp_get_in_ALREADY_DEFINED
+#else
+#define yyget_in glcpp_get_in
+#endif
+
+#ifdef yyset_in
+#define glcpp_set_in_ALREADY_DEFINED
+#else
+#define yyset_in glcpp_set_in
+#endif
+
+#ifdef yyget_out
+#define glcpp_get_out_ALREADY_DEFINED
+#else
+#define yyget_out glcpp_get_out
+#endif
+
+#ifdef yyset_out
+#define glcpp_set_out_ALREADY_DEFINED
+#else
+#define yyset_out glcpp_set_out
+#endif
+
+#ifdef yyget_leng
+#define glcpp_get_leng_ALREADY_DEFINED
+#else
+#define yyget_leng glcpp_get_leng
+#endif
+
+#ifdef yyget_text
+#define glcpp_get_text_ALREADY_DEFINED
+#else
+#define yyget_text glcpp_get_text
+#endif
+
+#ifdef yyget_lineno
+#define glcpp_get_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno glcpp_get_lineno
+#endif
+
+#ifdef yyset_lineno
+#define glcpp_set_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno glcpp_set_lineno
+#endif
+
+#ifdef yyget_column
+#define glcpp_get_column_ALREADY_DEFINED
+#else
+#define yyget_column glcpp_get_column
+#endif
+
+#ifdef yyset_column
+#define glcpp_set_column_ALREADY_DEFINED
+#else
+#define yyset_column glcpp_set_column
+#endif
+
+#ifdef yywrap
+#define glcpp_wrap_ALREADY_DEFINED
+#else
+#define yywrap glcpp_wrap
+#endif
+
+#ifdef yyget_lval
+#define glcpp_get_lval_ALREADY_DEFINED
+#else
+#define yyget_lval glcpp_get_lval
+#endif
+
+#ifdef yyset_lval
+#define glcpp_set_lval_ALREADY_DEFINED
+#else
+#define yyset_lval glcpp_set_lval
+#endif
+
+#ifdef yyget_lloc
+#define glcpp_get_lloc_ALREADY_DEFINED
+#else
+#define yyget_lloc glcpp_get_lloc
+#endif
+
+#ifdef yyset_lloc
+#define glcpp_set_lloc_ALREADY_DEFINED
+#else
+#define yyset_lloc glcpp_set_lloc
+#endif
+
+#ifdef yyalloc
+#define glcpp_alloc_ALREADY_DEFINED
+#else
+#define yyalloc glcpp_alloc
+#endif
+
+#ifdef yyrealloc
+#define glcpp_realloc_ALREADY_DEFINED
+#else
+#define yyrealloc glcpp_realloc
+#endif
+
+#ifdef yyfree
+#define glcpp_free_ALREADY_DEFINED
+#else
+#define yyfree glcpp_free
+#endif
+
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -83,40 +318,32 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
-
-#else /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
+/* begin standard C++ headers. */
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
+/* TODO: this is always defined, so inline it */
#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
#else
-#define yyconst
+#define yynoreturn
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
+/* Promotes a possibly negative, possibly signed char to an
+ * integer in range [0..255] for use as an array index.
*/
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -140,20 +367,16 @@ typedef void* yyscan_t;
* definition of BEGIN.
*/
#define BEGIN yyg->yy_start = 1 + 2 *
-
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yyg->yy_start - 1) / 2)
#define YYSTATE YY_START
-
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE glcpp_restart(yyin ,yyscanner )
-
+#define YY_NEW_FILE yyrestart( yyin , yyscanner )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
@@ -186,7 +409,7 @@ typedef size_t yy_size_t;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
-
+
#define YY_LESS_LINENO(n)
#define YY_LINENO_REWIND_TO(ptr)
@@ -203,7 +426,6 @@ typedef size_t yy_size_t;
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
-
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
#ifndef YY_STRUCT_YY_BUFFER_STATE
@@ -218,7 +440,7 @@ struct yy_buffer_state
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
- yy_size_t yy_buf_size;
+ int yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
@@ -246,7 +468,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -263,7 +485,7 @@ struct yy_buffer_state
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via glcpp_restart()), so that the user can continue scanning by
+ * (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
@@ -280,87 +502,77 @@ struct yy_buffer_state
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
: NULL)
-
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-void glcpp_restart (FILE *input_file ,yyscan_t yyscanner );
-void glcpp__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE glcpp__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void glcpp__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void glcpp__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void glcpp_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void glcpp_pop_buffer_state (yyscan_t yyscanner );
-
-static void glcpp_ensure_buffer_stack (yyscan_t yyscanner );
-static void glcpp__load_buffer_state (yyscan_t yyscanner );
-static void glcpp__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
-
-#define YY_FLUSH_BUFFER glcpp__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
-YY_BUFFER_STATE glcpp__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE glcpp__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE glcpp__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
+static void yyensure_buffer_stack ( yyscan_t yyscanner );
+static void yy_load_buffer_state ( yyscan_t yyscanner );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
-void *glcpp_alloc (yy_size_t ,yyscan_t yyscanner );
-void *glcpp_realloc (void *,yy_size_t ,yyscan_t yyscanner );
-void glcpp_free (void * ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
-#define yy_new_buffer glcpp__create_buffer
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
+#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
- glcpp_ensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- glcpp__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
-
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
- glcpp_ensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- glcpp__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
-
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
#define glcpp_wrap(yyscanner) (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
+typedef flex_uint8_t YY_CHAR;
typedef int yy_state_type;
#define yytext_ptr yytext_r
-static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
-static int yy_get_next_buffer (yyscan_t yyscanner );
-#if defined(__GNUC__) && __GNUC__ >= 3
-__attribute__((__noreturn__))
-#endif
-static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
+static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
+static int yy_get_next_buffer ( yyscan_t yyscanner );
+static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
yyg->yytext_ptr = yy_bp; \
- yyleng = (size_t) (yy_cp - yy_bp); \
+ yyleng = (int) (yy_cp - yy_bp); \
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-
#define YY_NUM_RULES 52
#define YY_END_OF_BUFFER 53
/* This struct is not used in this scanner,
@@ -370,7 +582,7 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[174] =
+static const flex_int16_t yy_accept[174] =
{ 0,
0, 0, 3, 3, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 53, 48, 49, 50, 51, 50,
@@ -393,7 +605,7 @@ static yyconst flex_int16_t yy_accept[174] =
9, 11, 0
} ;
-static yyconst YY_CHAR yy_ec[256] =
+static const YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
4, 4, 5, 1, 1, 1, 1, 1, 1, 1,
@@ -425,7 +637,7 @@ static yyconst YY_CHAR yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst YY_CHAR yy_meta[46] =
+static const YY_CHAR yy_meta[46] =
{ 0,
1, 2, 3, 2, 3, 1, 1, 1, 1, 4,
5, 1, 1, 6, 1, 7, 7, 7, 1, 1,
@@ -434,7 +646,7 @@ static yyconst YY_CHAR yy_meta[46] =
7, 7, 7, 7, 1
} ;
-static yyconst flex_uint16_t yy_base[191] =
+static const flex_int16_t yy_base[191] =
{ 0,
0, 0, 43, 44, 55, 0, 47, 48, 99, 141,
102, 103, 106, 107, 435, 433, 436, 428, 436, 429,
@@ -458,7 +670,7 @@ static yyconst flex_uint16_t yy_base[191] =
309, 317, 322, 330, 338, 346, 354, 362, 368, 376
} ;
-static yyconst flex_int16_t yy_def[191] =
+static const flex_int16_t yy_def[191] =
{ 0,
173, 1, 174, 174, 173, 5, 175, 175, 176, 176,
175, 175, 175, 175, 173, 173, 173, 173, 173, 173,
@@ -482,7 +694,7 @@ static yyconst flex_int16_t yy_def[191] =
173, 173, 173, 173, 173, 173, 173, 173, 173, 173
} ;
-static yyconst flex_uint16_t yy_nxt[482] =
+static const flex_int16_t yy_nxt[482] =
{ 0,
16, 17, 18, 19, 20, 21, 22, 23, 24, 23,
23, 25, 26, 27, 28, 29, 30, 30, 31, 32,
@@ -539,7 +751,7 @@ static yyconst flex_uint16_t yy_nxt[482] =
173
} ;
-static yyconst flex_int16_t yy_chk[482] =
+static const flex_int16_t yy_chk[482] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -603,8 +815,8 @@ static yyconst flex_int16_t yy_chk[482] =
#define yymore() yymore_used_but_not_detected
#define YY_MORE_ADJ 0
#define YY_RESTORE_YY_MORE_OFFSET
-#line 1 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
-#line 2 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 1 "src/glsl/glcpp/glcpp-lex.l"
+#line 2 "src/glsl/glcpp/glcpp-lex.l"
/*
* Copyright © 2010 Intel Corporation
*
@@ -760,9 +972,11 @@ glcpp_lex_update_state_per_token (glcpp_parser_t *parser, int token)
}
-/* Note: When adding any start conditions to this list, you must also
-* update the "Internal compiler error" catch-all rule near the end of
-* this file. */
+#line 976 "src/glsl/glcpp/glcpp-lex.c"
+#line 167 "src/glsl/glcpp/glcpp-lex.l"
+ /* Note: When adding any start conditions to this list, you must also
+ * update the "Internal compiler error" catch-all rule near the end of
+ * this file. */
/* The OTHER class is simply a catch-all for things that the CPP
parser just doesn't care about. Since flex regular expressions that
@@ -770,7 +984,7 @@ match longer strings take priority over those matching shorter
strings, we have to be careful to avoid OTHER matching and hiding
something that CPP does care about. So we simply exclude all
characters that appear in any other expressions. */
-#line 774 "<stdout>"
+#line 988 "src/glsl/glcpp/glcpp-lex.c"
#define INITIAL 0
#define COMMENT 1
@@ -780,14 +994,6 @@ characters that appear in any other expressions. */
#define NEWLINE_CATCHUP 5
#define UNREACHABLE 6
-#ifndef YY_NO_UNISTD_H
-/* Special case for "unistd.h", since it is non-ANSI. We include it way
- * down here because we want the user's section 1 to have been scanned first.
- * The user has a chance to override it with an option.
- */
-#include <unistd.h>
-#endif
-
#define YY_EXTRA_TYPE glcpp_parser_t *
/* Holds the entire state of the reentrant scanner. */
@@ -804,7 +1010,7 @@ struct yyguts_t
YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
char yy_hold_char;
int yy_n_chars;
- yy_size_t yyleng_r;
+ int yyleng_r;
char *yy_c_buf_p;
int yy_init;
int yy_start;
@@ -828,7 +1034,7 @@ struct yyguts_t
}; /* end struct yyguts_t */
-static int yy_init_globals (yyscan_t yyscanner );
+static int yy_init_globals ( yyscan_t yyscanner );
/* This must go here because YYSTYPE and YYLTYPE are included
* from bison output in section 1.*/
@@ -836,50 +1042,50 @@ static int yy_init_globals (yyscan_t yyscanner );
# define yylloc yyg->yylloc_r
-int glcpp_lex_init (yyscan_t* scanner);
+int yylex_init (yyscan_t* scanner);
-int glcpp_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int glcpp_lex_destroy (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
-int glcpp_get_debug (yyscan_t yyscanner );
+int yyget_debug ( yyscan_t yyscanner );
-void glcpp_set_debug (int debug_flag ,yyscan_t yyscanner );
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
-YY_EXTRA_TYPE glcpp_get_extra (yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
-void glcpp_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
-FILE *glcpp_get_in (yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
-void glcpp_set_in (FILE * _in_str ,yyscan_t yyscanner );
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
-FILE *glcpp_get_out (yyscan_t yyscanner );
+FILE *yyget_out ( yyscan_t yyscanner );
-void glcpp_set_out (FILE * _out_str ,yyscan_t yyscanner );
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
-yy_size_t glcpp_get_leng (yyscan_t yyscanner );
+ int yyget_leng ( yyscan_t yyscanner );
-char *glcpp_get_text (yyscan_t yyscanner );
+char *yyget_text ( yyscan_t yyscanner );
-int glcpp_get_lineno (yyscan_t yyscanner );
+int yyget_lineno ( yyscan_t yyscanner );
-void glcpp_set_lineno (int _line_number ,yyscan_t yyscanner );
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
-int glcpp_get_column (yyscan_t yyscanner );
+int yyget_column ( yyscan_t yyscanner );
-void glcpp_set_column (int _column_no ,yyscan_t yyscanner );
+void yyset_column ( int _column_no , yyscan_t yyscanner );
-YYSTYPE * glcpp_get_lval (yyscan_t yyscanner );
+YYSTYPE * yyget_lval ( yyscan_t yyscanner );
-void glcpp_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
+void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
- YYLTYPE *glcpp_get_lloc (yyscan_t yyscanner );
+ YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
- void glcpp_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
+ void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -887,41 +1093,40 @@ void glcpp_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int glcpp_wrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
#else
-extern int glcpp_wrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
#ifndef YY_NO_UNPUT
- static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner);
+ static void yyunput ( int c, char *buf_ptr , yyscan_t yyscanner);
#endif
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
-
#ifdef __cplusplus
-static int yyinput (yyscan_t yyscanner );
+static int yyinput ( yyscan_t yyscanner );
#else
-static int input (yyscan_t yyscanner );
+static int input ( yyscan_t yyscanner );
#endif
#endif
- static void yy_push_state (int _new_state ,yyscan_t yyscanner);
+ static void yy_push_state ( int _new_state , yyscan_t yyscanner);
- static void yy_pop_state (yyscan_t yyscanner );
+ static void yy_pop_state ( yyscan_t yyscanner );
- static int yy_top_state (yyscan_t yyscanner );
+ static int yy_top_state ( yyscan_t yyscanner );
/* Amount of stuff to slurp up with each read. */
#ifndef YY_READ_BUF_SIZE
@@ -938,7 +1143,7 @@ static int input (yyscan_t yyscanner );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -949,7 +1154,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ int n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -962,7 +1167,7 @@ static int input (yyscan_t yyscanner );
else \
{ \
errno=0; \
- while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
@@ -1003,10 +1208,10 @@ static int input (yyscan_t yyscanner );
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int glcpp_lex \
- (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
+extern int yylex \
+ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
-#define YY_DECL int glcpp_lex \
+#define YY_DECL int yylex \
(YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
#endif /* !YY_DECL */
@@ -1056,16 +1261,16 @@ YY_DECL
yyout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
- glcpp_ensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- glcpp__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- glcpp__load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
{
-#line 195 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 196 "src/glsl/glcpp/glcpp-lex.l"
glcpp_parser_t *parser = yyextra;
@@ -1126,7 +1331,7 @@ YY_DECL
}
/* Single-line comments */
-#line 1130 "<stdout>"
+#line 1335 "src/glsl/glcpp/glcpp-lex.c"
while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
@@ -1154,9 +1359,9 @@ yy_match:
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 174 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
while ( yy_current_state != 173 );
@@ -1181,41 +1386,41 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 255 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 256 "src/glsl/glcpp/glcpp-lex.l"
{
}
YY_BREAK
/* Multi-line comments */
case 2:
YY_RULE_SETUP
-#line 259 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 260 "src/glsl/glcpp/glcpp-lex.l"
{ yy_push_state(COMMENT, yyscanner); }
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 260 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 261 "src/glsl/glcpp/glcpp-lex.l"
YY_BREAK
case 4:
/* rule 4 can match eol */
YY_RULE_SETUP
-#line 261 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 262 "src/glsl/glcpp/glcpp-lex.l"
{ yylineno++; yycolumn = 0; parser->commented_newlines++; }
YY_BREAK
case 5:
YY_RULE_SETUP
-#line 262 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 263 "src/glsl/glcpp/glcpp-lex.l"
YY_BREAK
case 6:
/* rule 6 can match eol */
YY_RULE_SETUP
-#line 263 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 264 "src/glsl/glcpp/glcpp-lex.l"
{ yylineno++; yycolumn = 0; parser->commented_newlines++; }
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 264 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 265 "src/glsl/glcpp/glcpp-lex.l"
{
yy_pop_state(yyscanner);
/* In the <HASH> start condition, we don't want any SPACE token. */
@@ -1225,7 +1430,7 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 271 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 272 "src/glsl/glcpp/glcpp-lex.l"
{
/* If the '#' is the first non-whitespace, non-comment token on this
@@ -1243,7 +1448,7 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 286 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 287 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
yyextra->space_tokens = 0;
@@ -1265,7 +1470,7 @@ YY_LINENO_REWIND_TO(yy_cp - 1);
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 300 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 301 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
}
@@ -1274,7 +1479,7 @@ YY_RULE_SETUP
* Simply pass them through to the main compiler's lexer/parser. */
case 11:
YY_RULE_SETUP
-#line 306 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 307 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
RETURN_STRING_TOKEN (PRAGMA);
@@ -1282,7 +1487,7 @@ YY_RULE_SETUP
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 311 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 312 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
RETURN_TOKEN (LINE);
@@ -1291,7 +1496,7 @@ YY_RULE_SETUP
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
-#line 316 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 317 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
RETURN_TOKEN_NEVER_SKIP (NEWLINE);
@@ -1301,7 +1506,7 @@ YY_RULE_SETUP
* even when we are otherwise skipping. */
case 14:
YY_RULE_SETUP
-#line 323 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 324 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
yyextra->lexing_directive = 1;
@@ -1311,7 +1516,7 @@ YY_RULE_SETUP
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 330 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 331 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
yyextra->lexing_directive = 1;
@@ -1326,7 +1531,7 @@ YY_LINENO_REWIND_TO(yy_bp + 2);
yyg->yy_c_buf_p = yy_cp = yy_bp + 2;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 337 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 338 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
yyextra->lexing_directive = 1;
@@ -1341,7 +1546,7 @@ YY_LINENO_REWIND_TO(yy_bp + 4);
yyg->yy_c_buf_p = yy_cp = yy_bp + 4;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 344 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 345 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
yyextra->lexing_directive = 1;
@@ -1351,7 +1556,7 @@ YY_RULE_SETUP
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 351 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 352 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
yyextra->space_tokens = 0;
@@ -1360,7 +1565,7 @@ YY_RULE_SETUP
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 357 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 358 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
yyextra->space_tokens = 0;
@@ -1369,7 +1574,7 @@ YY_RULE_SETUP
YY_BREAK
case 20:
YY_RULE_SETUP
-#line 363 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 364 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
RETURN_STRING_TOKEN (ERROR_TOKEN);
@@ -1395,7 +1600,7 @@ YY_RULE_SETUP
*/
case 21:
YY_RULE_SETUP
-#line 386 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 387 "src/glsl/glcpp/glcpp-lex.l"
{
if (! parser->skipping) {
BEGIN DEFINE;
@@ -1406,7 +1611,7 @@ YY_RULE_SETUP
YY_BREAK
case 22:
YY_RULE_SETUP
-#line 394 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 395 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
yyextra->space_tokens = 0;
@@ -1415,7 +1620,7 @@ YY_RULE_SETUP
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 400 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 401 "src/glsl/glcpp/glcpp-lex.l"
{
/* Nothing to do here. Importantly, don't leave the <HASH>
* start condition, since it's legal to have space between the
@@ -1425,7 +1630,7 @@ YY_RULE_SETUP
/* This will catch any non-directive garbage after a HASH */
case 24:
YY_RULE_SETUP
-#line 407 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 408 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
RETURN_TOKEN (GARBAGE);
@@ -1437,7 +1642,7 @@ case 25:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 413 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 414 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
RETURN_STRING_TOKEN (FUNC_IDENTIFIER);
@@ -1446,7 +1651,7 @@ YY_RULE_SETUP
/* An identifier not immediately followed by '(' */
case 26:
YY_RULE_SETUP
-#line 419 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 420 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
RETURN_STRING_TOKEN (OBJ_IDENTIFIER);
@@ -1455,7 +1660,7 @@ YY_RULE_SETUP
/* Whitespace */
case 27:
YY_RULE_SETUP
-#line 425 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 426 "src/glsl/glcpp/glcpp-lex.l"
{
/* Just ignore it. Nothing to do here. */
}
@@ -1464,7 +1669,7 @@ YY_RULE_SETUP
case 28:
/* rule 28 can match eol */
YY_RULE_SETUP
-#line 430 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 431 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
glcpp_error(yylloc, yyextra, "#define followed by a non-identifier: %s", yytext);
@@ -1475,7 +1680,7 @@ YY_RULE_SETUP
* space. This is an error. */
case 29:
YY_RULE_SETUP
-#line 438 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 439 "src/glsl/glcpp/glcpp-lex.l"
{
BEGIN INITIAL;
glcpp_error(yylloc, yyextra, "#define followed by a non-identifier: %s", yytext);
@@ -1484,98 +1689,98 @@ YY_RULE_SETUP
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 444 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 445 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_STRING_TOKEN (INTEGER_STRING);
}
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 448 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 449 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_STRING_TOKEN (INTEGER_STRING);
}
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 452 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 453 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_STRING_TOKEN (INTEGER_STRING);
}
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 456 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 457 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_TOKEN (LEFT_SHIFT);
}
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 460 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 461 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_TOKEN (RIGHT_SHIFT);
}
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 464 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 465 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_TOKEN (LESS_OR_EQUAL);
}
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 468 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 469 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_TOKEN (GREATER_OR_EQUAL);
}
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 472 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 473 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_TOKEN (EQUAL);
}
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 476 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 477 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_TOKEN (NOT_EQUAL);
}
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 480 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 481 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_TOKEN (AND);
}
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 484 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 485 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_TOKEN (OR);
}
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 488 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 489 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_TOKEN (PLUS_PLUS);
}
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 492 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 493 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_TOKEN (MINUS_MINUS);
}
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 496 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 497 "src/glsl/glcpp/glcpp-lex.l"
{
if (! parser->skipping) {
if (parser->is_gles)
@@ -1586,42 +1791,42 @@ YY_RULE_SETUP
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 504 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 505 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_TOKEN (DEFINED);
}
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 508 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 509 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_STRING_TOKEN (IDENTIFIER);
}
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 512 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 513 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_STRING_TOKEN (OTHER);
}
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 516 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 517 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_TOKEN (yytext[0]);
}
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 520 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 521 "src/glsl/glcpp/glcpp-lex.l"
{
RETURN_STRING_TOKEN (OTHER);
}
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 524 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 525 "src/glsl/glcpp/glcpp-lex.l"
{
if (yyextra->space_tokens) {
RETURN_TOKEN (SPACE);
@@ -1633,7 +1838,7 @@ YY_RULE_SETUP
case 50:
/* rule 50 can match eol */
YY_RULE_SETUP
-#line 532 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 533 "src/glsl/glcpp/glcpp-lex.l"
{
if (parser->commented_newlines) {
BEGIN NEWLINE_CATCHUP;
@@ -1651,7 +1856,7 @@ case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(COMMENT):
case YY_STATE_EOF(DEFINE):
case YY_STATE_EOF(HASH):
-#line 545 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 546 "src/glsl/glcpp/glcpp-lex.l"
{
if (YY_START == COMMENT)
glcpp_error(yylloc, yyextra, "Unterminated comment");
@@ -1667,7 +1872,7 @@ case YY_STATE_EOF(HASH):
* of the preceding patterns to match that input. */
case 51:
YY_RULE_SETUP
-#line 559 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 560 "src/glsl/glcpp/glcpp-lex.l"
{
glcpp_error(yylloc, yyextra, "Internal compiler error: Unexpected character: %s", yytext);
@@ -1683,10 +1888,10 @@ YY_RULE_SETUP
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 572 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
+#line 573 "src/glsl/glcpp/glcpp-lex.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 1690 "<stdout>"
+#line 1895 "src/glsl/glcpp/glcpp-lex.c"
case YY_STATE_EOF(DONE):
case YY_STATE_EOF(NEWLINE_CATCHUP):
case YY_STATE_EOF(UNREACHABLE):
@@ -1706,7 +1911,7 @@ case YY_STATE_EOF(UNREACHABLE):
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed yyin at a new source and called
- * glcpp_lex(). If so, then we have to assure
+ * yylex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
@@ -1767,7 +1972,7 @@ case YY_STATE_EOF(UNREACHABLE):
{
yyg->yy_did_buffer_switch_on_eof = 0;
- if ( glcpp_wrap(yyscanner ) )
+ if ( yywrap( yyscanner ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
@@ -1821,7 +2026,7 @@ case YY_STATE_EOF(UNREACHABLE):
} /* end of action switch */
} /* end of scanning one token */
} /* end of user's declarations */
-} /* end of glcpp_lex */
+} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -1835,7 +2040,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
char *source = yyg->yytext_ptr;
- yy_size_t number_to_move, i;
+ int number_to_move, i;
int ret_val;
if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
@@ -1864,7 +2069,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
@@ -1877,7 +2082,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{
- yy_size_t num_to_read =
+ int num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
while ( num_to_read <= 0 )
@@ -1891,7 +2096,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( b->yy_is_our_buffer )
{
- yy_size_t new_size = b->yy_buf_size * 2;
+ int new_size = b->yy_buf_size * 2;
if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
@@ -1900,11 +2105,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- glcpp_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+ yyrealloc( (void *) b->yy_ch_buf,
+ (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
}
else
/* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
+ b->yy_ch_buf = NULL;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
@@ -1932,7 +2138,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- glcpp_restart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
}
else
@@ -1946,12 +2152,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) glcpp_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ /* "- 2" to take care of EOB's */
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
yyg->yy_n_chars += number_to_move;
@@ -1985,9 +2194,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 174 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
return yy_current_state;
@@ -2014,9 +2223,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 174 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 173);
(void)yyg;
@@ -2038,7 +2247,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
- yy_size_t number_to_move = yyg->yy_n_chars + 2;
+ int number_to_move = yyg->yy_n_chars + 2;
char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
char *source =
@@ -2050,7 +2259,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
yy_cp += (int) (dest - source);
yy_bp += (int) (dest - source);
YY_CURRENT_BUFFER_LVALUE->yy_n_chars =
- yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
+ yyg->yy_n_chars = (int) YY_CURRENT_BUFFER_LVALUE->yy_buf_size;
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
YY_FATAL_ERROR( "flex scanner push-back overflow" );
@@ -2090,7 +2299,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{ /* need more input */
- yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
++yyg->yy_c_buf_p;
switch ( yy_get_next_buffer( yyscanner ) )
@@ -2107,14 +2316,14 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
*/
/* Reset buffer status. */
- glcpp_restart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( glcpp_wrap(yyscanner ) )
- return EOF;
+ if ( yywrap( yyscanner ) )
+ return 0;
if ( ! yyg->yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
@@ -2145,34 +2354,34 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @note This function does not reset the start condition to @c INITIAL .
*/
- void glcpp_restart (FILE * input_file , yyscan_t yyscanner)
+ void yyrestart (FILE * input_file , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! YY_CURRENT_BUFFER ){
- glcpp_ensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- glcpp__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- glcpp__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
- glcpp__load_buffer_state(yyscanner );
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
+ yy_load_buffer_state( yyscanner );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
* @param yyscanner The scanner object.
*/
- void glcpp__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* TODO. We should be able to replace this entire function body
* with
- * glcpp_pop_buffer_state();
- * glcpp_push_buffer_state(new_buffer);
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
*/
- glcpp_ensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
if ( YY_CURRENT_BUFFER == new_buffer )
return;
@@ -2185,17 +2394,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- glcpp__load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
/* We don't actually know whether we did this switch during
- * EOF (glcpp_wrap()) processing, but the only time this flag
- * is looked at is after glcpp_wrap() is called, so it's safe
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yyg->yy_did_buffer_switch_on_eof = 1;
}
-static void glcpp__load_buffer_state (yyscan_t yyscanner)
+static void yy_load_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
@@ -2210,35 +2419,35 @@ static void glcpp__load_buffer_state (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the allocated buffer state.
*/
- YY_BUFFER_STATE glcpp__create_buffer (FILE * file, int size , yyscan_t yyscanner)
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) glcpp_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in glcpp__create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
- b->yy_buf_size = (yy_size_t)size;
+ b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) glcpp_alloc(b->yy_buf_size + 2 ,yyscanner );
+ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in glcpp__create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- glcpp__init_buffer(b,file ,yyscanner);
+ yy_init_buffer( b, file , yyscanner);
return b;
}
/** Destroy the buffer.
- * @param b a buffer created with glcpp__create_buffer()
+ * @param b a buffer created with yy_create_buffer()
* @param yyscanner The scanner object.
*/
- void glcpp__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -2249,28 +2458,28 @@ static void glcpp__load_buffer_state (yyscan_t yyscanner)
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- glcpp_free((void *) b->yy_ch_buf ,yyscanner );
+ yyfree( (void *) b->yy_ch_buf , yyscanner );
- glcpp_free((void *) b ,yyscanner );
+ yyfree( (void *) b , yyscanner );
}
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
- * such as during a glcpp_restart() or at EOF.
+ * such as during a yyrestart() or at EOF.
*/
- static void glcpp__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
{
int oerrno = errno;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- glcpp__flush_buffer(b ,yyscanner);
+ yy_flush_buffer( b , yyscanner);
b->yy_input_file = file;
b->yy_fill_buffer = 1;
- /* If b is the current buffer, then glcpp__init_buffer was _probably_
- * called from glcpp_restart() or through yy_get_next_buffer.
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
@@ -2287,7 +2496,7 @@ static void glcpp__load_buffer_state (yyscan_t yyscanner)
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
* @param yyscanner The scanner object.
*/
- void glcpp__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! b )
@@ -2308,7 +2517,7 @@ static void glcpp__load_buffer_state (yyscan_t yyscanner)
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- glcpp__load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
/** Pushes the new state onto the stack. The new state becomes
@@ -2317,15 +2526,15 @@ static void glcpp__load_buffer_state (yyscan_t yyscanner)
* @param new_buffer The new state.
* @param yyscanner The scanner object.
*/
-void glcpp_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (new_buffer == NULL)
return;
- glcpp_ensure_buffer_stack(yyscanner);
+ yyensure_buffer_stack(yyscanner);
- /* This block is copied from glcpp__switch_to_buffer. */
+ /* This block is copied from yy_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
@@ -2339,8 +2548,8 @@ void glcpp_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
yyg->yy_buffer_stack_top++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from glcpp__switch_to_buffer. */
- glcpp__load_buffer_state(yyscanner );
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
@@ -2348,19 +2557,19 @@ void glcpp_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
* The next element becomes the new top.
* @param yyscanner The scanner object.
*/
-void glcpp_pop_buffer_state (yyscan_t yyscanner)
+void yypop_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!YY_CURRENT_BUFFER)
return;
- glcpp__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+ yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
YY_CURRENT_BUFFER_LVALUE = NULL;
if (yyg->yy_buffer_stack_top > 0)
--yyg->yy_buffer_stack_top;
if (YY_CURRENT_BUFFER) {
- glcpp__load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
}
@@ -2368,7 +2577,7 @@ void glcpp_pop_buffer_state (yyscan_t yyscanner)
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
-static void glcpp_ensure_buffer_stack (yyscan_t yyscanner)
+static void yyensure_buffer_stack (yyscan_t yyscanner)
{
yy_size_t num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -2379,15 +2588,15 @@ static void glcpp_ensure_buffer_stack (yyscan_t yyscanner)
* scanner will even need a stack. We use 2 instead of 1 to avoid an
* immediate realloc on the next call.
*/
- num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
- yyg->yy_buffer_stack = (struct yy_buffer_state**)glcpp_alloc
+ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in glcpp_ensure_buffer_stack()" );
-
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
+
yyg->yy_buffer_stack_max = num_to_alloc;
yyg->yy_buffer_stack_top = 0;
return;
@@ -2399,12 +2608,12 @@ static void glcpp_ensure_buffer_stack (yyscan_t yyscanner)
yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
- yyg->yy_buffer_stack = (struct yy_buffer_state**)glcpp_realloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
(yyg->yy_buffer_stack,
num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in glcpp_ensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -2416,9 +2625,9 @@ static void glcpp_ensure_buffer_stack (yyscan_t yyscanner)
* @param base the character buffer
* @param size the size in bytes of the character buffer
* @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE glcpp__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
@@ -2426,69 +2635,69 @@ YY_BUFFER_STATE glcpp__scan_buffer (char * base, yy_size_t size , yyscan_t yys
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
- return 0;
+ return NULL;
- b = (YY_BUFFER_STATE) glcpp_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in glcpp__scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
+ b->yy_input_file = NULL;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- glcpp__switch_to_buffer(b ,yyscanner );
+ yy_switch_to_buffer( b , yyscanner );
return b;
}
-/** Setup the input buffer state to scan a string. The next call to glcpp_lex() will
+/** Setup the input buffer state to scan a string. The next call to yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
- * glcpp__scan_bytes() instead.
+ * yy_scan_bytes() instead.
*/
-YY_BUFFER_STATE glcpp__scan_string (yyconst char * yystr , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
{
- return glcpp__scan_bytes(yystr,strlen(yystr) ,yyscanner);
+ return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
}
-/** Setup the input buffer state to scan the given bytes. The next call to glcpp_lex() will
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
- yy_size_t i;
+ int i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) glcpp_alloc(n ,yyscanner );
+ n = (yy_size_t) (_yybytes_len + 2);
+ buf = (char *) yyalloc( n , yyscanner );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in glcpp__scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = glcpp__scan_buffer(buf,n ,yyscanner);
+ b = yy_scan_buffer( buf, n , yyscanner);
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in glcpp__scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -2506,13 +2715,14 @@ YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_
yy_size_t new_size;
yyg->yy_start_stack_depth += YY_START_STACK_INCR;
- new_size = yyg->yy_start_stack_depth * sizeof( int );
+ new_size = (yy_size_t) yyg->yy_start_stack_depth * sizeof( int );
if ( ! yyg->yy_start_stack )
- yyg->yy_start_stack = (int *) glcpp_alloc(new_size ,yyscanner );
+ yyg->yy_start_stack = (int *) yyalloc( new_size , yyscanner );
else
- yyg->yy_start_stack = (int *) glcpp_realloc((void *) yyg->yy_start_stack,new_size ,yyscanner );
+ yyg->yy_start_stack = (int *) yyrealloc(
+ (void *) yyg->yy_start_stack, new_size , yyscanner );
if ( ! yyg->yy_start_stack )
YY_FATAL_ERROR( "out of memory expanding start-condition stack" );
@@ -2542,11 +2752,11 @@ YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_
#define YY_EXIT_FAILURE 2
#endif
-static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
+static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- (void) fprintf( stderr, "%s\n", msg );
+ fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -2572,7 +2782,7 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
/** Get the user-defined data for this scanner.
* @param yyscanner The scanner object.
*/
-YY_EXTRA_TYPE glcpp_get_extra (yyscan_t yyscanner)
+YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyextra;
@@ -2581,10 +2791,10 @@ YY_EXTRA_TYPE glcpp_get_extra (yyscan_t yyscanner)
/** Get the current line number.
* @param yyscanner The scanner object.
*/
-int glcpp_get_lineno (yyscan_t yyscanner)
+int yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+
if (! YY_CURRENT_BUFFER)
return 0;
@@ -2594,10 +2804,10 @@ int glcpp_get_lineno (yyscan_t yyscanner)
/** Get the current column number.
* @param yyscanner The scanner object.
*/
-int glcpp_get_column (yyscan_t yyscanner)
+int yyget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+
if (! YY_CURRENT_BUFFER)
return 0;
@@ -2607,7 +2817,7 @@ int glcpp_get_column (yyscan_t yyscanner)
/** Get the input stream.
* @param yyscanner The scanner object.
*/
-FILE *glcpp_get_in (yyscan_t yyscanner)
+FILE *yyget_in (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyin;
@@ -2616,7 +2826,7 @@ FILE *glcpp_get_in (yyscan_t yyscanner)
/** Get the output stream.
* @param yyscanner The scanner object.
*/
-FILE *glcpp_get_out (yyscan_t yyscanner)
+FILE *yyget_out (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyout;
@@ -2625,7 +2835,7 @@ FILE *glcpp_get_out (yyscan_t yyscanner)
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
-yy_size_t glcpp_get_leng (yyscan_t yyscanner)
+int yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
@@ -2635,7 +2845,7 @@ yy_size_t glcpp_get_leng (yyscan_t yyscanner)
* @param yyscanner The scanner object.
*/
-char *glcpp_get_text (yyscan_t yyscanner)
+char *yyget_text (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yytext;
@@ -2645,7 +2855,7 @@ char *glcpp_get_text (yyscan_t yyscanner)
* @param user_defined The data to be associated with this scanner.
* @param yyscanner The scanner object.
*/
-void glcpp_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
+void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyextra = user_defined ;
@@ -2655,13 +2865,13 @@ void glcpp_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
* @param _line_number line number
* @param yyscanner The scanner object.
*/
-void glcpp_set_lineno (int _line_number , yyscan_t yyscanner)
+void yyset_lineno (int _line_number , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "glcpp_set_lineno called with no buffer" );
+ YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
yylineno = _line_number;
}
@@ -2670,13 +2880,13 @@ void glcpp_set_lineno (int _line_number , yyscan_t yyscanner)
* @param _column_no column number
* @param yyscanner The scanner object.
*/
-void glcpp_set_column (int _column_no , yyscan_t yyscanner)
+void yyset_column (int _column_no , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- YY_FATAL_ERROR( "glcpp_set_column called with no buffer" );
+ YY_FATAL_ERROR( "yyset_column called with no buffer" );
yycolumn = _column_no;
}
@@ -2685,27 +2895,27 @@ void glcpp_set_column (int _column_no , yyscan_t yyscanner)
* input buffer.
* @param _in_str A readable stream.
* @param yyscanner The scanner object.
- * @see glcpp__switch_to_buffer
+ * @see yy_switch_to_buffer
*/
-void glcpp_set_in (FILE * _in_str , yyscan_t yyscanner)
+void yyset_in (FILE * _in_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyin = _in_str ;
}
-void glcpp_set_out (FILE * _out_str , yyscan_t yyscanner)
+void yyset_out (FILE * _out_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyout = _out_str ;
}
-int glcpp_get_debug (yyscan_t yyscanner)
+int yyget_debug (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yy_flex_debug;
}
-void glcpp_set_debug (int _bdebug , yyscan_t yyscanner)
+void yyset_debug (int _bdebug , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_flex_debug = _bdebug ;
@@ -2713,25 +2923,25 @@ void glcpp_set_debug (int _bdebug , yyscan_t yyscanner)
/* Accessor methods for yylval and yylloc */
-YYSTYPE * glcpp_get_lval (yyscan_t yyscanner)
+YYSTYPE * yyget_lval (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yylval;
}
-void glcpp_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
+void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yylval = yylval_param;
}
-YYLTYPE *glcpp_get_lloc (yyscan_t yyscanner)
+YYLTYPE *yyget_lloc (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yylloc;
}
-void glcpp_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
+void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yylloc = yylloc_param;
@@ -2739,20 +2949,18 @@ void glcpp_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
/* User-visible API */
-/* glcpp_lex_init is special because it creates the scanner itself, so it is
+/* yylex_init is special because it creates the scanner itself, so it is
* the ONLY reentrant function that doesn't take the scanner as the last argument.
* That's why we explicitly handle the declaration, instead of using our macros.
*/
-
-int glcpp_lex_init(yyscan_t* ptr_yy_globals)
-
+int yylex_init(yyscan_t* ptr_yy_globals)
{
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
- *ptr_yy_globals = (yyscan_t) glcpp_alloc ( sizeof( struct yyguts_t ), NULL );
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -2765,39 +2973,37 @@ int glcpp_lex_init(yyscan_t* ptr_yy_globals)
return yy_init_globals ( *ptr_yy_globals );
}
-/* glcpp_lex_init_extra has the same functionality as glcpp_lex_init, but follows the
+/* yylex_init_extra has the same functionality as yylex_init, but follows the
* convention of taking the scanner as the last argument. Note however, that
* this is a *pointer* to a scanner, as it will be allocated by this call (and
* is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to glcpp_alloc in
+ * The user defined value in the first argument will be available to yyalloc in
* the yyextra field.
*/
-
-int glcpp_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
-
+int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
{
struct yyguts_t dummy_yyguts;
- glcpp_set_extra (yy_user_defined, &dummy_yyguts);
+ yyset_extra (yy_user_defined, &dummy_yyguts);
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
-
- *ptr_yy_globals = (yyscan_t) glcpp_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
-
+
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
return 1;
}
-
+
/* By setting to 0xAA, we expose bugs in
yy_init_globals. Leave at 0x00 for releases. */
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-
- glcpp_set_extra (yy_user_defined, *ptr_yy_globals);
-
+
+ yyset_extra (yy_user_defined, *ptr_yy_globals);
+
return yy_init_globals ( *ptr_yy_globals );
}
@@ -2805,13 +3011,13 @@ static int yy_init_globals (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Initialization is the same as for the non-reentrant scanner.
- * This function is called from glcpp_lex_destroy(), so don't allocate here.
+ * This function is called from yylex_destroy(), so don't allocate here.
*/
- yyg->yy_buffer_stack = 0;
+ yyg->yy_buffer_stack = NULL;
yyg->yy_buffer_stack_top = 0;
yyg->yy_buffer_stack_max = 0;
- yyg->yy_c_buf_p = (char *) 0;
+ yyg->yy_c_buf_p = NULL;
yyg->yy_init = 0;
yyg->yy_start = 0;
@@ -2824,42 +3030,42 @@ static int yy_init_globals (yyscan_t yyscanner)
yyin = stdin;
yyout = stdout;
#else
- yyin = (FILE *) 0;
- yyout = (FILE *) 0;
+ yyin = NULL;
+ yyout = NULL;
#endif
/* For future reference: Set errno on error, since we are called by
- * glcpp_lex_init()
+ * yylex_init()
*/
return 0;
}
-/* glcpp_lex_destroy is for both reentrant and non-reentrant scanners. */
-int glcpp_lex_destroy (yyscan_t yyscanner)
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- glcpp__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
YY_CURRENT_BUFFER_LVALUE = NULL;
- glcpp_pop_buffer_state(yyscanner);
+ yypop_buffer_state(yyscanner);
}
/* Destroy the stack itself. */
- glcpp_free(yyg->yy_buffer_stack ,yyscanner);
+ yyfree(yyg->yy_buffer_stack , yyscanner);
yyg->yy_buffer_stack = NULL;
/* Destroy the start condition stack. */
- glcpp_free(yyg->yy_start_stack ,yyscanner );
+ yyfree( yyg->yy_start_stack , yyscanner );
yyg->yy_start_stack = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
- * glcpp_lex() is called, initialization will occur. */
+ * yylex() is called, initialization will occur. */
yy_init_globals( yyscanner);
/* Destroy the main struct (reentrant only). */
- glcpp_free ( yyscanner , yyscanner );
+ yyfree ( yyscanner , yyscanner );
yyscanner = NULL;
return 0;
}
@@ -2869,7 +3075,7 @@ int glcpp_lex_destroy (yyscan_t yyscanner)
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
+static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
@@ -2881,7 +3087,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
+static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
{
int n;
for ( n = 0; s[n]; ++n )
@@ -2891,14 +3097,14 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
}
#endif
-void *glcpp_alloc (yy_size_t size , yyscan_t yyscanner)
+void *yyalloc (yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- return (void *) malloc( size );
+ return malloc(size);
}
-void *glcpp_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
+void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
@@ -2910,25 +3116,24 @@ void *glcpp_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
- return (void *) realloc( (char *) ptr, size );
+ return realloc(ptr, size);
}
-void glcpp_free (void * ptr , yyscan_t yyscanner)
+void yyfree (void * ptr , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
(void)yyg;
- free( (char *) ptr ); /* see glcpp_realloc() for (char *) cast */
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
-#line 572 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l"
-
+#line 573 "src/glsl/glcpp/glcpp-lex.l"
void
glcpp_lex_set_source_string(glcpp_parser_t *parser, const char *shader)
{
- glcpp__scan_string(shader,parser->scanner);
+ yy_scan_string(shader, parser->scanner);
}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c
index 66e5f083bd1..5aeb9f21ed2 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.c
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 3.5.1. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
+ Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,11 +41,14 @@
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
+/* Undocumented macros, especially those whose name start with YY_,
+ are private implementation details. Do not rely on them. */
+
/* Identify Bison output. */
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.0.2"
+#define YYBISON_VERSION "3.5.1"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -66,9 +70,8 @@
#define yydebug glcpp_parser_debug
#define yynerrs glcpp_parser_nerrs
-
-/* Copy the first part of user declarations. */
-#line 1 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:339 */
+/* First part of user prologue. */
+#line 1 "src/glsl/glcpp/glcpp-parse.y"
/*
* Copyright © 2010 Intel Corporation
@@ -228,13 +231,26 @@ static void
add_builtin_define(glcpp_parser_t *parser, const char *name, int value);
-#line 232 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:339 */
+#line 235 "src/glsl/glcpp/glcpp-parse.c"
+# ifndef YY_CAST
+# ifdef __cplusplus
+# define YY_CAST(Type, Val) static_cast<Type> (Val)
+# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
+# else
+# define YY_CAST(Type, Val) ((Type) (Val))
+# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
+# endif
+# endif
# ifndef YY_NULLPTR
-# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULLPTR nullptr
+# if defined __cplusplus
+# if 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
# else
-# define YY_NULLPTR 0
+# define YY_NULLPTR ((void*)0)
# endif
# endif
@@ -246,8 +262,8 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value);
# define YYERROR_VERBOSE 1
#endif
-/* In a future release of Bison, this section will be replaced
- by #include "glcpp-parse.h". */
+/* Use api.header.include to #include this header
+ instead of duplicating it here. */
#ifndef YY_GLCPP_PARSER_SRC_GLSL_GLCPP_GLCPP_PARSE_H_INCLUDED
# define YY_GLCPP_PARSER_SRC_GLSL_GLCPP_GLCPP_PARSE_H_INCLUDED
/* Debug traces. */
@@ -327,36 +343,81 @@ int glcpp_parser_parse (glcpp_parser_t *parser);
#endif /* !YY_GLCPP_PARSER_SRC_GLSL_GLCPP_GLCPP_PARSE_H_INCLUDED */
-/* Copy the second part of user declarations. */
-#line 333 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:358 */
#ifdef short
# undef short
#endif
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
+/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
+ <limits.h> and (if available) <stdint.h> are included
+ so that the code can choose integer types of a good width. */
+
+#ifndef __PTRDIFF_MAX__
+# include <limits.h> /* INFRINGES ON USER NAME SPACE */
+# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
+# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_STDINT_H
+# endif
#endif
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
+/* Narrow types that promote to a signed type and that can represent a
+ signed or unsigned integer of at least N bits. In tables they can
+ save space and decrease cache pressure. Promoting to a signed type
+ helps avoid bugs in integer arithmetic. */
+
+#ifdef __INT_LEAST8_MAX__
+typedef __INT_LEAST8_TYPE__ yytype_int8;
+#elif defined YY_STDINT_H
+typedef int_least8_t yytype_int8;
#else
typedef signed char yytype_int8;
#endif
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
+#ifdef __INT_LEAST16_MAX__
+typedef __INT_LEAST16_TYPE__ yytype_int16;
+#elif defined YY_STDINT_H
+typedef int_least16_t yytype_int16;
#else
-typedef unsigned short int yytype_uint16;
+typedef short yytype_int16;
#endif
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
+#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST8_TYPE__ yytype_uint8;
+#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST8_MAX <= INT_MAX)
+typedef uint_least8_t yytype_uint8;
+#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
+typedef unsigned char yytype_uint8;
#else
-typedef short int yytype_int16;
+typedef short yytype_uint8;
+#endif
+
+#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST16_TYPE__ yytype_uint16;
+#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST16_MAX <= INT_MAX)
+typedef uint_least16_t yytype_uint16;
+#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
+typedef unsigned short yytype_uint16;
+#else
+typedef int yytype_uint16;
+#endif
+
+#ifndef YYPTRDIFF_T
+# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
+# define YYPTRDIFF_T __PTRDIFF_TYPE__
+# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
+# elif defined PTRDIFF_MAX
+# ifndef ptrdiff_t
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# endif
+# define YYPTRDIFF_T ptrdiff_t
+# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
+# else
+# define YYPTRDIFF_T long
+# define YYPTRDIFF_MAXIMUM LONG_MAX
+# endif
#endif
#ifndef YYSIZE_T
@@ -364,15 +425,27 @@ typedef short int yytype_int16;
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T
+# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
-# define YYSIZE_T unsigned int
+# define YYSIZE_T unsigned
# endif
#endif
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+#define YYSIZE_MAXIMUM \
+ YY_CAST (YYPTRDIFF_T, \
+ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
+ ? YYPTRDIFF_MAXIMUM \
+ : YY_CAST (YYSIZE_T, -1)))
+
+#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
+
+/* Stored state numbers (used for stacks). */
+typedef yytype_uint8 yy_state_t;
+
+/* State numbers in computations. */
+typedef int yy_state_fast_t;
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
@@ -386,30 +459,19 @@ typedef short int yytype_int16;
# endif
#endif
-#ifndef YY_ATTRIBUTE
-# if (defined __GNUC__ \
- && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
- || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+#ifndef YY_ATTRIBUTE_PURE
+# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
-# define YY_ATTRIBUTE(Spec) /* empty */
+# define YY_ATTRIBUTE_PURE
# endif
#endif
-#ifndef YY_ATTRIBUTE_PURE
-# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
-#endif
-
#ifndef YY_ATTRIBUTE_UNUSED
-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
-#endif
-
-#if !defined _Noreturn \
- && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-# define _Noreturn __declspec (noreturn)
+# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
# else
-# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+# define YY_ATTRIBUTE_UNUSED
# endif
#endif
@@ -420,13 +482,13 @@ typedef short int yytype_int16;
# define YYUSE(E) /* empty */
#endif
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
- _Pragma ("GCC diagnostic push") \
- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
@@ -439,6 +501,20 @@ typedef short int yytype_int16;
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
+#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
+# define YY_IGNORE_USELESS_CAST_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
+# define YY_IGNORE_USELESS_CAST_END \
+ _Pragma ("GCC diagnostic pop")
+#endif
+#ifndef YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_END
+#endif
+
+
+#define YY_ASSERT(E) ((void) (0 && (E)))
#if ! defined yyoverflow || YYERROR_VERBOSE
@@ -516,18 +592,19 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss_alloc;
+ yy_state_t yyss_alloc;
YYSTYPE yyvs_alloc;
YYLTYPE yyls_alloc;
};
/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
+ + YYSIZEOF (YYLTYPE)) \
+ 2 * YYSTACK_GAP_MAXIMUM)
# define YYCOPY_NEEDED 1
@@ -540,11 +617,11 @@ union yyalloc
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
- YYSIZE_T yynewbytes; \
+ YYPTRDIFF_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
+ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / YYSIZEOF (*yyptr); \
} \
while (0)
@@ -556,12 +633,12 @@ union yyalloc
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(Dst, Src, Count) \
- __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
# else
# define YYCOPY(Dst, Src, Count) \
do \
{ \
- YYSIZE_T yyi; \
+ YYPTRDIFF_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
@@ -584,17 +661,18 @@ union yyalloc
/* YYNSTATES -- Number of states. */
#define YYNSTATES 185
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
- by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 296
+
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, with out-of-bounds checking. */
#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+ (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
- as returned by yylex, without out-of-bounds checking. */
-static const yytype_uint8 yytranslate[] =
+ as returned by yylex. */
+static const yytype_int8 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -630,7 +708,7 @@ static const yytype_uint8 yytranslate[] =
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
-static const yytype_uint16 yyrline[] =
+static const yytype_int16 yyrline[] =
{
0, 205, 205, 207, 211, 212, 213, 218, 222, 227,
232, 240, 253, 256, 259, 265, 268, 269, 269, 284,
@@ -673,7 +751,7 @@ static const char *const yytname[] =
# ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
(internal) symbol number NUM (which must be that of a token). */
-static const yytype_uint16 yytoknum[] =
+static const yytype_int16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
@@ -685,14 +763,14 @@ static const yytype_uint16 yytoknum[] =
};
# endif
-#define YYPACT_NINF -142
+#define YYPACT_NINF (-142)
-#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-142)))
+#define yypact_value_is_default(Yyn) \
+ ((Yyn) == YYPACT_NINF)
-#define YYTABLE_NINF -1
+#define YYTABLE_NINF (-1)
-#define yytable_value_is_error(Yytable_value) \
+#define yytable_value_is_error(Yyn) \
0
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
@@ -723,7 +801,7 @@ static const yytype_int16 yypact[] =
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
Performed when YYTABLE does not specify something else to do. Zero
means the default is an error. */
-static const yytype_uint8 yydefact[] =
+static const yytype_int8 yydefact[] =
{
2, 0, 1, 83, 0, 0, 80, 0, 81, 0,
72, 84, 85, 117, 118, 116, 112, 111, 110, 109,
@@ -907,7 +985,7 @@ static const yytype_int16 yycheck[] =
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
-static const yytype_uint8 yystos[] =
+static const yytype_int8 yystos[] =
{
0, 65, 0, 3, 4, 5, 21, 22, 24, 25,
26, 27, 29, 30, 31, 32, 33, 34, 35, 36,
@@ -931,7 +1009,7 @@ static const yytype_uint8 yystos[] =
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint8 yyr1[] =
+static const yytype_int8 yyr1[] =
{
0, 64, 65, 65, 66, 66, 66, 66, 67, 67,
67, 67, 68, 68, 68, 69, 69, 70, 69, 72,
@@ -948,7 +1026,7 @@ static const yytype_uint8 yyr1[] =
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
+static const yytype_int8 yyr2[] =
{
0, 2, 0, 2, 1, 2, 1, 1, 3, 3,
3, 4, 3, 5, 6, 1, 1, 0, 5, 0,
@@ -977,22 +1055,22 @@ static const yytype_uint8 yyr2[] =
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- YYPOPSTACK (yylen); \
- yystate = *yyssp; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (&yylloc, parser, YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (0)
+#define YYBACKUP(Token, Value) \
+ do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (&yylloc, parser, YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+ while (0)
/* Error token number */
#define YYTERROR 1
@@ -1051,10 +1129,10 @@ do { \
/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
YY_ATTRIBUTE_UNUSED
-static unsigned
+static int
yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
{
- unsigned res = 0;
+ int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
@@ -1097,41 +1175,43 @@ do { \
} while (0)
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT. |
-`----------------------------------------*/
+/*-----------------------------------.
+| Print this symbol's value on YYO. |
+`-----------------------------------*/
static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, glcpp_parser_t *parser)
+yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, glcpp_parser_t *parser)
{
- FILE *yyo = yyoutput;
- YYUSE (yyo);
+ FILE *yyoutput = yyo;
+ YYUSE (yyoutput);
YYUSE (yylocationp);
YYUSE (parser);
if (!yyvaluep)
return;
# ifdef YYPRINT
if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+ YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
# endif
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YYUSE (yytype);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+/*---------------------------.
+| Print this symbol on YYO. |
+`---------------------------*/
static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, glcpp_parser_t *parser)
+yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, glcpp_parser_t *parser)
{
- YYFPRINTF (yyoutput, "%s %s (",
+ YYFPRINTF (yyo, "%s %s (",
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
- YY_LOCATION_PRINT (yyoutput, *yylocationp);
- YYFPRINTF (yyoutput, ": ");
- yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, parser);
- YYFPRINTF (yyoutput, ")");
+ YY_LOCATION_PRINT (yyo, *yylocationp);
+ YYFPRINTF (yyo, ": ");
+ yy_symbol_value_print (yyo, yytype, yyvaluep, yylocationp, parser);
+ YYFPRINTF (yyo, ")");
}
/*------------------------------------------------------------------.
@@ -1140,7 +1220,7 @@ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYL
`------------------------------------------------------------------*/
static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
YYFPRINTF (stderr, "Stack now");
for (; yybottom <= yytop; yybottom++)
@@ -1163,20 +1243,20 @@ do { \
`------------------------------------------------*/
static void
-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, glcpp_parser_t *parser)
+yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, glcpp_parser_t *parser)
{
- unsigned long int yylno = yyrline[yyrule];
+ int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr,
- yystos[yyssp[yyi + 1 - yynrhs]],
- &(yyvsp[(yyi + 1) - (yynrhs)])
+ yystos[+yyssp[yyi + 1 - yynrhs]],
+ &yyvsp[(yyi + 1) - (yynrhs)]
, &(yylsp[(yyi + 1) - (yynrhs)]) , parser);
YYFPRINTF (stderr, "\n");
}
@@ -1220,13 +1300,13 @@ int yydebug;
# ifndef yystrlen
# if defined __GLIBC__ && defined _STRING_H
-# define yystrlen strlen
+# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
# else
/* Return the length of YYSTR. */
-static YYSIZE_T
+static YYPTRDIFF_T
yystrlen (const char *yystr)
{
- YYSIZE_T yylen;
+ YYPTRDIFF_T yylen;
for (yylen = 0; yystr[yylen]; yylen++)
continue;
return yylen;
@@ -1262,12 +1342,12 @@ yystpcpy (char *yydest, const char *yysrc)
backslash-backslash). YYSTR is taken from yytname. If YYRES is
null, do not copy; instead, return the length of what the result
would have been. */
-static YYSIZE_T
+static YYPTRDIFF_T
yytnamerr (char *yyres, const char *yystr)
{
if (*yystr == '"')
{
- YYSIZE_T yyn = 0;
+ YYPTRDIFF_T yyn = 0;
char const *yyp = yystr;
for (;;)
@@ -1280,7 +1360,10 @@ yytnamerr (char *yyres, const char *yystr)
case '\\':
if (*++yyp != '\\')
goto do_not_strip_quotes;
- /* Fall through. */
+ else
+ goto append;
+
+ append:
default:
if (yyres)
yyres[yyn] = *yyp;
@@ -1295,10 +1378,10 @@ yytnamerr (char *yyres, const char *yystr)
do_not_strip_quotes: ;
}
- if (! yyres)
+ if (yyres)
+ return yystpcpy (yyres, yystr) - yyres;
+ else
return yystrlen (yystr);
-
- return yystpcpy (yyres, yystr) - yyres;
}
# endif
@@ -1311,19 +1394,19 @@ yytnamerr (char *yyres, const char *yystr)
*YYMSG_ALLOC to the required number of bytes. Return 2 if the
required number of bytes is too large to store. */
static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
- yytype_int16 *yyssp, int yytoken)
+yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
+ yy_state_t *yyssp, int yytoken)
{
- YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
- YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
const char *yyformat = YY_NULLPTR;
- /* Arguments of yyformat. */
+ /* Arguments of yyformat: reported tokens (one for the "unexpected",
+ one per "expected"). */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- /* Number of reported tokens (one for the "unexpected", one per
- "expected"). */
+ /* Actual size of YYARG. */
int yycount = 0;
+ /* Cumulated lengths of YYARG. */
+ YYPTRDIFF_T yysize = 0;
/* There are many possibilities here to consider:
- If this state is a consistent state with a default action, then
@@ -1350,7 +1433,9 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
*/
if (yytoken != YYEMPTY)
{
- int yyn = yypact[*yyssp];
+ int yyn = yypact[+*yyssp];
+ YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
+ yysize = yysize0;
yyarg[yycount++] = yytname[yytoken];
if (!yypact_value_is_default (yyn))
{
@@ -1375,11 +1460,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
}
yyarg[yycount++] = yytname[yyx];
{
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ YYPTRDIFF_T yysize1
+ = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+ yysize = yysize1;
+ else
return 2;
- yysize = yysize1;
}
}
}
@@ -1391,6 +1477,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
case N: \
yyformat = S; \
break
+ default: /* Avoid compiler warnings. */
YYCASE_(0, YY_("syntax error"));
YYCASE_(1, YY_("syntax error, unexpected %s"));
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
@@ -1401,10 +1488,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
}
{
- YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ /* Don't count the "%s"s in the final size, but reserve room for
+ the terminator. */
+ YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+ yysize = yysize1;
+ else
return 2;
- yysize = yysize1;
}
if (*yymsg_alloc < yysize)
@@ -1430,8 +1520,8 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
}
else
{
- yyp++;
- yyformat++;
+ ++yyp;
+ ++yyformat;
}
}
return 0;
@@ -1488,7 +1578,7 @@ YYLTYPE yylloc = yyloc_default;
/* Number of syntax errors so far. */
int yynerrs;
- int yystate;
+ yy_state_fast_t yystate;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
@@ -1501,9 +1591,9 @@ YYLTYPE yylloc = yyloc_default;
to reallocate them elsewhere. */
/* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss;
- yytype_int16 *yyssp;
+ yy_state_t yyssa[YYINITDEPTH];
+ yy_state_t *yyss;
+ yy_state_t *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
@@ -1518,7 +1608,7 @@ YYLTYPE yylloc = yyloc_default;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[3];
- YYSIZE_T yystacksize;
+ YYPTRDIFF_T yystacksize;
int yyn;
int yyresult;
@@ -1533,7 +1623,7 @@ YYLTYPE yylloc = yyloc_default;
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+ YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
#endif
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
@@ -1555,7 +1645,7 @@ YYLTYPE yylloc = yyloc_default;
yychar = YYEMPTY; /* Cause a token to be read. */
/* User initialization code. */
-#line 165 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1429 */
+#line 165 "src/glsl/glcpp/glcpp-parse.y"
{
yylloc.first_line = 1;
yylloc.first_column = 1;
@@ -1564,33 +1654,46 @@ YYLTYPE yylloc = yyloc_default;
yylloc.source = 0;
}
-#line 1568 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1429 */
+#line 1658 "src/glsl/glcpp/glcpp-parse.c"
+
yylsp[0] = yylloc;
goto yysetstate;
+
/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
+| yynewstate -- push a new state, which is found in yystate. |
`------------------------------------------------------------*/
- yynewstate:
+yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
- yysetstate:
- *yyssp = yystate;
+
+/*--------------------------------------------------------------------.
+| yysetstate -- set current state (the top of the stack) to yystate. |
+`--------------------------------------------------------------------*/
+yysetstate:
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
+ YY_IGNORE_USELESS_CAST_BEGIN
+ *yyssp = YY_CAST (yy_state_t, yystate);
+ YY_IGNORE_USELESS_CAST_END
if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+ goto yyexhaustedlab;
+#else
{
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
+ YYPTRDIFF_T yysize = yyssp - yyss + 1;
-#ifdef yyoverflow
+# if defined yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
+ yy_state_t *yyss1 = yyss;
YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
YYLTYPE *yyls1 = yyls;
/* Each stack pointer address is followed by the size of the
@@ -1598,19 +1701,15 @@ YYLTYPE yylloc = yyloc_default;
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
- &yyls1, yysize * sizeof (*yylsp),
+ &yyss1, yysize * YYSIZEOF (*yyssp),
+ &yyvs1, yysize * YYSIZEOF (*yyvsp),
+ &yyls1, yysize * YYSIZEOF (*yylsp),
&yystacksize);
-
- yyls = yyls1;
yyss = yyss1;
yyvs = yyvs1;
+ yyls = yyls1;
}
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyexhaustedlab;
@@ -1619,44 +1718,45 @@ YYLTYPE yylloc = yyloc_default;
yystacksize = YYMAXDEPTH;
{
- yytype_int16 *yyss1 = yyss;
+ yy_state_t *yyss1 = yyss;
union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ YY_CAST (union yyalloc *,
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
if (! yyptr)
goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
YYSTACK_RELOCATE (yyls_alloc, yyls);
-# undef YYSTACK_RELOCATE
+# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
-#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
yylsp = yyls + yysize - 1;
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ YY_IGNORE_USELESS_CAST_BEGIN
+ YYDPRINTF ((stderr, "Stack size increased to %ld\n",
+ YY_CAST (long, yystacksize)));
+ YY_IGNORE_USELESS_CAST_END
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
-
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup;
+
/*-----------.
| yybackup. |
`-----------*/
yybackup:
-
/* Do appropriate processing given the current state. Read a
lookahead token if we need one and don't already have one. */
@@ -1706,15 +1806,14 @@ yybackup:
/* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the shifted token. */
- yychar = YYEMPTY;
-
yystate = yyn;
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
*++yylsp = yylloc;
+
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
goto yynewstate;
@@ -1729,7 +1828,7 @@ yydefault:
/*-----------------------------.
-| yyreduce -- Do a reduction. |
+| yyreduce -- do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
@@ -1745,44 +1844,45 @@ yyreduce:
GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen];
- /* Default location. */
+ /* Default location. */
YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
+ yyerror_range[1] = yyloc;
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 6:
-#line 213 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+ case 6:
+#line 213 "src/glsl/glcpp/glcpp-parse.y"
+ {
_glcpp_parser_print_expanded_token_list (parser, (yyvsp[0].token_list));
ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n");
ralloc_free ((yyvsp[0].token_list));
}
-#line 1761 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1861 "src/glsl/glcpp/glcpp-parse.c"
break;
case 8:
-#line 222 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 222 "src/glsl/glcpp/glcpp-parse.y"
+ {
if (parser->is_gles && (yyvsp[-1].expression_value).undefined_macro)
glcpp_error(& (yylsp[-2]), parser, "undefined macro %s in expression (illegal in GLES)", (yyvsp[-1].expression_value).undefined_macro);
_glcpp_parser_skip_stack_push_if (parser, & (yylsp[-2]), (yyvsp[-1].expression_value).value);
}
-#line 1771 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1871 "src/glsl/glcpp/glcpp-parse.c"
break;
case 9:
-#line 227 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 227 "src/glsl/glcpp/glcpp-parse.y"
+ {
if (parser->is_gles && (yyvsp[-1].expression_value).undefined_macro)
glcpp_error(& (yylsp[-2]), parser, "undefined macro %s in expression (illegal in GLES)", (yyvsp[-1].expression_value).undefined_macro);
_glcpp_parser_skip_stack_change_if (parser, & (yylsp[-2]), "elif", (yyvsp[-1].expression_value).value);
}
-#line 1781 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1881 "src/glsl/glcpp/glcpp-parse.c"
break;
case 10:
-#line 232 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 232 "src/glsl/glcpp/glcpp-parse.y"
+ {
parser->has_new_line_number = 1;
parser->new_line_number = (yyvsp[-1].ival);
ralloc_asprintf_rewrite_tail (&parser->output,
@@ -1790,12 +1890,12 @@ yyreduce:
"#line %" PRIiMAX "\n",
(yyvsp[-1].ival));
}
-#line 1794 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1894 "src/glsl/glcpp/glcpp-parse.c"
break;
case 11:
-#line 240 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 240 "src/glsl/glcpp/glcpp-parse.y"
+ {
parser->has_new_line_number = 1;
parser->new_line_number = (yyvsp[-2].ival);
parser->has_new_source_number = 1;
@@ -1805,52 +1905,52 @@ yyreduce:
"#line %" PRIiMAX " %" PRIiMAX "\n",
(yyvsp[-2].ival), (yyvsp[-1].ival));
}
-#line 1809 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1909 "src/glsl/glcpp/glcpp-parse.c"
break;
case 12:
-#line 253 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 253 "src/glsl/glcpp/glcpp-parse.y"
+ {
_define_object_macro (parser, & (yylsp[-2]), (yyvsp[-2].str), (yyvsp[-1].token_list));
}
-#line 1817 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1917 "src/glsl/glcpp/glcpp-parse.c"
break;
case 13:
-#line 256 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 256 "src/glsl/glcpp/glcpp-parse.y"
+ {
_define_function_macro (parser, & (yylsp[-4]), (yyvsp[-4].str), NULL, (yyvsp[-1].token_list));
}
-#line 1825 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1925 "src/glsl/glcpp/glcpp-parse.c"
break;
case 14:
-#line 259 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 259 "src/glsl/glcpp/glcpp-parse.y"
+ {
_define_function_macro (parser, & (yylsp[-5]), (yyvsp[-5].str), (yyvsp[-3].string_list), (yyvsp[-1].token_list));
}
-#line 1833 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1933 "src/glsl/glcpp/glcpp-parse.c"
break;
case 15:
-#line 265 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 265 "src/glsl/glcpp/glcpp-parse.y"
+ {
ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "\n");
}
-#line 1841 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1941 "src/glsl/glcpp/glcpp-parse.c"
break;
case 17:
-#line 269 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 269 "src/glsl/glcpp/glcpp-parse.y"
+ {
glcpp_parser_resolve_implicit_version(parser);
}
-#line 1849 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1949 "src/glsl/glcpp/glcpp-parse.c"
break;
case 18:
-#line 271 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 271 "src/glsl/glcpp/glcpp-parse.y"
+ {
if (parser->skip_stack == NULL ||
parser->skip_stack->type == SKIP_NO_SKIP)
@@ -1860,28 +1960,28 @@ yyreduce:
EXPANSION_MODE_IGNORE_DEFINED);
}
}
-#line 1864 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1964 "src/glsl/glcpp/glcpp-parse.c"
break;
case 19:
-#line 284 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 284 "src/glsl/glcpp/glcpp-parse.y"
+ {
glcpp_parser_resolve_implicit_version(parser);
}
-#line 1872 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1972 "src/glsl/glcpp/glcpp-parse.c"
break;
case 21:
-#line 287 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 287 "src/glsl/glcpp/glcpp-parse.y"
+ {
glcpp_parser_resolve_implicit_version(parser);
}
-#line 1880 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 1980 "src/glsl/glcpp/glcpp-parse.c"
break;
case 22:
-#line 289 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 289 "src/glsl/glcpp/glcpp-parse.y"
+ {
macro_t *macro;
if (strcmp("__LINE__", (yyvsp[-1].str)) == 0
|| strcmp("__FILE__", (yyvsp[-1].str)) == 0
@@ -1896,20 +1996,20 @@ yyreduce:
}
ralloc_free ((yyvsp[-1].str));
}
-#line 1900 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2000 "src/glsl/glcpp/glcpp-parse.c"
break;
case 23:
-#line 304 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 304 "src/glsl/glcpp/glcpp-parse.y"
+ {
glcpp_parser_resolve_implicit_version(parser);
}
-#line 1908 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2008 "src/glsl/glcpp/glcpp-parse.c"
break;
case 24:
-#line 306 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 306 "src/glsl/glcpp/glcpp-parse.y"
+ {
/* Be careful to only evaluate the 'if' expression if
* we are not skipping. When we are skipping, we
* simply push a new 0-valued 'if' onto the skip
@@ -1930,12 +2030,12 @@ yyreduce:
parser->skip_stack->type = SKIP_TO_ENDIF;
}
}
-#line 1934 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2034 "src/glsl/glcpp/glcpp-parse.c"
break;
case 25:
-#line 327 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 327 "src/glsl/glcpp/glcpp-parse.y"
+ {
/* #if without an expression is only an error if we
* are not skipping */
if (parser->skip_stack == NULL ||
@@ -1945,48 +2045,48 @@ yyreduce:
}
_glcpp_parser_skip_stack_push_if (parser, & (yylsp[-2]), 0);
}
-#line 1949 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2049 "src/glsl/glcpp/glcpp-parse.c"
break;
case 26:
-#line 337 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 337 "src/glsl/glcpp/glcpp-parse.y"
+ {
glcpp_parser_resolve_implicit_version(parser);
}
-#line 1957 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2057 "src/glsl/glcpp/glcpp-parse.c"
break;
case 27:
-#line 339 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 339 "src/glsl/glcpp/glcpp-parse.y"
+ {
macro_t *macro = hash_table_find (parser->defines, (yyvsp[-2].str));
ralloc_free ((yyvsp[-2].str));
_glcpp_parser_skip_stack_push_if (parser, & (yylsp[-5]), macro != NULL);
}
-#line 1967 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2067 "src/glsl/glcpp/glcpp-parse.c"
break;
case 28:
-#line 344 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 344 "src/glsl/glcpp/glcpp-parse.y"
+ {
glcpp_parser_resolve_implicit_version(parser);
}
-#line 1975 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2075 "src/glsl/glcpp/glcpp-parse.c"
break;
case 29:
-#line 346 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 346 "src/glsl/glcpp/glcpp-parse.y"
+ {
macro_t *macro = hash_table_find (parser->defines, (yyvsp[-2].str));
ralloc_free ((yyvsp[-2].str));
_glcpp_parser_skip_stack_push_if (parser, & (yylsp[-3]), macro == NULL);
}
-#line 1985 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2085 "src/glsl/glcpp/glcpp-parse.c"
break;
case 30:
-#line 351 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 351 "src/glsl/glcpp/glcpp-parse.y"
+ {
/* Be careful to only evaluate the 'elif' expression
* if we are not skipping. When we are skipping, we
* simply change to a 0-valued 'elif' on the skip
@@ -2012,12 +2112,12 @@ yyreduce:
"elif", 0);
}
}
-#line 2016 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2116 "src/glsl/glcpp/glcpp-parse.c"
break;
case 31:
-#line 377 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 377 "src/glsl/glcpp/glcpp-parse.y"
+ {
/* #elif without an expression is an error unless we
* are skipping. */
if (parser->skip_stack &&
@@ -2037,18 +2137,18 @@ yyreduce:
glcpp_warning(& (yylsp[-2]), parser, "ignoring illegal #elif without expression");
}
}
-#line 2041 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2141 "src/glsl/glcpp/glcpp-parse.c"
break;
case 32:
-#line 397 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { parser->lexing_directive = 1; }
-#line 2047 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 397 "src/glsl/glcpp/glcpp-parse.y"
+ { parser->lexing_directive = 1; }
+#line 2147 "src/glsl/glcpp/glcpp-parse.c"
break;
case 33:
-#line 397 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 397 "src/glsl/glcpp/glcpp-parse.y"
+ {
if (parser->skip_stack &&
parser->skip_stack->has_else)
{
@@ -2061,82 +2161,82 @@ yyreduce:
parser->skip_stack->has_else = true;
}
}
-#line 2065 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2165 "src/glsl/glcpp/glcpp-parse.c"
break;
case 34:
-#line 410 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 410 "src/glsl/glcpp/glcpp-parse.y"
+ {
_glcpp_parser_skip_stack_pop (parser, & (yylsp[-1]));
}
-#line 2073 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2173 "src/glsl/glcpp/glcpp-parse.c"
break;
case 36:
-#line 413 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 413 "src/glsl/glcpp/glcpp-parse.y"
+ {
if (parser->version_resolved) {
glcpp_error(& (yylsp[-3]), parser, "#version must appear on the first line");
}
_glcpp_parser_handle_version_declaration(parser, (yyvsp[-1].ival), NULL, true);
}
-#line 2084 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2184 "src/glsl/glcpp/glcpp-parse.c"
break;
case 37:
-#line 419 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 419 "src/glsl/glcpp/glcpp-parse.y"
+ {
if (parser->version_resolved) {
glcpp_error(& (yylsp[-4]), parser, "#version must appear on the first line");
}
_glcpp_parser_handle_version_declaration(parser, (yyvsp[-2].ival), (yyvsp[-1].str), true);
}
-#line 2095 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2195 "src/glsl/glcpp/glcpp-parse.c"
break;
case 38:
-#line 425 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 425 "src/glsl/glcpp/glcpp-parse.y"
+ {
glcpp_parser_resolve_implicit_version(parser);
}
-#line 2103 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2203 "src/glsl/glcpp/glcpp-parse.c"
break;
case 39:
-#line 428 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 428 "src/glsl/glcpp/glcpp-parse.y"
+ {
ralloc_asprintf_rewrite_tail (&parser->output, &parser->output_length, "#%s", (yyvsp[-1].str));
}
-#line 2111 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2211 "src/glsl/glcpp/glcpp-parse.c"
break;
case 40:
-#line 434 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 434 "src/glsl/glcpp/glcpp-parse.y"
+ {
glcpp_error(& (yylsp[-2]), parser, "#%s", (yyvsp[-1].str));
}
-#line 2119 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2219 "src/glsl/glcpp/glcpp-parse.c"
break;
case 41:
-#line 437 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 437 "src/glsl/glcpp/glcpp-parse.y"
+ {
glcpp_error (& (yylsp[-2]), parser, "#define without macro name");
}
-#line 2127 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2227 "src/glsl/glcpp/glcpp-parse.c"
break;
case 42:
-#line 440 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 440 "src/glsl/glcpp/glcpp-parse.y"
+ {
glcpp_error (& (yylsp[-3]), parser, "Illegal non-directive after #");
}
-#line 2135 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2235 "src/glsl/glcpp/glcpp-parse.c"
break;
case 43:
-#line 446 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 446 "src/glsl/glcpp/glcpp-parse.y"
+ {
if (strlen ((yyvsp[0].str)) >= 3 && strncmp ((yyvsp[0].str), "0x", 2) == 0) {
(yyval.ival) = (int)strtoll ((yyvsp[0].str) + 2, NULL, 16);
} else if ((yyvsp[0].str)[0] == '0') {
@@ -2145,41 +2245,41 @@ yyreduce:
(yyval.ival) = (int)strtoll ((yyvsp[0].str), NULL, 10);
}
}
-#line 2149 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2249 "src/glsl/glcpp/glcpp-parse.c"
break;
case 44:
-#line 455 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 455 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.ival) = (yyvsp[0].ival);
}
-#line 2157 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2257 "src/glsl/glcpp/glcpp-parse.c"
break;
case 45:
-#line 460 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 460 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[0].ival);
(yyval.expression_value).undefined_macro = NULL;
}
-#line 2166 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2266 "src/glsl/glcpp/glcpp-parse.c"
break;
case 46:
-#line 464 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 464 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = 0;
if (parser->is_gles)
(yyval.expression_value).undefined_macro = ralloc_strdup (parser, (yyvsp[0].str));
else
(yyval.expression_value).undefined_macro = NULL;
}
-#line 2178 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2278 "src/glsl/glcpp/glcpp-parse.c"
break;
case 47:
-#line 471 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 471 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value || (yyvsp[0].expression_value).value;
/* Short-circuit: Only flag undefined from right side
@@ -2190,12 +2290,12 @@ yyreduce:
else if (! (yyvsp[-2].expression_value).value)
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2194 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2294 "src/glsl/glcpp/glcpp-parse.c"
break;
case 48:
-#line 482 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 482 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value && (yyvsp[0].expression_value).value;
/* Short-circuit: Only flag undefined from right-side
@@ -2206,168 +2306,168 @@ yyreduce:
else if ((yyvsp[-2].expression_value).value)
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2210 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2310 "src/glsl/glcpp/glcpp-parse.c"
break;
case 49:
-#line 493 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 493 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value | (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2222 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2322 "src/glsl/glcpp/glcpp-parse.c"
break;
case 50:
-#line 500 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 500 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value ^ (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2234 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2334 "src/glsl/glcpp/glcpp-parse.c"
break;
case 51:
-#line 507 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 507 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value & (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2246 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2346 "src/glsl/glcpp/glcpp-parse.c"
break;
case 52:
-#line 514 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 514 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value != (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2258 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2358 "src/glsl/glcpp/glcpp-parse.c"
break;
case 53:
-#line 521 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 521 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value == (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2270 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2370 "src/glsl/glcpp/glcpp-parse.c"
break;
case 54:
-#line 528 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 528 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value >= (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2282 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2382 "src/glsl/glcpp/glcpp-parse.c"
break;
case 55:
-#line 535 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 535 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value <= (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2294 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2394 "src/glsl/glcpp/glcpp-parse.c"
break;
case 56:
-#line 542 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 542 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value > (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2306 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2406 "src/glsl/glcpp/glcpp-parse.c"
break;
case 57:
-#line 549 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 549 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value < (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2318 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2418 "src/glsl/glcpp/glcpp-parse.c"
break;
case 58:
-#line 556 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 556 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value >> (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2330 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2430 "src/glsl/glcpp/glcpp-parse.c"
break;
case 59:
-#line 563 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 563 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value << (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2342 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2442 "src/glsl/glcpp/glcpp-parse.c"
break;
case 60:
-#line 570 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 570 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value - (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2354 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2454 "src/glsl/glcpp/glcpp-parse.c"
break;
case 61:
-#line 577 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 577 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value + (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2366 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2466 "src/glsl/glcpp/glcpp-parse.c"
break;
case 62:
-#line 584 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 584 "src/glsl/glcpp/glcpp-parse.y"
+ {
if ((yyvsp[0].expression_value).value == 0) {
yyerror (& (yylsp[-2]), parser,
"zero modulus in preprocessor directive");
@@ -2379,12 +2479,12 @@ yyreduce:
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2383 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2483 "src/glsl/glcpp/glcpp-parse.c"
break;
case 63:
-#line 596 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 596 "src/glsl/glcpp/glcpp-parse.y"
+ {
if ((yyvsp[0].expression_value).value == 0) {
yyerror (& (yylsp[-2]), parser,
"division by 0 in preprocessor directive");
@@ -2396,378 +2496,379 @@ yyreduce:
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2400 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2500 "src/glsl/glcpp/glcpp-parse.c"
break;
case 64:
-#line 608 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 608 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = (yyvsp[-2].expression_value).value * (yyvsp[0].expression_value).value;
if ((yyvsp[-2].expression_value).undefined_macro)
(yyval.expression_value).undefined_macro = (yyvsp[-2].expression_value).undefined_macro;
else
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2412 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2512 "src/glsl/glcpp/glcpp-parse.c"
break;
case 65:
-#line 615 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 615 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = ! (yyvsp[0].expression_value).value;
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2421 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2521 "src/glsl/glcpp/glcpp-parse.c"
break;
case 66:
-#line 619 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 619 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = ~ (yyvsp[0].expression_value).value;
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2430 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2530 "src/glsl/glcpp/glcpp-parse.c"
break;
case 67:
-#line 623 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 623 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = - (yyvsp[0].expression_value).value;
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2439 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2539 "src/glsl/glcpp/glcpp-parse.c"
break;
case 68:
-#line 627 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 627 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value).value = + (yyvsp[0].expression_value).value;
(yyval.expression_value).undefined_macro = (yyvsp[0].expression_value).undefined_macro;
}
-#line 2448 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2548 "src/glsl/glcpp/glcpp-parse.c"
break;
case 69:
-#line 631 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 631 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.expression_value) = (yyvsp[-1].expression_value);
}
-#line 2456 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2556 "src/glsl/glcpp/glcpp-parse.c"
break;
case 70:
-#line 637 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 637 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.string_list) = _string_list_create (parser);
_string_list_append_item ((yyval.string_list), (yyvsp[0].str));
ralloc_steal ((yyval.string_list), (yyvsp[0].str));
}
-#line 2466 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2566 "src/glsl/glcpp/glcpp-parse.c"
break;
case 71:
-#line 642 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 642 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.string_list) = (yyvsp[-2].string_list);
_string_list_append_item ((yyval.string_list), (yyvsp[0].str));
ralloc_steal ((yyval.string_list), (yyvsp[0].str));
}
-#line 2476 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2576 "src/glsl/glcpp/glcpp-parse.c"
break;
case 72:
-#line 650 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.token_list) = NULL; }
-#line 2482 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 650 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.token_list) = NULL; }
+#line 2582 "src/glsl/glcpp/glcpp-parse.c"
break;
case 74:
-#line 655 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.token_list) = NULL; }
-#line 2488 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 655 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.token_list) = NULL; }
+#line 2588 "src/glsl/glcpp/glcpp-parse.c"
break;
case 77:
-#line 661 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 661 "src/glsl/glcpp/glcpp-parse.y"
+ {
glcpp_error(&(yylsp[0]), parser, "extra tokens at end of directive");
}
-#line 2496 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2596 "src/glsl/glcpp/glcpp-parse.c"
break;
case 78:
-#line 667 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 667 "src/glsl/glcpp/glcpp-parse.y"
+ {
parser->space_tokens = 1;
(yyval.token_list) = _token_list_create (parser);
_token_list_append ((yyval.token_list), (yyvsp[0].token));
}
-#line 2506 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2606 "src/glsl/glcpp/glcpp-parse.c"
break;
case 79:
-#line 672 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 672 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.token_list) = (yyvsp[-1].token_list);
_token_list_append ((yyval.token_list), (yyvsp[0].token));
}
-#line 2515 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2615 "src/glsl/glcpp/glcpp-parse.c"
break;
case 80:
-#line 679 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 679 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.token) = _token_create_str (parser, IDENTIFIER, (yyvsp[0].str));
(yyval.token)->location = yylloc;
}
-#line 2524 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2624 "src/glsl/glcpp/glcpp-parse.c"
break;
case 81:
-#line 683 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 683 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.token) = _token_create_str (parser, INTEGER_STRING, (yyvsp[0].str));
(yyval.token)->location = yylloc;
}
-#line 2533 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2633 "src/glsl/glcpp/glcpp-parse.c"
break;
case 82:
-#line 687 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 687 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.token) = _token_create_ival (parser, (yyvsp[0].ival), (yyvsp[0].ival));
(yyval.token)->location = yylloc;
}
-#line 2542 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2642 "src/glsl/glcpp/glcpp-parse.c"
break;
case 83:
-#line 691 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 691 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.token) = _token_create_ival (parser, DEFINED, DEFINED);
(yyval.token)->location = yylloc;
}
-#line 2551 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2651 "src/glsl/glcpp/glcpp-parse.c"
break;
case 84:
-#line 695 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 695 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.token) = _token_create_str (parser, OTHER, (yyvsp[0].str));
(yyval.token)->location = yylloc;
}
-#line 2560 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2660 "src/glsl/glcpp/glcpp-parse.c"
break;
case 85:
-#line 699 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- {
+#line 699 "src/glsl/glcpp/glcpp-parse.y"
+ {
(yyval.token) = _token_create_ival (parser, SPACE, SPACE);
(yyval.token)->location = yylloc;
}
-#line 2569 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2669 "src/glsl/glcpp/glcpp-parse.c"
break;
case 86:
-#line 706 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '['; }
-#line 2575 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 706 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '['; }
+#line 2675 "src/glsl/glcpp/glcpp-parse.c"
break;
case 87:
-#line 707 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = ']'; }
-#line 2581 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 707 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = ']'; }
+#line 2681 "src/glsl/glcpp/glcpp-parse.c"
break;
case 88:
-#line 708 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '('; }
-#line 2587 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 708 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '('; }
+#line 2687 "src/glsl/glcpp/glcpp-parse.c"
break;
case 89:
-#line 709 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = ')'; }
-#line 2593 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 709 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = ')'; }
+#line 2693 "src/glsl/glcpp/glcpp-parse.c"
break;
case 90:
-#line 710 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '{'; }
-#line 2599 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 710 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '{'; }
+#line 2699 "src/glsl/glcpp/glcpp-parse.c"
break;
case 91:
-#line 711 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '}'; }
-#line 2605 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 711 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '}'; }
+#line 2705 "src/glsl/glcpp/glcpp-parse.c"
break;
case 92:
-#line 712 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '.'; }
-#line 2611 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 712 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '.'; }
+#line 2711 "src/glsl/glcpp/glcpp-parse.c"
break;
case 93:
-#line 713 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '&'; }
-#line 2617 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 713 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '&'; }
+#line 2717 "src/glsl/glcpp/glcpp-parse.c"
break;
case 94:
-#line 714 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '*'; }
-#line 2623 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 714 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '*'; }
+#line 2723 "src/glsl/glcpp/glcpp-parse.c"
break;
case 95:
-#line 715 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '+'; }
-#line 2629 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 715 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '+'; }
+#line 2729 "src/glsl/glcpp/glcpp-parse.c"
break;
case 96:
-#line 716 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '-'; }
-#line 2635 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 716 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '-'; }
+#line 2735 "src/glsl/glcpp/glcpp-parse.c"
break;
case 97:
-#line 717 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '~'; }
-#line 2641 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 717 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '~'; }
+#line 2741 "src/glsl/glcpp/glcpp-parse.c"
break;
case 98:
-#line 718 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '!'; }
-#line 2647 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 718 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '!'; }
+#line 2747 "src/glsl/glcpp/glcpp-parse.c"
break;
case 99:
-#line 719 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '/'; }
-#line 2653 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 719 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '/'; }
+#line 2753 "src/glsl/glcpp/glcpp-parse.c"
break;
case 100:
-#line 720 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '%'; }
-#line 2659 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 720 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '%'; }
+#line 2759 "src/glsl/glcpp/glcpp-parse.c"
break;
case 101:
-#line 721 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = LEFT_SHIFT; }
-#line 2665 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 721 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = LEFT_SHIFT; }
+#line 2765 "src/glsl/glcpp/glcpp-parse.c"
break;
case 102:
-#line 722 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = RIGHT_SHIFT; }
-#line 2671 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 722 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = RIGHT_SHIFT; }
+#line 2771 "src/glsl/glcpp/glcpp-parse.c"
break;
case 103:
-#line 723 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '<'; }
-#line 2677 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 723 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '<'; }
+#line 2777 "src/glsl/glcpp/glcpp-parse.c"
break;
case 104:
-#line 724 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '>'; }
-#line 2683 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 724 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '>'; }
+#line 2783 "src/glsl/glcpp/glcpp-parse.c"
break;
case 105:
-#line 725 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = LESS_OR_EQUAL; }
-#line 2689 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 725 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = LESS_OR_EQUAL; }
+#line 2789 "src/glsl/glcpp/glcpp-parse.c"
break;
case 106:
-#line 726 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = GREATER_OR_EQUAL; }
-#line 2695 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 726 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = GREATER_OR_EQUAL; }
+#line 2795 "src/glsl/glcpp/glcpp-parse.c"
break;
case 107:
-#line 727 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = EQUAL; }
-#line 2701 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 727 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = EQUAL; }
+#line 2801 "src/glsl/glcpp/glcpp-parse.c"
break;
case 108:
-#line 728 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = NOT_EQUAL; }
-#line 2707 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 728 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = NOT_EQUAL; }
+#line 2807 "src/glsl/glcpp/glcpp-parse.c"
break;
case 109:
-#line 729 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '^'; }
-#line 2713 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 729 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '^'; }
+#line 2813 "src/glsl/glcpp/glcpp-parse.c"
break;
case 110:
-#line 730 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '|'; }
-#line 2719 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 730 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '|'; }
+#line 2819 "src/glsl/glcpp/glcpp-parse.c"
break;
case 111:
-#line 731 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = AND; }
-#line 2725 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 731 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = AND; }
+#line 2825 "src/glsl/glcpp/glcpp-parse.c"
break;
case 112:
-#line 732 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = OR; }
-#line 2731 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 732 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = OR; }
+#line 2831 "src/glsl/glcpp/glcpp-parse.c"
break;
case 113:
-#line 733 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = ';'; }
-#line 2737 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 733 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = ';'; }
+#line 2837 "src/glsl/glcpp/glcpp-parse.c"
break;
case 114:
-#line 734 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = ','; }
-#line 2743 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 734 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = ','; }
+#line 2843 "src/glsl/glcpp/glcpp-parse.c"
break;
case 115:
-#line 735 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = '='; }
-#line 2749 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 735 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = '='; }
+#line 2849 "src/glsl/glcpp/glcpp-parse.c"
break;
case 116:
-#line 736 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = PASTE; }
-#line 2755 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 736 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = PASTE; }
+#line 2855 "src/glsl/glcpp/glcpp-parse.c"
break;
case 117:
-#line 737 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = PLUS_PLUS; }
-#line 2761 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 737 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = PLUS_PLUS; }
+#line 2861 "src/glsl/glcpp/glcpp-parse.c"
break;
case 118:
-#line 738 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1646 */
- { (yyval.ival) = MINUS_MINUS; }
-#line 2767 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 738 "src/glsl/glcpp/glcpp-parse.y"
+ { (yyval.ival) = MINUS_MINUS; }
+#line 2867 "src/glsl/glcpp/glcpp-parse.c"
break;
-#line 2771 "src/glsl/glcpp/glcpp-parse.c" /* yacc.c:1646 */
+#line 2871 "src/glsl/glcpp/glcpp-parse.c"
+
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -2793,14 +2894,13 @@ yyreduce:
/* Now 'shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
+ {
+ const int yylhs = yyr1[yyn] - YYNTOKENS;
+ const int yyi = yypgoto[yylhs] + *yyssp;
+ yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
+ ? yytable[yyi]
+ : yydefgoto[yylhs]);
+ }
goto yynewstate;
@@ -2832,7 +2932,7 @@ yyerrlab:
{
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+ yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
if (!yymsg)
{
yymsg = yymsgbuf;
@@ -2883,14 +2983,11 @@ yyerrlab:
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
+ /* Pacify compilers when the user code never invokes YYERROR and the
+ label yyerrorlab therefore never appears in user code. */
+ if (0)
+ YYERROR;
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (/*CONSTCOND*/ 0)
- goto yyerrorlab;
-
- yyerror_range[1] = yylsp[1-yylen];
/* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
YYPOPSTACK (yylen);
@@ -2956,6 +3053,7 @@ yyacceptlab:
yyresult = 0;
goto yyreturn;
+
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
@@ -2963,6 +3061,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
+
#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
@@ -2973,6 +3072,10 @@ yyexhaustedlab:
/* Fall through. */
#endif
+
+/*-----------------------------------------------------.
+| yyreturn -- parsing is finished, return the result. |
+`-----------------------------------------------------*/
yyreturn:
if (yychar != YYEMPTY)
{
@@ -2989,7 +3092,7 @@ yyreturn:
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp, yylsp, parser);
+ yystos[+*yyssp], yyvsp, yylsp, parser);
YYPOPSTACK (1);
}
#ifndef yyoverflow
@@ -3002,7 +3105,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 741 "src/glsl/glcpp/glcpp-parse.y" /* yacc.c:1906 */
+#line 741 "src/glsl/glcpp/glcpp-parse.y"
string_list_t *
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.h b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.h
index df00257780c..9e3c96db6dd 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.h
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-parse.h
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 3.5.1. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
+ Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,6 +31,9 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
+/* Undocumented macros, especially those whose name start with YY_,
+ are private implementation details. Do not rely on them. */
+
#ifndef YY_GLCPP_PARSER_SRC_GLSL_GLCPP_GLCPP_PARSE_H_INCLUDED
# define YY_GLCPP_PARSER_SRC_GLSL_GLCPP_GLCPP_PARSE_H_INCLUDED
/* Debug traces. */
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.cpp
index cfa582f3cdc..99e2c38280d 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_lexer.cpp
@@ -8,12 +8,246 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 5
-#define YY_FLEX_SUBMINOR_VERSION 35
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 4
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
+#ifdef yy_create_buffer
+#define _mesa_glsl_lexer__create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer _mesa_glsl_lexer__create_buffer
+#endif
+
+#ifdef yy_delete_buffer
+#define _mesa_glsl_lexer__delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer _mesa_glsl_lexer__delete_buffer
+#endif
+
+#ifdef yy_scan_buffer
+#define _mesa_glsl_lexer__scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer _mesa_glsl_lexer__scan_buffer
+#endif
+
+#ifdef yy_scan_string
+#define _mesa_glsl_lexer__scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string _mesa_glsl_lexer__scan_string
+#endif
+
+#ifdef yy_scan_bytes
+#define _mesa_glsl_lexer__scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes _mesa_glsl_lexer__scan_bytes
+#endif
+
+#ifdef yy_init_buffer
+#define _mesa_glsl_lexer__init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer _mesa_glsl_lexer__init_buffer
+#endif
+
+#ifdef yy_flush_buffer
+#define _mesa_glsl_lexer__flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer _mesa_glsl_lexer__flush_buffer
+#endif
+
+#ifdef yy_load_buffer_state
+#define _mesa_glsl_lexer__load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state _mesa_glsl_lexer__load_buffer_state
+#endif
+
+#ifdef yy_switch_to_buffer
+#define _mesa_glsl_lexer__switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer _mesa_glsl_lexer__switch_to_buffer
+#endif
+
+#ifdef yypush_buffer_state
+#define _mesa_glsl_lexer_push_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state _mesa_glsl_lexer_push_buffer_state
+#endif
+
+#ifdef yypop_buffer_state
+#define _mesa_glsl_lexer_pop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state _mesa_glsl_lexer_pop_buffer_state
+#endif
+
+#ifdef yyensure_buffer_stack
+#define _mesa_glsl_lexer_ensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack _mesa_glsl_lexer_ensure_buffer_stack
+#endif
+
+#ifdef yylex
+#define _mesa_glsl_lexer_lex_ALREADY_DEFINED
+#else
+#define yylex _mesa_glsl_lexer_lex
+#endif
+
+#ifdef yyrestart
+#define _mesa_glsl_lexer_restart_ALREADY_DEFINED
+#else
+#define yyrestart _mesa_glsl_lexer_restart
+#endif
+
+#ifdef yylex_init
+#define _mesa_glsl_lexer_lex_init_ALREADY_DEFINED
+#else
+#define yylex_init _mesa_glsl_lexer_lex_init
+#endif
+
+#ifdef yylex_init_extra
+#define _mesa_glsl_lexer_lex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra _mesa_glsl_lexer_lex_init_extra
+#endif
+
+#ifdef yylex_destroy
+#define _mesa_glsl_lexer_lex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy _mesa_glsl_lexer_lex_destroy
+#endif
+
+#ifdef yyget_debug
+#define _mesa_glsl_lexer_get_debug_ALREADY_DEFINED
+#else
+#define yyget_debug _mesa_glsl_lexer_get_debug
+#endif
+
+#ifdef yyset_debug
+#define _mesa_glsl_lexer_set_debug_ALREADY_DEFINED
+#else
+#define yyset_debug _mesa_glsl_lexer_set_debug
+#endif
+
+#ifdef yyget_extra
+#define _mesa_glsl_lexer_get_extra_ALREADY_DEFINED
+#else
+#define yyget_extra _mesa_glsl_lexer_get_extra
+#endif
+
+#ifdef yyset_extra
+#define _mesa_glsl_lexer_set_extra_ALREADY_DEFINED
+#else
+#define yyset_extra _mesa_glsl_lexer_set_extra
+#endif
+
+#ifdef yyget_in
+#define _mesa_glsl_lexer_get_in_ALREADY_DEFINED
+#else
+#define yyget_in _mesa_glsl_lexer_get_in
+#endif
+
+#ifdef yyset_in
+#define _mesa_glsl_lexer_set_in_ALREADY_DEFINED
+#else
+#define yyset_in _mesa_glsl_lexer_set_in
+#endif
+
+#ifdef yyget_out
+#define _mesa_glsl_lexer_get_out_ALREADY_DEFINED
+#else
+#define yyget_out _mesa_glsl_lexer_get_out
+#endif
+
+#ifdef yyset_out
+#define _mesa_glsl_lexer_set_out_ALREADY_DEFINED
+#else
+#define yyset_out _mesa_glsl_lexer_set_out
+#endif
+
+#ifdef yyget_leng
+#define _mesa_glsl_lexer_get_leng_ALREADY_DEFINED
+#else
+#define yyget_leng _mesa_glsl_lexer_get_leng
+#endif
+
+#ifdef yyget_text
+#define _mesa_glsl_lexer_get_text_ALREADY_DEFINED
+#else
+#define yyget_text _mesa_glsl_lexer_get_text
+#endif
+
+#ifdef yyget_lineno
+#define _mesa_glsl_lexer_get_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno _mesa_glsl_lexer_get_lineno
+#endif
+
+#ifdef yyset_lineno
+#define _mesa_glsl_lexer_set_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno _mesa_glsl_lexer_set_lineno
+#endif
+
+#ifdef yyget_column
+#define _mesa_glsl_lexer_get_column_ALREADY_DEFINED
+#else
+#define yyget_column _mesa_glsl_lexer_get_column
+#endif
+
+#ifdef yyset_column
+#define _mesa_glsl_lexer_set_column_ALREADY_DEFINED
+#else
+#define yyset_column _mesa_glsl_lexer_set_column
+#endif
+
+#ifdef yywrap
+#define _mesa_glsl_lexer_wrap_ALREADY_DEFINED
+#else
+#define yywrap _mesa_glsl_lexer_wrap
+#endif
+
+#ifdef yyget_lval
+#define _mesa_glsl_lexer_get_lval_ALREADY_DEFINED
+#else
+#define yyget_lval _mesa_glsl_lexer_get_lval
+#endif
+
+#ifdef yyset_lval
+#define _mesa_glsl_lexer_set_lval_ALREADY_DEFINED
+#else
+#define yyset_lval _mesa_glsl_lexer_set_lval
+#endif
+
+#ifdef yyget_lloc
+#define _mesa_glsl_lexer_get_lloc_ALREADY_DEFINED
+#else
+#define yyget_lloc _mesa_glsl_lexer_get_lloc
+#endif
+
+#ifdef yyset_lloc
+#define _mesa_glsl_lexer_set_lloc_ALREADY_DEFINED
+#else
+#define yyset_lloc _mesa_glsl_lexer_set_lloc
+#endif
+
+#ifdef yyalloc
+#define _mesa_glsl_lexer_alloc_ALREADY_DEFINED
+#else
+#define yyalloc _mesa_glsl_lexer_alloc
+#endif
+
+#ifdef yyrealloc
+#define _mesa_glsl_lexer_realloc_ALREADY_DEFINED
+#else
+#define yyrealloc _mesa_glsl_lexer_realloc
+#endif
+
+#ifdef yyfree
+#define _mesa_glsl_lexer_free_ALREADY_DEFINED
+#else
+#define yyfree _mesa_glsl_lexer_free
+#endif
+
/* First, we deal with platform-specific or compiler-specific issues. */
/* begin standard C headers. */
@@ -84,40 +318,32 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif
+#ifndef SIZE_MAX
+#define SIZE_MAX (~(size_t)0)
+#endif
+
#endif /* ! C99 */
#endif /* ! FLEXINT_H */
-#ifdef __cplusplus
-
-/* The "const" storage-class-modifier is valid. */
-#define YY_USE_CONST
+/* begin standard C++ headers. */
-#else /* ! __cplusplus */
-
-/* C99 requires __STDC__ to be defined as 1. */
-#if defined (__STDC__)
-
-#define YY_USE_CONST
-
-#endif /* defined (__STDC__) */
-#endif /* ! __cplusplus */
-
-#ifdef YY_USE_CONST
+/* TODO: this is always defined, so inline it */
#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
#else
-#define yyconst
+#define yynoreturn
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
-/* Promotes a possibly negative, possibly signed char to an unsigned
- * integer for use as an array index. If the signed char is negative,
- * we want to instead treat it as an 8-bit unsigned char, hence the
- * double cast.
+/* Promotes a possibly negative, possibly signed char to an
+ * integer in range [0..255] for use as an array index.
*/
-#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
/* An opaque pointer. */
#ifndef YY_TYPEDEF_YY_SCANNER_T
@@ -141,20 +367,16 @@ typedef void* yyscan_t;
* definition of BEGIN.
*/
#define BEGIN yyg->yy_start = 1 + 2 *
-
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yyg->yy_start - 1) / 2)
#define YYSTATE YY_START
-
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-
/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE _mesa_glsl_lexer_restart(yyin ,yyscanner )
-
+#define YY_NEW_FILE yyrestart( yyin , yyscanner )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
@@ -179,11 +401,17 @@ typedef void* yyscan_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
-
+
#define YY_LESS_LINENO(n)
+ #define YY_LINENO_REWIND_TO(ptr)
/* Return all but the first "n" matched characters back to the input stream. */
#define yyless(n) \
@@ -198,14 +426,8 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )
-
#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
@@ -218,7 +440,7 @@ struct yy_buffer_state
/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
- yy_size_t yy_buf_size;
+ int yy_buf_size;
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
@@ -246,7 +468,7 @@ struct yy_buffer_state
int yy_bs_lineno; /**< The line count. */
int yy_bs_column; /**< The column count. */
-
+
/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
@@ -263,7 +485,7 @@ struct yy_buffer_state
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
- * (via _mesa_glsl_lexer_restart()), so that the user can continue scanning by
+ * (via yyrestart()), so that the user can continue scanning by
* just pointing yyin at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
@@ -280,84 +502,77 @@ struct yy_buffer_state
#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
: NULL)
-
/* Same as previous macro, but useful when we know that the buffer stack is not
* NULL or when we need an lvalue. For internal use only.
*/
#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-void _mesa_glsl_lexer_restart (FILE *input_file ,yyscan_t yyscanner );
-void _mesa_glsl_lexer__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-YY_BUFFER_STATE _mesa_glsl_lexer__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
-void _mesa_glsl_lexer__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void _mesa_glsl_lexer__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
-void _mesa_glsl_lexer_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
-void _mesa_glsl_lexer_pop_buffer_state (yyscan_t yyscanner );
-
-static void _mesa_glsl_lexer_ensure_buffer_stack (yyscan_t yyscanner );
-static void _mesa_glsl_lexer__load_buffer_state (yyscan_t yyscanner );
-static void _mesa_glsl_lexer__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
-
-#define YY_FLUSH_BUFFER _mesa_glsl_lexer__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
-YY_BUFFER_STATE _mesa_glsl_lexer__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
-YY_BUFFER_STATE _mesa_glsl_lexer__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE _mesa_glsl_lexer__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+static void yyensure_buffer_stack ( yyscan_t yyscanner );
+static void yy_load_buffer_state ( yyscan_t yyscanner );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
-void *_mesa_glsl_lexer_alloc (yy_size_t ,yyscan_t yyscanner );
-void *_mesa_glsl_lexer_realloc (void *,yy_size_t ,yyscan_t yyscanner );
-void _mesa_glsl_lexer_free (void * ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
-#define yy_new_buffer _mesa_glsl_lexer__create_buffer
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
+#define yy_new_buffer yy_create_buffer
#define yy_set_interactive(is_interactive) \
{ \
if ( ! YY_CURRENT_BUFFER ){ \
- _mesa_glsl_lexer_ensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- _mesa_glsl_lexer__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
}
-
#define yy_set_bol(at_bol) \
{ \
if ( ! YY_CURRENT_BUFFER ){\
- _mesa_glsl_lexer_ensure_buffer_stack (yyscanner); \
+ yyensure_buffer_stack (yyscanner); \
YY_CURRENT_BUFFER_LVALUE = \
- _mesa_glsl_lexer__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
} \
YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
}
-
#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
/* Begin user sect3 */
-#define _mesa_glsl_lexer_wrap(n) 1
+#define _mesa_glsl_lexer_wrap(yyscanner) (/*CONSTCOND*/1)
#define YY_SKIP_YYWRAP
-
-typedef unsigned char YY_CHAR;
+typedef flex_uint8_t YY_CHAR;
typedef int yy_state_type;
#define yytext_ptr yytext_r
-static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
-static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
-static int yy_get_next_buffer (yyscan_t yyscanner );
-static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
+static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state , yyscan_t yyscanner);
+static int yy_get_next_buffer ( yyscan_t yyscanner );
+static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
yyg->yytext_ptr = yy_bp; \
- yyleng = (size_t) (yy_cp - yy_bp); \
+ yyleng = (int) (yy_cp - yy_bp); \
yyg->yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-
#define YY_NUM_RULES 248
#define YY_END_OF_BUFFER 249
/* This struct is not used in this scanner,
@@ -367,7 +582,7 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[1009] =
+static const flex_int16_t yy_accept[1009] =
{ 0,
0, 0, 16, 16, 0, 0, 249, 247, 1, 22,
247, 247, 247, 247, 247, 247, 247, 247, 176, 174,
@@ -482,7 +697,7 @@ static yyconst flex_int16_t yy_accept[1009] =
0, 0, 0, 0, 0, 0, 11, 0
} ;
-static yyconst flex_int32_t yy_ec[256] =
+static const YY_CHAR yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
@@ -514,7 +729,7 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst flex_int32_t yy_meta[71] =
+static const YY_CHAR yy_meta[71] =
{ 0,
1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 3, 3, 3, 3, 3,
@@ -525,7 +740,7 @@ static yyconst flex_int32_t yy_meta[71] =
5, 5, 5, 5, 5, 5, 5, 5, 5, 1
} ;
-static yyconst flex_int16_t yy_base[1019] =
+static const flex_int16_t yy_base[1019] =
{ 0,
0, 69, 75, 145, 1378, 1377, 1379, 1382, 70, 1382,
1353, 1352, 94, 1351, 91, 92, 90, 1350, 202, 256,
@@ -641,7 +856,7 @@ static yyconst flex_int16_t yy_base[1019] =
892, 895, 846, 847, 898, 902, 905, 907
} ;
-static yyconst flex_int16_t yy_def[1019] =
+static const flex_int16_t yy_def[1019] =
{ 0,
1008, 1, 1009, 1009, 1010, 1010, 1008, 1008, 1008, 1008,
1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008,
@@ -757,7 +972,7 @@ static yyconst flex_int16_t yy_def[1019] =
1008, 1008, 1008, 1008, 1008, 1008, 1008, 1008
} ;
-static yyconst flex_int16_t yy_nxt[1453] =
+static const flex_int16_t yy_nxt[1453] =
{ 0,
8, 9, 10, 9, 11, 8, 12, 13, 8, 8,
14, 15, 16, 17, 18, 19, 20, 20, 20, 20,
@@ -921,7 +1136,7 @@ static yyconst flex_int16_t yy_nxt[1453] =
1008, 1008
} ;
-static yyconst flex_int16_t yy_chk[1453] =
+static const flex_int16_t yy_chk[1453] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -1247,11 +1462,13 @@ literal_integer(char *text, int len, struct _mesa_glsl_parse_state *state,
#define LITERAL_INTEGER(base) \
literal_integer(yytext, yyleng, yyextra, yylval, yylloc, base)
-/* Note: When adding any start conditions to this list, you must also
-* update the "Internal compiler error" catch-all rule near the end of
-* this file. */
+#line 1466 "src/glsl/glsl_lexer.cpp"
+#line 165 "src/glsl/glsl_lexer.ll"
+ /* Note: When adding any start conditions to this list, you must also
+ * update the "Internal compiler error" catch-all rule near the end of
+ * this file. */
-#line 1255 "src/glsl/glsl_lexer.cpp"
+#line 1472 "src/glsl/glsl_lexer.cpp"
#define INITIAL 0
#define PP 1
@@ -1297,7 +1514,7 @@ struct yyguts_t
}; /* end struct yyguts_t */
-static int yy_init_globals (yyscan_t yyscanner );
+static int yy_init_globals ( yyscan_t yyscanner );
/* This must go here because YYSTYPE and YYLTYPE are included
* from bison output in section 1.*/
@@ -1305,46 +1522,50 @@ static int yy_init_globals (yyscan_t yyscanner );
# define yylloc yyg->yylloc_r
-int _mesa_glsl_lexer_lex_init (yyscan_t* scanner);
+int yylex_init (yyscan_t* scanner);
-int _mesa_glsl_lexer_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
/* Accessor methods to globals.
These are made visible to non-reentrant scanners for convenience. */
-int _mesa_glsl_lexer_lex_destroy (yyscan_t yyscanner );
+int yylex_destroy ( yyscan_t yyscanner );
+
+int yyget_debug ( yyscan_t yyscanner );
-int _mesa_glsl_lexer_get_debug (yyscan_t yyscanner );
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
-void _mesa_glsl_lexer_set_debug (int debug_flag ,yyscan_t yyscanner );
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
-YY_EXTRA_TYPE _mesa_glsl_lexer_get_extra (yyscan_t yyscanner );
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
-void _mesa_glsl_lexer_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+FILE *yyget_in ( yyscan_t yyscanner );
-FILE *_mesa_glsl_lexer_get_in (yyscan_t yyscanner );
+void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
-void _mesa_glsl_lexer_set_in (FILE * in_str ,yyscan_t yyscanner );
+FILE *yyget_out ( yyscan_t yyscanner );
-FILE *_mesa_glsl_lexer_get_out (yyscan_t yyscanner );
+void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
-void _mesa_glsl_lexer_set_out (FILE * out_str ,yyscan_t yyscanner );
+ int yyget_leng ( yyscan_t yyscanner );
-int _mesa_glsl_lexer_get_leng (yyscan_t yyscanner );
+char *yyget_text ( yyscan_t yyscanner );
-char *_mesa_glsl_lexer_get_text (yyscan_t yyscanner );
+int yyget_lineno ( yyscan_t yyscanner );
-int _mesa_glsl_lexer_get_lineno (yyscan_t yyscanner );
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
-void _mesa_glsl_lexer_set_lineno (int line_number ,yyscan_t yyscanner );
+int yyget_column ( yyscan_t yyscanner );
-YYSTYPE * _mesa_glsl_lexer_get_lval (yyscan_t yyscanner );
+void yyset_column ( int _column_no , yyscan_t yyscanner );
-void _mesa_glsl_lexer_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
+YYSTYPE * yyget_lval ( yyscan_t yyscanner );
- YYLTYPE *_mesa_glsl_lexer_get_lloc (yyscan_t yyscanner );
+void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
+
+ YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
- void _mesa_glsl_lexer_set_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner );
+ void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
/* Macros after this point can all be overridden by user definitions in
* section 1.
@@ -1352,26 +1573,29 @@ void _mesa_glsl_lexer_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
#ifndef YY_SKIP_YYWRAP
#ifdef __cplusplus
-extern "C" int _mesa_glsl_lexer_wrap (yyscan_t yyscanner );
+extern "C" int yywrap ( yyscan_t yyscanner );
#else
-extern int _mesa_glsl_lexer_wrap (yyscan_t yyscanner );
+extern int yywrap ( yyscan_t yyscanner );
#endif
#endif
+#ifndef YY_NO_UNPUT
+
+#endif
+
#ifndef yytext_ptr
-static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
#endif
#ifndef YY_NO_INPUT
-
#ifdef __cplusplus
-static int yyinput (yyscan_t yyscanner );
+static int yyinput ( yyscan_t yyscanner );
#else
-static int input (yyscan_t yyscanner );
+static int input ( yyscan_t yyscanner );
#endif
#endif
@@ -1391,7 +1615,7 @@ static int input (yyscan_t yyscanner );
/* This used to be an fputs(), but since the string might contain NUL's,
* we now use fwrite().
*/
-#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
#endif
/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
@@ -1402,7 +1626,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
- size_t n; \
+ int n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
@@ -1415,7 +1639,7 @@ static int input (yyscan_t yyscanner );
else \
{ \
errno=0; \
- while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
{ \
if( errno != EINTR) \
{ \
@@ -1456,10 +1680,10 @@ static int input (yyscan_t yyscanner );
#ifndef YY_DECL
#define YY_DECL_IS_OURS 1
-extern int _mesa_glsl_lexer_lex \
- (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner);
+extern int yylex \
+ (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
-#define YY_DECL int _mesa_glsl_lexer_lex \
+#define YY_DECL int yylex \
(YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
#endif /* !YY_DECL */
@@ -1472,7 +1696,7 @@ extern int _mesa_glsl_lexer_lex \
/* Code executed at the end of each rule. */
#ifndef YY_BREAK
-#define YY_BREAK break;
+#define YY_BREAK /*LINTED*/break;
#endif
#define YY_RULE_SETUP \
@@ -1485,16 +1709,11 @@ extern int _mesa_glsl_lexer_lex \
*/
YY_DECL
{
- register yy_state_type yy_current_state;
- register char *yy_cp, *yy_bp;
- register int yy_act;
+ yy_state_type yy_current_state;
+ char *yy_cp, *yy_bp;
+ int yy_act;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-#line 176 "src/glsl/glsl_lexer.ll"
-
-
-#line 1497 "src/glsl/glsl_lexer.cpp"
-
yylval = yylval_param;
yylloc = yylloc_param;
@@ -1517,15 +1736,21 @@ YY_DECL
yyout = stdout;
if ( ! YY_CURRENT_BUFFER ) {
- _mesa_glsl_lexer_ensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- _mesa_glsl_lexer__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- _mesa_glsl_lexer__load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
- while ( 1 ) /* loops until end-of-file is reached */
+ {
+#line 177 "src/glsl/glsl_lexer.ll"
+
+
+#line 1752 "src/glsl/glsl_lexer.cpp"
+
+ while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */
{
yy_cp = yyg->yy_c_buf_p;
@@ -1542,7 +1767,7 @@ YY_DECL
yy_match:
do
{
- register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
@@ -1552,9 +1777,9 @@ yy_match:
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 1009 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
++yy_cp;
}
while ( yy_current_state != 1008 );
@@ -1579,7 +1804,7 @@ do_action: /* This label is used only to access EOF actions. */
case 1:
YY_RULE_SETUP
-#line 178 "src/glsl/glsl_lexer.ll"
+#line 179 "src/glsl/glsl_lexer.ll"
;
YY_BREAK
/* Preprocessor tokens. */
@@ -1588,17 +1813,17 @@ case 2:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 181 "src/glsl/glsl_lexer.ll"
+#line 182 "src/glsl/glsl_lexer.ll"
;
YY_BREAK
case 3:
YY_RULE_SETUP
-#line 182 "src/glsl/glsl_lexer.ll"
+#line 183 "src/glsl/glsl_lexer.ll"
{ BEGIN PP; return VERSION_TOK; }
YY_BREAK
case 4:
YY_RULE_SETUP
-#line 183 "src/glsl/glsl_lexer.ll"
+#line 184 "src/glsl/glsl_lexer.ll"
{ BEGIN PP; return EXTENSION; }
YY_BREAK
case 5:
@@ -1606,7 +1831,7 @@ case 5:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 184 "src/glsl/glsl_lexer.ll"
+#line 185 "src/glsl/glsl_lexer.ll"
{
/* Eat characters until the first digit is
* encountered
@@ -1628,7 +1853,7 @@ case 6:
yyg->yy_c_buf_p = yy_cp -= 1;
YY_DO_BEFORE_ACTION; /* set up yytext again */
YY_RULE_SETUP
-#line 199 "src/glsl/glsl_lexer.ll"
+#line 200 "src/glsl/glsl_lexer.ll"
{
/* Eat characters until the first digit is
* encountered
@@ -1646,7 +1871,7 @@ YY_RULE_SETUP
YY_BREAK
case 7:
YY_RULE_SETUP
-#line 213 "src/glsl/glsl_lexer.ll"
+#line 214 "src/glsl/glsl_lexer.ll"
{
BEGIN PP;
return PRAGMA_DEBUG_ON;
@@ -1654,7 +1879,7 @@ YY_RULE_SETUP
YY_BREAK
case 8:
YY_RULE_SETUP
-#line 217 "src/glsl/glsl_lexer.ll"
+#line 218 "src/glsl/glsl_lexer.ll"
{
BEGIN PP;
return PRAGMA_DEBUG_OFF;
@@ -1662,7 +1887,7 @@ YY_RULE_SETUP
YY_BREAK
case 9:
YY_RULE_SETUP
-#line 221 "src/glsl/glsl_lexer.ll"
+#line 222 "src/glsl/glsl_lexer.ll"
{
BEGIN PP;
return PRAGMA_OPTIMIZE_ON;
@@ -1670,7 +1895,7 @@ YY_RULE_SETUP
YY_BREAK
case 10:
YY_RULE_SETUP
-#line 225 "src/glsl/glsl_lexer.ll"
+#line 226 "src/glsl/glsl_lexer.ll"
{
BEGIN PP;
return PRAGMA_OPTIMIZE_OFF;
@@ -1678,7 +1903,7 @@ YY_RULE_SETUP
YY_BREAK
case 11:
YY_RULE_SETUP
-#line 229 "src/glsl/glsl_lexer.ll"
+#line 230 "src/glsl/glsl_lexer.ll"
{
BEGIN PP;
return PRAGMA_INVARIANT_ALL;
@@ -1686,38 +1911,38 @@ YY_RULE_SETUP
YY_BREAK
case 12:
YY_RULE_SETUP
-#line 233 "src/glsl/glsl_lexer.ll"
+#line 234 "src/glsl/glsl_lexer.ll"
{ BEGIN PRAGMA; }
YY_BREAK
case 13:
/* rule 13 can match eol */
YY_RULE_SETUP
-#line 235 "src/glsl/glsl_lexer.ll"
+#line 236 "src/glsl/glsl_lexer.ll"
{ BEGIN 0; yylineno++; yycolumn = 0; }
YY_BREAK
case 14:
YY_RULE_SETUP
-#line 236 "src/glsl/glsl_lexer.ll"
+#line 237 "src/glsl/glsl_lexer.ll"
{ }
YY_BREAK
case 15:
YY_RULE_SETUP
-#line 238 "src/glsl/glsl_lexer.ll"
+#line 239 "src/glsl/glsl_lexer.ll"
{ }
YY_BREAK
case 16:
YY_RULE_SETUP
-#line 239 "src/glsl/glsl_lexer.ll"
+#line 240 "src/glsl/glsl_lexer.ll"
{ }
YY_BREAK
case 17:
YY_RULE_SETUP
-#line 240 "src/glsl/glsl_lexer.ll"
+#line 241 "src/glsl/glsl_lexer.ll"
return COLON;
YY_BREAK
case 18:
YY_RULE_SETUP
-#line 241 "src/glsl/glsl_lexer.ll"
+#line 242 "src/glsl/glsl_lexer.ll"
{
void *mem_ctx = yyextra;
yylval->identifier = ralloc_strdup(mem_ctx, yytext);
@@ -1726,7 +1951,7 @@ YY_RULE_SETUP
YY_BREAK
case 19:
YY_RULE_SETUP
-#line 246 "src/glsl/glsl_lexer.ll"
+#line 247 "src/glsl/glsl_lexer.ll"
{
yylval->n = strtol(yytext, NULL, 10);
return INTCONSTANT;
@@ -1735,436 +1960,436 @@ YY_RULE_SETUP
case 20:
/* rule 20 can match eol */
YY_RULE_SETUP
-#line 250 "src/glsl/glsl_lexer.ll"
+#line 251 "src/glsl/glsl_lexer.ll"
{ BEGIN 0; yylineno++; yycolumn = 0; return EOL; }
YY_BREAK
case 21:
YY_RULE_SETUP
-#line 251 "src/glsl/glsl_lexer.ll"
+#line 252 "src/glsl/glsl_lexer.ll"
{ return yytext[0]; }
YY_BREAK
case 22:
/* rule 22 can match eol */
YY_RULE_SETUP
-#line 253 "src/glsl/glsl_lexer.ll"
+#line 254 "src/glsl/glsl_lexer.ll"
{ yylineno++; yycolumn = 0; }
YY_BREAK
case 23:
YY_RULE_SETUP
-#line 255 "src/glsl/glsl_lexer.ll"
+#line 256 "src/glsl/glsl_lexer.ll"
DEPRECATED_ES_KEYWORD(ATTRIBUTE);
YY_BREAK
case 24:
YY_RULE_SETUP
-#line 256 "src/glsl/glsl_lexer.ll"
+#line 257 "src/glsl/glsl_lexer.ll"
return CONST_TOK;
YY_BREAK
case 25:
YY_RULE_SETUP
-#line 257 "src/glsl/glsl_lexer.ll"
+#line 258 "src/glsl/glsl_lexer.ll"
return BOOL_TOK;
YY_BREAK
case 26:
YY_RULE_SETUP
-#line 258 "src/glsl/glsl_lexer.ll"
+#line 259 "src/glsl/glsl_lexer.ll"
return FLOAT_TOK;
YY_BREAK
case 27:
YY_RULE_SETUP
-#line 259 "src/glsl/glsl_lexer.ll"
+#line 260 "src/glsl/glsl_lexer.ll"
return INT_TOK;
YY_BREAK
case 28:
YY_RULE_SETUP
-#line 260 "src/glsl/glsl_lexer.ll"
+#line 261 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, UINT_TOK);
YY_BREAK
case 29:
YY_RULE_SETUP
-#line 262 "src/glsl/glsl_lexer.ll"
+#line 263 "src/glsl/glsl_lexer.ll"
return BREAK;
YY_BREAK
case 30:
YY_RULE_SETUP
-#line 263 "src/glsl/glsl_lexer.ll"
+#line 264 "src/glsl/glsl_lexer.ll"
return CONTINUE;
YY_BREAK
case 31:
YY_RULE_SETUP
-#line 264 "src/glsl/glsl_lexer.ll"
+#line 265 "src/glsl/glsl_lexer.ll"
return DO;
YY_BREAK
case 32:
YY_RULE_SETUP
-#line 265 "src/glsl/glsl_lexer.ll"
+#line 266 "src/glsl/glsl_lexer.ll"
return WHILE;
YY_BREAK
case 33:
YY_RULE_SETUP
-#line 266 "src/glsl/glsl_lexer.ll"
+#line 267 "src/glsl/glsl_lexer.ll"
return ELSE;
YY_BREAK
case 34:
YY_RULE_SETUP
-#line 267 "src/glsl/glsl_lexer.ll"
+#line 268 "src/glsl/glsl_lexer.ll"
return FOR;
YY_BREAK
case 35:
YY_RULE_SETUP
-#line 268 "src/glsl/glsl_lexer.ll"
+#line 269 "src/glsl/glsl_lexer.ll"
return IF;
YY_BREAK
case 36:
YY_RULE_SETUP
-#line 269 "src/glsl/glsl_lexer.ll"
+#line 270 "src/glsl/glsl_lexer.ll"
return DISCARD;
YY_BREAK
case 37:
YY_RULE_SETUP
-#line 270 "src/glsl/glsl_lexer.ll"
+#line 271 "src/glsl/glsl_lexer.ll"
return RETURN;
YY_BREAK
case 38:
YY_RULE_SETUP
-#line 272 "src/glsl/glsl_lexer.ll"
+#line 273 "src/glsl/glsl_lexer.ll"
return BVEC2;
YY_BREAK
case 39:
YY_RULE_SETUP
-#line 273 "src/glsl/glsl_lexer.ll"
+#line 274 "src/glsl/glsl_lexer.ll"
return BVEC3;
YY_BREAK
case 40:
YY_RULE_SETUP
-#line 274 "src/glsl/glsl_lexer.ll"
+#line 275 "src/glsl/glsl_lexer.ll"
return BVEC4;
YY_BREAK
case 41:
YY_RULE_SETUP
-#line 275 "src/glsl/glsl_lexer.ll"
+#line 276 "src/glsl/glsl_lexer.ll"
return IVEC2;
YY_BREAK
case 42:
YY_RULE_SETUP
-#line 276 "src/glsl/glsl_lexer.ll"
+#line 277 "src/glsl/glsl_lexer.ll"
return IVEC3;
YY_BREAK
case 43:
YY_RULE_SETUP
-#line 277 "src/glsl/glsl_lexer.ll"
+#line 278 "src/glsl/glsl_lexer.ll"
return IVEC4;
YY_BREAK
case 44:
YY_RULE_SETUP
-#line 278 "src/glsl/glsl_lexer.ll"
+#line 279 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, UVEC2);
YY_BREAK
case 45:
YY_RULE_SETUP
-#line 279 "src/glsl/glsl_lexer.ll"
+#line 280 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, UVEC3);
YY_BREAK
case 46:
YY_RULE_SETUP
-#line 280 "src/glsl/glsl_lexer.ll"
+#line 281 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, UVEC4);
YY_BREAK
case 47:
YY_RULE_SETUP
-#line 281 "src/glsl/glsl_lexer.ll"
+#line 282 "src/glsl/glsl_lexer.ll"
return VEC2;
YY_BREAK
case 48:
YY_RULE_SETUP
-#line 282 "src/glsl/glsl_lexer.ll"
+#line 283 "src/glsl/glsl_lexer.ll"
return VEC3;
YY_BREAK
case 49:
YY_RULE_SETUP
-#line 283 "src/glsl/glsl_lexer.ll"
+#line 284 "src/glsl/glsl_lexer.ll"
return VEC4;
YY_BREAK
case 50:
YY_RULE_SETUP
-#line 284 "src/glsl/glsl_lexer.ll"
+#line 285 "src/glsl/glsl_lexer.ll"
return MAT2X2;
YY_BREAK
case 51:
YY_RULE_SETUP
-#line 285 "src/glsl/glsl_lexer.ll"
+#line 286 "src/glsl/glsl_lexer.ll"
return MAT3X3;
YY_BREAK
case 52:
YY_RULE_SETUP
-#line 286 "src/glsl/glsl_lexer.ll"
+#line 287 "src/glsl/glsl_lexer.ll"
return MAT4X4;
YY_BREAK
case 53:
YY_RULE_SETUP
-#line 287 "src/glsl/glsl_lexer.ll"
+#line 288 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT2X2);
YY_BREAK
case 54:
YY_RULE_SETUP
-#line 288 "src/glsl/glsl_lexer.ll"
+#line 289 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT2X3);
YY_BREAK
case 55:
YY_RULE_SETUP
-#line 289 "src/glsl/glsl_lexer.ll"
+#line 290 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT2X4);
YY_BREAK
case 56:
YY_RULE_SETUP
-#line 290 "src/glsl/glsl_lexer.ll"
+#line 291 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT3X2);
YY_BREAK
case 57:
YY_RULE_SETUP
-#line 291 "src/glsl/glsl_lexer.ll"
+#line 292 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT3X3);
YY_BREAK
case 58:
YY_RULE_SETUP
-#line 292 "src/glsl/glsl_lexer.ll"
+#line 293 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT3X4);
YY_BREAK
case 59:
YY_RULE_SETUP
-#line 293 "src/glsl/glsl_lexer.ll"
+#line 294 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT4X2);
YY_BREAK
case 60:
YY_RULE_SETUP
-#line 294 "src/glsl/glsl_lexer.ll"
+#line 295 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT4X3);
YY_BREAK
case 61:
YY_RULE_SETUP
-#line 295 "src/glsl/glsl_lexer.ll"
+#line 296 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, MAT4X4);
YY_BREAK
case 62:
YY_RULE_SETUP
-#line 297 "src/glsl/glsl_lexer.ll"
+#line 298 "src/glsl/glsl_lexer.ll"
return IN_TOK;
YY_BREAK
case 63:
YY_RULE_SETUP
-#line 298 "src/glsl/glsl_lexer.ll"
+#line 299 "src/glsl/glsl_lexer.ll"
return OUT_TOK;
YY_BREAK
case 64:
YY_RULE_SETUP
-#line 299 "src/glsl/glsl_lexer.ll"
+#line 300 "src/glsl/glsl_lexer.ll"
return INOUT_TOK;
YY_BREAK
case 65:
YY_RULE_SETUP
-#line 300 "src/glsl/glsl_lexer.ll"
+#line 301 "src/glsl/glsl_lexer.ll"
return UNIFORM;
YY_BREAK
case 66:
YY_RULE_SETUP
-#line 301 "src/glsl/glsl_lexer.ll"
+#line 302 "src/glsl/glsl_lexer.ll"
DEPRECATED_ES_KEYWORD(VARYING);
YY_BREAK
case 67:
YY_RULE_SETUP
-#line 302 "src/glsl/glsl_lexer.ll"
+#line 303 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 300, 120, 300, CENTROID);
YY_BREAK
case 68:
YY_RULE_SETUP
-#line 303 "src/glsl/glsl_lexer.ll"
+#line 304 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 100, 120, 100, INVARIANT);
YY_BREAK
case 69:
YY_RULE_SETUP
-#line 304 "src/glsl/glsl_lexer.ll"
+#line 305 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 100, 130, 300, FLAT);
YY_BREAK
case 70:
YY_RULE_SETUP
-#line 305 "src/glsl/glsl_lexer.ll"
+#line 306 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, SMOOTH);
YY_BREAK
case 71:
YY_RULE_SETUP
-#line 306 "src/glsl/glsl_lexer.ll"
+#line 307 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, NOPERSPECTIVE);
YY_BREAK
case 72:
YY_RULE_SETUP
-#line 308 "src/glsl/glsl_lexer.ll"
+#line 309 "src/glsl/glsl_lexer.ll"
DEPRECATED_ES_KEYWORD(SAMPLER1D);
YY_BREAK
case 73:
YY_RULE_SETUP
-#line 309 "src/glsl/glsl_lexer.ll"
+#line 310 "src/glsl/glsl_lexer.ll"
return SAMPLER2D;
YY_BREAK
case 74:
YY_RULE_SETUP
-#line 310 "src/glsl/glsl_lexer.ll"
+#line 311 "src/glsl/glsl_lexer.ll"
return SAMPLER3D;
YY_BREAK
case 75:
YY_RULE_SETUP
-#line 311 "src/glsl/glsl_lexer.ll"
+#line 312 "src/glsl/glsl_lexer.ll"
return SAMPLERCUBE;
YY_BREAK
case 76:
YY_RULE_SETUP
-#line 312 "src/glsl/glsl_lexer.ll"
+#line 313 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, SAMPLER1DARRAY);
YY_BREAK
case 77:
YY_RULE_SETUP
-#line 313 "src/glsl/glsl_lexer.ll"
+#line 314 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, SAMPLER2DARRAY);
YY_BREAK
case 78:
YY_RULE_SETUP
-#line 314 "src/glsl/glsl_lexer.ll"
+#line 315 "src/glsl/glsl_lexer.ll"
DEPRECATED_ES_KEYWORD(SAMPLER1DSHADOW);
YY_BREAK
case 79:
YY_RULE_SETUP
-#line 315 "src/glsl/glsl_lexer.ll"
+#line 316 "src/glsl/glsl_lexer.ll"
return SAMPLER2DSHADOW;
YY_BREAK
case 80:
YY_RULE_SETUP
-#line 316 "src/glsl/glsl_lexer.ll"
+#line 317 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, SAMPLERCUBESHADOW);
YY_BREAK
case 81:
YY_RULE_SETUP
-#line 317 "src/glsl/glsl_lexer.ll"
+#line 318 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, SAMPLER1DARRAYSHADOW);
YY_BREAK
case 82:
YY_RULE_SETUP
-#line 318 "src/glsl/glsl_lexer.ll"
+#line 319 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, SAMPLER2DARRAYSHADOW);
YY_BREAK
case 83:
YY_RULE_SETUP
-#line 319 "src/glsl/glsl_lexer.ll"
+#line 320 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, ISAMPLER1D);
YY_BREAK
case 84:
YY_RULE_SETUP
-#line 320 "src/glsl/glsl_lexer.ll"
+#line 321 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, ISAMPLER2D);
YY_BREAK
case 85:
YY_RULE_SETUP
-#line 321 "src/glsl/glsl_lexer.ll"
+#line 322 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, ISAMPLER3D);
YY_BREAK
case 86:
YY_RULE_SETUP
-#line 322 "src/glsl/glsl_lexer.ll"
+#line 323 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, ISAMPLERCUBE);
YY_BREAK
case 87:
YY_RULE_SETUP
-#line 323 "src/glsl/glsl_lexer.ll"
+#line 324 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, ISAMPLER1DARRAY);
YY_BREAK
case 88:
YY_RULE_SETUP
-#line 324 "src/glsl/glsl_lexer.ll"
+#line 325 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, ISAMPLER2DARRAY);
YY_BREAK
case 89:
YY_RULE_SETUP
-#line 325 "src/glsl/glsl_lexer.ll"
+#line 326 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, USAMPLER1D);
YY_BREAK
case 90:
YY_RULE_SETUP
-#line 326 "src/glsl/glsl_lexer.ll"
+#line 327 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, USAMPLER2D);
YY_BREAK
case 91:
YY_RULE_SETUP
-#line 327 "src/glsl/glsl_lexer.ll"
+#line 328 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, USAMPLER3D);
YY_BREAK
case 92:
YY_RULE_SETUP
-#line 328 "src/glsl/glsl_lexer.ll"
+#line 329 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, USAMPLERCUBE);
YY_BREAK
case 93:
YY_RULE_SETUP
-#line 329 "src/glsl/glsl_lexer.ll"
+#line 330 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 0, USAMPLER1DARRAY);
YY_BREAK
case 94:
YY_RULE_SETUP
-#line 330 "src/glsl/glsl_lexer.ll"
+#line 331 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, USAMPLER2DARRAY);
YY_BREAK
/* additional keywords in ARB_texture_multisample, included in GLSL 1.50 */
/* these are reserved but not defined in GLSL 3.00 */
case 95:
YY_RULE_SETUP
-#line 334 "src/glsl/glsl_lexer.ll"
+#line 335 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMS);
YY_BREAK
case 96:
YY_RULE_SETUP
-#line 335 "src/glsl/glsl_lexer.ll"
+#line 336 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMS);
YY_BREAK
case 97:
YY_RULE_SETUP
-#line 336 "src/glsl/glsl_lexer.ll"
+#line 337 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMS);
YY_BREAK
case 98:
YY_RULE_SETUP
-#line 337 "src/glsl/glsl_lexer.ll"
+#line 338 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, SAMPLER2DMSARRAY);
YY_BREAK
case 99:
YY_RULE_SETUP
-#line 338 "src/glsl/glsl_lexer.ll"
+#line 339 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, ISAMPLER2DMSARRAY);
YY_BREAK
case 100:
YY_RULE_SETUP
-#line 339 "src/glsl/glsl_lexer.ll"
+#line 340 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(150, 300, 150, 0, yyextra->ARB_texture_multisample_enable, USAMPLER2DMSARRAY);
YY_BREAK
/* keywords available with ARB_texture_cube_map_array_enable extension on desktop GLSL */
case 101:
YY_RULE_SETUP
-#line 342 "src/glsl/glsl_lexer.ll"
+#line 343 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAY);
YY_BREAK
case 102:
YY_RULE_SETUP
-#line 343 "src/glsl/glsl_lexer.ll"
+#line 344 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, ISAMPLERCUBEARRAY);
YY_BREAK
case 103:
YY_RULE_SETUP
-#line 344 "src/glsl/glsl_lexer.ll"
+#line 345 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, USAMPLERCUBEARRAY);
YY_BREAK
case 104:
YY_RULE_SETUP
-#line 345 "src/glsl/glsl_lexer.ll"
+#line 346 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_texture_cube_map_array_enable, SAMPLERCUBEARRAYSHADOW);
YY_BREAK
case 105:
YY_RULE_SETUP
-#line 347 "src/glsl/glsl_lexer.ll"
+#line 348 "src/glsl/glsl_lexer.ll"
{
if (yyextra->OES_EGL_image_external_enable)
return SAMPLEREXTERNALOES;
@@ -2175,238 +2400,238 @@ YY_RULE_SETUP
/* keywords available with ARB_gpu_shader5 */
case 106:
YY_RULE_SETUP
-#line 355 "src/glsl/glsl_lexer.ll"
+#line 356 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_gpu_shader5_enable, PRECISE);
YY_BREAK
/* keywords available with ARB_shader_image_load_store */
case 107:
YY_RULE_SETUP
-#line 358 "src/glsl/glsl_lexer.ll"
+#line 359 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE1D);
YY_BREAK
case 108:
YY_RULE_SETUP
-#line 359 "src/glsl/glsl_lexer.ll"
+#line 360 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2D);
YY_BREAK
case 109:
YY_RULE_SETUP
-#line 360 "src/glsl/glsl_lexer.ll"
+#line 361 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE3D);
YY_BREAK
case 110:
YY_RULE_SETUP
-#line 361 "src/glsl/glsl_lexer.ll"
+#line 362 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DRECT);
YY_BREAK
case 111:
YY_RULE_SETUP
-#line 362 "src/glsl/glsl_lexer.ll"
+#line 363 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGECUBE);
YY_BREAK
case 112:
YY_RULE_SETUP
-#line 363 "src/glsl/glsl_lexer.ll"
+#line 364 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGEBUFFER);
YY_BREAK
case 113:
YY_RULE_SETUP
-#line 364 "src/glsl/glsl_lexer.ll"
+#line 365 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE1DARRAY);
YY_BREAK
case 114:
YY_RULE_SETUP
-#line 365 "src/glsl/glsl_lexer.ll"
+#line 366 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DARRAY);
YY_BREAK
case 115:
YY_RULE_SETUP
-#line 366 "src/glsl/glsl_lexer.ll"
+#line 367 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGECUBEARRAY);
YY_BREAK
case 116:
YY_RULE_SETUP
-#line 367 "src/glsl/glsl_lexer.ll"
+#line 368 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DMS);
YY_BREAK
case 117:
YY_RULE_SETUP
-#line 368 "src/glsl/glsl_lexer.ll"
+#line 369 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2DMSARRAY);
YY_BREAK
case 118:
YY_RULE_SETUP
-#line 369 "src/glsl/glsl_lexer.ll"
+#line 370 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE1D);
YY_BREAK
case 119:
YY_RULE_SETUP
-#line 370 "src/glsl/glsl_lexer.ll"
+#line 371 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2D);
YY_BREAK
case 120:
YY_RULE_SETUP
-#line 371 "src/glsl/glsl_lexer.ll"
+#line 372 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE3D);
YY_BREAK
case 121:
YY_RULE_SETUP
-#line 372 "src/glsl/glsl_lexer.ll"
+#line 373 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DRECT);
YY_BREAK
case 122:
YY_RULE_SETUP
-#line 373 "src/glsl/glsl_lexer.ll"
+#line 374 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGECUBE);
YY_BREAK
case 123:
YY_RULE_SETUP
-#line 374 "src/glsl/glsl_lexer.ll"
+#line 375 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGEBUFFER);
YY_BREAK
case 124:
YY_RULE_SETUP
-#line 375 "src/glsl/glsl_lexer.ll"
+#line 376 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE1DARRAY);
YY_BREAK
case 125:
YY_RULE_SETUP
-#line 376 "src/glsl/glsl_lexer.ll"
+#line 377 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DARRAY);
YY_BREAK
case 126:
YY_RULE_SETUP
-#line 377 "src/glsl/glsl_lexer.ll"
+#line 378 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGECUBEARRAY);
YY_BREAK
case 127:
YY_RULE_SETUP
-#line 378 "src/glsl/glsl_lexer.ll"
+#line 379 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DMS);
YY_BREAK
case 128:
YY_RULE_SETUP
-#line 379 "src/glsl/glsl_lexer.ll"
+#line 380 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IIMAGE2DMSARRAY);
YY_BREAK
case 129:
YY_RULE_SETUP
-#line 380 "src/glsl/glsl_lexer.ll"
+#line 381 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE1D);
YY_BREAK
case 130:
YY_RULE_SETUP
-#line 381 "src/glsl/glsl_lexer.ll"
+#line 382 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2D);
YY_BREAK
case 131:
YY_RULE_SETUP
-#line 382 "src/glsl/glsl_lexer.ll"
+#line 383 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE3D);
YY_BREAK
case 132:
YY_RULE_SETUP
-#line 383 "src/glsl/glsl_lexer.ll"
+#line 384 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DRECT);
YY_BREAK
case 133:
YY_RULE_SETUP
-#line 384 "src/glsl/glsl_lexer.ll"
+#line 385 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGECUBE);
YY_BREAK
case 134:
YY_RULE_SETUP
-#line 385 "src/glsl/glsl_lexer.ll"
+#line 386 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGEBUFFER);
YY_BREAK
case 135:
YY_RULE_SETUP
-#line 386 "src/glsl/glsl_lexer.ll"
+#line 387 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE1DARRAY);
YY_BREAK
case 136:
YY_RULE_SETUP
-#line 387 "src/glsl/glsl_lexer.ll"
+#line 388 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DARRAY);
YY_BREAK
case 137:
YY_RULE_SETUP
-#line 388 "src/glsl/glsl_lexer.ll"
+#line 389 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGECUBEARRAY);
YY_BREAK
case 138:
YY_RULE_SETUP
-#line 389 "src/glsl/glsl_lexer.ll"
+#line 390 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DMS);
YY_BREAK
case 139:
YY_RULE_SETUP
-#line 390 "src/glsl/glsl_lexer.ll"
+#line 391 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, UIMAGE2DMSARRAY);
YY_BREAK
case 140:
YY_RULE_SETUP
-#line 391 "src/glsl/glsl_lexer.ll"
+#line 392 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, IMAGE1DSHADOW);
YY_BREAK
case 141:
YY_RULE_SETUP
-#line 392 "src/glsl/glsl_lexer.ll"
+#line 393 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, IMAGE2DSHADOW);
YY_BREAK
case 142:
YY_RULE_SETUP
-#line 393 "src/glsl/glsl_lexer.ll"
+#line 394 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, IMAGE1DARRAYSHADOW);
YY_BREAK
case 143:
YY_RULE_SETUP
-#line 394 "src/glsl/glsl_lexer.ll"
+#line 395 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, IMAGE2DARRAYSHADOW);
YY_BREAK
case 144:
YY_RULE_SETUP
-#line 396 "src/glsl/glsl_lexer.ll"
+#line 397 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, COHERENT);
YY_BREAK
case 145:
YY_RULE_SETUP
-#line 397 "src/glsl/glsl_lexer.ll"
+#line 398 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(110, 100, 420, 0, yyextra->ARB_shader_image_load_store_enable, VOLATILE);
YY_BREAK
case 146:
YY_RULE_SETUP
-#line 398 "src/glsl/glsl_lexer.ll"
+#line 399 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, RESTRICT);
YY_BREAK
case 147:
YY_RULE_SETUP
-#line 399 "src/glsl/glsl_lexer.ll"
+#line 400 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, READONLY);
YY_BREAK
case 148:
YY_RULE_SETUP
-#line 400 "src/glsl/glsl_lexer.ll"
+#line 401 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, WRITEONLY);
YY_BREAK
case 149:
YY_RULE_SETUP
-#line 402 "src/glsl/glsl_lexer.ll"
+#line 403 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(420, 300, 420, 0, yyextra->ARB_shader_atomic_counters_enable, ATOMIC_UINT);
YY_BREAK
case 150:
YY_RULE_SETUP
-#line 404 "src/glsl/glsl_lexer.ll"
+#line 405 "src/glsl/glsl_lexer.ll"
return STRUCT;
YY_BREAK
case 151:
YY_RULE_SETUP
-#line 405 "src/glsl/glsl_lexer.ll"
+#line 406 "src/glsl/glsl_lexer.ll"
return VOID_TOK;
YY_BREAK
case 152:
YY_RULE_SETUP
-#line 407 "src/glsl/glsl_lexer.ll"
+#line 408 "src/glsl/glsl_lexer.ll"
{
if ((yyextra->is_version(140, 300))
|| yyextra->AMD_conservative_depth_enable
@@ -2428,133 +2653,133 @@ YY_RULE_SETUP
YY_BREAK
case 153:
YY_RULE_SETUP
-#line 426 "src/glsl/glsl_lexer.ll"
+#line 427 "src/glsl/glsl_lexer.ll"
return INC_OP;
YY_BREAK
case 154:
YY_RULE_SETUP
-#line 427 "src/glsl/glsl_lexer.ll"
+#line 428 "src/glsl/glsl_lexer.ll"
return DEC_OP;
YY_BREAK
case 155:
YY_RULE_SETUP
-#line 428 "src/glsl/glsl_lexer.ll"
+#line 429 "src/glsl/glsl_lexer.ll"
return LE_OP;
YY_BREAK
case 156:
YY_RULE_SETUP
-#line 429 "src/glsl/glsl_lexer.ll"
+#line 430 "src/glsl/glsl_lexer.ll"
return GE_OP;
YY_BREAK
case 157:
YY_RULE_SETUP
-#line 430 "src/glsl/glsl_lexer.ll"
+#line 431 "src/glsl/glsl_lexer.ll"
return EQ_OP;
YY_BREAK
case 158:
YY_RULE_SETUP
-#line 431 "src/glsl/glsl_lexer.ll"
+#line 432 "src/glsl/glsl_lexer.ll"
return NE_OP;
YY_BREAK
case 159:
YY_RULE_SETUP
-#line 432 "src/glsl/glsl_lexer.ll"
+#line 433 "src/glsl/glsl_lexer.ll"
return AND_OP;
YY_BREAK
case 160:
YY_RULE_SETUP
-#line 433 "src/glsl/glsl_lexer.ll"
+#line 434 "src/glsl/glsl_lexer.ll"
return OR_OP;
YY_BREAK
case 161:
YY_RULE_SETUP
-#line 434 "src/glsl/glsl_lexer.ll"
+#line 435 "src/glsl/glsl_lexer.ll"
return XOR_OP;
YY_BREAK
case 162:
YY_RULE_SETUP
-#line 435 "src/glsl/glsl_lexer.ll"
+#line 436 "src/glsl/glsl_lexer.ll"
return LEFT_OP;
YY_BREAK
case 163:
YY_RULE_SETUP
-#line 436 "src/glsl/glsl_lexer.ll"
+#line 437 "src/glsl/glsl_lexer.ll"
return RIGHT_OP;
YY_BREAK
case 164:
YY_RULE_SETUP
-#line 438 "src/glsl/glsl_lexer.ll"
+#line 439 "src/glsl/glsl_lexer.ll"
return MUL_ASSIGN;
YY_BREAK
case 165:
YY_RULE_SETUP
-#line 439 "src/glsl/glsl_lexer.ll"
+#line 440 "src/glsl/glsl_lexer.ll"
return DIV_ASSIGN;
YY_BREAK
case 166:
YY_RULE_SETUP
-#line 440 "src/glsl/glsl_lexer.ll"
+#line 441 "src/glsl/glsl_lexer.ll"
return ADD_ASSIGN;
YY_BREAK
case 167:
YY_RULE_SETUP
-#line 441 "src/glsl/glsl_lexer.ll"
+#line 442 "src/glsl/glsl_lexer.ll"
return MOD_ASSIGN;
YY_BREAK
case 168:
YY_RULE_SETUP
-#line 442 "src/glsl/glsl_lexer.ll"
+#line 443 "src/glsl/glsl_lexer.ll"
return LEFT_ASSIGN;
YY_BREAK
case 169:
YY_RULE_SETUP
-#line 443 "src/glsl/glsl_lexer.ll"
+#line 444 "src/glsl/glsl_lexer.ll"
return RIGHT_ASSIGN;
YY_BREAK
case 170:
YY_RULE_SETUP
-#line 444 "src/glsl/glsl_lexer.ll"
+#line 445 "src/glsl/glsl_lexer.ll"
return AND_ASSIGN;
YY_BREAK
case 171:
YY_RULE_SETUP
-#line 445 "src/glsl/glsl_lexer.ll"
+#line 446 "src/glsl/glsl_lexer.ll"
return XOR_ASSIGN;
YY_BREAK
case 172:
YY_RULE_SETUP
-#line 446 "src/glsl/glsl_lexer.ll"
+#line 447 "src/glsl/glsl_lexer.ll"
return OR_ASSIGN;
YY_BREAK
case 173:
YY_RULE_SETUP
-#line 447 "src/glsl/glsl_lexer.ll"
+#line 448 "src/glsl/glsl_lexer.ll"
return SUB_ASSIGN;
YY_BREAK
case 174:
YY_RULE_SETUP
-#line 449 "src/glsl/glsl_lexer.ll"
+#line 450 "src/glsl/glsl_lexer.ll"
{
return LITERAL_INTEGER(10);
}
YY_BREAK
case 175:
YY_RULE_SETUP
-#line 452 "src/glsl/glsl_lexer.ll"
+#line 453 "src/glsl/glsl_lexer.ll"
{
return LITERAL_INTEGER(16);
}
YY_BREAK
case 176:
YY_RULE_SETUP
-#line 455 "src/glsl/glsl_lexer.ll"
+#line 456 "src/glsl/glsl_lexer.ll"
{
return LITERAL_INTEGER(8);
}
YY_BREAK
case 177:
YY_RULE_SETUP
-#line 459 "src/glsl/glsl_lexer.ll"
+#line 460 "src/glsl/glsl_lexer.ll"
{
yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
@@ -2562,7 +2787,7 @@ YY_RULE_SETUP
YY_BREAK
case 178:
YY_RULE_SETUP
-#line 463 "src/glsl/glsl_lexer.ll"
+#line 464 "src/glsl/glsl_lexer.ll"
{
yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
@@ -2570,7 +2795,7 @@ YY_RULE_SETUP
YY_BREAK
case 179:
YY_RULE_SETUP
-#line 467 "src/glsl/glsl_lexer.ll"
+#line 468 "src/glsl/glsl_lexer.ll"
{
yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
@@ -2578,7 +2803,7 @@ YY_RULE_SETUP
YY_BREAK
case 180:
YY_RULE_SETUP
-#line 471 "src/glsl/glsl_lexer.ll"
+#line 472 "src/glsl/glsl_lexer.ll"
{
yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
@@ -2586,7 +2811,7 @@ YY_RULE_SETUP
YY_BREAK
case 181:
YY_RULE_SETUP
-#line 475 "src/glsl/glsl_lexer.ll"
+#line 476 "src/glsl/glsl_lexer.ll"
{
yylval->real = glsl_strtof(yytext, NULL);
return FLOATCONSTANT;
@@ -2594,7 +2819,7 @@ YY_RULE_SETUP
YY_BREAK
case 182:
YY_RULE_SETUP
-#line 480 "src/glsl/glsl_lexer.ll"
+#line 481 "src/glsl/glsl_lexer.ll"
{
yylval->n = 1;
return BOOLCONSTANT;
@@ -2602,7 +2827,7 @@ YY_RULE_SETUP
YY_BREAK
case 183:
YY_RULE_SETUP
-#line 484 "src/glsl/glsl_lexer.ll"
+#line 485 "src/glsl/glsl_lexer.ll"
{
yylval->n = 0;
return BOOLCONSTANT;
@@ -2611,321 +2836,321 @@ YY_RULE_SETUP
/* Reserved words in GLSL 1.10. */
case 184:
YY_RULE_SETUP
-#line 491 "src/glsl/glsl_lexer.ll"
+#line 492 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, ASM);
YY_BREAK
case 185:
YY_RULE_SETUP
-#line 492 "src/glsl/glsl_lexer.ll"
+#line 493 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, CLASS);
YY_BREAK
case 186:
YY_RULE_SETUP
-#line 493 "src/glsl/glsl_lexer.ll"
+#line 494 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, UNION);
YY_BREAK
case 187:
YY_RULE_SETUP
-#line 494 "src/glsl/glsl_lexer.ll"
+#line 495 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, ENUM);
YY_BREAK
case 188:
YY_RULE_SETUP
-#line 495 "src/glsl/glsl_lexer.ll"
+#line 496 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, TYPEDEF);
YY_BREAK
case 189:
YY_RULE_SETUP
-#line 496 "src/glsl/glsl_lexer.ll"
+#line 497 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, TEMPLATE);
YY_BREAK
case 190:
YY_RULE_SETUP
-#line 497 "src/glsl/glsl_lexer.ll"
+#line 498 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, THIS);
YY_BREAK
case 191:
YY_RULE_SETUP
-#line 498 "src/glsl/glsl_lexer.ll"
+#line 499 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(110, 100, 140, 300, yyextra->ARB_uniform_buffer_object_enable, PACKED_TOK);
YY_BREAK
case 192:
YY_RULE_SETUP
-#line 499 "src/glsl/glsl_lexer.ll"
+#line 500 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, GOTO);
YY_BREAK
case 193:
YY_RULE_SETUP
-#line 500 "src/glsl/glsl_lexer.ll"
+#line 501 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 130, 300, SWITCH);
YY_BREAK
case 194:
YY_RULE_SETUP
-#line 501 "src/glsl/glsl_lexer.ll"
+#line 502 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 130, 300, DEFAULT);
YY_BREAK
case 195:
YY_RULE_SETUP
-#line 502 "src/glsl/glsl_lexer.ll"
+#line 503 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, INLINE_TOK);
YY_BREAK
case 196:
YY_RULE_SETUP
-#line 503 "src/glsl/glsl_lexer.ll"
+#line 504 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, NOINLINE);
YY_BREAK
case 197:
YY_RULE_SETUP
-#line 504 "src/glsl/glsl_lexer.ll"
+#line 505 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, PUBLIC_TOK);
YY_BREAK
case 198:
YY_RULE_SETUP
-#line 505 "src/glsl/glsl_lexer.ll"
+#line 506 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, STATIC);
YY_BREAK
case 199:
YY_RULE_SETUP
-#line 506 "src/glsl/glsl_lexer.ll"
+#line 507 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, EXTERN);
YY_BREAK
case 200:
YY_RULE_SETUP
-#line 507 "src/glsl/glsl_lexer.ll"
+#line 508 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, EXTERNAL);
YY_BREAK
case 201:
YY_RULE_SETUP
-#line 508 "src/glsl/glsl_lexer.ll"
+#line 509 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, INTERFACE);
YY_BREAK
case 202:
YY_RULE_SETUP
-#line 509 "src/glsl/glsl_lexer.ll"
+#line 510 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, LONG_TOK);
YY_BREAK
case 203:
YY_RULE_SETUP
-#line 510 "src/glsl/glsl_lexer.ll"
+#line 511 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, SHORT_TOK);
YY_BREAK
case 204:
YY_RULE_SETUP
-#line 511 "src/glsl/glsl_lexer.ll"
+#line 512 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 400, 0, DOUBLE_TOK);
YY_BREAK
case 205:
YY_RULE_SETUP
-#line 512 "src/glsl/glsl_lexer.ll"
+#line 513 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, HALF);
YY_BREAK
case 206:
YY_RULE_SETUP
-#line 513 "src/glsl/glsl_lexer.ll"
+#line 514 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, FIXED_TOK);
YY_BREAK
case 207:
YY_RULE_SETUP
-#line 514 "src/glsl/glsl_lexer.ll"
+#line 515 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, UNSIGNED);
YY_BREAK
case 208:
YY_RULE_SETUP
-#line 515 "src/glsl/glsl_lexer.ll"
+#line 516 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, INPUT_TOK);
YY_BREAK
case 209:
YY_RULE_SETUP
-#line 516 "src/glsl/glsl_lexer.ll"
+#line 517 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, OUTPUT);
YY_BREAK
case 210:
YY_RULE_SETUP
-#line 517 "src/glsl/glsl_lexer.ll"
+#line 518 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, HVEC2);
YY_BREAK
case 211:
YY_RULE_SETUP
-#line 518 "src/glsl/glsl_lexer.ll"
+#line 519 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, HVEC3);
YY_BREAK
case 212:
YY_RULE_SETUP
-#line 519 "src/glsl/glsl_lexer.ll"
+#line 520 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, HVEC4);
YY_BREAK
case 213:
YY_RULE_SETUP
-#line 520 "src/glsl/glsl_lexer.ll"
+#line 521 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 400, 0, DVEC2);
YY_BREAK
case 214:
YY_RULE_SETUP
-#line 521 "src/glsl/glsl_lexer.ll"
+#line 522 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 400, 0, DVEC3);
YY_BREAK
case 215:
YY_RULE_SETUP
-#line 522 "src/glsl/glsl_lexer.ll"
+#line 523 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 400, 0, DVEC4);
YY_BREAK
case 216:
YY_RULE_SETUP
-#line 523 "src/glsl/glsl_lexer.ll"
+#line 524 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, FVEC2);
YY_BREAK
case 217:
YY_RULE_SETUP
-#line 524 "src/glsl/glsl_lexer.ll"
+#line 525 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, FVEC3);
YY_BREAK
case 218:
YY_RULE_SETUP
-#line 525 "src/glsl/glsl_lexer.ll"
+#line 526 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, FVEC4);
YY_BREAK
case 219:
YY_RULE_SETUP
-#line 526 "src/glsl/glsl_lexer.ll"
+#line 527 "src/glsl/glsl_lexer.ll"
DEPRECATED_ES_KEYWORD(SAMPLER2DRECT);
YY_BREAK
case 220:
YY_RULE_SETUP
-#line 527 "src/glsl/glsl_lexer.ll"
+#line 528 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, SAMPLER3DRECT);
YY_BREAK
case 221:
YY_RULE_SETUP
-#line 528 "src/glsl/glsl_lexer.ll"
+#line 529 "src/glsl/glsl_lexer.ll"
DEPRECATED_ES_KEYWORD(SAMPLER2DRECTSHADOW);
YY_BREAK
case 222:
YY_RULE_SETUP
-#line 529 "src/glsl/glsl_lexer.ll"
+#line 530 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, SIZEOF);
YY_BREAK
case 223:
YY_RULE_SETUP
-#line 530 "src/glsl/glsl_lexer.ll"
+#line 531 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, CAST);
YY_BREAK
case 224:
YY_RULE_SETUP
-#line 531 "src/glsl/glsl_lexer.ll"
+#line 532 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, NAMESPACE);
YY_BREAK
case 225:
YY_RULE_SETUP
-#line 532 "src/glsl/glsl_lexer.ll"
+#line 533 "src/glsl/glsl_lexer.ll"
KEYWORD(110, 100, 0, 0, USING);
YY_BREAK
/* Additional reserved words in GLSL 1.20. */
case 226:
YY_RULE_SETUP
-#line 535 "src/glsl/glsl_lexer.ll"
+#line 536 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 100, 130, 100, LOWP);
YY_BREAK
case 227:
YY_RULE_SETUP
-#line 536 "src/glsl/glsl_lexer.ll"
+#line 537 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 100, 130, 100, MEDIUMP);
YY_BREAK
case 228:
YY_RULE_SETUP
-#line 537 "src/glsl/glsl_lexer.ll"
+#line 538 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 100, 130, 100, HIGHP);
YY_BREAK
case 229:
YY_RULE_SETUP
-#line 538 "src/glsl/glsl_lexer.ll"
+#line 539 "src/glsl/glsl_lexer.ll"
KEYWORD(120, 100, 130, 100, PRECISION);
YY_BREAK
/* Additional reserved words in GLSL 1.30. */
case 230:
YY_RULE_SETUP
-#line 541 "src/glsl/glsl_lexer.ll"
+#line 542 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 130, 300, CASE);
YY_BREAK
case 231:
YY_RULE_SETUP
-#line 542 "src/glsl/glsl_lexer.ll"
+#line 543 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, COMMON);
YY_BREAK
case 232:
YY_RULE_SETUP
-#line 543 "src/glsl/glsl_lexer.ll"
+#line 544 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, PARTITION);
YY_BREAK
case 233:
YY_RULE_SETUP
-#line 544 "src/glsl/glsl_lexer.ll"
+#line 545 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, ACTIVE);
YY_BREAK
case 234:
YY_RULE_SETUP
-#line 545 "src/glsl/glsl_lexer.ll"
+#line 546 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 100, 0, 0, SUPERP);
YY_BREAK
case 235:
YY_RULE_SETUP
-#line 546 "src/glsl/glsl_lexer.ll"
+#line 547 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 140, 0, SAMPLERBUFFER);
YY_BREAK
case 236:
YY_RULE_SETUP
-#line 547 "src/glsl/glsl_lexer.ll"
+#line 548 "src/glsl/glsl_lexer.ll"
KEYWORD(130, 300, 0, 0, FILTER);
YY_BREAK
case 237:
YY_RULE_SETUP
-#line 548 "src/glsl/glsl_lexer.ll"
+#line 549 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(130, 0, 140, 0, yyextra->ARB_uniform_buffer_object_enable && !yyextra->es_shader, ROW_MAJOR);
YY_BREAK
/* Additional reserved words in GLSL 1.40 */
case 238:
YY_RULE_SETUP
-#line 551 "src/glsl/glsl_lexer.ll"
+#line 552 "src/glsl/glsl_lexer.ll"
KEYWORD(140, 300, 140, 0, ISAMPLER2DRECT);
YY_BREAK
case 239:
YY_RULE_SETUP
-#line 552 "src/glsl/glsl_lexer.ll"
+#line 553 "src/glsl/glsl_lexer.ll"
KEYWORD(140, 300, 140, 0, USAMPLER2DRECT);
YY_BREAK
case 240:
YY_RULE_SETUP
-#line 553 "src/glsl/glsl_lexer.ll"
+#line 554 "src/glsl/glsl_lexer.ll"
KEYWORD(140, 300, 140, 0, ISAMPLERBUFFER);
YY_BREAK
case 241:
YY_RULE_SETUP
-#line 554 "src/glsl/glsl_lexer.ll"
+#line 555 "src/glsl/glsl_lexer.ll"
KEYWORD(140, 300, 140, 0, USAMPLERBUFFER);
YY_BREAK
/* Additional reserved words in GLSL ES 3.00 */
case 242:
YY_RULE_SETUP
-#line 557 "src/glsl/glsl_lexer.ll"
+#line 558 "src/glsl/glsl_lexer.ll"
KEYWORD(0, 300, 0, 0, RESOURCE);
YY_BREAK
case 243:
YY_RULE_SETUP
-#line 558 "src/glsl/glsl_lexer.ll"
+#line 559 "src/glsl/glsl_lexer.ll"
KEYWORD(0, 300, 0, 0, PATCH);
YY_BREAK
case 244:
YY_RULE_SETUP
-#line 559 "src/glsl/glsl_lexer.ll"
+#line 560 "src/glsl/glsl_lexer.ll"
KEYWORD_WITH_ALT(400, 300, 400, 0, yyextra->ARB_gpu_shader5_enable, SAMPLE);
YY_BREAK
case 245:
YY_RULE_SETUP
-#line 560 "src/glsl/glsl_lexer.ll"
+#line 561 "src/glsl/glsl_lexer.ll"
KEYWORD(0, 300, 0, 0, SUBROUTINE);
YY_BREAK
case 246:
YY_RULE_SETUP
-#line 563 "src/glsl/glsl_lexer.ll"
+#line 564 "src/glsl/glsl_lexer.ll"
{
struct _mesa_glsl_parse_state *state = yyextra;
void *ctx = state;
@@ -2935,15 +3160,15 @@ YY_RULE_SETUP
YY_BREAK
case 247:
YY_RULE_SETUP
-#line 570 "src/glsl/glsl_lexer.ll"
+#line 571 "src/glsl/glsl_lexer.ll"
{ return yytext[0]; }
YY_BREAK
case 248:
YY_RULE_SETUP
-#line 572 "src/glsl/glsl_lexer.ll"
+#line 573 "src/glsl/glsl_lexer.ll"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
-#line 2947 "src/glsl/glsl_lexer.cpp"
+#line 3172 "src/glsl/glsl_lexer.cpp"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(PP):
case YY_STATE_EOF(PRAGMA):
@@ -2963,7 +3188,7 @@ case YY_STATE_EOF(PRAGMA):
/* We're scanning a new file or input source. It's
* possible that this happened because the user
* just pointed yyin at a new source and called
- * _mesa_glsl_lexer_lex(). If so, then we have to assure
+ * yylex(). If so, then we have to assure
* consistency between YY_CURRENT_BUFFER and our
* globals. Here is the right place to do so, because
* this is the first action (other than possibly a
@@ -3024,7 +3249,7 @@ case YY_STATE_EOF(PRAGMA):
{
yyg->yy_did_buffer_switch_on_eof = 0;
- if ( _mesa_glsl_lexer_wrap(yyscanner ) )
+ if ( yywrap( yyscanner ) )
{
/* Note: because we've taken care in
* yy_get_next_buffer() to have set up
@@ -3077,7 +3302,8 @@ case YY_STATE_EOF(PRAGMA):
"fatal flex scanner internal error--no action found" );
} /* end of action switch */
} /* end of scanning one token */
-} /* end of _mesa_glsl_lexer_lex */
+ } /* end of user's declarations */
+} /* end of yylex */
/* yy_get_next_buffer - try to read in a new buffer
*
@@ -3089,9 +3315,9 @@ case YY_STATE_EOF(PRAGMA):
static int yy_get_next_buffer (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
- register char *source = yyg->yytext_ptr;
- register int number_to_move, i;
+ char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ char *source = yyg->yytext_ptr;
+ int number_to_move, i;
int ret_val;
if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
@@ -3120,7 +3346,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* Try to read more data. */
/* First move last chars to start of buffer. */
- number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
for ( i = 0; i < number_to_move; ++i )
*(dest++) = *(source++);
@@ -3140,7 +3366,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{ /* Not enough room in the buffer - grow it. */
/* just a shorter name for the current buffer */
- YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
int yy_c_buf_p_offset =
(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
@@ -3156,11 +3382,12 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
b->yy_ch_buf = (char *)
/* Include room in for 2 EOB chars. */
- _mesa_glsl_lexer_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+ yyrealloc( (void *) b->yy_ch_buf,
+ (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
}
else
/* Can't grow it, we don't own it. */
- b->yy_ch_buf = 0;
+ b->yy_ch_buf = NULL;
if ( ! b->yy_ch_buf )
YY_FATAL_ERROR(
@@ -3178,7 +3405,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
- yyg->yy_n_chars, (size_t) num_to_read );
+ yyg->yy_n_chars, num_to_read );
YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
}
@@ -3188,7 +3415,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( number_to_move == YY_MORE_ADJ )
{
ret_val = EOB_ACT_END_OF_FILE;
- _mesa_glsl_lexer_restart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
}
else
@@ -3202,12 +3429,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
ret_val = EOB_ACT_CONTINUE_SCAN;
- if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
- yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
- YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) _mesa_glsl_lexer_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+ int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+ (void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ /* "- 2" to take care of EOB's */
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
}
yyg->yy_n_chars += number_to_move;
@@ -3223,8 +3453,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
{
- register yy_state_type yy_current_state;
- register char *yy_cp;
+ yy_state_type yy_current_state;
+ char *yy_cp;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yy_current_state = yyg->yy_start;
@@ -3232,7 +3462,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
{
- register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
@@ -3242,9 +3472,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 1009 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
}
return yy_current_state;
@@ -3257,11 +3487,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
*/
static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
{
- register int yy_is_jam;
+ int yy_is_jam;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
- register char *yy_cp = yyg->yy_c_buf_p;
+ char *yy_cp = yyg->yy_c_buf_p;
- register YY_CHAR yy_c = 1;
+ YY_CHAR yy_c = 1;
if ( yy_accept[yy_current_state] )
{
yyg->yy_last_accepting_state = yy_current_state;
@@ -3271,14 +3501,19 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
{
yy_current_state = (int) yy_def[yy_current_state];
if ( yy_current_state >= 1009 )
- yy_c = yy_meta[(unsigned int) yy_c];
+ yy_c = yy_meta[yy_c];
}
- yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
yy_is_jam = (yy_current_state == 1008);
+ (void)yyg;
return yy_is_jam ? 0 : yy_current_state;
}
+#ifndef YY_NO_UNPUT
+
+#endif
+
#ifndef YY_NO_INPUT
#ifdef __cplusplus
static int yyinput (yyscan_t yyscanner)
@@ -3304,7 +3539,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
else
{ /* need more input */
- int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
++yyg->yy_c_buf_p;
switch ( yy_get_next_buffer( yyscanner ) )
@@ -3321,14 +3556,14 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
*/
/* Reset buffer status. */
- _mesa_glsl_lexer_restart(yyin ,yyscanner);
+ yyrestart( yyin , yyscanner);
/*FALLTHROUGH*/
case EOB_ACT_END_OF_FILE:
{
- if ( _mesa_glsl_lexer_wrap(yyscanner ) )
- return EOF;
+ if ( yywrap( yyscanner ) )
+ return 0;
if ( ! yyg->yy_did_buffer_switch_on_eof )
YY_NEW_FILE;
@@ -3361,34 +3596,34 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @note This function does not reset the start condition to @c INITIAL .
*/
- void _mesa_glsl_lexer_restart (FILE * input_file , yyscan_t yyscanner)
+ void yyrestart (FILE * input_file , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! YY_CURRENT_BUFFER ){
- _mesa_glsl_lexer_ensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
YY_CURRENT_BUFFER_LVALUE =
- _mesa_glsl_lexer__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
}
- _mesa_glsl_lexer__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
- _mesa_glsl_lexer__load_buffer_state(yyscanner );
+ yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
+ yy_load_buffer_state( yyscanner );
}
/** Switch to a different input buffer.
* @param new_buffer The new input buffer.
* @param yyscanner The scanner object.
*/
- void _mesa_glsl_lexer__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+ void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* TODO. We should be able to replace this entire function body
* with
- * _mesa_glsl_lexer_pop_buffer_state();
- * _mesa_glsl_lexer_push_buffer_state(new_buffer);
+ * yypop_buffer_state();
+ * yypush_buffer_state(new_buffer);
*/
- _mesa_glsl_lexer_ensure_buffer_stack (yyscanner);
+ yyensure_buffer_stack (yyscanner);
if ( YY_CURRENT_BUFFER == new_buffer )
return;
@@ -3401,17 +3636,17 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
}
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- _mesa_glsl_lexer__load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
/* We don't actually know whether we did this switch during
- * EOF (_mesa_glsl_lexer_wrap()) processing, but the only time this flag
- * is looked at is after _mesa_glsl_lexer_wrap() is called, so it's safe
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
* to go ahead and always set it.
*/
yyg->yy_did_buffer_switch_on_eof = 1;
}
-static void _mesa_glsl_lexer__load_buffer_state (yyscan_t yyscanner)
+static void yy_load_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
@@ -3426,35 +3661,35 @@ static void _mesa_glsl_lexer__load_buffer_state (yyscan_t yyscanner)
* @param yyscanner The scanner object.
* @return the allocated buffer state.
*/
- YY_BUFFER_STATE _mesa_glsl_lexer__create_buffer (FILE * file, int size , yyscan_t yyscanner)
+ YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
- b = (YY_BUFFER_STATE) _mesa_glsl_lexer_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer__create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_buf_size = size;
/* yy_ch_buf has to be 2 characters longer than the size given because
* we need to put in 2 end-of-buffer characters.
*/
- b->yy_ch_buf = (char *) _mesa_glsl_lexer_alloc(b->yy_buf_size + 2 ,yyscanner );
+ b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
if ( ! b->yy_ch_buf )
- YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer__create_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
b->yy_is_our_buffer = 1;
- _mesa_glsl_lexer__init_buffer(b,file ,yyscanner);
+ yy_init_buffer( b, file , yyscanner);
return b;
}
/** Destroy the buffer.
- * @param b a buffer created with _mesa_glsl_lexer__create_buffer()
+ * @param b a buffer created with yy_create_buffer()
* @param yyscanner The scanner object.
*/
- void _mesa_glsl_lexer__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
@@ -3465,28 +3700,28 @@ static void _mesa_glsl_lexer__load_buffer_state (yyscan_t yyscanner)
YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
if ( b->yy_is_our_buffer )
- _mesa_glsl_lexer_free((void *) b->yy_ch_buf ,yyscanner );
+ yyfree( (void *) b->yy_ch_buf , yyscanner );
- _mesa_glsl_lexer_free((void *) b ,yyscanner );
+ yyfree( (void *) b , yyscanner );
}
/* Initializes or reinitializes a buffer.
* This function is sometimes called more than once on the same buffer,
- * such as during a _mesa_glsl_lexer_restart() or at EOF.
+ * such as during a yyrestart() or at EOF.
*/
- static void _mesa_glsl_lexer__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
+ static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
{
int oerrno = errno;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- _mesa_glsl_lexer__flush_buffer(b ,yyscanner);
+ yy_flush_buffer( b , yyscanner);
b->yy_input_file = file;
b->yy_fill_buffer = 1;
- /* If b is the current buffer, then _mesa_glsl_lexer__init_buffer was _probably_
- * called from _mesa_glsl_lexer_restart() or through yy_get_next_buffer.
+ /* If b is the current buffer, then yy_init_buffer was _probably_
+ * called from yyrestart() or through yy_get_next_buffer.
* In that case, we don't want to reset the lineno or column.
*/
if (b != YY_CURRENT_BUFFER){
@@ -3503,7 +3738,7 @@ static void _mesa_glsl_lexer__load_buffer_state (yyscan_t yyscanner)
* @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
* @param yyscanner The scanner object.
*/
- void _mesa_glsl_lexer__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+ void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if ( ! b )
@@ -3524,7 +3759,7 @@ static void _mesa_glsl_lexer__load_buffer_state (yyscan_t yyscanner)
b->yy_buffer_status = YY_BUFFER_NEW;
if ( b == YY_CURRENT_BUFFER )
- _mesa_glsl_lexer__load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
}
/** Pushes the new state onto the stack. The new state becomes
@@ -3533,15 +3768,15 @@ static void _mesa_glsl_lexer__load_buffer_state (yyscan_t yyscanner)
* @param new_buffer The new state.
* @param yyscanner The scanner object.
*/
-void _mesa_glsl_lexer_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (new_buffer == NULL)
return;
- _mesa_glsl_lexer_ensure_buffer_stack(yyscanner);
+ yyensure_buffer_stack(yyscanner);
- /* This block is copied from _mesa_glsl_lexer__switch_to_buffer. */
+ /* This block is copied from yy_switch_to_buffer. */
if ( YY_CURRENT_BUFFER )
{
/* Flush out information for old buffer. */
@@ -3555,8 +3790,8 @@ void _mesa_glsl_lexer_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t y
yyg->yy_buffer_stack_top++;
YY_CURRENT_BUFFER_LVALUE = new_buffer;
- /* copied from _mesa_glsl_lexer__switch_to_buffer. */
- _mesa_glsl_lexer__load_buffer_state(yyscanner );
+ /* copied from yy_switch_to_buffer. */
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
@@ -3564,19 +3799,19 @@ void _mesa_glsl_lexer_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t y
* The next element becomes the new top.
* @param yyscanner The scanner object.
*/
-void _mesa_glsl_lexer_pop_buffer_state (yyscan_t yyscanner)
+void yypop_buffer_state (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!YY_CURRENT_BUFFER)
return;
- _mesa_glsl_lexer__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+ yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
YY_CURRENT_BUFFER_LVALUE = NULL;
if (yyg->yy_buffer_stack_top > 0)
--yyg->yy_buffer_stack_top;
if (YY_CURRENT_BUFFER) {
- _mesa_glsl_lexer__load_buffer_state(yyscanner );
+ yy_load_buffer_state( yyscanner );
yyg->yy_did_buffer_switch_on_eof = 1;
}
}
@@ -3584,9 +3819,9 @@ void _mesa_glsl_lexer_pop_buffer_state (yyscan_t yyscanner)
/* Allocates the stack if it does not exist.
* Guarantees space for at least one push.
*/
-static void _mesa_glsl_lexer_ensure_buffer_stack (yyscan_t yyscanner)
+static void yyensure_buffer_stack (yyscan_t yyscanner)
{
- int num_to_alloc;
+ yy_size_t num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
if (!yyg->yy_buffer_stack) {
@@ -3595,15 +3830,15 @@ static void _mesa_glsl_lexer_ensure_buffer_stack (yyscan_t yyscanner)
* scanner will even need a stack. We use 2 instead of 1 to avoid an
* immediate realloc on the next call.
*/
- num_to_alloc = 1;
- yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_lexer_alloc
+ num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer_ensure_buffer_stack()" );
-
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
-
+
yyg->yy_buffer_stack_max = num_to_alloc;
yyg->yy_buffer_stack_top = 0;
return;
@@ -3612,15 +3847,15 @@ static void _mesa_glsl_lexer_ensure_buffer_stack (yyscan_t yyscanner)
if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
/* Increase the buffer to prepare for a possible push. */
- int grow_size = 8 /* arbitrary grow size */;
+ yy_size_t grow_size = 8 /* arbitrary grow size */;
num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
- yyg->yy_buffer_stack = (struct yy_buffer_state**)_mesa_glsl_lexer_realloc
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
(yyg->yy_buffer_stack,
num_to_alloc * sizeof(struct yy_buffer_state*)
, yyscanner);
if ( ! yyg->yy_buffer_stack )
- YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer_ensure_buffer_stack()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
/* zero only the new slots.*/
memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
@@ -3632,9 +3867,9 @@ static void _mesa_glsl_lexer_ensure_buffer_stack (yyscan_t yyscanner)
* @param base the character buffer
* @param size the size in bytes of the character buffer
* @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
+ * @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE _mesa_glsl_lexer__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
@@ -3642,49 +3877,49 @@ YY_BUFFER_STATE _mesa_glsl_lexer__scan_buffer (char * base, yy_size_t size , y
base[size-2] != YY_END_OF_BUFFER_CHAR ||
base[size-1] != YY_END_OF_BUFFER_CHAR )
/* They forgot to leave room for the EOB's. */
- return 0;
+ return NULL;
- b = (YY_BUFFER_STATE) _mesa_glsl_lexer_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
if ( ! b )
- YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer__scan_buffer()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
- b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_size = (int) (size - 2); /* "- 2" to take care of EOB's */
b->yy_buf_pos = b->yy_ch_buf = base;
b->yy_is_our_buffer = 0;
- b->yy_input_file = 0;
+ b->yy_input_file = NULL;
b->yy_n_chars = b->yy_buf_size;
b->yy_is_interactive = 0;
b->yy_at_bol = 1;
b->yy_fill_buffer = 0;
b->yy_buffer_status = YY_BUFFER_NEW;
- _mesa_glsl_lexer__switch_to_buffer(b ,yyscanner );
+ yy_switch_to_buffer( b , yyscanner );
return b;
}
-/** Setup the input buffer state to scan a string. The next call to _mesa_glsl_lexer_lex() will
+/** Setup the input buffer state to scan a string. The next call to yylex() will
* scan from a @e copy of @a str.
* @param yystr a NUL-terminated string to scan
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
* @note If you want to scan bytes that may contain NUL values, then use
- * _mesa_glsl_lexer__scan_bytes() instead.
+ * yy_scan_bytes() instead.
*/
-YY_BUFFER_STATE _mesa_glsl_lexer__scan_string (yyconst char * yystr , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
{
- return _mesa_glsl_lexer__scan_bytes(yystr,strlen(yystr) ,yyscanner);
+ return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
}
-/** Setup the input buffer state to scan the given bytes. The next call to _mesa_glsl_lexer_lex() will
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
-YY_BUFFER_STATE _mesa_glsl_lexer__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_bytes (const char * yybytes, int _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
@@ -3692,19 +3927,19 @@ YY_BUFFER_STATE _mesa_glsl_lexer__scan_bytes (yyconst char * yybytes, int _yyb
int i;
/* Get memory for full buffer, including space for trailing EOB's. */
- n = _yybytes_len + 2;
- buf = (char *) _mesa_glsl_lexer_alloc(n ,yyscanner );
+ n = (yy_size_t) (_yybytes_len + 2);
+ buf = (char *) yyalloc( n , yyscanner );
if ( ! buf )
- YY_FATAL_ERROR( "out of dynamic memory in _mesa_glsl_lexer__scan_bytes()" );
+ YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
for ( i = 0; i < _yybytes_len; ++i )
buf[i] = yybytes[i];
buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
- b = _mesa_glsl_lexer__scan_buffer(buf,n ,yyscanner);
+ b = yy_scan_buffer( buf, n , yyscanner);
if ( ! b )
- YY_FATAL_ERROR( "bad buffer in _mesa_glsl_lexer__scan_bytes()" );
+ YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
/* It's okay to grow etc. this buffer, and we should throw it
* away when we're done.
@@ -3718,9 +3953,11 @@ YY_BUFFER_STATE _mesa_glsl_lexer__scan_bytes (yyconst char * yybytes, int _yyb
#define YY_EXIT_FAILURE 2
#endif
-static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
+static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
{
- (void) fprintf( stderr, "%s\n", msg );
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ (void)yyg;
+ fprintf( stderr, "%s\n", msg );
exit( YY_EXIT_FAILURE );
}
@@ -3746,7 +3983,7 @@ static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
/** Get the user-defined data for this scanner.
* @param yyscanner The scanner object.
*/
-YY_EXTRA_TYPE _mesa_glsl_lexer_get_extra (yyscan_t yyscanner)
+YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyextra;
@@ -3755,10 +3992,10 @@ YY_EXTRA_TYPE _mesa_glsl_lexer_get_extra (yyscan_t yyscanner)
/** Get the current line number.
* @param yyscanner The scanner object.
*/
-int _mesa_glsl_lexer_get_lineno (yyscan_t yyscanner)
+int yyget_lineno (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+
if (! YY_CURRENT_BUFFER)
return 0;
@@ -3768,10 +4005,10 @@ int _mesa_glsl_lexer_get_lineno (yyscan_t yyscanner)
/** Get the current column number.
* @param yyscanner The scanner object.
*/
-int _mesa_glsl_lexer_get_column (yyscan_t yyscanner)
+int yyget_column (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
-
+
if (! YY_CURRENT_BUFFER)
return 0;
@@ -3781,7 +4018,7 @@ int _mesa_glsl_lexer_get_column (yyscan_t yyscanner)
/** Get the input stream.
* @param yyscanner The scanner object.
*/
-FILE *_mesa_glsl_lexer_get_in (yyscan_t yyscanner)
+FILE *yyget_in (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyin;
@@ -3790,7 +4027,7 @@ FILE *_mesa_glsl_lexer_get_in (yyscan_t yyscanner)
/** Get the output stream.
* @param yyscanner The scanner object.
*/
-FILE *_mesa_glsl_lexer_get_out (yyscan_t yyscanner)
+FILE *yyget_out (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyout;
@@ -3799,7 +4036,7 @@ FILE *_mesa_glsl_lexer_get_out (yyscan_t yyscanner)
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
-int _mesa_glsl_lexer_get_leng (yyscan_t yyscanner)
+int yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
@@ -3809,7 +4046,7 @@ int _mesa_glsl_lexer_get_leng (yyscan_t yyscanner)
* @param yyscanner The scanner object.
*/
-char *_mesa_glsl_lexer_get_text (yyscan_t yyscanner)
+char *yyget_text (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yytext;
@@ -3819,93 +4056,93 @@ char *_mesa_glsl_lexer_get_text (yyscan_t yyscanner)
* @param user_defined The data to be associated with this scanner.
* @param yyscanner The scanner object.
*/
-void _mesa_glsl_lexer_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
+void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yyextra = user_defined ;
}
/** Set the current line number.
- * @param line_number
+ * @param _line_number line number
* @param yyscanner The scanner object.
*/
-void _mesa_glsl_lexer_set_lineno (int line_number , yyscan_t yyscanner)
+void yyset_lineno (int _line_number , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- yy_fatal_error( "_mesa_glsl_lexer_set_lineno called with no buffer" , yyscanner);
+ YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
- yylineno = line_number;
+ yylineno = _line_number;
}
/** Set the current column.
- * @param line_number
+ * @param _column_no column number
* @param yyscanner The scanner object.
*/
-void _mesa_glsl_lexer_set_column (int column_no , yyscan_t yyscanner)
+void yyset_column (int _column_no , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
- yy_fatal_error( "_mesa_glsl_lexer_set_column called with no buffer" , yyscanner);
+ YY_FATAL_ERROR( "yyset_column called with no buffer" );
- yycolumn = column_no;
+ yycolumn = _column_no;
}
/** Set the input stream. This does not discard the current
* input buffer.
- * @param in_str A readable stream.
+ * @param _in_str A readable stream.
* @param yyscanner The scanner object.
- * @see _mesa_glsl_lexer__switch_to_buffer
+ * @see yy_switch_to_buffer
*/
-void _mesa_glsl_lexer_set_in (FILE * in_str , yyscan_t yyscanner)
+void yyset_in (FILE * _in_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- yyin = in_str ;
+ yyin = _in_str ;
}
-void _mesa_glsl_lexer_set_out (FILE * out_str , yyscan_t yyscanner)
+void yyset_out (FILE * _out_str , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- yyout = out_str ;
+ yyout = _out_str ;
}
-int _mesa_glsl_lexer_get_debug (yyscan_t yyscanner)
+int yyget_debug (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yy_flex_debug;
}
-void _mesa_glsl_lexer_set_debug (int bdebug , yyscan_t yyscanner)
+void yyset_debug (int _bdebug , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
- yy_flex_debug = bdebug ;
+ yy_flex_debug = _bdebug ;
}
/* Accessor methods for yylval and yylloc */
-YYSTYPE * _mesa_glsl_lexer_get_lval (yyscan_t yyscanner)
+YYSTYPE * yyget_lval (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yylval;
}
-void _mesa_glsl_lexer_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
+void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yylval = yylval_param;
}
-YYLTYPE *_mesa_glsl_lexer_get_lloc (yyscan_t yyscanner)
+YYLTYPE *yyget_lloc (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yylloc;
}
-void _mesa_glsl_lexer_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
+void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
yylloc = yylloc_param;
@@ -3913,20 +4150,18 @@ void _mesa_glsl_lexer_set_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner)
/* User-visible API */
-/* _mesa_glsl_lexer_lex_init is special because it creates the scanner itself, so it is
+/* yylex_init is special because it creates the scanner itself, so it is
* the ONLY reentrant function that doesn't take the scanner as the last argument.
* That's why we explicitly handle the declaration, instead of using our macros.
*/
-
-int _mesa_glsl_lexer_lex_init(yyscan_t* ptr_yy_globals)
-
+int yylex_init(yyscan_t* ptr_yy_globals)
{
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
- *ptr_yy_globals = (yyscan_t) _mesa_glsl_lexer_alloc ( sizeof( struct yyguts_t ), NULL );
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
@@ -3939,39 +4174,37 @@ int _mesa_glsl_lexer_lex_init(yyscan_t* ptr_yy_globals)
return yy_init_globals ( *ptr_yy_globals );
}
-/* _mesa_glsl_lexer_lex_init_extra has the same functionality as _mesa_glsl_lexer_lex_init, but follows the
+/* yylex_init_extra has the same functionality as yylex_init, but follows the
* convention of taking the scanner as the last argument. Note however, that
* this is a *pointer* to a scanner, as it will be allocated by this call (and
* is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to _mesa_glsl_lexer_alloc in
+ * The user defined value in the first argument will be available to yyalloc in
* the yyextra field.
*/
-
-int _mesa_glsl_lexer_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
-
+int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
{
struct yyguts_t dummy_yyguts;
- _mesa_glsl_lexer_set_extra (yy_user_defined, &dummy_yyguts);
+ yyset_extra (yy_user_defined, &dummy_yyguts);
if (ptr_yy_globals == NULL){
errno = EINVAL;
return 1;
}
-
- *ptr_yy_globals = (yyscan_t) _mesa_glsl_lexer_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
-
+
+ *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+
if (*ptr_yy_globals == NULL){
errno = ENOMEM;
return 1;
}
-
+
/* By setting to 0xAA, we expose bugs in
yy_init_globals. Leave at 0x00 for releases. */
memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
-
- _mesa_glsl_lexer_set_extra (yy_user_defined, *ptr_yy_globals);
-
+
+ yyset_extra (yy_user_defined, *ptr_yy_globals);
+
return yy_init_globals ( *ptr_yy_globals );
}
@@ -3979,13 +4212,13 @@ static int yy_init_globals (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Initialization is the same as for the non-reentrant scanner.
- * This function is called from _mesa_glsl_lexer_lex_destroy(), so don't allocate here.
+ * This function is called from yylex_destroy(), so don't allocate here.
*/
- yyg->yy_buffer_stack = 0;
+ yyg->yy_buffer_stack = NULL;
yyg->yy_buffer_stack_top = 0;
yyg->yy_buffer_stack_max = 0;
- yyg->yy_c_buf_p = (char *) 0;
+ yyg->yy_c_buf_p = NULL;
yyg->yy_init = 0;
yyg->yy_start = 0;
@@ -3998,42 +4231,42 @@ static int yy_init_globals (yyscan_t yyscanner)
yyin = stdin;
yyout = stdout;
#else
- yyin = (FILE *) 0;
- yyout = (FILE *) 0;
+ yyin = NULL;
+ yyout = NULL;
#endif
/* For future reference: Set errno on error, since we are called by
- * _mesa_glsl_lexer_lex_init()
+ * yylex_init()
*/
return 0;
}
-/* _mesa_glsl_lexer_lex_destroy is for both reentrant and non-reentrant scanners. */
-int _mesa_glsl_lexer_lex_destroy (yyscan_t yyscanner)
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
/* Pop the buffer stack, destroying each element. */
while(YY_CURRENT_BUFFER){
- _mesa_glsl_lexer__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+ yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
YY_CURRENT_BUFFER_LVALUE = NULL;
- _mesa_glsl_lexer_pop_buffer_state(yyscanner);
+ yypop_buffer_state(yyscanner);
}
/* Destroy the stack itself. */
- _mesa_glsl_lexer_free(yyg->yy_buffer_stack ,yyscanner);
+ yyfree(yyg->yy_buffer_stack , yyscanner);
yyg->yy_buffer_stack = NULL;
/* Destroy the start condition stack. */
- _mesa_glsl_lexer_free(yyg->yy_start_stack ,yyscanner );
+ yyfree( yyg->yy_start_stack , yyscanner );
yyg->yy_start_stack = NULL;
/* Reset the globals. This is important in a non-reentrant scanner so the next time
- * _mesa_glsl_lexer_lex() is called, initialization will occur. */
+ * yylex() is called, initialization will occur. */
yy_init_globals( yyscanner);
/* Destroy the main struct (reentrant only). */
- _mesa_glsl_lexer_free ( yyscanner , yyscanner );
+ yyfree ( yyscanner , yyscanner );
yyscanner = NULL;
return 0;
}
@@ -4043,18 +4276,21 @@ int _mesa_glsl_lexer_lex_destroy (yyscan_t yyscanner)
*/
#ifndef yytext_ptr
-static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
+static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
{
- register int i;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ (void)yyg;
+
+ int i;
for ( i = 0; i < n; ++i )
s1[i] = s2[i];
}
#endif
#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
+static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
{
- register int n;
+ int n;
for ( n = 0; s[n]; ++n )
;
@@ -4062,13 +4298,18 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
}
#endif
-void *_mesa_glsl_lexer_alloc (yy_size_t size , yyscan_t yyscanner)
+void *yyalloc (yy_size_t size , yyscan_t yyscanner)
{
- return (void *) malloc( size );
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ (void)yyg;
+ return malloc(size);
}
-void *_mesa_glsl_lexer_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
+void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ (void)yyg;
+
/* The cast to (char *) in the following accommodates both
* implementations that use char* generic pointers, and those
* that use void* generic pointers. It works with the latter
@@ -4076,18 +4317,19 @@ void *_mesa_glsl_lexer_realloc (void * ptr, yy_size_t size , yyscan_t yyscanne
* any pointer type to void*, and deal with argument conversions
* as though doing an assignment.
*/
- return (void *) realloc( (char *) ptr, size );
+ return realloc(ptr, size);
}
-void _mesa_glsl_lexer_free (void * ptr , yyscan_t yyscanner)
+void yyfree (void * ptr , yyscan_t yyscanner)
{
- free( (char *) ptr ); /* see _mesa_glsl_lexer_realloc() for (char *) cast */
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ (void)yyg;
+ free( (char *) ptr ); /* see yyrealloc() for (char *) cast */
}
#define YYTABLES_NAME "yytables"
-#line 572 "src/glsl/glsl_lexer.ll"
-
+#line 573 "src/glsl/glsl_lexer.ll"
int
@@ -4104,13 +4346,13 @@ classify_identifier(struct _mesa_glsl_parse_state *state, const char *name)
void
_mesa_glsl_lexer_ctor(struct _mesa_glsl_parse_state *state, const char *string)
{
- _mesa_glsl_lexer_lex_init_extra(state,& state->scanner);
- _mesa_glsl_lexer__scan_string(string,state->scanner);
+ yylex_init_extra(state, & state->scanner);
+ yy_scan_string(string, state->scanner);
}
void
_mesa_glsl_lexer_dtor(struct _mesa_glsl_parse_state *state)
{
- _mesa_glsl_lexer_lex_destroy(state->scanner);
+ yylex_destroy(state->scanner);
}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser.cpp
index 42418d6ba63..9e4ae96b430 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser.cpp
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 3.5.1. */
/* Bison implementation for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
+ Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -40,11 +41,14 @@
define necessary library symbols; they are noted "INFRINGES ON
USER NAME SPACE" below. */
+/* Undocumented macros, especially those whose name start with YY_,
+ are private implementation details. Do not rely on them. */
+
/* Identify Bison output. */
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.0.2"
+#define YYBISON_VERSION "3.5.1"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -66,9 +70,8 @@
#define yydebug _mesa_glsl_debug
#define yynerrs _mesa_glsl_nerrs
-
-/* Copy the first part of user declarations. */
-#line 1 "src/glsl/glsl_parser.yy" /* yacc.c:339 */
+/* First part of user prologue. */
+#line 1 "src/glsl/glsl_parser.yy"
/*
* Copyright © 2008, 2009 Intel Corporation
@@ -149,13 +152,26 @@ static bool match_layout_qualifier(const char *s1, const char *s2,
return strcasecmp(s1, s2);
}
-#line 153 "src/glsl/glsl_parser.cpp" /* yacc.c:339 */
+#line 156 "src/glsl/glsl_parser.cpp"
+# ifndef YY_CAST
+# ifdef __cplusplus
+# define YY_CAST(Type, Val) static_cast<Type> (Val)
+# define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast<Type> (Val)
+# else
+# define YY_CAST(Type, Val) ((Type) (Val))
+# define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val))
+# endif
+# endif
# ifndef YY_NULLPTR
-# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULLPTR nullptr
+# if defined __cplusplus
+# if 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
# else
-# define YY_NULLPTR 0
+# define YY_NULLPTR ((void*)0)
# endif
# endif
@@ -167,8 +183,8 @@ static bool match_layout_qualifier(const char *s1, const char *s2,
# define YYERROR_VERBOSE 1
#endif
-/* In a future release of Bison, this section will be replaced
- by #include "glsl_parser.h". */
+/* Use api.header.include to #include this header
+ instead of duplicating it here. */
#ifndef YY__MESA_GLSL_SRC_GLSL_GLSL_PARSER_H_INCLUDED
# define YY__MESA_GLSL_SRC_GLSL_GLSL_PARSER_H_INCLUDED
/* Debug traces. */
@@ -419,10 +435,9 @@ extern int _mesa_glsl_debug;
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE YYSTYPE;
union YYSTYPE
{
-#line 99 "src/glsl/glsl_parser.yy" /* yacc.c:355 */
+#line 99 "src/glsl/glsl_parser.yy"
int n;
float real;
@@ -459,8 +474,10 @@ union YYSTYPE
ast_node *else_statement;
} selection_rest_statement;
-#line 463 "src/glsl/glsl_parser.cpp" /* yacc.c:355 */
+#line 478 "src/glsl/glsl_parser.cpp"
+
};
+typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
@@ -485,36 +502,81 @@ int _mesa_glsl_parse (struct _mesa_glsl_parse_state *state);
#endif /* !YY__MESA_GLSL_SRC_GLSL_GLSL_PARSER_H_INCLUDED */
-/* Copy the second part of user declarations. */
-#line 491 "src/glsl/glsl_parser.cpp" /* yacc.c:358 */
#ifdef short
# undef short
#endif
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
+/* On compilers that do not define __PTRDIFF_MAX__ etc., make sure
+ <limits.h> and (if available) <stdint.h> are included
+ so that the code can choose integer types of a good width. */
+
+#ifndef __PTRDIFF_MAX__
+# include <limits.h> /* INFRINGES ON USER NAME SPACE */
+# if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
+# include <stdint.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_STDINT_H
+# endif
#endif
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
+/* Narrow types that promote to a signed type and that can represent a
+ signed or unsigned integer of at least N bits. In tables they can
+ save space and decrease cache pressure. Promoting to a signed type
+ helps avoid bugs in integer arithmetic. */
+
+#ifdef __INT_LEAST8_MAX__
+typedef __INT_LEAST8_TYPE__ yytype_int8;
+#elif defined YY_STDINT_H
+typedef int_least8_t yytype_int8;
#else
typedef signed char yytype_int8;
#endif
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
+#ifdef __INT_LEAST16_MAX__
+typedef __INT_LEAST16_TYPE__ yytype_int16;
+#elif defined YY_STDINT_H
+typedef int_least16_t yytype_int16;
#else
-typedef unsigned short int yytype_uint16;
+typedef short yytype_int16;
#endif
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
+#if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST8_TYPE__ yytype_uint8;
+#elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST8_MAX <= INT_MAX)
+typedef uint_least8_t yytype_uint8;
+#elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX
+typedef unsigned char yytype_uint8;
#else
-typedef short int yytype_int16;
+typedef short yytype_uint8;
+#endif
+
+#if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__
+typedef __UINT_LEAST16_TYPE__ yytype_uint16;
+#elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \
+ && UINT_LEAST16_MAX <= INT_MAX)
+typedef uint_least16_t yytype_uint16;
+#elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX
+typedef unsigned short yytype_uint16;
+#else
+typedef int yytype_uint16;
+#endif
+
+#ifndef YYPTRDIFF_T
+# if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__
+# define YYPTRDIFF_T __PTRDIFF_TYPE__
+# define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__
+# elif defined PTRDIFF_MAX
+# ifndef ptrdiff_t
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# endif
+# define YYPTRDIFF_T ptrdiff_t
+# define YYPTRDIFF_MAXIMUM PTRDIFF_MAX
+# else
+# define YYPTRDIFF_T long
+# define YYPTRDIFF_MAXIMUM LONG_MAX
+# endif
#endif
#ifndef YYSIZE_T
@@ -522,15 +584,27 @@ typedef short int yytype_int16;
# define YYSIZE_T __SIZE_TYPE__
# elif defined size_t
# define YYSIZE_T size_t
-# elif ! defined YYSIZE_T
+# elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__
# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
# define YYSIZE_T size_t
# else
-# define YYSIZE_T unsigned int
+# define YYSIZE_T unsigned
# endif
#endif
-#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+#define YYSIZE_MAXIMUM \
+ YY_CAST (YYPTRDIFF_T, \
+ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \
+ ? YYPTRDIFF_MAXIMUM \
+ : YY_CAST (YYSIZE_T, -1)))
+
+#define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X))
+
+/* Stored state numbers (used for stacks). */
+typedef yytype_int16 yy_state_t;
+
+/* State numbers in computations. */
+typedef int yy_state_fast_t;
#ifndef YY_
# if defined YYENABLE_NLS && YYENABLE_NLS
@@ -544,30 +618,19 @@ typedef short int yytype_int16;
# endif
#endif
-#ifndef YY_ATTRIBUTE
-# if (defined __GNUC__ \
- && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
- || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+#ifndef YY_ATTRIBUTE_PURE
+# if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_PURE __attribute__ ((__pure__))
# else
-# define YY_ATTRIBUTE(Spec) /* empty */
+# define YY_ATTRIBUTE_PURE
# endif
#endif
-#ifndef YY_ATTRIBUTE_PURE
-# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
-#endif
-
#ifndef YY_ATTRIBUTE_UNUSED
-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
-#endif
-
-#if !defined _Noreturn \
- && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-# define _Noreturn __declspec (noreturn)
+# if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__)
+# define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__))
# else
-# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+# define YY_ATTRIBUTE_UNUSED
# endif
#endif
@@ -578,13 +641,13 @@ typedef short int yytype_int16;
# define YYUSE(E) /* empty */
#endif
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
/* Suppress an incorrect diagnostic about yylval being uninitialized. */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
- _Pragma ("GCC diagnostic push") \
- _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \
_Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
_Pragma ("GCC diagnostic pop")
#else
# define YY_INITIAL_VALUE(Value) Value
@@ -597,6 +660,20 @@ typedef short int yytype_int16;
# define YY_INITIAL_VALUE(Value) /* Nothing. */
#endif
+#if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__
+# define YY_IGNORE_USELESS_CAST_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"")
+# define YY_IGNORE_USELESS_CAST_END \
+ _Pragma ("GCC diagnostic pop")
+#endif
+#ifndef YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_BEGIN
+# define YY_IGNORE_USELESS_CAST_END
+#endif
+
+
+#define YY_ASSERT(E) ((void) (0 && (E)))
#if ! defined yyoverflow || YYERROR_VERBOSE
@@ -674,18 +751,19 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
/* A type that is properly aligned for any stack member. */
union yyalloc
{
- yytype_int16 yyss_alloc;
+ yy_state_t yyss_alloc;
YYSTYPE yyvs_alloc;
YYLTYPE yyls_alloc;
};
/* The size of the maximum gap between one aligned stack and the next. */
-# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+# define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1)
/* The size of an array large to enough to hold all stacks, each with
N elements. */
# define YYSTACK_BYTES(N) \
- ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \
+ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE) \
+ + YYSIZEOF (YYLTYPE)) \
+ 2 * YYSTACK_GAP_MAXIMUM)
# define YYCOPY_NEEDED 1
@@ -698,11 +776,11 @@ union yyalloc
# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
do \
{ \
- YYSIZE_T yynewbytes; \
+ YYPTRDIFF_T yynewbytes; \
YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
Stack = &yyptr->Stack_alloc; \
- yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
- yyptr += yynewbytes / sizeof (*yyptr); \
+ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / YYSIZEOF (*yyptr); \
} \
while (0)
@@ -714,12 +792,12 @@ union yyalloc
# ifndef YYCOPY
# if defined __GNUC__ && 1 < __GNUC__
# define YYCOPY(Dst, Src, Count) \
- __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
# else
# define YYCOPY(Dst, Src, Count) \
do \
{ \
- YYSIZE_T yyi; \
+ YYPTRDIFF_T yyi; \
for (yyi = 0; yyi < (Count); yyi++) \
(Dst)[yyi] = (Src)[yyi]; \
} \
@@ -742,17 +820,18 @@ union yyalloc
/* YYNSTATES -- Number of states. */
#define YYNSTATES 540
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
- by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
#define YYMAXUTOK 487
+
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, with out-of-bounds checking. */
#define YYTRANSLATE(YYX) \
- ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+ (0 <= (YYX) && (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
- as returned by yylex, without out-of-bounds checking. */
-static const yytype_uint16 yytranslate[] =
+ as returned by yylex. */
+static const yytype_int16 yytranslate[] =
{
0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
@@ -807,7 +886,7 @@ static const yytype_uint16 yytranslate[] =
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
-static const yytype_uint16 yyrline[] =
+static const yytype_int16 yyrline[] =
{
0, 303, 303, 302, 314, 316, 323, 333, 334, 335,
336, 337, 350, 352, 356, 357, 358, 362, 371, 379,
@@ -950,7 +1029,7 @@ static const char *const yytname[] =
# ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
(internal) symbol number NUM (which must be that of a token). */
-static const yytype_uint16 yytoknum[] =
+static const yytype_int16 yytoknum[] =
{
0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
@@ -981,14 +1060,14 @@ static const yytype_uint16 yytoknum[] =
};
# endif
-#define YYPACT_NINF -414
+#define YYPACT_NINF (-414)
-#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-414)))
+#define yypact_value_is_default(Yyn) \
+ ((Yyn) == YYPACT_NINF)
-#define YYTABLE_NINF -378
+#define YYTABLE_NINF (-378)
-#define yytable_value_is_error(Yytable_value) \
+#define yytable_value_is_error(Yyn) \
0
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
@@ -1054,7 +1133,7 @@ static const yytype_int16 yypact[] =
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
Performed when YYTABLE does not specify something else to do. Zero
means the default is an error. */
-static const yytype_uint16 yydefact[] =
+static const yytype_int16 yydefact[] =
{
4, 0, 0, 12, 0, 1, 2, 14, 15, 16,
5, 0, 0, 0, 13, 6, 0, 179, 178, 203,
@@ -2247,7 +2326,7 @@ static const yytype_int16 yycheck[] =
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
symbol of state STATE-NUM. */
-static const yytype_uint16 yystos[] =
+static const yytype_int16 yystos[] =
{
0, 174, 258, 260, 142, 0, 262, 138, 139, 140,
178, 263, 175, 259, 264, 178, 263, 3, 4, 5,
@@ -2306,7 +2385,7 @@ static const yytype_uint16 yystos[] =
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
-static const yytype_uint16 yyr1[] =
+static const yytype_int16 yyr1[] =
{
0, 257, 259, 258, 260, 260, 260, 261, 261, 261,
261, 261, 262, 262, 263, 263, 263, 264, 265, 265,
@@ -2350,7 +2429,7 @@ static const yytype_uint16 yyr1[] =
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
-static const yytype_uint8 yyr2[] =
+static const yytype_int8 yyr2[] =
{
0, 2, 0, 4, 0, 3, 4, 2, 2, 2,
2, 2, 0, 2, 1, 1, 1, 5, 1, 2,
@@ -2406,22 +2485,22 @@ static const yytype_uint8 yyr2[] =
#define YYRECOVERING() (!!yyerrstatus)
-#define YYBACKUP(Token, Value) \
-do \
- if (yychar == YYEMPTY) \
- { \
- yychar = (Token); \
- yylval = (Value); \
- YYPOPSTACK (yylen); \
- yystate = *yyssp; \
- goto yybackup; \
- } \
- else \
- { \
- yyerror (&yylloc, state, YY_("syntax error: cannot back up")); \
- YYERROR; \
- } \
-while (0)
+#define YYBACKUP(Token, Value) \
+ do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (&yylloc, state, YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+ while (0)
/* Error token number */
#define YYTERROR 1
@@ -2480,10 +2559,10 @@ do { \
/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
YY_ATTRIBUTE_UNUSED
-static unsigned
+static int
yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
{
- unsigned res = 0;
+ int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
@@ -2526,41 +2605,43 @@ do { \
} while (0)
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT. |
-`----------------------------------------*/
+/*-----------------------------------.
+| Print this symbol's value on YYO. |
+`-----------------------------------*/
static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct _mesa_glsl_parse_state *state)
+yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct _mesa_glsl_parse_state *state)
{
- FILE *yyo = yyoutput;
- YYUSE (yyo);
+ FILE *yyoutput = yyo;
+ YYUSE (yyoutput);
YYUSE (yylocationp);
YYUSE (state);
if (!yyvaluep)
return;
# ifdef YYPRINT
if (yytype < YYNTOKENS)
- YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+ YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
# endif
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
YYUSE (yytype);
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
}
-/*--------------------------------.
-| Print this symbol on YYOUTPUT. |
-`--------------------------------*/
+/*---------------------------.
+| Print this symbol on YYO. |
+`---------------------------*/
static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct _mesa_glsl_parse_state *state)
+yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, struct _mesa_glsl_parse_state *state)
{
- YYFPRINTF (yyoutput, "%s %s (",
+ YYFPRINTF (yyo, "%s %s (",
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
- YY_LOCATION_PRINT (yyoutput, *yylocationp);
- YYFPRINTF (yyoutput, ": ");
- yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, state);
- YYFPRINTF (yyoutput, ")");
+ YY_LOCATION_PRINT (yyo, *yylocationp);
+ YYFPRINTF (yyo, ": ");
+ yy_symbol_value_print (yyo, yytype, yyvaluep, yylocationp, state);
+ YYFPRINTF (yyo, ")");
}
/*------------------------------------------------------------------.
@@ -2569,7 +2650,7 @@ yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYL
`------------------------------------------------------------------*/
static void
-yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop)
{
YYFPRINTF (stderr, "Stack now");
for (; yybottom <= yytop; yybottom++)
@@ -2592,20 +2673,20 @@ do { \
`------------------------------------------------*/
static void
-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, struct _mesa_glsl_parse_state *state)
+yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, struct _mesa_glsl_parse_state *state)
{
- unsigned long int yylno = yyrline[yyrule];
+ int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
int yyi;
- YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n",
yyrule - 1, yylno);
/* The symbols being reduced. */
for (yyi = 0; yyi < yynrhs; yyi++)
{
YYFPRINTF (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr,
- yystos[yyssp[yyi + 1 - yynrhs]],
- &(yyvsp[(yyi + 1) - (yynrhs)])
+ yystos[+yyssp[yyi + 1 - yynrhs]],
+ &yyvsp[(yyi + 1) - (yynrhs)]
, &(yylsp[(yyi + 1) - (yynrhs)]) , state);
YYFPRINTF (stderr, "\n");
}
@@ -2649,13 +2730,13 @@ int yydebug;
# ifndef yystrlen
# if defined __GLIBC__ && defined _STRING_H
-# define yystrlen strlen
+# define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S)))
# else
/* Return the length of YYSTR. */
-static YYSIZE_T
+static YYPTRDIFF_T
yystrlen (const char *yystr)
{
- YYSIZE_T yylen;
+ YYPTRDIFF_T yylen;
for (yylen = 0; yystr[yylen]; yylen++)
continue;
return yylen;
@@ -2691,12 +2772,12 @@ yystpcpy (char *yydest, const char *yysrc)
backslash-backslash). YYSTR is taken from yytname. If YYRES is
null, do not copy; instead, return the length of what the result
would have been. */
-static YYSIZE_T
+static YYPTRDIFF_T
yytnamerr (char *yyres, const char *yystr)
{
if (*yystr == '"')
{
- YYSIZE_T yyn = 0;
+ YYPTRDIFF_T yyn = 0;
char const *yyp = yystr;
for (;;)
@@ -2709,7 +2790,10 @@ yytnamerr (char *yyres, const char *yystr)
case '\\':
if (*++yyp != '\\')
goto do_not_strip_quotes;
- /* Fall through. */
+ else
+ goto append;
+
+ append:
default:
if (yyres)
yyres[yyn] = *yyp;
@@ -2724,10 +2808,10 @@ yytnamerr (char *yyres, const char *yystr)
do_not_strip_quotes: ;
}
- if (! yyres)
+ if (yyres)
+ return yystpcpy (yyres, yystr) - yyres;
+ else
return yystrlen (yystr);
-
- return yystpcpy (yyres, yystr) - yyres;
}
# endif
@@ -2740,19 +2824,19 @@ yytnamerr (char *yyres, const char *yystr)
*YYMSG_ALLOC to the required number of bytes. Return 2 if the
required number of bytes is too large to store. */
static int
-yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
- yytype_int16 *yyssp, int yytoken)
+yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg,
+ yy_state_t *yyssp, int yytoken)
{
- YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
- YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
const char *yyformat = YY_NULLPTR;
- /* Arguments of yyformat. */
+ /* Arguments of yyformat: reported tokens (one for the "unexpected",
+ one per "expected"). */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
- /* Number of reported tokens (one for the "unexpected", one per
- "expected"). */
+ /* Actual size of YYARG. */
int yycount = 0;
+ /* Cumulated lengths of YYARG. */
+ YYPTRDIFF_T yysize = 0;
/* There are many possibilities here to consider:
- If this state is a consistent state with a default action, then
@@ -2779,7 +2863,9 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
*/
if (yytoken != YYEMPTY)
{
- int yyn = yypact[*yyssp];
+ int yyn = yypact[+*yyssp];
+ YYPTRDIFF_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
+ yysize = yysize0;
yyarg[yycount++] = yytname[yytoken];
if (!yypact_value_is_default (yyn))
{
@@ -2804,11 +2890,12 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
}
yyarg[yycount++] = yytname[yyx];
{
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
- if (! (yysize <= yysize1
- && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ YYPTRDIFF_T yysize1
+ = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+ yysize = yysize1;
+ else
return 2;
- yysize = yysize1;
}
}
}
@@ -2820,6 +2907,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
case N: \
yyformat = S; \
break
+ default: /* Avoid compiler warnings. */
YYCASE_(0, YY_("syntax error"));
YYCASE_(1, YY_("syntax error, unexpected %s"));
YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
@@ -2830,10 +2918,13 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
}
{
- YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
- if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ /* Don't count the "%s"s in the final size, but reserve room for
+ the terminator. */
+ YYPTRDIFF_T yysize1 = yysize + (yystrlen (yyformat) - 2 * yycount) + 1;
+ if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+ yysize = yysize1;
+ else
return 2;
- yysize = yysize1;
}
if (*yymsg_alloc < yysize)
@@ -2859,8 +2950,8 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
}
else
{
- yyp++;
- yyformat++;
+ ++yyp;
+ ++yyformat;
}
}
return 0;
@@ -2917,7 +3008,7 @@ YYLTYPE yylloc = yyloc_default;
/* Number of syntax errors so far. */
int yynerrs;
- int yystate;
+ yy_state_fast_t yystate;
/* Number of tokens to shift before error messages enabled. */
int yyerrstatus;
@@ -2930,9 +3021,9 @@ YYLTYPE yylloc = yyloc_default;
to reallocate them elsewhere. */
/* The state stack. */
- yytype_int16 yyssa[YYINITDEPTH];
- yytype_int16 *yyss;
- yytype_int16 *yyssp;
+ yy_state_t yyssa[YYINITDEPTH];
+ yy_state_t *yyss;
+ yy_state_t *yyssp;
/* The semantic value stack. */
YYSTYPE yyvsa[YYINITDEPTH];
@@ -2947,7 +3038,7 @@ YYLTYPE yylloc = yyloc_default;
/* The locations where the error started and ended. */
YYLTYPE yyerror_range[3];
- YYSIZE_T yystacksize;
+ YYPTRDIFF_T yystacksize;
int yyn;
int yyresult;
@@ -2962,7 +3053,7 @@ YYLTYPE yylloc = yyloc_default;
/* Buffer for error messages, and its allocated size. */
char yymsgbuf[128];
char *yymsg = yymsgbuf;
- YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+ YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf;
#endif
#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N))
@@ -2984,7 +3075,7 @@ YYLTYPE yylloc = yyloc_default;
yychar = YYEMPTY; /* Cause a token to be read. */
/* User initialization code. */
-#line 88 "src/glsl/glsl_parser.yy" /* yacc.c:1429 */
+#line 88 "src/glsl/glsl_parser.yy"
{
yylloc.first_line = 1;
yylloc.first_column = 1;
@@ -2993,33 +3084,46 @@ YYLTYPE yylloc = yyloc_default;
yylloc.source = 0;
}
-#line 2997 "src/glsl/glsl_parser.cpp" /* yacc.c:1429 */
+#line 3088 "src/glsl/glsl_parser.cpp"
+
yylsp[0] = yylloc;
goto yysetstate;
+
/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
+| yynewstate -- push a new state, which is found in yystate. |
`------------------------------------------------------------*/
- yynewstate:
+yynewstate:
/* In all cases, when you get here, the value and location stacks
have just been pushed. So pushing a state here evens the stacks. */
yyssp++;
- yysetstate:
- *yyssp = yystate;
+
+/*--------------------------------------------------------------------.
+| yysetstate -- set current state (the top of the stack) to yystate. |
+`--------------------------------------------------------------------*/
+yysetstate:
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+ YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
+ YY_IGNORE_USELESS_CAST_BEGIN
+ *yyssp = YY_CAST (yy_state_t, yystate);
+ YY_IGNORE_USELESS_CAST_END
if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+ goto yyexhaustedlab;
+#else
{
/* Get the current used size of the three stacks, in elements. */
- YYSIZE_T yysize = yyssp - yyss + 1;
+ YYPTRDIFF_T yysize = yyssp - yyss + 1;
-#ifdef yyoverflow
+# if defined yyoverflow
{
/* Give user a chance to reallocate the stack. Use copies of
these so that the &'s don't force the real ones into
memory. */
+ yy_state_t *yyss1 = yyss;
YYSTYPE *yyvs1 = yyvs;
- yytype_int16 *yyss1 = yyss;
YYLTYPE *yyls1 = yyls;
/* Each stack pointer address is followed by the size of the
@@ -3027,19 +3131,15 @@ YYLTYPE yylloc = yyloc_default;
conditional around just the two extra args, but that might
be undefined if yyoverflow is a macro. */
yyoverflow (YY_("memory exhausted"),
- &yyss1, yysize * sizeof (*yyssp),
- &yyvs1, yysize * sizeof (*yyvsp),
- &yyls1, yysize * sizeof (*yylsp),
+ &yyss1, yysize * YYSIZEOF (*yyssp),
+ &yyvs1, yysize * YYSIZEOF (*yyvsp),
+ &yyls1, yysize * YYSIZEOF (*yylsp),
&yystacksize);
-
- yyls = yyls1;
yyss = yyss1;
yyvs = yyvs1;
+ yyls = yyls1;
}
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
- goto yyexhaustedlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
/* Extend the stack our own way. */
if (YYMAXDEPTH <= yystacksize)
goto yyexhaustedlab;
@@ -3048,44 +3148,45 @@ YYLTYPE yylloc = yyloc_default;
yystacksize = YYMAXDEPTH;
{
- yytype_int16 *yyss1 = yyss;
+ yy_state_t *yyss1 = yyss;
union yyalloc *yyptr =
- (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ YY_CAST (union yyalloc *,
+ YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
if (! yyptr)
goto yyexhaustedlab;
YYSTACK_RELOCATE (yyss_alloc, yyss);
YYSTACK_RELOCATE (yyvs_alloc, yyvs);
YYSTACK_RELOCATE (yyls_alloc, yyls);
-# undef YYSTACK_RELOCATE
+# undef YYSTACK_RELOCATE
if (yyss1 != yyssa)
YYSTACK_FREE (yyss1);
}
# endif
-#endif /* no yyoverflow */
yyssp = yyss + yysize - 1;
yyvsp = yyvs + yysize - 1;
yylsp = yyls + yysize - 1;
- YYDPRINTF ((stderr, "Stack size increased to %lu\n",
- (unsigned long int) yystacksize));
+ YY_IGNORE_USELESS_CAST_BEGIN
+ YYDPRINTF ((stderr, "Stack size increased to %ld\n",
+ YY_CAST (long, yystacksize)));
+ YY_IGNORE_USELESS_CAST_END
if (yyss + yystacksize - 1 <= yyssp)
YYABORT;
}
-
- YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
if (yystate == YYFINAL)
YYACCEPT;
goto yybackup;
+
/*-----------.
| yybackup. |
`-----------*/
yybackup:
-
/* Do appropriate processing given the current state. Read a
lookahead token if we need one and don't already have one. */
@@ -3135,15 +3236,14 @@ yybackup:
/* Shift the lookahead token. */
YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
-
- /* Discard the shifted token. */
- yychar = YYEMPTY;
-
yystate = yyn;
YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
*++yyvsp = yylval;
YY_IGNORE_MAYBE_UNINITIALIZED_END
*++yylsp = yylloc;
+
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
goto yynewstate;
@@ -3158,7 +3258,7 @@ yydefault:
/*-----------------------------.
-| yyreduce -- Do a reduction. |
+| yyreduce -- do a reduction. |
`-----------------------------*/
yyreduce:
/* yyn is the number of a rule to reduce with. */
@@ -3174,54 +3274,55 @@ yyreduce:
GCC warning that YYVAL may be used uninitialized. */
yyval = yyvsp[1-yylen];
- /* Default location. */
+ /* Default location. */
YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
+ yyerror_range[1] = yyloc;
YY_REDUCE_PRINT (yyn);
switch (yyn)
{
- case 2:
-#line 303 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+ case 2:
+#line 303 "src/glsl/glsl_parser.yy"
+ {
_mesa_glsl_initialize_types(state);
}
-#line 3188 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3289 "src/glsl/glsl_parser.cpp"
break;
case 3:
-#line 307 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 307 "src/glsl/glsl_parser.yy"
+ {
delete state->symbols;
state->symbols = new(ralloc_parent(state)) glsl_symbol_table;
_mesa_glsl_initialize_types(state);
}
-#line 3198 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3299 "src/glsl/glsl_parser.cpp"
break;
case 5:
-#line 317 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 317 "src/glsl/glsl_parser.yy"
+ {
state->process_version_directive(&(yylsp[-1]), (yyvsp[-1].n), NULL);
if (state->error) {
YYERROR;
}
}
-#line 3209 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3310 "src/glsl/glsl_parser.cpp"
break;
case 6:
-#line 324 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 324 "src/glsl/glsl_parser.yy"
+ {
state->process_version_directive(&(yylsp[-2]), (yyvsp[-2].n), (yyvsp[-1].identifier));
if (state->error) {
YYERROR;
}
}
-#line 3220 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3321 "src/glsl/glsl_parser.cpp"
break;
case 11:
-#line 338 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 338 "src/glsl/glsl_parser.yy"
+ {
if (!state->is_version(120, 100)) {
_mesa_glsl_warning(& (yylsp[-1]), state,
"pragma `invariant(all)' not supported in %s "
@@ -3231,46 +3332,46 @@ yyreduce:
state->all_invariant = true;
}
}
-#line 3235 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3336 "src/glsl/glsl_parser.cpp"
break;
case 17:
-#line 363 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 363 "src/glsl/glsl_parser.yy"
+ {
if (!_mesa_glsl_process_extension((yyvsp[-3].identifier), & (yylsp[-3]), (yyvsp[-1].identifier), & (yylsp[-1]), state)) {
YYERROR;
}
}
-#line 3245 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3346 "src/glsl/glsl_parser.cpp"
break;
case 18:
-#line 372 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 372 "src/glsl/glsl_parser.yy"
+ {
/* FINISHME: The NULL test is required because pragmas are set to
* FINISHME: NULL. (See production rule for external_declaration.)
*/
if ((yyvsp[0].node) != NULL)
state->translation_unit.push_tail(& (yyvsp[0].node)->link);
}
-#line 3257 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3358 "src/glsl/glsl_parser.cpp"
break;
case 19:
-#line 380 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 380 "src/glsl/glsl_parser.yy"
+ {
/* FINISHME: The NULL test is required because pragmas are set to
* FINISHME: NULL. (See production rule for external_declaration.)
*/
if ((yyvsp[0].node) != NULL)
state->translation_unit.push_tail(& (yyvsp[0].node)->link);
}
-#line 3269 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3370 "src/glsl/glsl_parser.cpp"
break;
case 20:
-#line 387 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 387 "src/glsl/glsl_parser.yy"
+ {
if (!state->allow_extension_directive_midshader) {
_mesa_glsl_error(& (yylsp[0]), state,
"#extension directive is not allowed "
@@ -3278,558 +3379,558 @@ yyreduce:
YYERROR;
}
}
-#line 3282 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3383 "src/glsl/glsl_parser.cpp"
break;
case 23:
-#line 404 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 404 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_identifier, NULL, NULL, NULL);
(yyval.expression)->set_location((yylsp[0]));
(yyval.expression)->primary_expression.identifier = (yyvsp[0].identifier);
}
-#line 3293 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3394 "src/glsl/glsl_parser.cpp"
break;
case 24:
-#line 411 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 411 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_int_constant, NULL, NULL, NULL);
(yyval.expression)->set_location((yylsp[0]));
(yyval.expression)->primary_expression.int_constant = (yyvsp[0].n);
}
-#line 3304 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3405 "src/glsl/glsl_parser.cpp"
break;
case 25:
-#line 418 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 418 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_uint_constant, NULL, NULL, NULL);
(yyval.expression)->set_location((yylsp[0]));
(yyval.expression)->primary_expression.uint_constant = (yyvsp[0].n);
}
-#line 3315 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3416 "src/glsl/glsl_parser.cpp"
break;
case 26:
-#line 425 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 425 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_float_constant, NULL, NULL, NULL);
(yyval.expression)->set_location((yylsp[0]));
(yyval.expression)->primary_expression.float_constant = (yyvsp[0].real);
}
-#line 3326 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3427 "src/glsl/glsl_parser.cpp"
break;
case 27:
-#line 432 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 432 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_bool_constant, NULL, NULL, NULL);
(yyval.expression)->set_location((yylsp[0]));
(yyval.expression)->primary_expression.bool_constant = (yyvsp[0].n);
}
-#line 3337 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3438 "src/glsl/glsl_parser.cpp"
break;
case 28:
-#line 439 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 439 "src/glsl/glsl_parser.yy"
+ {
(yyval.expression) = (yyvsp[-1].expression);
}
-#line 3345 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3446 "src/glsl/glsl_parser.cpp"
break;
case 30:
-#line 447 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 447 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_array_index, (yyvsp[-3].expression), (yyvsp[-1].expression), NULL);
(yyval.expression)->set_location_range((yylsp[-3]), (yylsp[0]));
}
-#line 3355 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3456 "src/glsl/glsl_parser.cpp"
break;
case 31:
-#line 453 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 453 "src/glsl/glsl_parser.yy"
+ {
(yyval.expression) = (yyvsp[0].expression);
}
-#line 3363 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3464 "src/glsl/glsl_parser.cpp"
break;
case 32:
-#line 457 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 457 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_field_selection, (yyvsp[-2].expression), NULL, NULL);
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
(yyval.expression)->primary_expression.identifier = (yyvsp[0].identifier);
}
-#line 3374 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3475 "src/glsl/glsl_parser.cpp"
break;
case 33:
-#line 464 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 464 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_post_inc, (yyvsp[-1].expression), NULL, NULL);
(yyval.expression)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 3384 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3485 "src/glsl/glsl_parser.cpp"
break;
case 34:
-#line 470 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 470 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_post_dec, (yyvsp[-1].expression), NULL, NULL);
(yyval.expression)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 3394 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3495 "src/glsl/glsl_parser.cpp"
break;
case 38:
-#line 488 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 488 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_field_selection, (yyvsp[-2].expression), (yyvsp[0].expression), NULL);
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3404 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3505 "src/glsl/glsl_parser.cpp"
break;
case 43:
-#line 507 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 507 "src/glsl/glsl_parser.yy"
+ {
(yyval.expression) = (yyvsp[-1].expression);
(yyval.expression)->set_location((yylsp[-1]));
(yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 3414 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3515 "src/glsl/glsl_parser.cpp"
break;
case 44:
-#line 513 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 513 "src/glsl/glsl_parser.yy"
+ {
(yyval.expression) = (yyvsp[-2].expression);
(yyval.expression)->set_location((yylsp[-2]));
(yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 3424 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3525 "src/glsl/glsl_parser.cpp"
break;
case 46:
-#line 529 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 529 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_function_expression((yyvsp[0].type_specifier));
(yyval.expression)->set_location((yylsp[0]));
}
-#line 3434 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3535 "src/glsl/glsl_parser.cpp"
break;
case 47:
-#line 535 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 535 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_expression *callee = new(ctx) ast_expression((yyvsp[0].identifier));
callee->set_location((yylsp[0]));
(yyval.expression) = new(ctx) ast_function_expression(callee);
(yyval.expression)->set_location((yylsp[0]));
}
-#line 3446 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3547 "src/glsl/glsl_parser.cpp"
break;
case 48:
-#line 543 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 543 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_expression *callee = new(ctx) ast_expression((yyvsp[0].identifier));
callee->set_location((yylsp[0]));
(yyval.expression) = new(ctx) ast_function_expression(callee);
(yyval.expression)->set_location((yylsp[0]));
}
-#line 3458 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3559 "src/glsl/glsl_parser.cpp"
break;
case 53:
-#line 564 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 564 "src/glsl/glsl_parser.yy"
+ {
(yyval.expression) = (yyvsp[-1].expression);
(yyval.expression)->set_location((yylsp[-1]));
(yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 3468 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3569 "src/glsl/glsl_parser.cpp"
break;
case 54:
-#line 570 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 570 "src/glsl/glsl_parser.yy"
+ {
(yyval.expression) = (yyvsp[-2].expression);
(yyval.expression)->set_location((yylsp[-2]));
(yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 3478 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3579 "src/glsl/glsl_parser.cpp"
break;
case 55:
-#line 582 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 582 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_expression *callee = new(ctx) ast_expression((yyvsp[-1].identifier));
callee->set_location((yylsp[-1]));
(yyval.expression) = new(ctx) ast_function_expression(callee);
(yyval.expression)->set_location((yylsp[-1]));
}
-#line 3490 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3591 "src/glsl/glsl_parser.cpp"
break;
case 57:
-#line 595 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 595 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_pre_inc, (yyvsp[0].expression), NULL, NULL);
(yyval.expression)->set_location((yylsp[-1]));
}
-#line 3500 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3601 "src/glsl/glsl_parser.cpp"
break;
case 58:
-#line 601 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 601 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_pre_dec, (yyvsp[0].expression), NULL, NULL);
(yyval.expression)->set_location((yylsp[-1]));
}
-#line 3510 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3611 "src/glsl/glsl_parser.cpp"
break;
case 59:
-#line 607 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 607 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression((yyvsp[-1].n), (yyvsp[0].expression), NULL, NULL);
(yyval.expression)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 3520 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3621 "src/glsl/glsl_parser.cpp"
break;
case 60:
-#line 616 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_plus; }
-#line 3526 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 616 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_plus; }
+#line 3627 "src/glsl/glsl_parser.cpp"
break;
case 61:
-#line 617 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_neg; }
-#line 3532 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 617 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_neg; }
+#line 3633 "src/glsl/glsl_parser.cpp"
break;
case 62:
-#line 618 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_logic_not; }
-#line 3538 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 618 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_logic_not; }
+#line 3639 "src/glsl/glsl_parser.cpp"
break;
case 63:
-#line 619 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_bit_not; }
-#line 3544 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 619 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_bit_not; }
+#line 3645 "src/glsl/glsl_parser.cpp"
break;
case 65:
-#line 625 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 625 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_mul, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3554 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3655 "src/glsl/glsl_parser.cpp"
break;
case 66:
-#line 631 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 631 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_div, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3564 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3665 "src/glsl/glsl_parser.cpp"
break;
case 67:
-#line 637 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 637 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_mod, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3574 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3675 "src/glsl/glsl_parser.cpp"
break;
case 69:
-#line 647 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 647 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_add, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3584 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3685 "src/glsl/glsl_parser.cpp"
break;
case 70:
-#line 653 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 653 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_sub, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3594 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3695 "src/glsl/glsl_parser.cpp"
break;
case 72:
-#line 663 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 663 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_lshift, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3604 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3705 "src/glsl/glsl_parser.cpp"
break;
case 73:
-#line 669 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 669 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_rshift, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3614 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3715 "src/glsl/glsl_parser.cpp"
break;
case 75:
-#line 679 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 679 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_less, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3624 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3725 "src/glsl/glsl_parser.cpp"
break;
case 76:
-#line 685 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 685 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_greater, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3634 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3735 "src/glsl/glsl_parser.cpp"
break;
case 77:
-#line 691 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 691 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_lequal, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3644 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3745 "src/glsl/glsl_parser.cpp"
break;
case 78:
-#line 697 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 697 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_gequal, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3654 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3755 "src/glsl/glsl_parser.cpp"
break;
case 80:
-#line 707 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 707 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_equal, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3664 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3765 "src/glsl/glsl_parser.cpp"
break;
case 81:
-#line 713 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 713 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_nequal, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3674 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3775 "src/glsl/glsl_parser.cpp"
break;
case 83:
-#line 723 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 723 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_bit_and, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3684 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3785 "src/glsl/glsl_parser.cpp"
break;
case 85:
-#line 733 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 733 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_bit_xor, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3694 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3795 "src/glsl/glsl_parser.cpp"
break;
case 87:
-#line 743 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 743 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_bit_or, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3704 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3805 "src/glsl/glsl_parser.cpp"
break;
case 89:
-#line 753 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 753 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_logic_and, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3714 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3815 "src/glsl/glsl_parser.cpp"
break;
case 91:
-#line 763 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 763 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_logic_xor, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3724 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3825 "src/glsl/glsl_parser.cpp"
break;
case 93:
-#line 773 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 773 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression_bin(ast_logic_or, (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3734 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3835 "src/glsl/glsl_parser.cpp"
break;
case 95:
-#line 783 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 783 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression(ast_conditional, (yyvsp[-4].expression), (yyvsp[-2].expression), (yyvsp[0].expression));
(yyval.expression)->set_location_range((yylsp[-4]), (yylsp[0]));
}
-#line 3744 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3845 "src/glsl/glsl_parser.cpp"
break;
case 97:
-#line 793 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 793 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_expression((yyvsp[-1].n), (yyvsp[-2].expression), (yyvsp[0].expression), NULL);
(yyval.expression)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 3754 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3855 "src/glsl/glsl_parser.cpp"
break;
case 98:
-#line 801 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_assign; }
-#line 3760 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 801 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_assign; }
+#line 3861 "src/glsl/glsl_parser.cpp"
break;
case 99:
-#line 802 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_mul_assign; }
-#line 3766 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 802 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_mul_assign; }
+#line 3867 "src/glsl/glsl_parser.cpp"
break;
case 100:
-#line 803 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_div_assign; }
-#line 3772 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 803 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_div_assign; }
+#line 3873 "src/glsl/glsl_parser.cpp"
break;
case 101:
-#line 804 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_mod_assign; }
-#line 3778 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 804 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_mod_assign; }
+#line 3879 "src/glsl/glsl_parser.cpp"
break;
case 102:
-#line 805 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_add_assign; }
-#line 3784 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 805 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_add_assign; }
+#line 3885 "src/glsl/glsl_parser.cpp"
break;
case 103:
-#line 806 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_sub_assign; }
-#line 3790 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 806 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_sub_assign; }
+#line 3891 "src/glsl/glsl_parser.cpp"
break;
case 104:
-#line 807 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_ls_assign; }
-#line 3796 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 807 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_ls_assign; }
+#line 3897 "src/glsl/glsl_parser.cpp"
break;
case 105:
-#line 808 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_rs_assign; }
-#line 3802 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 808 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_rs_assign; }
+#line 3903 "src/glsl/glsl_parser.cpp"
break;
case 106:
-#line 809 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_and_assign; }
-#line 3808 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 809 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_and_assign; }
+#line 3909 "src/glsl/glsl_parser.cpp"
break;
case 107:
-#line 810 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_xor_assign; }
-#line 3814 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 810 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_xor_assign; }
+#line 3915 "src/glsl/glsl_parser.cpp"
break;
case 108:
-#line 811 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = ast_or_assign; }
-#line 3820 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 811 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = ast_or_assign; }
+#line 3921 "src/glsl/glsl_parser.cpp"
break;
case 109:
-#line 816 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 816 "src/glsl/glsl_parser.yy"
+ {
(yyval.expression) = (yyvsp[0].expression);
}
-#line 3828 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3929 "src/glsl/glsl_parser.cpp"
break;
case 110:
-#line 820 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 820 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
if ((yyvsp[-2].expression)->oper != ast_sequence) {
(yyval.expression) = new(ctx) ast_expression(ast_sequence, NULL, NULL, NULL);
@@ -3841,64 +3942,64 @@ yyreduce:
(yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 3845 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3946 "src/glsl/glsl_parser.cpp"
break;
case 112:
-#line 840 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 840 "src/glsl/glsl_parser.yy"
+ {
state->symbols->pop_scope();
(yyval.node) = (yyvsp[-1].function);
}
-#line 3854 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3955 "src/glsl/glsl_parser.cpp"
break;
case 113:
-#line 845 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 845 "src/glsl/glsl_parser.yy"
+ {
(yyval.node) = (yyvsp[-1].declarator_list);
}
-#line 3862 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3963 "src/glsl/glsl_parser.cpp"
break;
case 114:
-#line 849 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 849 "src/glsl/glsl_parser.yy"
+ {
(yyvsp[-1].type_specifier)->default_precision = (yyvsp[-2].n);
(yyval.node) = (yyvsp[-1].type_specifier);
}
-#line 3871 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3972 "src/glsl/glsl_parser.cpp"
break;
case 115:
-#line 854 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 854 "src/glsl/glsl_parser.yy"
+ {
(yyval.node) = (yyvsp[0].node);
}
-#line 3879 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3980 "src/glsl/glsl_parser.cpp"
break;
case 119:
-#line 870 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 870 "src/glsl/glsl_parser.yy"
+ {
(yyval.function) = (yyvsp[-1].function);
(yyval.function)->parameters.push_tail(& (yyvsp[0].parameter_declarator)->link);
}
-#line 3888 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3989 "src/glsl/glsl_parser.cpp"
break;
case 120:
-#line 875 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 875 "src/glsl/glsl_parser.yy"
+ {
(yyval.function) = (yyvsp[-2].function);
(yyval.function)->parameters.push_tail(& (yyvsp[0].parameter_declarator)->link);
}
-#line 3897 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 3998 "src/glsl/glsl_parser.cpp"
break;
case 121:
-#line 883 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 883 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.function) = new(ctx) ast_function();
(yyval.function)->set_location((yylsp[-1]));
@@ -3908,12 +4009,12 @@ yyreduce:
state->symbols->add_function(new(state) ir_function((yyvsp[-1].identifier)));
state->symbols->push_scope();
}
-#line 3912 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4013 "src/glsl/glsl_parser.cpp"
break;
case 122:
-#line 897 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 897 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.parameter_declarator) = new(ctx) ast_parameter_declarator();
(yyval.parameter_declarator)->set_location_range((yylsp[-1]), (yylsp[0]));
@@ -3922,12 +4023,12 @@ yyreduce:
(yyval.parameter_declarator)->type->specifier = (yyvsp[-1].type_specifier);
(yyval.parameter_declarator)->identifier = (yyvsp[0].identifier);
}
-#line 3926 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4027 "src/glsl/glsl_parser.cpp"
break;
case 123:
-#line 907 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 907 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.parameter_declarator) = new(ctx) ast_parameter_declarator();
(yyval.parameter_declarator)->set_location_range((yylsp[-2]), (yylsp[0]));
@@ -3937,21 +4038,21 @@ yyreduce:
(yyval.parameter_declarator)->identifier = (yyvsp[-1].identifier);
(yyval.parameter_declarator)->array_specifier = (yyvsp[0].array_specifier);
}
-#line 3941 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4042 "src/glsl/glsl_parser.cpp"
break;
case 124:
-#line 921 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 921 "src/glsl/glsl_parser.yy"
+ {
(yyval.parameter_declarator) = (yyvsp[0].parameter_declarator);
(yyval.parameter_declarator)->type->qualifier = (yyvsp[-1].type_qualifier);
}
-#line 3950 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4051 "src/glsl/glsl_parser.cpp"
break;
case 125:
-#line 926 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 926 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.parameter_declarator) = new(ctx) ast_parameter_declarator();
(yyval.parameter_declarator)->set_location((yylsp[0]));
@@ -3960,45 +4061,45 @@ yyreduce:
(yyval.parameter_declarator)->type->qualifier = (yyvsp[-1].type_qualifier);
(yyval.parameter_declarator)->type->specifier = (yyvsp[0].type_specifier);
}
-#line 3964 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4065 "src/glsl/glsl_parser.cpp"
break;
case 126:
-#line 939 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 939 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
}
-#line 3973 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4074 "src/glsl/glsl_parser.cpp"
break;
case 127:
-#line 944 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 944 "src/glsl/glsl_parser.yy"
+ {
if ((yyvsp[0].type_qualifier).flags.q.constant)
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate const qualifier");
(yyval.type_qualifier) = (yyvsp[0].type_qualifier);
(yyval.type_qualifier).flags.q.constant = 1;
}
-#line 3985 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4086 "src/glsl/glsl_parser.cpp"
break;
case 128:
-#line 952 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 952 "src/glsl/glsl_parser.yy"
+ {
if ((yyvsp[0].type_qualifier).flags.q.precise)
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate precise qualifier");
(yyval.type_qualifier) = (yyvsp[0].type_qualifier);
(yyval.type_qualifier).flags.q.precise = 1;
}
-#line 3997 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4098 "src/glsl/glsl_parser.cpp"
break;
case 129:
-#line 960 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 960 "src/glsl/glsl_parser.yy"
+ {
if (((yyvsp[-1].type_qualifier).flags.q.in || (yyvsp[-1].type_qualifier).flags.q.out) && ((yyvsp[0].type_qualifier).flags.q.in || (yyvsp[0].type_qualifier).flags.q.out))
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate in/out/inout qualifier");
@@ -4009,12 +4110,12 @@ yyreduce:
(yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
(yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier));
}
-#line 4013 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4114 "src/glsl/glsl_parser.cpp"
break;
case 130:
-#line 972 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 972 "src/glsl/glsl_parser.yy"
+ {
if ((yyvsp[0].type_qualifier).precision != ast_precision_none)
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate precision qualifier");
@@ -4024,43 +4125,43 @@ yyreduce:
(yyval.type_qualifier) = (yyvsp[0].type_qualifier);
(yyval.type_qualifier).precision = (yyvsp[-1].n);
}
-#line 4028 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4129 "src/glsl/glsl_parser.cpp"
break;
case 131:
-#line 985 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 985 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.in = 1;
}
-#line 4038 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4139 "src/glsl/glsl_parser.cpp"
break;
case 132:
-#line 991 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 991 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.out = 1;
}
-#line 4048 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4149 "src/glsl/glsl_parser.cpp"
break;
case 133:
-#line 997 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 997 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.in = 1;
(yyval.type_qualifier).flags.q.out = 1;
}
-#line 4059 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4160 "src/glsl/glsl_parser.cpp"
break;
case 136:
-#line 1013 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1013 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
decl->set_location((yylsp[0]));
@@ -4069,12 +4170,12 @@ yyreduce:
(yyval.declarator_list)->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[0].identifier), ir_var_auto, glsl_precision_undefined));
}
-#line 4073 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4174 "src/glsl/glsl_parser.cpp"
break;
case 137:
-#line 1023 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1023 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL);
decl->set_location_range((yylsp[-1]), (yylsp[0]));
@@ -4083,12 +4184,12 @@ yyreduce:
(yyval.declarator_list)->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-1].identifier), ir_var_auto, glsl_precision_undefined));
}
-#line 4087 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4188 "src/glsl/glsl_parser.cpp"
break;
case 138:
-#line 1033 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1033 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-3].identifier), (yyvsp[-2].array_specifier), (yyvsp[0].expression));
decl->set_location_range((yylsp[-3]), (yylsp[-2]));
@@ -4097,12 +4198,12 @@ yyreduce:
(yyval.declarator_list)->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-3].identifier), ir_var_auto, glsl_precision_undefined));
}
-#line 4101 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4202 "src/glsl/glsl_parser.cpp"
break;
case 139:
-#line 1043 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1043 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-2].identifier), NULL, (yyvsp[0].expression));
decl->set_location((yylsp[-2]));
@@ -4111,23 +4212,23 @@ yyreduce:
(yyval.declarator_list)->declarations.push_tail(&decl->link);
state->symbols->add_variable(new(state) ir_variable(NULL, (yyvsp[-2].identifier), ir_var_auto, glsl_precision_undefined));
}
-#line 4115 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4216 "src/glsl/glsl_parser.cpp"
break;
case 140:
-#line 1057 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1057 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
/* Empty declaration list is valid. */
(yyval.declarator_list) = new(ctx) ast_declarator_list((yyvsp[0].fully_specified_type));
(yyval.declarator_list)->set_location((yylsp[0]));
}
-#line 4126 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4227 "src/glsl/glsl_parser.cpp"
break;
case 141:
-#line 1064 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1064 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
decl->set_location((yylsp[0]));
@@ -4136,12 +4237,12 @@ yyreduce:
(yyval.declarator_list)->set_location_range((yylsp[-1]), (yylsp[0]));
(yyval.declarator_list)->declarations.push_tail(&decl->link);
}
-#line 4140 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4241 "src/glsl/glsl_parser.cpp"
break;
case 142:
-#line 1074 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1074 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL);
decl->set_location_range((yylsp[-1]), (yylsp[0]));
@@ -4150,12 +4251,12 @@ yyreduce:
(yyval.declarator_list)->set_location_range((yylsp[-2]), (yylsp[0]));
(yyval.declarator_list)->declarations.push_tail(&decl->link);
}
-#line 4154 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4255 "src/glsl/glsl_parser.cpp"
break;
case 143:
-#line 1084 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1084 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-3].identifier), (yyvsp[-2].array_specifier), (yyvsp[0].expression));
decl->set_location_range((yylsp[-3]), (yylsp[-2]));
@@ -4164,12 +4265,12 @@ yyreduce:
(yyval.declarator_list)->set_location_range((yylsp[-4]), (yylsp[-2]));
(yyval.declarator_list)->declarations.push_tail(&decl->link);
}
-#line 4168 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4269 "src/glsl/glsl_parser.cpp"
break;
case 144:
-#line 1094 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1094 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-2].identifier), NULL, (yyvsp[0].expression));
decl->set_location((yylsp[-2]));
@@ -4178,12 +4279,12 @@ yyreduce:
(yyval.declarator_list)->set_location_range((yylsp[-3]), (yylsp[-2]));
(yyval.declarator_list)->declarations.push_tail(&decl->link);
}
-#line 4182 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4283 "src/glsl/glsl_parser.cpp"
break;
case 145:
-#line 1104 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1104 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
decl->set_location((yylsp[0]));
@@ -4194,12 +4295,12 @@ yyreduce:
(yyval.declarator_list)->declarations.push_tail(&decl->link);
}
-#line 4198 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4299 "src/glsl/glsl_parser.cpp"
break;
case 146:
-#line 1116 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1116 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
decl->set_location((yylsp[0]));
@@ -4210,66 +4311,66 @@ yyreduce:
(yyval.declarator_list)->declarations.push_tail(&decl->link);
}
-#line 4214 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4315 "src/glsl/glsl_parser.cpp"
break;
case 147:
-#line 1131 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1131 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.fully_specified_type) = new(ctx) ast_fully_specified_type();
(yyval.fully_specified_type)->set_location((yylsp[0]));
(yyval.fully_specified_type)->specifier = (yyvsp[0].type_specifier);
}
-#line 4225 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4326 "src/glsl/glsl_parser.cpp"
break;
case 148:
-#line 1138 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1138 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.fully_specified_type) = new(ctx) ast_fully_specified_type();
(yyval.fully_specified_type)->set_location_range((yylsp[-1]), (yylsp[0]));
(yyval.fully_specified_type)->qualifier = (yyvsp[-1].type_qualifier);
(yyval.fully_specified_type)->specifier = (yyvsp[0].type_specifier);
}
-#line 4237 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4338 "src/glsl/glsl_parser.cpp"
break;
case 149:
-#line 1149 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1149 "src/glsl/glsl_parser.yy"
+ {
(yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
}
-#line 4245 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4346 "src/glsl/glsl_parser.cpp"
break;
case 151:
-#line 1157 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1157 "src/glsl/glsl_parser.yy"
+ {
(yyval.type_qualifier) = (yyvsp[-2].type_qualifier);
if (!(yyval.type_qualifier).merge_qualifier(& (yylsp[0]), state, (yyvsp[0].type_qualifier))) {
YYERROR;
}
}
-#line 4256 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4357 "src/glsl/glsl_parser.cpp"
break;
case 152:
-#line 1166 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = (yyvsp[0].n); }
-#line 4262 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1166 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = (yyvsp[0].n); }
+#line 4363 "src/glsl/glsl_parser.cpp"
break;
case 153:
-#line 1167 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.n) = (yyvsp[0].n); }
-#line 4268 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1167 "src/glsl/glsl_parser.yy"
+ { (yyval.n) = (yyvsp[0].n); }
+#line 4369 "src/glsl/glsl_parser.cpp"
break;
case 154:
-#line 1172 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1172 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
@@ -4454,12 +4555,12 @@ yyreduce:
YYERROR;
}
}
-#line 4458 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4559 "src/glsl/glsl_parser.cpp"
break;
case 155:
-#line 1358 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1358 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
@@ -4598,12 +4699,12 @@ yyreduce:
YYERROR;
}
}
-#line 4602 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4703 "src/glsl/glsl_parser.cpp"
break;
case 156:
-#line 1498 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1498 "src/glsl/glsl_parser.yy"
+ {
(yyval.type_qualifier) = (yyvsp[0].type_qualifier);
/* Layout qualifiers for ARB_uniform_buffer_object. */
if ((yyval.type_qualifier).flags.q.uniform && !state->has_uniform_buffer_objects()) {
@@ -4616,103 +4717,103 @@ yyreduce:
"layout qualifier `%s' is used", (yyvsp[0].type_qualifier));
}
}
-#line 4620 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4721 "src/glsl/glsl_parser.cpp"
break;
case 157:
-#line 1524 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1524 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.row_major = 1;
}
-#line 4630 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4731 "src/glsl/glsl_parser.cpp"
break;
case 158:
-#line 1530 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1530 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.packed = 1;
}
-#line 4640 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4741 "src/glsl/glsl_parser.cpp"
break;
case 159:
-#line 1539 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1539 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.smooth = 1;
}
-#line 4650 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4751 "src/glsl/glsl_parser.cpp"
break;
case 160:
-#line 1545 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1545 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.flat = 1;
}
-#line 4660 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4761 "src/glsl/glsl_parser.cpp"
break;
case 161:
-#line 1551 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1551 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.noperspective = 1;
}
-#line 4670 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4771 "src/glsl/glsl_parser.cpp"
break;
case 162:
-#line 1561 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1561 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.invariant = 1;
}
-#line 4680 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4781 "src/glsl/glsl_parser.cpp"
break;
case 163:
-#line 1567 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1567 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.precise = 1;
}
-#line 4689 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4790 "src/glsl/glsl_parser.cpp"
break;
case 168:
-#line 1576 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1576 "src/glsl/glsl_parser.yy"
+ {
memset(&(yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).precision = (yyvsp[0].n);
}
-#line 4699 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4800 "src/glsl/glsl_parser.cpp"
break;
case 169:
-#line 1595 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1595 "src/glsl/glsl_parser.yy"
+ {
if ((yyvsp[0].type_qualifier).flags.q.precise)
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate \"precise\" qualifier");
(yyval.type_qualifier) = (yyvsp[0].type_qualifier);
(yyval.type_qualifier).flags.q.precise = 1;
}
-#line 4711 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4812 "src/glsl/glsl_parser.cpp"
break;
case 170:
-#line 1603 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1603 "src/glsl/glsl_parser.yy"
+ {
if ((yyvsp[0].type_qualifier).flags.q.invariant)
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate \"invariant\" qualifier");
@@ -4723,12 +4824,12 @@ yyreduce:
(yyval.type_qualifier) = (yyvsp[0].type_qualifier);
(yyval.type_qualifier).flags.q.invariant = 1;
}
-#line 4727 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4828 "src/glsl/glsl_parser.cpp"
break;
case 171:
-#line 1615 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1615 "src/glsl/glsl_parser.yy"
+ {
/* Section 4.3 of the GLSL 1.40 specification states:
* "...qualified with one of these interpolation qualifiers"
*
@@ -4751,12 +4852,12 @@ yyreduce:
(yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
(yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier));
}
-#line 4755 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4856 "src/glsl/glsl_parser.cpp"
break;
case 172:
-#line 1639 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1639 "src/glsl/glsl_parser.yy"
+ {
/* In the absence of ARB_shading_language_420pack, layout qualifiers may
* appear no later than auxiliary storage qualifiers. There is no
* particularly clear spec language mandating this, but in all examples
@@ -4772,12 +4873,12 @@ yyreduce:
(yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
(yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier));
}
-#line 4776 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4877 "src/glsl/glsl_parser.cpp"
break;
case 173:
-#line 1656 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1656 "src/glsl/glsl_parser.yy"
+ {
if ((yyvsp[0].type_qualifier).has_auxiliary_storage()) {
_mesa_glsl_error(&(yylsp[-1]), state,
"duplicate auxiliary storage qualifier (centroid or sample)");
@@ -4792,12 +4893,12 @@ yyreduce:
(yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
(yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier));
}
-#line 4796 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4897 "src/glsl/glsl_parser.cpp"
break;
case 174:
-#line 1672 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1672 "src/glsl/glsl_parser.yy"
+ {
/* Section 4.3 of the GLSL 1.20 specification states:
* "Variable declarations may have a storage qualifier specified..."
* 1.30 clarifies this to "may have one storage qualifier".
@@ -4816,12 +4917,12 @@ yyreduce:
(yyval.type_qualifier) = (yyvsp[-1].type_qualifier);
(yyval.type_qualifier).merge_qualifier(&(yylsp[-1]), state, (yyvsp[0].type_qualifier));
}
-#line 4820 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4921 "src/glsl/glsl_parser.cpp"
break;
case 175:
-#line 1692 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1692 "src/glsl/glsl_parser.yy"
+ {
if ((yyvsp[0].type_qualifier).precision != ast_precision_none)
_mesa_glsl_error(&(yylsp[-1]), state, "duplicate precision qualifier");
@@ -4831,81 +4932,81 @@ yyreduce:
(yyval.type_qualifier) = (yyvsp[0].type_qualifier);
(yyval.type_qualifier).precision = (yyvsp[-1].n);
}
-#line 4835 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4936 "src/glsl/glsl_parser.cpp"
break;
case 176:
-#line 1706 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1706 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.centroid = 1;
}
-#line 4845 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4946 "src/glsl/glsl_parser.cpp"
break;
case 177:
-#line 1712 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1712 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.sample = 1;
}
-#line 4854 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4955 "src/glsl/glsl_parser.cpp"
break;
case 178:
-#line 1720 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1720 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.constant = 1;
}
-#line 4864 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4965 "src/glsl/glsl_parser.cpp"
break;
case 179:
-#line 1726 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1726 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.attribute = 1;
}
-#line 4874 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4975 "src/glsl/glsl_parser.cpp"
break;
case 180:
-#line 1732 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1732 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.varying = 1;
}
-#line 4884 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4985 "src/glsl/glsl_parser.cpp"
break;
case 181:
-#line 1738 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1738 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.in = 1;
}
-#line 4894 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 4995 "src/glsl/glsl_parser.cpp"
break;
case 182:
-#line 1744 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1744 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.out = 1;
}
-#line 4904 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5005 "src/glsl/glsl_parser.cpp"
break;
case 183:
-#line 1750 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1750 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.in = 1;
@@ -4925,88 +5026,88 @@ yyreduce:
(yyval.type_qualifier).stream = state->out_qualifier->stream;
}
}
-#line 4929 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5030 "src/glsl/glsl_parser.cpp"
break;
case 184:
-#line 1771 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1771 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.uniform = 1;
}
-#line 4939 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5040 "src/glsl/glsl_parser.cpp"
break;
case 185:
-#line 1777 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1777 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.coherent = 1;
}
-#line 4948 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5049 "src/glsl/glsl_parser.cpp"
break;
case 186:
-#line 1782 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1782 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q._volatile = 1;
}
-#line 4957 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5058 "src/glsl/glsl_parser.cpp"
break;
case 187:
-#line 1787 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1787 "src/glsl/glsl_parser.yy"
+ {
STATIC_ASSERT(sizeof((yyval.type_qualifier).flags.q) <= sizeof((yyval.type_qualifier).flags.i));
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.restrict_flag = 1;
}
-#line 4967 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5068 "src/glsl/glsl_parser.cpp"
break;
case 188:
-#line 1793 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1793 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.read_only = 1;
}
-#line 4976 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5077 "src/glsl/glsl_parser.cpp"
break;
case 189:
-#line 1798 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1798 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).flags.q.write_only = 1;
}
-#line 4985 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5086 "src/glsl/glsl_parser.cpp"
break;
case 190:
-#line 1806 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1806 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.array_specifier) = new(ctx) ast_array_specifier((yylsp[-1]));
(yyval.array_specifier)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 4995 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5096 "src/glsl/glsl_parser.cpp"
break;
case 191:
-#line 1812 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1812 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.array_specifier) = new(ctx) ast_array_specifier((yylsp[-2]), (yyvsp[-1].expression));
(yyval.array_specifier)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 5005 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5106 "src/glsl/glsl_parser.cpp"
break;
case 192:
-#line 1818 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1818 "src/glsl/glsl_parser.yy"
+ {
(yyval.array_specifier) = (yyvsp[-2].array_specifier);
if (!state->ARB_arrays_of_arrays_enable) {
@@ -5019,12 +5120,12 @@ yyreduce:
"be unsized");
}
}
-#line 5023 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5124 "src/glsl/glsl_parser.cpp"
break;
case 193:
-#line 1832 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1832 "src/glsl/glsl_parser.yy"
+ {
(yyval.array_specifier) = (yyvsp[-3].array_specifier);
if (!state->ARB_arrays_of_arrays_enable) {
@@ -5035,723 +5136,723 @@ yyreduce:
(yyval.array_specifier)->add_dimension((yyvsp[-1].expression));
}
-#line 5039 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5140 "src/glsl/glsl_parser.cpp"
break;
case 195:
-#line 1848 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1848 "src/glsl/glsl_parser.yy"
+ {
(yyval.type_specifier) = (yyvsp[-1].type_specifier);
(yyval.type_specifier)->array_specifier = (yyvsp[0].array_specifier);
}
-#line 5048 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5149 "src/glsl/glsl_parser.cpp"
break;
case 196:
-#line 1856 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1856 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].identifier));
(yyval.type_specifier)->set_location((yylsp[0]));
}
-#line 5058 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5159 "src/glsl/glsl_parser.cpp"
break;
case 197:
-#line 1862 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1862 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].struct_specifier));
(yyval.type_specifier)->set_location((yylsp[0]));
}
-#line 5068 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5169 "src/glsl/glsl_parser.cpp"
break;
case 198:
-#line 1868 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1868 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.type_specifier) = new(ctx) ast_type_specifier((yyvsp[0].identifier));
(yyval.type_specifier)->set_location((yylsp[0]));
}
-#line 5078 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5179 "src/glsl/glsl_parser.cpp"
break;
case 199:
-#line 1876 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "void"; }
-#line 5084 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1876 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "void"; }
+#line 5185 "src/glsl/glsl_parser.cpp"
break;
case 200:
-#line 1877 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "float"; }
-#line 5090 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1877 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "float"; }
+#line 5191 "src/glsl/glsl_parser.cpp"
break;
case 201:
-#line 1878 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "int"; }
-#line 5096 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1878 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "int"; }
+#line 5197 "src/glsl/glsl_parser.cpp"
break;
case 202:
-#line 1879 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uint"; }
-#line 5102 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1879 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uint"; }
+#line 5203 "src/glsl/glsl_parser.cpp"
break;
case 203:
-#line 1880 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "bool"; }
-#line 5108 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1880 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "bool"; }
+#line 5209 "src/glsl/glsl_parser.cpp"
break;
case 204:
-#line 1881 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "vec2"; }
-#line 5114 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1881 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "vec2"; }
+#line 5215 "src/glsl/glsl_parser.cpp"
break;
case 205:
-#line 1882 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "vec3"; }
-#line 5120 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1882 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "vec3"; }
+#line 5221 "src/glsl/glsl_parser.cpp"
break;
case 206:
-#line 1883 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "vec4"; }
-#line 5126 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1883 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "vec4"; }
+#line 5227 "src/glsl/glsl_parser.cpp"
break;
case 207:
-#line 1884 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "bvec2"; }
-#line 5132 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1884 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "bvec2"; }
+#line 5233 "src/glsl/glsl_parser.cpp"
break;
case 208:
-#line 1885 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "bvec3"; }
-#line 5138 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1885 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "bvec3"; }
+#line 5239 "src/glsl/glsl_parser.cpp"
break;
case 209:
-#line 1886 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "bvec4"; }
-#line 5144 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1886 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "bvec4"; }
+#line 5245 "src/glsl/glsl_parser.cpp"
break;
case 210:
-#line 1887 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "ivec2"; }
-#line 5150 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1887 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "ivec2"; }
+#line 5251 "src/glsl/glsl_parser.cpp"
break;
case 211:
-#line 1888 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "ivec3"; }
-#line 5156 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1888 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "ivec3"; }
+#line 5257 "src/glsl/glsl_parser.cpp"
break;
case 212:
-#line 1889 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "ivec4"; }
-#line 5162 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1889 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "ivec4"; }
+#line 5263 "src/glsl/glsl_parser.cpp"
break;
case 213:
-#line 1890 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uvec2"; }
-#line 5168 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1890 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uvec2"; }
+#line 5269 "src/glsl/glsl_parser.cpp"
break;
case 214:
-#line 1891 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uvec3"; }
-#line 5174 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1891 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uvec3"; }
+#line 5275 "src/glsl/glsl_parser.cpp"
break;
case 215:
-#line 1892 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uvec4"; }
-#line 5180 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1892 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uvec4"; }
+#line 5281 "src/glsl/glsl_parser.cpp"
break;
case 216:
-#line 1893 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "mat2"; }
-#line 5186 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1893 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "mat2"; }
+#line 5287 "src/glsl/glsl_parser.cpp"
break;
case 217:
-#line 1894 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "mat2x3"; }
-#line 5192 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1894 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "mat2x3"; }
+#line 5293 "src/glsl/glsl_parser.cpp"
break;
case 218:
-#line 1895 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "mat2x4"; }
-#line 5198 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1895 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "mat2x4"; }
+#line 5299 "src/glsl/glsl_parser.cpp"
break;
case 219:
-#line 1896 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "mat3x2"; }
-#line 5204 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1896 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "mat3x2"; }
+#line 5305 "src/glsl/glsl_parser.cpp"
break;
case 220:
-#line 1897 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "mat3"; }
-#line 5210 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1897 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "mat3"; }
+#line 5311 "src/glsl/glsl_parser.cpp"
break;
case 221:
-#line 1898 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "mat3x4"; }
-#line 5216 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1898 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "mat3x4"; }
+#line 5317 "src/glsl/glsl_parser.cpp"
break;
case 222:
-#line 1899 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "mat4x2"; }
-#line 5222 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1899 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "mat4x2"; }
+#line 5323 "src/glsl/glsl_parser.cpp"
break;
case 223:
-#line 1900 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "mat4x3"; }
-#line 5228 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1900 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "mat4x3"; }
+#line 5329 "src/glsl/glsl_parser.cpp"
break;
case 224:
-#line 1901 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "mat4"; }
-#line 5234 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1901 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "mat4"; }
+#line 5335 "src/glsl/glsl_parser.cpp"
break;
case 225:
-#line 1902 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "sampler1D"; }
-#line 5240 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1902 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "sampler1D"; }
+#line 5341 "src/glsl/glsl_parser.cpp"
break;
case 226:
-#line 1903 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "sampler2D"; }
-#line 5246 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1903 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "sampler2D"; }
+#line 5347 "src/glsl/glsl_parser.cpp"
break;
case 227:
-#line 1904 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "sampler2DRect"; }
-#line 5252 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1904 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "sampler2DRect"; }
+#line 5353 "src/glsl/glsl_parser.cpp"
break;
case 228:
-#line 1905 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "sampler3D"; }
-#line 5258 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1905 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "sampler3D"; }
+#line 5359 "src/glsl/glsl_parser.cpp"
break;
case 229:
-#line 1906 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "samplerCube"; }
-#line 5264 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1906 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "samplerCube"; }
+#line 5365 "src/glsl/glsl_parser.cpp"
break;
case 230:
-#line 1907 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "samplerExternalOES"; }
-#line 5270 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1907 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "samplerExternalOES"; }
+#line 5371 "src/glsl/glsl_parser.cpp"
break;
case 231:
-#line 1908 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "sampler1DShadow"; }
-#line 5276 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1908 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "sampler1DShadow"; }
+#line 5377 "src/glsl/glsl_parser.cpp"
break;
case 232:
-#line 1909 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "sampler2DShadow"; }
-#line 5282 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1909 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "sampler2DShadow"; }
+#line 5383 "src/glsl/glsl_parser.cpp"
break;
case 233:
-#line 1910 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "sampler2DRectShadow"; }
-#line 5288 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1910 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "sampler2DRectShadow"; }
+#line 5389 "src/glsl/glsl_parser.cpp"
break;
case 234:
-#line 1911 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "samplerCubeShadow"; }
-#line 5294 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1911 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "samplerCubeShadow"; }
+#line 5395 "src/glsl/glsl_parser.cpp"
break;
case 235:
-#line 1912 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "sampler1DArray"; }
-#line 5300 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1912 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "sampler1DArray"; }
+#line 5401 "src/glsl/glsl_parser.cpp"
break;
case 236:
-#line 1913 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "sampler2DArray"; }
-#line 5306 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1913 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "sampler2DArray"; }
+#line 5407 "src/glsl/glsl_parser.cpp"
break;
case 237:
-#line 1914 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "sampler1DArrayShadow"; }
-#line 5312 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1914 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "sampler1DArrayShadow"; }
+#line 5413 "src/glsl/glsl_parser.cpp"
break;
case 238:
-#line 1915 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "sampler2DArrayShadow"; }
-#line 5318 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1915 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "sampler2DArrayShadow"; }
+#line 5419 "src/glsl/glsl_parser.cpp"
break;
case 239:
-#line 1916 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "samplerBuffer"; }
-#line 5324 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1916 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "samplerBuffer"; }
+#line 5425 "src/glsl/glsl_parser.cpp"
break;
case 240:
-#line 1917 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "samplerCubeArray"; }
-#line 5330 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1917 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "samplerCubeArray"; }
+#line 5431 "src/glsl/glsl_parser.cpp"
break;
case 241:
-#line 1918 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "samplerCubeArrayShadow"; }
-#line 5336 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1918 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "samplerCubeArrayShadow"; }
+#line 5437 "src/glsl/glsl_parser.cpp"
break;
case 242:
-#line 1919 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "isampler1D"; }
-#line 5342 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1919 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "isampler1D"; }
+#line 5443 "src/glsl/glsl_parser.cpp"
break;
case 243:
-#line 1920 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "isampler2D"; }
-#line 5348 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1920 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "isampler2D"; }
+#line 5449 "src/glsl/glsl_parser.cpp"
break;
case 244:
-#line 1921 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "isampler2DRect"; }
-#line 5354 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1921 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "isampler2DRect"; }
+#line 5455 "src/glsl/glsl_parser.cpp"
break;
case 245:
-#line 1922 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "isampler3D"; }
-#line 5360 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1922 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "isampler3D"; }
+#line 5461 "src/glsl/glsl_parser.cpp"
break;
case 246:
-#line 1923 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "isamplerCube"; }
-#line 5366 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1923 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "isamplerCube"; }
+#line 5467 "src/glsl/glsl_parser.cpp"
break;
case 247:
-#line 1924 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "isampler1DArray"; }
-#line 5372 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1924 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "isampler1DArray"; }
+#line 5473 "src/glsl/glsl_parser.cpp"
break;
case 248:
-#line 1925 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "isampler2DArray"; }
-#line 5378 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1925 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "isampler2DArray"; }
+#line 5479 "src/glsl/glsl_parser.cpp"
break;
case 249:
-#line 1926 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "isamplerBuffer"; }
-#line 5384 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1926 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "isamplerBuffer"; }
+#line 5485 "src/glsl/glsl_parser.cpp"
break;
case 250:
-#line 1927 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "isamplerCubeArray"; }
-#line 5390 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1927 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "isamplerCubeArray"; }
+#line 5491 "src/glsl/glsl_parser.cpp"
break;
case 251:
-#line 1928 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "usampler1D"; }
-#line 5396 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1928 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "usampler1D"; }
+#line 5497 "src/glsl/glsl_parser.cpp"
break;
case 252:
-#line 1929 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "usampler2D"; }
-#line 5402 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1929 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "usampler2D"; }
+#line 5503 "src/glsl/glsl_parser.cpp"
break;
case 253:
-#line 1930 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "usampler2DRect"; }
-#line 5408 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1930 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "usampler2DRect"; }
+#line 5509 "src/glsl/glsl_parser.cpp"
break;
case 254:
-#line 1931 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "usampler3D"; }
-#line 5414 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1931 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "usampler3D"; }
+#line 5515 "src/glsl/glsl_parser.cpp"
break;
case 255:
-#line 1932 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "usamplerCube"; }
-#line 5420 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1932 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "usamplerCube"; }
+#line 5521 "src/glsl/glsl_parser.cpp"
break;
case 256:
-#line 1933 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "usampler1DArray"; }
-#line 5426 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1933 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "usampler1DArray"; }
+#line 5527 "src/glsl/glsl_parser.cpp"
break;
case 257:
-#line 1934 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "usampler2DArray"; }
-#line 5432 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1934 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "usampler2DArray"; }
+#line 5533 "src/glsl/glsl_parser.cpp"
break;
case 258:
-#line 1935 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "usamplerBuffer"; }
-#line 5438 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1935 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "usamplerBuffer"; }
+#line 5539 "src/glsl/glsl_parser.cpp"
break;
case 259:
-#line 1936 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "usamplerCubeArray"; }
-#line 5444 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1936 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "usamplerCubeArray"; }
+#line 5545 "src/glsl/glsl_parser.cpp"
break;
case 260:
-#line 1937 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "sampler2DMS"; }
-#line 5450 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1937 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "sampler2DMS"; }
+#line 5551 "src/glsl/glsl_parser.cpp"
break;
case 261:
-#line 1938 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "isampler2DMS"; }
-#line 5456 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1938 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "isampler2DMS"; }
+#line 5557 "src/glsl/glsl_parser.cpp"
break;
case 262:
-#line 1939 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "usampler2DMS"; }
-#line 5462 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1939 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "usampler2DMS"; }
+#line 5563 "src/glsl/glsl_parser.cpp"
break;
case 263:
-#line 1940 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "sampler2DMSArray"; }
-#line 5468 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1940 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "sampler2DMSArray"; }
+#line 5569 "src/glsl/glsl_parser.cpp"
break;
case 264:
-#line 1941 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "isampler2DMSArray"; }
-#line 5474 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1941 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "isampler2DMSArray"; }
+#line 5575 "src/glsl/glsl_parser.cpp"
break;
case 265:
-#line 1942 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "usampler2DMSArray"; }
-#line 5480 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1942 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "usampler2DMSArray"; }
+#line 5581 "src/glsl/glsl_parser.cpp"
break;
case 266:
-#line 1943 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "image1D"; }
-#line 5486 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1943 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "image1D"; }
+#line 5587 "src/glsl/glsl_parser.cpp"
break;
case 267:
-#line 1944 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "image2D"; }
-#line 5492 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1944 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "image2D"; }
+#line 5593 "src/glsl/glsl_parser.cpp"
break;
case 268:
-#line 1945 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "image3D"; }
-#line 5498 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1945 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "image3D"; }
+#line 5599 "src/glsl/glsl_parser.cpp"
break;
case 269:
-#line 1946 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "image2DRect"; }
-#line 5504 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1946 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "image2DRect"; }
+#line 5605 "src/glsl/glsl_parser.cpp"
break;
case 270:
-#line 1947 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "imageCube"; }
-#line 5510 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1947 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "imageCube"; }
+#line 5611 "src/glsl/glsl_parser.cpp"
break;
case 271:
-#line 1948 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "imageBuffer"; }
-#line 5516 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1948 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "imageBuffer"; }
+#line 5617 "src/glsl/glsl_parser.cpp"
break;
case 272:
-#line 1949 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "image1DArray"; }
-#line 5522 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1949 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "image1DArray"; }
+#line 5623 "src/glsl/glsl_parser.cpp"
break;
case 273:
-#line 1950 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "image2DArray"; }
-#line 5528 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1950 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "image2DArray"; }
+#line 5629 "src/glsl/glsl_parser.cpp"
break;
case 274:
-#line 1951 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "imageCubeArray"; }
-#line 5534 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1951 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "imageCubeArray"; }
+#line 5635 "src/glsl/glsl_parser.cpp"
break;
case 275:
-#line 1952 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "image2DMS"; }
-#line 5540 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1952 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "image2DMS"; }
+#line 5641 "src/glsl/glsl_parser.cpp"
break;
case 276:
-#line 1953 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "image2DMSArray"; }
-#line 5546 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1953 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "image2DMSArray"; }
+#line 5647 "src/glsl/glsl_parser.cpp"
break;
case 277:
-#line 1954 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "iimage1D"; }
-#line 5552 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1954 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "iimage1D"; }
+#line 5653 "src/glsl/glsl_parser.cpp"
break;
case 278:
-#line 1955 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "iimage2D"; }
-#line 5558 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1955 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "iimage2D"; }
+#line 5659 "src/glsl/glsl_parser.cpp"
break;
case 279:
-#line 1956 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "iimage3D"; }
-#line 5564 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1956 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "iimage3D"; }
+#line 5665 "src/glsl/glsl_parser.cpp"
break;
case 280:
-#line 1957 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "iimage2DRect"; }
-#line 5570 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1957 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "iimage2DRect"; }
+#line 5671 "src/glsl/glsl_parser.cpp"
break;
case 281:
-#line 1958 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "iimageCube"; }
-#line 5576 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1958 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "iimageCube"; }
+#line 5677 "src/glsl/glsl_parser.cpp"
break;
case 282:
-#line 1959 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "iimageBuffer"; }
-#line 5582 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1959 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "iimageBuffer"; }
+#line 5683 "src/glsl/glsl_parser.cpp"
break;
case 283:
-#line 1960 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "iimage1DArray"; }
-#line 5588 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1960 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "iimage1DArray"; }
+#line 5689 "src/glsl/glsl_parser.cpp"
break;
case 284:
-#line 1961 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "iimage2DArray"; }
-#line 5594 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1961 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "iimage2DArray"; }
+#line 5695 "src/glsl/glsl_parser.cpp"
break;
case 285:
-#line 1962 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "iimageCubeArray"; }
-#line 5600 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1962 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "iimageCubeArray"; }
+#line 5701 "src/glsl/glsl_parser.cpp"
break;
case 286:
-#line 1963 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "iimage2DMS"; }
-#line 5606 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1963 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "iimage2DMS"; }
+#line 5707 "src/glsl/glsl_parser.cpp"
break;
case 287:
-#line 1964 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "iimage2DMSArray"; }
-#line 5612 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1964 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "iimage2DMSArray"; }
+#line 5713 "src/glsl/glsl_parser.cpp"
break;
case 288:
-#line 1965 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uimage1D"; }
-#line 5618 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1965 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uimage1D"; }
+#line 5719 "src/glsl/glsl_parser.cpp"
break;
case 289:
-#line 1966 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uimage2D"; }
-#line 5624 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1966 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uimage2D"; }
+#line 5725 "src/glsl/glsl_parser.cpp"
break;
case 290:
-#line 1967 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uimage3D"; }
-#line 5630 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1967 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uimage3D"; }
+#line 5731 "src/glsl/glsl_parser.cpp"
break;
case 291:
-#line 1968 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uimage2DRect"; }
-#line 5636 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1968 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uimage2DRect"; }
+#line 5737 "src/glsl/glsl_parser.cpp"
break;
case 292:
-#line 1969 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uimageCube"; }
-#line 5642 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1969 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uimageCube"; }
+#line 5743 "src/glsl/glsl_parser.cpp"
break;
case 293:
-#line 1970 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uimageBuffer"; }
-#line 5648 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1970 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uimageBuffer"; }
+#line 5749 "src/glsl/glsl_parser.cpp"
break;
case 294:
-#line 1971 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uimage1DArray"; }
-#line 5654 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1971 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uimage1DArray"; }
+#line 5755 "src/glsl/glsl_parser.cpp"
break;
case 295:
-#line 1972 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uimage2DArray"; }
-#line 5660 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1972 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uimage2DArray"; }
+#line 5761 "src/glsl/glsl_parser.cpp"
break;
case 296:
-#line 1973 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uimageCubeArray"; }
-#line 5666 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1973 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uimageCubeArray"; }
+#line 5767 "src/glsl/glsl_parser.cpp"
break;
case 297:
-#line 1974 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uimage2DMS"; }
-#line 5672 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1974 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uimage2DMS"; }
+#line 5773 "src/glsl/glsl_parser.cpp"
break;
case 298:
-#line 1975 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "uimage2DMSArray"; }
-#line 5678 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1975 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "uimage2DMSArray"; }
+#line 5779 "src/glsl/glsl_parser.cpp"
break;
case 299:
-#line 1976 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.identifier) = "atomic_uint"; }
-#line 5684 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 1976 "src/glsl/glsl_parser.yy"
+ { (yyval.identifier) = "atomic_uint"; }
+#line 5785 "src/glsl/glsl_parser.cpp"
break;
case 300:
-#line 1981 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1981 "src/glsl/glsl_parser.yy"
+ {
state->check_precision_qualifiers_allowed(&(yylsp[0]));
(yyval.n) = ast_precision_high;
}
-#line 5693 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5794 "src/glsl/glsl_parser.cpp"
break;
case 301:
-#line 1986 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1986 "src/glsl/glsl_parser.yy"
+ {
state->check_precision_qualifiers_allowed(&(yylsp[0]));
(yyval.n) = ast_precision_medium;
}
-#line 5702 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5803 "src/glsl/glsl_parser.cpp"
break;
case 302:
-#line 1991 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1991 "src/glsl/glsl_parser.yy"
+ {
state->check_precision_qualifiers_allowed(&(yylsp[0]));
(yyval.n) = ast_precision_low;
}
-#line 5711 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5812 "src/glsl/glsl_parser.cpp"
break;
case 303:
-#line 1999 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 1999 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.struct_specifier) = new(ctx) ast_struct_specifier((yyvsp[-3].identifier), (yyvsp[-1].declarator_list));
(yyval.struct_specifier)->set_location_range((yylsp[-3]), (yylsp[0]));
state->symbols->add_type((yyvsp[-3].identifier), glsl_type::void_type);
}
-#line 5722 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5823 "src/glsl/glsl_parser.cpp"
break;
case 304:
-#line 2006 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2006 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.struct_specifier) = new(ctx) ast_struct_specifier(NULL, (yyvsp[-1].declarator_list));
(yyval.struct_specifier)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 5732 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5833 "src/glsl/glsl_parser.cpp"
break;
case 305:
-#line 2015 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2015 "src/glsl/glsl_parser.yy"
+ {
(yyval.declarator_list) = (yyvsp[0].declarator_list);
(yyvsp[0].declarator_list)->link.self_link();
}
-#line 5741 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5842 "src/glsl/glsl_parser.cpp"
break;
case 306:
-#line 2020 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2020 "src/glsl/glsl_parser.yy"
+ {
(yyval.declarator_list) = (yyvsp[-1].declarator_list);
(yyval.declarator_list)->link.insert_before(& (yyvsp[0].declarator_list)->link);
}
-#line 5750 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5851 "src/glsl/glsl_parser.cpp"
break;
case 307:
-#line 2028 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2028 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_fully_specified_type *const type = (yyvsp[-2].fully_specified_type);
type->set_location((yylsp[-2]));
@@ -5766,146 +5867,146 @@ yyreduce:
(yyval.declarator_list)->declarations.push_degenerate_list_at_head(& (yyvsp[-1].declaration)->link);
}
-#line 5770 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5871 "src/glsl/glsl_parser.cpp"
break;
case 308:
-#line 2047 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2047 "src/glsl/glsl_parser.yy"
+ {
(yyval.declaration) = (yyvsp[0].declaration);
(yyvsp[0].declaration)->link.self_link();
}
-#line 5779 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5880 "src/glsl/glsl_parser.cpp"
break;
case 309:
-#line 2052 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2052 "src/glsl/glsl_parser.yy"
+ {
(yyval.declaration) = (yyvsp[-2].declaration);
(yyval.declaration)->link.insert_before(& (yyvsp[0].declaration)->link);
}
-#line 5788 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5889 "src/glsl/glsl_parser.cpp"
break;
case 310:
-#line 2060 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2060 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.declaration) = new(ctx) ast_declaration((yyvsp[0].identifier), NULL, NULL);
(yyval.declaration)->set_location((yylsp[0]));
}
-#line 5798 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5899 "src/glsl/glsl_parser.cpp"
break;
case 311:
-#line 2066 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2066 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.declaration) = new(ctx) ast_declaration((yyvsp[-1].identifier), (yyvsp[0].array_specifier), NULL);
(yyval.declaration)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 5808 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5909 "src/glsl/glsl_parser.cpp"
break;
case 313:
-#line 2076 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2076 "src/glsl/glsl_parser.yy"
+ {
(yyval.expression) = (yyvsp[-1].expression);
}
-#line 5816 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5917 "src/glsl/glsl_parser.cpp"
break;
case 314:
-#line 2080 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2080 "src/glsl/glsl_parser.yy"
+ {
(yyval.expression) = (yyvsp[-2].expression);
}
-#line 5824 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5925 "src/glsl/glsl_parser.cpp"
break;
case 315:
-#line 2087 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2087 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.expression) = new(ctx) ast_aggregate_initializer();
(yyval.expression)->set_location((yylsp[0]));
(yyval.expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 5835 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5936 "src/glsl/glsl_parser.cpp"
break;
case 316:
-#line 2094 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2094 "src/glsl/glsl_parser.yy"
+ {
(yyvsp[-2].expression)->expressions.push_tail(& (yyvsp[0].expression)->link);
}
-#line 5843 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5944 "src/glsl/glsl_parser.cpp"
break;
case 318:
-#line 2106 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.node) = (ast_node *) (yyvsp[0].compound_statement); }
-#line 5849 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 2106 "src/glsl/glsl_parser.yy"
+ { (yyval.node) = (ast_node *) (yyvsp[0].compound_statement); }
+#line 5950 "src/glsl/glsl_parser.cpp"
break;
case 326:
-#line 2121 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2121 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.compound_statement) = new(ctx) ast_compound_statement(true, NULL);
(yyval.compound_statement)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 5859 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5960 "src/glsl/glsl_parser.cpp"
break;
case 327:
-#line 2127 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2127 "src/glsl/glsl_parser.yy"
+ {
state->symbols->push_scope();
}
-#line 5867 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5968 "src/glsl/glsl_parser.cpp"
break;
case 328:
-#line 2131 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2131 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.compound_statement) = new(ctx) ast_compound_statement(true, (yyvsp[-1].node));
(yyval.compound_statement)->set_location_range((yylsp[-3]), (yylsp[0]));
state->symbols->pop_scope();
}
-#line 5878 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5979 "src/glsl/glsl_parser.cpp"
break;
case 329:
-#line 2140 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.node) = (ast_node *) (yyvsp[0].compound_statement); }
-#line 5884 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 2140 "src/glsl/glsl_parser.yy"
+ { (yyval.node) = (ast_node *) (yyvsp[0].compound_statement); }
+#line 5985 "src/glsl/glsl_parser.cpp"
break;
case 331:
-#line 2146 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2146 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.compound_statement) = new(ctx) ast_compound_statement(false, NULL);
(yyval.compound_statement)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 5894 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 5995 "src/glsl/glsl_parser.cpp"
break;
case 332:
-#line 2152 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2152 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.compound_statement) = new(ctx) ast_compound_statement(false, (yyvsp[-1].node));
(yyval.compound_statement)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 5904 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6005 "src/glsl/glsl_parser.cpp"
break;
case 333:
-#line 2161 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2161 "src/glsl/glsl_parser.yy"
+ {
if ((yyvsp[0].node) == NULL) {
_mesa_glsl_error(& (yylsp[0]), state, "<nil> statement");
assert((yyvsp[0].node) != NULL);
@@ -5914,12 +6015,12 @@ yyreduce:
(yyval.node) = (yyvsp[0].node);
(yyval.node)->link.self_link();
}
-#line 5918 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6019 "src/glsl/glsl_parser.cpp"
break;
case 334:
-#line 2171 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2171 "src/glsl/glsl_parser.yy"
+ {
if ((yyvsp[0].node) == NULL) {
_mesa_glsl_error(& (yylsp[0]), state, "<nil> statement");
assert((yyvsp[0].node) != NULL);
@@ -5927,68 +6028,68 @@ yyreduce:
(yyval.node) = (yyvsp[-1].node);
(yyval.node)->link.insert_before(& (yyvsp[0].node)->link);
}
-#line 5931 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6032 "src/glsl/glsl_parser.cpp"
break;
case 335:
-#line 2183 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2183 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.node) = new(ctx) ast_expression_statement(NULL);
(yyval.node)->set_location((yylsp[0]));
}
-#line 5941 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6042 "src/glsl/glsl_parser.cpp"
break;
case 336:
-#line 2189 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2189 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.node) = new(ctx) ast_expression_statement((yyvsp[-1].expression));
(yyval.node)->set_location((yylsp[-1]));
}
-#line 5951 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6052 "src/glsl/glsl_parser.cpp"
break;
case 337:
-#line 2198 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2198 "src/glsl/glsl_parser.yy"
+ {
(yyval.node) = new(state) ast_selection_statement((yyvsp[-2].expression), (yyvsp[0].selection_rest_statement).then_statement,
(yyvsp[0].selection_rest_statement).else_statement);
(yyval.node)->set_location_range((yylsp[-4]), (yylsp[0]));
}
-#line 5961 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6062 "src/glsl/glsl_parser.cpp"
break;
case 338:
-#line 2207 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2207 "src/glsl/glsl_parser.yy"
+ {
(yyval.selection_rest_statement).then_statement = (yyvsp[-2].node);
(yyval.selection_rest_statement).else_statement = (yyvsp[0].node);
}
-#line 5970 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6071 "src/glsl/glsl_parser.cpp"
break;
case 339:
-#line 2212 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2212 "src/glsl/glsl_parser.yy"
+ {
(yyval.selection_rest_statement).then_statement = (yyvsp[0].node);
(yyval.selection_rest_statement).else_statement = NULL;
}
-#line 5979 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6080 "src/glsl/glsl_parser.cpp"
break;
case 340:
-#line 2220 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2220 "src/glsl/glsl_parser.yy"
+ {
(yyval.node) = (ast_node *) (yyvsp[0].expression);
}
-#line 5987 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6088 "src/glsl/glsl_parser.cpp"
break;
case 341:
-#line 2224 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2224 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration((yyvsp[-2].identifier), NULL, (yyvsp[0].expression));
ast_declarator_list *declarator = new(ctx) ast_declarator_list((yyvsp[-3].fully_specified_type));
@@ -5998,253 +6099,253 @@ yyreduce:
declarator->declarations.push_tail(&decl->link);
(yyval.node) = declarator;
}
-#line 6002 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6103 "src/glsl/glsl_parser.cpp"
break;
case 342:
-#line 2242 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2242 "src/glsl/glsl_parser.yy"
+ {
(yyval.node) = new(state) ast_switch_statement((yyvsp[-2].expression), (yyvsp[0].switch_body));
(yyval.node)->set_location_range((yylsp[-4]), (yylsp[0]));
}
-#line 6011 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6112 "src/glsl/glsl_parser.cpp"
break;
case 343:
-#line 2250 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2250 "src/glsl/glsl_parser.yy"
+ {
(yyval.switch_body) = new(state) ast_switch_body(NULL);
(yyval.switch_body)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 6020 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6121 "src/glsl/glsl_parser.cpp"
break;
case 344:
-#line 2255 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2255 "src/glsl/glsl_parser.yy"
+ {
(yyval.switch_body) = new(state) ast_switch_body((yyvsp[-1].case_statement_list));
(yyval.switch_body)->set_location_range((yylsp[-2]), (yylsp[0]));
}
-#line 6029 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6130 "src/glsl/glsl_parser.cpp"
break;
case 345:
-#line 2263 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2263 "src/glsl/glsl_parser.yy"
+ {
(yyval.case_label) = new(state) ast_case_label((yyvsp[-1].expression));
(yyval.case_label)->set_location((yylsp[-1]));
}
-#line 6038 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6139 "src/glsl/glsl_parser.cpp"
break;
case 346:
-#line 2268 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2268 "src/glsl/glsl_parser.yy"
+ {
(yyval.case_label) = new(state) ast_case_label(NULL);
(yyval.case_label)->set_location((yylsp[0]));
}
-#line 6047 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6148 "src/glsl/glsl_parser.cpp"
break;
case 347:
-#line 2276 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2276 "src/glsl/glsl_parser.yy"
+ {
ast_case_label_list *labels = new(state) ast_case_label_list();
labels->labels.push_tail(& (yyvsp[0].case_label)->link);
(yyval.case_label_list) = labels;
(yyval.case_label_list)->set_location((yylsp[0]));
}
-#line 6059 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6160 "src/glsl/glsl_parser.cpp"
break;
case 348:
-#line 2284 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2284 "src/glsl/glsl_parser.yy"
+ {
(yyval.case_label_list) = (yyvsp[-1].case_label_list);
(yyval.case_label_list)->labels.push_tail(& (yyvsp[0].case_label)->link);
}
-#line 6068 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6169 "src/glsl/glsl_parser.cpp"
break;
case 349:
-#line 2292 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2292 "src/glsl/glsl_parser.yy"
+ {
ast_case_statement *stmts = new(state) ast_case_statement((yyvsp[-1].case_label_list));
stmts->set_location((yylsp[0]));
stmts->stmts.push_tail(& (yyvsp[0].node)->link);
(yyval.case_statement) = stmts;
}
-#line 6080 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6181 "src/glsl/glsl_parser.cpp"
break;
case 350:
-#line 2300 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2300 "src/glsl/glsl_parser.yy"
+ {
(yyval.case_statement) = (yyvsp[-1].case_statement);
(yyval.case_statement)->stmts.push_tail(& (yyvsp[0].node)->link);
}
-#line 6089 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6190 "src/glsl/glsl_parser.cpp"
break;
case 351:
-#line 2308 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2308 "src/glsl/glsl_parser.yy"
+ {
ast_case_statement_list *cases= new(state) ast_case_statement_list();
cases->set_location((yylsp[0]));
cases->cases.push_tail(& (yyvsp[0].case_statement)->link);
(yyval.case_statement_list) = cases;
}
-#line 6101 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6202 "src/glsl/glsl_parser.cpp"
break;
case 352:
-#line 2316 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2316 "src/glsl/glsl_parser.yy"
+ {
(yyval.case_statement_list) = (yyvsp[-1].case_statement_list);
(yyval.case_statement_list)->cases.push_tail(& (yyvsp[0].case_statement)->link);
}
-#line 6110 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6211 "src/glsl/glsl_parser.cpp"
break;
case 353:
-#line 2324 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2324 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_while,
NULL, (yyvsp[-2].node), NULL, (yyvsp[0].node));
(yyval.node)->set_location_range((yylsp[-4]), (yylsp[-1]));
}
-#line 6121 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6222 "src/glsl/glsl_parser.cpp"
break;
case 354:
-#line 2331 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2331 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_do_while,
NULL, (yyvsp[-2].expression), NULL, (yyvsp[-5].node));
(yyval.node)->set_location_range((yylsp[-6]), (yylsp[-1]));
}
-#line 6132 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6233 "src/glsl/glsl_parser.cpp"
break;
case 355:
-#line 2338 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2338 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.node) = new(ctx) ast_iteration_statement(ast_iteration_statement::ast_for,
(yyvsp[-3].node), (yyvsp[-2].for_rest_statement).cond, (yyvsp[-2].for_rest_statement).rest, (yyvsp[0].node));
(yyval.node)->set_location_range((yylsp[-5]), (yylsp[0]));
}
-#line 6143 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6244 "src/glsl/glsl_parser.cpp"
break;
case 359:
-#line 2354 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2354 "src/glsl/glsl_parser.yy"
+ {
(yyval.node) = NULL;
}
-#line 6151 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6252 "src/glsl/glsl_parser.cpp"
break;
case 360:
-#line 2361 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2361 "src/glsl/glsl_parser.yy"
+ {
(yyval.for_rest_statement).cond = (yyvsp[-1].node);
(yyval.for_rest_statement).rest = NULL;
}
-#line 6160 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6261 "src/glsl/glsl_parser.cpp"
break;
case 361:
-#line 2366 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2366 "src/glsl/glsl_parser.yy"
+ {
(yyval.for_rest_statement).cond = (yyvsp[-2].node);
(yyval.for_rest_statement).rest = (yyvsp[0].expression);
}
-#line 6169 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6270 "src/glsl/glsl_parser.cpp"
break;
case 362:
-#line 2375 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2375 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_continue, NULL);
(yyval.node)->set_location((yylsp[-1]));
}
-#line 6179 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6280 "src/glsl/glsl_parser.cpp"
break;
case 363:
-#line 2381 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2381 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_break, NULL);
(yyval.node)->set_location((yylsp[-1]));
}
-#line 6189 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6290 "src/glsl/glsl_parser.cpp"
break;
case 364:
-#line 2387 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2387 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, NULL);
(yyval.node)->set_location((yylsp[-1]));
}
-#line 6199 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6300 "src/glsl/glsl_parser.cpp"
break;
case 365:
-#line 2393 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2393 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_return, (yyvsp[-1].expression));
(yyval.node)->set_location_range((yylsp[-2]), (yylsp[-1]));
}
-#line 6209 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6310 "src/glsl/glsl_parser.cpp"
break;
case 366:
-#line 2399 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2399 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.node) = new(ctx) ast_jump_statement(ast_jump_statement::ast_discard, NULL);
(yyval.node)->set_location((yylsp[-1]));
}
-#line 6219 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6320 "src/glsl/glsl_parser.cpp"
break;
case 367:
-#line 2407 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.node) = (yyvsp[0].function_definition); }
-#line 6225 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 2407 "src/glsl/glsl_parser.yy"
+ { (yyval.node) = (yyvsp[0].function_definition); }
+#line 6326 "src/glsl/glsl_parser.cpp"
break;
case 368:
-#line 2408 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.node) = (yyvsp[0].node); }
-#line 6231 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 2408 "src/glsl/glsl_parser.yy"
+ { (yyval.node) = (yyvsp[0].node); }
+#line 6332 "src/glsl/glsl_parser.cpp"
break;
case 369:
-#line 2409 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.node) = NULL; }
-#line 6237 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 2409 "src/glsl/glsl_parser.yy"
+ { (yyval.node) = NULL; }
+#line 6338 "src/glsl/glsl_parser.cpp"
break;
case 370:
-#line 2410 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- { (yyval.node) = (yyvsp[0].node); }
-#line 6243 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 2410 "src/glsl/glsl_parser.yy"
+ { (yyval.node) = (yyvsp[0].node); }
+#line 6344 "src/glsl/glsl_parser.cpp"
break;
case 371:
-#line 2415 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2415 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
(yyval.function_definition) = new(ctx) ast_function_definition();
(yyval.function_definition)->set_location_range((yylsp[-1]), (yylsp[0]));
@@ -6253,20 +6354,20 @@ yyreduce:
state->symbols->pop_scope();
}
-#line 6257 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6358 "src/glsl/glsl_parser.cpp"
break;
case 372:
-#line 2429 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2429 "src/glsl/glsl_parser.yy"
+ {
(yyval.node) = (yyvsp[0].interface_block);
}
-#line 6265 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6366 "src/glsl/glsl_parser.cpp"
break;
case 373:
-#line 2433 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2433 "src/glsl/glsl_parser.yy"
+ {
ast_interface_block *block = (yyvsp[0].interface_block);
if (!block->layout.merge_qualifier(& (yylsp[-1]), state, (yyvsp[-1].type_qualifier))) {
YYERROR;
@@ -6285,12 +6386,12 @@ yyreduce:
}
(yyval.node) = block;
}
-#line 6289 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6390 "src/glsl/glsl_parser.cpp"
break;
case 374:
-#line 2456 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2456 "src/glsl/glsl_parser.yy"
+ {
ast_interface_block *const block = (yyvsp[-1].interface_block);
block->block_name = (yyvsp[-5].identifier);
@@ -6391,89 +6492,89 @@ yyreduce:
(yyval.interface_block) = block;
}
-#line 6395 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6496 "src/glsl/glsl_parser.cpp"
break;
case 375:
-#line 2561 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2561 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.in = 1;
}
-#line 6405 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6506 "src/glsl/glsl_parser.cpp"
break;
case 376:
-#line 2567 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2567 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.out = 1;
}
-#line 6415 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6516 "src/glsl/glsl_parser.cpp"
break;
case 377:
-#line 2573 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2573 "src/glsl/glsl_parser.yy"
+ {
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
(yyval.type_qualifier).precision = ast_precision_none;
(yyval.type_qualifier).flags.q.uniform = 1;
}
-#line 6425 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6526 "src/glsl/glsl_parser.cpp"
break;
case 378:
-#line 2582 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2582 "src/glsl/glsl_parser.yy"
+ {
(yyval.interface_block) = new(state) ast_interface_block(*state->default_uniform_qualifier,
NULL, NULL);
}
-#line 6434 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6535 "src/glsl/glsl_parser.cpp"
break;
case 379:
-#line 2587 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2587 "src/glsl/glsl_parser.yy"
+ {
(yyval.interface_block) = new(state) ast_interface_block(*state->default_uniform_qualifier,
(yyvsp[0].identifier), NULL);
(yyval.interface_block)->set_location((yylsp[0]));
}
-#line 6444 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6545 "src/glsl/glsl_parser.cpp"
break;
case 380:
-#line 2593 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2593 "src/glsl/glsl_parser.yy"
+ {
(yyval.interface_block) = new(state) ast_interface_block(*state->default_uniform_qualifier,
(yyvsp[-1].identifier), (yyvsp[0].array_specifier));
(yyval.interface_block)->set_location_range((yylsp[-1]), (yylsp[0]));
}
-#line 6454 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6555 "src/glsl/glsl_parser.cpp"
break;
case 381:
-#line 2602 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2602 "src/glsl/glsl_parser.yy"
+ {
(yyval.declarator_list) = (yyvsp[0].declarator_list);
(yyvsp[0].declarator_list)->link.self_link();
}
-#line 6463 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6564 "src/glsl/glsl_parser.cpp"
break;
case 382:
-#line 2607 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2607 "src/glsl/glsl_parser.yy"
+ {
(yyval.declarator_list) = (yyvsp[-1].declarator_list);
(yyvsp[0].declarator_list)->link.insert_before(& (yyval.declarator_list)->link);
}
-#line 6472 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6573 "src/glsl/glsl_parser.cpp"
break;
case 383:
-#line 2615 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2615 "src/glsl/glsl_parser.yy"
+ {
void *ctx = state;
ast_fully_specified_type *type = (yyvsp[-2].fully_specified_type);
type->set_location((yylsp[-2]));
@@ -6493,34 +6594,34 @@ yyreduce:
(yyval.declarator_list)->declarations.push_degenerate_list_at_head(& (yyvsp[-1].declaration)->link);
}
-#line 6497 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6598 "src/glsl/glsl_parser.cpp"
break;
case 384:
-#line 2639 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2639 "src/glsl/glsl_parser.yy"
+ {
if (!state->default_uniform_qualifier->merge_qualifier(& (yylsp[-2]), state, (yyvsp[-2].type_qualifier))) {
YYERROR;
}
(yyval.node) = NULL;
}
-#line 6508 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6609 "src/glsl/glsl_parser.cpp"
break;
case 385:
-#line 2647 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2647 "src/glsl/glsl_parser.yy"
+ {
(yyval.node) = NULL;
if (!state->in_qualifier->merge_in_qualifier(& (yylsp[-2]), state, (yyvsp[-2].type_qualifier), (yyval.node))) {
YYERROR;
}
}
-#line 6519 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6620 "src/glsl/glsl_parser.cpp"
break;
case 386:
-#line 2655 "src/glsl/glsl_parser.yy" /* yacc.c:1646 */
- {
+#line 2655 "src/glsl/glsl_parser.yy"
+ {
if (state->stage != MESA_SHADER_GEOMETRY) {
_mesa_glsl_error(& (yylsp[-2]), state,
"out layout qualifiers only valid in "
@@ -6547,11 +6648,12 @@ yyreduce:
}
(yyval.node) = NULL;
}
-#line 6551 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6652 "src/glsl/glsl_parser.cpp"
break;
-#line 6555 "src/glsl/glsl_parser.cpp" /* yacc.c:1646 */
+#line 6656 "src/glsl/glsl_parser.cpp"
+
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -6577,14 +6679,13 @@ yyreduce:
/* Now 'shift' the result of the reduction. Determine what state
that goes to, based on the state we popped back to and the rule
number reduced by. */
-
- yyn = yyr1[yyn];
-
- yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
- if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
- yystate = yytable[yystate];
- else
- yystate = yydefgoto[yyn - YYNTOKENS];
+ {
+ const int yylhs = yyr1[yyn] - YYNTOKENS;
+ const int yyi = yypgoto[yylhs] + *yyssp;
+ yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
+ ? yytable[yyi]
+ : yydefgoto[yylhs]);
+ }
goto yynewstate;
@@ -6616,7 +6717,7 @@ yyerrlab:
{
if (yymsg != yymsgbuf)
YYSTACK_FREE (yymsg);
- yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+ yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc)));
if (!yymsg)
{
yymsg = yymsgbuf;
@@ -6667,14 +6768,11 @@ yyerrlab:
| yyerrorlab -- error raised explicitly by YYERROR. |
`---------------------------------------------------*/
yyerrorlab:
+ /* Pacify compilers when the user code never invokes YYERROR and the
+ label yyerrorlab therefore never appears in user code. */
+ if (0)
+ YYERROR;
- /* Pacify compilers like GCC when the user code never invokes
- YYERROR and the label yyerrorlab therefore never appears in user
- code. */
- if (/*CONSTCOND*/ 0)
- goto yyerrorlab;
-
- yyerror_range[1] = yylsp[1-yylen];
/* Do not reclaim the symbols of the rule whose action triggered
this YYERROR. */
YYPOPSTACK (yylen);
@@ -6740,6 +6838,7 @@ yyacceptlab:
yyresult = 0;
goto yyreturn;
+
/*-----------------------------------.
| yyabortlab -- YYABORT comes here. |
`-----------------------------------*/
@@ -6747,6 +6846,7 @@ yyabortlab:
yyresult = 1;
goto yyreturn;
+
#if !defined yyoverflow || YYERROR_VERBOSE
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here. |
@@ -6757,6 +6857,10 @@ yyexhaustedlab:
/* Fall through. */
#endif
+
+/*-----------------------------------------------------.
+| yyreturn -- parsing is finished, return the result. |
+`-----------------------------------------------------*/
yyreturn:
if (yychar != YYEMPTY)
{
@@ -6773,7 +6877,7 @@ yyreturn:
while (yyssp != yyss)
{
yydestruct ("Cleanup: popping",
- yystos[*yyssp], yyvsp, yylsp, state);
+ yystos[+*yyssp], yyvsp, yylsp, state);
YYPOPSTACK (1);
}
#ifndef yyoverflow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser.h b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser.h
index 715f0babc08..cdaae2d00fd 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser.h
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/glsl_parser.h
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 3.5.1. */
/* Bison interface for Yacc-like parsers in C
- Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+ Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2020 Free Software Foundation,
+ Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,6 +31,9 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
+/* Undocumented macros, especially those whose name start with YY_,
+ are private implementation details. Do not rely on them. */
+
#ifndef YY__MESA_GLSL_SRC_GLSL_GLSL_PARSER_H_INCLUDED
# define YY__MESA_GLSL_SRC_GLSL_GLSL_PARSER_H_INCLUDED
/* Debug traces. */
@@ -280,10 +284,9 @@ extern int _mesa_glsl_debug;
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-typedef union YYSTYPE YYSTYPE;
union YYSTYPE
{
-#line 99 "src/glsl/glsl_parser.yy" /* yacc.c:1909 */
+#line 99 "src/glsl/glsl_parser.yy"
int n;
float real;
@@ -320,8 +323,10 @@ union YYSTYPE
ast_node *else_statement;
} selection_rest_statement;
-#line 324 "src/glsl/glsl_parser.h" /* yacc.c:1909 */
+#line 327 "src/glsl/glsl_parser.h"
+
};
+typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp
index dcd7f3745e1..22d8af42620 100644
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp
+++ b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/glsl/ir_print_glsl_visitor.cpp
@@ -449,7 +449,9 @@ void ir_print_glsl_visitor::visit(ir_variable *ir)
const char *const interp[] = { "", "smooth ", "flat ", "noperspective " };
- if (this->state->language_version >= 300 && ir->data.explicit_location)
+ bool built_in = (strstr(ir->name, "gl_") == ir->name);
+
+ if (this->state->language_version >= 300 && ir->data.explicit_location && !built_in)
{
const int binding_base = (this->state->stage == MESA_SHADER_VERTEX ? (int)VERT_ATTRIB_GENERIC0 : (int)FRAG_RESULT_DATA0);
const int location = ir->data.location - binding_base;
@@ -488,7 +490,7 @@ void ir_print_glsl_visitor::visit(ir_variable *ir)
}
// keep invariant declaration for builtin variables
- if (strstr(ir->name, "gl_") == ir->name) {
+ if (built_in) {
buffer.asprintf_append ("%s", inv);
print_var_name (ir);
return;
@@ -756,6 +758,16 @@ void ir_print_glsl_visitor::visit(ir_expression *ir)
buffer.asprintf_append (")");
}
}
+ else if (ir->operation == ir_triop_csel)
+ {
+ buffer.asprintf_append ("mix(");
+ ir->operands[2]->accept(this);
+ buffer.asprintf_append (", ");
+ ir->operands[1]->accept(this);
+ buffer.asprintf_append (", bvec%d(", ir->operands[1]->type->vector_elements);
+ ir->operands[0]->accept(this);
+ buffer.asprintf_append ("))");
+ }
else if (ir->operation == ir_binop_vector_extract)
{
// a[b]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/.gitignore b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/.gitignore
deleted file mode 100644
index fec06291a70..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/main/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-api_exec.c
-dispatch.h
-enums.c
-get_es1.c
-get_es2.c
-git_sha1.h
-git_sha1.h.tmp
-remap_helper.h
-get_hash.h
-get_hash.h.tmp
-format_info.c
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/program/.gitignore b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/program/.gitignore
deleted file mode 100644
index 4c20872e14a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/mesa/program/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-program_parse.output
-lex.yy.c
-program_parse.tab.c
-program_parse.tab.h
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/util/.gitignore b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/util/.gitignore
deleted file mode 100644
index e945ecbb511..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/util/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-format_srgb.c
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/util/SConscript b/3rdparty/bgfx/3rdparty/glsl-optimizer/src/util/SConscript
deleted file mode 100644
index ade1d6c6cfd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/src/util/SConscript
+++ /dev/null
@@ -1,38 +0,0 @@
-import common
-
-Import('*')
-
-from sys import executable as python_cmd
-
-env = env.Clone()
-
-env.Prepend(CPPPATH = [
- '#include',
- '#src',
- '#src/mapi',
- '#src/mesa',
- '#src/util',
-])
-
-env.CodeGenerate(
- target = 'format_srgb.c',
- script = 'format_srgb.py',
- source = [],
- command = python_cmd + ' $SCRIPT > $TARGET'
-)
-
-# parse Makefile.sources
-source_lists = env.ParseSourceList('Makefile.sources')
-
-mesautil_sources = (
- source_lists['MESA_UTIL_FILES'] +
- source_lists['MESA_UTIL_GENERATED_FILES']
-)
-
-mesautil = env.ConvenienceLibrary(
- target = 'mesautil',
- source = mesautil_sources,
-)
-
-env.Alias('mesautil', mesautil)
-Export('mesautil')
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/target_defaults.gypi b/3rdparty/bgfx/3rdparty/glsl-optimizer/target_defaults.gypi
deleted file mode 100644
index a76ae69ea65..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/target_defaults.gypi
+++ /dev/null
@@ -1,28 +0,0 @@
-{
- 'target_defaults': {
- 'configurations': {
- 'Debug': {
- 'defines': [
- 'DEBUG',
- '_DEBUG',
- ],
- },
- 'Release': {
- 'defines': [
- 'NDEBUG',
- ],
- },
- },
- 'conditions': [
- ['OS=="win"', {
- 'target_defaults': {
- 'msvs_settings': {
- 'VCCLCompilerTool': {
- 'ExceptionHandling': '0',
- },
- },
- },
- }],
- ],
- }
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-in.txt
deleted file mode 100644
index 56dccb65be3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-in.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-vec4 xlat_main( );
-vec4 xlat_main( ) {
- vec2 poisson[8];
- poisson[0] = vec2( 0.000000, 0.000000);
- poisson[1] = vec2( 0.527837, -0.0858680);
- poisson[2] = vec2( -0.0400880, 0.536087);
- poisson[3] = vec2( -0.670445, -0.179949);
- poisson[4] = vec2( -0.419418, -0.616039);
- poisson[5] = vec2( 0.440453, -0.639399);
- poisson[6] = vec2( -0.757088, 0.349334);
- poisson[7] = vec2( 0.574619, 0.685879);
- vec4 c;
- int i = 0;
- c = vec4( 0.000000);
- for ( ; (i < 8); ( ++i )) {
- c.xy += poisson[ i ];
- }
- return c;
-}
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( );
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-inES.txt
deleted file mode 100644
index 92a41e6a19a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-inES.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-mediump vec4 xlat_main( );
-mediump vec4 xlat_main( ) {
- highp vec2 poisson[8];
- poisson[0] = vec2( 0.000000, 0.000000);
- poisson[1] = vec2( 0.527837, -0.0858680);
- poisson[2] = vec2( -0.0400880, 0.536087);
- poisson[3] = vec2( -0.670445, -0.179949);
- poisson[4] = vec2( -0.419418, -0.616039);
- poisson[5] = vec2( 0.440453, -0.639399);
- poisson[6] = vec2( -0.757088, 0.349334);
- poisson[7] = vec2( 0.574619, 0.685879);
- mediump vec4 c;
- highp int i = 0;
- c = vec4( 0.000000);
- for ( ; (i < 8); ( ++i )) {
- c.xy += poisson[ i ];
- }
- return c;
-}
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( );
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-inES3.txt
deleted file mode 100644
index a8339b2175c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-inES3.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-#version 300 es
-mediump vec4 xlat_main( ) {
- highp vec2 poisson[8];
- poisson[0] = vec2( 0.000000, 0.000000);
- poisson[1] = vec2( 0.527837, -0.0858680);
- poisson[2] = vec2( -0.0400880, 0.536087);
- poisson[3] = vec2( -0.670445, -0.179949);
- poisson[4] = vec2( -0.419418, -0.616039);
- poisson[5] = vec2( 0.440453, -0.639399);
- poisson[6] = vec2( -0.757088, 0.349334);
- poisson[7] = vec2( 0.574619, 0.685879);
- mediump vec4 c;
- highp int i = 0;
- c = vec4( 0.000000);
- for ( ; (i < 8); ( ++i )) {
- c.xy += poisson[ i ];
- }
- return c;
-}
-out lowp vec4 _fragData;
-void main() {
- mediump vec4 xl_retval = xlat_main();
- _fragData = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt
deleted file mode 100644
index a51639ceae4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-out.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-void main ()
-{
- vec4 c_1;
- c_1.zw = vec2(0.0, 0.0);
- c_1.xy = vec2(-0.3441301, 0.05004501);
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt
deleted file mode 100644
index 5e8532a9fd5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-void main ()
-{
- mediump vec4 c_1;
- c_1.zw = vec2(0.0, 0.0);
- c_1.xy = vec2(-0.3441301, 0.05004501);
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt
deleted file mode 100644
index 8c78396282f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-void main ()
-{
- mediump vec4 c_1;
- c_1.zw = vec2(0.0, 0.0);
- c_1.xy = vec2(-0.3441301, 0.05004501);
- _fragData = c_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt
deleted file mode 100644
index 6c3681aebe9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-const-outES3Metal.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- c_1.zw = half2(float2(0.0, 0.0));
- c_1.xy = half2(float2(-0.3441301, 0.05004501));
- _mtl_o._fragData = c_1;
- return _mtl_o;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-in.txt
deleted file mode 100644
index 56dccb65be3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-in.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-vec4 xlat_main( );
-vec4 xlat_main( ) {
- vec2 poisson[8];
- poisson[0] = vec2( 0.000000, 0.000000);
- poisson[1] = vec2( 0.527837, -0.0858680);
- poisson[2] = vec2( -0.0400880, 0.536087);
- poisson[3] = vec2( -0.670445, -0.179949);
- poisson[4] = vec2( -0.419418, -0.616039);
- poisson[5] = vec2( 0.440453, -0.639399);
- poisson[6] = vec2( -0.757088, 0.349334);
- poisson[7] = vec2( 0.574619, 0.685879);
- vec4 c;
- int i = 0;
- c = vec4( 0.000000);
- for ( ; (i < 8); ( ++i )) {
- c.xy += poisson[ i ];
- }
- return c;
-}
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( );
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES.txt
deleted file mode 100644
index 92a41e6a19a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-mediump vec4 xlat_main( );
-mediump vec4 xlat_main( ) {
- highp vec2 poisson[8];
- poisson[0] = vec2( 0.000000, 0.000000);
- poisson[1] = vec2( 0.527837, -0.0858680);
- poisson[2] = vec2( -0.0400880, 0.536087);
- poisson[3] = vec2( -0.670445, -0.179949);
- poisson[4] = vec2( -0.419418, -0.616039);
- poisson[5] = vec2( 0.440453, -0.639399);
- poisson[6] = vec2( -0.757088, 0.349334);
- poisson[7] = vec2( 0.574619, 0.685879);
- mediump vec4 c;
- highp int i = 0;
- c = vec4( 0.000000);
- for ( ; (i < 8); ( ++i )) {
- c.xy += poisson[ i ];
- }
- return c;
-}
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( );
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES3.txt
deleted file mode 100644
index a9aa31b489d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-inES3.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-mediump vec4 xlat_main( );
-mediump vec4 xlat_main( ) {
- highp vec2 poisson[8];
- poisson[0] = vec2( 0.000000, 0.000000);
- poisson[1] = vec2( 0.527837, -0.0858680);
- poisson[2] = vec2( -0.0400880, 0.536087);
- poisson[3] = vec2( -0.670445, -0.179949);
- poisson[4] = vec2( -0.419418, -0.616039);
- poisson[5] = vec2( 0.440453, -0.639399);
- poisson[6] = vec2( -0.757088, 0.349334);
- poisson[7] = vec2( 0.574619, 0.685879);
- mediump vec4 c;
- highp int i = 0;
- c = vec4( 0.000000);
- for ( ; (i < 8); ( ++i )) {
- c.xy += poisson[ i ];
- }
- return c;
-}
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( );
- _fragData = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt
deleted file mode 100644
index a51639ceae4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-out.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-void main ()
-{
- vec4 c_1;
- c_1.zw = vec2(0.0, 0.0);
- c_1.xy = vec2(-0.3441301, 0.05004501);
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt
deleted file mode 100644
index 5e8532a9fd5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-void main ()
-{
- mediump vec4 c_1;
- c_1.zw = vec2(0.0, 0.0);
- c_1.xy = vec2(-0.3441301, 0.05004501);
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt
deleted file mode 100644
index 4da5457043b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-void main ()
-{
- mediump vec4 c_1;
- c_1.zw = vec2(0.0, 0.0);
- c_1.xy = vec2(-0.3441301, 0.05004501);
- _fragData = c_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt
deleted file mode 100644
index 6c3681aebe9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/array-constconst-outES3Metal.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- c_1.zw = half2(float2(0.0, 0.0));
- c_1.xy = half2(float2(-0.3441301, 0.05004501));
- _mtl_o._fragData = c_1;
- return _mtl_o;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-in.txt
deleted file mode 100644
index 42ca76a672f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-in.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-void main() {
- if (gl_FragCoord.x==1.0)
- discard;
- float a;
- if (2==3)
- a = 2.0;
- if (3==4)
- a = 3.0;
- else
- a = 4.0;
- for (int i = 0; i < 10; ++i)
- a += 1.0;
- do {
- a += 2.0;
- } while (0==1);
- a += 1.0;
- a *= a;
- a = -a;
- --a;
- a = sqrt(a);
- a = 1.0 / a;
- gl_FragColor = vec4(a);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-inES3.txt
deleted file mode 100644
index 20d08a8e16c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-inES3.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-void main()
-{
- if (gl_FragCoord.x==1.0)
- discard;
- float a;
- if (2==3)
- a = 2.0;
- if (3==4)
- a = 3.0;
- else
- a = 4.0;
- for (int i = 0; i < 10; ++i)
- a += 1.0;
- do {
- a += 2.0;
- } while (0==1);
- a += 1.0;
- a *= a;
- a = -a;
- --a;
- a = sqrt(a);
- a = 1.0 / a;
- _fragData = vec4(a);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt
deleted file mode 100644
index 90a8b9fa394..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-out.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-void main ()
-{
- float a_2;
- if ((gl_FragCoord.x == 1.0)) {
- discard;
- };
- a_2 = 4.0;
- for (int i_1 = 0; i_1 < 10; i_1++) {
- a_2 += 1.0;
- };
- while (true) {
- a_2 += 2.0;
- break;
- };
- a_2 += 1.0;
- a_2 = (a_2 * a_2);
- a_2 = -(a_2);
- a_2 = (a_2 - 1.0);
- a_2 = inversesqrt(a_2);
- gl_FragColor = vec4(a_2);
-}
-
-
-// stats: 12 alu 1 tex 4 flow
-// inputs: 1
-// #0: gl_FragCoord (high float) 4x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt
deleted file mode 100644
index da1b7ee4b1b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-void main ()
-{
- highp float a_2;
- if ((gl_FragCoord.x == 1.0)) {
- discard;
- };
- a_2 = 4.0;
- for (highp int i_1 = 0; i_1 < 10; i_1++) {
- a_2 += 1.0;
- };
- while (true) {
- a_2 += 2.0;
- break;
- };
- a_2 += 1.0;
- a_2 = (a_2 * a_2);
- a_2 = -(a_2);
- a_2 = (a_2 - 1.0);
- a_2 = inversesqrt(a_2);
- _fragData = vec4(a_2);
-}
-
-
-// stats: 12 alu 1 tex 4 flow
-// inputs: 1
-// #0: gl_FragCoord (high float) 4x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt
deleted file mode 100644
index d2dd3471a20..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ast-outES3Metal.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 gl_FragCoord [[position]];
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float a_2 = 0;
- if ((_mtl_i.gl_FragCoord.x == 1.0)) {
- discard_fragment();
- };
- a_2 = 4.0;
- for (int i_1 = 0; i_1 < 10; i_1++) {
- a_2 += 1.0;
- };
- while (true) {
- a_2 += 2.0;
- break;
- };
- a_2 += 1.0;
- a_2 = (a_2 * a_2);
- a_2 = -(a_2);
- a_2 = (a_2 - 1.0);
- a_2 = rsqrt(a_2);
- _mtl_o._fragData = half4(float4(a_2));
- return _mtl_o;
-}
-
-
-// stats: 12 alu 1 tex 4 flow
-// inputs: 1
-// #0: gl_FragCoord (high float) 4x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-in.txt
deleted file mode 100644
index 61ea66d7813..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-in.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-vec4 xlat_main() {
- return vec4(1.0, 1e7, 1e-6, 1.5);
-}
-void main() {
- vec4 x = xlat_main();
- gl_FragData[0] = x;
- gl_FragData[1] = vec4(1.0/0.0, -1.0/0.0, 0.0/0.0, -0.0/0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-inES.txt
deleted file mode 100644
index dc2a65a802b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-inES.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-mediump vec4 xlat_main( );
-mediump vec4 xlat_main( ) {
- return vec4( 1.00000);
-}
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( );
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-out.txt
deleted file mode 100644
index 666f8b270f4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-out.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-void main ()
-{
- gl_FragData[0] = vec4(1.0, 1e+07, 1e-06, 1.5);
- gl_FragData[1] = vec4((1.0/0.0), (-1.0/0.0), (0.0/0.0), (0.0/0.0));
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-outES.txt
deleted file mode 100644
index 3c287668c3f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/basic-outES.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main ()
-{
- gl_FragData[0] = vec4(1.0, 1.0, 1.0, 1.0);
-}
-
-
-// stats: 1 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-inES3.txt
deleted file mode 100644
index 8581859c848..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-inES3.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-#version 300 es
-#extension GL_EXT_shader_framebuffer_fetch : require
-
-// had a bug where if shader framebuffer fetch extension is enabled,
-// but not actually used, then translated shader would end up
-// being empty, since all writes to gl_FragData were wrongly removed.
-
-#define gl_FragData _glesFragData
-layout(location = 0) inout mediump vec4 _glesFragData[4];
-
-in highp vec2 inUV;
-void main() {
- gl_FragData[0] = vec4(inUV.x);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-outES3.txt
deleted file mode 100644
index 7346cff6aab..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-outES3.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-#version 300 es
-#extension GL_EXT_shader_framebuffer_fetch : enable
-layout(location=0) inout mediump vec4 _glesFragData[4];
-in highp vec2 inUV;
-void main ()
-{
- highp vec4 tmpvar_1;
- tmpvar_1 = inUV.xxxx;
- _glesFragData[0] = tmpvar_1;
-}
-
-
-// stats: 0 alu 0 tex 0 flow
-// inputs: 1
-// #0: inUV (high float) 2x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-outES3Metal.txt
deleted file mode 100644
index 8d0d17b6e38..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-bad-framebufferfetch-metal-translation-outES3Metal.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float2 inUV;
- half4 _glesFragData_0 [[color(0)]];
-};
-struct xlatMtlShaderOutput {
- half4 _glesFragData_0 [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float4 tmpvar_1 = 0;
- tmpvar_1 = _mtl_i.inUV.xxxx;
- _mtl_o._glesFragData_0 = half4(tmpvar_1);
- return _mtl_o;
-}
-
-
-// stats: 0 alu 0 tex 0 flow
-// inputs: 1
-// #0: inUV (high float) 2x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-in.txt
deleted file mode 100644
index ad4d9acaf8e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-in.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-// Used to expose bugs in constant variable optimization,
-// when variables were deemed constant not taking into
-// account branches or previous dereferences of them.
-
-uniform float mode;
-float func (float c) {
- if (mode == 2.0)
- return c;
- if (mode == 3.0)
- discard;
- if (mode == 10.0)
- c = 0.1;
- return c;
-}
-void main() {
- vec4 c = gl_FragCoord;
- c.x = func(c.x);
- gl_FragColor = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-out.txt
deleted file mode 100644
index 23c6e2c1928..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-const-variable-out.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-uniform float mode;
-void main ()
-{
- vec4 c_1;
- c_1 = gl_FragCoord;
- float c_2;
- c_2 = gl_FragCoord.x;
- float tmpvar_3;
- if ((mode == 2.0)) {
- tmpvar_3 = c_2;
- } else {
- if ((mode == 3.0)) {
- discard;
- };
- if ((mode == 10.0)) {
- c_2 = 0.1;
- };
- tmpvar_3 = c_2;
- };
- c_1.x = tmpvar_3;
- gl_FragColor = c_1;
-}
-
-
-// stats: 4 alu 1 tex 3 flow
-// inputs: 1
-// #0: gl_FragCoord (high float) 4x1 [-1] loc 0
-// uniforms: 1 (total size: 0)
-// #0: mode (high float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-in.txt
deleted file mode 100644
index 010d4ee2903..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-in.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-uniform float value;
-float otherValue = log(value);
-void main()
-{
- gl_FragColor = vec4(otherValue);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-out.txt
deleted file mode 100644
index 7046de03443..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-global-init-out.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-uniform float value;
-void main ()
-{
- gl_FragColor = vec4(log(value));
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// uniforms: 1 (total size: 0)
-// #0: value (high float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-in.txt
deleted file mode 100644
index 48e218b263b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-in.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-float foo (float v)
-{
- float a, b;
- a = v;
- {
- float a;
- a = sin(v);
- b = a;
- }
- a += b;
- return a;
-}
-
-varying float vv;
-
-void main()
-{
- gl_FragColor = vec4(foo(vv));
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-out.txt
deleted file mode 100644
index 6863b900e2f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-inline-names-out.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-varying float vv;
-void main ()
-{
- gl_FragColor = vec4((vv + sin(vv)));
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 1
-// #0: vv (high float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-in.txt
deleted file mode 100644
index 3a38c8a78a8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-in.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-void main() {
- float a = 0.0;
- int k = 0;
- for (int i = 0; i < 3; ++i)
- a += 1.0;
- for ( ; k < 3; ++k)
- a += 3.0;
- gl_FragColor = vec4(a);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-out.txt
deleted file mode 100644
index 30d22fda5f3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-null-from-out.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main ()
-{
- gl_FragColor = vec4(12.0, 12.0, 12.0, 12.0);
-}
-
-
-// stats: 1 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-in.txt
deleted file mode 100644
index 867ee306f26..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-in.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-// https://github.com/aras-p/glsl-optimizer/issues/49
-
-uniform int loopNum;
-
-void main() {
- int myIdx;
- vec4 r = vec4(0.0);
- myIdx = 1;
- for ( ; myIdx < loopNum; ++myIdx) {
- r.x += 1.0;
- r.y += 2.0;
- r.z += 3.0;
- }
- myIdx = 2;
- for ( ; myIdx < loopNum; ++myIdx) {
- r.x += 1.0;
- r.y += 2.0;
- r.z += 3.0;
- }
- gl_FragColor = r;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt
deleted file mode 100644
index bc1b63be667..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-share-index-out.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-uniform int loopNum;
-void main ()
-{
- vec4 r_1;
- int myIdx_2;
- r_1 = vec4(0.0, 0.0, 0.0, 0.0);
- myIdx_2 = 1;
- while (true) {
- if ((myIdx_2 >= loopNum)) {
- break;
- };
- r_1.x = (r_1.x + 1.0);
- r_1.y = (r_1.y + 2.0);
- r_1.z = (r_1.z + 3.0);
- myIdx_2++;
- };
- myIdx_2 = 2;
- while (true) {
- if ((myIdx_2 >= loopNum)) {
- break;
- };
- r_1.x = (r_1.x + 1.0);
- r_1.y = (r_1.y + 2.0);
- r_1.z = (r_1.z + 3.0);
- myIdx_2++;
- };
- gl_FragColor = r_1;
-}
-
-
-// stats: 13 alu 0 tex 4 flow
-// uniforms: 1 (total size: 0)
-// #0: loopNum (high int) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-inES3.txt
deleted file mode 100644
index d16d86bb193..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-inES3.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-#version 300 es
-
-// from case 685794 at Unity; a particular form of a loop
-// started to generate invalid shaders around Unity 4.6.3.
-
-out mediump vec4 _fragData;
-
-
-struct v2f_surf {
- mediump vec2 uv;
- highp vec4 pos;
-};
-uniform sampler2D _MainTex;
-uniform mediump float _NumPasses;
-uniform mediump vec4 _ContrastShift;
-uniform mediump vec4 _SaturationShift;
-uniform lowp vec4 _HueShift;
-uniform lowp vec4 _LuminosityShift;
-
-lowp vec3 TestCycle2( in lowp vec3 res, in mediump float val )
-{
- return ((res - 0.5) * pow( (cos(val) + 1.0), val));
-}
-
-lowp vec3 TestCycle( in lowp vec3 rgb, in mediump float passes )
-{
- lowp vec3 res = rgb;
- // a weird form of loop that was causing a bug
- highp float i = 0.0;
- for ( ; (i < 4.0); i += 1.0) {
-
- if ((i == passes)){
- break;
- }
- if ((i == 0.0)){
- res = TestCycle2( res, ((_ContrastShift.x * 3.0) + 12.0));
- }
- else{
- if ((i == 1.0)){
- res = TestCycle2( res, ((_SaturationShift.y * 3.0) + 12.0));
- }
- else{
- if ((i == 2.0)){
- res = TestCycle2( res, ((_HueShift.z * 3.0) + 12.0));
- }
- else{
- res = TestCycle2( res, ((_LuminosityShift.x * 3.0) + 12.0));
- }
- }
- }
- }
-
- return res;
-}
-
-lowp vec3 surf( in mediump vec2 uv )
-{
- lowp vec4 t = texture(_MainTex, uv);
- if (_NumPasses > 0.0)
- t.xyz = TestCycle(t.xyz, _NumPasses);
- return t.xyz;
-}
-
-lowp vec4 frag_surf( in v2f_surf IN )
-{
- lowp vec3 col = surf( IN.uv);
- return vec4( col, 1.0);
-}
-in mediump vec2 xlv_TEXCOORD0;
-void main() {
- lowp vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.uv = vec2(xlv_TEXCOORD0);
- xlt_IN.pos = vec4(0.0);
- xl_retval = frag_surf(xlt_IN);
- _fragData = vec4(xl_retval);
-}
-
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3.txt
deleted file mode 100644
index 8e19a5f01da..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3.txt
+++ /dev/null
@@ -1,88 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-uniform sampler2D _MainTex;
-uniform mediump float _NumPasses;
-uniform mediump vec4 _ContrastShift;
-uniform mediump vec4 _SaturationShift;
-uniform lowp vec4 _HueShift;
-uniform lowp vec4 _LuminosityShift;
-in mediump vec2 xlv_TEXCOORD0;
-void main ()
-{
- lowp vec4 t_1;
- lowp vec4 tmpvar_2;
- tmpvar_2 = texture (_MainTex, xlv_TEXCOORD0);
- t_1 = tmpvar_2;
- if ((_NumPasses > 0.0)) {
- mediump float passes_3;
- passes_3 = _NumPasses;
- highp float i_4;
- lowp vec3 res_5;
- res_5 = tmpvar_2.xyz;
- i_4 = 0.0;
- while (true) {
- if ((i_4 >= 4.0)) {
- break;
- };
- if ((i_4 == passes_3)) {
- break;
- };
- if ((i_4 == 0.0)) {
- lowp vec3 tmpvar_6;
- mediump float val_7;
- val_7 = ((_ContrastShift.x * 3.0) + 12.0);
- mediump float tmpvar_8;
- tmpvar_8 = pow ((cos(val_7) + 1.0), val_7);
- tmpvar_6 = ((res_5 - 0.5) * tmpvar_8);
- res_5 = tmpvar_6;
- } else {
- if ((i_4 == 1.0)) {
- lowp vec3 tmpvar_9;
- mediump float val_10;
- val_10 = ((_SaturationShift.y * 3.0) + 12.0);
- mediump float tmpvar_11;
- tmpvar_11 = pow ((cos(val_10) + 1.0), val_10);
- tmpvar_9 = ((res_5 - 0.5) * tmpvar_11);
- res_5 = tmpvar_9;
- } else {
- if ((i_4 == 2.0)) {
- lowp vec3 tmpvar_12;
- mediump float val_13;
- val_13 = ((_HueShift.z * 3.0) + 12.0);
- mediump float tmpvar_14;
- tmpvar_14 = pow ((cos(val_13) + 1.0), val_13);
- tmpvar_12 = ((res_5 - 0.5) * tmpvar_14);
- res_5 = tmpvar_12;
- } else {
- lowp vec3 tmpvar_15;
- mediump float val_16;
- val_16 = ((_LuminosityShift.x * 3.0) + 12.0);
- mediump float tmpvar_17;
- tmpvar_17 = pow ((cos(val_16) + 1.0), val_16);
- tmpvar_15 = ((res_5 - 0.5) * tmpvar_17);
- res_5 = tmpvar_15;
- };
- };
- };
- i_4 += 1.0;
- };
- t_1.xyz = res_5;
- };
- lowp vec4 tmpvar_18;
- tmpvar_18.w = 1.0;
- tmpvar_18.xyz = t_1.xyz;
- _fragData = tmpvar_18;
-}
-
-
-// stats: 37 alu 1 tex 7 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
-// uniforms: 5 (total size: 0)
-// #0: _NumPasses (medium float) 1x1 [-1]
-// #1: _ContrastShift (medium float) 4x1 [-1]
-// #2: _SaturationShift (medium float) 4x1 [-1]
-// #3: _HueShift (low float) 4x1 [-1]
-// #4: _LuminosityShift (low float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3Metal.txt
deleted file mode 100644
index cdaf06ad014..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-loop-undeclaredinductor-outES3Metal.txt
+++ /dev/null
@@ -1,98 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- half2 xlv_TEXCOORD0;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- half _NumPasses;
- half4 _ContrastShift;
- half4 _SaturationShift;
- half4 _HueShift;
- half4 _LuminosityShift;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 t_1 = 0;
- half4 tmpvar_2 = 0;
- tmpvar_2 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
- t_1 = tmpvar_2;
- if ((_mtl_u._NumPasses > (half)(0.0))) {
- half passes_3 = 0;
- passes_3 = _mtl_u._NumPasses;
- float i_4 = 0;
- half3 res_5 = 0;
- res_5 = tmpvar_2.xyz;
- i_4 = 0.0;
- while (true) {
- if ((i_4 >= 4.0)) {
- break;
- };
- if ((i_4 == (float)(passes_3))) {
- break;
- };
- if ((i_4 == 0.0)) {
- half3 tmpvar_6 = 0;
- half val_7 = 0;
- val_7 = ((_mtl_u._ContrastShift.x * (half)(3.0)) + (half)(12.0));
- half tmpvar_8 = 0;
- tmpvar_8 = pow ((cos(val_7) + (half)(1.0)), val_7);
- tmpvar_6 = ((res_5 - (half)(0.5)) * tmpvar_8);
- res_5 = tmpvar_6;
- } else {
- if ((i_4 == 1.0)) {
- half3 tmpvar_9 = 0;
- half val_10 = 0;
- val_10 = ((_mtl_u._SaturationShift.y * (half)(3.0)) + (half)(12.0));
- half tmpvar_11 = 0;
- tmpvar_11 = pow ((cos(val_10) + (half)(1.0)), val_10);
- tmpvar_9 = ((res_5 - (half)(0.5)) * tmpvar_11);
- res_5 = tmpvar_9;
- } else {
- if ((i_4 == 2.0)) {
- half3 tmpvar_12 = 0;
- half val_13 = 0;
- val_13 = ((_mtl_u._HueShift.z * (half)(3.0)) + (half)(12.0));
- half tmpvar_14 = 0;
- tmpvar_14 = pow ((cos(val_13) + (half)(1.0)), val_13);
- tmpvar_12 = ((res_5 - (half)(0.5)) * tmpvar_14);
- res_5 = tmpvar_12;
- } else {
- half3 tmpvar_15 = 0;
- half val_16 = 0;
- val_16 = ((_mtl_u._LuminosityShift.x * (half)(3.0)) + (half)(12.0));
- half tmpvar_17 = 0;
- tmpvar_17 = pow ((cos(val_16) + (half)(1.0)), val_16);
- tmpvar_15 = ((res_5 - (half)(0.5)) * tmpvar_17);
- res_5 = tmpvar_15;
- };
- };
- };
- i_4 += 1.0;
- };
- t_1.xyz = res_5;
- };
- half4 tmpvar_18 = 0;
- tmpvar_18.w = half(1.0);
- tmpvar_18.xyz = t_1.xyz;
- _mtl_o._fragData = tmpvar_18;
- return _mtl_o;
-}
-
-
-// stats: 37 alu 1 tex 7 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
-// uniforms: 5 (total size: 40)
-// #0: _NumPasses (medium float) 1x1 [-1] loc 0
-// #1: _ContrastShift (medium float) 4x1 [-1] loc 8
-// #2: _SaturationShift (medium float) 4x1 [-1] loc 16
-// #3: _HueShift (low float) 4x1 [-1] loc 24
-// #4: _LuminosityShift (low float) 4x1 [-1] loc 32
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-in.txt
deleted file mode 100644
index 390b2907b25..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-in.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-uniform float value;
-uniform float otherValue;
-void main()
-{
- float invValue = 1.0 / value;
- float result = otherValue / invValue;
- gl_FragColor = vec4(result);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-out.txt
deleted file mode 100644
index b33dc1761b1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-op-parens-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-uniform float value;
-uniform float otherValue;
-void main ()
-{
- gl_FragColor = vec4((otherValue / (1.0/(value))));
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// uniforms: 2 (total size: 0)
-// #0: value (high float) 1x1 [-1]
-// #1: otherValue (high float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-inES3.txt
deleted file mode 100644
index 97eb0711264..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-inES3.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-#version 300 es
-
-// There was a bug where due to xll_tex2Dlod sampling of a _CameraDepthTexture (that is a highp sampler)
-// was producing a missing cast between half4 and float4 on Metal output.
-// Shader is a minimal part of Unity's camera motion blur shader that exposes the bug
-
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { return textureLod(s, coord.xy, coord.w); }
-uniform highp sampler2D _CameraDepthTexture;
-in highp vec2 varUV;
-out mediump vec4 _fragData;
-void main()
-{
- highp float z = xll_tex2Dlod(_CameraDepthTexture, vec4(varUV, 0.0, 0.0)).x;
- _fragData = vec4(z);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3.txt
deleted file mode 100644
index 836ee2a6cbd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-#version 300 es
-uniform highp sampler2D _CameraDepthTexture;
-in highp vec2 varUV;
-out mediump vec4 _fragData;
-void main ()
-{
- highp vec4 tmpvar_1;
- tmpvar_1 = textureLod (_CameraDepthTexture, varUV, 0.0).xxxx;
- _fragData = tmpvar_1;
-}
-
-
-// stats: 0 alu 1 tex 0 flow
-// inputs: 1
-// #0: varUV (high float) 2x1 [-1]
-// textures: 1
-// #0: _CameraDepthTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3Metal.txt
deleted file mode 100644
index 015ffb28841..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highp-outES3Metal.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float2 varUV;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<float> _CameraDepthTexture [[texture(0)]], sampler _mtlsmp__CameraDepthTexture [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float4 tmpvar_1 = 0;
- tmpvar_1 = _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(_mtl_i.varUV), level(0.0)).xxxx;
- _mtl_o._fragData = half4(tmpvar_1);
- return _mtl_o;
-}
-
-
-// stats: 0 alu 1 tex 0 flow
-// inputs: 1
-// #0: varUV (high float) 2x1 [-1]
-// textures: 1
-// #0: _CameraDepthTexture (high 2d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-inES3.txt
deleted file mode 100644
index 07579cf9242..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-inES3.txt
+++ /dev/null
@@ -1,118 +0,0 @@
-#version 300 es
-
-// There was a bug where due to xll_tex2Dlod sampling of a _CameraDepthTexture (that is a highp sampler)
-// was producing a missing cast between half4 and float4 on Metal output.
-// Shader is part of Unity's camera motion blur shader.
-
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) { return textureLod( s, coord.xy, coord.w); }
-struct v2f {
- highp vec4 pos;
- highp vec2 uv;
-};
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp vec4 _ProjectionParams;
-uniform highp vec4 _ScreenParams;
-uniform highp vec4 _ZBufferParams;
-uniform highp vec4 _WorldSpaceLightPos0;
-uniform highp mat4 _Object2World;
-uniform highp mat4 _World2Object;
-uniform highp float _MaxRadiusOrKInPaper;
-const highp int SmallDiscKernelSamples = 12;
-const highp vec2[12] SmallDiscKernel = vec2[12]( vec2( -0.326212, -0.40581), vec2( -0.840144, -0.07358), vec2( -0.695914, 0.457137), vec2( -0.203345, 0.620716), vec2( 0.96234, -0.194983), vec2( 0.473434, -0.480026), vec2( 0.519456, 0.767022), vec2( 0.185461, -0.893124), vec2( 0.507431, 0.064425), vec2( 0.89642, 0.412458), vec2( -0.32194, -0.932615), vec2( -0.791559, -0.59771));
-uniform sampler2D _MainTex;
-uniform highp sampler2D _CameraDepthTexture;
-uniform sampler2D _VelTex;
-uniform sampler2D _NeighbourMaxTex;
-uniform sampler2D _NoiseTex;
-uniform sampler2D _TileTexDebug;
-uniform highp vec4 _MainTex_TexelSize;
-uniform highp vec4 _CameraDepthTexture_TexelSize;
-uniform highp vec4 _VelTex_TexelSize;
-uniform highp mat4 _InvViewProj;
-uniform highp mat4 _PrevViewProj;
-uniform highp mat4 _ToPrevViewProjCombined;
-uniform highp float _Jitter;
-uniform highp float _VelocityScale;
-uniform highp float _DisplayVelocityScale;
-uniform highp float _MaxVelocity;
-uniform highp float _MinVelocity;
-uniform highp vec4 _BlurDirectionPacked;
-uniform highp float _SoftZDistance;
-highp float Linear01Depth( in highp float z )
-{
- return (1.0 / ((_ZBufferParams.x * z) + _ZBufferParams.y));
-}
-highp float cone( in highp vec2 px, in highp vec2 py, in highp vec2 v )
-{
- return clamp( (1.0 - (length((px - py)) / length(v))), 0.0, 1.0);
-}
-highp float cylinder( in highp vec2 x, in highp vec2 y, in highp vec2 v )
-{
- highp float lv = length(v);
- return (1.0 - smoothstep( (0.95 * lv), (1.05 * lv), length((x - y))));
-}
-highp float softDepthCompare( in highp float za, in highp float zb )
-{
- return clamp( (1.0 - ((za - zb) / _SoftZDistance)), 0.0, 1.0);
-}
-highp vec4 ReconstructionDiscBlur( in v2f i )
-{
- highp vec2 xf = i.uv;
- highp vec2 x = i.uv;
-
- if ((_MainTex_TexelSize.y < 0.0))
- {
- xf.y = (1.0 - xf.y);
- }
-
- highp vec2 x2 = xf;
- highp vec2 vn = xll_tex2Dlod(_NeighbourMaxTex, vec4(x2, 0.0, 0.0)).xy;
- highp vec4 cx = xll_tex2Dlod(_MainTex, vec4(x, 0.0, 0.0));
-
- highp vec2 vx = xll_tex2Dlod(_VelTex, vec4(xf, 0.0, 0.0)).xy;
- highp vec4 noise = ((xll_tex2Dlod( _NoiseTex, (vec4(i.uv, 0.0, 0.0) * 11.0)) * 2.0) - 1.0);
- highp float zx = xll_tex2Dlod(_CameraDepthTexture, vec4(x, 0.0, 0.0)).x;
-
- zx = (-Linear01Depth( zx));
- noise *= (_MainTex_TexelSize.xyxy * _Jitter);
-
- highp float weight = 1.0;
- highp vec4 sum = (cx * weight);
- highp vec4 jitteredDir = (vn.xyxy + noise.xyyz);
-
- jitteredDir = ((max( abs(jitteredDir.xyxy), ((_MainTex_TexelSize.xyxy * _MaxVelocity) * 0.15)) * sign(jitteredDir.xyxy)) * vec4( 1.0, 1.0, -1.0, -1.0));
- highp int l = 0;
- for ( ; (l < 12); (l++)) {
-
- highp vec4 y = (i.uv.xyxy + ((jitteredDir.xyxy * SmallDiscKernel[l].xyxy) * vec4( 1.0, 1.0, -1.0, -1.0)));
- highp vec4 yf = y;
-
- if ((_MainTex_TexelSize.y < 0.0)){
- yf.yw = (1.0 - yf.yw);
- }
-
- highp vec2 vy = xll_tex2Dlod( _VelTex, vec4( yf.xy, 0.0, 0.0)).xy;
- highp float zy = xll_tex2Dlod( _CameraDepthTexture, vec4( y.xy, 0.0, 0.0)).x;
- zy = (-Linear01Depth( zy));
-
- highp float f = softDepthCompare( zx, zy);
- highp float b = softDepthCompare( zy, zx);
- highp float alphay = (((b * cone( x, y.xy, vx)) + (f * cone( y.xy, x, vy))) + ((cylinder( y.xy, x, vy) * cylinder( x, y.xy, vx)) * 2.0));
-
- highp vec4 cy = xll_tex2Dlod( _MainTex, vec4( y.xy, 0.0, 0.0));
- sum += (cy * alphay);
- weight += alphay;
- }
-
- return (sum / weight);
-}
-in highp vec2 xlv_TEXCOORD0;
-out mediump vec4 _fragData;
-void main() {
- highp vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2(xlv_TEXCOORD0);
- xl_retval = ReconstructionDiscBlur(xlt_i);
- _fragData = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3.txt
deleted file mode 100644
index 8b29e014c1a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3.txt
+++ /dev/null
@@ -1,161 +0,0 @@
-#version 300 es
-uniform highp vec4 _ZBufferParams;
-uniform sampler2D _MainTex;
-uniform highp sampler2D _CameraDepthTexture;
-uniform sampler2D _VelTex;
-uniform sampler2D _NeighbourMaxTex;
-uniform sampler2D _NoiseTex;
-uniform highp vec4 _MainTex_TexelSize;
-uniform highp float _Jitter;
-uniform highp float _MaxVelocity;
-uniform highp float _SoftZDistance;
-in highp vec2 xlv_TEXCOORD0;
-out mediump vec4 _fragData;
-void main ()
-{
- highp vec2 tmpvar_1;
- tmpvar_1 = xlv_TEXCOORD0;
- highp vec4 jitteredDir_3;
- highp vec4 sum_4;
- highp float weight_5;
- highp float zx_6;
- highp vec2 vx_7;
- highp vec2 x_8;
- highp vec2 xf_9;
- xf_9 = xlv_TEXCOORD0;
- x_8 = xlv_TEXCOORD0;
- if ((_MainTex_TexelSize.y < 0.0)) {
- xf_9.y = (1.0 - xlv_TEXCOORD0.y);
- };
- lowp vec4 tmpvar_10;
- tmpvar_10 = textureLod (_NeighbourMaxTex, xf_9, 0.0);
- highp vec2 tmpvar_11;
- tmpvar_11 = tmpvar_10.xy;
- lowp vec4 tmpvar_12;
- tmpvar_12 = textureLod (_MainTex, xlv_TEXCOORD0, 0.0);
- highp vec4 tmpvar_13;
- tmpvar_13 = tmpvar_12;
- lowp vec4 tmpvar_14;
- tmpvar_14 = textureLod (_VelTex, xf_9, 0.0);
- highp vec2 tmpvar_15;
- tmpvar_15 = tmpvar_14.xy;
- vx_7 = tmpvar_15;
- highp vec4 tmpvar_16;
- tmpvar_16.zw = vec2(0.0, 0.0);
- tmpvar_16.xy = xlv_TEXCOORD0;
- highp vec4 coord_17;
- coord_17 = (tmpvar_16 * 11.0);
- lowp vec4 tmpvar_18;
- tmpvar_18 = textureLod (_NoiseTex, coord_17.xy, coord_17.w);
- highp vec4 tmpvar_19;
- tmpvar_19 = ((tmpvar_18 * 2.0) - 1.0);
- zx_6 = -((1.0/((
- (_ZBufferParams.x * textureLod (_CameraDepthTexture, xlv_TEXCOORD0, 0.0).x)
- + _ZBufferParams.y))));
- weight_5 = 1.0;
- sum_4 = tmpvar_13;
- highp vec4 tmpvar_20;
- tmpvar_20 = (tmpvar_11.xyxy + (tmpvar_19 * (_MainTex_TexelSize.xyxy * _Jitter)).xyyz);
- jitteredDir_3 = ((max (
- abs(tmpvar_20.xyxy)
- ,
- ((_MainTex_TexelSize.xyxy * _MaxVelocity) * 0.15)
- ) * sign(tmpvar_20.xyxy)) * vec4(1.0, 1.0, -1.0, -1.0));
- for (highp int l_2 = 0; l_2 < 12; l_2++) {
- highp float zy_21;
- highp vec4 yf_22;
- highp vec4 tmpvar_23;
- tmpvar_23 = (tmpvar_1.xyxy + ((jitteredDir_3.xyxy * vec2[12](vec2(-0.326212, -0.40581), vec2(-0.840144, -0.07358), vec2(-0.695914, 0.457137), vec2(-0.203345, 0.620716), vec2(0.96234, -0.194983), vec2(0.473434, -0.480026), vec2(0.519456, 0.767022), vec2(0.185461, -0.893124), vec2(0.507431, 0.064425), vec2(0.89642, 0.412458), vec2(-0.32194, -0.932615), vec2(-0.791559, -0.59771))[l_2].xyxy) * vec4(1.0, 1.0, -1.0, -1.0)));
- yf_22 = tmpvar_23;
- if ((_MainTex_TexelSize.y < 0.0)) {
- yf_22.yw = (1.0 - tmpvar_23.yw);
- };
- lowp vec4 tmpvar_24;
- tmpvar_24 = textureLod (_VelTex, yf_22.xy, 0.0);
- highp vec2 tmpvar_25;
- tmpvar_25 = tmpvar_24.xy;
- zy_21 = -((1.0/((
- (_ZBufferParams.x * textureLod (_CameraDepthTexture, tmpvar_23.xy, 0.0).x)
- + _ZBufferParams.y))));
- highp vec2 x_26;
- x_26 = (x_8 - tmpvar_23.xy);
- highp vec2 x_27;
- x_27 = (tmpvar_23.xy - x_8);
- highp float tmpvar_28;
- tmpvar_28 = sqrt(dot (tmpvar_25, tmpvar_25));
- highp vec2 x_29;
- x_29 = (tmpvar_23.xy - x_8);
- highp float edge0_30;
- edge0_30 = (0.95 * tmpvar_28);
- highp float tmpvar_31;
- tmpvar_31 = clamp (((
- sqrt(dot (x_29, x_29))
- - edge0_30) / (
- (1.05 * tmpvar_28)
- - edge0_30)), 0.0, 1.0);
- highp float tmpvar_32;
- tmpvar_32 = sqrt(dot (vx_7, vx_7));
- highp vec2 x_33;
- x_33 = (x_8 - tmpvar_23.xy);
- highp float edge0_34;
- edge0_34 = (0.95 * tmpvar_32);
- highp float tmpvar_35;
- tmpvar_35 = clamp (((
- sqrt(dot (x_33, x_33))
- - edge0_34) / (
- (1.05 * tmpvar_32)
- - edge0_34)), 0.0, 1.0);
- highp float tmpvar_36;
- tmpvar_36 = (((
- clamp ((1.0 - ((zy_21 - zx_6) / _SoftZDistance)), 0.0, 1.0)
- *
- clamp ((1.0 - (sqrt(
- dot (x_26, x_26)
- ) / sqrt(
- dot (vx_7, vx_7)
- ))), 0.0, 1.0)
- ) + (
- clamp ((1.0 - ((zx_6 - zy_21) / _SoftZDistance)), 0.0, 1.0)
- *
- clamp ((1.0 - (sqrt(
- dot (x_27, x_27)
- ) / sqrt(
- dot (tmpvar_25, tmpvar_25)
- ))), 0.0, 1.0)
- )) + ((
- (1.0 - (tmpvar_31 * (tmpvar_31 * (3.0 -
- (2.0 * tmpvar_31)
- ))))
- *
- (1.0 - (tmpvar_35 * (tmpvar_35 * (3.0 -
- (2.0 * tmpvar_35)
- ))))
- ) * 2.0));
- lowp vec4 tmpvar_37;
- tmpvar_37 = textureLod (_MainTex, tmpvar_23.xy, 0.0);
- highp vec4 tmpvar_38;
- tmpvar_38 = tmpvar_37;
- sum_4 = (sum_4 + (tmpvar_38 * tmpvar_36));
- weight_5 = (weight_5 + tmpvar_36);
- };
- highp vec4 tmpvar_39;
- tmpvar_39 = (sum_4 / weight_5);
- _fragData = tmpvar_39;
-}
-
-
-// stats: 99 alu 8 tex 4 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// uniforms: 5 (total size: 0)
-// #0: _ZBufferParams (high float) 4x1 [-1]
-// #1: _MainTex_TexelSize (high float) 4x1 [-1]
-// #2: _Jitter (high float) 1x1 [-1]
-// #3: _MaxVelocity (high float) 1x1 [-1]
-// #4: _SoftZDistance (high float) 1x1 [-1]
-// textures: 5
-// #0: _MainTex (low 2d) 0x0 [-1]
-// #1: _CameraDepthTexture (high 2d) 0x0 [-1]
-// #2: _VelTex (low 2d) 0x0 [-1]
-// #3: _NeighbourMaxTex (low 2d) 0x0 [-1]
-// #4: _NoiseTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3Metal.txt
deleted file mode 100644
index f42f92e6768..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-sampler-highpfull-outES3Metal.txt
+++ /dev/null
@@ -1,172 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-constant float2 _xlat_mtl_const1[12] = {float2(-0.326212, -0.40581), float2(-0.840144, -0.07358), float2(-0.695914, 0.457137), float2(-0.203345, 0.620716), float2(0.96234, -0.194983), float2(0.473434, -0.480026), float2(0.519456, 0.767022), float2(0.185461, -0.893124), float2(0.507431, 0.064425), float2(0.89642, 0.412458), float2(-0.32194, -0.932615), float2(-0.791559, -0.59771)};
-struct xlatMtlShaderInput {
- float2 xlv_TEXCOORD0;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- float4 _ZBufferParams;
- float4 _MainTex_TexelSize;
- float _Jitter;
- float _MaxVelocity;
- float _SoftZDistance;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]]
- , texture2d<float> _CameraDepthTexture [[texture(1)]], sampler _mtlsmp__CameraDepthTexture [[sampler(1)]]
- , texture2d<half> _VelTex [[texture(2)]], sampler _mtlsmp__VelTex [[sampler(2)]]
- , texture2d<half> _NeighbourMaxTex [[texture(3)]], sampler _mtlsmp__NeighbourMaxTex [[sampler(3)]]
- , texture2d<half> _NoiseTex [[texture(4)]], sampler _mtlsmp__NoiseTex [[sampler(4)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float2 tmpvar_1 = 0;
- tmpvar_1 = _mtl_i.xlv_TEXCOORD0;
- float4 jitteredDir_3 = 0;
- float4 sum_4 = 0;
- float weight_5 = 0;
- float zx_6 = 0;
- float2 vx_7 = 0;
- float2 x_8 = 0;
- float2 xf_9 = 0;
- xf_9 = _mtl_i.xlv_TEXCOORD0;
- x_8 = _mtl_i.xlv_TEXCOORD0;
- if ((_mtl_u._MainTex_TexelSize.y < 0.0)) {
- xf_9.y = (1.0 - _mtl_i.xlv_TEXCOORD0.y);
- };
- half4 tmpvar_10 = 0;
- tmpvar_10 = _NeighbourMaxTex.sample(_mtlsmp__NeighbourMaxTex, (float2)(xf_9), level(0.0));
- float2 tmpvar_11 = 0;
- tmpvar_11 = float2(tmpvar_10.xy);
- half4 tmpvar_12 = 0;
- tmpvar_12 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0), level(0.0));
- float4 tmpvar_13 = 0;
- tmpvar_13 = float4(tmpvar_12);
- half4 tmpvar_14 = 0;
- tmpvar_14 = _VelTex.sample(_mtlsmp__VelTex, (float2)(xf_9), level(0.0));
- float2 tmpvar_15 = 0;
- tmpvar_15 = float2(tmpvar_14.xy);
- vx_7 = tmpvar_15;
- float4 tmpvar_16 = 0;
- tmpvar_16.zw = float2(0.0, 0.0);
- tmpvar_16.xy = _mtl_i.xlv_TEXCOORD0;
- float4 coord_17 = 0;
- coord_17 = (tmpvar_16 * 11.0);
- half4 tmpvar_18 = 0;
- tmpvar_18 = _NoiseTex.sample(_mtlsmp__NoiseTex, (float2)(coord_17.xy), level(coord_17.w));
- float4 tmpvar_19 = 0;
- tmpvar_19 = float4(((tmpvar_18 * (half)(2.0)) - (half)(1.0)));
- zx_6 = -((1.0/((
- (_mtl_u._ZBufferParams.x * _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(_mtl_i.xlv_TEXCOORD0), level(0.0)).x)
- + _mtl_u._ZBufferParams.y))));
- weight_5 = 1.0;
- sum_4 = tmpvar_13;
- float4 tmpvar_20 = 0;
- tmpvar_20 = (tmpvar_11.xyxy + (tmpvar_19 * (_mtl_u._MainTex_TexelSize.xyxy * _mtl_u._Jitter)).xyyz);
- jitteredDir_3 = ((max (
- abs(tmpvar_20.xyxy)
- ,
- ((_mtl_u._MainTex_TexelSize.xyxy * _mtl_u._MaxVelocity) * 0.15)
- ) * sign(tmpvar_20.xyxy)) * float4(1.0, 1.0, -1.0, -1.0));
- for (int l_2 = 0; l_2 < 12; l_2++) {
- float zy_21 = 0;
- float4 yf_22 = 0;
- float4 tmpvar_23 = 0;
- tmpvar_23 = (tmpvar_1.xyxy + ((jitteredDir_3.xyxy * _xlat_mtl_const1[l_2].xyxy) * float4(1.0, 1.0, -1.0, -1.0)));
- yf_22 = tmpvar_23;
- if ((_mtl_u._MainTex_TexelSize.y < 0.0)) {
- yf_22.yw = (1.0 - tmpvar_23.yw);
- };
- half4 tmpvar_24 = 0;
- tmpvar_24 = _VelTex.sample(_mtlsmp__VelTex, (float2)(yf_22.xy), level(0.0));
- float2 tmpvar_25 = 0;
- tmpvar_25 = float2(tmpvar_24.xy);
- zy_21 = -((1.0/((
- (_mtl_u._ZBufferParams.x * _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(tmpvar_23.xy), level(0.0)).x)
- + _mtl_u._ZBufferParams.y))));
- float2 x_26 = 0;
- x_26 = (x_8 - tmpvar_23.xy);
- float2 x_27 = 0;
- x_27 = (tmpvar_23.xy - x_8);
- float tmpvar_28 = 0;
- tmpvar_28 = sqrt(dot (tmpvar_25, tmpvar_25));
- float2 x_29 = 0;
- x_29 = (tmpvar_23.xy - x_8);
- float edge0_30 = 0;
- edge0_30 = (0.95 * tmpvar_28);
- float tmpvar_31 = 0;
- tmpvar_31 = clamp (((
- sqrt(dot (x_29, x_29))
- - edge0_30) / (
- (1.05 * tmpvar_28)
- - edge0_30)), 0.0, 1.0);
- float tmpvar_32 = 0;
- tmpvar_32 = sqrt(dot (vx_7, vx_7));
- float2 x_33 = 0;
- x_33 = (x_8 - tmpvar_23.xy);
- float edge0_34 = 0;
- edge0_34 = (0.95 * tmpvar_32);
- float tmpvar_35 = 0;
- tmpvar_35 = clamp (((
- sqrt(dot (x_33, x_33))
- - edge0_34) / (
- (1.05 * tmpvar_32)
- - edge0_34)), 0.0, 1.0);
- float tmpvar_36 = 0;
- tmpvar_36 = (((
- clamp ((1.0 - ((zy_21 - zx_6) / _mtl_u._SoftZDistance)), 0.0, 1.0)
- *
- clamp ((1.0 - (sqrt(
- dot (x_26, x_26)
- ) / sqrt(
- dot (vx_7, vx_7)
- ))), 0.0, 1.0)
- ) + (
- clamp ((1.0 - ((zx_6 - zy_21) / _mtl_u._SoftZDistance)), 0.0, 1.0)
- *
- clamp ((1.0 - (sqrt(
- dot (x_27, x_27)
- ) / sqrt(
- dot (tmpvar_25, tmpvar_25)
- ))), 0.0, 1.0)
- )) + ((
- (1.0 - (tmpvar_31 * (tmpvar_31 * (3.0 -
- (2.0 * tmpvar_31)
- ))))
- *
- (1.0 - (tmpvar_35 * (tmpvar_35 * (3.0 -
- (2.0 * tmpvar_35)
- ))))
- ) * 2.0));
- half4 tmpvar_37 = 0;
- tmpvar_37 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_23.xy), level(0.0));
- float4 tmpvar_38 = 0;
- tmpvar_38 = float4(tmpvar_37);
- sum_4 = (sum_4 + (tmpvar_38 * tmpvar_36));
- weight_5 = (weight_5 + tmpvar_36);
- };
- float4 tmpvar_39 = 0;
- tmpvar_39 = (sum_4 / weight_5);
- _mtl_o._fragData = half4(tmpvar_39);
- return _mtl_o;
-}
-
-
-// stats: 99 alu 8 tex 4 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// uniforms: 5 (total size: 44)
-// #0: _ZBufferParams (high float) 4x1 [-1] loc 0
-// #1: _MainTex_TexelSize (high float) 4x1 [-1] loc 16
-// #2: _Jitter (high float) 1x1 [-1] loc 32
-// #3: _MaxVelocity (high float) 1x1 [-1] loc 36
-// #4: _SoftZDistance (high float) 1x1 [-1] loc 40
-// textures: 5
-// #0: _MainTex (low 2d) 0x0 [-1] loc 0
-// #1: _CameraDepthTexture (high 2d) 0x0 [-1] loc 1
-// #2: _VelTex (low 2d) 0x0 [-1] loc 2
-// #3: _NeighbourMaxTex (low 2d) 0x0 [-1] loc 3
-// #4: _NoiseTex (low 2d) 0x0 [-1] loc 4
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-in.txt
deleted file mode 100644
index 46bf7ca6782..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-in.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-uniform sampler2D _MainTex;
-uniform sampler2D _RampTex;
-varying vec2 varUV;
-void main()
-{
- vec4 orig = texture2D (_MainTex, varUV);
-
- // There was a bug where these three texture
- // samples were "vectorized" in a wrong way, like
- // t.xyz = texture2DProj (_RampTex, t.xyz).xyz;
-
- float rr = texture2D (_RampTex, orig.xx).x;
- float gg = texture2D (_RampTex, orig.yy).y;
- float bb = texture2D (_RampTex, orig.zz).z;
- vec4 color = vec4 (rr, gg, bb, orig.w);
- gl_FragData[0] = color;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-out.txt
deleted file mode 100644
index c3c58fe3d72..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/bug-vectorize-tex-out.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-uniform sampler2D _MainTex;
-uniform sampler2D _RampTex;
-varying vec2 varUV;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = texture2D (_MainTex, varUV);
- vec4 tmpvar_2;
- tmpvar_2.x = texture2D (_RampTex, tmpvar_1.xx).x;
- tmpvar_2.y = texture2D (_RampTex, tmpvar_1.yy).y;
- tmpvar_2.z = texture2D (_RampTex, tmpvar_1.zz).z;
- tmpvar_2.w = tmpvar_1.w;
- gl_FragData[0] = tmpvar_2;
-}
-
-
-// stats: 0 alu 4 tex 0 flow
-// inputs: 1
-// #0: varUV (high float) 2x1 [-1]
-// textures: 2
-// #0: _MainTex (high 2d) 0x0 [-1]
-// #1: _RampTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-inES3.txt
deleted file mode 100644
index 067343da894..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-inES3.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-
-in mediump vec4 uv;
-
-void main()
-{
- mediump vec4 c;
- c = uv;
- c += gl_FragCoord;
- c.x += gl_FrontFacing ? 1.0 : 0.0;
- c.xy += gl_PointCoord;
- _fragData = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3.txt
deleted file mode 100644
index 8529f8d8f67..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-in mediump vec4 uv;
-void main ()
-{
- mediump vec4 c_1;
- c_1 = (uv + gl_FragCoord);
- highp float tmpvar_2;
- if (gl_FrontFacing) {
- tmpvar_2 = 1.0;
- } else {
- tmpvar_2 = 0.0;
- };
- c_1.x = (c_1.x + tmpvar_2);
- c_1.xy = (c_1.xy + gl_PointCoord);
- _fragData = c_1;
-}
-
-
-// stats: 5 alu 0 tex 1 flow
-// inputs: 4
-// #0: gl_PointCoord (medium float) 2x1 [-1] loc 23
-// #1: gl_FrontFacing (low bool) 1x1 [-1] loc 22
-// #2: gl_FragCoord (high float) 4x1 [-1] loc 0
-// #3: uv (medium float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3Metal.txt
deleted file mode 100644
index bd2b7469c21..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/builtin-vars-outES3Metal.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float2 gl_PointCoord [[point_coord]];
- bool gl_FrontFacing [[front_facing]];
- float4 gl_FragCoord [[position]];
- half4 uv;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- c_1 = half4(((float4)(_mtl_i.uv) + _mtl_i.gl_FragCoord));
- float tmpvar_2 = 0;
- if (_mtl_i.gl_FrontFacing) {
- tmpvar_2 = 1.0;
- } else {
- tmpvar_2 = 0.0;
- };
- c_1.x = (c_1.x + (half)(tmpvar_2));
- c_1.xy = half2(((float2)(c_1.xy) + _mtl_i.gl_PointCoord));
- _mtl_o._fragData = c_1;
- return _mtl_o;
-}
-
-
-// stats: 5 alu 0 tex 1 flow
-// inputs: 4
-// #0: gl_PointCoord (high float) 2x1 [-1] loc 23
-// #1: gl_FrontFacing (low bool) 1x1 [-1] loc 22
-// #2: gl_FragCoord (high float) 4x1 [-1] loc 0
-// #3: uv (medium float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-inES3.txt
deleted file mode 100644
index 0063401d18c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-inES3.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-#version 300 es
-#define gl_FragData _glesFragData
-layout(location = 0) out mediump vec4 _glesFragData[1];
-
-struct v2f {
- highp vec4 pos;
- mediump vec2 uv;
-};
-
-struct u2v {
- highp vec4 vertex;
- mediump vec2 texcoord;
-};
-
-const mediump vec3[3] ha = vec3[3]( vec3( 1.0, 2.0, 3.0), vec3( 4.0, 5.0, 6.0), vec3( 7.0, 8.0, 9.0));
-const highp vec3[3] fa = vec3[3]( vec3( 11.0, 12.0, 13.0), vec3( 14.0, 15.0, 16.0), vec3( 17.0, 18.0, 19.0));
-
-mediump vec4 frag( in v2f i ) {
- mediump vec3 h = vec3( 0.0);
- highp vec3 f = vec3( 0.0);
- highp vec3 p = vec3( i.uv.xy, 1.0);
- highp int j = 0;
- for ( ; (j < int((i.uv.x * 3.0))); (j++)) {
- h += ha[j];
- f += fa[j];
- f += (p * ha[0]);
- f += (ha[1] * p);
- }
- return vec4( h.xy, f.xy);
-}
-
-in mediump vec2 xlv_TEXCOORD0;
-void main() {
- mediump vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2(xlv_TEXCOORD0);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4(xl_retval);
-}
-
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-outES3.txt
deleted file mode 100644
index 813962a5b3f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-outES3.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-#version 300 es
-layout(location=0) out mediump vec4 _glesFragData[1];
-in mediump vec2 xlv_TEXCOORD0;
-void main ()
-{
- mediump vec4 tmpvar_1;
- mediump vec2 tmpvar_2;
- tmpvar_2 = xlv_TEXCOORD0;
- highp vec3 p_4;
- highp vec3 f_5;
- mediump vec3 h_6;
- h_6 = vec3(0.0, 0.0, 0.0);
- f_5 = vec3(0.0, 0.0, 0.0);
- mediump vec3 tmpvar_7;
- tmpvar_7.z = 1.0;
- tmpvar_7.xy = xlv_TEXCOORD0;
- p_4 = tmpvar_7;
- for (highp int j_3 = 0; j_3 < int((tmpvar_2.x * 3.0)); j_3++) {
- h_6 = (h_6 + vec3[3](vec3(1.0, 2.0, 3.0), vec3(4.0, 5.0, 6.0), vec3(7.0, 8.0, 9.0))[j_3]);
- f_5 = (f_5 + vec3[3](vec3(11.0, 12.0, 13.0), vec3(14.0, 15.0, 16.0), vec3(17.0, 18.0, 19.0))[j_3]);
- f_5 = (f_5 + (p_4 * vec3(1.0, 2.0, 3.0)));
- f_5 = (f_5 + (vec3(4.0, 5.0, 6.0) * p_4));
- };
- highp vec4 tmpvar_8;
- tmpvar_8.xy = h_6.xy;
- tmpvar_8.zw = f_5.xy;
- tmpvar_1 = tmpvar_8;
- _glesFragData[0] = tmpvar_1;
-}
-
-
-// stats: 14 alu 0 tex 2 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-outES3Metal.txt
deleted file mode 100644
index 29c302b6378..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/const-precision-outES3Metal.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-constant half3 _xlat_mtl_const1[3] = {half3(1.0, 2.0, 3.0), half3(4.0, 5.0, 6.0), half3(7.0, 8.0, 9.0)};
-constant float3 _xlat_mtl_const2[3] = {float3(11.0, 12.0, 13.0), float3(14.0, 15.0, 16.0), float3(17.0, 18.0, 19.0)};
-struct xlatMtlShaderInput {
- half2 xlv_TEXCOORD0;
-};
-struct xlatMtlShaderOutput {
- half4 _glesFragData_0 [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 tmpvar_1 = 0;
- half2 tmpvar_2 = 0;
- tmpvar_2 = _mtl_i.xlv_TEXCOORD0;
- float3 p_4 = 0;
- float3 f_5 = 0;
- half3 h_6 = 0;
- h_6 = half3(float3(0.0, 0.0, 0.0));
- f_5 = float3(0.0, 0.0, 0.0);
- half3 tmpvar_7 = 0;
- tmpvar_7.z = half(1.0);
- tmpvar_7.xy = _mtl_i.xlv_TEXCOORD0;
- p_4 = float3(tmpvar_7);
- for (int j_3 = 0; j_3 < short((tmpvar_2.x * (half)(3.0))); j_3++) {
- h_6 = (h_6 + _xlat_mtl_const1[j_3]);
- f_5 = (f_5 + _xlat_mtl_const2[j_3]);
- f_5 = (f_5 + (p_4 * (float3)(half3(1.0, 2.0, 3.0))));
- f_5 = (f_5 + ((float3)(half3(4.0, 5.0, 6.0)) * p_4));
- };
- float4 tmpvar_8 = 0;
- tmpvar_8.xy = float2(h_6.xy);
- tmpvar_8.zw = f_5.xy;
- tmpvar_1 = half4(tmpvar_8);
- _mtl_o._glesFragData_0 = tmpvar_1;
- return _mtl_o;
-}
-
-
-// stats: 14 alu 0 tex 2 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-in.txt
deleted file mode 100644
index 49fd071d7ff..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-in.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-float xll_dFdx(float f) {
- return dFdx(f);
-}
-vec2 xll_dFdx(vec2 v) {
- return dFdx(v);
-}
-vec3 xll_dFdx(vec3 v) {
- return dFdx(v);
-}
-vec4 xll_dFdx(vec4 v) {
- return dFdx(v);
-}
-mat2 xll_dFdx(mat2 m) {
- return mat2( dFdx(m[0]), dFdx(m[1]));
-}
-mat3 xll_dFdx(mat3 m) {
- return mat3( dFdx(m[0]), dFdx(m[1]), dFdx(m[2]));
-}
-mat4 xll_dFdx(mat4 m) {
- return mat4( dFdx(m[0]), dFdx(m[1]), dFdx(m[2]), dFdx(m[3]));
-}
-float xll_fwidth(float f) {
- return fwidth(f);
-}
-vec2 xll_fwidth(vec2 v) {
- return fwidth(v);
-}
-vec3 xll_fwidth(vec3 v) {
- return fwidth(v);
-}
-vec4 xll_fwidth(vec4 v) {
- return fwidth(v);
-}
-mat2 xll_fwidth(mat2 m) {
- return mat2( fwidth(m[0]), fwidth(m[1]));
-}
-mat3 xll_fwidth(mat3 m) {
- return mat3( fwidth(m[0]), fwidth(m[1]), fwidth(m[2]));
-}
-mat4 xll_fwidth(mat4 m) {
- return mat4( fwidth(m[0]), fwidth(m[1]), fwidth(m[2]), fwidth(m[3]));
-}
-vec4 xlat_main( in vec4 uv );
-#line 1
-vec4 xlat_main( in vec4 uv ) {
- vec4 res;
- #line 3
- res.x = xll_dFdx(uv.x);
- res.y = xll_dFdx(uv.y);
- res.zw = xll_fwidth(uv.xy);
- #line 7
- return res;
-}
-varying vec4 xlv_TEXCOORD0;
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-inES.txt
deleted file mode 100644
index 5f32e46d123..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-inES.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-#extension GL_OES_standard_derivatives : require
-float xll_dFdx(float f) {
- return dFdx(f);
-}
-vec2 xll_dFdx(vec2 v) {
- return dFdx(v);
-}
-vec3 xll_dFdx(vec3 v) {
- return dFdx(v);
-}
-vec4 xll_dFdx(vec4 v) {
- return dFdx(v);
-}
-mat2 xll_dFdx(mat2 m) {
- return mat2( dFdx(m[0]), dFdx(m[1]));
-}
-mat3 xll_dFdx(mat3 m) {
- return mat3( dFdx(m[0]), dFdx(m[1]), dFdx(m[2]));
-}
-mat4 xll_dFdx(mat4 m) {
- return mat4( dFdx(m[0]), dFdx(m[1]), dFdx(m[2]), dFdx(m[3]));
-}
-float xll_fwidth(float f) {
- return fwidth(f);
-}
-vec2 xll_fwidth(vec2 v) {
- return fwidth(v);
-}
-vec3 xll_fwidth(vec3 v) {
- return fwidth(v);
-}
-vec4 xll_fwidth(vec4 v) {
- return fwidth(v);
-}
-mat2 xll_fwidth(mat2 m) {
- return mat2( fwidth(m[0]), fwidth(m[1]));
-}
-mat3 xll_fwidth(mat3 m) {
- return mat3( fwidth(m[0]), fwidth(m[1]), fwidth(m[2]));
-}
-mat4 xll_fwidth(mat4 m) {
- return mat4( fwidth(m[0]), fwidth(m[1]), fwidth(m[2]), fwidth(m[3]));
-}
-mediump vec4 xlat_main( in highp vec4 uv );
-#line 1
-mediump vec4 xlat_main( in highp vec4 uv ) {
- lowp vec4 res;
- #line 3
- res.x = xll_dFdx( uv.x );
- res.y = xll_dFdx( uv.y );
- res.z = xll_fwidth( uv.z );
- res.w = 1.00000;
- #line 7
- return res;
-}
-varying highp vec4 xlv_TEXCOORD0;
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-out.txt
deleted file mode 100644
index 44b439e6a77..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-out.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-varying vec4 xlv_TEXCOORD0;
-void main ()
-{
- vec4 res_1;
- vec2 tmpvar_2;
- tmpvar_2 = dFdx(xlv_TEXCOORD0.xy);
- res_1.xy = tmpvar_2;
- res_1.zw = (abs(tmpvar_2) + abs(dFdy(xlv_TEXCOORD0.xy)));
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 5 alu 0 tex 0 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-outES.txt
deleted file mode 100644
index bdb188f4c6f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/derivatives-outES.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-#extension GL_OES_standard_derivatives : enable
-varying highp vec4 xlv_TEXCOORD0;
-void main ()
-{
- mediump vec4 tmpvar_1;
- lowp vec4 res_2;
- highp float tmpvar_3;
- tmpvar_3 = dFdx(xlv_TEXCOORD0.x);
- res_2.x = tmpvar_3;
- highp float tmpvar_4;
- tmpvar_4 = dFdx(xlv_TEXCOORD0.y);
- res_2.y = tmpvar_4;
- highp float tmpvar_5;
- tmpvar_5 = (abs(dFdx(xlv_TEXCOORD0.z)) + abs(dFdy(xlv_TEXCOORD0.z)));
- res_2.z = tmpvar_5;
- res_2.w = 1.0;
- tmpvar_1 = res_2;
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 8 alu 0 tex 0 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/estest1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/estest1-in.txt
deleted file mode 100644
index 9b13af18945..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/estest1-in.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-struct v2f {
- vec4 pos;
- vec2 uv0;
- vec2 uv1;
-};
-
-uniform vec4 _Color;
-uniform sampler2D _Detail;
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 c;
- c = (_Color * texture2D( _MainTex, i.uv0));
- c = ((c * texture2D( _Detail, i.uv1)) * 2.00000);
- return c;
-}
-varying vec4 xlv_TEXCOORD0;
-varying vec4 xlv_TEXCOORD1;
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.uv0 = vec2( xlv_TEXCOORD0);
- xlt_i.uv1 = vec2( xlv_TEXCOORD1);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/estest1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/estest1-out.txt
deleted file mode 100644
index 534e6348362..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/estest1-out.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _Detail;
-uniform sampler2D _MainTex;
-varying vec4 xlv_TEXCOORD0;
-varying vec4 xlv_TEXCOORD1;
-void main ()
-{
- vec4 c_1;
- c_1 = (_Color * texture2D (_MainTex, xlv_TEXCOORD0.xy));
- c_1 = ((c_1 * texture2D (_Detail, xlv_TEXCOORD1.xy)) * 2.0);
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 3 alu 2 tex 0 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 4x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// textures: 2
-// #0: _Detail (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-in.txt
deleted file mode 100644
index dc621c5386b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-in.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-varying vec2 uv;
-
-void main()
-{
- vec4 c = vec4(0.0);
- float a, b;
-
- a = uv.y * 1.111111e+6;
- b = uv.y * 1.111110e+6;
- c.x = a-b;
-
- a = uv.y * 1.23456789;
- b = uv.y * 1.23456765;
- c.y = a-b;
-
- a = uv.y * -1.234567e-6;
- b = uv.y * -1.234565e-6;
- c.z = a-b;
-
- gl_FragColor = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-out.txt
deleted file mode 100644
index 38c1370a5c3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/float-literals-out.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-varying vec2 uv;
-void main ()
-{
- float b_1;
- float a_2;
- vec4 c_3;
- c_3.w = 0.0;
- a_2 = (uv.y * 1111111.0);
- b_1 = (uv.y * 1111110.0);
- c_3.x = (a_2 - b_1);
- a_2 = (uv.y * 1.234568);
- b_1 = (uv.y * 1.234568);
- c_3.y = (a_2 - b_1);
- a_2 = (uv.y * -1.234567e-06);
- b_1 = (uv.y * -1.234565e-06);
- c_3.z = (a_2 - b_1);
- gl_FragColor = c_3;
-}
-
-
-// stats: 10 alu 0 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 2x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-in.txt
deleted file mode 100644
index 9e84b4ab6fa..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-in.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-void xlat_main( out vec4 ocol, out float oz ) {
- ocol = vec4( 0.5);
- oz = 0.9;
-}
-void main() {
- vec4 xlt_ocol;
- float xlt_oz;
- xlat_main( xlt_ocol, xlt_oz);
- gl_FragData[0] = vec4(xlt_ocol);
- gl_FragDepth = float(xlt_oz);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES.txt
deleted file mode 100644
index 59f355f580b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-#extension GL_EXT_frag_depth : require
-void xlat_main( out lowp vec4 ocol, out mediump float oz ) {
- ocol = vec4( 0.5);
- oz = 0.9;
-}
-void main() {
- lowp vec4 xlt_ocol;
- mediump float xlt_oz;
- xlat_main( xlt_ocol, xlt_oz);
- gl_FragData[0] = vec4(xlt_ocol);
- gl_FragDepthEXT = float(xlt_oz);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES3.txt
deleted file mode 100644
index b4c4f32e299..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-inES3.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-#version 300 es
-void xlat_main( out lowp vec4 ocol, out mediump float oz ) {
- ocol = vec4( 0.5);
- oz = 0.9;
-}
-out lowp vec4 _fragData;
-void main() {
- lowp vec4 xlt_ocol;
- mediump float xlt_oz;
- xlat_main( xlt_ocol, xlt_oz);
- _fragData = vec4(xlt_ocol);
- gl_FragDepth = float(xlt_oz);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-out.txt
deleted file mode 100644
index d8b2c7a853e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-out.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-void main ()
-{
- gl_FragData[0] = vec4(0.5, 0.5, 0.5, 0.5);
- gl_FragDepth = 0.9;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES.txt
deleted file mode 100644
index 39939006eb8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-#extension GL_EXT_frag_depth : enable
-void main ()
-{
- gl_FragData[0] = vec4(0.5, 0.5, 0.5, 0.5);
- gl_FragDepthEXT = 0.9;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3.txt
deleted file mode 100644
index 77e3099d993..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-void main ()
-{
- _fragData = vec4(0.5, 0.5, 0.5, 0.5);
- gl_FragDepth = 0.9;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3Metal.txt
deleted file mode 100644
index b3ab30301ab..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/fragdepth-outES3Metal.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
-};
-struct xlatMtlShaderOutput {
- float gl_FragDepth [[depth(any)]];
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- _mtl_o._fragData = half4(float4(0.5, 0.5, 0.5, 0.5));
- _mtl_o.gl_FragDepth = 0.9;
- return _mtl_o;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES.txt
deleted file mode 100644
index 261a9627a01..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-#extension GL_EXT_shader_framebuffer_fetch : require
-
-struct v2f {
- highp vec4 vertex;
- lowp vec4 color;
-};
-void frag (in v2f i, inout lowp vec4 ocol)
-{
- ocol.xy = i.color.xy;
- ocol.z *= 2.0;
-}
-varying lowp vec4 xlv_TEXCOORD0;
-void main() {
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4(xlv_TEXCOORD0);
- lowp vec4 xlt_ocol = vec4(gl_LastFragData[0]);
- frag (xlt_i, xlt_ocol);
- gl_FragData[0] = vec4(xlt_ocol);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES3.txt
deleted file mode 100644
index a61a8252c79..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-inES3.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-#version 300 es
-#extension GL_EXT_shader_framebuffer_fetch : require
-#define gl_FragColor _glesFragData[0]
-#define gl_FragData _glesFragData
-layout(location = 0) inout mediump vec4 _glesFragData[4];
-
-struct v2f {
- highp vec4 vertex;
- lowp vec4 color;
-};
-void frag (in v2f i, inout lowp vec4 ocol)
-{
- ocol.xy = i.color.xy;
- ocol.z *= 2.0;
-}
-in lowp vec4 xlv_TEXCOORD0;
-void main() {
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4(xlv_TEXCOORD0);
- lowp vec4 xlt_ocol = vec4(gl_FragData[0]);
- frag (xlt_i, xlt_ocol);
- gl_FragData[0] = vec4(xlt_ocol);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES.txt
deleted file mode 100644
index f319502cd0d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-#extension GL_EXT_shader_framebuffer_fetch : enable
-varying lowp vec4 xlv_TEXCOORD0;
-void main ()
-{
- lowp vec4 xlt_ocol_1;
- mediump vec4 tmpvar_2;
- tmpvar_2 = gl_LastFragData[0];
- xlt_ocol_1 = tmpvar_2;
- lowp vec4 ocol_3;
- ocol_3.w = xlt_ocol_1.w;
- ocol_3.xy = xlv_TEXCOORD0.xy;
- ocol_3.z = (xlt_ocol_1.z * 2.0);
- xlt_ocol_1 = ocol_3;
- gl_FragData[0] = ocol_3;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_LastFragData (medium float) 4x1 [4] loc 24
-// #1: xlv_TEXCOORD0 (low float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3.txt
deleted file mode 100644
index c313db96d12..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-#version 300 es
-#extension GL_EXT_shader_framebuffer_fetch : enable
-layout(location=0) inout mediump vec4 _glesFragData[4];
-in lowp vec4 xlv_TEXCOORD0;
-void main ()
-{
- lowp vec4 xlt_ocol_1;
- mediump vec4 tmpvar_2;
- tmpvar_2 = _glesFragData[0];
- xlt_ocol_1 = tmpvar_2;
- lowp vec4 ocol_3;
- ocol_3.w = xlt_ocol_1.w;
- ocol_3.xy = xlv_TEXCOORD0.xy;
- ocol_3.z = (xlt_ocol_1.z * 2.0);
- xlt_ocol_1 = ocol_3;
- _glesFragData[0] = ocol_3;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (low float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3Metal.txt
deleted file mode 100644
index 5108de97f2a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/framebuffer_fetch-outES3Metal.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- half4 xlv_TEXCOORD0;
- half4 _glesFragData_0 [[color(0)]];
-};
-struct xlatMtlShaderOutput {
- half4 _glesFragData_0 [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 xlt_ocol_1 = 0;
- xlt_ocol_1 = _mtl_i._glesFragData_0;
- half4 ocol_2 = 0;
- ocol_2.w = xlt_ocol_1.w;
- ocol_2.xy = _mtl_i.xlv_TEXCOORD0.xy;
- ocol_2.z = (xlt_ocol_1.z * (half)(2.0));
- xlt_ocol_1 = ocol_2;
- _mtl_o._glesFragData_0 = ocol_2;
- return _mtl_o;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (low float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-inES3.txt
deleted file mode 100644
index e6ef84c2bca..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-inES3.txt
+++ /dev/null
@@ -1,685 +0,0 @@
-#version 300 es
-vec4 xll_texCUBElod(samplerCube s, vec4 coord) {
- return textureLod( s, coord.xyz, coord.w);
-}
-float xll_shadow2D(mediump sampler2DShadow s, vec3 coord) { return texture (s, coord); }
-float xll_saturate_f( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate_vf2( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate_vf3( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate_vf4( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate_mf2x2(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate_mf3x3(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate_mf4x4(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-
-struct v2f_vertex_lit {
- highp vec2 uv;
- lowp vec4 diff;
- lowp vec4 spec;
-};
-
-struct v2f_img {
- highp vec4 pos;
- mediump vec2 uv;
-};
-
-struct appdata_img {
- highp vec4 vertex;
- mediump vec2 texcoord;
-};
-
-struct Unity_GlossyEnvironmentData {
- mediump float roughness;
- mediump vec3 reflUVW;
-};
-
-struct UnityLight {
- mediump vec3 color;
- mediump vec3 dir;
- mediump float ndotl;
-};
-
-struct UnityIndirect {
- mediump vec3 diffuse;
- mediump vec3 specular;
-};
-
-struct UnityGI {
- UnityLight light;
- UnityIndirect indirect;
-};
-
-struct UnityGIInput {
- UnityLight light;
- highp vec3 worldPos;
- mediump vec3 worldViewDir;
- mediump float atten;
- mediump vec3 ambient;
- mediump vec4 lightmapUV;
- highp vec4 boxMax[2];
- highp vec4 boxMin[2];
- highp vec4 probePosition[2];
- highp vec4 probeHDR[2];
-};
-
-struct SurfaceOutputStandard {
- lowp vec3 Albedo;
- lowp vec3 Normal;
- mediump vec3 Emission;
- mediump float Metallic;
- mediump float Smoothness;
- mediump float Occlusion;
- lowp float Alpha;
-};
-
-struct SurfaceOutputStandardSpecular {
- lowp vec3 Albedo;
- lowp vec3 Specular;
- lowp vec3 Normal;
- mediump vec3 Emission;
- mediump float Smoothness;
- mediump float Occlusion;
- lowp float Alpha;
-};
-
-struct VertexInput {
- highp vec4 vertex;
- mediump vec3 normal;
- highp vec2 uv0;
- highp vec2 uv1;
-};
-
-struct FragmentCommonData {
- mediump vec3 diffColor;
- mediump vec3 specColor;
- mediump float oneMinusReflectivity;
- mediump float oneMinusRoughness;
- mediump vec3 normalWorld;
- mediump vec3 eyeVec;
- mediump vec3 posWorld;
- mediump float alpha;
-};
-
-struct VertexOutputForwardBase {
- highp vec4 pos;
- highp vec4 tex;
- mediump vec3 eyeVec;
- mediump vec4 tangentToWorldAndParallax[3];
- mediump vec4 ambientOrLightmapUV;
- mediump vec4 _ShadowCoord;
-};
-
-struct VertexOutputForwardAdd {
- highp vec4 pos;
- highp vec4 tex;
- mediump vec3 eyeVec;
- mediump vec4 tangentToWorldAndLightDir[3];
- mediump vec4 _ShadowCoord;
-};
-
-struct VertexOutputDeferred {
- highp vec4 pos;
- highp vec4 tex;
- mediump vec3 eyeVec;
- mediump vec4 tangentToWorldAndParallax[3];
- mediump vec4 ambientOrLightmapUV;
-};
-
-struct VertexInput_VC {
- highp vec4 vertex;
- lowp vec4 color;
- mediump vec3 normal;
- highp vec2 uv0;
- highp vec2 uv1;
-};
-
-struct VertexOutputForwardBase_VC {
- highp vec4 pos;
- highp vec4 tex;
- mediump vec3 eyeVec;
- mediump vec4 tangentToWorldAndParallax[3];
- mediump vec4 ambientOrLightmapUV;
- mediump vec4 _ShadowCoord;
- lowp vec4 color;
-};
-
-struct VertexOutputDeferred_VC {
- highp vec4 pos;
- lowp vec4 color;
- highp vec4 tex;
- mediump vec3 eyeVec;
- mediump vec4 tangentToWorldAndParallax[3];
- mediump vec4 ambientOrLightmapUV;
-};
-
-uniform highp vec4 _Time;
-uniform highp vec4 _SinTime;
-uniform highp vec4 _CosTime;
-uniform highp vec4 unity_DeltaTime;
-
-uniform highp vec3 _WorldSpaceCameraPos;
-
-uniform highp vec4 _ProjectionParams;
-
-uniform highp vec4 _ScreenParams;
-
-uniform highp vec4 _ZBufferParams;
-
-uniform highp vec4 unity_OrthoParams;
-
-uniform highp vec4 unity_CameraWorldClipPlanes[6];
-
-uniform highp mat4 unity_CameraProjection;
-uniform highp mat4 unity_CameraInvProjection;
-
-uniform mediump vec4 _WorldSpaceLightPos0;
-
-uniform highp vec4 _LightPositionRange;
-uniform highp vec4 unity_4LightPosX0;
-uniform highp vec4 unity_4LightPosY0;
-
-uniform highp vec4 unity_4LightPosZ0;
-uniform mediump vec4 unity_4LightAtten0;
-uniform mediump vec4 unity_LightColor[8];
-
-uniform highp vec4 unity_LightPosition[8];
-
-uniform mediump vec4 unity_LightAtten[8];
-uniform highp vec4 unity_SpotDirection[8];
-
-uniform mediump vec4 unity_SHAr;
-uniform mediump vec4 unity_SHAg;
-uniform mediump vec4 unity_SHAb;
-uniform mediump vec4 unity_SHBr;
-
-uniform mediump vec4 unity_SHBg;
-uniform mediump vec4 unity_SHBb;
-uniform mediump vec4 unity_SHC;
-
-uniform mediump vec3 unity_LightColor0;
-uniform mediump vec3 unity_LightColor1;
-uniform mediump vec3 unity_LightColor2;
-uniform mediump vec3 unity_LightColor3;
-
-uniform highp vec4 unity_ShadowSplitSpheres[4];
-uniform highp vec4 unity_ShadowSplitSqRadii;
-uniform highp vec4 unity_LightShadowBias;
-uniform highp vec4 _LightSplitsNear;
-
-uniform highp vec4 _LightSplitsFar;
-uniform highp mat4 unity_World2Shadow[4];
-uniform mediump vec4 _LightShadowData;
-uniform highp vec4 unity_ShadowFadeCenterAndType;
-
-uniform highp mat4 glstate_matrix_mvp;
-uniform highp mat4 glstate_matrix_modelview0;
-uniform highp mat4 glstate_matrix_invtrans_modelview0;
-
-uniform highp mat4 _Object2World;
-uniform highp mat4 _World2Object;
-uniform highp vec4 unity_LODFade;
-uniform highp vec4 unity_WorldTransformParams;
-
-uniform highp mat4 glstate_matrix_transpose_modelview0;
-
-uniform highp mat4 glstate_matrix_projection;
-uniform lowp vec4 glstate_lightmodel_ambient;
-
-uniform highp mat4 unity_MatrixV;
-uniform highp mat4 unity_MatrixVP;
-
-uniform lowp vec4 unity_AmbientSky;
-uniform lowp vec4 unity_AmbientEquator;
-uniform lowp vec4 unity_AmbientGround;
-
-uniform lowp vec4 unity_FogColor;
-
-uniform highp vec4 unity_FogParams;
-
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-
-uniform sampler2D unity_DynamicLightmap;
-uniform sampler2D unity_DynamicDirectionality;
-uniform sampler2D unity_DynamicNormal;
-
-uniform highp vec4 unity_LightmapST;
-uniform highp vec4 unity_DynamicLightmapST;
-
-uniform samplerCube unity_SpecCube0;
-uniform samplerCube unity_SpecCube1;
-
-uniform highp vec4 unity_SpecCube0_BoxMax;
-uniform highp vec4 unity_SpecCube0_BoxMin;
-uniform highp vec4 unity_SpecCube0_ProbePosition;
-uniform mediump vec4 unity_SpecCube0_HDR;
-
-uniform highp vec4 unity_SpecCube1_BoxMax;
-uniform highp vec4 unity_SpecCube1_BoxMin;
-uniform highp vec4 unity_SpecCube1_ProbePosition;
-uniform mediump vec4 unity_SpecCube1_HDR;
-
-uniform lowp vec4 unity_ColorSpaceGrey;
-uniform lowp vec4 unity_ColorSpaceDouble;
-uniform mediump vec4 unity_ColorSpaceDielectricSpec;
-uniform mediump vec4 unity_ColorSpaceLuminance;
-
-uniform mediump vec4 unity_Lightmap_HDR;
-
-uniform mediump vec4 unity_DynamicLightmap_HDR;
-
-uniform lowp vec4 _LightColor0;
-uniform lowp vec4 _SpecColor;
-
-uniform sampler2D unity_NHxRoughness;
-
-uniform mediump vec4 _Color;
-uniform mediump float _Cutoff;
-uniform sampler2D _MainTex;
-
-uniform highp vec4 _MainTex_ST;
-uniform sampler2D _DetailAlbedoMap;
-uniform highp vec4 _DetailAlbedoMap_ST;
-
-uniform sampler2D _BumpMap;
-uniform mediump float _BumpScale;
-uniform sampler2D _DetailMask;
-
-uniform sampler2D _DetailNormalMap;
-uniform mediump float _DetailNormalMapScale;
-uniform sampler2D _SpecGlossMap;
-
-uniform sampler2D _MetallicGlossMap;
-uniform mediump float _Metallic;
-uniform mediump float _Glossiness;
-
-uniform sampler2D _OcclusionMap;
-uniform mediump float _OcclusionStrength;
-uniform sampler2D _ParallaxMap;
-
-uniform mediump float _Parallax;
-uniform mediump float _UVSec;
-uniform mediump vec4 _EmissionColor;
-
-uniform sampler2D _EmissionMap;
-
-uniform lowp sampler2DShadow _ShadowMapTexture;
-
-mediump float DotClamped( in mediump vec3 a, in mediump vec3 b ) {
- return max( 0.0, dot( a, b));
-}
-
-mediump float BlinnTerm( in mediump vec3 normal, in mediump vec3 halfDir ) {
- return DotClamped( normal, halfDir);
-}
-
-mediump float Pow4( in mediump float x ) {
- return (((x * x) * x) * x);
-}
-
-mediump vec3 FresnelLerpFast( in mediump vec3 F0, in mediump vec3 F90, in mediump float cosA ) {
- mediump float t = Pow4( (1.0 - cosA));
- return mix( F0, F90, vec3( t));
-}
-
-bool IsGammaSpace( ) {
- return true;
-}
-
-mediump float RoughnessToSpecPower( in mediump float roughness ) {
-
- mediump float m = max( 0.0001, (roughness * roughness));
- mediump float n = ((2.0 / (m * m)) - 2.0);
- n = max( n, 0.0001);
-
- return n;
-}
-
-mediump vec3 Unity_SafeNormalize( in mediump vec3 inVec ) {
- mediump float dp3 = max( 0.001, dot( inVec, inVec));
- return (inVec * inversesqrt(dp3));
-}
-
-mediump vec4 BRDF2_Unity_PBS( in mediump vec3 diffColor, in mediump vec3 specColor, in mediump float oneMinusReflectivity, in mediump float oneMinusRoughness, in mediump vec3 normal, in mediump vec3 viewDir, in UnityLight light, in UnityIndirect gi ) {
- mediump vec3 halfDir = Unity_SafeNormalize( (light.dir + viewDir));
-
- mediump float nl = light.ndotl;
- mediump float nh = BlinnTerm( normal, halfDir);
- mediump float nv = DotClamped( normal, viewDir);
- mediump float lh = DotClamped( light.dir, halfDir);
-
- mediump float roughness = (1.0 - oneMinusRoughness);
- mediump float specularPower = RoughnessToSpecPower( roughness);
-
- mediump float invV = (((lh * lh) * oneMinusRoughness) + (roughness * roughness));
- mediump float invF = lh;
- mediump float specular = (((specularPower + 1.0) * pow( nh, specularPower)) / (((8.0 * invV) * invF) + 0.0001));
- if (IsGammaSpace( )){
- specular = sqrt(max( 0.0001, specular));
- }
-
- mediump float realRoughness = (roughness * roughness);
- mediump float surfaceReduction = (( IsGammaSpace( ) ) ? ( 0.28 ) : ( (0.6 - (0.08 * roughness)) ));
-
- surfaceReduction = (1.0 - ((realRoughness * roughness) * surfaceReduction));
-
- mediump float grazingTerm = xll_saturate_f((oneMinusRoughness + (1.0 - oneMinusReflectivity)));
- mediump vec3 color = (((((diffColor + (specular * specColor)) * light.color) * nl) + (gi.diffuse * diffColor)) + ((surfaceReduction * gi.specular) * FresnelLerpFast( specColor, vec3( grazingTerm), nv)));
-
- return vec4( color, 1.0);
-}
-
-mediump vec3 BRDF_Unity_Indirect( in mediump vec3 baseColor, in mediump vec3 specColor, in mediump float oneMinusReflectivity, in mediump float oneMinusRoughness, in mediump vec3 normal, in mediump vec3 viewDir, in mediump float occlusion, in UnityGI gi ) {
- mediump vec3 c = vec3( 0.0);
-
- return c;
-}
-
-mediump vec3 Emission( in highp vec2 uv ) {
- return vec3( 0.0);
-}
-
-void ResetUnityLight( out UnityLight outLight ) {
-
- outLight.color = vec3( 0.0);
- outLight.dir = vec3( 0.0);
- outLight.ndotl = 0.0;
-}
-
-void ResetUnityGI( out UnityGI outGI ) {
- ResetUnityLight( outGI.light);
-
- outGI.indirect.diffuse = vec3( 0.0);
- outGI.indirect.specular = vec3( 0.0);
-}
-
-mediump vec3 LinearToGammaSpace( in mediump vec3 linRGB ) {
- linRGB = max( linRGB, vec3( 0.0, 0.0, 0.0));
-
- return max( ((1.055 * pow( linRGB, vec3( 0.4166667))) - 0.055), vec3( 0.0));
-}
-
-mediump vec3 SHEvalLinearL0L1( in mediump vec4 normal ) {
- mediump vec3 x;
-
- x.x = dot( unity_SHAr, normal);
- x.y = dot( unity_SHAg, normal);
- x.z = dot( unity_SHAb, normal);
-
- return x;
-}
-
-mediump vec3 ShadeSHPerPixel( in mediump vec3 normal, in mediump vec3 ambient ) {
-
- mediump vec3 ambient_contrib = vec3( 0.0);
-
- ambient_contrib = SHEvalLinearL0L1( vec4( normal, 1.0));
- ambient = max( vec3( 0.0, 0.0, 0.0), (ambient + ambient_contrib));
- if (IsGammaSpace( )){
- ambient = LinearToGammaSpace( ambient);
- }
-
- return ambient;
-}
-
-UnityGI UnityGI_Base( in UnityGIInput data, in mediump float occlusion, in mediump vec3 normalWorld ) {
- UnityGI o_gi;
- ResetUnityGI( o_gi);
-
- o_gi.light = data.light;
- o_gi.light.color *= data.atten;
-
- o_gi.indirect.diffuse = ShadeSHPerPixel( normalWorld, data.ambient);
-
- o_gi.indirect.diffuse *= occlusion;
- return o_gi;
-}
-
-UnityGI UnityGlobalIllumination( in UnityGIInput data, in mediump float occlusion, in mediump vec3 normalWorld ) {
- return UnityGI_Base( data, occlusion, normalWorld);
-}
-
-mediump vec3 DecodeHDR( in mediump vec4 data, in mediump vec4 decodeInstructions ) {
- return ((decodeInstructions.x * data.w) * data.xyz);
-}
-
-mediump vec3 DecodeHDR_NoLinearSupportInSM2( in mediump vec4 data, in mediump vec4 decodeInstructions ) {
- return DecodeHDR( data, decodeInstructions);
-}
-
-mediump vec3 Unity_GlossyEnvironment( in samplerCube tex, in mediump vec4 hdr, in Unity_GlossyEnvironmentData glossIn ) {
-
- mediump float roughness = glossIn.roughness;
-
- roughness = (roughness * (1.7 - (0.7 * roughness)));
-
- mediump float mip = (roughness * 6.0);
- mediump vec4 rgbm = xll_texCUBElod( tex, vec4( glossIn.reflUVW, mip));
- return DecodeHDR_NoLinearSupportInSM2( rgbm, hdr);
-}
-
-mediump vec3 UnityGI_IndirectSpecular( in UnityGIInput data, in mediump float occlusion, in mediump vec3 normalWorld, in Unity_GlossyEnvironmentData glossIn ) {
- mediump vec3 specular;
- mediump vec3 env0 = Unity_GlossyEnvironment( unity_SpecCube0, data.probeHDR[0], glossIn);
- specular = env0;
- return (specular * occlusion);
-}
-
-UnityGI UnityGlobalIllumination( in UnityGIInput data, in mediump float occlusion, in mediump vec3 normalWorld, in Unity_GlossyEnvironmentData glossIn ) {
- UnityGI o_gi = UnityGI_Base( data, occlusion, normalWorld);
- o_gi.indirect.specular = UnityGI_IndirectSpecular( data, occlusion, normalWorld, glossIn);
- return o_gi;
-}
-
-UnityGI FragmentGI( in FragmentCommonData s, in mediump float occlusion, in mediump vec4 i_ambientOrLightmapUV, in mediump float atten, in UnityLight light, in bool reflections ) {
- UnityGIInput d;
- d.light = light;
-
- d.worldPos = s.posWorld;
- d.worldViewDir = (-s.eyeVec);
- d.atten = atten;
-
- d.ambient = i_ambientOrLightmapUV.xyz;
- d.lightmapUV = vec4( 0.0);
- d.boxMax[0] = unity_SpecCube0_BoxMax;
-
- d.boxMin[0] = unity_SpecCube0_BoxMin;
- d.probePosition[0] = unity_SpecCube0_ProbePosition;
- d.probeHDR[0] = unity_SpecCube0_HDR;
-
- d.boxMax[1] = unity_SpecCube1_BoxMax;
- d.boxMin[1] = unity_SpecCube1_BoxMin;
- d.probePosition[1] = unity_SpecCube1_ProbePosition;
- d.probeHDR[1] = unity_SpecCube1_HDR;
-
- if (reflections){
- Unity_GlossyEnvironmentData g;
- g.roughness = (1.0 - s.oneMinusRoughness);
-
- g.reflUVW = reflect( s.eyeVec, s.normalWorld);
- return UnityGlobalIllumination( d, occlusion, s.normalWorld, g);
- }
- else{
- return UnityGlobalIllumination( d, occlusion, s.normalWorld);
- }
-}
-
-UnityGI FragmentGI( in highp vec3 posWorld, in mediump float occlusion, in mediump vec4 i_ambientOrLightmapUV, in mediump float atten, in mediump float oneMinusRoughness, in mediump vec3 normalWorld, in mediump vec3 eyeVec, in UnityLight light, in bool reflections ) {
- FragmentCommonData s = FragmentCommonData(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), 0.0, 0.0, vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), 0.0);
- s.oneMinusRoughness = oneMinusRoughness;
- s.normalWorld = normalWorld;
- s.eyeVec = eyeVec;
- s.posWorld = posWorld;
- return FragmentGI( s, occlusion, i_ambientOrLightmapUV, atten, light, reflections);
-}
-
-UnityGI FragmentGI( in highp vec3 posWorld, in mediump float occlusion, in mediump vec4 i_ambientOrLightmapUV, in mediump float atten, in mediump float oneMinusRoughness, in mediump vec3 normalWorld, in mediump vec3 eyeVec, in UnityLight light ) {
- return FragmentGI( posWorld, occlusion, i_ambientOrLightmapUV, atten, oneMinusRoughness, normalWorld, eyeVec, light, true);
-}
-
-mediump float Alpha( in highp vec2 uv ) {
- return (texture( _MainTex, uv).w * _Color.w);
-}
-
-mediump vec3 Albedo( in highp vec4 texcoords ) {
- mediump vec3 albedo = (_Color.xyz * texture( _MainTex, texcoords.xy).xyz);
- return albedo;
-}
-
-mediump float OneMinusReflectivityFromMetallic( in mediump float metallic ) {
- mediump float oneMinusDielectricSpec = unity_ColorSpaceDielectricSpec.w;
- return (oneMinusDielectricSpec - (metallic * oneMinusDielectricSpec));
-}
-
-mediump vec3 DiffuseAndSpecularFromMetallic( in mediump vec3 albedo, in mediump float metallic, out mediump vec3 specColor, out mediump float oneMinusReflectivity ) {
- specColor = mix( unity_ColorSpaceDielectricSpec.xyz, albedo, vec3( metallic));
- oneMinusReflectivity = OneMinusReflectivityFromMetallic( metallic);
-
- return (albedo * oneMinusReflectivity);
-}
-
-mediump vec2 MetallicGloss( in highp vec2 uv ) {
- mediump vec2 mg;
-
- mg = vec2( _Metallic, _Glossiness);
- return mg;
-}
-
-FragmentCommonData MetallicSetup( in highp vec4 i_tex ) {
- mediump vec2 metallicGloss = MetallicGloss( i_tex.xy);
- mediump float metallic = metallicGloss.x;
-
- mediump float oneMinusRoughness = metallicGloss.y;
- mediump float oneMinusReflectivity;
- mediump vec3 specColor;
-
- mediump vec3 diffColor = DiffuseAndSpecularFromMetallic( Albedo( i_tex), metallic, specColor, oneMinusReflectivity);
- FragmentCommonData o = FragmentCommonData(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), 0.0, 0.0, vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), 0.0);
- o.diffColor = diffColor;
-
- o.specColor = specColor;
- o.oneMinusReflectivity = oneMinusReflectivity;
- o.oneMinusRoughness = oneMinusRoughness;
- return o;
-}
-
-mediump vec3 NormalizePerPixelNormal( in mediump vec3 n ) {
- return normalize(n);
-}
-
-highp vec4 Parallax( in highp vec4 texcoords, in mediump vec3 viewDir ) {
- return texcoords;
-}
-
-mediump vec3 PerPixelWorldNormal( in highp vec4 i_tex, in mediump vec4 tangentToWorld[3] ) {
- mediump vec3 normalWorld = normalize(tangentToWorld[2].xyz);
- return normalWorld;
-}
-
-mediump vec3 PreMultiplyAlpha( in mediump vec3 diffColor, in mediump float alpha, in mediump float oneMinusReflectivity, out mediump float outModifiedAlpha ) {
- outModifiedAlpha = alpha;
- return diffColor;
-}
-
-FragmentCommonData FragmentSetup( in highp vec4 i_tex, in mediump vec3 i_eyeVec, in mediump vec3 i_viewDirForParallax, in mediump vec4 tangentToWorld[3], in mediump vec3 i_posWorld ) {
- i_tex = Parallax( i_tex, i_viewDirForParallax);
-
- mediump float alpha = Alpha( i_tex.xy);
-
- FragmentCommonData o = MetallicSetup( i_tex);
- o.normalWorld = PerPixelWorldNormal( i_tex, tangentToWorld);
- o.eyeVec = NormalizePerPixelNormal( i_eyeVec);
- o.posWorld = i_posWorld;
-
- o.diffColor = PreMultiplyAlpha( o.diffColor, alpha, o.oneMinusReflectivity, o.alpha);
- return o;
-}
-
-mediump float LambertTerm( in mediump vec3 normal, in mediump vec3 lightDir ) {
- return DotClamped( normal, lightDir);
-}
-
-UnityLight MainLight( in mediump vec3 normalWorld ) {
- UnityLight l;
-
- l.color = _LightColor0.xyz;
- l.dir = _WorldSpaceLightPos0.xyz;
- l.ndotl = LambertTerm( normalWorld, l.dir);
-
- return l;
-}
-
-mediump float LerpOneTo( in mediump float b, in mediump float t ) {
- mediump float oneMinusT = (1.0 - t);
- return (oneMinusT + (b * t));
-}
-
-mediump float Occlusion( in highp vec2 uv ) {
- mediump float occ = texture( _OcclusionMap, uv).y;
- return LerpOneTo( occ, _OcclusionStrength);
-}
-
-mediump vec4 OutputForward( in mediump vec4 xlat_varoutput, in mediump float alphaFromSurface ) {
- xlat_varoutput.w = 1.0;
- return xlat_varoutput;
-}
-
-lowp float unitySampleShadow( in mediump vec4 shadowCoord ) {
- lowp float shadow = xll_shadow2D( _ShadowMapTexture, shadowCoord.xyz.xyz);
- shadow = (_LightShadowData.x + (shadow * (1.0 - _LightShadowData.x)));
- return shadow;
-}
-
-mediump vec4 fragForwardBase_VC( in VertexOutputForwardBase_VC i ) {
- FragmentCommonData s = FragmentSetup( i.tex, i.eyeVec, vec3( 0.0, 0.0, 0.0), i.tangentToWorldAndParallax, vec3( 0.0, 0.0, 0.0));
- UnityLight mainLight = MainLight( s.normalWorld);
-
- mediump float atten = unitySampleShadow( i._ShadowCoord);
- mediump float occlusion = Occlusion( i.tex.xy);
- UnityGI gi = FragmentGI( s.posWorld, occlusion, i.ambientOrLightmapUV, atten, s.oneMinusRoughness, s.normalWorld, s.eyeVec, mainLight);
-
- mediump vec4 c = BRDF2_Unity_PBS( s.diffColor, s.specColor, s.oneMinusReflectivity, s.oneMinusRoughness, s.normalWorld, (-s.eyeVec), gi.light, gi.indirect);
- c *= i.color;
-
- c.xyz += BRDF_Unity_Indirect( s.diffColor, s.specColor, s.oneMinusReflectivity, s.oneMinusRoughness, s.normalWorld, (-s.eyeVec), occlusion, gi);
- c.xyz += Emission( i.tex.xy);
-
- return OutputForward( c, (s.alpha * i.color.w));
-}
-in highp vec4 xlv_TEXCOORD0;
-in mediump vec3 xlv_TEXCOORD1;
-in mediump vec4 xlv_TEXCOORD2;
-in mediump vec4 xlv_TEXCOORD2_1;
-in mediump vec4 xlv_TEXCOORD2_2;
-in mediump vec4 xlv_TEXCOORD5;
-in mediump vec4 xlv_TEXCOORD6;
-in lowp vec4 xlv_COLOR;
-out lowp vec4 FragData [1];
-void main() {
- mediump vec4 xl_retval;
- VertexOutputForwardBase_VC xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.tex = vec4(xlv_TEXCOORD0);
- xlt_i.eyeVec = vec3(xlv_TEXCOORD1);
- xlt_i.tangentToWorldAndParallax[0] = vec4(xlv_TEXCOORD2);
- xlt_i.tangentToWorldAndParallax[1] = vec4(xlv_TEXCOORD2_1);
- xlt_i.tangentToWorldAndParallax[2] = vec4(xlv_TEXCOORD2_2);
- xlt_i.ambientOrLightmapUV = vec4(xlv_TEXCOORD5);
- xlt_i._ShadowCoord = vec4(xlv_TEXCOORD6);
- xlt_i.color = vec4(xlv_COLOR);
- xl_retval = fragForwardBase_VC( xlt_i);
- FragData[0] = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-outES3.txt
deleted file mode 100644
index 3c6034fa529..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-outES3.txt
+++ /dev/null
@@ -1,187 +0,0 @@
-#version 300 es
-struct FragmentCommonData {
- mediump vec3 diffColor;
- mediump vec3 specColor;
- mediump float oneMinusReflectivity;
- mediump float oneMinusRoughness;
- mediump vec3 normalWorld;
- mediump vec3 eyeVec;
- mediump vec3 posWorld;
- mediump float alpha;
-};
-uniform mediump vec4 _WorldSpaceLightPos0;
-uniform mediump vec4 unity_SHAr;
-uniform mediump vec4 unity_SHAg;
-uniform mediump vec4 unity_SHAb;
-uniform mediump vec4 _LightShadowData;
-uniform lowp samplerCube unity_SpecCube0;
-uniform mediump vec4 unity_SpecCube0_HDR;
-uniform mediump vec4 unity_ColorSpaceDielectricSpec;
-uniform lowp vec4 _LightColor0;
-uniform mediump vec4 _Color;
-uniform sampler2D _MainTex;
-uniform mediump float _Metallic;
-uniform mediump float _Glossiness;
-uniform sampler2D _OcclusionMap;
-uniform mediump float _OcclusionStrength;
-uniform lowp sampler2DShadow _ShadowMapTexture;
-in highp vec4 xlv_TEXCOORD0;
-in mediump vec3 xlv_TEXCOORD1;
-in mediump vec4 xlv_TEXCOORD2_2;
-in mediump vec4 xlv_TEXCOORD5;
-in mediump vec4 xlv_TEXCOORD6;
-in lowp vec4 xlv_COLOR;
-out lowp vec4 FragData[1];
-void main ()
-{
- mediump vec4 c_1;
- mediump float atten_2;
- lowp vec4 tmpvar_3;
- tmpvar_3 = texture (_MainTex, xlv_TEXCOORD0.xy);
- mediump vec2 tmpvar_4;
- tmpvar_4.x = _Metallic;
- tmpvar_4.y = _Glossiness;
- mediump vec3 tmpvar_5;
- tmpvar_5 = (_Color.xyz * tmpvar_3.xyz);
- mediump vec3 tmpvar_6;
- mediump vec3 tmpvar_7;
- tmpvar_7 = mix (unity_ColorSpaceDielectricSpec.xyz, tmpvar_5, vec3(_Metallic));
- mediump float tmpvar_8;
- tmpvar_8 = (unity_ColorSpaceDielectricSpec.w - (_Metallic * unity_ColorSpaceDielectricSpec.w));
- tmpvar_6 = (tmpvar_5 * tmpvar_8);
- mediump vec3 tmpvar_9;
- tmpvar_9 = normalize(xlv_TEXCOORD2_2.xyz);
- mediump vec3 tmpvar_10;
- tmpvar_10 = normalize(xlv_TEXCOORD1);
- mediump vec3 tmpvar_11;
- tmpvar_11 = _LightColor0.xyz;
- lowp float shadow_12;
- mediump float tmpvar_13;
- tmpvar_13 = texture (_ShadowMapTexture, xlv_TEXCOORD6.xyz);
- lowp float tmpvar_14;
- tmpvar_14 = tmpvar_13;
- shadow_12 = (_LightShadowData.x + (tmpvar_14 * (1.0 - _LightShadowData.x)));
- atten_2 = shadow_12;
- mediump float occ_15;
- lowp float tmpvar_16;
- tmpvar_16 = texture (_OcclusionMap, xlv_TEXCOORD0.xy).y;
- occ_15 = tmpvar_16;
- mediump float tmpvar_17;
- tmpvar_17 = ((1.0 - _OcclusionStrength) + (occ_15 * _OcclusionStrength));
- FragmentCommonData s_18;
- s_18 = FragmentCommonData(vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), 0.0, 0.0, vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), vec3(0.0, 0.0, 0.0), 0.0);
- s_18.oneMinusRoughness = tmpvar_4.y;
- s_18.normalWorld = tmpvar_9;
- s_18.eyeVec = tmpvar_10;
- s_18.posWorld = vec3(0.0, 0.0, 0.0);
- mediump vec3 tmpvar_19;
- mediump vec3 tmpvar_20;
- tmpvar_19 = s_18.normalWorld;
- tmpvar_20 = s_18.eyeVec;
- highp vec4 tmpvar_21;
- tmpvar_21 = unity_SpecCube0_HDR;
- mediump float tmpvar_22;
- tmpvar_22 = (1.0 - s_18.oneMinusRoughness);
- mediump vec3 tmpvar_23;
- tmpvar_23 = (tmpvar_20 - (2.0 * (
- dot (tmpvar_19, tmpvar_20)
- * tmpvar_19)));
- mediump vec4 tmpvar_24;
- tmpvar_24.w = 1.0;
- tmpvar_24.xyz = tmpvar_19;
- mediump vec3 x_25;
- x_25.x = dot (unity_SHAr, tmpvar_24);
- x_25.y = dot (unity_SHAg, tmpvar_24);
- x_25.z = dot (unity_SHAb, tmpvar_24);
- mediump vec4 hdr_26;
- hdr_26 = tmpvar_21;
- mediump vec4 tmpvar_27;
- tmpvar_27.xyz = tmpvar_23;
- tmpvar_27.w = ((tmpvar_22 * (1.7 -
- (0.7 * tmpvar_22)
- )) * 6.0);
- lowp vec4 tmpvar_28;
- tmpvar_28 = textureLod (unity_SpecCube0, tmpvar_23, tmpvar_27.w);
- mediump vec4 tmpvar_29;
- tmpvar_29 = tmpvar_28;
- mediump vec3 viewDir_30;
- viewDir_30 = -(tmpvar_10);
- mediump vec3 tmpvar_31;
- mediump vec3 inVec_32;
- inVec_32 = (_WorldSpaceLightPos0.xyz + viewDir_30);
- tmpvar_31 = (inVec_32 * inversesqrt(max (0.001,
- dot (inVec_32, inVec_32)
- )));
- mediump float tmpvar_33;
- tmpvar_33 = max (0.0, dot (_WorldSpaceLightPos0.xyz, tmpvar_31));
- mediump float tmpvar_34;
- tmpvar_34 = (1.0 - _Glossiness);
- mediump float tmpvar_35;
- tmpvar_35 = max (0.0001, (tmpvar_34 * tmpvar_34));
- mediump float tmpvar_36;
- tmpvar_36 = max (((2.0 /
- (tmpvar_35 * tmpvar_35)
- ) - 2.0), 0.0001);
- mediump float x_37;
- x_37 = (1.0 - max (0.0, dot (tmpvar_9, viewDir_30)));
- mediump vec4 tmpvar_38;
- tmpvar_38.w = 1.0;
- tmpvar_38.xyz = (((
- ((tmpvar_6 + (sqrt(
- max (0.0001, (((tmpvar_36 + 1.0) * pow (
- max (0.0, dot (tmpvar_9, tmpvar_31))
- , tmpvar_36)) / ((
- (8.0 * (((tmpvar_33 * tmpvar_33) * _Glossiness) + (tmpvar_34 * tmpvar_34)))
- * tmpvar_33) + 0.0001)))
- ) * tmpvar_7)) * (tmpvar_11 * atten_2))
- *
- max (0.0, dot (tmpvar_9, _WorldSpaceLightPos0.xyz))
- ) + (
- (max (((1.055 *
- pow (max (vec3(0.0, 0.0, 0.0), (xlv_TEXCOORD5.xyz + x_25)), vec3(0.4166667, 0.4166667, 0.4166667))
- ) - 0.055), vec3(0.0, 0.0, 0.0)) * tmpvar_17)
- * tmpvar_6)) + ((
- (1.0 - ((tmpvar_34 * tmpvar_34) * (tmpvar_34 * 0.28)))
- *
- (((hdr_26.x * tmpvar_29.w) * tmpvar_29.xyz) * tmpvar_17)
- ) * mix (tmpvar_7, vec3(
- clamp ((_Glossiness + (1.0 - tmpvar_8)), 0.0, 1.0)
- ), vec3(
- ((x_37 * x_37) * (x_37 * x_37))
- ))));
- c_1 = (tmpvar_38 * xlv_COLOR);
- c_1.xyz = c_1.xyz;
- c_1.xyz = c_1.xyz;
- mediump vec4 xlat_varoutput_39;
- xlat_varoutput_39.xyz = c_1.xyz;
- xlat_varoutput_39.w = 1.0;
- FragData[0] = xlat_varoutput_39;
-}
-
-
-// stats: 97 alu 4 tex 0 flow
-// inputs: 6
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// #1: xlv_TEXCOORD1 (medium float) 3x1 [-1]
-// #2: xlv_TEXCOORD2_2 (medium float) 4x1 [-1]
-// #3: xlv_TEXCOORD5 (medium float) 4x1 [-1]
-// #4: xlv_TEXCOORD6 (medium float) 4x1 [-1]
-// #5: xlv_COLOR (low float) 4x1 [-1]
-// uniforms: 12 (total size: 0)
-// #0: _WorldSpaceLightPos0 (medium float) 4x1 [-1]
-// #1: unity_SHAr (medium float) 4x1 [-1]
-// #2: unity_SHAg (medium float) 4x1 [-1]
-// #3: unity_SHAb (medium float) 4x1 [-1]
-// #4: _LightShadowData (medium float) 4x1 [-1]
-// #5: unity_SpecCube0_HDR (medium float) 4x1 [-1]
-// #6: unity_ColorSpaceDielectricSpec (medium float) 4x1 [-1]
-// #7: _LightColor0 (low float) 4x1 [-1]
-// #8: _Color (medium float) 4x1 [-1]
-// #9: _Metallic (medium float) 1x1 [-1]
-// #10: _Glossiness (medium float) 1x1 [-1]
-// #11: _OcclusionStrength (medium float) 1x1 [-1]
-// textures: 4
-// #0: unity_SpecCube0 (low cube) 0x0 [-1]
-// #1: _MainTex (low 2d) 0x0 [-1]
-// #2: _OcclusionMap (low 2d) 0x0 [-1]
-// #3: _ShadowMapTexture (low 2dshadow) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-outES3Metal.txt
deleted file mode 100644
index 1ded178e97a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/global-struct-constant-init-metal-outES3Metal.txt
+++ /dev/null
@@ -1,199 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less_equal);
-struct FragmentCommonData {
- half3 diffColor;
- half3 specColor;
- half oneMinusReflectivity;
- half oneMinusRoughness;
- half3 normalWorld;
- half3 eyeVec;
- half3 posWorld;
- half alpha;
-};
-constant FragmentCommonData _xlat_mtl_const1 = {float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), 0.0, 0.0, float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), float3(0.0, 0.0, 0.0), 0.0};
-struct xlatMtlShaderInput {
- float4 xlv_TEXCOORD0;
- half3 xlv_TEXCOORD1;
- half4 xlv_TEXCOORD2_2;
- half4 xlv_TEXCOORD5;
- half4 xlv_TEXCOORD6;
- half4 xlv_COLOR;
-};
-struct xlatMtlShaderOutput {
- half4 FragData_0 [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- half4 _WorldSpaceLightPos0;
- half4 unity_SHAr;
- half4 unity_SHAg;
- half4 unity_SHAb;
- half4 _LightShadowData;
- half4 unity_SpecCube0_HDR;
- half4 unity_ColorSpaceDielectricSpec;
- half4 _LightColor0;
- half4 _Color;
- half _Metallic;
- half _Glossiness;
- half _OcclusionStrength;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texturecube<half> unity_SpecCube0 [[texture(0)]], sampler _mtlsmp_unity_SpecCube0 [[sampler(0)]]
- , texture2d<half> _MainTex [[texture(1)]], sampler _mtlsmp__MainTex [[sampler(1)]]
- , texture2d<half> _OcclusionMap [[texture(2)]], sampler _mtlsmp__OcclusionMap [[sampler(2)]]
- , depth2d<float> _ShadowMapTexture [[texture(3)]], sampler _mtlsmp__ShadowMapTexture [[sampler(3)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- half atten_2 = 0;
- half4 tmpvar_3 = 0;
- tmpvar_3 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0.xy));
- half2 tmpvar_4 = 0;
- tmpvar_4.x = _mtl_u._Metallic;
- tmpvar_4.y = _mtl_u._Glossiness;
- half3 tmpvar_5 = 0;
- tmpvar_5 = (_mtl_u._Color.xyz * tmpvar_3.xyz);
- half3 tmpvar_6 = 0;
- half3 tmpvar_7 = 0;
- tmpvar_7 = mix (_mtl_u.unity_ColorSpaceDielectricSpec.xyz, tmpvar_5, half3(_mtl_u._Metallic));
- half tmpvar_8 = 0;
- tmpvar_8 = (_mtl_u.unity_ColorSpaceDielectricSpec.w - (_mtl_u._Metallic * _mtl_u.unity_ColorSpaceDielectricSpec.w));
- tmpvar_6 = (tmpvar_5 * tmpvar_8);
- half3 tmpvar_9 = 0;
- tmpvar_9 = normalize(_mtl_i.xlv_TEXCOORD2_2.xyz);
- half3 tmpvar_10 = 0;
- tmpvar_10 = normalize(_mtl_i.xlv_TEXCOORD1);
- half3 tmpvar_11 = 0;
- tmpvar_11 = _mtl_u._LightColor0.xyz;
- half shadow_12 = 0;
- half tmpvar_13 = 0;
- tmpvar_13 = _ShadowMapTexture.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.xlv_TEXCOORD6.xyz).xy, saturate((float)(_mtl_i.xlv_TEXCOORD6.xyz).z));
- half tmpvar_14 = 0;
- tmpvar_14 = tmpvar_13;
- shadow_12 = (_mtl_u._LightShadowData.x + (tmpvar_14 * ((half)(1.0) - _mtl_u._LightShadowData.x)));
- atten_2 = shadow_12;
- half occ_15 = 0;
- half tmpvar_16 = 0;
- tmpvar_16 = _OcclusionMap.sample(_mtlsmp__OcclusionMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).y;
- occ_15 = tmpvar_16;
- half tmpvar_17 = 0;
- tmpvar_17 = (((half)(1.0) - _mtl_u._OcclusionStrength) + (occ_15 * _mtl_u._OcclusionStrength));
- FragmentCommonData s_18;
- s_18 = _xlat_mtl_const1;
- s_18.oneMinusRoughness = tmpvar_4.y;
- s_18.normalWorld = tmpvar_9;
- s_18.eyeVec = tmpvar_10;
- s_18.posWorld = half3(float3(0.0, 0.0, 0.0));
- half3 tmpvar_19 = 0;
- half3 tmpvar_20 = 0;
- tmpvar_19 = s_18.normalWorld;
- tmpvar_20 = s_18.eyeVec;
- float4 tmpvar_21 = 0;
- tmpvar_21 = float4(_mtl_u.unity_SpecCube0_HDR);
- half tmpvar_22 = 0;
- tmpvar_22 = ((half)(1.0) - s_18.oneMinusRoughness);
- half3 tmpvar_23 = 0;
- tmpvar_23 = (tmpvar_20 - ((half)(2.0) * (
- dot (tmpvar_19, tmpvar_20)
- * tmpvar_19)));
- half4 tmpvar_24 = 0;
- tmpvar_24.w = half(1.0);
- tmpvar_24.xyz = tmpvar_19;
- half3 x_25 = 0;
- x_25.x = dot (_mtl_u.unity_SHAr, tmpvar_24);
- x_25.y = dot (_mtl_u.unity_SHAg, tmpvar_24);
- x_25.z = dot (_mtl_u.unity_SHAb, tmpvar_24);
- half4 hdr_26 = 0;
- hdr_26 = half4(tmpvar_21);
- half4 tmpvar_27 = 0;
- tmpvar_27.xyz = tmpvar_23;
- tmpvar_27.w = ((tmpvar_22 * ((half)(1.7) -
- ((half)(0.7) * tmpvar_22)
- )) * (half)(6.0));
- half4 tmpvar_28 = 0;
- tmpvar_28 = unity_SpecCube0.sample(_mtlsmp_unity_SpecCube0, (float3)(tmpvar_23), level(tmpvar_27.w));
- half4 tmpvar_29 = 0;
- tmpvar_29 = tmpvar_28;
- half3 viewDir_30 = 0;
- viewDir_30 = -(tmpvar_10);
- half3 tmpvar_31 = 0;
- half3 inVec_32 = 0;
- inVec_32 = (_mtl_u._WorldSpaceLightPos0.xyz + viewDir_30);
- tmpvar_31 = (inVec_32 * rsqrt(max ((half)0.001,
- dot (inVec_32, inVec_32)
- )));
- half tmpvar_33 = 0;
- tmpvar_33 = max ((half)0.0, dot (_mtl_u._WorldSpaceLightPos0.xyz, tmpvar_31));
- half tmpvar_34 = 0;
- tmpvar_34 = ((half)(1.0) - _mtl_u._Glossiness);
- half tmpvar_35 = 0;
- tmpvar_35 = max ((half)0.0001, (tmpvar_34 * tmpvar_34));
- half tmpvar_36 = 0;
- tmpvar_36 = max ((((half)(2.0) /
- (tmpvar_35 * tmpvar_35)
- ) - (half)(2.0)), (half)0.0001);
- half x_37 = 0;
- x_37 = ((half)(1.0) - max ((half)0.0, dot (tmpvar_9, viewDir_30)));
- half4 tmpvar_38 = 0;
- tmpvar_38.w = half(1.0);
- tmpvar_38.xyz = (((
- ((tmpvar_6 + (sqrt(
- max ((half)0.0001, (((tmpvar_36 + (half)(1.0)) * pow (
- max ((half)0.0, dot (tmpvar_9, tmpvar_31))
- , tmpvar_36)) / ((
- ((half)(8.0) * (((tmpvar_33 * tmpvar_33) * _mtl_u._Glossiness) + (tmpvar_34 * tmpvar_34)))
- * tmpvar_33) + (half)(0.0001))))
- ) * tmpvar_7)) * (tmpvar_11 * atten_2))
- *
- max ((half)0.0, dot (tmpvar_9, _mtl_u._WorldSpaceLightPos0.xyz))
- ) + (
- (max ((((half)(1.055) *
- pow (max ((half3)float3(0.0, 0.0, 0.0), (_mtl_i.xlv_TEXCOORD5.xyz + x_25)), (half3)float3(0.4166667, 0.4166667, 0.4166667))
- ) - (half)(0.055)), (half3)float3(0.0, 0.0, 0.0)) * tmpvar_17)
- * tmpvar_6)) + ((
- ((half)(1.0) - ((tmpvar_34 * tmpvar_34) * (tmpvar_34 * (half)(0.28))))
- *
- (((hdr_26.x * tmpvar_29.w) * tmpvar_29.xyz) * tmpvar_17)
- ) * mix (tmpvar_7, half3(
- clamp ((_mtl_u._Glossiness + ((half)(1.0) - tmpvar_8)), (half)0.0, (half)1.0)
- ), half3(
- ((x_37 * x_37) * (x_37 * x_37))
- ))));
- c_1 = (tmpvar_38 * _mtl_i.xlv_COLOR);
- c_1.xyz = c_1.xyz;
- c_1.xyz = c_1.xyz;
- half4 xlat_varoutput_39 = 0;
- xlat_varoutput_39.xyz = c_1.xyz;
- xlat_varoutput_39.w = half(1.0);
- _mtl_o.FragData_0 = xlat_varoutput_39;
- return _mtl_o;
-}
-
-
-// stats: 97 alu 4 tex 0 flow
-// inputs: 6
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// #1: xlv_TEXCOORD1 (medium float) 3x1 [-1]
-// #2: xlv_TEXCOORD2_2 (medium float) 4x1 [-1]
-// #3: xlv_TEXCOORD5 (medium float) 4x1 [-1]
-// #4: xlv_TEXCOORD6 (medium float) 4x1 [-1]
-// #5: xlv_COLOR (low float) 4x1 [-1]
-// uniforms: 12 (total size: 78)
-// #0: _WorldSpaceLightPos0 (medium float) 4x1 [-1] loc 0
-// #1: unity_SHAr (medium float) 4x1 [-1] loc 8
-// #2: unity_SHAg (medium float) 4x1 [-1] loc 16
-// #3: unity_SHAb (medium float) 4x1 [-1] loc 24
-// #4: _LightShadowData (medium float) 4x1 [-1] loc 32
-// #5: unity_SpecCube0_HDR (medium float) 4x1 [-1] loc 40
-// #6: unity_ColorSpaceDielectricSpec (medium float) 4x1 [-1] loc 48
-// #7: _LightColor0 (low float) 4x1 [-1] loc 56
-// #8: _Color (medium float) 4x1 [-1] loc 64
-// #9: _Metallic (medium float) 1x1 [-1] loc 72
-// #10: _Glossiness (medium float) 1x1 [-1] loc 74
-// #11: _OcclusionStrength (medium float) 1x1 [-1] loc 76
-// textures: 4
-// #0: unity_SpecCube0 (low cube) 0x0 [-1] loc 0
-// #1: _MainTex (low 2d) 0x0 [-1] loc 1
-// #2: _OcclusionMap (low 2d) 0x0 [-1] loc 2
-// #3: _ShadowMapTexture (low 2dshadow) 0x0 [-1] loc 3
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-in.txt
deleted file mode 100644
index e5a4e771bc8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-in.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-#version 120
-
-uniform float inInit = 13.0; // accept uniform initializers
-uniform mat4x3 nonSqMat; // non square matrices
-uniform vec4 uniInit = vec4(1.0,2.0,3.0,4.0);
-
-void main()
-{
- const float cosPI = cos(3.1415); // built-in calls in constant initializers
-
- vec4 v;
- v.x = 1.2f; // accepts 'f' suffix
- v.y = 5; // automatic int-to-float
- v.z = inInit;
- v.w = cosPI;
- v.x += nonSqMat[0][0];
-
- float arr[4] = float[](1,2,3,4); // array initializer
- v.y += arr[0];
- v.z += arr.length(); // array length
-
- v.w += uniInit.w;
-
- gl_FragColor = v;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-inES3.txt
deleted file mode 100644
index f5aeeccae58..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-inES3.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-
-uniform mat4x3 nonSqMat; // non square matrices
-
-
-void main()
-{
- const float cosPI = cos(3.1415); // built-in calls in constant initializers
-
- mediump vec4 v;
- v.x = 1.2f; // accepts 'f' suffix
- v.y = 5.0f;
- v.z = 0.0;
- v.w = cosPI;
- v.x += nonSqMat[0][0];
-
- float arr[4] = float[](1,2,3,4); // array initializer
- v.y += arr[0];
- v.z += float(arr.length()); // array length
-
- _fragData = v;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-out.txt
deleted file mode 100644
index d3f9ca6c94f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-out.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-#version 120
-uniform float inInit = 13.0;
-uniform mat4x3 nonSqMat;
-uniform vec4 uniInit = vec4(1.0, 2.0, 3.0, 4.0);
-void main ()
-{
- vec4 v_1;
- v_1.x = (1.2 + nonSqMat[0].x);
- v_1.y = 6.0;
- v_1.z = (inInit + 4.0);
- v_1.w = (-1.0 + uniInit.w);
- gl_FragColor = v_1;
-}
-
-
-// stats: 4 alu 0 tex 0 flow
-// uniforms: 3 (total size: 0)
-// #0: inInit (high float) 1x1 [-1]
-// #1: nonSqMat (high float) 3x4 [-1]
-// #2: uniInit (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3.txt
deleted file mode 100644
index ec264248e9a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-uniform highp mat4x3 nonSqMat;
-void main ()
-{
- mediump vec4 v_1;
- v_1.w = -1.0;
- v_1.x = (1.2 + nonSqMat[0].x);
- v_1.y = 6.0;
- v_1.z = 4.0;
- _fragData = v_1;
-}
-
-
-// stats: 4 alu 0 tex 0 flow
-// uniforms: 1 (total size: 0)
-// #0: nonSqMat (high float) 3x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3Metal.txt
deleted file mode 100644
index f8b9ff1d2d9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl120-basic-outES3Metal.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- float4x3 nonSqMat;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 v_1 = 0;
- v_1.w = half(-1.0);
- v_1.x = ((half)(1.2 + _mtl_u.nonSqMat[0].x));
- v_1.y = half(6.0);
- v_1.z = half(4.0);
- _mtl_o._fragData = v_1;
- return _mtl_o;
-}
-
-
-// stats: 4 alu 0 tex 0 flow
-// uniforms: 1 (total size: 64)
-// #0: nonSqMat (high float) 3x4 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-in.txt
deleted file mode 100644
index 29c2a9e923c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-in.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-#version 140
-
-in vec4 col;
-
-out vec4 fragCol;
-
-void main(void)
-{
- fragCol = col;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-out.txt
deleted file mode 100644
index 5ea193bde5a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/glsl140-basic-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-#version 140
-in vec4 col;
-out vec4 fragCol;
-void main ()
-{
- fragCol = col;
-}
-
-
-// stats: 0 alu 0 tex 0 flow
-// inputs: 1
-// #0: col (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-in.txt
deleted file mode 100644
index e0909a22860..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-in.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec4 color;
-};
-vec4 xlat_main( in v2f i );
-vec4 xlat_main( in v2f i ) {
- vec4 c;
- c = i.color;
- c.xy += i.uv;
- return c;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xlt_i.color = vec4( gl_Color);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-inES.txt
deleted file mode 100644
index 1a689316b04..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-inES.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-struct v2f {
- highp vec4 pos;
- highp vec2 uv;
- highp vec4 color;
-};
-mediump vec4 xlat_main( in v2f i );
-mediump vec4 xlat_main( in v2f i ) {
- mediump vec4 c;
- c = i.color;
- c.xy += i.uv;
- return c;
-}
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec4 xlv_COLOR;
-void main() {
- mediump vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( xlv_TEXCOORD0);
- xlt_i.color = vec4( xlv_COLOR);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-out.txt
deleted file mode 100644
index 996cffa2b2c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-out.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-void main ()
-{
- vec4 c_1;
- c_1.zw = gl_Color.zw;
- c_1.xy = (gl_Color.xy + gl_TexCoord[0].xy);
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [1] loc 4
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-outES.txt
deleted file mode 100644
index e4836bef248..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-struct-ret-vals-outES.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec4 xlv_COLOR;
-void main ()
-{
- mediump vec4 c_1;
- c_1 = xlv_COLOR;
- c_1.xy = (c_1.xy + xlv_TEXCOORD0);
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_COLOR (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-inES.txt
deleted file mode 100644
index da759bf6260..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-inES.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-mediump vec4 xlat_main( in highp vec2 uv, in highp vec4 color );
-mediump vec4 xlat_main( in highp vec2 uv, in highp vec4 color ) {
- mediump vec4 c;
- c = color;
- c.xy += uv;
- return c;
-}
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec4 xlv_COLOR;
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( vec2(xlv_TEXCOORD0), vec4(xlv_COLOR));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-outES.txt
deleted file mode 100644
index e4836bef248..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/in-vals-ret-vals-outES.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec4 xlv_COLOR;
-void main ()
-{
- mediump vec4 c_1;
- c_1 = xlv_COLOR;
- c_1.xy = (c_1.xy + xlv_TEXCOORD0);
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_COLOR (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-in.txt
deleted file mode 100644
index c612ba68937..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-in.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-float xll_mod( float x, float y ) {
- float d = x / y;
- float f = fract (abs(d)) * y;
- return d >= 0.0 ? f : -f;
-}
-vec2 xll_mod( vec2 x, vec2 y ) {
- vec2 d = x / y;
- vec2 f = fract (abs(d)) * y;
- return vec2 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y);
-}
-vec3 xll_mod( vec3 x, vec3 y ) {
- vec3 d = x / y;
- vec3 f = fract (abs(d)) * y;
- return vec3 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z);
-}
-vec4 xll_mod( vec4 x, vec4 y ) {
- vec4 d = x / y;
- vec4 f = fract (abs(d)) * y;
- return vec4 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z, d.w >= 0.0 ? f.w : -f.w);
-}
-float xll_modf( float x, out int ip) {
- ip = int (x);
- return x-float(ip);
-}
-float xll_modf( float x, out float ip) {
- int i = int (x);
- ip = float(i);
- return x-ip;
-}
-vec2 xll_modf( vec2 x, out ivec2 ip) {
- ip = ivec2 (x);
- return x-vec2(ip);
-}
-vec2 xll_modf( vec2 x, out vec2 ip) {
- ivec2 i = ivec2 (x);
- ip = vec2(i);
- return x-ip;
-}
-vec3 xll_modf( vec3 x, out ivec3 ip) {
- ip = ivec3 (x);
- return x-vec3(ip);
-}
-vec3 xll_modf( vec3 x, out vec3 ip) {
- ivec3 i = ivec3 (x);
- ip = vec3(i);
- return x-ip;
-}
-vec4 xll_modf( vec4 x, out ivec4 ip) {
- ip = ivec4 (x);
- return x-vec4(ip);
-}
-vec4 xll_modf( vec4 x, out vec4 ip) {
- ivec4 i = ivec4 (x);
- ip = vec4(i);
- return x-ip;
-}
-vec4 xlat_main( in vec4 uv );
-vec4 xlat_main( in vec4 uv ) {
- vec4 c;
- vec4 d;
- c = vec4( 0.000000);
- c.x += xll_mod( uv.x , 2.00000);
- c.xy += xll_mod( uv.xy , vec2( 2.00000));
- c.xyz += xll_mod( uv.xyz , vec3( 2.00000));
- c.xyzw += xll_mod( uv.xyzw , vec4( 2.00000));
- c.x += xll_modf( uv.x , d.x );
- c.xy += xll_modf( uv.xy , d.xy );
- c.xyz += xll_modf( uv.xyz , d.xyz );
- c.xyzw += xll_modf( uv.xyzw , d.xyzw );
- return c;
-}
-varying vec4 xlv_TEXCOORD0;
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES.txt
deleted file mode 100644
index aa6db210293..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-float xll_mod( float x, float y ) {
- float d = x / y;
- float f = fract (abs(d)) * y;
- return d >= 0.0 ? f : -f;
-}
-vec2 xll_mod( vec2 x, vec2 y ) {
- vec2 d = x / y;
- vec2 f = fract (abs(d)) * y;
- return vec2 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y);
-}
-vec3 xll_mod( vec3 x, vec3 y ) {
- vec3 d = x / y;
- vec3 f = fract (abs(d)) * y;
- return vec3 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z);
-}
-vec4 xll_mod( vec4 x, vec4 y ) {
- vec4 d = x / y;
- vec4 f = fract (abs(d)) * y;
- return vec4 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z, d.w >= 0.0 ? f.w : -f.w);
-}
-float xll_modf( float x, out int ip) {
- ip = int (x);
- return x-float(ip);
-}
-float xll_modf( float x, out float ip) {
- int i = int (x);
- ip = float(i);
- return x-ip;
-}
-vec2 xll_modf( vec2 x, out ivec2 ip) {
- ip = ivec2 (x);
- return x-vec2(ip);
-}
-vec2 xll_modf( vec2 x, out vec2 ip) {
- ivec2 i = ivec2 (x);
- ip = vec2(i);
- return x-ip;
-}
-vec3 xll_modf( vec3 x, out ivec3 ip) {
- ip = ivec3 (x);
- return x-vec3(ip);
-}
-vec3 xll_modf( vec3 x, out vec3 ip) {
- ivec3 i = ivec3 (x);
- ip = vec3(i);
- return x-ip;
-}
-vec4 xll_modf( vec4 x, out ivec4 ip) {
- ip = ivec4 (x);
- return x-vec4(ip);
-}
-vec4 xll_modf( vec4 x, out vec4 ip) {
- ivec4 i = ivec4 (x);
- ip = vec4(i);
- return x-ip;
-}
-mediump vec4 xlat_main( in highp vec4 uv );
-mediump vec4 xlat_main( in highp vec4 uv ) {
- mediump vec4 c;
- mediump vec4 d;
- c = vec4( 0.000000);
- c.x += xll_mod( uv.x , 2.00000);
- c.xy += xll_mod( uv.xy , vec2( 2.00000));
- c.xyz += xll_mod( uv.xyz , vec3( 2.00000));
- c.xyzw += xll_mod( uv.xyzw , vec4( 2.00000));
- c.x += xll_modf( uv.x , d.x );
- c.xy += xll_modf( uv.xy , d.xy );
- c.xyz += xll_modf( uv.xyz , d.xyz );
- c.xyzw += xll_modf( uv.xyzw , d.xyzw );
- return c;
-}
-varying highp vec4 xlv_TEXCOORD0;
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt
deleted file mode 100644
index 4baed65149b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-inES3.txt
+++ /dev/null
@@ -1,97 +0,0 @@
-#version 300 es
-float xll_mod( float x, float y ) {
- float d = x / y;
- float f = fract (abs(d)) * y;
- return d >= 0.0 ? f : -f;
-}
-vec2 xll_mod( vec2 x, vec2 y ) {
- vec2 d = x / y;
- vec2 f = fract (abs(d)) * y;
- return vec2 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y);
-}
-vec3 xll_mod( vec3 x, vec3 y ) {
- vec3 d = x / y;
- vec3 f = fract (abs(d)) * y;
- return vec3 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z);
-}
-vec4 xll_mod( vec4 x, vec4 y ) {
- vec4 d = x / y;
- vec4 f = fract (abs(d)) * y;
- return vec4 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z, d.w >= 0.0 ? f.w : -f.w);
-}
-float xll_modf( float x, out int ip) {
- ip = int (x);
- return x-float(ip);
-}
-float xll_modf( float x, out float ip) {
- int i = int (x);
- ip = float(i);
- return x-ip;
-}
-vec2 xll_modf( vec2 x, out ivec2 ip) {
- ip = ivec2 (x);
- return x-vec2(ip);
-}
-vec2 xll_modf( vec2 x, out vec2 ip) {
- ivec2 i = ivec2 (x);
- ip = vec2(i);
- return x-ip;
-}
-vec3 xll_modf( vec3 x, out ivec3 ip) {
- ip = ivec3 (x);
- return x-vec3(ip);
-}
-vec3 xll_modf( vec3 x, out vec3 ip) {
- ivec3 i = ivec3 (x);
- ip = vec3(i);
- return x-ip;
-}
-vec4 xll_modf( vec4 x, out ivec4 ip) {
- ip = ivec4 (x);
- return x-vec4(ip);
-}
-vec4 xll_modf( vec4 x, out vec4 ip) {
- ivec4 i = ivec4 (x);
- ip = vec4(i);
- return x-ip;
-}
-
-mediump vec4 xlat_main (in highp vec4 uv)
-{
- mediump vec4 c;
- mediump vec4 d;
- c = vec4( 0.000000);
- c.x += xll_mod( uv.x , 2.00000);
- c.xy += xll_mod( uv.xy , vec2( 2.00000));
- c.xyz += xll_mod( uv.xyz , vec3( 2.00000));
- c.xyzw += xll_mod( uv.xyzw , vec4( 2.00000));
- c.x += xll_modf( uv.x , d.x );
- c.xy += xll_modf( uv.xy , d.xy );
- c.xyz += xll_modf( uv.xyz , d.xyz );
- c.xyzw += xll_modf( uv.xyzw , d.xyzw );
-
- // GLSL mod function
- c.x += mod(uv.x, d.x);
- c.xy += mod(uv.xy, d.xy);
- c.xyz += mod(uv.xyz, d.xyz);
-
- // inverse
- c.x += 1.0/uv.x; // float
- c.x += max(0.0, 1.0/uv.x);
-
- c.y += 1.0/c.z; // half
- c.y += max(0.0, 1.0/c.w);
-
- // max with different precision arguments
- c.x += max(uv.x, c.z);
-
- return c;
-}
-
-in highp vec4 xlv_TEXCOORD0;
-out mediump vec4 _fragData;
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- _fragData = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-out.txt
deleted file mode 100644
index 49d36f8df26..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-out.txt
+++ /dev/null
@@ -1,116 +0,0 @@
-varying vec4 xlv_TEXCOORD0;
-void main ()
-{
- vec4 c_1;
- c_1 = vec4(0.0, 0.0, 0.0, 0.0);
- float tmpvar_2;
- tmpvar_2 = (xlv_TEXCOORD0.x / 2.0);
- float tmpvar_3;
- tmpvar_3 = (fract(abs(tmpvar_2)) * 2.0);
- float tmpvar_4;
- if ((tmpvar_2 >= 0.0)) {
- tmpvar_4 = tmpvar_3;
- } else {
- tmpvar_4 = -(tmpvar_3);
- };
- c_1.x = tmpvar_4;
- vec2 tmpvar_5;
- tmpvar_5 = (xlv_TEXCOORD0.xy / vec2(2.0, 2.0));
- vec2 tmpvar_6;
- tmpvar_6 = (fract(abs(tmpvar_5)) * vec2(2.0, 2.0));
- float tmpvar_7;
- if ((tmpvar_5.x >= 0.0)) {
- tmpvar_7 = tmpvar_6.x;
- } else {
- tmpvar_7 = -(tmpvar_6.x);
- };
- float tmpvar_8;
- if ((tmpvar_5.y >= 0.0)) {
- tmpvar_8 = tmpvar_6.y;
- } else {
- tmpvar_8 = -(tmpvar_6.y);
- };
- vec2 tmpvar_9;
- tmpvar_9.x = tmpvar_7;
- tmpvar_9.y = tmpvar_8;
- c_1.xy = (c_1.xy + tmpvar_9);
- vec3 tmpvar_10;
- tmpvar_10 = (xlv_TEXCOORD0.xyz / vec3(2.0, 2.0, 2.0));
- vec3 tmpvar_11;
- tmpvar_11 = (fract(abs(tmpvar_10)) * vec3(2.0, 2.0, 2.0));
- float tmpvar_12;
- if ((tmpvar_10.x >= 0.0)) {
- tmpvar_12 = tmpvar_11.x;
- } else {
- tmpvar_12 = -(tmpvar_11.x);
- };
- float tmpvar_13;
- if ((tmpvar_10.y >= 0.0)) {
- tmpvar_13 = tmpvar_11.y;
- } else {
- tmpvar_13 = -(tmpvar_11.y);
- };
- float tmpvar_14;
- if ((tmpvar_10.z >= 0.0)) {
- tmpvar_14 = tmpvar_11.z;
- } else {
- tmpvar_14 = -(tmpvar_11.z);
- };
- vec3 tmpvar_15;
- tmpvar_15.x = tmpvar_12;
- tmpvar_15.y = tmpvar_13;
- tmpvar_15.z = tmpvar_14;
- c_1.xyz = (c_1.xyz + tmpvar_15);
- vec4 tmpvar_16;
- tmpvar_16 = (xlv_TEXCOORD0 / vec4(2.0, 2.0, 2.0, 2.0));
- vec4 tmpvar_17;
- tmpvar_17 = (fract(abs(tmpvar_16)) * vec4(2.0, 2.0, 2.0, 2.0));
- float tmpvar_18;
- if ((tmpvar_16.x >= 0.0)) {
- tmpvar_18 = tmpvar_17.x;
- } else {
- tmpvar_18 = -(tmpvar_17.x);
- };
- float tmpvar_19;
- if ((tmpvar_16.y >= 0.0)) {
- tmpvar_19 = tmpvar_17.y;
- } else {
- tmpvar_19 = -(tmpvar_17.y);
- };
- float tmpvar_20;
- if ((tmpvar_16.z >= 0.0)) {
- tmpvar_20 = tmpvar_17.z;
- } else {
- tmpvar_20 = -(tmpvar_17.z);
- };
- float tmpvar_21;
- if ((tmpvar_16.w >= 0.0)) {
- tmpvar_21 = tmpvar_17.w;
- } else {
- tmpvar_21 = -(tmpvar_17.w);
- };
- vec4 tmpvar_22;
- tmpvar_22.x = tmpvar_18;
- tmpvar_22.y = tmpvar_19;
- tmpvar_22.z = tmpvar_20;
- tmpvar_22.w = tmpvar_21;
- c_1 = (c_1 + tmpvar_22);
- c_1.x = (c_1.x + (xlv_TEXCOORD0.x - float(
- int(xlv_TEXCOORD0.x)
- )));
- c_1.xy = (c_1.xy + (xlv_TEXCOORD0.xy - vec2(
- ivec2(xlv_TEXCOORD0.xy)
- )));
- c_1.xyz = (c_1.xyz + (xlv_TEXCOORD0.xyz - vec3(
- ivec3(xlv_TEXCOORD0.xyz)
- )));
- c_1 = (c_1 + (xlv_TEXCOORD0 - vec4(
- ivec4(xlv_TEXCOORD0)
- )));
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 56 alu 0 tex 10 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt
deleted file mode 100644
index cb1132829d9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES.txt
+++ /dev/null
@@ -1,132 +0,0 @@
-varying highp vec4 xlv_TEXCOORD0;
-void main ()
-{
- mediump vec4 c_1;
- c_1 = vec4(0.0, 0.0, 0.0, 0.0);
- highp float tmpvar_2;
- tmpvar_2 = (xlv_TEXCOORD0.x / 2.0);
- highp float tmpvar_3;
- tmpvar_3 = (fract(abs(tmpvar_2)) * 2.0);
- highp float tmpvar_4;
- if ((tmpvar_2 >= 0.0)) {
- tmpvar_4 = tmpvar_3;
- } else {
- tmpvar_4 = -(tmpvar_3);
- };
- c_1.x = tmpvar_4;
- highp vec2 tmpvar_5;
- tmpvar_5 = (xlv_TEXCOORD0.xy / vec2(2.0, 2.0));
- highp vec2 tmpvar_6;
- tmpvar_6 = (fract(abs(tmpvar_5)) * vec2(2.0, 2.0));
- highp float tmpvar_7;
- if ((tmpvar_5.x >= 0.0)) {
- tmpvar_7 = tmpvar_6.x;
- } else {
- tmpvar_7 = -(tmpvar_6.x);
- };
- highp float tmpvar_8;
- if ((tmpvar_5.y >= 0.0)) {
- tmpvar_8 = tmpvar_6.y;
- } else {
- tmpvar_8 = -(tmpvar_6.y);
- };
- highp vec2 tmpvar_9;
- tmpvar_9.x = tmpvar_7;
- tmpvar_9.y = tmpvar_8;
- c_1.xy = (c_1.xy + tmpvar_9);
- highp vec3 tmpvar_10;
- tmpvar_10 = (xlv_TEXCOORD0.xyz / vec3(2.0, 2.0, 2.0));
- highp vec3 tmpvar_11;
- tmpvar_11 = (fract(abs(tmpvar_10)) * vec3(2.0, 2.0, 2.0));
- highp float tmpvar_12;
- if ((tmpvar_10.x >= 0.0)) {
- tmpvar_12 = tmpvar_11.x;
- } else {
- tmpvar_12 = -(tmpvar_11.x);
- };
- highp float tmpvar_13;
- if ((tmpvar_10.y >= 0.0)) {
- tmpvar_13 = tmpvar_11.y;
- } else {
- tmpvar_13 = -(tmpvar_11.y);
- };
- highp float tmpvar_14;
- if ((tmpvar_10.z >= 0.0)) {
- tmpvar_14 = tmpvar_11.z;
- } else {
- tmpvar_14 = -(tmpvar_11.z);
- };
- highp vec3 tmpvar_15;
- tmpvar_15.x = tmpvar_12;
- tmpvar_15.y = tmpvar_13;
- tmpvar_15.z = tmpvar_14;
- c_1.xyz = (c_1.xyz + tmpvar_15);
- highp vec4 tmpvar_16;
- tmpvar_16 = (xlv_TEXCOORD0 / vec4(2.0, 2.0, 2.0, 2.0));
- highp vec4 tmpvar_17;
- tmpvar_17 = (fract(abs(tmpvar_16)) * vec4(2.0, 2.0, 2.0, 2.0));
- highp float tmpvar_18;
- if ((tmpvar_16.x >= 0.0)) {
- tmpvar_18 = tmpvar_17.x;
- } else {
- tmpvar_18 = -(tmpvar_17.x);
- };
- highp float tmpvar_19;
- if ((tmpvar_16.y >= 0.0)) {
- tmpvar_19 = tmpvar_17.y;
- } else {
- tmpvar_19 = -(tmpvar_17.y);
- };
- highp float tmpvar_20;
- if ((tmpvar_16.z >= 0.0)) {
- tmpvar_20 = tmpvar_17.z;
- } else {
- tmpvar_20 = -(tmpvar_17.z);
- };
- highp float tmpvar_21;
- if ((tmpvar_16.w >= 0.0)) {
- tmpvar_21 = tmpvar_17.w;
- } else {
- tmpvar_21 = -(tmpvar_17.w);
- };
- highp vec4 tmpvar_22;
- tmpvar_22.x = tmpvar_18;
- tmpvar_22.y = tmpvar_19;
- tmpvar_22.z = tmpvar_20;
- tmpvar_22.w = tmpvar_21;
- c_1 = (c_1 + tmpvar_22);
- highp float tmpvar_23;
- mediump float ip_24;
- highp int tmpvar_25;
- tmpvar_25 = int(xlv_TEXCOORD0.x);
- ip_24 = float(tmpvar_25);
- tmpvar_23 = (xlv_TEXCOORD0.x - ip_24);
- c_1.x = (c_1.x + tmpvar_23);
- highp vec2 tmpvar_26;
- highp ivec2 tmpvar_27;
- tmpvar_27 = ivec2(xlv_TEXCOORD0.xy);
- mediump vec2 tmpvar_28;
- tmpvar_28 = vec2(tmpvar_27);
- tmpvar_26 = (xlv_TEXCOORD0.xy - tmpvar_28);
- c_1.xy = (c_1.xy + tmpvar_26);
- highp vec3 tmpvar_29;
- highp ivec3 tmpvar_30;
- tmpvar_30 = ivec3(xlv_TEXCOORD0.xyz);
- mediump vec3 tmpvar_31;
- tmpvar_31 = vec3(tmpvar_30);
- tmpvar_29 = (xlv_TEXCOORD0.xyz - tmpvar_31);
- c_1.xyz = (c_1.xyz + tmpvar_29);
- highp vec4 tmpvar_32;
- highp ivec4 tmpvar_33;
- tmpvar_33 = ivec4(xlv_TEXCOORD0);
- mediump vec4 tmpvar_34;
- tmpvar_34 = vec4(tmpvar_33);
- tmpvar_32 = (xlv_TEXCOORD0 - tmpvar_34);
- c_1 = (c_1 + tmpvar_32);
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 56 alu 0 tex 10 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt
deleted file mode 100644
index 46cd23f7ce7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3.txt
+++ /dev/null
@@ -1,154 +0,0 @@
-#version 300 es
-in highp vec4 xlv_TEXCOORD0;
-out mediump vec4 _fragData;
-void main ()
-{
- mediump vec4 c_1;
- c_1 = vec4(0.0, 0.0, 0.0, 0.0);
- highp float tmpvar_2;
- tmpvar_2 = (xlv_TEXCOORD0.x / 2.0);
- highp float tmpvar_3;
- tmpvar_3 = (fract(abs(tmpvar_2)) * 2.0);
- highp float tmpvar_4;
- if ((tmpvar_2 >= 0.0)) {
- tmpvar_4 = tmpvar_3;
- } else {
- tmpvar_4 = -(tmpvar_3);
- };
- c_1.x = tmpvar_4;
- highp vec2 tmpvar_5;
- tmpvar_5 = (xlv_TEXCOORD0.xy / vec2(2.0, 2.0));
- highp vec2 tmpvar_6;
- tmpvar_6 = (fract(abs(tmpvar_5)) * vec2(2.0, 2.0));
- highp float tmpvar_7;
- if ((tmpvar_5.x >= 0.0)) {
- tmpvar_7 = tmpvar_6.x;
- } else {
- tmpvar_7 = -(tmpvar_6.x);
- };
- highp float tmpvar_8;
- if ((tmpvar_5.y >= 0.0)) {
- tmpvar_8 = tmpvar_6.y;
- } else {
- tmpvar_8 = -(tmpvar_6.y);
- };
- highp vec2 tmpvar_9;
- tmpvar_9.x = tmpvar_7;
- tmpvar_9.y = tmpvar_8;
- c_1.xy = (c_1.xy + tmpvar_9);
- highp vec3 tmpvar_10;
- tmpvar_10 = (xlv_TEXCOORD0.xyz / vec3(2.0, 2.0, 2.0));
- highp vec3 tmpvar_11;
- tmpvar_11 = (fract(abs(tmpvar_10)) * vec3(2.0, 2.0, 2.0));
- highp float tmpvar_12;
- if ((tmpvar_10.x >= 0.0)) {
- tmpvar_12 = tmpvar_11.x;
- } else {
- tmpvar_12 = -(tmpvar_11.x);
- };
- highp float tmpvar_13;
- if ((tmpvar_10.y >= 0.0)) {
- tmpvar_13 = tmpvar_11.y;
- } else {
- tmpvar_13 = -(tmpvar_11.y);
- };
- highp float tmpvar_14;
- if ((tmpvar_10.z >= 0.0)) {
- tmpvar_14 = tmpvar_11.z;
- } else {
- tmpvar_14 = -(tmpvar_11.z);
- };
- highp vec3 tmpvar_15;
- tmpvar_15.x = tmpvar_12;
- tmpvar_15.y = tmpvar_13;
- tmpvar_15.z = tmpvar_14;
- c_1.xyz = (c_1.xyz + tmpvar_15);
- highp vec4 tmpvar_16;
- tmpvar_16 = (xlv_TEXCOORD0 / vec4(2.0, 2.0, 2.0, 2.0));
- highp vec4 tmpvar_17;
- tmpvar_17 = (fract(abs(tmpvar_16)) * vec4(2.0, 2.0, 2.0, 2.0));
- highp float tmpvar_18;
- if ((tmpvar_16.x >= 0.0)) {
- tmpvar_18 = tmpvar_17.x;
- } else {
- tmpvar_18 = -(tmpvar_17.x);
- };
- highp float tmpvar_19;
- if ((tmpvar_16.y >= 0.0)) {
- tmpvar_19 = tmpvar_17.y;
- } else {
- tmpvar_19 = -(tmpvar_17.y);
- };
- highp float tmpvar_20;
- if ((tmpvar_16.z >= 0.0)) {
- tmpvar_20 = tmpvar_17.z;
- } else {
- tmpvar_20 = -(tmpvar_17.z);
- };
- highp float tmpvar_21;
- if ((tmpvar_16.w >= 0.0)) {
- tmpvar_21 = tmpvar_17.w;
- } else {
- tmpvar_21 = -(tmpvar_17.w);
- };
- highp vec4 tmpvar_22;
- tmpvar_22.x = tmpvar_18;
- tmpvar_22.y = tmpvar_19;
- tmpvar_22.z = tmpvar_20;
- tmpvar_22.w = tmpvar_21;
- c_1 = (c_1 + tmpvar_22);
- highp float tmpvar_23;
- mediump float ip_24;
- highp int tmpvar_25;
- tmpvar_25 = int(xlv_TEXCOORD0.x);
- ip_24 = float(tmpvar_25);
- tmpvar_23 = (xlv_TEXCOORD0.x - ip_24);
- c_1.x = (c_1.x + tmpvar_23);
- highp vec2 tmpvar_26;
- highp ivec2 tmpvar_27;
- tmpvar_27 = ivec2(xlv_TEXCOORD0.xy);
- mediump vec2 tmpvar_28;
- tmpvar_28 = vec2(tmpvar_27);
- tmpvar_26 = (xlv_TEXCOORD0.xy - tmpvar_28);
- c_1.xy = (c_1.xy + tmpvar_26);
- highp vec3 tmpvar_29;
- highp ivec3 tmpvar_30;
- tmpvar_30 = ivec3(xlv_TEXCOORD0.xyz);
- mediump vec3 tmpvar_31;
- tmpvar_31 = vec3(tmpvar_30);
- tmpvar_29 = (xlv_TEXCOORD0.xyz - tmpvar_31);
- c_1.xyz = (c_1.xyz + tmpvar_29);
- highp vec4 tmpvar_32;
- highp ivec4 tmpvar_33;
- tmpvar_33 = ivec4(xlv_TEXCOORD0);
- mediump vec4 tmpvar_34;
- tmpvar_34 = vec4(tmpvar_33);
- tmpvar_32 = (xlv_TEXCOORD0 - tmpvar_34);
- c_1 = (c_1 + tmpvar_32);
- highp float tmpvar_35;
- tmpvar_35 = (float(mod (xlv_TEXCOORD0.x, tmpvar_34.x)));
- c_1.x = (c_1.x + tmpvar_35);
- highp vec2 tmpvar_36;
- tmpvar_36 = (vec2(mod (xlv_TEXCOORD0.xy, tmpvar_34.xy)));
- c_1.xy = (c_1.xy + tmpvar_36);
- highp vec3 tmpvar_37;
- tmpvar_37 = (vec3(mod (xlv_TEXCOORD0.xyz, tmpvar_34.xyz)));
- c_1.xyz = (c_1.xyz + tmpvar_37);
- highp float tmpvar_38;
- tmpvar_38 = (1.0/(xlv_TEXCOORD0.x));
- c_1.x = (c_1.x + tmpvar_38);
- highp float tmpvar_39;
- tmpvar_39 = max (0.0, tmpvar_38);
- c_1.x = (c_1.x + tmpvar_39);
- c_1.y = (c_1.y + (1.0/(c_1.z)));
- c_1.y = (c_1.y + max (0.0, (1.0/(c_1.w))));
- highp float tmpvar_40;
- tmpvar_40 = max (xlv_TEXCOORD0.x, c_1.z);
- c_1.x = (c_1.x + tmpvar_40);
- _fragData = c_1;
-}
-
-
-// stats: 73 alu 0 tex 10 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt
deleted file mode 100644
index b00448b0232..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/intrinsics-outES3Metal.txt
+++ /dev/null
@@ -1,164 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 xlv_TEXCOORD0;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- c_1 = half4(float4(0.0, 0.0, 0.0, 0.0));
- float tmpvar_2 = 0;
- tmpvar_2 = (_mtl_i.xlv_TEXCOORD0.x / 2.0);
- float tmpvar_3 = 0;
- tmpvar_3 = (fract(abs(tmpvar_2)) * 2.0);
- float tmpvar_4 = 0;
- if ((tmpvar_2 >= 0.0)) {
- tmpvar_4 = tmpvar_3;
- } else {
- tmpvar_4 = -(tmpvar_3);
- };
- c_1.x = half(tmpvar_4);
- float2 tmpvar_5 = 0;
- tmpvar_5 = (_mtl_i.xlv_TEXCOORD0.xy / float2(2.0, 2.0));
- float2 tmpvar_6 = 0;
- tmpvar_6 = (fract(abs(tmpvar_5)) * float2(2.0, 2.0));
- float tmpvar_7 = 0;
- if ((tmpvar_5.x >= 0.0)) {
- tmpvar_7 = tmpvar_6.x;
- } else {
- tmpvar_7 = -(tmpvar_6.x);
- };
- float tmpvar_8 = 0;
- if ((tmpvar_5.y >= 0.0)) {
- tmpvar_8 = tmpvar_6.y;
- } else {
- tmpvar_8 = -(tmpvar_6.y);
- };
- float2 tmpvar_9 = 0;
- tmpvar_9.x = tmpvar_7;
- tmpvar_9.y = tmpvar_8;
- c_1.xy = ((half2)((float2)(c_1.xy) + tmpvar_9));
- float3 tmpvar_10 = 0;
- tmpvar_10 = (_mtl_i.xlv_TEXCOORD0.xyz / float3(2.0, 2.0, 2.0));
- float3 tmpvar_11 = 0;
- tmpvar_11 = (fract(abs(tmpvar_10)) * float3(2.0, 2.0, 2.0));
- float tmpvar_12 = 0;
- if ((tmpvar_10.x >= 0.0)) {
- tmpvar_12 = tmpvar_11.x;
- } else {
- tmpvar_12 = -(tmpvar_11.x);
- };
- float tmpvar_13 = 0;
- if ((tmpvar_10.y >= 0.0)) {
- tmpvar_13 = tmpvar_11.y;
- } else {
- tmpvar_13 = -(tmpvar_11.y);
- };
- float tmpvar_14 = 0;
- if ((tmpvar_10.z >= 0.0)) {
- tmpvar_14 = tmpvar_11.z;
- } else {
- tmpvar_14 = -(tmpvar_11.z);
- };
- float3 tmpvar_15 = 0;
- tmpvar_15.x = tmpvar_12;
- tmpvar_15.y = tmpvar_13;
- tmpvar_15.z = tmpvar_14;
- c_1.xyz = ((half3)((float3)(c_1.xyz) + tmpvar_15));
- float4 tmpvar_16 = 0;
- tmpvar_16 = (_mtl_i.xlv_TEXCOORD0 / float4(2.0, 2.0, 2.0, 2.0));
- float4 tmpvar_17 = 0;
- tmpvar_17 = (fract(abs(tmpvar_16)) * float4(2.0, 2.0, 2.0, 2.0));
- float tmpvar_18 = 0;
- if ((tmpvar_16.x >= 0.0)) {
- tmpvar_18 = tmpvar_17.x;
- } else {
- tmpvar_18 = -(tmpvar_17.x);
- };
- float tmpvar_19 = 0;
- if ((tmpvar_16.y >= 0.0)) {
- tmpvar_19 = tmpvar_17.y;
- } else {
- tmpvar_19 = -(tmpvar_17.y);
- };
- float tmpvar_20 = 0;
- if ((tmpvar_16.z >= 0.0)) {
- tmpvar_20 = tmpvar_17.z;
- } else {
- tmpvar_20 = -(tmpvar_17.z);
- };
- float tmpvar_21 = 0;
- if ((tmpvar_16.w >= 0.0)) {
- tmpvar_21 = tmpvar_17.w;
- } else {
- tmpvar_21 = -(tmpvar_17.w);
- };
- float4 tmpvar_22 = 0;
- tmpvar_22.x = tmpvar_18;
- tmpvar_22.y = tmpvar_19;
- tmpvar_22.z = tmpvar_20;
- tmpvar_22.w = tmpvar_21;
- c_1 = ((half4)((float4)(c_1) + tmpvar_22));
- float tmpvar_23 = 0;
- half ip_24 = 0;
- int tmpvar_25 = 0;
- tmpvar_25 = int(_mtl_i.xlv_TEXCOORD0.x);
- ip_24 = half(float(tmpvar_25));
- tmpvar_23 = (_mtl_i.xlv_TEXCOORD0.x - (float)(ip_24));
- c_1.x = ((half)((float)(c_1.x) + tmpvar_23));
- float2 tmpvar_26 = 0;
- int2 tmpvar_27 = 0;
- tmpvar_27 = int2(_mtl_i.xlv_TEXCOORD0.xy);
- half2 tmpvar_28 = 0;
- tmpvar_28 = half2(float2(tmpvar_27));
- tmpvar_26 = (_mtl_i.xlv_TEXCOORD0.xy - (float2)(tmpvar_28));
- c_1.xy = ((half2)((float2)(c_1.xy) + tmpvar_26));
- float3 tmpvar_29 = 0;
- int3 tmpvar_30 = 0;
- tmpvar_30 = int3(_mtl_i.xlv_TEXCOORD0.xyz);
- half3 tmpvar_31 = 0;
- tmpvar_31 = half3(float3(tmpvar_30));
- tmpvar_29 = (_mtl_i.xlv_TEXCOORD0.xyz - (float3)(tmpvar_31));
- c_1.xyz = ((half3)((float3)(c_1.xyz) + tmpvar_29));
- float4 tmpvar_32 = 0;
- int4 tmpvar_33 = 0;
- tmpvar_33 = int4(_mtl_i.xlv_TEXCOORD0);
- half4 tmpvar_34 = 0;
- tmpvar_34 = half4(float4(tmpvar_33));
- tmpvar_32 = (_mtl_i.xlv_TEXCOORD0 - (float4)(tmpvar_34));
- c_1 = ((half4)((float4)(c_1) + tmpvar_32));
- float tmpvar_35 = 0;
- tmpvar_35 = (float(fmod (_mtl_i.xlv_TEXCOORD0.x, (float)tmpvar_34.x)));
- c_1.x = half(((float)(c_1.x) + tmpvar_35));
- float2 tmpvar_36 = 0;
- tmpvar_36 = (float2(fmod (_mtl_i.xlv_TEXCOORD0.xy, (float2)tmpvar_34.xy)));
- c_1.xy = half2(((float2)(c_1.xy) + tmpvar_36));
- float3 tmpvar_37 = 0;
- tmpvar_37 = (float3(fmod (_mtl_i.xlv_TEXCOORD0.xyz, (float3)tmpvar_34.xyz)));
- c_1.xyz = half3(((float3)(c_1.xyz) + tmpvar_37));
- float tmpvar_38 = 0;
- tmpvar_38 = (1.0/(_mtl_i.xlv_TEXCOORD0.x));
- c_1.x = half(((float)(c_1.x) + tmpvar_38));
- float tmpvar_39 = 0;
- tmpvar_39 = max (0.0, tmpvar_38);
- c_1.x = half(((float)(c_1.x) + tmpvar_39));
- c_1.y = (c_1.y + ((half)1.0/(c_1.z)));
- c_1.y = (c_1.y + max ((half)0.0, ((half)1.0/(c_1.w))));
- float tmpvar_40 = 0;
- tmpvar_40 = max (_mtl_i.xlv_TEXCOORD0.x, (float)c_1.z);
- c_1.x = half(((float)(c_1.x) + tmpvar_40));
- _mtl_o._fragData = c_1;
- return _mtl_o;
-}
-
-
-// stats: 73 alu 0 tex 10 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES.txt
deleted file mode 100644
index d62b7bdc6db..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-struct v2f {
- highp vec2 uv;
- highp vec3 nl;
-};
-uniform sampler2D _MainTex;
-uniform highp vec4 _TerrainTreeLightColors[4];
-lowp vec4 xlat_main (in v2f i) {
- highp int j = 0;
- lowp vec4 col = texture2D( _MainTex, i.uv);
- mediump vec3 light = vec3(0.0);
- for ( ; (j < 3); (j++)) {
- light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz;
- }
- return vec4(light, 1.0);
-}
-varying highp vec2 xlv_uv;
-varying highp vec3 xlv_nl;
-void main() {
- v2f i;
- i.uv = xlv_uv;
- i.nl = xlv_nl;
- gl_FragData[0] = xlat_main(i);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt
deleted file mode 100644
index 3471a87ff17..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-inES3.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-struct v2f {
- highp vec2 uv;
- mediump vec3 nl;
-};
-uniform sampler2D _MainTex;
-uniform mediump vec4 _TerrainTreeLightColors[4];
-lowp vec4 xlat_main (in v2f i) {
- highp int j = 0;
- lowp vec4 col = texture( _MainTex, i.uv);
- mediump vec3 light = vec3(0.0);
- for ( ; (j < 3); (j++)) {
- light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz;
- }
- return vec4(light, 1.0);
-}
-in highp vec2 xlv_uv;
-in mediump vec3 xlv_nl;
-void main() {
- v2f i;
- i.uv = xlv_uv;
- i.nl = xlv_nl;
- _fragData = xlat_main(i);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES.txt
deleted file mode 100644
index 2080060decd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-uniform sampler2D _MainTex;
-uniform highp vec4 _TerrainTreeLightColors[4];
-varying highp vec2 xlv_uv;
-varying highp vec3 xlv_nl;
-void main ()
-{
- lowp vec4 tmpvar_1;
- mediump vec3 light_2;
- lowp vec4 col_3;
- col_3 = texture2D (_MainTex, xlv_uv);
- light_2 = ((col_3.xyz * xlv_nl.x) * _TerrainTreeLightColors[0].xyz);
- light_2 = (light_2 + ((col_3.xyz * xlv_nl.y) * _TerrainTreeLightColors[1].xyz));
- light_2 = (light_2 + ((col_3.xyz * xlv_nl.z) * _TerrainTreeLightColors[2].xyz));
- mediump vec4 tmpvar_4;
- tmpvar_4.w = 1.0;
- tmpvar_4.xyz = light_2;
- tmpvar_1 = tmpvar_4;
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 9 alu 1 tex 0 flow
-// inputs: 2
-// #0: xlv_uv (high float) 2x1 [-1]
-// #1: xlv_nl (high float) 3x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _TerrainTreeLightColors (high float) 4x1 [4]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3.txt
deleted file mode 100644
index aea0c58d2e0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-uniform sampler2D _MainTex;
-uniform mediump vec4 _TerrainTreeLightColors[4];
-in highp vec2 xlv_uv;
-in mediump vec3 xlv_nl;
-void main ()
-{
- lowp vec4 tmpvar_1;
- mediump vec3 light_2;
- lowp vec4 col_3;
- col_3 = texture (_MainTex, xlv_uv);
- light_2 = ((col_3.xyz * xlv_nl.x) * _TerrainTreeLightColors[0].xyz);
- light_2 = (light_2 + ((col_3.xyz * xlv_nl.y) * _TerrainTreeLightColors[1].xyz));
- light_2 = (light_2 + ((col_3.xyz * xlv_nl.z) * _TerrainTreeLightColors[2].xyz));
- mediump vec4 tmpvar_4;
- tmpvar_4.w = 1.0;
- tmpvar_4.xyz = light_2;
- tmpvar_1 = tmpvar_4;
- _fragData = tmpvar_1;
-}
-
-
-// stats: 9 alu 1 tex 0 flow
-// inputs: 2
-// #0: xlv_uv (high float) 2x1 [-1]
-// #1: xlv_nl (medium float) 3x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _TerrainTreeLightColors (medium float) 4x1 [4]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3Metal.txt
deleted file mode 100644
index 8a798b045a4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-for-outES3Metal.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float2 xlv_uv;
- half3 xlv_nl;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- half4 _TerrainTreeLightColors[4];
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 tmpvar_1 = 0;
- half3 light_2 = 0;
- half4 col_3 = 0;
- col_3 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_uv));
- light_2 = ((col_3.xyz * _mtl_i.xlv_nl.x) * _mtl_u._TerrainTreeLightColors[0].xyz);
- light_2 = (light_2 + ((col_3.xyz * _mtl_i.xlv_nl.y) * _mtl_u._TerrainTreeLightColors[1].xyz));
- light_2 = (light_2 + ((col_3.xyz * _mtl_i.xlv_nl.z) * _mtl_u._TerrainTreeLightColors[2].xyz));
- half4 tmpvar_4 = 0;
- tmpvar_4.w = half(1.0);
- tmpvar_4.xyz = light_2;
- tmpvar_1 = tmpvar_4;
- _mtl_o._fragData = tmpvar_1;
- return _mtl_o;
-}
-
-
-// stats: 9 alu 1 tex 0 flow
-// inputs: 2
-// #0: xlv_uv (high float) 2x1 [-1]
-// #1: xlv_nl (medium float) 3x1 [-1]
-// uniforms: 1 (total size: 32)
-// #0: _TerrainTreeLightColors (medium float) 4x1 [4] loc 0
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES.txt
deleted file mode 100644
index 6f460816b4f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-struct v2f {
- highp vec2 uv;
- highp vec3 nl;
-};
-uniform sampler2D _MainTex;
-uniform highp vec4 _TerrainTreeLightColors[4];
-lowp vec4 xlat_main (in v2f i) {
- lowp vec4 col = texture2D( _MainTex, i.uv);
- if (col.w < 0.5)
- discard;
- mediump vec3 light = vec3(0.0);
- for (int j = 0; j < 3; ++j) {
- light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz;
- }
- return vec4(light, 1.0);
-}
-varying highp vec2 xlv_uv;
-varying highp vec3 xlv_nl;
-void main() {
- v2f i;
- i.uv = xlv_uv;
- i.nl = xlv_nl;
- gl_FragData[0] = xlat_main(i);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt
deleted file mode 100644
index 73b6172a659..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-inES3.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-struct v2f {
- highp vec2 uv;
- mediump vec3 nl;
-};
-uniform sampler2D _MainTex;
-uniform mediump vec4 _TerrainTreeLightColors[4];
-lowp vec4 xlat_main (in v2f i) {
- lowp vec4 col = texture( _MainTex, i.uv);
- if (col.w < 0.5)
- discard;
- mediump vec3 light = vec3(0.0);
- for (int j = 0; j < 3; ++j) {
- light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz;
- }
- return vec4(light, 1.0);
-}
-in highp vec2 xlv_uv;
-in mediump vec3 xlv_nl;
-void main() {
- v2f i;
- i.uv = xlv_uv;
- i.nl = xlv_nl;
- _fragData = xlat_main(i);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES.txt
deleted file mode 100644
index 665d1b89db8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-uniform sampler2D _MainTex;
-uniform highp vec4 _TerrainTreeLightColors[4];
-varying highp vec2 xlv_uv;
-varying highp vec3 xlv_nl;
-void main ()
-{
- lowp vec4 tmpvar_1;
- mediump vec3 light_2;
- lowp vec4 tmpvar_3;
- tmpvar_3 = texture2D (_MainTex, xlv_uv);
- if ((tmpvar_3.w < 0.5)) {
- discard;
- };
- light_2 = ((tmpvar_3.xyz * xlv_nl.x) * _TerrainTreeLightColors[0].xyz);
- light_2 = (light_2 + ((tmpvar_3.xyz * xlv_nl.y) * _TerrainTreeLightColors[1].xyz));
- light_2 = (light_2 + ((tmpvar_3.xyz * xlv_nl.z) * _TerrainTreeLightColors[2].xyz));
- mediump vec4 tmpvar_4;
- tmpvar_4.w = 1.0;
- tmpvar_4.xyz = light_2;
- tmpvar_1 = tmpvar_4;
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 10 alu 2 tex 1 flow
-// inputs: 2
-// #0: xlv_uv (high float) 2x1 [-1]
-// #1: xlv_nl (high float) 3x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _TerrainTreeLightColors (high float) 4x1 [4]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3.txt
deleted file mode 100644
index cb6883e7f77..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-uniform sampler2D _MainTex;
-uniform mediump vec4 _TerrainTreeLightColors[4];
-in highp vec2 xlv_uv;
-in mediump vec3 xlv_nl;
-void main ()
-{
- lowp vec4 tmpvar_1;
- mediump vec3 light_2;
- lowp vec4 tmpvar_3;
- tmpvar_3 = texture (_MainTex, xlv_uv);
- if ((tmpvar_3.w < 0.5)) {
- discard;
- };
- light_2 = ((tmpvar_3.xyz * xlv_nl.x) * _TerrainTreeLightColors[0].xyz);
- light_2 = (light_2 + ((tmpvar_3.xyz * xlv_nl.y) * _TerrainTreeLightColors[1].xyz));
- light_2 = (light_2 + ((tmpvar_3.xyz * xlv_nl.z) * _TerrainTreeLightColors[2].xyz));
- mediump vec4 tmpvar_4;
- tmpvar_4.w = 1.0;
- tmpvar_4.xyz = light_2;
- tmpvar_1 = tmpvar_4;
- _fragData = tmpvar_1;
-}
-
-
-// stats: 10 alu 2 tex 1 flow
-// inputs: 2
-// #0: xlv_uv (high float) 2x1 [-1]
-// #1: xlv_nl (medium float) 3x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _TerrainTreeLightColors (medium float) 4x1 [4]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3Metal.txt
deleted file mode 100644
index 7cef1f3b0d9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forafterdiscard-outES3Metal.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float2 xlv_uv;
- half3 xlv_nl;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- half4 _TerrainTreeLightColors[4];
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 tmpvar_1 = 0;
- half3 light_2 = 0;
- half4 tmpvar_3 = 0;
- tmpvar_3 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_uv));
- if ((tmpvar_3.w < (half)(0.5))) {
- discard_fragment();
- };
- light_2 = ((tmpvar_3.xyz * _mtl_i.xlv_nl.x) * _mtl_u._TerrainTreeLightColors[0].xyz);
- light_2 = (light_2 + ((tmpvar_3.xyz * _mtl_i.xlv_nl.y) * _mtl_u._TerrainTreeLightColors[1].xyz));
- light_2 = (light_2 + ((tmpvar_3.xyz * _mtl_i.xlv_nl.z) * _mtl_u._TerrainTreeLightColors[2].xyz));
- half4 tmpvar_4 = 0;
- tmpvar_4.w = half(1.0);
- tmpvar_4.xyz = light_2;
- tmpvar_1 = tmpvar_4;
- _mtl_o._fragData = tmpvar_1;
- return _mtl_o;
-}
-
-
-// stats: 10 alu 2 tex 1 flow
-// inputs: 2
-// #0: xlv_uv (high float) 2x1 [-1]
-// #1: xlv_nl (medium float) 3x1 [-1]
-// uniforms: 1 (total size: 32)
-// #0: _TerrainTreeLightColors (medium float) 4x1 [4] loc 0
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-inES.txt
deleted file mode 100644
index 5cf1a88c22f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-inES.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-struct v2f {
- highp vec2 uv;
- highp vec3 nl;
-};
-uniform sampler2D _MainTex;
-uniform highp vec4 _TerrainTreeLightColors[4];
-lowp vec4 xlat_main (in v2f i) {
- lowp vec4 col = texture2D( _MainTex, i.uv);
- mediump vec3 light = vec3(0.0);
- if(col.x >= 0.0) {
- for (float j = 0.0; (j < i.uv.x); (j++)) {
- light += col.xyz;
- }
- }
- if(col.x >= 1.0) {
- float j = i.uv.y;
- j *= sin(j);
- light += col.xyz*j;
- }
- return vec4(light, 1.0);
-}
-varying highp vec2 xlv_uv;
-varying highp vec3 xlv_nl;
-void main() {
- v2f i;
- i.uv = xlv_uv;
- i.nl = xlv_nl;
- gl_FragData[0] = xlat_main(i);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-outES.txt
deleted file mode 100644
index 774b8fe2d52..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-foraliasinductor-outES.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-uniform sampler2D _MainTex;
-varying highp vec2 xlv_uv;
-void main ()
-{
- lowp vec4 tmpvar_1;
- highp vec2 tmpvar_2;
- tmpvar_2 = xlv_uv;
- mediump vec3 light_3;
- lowp vec4 col_4;
- lowp vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, xlv_uv);
- col_4 = tmpvar_5;
- light_3 = vec3(0.0, 0.0, 0.0);
- if ((tmpvar_5.x >= 0.0)) {
- for (highp float j_6 = 0.0; j_6 < tmpvar_2.x; j_6 += 1.0) {
- light_3 = (light_3 + col_4.xyz);
- };
- };
- if ((tmpvar_5.x >= 1.0)) {
- highp float j_7;
- j_7 = (xlv_uv.y * sin(xlv_uv.y));
- light_3 = (light_3 + (tmpvar_5.xyz * j_7));
- };
- mediump vec4 tmpvar_8;
- tmpvar_8.w = 1.0;
- tmpvar_8.xyz = light_3;
- tmpvar_1 = tmpvar_8;
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 12 alu 1 tex 4 flow
-// inputs: 1
-// #0: xlv_uv (high float) 2x1 [-1]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-inES.txt
deleted file mode 100644
index da195d6d447..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-inES.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-struct v2f {
- highp vec2 uv;
- highp vec3 nl;
-};
-uniform sampler2D _MainTex;
-uniform highp vec4 _TerrainTreeLightColors[4];
-lowp vec4 xlat_main (in v2f i) {
- highp int j = 0; // loop init before discard
- lowp vec4 col = texture2D( _MainTex, i.uv);
- if (col.w < 0.5)
- discard;
- mediump vec3 light = vec3(0.0);
- for ( ; (j < 3); (j++)) { // loop body after discard
- light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz;
- }
- return vec4(light, 1.0);
-}
-varying highp vec2 xlv_uv;
-varying highp vec3 xlv_nl;
-void main() {
- v2f i;
- i.uv = xlv_uv;
- i.nl = xlv_nl;
- gl_FragData[0] = xlat_main(i);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-outES.txt
deleted file mode 100644
index 665d1b89db8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forarounddiscard-outES.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-uniform sampler2D _MainTex;
-uniform highp vec4 _TerrainTreeLightColors[4];
-varying highp vec2 xlv_uv;
-varying highp vec3 xlv_nl;
-void main ()
-{
- lowp vec4 tmpvar_1;
- mediump vec3 light_2;
- lowp vec4 tmpvar_3;
- tmpvar_3 = texture2D (_MainTex, xlv_uv);
- if ((tmpvar_3.w < 0.5)) {
- discard;
- };
- light_2 = ((tmpvar_3.xyz * xlv_nl.x) * _TerrainTreeLightColors[0].xyz);
- light_2 = (light_2 + ((tmpvar_3.xyz * xlv_nl.y) * _TerrainTreeLightColors[1].xyz));
- light_2 = (light_2 + ((tmpvar_3.xyz * xlv_nl.z) * _TerrainTreeLightColors[2].xyz));
- mediump vec4 tmpvar_4;
- tmpvar_4.w = 1.0;
- tmpvar_4.xyz = light_2;
- tmpvar_1 = tmpvar_4;
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 10 alu 2 tex 1 flow
-// inputs: 2
-// #0: xlv_uv (high float) 2x1 [-1]
-// #1: xlv_nl (high float) 3x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _TerrainTreeLightColors (high float) 4x1 [4]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-inES.txt
deleted file mode 100644
index cf8f959af52..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-inES.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main() {
- int i = 0;
- float f = 0.0;
- for (; i < 32; (++i))
- f += gl_FragCoord.x * float(i);
- gl_FragColor = vec4(f);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt
deleted file mode 100644
index 3b0113bf067..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-fornounroll-outES.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-void main ()
-{
- highp float f_1;
- f_1 = 0.0;
- for (highp int i_2 = 0; i_2 < 32; i_2++) {
- f_1 = (f_1 + (gl_FragCoord.x * float(i_2)));
- };
- highp vec4 tmpvar_3;
- tmpvar_3 = vec4(f_1);
- gl_FragColor = tmpvar_3;
-}
-
-
-// stats: 7 alu 0 tex 2 flow
-// inputs: 1
-// #0: gl_FragCoord (high float) 4x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-inES.txt
deleted file mode 100644
index 332469d06ac..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-inES.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-struct v2f {
- highp vec2 uv;
- highp vec3 nl;
-};
-uniform sampler2D _MainTex;
-uniform highp vec4 _TerrainTreeLightColors[4];
-lowp vec4 xlat_main (in v2f i) {
- lowp vec4 col = texture2D( _MainTex, i.uv);
- mediump vec3 light = vec3(0.0);
- int loopCount = int(col.a*10.0);
- for (int j = 0; j < loopCount; ++j)
- {
- light += col.xyz * i.nl[j] * _TerrainTreeLightColors[j].xyz;
- }
- return vec4(light, 1.0);
-}
-varying highp vec2 xlv_uv;
-varying highp vec3 xlv_nl;
-void main() {
- v2f i;
- i.uv = xlv_uv;
- i.nl = xlv_nl;
- gl_FragData[0] = xlat_main(i);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt
deleted file mode 100644
index de5e0289e29..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forunbounded-outES.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-uniform sampler2D _MainTex;
-uniform highp vec4 _TerrainTreeLightColors[4];
-varying highp vec2 xlv_uv;
-varying highp vec3 xlv_nl;
-void main ()
-{
- lowp vec4 tmpvar_1;
- highp vec3 tmpvar_2;
- tmpvar_2 = xlv_nl;
- lowp int loopCount_4;
- mediump vec3 light_5;
- lowp vec4 col_6;
- lowp vec4 tmpvar_7;
- tmpvar_7 = texture2D (_MainTex, xlv_uv);
- col_6 = tmpvar_7;
- light_5 = vec3(0.0, 0.0, 0.0);
- loopCount_4 = int((tmpvar_7.w * 10.0));
- for (highp int j_3 = 0; j_3 < loopCount_4; j_3++) {
- light_5 = (light_5 + ((col_6.xyz *
- tmpvar_2[j_3]
- ) * _TerrainTreeLightColors[j_3].xyz));
- };
- mediump vec4 tmpvar_8;
- tmpvar_8.w = 1.0;
- tmpvar_8.xyz = light_5;
- tmpvar_1 = tmpvar_8;
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 11 alu 1 tex 2 flow
-// inputs: 2
-// #0: xlv_uv (high float) 2x1 [-1]
-// #1: xlv_nl (high float) 3x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _TerrainTreeLightColors (high float) 4x1 [4]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-in.txt
deleted file mode 100644
index c150f0535f4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-in.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-uniform sampler2D mainTex;
-varying vec2 uv;
-
-void main()
-{
- vec4 c = vec4(0.0);
-
- // various loop forms
- for (int i = 0; i < 100; ++i)
- c.x += texture2D (mainTex, uv + vec2(i,i)).r;
- for (int i = 0; i <= 100; i += 3)
- c.x += texture2D (mainTex, uv + vec2(i,i)).r;
- for (int i = 100; i >= 0; --i)
- c.x += texture2D (mainTex, uv + vec2(i,i)).r;
- int n = int(c.x * 10.0);
- for (int i = 3; i < n; ++i)
- c.x += texture2D (mainTex, uv + vec2(i,i)).r;
- for (int i = 1, j = 2; i < 100 && j < 50; i += 2, j += 3)
- c.x += texture2D (mainTex, uv + vec2(i,j)).r;
- gl_FragColor = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-out.txt
deleted file mode 100644
index 680d3e92f66..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forvariants-out.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-uniform sampler2D mainTex;
-varying vec2 uv;
-void main ()
-{
- int j_1;
- int i_2;
- int n_4;
- vec4 c_8;
- c_8 = vec4(0.0, 0.0, 0.0, 0.0);
- for (int i_7 = 0; i_7 < 100; i_7++) {
- vec2 tmpvar_9;
- tmpvar_9.x = float(i_7);
- tmpvar_9.y = float(i_7);
- c_8.x = (c_8.x + texture2D (mainTex, (uv + tmpvar_9)).x);
- };
- for (int i_6 = 0; i_6 <= 100; i_6 += 3) {
- vec2 tmpvar_10;
- tmpvar_10.x = float(i_6);
- tmpvar_10.y = float(i_6);
- c_8.x = (c_8.x + texture2D (mainTex, (uv + tmpvar_10)).x);
- };
- for (int i_5 = 100; i_5 >= 0; i_5 = (i_5 - 1)) {
- vec2 tmpvar_11;
- tmpvar_11.x = float(i_5);
- tmpvar_11.y = float(i_5);
- c_8.x = (c_8.x + texture2D (mainTex, (uv + tmpvar_11)).x);
- };
- n_4 = int((c_8.x * 10.0));
- for (int i_3 = 3; i_3 < n_4; i_3++) {
- vec2 tmpvar_12;
- tmpvar_12.x = float(i_3);
- tmpvar_12.y = float(i_3);
- c_8.x = (c_8.x + texture2D (mainTex, (uv + tmpvar_12)).x);
- };
- i_2 = 1;
- j_1 = 2;
- for (; ((i_2 < 100) && (j_1 < 50)); i_2 += 2, j_1 += 3) {
- vec2 tmpvar_13;
- tmpvar_13.x = float(i_2);
- tmpvar_13.y = float(j_1);
- c_8.x = (c_8.x + texture2D (mainTex, (uv + tmpvar_13)).x);
- };
- gl_FragColor = c_8;
-}
-
-
-// stats: 43 alu 5 tex 10 flow
-// inputs: 1
-// #0: uv (high float) 2x1 [-1]
-// textures: 1
-// #0: mainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-inES.txt
deleted file mode 100644
index 34ab82efd00..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-inES.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-struct v2f {
- highp vec2 uv;
- highp vec3 nl;
-};
-uniform sampler2D _MainTex;
-uniform highp vec4 _TerrainTreeLightColors[4];
-lowp vec4 xlat_main (in v2f i) {
- lowp vec4 col = texture2D( _MainTex, i.uv);
- mediump vec3 light = vec3(0.0);
- if(col.x >= 0.0) {
- for (float j = 0.0; (j < i.uv.x); (j++)) {
- light += col.xyz;
- }
- }
- return vec4(light, 1.0);
-}
-varying highp vec2 xlv_uv;
-varying highp vec3 xlv_nl;
-void main() {
- v2f i;
- i.uv = xlv_uv;
- i.nl = xlv_nl;
- gl_FragData[0] = xlat_main(i);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-outES.txt
deleted file mode 100644
index 3383ff082fa..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/loop-forwronginductor-outES.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-uniform sampler2D _MainTex;
-varying highp vec2 xlv_uv;
-void main ()
-{
- lowp vec4 tmpvar_1;
- highp vec2 tmpvar_2;
- tmpvar_2 = xlv_uv;
- mediump vec3 light_3;
- lowp vec4 col_4;
- lowp vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, xlv_uv);
- col_4 = tmpvar_5;
- light_3 = vec3(0.0, 0.0, 0.0);
- if ((tmpvar_5.x >= 0.0)) {
- for (highp float j_6 = 0.0; j_6 < tmpvar_2.x; j_6 += 1.0) {
- light_3 = (light_3 + col_4.xyz);
- };
- };
- mediump vec4 tmpvar_7;
- tmpvar_7.w = 1.0;
- tmpvar_7.xyz = light_3;
- tmpvar_1 = tmpvar_7;
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 7 alu 1 tex 3 flow
-// inputs: 1
-// #0: xlv_uv (high float) 2x1 [-1]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-inES3.txt
deleted file mode 100644
index 196b2f75ec9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-inES3.txt
+++ /dev/null
@@ -1,94 +0,0 @@
-#version 300 es
-
-// Shader below was causing invalid matrix assignment (different types, i.e. half3x3 vs float3x3)
-// in the resulting Metal code. Caused by some combination of matrix transposes and other operations
-// on them.
-
-mat3 xll_transpose_mf3x3(mat3 m) {
- 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]);
-}
-vec3 xll_matrixindex_mf3x3_i (mat3 m, int i) { vec3 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; return v; }
-struct SurfaceOutput {
- lowp vec3 Albedo;
- lowp vec3 Normal;
- lowp vec3 Emission;
- mediump float Specular;
- lowp float Gloss;
- lowp float Alpha;
-};
-struct Input {
- highp vec2 uv_PanelTex;
- highp vec2 uv2_DecalTex;
-};
-struct v2f_surf {
- highp vec4 pos;
- highp vec4 pack0;
- highp vec4 tSpace0;
- highp vec4 tSpace1;
- highp vec4 tSpace2;
-};
-uniform highp vec4 _WorldSpaceLightPos0;
-uniform sampler2D _PanelNorm;
-uniform sampler2D _DecalNorm;
-highp vec3 UnityWorldSpaceLightDir( in highp vec3 worldPos ) {
- return (_WorldSpaceLightPos0.xyz - (worldPos * _WorldSpaceLightPos0.w));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
-
- lowp vec3 baseNormal = ((texture( _DecalNorm, IN.uv2_DecalTex).xyz * 2.0) - 1.0);
- lowp vec3 detailNormal = ((texture( _PanelNorm, IN.uv_PanelTex).xyz * 2.0) - 1.0);
- highp mat3 nBasis = xll_transpose_mf3x3(mat3( vec3( baseNormal.z, baseNormal.y, (-baseNormal.x)), vec3( baseNormal.x, baseNormal.z, (-baseNormal.y)), vec3( baseNormal.x, baseNormal.y, baseNormal.z)));
-
- lowp vec3 combinedNormal = normalize((((detailNormal.x * xll_matrixindex_mf3x3_i (nBasis, 0)) + (detailNormal.y * xll_matrixindex_mf3x3_i (nBasis, 1))) + (detailNormal.z * xll_matrixindex_mf3x3_i (nBasis, 2))));
- combinedNormal *= 1.0;
- o.Normal = combinedNormal;
-}
-lowp vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
-
- surfIN.uv_PanelTex = IN.pack0.xy;
- surfIN.uv2_DecalTex = IN.pack0.zw;
- highp vec3 worldPos = vec3( IN.tSpace0.w, IN.tSpace1.w, IN.tSpace2.w);
-
- lowp vec3 lightDir = normalize(UnityWorldSpaceLightDir( worldPos));
-
- SurfaceOutput o;
- o.Albedo = vec3( 0.0);
- o.Emission = vec3( 0.0);
-
- o.Specular = 0.0;
- o.Alpha = 0.0;
- o.Gloss = 0.0;
- lowp vec3 normalWorldVertex = vec3( 0.0, 0.0, 1.0);
-
- surf( surfIN, o);
- lowp vec3 worldN;
- worldN.x = dot( IN.tSpace0.xyz, o.Normal);
- worldN.y = dot( IN.tSpace1.xyz, o.Normal);
-
- worldN.z = dot( IN.tSpace2.xyz, o.Normal);
- o.Normal = worldN;
-
- lowp vec4 res;
- res.xyz = ((o.Normal * 0.5) + 0.5);
- res.w = o.Specular;
- return res;
-}
-in highp vec4 xlv_TEXCOORD0;
-in highp vec4 xlv_TEXCOORD1;
-in highp vec4 xlv_TEXCOORD2;
-in highp vec4 xlv_TEXCOORD3;
-out lowp vec4 _fragData;
-void main() {
- lowp vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.pack0 = vec4(xlv_TEXCOORD0);
- xlt_IN.tSpace0 = vec4(xlv_TEXCOORD1);
- xlt_IN.tSpace1 = vec4(xlv_TEXCOORD2);
- xlt_IN.tSpace2 = vec4(xlv_TEXCOORD3);
- xl_retval = frag_surf( xlt_IN);
- _fragData = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3.txt
deleted file mode 100644
index c5fcdb4bb5e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-#version 300 es
-uniform sampler2D _PanelNorm;
-uniform sampler2D _DecalNorm;
-in highp vec4 xlv_TEXCOORD0;
-in highp vec4 xlv_TEXCOORD1;
-in highp vec4 xlv_TEXCOORD2;
-in highp vec4 xlv_TEXCOORD3;
-out lowp vec4 _fragData;
-void main ()
-{
- lowp vec4 res_1;
- lowp vec3 worldN_2;
- lowp vec3 combinedNormal_3;
- lowp vec3 tmpvar_4;
- tmpvar_4 = ((texture (_DecalNorm, xlv_TEXCOORD0.zw).xyz * 2.0) - 1.0);
- lowp vec3 tmpvar_5;
- tmpvar_5 = ((texture (_PanelNorm, xlv_TEXCOORD0.xy).xyz * 2.0) - 1.0);
- lowp vec3 tmpvar_6;
- tmpvar_6.x = tmpvar_4.z;
- tmpvar_6.y = tmpvar_4.y;
- tmpvar_6.z = -(tmpvar_4.x);
- lowp vec3 tmpvar_7;
- tmpvar_7.x = tmpvar_4.x;
- tmpvar_7.y = tmpvar_4.z;
- tmpvar_7.z = -(tmpvar_4.y);
- highp mat3 tmpvar_8;
- lowp mat3 tmpvar_9;
- tmpvar_9[uint(0)].x = tmpvar_6.x;
- tmpvar_9[uint(0)].y = tmpvar_7.x;
- tmpvar_9[uint(0)].z = tmpvar_4.x;
- tmpvar_9[1u].x = tmpvar_6.y;
- tmpvar_9[1u].y = tmpvar_7.y;
- tmpvar_9[1u].z = tmpvar_4.y;
- tmpvar_9[2u].x = tmpvar_6.z;
- tmpvar_9[2u].y = tmpvar_7.z;
- tmpvar_9[2u].z = tmpvar_4.z;
- tmpvar_8 = tmpvar_9;
- highp vec3 v_10;
- v_10.x = tmpvar_8[0].x;
- v_10.y = tmpvar_8[1].x;
- v_10.z = tmpvar_8[2].x;
- highp vec3 v_11;
- v_11.x = tmpvar_8[0].y;
- v_11.y = tmpvar_8[1].y;
- v_11.z = tmpvar_8[2].y;
- highp vec3 v_12;
- v_12.x = tmpvar_8[0].z;
- v_12.y = tmpvar_8[1].z;
- v_12.z = tmpvar_8[2].z;
- combinedNormal_3 = normalize(((
- (tmpvar_5.x * v_10)
- +
- (tmpvar_5.y * v_11)
- ) + (tmpvar_5.z * v_12)));
- highp float tmpvar_13;
- tmpvar_13 = dot (xlv_TEXCOORD1.xyz, combinedNormal_3);
- worldN_2.x = tmpvar_13;
- highp float tmpvar_14;
- tmpvar_14 = dot (xlv_TEXCOORD2.xyz, combinedNormal_3);
- worldN_2.y = tmpvar_14;
- highp float tmpvar_15;
- tmpvar_15 = dot (xlv_TEXCOORD3.xyz, combinedNormal_3);
- worldN_2.z = tmpvar_15;
- res_1.xyz = ((worldN_2 * 0.5) + 0.5);
- res_1.w = 0.0;
- _fragData = res_1;
-}
-
-
-// stats: 18 alu 2 tex 0 flow
-// inputs: 4
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 4x1 [-1]
-// #2: xlv_TEXCOORD2 (high float) 4x1 [-1]
-// #3: xlv_TEXCOORD3 (high float) 4x1 [-1]
-// textures: 2
-// #0: _PanelNorm (low 2d) 0x0 [-1]
-// #1: _DecalNorm (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3Metal.txt
deleted file mode 100644
index 0714a7cd94d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-cast-types-outES3Metal.txt
+++ /dev/null
@@ -1,94 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-inline float4x4 _xlcast_float4x4(half4x4 v) { return float4x4(float4(v[0]), float4(v[1]), float4(v[2]), float4(v[3])); }
-inline float3x3 _xlcast_float3x3(half3x3 v) { return float3x3(float3(v[0]), float3(v[1]), float3(v[2])); }
-inline float2x2 _xlcast_float2x2(half2x2 v) { return float2x2(float2(v[0]), float2(v[1])); }
-inline half4x4 _xlcast_half4x4(float4x4 v) { return half4x4(half4(v[0]), half4(v[1]), half4(v[2]), half4(v[3])); }
-inline half3x3 _xlcast_half3x3(float3x3 v) { return half3x3(half3(v[0]), half3(v[1]), half3(v[2])); }
-inline half2x2 _xlcast_half2x2(float2x2 v) { return half2x2(half2(v[0]), half2(v[1])); }
-struct xlatMtlShaderInput {
- float4 xlv_TEXCOORD0;
- float4 xlv_TEXCOORD1;
- float4 xlv_TEXCOORD2;
- float4 xlv_TEXCOORD3;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _PanelNorm [[texture(0)]], sampler _mtlsmp__PanelNorm [[sampler(0)]]
- , texture2d<half> _DecalNorm [[texture(1)]], sampler _mtlsmp__DecalNorm [[sampler(1)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 res_1 = 0;
- half3 worldN_2 = 0;
- half3 combinedNormal_3 = 0;
- half3 tmpvar_4 = 0;
- tmpvar_4 = ((_DecalNorm.sample(_mtlsmp__DecalNorm, (float2)(_mtl_i.xlv_TEXCOORD0.zw)).xyz * (half)(2.0)) - (half)(1.0));
- half3 tmpvar_5 = 0;
- tmpvar_5 = ((_PanelNorm.sample(_mtlsmp__PanelNorm, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).xyz * (half)(2.0)) - (half)(1.0));
- half3 tmpvar_6 = 0;
- tmpvar_6.x = tmpvar_4.z;
- tmpvar_6.y = tmpvar_4.y;
- tmpvar_6.z = -(tmpvar_4.x);
- half3 tmpvar_7 = 0;
- tmpvar_7.x = tmpvar_4.x;
- tmpvar_7.y = tmpvar_4.z;
- tmpvar_7.z = -(tmpvar_4.y);
- float3x3 tmpvar_8;
- half3x3 tmpvar_9;
- tmpvar_9[0].x = tmpvar_6.x;
- tmpvar_9[0].y = tmpvar_7.x;
- tmpvar_9[0].z = tmpvar_4.x;
- tmpvar_9[1].x = tmpvar_6.y;
- tmpvar_9[1].y = tmpvar_7.y;
- tmpvar_9[1].z = tmpvar_4.y;
- tmpvar_9[2].x = tmpvar_6.z;
- tmpvar_9[2].y = tmpvar_7.z;
- tmpvar_9[2].z = tmpvar_4.z;
- tmpvar_8 = _xlcast_float3x3(tmpvar_9);
- float3 v_10 = 0;
- v_10.x = tmpvar_8[0].x;
- v_10.y = tmpvar_8[1].x;
- v_10.z = tmpvar_8[2].x;
- float3 v_11 = 0;
- v_11.x = tmpvar_8[0].y;
- v_11.y = tmpvar_8[1].y;
- v_11.z = tmpvar_8[2].y;
- float3 v_12 = 0;
- v_12.x = tmpvar_8[0].z;
- v_12.y = tmpvar_8[1].z;
- v_12.z = tmpvar_8[2].z;
- combinedNormal_3 = normalize(((
- ((half3)((float)(tmpvar_5.x) * v_10))
- +
- ((half3)((float)(tmpvar_5.y) * v_11))
- ) + ((half3)((float)(tmpvar_5.z) * v_12))));
- float tmpvar_13 = 0;
- tmpvar_13 = dot (_mtl_i.xlv_TEXCOORD1.xyz, (float3)combinedNormal_3);
- worldN_2.x = half(tmpvar_13);
- float tmpvar_14 = 0;
- tmpvar_14 = dot (_mtl_i.xlv_TEXCOORD2.xyz, (float3)combinedNormal_3);
- worldN_2.y = half(tmpvar_14);
- float tmpvar_15 = 0;
- tmpvar_15 = dot (_mtl_i.xlv_TEXCOORD3.xyz, (float3)combinedNormal_3);
- worldN_2.z = half(tmpvar_15);
- res_1.xyz = ((worldN_2 * (half)(0.5)) + (half)(0.5));
- res_1.w = half(0.0);
- _mtl_o._fragData = res_1;
- return _mtl_o;
-}
-
-
-// stats: 18 alu 2 tex 0 flow
-// inputs: 4
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 4x1 [-1]
-// #2: xlv_TEXCOORD2 (high float) 4x1 [-1]
-// #3: xlv_TEXCOORD3 (high float) 4x1 [-1]
-// textures: 2
-// #0: _PanelNorm (low 2d) 0x0 [-1] loc 0
-// #1: _DecalNorm (low 2d) 0x0 [-1] loc 1
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-inES3.txt
deleted file mode 100644
index 03239e9097f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-inES3.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-uniform highp float _Speed;
-uniform highp vec4 _Time;
-highp vec4 func( in highp vec2 uv )
-{
- highp float s = sin(_Speed * _Time.x);
- highp float c = cos(_Speed * _Time.x);
-
- highp mat2 rotationMatrix = mat2(c, s, -s, c);
- // various operations on a matrix
- rotationMatrix = rotationMatrix * 2.0;
- rotationMatrix = rotationMatrix - 1.0;
- rotationMatrix = s - rotationMatrix;
- rotationMatrix = c + rotationMatrix;
- rotationMatrix /= s;
-
- mediump mat2 halfMatrix = mat2(c, s, -s, c);
- halfMatrix = halfMatrix * 2.0;
- halfMatrix = halfMatrix - 1.0;
- halfMatrix = s - halfMatrix;
- halfMatrix = c + halfMatrix;
- halfMatrix /= s;
-
- return vec4((rotationMatrix * uv), (halfMatrix * uv));
-}
-in highp vec2 uv;
-void main() {
- _fragData = func(uv);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3.txt
deleted file mode 100644
index 4f2d14e9aca..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-uniform highp float _Speed;
-uniform highp vec4 _Time;
-in highp vec2 uv;
-void main ()
-{
- mediump mat2 halfMatrix_1;
- highp mat2 rotationMatrix_2;
- highp float tmpvar_3;
- highp float tmpvar_4;
- tmpvar_4 = (_Speed * _Time.x);
- tmpvar_3 = sin(tmpvar_4);
- highp float tmpvar_5;
- tmpvar_5 = cos(tmpvar_4);
- highp mat2 tmpvar_6;
- tmpvar_6[uint(0)].x = tmpvar_5;
- tmpvar_6[uint(0)].y = tmpvar_3;
- tmpvar_6[1u].x = -(tmpvar_3);
- tmpvar_6[1u].y = tmpvar_5;
- rotationMatrix_2 = (tmpvar_6 * 2.0);
- rotationMatrix_2 = (rotationMatrix_2 - 1.0);
- rotationMatrix_2 = (tmpvar_3 - rotationMatrix_2);
- rotationMatrix_2 = (tmpvar_5 + rotationMatrix_2);
- rotationMatrix_2 = (rotationMatrix_2 / tmpvar_3);
- highp mat2 tmpvar_7;
- tmpvar_7[uint(0)].x = tmpvar_5;
- tmpvar_7[uint(0)].y = tmpvar_3;
- tmpvar_7[1u].x = -(tmpvar_3);
- tmpvar_7[1u].y = tmpvar_5;
- halfMatrix_1 = tmpvar_7;
- halfMatrix_1 = (halfMatrix_1 * 2.0);
- halfMatrix_1 = (halfMatrix_1 - 1.0);
- halfMatrix_1 = (tmpvar_3 - halfMatrix_1);
- halfMatrix_1 = (tmpvar_5 + halfMatrix_1);
- halfMatrix_1 = (halfMatrix_1 / tmpvar_3);
- highp vec4 tmpvar_8;
- tmpvar_8.xy = (rotationMatrix_2 * uv);
- tmpvar_8.zw = (halfMatrix_1 * uv);
- _fragData = tmpvar_8;
-}
-
-
-// stats: 17 alu 0 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 2x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: _Speed (high float) 1x1 [-1]
-// #1: _Time (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3Metal.txt
deleted file mode 100644
index ea699afd5e9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/matrix-ops-outES3Metal.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-inline float4x4 _xlinit_float4x4(float v) { return float4x4(float4(v), float4(v), float4(v), float4(v)); }
-inline float3x3 _xlinit_float3x3(float v) { return float3x3(float3(v), float3(v), float3(v)); }
-inline float2x2 _xlinit_float2x2(float v) { return float2x2(float2(v), float2(v)); }
-inline half4x4 _xlinit_half4x4(half v) { return half4x4(half4(v), half4(v), half4(v), half4(v)); }
-inline half3x3 _xlinit_half3x3(half v) { return half3x3(half3(v), half3(v), half3(v)); }
-inline half2x2 _xlinit_half2x2(half v) { return half2x2(half2(v), half2(v)); }
-inline float4x4 _xlcast_float4x4(half4x4 v) { return float4x4(float4(v[0]), float4(v[1]), float4(v[2]), float4(v[3])); }
-inline float3x3 _xlcast_float3x3(half3x3 v) { return float3x3(float3(v[0]), float3(v[1]), float3(v[2])); }
-inline float2x2 _xlcast_float2x2(half2x2 v) { return float2x2(float2(v[0]), float2(v[1])); }
-inline half4x4 _xlcast_half4x4(float4x4 v) { return half4x4(half4(v[0]), half4(v[1]), half4(v[2]), half4(v[3])); }
-inline half3x3 _xlcast_half3x3(float3x3 v) { return half3x3(half3(v[0]), half3(v[1]), half3(v[2])); }
-inline half2x2 _xlcast_half2x2(float2x2 v) { return half2x2(half2(v[0]), half2(v[1])); }
-struct xlatMtlShaderInput {
- float2 uv;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- float _Speed;
- float4 _Time;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half2x2 halfMatrix_1;
- float2x2 rotationMatrix_2;
- float tmpvar_3 = 0;
- float tmpvar_4 = 0;
- tmpvar_4 = (_mtl_u._Speed * _mtl_u._Time.x);
- tmpvar_3 = sin(tmpvar_4);
- float tmpvar_5 = 0;
- tmpvar_5 = cos(tmpvar_4);
- float2x2 tmpvar_6;
- tmpvar_6[0].x = tmpvar_5;
- tmpvar_6[0].y = tmpvar_3;
- tmpvar_6[1].x = -(tmpvar_3);
- tmpvar_6[1].y = tmpvar_5;
- rotationMatrix_2 = (tmpvar_6 * 2.0);
- rotationMatrix_2 = (rotationMatrix_2 - _xlinit_float2x2(1.0));
- rotationMatrix_2 = (_xlinit_float2x2(tmpvar_3) - rotationMatrix_2);
- rotationMatrix_2 = (_xlinit_float2x2(tmpvar_5) + rotationMatrix_2);
- rotationMatrix_2 = (rotationMatrix_2 * (1.0/(tmpvar_3)));
- float2x2 tmpvar_7;
- tmpvar_7[0].x = tmpvar_5;
- tmpvar_7[0].y = tmpvar_3;
- tmpvar_7[1].x = -(tmpvar_3);
- tmpvar_7[1].y = tmpvar_5;
- halfMatrix_1 = _xlcast_half2x2(tmpvar_7);
- halfMatrix_1 = (halfMatrix_1 * (half)(2.0));
- halfMatrix_1 = (halfMatrix_1 - _xlinit_half2x2(1.0));
- halfMatrix_1 = _xlcast_half2x2(((float2x2)(_xlinit_half2x2(tmpvar_3) - halfMatrix_1)));
- halfMatrix_1 = _xlcast_half2x2(((float2x2)(_xlinit_half2x2(tmpvar_5) + halfMatrix_1)));
- halfMatrix_1 = _xlcast_half2x2(((float2x2)(halfMatrix_1 * (1.0h/half(tmpvar_3)))));
- float4 tmpvar_8 = 0;
- tmpvar_8.xy = (rotationMatrix_2 * _mtl_i.uv);
- tmpvar_8.zw = ((float2)(halfMatrix_1 * (half2)(_mtl_i.uv)));
- _mtl_o._fragData = half4(tmpvar_8);
- return _mtl_o;
-}
-
-
-// stats: 17 alu 0 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 2x1 [-1]
-// uniforms: 2 (total size: 32)
-// #0: _Speed (high float) 1x1 [-1] loc 0
-// #1: _Time (high float) 4x1 [-1] loc 16
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-in.txt
deleted file mode 100644
index dcbc5250791..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-in.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main()
-{
- gl_FragData[0] = vec4(0.0);
- gl_FragData[1] = vec4(0.1);
- gl_FragData[2] = vec4(0.2);
- gl_FragData[3] = vec4(0.3);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-inES.txt
deleted file mode 100644
index 135cc87a45c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-inES.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-#extension GL_EXT_draw_buffers : require
-
-void main()
-{
- gl_FragData[0] = vec4(0.0);
- gl_FragData[1] = vec4(0.1);
- gl_FragData[2] = vec4(0.2);
- gl_FragData[3] = vec4(0.3);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-inES3.txt
deleted file mode 100644
index a85650684cb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-inES3.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData[4];
-void main()
-{
- _fragData[0] = vec4(0.0);
- _fragData[1] = vec4(0.1);
- _fragData[2] = vec4(0.2);
- _fragData[3] = vec4(0.3);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-inES3.txt
deleted file mode 100644
index d7be49b2991..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-inES3.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-#version 300 es
-
-// Defines output as an array (uses only 1st index),
-// and two vectors (1st unused).
-layout(location = 0) out mediump vec4 _colArr[2];
-layout(location = 2) out mediump vec4 _colVecUnused;
-layout(location = 3) out mediump vec4 _colVec;
-
-void main()
-{
- _colArr[0] = vec4(0.0);
- _colVec = vec4(1.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3.txt
deleted file mode 100644
index 739ff37a4b6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-#version 300 es
-layout(location=0) out mediump vec4 _colArr[2];
-layout(location=3) out mediump vec4 _colVec;
-void main ()
-{
- _colArr[0] = vec4(0.0, 0.0, 0.0, 0.0);
- _colVec = vec4(1.0, 1.0, 1.0, 1.0);
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3Metal.txt
deleted file mode 100644
index 4c9c30d5bcf..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-mixed-array-outES3Metal.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
-};
-struct xlatMtlShaderOutput {
- half4 _colArr_0 [[color(0)]];
- half4 _colVec [[color(3)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- _mtl_o._colArr_0 = half4(float4(0.0, 0.0, 0.0, 0.0));
- _mtl_o._colVec = half4(float4(1.0, 1.0, 1.0, 1.0));
- return _mtl_o;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-out.txt
deleted file mode 100644
index 57e21aebe93..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-out.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-void main ()
-{
- gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0);
- gl_FragData[1] = vec4(0.1, 0.1, 0.1, 0.1);
- gl_FragData[2] = vec4(0.2, 0.2, 0.2, 0.2);
- gl_FragData[3] = vec4(0.3, 0.3, 0.3, 0.3);
-}
-
-
-// stats: 4 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt
deleted file mode 100644
index 5dc2197325b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-#extension GL_EXT_draw_buffers : enable
-void main ()
-{
- gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0);
- gl_FragData[1] = vec4(0.1, 0.1, 0.1, 0.1);
- gl_FragData[2] = vec4(0.2, 0.2, 0.2, 0.2);
- gl_FragData[3] = vec4(0.3, 0.3, 0.3, 0.3);
-}
-
-
-// stats: 4 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3.txt
deleted file mode 100644
index f6282ea7240..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData[4];
-void main ()
-{
- _fragData[0] = vec4(0.0, 0.0, 0.0, 0.0);
- _fragData[1] = vec4(0.1, 0.1, 0.1, 0.1);
- _fragData[2] = vec4(0.2, 0.2, 0.2, 0.2);
- _fragData[3] = vec4(0.3, 0.3, 0.3, 0.3);
-}
-
-
-// stats: 4 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3Metal.txt
deleted file mode 100644
index e4b3f820a94..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-outES3Metal.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
-};
-struct xlatMtlShaderOutput {
- half4 _fragData_0 [[color(0)]];
- half4 _fragData_1 [[color(1)]];
- half4 _fragData_2 [[color(2)]];
- half4 _fragData_3 [[color(3)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- _mtl_o._fragData_0 = half4(float4(0.0, 0.0, 0.0, 0.0));
- _mtl_o._fragData_1 = half4(float4(0.1, 0.1, 0.1, 0.1));
- _mtl_o._fragData_2 = half4(float4(0.2, 0.2, 0.2, 0.2));
- _mtl_o._fragData_3 = half4(float4(0.3, 0.3, 0.3, 0.3));
- return _mtl_o;
-}
-
-
-// stats: 4 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-inES3.txt
deleted file mode 100644
index b6da878b1c1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-inES3.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-#version 300 es
-
-// Defines output as an array of 4 colors,
-// but writes to only one.
-#define gl_FragColor _glesFragData[0]
-#define gl_FragData _glesFragData
-layout(location = 0) out mediump vec4 _glesFragData[4];
-
-uniform highp vec4 _Color;
-in lowp vec4 xlv_COLOR0;
-
-void main() {
- lowp vec4 c = xlv_COLOR0 * _Color;
- gl_FragData[0] = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3.txt
deleted file mode 100644
index d83e1dc05f7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-#version 300 es
-layout(location=0) out mediump vec4 _glesFragData[4];
-uniform highp vec4 _Color;
-in lowp vec4 xlv_COLOR0;
-void main ()
-{
- lowp vec4 c_1;
- highp vec4 tmpvar_2;
- tmpvar_2 = (xlv_COLOR0 * _Color);
- c_1 = tmpvar_2;
- _glesFragData[0] = c_1;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 1
-// #0: xlv_COLOR0 (low float) 4x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3Metal.txt
deleted file mode 100644
index 92c49d1fd94..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/mrt-unused-outES3Metal.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- half4 xlv_COLOR0;
-};
-struct xlatMtlShaderOutput {
- half4 _glesFragData_0 [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- float4 _Color;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- float4 tmpvar_2 = 0;
- tmpvar_2 = ((float4)(_mtl_i.xlv_COLOR0) * _mtl_u._Color);
- c_1 = half4(tmpvar_2);
- _mtl_o._glesFragData_0 = c_1;
- return _mtl_o;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 1
-// #0: xlv_COLOR0 (low float) 4x1 [-1]
-// uniforms: 1 (total size: 16)
-// #0: _Color (high float) 4x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-in.txt
deleted file mode 100644
index fdee4505eeb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-in.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-
-uniform vec3 uniVal;
-
-void main() {
- vec2 val;
- bool useZero = uniVal.x > 1.;
- if (useZero){
- gl_FragData[0] = vec4(0.);
- }
- else{
- val = uniVal.xy;
- xll_clip( (0.00100000 - val.x ) );
- xll_clip( (0.00100000 - val.y ) );
- gl_FragData[0] = vec4(1.);
- }
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-out.txt
deleted file mode 100644
index 1b9dc6076c9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/nested-inlining-out.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-uniform vec3 uniVal;
-void main ()
-{
- if ((uniVal.x > 1.0)) {
- gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0);
- } else {
- float x_1;
- x_1 = (0.001 - uniVal.x);
- if ((x_1 < 0.0)) {
- discard;
- };
- float x_2;
- x_2 = (0.001 - uniVal.y);
- if ((x_2 < 0.0)) {
- discard;
- };
- gl_FragData[0] = vec4(1.0, 1.0, 1.0, 1.0);
- };
-}
-
-
-// stats: 7 alu 2 tex 3 flow
-// uniforms: 1 (total size: 0)
-// #0: uniVal (high float) 3x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-in.txt
deleted file mode 100644
index 1739b903986..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-in.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-struct v2f {
- float f;
-};
-varying float var;
-void main() {
- v2f i;
- i.f = var;
- v2f i2 = i;
- gl_FragColor = vec4(abs(i2.f));
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-out.txt
deleted file mode 100644
index 47ff29d50c6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copyprop-struct-out.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-varying float var;
-void main ()
-{
- gl_FragColor = vec4(abs(var));
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 1
-// #0: var (high float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-in.txt
deleted file mode 100644
index 9ef290bcf5f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-in.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-varying vec2 uv;
-uniform sampler2D tex;
-void main() {
- vec4 v = texture2D (tex, uv);
- v.xy = v.yx;
- v.x = -v.x;
- gl_FragColor = v;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-out.txt
deleted file mode 100644
index 1013d7fd484..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-copypropelems-swizzle-out.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-varying vec2 uv;
-uniform sampler2D tex;
-void main ()
-{
- vec4 v_1;
- vec4 tmpvar_2;
- tmpvar_2 = texture2D (tex, uv);
- v_1.zw = tmpvar_2.zw;
- v_1.y = tmpvar_2.x;
- v_1.x = -(tmpvar_2.y);
- gl_FragColor = v_1;
-}
-
-
-// stats: 1 alu 1 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 2x1 [-1]
-// textures: 1
-// #0: tex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-in.txt
deleted file mode 100644
index b0fff79100f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-in.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-uniform sampler2D _MainTex;
-
-// presence of inout parameters with discard used inside
-// the function, and the variables not being trivially the same
-// type (vec4 vs vec3), can cause the actually unused
-// texture sample to be left in.
-void surf (vec2 uv, inout vec3 oo)
-{
- if (uv.x < 0.0)
- discard;
- oo = texture2D(_MainTex, uv).xyz;
-}
-
-void main()
-{
- vec3 oo;
- surf(gl_TexCoord[0].xy, oo);
-
- gl_FragData[0] = vec4(0.5);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-out.txt
deleted file mode 100644
index 42ec096463a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloads-out.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-void main ()
-{
- vec2 uv_1;
- uv_1 = gl_TexCoord[0].xy;
- if ((uv_1.x < 0.0)) {
- discard;
- };
- gl_FragData[0] = vec4(0.5, 0.5, 0.5, 0.5);
-}
-
-
-// stats: 2 alu 1 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-inES3.txt
deleted file mode 100644
index d8c3663b505..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-inES3.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-#version 300 es
-
-// Tree Creator Optimized Bark surface shader from Unity 4.x,
-// shadow caster pass. Used to not do dead code elimination
-// properly, i.e. was leaving normal map sample in the fragment shader.
-
-#define gl_FragColor _glesFragData[0]
-#define gl_FragData _glesFragData
-
-layout(location = 0) out mediump vec4 _glesFragData[4];
-float xll_saturate_f( float x) {
- return clamp( x, 0.0, 1.0);
-}
-
-struct SurfaceOutput {
- lowp vec3 Albedo;
- lowp vec3 Normal;
- lowp vec3 Emission;
- mediump float Specular;
- lowp float Gloss;
- lowp float Alpha;
-};
-
-struct LeafSurfaceOutput {
- lowp vec3 Albedo;
- lowp vec3 Normal;
- lowp vec3 Emission;
- lowp float Translucency;
- mediump float Specular;
- lowp float Gloss;
- lowp float Alpha;
-};
-
-struct Input {
- highp vec2 uv_MainTex;
- lowp vec4 color;
-};
-
-struct v2f_surf {
- highp vec4 pos;
-};
-
-uniform lowp vec4 _Color;
-uniform lowp vec3 _TranslucencyColor;
-uniform lowp float _TranslucencyViewDependency;
-uniform mediump float _ShadowStrength;
-
-uniform sampler2D _MainTex;
-uniform sampler2D _BumpSpecMap;
-uniform sampler2D _TranslucencyMap;
-
-lowp vec3 UnpackNormalDXT5nm( in lowp vec4 packednormal ) {
- lowp vec3 normal;
- normal.xy = ((packednormal.wy * 2.0) - 1.0);
- normal.z = sqrt((1.0 - xll_saturate_f(dot( normal.xy, normal.xy))));
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- lowp vec4 c = texture( _MainTex, IN.uv_MainTex);
- o.Albedo = ((c.xyz * _Color.xyz) * IN.color.w);
- lowp vec4 trngls = texture( _TranslucencyMap, IN.uv_MainTex);
- o.Gloss = (trngls.w * _Color.x);
- o.Alpha = c.w;
- mediump vec4 norspc = texture( _BumpSpecMap, IN.uv_MainTex);
- o.Specular = norspc.x;
- o.Normal = UnpackNormalDXT5nm( norspc);
-}
-lowp vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- o.Albedo = vec3(0.0);
- o.Emission = vec3(0.0);
- o.Specular = 0.0;
- o.Alpha = 0.0;
- o.Gloss = 0.0;
- surf (surfIN, o);
- return vec4(0.0);
-}
-void main() {
- lowp vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3.txt
deleted file mode 100644
index 7dc32ee7a97..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-#version 300 es
-layout(location=0) out mediump vec4 _glesFragData[4];
-void main ()
-{
- _glesFragData[0] = vec4(0.0, 0.0, 0.0, 0.0);
-}
-
-
-// stats: 1 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3Metal.txt
deleted file mode 100644
index 369965c5f31..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-dead-texloadstreeshadow-outES3Metal.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
-};
-struct xlatMtlShaderOutput {
- half4 _glesFragData_0 [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- _mtl_o._glesFragData_0 = half4(float4(0.0, 0.0, 0.0, 0.0));
- return _mtl_o;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-in.txt
deleted file mode 100644
index 1c968d66d32..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-in.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-struct v2f {
- vec4 pos;
- float unusedmember;
-};
-void main() {
- float f = gl_FragCoord.x;
-
- v2f sused;
- sused.pos = vec4(f);
- sused.unusedmember = f*6.0;
- v2f sunused;
- sunused.pos = vec4(f);
- sunused.unusedmember = f*7.0;
-
- float fused = f*2.0;
- float funused = f*3.0;
-
- float arrused[3];
- arrused[0] = f*4.0;
- float arrunused[3];
- arrunused[0] = f*5.0;
-
- gl_FragColor = vec4(fused+sused.pos.x+arrused[0]);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-out.txt
deleted file mode 100644
index 75b0220044d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcode-out.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-void main ()
-{
- gl_FragColor = vec4((((gl_FragCoord.x * 2.0) + gl_FragCoord.x) + (gl_FragCoord.x * 4.0)));
-}
-
-
-// stats: 4 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_FragCoord (high float) 4x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-in.txt
deleted file mode 100644
index a2afa10e031..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-in.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-struct foo {
- float used;
- float unused;
-};
-void main() {
- float f = 1.0;
- foo s;
- s.used = f;
- s.unused = f;
- gl_FragColor = vec4(s.used);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-out.txt
deleted file mode 100644
index b65fa08e0d7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-deadcodestruct-out.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main ()
-{
- gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
-}
-
-
-// stats: 1 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES.txt
deleted file mode 100644
index 3a7a3ee3329..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-varying lowp vec3 normal;
-varying lowp vec3 halfDir;
-uniform mediump float specPower;
-
-void main()
-{
- lowp float nh = dot (normal, halfDir);
- mediump float spec = pow (nh, specPower);
-
- lowp vec4 c;
- c = vec4(spec);
- gl_FragColor = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES3.txt
deleted file mode 100644
index 9d383f18a0e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-inES3.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-in lowp vec3 normal;
-in lowp vec3 halfDir;
-uniform mediump float specPower;
-
-void main()
-{
- lowp float nh = dot (normal, halfDir);
- mediump float spec = pow (nh, specPower);
-
- lowp vec4 c;
- c = vec4(spec);
- _fragData = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES.txt
deleted file mode 100644
index d5a6423efc3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-varying lowp vec3 normal;
-varying lowp vec3 halfDir;
-uniform mediump float specPower;
-void main ()
-{
- lowp vec4 c_1;
- lowp float tmpvar_2;
- tmpvar_2 = dot (normal, halfDir);
- mediump vec4 tmpvar_3;
- tmpvar_3 = vec4(pow (tmpvar_2, specPower));
- c_1 = tmpvar_3;
- gl_FragColor = c_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 2
-// #0: normal (low float) 3x1 [-1]
-// #1: halfDir (low float) 3x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: specPower (medium float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3.txt
deleted file mode 100644
index 9869db21f5f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-in lowp vec3 normal;
-in lowp vec3 halfDir;
-uniform mediump float specPower;
-void main ()
-{
- lowp vec4 c_1;
- lowp float tmpvar_2;
- tmpvar_2 = dot (normal, halfDir);
- mediump vec4 tmpvar_3;
- tmpvar_3 = vec4(pow (tmpvar_2, specPower));
- c_1 = tmpvar_3;
- _fragData = c_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 2
-// #0: normal (low float) 3x1 [-1]
-// #1: halfDir (low float) 3x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: specPower (medium float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3Metal.txt
deleted file mode 100644
index e6b85706ee2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-grafting-precision-outES3Metal.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- half3 normal;
- half3 halfDir;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- half specPower;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- half tmpvar_2 = 0;
- tmpvar_2 = dot (_mtl_i.normal, _mtl_i.halfDir);
- half4 tmpvar_3 = 0;
- tmpvar_3 = half4(pow (tmpvar_2, _mtl_u.specPower));
- c_1 = tmpvar_3;
- _mtl_o._fragData = c_1;
- return _mtl_o;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 2
-// #0: normal (low float) 3x1 [-1]
-// #1: halfDir (low float) 3x1 [-1]
-// uniforms: 1 (total size: 2)
-// #0: specPower (medium float) 1x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-in.txt
deleted file mode 100644
index 2b935104996..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-in.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-void main() {
- vec4 c = vec4(0.0);
-
- // nested ifs
- if (gl_FragCoord.x > 0.5) {
- if (gl_FragCoord.y > 0.5) {
- c = vec4(0.5);
- }
- }
- gl_FragColor = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-out.txt
deleted file mode 100644
index 9ad099bb7df..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-ifs-out.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-void main ()
-{
- vec4 c_1;
- c_1 = vec4(0.0, 0.0, 0.0, 0.0);
- if (((gl_FragCoord.x > 0.5) && (gl_FragCoord.y > 0.5))) {
- c_1 = vec4(0.5, 0.5, 0.5, 0.5);
- };
- gl_FragColor = c_1;
-}
-
-
-// stats: 5 alu 0 tex 1 flow
-// inputs: 1
-// #0: gl_FragCoord (high float) 4x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-in.txt
deleted file mode 100644
index eff6bfbd95e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-in.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-struct SurfaceOutput {
- vec4 color;
-};
-void surf(inout SurfaceOutput o) {
- o.color = vec4(1);
-}
-void main() {
- SurfaceOutput o;
- surf(o);
- gl_FragColor = o.color;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-out.txt
deleted file mode 100644
index b65fa08e0d7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-inline-inoutstruct-out.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main ()
-{
- gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
-}
-
-
-// stats: 1 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-inES.txt
deleted file mode 100644
index a56d4f06203..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-inES.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-varying lowp float xx;
-
-int func(inout float x)
-{
- x = x*2.0;
- return 0;
-}
-
-void main()
-{
- lowp float x = xx;
-
- int i = func(x); // side effects!
-
- if (x < 0.0)
- discard;
-
- lowp float c = 0.0;
- for (; i < 4; ++i)
- c += xx;
- gl_FragColor = vec4(c);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-outES.txt
deleted file mode 100644
index d41b3c0726a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect-outES.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-varying lowp float xx;
-void main ()
-{
- lowp float c_1;
- lowp float x_2;
- x_2 = (xx * 2.0);
- if ((x_2 < 0.0)) {
- discard;
- };
- c_1 = (xx + xx);
- c_1 = (c_1 + xx);
- c_1 = (c_1 + xx);
- lowp vec4 tmpvar_3;
- tmpvar_3 = vec4(c_1);
- gl_FragColor = tmpvar_3;
-}
-
-
-// stats: 5 alu 1 tex 1 flow
-// inputs: 1
-// #0: xx (low float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-inES.txt
deleted file mode 100644
index 36449736b77..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-inES.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-varying lowp float xx;
-
-void main()
-{
- int x;
-
- int i = (x=(xx>0.5?2:4)); // side effects!
-
- if (x < 2)
- discard;
-
- lowp float c = 0.0;
- for (; i < 4; ++i)
- c += xx;
- gl_FragColor = vec4(c);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt
deleted file mode 100644
index 3c7c7d1a82d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-sideeffect2-outES.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-varying lowp float xx;
-void main ()
-{
- lowp float c_1;
- highp int tmpvar_3;
- if ((xx > 0.5)) {
- tmpvar_3 = 2;
- } else {
- tmpvar_3 = 4;
- };
- if ((tmpvar_3 < 2)) {
- discard;
- };
- c_1 = 0.0;
- for (highp int i_2 = tmpvar_3; i_2 < 4; i_2++) {
- c_1 = (c_1 + xx);
- };
- lowp vec4 tmpvar_4;
- tmpvar_4 = vec4(c_1);
- gl_FragColor = tmpvar_4;
-}
-
-
-// stats: 8 alu 1 tex 4 flow
-// inputs: 1
-// #0: xx (low float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-inES.txt
deleted file mode 100644
index 3718af198ee..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-inES.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-varying lowp float xx;
-
-void main()
-{
- int i = 0;
-
- if (xx < 0.0)
- discard;
-
- lowp float c = 0.0;
- for (; i < 4; ++i)
- c += xx;
- gl_FragColor = vec4(c);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-outES.txt
deleted file mode 100644
index 114c07881d0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-movevars-simple-outES.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-varying lowp float xx;
-void main ()
-{
- lowp float c_1;
- if ((xx < 0.0)) {
- discard;
- };
- c_1 = (xx + xx);
- c_1 = (c_1 + xx);
- c_1 = (c_1 + xx);
- lowp vec4 tmpvar_2;
- tmpvar_2 = vec4(c_1);
- gl_FragColor = tmpvar_2;
-}
-
-
-// stats: 4 alu 1 tex 1 flow
-// inputs: 1
-// #0: xx (low float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-in.txt
deleted file mode 100644
index d443d2d04ce..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-in.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main() {
- vec2 c = vec2(0.0);
- for (int j = 0; j < 2; ++j) {
- c += abs (vec2(vec2(0.0)[j]));
- }
- gl_FragColor = vec4(c,0.0,0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-out.txt
deleted file mode 100644
index 5dd28832008..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vec-var-index-out.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1.zw = vec2(0.0, 0.0);
- tmpvar_1.xy = vec2(0.0, 0.0);
- gl_FragColor = tmpvar_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-in.txt
deleted file mode 100644
index ff6b005dec6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-in.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-uniform sampler2D maintex;
-uniform float factor;
-varying vec2 uv;
-void main()
-{
- vec4 c = texture2D (maintex, uv);
- vec2 coord = c.xy;
- bool cond = c.w >= 0.5;
- if (!cond)
- coord.x += factor;
- if (cond)
- coord.y += factor;
- gl_FragColor = vec4(coord,0,0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-out.txt
deleted file mode 100644
index e788e97b1e5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-ifs-out.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-uniform sampler2D maintex;
-uniform float factor;
-varying vec2 uv;
-void main ()
-{
- vec2 coord_1;
- vec4 tmpvar_2;
- tmpvar_2 = texture2D (maintex, uv);
- coord_1 = tmpvar_2.xy;
- bool tmpvar_3;
- tmpvar_3 = (tmpvar_2.w >= 0.5);
- if (!(tmpvar_3)) {
- coord_1.x = (tmpvar_2.x + factor);
- };
- if (tmpvar_3) {
- coord_1.y = (tmpvar_2.y + factor);
- };
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = coord_1;
- gl_FragColor = tmpvar_4;
-}
-
-
-// stats: 5 alu 1 tex 2 flow
-// inputs: 1
-// #0: uv (high float) 2x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: factor (high float) 1x1 [-1]
-// textures: 1
-// #0: maintex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-in.txt
deleted file mode 100644
index 78f15502a3d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-in.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-uniform float _Fresnel;
-uniform float _SpecIntensity;
-float saturate (float f) { return max(0.0, min(1.0,f)); }
-float splineFresnel (in vec3 N, in vec3 E, in float specIntensity, in float fresnel)
-{
- float factor = (1.0 - saturate(dot(N,E)));
- float factor3 = ((factor * factor) * factor);
- vec3 p = vec3(1.0, factor, factor3);
- vec2 t = vec2(1.0 - fresnel, fresnel);
- p.x = dot(p.xy, t);
- p.y = dot(p.yz, t);
- factor = (0.05 + (0.95 * dot(p.xy, t)));
- factor *= specIntensity;
- return factor;
-}
-varying vec3 inN;
-varying vec3 inE;
-void main()
-{
- float f = splineFresnel (inN, inE, _SpecIntensity, _Fresnel);
- gl_FragColor = vec4(f);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-out.txt
deleted file mode 100644
index 21c35befbcc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-retval-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform float _Fresnel;
-uniform float _SpecIntensity;
-varying vec3 inN;
-varying vec3 inE;
-void main ()
-{
- vec3 p_1;
- float factor_2;
- float tmpvar_3;
- tmpvar_3 = (1.0 - min (max (
- dot (inN, inE)
- , 0.0), 1.0));
- vec3 tmpvar_4;
- tmpvar_4.x = 1.0;
- tmpvar_4.y = tmpvar_3;
- tmpvar_4.z = ((tmpvar_3 * tmpvar_3) * tmpvar_3);
- p_1.z = tmpvar_4.z;
- vec2 tmpvar_5;
- tmpvar_5.x = (1.0 - _Fresnel);
- tmpvar_5.y = _Fresnel;
- p_1.x = dot (tmpvar_4.xy, tmpvar_5);
- p_1.y = dot (tmpvar_4.yz, tmpvar_5);
- factor_2 = (0.05 + (0.95 * dot (p_1.xy, tmpvar_5)));
- factor_2 = (factor_2 * _SpecIntensity);
- gl_FragColor = vec4(factor_2);
-}
-
-
-// stats: 14 alu 0 tex 0 flow
-// inputs: 2
-// #0: inN (high float) 3x1 [-1]
-// #1: inE (high float) 3x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: _Fresnel (high float) 1x1 [-1]
-// #1: _SpecIntensity (high float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-in.txt
deleted file mode 100644
index 7adaba4b50d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-in.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-uniform sampler2D maintex;
-uniform float factor;
-varying vec2 uv;
-void main() {
- vec4 c = texture2D(maintex, uv);
- vec4 r;
- // when these become vectorized, they need to turn scalar
- // arguments into proper types as well
- r.x = max(0.123, c.x);
- r.y = max(0.123, c.y);
- r.z = min(c.z, factor);
- r.w = min(c.w, factor);
- gl_FragColor = r;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-out.txt
deleted file mode 100644
index 08d56ea9b83..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/opt-vectorize-types-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-uniform sampler2D maintex;
-uniform float factor;
-varying vec2 uv;
-void main ()
-{
- vec4 r_1;
- vec4 tmpvar_2;
- tmpvar_2 = texture2D (maintex, uv);
- r_1.xy = max (vec2(0.123, 0.123), tmpvar_2.xy);
- r_1.zw = min (tmpvar_2.zw, vec2(factor));
- gl_FragColor = r_1;
-}
-
-
-// stats: 2 alu 1 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 2x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: factor (high float) 1x1 [-1]
-// textures: 1
-// #0: maintex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/pp-basic-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/pp-basic-in.txt
deleted file mode 100644
index 975ea8da1d7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/pp-basic-in.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-#define FRAGMENT
-
-#ifdef VERTEX
-foo bar baz
-#endif
-
-#ifdef FRAGMENT
-vec4 xlat_main () {
- return vec4(1.0);
-}
-#endif
-
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main();
- gl_FragData[0] = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/pp-basic-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/pp-basic-out.txt
deleted file mode 100644
index 3c287668c3f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/pp-basic-out.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main ()
-{
- gl_FragData[0] = vec4(1.0, 1.0, 1.0, 1.0);
-}
-
-
-// stats: 1 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-inES.txt
deleted file mode 100644
index 20bf6dbe01a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-inES.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-precision highp float;
-precision lowp int;
-
-struct MyStruct {
- float f;
- int i;
-};
-uniform MyStruct s1;
-
-uniform float fh1;
-uniform highp float fh2;
-uniform mediump float fm;
-
-uniform int il1;
-uniform lowp int il2;
-uniform mediump int im;
-
-
-void main() {
- lowp float f = fh1 + fh2 + fm + s1.f;
- highp int i = il1 + il2 + im + s1.i;
- float z = 0.0;
- z += gl_FragCoord.x > 0.5 ? 0.9 : 0.1;
- gl_FragColor = vec4(f, i, z, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt
deleted file mode 100644
index 138e77f72be..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-default-outES.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-precision lowp int;
-precision highp float;
-struct MyStruct {
- float f;
- int i;
-};
-uniform MyStruct s1;
-uniform float fh1;
-uniform highp float fh2;
-uniform mediump float fm;
-uniform highp int il1;
-uniform lowp int il2;
-uniform mediump int im;
-void main ()
-{
- highp int i_1;
- lowp float f_2;
- highp float tmpvar_3;
- tmpvar_3 = (((fh1 + fh2) + fm) + s1.f);
- f_2 = tmpvar_3;
- mediump int tmpvar_4;
- tmpvar_4 = (((il1 + il2) + im) + s1.i);
- i_1 = tmpvar_4;
- highp float tmpvar_5;
- if ((gl_FragCoord.x > 0.5)) {
- tmpvar_5 = 0.9;
- } else {
- tmpvar_5 = 0.1;
- };
- highp vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.x = f_2;
- tmpvar_6.y = float(i_1);
- tmpvar_6.z = tmpvar_5;
- gl_FragColor = tmpvar_6;
-}
-
-
-// stats: 11 alu 0 tex 1 flow
-// inputs: 1
-// #0: gl_FragCoord (high float) 4x1 [-1] loc 0
-// uniforms: 7 (total size: 0)
-// #0: s1 (high other) 0x0 [-1]
-// #1: fh1 (high float) 1x1 [-1]
-// #2: fh2 (high float) 1x1 [-1]
-// #3: fm (medium float) 1x1 [-1]
-// #4: il1 (high int) 1x1 [-1]
-// #5: il2 (low int) 1x1 [-1]
-// #6: im (medium int) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-inES3.txt
deleted file mode 100644
index bf4d59015aa..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-inES3.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-
-uniform mediump mat4 _LightMatrix;
-uniform highp vec3 _WorldPos;
-
-void main()
-{
- // Used to expose bug in Metal output where it was inserting cast in the wrong place,
- // i.e. it was doing a v3 = (float4)(mat * vec).xyz
- mediump vec3 lightCoord = vec3 ( (_LightMatrix * vec4(_WorldPos, 1.0)) );
-
- mediump vec4 r;
- r.xyz = lightCoord;
- r.w = 1.0;
- _fragData = r;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3.txt
deleted file mode 100644
index b5bb790a750..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-uniform mediump mat4 _LightMatrix;
-uniform highp vec3 _WorldPos;
-void main ()
-{
- mediump vec4 r_1;
- mediump vec3 lightCoord_2;
- highp vec4 tmpvar_3;
- tmpvar_3.w = 1.0;
- tmpvar_3.xyz = _WorldPos;
- highp vec3 tmpvar_4;
- tmpvar_4 = (_LightMatrix * tmpvar_3).xyz;
- lightCoord_2 = tmpvar_4;
- r_1.xyz = lightCoord_2;
- r_1.w = 1.0;
- _fragData = r_1;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// uniforms: 2 (total size: 0)
-// #0: _LightMatrix (medium float) 4x4 [-1]
-// #1: _WorldPos (high float) 3x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3Metal.txt
deleted file mode 100644
index 1d56e351e7b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-expressions-outES3Metal.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- half4x4 _LightMatrix;
- float3 _WorldPos;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 r_1 = 0;
- half3 lightCoord_2 = 0;
- float4 tmpvar_3 = 0;
- tmpvar_3.w = 1.0;
- tmpvar_3.xyz = _mtl_u._WorldPos;
- float3 tmpvar_4 = 0;
- tmpvar_4 = ((float4)(_mtl_u._LightMatrix * (half4)(tmpvar_3))).xyz;
- lightCoord_2 = half3(tmpvar_4);
- r_1.xyz = lightCoord_2;
- r_1.w = half(1.0);
- _mtl_o._fragData = r_1;
- return _mtl_o;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// uniforms: 2 (total size: 48)
-// #0: _LightMatrix (medium float) 4x4 [-1] loc 0
-// #1: _WorldPos (high float) 3x1 [-1] loc 32
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-inES.txt
deleted file mode 100644
index 423f9bd6a9d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-inES.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-float xll_saturate(float x) {
- return clamp(x, 0.0, 1.0);
-}
-vec3 xll_saturate(vec3 x) {
- return clamp(x, 0.0, 1.0);
-}
-uniform sampler2D _MainTex;
-uniform sampler2D _BurntTex;
-uniform mediump float _EmberFadeEnd;
-uniform mediump float _EmberFadeStart;
-lowp vec4 frag (mediump vec2 uv) {
- lowp vec3 base = texture2D(_MainTex, uv).xyz;
- lowp vec3 burn = texture2D(_BurntTex, uv).xyz;
- lowp float t;
- t = xll_saturate( ((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)) );
- return vec4(mix(base, burn, vec3(t)), 1.0);
-}
-varying mediump vec2 xlv_TEXCOORD0;
-void main() {
- gl_FragColor = frag(xlv_TEXCOORD0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt
deleted file mode 100644
index bdda6f01f74..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr1-outES.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-uniform sampler2D _MainTex;
-uniform sampler2D _BurntTex;
-uniform mediump float _EmberFadeEnd;
-uniform mediump float _EmberFadeStart;
-varying mediump vec2 xlv_TEXCOORD0;
-void main ()
-{
- lowp float tmpvar_1;
- mediump float tmpvar_2;
- tmpvar_2 = clamp (((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)), 0.0, 1.0);
- tmpvar_1 = tmpvar_2;
- lowp vec4 tmpvar_3;
- tmpvar_3.w = 1.0;
- tmpvar_3.xyz = mix (texture2D (_MainTex, xlv_TEXCOORD0).xyz, texture2D (_BurntTex, xlv_TEXCOORD0).xyz, vec3(tmpvar_1));
- gl_FragColor = tmpvar_3;
-}
-
-
-// stats: 6 alu 2 tex 0 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: _EmberFadeEnd (medium float) 1x1 [-1]
-// #1: _EmberFadeStart (medium float) 1x1 [-1]
-// textures: 2
-// #0: _MainTex (low 2d) 0x0 [-1]
-// #1: _BurntTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-inES.txt
deleted file mode 100644
index 5edf9d2da0d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-inES.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-float xll_saturate(float x) {
- return clamp(x, 0.0, 1.0);
-}
-vec3 xll_saturate(vec3 x) {
- return clamp(x, 0.0, 1.0);
-}
-uniform sampler2D _MainTex;
-uniform sampler2D _BurntTex;
-uniform mediump float _EmberFadeEnd;
-uniform mediump float _EmberFadeStart;
-lowp vec4 frag (mediump vec2 uv) {
- lowp vec3 base = texture2D(_MainTex, uv).xyz;
- lowp vec3 burn = texture2D(_BurntTex, uv).xyz;
- lowp vec3 t;
- t = vec3( xll_saturate( ((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)) ) );
- return vec4(mix(base, burn, t), 1.0);
-}
-varying mediump vec2 xlv_TEXCOORD0;
-void main() {
- gl_FragColor = frag(xlv_TEXCOORD0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt
deleted file mode 100644
index e132db421b7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-inlineexpr2-outES.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-uniform sampler2D _MainTex;
-uniform sampler2D _BurntTex;
-uniform mediump float _EmberFadeEnd;
-uniform mediump float _EmberFadeStart;
-varying mediump vec2 xlv_TEXCOORD0;
-void main ()
-{
- mediump float tmpvar_1;
- tmpvar_1 = clamp (((_EmberFadeStart - 0.05) / (_EmberFadeStart - _EmberFadeEnd)), 0.0, 1.0);
- lowp vec3 tmpvar_2;
- tmpvar_2 = vec3(tmpvar_1);
- lowp vec4 tmpvar_3;
- tmpvar_3.w = 1.0;
- tmpvar_3.xyz = mix (texture2D (_MainTex, xlv_TEXCOORD0).xyz, texture2D (_BurntTex, xlv_TEXCOORD0).xyz, tmpvar_2);
- gl_FragColor = tmpvar_3;
-}
-
-
-// stats: 6 alu 2 tex 0 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: _EmberFadeEnd (medium float) 1x1 [-1]
-// #1: _EmberFadeStart (medium float) 1x1 [-1]
-// textures: 2
-// #0: _MainTex (low 2d) 0x0 [-1]
-// #1: _BurntTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-inES3.txt
deleted file mode 100644
index 49922cbf773..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-inES3.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-#version 300 es
-
-// A very cut down variant of Unity's directional lightmap;
-// has an inline medium precision matrix constructor,
-// but even if dirBasis is declared as mediump
-// some code was promoting it to high precision.
-
-out mediump vec4 _glesFragData;
-
-mat3 transposem3(mat3 m) {
- 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]);
-}
-
-in mediump vec3 inNormal;
-
-void main()
-{
- mediump mat3 dirBasis = transposem3(mat3(
- vec3( 0.8164966, 0.0, 0.5773503),
- vec3( -0.4082483, 0.7071068, 0.5773503),
- vec3( -0.4082483, -0.7071068, 0.5773503)));
- mediump vec4 c;
- c.xyz = dirBasis * inNormal;
- c.w = 0.0;
- _glesFragData = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3.txt
deleted file mode 100644
index 0f26e32ac16..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-#version 300 es
-out mediump vec4 _glesFragData;
-in mediump vec3 inNormal;
-void main ()
-{
- mediump vec4 c_1;
- mediump mat3 tmpvar_2;
- tmpvar_2[uint(0)].x = 0.8164966;
- tmpvar_2[uint(0)].y = -0.4082483;
- tmpvar_2[uint(0)].z = -0.4082483;
- tmpvar_2[1u].x = 0.0;
- tmpvar_2[1u].y = 0.7071068;
- tmpvar_2[1u].z = -0.7071068;
- tmpvar_2[2u].x = 0.5773503;
- tmpvar_2[2u].y = 0.5773503;
- tmpvar_2[2u].z = 0.5773503;
- c_1.xyz = (tmpvar_2 * inNormal);
- c_1.w = 0.0;
- _glesFragData = c_1;
-}
-
-
-// stats: 11 alu 0 tex 0 flow
-// inputs: 1
-// #0: inNormal (medium float) 3x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3Metal.txt
deleted file mode 100644
index 002b1233541..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-matrix-constr-outES3Metal.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- half3 inNormal;
-};
-struct xlatMtlShaderOutput {
- half4 _glesFragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- half3x3 tmpvar_2;
- tmpvar_2[0].x = half(0.8164966);
- tmpvar_2[0].y = half(-0.4082483);
- tmpvar_2[0].z = half(-0.4082483);
- tmpvar_2[1].x = half(0.0);
- tmpvar_2[1].y = half(0.7071068);
- tmpvar_2[1].z = half(-0.7071068);
- tmpvar_2[2].x = half(0.5773503);
- tmpvar_2[2].y = half(0.5773503);
- tmpvar_2[2].z = half(0.5773503);
- c_1.xyz = (tmpvar_2 * _mtl_i.inNormal);
- c_1.w = half(0.0);
- _mtl_o._glesFragData = c_1;
- return _mtl_o;
-}
-
-
-// stats: 11 alu 0 tex 0 flow
-// inputs: 1
-// #0: inNormal (medium float) 3x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-temps-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-temps-inES.txt
deleted file mode 100644
index 5e3a5fba331..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-temps-inES.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-struct v2f_surf {
- highp vec4 pos;
- lowp vec2 pack0;
- lowp vec3 halfDir;
- lowp vec3 lightDir;
- lowp vec3 vlight;
-};
-uniform sampler2D _BumpMap;
-uniform lowp vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform lowp float _Shininess;
-lowp vec4 frag_surf (in v2f_surf IN) {
- lowp vec4 tex;
- lowp vec3 Normal;
- lowp float diff;
- lowp float nh;
- lowp float spec;
- lowp vec4 c;
- tex = texture2D (_MainTex, IN.pack0);
- Normal = (texture2D( _BumpMap, IN.pack0).xyz * 2.0) - 1.0;
- diff = max (0.0, dot(Normal, IN.lightDir));
- nh = max (0.0, dot(Normal, IN.halfDir));
- spec = pow(nh, _Shininess) * tex.w;
- c.xyz = ((vec3(tex) * ((_LightColor0.xyz * diff) + IN.vlight)) + (_LightColor0.xyz * spec));
- c.w = 0.00000;
- return c;
-}
-varying lowp vec2 xlv_TEXCOORD0;
-varying lowp vec3 xlv_TEXCOORD1;
-varying lowp vec3 xlv_TEXCOORD2;
-varying lowp vec3 xlv_TEXCOORD3;
-void main() {
- lowp vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.pack0 = vec2(xlv_TEXCOORD0);
- xlt_IN.halfDir = vec3(xlv_TEXCOORD1);
- xlt_IN.lightDir = vec3(xlv_TEXCOORD2);
- xlt_IN.vlight = vec3(xlv_TEXCOORD3);
- xl_retval = frag_surf(xlt_IN);
- gl_FragData[0] = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-temps-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-temps-outES.txt
deleted file mode 100644
index d1eb06ac388..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-temps-outES.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform lowp vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform lowp float _Shininess;
-varying lowp vec2 xlv_TEXCOORD0;
-varying lowp vec3 xlv_TEXCOORD1;
-varying lowp vec3 xlv_TEXCOORD2;
-varying lowp vec3 xlv_TEXCOORD3;
-void main ()
-{
- lowp vec4 c_1;
- lowp vec3 Normal_2;
- lowp vec4 tmpvar_3;
- tmpvar_3 = texture2D (_MainTex, xlv_TEXCOORD0);
- Normal_2 = ((texture2D (_BumpMap, xlv_TEXCOORD0).xyz * 2.0) - 1.0);
- c_1.xyz = ((tmpvar_3.xyz * (
- (_LightColor0.xyz * max (0.0, dot (Normal_2, xlv_TEXCOORD2)))
- + xlv_TEXCOORD3)) + (_LightColor0.xyz * (
- pow (max (0.0, dot (Normal_2, xlv_TEXCOORD1)), _Shininess)
- * tmpvar_3.w)));
- c_1.w = 0.0;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 14 alu 2 tex 0 flow
-// inputs: 4
-// #0: xlv_TEXCOORD0 (low float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (low float) 3x1 [-1]
-// #2: xlv_TEXCOORD2 (low float) 3x1 [-1]
-// #3: xlv_TEXCOORD3 (low float) 3x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: _LightColor0 (low float) 4x1 [-1]
-// #1: _Shininess (low float) 1x1 [-1]
-// textures: 2
-// #0: _BumpMap (low 2d) 0x0 [-1]
-// #1: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-inES.txt
deleted file mode 100644
index b52e1fc4b00..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-inES.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-uniform sampler2D tex_def;
-uniform lowp sampler2D tex_lowp;
-uniform highp sampler2D tex_highp;
-varying lowp vec2 var_lowp;
-varying mediump vec2 var_mediump;
-void main()
-{
- lowp vec4 c1;
- c1 = texture2D (tex_def, var_lowp) * 2.0;
- lowp vec4 c2;
- c2 = texture2D (tex_def, var_mediump) * 2.0;
- lowp vec4 c3;
- c3 = texture2D (tex_highp, var_mediump) * 2.0;
- lowp vec4 c4;
- c4 = texture2D (tex_lowp, var_mediump) * 2.0;
-
- lowp vec4 a1;
- a1 = abs(var_lowp.xxxx);
-
- gl_FragColor = c1 + c2 + c3 + c4 + a1;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-outES.txt
deleted file mode 100644
index f0ef5372fda..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-tempssimple-outES.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-uniform sampler2D tex_def;
-uniform sampler2D tex_lowp;
-uniform highp sampler2D tex_highp;
-varying lowp vec2 var_lowp;
-varying mediump vec2 var_mediump;
-void main ()
-{
- lowp vec4 c4_1;
- lowp vec4 c3_2;
- lowp vec4 c2_3;
- lowp vec4 c1_4;
- c1_4 = (texture2D (tex_def, var_lowp) * 2.0);
- c2_3 = (texture2D (tex_def, var_mediump) * 2.0);
- highp vec4 tmpvar_5;
- tmpvar_5 = texture2D (tex_highp, var_mediump);
- c3_2 = (tmpvar_5 * 2.0);
- c4_1 = (texture2D (tex_lowp, var_mediump) * 2.0);
- lowp vec4 tmpvar_6;
- tmpvar_6 = abs(var_lowp.xxxx);
- gl_FragColor = ((c1_4 + c2_3) + ((c3_2 + c4_1) + tmpvar_6));
-}
-
-
-// stats: 9 alu 4 tex 0 flow
-// inputs: 2
-// #0: var_lowp (low float) 2x1 [-1]
-// #1: var_mediump (medium float) 2x1 [-1]
-// textures: 3
-// #0: tex_def (low 2d) 0x0 [-1]
-// #1: tex_lowp (low 2d) 0x0 [-1]
-// #2: tex_highp (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-inES.txt
deleted file mode 100644
index 237b36b1c53..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-inES.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-uniform mediump float med_a;
-uniform mediump float med_b;
-uniform lowp float low_c;
-
-void main()
-{
- // must be computed at mediump since some args are mediump
- lowp float t = (med_a + low_c / med_b);
- // computed at lowp
- lowp vec4 c = clamp(vec4(t), 0.0, 1.0);
-
- gl_FragColor = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-outES.txt
deleted file mode 100644
index 7f50273f899..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/prec-treegrafting-outES.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-uniform mediump float med_a;
-uniform mediump float med_b;
-uniform lowp float low_c;
-void main ()
-{
- lowp float t_1;
- mediump float tmpvar_2;
- tmpvar_2 = (med_a + (low_c / med_b));
- t_1 = tmpvar_2;
- lowp vec4 tmpvar_3;
- tmpvar_3 = clamp (vec4(t_1), 0.0, 1.0);
- gl_FragColor = tmpvar_3;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// uniforms: 3 (total size: 0)
-// #0: med_a (medium float) 1x1 [-1]
-// #1: med_b (medium float) 1x1 [-1]
-// #2: low_c (low float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-inES3.txt
deleted file mode 100644
index 111dcc7735d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-inES3.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-#version 300 es
-precision mediump float;
-
-layout(location=0) out vec4 final_color0;
-layout(location=1) out vec4 final_color1;
-layout(location=2) out vec4 final_color2;
-
-void main()
-{
- final_color0 = vec4(1,0,0,1);
- final_color1 = vec4(0,1,0,1);
- final_color2 = vec4(0,0,1,1);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3.txt
deleted file mode 100644
index a63f3a5e8ed..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-#version 300 es
-precision mediump float;
-layout(location=0) out vec4 final_color0;
-layout(location=1) out vec4 final_color1;
-layout(location=2) out vec4 final_color2;
-void main ()
-{
- final_color0 = vec4(1.0, 0.0, 0.0, 1.0);
- final_color1 = vec4(0.0, 1.0, 0.0, 1.0);
- final_color2 = vec4(0.0, 0.0, 1.0, 1.0);
-}
-
-
-// stats: 3 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3Metal.txt
deleted file mode 100644
index 5edc1f20775..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/qualifiers-layout-outES3Metal.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
-};
-struct xlatMtlShaderOutput {
- float4 final_color0 [[color(0)]];
- float4 final_color1 [[color(1)]];
- float4 final_color2 [[color(2)]];
-};
-struct xlatMtlShaderUniform {
-};
-;
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- _mtl_o.final_color0 = float4(1.0, 0.0, 0.0, 1.0);
- _mtl_o.final_color1 = float4(0.0, 1.0, 0.0, 1.0);
- _mtl_o.final_color2 = float4(0.0, 0.0, 1.0, 1.0);
- return _mtl_o;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES.txt
deleted file mode 100644
index 009b3819c74..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-uniform sampler2D texlow;
-uniform mediump sampler2D texmed;
-uniform highp sampler2D texhigh;
-uniform samplerCube cubelow;
-uniform mediump samplerCube cubemed;
-uniform highp samplerCube cubehigh;
-
-mediump vec4 xlat_main(in highp vec4 uv) {
- mediump vec4 c;
- c = texture2D(texlow, uv.xy);
- c += texture2D(texmed, uv.xy);
- c += texture2D(texhigh, uv.xy);
- c += textureCube(cubelow, uv.xyz);
- c += textureCube(cubemed, uv.xyz);
- c += textureCube(cubehigh, uv.xyz);
- return c;
-}
-varying highp vec4 varUV;
-void main() {
- mediump vec4 r;
- r = xlat_main(varUV);
- gl_FragData[0] = r;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt
deleted file mode 100644
index cee9269e6eb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-inES3.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-uniform sampler2D texlow;
-uniform mediump sampler2D texmed;
-uniform highp sampler2D texhigh;
-uniform samplerCube cubelow;
-uniform mediump samplerCube cubemed;
-uniform highp samplerCube cubehigh;
-
-mediump vec4 xlat_main(in highp vec4 uv) {
- mediump vec4 c;
- c = texture(texlow, uv.xy);
- c += texture(texmed, uv.xy);
- c += texture(texhigh, uv.xy);
- c += texture(cubelow, uv.xyz);
- c += texture(cubemed, uv.xyz);
- c += texture(cubehigh, uv.xyz);
- return c;
-}
-in highp vec4 varUV;
-void main() {
- mediump vec4 r;
- r = xlat_main(varUV);
- _fragData = r;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt
deleted file mode 100644
index 7301c179fe4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-uniform sampler2D texlow;
-uniform mediump sampler2D texmed;
-uniform highp sampler2D texhigh;
-uniform lowp samplerCube cubelow;
-uniform mediump samplerCube cubemed;
-uniform highp samplerCube cubehigh;
-varying highp vec4 varUV;
-void main ()
-{
- mediump vec4 c_1;
- lowp vec4 tmpvar_2;
- tmpvar_2 = texture2D (texlow, varUV.xy);
- c_1 = tmpvar_2;
- c_1 = (c_1 + texture2D (texmed, varUV.xy));
- highp vec4 tmpvar_3;
- tmpvar_3 = texture2D (texhigh, varUV.xy);
- c_1 = (c_1 + tmpvar_3);
- lowp vec4 tmpvar_4;
- tmpvar_4 = textureCube (cubelow, varUV.xyz);
- c_1 = (c_1 + tmpvar_4);
- c_1 = (c_1 + textureCube (cubemed, varUV.xyz));
- highp vec4 tmpvar_5;
- tmpvar_5 = textureCube (cubehigh, varUV.xyz);
- c_1 = (c_1 + tmpvar_5);
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 5 alu 6 tex 0 flow
-// inputs: 1
-// #0: varUV (high float) 4x1 [-1]
-// textures: 6
-// #0: texlow (low 2d) 0x0 [-1]
-// #1: texmed (medium 2d) 0x0 [-1]
-// #2: texhigh (high 2d) 0x0 [-1]
-// #3: cubelow (low cube) 0x0 [-1]
-// #4: cubemed (medium cube) 0x0 [-1]
-// #5: cubehigh (high cube) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt
deleted file mode 100644
index af995d19c3d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-uniform sampler2D texlow;
-uniform mediump sampler2D texmed;
-uniform highp sampler2D texhigh;
-uniform lowp samplerCube cubelow;
-uniform mediump samplerCube cubemed;
-uniform highp samplerCube cubehigh;
-in highp vec4 varUV;
-void main ()
-{
- mediump vec4 c_1;
- lowp vec4 tmpvar_2;
- tmpvar_2 = texture (texlow, varUV.xy);
- c_1 = tmpvar_2;
- c_1 = (c_1 + texture (texmed, varUV.xy));
- highp vec4 tmpvar_3;
- tmpvar_3 = texture (texhigh, varUV.xy);
- c_1 = (c_1 + tmpvar_3);
- lowp vec4 tmpvar_4;
- tmpvar_4 = texture (cubelow, varUV.xyz);
- c_1 = (c_1 + tmpvar_4);
- c_1 = (c_1 + texture (cubemed, varUV.xyz));
- highp vec4 tmpvar_5;
- tmpvar_5 = texture (cubehigh, varUV.xyz);
- c_1 = (c_1 + tmpvar_5);
- _fragData = c_1;
-}
-
-
-// stats: 5 alu 6 tex 0 flow
-// inputs: 1
-// #0: varUV (high float) 4x1 [-1]
-// textures: 6
-// #0: texlow (low 2d) 0x0 [-1]
-// #1: texmed (medium 2d) 0x0 [-1]
-// #2: texhigh (high 2d) 0x0 [-1]
-// #3: cubelow (low cube) 0x0 [-1]
-// #4: cubemed (medium cube) 0x0 [-1]
-// #5: cubehigh (high cube) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt
deleted file mode 100644
index 24ac7348b5b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/sampler-precision-outES3Metal.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 varUV;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> texlow [[texture(0)]], sampler _mtlsmp_texlow [[sampler(0)]]
- , texture2d<half> texmed [[texture(1)]], sampler _mtlsmp_texmed [[sampler(1)]]
- , texture2d<float> texhigh [[texture(2)]], sampler _mtlsmp_texhigh [[sampler(2)]]
- , texturecube<half> cubelow [[texture(3)]], sampler _mtlsmp_cubelow [[sampler(3)]]
- , texturecube<half> cubemed [[texture(4)]], sampler _mtlsmp_cubemed [[sampler(4)]]
- , texturecube<float> cubehigh [[texture(5)]], sampler _mtlsmp_cubehigh [[sampler(5)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- half4 tmpvar_2 = 0;
- tmpvar_2 = texlow.sample(_mtlsmp_texlow, (float2)(_mtl_i.varUV.xy));
- c_1 = tmpvar_2;
- c_1 = (c_1 + texmed.sample(_mtlsmp_texmed, (float2)(_mtl_i.varUV.xy)));
- float4 tmpvar_3 = 0;
- tmpvar_3 = texhigh.sample(_mtlsmp_texhigh, (float2)(_mtl_i.varUV.xy));
- c_1 = half4(((float4)(c_1) + tmpvar_3));
- half4 tmpvar_4 = 0;
- tmpvar_4 = cubelow.sample(_mtlsmp_cubelow, (float3)(_mtl_i.varUV.xyz));
- c_1 = (c_1 + tmpvar_4);
- c_1 = (c_1 + cubemed.sample(_mtlsmp_cubemed, (float3)(_mtl_i.varUV.xyz)));
- float4 tmpvar_5 = 0;
- tmpvar_5 = cubehigh.sample(_mtlsmp_cubehigh, (float3)(_mtl_i.varUV.xyz));
- c_1 = half4(((float4)(c_1) + tmpvar_5));
- _mtl_o._fragData = c_1;
- return _mtl_o;
-}
-
-
-// stats: 5 alu 6 tex 0 flow
-// inputs: 1
-// #0: varUV (high float) 4x1 [-1]
-// textures: 6
-// #0: texlow (low 2d) 0x0 [-1] loc 0
-// #1: texmed (medium 2d) 0x0 [-1] loc 1
-// #2: texhigh (high 2d) 0x0 [-1] loc 2
-// #3: cubelow (low cube) 0x0 [-1] loc 3
-// #4: cubemed (medium cube) 0x0 [-1] loc 4
-// #5: cubehigh (high cube) 0x0 [-1] loc 5
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/small-float-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/small-float-in.txt
deleted file mode 100644
index df059e53ec1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/small-float-in.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-uniform float inFloat;
-
-void main()
-{
- gl_FragColor = vec4(inFloat * 4.36e-6);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/small-float-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/small-float-out.txt
deleted file mode 100644
index 4e9098e8179..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/small-float-out.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-uniform float inFloat;
-void main ()
-{
- gl_FragColor = vec4((inFloat * 4.36e-06));
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// uniforms: 1 (total size: 0)
-// #0: inFloat (high float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-in.txt
deleted file mode 100644
index 3925ecd1d09..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-in.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-struct str {
- float params[3];
-};
-void main() {
- str s;
- for (int i = 0; i < 3; ++i)
- s.params[i] = 1.0;
- gl_FragColor = vec4(0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-out.txt
deleted file mode 100644
index a5b251cfb4f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-array-var-index-out.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main ()
-{
- gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
-}
-
-
-// stats: 1 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-in.txt
deleted file mode 100644
index 19c2ff7279f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-in.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-// From https://gitorious.org/wikibooks-opengl/modern-tutorials/source/mini-portal/phong-shading.f.glsl
-
-/**
-* This file is in the public domain.
-* Contributors: Martin Kraus, Sylvain Beucler
-*/
-varying vec4 position; // position of the vertex (and fragment) in world space
-varying vec3 varyingNormalDirection; // surface normal vector in world space
-uniform mat4 m, v, p;
-uniform mat4 v_inv;
-
-struct lightSource
-{
- vec4 position;
- vec4 diffuse;
- vec4 specular;
- float invLinearAttenuation;
- float spotCutoff, spotExponent;
- vec3 spotDirection;
-};
-lightSource light0 = lightSource(
- vec4(0.0, 3.0, 0.0, 1.0),
- vec4(1.0, 1.0, 1.0, 1.0),
- vec4(1.0, 1.0, 1.0, 1.0),
- 2.0,
- 180.0, 0.0,
- vec3(0.0, 0.0, 0.0)
-);
-vec4 scene_ambient = vec4(0.2, 0.2, 0.2, 1.0);
-
-struct material
-{
- vec4 ambient;
- vec4 diffuse;
- vec4 specular;
- float shininess;
-};
-material frontMaterial = material(
- vec4(0.2, 0.2, 0.2, 1.0),
- vec4(1.0, 0.8, 0.8, 1.0),
- vec4(1.0, 1.0, 1.0, 1.0),
- 5.0
-);
-
-void main()
-{
- vec3 normalDirection = normalize(varyingNormalDirection);
- vec3 viewDirection = normalize(vec3(v_inv * vec4(0.0, 0.0, 0.0, 1.0) - position));
- vec3 lightDirection;
- float attenuation;
-
- // initialize total lighting with ambient lighting
- vec3 totalLighting = vec3(scene_ambient) * vec3(frontMaterial.ambient);
-
- vec3 positionToLightSource = vec3(light0.position - position);
- float distanceSqr = dot(positionToLightSource, positionToLightSource);
- lightDirection = inversesqrt(distanceSqr) * positionToLightSource;
- attenuation = light0.invLinearAttenuation * inversesqrt(distanceSqr);
-
- vec3 diffuseReflection = attenuation
- * vec3(light0.diffuse) * vec3(frontMaterial.diffuse)
- * max(0.0, dot(normalDirection, lightDirection));
-
- vec3 specularReflection;
- if (dot(normalDirection, lightDirection) < 0.0) // light source on the wrong side?
- {
- specularReflection = vec3(0.0, 0.0, 0.0); // no specular reflection
- }
- else // light source on the right side
- {
- specularReflection = attenuation * vec3(light0.specular) * vec3(frontMaterial.specular)
- * pow(max(0.0, dot(reflect(-lightDirection, normalDirection), viewDirection)), frontMaterial.shininess);
- }
-
- totalLighting = totalLighting + diffuseReflection + specularReflection;
-
- gl_FragColor = vec4(totalLighting, 1.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-out.txt
deleted file mode 100644
index 179c30c2e30..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-initializer-out.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-varying vec4 position;
-varying vec3 varyingNormalDirection;
-uniform mat4 v_inv;
-void main ()
-{
- vec3 specularReflection_1;
- vec3 totalLighting_2;
- float attenuation_3;
- vec3 lightDirection_4;
- vec3 tmpvar_5;
- tmpvar_5 = normalize(varyingNormalDirection);
- vec3 tmpvar_6;
- tmpvar_6 = normalize(((v_inv * vec4(0.0, 0.0, 0.0, 1.0)) - position).xyz);
- totalLighting_2 = vec3(0.04, 0.04, 0.04);
- vec3 tmpvar_7;
- tmpvar_7 = (vec4(0.0, 3.0, 0.0, 1.0) - position).xyz;
- float tmpvar_8;
- tmpvar_8 = dot (tmpvar_7, tmpvar_7);
- lightDirection_4 = (inversesqrt(tmpvar_8) * tmpvar_7);
- attenuation_3 = (2.0 * inversesqrt(tmpvar_8));
- vec3 tmpvar_9;
- tmpvar_9 = ((vec3(attenuation_3) * vec3(1.0, 0.8, 0.8)) * max (0.0, dot (tmpvar_5, lightDirection_4)));
- float tmpvar_10;
- tmpvar_10 = dot (tmpvar_5, lightDirection_4);
- if ((tmpvar_10 < 0.0)) {
- specularReflection_1 = vec3(0.0, 0.0, 0.0);
- } else {
- vec3 I_11;
- I_11 = -(lightDirection_4);
- specularReflection_1 = (vec3(attenuation_3) * pow (max (0.0,
- dot ((I_11 - (2.0 * (
- dot (tmpvar_5, I_11)
- * tmpvar_5))), tmpvar_6)
- ), 5.0));
- };
- totalLighting_2 = ((vec3(0.04, 0.04, 0.04) + tmpvar_9) + specularReflection_1);
- vec4 tmpvar_12;
- tmpvar_12.w = 1.0;
- tmpvar_12.xyz = totalLighting_2;
- gl_FragColor = tmpvar_12;
-}
-
-
-// stats: 30 alu 0 tex 1 flow
-// inputs: 2
-// #0: position (high float) 4x1 [-1]
-// #1: varyingNormalDirection (high float) 3x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: v_inv (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-unused-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-unused-in.txt
deleted file mode 100644
index bc6ffdc1e72..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-unused-in.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-struct SurfaceOutput {
- vec4 color;
-};
-void main() {
- SurfaceOutput o;
- gl_FragColor = vec4(0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-unused-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-unused-out.txt
deleted file mode 100644
index a5b251cfb4f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/struct-unused-out.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main ()
-{
- gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
-}
-
-
-// stats: 1 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-in.txt
deleted file mode 100644
index 22638a2ca08..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-in.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-void main () {
- vec4 c;
- c.x = dot (gl_FragCoord.xyz, vec3(1.0, 2.0, 3.0));
- c.yzw = vec3(4.0,5.0,6.0);
- gl_FragColor = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-out.txt
deleted file mode 100644
index c1c8eb71c15..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/swizzle-writemask-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-void main ()
-{
- vec4 c_1;
- c_1.x = dot (gl_FragCoord.xyz, vec3(1.0, 2.0, 3.0));
- c_1.yzw = vec3(4.0, 5.0, 6.0);
- gl_FragColor = c_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_FragCoord (high float) 4x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/syntax-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/syntax-inES.txt
deleted file mode 100644
index 42552b096c7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/syntax-inES.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-mediump vec4 xlat_main( );
-mediump vec4 xlat_main( ) {
- highp float foo = 1.00000;
- foo += 1.00000;
- foo += 100000.;
- foo += -0.00100000;
- foo += 2.00000;
- foo += 3.00000;
- return vec4( foo);
-}
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( );
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/syntax-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/syntax-outES.txt
deleted file mode 100644
index f7068ac1157..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/syntax-outES.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main ()
-{
- gl_FragData[0] = vec4(100007.0, 100007.0, 100007.0, 100007.0);
-}
-
-
-// stats: 1 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-in.txt
deleted file mode 100644
index 4befc28c449..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-in.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-vec4 xlat_main( in vec4 uv );
-vec4 xlat_main( in vec4 uv ) {
- vec4 c;
- c = vec4( 0.000000);
- c += ( (uv.x > 0.500000) ) ? ( 0.900000 ) : ( 0.100000 );
- c += ( (uv.x > 0.500000) ) ? ( vec4( 0.900000, 0.900000, 0.900000, 0.900000) ) : ( vec4( 0.100000, 0.100000, 0.100000, 0.100000) );
- c.xyz += ( (uv.x > 0.500000) ) ? ( vec3( 0.900000, 0.900000, 0.900000) ) : ( vec3( 0.100000, 0.100000, 0.100000) );
- c.xy += ( (uv.x > 0.500000) ) ? ( vec2( 0.900000, 0.900000) ) : ( vec2( 0.100000, 0.100000) );
- c.x += ( bool( fract( uv.x ) ) ) ? ( 0.900000 ) : ( 0.100000 );
- return c;
-}
-varying vec4 xlv_TEXCOORD0;
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-inES.txt
deleted file mode 100644
index c68e4282667..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-inES.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-mediump vec4 xlat_main( in highp vec4 uv );
-mediump vec4 xlat_main( in highp vec4 uv ) {
- mediump vec4 c;
- c = vec4( 0.000000);
- c += ( (uv.x > 0.500000) ) ? ( 0.900000 ) : ( 0.100000 );
- c += ( (uv.x > 0.500000) ) ? ( vec4( 0.900000, 0.900000, 0.900000, 0.900000) ) : ( vec4( 0.100000, 0.100000, 0.100000, 0.100000) );
- c.xyz += ( (uv.x > 0.500000) ) ? ( vec3( 0.900000, 0.900000, 0.900000) ) : ( vec3( 0.100000, 0.100000, 0.100000) );
- c.xy += ( (uv.x > 0.500000) ) ? ( vec2( 0.900000, 0.900000) ) : ( vec2( 0.100000, 0.100000) );
- c.x += ( bool( fract( uv.x ) ) ) ? ( 0.900000 ) : ( 0.100000 );
- return c;
-}
-varying highp vec4 xlv_TEXCOORD0;
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-inES3.txt
deleted file mode 100644
index 3d86f890169..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-inES3.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-#version 300 es
-mediump vec4 xlat_main( in highp vec4 uv ) {
- mediump vec4 c;
- c = vec4( 0.000000);
- c += ( (uv.x > 0.500000) ) ? ( 0.900000 ) : ( 0.100000 );
- c += ( (uv.x > 0.500000) ) ? ( vec4( 0.900000, 0.900000, 0.900000, 0.900000) ) : ( vec4( 0.100000, 0.100000, 0.100000, 0.100000) );
- c.xyz += ( (uv.x > 0.500000) ) ? ( vec3( 0.900000, 0.900000, 0.900000) ) : ( vec3( 0.100000, 0.100000, 0.100000) );
- c.xy += ( (uv.x > 0.500000) ) ? ( vec2( 0.900000, 0.900000) ) : ( vec2( 0.100000, 0.100000) );
- c.x += ( bool( fract( uv.x ) ) ) ? ( 0.900000 ) : ( 0.100000 );
- return c;
-}
-in highp vec4 xlv_TEXCOORD0;
-out mediump vec4 _fragData;
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- _fragData = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-out.txt
deleted file mode 100644
index a8f23423d9d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-out.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-varying vec4 xlv_TEXCOORD0;
-void main ()
-{
- vec4 c_1;
- c_1 = vec4(0.0, 0.0, 0.0, 0.0);
- float tmpvar_2;
- if ((xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_2 = 0.9;
- } else {
- tmpvar_2 = 0.1;
- };
- c_1 = vec4(tmpvar_2);
- vec4 tmpvar_3;
- if ((xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_3 = vec4(0.9, 0.9, 0.9, 0.9);
- } else {
- tmpvar_3 = vec4(0.1, 0.1, 0.1, 0.1);
- };
- c_1 = (vec4(tmpvar_2) + tmpvar_3);
- vec3 tmpvar_4;
- if ((xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_4 = vec3(0.9, 0.9, 0.9);
- } else {
- tmpvar_4 = vec3(0.1, 0.1, 0.1);
- };
- c_1.xyz = (c_1.xyz + tmpvar_4);
- vec2 tmpvar_5;
- if ((xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_5 = vec2(0.9, 0.9);
- } else {
- tmpvar_5 = vec2(0.1, 0.1);
- };
- c_1.xy = (c_1.xy + tmpvar_5);
- float tmpvar_6;
- tmpvar_6 = fract(xlv_TEXCOORD0.x);
- float tmpvar_7;
- if (bool(tmpvar_6)) {
- tmpvar_7 = 0.9;
- } else {
- tmpvar_7 = 0.1;
- };
- c_1.x = (c_1.x + tmpvar_7);
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 21 alu 0 tex 5 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES.txt
deleted file mode 100644
index 9f8a3f2550d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-varying highp vec4 xlv_TEXCOORD0;
-void main ()
-{
- mediump vec4 c_1;
- c_1 = vec4(0.0, 0.0, 0.0, 0.0);
- highp float tmpvar_2;
- if ((xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_2 = 0.9;
- } else {
- tmpvar_2 = 0.1;
- };
- c_1 = vec4(tmpvar_2);
- highp vec4 tmpvar_3;
- if ((xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_3 = vec4(0.9, 0.9, 0.9, 0.9);
- } else {
- tmpvar_3 = vec4(0.1, 0.1, 0.1, 0.1);
- };
- c_1 = (vec4(tmpvar_2) + tmpvar_3);
- highp vec3 tmpvar_4;
- if ((xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_4 = vec3(0.9, 0.9, 0.9);
- } else {
- tmpvar_4 = vec3(0.1, 0.1, 0.1);
- };
- c_1.xyz = (c_1.xyz + tmpvar_4);
- highp vec2 tmpvar_5;
- if ((xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_5 = vec2(0.9, 0.9);
- } else {
- tmpvar_5 = vec2(0.1, 0.1);
- };
- c_1.xy = (c_1.xy + tmpvar_5);
- highp float tmpvar_6;
- tmpvar_6 = fract(xlv_TEXCOORD0.x);
- highp float tmpvar_7;
- if (bool(tmpvar_6)) {
- tmpvar_7 = 0.9;
- } else {
- tmpvar_7 = 0.1;
- };
- c_1.x = (c_1.x + tmpvar_7);
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 21 alu 0 tex 5 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3.txt
deleted file mode 100644
index 9f56d0f135b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-#version 300 es
-in highp vec4 xlv_TEXCOORD0;
-out mediump vec4 _fragData;
-void main ()
-{
- mediump vec4 c_1;
- c_1 = vec4(0.0, 0.0, 0.0, 0.0);
- highp float tmpvar_2;
- if ((xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_2 = 0.9;
- } else {
- tmpvar_2 = 0.1;
- };
- c_1 = vec4(tmpvar_2);
- highp vec4 tmpvar_3;
- if ((xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_3 = vec4(0.9, 0.9, 0.9, 0.9);
- } else {
- tmpvar_3 = vec4(0.1, 0.1, 0.1, 0.1);
- };
- c_1 = (vec4(tmpvar_2) + tmpvar_3);
- highp vec3 tmpvar_4;
- if ((xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_4 = vec3(0.9, 0.9, 0.9);
- } else {
- tmpvar_4 = vec3(0.1, 0.1, 0.1);
- };
- c_1.xyz = (c_1.xyz + tmpvar_4);
- highp vec2 tmpvar_5;
- if ((xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_5 = vec2(0.9, 0.9);
- } else {
- tmpvar_5 = vec2(0.1, 0.1);
- };
- c_1.xy = (c_1.xy + tmpvar_5);
- highp float tmpvar_6;
- tmpvar_6 = fract(xlv_TEXCOORD0.x);
- highp float tmpvar_7;
- if (bool(tmpvar_6)) {
- tmpvar_7 = 0.9;
- } else {
- tmpvar_7 = 0.1;
- };
- c_1.x = (c_1.x + tmpvar_7);
- _fragData = c_1;
-}
-
-
-// stats: 21 alu 0 tex 5 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3Metal.txt
deleted file mode 100644
index b50458537e5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-outES3Metal.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 xlv_TEXCOORD0;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- c_1 = half4(float4(0.0, 0.0, 0.0, 0.0));
- float tmpvar_2 = 0;
- if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_2 = 0.9;
- } else {
- tmpvar_2 = 0.1;
- };
- c_1 = half4(float4(tmpvar_2));
- float4 tmpvar_3 = 0;
- if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_3 = float4(0.9, 0.9, 0.9, 0.9);
- } else {
- tmpvar_3 = float4(0.1, 0.1, 0.1, 0.1);
- };
- c_1 = ((half4)(float4(tmpvar_2) + tmpvar_3));
- float3 tmpvar_4 = 0;
- if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_4 = float3(0.9, 0.9, 0.9);
- } else {
- tmpvar_4 = float3(0.1, 0.1, 0.1);
- };
- c_1.xyz = (c_1.xyz + (half3)(tmpvar_4));
- float2 tmpvar_5 = 0;
- if ((_mtl_i.xlv_TEXCOORD0.x > 0.5)) {
- tmpvar_5 = float2(0.9, 0.9);
- } else {
- tmpvar_5 = float2(0.1, 0.1);
- };
- c_1.xy = (c_1.xy + (half2)(tmpvar_5));
- float tmpvar_6 = 0;
- tmpvar_6 = fract(_mtl_i.xlv_TEXCOORD0.x);
- float tmpvar_7 = 0;
- if (bool(tmpvar_6)) {
- tmpvar_7 = 0.9;
- } else {
- tmpvar_7 = 0.1;
- };
- c_1.x = (c_1.x + (half)(tmpvar_7));
- _mtl_o._fragData = c_1;
- return _mtl_o;
-}
-
-
-// stats: 21 alu 0 tex 5 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-in.txt
deleted file mode 100644
index 38616b648bb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-in.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-vec2 xll_vecTSel (bvec2 a, vec2 b, vec2 c) {
- return vec2 (a.x ? b.x : c.x, a.y ? b.y : c.y);
-}
-vec3 xll_vecTSel (bvec3 a, vec3 b, vec3 c) {
- return vec3 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z);
-}
-vec4 xll_vecTSel (bvec4 a, vec4 b, vec4 c) {
- return vec4 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z, a.w ? b.w : c.w);
-}
-vec4 xlat_main( in vec4 uv );
-vec4 xlat_main( in vec4 uv ) {
- vec4 a;
- a = vec4( 0.000000);
- a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000));
- a += xll_vecTSel (greaterThan( uv, vec4( 0.500000, 0.500000, 0.500000, 0.500000)), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000));
- a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000));
- a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1), vec4( 2));
- a += xll_vecTSel (bvec4( fract( uv ) ), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000));
- return a;
-}
-varying vec4 xlv_TEXCOORD0;
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES.txt
deleted file mode 100644
index 1f6ceb853ba..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-vec2 xll_vecTSel (bvec2 a, vec2 b, vec2 c) {
- return vec2 (a.x ? b.x : c.x, a.y ? b.y : c.y);
-}
-vec3 xll_vecTSel (bvec3 a, vec3 b, vec3 c) {
- return vec3 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z);
-}
-vec4 xll_vecTSel (bvec4 a, vec4 b, vec4 c) {
- return vec4 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z, a.w ? b.w : c.w);
-}
-mediump vec4 xlat_main( in highp vec4 uv );
-mediump vec4 xlat_main( in highp vec4 uv ) {
- highp vec4 a;
- a = vec4( 0.000000);
- a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000));
- a += xll_vecTSel (greaterThan( uv, vec4( 0.500000, 0.500000, 0.500000, 0.500000)), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000));
- a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000));
- a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1), vec4( 2));
- a += xll_vecTSel (bvec4( fract( uv ) ), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000));
- return a;
-}
-varying highp vec4 xlv_TEXCOORD0;
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES3.txt
deleted file mode 100644
index 7dbd7ebb6dd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-inES3.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-vec2 xll_vecTSel (bvec2 a, vec2 b, vec2 c) {
- return vec2 (a.x ? b.x : c.x, a.y ? b.y : c.y);
-}
-vec3 xll_vecTSel (bvec3 a, vec3 b, vec3 c) {
- return vec3 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z);
-}
-vec4 xll_vecTSel (bvec4 a, vec4 b, vec4 c) {
- return vec4 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z, a.w ? b.w : c.w);
-}
-mediump vec4 xlat_main( in highp vec4 uv );
-mediump vec4 xlat_main( in highp vec4 uv ) {
- highp vec4 a;
- a = vec4( 0.000000);
- a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000));
- a += xll_vecTSel (greaterThan( uv, vec4( 0.500000, 0.500000, 0.500000, 0.500000)), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000));
- a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000));
- a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1), vec4( 2));
- a += xll_vecTSel (bvec4( fract( uv ) ), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000));
- return a;
-}
-in highp vec4 xlv_TEXCOORD0;
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- _fragData = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-out.txt
deleted file mode 100644
index 584582e88e8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-out.txt
+++ /dev/null
@@ -1,172 +0,0 @@
-varying vec4 xlv_TEXCOORD0;
-void main ()
-{
- vec4 a_1;
- a_1 = vec4(0.0, 0.0, 0.0, 0.0);
- bvec4 tmpvar_2;
- tmpvar_2 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5));
- float tmpvar_3;
- if (tmpvar_2.x) {
- tmpvar_3 = 1.0;
- } else {
- tmpvar_3 = 5.0;
- };
- float tmpvar_4;
- if (tmpvar_2.y) {
- tmpvar_4 = 2.0;
- } else {
- tmpvar_4 = 6.0;
- };
- float tmpvar_5;
- if (tmpvar_2.z) {
- tmpvar_5 = 3.0;
- } else {
- tmpvar_5 = 7.0;
- };
- float tmpvar_6;
- if (tmpvar_2.w) {
- tmpvar_6 = 4.0;
- } else {
- tmpvar_6 = 8.0;
- };
- vec4 tmpvar_7;
- tmpvar_7.x = tmpvar_3;
- tmpvar_7.y = tmpvar_4;
- tmpvar_7.z = tmpvar_5;
- tmpvar_7.w = tmpvar_6;
- a_1 = tmpvar_7;
- bvec4 tmpvar_8;
- tmpvar_8 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5));
- float tmpvar_9;
- if (tmpvar_8.x) {
- tmpvar_9 = 1.0;
- } else {
- tmpvar_9 = 5.0;
- };
- float tmpvar_10;
- if (tmpvar_8.y) {
- tmpvar_10 = 2.0;
- } else {
- tmpvar_10 = 6.0;
- };
- float tmpvar_11;
- if (tmpvar_8.z) {
- tmpvar_11 = 3.0;
- } else {
- tmpvar_11 = 7.0;
- };
- float tmpvar_12;
- if (tmpvar_8.w) {
- tmpvar_12 = 4.0;
- } else {
- tmpvar_12 = 8.0;
- };
- vec4 tmpvar_13;
- tmpvar_13.x = tmpvar_9;
- tmpvar_13.y = tmpvar_10;
- tmpvar_13.z = tmpvar_11;
- tmpvar_13.w = tmpvar_12;
- a_1 = (tmpvar_7 + tmpvar_13);
- bvec4 tmpvar_14;
- tmpvar_14 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5));
- float tmpvar_15;
- if (tmpvar_14.x) {
- tmpvar_15 = 1.0;
- } else {
- tmpvar_15 = 2.0;
- };
- float tmpvar_16;
- if (tmpvar_14.y) {
- tmpvar_16 = 1.0;
- } else {
- tmpvar_16 = 2.0;
- };
- float tmpvar_17;
- if (tmpvar_14.z) {
- tmpvar_17 = 1.0;
- } else {
- tmpvar_17 = 2.0;
- };
- float tmpvar_18;
- if (tmpvar_14.w) {
- tmpvar_18 = 1.0;
- } else {
- tmpvar_18 = 2.0;
- };
- vec4 tmpvar_19;
- tmpvar_19.x = tmpvar_15;
- tmpvar_19.y = tmpvar_16;
- tmpvar_19.z = tmpvar_17;
- tmpvar_19.w = tmpvar_18;
- a_1 = (a_1 + tmpvar_19);
- bvec4 tmpvar_20;
- tmpvar_20 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5));
- float tmpvar_21;
- if (tmpvar_20.x) {
- tmpvar_21 = 1.0;
- } else {
- tmpvar_21 = 2.0;
- };
- float tmpvar_22;
- if (tmpvar_20.y) {
- tmpvar_22 = 1.0;
- } else {
- tmpvar_22 = 2.0;
- };
- float tmpvar_23;
- if (tmpvar_20.z) {
- tmpvar_23 = 1.0;
- } else {
- tmpvar_23 = 2.0;
- };
- float tmpvar_24;
- if (tmpvar_20.w) {
- tmpvar_24 = 1.0;
- } else {
- tmpvar_24 = 2.0;
- };
- vec4 tmpvar_25;
- tmpvar_25.x = tmpvar_21;
- tmpvar_25.y = tmpvar_22;
- tmpvar_25.z = tmpvar_23;
- tmpvar_25.w = tmpvar_24;
- a_1 = (a_1 + tmpvar_25);
- bvec4 tmpvar_26;
- tmpvar_26 = bvec4(fract(xlv_TEXCOORD0));
- float tmpvar_27;
- if (tmpvar_26.x) {
- tmpvar_27 = 1.0;
- } else {
- tmpvar_27 = 2.0;
- };
- float tmpvar_28;
- if (tmpvar_26.y) {
- tmpvar_28 = 1.0;
- } else {
- tmpvar_28 = 2.0;
- };
- float tmpvar_29;
- if (tmpvar_26.z) {
- tmpvar_29 = 1.0;
- } else {
- tmpvar_29 = 2.0;
- };
- float tmpvar_30;
- if (tmpvar_26.w) {
- tmpvar_30 = 1.0;
- } else {
- tmpvar_30 = 2.0;
- };
- vec4 tmpvar_31;
- tmpvar_31.x = tmpvar_27;
- tmpvar_31.y = tmpvar_28;
- tmpvar_31.z = tmpvar_29;
- tmpvar_31.w = tmpvar_30;
- a_1 = (a_1 + tmpvar_31);
- gl_FragData[0] = a_1;
-}
-
-
-// stats: 51 alu 0 tex 20 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES.txt
deleted file mode 100644
index cd31d85ffe0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES.txt
+++ /dev/null
@@ -1,174 +0,0 @@
-varying highp vec4 xlv_TEXCOORD0;
-void main ()
-{
- mediump vec4 tmpvar_1;
- highp vec4 a_2;
- a_2 = vec4(0.0, 0.0, 0.0, 0.0);
- bvec4 tmpvar_3;
- tmpvar_3 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5));
- highp float tmpvar_4;
- if (tmpvar_3.x) {
- tmpvar_4 = 1.0;
- } else {
- tmpvar_4 = 5.0;
- };
- highp float tmpvar_5;
- if (tmpvar_3.y) {
- tmpvar_5 = 2.0;
- } else {
- tmpvar_5 = 6.0;
- };
- highp float tmpvar_6;
- if (tmpvar_3.z) {
- tmpvar_6 = 3.0;
- } else {
- tmpvar_6 = 7.0;
- };
- highp float tmpvar_7;
- if (tmpvar_3.w) {
- tmpvar_7 = 4.0;
- } else {
- tmpvar_7 = 8.0;
- };
- highp vec4 tmpvar_8;
- tmpvar_8.x = tmpvar_4;
- tmpvar_8.y = tmpvar_5;
- tmpvar_8.z = tmpvar_6;
- tmpvar_8.w = tmpvar_7;
- a_2 = tmpvar_8;
- bvec4 tmpvar_9;
- tmpvar_9 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5));
- highp float tmpvar_10;
- if (tmpvar_9.x) {
- tmpvar_10 = 1.0;
- } else {
- tmpvar_10 = 5.0;
- };
- highp float tmpvar_11;
- if (tmpvar_9.y) {
- tmpvar_11 = 2.0;
- } else {
- tmpvar_11 = 6.0;
- };
- highp float tmpvar_12;
- if (tmpvar_9.z) {
- tmpvar_12 = 3.0;
- } else {
- tmpvar_12 = 7.0;
- };
- highp float tmpvar_13;
- if (tmpvar_9.w) {
- tmpvar_13 = 4.0;
- } else {
- tmpvar_13 = 8.0;
- };
- highp vec4 tmpvar_14;
- tmpvar_14.x = tmpvar_10;
- tmpvar_14.y = tmpvar_11;
- tmpvar_14.z = tmpvar_12;
- tmpvar_14.w = tmpvar_13;
- a_2 = (tmpvar_8 + tmpvar_14);
- bvec4 tmpvar_15;
- tmpvar_15 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5));
- highp float tmpvar_16;
- if (tmpvar_15.x) {
- tmpvar_16 = 1.0;
- } else {
- tmpvar_16 = 2.0;
- };
- highp float tmpvar_17;
- if (tmpvar_15.y) {
- tmpvar_17 = 1.0;
- } else {
- tmpvar_17 = 2.0;
- };
- highp float tmpvar_18;
- if (tmpvar_15.z) {
- tmpvar_18 = 1.0;
- } else {
- tmpvar_18 = 2.0;
- };
- highp float tmpvar_19;
- if (tmpvar_15.w) {
- tmpvar_19 = 1.0;
- } else {
- tmpvar_19 = 2.0;
- };
- highp vec4 tmpvar_20;
- tmpvar_20.x = tmpvar_16;
- tmpvar_20.y = tmpvar_17;
- tmpvar_20.z = tmpvar_18;
- tmpvar_20.w = tmpvar_19;
- a_2 = (a_2 + tmpvar_20);
- bvec4 tmpvar_21;
- tmpvar_21 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5));
- highp float tmpvar_22;
- if (tmpvar_21.x) {
- tmpvar_22 = 1.0;
- } else {
- tmpvar_22 = 2.0;
- };
- highp float tmpvar_23;
- if (tmpvar_21.y) {
- tmpvar_23 = 1.0;
- } else {
- tmpvar_23 = 2.0;
- };
- highp float tmpvar_24;
- if (tmpvar_21.z) {
- tmpvar_24 = 1.0;
- } else {
- tmpvar_24 = 2.0;
- };
- highp float tmpvar_25;
- if (tmpvar_21.w) {
- tmpvar_25 = 1.0;
- } else {
- tmpvar_25 = 2.0;
- };
- highp vec4 tmpvar_26;
- tmpvar_26.x = tmpvar_22;
- tmpvar_26.y = tmpvar_23;
- tmpvar_26.z = tmpvar_24;
- tmpvar_26.w = tmpvar_25;
- a_2 = (a_2 + tmpvar_26);
- bvec4 tmpvar_27;
- tmpvar_27 = bvec4(fract(xlv_TEXCOORD0));
- highp float tmpvar_28;
- if (tmpvar_27.x) {
- tmpvar_28 = 1.0;
- } else {
- tmpvar_28 = 2.0;
- };
- highp float tmpvar_29;
- if (tmpvar_27.y) {
- tmpvar_29 = 1.0;
- } else {
- tmpvar_29 = 2.0;
- };
- highp float tmpvar_30;
- if (tmpvar_27.z) {
- tmpvar_30 = 1.0;
- } else {
- tmpvar_30 = 2.0;
- };
- highp float tmpvar_31;
- if (tmpvar_27.w) {
- tmpvar_31 = 1.0;
- } else {
- tmpvar_31 = 2.0;
- };
- highp vec4 tmpvar_32;
- tmpvar_32.x = tmpvar_28;
- tmpvar_32.y = tmpvar_29;
- tmpvar_32.z = tmpvar_30;
- tmpvar_32.w = tmpvar_31;
- a_2 = (a_2 + tmpvar_32);
- tmpvar_1 = a_2;
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 51 alu 0 tex 20 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3.txt
deleted file mode 100644
index c5439b74f8d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3.txt
+++ /dev/null
@@ -1,176 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-in highp vec4 xlv_TEXCOORD0;
-void main ()
-{
- mediump vec4 tmpvar_1;
- highp vec4 a_2;
- a_2 = vec4(0.0, 0.0, 0.0, 0.0);
- bvec4 tmpvar_3;
- tmpvar_3 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5));
- highp float tmpvar_4;
- if (tmpvar_3.x) {
- tmpvar_4 = 1.0;
- } else {
- tmpvar_4 = 5.0;
- };
- highp float tmpvar_5;
- if (tmpvar_3.y) {
- tmpvar_5 = 2.0;
- } else {
- tmpvar_5 = 6.0;
- };
- highp float tmpvar_6;
- if (tmpvar_3.z) {
- tmpvar_6 = 3.0;
- } else {
- tmpvar_6 = 7.0;
- };
- highp float tmpvar_7;
- if (tmpvar_3.w) {
- tmpvar_7 = 4.0;
- } else {
- tmpvar_7 = 8.0;
- };
- highp vec4 tmpvar_8;
- tmpvar_8.x = tmpvar_4;
- tmpvar_8.y = tmpvar_5;
- tmpvar_8.z = tmpvar_6;
- tmpvar_8.w = tmpvar_7;
- a_2 = tmpvar_8;
- bvec4 tmpvar_9;
- tmpvar_9 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5));
- highp float tmpvar_10;
- if (tmpvar_9.x) {
- tmpvar_10 = 1.0;
- } else {
- tmpvar_10 = 5.0;
- };
- highp float tmpvar_11;
- if (tmpvar_9.y) {
- tmpvar_11 = 2.0;
- } else {
- tmpvar_11 = 6.0;
- };
- highp float tmpvar_12;
- if (tmpvar_9.z) {
- tmpvar_12 = 3.0;
- } else {
- tmpvar_12 = 7.0;
- };
- highp float tmpvar_13;
- if (tmpvar_9.w) {
- tmpvar_13 = 4.0;
- } else {
- tmpvar_13 = 8.0;
- };
- highp vec4 tmpvar_14;
- tmpvar_14.x = tmpvar_10;
- tmpvar_14.y = tmpvar_11;
- tmpvar_14.z = tmpvar_12;
- tmpvar_14.w = tmpvar_13;
- a_2 = (tmpvar_8 + tmpvar_14);
- bvec4 tmpvar_15;
- tmpvar_15 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5));
- highp float tmpvar_16;
- if (tmpvar_15.x) {
- tmpvar_16 = 1.0;
- } else {
- tmpvar_16 = 2.0;
- };
- highp float tmpvar_17;
- if (tmpvar_15.y) {
- tmpvar_17 = 1.0;
- } else {
- tmpvar_17 = 2.0;
- };
- highp float tmpvar_18;
- if (tmpvar_15.z) {
- tmpvar_18 = 1.0;
- } else {
- tmpvar_18 = 2.0;
- };
- highp float tmpvar_19;
- if (tmpvar_15.w) {
- tmpvar_19 = 1.0;
- } else {
- tmpvar_19 = 2.0;
- };
- highp vec4 tmpvar_20;
- tmpvar_20.x = tmpvar_16;
- tmpvar_20.y = tmpvar_17;
- tmpvar_20.z = tmpvar_18;
- tmpvar_20.w = tmpvar_19;
- a_2 = (a_2 + tmpvar_20);
- bvec4 tmpvar_21;
- tmpvar_21 = greaterThan (xlv_TEXCOORD0, vec4(0.5, 0.5, 0.5, 0.5));
- highp float tmpvar_22;
- if (tmpvar_21.x) {
- tmpvar_22 = 1.0;
- } else {
- tmpvar_22 = 2.0;
- };
- highp float tmpvar_23;
- if (tmpvar_21.y) {
- tmpvar_23 = 1.0;
- } else {
- tmpvar_23 = 2.0;
- };
- highp float tmpvar_24;
- if (tmpvar_21.z) {
- tmpvar_24 = 1.0;
- } else {
- tmpvar_24 = 2.0;
- };
- highp float tmpvar_25;
- if (tmpvar_21.w) {
- tmpvar_25 = 1.0;
- } else {
- tmpvar_25 = 2.0;
- };
- highp vec4 tmpvar_26;
- tmpvar_26.x = tmpvar_22;
- tmpvar_26.y = tmpvar_23;
- tmpvar_26.z = tmpvar_24;
- tmpvar_26.w = tmpvar_25;
- a_2 = (a_2 + tmpvar_26);
- bvec4 tmpvar_27;
- tmpvar_27 = bvec4(fract(xlv_TEXCOORD0));
- highp float tmpvar_28;
- if (tmpvar_27.x) {
- tmpvar_28 = 1.0;
- } else {
- tmpvar_28 = 2.0;
- };
- highp float tmpvar_29;
- if (tmpvar_27.y) {
- tmpvar_29 = 1.0;
- } else {
- tmpvar_29 = 2.0;
- };
- highp float tmpvar_30;
- if (tmpvar_27.z) {
- tmpvar_30 = 1.0;
- } else {
- tmpvar_30 = 2.0;
- };
- highp float tmpvar_31;
- if (tmpvar_27.w) {
- tmpvar_31 = 1.0;
- } else {
- tmpvar_31 = 2.0;
- };
- highp vec4 tmpvar_32;
- tmpvar_32.x = tmpvar_28;
- tmpvar_32.y = tmpvar_29;
- tmpvar_32.z = tmpvar_30;
- tmpvar_32.w = tmpvar_31;
- a_2 = (a_2 + tmpvar_32);
- tmpvar_1 = a_2;
- _fragData = tmpvar_1;
-}
-
-
-// stats: 51 alu 0 tex 20 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3Metal.txt
deleted file mode 100644
index 04bf455cd7b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/ternary-vec4-outES3Metal.txt
+++ /dev/null
@@ -1,186 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 xlv_TEXCOORD0;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 tmpvar_1 = 0;
- float4 a_2 = 0;
- a_2 = float4(0.0, 0.0, 0.0, 0.0);
- bool4 tmpvar_3 = false;
- tmpvar_3 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5)));
- float tmpvar_4 = 0;
- if (tmpvar_3.x) {
- tmpvar_4 = 1.0;
- } else {
- tmpvar_4 = 5.0;
- };
- float tmpvar_5 = 0;
- if (tmpvar_3.y) {
- tmpvar_5 = 2.0;
- } else {
- tmpvar_5 = 6.0;
- };
- float tmpvar_6 = 0;
- if (tmpvar_3.z) {
- tmpvar_6 = 3.0;
- } else {
- tmpvar_6 = 7.0;
- };
- float tmpvar_7 = 0;
- if (tmpvar_3.w) {
- tmpvar_7 = 4.0;
- } else {
- tmpvar_7 = 8.0;
- };
- float4 tmpvar_8 = 0;
- tmpvar_8.x = tmpvar_4;
- tmpvar_8.y = tmpvar_5;
- tmpvar_8.z = tmpvar_6;
- tmpvar_8.w = tmpvar_7;
- a_2 = tmpvar_8;
- bool4 tmpvar_9 = false;
- tmpvar_9 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5)));
- float tmpvar_10 = 0;
- if (tmpvar_9.x) {
- tmpvar_10 = 1.0;
- } else {
- tmpvar_10 = 5.0;
- };
- float tmpvar_11 = 0;
- if (tmpvar_9.y) {
- tmpvar_11 = 2.0;
- } else {
- tmpvar_11 = 6.0;
- };
- float tmpvar_12 = 0;
- if (tmpvar_9.z) {
- tmpvar_12 = 3.0;
- } else {
- tmpvar_12 = 7.0;
- };
- float tmpvar_13 = 0;
- if (tmpvar_9.w) {
- tmpvar_13 = 4.0;
- } else {
- tmpvar_13 = 8.0;
- };
- float4 tmpvar_14 = 0;
- tmpvar_14.x = tmpvar_10;
- tmpvar_14.y = tmpvar_11;
- tmpvar_14.z = tmpvar_12;
- tmpvar_14.w = tmpvar_13;
- a_2 = (tmpvar_8 + tmpvar_14);
- bool4 tmpvar_15 = false;
- tmpvar_15 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5)));
- float tmpvar_16 = 0;
- if (tmpvar_15.x) {
- tmpvar_16 = 1.0;
- } else {
- tmpvar_16 = 2.0;
- };
- float tmpvar_17 = 0;
- if (tmpvar_15.y) {
- tmpvar_17 = 1.0;
- } else {
- tmpvar_17 = 2.0;
- };
- float tmpvar_18 = 0;
- if (tmpvar_15.z) {
- tmpvar_18 = 1.0;
- } else {
- tmpvar_18 = 2.0;
- };
- float tmpvar_19 = 0;
- if (tmpvar_15.w) {
- tmpvar_19 = 1.0;
- } else {
- tmpvar_19 = 2.0;
- };
- float4 tmpvar_20 = 0;
- tmpvar_20.x = tmpvar_16;
- tmpvar_20.y = tmpvar_17;
- tmpvar_20.z = tmpvar_18;
- tmpvar_20.w = tmpvar_19;
- a_2 = (a_2 + tmpvar_20);
- bool4 tmpvar_21 = false;
- tmpvar_21 = bool4((_mtl_i.xlv_TEXCOORD0 > float4(0.5, 0.5, 0.5, 0.5)));
- float tmpvar_22 = 0;
- if (tmpvar_21.x) {
- tmpvar_22 = 1.0;
- } else {
- tmpvar_22 = 2.0;
- };
- float tmpvar_23 = 0;
- if (tmpvar_21.y) {
- tmpvar_23 = 1.0;
- } else {
- tmpvar_23 = 2.0;
- };
- float tmpvar_24 = 0;
- if (tmpvar_21.z) {
- tmpvar_24 = 1.0;
- } else {
- tmpvar_24 = 2.0;
- };
- float tmpvar_25 = 0;
- if (tmpvar_21.w) {
- tmpvar_25 = 1.0;
- } else {
- tmpvar_25 = 2.0;
- };
- float4 tmpvar_26 = 0;
- tmpvar_26.x = tmpvar_22;
- tmpvar_26.y = tmpvar_23;
- tmpvar_26.z = tmpvar_24;
- tmpvar_26.w = tmpvar_25;
- a_2 = (a_2 + tmpvar_26);
- bool4 tmpvar_27 = false;
- tmpvar_27 = bool4(fract(_mtl_i.xlv_TEXCOORD0));
- float tmpvar_28 = 0;
- if (tmpvar_27.x) {
- tmpvar_28 = 1.0;
- } else {
- tmpvar_28 = 2.0;
- };
- float tmpvar_29 = 0;
- if (tmpvar_27.y) {
- tmpvar_29 = 1.0;
- } else {
- tmpvar_29 = 2.0;
- };
- float tmpvar_30 = 0;
- if (tmpvar_27.z) {
- tmpvar_30 = 1.0;
- } else {
- tmpvar_30 = 2.0;
- };
- float tmpvar_31 = 0;
- if (tmpvar_27.w) {
- tmpvar_31 = 1.0;
- } else {
- tmpvar_31 = 2.0;
- };
- float4 tmpvar_32 = 0;
- tmpvar_32.x = tmpvar_28;
- tmpvar_32.y = tmpvar_29;
- tmpvar_32.z = tmpvar_30;
- tmpvar_32.w = tmpvar_31;
- a_2 = (a_2 + tmpvar_32);
- tmpvar_1 = half4(a_2);
- _mtl_o._fragData = tmpvar_1;
- return _mtl_o;
-}
-
-
-// stats: 51 alu 0 tex 20 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-in.txt
deleted file mode 100644
index 3fd866df99d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-in.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-#extension GL_EXT_texture_array : require
-
-vec4 xll_tex2DArray(sampler2DArray s, vec3 coord) { return texture2DArray (s, coord); }
-vec4 xll_tex2DArrayBias(sampler2DArray s, vec4 coord) { return texture2DArray (s, coord.xyz, coord.w); }
-
-uniform sampler2DArray myarr;
-
-vec4 xlat_main( in vec4 uv ) {
- vec4 s = xll_tex2DArray( myarr, uv.xyz);
- vec4 sswiz = xll_tex2DArray( myarr, uv.xyw);
- vec4 sbias = xll_tex2DArrayBias( myarr, vec4( uv.xyz, 1.5));
- return s + sswiz + sbias;
-}
-
-varying vec4 uv;
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main(uv);
- gl_FragData[0] = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-inES3.txt
deleted file mode 100644
index a84428edb42..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-inES3.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-
-vec4 xll_tex2DArray(sampler2DArray s, vec3 coord) { return texture (s, coord); }
-vec4 xll_tex2DArrayBias(sampler2DArray s, vec4 coord) { return texture (s, coord.xyz, coord.w); }
-
-uniform lowp sampler2DArray myarr;
-
-lowp vec4 xlat_main( in highp vec4 uv ) {
- highp vec4 s = xll_tex2DArray( myarr, uv.xyz);
- highp vec4 sswiz = xll_tex2DArray( myarr, uv.xyw);
- highp vec4 sbias = xll_tex2DArrayBias( myarr, vec4( uv.xyz, 1.5));
- highp vec4 slod = textureLod(myarr, uv.xyz, 2.5);
- return (((s + sswiz) + sbias) + slod);
-}
-in highp vec4 uv;
-void main() {
- _fragData = xlat_main(uv);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-out.txt
deleted file mode 100644
index ed5629c6d12..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-out.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-#extension GL_EXT_texture_array : enable
-uniform sampler2DArray myarr;
-varying vec4 uv;
-void main ()
-{
- gl_FragData[0] = ((texture2DArray (myarr, uv.xyz) + texture2DArray (myarr, uv.xyw)) + texture2DArray (myarr, uv.xyz, 1.5));
-}
-
-
-// stats: 2 alu 3 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 4x1 [-1]
-// textures: 1
-// #0: myarr (high 2darray) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3.txt
deleted file mode 100644
index 1b564fee2ba..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-uniform sampler2DArray myarr;
-in highp vec4 uv;
-void main ()
-{
- lowp vec4 tmpvar_1;
- highp vec4 slod_2;
- lowp vec4 tmpvar_3;
- tmpvar_3 = texture (myarr, uv.xyz);
- highp vec4 tmpvar_4;
- tmpvar_4 = tmpvar_3;
- lowp vec4 tmpvar_5;
- tmpvar_5 = texture (myarr, uv.xyw);
- highp vec4 tmpvar_6;
- tmpvar_6 = tmpvar_5;
- lowp vec4 tmpvar_7;
- tmpvar_7 = texture (myarr, uv.xyz, 1.5);
- highp vec4 tmpvar_8;
- tmpvar_8 = tmpvar_7;
- lowp vec4 tmpvar_9;
- tmpvar_9 = textureLod (myarr, uv.xyz, 2.5);
- slod_2 = tmpvar_9;
- tmpvar_1 = ((tmpvar_4 + tmpvar_6) + (tmpvar_8 + slod_2));
- _fragData = tmpvar_1;
-}
-
-
-// stats: 3 alu 4 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 4x1 [-1]
-// textures: 1
-// #0: myarr (low 2darray) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3Metal.txt
deleted file mode 100644
index 2ba6f57df4e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2DArray-outES3Metal.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 uv;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d_array<half> myarr [[texture(0)]], sampler _mtlsmp_myarr [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 tmpvar_1 = 0;
- float4 slod_2 = 0;
- half4 tmpvar_3 = 0;
- tmpvar_3 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyz).xy), (uint)((_mtl_i.uv.xyz).z));
- float4 tmpvar_4 = 0;
- tmpvar_4 = float4(tmpvar_3);
- half4 tmpvar_5 = 0;
- tmpvar_5 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyw).xy), (uint)((_mtl_i.uv.xyw).z));
- float4 tmpvar_6 = 0;
- tmpvar_6 = float4(tmpvar_5);
- half4 tmpvar_7 = 0;
- tmpvar_7 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyz).xy), (uint)((_mtl_i.uv.xyz).z), bias(1.5));
- float4 tmpvar_8 = 0;
- tmpvar_8 = float4(tmpvar_7);
- half4 tmpvar_9 = 0;
- tmpvar_9 = myarr.sample(_mtlsmp_myarr, (float2)((_mtl_i.uv.xyz).xy), (uint)((_mtl_i.uv.xyz).z), level(2.5));
- slod_2 = float4(tmpvar_9);
- tmpvar_1 = half4(((tmpvar_4 + tmpvar_6) + (tmpvar_8 + slod_2)));
- _mtl_o._fragData = tmpvar_1;
- return _mtl_o;
-}
-
-
-// stats: 3 alu 4 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 4x1 [-1]
-// textures: 1
-// #0: myarr (low 2darray) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-in.txt
deleted file mode 100644
index 5c0d7a65a12..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-in.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-#extension GL_ARB_shader_texture_lod : require
-uniform sampler2D tex;
-uniform samplerCube cub;
-varying vec3 uv;
-void main() {
- gl_FragColor = texture2DGradARB(tex,uv.xy,dFdx(uv.xy),dFdy(uv.xy)) + textureCubeGradARB(cub,uv,dFdx(uv),dFdy(uv));
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES.txt
deleted file mode 100644
index 8bbfa73291a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-#extension GL_EXT_shader_texture_lod : require
-#extension GL_OES_standard_derivatives : require
-uniform sampler2D tex;
-uniform samplerCube cub;
-varying vec3 uv;
-void main() {
- gl_FragColor = texture2DGradEXT(tex,uv.xy,dFdx(uv.xy),dFdy(uv.xy)) + textureCubeGradEXT(cub,uv,dFdx(uv),dFdy(uv));
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES3.txt
deleted file mode 100644
index 83f5a0571ff..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-inES3.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-#version 300 es
-precision mediump float;
-uniform sampler2D tex;
-uniform samplerCube cub;
-in mediump vec3 uv1;
-in highp vec3 uv2;
-out vec4 _fragColor;
-void main() {
- vec4 g1 = textureGrad(tex,uv1.xy,dFdx(uv1.xy),dFdy(uv1.xy)); // mediump UV
- vec4 g2 = textureGrad(tex,uv2.xy,dFdx(uv2.xy),dFdy(uv2.xy)); // highp UV
- vec4 g3 = textureGrad(tex,uv2.xy,uv1.xy,uv1.xy); // mediump gradient
- _fragColor = g1 + g2 + g3;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-out.txt
deleted file mode 100644
index 8ec32567cbc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-out.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-#extension GL_ARB_shader_texture_lod : enable
-uniform sampler2D tex;
-uniform samplerCube cub;
-varying vec3 uv;
-void main ()
-{
- gl_FragColor = (texture2DGradARB (tex, uv.xy, dFdx(uv.xy), dFdy(uv.xy)) + textureCubeGradARB (cub, uv, dFdx(uv), dFdy(uv)));
-}
-
-
-// stats: 5 alu 2 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 3x1 [-1]
-// textures: 2
-// #0: tex (high 2d) 0x0 [-1]
-// #1: cub (high cube) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES.txt
deleted file mode 100644
index a3110f802fb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-#extension GL_EXT_shader_texture_lod : enable
-#extension GL_OES_standard_derivatives : enable
-uniform sampler2D tex;
-uniform lowp samplerCube cub;
-varying highp vec3 uv;
-void main ()
-{
- lowp vec4 tmpvar_1;
- tmpvar_1 = texture2DGradEXT (tex, uv.xy, dFdx(uv.xy), dFdy(uv.xy));
- lowp vec4 tmpvar_2;
- tmpvar_2 = textureCubeGradEXT (cub, uv, dFdx(uv), dFdy(uv));
- gl_FragColor = (tmpvar_1 + tmpvar_2);
-}
-
-
-// stats: 5 alu 2 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 3x1 [-1]
-// textures: 2
-// #0: tex (low 2d) 0x0 [-1]
-// #1: cub (low cube) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3.txt
deleted file mode 100644
index 5ddc3454e35..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-#version 300 es
-precision mediump float;
-uniform sampler2D tex;
-in mediump vec3 uv1;
-in highp vec3 uv2;
-out lowp vec4 _fragColor;
-void main ()
-{
- mediump vec2 tmpvar_1;
- tmpvar_1 = dFdx(uv1.xy);
- mediump vec2 tmpvar_2;
- tmpvar_2 = dFdy(uv1.xy);
- highp vec2 tmpvar_3;
- tmpvar_3 = dFdx(uv2.xy);
- highp vec2 tmpvar_4;
- tmpvar_4 = dFdy(uv2.xy);
- _fragColor = ((textureGrad (tex, uv1.xy, tmpvar_1, tmpvar_2) + textureGrad (tex, uv2.xy, tmpvar_3, tmpvar_4)) + textureGrad (tex, uv2.xy, uv1.xy, uv1.xy));
-}
-
-
-// stats: 6 alu 3 tex 0 flow
-// inputs: 2
-// #0: uv1 (medium float) 3x1 [-1]
-// #1: uv2 (high float) 3x1 [-1]
-// textures: 1
-// #0: tex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3Metal.txt
deleted file mode 100644
index f9f48cb6b3f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dgrad-outES3Metal.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- half3 uv1;
- float3 uv2;
-};
-struct xlatMtlShaderOutput {
- half4 _fragColor [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-;
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half2 tmpvar_1 = 0;
- tmpvar_1 = dfdx(_mtl_i.uv1.xy);
- half2 tmpvar_2 = 0;
- tmpvar_2 = dfdy(_mtl_i.uv1.xy);
- float2 tmpvar_3 = 0;
- tmpvar_3 = dfdx(_mtl_i.uv2.xy);
- float2 tmpvar_4 = 0;
- tmpvar_4 = dfdy(_mtl_i.uv2.xy);
- _mtl_o._fragColor = ((tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv1.xy), gradient2d((float2)(tmpvar_1), (float2)(tmpvar_2))) + tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv2.xy), gradient2d((float2)(tmpvar_3), (float2)(tmpvar_4)))) + tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv2.xy), gradient2d((float2)(_mtl_i.uv1.xy), (float2)(_mtl_i.uv1.xy))));
- return _mtl_o;
-}
-
-
-// stats: 6 alu 3 tex 0 flow
-// inputs: 2
-// #0: uv1 (medium float) 3x1 [-1]
-// #1: uv2 (high float) 3x1 [-1]
-// textures: 1
-// #0: tex (low 2d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-in.txt
deleted file mode 100644
index e283775f819..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-in.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-#extension GL_ARB_shader_texture_lod : require
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return texture2DLod( s, coord.xy, coord.w);
-}
-uniform sampler2D tex;
-vec4 xlat_main( in vec4 uv );
-vec4 xlat_main( in vec4 uv ) {
- return xll_tex2Dlod( tex, vec4( uv.xy , 0.0, 0.0));
-}
-varying vec4 xlv_TEXCOORD0;
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES.txt
deleted file mode 100644
index 94a1a0bc63f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-#extension GL_EXT_shader_texture_lod : require
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return texture2DLodEXT( s, coord.xy, coord.w);
-}
-uniform sampler2D tex;
-mediump vec4 xlat_main( in highp vec4 uv );
-mediump vec4 xlat_main( in highp vec4 uv ) {
- return xll_tex2Dlod( tex, vec4( uv.xy , 0.0, 0.0));
-}
-varying highp vec4 xlv_TEXCOORD0;
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES3.txt
deleted file mode 100644
index a1ca7f26401..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-inES3.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-#version 300 es
-precision mediump float;
-
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return textureLod (s, coord.xy, coord.w);
-}
-uniform sampler2D tex;
-mediump vec4 xlat_main (in highp vec4 uv) {
- return xll_tex2Dlod( tex, vec4( uv.xy , 0.0, 0.0));
-}
-in highp vec4 uvHi;
-in mediump vec4 uvMed;
-out vec4 _fragColor;
-void main() {
- mediump vec4 r;
- r = xlat_main(uvHi);
- r += textureLod (tex, uvMed.xy, uvMed.z); // mediump arguments
- _fragColor = r;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-out.txt
deleted file mode 100644
index 5f049c2fa9a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-out.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-#extension GL_ARB_shader_texture_lod : enable
-uniform sampler2D tex;
-varying vec4 xlv_TEXCOORD0;
-void main ()
-{
- gl_FragData[0] = texture2DLod (tex, xlv_TEXCOORD0.xy, 0.0);
-}
-
-
-// stats: 0 alu 1 tex 0 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// textures: 1
-// #0: tex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt
deleted file mode 100644
index 5d39865c8cd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-#extension GL_EXT_shader_texture_lod : enable
-lowp vec4 impl_low_texture2DLodEXT(lowp sampler2D sampler, highp vec2 coord, mediump float lod)
-{
-#if defined(GL_EXT_shader_texture_lod)
- return texture2DLodEXT(sampler, coord, lod);
-#else
- return texture2D(sampler, coord, lod);
-#endif
-}
-
-uniform sampler2D tex;
-varying highp vec4 xlv_TEXCOORD0;
-void main ()
-{
- mediump vec4 tmpvar_1;
- lowp vec4 tmpvar_2;
- tmpvar_2 = impl_low_texture2DLodEXT (tex, xlv_TEXCOORD0.xy, 0.0);
- tmpvar_1 = tmpvar_2;
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 0 alu 1 tex 0 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// textures: 1
-// #0: tex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3.txt
deleted file mode 100644
index 826630bbaaf..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-#version 300 es
-precision mediump float;
-uniform sampler2D tex;
-in highp vec4 uvHi;
-in mediump vec4 uvMed;
-out mediump vec4 _fragColor;
-void main ()
-{
- mediump vec4 tmpvar_1;
- lowp vec4 tmpvar_2;
- tmpvar_2 = textureLod (tex, uvHi.xy, 0.0);
- tmpvar_1 = tmpvar_2;
- lowp vec4 tmpvar_3;
- tmpvar_3 = textureLod (tex, uvMed.xy, uvMed.z);
- _fragColor = (tmpvar_1 + tmpvar_3);
-}
-
-
-// stats: 1 alu 2 tex 0 flow
-// inputs: 2
-// #0: uvHi (high float) 4x1 [-1]
-// #1: uvMed (medium float) 4x1 [-1]
-// textures: 1
-// #0: tex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3Metal.txt
deleted file mode 100644
index af62fcf4155..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dlod-outES3Metal.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 uvHi;
- half4 uvMed;
-};
-struct xlatMtlShaderOutput {
- half4 _fragColor [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-;
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 tmpvar_1 = 0;
- half4 tmpvar_2 = 0;
- tmpvar_2 = tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uvHi.xy), level(0.0));
- tmpvar_1 = tmpvar_2;
- half4 tmpvar_3 = 0;
- tmpvar_3 = tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uvMed.xy), level(_mtl_i.uvMed.z));
- _mtl_o._fragColor = (tmpvar_1 + tmpvar_3);
- return _mtl_o;
-}
-
-
-// stats: 1 alu 2 tex 0 flow
-// inputs: 2
-// #0: uvHi (high float) 4x1 [-1]
-// #1: uvMed (medium float) 4x1 [-1]
-// textures: 1
-// #0: tex (low 2d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-in.txt
deleted file mode 100644
index cd50bfe92fc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-in.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-float xll_shadow2D(sampler2DShadow s, vec3 coord) { return shadow2D (s, coord).r; }
-float xll_shadow2Dproj(sampler2DShadow s, vec4 coord) { return shadow2DProj (s, coord).r; }
-uniform sampler2DShadow shadowmap;
-vec4 xlat_main( in vec4 uv );
-#line 4
-vec4 xlat_main( in vec4 uv ) {
- float s1;
- float s2;
- s1 = xll_shadow2D( shadowmap, uv.xyz);
- s2 = xll_shadow2Dproj( shadowmap, uv);
- #line 8
- return vec4( (s1 + s2));
-}
-varying vec4 xlv_TEXCOORD0;
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES.txt
deleted file mode 100644
index d8458936edd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-#extension GL_EXT_shadow_samplers : require
-float xll_shadow2D(sampler2DShadow s, vec3 coord) { return shadow2DEXT (s, coord); }
-float xll_shadow2Dproj(sampler2DShadow s, vec4 coord) { return shadow2DProjEXT (s, coord); }
-uniform sampler2DShadow shadowmap;
-lowp vec4 xlat_main( in highp vec4 uv );
-#line 4
-lowp vec4 xlat_main( in highp vec4 uv ) {
- lowp float s1;
- lowp float s2;
- s1 = xll_shadow2D( shadowmap, uv.xyz);
- s2 = xll_shadow2Dproj( shadowmap, uv);
- #line 8
- return vec4( (s1 + s2));
-}
-varying highp vec4 xlv_TEXCOORD0;
-void main() {
- lowp vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES3.txt
deleted file mode 100644
index 922e3b3980f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-inES3.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-#version 300 es
-precision mediump float;
-
-float xll_shadow2D(sampler2DShadow s, vec3 coord) { return texture (s, coord); }
-float xll_shadow2Dproj(sampler2DShadow s, vec4 coord) { return textureProj (s, coord); }
-uniform sampler2DShadow shadowmap;
-lowp vec4 xlat_main (in highp vec4 uv) {
- lowp float s1;
- lowp float s2;
- s1 = xll_shadow2D( shadowmap, uv.xyz);
- s2 = xll_shadow2Dproj( shadowmap, uv);
- #line 8
- return vec4( (s1 + s2));
-}
-in highp vec4 uvHi;
-in mediump vec4 uvMed;
-out vec4 _fragColor;
-void main() {
- lowp vec4 r;
- r = xlat_main(uvHi);
- r.x += texture (shadowmap, uvMed.xyz);
- _fragColor = r;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt
deleted file mode 100644
index 68e11513629..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-out.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-uniform sampler2DShadow shadowmap;
-varying vec4 xlv_TEXCOORD0;
-void main ()
-{
- gl_FragData[0] = vec4((shadow2D (shadowmap, xlv_TEXCOORD0.xyz).x + shadow2DProj (shadowmap, xlv_TEXCOORD0).x));
-}
-
-
-// stats: 1 alu 2 tex 0 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// textures: 1
-// #0: shadowmap (high 2dshadow) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt
deleted file mode 100644
index fcbba67c309..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-#extension GL_EXT_shadow_samplers : enable
-uniform lowp sampler2DShadow shadowmap;
-varying highp vec4 xlv_TEXCOORD0;
-void main ()
-{
- lowp vec4 tmpvar_1;
- tmpvar_1 = vec4((shadow2DEXT (shadowmap, xlv_TEXCOORD0.xyz) + shadow2DProjEXT (shadowmap, xlv_TEXCOORD0)));
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 1 alu 2 tex 0 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// textures: 1
-// #0: shadowmap (low 2dshadow) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt
deleted file mode 100644
index 64af66456a0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-#version 300 es
-precision mediump float;
-uniform lowp sampler2DShadow shadowmap;
-in highp vec4 uvHi;
-in mediump vec4 uvMed;
-out lowp vec4 _fragColor;
-void main ()
-{
- lowp vec4 r_1;
- lowp vec4 tmpvar_2;
- tmpvar_2 = vec4((texture (shadowmap, uvHi.xyz) + textureProj (shadowmap, uvHi)));
- r_1.yzw = tmpvar_2.yzw;
- r_1.x = (tmpvar_2.x + texture (shadowmap, uvMed.xyz));
- _fragColor = r_1;
-}
-
-
-// stats: 2 alu 3 tex 0 flow
-// inputs: 2
-// #0: uvHi (high float) 4x1 [-1]
-// #1: uvMed (medium float) 4x1 [-1]
-// textures: 1
-// #0: shadowmap (low 2dshadow) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt
deleted file mode 100644
index 45f2f9f1ef9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex2dshadow-outES3Metal.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less_equal);
-struct xlatMtlShaderInput {
- float4 uvHi;
- half4 uvMed;
-};
-struct xlatMtlShaderOutput {
- half4 _fragColor [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-;
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , depth2d<float> shadowmap [[texture(0)]], sampler _mtlsmp_shadowmap [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 r_1 = 0;
- half4 tmpvar_2 = 0;
- tmpvar_2 = half4((shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvHi.xyz).xy, saturate((float)(_mtl_i.uvHi.xyz).z)) + shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvHi).xy / (float)(_mtl_i.uvHi).w, saturate((float)(_mtl_i.uvHi).z / (float)(_mtl_i.uvHi).w))));
- r_1.yzw = tmpvar_2.yzw;
- r_1.x = (tmpvar_2.x + shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uvMed.xyz).xy, saturate((float)(_mtl_i.uvMed.xyz).z)));
- _mtl_o._fragColor = r_1;
- return _mtl_o;
-}
-
-
-// stats: 2 alu 3 tex 0 flow
-// inputs: 2
-// #0: uvHi (high float) 4x1 [-1]
-// #1: uvMed (medium float) 4x1 [-1]
-// textures: 1
-// #0: shadowmap (low 2dshadow) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-in.txt
deleted file mode 100644
index b4e68980f1d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-in.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-uniform sampler3D tex;
-varying vec3 uv;
-void main() {
- gl_FragColor = texture3D(tex, uv);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES3.txt
deleted file mode 100644
index 412d0174ac9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES3.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-#version 300 es
-precision mediump float;
-uniform sampler3D tex;
-in vec3 uv;
-out vec4 _fragColor;
-void main() {
- _fragColor = texture(tex, uv);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES__.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES__.txt
deleted file mode 100644
index afe393d869d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-inES__.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-#extension GL_OES_texture_3D : require
-
-uniform sampler3D tex;
-varying vec3 uv;
-void main() {
- gl_FragColor = texture3D(tex, uv);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-out.txt
deleted file mode 100644
index 8d5381964af..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-out.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-uniform sampler3D tex;
-varying vec3 uv;
-void main ()
-{
- gl_FragColor = texture3D (tex, uv);
-}
-
-
-// stats: 0 alu 1 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 3x1 [-1]
-// textures: 1
-// #0: tex (high 3d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3.txt
deleted file mode 100644
index 8985475e186..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-#version 300 es
-precision mediump float;
-uniform lowp sampler3D tex;
-in vec3 uv;
-out lowp vec4 _fragColor;
-void main ()
-{
- _fragColor = texture (tex, uv);
-}
-
-
-// stats: 0 alu 1 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 3x1 [-1]
-// textures: 1
-// #0: tex (low 3d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3Metal.txt
deleted file mode 100644
index 91d9515cb04..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/tex3D-outES3Metal.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float3 uv;
-};
-struct xlatMtlShaderOutput {
- half4 _fragColor [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-;
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture3d<half> tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- _mtl_o._fragColor = tex.sample(_mtlsmp_tex, (float3)(_mtl_i.uv));
- return _mtl_o;
-}
-
-
-// stats: 0 alu 1 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 3x1 [-1]
-// textures: 1
-// #0: tex (low 3d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-inES3.txt
deleted file mode 100644
index e0f2b29c49f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-inES3.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-#version 300 es
-precision mediump float;
-
-uniform samplerCubeShadow shadowmap;
-
-in mediump vec4 uv;
-out mediump vec4 _fragColor;
-
-void main()
-{
- float s = texture (shadowmap, uv);
- _fragColor = vec4(s);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3.txt
deleted file mode 100644
index 2af5a2962b3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-#version 300 es
-precision mediump float;
-uniform lowp samplerCubeShadow shadowmap;
-in mediump vec4 uv;
-out mediump vec4 _fragColor;
-void main ()
-{
- lowp vec4 tmpvar_1;
- tmpvar_1 = vec4(texture (shadowmap, uv));
- _fragColor = tmpvar_1;
-}
-
-
-// stats: 0 alu 1 tex 0 flow
-// inputs: 1
-// #0: uv (medium float) 4x1 [-1]
-// textures: 1
-// #0: shadowmap (low cube) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3Metal.txt
deleted file mode 100644
index 5bd07ee9088..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texCubeShadow-outES3Metal.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less_equal);
-struct xlatMtlShaderInput {
- half4 uv;
-};
-struct xlatMtlShaderOutput {
- half4 _fragColor [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-;
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , depthcube<float> shadowmap [[texture(0)]], sampler _mtlsmp_shadowmap [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 tmpvar_1 = 0;
- tmpvar_1 = half4(shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float3)(_mtl_i.uv).xyz, (_mtl_i.uv).w));
- _mtl_o._fragColor = tmpvar_1;
- return _mtl_o;
-}
-
-
-// stats: 0 alu 1 tex 0 flow
-// inputs: 1
-// #0: uv (medium float) 4x1 [-1]
-// textures: 1
-// #0: shadowmap (low cube) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-inES3.txt
deleted file mode 100644
index 2e7bd28eda3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-inES3.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-#version 300 es
-in mediump vec3 uv;
-out lowp vec4 outColor;
-uniform sampler2D tex;
-uniform sampler3D vol;
-void main()
-{
- lowp vec4 c;
-
- // texture offset forms
- c = textureOffset (tex, uv.xy, ivec2(-2,-3));
- c += textureOffset (tex, uv.xy, ivec2(4,5), 0.5);
- c += textureOffset (vol, uv.xyz, ivec3(-2,-3,-4));
- c += textureOffset (vol, uv.xyz, ivec3(4,5,6), -0.5);
-
- // texelFetch forms
- c += texelFetch (tex, ivec2(1,2), 1);
- c += texelFetch (vol, ivec3(1,2,3), 2);
- c += texelFetchOffset (tex, ivec2(1,2), 3, ivec2(-2,-3));
- c += texelFetchOffset (vol, ivec3(1,2,3), 0, ivec3(-2,-3,-4));
-
- outColor = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt
deleted file mode 100644
index a9a38f57417..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-#version 300 es
-in mediump vec3 uv;
-out lowp vec4 outColor;
-uniform sampler2D tex;
-uniform lowp sampler3D vol;
-void main ()
-{
- lowp vec4 c_1;
- c_1 = (textureOffset (tex, uv.xy, ivec2(-2, -3)) + textureOffset (tex, uv.xy, ivec2(4, 5), 0.5));
- c_1 = (c_1 + textureOffset (vol, uv, ivec3(-2, -3, -4)));
- c_1 = (c_1 + textureOffset (vol, uv, ivec3(4, 5, 6), -0.5));
- c_1 = (c_1 + texelFetch (tex, ivec2(1, 2), 1));
- c_1 = (c_1 + texelFetch (vol, ivec3(1, 2, 3), 2));
- c_1 = (c_1 + texelFetchOffset (tex, ivec2(1, 2), 3, ivec2(-2, -3)));
- c_1 = (c_1 + texelFetchOffset (vol, ivec3(1, 2, 3), 0, ivec3(-2, -3, -4)));
- outColor = c_1;
-}
-
-
-// stats: 7 alu 8 tex 0 flow
-// inputs: 1
-// #0: uv (medium float) 3x1 [-1]
-// textures: 2
-// #0: tex (low 2d) 0x0 [-1]
-// #1: vol (low 3d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3Metal.txt
deleted file mode 100644
index a26cd301e09..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texOffset-outES3Metal.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- half3 uv;
-};
-struct xlatMtlShaderOutput {
- half4 outColor [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]]
- , texture3d<half> vol [[texture(1)]], sampler _mtlsmp_vol [[sampler(1)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- c_1 = (tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv.xy)) + tex.sample(_mtlsmp_tex, (float2)(_mtl_i.uv.xy), bias(0.5)));
- c_1 = (c_1 + vol.sample(_mtlsmp_vol, (float3)(_mtl_i.uv)));
- c_1 = (c_1 + vol.sample(_mtlsmp_vol, (float3)(_mtl_i.uv), bias(-0.5)));
- c_1 = (c_1 + tex.sample(_mtlsmp_tex, (float2)(int2(1, 2))));
- c_1 = (c_1 + vol.sample(_mtlsmp_vol, (float3)(int3(1, 2, 3))));
- c_1 = (c_1 + tex.sample(_mtlsmp_tex, (float2)(int2(1, 2))));
- c_1 = (c_1 + vol.sample(_mtlsmp_vol, (float3)(int3(1, 2, 3))));
- _mtl_o.outColor = c_1;
- return _mtl_o;
-}
-
-
-// stats: 7 alu 8 tex 0 flow
-// inputs: 1
-// #0: uv (medium float) 3x1 [-1]
-// textures: 2
-// #0: tex (low 2d) 0x0 [-1] loc 0
-// #1: vol (low 3d) 0x0 [-1] loc 1
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-inES.txt
deleted file mode 100644
index 0a0876aba8c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-inES.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-#extension GL_EXT_shadow_samplers : require
-#extension GL_EXT_shader_texture_lod : require
-
-uniform sampler2D tex;
-uniform sampler2DShadow shadowmap;
-
-varying highp vec4 uv;
-
-void main() {
- lowp vec4 c;
- c = texture2DProj(tex, uv);
- c += texture2DProj(tex, uv.xyz);
- c += texture2DProjLodEXT(tex, uv, 1.0);
- c += texture2DProjLodEXT(tex, uv.xyz, 1.0);
-
- c += vec4(shadow2DEXT(shadowmap, uv.xyz));
- c += vec4(shadow2DProjEXT(shadowmap, uv));
-
- gl_FragColor = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-inES3.txt
deleted file mode 100644
index 0bd68597bd2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-inES3.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-
-uniform sampler2D tex;
-uniform sampler2DShadow shadowmap;
-
-in highp vec4 uv;
-
-void main() {
- lowp vec4 c;
- c = textureProj(tex, uv);
- c += textureProj(tex, uv.xyz);
- c += textureProjLod(tex, uv, 1.0);
- c += textureProjLod(tex, uv.xyz, 1.0);
-
- c += vec4(texture(shadowmap, uv.xyz));
- c += vec4(textureProj(shadowmap, uv));
-
- _fragData = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt
deleted file mode 100644
index 33f2890ec37..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-#extension GL_EXT_shader_texture_lod : enable
-#extension GL_EXT_shadow_samplers : enable
-lowp vec4 impl_low_texture2DProjLodEXT(lowp sampler2D sampler, highp vec4 coord, mediump float lod)
-{
-#if defined(GL_EXT_shader_texture_lod)
- return texture2DProjLodEXT(sampler, coord, lod);
-#else
- return texture2DProj(sampler, coord, lod);
-#endif
-}
-
-lowp vec4 impl_low_texture2DProjLodEXT(lowp sampler2D sampler, highp vec3 coord, mediump float lod)
-{
-#if defined(GL_EXT_shader_texture_lod)
- return texture2DProjLodEXT(sampler, coord, lod);
-#else
- return texture2DProj(sampler, coord, lod);
-#endif
-}
-
-uniform sampler2D tex;
-uniform lowp sampler2DShadow shadowmap;
-varying highp vec4 uv;
-void main ()
-{
- lowp vec4 c_1;
- c_1 = (texture2DProj (tex, uv) + texture2DProj (tex, uv.xyz));
- c_1 = (c_1 + impl_low_texture2DProjLodEXT (tex, uv, 1.0));
- c_1 = (c_1 + impl_low_texture2DProjLodEXT (tex, uv.xyz, 1.0));
- c_1 = (c_1 + vec4(shadow2DEXT (shadowmap, uv.xyz)));
- c_1 = (c_1 + vec4(shadow2DProjEXT (shadowmap, uv)));
- gl_FragColor = c_1;
-}
-
-
-// stats: 5 alu 6 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 4x1 [-1]
-// textures: 2
-// #0: tex (low 2d) 0x0 [-1]
-// #1: shadowmap (low 2dshadow) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt
deleted file mode 100644
index cbcfaba03ea..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-uniform sampler2D tex;
-uniform lowp sampler2DShadow shadowmap;
-in highp vec4 uv;
-void main ()
-{
- lowp vec4 c_1;
- c_1 = (textureProj (tex, uv) + textureProj (tex, uv.xyz));
- c_1 = (c_1 + textureProjLod (tex, uv, 1.0));
- c_1 = (c_1 + textureProjLod (tex, uv.xyz, 1.0));
- c_1 = (c_1 + vec4(texture (shadowmap, uv.xyz)));
- c_1 = (c_1 + vec4(textureProj (shadowmap, uv)));
- _fragData = c_1;
-}
-
-
-// stats: 5 alu 6 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 4x1 [-1]
-// textures: 2
-// #0: tex (low 2d) 0x0 [-1]
-// #1: shadowmap (low 2dshadow) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt
deleted file mode 100644
index d8dd6c1be0a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texProj-outES3Metal.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-constexpr sampler _mtl_xl_shadow_sampler(address::clamp_to_edge, filter::linear, compare_func::less_equal);
-struct xlatMtlShaderInput {
- float4 uv;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> tex [[texture(0)]], sampler _mtlsmp_tex [[sampler(0)]]
- , depth2d<float> shadowmap [[texture(1)]], sampler _mtlsmp_shadowmap [[sampler(1)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- c_1 = (tex.sample(_mtlsmp_tex, ((float2)(_mtl_i.uv).xy / (float)(_mtl_i.uv).w)) + tex.sample(_mtlsmp_tex, ((float2)(_mtl_i.uv.xyz).xy / (float)(_mtl_i.uv.xyz).z)));
- c_1 = (c_1 + tex.sample(_mtlsmp_tex, ((float2)(_mtl_i.uv).xy / (float)(_mtl_i.uv).w), level(1.0)));
- c_1 = (c_1 + tex.sample(_mtlsmp_tex, ((float2)(_mtl_i.uv.xyz).xy / (float)(_mtl_i.uv.xyz).z), level(1.0)));
- c_1 = (c_1 + half4(shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uv.xyz).xy, saturate((float)(_mtl_i.uv.xyz).z))));
- c_1 = (c_1 + half4(shadowmap.sample_compare(_mtl_xl_shadow_sampler, (float2)(_mtl_i.uv).xy / (float)(_mtl_i.uv).w, saturate((float)(_mtl_i.uv).z / (float)(_mtl_i.uv).w))));
- _mtl_o._fragData = c_1;
- return _mtl_o;
-}
-
-
-// stats: 5 alu 6 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 4x1 [-1]
-// textures: 2
-// #0: tex (low 2d) 0x0 [-1] loc 0
-// #1: shadowmap (low 2dshadow) 0x0 [-1] loc 1
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-inES3.txt
deleted file mode 100644
index 130cd5d5ab6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-inES3.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-#version 300 es
-uniform highp sampler2D map;
-layout ( location = 0 ) out mediump vec4 out_color;
-void main () {
- vec2 map_size = vec2(textureSize(map, 0));
- out_color = vec4(map_size.x, map_size.y, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-outES3.txt
deleted file mode 100644
index becc32a72de..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-outES3.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-#version 300 es
-uniform highp sampler2D map;
-layout(location=0) out mediump vec4 out_color;
-void main ()
-{
- highp vec4 tmpvar_1;
- tmpvar_1.zw = vec2(0.0, 0.0);
- tmpvar_1.xy = vec2(textureSize (map, 0));
- out_color = tmpvar_1;
-}
-
-
-// stats: 2 alu 1 tex 0 flow
-// textures: 1
-// #0: map (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-outES3Metal.txt
deleted file mode 100644
index a83731bca90..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texSize-outES3Metal.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
-};
-struct xlatMtlShaderOutput {
- half4 out_color [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<float> map [[texture(0)]], sampler _mtlsmp_map [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float4 tmpvar_1 = 0;
- tmpvar_1.zw = float2(0.0, 0.0);
- tmpvar_1.xy = float2(map.get_width(0), map.get_height(0));
- _mtl_o.out_color = half4(tmpvar_1);
- return _mtl_o;
-}
-
-
-// stats: 2 alu 1 tex 0 flow
-// textures: 1
-// #0: map (high 2d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texelFetchMSAA-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texelFetchMSAA-in.txt
deleted file mode 100644
index 02a78ec3560..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texelFetchMSAA-in.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-#version 150
-uniform sampler2DMS tex;
-in vec2 uv;
-out vec4 color;
-void main() {
- color = texelFetch(tex, ivec2(uv), 3);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texelFetchMSAA-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texelFetchMSAA-out.txt
deleted file mode 100644
index 1e63dc760e6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/texelFetchMSAA-out.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-#version 150
-uniform sampler2DMS tex;
-in vec2 uv;
-out vec4 color;
-void main ()
-{
- color = texelFetch (tex, ivec2(uv), 3);
-}
-
-
-// stats: 1 alu 1 tex 0 flow
-// inputs: 1
-// #0: uv (high float) 2x1 [-1]
-// textures: 1
-// #0: tex (high other) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/types-writemask-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/types-writemask-in.txt
deleted file mode 100644
index ec426f50e36..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/types-writemask-in.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-void main () {
- vec4 c;
- c.x = gl_FragCoord.y;
- c.yzw = vec3(4.0,5.0,6.0);
- gl_FragColor = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/types-writemask-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/types-writemask-out.txt
deleted file mode 100644
index 1e5d0e6c8b5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/types-writemask-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-void main ()
-{
- vec4 c_1;
- c_1.x = gl_FragCoord.y;
- c_1.yzw = vec3(4.0, 5.0, 6.0);
- gl_FragColor = c_1;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_FragCoord (high float) 4x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-inES3.txt
deleted file mode 100644
index 64881fe105a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-inES3.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-#version 300 es
-#define gl_FragData _glesFragData
-layout(location = 0) out mediump vec4 _glesFragData[1];
-
-uniform sampler2D _MainTex;
-
-struct u2v {
- vec4 pos;
- vec2 uv;
-};
-
-struct v2f {
- vec4 pos;
- vec2 uv;
-};
-
-v2f vert (u2v v) {
- v2f o;
- o.pos = v.pos;
- o.uv = v.uv;
- return o;
-}
-
-vec4 frag (in v2f i) {
- vec4 foo;
- bool bar;
- mat4 mat;
- vec4 leet = vec4(0.5);
- vec4 col = texture(_MainTex, i.uv);
- col += bar ? foo : leet;
- col += mat[0];
- return col;
-}
-
-in mediump vec2 xlv_TEXCOORD0;
-void main() {
- mediump vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2(xlv_TEXCOORD0);
- xl_retval = frag(xlt_i);
- gl_FragData[0] = vec4(xl_retval);
-}
-
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-outES3.txt
deleted file mode 100644
index c917d7ea094..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-outES3.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-#version 300 es
-layout(location=0) out mediump vec4 _glesFragData[1];
-uniform sampler2D _MainTex;
-in mediump vec2 xlv_TEXCOORD0;
-void main ()
-{
- mediump vec4 xl_retval_1;
- lowp vec4 col_2;
- highp vec4 mat_0_3;
- bool bar_4;
- highp vec4 foo_5;
- lowp vec4 tmpvar_6;
- tmpvar_6 = texture (_MainTex, xlv_TEXCOORD0);
- col_2 = tmpvar_6;
- highp vec4 tmpvar_7;
- if (bar_4) {
- tmpvar_7 = foo_5;
- } else {
- tmpvar_7 = vec4(0.5, 0.5, 0.5, 0.5);
- };
- col_2 = (tmpvar_6 + tmpvar_7);
- col_2 = (col_2 + mat_0_3);
- xl_retval_1 = col_2;
- _glesFragData[0] = xl_retval_1;
-}
-
-
-// stats: 3 alu 1 tex 1 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-outES3Metal.txt
deleted file mode 100644
index f613ea33045..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/variables-initialization-outES3Metal.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- half2 xlv_TEXCOORD0;
-};
-struct xlatMtlShaderOutput {
- half4 _glesFragData_0 [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 xl_retval_1 = 0;
- half4 col_2 = 0;
- float4 mat_0_3 = 0;
- bool bar_4 = false;
- float4 foo_5 = 0;
- half4 tmpvar_6 = 0;
- tmpvar_6 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
- col_2 = tmpvar_6;
- float4 tmpvar_7 = 0;
- if (bar_4) {
- tmpvar_7 = foo_5;
- } else {
- tmpvar_7 = float4(0.5, 0.5, 0.5, 0.5);
- };
- col_2 = (tmpvar_6 + (half4)(tmpvar_7));
- col_2 = (col_2 + (half4)(mat_0_3));
- xl_retval_1 = col_2;
- _mtl_o._glesFragData_0 = xl_retval_1;
- return _mtl_o;
-}
-
-
-// stats: 3 alu 1 tex 1 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-in.txt
deleted file mode 100644
index 835df7d5711..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-in.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-vec4 xlat_main( in vec4 uv, in vec4 foobar_xlv_foo );
-vec4 xlat_main( in vec4 uv, in vec4 foobar_xlv_foo ) {
- vec4 c;
- c = vec4( 0.000000);
- return c;
-}
-varying vec4 xlv_TEXCOORD0;
-varying vec4 xlv_TEXCOORD1;
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0), vec4(xlv_TEXCOORD1));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-inES.txt
deleted file mode 100644
index a81e16c3532..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-inES.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-mediump vec4 xlat_main( in highp vec4 uv, in highp vec4 foobar_xlv_foo );
-mediump vec4 xlat_main( in highp vec4 uv, in highp vec4 foobar_xlv_foo ) {
- mediump vec4 c;
- c = vec4( 0.000000);
- return c;
-}
-varying highp vec4 xlv_TEXCOORD0;
-varying highp vec4 xlv_TEXCOORD1;
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_TEXCOORD0), vec4(xlv_TEXCOORD1));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-out.txt
deleted file mode 100644
index b8c9f3c0503..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-out.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main ()
-{
- gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0);
-}
-
-
-// stats: 1 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-outES.txt
deleted file mode 100644
index b8c9f3c0503..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/varyings-outES.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main ()
-{
- gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0);
-}
-
-
-// stats: 1 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-in.txt
deleted file mode 100644
index 07384c500f2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-in.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-vec4 xlat_main( in float face );
-vec4 xlat_main( in float face ) {
- return vec4( face);
-}
-varying float xlv_VFACE;
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( float(xlv_VFACE));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-inES.txt
deleted file mode 100644
index 807922ae93f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-inES.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-mediump vec4 xlat_main( in highp float face );
-mediump vec4 xlat_main( in highp float face ) {
- return vec4( face);
-}
-varying highp float xlv_VFACE;
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( float(xlv_VFACE));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-out.txt
deleted file mode 100644
index 855a6bb1ae8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-out.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-varying float xlv_VFACE;
-void main ()
-{
- gl_FragData[0] = vec4(xlv_VFACE);
-}
-
-
-// stats: 0 alu 0 tex 0 flow
-// inputs: 1
-// #0: xlv_VFACE (high float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-outES.txt
deleted file mode 100644
index 92e338b8410..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vface-outES.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-varying highp float xlv_VFACE;
-void main ()
-{
- mediump vec4 tmpvar_1;
- highp vec4 tmpvar_2;
- tmpvar_2 = vec4(xlv_VFACE);
- tmpvar_1 = tmpvar_2;
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 0 alu 0 tex 0 flow
-// inputs: 1
-// #0: xlv_VFACE (high float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-in.txt
deleted file mode 100644
index 9411353e51e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-in.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-vec4 xlat_main( in vec2 pos );
-vec4 xlat_main( in vec2 pos ) {
- return vec4( pos, 0.000000, 0.000000);
-}
-varying vec2 xlv_VPOS;
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( vec2(xlv_VPOS));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-inES.txt
deleted file mode 100644
index 829b18d38fe..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-inES.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-mediump vec4 xlat_main( in highp vec2 pos );
-mediump vec4 xlat_main( in highp vec2 pos ) {
- return vec4( pos, 0.000000, 0.000000);
-}
-varying highp vec2 xlv_VPOS;
-void main() {
- mediump vec4 xl_retval;
- xl_retval = xlat_main( vec2(xlv_VPOS));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-out.txt
deleted file mode 100644
index 0a7bd118f8f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-out.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-varying vec2 xlv_VPOS;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1.zw = vec2(0.0, 0.0);
- tmpvar_1.xy = xlv_VPOS;
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 1
-// #0: xlv_VPOS (high float) 2x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-outES.txt
deleted file mode 100644
index 521238a7e2b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/vpos-outES.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-varying highp vec2 xlv_VPOS;
-void main ()
-{
- mediump vec4 tmpvar_1;
- highp vec4 tmpvar_2;
- tmpvar_2.zw = vec2(0.0, 0.0);
- tmpvar_2.xy = xlv_VPOS;
- tmpvar_1 = tmpvar_2;
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 1
-// #0: xlv_VPOS (high float) 2x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-inES3.txt
deleted file mode 100644
index e85ddc5e200..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-inES3.txt
+++ /dev/null
@@ -1,136 +0,0 @@
-#version 300 es
-
-// A variant produced by Unity's directional lightmap;
-// has an inline medium precision matrix constructor,
-// but even if unity_DirBasis is declared as mediump
-// some code was promoting it to high precision.
-
-#define gl_FragColor _glesFragData[0]
-#define gl_FragData _glesFragData
-layout(location = 0)out mediump vec4 _glesFragData[4];
-
-mat3 xll_transpose_mf3x3(mat3 m) {
- 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]);
-}
-vec3 xll_saturate_vf3( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-struct SurfaceOutput {
- lowp vec3 Albedo;
- lowp vec3 Normal;
- lowp vec3 Emission;
- mediump float Specular;
- lowp float Gloss;
- lowp float Alpha;
-};
-struct Input {
- highp vec2 uv_MainTex;
-};
-struct v2f_surf {
- highp vec4 pos;
- highp vec2 pack0;
- lowp vec3 tSpace0;
- lowp vec3 tSpace1;
- lowp vec3 tSpace2;
- highp vec4 lmap;
-};
-uniform mediump vec4 _WorldSpaceLightPos0;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-uniform lowp vec4 _LightColor0;
-uniform lowp vec4 _SpecColor;
-uniform sampler2D _MainTex;
-uniform highp vec4 _MainTex_ST;
-lowp vec3 DecodeLightmapDoubleLDR( in lowp vec4 color ) {
- return (2.0 * color.xyz);
-}
-lowp vec3 DecodeLightmap( in lowp vec4 color ) {
-
- return DecodeLightmapDoubleLDR( color);
-}
-mediump vec3 DirLightmapDiffuse( in mediump mat3 dirBasis, in lowp vec4 color, in lowp vec4 scale, in mediump vec3 normal, in bool surfFuncWritesNormal, out mediump vec3 scalePerBasisVector ) {
- mediump vec3 lm = DecodeLightmap( color);
-
- scalePerBasisVector = DecodeLightmap( scale);
- if (surfFuncWritesNormal){
-
- mediump vec3 normalInRnmBasis = xll_saturate_vf3((dirBasis * normal));
- lm *= dot( normalInRnmBasis, scalePerBasisVector);
- }
-
- return lm;
-}
-mediump vec4 LightingLambert_DirLightmap( in SurfaceOutput s, in lowp vec4 color, in lowp vec4 scale, in bool surfFuncWritesNormal ) {
- mediump mat3 unity_DirBasis = xll_transpose_mf3x3(mat3( vec3( 0.8164966, 0.0, 0.5773503), vec3( -0.4082483, 0.7071068, 0.5773503), vec3( -0.4082483, -0.7071068, 0.5773503)));
- mediump vec3 scalePerBasisVector;
-
- mediump vec4 c;
- c.xyz = DirLightmapDiffuse( unity_DirBasis, color, scale, s.Normal, surfFuncWritesNormal, scalePerBasisVector);
- c.w = 0.0;
-
- return c;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- mediump vec4 c = texture( _MainTex, IN.uv_MainTex);
- o.Albedo = c.xyz;
- o.Alpha = c.w;
-
- o.Normal = ((c.xyz * 2.0) - 1.0);
-}
-lowp vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
-
- surfIN.uv_MainTex = IN.pack0.xy;
- highp vec3 lightDir = _WorldSpaceLightPos0.xyz;
-
- SurfaceOutput o;
- o.Albedo = vec3( 0.0);
- o.Emission = vec3( 0.0);
-
- o.Specular = 0.0;
- o.Alpha = 0.0;
- o.Gloss = 0.0;
- lowp vec3 normalWorldVertex = vec3( 0.0, 0.0, 1.0);
-
- surf( surfIN, o);
- lowp float atten = 1.0;
-
- lowp vec4 c = vec4( 0.0);
-
- lowp vec4 lmtex = texture( unity_Lightmap, IN.lmap.xy);
- lowp vec4 lmIndTex = texture( unity_LightmapInd, IN.lmap.xy);
- mediump vec3 lm = LightingLambert_DirLightmap( o, lmtex, lmIndTex, true).xyz;
-
- lowp vec3 worldN;
- worldN.x = dot( IN.tSpace0.xyz, o.Normal);
- worldN.y = dot( IN.tSpace1.xyz, o.Normal);
- worldN.z = dot( IN.tSpace2.xyz, o.Normal);
-
- o.Normal = worldN;
-
- c.w = o.Alpha;
-
- c.xyz += (o.Albedo * lm);
-
- c.w = 1.0;
- return c;
-}
-in highp vec2 xlv_TEXCOORD0;
-in lowp vec3 xlv_TEXCOORD1;
-in lowp vec3 xlv_TEXCOORD2;
-in lowp vec3 xlv_TEXCOORD3;
-in highp vec4 xlv_TEXCOORD4;
-void main() {
- lowp vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.pack0 = vec2(xlv_TEXCOORD0);
- xlt_IN.tSpace0 = vec3(xlv_TEXCOORD1);
- xlt_IN.tSpace1 = vec3(xlv_TEXCOORD2);
- xlt_IN.tSpace2 = vec3(xlv_TEXCOORD3);
- xlt_IN.lmap = vec4(xlv_TEXCOORD4);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3.txt
deleted file mode 100644
index e2d412109ff..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-#version 300 es
-layout(location=0) out mediump vec4 _glesFragData[4];
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-uniform sampler2D _MainTex;
-in highp vec2 xlv_TEXCOORD0;
-in highp vec4 xlv_TEXCOORD4;
-void main ()
-{
- lowp vec4 c_1;
- lowp vec3 tmpvar_2;
- lowp vec3 tmpvar_3;
- mediump vec4 c_4;
- lowp vec4 tmpvar_5;
- tmpvar_5 = texture (_MainTex, xlv_TEXCOORD0);
- c_4 = tmpvar_5;
- tmpvar_2 = c_4.xyz;
- tmpvar_3 = ((c_4.xyz * 2.0) - 1.0);
- mediump mat3 tmpvar_6;
- tmpvar_6[uint(0)].x = 0.8164966;
- tmpvar_6[uint(0)].y = -0.4082483;
- tmpvar_6[uint(0)].z = -0.4082483;
- tmpvar_6[1u].x = 0.0;
- tmpvar_6[1u].y = 0.7071068;
- tmpvar_6[1u].z = -0.7071068;
- tmpvar_6[2u].x = 0.5773503;
- tmpvar_6[2u].y = 0.5773503;
- tmpvar_6[2u].z = 0.5773503;
- mediump vec3 normal_7;
- normal_7 = tmpvar_3;
- mediump vec3 scalePerBasisVector_8;
- mediump vec3 lm_9;
- lowp vec3 tmpvar_10;
- tmpvar_10 = (2.0 * texture (unity_Lightmap, xlv_TEXCOORD4.xy).xyz);
- lm_9 = tmpvar_10;
- lowp vec3 tmpvar_11;
- tmpvar_11 = (2.0 * texture (unity_LightmapInd, xlv_TEXCOORD4.xy).xyz);
- scalePerBasisVector_8 = tmpvar_11;
- lm_9 = (lm_9 * dot (clamp (
- (tmpvar_6 * normal_7)
- , 0.0, 1.0), scalePerBasisVector_8));
- c_1.xyz = (tmpvar_2 * lm_9);
- c_1.w = 1.0;
- _glesFragData[0] = c_1;
-}
-
-
-// stats: 19 alu 3 tex 0 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD4 (high float) 4x1 [-1]
-// textures: 3
-// #0: unity_Lightmap (low 2d) 0x0 [-1]
-// #1: unity_LightmapInd (low 2d) 0x0 [-1]
-// #2: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3Metal.txt
deleted file mode 100644
index a7530f4e1dc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-DirLMBasis-outES3Metal.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float2 xlv_TEXCOORD0;
- float4 xlv_TEXCOORD4;
-};
-struct xlatMtlShaderOutput {
- half4 _glesFragData_0 [[color(0)]];
-};
-struct xlatMtlShaderUniform {
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> unity_Lightmap [[texture(0)]], sampler _mtlsmp_unity_Lightmap [[sampler(0)]]
- , texture2d<half> unity_LightmapInd [[texture(1)]], sampler _mtlsmp_unity_LightmapInd [[sampler(1)]]
- , texture2d<half> _MainTex [[texture(2)]], sampler _mtlsmp__MainTex [[sampler(2)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- half3 tmpvar_2 = 0;
- half3 tmpvar_3 = 0;
- half4 c_4 = 0;
- half4 tmpvar_5 = 0;
- tmpvar_5 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
- c_4 = tmpvar_5;
- tmpvar_2 = c_4.xyz;
- tmpvar_3 = ((c_4.xyz * (half)(2.0)) - (half)(1.0));
- half3x3 tmpvar_6;
- tmpvar_6[0].x = half(0.8164966);
- tmpvar_6[0].y = half(-0.4082483);
- tmpvar_6[0].z = half(-0.4082483);
- tmpvar_6[1].x = half(0.0);
- tmpvar_6[1].y = half(0.7071068);
- tmpvar_6[1].z = half(-0.7071068);
- tmpvar_6[2].x = half(0.5773503);
- tmpvar_6[2].y = half(0.5773503);
- tmpvar_6[2].z = half(0.5773503);
- half3 normal_7 = 0;
- normal_7 = tmpvar_3;
- half3 scalePerBasisVector_8 = 0;
- half3 lm_9 = 0;
- half3 tmpvar_10 = 0;
- tmpvar_10 = ((half)(2.0) * unity_Lightmap.sample(_mtlsmp_unity_Lightmap, (float2)(_mtl_i.xlv_TEXCOORD4.xy)).xyz);
- lm_9 = tmpvar_10;
- half3 tmpvar_11 = 0;
- tmpvar_11 = ((half)(2.0) * unity_LightmapInd.sample(_mtlsmp_unity_LightmapInd, (float2)(_mtl_i.xlv_TEXCOORD4.xy)).xyz);
- scalePerBasisVector_8 = tmpvar_11;
- lm_9 = (lm_9 * dot (clamp (
- (tmpvar_6 * normal_7)
- , (half)0.0, (half)1.0), scalePerBasisVector_8));
- c_1.xyz = (tmpvar_2 * lm_9);
- c_1.w = half(1.0);
- _mtl_o._glesFragData_0 = c_1;
- return _mtl_o;
-}
-
-
-// stats: 19 alu 3 tex 0 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD4 (high float) 4x1 [-1]
-// textures: 3
-// #0: unity_Lightmap (low 2d) 0x0 [-1] loc 0
-// #1: unity_LightmapInd (low 2d) 0x0 [-1] loc 1
-// #2: _MainTex (low 2d) 0x0 [-1] loc 2
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-inES3.txt
deleted file mode 100644
index aa545ab1c4c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-inES3.txt
+++ /dev/null
@@ -1,98 +0,0 @@
-#version 300 es
-
-// From rcupisz light shafts package, "Coords" shader.
-// Is using vector equality, which was translating wrong to Metal
-// at some point.
-
-#define gl_FragColor _glesFragData[0]
-#define gl_FragData _glesFragData
-layout(location = 0) out mediump vec4 _glesFragData[4];
-float xll_saturate_f( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_matrixindex_mf4x4_i (mat4 m, int i) { vec4 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; v.w=m[3][i]; return v; }
-struct posuv {
- highp vec4 pos;
- highp vec2 uv;
-};
-uniform highp vec4 _ZBufferParams;
-uniform highp vec4 _LightPos;
-uniform highp float _InterpolationStep;
-uniform highp mat4 _FrustumRays;
-uniform highp vec4 _CameraPosLocal;
-uniform highp float _FrustumApex;
-uniform highp vec4 _CoordTexDim;
-uniform highp vec4 _ScreenTexDim;
-uniform sampler2D _CameraDepthTexture;
-
-highp vec2 GetEpipolarLineEntryPoint( in highp vec2 exit ) {
- return _LightPos.xy;
-}
-
-bool Cube( in highp vec3 org, in highp vec3 dir, out highp float tnear, out highp float tfar ) {
- highp vec3 invR = (1.0 / dir);
- highp vec3 tbot = (invR * (-0.5 - org));
- highp vec3 ttop = (invR * (0.5 - org));
- highp vec3 tmin = min( ttop, tbot);
- highp vec3 tmax = max( ttop, tbot);
- highp vec2 t0 = max( tmin.xx, tmin.yz);
- tnear = max( t0.x, t0.y);
- t0 = min( tmax.xx, tmax.yz);
- tfar = min( t0.x, t0.y);
- return ((tnear < tfar) && (tfar > 0.0));
-}
-highp vec3 FrustumRay( in highp vec2 uv, out highp float rayLength ) {
- highp vec3 ray0 = mix( xll_matrixindex_mf4x4_i (_FrustumRays, 0).xyz, xll_matrixindex_mf4x4_i (_FrustumRays, 1).xyz, vec3( uv.x));
- highp vec3 ray1 = mix( xll_matrixindex_mf4x4_i (_FrustumRays, 3).xyz, xll_matrixindex_mf4x4_i (_FrustumRays, 2).xyz, vec3( uv.x));
- highp vec3 ray = mix( ray0, ray1, vec3( uv.y));
- rayLength = length(ray);
- return (ray / rayLength);
-}
-bool IntersectVolume( in highp vec2 uv, out highp float near, out highp float far, out highp vec3 rayN, out highp float rayLength ) {
- rayN = FrustumRay( uv, rayLength);
- return Cube( _CameraPosLocal.xyz, rayN, near, far);
-}
-highp float Linear01Depth( in highp float z ) {
- return (1.0 / ((_ZBufferParams.x * z) + _ZBufferParams.y));
-}
-void frag( in posuv i, out highp vec4 coord, out highp vec4 depth ) {
- highp vec2 uv = i.uv;
- highp float sampleOnEpipolarLine = (uv.x - (0.5 / _CoordTexDim.x));
- highp float epipolarLine = xll_saturate_f((uv.y - (0.5 / _CoordTexDim.y)));
- sampleOnEpipolarLine *= (_CoordTexDim.x / (_CoordTexDim.x - 1.0));
- sampleOnEpipolarLine = xll_saturate_f(sampleOnEpipolarLine);
- highp int edge = int(clamp( floor((epipolarLine * 4.0)), 0.0, 3.0));
- highp float posOnEdge = fract((epipolarLine * 4.0));
- highp float edgeCoord = (-1.0 + (2.0 * posOnEdge));
- highp vec4 edgeX = vec4( -1.0, edgeCoord, 1.0, (-edgeCoord));
- highp vec4 edgeY = vec4( (-edgeCoord), -1.0, edgeCoord, 1.0);
- bvec4 edgeFlags = equal( ivec4( edge), ivec4( 0, 1, 2, 3));
- highp vec2 exit = (-vec2( dot( edgeY, vec4(edgeFlags)), dot( edgeX, vec4(edgeFlags))));
- highp vec2 entry = GetEpipolarLineEntryPoint( exit);
- highp vec2 coordTemp = mix( entry, exit, vec2( sampleOnEpipolarLine));
- coordTemp = ((coordTemp * 0.5) + 0.5);
- coord = vec4( coordTemp.x, coordTemp.y, 0.0, 0.0);
- coordTemp = ((floor((coordTemp * _ScreenTexDim.xy)) + 0.5) * _ScreenTexDim.zw);
- depth = vec4( Linear01Depth( texture( _CameraDepthTexture, coordTemp).x));
- highp float near;
- highp float far;
- highp float rayLength;
- highp vec3 rayN;
- if (((!IntersectVolume( coord.xy, near, far, rayN, rayLength)) || (depth.x < (near / rayLength)))){
- depth *= -1.0;
- }
- else{
- depth = min( depth, vec4( (far / rayLength)));
- }
-}
-in highp vec2 xlv_TEXCOORD0;
-void main() {
- posuv xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2(xlv_TEXCOORD0);
- highp vec4 xlt_coord;
- highp vec4 xlt_depth;
- frag( xlt_i, xlt_coord, xlt_depth);
- gl_FragData[0] = vec4(xlt_coord);
- gl_FragData[1] = vec4(xlt_depth);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt
deleted file mode 100644
index 1f09dc12cc5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3.txt
+++ /dev/null
@@ -1,128 +0,0 @@
-#version 300 es
-layout(location=0) out mediump vec4 _glesFragData[4];
-uniform highp vec4 _ZBufferParams;
-uniform highp vec4 _LightPos;
-uniform highp mat4 _FrustumRays;
-uniform highp vec4 _CameraPosLocal;
-uniform highp vec4 _CoordTexDim;
-uniform highp vec4 _ScreenTexDim;
-uniform sampler2D _CameraDepthTexture;
-in highp vec2 xlv_TEXCOORD0;
-void main ()
-{
- highp vec4 depth_1;
- highp vec2 coordTemp_2;
- highp float sampleOnEpipolarLine_3;
- highp float tmpvar_4;
- tmpvar_4 = clamp ((xlv_TEXCOORD0.y - (0.5 / _CoordTexDim.y)), 0.0, 1.0);
- sampleOnEpipolarLine_3 = ((xlv_TEXCOORD0.x - (0.5 / _CoordTexDim.x)) * (_CoordTexDim.x / (_CoordTexDim.x - 1.0)));
- highp float tmpvar_5;
- tmpvar_5 = clamp (sampleOnEpipolarLine_3, 0.0, 1.0);
- sampleOnEpipolarLine_3 = tmpvar_5;
- highp int tmpvar_6;
- tmpvar_6 = int(clamp (floor(
- (tmpvar_4 * 4.0)
- ), 0.0, 3.0));
- highp float tmpvar_7;
- tmpvar_7 = (-1.0 + (2.0 * fract(
- (tmpvar_4 * 4.0)
- )));
- highp vec4 tmpvar_8;
- tmpvar_8.xz = vec2(-1.0, 1.0);
- tmpvar_8.y = tmpvar_7;
- tmpvar_8.w = -(tmpvar_7);
- highp vec4 tmpvar_9;
- tmpvar_9.yw = vec2(-1.0, 1.0);
- tmpvar_9.x = -(tmpvar_7);
- tmpvar_9.z = tmpvar_7;
- bvec4 tmpvar_10;
- tmpvar_10 = equal (ivec4(tmpvar_6), ivec4(0, 1, 2, 3));
- lowp vec4 tmpvar_11;
- tmpvar_11 = vec4(tmpvar_10);
- lowp vec4 tmpvar_12;
- tmpvar_12 = vec4(tmpvar_10);
- highp vec2 tmpvar_13;
- tmpvar_13.x = dot (tmpvar_9, tmpvar_11);
- tmpvar_13.y = dot (tmpvar_8, tmpvar_12);
- coordTemp_2 = ((mix (_LightPos.xy,
- -(tmpvar_13)
- , vec2(tmpvar_5)) * 0.5) + 0.5);
- highp vec4 tmpvar_14;
- tmpvar_14.zw = vec2(0.0, 0.0);
- tmpvar_14.xy = coordTemp_2;
- coordTemp_2 = ((floor(
- (coordTemp_2 * _ScreenTexDim.xy)
- ) + 0.5) * _ScreenTexDim.zw);
- lowp vec4 tmpvar_15;
- tmpvar_15 = texture (_CameraDepthTexture, coordTemp_2);
- highp float tmpvar_16;
- highp float z_17;
- z_17 = tmpvar_15.x;
- tmpvar_16 = (1.0/(((_ZBufferParams.x * z_17) + _ZBufferParams.y)));
- depth_1 = vec4(tmpvar_16);
- highp vec4 v_18;
- v_18.x = _FrustumRays[0].x;
- v_18.y = _FrustumRays[1].x;
- v_18.z = _FrustumRays[2].x;
- v_18.w = _FrustumRays[3].x;
- highp vec4 v_19;
- v_19.x = _FrustumRays[0].y;
- v_19.y = _FrustumRays[1].y;
- v_19.z = _FrustumRays[2].y;
- v_19.w = _FrustumRays[3].y;
- highp vec4 v_20;
- v_20.x = _FrustumRays[0].w;
- v_20.y = _FrustumRays[1].w;
- v_20.z = _FrustumRays[2].w;
- v_20.w = _FrustumRays[3].w;
- highp vec4 v_21;
- v_21.x = _FrustumRays[0].z;
- v_21.y = _FrustumRays[1].z;
- v_21.z = _FrustumRays[2].z;
- v_21.w = _FrustumRays[3].z;
- highp vec3 tmpvar_22;
- tmpvar_22 = mix (mix (v_18.xyz, v_19.xyz, tmpvar_14.xxx), mix (v_20.xyz, v_21.xyz, tmpvar_14.xxx), tmpvar_14.yyy);
- highp float tmpvar_23;
- tmpvar_23 = sqrt(dot (tmpvar_22, tmpvar_22));
- bool tmpvar_24;
- highp vec3 tmpvar_25;
- tmpvar_25 = (1.0/((tmpvar_22 / tmpvar_23)));
- highp vec3 tmpvar_26;
- tmpvar_26 = (tmpvar_25 * (-0.5 - _CameraPosLocal.xyz));
- highp vec3 tmpvar_27;
- tmpvar_27 = (tmpvar_25 * (0.5 - _CameraPosLocal.xyz));
- highp vec3 tmpvar_28;
- tmpvar_28 = min (tmpvar_27, tmpvar_26);
- highp vec3 tmpvar_29;
- tmpvar_29 = max (tmpvar_27, tmpvar_26);
- highp vec2 tmpvar_30;
- tmpvar_30 = max (tmpvar_28.xx, tmpvar_28.yz);
- highp float tmpvar_31;
- tmpvar_31 = max (tmpvar_30.x, tmpvar_30.y);
- highp vec2 tmpvar_32;
- tmpvar_32 = min (tmpvar_29.xx, tmpvar_29.yz);
- highp float tmpvar_33;
- tmpvar_33 = min (tmpvar_32.x, tmpvar_32.y);
- tmpvar_24 = ((tmpvar_31 < tmpvar_33) && (tmpvar_33 > 0.0));
- if ((!(tmpvar_24) || (tmpvar_16 < (tmpvar_31 / tmpvar_23)))) {
- depth_1 = -(vec4(tmpvar_16));
- } else {
- depth_1 = min (depth_1, vec4((tmpvar_33 / tmpvar_23)));
- };
- _glesFragData[0] = tmpvar_14;
- _glesFragData[1] = depth_1;
-}
-
-
-// stats: 65 alu 1 tex 1 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// uniforms: 6 (total size: 0)
-// #0: _ZBufferParams (high float) 4x1 [-1]
-// #1: _LightPos (high float) 4x1 [-1]
-// #2: _FrustumRays (high float) 4x4 [-1]
-// #3: _CameraPosLocal (high float) 4x1 [-1]
-// #4: _CoordTexDim (high float) 4x1 [-1]
-// #5: _ScreenTexDim (high float) 4x1 [-1]
-// textures: 1
-// #0: _CameraDepthTexture (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3Metal.txt
deleted file mode 100644
index a06acd4448c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-LightShaftsCoord-outES3Metal.txt
+++ /dev/null
@@ -1,139 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float2 xlv_TEXCOORD0;
-};
-struct xlatMtlShaderOutput {
- half4 _glesFragData_0 [[color(0)]];
- half4 _glesFragData_1 [[color(1)]];
-};
-struct xlatMtlShaderUniform {
- float4 _ZBufferParams;
- float4 _LightPos;
- float4x4 _FrustumRays;
- float4 _CameraPosLocal;
- float4 _CoordTexDim;
- float4 _ScreenTexDim;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _CameraDepthTexture [[texture(0)]], sampler _mtlsmp__CameraDepthTexture [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float4 depth_1 = 0;
- float2 coordTemp_2 = 0;
- float sampleOnEpipolarLine_3 = 0;
- float tmpvar_4 = 0;
- tmpvar_4 = clamp ((_mtl_i.xlv_TEXCOORD0.y - (0.5 / _mtl_u._CoordTexDim.y)), 0.0, 1.0);
- sampleOnEpipolarLine_3 = ((_mtl_i.xlv_TEXCOORD0.x - (0.5 / _mtl_u._CoordTexDim.x)) * (_mtl_u._CoordTexDim.x / (_mtl_u._CoordTexDim.x - 1.0)));
- float tmpvar_5 = 0;
- tmpvar_5 = clamp (sampleOnEpipolarLine_3, 0.0, 1.0);
- sampleOnEpipolarLine_3 = tmpvar_5;
- int tmpvar_6 = 0;
- tmpvar_6 = int(clamp (floor(
- (tmpvar_4 * 4.0)
- ), 0.0, 3.0));
- float tmpvar_7 = 0;
- tmpvar_7 = (-1.0 + (2.0 * fract(
- (tmpvar_4 * 4.0)
- )));
- float4 tmpvar_8 = 0;
- tmpvar_8.xz = float2(-1.0, 1.0);
- tmpvar_8.y = tmpvar_7;
- tmpvar_8.w = -(tmpvar_7);
- float4 tmpvar_9 = 0;
- tmpvar_9.yw = float2(-1.0, 1.0);
- tmpvar_9.x = -(tmpvar_7);
- tmpvar_9.z = tmpvar_7;
- bool4 tmpvar_10 = false;
- tmpvar_10 = bool4((int4(tmpvar_6) == int4(0, 1, 2, 3)));
- half4 tmpvar_11 = 0;
- tmpvar_11 = half4(tmpvar_10);
- half4 tmpvar_12 = 0;
- tmpvar_12 = half4(tmpvar_10);
- float2 tmpvar_13 = 0;
- tmpvar_13.x = dot (tmpvar_9, (float4)tmpvar_11);
- tmpvar_13.y = dot (tmpvar_8, (float4)tmpvar_12);
- coordTemp_2 = ((mix (_mtl_u._LightPos.xy,
- -(tmpvar_13)
- , float2(tmpvar_5)) * 0.5) + 0.5);
- float4 tmpvar_14 = 0;
- tmpvar_14.zw = float2(0.0, 0.0);
- tmpvar_14.xy = coordTemp_2;
- coordTemp_2 = ((floor(
- (coordTemp_2 * _mtl_u._ScreenTexDim.xy)
- ) + 0.5) * _mtl_u._ScreenTexDim.zw);
- half4 tmpvar_15 = 0;
- tmpvar_15 = _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(coordTemp_2));
- float tmpvar_16 = 0;
- float z_17 = 0;
- z_17 = float(tmpvar_15.x);
- tmpvar_16 = (1.0/(((_mtl_u._ZBufferParams.x * z_17) + _mtl_u._ZBufferParams.y)));
- depth_1 = float4(tmpvar_16);
- float4 v_18 = 0;
- v_18.x = _mtl_u._FrustumRays[0].x;
- v_18.y = _mtl_u._FrustumRays[1].x;
- v_18.z = _mtl_u._FrustumRays[2].x;
- v_18.w = _mtl_u._FrustumRays[3].x;
- float4 v_19 = 0;
- v_19.x = _mtl_u._FrustumRays[0].y;
- v_19.y = _mtl_u._FrustumRays[1].y;
- v_19.z = _mtl_u._FrustumRays[2].y;
- v_19.w = _mtl_u._FrustumRays[3].y;
- float4 v_20 = 0;
- v_20.x = _mtl_u._FrustumRays[0].w;
- v_20.y = _mtl_u._FrustumRays[1].w;
- v_20.z = _mtl_u._FrustumRays[2].w;
- v_20.w = _mtl_u._FrustumRays[3].w;
- float4 v_21 = 0;
- v_21.x = _mtl_u._FrustumRays[0].z;
- v_21.y = _mtl_u._FrustumRays[1].z;
- v_21.z = _mtl_u._FrustumRays[2].z;
- v_21.w = _mtl_u._FrustumRays[3].z;
- float3 tmpvar_22 = 0;
- tmpvar_22 = mix (mix (v_18.xyz, v_19.xyz, tmpvar_14.xxx), mix (v_20.xyz, v_21.xyz, tmpvar_14.xxx), tmpvar_14.yyy);
- float tmpvar_23 = 0;
- tmpvar_23 = sqrt(dot (tmpvar_22, tmpvar_22));
- bool tmpvar_24 = false;
- float3 tmpvar_25 = 0;
- tmpvar_25 = (1.0/((tmpvar_22 / tmpvar_23)));
- float3 tmpvar_26 = 0;
- tmpvar_26 = (tmpvar_25 * (-0.5 - _mtl_u._CameraPosLocal.xyz));
- float3 tmpvar_27 = 0;
- tmpvar_27 = (tmpvar_25 * (0.5 - _mtl_u._CameraPosLocal.xyz));
- float3 tmpvar_28 = 0;
- tmpvar_28 = min (tmpvar_27, tmpvar_26);
- float3 tmpvar_29 = 0;
- tmpvar_29 = max (tmpvar_27, tmpvar_26);
- float2 tmpvar_30 = 0;
- tmpvar_30 = max (tmpvar_28.xx, tmpvar_28.yz);
- float tmpvar_31 = 0;
- tmpvar_31 = max (tmpvar_30.x, tmpvar_30.y);
- float2 tmpvar_32 = 0;
- tmpvar_32 = min (tmpvar_29.xx, tmpvar_29.yz);
- float tmpvar_33 = 0;
- tmpvar_33 = min (tmpvar_32.x, tmpvar_32.y);
- tmpvar_24 = bool(((tmpvar_31 < tmpvar_33) && (tmpvar_33 > 0.0)));
- if (((bool)(!(tmpvar_24)) || (tmpvar_16 < (tmpvar_31 / tmpvar_23)))) {
- depth_1 = -(float4(tmpvar_16));
- } else {
- depth_1 = min (depth_1, float4((tmpvar_33 / tmpvar_23)));
- };
- _mtl_o._glesFragData_0 = half4(tmpvar_14);
- _mtl_o._glesFragData_1 = half4(depth_1);
- return _mtl_o;
-}
-
-
-// stats: 65 alu 1 tex 1 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// uniforms: 6 (total size: 144)
-// #0: _ZBufferParams (high float) 4x1 [-1] loc 0
-// #1: _LightPos (high float) 4x1 [-1] loc 16
-// #2: _FrustumRays (high float) 4x4 [-1] loc 32
-// #3: _CameraPosLocal (high float) 4x1 [-1] loc 96
-// #4: _CoordTexDim (high float) 4x1 [-1] loc 112
-// #5: _ScreenTexDim (high float) 4x1 [-1] loc 128
-// textures: 1
-// #0: _CameraDepthTexture (low 2d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-in.txt
deleted file mode 100644
index 16755a7bfd2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-in.txt
+++ /dev/null
@@ -1,111 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec3 vlight;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- float atten = 1.00000;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- c = LightingBlinnPhong( o, IN.lightDir, normalize( vec3( IN.viewDir) ), atten);
- c.xyz += (o.Albedo * IN.vlight);
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN.vlight = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt
deleted file mode 100644
index d8af75b617c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-inES3.txt
+++ /dev/null
@@ -1,118 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec3 vlight;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform mediump vec4 _Color;
-uniform mediump vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform mediump vec4 _SpecColor;
-
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-
-mediump vec4 UnpackNormal( in mediump vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- float atten = 1.00000;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- c = LightingBlinnPhong( o, IN.lightDir, normalize( vec3( IN.viewDir) ), atten);
- c.xyz += (o.Albedo * IN.vlight);
- c.w = o.Alpha;
- return c;
-}
-in vec4 xlv_FOG;
-in highp vec4 _uv0;
-in mediump vec3 _uv1;
-in mediump vec3 _uv2;
-in mediump vec3 _uv3;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = _uv0;
- xlt_IN.viewDir = _uv1;
- xlt_IN.lightDir = _uv2;
- xlt_IN.vlight = _uv3;
- xl_retval = frag_surf( xlt_IN);
- _fragData = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-out.txt
deleted file mode 100644
index 2c87a23e8e4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-out.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[2].xyz;
- vec4 c_3;
- vec3 tmpvar_4;
- float tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6 = texture2D (_MainTex, tmpvar_1.xy);
- tmpvar_4 = (tmpvar_6.xyz * _Color.xyz);
- tmpvar_5 = (tmpvar_6.w * _Color.w);
- vec4 normal_7;
- normal_7.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_7.z = sqrt(((1.0 -
- (normal_7.x * normal_7.x)
- ) - (normal_7.y * normal_7.y)));
- vec4 c_8;
- float spec_9;
- spec_9 = (pow (max (0.0,
- dot (normal_7.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[1].xyz))))
- ), (_Shininess * 128.0)) * tmpvar_6.w);
- c_8.xyz = (((
- (tmpvar_4 * _LightColor0.xyz)
- *
- max (0.0, dot (normal_7.xyz, tmpvar_2))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_9)) * 2.0);
- c_8.w = (tmpvar_5 + ((_LightColor0.w * _SpecColor.w) * spec_9));
- c_3.xyz = (c_8.xyz + (tmpvar_4 * gl_TexCoord[3].xyz));
- c_3.w = tmpvar_5;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 30 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Shininess (high float) 1x1 [-1]
-// #3: _SpecColor (high float) 4x1 [-1]
-// textures: 2
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt
deleted file mode 100644
index 47da6025b7d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-uniform sampler2D _BumpMap;
-uniform mediump vec4 _Color;
-uniform mediump vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform highp float _Shininess;
-uniform mediump vec4 _SpecColor;
-in highp vec4 _uv0;
-in mediump vec3 _uv1;
-in mediump vec3 _uv2;
-in mediump vec3 _uv3;
-void main ()
-{
- mediump vec4 c_1;
- mediump vec3 tmpvar_2;
- mediump float tmpvar_3;
- lowp vec4 tmpvar_4;
- tmpvar_4 = texture (_MainTex, _uv0.xy);
- tmpvar_2 = (tmpvar_4.xyz * _Color.xyz);
- tmpvar_3 = (tmpvar_4.w * _Color.w);
- lowp vec4 tmpvar_5;
- tmpvar_5 = texture (_BumpMap, _uv0.zw);
- mediump vec4 packednormal_6;
- packednormal_6 = tmpvar_5;
- mediump vec4 normal_7;
- normal_7.xy = ((packednormal_6.wy * 2.0) - 1.0);
- normal_7.z = sqrt(((1.0 -
- (normal_7.x * normal_7.x)
- ) - (normal_7.y * normal_7.y)));
- mediump vec4 c_8;
- lowp float spec_9;
- mediump float tmpvar_10;
- tmpvar_10 = pow (max (0.0, dot (normal_7.xyz,
- normalize((_uv2 + normalize(_uv1)))
- )), (_Shininess * 128.0));
- spec_9 = (tmpvar_10 * tmpvar_4.w);
- c_8.xyz = (((
- (tmpvar_2 * _LightColor0.xyz)
- *
- max (0.0, dot (normal_7.xyz, _uv2))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_9)) * 2.0);
- c_8.w = (tmpvar_3 + ((_LightColor0.w * _SpecColor.w) * spec_9));
- c_1.xyz = (c_8.xyz + (tmpvar_2 * _uv3));
- c_1.w = tmpvar_3;
- lowp vec4 tmpvar_11;
- tmpvar_11 = c_1;
- _fragData = tmpvar_11;
-}
-
-
-// stats: 30 alu 2 tex 0 flow
-// inputs: 4
-// #0: _uv0 (high float) 4x1 [-1]
-// #1: _uv1 (medium float) 3x1 [-1]
-// #2: _uv2 (medium float) 3x1 [-1]
-// #3: _uv3 (medium float) 3x1 [-1]
-// uniforms: 4 (total size: 0)
-// #0: _Color (medium float) 4x1 [-1]
-// #1: _LightColor0 (medium float) 4x1 [-1]
-// #2: _Shininess (high float) 1x1 [-1]
-// #3: _SpecColor (medium float) 4x1 [-1]
-// textures: 2
-// #0: _BumpMap (low 2d) 0x0 [-1]
-// #1: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt
deleted file mode 100644
index bc86b01a1dc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-alphabumpspec-outES3Metal.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 _uv0;
- half3 _uv1;
- half3 _uv2;
- half3 _uv3;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- half4 _Color;
- half4 _LightColor0;
- float _Shininess;
- half4 _SpecColor;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _BumpMap [[texture(0)]], sampler _mtlsmp__BumpMap [[sampler(0)]]
- , texture2d<half> _MainTex [[texture(1)]], sampler _mtlsmp__MainTex [[sampler(1)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- half3 tmpvar_2 = 0;
- half tmpvar_3 = 0;
- half4 tmpvar_4 = 0;
- tmpvar_4 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i._uv0.xy));
- tmpvar_2 = (tmpvar_4.xyz * _mtl_u._Color.xyz);
- tmpvar_3 = (tmpvar_4.w * _mtl_u._Color.w);
- half4 tmpvar_5 = 0;
- tmpvar_5 = _BumpMap.sample(_mtlsmp__BumpMap, (float2)(_mtl_i._uv0.zw));
- half4 packednormal_6 = 0;
- packednormal_6 = tmpvar_5;
- half4 normal_7 = 0;
- normal_7.xy = ((packednormal_6.wy * (half)(2.0)) - (half)(1.0));
- normal_7.z = sqrt((((half)(1.0) -
- (normal_7.x * normal_7.x)
- ) - (normal_7.y * normal_7.y)));
- half4 c_8 = 0;
- half spec_9 = 0;
- half tmpvar_10 = 0;
- float y_11 = 0;
- y_11 = (_mtl_u._Shininess * 128.0);
- tmpvar_10 = ((half)pow ((float)max ((half)0.0, dot (normal_7.xyz,
- normalize((_mtl_i._uv2 + normalize(_mtl_i._uv1)))
- )), y_11));
- spec_9 = (tmpvar_10 * tmpvar_4.w);
- c_8.xyz = (((
- (tmpvar_2 * _mtl_u._LightColor0.xyz)
- *
- max ((half)0.0, dot (normal_7.xyz, _mtl_i._uv2))
- ) + (
- (_mtl_u._LightColor0.xyz * _mtl_u._SpecColor.xyz)
- * spec_9)) * (half)(2.0));
- c_8.w = (tmpvar_3 + ((_mtl_u._LightColor0.w * _mtl_u._SpecColor.w) * spec_9));
- c_1.xyz = (c_8.xyz + (tmpvar_2 * _mtl_i._uv3));
- c_1.w = tmpvar_3;
- half4 tmpvar_12 = 0;
- tmpvar_12 = c_1;
- _mtl_o._fragData = tmpvar_12;
- return _mtl_o;
-}
-
-
-// stats: 30 alu 2 tex 0 flow
-// inputs: 4
-// #0: _uv0 (high float) 4x1 [-1]
-// #1: _uv1 (medium float) 3x1 [-1]
-// #2: _uv2 (medium float) 3x1 [-1]
-// #3: _uv3 (medium float) 3x1 [-1]
-// uniforms: 4 (total size: 32)
-// #0: _Color (medium float) 4x1 [-1] loc 0
-// #1: _LightColor0 (medium float) 4x1 [-1] loc 8
-// #2: _Shininess (high float) 1x1 [-1] loc 16
-// #3: _SpecColor (medium float) 4x1 [-1] loc 24
-// textures: 2
-// #0: _BumpMap (low 2d) 0x0 [-1] loc 0
-// #1: _MainTex (low 2d) 0x0 [-1] loc 1
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-in.txt
deleted file mode 100644
index e45ab823c27..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-in.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec3 ray;
-};
-uniform sampler2D _CameraDepthTexture;
-uniform vec4 _LightShadowData;
-uniform vec4 _LightSplitsFar;
-uniform vec4 _LightSplitsNear;
-uniform sampler2D _ShadowMapTexture;
-uniform mat4 _View2Shadow;
-uniform mat4 _View2Shadow1;
-uniform mat4 _View2Shadow2;
-uniform mat4 _View2Shadow3;
-uniform vec4 _ZBufferParams;
-float unitySampleShadow( in vec4 eyePos );
-float Linear01Depth( in float z );
-vec2 EncodeFloatRG( in float v );
-vec4 xlat_main( in v2f i );
-float unitySampleShadow( in vec4 eyePos ) {
- vec3 sc0;
- vec3 sc1;
- vec3 sc2;
- vec3 sc3;
- float z;
- vec4 near;
- vec4 far;
- vec4 weights;
- vec4 coord;
- float shadow;
- sc0 = ( _View2Shadow * eyePos ).xyz ;
- sc1 = ( _View2Shadow1 * eyePos ).xyz ;
- sc2 = ( _View2Shadow2 * eyePos ).xyz ;
- sc3 = ( _View2Shadow3 * eyePos ).xyz ;
- z = eyePos.z ;
- near = vec4( greaterThanEqual( vec4( z ), _LightSplitsNear) );
- far = vec4( lessThan( vec4( z ), _LightSplitsFar) );
- weights = (near * far);
- coord = vec4( ((((sc0 * weights.x ) + (sc1 * weights.y )) + (sc2 * weights.z )) + (sc3 * weights.w )), 1.00000);
- shadow = ( (texture2D( _ShadowMapTexture, coord.xy ).x < coord.z ) ) ? ( _LightShadowData.x ) : ( 1.00000 );
- return shadow;
-}
-float Linear01Depth( in float z ) {
- return (1.00000 / ((_ZBufferParams.x * z) + _ZBufferParams.y ));
-}
-vec2 EncodeFloatRG( in float v ) {
- vec2 kEncodeMul = vec2( 1.00000, 255.000);
- float kEncodeBit = 0.00392157;
- vec2 enc;
- enc = (kEncodeMul * v);
- enc = fract( enc );
- enc.x -= (enc.y * kEncodeBit);
- return enc;
-}
-vec4 xlat_main( in v2f i ) {
- float depth;
- vec4 vpos;
- float shadow;
- vec4 res;
- depth = texture2D( _CameraDepthTexture, i.uv).x ;
- depth = Linear01Depth( depth);
- vpos = vec4( (i.ray * depth), 1.00000);
- shadow = unitySampleShadow( vpos);
- res.x = shadow;
- res.y = 1.00000;
- res.zw = EncodeFloatRG( (1.00000 - depth));
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xlt_i.ray = vec3( gl_TexCoord[1]);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES.txt
deleted file mode 100644
index 0414adb185b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-struct v2f {
- highp vec4 pos;
- highp vec2 uv;
- highp vec3 ray;
-};
-uniform sampler2D _CameraDepthTexture;
-uniform highp vec4 _LightShadowData;
-uniform highp vec4 _LightSplitsFar;
-uniform highp vec4 _LightSplitsNear;
-uniform sampler2D _ShadowMapTexture;
-uniform highp mat4 _View2Shadow;
-uniform highp mat4 _View2Shadow1;
-uniform highp mat4 _View2Shadow2;
-uniform highp mat4 _View2Shadow3;
-uniform highp vec4 _ZBufferParams;
-mediump float unitySampleShadow( in highp vec4 eyePos );
-highp float Linear01Depth( in highp float z );
-highp vec2 EncodeFloatRG( in highp float v );
-mediump vec4 xlat_main( in v2f i );
-mediump float unitySampleShadow( in highp vec4 eyePos ) {
- highp vec3 sc0;
- highp vec3 sc1;
- highp vec3 sc2;
- highp vec3 sc3;
- highp float z;
- highp vec4 near;
- highp vec4 far;
- highp vec4 weights;
- highp vec4 coord;
- mediump float shadow;
- sc0 = ( _View2Shadow * eyePos ).xyz ;
- sc1 = ( _View2Shadow1 * eyePos ).xyz ;
- sc2 = ( _View2Shadow2 * eyePos ).xyz ;
- sc3 = ( _View2Shadow3 * eyePos ).xyz ;
- z = eyePos.z ;
- near = vec4( greaterThanEqual( vec4( z ), _LightSplitsNear) );
- far = vec4( lessThan( vec4( z ), _LightSplitsFar) );
- weights = (near * far);
- coord = vec4( ((((sc0 * weights.x ) + (sc1 * weights.y )) + (sc2 * weights.z )) + (sc3 * weights.w )), 1.00000);
- shadow = ( (texture2D( _ShadowMapTexture, coord.xy ).x < coord.z ) ) ? ( _LightShadowData.x ) : ( 1.00000 );
- return shadow;
-}
-highp float Linear01Depth( in highp float z ) {
- return (1.00000 / ((_ZBufferParams.x * z) + _ZBufferParams.y ));
-}
-highp vec2 EncodeFloatRG( in highp float v ) {
- highp vec2 kEncodeMul = vec2( 1.00000, 255.000);
- highp float kEncodeBit = 0.00392157;
- highp vec2 enc;
- enc = (kEncodeMul * v);
- enc = fract( enc );
- enc.x -= (enc.y * kEncodeBit);
- return enc;
-}
-mediump vec4 xlat_main( in v2f i ) {
- highp float depth;
- highp vec4 vpos;
- mediump float shadow;
- highp vec4 res;
- depth = texture2D( _CameraDepthTexture, i.uv).x ;
- depth = Linear01Depth( depth);
- vpos = vec4( (i.ray * depth), 1.00000);
- shadow = unitySampleShadow( vpos);
- res.x = shadow;
- res.y = 1.00000;
- res.zw = EncodeFloatRG( (1.00000 - depth));
- return res;
-}
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec3 xlv_TEXCOORD1;
-void main() {
- mediump vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( xlv_TEXCOORD0);
- xlt_i.ray = vec3( xlv_TEXCOORD1);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt
deleted file mode 100644
index 86e532d7b87..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-inES3.txt
+++ /dev/null
@@ -1,81 +0,0 @@
-#version 300 es
-struct v2f {
- highp vec4 pos;
- highp vec2 uv;
- highp vec3 ray;
-};
-uniform sampler2D _CameraDepthTexture;
-uniform highp vec4 _LightShadowData;
-uniform highp vec4 _LightSplitsFar;
-uniform highp vec4 _LightSplitsNear;
-uniform sampler2D _ShadowMapTexture;
-uniform highp mat4 _View2Shadow;
-uniform highp mat4 _View2Shadow1;
-uniform highp mat4 _View2Shadow2;
-uniform highp mat4 _View2Shadow3;
-uniform highp vec4 _ZBufferParams;
-mediump float unitySampleShadow( in highp vec4 eyePos );
-highp float Linear01Depth( in highp float z );
-highp vec2 EncodeFloatRG( in highp float v );
-mediump vec4 xlat_main( in v2f i );
-mediump float unitySampleShadow( in highp vec4 eyePos ) {
- highp vec3 sc0;
- highp vec3 sc1;
- highp vec3 sc2;
- highp vec3 sc3;
- highp float z;
- highp vec4 near;
- highp vec4 far;
- highp vec4 weights;
- highp vec4 coord;
- mediump float shadow;
- sc0 = ( _View2Shadow * eyePos ).xyz ;
- sc1 = ( _View2Shadow1 * eyePos ).xyz ;
- sc2 = ( _View2Shadow2 * eyePos ).xyz ;
- sc3 = ( _View2Shadow3 * eyePos ).xyz ;
- z = eyePos.z ;
- near = vec4( greaterThanEqual( vec4( z ), _LightSplitsNear) );
- far = vec4( lessThan( vec4( z ), _LightSplitsFar) );
- weights = (near * far);
- coord = vec4( ((((sc0 * weights.x ) + (sc1 * weights.y )) + (sc2 * weights.z )) + (sc3 * weights.w )), 1.00000);
- shadow = ( (texture( _ShadowMapTexture, coord.xy ).x < coord.z ) ) ? ( _LightShadowData.x ) : ( 1.00000 );
- return shadow;
-}
-highp float Linear01Depth( in highp float z ) {
- return (1.00000 / ((_ZBufferParams.x * z) + _ZBufferParams.y ));
-}
-highp vec2 EncodeFloatRG( in highp float v ) {
- highp vec2 kEncodeMul = vec2( 1.00000, 255.000);
- highp float kEncodeBit = 0.00392157;
- highp vec2 enc;
- enc = (kEncodeMul * v);
- enc = fract( enc );
- enc.x -= (enc.y * kEncodeBit);
- return enc;
-}
-mediump vec4 xlat_main( in v2f i ) {
- highp float depth;
- highp vec4 vpos;
- mediump float shadow;
- highp vec4 res;
- depth = texture( _CameraDepthTexture, i.uv).x ;
- depth = Linear01Depth( depth);
- vpos = vec4( (i.ray * depth), 1.00000);
- shadow = unitySampleShadow( vpos);
- res.x = shadow;
- res.y = 1.00000;
- res.zw = EncodeFloatRG( (1.00000 - depth));
- return res;
-}
-in highp vec2 xlv_TEXCOORD0;
-in highp vec3 xlv_TEXCOORD1;
-out mediump vec4 _fragData;
-void main() {
- mediump vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( xlv_TEXCOORD0);
- xlt_i.ray = vec3( xlv_TEXCOORD1);
- xl_retval = xlat_main( xlt_i);
- _fragData = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-out.txt
deleted file mode 100644
index 4838ce8ff18..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-out.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-uniform sampler2D _CameraDepthTexture;
-uniform vec4 _LightShadowData;
-uniform vec4 _LightSplitsFar;
-uniform vec4 _LightSplitsNear;
-uniform sampler2D _ShadowMapTexture;
-uniform mat4 _View2Shadow;
-uniform mat4 _View2Shadow1;
-uniform mat4 _View2Shadow2;
-uniform mat4 _View2Shadow3;
-uniform vec4 _ZBufferParams;
-void main ()
-{
- vec4 res_1;
- float tmpvar_2;
- tmpvar_2 = (1.0/(((_ZBufferParams.x * texture2D (_CameraDepthTexture, gl_TexCoord[0].xy).x) + _ZBufferParams.y)));
- vec4 tmpvar_3;
- tmpvar_3.w = 1.0;
- tmpvar_3.xyz = (gl_TexCoord[1].xyz * tmpvar_2);
- vec4 weights_4;
- weights_4 = (vec4(greaterThanEqual (tmpvar_3.zzzz, _LightSplitsNear)) * vec4(lessThan (tmpvar_3.zzzz, _LightSplitsFar)));
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = (((
- ((_View2Shadow * tmpvar_3).xyz * weights_4.x)
- +
- ((_View2Shadow1 * tmpvar_3).xyz * weights_4.y)
- ) + (
- (_View2Shadow2 * tmpvar_3)
- .xyz * weights_4.z)) + ((_View2Shadow3 * tmpvar_3).xyz * weights_4.w));
- vec4 tmpvar_6;
- tmpvar_6 = texture2D (_ShadowMapTexture, tmpvar_5.xy);
- float tmpvar_7;
- if ((tmpvar_6.x < tmpvar_5.z)) {
- tmpvar_7 = _LightShadowData.x;
- } else {
- tmpvar_7 = 1.0;
- };
- res_1.x = tmpvar_7;
- res_1.y = 1.0;
- vec2 enc_8;
- enc_8 = (vec2(1.0, 255.0) * (1.0 - tmpvar_2));
- vec2 tmpvar_9;
- tmpvar_9 = fract(enc_8);
- enc_8.y = tmpvar_9.y;
- enc_8.x = (tmpvar_9.x - (tmpvar_9.y * 0.00392157));
- res_1.zw = enc_8;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 30 alu 2 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 8 (total size: 0)
-// #0: _LightShadowData (high float) 4x1 [-1]
-// #1: _LightSplitsFar (high float) 4x1 [-1]
-// #2: _LightSplitsNear (high float) 4x1 [-1]
-// #3: _View2Shadow (high float) 4x4 [-1]
-// #4: _View2Shadow1 (high float) 4x4 [-1]
-// #5: _View2Shadow2 (high float) 4x4 [-1]
-// #6: _View2Shadow3 (high float) 4x4 [-1]
-// #7: _ZBufferParams (high float) 4x1 [-1]
-// textures: 2
-// #0: _CameraDepthTexture (high 2d) 0x0 [-1]
-// #1: _ShadowMapTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES.txt
deleted file mode 100644
index 17c99495112..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-uniform sampler2D _CameraDepthTexture;
-uniform highp vec4 _LightShadowData;
-uniform highp vec4 _LightSplitsFar;
-uniform highp vec4 _LightSplitsNear;
-uniform sampler2D _ShadowMapTexture;
-uniform highp mat4 _View2Shadow;
-uniform highp mat4 _View2Shadow1;
-uniform highp mat4 _View2Shadow2;
-uniform highp mat4 _View2Shadow3;
-uniform highp vec4 _ZBufferParams;
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec3 xlv_TEXCOORD1;
-void main ()
-{
- mediump vec4 tmpvar_1;
- highp vec4 res_2;
- highp float depth_3;
- lowp vec4 tmpvar_4;
- tmpvar_4 = texture2D (_CameraDepthTexture, xlv_TEXCOORD0);
- depth_3 = tmpvar_4.x;
- highp float tmpvar_5;
- tmpvar_5 = (1.0/(((_ZBufferParams.x * depth_3) + _ZBufferParams.y)));
- depth_3 = tmpvar_5;
- highp vec4 tmpvar_6;
- tmpvar_6.w = 1.0;
- tmpvar_6.xyz = (xlv_TEXCOORD1 * tmpvar_5);
- mediump float shadow_7;
- highp vec4 weights_8;
- highp vec4 far_9;
- highp vec4 near_10;
- bvec4 tmpvar_11;
- tmpvar_11 = greaterThanEqual (tmpvar_6.zzzz, _LightSplitsNear);
- lowp vec4 tmpvar_12;
- tmpvar_12 = vec4(tmpvar_11);
- near_10 = tmpvar_12;
- bvec4 tmpvar_13;
- tmpvar_13 = lessThan (tmpvar_6.zzzz, _LightSplitsFar);
- lowp vec4 tmpvar_14;
- tmpvar_14 = vec4(tmpvar_13);
- far_9 = tmpvar_14;
- weights_8 = (near_10 * far_9);
- highp vec4 tmpvar_15;
- tmpvar_15.w = 1.0;
- tmpvar_15.xyz = (((
- ((_View2Shadow * tmpvar_6).xyz * weights_8.x)
- +
- ((_View2Shadow1 * tmpvar_6).xyz * weights_8.y)
- ) + (
- (_View2Shadow2 * tmpvar_6)
- .xyz * weights_8.z)) + ((_View2Shadow3 * tmpvar_6).xyz * weights_8.w));
- lowp vec4 tmpvar_16;
- tmpvar_16 = texture2D (_ShadowMapTexture, tmpvar_15.xy);
- highp float tmpvar_17;
- if ((tmpvar_16.x < tmpvar_15.z)) {
- tmpvar_17 = _LightShadowData.x;
- } else {
- tmpvar_17 = 1.0;
- };
- shadow_7 = tmpvar_17;
- res_2.x = shadow_7;
- res_2.y = 1.0;
- highp vec2 enc_18;
- enc_18 = (vec2(1.0, 255.0) * (1.0 - tmpvar_5));
- highp vec2 tmpvar_19;
- tmpvar_19 = fract(enc_18);
- enc_18.y = tmpvar_19.y;
- enc_18.x = (tmpvar_19.x - (tmpvar_19.y * 0.00392157));
- res_2.zw = enc_18;
- tmpvar_1 = res_2;
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 30 alu 2 tex 1 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 3x1 [-1]
-// uniforms: 8 (total size: 0)
-// #0: _LightShadowData (high float) 4x1 [-1]
-// #1: _LightSplitsFar (high float) 4x1 [-1]
-// #2: _LightSplitsNear (high float) 4x1 [-1]
-// #3: _View2Shadow (high float) 4x4 [-1]
-// #4: _View2Shadow1 (high float) 4x4 [-1]
-// #5: _View2Shadow2 (high float) 4x4 [-1]
-// #6: _View2Shadow3 (high float) 4x4 [-1]
-// #7: _ZBufferParams (high float) 4x1 [-1]
-// textures: 2
-// #0: _CameraDepthTexture (low 2d) 0x0 [-1]
-// #1: _ShadowMapTexture (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3.txt
deleted file mode 100644
index 46be5e4c896..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3.txt
+++ /dev/null
@@ -1,91 +0,0 @@
-#version 300 es
-uniform sampler2D _CameraDepthTexture;
-uniform highp vec4 _LightShadowData;
-uniform highp vec4 _LightSplitsFar;
-uniform highp vec4 _LightSplitsNear;
-uniform sampler2D _ShadowMapTexture;
-uniform highp mat4 _View2Shadow;
-uniform highp mat4 _View2Shadow1;
-uniform highp mat4 _View2Shadow2;
-uniform highp mat4 _View2Shadow3;
-uniform highp vec4 _ZBufferParams;
-in highp vec2 xlv_TEXCOORD0;
-in highp vec3 xlv_TEXCOORD1;
-out mediump vec4 _fragData;
-void main ()
-{
- mediump vec4 tmpvar_1;
- highp vec4 res_2;
- highp float depth_3;
- lowp vec4 tmpvar_4;
- tmpvar_4 = texture (_CameraDepthTexture, xlv_TEXCOORD0);
- depth_3 = tmpvar_4.x;
- highp float tmpvar_5;
- tmpvar_5 = (1.0/(((_ZBufferParams.x * depth_3) + _ZBufferParams.y)));
- depth_3 = tmpvar_5;
- highp vec4 tmpvar_6;
- tmpvar_6.w = 1.0;
- tmpvar_6.xyz = (xlv_TEXCOORD1 * tmpvar_5);
- mediump float shadow_7;
- highp vec4 weights_8;
- highp vec4 far_9;
- highp vec4 near_10;
- bvec4 tmpvar_11;
- tmpvar_11 = greaterThanEqual (tmpvar_6.zzzz, _LightSplitsNear);
- lowp vec4 tmpvar_12;
- tmpvar_12 = vec4(tmpvar_11);
- near_10 = tmpvar_12;
- bvec4 tmpvar_13;
- tmpvar_13 = lessThan (tmpvar_6.zzzz, _LightSplitsFar);
- lowp vec4 tmpvar_14;
- tmpvar_14 = vec4(tmpvar_13);
- far_9 = tmpvar_14;
- weights_8 = (near_10 * far_9);
- highp vec4 tmpvar_15;
- tmpvar_15.w = 1.0;
- tmpvar_15.xyz = (((
- ((_View2Shadow * tmpvar_6).xyz * weights_8.x)
- +
- ((_View2Shadow1 * tmpvar_6).xyz * weights_8.y)
- ) + (
- (_View2Shadow2 * tmpvar_6)
- .xyz * weights_8.z)) + ((_View2Shadow3 * tmpvar_6).xyz * weights_8.w));
- lowp vec4 tmpvar_16;
- tmpvar_16 = texture (_ShadowMapTexture, tmpvar_15.xy);
- highp float tmpvar_17;
- if ((tmpvar_16.x < tmpvar_15.z)) {
- tmpvar_17 = _LightShadowData.x;
- } else {
- tmpvar_17 = 1.0;
- };
- shadow_7 = tmpvar_17;
- res_2.x = shadow_7;
- res_2.y = 1.0;
- highp vec2 enc_18;
- enc_18 = (vec2(1.0, 255.0) * (1.0 - tmpvar_5));
- highp vec2 tmpvar_19;
- tmpvar_19 = fract(enc_18);
- enc_18.y = tmpvar_19.y;
- enc_18.x = (tmpvar_19.x - (tmpvar_19.y * 0.00392157));
- res_2.zw = enc_18;
- tmpvar_1 = res_2;
- _fragData = tmpvar_1;
-}
-
-
-// stats: 30 alu 2 tex 1 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 3x1 [-1]
-// uniforms: 8 (total size: 0)
-// #0: _LightShadowData (high float) 4x1 [-1]
-// #1: _LightSplitsFar (high float) 4x1 [-1]
-// #2: _LightSplitsNear (high float) 4x1 [-1]
-// #3: _View2Shadow (high float) 4x4 [-1]
-// #4: _View2Shadow1 (high float) 4x4 [-1]
-// #5: _View2Shadow2 (high float) 4x4 [-1]
-// #6: _View2Shadow3 (high float) 4x4 [-1]
-// #7: _ZBufferParams (high float) 4x1 [-1]
-// textures: 2
-// #0: _CameraDepthTexture (low 2d) 0x0 [-1]
-// #1: _ShadowMapTexture (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3Metal.txt
deleted file mode 100644
index 66162e907d6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-collectshadows-outES3Metal.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float2 xlv_TEXCOORD0;
- float3 xlv_TEXCOORD1;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- float4 _LightShadowData;
- float4 _LightSplitsFar;
- float4 _LightSplitsNear;
- float4x4 _View2Shadow;
- float4x4 _View2Shadow1;
- float4x4 _View2Shadow2;
- float4x4 _View2Shadow3;
- float4 _ZBufferParams;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _CameraDepthTexture [[texture(0)]], sampler _mtlsmp__CameraDepthTexture [[sampler(0)]]
- , texture2d<half> _ShadowMapTexture [[texture(1)]], sampler _mtlsmp__ShadowMapTexture [[sampler(1)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 tmpvar_1 = 0;
- float4 res_2 = 0;
- float depth_3 = 0;
- half4 tmpvar_4 = 0;
- tmpvar_4 = _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(_mtl_i.xlv_TEXCOORD0));
- depth_3 = float(tmpvar_4.x);
- float tmpvar_5 = 0;
- tmpvar_5 = (1.0/(((_mtl_u._ZBufferParams.x * depth_3) + _mtl_u._ZBufferParams.y)));
- depth_3 = tmpvar_5;
- float4 tmpvar_6 = 0;
- tmpvar_6.w = 1.0;
- tmpvar_6.xyz = (_mtl_i.xlv_TEXCOORD1 * tmpvar_5);
- half shadow_7 = 0;
- float4 weights_8 = 0;
- float4 far_9 = 0;
- float4 near_10 = 0;
- bool4 tmpvar_11 = false;
- tmpvar_11 = bool4((tmpvar_6.zzzz >= _mtl_u._LightSplitsNear));
- half4 tmpvar_12 = 0;
- tmpvar_12 = half4(tmpvar_11);
- near_10 = float4(tmpvar_12);
- bool4 tmpvar_13 = false;
- tmpvar_13 = bool4((tmpvar_6.zzzz < _mtl_u._LightSplitsFar));
- half4 tmpvar_14 = 0;
- tmpvar_14 = half4(tmpvar_13);
- far_9 = float4(tmpvar_14);
- weights_8 = (near_10 * far_9);
- float4 tmpvar_15 = 0;
- tmpvar_15.w = 1.0;
- tmpvar_15.xyz = (((
- ((_mtl_u._View2Shadow * tmpvar_6).xyz * weights_8.x)
- +
- ((_mtl_u._View2Shadow1 * tmpvar_6).xyz * weights_8.y)
- ) + (
- (_mtl_u._View2Shadow2 * tmpvar_6)
- .xyz * weights_8.z)) + ((_mtl_u._View2Shadow3 * tmpvar_6).xyz * weights_8.w));
- half4 tmpvar_16 = 0;
- tmpvar_16 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float2)(tmpvar_15.xy));
- float tmpvar_17 = 0;
- if (((float)(tmpvar_16.x) < tmpvar_15.z)) {
- tmpvar_17 = _mtl_u._LightShadowData.x;
- } else {
- tmpvar_17 = 1.0;
- };
- shadow_7 = half(tmpvar_17);
- res_2.x = float(shadow_7);
- res_2.y = 1.0;
- float2 enc_18 = 0;
- enc_18 = (float2(1.0, 255.0) * (1.0 - tmpvar_5));
- float2 tmpvar_19 = 0;
- tmpvar_19 = fract(enc_18);
- enc_18.y = tmpvar_19.y;
- enc_18.x = (tmpvar_19.x - (tmpvar_19.y * 0.00392157));
- res_2.zw = enc_18;
- tmpvar_1 = half4(res_2);
- _mtl_o._fragData = tmpvar_1;
- return _mtl_o;
-}
-
-
-// stats: 30 alu 2 tex 1 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 3x1 [-1]
-// uniforms: 8 (total size: 320)
-// #0: _LightShadowData (high float) 4x1 [-1] loc 0
-// #1: _LightSplitsFar (high float) 4x1 [-1] loc 16
-// #2: _LightSplitsNear (high float) 4x1 [-1] loc 32
-// #3: _View2Shadow (high float) 4x4 [-1] loc 48
-// #4: _View2Shadow1 (high float) 4x4 [-1] loc 112
-// #5: _View2Shadow2 (high float) 4x4 [-1] loc 176
-// #6: _View2Shadow3 (high float) 4x4 [-1] loc 240
-// #7: _ZBufferParams (high float) 4x1 [-1] loc 304
-// textures: 2
-// #0: _CameraDepthTexture (low 2d) 0x0 [-1] loc 0
-// #1: _ShadowMapTexture (low 2d) 0x0 [-1] loc 1
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-in.txt
deleted file mode 100644
index 0791a597a3a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-in.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-uniform sampler2D _FlareTexture;
-vec4 xlat_main( in vec4 color, in vec2 texcoord );
-vec4 xlat_main( in vec4 color, in vec2 texcoord ) {
- return (texture2D( _FlareTexture, texcoord) * color);
-}
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( vec4(gl_Color), vec2(gl_TexCoord[0]));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-inES.txt
deleted file mode 100644
index 44e39e73f2c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-inES.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-uniform sampler2D _FlareTexture;
-lowp vec4 xlat_main( in lowp vec4 color, in highp vec2 texcoord ) {
- return (texture2D( _FlareTexture, texcoord) * color);
-}
-varying lowp vec4 xlv_COLOR;
-varying highp vec2 xlv_TEXCOORD0;
-void main() {
- lowp vec4 xl_retval;
- xl_retval = xlat_main( vec4(xlv_COLOR), vec2(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-out.txt
deleted file mode 100644
index 7e8e2e5f293..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-out.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-uniform sampler2D _FlareTexture;
-void main ()
-{
- gl_FragData[0] = (texture2D (_FlareTexture, gl_TexCoord[0].xy) * gl_Color);
-}
-
-
-// stats: 1 alu 1 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _FlareTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-outES.txt
deleted file mode 100644
index c6de169ce9c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-flare-outES.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-uniform sampler2D _FlareTexture;
-varying lowp vec4 xlv_COLOR;
-varying highp vec2 xlv_TEXCOORD0;
-void main ()
-{
- lowp vec4 tmpvar_1;
- tmpvar_1 = (texture2D (_FlareTexture, xlv_TEXCOORD0) * xlv_COLOR);
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 1 alu 1 tex 0 flow
-// inputs: 2
-// #0: xlv_COLOR (low float) 4x1 [-1]
-// #1: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// textures: 1
-// #0: _FlareTexture (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-in.txt
deleted file mode 100644
index 4a81caf9ca4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-in.txt
+++ /dev/null
@@ -1,188 +0,0 @@
-#extension GL_ARB_shader_texture_lod : require
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return texture2DLod( s, coord.xy, coord.w);
-}
-vec4 xll_tex2Dgrad(sampler2D s, vec2 coord, vec2 ddx, vec2 ddy) {
- return texture2DGradARB( s, coord, ddx, ddy);
-}
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_TexelSize;
-vec4 FxaaTexOff( in sampler2D tex, in vec2 pos, in vec2 off, in vec2 rcpFrame );
-vec4 FxaaTexLod0( in sampler2D tex, in vec2 pos );
-vec4 FxaaTexGrad( in sampler2D tex, in vec2 pos, in vec2 grad );
-float FxaaLuma( in vec3 rgb );
-vec3 FxaaLerp3( in vec3 a, in vec3 b, in float amountOfA );
-vec3 FxaaFilterReturn( in vec3 rgb );
-vec3 FxaaPixelShader( in vec2 pos, in sampler2D tex, in vec2 rcpFrame );
-vec4 xlat_main( in vec2 uv );
-vec4 FxaaTexOff( in sampler2D tex, in vec2 pos, in vec2 off, in vec2 rcpFrame ) {
- return xll_tex2Dlod( tex, vec4( (pos.xy + (off * rcpFrame)), 0.00000, 0.00000));
-}
-vec4 FxaaTexLod0( in sampler2D tex, in vec2 pos ) {
- return xll_tex2Dlod( tex, vec4( pos.xy , 0.00000, 0.00000));
-}
-vec4 FxaaTexGrad( in sampler2D tex, in vec2 pos, in vec2 grad ) {
- return xll_tex2Dgrad( tex, pos.xy , grad, grad);
-}
-float FxaaLuma( in vec3 rgb ) {
- return ((rgb.y * 1.96321) + rgb.x );
-}
-vec3 FxaaLerp3( in vec3 a, in vec3 b, in float amountOfA ) {
- return ((vec3( ( -amountOfA ), ( -amountOfA ), ( -amountOfA )) * b) + ((a * vec3( amountOfA, amountOfA, amountOfA)) + b));
-}
-vec3 FxaaFilterReturn( in vec3 rgb ) {
- return rgb;
-}
-vec3 FxaaPixelShader( in vec2 pos, in sampler2D tex, in vec2 rcpFrame ) {
- vec3 rgbN;
- vec3 rgbW;
- vec3 rgbM;
- vec3 rgbE;
- vec3 rgbS;
- float lumaN;
- float lumaW;
- float lumaM;
- float lumaE;
- float lumaS;
- float rangeMin;
- float rangeMax;
- float range;
- vec3 rgbL;
- float lumaL;
- float rangeL;
- float blendL;
- vec3 rgbNW;
- vec3 rgbNE;
- vec3 rgbSW;
- vec3 rgbSE;
- float lumaNW;
- float lumaNE;
- float lumaSW;
- float lumaSE;
- float edgeVert;
- float edgeHorz;
- bool horzSpan;
- float lengthSign;
- float gradientN;
- float gradientS;
- bool pairN;
- vec2 posN;
- vec2 posP;
- vec2 offNP;
- float lumaEndN;
- float lumaEndP;
- bool doneN = false;
- bool doneP = false;
- int i = 0;
- float dstN;
- float dstP;
- bool directionN;
- float spanLength;
- float subPixelOffset;
- vec3 rgbF;
- rgbN = FxaaTexOff( tex, pos.xy , vec2( 0.00000, -1.00000), rcpFrame).xyz ;
- rgbW = FxaaTexOff( tex, pos.xy , vec2( -1.00000, 0.00000), rcpFrame).xyz ;
- rgbM = FxaaTexOff( tex, pos.xy , vec2( 0.00000, 0.00000), rcpFrame).xyz ;
- rgbE = FxaaTexOff( tex, pos.xy , vec2( 1.00000, 0.00000), rcpFrame).xyz ;
- rgbS = FxaaTexOff( tex, pos.xy , vec2( 0.00000, 1.00000), rcpFrame).xyz ;
- lumaN = FxaaLuma( rgbN);
- lumaW = FxaaLuma( rgbW);
- lumaM = FxaaLuma( rgbM);
- lumaE = FxaaLuma( rgbE);
- lumaS = FxaaLuma( rgbS);
- rangeMin = min( lumaM, min( min( lumaN, lumaW), min( lumaS, lumaE)));
- rangeMax = max( lumaM, max( max( lumaN, lumaW), max( lumaS, lumaE)));
- range = (rangeMax - rangeMin);
- if ( (range < max( 0.0625000, (rangeMax * 0.125000))) ){
- return FxaaFilterReturn( rgbM);
- }
- rgbL = ((((rgbN + rgbW) + rgbM) + rgbE) + rgbS);
- lumaL = ((((lumaN + lumaW) + lumaE) + lumaS) * 0.250000);
- rangeL = abs( (lumaL - lumaM) );
- blendL = (max( 0.00000, ((rangeL / range) - 0.250000)) * 1.33333);
- blendL = min( 0.750000, blendL);
- rgbNW = FxaaTexOff( tex, pos.xy , vec2( -1.00000, -1.00000), rcpFrame).xyz ;
- rgbNE = FxaaTexOff( tex, pos.xy , vec2( 1.00000, -1.00000), rcpFrame).xyz ;
- rgbSW = FxaaTexOff( tex, pos.xy , vec2( -1.00000, 1.00000), rcpFrame).xyz ;
- rgbSE = FxaaTexOff( tex, pos.xy , vec2( 1.00000, 1.00000), rcpFrame).xyz ;
- rgbL += (((rgbNW + rgbNE) + rgbSW) + rgbSE);
- rgbL *= vec3( 0.111111, 0.111111, 0.111111);
- lumaNW = FxaaLuma( rgbNW);
- lumaNE = FxaaLuma( rgbNE);
- lumaSW = FxaaLuma( rgbSW);
- lumaSE = FxaaLuma( rgbSE);
- edgeVert = ((abs( (((0.250000 * lumaNW) + (-0.500000 * lumaN)) + (0.250000 * lumaNE)) ) + abs( (((0.500000 * lumaW) + (-1.00000 * lumaM)) + (0.500000 * lumaE)) )) + abs( (((0.250000 * lumaSW) + (-0.500000 * lumaS)) + (0.250000 * lumaSE)) ));
- edgeHorz = ((abs( (((0.250000 * lumaNW) + (-0.500000 * lumaW)) + (0.250000 * lumaSW)) ) + abs( (((0.500000 * lumaN) + (-1.00000 * lumaM)) + (0.500000 * lumaS)) )) + abs( (((0.250000 * lumaNE) + (-0.500000 * lumaE)) + (0.250000 * lumaSE)) ));
- horzSpan = (edgeHorz >= edgeVert);
- lengthSign = (( horzSpan ) ? ( ( -rcpFrame.y ) ) : ( ( -rcpFrame.x ) ));
- if ( ( !horzSpan ) ){
- lumaN = lumaW;
- }
- if ( ( !horzSpan ) ){
- lumaS = lumaE;
- }
- gradientN = abs( (lumaN - lumaM) );
- gradientS = abs( (lumaS - lumaM) );
- lumaN = ((lumaN + lumaM) * 0.500000);
- lumaS = ((lumaS + lumaM) * 0.500000);
- pairN = (gradientN >= gradientS);
- if ( ( !pairN ) ){
- lumaN = lumaS;
- }
- if ( ( !pairN ) ){
- gradientN = gradientS;
- }
- if ( ( !pairN ) ){
- lengthSign *= -1.00000;
- }
- posN.x = (pos.x + (( horzSpan ) ? ( 0.00000 ) : ( (lengthSign * 0.500000) )));
- posN.y = (pos.y + (( horzSpan ) ? ( (lengthSign * 0.500000) ) : ( 0.00000 )));
- gradientN *= 0.250000;
- posP = posN;
- offNP = (( horzSpan ) ? ( vec2( rcpFrame.x , 0.00000) ) : ( vec2( 0.00000, rcpFrame.y ) ));
- lumaEndN = lumaN;
- lumaEndP = lumaN;
- posN += (offNP * vec2( -2.00000, -2.00000));
- posP += (offNP * vec2( 2.00000, 2.00000));
- offNP *= vec2( 3.00000, 3.00000);
- for ( ; (i < 4); ( i++ )) {
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( FxaaTexGrad( tex, posN.xy , offNP).xyz );
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( FxaaTexGrad( tex, posP.xy , offNP).xyz );
- }
- doneN = (doneN || (abs( (lumaEndN - lumaN) ) >= gradientN));
- doneP = (doneP || (abs( (lumaEndP - lumaN) ) >= gradientN));
- if ( (doneN && doneP) ){
- break;
- }
- if ( ( !doneN ) ){
- posN -= offNP;
- }
- if ( ( !doneP ) ){
- posP += offNP;
- }
- }
- dstN = (( horzSpan ) ? ( (pos.x - posN.x ) ) : ( (pos.y - posN.y ) ));
- dstP = (( horzSpan ) ? ( (posP.x - pos.x ) ) : ( (posP.y - pos.y ) ));
- directionN = (dstN < dstP);
- lumaEndN = (( directionN ) ? ( lumaEndN ) : ( lumaEndP ));
- if ( (((lumaM - lumaN) < 0.00000) == ((lumaEndN - lumaN) < 0.00000)) ){
- lengthSign = 0.00000;
- }
- spanLength = (dstP + dstN);
- dstN = (( directionN ) ? ( dstN ) : ( dstP ));
- subPixelOffset = ((0.500000 + (dstN * (-1.00000 / spanLength))) * lengthSign);
- rgbF = FxaaTexLod0( tex, vec2( (pos.x + (( horzSpan ) ? ( 0.00000 ) : ( subPixelOffset ))), (pos.y + (( horzSpan ) ? ( subPixelOffset ) : ( 0.00000 ))))).xyz ;
- return FxaaFilterReturn( FxaaLerp3( rgbL, rgbF, blendL));
-}
-vec4 xlat_main( in vec2 uv ) {
- return vec4( FxaaPixelShader( uv.xy , _MainTex, _MainTex_TexelSize.xy ).xyz , 0.00000);
-}
-varying vec2 xlv_TEXCOORD0;
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( vec2(xlv_TEXCOORD0));
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-out.txt
deleted file mode 100644
index 64f12168361..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset1-out.txt
+++ /dev/null
@@ -1,294 +0,0 @@
-#extension GL_ARB_shader_texture_lod : enable
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_TexelSize;
-varying vec2 xlv_TEXCOORD0;
-void main ()
-{
- vec2 rcpFrame_1;
- rcpFrame_1 = _MainTex_TexelSize.xy;
- vec3 tmpvar_2;
- float subPixelOffset_3;
- float spanLength_4;
- bool directionN_5;
- bool doneP_7;
- bool doneN_8;
- float lumaEndP_9;
- float lumaEndN_10;
- vec2 offNP_11;
- vec2 posP_12;
- vec2 posN_13;
- bool pairN_14;
- float gradientN_15;
- float lengthSign_16;
- bool horzSpan_17;
- float blendL_18;
- vec3 rgbL_19;
- float range_20;
- float lumaS_21;
- float lumaN_22;
- doneN_8 = bool(0);
- doneP_7 = bool(0);
- vec4 tmpvar_23;
- tmpvar_23.zw = vec2(0.0, 0.0);
- tmpvar_23.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_24;
- tmpvar_24 = texture2DLod (_MainTex, tmpvar_23.xy, 0.0);
- vec4 tmpvar_25;
- tmpvar_25.zw = vec2(0.0, 0.0);
- tmpvar_25.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_26;
- tmpvar_26 = texture2DLod (_MainTex, tmpvar_25.xy, 0.0);
- vec4 tmpvar_27;
- tmpvar_27 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0);
- vec4 tmpvar_28;
- tmpvar_28.zw = vec2(0.0, 0.0);
- tmpvar_28.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_29;
- tmpvar_29 = texture2DLod (_MainTex, tmpvar_28.xy, 0.0);
- vec4 tmpvar_30;
- tmpvar_30.zw = vec2(0.0, 0.0);
- tmpvar_30.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_31;
- tmpvar_31 = texture2DLod (_MainTex, tmpvar_30.xy, 0.0);
- float tmpvar_32;
- tmpvar_32 = ((tmpvar_24.y * 1.96321) + tmpvar_24.x);
- lumaN_22 = tmpvar_32;
- float tmpvar_33;
- tmpvar_33 = ((tmpvar_26.y * 1.96321) + tmpvar_26.x);
- float tmpvar_34;
- tmpvar_34 = ((tmpvar_27.y * 1.96321) + tmpvar_27.x);
- float tmpvar_35;
- tmpvar_35 = ((tmpvar_29.y * 1.96321) + tmpvar_29.x);
- float tmpvar_36;
- tmpvar_36 = ((tmpvar_31.y * 1.96321) + tmpvar_31.x);
- lumaS_21 = tmpvar_36;
- float tmpvar_37;
- tmpvar_37 = max (max (tmpvar_34, tmpvar_32), max (max (tmpvar_33, tmpvar_36), tmpvar_35));
- range_20 = (tmpvar_37 - min (min (tmpvar_34, tmpvar_32), min (
- min (tmpvar_33, tmpvar_36)
- , tmpvar_35)));
- float tmpvar_38;
- tmpvar_38 = max (0.0625, (tmpvar_37 * 0.125));
- if ((range_20 < tmpvar_38)) {
- tmpvar_2 = tmpvar_27.xyz;
- } else {
- rgbL_19 = ((tmpvar_24.xyz + tmpvar_26.xyz) + ((tmpvar_27.xyz + tmpvar_29.xyz) + tmpvar_31.xyz));
- blendL_18 = (max (0.0, (
- (abs(((
- ((tmpvar_32 + tmpvar_33) + (tmpvar_35 + tmpvar_36))
- * 0.25) - tmpvar_34)) / range_20)
- - 0.25)) * 1.33333);
- float tmpvar_39;
- tmpvar_39 = min (0.75, blendL_18);
- blendL_18 = tmpvar_39;
- vec4 tmpvar_40;
- tmpvar_40.zw = vec2(0.0, 0.0);
- tmpvar_40.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy);
- vec4 tmpvar_41;
- tmpvar_41 = texture2DLod (_MainTex, tmpvar_40.xy, 0.0);
- vec4 tmpvar_42;
- tmpvar_42.zw = vec2(0.0, 0.0);
- tmpvar_42.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_43;
- tmpvar_43 = texture2DLod (_MainTex, tmpvar_42.xy, 0.0);
- vec4 tmpvar_44;
- tmpvar_44.zw = vec2(0.0, 0.0);
- tmpvar_44.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_45;
- tmpvar_45 = texture2DLod (_MainTex, tmpvar_44.xy, 0.0);
- vec4 tmpvar_46;
- tmpvar_46.zw = vec2(0.0, 0.0);
- tmpvar_46.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy);
- vec4 tmpvar_47;
- tmpvar_47 = texture2DLod (_MainTex, tmpvar_46.xy, 0.0);
- rgbL_19 = ((rgbL_19 + tmpvar_41.xyz) + ((tmpvar_43.xyz + tmpvar_45.xyz) + tmpvar_47.xyz));
- rgbL_19 = (rgbL_19 * vec3(0.111111, 0.111111, 0.111111));
- float tmpvar_48;
- tmpvar_48 = ((tmpvar_41.y * 1.96321) + tmpvar_41.x);
- float tmpvar_49;
- tmpvar_49 = ((tmpvar_43.y * 1.96321) + tmpvar_43.x);
- float tmpvar_50;
- tmpvar_50 = ((tmpvar_45.y * 1.96321) + tmpvar_45.x);
- float tmpvar_51;
- tmpvar_51 = ((tmpvar_47.y * 1.96321) + tmpvar_47.x);
- horzSpan_17 = (((
- abs((((0.25 * tmpvar_48) + (-0.5 * tmpvar_33)) + (0.25 * tmpvar_50)))
- +
- abs((((0.5 * tmpvar_32) - tmpvar_34) + (0.5 * tmpvar_36)))
- ) + abs(
- (((0.25 * tmpvar_49) + (-0.5 * tmpvar_35)) + (0.25 * tmpvar_51))
- )) >= ((
- abs((((0.25 * tmpvar_48) + (-0.5 * tmpvar_32)) + (0.25 * tmpvar_49)))
- +
- abs((((0.5 * tmpvar_33) - tmpvar_34) + (0.5 * tmpvar_35)))
- ) + abs(
- (((0.25 * tmpvar_50) + (-0.5 * tmpvar_36)) + (0.25 * tmpvar_51))
- )));
- float tmpvar_52;
- if (horzSpan_17) {
- tmpvar_52 = -(_MainTex_TexelSize.y);
- } else {
- tmpvar_52 = -(_MainTex_TexelSize.x);
- };
- lengthSign_16 = tmpvar_52;
- if (!(horzSpan_17)) {
- lumaN_22 = tmpvar_33;
- };
- if (!(horzSpan_17)) {
- lumaS_21 = tmpvar_35;
- };
- float tmpvar_53;
- tmpvar_53 = abs((lumaN_22 - tmpvar_34));
- gradientN_15 = tmpvar_53;
- float tmpvar_54;
- tmpvar_54 = abs((lumaS_21 - tmpvar_34));
- lumaN_22 = ((lumaN_22 + tmpvar_34) * 0.5);
- lumaS_21 = ((lumaS_21 + tmpvar_34) * 0.5);
- pairN_14 = (tmpvar_53 >= tmpvar_54);
- if (!(pairN_14)) {
- lumaN_22 = lumaS_21;
- };
- if (!(pairN_14)) {
- gradientN_15 = tmpvar_54;
- };
- if (!(pairN_14)) {
- lengthSign_16 = -(tmpvar_52);
- };
- float tmpvar_55;
- if (horzSpan_17) {
- tmpvar_55 = 0.0;
- } else {
- tmpvar_55 = (lengthSign_16 * 0.5);
- };
- posN_13.x = (xlv_TEXCOORD0.x + tmpvar_55);
- float tmpvar_56;
- if (horzSpan_17) {
- tmpvar_56 = (lengthSign_16 * 0.5);
- } else {
- tmpvar_56 = 0.0;
- };
- posN_13.y = (xlv_TEXCOORD0.y + tmpvar_56);
- gradientN_15 = (gradientN_15 * 0.25);
- posP_12 = posN_13;
- vec2 tmpvar_57;
- if (horzSpan_17) {
- vec2 tmpvar_58;
- tmpvar_58.y = 0.0;
- tmpvar_58.x = rcpFrame_1.x;
- tmpvar_57 = tmpvar_58;
- } else {
- vec2 tmpvar_59;
- tmpvar_59.x = 0.0;
- tmpvar_59.y = rcpFrame_1.y;
- tmpvar_57 = tmpvar_59;
- };
- lumaEndN_10 = lumaN_22;
- lumaEndP_9 = lumaN_22;
- posN_13 = (posN_13 + (tmpvar_57 * vec2(-2.0, -2.0)));
- posP_12 = (posP_12 + (tmpvar_57 * vec2(2.0, 2.0)));
- offNP_11 = (tmpvar_57 * vec2(3.0, 3.0));
- for (int i_6; i_6 < 4; i_6++) {
- if (!(doneN_8)) {
- vec4 tmpvar_60;
- tmpvar_60 = texture2DGradARB (_MainTex, posN_13, offNP_11, offNP_11);
- lumaEndN_10 = ((tmpvar_60.y * 1.96321) + tmpvar_60.x);
- };
- if (!(doneP_7)) {
- vec4 tmpvar_61;
- tmpvar_61 = texture2DGradARB (_MainTex, posP_12, offNP_11, offNP_11);
- lumaEndP_9 = ((tmpvar_61.y * 1.96321) + tmpvar_61.x);
- };
- bool tmpvar_62;
- if (doneN_8) {
- tmpvar_62 = bool(1);
- } else {
- tmpvar_62 = (abs((lumaEndN_10 - lumaN_22)) >= gradientN_15);
- };
- doneN_8 = tmpvar_62;
- bool tmpvar_63;
- if (doneP_7) {
- tmpvar_63 = bool(1);
- } else {
- tmpvar_63 = (abs((lumaEndP_9 - lumaN_22)) >= gradientN_15);
- };
- doneP_7 = tmpvar_63;
- if ((tmpvar_62 && tmpvar_63)) {
- break;
- };
- if (!(tmpvar_62)) {
- posN_13 = (posN_13 - offNP_11);
- };
- if (!(tmpvar_63)) {
- posP_12 = (posP_12 + offNP_11);
- };
- };
- float tmpvar_64;
- if (horzSpan_17) {
- tmpvar_64 = (xlv_TEXCOORD0.x - posN_13.x);
- } else {
- tmpvar_64 = (xlv_TEXCOORD0.y - posN_13.y);
- };
- float tmpvar_65;
- if (horzSpan_17) {
- tmpvar_65 = (posP_12.x - xlv_TEXCOORD0.x);
- } else {
- tmpvar_65 = (posP_12.y - xlv_TEXCOORD0.y);
- };
- directionN_5 = (tmpvar_64 < tmpvar_65);
- float tmpvar_66;
- if (directionN_5) {
- tmpvar_66 = lumaEndN_10;
- } else {
- tmpvar_66 = lumaEndP_9;
- };
- lumaEndN_10 = tmpvar_66;
- if ((((tmpvar_34 - lumaN_22) < 0.0) == ((tmpvar_66 - lumaN_22) < 0.0))) {
- lengthSign_16 = 0.0;
- };
- spanLength_4 = (tmpvar_65 + tmpvar_64);
- float tmpvar_67;
- if (directionN_5) {
- tmpvar_67 = tmpvar_64;
- } else {
- tmpvar_67 = tmpvar_65;
- };
- subPixelOffset_3 = ((0.5 + (tmpvar_67 *
- (-1.0 / spanLength_4)
- )) * lengthSign_16);
- float tmpvar_68;
- if (horzSpan_17) {
- tmpvar_68 = 0.0;
- } else {
- tmpvar_68 = subPixelOffset_3;
- };
- float tmpvar_69;
- if (horzSpan_17) {
- tmpvar_69 = subPixelOffset_3;
- } else {
- tmpvar_69 = 0.0;
- };
- vec2 tmpvar_70;
- tmpvar_70.x = (xlv_TEXCOORD0.x + tmpvar_68);
- tmpvar_70.y = (xlv_TEXCOORD0.y + tmpvar_69);
- vec4 tmpvar_71;
- tmpvar_71 = texture2DLod (_MainTex, tmpvar_70, 0.0);
- vec3 tmpvar_72;
- tmpvar_72.x = -(tmpvar_39);
- tmpvar_72.y = -(tmpvar_39);
- tmpvar_72.z = -(tmpvar_39);
- tmpvar_2 = ((tmpvar_72 * tmpvar_71.xyz) + ((rgbL_19 * vec3(tmpvar_39)) + tmpvar_71.xyz));
- };
- vec4 tmpvar_73;
- tmpvar_73.w = 0.0;
- tmpvar_73.xyz = tmpvar_2;
- gl_FragData[0] = tmpvar_73;
-}
-
-
-// stats: 194 alu 12 tex 26 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _MainTex_TexelSize (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-in.txt
deleted file mode 100644
index 19721924c08..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-in.txt
+++ /dev/null
@@ -1,138 +0,0 @@
-#extension GL_ARB_shader_texture_lod : require
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return texture2DLod( s, coord.xy, coord.w);
-}
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_TexelSize;
-vec4 FxaaTexOff( in sampler2D tex, in vec2 pos, in vec2 off, in vec2 rcpFrame );
-vec4 FxaaTexLod0( in sampler2D tex, in vec2 pos );
-float FxaaLuma( in vec3 rgb );
-vec3 FxaaLerp3( in vec3 a, in vec3 b, in float amountOfA );
-vec3 FxaaFilterReturn( in vec3 rgb );
-vec3 FxaaPixelShader( in vec2 pos, in sampler2D tex, in vec2 rcpFrame );
-vec4 xlat_main( in vec2 uv );
-vec4 FxaaTexOff( in sampler2D tex, in vec2 pos, in vec2 off, in vec2 rcpFrame ) {
- return xll_tex2Dlod( tex, vec4( (pos.xy + (off * rcpFrame)), 0.0, 0.0));
-}
-vec4 FxaaTexLod0( in sampler2D tex, in vec2 pos ) {
- return xll_tex2Dlod( tex, vec4( pos.xy, 0.0, 0.0));
-}
-float FxaaLuma( in vec3 rgb ) {
- return ((rgb.y * (0.587 / 0.299)) + rgb.x);
-}
-vec3 FxaaLerp3( in vec3 a, in vec3 b, in float amountOfA ) {
- return ((vec3( (-amountOfA), (-amountOfA), (-amountOfA)) * b) + ((a * vec3( amountOfA, amountOfA, amountOfA)) + b));
-}
-vec3 FxaaFilterReturn( in vec3 rgb ) {
- return rgb;
-}
-vec3 FxaaPixelShader( in vec2 pos, in sampler2D tex, in vec2 rcpFrame ) {
- vec3 rgbN = FxaaTexOff( tex, pos.xy, vec2( 0.0, -1.0), rcpFrame).xyz;
- vec3 rgbW = FxaaTexOff( tex, pos.xy, vec2( -1.0, 0.0), rcpFrame).xyz;
- vec3 rgbM = FxaaTexOff( tex, pos.xy, vec2( 0.0, 0.0), rcpFrame).xyz;
- vec3 rgbE = FxaaTexOff( tex, pos.xy, vec2( 1.0, 0.0), rcpFrame).xyz;
- vec3 rgbS = FxaaTexOff( tex, pos.xy, vec2( 0.0, 1.0), rcpFrame).xyz;
- float lumaN = FxaaLuma( rgbN);
- float lumaW = FxaaLuma( rgbW);
- float lumaM = FxaaLuma( rgbM);
- float lumaE = FxaaLuma( rgbE);
- float lumaS = FxaaLuma( rgbS);
- float rangeMin = min( lumaM, min( min( lumaN, lumaW), min( lumaS, lumaE)));
- float rangeMax = max( lumaM, max( max( lumaN, lumaW), max( lumaS, lumaE)));
- float range = (rangeMax - rangeMin);
- if ((range < max( (1.0 / 24.0), (rangeMax * (1.0 / 8.0))))){
- return FxaaFilterReturn( rgbM);
- }
- vec3 rgbL = ((((rgbN + rgbW) + rgbM) + rgbE) + rgbS);
- float lumaL = ((((lumaN + lumaW) + lumaE) + lumaS) * 0.25);
- float rangeL = abs((lumaL - lumaM));
- float blendL = (max( 0.0, ((rangeL / range) - (1.0 / 4.0))) * (1.0 / (1.0 - (1.0 / 4.0))));
- blendL = min( (3.0 / 4.0), blendL);
- vec3 rgbNW = FxaaTexOff( tex, pos.xy, vec2( -1.0, -1.0), rcpFrame).xyz;
- vec3 rgbNE = FxaaTexOff( tex, pos.xy, vec2( 1.0, -1.0), rcpFrame).xyz;
- vec3 rgbSW = FxaaTexOff( tex, pos.xy, vec2( -1.0, 1.0), rcpFrame).xyz;
- vec3 rgbSE = FxaaTexOff( tex, pos.xy, vec2( 1.0, 1.0), rcpFrame).xyz;
- rgbL += (((rgbNW + rgbNE) + rgbSW) + rgbSE);
- rgbL *= vec3( (1.0 / 9.0), (1.0 / 9.0), (1.0 / 9.0));
- float lumaNW = FxaaLuma( rgbNW);
- float lumaNE = FxaaLuma( rgbNE);
- float lumaSW = FxaaLuma( rgbSW);
- float lumaSE = FxaaLuma( rgbSE);
- float edgeVert = ((abs((((0.25 * lumaNW) + ((-0.5) * lumaN)) + (0.25 * lumaNE))) + abs((((0.5 * lumaW) + ((-1.0) * lumaM)) + (0.5 * lumaE)))) + abs((((0.25 * lumaSW) + ((-0.5) * lumaS)) + (0.25 * lumaSE))));
- float edgeHorz = ((abs((((0.25 * lumaNW) + ((-0.5) * lumaW)) + (0.25 * lumaSW))) + abs((((0.5 * lumaN) + ((-1.0) * lumaM)) + (0.5 * lumaS)))) + abs((((0.25 * lumaNE) + ((-0.5) * lumaE)) + (0.25 * lumaSE))));
- bool horzSpan = (edgeHorz >= edgeVert);
- float lengthSign = (( horzSpan ) ? ( (-rcpFrame.y) ) : ( (-rcpFrame.x) ));
- if ((!horzSpan)){
- lumaN = lumaW;
- }
- if ((!horzSpan)){
- lumaS = lumaE;
- }
- float gradientN = abs((lumaN - lumaM));
- float gradientS = abs((lumaS - lumaM));
- lumaN = ((lumaN + lumaM) * 0.5);
- lumaS = ((lumaS + lumaM) * 0.5);
- bool pairN = (gradientN >= gradientS);
- if ((!pairN)){
- lumaN = lumaS;
- }
- if ((!pairN)){
- gradientN = gradientS;
- }
- if ((!pairN)){
- lengthSign *= (-1.0);
- }
- vec2 posN;
- posN.x = (pos.x + (( horzSpan ) ? ( 0.0 ) : ( (lengthSign * 0.5) )));
- posN.y = (pos.y + (( horzSpan ) ? ( (lengthSign * 0.5) ) : ( 0.0 )));
- gradientN *= (1.0 / 4.0);
- vec2 posP = posN;
- vec2 offNP = (( horzSpan ) ? ( vec2( rcpFrame.x, 0.0) ) : ( vec2( 0.0, rcpFrame.y) ));
- float lumaEndN = lumaN;
- float lumaEndP = lumaN;
- bool doneN = false;
- bool doneP = false;
- posN += (offNP * vec2( (-1.0), (-1.0)));
- posP += (offNP * vec2( 1.0, 1.0));
- int i = 0;
- for ( ; (i < 16); (i++)) {
- if ((!doneN)){
- lumaEndN = FxaaLuma( FxaaTexLod0( tex, posN.xy).xyz);
- }
- if ((!doneP)){
- lumaEndP = FxaaLuma( FxaaTexLod0( tex, posP.xy).xyz);
- }
- doneN = (doneN || (abs((lumaEndN - lumaN)) >= gradientN));
- doneP = (doneP || (abs((lumaEndP - lumaN)) >= gradientN));
- if ((doneN && doneP)){
- break;
- }
- if ((!doneN)){
- posN -= offNP;
- }
- if ((!doneP)){
- posP += offNP;
- }
- }
- float dstN = (( horzSpan ) ? ( (pos.x - posN.x) ) : ( (pos.y - posN.y) ));
- float dstP = (( horzSpan ) ? ( (posP.x - pos.x) ) : ( (posP.y - pos.y) ));
- bool directionN = (dstN < dstP);
- lumaEndN = (( directionN ) ? ( lumaEndN ) : ( lumaEndP ));
- if ((((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))){
- lengthSign = 0.0;
- }
- float spanLength = (dstP + dstN);
- dstN = (( directionN ) ? ( dstN ) : ( dstP ));
- float subPixelOffset = ((0.5 + (dstN * ((-1.0) / spanLength))) * lengthSign);
- vec3 rgbF = FxaaTexLod0( tex, vec2( (pos.x + (( horzSpan ) ? ( 0.0 ) : ( subPixelOffset ))), (pos.y + (( horzSpan ) ? ( subPixelOffset ) : ( 0.0 ))))).xyz;
- return FxaaFilterReturn( FxaaLerp3( rgbL, rgbF, blendL));
-}
-vec4 xlat_main( in vec2 uv ) {
- return vec4( FxaaPixelShader( uv.xy, _MainTex, _MainTex_TexelSize.xy).xyz, 0.0);
-}
-varying vec2 xlv_TEXCOORD0;
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( vec2(xlv_TEXCOORD0));
- gl_FragData[0] = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt
deleted file mode 100644
index 366fe2f4cac..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-inES3.txt
+++ /dev/null
@@ -1,139 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return textureLod( s, coord.xy, coord.w);
-}
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_TexelSize;
-vec4 FxaaTexOff( in sampler2D tex, in vec2 pos, in vec2 off, in vec2 rcpFrame );
-vec4 FxaaTexLod0( in sampler2D tex, in vec2 pos );
-float FxaaLuma( in vec3 rgb );
-vec3 FxaaLerp3( in vec3 a, in vec3 b, in float amountOfA );
-vec3 FxaaFilterReturn( in vec3 rgb );
-vec3 FxaaPixelShader( in vec2 pos, in sampler2D tex, in vec2 rcpFrame );
-vec4 xlat_main( in vec2 uv );
-vec4 FxaaTexOff( in sampler2D tex, in vec2 pos, in vec2 off, in vec2 rcpFrame ) {
- return xll_tex2Dlod( tex, vec4( (pos.xy + (off * rcpFrame)), 0.0, 0.0));
-}
-vec4 FxaaTexLod0( in sampler2D tex, in vec2 pos ) {
- return xll_tex2Dlod( tex, vec4( pos.xy, 0.0, 0.0));
-}
-float FxaaLuma( in vec3 rgb ) {
- return ((rgb.y * (0.587 / 0.299)) + rgb.x);
-}
-vec3 FxaaLerp3( in vec3 a, in vec3 b, in float amountOfA ) {
- return ((vec3( (-amountOfA), (-amountOfA), (-amountOfA)) * b) + ((a * vec3( amountOfA, amountOfA, amountOfA)) + b));
-}
-vec3 FxaaFilterReturn( in vec3 rgb ) {
- return rgb;
-}
-vec3 FxaaPixelShader( in vec2 pos, in sampler2D tex, in vec2 rcpFrame ) {
- vec3 rgbN = FxaaTexOff( tex, pos.xy, vec2( 0.0, -1.0), rcpFrame).xyz;
- vec3 rgbW = FxaaTexOff( tex, pos.xy, vec2( -1.0, 0.0), rcpFrame).xyz;
- vec3 rgbM = FxaaTexOff( tex, pos.xy, vec2( 0.0, 0.0), rcpFrame).xyz;
- vec3 rgbE = FxaaTexOff( tex, pos.xy, vec2( 1.0, 0.0), rcpFrame).xyz;
- vec3 rgbS = FxaaTexOff( tex, pos.xy, vec2( 0.0, 1.0), rcpFrame).xyz;
- float lumaN = FxaaLuma( rgbN);
- float lumaW = FxaaLuma( rgbW);
- float lumaM = FxaaLuma( rgbM);
- float lumaE = FxaaLuma( rgbE);
- float lumaS = FxaaLuma( rgbS);
- float rangeMin = min( lumaM, min( min( lumaN, lumaW), min( lumaS, lumaE)));
- float rangeMax = max( lumaM, max( max( lumaN, lumaW), max( lumaS, lumaE)));
- float range = (rangeMax - rangeMin);
- if ((range < max( (1.0 / 24.0), (rangeMax * (1.0 / 8.0))))){
- return FxaaFilterReturn( rgbM);
- }
- vec3 rgbL = ((((rgbN + rgbW) + rgbM) + rgbE) + rgbS);
- float lumaL = ((((lumaN + lumaW) + lumaE) + lumaS) * 0.25);
- float rangeL = abs((lumaL - lumaM));
- float blendL = (max( 0.0, ((rangeL / range) - (1.0 / 4.0))) * (1.0 / (1.0 - (1.0 / 4.0))));
- blendL = min( (3.0 / 4.0), blendL);
- vec3 rgbNW = FxaaTexOff( tex, pos.xy, vec2( -1.0, -1.0), rcpFrame).xyz;
- vec3 rgbNE = FxaaTexOff( tex, pos.xy, vec2( 1.0, -1.0), rcpFrame).xyz;
- vec3 rgbSW = FxaaTexOff( tex, pos.xy, vec2( -1.0, 1.0), rcpFrame).xyz;
- vec3 rgbSE = FxaaTexOff( tex, pos.xy, vec2( 1.0, 1.0), rcpFrame).xyz;
- rgbL += (((rgbNW + rgbNE) + rgbSW) + rgbSE);
- rgbL *= vec3( (1.0 / 9.0), (1.0 / 9.0), (1.0 / 9.0));
- float lumaNW = FxaaLuma( rgbNW);
- float lumaNE = FxaaLuma( rgbNE);
- float lumaSW = FxaaLuma( rgbSW);
- float lumaSE = FxaaLuma( rgbSE);
- float edgeVert = ((abs((((0.25 * lumaNW) + ((-0.5) * lumaN)) + (0.25 * lumaNE))) + abs((((0.5 * lumaW) + ((-1.0) * lumaM)) + (0.5 * lumaE)))) + abs((((0.25 * lumaSW) + ((-0.5) * lumaS)) + (0.25 * lumaSE))));
- float edgeHorz = ((abs((((0.25 * lumaNW) + ((-0.5) * lumaW)) + (0.25 * lumaSW))) + abs((((0.5 * lumaN) + ((-1.0) * lumaM)) + (0.5 * lumaS)))) + abs((((0.25 * lumaNE) + ((-0.5) * lumaE)) + (0.25 * lumaSE))));
- bool horzSpan = (edgeHorz >= edgeVert);
- float lengthSign = (( horzSpan ) ? ( (-rcpFrame.y) ) : ( (-rcpFrame.x) ));
- if ((!horzSpan)){
- lumaN = lumaW;
- }
- if ((!horzSpan)){
- lumaS = lumaE;
- }
- float gradientN = abs((lumaN - lumaM));
- float gradientS = abs((lumaS - lumaM));
- lumaN = ((lumaN + lumaM) * 0.5);
- lumaS = ((lumaS + lumaM) * 0.5);
- bool pairN = (gradientN >= gradientS);
- if ((!pairN)){
- lumaN = lumaS;
- }
- if ((!pairN)){
- gradientN = gradientS;
- }
- if ((!pairN)){
- lengthSign *= (-1.0);
- }
- vec2 posN;
- posN.x = (pos.x + (( horzSpan ) ? ( 0.0 ) : ( (lengthSign * 0.5) )));
- posN.y = (pos.y + (( horzSpan ) ? ( (lengthSign * 0.5) ) : ( 0.0 )));
- gradientN *= (1.0 / 4.0);
- vec2 posP = posN;
- vec2 offNP = (( horzSpan ) ? ( vec2( rcpFrame.x, 0.0) ) : ( vec2( 0.0, rcpFrame.y) ));
- float lumaEndN = lumaN;
- float lumaEndP = lumaN;
- bool doneN = false;
- bool doneP = false;
- posN += (offNP * vec2( (-1.0), (-1.0)));
- posP += (offNP * vec2( 1.0, 1.0));
- int i = 0;
- for ( ; (i < 16); (i++)) {
- if ((!doneN)){
- lumaEndN = FxaaLuma( FxaaTexLod0( tex, posN.xy).xyz);
- }
- if ((!doneP)){
- lumaEndP = FxaaLuma( FxaaTexLod0( tex, posP.xy).xyz);
- }
- doneN = (doneN || (abs((lumaEndN - lumaN)) >= gradientN));
- doneP = (doneP || (abs((lumaEndP - lumaN)) >= gradientN));
- if ((doneN && doneP)){
- break;
- }
- if ((!doneN)){
- posN -= offNP;
- }
- if ((!doneP)){
- posP += offNP;
- }
- }
- float dstN = (( horzSpan ) ? ( (pos.x - posN.x) ) : ( (pos.y - posN.y) ));
- float dstP = (( horzSpan ) ? ( (posP.x - pos.x) ) : ( (posP.y - pos.y) ));
- bool directionN = (dstN < dstP);
- lumaEndN = (( directionN ) ? ( lumaEndN ) : ( lumaEndP ));
- if ((((lumaM - lumaN) < 0.0) == ((lumaEndN - lumaN) < 0.0))){
- lengthSign = 0.0;
- }
- float spanLength = (dstP + dstN);
- dstN = (( directionN ) ? ( dstN ) : ( dstP ));
- float subPixelOffset = ((0.5 + (dstN * ((-1.0) / spanLength))) * lengthSign);
- vec3 rgbF = FxaaTexLod0( tex, vec2( (pos.x + (( horzSpan ) ? ( 0.0 ) : ( subPixelOffset ))), (pos.y + (( horzSpan ) ? ( subPixelOffset ) : ( 0.0 ))))).xyz;
- return FxaaFilterReturn( FxaaLerp3( rgbL, rgbF, blendL));
-}
-vec4 xlat_main( in vec2 uv ) {
- return vec4( FxaaPixelShader( uv.xy, _MainTex, _MainTex_TexelSize.xy).xyz, 0.0);
-}
-in vec2 xlv_TEXCOORD0;
-void main() {
- vec4 xl_retval;
- xl_retval = xlat_main( vec2(xlv_TEXCOORD0));
- _fragData = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt
deleted file mode 100644
index 5a7ad47a804..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-out.txt
+++ /dev/null
@@ -1,292 +0,0 @@
-#extension GL_ARB_shader_texture_lod : enable
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_TexelSize;
-varying vec2 xlv_TEXCOORD0;
-void main ()
-{
- vec2 rcpFrame_1;
- rcpFrame_1 = _MainTex_TexelSize.xy;
- vec3 tmpvar_2;
- bool doneP_4;
- bool doneN_5;
- float lumaEndP_6;
- float lumaEndN_7;
- vec2 offNP_8;
- vec2 posP_9;
- vec2 posN_10;
- float gradientN_11;
- float lengthSign_12;
- vec3 rgbL_13;
- float lumaS_14;
- float lumaN_15;
- vec4 tmpvar_16;
- tmpvar_16.zw = vec2(0.0, 0.0);
- tmpvar_16.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_17;
- tmpvar_17 = texture2DLod (_MainTex, tmpvar_16.xy, 0.0);
- vec4 tmpvar_18;
- tmpvar_18.zw = vec2(0.0, 0.0);
- tmpvar_18.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_19;
- tmpvar_19 = texture2DLod (_MainTex, tmpvar_18.xy, 0.0);
- vec4 tmpvar_20;
- tmpvar_20 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0);
- vec4 tmpvar_21;
- tmpvar_21.zw = vec2(0.0, 0.0);
- tmpvar_21.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_22;
- tmpvar_22 = texture2DLod (_MainTex, tmpvar_21.xy, 0.0);
- vec4 tmpvar_23;
- tmpvar_23.zw = vec2(0.0, 0.0);
- tmpvar_23.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_24;
- tmpvar_24 = texture2DLod (_MainTex, tmpvar_23.xy, 0.0);
- float tmpvar_25;
- tmpvar_25 = ((tmpvar_17.y * 1.963211) + tmpvar_17.x);
- lumaN_15 = tmpvar_25;
- float tmpvar_26;
- tmpvar_26 = ((tmpvar_19.y * 1.963211) + tmpvar_19.x);
- float tmpvar_27;
- tmpvar_27 = ((tmpvar_20.y * 1.963211) + tmpvar_20.x);
- float tmpvar_28;
- tmpvar_28 = ((tmpvar_22.y * 1.963211) + tmpvar_22.x);
- float tmpvar_29;
- tmpvar_29 = ((tmpvar_24.y * 1.963211) + tmpvar_24.x);
- lumaS_14 = tmpvar_29;
- float tmpvar_30;
- tmpvar_30 = max (max (tmpvar_27, tmpvar_25), max (max (tmpvar_26, tmpvar_29), tmpvar_28));
- float tmpvar_31;
- tmpvar_31 = (tmpvar_30 - min (min (tmpvar_27, tmpvar_25), min (
- min (tmpvar_26, tmpvar_29)
- , tmpvar_28)));
- float tmpvar_32;
- tmpvar_32 = max (0.04166667, (tmpvar_30 * 0.125));
- if ((tmpvar_31 < tmpvar_32)) {
- tmpvar_2 = tmpvar_20.xyz;
- } else {
- float tmpvar_33;
- tmpvar_33 = min (0.75, (max (0.0,
- ((abs((
- (((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * 0.25)
- - tmpvar_27)) / tmpvar_31) - 0.25)
- ) * 1.333333));
- vec4 tmpvar_34;
- tmpvar_34.zw = vec2(0.0, 0.0);
- tmpvar_34.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy);
- vec4 tmpvar_35;
- tmpvar_35 = texture2DLod (_MainTex, tmpvar_34.xy, 0.0);
- vec4 tmpvar_36;
- tmpvar_36.zw = vec2(0.0, 0.0);
- tmpvar_36.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_37;
- tmpvar_37 = texture2DLod (_MainTex, tmpvar_36.xy, 0.0);
- vec4 tmpvar_38;
- tmpvar_38.zw = vec2(0.0, 0.0);
- tmpvar_38.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_39;
- tmpvar_39 = texture2DLod (_MainTex, tmpvar_38.xy, 0.0);
- vec4 tmpvar_40;
- tmpvar_40.zw = vec2(0.0, 0.0);
- tmpvar_40.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy);
- vec4 tmpvar_41;
- tmpvar_41 = texture2DLod (_MainTex, tmpvar_40.xy, 0.0);
- rgbL_13 = (((tmpvar_17.xyz + tmpvar_19.xyz) + (tmpvar_20.xyz + tmpvar_22.xyz)) + ((tmpvar_24.xyz + tmpvar_35.xyz) + (
- (tmpvar_37.xyz + tmpvar_39.xyz)
- + tmpvar_41.xyz)));
- rgbL_13 = (rgbL_13 * vec3(0.1111111, 0.1111111, 0.1111111));
- float tmpvar_42;
- tmpvar_42 = ((tmpvar_35.y * 1.963211) + tmpvar_35.x);
- float tmpvar_43;
- tmpvar_43 = ((tmpvar_37.y * 1.963211) + tmpvar_37.x);
- float tmpvar_44;
- tmpvar_44 = ((tmpvar_39.y * 1.963211) + tmpvar_39.x);
- float tmpvar_45;
- tmpvar_45 = ((tmpvar_41.y * 1.963211) + tmpvar_41.x);
- bool tmpvar_46;
- tmpvar_46 = (((
- abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_26)) + (0.25 * tmpvar_44)))
- +
- abs((((0.5 * tmpvar_25) - tmpvar_27) + (0.5 * tmpvar_29)))
- ) + abs(
- (((0.25 * tmpvar_43) + (-0.5 * tmpvar_28)) + (0.25 * tmpvar_45))
- )) >= ((
- abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_25)) + (0.25 * tmpvar_43)))
- +
- abs((((0.5 * tmpvar_26) - tmpvar_27) + (0.5 * tmpvar_28)))
- ) + abs(
- (((0.25 * tmpvar_44) + (-0.5 * tmpvar_29)) + (0.25 * tmpvar_45))
- )));
- float tmpvar_47;
- if (tmpvar_46) {
- tmpvar_47 = -(_MainTex_TexelSize.y);
- } else {
- tmpvar_47 = -(_MainTex_TexelSize.x);
- };
- lengthSign_12 = tmpvar_47;
- if (!(tmpvar_46)) {
- lumaN_15 = tmpvar_26;
- };
- if (!(tmpvar_46)) {
- lumaS_14 = tmpvar_28;
- };
- float tmpvar_48;
- tmpvar_48 = abs((lumaN_15 - tmpvar_27));
- gradientN_11 = tmpvar_48;
- float tmpvar_49;
- tmpvar_49 = abs((lumaS_14 - tmpvar_27));
- lumaN_15 = ((lumaN_15 + tmpvar_27) * 0.5);
- lumaS_14 = ((lumaS_14 + tmpvar_27) * 0.5);
- bool tmpvar_50;
- tmpvar_50 = (tmpvar_48 >= tmpvar_49);
- if (!(tmpvar_50)) {
- lumaN_15 = lumaS_14;
- };
- if (!(tmpvar_50)) {
- gradientN_11 = tmpvar_49;
- };
- if (!(tmpvar_50)) {
- lengthSign_12 = -(tmpvar_47);
- };
- float tmpvar_51;
- if (tmpvar_46) {
- tmpvar_51 = 0.0;
- } else {
- tmpvar_51 = (lengthSign_12 * 0.5);
- };
- posN_10.x = (xlv_TEXCOORD0.x + tmpvar_51);
- float tmpvar_52;
- if (tmpvar_46) {
- tmpvar_52 = (lengthSign_12 * 0.5);
- } else {
- tmpvar_52 = 0.0;
- };
- posN_10.y = (xlv_TEXCOORD0.y + tmpvar_52);
- gradientN_11 = (gradientN_11 * 0.25);
- posP_9 = posN_10;
- vec2 tmpvar_53;
- if (tmpvar_46) {
- vec2 tmpvar_54;
- tmpvar_54.y = 0.0;
- tmpvar_54.x = rcpFrame_1.x;
- tmpvar_53 = tmpvar_54;
- } else {
- vec2 tmpvar_55;
- tmpvar_55.x = 0.0;
- tmpvar_55.y = rcpFrame_1.y;
- tmpvar_53 = tmpvar_55;
- };
- offNP_8 = tmpvar_53;
- lumaEndN_7 = lumaN_15;
- lumaEndP_6 = lumaN_15;
- doneN_5 = bool(0);
- doneP_4 = bool(0);
- posN_10 = (posN_10 - tmpvar_53);
- posP_9 = (posP_9 + tmpvar_53);
- for (int i_3 = 0; i_3 < 16; i_3++) {
- if (!(doneN_5)) {
- vec4 tmpvar_56;
- tmpvar_56 = texture2DLod (_MainTex, posN_10, 0.0);
- lumaEndN_7 = ((tmpvar_56.y * 1.963211) + tmpvar_56.x);
- };
- if (!(doneP_4)) {
- vec4 tmpvar_57;
- tmpvar_57 = texture2DLod (_MainTex, posP_9, 0.0);
- lumaEndP_6 = ((tmpvar_57.y * 1.963211) + tmpvar_57.x);
- };
- bool tmpvar_58;
- if (doneN_5) {
- tmpvar_58 = bool(1);
- } else {
- tmpvar_58 = (abs((lumaEndN_7 - lumaN_15)) >= gradientN_11);
- };
- doneN_5 = tmpvar_58;
- bool tmpvar_59;
- if (doneP_4) {
- tmpvar_59 = bool(1);
- } else {
- tmpvar_59 = (abs((lumaEndP_6 - lumaN_15)) >= gradientN_11);
- };
- doneP_4 = tmpvar_59;
- if ((tmpvar_58 && tmpvar_59)) {
- break;
- };
- if (!(tmpvar_58)) {
- posN_10 = (posN_10 - offNP_8);
- };
- if (!(tmpvar_59)) {
- posP_9 = (posP_9 + offNP_8);
- };
- };
- float tmpvar_60;
- if (tmpvar_46) {
- tmpvar_60 = (xlv_TEXCOORD0.x - posN_10.x);
- } else {
- tmpvar_60 = (xlv_TEXCOORD0.y - posN_10.y);
- };
- float tmpvar_61;
- if (tmpvar_46) {
- tmpvar_61 = (posP_9.x - xlv_TEXCOORD0.x);
- } else {
- tmpvar_61 = (posP_9.y - xlv_TEXCOORD0.y);
- };
- bool tmpvar_62;
- tmpvar_62 = (tmpvar_60 < tmpvar_61);
- float tmpvar_63;
- if (tmpvar_62) {
- tmpvar_63 = lumaEndN_7;
- } else {
- tmpvar_63 = lumaEndP_6;
- };
- lumaEndN_7 = tmpvar_63;
- if ((((tmpvar_27 - lumaN_15) < 0.0) == ((tmpvar_63 - lumaN_15) < 0.0))) {
- lengthSign_12 = 0.0;
- };
- float tmpvar_64;
- tmpvar_64 = (tmpvar_61 + tmpvar_60);
- float tmpvar_65;
- if (tmpvar_62) {
- tmpvar_65 = tmpvar_60;
- } else {
- tmpvar_65 = tmpvar_61;
- };
- float tmpvar_66;
- tmpvar_66 = ((0.5 + (tmpvar_65 *
- (-1.0 / tmpvar_64)
- )) * lengthSign_12);
- float tmpvar_67;
- if (tmpvar_46) {
- tmpvar_67 = 0.0;
- } else {
- tmpvar_67 = tmpvar_66;
- };
- float tmpvar_68;
- if (tmpvar_46) {
- tmpvar_68 = tmpvar_66;
- } else {
- tmpvar_68 = 0.0;
- };
- vec2 tmpvar_69;
- tmpvar_69.x = (xlv_TEXCOORD0.x + tmpvar_67);
- tmpvar_69.y = (xlv_TEXCOORD0.y + tmpvar_68);
- vec4 tmpvar_70;
- tmpvar_70 = texture2DLod (_MainTex, tmpvar_69, 0.0);
- vec3 tmpvar_71;
- tmpvar_71.x = -(tmpvar_33);
- tmpvar_71.y = -(tmpvar_33);
- tmpvar_71.z = -(tmpvar_33);
- tmpvar_2 = ((tmpvar_71 * tmpvar_70.xyz) + ((rgbL_13 * vec3(tmpvar_33)) + tmpvar_70.xyz));
- };
- vec4 tmpvar_72;
- tmpvar_72.w = 0.0;
- tmpvar_72.xyz = tmpvar_2;
- gl_FragData[0] = tmpvar_72;
-}
-
-
-// stats: 191 alu 12 tex 26 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _MainTex_TexelSize (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt
deleted file mode 100644
index 371c8e0fcfb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3.txt
+++ /dev/null
@@ -1,293 +0,0 @@
-#version 300 es
-out lowp vec4 _fragData;
-uniform sampler2D _MainTex;
-uniform highp vec4 _MainTex_TexelSize;
-in highp vec2 xlv_TEXCOORD0;
-void main ()
-{
- highp vec2 rcpFrame_1;
- rcpFrame_1 = _MainTex_TexelSize.xy;
- lowp vec3 tmpvar_2;
- bool doneP_4;
- bool doneN_5;
- lowp float lumaEndP_6;
- lowp float lumaEndN_7;
- highp vec2 offNP_8;
- highp vec2 posP_9;
- highp vec2 posN_10;
- lowp float gradientN_11;
- highp float lengthSign_12;
- lowp vec3 rgbL_13;
- lowp float lumaS_14;
- lowp float lumaN_15;
- highp vec4 tmpvar_16;
- tmpvar_16.zw = vec2(0.0, 0.0);
- tmpvar_16.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy));
- lowp vec4 tmpvar_17;
- tmpvar_17 = textureLod (_MainTex, tmpvar_16.xy, 0.0);
- highp vec4 tmpvar_18;
- tmpvar_18.zw = vec2(0.0, 0.0);
- tmpvar_18.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy));
- lowp vec4 tmpvar_19;
- tmpvar_19 = textureLod (_MainTex, tmpvar_18.xy, 0.0);
- lowp vec4 tmpvar_20;
- tmpvar_20 = textureLod (_MainTex, xlv_TEXCOORD0, 0.0);
- highp vec4 tmpvar_21;
- tmpvar_21.zw = vec2(0.0, 0.0);
- tmpvar_21.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy));
- lowp vec4 tmpvar_22;
- tmpvar_22 = textureLod (_MainTex, tmpvar_21.xy, 0.0);
- highp vec4 tmpvar_23;
- tmpvar_23.zw = vec2(0.0, 0.0);
- tmpvar_23.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy));
- lowp vec4 tmpvar_24;
- tmpvar_24 = textureLod (_MainTex, tmpvar_23.xy, 0.0);
- lowp float tmpvar_25;
- tmpvar_25 = ((tmpvar_17.y * 1.963211) + tmpvar_17.x);
- lumaN_15 = tmpvar_25;
- lowp float tmpvar_26;
- tmpvar_26 = ((tmpvar_19.y * 1.963211) + tmpvar_19.x);
- lowp float tmpvar_27;
- tmpvar_27 = ((tmpvar_20.y * 1.963211) + tmpvar_20.x);
- lowp float tmpvar_28;
- tmpvar_28 = ((tmpvar_22.y * 1.963211) + tmpvar_22.x);
- lowp float tmpvar_29;
- tmpvar_29 = ((tmpvar_24.y * 1.963211) + tmpvar_24.x);
- lumaS_14 = tmpvar_29;
- lowp float tmpvar_30;
- tmpvar_30 = max (max (tmpvar_27, tmpvar_25), max (max (tmpvar_26, tmpvar_29), tmpvar_28));
- lowp float tmpvar_31;
- tmpvar_31 = (tmpvar_30 - min (min (tmpvar_27, tmpvar_25), min (
- min (tmpvar_26, tmpvar_29)
- , tmpvar_28)));
- lowp float tmpvar_32;
- tmpvar_32 = max (0.04166667, (tmpvar_30 * 0.125));
- if ((tmpvar_31 < tmpvar_32)) {
- tmpvar_2 = tmpvar_20.xyz;
- } else {
- lowp float tmpvar_33;
- tmpvar_33 = min (0.75, (max (0.0,
- ((abs((
- (((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * 0.25)
- - tmpvar_27)) / tmpvar_31) - 0.25)
- ) * 1.333333));
- highp vec4 tmpvar_34;
- tmpvar_34.zw = vec2(0.0, 0.0);
- tmpvar_34.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy);
- lowp vec4 tmpvar_35;
- tmpvar_35 = textureLod (_MainTex, tmpvar_34.xy, 0.0);
- highp vec4 tmpvar_36;
- tmpvar_36.zw = vec2(0.0, 0.0);
- tmpvar_36.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy));
- lowp vec4 tmpvar_37;
- tmpvar_37 = textureLod (_MainTex, tmpvar_36.xy, 0.0);
- highp vec4 tmpvar_38;
- tmpvar_38.zw = vec2(0.0, 0.0);
- tmpvar_38.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy));
- lowp vec4 tmpvar_39;
- tmpvar_39 = textureLod (_MainTex, tmpvar_38.xy, 0.0);
- highp vec4 tmpvar_40;
- tmpvar_40.zw = vec2(0.0, 0.0);
- tmpvar_40.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy);
- lowp vec4 tmpvar_41;
- tmpvar_41 = textureLod (_MainTex, tmpvar_40.xy, 0.0);
- rgbL_13 = (((tmpvar_17.xyz + tmpvar_19.xyz) + (tmpvar_20.xyz + tmpvar_22.xyz)) + ((tmpvar_24.xyz + tmpvar_35.xyz) + (
- (tmpvar_37.xyz + tmpvar_39.xyz)
- + tmpvar_41.xyz)));
- rgbL_13 = (rgbL_13 * vec3(0.1111111, 0.1111111, 0.1111111));
- lowp float tmpvar_42;
- tmpvar_42 = ((tmpvar_35.y * 1.963211) + tmpvar_35.x);
- lowp float tmpvar_43;
- tmpvar_43 = ((tmpvar_37.y * 1.963211) + tmpvar_37.x);
- lowp float tmpvar_44;
- tmpvar_44 = ((tmpvar_39.y * 1.963211) + tmpvar_39.x);
- lowp float tmpvar_45;
- tmpvar_45 = ((tmpvar_41.y * 1.963211) + tmpvar_41.x);
- bool tmpvar_46;
- tmpvar_46 = (((
- abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_26)) + (0.25 * tmpvar_44)))
- +
- abs((((0.5 * tmpvar_25) - tmpvar_27) + (0.5 * tmpvar_29)))
- ) + abs(
- (((0.25 * tmpvar_43) + (-0.5 * tmpvar_28)) + (0.25 * tmpvar_45))
- )) >= ((
- abs((((0.25 * tmpvar_42) + (-0.5 * tmpvar_25)) + (0.25 * tmpvar_43)))
- +
- abs((((0.5 * tmpvar_26) - tmpvar_27) + (0.5 * tmpvar_28)))
- ) + abs(
- (((0.25 * tmpvar_44) + (-0.5 * tmpvar_29)) + (0.25 * tmpvar_45))
- )));
- highp float tmpvar_47;
- if (tmpvar_46) {
- tmpvar_47 = -(_MainTex_TexelSize.y);
- } else {
- tmpvar_47 = -(_MainTex_TexelSize.x);
- };
- lengthSign_12 = tmpvar_47;
- if (!(tmpvar_46)) {
- lumaN_15 = tmpvar_26;
- };
- if (!(tmpvar_46)) {
- lumaS_14 = tmpvar_28;
- };
- lowp float tmpvar_48;
- tmpvar_48 = abs((lumaN_15 - tmpvar_27));
- gradientN_11 = tmpvar_48;
- lowp float tmpvar_49;
- tmpvar_49 = abs((lumaS_14 - tmpvar_27));
- lumaN_15 = ((lumaN_15 + tmpvar_27) * 0.5);
- lumaS_14 = ((lumaS_14 + tmpvar_27) * 0.5);
- bool tmpvar_50;
- tmpvar_50 = (tmpvar_48 >= tmpvar_49);
- if (!(tmpvar_50)) {
- lumaN_15 = lumaS_14;
- };
- if (!(tmpvar_50)) {
- gradientN_11 = tmpvar_49;
- };
- if (!(tmpvar_50)) {
- lengthSign_12 = -(tmpvar_47);
- };
- highp float tmpvar_51;
- if (tmpvar_46) {
- tmpvar_51 = 0.0;
- } else {
- tmpvar_51 = (lengthSign_12 * 0.5);
- };
- posN_10.x = (xlv_TEXCOORD0.x + tmpvar_51);
- highp float tmpvar_52;
- if (tmpvar_46) {
- tmpvar_52 = (lengthSign_12 * 0.5);
- } else {
- tmpvar_52 = 0.0;
- };
- posN_10.y = (xlv_TEXCOORD0.y + tmpvar_52);
- gradientN_11 = (gradientN_11 * 0.25);
- posP_9 = posN_10;
- highp vec2 tmpvar_53;
- if (tmpvar_46) {
- highp vec2 tmpvar_54;
- tmpvar_54.y = 0.0;
- tmpvar_54.x = rcpFrame_1.x;
- tmpvar_53 = tmpvar_54;
- } else {
- highp vec2 tmpvar_55;
- tmpvar_55.x = 0.0;
- tmpvar_55.y = rcpFrame_1.y;
- tmpvar_53 = tmpvar_55;
- };
- offNP_8 = tmpvar_53;
- lumaEndN_7 = lumaN_15;
- lumaEndP_6 = lumaN_15;
- doneN_5 = bool(0);
- doneP_4 = bool(0);
- posN_10 = (posN_10 - tmpvar_53);
- posP_9 = (posP_9 + tmpvar_53);
- for (highp int i_3 = 0; i_3 < 16; i_3++) {
- if (!(doneN_5)) {
- lowp vec4 tmpvar_56;
- tmpvar_56 = textureLod (_MainTex, posN_10, 0.0);
- lumaEndN_7 = ((tmpvar_56.y * 1.963211) + tmpvar_56.x);
- };
- if (!(doneP_4)) {
- lowp vec4 tmpvar_57;
- tmpvar_57 = textureLod (_MainTex, posP_9, 0.0);
- lumaEndP_6 = ((tmpvar_57.y * 1.963211) + tmpvar_57.x);
- };
- bool tmpvar_58;
- if (doneN_5) {
- tmpvar_58 = bool(1);
- } else {
- tmpvar_58 = (abs((lumaEndN_7 - lumaN_15)) >= gradientN_11);
- };
- doneN_5 = tmpvar_58;
- bool tmpvar_59;
- if (doneP_4) {
- tmpvar_59 = bool(1);
- } else {
- tmpvar_59 = (abs((lumaEndP_6 - lumaN_15)) >= gradientN_11);
- };
- doneP_4 = tmpvar_59;
- if ((tmpvar_58 && tmpvar_59)) {
- break;
- };
- if (!(tmpvar_58)) {
- posN_10 = (posN_10 - offNP_8);
- };
- if (!(tmpvar_59)) {
- posP_9 = (posP_9 + offNP_8);
- };
- };
- highp float tmpvar_60;
- if (tmpvar_46) {
- tmpvar_60 = (xlv_TEXCOORD0.x - posN_10.x);
- } else {
- tmpvar_60 = (xlv_TEXCOORD0.y - posN_10.y);
- };
- highp float tmpvar_61;
- if (tmpvar_46) {
- tmpvar_61 = (posP_9.x - xlv_TEXCOORD0.x);
- } else {
- tmpvar_61 = (posP_9.y - xlv_TEXCOORD0.y);
- };
- bool tmpvar_62;
- tmpvar_62 = (tmpvar_60 < tmpvar_61);
- lowp float tmpvar_63;
- if (tmpvar_62) {
- tmpvar_63 = lumaEndN_7;
- } else {
- tmpvar_63 = lumaEndP_6;
- };
- lumaEndN_7 = tmpvar_63;
- if ((((tmpvar_27 - lumaN_15) < 0.0) == ((tmpvar_63 - lumaN_15) < 0.0))) {
- lengthSign_12 = 0.0;
- };
- highp float tmpvar_64;
- tmpvar_64 = (tmpvar_61 + tmpvar_60);
- highp float tmpvar_65;
- if (tmpvar_62) {
- tmpvar_65 = tmpvar_60;
- } else {
- tmpvar_65 = tmpvar_61;
- };
- highp float tmpvar_66;
- tmpvar_66 = ((0.5 + (tmpvar_65 *
- (-1.0 / tmpvar_64)
- )) * lengthSign_12);
- highp float tmpvar_67;
- if (tmpvar_46) {
- tmpvar_67 = 0.0;
- } else {
- tmpvar_67 = tmpvar_66;
- };
- highp float tmpvar_68;
- if (tmpvar_46) {
- tmpvar_68 = tmpvar_66;
- } else {
- tmpvar_68 = 0.0;
- };
- highp vec2 tmpvar_69;
- tmpvar_69.x = (xlv_TEXCOORD0.x + tmpvar_67);
- tmpvar_69.y = (xlv_TEXCOORD0.y + tmpvar_68);
- lowp vec4 tmpvar_70;
- tmpvar_70 = textureLod (_MainTex, tmpvar_69, 0.0);
- lowp vec3 tmpvar_71;
- tmpvar_71.x = -(tmpvar_33);
- tmpvar_71.y = -(tmpvar_33);
- tmpvar_71.z = -(tmpvar_33);
- tmpvar_2 = ((tmpvar_71 * tmpvar_70.xyz) + ((rgbL_13 * vec3(tmpvar_33)) + tmpvar_70.xyz));
- };
- lowp vec4 tmpvar_72;
- tmpvar_72.w = 0.0;
- tmpvar_72.xyz = tmpvar_2;
- _fragData = tmpvar_72;
-}
-
-
-// stats: 191 alu 12 tex 26 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _MainTex_TexelSize (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt
deleted file mode 100644
index 7856f19600d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa-preset3-outES3Metal.txt
+++ /dev/null
@@ -1,303 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float2 xlv_TEXCOORD0;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- float4 _MainTex_TexelSize;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float2 rcpFrame_1 = 0;
- rcpFrame_1 = _mtl_u._MainTex_TexelSize.xy;
- half3 tmpvar_2 = 0;
- bool doneP_4 = false;
- bool doneN_5 = false;
- half lumaEndP_6 = 0;
- half lumaEndN_7 = 0;
- float2 offNP_8 = 0;
- float2 posP_9 = 0;
- float2 posN_10 = 0;
- half gradientN_11 = 0;
- float lengthSign_12 = 0;
- half3 rgbL_13 = 0;
- half lumaS_14 = 0;
- half lumaN_15 = 0;
- float4 tmpvar_16 = 0;
- tmpvar_16.zw = float2(0.0, 0.0);
- tmpvar_16.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(0.0, -1.0) * _mtl_u._MainTex_TexelSize.xy));
- half4 tmpvar_17 = 0;
- tmpvar_17 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_16.xy), level(0.0));
- float4 tmpvar_18 = 0;
- tmpvar_18.zw = float2(0.0, 0.0);
- tmpvar_18.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(-1.0, 0.0) * _mtl_u._MainTex_TexelSize.xy));
- half4 tmpvar_19 = 0;
- tmpvar_19 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_18.xy), level(0.0));
- half4 tmpvar_20 = 0;
- tmpvar_20 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0), level(0.0));
- float4 tmpvar_21 = 0;
- tmpvar_21.zw = float2(0.0, 0.0);
- tmpvar_21.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(1.0, 0.0) * _mtl_u._MainTex_TexelSize.xy));
- half4 tmpvar_22 = 0;
- tmpvar_22 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_21.xy), level(0.0));
- float4 tmpvar_23 = 0;
- tmpvar_23.zw = float2(0.0, 0.0);
- tmpvar_23.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(0.0, 1.0) * _mtl_u._MainTex_TexelSize.xy));
- half4 tmpvar_24 = 0;
- tmpvar_24 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_23.xy), level(0.0));
- half tmpvar_25 = 0;
- tmpvar_25 = ((tmpvar_17.y * (half)(1.963211)) + tmpvar_17.x);
- lumaN_15 = tmpvar_25;
- half tmpvar_26 = 0;
- tmpvar_26 = ((tmpvar_19.y * (half)(1.963211)) + tmpvar_19.x);
- half tmpvar_27 = 0;
- tmpvar_27 = ((tmpvar_20.y * (half)(1.963211)) + tmpvar_20.x);
- half tmpvar_28 = 0;
- tmpvar_28 = ((tmpvar_22.y * (half)(1.963211)) + tmpvar_22.x);
- half tmpvar_29 = 0;
- tmpvar_29 = ((tmpvar_24.y * (half)(1.963211)) + tmpvar_24.x);
- lumaS_14 = tmpvar_29;
- half tmpvar_30 = 0;
- tmpvar_30 = max (max (tmpvar_27, tmpvar_25), max (max (tmpvar_26, tmpvar_29), tmpvar_28));
- half tmpvar_31 = 0;
- tmpvar_31 = (tmpvar_30 - min (min (tmpvar_27, tmpvar_25), min (
- min (tmpvar_26, tmpvar_29)
- , tmpvar_28)));
- half tmpvar_32 = 0;
- tmpvar_32 = max ((half)0.04166667, (tmpvar_30 * (half)(0.125)));
- if ((tmpvar_31 < tmpvar_32)) {
- tmpvar_2 = tmpvar_20.xyz;
- } else {
- half tmpvar_33 = 0;
- tmpvar_33 = min ((half)0.75, (max ((half)0.0,
- ((abs((
- (((tmpvar_25 + tmpvar_26) + (tmpvar_28 + tmpvar_29)) * (half)(0.25))
- - tmpvar_27)) / tmpvar_31) - (half)(0.25))
- ) * (half)(1.333333)));
- float4 tmpvar_34 = 0;
- tmpvar_34.zw = float2(0.0, 0.0);
- tmpvar_34.xy = (_mtl_i.xlv_TEXCOORD0 - _mtl_u._MainTex_TexelSize.xy);
- half4 tmpvar_35 = 0;
- tmpvar_35 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_34.xy), level(0.0));
- float4 tmpvar_36 = 0;
- tmpvar_36.zw = float2(0.0, 0.0);
- tmpvar_36.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(1.0, -1.0) * _mtl_u._MainTex_TexelSize.xy));
- half4 tmpvar_37 = 0;
- tmpvar_37 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_36.xy), level(0.0));
- float4 tmpvar_38 = 0;
- tmpvar_38.zw = float2(0.0, 0.0);
- tmpvar_38.xy = (_mtl_i.xlv_TEXCOORD0 + (float2(-1.0, 1.0) * _mtl_u._MainTex_TexelSize.xy));
- half4 tmpvar_39 = 0;
- tmpvar_39 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_38.xy), level(0.0));
- float4 tmpvar_40 = 0;
- tmpvar_40.zw = float2(0.0, 0.0);
- tmpvar_40.xy = (_mtl_i.xlv_TEXCOORD0 + _mtl_u._MainTex_TexelSize.xy);
- half4 tmpvar_41 = 0;
- tmpvar_41 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_40.xy), level(0.0));
- rgbL_13 = (((tmpvar_17.xyz + tmpvar_19.xyz) + (tmpvar_20.xyz + tmpvar_22.xyz)) + ((tmpvar_24.xyz + tmpvar_35.xyz) + (
- (tmpvar_37.xyz + tmpvar_39.xyz)
- + tmpvar_41.xyz)));
- rgbL_13 = (rgbL_13 * (half3)(float3(0.1111111, 0.1111111, 0.1111111)));
- half tmpvar_42 = 0;
- tmpvar_42 = ((tmpvar_35.y * (half)(1.963211)) + tmpvar_35.x);
- half tmpvar_43 = 0;
- tmpvar_43 = ((tmpvar_37.y * (half)(1.963211)) + tmpvar_37.x);
- half tmpvar_44 = 0;
- tmpvar_44 = ((tmpvar_39.y * (half)(1.963211)) + tmpvar_39.x);
- half tmpvar_45 = 0;
- tmpvar_45 = ((tmpvar_41.y * (half)(1.963211)) + tmpvar_41.x);
- bool tmpvar_46 = false;
- tmpvar_46 = (((
- abs(((((half)(0.25) * tmpvar_42) + ((half)(-0.5) * tmpvar_26)) + ((half)(0.25) * tmpvar_44)))
- +
- abs(((((half)(0.5) * tmpvar_25) - tmpvar_27) + ((half)(0.5) * tmpvar_29)))
- ) + abs(
- ((((half)(0.25) * tmpvar_43) + ((half)(-0.5) * tmpvar_28)) + ((half)(0.25) * tmpvar_45))
- )) >= ((
- abs(((((half)(0.25) * tmpvar_42) + ((half)(-0.5) * tmpvar_25)) + ((half)(0.25) * tmpvar_43)))
- +
- abs(((((half)(0.5) * tmpvar_26) - tmpvar_27) + ((half)(0.5) * tmpvar_28)))
- ) + abs(
- ((((half)(0.25) * tmpvar_44) + ((half)(-0.5) * tmpvar_29)) + ((half)(0.25) * tmpvar_45))
- )));
- float tmpvar_47 = 0;
- if (tmpvar_46) {
- tmpvar_47 = -(_mtl_u._MainTex_TexelSize.y);
- } else {
- tmpvar_47 = -(_mtl_u._MainTex_TexelSize.x);
- };
- lengthSign_12 = tmpvar_47;
- if (!(tmpvar_46)) {
- lumaN_15 = tmpvar_26;
- };
- if (!(tmpvar_46)) {
- lumaS_14 = tmpvar_28;
- };
- half tmpvar_48 = 0;
- tmpvar_48 = abs((lumaN_15 - tmpvar_27));
- gradientN_11 = tmpvar_48;
- half tmpvar_49 = 0;
- tmpvar_49 = abs((lumaS_14 - tmpvar_27));
- lumaN_15 = ((lumaN_15 + tmpvar_27) * (half)(0.5));
- lumaS_14 = ((lumaS_14 + tmpvar_27) * (half)(0.5));
- bool tmpvar_50 = false;
- tmpvar_50 = (tmpvar_48 >= tmpvar_49);
- if (!(tmpvar_50)) {
- lumaN_15 = lumaS_14;
- };
- if (!(tmpvar_50)) {
- gradientN_11 = tmpvar_49;
- };
- if (!(tmpvar_50)) {
- lengthSign_12 = -(tmpvar_47);
- };
- float tmpvar_51 = 0;
- if (tmpvar_46) {
- tmpvar_51 = 0.0;
- } else {
- tmpvar_51 = (lengthSign_12 * 0.5);
- };
- posN_10.x = (_mtl_i.xlv_TEXCOORD0.x + tmpvar_51);
- float tmpvar_52 = 0;
- if (tmpvar_46) {
- tmpvar_52 = (lengthSign_12 * 0.5);
- } else {
- tmpvar_52 = 0.0;
- };
- posN_10.y = (_mtl_i.xlv_TEXCOORD0.y + tmpvar_52);
- gradientN_11 = (gradientN_11 * (half)(0.25));
- posP_9 = posN_10;
- float2 tmpvar_53 = 0;
- if (tmpvar_46) {
- float2 tmpvar_54 = 0;
- tmpvar_54.y = 0.0;
- tmpvar_54.x = rcpFrame_1.x;
- tmpvar_53 = tmpvar_54;
- } else {
- float2 tmpvar_55 = 0;
- tmpvar_55.x = 0.0;
- tmpvar_55.y = rcpFrame_1.y;
- tmpvar_53 = tmpvar_55;
- };
- offNP_8 = tmpvar_53;
- lumaEndN_7 = lumaN_15;
- lumaEndP_6 = lumaN_15;
- doneN_5 = bool(bool(0));
- doneP_4 = bool(bool(0));
- posN_10 = (posN_10 - tmpvar_53);
- posP_9 = (posP_9 + tmpvar_53);
- for (int i_3 = 0; i_3 < 16; i_3++) {
- if (!(doneN_5)) {
- half4 tmpvar_56 = 0;
- tmpvar_56 = _MainTex.sample(_mtlsmp__MainTex, (float2)(posN_10), level(0.0));
- lumaEndN_7 = ((tmpvar_56.y * (half)(1.963211)) + tmpvar_56.x);
- };
- if (!(doneP_4)) {
- half4 tmpvar_57 = 0;
- tmpvar_57 = _MainTex.sample(_mtlsmp__MainTex, (float2)(posP_9), level(0.0));
- lumaEndP_6 = ((tmpvar_57.y * (half)(1.963211)) + tmpvar_57.x);
- };
- bool tmpvar_58 = false;
- if (doneN_5) {
- tmpvar_58 = bool(bool(1));
- } else {
- tmpvar_58 = (abs((lumaEndN_7 - lumaN_15)) >= gradientN_11);
- };
- doneN_5 = tmpvar_58;
- bool tmpvar_59 = false;
- if (doneP_4) {
- tmpvar_59 = bool(bool(1));
- } else {
- tmpvar_59 = (abs((lumaEndP_6 - lumaN_15)) >= gradientN_11);
- };
- doneP_4 = tmpvar_59;
- if ((tmpvar_58 && tmpvar_59)) {
- break;
- };
- if (!(tmpvar_58)) {
- posN_10 = (posN_10 - offNP_8);
- };
- if (!(tmpvar_59)) {
- posP_9 = (posP_9 + offNP_8);
- };
- };
- float tmpvar_60 = 0;
- if (tmpvar_46) {
- tmpvar_60 = (_mtl_i.xlv_TEXCOORD0.x - posN_10.x);
- } else {
- tmpvar_60 = (_mtl_i.xlv_TEXCOORD0.y - posN_10.y);
- };
- float tmpvar_61 = 0;
- if (tmpvar_46) {
- tmpvar_61 = (posP_9.x - _mtl_i.xlv_TEXCOORD0.x);
- } else {
- tmpvar_61 = (posP_9.y - _mtl_i.xlv_TEXCOORD0.y);
- };
- bool tmpvar_62 = false;
- tmpvar_62 = (tmpvar_60 < tmpvar_61);
- half tmpvar_63 = 0;
- if (tmpvar_62) {
- tmpvar_63 = lumaEndN_7;
- } else {
- tmpvar_63 = lumaEndP_6;
- };
- lumaEndN_7 = tmpvar_63;
- if ((((tmpvar_27 - lumaN_15) < (half)(0.0)) == ((tmpvar_63 - lumaN_15) < (half)(0.0)))) {
- lengthSign_12 = 0.0;
- };
- float tmpvar_64 = 0;
- tmpvar_64 = (tmpvar_61 + tmpvar_60);
- float tmpvar_65 = 0;
- if (tmpvar_62) {
- tmpvar_65 = tmpvar_60;
- } else {
- tmpvar_65 = tmpvar_61;
- };
- float tmpvar_66 = 0;
- tmpvar_66 = ((0.5 + (tmpvar_65 *
- (-1.0 / tmpvar_64)
- )) * lengthSign_12);
- float tmpvar_67 = 0;
- if (tmpvar_46) {
- tmpvar_67 = 0.0;
- } else {
- tmpvar_67 = tmpvar_66;
- };
- float tmpvar_68 = 0;
- if (tmpvar_46) {
- tmpvar_68 = tmpvar_66;
- } else {
- tmpvar_68 = 0.0;
- };
- float2 tmpvar_69 = 0;
- tmpvar_69.x = (_mtl_i.xlv_TEXCOORD0.x + tmpvar_67);
- tmpvar_69.y = (_mtl_i.xlv_TEXCOORD0.y + tmpvar_68);
- half4 tmpvar_70 = 0;
- tmpvar_70 = _MainTex.sample(_mtlsmp__MainTex, (float2)(tmpvar_69), level(0.0));
- half3 tmpvar_71 = 0;
- tmpvar_71.x = -(tmpvar_33);
- tmpvar_71.y = -(tmpvar_33);
- tmpvar_71.z = -(tmpvar_33);
- tmpvar_2 = ((tmpvar_71 * tmpvar_70.xyz) + ((rgbL_13 * half3(tmpvar_33)) + tmpvar_70.xyz));
- };
- half4 tmpvar_72 = 0;
- tmpvar_72.w = half(0.0);
- tmpvar_72.xyz = tmpvar_2;
- _mtl_o._fragData = tmpvar_72;
- return _mtl_o;
-}
-
-
-// stats: 191 alu 12 tex 26 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// uniforms: 1 (total size: 16)
-// #0: _MainTex_TexelSize (high float) 4x1 [-1] loc 0
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-in.txt
deleted file mode 100644
index 2cfc7a413f7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-in.txt
+++ /dev/null
@@ -1,107 +0,0 @@
-#ifdef GL_ES
-#define texture2DLod texture2DLodEXT
-#endif
-#extension GL_ARB_shader_texture_lod : require
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return texture2DLod( s, coord.xy, coord.w);
-}
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec4 uvPosPos;
-};
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_TexelSize;
-float FxaaLuma( in vec4 rgba );
-vec4 FxaaPixelShader( in vec2 pos, in vec4 fxaaConsolePosPos, in sampler2D tex, in sampler2D fxaaConsole360TexExpBiasNegOne, in sampler2D fxaaConsole360TexExpBiasNegTwo, in vec2 fxaaQualityRcpFrame, in vec4 fxaaConsoleRcpFrameOpt, in vec4 fxaaConsoleRcpFrameOpt2, in vec4 fxaaConsole360RcpFrameOpt2, in float fxaaQualitySubpix, in float fxaaQualityEdgeThreshold, in float fxaaQualityEdgeThresholdMin, in float fxaaConsoleEdgeSharpness, in float fxaaConsoleEdgeThreshold, in float fxaaConsoleEdgeThresholdMin, in vec4 fxaaConsole360ConstDir );
-vec4 xlat_main( in v2f i );
-float FxaaLuma( in vec4 rgba ) {
- return rgba.y ;
-}
-vec4 FxaaPixelShader( in vec2 pos, in vec4 fxaaConsolePosPos, in sampler2D tex, in sampler2D fxaaConsole360TexExpBiasNegOne, in sampler2D fxaaConsole360TexExpBiasNegTwo, in vec2 fxaaQualityRcpFrame, in vec4 fxaaConsoleRcpFrameOpt, in vec4 fxaaConsoleRcpFrameOpt2, in vec4 fxaaConsole360RcpFrameOpt2, in float fxaaQualitySubpix, in float fxaaQualityEdgeThreshold, in float fxaaQualityEdgeThresholdMin, in float fxaaConsoleEdgeSharpness, in float fxaaConsoleEdgeThreshold, in float fxaaConsoleEdgeThresholdMin, in vec4 fxaaConsole360ConstDir ) {
- float lumaNw;
- float lumaSw;
- float lumaNe;
- float lumaSe;
- vec4 rgbyM;
- float lumaM;
- float lumaMaxNwSw;
- float lumaMinNwSw;
- float lumaMaxNeSe;
- float lumaMinNeSe;
- float lumaMax;
- float lumaMin;
- float lumaMaxScaled;
- float lumaMinM;
- float lumaMaxScaledClamped;
- float lumaMaxM;
- float dirSwMinusNe;
- float lumaMaxSubMinM;
- float dirSeMinusNw;
- vec2 dir;
- vec2 dir1;
- vec4 rgbyN1;
- vec4 rgbyP1;
- float dirAbsMinTimesC;
- vec2 dir2;
- vec4 rgbyN2;
- vec4 rgbyP2;
- vec4 rgbyA;
- vec4 rgbyB;
- bool twoTap;
- lumaNw = FxaaLuma( xll_tex2Dlod( tex, vec4( fxaaConsolePosPos.xy , 0.00000, 0.00000)));
- lumaSw = FxaaLuma( xll_tex2Dlod( tex, vec4( fxaaConsolePosPos.xw , 0.00000, 0.00000)));
- lumaNe = FxaaLuma( xll_tex2Dlod( tex, vec4( fxaaConsolePosPos.zy , 0.00000, 0.00000)));
- lumaSe = FxaaLuma( xll_tex2Dlod( tex, vec4( fxaaConsolePosPos.zw , 0.00000, 0.00000)));
- rgbyM = xll_tex2Dlod( tex, vec4( pos.xy , 0.00000, 0.00000));
- lumaM = rgbyM.y ;
- lumaMaxNwSw = max( lumaNw, lumaSw);
- lumaNe += 0.00260417;
- lumaMinNwSw = min( lumaNw, lumaSw);
- lumaMaxNeSe = max( lumaNe, lumaSe);
- lumaMinNeSe = min( lumaNe, lumaSe);
- lumaMax = max( lumaMaxNeSe, lumaMaxNwSw);
- lumaMin = min( lumaMinNeSe, lumaMinNwSw);
- lumaMaxScaled = (lumaMax * fxaaConsoleEdgeThreshold);
- lumaMinM = min( lumaMin, lumaM);
- lumaMaxScaledClamped = max( fxaaConsoleEdgeThresholdMin, lumaMaxScaled);
- lumaMaxM = max( lumaMax, lumaM);
- dirSwMinusNe = (lumaSw - lumaNe);
- lumaMaxSubMinM = (lumaMaxM - lumaMinM);
- dirSeMinusNw = (lumaSe - lumaNw);
- if ( (lumaMaxSubMinM < lumaMaxScaledClamped) ){
- return rgbyM;
- }
- dir.x = (dirSwMinusNe + dirSeMinusNw);
- dir.y = (dirSwMinusNe - dirSeMinusNw);
- dir1 = normalize( dir.xy );
- rgbyN1 = xll_tex2Dlod( tex, vec4( (pos.xy - (dir1 * fxaaConsoleRcpFrameOpt.zw )), 0.00000, 0.00000));
- rgbyP1 = xll_tex2Dlod( tex, vec4( (pos.xy + (dir1 * fxaaConsoleRcpFrameOpt.zw )), 0.00000, 0.00000));
- dirAbsMinTimesC = (min( abs( dir1.x ), abs( dir1.y )) * fxaaConsoleEdgeSharpness);
- dir2 = clamp( (dir1.xy / dirAbsMinTimesC), vec2( -2.00000), vec2( 2.00000));
- rgbyN2 = xll_tex2Dlod( tex, vec4( (pos.xy - (dir2 * fxaaConsoleRcpFrameOpt2.zw )), 0.00000, 0.00000));
- rgbyP2 = xll_tex2Dlod( tex, vec4( (pos.xy + (dir2 * fxaaConsoleRcpFrameOpt2.zw )), 0.00000, 0.00000));
- rgbyA = (rgbyN1 + rgbyP1);
- rgbyB = (((rgbyN2 + rgbyP2) * 0.250000) + (rgbyA * 0.250000));
- twoTap = ((rgbyB.y < lumaMin) || (rgbyB.y > lumaMax));
- if ( twoTap ){
- rgbyB.xyz = (rgbyA.xyz * 0.500000);
- }
- return rgbyB;
-}
-vec4 xlat_main( in v2f i ) {
- float fxaaN = 0.500000;
- return FxaaPixelShader( i.uv, i.uvPosPos, _MainTex, _MainTex, _MainTex, _MainTex_TexelSize.xy , (_MainTex_TexelSize.xyxy * vec4( ( -fxaaN ), ( -fxaaN ), fxaaN, fxaaN)), (_MainTex_TexelSize.xyxy * vec4( -2.00000, -2.00000, 2.00000, 2.00000)), (_MainTex_TexelSize.xyxy * vec4( 8.00000, 8.00000, -4.00000, -4.00000)), 0.750000, 0.166000, 0.0833000, 8.00000, 0.125000, 0.0500000, vec4( 1.00000, -1.00000, 0.250000, -0.250000));
-}
-varying vec4 xlv_SV_POSITION;
-varying vec2 xlv_TEXCOORD0;
-varying vec4 xlv_TEXCOORD1;
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4( xlv_SV_POSITION);
- xlt_i.uv = vec2( xlv_TEXCOORD0);
- xlt_i.uvPosPos = vec4( xlv_TEXCOORD1);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-inES.txt
deleted file mode 100644
index 95bc7142c0a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-inES.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-#ifdef GL_ES
-#define texture2DLod texture2DLodEXT
-#endif
-#extension GL_EXT_shader_texture_lod : require
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return texture2DLod( s, coord.xy, coord.w);
-}
-struct v2f {
- highp vec4 pos;
- highp vec2 uv;
- highp vec4 uvPosPos;
-};
-uniform sampler2D _MainTex;
-uniform highp vec4 _MainTex_TexelSize;
-highp float FxaaLuma( in lowp vec4 rgba );
-lowp vec4 FxaaPixelShader( in highp vec2 pos, in highp vec4 fxaaConsolePosPos, in sampler2D tex, in sampler2D fxaaConsole360TexExpBiasNegOne, in sampler2D fxaaConsole360TexExpBiasNegTwo, in highp vec2 fxaaQualityRcpFrame, in highp vec4 fxaaConsoleRcpFrameOpt, in highp vec4 fxaaConsoleRcpFrameOpt2, in highp vec4 fxaaConsole360RcpFrameOpt2, in highp float fxaaQualitySubpix, in highp float fxaaQualityEdgeThreshold, in highp float fxaaQualityEdgeThresholdMin, in highp float fxaaConsoleEdgeSharpness, in highp float fxaaConsoleEdgeThreshold, in highp float fxaaConsoleEdgeThresholdMin, in highp vec4 fxaaConsole360ConstDir );
-lowp vec4 xlat_main( in v2f i );
-highp float FxaaLuma( in lowp vec4 rgba ) {
- return rgba.y ;
-}
-lowp vec4 FxaaPixelShader( in highp vec2 pos, in highp vec4 fxaaConsolePosPos, in sampler2D tex, in sampler2D fxaaConsole360TexExpBiasNegOne, in sampler2D fxaaConsole360TexExpBiasNegTwo, in highp vec2 fxaaQualityRcpFrame, in highp vec4 fxaaConsoleRcpFrameOpt, in highp vec4 fxaaConsoleRcpFrameOpt2, in highp vec4 fxaaConsole360RcpFrameOpt2, in highp float fxaaQualitySubpix, in highp float fxaaQualityEdgeThreshold, in highp float fxaaQualityEdgeThresholdMin, in highp float fxaaConsoleEdgeSharpness, in highp float fxaaConsoleEdgeThreshold, in highp float fxaaConsoleEdgeThresholdMin, in highp vec4 fxaaConsole360ConstDir ) {
- highp float lumaNw;
- highp float lumaSw;
- highp float lumaNe;
- highp float lumaSe;
- lowp vec4 rgbyM;
- highp float lumaM;
- highp float lumaMaxNwSw;
- highp float lumaMinNwSw;
- highp float lumaMaxNeSe;
- highp float lumaMinNeSe;
- highp float lumaMax;
- highp float lumaMin;
- highp float lumaMaxScaled;
- highp float lumaMinM;
- highp float lumaMaxScaledClamped;
- highp float lumaMaxM;
- highp float dirSwMinusNe;
- highp float lumaMaxSubMinM;
- highp float dirSeMinusNw;
- highp vec2 dir;
- highp vec2 dir1;
- lowp vec4 rgbyN1;
- lowp vec4 rgbyP1;
- highp float dirAbsMinTimesC;
- highp vec2 dir2;
- lowp vec4 rgbyN2;
- lowp vec4 rgbyP2;
- lowp vec4 rgbyA;
- lowp vec4 rgbyB;
- bool twoTap;
- lumaNw = FxaaLuma( xll_tex2Dlod( tex, vec4( fxaaConsolePosPos.xy , 0.00000, 0.00000)));
- lumaSw = FxaaLuma( xll_tex2Dlod( tex, vec4( fxaaConsolePosPos.xw , 0.00000, 0.00000)));
- lumaNe = FxaaLuma( xll_tex2Dlod( tex, vec4( fxaaConsolePosPos.zy , 0.00000, 0.00000)));
- lumaSe = FxaaLuma( xll_tex2Dlod( tex, vec4( fxaaConsolePosPos.zw , 0.00000, 0.00000)));
- rgbyM = xll_tex2Dlod( tex, vec4( pos.xy , 0.00000, 0.00000));
- lumaM = rgbyM.y ;
- lumaMaxNwSw = max( lumaNw, lumaSw);
- lumaNe += 0.00260417;
- lumaMinNwSw = min( lumaNw, lumaSw);
- lumaMaxNeSe = max( lumaNe, lumaSe);
- lumaMinNeSe = min( lumaNe, lumaSe);
- lumaMax = max( lumaMaxNeSe, lumaMaxNwSw);
- lumaMin = min( lumaMinNeSe, lumaMinNwSw);
- lumaMaxScaled = (lumaMax * fxaaConsoleEdgeThreshold);
- lumaMinM = min( lumaMin, lumaM);
- lumaMaxScaledClamped = max( fxaaConsoleEdgeThresholdMin, lumaMaxScaled);
- lumaMaxM = max( lumaMax, lumaM);
- dirSwMinusNe = (lumaSw - lumaNe);
- lumaMaxSubMinM = (lumaMaxM - lumaMinM);
- dirSeMinusNw = (lumaSe - lumaNw);
- if ( (lumaMaxSubMinM < lumaMaxScaledClamped) ){
- return rgbyM;
- }
- dir.x = (dirSwMinusNe + dirSeMinusNw);
- dir.y = (dirSwMinusNe - dirSeMinusNw);
- dir1 = normalize( dir.xy );
- rgbyN1 = xll_tex2Dlod( tex, vec4( (pos.xy - (dir1 * fxaaConsoleRcpFrameOpt.zw )), 0.00000, 0.00000));
- rgbyP1 = xll_tex2Dlod( tex, vec4( (pos.xy + (dir1 * fxaaConsoleRcpFrameOpt.zw )), 0.00000, 0.00000));
- dirAbsMinTimesC = (min( abs( dir1.x ), abs( dir1.y )) * fxaaConsoleEdgeSharpness);
- dir2 = clamp( (dir1.xy / dirAbsMinTimesC), vec2( -2.00000), vec2( 2.00000));
- rgbyN2 = xll_tex2Dlod( tex, vec4( (pos.xy - (dir2 * fxaaConsoleRcpFrameOpt2.zw )), 0.00000, 0.00000));
- rgbyP2 = xll_tex2Dlod( tex, vec4( (pos.xy + (dir2 * fxaaConsoleRcpFrameOpt2.zw )), 0.00000, 0.00000));
- rgbyA = (rgbyN1 + rgbyP1);
- rgbyB = (((rgbyN2 + rgbyP2) * 0.250000) + (rgbyA * 0.250000));
- twoTap = ((rgbyB.y < lumaMin) || (rgbyB.y > lumaMax));
- if ( twoTap ){
- rgbyB.xyz = (rgbyA.xyz * 0.500000);
- }
- return rgbyB;
-}
-lowp vec4 xlat_main( in v2f i ) {
- highp float fxaaN = 0.500000;
- return FxaaPixelShader( i.uv, i.uvPosPos, _MainTex, _MainTex, _MainTex, _MainTex_TexelSize.xy , (_MainTex_TexelSize.xyxy * vec4( ( -fxaaN ), ( -fxaaN ), fxaaN, fxaaN)), (_MainTex_TexelSize.xyxy * vec4( -2.00000, -2.00000, 2.00000, 2.00000)), (_MainTex_TexelSize.xyxy * vec4( 8.00000, 8.00000, -4.00000, -4.00000)), 0.750000, 0.166000, 0.0833000, 8.00000, 0.125000, 0.0500000, vec4( 1.00000, -1.00000, 0.250000, -0.250000));
-}
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec4 xlv_TEXCOORD1;
-void main() {
- lowp vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( xlv_TEXCOORD0);
- xlt_i.uvPosPos = vec4( xlv_TEXCOORD1);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-} \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-out.txt
deleted file mode 100644
index cbb0d2755f1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-out.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-#extension GL_ARB_shader_texture_lod : enable
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_TexelSize;
-varying vec2 xlv_TEXCOORD0;
-varying vec4 xlv_TEXCOORD1;
-void main ()
-{
- vec4 fxaaConsoleRcpFrameOpt_1;
- fxaaConsoleRcpFrameOpt_1 = (_MainTex_TexelSize.xyxy * vec4(-0.5, -0.5, 0.5, 0.5));
- vec4 fxaaConsoleRcpFrameOpt2_2;
- fxaaConsoleRcpFrameOpt2_2 = (_MainTex_TexelSize.xyxy * vec4(-2.0, -2.0, 2.0, 2.0));
- vec4 tmpvar_3;
- vec4 rgbyB_4;
- vec4 rgbyA_5;
- vec2 dir_6;
- float dirSeMinusNw_7;
- float lumaMaxSubMinM_8;
- float dirSwMinusNe_9;
- float lumaNe_10;
- vec4 tmpvar_11;
- tmpvar_11 = texture2DLod (_MainTex, xlv_TEXCOORD1.xy, 0.0);
- vec4 tmpvar_12;
- tmpvar_12 = texture2DLod (_MainTex, xlv_TEXCOORD1.xw, 0.0);
- vec4 tmpvar_13;
- tmpvar_13 = texture2DLod (_MainTex, xlv_TEXCOORD1.zw, 0.0);
- vec4 tmpvar_14;
- tmpvar_14 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0);
- lumaNe_10 = (texture2DLod (_MainTex, xlv_TEXCOORD1.zy, 0.0).y + 0.00260417);
- float tmpvar_15;
- tmpvar_15 = max (max (lumaNe_10, tmpvar_13.y), max (tmpvar_11.y, tmpvar_12.y));
- float tmpvar_16;
- tmpvar_16 = min (min (lumaNe_10, tmpvar_13.y), min (tmpvar_11.y, tmpvar_12.y));
- float tmpvar_17;
- tmpvar_17 = max (0.05, (tmpvar_15 * 0.125));
- dirSwMinusNe_9 = (tmpvar_12.y - lumaNe_10);
- lumaMaxSubMinM_8 = (max (tmpvar_15, tmpvar_14.y) - min (tmpvar_16, tmpvar_14.y));
- dirSeMinusNw_7 = (tmpvar_13.y - tmpvar_11.y);
- if ((lumaMaxSubMinM_8 < tmpvar_17)) {
- tmpvar_3 = tmpvar_14;
- } else {
- dir_6.x = (dirSwMinusNe_9 + dirSeMinusNw_7);
- dir_6.y = (dirSwMinusNe_9 - dirSeMinusNw_7);
- vec2 tmpvar_18;
- tmpvar_18 = normalize(dir_6);
- vec4 tmpvar_19;
- tmpvar_19.zw = vec2(0.0, 0.0);
- tmpvar_19.xy = (xlv_TEXCOORD0 - (tmpvar_18 * fxaaConsoleRcpFrameOpt_1.zw));
- vec4 tmpvar_20;
- tmpvar_20.zw = vec2(0.0, 0.0);
- tmpvar_20.xy = (xlv_TEXCOORD0 + (tmpvar_18 * fxaaConsoleRcpFrameOpt_1.zw));
- vec2 tmpvar_21;
- tmpvar_21 = clamp ((tmpvar_18 / (
- min (abs(tmpvar_18.x), abs(tmpvar_18.y))
- * 8.0)), vec2(-2.0, -2.0), vec2(2.0, 2.0));
- vec4 tmpvar_22;
- tmpvar_22.zw = vec2(0.0, 0.0);
- tmpvar_22.xy = (xlv_TEXCOORD0 - (tmpvar_21 * fxaaConsoleRcpFrameOpt2_2.zw));
- vec4 tmpvar_23;
- tmpvar_23.zw = vec2(0.0, 0.0);
- tmpvar_23.xy = (xlv_TEXCOORD0 + (tmpvar_21 * fxaaConsoleRcpFrameOpt2_2.zw));
- rgbyA_5 = (texture2DLod (_MainTex, tmpvar_19.xy, 0.0) + texture2DLod (_MainTex, tmpvar_20.xy, 0.0));
- rgbyB_4 = (((texture2DLod (_MainTex, tmpvar_22.xy, 0.0) + texture2DLod (_MainTex, tmpvar_23.xy, 0.0)) * 0.25) + (rgbyA_5 * 0.25));
- if (((rgbyB_4.y < tmpvar_16) || (rgbyB_4.y > tmpvar_15))) {
- rgbyB_4.xyz = (rgbyA_5.xyz * 0.5);
- };
- tmpvar_3 = rgbyB_4;
- };
- gl_FragData[0] = tmpvar_3;
-}
-
-
-// stats: 47 alu 9 tex 2 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 4x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _MainTex_TexelSize (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt
deleted file mode 100644
index 8405c1fa905..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-consolepc-outES.txt
+++ /dev/null
@@ -1,100 +0,0 @@
-#extension GL_EXT_shader_texture_lod : enable
-lowp vec4 impl_low_texture2DLodEXT(lowp sampler2D sampler, highp vec2 coord, mediump float lod)
-{
-#if defined(GL_EXT_shader_texture_lod)
- return texture2DLodEXT(sampler, coord, lod);
-#else
- return texture2D(sampler, coord, lod);
-#endif
-}
-
-uniform sampler2D _MainTex;
-uniform highp vec4 _MainTex_TexelSize;
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec4 xlv_TEXCOORD1;
-void main ()
-{
- highp vec4 fxaaConsoleRcpFrameOpt_1;
- fxaaConsoleRcpFrameOpt_1 = (_MainTex_TexelSize.xyxy * vec4(-0.5, -0.5, 0.5, 0.5));
- highp vec4 fxaaConsoleRcpFrameOpt2_2;
- fxaaConsoleRcpFrameOpt2_2 = (_MainTex_TexelSize.xyxy * vec4(-2.0, -2.0, 2.0, 2.0));
- lowp vec4 tmpvar_3;
- lowp vec4 rgbyB_4;
- lowp vec4 rgbyA_5;
- highp vec2 dir_6;
- highp float dirSeMinusNw_7;
- highp float lumaMaxSubMinM_8;
- highp float dirSwMinusNe_9;
- highp float lumaM_10;
- highp float lumaNe_11;
- lowp vec4 tmpvar_12;
- tmpvar_12 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD1.xy, 0.0);
- highp float tmpvar_13;
- tmpvar_13 = tmpvar_12.y;
- lowp vec4 tmpvar_14;
- tmpvar_14 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD1.xw, 0.0);
- highp float tmpvar_15;
- tmpvar_15 = tmpvar_14.y;
- lowp vec4 tmpvar_16;
- tmpvar_16 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zy, 0.0);
- highp float tmpvar_17;
- tmpvar_17 = tmpvar_16.y;
- lowp vec4 tmpvar_18;
- tmpvar_18 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD1.zw, 0.0);
- highp float tmpvar_19;
- tmpvar_19 = tmpvar_18.y;
- lowp vec4 tmpvar_20;
- tmpvar_20 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0);
- lumaM_10 = tmpvar_20.y;
- lumaNe_11 = (tmpvar_17 + 0.00260417);
- highp float tmpvar_21;
- tmpvar_21 = max (max (lumaNe_11, tmpvar_19), max (tmpvar_13, tmpvar_15));
- highp float tmpvar_22;
- tmpvar_22 = min (min (lumaNe_11, tmpvar_19), min (tmpvar_13, tmpvar_15));
- highp float tmpvar_23;
- tmpvar_23 = max (0.05, (tmpvar_21 * 0.125));
- dirSwMinusNe_9 = (tmpvar_15 - lumaNe_11);
- lumaMaxSubMinM_8 = (max (tmpvar_21, lumaM_10) - min (tmpvar_22, lumaM_10));
- dirSeMinusNw_7 = (tmpvar_19 - tmpvar_13);
- if ((lumaMaxSubMinM_8 < tmpvar_23)) {
- tmpvar_3 = tmpvar_20;
- } else {
- dir_6.x = (dirSwMinusNe_9 + dirSeMinusNw_7);
- dir_6.y = (dirSwMinusNe_9 - dirSeMinusNw_7);
- highp vec2 tmpvar_24;
- tmpvar_24 = normalize(dir_6);
- highp vec4 tmpvar_25;
- tmpvar_25.zw = vec2(0.0, 0.0);
- tmpvar_25.xy = (xlv_TEXCOORD0 - (tmpvar_24 * fxaaConsoleRcpFrameOpt_1.zw));
- highp vec4 tmpvar_26;
- tmpvar_26.zw = vec2(0.0, 0.0);
- tmpvar_26.xy = (xlv_TEXCOORD0 + (tmpvar_24 * fxaaConsoleRcpFrameOpt_1.zw));
- highp vec2 tmpvar_27;
- tmpvar_27 = clamp ((tmpvar_24 / (
- min (abs(tmpvar_24.x), abs(tmpvar_24.y))
- * 8.0)), vec2(-2.0, -2.0), vec2(2.0, 2.0));
- highp vec4 tmpvar_28;
- tmpvar_28.zw = vec2(0.0, 0.0);
- tmpvar_28.xy = (xlv_TEXCOORD0 - (tmpvar_27 * fxaaConsoleRcpFrameOpt2_2.zw));
- highp vec4 tmpvar_29;
- tmpvar_29.zw = vec2(0.0, 0.0);
- tmpvar_29.xy = (xlv_TEXCOORD0 + (tmpvar_27 * fxaaConsoleRcpFrameOpt2_2.zw));
- rgbyA_5 = (impl_low_texture2DLodEXT (_MainTex, tmpvar_25.xy, 0.0) + impl_low_texture2DLodEXT (_MainTex, tmpvar_26.xy, 0.0));
- rgbyB_4 = (((impl_low_texture2DLodEXT (_MainTex, tmpvar_28.xy, 0.0) + impl_low_texture2DLodEXT (_MainTex, tmpvar_29.xy, 0.0)) * 0.25) + (rgbyA_5 * 0.25));
- if (((rgbyB_4.y < tmpvar_22) || (rgbyB_4.y > tmpvar_21))) {
- rgbyB_4.xyz = (rgbyA_5.xyz * 0.5);
- };
- tmpvar_3 = rgbyB_4;
- };
- gl_FragData[0] = tmpvar_3;
-}
-
-
-// stats: 47 alu 9 tex 2 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 4x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _MainTex_TexelSize (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-in.txt
deleted file mode 100644
index eef6faa5268..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-in.txt
+++ /dev/null
@@ -1,567 +0,0 @@
-#ifdef GL_ES
-#define texture2DLod texture2DLodEXT
-#endif
-#extension GL_ARB_shader_texture_lod : require
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return texture2DLod( s, coord.xy, coord.w);
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec4 uvPosPos;
-};
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_TexelSize;
-float FxaaLuma( in vec4 rgba );
-vec4 FxaaPixelShader( in vec2 pos, in vec4 fxaaConsolePosPos, in sampler2D tex, in sampler2D fxaaConsole360TexExpBiasNegOne, in sampler2D fxaaConsole360TexExpBiasNegTwo, in vec2 fxaaQualityRcpFrame, in vec4 fxaaConsoleRcpFrameOpt, in vec4 fxaaConsoleRcpFrameOpt2, in vec4 fxaaConsole360RcpFrameOpt2, in float fxaaQualitySubpix, in float fxaaQualityEdgeThreshold, in float fxaaQualityEdgeThresholdMin, in float fxaaConsoleEdgeSharpness, in float fxaaConsoleEdgeThreshold, in float fxaaConsoleEdgeThresholdMin, in vec4 fxaaConsole360ConstDir );
-vec4 xlat_main( in v2f i );
-float FxaaLuma( in vec4 rgba ) {
- return rgba.w ;
-}
-vec4 FxaaPixelShader( in vec2 pos, in vec4 fxaaConsolePosPos, in sampler2D tex, in sampler2D fxaaConsole360TexExpBiasNegOne, in sampler2D fxaaConsole360TexExpBiasNegTwo, in vec2 fxaaQualityRcpFrame, in vec4 fxaaConsoleRcpFrameOpt, in vec4 fxaaConsoleRcpFrameOpt2, in vec4 fxaaConsole360RcpFrameOpt2, in float fxaaQualitySubpix, in float fxaaQualityEdgeThreshold, in float fxaaQualityEdgeThresholdMin, in float fxaaConsoleEdgeSharpness, in float fxaaConsoleEdgeThreshold, in float fxaaConsoleEdgeThresholdMin, in vec4 fxaaConsole360ConstDir ) {
- vec2 posM;
- vec4 rgbyM;
- float lumaS;
- float lumaE;
- float lumaN;
- float lumaW;
- float maxSM;
- float minSM;
- float maxESM;
- float minESM;
- float maxWN;
- float minWN;
- float rangeMax;
- float rangeMin;
- float rangeMaxScaled;
- float range;
- float rangeMaxClamped;
- bool earlyExit;
- float lumaNW;
- float lumaSE;
- float lumaNE;
- float lumaSW;
- float lumaNS;
- float lumaWE;
- float subpixRcpRange;
- float subpixNSWE;
- float edgeHorz1;
- float edgeVert1;
- float lumaNESE;
- float lumaNWNE;
- float edgeHorz2;
- float edgeVert2;
- float lumaNWSW;
- float lumaSWSE;
- float edgeHorz4;
- float edgeVert4;
- float edgeHorz3;
- float edgeVert3;
- float edgeHorz;
- float edgeVert;
- float subpixNWSWNESE;
- float lengthSign;
- bool horzSpan;
- float subpixA;
- float subpixB;
- float gradientN;
- float gradientS;
- float lumaNN;
- float lumaSS;
- bool pairN;
- float gradient;
- float subpixC;
- vec2 posB;
- vec2 offNP;
- vec2 posN;
- vec2 posP;
- float subpixD;
- float lumaEndN;
- float subpixE;
- float lumaEndP;
- float gradientScaled;
- float lumaMM;
- float subpixF;
- bool lumaMLTZero;
- bool doneN;
- bool doneP;
- bool doneNP;
- float dstN;
- float dstP;
- bool goodSpanN;
- float spanLength;
- bool goodSpanP;
- float spanLengthRcp;
- bool directionN;
- float dst;
- bool goodSpan;
- float subpixG;
- float pixelOffset;
- float subpixH;
- float pixelOffsetGood;
- float pixelOffsetSubpix;
- posM.x = pos.x ;
- posM.y = pos.y ;
- rgbyM = xll_tex2Dlod( tex, vec4( posM, 0.00000, 0.00000));
- lumaS = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 0.00000, 1.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaE = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 1.00000, 0.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaN = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 0.00000, -1.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaW = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( -1.00000, 0.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- maxSM = max( lumaS, rgbyM.w );
- minSM = min( lumaS, rgbyM.w );
- maxESM = max( lumaE, maxSM);
- minESM = min( lumaE, minSM);
- maxWN = max( lumaN, lumaW);
- minWN = min( lumaN, lumaW);
- rangeMax = max( maxWN, maxESM);
- rangeMin = min( minWN, minESM);
- rangeMaxScaled = (rangeMax * fxaaQualityEdgeThreshold);
- range = (rangeMax - rangeMin);
- rangeMaxClamped = max( fxaaQualityEdgeThresholdMin, rangeMaxScaled);
- earlyExit = (range < rangeMaxClamped);
- if ( earlyExit ){
- return rgbyM;
- }
- lumaNW = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( -1.00000, -1.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaSE = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 1.00000, 1.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaNE = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 1.00000, -1.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaSW = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( -1.00000, 1.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaNS = (lumaN + lumaS);
- lumaWE = (lumaW + lumaE);
- subpixRcpRange = (1.00000 / range);
- subpixNSWE = (lumaNS + lumaWE);
- edgeHorz1 = ((-2.00000 * rgbyM.w ) + lumaNS);
- edgeVert1 = ((-2.00000 * rgbyM.w ) + lumaWE);
- lumaNESE = (lumaNE + lumaSE);
- lumaNWNE = (lumaNW + lumaNE);
- edgeHorz2 = ((-2.00000 * lumaE) + lumaNESE);
- edgeVert2 = ((-2.00000 * lumaN) + lumaNWNE);
- lumaNWSW = (lumaNW + lumaSW);
- lumaSWSE = (lumaSW + lumaSE);
- edgeHorz4 = ((abs( edgeHorz1 ) * 2.00000) + abs( edgeHorz2 ));
- edgeVert4 = ((abs( edgeVert1 ) * 2.00000) + abs( edgeVert2 ));
- edgeHorz3 = ((-2.00000 * lumaW) + lumaNWSW);
- edgeVert3 = ((-2.00000 * lumaS) + lumaSWSE);
- edgeHorz = (abs( edgeHorz3 ) + edgeHorz4);
- edgeVert = (abs( edgeVert3 ) + edgeVert4);
- subpixNWSWNESE = (lumaNWSW + lumaNESE);
- lengthSign = fxaaQualityRcpFrame.x ;
- horzSpan = (edgeHorz >= edgeVert);
- subpixA = ((subpixNSWE * 2.00000) + subpixNWSWNESE);
- if ( ( !horzSpan ) ){
- lumaN = lumaW;
- }
- if ( ( !horzSpan ) ){
- lumaS = lumaE;
- }
- if ( horzSpan ){
- lengthSign = fxaaQualityRcpFrame.y ;
- }
- subpixB = ((subpixA * 0.0833333) - rgbyM.w );
- gradientN = (lumaN - rgbyM.w );
- gradientS = (lumaS - rgbyM.w );
- lumaNN = (lumaN + rgbyM.w );
- lumaSS = (lumaS + rgbyM.w );
- pairN = (abs( gradientN ) >= abs( gradientS ));
- gradient = max( abs( gradientN ), abs( gradientS ));
- if ( pairN ){
- lengthSign = ( -lengthSign );
- }
- subpixC = xll_saturate( (abs( subpixB ) * subpixRcpRange) );
- posB.x = posM.x ;
- posB.y = posM.y ;
- offNP.x = (( ( !horzSpan ) ) ? ( 0.00000 ) : ( fxaaQualityRcpFrame.x ));
- offNP.y = (( horzSpan ) ? ( 0.00000 ) : ( fxaaQualityRcpFrame.y ));
- if ( ( !horzSpan ) ){
- posB.x += (lengthSign * 0.500000);
- }
- if ( horzSpan ){
- posB.y += (lengthSign * 0.500000);
- }
- posN.x = (posB.x - (offNP.x * 1.00000));
- posN.y = (posB.y - (offNP.y * 1.00000));
- posP.x = (posB.x + (offNP.x * 1.00000));
- posP.y = (posB.y + (offNP.y * 1.00000));
- subpixD = ((-2.00000 * subpixC) + 3.00000);
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN, 0.00000, 0.00000)));
- subpixE = (subpixC * subpixC);
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP, 0.00000, 0.00000)));
- if ( ( !pairN ) ){
- lumaNN = lumaSS;
- }
- gradientScaled = ((gradient * 1.00000) / 4.00000);
- lumaMM = (rgbyM.w - (lumaNN * 0.500000));
- subpixF = (subpixD * subpixE);
- lumaMLTZero = (lumaMM < 0.00000);
- lumaEndN -= (lumaNN * 0.500000);
- lumaEndP -= (lumaNN * 0.500000);
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 1.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 1.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 1.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 1.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 1.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 1.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 1.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 1.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 1.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 1.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 1.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 1.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 1.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 1.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 1.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 1.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 1.50000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 1.50000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 1.50000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 1.50000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 2.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 2.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 2.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 2.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 2.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 2.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 2.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 2.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 2.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 2.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 2.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 2.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 2.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 2.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 2.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 2.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 4.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 4.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 4.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 4.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 8.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 8.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 8.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 8.00000);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- dstN = (posM.x - posN.x );
- dstP = (posP.x - posM.x );
- if ( ( !horzSpan ) ){
- dstN = (posM.y - posN.y );
- }
- if ( ( !horzSpan ) ){
- dstP = (posP.y - posM.y );
- }
- goodSpanN = ((lumaEndN < 0.00000) != lumaMLTZero);
- spanLength = (dstP + dstN);
- goodSpanP = ((lumaEndP < 0.00000) != lumaMLTZero);
- spanLengthRcp = (1.00000 / spanLength);
- directionN = (dstN < dstP);
- dst = min( dstN, dstP);
- goodSpan = (( directionN ) ? ( goodSpanN ) : ( goodSpanP ));
- subpixG = (subpixF * subpixF);
- pixelOffset = ((dst * ( -spanLengthRcp )) + 0.500000);
- subpixH = (subpixG * fxaaQualitySubpix);
- pixelOffsetGood = (( goodSpan ) ? ( pixelOffset ) : ( 0.00000 ));
- pixelOffsetSubpix = max( pixelOffsetGood, subpixH);
- if ( ( !horzSpan ) ){
- posM.x += (pixelOffsetSubpix * lengthSign);
- }
- if ( horzSpan ){
- posM.y += (pixelOffsetSubpix * lengthSign);
- }
- return vec4( xll_tex2Dlod( tex, vec4( posM, 0.00000, 0.00000)).xyz , rgbyM.w );
-}
-vec4 xlat_main( in v2f i ) {
- float fxaaN = 0.500000;
- return FxaaPixelShader( i.uv, i.uvPosPos, _MainTex, _MainTex, _MainTex, _MainTex_TexelSize.xy , (_MainTex_TexelSize.xyxy * vec4( ( -fxaaN ), ( -fxaaN ), fxaaN, fxaaN)), (_MainTex_TexelSize.xyxy * vec4( -2.00000, -2.00000, 2.00000, 2.00000)), (_MainTex_TexelSize.xyxy * vec4( 8.00000, 8.00000, -4.00000, -4.00000)), 0.750000, 0.166000, 0.0833000, 8.00000, 0.125000, 0.0500000, vec4( 1.00000, -1.00000, 0.250000, -0.250000));
-}
-varying vec4 xlv_SV_POSITION;
-varying vec2 xlv_TEXCOORD0;
-varying vec4 xlv_TEXCOORD1;
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4( xlv_SV_POSITION);
- xlt_i.uv = vec2( xlv_TEXCOORD0);
- xlt_i.uvPosPos = vec4( xlv_TEXCOORD1);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-inES.txt
deleted file mode 100644
index bade4bfc7e5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-inES.txt
+++ /dev/null
@@ -1,567 +0,0 @@
-#ifdef GL_ES
-#define texture2DLod texture2DLodEXT
-#endif
-#extension GL_EXT_shader_texture_lod : require
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return texture2DLod( s, coord.xy, coord.w);
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f {
- highp vec4 pos;
- highp vec2 uv;
- highp vec4 uvPosPos;
-};
-uniform sampler2D _MainTex;
-uniform highp vec4 _MainTex_TexelSize;
-highp float FxaaLuma( in highp vec4 rgba );
-highp vec4 FxaaPixelShader( in highp vec2 pos, in highp vec4 fxaaConsolePosPos, in sampler2D tex, in sampler2D fxaaConsole360TexExpBiasNegOne, in sampler2D fxaaConsole360TexExpBiasNegTwo, in highp vec2 fxaaQualityRcpFrame, in highp vec4 fxaaConsoleRcpFrameOpt, in highp vec4 fxaaConsoleRcpFrameOpt2, in highp vec4 fxaaConsole360RcpFrameOpt2, in highp float fxaaQualitySubpix, in highp float fxaaQualityEdgeThreshold, in highp float fxaaQualityEdgeThresholdMin, in highp float fxaaConsoleEdgeSharpness, in highp float fxaaConsoleEdgeThreshold, in highp float fxaaConsoleEdgeThresholdMin, in highp vec4 fxaaConsole360ConstDir );
-highp vec4 xlat_main( in v2f i );
-highp float FxaaLuma( in highp vec4 rgba ) {
- return rgba.w ;
-}
-highp vec4 FxaaPixelShader( in highp vec2 pos, in highp vec4 fxaaConsolePosPos, in sampler2D tex, in sampler2D fxaaConsole360TexExpBiasNegOne, in sampler2D fxaaConsole360TexExpBiasNegTwo, in highp vec2 fxaaQualityRcpFrame, in highp vec4 fxaaConsoleRcpFrameOpt, in highp vec4 fxaaConsoleRcpFrameOpt2, in highp vec4 fxaaConsole360RcpFrameOpt2, in highp float fxaaQualitySubpix, in highp float fxaaQualityEdgeThreshold, in highp float fxaaQualityEdgeThresholdMin, in highp float fxaaConsoleEdgeSharpness, in highp float fxaaConsoleEdgeThreshold, in highp float fxaaConsoleEdgeThresholdMin, in highp vec4 fxaaConsole360ConstDir ) {
- highp vec2 posM;
- highp vec4 rgbyM;
- highp float lumaS;
- highp float lumaE;
- highp float lumaN;
- highp float lumaW;
- highp float maxSM;
- highp float minSM;
- highp float maxESM;
- highp float minESM;
- highp float maxWN;
- highp float minWN;
- highp float rangeMax;
- highp float rangeMin;
- highp float rangeMaxScaled;
- highp float range;
- highp float rangeMaxClamped;
- bool earlyExit;
- highp float lumaNW;
- highp float lumaSE;
- highp float lumaNE;
- highp float lumaSW;
- highp float lumaNS;
- highp float lumaWE;
- highp float subpixRcpRange;
- highp float subpixNSWE;
- highp float edgeHorz1;
- highp float edgeVert1;
- highp float lumaNESE;
- highp float lumaNWNE;
- highp float edgeHorz2;
- highp float edgeVert2;
- highp float lumaNWSW;
- highp float lumaSWSE;
- highp float edgeHorz4;
- highp float edgeVert4;
- highp float edgeHorz3;
- highp float edgeVert3;
- highp float edgeHorz;
- highp float edgeVert;
- highp float subpixNWSWNESE;
- highp float lengthSign;
- bool horzSpan;
- highp float subpixA;
- highp float subpixB;
- highp float gradientN;
- highp float gradientS;
- highp float lumaNN;
- highp float lumaSS;
- bool pairN;
- highp float gradient;
- highp float subpixC;
- highp vec2 posB;
- highp vec2 offNP;
- highp vec2 posN;
- highp vec2 posP;
- highp float subpixD;
- highp float lumaEndN;
- highp float subpixE;
- highp float lumaEndP;
- highp float gradientScaled;
- highp float lumaMM;
- highp float subpixF;
- bool lumaMLTZero;
- bool doneN;
- bool doneP;
- bool doneNP;
- highp float dstN;
- highp float dstP;
- bool goodSpanN;
- highp float spanLength;
- bool goodSpanP;
- highp float spanLengthRcp;
- bool directionN;
- highp float dst;
- bool goodSpan;
- highp float subpixG;
- highp float pixelOffset;
- highp float subpixH;
- highp float pixelOffsetGood;
- highp float pixelOffsetSubpix;
- posM.x = pos.x ;
- posM.y = pos.y ;
- rgbyM = xll_tex2Dlod( tex, vec4( posM, 0.00000, 0.00000));
- lumaS = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 0.00000, 1.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaE = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 1.00000, 0.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaN = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 0.00000, -1.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaW = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( -1.00000, 0.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- maxSM = max( lumaS, rgbyM.w );
- minSM = min( lumaS, rgbyM.w );
- maxESM = max( lumaE, maxSM);
- minESM = min( lumaE, minSM);
- maxWN = max( lumaN, lumaW);
- minWN = min( lumaN, lumaW);
- rangeMax = max( maxWN, maxESM);
- rangeMin = min( minWN, minESM);
- rangeMaxScaled = (rangeMax * fxaaQualityEdgeThreshold);
- range = (rangeMax - rangeMin);
- rangeMaxClamped = max( fxaaQualityEdgeThresholdMin, rangeMaxScaled);
- earlyExit = (range < rangeMaxClamped);
- if ( earlyExit ){
- return rgbyM;
- }
- lumaNW = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( -1.00000, -1.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaSE = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 1.00000, 1.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaNE = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( 1.00000, -1.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaSW = FxaaLuma( xll_tex2Dlod( tex, vec4( (posM + (vec2( -1.00000, 1.00000) * fxaaQualityRcpFrame.xy )), 0.00000, 0.00000)));
- lumaNS = (lumaN + lumaS);
- lumaWE = (lumaW + lumaE);
- subpixRcpRange = (1.00000 / range);
- subpixNSWE = (lumaNS + lumaWE);
- edgeHorz1 = ((-2.00000 * rgbyM.w ) + lumaNS);
- edgeVert1 = ((-2.00000 * rgbyM.w ) + lumaWE);
- lumaNESE = (lumaNE + lumaSE);
- lumaNWNE = (lumaNW + lumaNE);
- edgeHorz2 = ((-2.00000 * lumaE) + lumaNESE);
- edgeVert2 = ((-2.00000 * lumaN) + lumaNWNE);
- lumaNWSW = (lumaNW + lumaSW);
- lumaSWSE = (lumaSW + lumaSE);
- edgeHorz4 = ((abs( edgeHorz1 ) * 2.00000) + abs( edgeHorz2 ));
- edgeVert4 = ((abs( edgeVert1 ) * 2.00000) + abs( edgeVert2 ));
- edgeHorz3 = ((-2.00000 * lumaW) + lumaNWSW);
- edgeVert3 = ((-2.00000 * lumaS) + lumaSWSE);
- edgeHorz = (abs( edgeHorz3 ) + edgeHorz4);
- edgeVert = (abs( edgeVert3 ) + edgeVert4);
- subpixNWSWNESE = (lumaNWSW + lumaNESE);
- lengthSign = fxaaQualityRcpFrame.x ;
- horzSpan = (edgeHorz >= edgeVert);
- subpixA = ((subpixNSWE * 2.00000) + subpixNWSWNESE);
- if ( ( !horzSpan ) ){
- lumaN = lumaW;
- }
- if ( ( !horzSpan ) ){
- lumaS = lumaE;
- }
- if ( horzSpan ){
- lengthSign = fxaaQualityRcpFrame.y ;
- }
- subpixB = ((subpixA * 0.0833333) - rgbyM.w );
- gradientN = (lumaN - rgbyM.w );
- gradientS = (lumaS - rgbyM.w );
- lumaNN = (lumaN + rgbyM.w );
- lumaSS = (lumaS + rgbyM.w );
- pairN = (abs( gradientN ) >= abs( gradientS ));
- gradient = max( abs( gradientN ), abs( gradientS ));
- if ( pairN ){
- lengthSign = ( -lengthSign );
- }
- subpixC = xll_saturate( (abs( subpixB ) * subpixRcpRange) );
- posB.x = posM.x ;
- posB.y = posM.y ;
- offNP.x = (( ( !horzSpan ) ) ? ( 0.00000 ) : ( fxaaQualityRcpFrame.x ));
- offNP.y = (( horzSpan ) ? ( 0.00000 ) : ( fxaaQualityRcpFrame.y ));
- if ( ( !horzSpan ) ){
- posB.x += (lengthSign * 0.500000);
- }
- if ( horzSpan ){
- posB.y += (lengthSign * 0.500000);
- }
- posN.x = (posB.x - (offNP.x * 1.00000));
- posN.y = (posB.y - (offNP.y * 1.00000));
- posP.x = (posB.x + (offNP.x * 1.00000));
- posP.y = (posB.y + (offNP.y * 1.00000));
- subpixD = ((-2.00000 * subpixC) + 3.00000);
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN, 0.00000, 0.00000)));
- subpixE = (subpixC * subpixC);
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP, 0.00000, 0.00000)));
- if ( ( !pairN ) ){
- lumaNN = lumaSS;
- }
- gradientScaled = ((gradient * 1.00000) / 4.00000);
- lumaMM = (rgbyM.w - (lumaNN * 0.500000));
- subpixF = (subpixD * subpixE);
- lumaMLTZero = (lumaMM < 0.00000);
- lumaEndN -= (lumaNN * 0.500000);
- lumaEndP -= (lumaNN * 0.500000);
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 1.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 1.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 1.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 1.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 1.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 1.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 1.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 1.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 1.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 1.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 1.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 1.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 1.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 1.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 1.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 1.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 1.50000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 1.50000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 1.50000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 1.50000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 2.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 2.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 2.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 2.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 2.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 2.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 2.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 2.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 2.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 2.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 2.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 2.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 2.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 2.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 2.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 2.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 4.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 4.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 4.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 4.00000);
- }
- if ( doneNP ){
- if ( ( !doneN ) ){
- lumaEndN = FxaaLuma( xll_tex2Dlod( tex, vec4( posN.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneP ) ){
- lumaEndP = FxaaLuma( xll_tex2Dlod( tex, vec4( posP.xy , 0.00000, 0.00000)));
- }
- if ( ( !doneN ) ){
- lumaEndN = (lumaEndN - (lumaNN * 0.500000));
- }
- if ( ( !doneP ) ){
- lumaEndP = (lumaEndP - (lumaNN * 0.500000));
- }
- doneN = (abs( lumaEndN ) >= gradientScaled);
- doneP = (abs( lumaEndP ) >= gradientScaled);
- if ( ( !doneN ) ){
- posN.x -= (offNP.x * 8.00000);
- }
- if ( ( !doneN ) ){
- posN.y -= (offNP.y * 8.00000);
- }
- doneNP = (( !doneN ) || ( !doneP ));
- if ( ( !doneP ) ){
- posP.x += (offNP.x * 8.00000);
- }
- if ( ( !doneP ) ){
- posP.y += (offNP.y * 8.00000);
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- dstN = (posM.x - posN.x );
- dstP = (posP.x - posM.x );
- if ( ( !horzSpan ) ){
- dstN = (posM.y - posN.y );
- }
- if ( ( !horzSpan ) ){
- dstP = (posP.y - posM.y );
- }
- goodSpanN = ((lumaEndN < 0.00000) != lumaMLTZero);
- spanLength = (dstP + dstN);
- goodSpanP = ((lumaEndP < 0.00000) != lumaMLTZero);
- spanLengthRcp = (1.00000 / spanLength);
- directionN = (dstN < dstP);
- dst = min( dstN, dstP);
- goodSpan = (( directionN ) ? ( goodSpanN ) : ( goodSpanP ));
- subpixG = (subpixF * subpixF);
- pixelOffset = ((dst * ( -spanLengthRcp )) + 0.500000);
- subpixH = (subpixG * fxaaQualitySubpix);
- pixelOffsetGood = (( goodSpan ) ? ( pixelOffset ) : ( 0.00000 ));
- pixelOffsetSubpix = max( pixelOffsetGood, subpixH);
- if ( ( !horzSpan ) ){
- posM.x += (pixelOffsetSubpix * lengthSign);
- }
- if ( horzSpan ){
- posM.y += (pixelOffsetSubpix * lengthSign);
- }
- return vec4( xll_tex2Dlod( tex, vec4( posM, 0.00000, 0.00000)).xyz , rgbyM.w );
-}
-highp vec4 xlat_main( in v2f i ) {
- highp float fxaaN = 0.500000;
- return FxaaPixelShader( i.uv, i.uvPosPos, _MainTex, _MainTex, _MainTex, _MainTex_TexelSize.xy , (_MainTex_TexelSize.xyxy * vec4( ( -fxaaN ), ( -fxaaN ), fxaaN, fxaaN)), (_MainTex_TexelSize.xyxy * vec4( -2.00000, -2.00000, 2.00000, 2.00000)), (_MainTex_TexelSize.xyxy * vec4( 8.00000, 8.00000, -4.00000, -4.00000)), 0.750000, 0.166000, 0.0833000, 8.00000, 0.125000, 0.0500000, vec4( 1.00000, -1.00000, 0.250000, -0.250000));
-}
-varying highp vec4 xlv_SV_POSITION;
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec4 xlv_TEXCOORD1;
-void main() {
- highp vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4( xlv_SV_POSITION);
- xlt_i.uv = vec2( xlv_TEXCOORD0);
- xlt_i.uvPosPos = vec4( xlv_TEXCOORD1);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-out.txt
deleted file mode 100644
index a962de142b2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-out.txt
+++ /dev/null
@@ -1,541 +0,0 @@
-#extension GL_ARB_shader_texture_lod : enable
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_TexelSize;
-varying vec2 xlv_TEXCOORD0;
-void main ()
-{
- vec2 fxaaQualityRcpFrame_1;
- fxaaQualityRcpFrame_1 = _MainTex_TexelSize.xy;
- vec4 tmpvar_2;
- float subpixH_3;
- float pixelOffset_4;
- float spanLengthRcp_5;
- bool goodSpanP_6;
- bool goodSpanN_7;
- float dstP_8;
- float dstN_9;
- bool doneNP_10;
- bool doneP_11;
- bool doneN_12;
- bool lumaMLTZero_13;
- float subpixF_14;
- float gradientScaled_15;
- float lumaEndP_16;
- float subpixE_17;
- float lumaEndN_18;
- float subpixD_19;
- vec2 posP_20;
- vec2 posN_21;
- vec2 posB_22;
- bool pairN_23;
- float lumaSS_24;
- float lumaNN_25;
- float gradientS_26;
- float gradientN_27;
- float subpixB_28;
- float subpixA_29;
- bool horzSpan_30;
- float lengthSign_31;
- float lumaNWSW_32;
- float lumaNESE_33;
- float subpixRcpRange_34;
- float lumaWE_35;
- float lumaNS_36;
- float range_37;
- float lumaN_38;
- float lumaS_39;
- vec2 posM_40;
- posM_40 = xlv_TEXCOORD0;
- vec4 tmpvar_41;
- tmpvar_41 = texture2DLod (_MainTex, xlv_TEXCOORD0, 0.0);
- vec4 tmpvar_42;
- tmpvar_42.zw = vec2(0.0, 0.0);
- tmpvar_42.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_43;
- tmpvar_43 = texture2DLod (_MainTex, tmpvar_42.xy, 0.0);
- lumaS_39 = tmpvar_43.w;
- vec4 tmpvar_44;
- tmpvar_44.zw = vec2(0.0, 0.0);
- tmpvar_44.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_45;
- tmpvar_45 = texture2DLod (_MainTex, tmpvar_44.xy, 0.0);
- float tmpvar_46;
- tmpvar_46 = tmpvar_45.w;
- vec4 tmpvar_47;
- tmpvar_47.zw = vec2(0.0, 0.0);
- tmpvar_47.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_48;
- tmpvar_48 = texture2DLod (_MainTex, tmpvar_47.xy, 0.0);
- lumaN_38 = tmpvar_48.w;
- vec4 tmpvar_49;
- tmpvar_49.zw = vec2(0.0, 0.0);
- tmpvar_49.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_50;
- tmpvar_50 = texture2DLod (_MainTex, tmpvar_49.xy, 0.0);
- float tmpvar_51;
- tmpvar_51 = tmpvar_50.w;
- float tmpvar_52;
- tmpvar_52 = max (max (tmpvar_48.w, tmpvar_50.w), max (max (tmpvar_45.w, tmpvar_43.w), tmpvar_41.w));
- range_37 = (tmpvar_52 - min (min (tmpvar_48.w, tmpvar_50.w), min (
- min (tmpvar_45.w, tmpvar_43.w)
- , tmpvar_41.w)));
- if ((range_37 < max (0.0833, (tmpvar_52 * 0.166)))) {
- tmpvar_2 = tmpvar_41;
- } else {
- vec4 tmpvar_53;
- tmpvar_53.zw = vec2(0.0, 0.0);
- tmpvar_53.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy);
- vec4 tmpvar_54;
- tmpvar_54 = texture2DLod (_MainTex, tmpvar_53.xy, 0.0);
- vec4 tmpvar_55;
- tmpvar_55.zw = vec2(0.0, 0.0);
- tmpvar_55.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy);
- vec4 tmpvar_56;
- tmpvar_56 = texture2DLod (_MainTex, tmpvar_55.xy, 0.0);
- vec4 tmpvar_57;
- tmpvar_57.zw = vec2(0.0, 0.0);
- tmpvar_57.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_58;
- tmpvar_58 = texture2DLod (_MainTex, tmpvar_57.xy, 0.0);
- vec4 tmpvar_59;
- tmpvar_59.zw = vec2(0.0, 0.0);
- tmpvar_59.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy));
- vec4 tmpvar_60;
- tmpvar_60 = texture2DLod (_MainTex, tmpvar_59.xy, 0.0);
- lumaNS_36 = (tmpvar_48.w + tmpvar_43.w);
- lumaWE_35 = (tmpvar_50.w + tmpvar_45.w);
- subpixRcpRange_34 = (1.0/(range_37));
- lumaNESE_33 = (tmpvar_58.w + tmpvar_56.w);
- lumaNWSW_32 = (tmpvar_54.w + tmpvar_60.w);
- lengthSign_31 = fxaaQualityRcpFrame_1.x;
- horzSpan_30 = ((abs(
- ((-2.0 * tmpvar_50.w) + lumaNWSW_32)
- ) + (
- (abs(((-2.0 * tmpvar_41.w) + lumaNS_36)) * 2.0)
- +
- abs(((-2.0 * tmpvar_45.w) + lumaNESE_33))
- )) >= (abs(
- ((-2.0 * tmpvar_43.w) + (tmpvar_60.w + tmpvar_56.w))
- ) + (
- (abs(((-2.0 * tmpvar_41.w) + lumaWE_35)) * 2.0)
- +
- abs(((-2.0 * tmpvar_48.w) + (tmpvar_54.w + tmpvar_58.w)))
- )));
- subpixA_29 = (((lumaNS_36 + lumaWE_35) * 2.0) + (lumaNWSW_32 + lumaNESE_33));
- if (!(horzSpan_30)) {
- lumaN_38 = tmpvar_51;
- };
- if (!(horzSpan_30)) {
- lumaS_39 = tmpvar_46;
- };
- if (horzSpan_30) {
- lengthSign_31 = fxaaQualityRcpFrame_1.y;
- };
- subpixB_28 = ((subpixA_29 * 0.0833333) - tmpvar_41.w);
- gradientN_27 = (lumaN_38 - tmpvar_41.w);
- gradientS_26 = (lumaS_39 - tmpvar_41.w);
- lumaNN_25 = (lumaN_38 + tmpvar_41.w);
- lumaSS_24 = (lumaS_39 + tmpvar_41.w);
- pairN_23 = (abs(gradientN_27) >= abs(gradientS_26));
- float tmpvar_61;
- tmpvar_61 = max (abs(gradientN_27), abs(gradientS_26));
- if (pairN_23) {
- lengthSign_31 = -(lengthSign_31);
- };
- float tmpvar_62;
- tmpvar_62 = clamp ((abs(subpixB_28) * subpixRcpRange_34), 0.0, 1.0);
- posB_22 = posM_40;
- float tmpvar_63;
- if (!(horzSpan_30)) {
- tmpvar_63 = 0.0;
- } else {
- tmpvar_63 = fxaaQualityRcpFrame_1.x;
- };
- float tmpvar_64;
- if (horzSpan_30) {
- tmpvar_64 = 0.0;
- } else {
- tmpvar_64 = fxaaQualityRcpFrame_1.y;
- };
- if (!(horzSpan_30)) {
- posB_22.x = (xlv_TEXCOORD0.x + (lengthSign_31 * 0.5));
- };
- if (horzSpan_30) {
- posB_22.y = (xlv_TEXCOORD0.y + (lengthSign_31 * 0.5));
- };
- posN_21.x = (posB_22.x - tmpvar_63);
- posN_21.y = (posB_22.y - tmpvar_64);
- posP_20.x = (posB_22.x + tmpvar_63);
- posP_20.y = (posB_22.y + tmpvar_64);
- subpixD_19 = ((-2.0 * tmpvar_62) + 3.0);
- vec4 tmpvar_65;
- tmpvar_65 = texture2DLod (_MainTex, posN_21, 0.0);
- lumaEndN_18 = tmpvar_65.w;
- subpixE_17 = (tmpvar_62 * tmpvar_62);
- vec4 tmpvar_66;
- tmpvar_66 = texture2DLod (_MainTex, posP_20, 0.0);
- lumaEndP_16 = tmpvar_66.w;
- if (!(pairN_23)) {
- lumaNN_25 = lumaSS_24;
- };
- gradientScaled_15 = (tmpvar_61 / 4.0);
- subpixF_14 = (subpixD_19 * subpixE_17);
- lumaMLTZero_13 = ((tmpvar_41.w - (lumaNN_25 * 0.5)) < 0.0);
- lumaEndN_18 = (tmpvar_65.w - (lumaNN_25 * 0.5));
- lumaEndP_16 = (tmpvar_66.w - (lumaNN_25 * 0.5));
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - tmpvar_63);
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - tmpvar_64);
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + tmpvar_63);
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + tmpvar_64);
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w;
- };
- if (!(doneP_11)) {
- lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - tmpvar_63);
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - tmpvar_64);
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + tmpvar_63);
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + tmpvar_64);
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w;
- };
- if (!(doneP_11)) {
- lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - tmpvar_63);
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - tmpvar_64);
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + tmpvar_63);
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + tmpvar_64);
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w;
- };
- if (!(doneP_11)) {
- lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - tmpvar_63);
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - tmpvar_64);
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + tmpvar_63);
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + tmpvar_64);
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w;
- };
- if (!(doneP_11)) {
- lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_63 * 1.5));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_64 * 1.5));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_63 * 1.5));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_64 * 1.5));
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w;
- };
- if (!(doneP_11)) {
- lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_63 * 2.0));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_64 * 2.0));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_63 * 2.0));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_64 * 2.0));
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w;
- };
- if (!(doneP_11)) {
- lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_63 * 2.0));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_64 * 2.0));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_63 * 2.0));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_64 * 2.0));
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w;
- };
- if (!(doneP_11)) {
- lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_63 * 2.0));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_64 * 2.0));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_63 * 2.0));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_64 * 2.0));
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w;
- };
- if (!(doneP_11)) {
- lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_63 * 2.0));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_64 * 2.0));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_63 * 2.0));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_64 * 2.0));
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w;
- };
- if (!(doneP_11)) {
- lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_63 * 4.0));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_64 * 4.0));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_63 * 4.0));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_64 * 4.0));
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- lumaEndN_18 = texture2DLod (_MainTex, posN_21, 0.0).w;
- };
- if (!(doneP_11)) {
- lumaEndP_16 = texture2DLod (_MainTex, posP_20, 0.0).w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_63 * 8.0));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_64 * 8.0));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_63 * 8.0));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_64 * 8.0));
- };
- };
- };
- };
- };
- };
- };
- };
- };
- };
- };
- dstN_9 = (xlv_TEXCOORD0.x - posN_21.x);
- dstP_8 = (posP_20.x - xlv_TEXCOORD0.x);
- if (!(horzSpan_30)) {
- dstN_9 = (xlv_TEXCOORD0.y - posN_21.y);
- };
- if (!(horzSpan_30)) {
- dstP_8 = (posP_20.y - xlv_TEXCOORD0.y);
- };
- goodSpanN_7 = ((lumaEndN_18 < 0.0) != lumaMLTZero_13);
- goodSpanP_6 = ((lumaEndP_16 < 0.0) != lumaMLTZero_13);
- spanLengthRcp_5 = (1.0/((dstP_8 + dstN_9)));
- float tmpvar_67;
- tmpvar_67 = min (dstN_9, dstP_8);
- bool tmpvar_68;
- if ((dstN_9 < dstP_8)) {
- tmpvar_68 = goodSpanN_7;
- } else {
- tmpvar_68 = goodSpanP_6;
- };
- pixelOffset_4 = ((tmpvar_67 * -(spanLengthRcp_5)) + 0.5);
- subpixH_3 = ((subpixF_14 * subpixF_14) * 0.75);
- float tmpvar_69;
- if (tmpvar_68) {
- tmpvar_69 = pixelOffset_4;
- } else {
- tmpvar_69 = 0.0;
- };
- float tmpvar_70;
- tmpvar_70 = max (tmpvar_69, subpixH_3);
- if (!(horzSpan_30)) {
- posM_40.x = (xlv_TEXCOORD0.x + (tmpvar_70 * lengthSign_31));
- };
- if (horzSpan_30) {
- posM_40.y = (xlv_TEXCOORD0.y + (tmpvar_70 * lengthSign_31));
- };
- vec4 tmpvar_71;
- tmpvar_71.xyz = texture2DLod (_MainTex, posM_40, 0.0).xyz;
- tmpvar_71.w = tmpvar_41.w;
- tmpvar_2 = tmpvar_71;
- };
- gl_FragData[0] = tmpvar_2;
-}
-
-
-// stats: 401 alu 32 tex 110 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _MainTex_TexelSize (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt
deleted file mode 100644
index 376ff3ebd06..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-fxaa3-11-pc39-outES.txt
+++ /dev/null
@@ -1,654 +0,0 @@
-#extension GL_EXT_shader_texture_lod : enable
-lowp vec4 impl_low_texture2DLodEXT(lowp sampler2D sampler, highp vec2 coord, mediump float lod)
-{
-#if defined(GL_EXT_shader_texture_lod)
- return texture2DLodEXT(sampler, coord, lod);
-#else
- return texture2D(sampler, coord, lod);
-#endif
-}
-
-uniform sampler2D _MainTex;
-uniform highp vec4 _MainTex_TexelSize;
-varying highp vec2 xlv_TEXCOORD0;
-void main ()
-{
- highp vec2 fxaaQualityRcpFrame_1;
- fxaaQualityRcpFrame_1 = _MainTex_TexelSize.xy;
- highp vec4 tmpvar_2;
- highp float subpixH_3;
- highp float pixelOffset_4;
- highp float spanLengthRcp_5;
- bool goodSpanP_6;
- bool goodSpanN_7;
- highp float dstP_8;
- highp float dstN_9;
- bool doneNP_10;
- bool doneP_11;
- bool doneN_12;
- bool lumaMLTZero_13;
- highp float subpixF_14;
- highp float gradientScaled_15;
- highp float lumaEndP_16;
- highp float subpixE_17;
- highp float lumaEndN_18;
- highp float subpixD_19;
- highp vec2 posP_20;
- highp vec2 posN_21;
- highp vec2 posB_22;
- bool pairN_23;
- highp float lumaSS_24;
- highp float lumaNN_25;
- highp float gradientS_26;
- highp float gradientN_27;
- highp float subpixB_28;
- highp float subpixA_29;
- bool horzSpan_30;
- highp float lengthSign_31;
- highp float lumaNWSW_32;
- highp float lumaNESE_33;
- highp float subpixRcpRange_34;
- highp float lumaWE_35;
- highp float lumaNS_36;
- highp float range_37;
- highp float lumaN_38;
- highp float lumaS_39;
- highp vec2 posM_40;
- posM_40 = xlv_TEXCOORD0;
- highp vec4 tmpvar_41;
- lowp vec4 tmpvar_42;
- tmpvar_42 = impl_low_texture2DLodEXT (_MainTex, xlv_TEXCOORD0, 0.0);
- tmpvar_41 = tmpvar_42;
- highp vec4 tmpvar_43;
- tmpvar_43.zw = vec2(0.0, 0.0);
- tmpvar_43.xy = (xlv_TEXCOORD0 + (vec2(0.0, 1.0) * _MainTex_TexelSize.xy));
- highp vec4 tmpvar_44;
- lowp vec4 tmpvar_45;
- tmpvar_45 = impl_low_texture2DLodEXT (_MainTex, tmpvar_43.xy, 0.0);
- tmpvar_44 = tmpvar_45;
- lumaS_39 = tmpvar_44.w;
- highp vec4 tmpvar_46;
- tmpvar_46.zw = vec2(0.0, 0.0);
- tmpvar_46.xy = (xlv_TEXCOORD0 + (vec2(1.0, 0.0) * _MainTex_TexelSize.xy));
- highp vec4 tmpvar_47;
- lowp vec4 tmpvar_48;
- tmpvar_48 = impl_low_texture2DLodEXT (_MainTex, tmpvar_46.xy, 0.0);
- tmpvar_47 = tmpvar_48;
- highp float tmpvar_49;
- tmpvar_49 = tmpvar_47.w;
- highp vec4 tmpvar_50;
- tmpvar_50.zw = vec2(0.0, 0.0);
- tmpvar_50.xy = (xlv_TEXCOORD0 + (vec2(0.0, -1.0) * _MainTex_TexelSize.xy));
- highp vec4 tmpvar_51;
- lowp vec4 tmpvar_52;
- tmpvar_52 = impl_low_texture2DLodEXT (_MainTex, tmpvar_50.xy, 0.0);
- tmpvar_51 = tmpvar_52;
- lumaN_38 = tmpvar_51.w;
- highp vec4 tmpvar_53;
- tmpvar_53.zw = vec2(0.0, 0.0);
- tmpvar_53.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 0.0) * _MainTex_TexelSize.xy));
- highp vec4 tmpvar_54;
- lowp vec4 tmpvar_55;
- tmpvar_55 = impl_low_texture2DLodEXT (_MainTex, tmpvar_53.xy, 0.0);
- tmpvar_54 = tmpvar_55;
- highp float tmpvar_56;
- tmpvar_56 = tmpvar_54.w;
- highp float tmpvar_57;
- tmpvar_57 = max (max (tmpvar_51.w, tmpvar_54.w), max (max (tmpvar_47.w, tmpvar_44.w), tmpvar_41.w));
- range_37 = (tmpvar_57 - min (min (tmpvar_51.w, tmpvar_54.w), min (
- min (tmpvar_47.w, tmpvar_44.w)
- , tmpvar_41.w)));
- if ((range_37 < max (0.0833, (tmpvar_57 * 0.166)))) {
- tmpvar_2 = tmpvar_41;
- } else {
- highp vec4 tmpvar_58;
- tmpvar_58.zw = vec2(0.0, 0.0);
- tmpvar_58.xy = (xlv_TEXCOORD0 - _MainTex_TexelSize.xy);
- highp vec4 tmpvar_59;
- lowp vec4 tmpvar_60;
- tmpvar_60 = impl_low_texture2DLodEXT (_MainTex, tmpvar_58.xy, 0.0);
- tmpvar_59 = tmpvar_60;
- highp vec4 tmpvar_61;
- tmpvar_61.zw = vec2(0.0, 0.0);
- tmpvar_61.xy = (xlv_TEXCOORD0 + _MainTex_TexelSize.xy);
- highp vec4 tmpvar_62;
- lowp vec4 tmpvar_63;
- tmpvar_63 = impl_low_texture2DLodEXT (_MainTex, tmpvar_61.xy, 0.0);
- tmpvar_62 = tmpvar_63;
- highp vec4 tmpvar_64;
- tmpvar_64.zw = vec2(0.0, 0.0);
- tmpvar_64.xy = (xlv_TEXCOORD0 + (vec2(1.0, -1.0) * _MainTex_TexelSize.xy));
- highp vec4 tmpvar_65;
- lowp vec4 tmpvar_66;
- tmpvar_66 = impl_low_texture2DLodEXT (_MainTex, tmpvar_64.xy, 0.0);
- tmpvar_65 = tmpvar_66;
- highp vec4 tmpvar_67;
- tmpvar_67.zw = vec2(0.0, 0.0);
- tmpvar_67.xy = (xlv_TEXCOORD0 + (vec2(-1.0, 1.0) * _MainTex_TexelSize.xy));
- highp vec4 tmpvar_68;
- lowp vec4 tmpvar_69;
- tmpvar_69 = impl_low_texture2DLodEXT (_MainTex, tmpvar_67.xy, 0.0);
- tmpvar_68 = tmpvar_69;
- lumaNS_36 = (tmpvar_51.w + tmpvar_44.w);
- lumaWE_35 = (tmpvar_54.w + tmpvar_47.w);
- subpixRcpRange_34 = (1.0/(range_37));
- lumaNESE_33 = (tmpvar_65.w + tmpvar_62.w);
- lumaNWSW_32 = (tmpvar_59.w + tmpvar_68.w);
- lengthSign_31 = fxaaQualityRcpFrame_1.x;
- horzSpan_30 = ((abs(
- ((-2.0 * tmpvar_54.w) + lumaNWSW_32)
- ) + (
- (abs(((-2.0 * tmpvar_41.w) + lumaNS_36)) * 2.0)
- +
- abs(((-2.0 * tmpvar_47.w) + lumaNESE_33))
- )) >= (abs(
- ((-2.0 * tmpvar_44.w) + (tmpvar_68.w + tmpvar_62.w))
- ) + (
- (abs(((-2.0 * tmpvar_41.w) + lumaWE_35)) * 2.0)
- +
- abs(((-2.0 * tmpvar_51.w) + (tmpvar_59.w + tmpvar_65.w)))
- )));
- subpixA_29 = (((lumaNS_36 + lumaWE_35) * 2.0) + (lumaNWSW_32 + lumaNESE_33));
- if (!(horzSpan_30)) {
- lumaN_38 = tmpvar_56;
- };
- if (!(horzSpan_30)) {
- lumaS_39 = tmpvar_49;
- };
- if (horzSpan_30) {
- lengthSign_31 = fxaaQualityRcpFrame_1.y;
- };
- subpixB_28 = ((subpixA_29 * 0.0833333) - tmpvar_41.w);
- gradientN_27 = (lumaN_38 - tmpvar_41.w);
- gradientS_26 = (lumaS_39 - tmpvar_41.w);
- lumaNN_25 = (lumaN_38 + tmpvar_41.w);
- lumaSS_24 = (lumaS_39 + tmpvar_41.w);
- pairN_23 = (abs(gradientN_27) >= abs(gradientS_26));
- highp float tmpvar_70;
- tmpvar_70 = max (abs(gradientN_27), abs(gradientS_26));
- if (pairN_23) {
- lengthSign_31 = -(lengthSign_31);
- };
- highp float tmpvar_71;
- tmpvar_71 = clamp ((abs(subpixB_28) * subpixRcpRange_34), 0.0, 1.0);
- posB_22 = xlv_TEXCOORD0;
- highp float tmpvar_72;
- if (!(horzSpan_30)) {
- tmpvar_72 = 0.0;
- } else {
- tmpvar_72 = fxaaQualityRcpFrame_1.x;
- };
- highp float tmpvar_73;
- if (horzSpan_30) {
- tmpvar_73 = 0.0;
- } else {
- tmpvar_73 = fxaaQualityRcpFrame_1.y;
- };
- if (!(horzSpan_30)) {
- posB_22.x = (xlv_TEXCOORD0.x + (lengthSign_31 * 0.5));
- };
- if (horzSpan_30) {
- posB_22.y = (xlv_TEXCOORD0.y + (lengthSign_31 * 0.5));
- };
- posN_21.x = (posB_22.x - tmpvar_72);
- posN_21.y = (posB_22.y - tmpvar_73);
- posP_20.x = (posB_22.x + tmpvar_72);
- posP_20.y = (posB_22.y + tmpvar_73);
- subpixD_19 = ((-2.0 * tmpvar_71) + 3.0);
- highp vec4 tmpvar_74;
- lowp vec4 tmpvar_75;
- tmpvar_75 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- tmpvar_74 = tmpvar_75;
- lumaEndN_18 = tmpvar_74.w;
- subpixE_17 = (tmpvar_71 * tmpvar_71);
- highp vec4 tmpvar_76;
- lowp vec4 tmpvar_77;
- tmpvar_77 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- tmpvar_76 = tmpvar_77;
- lumaEndP_16 = tmpvar_76.w;
- if (!(pairN_23)) {
- lumaNN_25 = lumaSS_24;
- };
- gradientScaled_15 = (tmpvar_70 / 4.0);
- subpixF_14 = (subpixD_19 * subpixE_17);
- lumaMLTZero_13 = ((tmpvar_41.w - (lumaNN_25 * 0.5)) < 0.0);
- lumaEndN_18 = (tmpvar_74.w - (lumaNN_25 * 0.5));
- lumaEndP_16 = (tmpvar_76.w - (lumaNN_25 * 0.5));
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - tmpvar_72);
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - tmpvar_73);
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + tmpvar_72);
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + tmpvar_73);
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- highp vec4 tmpvar_78;
- lowp vec4 tmpvar_79;
- tmpvar_79 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- tmpvar_78 = tmpvar_79;
- lumaEndN_18 = tmpvar_78.w;
- };
- if (!(doneP_11)) {
- highp vec4 tmpvar_80;
- lowp vec4 tmpvar_81;
- tmpvar_81 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- tmpvar_80 = tmpvar_81;
- lumaEndP_16 = tmpvar_80.w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - tmpvar_72);
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - tmpvar_73);
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + tmpvar_72);
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + tmpvar_73);
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- highp vec4 tmpvar_82;
- lowp vec4 tmpvar_83;
- tmpvar_83 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- tmpvar_82 = tmpvar_83;
- lumaEndN_18 = tmpvar_82.w;
- };
- if (!(doneP_11)) {
- highp vec4 tmpvar_84;
- lowp vec4 tmpvar_85;
- tmpvar_85 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- tmpvar_84 = tmpvar_85;
- lumaEndP_16 = tmpvar_84.w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - tmpvar_72);
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - tmpvar_73);
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + tmpvar_72);
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + tmpvar_73);
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- highp vec4 tmpvar_86;
- lowp vec4 tmpvar_87;
- tmpvar_87 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- tmpvar_86 = tmpvar_87;
- lumaEndN_18 = tmpvar_86.w;
- };
- if (!(doneP_11)) {
- highp vec4 tmpvar_88;
- lowp vec4 tmpvar_89;
- tmpvar_89 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- tmpvar_88 = tmpvar_89;
- lumaEndP_16 = tmpvar_88.w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - tmpvar_72);
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - tmpvar_73);
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + tmpvar_72);
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + tmpvar_73);
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- highp vec4 tmpvar_90;
- lowp vec4 tmpvar_91;
- tmpvar_91 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- tmpvar_90 = tmpvar_91;
- lumaEndN_18 = tmpvar_90.w;
- };
- if (!(doneP_11)) {
- highp vec4 tmpvar_92;
- lowp vec4 tmpvar_93;
- tmpvar_93 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- tmpvar_92 = tmpvar_93;
- lumaEndP_16 = tmpvar_92.w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_72 * 1.5));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_73 * 1.5));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_72 * 1.5));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_73 * 1.5));
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- highp vec4 tmpvar_94;
- lowp vec4 tmpvar_95;
- tmpvar_95 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- tmpvar_94 = tmpvar_95;
- lumaEndN_18 = tmpvar_94.w;
- };
- if (!(doneP_11)) {
- highp vec4 tmpvar_96;
- lowp vec4 tmpvar_97;
- tmpvar_97 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- tmpvar_96 = tmpvar_97;
- lumaEndP_16 = tmpvar_96.w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_72 * 2.0));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_73 * 2.0));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_72 * 2.0));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_73 * 2.0));
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- highp vec4 tmpvar_98;
- lowp vec4 tmpvar_99;
- tmpvar_99 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- tmpvar_98 = tmpvar_99;
- lumaEndN_18 = tmpvar_98.w;
- };
- if (!(doneP_11)) {
- highp vec4 tmpvar_100;
- lowp vec4 tmpvar_101;
- tmpvar_101 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- tmpvar_100 = tmpvar_101;
- lumaEndP_16 = tmpvar_100.w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_72 * 2.0));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_73 * 2.0));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_72 * 2.0));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_73 * 2.0));
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- highp vec4 tmpvar_102;
- lowp vec4 tmpvar_103;
- tmpvar_103 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- tmpvar_102 = tmpvar_103;
- lumaEndN_18 = tmpvar_102.w;
- };
- if (!(doneP_11)) {
- highp vec4 tmpvar_104;
- lowp vec4 tmpvar_105;
- tmpvar_105 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- tmpvar_104 = tmpvar_105;
- lumaEndP_16 = tmpvar_104.w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_72 * 2.0));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_73 * 2.0));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_72 * 2.0));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_73 * 2.0));
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- highp vec4 tmpvar_106;
- lowp vec4 tmpvar_107;
- tmpvar_107 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- tmpvar_106 = tmpvar_107;
- lumaEndN_18 = tmpvar_106.w;
- };
- if (!(doneP_11)) {
- highp vec4 tmpvar_108;
- lowp vec4 tmpvar_109;
- tmpvar_109 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- tmpvar_108 = tmpvar_109;
- lumaEndP_16 = tmpvar_108.w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_72 * 2.0));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_73 * 2.0));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_72 * 2.0));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_73 * 2.0));
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- highp vec4 tmpvar_110;
- lowp vec4 tmpvar_111;
- tmpvar_111 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- tmpvar_110 = tmpvar_111;
- lumaEndN_18 = tmpvar_110.w;
- };
- if (!(doneP_11)) {
- highp vec4 tmpvar_112;
- lowp vec4 tmpvar_113;
- tmpvar_113 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- tmpvar_112 = tmpvar_113;
- lumaEndP_16 = tmpvar_112.w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_72 * 4.0));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_73 * 4.0));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_72 * 4.0));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_73 * 4.0));
- };
- if (doneNP_10) {
- if (!(doneN_12)) {
- highp vec4 tmpvar_114;
- lowp vec4 tmpvar_115;
- tmpvar_115 = impl_low_texture2DLodEXT (_MainTex, posN_21, 0.0);
- tmpvar_114 = tmpvar_115;
- lumaEndN_18 = tmpvar_114.w;
- };
- if (!(doneP_11)) {
- highp vec4 tmpvar_116;
- lowp vec4 tmpvar_117;
- tmpvar_117 = impl_low_texture2DLodEXT (_MainTex, posP_20, 0.0);
- tmpvar_116 = tmpvar_117;
- lumaEndP_16 = tmpvar_116.w;
- };
- if (!(doneN_12)) {
- lumaEndN_18 = (lumaEndN_18 - (lumaNN_25 * 0.5));
- };
- if (!(doneP_11)) {
- lumaEndP_16 = (lumaEndP_16 - (lumaNN_25 * 0.5));
- };
- doneN_12 = (abs(lumaEndN_18) >= gradientScaled_15);
- doneP_11 = (abs(lumaEndP_16) >= gradientScaled_15);
- if (!(doneN_12)) {
- posN_21.x = (posN_21.x - (tmpvar_72 * 8.0));
- };
- if (!(doneN_12)) {
- posN_21.y = (posN_21.y - (tmpvar_73 * 8.0));
- };
- doneNP_10 = !((doneN_12 && doneP_11));
- if (!(doneP_11)) {
- posP_20.x = (posP_20.x + (tmpvar_72 * 8.0));
- };
- if (!(doneP_11)) {
- posP_20.y = (posP_20.y + (tmpvar_73 * 8.0));
- };
- };
- };
- };
- };
- };
- };
- };
- };
- };
- };
- dstN_9 = (xlv_TEXCOORD0.x - posN_21.x);
- dstP_8 = (posP_20.x - xlv_TEXCOORD0.x);
- if (!(horzSpan_30)) {
- dstN_9 = (xlv_TEXCOORD0.y - posN_21.y);
- };
- if (!(horzSpan_30)) {
- dstP_8 = (posP_20.y - xlv_TEXCOORD0.y);
- };
- goodSpanN_7 = ((lumaEndN_18 < 0.0) != lumaMLTZero_13);
- goodSpanP_6 = ((lumaEndP_16 < 0.0) != lumaMLTZero_13);
- spanLengthRcp_5 = (1.0/((dstP_8 + dstN_9)));
- highp float tmpvar_118;
- tmpvar_118 = min (dstN_9, dstP_8);
- bool tmpvar_119;
- if ((dstN_9 < dstP_8)) {
- tmpvar_119 = goodSpanN_7;
- } else {
- tmpvar_119 = goodSpanP_6;
- };
- pixelOffset_4 = ((tmpvar_118 * -(spanLengthRcp_5)) + 0.5);
- subpixH_3 = ((subpixF_14 * subpixF_14) * 0.75);
- highp float tmpvar_120;
- if (tmpvar_119) {
- tmpvar_120 = pixelOffset_4;
- } else {
- tmpvar_120 = 0.0;
- };
- highp float tmpvar_121;
- tmpvar_121 = max (tmpvar_120, subpixH_3);
- if (!(horzSpan_30)) {
- posM_40.x = (xlv_TEXCOORD0.x + (tmpvar_121 * lengthSign_31));
- };
- if (horzSpan_30) {
- posM_40.y = (xlv_TEXCOORD0.y + (tmpvar_121 * lengthSign_31));
- };
- lowp vec4 tmpvar_122;
- tmpvar_122 = impl_low_texture2DLodEXT (_MainTex, posM_40, 0.0);
- highp vec4 tmpvar_123;
- tmpvar_123.xyz = tmpvar_122.xyz;
- tmpvar_123.w = tmpvar_41.w;
- tmpvar_2 = tmpvar_123;
- };
- gl_FragData[0] = tmpvar_2;
-}
-
-
-// stats: 401 alu 32 tex 110 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _MainTex_TexelSize (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-in.txt
deleted file mode 100644
index ce406bb8d14..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-in.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-vec4 xlat_main( in v2f i );
-vec4 xlat_main( in v2f i ) {
- return (i.color * texture2D( _MainTex, i.texcoord));
-}
-varying vec4 xlv_COLOR;
-varying vec2 xlv_TEXCOORD0;
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( xlv_COLOR);
- xlt_i.texcoord = vec2( xlv_TEXCOORD0);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-inES.txt
deleted file mode 100644
index 8ecedcf4d3a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-inES.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-struct v2f {
- highp vec4 vertex;
- lowp vec4 color;
- mediump vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-lowp vec4 xlat_main( in v2f i ) {
- return (i.color * texture2D( _MainTex, i.texcoord));
-}
-varying lowp vec4 xlv_COLOR;
-varying mediump vec2 xlv_TEXCOORD0;
-void main() {
- lowp vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( xlv_COLOR);
- xlt_i.texcoord = vec2( xlv_TEXCOORD0);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-out.txt
deleted file mode 100644
index 309a8b5e2a7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-out.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-uniform sampler2D _MainTex;
-varying vec4 xlv_COLOR;
-varying vec2 xlv_TEXCOORD0;
-void main ()
-{
- gl_FragData[0] = (xlv_COLOR * texture2D (_MainTex, xlv_TEXCOORD0));
-}
-
-
-// stats: 1 alu 1 tex 0 flow
-// inputs: 2
-// #0: xlv_COLOR (high float) 4x1 [-1]
-// #1: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-outES.txt
deleted file mode 100644
index 6cf830a7baa..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-particle-outES.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-uniform sampler2D _MainTex;
-varying lowp vec4 xlv_COLOR;
-varying mediump vec2 xlv_TEXCOORD0;
-void main ()
-{
- lowp vec4 tmpvar_1;
- tmpvar_1 = (xlv_COLOR * texture2D (_MainTex, xlv_TEXCOORD0));
- gl_FragData[0] = tmpvar_1;
-}
-
-
-// stats: 1 alu 1 tex 0 flow
-// inputs: 2
-// #0: xlv_COLOR (low float) 4x1 [-1]
-// #1: xlv_TEXCOORD0 (medium float) 2x1 [-1]
-// textures: 1
-// #0: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-in.txt
deleted file mode 100644
index bdc511fc9e2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-in.txt
+++ /dev/null
@@ -1,145 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-vec2 xll_vecTSel (bvec2 a, vec2 b, vec2 c) {
- return vec2 (a.x ? b.x : c.x, a.y ? b.y : c.y);
-}
-vec3 xll_vecTSel (bvec3 a, vec3 b, vec3 c) {
- return vec3 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z);
-}
-vec4 xll_vecTSel (bvec4 a, vec4 b, vec4 c) {
- return vec4 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z, a.w ? b.w : c.w);
-}
-struct v2f {
- vec4 pos;
- vec4 uv;
- vec3 ray;
-};
-uniform sampler2D _CameraDepthTexture;
-uniform sampler2D _CameraNormalsTexture;
-uniform mat4 _CameraToWorld;
-uniform vec4 _LightColor;
-uniform mat4 _LightMatrix0;
-uniform vec4 _LightPos;
-uniform vec4 _LightPositionRange;
-uniform vec4 _LightShadowData;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform vec4 _ProjectionParams;
-uniform samplerCube _ShadowMapTexture;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _ZBufferParams;
-uniform vec4 unity_LightmapFade;
-float Luminance( in vec3 c );
-float Linear01Depth( in float z );
-float DecodeFloatRGBA( in vec4 enc );
-float SampleCubeDistance( in vec3 vec );
-float unitySampleShadow( in vec3 vec, in float mydist );
-float ComputeShadow( in vec3 vec, in float z, in vec2 uv );
-vec4 xlat_main( in v2f i );
-float Luminance( in vec3 c ) {
- return dot( c, vec3( 0.220000, 0.707000, 0.0710000));
-}
-float Linear01Depth( in float z ) {
- return (1.00000 / ((_ZBufferParams.x * z) + _ZBufferParams.y ));
-}
-float DecodeFloatRGBA( in vec4 enc ) {
- vec4 kDecodeDot = vec4( 1.00000, 0.00392157, 1.53787e-005, 6.22737e-009);
- return dot( enc, kDecodeDot);
-}
-float SampleCubeDistance( in vec3 vec ) {
- vec4 packDist;
- packDist = textureCube( _ShadowMapTexture, vec);
- return DecodeFloatRGBA( packDist);
-}
-float unitySampleShadow( in vec3 vec, in float mydist ) {
- float z = 0.00781250;
- vec4 shadowVals;
- vec4 shadows;
- shadowVals.x = SampleCubeDistance( (vec + vec3( z, z, z)));
- shadowVals.y = SampleCubeDistance( (vec + vec3( ( -z ), ( -z ), z)));
- shadowVals.z = SampleCubeDistance( (vec + vec3( ( -z ), z, ( -z ))));
- shadowVals.w = SampleCubeDistance( (vec + vec3( z, ( -z ), ( -z ))));
- shadows = xll_vecTSel (lessThan( shadowVals, vec4( vec4( mydist) )), vec4( _LightShadowData.xxxx ), vec4( 1.00000));
- return dot( shadows, vec4( 0.250000));
-}
-float ComputeShadow( in vec3 vec, in float z, in vec2 uv ) {
- float fade;
- float mydist;
- fade = ((z * _LightShadowData.z ) + _LightShadowData.w );
- fade = xll_saturate( fade );
- mydist = (length( vec ) * _LightPositionRange.w );
- mydist *= 0.970000;
- return unitySampleShadow( vec, mydist);
- return 1.00000;
-}
-vec4 xlat_main( in v2f i ) {
- vec2 uv;
- vec4 nspec;
- vec3 normal;
- float depth;
- vec4 vpos;
- vec3 wpos;
- vec3 tolight;
- vec3 lightDir;
- float att;
- float atten;
- float diff;
- vec3 h;
- float spec;
- vec4 res;
- float fade;
- i.ray = (i.ray * (_ProjectionParams.z / i.ray.z ));
- uv = (i.uv.xy / i.uv.w );
- nspec = texture2D( _CameraNormalsTexture, uv);
- normal = ((nspec.xyz * 2.00000) - 1.00000);
- normal = normalize( normal );
- depth = texture2D( _CameraDepthTexture, uv).x ;
- depth = Linear01Depth( depth);
- vpos = vec4( (i.ray * depth), 1.00000);
- wpos = ( _CameraToWorld * vpos ).xyz ;
- tolight = (wpos - _LightPos.xyz );
- lightDir = ( -normalize( tolight ) );
- att = (dot( tolight, tolight) * _LightPos.w );
- atten = texture2D( _LightTextureB0, vec2( vec2( att))).w ;
- atten *= ComputeShadow( tolight, vpos.z , uv);
- atten *= textureCube( _LightTexture0, ( _LightMatrix0 * vec4( wpos, 1.00000) ).xyz ).w ;
- diff = max( 0.000000, dot( lightDir, normal));
- h = normalize( (lightDir - normalize( (wpos - _WorldSpaceCameraPos) )) );
- spec = pow( max( 0.000000, dot( h, normal)), (nspec.w * 128.000));
- spec *= xll_saturate( atten );
- res.xyz = (_LightColor.xyz * (diff * atten));
- res.w = (spec * Luminance( _LightColor.xyz ));
- fade = ((vpos.z * unity_LightmapFade.z ) + unity_LightmapFade.w );
- res *= xll_saturate( (1.00000 - fade) );
- return exp2( ( -res ) );
-}
-varying vec4 xlv_TEXCOORD0;
-varying vec3 xlv_TEXCOORD1;
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec4( xlv_TEXCOORD0);
- xlt_i.ray = vec3( xlv_TEXCOORD1);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES.txt
deleted file mode 100644
index c2e519fbae8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES.txt
+++ /dev/null
@@ -1,145 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-vec2 xll_vecTSel (bvec2 a, vec2 b, vec2 c) {
- return vec2 (a.x ? b.x : c.x, a.y ? b.y : c.y);
-}
-vec3 xll_vecTSel (bvec3 a, vec3 b, vec3 c) {
- return vec3 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z);
-}
-vec4 xll_vecTSel (bvec4 a, vec4 b, vec4 c) {
- return vec4 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z, a.w ? b.w : c.w);
-}
-struct v2f {
- highp vec4 pos;
- highp vec4 uv;
- highp vec3 ray;
-};
-uniform sampler2D _CameraDepthTexture;
-uniform sampler2D _CameraNormalsTexture;
-uniform highp mat4 _CameraToWorld;
-uniform highp vec4 _LightColor;
-uniform highp mat4 _LightMatrix0;
-uniform highp vec4 _LightPos;
-uniform highp vec4 _LightPositionRange;
-uniform highp vec4 _LightShadowData;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform highp vec4 _ProjectionParams;
-uniform samplerCube _ShadowMapTexture;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp vec4 _ZBufferParams;
-uniform highp vec4 unity_LightmapFade;
-mediump float Luminance( in mediump vec3 c );
-highp float Linear01Depth( in highp float z );
-highp float DecodeFloatRGBA( in highp vec4 enc );
-highp float SampleCubeDistance( in highp vec3 vec );
-mediump float unitySampleShadow( in highp vec3 vec, in highp float mydist );
-mediump float ComputeShadow( in highp vec3 vec, in highp float z, in highp vec2 uv );
-mediump vec4 xlat_main( in v2f i );
-mediump float Luminance( in mediump vec3 c ) {
- return dot( c, vec3( 0.220000, 0.707000, 0.0710000));
-}
-highp float Linear01Depth( in highp float z ) {
- return (1.00000 / ((_ZBufferParams.x * z) + _ZBufferParams.y ));
-}
-highp float DecodeFloatRGBA( in highp vec4 enc ) {
- highp vec4 kDecodeDot = vec4( 1.00000, 0.00392157, 1.53787e-005, 6.22737e-009);
- return dot( enc, kDecodeDot);
-}
-highp float SampleCubeDistance( in highp vec3 vec ) {
- highp vec4 packDist;
- packDist = textureCube( _ShadowMapTexture, vec);
- return DecodeFloatRGBA( packDist);
-}
-mediump float unitySampleShadow( in highp vec3 vec, in highp float mydist ) {
- highp float z = 0.00781250;
- highp vec4 shadowVals;
- mediump vec4 shadows;
- shadowVals.x = SampleCubeDistance( (vec + vec3( z, z, z)));
- shadowVals.y = SampleCubeDistance( (vec + vec3( ( -z ), ( -z ), z)));
- shadowVals.z = SampleCubeDistance( (vec + vec3( ( -z ), z, ( -z ))));
- shadowVals.w = SampleCubeDistance( (vec + vec3( z, ( -z ), ( -z ))));
- shadows = xll_vecTSel (lessThan( shadowVals, vec4( vec4( mydist) )), vec4( _LightShadowData.xxxx ), vec4( 1.00000));
- return dot( shadows, vec4( 0.250000));
-}
-mediump float ComputeShadow( in highp vec3 vec, in highp float z, in highp vec2 uv ) {
- highp float fade;
- highp float mydist;
- fade = ((z * _LightShadowData.z ) + _LightShadowData.w );
- fade = xll_saturate( fade );
- mydist = (length( vec ) * _LightPositionRange.w );
- mydist *= 0.970000;
- return unitySampleShadow( vec, mydist);
- return 1.00000;
-}
-mediump vec4 xlat_main( in v2f i ) {
- highp vec2 uv;
- mediump vec4 nspec;
- mediump vec3 normal;
- highp float depth;
- highp vec4 vpos;
- highp vec3 wpos;
- highp vec3 tolight;
- mediump vec3 lightDir;
- highp float att;
- highp float atten;
- mediump float diff;
- mediump vec3 h;
- highp float spec;
- mediump vec4 res;
- highp float fade;
- i.ray = (i.ray * (_ProjectionParams.z / i.ray.z ));
- uv = (i.uv.xy / i.uv.w );
- nspec = texture2D( _CameraNormalsTexture, uv);
- normal = ((nspec.xyz * 2.00000) - 1.00000);
- normal = normalize( normal );
- depth = texture2D( _CameraDepthTexture, uv).x ;
- depth = Linear01Depth( depth);
- vpos = vec4( (i.ray * depth), 1.00000);
- wpos = ( _CameraToWorld * vpos ).xyz ;
- tolight = (wpos - _LightPos.xyz );
- lightDir = ( -normalize( tolight ) );
- att = (dot( tolight, tolight) * _LightPos.w );
- atten = texture2D( _LightTextureB0, vec2( vec2( att))).w ;
- atten *= ComputeShadow( tolight, vpos.z , uv);
- atten *= textureCube( _LightTexture0, ( _LightMatrix0 * vec4( wpos, 1.00000) ).xyz ).w ;
- diff = max( 0.000000, dot( lightDir, normal));
- h = normalize( (lightDir - normalize( (wpos - _WorldSpaceCameraPos) )) );
- spec = pow( max( 0.000000, dot( h, normal)), (nspec.w * 128.000));
- spec *= xll_saturate( atten );
- res.xyz = (_LightColor.xyz * (diff * atten));
- res.w = (spec * Luminance( _LightColor.xyz ));
- fade = ((vpos.z * unity_LightmapFade.z ) + unity_LightmapFade.w );
- res *= xll_saturate( (1.00000 - fade) );
- return exp2( ( -res ) );
-}
-varying highp vec4 xlv_TEXCOORD0;
-varying highp vec3 xlv_TEXCOORD1;
-void main() {
- mediump vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec4( xlv_TEXCOORD0);
- xlt_i.ray = vec3( xlv_TEXCOORD1);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt
deleted file mode 100644
index 582c7392de5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-inES3.txt
+++ /dev/null
@@ -1,147 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-vec2 xll_vecTSel (bvec2 a, vec2 b, vec2 c) {
- return vec2 (a.x ? b.x : c.x, a.y ? b.y : c.y);
-}
-vec3 xll_vecTSel (bvec3 a, vec3 b, vec3 c) {
- return vec3 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z);
-}
-vec4 xll_vecTSel (bvec4 a, vec4 b, vec4 c) {
- return vec4 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z, a.w ? b.w : c.w);
-}
-struct v2f {
- highp vec4 pos;
- highp vec4 uv;
- highp vec3 ray;
-};
-uniform sampler2D _CameraDepthTexture;
-uniform sampler2D _CameraNormalsTexture;
-uniform highp mat4 _CameraToWorld;
-uniform highp vec4 _LightColor;
-uniform highp mat4 _LightMatrix0;
-uniform highp vec4 _LightPos;
-uniform highp vec4 _LightPositionRange;
-uniform highp vec4 _LightShadowData;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform highp vec4 _ProjectionParams;
-uniform samplerCube _ShadowMapTexture;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp vec4 _ZBufferParams;
-uniform highp vec4 unity_LightmapFade;
-mediump float Luminance( in mediump vec3 c );
-highp float Linear01Depth( in highp float z );
-highp float DecodeFloatRGBA( in highp vec4 enc );
-highp float SampleCubeDistance( in highp vec3 vec );
-mediump float unitySampleShadow( in highp vec3 vec, in highp float mydist );
-mediump float ComputeShadow( in highp vec3 vec, in highp float z, in highp vec2 uv );
-mediump vec4 xlat_main( in v2f i );
-mediump float Luminance( in mediump vec3 c ) {
- return dot( c, vec3( 0.220000, 0.707000, 0.0710000));
-}
-highp float Linear01Depth( in highp float z ) {
- return (1.00000 / ((_ZBufferParams.x * z) + _ZBufferParams.y ));
-}
-highp float DecodeFloatRGBA( in highp vec4 enc ) {
- highp vec4 kDecodeDot = vec4( 1.00000, 0.00392157, 1.53787e-005, 6.22737e-009);
- return dot( enc, kDecodeDot);
-}
-highp float SampleCubeDistance( in highp vec3 vec ) {
- highp vec4 packDist;
- packDist = texture( _ShadowMapTexture, vec);
- return DecodeFloatRGBA( packDist);
-}
-mediump float unitySampleShadow( in highp vec3 vec, in highp float mydist ) {
- highp float z = 0.00781250;
- highp vec4 shadowVals;
- mediump vec4 shadows;
- shadowVals.x = SampleCubeDistance( (vec + vec3( z, z, z)));
- shadowVals.y = SampleCubeDistance( (vec + vec3( ( -z ), ( -z ), z)));
- shadowVals.z = SampleCubeDistance( (vec + vec3( ( -z ), z, ( -z ))));
- shadowVals.w = SampleCubeDistance( (vec + vec3( z, ( -z ), ( -z ))));
- shadows = xll_vecTSel (lessThan( shadowVals, vec4( vec4( mydist) )), vec4( _LightShadowData.xxxx ), vec4( 1.00000));
- return dot( shadows, vec4( 0.250000));
-}
-mediump float ComputeShadow( in highp vec3 vec, in highp float z, in highp vec2 uv ) {
- highp float fade;
- highp float mydist;
- fade = ((z * _LightShadowData.z ) + _LightShadowData.w );
- fade = xll_saturate( fade );
- mydist = (length( vec ) * _LightPositionRange.w );
- mydist *= 0.970000;
- return unitySampleShadow( vec, mydist);
- return 1.00000;
-}
-mediump vec4 xlat_main( in v2f i ) {
- highp vec2 uv;
- mediump vec4 nspec;
- mediump vec3 normal;
- highp float depth;
- highp vec4 vpos;
- highp vec3 wpos;
- highp vec3 tolight;
- mediump vec3 lightDir;
- highp float att;
- highp float atten;
- mediump float diff;
- mediump vec3 h;
- highp float spec;
- mediump vec4 res;
- highp float fade;
- i.ray = (i.ray * (_ProjectionParams.z / i.ray.z ));
- uv = (i.uv.xy / i.uv.w );
- nspec = texture( _CameraNormalsTexture, uv);
- normal = ((nspec.xyz * 2.00000) - 1.00000);
- normal = normalize( normal );
- depth = texture( _CameraDepthTexture, uv).x ;
- depth = Linear01Depth( depth);
- vpos = vec4( (i.ray * depth), 1.00000);
- wpos = ( _CameraToWorld * vpos ).xyz ;
- tolight = (wpos - _LightPos.xyz );
- lightDir = ( -normalize( tolight ) );
- att = (dot( tolight, tolight) * _LightPos.w );
- atten = texture( _LightTextureB0, vec2( vec2( att))).w ;
- atten *= ComputeShadow( tolight, vpos.z , uv);
- atten *= texture( _LightTexture0, ( _LightMatrix0 * vec4( wpos, 1.00000) ).xyz ).w ;
- diff = max( 0.000000, dot( lightDir, normal));
- h = normalize( (lightDir - normalize( (wpos - _WorldSpaceCameraPos) )) );
- spec = pow( max( 0.000000, dot( h, normal)), (nspec.w * 128.000));
- spec *= xll_saturate( atten );
- res.xyz = (_LightColor.xyz * (diff * atten));
- res.w = (spec * Luminance( _LightColor.xyz ));
- fade = ((vpos.z * unity_LightmapFade.z ) + unity_LightmapFade.w );
- res *= xll_saturate( (1.00000 - fade) );
- return exp2( ( -res ) );
-}
-in highp vec4 xlv_TEXCOORD0;
-in highp vec3 xlv_TEXCOORD1;
-void main() {
- mediump vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec4( xlv_TEXCOORD0);
- xlt_i.ray = vec3( xlv_TEXCOORD1);
- xl_retval = xlat_main( xlt_i);
- _fragData = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-out.txt
deleted file mode 100644
index 7cc74d87822..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-out.txt
+++ /dev/null
@@ -1,124 +0,0 @@
-uniform sampler2D _CameraDepthTexture;
-uniform sampler2D _CameraNormalsTexture;
-uniform mat4 _CameraToWorld;
-uniform vec4 _LightColor;
-uniform mat4 _LightMatrix0;
-uniform vec4 _LightPos;
-uniform vec4 _LightPositionRange;
-uniform vec4 _LightShadowData;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform vec4 _ProjectionParams;
-uniform samplerCube _ShadowMapTexture;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _ZBufferParams;
-uniform vec4 unity_LightmapFade;
-varying vec4 xlv_TEXCOORD0;
-varying vec3 xlv_TEXCOORD1;
-void main ()
-{
- vec4 res_1;
- float atten_2;
- vec3 lightDir_3;
- vec3 tolight_4;
- vec3 wpos_5;
- vec3 normal_6;
- vec2 uv_7;
- uv_7 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w);
- vec4 tmpvar_8;
- tmpvar_8 = texture2D (_CameraNormalsTexture, uv_7);
- normal_6 = ((tmpvar_8.xyz * 2.0) - 1.0);
- normal_6 = normalize(normal_6);
- vec4 tmpvar_9;
- tmpvar_9.w = 1.0;
- tmpvar_9.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * (1.0/((
- (_ZBufferParams.x * texture2D (_CameraDepthTexture, uv_7).x)
- + _ZBufferParams.y))));
- wpos_5 = (_CameraToWorld * tmpvar_9).xyz;
- tolight_4 = (wpos_5 - _LightPos.xyz);
- lightDir_3 = -(normalize(tolight_4));
- atten_2 = texture2D (_LightTextureB0, vec2((dot (tolight_4, tolight_4) * _LightPos.w))).w;
- float mydist_10;
- mydist_10 = (sqrt(dot (tolight_4, tolight_4)) * _LightPositionRange.w);
- mydist_10 = (mydist_10 * 0.97);
- vec4 shadowVals_11;
- shadowVals_11.x = dot (textureCube (_ShadowMapTexture, (tolight_4 + vec3(0.0078125, 0.0078125, 0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- shadowVals_11.y = dot (textureCube (_ShadowMapTexture, (tolight_4 + vec3(-0.0078125, -0.0078125, 0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- shadowVals_11.z = dot (textureCube (_ShadowMapTexture, (tolight_4 + vec3(-0.0078125, 0.0078125, -0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- shadowVals_11.w = dot (textureCube (_ShadowMapTexture, (tolight_4 + vec3(0.0078125, -0.0078125, -0.0078125))), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- bvec4 tmpvar_12;
- tmpvar_12 = lessThan (shadowVals_11, vec4(mydist_10));
- vec4 tmpvar_13;
- tmpvar_13 = _LightShadowData.xxxx;
- float tmpvar_14;
- if (tmpvar_12.x) {
- tmpvar_14 = tmpvar_13.x;
- } else {
- tmpvar_14 = 1.0;
- };
- float tmpvar_15;
- if (tmpvar_12.y) {
- tmpvar_15 = tmpvar_13.y;
- } else {
- tmpvar_15 = 1.0;
- };
- float tmpvar_16;
- if (tmpvar_12.z) {
- tmpvar_16 = tmpvar_13.z;
- } else {
- tmpvar_16 = 1.0;
- };
- float tmpvar_17;
- if (tmpvar_12.w) {
- tmpvar_17 = tmpvar_13.w;
- } else {
- tmpvar_17 = 1.0;
- };
- vec4 tmpvar_18;
- tmpvar_18.x = tmpvar_14;
- tmpvar_18.y = tmpvar_15;
- tmpvar_18.z = tmpvar_16;
- tmpvar_18.w = tmpvar_17;
- atten_2 = (atten_2 * dot (tmpvar_18, vec4(0.25, 0.25, 0.25, 0.25)));
- vec4 tmpvar_19;
- tmpvar_19.w = 1.0;
- tmpvar_19.xyz = wpos_5;
- atten_2 = (atten_2 * textureCube (_LightTexture0, (_LightMatrix0 * tmpvar_19).xyz).w);
- res_1.xyz = (_LightColor.xyz * (max (0.0,
- dot (lightDir_3, normal_6)
- ) * atten_2));
- res_1.w = ((pow (
- max (0.0, dot (normalize((lightDir_3 -
- normalize((wpos_5 - _WorldSpaceCameraPos))
- )), normal_6))
- ,
- (tmpvar_8.w * 128.0)
- ) * clamp (atten_2, 0.0, 1.0)) * dot (_LightColor.xyz, vec3(0.22, 0.707, 0.071)));
- res_1 = (res_1 * clamp ((1.0 -
- ((tmpvar_9.z * unity_LightmapFade.z) + unity_LightmapFade.w)
- ), 0.0, 1.0));
- gl_FragData[0] = exp2(-(res_1));
-}
-
-
-// stats: 62 alu 8 tex 4 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 3x1 [-1]
-// uniforms: 10 (total size: 0)
-// #0: _CameraToWorld (high float) 4x4 [-1]
-// #1: _LightColor (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _LightPos (high float) 4x1 [-1]
-// #4: _LightPositionRange (high float) 4x1 [-1]
-// #5: _LightShadowData (high float) 4x1 [-1]
-// #6: _ProjectionParams (high float) 4x1 [-1]
-// #7: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #8: _ZBufferParams (high float) 4x1 [-1]
-// #9: unity_LightmapFade (high float) 4x1 [-1]
-// textures: 5
-// #0: _CameraDepthTexture (high 2d) 0x0 [-1]
-// #1: _CameraNormalsTexture (high 2d) 0x0 [-1]
-// #2: _LightTexture0 (high cube) 0x0 [-1]
-// #3: _LightTextureB0 (high 2d) 0x0 [-1]
-// #4: _ShadowMapTexture (high cube) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt
deleted file mode 100644
index 8a1a837cb52..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES.txt
+++ /dev/null
@@ -1,176 +0,0 @@
-uniform sampler2D _CameraDepthTexture;
-uniform sampler2D _CameraNormalsTexture;
-uniform highp mat4 _CameraToWorld;
-uniform highp vec4 _LightColor;
-uniform highp mat4 _LightMatrix0;
-uniform highp vec4 _LightPos;
-uniform highp vec4 _LightPositionRange;
-uniform highp vec4 _LightShadowData;
-uniform lowp samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform highp vec4 _ProjectionParams;
-uniform lowp samplerCube _ShadowMapTexture;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp vec4 _ZBufferParams;
-uniform highp vec4 unity_LightmapFade;
-varying highp vec4 xlv_TEXCOORD0;
-varying highp vec3 xlv_TEXCOORD1;
-void main ()
-{
- mediump vec4 res_1;
- highp float spec_2;
- mediump vec3 h_3;
- highp float atten_4;
- mediump vec3 lightDir_5;
- highp vec3 tolight_6;
- highp vec3 wpos_7;
- highp float depth_8;
- mediump vec3 normal_9;
- mediump vec4 nspec_10;
- highp vec2 uv_11;
- uv_11 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w);
- lowp vec4 tmpvar_12;
- tmpvar_12 = texture2D (_CameraNormalsTexture, uv_11);
- nspec_10 = tmpvar_12;
- normal_9 = ((nspec_10.xyz * 2.0) - 1.0);
- normal_9 = normalize(normal_9);
- lowp vec4 tmpvar_13;
- tmpvar_13 = texture2D (_CameraDepthTexture, uv_11);
- depth_8 = tmpvar_13.x;
- highp float tmpvar_14;
- tmpvar_14 = (1.0/(((_ZBufferParams.x * depth_8) + _ZBufferParams.y)));
- depth_8 = tmpvar_14;
- highp vec4 tmpvar_15;
- tmpvar_15.w = 1.0;
- tmpvar_15.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * tmpvar_14);
- wpos_7 = (_CameraToWorld * tmpvar_15).xyz;
- tolight_6 = (wpos_7 - _LightPos.xyz);
- highp vec3 tmpvar_16;
- tmpvar_16 = normalize(tolight_6);
- lightDir_5 = -(tmpvar_16);
- highp vec2 tmpvar_17;
- tmpvar_17 = vec2((dot (tolight_6, tolight_6) * _LightPos.w));
- lowp vec4 tmpvar_18;
- tmpvar_18 = texture2D (_LightTextureB0, tmpvar_17);
- atten_4 = tmpvar_18.w;
- highp float mydist_19;
- mydist_19 = (sqrt(dot (tolight_6, tolight_6)) * _LightPositionRange.w);
- mydist_19 = (mydist_19 * 0.97);
- highp vec4 shadowVals_20;
- highp vec3 vec_21;
- vec_21 = (tolight_6 + vec3(0.0078125, 0.0078125, 0.0078125));
- highp vec4 packDist_22;
- lowp vec4 tmpvar_23;
- tmpvar_23 = textureCube (_ShadowMapTexture, vec_21);
- packDist_22 = tmpvar_23;
- shadowVals_20.x = dot (packDist_22, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- highp vec3 vec_24;
- vec_24 = (tolight_6 + vec3(-0.0078125, -0.0078125, 0.0078125));
- highp vec4 packDist_25;
- lowp vec4 tmpvar_26;
- tmpvar_26 = textureCube (_ShadowMapTexture, vec_24);
- packDist_25 = tmpvar_26;
- shadowVals_20.y = dot (packDist_25, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- highp vec3 vec_27;
- vec_27 = (tolight_6 + vec3(-0.0078125, 0.0078125, -0.0078125));
- highp vec4 packDist_28;
- lowp vec4 tmpvar_29;
- tmpvar_29 = textureCube (_ShadowMapTexture, vec_27);
- packDist_28 = tmpvar_29;
- shadowVals_20.z = dot (packDist_28, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- highp vec3 vec_30;
- vec_30 = (tolight_6 + vec3(0.0078125, -0.0078125, -0.0078125));
- highp vec4 packDist_31;
- lowp vec4 tmpvar_32;
- tmpvar_32 = textureCube (_ShadowMapTexture, vec_30);
- packDist_31 = tmpvar_32;
- shadowVals_20.w = dot (packDist_31, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- bvec4 tmpvar_33;
- tmpvar_33 = lessThan (shadowVals_20, vec4(mydist_19));
- highp vec4 tmpvar_34;
- tmpvar_34 = _LightShadowData.xxxx;
- highp float tmpvar_35;
- if (tmpvar_33.x) {
- tmpvar_35 = tmpvar_34.x;
- } else {
- tmpvar_35 = 1.0;
- };
- highp float tmpvar_36;
- if (tmpvar_33.y) {
- tmpvar_36 = tmpvar_34.y;
- } else {
- tmpvar_36 = 1.0;
- };
- highp float tmpvar_37;
- if (tmpvar_33.z) {
- tmpvar_37 = tmpvar_34.z;
- } else {
- tmpvar_37 = 1.0;
- };
- highp float tmpvar_38;
- if (tmpvar_33.w) {
- tmpvar_38 = tmpvar_34.w;
- } else {
- tmpvar_38 = 1.0;
- };
- mediump vec4 tmpvar_39;
- tmpvar_39.x = tmpvar_35;
- tmpvar_39.y = tmpvar_36;
- tmpvar_39.z = tmpvar_37;
- tmpvar_39.w = tmpvar_38;
- mediump float tmpvar_40;
- tmpvar_40 = dot (tmpvar_39, vec4(0.25, 0.25, 0.25, 0.25));
- atten_4 = (atten_4 * tmpvar_40);
- highp vec4 tmpvar_41;
- tmpvar_41.w = 1.0;
- tmpvar_41.xyz = wpos_7;
- lowp vec4 tmpvar_42;
- highp vec3 P_43;
- P_43 = (_LightMatrix0 * tmpvar_41).xyz;
- tmpvar_42 = textureCube (_LightTexture0, P_43);
- atten_4 = (atten_4 * tmpvar_42.w);
- highp vec3 tmpvar_44;
- tmpvar_44 = normalize((lightDir_5 - normalize(
- (wpos_7 - _WorldSpaceCameraPos)
- )));
- h_3 = tmpvar_44;
- mediump float tmpvar_45;
- tmpvar_45 = pow (max (0.0, dot (h_3, normal_9)), (nspec_10.w * 128.0));
- spec_2 = tmpvar_45;
- spec_2 = (spec_2 * clamp (atten_4, 0.0, 1.0));
- res_1.xyz = (_LightColor.xyz * (max (0.0,
- dot (lightDir_5, normal_9)
- ) * atten_4));
- mediump vec3 c_46;
- c_46 = _LightColor.xyz;
- res_1.w = (spec_2 * dot (c_46, vec3(0.22, 0.707, 0.071)));
- highp float tmpvar_47;
- tmpvar_47 = clamp ((1.0 - (
- (tmpvar_15.z * unity_LightmapFade.z)
- + unity_LightmapFade.w)), 0.0, 1.0);
- res_1 = (res_1 * tmpvar_47);
- gl_FragData[0] = exp2(-(res_1));
-}
-
-
-// stats: 62 alu 8 tex 4 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 3x1 [-1]
-// uniforms: 10 (total size: 0)
-// #0: _CameraToWorld (high float) 4x4 [-1]
-// #1: _LightColor (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _LightPos (high float) 4x1 [-1]
-// #4: _LightPositionRange (high float) 4x1 [-1]
-// #5: _LightShadowData (high float) 4x1 [-1]
-// #6: _ProjectionParams (high float) 4x1 [-1]
-// #7: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #8: _ZBufferParams (high float) 4x1 [-1]
-// #9: unity_LightmapFade (high float) 4x1 [-1]
-// textures: 5
-// #0: _CameraDepthTexture (low 2d) 0x0 [-1]
-// #1: _CameraNormalsTexture (low 2d) 0x0 [-1]
-// #2: _LightTexture0 (low cube) 0x0 [-1]
-// #3: _LightTextureB0 (low 2d) 0x0 [-1]
-// #4: _ShadowMapTexture (low cube) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt
deleted file mode 100644
index bf1e2bc6640..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3.txt
+++ /dev/null
@@ -1,178 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-uniform sampler2D _CameraDepthTexture;
-uniform sampler2D _CameraNormalsTexture;
-uniform highp mat4 _CameraToWorld;
-uniform highp vec4 _LightColor;
-uniform highp mat4 _LightMatrix0;
-uniform highp vec4 _LightPos;
-uniform highp vec4 _LightPositionRange;
-uniform highp vec4 _LightShadowData;
-uniform lowp samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform highp vec4 _ProjectionParams;
-uniform lowp samplerCube _ShadowMapTexture;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp vec4 _ZBufferParams;
-uniform highp vec4 unity_LightmapFade;
-in highp vec4 xlv_TEXCOORD0;
-in highp vec3 xlv_TEXCOORD1;
-void main ()
-{
- mediump vec4 res_1;
- highp float spec_2;
- mediump vec3 h_3;
- highp float atten_4;
- mediump vec3 lightDir_5;
- highp vec3 tolight_6;
- highp vec3 wpos_7;
- highp float depth_8;
- mediump vec3 normal_9;
- mediump vec4 nspec_10;
- highp vec2 uv_11;
- uv_11 = (xlv_TEXCOORD0.xy / xlv_TEXCOORD0.w);
- lowp vec4 tmpvar_12;
- tmpvar_12 = texture (_CameraNormalsTexture, uv_11);
- nspec_10 = tmpvar_12;
- normal_9 = ((nspec_10.xyz * 2.0) - 1.0);
- normal_9 = normalize(normal_9);
- lowp vec4 tmpvar_13;
- tmpvar_13 = texture (_CameraDepthTexture, uv_11);
- depth_8 = tmpvar_13.x;
- highp float tmpvar_14;
- tmpvar_14 = (1.0/(((_ZBufferParams.x * depth_8) + _ZBufferParams.y)));
- depth_8 = tmpvar_14;
- highp vec4 tmpvar_15;
- tmpvar_15.w = 1.0;
- tmpvar_15.xyz = ((xlv_TEXCOORD1 * (_ProjectionParams.z / xlv_TEXCOORD1.z)) * tmpvar_14);
- wpos_7 = (_CameraToWorld * tmpvar_15).xyz;
- tolight_6 = (wpos_7 - _LightPos.xyz);
- highp vec3 tmpvar_16;
- tmpvar_16 = normalize(tolight_6);
- lightDir_5 = -(tmpvar_16);
- highp vec2 tmpvar_17;
- tmpvar_17 = vec2((dot (tolight_6, tolight_6) * _LightPos.w));
- lowp vec4 tmpvar_18;
- tmpvar_18 = texture (_LightTextureB0, tmpvar_17);
- atten_4 = tmpvar_18.w;
- highp float mydist_19;
- mydist_19 = (sqrt(dot (tolight_6, tolight_6)) * _LightPositionRange.w);
- mydist_19 = (mydist_19 * 0.97);
- highp vec4 shadowVals_20;
- highp vec3 vec_21;
- vec_21 = (tolight_6 + vec3(0.0078125, 0.0078125, 0.0078125));
- highp vec4 packDist_22;
- lowp vec4 tmpvar_23;
- tmpvar_23 = texture (_ShadowMapTexture, vec_21);
- packDist_22 = tmpvar_23;
- shadowVals_20.x = dot (packDist_22, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- highp vec3 vec_24;
- vec_24 = (tolight_6 + vec3(-0.0078125, -0.0078125, 0.0078125));
- highp vec4 packDist_25;
- lowp vec4 tmpvar_26;
- tmpvar_26 = texture (_ShadowMapTexture, vec_24);
- packDist_25 = tmpvar_26;
- shadowVals_20.y = dot (packDist_25, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- highp vec3 vec_27;
- vec_27 = (tolight_6 + vec3(-0.0078125, 0.0078125, -0.0078125));
- highp vec4 packDist_28;
- lowp vec4 tmpvar_29;
- tmpvar_29 = texture (_ShadowMapTexture, vec_27);
- packDist_28 = tmpvar_29;
- shadowVals_20.z = dot (packDist_28, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- highp vec3 vec_30;
- vec_30 = (tolight_6 + vec3(0.0078125, -0.0078125, -0.0078125));
- highp vec4 packDist_31;
- lowp vec4 tmpvar_32;
- tmpvar_32 = texture (_ShadowMapTexture, vec_30);
- packDist_31 = tmpvar_32;
- shadowVals_20.w = dot (packDist_31, vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- bvec4 tmpvar_33;
- tmpvar_33 = lessThan (shadowVals_20, vec4(mydist_19));
- highp vec4 tmpvar_34;
- tmpvar_34 = _LightShadowData.xxxx;
- highp float tmpvar_35;
- if (tmpvar_33.x) {
- tmpvar_35 = tmpvar_34.x;
- } else {
- tmpvar_35 = 1.0;
- };
- highp float tmpvar_36;
- if (tmpvar_33.y) {
- tmpvar_36 = tmpvar_34.y;
- } else {
- tmpvar_36 = 1.0;
- };
- highp float tmpvar_37;
- if (tmpvar_33.z) {
- tmpvar_37 = tmpvar_34.z;
- } else {
- tmpvar_37 = 1.0;
- };
- highp float tmpvar_38;
- if (tmpvar_33.w) {
- tmpvar_38 = tmpvar_34.w;
- } else {
- tmpvar_38 = 1.0;
- };
- mediump vec4 tmpvar_39;
- tmpvar_39.x = tmpvar_35;
- tmpvar_39.y = tmpvar_36;
- tmpvar_39.z = tmpvar_37;
- tmpvar_39.w = tmpvar_38;
- mediump float tmpvar_40;
- tmpvar_40 = dot (tmpvar_39, vec4(0.25, 0.25, 0.25, 0.25));
- atten_4 = (atten_4 * tmpvar_40);
- highp vec4 tmpvar_41;
- tmpvar_41.w = 1.0;
- tmpvar_41.xyz = wpos_7;
- lowp vec4 tmpvar_42;
- highp vec3 P_43;
- P_43 = (_LightMatrix0 * tmpvar_41).xyz;
- tmpvar_42 = texture (_LightTexture0, P_43);
- atten_4 = (atten_4 * tmpvar_42.w);
- highp vec3 tmpvar_44;
- tmpvar_44 = normalize((lightDir_5 - normalize(
- (wpos_7 - _WorldSpaceCameraPos)
- )));
- h_3 = tmpvar_44;
- mediump float tmpvar_45;
- tmpvar_45 = pow (max (0.0, dot (h_3, normal_9)), (nspec_10.w * 128.0));
- spec_2 = tmpvar_45;
- spec_2 = (spec_2 * clamp (atten_4, 0.0, 1.0));
- res_1.xyz = (_LightColor.xyz * (max (0.0,
- dot (lightDir_5, normal_9)
- ) * atten_4));
- mediump vec3 c_46;
- c_46 = _LightColor.xyz;
- res_1.w = (spec_2 * dot (c_46, vec3(0.22, 0.707, 0.071)));
- highp float tmpvar_47;
- tmpvar_47 = clamp ((1.0 - (
- (tmpvar_15.z * unity_LightmapFade.z)
- + unity_LightmapFade.w)), 0.0, 1.0);
- res_1 = (res_1 * tmpvar_47);
- _fragData = exp2(-(res_1));
-}
-
-
-// stats: 62 alu 8 tex 4 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 3x1 [-1]
-// uniforms: 10 (total size: 0)
-// #0: _CameraToWorld (high float) 4x4 [-1]
-// #1: _LightColor (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _LightPos (high float) 4x1 [-1]
-// #4: _LightPositionRange (high float) 4x1 [-1]
-// #5: _LightShadowData (high float) 4x1 [-1]
-// #6: _ProjectionParams (high float) 4x1 [-1]
-// #7: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #8: _ZBufferParams (high float) 4x1 [-1]
-// #9: unity_LightmapFade (high float) 4x1 [-1]
-// textures: 5
-// #0: _CameraDepthTexture (low 2d) 0x0 [-1]
-// #1: _CameraNormalsTexture (low 2d) 0x0 [-1]
-// #2: _LightTexture0 (low cube) 0x0 [-1]
-// #3: _LightTextureB0 (low 2d) 0x0 [-1]
-// #4: _ShadowMapTexture (low cube) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt
deleted file mode 100644
index 69c08c6785f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-prepasslight-outES3Metal.txt
+++ /dev/null
@@ -1,188 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 xlv_TEXCOORD0;
- float3 xlv_TEXCOORD1;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- float4x4 _CameraToWorld;
- float4 _LightColor;
- float4x4 _LightMatrix0;
- float4 _LightPos;
- float4 _LightPositionRange;
- float4 _LightShadowData;
- float4 _ProjectionParams;
- float3 _WorldSpaceCameraPos;
- float4 _ZBufferParams;
- float4 unity_LightmapFade;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _CameraDepthTexture [[texture(0)]], sampler _mtlsmp__CameraDepthTexture [[sampler(0)]]
- , texture2d<half> _CameraNormalsTexture [[texture(1)]], sampler _mtlsmp__CameraNormalsTexture [[sampler(1)]]
- , texturecube<half> _LightTexture0 [[texture(2)]], sampler _mtlsmp__LightTexture0 [[sampler(2)]]
- , texture2d<half> _LightTextureB0 [[texture(3)]], sampler _mtlsmp__LightTextureB0 [[sampler(3)]]
- , texturecube<half> _ShadowMapTexture [[texture(4)]], sampler _mtlsmp__ShadowMapTexture [[sampler(4)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 res_1 = 0;
- float spec_2 = 0;
- half3 h_3 = 0;
- float atten_4 = 0;
- half3 lightDir_5 = 0;
- float3 tolight_6 = 0;
- float3 wpos_7 = 0;
- float depth_8 = 0;
- half3 normal_9 = 0;
- half4 nspec_10 = 0;
- float2 uv_11 = 0;
- uv_11 = (_mtl_i.xlv_TEXCOORD0.xy / _mtl_i.xlv_TEXCOORD0.w);
- half4 tmpvar_12 = 0;
- tmpvar_12 = _CameraNormalsTexture.sample(_mtlsmp__CameraNormalsTexture, (float2)(uv_11));
- nspec_10 = tmpvar_12;
- normal_9 = ((nspec_10.xyz * (half)(2.0)) - (half)(1.0));
- normal_9 = normalize(normal_9);
- half4 tmpvar_13 = 0;
- tmpvar_13 = _CameraDepthTexture.sample(_mtlsmp__CameraDepthTexture, (float2)(uv_11));
- depth_8 = float(tmpvar_13.x);
- float tmpvar_14 = 0;
- tmpvar_14 = (1.0/(((_mtl_u._ZBufferParams.x * depth_8) + _mtl_u._ZBufferParams.y)));
- depth_8 = tmpvar_14;
- float4 tmpvar_15 = 0;
- tmpvar_15.w = 1.0;
- tmpvar_15.xyz = ((_mtl_i.xlv_TEXCOORD1 * (_mtl_u._ProjectionParams.z / _mtl_i.xlv_TEXCOORD1.z)) * tmpvar_14);
- wpos_7 = (_mtl_u._CameraToWorld * tmpvar_15).xyz;
- tolight_6 = (wpos_7 - _mtl_u._LightPos.xyz);
- float3 tmpvar_16 = 0;
- tmpvar_16 = normalize(tolight_6);
- lightDir_5 = half3(-(tmpvar_16));
- float2 tmpvar_17 = 0;
- tmpvar_17 = float2((dot (tolight_6, tolight_6) * _mtl_u._LightPos.w));
- half4 tmpvar_18 = 0;
- tmpvar_18 = _LightTextureB0.sample(_mtlsmp__LightTextureB0, (float2)(tmpvar_17));
- atten_4 = float(tmpvar_18.w);
- float mydist_19 = 0;
- mydist_19 = (sqrt(dot (tolight_6, tolight_6)) * _mtl_u._LightPositionRange.w);
- mydist_19 = (mydist_19 * 0.97);
- float4 shadowVals_20 = 0;
- float3 vec_21 = 0;
- vec_21 = (tolight_6 + float3(0.0078125, 0.0078125, 0.0078125));
- float4 packDist_22 = 0;
- half4 tmpvar_23 = 0;
- tmpvar_23 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_21));
- packDist_22 = float4(tmpvar_23);
- shadowVals_20.x = dot (packDist_22, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- float3 vec_24 = 0;
- vec_24 = (tolight_6 + float3(-0.0078125, -0.0078125, 0.0078125));
- float4 packDist_25 = 0;
- half4 tmpvar_26 = 0;
- tmpvar_26 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_24));
- packDist_25 = float4(tmpvar_26);
- shadowVals_20.y = dot (packDist_25, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- float3 vec_27 = 0;
- vec_27 = (tolight_6 + float3(-0.0078125, 0.0078125, -0.0078125));
- float4 packDist_28 = 0;
- half4 tmpvar_29 = 0;
- tmpvar_29 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_27));
- packDist_28 = float4(tmpvar_29);
- shadowVals_20.z = dot (packDist_28, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- float3 vec_30 = 0;
- vec_30 = (tolight_6 + float3(0.0078125, -0.0078125, -0.0078125));
- float4 packDist_31 = 0;
- half4 tmpvar_32 = 0;
- tmpvar_32 = _ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, (float3)(vec_30));
- packDist_31 = float4(tmpvar_32);
- shadowVals_20.w = dot (packDist_31, float4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- bool4 tmpvar_33 = false;
- tmpvar_33 = bool4((shadowVals_20 < float4(mydist_19)));
- float4 tmpvar_34 = 0;
- tmpvar_34 = _mtl_u._LightShadowData.xxxx;
- float tmpvar_35 = 0;
- if (tmpvar_33.x) {
- tmpvar_35 = tmpvar_34.x;
- } else {
- tmpvar_35 = 1.0;
- };
- float tmpvar_36 = 0;
- if (tmpvar_33.y) {
- tmpvar_36 = tmpvar_34.y;
- } else {
- tmpvar_36 = 1.0;
- };
- float tmpvar_37 = 0;
- if (tmpvar_33.z) {
- tmpvar_37 = tmpvar_34.z;
- } else {
- tmpvar_37 = 1.0;
- };
- float tmpvar_38 = 0;
- if (tmpvar_33.w) {
- tmpvar_38 = tmpvar_34.w;
- } else {
- tmpvar_38 = 1.0;
- };
- half4 tmpvar_39 = 0;
- tmpvar_39.x = half(tmpvar_35);
- tmpvar_39.y = half(tmpvar_36);
- tmpvar_39.z = half(tmpvar_37);
- tmpvar_39.w = half(tmpvar_38);
- half tmpvar_40 = 0;
- tmpvar_40 = dot (tmpvar_39, (half4)float4(0.25, 0.25, 0.25, 0.25));
- atten_4 = (atten_4 * (float)(tmpvar_40));
- float4 tmpvar_41 = 0;
- tmpvar_41.w = 1.0;
- tmpvar_41.xyz = wpos_7;
- half4 tmpvar_42 = 0;
- float3 P_43 = 0;
- P_43 = (_mtl_u._LightMatrix0 * tmpvar_41).xyz;
- tmpvar_42 = _LightTexture0.sample(_mtlsmp__LightTexture0, (float3)(P_43));
- atten_4 = (atten_4 * (float)(tmpvar_42.w));
- float3 tmpvar_44 = 0;
- tmpvar_44 = normalize(((float3)(lightDir_5) - normalize(
- (wpos_7 - _mtl_u._WorldSpaceCameraPos)
- )));
- h_3 = half3(tmpvar_44);
- half tmpvar_45 = 0;
- tmpvar_45 = pow (max ((half)0.0, dot (h_3, normal_9)), (nspec_10.w * (half)(128.0)));
- spec_2 = float(tmpvar_45);
- spec_2 = (spec_2 * clamp (atten_4, 0.0, 1.0));
- res_1.xyz = half3((_mtl_u._LightColor.xyz * ((float)(max ((half)0.0,
- dot (lightDir_5, normal_9)
- )) * atten_4)));
- half3 c_46 = 0;
- c_46 = half3(_mtl_u._LightColor.xyz);
- res_1.w = half((spec_2 * (float)(dot (c_46, (half3)float3(0.22, 0.707, 0.071)))));
- float tmpvar_47 = 0;
- tmpvar_47 = clamp ((1.0 - (
- (tmpvar_15.z * _mtl_u.unity_LightmapFade.z)
- + _mtl_u.unity_LightmapFade.w)), 0.0, 1.0);
- res_1 = ((half4)((float4)(res_1) * tmpvar_47));
- _mtl_o._fragData = exp2(-(res_1));
- return _mtl_o;
-}
-
-
-// stats: 62 alu 8 tex 4 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 3x1 [-1]
-// uniforms: 10 (total size: 256)
-// #0: _CameraToWorld (high float) 4x4 [-1] loc 0
-// #1: _LightColor (high float) 4x1 [-1] loc 64
-// #2: _LightMatrix0 (high float) 4x4 [-1] loc 80
-// #3: _LightPos (high float) 4x1 [-1] loc 144
-// #4: _LightPositionRange (high float) 4x1 [-1] loc 160
-// #5: _LightShadowData (high float) 4x1 [-1] loc 176
-// #6: _ProjectionParams (high float) 4x1 [-1] loc 192
-// #7: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 208
-// #8: _ZBufferParams (high float) 4x1 [-1] loc 224
-// #9: unity_LightmapFade (high float) 4x1 [-1] loc 240
-// textures: 5
-// #0: _CameraDepthTexture (low 2d) 0x0 [-1] loc 0
-// #1: _CameraNormalsTexture (low 2d) 0x0 [-1] loc 1
-// #2: _LightTexture0 (low cube) 0x0 [-1] loc 2
-// #3: _LightTextureB0 (low 2d) 0x0 [-1] loc 3
-// #4: _ShadowMapTexture (low cube) 0x0 [-1] loc 4
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-inES3.txt
deleted file mode 100644
index 55c6787cedb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-inES3.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-#version 300 es
-
-#define gl_FragColor _glesFragData[0]
-#define gl_FragData _glesFragData
-layout(location = 0) out mediump vec4 _glesFragData[4];
-
-struct v2f {
- highp vec4 pos;
- highp vec2 uv;
-};
-
-uniform sampler2D _MainTex;
-uniform sampler2D _Curve;
-uniform highp float _RangeScale;
-
-highp vec3 FromCIE( in highp vec3 Yxy ) {
- highp vec3 XYZ;
- XYZ.x = ((Yxy.x * Yxy.y) / Yxy.z);
- XYZ.y = Yxy.x;
- XYZ.z = ((Yxy.x * ((1.0 - Yxy.y) - Yxy.z)) / Yxy.z);
- highp mat3 XYZ2RGB = mat3(2.5651, -1.0217, 0.0753, -1.1665, 1.9777, -0.2543, -0.3986, 0.0439, 1.1892);
- return (XYZ2RGB * XYZ);
-}
-highp vec3 ToCIE( in highp vec3 FullScreenImage ) {
- highp mat3 RGB2XYZ = mat3(0.514136, 0.265068, 0.0241188, 0.323879, 0.670234, 0.122818, 0.160364, 0.0640916, 0.844427);
- highp vec3 XYZ = (RGB2XYZ * FullScreenImage.xyz);
- highp vec3 Yxy;
- Yxy.x = XYZ.y;
- highp float temp = dot( vec3( 1.0, 1.0, 1.0), XYZ.xyz);
- Yxy.yz = (XYZ.xy / temp);
- return Yxy;
-}
-highp vec4 fragCurve( in v2f i ) {
- highp vec4 color = texture( _MainTex, i.uv);
- highp vec3 cie = ToCIE( color.xyz);
- highp float newLum = texture( _Curve, vec2( (cie.x * _RangeScale), 0.5)).x;
- cie.x = newLum;
- color.xyz = FromCIE( cie);
- return color;
-}
-in highp vec2 xlv_TEXCOORD0;
-void main() {
- highp vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2(xlv_TEXCOORD0);
- xl_retval = fragCurve(xlt_i);
- gl_FragData[0] = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3.txt
deleted file mode 100644
index 5b0a7e25957..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-#version 300 es
-layout(location=0) out mediump vec4 _glesFragData[4];
-uniform sampler2D _MainTex;
-uniform sampler2D _Curve;
-uniform highp float _RangeScale;
-in highp vec2 xlv_TEXCOORD0;
-void main ()
-{
- highp float newLum_1;
- highp vec3 cie_2;
- highp vec4 color_3;
- lowp vec4 tmpvar_4;
- tmpvar_4 = texture (_MainTex, xlv_TEXCOORD0);
- color_3 = tmpvar_4;
- highp vec3 Yxy_5;
- highp vec3 tmpvar_6;
- tmpvar_6 = (mat3(0.514136, 0.265068, 0.0241188, 0.323879, 0.670234, 0.122818, 0.160364, 0.0640916, 0.844427) * color_3.xyz);
- Yxy_5.x = tmpvar_6.y;
- Yxy_5.yz = (tmpvar_6.xy / dot (vec3(1.0, 1.0, 1.0), tmpvar_6));
- cie_2.yz = Yxy_5.yz;
- highp vec2 tmpvar_7;
- tmpvar_7.y = 0.5;
- tmpvar_7.x = (tmpvar_6.y * _RangeScale);
- lowp float tmpvar_8;
- tmpvar_8 = texture (_Curve, tmpvar_7).x;
- newLum_1 = tmpvar_8;
- cie_2.x = newLum_1;
- highp vec3 XYZ_9;
- XYZ_9.x = ((newLum_1 * Yxy_5.y) / Yxy_5.z);
- XYZ_9.y = cie_2.x;
- XYZ_9.z = ((newLum_1 * (
- (1.0 - Yxy_5.y)
- - Yxy_5.z)) / Yxy_5.z);
- color_3.xyz = (mat3(2.5651, -1.0217, 0.0753, -1.1665, 1.9777, -0.2543, -0.3986, 0.0439, 1.1892) * XYZ_9);
- _glesFragData[0] = color_3;
-}
-
-
-// stats: 12 alu 2 tex 0 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _RangeScale (high float) 1x1 [-1]
-// textures: 2
-// #0: _MainTex (low 2d) 0x0 [-1]
-// #1: _Curve (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3Metal.txt
deleted file mode 100644
index 23a9b2745f0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-tonemap-usercurve-outES3Metal.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float2 xlv_TEXCOORD0;
-};
-struct xlatMtlShaderOutput {
- half4 _glesFragData_0 [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- float _RangeScale;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]]
- , texture2d<half> _Curve [[texture(1)]], sampler _mtlsmp__Curve [[sampler(1)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float newLum_1 = 0;
- float3 cie_2 = 0;
- float4 color_3 = 0;
- half4 tmpvar_4 = 0;
- tmpvar_4 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
- color_3 = float4(tmpvar_4);
- float3 Yxy_5 = 0;
- float3 tmpvar_6 = 0;
- tmpvar_6 = (float3x3(float3(0.514136, 0.265068, 0.0241188), float3(0.323879, 0.670234, 0.122818), float3(0.160364, 0.0640916, 0.844427)) * color_3.xyz);
- Yxy_5.x = tmpvar_6.y;
- Yxy_5.yz = (tmpvar_6.xy / dot (float3(1.0, 1.0, 1.0), tmpvar_6));
- cie_2.yz = Yxy_5.yz;
- float2 tmpvar_7 = 0;
- tmpvar_7.y = 0.5;
- tmpvar_7.x = (tmpvar_6.y * _mtl_u._RangeScale);
- half tmpvar_8 = 0;
- tmpvar_8 = _Curve.sample(_mtlsmp__Curve, (float2)(tmpvar_7)).x;
- newLum_1 = float(tmpvar_8);
- cie_2.x = newLum_1;
- float3 XYZ_9 = 0;
- XYZ_9.x = ((newLum_1 * Yxy_5.y) / Yxy_5.z);
- XYZ_9.y = cie_2.x;
- XYZ_9.z = ((newLum_1 * (
- (1.0 - Yxy_5.y)
- - Yxy_5.z)) / Yxy_5.z);
- color_3.xyz = (float3x3(float3(2.5651, -1.0217, 0.0753), float3(-1.1665, 1.9777, -0.2543), float3(-0.3986, 0.0439, 1.1892)) * XYZ_9);
- _mtl_o._glesFragData_0 = half4(color_3);
- return _mtl_o;
-}
-
-
-// stats: 12 alu 2 tex 0 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// uniforms: 1 (total size: 4)
-// #0: _RangeScale (high float) 1x1 [-1] loc 0
-// textures: 2
-// #0: _MainTex (low 2d) 0x0 [-1] loc 0
-// #1: _Curve (low 2d) 0x0 [-1] loc 1
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-in.txt
deleted file mode 100644
index f48ba9e593d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-in.txt
+++ /dev/null
@@ -1,137 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Translucency;
- float ShadowOffset;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
- vec2 _LightCoord;
-};
-uniform sampler2D _BumpSpecMap;
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _ShadowStrength;
-uniform vec3 _TranslucencyColor;
-uniform sampler2D _TranslucencyMap;
-uniform float _TranslucencyViewDependency;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout LeafSurfaceOutput o );
-vec4 LightingTreeLeaf( in LeafSurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 xlat_main( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout LeafSurfaceOutput o ) {
- vec4 c;
- vec4 trngls;
- vec4 norspc;
- c = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = ((c.xyz * _Color.xyz ) * IN.color.w );
- trngls = texture2D( _TranslucencyMap, IN.uv_MainTex);
- o.Translucency = trngls.z ;
- o.Gloss = (trngls.w * _Color.x );
- o.Alpha = c.w ;
- norspc = texture2D( _BumpSpecMap, IN.uv_MainTex);
- o.Specular = norspc.x ;
- o.ShadowOffset = norspc.z ;
- o.Normal = vec3( UnpackNormal( norspc));
-}
-vec4 LightingTreeLeaf( in LeafSurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float nl;
- float nh;
- float spec;
- float backContrib;
- vec3 translucencyColor;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- nl = dot( s.Normal, lightDir);
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- backContrib = xll_saturate( dot( viewDir, ( -lightDir )) );
- backContrib = mix( xll_saturate( ( -nl ) ), backContrib, _TranslucencyViewDependency);
- translucencyColor = ((backContrib * s.Translucency) * _TranslucencyColor);
- nl = max( 0.000000, ((nl * 0.600000) + 0.400000));
- c.xyz = (s.Albedo * ((translucencyColor * 2.00000) + nl));
- c.xyz = ((c.xyz * _LightColor0.xyz ) + spec);
- c.xyz *= mix( 2.00000, (atten * 2.00000), _ShadowStrength);
- return c;
-}
-vec4 xlat_main( in v2f_surf IN ) {
- Input surfIN;
- LeafSurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- lightDir = IN.lightDir;
- c = LightingTreeLeaf( o, lightDir, normalize( vec3( IN.viewDir) ), (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = o.Alpha;
- return c;
-}
-varying vec2 xlv_TEXCOORD0;
-varying vec4 xlv_COLOR0;
-varying vec3 xlv_TEXCOORD1;
-varying vec3 xlv_TEXCOORD2;
-varying vec2 xlv_TEXCOORD3;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.hip_pack0 = vec2( xlv_TEXCOORD0);
- xlt_IN.lop_color = vec4( xlv_COLOR0);
- xlt_IN.lightDir = vec3( xlv_TEXCOORD1);
- xlt_IN.viewDir = vec3( xlv_TEXCOORD2);
- xlt_IN._LightCoord = vec2( xlv_TEXCOORD3);
- xl_retval = xlat_main( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-inES.txt
deleted file mode 100644
index ee09ebc7bc7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-inES.txt
+++ /dev/null
@@ -1,137 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct LeafSurfaceOutput {
- mediump vec3 Albedo;
- mediump vec3 Normal;
- mediump vec3 Emission;
- mediump float Translucency;
- mediump float ShadowOffset;
- mediump float Specular;
- mediump float Gloss;
- mediump float Alpha;
-};
-struct Input {
- highp vec2 uv_MainTex;
- highp vec4 color;
-};
-struct v2f_surf {
- highp vec4 pos;
- highp vec2 hip_pack0;
- highp vec4 lop_color;
- highp vec3 lightDir;
- highp vec3 viewDir;
- highp vec2 _LightCoord;
-};
-uniform sampler2D _BumpSpecMap;
-uniform highp vec4 _Color;
-uniform highp float _Cutoff;
-uniform highp vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform mediump float _ShadowStrength;
-uniform mediump vec3 _TranslucencyColor;
-uniform sampler2D _TranslucencyMap;
-uniform mediump float _TranslucencyViewDependency;
-mediump vec4 UnpackNormal( in mediump vec4 packednormal );
-void surf( in Input IN, inout LeafSurfaceOutput o );
-mediump vec4 LightingTreeLeaf( in LeafSurfaceOutput s, in mediump vec3 lightDir, in mediump vec3 viewDir, in mediump float atten );
-mediump vec4 xlat_main( in v2f_surf IN );
-mediump vec4 UnpackNormal( in mediump vec4 packednormal ) {
- mediump vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout LeafSurfaceOutput o ) {
- mediump vec4 c;
- mediump vec4 trngls;
- mediump vec4 norspc;
- c = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = ((c.xyz * _Color.xyz ) * IN.color.w );
- trngls = texture2D( _TranslucencyMap, IN.uv_MainTex);
- o.Translucency = trngls.z ;
- o.Gloss = (trngls.w * _Color.x );
- o.Alpha = c.w ;
- norspc = texture2D( _BumpSpecMap, IN.uv_MainTex);
- o.Specular = norspc.x ;
- o.ShadowOffset = norspc.z ;
- o.Normal = vec3( UnpackNormal( norspc));
-}
-mediump vec4 LightingTreeLeaf( in LeafSurfaceOutput s, in mediump vec3 lightDir, in mediump vec3 viewDir, in mediump float atten ) {
- mediump vec3 h;
- mediump float nl;
- mediump float nh;
- mediump float spec;
- mediump float backContrib;
- mediump vec3 translucencyColor;
- mediump vec4 c;
- h = normalize( (lightDir + viewDir) );
- nl = dot( s.Normal, lightDir);
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- backContrib = xll_saturate( dot( viewDir, ( -lightDir )) );
- backContrib = mix( xll_saturate( ( -nl ) ), backContrib, _TranslucencyViewDependency);
- translucencyColor = ((backContrib * s.Translucency) * _TranslucencyColor);
- nl = max( 0.000000, ((nl * 0.600000) + 0.400000));
- c.xyz = (s.Albedo * ((translucencyColor * 2.00000) + nl));
- c.xyz = ((c.xyz * _LightColor0.xyz ) + spec);
- c.xyz *= mix( 2.00000, (atten * 2.00000), _ShadowStrength);
- return c;
-}
-mediump vec4 xlat_main( in v2f_surf IN ) {
- Input surfIN;
- LeafSurfaceOutput o;
- mediump vec3 lightDir;
- mediump vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- lightDir = IN.lightDir;
- c = LightingTreeLeaf( o, lightDir, normalize( vec3( IN.viewDir) ), (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = o.Alpha;
- return c;
-}
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec4 xlv_COLOR0;
-varying highp vec3 xlv_TEXCOORD1;
-varying highp vec3 xlv_TEXCOORD2;
-varying highp vec2 xlv_TEXCOORD3;
-void main() {
- mediump vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.hip_pack0 = vec2( xlv_TEXCOORD0);
- xlt_IN.lop_color = vec4( xlv_COLOR0);
- xlt_IN.lightDir = vec3( xlv_TEXCOORD1);
- xlt_IN.viewDir = vec3( xlv_TEXCOORD2);
- xlt_IN._LightCoord = vec2( xlv_TEXCOORD3);
- xl_retval = xlat_main( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-out.txt
deleted file mode 100644
index 3ae3c668a1e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-out.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-uniform sampler2D _BumpSpecMap;
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _ShadowStrength;
-uniform vec3 _TranslucencyColor;
-uniform sampler2D _TranslucencyMap;
-uniform float _TranslucencyViewDependency;
-varying vec2 xlv_TEXCOORD0;
-varying vec4 xlv_COLOR0;
-varying vec3 xlv_TEXCOORD1;
-varying vec3 xlv_TEXCOORD2;
-varying vec2 xlv_TEXCOORD3;
-void main ()
-{
- vec4 c_1;
- vec4 tmpvar_2;
- tmpvar_2 = texture2D (_MainTex, xlv_TEXCOORD0);
- vec4 tmpvar_3;
- tmpvar_3 = texture2D (_TranslucencyMap, xlv_TEXCOORD0);
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_BumpSpecMap, xlv_TEXCOORD0);
- vec4 normal_5;
- normal_5.xy = ((tmpvar_4.wy * 2.0) - 1.0);
- normal_5.z = sqrt(((1.0 -
- (normal_5.x * normal_5.x)
- ) - (normal_5.y * normal_5.y)));
- float x_6;
- x_6 = (tmpvar_2.w - _Cutoff);
- if ((x_6 < 0.0)) {
- discard;
- };
- vec3 tmpvar_7;
- tmpvar_7 = normalize(xlv_TEXCOORD2);
- vec4 c_8;
- float tmpvar_9;
- tmpvar_9 = dot (normal_5.xyz, xlv_TEXCOORD1);
- c_8.xyz = (((tmpvar_2.xyz * _Color.xyz) * xlv_COLOR0.w) * ((
- ((mix (clamp (
- -(tmpvar_9)
- , 0.0, 1.0), clamp (
- dot (tmpvar_7, -(xlv_TEXCOORD1))
- , 0.0, 1.0), _TranslucencyViewDependency) * tmpvar_3.z) * _TranslucencyColor)
- * 2.0) + max (0.0,
- ((tmpvar_9 * 0.6) + 0.4)
- )));
- c_8.xyz = ((c_8.xyz * _LightColor0.xyz) + (pow (
- max (0.0, dot (normal_5.xyz, normalize((xlv_TEXCOORD1 + tmpvar_7))))
- ,
- (tmpvar_4.x * 128.0)
- ) * (tmpvar_3.w * _Color.x)));
- c_8.xyz = (c_8.xyz * mix (2.0, (texture2D (_LightTexture0, xlv_TEXCOORD3).w * 2.0), _ShadowStrength));
- c_1.xyz = c_8.xyz;
- c_1.w = tmpvar_2.w;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 40 alu 5 tex 1 flow
-// inputs: 5
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_COLOR0 (high float) 4x1 [-1]
-// #2: xlv_TEXCOORD1 (high float) 3x1 [-1]
-// #3: xlv_TEXCOORD2 (high float) 3x1 [-1]
-// #4: xlv_TEXCOORD3 (high float) 2x1 [-1]
-// uniforms: 6 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: _LightColor0 (high float) 4x1 [-1]
-// #3: _ShadowStrength (high float) 1x1 [-1]
-// #4: _TranslucencyColor (high float) 3x1 [-1]
-// #5: _TranslucencyViewDependency (high float) 1x1 [-1]
-// textures: 4
-// #0: _BumpSpecMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
-// #3: _TranslucencyMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-outES.txt
deleted file mode 100644
index e9a7ce8db80..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleaf-outES.txt
+++ /dev/null
@@ -1,97 +0,0 @@
-uniform sampler2D _BumpSpecMap;
-uniform highp vec4 _Color;
-uniform highp float _Cutoff;
-uniform highp vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform mediump float _ShadowStrength;
-uniform mediump vec3 _TranslucencyColor;
-uniform sampler2D _TranslucencyMap;
-uniform mediump float _TranslucencyViewDependency;
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec4 xlv_COLOR0;
-varying highp vec3 xlv_TEXCOORD1;
-varying highp vec3 xlv_TEXCOORD2;
-varying highp vec2 xlv_TEXCOORD3;
-void main ()
-{
- mediump vec4 c_1;
- mediump vec3 lightDir_2;
- mediump vec3 tmpvar_3;
- mediump float tmpvar_4;
- mediump vec4 norspc_5;
- mediump vec4 trngls_6;
- mediump vec4 c_7;
- lowp vec4 tmpvar_8;
- tmpvar_8 = texture2D (_MainTex, xlv_TEXCOORD0);
- c_7 = tmpvar_8;
- tmpvar_3 = ((c_7.xyz * _Color.xyz) * xlv_COLOR0.w);
- lowp vec4 tmpvar_9;
- tmpvar_9 = texture2D (_TranslucencyMap, xlv_TEXCOORD0);
- trngls_6 = tmpvar_9;
- tmpvar_4 = (trngls_6.w * _Color.x);
- lowp vec4 tmpvar_10;
- tmpvar_10 = texture2D (_BumpSpecMap, xlv_TEXCOORD0);
- norspc_5 = tmpvar_10;
- mediump vec4 normal_11;
- normal_11.xy = ((norspc_5.wy * 2.0) - 1.0);
- normal_11.z = sqrt(((1.0 -
- (normal_11.x * normal_11.x)
- ) - (normal_11.y * normal_11.y)));
- highp float x_12;
- x_12 = (c_7.w - _Cutoff);
- if ((x_12 < 0.0)) {
- discard;
- };
- lightDir_2 = xlv_TEXCOORD1;
- highp vec3 tmpvar_13;
- tmpvar_13 = normalize(xlv_TEXCOORD2);
- lowp vec4 tmpvar_14;
- tmpvar_14 = texture2D (_LightTexture0, xlv_TEXCOORD3);
- mediump vec3 viewDir_15;
- viewDir_15 = tmpvar_13;
- mediump float atten_16;
- atten_16 = tmpvar_14.w;
- mediump vec4 c_17;
- mediump float tmpvar_18;
- tmpvar_18 = dot (normal_11.xyz, lightDir_2);
- c_17.xyz = (tmpvar_3 * ((
- ((mix (clamp (
- -(tmpvar_18)
- , 0.0, 1.0), clamp (
- dot (viewDir_15, -(lightDir_2))
- , 0.0, 1.0), _TranslucencyViewDependency) * trngls_6.z) * _TranslucencyColor)
- * 2.0) + max (0.0,
- ((tmpvar_18 * 0.6) + 0.4)
- )));
- c_17.xyz = ((c_17.xyz * _LightColor0.xyz) + (pow (
- max (0.0, dot (normal_11.xyz, normalize((lightDir_2 + viewDir_15))))
- ,
- (norspc_5.x * 128.0)
- ) * tmpvar_4));
- c_17.xyz = (c_17.xyz * mix (2.0, (atten_16 * 2.0), _ShadowStrength));
- c_1.xyz = c_17.xyz;
- c_1.w = c_7.w;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 40 alu 5 tex 1 flow
-// inputs: 5
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_COLOR0 (high float) 4x1 [-1]
-// #2: xlv_TEXCOORD1 (high float) 3x1 [-1]
-// #3: xlv_TEXCOORD2 (high float) 3x1 [-1]
-// #4: xlv_TEXCOORD3 (high float) 2x1 [-1]
-// uniforms: 6 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: _LightColor0 (high float) 4x1 [-1]
-// #3: _ShadowStrength (medium float) 1x1 [-1]
-// #4: _TranslucencyColor (medium float) 3x1 [-1]
-// #5: _TranslucencyViewDependency (medium float) 1x1 [-1]
-// textures: 4
-// #0: _BumpSpecMap (low 2d) 0x0 [-1]
-// #1: _LightTexture0 (low 2d) 0x0 [-1]
-// #2: _MainTex (low 2d) 0x0 [-1]
-// #3: _TranslucencyMap (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES.txt
deleted file mode 100644
index 0f338bdf2be..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES.txt
+++ /dev/null
@@ -1,81 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-#line 11
-struct v2f {
- highp vec4 pos;
- highp vec2 uv;
- highp vec3 color;
- highp vec3 backContrib;
- highp vec3 nl;
- highp vec3 nh;
-};
-uniform lowp vec4 UNITY_LIGHTMODEL_AMBIENT;
-uniform sampler2D _BumpSpecMap;
-uniform lowp float _Cutoff;
-uniform sampler2D _MainTex;
-uniform lowp vec4 _SpecColor;
-uniform highp vec4 _TerrainTreeLightColors[4];
-uniform lowp vec3 _TranslucencyColor;
-uniform sampler2D _TranslucencyMap;
-lowp vec4 xlat_main( in v2f i );
-#line 30
-lowp vec4 xlat_main( in v2f i ) {
- lowp vec4 col;
- lowp vec3 albedo;
- mediump float specular;
- lowp vec4 trngls;
- mediump float gloss;
- mediump vec3 light;
- mediump vec3 backContribs;
- highp int j = 0;
- mediump vec3 lightColor;
- mediump vec3 translucencyColor;
- mediump float nl;
- mediump float nh;
- mediump float spec;
- lowp vec4 c;
- col = texture2D( _MainTex, i.uv);
- xll_clip((col.w - _Cutoff));
- #line 35
- albedo = (col.xyz * i.color);
- specular = (texture2D( _BumpSpecMap, i.uv).x * 128.000);
- #line 39
- trngls = texture2D( _TranslucencyMap, i.uv);
- gloss = trngls.w;
- light = (vec3( UNITY_LIGHTMODEL_AMBIENT) * albedo);
- #line 44
- backContribs = (i.backContrib * trngls.z);
- for ( ; (j < 3); (j++)) {
- #line 48
- lightColor = _TerrainTreeLightColors[j].xyz;
- translucencyColor = (backContribs[j] * _TranslucencyColor);
- nl = i.nl[j];
- #line 52
- nh = i.nh[j];
- spec = (pow( nh, specular) * gloss);
- light += (((albedo * (translucencyColor + nl)) + (_SpecColor.xyz * spec)) * lightColor);
- }
- #line 58
- c.xyz = (light * 2.00000);
- c.w = 1.00000;
- return c;
-}
-varying highp vec4 xlv_SV_POSITION;
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec3 xlv_TEXCOORD1;
-varying highp vec3 xlv_TEXCOORD2;
-varying highp vec3 xlv_TEXCOORD3;
-varying highp vec3 xlv_TEXCOORD4;
-void main() {
- lowp vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4( xlv_SV_POSITION);
- xlt_i.uv = vec2( xlv_TEXCOORD0);
- xlt_i.color = vec3( xlv_TEXCOORD1);
- xlt_i.backContrib = vec3( xlv_TEXCOORD2);
- xlt_i.nl = vec3( xlv_TEXCOORD3);
- xlt_i.nh = vec3( xlv_TEXCOORD4);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt
deleted file mode 100644
index e7a79e38202..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-inES3.txt
+++ /dev/null
@@ -1,81 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f {
- highp vec4 pos;
- highp vec2 uv;
- highp vec3 color;
- highp vec3 backContrib;
- highp vec3 nl;
- highp vec3 nh;
-};
-uniform lowp vec4 UNITY_LIGHTMODEL_AMBIENT;
-uniform sampler2D _BumpSpecMap;
-uniform lowp float _Cutoff;
-uniform sampler2D _MainTex;
-uniform lowp vec4 _SpecColor;
-uniform highp vec4 _TerrainTreeLightColors[4];
-uniform lowp vec3 _TranslucencyColor;
-uniform sampler2D _TranslucencyMap;
-lowp vec4 xlat_main( in v2f i );
-lowp vec4 xlat_main( in v2f i ) {
- lowp vec4 col;
- lowp vec3 albedo;
- mediump float specular;
- lowp vec4 trngls;
- mediump float gloss;
- mediump vec3 light;
- mediump vec3 backContribs;
- highp int j = 0;
- mediump vec3 lightColor;
- mediump vec3 translucencyColor;
- mediump float nl;
- mediump float nh;
- mediump float spec;
- lowp vec4 c;
- col = texture( _MainTex, i.uv);
- xll_clip((col.w - _Cutoff));
- #line 35
- albedo = (col.xyz * i.color);
- specular = (texture( _BumpSpecMap, i.uv).x * 128.000);
- #line 39
- trngls = texture( _TranslucencyMap, i.uv);
- gloss = trngls.w;
- light = (vec3( UNITY_LIGHTMODEL_AMBIENT) * albedo);
- #line 44
- backContribs = (i.backContrib * trngls.z);
- for ( ; (j < 3); (j++)) {
- #line 48
- lightColor = _TerrainTreeLightColors[j].xyz;
- translucencyColor = (backContribs[j] * _TranslucencyColor);
- nl = i.nl[j];
- #line 52
- nh = i.nh[j];
- spec = (pow( nh, specular) * gloss);
- light += (((albedo * (translucencyColor + nl)) + (_SpecColor.xyz * spec)) * lightColor);
- }
- #line 58
- c.xyz = (light * 2.00000);
- c.w = 1.00000;
- return c;
-}
-in highp vec4 xlv_SV_POSITION;
-in highp vec2 xlv_TEXCOORD0;
-in highp vec3 xlv_TEXCOORD1;
-in highp vec3 xlv_TEXCOORD2;
-in highp vec3 xlv_TEXCOORD3;
-in highp vec3 xlv_TEXCOORD4;
-void main() {
- lowp vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4( xlv_SV_POSITION);
- xlt_i.uv = vec2( xlv_TEXCOORD0);
- xlt_i.color = vec3( xlv_TEXCOORD1);
- xlt_i.backContrib = vec3( xlv_TEXCOORD2);
- xlt_i.nl = vec3( xlv_TEXCOORD3);
- xlt_i.nh = vec3( xlv_TEXCOORD4);
- xl_retval = xlat_main( xlt_i);
- _fragData = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES.txt
deleted file mode 100644
index 32a5b73d49a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-uniform lowp vec4 UNITY_LIGHTMODEL_AMBIENT;
-uniform sampler2D _BumpSpecMap;
-uniform lowp float _Cutoff;
-uniform sampler2D _MainTex;
-uniform lowp vec4 _SpecColor;
-uniform highp vec4 _TerrainTreeLightColors[4];
-uniform lowp vec3 _TranslucencyColor;
-uniform sampler2D _TranslucencyMap;
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec3 xlv_TEXCOORD1;
-varying highp vec3 xlv_TEXCOORD2;
-varying highp vec3 xlv_TEXCOORD3;
-varying highp vec3 xlv_TEXCOORD4;
-void main ()
-{
- lowp vec4 c_1;
- mediump float nh_2;
- mediump float nl_3;
- mediump vec3 lightColor_4;
- mediump vec3 backContribs_5;
- mediump vec3 light_6;
- mediump float gloss_7;
- mediump float specular_8;
- lowp vec3 albedo_9;
- lowp vec4 tmpvar_10;
- tmpvar_10 = texture2D (_MainTex, xlv_TEXCOORD0);
- lowp float x_11;
- x_11 = (tmpvar_10.w - _Cutoff);
- if ((x_11 < 0.0)) {
- discard;
- };
- albedo_9 = (tmpvar_10.xyz * xlv_TEXCOORD1);
- lowp vec4 tmpvar_12;
- tmpvar_12 = texture2D (_BumpSpecMap, xlv_TEXCOORD0);
- specular_8 = (tmpvar_12.x * 128.0);
- lowp vec4 tmpvar_13;
- tmpvar_13 = texture2D (_TranslucencyMap, xlv_TEXCOORD0);
- gloss_7 = tmpvar_13.w;
- light_6 = (UNITY_LIGHTMODEL_AMBIENT.xyz * albedo_9);
- backContribs_5 = (xlv_TEXCOORD2 * tmpvar_13.z);
- lightColor_4 = _TerrainTreeLightColors[0].xyz;
- nl_3 = xlv_TEXCOORD3.x;
- nh_2 = xlv_TEXCOORD4.x;
- light_6 = (light_6 + ((
- (albedo_9 * ((backContribs_5.x * _TranslucencyColor) + nl_3))
- +
- (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7))
- ) * lightColor_4));
- lightColor_4 = _TerrainTreeLightColors[1].xyz;
- nl_3 = xlv_TEXCOORD3.y;
- nh_2 = xlv_TEXCOORD4.y;
- light_6 = (light_6 + ((
- (albedo_9 * ((backContribs_5.y * _TranslucencyColor) + nl_3))
- +
- (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7))
- ) * lightColor_4));
- lightColor_4 = _TerrainTreeLightColors[2].xyz;
- nl_3 = xlv_TEXCOORD3.z;
- nh_2 = xlv_TEXCOORD4.z;
- light_6 = (light_6 + ((
- (albedo_9 * ((backContribs_5.z * _TranslucencyColor) + nl_3))
- +
- (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7))
- ) * lightColor_4));
- c_1.xyz = (light_6 * 2.0);
- c_1.w = 1.0;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 35 alu 4 tex 1 flow
-// inputs: 5
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 3x1 [-1]
-// #2: xlv_TEXCOORD2 (high float) 3x1 [-1]
-// #3: xlv_TEXCOORD3 (high float) 3x1 [-1]
-// #4: xlv_TEXCOORD4 (high float) 3x1 [-1]
-// uniforms: 5 (total size: 0)
-// #0: UNITY_LIGHTMODEL_AMBIENT (low float) 4x1 [-1]
-// #1: _Cutoff (low float) 1x1 [-1]
-// #2: _SpecColor (low float) 4x1 [-1]
-// #3: _TerrainTreeLightColors (high float) 4x1 [4]
-// #4: _TranslucencyColor (low float) 3x1 [-1]
-// textures: 3
-// #0: _BumpSpecMap (low 2d) 0x0 [-1]
-// #1: _MainTex (low 2d) 0x0 [-1]
-// #2: _TranslucencyMap (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3.txt
deleted file mode 100644
index f7a25f42712..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-uniform lowp vec4 UNITY_LIGHTMODEL_AMBIENT;
-uniform sampler2D _BumpSpecMap;
-uniform lowp float _Cutoff;
-uniform sampler2D _MainTex;
-uniform lowp vec4 _SpecColor;
-uniform highp vec4 _TerrainTreeLightColors[4];
-uniform lowp vec3 _TranslucencyColor;
-uniform sampler2D _TranslucencyMap;
-in highp vec2 xlv_TEXCOORD0;
-in highp vec3 xlv_TEXCOORD1;
-in highp vec3 xlv_TEXCOORD2;
-in highp vec3 xlv_TEXCOORD3;
-in highp vec3 xlv_TEXCOORD4;
-void main ()
-{
- lowp vec4 c_1;
- mediump float nh_2;
- mediump float nl_3;
- mediump vec3 lightColor_4;
- mediump vec3 backContribs_5;
- mediump vec3 light_6;
- mediump float gloss_7;
- mediump float specular_8;
- lowp vec3 albedo_9;
- lowp vec4 tmpvar_10;
- tmpvar_10 = texture (_MainTex, xlv_TEXCOORD0);
- lowp float x_11;
- x_11 = (tmpvar_10.w - _Cutoff);
- if ((x_11 < 0.0)) {
- discard;
- };
- albedo_9 = (tmpvar_10.xyz * xlv_TEXCOORD1);
- lowp vec4 tmpvar_12;
- tmpvar_12 = texture (_BumpSpecMap, xlv_TEXCOORD0);
- specular_8 = (tmpvar_12.x * 128.0);
- lowp vec4 tmpvar_13;
- tmpvar_13 = texture (_TranslucencyMap, xlv_TEXCOORD0);
- gloss_7 = tmpvar_13.w;
- light_6 = (UNITY_LIGHTMODEL_AMBIENT.xyz * albedo_9);
- backContribs_5 = (xlv_TEXCOORD2 * tmpvar_13.z);
- lightColor_4 = _TerrainTreeLightColors[0].xyz;
- nl_3 = xlv_TEXCOORD3.x;
- nh_2 = xlv_TEXCOORD4.x;
- light_6 = (light_6 + ((
- (albedo_9 * ((backContribs_5.x * _TranslucencyColor) + nl_3))
- +
- (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7))
- ) * lightColor_4));
- lightColor_4 = _TerrainTreeLightColors[1].xyz;
- nl_3 = xlv_TEXCOORD3.y;
- nh_2 = xlv_TEXCOORD4.y;
- light_6 = (light_6 + ((
- (albedo_9 * ((backContribs_5.y * _TranslucencyColor) + nl_3))
- +
- (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7))
- ) * lightColor_4));
- lightColor_4 = _TerrainTreeLightColors[2].xyz;
- nl_3 = xlv_TEXCOORD3.z;
- nh_2 = xlv_TEXCOORD4.z;
- light_6 = (light_6 + ((
- (albedo_9 * ((backContribs_5.z * _TranslucencyColor) + nl_3))
- +
- (_SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7))
- ) * lightColor_4));
- c_1.xyz = (light_6 * 2.0);
- c_1.w = 1.0;
- _fragData = c_1;
-}
-
-
-// stats: 35 alu 4 tex 1 flow
-// inputs: 5
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 3x1 [-1]
-// #2: xlv_TEXCOORD2 (high float) 3x1 [-1]
-// #3: xlv_TEXCOORD3 (high float) 3x1 [-1]
-// #4: xlv_TEXCOORD4 (high float) 3x1 [-1]
-// uniforms: 5 (total size: 0)
-// #0: UNITY_LIGHTMODEL_AMBIENT (low float) 4x1 [-1]
-// #1: _Cutoff (low float) 1x1 [-1]
-// #2: _SpecColor (low float) 4x1 [-1]
-// #3: _TerrainTreeLightColors (high float) 4x1 [4]
-// #4: _TranslucencyColor (low float) 3x1 [-1]
-// textures: 3
-// #0: _BumpSpecMap (low 2d) 0x0 [-1]
-// #1: _MainTex (low 2d) 0x0 [-1]
-// #2: _TranslucencyMap (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3Metal.txt
deleted file mode 100644
index 7d379372097..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-treeleafloop-outES3Metal.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float2 xlv_TEXCOORD0;
- float3 xlv_TEXCOORD1;
- float3 xlv_TEXCOORD2;
- float3 xlv_TEXCOORD3;
- float3 xlv_TEXCOORD4;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- half4 UNITY_LIGHTMODEL_AMBIENT;
- half _Cutoff;
- half4 _SpecColor;
- float4 _TerrainTreeLightColors[4];
- half3 _TranslucencyColor;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _BumpSpecMap [[texture(0)]], sampler _mtlsmp__BumpSpecMap [[sampler(0)]]
- , texture2d<half> _MainTex [[texture(1)]], sampler _mtlsmp__MainTex [[sampler(1)]]
- , texture2d<half> _TranslucencyMap [[texture(2)]], sampler _mtlsmp__TranslucencyMap [[sampler(2)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- half nh_2 = 0;
- half nl_3 = 0;
- half3 lightColor_4 = 0;
- half3 backContribs_5 = 0;
- half3 light_6 = 0;
- half gloss_7 = 0;
- half specular_8 = 0;
- half3 albedo_9 = 0;
- half4 tmpvar_10 = 0;
- tmpvar_10 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
- half x_11 = 0;
- x_11 = (tmpvar_10.w - _mtl_u._Cutoff);
- if ((x_11 < (half)(0.0))) {
- discard_fragment();
- };
- albedo_9 = half3(((float3)(tmpvar_10.xyz) * _mtl_i.xlv_TEXCOORD1));
- half4 tmpvar_12 = 0;
- tmpvar_12 = _BumpSpecMap.sample(_mtlsmp__BumpSpecMap, (float2)(_mtl_i.xlv_TEXCOORD0));
- specular_8 = (tmpvar_12.x * (half)(128.0));
- half4 tmpvar_13 = 0;
- tmpvar_13 = _TranslucencyMap.sample(_mtlsmp__TranslucencyMap, (float2)(_mtl_i.xlv_TEXCOORD0));
- gloss_7 = tmpvar_13.w;
- light_6 = (_mtl_u.UNITY_LIGHTMODEL_AMBIENT.xyz * albedo_9);
- backContribs_5 = half3((_mtl_i.xlv_TEXCOORD2 * (float)(tmpvar_13.z)));
- lightColor_4 = half3(_mtl_u._TerrainTreeLightColors[0].xyz);
- nl_3 = half(_mtl_i.xlv_TEXCOORD3.x);
- nh_2 = half(_mtl_i.xlv_TEXCOORD4.x);
- light_6 = (light_6 + ((
- (albedo_9 * ((backContribs_5.x * _mtl_u._TranslucencyColor) + nl_3))
- +
- (_mtl_u._SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7))
- ) * lightColor_4));
- lightColor_4 = half3(_mtl_u._TerrainTreeLightColors[1].xyz);
- nl_3 = half(_mtl_i.xlv_TEXCOORD3.y);
- nh_2 = half(_mtl_i.xlv_TEXCOORD4.y);
- light_6 = (light_6 + ((
- (albedo_9 * ((backContribs_5.y * _mtl_u._TranslucencyColor) + nl_3))
- +
- (_mtl_u._SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7))
- ) * lightColor_4));
- lightColor_4 = half3(_mtl_u._TerrainTreeLightColors[2].xyz);
- nl_3 = half(_mtl_i.xlv_TEXCOORD3.z);
- nh_2 = half(_mtl_i.xlv_TEXCOORD4.z);
- light_6 = (light_6 + ((
- (albedo_9 * ((backContribs_5.z * _mtl_u._TranslucencyColor) + nl_3))
- +
- (_mtl_u._SpecColor.xyz * (pow (nh_2, specular_8) * gloss_7))
- ) * lightColor_4));
- c_1.xyz = (light_6 * (half)(2.0));
- c_1.w = half(1.0);
- _mtl_o._fragData = c_1;
- return _mtl_o;
-}
-
-
-// stats: 35 alu 4 tex 1 flow
-// inputs: 5
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 3x1 [-1]
-// #2: xlv_TEXCOORD2 (high float) 3x1 [-1]
-// #3: xlv_TEXCOORD3 (high float) 3x1 [-1]
-// #4: xlv_TEXCOORD4 (high float) 3x1 [-1]
-// uniforms: 5 (total size: 104)
-// #0: UNITY_LIGHTMODEL_AMBIENT (low float) 4x1 [-1] loc 0
-// #1: _Cutoff (low float) 1x1 [-1] loc 8
-// #2: _SpecColor (low float) 4x1 [-1] loc 16
-// #3: _TerrainTreeLightColors (high float) 4x1 [4] loc 32
-// #4: _TranslucencyColor (low float) 3x1 [-1] loc 96
-// textures: 3
-// #0: _BumpSpecMap (low 2d) 0x0 [-1] loc 0
-// #1: _MainTex (low 2d) 0x0 [-1] loc 1
-// #2: _TranslucencyMap (low 2d) 0x0 [-1] loc 2
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-in.txt
deleted file mode 100644
index e6094a056eb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-in.txt
+++ /dev/null
@@ -1,258 +0,0 @@
-#extension GL_ARB_shader_texture_lod : require
-
-vec4 xll_texCUBElod(samplerCube s, vec4 coord) {
- return textureCubeLod( s, coord.xyz, coord.w);
-}
-mat3 xll_transpose_mf3x3(mat3 m) {
- 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]);
-}
-float xll_saturate_f( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate_vf3( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_matrixindex_mf3x3_i (mat3 m, int i) { vec3 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; return v; }
-struct VertexOutput {
- vec4 pos;
- vec4 tex;
- vec4 posWorld;
- vec3 normalWorld;
- vec4 tangentWorld;
- vec3 extra;
- vec4 _ShadowCoord;
- vec3 lightDir;
-};
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _ProjectionParams;
-uniform vec4 _ScreenParams;
-uniform vec4 _ZBufferParams;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHC;
-uniform vec4 _LightShadowData;
-
-
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 unity_Scale;
-uniform mat4 glstate_matrix_transpose_modelview0;
-
-
-
-
-uniform mat4 unity_MatrixV;
-uniform mat4 unity_MatrixVP;
-uniform samplerCube _Cube;
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_ST;
-uniform sampler2D _DetailAlbedoMap;
-uniform vec4 _DetailAlbedoMap_ST;
-uniform sampler2D _AlphaMap;
-uniform sampler2D _Occlusion;
-uniform sampler2D _DetailNormalMap;
-uniform vec4 _DetailNormalMap_ST;
-uniform float _DetailNormalMapScale;
-uniform sampler2D _BumpMap;
-uniform float _BumpScale;
-uniform float _Exposure;
-uniform float _DetailBumpScale;
-uniform float _AlphaTestRef;
-uniform float _DetailBumpTiling;
-uniform vec4 _Color;
-uniform vec4 _SpecularColor;
-uniform sampler2D _SpecGlossMap;
-uniform float _Glossiness;
-
-uniform vec4 unity_ColorSpaceGrey;
-
-uniform sampler2D _ShadowMapTexture;
-uniform vec4 _LightColor0;
-
-uniform samplerCube _SpecCube;
-uniform vec4 unity_LightmapST;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-uniform float _SelfIllumScale;
-uniform sampler2D _SelfIllum;
-
-vec3 Albedo( in vec4 texcoords ) {
- vec3 albedo = (_Color.xyz * texture2D( _MainTex, texcoords.xy).xyz);
- albedo *= (2.0 * texture2D( _DetailAlbedoMap, texcoords.zw).xyz);
- return albedo;
-}
-float Alpha( in vec2 uv ) {
- return (texture2D( _AlphaMap, uv).w * _Color.w);
-}
-float BlinnPhongTerm( in float roughness, in float NdotH ) {
- float m = (pow( roughness, 4.0) + 1e-05);
- float n = ((1.0 / m) - 2.0);
- float normTerm = ((n + 1.0) / 6.28318);
- float specTerm = pow( NdotH, n);
- return (specTerm * normTerm);
-}
-float BlinnTerm( in vec3 normal, in vec3 halfDir ) {
- return max( 0.0, dot( normal, halfDir));
-}
-float FresnelTerm( in float F0, in float cosA ) {
- float _Falloff = 5.0;
- float t = pow( abs((1.0 - cosA)), _Falloff);
- return (F0 + ((1.0 - F0) * t));
-}
-float CTGeometricTerm( in float NdotL, in float NdotH, in float NdotV, in float VdotH ) {
- VdotH += 1e-05;
- return min( 1.0, min( (((2.0 * NdotH) * NdotV) / VdotH), (((2.0 * NdotH) * NdotL) / VdotH)));
-}
-float GeometricTerm( in float NdotL, in float NdotH, in float NdotV, in float VdotH, in float LdotV ) {
- return CTGeometricTerm( NdotL, NdotH, NdotV, VdotH);
-}
-float LambertTerm( in vec3 normal, in vec3 lightDir ) {
- return max( 0.0, dot( normal, lightDir));
-}
-float RGBToLuminance( in vec3 color ) {
- vec3 lumSensitivity = vec3( 0.299, 0.587, 0.114);
- float luminance = dot( color, lumSensitivity);
- return luminance;
-}
-vec3 BRDF_Disney_PBS( in vec3 baseColor, in vec3 lightColor, in vec3 specColor, in float specular, in float roughness, in vec3 normal, in vec3 lightDir, in vec3 viewDir, in vec3 ambient, in vec3 env ) {
- vec3 halfDir = normalize((lightDir + viewDir));
- float nl = LambertTerm( normal, lightDir);
- float nh = BlinnTerm( normal, halfDir);
- float nv = max( 0.0, dot( normal, viewDir));
- float vh = max( 0.0, dot( viewDir, halfDir));
- float lv = max( 0.0, dot( lightDir, viewDir));
- float lh = max( 0.0, dot( lightDir, halfDir));
- float F = FresnelTerm( specular, vh);
- float G = GeometricTerm( nl, nh, nv, vh, lv);
- float R = BlinnPhongTerm( roughness, nh);
- R = max( 0.0, R);
- float Fd90 = (0.5 + ((2.0 * pow( lh, 2.0)) * roughness));
- float nlPow = pow( (1.00001 - nl), 5.0);
- float nvPow = pow( (1.00001 - nv), 5.0);
- float disneyDiffuse = ((1.0 + ((Fd90 - 1.0) * nlPow)) * (1.0 + ((Fd90 - 1.0) * nvPow)));
- float specularTerm = max( 0.0, (((F * G) * R) / ((4.0 * nv) + 1e-05)));
- float diffuseTerm = (disneyDiffuse * nl);
- vec3 diffuseColor = baseColor;
- vec3 color = (((diffuseColor * (ambient + (diffuseTerm * lightColor))) + (specColor * (env + (lightColor * specularTerm)))) + ((((1.0 - RGBToLuminance( specColor)) * (1.0 - roughness)) * FresnelTerm( 0.0, nv)) * env));
- return color;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return ((8.0 * color.w) * color.xyz);
-}
-vec3 DirLightmapDiffuse( in mat3 dirBasis, in vec4 color, in vec4 scale, in vec3 normal, in bool surfFuncWritesNormal, out vec3 scalePerBasisVector ) {
- vec3 lm = DecodeLightmap( color);
- scalePerBasisVector = DecodeLightmap( scale);
- if (surfFuncWritesNormal){
- vec3 normalInRnmBasis = xll_saturate_vf3((dirBasis * normal));
- lm *= dot( normalInRnmBasis, scalePerBasisVector);
- }
- return lm;
-}
-void DecodeDirLightmap( in vec3 normal, in vec4 colorLM, in vec4 scaleLM, out vec3 lightColor, out vec3 lightDir ) {
- mat3 unity_DirBasis = xll_transpose_mf3x3(mat3( vec3( 0.816497, 0.0, 0.57735), vec3( -0.408248, 0.707107, 0.57735), vec3( -0.408248, -0.707107, 0.57735)));
- vec3 scalePerBasisVector;
- lightColor = DirLightmapDiffuse( unity_DirBasis, colorLM, scaleLM, normal, true, scalePerBasisVector);
- lightDir = normalize((((scalePerBasisVector.x * xll_matrixindex_mf3x3_i (unity_DirBasis, 0)) + (scalePerBasisVector.y * xll_matrixindex_mf3x3_i (unity_DirBasis, 1))) + (scalePerBasisVector.z * xll_matrixindex_mf3x3_i (unity_DirBasis, 2))));
-}
-vec3 EnergyCalculator( in vec3 specColor, in float specular, in vec3 baseColor ) {
- return min( baseColor, (vec3( 1.0, 1.0, 1.0) - specular));
-}
-float toLinearFast1( in float c ) {
- float c2 = (c * c);
- return dot( vec2( 0.7532, 0.2468), vec2( c2, (c * c2)));
-}
-vec3 fromRGBM( in vec4 c ) {
- return ((c.xyz * toLinearFast1( c.w)) * _Exposure);
-}
-vec3 EnvMap( in vec4 worldNormal ) {
- vec4 envTexel = xll_texCUBElod( _SpecCube, vec4( worldNormal.xyz, worldNormal.w));
- return fromRGBM( envTexel);
-}
-float Occlusion( in vec2 uv ) {
- return texture2D( _Occlusion, uv).x;
-}
-vec4 SpecularGloss( in vec2 uv ) {
- vec4 specGloss = texture2D( _SpecGlossMap, uv);
- return vec4( specGloss.xyz, specGloss.w);
-}
-vec3 BlendNormals( in vec3 n1, in vec3 n2 ) {
- return normalize(vec3( (n1.xy + n2.xy), (n1.z * n2.z)));
-}
-vec3 UnpackScaleNormal( in vec4 packednormal, in float bumpScale ) {
- vec3 normal;
- normal.xy = ((packednormal.wy * 2.0) - 1.0);
- normal.xy *= bumpScale;
- normal.z = sqrt((1.0 - xll_saturate_f(dot( normal.xy, normal.xy))));
- return normal;
-}
-vec3 TangentNormal( in vec4 texcoords ) {
- vec3 normalTangent = UnpackScaleNormal( texture2D( _BumpMap, texcoords.xy), _BumpScale);
- vec3 detailNormalTangent = UnpackScaleNormal( texture2D( _DetailNormalMap, texcoords.zw), _DetailNormalMapScale);
- normalTangent = BlendNormals( normalTangent, detailNormalTangent);
- return normalTangent;
-}
-mat3 TangentToWorld( in vec3 normal, in vec3 tangent, in vec3 flip ) {
- vec3 binormal = (cross( normal, tangent) * flip);
- return xll_transpose_mf3x3(mat3( tangent, binormal, normal));
-}
-float unitySampleShadow( in vec4 shadowCoord ) {
- float shadow = texture2DProj( _ShadowMapTexture, shadowCoord).x;
- return shadow;
-}
-vec4 frag( in VertexOutput i ) {
- float atten = unitySampleShadow( i._ShadowCoord);
- mat3 tanToWorld = TangentToWorld( i.normalWorld, i.tangentWorld.xyz, vec3( i.tangentWorld.w));
- i.normalWorld = normalize(i.normalWorld);
- vec3 normalTangent = TangentNormal( i.tex);
- vec3 normalWorld = (normalTangent * tanToWorld);
- vec3 eyeVec = normalize((i.posWorld.xyz - _WorldSpaceCameraPos));
- vec4 specGloss = SpecularGloss( i.tex.xy);
- vec3 specColor = specGloss.xyz;
- float specular = RGBToLuminance( specGloss.xyz);
- float roughness = (1.0 - specGloss.w);
- vec3 env = vec3( 0.0);
- env = (EnvMap( vec4( reflect( eyeVec, normalWorld), (roughness * 5.0))) * Occlusion( i.tex.xy));
- vec3 lightColor = (_LightColor0.xyz * 2.0);
- vec3 lightDir = _WorldSpaceLightPos0.xyz;
- float subsurface = 1.0;
- vec3 ambient = vec3( 0.0);
- vec4 lmtex = texture2D( unity_Lightmap, i.extra.xy);
- vec4 lmIndTex = texture2D( unity_LightmapInd, i.extra.xy);
- vec3 lightDirTangent;
- DecodeDirLightmap( normalTangent, lmtex, lmIndTex, lightColor, lightDirTangent);
- lightDir = (lightDirTangent * tanToWorld);
- lightDir = normalize(lightDir);
- vec3 baseColor = EnergyCalculator( specColor, specular, Albedo( i.tex));
- vec3 color = BRDF_Disney_PBS( baseColor, (atten * lightColor), specColor, specular, roughness, normalWorld, lightDir, (-eyeVec), ambient, env);
- color += (texture2D( _SelfIllum, i.tex.xy).xyz * _SelfIllumScale);
- float alpha = Alpha( i.tex.xy);
- return vec4( color, alpha);
-}
-varying vec4 xlv_TEXCOORD0;
-varying vec4 xlv_TEXCOORD1;
-varying vec3 xlv_TEXCOORD2;
-varying vec4 xlv_TEXCOORD3;
-varying vec3 xlv_TEXCOORD4;
-varying vec4 xlv_TEXCOORD5;
-varying vec3 xlv_TEXCOORD7;
-void main() {
- vec4 xl_retval;
- VertexOutput xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.tex = vec4(xlv_TEXCOORD0);
- xlt_i.posWorld = vec4(xlv_TEXCOORD1);
- xlt_i.normalWorld = vec3(xlv_TEXCOORD2);
- xlt_i.tangentWorld = vec4(xlv_TEXCOORD3);
- xlt_i.extra = vec3(xlv_TEXCOORD4);
- xlt_i._ShadowCoord = vec4(xlv_TEXCOORD5);
- xlt_i.lightDir = vec3(xlv_TEXCOORD7);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt
deleted file mode 100644
index cc61bae0e57..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-inES3.txt
+++ /dev/null
@@ -1,259 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-
-vec4 xll_texCUBElod(samplerCube s, vec4 coord) {
- return textureLod( s, coord.xyz, coord.w);
-}
-mat3 xll_transpose_mf3x3(mat3 m) {
- 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]);
-}
-float xll_saturate_f( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate_vf3( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_matrixindex_mf3x3_i (mat3 m, int i) { vec3 v; v.x=m[0][i]; v.y=m[1][i]; v.z=m[2][i]; return v; }
-struct VertexOutput {
- vec4 pos;
- vec4 tex;
- vec4 posWorld;
- vec3 normalWorld;
- vec4 tangentWorld;
- vec3 extra;
- vec4 _ShadowCoord;
- vec3 lightDir;
-};
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _ProjectionParams;
-uniform vec4 _ScreenParams;
-uniform vec4 _ZBufferParams;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHC;
-uniform vec4 _LightShadowData;
-
-
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 unity_Scale;
-uniform mat4 glstate_matrix_transpose_modelview0;
-
-
-
-
-uniform mat4 unity_MatrixV;
-uniform mat4 unity_MatrixVP;
-uniform samplerCube _Cube;
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_ST;
-uniform sampler2D _DetailAlbedoMap;
-uniform vec4 _DetailAlbedoMap_ST;
-uniform sampler2D _AlphaMap;
-uniform sampler2D _Occlusion;
-uniform sampler2D _DetailNormalMap;
-uniform vec4 _DetailNormalMap_ST;
-uniform float _DetailNormalMapScale;
-uniform sampler2D _BumpMap;
-uniform float _BumpScale;
-uniform float _Exposure;
-uniform float _DetailBumpScale;
-uniform float _AlphaTestRef;
-uniform float _DetailBumpTiling;
-uniform vec4 _Color;
-uniform vec4 _SpecularColor;
-uniform sampler2D _SpecGlossMap;
-uniform float _Glossiness;
-
-uniform vec4 unity_ColorSpaceGrey;
-
-uniform sampler2D _ShadowMapTexture;
-uniform vec4 _LightColor0;
-
-uniform samplerCube _SpecCube;
-uniform vec4 unity_LightmapST;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-uniform float _SelfIllumScale;
-uniform sampler2D _SelfIllum;
-
-vec3 Albedo( in vec4 texcoords ) {
- vec3 albedo = (_Color.xyz * texture( _MainTex, texcoords.xy).xyz);
- albedo *= (2.0 * texture( _DetailAlbedoMap, texcoords.zw).xyz);
- return albedo;
-}
-float Alpha( in vec2 uv ) {
- return (texture( _AlphaMap, uv).w * _Color.w);
-}
-float BlinnPhongTerm( in float roughness, in float NdotH ) {
- float m = (pow( roughness, 4.0) + 1e-05);
- float n = ((1.0 / m) - 2.0);
- float normTerm = ((n + 1.0) / 6.28318);
- float specTerm = pow( NdotH, n);
- return (specTerm * normTerm);
-}
-float BlinnTerm( in vec3 normal, in vec3 halfDir ) {
- return max( 0.0, dot( normal, halfDir));
-}
-float FresnelTerm( in float F0, in float cosA ) {
- float _Falloff = 5.0;
- float t = pow( abs((1.0 - cosA)), _Falloff);
- return (F0 + ((1.0 - F0) * t));
-}
-float CTGeometricTerm( in float NdotL, in float NdotH, in float NdotV, in float VdotH ) {
- VdotH += 1e-05;
- return min( 1.0, min( (((2.0 * NdotH) * NdotV) / VdotH), (((2.0 * NdotH) * NdotL) / VdotH)));
-}
-float GeometricTerm( in float NdotL, in float NdotH, in float NdotV, in float VdotH, in float LdotV ) {
- return CTGeometricTerm( NdotL, NdotH, NdotV, VdotH);
-}
-float LambertTerm( in vec3 normal, in vec3 lightDir ) {
- return max( 0.0, dot( normal, lightDir));
-}
-float RGBToLuminance( in vec3 color ) {
- vec3 lumSensitivity = vec3( 0.299, 0.587, 0.114);
- float luminance = dot( color, lumSensitivity);
- return luminance;
-}
-vec3 BRDF_Disney_PBS( in vec3 baseColor, in vec3 lightColor, in vec3 specColor, in float specular, in float roughness, in vec3 normal, in vec3 lightDir, in vec3 viewDir, in vec3 ambient, in vec3 env ) {
- vec3 halfDir = normalize((lightDir + viewDir));
- float nl = LambertTerm( normal, lightDir);
- float nh = BlinnTerm( normal, halfDir);
- float nv = max( 0.0, dot( normal, viewDir));
- float vh = max( 0.0, dot( viewDir, halfDir));
- float lv = max( 0.0, dot( lightDir, viewDir));
- float lh = max( 0.0, dot( lightDir, halfDir));
- float F = FresnelTerm( specular, vh);
- float G = GeometricTerm( nl, nh, nv, vh, lv);
- float R = BlinnPhongTerm( roughness, nh);
- R = max( 0.0, R);
- float Fd90 = (0.5 + ((2.0 * pow( lh, 2.0)) * roughness));
- float nlPow = pow( (1.00001 - nl), 5.0);
- float nvPow = pow( (1.00001 - nv), 5.0);
- float disneyDiffuse = ((1.0 + ((Fd90 - 1.0) * nlPow)) * (1.0 + ((Fd90 - 1.0) * nvPow)));
- float specularTerm = max( 0.0, (((F * G) * R) / ((4.0 * nv) + 1e-05)));
- float diffuseTerm = (disneyDiffuse * nl);
- vec3 diffuseColor = baseColor;
- vec3 color = (((diffuseColor * (ambient + (diffuseTerm * lightColor))) + (specColor * (env + (lightColor * specularTerm)))) + ((((1.0 - RGBToLuminance( specColor)) * (1.0 - roughness)) * FresnelTerm( 0.0, nv)) * env));
- return color;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return ((8.0 * color.w) * color.xyz);
-}
-vec3 DirLightmapDiffuse( in mat3 dirBasis, in vec4 color, in vec4 scale, in vec3 normal, in bool surfFuncWritesNormal, out vec3 scalePerBasisVector ) {
- vec3 lm = DecodeLightmap( color);
- scalePerBasisVector = DecodeLightmap( scale);
- if (surfFuncWritesNormal){
- vec3 normalInRnmBasis = xll_saturate_vf3((dirBasis * normal));
- lm *= dot( normalInRnmBasis, scalePerBasisVector);
- }
- return lm;
-}
-void DecodeDirLightmap( in vec3 normal, in vec4 colorLM, in vec4 scaleLM, out vec3 lightColor, out vec3 lightDir ) {
- mat3 unity_DirBasis = xll_transpose_mf3x3(mat3( vec3( 0.816497, 0.0, 0.57735), vec3( -0.408248, 0.707107, 0.57735), vec3( -0.408248, -0.707107, 0.57735)));
- vec3 scalePerBasisVector;
- lightColor = DirLightmapDiffuse( unity_DirBasis, colorLM, scaleLM, normal, true, scalePerBasisVector);
- lightDir = normalize((((scalePerBasisVector.x * xll_matrixindex_mf3x3_i (unity_DirBasis, 0)) + (scalePerBasisVector.y * xll_matrixindex_mf3x3_i (unity_DirBasis, 1))) + (scalePerBasisVector.z * xll_matrixindex_mf3x3_i (unity_DirBasis, 2))));
-}
-vec3 EnergyCalculator( in vec3 specColor, in float specular, in vec3 baseColor ) {
- return min( baseColor, (vec3( 1.0, 1.0, 1.0) - specular));
-}
-float toLinearFast1( in float c ) {
- float c2 = (c * c);
- return dot( vec2( 0.7532, 0.2468), vec2( c2, (c * c2)));
-}
-vec3 fromRGBM( in vec4 c ) {
- return ((c.xyz * toLinearFast1( c.w)) * _Exposure);
-}
-vec3 EnvMap( in vec4 worldNormal ) {
- vec4 envTexel = xll_texCUBElod( _SpecCube, vec4( worldNormal.xyz, worldNormal.w));
- return fromRGBM( envTexel);
-}
-float Occlusion( in vec2 uv ) {
- return texture( _Occlusion, uv).x;
-}
-vec4 SpecularGloss( in vec2 uv ) {
- vec4 specGloss = texture( _SpecGlossMap, uv);
- return vec4( specGloss.xyz, specGloss.w);
-}
-vec3 BlendNormals( in vec3 n1, in vec3 n2 ) {
- return normalize(vec3( (n1.xy + n2.xy), (n1.z * n2.z)));
-}
-vec3 UnpackScaleNormal( in vec4 packednormal, in float bumpScale ) {
- vec3 normal;
- normal.xy = ((packednormal.wy * 2.0) - 1.0);
- normal.xy *= bumpScale;
- normal.z = sqrt((1.0 - xll_saturate_f(dot( normal.xy, normal.xy))));
- return normal;
-}
-vec3 TangentNormal( in vec4 texcoords ) {
- vec3 normalTangent = UnpackScaleNormal( texture( _BumpMap, texcoords.xy), _BumpScale);
- vec3 detailNormalTangent = UnpackScaleNormal( texture( _DetailNormalMap, texcoords.zw), _DetailNormalMapScale);
- normalTangent = BlendNormals( normalTangent, detailNormalTangent);
- return normalTangent;
-}
-mat3 TangentToWorld( in vec3 normal, in vec3 tangent, in vec3 flip ) {
- vec3 binormal = (cross( normal, tangent) * flip);
- return xll_transpose_mf3x3(mat3( tangent, binormal, normal));
-}
-float unitySampleShadow( in vec4 shadowCoord ) {
- float shadow = textureProj( _ShadowMapTexture, shadowCoord).x;
- return shadow;
-}
-vec4 frag( in VertexOutput i ) {
- float atten = unitySampleShadow( i._ShadowCoord);
- mat3 tanToWorld = TangentToWorld( i.normalWorld, i.tangentWorld.xyz, vec3( i.tangentWorld.w));
- i.normalWorld = normalize(i.normalWorld);
- vec3 normalTangent = TangentNormal( i.tex);
- vec3 normalWorld = (normalTangent * tanToWorld);
- vec3 eyeVec = normalize((i.posWorld.xyz - _WorldSpaceCameraPos));
- vec4 specGloss = SpecularGloss( i.tex.xy);
- vec3 specColor = specGloss.xyz;
- float specular = RGBToLuminance( specGloss.xyz);
- float roughness = (1.0 - specGloss.w);
- vec3 env = vec3( 0.0);
- env = (EnvMap( vec4( reflect( eyeVec, normalWorld), (roughness * 5.0))) * Occlusion( i.tex.xy));
- vec3 lightColor = (_LightColor0.xyz * 2.0);
- vec3 lightDir = _WorldSpaceLightPos0.xyz;
- float subsurface = 1.0;
- vec3 ambient = vec3( 0.0);
- vec4 lmtex = texture( unity_Lightmap, i.extra.xy);
- vec4 lmIndTex = texture( unity_LightmapInd, i.extra.xy);
- vec3 lightDirTangent;
- DecodeDirLightmap( normalTangent, lmtex, lmIndTex, lightColor, lightDirTangent);
- lightDir = (lightDirTangent * tanToWorld);
- lightDir = normalize(lightDir);
- vec3 baseColor = EnergyCalculator( specColor, specular, Albedo( i.tex));
- vec3 color = BRDF_Disney_PBS( baseColor, (atten * lightColor), specColor, specular, roughness, normalWorld, lightDir, (-eyeVec), ambient, env);
- color += (texture( _SelfIllum, i.tex.xy).xyz * _SelfIllumScale);
- float alpha = Alpha( i.tex.xy);
- return vec4( color, alpha);
-}
-in vec4 xlv_TEXCOORD0;
-in vec4 xlv_TEXCOORD1;
-in vec3 xlv_TEXCOORD2;
-in vec4 xlv_TEXCOORD3;
-in vec3 xlv_TEXCOORD4;
-in vec4 xlv_TEXCOORD5;
-in vec3 xlv_TEXCOORD7;
-void main() {
- vec4 xl_retval;
- VertexOutput xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.tex = vec4(xlv_TEXCOORD0);
- xlt_i.posWorld = vec4(xlv_TEXCOORD1);
- xlt_i.normalWorld = vec3(xlv_TEXCOORD2);
- xlt_i.tangentWorld = vec4(xlv_TEXCOORD3);
- xlt_i.extra = vec3(xlv_TEXCOORD4);
- xlt_i._ShadowCoord = vec4(xlv_TEXCOORD5);
- xlt_i.lightDir = vec3(xlv_TEXCOORD7);
- xl_retval = frag( xlt_i);
- _fragData = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-out.txt
deleted file mode 100644
index 5ed774868de..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-out.txt
+++ /dev/null
@@ -1,204 +0,0 @@
-#extension GL_ARB_shader_texture_lod : enable
-uniform vec3 _WorldSpaceCameraPos;
-uniform sampler2D _MainTex;
-uniform sampler2D _DetailAlbedoMap;
-uniform sampler2D _AlphaMap;
-uniform sampler2D _Occlusion;
-uniform sampler2D _DetailNormalMap;
-uniform float _DetailNormalMapScale;
-uniform sampler2D _BumpMap;
-uniform float _BumpScale;
-uniform float _Exposure;
-uniform vec4 _Color;
-uniform sampler2D _SpecGlossMap;
-uniform sampler2D _ShadowMapTexture;
-uniform samplerCube _SpecCube;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-uniform float _SelfIllumScale;
-uniform sampler2D _SelfIllum;
-varying vec4 xlv_TEXCOORD0;
-varying vec4 xlv_TEXCOORD1;
-varying vec3 xlv_TEXCOORD2;
-varying vec4 xlv_TEXCOORD3;
-varying vec3 xlv_TEXCOORD4;
-varying vec4 xlv_TEXCOORD5;
-void main ()
-{
- vec3 lightDir_1;
- vec3 env_2;
- vec3 tmpvar_3;
- vec3 tmpvar_4;
- tmpvar_3 = xlv_TEXCOORD3.xyz;
- tmpvar_4 = (((xlv_TEXCOORD2.yzx * xlv_TEXCOORD3.zxy) - (xlv_TEXCOORD2.zxy * xlv_TEXCOORD3.yzx)) * xlv_TEXCOORD3.www);
- mat3 tmpvar_5;
- tmpvar_5[0].x = tmpvar_3.x;
- tmpvar_5[0].y = tmpvar_4.x;
- tmpvar_5[0].z = xlv_TEXCOORD2.x;
- tmpvar_5[1].x = tmpvar_3.y;
- tmpvar_5[1].y = tmpvar_4.y;
- tmpvar_5[1].z = xlv_TEXCOORD2.y;
- tmpvar_5[2].x = tmpvar_3.z;
- tmpvar_5[2].y = tmpvar_4.z;
- tmpvar_5[2].z = xlv_TEXCOORD2.z;
- vec3 normal_6;
- normal_6.xy = ((texture2D (_BumpMap, xlv_TEXCOORD0.xy).wy * 2.0) - 1.0);
- normal_6.xy = (normal_6.xy * _BumpScale);
- normal_6.z = sqrt((1.0 - clamp (
- dot (normal_6.xy, normal_6.xy)
- , 0.0, 1.0)));
- vec3 normal_7;
- normal_7.xy = ((texture2D (_DetailNormalMap, xlv_TEXCOORD0.zw).wy * 2.0) - 1.0);
- normal_7.xy = (normal_7.xy * _DetailNormalMapScale);
- normal_7.z = sqrt((1.0 - clamp (
- dot (normal_7.xy, normal_7.xy)
- , 0.0, 1.0)));
- vec3 tmpvar_8;
- tmpvar_8.xy = (normal_6.xy + normal_7.xy);
- tmpvar_8.z = (normal_6.z * normal_7.z);
- vec3 tmpvar_9;
- tmpvar_9 = normalize(tmpvar_8);
- vec3 tmpvar_10;
- tmpvar_10 = (tmpvar_9 * tmpvar_5);
- vec3 tmpvar_11;
- tmpvar_11 = normalize((xlv_TEXCOORD1.xyz - _WorldSpaceCameraPos));
- vec4 tmpvar_12;
- tmpvar_12 = texture2D (_SpecGlossMap, xlv_TEXCOORD0.xy);
- float tmpvar_13;
- tmpvar_13 = dot (tmpvar_12.xyz, vec3(0.299, 0.587, 0.114));
- float tmpvar_14;
- tmpvar_14 = (1.0 - tmpvar_12.w);
- vec4 tmpvar_15;
- tmpvar_15.xyz = (tmpvar_11 - (2.0 * (
- dot (tmpvar_10, tmpvar_11)
- * tmpvar_10)));
- tmpvar_15.w = (tmpvar_14 * 5.0);
- vec4 tmpvar_16;
- tmpvar_16 = textureCubeLod (_SpecCube, tmpvar_15.xyz, tmpvar_15.w);
- float tmpvar_17;
- tmpvar_17 = (tmpvar_16.w * tmpvar_16.w);
- vec2 tmpvar_18;
- tmpvar_18.x = tmpvar_17;
- tmpvar_18.y = (tmpvar_16.w * tmpvar_17);
- env_2 = (((tmpvar_16.xyz *
- dot (vec2(0.7532, 0.2468), tmpvar_18)
- ) * _Exposure) * texture2D (_Occlusion, xlv_TEXCOORD0.xy).x);
- vec4 tmpvar_19;
- tmpvar_19 = texture2D (unity_Lightmap, xlv_TEXCOORD4.xy);
- vec4 tmpvar_20;
- tmpvar_20 = texture2D (unity_LightmapInd, xlv_TEXCOORD4.xy);
- mat3 tmpvar_21;
- tmpvar_21[0].x = 0.816497;
- tmpvar_21[0].y = -0.408248;
- tmpvar_21[0].z = -0.408248;
- tmpvar_21[1].x = 0.0;
- tmpvar_21[1].y = 0.707107;
- tmpvar_21[1].z = -0.707107;
- tmpvar_21[2].x = 0.57735;
- tmpvar_21[2].y = 0.57735;
- tmpvar_21[2].z = 0.57735;
- vec3 tmpvar_22;
- tmpvar_22 = ((8.0 * tmpvar_20.w) * tmpvar_20.xyz);
- vec3 v_23;
- v_23.x = tmpvar_21[0].x;
- v_23.y = tmpvar_21[1].x;
- v_23.z = tmpvar_21[2].x;
- vec3 v_24;
- v_24.x = tmpvar_21[0].y;
- v_24.y = tmpvar_21[1].y;
- v_24.z = tmpvar_21[2].y;
- vec3 v_25;
- v_25.x = tmpvar_21[0].z;
- v_25.y = tmpvar_21[1].z;
- v_25.z = tmpvar_21[2].z;
- lightDir_1 = (normalize((
- ((tmpvar_22.x * v_23) + (tmpvar_22.y * v_24))
- +
- (tmpvar_22.z * v_25)
- )) * tmpvar_5);
- vec3 tmpvar_26;
- tmpvar_26 = normalize(lightDir_1);
- lightDir_1 = tmpvar_26;
- vec3 lightColor_27;
- lightColor_27 = (texture2DProj (_ShadowMapTexture, xlv_TEXCOORD5).x * ((
- (8.0 * tmpvar_19.w)
- * tmpvar_19.xyz) * dot (
- clamp ((tmpvar_21 * tmpvar_9), 0.0, 1.0)
- , tmpvar_22)));
- vec3 viewDir_28;
- viewDir_28 = -(tmpvar_11);
- vec3 tmpvar_29;
- tmpvar_29 = normalize((tmpvar_26 + viewDir_28));
- float tmpvar_30;
- tmpvar_30 = max (0.0, dot (tmpvar_10, tmpvar_26));
- float tmpvar_31;
- tmpvar_31 = max (0.0, dot (tmpvar_10, tmpvar_29));
- float tmpvar_32;
- tmpvar_32 = max (0.0, dot (tmpvar_10, viewDir_28));
- float tmpvar_33;
- tmpvar_33 = max (0.0, dot (viewDir_28, tmpvar_29));
- float VdotH_34;
- VdotH_34 = (tmpvar_33 + 1e-05);
- float tmpvar_35;
- tmpvar_35 = ((1.0/((
- pow (tmpvar_14, 4.0)
- + 1e-05))) - 2.0);
- float tmpvar_36;
- float tmpvar_37;
- tmpvar_37 = max (0.0, dot (tmpvar_26, tmpvar_29));
- tmpvar_36 = (0.5 + ((2.0 * tmpvar_37) * (tmpvar_37 * tmpvar_14)));
- vec4 tmpvar_38;
- tmpvar_38.xyz = (((
- (min (((_Color.xyz * texture2D (_MainTex, xlv_TEXCOORD0.xy).xyz) * (2.0 * texture2D (_DetailAlbedoMap, xlv_TEXCOORD0.zw).xyz)), (vec3(1.0, 1.0, 1.0) - tmpvar_13)) * (((
- (1.0 + ((tmpvar_36 - 1.0) * pow ((1.00001 - tmpvar_30), 5.0)))
- *
- (1.0 + ((tmpvar_36 - 1.0) * pow ((1.00001 - tmpvar_32), 5.0)))
- ) * tmpvar_30) * lightColor_27))
- +
- (tmpvar_12.xyz * (env_2 + (lightColor_27 * max (0.0,
- ((((tmpvar_13 +
- ((1.0 - tmpvar_13) * pow (abs((1.0 - tmpvar_33)), 5.0))
- ) * min (1.0,
- min ((((2.0 * tmpvar_31) * tmpvar_32) / VdotH_34), (((2.0 * tmpvar_31) * tmpvar_30) / VdotH_34))
- )) * max (0.0, (
- pow (tmpvar_31, tmpvar_35)
- *
- ((tmpvar_35 + 1.0) / 6.28318)
- ))) / ((4.0 * tmpvar_32) + 1e-05))
- ))))
- ) + (
- (((1.0 - dot (tmpvar_12.xyz, vec3(0.299, 0.587, 0.114))) * (1.0 - tmpvar_14)) * pow (abs((1.0 - tmpvar_32)), 5.0))
- * env_2)) + (texture2D (_SelfIllum, xlv_TEXCOORD0.xy).xyz * _SelfIllumScale));
- tmpvar_38.w = (texture2D (_AlphaMap, xlv_TEXCOORD0.xy).w * _Color.w);
- gl_FragData[0] = tmpvar_38;
-}
-
-
-// stats: 146 alu 12 tex 0 flow
-// inputs: 6
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 4x1 [-1]
-// #2: xlv_TEXCOORD2 (high float) 3x1 [-1]
-// #3: xlv_TEXCOORD3 (high float) 4x1 [-1]
-// #4: xlv_TEXCOORD4 (high float) 3x1 [-1]
-// #5: xlv_TEXCOORD5 (high float) 4x1 [-1]
-// uniforms: 6 (total size: 0)
-// #0: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #1: _DetailNormalMapScale (high float) 1x1 [-1]
-// #2: _BumpScale (high float) 1x1 [-1]
-// #3: _Exposure (high float) 1x1 [-1]
-// #4: _Color (high float) 4x1 [-1]
-// #5: _SelfIllumScale (high float) 1x1 [-1]
-// textures: 12
-// #0: _MainTex (high 2d) 0x0 [-1]
-// #1: _DetailAlbedoMap (high 2d) 0x0 [-1]
-// #2: _AlphaMap (high 2d) 0x0 [-1]
-// #3: _Occlusion (high 2d) 0x0 [-1]
-// #4: _DetailNormalMap (high 2d) 0x0 [-1]
-// #5: _BumpMap (high 2d) 0x0 [-1]
-// #6: _SpecGlossMap (high 2d) 0x0 [-1]
-// #7: _ShadowMapTexture (high 2d) 0x0 [-1]
-// #8: _SpecCube (high cube) 0x0 [-1]
-// #9: unity_Lightmap (high 2d) 0x0 [-1]
-// #10: unity_LightmapInd (high 2d) 0x0 [-1]
-// #11: _SelfIllum (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt
deleted file mode 100644
index 2912d07e6b3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3.txt
+++ /dev/null
@@ -1,207 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform sampler2D _MainTex;
-uniform sampler2D _DetailAlbedoMap;
-uniform sampler2D _AlphaMap;
-uniform sampler2D _Occlusion;
-uniform sampler2D _DetailNormalMap;
-uniform highp float _DetailNormalMapScale;
-uniform sampler2D _BumpMap;
-uniform highp float _BumpScale;
-uniform highp float _Exposure;
-uniform highp vec4 _Color;
-uniform sampler2D _SpecGlossMap;
-uniform sampler2D _ShadowMapTexture;
-uniform lowp samplerCube _SpecCube;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-uniform highp float _SelfIllumScale;
-uniform sampler2D _SelfIllum;
-in highp vec4 xlv_TEXCOORD0;
-in highp vec4 xlv_TEXCOORD1;
-in highp vec3 xlv_TEXCOORD2;
-in highp vec4 xlv_TEXCOORD3;
-in highp vec3 xlv_TEXCOORD4;
-in highp vec4 xlv_TEXCOORD5;
-void main ()
-{
- lowp vec3 lightDir_1;
- lowp vec3 env_2;
- highp vec3 tmpvar_3;
- highp vec3 tmpvar_4;
- tmpvar_3 = xlv_TEXCOORD3.xyz;
- tmpvar_4 = (((xlv_TEXCOORD2.yzx * xlv_TEXCOORD3.zxy) - (xlv_TEXCOORD2.zxy * xlv_TEXCOORD3.yzx)) * xlv_TEXCOORD3.www);
- highp mat3 tmpvar_5;
- tmpvar_5[uint(0)].x = tmpvar_3.x;
- tmpvar_5[uint(0)].y = tmpvar_4.x;
- tmpvar_5[uint(0)].z = xlv_TEXCOORD2.x;
- tmpvar_5[1u].x = tmpvar_3.y;
- tmpvar_5[1u].y = tmpvar_4.y;
- tmpvar_5[1u].z = xlv_TEXCOORD2.y;
- tmpvar_5[2u].x = tmpvar_3.z;
- tmpvar_5[2u].y = tmpvar_4.z;
- tmpvar_5[2u].z = xlv_TEXCOORD2.z;
- lowp vec3 normal_6;
- normal_6.xy = ((texture (_BumpMap, xlv_TEXCOORD0.xy).wy * 2.0) - 1.0);
- normal_6.xy = (normal_6.xy * _BumpScale);
- normal_6.z = sqrt((1.0 - clamp (
- dot (normal_6.xy, normal_6.xy)
- , 0.0, 1.0)));
- lowp vec3 normal_7;
- normal_7.xy = ((texture (_DetailNormalMap, xlv_TEXCOORD0.zw).wy * 2.0) - 1.0);
- normal_7.xy = (normal_7.xy * _DetailNormalMapScale);
- normal_7.z = sqrt((1.0 - clamp (
- dot (normal_7.xy, normal_7.xy)
- , 0.0, 1.0)));
- lowp vec3 tmpvar_8;
- tmpvar_8.xy = (normal_6.xy + normal_7.xy);
- tmpvar_8.z = (normal_6.z * normal_7.z);
- lowp vec3 tmpvar_9;
- tmpvar_9 = normalize(tmpvar_8);
- lowp vec3 tmpvar_10;
- tmpvar_10 = (tmpvar_9 * tmpvar_5);
- highp vec3 tmpvar_11;
- tmpvar_11 = normalize((xlv_TEXCOORD1.xyz - _WorldSpaceCameraPos));
- lowp vec4 tmpvar_12;
- tmpvar_12 = texture (_SpecGlossMap, xlv_TEXCOORD0.xy);
- lowp float tmpvar_13;
- tmpvar_13 = dot (tmpvar_12.xyz, vec3(0.299, 0.587, 0.114));
- lowp float tmpvar_14;
- tmpvar_14 = (1.0 - tmpvar_12.w);
- lowp vec4 tmpvar_15;
- tmpvar_15.xyz = (tmpvar_11 - (2.0 * (
- dot (tmpvar_10, tmpvar_11)
- * tmpvar_10)));
- tmpvar_15.w = (tmpvar_14 * 5.0);
- lowp vec4 tmpvar_16;
- tmpvar_16 = textureLod (_SpecCube, tmpvar_15.xyz, tmpvar_15.w);
- lowp float tmpvar_17;
- tmpvar_17 = (tmpvar_16.w * tmpvar_16.w);
- lowp vec2 tmpvar_18;
- tmpvar_18.x = tmpvar_17;
- tmpvar_18.y = (tmpvar_16.w * tmpvar_17);
- env_2 = (((tmpvar_16.xyz *
- dot (vec2(0.7532, 0.2468), tmpvar_18)
- ) * _Exposure) * texture (_Occlusion, xlv_TEXCOORD0.xy).x);
- lowp vec4 tmpvar_19;
- tmpvar_19 = texture (unity_Lightmap, xlv_TEXCOORD4.xy);
- lowp vec4 tmpvar_20;
- tmpvar_20 = texture (unity_LightmapInd, xlv_TEXCOORD4.xy);
- highp mat3 tmpvar_21;
- tmpvar_21[uint(0)].x = 0.816497;
- tmpvar_21[uint(0)].y = -0.408248;
- tmpvar_21[uint(0)].z = -0.408248;
- tmpvar_21[1u].x = 0.0;
- tmpvar_21[1u].y = 0.707107;
- tmpvar_21[1u].z = -0.707107;
- tmpvar_21[2u].x = 0.57735;
- tmpvar_21[2u].y = 0.57735;
- tmpvar_21[2u].z = 0.57735;
- lowp vec3 tmpvar_22;
- tmpvar_22 = ((8.0 * tmpvar_20.w) * tmpvar_20.xyz);
- highp vec3 v_23;
- v_23.x = tmpvar_21[0].x;
- v_23.y = tmpvar_21[1].x;
- v_23.z = tmpvar_21[2].x;
- highp vec3 v_24;
- v_24.x = tmpvar_21[0].y;
- v_24.y = tmpvar_21[1].y;
- v_24.z = tmpvar_21[2].y;
- highp vec3 v_25;
- v_25.x = tmpvar_21[0].z;
- v_25.y = tmpvar_21[1].z;
- v_25.z = tmpvar_21[2].z;
- lightDir_1 = (normalize((
- ((tmpvar_22.x * v_23) + (tmpvar_22.y * v_24))
- +
- (tmpvar_22.z * v_25)
- )) * tmpvar_5);
- lowp vec3 tmpvar_26;
- tmpvar_26 = normalize(lightDir_1);
- lightDir_1 = tmpvar_26;
- lowp vec3 lightColor_27;
- lightColor_27 = (textureProj (_ShadowMapTexture, xlv_TEXCOORD5).x * ((
- (8.0 * tmpvar_19.w)
- * tmpvar_19.xyz) * dot (
- clamp ((tmpvar_21 * tmpvar_9), 0.0, 1.0)
- , tmpvar_22)));
- highp vec3 viewDir_28;
- viewDir_28 = -(tmpvar_11);
- lowp vec3 tmpvar_29;
- tmpvar_29 = normalize((tmpvar_26 + viewDir_28));
- lowp float tmpvar_30;
- tmpvar_30 = max (0.0, dot (tmpvar_10, tmpvar_26));
- lowp float tmpvar_31;
- tmpvar_31 = max (0.0, dot (tmpvar_10, tmpvar_29));
- lowp float tmpvar_32;
- tmpvar_32 = max (0.0, dot (tmpvar_10, viewDir_28));
- lowp float tmpvar_33;
- tmpvar_33 = max (0.0, dot (viewDir_28, tmpvar_29));
- lowp float VdotH_34;
- VdotH_34 = (tmpvar_33 + 1e-05);
- lowp float tmpvar_35;
- tmpvar_35 = ((1.0/((
- pow (tmpvar_14, 4.0)
- + 1e-05))) - 2.0);
- lowp float tmpvar_36;
- lowp float tmpvar_37;
- tmpvar_37 = max (0.0, dot (tmpvar_26, tmpvar_29));
- tmpvar_36 = (0.5 + ((2.0 * tmpvar_37) * (tmpvar_37 * tmpvar_14)));
- lowp vec4 tmpvar_38;
- tmpvar_38.xyz = (((
- (min (((_Color.xyz * texture (_MainTex, xlv_TEXCOORD0.xy).xyz) * (2.0 * texture (_DetailAlbedoMap, xlv_TEXCOORD0.zw).xyz)), (vec3(1.0, 1.0, 1.0) - tmpvar_13)) * (((
- (1.0 + ((tmpvar_36 - 1.0) * pow ((1.00001 - tmpvar_30), 5.0)))
- *
- (1.0 + ((tmpvar_36 - 1.0) * pow ((1.00001 - tmpvar_32), 5.0)))
- ) * tmpvar_30) * lightColor_27))
- +
- (tmpvar_12.xyz * (env_2 + (lightColor_27 * max (0.0,
- ((((tmpvar_13 +
- ((1.0 - tmpvar_13) * pow (abs((1.0 - tmpvar_33)), 5.0))
- ) * min (1.0,
- min ((((2.0 * tmpvar_31) * tmpvar_32) / VdotH_34), (((2.0 * tmpvar_31) * tmpvar_30) / VdotH_34))
- )) * max (0.0, (
- pow (tmpvar_31, tmpvar_35)
- *
- ((tmpvar_35 + 1.0) / 6.28318)
- ))) / ((4.0 * tmpvar_32) + 1e-05))
- ))))
- ) + (
- (((1.0 - dot (tmpvar_12.xyz, vec3(0.299, 0.587, 0.114))) * (1.0 - tmpvar_14)) * pow (abs((1.0 - tmpvar_32)), 5.0))
- * env_2)) + (texture (_SelfIllum, xlv_TEXCOORD0.xy).xyz * _SelfIllumScale));
- tmpvar_38.w = (texture (_AlphaMap, xlv_TEXCOORD0.xy).w * _Color.w);
- mediump vec4 tmpvar_39;
- tmpvar_39 = tmpvar_38;
- _fragData = tmpvar_39;
-}
-
-
-// stats: 146 alu 12 tex 0 flow
-// inputs: 6
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 4x1 [-1]
-// #2: xlv_TEXCOORD2 (high float) 3x1 [-1]
-// #3: xlv_TEXCOORD3 (high float) 4x1 [-1]
-// #4: xlv_TEXCOORD4 (high float) 3x1 [-1]
-// #5: xlv_TEXCOORD5 (high float) 4x1 [-1]
-// uniforms: 6 (total size: 0)
-// #0: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #1: _DetailNormalMapScale (high float) 1x1 [-1]
-// #2: _BumpScale (high float) 1x1 [-1]
-// #3: _Exposure (high float) 1x1 [-1]
-// #4: _Color (high float) 4x1 [-1]
-// #5: _SelfIllumScale (high float) 1x1 [-1]
-// textures: 12
-// #0: _MainTex (low 2d) 0x0 [-1]
-// #1: _DetailAlbedoMap (low 2d) 0x0 [-1]
-// #2: _AlphaMap (low 2d) 0x0 [-1]
-// #3: _Occlusion (low 2d) 0x0 [-1]
-// #4: _DetailNormalMap (low 2d) 0x0 [-1]
-// #5: _BumpMap (low 2d) 0x0 [-1]
-// #6: _SpecGlossMap (low 2d) 0x0 [-1]
-// #7: _ShadowMapTexture (low 2d) 0x0 [-1]
-// #8: _SpecCube (low cube) 0x0 [-1]
-// #9: unity_Lightmap (low 2d) 0x0 [-1]
-// #10: unity_LightmapInd (low 2d) 0x0 [-1]
-// #11: _SelfIllum (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt
deleted file mode 100644
index cfbf05ba49b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unishader-dirlm-outES3Metal.txt
+++ /dev/null
@@ -1,217 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 xlv_TEXCOORD0;
- float4 xlv_TEXCOORD1;
- float3 xlv_TEXCOORD2;
- float4 xlv_TEXCOORD3;
- float3 xlv_TEXCOORD4;
- float4 xlv_TEXCOORD5;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- float3 _WorldSpaceCameraPos;
- float _DetailNormalMapScale;
- float _BumpScale;
- float _Exposure;
- float4 _Color;
- float _SelfIllumScale;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _MainTex [[texture(0)]], sampler _mtlsmp__MainTex [[sampler(0)]]
- , texture2d<half> _DetailAlbedoMap [[texture(1)]], sampler _mtlsmp__DetailAlbedoMap [[sampler(1)]]
- , texture2d<half> _AlphaMap [[texture(2)]], sampler _mtlsmp__AlphaMap [[sampler(2)]]
- , texture2d<half> _Occlusion [[texture(3)]], sampler _mtlsmp__Occlusion [[sampler(3)]]
- , texture2d<half> _DetailNormalMap [[texture(4)]], sampler _mtlsmp__DetailNormalMap [[sampler(4)]]
- , texture2d<half> _BumpMap [[texture(5)]], sampler _mtlsmp__BumpMap [[sampler(5)]]
- , texture2d<half> _SpecGlossMap [[texture(6)]], sampler _mtlsmp__SpecGlossMap [[sampler(6)]]
- , texture2d<half> _ShadowMapTexture [[texture(7)]], sampler _mtlsmp__ShadowMapTexture [[sampler(7)]]
- , texturecube<half> _SpecCube [[texture(8)]], sampler _mtlsmp__SpecCube [[sampler(8)]]
- , texture2d<half> unity_Lightmap [[texture(9)]], sampler _mtlsmp_unity_Lightmap [[sampler(9)]]
- , texture2d<half> unity_LightmapInd [[texture(10)]], sampler _mtlsmp_unity_LightmapInd [[sampler(10)]]
- , texture2d<half> _SelfIllum [[texture(11)]], sampler _mtlsmp__SelfIllum [[sampler(11)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half3 lightDir_1 = 0;
- half3 env_2 = 0;
- float3 tmpvar_3 = 0;
- float3 tmpvar_4 = 0;
- tmpvar_3 = _mtl_i.xlv_TEXCOORD3.xyz;
- tmpvar_4 = (((_mtl_i.xlv_TEXCOORD2.yzx * _mtl_i.xlv_TEXCOORD3.zxy) - (_mtl_i.xlv_TEXCOORD2.zxy * _mtl_i.xlv_TEXCOORD3.yzx)) * _mtl_i.xlv_TEXCOORD3.www);
- float3x3 tmpvar_5;
- tmpvar_5[0].x = tmpvar_3.x;
- tmpvar_5[0].y = tmpvar_4.x;
- tmpvar_5[0].z = _mtl_i.xlv_TEXCOORD2.x;
- tmpvar_5[1].x = tmpvar_3.y;
- tmpvar_5[1].y = tmpvar_4.y;
- tmpvar_5[1].z = _mtl_i.xlv_TEXCOORD2.y;
- tmpvar_5[2].x = tmpvar_3.z;
- tmpvar_5[2].y = tmpvar_4.z;
- tmpvar_5[2].z = _mtl_i.xlv_TEXCOORD2.z;
- half3 normal_6 = 0;
- normal_6.xy = ((_BumpMap.sample(_mtlsmp__BumpMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).wy * (half)(2.0)) - (half)(1.0));
- normal_6.xy = ((half2)((float2)(normal_6.xy) * _mtl_u._BumpScale));
- normal_6.z = sqrt(((half)(1.0) - clamp (
- dot (normal_6.xy, normal_6.xy)
- , (half)0.0, (half)1.0)));
- half3 normal_7 = 0;
- normal_7.xy = ((_DetailNormalMap.sample(_mtlsmp__DetailNormalMap, (float2)(_mtl_i.xlv_TEXCOORD0.zw)).wy * (half)(2.0)) - (half)(1.0));
- normal_7.xy = ((half2)((float2)(normal_7.xy) * _mtl_u._DetailNormalMapScale));
- normal_7.z = sqrt(((half)(1.0) - clamp (
- dot (normal_7.xy, normal_7.xy)
- , (half)0.0, (half)1.0)));
- half3 tmpvar_8 = 0;
- tmpvar_8.xy = (normal_6.xy + normal_7.xy);
- tmpvar_8.z = (normal_6.z * normal_7.z);
- half3 tmpvar_9 = 0;
- tmpvar_9 = normalize(tmpvar_8);
- half3 tmpvar_10 = 0;
- tmpvar_10 = ((half3)((float3)(tmpvar_9) * tmpvar_5));
- float3 tmpvar_11 = 0;
- tmpvar_11 = normalize((_mtl_i.xlv_TEXCOORD1.xyz - _mtl_u._WorldSpaceCameraPos));
- half4 tmpvar_12 = 0;
- tmpvar_12 = _SpecGlossMap.sample(_mtlsmp__SpecGlossMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy));
- half tmpvar_13 = 0;
- tmpvar_13 = dot (tmpvar_12.xyz, (half3)float3(0.299, 0.587, 0.114));
- half tmpvar_14 = 0;
- tmpvar_14 = ((half)(1.0) - tmpvar_12.w);
- half4 tmpvar_15 = 0;
- tmpvar_15.xyz = ((half3)(tmpvar_11 - (float3)(((half)(2.0) * (
- ((half)dot ((float3)tmpvar_10, tmpvar_11))
- * tmpvar_10)))));
- tmpvar_15.w = (tmpvar_14 * (half)(5.0));
- half4 tmpvar_16 = 0;
- tmpvar_16 = _SpecCube.sample(_mtlsmp__SpecCube, (float3)(tmpvar_15.xyz), level(tmpvar_15.w));
- half tmpvar_17 = 0;
- tmpvar_17 = (tmpvar_16.w * tmpvar_16.w);
- half2 tmpvar_18 = 0;
- tmpvar_18.x = tmpvar_17;
- tmpvar_18.y = (tmpvar_16.w * tmpvar_17);
- env_2 = (((half3)((float3)((tmpvar_16.xyz *
- dot ((half2)float2(0.7532, 0.2468), tmpvar_18)
- )) * _mtl_u._Exposure)) * _Occlusion.sample(_mtlsmp__Occlusion, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).x);
- half4 tmpvar_19 = 0;
- tmpvar_19 = unity_Lightmap.sample(_mtlsmp_unity_Lightmap, (float2)(_mtl_i.xlv_TEXCOORD4.xy));
- half4 tmpvar_20 = 0;
- tmpvar_20 = unity_LightmapInd.sample(_mtlsmp_unity_LightmapInd, (float2)(_mtl_i.xlv_TEXCOORD4.xy));
- float3x3 tmpvar_21;
- tmpvar_21[0].x = 0.816497;
- tmpvar_21[0].y = -0.408248;
- tmpvar_21[0].z = -0.408248;
- tmpvar_21[1].x = 0.0;
- tmpvar_21[1].y = 0.707107;
- tmpvar_21[1].z = -0.707107;
- tmpvar_21[2].x = 0.57735;
- tmpvar_21[2].y = 0.57735;
- tmpvar_21[2].z = 0.57735;
- half3 tmpvar_22 = 0;
- tmpvar_22 = (((half)(8.0) * tmpvar_20.w) * tmpvar_20.xyz);
- float3 v_23 = 0;
- v_23.x = tmpvar_21[0].x;
- v_23.y = tmpvar_21[1].x;
- v_23.z = tmpvar_21[2].x;
- float3 v_24 = 0;
- v_24.x = tmpvar_21[0].y;
- v_24.y = tmpvar_21[1].y;
- v_24.z = tmpvar_21[2].y;
- float3 v_25 = 0;
- v_25.x = tmpvar_21[0].z;
- v_25.y = tmpvar_21[1].z;
- v_25.z = tmpvar_21[2].z;
- lightDir_1 = ((half3)((float3)(normalize((
- ((tmpvar_22.x * (half3)(v_23)) + (tmpvar_22.y * (half3)(v_24)))
- +
- (tmpvar_22.z * (half3)(v_25))
- ))) * tmpvar_5));
- half3 tmpvar_26 = 0;
- tmpvar_26 = normalize(lightDir_1);
- lightDir_1 = tmpvar_26;
- half3 lightColor_27 = 0;
- lightColor_27 = (_ShadowMapTexture.sample(_mtlsmp__ShadowMapTexture, ((float2)(_mtl_i.xlv_TEXCOORD5).xy / (float)(_mtl_i.xlv_TEXCOORD5).w)).x * ((
- ((half)(8.0) * tmpvar_19.w)
- * tmpvar_19.xyz) * dot (
- clamp (((half3)(tmpvar_21 * (float3)(tmpvar_9))), (half)0.0, (half)1.0)
- , tmpvar_22)));
- float3 viewDir_28 = 0;
- viewDir_28 = -(tmpvar_11);
- half3 tmpvar_29 = 0;
- tmpvar_29 = normalize(((half3)((float3)(tmpvar_26) + viewDir_28)));
- half tmpvar_30 = 0;
- tmpvar_30 = max ((half)0.0, dot (tmpvar_10, tmpvar_26));
- half tmpvar_31 = 0;
- tmpvar_31 = max ((half)0.0, dot (tmpvar_10, tmpvar_29));
- half tmpvar_32 = 0;
- tmpvar_32 = max ((half)0.0, ((half)dot ((float3)tmpvar_10, viewDir_28)));
- half tmpvar_33 = 0;
- tmpvar_33 = max ((half)0.0, ((half)dot (viewDir_28, (float3)tmpvar_29)));
- half VdotH_34 = 0;
- VdotH_34 = (tmpvar_33 + (half)(1e-05));
- half tmpvar_35 = 0;
- tmpvar_35 = (((half)1.0/((
- pow (tmpvar_14, (half)4.0)
- + (half)(1e-05)))) - (half)(2.0));
- half tmpvar_36 = 0;
- half tmpvar_37 = 0;
- tmpvar_37 = max ((half)0.0, dot (tmpvar_26, tmpvar_29));
- tmpvar_36 = ((half)(0.5) + (((half)(2.0) * tmpvar_37) * (tmpvar_37 * tmpvar_14)));
- half4 tmpvar_38 = 0;
- tmpvar_38.xyz = (((
- (min ((((half3)(_mtl_u._Color.xyz * (float3)(_MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).xyz))) * ((half)(2.0) * _DetailAlbedoMap.sample(_mtlsmp__DetailAlbedoMap, (float2)(_mtl_i.xlv_TEXCOORD0.zw)).xyz)), ((half3)(float3(1.0, 1.0, 1.0)) - tmpvar_13)) * (((
- ((half)(1.0) + ((tmpvar_36 - (half)(1.0)) * pow (((half)(1.00001) - tmpvar_30), (half)5.0)))
- *
- ((half)(1.0) + ((tmpvar_36 - (half)(1.0)) * pow (((half)(1.00001) - tmpvar_32), (half)5.0)))
- ) * tmpvar_30) * lightColor_27))
- +
- (tmpvar_12.xyz * (env_2 + (lightColor_27 * max ((half)0.0,
- ((((tmpvar_13 +
- (((half)(1.0) - tmpvar_13) * pow (abs(((half)(1.0) - tmpvar_33)), (half)5.0))
- ) * min ((half)1.0,
- min (((((half)(2.0) * tmpvar_31) * tmpvar_32) / VdotH_34), ((((half)(2.0) * tmpvar_31) * tmpvar_30) / VdotH_34))
- )) * max ((half)0.0, (
- pow (tmpvar_31, tmpvar_35)
- *
- ((tmpvar_35 + (half)(1.0)) / (half)(6.28318))
- ))) / (((half)(4.0) * tmpvar_32) + (half)(1e-05)))
- ))))
- ) + (
- ((((half)(1.0) - dot (tmpvar_12.xyz, (half3)float3(0.299, 0.587, 0.114))) * ((half)(1.0) - tmpvar_14)) * pow (abs(((half)(1.0) - tmpvar_32)), (half)5.0))
- * env_2)) + ((half3)((float3)(_SelfIllum.sample(_mtlsmp__SelfIllum, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).xyz) * _mtl_u._SelfIllumScale)));
- tmpvar_38.w = ((half)((float)(_AlphaMap.sample(_mtlsmp__AlphaMap, (float2)(_mtl_i.xlv_TEXCOORD0.xy)).w) * _mtl_u._Color.w));
- half4 tmpvar_39 = 0;
- tmpvar_39 = tmpvar_38;
- _mtl_o._fragData = tmpvar_39;
- return _mtl_o;
-}
-
-
-// stats: 146 alu 12 tex 0 flow
-// inputs: 6
-// #0: xlv_TEXCOORD0 (high float) 4x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 4x1 [-1]
-// #2: xlv_TEXCOORD2 (high float) 3x1 [-1]
-// #3: xlv_TEXCOORD3 (high float) 4x1 [-1]
-// #4: xlv_TEXCOORD4 (high float) 3x1 [-1]
-// #5: xlv_TEXCOORD5 (high float) 4x1 [-1]
-// uniforms: 6 (total size: 52)
-// #0: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 0
-// #1: _DetailNormalMapScale (high float) 1x1 [-1] loc 16
-// #2: _BumpScale (high float) 1x1 [-1] loc 20
-// #3: _Exposure (high float) 1x1 [-1] loc 24
-// #4: _Color (high float) 4x1 [-1] loc 32
-// #5: _SelfIllumScale (high float) 1x1 [-1] loc 48
-// textures: 12
-// #0: _MainTex (low 2d) 0x0 [-1] loc 0
-// #1: _DetailAlbedoMap (low 2d) 0x0 [-1] loc 1
-// #2: _AlphaMap (low 2d) 0x0 [-1] loc 2
-// #3: _Occlusion (low 2d) 0x0 [-1] loc 3
-// #4: _DetailNormalMap (low 2d) 0x0 [-1] loc 4
-// #5: _BumpMap (low 2d) 0x0 [-1] loc 5
-// #6: _SpecGlossMap (low 2d) 0x0 [-1] loc 6
-// #7: _ShadowMapTexture (low 2d) 0x0 [-1] loc 7
-// #8: _SpecCube (low cube) 0x0 [-1] loc 8
-// #9: unity_Lightmap (low 2d) 0x0 [-1] loc 9
-// #10: unity_LightmapInd (low 2d) 0x0 [-1] loc 10
-// #11: _SelfIllum (low 2d) 0x0 [-1] loc 11
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-inES3.txt
deleted file mode 100644
index b409584d09c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-inES3.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-#version 300 es
-
-#define gl_FragColor _glesFragData[0]
-#define gl_FragData _glesFragData
-layout(location = 0) out mediump vec4 _glesFragData[4];
-
-struct SurfaceOutput {
- lowp vec3 Albedo;
- lowp vec3 Normal;
- lowp vec3 Emission;
- mediump float Specular;
- lowp float Gloss;
- lowp float Alpha;
-};
-struct Input {
- highp vec2 uv_MainTex;
-};
-struct v2f_surf {
- highp vec4 pos;
- highp vec2 pack0;
- lowp vec3 worldNormal;
- highp vec3 worldPos;
-};
-struct appdata_full {
- highp vec4 vertex;
- highp vec4 tangent;
- highp vec3 normal;
- highp vec4 texcoord;
- highp vec4 texcoord1;
- highp vec4 texcoord2;
- highp vec4 texcoord3;
- lowp vec4 color;
-};
-uniform highp vec4 _WorldSpaceLightPos0;
-uniform lowp vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform mediump mat4 _LightMatrix0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform highp vec4 _MainTex_ST;
-
-lowp vec4 LightingLambert( in SurfaceOutput s, in lowp vec3 lightDir, in lowp float atten )
-{
- lowp float diff = max( 0.0, dot( s.Normal, lightDir));
- lowp vec4 c;
- c.xyz = ((s.Albedo * _LightColor0.xyz) * ((diff * atten) * 2.0));
- c.w = s.Alpha;
- return c;
-}
-lowp float UnitySpotAttenuate( in mediump vec3 LightCoord )
-{
- return texture( _LightTextureB0, vec2( dot( LightCoord, LightCoord))).w;
-}
-lowp float UnitySpotCookie( in mediump vec4 LightCoord )
-{
- return texture( _LightTexture0, ((LightCoord.xy / LightCoord.w) + 0.5)).w;
-}
-highp vec3 UnityWorldSpaceLightDir( in highp vec3 worldPos )
-{
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void surf( in Input IN, inout SurfaceOutput o )
-{
- mediump vec4 c = texture( _MainTex, IN.uv_MainTex);
- o.Albedo = c.xyz;
- o.Alpha = c.w;
-}
-lowp vec4 frag_surf( in v2f_surf IN )
-{
- Input surfIN;
- surfIN.uv_MainTex = IN.pack0.xy;
- highp vec3 worldPos = IN.worldPos;
- highp vec3 lightDir = normalize(UnityWorldSpaceLightDir( worldPos));
- SurfaceOutput o;
- o.Albedo = vec3( 0.0);
- o.Emission = vec3( 0.0);
- o.Specular = 0.0;
- o.Alpha = 0.0;
- o.Gloss = 0.0;
- o.Normal = IN.worldNormal;
- surf( surfIN, o);
- mediump vec4 lightCoord = (_LightMatrix0 * vec4( worldPos, 1.0));
- lowp float atten = (((float((lightCoord.z > 0.0)) * UnitySpotCookie( lightCoord)) * UnitySpotAttenuate( lightCoord.xyz)) * 1.0);
- lowp vec4 c = vec4( 0.0);
- c += LightingLambert( o, lightDir, atten);
- c.w = 0.0;
- return c;
-}
-in highp vec2 xlv_TEXCOORD0;
-in lowp vec3 xlv_TEXCOORD1;
-in highp vec3 xlv_TEXCOORD2;
-void main() {
- lowp vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.pack0 = vec2(xlv_TEXCOORD0);
- xlt_IN.worldNormal = vec3(xlv_TEXCOORD1);
- xlt_IN.worldPos = vec3(xlv_TEXCOORD2);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3.txt
deleted file mode 100644
index e061c46fcad..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-#version 300 es
-layout(location=0) out mediump vec4 _glesFragData[4];
-uniform highp vec4 _WorldSpaceLightPos0;
-uniform lowp vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform mediump mat4 _LightMatrix0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-in highp vec2 xlv_TEXCOORD0;
-in lowp vec3 xlv_TEXCOORD1;
-in highp vec3 xlv_TEXCOORD2;
-void main ()
-{
- lowp vec4 c_1;
- lowp float atten_2;
- mediump vec4 lightCoord_3;
- highp vec3 tmpvar_4;
- tmpvar_4 = normalize((_WorldSpaceLightPos0.xyz - xlv_TEXCOORD2));
- lowp vec3 tmpvar_5;
- lowp float tmpvar_6;
- mediump vec4 c_7;
- lowp vec4 tmpvar_8;
- tmpvar_8 = texture (_MainTex, xlv_TEXCOORD0);
- c_7 = tmpvar_8;
- tmpvar_5 = c_7.xyz;
- tmpvar_6 = c_7.w;
- highp vec4 tmpvar_9;
- tmpvar_9.w = 1.0;
- tmpvar_9.xyz = xlv_TEXCOORD2;
- highp vec4 tmpvar_10;
- tmpvar_10 = (_LightMatrix0 * tmpvar_9);
- lightCoord_3 = tmpvar_10;
- lowp vec4 tmpvar_11;
- mediump vec2 P_12;
- P_12 = ((lightCoord_3.xy / lightCoord_3.w) + 0.5);
- tmpvar_11 = texture (_LightTexture0, P_12);
- mediump float tmpvar_13;
- tmpvar_13 = dot (lightCoord_3.xyz, lightCoord_3.xyz);
- lowp vec4 tmpvar_14;
- tmpvar_14 = texture (_LightTextureB0, vec2(tmpvar_13));
- mediump float tmpvar_15;
- tmpvar_15 = ((float(
- (lightCoord_3.z > 0.0)
- ) * tmpvar_11.w) * tmpvar_14.w);
- atten_2 = tmpvar_15;
- lowp vec3 lightDir_16;
- lightDir_16 = tmpvar_4;
- lowp vec4 c_17;
- c_17.xyz = ((tmpvar_5 * _LightColor0.xyz) * ((
- max (0.0, dot (xlv_TEXCOORD1, lightDir_16))
- * atten_2) * 2.0));
- c_17.w = tmpvar_6;
- c_1.xyz = c_17.xyz;
- c_1.w = 0.0;
- _glesFragData[0] = c_1;
-}
-
-
-// stats: 18 alu 3 tex 0 flow
-// inputs: 3
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (low float) 3x1 [-1]
-// #2: xlv_TEXCOORD2 (high float) 3x1 [-1]
-// uniforms: 3 (total size: 0)
-// #0: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #1: _LightColor0 (low float) 4x1 [-1]
-// #2: _LightMatrix0 (medium float) 4x4 [-1]
-// textures: 3
-// #0: _LightTexture0 (low 2d) 0x0 [-1]
-// #1: _LightTextureB0 (low 2d) 0x0 [-1]
-// #2: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3Metal.txt
deleted file mode 100644
index 1b8314b3cff..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/z-unity-spot-outES3Metal.txt
+++ /dev/null
@@ -1,81 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float2 xlv_TEXCOORD0;
- half3 xlv_TEXCOORD1;
- float3 xlv_TEXCOORD2;
-};
-struct xlatMtlShaderOutput {
- half4 _glesFragData_0 [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- float4 _WorldSpaceLightPos0;
- half4 _LightColor0;
- half4x4 _LightMatrix0;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _LightTexture0 [[texture(0)]], sampler _mtlsmp__LightTexture0 [[sampler(0)]]
- , texture2d<half> _LightTextureB0 [[texture(1)]], sampler _mtlsmp__LightTextureB0 [[sampler(1)]]
- , texture2d<half> _MainTex [[texture(2)]], sampler _mtlsmp__MainTex [[sampler(2)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- half atten_2 = 0;
- half4 lightCoord_3 = 0;
- float3 tmpvar_4 = 0;
- tmpvar_4 = normalize((_mtl_u._WorldSpaceLightPos0.xyz - _mtl_i.xlv_TEXCOORD2));
- half3 tmpvar_5 = 0;
- half tmpvar_6 = 0;
- half4 c_7 = 0;
- half4 tmpvar_8 = 0;
- tmpvar_8 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
- c_7 = tmpvar_8;
- tmpvar_5 = c_7.xyz;
- tmpvar_6 = c_7.w;
- float4 tmpvar_9 = 0;
- tmpvar_9.w = 1.0;
- tmpvar_9.xyz = _mtl_i.xlv_TEXCOORD2;
- float4 tmpvar_10 = 0;
- tmpvar_10 = ((float4)(_mtl_u._LightMatrix0 * (half4)(tmpvar_9)));
- lightCoord_3 = half4(tmpvar_10);
- half4 tmpvar_11 = 0;
- half2 P_12 = 0;
- P_12 = ((lightCoord_3.xy / lightCoord_3.w) + (half)(0.5));
- tmpvar_11 = _LightTexture0.sample(_mtlsmp__LightTexture0, (float2)(P_12));
- half tmpvar_13 = 0;
- tmpvar_13 = dot (lightCoord_3.xyz, lightCoord_3.xyz);
- half4 tmpvar_14 = 0;
- tmpvar_14 = _LightTextureB0.sample(_mtlsmp__LightTextureB0, (float2)(half2(tmpvar_13)));
- half tmpvar_15 = 0;
- tmpvar_15 = ((half(
- (lightCoord_3.z > (half)(0.0))
- ) * tmpvar_11.w) * tmpvar_14.w);
- atten_2 = tmpvar_15;
- half3 lightDir_16 = 0;
- lightDir_16 = half3(tmpvar_4);
- half4 c_17 = 0;
- c_17.xyz = ((tmpvar_5 * _mtl_u._LightColor0.xyz) * ((
- max ((half)0.0, dot (_mtl_i.xlv_TEXCOORD1, lightDir_16))
- * atten_2) * (half)(2.0)));
- c_17.w = tmpvar_6;
- c_1.xyz = c_17.xyz;
- c_1.w = half(0.0);
- _mtl_o._glesFragData_0 = c_1;
- return _mtl_o;
-}
-
-
-// stats: 18 alu 3 tex 0 flow
-// inputs: 3
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (low float) 3x1 [-1]
-// #2: xlv_TEXCOORD2 (high float) 3x1 [-1]
-// uniforms: 3 (total size: 56)
-// #0: _WorldSpaceLightPos0 (high float) 4x1 [-1] loc 0
-// #1: _LightColor0 (low float) 4x1 [-1] loc 16
-// #2: _LightMatrix0 (medium float) 4x4 [-1] loc 24
-// textures: 3
-// #0: _LightTexture0 (low 2d) 0x0 [-1] loc 0
-// #1: _LightTextureB0 (low 2d) 0x0 [-1] loc 1
-// #2: _MainTex (low 2d) 0x0 [-1] loc 2
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-in.txt
deleted file mode 100644
index f24c69199ad..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-in.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- vec2 hip_pack0;
- vec3 TtoV0;
- vec3 TtoV1;
- vec3 TtoV2;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _MainTex;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 viewN;
- vec4 res;
- surfIN.uv_BumpMap = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- viewN.x = dot( IN.TtoV0, o.Normal);
- viewN.y = dot( IN.TtoV1, o.Normal);
- viewN.z = dot( IN.TtoV2, o.Normal);
- o.Normal = viewN;
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.TtoV0 = vec3( gl_TexCoord[1]);
- xlt_IN.TtoV1 = vec3( gl_TexCoord[2]);
- xlt_IN.TtoV2 = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-out.txt
deleted file mode 100644
index bf03f0203e9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse-out.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-uniform sampler2D _BumpMap;
-void main ()
-{
- vec4 res_1;
- vec3 viewN_2;
- vec4 normal_3;
- normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0);
- normal_3.z = sqrt(((1.0 -
- (normal_3.x * normal_3.x)
- ) - (normal_3.y * normal_3.y)));
- viewN_2.x = dot (gl_TexCoord[1].xyz, normal_3.xyz);
- viewN_2.y = dot (gl_TexCoord[2].xyz, normal_3.xyz);
- viewN_2.z = dot (gl_TexCoord[3].xyz, normal_3.xyz);
- res_1.xyz = ((viewN_2 * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = 0.0;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 13 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// textures: 1
-// #0: _BumpMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-in.txt
deleted file mode 100644
index 93bf021efe5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-in.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-out.txt
deleted file mode 100644
index 931d1e41978..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Diffuse1-out.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 light_1;
- vec4 c_2;
- c_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
- light_1 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_1.xyz = (light_1.xyz + unity_Ambient.xyz);
- vec4 c_3;
- c_3.xyz = (c_2.xyz * light_1.xyz);
- c_3.w = c_2.w;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 5 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: unity_Ambient (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-in.txt
deleted file mode 100644
index d05216ad55b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-in.txt
+++ /dev/null
@@ -1,120 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec3 vlight;
- vec4 _ShadowCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform sampler2D _ShadowMapTexture;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-float unitySampleShadow( in vec4 shadowCoord );
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-float unitySampleShadow( in vec4 shadowCoord ) {
- float shadow;
- shadow = texture2DProj( _ShadowMapTexture, shadowCoord).x ;
- return shadow;
-}
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- float atten;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- atten = unitySampleShadow( IN._ShadowCoord);
- c = LightingBlinnPhong( o, IN.lightDir, normalize( vec3( IN.viewDir) ), atten);
- c.xyz += (o.Albedo * IN.vlight);
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN.vlight = vec3( gl_TexCoord[3]);
- xlt_IN._ShadowCoord = vec4( gl_TexCoord[4]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-out.txt
deleted file mode 100644
index d04f12cf029..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular-out.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform sampler2D _ShadowMapTexture;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[2].xyz;
- vec4 c_3;
- vec3 tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, tmpvar_1.xy);
- tmpvar_4 = (tmpvar_5.xyz * _Color.xyz);
- vec4 normal_6;
- normal_6.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_6.z = sqrt(((1.0 -
- (normal_6.x * normal_6.x)
- ) - (normal_6.y * normal_6.y)));
- vec4 tmpvar_7;
- tmpvar_7 = texture2DProj (_ShadowMapTexture, gl_TexCoord[4]);
- vec4 c_8;
- float spec_9;
- spec_9 = (pow (max (0.0,
- dot (normal_6.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[1].xyz))))
- ), (_Shininess * 128.0)) * tmpvar_5.w);
- c_8.xyz = (((
- (tmpvar_4 * _LightColor0.xyz)
- *
- max (0.0, dot (normal_6.xyz, tmpvar_2))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_9)) * (tmpvar_7.x * 2.0));
- c_8.w = ((tmpvar_5.w * _Color.w) + ((_LightColor0.w * _SpecColor.w) * (spec_9 * tmpvar_7.x)));
- c_3.w = c_8.w;
- c_3.xyz = (c_8.xyz + (tmpvar_4 * gl_TexCoord[3].xyz));
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 32 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Shininess (high float) 1x1 [-1]
-// #3: _SpecColor (high float) 4x1 [-1]
-// textures: 3
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: _ShadowMapTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-in.txt
deleted file mode 100644
index a0abf016225..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-in.txt
+++ /dev/null
@@ -1,112 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec3 viewDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN.viewDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec2( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-out.txt
deleted file mode 100644
index 4b83571943a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular1-out.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1].xyz;
- vec4 c_3;
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_MainTex, tmpvar_1.xy);
- vec4 normal_5;
- normal_5.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_5.z = sqrt(((1.0 -
- (normal_5.x * normal_5.x)
- ) - (normal_5.y * normal_5.y)));
- float atten_6;
- atten_6 = texture2D (_LightTexture0, gl_TexCoord[3].xy).w;
- vec4 c_7;
- float spec_8;
- spec_8 = (pow (max (0.0,
- dot (normal_5.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[2].xyz))))
- ), (_Shininess * 128.0)) * tmpvar_4.w);
- c_7.xyz = (((
- ((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz)
- *
- max (0.0, dot (normal_5.xyz, tmpvar_2))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_8)) * (atten_6 * 2.0));
- c_7.w = ((tmpvar_4.w * _Color.w) + ((_LightColor0.w * _SpecColor.w) * (spec_8 * atten_6)));
- c_3.xyz = c_7.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 31 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Shininess (high float) 1x1 [-1]
-// #3: _SpecColor (high float) 4x1 [-1]
-// textures: 3
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-in.txt
deleted file mode 100644
index 07ca232a495..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-in.txt
+++ /dev/null
@@ -1,136 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light ) {
- float spec;
- vec4 c;
- spec = (light.w * s.Gloss);
- c.xyz = ((s.Albedo * light.xyz ) + ((light.xyz * _SpecColor.xyz ) * spec));
- c.w = (s.Alpha + (spec * _SpecColor.w ));
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingBlinnPhong_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-out.txt
deleted file mode 100644
index 9884f4fbfc0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Bumped_Specular2-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _SpecColor;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[2].xyz;
- vec4 light_2;
- vec4 tmpvar_3;
- tmpvar_3 = texture2D (_MainTex, gl_TexCoord[0].xy);
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0))));
- vec4 c_4;
- float spec_5;
- spec_5 = (light_2.w * tmpvar_3.w);
- c_4.xyz = (((tmpvar_3.xyz * _Color.xyz) * light_2.xyz) + ((light_2.xyz * _SpecColor.xyz) * spec_5));
- c_4.w = ((tmpvar_3.w * _Color.w) + (spec_5 * _SpecColor.w));
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 16 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _SpecColor (high float) 4x1 [-1]
-// textures: 4
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: unity_Lightmap (high 2d) 0x0 [-1]
-// #3: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-in.txt
deleted file mode 100644
index cebc6e2aca8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-in.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_DecalTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 normal;
- vec3 lightDir;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _DecalTex;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- vec4 decal;
- c = texture2D( _MainTex, IN.uv_MainTex);
- decal = texture2D( _DecalTex, IN.uv_DecalTex);
- c.xyz = mix( c.xyz , decal.xyz , vec3( decal.w ));
- c *= _Color;
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_DecalTex = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingLambert( o, lightDir, 1.00000);
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-out.txt
deleted file mode 100644
index d0e0f6fe4bc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal-out.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _DecalTex;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 c_2;
- vec4 c_3;
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_MainTex, tmpvar_1.xy);
- c_3.w = tmpvar_4.w;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_DecalTex, tmpvar_1.zw);
- c_3.xyz = mix (tmpvar_4.xyz, tmpvar_5.xyz, tmpvar_5.www);
- c_3 = (c_3 * _Color);
- vec4 c_6;
- c_6.xyz = ((c_3.xyz * _LightColor0.xyz) * (max (0.0,
- dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)
- ) * 2.0));
- c_6.w = c_3.w;
- c_2.xyz = c_6.xyz;
- c_2.w = 0.0;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 8 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 2
-// #0: _DecalTex (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-in.txt
deleted file mode 100644
index fd86cf92856..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-in.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_DecalTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _DecalTex;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- vec4 decal;
- c = texture2D( _MainTex, IN.uv_MainTex);
- decal = texture2D( _DecalTex, IN.uv_DecalTex);
- c.xyz = mix( c.xyz , decal.xyz , vec3( decal.w ));
- c *= _Color;
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_DecalTex = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingLambert( o, lightDir, (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec2( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-out.txt
deleted file mode 100644
index 6a73960591f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal1-out.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _DecalTex;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 c_2;
- vec4 c_3;
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_MainTex, tmpvar_1.xy);
- c_3.w = tmpvar_4.w;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_DecalTex, tmpvar_1.zw);
- c_3.xyz = mix (tmpvar_4.xyz, tmpvar_5.xyz, tmpvar_5.www);
- c_3 = (c_3 * _Color);
- vec4 c_6;
- c_6.xyz = ((c_3.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz))
- * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0));
- c_6.w = c_3.w;
- c_2.xyz = c_6.xyz;
- c_2.w = 0.0;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 9 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 3
-// #0: _DecalTex (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-in.txt
deleted file mode 100644
index 0e0e728e68d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-in.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_DecalTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _DecalTex;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- vec4 decal;
- c = texture2D( _MainTex, IN.uv_MainTex);
- decal = texture2D( _DecalTex, IN.uv_DecalTex);
- c.xyz = mix( c.xyz , decal.xyz , vec3( decal.w ));
- c *= _Color;
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_DecalTex = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-out.txt
deleted file mode 100644
index 813b8f1e90f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Decal2-out.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _DecalTex;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 light_2;
- vec4 c_3;
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_MainTex, tmpvar_1.xy);
- c_3.w = tmpvar_4.w;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_DecalTex, tmpvar_1.zw);
- c_3.xyz = mix (tmpvar_4.xyz, tmpvar_5.xyz, tmpvar_5.www);
- c_3 = (c_3 * _Color);
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_2.xyz = (light_2.xyz + unity_Ambient.xyz);
- vec4 c_6;
- c_6.xyz = (c_3.xyz * light_2.xyz);
- c_6.w = c_3.w;
- gl_FragData[0] = c_6;
-}
-
-
-// stats: 6 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: unity_Ambient (high float) 4x1 [-1]
-// textures: 3
-// #0: _DecalTex (high 2d) 0x0 [-1]
-// #1: _LightBuffer (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-in.txt
deleted file mode 100644
index a93398545b9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-in.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, texture2D( _LightTexture0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w );
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-out.txt
deleted file mode 100644
index 2fbdf5287f7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse-out.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[3].xyz;
- vec4 c_2;
- vec4 c_3;
- c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
- vec4 c_4;
- c_4.xyz = ((c_3.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz)))
- * texture2D (_LightTexture0, vec2(
- dot (tmpvar_1, tmpvar_1)
- )).w) * 2.0));
- c_4.w = c_3.w;
- c_2.xyz = c_4.xyz;
- c_2.w = 0.0;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 10 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-in.txt
deleted file mode 100644
index a6b94bf7a4e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-in.txt
+++ /dev/null
@@ -1,69 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- vec4 res;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.normal = vec3( gl_TexCoord[0]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-out.txt
deleted file mode 100644
index 811a562240d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse1-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-void main ()
-{
- vec4 res_1;
- res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = 0.0;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-in.txt
deleted file mode 100644
index b7401d4b65e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-in.txt
+++ /dev/null
@@ -1,120 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-out.txt
deleted file mode 100644
index 058c32f2521..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse2-out.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[2].xyz;
- vec4 light_2;
- vec4 c_3;
- c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0))));
- vec4 c_4;
- c_4.xyz = (c_3.xyz * light_2.xyz);
- c_4.w = c_3.w;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 9 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// textures: 4
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: unity_Lightmap (high 2d) 0x0 [-1]
-// #3: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt
deleted file mode 100644
index b15d52de8ee..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 vlight;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform vec4 _WorldSpaceLightPos0;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- float atten = 1.00000;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- c = LightingLambert( o, _WorldSpaceLightPos0.xyz , atten);
- c.xyz += (o.Albedo * IN.vlight);
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.vlight = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt
deleted file mode 100644
index 805339e9cda..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform vec4 _WorldSpaceLightPos0;
-void main ()
-{
- vec4 c_1;
- float tmpvar_2;
- vec4 c_3;
- c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
- tmpvar_2 = c_3.w;
- vec4 c_4;
- c_4.xyz = ((c_3.xyz * _LightColor0.xyz) * (max (0.0,
- dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz)
- ) * 2.0));
- c_4.w = tmpvar_2;
- c_1.xyz = (c_4.xyz + (c_3.xyz * gl_TexCoord[2].xyz));
- c_1.w = tmpvar_2;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 8 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-in.txt
deleted file mode 100644
index 6eecd245c85..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-in.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Detail;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _Detail;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- c.xyz *= (texture2D( _Detail, IN.uv_Detail).xyz * 2.00000);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_Detail = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-out.txt
deleted file mode 100644
index 8eb0b0ad9eb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail-out.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _Detail;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[3];
- vec4 c_3;
- vec4 c_4;
- c_4 = (texture2D (_MainTex, tmpvar_1.xy) * _Color);
- c_4.xyz = (c_4.xyz * (texture2D (_Detail, tmpvar_1.zw).xyz * 2.0));
- vec4 c_5;
- c_5.xyz = ((c_4.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz)))
- *
- ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)
- ) * 2.0));
- c_5.w = c_4.w;
- c_3.xyz = c_5.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 18 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 4
-// #0: _Detail (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-in.txt
deleted file mode 100644
index 1376c889a45..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-in.txt
+++ /dev/null
@@ -1,72 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Detail;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _Detail;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- c.xyz *= (texture2D( _Detail, IN.uv_Detail).xyz * 2.00000);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- vec4 res;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.normal = vec3( gl_TexCoord[0]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-out.txt
deleted file mode 100644
index 811a562240d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Diffuse_Detail1-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-void main ()
-{
- vec4 res_1;
- res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = 0.0;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-in.txt
deleted file mode 100644
index e7b7f54d4f7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-in.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 uvgrab;
- vec2 uvbump;
- vec2 uvmain;
-};
-struct appdata_t {
- vec4 vertex;
- vec2 texcoord;
-};
-uniform float _BumpAmt;
-uniform sampler2D _BumpMap;
-uniform sampler2D _GrabTexture;
-uniform vec4 _GrabTexture_TexelSize;
-uniform sampler2D _MainTex;
-vec4 UnpackNormal( in vec4 packednormal );
-vec4 frag( in v2f i );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec4 frag( in v2f i ) {
- vec2 bump;
- vec2 offset;
- vec4 col;
- vec4 tint;
- bump = UnpackNormal( texture2D( _BumpMap, i.uvbump)).xy ;
- offset = ((bump * _BumpAmt) * _GrabTexture_TexelSize.xy );
- i.uvgrab.xy = ((offset * i.uvgrab.z ) + i.uvgrab.xy );
- col = texture2DProj( _GrabTexture, i.uvgrab);
- tint = texture2D( _MainTex, i.uvmain);
- return (col * tint);
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.uvgrab = vec4( gl_TexCoord[0]);
- xlt_i.uvbump = vec2( gl_TexCoord[1]);
- xlt_i.uvmain = vec2( gl_TexCoord[2]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-out.txt
deleted file mode 100644
index 2e9a89bdbe6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Glass_Stained_BumpDistort-out.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-uniform float _BumpAmt;
-uniform sampler2D _BumpMap;
-uniform sampler2D _GrabTexture;
-uniform vec4 _GrabTexture_TexelSize;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 tmpvar_2;
- tmpvar_2.zw = tmpvar_1.zw;
- vec4 normal_3;
- normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[1].xy).wy * 2.0) - 1.0);
- normal_3.z = sqrt(((1.0 -
- (normal_3.x * normal_3.x)
- ) - (normal_3.y * normal_3.y)));
- tmpvar_2.xy = (((normal_3.xy * _BumpAmt) * (_GrabTexture_TexelSize.xy * tmpvar_1.z)) + tmpvar_1.xy);
- gl_FragData[0] = (texture2DProj (_GrabTexture, tmpvar_2) * texture2D (_MainTex, gl_TexCoord[2].xy));
-}
-
-
-// stats: 12 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _BumpAmt (high float) 1x1 [-1]
-// #1: _GrabTexture_TexelSize (high float) 4x1 [-1]
-// textures: 3
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _GrabTexture (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-in.txt
deleted file mode 100644
index e5cf0fd6395..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-in.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- float fog;
- vec2 bumpuv[2];
- vec3 viewDir;
-};
-struct appdata {
- vec4 vertex;
- vec3 normal;
-};
-uniform sampler2D _BumpMap;
-uniform sampler2D _ColorControl;
-uniform vec4 _horizonColor;
-vec4 UnpackNormal( in vec4 packednormal );
-vec4 frag( in v2f i );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec4 frag( in v2f i ) {
- vec3 bump1;
- vec3 bump2;
- vec3 bump;
- float fresnel;
- vec4 water;
- vec4 col;
- bump1 = UnpackNormal( texture2D( _BumpMap, i.bumpuv[ 0 ])).xyz ;
- bump2 = UnpackNormal( texture2D( _BumpMap, i.bumpuv[ 1 ])).xyz ;
- bump = ((bump1 + bump2) * 0.500000);
- fresnel = dot( i.viewDir, bump);
- water = texture2D( _ColorControl, vec2( fresnel, fresnel));
- col.xyz = mix( water.xyz , _horizonColor.xyz , vec3( water.w ));
- col.w = _horizonColor.w ;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.fog = float( xlv_FOG);
- xlt_i.bumpuv[0] = vec2( gl_TexCoord[0]);
- xlt_i.bumpuv[1] = vec2( gl_TexCoord[1]);
- xlt_i.viewDir = vec3( gl_TexCoord[2]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-out.txt
deleted file mode 100644
index 29fa21c8616..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-FX_Water_(simple)-out.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform sampler2D _ColorControl;
-uniform vec4 _horizonColor;
-void main ()
-{
- vec4 col_1;
- vec4 normal_2;
- normal_2.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0);
- normal_2.z = sqrt(((1.0 -
- (normal_2.x * normal_2.x)
- ) - (normal_2.y * normal_2.y)));
- vec4 normal_3;
- normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[1].xy).wy * 2.0) - 1.0);
- normal_3.z = sqrt(((1.0 -
- (normal_3.x * normal_3.x)
- ) - (normal_3.y * normal_3.y)));
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_ColorControl, vec2(dot (gl_TexCoord[2].xyz, ((normal_2.xyz + normal_3.xyz) * 0.5))));
- col_1.xyz = mix (tmpvar_4.xyz, _horizonColor.xyz, tmpvar_4.www);
- col_1.w = _horizonColor.w;
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 18 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _horizonColor (high float) 4x1 [-1]
-// textures: 2
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _ColorControl (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-in.txt
deleted file mode 100644
index 22209228513..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-in.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 uv;
-};
-uniform sampler2D _GrabTexture;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- return (1.00000 - texture2DProj( _GrabTexture, i.uv));
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.uv = vec4( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-out.txt
deleted file mode 100644
index 270ca856122..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Grab_Invert-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-uniform sampler2D _GrabTexture;
-void main ()
-{
- gl_FragData[0] = (1.0 - texture2DProj (_GrabTexture, gl_TexCoord[0]));
-}
-
-
-// stats: 1 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _GrabTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-in.txt
deleted file mode 100644
index 0832f3d9683..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-in.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec4 nz;
-};
-struct appdata {
- vec4 vertex;
- vec3 normal;
- vec4 color;
- vec4 texcoord;
-};
-uniform float _Cutoff;
-uniform sampler2D _MainTex;
-vec2 EncodeViewNormalStereo( in vec3 n );
-vec2 EncodeFloatRG( in float v );
-vec4 EncodeDepthNormal( in float depth, in vec3 normal );
-vec4 frag( in v2f i );
-vec2 EncodeViewNormalStereo( in vec3 n ) {
- float kScale = 1.77770;
- vec2 enc;
- enc = (n.xy / (n.z + 1.00000));
- enc /= kScale;
- enc = ((enc * 0.500000) + 0.500000);
- return enc;
-}
-vec2 EncodeFloatRG( in float v ) {
- vec2 kEncodeMul = vec2( 1.00000, 255.000);
- float kEncodeBit = 0.00392157;
- vec2 enc;
- enc = (kEncodeMul * v);
- enc = fract( enc );
- enc.x -= (enc.y * kEncodeBit);
- return enc;
-}
-vec4 EncodeDepthNormal( in float depth, in vec3 normal ) {
- vec4 enc;
- enc.xy = EncodeViewNormalStereo( normal);
- enc.zw = EncodeFloatRG( depth);
- return enc;
-}
-vec4 frag( in v2f i ) {
- vec4 texcol;
- texcol = texture2D( _MainTex, i.uv);
- xll_clip( (texcol.w - _Cutoff) );
- return EncodeDepthNormal( i.nz.w , i.nz.xyz );
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xlt_i.nz = vec4( gl_TexCoord[1]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-out.txt
deleted file mode 100644
index 79dbd07d0f3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform float _Cutoff;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[1];
- float x_2;
- x_2 = (texture2D (_MainTex, gl_TexCoord[0].xy).w - _Cutoff);
- if ((x_2 < 0.0)) {
- discard;
- };
- vec4 enc_3;
- vec2 enc_4;
- enc_4 = (tmpvar_1.xy / (tmpvar_1.z + 1.0));
- enc_4 = (enc_4 / 1.7777);
- enc_4 = ((enc_4 * 0.5) + 0.5);
- enc_3.xy = enc_4;
- vec2 enc_5;
- enc_5 = (vec2(1.0, 255.0) * tmpvar_1.w);
- vec2 tmpvar_6;
- tmpvar_6 = fract(enc_5);
- enc_5.y = tmpvar_6.y;
- enc_5.x = (tmpvar_6.x - (tmpvar_6.y * 0.00392157));
- enc_3.zw = enc_5;
- gl_FragData[0] = enc_3;
-}
-
-
-// stats: 11 alu 2 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Cutoff (high float) 1x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-in.txt
deleted file mode 100644
index 72b92956188..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-in.txt
+++ /dev/null
@@ -1,72 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec4 nz;
-};
-struct appdata_grass {
- vec4 vertex;
- vec4 tangent;
- vec4 color;
- vec4 texcoord;
- vec4 texcoord1;
-};
-uniform float _Cutoff;
-uniform sampler2D _MainTex;
-vec2 EncodeViewNormalStereo( in vec3 n );
-vec2 EncodeFloatRG( in float v );
-vec4 EncodeDepthNormal( in float depth, in vec3 normal );
-vec4 frag( in v2f i );
-vec2 EncodeViewNormalStereo( in vec3 n ) {
- float kScale = 1.77770;
- vec2 enc;
- enc = (n.xy / (n.z + 1.00000));
- enc /= kScale;
- enc = ((enc * 0.500000) + 0.500000);
- return enc;
-}
-vec2 EncodeFloatRG( in float v ) {
- vec2 kEncodeMul = vec2( 1.00000, 255.000);
- float kEncodeBit = 0.00392157;
- vec2 enc;
- enc = (kEncodeMul * v);
- enc = fract( enc );
- enc.x -= (enc.y * kEncodeBit);
- return enc;
-}
-vec4 EncodeDepthNormal( in float depth, in vec3 normal ) {
- vec4 enc;
- enc.xy = EncodeViewNormalStereo( normal);
- enc.zw = EncodeFloatRG( depth);
- return enc;
-}
-vec4 frag( in v2f i ) {
- vec4 texcol;
- texcol = texture2D( _MainTex, i.uv);
- xll_clip( (texcol.w - _Cutoff) );
- return EncodeDepthNormal( i.nz.w , i.nz.xyz );
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xlt_i.nz = vec4( gl_TexCoord[1]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-out.txt
deleted file mode 100644
index 79dbd07d0f3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthNormalTexture1-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform float _Cutoff;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[1];
- float x_2;
- x_2 = (texture2D (_MainTex, gl_TexCoord[0].xy).w - _Cutoff);
- if ((x_2 < 0.0)) {
- discard;
- };
- vec4 enc_3;
- vec2 enc_4;
- enc_4 = (tmpvar_1.xy / (tmpvar_1.z + 1.0));
- enc_4 = (enc_4 / 1.7777);
- enc_4 = ((enc_4 * 0.5) + 0.5);
- enc_3.xy = enc_4;
- vec2 enc_5;
- enc_5 = (vec2(1.0, 255.0) * tmpvar_1.w);
- vec2 tmpvar_6;
- tmpvar_6 = fract(enc_5);
- enc_5.y = tmpvar_6.y;
- enc_5.x = (tmpvar_6.x - (tmpvar_6.y * 0.00392157));
- enc_3.zw = enc_5;
- gl_FragData[0] = enc_3;
-}
-
-
-// stats: 11 alu 2 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Cutoff (high float) 1x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-in.txt
deleted file mode 100644
index efda7df49bc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-in.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_tree_billboard {
- vec4 vertex;
- vec4 color;
- vec4 texcoord;
- vec2 texcoord1;
-};
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 texcol;
- texcol = texture2D( _MainTex, i.uv);
- xll_clip( (texcol.w - 0.00100000) );
- return vec4( 0.000000);
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt
deleted file mode 100644
index 6042b7a622b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Camera-DepthTexture-out.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- float x_1;
- x_1 = (texture2D (_MainTex, gl_TexCoord[0].xy).w - 0.001);
- if ((x_1 < 0.0)) {
- discard;
- };
- gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0);
-}
-
-
-// stats: 3 alu 2 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-in.txt
deleted file mode 100644
index eb6e51d6671..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-in.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-uniform sampler2D _RampTex;
-vec4 frag( in v2f_img i );
-vec4 frag( in v2f_img i ) {
- vec4 orig;
- float rr;
- float gg;
- float bb;
- vec4 color;
- orig = texture2D( _MainTex, i.uv);
- rr = (texture2D( _RampTex, orig.xx ).x + 1.00000e-005);
- gg = (texture2D( _RampTex, orig.yy ).y + 2.00000e-005);
- bb = (texture2D( _RampTex, orig.zz ).z + 3.00000e-005);
- color = vec4( rr, gg, bb, orig.w );
- return color;
-}
-void main() {
- vec4 xl_retval;
- v2f_img xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt
deleted file mode 100644
index 2def9000182..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Color_Correction_Effect-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-uniform sampler2D _MainTex;
-uniform sampler2D _RampTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = texture2D (_MainTex, gl_TexCoord[0].xy);
- vec4 tmpvar_2;
- tmpvar_2.x = (texture2D (_RampTex, tmpvar_1.xx).x + 1e-05);
- tmpvar_2.y = (texture2D (_RampTex, tmpvar_1.yy).y + 2e-05);
- tmpvar_2.z = (texture2D (_RampTex, tmpvar_1.zz).z + 3e-05);
- tmpvar_2.w = tmpvar_1.w;
- gl_FragData[0] = tmpvar_2;
-}
-
-
-// stats: 3 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 2
-// #0: _MainTex (high 2d) 0x0 [-1]
-// #1: _RampTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-in.txt
deleted file mode 100644
index 9c181355c3e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-in.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv[3];
-};
-uniform sampler2D _MainTex;
-uniform float _Treshold;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 original;
- vec3 p1;
- vec3 p2;
- vec3 p3;
- vec3 diff;
- float len;
- original = texture2D( _MainTex, i.uv[ 0 ]);
- p1 = original.xyz ;
- p2 = texture2D( _MainTex, i.uv[ 1 ]).xyz ;
- p3 = texture2D( _MainTex, i.uv[ 2 ]).xyz ;
- diff = (((p1 * 2.00000) - p2) - p3);
- len = dot( diff, diff);
- if ( (len >= _Treshold) ){
- original.xyz = vec3( 0.000000);
- }
- return original;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv[0] = vec2( gl_TexCoord[0]);
- xlt_i.uv[1] = vec2( gl_TexCoord[1]);
- xlt_i.uv[2] = vec2( gl_TexCoord[2]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-out.txt
deleted file mode 100644
index f36dbb15d0b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Edge_Detect_X-out.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-uniform sampler2D _MainTex;
-uniform float _Treshold;
-void main ()
-{
- vec3 diff_1;
- vec4 original_2;
- vec4 tmpvar_3;
- tmpvar_3 = texture2D (_MainTex, gl_TexCoord[0].xy);
- original_2 = tmpvar_3;
- diff_1 = (((tmpvar_3.xyz * 2.0) - texture2D (_MainTex, gl_TexCoord[1].xy).xyz) - texture2D (_MainTex, gl_TexCoord[2].xy).xyz);
- float tmpvar_4;
- tmpvar_4 = dot (diff_1, diff_1);
- if ((tmpvar_4 >= _Treshold)) {
- original_2.xyz = vec3(0.0, 0.0, 0.0);
- };
- gl_FragData[0] = original_2;
-}
-
-
-// stats: 6 alu 3 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Treshold (high float) 1x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-in.txt
deleted file mode 100644
index 68cc42c56c4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-in.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec4 uv[2];
-};
-uniform vec4 _Color;
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 c;
- c = texture2D( _MainTex, i.uv[ 0 ].xy );
- c += texture2D( _MainTex, i.uv[ 0 ].zw );
- c += texture2D( _MainTex, i.uv[ 1 ].xy );
- c += texture2D( _MainTex, i.uv[ 1 ].zw );
- c.xyz *= _Color.xyz ;
- return (c * _Color.w );
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv[0] = vec4( gl_TexCoord[0]);
- xlt_i.uv[1] = vec4( gl_TexCoord[1]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-out.txt
deleted file mode 100644
index 062159cda9d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_GlowConeTap-out.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- vec4 tmpvar_2;
- tmpvar_1 = gl_TexCoord[0];
- tmpvar_2 = gl_TexCoord[1];
- vec4 c_3;
- c_3 = (texture2D (_MainTex, tmpvar_1.xy) + texture2D (_MainTex, tmpvar_1.zw));
- c_3 = (c_3 + texture2D (_MainTex, tmpvar_2.xy));
- c_3 = (c_3 + texture2D (_MainTex, tmpvar_2.zw));
- c_3.xyz = (c_3.xyz * _Color.xyz);
- gl_FragData[0] = (c_3 * _Color.w);
-}
-
-
-// stats: 5 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-in.txt
deleted file mode 100644
index bafe69eac94..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-in.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec4 uv[4];
-};
-uniform vec4 _Color;
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 c;
- c = texture2D( _MainTex, i.uv[ 0 ].xy );
- c += texture2D( _MainTex, i.uv[ 1 ].xy );
- c += texture2D( _MainTex, i.uv[ 2 ].xy );
- c += texture2D( _MainTex, i.uv[ 3 ].xy );
- c /= 4.00000;
- c.xyz *= _Color.xyz ;
- c.xyz *= (c.w + _Color.w );
- c.w = 0.000000;
- return c;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv[0] = vec4( gl_TexCoord[0]);
- xlt_i.uv[1] = vec4( gl_TexCoord[1]);
- xlt_i.uv[2] = vec4( gl_TexCoord[2]);
- xlt_i.uv[3] = vec4( gl_TexCoord[3]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-out.txt
deleted file mode 100644
index 9c46022d3a3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Glow_Downsample-out.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 c_1;
- c_1 = (texture2D (_MainTex, gl_TexCoord[0].xy) + texture2D (_MainTex, gl_TexCoord[1].xy));
- c_1 = (c_1 + texture2D (_MainTex, gl_TexCoord[2].xy));
- c_1 = (c_1 + texture2D (_MainTex, gl_TexCoord[3].xy));
- c_1 = (c_1 / 4.0);
- c_1.xyz = (c_1.xyz * _Color.xyz);
- c_1.xyz = (c_1.xyz * (c_1.w + _Color.w));
- c_1.w = 0.0;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 8 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-in.txt
deleted file mode 100644
index c20e3ef04f9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-in.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-uniform float _RampOffset;
-uniform sampler2D _RampTex;
-float Luminance( in vec3 c );
-vec4 frag( in v2f_img i );
-float Luminance( in vec3 c ) {
- return dot( c, vec3( 0.220000, 0.707000, 0.0710000));
-}
-vec4 frag( in v2f_img i ) {
- vec4 original;
- float grayscale;
- vec2 remap;
- vec4 xlat_var_output;
- original = texture2D( _MainTex, i.uv);
- grayscale = Luminance( original.xyz );
- remap = vec2( (grayscale + _RampOffset), 0.500000);
- xlat_var_output = texture2D( _RampTex, remap);
- xlat_var_output.w = original.w ;
- return xlat_var_output;
-}
-void main() {
- vec4 xl_retval;
- v2f_img xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-out.txt
deleted file mode 100644
index d2b1a200218..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Grayscale_Effect-out.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-uniform sampler2D _MainTex;
-uniform float _RampOffset;
-uniform sampler2D _RampTex;
-void main ()
-{
- vec4 xlat_var_output_1;
- vec4 tmpvar_2;
- tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy);
- vec2 tmpvar_3;
- tmpvar_3.y = 0.5;
- tmpvar_3.x = (dot (tmpvar_2.xyz, vec3(0.22, 0.707, 0.071)) + _RampOffset);
- xlat_var_output_1.xyz = texture2D (_RampTex, tmpvar_3).xyz;
- xlat_var_output_1.w = tmpvar_2.w;
- gl_FragData[0] = xlat_var_output_1;
-}
-
-
-// stats: 3 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _RampOffset (high float) 1x1 [-1]
-// textures: 2
-// #0: _MainTex (high 2d) 0x0 [-1]
-// #1: _RampTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-in.txt
deleted file mode 100644
index 5a981d7f7c7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-in.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
-};
-struct appdata {
- vec4 vertex;
- vec2 texcoord;
-};
-uniform sampler2D _CameraDepthTexture;
-uniform sampler2D _CameraNormalsTexture;
-uniform vec4 _ZBufferParams;
-float Linear01Depth( in float z );
-vec2 EncodeViewNormalStereo( in vec3 n );
-vec2 EncodeFloatRG( in float v );
-vec4 EncodeDepthNormal( in float depth, in vec3 normal );
-vec4 frag( in v2f i );
-float Linear01Depth( in float z ) {
- return (1.00000 / ((_ZBufferParams.x * z) + _ZBufferParams.y ));
-}
-vec2 EncodeViewNormalStereo( in vec3 n ) {
- float kScale = 1.77770;
- vec2 enc;
- enc = (n.xy / (n.z + 1.00000));
- enc /= kScale;
- enc = ((enc * 0.500000) + 0.500000);
- return enc;
-}
-vec2 EncodeFloatRG( in float v ) {
- vec2 kEncodeMul = vec2( 1.00000, 255.000);
- float kEncodeBit = 0.00392157;
- vec2 enc;
- enc = (kEncodeMul * v);
- enc = fract( enc );
- enc.x -= (enc.y * kEncodeBit);
- return enc;
-}
-vec4 EncodeDepthNormal( in float depth, in vec3 normal ) {
- vec4 enc;
- enc.xy = EncodeViewNormalStereo( normal);
- enc.zw = EncodeFloatRG( depth);
- return enc;
-}
-vec4 frag( in v2f i ) {
- float d;
- vec4 n;
- d = texture2D( _CameraDepthTexture, i.uv).x ;
- n = texture2D( _CameraNormalsTexture, i.uv);
- d = Linear01Depth( d);
- n.xyz = ((n.xyz * 2.00000) - 1.00000);
- n.z = ( -n.z );
- return ( (d < 0.999985) ) ? ( EncodeDepthNormal( d, n.xyz ) ) : ( vec4( 0.500000, 0.500000, 1.00000, 1.00000) );
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-out.txt
deleted file mode 100644
index 04c2e8dcf70..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-CombineDepthNormals-out.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-uniform sampler2D _CameraDepthTexture;
-uniform sampler2D _CameraNormalsTexture;
-uniform vec4 _ZBufferParams;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec4 n_2;
- vec4 tmpvar_3;
- tmpvar_3 = texture2D (_CameraNormalsTexture, tmpvar_1);
- n_2.w = tmpvar_3.w;
- float tmpvar_4;
- tmpvar_4 = (1.0/(((_ZBufferParams.x * texture2D (_CameraDepthTexture, tmpvar_1).x) + _ZBufferParams.y)));
- n_2.xyz = ((tmpvar_3.xyz * 2.0) - 1.0);
- n_2.z = -(n_2.z);
- vec4 tmpvar_5;
- if ((tmpvar_4 < 0.999985)) {
- vec4 enc_6;
- vec2 enc_7;
- enc_7 = (n_2.xy / (n_2.z + 1.0));
- enc_7 = (enc_7 / 1.7777);
- enc_7 = ((enc_7 * 0.5) + 0.5);
- enc_6.xy = enc_7;
- vec2 enc_8;
- enc_8 = (vec2(1.0, 255.0) * tmpvar_4);
- vec2 tmpvar_9;
- tmpvar_9 = fract(enc_8);
- enc_8.y = tmpvar_9.y;
- enc_8.x = (tmpvar_9.x - (tmpvar_9.y * 0.00392157));
- enc_6.zw = enc_8;
- tmpvar_5 = enc_6;
- } else {
- tmpvar_5 = vec4(0.5, 0.5, 1.0, 1.0);
- };
- gl_FragData[0] = tmpvar_5;
-}
-
-
-// stats: 17 alu 2 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _ZBufferParams (high float) 4x1 [-1]
-// textures: 2
-// #0: _CameraDepthTexture (high 2d) 0x0 [-1]
-// #1: _CameraNormalsTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-in.txt
deleted file mode 100644
index f157ad534ca..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-in.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
- vec2 texgencoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform sampler2D _GUIClipTexture;
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 col;
- col.xyz = (texture2D( _MainTex, i.texcoord).xyz * i.color.xyz );
- col.w = (i.color.w * texture2D( _GUIClipTexture, i.texgencoord).w );
- return col;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xlt_i.texgencoord = vec2( gl_TexCoord[1]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt
deleted file mode 100644
index 1de1ebc1474..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureBlit-out.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-uniform sampler2D _GUIClipTexture;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 col_1;
- col_1.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * gl_Color.xyz);
- col_1.w = (gl_Color.w * texture2D (_GUIClipTexture, gl_TexCoord[1].xy).w);
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 2 alu 2 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [2] loc 4
-// textures: 2
-// #0: _GUIClipTexture (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-in.txt
deleted file mode 100644
index 8ac7505ce4e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-in.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
- vec2 texgencoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform sampler2D _GUIClipTexture;
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 col;
- col = (texture2D( _MainTex, i.texcoord) * i.color);
- col.w *= texture2D( _GUIClipTexture, i.texgencoord).w ;
- return col;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xlt_i.texgencoord = vec2( gl_TexCoord[1]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt
deleted file mode 100644
index fee6e24ae14..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-GUITextureClip-out.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-uniform sampler2D _GUIClipTexture;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 col_1;
- col_1 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color);
- col_1.w = (col_1.w * texture2D (_GUIClipTexture, gl_TexCoord[1].xy).w);
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 2 alu 2 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [2] loc 4
-// textures: 2
-// #0: _GUIClipTexture (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-in.txt
deleted file mode 100644
index 06728776cd7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-in.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform sampler2D _HaloFalloff;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- float a;
- a = texture2D( _HaloFalloff, i.texcoord).w ;
- return vec4( (i.color.xyz * a), a);
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-out.txt
deleted file mode 100644
index 6559f0e0c95..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-Halo-out.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-uniform sampler2D _HaloFalloff;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = texture2D (_HaloFalloff, gl_TexCoord[0].xy);
- vec4 tmpvar_2;
- tmpvar_2.xyz = (gl_Color.xyz * tmpvar_1.w);
- tmpvar_2.w = tmpvar_1.w;
- gl_FragData[0] = tmpvar_2;
-}
-
-
-// stats: 1 alu 1 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _HaloFalloff (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-in.txt
deleted file mode 100644
index 2e8a50b1f5a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-in.txt
+++ /dev/null
@@ -1,95 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec3 ray;
-};
-struct appdata {
- vec4 vertex;
- vec2 texcoord;
- vec3 texcoord1;
-};
-uniform sampler2D _CameraDepthTexture;
-uniform vec4 _LightShadowData;
-uniform vec4 _LightSplitsFar;
-uniform vec4 _LightSplitsNear;
-uniform sampler2D _ShadowMapTexture;
-uniform mat4 _View2Shadow;
-uniform mat4 _View2Shadow1;
-uniform mat4 _View2Shadow2;
-uniform mat4 _View2Shadow3;
-uniform vec4 _ZBufferParams;
-float unitySampleShadow( in vec4 eyePos );
-float Linear01Depth( in float z );
-vec2 EncodeFloatRG( in float v );
-vec4 frag( in v2f i );
-float unitySampleShadow( in vec4 eyePos ) {
- vec3 sc0;
- vec3 sc1;
- vec3 sc2;
- vec3 sc3;
- float z;
- vec4 near;
- vec4 far;
- vec4 weights;
- vec4 coord;
- float shadow;
- sc0 = ( _View2Shadow * eyePos ).xyz ;
- sc1 = ( _View2Shadow1 * eyePos ).xyz ;
- sc2 = ( _View2Shadow2 * eyePos ).xyz ;
- sc3 = ( _View2Shadow3 * eyePos ).xyz ;
- z = eyePos.z ;
- near = vec4( greaterThanEqual( vec4( z ), _LightSplitsNear) );
- far = vec4( lessThan( vec4( z ), _LightSplitsFar) );
- weights = (near * far);
- coord = vec4( ((((sc0 * weights.x ) + (sc1 * weights.y )) + (sc2 * weights.z )) + (sc3 * weights.w )), 1.00000);
- shadow = ( (texture2D( _ShadowMapTexture, coord.xy ).x < coord.z ) ) ? ( _LightShadowData.x ) : ( 1.00000 );
- return shadow;
-}
-float Linear01Depth( in float z ) {
- return (1.00000 / ((_ZBufferParams.x * z) + _ZBufferParams.y ));
-}
-vec2 EncodeFloatRG( in float v ) {
- vec2 kEncodeMul = vec2( 1.00000, 255.000);
- float kEncodeBit = 0.00392157;
- vec2 enc;
- enc = (kEncodeMul * v);
- enc = fract( enc );
- enc.x -= (enc.y * kEncodeBit);
- return enc;
-}
-vec4 frag( in v2f i ) {
- float depth;
- vec4 vpos;
- float shadow;
- vec4 res;
- depth = texture2D( _CameraDepthTexture, i.uv).x ;
- depth = Linear01Depth( depth);
- vpos = vec4( (i.ray * depth), 1.00000);
- shadow = unitySampleShadow( vpos);
- res.x = shadow;
- res.y = 1.00000;
- res.zw = EncodeFloatRG( (1.00000 - depth));
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xlt_i.ray = vec3( gl_TexCoord[1]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt
deleted file mode 100644
index 4838ce8ff18..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassCollectShadows-out.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-uniform sampler2D _CameraDepthTexture;
-uniform vec4 _LightShadowData;
-uniform vec4 _LightSplitsFar;
-uniform vec4 _LightSplitsNear;
-uniform sampler2D _ShadowMapTexture;
-uniform mat4 _View2Shadow;
-uniform mat4 _View2Shadow1;
-uniform mat4 _View2Shadow2;
-uniform mat4 _View2Shadow3;
-uniform vec4 _ZBufferParams;
-void main ()
-{
- vec4 res_1;
- float tmpvar_2;
- tmpvar_2 = (1.0/(((_ZBufferParams.x * texture2D (_CameraDepthTexture, gl_TexCoord[0].xy).x) + _ZBufferParams.y)));
- vec4 tmpvar_3;
- tmpvar_3.w = 1.0;
- tmpvar_3.xyz = (gl_TexCoord[1].xyz * tmpvar_2);
- vec4 weights_4;
- weights_4 = (vec4(greaterThanEqual (tmpvar_3.zzzz, _LightSplitsNear)) * vec4(lessThan (tmpvar_3.zzzz, _LightSplitsFar)));
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = (((
- ((_View2Shadow * tmpvar_3).xyz * weights_4.x)
- +
- ((_View2Shadow1 * tmpvar_3).xyz * weights_4.y)
- ) + (
- (_View2Shadow2 * tmpvar_3)
- .xyz * weights_4.z)) + ((_View2Shadow3 * tmpvar_3).xyz * weights_4.w));
- vec4 tmpvar_6;
- tmpvar_6 = texture2D (_ShadowMapTexture, tmpvar_5.xy);
- float tmpvar_7;
- if ((tmpvar_6.x < tmpvar_5.z)) {
- tmpvar_7 = _LightShadowData.x;
- } else {
- tmpvar_7 = 1.0;
- };
- res_1.x = tmpvar_7;
- res_1.y = 1.0;
- vec2 enc_8;
- enc_8 = (vec2(1.0, 255.0) * (1.0 - tmpvar_2));
- vec2 tmpvar_9;
- tmpvar_9 = fract(enc_8);
- enc_8.y = tmpvar_9.y;
- enc_8.x = (tmpvar_9.x - (tmpvar_9.y * 0.00392157));
- res_1.zw = enc_8;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 30 alu 2 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 8 (total size: 0)
-// #0: _LightShadowData (high float) 4x1 [-1]
-// #1: _LightSplitsFar (high float) 4x1 [-1]
-// #2: _LightSplitsNear (high float) 4x1 [-1]
-// #3: _View2Shadow (high float) 4x4 [-1]
-// #4: _View2Shadow1 (high float) 4x4 [-1]
-// #5: _View2Shadow2 (high float) 4x4 [-1]
-// #6: _View2Shadow3 (high float) 4x4 [-1]
-// #7: _ZBufferParams (high float) 4x1 [-1]
-// textures: 2
-// #0: _CameraDepthTexture (high 2d) 0x0 [-1]
-// #1: _ShadowMapTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-in.txt
deleted file mode 100644
index 5f0fc9e2680..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-in.txt
+++ /dev/null
@@ -1,146 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec4 uv;
- vec3 ray;
-};
-struct appdata {
- vec4 vertex;
- vec3 texcoord;
-};
-uniform sampler2D _CameraDepthTexture;
-uniform sampler2D _CameraNormalsTexture;
-uniform vec4 _LightColor;
-uniform vec4 _LightPos;
-uniform vec4 _LightPositionRange;
-uniform vec4 _LightShadowData;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform vec4 _ProjectionParams;
-uniform samplerCube _ShadowMapTexture;
-uniform mat4 _View2Shadow;
-uniform mat4 _ViewToCookie;
-uniform vec4 _ZBufferParams;
-uniform vec4 unity_LightmapFade;
-float Luminance( in vec3 c );
-float Linear01Depth( in float z );
-float DecodeFloatRGBA( in vec4 enc );
-float SampleCubeDistance( in vec3 vec );
-float unitySampleShadow( in vec3 vec, in float mydist );
-float ComputeShadow( in vec3 vec, in vec2 uv );
-vec4 frag( in v2f i );
-float Luminance( in vec3 c ) {
- return dot( c, vec3( 0.220000, 0.707000, 0.0710000));
-}
-float Linear01Depth( in float z ) {
- return (1.00000 / ((_ZBufferParams.x * z) + _ZBufferParams.y ));
-}
-float DecodeFloatRGBA( in vec4 enc ) {
- vec4 kDecodeDot = vec4( 1.00000, 0.00392157, 1.53787e-005, 6.22737e-009);
- return dot( enc, kDecodeDot);
-}
-float SampleCubeDistance( in vec3 vec ) {
- vec4 packDist;
- packDist = textureCube( _ShadowMapTexture, vec);
- return DecodeFloatRGBA( packDist);
-}
-float unitySampleShadow( in vec3 vec, in float mydist ) {
- float dist;
- dist = SampleCubeDistance( vec);
- return ( (dist < mydist) ) ? ( _LightShadowData.x ) : ( 1.00000 );
-}
-float ComputeShadow( in vec3 vec, in vec2 uv ) {
- float fade;
- float mydist;
- fade = ((vec.z * _LightShadowData.z ) + _LightShadowData.w );
- fade = xll_saturate( fade );
- vec = ( xll_constructMat3( _View2Shadow) * vec );
- mydist = (length( vec ) * _LightPositionRange.w );
- mydist *= 0.970000;
- return unitySampleShadow( vec, mydist);
- return 1.00000;
-}
-vec4 frag( in v2f i ) {
- vec2 uv;
- vec4 nspec;
- vec3 normal;
- float depth;
- vec3 vpos;
- vec3 tolight;
- vec3 lightDir;
- float att;
- float atten;
- float diff;
- vec3 h;
- float spec;
- vec4 res;
- float fade;
- i.ray = (i.ray * (_ProjectionParams.z / i.ray.z ));
- uv = (i.uv.xy / i.uv.w );
- nspec = texture2D( _CameraNormalsTexture, uv);
- normal = ((nspec.xyz * 2.00000) - 1.00000);
- normal = normalize( normal );
- depth = texture2D( _CameraDepthTexture, uv).x ;
- depth = Linear01Depth( depth);
- vpos = (i.ray * depth);
- tolight = (_LightPos.xyz - vpos);
- lightDir = normalize( tolight );
- att = (dot( tolight, tolight) * _LightPos.w );
- atten = texture2D( _LightTextureB0, vec2( vec2( att))).w ;
- atten *= ComputeShadow( ( -tolight ), uv);
- atten *= textureCube( _LightTexture0, ( _ViewToCookie * vec4( vpos, 1.00000) ).xyz ).w ;
- diff = max( 0.000000, dot( lightDir, normal));
- h = normalize( (lightDir - normalize( vpos )) );
- spec = pow( max( 0.000000, dot( h, normal)), (nspec.w * 128.000));
- spec *= xll_saturate( atten );
- res.xyz = (_LightColor.xyz * (diff * atten));
- res.w = (spec * Luminance( _LightColor.xyz ));
- fade = ((vpos.z * unity_LightmapFade.z ) + unity_LightmapFade.w );
- res *= xll_saturate( (1.00000 - fade) );
- return exp2( ( -res ) );
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec4( gl_TexCoord[0]);
- xlt_i.ray = vec3( gl_TexCoord[1]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-out.txt
deleted file mode 100644
index 44f685c8033..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Internal-PrePassLighting-out.txt
+++ /dev/null
@@ -1,97 +0,0 @@
-uniform sampler2D _CameraDepthTexture;
-uniform sampler2D _CameraNormalsTexture;
-uniform vec4 _LightColor;
-uniform vec4 _LightPos;
-uniform vec4 _LightPositionRange;
-uniform vec4 _LightShadowData;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform vec4 _ProjectionParams;
-uniform samplerCube _ShadowMapTexture;
-uniform mat4 _View2Shadow;
-uniform mat4 _ViewToCookie;
-uniform vec4 _ZBufferParams;
-uniform vec4 unity_LightmapFade;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1].xyz;
- vec4 res_3;
- float atten_4;
- vec3 lightDir_5;
- vec3 tolight_6;
- vec3 vpos_7;
- vec3 normal_8;
- vec2 uv_9;
- uv_9 = (tmpvar_1.xy / tmpvar_1.w);
- vec4 tmpvar_10;
- tmpvar_10 = texture2D (_CameraNormalsTexture, uv_9);
- normal_8 = ((tmpvar_10.xyz * 2.0) - 1.0);
- normal_8 = normalize(normal_8);
- vpos_7 = ((tmpvar_2 * (_ProjectionParams.z / tmpvar_2.z)) * (1.0/((
- (_ZBufferParams.x * texture2D (_CameraDepthTexture, uv_9).x)
- + _ZBufferParams.y))));
- tolight_6 = (_LightPos.xyz - vpos_7);
- lightDir_5 = normalize(tolight_6);
- atten_4 = texture2D (_LightTextureB0, vec2((dot (tolight_6, tolight_6) * _LightPos.w))).w;
- vec3 vec_11;
- vec_11 = -(tolight_6);
- float mydist_12;
- mat3 tmpvar_13;
- tmpvar_13[0] = _View2Shadow[0].xyz;
- tmpvar_13[1] = _View2Shadow[1].xyz;
- tmpvar_13[2] = _View2Shadow[2].xyz;
- vec_11 = (tmpvar_13 * vec_11);
- mydist_12 = (sqrt(dot (vec_11, vec_11)) * _LightPositionRange.w);
- mydist_12 = (mydist_12 * 0.97);
- float tmpvar_14;
- tmpvar_14 = dot (textureCube (_ShadowMapTexture, vec_11), vec4(1.0, 0.00392157, 1.53787e-05, 6.22737e-09));
- float tmpvar_15;
- if ((tmpvar_14 < mydist_12)) {
- tmpvar_15 = _LightShadowData.x;
- } else {
- tmpvar_15 = 1.0;
- };
- atten_4 = (atten_4 * tmpvar_15);
- vec4 tmpvar_16;
- tmpvar_16.w = 1.0;
- tmpvar_16.xyz = vpos_7;
- atten_4 = (atten_4 * textureCube (_LightTexture0, (_ViewToCookie * tmpvar_16).xyz).w);
- res_3.xyz = (_LightColor.xyz * (max (0.0,
- dot (lightDir_5, normal_8)
- ) * atten_4));
- res_3.w = ((pow (
- max (0.0, dot (normalize((lightDir_5 -
- normalize(vpos_7)
- )), normal_8))
- ,
- (tmpvar_10.w * 128.0)
- ) * clamp (atten_4, 0.0, 1.0)) * dot (_LightColor.xyz, vec3(0.22, 0.707, 0.071)));
- res_3 = (res_3 * clamp ((1.0 -
- ((vpos_7.z * unity_LightmapFade.z) + unity_LightmapFade.w)
- ), 0.0, 1.0));
- gl_FragData[0] = exp2(-(res_3));
-}
-
-
-// stats: 49 alu 5 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 9 (total size: 0)
-// #0: _LightColor (high float) 4x1 [-1]
-// #1: _LightPos (high float) 4x1 [-1]
-// #2: _LightPositionRange (high float) 4x1 [-1]
-// #3: _LightShadowData (high float) 4x1 [-1]
-// #4: _ProjectionParams (high float) 4x1 [-1]
-// #5: _View2Shadow (high float) 4x4 [-1]
-// #6: _ViewToCookie (high float) 4x4 [-1]
-// #7: _ZBufferParams (high float) 4x1 [-1]
-// #8: unity_LightmapFade (high float) 4x1 [-1]
-// textures: 5
-// #0: _CameraDepthTexture (high 2d) 0x0 [-1]
-// #1: _CameraNormalsTexture (high 2d) 0x0 [-1]
-// #2: _LightTexture0 (high cube) 0x0 [-1]
-// #3: _LightTextureB0 (high 2d) 0x0 [-1]
-// #4: _ShadowMapTexture (high cube) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-in.txt
deleted file mode 100644
index af70ed93d59..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-in.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec2 uvg;
- vec2 uvs;
-};
-uniform sampler2D _GrainTex;
-uniform vec4 _Intensity;
-uniform sampler2D _MainTex;
-uniform sampler2D _ScratchTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 col;
- vec3 grain;
- vec3 scratch;
- col = texture2D( _MainTex, i.uv);
- grain = ((texture2D( _GrainTex, i.uvg).xyz * 2.00000) - 1.00000);
- col.xyz += (grain * _Intensity.x );
- scratch = ((texture2D( _ScratchTex, i.uvs).xyz * 2.00000) - 1.00000);
- col.xyz += (scratch * _Intensity.y );
- return col;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xlt_i.uvg = vec2( gl_TexCoord[1]);
- xlt_i.uvs = vec2( gl_TexCoord[2]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-out.txt
deleted file mode 100644
index c1b7db077b6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_RGB-out.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-uniform sampler2D _GrainTex;
-uniform vec4 _Intensity;
-uniform sampler2D _MainTex;
-uniform sampler2D _ScratchTex;
-void main ()
-{
- vec4 col_1;
- vec4 tmpvar_2;
- tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy);
- col_1.w = tmpvar_2.w;
- col_1.xyz = (tmpvar_2.xyz + ((
- (texture2D (_GrainTex, gl_TexCoord[1].xy).xyz * 2.0)
- - 1.0) * _Intensity.x));
- col_1.xyz = (col_1.xyz + ((
- (texture2D (_ScratchTex, gl_TexCoord[2].xy).xyz * 2.0)
- - 1.0) * _Intensity.y));
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 8 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Intensity (high float) 4x1 [-1]
-// textures: 3
-// #0: _GrainTex (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: _ScratchTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-in.txt
deleted file mode 100644
index 0bafbad1a44..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-in.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec2 uvg;
- vec2 uvs;
-};
-uniform sampler2D _GrainTex;
-uniform vec4 _Intensity;
-uniform sampler2D _MainTex;
-uniform sampler2D _ScratchTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 col;
- vec3 yuv;
- vec3 grain;
- vec3 scratch;
- col = texture2D( _MainTex, i.uv);
- yuv.x = dot( col.xyz , vec3( 0.299000, 0.587000, 0.114000));
- yuv.y = ((col.z - yuv.x ) * 0.492000);
- yuv.z = ((col.x - yuv.x ) * 0.877000);
- grain = ((texture2D( _GrainTex, i.uvg).xyz * 2.00000) - 1.00000);
- yuv.xyz += (grain * _Intensity.x );
- col.x = ((yuv.z * 1.14000) + yuv.x );
- col.y = (((yuv.z * -0.581000) + (yuv.y * -0.395000)) + yuv.x );
- col.z = ((yuv.y * 2.03200) + yuv.x );
- scratch = ((texture2D( _ScratchTex, i.uvs).xyz * 2.00000) - 1.00000);
- col.xyz += (scratch * _Intensity.y );
- return col;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xlt_i.uvg = vec2( gl_TexCoord[1]);
- xlt_i.uvs = vec2( gl_TexCoord[2]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-out.txt
deleted file mode 100644
index 409dac97ead..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Noise_Shader_YUV-out.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-uniform sampler2D _GrainTex;
-uniform vec4 _Intensity;
-uniform sampler2D _MainTex;
-uniform sampler2D _ScratchTex;
-void main ()
-{
- vec3 yuv_1;
- vec4 col_2;
- vec4 tmpvar_3;
- tmpvar_3 = texture2D (_MainTex, gl_TexCoord[0].xy);
- col_2.w = tmpvar_3.w;
- yuv_1.x = dot (tmpvar_3.xyz, vec3(0.299, 0.587, 0.114));
- yuv_1.y = ((tmpvar_3.z - yuv_1.x) * 0.492);
- yuv_1.z = ((tmpvar_3.x - yuv_1.x) * 0.877);
- yuv_1 = (yuv_1 + ((
- (texture2D (_GrainTex, gl_TexCoord[1].xy).xyz * 2.0)
- - 1.0) * _Intensity.x));
- col_2.x = ((yuv_1.z * 1.14) + yuv_1.x);
- col_2.y = (((yuv_1.z * -0.581) + (yuv_1.y * -0.395)) + yuv_1.x);
- col_2.z = ((yuv_1.y * 2.032) + yuv_1.x);
- col_2.xyz = (col_2.xyz + ((
- (texture2D (_ScratchTex, gl_TexCoord[2].xy).xyz * 2.0)
- - 1.0) * _Intensity.y));
- gl_FragData[0] = col_2;
-}
-
-
-// stats: 21 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Intensity (high float) 4x1 [-1]
-// textures: 3
-// #0: _GrainTex (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: _ScratchTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-in.txt
deleted file mode 100644
index 91564c8f792..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-in.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-vec4 frag( in v2f_img i );
-vec4 frag( in v2f_img i ) {
- vec4 original;
- float Y;
- vec4 sepiaConvert = vec4( 0.191000, -0.0540000, -0.221000, 0.000000);
- vec4 xlat_var_output;
- original = texture2D( _MainTex, i.uv);
- Y = dot( vec3( 0.299000, 0.587000, 0.114000), original.xyz );
- xlat_var_output = (sepiaConvert + Y);
- xlat_var_output.w = original.w ;
- return xlat_var_output;
-}
-void main() {
- vec4 xl_retval;
- v2f_img xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt
deleted file mode 100644
index 79f2064e7d2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Sepiatone_Effect-out.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 xlat_var_output_1;
- vec4 tmpvar_2;
- tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy);
- xlat_var_output_1.xyz = (vec4(0.191, -0.054, -0.221, 0.0) + dot (vec3(0.299, 0.587, 0.114), tmpvar_2.xyz)).xyz;
- xlat_var_output_1.w = tmpvar_2.w;
- gl_FragData[0] = xlat_var_output_1;
-}
-
-
-// stats: 2 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-in.txt
deleted file mode 100644
index e7822e24cd8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-in.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-uniform vec4 _BlurOffsets[8];
-uniform sampler2D _MainTex;
-uniform vec4 unity_ShadowBlurParams;
-vec4 frag( in v2f_img i );
-vec4 frag( in v2f_img i ) {
- vec4 coord;
- vec4 mask;
- float dist;
- float radius;
- float diffTolerance;
- int i_1 = 0;
- vec4 sample;
- float sampleDist;
- float diff;
- float shadow;
- coord = vec4( i.uv, 0.000000, 0.000000);
- mask = texture2D( _MainTex, coord.xy );
- dist = (mask.z + (mask.w / 255.000));
- radius = xll_saturate( (unity_ShadowBlurParams.y / (1.00000 - dist)) );
- diffTolerance = unity_ShadowBlurParams.x ;
- mask.xy *= diffTolerance;
- for ( ; (i_1 < 8); ( i_1++ )) {
- sample = texture2D( _MainTex, (coord + (radius * _BlurOffsets[ i_1 ])).xy );
- sampleDist = (sample.z + (sample.w / 255.000));
- diff = (dist - sampleDist);
- diff = xll_saturate( (diffTolerance - abs( diff )) );
- mask.xy += (diff * sample.xy );
- }
- shadow = (mask.x / mask.y );
- return vec4( shadow);
-}
-void main() {
- vec4 xl_retval;
- v2f_img xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt
deleted file mode 100644
index dd66db84c9b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Shadow-ScreenBlur-out.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-uniform vec4 _BlurOffsets[8];
-uniform sampler2D _MainTex;
-uniform vec4 unity_ShadowBlurParams;
-void main ()
-{
- float diff_1;
- float radius_2;
- float dist_3;
- vec4 mask_4;
- vec4 tmpvar_5;
- tmpvar_5.zw = vec2(0.0, 0.0);
- tmpvar_5.xy = gl_TexCoord[0].xy;
- vec4 tmpvar_6;
- tmpvar_6 = texture2D (_MainTex, tmpvar_5.xy);
- mask_4.zw = tmpvar_6.zw;
- dist_3 = (tmpvar_6.z + (tmpvar_6.w / 255.0));
- radius_2 = clamp ((unity_ShadowBlurParams.y / (1.0 - dist_3)), 0.0, 1.0);
- mask_4.xy = (tmpvar_6.xy * unity_ShadowBlurParams.x);
- vec4 tmpvar_7;
- tmpvar_7 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[0])).xy);
- diff_1 = (dist_3 - (tmpvar_7.z + (tmpvar_7.w / 255.0)));
- mask_4.xy = (mask_4.xy + (clamp (
- (unity_ShadowBlurParams.x - abs(diff_1))
- , 0.0, 1.0) * tmpvar_7.xy));
- vec4 tmpvar_8;
- tmpvar_8 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[1])).xy);
- diff_1 = (dist_3 - (tmpvar_8.z + (tmpvar_8.w / 255.0)));
- mask_4.xy = (mask_4.xy + (clamp (
- (unity_ShadowBlurParams.x - abs(diff_1))
- , 0.0, 1.0) * tmpvar_8.xy));
- vec4 tmpvar_9;
- tmpvar_9 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[2])).xy);
- diff_1 = (dist_3 - (tmpvar_9.z + (tmpvar_9.w / 255.0)));
- mask_4.xy = (mask_4.xy + (clamp (
- (unity_ShadowBlurParams.x - abs(diff_1))
- , 0.0, 1.0) * tmpvar_9.xy));
- vec4 tmpvar_10;
- tmpvar_10 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[3])).xy);
- diff_1 = (dist_3 - (tmpvar_10.z + (tmpvar_10.w / 255.0)));
- mask_4.xy = (mask_4.xy + (clamp (
- (unity_ShadowBlurParams.x - abs(diff_1))
- , 0.0, 1.0) * tmpvar_10.xy));
- vec4 tmpvar_11;
- tmpvar_11 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[4])).xy);
- diff_1 = (dist_3 - (tmpvar_11.z + (tmpvar_11.w / 255.0)));
- mask_4.xy = (mask_4.xy + (clamp (
- (unity_ShadowBlurParams.x - abs(diff_1))
- , 0.0, 1.0) * tmpvar_11.xy));
- vec4 tmpvar_12;
- tmpvar_12 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[5])).xy);
- diff_1 = (dist_3 - (tmpvar_12.z + (tmpvar_12.w / 255.0)));
- mask_4.xy = (mask_4.xy + (clamp (
- (unity_ShadowBlurParams.x - abs(diff_1))
- , 0.0, 1.0) * tmpvar_12.xy));
- vec4 tmpvar_13;
- tmpvar_13 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[6])).xy);
- diff_1 = (dist_3 - (tmpvar_13.z + (tmpvar_13.w / 255.0)));
- mask_4.xy = (mask_4.xy + (clamp (
- (unity_ShadowBlurParams.x - abs(diff_1))
- , 0.0, 1.0) * tmpvar_13.xy));
- vec4 tmpvar_14;
- tmpvar_14 = texture2D (_MainTex, (tmpvar_5 + (radius_2 * _BlurOffsets[7])).xy);
- diff_1 = (dist_3 - (tmpvar_14.z + (tmpvar_14.w / 255.0)));
- float tmpvar_15;
- tmpvar_15 = clamp ((unity_ShadowBlurParams.x - abs(diff_1)), 0.0, 1.0);
- diff_1 = tmpvar_15;
- mask_4.xy = (mask_4.xy + (tmpvar_15 * tmpvar_14.xy));
- gl_FragData[0] = vec4((mask_4.x / mask_4.y));
-}
-
-
-// stats: 88 alu 9 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _BlurOffsets (high float) 4x1 [8]
-// #1: unity_ShadowBlurParams (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-in.txt
deleted file mode 100644
index 7248cbe1921..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-in.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-uniform sampler2D _CameraDepthNormalsTexture;
-uniform sampler2D _MainTex;
-vec3 DecodeViewNormalStereo( in vec4 enc4 );
-float DecodeFloatRG( in vec2 enc );
-void DecodeDepthNormal( in vec4 enc, out float depth, out vec3 normal );
-vec4 frag( in v2f_img i );
-vec3 DecodeViewNormalStereo( in vec4 enc4 ) {
- float kScale = 1.77770;
- vec3 nn;
- float g;
- vec3 n;
- nn = ((enc4.xyz * vec3( (2.00000 * kScale), (2.00000 * kScale), 0.000000)) + vec3( ( -kScale ), ( -kScale ), 1.00000));
- g = (2.00000 / dot( nn.xyz , nn.xyz ));
- n.xy = (g * nn.xy );
- n.z = (g - 1.00000);
- return n;
-}
-float DecodeFloatRG( in vec2 enc ) {
- vec2 kDecodeDot = vec2( 1.00000, 0.00392157);
- return dot( enc, kDecodeDot);
-}
-void DecodeDepthNormal( in vec4 enc, out float depth, out vec3 normal ) {
- depth = DecodeFloatRG( enc.zw );
- normal = DecodeViewNormalStereo( enc);
-}
-vec4 frag( in v2f_img i ) {
- vec4 tex;
- vec4 depth;
- float z;
- vec3 n;
- vec4 col;
- tex = texture2D( _MainTex, i.uv);
- depth = texture2D( _CameraDepthNormalsTexture, i.uv);
- DecodeDepthNormal( depth, z, n);
- col.x = z;
- col.y = ((n.x * 0.500000) + 0.500000);
- col.z = ((n.y * 0.500000) + 0.500000);
- col.w = tex.w ;
- return col;
-}
-void main() {
- vec4 xl_retval;
- v2f_img xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-out.txt
deleted file mode 100644
index 10449605a65..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthNTexture-out.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-uniform sampler2D _CameraDepthNormalsTexture;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec4 col_2;
- vec4 tmpvar_3;
- tmpvar_3 = texture2D (_CameraDepthNormalsTexture, tmpvar_1);
- vec3 n_4;
- float g_5;
- vec3 nn_6;
- nn_6 = ((tmpvar_3.xyz * vec3(3.5554, 3.5554, 0.0)) + vec3(-1.7777, -1.7777, 1.0));
- g_5 = (2.0 / dot (nn_6, nn_6));
- n_4.xy = (g_5 * nn_6.xy);
- n_4.z = (g_5 - 1.0);
- col_2.x = dot (tmpvar_3.zw, vec2(1.0, 0.00392157));
- col_2.y = ((n_4.x * 0.5) + 0.5);
- col_2.z = ((n_4.y * 0.5) + 0.5);
- col_2.w = texture2D (_MainTex, tmpvar_1).w;
- gl_FragData[0] = col_2;
-}
-
-
-// stats: 11 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 2
-// #0: _CameraDepthNormalsTexture (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-in.txt
deleted file mode 100644
index 339d8dfe6f9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-in.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-uniform sampler2D _CameraDepthTexture;
-uniform sampler2D _MainTex;
-uniform vec4 _ZBufferParams;
-float LinearEyeDepth( in float z );
-vec4 frag( in v2f_img i );
-float LinearEyeDepth( in float z ) {
- return (1.00000 / ((_ZBufferParams.z * z) + _ZBufferParams.w ));
-}
-vec4 frag( in v2f_img i ) {
- vec4 tex;
- vec4 depth;
- float z;
- vec4 col;
- tex = texture2D( _MainTex, i.uv);
- depth = texture2D( _CameraDepthTexture, i.uv);
- z = (LinearEyeDepth( depth.x ) * 0.0100000);
- col = tex;
- col.xy = vec2( z);
- return col;
-}
-void main() {
- vec4 xl_retval;
- v2f_img xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-out.txt
deleted file mode 100644
index bb3cf6a6845..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_ShowDepthTexture-out.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-uniform sampler2D _CameraDepthTexture;
-uniform sampler2D _MainTex;
-uniform vec4 _ZBufferParams;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec4 col_2;
- col_2.zw = texture2D (_MainTex, tmpvar_1).zw;
- col_2.xy = vec2(((1.0/((
- (_ZBufferParams.z * texture2D (_CameraDepthTexture, tmpvar_1).x)
- + _ZBufferParams.w))) * 0.01));
- gl_FragData[0] = col_2;
-}
-
-
-// stats: 4 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _ZBufferParams (high float) 4x1 [-1]
-// textures: 2
-// #0: _CameraDepthTexture (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-in.txt
deleted file mode 100644
index b7d56d4c2c0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-in.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- float fog;
- vec4 color;
- vec2 uv;
-};
-struct appdata_tree_billboard {
- vec4 vertex;
- vec4 color;
- vec4 texcoord;
- vec2 texcoord1;
-};
-uniform sampler2D _MainTex;
-vec4 frag( in v2f xlat_var_input );
-vec4 frag( in v2f xlat_var_input ) {
- vec4 col;
- col = texture2D( _MainTex, xlat_var_input.uv);
- col.xyz *= xlat_var_input.color.xyz ;
- xll_clip( col.w );
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f xlt_xlat_var_input;
- xlt_xlat_var_input.pos = vec4(0.0);
- xlt_xlat_var_input.fog = float( xlv_FOG);
- xlt_xlat_var_input.color = vec4( gl_Color);
- xlt_xlat_var_input.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_xlat_var_input);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt
deleted file mode 100644
index 09b0db192b1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_BillboardTree-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 col_1;
- vec4 tmpvar_2;
- tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy);
- col_1.w = tmpvar_2.w;
- col_1.xyz = (tmpvar_2.xyz * gl_Color.xyz);
- if ((tmpvar_2.w < 0.0)) {
- discard;
- };
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 2 alu 2 tex 1 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-in.txt
deleted file mode 100644
index 8110f768e23..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-in.txt
+++ /dev/null
@@ -1,98 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 normal;
- vec3 vlight;
-};
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform vec4 _WorldSpaceLightPos0;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * IN.color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- float atten = 1.00000;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- c = LightingLambert( o, _WorldSpaceLightPos0.xyz , atten);
- c.xyz += (o.Albedo * IN.vlight);
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lop_color = vec4( gl_Color);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.vlight = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt
deleted file mode 100644
index bd9dac0abac..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform vec4 _WorldSpaceLightPos0;
-void main ()
-{
- vec4 c_1;
- float tmpvar_2;
- vec4 c_3;
- c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color);
- tmpvar_2 = c_3.w;
- float x_4;
- x_4 = (c_3.w - _Cutoff);
- if ((x_4 < 0.0)) {
- discard;
- };
- vec4 c_5;
- c_5.xyz = ((c_3.xyz * _LightColor0.xyz) * (max (0.0,
- dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz)
- ) * 2.0));
- c_5.w = tmpvar_2;
- c_1.xyz = (c_5.xyz + (c_3.xyz * gl_TexCoord[2].xyz));
- c_1.w = tmpvar_2;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 10 alu 2 tex 1 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Cutoff (high float) 1x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-in.txt
deleted file mode 100644
index 1f79d0aeed2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-in.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 normal;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * IN.color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, (texture2D( _LightTextureB0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w * textureCube( _LightTexture0, IN._LightCoord).w ));
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lop_color = vec4( gl_Color);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt
deleted file mode 100644
index 22e4227d835..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[3].xyz;
- vec4 c_2;
- float tmpvar_3;
- vec4 c_4;
- c_4 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color);
- tmpvar_3 = c_4.w;
- float x_5;
- x_5 = (c_4.w - _Cutoff);
- if ((x_5 < 0.0)) {
- discard;
- };
- vec4 c_6;
- c_6.xyz = ((c_4.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz)))
- *
- (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w)
- ) * 2.0));
- c_6.w = tmpvar_3;
- c_2.xyz = c_6.xyz;
- c_2.w = tmpvar_3;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 12 alu 4 tex 1 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Cutoff (high float) 1x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 3
-// #0: _LightTexture0 (high cube) 0x0 [-1]
-// #1: _LightTextureB0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-in.txt
deleted file mode 100644
index bcd59ae1e75..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-in.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- vec2 hip_pack0;
- vec4 lop_color;
-};
-uniform float _Cutoff;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * IN.color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- return vec4( 0.000000);
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[1]);
- xlt_IN.lop_color = vec4( gl_Color);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt
deleted file mode 100644
index 0e7d2407103..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-uniform float _Cutoff;
-uniform sampler2D _MainTex;
-void main ()
-{
- float x_1;
- x_1 = ((texture2D (_MainTex, gl_TexCoord[1].xy) * gl_Color).w - _Cutoff);
- if ((x_1 < 0.0)) {
- discard;
- };
- gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0);
-}
-
-
-// stats: 4 alu 2 tex 1 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Cutoff (high float) 1x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-in.txt
deleted file mode 100644
index db506b16fe7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-in.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 normal;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * IN.color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, texture2D( _LightTexture0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w );
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lop_color = vec4( gl_Color);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt
deleted file mode 100644
index 89ed021fd73..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit-out.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[3].xyz;
- vec4 c_2;
- vec4 c_3;
- c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color);
- vec4 c_4;
- c_4.xyz = ((c_3.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz)))
- * texture2D (_LightTexture0, vec2(
- dot (tmpvar_1, tmpvar_1)
- )).w) * 2.0));
- c_4.w = c_3.w;
- c_2.xyz = c_4.xyz;
- c_2.w = 0.0;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 10 alu 2 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-in.txt
deleted file mode 100644
index 93e8267d791..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-in.txt
+++ /dev/null
@@ -1,123 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * IN.color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lop_color = vec4( gl_Color);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt
deleted file mode 100644
index 45cb2245348..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_Vertexlit1-out.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[2].xyz;
- vec4 light_2;
- vec4 c_3;
- c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color);
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0))));
- vec4 c_4;
- c_4.xyz = (c_3.xyz * light_2.xyz);
- c_4.w = c_3.w;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 9 alu 4 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [3] loc 4
-// textures: 4
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: unity_Lightmap (high 2d) 0x0 [-1]
-// #3: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-in.txt
deleted file mode 100644
index 2f1422ddf02..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-in.txt
+++ /dev/null
@@ -1,108 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 normal;
- vec3 vlight;
- vec4 _ShadowCoord;
-};
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform sampler2D _ShadowMapTexture;
-uniform vec4 _WorldSpaceLightPos0;
-float unitySampleShadow( in vec4 shadowCoord );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-float unitySampleShadow( in vec4 shadowCoord ) {
- float shadow;
- shadow = texture2DProj( _ShadowMapTexture, shadowCoord).x ;
- return shadow;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * IN.color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- float atten;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- atten = unitySampleShadow( IN._ShadowCoord);
- c = LightingLambert( o, _WorldSpaceLightPos0.xyz , atten);
- c.xyz += (o.Albedo * IN.vlight);
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lop_color = vec4( gl_Color);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.vlight = vec3( gl_TexCoord[2]);
- xlt_IN._ShadowCoord = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt
deleted file mode 100644
index 6efed9d7920..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass-out.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform sampler2D _ShadowMapTexture;
-uniform vec4 _WorldSpaceLightPos0;
-void main ()
-{
- vec4 c_1;
- float tmpvar_2;
- vec4 c_3;
- c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color);
- tmpvar_2 = c_3.w;
- float x_4;
- x_4 = (c_3.w - _Cutoff);
- if ((x_4 < 0.0)) {
- discard;
- };
- vec4 c_5;
- c_5.xyz = ((c_3.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz))
- * texture2DProj (_ShadowMapTexture, gl_TexCoord[3]).x) * 2.0));
- c_5.w = tmpvar_2;
- c_1.xyz = (c_5.xyz + (c_3.xyz * gl_TexCoord[2].xyz));
- c_1.w = tmpvar_2;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 11 alu 3 tex 1 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Cutoff (high float) 1x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// textures: 2
-// #0: _MainTex (high 2d) 0x0 [-1]
-// #1: _ShadowMapTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-in.txt
deleted file mode 100644
index 3c5a190d39b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-in.txt
+++ /dev/null
@@ -1,110 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * IN.color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lop_color = vec4( gl_Color);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt
deleted file mode 100644
index dcf1571bddb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[3];
- vec4 c_2;
- float tmpvar_3;
- vec4 c_4;
- c_4 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color);
- tmpvar_3 = c_4.w;
- float x_5;
- x_5 = (c_4.w - _Cutoff);
- if ((x_5 < 0.0)) {
- discard;
- };
- vec4 c_6;
- c_6.xyz = ((c_4.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz)))
- *
- ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w)
- ) * 2.0));
- c_6.w = tmpvar_3;
- c_2.xyz = c_6.xyz;
- c_2.w = tmpvar_3;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 17 alu 4 tex 1 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Cutoff (high float) 1x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 3
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _LightTextureB0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-in.txt
deleted file mode 100644
index bf5bd9d3d1e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-in.txt
+++ /dev/null
@@ -1,94 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec4 hip_screen;
-};
-uniform float _Cutoff;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * IN.color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lop_color = vec4( gl_Color);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt
deleted file mode 100644
index 61ec5cf284a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Details_WavingDoublePass2-out.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-uniform float _Cutoff;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 light_1;
- vec4 c_2;
- c_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * gl_Color);
- float x_3;
- x_3 = (c_2.w - _Cutoff);
- if ((x_3 < 0.0)) {
- discard;
- };
- light_1 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_1.xyz = (light_1.xyz + unity_Ambient.xyz);
- vec4 c_4;
- c_4.xyz = (c_2.xyz * light_1.xyz);
- c_4.w = c_2.w;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 7 alu 3 tex 1 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Cutoff (high float) 1x1 [-1]
-// #1: unity_Ambient (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-in.txt
deleted file mode 100644
index 32bc7b712da..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-in.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- return (texture2D( _MainTex, i.texcoord) * vec4( 1.00000, 0.000000, 0.000000, 1.00000));
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt
deleted file mode 100644
index 53684bfe717..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_My_Soft_Occlusion_Leaves_rendertex-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- gl_FragData[0] = (texture2D (_MainTex, gl_TexCoord[0].xy) * vec4(1.0, 0.0, 0.0, 1.0));
-}
-
-
-// stats: 1 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-in.txt
deleted file mode 100644
index 8c08479f4b8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-in.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- float fog;
- vec4 uv;
- vec4 color;
-};
-struct appdata_tree {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 color;
- vec4 texcoord;
-};
-uniform sampler2D _MainTex;
-vec4 frag( in v2f xlat_var_input );
-vec4 frag( in v2f xlat_var_input ) {
- vec4 col;
- col = xlat_var_input.color;
- col.xyz *= (2.00000 * texture2D( _MainTex, xlat_var_input.uv.xy ).xyz );
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f xlt_xlat_var_input;
- xlt_xlat_var_input.pos = vec4(0.0);
- xlt_xlat_var_input.fog = float( xlv_FOG);
- xlt_xlat_var_input.uv = vec4( gl_TexCoord[0]);
- xlt_xlat_var_input.color = vec4( gl_Color);
- xl_retval = frag( xlt_xlat_var_input);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt
deleted file mode 100644
index 5645eeb5123..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 col_1;
- col_1.w = gl_Color.w;
- col_1.xyz = (gl_Color.xyz * (2.0 * texture2D (_MainTex, gl_TexCoord[0].xy).xyz));
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 2 alu 1 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-in.txt
deleted file mode 100644
index 146a19c5497..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-in.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- float fog;
- vec4 uv;
- vec4 color;
-};
-struct appdata_tree {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 color;
- vec4 texcoord;
-};
-uniform float _HalfOverCutoff;
-uniform sampler2D _MainTex;
-vec4 frag( in v2f xlat_var_input );
-vec4 frag( in v2f xlat_var_input ) {
- vec4 col;
- col = texture2D( _MainTex, xlat_var_input.uv.xy );
- col.xyz *= (2.00000 * xlat_var_input.color.xyz );
- col.w *= (2.00000 * _HalfOverCutoff);
- xll_clip( (col.w - 1.00000) );
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f xlt_xlat_var_input;
- xlt_xlat_var_input.pos = vec4(0.0);
- xlt_xlat_var_input.fog = float( xlv_FOG);
- xlt_xlat_var_input.uv = vec4( gl_TexCoord[0]);
- xlt_xlat_var_input.color = vec4( gl_Color);
- xl_retval = frag( xlt_xlat_var_input);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt
deleted file mode 100644
index 94fde0e1364..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-uniform float _HalfOverCutoff;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 col_1;
- vec4 tmpvar_2;
- tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy);
- col_1.xyz = (tmpvar_2.xyz * (2.0 * gl_Color.xyz));
- col_1.w = (tmpvar_2.w * (2.0 * _HalfOverCutoff));
- float x_3;
- x_3 = (col_1.w - 1.0);
- if ((x_3 < 0.0)) {
- discard;
- };
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 6 alu 2 tex 1 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _HalfOverCutoff (high float) 1x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-in.txt
deleted file mode 100644
index 5bd09fdde0c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-in.txt
+++ /dev/null
@@ -1,119 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_Control;
- vec2 uv_Splat0;
- vec2 uv_Splat1;
- vec2 uv_Splat2;
- vec2 uv_Splat3;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_pack1;
- vec2 hip_pack2;
- vec3 normal;
- vec3 vlight;
- vec4 _ShadowCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _Control;
-uniform vec4 _LightColor0;
-uniform sampler2D _ShadowMapTexture;
-uniform sampler2D _Splat0;
-uniform sampler2D _Splat1;
-uniform sampler2D _Splat2;
-uniform sampler2D _Splat3;
-uniform vec4 _WorldSpaceLightPos0;
-float unitySampleShadow( in vec4 shadowCoord );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-float unitySampleShadow( in vec4 shadowCoord ) {
- float shadow;
- shadow = texture2DProj( _ShadowMapTexture, shadowCoord).x ;
- return shadow;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 splat_control;
- vec3 col;
- splat_control = texture2D( _Control, IN.uv_Control);
- col = (splat_control.x * texture2D( _Splat0, IN.uv_Splat0).xyz );
- col += (splat_control.y * texture2D( _Splat1, IN.uv_Splat1).xyz );
- col += (splat_control.z * texture2D( _Splat2, IN.uv_Splat2).xyz );
- col += (splat_control.w * texture2D( _Splat3, IN.uv_Splat3).xyz );
- o.Albedo = col;
- o.Alpha = 0.000000;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- float atten;
- vec4 c;
- surfIN.uv_Control = IN.hip_pack0.xy ;
- surfIN.uv_Splat0 = IN.hip_pack0.zw ;
- surfIN.uv_Splat1 = IN.hip_pack1.xy ;
- surfIN.uv_Splat2 = IN.hip_pack1.zw ;
- surfIN.uv_Splat3 = IN.hip_pack2.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- atten = unitySampleShadow( IN._ShadowCoord);
- c = LightingLambert( o, _WorldSpaceLightPos0.xyz , atten);
- c.xyz += (o.Albedo * IN.vlight);
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_pack1 = vec4( gl_TexCoord[1]);
- xlt_IN.hip_pack2 = vec2( gl_TexCoord[2]);
- xlt_IN.normal = vec3( gl_TexCoord[3]);
- xlt_IN.vlight = vec3( gl_TexCoord[4]);
- xlt_IN._ShadowCoord = vec4( gl_TexCoord[5]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt
deleted file mode 100644
index 5a3af77ef83..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-uniform sampler2D _Control;
-uniform vec4 _LightColor0;
-uniform sampler2D _ShadowMapTexture;
-uniform sampler2D _Splat0;
-uniform sampler2D _Splat1;
-uniform sampler2D _Splat2;
-uniform sampler2D _Splat3;
-uniform vec4 _WorldSpaceLightPos0;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1];
- vec4 c_3;
- vec3 col_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_Control, tmpvar_1.xy);
- col_4 = (tmpvar_5.x * texture2D (_Splat0, tmpvar_1.zw).xyz);
- col_4 = (col_4 + (tmpvar_5.y * texture2D (_Splat1, tmpvar_2.xy).xyz));
- col_4 = (col_4 + (tmpvar_5.z * texture2D (_Splat2, tmpvar_2.zw).xyz));
- col_4 = (col_4 + (tmpvar_5.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz));
- vec4 c_6;
- c_6.xyz = ((col_4 * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[3].xyz, _WorldSpaceLightPos0.xyz))
- * texture2DProj (_ShadowMapTexture, gl_TexCoord[5]).x) * 2.0));
- c_6.w = 0.0;
- c_3.w = c_6.w;
- c_3.xyz = (c_6.xyz + (col_4 * gl_TexCoord[4].xyz));
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 16 alu 6 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [6] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// #1: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// textures: 6
-// #0: _Control (high 2d) 0x0 [-1]
-// #1: _ShadowMapTexture (high 2d) 0x0 [-1]
-// #2: _Splat0 (high 2d) 0x0 [-1]
-// #3: _Splat1 (high 2d) 0x0 [-1]
-// #4: _Splat2 (high 2d) 0x0 [-1]
-// #5: _Splat3 (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-in.txt
deleted file mode 100644
index 7906335fcfb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-in.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_Control;
- vec2 uv_Splat0;
- vec2 uv_Splat1;
- vec2 uv_Splat2;
- vec2 uv_Splat3;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_pack1;
- vec2 hip_pack2;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _Control;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _Splat0;
-uniform sampler2D _Splat1;
-uniform sampler2D _Splat2;
-uniform sampler2D _Splat3;
-uniform vec4 unity_Ambient;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 splat_control;
- vec3 col;
- splat_control = texture2D( _Control, IN.uv_Control);
- col = (splat_control.x * texture2D( _Splat0, IN.uv_Splat0).xyz );
- col += (splat_control.y * texture2D( _Splat1, IN.uv_Splat1).xyz );
- col += (splat_control.z * texture2D( _Splat2, IN.uv_Splat2).xyz );
- col += (splat_control.w * texture2D( _Splat3, IN.uv_Splat3).xyz );
- o.Albedo = col;
- o.Alpha = 0.000000;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_Control = IN.hip_pack0.xy ;
- surfIN.uv_Splat0 = IN.hip_pack0.zw ;
- surfIN.uv_Splat1 = IN.hip_pack1.xy ;
- surfIN.uv_Splat2 = IN.hip_pack1.zw ;
- surfIN.uv_Splat3 = IN.hip_pack2.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_pack1 = vec4( gl_TexCoord[1]);
- xlt_IN.hip_pack2 = vec2( gl_TexCoord[2]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt
deleted file mode 100644
index d10280424ce..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass1-out.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-uniform sampler2D _Control;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _Splat0;
-uniform sampler2D _Splat1;
-uniform sampler2D _Splat2;
-uniform sampler2D _Splat3;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1];
- vec4 light_3;
- vec3 col_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_Control, tmpvar_1.xy);
- col_4 = (tmpvar_5.x * texture2D (_Splat0, tmpvar_1.zw).xyz);
- col_4 = (col_4 + (tmpvar_5.y * texture2D (_Splat1, tmpvar_2.xy).xyz));
- col_4 = (col_4 + (tmpvar_5.z * texture2D (_Splat2, tmpvar_2.zw).xyz));
- col_4 = (col_4 + (tmpvar_5.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz));
- light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3])));
- light_3.xyz = (light_3.xyz + unity_Ambient.xyz);
- vec4 c_6;
- c_6.xyz = (col_4 * light_3.xyz);
- c_6.w = 0.0;
- gl_FragData[0] = c_6;
-}
-
-
-// stats: 12 alu 6 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 1 (total size: 0)
-// #0: unity_Ambient (high float) 4x1 [-1]
-// textures: 6
-// #0: _Control (high 2d) 0x0 [-1]
-// #1: _LightBuffer (high 2d) 0x0 [-1]
-// #2: _Splat0 (high 2d) 0x0 [-1]
-// #3: _Splat1 (high 2d) 0x0 [-1]
-// #4: _Splat2 (high 2d) 0x0 [-1]
-// #5: _Splat3 (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-in.txt
deleted file mode 100644
index 7906335fcfb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-in.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_Control;
- vec2 uv_Splat0;
- vec2 uv_Splat1;
- vec2 uv_Splat2;
- vec2 uv_Splat3;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_pack1;
- vec2 hip_pack2;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _Control;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _Splat0;
-uniform sampler2D _Splat1;
-uniform sampler2D _Splat2;
-uniform sampler2D _Splat3;
-uniform vec4 unity_Ambient;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 splat_control;
- vec3 col;
- splat_control = texture2D( _Control, IN.uv_Control);
- col = (splat_control.x * texture2D( _Splat0, IN.uv_Splat0).xyz );
- col += (splat_control.y * texture2D( _Splat1, IN.uv_Splat1).xyz );
- col += (splat_control.z * texture2D( _Splat2, IN.uv_Splat2).xyz );
- col += (splat_control.w * texture2D( _Splat3, IN.uv_Splat3).xyz );
- o.Albedo = col;
- o.Alpha = 0.000000;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_Control = IN.hip_pack0.xy ;
- surfIN.uv_Splat0 = IN.hip_pack0.zw ;
- surfIN.uv_Splat1 = IN.hip_pack1.xy ;
- surfIN.uv_Splat2 = IN.hip_pack1.zw ;
- surfIN.uv_Splat3 = IN.hip_pack2.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_pack1 = vec4( gl_TexCoord[1]);
- xlt_IN.hip_pack2 = vec2( gl_TexCoord[2]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt
deleted file mode 100644
index d10280424ce..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass-out.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-uniform sampler2D _Control;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _Splat0;
-uniform sampler2D _Splat1;
-uniform sampler2D _Splat2;
-uniform sampler2D _Splat3;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1];
- vec4 light_3;
- vec3 col_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_Control, tmpvar_1.xy);
- col_4 = (tmpvar_5.x * texture2D (_Splat0, tmpvar_1.zw).xyz);
- col_4 = (col_4 + (tmpvar_5.y * texture2D (_Splat1, tmpvar_2.xy).xyz));
- col_4 = (col_4 + (tmpvar_5.z * texture2D (_Splat2, tmpvar_2.zw).xyz));
- col_4 = (col_4 + (tmpvar_5.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz));
- light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3])));
- light_3.xyz = (light_3.xyz + unity_Ambient.xyz);
- vec4 c_6;
- c_6.xyz = (col_4 * light_3.xyz);
- c_6.w = 0.0;
- gl_FragData[0] = c_6;
-}
-
-
-// stats: 12 alu 6 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 1 (total size: 0)
-// #0: unity_Ambient (high float) 4x1 [-1]
-// textures: 6
-// #0: _Control (high 2d) 0x0 [-1]
-// #1: _LightBuffer (high 2d) 0x0 [-1]
-// #2: _Splat0 (high 2d) 0x0 [-1]
-// #3: _Splat1 (high 2d) 0x0 [-1]
-// #4: _Splat2 (high 2d) 0x0 [-1]
-// #5: _Splat3 (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-in.txt
deleted file mode 100644
index a6232609250..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-in.txt
+++ /dev/null
@@ -1,140 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_Control;
- vec2 uv_Splat0;
- vec2 uv_Splat1;
- vec2 uv_Splat2;
- vec2 uv_Splat3;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_pack1;
- vec2 hip_pack2;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _Control;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _Splat0;
-uniform sampler2D _Splat1;
-uniform sampler2D _Splat2;
-uniform sampler2D _Splat3;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 splat_control;
- vec3 col;
- splat_control = texture2D( _Control, IN.uv_Control);
- col = (splat_control.x * texture2D( _Splat0, IN.uv_Splat0).xyz );
- col += (splat_control.y * texture2D( _Splat1, IN.uv_Splat1).xyz );
- col += (splat_control.z * texture2D( _Splat2, IN.uv_Splat2).xyz );
- col += (splat_control.w * texture2D( _Splat3, IN.uv_Splat3).xyz );
- o.Albedo = col;
- o.Alpha = 0.000000;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.uv_Control = IN.hip_pack0.xy ;
- surfIN.uv_Splat0 = IN.hip_pack0.zw ;
- surfIN.uv_Splat1 = IN.hip_pack1.xy ;
- surfIN.uv_Splat2 = IN.hip_pack1.zw ;
- surfIN.uv_Splat3 = IN.hip_pack2.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_pack1 = vec4( gl_TexCoord[1]);
- xlt_IN.hip_pack2 = vec2( gl_TexCoord[2]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[3]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[4]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt
deleted file mode 100644
index 627c0195187..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-uniform sampler2D _Control;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _Splat0;
-uniform sampler2D _Splat1;
-uniform sampler2D _Splat2;
-uniform sampler2D _Splat3;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1];
- vec3 tmpvar_3;
- tmpvar_3 = gl_TexCoord[4].xyz;
- vec4 light_4;
- vec3 col_5;
- vec4 tmpvar_6;
- tmpvar_6 = texture2D (_Control, tmpvar_1.xy);
- col_5 = (tmpvar_6.x * texture2D (_Splat0, tmpvar_1.zw).xyz);
- col_5 = (col_5 + (tmpvar_6.y * texture2D (_Splat1, tmpvar_2.xy).xyz));
- col_5 = (col_5 + (tmpvar_6.z * texture2D (_Splat2, tmpvar_2.zw).xyz));
- col_5 = (col_5 + (tmpvar_6.w * texture2D (_Splat3, gl_TexCoord[2].xy).xyz));
- light_4 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3])));
- light_4.xyz = (light_4.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_3.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_3.xy).xyz), vec3(clamp (tmpvar_3.z, 0.0, 1.0))));
- vec4 c_7;
- c_7.xyz = (col_5 * light_4.xyz);
- c_7.w = 0.0;
- gl_FragData[0] = c_7;
-}
-
-
-// stats: 16 alu 8 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// textures: 8
-// #0: _Control (high 2d) 0x0 [-1]
-// #1: _LightBuffer (high 2d) 0x0 [-1]
-// #2: _Splat0 (high 2d) 0x0 [-1]
-// #3: _Splat1 (high 2d) 0x0 [-1]
-// #4: _Splat2 (high 2d) 0x0 [-1]
-// #5: _Splat3 (high 2d) 0x0 [-1]
-// #6: unity_Lightmap (high 2d) 0x0 [-1]
-// #7: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt
deleted file mode 100644
index 1d49ccbb331..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec3 color;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 col;
- col = texture2D( _MainTex, i.uv);
- col.xyz *= (i.color * 2.00000);
- col.w = 1.00000;
- return col;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xlt_i.color = vec3( gl_TexCoord[1]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt
deleted file mode 100644
index 8598d0b4522..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 col_1;
- col_1.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * (gl_TexCoord[1].xyz * 2.0));
- col_1.w = 1.0;
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 3 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt
deleted file mode 100644
index e4baa940bbe..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec3 color;
-};
-uniform float _HalfOverCutoff;
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 col;
- col = texture2D( _MainTex, i.uv);
- col.xyz *= (i.color * 2.00000);
- col.w *= (2.00000 * _HalfOverCutoff);
- xll_clip( (col.w - 1.00000) );
- return col;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xlt_i.color = vec3( gl_TexCoord[1]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt
deleted file mode 100644
index 9d32287d66b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-uniform float _HalfOverCutoff;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 col_1;
- vec4 tmpvar_2;
- tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy);
- col_1.xyz = (tmpvar_2.xyz * (gl_TexCoord[1].xyz * 2.0));
- col_1.w = (tmpvar_2.w * (2.0 * _HalfOverCutoff));
- float x_3;
- x_3 = (col_1.w - 1.0);
- if ((x_3 < 0.0)) {
- discard;
- };
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 6 alu 2 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _HalfOverCutoff (high float) 1x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-in.txt
deleted file mode 100644
index 70a16f3df60..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-in.txt
+++ /dev/null
@@ -1,127 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
- vec3 _LightCoord;
-};
-uniform sampler2D _BumpSpecMap;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform sampler2D _TranslucencyMap;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingTreeBark( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- vec4 trngls;
- vec4 norspc;
- c = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (c.xyz * IN.color.xyz );
- trngls = texture2D( _TranslucencyMap, IN.uv_MainTex);
- o.Gloss = trngls.w ;
- o.Alpha = IN.color.w ;
- norspc = texture2D( _BumpSpecMap, IN.uv_MainTex);
- o.Specular = norspc.x ;
- o.Normal = vec3( UnpackNormal( norspc));
-}
-vec4 LightingTreeBark( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + (_LightColor0.xyz * spec)) * (atten * 2.00000));
- c.w = (((_LightColor0.w * spec) * atten) * s.Alpha);
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingTreeBark( o, lightDir, normalize( vec3( IN.viewDir) ), (texture2D( _LightTextureB0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w * textureCube( _LightTexture0, IN._LightCoord).w ));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lop_color = vec4( gl_Color);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN.viewDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt
deleted file mode 100644
index ed5882a82f6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-uniform sampler2D _BumpSpecMap;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform sampler2D _TranslucencyMap;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[3].xyz;
- vec4 c_3;
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_BumpSpecMap, tmpvar_1);
- vec4 normal_5;
- normal_5.xy = ((tmpvar_4.wy * 2.0) - 1.0);
- normal_5.z = sqrt(((1.0 -
- (normal_5.x * normal_5.x)
- ) - (normal_5.y * normal_5.y)));
- vec3 tmpvar_6;
- tmpvar_6 = normalize(gl_TexCoord[1].xyz);
- float atten_7;
- atten_7 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w);
- vec4 c_8;
- float spec_9;
- spec_9 = (pow (max (0.0,
- dot (normal_5.xyz, normalize((tmpvar_6 + normalize(gl_TexCoord[2].xyz))))
- ), (tmpvar_4.x * 128.0)) * texture2D (_TranslucencyMap, tmpvar_1).w);
- c_8.xyz = (((
- ((texture2D (_MainTex, tmpvar_1).xyz * gl_Color.xyz) * _LightColor0.xyz)
- *
- max (0.0, dot (normal_5.xyz, tmpvar_6))
- ) + (_LightColor0.xyz * spec_9)) * (atten_7 * 2.0));
- c_8.w = ((_LightColor0.w * spec_9) * (atten_7 * gl_Color.w));
- c_3.xyz = c_8.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 31 alu 5 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 5
-// #0: _BumpSpecMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high cube) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
-// #4: _TranslucencyMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt
deleted file mode 100644
index befaa8fda49..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt
+++ /dev/null
@@ -1,88 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
-};
-uniform sampler2D _BumpSpecMap;
-uniform sampler2D _MainTex;
-uniform sampler2D _TranslucencyMap;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- vec4 trngls;
- vec4 norspc;
- c = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (c.xyz * IN.color.xyz );
- trngls = texture2D( _TranslucencyMap, IN.uv_MainTex);
- o.Gloss = trngls.w ;
- o.Alpha = IN.color.w ;
- norspc = texture2D( _BumpSpecMap, IN.uv_MainTex);
- o.Specular = norspc.x ;
- o.Normal = vec3( UnpackNormal( norspc));
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- return vec4( 0.000000);
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt
deleted file mode 100644
index b8c9f3c0503..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-void main ()
-{
- gl_FragData[0] = vec4(0.0, 0.0, 0.0, 0.0);
-}
-
-
-// stats: 1 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt
deleted file mode 100644
index ac1f8621b4b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt
+++ /dev/null
@@ -1,156 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
-};
-uniform sampler2D _BumpSpecMap;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform sampler2D _TranslucencyMap;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout LeafSurfaceOutput o );
-vec4 LightingTreeLeaf( in LeafSurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout LeafSurfaceOutput o ) {
- vec4 c;
- vec4 trngls;
- vec4 norspc;
- c = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (c.xyz * IN.color.xyz );
- trngls = texture2D( _TranslucencyMap, IN.uv_MainTex);
- o.Translucency = trngls.xyz ;
- o.Gloss = trngls.w ;
- o.Alpha = (c.w * IN.color.w );
- norspc = texture2D( _BumpSpecMap, IN.uv_MainTex);
- o.Specular = norspc.x ;
- o.Normal = vec3( UnpackNormal( norspc));
-}
-vec4 LightingTreeLeaf( in LeafSurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- float trans;
- vec3 translucencyColor;
- vec3 col;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = dot( s.Normal, lightDir);
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- trans = max( 0.000000, ( -diff ));
- translucencyColor = ((s.Translucency * trans) * 2.00000);
- diff = max( 0.000000, ((diff * 0.500000) + 0.500000));
- col = (s.Albedo * (diff + translucencyColor));
- col += (spec * (1.00000 - xll_saturate( ceil( trans ) )));
- col *= _LightColor0.xyz ;
- c.xyz = (col * (atten * 2.00000));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- LeafSurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- lightDir = IN.lightDir;
- c = LightingTreeLeaf( o, lightDir, normalize( vec3( IN.viewDir) ), 1.00000);
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lop_color = vec4( gl_Color);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN.viewDir = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt
deleted file mode 100644
index 86d31e24fc7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-uniform sampler2D _BumpSpecMap;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform sampler2D _TranslucencyMap;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1].xyz;
- vec4 c_3;
- float tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, tmpvar_1);
- vec4 tmpvar_6;
- tmpvar_6 = texture2D (_TranslucencyMap, tmpvar_1);
- tmpvar_4 = (tmpvar_5.w * gl_Color.w);
- vec4 tmpvar_7;
- tmpvar_7 = texture2D (_BumpSpecMap, tmpvar_1);
- vec4 normal_8;
- normal_8.xy = ((tmpvar_7.wy * 2.0) - 1.0);
- normal_8.z = sqrt(((1.0 -
- (normal_8.x * normal_8.x)
- ) - (normal_8.y * normal_8.y)));
- float x_9;
- x_9 = (tmpvar_4 - _Cutoff);
- if ((x_9 < 0.0)) {
- discard;
- };
- vec4 c_10;
- vec3 col_11;
- float tmpvar_12;
- tmpvar_12 = dot (normal_8.xyz, tmpvar_2);
- float tmpvar_13;
- tmpvar_13 = max (0.0, -(tmpvar_12));
- col_11 = ((tmpvar_5.xyz * gl_Color.xyz) * (max (0.0,
- ((tmpvar_12 * 0.5) + 0.5)
- ) + (
- (tmpvar_6.xyz * tmpvar_13)
- * 2.0)));
- col_11 = (col_11 + ((
- pow (max (0.0, dot (normal_8.xyz, normalize(
- (tmpvar_2 + normalize(gl_TexCoord[2].xyz))
- ))), (tmpvar_7.x * 128.0))
- * tmpvar_6.w) * (1.0 -
- clamp (ceil(tmpvar_13), 0.0, 1.0)
- )));
- col_11 = (col_11 * _LightColor0.xyz);
- c_10.xyz = (col_11 * 2.0);
- c_3.xyz = c_10.xyz;
- c_3.w = tmpvar_4;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 36 alu 4 tex 1 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Cutoff (high float) 1x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 3
-// #0: _BumpSpecMap (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: _TranslucencyMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt
deleted file mode 100644
index a31302b15c2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt
+++ /dev/null
@@ -1,161 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
- vec3 _LightCoord;
-};
-uniform sampler2D _BumpSpecMap;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform sampler2D _TranslucencyMap;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout LeafSurfaceOutput o );
-vec4 LightingTreeLeaf( in LeafSurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout LeafSurfaceOutput o ) {
- vec4 c;
- vec4 trngls;
- vec4 norspc;
- c = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (c.xyz * IN.color.xyz );
- trngls = texture2D( _TranslucencyMap, IN.uv_MainTex);
- o.Translucency = trngls.xyz ;
- o.Gloss = trngls.w ;
- o.Alpha = (c.w * IN.color.w );
- norspc = texture2D( _BumpSpecMap, IN.uv_MainTex);
- o.Specular = norspc.x ;
- o.Normal = vec3( UnpackNormal( norspc));
-}
-vec4 LightingTreeLeaf( in LeafSurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- float trans;
- vec3 translucencyColor;
- vec3 col;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = dot( s.Normal, lightDir);
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- trans = max( 0.000000, ( -diff ));
- translucencyColor = ((s.Translucency * trans) * 2.00000);
- diff = max( 0.000000, ((diff * 0.500000) + 0.500000));
- col = (s.Albedo * (diff + translucencyColor));
- col += (spec * (1.00000 - xll_saturate( ceil( trans ) )));
- col *= _LightColor0.xyz ;
- c.xyz = (col * (atten * 2.00000));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- LeafSurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingTreeLeaf( o, lightDir, normalize( vec3( IN.viewDir) ), (texture2D( _LightTextureB0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w * textureCube( _LightTexture0, IN._LightCoord).w ));
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lop_color = vec4( gl_Color);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN.viewDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt
deleted file mode 100644
index e4ae19d8886..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-uniform sampler2D _BumpSpecMap;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform sampler2D _TranslucencyMap;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[3].xyz;
- vec4 c_3;
- float tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, tmpvar_1);
- vec4 tmpvar_6;
- tmpvar_6 = texture2D (_TranslucencyMap, tmpvar_1);
- tmpvar_4 = (tmpvar_5.w * gl_Color.w);
- vec4 tmpvar_7;
- tmpvar_7 = texture2D (_BumpSpecMap, tmpvar_1);
- vec4 normal_8;
- normal_8.xy = ((tmpvar_7.wy * 2.0) - 1.0);
- normal_8.z = sqrt(((1.0 -
- (normal_8.x * normal_8.x)
- ) - (normal_8.y * normal_8.y)));
- float x_9;
- x_9 = (tmpvar_4 - _Cutoff);
- if ((x_9 < 0.0)) {
- discard;
- };
- vec3 tmpvar_10;
- tmpvar_10 = normalize(gl_TexCoord[1].xyz);
- vec4 c_11;
- vec3 col_12;
- float tmpvar_13;
- tmpvar_13 = dot (normal_8.xyz, tmpvar_10);
- float tmpvar_14;
- tmpvar_14 = max (0.0, -(tmpvar_13));
- col_12 = ((tmpvar_5.xyz * gl_Color.xyz) * (max (0.0,
- ((tmpvar_13 * 0.5) + 0.5)
- ) + (
- (tmpvar_6.xyz * tmpvar_14)
- * 2.0)));
- col_12 = (col_12 + ((
- pow (max (0.0, dot (normal_8.xyz, normalize(
- (tmpvar_10 + normalize(gl_TexCoord[2].xyz))
- ))), (tmpvar_7.x * 128.0))
- * tmpvar_6.w) * (1.0 -
- clamp (ceil(tmpvar_14), 0.0, 1.0)
- )));
- col_12 = (col_12 * _LightColor0.xyz);
- c_11.xyz = (col_12 * ((texture2D (_LightTextureB0, vec2(
- dot (tmpvar_2, tmpvar_2)
- )).w * textureCube (_LightTexture0, tmpvar_2).w) * 2.0));
- c_3.xyz = c_11.xyz;
- c_3.w = tmpvar_4;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 40 alu 6 tex 1 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Cutoff (high float) 1x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 5
-// #0: _BumpSpecMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high cube) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
-// #4: _TranslucencyMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-in.txt
deleted file mode 100644
index b7032ae4491..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-in.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
-};
-uniform vec4 _CenterRadius;
-uniform sampler2D _MainTex;
-uniform mat4 _RotationMatrix;
-vec2 MultiplyUV( in mat4 mat, in vec2 inUV );
-vec4 frag( in v2f i );
-vec2 MultiplyUV( in mat4 mat, in vec2 inUV ) {
- vec4 temp;
- temp = vec4( inUV.x , inUV.y , 0.000000, 0.000000);
- temp = ( mat * temp );
- return temp.xy ;
-}
-vec4 frag( in v2f i ) {
- vec2 offset;
- vec2 distortedOffset;
- vec2 tmp;
- float t;
- offset = i.uv;
- distortedOffset = MultiplyUV( _RotationMatrix, offset.xy );
- tmp = (offset / _CenterRadius.zw );
- t = min( 1.00000, length( tmp ));
- offset = mix( distortedOffset, offset, vec2( t));
- offset += _CenterRadius.xy ;
- return texture2D( _MainTex, offset);
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt
deleted file mode 100644
index 0fef47659f9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twirt_Effect_Shader-out.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-uniform vec4 _CenterRadius;
-uniform sampler2D _MainTex;
-uniform mat4 _RotationMatrix;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec2 tmp_2;
- vec4 tmpvar_3;
- tmpvar_3.zw = vec2(0.0, 0.0);
- tmpvar_3.xy = tmpvar_1;
- tmp_2 = (tmpvar_1 / _CenterRadius.zw);
- gl_FragData[0] = texture2D (_MainTex, (mix ((_RotationMatrix * tmpvar_3).xy, tmpvar_1, vec2(min (1.0,
- sqrt(dot (tmp_2, tmp_2))
- ))) + _CenterRadius.xy));
-}
-
-
-// stats: 8 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _CenterRadius (high float) 4x1 [-1]
-// #1: _RotationMatrix (high float) 4x4 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-in.txt
deleted file mode 100644
index 2e90d990bdc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-in.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-void xll_sincos( float x, out float s, out float c) {
- s = sin(x);
- c = cos(x);
-}
-void xll_sincos( vec2 x, out vec2 s, out vec2 c) {
- s = sin(x);
- c = cos(x);
-}
-void xll_sincos( vec3 x, out vec3 s, out vec3 c) {
- s = sin(x);
- c = cos(x);
-}
-void xll_sincos( vec4 x, out vec4 s, out vec4 c) {
- s = sin(x);
- c = cos(x);
-}
-void xll_sincos( mat2 x, out mat2 s, out mat2 c) {
- s = mat2( sin ( x[0] ), sin ( x[1] ) );
- c = mat2( cos ( x[0] ), cos ( x[1] ) );
-}
-void xll_sincos( mat3 x, out mat3 s, out mat3 c) {
- s = mat3( sin ( x[0] ), sin ( x[1] ), sin ( x[2] ) );
- c = mat3( cos ( x[0] ), cos ( x[1] ), cos ( x[2] ) );
-}
-void xll_sincos( mat4 x, out mat4 s, out mat4 c) {
- s = mat4( sin ( x[0] ), sin ( x[1] ), sin ( x[2] ), sin ( x[3] ) );
- c = mat4( cos ( x[0] ), cos ( x[1] ), cos ( x[2] ), cos ( x[3] ) );
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec2 uvOrig;
-};
-uniform float _Angle;
-uniform vec4 _CenterRadius;
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec2 offset;
- float angle;
- float sinLength;
- float cosLength;
- vec2 uv;
- offset = i.uvOrig;
- angle = (1.00000 - length( (offset / _CenterRadius.zw ) ));
- angle = max( 0.000000, angle);
- angle = ((angle * angle) * _Angle);
- xll_sincos( angle, sinLength, cosLength);
- uv.x = ((cosLength * offset.x ) - (sinLength * offset.y ));
- uv.y = ((sinLength * offset.x ) + (cosLength * offset.y ));
- uv += _CenterRadius.xy ;
- return texture2D( _MainTex, uv);
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xlt_i.uvOrig = vec2( gl_TexCoord[1]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-out.txt
deleted file mode 100644
index 1b197287f61..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Hidden_Twist_Effect-out.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-uniform float _Angle;
-uniform vec4 _CenterRadius;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[1].xy;
- vec2 uv_2;
- float angle_3;
- vec2 x_4;
- x_4 = (tmpvar_1 / _CenterRadius.zw);
- angle_3 = (1.0 - sqrt(dot (x_4, x_4)));
- float tmpvar_5;
- tmpvar_5 = max (0.0, angle_3);
- angle_3 = ((tmpvar_5 * tmpvar_5) * _Angle);
- float tmpvar_6;
- tmpvar_6 = sin(angle_3);
- float tmpvar_7;
- tmpvar_7 = cos(angle_3);
- uv_2.x = ((tmpvar_7 * tmpvar_1.x) - (tmpvar_6 * tmpvar_1.y));
- uv_2.y = ((tmpvar_6 * tmpvar_1.x) + (tmpvar_7 * tmpvar_1.y));
- uv_2 = (uv_2 + _CenterRadius.xy);
- gl_FragData[0] = texture2D (_MainTex, uv_2);
-}
-
-
-// stats: 16 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Angle (high float) 1x1 [-1]
-// #1: _CenterRadius (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt
deleted file mode 100644
index a6f7b123800..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec2 uv2_LightMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightMap;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 lm;
- o.Albedo = (texture2D( _MainTex, IN.uv_MainTex).xyz * vec3( _Color));
- lm = texture2D( _LightMap, IN.uv2_LightMap);
- o.Emission = (lm.xyz * o.Albedo.xyz );
- o.Alpha = (lm.w * _Color.w );
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingLambert( o, lightDir, (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN._LightCoord = vec2( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt
deleted file mode 100644
index c944addf6f1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightMap;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 c_2;
- vec2 tmpvar_3;
- vec4 normal_4;
- normal_4.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_4.z = sqrt(((1.0 -
- (normal_4.x * normal_4.x)
- ) - (normal_4.y * normal_4.y)));
- vec4 c_5;
- c_5.xyz = (((texture2D (_MainTex, tmpvar_1.xy).xyz * _Color.xyz) * _LightColor0.xyz) * ((
- max (0.0, dot (normal_4.xyz, gl_TexCoord[1].xyz))
- * texture2D (_LightTexture0, gl_TexCoord[2].xy).w) * 2.0));
- c_5.w = (texture2D (_LightMap, tmpvar_3).w * _Color.w);
- c_2.xyz = c_5.xyz;
- c_2.w = 0.0;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 16 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 4
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _LightMap (high 2d) 0x0 [-1]
-// #2: _LightTexture0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-in.txt
deleted file mode 100644
index ea160ddf83f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-in.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec2 uv2_LightMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _LightMap;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 lm;
- o.Albedo = (texture2D( _MainTex, IN.uv_MainTex).xyz * vec3( _Color));
- lm = texture2D( _LightMap, IN.uv2_LightMap);
- o.Emission = (lm.xyz * o.Albedo.xyz );
- o.Alpha = (lm.w * _Color.w );
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv2_LightMap = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- col.xyz += o.Emission;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt
deleted file mode 100644
index cd0ec4f73c8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse2-out.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _LightMap;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 col_2;
- vec4 light_3;
- vec3 tmpvar_4;
- tmpvar_4 = (texture2D (_MainTex, tmpvar_1.xy).xyz * _Color.xyz);
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_LightMap, tmpvar_1.zw);
- light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_3.xyz = (light_3.xyz + unity_Ambient.xyz);
- vec4 c_6;
- c_6.xyz = (tmpvar_4 * light_3.xyz);
- c_6.w = (tmpvar_5.w * _Color.w);
- col_2.w = c_6.w;
- col_2.xyz = (c_6.xyz + (tmpvar_5.xyz * tmpvar_4));
- gl_FragData[0] = col_2;
-}
-
-
-// stats: 8 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: unity_Ambient (high float) 4x1 [-1]
-// textures: 3
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _LightMap (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-in.txt
deleted file mode 100644
index 90441a17067..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-in.txt
+++ /dev/null
@@ -1,105 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv2_LightMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightMap;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 lm;
- o.Albedo = (texture2D( _MainTex, IN.uv_MainTex).xyz * vec3( _Color));
- lm = texture2D( _LightMap, IN.uv2_LightMap);
- o.Emission = (lm.xyz * o.Albedo.xyz );
- o.Alpha = (lm.w * _Color.w );
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt
deleted file mode 100644
index 6b5c2e18cf2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Legacy_Shaders_Lightmapped_Diffuse-out.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightMap;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[3];
- vec4 c_2;
- vec2 tmpvar_3;
- vec4 c_4;
- c_4.xyz = (((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _Color.xyz) * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz)))
- *
- ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w)
- ) * 2.0));
- c_4.w = (texture2D (_LightMap, tmpvar_3).w * _Color.w);
- c_2.xyz = c_4.xyz;
- c_2.w = 0.0;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 17 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 4
-// #0: _LightMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES.txt
deleted file mode 100644
index 0867ee8a259..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES.txt
+++ /dev/null
@@ -1,83 +0,0 @@
-struct SurfaceOutput {
- lowp vec3 Albedo;
- lowp vec3 Normal;
- lowp vec3 Emission;
- mediump float Specular;
- lowp float Gloss;
- lowp float Alpha;
-};
-struct Input {
- mediump vec2 uv_MainTex;
-};
-struct v2f_surf {
- highp vec4 pos;
- mediump vec2 pack0;
- mediump vec3 viewDir;
- lowp vec3 lightDir;
- lowp vec3 vlight;
-};
-uniform sampler2D _BumpMap;
-uniform lowp vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform mediump float _Shininess;
-lowp vec3 UnpackNormal( in lowp vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-lowp vec4 LightingMobileBlinnPhong( in SurfaceOutput s, in lowp vec3 lightDir, in lowp vec3 halfDir, in lowp float atten );
-lowp vec4 frag_surf( in v2f_surf IN );
-lowp vec3 UnpackNormal( in lowp vec4 packednormal ) {
- return ((packednormal.xyz * 2.0) - 1.0);
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- lowp vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = tex.xyz ;
- o.Gloss = tex.w ;
- o.Alpha = tex.w ;
- o.Specular = _Shininess;
- o.Normal = UnpackNormal( texture2D( _BumpMap, IN.uv_MainTex));
-}
-lowp vec4 LightingMobileBlinnPhong( in SurfaceOutput s, in lowp vec3 lightDir, in lowp vec3 halfDir, in lowp float atten ) {
- lowp float diff;
- lowp float nh;
- lowp float spec;
- lowp vec4 c;
- diff = max( 0.0, dot( s.Normal, lightDir));
- nh = max( 0.0, dot( s.Normal, halfDir));
- spec = (pow( nh, (s.Specular * 128.0)) * s.Gloss);
- c.xyz = ((((s.Albedo * diff) + spec) * _LightColor0.xyz ) * (atten * 2.0));
- c.w = 0.0;
- return c;
-}
-lowp vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- lowp float atten;
- lowp vec4 c;
- surfIN.uv_MainTex = IN.pack0.xy ;
- o.Albedo = vec3( 0.0);
- o.Emission = vec3( 0.0);
- o.Specular = 0.0;
- o.Alpha = 0.0;
- o.Gloss = 0.0;
- surf( surfIN, o);
- atten = 1.0;
- c = vec4( 0.0);
- c = LightingMobileBlinnPhong( o, IN.lightDir, IN.viewDir, atten);
- c.xyz += (o.Albedo * IN.vlight);
- return c;
-}
-varying mediump vec2 xlv_TEXCOORD0;
-varying mediump vec3 xlv_TEXCOORD1;
-varying lowp vec3 xlv_TEXCOORD2;
-varying lowp vec3 xlv_TEXCOORD3;
-void main() {
- lowp vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.pack0 = vec2( xlv_TEXCOORD0);
- xlt_IN.viewDir = vec3( xlv_TEXCOORD1);
- xlt_IN.lightDir = vec3( xlv_TEXCOORD2);
- xlt_IN.vlight = vec3( xlv_TEXCOORD3);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt
deleted file mode 100644
index 732844f0e61..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-inES3.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-
-struct SurfaceOutput {
- lowp vec3 Albedo;
- lowp vec3 Normal;
- lowp vec3 Emission;
- mediump float Specular;
- lowp float Gloss;
- lowp float Alpha;
-};
-struct Input {
- mediump vec2 uv_MainTex;
-};
-struct v2f_surf {
- highp vec4 pos;
- mediump vec2 pack0;
- mediump vec3 viewDir;
- lowp vec3 lightDir;
- lowp vec3 vlight;
-};
-uniform sampler2D _BumpMap;
-uniform lowp vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform mediump float _Shininess;
-lowp vec3 UnpackNormal( in lowp vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-lowp vec4 LightingMobileBlinnPhong( in SurfaceOutput s, in lowp vec3 lightDir, in lowp vec3 halfDir, in lowp float atten );
-lowp vec4 frag_surf( in v2f_surf IN );
-lowp vec3 UnpackNormal( in lowp vec4 packednormal ) {
- return ((packednormal.xyz * 2.0) - 1.0);
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- lowp vec4 tex;
- tex = texture( _MainTex, IN.uv_MainTex);
- o.Albedo = tex.xyz ;
- o.Gloss = tex.w ;
- o.Alpha = tex.w ;
- o.Specular = _Shininess;
- o.Normal = UnpackNormal( texture( _BumpMap, IN.uv_MainTex));
-}
-lowp vec4 LightingMobileBlinnPhong( in SurfaceOutput s, in lowp vec3 lightDir, in lowp vec3 halfDir, in lowp float atten ) {
- lowp float diff;
- lowp float nh;
- lowp float spec;
- lowp vec4 c;
- diff = max( 0.0, dot( s.Normal, lightDir));
- nh = max( 0.0, dot( s.Normal, halfDir));
- spec = (pow( nh, (s.Specular * 128.0)) * s.Gloss);
- c.xyz = ((((s.Albedo * diff) + spec) * _LightColor0.xyz ) * (atten * 2.0));
- c.w = 0.0;
- return c;
-}
-lowp vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- lowp float atten;
- lowp vec4 c;
- surfIN.uv_MainTex = IN.pack0.xy ;
- o.Albedo = vec3( 0.0);
- o.Emission = vec3( 0.0);
- o.Specular = 0.0;
- o.Alpha = 0.0;
- o.Gloss = 0.0;
- surf( surfIN, o);
- atten = 1.0;
- c = vec4( 0.0);
- c = LightingMobileBlinnPhong( o, IN.lightDir, IN.viewDir, atten);
- c.xyz += (o.Albedo * IN.vlight);
- return c;
-}
-in mediump vec2 xlv_TEXCOORD0;
-in mediump vec3 xlv_TEXCOORD1;
-in lowp vec3 xlv_TEXCOORD2;
-in lowp vec3 xlv_TEXCOORD3;
-void main() {
- lowp vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.pack0 = vec2( xlv_TEXCOORD0);
- xlt_IN.viewDir = vec3( xlv_TEXCOORD1);
- xlt_IN.lightDir = vec3( xlv_TEXCOORD2);
- xlt_IN.vlight = vec3( xlv_TEXCOORD3);
- xl_retval = frag_surf( xlt_IN);
- _fragData = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES.txt
deleted file mode 100644
index 70641880666..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform lowp vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform mediump float _Shininess;
-varying mediump vec2 xlv_TEXCOORD0;
-varying mediump vec3 xlv_TEXCOORD1;
-varying lowp vec3 xlv_TEXCOORD2;
-varying lowp vec3 xlv_TEXCOORD3;
-void main ()
-{
- lowp vec4 c_1;
- lowp vec4 tmpvar_2;
- tmpvar_2 = texture2D (_MainTex, xlv_TEXCOORD0);
- lowp vec3 tmpvar_3;
- tmpvar_3 = ((texture2D (_BumpMap, xlv_TEXCOORD0).xyz * 2.0) - 1.0);
- lowp vec3 halfDir_4;
- halfDir_4 = xlv_TEXCOORD1;
- lowp vec4 c_5;
- lowp float spec_6;
- lowp float tmpvar_7;
- tmpvar_7 = max (0.0, dot (tmpvar_3, halfDir_4));
- mediump float tmpvar_8;
- tmpvar_8 = pow (tmpvar_7, (_Shininess * 128.0));
- spec_6 = (tmpvar_8 * tmpvar_2.w);
- c_5.xyz = (((
- (tmpvar_2.xyz * max (0.0, dot (tmpvar_3, xlv_TEXCOORD2)))
- + spec_6) * _LightColor0.xyz) * 2.0);
- c_5.w = 0.0;
- c_1.w = c_5.w;
- c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * xlv_TEXCOORD3));
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 16 alu 2 tex 0 flow
-// inputs: 4
-// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (medium float) 3x1 [-1]
-// #2: xlv_TEXCOORD2 (low float) 3x1 [-1]
-// #3: xlv_TEXCOORD3 (low float) 3x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: _LightColor0 (low float) 4x1 [-1]
-// #1: _Shininess (medium float) 1x1 [-1]
-// textures: 2
-// #0: _BumpMap (low 2d) 0x0 [-1]
-// #1: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3.txt
deleted file mode 100644
index f46b1884f03..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-#version 300 es
-out mediump vec4 _fragData;
-uniform sampler2D _BumpMap;
-uniform lowp vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform mediump float _Shininess;
-in mediump vec2 xlv_TEXCOORD0;
-in mediump vec3 xlv_TEXCOORD1;
-in lowp vec3 xlv_TEXCOORD2;
-in lowp vec3 xlv_TEXCOORD3;
-void main ()
-{
- lowp vec4 c_1;
- lowp vec4 tmpvar_2;
- tmpvar_2 = texture (_MainTex, xlv_TEXCOORD0);
- lowp vec3 tmpvar_3;
- tmpvar_3 = ((texture (_BumpMap, xlv_TEXCOORD0).xyz * 2.0) - 1.0);
- lowp vec3 halfDir_4;
- halfDir_4 = xlv_TEXCOORD1;
- lowp vec4 c_5;
- lowp float spec_6;
- lowp float tmpvar_7;
- tmpvar_7 = max (0.0, dot (tmpvar_3, halfDir_4));
- mediump float tmpvar_8;
- tmpvar_8 = pow (tmpvar_7, (_Shininess * 128.0));
- spec_6 = (tmpvar_8 * tmpvar_2.w);
- c_5.xyz = (((
- (tmpvar_2.xyz * max (0.0, dot (tmpvar_3, xlv_TEXCOORD2)))
- + spec_6) * _LightColor0.xyz) * 2.0);
- c_5.w = 0.0;
- c_1.w = c_5.w;
- c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * xlv_TEXCOORD3));
- _fragData = c_1;
-}
-
-
-// stats: 16 alu 2 tex 0 flow
-// inputs: 4
-// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (medium float) 3x1 [-1]
-// #2: xlv_TEXCOORD2 (low float) 3x1 [-1]
-// #3: xlv_TEXCOORD3 (low float) 3x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: _LightColor0 (low float) 4x1 [-1]
-// #1: _Shininess (medium float) 1x1 [-1]
-// textures: 2
-// #0: _BumpMap (low 2d) 0x0 [-1]
-// #1: _MainTex (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3Metal.txt
deleted file mode 100644
index b595775e75d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-MobileBumpSpec-outES3Metal.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- half2 xlv_TEXCOORD0;
- half3 xlv_TEXCOORD1;
- half3 xlv_TEXCOORD2;
- half3 xlv_TEXCOORD3;
-};
-struct xlatMtlShaderOutput {
- half4 _fragData [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- half4 _LightColor0;
- half _Shininess;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _BumpMap [[texture(0)]], sampler _mtlsmp__BumpMap [[sampler(0)]]
- , texture2d<half> _MainTex [[texture(1)]], sampler _mtlsmp__MainTex [[sampler(1)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 c_1 = 0;
- half4 tmpvar_2 = 0;
- tmpvar_2 = _MainTex.sample(_mtlsmp__MainTex, (float2)(_mtl_i.xlv_TEXCOORD0));
- half3 tmpvar_3 = 0;
- tmpvar_3 = ((_BumpMap.sample(_mtlsmp__BumpMap, (float2)(_mtl_i.xlv_TEXCOORD0)).xyz * (half)(2.0)) - (half)(1.0));
- half3 halfDir_4 = 0;
- halfDir_4 = _mtl_i.xlv_TEXCOORD1;
- half4 c_5 = 0;
- half spec_6 = 0;
- half tmpvar_7 = 0;
- tmpvar_7 = max ((half)0.0, dot (tmpvar_3, halfDir_4));
- half tmpvar_8 = 0;
- tmpvar_8 = pow (tmpvar_7, (_mtl_u._Shininess * (half)(128.0)));
- spec_6 = (tmpvar_8 * tmpvar_2.w);
- c_5.xyz = (((
- (tmpvar_2.xyz * max ((half)0.0, dot (tmpvar_3, _mtl_i.xlv_TEXCOORD2)))
- + spec_6) * _mtl_u._LightColor0.xyz) * (half)(2.0));
- c_5.w = half(0.0);
- c_1.w = c_5.w;
- c_1.xyz = (c_5.xyz + (tmpvar_2.xyz * _mtl_i.xlv_TEXCOORD3));
- _mtl_o._fragData = c_1;
- return _mtl_o;
-}
-
-
-// stats: 16 alu 2 tex 0 flow
-// inputs: 4
-// #0: xlv_TEXCOORD0 (medium float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (medium float) 3x1 [-1]
-// #2: xlv_TEXCOORD2 (low float) 3x1 [-1]
-// #3: xlv_TEXCOORD3 (low float) 3x1 [-1]
-// uniforms: 2 (total size: 10)
-// #0: _LightColor0 (low float) 4x1 [-1] loc 0
-// #1: _Shininess (medium float) 1x1 [-1] loc 8
-// textures: 2
-// #0: _BumpMap (low 2d) 0x0 [-1] loc 0
-// #1: _MainTex (low 2d) 0x0 [-1] loc 1
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-in.txt
deleted file mode 100644
index 32bc7b712da..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-in.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- return (texture2D( _MainTex, i.texcoord) * vec4( 1.00000, 0.000000, 0.000000, 1.00000));
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt
deleted file mode 100644
index 53684bfe717..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_My_Soft_Occlusion_Leaves-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- gl_FragData[0] = (texture2D (_MainTex, gl_TexCoord[0].xy) * vec4(1.0, 0.0, 0.0, 1.0));
-}
-
-
-// stats: 1 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-in.txt
deleted file mode 100644
index a23a5b45e90..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-in.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-out.txt
deleted file mode 100644
index 2ca19c2dcf3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[3];
- vec4 c_2;
- vec4 c_3;
- c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
- vec4 c_4;
- c_4.xyz = ((c_3.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz)))
- *
- ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w)
- ) * 2.0));
- c_4.w = c_3.w;
- c_2.xyz = c_4.xyz;
- c_2.w = 0.0;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 16 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 3
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _LightTextureB0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-in.txt
deleted file mode 100644
index ea4625ddf4a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-in.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingLambert( o, lightDir, (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec2( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-out.txt
deleted file mode 100644
index 5f001ce83a2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark1-out.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 c_1;
- vec4 c_2;
- c_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
- vec4 c_3;
- c_3.xyz = ((c_2.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz))
- * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0));
- c_3.w = c_2.w;
- c_1.xyz = c_3.xyz;
- c_1.w = 0.0;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 8 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-in.txt
deleted file mode 100644
index d10964c37b5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-in.txt
+++ /dev/null
@@ -1,76 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 vec;
-};
-uniform vec4 _Color;
-uniform vec4 _LightPositionRange;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 EncodeFloatRGBA( in float v );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 EncodeFloatRGBA( in float v ) {
- vec4 kEncodeMul = vec4( 1.00000, 255.000, 65025.0, 1.60581e+008);
- float kEncodeBit = 0.00392157;
- vec4 enc;
- enc = (kEncodeMul * v);
- enc = fract( enc );
- enc -= (enc.yzww * kEncodeBit);
- return enc;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- return EncodeFloatRGBA( (length( IN.vec ) * _LightPositionRange.w ));
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.vec = vec3( gl_TexCoord[0]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt
deleted file mode 100644
index cb620ef4866..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark2-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-uniform vec4 _LightPositionRange;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xyz;
- vec4 enc_2;
- enc_2 = (vec4(1.0, 255.0, 65025.0, 1.60581e+08) * (sqrt(
- dot (tmpvar_1, tmpvar_1)
- ) * _LightPositionRange.w));
- vec4 tmpvar_3;
- tmpvar_3 = fract(enc_2);
- enc_2 = (tmpvar_3 - (tmpvar_3.yzww * 0.00392157));
- gl_FragData[0] = enc_2;
-}
-
-
-// stats: 7 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightPositionRange (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-in.txt
deleted file mode 100644
index f969f0d6cd2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-in.txt
+++ /dev/null
@@ -1,127 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 _ShadowCoord0;
- vec3 _ShadowCoord1;
- vec3 _ShadowCoord2;
- vec3 _ShadowCoord3;
- vec2 _ShadowZFade;
-};
-uniform vec4 _Color;
-uniform vec4 _LightShadowData;
-uniform vec4 _LightSplitsFar;
-uniform vec4 _LightSplitsNear;
-uniform sampler2D _MainTex;
-uniform vec4 _ProjectionParams;
-uniform sampler2D _ShadowMapTexture;
-void surf( in Input IN, inout SurfaceOutput o );
-vec2 EncodeFloatRG( in float v );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec2 EncodeFloatRG( in float v ) {
- vec2 kEncodeMul = vec2( 1.00000, 255.000);
- float kEncodeBit = 0.00392157;
- vec2 enc;
- enc = (kEncodeMul * v);
- enc = fract( enc );
- enc.x -= (enc.y * kEncodeBit);
- return enc;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- vec4 z;
- vec4 near;
- vec4 far;
- vec4 weights;
- vec4 coord;
- float shadow;
- float faded;
- vec4 res;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- z = vec4( IN._ShadowZFade.x );
- near = vec4( greaterThanEqual( z, _LightSplitsNear) );
- far = vec4( lessThan( z, _LightSplitsFar) );
- weights = (near * far);
- coord = vec4( ((((IN._ShadowCoord0 * weights.x ) + (IN._ShadowCoord1 * weights.y )) + (IN._ShadowCoord2 * weights.z )) + (IN._ShadowCoord3 * weights.w )), 1.00000);
- shadow = ( (texture2D( _ShadowMapTexture, coord.xy ).x < coord.z ) ) ? ( _LightShadowData.x ) : ( 1.00000 );
- faded = xll_saturate( (shadow + xll_saturate( IN._ShadowZFade.y )) );
- res.x = faded;
- res.y = 1.00000;
- res.zw = EncodeFloatRG( float( (1.00000 - (z * _ProjectionParams.w ))));
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN._ShadowCoord0 = vec3( gl_TexCoord[0]);
- xlt_IN._ShadowCoord1 = vec3( gl_TexCoord[1]);
- xlt_IN._ShadowCoord2 = vec3( gl_TexCoord[2]);
- xlt_IN._ShadowCoord3 = vec3( gl_TexCoord[3]);
- xlt_IN._ShadowZFade = vec2( gl_TexCoord[4]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-out.txt
deleted file mode 100644
index b820441d5dc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Bark3-out.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-uniform vec4 _LightShadowData;
-uniform vec4 _LightSplitsFar;
-uniform vec4 _LightSplitsNear;
-uniform vec4 _ProjectionParams;
-uniform sampler2D _ShadowMapTexture;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[4].xy;
- vec4 res_2;
- vec4 weights_3;
- weights_3 = (vec4(greaterThanEqual (tmpvar_1.xxxx, _LightSplitsNear)) * vec4(lessThan (tmpvar_1.xxxx, _LightSplitsFar)));
- vec4 tmpvar_4;
- tmpvar_4.w = 1.0;
- tmpvar_4.xyz = (((
- (gl_TexCoord[0].xyz * weights_3.x)
- +
- (gl_TexCoord[1].xyz * weights_3.y)
- ) + (gl_TexCoord[2].xyz * weights_3.z)) + (gl_TexCoord[3].xyz * weights_3.w));
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_ShadowMapTexture, tmpvar_4.xy);
- float tmpvar_6;
- if ((tmpvar_5.x < tmpvar_4.z)) {
- tmpvar_6 = _LightShadowData.x;
- } else {
- tmpvar_6 = 1.0;
- };
- res_2.x = clamp ((tmpvar_6 + clamp (tmpvar_1.y, 0.0, 1.0)), 0.0, 1.0);
- res_2.y = 1.0;
- vec2 enc_7;
- enc_7 = (vec2(1.0, 255.0) * (1.0 - (tmpvar_1.xxxx * _ProjectionParams.w)).x);
- vec2 tmpvar_8;
- tmpvar_8 = fract(enc_7);
- enc_7.y = tmpvar_8.y;
- enc_7.x = (tmpvar_8.x - (tmpvar_8.y * 0.00392157));
- res_2.zw = enc_7;
- gl_FragData[0] = res_2;
-}
-
-
-// stats: 25 alu 1 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _LightShadowData (high float) 4x1 [-1]
-// #1: _LightSplitsFar (high float) 4x1 [-1]
-// #2: _LightSplitsNear (high float) 4x1 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
-// textures: 1
-// #0: _ShadowMapTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-in.txt
deleted file mode 100644
index 3ad85815dca..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-in.txt
+++ /dev/null
@@ -1,105 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 vlight;
- vec4 _ShadowCoord;
-};
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform sampler2D _ShadowMapTexture;
-uniform vec4 _WorldSpaceLightPos0;
-float unitySampleShadow( in vec4 shadowCoord );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-float unitySampleShadow( in vec4 shadowCoord ) {
- float shadow;
- shadow = texture2DProj( _ShadowMapTexture, shadowCoord).x ;
- return shadow;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- float atten;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- atten = unitySampleShadow( IN._ShadowCoord);
- c = LightingLambert( o, _WorldSpaceLightPos0.xyz , atten);
- c.xyz += (o.Albedo * IN.vlight);
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.vlight = vec3( gl_TexCoord[2]);
- xlt_IN._ShadowCoord = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-out.txt
deleted file mode 100644
index 44506be176c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves-out.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform sampler2D _ShadowMapTexture;
-uniform vec4 _WorldSpaceLightPos0;
-void main ()
-{
- vec4 c_1;
- float tmpvar_2;
- vec4 c_3;
- c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
- tmpvar_2 = c_3.w;
- float x_4;
- x_4 = (c_3.w - _Cutoff);
- if ((x_4 < 0.0)) {
- discard;
- };
- vec4 c_5;
- c_5.xyz = ((c_3.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, _WorldSpaceLightPos0.xyz))
- * texture2DProj (_ShadowMapTexture, gl_TexCoord[3]).x) * 2.0));
- c_5.w = tmpvar_2;
- c_1.xyz = (c_5.xyz + (c_3.xyz * gl_TexCoord[2].xyz));
- c_1.w = tmpvar_2;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 11 alu 3 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: _LightColor0 (high float) 4x1 [-1]
-// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// textures: 2
-// #0: _MainTex (high 2d) 0x0 [-1]
-// #1: _ShadowMapTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-in.txt
deleted file mode 100644
index 6c683ae1198..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-in.txt
+++ /dev/null
@@ -1,91 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
-};
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-out.txt
deleted file mode 100644
index 8e834b2b142..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves1-out.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 light_1;
- vec4 c_2;
- c_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
- float x_3;
- x_3 = (c_2.w - _Cutoff);
- if ((x_3 < 0.0)) {
- discard;
- };
- light_1 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_1.xyz = (light_1.xyz + unity_Ambient.xyz);
- vec4 c_4;
- c_4.xyz = (c_2.xyz * light_1.xyz);
- c_4.w = c_2.w;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 7 alu 3 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: unity_Ambient (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-in.txt
deleted file mode 100644
index 07589fddd08..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-in.txt
+++ /dev/null
@@ -1,125 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-out.txt
deleted file mode 100644
index 4b8f8bf7ce4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves2-out.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[2].xyz;
- vec4 light_2;
- vec4 c_3;
- c_3 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
- float x_4;
- x_4 = (c_3.w - _Cutoff);
- if ((x_4 < 0.0)) {
- discard;
- };
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0))));
- vec4 c_5;
- c_5.xyz = (c_3.xyz * light_2.xyz);
- c_5.w = c_3.w;
- gl_FragData[0] = c_5;
-}
-
-
-// stats: 11 alu 5 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// textures: 4
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: unity_Lightmap (high 2d) 0x0 [-1]
-// #3: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-in.txt
deleted file mode 100644
index d0065d33155..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-in.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 vec;
- vec2 hip_pack0;
-};
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightPositionRange;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 EncodeFloatRGBA( in float v );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 EncodeFloatRGBA( in float v ) {
- vec4 kEncodeMul = vec4( 1.00000, 255.000, 65025.0, 1.60581e+008);
- float kEncodeBit = 0.00392157;
- vec4 enc;
- enc = (kEncodeMul * v);
- enc = fract( enc );
- enc -= (enc.yzww * kEncodeBit);
- return enc;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- return EncodeFloatRGBA( (length( IN.vec ) * _LightPositionRange.w ));
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.vec = vec3( gl_TexCoord[0]);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[1]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-out.txt
deleted file mode 100644
index 948eb839bf2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Soft_Occlusion_Leaves3-out.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightPositionRange;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xyz;
- float x_2;
- x_2 = ((texture2D (_MainTex, gl_TexCoord[1].xy) * _Color).w - _Cutoff);
- if ((x_2 < 0.0)) {
- discard;
- };
- vec4 enc_3;
- enc_3 = (vec4(1.0, 255.0, 65025.0, 1.60581e+08) * (sqrt(
- dot (tmpvar_1, tmpvar_1)
- ) * _LightPositionRange.w));
- vec4 tmpvar_4;
- tmpvar_4 = fract(enc_3);
- enc_3 = (tmpvar_4 - (tmpvar_4.yzww * 0.00392157));
- gl_FragData[0] = enc_3;
-}
-
-
-// stats: 10 alu 2 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: _LightPositionRange (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-in.txt
deleted file mode 100644
index 04dd6ca6487..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-in.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 col;
- col = (_Color * texture2D( _MainTex, i.texcoord));
- xll_clip( (col.w - _Cutoff) );
- return col;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt
deleted file mode 100644
index f9926efe609..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Nature_Vegetation_Two_Pass_unlit-out.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 col_1;
- col_1 = (_Color * texture2D (_MainTex, gl_TexCoord[0].xy));
- float x_2;
- x_2 = (col_1.w - _Cutoff);
- if ((x_2 < 0.0)) {
- discard;
- };
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 3 alu 2 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-in.txt
deleted file mode 100644
index dd285de69e6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-in.txt
+++ /dev/null
@@ -1,128 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec3 vlight;
- vec4 _ShadowCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform sampler2D _ShadowMapTexture;
-float unitySampleShadow( in vec4 shadowCoord );
-vec4 UnpackNormal( in vec4 packednormal );
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-float unitySampleShadow( in vec4 shadowCoord ) {
- float shadow;
- shadow = texture2DProj( _ShadowMapTexture, shadowCoord).x ;
- return shadow;
-}
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
- vec3 v;
- h = ((h * height) - (height / 2.00000));
- v = normalize( viewDir );
- v.z += 0.420000;
- return (h * (v.xy / v.z ));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float h;
- vec2 offset;
- vec4 c;
- h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
- offset = ParallaxOffset( h, _Parallax, IN.viewDir);
- IN.uv_MainTex += offset;
- IN.uv_BumpMap += offset;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- float atten;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- atten = unitySampleShadow( IN._ShadowCoord);
- c = LightingLambert( o, IN.lightDir, atten);
- c.xyz += (o.Albedo * IN.vlight);
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN.vlight = vec3( gl_TexCoord[3]);
- xlt_IN._ShadowCoord = vec4( gl_TexCoord[4]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-out.txt
deleted file mode 100644
index c9689ca9e85..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse-out.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform sampler2D _ShadowMapTexture;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 c_2;
- vec4 c_3;
- vec2 tmpvar_4;
- vec3 v_5;
- vec3 tmpvar_6;
- tmpvar_6 = normalize(gl_TexCoord[1].xyz);
- v_5.xy = tmpvar_6.xy;
- v_5.z = (tmpvar_6.z + 0.42);
- tmpvar_4 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_6.xy / v_5.z));
- c_3 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_4)) * _Color);
- vec4 normal_7;
- normal_7.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_4)).wy * 2.0) - 1.0);
- normal_7.z = sqrt(((1.0 -
- (normal_7.x * normal_7.x)
- ) - (normal_7.y * normal_7.y)));
- vec4 c_8;
- c_8.xyz = ((c_3.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (normal_7.xyz, gl_TexCoord[2].xyz))
- * texture2DProj (_ShadowMapTexture, gl_TexCoord[4]).x) * 2.0));
- c_8.w = c_3.w;
- c_2.w = c_8.w;
- c_2.xyz = (c_8.xyz + (c_3.xyz * gl_TexCoord[3].xyz));
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 25 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Parallax (high float) 1x1 [-1]
-// textures: 4
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: _ParallaxMap (high 2d) 0x0 [-1]
-// #3: _ShadowMapTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-in.txt
deleted file mode 100644
index a2f75c79eb4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-in.txt
+++ /dev/null
@@ -1,117 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform vec4 unity_Ambient;
-vec4 UnpackNormal( in vec4 packednormal );
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
- vec3 v;
- h = ((h * height) - (height / 2.00000));
- v = normalize( viewDir );
- v.z += 0.420000;
- return (h * (v.xy / v.z ));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float h;
- vec2 offset;
- vec4 c;
- h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
- offset = ParallaxOffset( h, _Parallax, IN.viewDir);
- IN.uv_MainTex += offset;
- IN.uv_BumpMap += offset;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-out.txt
deleted file mode 100644
index 471b4cc0ccc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse1-out.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 light_2;
- vec4 c_3;
- vec3 v_4;
- vec3 tmpvar_5;
- tmpvar_5 = normalize(gl_TexCoord[1].xyz);
- v_4.xy = tmpvar_5.xy;
- v_4.z = (tmpvar_5.z + 0.42);
- c_3 = (texture2D (_MainTex, (tmpvar_1.xy + (
- ((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0))
- *
- (tmpvar_5.xy / v_4.z)
- ))) * _Color);
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2])));
- light_2.xyz = (light_2.xyz + unity_Ambient.xyz);
- vec4 c_6;
- c_6.xyz = (c_3.xyz * light_2.xyz);
- c_6.w = c_3.w;
- gl_FragData[0] = c_6;
-}
-
-
-// stats: 13 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Parallax (high float) 1x1 [-1]
-// #2: unity_Ambient (high float) 4x1 [-1]
-// textures: 3
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: _ParallaxMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-in.txt
deleted file mode 100644
index 1692621bda1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-in.txt
+++ /dev/null
@@ -1,151 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-vec4 UnpackNormal( in vec4 packednormal );
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
- vec3 v;
- h = ((h * height) - (height / 2.00000));
- v = normalize( viewDir );
- v.z += 0.420000;
- return (h * (v.xy / v.z ));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float h;
- vec2 offset;
- vec4 c;
- h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
- offset = ParallaxOffset( h, _Parallax, IN.viewDir);
- IN.uv_MainTex += offset;
- IN.uv_BumpMap += offset;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[2]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-out.txt
deleted file mode 100644
index 47d3eabf21f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Diffuse2-out.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[3].xyz;
- vec4 light_3;
- vec4 c_4;
- vec3 v_5;
- vec3 tmpvar_6;
- tmpvar_6 = normalize(gl_TexCoord[1].xyz);
- v_5.xy = tmpvar_6.xy;
- v_5.z = (tmpvar_6.z + 0.42);
- c_4 = (texture2D (_MainTex, (tmpvar_1.xy + (
- ((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0))
- *
- (tmpvar_6.xy / v_5.z)
- ))) * _Color);
- light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2])));
- light_3.xyz = (light_3.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_2.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_2.xy).xyz), vec3(clamp (tmpvar_2.z, 0.0, 1.0))));
- vec4 c_7;
- c_7.xyz = (c_4.xyz * light_3.xyz);
- c_7.w = c_4.w;
- gl_FragData[0] = c_7;
-}
-
-
-// stats: 17 alu 5 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Parallax (high float) 1x1 [-1]
-// textures: 5
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: _ParallaxMap (high 2d) 0x0 [-1]
-// #3: unity_Lightmap (high 2d) 0x0 [-1]
-// #4: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-in.txt
deleted file mode 100644
index e938f555f42..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-in.txt
+++ /dev/null
@@ -1,140 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-vec4 UnpackNormal( in vec4 packednormal );
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
- vec3 v;
- h = ((h * height) - (height / 2.00000));
- v = normalize( viewDir );
- v.z += 0.420000;
- return (h * (v.xy / v.z ));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float h;
- vec2 offset;
- vec4 tex;
- h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
- offset = ParallaxOffset( h, _Parallax, IN.viewDir);
- IN.uv_MainTex += offset;
- IN.uv_BumpMap += offset;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-out.txt
deleted file mode 100644
index 73ef2117e4b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Parallax_Specular-out.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1].xyz;
- vec4 tmpvar_3;
- tmpvar_3 = gl_TexCoord[3];
- vec4 c_4;
- vec2 tmpvar_5;
- vec3 v_6;
- vec3 tmpvar_7;
- tmpvar_7 = normalize(tmpvar_2);
- v_6.xy = tmpvar_7.xy;
- v_6.z = (tmpvar_7.z + 0.42);
- tmpvar_5 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_7.xy / v_6.z));
- vec4 tmpvar_8;
- tmpvar_8 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_5));
- vec4 normal_9;
- normal_9.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_5)).wy * 2.0) - 1.0);
- normal_9.z = sqrt(((1.0 -
- (normal_9.x * normal_9.x)
- ) - (normal_9.y * normal_9.y)));
- vec3 tmpvar_10;
- tmpvar_10 = normalize(gl_TexCoord[2].xyz);
- float atten_11;
- atten_11 = ((float(
- (tmpvar_3.z > 0.0)
- ) * texture2D (_LightTexture0, (
- (tmpvar_3.xy / tmpvar_3.w)
- + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_3.xyz, tmpvar_3.xyz))).w);
- vec4 c_12;
- float spec_13;
- spec_13 = (pow (max (0.0,
- dot (normal_9.xyz, normalize((tmpvar_10 + normalize(tmpvar_2))))
- ), (_Shininess * 128.0)) * tmpvar_8.w);
- c_12.xyz = (((
- ((tmpvar_8.xyz * _Color.xyz) * _LightColor0.xyz)
- *
- max (0.0, dot (normal_9.xyz, tmpvar_10))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_13)) * (atten_11 * 2.0));
- c_12.w = ((tmpvar_8.w * _Color.w) + ((_LightColor0.w * _SpecColor.w) * (spec_13 * atten_11)));
- c_4.xyz = c_12.xyz;
- c_4.w = 0.0;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 48 alu 5 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 5 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Parallax (high float) 1x1 [-1]
-// #3: _Shininess (high float) 1x1 [-1]
-// #4: _SpecColor (high float) 4x1 [-1]
-// textures: 5
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
-// #4: _ParallaxMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-in.txt
deleted file mode 100644
index 967365d83fb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-in.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-uniform vec4 _TintColor;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- return (((2.00000 * i.color) * _TintColor) * texture2D( _MainTex, i.texcoord));
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-out.txt
deleted file mode 100644
index 58decf60ad4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive-out.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-uniform sampler2D _MainTex;
-uniform vec4 _TintColor;
-void main ()
-{
- gl_FragData[0] = (((2.0 * gl_Color) * _TintColor) * texture2D (_MainTex, gl_TexCoord[0].xy));
-}
-
-
-// stats: 3 alu 1 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _TintColor (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-in.txt
deleted file mode 100644
index 70c58119fea..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-in.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 prev;
- prev = (i.color * texture2D( _MainTex, i.texcoord));
- prev.xyz *= prev.w ;
- return prev;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-out.txt
deleted file mode 100644
index 2ecf0af3a67..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Additive_(Soft)-out.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 prev_1;
- prev_1 = (gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy));
- prev_1.xyz = (prev_1.xyz * prev_1.w);
- gl_FragData[0] = prev_1;
-}
-
-
-// stats: 2 alu 1 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-in.txt
deleted file mode 100644
index 327354da04a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-in.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- return ((i.color * texture2D( _MainTex, i.texcoord)) * i.color.w );
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt
deleted file mode 100644
index 62ff87d1801..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Alpha_Blended_Premultiply-out.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- gl_FragData[0] = ((gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy)) * gl_Color.w);
-}
-
-
-// stats: 2 alu 1 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-in.txt
deleted file mode 100644
index c262ae200dd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-in.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 prev;
- prev = (i.color * texture2D( _MainTex, i.texcoord));
- return mix( vec4( 1.00000, 1.00000, 1.00000, 1.00000), prev, vec4( prev.w ));
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-out.txt
deleted file mode 100644
index e8752575e42..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply-out.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 prev_1;
- prev_1 = (gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy));
- gl_FragData[0] = mix (vec4(1.0, 1.0, 1.0, 1.0), prev_1, prev_1.wwww);
-}
-
-
-// stats: 2 alu 1 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-in.txt
deleted file mode 100644
index 856c5663af7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-in.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 tex;
- vec4 col;
- tex = texture2D( _MainTex, i.texcoord);
- col.xyz = ((tex.xyz * i.color.xyz ) * 2.00000);
- col.w = (i.color.w * tex.w );
- return mix( vec4( 0.500000, 0.500000, 0.500000, 0.500000), col, vec4( col.w ));
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-out.txt
deleted file mode 100644
index 8887c38d2a6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles_Multiply_(Double)-out.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 col_1;
- vec4 tmpvar_2;
- tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy);
- col_1.xyz = ((tmpvar_2.xyz * gl_Color.xyz) * 2.0);
- col_1.w = (gl_Color.w * tmpvar_2.w);
- gl_FragData[0] = mix (vec4(0.5, 0.5, 0.5, 0.5), col_1, col_1.wwww);
-}
-
-
-// stats: 4 alu 1 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-in.txt
deleted file mode 100644
index 10d4aa72543..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-in.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-uniform vec4 _TintColor;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 tex;
- vec4 col;
- tex = texture2D( _MainTex, i.texcoord);
- col.xyz = (((_TintColor.xyz * tex.xyz ) * i.color.xyz ) * 2.00000);
- col.w = ((1.00000 - tex.w ) * ((_TintColor.w * i.color.w ) * 2.00000));
- return col;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-out.txt
deleted file mode 100644
index be250651c2e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Particles__Additive-Multiply-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-uniform sampler2D _MainTex;
-uniform vec4 _TintColor;
-void main ()
-{
- vec4 col_1;
- vec4 tmpvar_2;
- tmpvar_2 = texture2D (_MainTex, gl_TexCoord[0].xy);
- col_1.xyz = ((_TintColor.xyz * tmpvar_2.xyz) * (gl_Color.xyz * 2.0));
- col_1.w = ((1.0 - tmpvar_2.w) * ((_TintColor.w * gl_Color.w) * 2.0));
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 7 alu 1 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _TintColor (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-in.txt
deleted file mode 100644
index 46d999d6a86..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-in.txt
+++ /dev/null
@@ -1,111 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- vec3 worldRefl;
- vec4 reflcol;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
- worldRefl = IN.worldRefl;
- reflcol = textureCube( _Cube, worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingLambert( o, lightDir, (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN._LightCoord = vec2( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-out.txt
deleted file mode 100644
index e14892f1436..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse-out.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 c_2;
- vec3 tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_MainTex, tmpvar_1.xy);
- vec4 normal_5;
- normal_5.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_5.z = sqrt(((1.0 -
- (normal_5.x * normal_5.x)
- ) - (normal_5.y * normal_5.y)));
- vec4 c_6;
- c_6.xyz = (((tmpvar_4 * _Color).xyz * _LightColor0.xyz) * ((
- max (0.0, dot (normal_5.xyz, gl_TexCoord[1].xyz))
- * texture2D (_LightTexture0, gl_TexCoord[2].xy).w) * 2.0));
- c_6.w = ((textureCube (_Cube, tmpvar_3) * tmpvar_4.w).w * _ReflectColor.w);
- c_2.xyz = c_6.xyz;
- c_2.w = 0.0;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 17 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _ReflectColor (high float) 4x1 [-1]
-// textures: 4
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _Cube (high cube) 0x0 [-1]
-// #2: _LightTexture0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-in.txt
deleted file mode 100644
index 5faa60723bb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-in.txt
+++ /dev/null
@@ -1,156 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
- vec3 TtoW0;
- vec3 TtoW1;
- vec3 TtoW2;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
- vec4 TtoW0;
- vec4 TtoW1;
- vec4 TtoW2;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- vec3 worldRefl;
- vec4 reflcol;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
- worldRefl = reflect( IN.worldRefl, vec3( dot( IN.TtoW0, o.Normal), dot( IN.TtoW1, o.Normal), dot( IN.TtoW2, o.Normal)));
- reflcol = textureCube( _Cube, worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.worldRefl = vec3( IN.TtoW0.w , IN.TtoW1.w , IN.TtoW2.w );
- surfIN.TtoW0 = IN.TtoW0.xyz ;
- surfIN.TtoW1 = IN.TtoW1.xyz ;
- surfIN.TtoW2 = IN.TtoW2.xyz ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingLambert_PrePass( o, light);
- col.xyz += o.Emission;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xlt_IN.TtoW0 = vec4( gl_TexCoord[2]);
- xlt_IN.TtoW1 = vec4( gl_TexCoord[3]);
- xlt_IN.TtoW2 = vec4( gl_TexCoord[4]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[5]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-out.txt
deleted file mode 100644
index b61b2abd152..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Diffuse1-out.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[2];
- vec4 tmpvar_3;
- tmpvar_3 = gl_TexCoord[3];
- vec4 tmpvar_4;
- tmpvar_4 = gl_TexCoord[4];
- vec3 tmpvar_5;
- tmpvar_5 = gl_TexCoord[5].xyz;
- vec4 col_6;
- vec4 light_7;
- vec3 tmpvar_8;
- tmpvar_8.x = tmpvar_2.w;
- tmpvar_8.y = tmpvar_3.w;
- tmpvar_8.z = tmpvar_4.w;
- vec4 reflcol_9;
- vec4 tmpvar_10;
- tmpvar_10 = texture2D (_MainTex, tmpvar_1.xy);
- vec4 normal_11;
- normal_11.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_11.z = sqrt(((1.0 -
- (normal_11.x * normal_11.x)
- ) - (normal_11.y * normal_11.y)));
- vec3 tmpvar_12;
- tmpvar_12.x = dot (tmpvar_2.xyz, normal_11.xyz);
- tmpvar_12.y = dot (tmpvar_3.xyz, normal_11.xyz);
- tmpvar_12.z = dot (tmpvar_4.xyz, normal_11.xyz);
- reflcol_9 = (textureCube (_Cube, (tmpvar_8 - (2.0 *
- (dot (tmpvar_12, tmpvar_8) * tmpvar_12)
- ))) * tmpvar_10.w);
- light_7 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_7.xyz = (light_7.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_5.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_5.xy).xyz), vec3(clamp (tmpvar_5.z, 0.0, 1.0))));
- vec4 c_13;
- c_13.xyz = ((tmpvar_10 * _Color).xyz * light_7.xyz);
- c_13.w = (reflcol_9.w * _ReflectColor.w);
- col_6.w = c_13.w;
- col_6.xyz = (c_13.xyz + (reflcol_9.xyz * _ReflectColor.xyz));
- gl_FragData[0] = col_6;
-}
-
-
-// stats: 27 alu 6 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [6] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _ReflectColor (high float) 4x1 [-1]
-// textures: 6
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _Cube (high cube) 0x0 [-1]
-// #2: _LightBuffer (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
-// #4: unity_Lightmap (high 2d) 0x0 [-1]
-// #5: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-in.txt
deleted file mode 100644
index 7b7c7e96c28..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-in.txt
+++ /dev/null
@@ -1,124 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec3 viewDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- vec3 worldRefl;
- vec4 reflcol;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Gloss = tex.w ;
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
- worldRefl = IN.worldRefl;
- reflcol = textureCube( _Cube, worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), texture2D( _LightTexture0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w );
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN.viewDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-out.txt
deleted file mode 100644
index 09234376ae7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular-out.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[3].xyz;
- vec4 c_3;
- vec3 tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, tmpvar_1.xy);
- vec4 normal_6;
- normal_6.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_6.z = sqrt(((1.0 -
- (normal_6.x * normal_6.x)
- ) - (normal_6.y * normal_6.y)));
- vec3 tmpvar_7;
- tmpvar_7 = normalize(gl_TexCoord[1].xyz);
- vec4 tmpvar_8;
- tmpvar_8 = texture2D (_LightTexture0, vec2(dot (tmpvar_2, tmpvar_2)));
- vec4 c_9;
- float spec_10;
- spec_10 = (pow (max (0.0,
- dot (normal_6.xyz, normalize((tmpvar_7 + normalize(gl_TexCoord[2].xyz))))
- ), (_Shininess * 128.0)) * tmpvar_5.w);
- c_9.xyz = (((
- ((tmpvar_5 * _Color).xyz * _LightColor0.xyz)
- *
- max (0.0, dot (normal_6.xyz, tmpvar_7))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_10)) * (tmpvar_8.w * 2.0));
- c_9.w = (((textureCube (_Cube, tmpvar_4) * tmpvar_5.w).w * _ReflectColor.w) + ((_LightColor0.w * _SpecColor.w) * (spec_10 * tmpvar_8.w)));
- c_3.xyz = c_9.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 34 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 5 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _ReflectColor (high float) 4x1 [-1]
-// #3: _Shininess (high float) 1x1 [-1]
-// #4: _SpecColor (high float) 4x1 [-1]
-// textures: 4
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _Cube (high cube) 0x0 [-1]
-// #2: _LightTexture0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-in.txt
deleted file mode 100644
index 048ee847b71..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-in.txt
+++ /dev/null
@@ -1,104 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- vec2 hip_pack0;
- vec3 TtoV0;
- vec3 TtoV1;
- vec3 TtoV2;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform float _Shininess;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- vec3 worldRefl;
- vec4 reflcol;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Gloss = tex.w ;
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
- worldRefl = IN.worldRefl;
- reflcol = textureCube( _Cube, worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 viewN;
- vec4 res;
- surfIN.uv_BumpMap = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- viewN.x = dot( IN.TtoV0, o.Normal);
- viewN.y = dot( IN.TtoV1, o.Normal);
- viewN.z = dot( IN.TtoV2, o.Normal);
- o.Normal = viewN;
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.TtoV0 = vec3( gl_TexCoord[1]);
- xlt_IN.TtoV1 = vec3( gl_TexCoord[2]);
- xlt_IN.TtoV2 = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-out.txt
deleted file mode 100644
index 0d855bd4672..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular1-out.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform float _Shininess;
-void main ()
-{
- vec4 res_1;
- vec3 viewN_2;
- vec4 normal_3;
- normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0);
- normal_3.z = sqrt(((1.0 -
- (normal_3.x * normal_3.x)
- ) - (normal_3.y * normal_3.y)));
- viewN_2.x = dot (gl_TexCoord[1].xyz, normal_3.xyz);
- viewN_2.y = dot (gl_TexCoord[2].xyz, normal_3.xyz);
- viewN_2.z = dot (gl_TexCoord[3].xyz, normal_3.xyz);
- res_1.xyz = ((viewN_2 * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = _Shininess;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 12 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Shininess (high float) 1x1 [-1]
-// textures: 1
-// #0: _BumpMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-in.txt
deleted file mode 100644
index 37f2e786cde..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-in.txt
+++ /dev/null
@@ -1,128 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
- vec3 TtoW0;
- vec3 TtoW1;
- vec3 TtoW2;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
- vec4 TtoW0;
- vec4 TtoW1;
- vec4 TtoW2;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-uniform vec4 unity_Ambient;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- vec3 worldRefl;
- vec4 reflcol;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Gloss = tex.w ;
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
- worldRefl = reflect( IN.worldRefl, vec3( dot( IN.TtoW0, o.Normal), dot( IN.TtoW1, o.Normal), dot( IN.TtoW2, o.Normal)));
- reflcol = textureCube( _Cube, worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light ) {
- float spec;
- vec4 c;
- spec = (light.w * s.Gloss);
- c.xyz = ((s.Albedo * light.xyz ) + ((light.xyz * _SpecColor.xyz ) * spec));
- c.w = (s.Alpha + (spec * _SpecColor.w ));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.worldRefl = vec3( IN.TtoW0.w , IN.TtoW1.w , IN.TtoW2.w );
- surfIN.TtoW0 = IN.TtoW0.xyz ;
- surfIN.TtoW1 = IN.TtoW1.xyz ;
- surfIN.TtoW2 = IN.TtoW2.xyz ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingBlinnPhong_PrePass( o, light);
- col.xyz += o.Emission;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xlt_IN.TtoW0 = vec4( gl_TexCoord[2]);
- xlt_IN.TtoW1 = vec4( gl_TexCoord[3]);
- xlt_IN.TtoW2 = vec4( gl_TexCoord[4]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt
deleted file mode 100644
index db6a67a3c78..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Specular2-out.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform vec4 _SpecColor;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[2];
- vec4 tmpvar_3;
- tmpvar_3 = gl_TexCoord[3];
- vec4 tmpvar_4;
- tmpvar_4 = gl_TexCoord[4];
- vec4 col_5;
- vec4 light_6;
- vec3 tmpvar_7;
- tmpvar_7.x = tmpvar_2.w;
- tmpvar_7.y = tmpvar_3.w;
- tmpvar_7.z = tmpvar_4.w;
- vec4 reflcol_8;
- vec4 tmpvar_9;
- tmpvar_9 = texture2D (_MainTex, tmpvar_1.xy);
- vec4 normal_10;
- normal_10.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_10.z = sqrt(((1.0 -
- (normal_10.x * normal_10.x)
- ) - (normal_10.y * normal_10.y)));
- vec3 tmpvar_11;
- tmpvar_11.x = dot (tmpvar_2.xyz, normal_10.xyz);
- tmpvar_11.y = dot (tmpvar_3.xyz, normal_10.xyz);
- tmpvar_11.z = dot (tmpvar_4.xyz, normal_10.xyz);
- reflcol_8 = (textureCube (_Cube, (tmpvar_7 - (2.0 *
- (dot (tmpvar_11, tmpvar_7) * tmpvar_11)
- ))) * tmpvar_9.w);
- light_6 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_6.xyz = (light_6.xyz + unity_Ambient.xyz);
- vec4 c_12;
- float spec_13;
- spec_13 = (light_6.w * tmpvar_9.w);
- c_12.xyz = (((tmpvar_9 * _Color).xyz * light_6.xyz) + ((light_6.xyz * _SpecColor.xyz) * spec_13));
- c_12.w = ((reflcol_8.w * _ReflectColor.w) + (spec_13 * _SpecColor.w));
- col_5.w = c_12.w;
- col_5.xyz = (c_12.xyz + (reflcol_8.xyz * _ReflectColor.xyz));
- gl_FragData[0] = col_5;
-}
-
-
-// stats: 29 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _ReflectColor (high float) 4x1 [-1]
-// #2: _SpecColor (high float) 4x1 [-1]
-// #3: unity_Ambient (high float) 4x1 [-1]
-// textures: 4
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _Cube (high cube) 0x0 [-1]
-// #2: _LightBuffer (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-in.txt
deleted file mode 100644
index 3d3a3aec417..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-in.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- float fog;
- vec2 uv;
- vec2 uv2;
- vec3 I;
- vec3 TtoW0;
- vec3 TtoW1;
- vec3 TtoW2;
-};
-struct appdata_tan {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
-};
-uniform sampler2D _BumpMap;
-uniform samplerCube _Cube;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-
-vec4 UnpackNormal( in vec4 packednormal );
-vec4 frag( in v2f i );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec4 frag( in v2f i ) {
- vec4 normal;
- vec4 texcol;
- vec3 wn;
- vec3 r;
- vec4 c;
- vec4 reflcolor;
- normal = UnpackNormal( texture2D( _BumpMap, i.uv2));
- texcol = texture2D( _MainTex, i.uv);
- wn.x = dot( i.TtoW0, normal.xyz );
- wn.y = dot( i.TtoW1, normal.xyz );
- wn.z = dot( i.TtoW2, normal.xyz );
- r = reflect( i.I, wn);
- c = (gl_LightModel.ambient * texcol);
- c.xyz *= 2.00000;
- reflcolor = ((textureCube( _Cube, r) * _ReflectColor) * texcol.w );
- return (c + reflcolor);
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.fog = float( xlv_FOG);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xlt_i.uv2 = vec2( gl_TexCoord[1]);
- xlt_i.I = vec3( gl_TexCoord[2]);
- xlt_i.TtoW0 = vec3( gl_TexCoord[3]);
- xlt_i.TtoW1 = vec3( gl_TexCoord[4]);
- xlt_i.TtoW2 = vec3( gl_TexCoord[5]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt
deleted file mode 100644
index 1aadd153dcf..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Bumped_Unlit-out.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform samplerCube _Cube;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[2].xyz;
- vec4 c_2;
- vec3 wn_3;
- vec4 normal_4;
- normal_4.xy = ((texture2D (_BumpMap, gl_TexCoord[1].xy).wy * 2.0) - 1.0);
- normal_4.z = sqrt(((1.0 -
- (normal_4.x * normal_4.x)
- ) - (normal_4.y * normal_4.y)));
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, gl_TexCoord[0].xy);
- wn_3.x = dot (gl_TexCoord[3].xyz, normal_4.xyz);
- wn_3.y = dot (gl_TexCoord[4].xyz, normal_4.xyz);
- wn_3.z = dot (gl_TexCoord[5].xyz, normal_4.xyz);
- c_2 = (gl_LightModel.ambient * tmpvar_5);
- c_2.xyz = (c_2.xyz * 2.0);
- gl_FragData[0] = (c_2 + ((textureCube (_Cube,
- (tmpvar_1 - (2.0 * (dot (wn_3, tmpvar_1) * wn_3)))
- ) * _ReflectColor) * tmpvar_5.w));
-}
-
-
-// stats: 19 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [6] loc 4
-// uniforms: 2 (total size: 0)
-// #0: gl_LightModel (high other) 0x0 [-1]
-// #1: _ReflectColor (high float) 4x1 [-1]
-// textures: 3
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _Cube (high cube) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-in.txt
deleted file mode 100644
index b7b4e568318..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-in.txt
+++ /dev/null
@@ -1,111 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- vec4 reflcol;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- reflcol = textureCube( _Cube, IN.worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-out.txt
deleted file mode 100644
index bb3b16efb3d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse-out.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[3];
- vec4 c_2;
- vec3 tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy);
- vec4 c_5;
- c_5.xyz = (((tmpvar_4 * _Color).xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz)))
- *
- ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w)
- ) * 2.0));
- c_5.w = ((textureCube (_Cube, tmpvar_3) * tmpvar_4.w).w * _ReflectColor.w);
- c_2.xyz = c_5.xyz;
- c_2.w = 0.0;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 18 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _ReflectColor (high float) 4x1 [-1]
-// textures: 4
-// #0: _Cube (high cube) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-in.txt
deleted file mode 100644
index fd969be5103..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-in.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 worldRefl;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform vec4 unity_Ambient;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- vec4 reflcol;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- reflcol = textureCube( _Cube, IN.worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.worldRefl = IN.worldRefl;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- col.xyz += o.Emission;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.worldRefl = vec3( gl_TexCoord[1]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-out.txt
deleted file mode 100644
index b83c76fd5a6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Diffuse1-out.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 col_1;
- vec4 light_2;
- vec4 reflcol_3;
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy);
- reflcol_3 = (textureCube (_Cube, gl_TexCoord[1].xyz) * tmpvar_4.w);
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2])));
- light_2.xyz = (light_2.xyz + unity_Ambient.xyz);
- vec4 c_5;
- c_5.xyz = ((tmpvar_4 * _Color).xyz * light_2.xyz);
- c_5.w = (reflcol_3.w * _ReflectColor.w);
- col_1.w = c_5.w;
- col_1.xyz = (c_5.xyz + (reflcol_3.xyz * _ReflectColor.xyz));
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 9 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _ReflectColor (high float) 4x1 [-1]
-// #2: unity_Ambient (high float) 4x1 [-1]
-// textures: 3
-// #0: _Cube (high cube) 0x0 [-1]
-// #1: _LightBuffer (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-in.txt
deleted file mode 100644
index 4ac625d1e3c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-in.txt
+++ /dev/null
@@ -1,141 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform vec4 _ReflectColor;
-vec4 UnpackNormal( in vec4 packednormal );
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
- vec3 v;
- h = ((h * height) - (height / 2.00000));
- v = normalize( viewDir );
- v.z += 0.420000;
- return (h * (v.xy / v.z ));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float h;
- vec2 offset;
- vec4 tex;
- vec4 c;
- vec3 worldRefl;
- vec4 reflcol;
- h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
- offset = ParallaxOffset( h, _Parallax, IN.viewDir);
- IN.uv_MainTex += offset;
- IN.uv_BumpMap += offset;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
- worldRefl = IN.worldRefl;
- reflcol = textureCube( _Cube, worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-out.txt
deleted file mode 100644
index 3cc611e3a2f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse-out.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform vec4 _ReflectColor;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[3];
- vec4 c_3;
- vec3 tmpvar_4;
- vec2 tmpvar_5;
- vec3 v_6;
- vec3 tmpvar_7;
- tmpvar_7 = normalize(gl_TexCoord[1].xyz);
- v_6.xy = tmpvar_7.xy;
- v_6.z = (tmpvar_7.z + 0.42);
- tmpvar_5 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_7.xy / v_6.z));
- vec4 tmpvar_8;
- tmpvar_8 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_5));
- vec4 normal_9;
- normal_9.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_5)).wy * 2.0) - 1.0);
- normal_9.z = sqrt(((1.0 -
- (normal_9.x * normal_9.x)
- ) - (normal_9.y * normal_9.y)));
- vec4 c_10;
- c_10.xyz = (((tmpvar_8 * _Color).xyz * _LightColor0.xyz) * ((
- max (0.0, dot (normal_9.xyz, normalize(gl_TexCoord[2].xyz)))
- *
- ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)
- ) * 2.0));
- c_10.w = ((textureCube (_Cube, tmpvar_4) * tmpvar_8.w).w * _ReflectColor.w);
- c_3.xyz = c_10.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 34 alu 6 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Parallax (high float) 1x1 [-1]
-// #3: _ReflectColor (high float) 4x1 [-1]
-// textures: 6
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _Cube (high cube) 0x0 [-1]
-// #2: _LightTexture0 (high 2d) 0x0 [-1]
-// #3: _LightTextureB0 (high 2d) 0x0 [-1]
-// #4: _MainTex (high 2d) 0x0 [-1]
-// #5: _ParallaxMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-in.txt
deleted file mode 100644
index 69d0ff01fac..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-in.txt
+++ /dev/null
@@ -1,142 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
- vec3 viewDir;
- vec3 TtoW0;
- vec3 TtoW1;
- vec3 TtoW2;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec4 hip_screen;
- vec4 TtoW0;
- vec4 TtoW1;
- vec4 TtoW2;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform vec4 _ReflectColor;
-uniform vec4 unity_Ambient;
-vec4 UnpackNormal( in vec4 packednormal );
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
- vec3 v;
- h = ((h * height) - (height / 2.00000));
- v = normalize( viewDir );
- v.z += 0.420000;
- return (h * (v.xy / v.z ));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float h;
- vec2 offset;
- vec4 tex;
- vec4 c;
- vec3 worldRefl;
- vec4 reflcol;
- h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
- offset = ParallaxOffset( h, _Parallax, IN.viewDir);
- IN.uv_MainTex += offset;
- IN.uv_BumpMap += offset;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
- worldRefl = reflect( IN.worldRefl, vec3( dot( IN.TtoW0, o.Normal), dot( IN.TtoW1, o.Normal), dot( IN.TtoW2, o.Normal)));
- reflcol = textureCube( _Cube, worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.worldRefl = vec3( IN.TtoW0.w , IN.TtoW1.w , IN.TtoW2.w );
- surfIN.TtoW0 = IN.TtoW0.xyz ;
- surfIN.TtoW1 = IN.TtoW1.xyz ;
- surfIN.TtoW2 = IN.TtoW2.xyz ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- col.xyz += o.Emission;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[2]);
- xlt_IN.TtoW0 = vec4( gl_TexCoord[3]);
- xlt_IN.TtoW1 = vec4( gl_TexCoord[4]);
- xlt_IN.TtoW2 = vec4( gl_TexCoord[5]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt
deleted file mode 100644
index 12f0e7fb13f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Diffuse1-out.txt
+++ /dev/null
@@ -1,72 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform vec4 _ReflectColor;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[3];
- vec4 tmpvar_3;
- tmpvar_3 = gl_TexCoord[4];
- vec4 tmpvar_4;
- tmpvar_4 = gl_TexCoord[5];
- vec4 col_5;
- vec4 light_6;
- vec3 tmpvar_7;
- tmpvar_7.x = tmpvar_2.w;
- tmpvar_7.y = tmpvar_3.w;
- tmpvar_7.z = tmpvar_4.w;
- vec4 reflcol_8;
- vec2 tmpvar_9;
- vec3 v_10;
- vec3 tmpvar_11;
- tmpvar_11 = normalize(gl_TexCoord[1].xyz);
- v_10.xy = tmpvar_11.xy;
- v_10.z = (tmpvar_11.z + 0.42);
- tmpvar_9 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_11.xy / v_10.z));
- vec4 tmpvar_12;
- tmpvar_12 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_9));
- vec4 normal_13;
- normal_13.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_9)).wy * 2.0) - 1.0);
- normal_13.z = sqrt(((1.0 -
- (normal_13.x * normal_13.x)
- ) - (normal_13.y * normal_13.y)));
- vec3 tmpvar_14;
- tmpvar_14.x = dot (tmpvar_2.xyz, normal_13.xyz);
- tmpvar_14.y = dot (tmpvar_3.xyz, normal_13.xyz);
- tmpvar_14.z = dot (tmpvar_4.xyz, normal_13.xyz);
- reflcol_8 = (textureCube (_Cube, (tmpvar_7 - (2.0 *
- (dot (tmpvar_14, tmpvar_7) * tmpvar_14)
- ))) * tmpvar_12.w);
- light_6 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2])));
- light_6.xyz = (light_6.xyz + unity_Ambient.xyz);
- vec4 c_15;
- c_15.xyz = ((tmpvar_12 * _Color).xyz * light_6.xyz);
- c_15.w = (reflcol_8.w * _ReflectColor.w);
- col_5.w = c_15.w;
- col_5.xyz = (c_15.xyz + (reflcol_8.xyz * _ReflectColor.xyz));
- gl_FragData[0] = col_5;
-}
-
-
-// stats: 32 alu 5 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [6] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Parallax (high float) 1x1 [-1]
-// #2: _ReflectColor (high float) 4x1 [-1]
-// #3: unity_Ambient (high float) 4x1 [-1]
-// textures: 5
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _Cube (high cube) 0x0 [-1]
-// #2: _LightBuffer (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
-// #4: _ParallaxMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-in.txt
deleted file mode 100644
index 16d2d6f8756..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-in.txt
+++ /dev/null
@@ -1,140 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform vec4 _ReflectColor;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-vec4 UnpackNormal( in vec4 packednormal );
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
- vec3 v;
- h = ((h * height) - (height / 2.00000));
- v = normalize( viewDir );
- v.z += 0.420000;
- return (h * (v.xy / v.z ));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float h;
- vec2 offset;
- vec4 tex;
- vec3 worldRefl;
- vec4 reflcol;
- h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
- offset = ParallaxOffset( h, _Parallax, IN.viewDir);
- IN.uv_MainTex += offset;
- IN.uv_BumpMap += offset;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
- worldRefl = IN.worldRefl;
- reflcol = textureCube( _Cube, worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), texture2D( _LightTexture0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w );
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-out.txt
deleted file mode 100644
index 21e84c6ca6e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular-out.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform vec4 _ReflectColor;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1].xyz;
- vec3 tmpvar_3;
- tmpvar_3 = gl_TexCoord[3].xyz;
- vec4 c_4;
- vec3 tmpvar_5;
- vec2 tmpvar_6;
- vec3 v_7;
- vec3 tmpvar_8;
- tmpvar_8 = normalize(tmpvar_2);
- v_7.xy = tmpvar_8.xy;
- v_7.z = (tmpvar_8.z + 0.42);
- tmpvar_6 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_8.xy / v_7.z));
- vec4 tmpvar_9;
- tmpvar_9 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_6));
- vec4 normal_10;
- normal_10.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_6)).wy * 2.0) - 1.0);
- normal_10.z = sqrt(((1.0 -
- (normal_10.x * normal_10.x)
- ) - (normal_10.y * normal_10.y)));
- vec3 tmpvar_11;
- tmpvar_11 = normalize(gl_TexCoord[2].xyz);
- vec4 tmpvar_12;
- tmpvar_12 = texture2D (_LightTexture0, vec2(dot (tmpvar_3, tmpvar_3)));
- vec4 c_13;
- float spec_14;
- spec_14 = (pow (max (0.0,
- dot (normal_10.xyz, normalize((tmpvar_11 + normalize(tmpvar_2))))
- ), (_Shininess * 128.0)) * tmpvar_9.w);
- c_13.xyz = (((
- ((tmpvar_9.xyz * _Color.xyz) * _LightColor0.xyz)
- *
- max (0.0, dot (normal_10.xyz, tmpvar_11))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_14)) * (tmpvar_12.w * 2.0));
- c_13.w = (((textureCube (_Cube, tmpvar_5) * tmpvar_9.w).w * _ReflectColor.w) + ((_LightColor0.w * _SpecColor.w) * (spec_14 * tmpvar_12.w)));
- c_4.xyz = c_13.xyz;
- c_4.w = 0.0;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 43 alu 5 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 6 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Parallax (high float) 1x1 [-1]
-// #3: _ReflectColor (high float) 4x1 [-1]
-// #4: _Shininess (high float) 1x1 [-1]
-// #5: _SpecColor (high float) 4x1 [-1]
-// textures: 5
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _Cube (high cube) 0x0 [-1]
-// #2: _LightTexture0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
-// #4: _ParallaxMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-in.txt
deleted file mode 100644
index 9c49e608a7f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-in.txt
+++ /dev/null
@@ -1,139 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform vec4 _ReflectColor;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-vec4 UnpackNormal( in vec4 packednormal );
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
- vec3 v;
- h = ((h * height) - (height / 2.00000));
- v = normalize( viewDir );
- v.z += 0.420000;
- return (h * (v.xy / v.z ));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float h;
- vec2 offset;
- vec4 tex;
- vec3 worldRefl;
- vec4 reflcol;
- h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
- offset = ParallaxOffset( h, _Parallax, IN.viewDir);
- IN.uv_MainTex += offset;
- IN.uv_BumpMap += offset;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
- worldRefl = IN.worldRefl;
- reflcol = textureCube( _Cube, worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec2( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-out.txt
deleted file mode 100644
index 6bc2226788b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Parallax_Specular1-out.txt
+++ /dev/null
@@ -1,72 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform vec4 _ReflectColor;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1].xyz;
- vec3 tmpvar_3;
- tmpvar_3 = gl_TexCoord[2].xyz;
- vec4 c_4;
- vec3 tmpvar_5;
- vec2 tmpvar_6;
- vec3 v_7;
- vec3 tmpvar_8;
- tmpvar_8 = normalize(tmpvar_2);
- v_7.xy = tmpvar_8.xy;
- v_7.z = (tmpvar_8.z + 0.42);
- tmpvar_6 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_8.xy / v_7.z));
- vec4 tmpvar_9;
- tmpvar_9 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_6));
- vec4 normal_10;
- normal_10.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_6)).wy * 2.0) - 1.0);
- normal_10.z = sqrt(((1.0 -
- (normal_10.x * normal_10.x)
- ) - (normal_10.y * normal_10.y)));
- float atten_11;
- atten_11 = texture2D (_LightTexture0, gl_TexCoord[3].xy).w;
- vec4 c_12;
- float spec_13;
- spec_13 = (pow (max (0.0,
- dot (normal_10.xyz, normalize((tmpvar_3 + normalize(tmpvar_2))))
- ), (_Shininess * 128.0)) * tmpvar_9.w);
- c_12.xyz = (((
- ((tmpvar_9.xyz * _Color.xyz) * _LightColor0.xyz)
- *
- max (0.0, dot (normal_10.xyz, tmpvar_3))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_13)) * (atten_11 * 2.0));
- c_12.w = (((textureCube (_Cube, tmpvar_5) * tmpvar_9.w).w * _ReflectColor.w) + ((_LightColor0.w * _SpecColor.w) * (spec_13 * atten_11)));
- c_4.xyz = c_12.xyz;
- c_4.w = 0.0;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 41 alu 5 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 6 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Parallax (high float) 1x1 [-1]
-// #3: _ReflectColor (high float) 4x1 [-1]
-// #4: _Shininess (high float) 1x1 [-1]
-// #5: _SpecColor (high float) 4x1 [-1]
-// textures: 5
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _Cube (high cube) 0x0 [-1]
-// #2: _LightTexture0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
-// #4: _ParallaxMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-in.txt
deleted file mode 100644
index 395bcebc5de..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-in.txt
+++ /dev/null
@@ -1,123 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 viewDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- vec4 reflcol;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Gloss = tex.w ;
- o.Specular = _Shininess;
- reflcol = textureCube( _Cube, IN.worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN.viewDir = vec3( gl_TexCoord[3]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[4]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-out.txt
deleted file mode 100644
index 8379eb4f8a0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular-out.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[1].xyz;
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[4];
- vec4 c_3;
- vec3 tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, gl_TexCoord[0].xy);
- vec3 tmpvar_6;
- tmpvar_6 = normalize(gl_TexCoord[2].xyz);
- float atten_7;
- atten_7 = ((float(
- (tmpvar_2.z > 0.0)
- ) * texture2D (_LightTexture0, (
- (tmpvar_2.xy / tmpvar_2.w)
- + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w);
- vec4 c_8;
- float spec_9;
- spec_9 = (pow (max (0.0,
- dot (tmpvar_1, normalize((tmpvar_6 + normalize(gl_TexCoord[3].xyz))))
- ), (_Shininess * 128.0)) * tmpvar_5.w);
- c_8.xyz = (((
- ((tmpvar_5 * _Color).xyz * _LightColor0.xyz)
- *
- max (0.0, dot (tmpvar_1, tmpvar_6))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_9)) * (atten_7 * 2.0));
- c_8.w = (((textureCube (_Cube, tmpvar_4) * tmpvar_5.w).w * _ReflectColor.w) + ((_LightColor0.w * _SpecColor.w) * (spec_9 * atten_7)));
- c_3.xyz = c_8.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 33 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// uniforms: 5 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _ReflectColor (high float) 4x1 [-1]
-// #3: _Shininess (high float) 1x1 [-1]
-// #4: _SpecColor (high float) 4x1 [-1]
-// textures: 4
-// #0: _Cube (high cube) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-in.txt
deleted file mode 100644
index e606336936e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-in.txt
+++ /dev/null
@@ -1,81 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform float _Shininess;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- vec4 reflcol;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Gloss = tex.w ;
- o.Specular = _Shininess;
- reflcol = textureCube( _Cube, IN.worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- vec4 res;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.normal = vec3( gl_TexCoord[0]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-out.txt
deleted file mode 100644
index 63f2c940aec..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular1-out.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-uniform float _Shininess;
-void main ()
-{
- vec4 res_1;
- res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = _Shininess;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Shininess (high float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-in.txt
deleted file mode 100644
index 6e4d5d03e9d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-in.txt
+++ /dev/null
@@ -1,105 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 worldRefl;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-uniform vec4 unity_Ambient;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- vec4 reflcol;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Gloss = tex.w ;
- o.Specular = _Shininess;
- reflcol = textureCube( _Cube, IN.worldRefl);
- reflcol *= tex.w ;
- o.Emission = (reflcol.xyz * _ReflectColor.xyz );
- o.Alpha = (reflcol.w * _ReflectColor.w );
-}
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light ) {
- float spec;
- vec4 c;
- spec = (light.w * s.Gloss);
- c.xyz = ((s.Albedo * light.xyz ) + ((light.xyz * _SpecColor.xyz ) * spec));
- c.w = (s.Alpha + (spec * _SpecColor.w ));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.worldRefl = IN.worldRefl;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingBlinnPhong_PrePass( o, light);
- col.xyz += o.Emission;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.worldRefl = vec3( gl_TexCoord[1]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-out.txt
deleted file mode 100644
index e0f894486fc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Reflective_Specular2-out.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-uniform vec4 _Color;
-uniform samplerCube _Cube;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _ReflectColor;
-uniform vec4 _SpecColor;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 col_1;
- vec4 light_2;
- vec4 reflcol_3;
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy);
- reflcol_3 = (textureCube (_Cube, gl_TexCoord[1].xyz) * tmpvar_4.w);
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2])));
- light_2.xyz = (light_2.xyz + unity_Ambient.xyz);
- vec4 c_5;
- float spec_6;
- spec_6 = (light_2.w * tmpvar_4.w);
- c_5.xyz = (((tmpvar_4 * _Color).xyz * light_2.xyz) + ((light_2.xyz * _SpecColor.xyz) * spec_6));
- c_5.w = ((reflcol_3.w * _ReflectColor.w) + (spec_6 * _SpecColor.w));
- col_1.w = c_5.w;
- col_1.xyz = (c_5.xyz + (reflcol_3.xyz * _ReflectColor.xyz));
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 15 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _ReflectColor (high float) 4x1 [-1]
-// #2: _SpecColor (high float) 4x1 [-1]
-// #3: unity_Ambient (high float) 4x1 [-1]
-// textures: 3
-// #0: _Cube (high cube) 0x0 [-1]
-// #1: _LightBuffer (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-in.txt
deleted file mode 100644
index 8beb53f7e79..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-in.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec2 texcoord;
-};
-uniform vec4 _Tint;
-uniform sampler2D _UpTex;
-vec4 skybox_frag( in v2f i, in sampler2D smp );
-vec4 frag( in v2f i );
-vec4 skybox_frag( in v2f i, in sampler2D smp ) {
- vec4 tex;
- vec4 col;
- tex = texture2D( smp, i.texcoord);
- col.xyz = ((tex.xyz + _Tint.xyz ) - 0.500000);
- col.w = (tex.w * _Tint.w );
- return col;
-}
-vec4 frag( in v2f i ) {
- return skybox_frag( i, _UpTex);
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-out.txt
deleted file mode 100644
index 6e773429cad..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox-out.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-uniform vec4 _Tint;
-uniform sampler2D _UpTex;
-void main ()
-{
- vec4 col_1;
- vec4 tmpvar_2;
- tmpvar_2 = texture2D (_UpTex, gl_TexCoord[0].xy);
- col_1.xyz = ((tmpvar_2.xyz + _Tint.xyz) - 0.5);
- col_1.w = (tmpvar_2.w * _Tint.w);
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 3 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Tint (high float) 4x1 [-1]
-// textures: 1
-// #0: _UpTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-in.txt
deleted file mode 100644
index 61e0d0e1c97..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-in.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec3 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec3 texcoord;
-};
-uniform samplerCube _Tex;
-uniform vec4 _Tint;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 tex;
- vec4 col;
- tex = textureCube( _Tex, i.texcoord);
- col.xyz = ((tex.xyz + _Tint.xyz ) - 0.500000);
- col.w = (tex.w * _Tint.w );
- return col;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.texcoord = vec3( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt
deleted file mode 100644
index de340c37b3d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-RenderFX_Skybox_Cubed-out.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-uniform samplerCube _Tex;
-uniform vec4 _Tint;
-void main ()
-{
- vec4 col_1;
- vec4 tmpvar_2;
- tmpvar_2 = textureCube (_Tex, gl_TexCoord[0].xyz);
- col_1.xyz = ((tmpvar_2.xyz + _Tint.xyz) - 0.5);
- col_1.w = (tmpvar_2.w * _Tint.w);
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 3 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Tint (high float) 4x1 [-1]
-// textures: 1
-// #0: _Tex (high cube) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-in.txt
deleted file mode 100644
index 39707292d4a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-in.txt
+++ /dev/null
@@ -1,100 +0,0 @@
-float xll_saturate_f( float x) {
- return clamp( x, 0.0, 1.0);
-}
-struct v2f_ao {
- vec4 pos;
- vec2 uv;
- vec2 uvr;
-};
-uniform vec4 _ProjectionParams;
-uniform vec2 _NoiseScale;
-uniform vec4 _CameraDepthNormalsTexture_ST;
-uniform sampler2D _CameraDepthNormalsTexture;
-uniform sampler2D _RandomTexture;
-uniform vec4 _Params;
-float DecodeFloatRG( in vec2 enc ) {
- vec2 kDecodeDot = vec2( 1.0, 0.00392157);
- return dot( enc, kDecodeDot);
-}
-vec3 DecodeViewNormalStereo( in vec4 enc4 ) {
- float kScale = 1.7777;
- vec3 nn = ((enc4.xyz * vec3( (2.0 * kScale), (2.0 * kScale), 0.0)) + vec3( (-kScale), (-kScale), 1.0));
- float g = (2.0 / dot( nn.xyz, nn.xyz));
- vec3 n;
- n.xy = (g * nn.xy);
- n.z = (g - 1.0);
- return n;
-}
-void DecodeDepthNormal( in vec4 enc, out float depth, out vec3 normal ) {
- depth = DecodeFloatRG( enc.zw);
- normal = DecodeViewNormalStereo( enc);
-}
-float frag_ao( in v2f_ao i, in int sampleCount, in vec3 samples[24] ) {
- vec3 randN = ((texture2D( _RandomTexture, i.uvr).xyz * 2.0) - 1.0);
- vec4 depthnormal = texture2D( _CameraDepthNormalsTexture, i.uv);
- vec3 viewNorm;
- float depth;
- DecodeDepthNormal( depthnormal, depth, viewNorm);
- depth *= _ProjectionParams.z;
- float scale = (_Params.x / depth);
- float occ = 0.0;
- int s = 0;
- for ( ; (s < sampleCount); (++s)) {
- vec3 randomDir = reflect( samples[s], randN);
- float flip = (( (dot( viewNorm, randomDir) < 0.0) ) ? ( 1.0 ) : ( -1.0 ));
- randomDir *= (-flip);
- randomDir += (viewNorm * 0.3);
- vec2 offset = (randomDir.xy * scale);
- float sD = (depth - (randomDir.z * _Params.x));
- vec4 sampleND = texture2D( _CameraDepthNormalsTexture, (i.uv + offset));
- float sampleD;
- vec3 sampleN;
- DecodeDepthNormal( sampleND, sampleD, sampleN);
- sampleD *= _ProjectionParams.z;
- float zd = xll_saturate_f((sD - sampleD));
- if ((zd > _Params.y)){
- occ += pow( (1.0 - zd), _Params.z);
- }
- }
- occ /= float(sampleCount);
- return (1.0 - occ);
-}
-vec4 frag( in v2f_ao i ) {
- vec3 RAND_SAMPLES[24];
- RAND_SAMPLES[0] = vec3( 0.0130572, 0.587232, -0.119337);
- RAND_SAMPLES[1] = vec3( 0.323078, 0.0220727, -0.418873);
- RAND_SAMPLES[2] = vec3( -0.310725, -0.191367, 0.0561369);
- RAND_SAMPLES[3] = vec3( -0.479646, 0.0939877, -0.580265);
- RAND_SAMPLES[4] = vec3( 0.139999, -0.33577, 0.559679);
- RAND_SAMPLES[5] = vec3( -0.248458, 0.255532, 0.348944);
- RAND_SAMPLES[6] = vec3( 0.18719, -0.702764, -0.231748);
- RAND_SAMPLES[7] = vec3( 0.884915, 0.284208, 0.368524);
- RAND_SAMPLES[8] = vec3( 0.0130572, 0.587232, -0.119337);
- RAND_SAMPLES[9] = vec3( 0.323078, 0.0220727, -0.418873);
- RAND_SAMPLES[10] = vec3( -0.310725, -0.191367, 0.0561369);
- RAND_SAMPLES[11] = vec3( -0.479646, 0.0939877, -0.580265);
- RAND_SAMPLES[12] = vec3( 0.139999, -0.33577, 0.559679);
- RAND_SAMPLES[13] = vec3( -0.248458, 0.255532, 0.348944);
- RAND_SAMPLES[14] = vec3( 0.18719, -0.702764, -0.231748);
- RAND_SAMPLES[15] = vec3( 0.884915, 0.284208, 0.368524);
- RAND_SAMPLES[16] = vec3( 0.0130572, 0.587232, -0.119337);
- RAND_SAMPLES[17] = vec3( 0.323078, 0.0220727, -0.418873);
- RAND_SAMPLES[18] = vec3( -0.310725, -0.191367, 0.0561369);
- RAND_SAMPLES[19] = vec3( -0.479646, 0.0939877, -0.580265);
- RAND_SAMPLES[20] = vec3( 0.139999, -0.33577, 0.559679);
- RAND_SAMPLES[21] = vec3( -0.248458, 0.255532, 0.348944);
- RAND_SAMPLES[22] = vec3( 0.18719, -0.702764, -0.231748);
- RAND_SAMPLES[23] = vec3( 0.884915, 0.284208, 0.368524);
- return vec4( frag_ao( i, 24, RAND_SAMPLES));
-}
-varying vec2 xlv_TEXCOORD0;
-varying vec2 xlv_TEXCOORD1;
-void main() {
- vec4 xl_retval;
- v2f_ao xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2(xlv_TEXCOORD0);
- xlt_i.uvr = vec2(xlv_TEXCOORD1);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4(xl_retval);
-} \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-inES3.txt
deleted file mode 100644
index ba5c35740c5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-inES3.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-#version 300 es
-#define gl_FragData _glesFragData
-layout(location = 0) out mediump vec4 _glesFragData[4];
-highp float xll_saturate_f( highp float x) {
- return clamp( x, 0.0, 1.0);
-}
-struct v2f_ao {
- highp vec4 pos;
- highp vec2 uv;
- highp vec2 uvr;
-};
-uniform highp vec4 _ProjectionParams;
-uniform highp vec2 _NoiseScale;
-uniform highp vec4 _CameraDepthNormalsTexture_ST;
-uniform highp sampler2D _CameraDepthNormalsTexture;
-uniform sampler2D _RandomTexture;
-uniform highp vec4 _Params;
-highp float DecodeFloatRG( in highp vec2 enc ) {
- highp vec2 kDecodeDot = vec2( 1.0, 0.00392157);
- return dot( enc, kDecodeDot);
-}
-highp vec3 DecodeViewNormalStereo( in highp vec4 enc4 ) {
- highp float kScale = 1.7777;
- highp vec3 nn = ((enc4.xyz * vec3( (2.0 * kScale), (2.0 * kScale), 0.0)) + vec3( (-kScale), (-kScale), 1.0));
- highp float g = (2.0 / dot( nn.xyz, nn.xyz));
- highp vec3 n;
- n.xy = (g * nn.xy);
- n.z = (g - 1.0);
- return n;
-}
-void DecodeDepthNormal( in highp vec4 enc, out highp float depth, out highp vec3 normal ) {
- depth = DecodeFloatRG( enc.zw);
- normal = DecodeViewNormalStereo( enc);
-}
-mediump float frag_ao( in v2f_ao i, in highp int sampleCount, in highp vec3 samples[8] ) {
- mediump vec3 randN = ((texture( _RandomTexture, i.uvr).xyz * 2.0) - 1.0);
- highp vec4 depthnormal = texture( _CameraDepthNormalsTexture, i.uv);
- highp vec3 viewNorm;
- highp float depth;
- DecodeDepthNormal( depthnormal, depth, viewNorm);
- depth *= _ProjectionParams.z;
- highp float scale = (_Params.x / depth);
- highp float occ = 0.0;
- highp int s = 0;
- for ( ; (s < sampleCount); (++s)) {
- mediump vec3 randomDir = reflect( samples[s], randN);
- mediump float flip = (( (dot( viewNorm, randomDir) < 0.0) ) ? ( 1.0 ) : ( -1.0 ));
- randomDir *= (-flip);
- randomDir += (viewNorm * 0.3);
- highp vec2 offset = (randomDir.xy * scale);
- highp float sD = (depth - (randomDir.z * _Params.x));
- highp vec4 sampleND = texture( _CameraDepthNormalsTexture, (i.uv + offset));
- highp float sampleD;
- highp vec3 sampleN;
- DecodeDepthNormal( sampleND, sampleD, sampleN);
- sampleD *= _ProjectionParams.z;
- highp float zd = xll_saturate_f((sD - sampleD));
- if ((zd > _Params.y)){
- occ += pow( (1.0 - zd), _Params.z);
- }
- }
- occ /= float(sampleCount);
- return (1.0 - occ);
-}
-mediump vec4 frag( in v2f_ao i ) {
- const highp vec3[8] RAND_SAMPLES = vec3[8]( vec3( 0.0130572, 0.587232, -0.119337), vec3( 0.323078, 0.0220727, -0.418873), vec3( -0.310725, -0.191367, 0.0561369), vec3( -0.479646, 0.0939877, -0.580265), vec3( 0.139999, -0.33577, 0.559679), vec3( -0.248458, 0.255532, 0.348944), vec3( 0.18719, -0.702764, -0.231748), vec3( 0.884915, 0.284208, 0.368524));
- return vec4( frag_ao( i, 8, RAND_SAMPLES));
-}
-in highp vec2 xlv_TEXCOORD0;
-in highp vec2 xlv_TEXCOORD1;
-void main() {
- mediump vec4 xl_retval;
- v2f_ao xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2(xlv_TEXCOORD0);
- xlt_i.uvr = vec2(xlv_TEXCOORD1);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4(xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-out.txt
deleted file mode 100644
index 0bff3c66046..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-out.txt
+++ /dev/null
@@ -1,100 +0,0 @@
-uniform vec4 _ProjectionParams;
-uniform sampler2D _CameraDepthNormalsTexture;
-uniform sampler2D _RandomTexture;
-uniform vec4 _Params;
-varying vec2 xlv_TEXCOORD0;
-varying vec2 xlv_TEXCOORD1;
-void main ()
-{
- vec3 RAND_SAMPLES_1[24];
- RAND_SAMPLES_1[0] = vec3(0.0130572, 0.587232, -0.119337);
- RAND_SAMPLES_1[1] = vec3(0.323078, 0.0220727, -0.418873);
- RAND_SAMPLES_1[2] = vec3(-0.310725, -0.191367, 0.0561369);
- RAND_SAMPLES_1[3] = vec3(-0.479646, 0.0939877, -0.580265);
- RAND_SAMPLES_1[4] = vec3(0.139999, -0.33577, 0.559679);
- RAND_SAMPLES_1[5] = vec3(-0.248458, 0.255532, 0.348944);
- RAND_SAMPLES_1[6] = vec3(0.18719, -0.702764, -0.231748);
- RAND_SAMPLES_1[7] = vec3(0.884915, 0.284208, 0.368524);
- RAND_SAMPLES_1[8] = vec3(0.0130572, 0.587232, -0.119337);
- RAND_SAMPLES_1[9] = vec3(0.323078, 0.0220727, -0.418873);
- RAND_SAMPLES_1[10] = vec3(-0.310725, -0.191367, 0.0561369);
- RAND_SAMPLES_1[11] = vec3(-0.479646, 0.0939877, -0.580265);
- RAND_SAMPLES_1[12] = vec3(0.139999, -0.33577, 0.559679);
- RAND_SAMPLES_1[13] = vec3(-0.248458, 0.255532, 0.348944);
- RAND_SAMPLES_1[14] = vec3(0.18719, -0.702764, -0.231748);
- RAND_SAMPLES_1[15] = vec3(0.884915, 0.284208, 0.368524);
- RAND_SAMPLES_1[16] = vec3(0.0130572, 0.587232, -0.119337);
- RAND_SAMPLES_1[17] = vec3(0.323078, 0.0220727, -0.418873);
- RAND_SAMPLES_1[18] = vec3(-0.310725, -0.191367, 0.0561369);
- RAND_SAMPLES_1[19] = vec3(-0.479646, 0.0939877, -0.580265);
- RAND_SAMPLES_1[20] = vec3(0.139999, -0.33577, 0.559679);
- RAND_SAMPLES_1[21] = vec3(-0.248458, 0.255532, 0.348944);
- RAND_SAMPLES_1[22] = vec3(0.18719, -0.702764, -0.231748);
- RAND_SAMPLES_1[23] = vec3(0.884915, 0.284208, 0.368524);
- vec2 tmpvar_2;
- tmpvar_2 = xlv_TEXCOORD0;
- vec3 samples_3[24];
- samples_3[0]=RAND_SAMPLES_1[0];samples_3[1]=RAND_SAMPLES_1[1];samples_3[2]=RAND_SAMPLES_1[2];samples_3[3]=RAND_SAMPLES_1[3];samples_3[4]=RAND_SAMPLES_1[4];samples_3[5]=RAND_SAMPLES_1[5];samples_3[6]=RAND_SAMPLES_1[6];samples_3[7]=RAND_SAMPLES_1[7];samples_3[8]=RAND_SAMPLES_1[8];samples_3[9]=RAND_SAMPLES_1[9];samples_3[10]=RAND_SAMPLES_1[10];samples_3[11]=RAND_SAMPLES_1[11];samples_3[12]=RAND_SAMPLES_1[12];samples_3[13]=RAND_SAMPLES_1[13];samples_3[14]=RAND_SAMPLES_1[14];samples_3[15]=RAND_SAMPLES_1[15];samples_3[16]=RAND_SAMPLES_1[16];samples_3[17]=RAND_SAMPLES_1[17];samples_3[18]=RAND_SAMPLES_1[18];samples_3[19]=RAND_SAMPLES_1[19];samples_3[20]=RAND_SAMPLES_1[20];samples_3[21]=RAND_SAMPLES_1[21];samples_3[22]=RAND_SAMPLES_1[22];samples_3[23]=RAND_SAMPLES_1[23];
- float occ_5;
- float scale_6;
- float depth_7;
- vec3 viewNorm_8;
- vec3 randN_9;
- randN_9 = ((texture2D (_RandomTexture, xlv_TEXCOORD1).xyz * 2.0) - 1.0);
- vec4 tmpvar_10;
- tmpvar_10 = texture2D (_CameraDepthNormalsTexture, xlv_TEXCOORD0);
- vec3 n_11;
- vec3 tmpvar_12;
- tmpvar_12 = ((tmpvar_10.xyz * vec3(3.5554, 3.5554, 0.0)) + vec3(-1.7777, -1.7777, 1.0));
- float tmpvar_13;
- tmpvar_13 = (2.0 / dot (tmpvar_12, tmpvar_12));
- n_11.xy = (tmpvar_13 * tmpvar_12.xy);
- n_11.z = (tmpvar_13 - 1.0);
- viewNorm_8 = n_11;
- depth_7 = (dot (tmpvar_10.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z);
- scale_6 = (_Params.x / depth_7);
- occ_5 = 0.0;
- for (int s_4 = 0; s_4 < 24; s_4++) {
- vec3 randomDir_14;
- vec3 tmpvar_15;
- vec3 I_16;
- I_16 = samples_3[s_4];
- tmpvar_15 = (I_16 - (2.0 * (
- dot (randN_9, I_16)
- * randN_9)));
- randomDir_14 = tmpvar_15;
- float tmpvar_17;
- tmpvar_17 = dot (viewNorm_8, tmpvar_15);
- float tmpvar_18;
- if ((tmpvar_17 < 0.0)) {
- tmpvar_18 = 1.0;
- } else {
- tmpvar_18 = -1.0;
- };
- randomDir_14 = (tmpvar_15 * -(tmpvar_18));
- randomDir_14 = (randomDir_14 + (viewNorm_8 * 0.3));
- float tmpvar_19;
- tmpvar_19 = clamp (((depth_7 -
- (randomDir_14.z * _Params.x)
- ) - (
- dot (texture2D (_CameraDepthNormalsTexture, (tmpvar_2 + (randomDir_14.xy * scale_6))).zw, vec2(1.0, 0.00392157))
- * _ProjectionParams.z)), 0.0, 1.0);
- if ((tmpvar_19 > _Params.y)) {
- occ_5 = (occ_5 + pow ((1.0 - tmpvar_19), _Params.z));
- };
- };
- occ_5 = (occ_5 / 24.0);
- gl_FragData[0] = vec4((1.0 - occ_5));
-}
-
-
-// stats: 65 alu 3 tex 4 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 2x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: _ProjectionParams (high float) 4x1 [-1]
-// #1: _Params (high float) 4x1 [-1]
-// textures: 2
-// #0: _CameraDepthNormalsTexture (high 2d) 0x0 [-1]
-// #1: _RandomTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt
deleted file mode 100644
index 8ba9f361fe6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-#version 300 es
-layout(location=0) out mediump vec4 _glesFragData[4];
-uniform highp vec4 _ProjectionParams;
-uniform highp sampler2D _CameraDepthNormalsTexture;
-uniform sampler2D _RandomTexture;
-uniform highp vec4 _Params;
-in highp vec2 xlv_TEXCOORD0;
-in highp vec2 xlv_TEXCOORD1;
-void main ()
-{
- mediump float tmpvar_1;
- highp vec2 tmpvar_2;
- tmpvar_2 = xlv_TEXCOORD0;
- highp float occ_4;
- highp float scale_5;
- highp float depth_6;
- highp vec3 viewNorm_7;
- mediump vec3 randN_8;
- lowp vec3 tmpvar_9;
- tmpvar_9 = ((texture (_RandomTexture, xlv_TEXCOORD1).xyz * 2.0) - 1.0);
- randN_8 = tmpvar_9;
- highp vec4 tmpvar_10;
- tmpvar_10 = texture (_CameraDepthNormalsTexture, xlv_TEXCOORD0);
- highp vec3 n_11;
- highp vec3 tmpvar_12;
- tmpvar_12 = ((tmpvar_10.xyz * vec3(3.5554, 3.5554, 0.0)) + vec3(-1.7777, -1.7777, 1.0));
- highp float tmpvar_13;
- tmpvar_13 = (2.0 / dot (tmpvar_12, tmpvar_12));
- n_11.xy = (tmpvar_13 * tmpvar_12.xy);
- n_11.z = (tmpvar_13 - 1.0);
- viewNorm_7 = n_11;
- depth_6 = (dot (tmpvar_10.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z);
- scale_5 = (_Params.x / depth_6);
- occ_4 = 0.0;
- for (highp int s_3 = 0; s_3 < 8; s_3++) {
- mediump vec3 randomDir_14;
- highp vec3 tmpvar_15;
- highp vec3 I_16;
- I_16 = vec3[8](vec3(0.0130572, 0.587232, -0.119337), vec3(0.323078, 0.0220727, -0.418873), vec3(-0.310725, -0.191367, 0.0561369), vec3(-0.479646, 0.0939877, -0.580265), vec3(0.139999, -0.33577, 0.559679), vec3(-0.248458, 0.255532, 0.348944), vec3(0.18719, -0.702764, -0.231748), vec3(0.884915, 0.284208, 0.368524))[s_3];
- tmpvar_15 = (I_16 - (2.0 * (
- dot (randN_8, I_16)
- * randN_8)));
- randomDir_14 = tmpvar_15;
- highp float tmpvar_17;
- tmpvar_17 = dot (viewNorm_7, randomDir_14);
- mediump float tmpvar_18;
- if ((tmpvar_17 < 0.0)) {
- tmpvar_18 = 1.0;
- } else {
- tmpvar_18 = -1.0;
- };
- randomDir_14 = (randomDir_14 * -(tmpvar_18));
- randomDir_14 = (randomDir_14 + (viewNorm_7 * 0.3));
- highp float tmpvar_19;
- tmpvar_19 = clamp (((depth_6 -
- (randomDir_14.z * _Params.x)
- ) - (
- dot (texture (_CameraDepthNormalsTexture, (tmpvar_2 + (randomDir_14.xy * scale_5))).zw, vec2(1.0, 0.00392157))
- * _ProjectionParams.z)), 0.0, 1.0);
- if ((tmpvar_19 > _Params.y)) {
- occ_4 = (occ_4 + pow ((1.0 - tmpvar_19), _Params.z));
- };
- };
- occ_4 = (occ_4 / 8.0);
- tmpvar_1 = (1.0 - occ_4);
- _glesFragData[0] = vec4(tmpvar_1);
-}
-
-
-// stats: 41 alu 3 tex 4 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 2x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: _ProjectionParams (high float) 4x1 [-1]
-// #1: _Params (high float) 4x1 [-1]
-// textures: 2
-// #0: _CameraDepthNormalsTexture (high 2d) 0x0 [-1]
-// #1: _RandomTexture (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt
deleted file mode 100644
index add23da4e43..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO24-outES3Metal.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-constant float3 _xlat_mtl_const1[8] = {float3(0.0130572, 0.587232, -0.119337), float3(0.323078, 0.0220727, -0.418873), float3(-0.310725, -0.191367, 0.0561369), float3(-0.479646, 0.0939877, -0.580265), float3(0.139999, -0.33577, 0.559679), float3(-0.248458, 0.255532, 0.348944), float3(0.18719, -0.702764, -0.231748), float3(0.884915, 0.284208, 0.368524)};
-struct xlatMtlShaderInput {
- float2 xlv_TEXCOORD0;
- float2 xlv_TEXCOORD1;
-};
-struct xlatMtlShaderOutput {
- half4 _glesFragData_0 [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- float4 _ProjectionParams;
- float4 _Params;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<float> _CameraDepthNormalsTexture [[texture(0)]], sampler _mtlsmp__CameraDepthNormalsTexture [[sampler(0)]]
- , texture2d<half> _RandomTexture [[texture(1)]], sampler _mtlsmp__RandomTexture [[sampler(1)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half tmpvar_1 = 0;
- float2 tmpvar_2 = 0;
- tmpvar_2 = _mtl_i.xlv_TEXCOORD0;
- float occ_4 = 0;
- float scale_5 = 0;
- float depth_6 = 0;
- float3 viewNorm_7 = 0;
- half3 randN_8 = 0;
- half3 tmpvar_9 = 0;
- tmpvar_9 = ((_RandomTexture.sample(_mtlsmp__RandomTexture, (float2)(_mtl_i.xlv_TEXCOORD1)).xyz * (half)(2.0)) - (half)(1.0));
- randN_8 = tmpvar_9;
- float4 tmpvar_10 = 0;
- tmpvar_10 = _CameraDepthNormalsTexture.sample(_mtlsmp__CameraDepthNormalsTexture, (float2)(_mtl_i.xlv_TEXCOORD0));
- float3 n_11 = 0;
- float3 tmpvar_12 = 0;
- tmpvar_12 = ((tmpvar_10.xyz * float3(3.5554, 3.5554, 0.0)) + float3(-1.7777, -1.7777, 1.0));
- float tmpvar_13 = 0;
- tmpvar_13 = (2.0 / dot (tmpvar_12, tmpvar_12));
- n_11.xy = (tmpvar_13 * tmpvar_12.xy);
- n_11.z = (tmpvar_13 - 1.0);
- viewNorm_7 = n_11;
- depth_6 = (dot (tmpvar_10.zw, float2(1.0, 0.00392157)) * _mtl_u._ProjectionParams.z);
- scale_5 = (_mtl_u._Params.x / depth_6);
- occ_4 = 0.0;
- for (int s_3 = 0; s_3 < 8; s_3++) {
- half3 randomDir_14 = 0;
- float3 tmpvar_15 = 0;
- float3 I_16 = 0;
- I_16 = _xlat_mtl_const1[s_3];
- tmpvar_15 = (I_16 - (float3)(((half)(2.0) * ((half3)(
- dot ((float3)randN_8, I_16)
- * (float3)(randN_8))))));
- randomDir_14 = half3(tmpvar_15);
- float tmpvar_17 = 0;
- tmpvar_17 = dot (viewNorm_7, (float3)randomDir_14);
- half tmpvar_18 = 0;
- if ((tmpvar_17 < 0.0)) {
- tmpvar_18 = half(1.0);
- } else {
- tmpvar_18 = half(-1.0);
- };
- randomDir_14 = (randomDir_14 * -(tmpvar_18));
- randomDir_14 = half3(((float3)(randomDir_14) + (viewNorm_7 * 0.3)));
- float tmpvar_19 = 0;
- tmpvar_19 = clamp (((depth_6 -
- ((float)(randomDir_14.z) * _mtl_u._Params.x)
- ) - (
- dot (_CameraDepthNormalsTexture.sample(_mtlsmp__CameraDepthNormalsTexture, (float2)((tmpvar_2 + ((float2)(randomDir_14.xy) * scale_5)))).zw, float2(1.0, 0.00392157))
- * _mtl_u._ProjectionParams.z)), 0.0, 1.0);
- if ((tmpvar_19 > _mtl_u._Params.y)) {
- occ_4 = (occ_4 + pow ((1.0 - tmpvar_19), _mtl_u._Params.z));
- };
- };
- occ_4 = (occ_4 / 8.0);
- tmpvar_1 = half((1.0 - occ_4));
- _mtl_o._glesFragData_0 = half4(tmpvar_1);
- return _mtl_o;
-}
-
-
-// stats: 41 alu 3 tex 4 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 2x1 [-1]
-// uniforms: 2 (total size: 32)
-// #0: _ProjectionParams (high float) 4x1 [-1] loc 0
-// #1: _Params (high float) 4x1 [-1] loc 16
-// textures: 2
-// #0: _CameraDepthNormalsTexture (high 2d) 0x0 [-1] loc 0
-// #1: _RandomTexture (low 2d) 0x0 [-1] loc 1
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-inES.txt
deleted file mode 100644
index 2d51f984256..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-inES.txt
+++ /dev/null
@@ -1,131 +0,0 @@
-float xll_saturate_f( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate_vf2( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate_vf3( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate_vf4( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate_mf2x2(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate_mf3x3(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate_mf4x4(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-#line 4
-struct v2f_ao {
- highp vec4 pos;
- highp vec2 uv;
- highp vec2 uvr;
-};
-#line 10
-uniform sampler2D _CameraDepthNormalsTexture;
-uniform sampler2D _RandomTexture;
-uniform highp vec4 _Params;
-uniform highp vec4 _ProjectionParams;
-#line 15
-#line 36
-#line 83
-#line 25
-highp float DecodeFloatRG( in highp vec2 enc ) {
- #line 27
- highp vec2 kDecodeDot = vec2( 1.0, 0.00392157);
- return dot( enc, kDecodeDot);
-}
-#line 15
-highp vec3 DecodeViewNormalStereo( in highp vec4 enc4 ) {
- highp float kScale = 1.7777;
- highp vec3 nn = ((enc4.xyz * vec3( (2.0 * kScale), (2.0 * kScale), 0.0)) + vec3( (-kScale), (-kScale), 1.0));
- #line 19
- highp float g = (2.0 / dot( nn.xyz, nn.xyz));
- highp vec3 n;
- n.xy = (g * nn.xy);
- n.z = (g - 1.0);
- #line 23
- return n;
-}
-#line 30
-void DecodeDepthNormal( in highp vec4 enc, out highp float depth, out highp vec3 normal ) {
- #line 32
- depth = DecodeFloatRG( enc.zw);
- normal = DecodeViewNormalStereo( enc);
-}
-#line 36
-mediump float frag_ao( in v2f_ao i, in highp int sampleCount, in highp vec3 samples[8] ) {
- mediump vec3 randN = ((texture2D( _RandomTexture, i.uvr).xyz * 2.0) - 1.0);
- #line 42
- highp vec4 depthnormal = texture2D( _CameraDepthNormalsTexture, i.uv);
- highp vec3 viewNorm;
- highp float depth;
- DecodeDepthNormal( depthnormal, depth, viewNorm);
- #line 46
- depth *= _ProjectionParams.z;
- highp float scale = (_Params.x / depth);
- #line 50
- highp float occ = 0.0;
- highp int s = 0;
- for ( ; (s < sampleCount); (++s)) {
- #line 54
- mediump vec3 randomDir = reflect( samples[s], randN);
- mediump float flip = (( (dot( viewNorm, randomDir) < 0.0) ) ? ( 1.0 ) : ( -1.0 ));
- #line 58
- randomDir *= (-flip);
- randomDir += (viewNorm * 0.3);
- #line 62
- highp vec2 offset = (randomDir.xy * scale);
- highp float sD = (depth - (randomDir.z * _Params.x));
- #line 66
- highp vec4 sampleND = texture2D( _CameraDepthNormalsTexture, (i.uv + offset));
- highp float sampleD;
- highp vec3 sampleN;
- DecodeDepthNormal( sampleND, sampleD, sampleN);
- #line 70
- sampleD *= _ProjectionParams.z;
- highp float zd = xll_saturate_f((sD - sampleD));
- if ((zd > _Params.y)){
- #line 74
- occ += pow( (1.0 - zd), _Params.z);
- }
- }
- #line 79
- occ /= float(sampleCount);
- return (1.0 - occ);
-}
-#line 83
-mediump vec4 xlat_main( in v2f_ao i ) {
- highp vec3 RAND_SAMPLES[8];
- RAND_SAMPLES[0] = vec3( 0.0130572, 0.587232, -0.119337);
- RAND_SAMPLES[1] = vec3( 0.323078, 0.0220727, -0.418873);
- RAND_SAMPLES[2] = vec3( -0.310725, -0.191367, 0.0561369);
- RAND_SAMPLES[3] = vec3( -0.479646, 0.0939877, -0.580265);
- RAND_SAMPLES[4] = vec3( 0.139999, -0.33577, 0.559679);
- RAND_SAMPLES[5] = vec3( -0.248458, 0.255532, 0.348944);
- RAND_SAMPLES[6] = vec3( 0.18719, -0.702764, -0.231748);
- RAND_SAMPLES[7] = vec3( 0.884915, 0.284208, 0.368524);
- #line 95
- return vec4( frag_ao( i, 8, RAND_SAMPLES));
-}
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec2 xlv_TEXCOORD1;
-void main() {
- mediump vec4 xl_retval;
- v2f_ao xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2(xlv_TEXCOORD0);
- xlt_i.uvr = vec2(xlv_TEXCOORD1);
- xl_retval = xlat_main( xlt_i);
- gl_FragData[0] = vec4(xl_retval);
-}
-
-// uniforms:
-// _CameraDepthNormalsTexture:<none> type 25 arrsize 0
-// _Params:<none> type 12 arrsize 0
-// _ProjectionParams:<none> type 12 arrsize 0
-// _RandomTexture:<none> type 25 arrsize 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt
deleted file mode 100644
index 431cd9498eb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-SSAO8-outES.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-uniform sampler2D _CameraDepthNormalsTexture;
-uniform sampler2D _RandomTexture;
-uniform highp vec4 _Params;
-uniform highp vec4 _ProjectionParams;
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec2 xlv_TEXCOORD1;
-void main ()
-{
- highp vec3 RAND_SAMPLES_1[8];
- RAND_SAMPLES_1[0] = vec3(0.0130572, 0.587232, -0.119337);
- RAND_SAMPLES_1[1] = vec3(0.323078, 0.0220727, -0.418873);
- RAND_SAMPLES_1[2] = vec3(-0.310725, -0.191367, 0.0561369);
- RAND_SAMPLES_1[3] = vec3(-0.479646, 0.0939877, -0.580265);
- RAND_SAMPLES_1[4] = vec3(0.139999, -0.33577, 0.559679);
- RAND_SAMPLES_1[5] = vec3(-0.248458, 0.255532, 0.348944);
- RAND_SAMPLES_1[6] = vec3(0.18719, -0.702764, -0.231748);
- RAND_SAMPLES_1[7] = vec3(0.884915, 0.284208, 0.368524);
- mediump float tmpvar_2;
- highp vec2 tmpvar_3;
- tmpvar_3 = xlv_TEXCOORD0;
- highp vec3 samples_4[8];
- samples_4[0]=RAND_SAMPLES_1[0];samples_4[1]=RAND_SAMPLES_1[1];samples_4[2]=RAND_SAMPLES_1[2];samples_4[3]=RAND_SAMPLES_1[3];samples_4[4]=RAND_SAMPLES_1[4];samples_4[5]=RAND_SAMPLES_1[5];samples_4[6]=RAND_SAMPLES_1[6];samples_4[7]=RAND_SAMPLES_1[7];
- highp float occ_6;
- highp float scale_7;
- highp float depth_8;
- highp vec3 viewNorm_9;
- highp vec4 depthnormal_10;
- mediump vec3 randN_11;
- lowp vec3 tmpvar_12;
- tmpvar_12 = ((texture2D (_RandomTexture, xlv_TEXCOORD1).xyz * 2.0) - 1.0);
- randN_11 = tmpvar_12;
- lowp vec4 tmpvar_13;
- tmpvar_13 = texture2D (_CameraDepthNormalsTexture, xlv_TEXCOORD0);
- depthnormal_10 = tmpvar_13;
- highp vec3 n_14;
- highp vec3 tmpvar_15;
- tmpvar_15 = ((depthnormal_10.xyz * vec3(3.5554, 3.5554, 0.0)) + vec3(-1.7777, -1.7777, 1.0));
- highp float tmpvar_16;
- tmpvar_16 = (2.0 / dot (tmpvar_15, tmpvar_15));
- n_14.xy = (tmpvar_16 * tmpvar_15.xy);
- n_14.z = (tmpvar_16 - 1.0);
- viewNorm_9 = n_14;
- depth_8 = (dot (depthnormal_10.zw, vec2(1.0, 0.00392157)) * _ProjectionParams.z);
- scale_7 = (_Params.x / depth_8);
- occ_6 = 0.0;
- for (highp int s_5 = 0; s_5 < 8; s_5++) {
- highp vec4 sampleND_17;
- mediump vec3 randomDir_18;
- highp vec3 tmpvar_19;
- highp vec3 I_20;
- I_20 = samples_4[s_5];
- tmpvar_19 = (I_20 - (2.0 * (
- dot (randN_11, I_20)
- * randN_11)));
- randomDir_18 = tmpvar_19;
- highp float tmpvar_21;
- tmpvar_21 = dot (viewNorm_9, randomDir_18);
- mediump float tmpvar_22;
- if ((tmpvar_21 < 0.0)) {
- tmpvar_22 = 1.0;
- } else {
- tmpvar_22 = -1.0;
- };
- randomDir_18 = (randomDir_18 * -(tmpvar_22));
- randomDir_18 = (randomDir_18 + (viewNorm_9 * 0.3));
- lowp vec4 tmpvar_23;
- highp vec2 P_24;
- P_24 = (tmpvar_3 + (randomDir_18.xy * scale_7));
- tmpvar_23 = texture2D (_CameraDepthNormalsTexture, P_24);
- sampleND_17 = tmpvar_23;
- highp float tmpvar_25;
- tmpvar_25 = clamp (((depth_8 -
- (randomDir_18.z * _Params.x)
- ) - (
- dot (sampleND_17.zw, vec2(1.0, 0.00392157))
- * _ProjectionParams.z)), 0.0, 1.0);
- if ((tmpvar_25 > _Params.y)) {
- occ_6 = (occ_6 + pow ((1.0 - tmpvar_25), _Params.z));
- };
- };
- occ_6 = (occ_6 / 8.0);
- tmpvar_2 = (1.0 - occ_6);
- gl_FragData[0] = vec4(tmpvar_2);
-}
-
-
-// stats: 49 alu 3 tex 4 flow
-// inputs: 2
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// #1: xlv_TEXCOORD1 (high float) 2x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: _Params (high float) 4x1 [-1]
-// #1: _ProjectionParams (high float) 4x1 [-1]
-// textures: 2
-// #0: _CameraDepthNormalsTexture (low 2d) 0x0 [-1]
-// #1: _RandomTexture (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-in.txt
deleted file mode 100644
index d22a81b7d6b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-in.txt
+++ /dev/null
@@ -1,115 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-out.txt
deleted file mode 100644
index 1a8b2f847f5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse-out.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[2];
- vec4 c_3;
- vec4 c_4;
- c_4 = (texture2D (_MainTex, tmpvar_1.xy) * _Color);
- vec4 normal_5;
- normal_5.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_5.z = sqrt(((1.0 -
- (normal_5.x * normal_5.x)
- ) - (normal_5.y * normal_5.y)));
- vec4 c_6;
- c_6.xyz = ((c_4.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (normal_5.xyz, normalize(gl_TexCoord[1].xyz)))
- *
- ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)
- ) * 2.0));
- c_6.w = c_4.w;
- c_3.xyz = c_6.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 23 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 4
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-in.txt
deleted file mode 100644
index b9b2afc2837..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-in.txt
+++ /dev/null
@@ -1,95 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- vec2 hip_pack0;
- vec3 TtoV0;
- vec3 TtoV1;
- vec3 TtoV2;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform sampler2D _MainTex;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 viewN;
- vec4 res;
- surfIN.uv_BumpMap = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- viewN.x = dot( IN.TtoV0, o.Normal);
- viewN.y = dot( IN.TtoV1, o.Normal);
- viewN.z = dot( IN.TtoV2, o.Normal);
- o.Normal = viewN;
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.TtoV0 = vec3( gl_TexCoord[1]);
- xlt_IN.TtoV1 = vec3( gl_TexCoord[2]);
- xlt_IN.TtoV2 = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt
deleted file mode 100644
index bf03f0203e9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse1-out.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-uniform sampler2D _BumpMap;
-void main ()
-{
- vec4 res_1;
- vec3 viewN_2;
- vec4 normal_3;
- normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0);
- normal_3.z = sqrt(((1.0 -
- (normal_3.x * normal_3.x)
- ) - (normal_3.y * normal_3.y)));
- viewN_2.x = dot (gl_TexCoord[1].xyz, normal_3.xyz);
- viewN_2.y = dot (gl_TexCoord[2].xyz, normal_3.xyz);
- viewN_2.z = dot (gl_TexCoord[3].xyz, normal_3.xyz);
- res_1.xyz = ((viewN_2 * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = 0.0;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 13 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// textures: 1
-// #0: _BumpMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-in.txt
deleted file mode 100644
index 9ab13c1db52..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-in.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_Illum = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- col.xyz += o.Emission;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-out.txt
deleted file mode 100644
index 6561ac56a5e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Diffuse2-out.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 col_2;
- vec4 light_3;
- vec4 c_4;
- c_4 = (texture2D (_MainTex, tmpvar_1.xy) * _Color);
- light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_3.xyz = (light_3.xyz + unity_Ambient.xyz);
- vec4 c_5;
- c_5.xyz = (c_4.xyz * light_3.xyz);
- c_5.w = c_4.w;
- col_2.w = c_5.w;
- col_2.xyz = (c_5.xyz + (c_4.xyz * texture2D (_Illum, tmpvar_1.zw).w));
- gl_FragData[0] = col_2;
-}
-
-
-// stats: 7 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: unity_Ambient (high float) 4x1 [-1]
-// textures: 3
-// #0: _Illum (high 2d) 0x0 [-1]
-// #1: _LightBuffer (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-in.txt
deleted file mode 100644
index b1542ffac31..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-in.txt
+++ /dev/null
@@ -1,98 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- vec2 hip_pack0;
- vec3 TtoV0;
- vec3 TtoV1;
- vec3 TtoV2;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Gloss = tex.w ;
- o.Alpha = c.w ;
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 viewN;
- vec4 res;
- surfIN.uv_BumpMap = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- viewN.x = dot( IN.TtoV0, o.Normal);
- viewN.y = dot( IN.TtoV1, o.Normal);
- viewN.z = dot( IN.TtoV2, o.Normal);
- o.Normal = viewN;
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.TtoV0 = vec3( gl_TexCoord[1]);
- xlt_IN.TtoV1 = vec3( gl_TexCoord[2]);
- xlt_IN.TtoV2 = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-out.txt
deleted file mode 100644
index 0d855bd4672..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular-out.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform float _Shininess;
-void main ()
-{
- vec4 res_1;
- vec3 viewN_2;
- vec4 normal_3;
- normal_3.xy = ((texture2D (_BumpMap, gl_TexCoord[0].xy).wy * 2.0) - 1.0);
- normal_3.z = sqrt(((1.0 -
- (normal_3.x * normal_3.x)
- ) - (normal_3.y * normal_3.y)));
- viewN_2.x = dot (gl_TexCoord[1].xyz, normal_3.xyz);
- viewN_2.y = dot (gl_TexCoord[2].xyz, normal_3.xyz);
- viewN_2.z = dot (gl_TexCoord[3].xyz, normal_3.xyz);
- res_1.xyz = ((viewN_2 * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = _Shininess;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 12 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Shininess (high float) 1x1 [-1]
-// textures: 1
-// #0: _BumpMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-in.txt
deleted file mode 100644
index 576a23ac76b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-in.txt
+++ /dev/null
@@ -1,109 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-uniform vec4 unity_Ambient;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Gloss = tex.w ;
- o.Alpha = c.w ;
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light ) {
- float spec;
- vec4 c;
- spec = (light.w * s.Gloss);
- c.xyz = ((s.Albedo * light.xyz ) + ((light.xyz * _SpecColor.xyz ) * spec));
- c.w = (s.Alpha + (spec * _SpecColor.w ));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_Illum = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingBlinnPhong_PrePass( o, light);
- col.xyz += o.Emission;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-out.txt
deleted file mode 100644
index 6a2670957da..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Bumped_Specular1-out.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _SpecColor;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 col_2;
- vec4 light_3;
- vec4 c_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, tmpvar_1.xy);
- c_4 = (tmpvar_5 * _Color);
- light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_3.xyz = (light_3.xyz + unity_Ambient.xyz);
- vec4 c_6;
- float spec_7;
- spec_7 = (light_3.w * tmpvar_5.w);
- c_6.xyz = ((c_4.xyz * light_3.xyz) + ((light_3.xyz * _SpecColor.xyz) * spec_7));
- c_6.w = (c_4.w + (spec_7 * _SpecColor.w));
- col_2.w = c_6.w;
- col_2.xyz = (c_6.xyz + (c_4.xyz * texture2D (_Illum, tmpvar_1.zw).w));
- gl_FragData[0] = col_2;
-}
-
-
-// stats: 13 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _SpecColor (high float) 4x1 [-1]
-// #2: unity_Ambient (high float) 4x1 [-1]
-// textures: 3
-// #0: _Illum (high 2d) 0x0 [-1]
-// #1: _LightBuffer (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-in.txt
deleted file mode 100644
index 3e3bb132e25..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-in.txt
+++ /dev/null
@@ -1,97 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Alpha = c.w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingLambert( o, lightDir, (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec2( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-out.txt
deleted file mode 100644
index 5f001ce83a2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-out.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 c_1;
- vec4 c_2;
- c_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
- vec4 c_3;
- c_3.xyz = ((c_2.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz))
- * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0));
- c_3.w = c_2.w;
- c_1.xyz = c_3.xyz;
- c_1.w = 0.0;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 8 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-in.txt
deleted file mode 100644
index 5d3ca86c2d2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-in.txt
+++ /dev/null
@@ -1,127 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Alpha = c.w ;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_Illum = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingLambert_PrePass( o, light);
- col.xyz += o.Emission;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-out.txt
deleted file mode 100644
index 7193ecbcc38..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse1-out.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[2].xyz;
- vec4 col_3;
- vec4 light_4;
- vec4 c_5;
- c_5 = (texture2D (_MainTex, tmpvar_1.xy) * _Color);
- light_4 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_4.xyz = (light_4.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_2.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_2.xy).xyz), vec3(clamp (tmpvar_2.z, 0.0, 1.0))));
- vec4 c_6;
- c_6.xyz = (c_5.xyz * light_4.xyz);
- c_6.w = c_5.w;
- col_3.w = c_6.w;
- col_3.xyz = (c_6.xyz + (c_5.xyz * texture2D (_Illum, tmpvar_1.zw).w));
- gl_FragData[0] = col_3;
-}
-
-
-// stats: 11 alu 5 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// textures: 5
-// #0: _Illum (high 2d) 0x0 [-1]
-// #1: _LightBuffer (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
-// #3: unity_Lightmap (high 2d) 0x0 [-1]
-// #4: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-in.txt
deleted file mode 100644
index d556f4e7b62..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-in.txt
+++ /dev/null
@@ -1,134 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec2 uv_Illum;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-vec4 UnpackNormal( in vec4 packednormal );
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
- vec3 v;
- h = ((h * height) - (height / 2.00000));
- v = normalize( viewDir );
- v.z += 0.420000;
- return (h * (v.xy / v.z ));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float h;
- vec2 offset;
- vec4 c;
- h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
- offset = ParallaxOffset( h, _Parallax, IN.viewDir);
- IN.uv_MainTex += offset;
- IN.uv_BumpMap += offset;
- IN.uv_Illum += offset;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-out.txt
deleted file mode 100644
index 13a1b227234..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse-out.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[3];
- vec4 c_3;
- vec4 c_4;
- vec2 tmpvar_5;
- vec3 v_6;
- vec3 tmpvar_7;
- tmpvar_7 = normalize(gl_TexCoord[1].xyz);
- v_6.xy = tmpvar_7.xy;
- v_6.z = (tmpvar_7.z + 0.42);
- tmpvar_5 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_7.xy / v_6.z));
- c_4 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_5)) * _Color);
- vec4 normal_8;
- normal_8.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_5)).wy * 2.0) - 1.0);
- normal_8.z = sqrt(((1.0 -
- (normal_8.x * normal_8.x)
- ) - (normal_8.y * normal_8.y)));
- vec4 c_9;
- c_9.xyz = ((c_4.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (normal_8.xyz, normalize(gl_TexCoord[2].xyz)))
- *
- ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)
- ) * 2.0));
- c_9.w = c_4.w;
- c_3.xyz = c_9.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 32 alu 5 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Parallax (high float) 1x1 [-1]
-// textures: 5
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
-// #4: _ParallaxMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-in.txt
deleted file mode 100644
index b3efee054b1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-in.txt
+++ /dev/null
@@ -1,124 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec2 uv_Illum;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-vec4 UnpackNormal( in vec4 packednormal );
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
- vec3 v;
- h = ((h * height) - (height / 2.00000));
- v = normalize( viewDir );
- v.z += 0.420000;
- return (h * (v.xy / v.z ));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float h;
- vec2 offset;
- vec4 c;
- h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
- offset = ParallaxOffset( h, _Parallax, IN.viewDir);
- IN.uv_MainTex += offset;
- IN.uv_BumpMap += offset;
- IN.uv_Illum += offset;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingLambert( o, lightDir, (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec2( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-out.txt
deleted file mode 100644
index c8fa7f18856..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse1-out.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 c_2;
- vec4 c_3;
- vec2 tmpvar_4;
- vec3 v_5;
- vec3 tmpvar_6;
- tmpvar_6 = normalize(gl_TexCoord[1].xyz);
- v_5.xy = tmpvar_6.xy;
- v_5.z = (tmpvar_6.z + 0.42);
- tmpvar_4 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_6.xy / v_5.z));
- c_3 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_4)) * _Color);
- vec4 normal_7;
- normal_7.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_4)).wy * 2.0) - 1.0);
- normal_7.z = sqrt(((1.0 -
- (normal_7.x * normal_7.x)
- ) - (normal_7.y * normal_7.y)));
- vec4 c_8;
- c_8.xyz = ((c_3.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (normal_7.xyz, gl_TexCoord[2].xyz))
- * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0));
- c_8.w = c_3.w;
- c_2.xyz = c_8.xyz;
- c_2.w = 0.0;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 24 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Parallax (high float) 1x1 [-1]
-// textures: 4
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
-// #3: _ParallaxMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-in.txt
deleted file mode 100644
index 0d08c5a73f8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-in.txt
+++ /dev/null
@@ -1,125 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec2 uv_Illum;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec2 hip_pack1;
- vec3 viewDir;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform vec4 unity_Ambient;
-vec4 UnpackNormal( in vec4 packednormal );
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
- vec3 v;
- h = ((h * height) - (height / 2.00000));
- v = normalize( viewDir );
- v.z += 0.420000;
- return (h * (v.xy / v.z ));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float h;
- vec2 offset;
- vec4 c;
- h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
- offset = ParallaxOffset( h, _Parallax, IN.viewDir);
- IN.uv_MainTex += offset;
- IN.uv_BumpMap += offset;
- IN.uv_Illum += offset;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.uv_Illum = IN.hip_pack1.xy ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- col.xyz += o.Emission;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_pack1 = vec2( gl_TexCoord[1]);
- xlt_IN.viewDir = vec3( gl_TexCoord[2]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-out.txt
deleted file mode 100644
index 31ad181a488..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Diffuse2-out.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 col_2;
- vec4 light_3;
- vec4 c_4;
- vec2 tmpvar_5;
- vec3 v_6;
- vec3 tmpvar_7;
- tmpvar_7 = normalize(gl_TexCoord[2].xyz);
- v_6.xy = tmpvar_7.xy;
- v_6.z = (tmpvar_7.z + 0.42);
- tmpvar_5 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_7.xy / v_6.z));
- c_4 = (texture2D (_MainTex, (tmpvar_1.xy + tmpvar_5)) * _Color);
- light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[3])));
- light_3.xyz = (light_3.xyz + unity_Ambient.xyz);
- vec4 c_8;
- c_8.xyz = (c_4.xyz * light_3.xyz);
- c_8.w = c_4.w;
- col_2.w = c_8.w;
- col_2.xyz = (c_8.xyz + (c_4.xyz * texture2D (_Illum, (gl_TexCoord[1].xy + tmpvar_5)).w));
- gl_FragData[0] = col_2;
-}
-
-
-// stats: 16 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Parallax (high float) 1x1 [-1]
-// #2: unity_Ambient (high float) 4x1 [-1]
-// textures: 4
-// #0: _Illum (high 2d) 0x0 [-1]
-// #1: _LightBuffer (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
-// #3: _ParallaxMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-in.txt
deleted file mode 100644
index 64349e8602a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-in.txt
+++ /dev/null
@@ -1,137 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec2 uv_Illum;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-vec4 UnpackNormal( in vec4 packednormal );
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
- vec3 v;
- h = ((h * height) - (height / 2.00000));
- v = normalize( viewDir );
- v.z += 0.420000;
- return (h * (v.xy / v.z ));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float h;
- vec2 offset;
- vec4 tex;
- vec4 c;
- h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
- offset = ParallaxOffset( h, _Parallax, IN.viewDir);
- IN.uv_MainTex += offset;
- IN.uv_BumpMap += offset;
- IN.uv_Illum += offset;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Gloss = tex.w ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Specular = _Shininess;
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), texture2D( _LightTexture0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w );
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-out.txt
deleted file mode 100644
index 267ff62bf06..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular-out.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1].xyz;
- vec3 tmpvar_3;
- tmpvar_3 = gl_TexCoord[3].xyz;
- vec4 c_4;
- vec4 c_5;
- vec2 tmpvar_6;
- vec3 v_7;
- vec3 tmpvar_8;
- tmpvar_8 = normalize(tmpvar_2);
- v_7.xy = tmpvar_8.xy;
- v_7.z = (tmpvar_8.z + 0.42);
- tmpvar_6 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_8.xy / v_7.z));
- vec4 tmpvar_9;
- tmpvar_9 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_6));
- c_5 = (tmpvar_9 * _Color);
- vec4 normal_10;
- normal_10.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_6)).wy * 2.0) - 1.0);
- normal_10.z = sqrt(((1.0 -
- (normal_10.x * normal_10.x)
- ) - (normal_10.y * normal_10.y)));
- vec3 tmpvar_11;
- tmpvar_11 = normalize(gl_TexCoord[2].xyz);
- vec4 tmpvar_12;
- tmpvar_12 = texture2D (_LightTexture0, vec2(dot (tmpvar_3, tmpvar_3)));
- vec4 c_13;
- float spec_14;
- spec_14 = (pow (max (0.0,
- dot (normal_10.xyz, normalize((tmpvar_11 + normalize(tmpvar_2))))
- ), (_Shininess * 128.0)) * tmpvar_9.w);
- c_13.xyz = (((
- (c_5.xyz * _LightColor0.xyz)
- *
- max (0.0, dot (normal_10.xyz, tmpvar_11))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_14)) * (tmpvar_12.w * 2.0));
- c_13.w = (c_5.w + ((_LightColor0.w * _SpecColor.w) * (spec_14 * tmpvar_12.w)));
- c_4.xyz = c_13.xyz;
- c_4.w = 0.0;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 41 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 5 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Parallax (high float) 1x1 [-1]
-// #3: _Shininess (high float) 1x1 [-1]
-// #4: _SpecColor (high float) 4x1 [-1]
-// textures: 4
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
-// #3: _ParallaxMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-in.txt
deleted file mode 100644
index 4efc7afecce..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-in.txt
+++ /dev/null
@@ -1,138 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec2 uv_Illum;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-vec4 UnpackNormal( in vec4 packednormal );
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-vec2 ParallaxOffset( in float h, in float height, in vec3 viewDir ) {
- vec3 v;
- h = ((h * height) - (height / 2.00000));
- v = normalize( viewDir );
- v.z += 0.420000;
- return (h * (v.xy / v.z ));
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float h;
- vec2 offset;
- vec4 tex;
- vec4 c;
- h = texture2D( _ParallaxMap, IN.uv_BumpMap).w ;
- offset = ParallaxOffset( h, _Parallax, IN.viewDir);
- IN.uv_MainTex += offset;
- IN.uv_BumpMap += offset;
- IN.uv_Illum += offset;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Gloss = tex.w ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Specular = _Shininess;
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), (texture2D( _LightTextureB0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w * textureCube( _LightTexture0, IN._LightCoord).w ));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-out.txt
deleted file mode 100644
index f8f17c3368c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Parallax_Specular1-out.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Parallax;
-uniform sampler2D _ParallaxMap;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1].xyz;
- vec3 tmpvar_3;
- tmpvar_3 = gl_TexCoord[3].xyz;
- vec4 c_4;
- vec4 c_5;
- vec2 tmpvar_6;
- vec3 v_7;
- vec3 tmpvar_8;
- tmpvar_8 = normalize(tmpvar_2);
- v_7.xy = tmpvar_8.xy;
- v_7.z = (tmpvar_8.z + 0.42);
- tmpvar_6 = (((texture2D (_ParallaxMap, tmpvar_1.zw).w * _Parallax) - (_Parallax / 2.0)) * (tmpvar_8.xy / v_7.z));
- vec4 tmpvar_9;
- tmpvar_9 = texture2D (_MainTex, (tmpvar_1.xy + tmpvar_6));
- c_5 = (tmpvar_9 * _Color);
- vec4 normal_10;
- normal_10.xy = ((texture2D (_BumpMap, (tmpvar_1.zw + tmpvar_6)).wy * 2.0) - 1.0);
- normal_10.z = sqrt(((1.0 -
- (normal_10.x * normal_10.x)
- ) - (normal_10.y * normal_10.y)));
- vec3 tmpvar_11;
- tmpvar_11 = normalize(gl_TexCoord[2].xyz);
- float atten_12;
- atten_12 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_3, tmpvar_3))).w * textureCube (_LightTexture0, tmpvar_3).w);
- vec4 c_13;
- float spec_14;
- spec_14 = (pow (max (0.0,
- dot (normal_10.xyz, normalize((tmpvar_11 + normalize(tmpvar_2))))
- ), (_Shininess * 128.0)) * tmpvar_9.w);
- c_13.xyz = (((
- (c_5.xyz * _LightColor0.xyz)
- *
- max (0.0, dot (normal_10.xyz, tmpvar_11))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_14)) * (atten_12 * 2.0));
- c_13.w = (c_5.w + ((_LightColor0.w * _SpecColor.w) * (spec_14 * atten_12)));
- c_4.xyz = c_13.xyz;
- c_4.w = 0.0;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 42 alu 5 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 5 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Parallax (high float) 1x1 [-1]
-// #3: _Shininess (high float) 1x1 [-1]
-// #4: _SpecColor (high float) 4x1 [-1]
-// textures: 5
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high cube) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
-// #4: _ParallaxMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-in.txt
deleted file mode 100644
index c06f03100be..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-in.txt
+++ /dev/null
@@ -1,119 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 viewDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Gloss = tex.w ;
- o.Alpha = c.w ;
- o.Specular = _Shininess;
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN.viewDir = vec3( gl_TexCoord[3]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[4]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-out.txt
deleted file mode 100644
index 77fcc8082af..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular-out.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[1].xyz;
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[4];
- vec4 c_3;
- vec4 c_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, gl_TexCoord[0].xy);
- c_4 = (tmpvar_5 * _Color);
- vec3 tmpvar_6;
- tmpvar_6 = normalize(gl_TexCoord[2].xyz);
- float atten_7;
- atten_7 = ((float(
- (tmpvar_2.z > 0.0)
- ) * texture2D (_LightTexture0, (
- (tmpvar_2.xy / tmpvar_2.w)
- + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w);
- vec4 c_8;
- float spec_9;
- spec_9 = (pow (max (0.0,
- dot (tmpvar_1, normalize((tmpvar_6 + normalize(gl_TexCoord[3].xyz))))
- ), (_Shininess * 128.0)) * tmpvar_5.w);
- c_8.xyz = (((
- (c_4.xyz * _LightColor0.xyz)
- *
- max (0.0, dot (tmpvar_1, tmpvar_6))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_9)) * (atten_7 * 2.0));
- c_8.w = (c_4.w + ((_LightColor0.w * _SpecColor.w) * (spec_9 * atten_7)));
- c_3.xyz = c_8.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 31 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Shininess (high float) 1x1 [-1]
-// #3: _SpecColor (high float) 4x1 [-1]
-// textures: 3
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _LightTextureB0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-in.txt
deleted file mode 100644
index a233b144e2a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-in.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Gloss = tex.w ;
- o.Alpha = c.w ;
- o.Specular = _Shininess;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- vec4 res;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.normal = vec3( gl_TexCoord[0]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-out.txt
deleted file mode 100644
index 63f2c940aec..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular1-out.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-uniform float _Shininess;
-void main ()
-{
- vec4 res_1;
- res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = _Shininess;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Shininess (high float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-in.txt
deleted file mode 100644
index 85521d5cf8b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-in.txt
+++ /dev/null
@@ -1,133 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- vec4 c;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- c = (tex * _Color);
- o.Albedo = c.xyz ;
- o.Emission = (c.xyz * texture2D( _Illum, IN.uv_Illum).w );
- o.Gloss = tex.w ;
- o.Alpha = c.w ;
- o.Specular = _Shininess;
-}
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light ) {
- float spec;
- vec4 c;
- spec = (light.w * s.Gloss);
- c.xyz = ((s.Albedo * light.xyz ) + ((light.xyz * _SpecColor.xyz ) * spec));
- c.w = (s.Alpha + (spec * _SpecColor.w ));
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_Illum = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingBlinnPhong_PrePass( o, light);
- col.xyz += o.Emission;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-out.txt
deleted file mode 100644
index b63e8a94f6a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Specular2-out.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _Illum;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _SpecColor;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[2].xyz;
- vec4 col_3;
- vec4 light_4;
- vec4 c_5;
- vec4 tmpvar_6;
- tmpvar_6 = texture2D (_MainTex, tmpvar_1.xy);
- c_5 = (tmpvar_6 * _Color);
- light_4 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_4.xyz = (light_4.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_2.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_2.xy).xyz), vec3(clamp (tmpvar_2.z, 0.0, 1.0))));
- vec4 c_7;
- float spec_8;
- spec_8 = (light_4.w * tmpvar_6.w);
- c_7.xyz = ((c_5.xyz * light_4.xyz) + ((light_4.xyz * _SpecColor.xyz) * spec_8));
- c_7.w = (c_5.w + (spec_8 * _SpecColor.w));
- col_3.w = c_7.w;
- col_3.xyz = (c_7.xyz + (c_5.xyz * texture2D (_Illum, tmpvar_1.zw).w));
- gl_FragData[0] = col_3;
-}
-
-
-// stats: 17 alu 5 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _SpecColor (high float) 4x1 [-1]
-// textures: 5
-// #0: _Illum (high 2d) 0x0 [-1]
-// #1: _LightBuffer (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
-// #3: unity_Lightmap (high 2d) 0x0 [-1]
-// #4: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-in.txt
deleted file mode 100644
index 681dff8562b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-in.txt
+++ /dev/null
@@ -1,114 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 viewDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN.viewDir = vec3( gl_TexCoord[3]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[4]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-out.txt
deleted file mode 100644
index 645d430b88c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular-out.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[1].xyz;
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[4];
- vec4 c_3;
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy);
- vec3 tmpvar_5;
- tmpvar_5 = normalize(gl_TexCoord[2].xyz);
- float atten_6;
- atten_6 = ((float(
- (tmpvar_2.z > 0.0)
- ) * texture2D (_LightTexture0, (
- (tmpvar_2.xy / tmpvar_2.w)
- + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w);
- vec4 c_7;
- float spec_8;
- spec_8 = (pow (max (0.0,
- dot (tmpvar_1, normalize((tmpvar_5 + normalize(gl_TexCoord[3].xyz))))
- ), (_Shininess * 128.0)) * tmpvar_4.w);
- c_7.xyz = (((
- ((tmpvar_4.xyz * _Color.xyz) * _LightColor0.xyz)
- *
- max (0.0, dot (tmpvar_1, tmpvar_5))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_8)) * (atten_6 * 2.0));
- c_7.w = ((tmpvar_4.w * _Color.w) + ((_LightColor0.w * _SpecColor.w) * (spec_8 * atten_6)));
- c_3.xyz = c_7.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 32 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Shininess (high float) 1x1 [-1]
-// #3: _SpecColor (high float) 4x1 [-1]
-// textures: 3
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _LightTextureB0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-in.txt
deleted file mode 100644
index 4b417be75eb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-in.txt
+++ /dev/null
@@ -1,72 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- vec4 res;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.normal = vec3( gl_TexCoord[0]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-out.txt
deleted file mode 100644
index 63f2c940aec..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-out.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-uniform float _Shininess;
-void main ()
-{
- vec4 res_1;
- res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = _Shininess;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Shininess (high float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-in.txt
deleted file mode 100644
index 3c30d05282d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-in.txt
+++ /dev/null
@@ -1,126 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
-}
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light ) {
- float spec;
- vec4 c;
- spec = (light.w * s.Gloss);
- c.xyz = ((s.Albedo * light.xyz ) + ((light.xyz * _SpecColor.xyz ) * spec));
- c.w = (s.Alpha + (spec * _SpecColor.w ));
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingBlinnPhong_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-out.txt
deleted file mode 100644
index 9884f4fbfc0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular2-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _SpecColor;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[2].xyz;
- vec4 light_2;
- vec4 tmpvar_3;
- tmpvar_3 = texture2D (_MainTex, gl_TexCoord[0].xy);
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0))));
- vec4 c_4;
- float spec_5;
- spec_5 = (light_2.w * tmpvar_3.w);
- c_4.xyz = (((tmpvar_3.xyz * _Color.xyz) * light_2.xyz) + ((light_2.xyz * _SpecColor.xyz) * spec_5));
- c_4.w = ((tmpvar_3.w * _Color.w) + (spec_5 * _SpecColor.w));
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 16 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _SpecColor (high float) 4x1 [-1]
-// textures: 4
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: unity_Lightmap (high 2d) 0x0 [-1]
-// #3: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-in.txt
deleted file mode 100644
index bc667de7aad..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-in.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv2_Detail;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _Detail;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- o.Albedo = ((texture2D( _MainTex, IN.uv_MainTex).xyz * texture2D( _Detail, IN.uv2_Detail).xyz ) * 2.00000);
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv2_Detail = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-out.txt
deleted file mode 100644
index e9a980a29fa..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform sampler2D _Detail;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[3];
- vec4 c_3;
- vec4 c_4;
- c_4.xyz = (((texture2D (_MainTex, tmpvar_1.xy).xyz * texture2D (_Detail, tmpvar_1.zw).xyz) * (2.0 * _LightColor0.xyz)) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz)))
- *
- ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)
- ) * 2.0));
- c_4.w = 0.0;
- c_3.xyz = c_4.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 18 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 4
-// #0: _Detail (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-in.txt
deleted file mode 100644
index 7a64f00ab3a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-in.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv2_Detail;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _Detail;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- o.Albedo = ((texture2D( _MainTex, IN.uv_MainTex).xyz * texture2D( _Detail, IN.uv2_Detail).xyz ) * 2.00000);
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv2_Detail = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-out.txt
deleted file mode 100644
index 7980016e469..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_2UV1-out.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-uniform sampler2D _Detail;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 light_2;
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_2.xyz = (light_2.xyz + unity_Ambient.xyz);
- vec4 c_3;
- c_3.xyz = ((texture2D (_MainTex, tmpvar_1.xy).xyz * texture2D (_Detail, tmpvar_1.zw).xyz) * (2.0 * light_2.xyz));
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 7 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 1 (total size: 0)
-// #0: unity_Ambient (high float) 4x1 [-1]
-// textures: 3
-// #0: _Detail (high 2d) 0x0 [-1]
-// #1: _LightBuffer (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-in.txt
deleted file mode 100644
index 56385d87721..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-in.txt
+++ /dev/null
@@ -1,122 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct MySurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- vec3 GlossColor;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_SpecMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 viewDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform sampler2D _SpecMap;
-void surf( in Input IN, inout MySurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingColoredSpecular( in MySurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout MySurfaceOutput o ) {
- vec4 spec;
- o.Albedo = (texture2D( _MainTex, IN.uv_MainTex).xyz * 0.300000);
- spec = texture2D( _SpecMap, IN.uv_SpecMap);
- o.GlossColor = spec.xyz ;
- o.Specular = 0.250000;
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingColoredSpecular( in MySurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec3 specCol;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = pow( nh, 32.0000);
- specCol = (spec * s.GlossColor);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + (_LightColor0.xyz * specCol)) * (atten * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- MySurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_SpecMap = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingColoredSpecular( o, lightDir, normalize( vec3( IN.viewDir) ), ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN.viewDir = vec3( gl_TexCoord[3]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[4]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-out.txt
deleted file mode 100644
index e3c2584e9ef..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular-out.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform sampler2D _SpecMap;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1].xyz;
- vec4 tmpvar_3;
- tmpvar_3 = gl_TexCoord[4];
- vec4 c_4;
- vec3 tmpvar_5;
- tmpvar_5 = normalize(gl_TexCoord[2].xyz);
- vec4 c_6;
- c_6.xyz = (((
- ((texture2D (_MainTex, tmpvar_1.xy).xyz * 0.3) * _LightColor0.xyz)
- *
- max (0.0, dot (tmpvar_2, tmpvar_5))
- ) + (_LightColor0.xyz *
- (pow (max (0.0, dot (tmpvar_2,
- normalize((tmpvar_5 + normalize(gl_TexCoord[3].xyz)))
- )), 32.0) * texture2D (_SpecMap, tmpvar_1.zw).xyz)
- )) * ((
- (float((tmpvar_3.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_3.xy / tmpvar_3.w) + 0.5)).w)
- * texture2D (_LightTextureB0, vec2(
- dot (tmpvar_3.xyz, tmpvar_3.xyz)
- )).w) * 2.0));
- c_6.w = 0.0;
- c_4.xyz = c_6.xyz;
- c_4.w = 0.0;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 26 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 4
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _LightTextureB0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
-// #3: _SpecMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-in.txt
deleted file mode 100644
index 57e31326da4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-in.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct MySurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- vec3 GlossColor;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_SpecMap;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _MainTex;
-uniform sampler2D _SpecMap;
-void surf( in Input IN, inout MySurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout MySurfaceOutput o ) {
- vec4 spec;
- o.Albedo = (texture2D( _MainTex, IN.uv_MainTex).xyz * 0.300000);
- spec = texture2D( _SpecMap, IN.uv_SpecMap);
- o.GlossColor = spec.xyz ;
- o.Specular = 0.250000;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- MySurfaceOutput o;
- Input surfIN;
- vec4 res;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.normal = vec3( gl_TexCoord[0]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-out.txt
deleted file mode 100644
index af5ca30dd5f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Colored_Specular1-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-void main ()
-{
- vec4 res_1;
- res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = 0.25;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-in.txt
deleted file mode 100644
index 6dd56e88ca1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-in.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec3 foo;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec3 cust_foo;
- vec3 normal;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- o.Albedo = IN.foo;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.foo = IN.cust_foo;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, (texture2D( _LightTextureB0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w * textureCube( _LightTexture0, IN._LightCoord).w ));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.cust_foo = vec3( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-out.txt
deleted file mode 100644
index 082a301be1a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data-out.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[3].xyz;
- vec4 c_2;
- vec4 c_3;
- c_3.xyz = ((gl_TexCoord[0].xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz)))
- *
- (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w)
- ) * 2.0));
- c_3.w = 0.0;
- c_2.xyz = c_3.xyz;
- c_2.w = 0.0;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 11 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightTexture0 (high cube) 0x0 [-1]
-// #1: _LightTextureB0 (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-in.txt
deleted file mode 100644
index 7eb067b9b1d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-in.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec3 foo;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec3 cust_foo;
- vec3 normal;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- o.Albedo = IN.foo;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.foo = IN.cust_foo;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingLambert( o, lightDir, (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.cust_foo = vec3( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec2( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-out.txt
deleted file mode 100644
index cc2a0a87a1f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data1-out.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-void main ()
-{
- vec4 c_1;
- vec4 c_2;
- c_2.xyz = ((gl_TexCoord[0].xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz))
- * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0));
- c_2.w = 0.0;
- c_1.xyz = c_2.xyz;
- c_1.w = 0.0;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 8 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 1
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-in.txt
deleted file mode 100644
index ce91810dbbd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-in.txt
+++ /dev/null
@@ -1,115 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec3 foo;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec3 cust_foo;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-uniform sampler2D _LightBuffer;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- o.Albedo = IN.foo;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.foo = IN.cust_foo;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.cust_foo = vec3( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-out.txt
deleted file mode 100644
index 68a1d1e0657..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Custom_Data2-out.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-uniform sampler2D _LightBuffer;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[2].xyz;
- vec4 light_2;
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0))));
- vec4 c_3;
- c_3.xyz = (gl_TexCoord[0].xyz * light_2.xyz);
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 9 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// textures: 3
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: unity_Lightmap (high 2d) 0x0 [-1]
-// #2: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-in.txt
deleted file mode 100644
index 1f296aca47b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-in.txt
+++ /dev/null
@@ -1,88 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- o.Albedo = (texture2D( _MainTex, IN.uv_MainTex).xyz * 0.500000);
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingLambert( o, lightDir, (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec2( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-out.txt
deleted file mode 100644
index a70ba2a2091..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAdd-out.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 c_1;
- vec4 c_2;
- c_2.xyz = (((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * 0.5) * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz))
- * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0));
- c_2.w = 0.0;
- c_1.xyz = c_2.xyz;
- c_1.w = 0.0;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 9 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-in.txt
deleted file mode 100644
index 6bc127799dc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-in.txt
+++ /dev/null
@@ -1,104 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_Decal;
- vec2 uv_DecalBump;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec3 vlight;
- vec4 _ShadowCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _Decal;
-uniform sampler2D _DecalBump;
-uniform vec4 _LightColor0;
-uniform sampler2D _ShadowMapTexture;
-float unitySampleShadow( in vec4 shadowCoord );
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-float unitySampleShadow( in vec4 shadowCoord ) {
- float shadow;
- shadow = texture2DProj( _ShadowMapTexture, shadowCoord).x ;
- return shadow;
-}
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- o.Albedo = (texture2D( _Decal, IN.uv_Decal).xyz * 0.500000);
- o.Normal = vec3( UnpackNormal( texture2D( _DecalBump, IN.uv_DecalBump)));
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- float atten;
- vec4 c;
- surfIN.uv_Decal = IN.hip_pack0.xy ;
- surfIN.uv_DecalBump = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- atten = unitySampleShadow( IN._ShadowCoord);
- c = LightingLambert( o, IN.lightDir, atten);
- c.xyz += (o.Albedo * IN.vlight);
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN.vlight = vec3( gl_TexCoord[2]);
- xlt_IN._ShadowCoord = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-out.txt
deleted file mode 100644
index 5601603c6c7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump3-out.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-uniform sampler2D _Decal;
-uniform sampler2D _DecalBump;
-uniform vec4 _LightColor0;
-uniform sampler2D _ShadowMapTexture;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 c_2;
- vec3 tmpvar_3;
- tmpvar_3 = (texture2D (_Decal, tmpvar_1.xy).xyz * 0.5);
- vec4 normal_4;
- normal_4.xy = ((texture2D (_DecalBump, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_4.z = sqrt(((1.0 -
- (normal_4.x * normal_4.x)
- ) - (normal_4.y * normal_4.y)));
- vec4 c_5;
- c_5.xyz = ((tmpvar_3 * _LightColor0.xyz) * ((
- max (0.0, dot (normal_4.xyz, gl_TexCoord[1].xyz))
- * texture2DProj (_ShadowMapTexture, gl_TexCoord[3]).x) * 2.0));
- c_5.w = 0.0;
- c_2.w = c_5.w;
- c_2.xyz = (c_5.xyz + (tmpvar_3 * gl_TexCoord[2].xyz));
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 17 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 3
-// #0: _Decal (high 2d) 0x0 [-1]
-// #1: _DecalBump (high 2d) 0x0 [-1]
-// #2: _ShadowMapTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-in.txt
deleted file mode 100644
index 1d5921b82ac..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-in.txt
+++ /dev/null
@@ -1,97 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_Decal;
- vec2 uv_DecalBump;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _Decal;
-uniform sampler2D _DecalBump;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- o.Albedo = (texture2D( _Decal, IN.uv_Decal).xyz * 0.500000);
- o.Normal = vec3( UnpackNormal( texture2D( _DecalBump, IN.uv_DecalBump)));
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_Decal = IN.hip_pack0.xy ;
- surfIN.uv_DecalBump = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, texture2D( _LightTexture0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w );
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-out.txt
deleted file mode 100644
index 0eaef42e5d5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_DecalAddBump5-out.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-uniform sampler2D _Decal;
-uniform sampler2D _DecalBump;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[2].xyz;
- vec4 c_3;
- vec4 normal_4;
- normal_4.xy = ((texture2D (_DecalBump, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_4.z = sqrt(((1.0 -
- (normal_4.x * normal_4.x)
- ) - (normal_4.y * normal_4.y)));
- vec4 c_5;
- c_5.xyz = (((texture2D (_Decal, tmpvar_1.xy).xyz * 0.5) * _LightColor0.xyz) * ((
- max (0.0, dot (normal_4.xyz, normalize(gl_TexCoord[1].xyz)))
- * texture2D (_LightTexture0, vec2(
- dot (tmpvar_2, tmpvar_2)
- )).w) * 2.0));
- c_5.w = 0.0;
- c_3.xyz = c_5.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 18 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 3
-// #0: _Decal (high 2d) 0x0 [-1]
-// #1: _DecalBump (high 2d) 0x0 [-1]
-// #2: _LightTexture0 (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-in.txt
deleted file mode 100644
index 0c2d0cbc0b6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-in.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingWrapLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- o.Albedo = texture2D( _MainTex, IN.uv_MainTex).xyz ;
-}
-vec4 LightingWrapLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float NdotL;
- float diff;
- vec4 c;
- NdotL = dot( s.Normal, lightDir);
- diff = ((NdotL * 0.500000) + 0.500000);
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingWrapLambert( o, lightDir, (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec2( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt
deleted file mode 100644
index 811a428cb44..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Diffuse_Wrapped-out.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 c_1;
- vec4 c_2;
- c_2.xyz = ((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _LightColor0.xyz) * ((
- ((dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz) * 0.5) + 0.5)
- * texture2D (_LightTexture0, gl_TexCoord[3].xy).w) * 2.0));
- c_2.w = 0.0;
- c_1.xyz = c_2.xyz;
- c_1.w = 0.0;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 9 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-in.txt
deleted file mode 100644
index 3361d28cc93..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-in.txt
+++ /dev/null
@@ -1,112 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform vec4 _RimColor;
-uniform float _RimPower;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- float rim;
- o.Albedo = texture2D( _MainTex, IN.uv_MainTex).xyz ;
- rim = (1.00000 - xll_saturate( dot( normalize( IN.viewDir ), o.Normal) ));
- o.Emission = (_RimColor.xyz * pow( rim, _RimPower));
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingLambert( o, lightDir, 1.00000);
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-out.txt
deleted file mode 100644
index a0016305db0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim-out.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 c_1;
- vec4 c_2;
- c_2.xyz = ((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _LightColor0.xyz) * (max (0.0,
- dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)
- ) * 2.0));
- c_2.w = 0.0;
- c_1.xyz = c_2.xyz;
- c_1.w = 0.0;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 7 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-in.txt
deleted file mode 100644
index 6fc5df14ec9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-in.txt
+++ /dev/null
@@ -1,116 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 viewDir;
- vec4 hip_screen;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _RimColor;
-uniform float _RimPower;
-uniform vec4 unity_Ambient;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- float rim;
- o.Albedo = texture2D( _MainTex, IN.uv_MainTex).xyz ;
- rim = (1.00000 - xll_saturate( dot( normalize( IN.viewDir ), o.Normal) ));
- o.Emission = (_RimColor.xyz * pow( rim, _RimPower));
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- col.xyz += o.Emission;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[2]);
- xlt_IN.normal = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-out.txt
deleted file mode 100644
index 6ba22d2b0ba..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim1-out.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _RimColor;
-uniform float _RimPower;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 col_1;
- vec4 light_2;
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2])));
- light_2.xyz = (light_2.xyz + unity_Ambient.xyz);
- vec4 c_3;
- c_3.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_2.xyz);
- c_3.w = 0.0;
- col_1.w = c_3.w;
- col_1.xyz = (c_3.xyz + (_RimColor.xyz * pow (
- (1.0 - clamp (dot (normalize(gl_TexCoord[1].xyz), gl_TexCoord[3].xyz), 0.0, 1.0))
- , _RimPower)));
- gl_FragData[0] = col_1;
-}
-
-
-// stats: 12 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _RimColor (high float) 4x1 [-1]
-// #1: _RimPower (high float) 1x1 [-1]
-// #2: unity_Ambient (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-in.txt
deleted file mode 100644
index 3fc23f38440..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-in.txt
+++ /dev/null
@@ -1,129 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 viewDir;
- vec4 hip_screen;
- vec3 normal;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _RimColor;
-uniform float _RimPower;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- float rim;
- o.Albedo = texture2D( _MainTex, IN.uv_MainTex).xyz ;
- rim = (1.00000 - xll_saturate( dot( normalize( IN.viewDir ), o.Normal) ));
- o.Emission = (_RimColor.xyz * pow( rim, _RimPower));
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.viewDir = IN.viewDir;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingLambert_PrePass( o, light);
- col.xyz += o.Emission;
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.viewDir = vec3( gl_TexCoord[1]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[2]);
- xlt_IN.normal = vec3( gl_TexCoord[3]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[4]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-out.txt
deleted file mode 100644
index 1a05758ad3d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim2-out.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _RimColor;
-uniform float _RimPower;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[4].xyz;
- vec4 col_2;
- vec4 light_3;
- light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2])));
- light_3.xyz = (light_3.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0))));
- vec4 c_4;
- c_4.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_3.xyz);
- c_4.w = 0.0;
- col_2.w = c_4.w;
- col_2.xyz = (c_4.xyz + (_RimColor.xyz * pow (
- (1.0 - clamp (dot (normalize(gl_TexCoord[1].xyz), gl_TexCoord[3].xyz), 0.0, 1.0))
- , _RimPower)));
- gl_FragData[0] = col_2;
-}
-
-
-// stats: 16 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _RimColor (high float) 4x1 [-1]
-// #1: _RimPower (high float) 1x1 [-1]
-// textures: 4
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: unity_Lightmap (high 2d) 0x0 [-1]
-// #3: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-in.txt
deleted file mode 100644
index 423cff29491..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-in.txt
+++ /dev/null
@@ -1,131 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_BumpMap;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform vec4 _RimColor;
-uniform float _RimPower;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float rim;
- o.Albedo = texture2D( _MainTex, IN.uv_BumpMap).xyz ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
- rim = (1.00000 - xll_saturate( dot( normalize( IN.viewDir ), o.Normal) ));
- o.Emission = (_RimColor.xyz * pow( rim, _RimPower));
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_BumpMap = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-out.txt
deleted file mode 100644
index 40923ff01f8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump-out.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[2];
- vec4 c_3;
- vec4 normal_4;
- normal_4.xy = ((texture2D (_BumpMap, tmpvar_1).wy * 2.0) - 1.0);
- normal_4.z = sqrt(((1.0 -
- (normal_4.x * normal_4.x)
- ) - (normal_4.y * normal_4.y)));
- vec4 c_5;
- c_5.xyz = ((texture2D (_MainTex, tmpvar_1).xyz * _LightColor0.xyz) * ((
- max (0.0, dot (normal_4.xyz, normalize(gl_TexCoord[1].xyz)))
- *
- ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)
- ) * 2.0));
- c_5.w = 0.0;
- c_3.xyz = c_5.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 23 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 4
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high 2d) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-in.txt
deleted file mode 100644
index 36c99facde3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-in.txt
+++ /dev/null
@@ -1,123 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_BumpMap;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform vec4 _RimColor;
-uniform float _RimPower;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- float rim;
- o.Albedo = texture2D( _MainTex, IN.uv_BumpMap).xyz ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
- rim = (1.00000 - xll_saturate( dot( normalize( IN.viewDir ), o.Normal) ));
- o.Emission = (_RimColor.xyz * pow( rim, _RimPower));
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_BumpMap = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, (texture2D( _LightTextureB0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w * textureCube( _LightTexture0, IN._LightCoord).w ));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-out.txt
deleted file mode 100644
index 6dbcc1a123a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Rim_Bump1-out.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[2].xyz;
- vec4 c_3;
- vec4 normal_4;
- normal_4.xy = ((texture2D (_BumpMap, tmpvar_1).wy * 2.0) - 1.0);
- normal_4.z = sqrt(((1.0 -
- (normal_4.x * normal_4.x)
- ) - (normal_4.y * normal_4.y)));
- vec4 c_5;
- c_5.xyz = ((texture2D (_MainTex, tmpvar_1).xyz * _LightColor0.xyz) * ((
- max (0.0, dot (normal_4.xyz, normalize(gl_TexCoord[1].xyz)))
- *
- (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w)
- ) * 2.0));
- c_5.w = 0.0;
- c_3.xyz = c_5.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 18 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 4
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high cube) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-in.txt
deleted file mode 100644
index 71fa3b901e7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-in.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec4 screenPos;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec2 uv;
- uv = (IN.screenPos.xy / IN.screenPos.w );
- uv *= vec2( 2.00000, 1.00000);
- o.Albedo = vec3( 0.500000);
- o.Emission = (texture2D( _MainTex, uv).xyz * 0.500000);
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- vec3 lightDir;
- vec4 c;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.normal = vec3( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-out.txt
deleted file mode 100644
index 0992b515aad..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos-out.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[2];
- vec4 c_2;
- vec4 c_3;
- c_3.xyz = ((vec3(0.5, 0.5, 0.5) * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[0].xyz, normalize(gl_TexCoord[1].xyz)))
- *
- ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w)
- ) * 2.0));
- c_3.w = 0.0;
- c_2.xyz = c_3.xyz;
- c_2.w = 0.0;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 16 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _LightTextureB0 (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-in.txt
deleted file mode 100644
index 9272fb1f6b1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-in.txt
+++ /dev/null
@@ -1,91 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec4 screenPos;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec3 normal;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec2 uv;
- uv = (IN.screenPos.xy / IN.screenPos.w );
- uv *= vec2( 2.00000, 1.00000);
- o.Albedo = vec3( 0.500000);
- o.Emission = (texture2D( _MainTex, uv).xyz * 0.500000);
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- vec3 lightDir;
- vec4 c;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, (texture2D( _LightTextureB0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w * textureCube( _LightTexture0, IN._LightCoord).w ));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.normal = vec3( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-out.txt
deleted file mode 100644
index d868a8bc453..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos1-out.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[2].xyz;
- vec4 c_2;
- vec4 c_3;
- c_3.xyz = ((vec3(0.5, 0.5, 0.5) * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[0].xyz, normalize(gl_TexCoord[1].xyz)))
- *
- (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w)
- ) * 2.0));
- c_3.w = 0.0;
- c_2.xyz = c_3.xyz;
- c_2.w = 0.0;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 11 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightTexture0 (high cube) 0x0 [-1]
-// #1: _LightTextureB0 (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-in.txt
deleted file mode 100644
index 61b0c03234b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-in.txt
+++ /dev/null
@@ -1,69 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec4 screenPos;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec2 uv;
- uv = (IN.screenPos.xy / IN.screenPos.w );
- uv *= vec2( 2.00000, 1.00000);
- o.Albedo = vec3( 0.500000);
- o.Emission = (texture2D( _MainTex, uv).xyz * 0.500000);
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- vec4 res;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.normal = vec3( gl_TexCoord[0]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-out.txt
deleted file mode 100644
index 811a562240d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPos2-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-void main ()
-{
- vec4 res_1;
- res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = 0.0;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-in.txt
deleted file mode 100644
index bdf5e08969c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-in.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec4 screenPos;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec2 uv;
- uv = (IN.screenPos.xy / IN.screenPos.w );
- uv *= vec2( 2.00000, 1.00000);
- o.Albedo = texture2D( _MainTex, uv).xyz ;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- vec4 res;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.normal = vec3( gl_TexCoord[0]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt
deleted file mode 100644
index 811a562240d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-void main ()
-{
- vec4 res_1;
- res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = 0.0;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-in.txt
deleted file mode 100644
index 3450105ad37..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-in.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec4 screenPos;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_screenPos;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec2 uv;
- uv = (IN.screenPos.xy / IN.screenPos.w );
- uv *= vec2( 2.00000, 1.00000);
- o.Albedo = texture2D( _MainTex, uv).xyz ;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.screenPos = IN.hip_screenPos;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_screenPos = vec4( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-out.txt
deleted file mode 100644
index 3c0b1ce1674..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_ScreenPosAlbedo1-out.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 light_2;
- vec2 uv_3;
- uv_3 = (tmpvar_1.xy / tmpvar_1.w);
- uv_3 = (uv_3 * vec2(2.0, 1.0));
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_2.xyz = (light_2.xyz + unity_Ambient.xyz);
- vec4 c_4;
- c_4.xyz = (texture2D (_MainTex, uv_3).xyz * light_2.xyz);
- c_4.w = 0.0;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 7 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 1 (total size: 0)
-// #0: unity_Ambient (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-in.txt
deleted file mode 100644
index 97ccff30f75..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-in.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldPos;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 worldPos;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- xll_clip( (fract( ((IN.worldPos.y + (IN.worldPos.z * 0.100000)) * 5.00000) ) - 0.500000) );
- o.Albedo = texture2D( _MainTex, IN.uv_MainTex).xyz ;
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.worldPos = IN.worldPos;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.worldPos = vec3( gl_TexCoord[1]);
- xlt_IN.normal = vec3( gl_TexCoord[2]);
- xlt_IN.lightDir = vec3( gl_TexCoord[3]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[4]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-out.txt
deleted file mode 100644
index 91ee4e3bf59..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices-out.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[1].xyz;
- vec4 tmpvar_2;
- tmpvar_2 = gl_TexCoord[4];
- vec4 c_3;
- float x_4;
- x_4 = (fract((
- (tmpvar_1.y + (tmpvar_1.z * 0.1))
- * 5.0)) - 0.5);
- if ((x_4 < 0.0)) {
- discard;
- };
- vec4 c_5;
- c_5.xyz = ((texture2D (_MainTex, gl_TexCoord[0].xy).xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[2].xyz, normalize(gl_TexCoord[3].xyz)))
- *
- ((float((tmpvar_2.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_2.xy / tmpvar_2.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_2.xyz, tmpvar_2.xyz))).w)
- ) * 2.0));
- c_5.w = 0.0;
- c_3.xyz = c_5.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 22 alu 4 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 3
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _LightTextureB0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-in.txt
deleted file mode 100644
index fa83426b4ce..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-in.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldPos;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 worldPos;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- xll_clip( (fract( ((IN.worldPos.y + (IN.worldPos.z * 0.100000)) * 5.00000) ) - 0.500000) );
- o.Albedo = texture2D( _MainTex, IN.uv_MainTex).xyz ;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.worldPos = IN.worldPos;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.worldPos = vec3( gl_TexCoord[1]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-out.txt
deleted file mode 100644
index b292305fbea..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices1-out.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[1].xyz;
- vec4 light_2;
- float x_3;
- x_3 = (fract((
- (tmpvar_1.y + (tmpvar_1.z * 0.1))
- * 5.0)) - 0.5);
- if ((x_3 < 0.0)) {
- discard;
- };
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2])));
- light_2.xyz = (light_2.xyz + unity_Ambient.xyz);
- vec4 c_4;
- c_4.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_2.xyz);
- c_4.w = 0.0;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 11 alu 3 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: unity_Ambient (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-in.txt
deleted file mode 100644
index 2034e921549..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-in.txt
+++ /dev/null
@@ -1,124 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldPos;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 worldPos;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- xll_clip( (fract( ((IN.worldPos.y + (IN.worldPos.z * 0.100000)) * 5.00000) ) - 0.500000) );
- o.Albedo = texture2D( _MainTex, IN.uv_MainTex).xyz ;
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.worldPos = IN.worldPos;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.worldPos = vec3( gl_TexCoord[1]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[2]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-out.txt
deleted file mode 100644
index b1e0b1db134..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices2-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[1].xyz;
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[3].xyz;
- vec4 light_3;
- float x_4;
- x_4 = (fract((
- (tmpvar_1.y + (tmpvar_1.z * 0.1))
- * 5.0)) - 0.5);
- if ((x_4 < 0.0)) {
- discard;
- };
- light_3 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[2])));
- light_3.xyz = (light_3.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_2.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_2.xy).xyz), vec3(clamp (tmpvar_2.z, 0.0, 1.0))));
- vec4 c_5;
- c_5.xyz = (texture2D (_MainTex, gl_TexCoord[0].xy).xyz * light_3.xyz);
- c_5.w = 0.0;
- gl_FragData[0] = c_5;
-}
-
-
-// stats: 15 alu 5 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// textures: 4
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: unity_Lightmap (high 2d) 0x0 [-1]
-// #3: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-in.txt
deleted file mode 100644
index d384756da6e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-in.txt
+++ /dev/null
@@ -1,131 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldPos;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 _ShadowCoord0;
- vec3 _ShadowCoord1;
- vec3 _ShadowCoord2;
- vec3 _ShadowCoord3;
- vec2 _ShadowZFade;
- vec3 worldPos;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _LightShadowData;
-uniform vec4 _LightSplitsFar;
-uniform vec4 _LightSplitsNear;
-uniform sampler2D _MainTex;
-uniform vec4 _ProjectionParams;
-uniform sampler2D _ShadowMapTexture;
-void surf( in Input IN, inout SurfaceOutput o );
-vec2 EncodeFloatRG( in float v );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- xll_clip( (fract( ((IN.worldPos.y + (IN.worldPos.z * 0.100000)) * 5.00000) ) - 0.500000) );
- o.Albedo = texture2D( _MainTex, IN.uv_MainTex).xyz ;
-}
-vec2 EncodeFloatRG( in float v ) {
- vec2 kEncodeMul = vec2( 1.00000, 255.000);
- float kEncodeBit = 0.00392157;
- vec2 enc;
- enc = (kEncodeMul * v);
- enc = fract( enc );
- enc.x -= (enc.y * kEncodeBit);
- return enc;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 z;
- vec4 near;
- vec4 far;
- vec4 weights;
- vec4 coord;
- float shadow;
- float faded;
- vec4 res;
- surfIN.worldPos = IN.worldPos;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- z = vec4( IN._ShadowZFade.x );
- near = vec4( greaterThanEqual( z, _LightSplitsNear) );
- far = vec4( lessThan( z, _LightSplitsFar) );
- weights = (near * far);
- coord = vec4( ((((IN._ShadowCoord0 * weights.x ) + (IN._ShadowCoord1 * weights.y )) + (IN._ShadowCoord2 * weights.z )) + (IN._ShadowCoord3 * weights.w )), 1.00000);
- shadow = ( (texture2D( _ShadowMapTexture, coord.xy ).x < coord.z ) ) ? ( _LightShadowData.x ) : ( 1.00000 );
- faded = xll_saturate( (shadow + xll_saturate( IN._ShadowZFade.y )) );
- res.x = faded;
- res.y = 1.00000;
- res.zw = EncodeFloatRG( float( (1.00000 - (z * _ProjectionParams.w ))));
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN._ShadowCoord0 = vec3( gl_TexCoord[0]);
- xlt_IN._ShadowCoord1 = vec3( gl_TexCoord[1]);
- xlt_IN._ShadowCoord2 = vec3( gl_TexCoord[2]);
- xlt_IN._ShadowCoord3 = vec3( gl_TexCoord[3]);
- xlt_IN._ShadowZFade = vec2( gl_TexCoord[4]);
- xlt_IN.worldPos = vec3( gl_TexCoord[5]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-out.txt
deleted file mode 100644
index 8708621f144..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_Slices3-out.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-uniform vec4 _LightShadowData;
-uniform vec4 _LightSplitsFar;
-uniform vec4 _LightSplitsNear;
-uniform vec4 _ProjectionParams;
-uniform sampler2D _ShadowMapTexture;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[4].xy;
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[5].xyz;
- vec4 res_3;
- vec4 weights_4;
- float x_5;
- x_5 = (fract((
- (tmpvar_2.y + (tmpvar_2.z * 0.1))
- * 5.0)) - 0.5);
- if ((x_5 < 0.0)) {
- discard;
- };
- weights_4 = (vec4(greaterThanEqual (tmpvar_1.xxxx, _LightSplitsNear)) * vec4(lessThan (tmpvar_1.xxxx, _LightSplitsFar)));
- vec4 tmpvar_6;
- tmpvar_6.w = 1.0;
- tmpvar_6.xyz = (((
- (gl_TexCoord[0].xyz * weights_4.x)
- +
- (gl_TexCoord[1].xyz * weights_4.y)
- ) + (gl_TexCoord[2].xyz * weights_4.z)) + (gl_TexCoord[3].xyz * weights_4.w));
- vec4 tmpvar_7;
- tmpvar_7 = texture2D (_ShadowMapTexture, tmpvar_6.xy);
- float tmpvar_8;
- if ((tmpvar_7.x < tmpvar_6.z)) {
- tmpvar_8 = _LightShadowData.x;
- } else {
- tmpvar_8 = 1.0;
- };
- res_3.x = clamp ((tmpvar_8 + clamp (tmpvar_1.y, 0.0, 1.0)), 0.0, 1.0);
- res_3.y = 1.0;
- vec2 enc_9;
- enc_9 = (vec2(1.0, 255.0) * (1.0 - (tmpvar_1.xxxx * _ProjectionParams.w)).x);
- vec2 tmpvar_10;
- tmpvar_10 = fract(enc_9);
- enc_9.y = tmpvar_10.y;
- enc_9.x = (tmpvar_10.x - (tmpvar_10.y * 0.00392157));
- res_3.zw = enc_9;
- gl_FragData[0] = res_3;
-}
-
-
-// stats: 31 alu 2 tex 2 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [6] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _LightShadowData (high float) 4x1 [-1]
-// #1: _LightSplitsFar (high float) 4x1 [-1]
-// #2: _LightSplitsNear (high float) 4x1 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
-// textures: 1
-// #0: _ShadowMapTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-in.txt
deleted file mode 100644
index 85001146b41..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-in.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec3 worldRefl;
- vec3 normal;
- vec3 lightDir;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- o.Albedo = textureCube( _Cube, IN.worldRefl).xyz ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.worldRefl = IN.worldRefl;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingLambert( o, lightDir, 1.00000);
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.worldRefl = vec3( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-out.txt
deleted file mode 100644
index cf24a024e2c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl-out.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-uniform samplerCube _Cube;
-uniform vec4 _LightColor0;
-void main ()
-{
- vec4 c_1;
- vec4 c_2;
- c_2.xyz = ((textureCube (_Cube, gl_TexCoord[0].xyz).xyz * _LightColor0.xyz) * (max (0.0,
- dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz)
- ) * 2.0));
- c_2.w = 0.0;
- c_1.xyz = c_2.xyz;
- c_1.w = 0.0;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 7 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _LightColor0 (high float) 4x1 [-1]
-// textures: 1
-// #0: _Cube (high cube) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-in.txt
deleted file mode 100644
index 973321c6760..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-in.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform samplerCube _Cube;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- o.Albedo = textureCube( _Cube, IN.worldRefl).xyz ;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- vec4 res;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.normal = vec3( gl_TexCoord[0]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-out.txt
deleted file mode 100644
index 811a562240d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Surface_WorldRefl1-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-void main ()
-{
- vec4 res_1;
- res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = 0.0;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-in.txt
deleted file mode 100644
index 6597b9cd674..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-in.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec4 color;
-};
-struct appdata_base {
- vec4 vertex;
- vec3 normal;
- vec4 texcoord;
-};
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- return i.color;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-out.txt
deleted file mode 100644
index a15e4e8a8fb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_CgNormals-out.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-void main ()
-{
- gl_FragData[0] = gl_Color;
-}
-
-
-// stats: 0 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_Color (high float) 4x1 [-1] loc 1
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-in.txt
deleted file mode 100644
index b74c048cf12..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-in.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec2 texcoord;
-};
-uniform vec4 _Color;
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- return (texture2D( _MainTex, i.texcoord) * _Color);
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-out.txt
deleted file mode 100644
index e7901256cfc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_FontShaderCull-out.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _MainTex;
-void main ()
-{
- gl_FragData[0] = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
-}
-
-
-// stats: 1 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-in.txt
deleted file mode 100644
index 48454d866be..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-in.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_base {
- vec4 vertex;
- vec3 normal;
- vec4 texcoord;
-};
-uniform sampler2D _CameraDepthTexture;
-uniform vec4 _ZBufferParams;
-float Linear01Depth( in float z );
-vec4 frag( in v2f i );
-float Linear01Depth( in float z ) {
- return (1.00000 / ((_ZBufferParams.x * z) + _ZBufferParams.y ));
-}
-vec4 frag( in v2f i ) {
- return vec4( (1.00000 - Linear01Depth( texture2D( _CameraDepthTexture, i.uv).x )));
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt
deleted file mode 100644
index e225eda47f6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderDepthTexture-out.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-uniform sampler2D _CameraDepthTexture;
-uniform vec4 _ZBufferParams;
-void main ()
-{
- gl_FragData[0] = vec4((1.0 - (1.0/((
- (_ZBufferParams.x * texture2D (_CameraDepthTexture, gl_TexCoord[0].xy).x)
- + _ZBufferParams.y)))));
-}
-
-
-// stats: 4 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _ZBufferParams (high float) 4x1 [-1]
-// textures: 1
-// #0: _CameraDepthTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-in.txt
deleted file mode 100644
index 30200823721..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-in.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_base {
- vec4 vertex;
- vec3 normal;
- vec4 texcoord;
-};
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- return texture2D( _MainTex, i.uv);
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-out.txt
deleted file mode 100644
index 6290eb987e1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Test_VertexShaderTexture-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- gl_FragData[0] = texture2D (_MainTex, gl_TexCoord[0].xy);
-}
-
-
-// stats: 0 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-in.txt
deleted file mode 100644
index 1c2c0f659af..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-in.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_base {
- vec4 vertex;
- vec3 normal;
- vec4 texcoord;
-};
-uniform sampler2D _MainTex0;
-uniform sampler2D _MainTex1;
-uniform sampler2D _MainTex10;
-uniform sampler2D _MainTex11;
-uniform sampler2D _MainTex12;
-uniform sampler2D _MainTex13;
-uniform sampler2D _MainTex14;
-uniform sampler2D _MainTex15;
-uniform sampler2D _MainTex2;
-uniform sampler2D _MainTex3;
-uniform sampler2D _MainTex4;
-uniform sampler2D _MainTex5;
-uniform sampler2D _MainTex6;
-uniform sampler2D _MainTex7;
-uniform sampler2D _MainTex8;
-uniform sampler2D _MainTex9;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 col;
- col = texture2D( _MainTex0, i.uv);
- col += texture2D( _MainTex1, i.uv);
- col += texture2D( _MainTex2, i.uv);
- col += texture2D( _MainTex3, i.uv);
- col += texture2D( _MainTex4, i.uv);
- col += texture2D( _MainTex5, i.uv);
- col += texture2D( _MainTex6, i.uv);
- col += texture2D( _MainTex7, i.uv);
- col += texture2D( _MainTex8, i.uv);
- col += texture2D( _MainTex9, i.uv);
- col += texture2D( _MainTex10, i.uv);
- col += texture2D( _MainTex11, i.uv);
- col += texture2D( _MainTex12, i.uv);
- col += texture2D( _MainTex13, i.uv);
- col += texture2D( _MainTex14, i.uv);
- col += texture2D( _MainTex15, i.uv);
- return col;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-out.txt
deleted file mode 100644
index 20d8abba891..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Blend_Many_Textures-out.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-uniform sampler2D _MainTex0;
-uniform sampler2D _MainTex1;
-uniform sampler2D _MainTex10;
-uniform sampler2D _MainTex11;
-uniform sampler2D _MainTex12;
-uniform sampler2D _MainTex13;
-uniform sampler2D _MainTex14;
-uniform sampler2D _MainTex15;
-uniform sampler2D _MainTex2;
-uniform sampler2D _MainTex3;
-uniform sampler2D _MainTex4;
-uniform sampler2D _MainTex5;
-uniform sampler2D _MainTex6;
-uniform sampler2D _MainTex7;
-uniform sampler2D _MainTex8;
-uniform sampler2D _MainTex9;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec4 col_2;
- col_2 = (texture2D (_MainTex0, tmpvar_1) + texture2D (_MainTex1, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex2, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex3, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex4, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex5, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex6, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex7, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex8, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex9, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex10, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex11, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex12, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex13, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex14, tmpvar_1));
- col_2 = (col_2 + texture2D (_MainTex15, tmpvar_1));
- gl_FragData[0] = col_2;
-}
-
-
-// stats: 15 alu 16 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 16
-// #0: _MainTex0 (high 2d) 0x0 [-1]
-// #1: _MainTex1 (high 2d) 0x0 [-1]
-// #2: _MainTex10 (high 2d) 0x0 [-1]
-// #3: _MainTex11 (high 2d) 0x0 [-1]
-// #4: _MainTex12 (high 2d) 0x0 [-1]
-// #5: _MainTex13 (high 2d) 0x0 [-1]
-// #6: _MainTex14 (high 2d) 0x0 [-1]
-// #7: _MainTex15 (high 2d) 0x0 [-1]
-// #8: _MainTex2 (high 2d) 0x0 [-1]
-// #9: _MainTex3 (high 2d) 0x0 [-1]
-// #10: _MainTex4 (high 2d) 0x0 [-1]
-// #11: _MainTex5 (high 2d) 0x0 [-1]
-// #12: _MainTex6 (high 2d) 0x0 [-1]
-// #13: _MainTex7 (high 2d) 0x0 [-1]
-// #14: _MainTex8 (high 2d) 0x0 [-1]
-// #15: _MainTex9 (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-in.txt
deleted file mode 100644
index 3e04a3397e1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-in.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec3 normal;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- o.Emission = vec3( vec4( 0.000000, 1.00000, 0.000000, 0.000000));
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- vec3 lightDir;
- vec4 c;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, texture2D( _LightTexture0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w );
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.normal = vec3( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt
deleted file mode 100644
index da60f62d002..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert-out.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-void main ()
-{
- vec4 c_1;
- c_1.xyz = vec3(0.0, 0.0, 0.0);
- c_1.w = 0.0;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-in.txt
deleted file mode 100644
index e54b9bf5160..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-in.txt
+++ /dev/null
@@ -1,64 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- o.Emission = vec3( vec4( 1.00000, 0.000000, 0.000000, 0.000000));
-}
-vec4 frag_surf( in v2f_surf IN ) {
- SurfaceOutput o;
- Input surfIN;
- vec4 res;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.normal = vec3( gl_TexCoord[0]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt
deleted file mode 100644
index 811a562240d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tests_Fwd-Def-Vert1-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-void main ()
-{
- vec4 res_1;
- res_1.xyz = ((gl_TexCoord[0].xyz * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_1.w = 0.0;
- gl_FragData[0] = res_1;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-in.txt
deleted file mode 100644
index 29d1b2ba109..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-in.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec3 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec3 normal;
-};
-uniform samplerCube _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- return textureCube( _MainTex, i.texcoord);
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.vertex = vec4(0.0);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec3( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-out.txt
deleted file mode 100644
index 5d1e7ccffab..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TexGen_Cube_Refl-out.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-uniform samplerCube _MainTex;
-void main ()
-{
- gl_FragData[0] = textureCube (_MainTex, gl_TexCoord[0].xyz);
-}
-
-
-// stats: 0 alu 1 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// textures: 1
-// #0: _MainTex (high cube) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-in.txt
deleted file mode 100644
index 700c479472e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-in.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 texcoord;
- vec3 cubenormal;
-};
-struct appdata {
- vec4 vertex;
- vec2 texcoord;
- vec3 normal;
-};
-uniform vec4 _Color;
-uniform sampler2D _MainTex;
-uniform samplerCube _ToonShade;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- vec4 col;
- vec4 cube;
- col = (_Color * texture2D( _MainTex, i.texcoord));
- cube = textureCube( _ToonShade, i.cubenormal);
- return vec4( ((2.00000 * cube.xyz ) * col.xyz ), col.w );
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xlt_i.cubenormal = vec3( gl_TexCoord[1]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-out.txt
deleted file mode 100644
index efc24263658..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Basic-out.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-uniform vec4 _Color;
-uniform sampler2D _MainTex;
-uniform samplerCube _ToonShade;
-void main ()
-{
- vec4 col_1;
- col_1 = (_Color * texture2D (_MainTex, gl_TexCoord[0].xy));
- vec4 tmpvar_2;
- tmpvar_2.xyz = ((2.0 * textureCube (_ToonShade, gl_TexCoord[1].xyz).xyz) * col_1.xyz);
- tmpvar_2.w = col_1.w;
- gl_FragData[0] = tmpvar_2;
-}
-
-
-// stats: 3 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// textures: 2
-// #0: _MainTex (high 2d) 0x0 [-1]
-// #1: _ToonShade (high cube) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-in.txt
deleted file mode 100644
index e302d18a924..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-in.txt
+++ /dev/null
@@ -1,95 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform sampler2D _Ramp;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingToonRamp( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingToonRamp( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float d;
- vec3 ramp;
- vec4 c;
- d = ((dot( s.Normal, lightDir) * 0.500000) + 0.500000);
- ramp = texture2D( _Ramp, vec2( d, d)).xyz ;
- c.xyz = (((s.Albedo * _LightColor0.xyz ) * ramp) * (atten * 2.00000));
- c.w = 0.000000;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingToonRamp( o, lightDir, (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec2( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-out.txt
deleted file mode 100644
index cd69c769dc7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Toon_Lighted-out.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform sampler2D _Ramp;
-void main ()
-{
- vec4 c_1;
- vec4 c_2;
- c_2.xyz = (((
- (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color)
- .xyz * _LightColor0.xyz) * texture2D (_Ramp, vec2((
- (dot (gl_TexCoord[1].xyz, gl_TexCoord[2].xyz) * 0.5)
- + 0.5))).xyz) * (texture2D (_LightTexture0, gl_TexCoord[3].xy).w * 2.0));
- c_2.w = 0.0;
- c_1.xyz = c_2.xyz;
- c_1.w = 0.0;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 10 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 3
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: _Ramp (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-in.txt
deleted file mode 100644
index 6306de8d923..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-in.txt
+++ /dev/null
@@ -1,114 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec3 viewDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), (texture2D( _LightTextureB0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w * textureCube( _LightTexture0, IN._LightCoord).w ));
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN.viewDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-out.txt
deleted file mode 100644
index 16756df44cb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Bumped_Specular-out.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[3].xyz;
- vec4 c_3;
- float tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, tmpvar_1.xy);
- tmpvar_4 = (tmpvar_5.w * _Color.w);
- vec4 normal_6;
- normal_6.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_6.z = sqrt(((1.0 -
- (normal_6.x * normal_6.x)
- ) - (normal_6.y * normal_6.y)));
- vec3 tmpvar_7;
- tmpvar_7 = normalize(gl_TexCoord[1].xyz);
- float atten_8;
- atten_8 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w);
- vec4 c_9;
- float spec_10;
- spec_10 = (pow (max (0.0,
- dot (normal_6.xyz, normalize((tmpvar_7 + normalize(gl_TexCoord[2].xyz))))
- ), (_Shininess * 128.0)) * tmpvar_5.w);
- c_9.xyz = (((
- ((tmpvar_5.xyz * _Color.xyz) * _LightColor0.xyz)
- *
- max (0.0, dot (normal_6.xyz, tmpvar_7))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_10)) * (atten_8 * 2.0));
- c_9.w = (tmpvar_4 + ((_LightColor0.w * _SpecColor.w) * (spec_10 * atten_8)));
- c_3.xyz = c_9.xyz;
- c_3.w = tmpvar_4;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 33 alu 4 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Shininess (high float) 1x1 [-1]
-// #3: _SpecColor (high float) 4x1 [-1]
-// textures: 4
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _LightTexture0 (high cube) 0x0 [-1]
-// #2: _LightTextureB0 (high 2d) 0x0 [-1]
-// #3: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-in.txt
deleted file mode 100644
index 4e2fc16603a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-in.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- lightDir = IN.lightDir;
- c = LightingLambert( o, lightDir, 1.00000);
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-out.txt
deleted file mode 100644
index 7c36831db48..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse-out.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 c_2;
- float tmpvar_3;
- vec4 c_4;
- c_4 = (texture2D (_MainTex, tmpvar_1.xy) * _Color);
- tmpvar_3 = c_4.w;
- vec4 normal_5;
- normal_5.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_5.z = sqrt(((1.0 -
- (normal_5.x * normal_5.x)
- ) - (normal_5.y * normal_5.y)));
- float x_6;
- x_6 = (c_4.w - _Cutoff);
- if ((x_6 < 0.0)) {
- discard;
- };
- vec4 c_7;
- c_7.xyz = ((c_4.xyz * _LightColor0.xyz) * (max (0.0,
- dot (normal_5.xyz, gl_TexCoord[1].xyz)
- ) * 2.0));
- c_7.w = tmpvar_3;
- c_2.xyz = c_7.xyz;
- c_2.w = tmpvar_3;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 15 alu 3 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: _LightColor0 (high float) 4x1 [-1]
-// textures: 2
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-in.txt
deleted file mode 100644
index 43ee94fa4bd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-in.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingLambert_PrePass( in SurfaceOutput s, in vec4 light ) {
- vec4 c;
- c.xyz = (s.Albedo * light.xyz );
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingLambert_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt
deleted file mode 100644
index 8e834b2b142..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 light_1;
- vec4 c_2;
- c_2 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
- float x_3;
- x_3 = (c_2.w - _Cutoff);
- if ((x_3 < 0.0)) {
- discard;
- };
- light_1 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_1.xyz = (light_1.xyz + unity_Ambient.xyz);
- vec4 c_4;
- c_4.xyz = (c_2.xyz * light_1.xyz);
- c_4.w = c_2.w;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 7 alu 3 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: unity_Ambient (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-in.txt
deleted file mode 100644
index 7c46c068fad..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-in.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- vec4 hip_pack0;
- vec3 TtoV0;
- vec3 TtoV1;
- vec3 TtoV2;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 viewN;
- vec4 res;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.uv_BumpMap = IN.hip_pack0.zw ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- viewN.x = dot( IN.TtoV0, o.Normal);
- viewN.y = dot( IN.TtoV1, o.Normal);
- viewN.z = dot( IN.TtoV2, o.Normal);
- o.Normal = viewN;
- res.xyz = ((o.Normal * vec3( 0.500000, 0.500000, -0.500000)) + 0.500000);
- res.w = o.Specular;
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.hip_pack0 = vec4( gl_TexCoord[0]);
- xlt_IN.TtoV0 = vec3( gl_TexCoord[1]);
- xlt_IN.TtoV1 = vec3( gl_TexCoord[2]);
- xlt_IN.TtoV2 = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-out.txt
deleted file mode 100644
index f4d18d8b132..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular-out.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0];
- vec4 res_2;
- vec3 viewN_3;
- vec4 normal_4;
- normal_4.xy = ((texture2D (_BumpMap, tmpvar_1.zw).wy * 2.0) - 1.0);
- normal_4.z = sqrt(((1.0 -
- (normal_4.x * normal_4.x)
- ) - (normal_4.y * normal_4.y)));
- float x_5;
- x_5 = ((texture2D (_MainTex, tmpvar_1.xy).w * _Color.w) - _Cutoff);
- if ((x_5 < 0.0)) {
- discard;
- };
- viewN_3.x = dot (gl_TexCoord[1].xyz, normal_4.xyz);
- viewN_3.y = dot (gl_TexCoord[2].xyz, normal_4.xyz);
- viewN_3.z = dot (gl_TexCoord[3].xyz, normal_4.xyz);
- res_2.xyz = ((viewN_3 * vec3(0.5, 0.5, -0.5)) + 0.5);
- res_2.w = _Shininess;
- gl_FragData[0] = res_2;
-}
-
-
-// stats: 15 alu 3 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: _Shininess (high float) 1x1 [-1]
-// textures: 2
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-in.txt
deleted file mode 100644
index 4b96e3b82d5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-in.txt
+++ /dev/null
@@ -1,107 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-uniform vec4 unity_Ambient;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_BumpMap)));
-}
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light ) {
- float spec;
- vec4 c;
- spec = (light.w * s.Gloss);
- c.xyz = ((s.Albedo * light.xyz ) + ((light.xyz * _SpecColor.xyz ) * spec));
- c.w = (s.Alpha + (spec * _SpecColor.w ));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- light.xyz += unity_Ambient.xyz ;
- col = LightingBlinnPhong_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-out.txt
deleted file mode 100644
index b7d4f814265..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Bumped_Specular1-out.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _SpecColor;
-uniform vec4 unity_Ambient;
-void main ()
-{
- vec4 light_1;
- float tmpvar_2;
- vec4 tmpvar_3;
- tmpvar_3 = texture2D (_MainTex, gl_TexCoord[0].xy);
- tmpvar_2 = (tmpvar_3.w * _Color.w);
- float x_4;
- x_4 = (tmpvar_2 - _Cutoff);
- if ((x_4 < 0.0)) {
- discard;
- };
- light_1 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_1.xyz = (light_1.xyz + unity_Ambient.xyz);
- vec4 c_5;
- float spec_6;
- spec_6 = (light_1.w * tmpvar_3.w);
- c_5.xyz = (((tmpvar_3.xyz * _Color.xyz) * light_1.xyz) + ((light_1.xyz * _SpecColor.xyz) * spec_6));
- c_5.w = (tmpvar_2 + (spec_6 * _SpecColor.w));
- gl_FragData[0] = c_5;
-}
-
-
-// stats: 14 alu 3 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [2] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: _SpecColor (high float) 4x1 [-1]
-// #3: unity_Ambient (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-in.txt
deleted file mode 100644
index 3aad0f78320..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-in.txt
+++ /dev/null
@@ -1,107 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-float UnitySpotCookie( in vec4 LightCoord );
-float UnitySpotAttenuate( in vec3 LightCoord );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-float UnitySpotCookie( in vec4 LightCoord ) {
- return texture2D( _LightTexture0, ((LightCoord.xy / LightCoord.w ) + 0.500000)).w ;
-}
-float UnitySpotAttenuate( in vec3 LightCoord ) {
- return texture2D( _LightTextureB0, vec2( vec2( dot( LightCoord, LightCoord)))).w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, ((float( (IN._LightCoord.z > 0.000000) ) * UnitySpotCookie( IN._LightCoord)) * UnitySpotAttenuate( IN._LightCoord.xyz )));
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec4( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-out.txt
deleted file mode 100644
index d8a3d4d56c3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Diffuse-out.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1 = gl_TexCoord[3];
- vec4 c_2;
- float tmpvar_3;
- vec4 c_4;
- c_4 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
- tmpvar_3 = c_4.w;
- float x_5;
- x_5 = (c_4.w - _Cutoff);
- if ((x_5 < 0.0)) {
- discard;
- };
- vec4 c_6;
- c_6.xyz = ((c_4.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz)))
- *
- ((float((tmpvar_1.z > 0.0)) * texture2D (_LightTexture0, ((tmpvar_1.xy / tmpvar_1.w) + 0.5)).w) * texture2D (_LightTextureB0, vec2(dot (tmpvar_1.xyz, tmpvar_1.xyz))).w)
- ) * 2.0));
- c_6.w = tmpvar_3;
- c_2.xyz = c_6.xyz;
- c_2.w = tmpvar_3;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 17 alu 4 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: _LightColor0 (high float) 4x1 [-1]
-// textures: 3
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _LightTextureB0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-in.txt
deleted file mode 100644
index fef6a9fdd2d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-in.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 viewDir;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- lightDir = IN.lightDir;
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), 1.00000);
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN.viewDir = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-out.txt
deleted file mode 100644
index 10445ee9783..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular-out.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[1].xyz;
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[2].xyz;
- vec4 c_3;
- float tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, gl_TexCoord[0].xy);
- tmpvar_4 = (tmpvar_5.w * _Color.w);
- float x_6;
- x_6 = (tmpvar_4 - _Cutoff);
- if ((x_6 < 0.0)) {
- discard;
- };
- vec4 c_7;
- float spec_8;
- spec_8 = (pow (max (0.0,
- dot (tmpvar_1, normalize((tmpvar_2 + normalize(gl_TexCoord[3].xyz))))
- ), (_Shininess * 128.0)) * tmpvar_5.w);
- c_7.xyz = (((
- ((tmpvar_5.xyz * _Color.xyz) * _LightColor0.xyz)
- *
- max (0.0, dot (tmpvar_1, tmpvar_2))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_8)) * 2.0);
- c_7.w = (tmpvar_4 + ((_LightColor0.w * _SpecColor.w) * spec_8));
- c_3.xyz = c_7.xyz;
- c_3.w = tmpvar_4;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 23 alu 2 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 5 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: _LightColor0 (high float) 4x1 [-1]
-// #3: _Shininess (high float) 1x1 [-1]
-// #4: _SpecColor (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-in.txt
deleted file mode 100644
index bfe4c547be5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-in.txt
+++ /dev/null
@@ -1,111 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 viewDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), (texture2D( _LightTextureB0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w * textureCube( _LightTexture0, IN._LightCoord).w ));
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN.viewDir = vec3( gl_TexCoord[3]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[4]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-out.txt
deleted file mode 100644
index 57cea66fc4c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular1-out.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[1].xyz;
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[4].xyz;
- vec4 c_3;
- float tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, gl_TexCoord[0].xy);
- tmpvar_4 = (tmpvar_5.w * _Color.w);
- float x_6;
- x_6 = (tmpvar_4 - _Cutoff);
- if ((x_6 < 0.0)) {
- discard;
- };
- vec3 tmpvar_7;
- tmpvar_7 = normalize(gl_TexCoord[2].xyz);
- float atten_8;
- atten_8 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w);
- vec4 c_9;
- float spec_10;
- spec_10 = (pow (max (0.0,
- dot (tmpvar_1, normalize((tmpvar_7 + normalize(gl_TexCoord[3].xyz))))
- ), (_Shininess * 128.0)) * tmpvar_5.w);
- c_9.xyz = (((
- ((tmpvar_5.xyz * _Color.xyz) * _LightColor0.xyz)
- *
- max (0.0, dot (tmpvar_1, tmpvar_7))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_10)) * (atten_8 * 2.0));
- c_9.w = (tmpvar_4 + ((_LightColor0.w * _SpecColor.w) * (spec_10 * atten_8)));
- c_3.xyz = c_9.xyz;
- c_3.w = tmpvar_4;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 28 alu 4 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// uniforms: 5 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: _LightColor0 (high float) 4x1 [-1]
-// #3: _Shininess (high float) 1x1 [-1]
-// #4: _SpecColor (high float) 4x1 [-1]
-// textures: 3
-// #0: _LightTexture0 (high cube) 0x0 [-1]
-// #1: _LightTextureB0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-in.txt
deleted file mode 100644
index eaa50c2a3d9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-in.txt
+++ /dev/null
@@ -1,131 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light );
-vec3 DecodeLightmap( in vec4 color );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
-}
-vec4 LightingBlinnPhong_PrePass( in SurfaceOutput s, in vec4 light ) {
- float spec;
- vec4 c;
- spec = (light.w * s.Gloss);
- c.xyz = ((s.Albedo * light.xyz ) + ((light.xyz * _SpecColor.xyz ) * spec));
- c.w = (s.Alpha + (spec * _SpecColor.w ));
- return c;
-}
-vec3 DecodeLightmap( in vec4 color ) {
- return (2.00000 * color.xyz );
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec4 light;
- vec3 lmFull;
- vec3 lmIndirect;
- vec3 lm;
- vec4 col;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- light = texture2DProj( _LightBuffer, IN.hip_screen);
- light = ( -log2( light ) );
- lmFull = DecodeLightmap( texture2D( unity_Lightmap, IN.hip_lmapFade.xy ));
- lmIndirect = DecodeLightmap( texture2D( unity_LightmapInd, IN.hip_lmapFade.xy ));
- lm = mix( lmIndirect, lmFull, vec3( xll_saturate( IN.hip_lmapFade.z )));
- light.xyz += lm;
- col = LightingBlinnPhong_PrePass( o, light);
- return col;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.hip_screen = vec4( gl_TexCoord[1]);
- xlt_IN.hip_lmapFade = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-out.txt
deleted file mode 100644
index 1ec0d4a0fdb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Cutout_Specular2-out.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-uniform vec4 _Color;
-uniform float _Cutoff;
-uniform sampler2D _LightBuffer;
-uniform sampler2D _MainTex;
-uniform vec4 _SpecColor;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[2].xyz;
- vec4 light_2;
- float tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_MainTex, gl_TexCoord[0].xy);
- tmpvar_3 = (tmpvar_4.w * _Color.w);
- float x_5;
- x_5 = (tmpvar_3 - _Cutoff);
- if ((x_5 < 0.0)) {
- discard;
- };
- light_2 = -(log2(texture2DProj (_LightBuffer, gl_TexCoord[1])));
- light_2.xyz = (light_2.xyz + mix ((2.0 * texture2D (unity_LightmapInd, tmpvar_1.xy).xyz), (2.0 * texture2D (unity_Lightmap, tmpvar_1.xy).xyz), vec3(clamp (tmpvar_1.z, 0.0, 1.0))));
- vec4 c_6;
- float spec_7;
- spec_7 = (light_2.w * tmpvar_4.w);
- c_6.xyz = (((tmpvar_4.xyz * _Color.xyz) * light_2.xyz) + ((light_2.xyz * _SpecColor.xyz) * spec_7));
- c_6.w = (tmpvar_3 + (spec_7 * _SpecColor.w));
- gl_FragData[0] = c_6;
-}
-
-
-// stats: 18 alu 5 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: _SpecColor (high float) 4x1 [-1]
-// textures: 4
-// #0: _LightBuffer (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: unity_Lightmap (high 2d) 0x0 [-1]
-// #3: unity_LightmapInd (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-in.txt
deleted file mode 100644
index 23b2d6d3110..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-in.txt
+++ /dev/null
@@ -1,94 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = (texture2D( _MainTex, IN.uv_MainTex) * _Color);
- o.Albedo = c.xyz ;
- o.Alpha = c.w ;
-}
-vec4 LightingLambert( in SurfaceOutput s, in vec3 lightDir, in float atten ) {
- float diff;
- vec4 c;
- diff = max( 0.000000, dot( s.Normal, lightDir));
- c.xyz = ((s.Albedo * _LightColor0.xyz ) * ((diff * atten) * 2.00000));
- c.w = s.Alpha;
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingLambert( o, lightDir, (texture2D( _LightTextureB0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w * textureCube( _LightTexture0, IN._LightCoord).w ));
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-out.txt
deleted file mode 100644
index 7d9a98d5a65..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Diffuse-out.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[3].xyz;
- vec4 c_2;
- float tmpvar_3;
- vec4 c_4;
- c_4 = (texture2D (_MainTex, gl_TexCoord[0].xy) * _Color);
- tmpvar_3 = c_4.w;
- vec4 c_5;
- c_5.xyz = ((c_4.xyz * _LightColor0.xyz) * ((
- max (0.0, dot (gl_TexCoord[1].xyz, normalize(gl_TexCoord[2].xyz)))
- *
- (texture2D (_LightTextureB0, vec2(dot (tmpvar_1, tmpvar_1))).w * textureCube (_LightTexture0, tmpvar_1).w)
- ) * 2.0));
- c_5.w = tmpvar_3;
- c_2.xyz = c_5.xyz;
- c_2.w = tmpvar_3;
- gl_FragData[0] = c_2;
-}
-
-
-// stats: 10 alu 3 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 2 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// textures: 3
-// #0: _LightTexture0 (high cube) 0x0 [-1]
-// #1: _LightTextureB0 (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-in.txt
deleted file mode 100644
index 72f6765ed86..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-in.txt
+++ /dev/null
@@ -1,104 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 viewDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 tex;
- tex = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (tex.xyz * _Color.xyz );
- o.Gloss = tex.w ;
- o.Alpha = (tex.w * _Color.w );
- o.Specular = _Shininess;
-}
-vec4 LightingBlinnPhong( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + ((_LightColor0.xyz * _SpecColor.xyz ) * spec)) * (atten * 2.00000));
- c.w = (s.Alpha + (((_LightColor0.w * _SpecColor.w ) * spec) * atten));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- o.Normal = IN.normal;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingBlinnPhong( o, lightDir, normalize( vec3( IN.viewDir) ), (texture2D( _LightTexture0, IN._LightCoord).w * 1.00000));
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.normal = vec3( gl_TexCoord[1]);
- xlt_IN.lightDir = vec3( gl_TexCoord[2]);
- xlt_IN.viewDir = vec3( gl_TexCoord[3]);
- xlt_IN._LightCoord = vec2( gl_TexCoord[4]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-out.txt
deleted file mode 100644
index aef012342ae..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Transparent_Specular-out.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _LightColor0;
-uniform sampler2D _LightTexture0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _SpecColor;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = gl_TexCoord[1].xyz;
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[2].xyz;
- vec4 c_3;
- float tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, gl_TexCoord[0].xy);
- tmpvar_4 = (tmpvar_5.w * _Color.w);
- float atten_6;
- atten_6 = texture2D (_LightTexture0, gl_TexCoord[4].xy).w;
- vec4 c_7;
- float spec_8;
- spec_8 = (pow (max (0.0,
- dot (tmpvar_1, normalize((tmpvar_2 + normalize(gl_TexCoord[3].xyz))))
- ), (_Shininess * 128.0)) * tmpvar_5.w);
- c_7.xyz = (((
- ((tmpvar_5.xyz * _Color.xyz) * _LightColor0.xyz)
- *
- max (0.0, dot (tmpvar_1, tmpvar_2))
- ) + (
- (_LightColor0.xyz * _SpecColor.xyz)
- * spec_8)) * (atten_6 * 2.0));
- c_7.w = (tmpvar_4 + ((_LightColor0.w * _SpecColor.w) * (spec_8 * atten_6)));
- c_3.xyz = c_7.xyz;
- c_3.w = tmpvar_4;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 23 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Shininess (high float) 1x1 [-1]
-// #3: _SpecColor (high float) 4x1 [-1]
-// textures: 2
-// #0: _LightTexture0 (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-in.txt
deleted file mode 100644
index f6e77189c26..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-in.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec3 color;
- vec3 backContrib;
- vec3 nl;
- vec3 nh;
-};
-uniform sampler2D _BumpSpecMap;
-uniform float _Cutoff;
-uniform sampler2D _MainTex;
-uniform vec4 _SpecColor;
-uniform vec4 _TerrainTreeLightColors[4];
-uniform vec3 _TranslucencyColor;
-uniform sampler2D _TranslucencyMap;
-
-vec4 frag( in v2f i ) {
- vec4 col;
- vec3 albedo;
- float specular;
- vec4 trngls;
- float gloss;
- vec3 light;
- vec3 backContribs;
- int j = 0;
- vec3 lightColor;
- vec3 translucencyColor;
- float nl;
- float nh;
- float spec;
- vec4 c;
- col = texture2D( _MainTex, i.uv);
- xll_clip( (col.w - _Cutoff) );
- albedo = (col.xyz * i.color);
- specular = (texture2D( _BumpSpecMap, i.uv).x * 128.000);
- trngls = texture2D( _TranslucencyMap, i.uv);
- gloss = trngls.w ;
- light = (vec3( gl_LightModel.ambient) * albedo);
- backContribs = (i.backContrib * trngls.z );
- for ( ; (j < 3); ( j++ )) {
- lightColor = _TerrainTreeLightColors[ j ].xyz ;
- translucencyColor = (backContribs[ j ] * _TranslucencyColor);
- nl = i.nl[ j ];
- nh = i.nh[ j ];
- spec = (pow( nh, specular) * gloss);
- light += (((albedo * (translucencyColor + nl)) + (_SpecColor.xyz * spec)) * lightColor);
- }
- c.xyz = (light * 2.00000);
- c.w = 1.00000;
- return c;
-}
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xlt_i.color = vec3( gl_TexCoord[1]);
- xlt_i.backContrib = vec3( gl_TexCoord[2]);
- xlt_i.nl = vec3( gl_TexCoord[3]);
- xlt_i.nh = vec3( gl_TexCoord[4]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-out.txt
deleted file mode 100644
index 5e6420a9a82..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-TreeCreatorLeavesRT-out.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-uniform sampler2D _BumpSpecMap;
-uniform float _Cutoff;
-uniform sampler2D _MainTex;
-uniform vec4 _SpecColor;
-uniform vec4 _TerrainTreeLightColors[4];
-uniform vec3 _TranslucencyColor;
-uniform sampler2D _TranslucencyMap;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec3 tmpvar_2;
- vec3 tmpvar_3;
- tmpvar_2 = gl_TexCoord[3].xyz;
- tmpvar_3 = gl_TexCoord[4].xyz;
- vec4 c_4;
- vec3 backContribs_5;
- vec3 light_6;
- float specular_7;
- vec3 albedo_8;
- vec4 tmpvar_9;
- tmpvar_9 = texture2D (_MainTex, tmpvar_1);
- float x_10;
- x_10 = (tmpvar_9.w - _Cutoff);
- if ((x_10 < 0.0)) {
- discard;
- };
- albedo_8 = (tmpvar_9.xyz * gl_TexCoord[1].xyz);
- specular_7 = (texture2D (_BumpSpecMap, tmpvar_1).x * 128.0);
- vec4 tmpvar_11;
- tmpvar_11 = texture2D (_TranslucencyMap, tmpvar_1);
- light_6 = (gl_LightModel.ambient.xyz * albedo_8);
- backContribs_5 = (gl_TexCoord[2].xyz * tmpvar_11.z);
- light_6 = (light_6 + ((
- (albedo_8 * ((backContribs_5.x * _TranslucencyColor) + tmpvar_2.x))
- +
- (_SpecColor.xyz * (pow (tmpvar_3.x, specular_7) * tmpvar_11.w))
- ) * _TerrainTreeLightColors[0].xyz));
- light_6 = (light_6 + ((
- (albedo_8 * ((backContribs_5.y * _TranslucencyColor) + tmpvar_2.y))
- +
- (_SpecColor.xyz * (pow (tmpvar_3.y, specular_7) * tmpvar_11.w))
- ) * _TerrainTreeLightColors[1].xyz));
- light_6 = (light_6 + ((
- (albedo_8 * ((backContribs_5.z * _TranslucencyColor) + tmpvar_2.z))
- +
- (_SpecColor.xyz * (pow (tmpvar_3.z, specular_7) * tmpvar_11.w))
- ) * _TerrainTreeLightColors[2].xyz));
- c_4.xyz = (light_6 * 2.0);
- c_4.w = 1.0;
- gl_FragData[0] = c_4;
-}
-
-
-// stats: 35 alu 4 tex 1 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [5] loc 4
-// uniforms: 5 (total size: 0)
-// #0: gl_LightModel (high other) 0x0 [-1]
-// #1: _Cutoff (high float) 1x1 [-1]
-// #2: _SpecColor (high float) 4x1 [-1]
-// #3: _TerrainTreeLightColors (high float) 4x1 [4]
-// #4: _TranslucencyColor (high float) 3x1 [-1]
-// textures: 3
-// #0: _BumpSpecMap (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
-// #2: _TranslucencyMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-in.txt
deleted file mode 100644
index 1060b0f492c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-in.txt
+++ /dev/null
@@ -1,120 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _GlossMap;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingTreeBark( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (c.xyz * IN.color.xyz );
- o.Gloss = texture2D( _GlossMap, IN.uv_MainTex).w ;
- o.Alpha = _Color.w ;
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_MainTex)));
-}
-vec4 LightingTreeBark( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + (_LightColor0.xyz * spec)) * (atten * 2.00000));
- c.w = (((_LightColor0.w * spec) * atten) * s.Alpha);
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- c = LightingTreeBark( o, lightDir, normalize( vec3( IN.viewDir) ), 1.00000);
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lop_color = vec4( gl_Color);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN.viewDir = vec3( gl_TexCoord[2]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-out.txt
deleted file mode 100644
index 198989055c1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader-out.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _GlossMap;
-uniform vec4 _LightColor0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[1].xyz;
- vec4 c_3;
- vec4 normal_4;
- normal_4.xy = ((texture2D (_BumpMap, tmpvar_1).wy * 2.0) - 1.0);
- normal_4.z = sqrt(((1.0 -
- (normal_4.x * normal_4.x)
- ) - (normal_4.y * normal_4.y)));
- vec4 c_5;
- float spec_6;
- spec_6 = (pow (max (0.0,
- dot (normal_4.xyz, normalize((tmpvar_2 + normalize(gl_TexCoord[2].xyz))))
- ), (_Shininess * 128.0)) * texture2D (_GlossMap, tmpvar_1).w);
- c_5.xyz = (((
- ((texture2D (_MainTex, tmpvar_1).xyz * gl_Color.xyz) * _LightColor0.xyz)
- *
- max (0.0, dot (normal_4.xyz, tmpvar_2))
- ) + (_LightColor0.xyz * spec_6)) * 2.0);
- c_5.w = ((_LightColor0.w * spec_6) * _Color.w);
- c_3.xyz = c_5.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 26 alu 3 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [3] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Shininess (high float) 1x1 [-1]
-// textures: 3
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _GlossMap (high 2d) 0x0 [-1]
-// #2: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-in.txt
deleted file mode 100644
index 98070bde405..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-in.txt
+++ /dev/null
@@ -1,125 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
- vec3 _LightCoord;
-};
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _GlossMap;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout SurfaceOutput o );
-vec4 LightingTreeBark( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout SurfaceOutput o ) {
- vec4 c;
- c = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (c.xyz * IN.color.xyz );
- o.Gloss = texture2D( _GlossMap, IN.uv_MainTex).w ;
- o.Alpha = _Color.w ;
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_MainTex)));
-}
-vec4 LightingTreeBark( in SurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = max( 0.000000, dot( s.Normal, lightDir));
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- c.xyz = ((((s.Albedo * _LightColor0.xyz ) * diff) + (_LightColor0.xyz * spec)) * (atten * 2.00000));
- c.w = (((_LightColor0.w * spec) * atten) * s.Alpha);
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- SurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- o.Gloss = 0.000000;
- surf( surfIN, o);
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingTreeBark( o, lightDir, normalize( vec3( IN.viewDir) ), (texture2D( _LightTextureB0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w * textureCube( _LightTexture0, IN._LightCoord).w ));
- c.w = 0.000000;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lop_color = vec4( gl_Color);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN.viewDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-out.txt
deleted file mode 100644
index 7564e87827c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Bark_Shader1-out.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform vec4 _Color;
-uniform sampler2D _GlossMap;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[3].xyz;
- vec4 c_3;
- vec4 normal_4;
- normal_4.xy = ((texture2D (_BumpMap, tmpvar_1).wy * 2.0) - 1.0);
- normal_4.z = sqrt(((1.0 -
- (normal_4.x * normal_4.x)
- ) - (normal_4.y * normal_4.y)));
- vec3 tmpvar_5;
- tmpvar_5 = normalize(gl_TexCoord[1].xyz);
- float atten_6;
- atten_6 = (texture2D (_LightTextureB0, vec2(dot (tmpvar_2, tmpvar_2))).w * textureCube (_LightTexture0, tmpvar_2).w);
- vec4 c_7;
- float spec_8;
- spec_8 = (pow (max (0.0,
- dot (normal_4.xyz, normalize((tmpvar_5 + normalize(gl_TexCoord[2].xyz))))
- ), (_Shininess * 128.0)) * texture2D (_GlossMap, tmpvar_1).w);
- c_7.xyz = (((
- ((texture2D (_MainTex, tmpvar_1).xyz * gl_Color.xyz) * _LightColor0.xyz)
- *
- max (0.0, dot (normal_4.xyz, tmpvar_5))
- ) + (_LightColor0.xyz * spec_8)) * (atten_6 * 2.0));
- c_7.w = ((_LightColor0.w * spec_8) * (atten_6 * _Color.w));
- c_3.xyz = c_7.xyz;
- c_3.w = 0.0;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 31 alu 5 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 3 (total size: 0)
-// #0: _Color (high float) 4x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Shininess (high float) 1x1 [-1]
-// textures: 5
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _GlossMap (high 2d) 0x0 [-1]
-// #2: _LightTexture0 (high cube) 0x0 [-1]
-// #3: _LightTextureB0 (high 2d) 0x0 [-1]
-// #4: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-in.txt
deleted file mode 100644
index 137dd9847fc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-in.txt
+++ /dev/null
@@ -1,160 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
- vec3 _LightCoord;
-};
-uniform sampler2D _BumpMap;
-uniform float _Cutoff;
-uniform sampler2D _GlossMap;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _TranslucencyColor;
-uniform sampler2D _TranslucencyMap;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout LeafSurfaceOutput o );
-vec4 LightingTreeLeaf( in LeafSurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout LeafSurfaceOutput o ) {
- vec4 c;
- c = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (c.xyz * IN.color.xyz );
- o.Translucency = (texture2D( _TranslucencyMap, IN.uv_MainTex).xyz * vec3( _TranslucencyColor));
- o.Gloss = texture2D( _GlossMap, IN.uv_MainTex).w ;
- o.Alpha = (c.w * IN.color.w );
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_MainTex)));
-}
-vec4 LightingTreeLeaf( in LeafSurfaceOutput s, in vec3 lightDir, in vec3 viewDir, in float atten ) {
- vec3 h;
- float diff;
- float nh;
- float spec;
- float trans;
- vec3 translucencyColor;
- vec3 col;
- vec4 c;
- h = normalize( (lightDir + viewDir) );
- diff = dot( s.Normal, lightDir);
- nh = max( 0.000000, dot( s.Normal, h));
- spec = (pow( nh, (s.Specular * 128.000)) * s.Gloss);
- trans = max( 0.000000, ( -diff ));
- translucencyColor = ((s.Translucency * trans) * 2.00000);
- diff = max( 0.000000, ((diff * 0.500000) + 0.500000));
- col = (s.Albedo * (diff + translucencyColor));
- col += (spec * (1.00000 - xll_saturate( ceil( trans ) )));
- col *= _LightColor0.xyz ;
- c.xyz = (col * (atten * 2.00000));
- return c;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- LeafSurfaceOutput o;
- vec3 lightDir;
- vec4 c;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- lightDir = IN.lightDir;
- lightDir = normalize( lightDir );
- c = LightingTreeLeaf( o, lightDir, normalize( vec3( IN.viewDir) ), (texture2D( _LightTextureB0, vec2( vec2( dot( IN._LightCoord, IN._LightCoord)))).w * textureCube( _LightTexture0, IN._LightCoord).w ));
- c.w = o.Alpha;
- return c;
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN.fog = float( xlv_FOG);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[0]);
- xlt_IN.lop_color = vec4( gl_Color);
- xlt_IN.lightDir = vec3( gl_TexCoord[1]);
- xlt_IN.viewDir = vec3( gl_TexCoord[2]);
- xlt_IN._LightCoord = vec3( gl_TexCoord[3]);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-out.txt
deleted file mode 100644
index ca33c04cc03..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader-out.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-uniform sampler2D _BumpMap;
-uniform float _Cutoff;
-uniform sampler2D _GlossMap;
-uniform vec4 _LightColor0;
-uniform samplerCube _LightTexture0;
-uniform sampler2D _LightTextureB0;
-uniform sampler2D _MainTex;
-uniform float _Shininess;
-uniform vec4 _TranslucencyColor;
-uniform sampler2D _TranslucencyMap;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec3 tmpvar_2;
- tmpvar_2 = gl_TexCoord[3].xyz;
- vec4 c_3;
- float tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, tmpvar_1);
- tmpvar_4 = (tmpvar_5.w * gl_Color.w);
- vec4 normal_6;
- normal_6.xy = ((texture2D (_BumpMap, tmpvar_1).wy * 2.0) - 1.0);
- normal_6.z = sqrt(((1.0 -
- (normal_6.x * normal_6.x)
- ) - (normal_6.y * normal_6.y)));
- float x_7;
- x_7 = (tmpvar_4 - _Cutoff);
- if ((x_7 < 0.0)) {
- discard;
- };
- vec3 tmpvar_8;
- tmpvar_8 = normalize(gl_TexCoord[1].xyz);
- vec4 c_9;
- vec3 col_10;
- float tmpvar_11;
- tmpvar_11 = dot (normal_6.xyz, tmpvar_8);
- float tmpvar_12;
- tmpvar_12 = max (0.0, -(tmpvar_11));
- col_10 = ((tmpvar_5.xyz * gl_Color.xyz) * (max (0.0,
- ((tmpvar_11 * 0.5) + 0.5)
- ) + (
- (texture2D (_TranslucencyMap, tmpvar_1).xyz * _TranslucencyColor.xyz)
- *
- (tmpvar_12 * 2.0)
- )));
- col_10 = (col_10 + ((
- pow (max (0.0, dot (normal_6.xyz, normalize(
- (tmpvar_8 + normalize(gl_TexCoord[2].xyz))
- ))), (_Shininess * 128.0))
- * texture2D (_GlossMap, tmpvar_1).w) * (1.0 -
- clamp (ceil(tmpvar_12), 0.0, 1.0)
- )));
- col_10 = (col_10 * _LightColor0.xyz);
- c_9.xyz = (col_10 * ((texture2D (_LightTextureB0, vec2(
- dot (tmpvar_2, tmpvar_2)
- )).w * textureCube (_LightTexture0, tmpvar_2).w) * 2.0));
- c_3.xyz = c_9.xyz;
- c_3.w = tmpvar_4;
- gl_FragData[0] = c_3;
-}
-
-
-// stats: 41 alu 7 tex 1 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [4] loc 4
-// uniforms: 4 (total size: 0)
-// #0: _Cutoff (high float) 1x1 [-1]
-// #1: _LightColor0 (high float) 4x1 [-1]
-// #2: _Shininess (high float) 1x1 [-1]
-// #3: _TranslucencyColor (high float) 4x1 [-1]
-// textures: 6
-// #0: _BumpMap (high 2d) 0x0 [-1]
-// #1: _GlossMap (high 2d) 0x0 [-1]
-// #2: _LightTexture0 (high cube) 0x0 [-1]
-// #3: _LightTextureB0 (high 2d) 0x0 [-1]
-// #4: _MainTex (high 2d) 0x0 [-1]
-// #5: _TranslucencyMap (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-in.txt
deleted file mode 100644
index e6bddbf0116..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-in.txt
+++ /dev/null
@@ -1,162 +0,0 @@
-void xll_clip(float x) {
- if ( x<0.0 ) discard;
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 _ShadowCoord0;
- vec3 _ShadowCoord1;
- vec3 _ShadowCoord2;
- vec3 _ShadowCoord3;
- vec2 _ShadowZFade;
- vec2 hip_pack0;
- vec4 lop_color;
-};
-uniform sampler2D _BumpMap;
-uniform float _Cutoff;
-uniform sampler2D _GlossMap;
-uniform vec4 _LightShadowData;
-uniform vec4 _LightSplitsFar;
-uniform vec4 _LightSplitsNear;
-uniform sampler2D _MainTex;
-uniform vec4 _ProjectionParams;
-uniform sampler2D _ShadowMapTexture;
-uniform float _Shininess;
-uniform vec4 _TranslucencyColor;
-uniform sampler2D _TranslucencyMap;
-vec4 UnpackNormal( in vec4 packednormal );
-void surf( in Input IN, inout LeafSurfaceOutput o );
-vec2 EncodeFloatRG( in float v );
-vec4 frag_surf( in v2f_surf IN );
-vec4 UnpackNormal( in vec4 packednormal ) {
- vec4 normal;
- normal.xy = ((packednormal.wy * 2.00000) - 1.00000);
- normal.z = sqrt( ((1.00000 - (normal.x * normal.x )) - (normal.y * normal.y )) );
- return normal;
-}
-void surf( in Input IN, inout LeafSurfaceOutput o ) {
- vec4 c;
- c = texture2D( _MainTex, IN.uv_MainTex);
- o.Albedo = (c.xyz * IN.color.xyz );
- o.Translucency = (texture2D( _TranslucencyMap, IN.uv_MainTex).xyz * vec3( _TranslucencyColor));
- o.Gloss = texture2D( _GlossMap, IN.uv_MainTex).w ;
- o.Alpha = (c.w * IN.color.w );
- o.Specular = _Shininess;
- o.Normal = vec3( UnpackNormal( texture2D( _BumpMap, IN.uv_MainTex)));
-}
-vec2 EncodeFloatRG( in float v ) {
- vec2 kEncodeMul = vec2( 1.00000, 255.000);
- float kEncodeBit = 0.00392157;
- vec2 enc;
- enc = (kEncodeMul * v);
- enc = fract( enc );
- enc.x -= (enc.y * kEncodeBit);
- return enc;
-}
-vec4 frag_surf( in v2f_surf IN ) {
- Input surfIN;
- LeafSurfaceOutput o;
- vec4 z;
- vec4 near;
- vec4 far;
- vec4 weights;
- vec4 coord;
- float shadow;
- float faded;
- vec4 res;
- surfIN.uv_MainTex = IN.hip_pack0.xy ;
- surfIN.color = IN.lop_color;
- o.Albedo = vec3( 0.000000);
- o.Emission = vec3( 0.000000);
- o.Specular = 0.000000;
- o.Alpha = 0.000000;
- surf( surfIN, o);
- xll_clip( (o.Alpha - _Cutoff) );
- z = vec4( IN._ShadowZFade.x );
- near = vec4( greaterThanEqual( z, _LightSplitsNear) );
- far = vec4( lessThan( z, _LightSplitsFar) );
- weights = (near * far);
- coord = vec4( ((((IN._ShadowCoord0 * weights.x ) + (IN._ShadowCoord1 * weights.y )) + (IN._ShadowCoord2 * weights.z )) + (IN._ShadowCoord3 * weights.w )), 1.00000);
- shadow = ( (texture2D( _ShadowMapTexture, coord.xy ).x < coord.z ) ) ? ( _LightShadowData.x ) : ( 1.00000 );
- faded = xll_saturate( (shadow + xll_saturate( IN._ShadowZFade.y )) );
- res.x = faded;
- res.y = 1.00000;
- res.zw = EncodeFloatRG( float( (1.00000 - (z * _ProjectionParams.w ))));
- return res;
-}
-void main() {
- vec4 xl_retval;
- v2f_surf xlt_IN;
- xlt_IN.pos = vec4(0.0);
- xlt_IN._ShadowCoord0 = vec3( gl_TexCoord[0]);
- xlt_IN._ShadowCoord1 = vec3( gl_TexCoord[1]);
- xlt_IN._ShadowCoord2 = vec3( gl_TexCoord[2]);
- xlt_IN._ShadowCoord3 = vec3( gl_TexCoord[3]);
- xlt_IN._ShadowZFade = vec2( gl_TexCoord[4]);
- xlt_IN.hip_pack0 = vec2( gl_TexCoord[5]);
- xlt_IN.lop_color = vec4( gl_Color);
- xl_retval = frag_surf( xlt_IN);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-out.txt
deleted file mode 100644
index 1adf41cc9fe..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Tree_Editor_Leaf_Shader1-out.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-uniform float _Cutoff;
-uniform vec4 _LightShadowData;
-uniform vec4 _LightSplitsFar;
-uniform vec4 _LightSplitsNear;
-uniform sampler2D _MainTex;
-uniform vec4 _ProjectionParams;
-uniform sampler2D _ShadowMapTexture;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[4].xy;
- vec4 res_2;
- vec4 weights_3;
- float x_4;
- x_4 = ((texture2D (_MainTex, gl_TexCoord[5].xy).w * gl_Color.w) - _Cutoff);
- if ((x_4 < 0.0)) {
- discard;
- };
- weights_3 = (vec4(greaterThanEqual (tmpvar_1.xxxx, _LightSplitsNear)) * vec4(lessThan (tmpvar_1.xxxx, _LightSplitsFar)));
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = (((
- (gl_TexCoord[0].xyz * weights_3.x)
- +
- (gl_TexCoord[1].xyz * weights_3.y)
- ) + (gl_TexCoord[2].xyz * weights_3.z)) + (gl_TexCoord[3].xyz * weights_3.w));
- vec4 tmpvar_6;
- tmpvar_6 = texture2D (_ShadowMapTexture, tmpvar_5.xy);
- float tmpvar_7;
- if ((tmpvar_6.x < tmpvar_5.z)) {
- tmpvar_7 = _LightShadowData.x;
- } else {
- tmpvar_7 = 1.0;
- };
- res_2.x = clamp ((tmpvar_7 + clamp (tmpvar_1.y, 0.0, 1.0)), 0.0, 1.0);
- res_2.y = 1.0;
- vec2 enc_8;
- enc_8 = (vec2(1.0, 255.0) * (1.0 - (tmpvar_1.xxxx * _ProjectionParams.w)).x);
- vec2 tmpvar_9;
- tmpvar_9 = fract(enc_8);
- enc_8.y = tmpvar_9.y;
- enc_8.x = (tmpvar_9.x - (tmpvar_9.y * 0.00392157));
- res_2.zw = enc_8;
- gl_FragData[0] = res_2;
-}
-
-
-// stats: 28 alu 3 tex 2 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [6] loc 4
-// uniforms: 5 (total size: 0)
-// #0: _Cutoff (high float) 1x1 [-1]
-// #1: _LightShadowData (high float) 4x1 [-1]
-// #2: _LightSplitsFar (high float) 4x1 [-1]
-// #3: _LightSplitsNear (high float) 4x1 [-1]
-// #4: _ProjectionParams (high float) 4x1 [-1]
-// textures: 2
-// #0: _MainTex (high 2d) 0x0 [-1]
-// #1: _ShadowMapTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-in.txt
deleted file mode 100644
index 14955aa62fc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-in.txt
+++ /dev/null
@@ -1,43 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- float fog;
- vec4 color;
- vec2 texcoord;
- vec3 normal;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec3 normal;
- vec2 texcoord;
-};
-uniform sampler2D _MainTex;
-vec4 frag( in v2f i );
-vec4 frag( in v2f i ) {
- return (i.color * texture2D( _MainTex, i.texcoord));
-}
-varying vec4 xlv_FOG;
-void main() {
- vec4 xl_retval;
- v2f xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.fog = float( xlv_FOG);
- xlt_i.color = vec4( gl_Color);
- xlt_i.texcoord = vec2( gl_TexCoord[0]);
- xlt_i.normal = vec3( gl_TexCoord[1]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-out.txt
deleted file mode 100644
index 37bcecb769b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Vertex_Colored-out.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- gl_FragData[0] = (gl_Color * texture2D (_MainTex, gl_TexCoord[0].xy));
-}
-
-
-// stats: 1 alu 1 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 1
-// #1: gl_TexCoord (high float) 4x1 [2] loc 4
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-in.txt
deleted file mode 100644
index 175bd11282d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-in.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-uniform vec4 _AdaptParams;
-uniform sampler2D _CurTex;
-uniform sampler2D _MainTex;
-vec4 frag( in v2f_img i );
-vec4 frag( in v2f_img i ) {
- vec2 valAdapted;
- vec2 valCur;
- vec2 delta;
- vec4 valNew;
- valAdapted = texture2D( _MainTex, i.uv).xy ;
- valCur = texture2D( _CurTex, i.uv).xy ;
- delta = ((valCur - valAdapted) * _AdaptParams.x );
- delta.x = (sign( delta.x ) * max( 0.00392157, abs( delta.x )));
- delta.y = (sign( delta.y ) * max( 0.00392157, abs( delta.y )));
- valNew.xy = (valAdapted + delta);
- valNew.x = max( valNew.x , _AdaptParams.z );
- valNew.y = min( valNew.y , _AdaptParams.y );
- valNew.z = ((valNew.x - valNew.y ) + 0.0100000);
- valNew.w = (valNew.y / valNew.z );
- return valNew;
-}
-void main() {
- vec4 xl_retval;
- v2f_img xlt_i;
- xlt_i.pos = vec4(0.0);
- xlt_i.uv = vec2( gl_TexCoord[0]);
- xl_retval = frag( xlt_i);
- gl_FragData[0] = vec4( xl_retval);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-out.txt
deleted file mode 100644
index 094bce528d8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-currently_adapted-out.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-uniform vec4 _AdaptParams;
-uniform sampler2D _CurTex;
-uniform sampler2D _MainTex;
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_TexCoord[0].xy;
- vec4 valNew_2;
- vec2 delta_3;
- vec4 tmpvar_4;
- tmpvar_4 = texture2D (_MainTex, tmpvar_1);
- delta_3 = ((texture2D (_CurTex, tmpvar_1).xy - tmpvar_4.xy) * _AdaptParams.x);
- delta_3 = (sign(delta_3) * max (vec2(0.00392157, 0.00392157), abs(delta_3)));
- valNew_2.xy = (tmpvar_4.xy + delta_3);
- valNew_2.x = max (valNew_2.x, _AdaptParams.z);
- valNew_2.y = min (valNew_2.y, _AdaptParams.y);
- valNew_2.z = ((valNew_2.x - valNew_2.y) + 0.01);
- valNew_2.w = (valNew_2.y / valNew_2.z);
- gl_FragData[0] = valNew_2;
-}
-
-
-// stats: 12 alu 2 tex 0 flow
-// inputs: 1
-// #0: gl_TexCoord (high float) 4x1 [1] loc 4
-// uniforms: 1 (total size: 0)
-// #0: _AdaptParams (high float) 4x1 [-1]
-// textures: 2
-// #0: _CurTex (high 2d) 0x0 [-1]
-// #1: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-in.txt
deleted file mode 100644
index 60192e0389a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-in.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-struct v2f {
- vec4 pos;
- vec2 uv;
-};
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_TexelSize;
-
-vec2 maxMag (in vec2 a, in vec2 b)
-{
- float ma;
- float mb;
- ma = dot(a, a);
- mb = dot(b, b);
- return mix (a, b, vec2(step(ma, mb)));
-}
-vec4 TileMax (in v2f i)
-{
- vec2 uvCorner;
- vec2 mx;
- vec2 v;
- uvCorner = i.uv;
- mx = vec2(texture2D( _MainTex, uvCorner));
- int j = 0;
- for ( ; (j < 8); (j++))
- {
- int l = 0;
- for ( ; (l < 8); (l++))
- {
- v = texture2D (_MainTex, (uvCorner + (vec2(float(l),float(j)) * _MainTex_TexelSize.xy))).xy;
- mx = maxMag(mx, v);
- }
- }
- return vec4(mx, 0.0, 0.0);
-}
-
-varying vec2 xlv_TEXCOORD0;
-
-void main()
-{
- vec4 c;
- v2f ii;
- ii.pos = vec4(0.0);
- ii.uv = xlv_TEXCOORD0;
- c = TileMax(ii);
- gl_FragData[0] = c;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-out.txt
deleted file mode 100644
index 983d1277132..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/fragment/zunity-MotionBlur-TileMax-out.txt
+++ /dev/null
@@ -1,105 +0,0 @@
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_TexelSize;
-varying vec2 xlv_TEXCOORD0;
-void main ()
-{
- vec2 mx_2;
- vec2 uvCorner_3;
- uvCorner_3 = xlv_TEXCOORD0;
- mx_2 = texture2D (_MainTex, xlv_TEXCOORD0).xy;
- for (int j_1 = 0; j_1 < 8; j_1++) {
- vec2 tmpvar_4;
- tmpvar_4.x = 0.0;
- tmpvar_4.y = float(j_1);
- vec4 tmpvar_5;
- tmpvar_5 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_4 * _MainTex_TexelSize.xy)));
- mx_2 = mix (mx_2, tmpvar_5.xy, vec2(float((
- dot (tmpvar_5.xy, tmpvar_5.xy)
- >=
- dot (mx_2, mx_2)
- ))));
- vec2 tmpvar_6;
- tmpvar_6.x = 1.0;
- tmpvar_6.y = float(j_1);
- vec4 tmpvar_7;
- tmpvar_7 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_6 * _MainTex_TexelSize.xy)));
- mx_2 = mix (mx_2, tmpvar_7.xy, vec2(float((
- dot (tmpvar_7.xy, tmpvar_7.xy)
- >=
- dot (mx_2, mx_2)
- ))));
- vec2 tmpvar_8;
- tmpvar_8.x = 2.0;
- tmpvar_8.y = float(j_1);
- vec4 tmpvar_9;
- tmpvar_9 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_8 * _MainTex_TexelSize.xy)));
- mx_2 = mix (mx_2, tmpvar_9.xy, vec2(float((
- dot (tmpvar_9.xy, tmpvar_9.xy)
- >=
- dot (mx_2, mx_2)
- ))));
- vec2 tmpvar_10;
- tmpvar_10.x = 3.0;
- tmpvar_10.y = float(j_1);
- vec4 tmpvar_11;
- tmpvar_11 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_10 * _MainTex_TexelSize.xy)));
- mx_2 = mix (mx_2, tmpvar_11.xy, vec2(float((
- dot (tmpvar_11.xy, tmpvar_11.xy)
- >=
- dot (mx_2, mx_2)
- ))));
- vec2 tmpvar_12;
- tmpvar_12.x = 4.0;
- tmpvar_12.y = float(j_1);
- vec4 tmpvar_13;
- tmpvar_13 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_12 * _MainTex_TexelSize.xy)));
- mx_2 = mix (mx_2, tmpvar_13.xy, vec2(float((
- dot (tmpvar_13.xy, tmpvar_13.xy)
- >=
- dot (mx_2, mx_2)
- ))));
- vec2 tmpvar_14;
- tmpvar_14.x = 5.0;
- tmpvar_14.y = float(j_1);
- vec4 tmpvar_15;
- tmpvar_15 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_14 * _MainTex_TexelSize.xy)));
- mx_2 = mix (mx_2, tmpvar_15.xy, vec2(float((
- dot (tmpvar_15.xy, tmpvar_15.xy)
- >=
- dot (mx_2, mx_2)
- ))));
- vec2 tmpvar_16;
- tmpvar_16.x = 6.0;
- tmpvar_16.y = float(j_1);
- vec4 tmpvar_17;
- tmpvar_17 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_16 * _MainTex_TexelSize.xy)));
- mx_2 = mix (mx_2, tmpvar_17.xy, vec2(float((
- dot (tmpvar_17.xy, tmpvar_17.xy)
- >=
- dot (mx_2, mx_2)
- ))));
- vec2 tmpvar_18;
- tmpvar_18.x = 7.0;
- tmpvar_18.y = float(j_1);
- vec4 tmpvar_19;
- tmpvar_19 = texture2D (_MainTex, (uvCorner_3 + (tmpvar_18 * _MainTex_TexelSize.xy)));
- mx_2 = mix (mx_2, tmpvar_19.xy, vec2(float((
- dot (tmpvar_19.xy, tmpvar_19.xy)
- >=
- dot (mx_2, mx_2)
- ))));
- };
- vec4 tmpvar_20;
- tmpvar_20.zw = vec2(0.0, 0.0);
- tmpvar_20.xy = mx_2;
- gl_FragData[0] = tmpvar_20;
-}
-
-
-// stats: 76 alu 9 tex 2 flow
-// inputs: 1
-// #0: xlv_TEXCOORD0 (high float) 2x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: _MainTex_TexelSize (high float) 4x1 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES.txt
deleted file mode 100644
index 5cebed77251..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-uniform highp float uni1;
-uniform mediump vec4 uni4;
-uniform sampler2D tex1;
-
-// global variables that aren't uniforms
-highp float mut_uni1;
-mediump vec4 mut_uni4;
-
-highp vec3 SampleDiffuse(in highp vec2 uv)
-{
- mut_uni4.xy = uv;
- return vec3(texture2D(tex1,mut_uni4.xy));
-}
-lowp vec4 xlat_main(in highp vec4 uv)
-{
- lowp vec4 c = vec4(0.0);
- c.x += mut_uni4.x;
- c.xyz += SampleDiffuse(uv.xy);
- c.z += mut_uni1;
- mut_uni1 += 2.0;
- c.w += mut_uni1;
- return c;
-}
-varying highp vec4 var_uv;
-void main()
-{
- mut_uni1 = uni1;
- mut_uni4 = uni4;
- lowp vec4 r = xlat_main(var_uv);
- gl_FragData[0] = r;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES3.txt
deleted file mode 100644
index 781c8087abf..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-inES3.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-#version 300 es
-
-uniform highp float uni1;
-uniform mediump vec4 uni4;
-uniform sampler2D tex1;
-uniform lowp vec4 unity_ColorSpaceDouble;
-uniform mediump vec3 _SkyTint;
-uniform mediump float _AtmosphereThickness;
-
-
-// global variables that aren't uniforms
-highp float mut_uni1;
-mediump vec4 mut_uni4;
-// global variables that are modified in complex chains of assignments/branches
-highp vec3 kSkyTintInGammaSpace;
-highp float kKrESun;
-highp float kKr4PI;
-
-
-highp vec3 SampleDiffuse(in highp vec2 uv)
-{
- mut_uni4.xy = uv;
- return vec3(texture(tex1, mut_uni4.xy));
-}
-lowp vec4 xlat_main(in highp vec4 uv)
-{
- lowp vec4 c = vec4(0.0);
- c.x += mut_uni4.x;
- c.xyz += SampleDiffuse(uv.xy);
- c.z += mut_uni1;
- mut_uni1 += 2.0;
- c.w += mut_uni1;
-
- mediump vec3 tmpvar_1;
- if ((unity_ColorSpaceDouble.x > 2.0)) {
- tmpvar_1 = pow (_SkyTint, vec3(0.454545, 0.454545, 0.454545));
- } else {
- tmpvar_1 = _SkyTint;
- };
- kSkyTintInGammaSpace = tmpvar_1;
- highp vec3 tmpvar_2;
- tmpvar_2 = (1.0/(pow (mix (vec3(0.5, 0.42, 0.325), vec3(0.8, 0.72, 0.625),
- (vec3(1.0, 1.0, 1.0) - kSkyTintInGammaSpace)
- ), vec3(4.0, 4.0, 4.0))));
- mediump float tmpvar_3;
- mediump float cse_4;
- cse_4 = pow (_AtmosphereThickness, 2.5);
- tmpvar_3 = (mix (0.0, 0.0025, cse_4) * 20.0);
- kKrESun = tmpvar_3;
- mediump float tmpvar_5;
- tmpvar_5 = (12.5664 * mix (0.0, 0.0025, cse_4));
- kKr4PI = tmpvar_5;
-
- if (uv.x > 0.5)
- {
- c.x += pow(kKrESun, kKr4PI);
- }
- return c;
-}
-in highp vec4 var_uv;
-out mediump vec4 out_data;
-void main()
-{
- mut_uni1 = uni1;
- mut_uni4 = uni4;
- lowp vec4 r = xlat_main(var_uv);
- out_data = r;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES.txt
deleted file mode 100644
index b9f081a3644..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform highp float uni1;
-uniform mediump vec4 uni4;
-uniform sampler2D tex1;
-highp float mut_uni1;
-mediump vec4 mut_uni4;
-varying highp vec4 var_uv;
-void main ()
-{
- mut_uni4.zw = uni4.zw;
- lowp vec4 c_1;
- c_1.yzw = vec3(0.0, 0.0, 0.0);
- c_1.x = uni4.x;
- highp vec3 tmpvar_2;
- highp vec2 uv_3;
- uv_3 = var_uv.xy;
- mut_uni4.xy = uv_3;
- lowp vec3 tmpvar_4;
- tmpvar_4 = texture2D (tex1, mut_uni4.xy).xyz;
- tmpvar_2 = tmpvar_4;
- c_1.xyz = (c_1.xyz + tmpvar_2);
- c_1.z = (c_1.z + uni1);
- mut_uni1 = (uni1 + 2.0);
- c_1.w = mut_uni1;
- gl_FragData[0] = c_1;
-}
-
-
-// stats: 4 alu 1 tex 0 flow
-// inputs: 1
-// #0: var_uv (high float) 4x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: uni1 (high float) 1x1 [-1]
-// #1: uni4 (medium float) 4x1 [-1]
-// textures: 1
-// #0: tex1 (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3.txt
deleted file mode 100644
index 8f6e58b3865..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-#version 300 es
-uniform highp float uni1;
-uniform mediump vec4 uni4;
-uniform sampler2D tex1;
-uniform mediump float _AtmosphereThickness;
-highp float mut_uni1;
-mediump vec4 mut_uni4;
-highp float kKrESun;
-highp float kKr4PI;
-in highp vec4 var_uv;
-out mediump vec4 out_data;
-void main ()
-{
- mut_uni4.zw = uni4.zw;
- mediump float tmpvar_5_1;
- mediump float tmpvar_3_2;
- lowp vec4 c_3;
- c_3.yzw = vec3(0.0, 0.0, 0.0);
- c_3.x = uni4.x;
- highp vec3 tmpvar_4;
- highp vec2 uv_5;
- uv_5 = var_uv.xy;
- mut_uni4.xy = uv_5;
- lowp vec3 tmpvar_6;
- tmpvar_6 = texture (tex1, mut_uni4.xy).xyz;
- tmpvar_4 = tmpvar_6;
- c_3.xyz = (c_3.xyz + tmpvar_4);
- c_3.z = (c_3.z + uni1);
- mut_uni1 = (uni1 + 2.0);
- c_3.w = mut_uni1;
- mediump float tmpvar_7;
- tmpvar_7 = pow (_AtmosphereThickness, 2.5);
- tmpvar_3_2 = (0.05 * tmpvar_7);
- kKrESun = tmpvar_3_2;
- tmpvar_5_1 = (tmpvar_7 * 0.031416);
- kKr4PI = tmpvar_5_1;
- if ((var_uv.x > 0.5)) {
- highp float tmpvar_8;
- tmpvar_8 = pow (kKrESun, kKr4PI);
- c_3.x = (c_3.x + tmpvar_8);
- };
- out_data = c_3;
-}
-
-
-// stats: 10 alu 1 tex 1 flow
-// inputs: 1
-// #0: var_uv (high float) 4x1 [-1]
-// uniforms: 3 (total size: 0)
-// #0: uni1 (high float) 1x1 [-1]
-// #1: uni4 (medium float) 4x1 [-1]
-// #2: _AtmosphereThickness (medium float) 1x1 [-1]
-// textures: 1
-// #0: tex1 (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3Metal.txt
deleted file mode 100644
index 71a1a1a4a0a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/global-mutable-outES3Metal.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-#include <metal_stdlib>
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 var_uv;
-};
-struct xlatMtlShaderOutput {
- half4 out_data [[color(0)]];
-};
-struct xlatMtlShaderUniform {
- float uni1;
- half4 uni4;
- half _AtmosphereThickness;
-};
-fragment xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> tex1 [[texture(0)]], sampler _mtlsmp_tex1 [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
-float mut_uni1_1;
-half4 mut_uni4_2;
-float kKrESun_3;
-float kKr4PI_4;
- mut_uni4_2.zw = _mtl_u.uni4.zw;
- half tmpvar_5_5;
- half tmpvar_3_6;
- half4 c_7;
- c_7.yzw = half3(float3(0.0, 0.0, 0.0));
- c_7.x = _mtl_u.uni4.x;
- float3 tmpvar_8;
- float2 uv_9;
- uv_9 = _mtl_i.var_uv.xy;
- mut_uni4_2.xy = half2(uv_9);
- half3 tmpvar_10;
- tmpvar_10 = tex1.sample(_mtlsmp_tex1, (float2)(mut_uni4_2.xy)).xyz;
- tmpvar_8 = float3(tmpvar_10);
- c_7.xyz = half3(((float3)c_7.xyz + tmpvar_8));
- c_7.z = half(((float)c_7.z + _mtl_u.uni1));
- mut_uni1_1 = (_mtl_u.uni1 + 2.0);
- c_7.w = half(mut_uni1_1);
- half tmpvar_11;
- tmpvar_11 = pow (_mtl_u._AtmosphereThickness, (half)2.5);
- tmpvar_3_6 = ((half)0.05 * tmpvar_11);
- kKrESun_3 = float(tmpvar_3_6);
- tmpvar_5_5 = (tmpvar_11 * (half)0.031416);
- kKr4PI_4 = float(tmpvar_5_5);
- if ((_mtl_i.var_uv.x > 0.5)) {
- float tmpvar_12;
- tmpvar_12 = pow (kKrESun_3, kKr4PI_4);
- c_7.x = half(((float)c_7.x + tmpvar_12));
- };
- _mtl_o.out_data = c_7;
- return _mtl_o;
-}
-
-
-// stats: 10 alu 1 tex 1 flow
-// inputs: 1
-// #0: var_uv (high float) 4x1 [-1]
-// uniforms: 3 (total size: 18)
-// #0: uni1 (high float) 1x1 [-1] loc 0
-// #1: uni4 (medium float) 4x1 [-1] loc 8
-// #2: _AtmosphereThickness (medium float) 1x1 [-1] loc 16
-// textures: 1
-// #0: tex1 (low 2d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp
deleted file mode 100644
index 1f8e8cead20..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/glsl_optimizer_tests.cpp
+++ /dev/null
@@ -1,706 +0,0 @@
-#include <string>
-#include <vector>
-#include <time.h>
-#include "../src/glsl/glsl_optimizer.h"
-
-#define GL_GLEXT_PROTOTYPES 1
-
-#if __linux__
-#define GOT_GFX 0
-#else
-#define GOT_GFX 1
-#endif
-
-#if GOT_GFX
-
-// ---- Windows GL bits
-#ifdef _MSC_VER
-#define GOT_MORE_THAN_GLSL_120 1
-#include <windows.h>
-#include <gl/GL.h>
-extern "C" {
-typedef char GLchar; /* native character */
-typedef unsigned int GLuint; /* shader object handle */
-#define GL_VERTEX_SHADER 0x8B31
-#define GL_FRAGMENT_SHADER 0x8B30
-#define GL_COMPILE_STATUS 0x8B81
-typedef void (WINAPI * PFNGLDELETESHADERPROC) (GLuint shader);
-typedef GLuint (WINAPI * PFNGLCREATESHADERPROC) (GLenum type);
-typedef void (WINAPI * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
-typedef void (WINAPI * PFNGLCOMPILESHADERPROC) (GLuint shader);
-typedef void (WINAPI * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
-typedef void (WINAPI * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
-static PFNGLDELETESHADERPROC glDeleteShader;
-static PFNGLCREATESHADERPROC glCreateShader;
-static PFNGLSHADERSOURCEPROC glShaderSource;
-static PFNGLCOMPILESHADERPROC glCompileShader;
-static PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog;
-static PFNGLGETSHADERIVPROC glGetShaderiv;
-}
-#endif // #ifdef _MSC_VER
-
-
-// ---- Apple GL bits
-#ifdef __APPLE__
-
-#define GOT_MORE_THAN_GLSL_120 0
-#include <OpenGL/OpenGL.h>
-#include <OpenGL/gl.h>
-#include <OpenGL/CGLTypes.h>
-#include <dirent.h>
-#include <stdlib.h>
-static CGLContextObj s_GLContext;
-static CGLContextObj s_GLContext3;
-static bool s_GL3Active = false;
-
-#endif // ifdef __APPLE__
-
-
-#else // #if GOT_GFX
-
-#define GOT_MORE_THAN_GLSL_120 0
-#include <cstdio>
-#include <cstring>
-#include "dirent.h"
-#include "GL/gl.h"
-#include "GL/glext.h"
-
-#endif // ! #if GOT_GFX
-
-
-#ifndef _MSC_VER
-#include <unistd.h>
-#endif
-
-
-static bool InitializeOpenGL ()
-{
- bool hasGLSL = false;
-
-#if GOT_GFX
-
-#ifdef _MSC_VER
- // setup minimal required GL
- HWND wnd = CreateWindowA(
- "STATIC",
- "GL",
- WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS | WS_CLIPCHILDREN,
- 0, 0, 16, 16,
- NULL, NULL,
- GetModuleHandle(NULL), NULL );
- HDC dc = GetDC( wnd );
-
- PIXELFORMATDESCRIPTOR pfd = {
- sizeof(PIXELFORMATDESCRIPTOR), 1,
- PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL,
- PFD_TYPE_RGBA, 32,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0,
- 16, 0,
- 0, PFD_MAIN_PLANE, 0, 0, 0, 0
- };
-
- int fmt = ChoosePixelFormat( dc, &pfd );
- SetPixelFormat( dc, fmt, &pfd );
-
- HGLRC rc = wglCreateContext( dc );
- wglMakeCurrent( dc, rc );
-
-#elif defined(__APPLE__)
-
- CGLPixelFormatAttribute attributes[] = {
- kCGLPFAAccelerated, // no software rendering
- (CGLPixelFormatAttribute) 0
- };
- CGLPixelFormatAttribute attributes3[] = {
- kCGLPFAAccelerated, // no software rendering
- kCGLPFAOpenGLProfile, // core profile with the version stated below
- (CGLPixelFormatAttribute) kCGLOGLPVersion_3_2_Core,
- (CGLPixelFormatAttribute) 0
- };
- GLint num;
- CGLPixelFormatObj pix;
-
- // create legacy context
- CGLChoosePixelFormat(attributes, &pix, &num);
- if (pix == NULL)
- return false;
- CGLCreateContext(pix, NULL, &s_GLContext);
- if (s_GLContext == NULL)
- return false;
- CGLDestroyPixelFormat(pix);
- CGLSetCurrentContext(s_GLContext);
-
- // create core 3.2 context
- CGLChoosePixelFormat(attributes3, &pix, &num);
- if (pix == NULL)
- return false;
- CGLCreateContext(pix, NULL, &s_GLContext3);
- if (s_GLContext3 == NULL)
- return false;
- CGLDestroyPixelFormat(pix);
-
-#endif
-
- // check if we have GLSL
- const char* extensions = (const char*)glGetString(GL_EXTENSIONS);
- hasGLSL = extensions != NULL && strstr(extensions, "GL_ARB_shader_objects") && strstr(extensions, "GL_ARB_vertex_shader") && strstr(extensions, "GL_ARB_fragment_shader");
-
- #if defined(__APPLE__)
- // using core profile; always has GLSL
- hasGLSL = true;
- #endif
-
-
-#ifdef _MSC_VER
- if (hasGLSL)
- {
- glDeleteShader = (PFNGLDELETESHADERPROC)wglGetProcAddress("glDeleteShader");
- glCreateShader = (PFNGLCREATESHADERPROC)wglGetProcAddress("glCreateShader");
- glShaderSource = (PFNGLSHADERSOURCEPROC)wglGetProcAddress("glShaderSource");
- glCompileShader = (PFNGLCOMPILESHADERPROC)wglGetProcAddress("glCompileShader");
- glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)wglGetProcAddress("glGetShaderInfoLog");
- glGetShaderiv = (PFNGLGETSHADERIVPROC)wglGetProcAddress("glGetShaderiv");
- }
-#endif
-
-#endif
- return hasGLSL;
-}
-
-static void CleanupGL()
-{
-#if GOT_GFX
- #ifdef __APPLE__
- CGLSetCurrentContext(NULL);
- if (s_GLContext)
- CGLDestroyContext(s_GLContext);
- if (s_GLContext3)
- CGLDestroyContext(s_GLContext3);
- #endif // #ifdef __APPLE__
-#endif // #if GOT_GFX
-}
-
-
-static bool InitializeMetal ()
-{
- bool hasMetal = false;
-
-#if defined(__APPLE__)
-
- hasMetal = true; //@TODO: detect metal compiler presence
-
-#endif
-
- return hasMetal;
-}
-
-static void replace_string (std::string& target, const std::string& search, const std::string& replace, size_t startPos)
-{
- if (search.empty())
- return;
-
- std::string::size_type p = startPos;
- while ((p = target.find (search, p)) != std::string::npos)
- {
- target.replace (p, search.size (), replace);
- p += replace.size ();
- }
-}
-
-static bool CheckGLSL (bool vertex, bool gles, const std::string& testName, const char* prefix, const std::string& source)
-{
- #if !GOT_GFX
- return true; // just assume it's ok
- #endif
-
- #if !GOT_MORE_THAN_GLSL_120
- if (source.find("#version 140") != std::string::npos)
- return true;
- #endif
-
- const bool need3 =
- (source.find("#version 150") != std::string::npos) ||
- (source.find("#version 300") != std::string::npos);
-
-# ifdef __APPLE__
- // Mac core context does not accept any older shader versions, so need to switch to
- // either legacy context or core one.
- if (need3)
- {
- if (!s_GL3Active)
- CGLSetCurrentContext(s_GLContext3);
- s_GL3Active = true;
- }
- else
- {
- if (s_GL3Active)
- CGLSetCurrentContext(s_GLContext);
- s_GL3Active = false;
- }
-# endif // ifdef __APPLE__
-
-
- std::string src;
- if (gles)
- {
- src += "#define lowp\n";
- src += "#define mediump\n";
- src += "#define highp\n";
- src += "#define texture2DLodEXT texture2DLod\n";
- src += "#define texture2DProjLodEXT texture2DProjLod\n";
- src += "#define texture2DGradEXT texture2DGradARB\n";
- src += "#define textureCubeGradEXT textureCubeGradARB\n";
- src += "#define gl_FragDepthEXT gl_FragDepth\n";
- if (!need3)
- {
- src += "#define gl_LastFragData _glesLastFragData\n";
- src += "varying lowp vec4 _glesLastFragData[4];\n";
- }
- if (!need3)
- {
- src += "float shadow2DEXT (sampler2DShadow s, vec3 p) { return shadow2D(s,p).r; }\n";
- src += "float shadow2DProjEXT (sampler2DShadow s, vec4 p) { return shadow2DProj(s,p).r; }\n";
- }
- }
- src += source;
- if (gles)
- {
- replace_string (src, "GL_EXT_shader_texture_lod", "GL_ARB_shader_texture_lod", 0);
- replace_string (src, "GL_EXT_draw_instanced", "GL_ARB_draw_instanced", 0);
- replace_string (src, "gl_InstanceIDEXT", "gl_InstanceIDARB ", 0);
- replace_string (src, "#extension GL_OES_standard_derivatives : require", "", 0);
- replace_string (src, "#extension GL_EXT_shadow_samplers : require", "", 0);
- replace_string (src, "#extension GL_EXT_frag_depth : require", "", 0);
- replace_string (src, "#extension GL_OES_standard_derivatives : enable", "", 0);
- replace_string (src, "#extension GL_EXT_shadow_samplers : enable", "", 0);
- replace_string (src, "#extension GL_EXT_frag_depth : enable", "", 0);
- replace_string (src, "#extension GL_EXT_draw_buffers : enable", "", 0);
- replace_string (src, "#extension GL_EXT_draw_buffers : require", "", 0);
- replace_string (src, "precision ", "// precision ", 0);
- replace_string (src, "#version 300 es", "", 0);
- }
-
- // can't check FB fetch on PC
- if (src.find("#extension GL_EXT_shader_framebuffer_fetch") != std::string::npos)
- return true;
-
- if (gles && need3)
- {
- src = "#version 330\n" + src;
- }
- const char* sourcePtr = src.c_str();
-
-
- GLuint shader = glCreateShader (vertex ? GL_VERTEX_SHADER : GL_FRAGMENT_SHADER);
- glShaderSource (shader, 1, &sourcePtr, NULL);
- glCompileShader (shader);
- GLint status;
-
- glGetShaderiv (shader, GL_COMPILE_STATUS, &status);
-
- bool res = true;
- if (status != GL_TRUE)
- {
- char log[20000];
- log[0] = 0;
- GLsizei logLength;
- glGetShaderInfoLog (shader, sizeof(log), &logLength, log);
- printf ("\n %s: real glsl compiler error on %s:\n%s\n", testName.c_str(), prefix, log);
- res = false;
- }
- glDeleteShader (shader);
- return res;
-}
-
-
-static bool CheckMetal (bool vertex, bool gles, const std::string& testName, const char* prefix, const std::string& source)
-{
-#if !GOT_GFX || !defined(__APPLE__)
- return true; // just assume it's ok
-#else
-
- FILE* f = fopen ("metalTemp.metal", "wb");
- fwrite (source.c_str(), source.size(), 1, f);
- fclose (f);
-
-#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
- int res = system("/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/usr/bin/metal metalTemp.metal -o metalTemp.o -std=ios-metal1.0 -Wno-parentheses-equality");
- if (res != 0)
- {
- printf ("\n %s: Metal compiler failed\n", testName.c_str());
- return false;
- }
-#endif //
-
- return true;
-#endif
-}
-
-
-static bool ReadStringFromFile (const char* pathName, std::string& output)
-{
- FILE* file = fopen( pathName, "rb" );
- if (file == NULL)
- return false;
- fseek(file, 0, SEEK_END);
- int length = ftell(file);
- fseek(file, 0, SEEK_SET);
- if (length < 0)
- {
- fclose( file );
- return false;
- }
- output.resize(length);
- int readLength = fread(&*output.begin(), 1, length, file);
- fclose(file);
- if (readLength != length)
- {
- output.clear();
- return false;
- }
-
- replace_string(output, "\r\n", "\n", 0);
- return true;
-}
-
-bool EndsWith (const std::string& str, const std::string& sub)
-{
- return (str.size() >= sub.size()) && (strncmp (str.c_str()+str.size()-sub.size(), sub.c_str(), sub.size())==0);
-}
-
-typedef std::vector<std::string> StringVector;
-
-static StringVector GetFiles (const std::string& folder, const std::string& endsWith)
-{
- StringVector res;
-
- #ifdef _MSC_VER
- WIN32_FIND_DATAA FindFileData;
- HANDLE hFind = FindFirstFileA ((folder+"/*"+endsWith).c_str(), &FindFileData);
- if (hFind == INVALID_HANDLE_VALUE)
- return res;
-
- do {
- res.push_back (FindFileData.cFileName);
- } while (FindNextFileA (hFind, &FindFileData));
-
- FindClose (hFind);
-
- #else
-
- DIR *dirp;
- struct dirent *dp;
-
- if ((dirp = opendir(folder.c_str())) == NULL)
- return res;
-
- while ( (dp = readdir(dirp)) )
- {
- std::string fname = dp->d_name;
- if (fname == "." || fname == "..")
- continue;
- if (!EndsWith (fname, endsWith))
- continue;
- res.push_back (fname);
- }
- closedir(dirp);
-
- #endif
-
- return res;
-}
-
-static void DeleteFile (const std::string& path)
-{
- #ifdef _MSC_VER
- DeleteFileA (path.c_str());
- #else
- unlink (path.c_str());
- #endif
-}
-
-static void MassageVertexForGLES (std::string& s)
-{
- if (s.find ("_glesVertex") != std::string::npos)
- return;
- std::string pre;
- std::string version = "#version 300 es\n";
- size_t insertPoint = s.find(version);
- if (insertPoint != std::string::npos)
- {
- insertPoint += version.size();
- pre += "#define gl_Vertex _glesVertex\nin highp vec4 _glesVertex;\n";
- pre += "#define gl_Normal _glesNormal\nin mediump vec3 _glesNormal;\n";
- pre += "#define gl_MultiTexCoord0 _glesMultiTexCoord0\nin highp vec4 _glesMultiTexCoord0;\n";
- pre += "#define gl_MultiTexCoord1 _glesMultiTexCoord1\nin highp vec4 _glesMultiTexCoord1;\n";
- pre += "#define gl_Color _glesColor\nin lowp vec4 _glesColor;\n";
- }
- else
- {
- insertPoint = 0;
- pre += "#define gl_Vertex _glesVertex\nattribute highp vec4 _glesVertex;\n";
- pre += "#define gl_Normal _glesNormal\nattribute mediump vec3 _glesNormal;\n";
- pre += "#define gl_MultiTexCoord0 _glesMultiTexCoord0\nattribute highp vec4 _glesMultiTexCoord0;\n";
- pre += "#define gl_MultiTexCoord1 _glesMultiTexCoord1\nattribute highp vec4 _glesMultiTexCoord1;\n";
- pre += "#define gl_Color _glesColor\nattribute lowp vec4 _glesColor;\n";
- }
-
- s.insert (insertPoint, pre);
-}
-
-static void MassageFragmentForGLES (std::string& s)
-{
- std::string pre;
- s = pre + s;
-}
-
-static const char* kGlslTypeNames[kGlslTypeCount] = {
- "float",
- "int",
- "bool",
- "2d",
- "3d",
- "cube",
- "2dshadow",
- "2darray",
- "other",
-};
-static const char* kGlslPrecNames[kGlslPrecCount] = {
- "high",
- "medium",
- "low",
-};
-
-
-static bool TestFile (glslopt_ctx* ctx, bool vertex,
- const std::string& testName,
- const std::string& inputPath,
- const std::string& outputPath,
- bool gles,
- bool doCheckGLSL,
- bool doCheckMetal)
-{
- std::string input;
- if (!ReadStringFromFile (inputPath.c_str(), input))
- {
- printf ("\n %s: failed to read input file\n", testName.c_str());
- return false;
- }
- if (doCheckGLSL)
- {
- if (!CheckGLSL (vertex, gles, testName, "input", input.c_str()))
- return false;
- }
-
- if (gles)
- {
- if (vertex)
- MassageVertexForGLES (input);
- else
- MassageFragmentForGLES (input);
- }
-
- bool res = true;
-
- glslopt_shader_type type = vertex ? kGlslOptShaderVertex : kGlslOptShaderFragment;
- glslopt_shader* shader = glslopt_optimize (ctx, type, input.c_str(), 0);
-
- bool optimizeOk = glslopt_get_status(shader);
- if (optimizeOk)
- {
- std::string textHir = glslopt_get_raw_output (shader);
- std::string textOpt = glslopt_get_output (shader);
-
- // append stats
- char buffer[1000];
- int statsAlu, statsTex, statsFlow;
- glslopt_shader_get_stats (shader, &statsAlu, &statsTex, &statsFlow);
- sprintf(buffer, "\n// stats: %i alu %i tex %i flow\n", statsAlu, statsTex, statsFlow);
- textOpt += buffer;
-
- // append inputs
- const int inputCount = glslopt_shader_get_input_count (shader);
- if (inputCount > 0)
- {
- sprintf(buffer, "// inputs: %i\n", inputCount);
- textOpt += buffer;
- }
- for (int i = 0; i < inputCount; ++i)
- {
- const char* parName;
- glslopt_basic_type parType;
- glslopt_precision parPrec;
- int parVecSize, parMatSize, parArrSize, location;
- glslopt_shader_get_input_desc(shader, i, &parName, &parType, &parPrec, &parVecSize, &parMatSize, &parArrSize, &location);
- if (location >= 0)
- sprintf(buffer, "// #%i: %s (%s %s) %ix%i [%i] loc %i\n", i, parName, kGlslPrecNames[parPrec], kGlslTypeNames[parType], parVecSize, parMatSize, parArrSize, location);
- else
- sprintf(buffer, "// #%i: %s (%s %s) %ix%i [%i]\n", i, parName, kGlslPrecNames[parPrec], kGlslTypeNames[parType], parVecSize, parMatSize, parArrSize);
- textOpt += buffer;
- }
- // append uniforms
- const int uniformCount = glslopt_shader_get_uniform_count (shader);
- const int uniformSize = glslopt_shader_get_uniform_total_size (shader);
- if (uniformCount > 0)
- {
- sprintf(buffer, "// uniforms: %i (total size: %i)\n", uniformCount, uniformSize);
- textOpt += buffer;
- }
- for (int i = 0; i < uniformCount; ++i)
- {
- const char* parName;
- glslopt_basic_type parType;
- glslopt_precision parPrec;
- int parVecSize, parMatSize, parArrSize, location;
- glslopt_shader_get_uniform_desc(shader, i, &parName, &parType, &parPrec, &parVecSize, &parMatSize, &parArrSize, &location);
- if (location >= 0)
- sprintf(buffer, "// #%i: %s (%s %s) %ix%i [%i] loc %i\n", i, parName, kGlslPrecNames[parPrec], kGlslTypeNames[parType], parVecSize, parMatSize, parArrSize, location);
- else
- sprintf(buffer, "// #%i: %s (%s %s) %ix%i [%i]\n", i, parName, kGlslPrecNames[parPrec], kGlslTypeNames[parType], parVecSize, parMatSize, parArrSize);
- textOpt += buffer;
- }
- // append textures
- const int textureCount = glslopt_shader_get_texture_count (shader);
- if (textureCount > 0)
- {
- sprintf(buffer, "// textures: %i\n", textureCount);
- textOpt += buffer;
- }
- for (int i = 0; i < textureCount; ++i)
- {
- const char* parName;
- glslopt_basic_type parType;
- glslopt_precision parPrec;
- int parVecSize, parMatSize, parArrSize, location;
- glslopt_shader_get_texture_desc(shader, i, &parName, &parType, &parPrec, &parVecSize, &parMatSize, &parArrSize, &location);
- if (location >= 0)
- sprintf(buffer, "// #%i: %s (%s %s) %ix%i [%i] loc %i\n", i, parName, kGlslPrecNames[parPrec], kGlslTypeNames[parType], parVecSize, parMatSize, parArrSize, location);
- else
- sprintf(buffer, "// #%i: %s (%s %s) %ix%i [%i]\n", i, parName, kGlslPrecNames[parPrec], kGlslTypeNames[parType], parVecSize, parMatSize, parArrSize);
- textOpt += buffer;
- }
-
- std::string outputOpt;
- ReadStringFromFile (outputPath.c_str(), outputOpt);
-
- if (res && doCheckMetal && !CheckMetal (vertex, gles, testName, "metal", textOpt.c_str()))
- res = false;
-
- if (textOpt != outputOpt)
- {
- // write output
- FILE* f = fopen (outputPath.c_str(), "wb");
- if (!f)
- {
- printf ("\n %s: can't write to optimized file!\n", testName.c_str());
- }
- else
- {
- fwrite (textOpt.c_str(), 1, textOpt.size(), f);
- fclose (f);
- }
- printf ("\n %s: does not match optimized output\n", testName.c_str());
- res = false;
- }
- if (res && doCheckGLSL && !CheckGLSL (vertex, gles, testName, "raw", textHir.c_str()))
- res = false;
- if (res && doCheckGLSL && !CheckGLSL (vertex, gles, testName, "optimized", textOpt.c_str()))
- res = false;
- }
- else
- {
- printf ("\n %s: optimize error: %s\n", testName.c_str(), glslopt_get_log(shader));
- res = false;
- }
-
- glslopt_shader_delete (shader);
-
- return res;
-}
-
-
-int main (int argc, const char** argv)
-{
- if (argc < 2)
- {
- printf ("USAGE: glsloptimizer testfolder\n");
- return 1;
- }
-
- bool hasOpenGL = InitializeOpenGL ();
- bool hasMetal = InitializeMetal ();
- glslopt_ctx* ctx[3] = {
- glslopt_initialize(kGlslTargetOpenGLES20),
- glslopt_initialize(kGlslTargetOpenGLES30),
- glslopt_initialize(kGlslTargetOpenGL),
- };
- glslopt_ctx* ctxMetal = glslopt_initialize(kGlslTargetMetal);
-
- std::string baseFolder = argv[1];
-
- clock_t time0 = clock();
-
- // 2.39s
- // ralloc fix 256 initial: 1.35s
-
- static const char* kTypeName[2] = { "vertex", "fragment" };
- size_t tests = 0;
- size_t errors = 0;
- for (int type = 0; type < 2; ++type)
- {
- std::string testFolder = baseFolder + "/" + kTypeName[type];
-
- static const char* kAPIName[3] = { "OpenGL ES 2.0", "OpenGL ES 3.0", "OpenGL" };
- static const char* kApiIn [3] = {"-inES.txt", "-inES3.txt", "-in.txt"};
- static const char* kApiOut[3] = {"-outES.txt", "-outES3.txt", "-out.txt"};
- static const char* kApiOutMetal[3] = {"-outESMetal.txt", "-outES3Metal.txt", "-outMetal.txt"};
- for (int api = 0; api < 3; ++api)
- {
- printf ("\n** running %s tests for %s...\n", kTypeName[type], kAPIName[api]);
- StringVector inputFiles = GetFiles (testFolder, kApiIn[api]);
-
- size_t n = inputFiles.size();
- for (size_t i = 0; i < n; ++i)
- {
- std::string inname = inputFiles[i];
- //if (inname != "ast-in.txt")
- // continue;
- std::string outname = inname.substr (0,inname.size()-strlen(kApiIn[api])) + kApiOut[api];
- std::string outnameMetal = inname.substr (0,inname.size()-strlen(kApiIn[api])) + kApiOutMetal[api];
- const bool useMetal = (api == 1);
- bool ok = TestFile (ctx[api], type==0, inname, testFolder + "/" + inname, testFolder + "/" + outname, api<=1, hasOpenGL, false);
- if (!ok)
- {
- ++errors;
- }
- if (useMetal)
- {
- ok = TestFile (ctxMetal, type==0, inname, testFolder + "/" + inname, testFolder + "/" + outnameMetal, api==0, false, hasMetal);
- if (!ok)
- {
- ++errors;
- }
- }
- ++tests;
- }
- }
- }
- clock_t time1 = clock();
- float timeDelta = float(time1-time0)/CLOCKS_PER_SEC;
-
- if (errors != 0)
- printf ("\n**** %i tests (%.2fsec), %i !!!FAILED!!!\n", (int)tests, timeDelta, (int)errors);
- else
- printf ("\n**** %i tests (%.2fsec) succeeded\n", (int)tests, timeDelta);
-
- // 3.25s
- // with builtin call linking, 3.84s
-
- for (int i = 0; i < 2; ++i)
- glslopt_cleanup (ctx[i]);
- glslopt_cleanup (ctxMetal);
- CleanupGL();
-
- return errors ? 1 : 0;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/tests.gyp b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/tests.gyp
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/tests.gyp
+++ /dev/null
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/tests.js b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/tests.js
deleted file mode 100644
index 1aa9a64e336..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/tests.js
+++ /dev/null
@@ -1,40 +0,0 @@
-var glslOptimizer = require('../');
-var assert = require('assert');
-
-var fs = require('fs');
-var path = require('path');
-var frag = fs.readFileSync( path.join( __dirname, 'fragment', 'glsl140-basic-in.txt' ), 'utf8' );
-
-assert.equal(glslOptimizer.TARGET_OPENGL, 0, 'exports TARGET_OPENGL');
-assert.equal(glslOptimizer.TARGET_OPENGLES20, 1, 'exports TARGET_OPENGLES20');
-assert.equal(glslOptimizer.TARGET_OPENGLES30, 2, 'exports TARGET_OPENGLES30');
-assert.equal(glslOptimizer.VERTEX_SHADER, 0, 'exports VERTEX_SHADER');
-assert.equal(glslOptimizer.FRAGMENT_SHADER, 1, 'exports FRAGMENT_SHADER');
-assert.equal(typeof glslOptimizer.Compiler, 'function', 'exports Compiler constructor');
-
-var ESSL = false;
-
-//First we need to create a new compiler
-var compiler = new glslOptimizer.Compiler(2);
-
-assert.equal(typeof compiler.dispose, 'function', 'exports Compiler#dispose()');
-
-var shader = new glslOptimizer.Shader(compiler, glslOptimizer.FRAGMENT_SHADER, frag);
-
-var didCompile = shader.compiled();
-var raw = shader.rawOutput();
-var output = shader.output();
-var log = shader.log();
-
-assert.equal(typeof didCompile, 'boolean', 'exports compiled()');
-assert.equal(typeof raw, 'string', 'exports rawOutput()');
-assert.equal(typeof output, 'string', 'exports output()');
-assert.equal(typeof log, 'string', 'exports log()');
-
-console.log(output, didCompile);
-
-//Clean up shader...
-shader.dispose();
-
-//Clean up after we've created our compiler
-compiler.dispose(); \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES.txt
deleted file mode 100644
index 4d40053c2b2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES.txt
+++ /dev/null
@@ -1,154 +0,0 @@
-float xll_mod( float x, float y ) {
- float d = x / y;
- float f = fract (abs(d)) * y;
- return d >= 0.0 ? f : -f;
-}
-vec2 xll_mod( vec2 x, vec2 y ) {
- vec2 d = x / y;
- vec2 f = fract (abs(d)) * y;
- return vec2 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y);
-}
-vec3 xll_mod( vec3 x, vec3 y ) {
- vec3 d = x / y;
- vec3 f = fract (abs(d)) * y;
- return vec3 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z);
-}
-vec4 xll_mod( vec4 x, vec4 y ) {
- vec4 d = x / y;
- vec4 f = fract (abs(d)) * y;
- return vec4 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z, d.w >= 0.0 ? f.w : -f.w);
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f {
- highp vec4 pos;
- highp vec2 uv;
- lowp vec4 color;
-};
-struct appdata_full {
- highp vec4 vertex;
- highp vec4 tangent;
- highp vec3 normal;
- highp vec4 texcoord;
- highp vec4 texcoord1;
- highp vec4 color;
-};
-uniform highp float _Bias;
-uniform highp float _BlinkingTimeOffsScale;
-uniform highp vec4 _Color;
-uniform highp float _FadeOutDistFar;
-uniform highp float _FadeOutDistNear;
-uniform highp float _MaxGrowSize;
-uniform highp float _Multiplier;
-uniform highp float _NoiseAmount;
-uniform highp float _SizeGrowEndDist;
-uniform highp float _SizeGrowStartDist;
-uniform highp vec4 _Time;
-uniform highp float _TimeOffDuration;
-uniform highp float _TimeOnDuration;
-uniform highp float _VerticalBillboarding;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp mat4 glstate_matrix_mvp;
-void CalcOrthonormalBasis( in highp vec3 dir, out highp vec3 right, out highp vec3 up );
-highp float CalcFadeOutFactor( in highp float dist );
-highp float CalcDistScale( in highp float dist );
-v2f xlat_main( in appdata_full v );
-void CalcOrthonormalBasis( in highp vec3 dir, out highp vec3 right, out highp vec3 up ) {
- up = (( (abs( dir.y ) > 0.999000) ) ? ( vec3( 0.0, 0.0, 1.0) ) : ( vec3( 0.0, 1.0, 0.0) ));
- right = normalize( cross( up, dir) );
- up = cross( dir, right);
-}
-highp float CalcFadeOutFactor( in highp float dist ) {
- highp float nfadeout;
- highp float ffadeout;
- nfadeout = xll_saturate( (dist / _FadeOutDistNear) );
- ffadeout = (1.00000 - xll_saturate( (max( (dist - _FadeOutDistFar), 0.00000) * 0.200000) ));
- ffadeout *= ffadeout;
- nfadeout *= nfadeout;
- nfadeout *= nfadeout;
- nfadeout *= ffadeout;
- return nfadeout;
-}
-highp float CalcDistScale( in highp float dist ) {
- highp float distScale;
- distScale = min( (max( (dist - _SizeGrowStartDist), 0.00000) / _SizeGrowEndDist), 1.00000);
- return ((distScale * distScale) * _MaxGrowSize);
-}
-v2f xlat_main( in appdata_full v ) {
- highp vec3 centerOffs;
- highp vec3 centerLocal;
- highp vec3 viewerLocal;
- highp vec3 localDir;
- highp float localDirLength;
- highp vec3 rightLocal;
- highp vec3 upLocal;
- highp float distScale;
- highp vec3 BBNormal;
- highp vec3 BBLocalPos;
- highp float time;
- highp float fracTime;
- highp float wave;
- highp float noiseTime;
- highp float noise;
- highp float noiseWave;
- v2f o;
- centerOffs = (vec3( (vec2( 0.500000) - v.color.xy ), 0.00000) * v.texcoord1.xyy );
- centerLocal = (v.vertex.xyz + centerOffs.xyz );
- viewerLocal = vec3( ( _World2Object * vec4( _WorldSpaceCameraPos, 1.00000) ));
- localDir = (viewerLocal - centerLocal);
- localDir.y = mix( 0.00000, localDir.y , _VerticalBillboarding);
- localDirLength = length( localDir );
- CalcOrthonormalBasis( (localDir / localDirLength), rightLocal, upLocal);
- distScale = (CalcDistScale( localDirLength) * v.color.w );
- BBNormal = ((rightLocal * v.normal.x ) + (upLocal * v.normal.y ));
- BBLocalPos = ((centerLocal - ((rightLocal * centerOffs.x ) + (upLocal * centerOffs.y ))) + (BBNormal * distScale));
- time = (_Time.y + (_BlinkingTimeOffsScale * v.color.z ));
- fracTime = xll_mod( time, (_TimeOnDuration + _TimeOffDuration));
- wave = (smoothstep( 0.00000, (_TimeOnDuration * 0.250000), fracTime) * (1.00000 - smoothstep( (_TimeOnDuration * 0.750000), _TimeOnDuration, fracTime)));
- noiseTime = (time * (6.28319 / _TimeOnDuration));
- noise = (sin( noiseTime ) * ((0.500000 * cos( ((noiseTime * 0.636600) + 56.7272) )) + 0.500000));
- noiseWave = ((_NoiseAmount * noise) + (1.00000 - _NoiseAmount));
- wave = (( (_NoiseAmount < 0.0100000) ) ? ( wave ) : ( noiseWave ));
- wave += _Bias;
- o.uv = v.texcoord.xy ;
- o.pos = ( glstate_matrix_mvp * vec4( BBLocalPos, 1.00000) );
- o.color = (((CalcFadeOutFactor( localDirLength) * _Color) * _Multiplier) * wave);
- return o;
-}
-attribute vec4 TANGENT;
-varying highp vec2 xlv_TEXCOORD0;
-varying lowp vec4 xlv_TEXCOORD1;
-void main() {
- v2f xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4(xl_retval.pos);
- xlv_TEXCOORD0 = vec2( xl_retval.uv);
- xlv_TEXCOORD1 = vec4( xl_retval.color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES3.txt
deleted file mode 100644
index b15d088469b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-inES3.txt
+++ /dev/null
@@ -1,161 +0,0 @@
-#version 300 es
-
-float xll_mod( float x, float y ) {
- float d = x / y;
- float f = fract (abs(d)) * y;
- return d >= 0.0 ? f : -f;
-}
-vec2 xll_mod( vec2 x, vec2 y ) {
- vec2 d = x / y;
- vec2 f = fract (abs(d)) * y;
- return vec2 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y);
-}
-vec3 xll_mod( vec3 x, vec3 y ) {
- vec3 d = x / y;
- vec3 f = fract (abs(d)) * y;
- return vec3 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z);
-}
-vec4 xll_mod( vec4 x, vec4 y ) {
- vec4 d = x / y;
- vec4 f = fract (abs(d)) * y;
- return vec4 (d.x >= 0.0 ? f.x : -f.x, d.y >= 0.0 ? f.y : -f.y, d.z >= 0.0 ? f.z : -f.z, d.w >= 0.0 ? f.w : -f.w);
-}
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-vec2 xll_saturate( vec2 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec3 xll_saturate( vec3 x) {
- return clamp( x, 0.0, 1.0);
-}
-vec4 xll_saturate( vec4 x) {
- return clamp( x, 0.0, 1.0);
-}
-mat2 xll_saturate(mat2 m) {
- return mat2( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0));
-}
-mat3 xll_saturate(mat3 m) {
- return mat3( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0));
-}
-mat4 xll_saturate(mat4 m) {
- return mat4( clamp(m[0], 0.0, 1.0), clamp(m[1], 0.0, 1.0), clamp(m[2], 0.0, 1.0), clamp(m[3], 0.0, 1.0));
-}
-struct v2f {
- highp vec4 pos;
- highp vec2 uv;
- lowp vec4 color;
-};
-struct appdata_full {
- highp vec4 vertex;
- highp vec4 tangent;
- highp vec3 normal;
- highp vec4 texcoord;
- highp vec4 texcoord1;
- highp vec4 color;
-};
-uniform highp float _Bias;
-uniform highp float _BlinkingTimeOffsScale;
-uniform highp vec4 _Color;
-uniform highp float _FadeOutDistFar;
-uniform highp float _FadeOutDistNear;
-uniform highp float _MaxGrowSize;
-uniform highp float _Multiplier;
-uniform highp float _NoiseAmount;
-uniform highp float _SizeGrowEndDist;
-uniform highp float _SizeGrowStartDist;
-uniform highp vec4 _Time;
-uniform highp float _TimeOffDuration;
-uniform highp float _TimeOnDuration;
-uniform highp float _VerticalBillboarding;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp mat4 glstate_matrix_mvp;
-void CalcOrthonormalBasis( in highp vec3 dir, out highp vec3 right, out highp vec3 up );
-highp float CalcFadeOutFactor( in highp float dist );
-highp float CalcDistScale( in highp float dist );
-v2f xlat_main( in appdata_full v );
-void CalcOrthonormalBasis( in highp vec3 dir, out highp vec3 right, out highp vec3 up ) {
- up = (( (abs( dir.y ) > 0.999000) ) ? ( vec3( 0.0, 0.0, 1.0) ) : ( vec3( 0.0, 1.0, 0.0) ));
- right = normalize( cross( up, dir) );
- up = cross( dir, right);
-}
-highp float CalcFadeOutFactor( in highp float dist ) {
- highp float nfadeout;
- highp float ffadeout;
- nfadeout = xll_saturate( (dist / _FadeOutDistNear) );
- ffadeout = (1.00000 - xll_saturate( (max( (dist - _FadeOutDistFar), 0.00000) * 0.200000) ));
- ffadeout *= ffadeout;
- nfadeout *= nfadeout;
- nfadeout *= nfadeout;
- nfadeout *= ffadeout;
- return nfadeout;
-}
-highp float CalcDistScale( in highp float dist ) {
- highp float distScale;
- distScale = min( (max( (dist - _SizeGrowStartDist), 0.00000) / _SizeGrowEndDist), 1.00000);
- return ((distScale * distScale) * _MaxGrowSize);
-}
-v2f xlat_main( in appdata_full v ) {
- highp vec3 centerOffs;
- highp vec3 centerLocal;
- highp vec3 viewerLocal;
- highp vec3 localDir;
- highp float localDirLength;
- highp vec3 rightLocal;
- highp vec3 upLocal;
- highp float distScale;
- highp vec3 BBNormal;
- highp vec3 BBLocalPos;
- highp float time;
- highp float fracTime;
- highp float wave;
- highp float noiseTime;
- highp float noise;
- highp float noiseWave;
- v2f o;
- centerOffs = (vec3( (vec2( 0.500000) - v.color.xy ), 0.00000) * v.texcoord1.xyy );
- centerLocal = (v.vertex.xyz + centerOffs.xyz );
- viewerLocal = vec3( ( _World2Object * vec4( _WorldSpaceCameraPos, 1.00000) ));
- localDir = (viewerLocal - centerLocal);
- localDir.y = mix( 0.00000, localDir.y , _VerticalBillboarding);
- localDirLength = length( localDir );
- CalcOrthonormalBasis( (localDir / localDirLength), rightLocal, upLocal);
- distScale = (CalcDistScale( localDirLength) * v.color.w );
- BBNormal = ((rightLocal * v.normal.x ) + (upLocal * v.normal.y ));
- BBLocalPos = ((centerLocal - ((rightLocal * centerOffs.x ) + (upLocal * centerOffs.y ))) + (BBNormal * distScale));
- time = (_Time.y + (_BlinkingTimeOffsScale * v.color.z ));
- fracTime = xll_mod( time, (_TimeOnDuration + _TimeOffDuration));
- wave = (smoothstep( 0.00000, (_TimeOnDuration * 0.250000), fracTime) * (1.00000 - smoothstep( (_TimeOnDuration * 0.750000), _TimeOnDuration, fracTime)));
- noiseTime = (time * (6.28319 / _TimeOnDuration));
- noise = (sin( noiseTime ) * ((0.500000 * cos( ((noiseTime * 0.636600) + 56.7272) )) + 0.500000));
- noiseWave = ((_NoiseAmount * noise) + (1.00000 - _NoiseAmount));
- wave = (( (_NoiseAmount < 0.0100000) ) ? ( wave ) : ( noiseWave ));
- wave += _Bias;
- o.uv = v.texcoord.xy ;
- o.pos = ( glstate_matrix_mvp * vec4( BBLocalPos, 1.00000) );
- o.color = (((CalcFadeOutFactor( localDirLength) * _Color) * _Multiplier) * wave);
- return o;
-}
-in highp vec4 _inVertex;
-in mediump vec3 _inNormal;
-in highp vec4 _uv0;
-in highp vec4 _uv1;
-in lowp vec4 _color;
-in vec4 TANGENT;
-out highp vec2 xlv_TEXCOORD0;
-out lowp vec4 xlv_TEXCOORD1;
-void main() {
- v2f xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = _inVertex;
- xlt_v.tangent = TANGENT;
- xlt_v.normal = _inNormal;
- xlt_v.texcoord = _uv0;
- xlt_v.texcoord1 = _uv1;
- xlt_v.color = _color;
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4(xl_retval.pos);
- xlv_TEXCOORD0 = vec2( xl_retval.uv);
- xlv_TEXCOORD1 = vec4( xl_retval.color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt
deleted file mode 100644
index f95b0ac21f3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES.txt
+++ /dev/null
@@ -1,167 +0,0 @@
-attribute highp vec4 _glesVertex;
-attribute mediump vec3 _glesNormal;
-attribute highp vec4 _glesMultiTexCoord0;
-attribute highp vec4 _glesMultiTexCoord1;
-attribute lowp vec4 _glesColor;
-uniform highp float _Bias;
-uniform highp float _BlinkingTimeOffsScale;
-uniform highp vec4 _Color;
-uniform highp float _FadeOutDistFar;
-uniform highp float _FadeOutDistNear;
-uniform highp float _MaxGrowSize;
-uniform highp float _Multiplier;
-uniform highp float _NoiseAmount;
-uniform highp float _SizeGrowEndDist;
-uniform highp float _SizeGrowStartDist;
-uniform highp vec4 _Time;
-uniform highp float _TimeOffDuration;
-uniform highp float _TimeOnDuration;
-uniform highp float _VerticalBillboarding;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp mat4 glstate_matrix_mvp;
-varying highp vec2 xlv_TEXCOORD0;
-varying lowp vec4 xlv_TEXCOORD1;
-void main ()
-{
- highp vec3 tmpvar_1;
- highp vec4 tmpvar_2;
- tmpvar_1 = _glesNormal;
- tmpvar_2 = _glesColor;
- lowp vec4 tmpvar_3;
- highp float noiseWave_4;
- highp float noiseTime_5;
- highp float wave_6;
- highp float time_7;
- highp vec3 BBLocalPos_8;
- highp vec3 localDir_9;
- highp vec3 centerLocal_10;
- highp vec3 centerOffs_11;
- highp vec3 tmpvar_12;
- tmpvar_12.z = 0.0;
- tmpvar_12.xy = (vec2(0.5, 0.5) - tmpvar_2.xy);
- centerOffs_11 = (tmpvar_12 * _glesMultiTexCoord1.xyy);
- centerLocal_10 = (_glesVertex.xyz + centerOffs_11);
- highp vec4 tmpvar_13;
- tmpvar_13.w = 1.0;
- tmpvar_13.xyz = _WorldSpaceCameraPos;
- localDir_9 = ((_World2Object * tmpvar_13).xyz - centerLocal_10);
- localDir_9.y = (localDir_9.y * _VerticalBillboarding);
- highp float tmpvar_14;
- tmpvar_14 = sqrt(dot (localDir_9, localDir_9));
- highp vec3 dir_15;
- dir_15 = (localDir_9 / tmpvar_14);
- highp float tmpvar_16;
- tmpvar_16 = abs(dir_15.y);
- highp vec3 tmpvar_17;
- if ((tmpvar_16 > 0.999)) {
- tmpvar_17 = vec3(0.0, 0.0, 1.0);
- } else {
- tmpvar_17 = vec3(0.0, 1.0, 0.0);
- };
- highp vec3 tmpvar_18;
- tmpvar_18 = normalize(((tmpvar_17.yzx * dir_15.zxy) - (tmpvar_17.zxy * dir_15.yzx)));
- highp vec3 tmpvar_19;
- tmpvar_19 = ((dir_15.yzx * tmpvar_18.zxy) - (dir_15.zxy * tmpvar_18.yzx));
- highp float tmpvar_20;
- tmpvar_20 = min ((max (
- (tmpvar_14 - _SizeGrowStartDist)
- , 0.0) / _SizeGrowEndDist), 1.0);
- BBLocalPos_8 = ((centerLocal_10 - (
- (tmpvar_18 * centerOffs_11.x)
- +
- (tmpvar_19 * centerOffs_11.y)
- )) + ((
- (tmpvar_18 * tmpvar_1.x)
- +
- (tmpvar_19 * tmpvar_1.y)
- ) * (
- (tmpvar_20 * tmpvar_20)
- *
- (_MaxGrowSize * tmpvar_2.w)
- )));
- time_7 = (_Time.y + (_BlinkingTimeOffsScale * tmpvar_2.z));
- highp float y_21;
- y_21 = (_TimeOnDuration + _TimeOffDuration);
- highp float tmpvar_22;
- tmpvar_22 = (time_7 / y_21);
- highp float tmpvar_23;
- tmpvar_23 = (fract(abs(tmpvar_22)) * y_21);
- highp float tmpvar_24;
- if ((tmpvar_22 >= 0.0)) {
- tmpvar_24 = tmpvar_23;
- } else {
- tmpvar_24 = -(tmpvar_23);
- };
- highp float tmpvar_25;
- tmpvar_25 = clamp ((tmpvar_24 / (_TimeOnDuration * 0.25)), 0.0, 1.0);
- highp float edge0_26;
- edge0_26 = (_TimeOnDuration * 0.75);
- highp float tmpvar_27;
- tmpvar_27 = clamp (((tmpvar_24 - edge0_26) / (_TimeOnDuration - edge0_26)), 0.0, 1.0);
- wave_6 = ((tmpvar_25 * (tmpvar_25 *
- (3.0 - (2.0 * tmpvar_25))
- )) * (1.0 - (tmpvar_27 *
- (tmpvar_27 * (3.0 - (2.0 * tmpvar_27)))
- )));
- noiseTime_5 = (time_7 * (6.28319 / _TimeOnDuration));
- noiseWave_4 = ((_NoiseAmount * (
- sin(noiseTime_5)
- *
- ((0.5 * cos((
- (noiseTime_5 * 0.6366)
- + 56.7272))) + 0.5)
- )) + (1.0 - _NoiseAmount));
- highp float tmpvar_28;
- if ((_NoiseAmount < 0.01)) {
- tmpvar_28 = wave_6;
- } else {
- tmpvar_28 = noiseWave_4;
- };
- wave_6 = (tmpvar_28 + _Bias);
- highp vec4 tmpvar_29;
- tmpvar_29.w = 1.0;
- tmpvar_29.xyz = BBLocalPos_8;
- highp float ffadeout_30;
- highp float nfadeout_31;
- highp float tmpvar_32;
- tmpvar_32 = clamp ((tmpvar_14 / _FadeOutDistNear), 0.0, 1.0);
- ffadeout_30 = (1.0 - clamp ((
- max ((tmpvar_14 - _FadeOutDistFar), 0.0)
- * 0.2), 0.0, 1.0));
- ffadeout_30 = (ffadeout_30 * ffadeout_30);
- nfadeout_31 = (tmpvar_32 * tmpvar_32);
- nfadeout_31 = (nfadeout_31 * nfadeout_31);
- nfadeout_31 = (nfadeout_31 * ffadeout_30);
- tmpvar_3 = ((nfadeout_31 * _Color) * (_Multiplier * wave_6));
- gl_Position = (glstate_matrix_mvp * tmpvar_29);
- xlv_TEXCOORD0 = _glesMultiTexCoord0.xy;
- xlv_TEXCOORD1 = tmpvar_3;
-}
-
-
-// stats: 95 alu 0 tex 3 flow
-// inputs: 5
-// #0: _glesVertex (high float) 4x1 [-1]
-// #1: _glesNormal (medium float) 3x1 [-1]
-// #2: _glesMultiTexCoord0 (high float) 4x1 [-1]
-// #3: _glesMultiTexCoord1 (high float) 4x1 [-1]
-// #4: _glesColor (low float) 4x1 [-1]
-// uniforms: 17 (total size: 0)
-// #0: _Bias (high float) 1x1 [-1]
-// #1: _BlinkingTimeOffsScale (high float) 1x1 [-1]
-// #2: _Color (high float) 4x1 [-1]
-// #3: _FadeOutDistFar (high float) 1x1 [-1]
-// #4: _FadeOutDistNear (high float) 1x1 [-1]
-// #5: _MaxGrowSize (high float) 1x1 [-1]
-// #6: _Multiplier (high float) 1x1 [-1]
-// #7: _NoiseAmount (high float) 1x1 [-1]
-// #8: _SizeGrowEndDist (high float) 1x1 [-1]
-// #9: _SizeGrowStartDist (high float) 1x1 [-1]
-// #10: _Time (high float) 4x1 [-1]
-// #11: _TimeOffDuration (high float) 1x1 [-1]
-// #12: _TimeOnDuration (high float) 1x1 [-1]
-// #13: _VerticalBillboarding (high float) 1x1 [-1]
-// #14: _World2Object (high float) 4x4 [-1]
-// #15: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #16: glstate_matrix_mvp (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt
deleted file mode 100644
index 25c7976a40f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3.txt
+++ /dev/null
@@ -1,168 +0,0 @@
-#version 300 es
-uniform highp float _Bias;
-uniform highp float _BlinkingTimeOffsScale;
-uniform highp vec4 _Color;
-uniform highp float _FadeOutDistFar;
-uniform highp float _FadeOutDistNear;
-uniform highp float _MaxGrowSize;
-uniform highp float _Multiplier;
-uniform highp float _NoiseAmount;
-uniform highp float _SizeGrowEndDist;
-uniform highp float _SizeGrowStartDist;
-uniform highp vec4 _Time;
-uniform highp float _TimeOffDuration;
-uniform highp float _TimeOnDuration;
-uniform highp float _VerticalBillboarding;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp mat4 glstate_matrix_mvp;
-in highp vec4 _inVertex;
-in mediump vec3 _inNormal;
-in highp vec4 _uv0;
-in highp vec4 _uv1;
-in lowp vec4 _color;
-out highp vec2 xlv_TEXCOORD0;
-out lowp vec4 xlv_TEXCOORD1;
-void main ()
-{
- highp vec3 tmpvar_1;
- highp vec4 tmpvar_2;
- tmpvar_1 = _inNormal;
- tmpvar_2 = _color;
- lowp vec4 tmpvar_3;
- highp float noiseWave_4;
- highp float noiseTime_5;
- highp float wave_6;
- highp float time_7;
- highp vec3 BBLocalPos_8;
- highp vec3 localDir_9;
- highp vec3 centerLocal_10;
- highp vec3 centerOffs_11;
- highp vec3 tmpvar_12;
- tmpvar_12.z = 0.0;
- tmpvar_12.xy = (vec2(0.5, 0.5) - tmpvar_2.xy);
- centerOffs_11 = (tmpvar_12 * _uv1.xyy);
- centerLocal_10 = (_inVertex.xyz + centerOffs_11);
- highp vec4 tmpvar_13;
- tmpvar_13.w = 1.0;
- tmpvar_13.xyz = _WorldSpaceCameraPos;
- localDir_9 = ((_World2Object * tmpvar_13).xyz - centerLocal_10);
- localDir_9.y = (localDir_9.y * _VerticalBillboarding);
- highp float tmpvar_14;
- tmpvar_14 = sqrt(dot (localDir_9, localDir_9));
- highp vec3 dir_15;
- dir_15 = (localDir_9 / tmpvar_14);
- highp float tmpvar_16;
- tmpvar_16 = abs(dir_15.y);
- highp vec3 tmpvar_17;
- if ((tmpvar_16 > 0.999)) {
- tmpvar_17 = vec3(0.0, 0.0, 1.0);
- } else {
- tmpvar_17 = vec3(0.0, 1.0, 0.0);
- };
- highp vec3 tmpvar_18;
- tmpvar_18 = normalize(((tmpvar_17.yzx * dir_15.zxy) - (tmpvar_17.zxy * dir_15.yzx)));
- highp vec3 tmpvar_19;
- tmpvar_19 = ((dir_15.yzx * tmpvar_18.zxy) - (dir_15.zxy * tmpvar_18.yzx));
- highp float tmpvar_20;
- tmpvar_20 = min ((max (
- (tmpvar_14 - _SizeGrowStartDist)
- , 0.0) / _SizeGrowEndDist), 1.0);
- BBLocalPos_8 = ((centerLocal_10 - (
- (tmpvar_18 * centerOffs_11.x)
- +
- (tmpvar_19 * centerOffs_11.y)
- )) + ((
- (tmpvar_18 * tmpvar_1.x)
- +
- (tmpvar_19 * tmpvar_1.y)
- ) * (
- (tmpvar_20 * tmpvar_20)
- *
- (_MaxGrowSize * tmpvar_2.w)
- )));
- time_7 = (_Time.y + (_BlinkingTimeOffsScale * tmpvar_2.z));
- highp float y_21;
- y_21 = (_TimeOnDuration + _TimeOffDuration);
- highp float tmpvar_22;
- tmpvar_22 = (time_7 / y_21);
- highp float tmpvar_23;
- tmpvar_23 = (fract(abs(tmpvar_22)) * y_21);
- highp float tmpvar_24;
- if ((tmpvar_22 >= 0.0)) {
- tmpvar_24 = tmpvar_23;
- } else {
- tmpvar_24 = -(tmpvar_23);
- };
- highp float tmpvar_25;
- tmpvar_25 = clamp ((tmpvar_24 / (_TimeOnDuration * 0.25)), 0.0, 1.0);
- highp float edge0_26;
- edge0_26 = (_TimeOnDuration * 0.75);
- highp float tmpvar_27;
- tmpvar_27 = clamp (((tmpvar_24 - edge0_26) / (_TimeOnDuration - edge0_26)), 0.0, 1.0);
- wave_6 = ((tmpvar_25 * (tmpvar_25 *
- (3.0 - (2.0 * tmpvar_25))
- )) * (1.0 - (tmpvar_27 *
- (tmpvar_27 * (3.0 - (2.0 * tmpvar_27)))
- )));
- noiseTime_5 = (time_7 * (6.28319 / _TimeOnDuration));
- noiseWave_4 = ((_NoiseAmount * (
- sin(noiseTime_5)
- *
- ((0.5 * cos((
- (noiseTime_5 * 0.6366)
- + 56.7272))) + 0.5)
- )) + (1.0 - _NoiseAmount));
- highp float tmpvar_28;
- if ((_NoiseAmount < 0.01)) {
- tmpvar_28 = wave_6;
- } else {
- tmpvar_28 = noiseWave_4;
- };
- wave_6 = (tmpvar_28 + _Bias);
- highp vec4 tmpvar_29;
- tmpvar_29.w = 1.0;
- tmpvar_29.xyz = BBLocalPos_8;
- highp float ffadeout_30;
- highp float nfadeout_31;
- highp float tmpvar_32;
- tmpvar_32 = clamp ((tmpvar_14 / _FadeOutDistNear), 0.0, 1.0);
- ffadeout_30 = (1.0 - clamp ((
- max ((tmpvar_14 - _FadeOutDistFar), 0.0)
- * 0.2), 0.0, 1.0));
- ffadeout_30 = (ffadeout_30 * ffadeout_30);
- nfadeout_31 = (tmpvar_32 * tmpvar_32);
- nfadeout_31 = (nfadeout_31 * nfadeout_31);
- nfadeout_31 = (nfadeout_31 * ffadeout_30);
- tmpvar_3 = ((nfadeout_31 * _Color) * (_Multiplier * wave_6));
- gl_Position = (glstate_matrix_mvp * tmpvar_29);
- xlv_TEXCOORD0 = _uv0.xy;
- xlv_TEXCOORD1 = tmpvar_3;
-}
-
-
-// stats: 95 alu 0 tex 3 flow
-// inputs: 5
-// #0: _inVertex (high float) 4x1 [-1]
-// #1: _inNormal (medium float) 3x1 [-1]
-// #2: _uv0 (high float) 4x1 [-1]
-// #3: _uv1 (high float) 4x1 [-1]
-// #4: _color (low float) 4x1 [-1]
-// uniforms: 17 (total size: 0)
-// #0: _Bias (high float) 1x1 [-1]
-// #1: _BlinkingTimeOffsScale (high float) 1x1 [-1]
-// #2: _Color (high float) 4x1 [-1]
-// #3: _FadeOutDistFar (high float) 1x1 [-1]
-// #4: _FadeOutDistNear (high float) 1x1 [-1]
-// #5: _MaxGrowSize (high float) 1x1 [-1]
-// #6: _Multiplier (high float) 1x1 [-1]
-// #7: _NoiseAmount (high float) 1x1 [-1]
-// #8: _SizeGrowEndDist (high float) 1x1 [-1]
-// #9: _SizeGrowStartDist (high float) 1x1 [-1]
-// #10: _Time (high float) 4x1 [-1]
-// #11: _TimeOffDuration (high float) 1x1 [-1]
-// #12: _TimeOnDuration (high float) 1x1 [-1]
-// #13: _VerticalBillboarding (high float) 1x1 [-1]
-// #14: _World2Object (high float) 4x4 [-1]
-// #15: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #16: glstate_matrix_mvp (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3Metal.txt
deleted file mode 100644
index 54ce7a9d98c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/MF-GodRays-outES3Metal.txt
+++ /dev/null
@@ -1,179 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 _inVertex [[attribute(0)]];
- half3 _inNormal [[attribute(1)]];
- float4 _uv0 [[attribute(2)]];
- float4 _uv1 [[attribute(3)]];
- half4 _color [[attribute(4)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- float2 xlv_TEXCOORD0;
- half4 xlv_TEXCOORD1;
-};
-struct xlatMtlShaderUniform {
- float _Bias;
- float _BlinkingTimeOffsScale;
- float4 _Color;
- float _FadeOutDistFar;
- float _FadeOutDistNear;
- float _MaxGrowSize;
- float _Multiplier;
- float _NoiseAmount;
- float _SizeGrowEndDist;
- float _SizeGrowStartDist;
- float4 _Time;
- float _TimeOffDuration;
- float _TimeOnDuration;
- float _VerticalBillboarding;
- float4x4 _World2Object;
- float3 _WorldSpaceCameraPos;
- float4x4 glstate_matrix_mvp;
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float3 tmpvar_1 = 0;
- float4 tmpvar_2 = 0;
- tmpvar_1 = float3(_mtl_i._inNormal);
- tmpvar_2 = float4(_mtl_i._color);
- half4 tmpvar_3 = 0;
- float noiseWave_4 = 0;
- float noiseTime_5 = 0;
- float wave_6 = 0;
- float time_7 = 0;
- float3 BBLocalPos_8 = 0;
- float3 localDir_9 = 0;
- float3 centerLocal_10 = 0;
- float3 centerOffs_11 = 0;
- float3 tmpvar_12 = 0;
- tmpvar_12.z = 0.0;
- tmpvar_12.xy = (float2(0.5, 0.5) - tmpvar_2.xy);
- centerOffs_11 = (tmpvar_12 * _mtl_i._uv1.xyy);
- centerLocal_10 = (_mtl_i._inVertex.xyz + centerOffs_11);
- float4 tmpvar_13 = 0;
- tmpvar_13.w = 1.0;
- tmpvar_13.xyz = _mtl_u._WorldSpaceCameraPos;
- localDir_9 = ((_mtl_u._World2Object * tmpvar_13).xyz - centerLocal_10);
- localDir_9.y = (localDir_9.y * _mtl_u._VerticalBillboarding);
- float tmpvar_14 = 0;
- tmpvar_14 = sqrt(dot (localDir_9, localDir_9));
- float3 dir_15 = 0;
- dir_15 = (localDir_9 / tmpvar_14);
- float tmpvar_16 = 0;
- tmpvar_16 = abs(dir_15.y);
- float3 tmpvar_17 = 0;
- if ((tmpvar_16 > 0.999)) {
- tmpvar_17 = float3(0.0, 0.0, 1.0);
- } else {
- tmpvar_17 = float3(0.0, 1.0, 0.0);
- };
- float3 tmpvar_18 = 0;
- tmpvar_18 = normalize(((tmpvar_17.yzx * dir_15.zxy) - (tmpvar_17.zxy * dir_15.yzx)));
- float3 tmpvar_19 = 0;
- tmpvar_19 = ((dir_15.yzx * tmpvar_18.zxy) - (dir_15.zxy * tmpvar_18.yzx));
- float tmpvar_20 = 0;
- tmpvar_20 = min ((max (
- (tmpvar_14 - _mtl_u._SizeGrowStartDist)
- , 0.0) / _mtl_u._SizeGrowEndDist), 1.0);
- BBLocalPos_8 = ((centerLocal_10 - (
- (tmpvar_18 * centerOffs_11.x)
- +
- (tmpvar_19 * centerOffs_11.y)
- )) + ((
- (tmpvar_18 * tmpvar_1.x)
- +
- (tmpvar_19 * tmpvar_1.y)
- ) * (
- (tmpvar_20 * tmpvar_20)
- *
- (_mtl_u._MaxGrowSize * tmpvar_2.w)
- )));
- time_7 = (_mtl_u._Time.y + (_mtl_u._BlinkingTimeOffsScale * tmpvar_2.z));
- float y_21 = 0;
- y_21 = (_mtl_u._TimeOnDuration + _mtl_u._TimeOffDuration);
- float tmpvar_22 = 0;
- tmpvar_22 = (time_7 / y_21);
- float tmpvar_23 = 0;
- tmpvar_23 = (fract(abs(tmpvar_22)) * y_21);
- float tmpvar_24 = 0;
- if ((tmpvar_22 >= 0.0)) {
- tmpvar_24 = tmpvar_23;
- } else {
- tmpvar_24 = -(tmpvar_23);
- };
- float tmpvar_25 = 0;
- tmpvar_25 = clamp ((tmpvar_24 / (_mtl_u._TimeOnDuration * 0.25)), 0.0, 1.0);
- float edge0_26 = 0;
- edge0_26 = (_mtl_u._TimeOnDuration * 0.75);
- float tmpvar_27 = 0;
- tmpvar_27 = clamp (((tmpvar_24 - edge0_26) / (_mtl_u._TimeOnDuration - edge0_26)), 0.0, 1.0);
- wave_6 = ((tmpvar_25 * (tmpvar_25 *
- (3.0 - (2.0 * tmpvar_25))
- )) * (1.0 - (tmpvar_27 *
- (tmpvar_27 * (3.0 - (2.0 * tmpvar_27)))
- )));
- noiseTime_5 = (time_7 * (6.28319 / _mtl_u._TimeOnDuration));
- noiseWave_4 = ((_mtl_u._NoiseAmount * (
- sin(noiseTime_5)
- *
- ((0.5 * cos((
- (noiseTime_5 * 0.6366)
- + 56.7272))) + 0.5)
- )) + (1.0 - _mtl_u._NoiseAmount));
- float tmpvar_28 = 0;
- if ((_mtl_u._NoiseAmount < 0.01)) {
- tmpvar_28 = wave_6;
- } else {
- tmpvar_28 = noiseWave_4;
- };
- wave_6 = (tmpvar_28 + _mtl_u._Bias);
- float4 tmpvar_29 = 0;
- tmpvar_29.w = 1.0;
- tmpvar_29.xyz = BBLocalPos_8;
- float ffadeout_30 = 0;
- float nfadeout_31 = 0;
- float tmpvar_32 = 0;
- tmpvar_32 = clamp ((tmpvar_14 / _mtl_u._FadeOutDistNear), 0.0, 1.0);
- ffadeout_30 = (1.0 - clamp ((
- max ((tmpvar_14 - _mtl_u._FadeOutDistFar), 0.0)
- * 0.2), 0.0, 1.0));
- ffadeout_30 = (ffadeout_30 * ffadeout_30);
- nfadeout_31 = (tmpvar_32 * tmpvar_32);
- nfadeout_31 = (nfadeout_31 * nfadeout_31);
- nfadeout_31 = (nfadeout_31 * ffadeout_30);
- tmpvar_3 = half4(((nfadeout_31 * _mtl_u._Color) * (_mtl_u._Multiplier * wave_6)));
- _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * tmpvar_29);
- _mtl_o.xlv_TEXCOORD0 = _mtl_i._uv0.xy;
- _mtl_o.xlv_TEXCOORD1 = tmpvar_3;
- return _mtl_o;
-}
-
-
-// stats: 95 alu 0 tex 3 flow
-// inputs: 5
-// #0: _inVertex (high float) 4x1 [-1] loc 0
-// #1: _inNormal (medium float) 3x1 [-1] loc 1
-// #2: _uv0 (high float) 4x1 [-1] loc 2
-// #3: _uv1 (high float) 4x1 [-1] loc 3
-// #4: _color (low float) 4x1 [-1] loc 4
-// uniforms: 17 (total size: 240)
-// #0: _Bias (high float) 1x1 [-1] loc 0
-// #1: _BlinkingTimeOffsScale (high float) 1x1 [-1] loc 4
-// #2: _Color (high float) 4x1 [-1] loc 16
-// #3: _FadeOutDistFar (high float) 1x1 [-1] loc 32
-// #4: _FadeOutDistNear (high float) 1x1 [-1] loc 36
-// #5: _MaxGrowSize (high float) 1x1 [-1] loc 40
-// #6: _Multiplier (high float) 1x1 [-1] loc 44
-// #7: _NoiseAmount (high float) 1x1 [-1] loc 48
-// #8: _SizeGrowEndDist (high float) 1x1 [-1] loc 52
-// #9: _SizeGrowStartDist (high float) 1x1 [-1] loc 56
-// #10: _Time (high float) 4x1 [-1] loc 64
-// #11: _TimeOffDuration (high float) 1x1 [-1] loc 80
-// #12: _TimeOnDuration (high float) 1x1 [-1] loc 84
-// #13: _VerticalBillboarding (high float) 1x1 [-1] loc 88
-// #14: _World2Object (high float) 4x4 [-1] loc 96
-// #15: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 160
-// #16: glstate_matrix_mvp (high float) 4x4 [-1] loc 176
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-in.txt
deleted file mode 100644
index 6bc63839019..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-in.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-// https://github.com/aras-p/glsl-optimizer/issues/48
-
-attribute vec3 _in_position;
-
-uniform mat4 mtx;
-
-void main()
-{
- mat4 m = mtx;
- // chained assignments used to not work, #48
- m[0][1] = m[0][2] = m[0][3] = 0.0;
- gl_Position = m * vec4(_in_position,1);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-out.txt
deleted file mode 100644
index c8c69cd8f93..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-chained-assign-out.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-attribute vec3 _in_position;
-uniform mat4 mtx;
-void main ()
-{
- mat4 m_1;
- m_1 = mtx;
- vec4 tmpvar_2;
- tmpvar_2.xyz = mtx[0].xyz;
- tmpvar_2.w = 0.0;
- m_1[0] = tmpvar_2;
- vec4 tmpvar_3;
- tmpvar_3.xyw = m_1[0].xyw;
- tmpvar_3.z = tmpvar_2.w;
- m_1[0] = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.xzw = m_1[0].xzw;
- tmpvar_4.y = tmpvar_3.z;
- m_1[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = _in_position;
- gl_Position = (m_1 * tmpvar_5);
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 1
-// #0: _in_position (high float) 3x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: mtx (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-in.txt
deleted file mode 100644
index 20037291af6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-in.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-#define MAX_ITER 5
-
-attribute vec4 a_position;
-
-uniform int u_iter;
-uniform vec4 u_deltas[MAX_ITER];
-
-int my_min(int a, int b) {
- if (a < b) {
- return a;
- } else {
- return b;
- }
-}
-
-void main() {
- gl_Position = a_position;
- for (int i = 0; i < my_min(u_iter, MAX_ITER); i++) {
- gl_Position += u_deltas[i];
- }
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-out.txt
deleted file mode 100644
index 466dd275008..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-loops-for-while-out.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-attribute vec4 a_position;
-uniform int u_iter;
-uniform vec4 u_deltas[5];
-void main ()
-{
- int i_1;
- gl_Position = a_position;
- i_1 = 0;
- while (true) {
- int tmpvar_2;
- if ((u_iter < 5)) {
- tmpvar_2 = u_iter;
- } else {
- tmpvar_2 = 5;
- };
- if ((i_1 >= tmpvar_2)) {
- break;
- };
- gl_Position = (gl_Position + u_deltas[i_1]);
- i_1++;
- };
-}
-
-
-// stats: 6 alu 0 tex 3 flow
-// inputs: 1
-// #0: a_position (high float) 4x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: u_iter (high int) 1x1 [-1]
-// #1: u_deltas (high float) 4x1 [5]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-in.txt
deleted file mode 100644
index 34240932528..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-in.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-// https://github.com/aras-p/glsl-optimizer/issues/18
-
-struct shadow_map_t
-{
- mat4 transform;
-};
-
-uniform shadow_map_t ShadowMaps[1];
-attribute vec3 _in_position;
-
-void main()
-{
- gl_Position = ShadowMaps[0].transform * vec4(_in_position,1);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-out.txt
deleted file mode 100644
index b2cdc2fd2e3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-struct-uniform-out.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-struct shadow_map_t {
- mat4 transform;
-};
-uniform shadow_map_t ShadowMaps[1];
-attribute vec3 _in_position;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1.w = 1.0;
- tmpvar_1.xyz = _in_position;
- gl_Position = (ShadowMaps[0].transform * tmpvar_1);
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 1
-// #0: _in_position (high float) 3x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: ShadowMaps (high other) 0x0 [1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-inES3.txt
deleted file mode 100644
index 32fa17da078..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-inES3.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-#version 300 es
-
-// Metal translation was producing a wrong typecast
-// on o.backContrib[j] = (backContrib * 2.0) expression;
-// was thinking LHS is a float3
-
-#define gl_Vertex _glesVertex
-in vec4 _glesVertex;
-#define gl_Normal _glesNormal
-in vec3 _glesNormal;
-float xll_saturate_f( float x) {
- return clamp( x, 0.0, 1.0);
-}
-struct appdata_full {
- highp vec4 vertex;
- highp vec3 normal;
-};
-struct v2f {
- highp vec4 pos;
- highp vec3 backContrib;
-};
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp mat4 glstate_matrix_mvp;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _TerrainTreeLightDirections[4];
-highp vec3 ObjSpaceViewDir( in highp vec4 v ) {
- highp vec3 objSpaceCameraPos = (_World2Object * vec4( _WorldSpaceCameraPos.xyz, 1.0)).xyz;
- return (objSpaceCameraPos - v.xyz);
-}
-v2f vert( in appdata_full v ) {
- v2f o;
- o.pos = (glstate_matrix_mvp * v.vertex);
- highp vec3 viewDir = normalize(ObjSpaceViewDir( v.vertex));
- highp int j = 0;
- for ( ; (j < 3); (j++)) {
- highp vec3 lightDir = _TerrainTreeLightDirections[j];
- mediump float nl = dot( v.normal, lightDir);
- mediump float backContrib = xll_saturate_f(dot( viewDir, (-lightDir)));
- o.backContrib[j] = (backContrib * 2.0);
- }
- return o;
-}
-
-out highp vec3 xlv_TEXCOORD2;
-void main() {
- v2f xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4(gl_Vertex);
- xlt_v.normal = vec3(gl_Normal);
- xl_retval = vert( xlt_v);
- gl_Position = vec4(xl_retval.pos);
- xlv_TEXCOORD2 = vec3(xl_retval.backContrib);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt
deleted file mode 100644
index f252e00e39e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-#version 300 es
-in vec4 _glesVertex;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp mat4 glstate_matrix_mvp;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _TerrainTreeLightDirections[4];
-out highp vec3 xlv_TEXCOORD2;
-void main ()
-{
- highp vec3 viewDir_1;
- highp vec3 tmpvar_2;
- highp vec4 tmpvar_3;
- tmpvar_3.w = 1.0;
- tmpvar_3.xyz = _WorldSpaceCameraPos;
- viewDir_1 = normalize(((_World2Object * tmpvar_3).xyz - _glesVertex.xyz));
- mediump float tmpvar_4;
- highp float tmpvar_5;
- tmpvar_5 = clamp (dot (viewDir_1, -(_TerrainTreeLightDirections[0])), 0.0, 1.0);
- tmpvar_4 = tmpvar_5;
- highp vec3 tmpvar_6;
- tmpvar_6.yz = tmpvar_2.yz;
- tmpvar_6.x = (tmpvar_4 * 2.0);
- mediump float tmpvar_7;
- highp float tmpvar_8;
- tmpvar_8 = clamp (dot (viewDir_1, -(_TerrainTreeLightDirections[1])), 0.0, 1.0);
- tmpvar_7 = tmpvar_8;
- highp vec3 tmpvar_9;
- tmpvar_9.xz = tmpvar_6.xz;
- tmpvar_9.y = (tmpvar_7 * 2.0);
- mediump float tmpvar_10;
- highp float tmpvar_11;
- tmpvar_11 = clamp (dot (viewDir_1, -(_TerrainTreeLightDirections[2])), 0.0, 1.0);
- tmpvar_10 = tmpvar_11;
- highp vec3 tmpvar_12;
- tmpvar_12.xy = tmpvar_9.xy;
- tmpvar_12.z = (tmpvar_10 * 2.0);
- tmpvar_2 = tmpvar_12;
- gl_Position = (glstate_matrix_mvp * _glesVertex);
- xlv_TEXCOORD2 = tmpvar_12;
-}
-
-
-// stats: 17 alu 0 tex 0 flow
-// inputs: 1
-// #0: _glesVertex (high float) 4x1 [-1]
-// uniforms: 4 (total size: 0)
-// #0: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #1: glstate_matrix_mvp (high float) 4x4 [-1]
-// #2: _World2Object (high float) 4x4 [-1]
-// #3: _TerrainTreeLightDirections (high float) 3x1 [4]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt
deleted file mode 100644
index d4dccdc74a8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-swizzle-lhs-cast-outES3Metal.txt
+++ /dev/null
@@ -1,61 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 _glesVertex [[attribute(0)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- float3 xlv_TEXCOORD2;
-};
-struct xlatMtlShaderUniform {
- float3 _WorldSpaceCameraPos;
- float4x4 glstate_matrix_mvp;
- float4x4 _World2Object;
- float3 _TerrainTreeLightDirections[4];
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float3 viewDir_1 = 0;
- float3 tmpvar_2 = 0;
- float4 tmpvar_3 = 0;
- tmpvar_3.w = 1.0;
- tmpvar_3.xyz = _mtl_u._WorldSpaceCameraPos;
- viewDir_1 = normalize(((_mtl_u._World2Object * tmpvar_3).xyz - _mtl_i._glesVertex.xyz));
- half tmpvar_4 = 0;
- float tmpvar_5 = 0;
- tmpvar_5 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[0])), 0.0, 1.0);
- tmpvar_4 = half(tmpvar_5);
- float3 tmpvar_6 = 0;
- tmpvar_6.yz = tmpvar_2.yz;
- tmpvar_6.x = float((tmpvar_4 * (half)(2.0)));
- half tmpvar_7 = 0;
- float tmpvar_8 = 0;
- tmpvar_8 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[1])), 0.0, 1.0);
- tmpvar_7 = half(tmpvar_8);
- float3 tmpvar_9 = 0;
- tmpvar_9.xz = tmpvar_6.xz;
- tmpvar_9.y = float((tmpvar_7 * (half)(2.0)));
- half tmpvar_10 = 0;
- float tmpvar_11 = 0;
- tmpvar_11 = clamp (dot (viewDir_1, -(_mtl_u._TerrainTreeLightDirections[2])), 0.0, 1.0);
- tmpvar_10 = half(tmpvar_11);
- float3 tmpvar_12 = 0;
- tmpvar_12.xy = tmpvar_9.xy;
- tmpvar_12.z = float((tmpvar_10 * (half)(2.0)));
- tmpvar_2 = tmpvar_12;
- _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex);
- _mtl_o.xlv_TEXCOORD2 = tmpvar_12;
- return _mtl_o;
-}
-
-
-// stats: 17 alu 0 tex 0 flow
-// inputs: 1
-// #0: _glesVertex (high float) 4x1 [-1] loc 0
-// uniforms: 4 (total size: 208)
-// #0: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 0
-// #1: glstate_matrix_mvp (high float) 4x4 [-1] loc 16
-// #2: _World2Object (high float) 4x4 [-1] loc 80
-// #3: _TerrainTreeLightDirections (high float) 3x1 [4] loc 144
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-in.txt
deleted file mode 100644
index 2f1f3992552..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-in.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-varying vec4 var4;
-varying float var1;
-varying vec4 var4ok;
-
-void main()
-{
- var4 = vec4(0.0);
- var1 = 0.5;
- var4ok = gl_Vertex;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-out.txt
deleted file mode 100644
index 435e2991d63..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/bug-varying-const-out.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-varying vec4 var4;
-varying float var1;
-varying vec4 var4ok;
-void main ()
-{
- var4 = vec4(0.0, 0.0, 0.0, 0.0);
- var1 = 0.5;
- var4ok = gl_Vertex;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-in.txt
deleted file mode 100644
index b5d7a308376..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-in.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-#extension GL_ARB_draw_instanced : require
-#extension GL_EXT_gpu_shader4 : require
-
-attribute vec3 _inPos;
-attribute vec3 _inNor;
-
-void main()
-{
- vec3 p;
- p = _inPos;
- p.y += float(gl_VertexID);
- p.y += float(gl_InstanceIDARB);
- p += _inNor;
- gl_Position = vec4(p,1.0);
- gl_PointSize = p.x;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES.txt
deleted file mode 100644
index dbf6c16502f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-#extension GL_EXT_draw_instanced : require
-
-attribute highp vec3 _inPos;
-attribute highp vec3 _inNor;
-
-void main()
-{
- highp vec3 p;
- p = _inPos;
- p.y += float(gl_InstanceIDEXT);
- p += _inNor;
- gl_Position = vec4(p,1.0);
- gl_PointSize = p.x;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES3.txt
deleted file mode 100644
index ef26b6c5a33..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-inES3.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-#version 300 es
-
-in highp vec3 _inPos;
-in highp vec3 _inNor;
-
-void main()
-{
- highp vec3 p;
- p = _inPos;
- p.x += float(gl_VertexID);
- p.y += float(gl_InstanceID);
- p += _inNor;
- gl_Position = vec4(p,1.0);
- gl_PointSize = p.x;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-out.txt
deleted file mode 100644
index 9b18e44eab2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-out.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-#extension GL_ARB_draw_instanced : enable
-#extension GL_EXT_gpu_shader4 : enable
-attribute vec3 _inPos;
-attribute vec3 _inNor;
-void main ()
-{
- vec3 p_1;
- p_1.xz = _inPos.xz;
- p_1.y = (_inPos.y + float(gl_VertexID));
- p_1.y = (p_1.y + float(gl_InstanceIDARB));
- p_1 = (p_1 + _inNor);
- vec4 tmpvar_2;
- tmpvar_2.w = 1.0;
- tmpvar_2.xyz = p_1;
- gl_Position = tmpvar_2;
- gl_PointSize = p_1.x;
-}
-
-
-// stats: 6 alu 0 tex 0 flow
-// inputs: 2
-// #0: _inPos (high float) 3x1 [-1]
-// #1: _inNor (high float) 3x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES.txt
deleted file mode 100644
index f82939e25d1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-#extension GL_EXT_draw_instanced : enable
-attribute highp vec3 _inPos;
-attribute highp vec3 _inNor;
-void main ()
-{
- highp vec3 p_1;
- p_1.xz = _inPos.xz;
- p_1.y = (_inPos.y + float(gl_InstanceIDEXT));
- p_1 = (p_1 + _inNor);
- highp vec4 tmpvar_2;
- tmpvar_2.w = 1.0;
- tmpvar_2.xyz = p_1;
- gl_Position = tmpvar_2;
- gl_PointSize = p_1.x;
-}
-
-
-// stats: 4 alu 0 tex 0 flow
-// inputs: 2
-// #0: _inPos (high float) 3x1 [-1]
-// #1: _inNor (high float) 3x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3.txt
deleted file mode 100644
index 75320d4a35f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-#version 300 es
-in highp vec3 _inPos;
-in highp vec3 _inNor;
-void main ()
-{
- highp vec3 p_1;
- p_1.z = _inPos.z;
- p_1.x = (_inPos.x + float(gl_VertexID));
- p_1.y = (_inPos.y + float(gl_InstanceID));
- p_1 = (p_1 + _inNor);
- highp vec4 tmpvar_2;
- tmpvar_2.w = 1.0;
- tmpvar_2.xyz = p_1;
- gl_Position = tmpvar_2;
- gl_PointSize = p_1.x;
-}
-
-
-// stats: 6 alu 0 tex 0 flow
-// inputs: 2
-// #0: _inPos (high float) 3x1 [-1]
-// #1: _inNor (high float) 3x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3Metal.txt
deleted file mode 100644
index ccaa1b02be9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/builtin-vars-outES3Metal.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float3 _inPos [[attribute(0)]];
- float3 _inNor [[attribute(1)]];
-};
-struct xlatMtlShaderOutput {
- float gl_PointSize [[point_size]];
- float4 gl_Position [[position]];
-};
-struct xlatMtlShaderUniform {
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , uint gl_InstanceID [[instance_id]]
- , uint gl_VertexID [[vertex_id]])
-{
- xlatMtlShaderOutput _mtl_o;
- float3 p_1 = 0;
- p_1.z = _mtl_i._inPos.z;
- p_1.x = (_mtl_i._inPos.x + float(gl_VertexID));
- p_1.y = (_mtl_i._inPos.y + float(gl_InstanceID));
- p_1 = (p_1 + _mtl_i._inNor);
- float4 tmpvar_2 = 0;
- tmpvar_2.w = 1.0;
- tmpvar_2.xyz = p_1;
- _mtl_o.gl_Position = tmpvar_2;
- _mtl_o.gl_PointSize = p_1.x;
- return _mtl_o;
-}
-
-
-// stats: 6 alu 0 tex 0 flow
-// inputs: 2
-// #0: _inPos (high float) 3x1 [-1] loc 0
-// #1: _inNor (high float) 3x1 [-1] loc 1
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/estest1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/estest1-in.txt
deleted file mode 100644
index c668baed166..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/estest1-in.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-struct v2f {
- vec4 pos;
- vec2 uv0;
- vec2 uv1;
-};
-
-attribute vec4 position;
-
-uniform mat4 modelViewProjectionMatrix;
-
-varying vec4 xlv_TEXCOORD0;
-varying vec4 xlv_TEXCOORD1;
-
-void main()
-{
- gl_Position = modelViewProjectionMatrix * position;
- xlv_TEXCOORD0 = vec4(position.xy * vec2(4.0), 0.0, 0.0);
- xlv_TEXCOORD1 = vec4(position.xy, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/estest1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/estest1-out.txt
deleted file mode 100644
index 175aaf44ee4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/estest1-out.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-attribute vec4 position;
-uniform mat4 modelViewProjectionMatrix;
-varying vec4 xlv_TEXCOORD0;
-varying vec4 xlv_TEXCOORD1;
-void main ()
-{
- gl_Position = (modelViewProjectionMatrix * position);
- vec4 tmpvar_1;
- tmpvar_1.zw = vec2(0.0, 0.0);
- tmpvar_1.xy = (position.xy * vec2(4.0, 4.0));
- xlv_TEXCOORD0 = tmpvar_1;
- vec4 tmpvar_2;
- tmpvar_2.zw = vec2(0.0, 0.0);
- tmpvar_2.xy = position.xy;
- xlv_TEXCOORD1 = tmpvar_2;
-}
-
-
-// stats: 4 alu 0 tex 0 flow
-// inputs: 1
-// #0: position (high float) 4x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: modelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-in.txt
deleted file mode 100644
index c6a44d27699..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-in.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-#version 140
-
-uniform vec2 p;
-
-in vec4 position;
-in vec4 icol;
-
-out vec4 col;
-
-void main (void)
-{
- col = icol;
- gl_Position = vec4(p, 0.0, 0.0) + position;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-out.txt
deleted file mode 100644
index 48759e59adf..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-basic-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-#version 140
-uniform vec2 p;
-in vec4 position;
-in vec4 icol;
-out vec4 col;
-void main ()
-{
- col = icol;
- vec4 tmpvar_1;
- tmpvar_1.zw = vec2(0.0, 0.0);
- tmpvar_1.xy = p;
- gl_Position = (tmpvar_1 + position);
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 2
-// #0: position (high float) 4x1 [-1]
-// #1: icol (high float) 4x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: p (high float) 2x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-in.txt
deleted file mode 100644
index d3f4091ba50..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-in.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-#version 140
-
-uniform vec2 p;
-
-in vec4 position;
-in vec4 icol;
-
-out vec4 col;
-flat out ivec4 colint;
-
-void main (void)
-{
- gl_Position = vec4(p, 0.0, 0.0) + position;
-
- // integers & vertex ID & instance ID
- colint.x = gl_VertexID;
- colint.y = gl_InstanceID ^ gl_InstanceID;
- colint.z = gl_InstanceID << 2;
- colint.w = colint.x + colint.y;
-
- // new built-ins
- col.x = trunc(position.x);
- col.y = round(position.y);
- col.z = roundEven(position.y);
- col.w = cosh(position.w);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-out.txt
deleted file mode 100644
index 93bbe01fc06..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/glsl140-integers-out.txt
+++ /dev/null
@@ -1,31 +0,0 @@
-#version 140
-uniform vec2 p;
-in vec4 position;
-out vec4 col;
-flat out ivec4 colint;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1.zw = vec2(0.0, 0.0);
- tmpvar_1.xy = p;
- gl_Position = (tmpvar_1 + position);
- colint.x = gl_VertexID;
- colint.y = (gl_InstanceID ^ gl_InstanceID);
- colint.z = (gl_InstanceID << 2);
- colint.w = (gl_VertexID + colint.y);
- col.x = trunc(position.x);
- float tmpvar_2;
- tmpvar_2 = roundEven(position.y);
- col.y = tmpvar_2;
- col.z = tmpvar_2;
- col.w = (0.5 * (exp(position.w) + exp(
- -(position.w)
- )));
-}
-
-
-// stats: 12 alu 0 tex 0 flow
-// inputs: 1
-// #0: position (high float) 4x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: p (high float) 2x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-inES3.txt
deleted file mode 100644
index d8afdf4bcab..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-inES3.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-#version 300 es
-
-#define gl_Vertex _glesVertex
-in vec4 _glesVertex;
-#define gl_MultiTexCoord0 _glesMultiTexCoord0
-in vec4 _glesMultiTexCoord0;
-#define TANGENT vec4(normalize(_glesTANGENT.xyz), _glesTANGENT.w)
-in vec4 _glesTANGENT;
-
-struct v2f {
- highp vec4 pos;
- mediump vec2 uv;
- lowp vec4 color;
-};
-
-uniform highp mat4 glstate_matrix_mvp;
-
-v2f vert( in highp vec4 pos, in mediump vec2 uv, in highp vec4 tangent ) {
- v2f o;
- o.pos = (glstate_matrix_mvp * pos);
- o.color.xy = (uv * 0.3);
- o.color.xyz += ((tangent.xyz * 0.5) + 0.5);
- o.color.w = 0.0;
- o.uv = uv;
- return o;
-}
-
-out mediump vec2 xlv_TEXCOORD0;
-out lowp vec4 xlv_TEXCOORD1;
-void main() {
- v2f xl_retval;
- xl_retval = vert( vec4(gl_Vertex), vec2(gl_MultiTexCoord0), vec4(TANGENT));
- gl_Position = vec4(xl_retval.pos);
- xlv_TEXCOORD0 = vec2(xl_retval.uv);
- xlv_TEXCOORD1 = vec4(xl_retval.color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt
deleted file mode 100644
index 1c7d3b422ed..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-#version 300 es
-in vec4 _glesVertex;
-in vec4 _glesMultiTexCoord0;
-in vec4 _glesTANGENT;
-uniform highp mat4 glstate_matrix_mvp;
-out mediump vec2 xlv_TEXCOORD0;
-out lowp vec4 xlv_TEXCOORD1;
-void main ()
-{
- highp vec4 tmpvar_1;
- tmpvar_1.xyz = normalize(_glesTANGENT.xyz);
- tmpvar_1.w = _glesTANGENT.w;
- lowp vec4 tmpvar_2;
- tmpvar_2.xy = (_glesMultiTexCoord0.xy * 0.3);
- tmpvar_2.xyz = (tmpvar_2.xyz + ((tmpvar_1.xyz * 0.5) + 0.5));
- tmpvar_2.w = 0.0;
- gl_Position = (glstate_matrix_mvp * _glesVertex);
- xlv_TEXCOORD0 = _glesMultiTexCoord0.xy;
- xlv_TEXCOORD1 = tmpvar_2;
-}
-
-
-// stats: 7 alu 0 tex 0 flow
-// inputs: 3
-// #0: _glesVertex (high float) 4x1 [-1]
-// #1: _glesMultiTexCoord0 (high float) 4x1 [-1]
-// #2: _glesTANGENT (high float) 4x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: glstate_matrix_mvp (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt
deleted file mode 100644
index db6277dee41..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/inputs-outES3Metal.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 _glesVertex [[attribute(0)]];
- float4 _glesMultiTexCoord0 [[attribute(1)]];
- float4 _glesTANGENT [[attribute(2)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- half2 xlv_TEXCOORD0;
- half4 xlv_TEXCOORD1;
-};
-struct xlatMtlShaderUniform {
- float4x4 glstate_matrix_mvp;
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half2 tmpvar_1 = 0;
- tmpvar_1 = half2(_mtl_i._glesMultiTexCoord0.xy);
- float4 tmpvar_2 = 0;
- tmpvar_2.xyz = normalize(_mtl_i._glesTANGENT.xyz);
- tmpvar_2.w = _mtl_i._glesTANGENT.w;
- half4 tmpvar_3 = 0;
- tmpvar_3.xy = (tmpvar_1 * (half)(0.3));
- tmpvar_3.xyz = half3(((float3)(tmpvar_3.xyz) + ((tmpvar_2.xyz * 0.5) + 0.5)));
- tmpvar_3.w = half(0.0);
- _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex);
- _mtl_o.xlv_TEXCOORD0 = tmpvar_1;
- _mtl_o.xlv_TEXCOORD1 = tmpvar_3;
- return _mtl_o;
-}
-
-
-// stats: 7 alu 0 tex 0 flow
-// inputs: 3
-// #0: _glesVertex (high float) 4x1 [-1] loc 0
-// #1: _glesMultiTexCoord0 (high float) 4x1 [-1] loc 1
-// #2: _glesTANGENT (high float) 4x1 [-1] loc 2
-// uniforms: 1 (total size: 64)
-// #0: glstate_matrix_mvp (high float) 4x4 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-in.txt
deleted file mode 100644
index bdfcfff4044..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-in.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f {
- vec4 pos;
- vec4 color;
-};
-struct appdata {
- vec4 vertex;
- vec3 normal;
-};
-uniform mat4 UNITY_MATRIX_IT_MV;
-uniform mat4 UNITY_MATRIX_MV;
-uniform mat4 UNITY_MATRIX_MVP;
-uniform vec4 unity_LightAtten[4];
-uniform vec4 unity_LightColor[4];
-uniform vec4 unity_LightPosition[4];
-vec3 ShadeMyVertexLights( in vec4 vertex, in vec3 normal );
-v2f xlat_main( in appdata v );
-vec3 ShadeMyVertexLights( in vec4 vertex, in vec3 normal ) {
- vec3 viewpos;
- vec3 viewN;
- vec3 lightColor = vec3( 0.00000, 0.00000, 0.00000);
- int i = 0;
- vec3 toLight;
- float lengthSq;
- float atten;
- float diff;
- viewpos = ( UNITY_MATRIX_MV * vertex ).xyz ;
- viewN = ( xll_constructMat3( UNITY_MATRIX_IT_MV) * normal );
- for ( ; (i < 2); ( i++ )) {
- toLight = (unity_LightPosition[ i ].xyz - viewpos.xyz );
- lengthSq = dot( toLight, toLight);
- atten = (1.00000 / (1.00000 + (lengthSq * unity_LightAtten[ i ].z )));
- diff = max( 0.00000, dot( viewN, normalize( toLight )));
- lightColor += (unity_LightColor[ i ].xyz * (diff * atten));
- }
- return (lightColor * 2.00000);
-}
-v2f xlat_main( in appdata v ) {
- v2f o;
- o.pos = ( UNITY_MATRIX_MVP * v.vertex );
- o.color = vec4( ShadeMyVertexLights( v.vertex, v.normal), 1.00000);
- return o;
-}
-varying vec4 xlv_TEXCOORD0;
-void main() {
- v2f xl_retval;
- appdata xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.normal = vec3( gl_Normal);
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_TEXCOORD0 = vec4( xl_retval.color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-out.txt
deleted file mode 100644
index e198de2072d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-out.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-uniform mat4 UNITY_MATRIX_IT_MV;
-uniform mat4 UNITY_MATRIX_MV;
-uniform mat4 UNITY_MATRIX_MVP;
-uniform vec4 unity_LightAtten[4];
-uniform vec4 unity_LightColor[4];
-uniform vec4 unity_LightPosition[4];
-varying vec4 xlv_TEXCOORD0;
-void main ()
-{
- vec3 toLight_1;
- vec3 lightColor_2;
- vec3 viewN_3;
- vec3 viewpos_4;
- viewpos_4 = (UNITY_MATRIX_MV * gl_Vertex).xyz;
- mat3 tmpvar_5;
- tmpvar_5[0] = UNITY_MATRIX_IT_MV[0].xyz;
- tmpvar_5[1] = UNITY_MATRIX_IT_MV[1].xyz;
- tmpvar_5[2] = UNITY_MATRIX_IT_MV[2].xyz;
- viewN_3 = (tmpvar_5 * gl_Normal);
- toLight_1 = (unity_LightPosition[0].xyz - viewpos_4);
- lightColor_2 = (unity_LightColor[0].xyz * (max (0.0,
- dot (viewN_3, normalize(toLight_1))
- ) * (1.0/(
- (1.0 + (dot (toLight_1, toLight_1) * unity_LightAtten[0].z))
- ))));
- toLight_1 = (unity_LightPosition[1].xyz - viewpos_4);
- lightColor_2 = (lightColor_2 + (unity_LightColor[1].xyz * (
- max (0.0, dot (viewN_3, normalize(toLight_1)))
- *
- (1.0/((1.0 + (dot (toLight_1, toLight_1) * unity_LightAtten[1].z))))
- )));
- vec4 tmpvar_6;
- tmpvar_6.w = 1.0;
- tmpvar_6.xyz = (lightColor_2 * 2.0);
- gl_Position = (UNITY_MATRIX_MVP * gl_Vertex);
- xlv_TEXCOORD0 = tmpvar_6;
-}
-
-
-// stats: 26 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: UNITY_MATRIX_IT_MV (high float) 4x4 [-1]
-// #1: UNITY_MATRIX_MV (high float) 4x4 [-1]
-// #2: UNITY_MATRIX_MVP (high float) 4x4 [-1]
-// #3: unity_LightAtten (high float) 4x1 [4]
-// #4: unity_LightColor (high float) 4x1 [4]
-// #5: unity_LightPosition (high float) 4x1 [4]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-in.txt
deleted file mode 100644
index 287bc8d5185..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-in.txt
+++ /dev/null
@@ -1,188 +0,0 @@
-#version 140
-#ifndef SHADER_API_D3D11
- #define SHADER_API_D3D11 1
-#endif
-#ifndef SHADER_API_D3D11
- #define SHADER_API_D3D11 1
-#endif
-struct vec1 {
- float x;
-};
-struct uvec1 {
- uint x;
-};
-struct ivec1 {
- int x;
-};
-uniform Globals {
- vec4 unity_ColorSpaceGrey;
- vec4 _MainTex_ST;
-};
-uniform UnityLighting {
- vec4 _WorldSpaceLightPos0;
- vec4 _LightPositionRange;
- vec4 unity_4LightPosX0;
- vec4 unity_4LightPosY0;
- vec4 unity_4LightPosZ0;
- vec4 unity_4LightAtten0;
- vec4 unity_LightColor[8];
- vec4 unity_LightPosition[8];
- vec4 unity_LightAtten[8];
- vec4 unity_SpotDirection[8];
- vec4 unity_SHAr;
- vec4 unity_SHAg;
- vec4 unity_SHAb;
- vec4 unity_SHBr;
- vec4 unity_SHBg;
- vec4 unity_SHBb;
- vec4 unity_SHC;
-};
-uniform UnityPerDraw {
- vec4 glstate_matrix_mvp[4];
- vec4 glstate_matrix_modelview0[4];
- vec4 glstate_matrix_invtrans_modelview0[4];
- vec4 _Object2World[4];
- vec4 _World2Object[4];
- vec4 unity_Scale;
- vec4 unity_LODFade;
-};
-uniform UnityPerFrame {
- vec4 glstate_matrix_projection[4];
- vec4 glstate_lightmodel_ambient;
- vec4 unity_MatrixV[4];
- vec4 unity_MatrixVP[4];
- vec4 unity_AmbientSky;
- vec4 unity_AmbientGround;
-};
-in vec4 dcl_Input0_POSITION0;
-vec4 Input0;
-in vec4 dcl_Input1_NORMAL0;
-vec4 Input1;
-in vec4 dcl_Input2_TEXCOORD0;
-vec4 Input2;
-#undef Output0
-#define Output0 phase0_Output0
-vec4 phase0_Output0;
- out vec4 VtxGeoOutput1_TEXCOORD0;
-#define Output1 VtxGeoOutput1_TEXCOORD0
- out vec4 VtxGeoOutput2_COLOR0;
-#define Output2 VtxGeoOutput2_COLOR0
-vec4 Temp[4];
-ivec4 Temp_int[4];
-uvec4 Temp_uint[4];
-void main()
-{
- //--- Start Early Main ---
- Input0 = dcl_Input0_POSITION0;
- Input1 = dcl_Input1_NORMAL0;
- Input2 = dcl_Input2_TEXCOORD0;
- //--- End Early Main ---
- //Instruction 0
- //MUL
- Temp[0] = vec4(Input0.yyyy * glstate_matrix_mvp[1]);
- //Instruction 1
- //MAD
- Temp[0] = vec4(glstate_matrix_mvp[0] * Input0.xxxx + Temp[0]);
- //Instruction 2
- //MAD
- Temp[0] = vec4(glstate_matrix_mvp[2] * Input0.zzzz + Temp[0]);
- //Instruction 3
- //MAD
- Output0 = vec4(glstate_matrix_mvp[3] * Input0.wwww + Temp[0]);
- //Instruction 4
- //MAD
- Output1.xy = vec4(Input2.xyxx * _MainTex_ST.xyxx + _MainTex_ST.zwzz).xy;
- //Instruction 5
- //MUL
- Temp[0].xyz = vec4(Input0.yyyy * glstate_matrix_modelview0[1].xyzx).xyz;
- //Instruction 6
- //MAD
- Temp[0].xyz = vec4(glstate_matrix_modelview0[0].xyzx * Input0.xxxx + Temp[0].xyzx).xyz;
- //Instruction 7
- //MAD
- Temp[0].xyz = vec4(glstate_matrix_modelview0[2].xyzx * Input0.zzzz + Temp[0].xyzx).xyz;
- //Instruction 8
- //MAD
- Temp[0].xyz = vec4(glstate_matrix_modelview0[3].xyzx * Input0.wwww + Temp[0].xyzx).xyz;
- //Instruction 9
- //MUL
- Temp[1].xyz = vec4(Input1.yyyy * glstate_matrix_invtrans_modelview0[1].xyzx).xyz;
- //Instruction 10
- //MAD
- Temp[1].xyz = vec4(glstate_matrix_invtrans_modelview0[0].xyzx * Input1.xxxx + Temp[1].xyzx).xyz;
- //Instruction 11
- //MAD
- Temp[1].xyz = vec4(glstate_matrix_invtrans_modelview0[2].xyzx * Input1.zzzz + Temp[1].xyzx).xyz;
- //Instruction 12
- //DP3
- Temp[0].w = vec4(dot((Temp[1].xyzx).xyz, (Temp[1].xyzx).xyz)).w;
- //Instruction 13
- //RSQ
- Temp[0].w = vec4(inversesqrt(Temp[0].w)).w;
- //Instruction 14
- //MUL
- Temp[1].xyz = vec4(Temp[0].wwww * Temp[1].xyzx).xyz;
- //Instruction 15
- //MOV
- Temp[2].xyz = vec4(glstate_lightmodel_ambient.xyzx).xyz;
- //Instruction 16
- //MOV
- Temp_int[0].w = ivec4(0).w;
- //Instruction 17
- //LOOP
- while(true){
- //Instruction 18
- //IGE
- // IGE+BREAKC opt
- if (((Temp_int[0].w)>= (4))) { break; }
- Temp_uint[1].w = ((Temp_int[0].w)>= (4)) ? 0xFFFFFFFFu : uint(0);
- //Instruction 19
- //Instruction 20
- //MAD
- Temp[3].xyz = vec4(-Temp[0].xyzx * unity_LightPosition[Temp_int[0].w + 0].wwww + unity_LightPosition[Temp_int[0].w + 0].xyzx).xyz;
- //Instruction 21
- //DP3
- Temp[1].w = vec4(dot((Temp[3].xyzx).xyz, (Temp[3].xyzx).xyz)).w;
- //Instruction 22
- //MAD
- Temp[2].w = Temp[1].w * unity_LightAtten[Temp_int[0].w + 0].z + 1.000000;
- //Instruction 23
- //DIV
- Temp[2].w = vec4(vec4(1.000000, 1.000000, 1.000000, 1.000000) / Temp[2].w).w;
- //Instruction 24
- //RSQ
- Temp[1].w = vec4(inversesqrt(Temp[1].w)).w;
- //Instruction 25
- //MUL
- Temp[3].xyz = vec4(Temp[1].wwww * Temp[3].xyzx).xyz;
- //Instruction 26
- //DP3
- Temp[1].w = vec4(dot((Temp[1].xyzx).xyz, (Temp[3].xyzx).xyz)).w;
- //Instruction 27
- //MAX
- Temp[1].w = vec4(max(Temp[1].w, 0.000000)).w;
- //Instruction 28
- //MUL
- Temp[1].w *= Temp[2].w;
- //Instruction 29
- //MAD
- Temp[2].xyz = vec4(unity_LightColor[Temp_int[0].w + 0].xyzx * Temp[1].wwww + Temp[2].xyzx).xyz;
- //Instruction 30
- //IADD
- Temp_int[0].w += 1;
- //Instruction 31
- //ENDLOOP
- }
- //Instruction 32
- //ADD
- Output2.xyz = vec4(Temp[2].xyzx + Temp[2].xyzx).xyz;
- //Instruction 33
- //MOV
- Output2.w = vec4(1.000000).w;
- //Instruction 34
- //RET
- //--- Post shader code ---
- gl_Position = vec4(phase0_Output0);
- //--- End post shader code ---
- return;
-} \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-inES3.txt
deleted file mode 100644
index d4239e41a74..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-inES3.txt
+++ /dev/null
@@ -1,188 +0,0 @@
-#version 300 es
-#ifndef SHADER_API_D3D11
- #define SHADER_API_D3D11 1
-#endif
-#ifndef SHADER_API_D3D11
- #define SHADER_API_D3D11 1
-#endif
-struct vec1 {
- float x;
-};
-struct uvec1 {
- uint x;
-};
-struct ivec1 {
- int x;
-};
-uniform Globals {
- vec4 unity_ColorSpaceGrey;
- vec4 _MainTex_ST;
-};
-uniform UnityLighting {
- vec4 _WorldSpaceLightPos0;
- vec4 _LightPositionRange;
- vec4 unity_4LightPosX0;
- vec4 unity_4LightPosY0;
- vec4 unity_4LightPosZ0;
- vec4 unity_4LightAtten0;
- vec4 unity_LightColor[8];
- vec4 unity_LightPosition[8];
- vec4 unity_LightAtten[8];
- vec4 unity_SpotDirection[8];
- vec4 unity_SHAr;
- vec4 unity_SHAg;
- vec4 unity_SHAb;
- vec4 unity_SHBr;
- vec4 unity_SHBg;
- vec4 unity_SHBb;
- vec4 unity_SHC;
-};
-uniform UnityPerDraw {
- vec4 glstate_matrix_mvp[4];
- vec4 glstate_matrix_modelview0[4];
- vec4 glstate_matrix_invtrans_modelview0[4];
- vec4 _Object2World[4];
- vec4 _World2Object[4];
- vec4 unity_Scale;
- vec4 unity_LODFade;
-};
-uniform UnityPerFrame {
- vec4 glstate_matrix_projection[4];
- vec4 glstate_lightmodel_ambient;
- vec4 unity_MatrixV[4];
- vec4 unity_MatrixVP[4];
- vec4 unity_AmbientSky;
- vec4 unity_AmbientGround;
-};
-in vec4 dcl_Input0_POSITION0;
-vec4 Input0;
-in vec4 dcl_Input1_NORMAL0;
-vec4 Input1;
-in vec4 dcl_Input2_TEXCOORD0;
-vec4 Input2;
-#undef Output0
-#define Output0 phase0_Output0
-vec4 phase0_Output0;
- out vec4 VtxGeoOutput1_TEXCOORD0;
-#define Output1 VtxGeoOutput1_TEXCOORD0
- out vec4 VtxGeoOutput2_COLOR0;
-#define Output2 VtxGeoOutput2_COLOR0
-vec4 Temp[4];
-ivec4 Temp_int[4];
-uvec4 Temp_uint[4];
-void main()
-{
- //--- Start Early Main ---
- Input0 = dcl_Input0_POSITION0;
- Input1 = dcl_Input1_NORMAL0;
- Input2 = dcl_Input2_TEXCOORD0;
- //--- End Early Main ---
- //Instruction 0
- //MUL
- Temp[0] = vec4(Input0.yyyy * glstate_matrix_mvp[1]);
- //Instruction 1
- //MAD
- Temp[0] = vec4(glstate_matrix_mvp[0] * Input0.xxxx + Temp[0]);
- //Instruction 2
- //MAD
- Temp[0] = vec4(glstate_matrix_mvp[2] * Input0.zzzz + Temp[0]);
- //Instruction 3
- //MAD
- Output0 = vec4(glstate_matrix_mvp[3] * Input0.wwww + Temp[0]);
- //Instruction 4
- //MAD
- Output1.xy = vec4(Input2.xyxx * _MainTex_ST.xyxx + _MainTex_ST.zwzz).xy;
- //Instruction 5
- //MUL
- Temp[0].xyz = vec4(Input0.yyyy * glstate_matrix_modelview0[1].xyzx).xyz;
- //Instruction 6
- //MAD
- Temp[0].xyz = vec4(glstate_matrix_modelview0[0].xyzx * Input0.xxxx + Temp[0].xyzx).xyz;
- //Instruction 7
- //MAD
- Temp[0].xyz = vec4(glstate_matrix_modelview0[2].xyzx * Input0.zzzz + Temp[0].xyzx).xyz;
- //Instruction 8
- //MAD
- Temp[0].xyz = vec4(glstate_matrix_modelview0[3].xyzx * Input0.wwww + Temp[0].xyzx).xyz;
- //Instruction 9
- //MUL
- Temp[1].xyz = vec4(Input1.yyyy * glstate_matrix_invtrans_modelview0[1].xyzx).xyz;
- //Instruction 10
- //MAD
- Temp[1].xyz = vec4(glstate_matrix_invtrans_modelview0[0].xyzx * Input1.xxxx + Temp[1].xyzx).xyz;
- //Instruction 11
- //MAD
- Temp[1].xyz = vec4(glstate_matrix_invtrans_modelview0[2].xyzx * Input1.zzzz + Temp[1].xyzx).xyz;
- //Instruction 12
- //DP3
- Temp[0].w = vec4(dot((Temp[1].xyzx).xyz, (Temp[1].xyzx).xyz)).w;
- //Instruction 13
- //RSQ
- Temp[0].w = vec4(inversesqrt(Temp[0].w)).w;
- //Instruction 14
- //MUL
- Temp[1].xyz = vec4(Temp[0].wwww * Temp[1].xyzx).xyz;
- //Instruction 15
- //MOV
- Temp[2].xyz = vec4(glstate_lightmodel_ambient.xyzx).xyz;
- //Instruction 16
- //MOV
- Temp_int[0].w = ivec4(0).w;
- //Instruction 17
- //LOOP
- while(true){
- //Instruction 18
- //IGE
- // IGE+BREAKC opt
- if (((Temp_int[0].w)>= (4))) { break; }
- Temp_uint[1].w = ((Temp_int[0].w)>= (4)) ? 0xFFFFFFFFu : uint(0);
- //Instruction 19
- //Instruction 20
- //MAD
- Temp[3].xyz = vec4(-Temp[0].xyzx * unity_LightPosition[Temp_int[0].w + 0].wwww + unity_LightPosition[Temp_int[0].w + 0].xyzx).xyz;
- //Instruction 21
- //DP3
- Temp[1].w = vec4(dot((Temp[3].xyzx).xyz, (Temp[3].xyzx).xyz)).w;
- //Instruction 22
- //MAD
- Temp[2].w = Temp[1].w * unity_LightAtten[Temp_int[0].w + 0].z + 1.000000;
- //Instruction 23
- //DIV
- Temp[2].w = vec4(vec4(1.000000, 1.000000, 1.000000, 1.000000) / Temp[2].w).w;
- //Instruction 24
- //RSQ
- Temp[1].w = vec4(inversesqrt(Temp[1].w)).w;
- //Instruction 25
- //MUL
- Temp[3].xyz = vec4(Temp[1].wwww * Temp[3].xyzx).xyz;
- //Instruction 26
- //DP3
- Temp[1].w = vec4(dot((Temp[1].xyzx).xyz, (Temp[3].xyzx).xyz)).w;
- //Instruction 27
- //MAX
- Temp[1].w = vec4(max(Temp[1].w, 0.000000)).w;
- //Instruction 28
- //MUL
- Temp[1].w *= Temp[2].w;
- //Instruction 29
- //MAD
- Temp[2].xyz = vec4(unity_LightColor[Temp_int[0].w + 0].xyzx * Temp[1].wwww + Temp[2].xyzx).xyz;
- //Instruction 30
- //IADD
- Temp_int[0].w += 1;
- //Instruction 31
- //ENDLOOP
- }
- //Instruction 32
- //ADD
- Output2.xyz = vec4(Temp[2].xyzx + Temp[2].xyzx).xyz;
- //Instruction 33
- //MOV
- Output2.w = vec4(1.000000).w;
- //Instruction 34
- //RET
- //--- Post shader code ---
- gl_Position = vec4(phase0_Output0);
- //--- End post shader code ---
- return;
-} \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt
deleted file mode 100644
index 2f8889de926..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-out.txt
+++ /dev/null
@@ -1,123 +0,0 @@
-#version 140
-uniform vec4 unity_AmbientGround;
-uniform vec4 unity_AmbientSky;
-uniform vec4 unity_MatrixVP[4];
-uniform vec4 unity_MatrixV[4];
-uniform vec4 glstate_lightmodel_ambient;
-uniform vec4 glstate_matrix_projection[4];
-uniform vec4 unity_LODFade;
-uniform vec4 unity_Scale;
-uniform vec4 _World2Object[4];
-uniform vec4 _Object2World[4];
-uniform vec4 glstate_matrix_invtrans_modelview0[4];
-uniform vec4 glstate_matrix_modelview0[4];
-uniform vec4 glstate_matrix_mvp[4];
-uniform vec4 unity_SHC;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SpotDirection[8];
-uniform vec4 unity_LightAtten[8];
-uniform vec4 unity_LightPosition[8];
-uniform vec4 unity_LightColor[8];
-uniform vec4 unity_4LightAtten0;
-uniform vec4 unity_4LightPosZ0;
-uniform vec4 unity_4LightPosY0;
-uniform vec4 unity_4LightPosX0;
-uniform vec4 _LightPositionRange;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 _MainTex_ST;
-uniform vec4 unity_ColorSpaceGrey;
-in vec4 dcl_Input0_POSITION0;
-in vec4 dcl_Input1_NORMAL0;
-in vec4 dcl_Input2_TEXCOORD0;
-out vec4 VtxGeoOutput1_TEXCOORD0;
-out vec4 VtxGeoOutput2_COLOR0;
-vec4 Temp_0;
-vec4 Temp_1;
-vec4 Temp_2;
-vec4 Temp_3;
-ivec4 Temp_int_0;
-void main ()
-{
- Temp_0 = (dcl_Input0_POSITION0.yyyy * glstate_matrix_mvp[1]);
- Temp_0 = ((glstate_matrix_mvp[0] * dcl_Input0_POSITION0.xxxx) + Temp_0);
- Temp_0 = ((glstate_matrix_mvp[2] * dcl_Input0_POSITION0.zzzz) + Temp_0);
- vec4 tmpvar_1;
- tmpvar_1 = ((glstate_matrix_mvp[3] * dcl_Input0_POSITION0.wwww) + Temp_0);
- VtxGeoOutput1_TEXCOORD0.xy = ((dcl_Input2_TEXCOORD0.xyxx * _MainTex_ST.xyxx) + _MainTex_ST.zwzz).xy;
- Temp_0.xyz = (dcl_Input0_POSITION0.yyyy * glstate_matrix_modelview0[1].xyzx).xyz;
- Temp_0.xyz = ((glstate_matrix_modelview0[0].xyzx * dcl_Input0_POSITION0.xxxx) + Temp_0.xyzx).xyz;
- Temp_0.xyz = ((glstate_matrix_modelview0[2].xyzx * dcl_Input0_POSITION0.zzzz) + Temp_0.xyzx).xyz;
- Temp_0.xyz = ((glstate_matrix_modelview0[3].xyzx * dcl_Input0_POSITION0.wwww) + Temp_0.xyzx).xyz;
- Temp_1.xyz = (dcl_Input1_NORMAL0.yyyy * glstate_matrix_invtrans_modelview0[1].xyzx).xyz;
- Temp_1.xyz = ((glstate_matrix_invtrans_modelview0[0].xyzx * dcl_Input1_NORMAL0.xxxx) + Temp_1.xyzx).xyz;
- Temp_1.xyz = ((glstate_matrix_invtrans_modelview0[2].xyzx * dcl_Input1_NORMAL0.zzzz) + Temp_1.xyzx).xyz;
- Temp_0.w = dot (Temp_1.xyz, Temp_1.xyz);
- Temp_0.w = inversesqrt(Temp_0.w);
- Temp_1.xyz = (Temp_0.wwww * Temp_1.xyzx).xyz;
- Temp_2.xyz = glstate_lightmodel_ambient.xyz;
- Temp_int_0.w = 0;
- while (true) {
- if ((Temp_int_0.w >= 4)) {
- break;
- };
- Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[Temp_int_0.w].wwww) + unity_LightPosition[Temp_int_0.w].xyzx).xyz;
- Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz);
- Temp_2.w = ((Temp_1.w * unity_LightAtten[Temp_int_0.w].z) + 1.0);
- Temp_2.w = (1.0/(Temp_2.w));
- Temp_1.w = inversesqrt(Temp_1.w);
- Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz;
- Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz);
- Temp_1.w = max (Temp_1.w, 0.0);
- Temp_1.w = (Temp_1.w * Temp_2.w);
- Temp_2.xyz = ((unity_LightColor[Temp_int_0.w].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz;
- Temp_int_0.w = (Temp_int_0.w + 1);
- };
- VtxGeoOutput2_COLOR0.xyz = (Temp_2.xyzx + Temp_2.xyzx).xyz;
- VtxGeoOutput2_COLOR0.w = 1.0;
- gl_Position = tmpvar_1;
-}
-
-
-// stats: 43 alu 0 tex 2 flow
-// inputs: 3
-// #0: dcl_Input0_POSITION0 (high float) 4x1 [-1]
-// #1: dcl_Input1_NORMAL0 (high float) 4x1 [-1]
-// #2: dcl_Input2_TEXCOORD0 (high float) 4x1 [-1]
-// uniforms: 32 (total size: 0)
-// #0: unity_AmbientGround (high float) 4x1 [-1]
-// #1: unity_AmbientSky (high float) 4x1 [-1]
-// #2: unity_MatrixVP (high float) 4x1 [4]
-// #3: unity_MatrixV (high float) 4x1 [4]
-// #4: glstate_lightmodel_ambient (high float) 4x1 [-1]
-// #5: glstate_matrix_projection (high float) 4x1 [4]
-// #6: unity_LODFade (high float) 4x1 [-1]
-// #7: unity_Scale (high float) 4x1 [-1]
-// #8: _World2Object (high float) 4x1 [4]
-// #9: _Object2World (high float) 4x1 [4]
-// #10: glstate_matrix_invtrans_modelview0 (high float) 4x1 [4]
-// #11: glstate_matrix_modelview0 (high float) 4x1 [4]
-// #12: glstate_matrix_mvp (high float) 4x1 [4]
-// #13: unity_SHC (high float) 4x1 [-1]
-// #14: unity_SHBb (high float) 4x1 [-1]
-// #15: unity_SHBg (high float) 4x1 [-1]
-// #16: unity_SHBr (high float) 4x1 [-1]
-// #17: unity_SHAb (high float) 4x1 [-1]
-// #18: unity_SHAg (high float) 4x1 [-1]
-// #19: unity_SHAr (high float) 4x1 [-1]
-// #20: unity_SpotDirection (high float) 4x1 [8]
-// #21: unity_LightAtten (high float) 4x1 [8]
-// #22: unity_LightPosition (high float) 4x1 [8]
-// #23: unity_LightColor (high float) 4x1 [8]
-// #24: unity_4LightAtten0 (high float) 4x1 [-1]
-// #25: unity_4LightPosZ0 (high float) 4x1 [-1]
-// #26: unity_4LightPosY0 (high float) 4x1 [-1]
-// #27: unity_4LightPosX0 (high float) 4x1 [-1]
-// #28: _LightPositionRange (high float) 4x1 [-1]
-// #29: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #30: _MainTex_ST (high float) 4x1 [-1]
-// #31: unity_ColorSpaceGrey (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt
deleted file mode 100644
index dce767a5403..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3.txt
+++ /dev/null
@@ -1,123 +0,0 @@
-#version 300 es
-uniform vec4 unity_AmbientGround;
-uniform vec4 unity_AmbientSky;
-uniform vec4 unity_MatrixVP[4];
-uniform vec4 unity_MatrixV[4];
-uniform vec4 glstate_lightmodel_ambient;
-uniform vec4 glstate_matrix_projection[4];
-uniform vec4 unity_LODFade;
-uniform vec4 unity_Scale;
-uniform vec4 _World2Object[4];
-uniform vec4 _Object2World[4];
-uniform vec4 glstate_matrix_invtrans_modelview0[4];
-uniform vec4 glstate_matrix_modelview0[4];
-uniform vec4 glstate_matrix_mvp[4];
-uniform vec4 unity_SHC;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SpotDirection[8];
-uniform vec4 unity_LightAtten[8];
-uniform vec4 unity_LightPosition[8];
-uniform vec4 unity_LightColor[8];
-uniform vec4 unity_4LightAtten0;
-uniform vec4 unity_4LightPosZ0;
-uniform vec4 unity_4LightPosY0;
-uniform vec4 unity_4LightPosX0;
-uniform vec4 _LightPositionRange;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 _MainTex_ST;
-uniform vec4 unity_ColorSpaceGrey;
-in vec4 dcl_Input0_POSITION0;
-in vec4 dcl_Input1_NORMAL0;
-in vec4 dcl_Input2_TEXCOORD0;
-out vec4 VtxGeoOutput1_TEXCOORD0;
-out vec4 VtxGeoOutput2_COLOR0;
-vec4 Temp_0;
-vec4 Temp_1;
-vec4 Temp_2;
-vec4 Temp_3;
-highp ivec4 Temp_int_0;
-void main ()
-{
- Temp_0 = (dcl_Input0_POSITION0.yyyy * glstate_matrix_mvp[1]);
- Temp_0 = ((glstate_matrix_mvp[0] * dcl_Input0_POSITION0.xxxx) + Temp_0);
- Temp_0 = ((glstate_matrix_mvp[2] * dcl_Input0_POSITION0.zzzz) + Temp_0);
- highp vec4 tmpvar_1;
- tmpvar_1 = ((glstate_matrix_mvp[3] * dcl_Input0_POSITION0.wwww) + Temp_0);
- VtxGeoOutput1_TEXCOORD0.xy = ((dcl_Input2_TEXCOORD0.xyxx * _MainTex_ST.xyxx) + _MainTex_ST.zwzz).xy;
- Temp_0.xyz = (dcl_Input0_POSITION0.yyyy * glstate_matrix_modelview0[1].xyzx).xyz;
- Temp_0.xyz = ((glstate_matrix_modelview0[0].xyzx * dcl_Input0_POSITION0.xxxx) + Temp_0.xyzx).xyz;
- Temp_0.xyz = ((glstate_matrix_modelview0[2].xyzx * dcl_Input0_POSITION0.zzzz) + Temp_0.xyzx).xyz;
- Temp_0.xyz = ((glstate_matrix_modelview0[3].xyzx * dcl_Input0_POSITION0.wwww) + Temp_0.xyzx).xyz;
- Temp_1.xyz = (dcl_Input1_NORMAL0.yyyy * glstate_matrix_invtrans_modelview0[1].xyzx).xyz;
- Temp_1.xyz = ((glstate_matrix_invtrans_modelview0[0].xyzx * dcl_Input1_NORMAL0.xxxx) + Temp_1.xyzx).xyz;
- Temp_1.xyz = ((glstate_matrix_invtrans_modelview0[2].xyzx * dcl_Input1_NORMAL0.zzzz) + Temp_1.xyzx).xyz;
- Temp_0.w = dot (Temp_1.xyz, Temp_1.xyz);
- Temp_0.w = inversesqrt(Temp_0.w);
- Temp_1.xyz = (Temp_0.wwww * Temp_1.xyzx).xyz;
- Temp_2.xyz = glstate_lightmodel_ambient.xyz;
- Temp_int_0.w = 0;
- while (true) {
- if ((Temp_int_0.w >= 4)) {
- break;
- };
- Temp_3.xyz = ((-(Temp_0.xyzx) * unity_LightPosition[Temp_int_0.w].wwww) + unity_LightPosition[Temp_int_0.w].xyzx).xyz;
- Temp_1.w = dot (Temp_3.xyz, Temp_3.xyz);
- Temp_2.w = ((Temp_1.w * unity_LightAtten[Temp_int_0.w].z) + 1.0);
- Temp_2.w = (1.0/(Temp_2.w));
- Temp_1.w = inversesqrt(Temp_1.w);
- Temp_3.xyz = (Temp_1.wwww * Temp_3.xyzx).xyz;
- Temp_1.w = dot (Temp_1.xyz, Temp_3.xyz);
- Temp_1.w = max (Temp_1.w, 0.0);
- Temp_1.w = (Temp_1.w * Temp_2.w);
- Temp_2.xyz = ((unity_LightColor[Temp_int_0.w].xyzx * Temp_1.wwww) + Temp_2.xyzx).xyz;
- Temp_int_0.w = (Temp_int_0.w + 1);
- };
- VtxGeoOutput2_COLOR0.xyz = (Temp_2.xyzx + Temp_2.xyzx).xyz;
- VtxGeoOutput2_COLOR0.w = 1.0;
- gl_Position = tmpvar_1;
-}
-
-
-// stats: 43 alu 0 tex 2 flow
-// inputs: 3
-// #0: dcl_Input0_POSITION0 (high float) 4x1 [-1]
-// #1: dcl_Input1_NORMAL0 (high float) 4x1 [-1]
-// #2: dcl_Input2_TEXCOORD0 (high float) 4x1 [-1]
-// uniforms: 32 (total size: 0)
-// #0: unity_AmbientGround (high float) 4x1 [-1]
-// #1: unity_AmbientSky (high float) 4x1 [-1]
-// #2: unity_MatrixVP (high float) 4x1 [4]
-// #3: unity_MatrixV (high float) 4x1 [4]
-// #4: glstate_lightmodel_ambient (high float) 4x1 [-1]
-// #5: glstate_matrix_projection (high float) 4x1 [4]
-// #6: unity_LODFade (high float) 4x1 [-1]
-// #7: unity_Scale (high float) 4x1 [-1]
-// #8: _World2Object (high float) 4x1 [4]
-// #9: _Object2World (high float) 4x1 [4]
-// #10: glstate_matrix_invtrans_modelview0 (high float) 4x1 [4]
-// #11: glstate_matrix_modelview0 (high float) 4x1 [4]
-// #12: glstate_matrix_mvp (high float) 4x1 [4]
-// #13: unity_SHC (high float) 4x1 [-1]
-// #14: unity_SHBb (high float) 4x1 [-1]
-// #15: unity_SHBg (high float) 4x1 [-1]
-// #16: unity_SHBr (high float) 4x1 [-1]
-// #17: unity_SHAb (high float) 4x1 [-1]
-// #18: unity_SHAg (high float) 4x1 [-1]
-// #19: unity_SHAr (high float) 4x1 [-1]
-// #20: unity_SpotDirection (high float) 4x1 [8]
-// #21: unity_LightAtten (high float) 4x1 [8]
-// #22: unity_LightPosition (high float) 4x1 [8]
-// #23: unity_LightColor (high float) 4x1 [8]
-// #24: unity_4LightAtten0 (high float) 4x1 [-1]
-// #25: unity_4LightPosZ0 (high float) 4x1 [-1]
-// #26: unity_4LightPosY0 (high float) 4x1 [-1]
-// #27: unity_4LightPosX0 (high float) 4x1 [-1]
-// #28: _LightPositionRange (high float) 4x1 [-1]
-// #29: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #30: _MainTex_ST (high float) 4x1 [-1]
-// #31: unity_ColorSpaceGrey (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt
deleted file mode 100644
index 06bd71bd0f5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4-outES3Metal.txt
+++ /dev/null
@@ -1,134 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 dcl_Input0_POSITION0 [[attribute(0)]];
- float4 dcl_Input1_NORMAL0 [[attribute(1)]];
- float4 dcl_Input2_TEXCOORD0 [[attribute(2)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- float4 VtxGeoOutput1_TEXCOORD0;
- float4 VtxGeoOutput2_COLOR0;
-};
-struct xlatMtlShaderUniform {
- float4 unity_AmbientGround;
- float4 unity_AmbientSky;
- float4 unity_MatrixVP[4];
- float4 unity_MatrixV[4];
- float4 glstate_lightmodel_ambient;
- float4 glstate_matrix_projection[4];
- float4 unity_LODFade;
- float4 unity_Scale;
- float4 _World2Object[4];
- float4 _Object2World[4];
- float4 glstate_matrix_invtrans_modelview0[4];
- float4 glstate_matrix_modelview0[4];
- float4 glstate_matrix_mvp[4];
- float4 unity_SHC;
- float4 unity_SHBb;
- float4 unity_SHBg;
- float4 unity_SHBr;
- float4 unity_SHAb;
- float4 unity_SHAg;
- float4 unity_SHAr;
- float4 unity_SpotDirection[8];
- float4 unity_LightAtten[8];
- float4 unity_LightPosition[8];
- float4 unity_LightColor[8];
- float4 unity_4LightAtten0;
- float4 unity_4LightPosZ0;
- float4 unity_4LightPosY0;
- float4 unity_4LightPosX0;
- float4 _LightPositionRange;
- float4 _WorldSpaceLightPos0;
- float4 _MainTex_ST;
- float4 unity_ColorSpaceGrey;
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
-float4 phase0_Output0_1 = 0;
-float4 Temp_0_2 = 0;
-float4 Temp_1_3 = 0;
-float4 Temp_2_4 = 0;
-float4 Temp_3_5 = 0;
-int4 Temp_int_0_6 = 0;
- Temp_0_2 = (_mtl_i.dcl_Input0_POSITION0.yyyy * _mtl_u.glstate_matrix_mvp[1]);
- Temp_0_2 = ((_mtl_u.glstate_matrix_mvp[0] * _mtl_i.dcl_Input0_POSITION0.xxxx) + Temp_0_2);
- Temp_0_2 = ((_mtl_u.glstate_matrix_mvp[2] * _mtl_i.dcl_Input0_POSITION0.zzzz) + Temp_0_2);
- phase0_Output0_1 = ((_mtl_u.glstate_matrix_mvp[3] * _mtl_i.dcl_Input0_POSITION0.wwww) + Temp_0_2);
- _mtl_o.VtxGeoOutput1_TEXCOORD0.xy = ((_mtl_i.dcl_Input2_TEXCOORD0.xyxx * _mtl_u._MainTex_ST.xyxx) + _mtl_u._MainTex_ST.zwzz).xy;
- Temp_0_2.xyz = (_mtl_i.dcl_Input0_POSITION0.yyyy * _mtl_u.glstate_matrix_modelview0[1].xyzx).xyz;
- Temp_0_2.xyz = ((_mtl_u.glstate_matrix_modelview0[0].xyzx * _mtl_i.dcl_Input0_POSITION0.xxxx) + Temp_0_2.xyzx).xyz;
- Temp_0_2.xyz = ((_mtl_u.glstate_matrix_modelview0[2].xyzx * _mtl_i.dcl_Input0_POSITION0.zzzz) + Temp_0_2.xyzx).xyz;
- Temp_0_2.xyz = ((_mtl_u.glstate_matrix_modelview0[3].xyzx * _mtl_i.dcl_Input0_POSITION0.wwww) + Temp_0_2.xyzx).xyz;
- Temp_1_3.xyz = (_mtl_i.dcl_Input1_NORMAL0.yyyy * _mtl_u.glstate_matrix_invtrans_modelview0[1].xyzx).xyz;
- Temp_1_3.xyz = ((_mtl_u.glstate_matrix_invtrans_modelview0[0].xyzx * _mtl_i.dcl_Input1_NORMAL0.xxxx) + Temp_1_3.xyzx).xyz;
- Temp_1_3.xyz = ((_mtl_u.glstate_matrix_invtrans_modelview0[2].xyzx * _mtl_i.dcl_Input1_NORMAL0.zzzz) + Temp_1_3.xyzx).xyz;
- Temp_0_2.w = dot (Temp_1_3.xyz, Temp_1_3.xyz);
- Temp_0_2.w = rsqrt(Temp_0_2.w);
- Temp_1_3.xyz = (Temp_0_2.wwww * Temp_1_3.xyzx).xyz;
- Temp_2_4.xyz = _mtl_u.glstate_lightmodel_ambient.xyz;
- Temp_int_0_6.w = 0;
- while (true) {
- if ((Temp_int_0_6.w >= 4)) {
- break;
- };
- Temp_3_5.xyz = ((-(Temp_0_2.xyzx) * _mtl_u.unity_LightPosition[Temp_int_0_6.w].wwww) + _mtl_u.unity_LightPosition[Temp_int_0_6.w].xyzx).xyz;
- Temp_1_3.w = dot (Temp_3_5.xyz, Temp_3_5.xyz);
- Temp_2_4.w = ((Temp_1_3.w * _mtl_u.unity_LightAtten[Temp_int_0_6.w].z) + 1.0);
- Temp_2_4.w = (1.0/(Temp_2_4.w));
- Temp_1_3.w = rsqrt(Temp_1_3.w);
- Temp_3_5.xyz = (Temp_1_3.wwww * Temp_3_5.xyzx).xyz;
- Temp_1_3.w = dot (Temp_1_3.xyz, Temp_3_5.xyz);
- Temp_1_3.w = max (Temp_1_3.w, 0.0);
- Temp_1_3.w = (Temp_1_3.w * Temp_2_4.w);
- Temp_2_4.xyz = ((_mtl_u.unity_LightColor[Temp_int_0_6.w].xyzx * Temp_1_3.wwww) + Temp_2_4.xyzx).xyz;
- Temp_int_0_6.w = (Temp_int_0_6.w + 1);
- };
- _mtl_o.VtxGeoOutput2_COLOR0.xyz = (Temp_2_4.xyzx + Temp_2_4.xyzx).xyz;
- _mtl_o.VtxGeoOutput2_COLOR0.w = 1.0;
- _mtl_o.gl_Position = phase0_Output0_1;
- return _mtl_o;
-}
-
-
-// stats: 43 alu 0 tex 2 flow
-// inputs: 3
-// #0: dcl_Input0_POSITION0 (high float) 4x1 [-1] loc 0
-// #1: dcl_Input1_NORMAL0 (high float) 4x1 [-1] loc 1
-// #2: dcl_Input2_TEXCOORD0 (high float) 4x1 [-1] loc 2
-// uniforms: 32 (total size: 1344)
-// #0: unity_AmbientGround (high float) 4x1 [-1] loc 0
-// #1: unity_AmbientSky (high float) 4x1 [-1] loc 16
-// #2: unity_MatrixVP (high float) 4x1 [4] loc 32
-// #3: unity_MatrixV (high float) 4x1 [4] loc 96
-// #4: glstate_lightmodel_ambient (high float) 4x1 [-1] loc 160
-// #5: glstate_matrix_projection (high float) 4x1 [4] loc 176
-// #6: unity_LODFade (high float) 4x1 [-1] loc 240
-// #7: unity_Scale (high float) 4x1 [-1] loc 256
-// #8: _World2Object (high float) 4x1 [4] loc 272
-// #9: _Object2World (high float) 4x1 [4] loc 336
-// #10: glstate_matrix_invtrans_modelview0 (high float) 4x1 [4] loc 400
-// #11: glstate_matrix_modelview0 (high float) 4x1 [4] loc 464
-// #12: glstate_matrix_mvp (high float) 4x1 [4] loc 528
-// #13: unity_SHC (high float) 4x1 [-1] loc 592
-// #14: unity_SHBb (high float) 4x1 [-1] loc 608
-// #15: unity_SHBg (high float) 4x1 [-1] loc 624
-// #16: unity_SHBr (high float) 4x1 [-1] loc 640
-// #17: unity_SHAb (high float) 4x1 [-1] loc 656
-// #18: unity_SHAg (high float) 4x1 [-1] loc 672
-// #19: unity_SHAr (high float) 4x1 [-1] loc 688
-// #20: unity_SpotDirection (high float) 4x1 [8] loc 704
-// #21: unity_LightAtten (high float) 4x1 [8] loc 832
-// #22: unity_LightPosition (high float) 4x1 [8] loc 960
-// #23: unity_LightColor (high float) 4x1 [8] loc 1088
-// #24: unity_4LightAtten0 (high float) 4x1 [-1] loc 1216
-// #25: unity_4LightPosZ0 (high float) 4x1 [-1] loc 1232
-// #26: unity_4LightPosY0 (high float) 4x1 [-1] loc 1248
-// #27: unity_4LightPosX0 (high float) 4x1 [-1] loc 1264
-// #28: _LightPositionRange (high float) 4x1 [-1] loc 1280
-// #29: _WorldSpaceLightPos0 (high float) 4x1 [-1] loc 1296
-// #30: _MainTex_ST (high float) 4x1 [-1] loc 1312
-// #31: unity_ColorSpaceGrey (high float) 4x1 [-1] loc 1328
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-inES3.txt
deleted file mode 100644
index 9117dfa850b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-inES3.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-#version 300 es
-
-// This was produced at one point from Unity's Reflect/VertexLit
-// shader's "Vertex Lit, emulated in shaders" pass by hlslcc.
-// Loop analysis was not detecting that Temp_int[0] is used as
-// both a loop induction variable (.w component) and for other uses
-// outside the loop.
-
-precision highp float;
-
-uniform vec4 unity_LightColor[8];
-uniform vec4 unity_LightPosition[8];
-uniform vec4 unity_LightAtten[8];
-uniform vec4 unity_SpotDirection[8];
-uniform mat4 glstate_matrix_mvp;
-uniform mat4 glstate_matrix_modelview0;
-uniform mat4 glstate_matrix_invtrans_modelview0;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 glstate_lightmodel_ambient;
-uniform vec4 _MainTex_ST;
-uniform vec4 _Color;
-uniform vec4 _ReflectColor;
- in highp vec4 in_POSITION0;
-vec4 Input0;
- in highp vec4 in_NORMAL0;
-vec4 Input1;
- in highp vec4 in_TEXCOORD0;
-vec4 Input2;
- out highp vec4 TEXCOORD0;
-#define Output0 TEXCOORD0
- out highp vec4 COLOR0;
-#define Output1 COLOR0
-#undef Output2
-#define Output2 phase0_Output2
-vec4 phase0_Output2;
-vec4 Temp[4];
-ivec4 Temp_int[4];
-void main()
-{
- Input0 = in_POSITION0;
- Input1 = in_NORMAL0;
- Input2 = in_TEXCOORD0;
- Temp_int[0] = floatBitsToInt(Input0.yyyy * glstate_matrix_mvp[1]);
- Temp_int[0] = floatBitsToInt(glstate_matrix_mvp[0] * Input0.xxxx + intBitsToFloat(Temp_int[0]));
- Temp_int[0] = floatBitsToInt(glstate_matrix_mvp[2] * Input0.zzzz + intBitsToFloat(Temp_int[0]));
- Output2 = glstate_matrix_mvp[3] * Input0.wwww + intBitsToFloat(Temp_int[0]);
- Output0.xy = Input2.xy * _MainTex_ST.xy + _MainTex_ST.zw;
- Temp_int[0].xyz = floatBitsToInt(Input0.yyy * glstate_matrix_modelview0[1].xyz);
- Temp_int[0].xyz = floatBitsToInt(glstate_matrix_modelview0[0].xyz * Input0.xxx + intBitsToFloat(Temp_int[0]).xyz);
- Temp_int[0].xyz = floatBitsToInt(glstate_matrix_modelview0[2].xyz * Input0.zzz + intBitsToFloat(Temp_int[0]).xyz);
- Temp_int[0].xyz = floatBitsToInt(glstate_matrix_modelview0[3].xyz * Input0.www + intBitsToFloat(Temp_int[0]).xyz);
- Temp_int[1].xyz = floatBitsToInt(Input1.yyy * glstate_matrix_invtrans_modelview0[1].xyz);
- Temp_int[1].xyz = floatBitsToInt(glstate_matrix_invtrans_modelview0[0].xyz * Input1.xxx + intBitsToFloat(Temp_int[1]).xyz);
- Temp_int[1].xyz = floatBitsToInt(glstate_matrix_invtrans_modelview0[2].xyz * Input1.zzz + intBitsToFloat(Temp_int[1]).xyz);
- Temp_int[0].w = floatBitsToInt(dot(intBitsToFloat(Temp_int[1]).xyz, intBitsToFloat(Temp_int[1]).xyz));
- Temp_int[0].w = floatBitsToInt(inversesqrt(intBitsToFloat(Temp_int[0]).w));
- Temp_int[1].xyz = floatBitsToInt(intBitsToFloat(Temp_int[0]).www * intBitsToFloat(Temp_int[1]).xyz);
- Temp[2].xyz = glstate_lightmodel_ambient.xyz;
- Temp_int[0].w = 0x0;
- while(true){
- if ((Temp_int[0].w>= 0x4)) { break; }
- Temp_int[1].w = int((Temp_int[0].w>=0x4) ? 0xFFFFFFFFu : 0u);
- Temp[3].xyz = (-intBitsToFloat(Temp_int[0]).xyz) * unity_LightPosition[Temp_int[0].w + 0].www + unity_LightPosition[Temp_int[0].w + 0].xyz;
- Temp_int[1].w = floatBitsToInt(dot(Temp[3].xyz, Temp[3].xyz));
- Temp[2].w = inversesqrt(intBitsToFloat(Temp_int[1]).w);
- Temp[3].xyz = Temp[2].www * Temp[3].xyz;
- Temp_int[1].w = floatBitsToInt(intBitsToFloat(Temp_int[1]).w * unity_LightAtten[Temp_int[0].w + 0].z + intBitsToFloat(0x3F800000));
- Temp_int[1].w = floatBitsToInt(float(intBitsToFloat(0x3F800000)) / intBitsToFloat(Temp_int[1]).w);
- Temp[2].w = dot(Temp[3].xyz, unity_SpotDirection[Temp_int[0].w + 0].xyz);
- Temp[2].w = max(Temp[2].w, intBitsToFloat(0x0));
- Temp[2].w = Temp[2].w + (-unity_LightAtten[Temp_int[0].w + 0].x);
- Temp[2].w = Temp[2].w * unity_LightAtten[Temp_int[0].w + 0].y;
- Temp[2].w = clamp(Temp[2].w, 0.0, 1.0);
- Temp_int[1].w = floatBitsToInt(intBitsToFloat(Temp_int[1]).w * Temp[2].w);
- Temp[2].w = dot(intBitsToFloat(Temp_int[1]).xyz, Temp[3].xyz);
- Temp[2].w = max(Temp[2].w, intBitsToFloat(0x0));
- Temp_int[1].w = floatBitsToInt(intBitsToFloat(Temp_int[1]).w * Temp[2].w);
- Temp[2].xyz = unity_LightColor[Temp_int[0].w + 0].xyz * intBitsToFloat(Temp_int[1]).www + Temp[2].xyz;
- Temp_int[0].w = Temp_int[0].w + 0x1;
- }
- Output1.xyz = Temp[2].xyz * _Color.xyz;
- Output1.w = _Color.w * _ReflectColor.w;
- gl_Position = vec4(phase0_Output2);
- return;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt
deleted file mode 100644
index d3a42f5a079..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3.txt
+++ /dev/null
@@ -1,91 +0,0 @@
-#version 300 es
-precision highp float;
-uniform vec4 unity_LightColor[8];
-uniform vec4 unity_LightPosition[8];
-uniform vec4 unity_LightAtten[8];
-uniform vec4 unity_SpotDirection[8];
-uniform mat4 glstate_matrix_mvp;
-uniform mat4 glstate_matrix_modelview0;
-uniform mat4 glstate_matrix_invtrans_modelview0;
-uniform vec4 glstate_lightmodel_ambient;
-uniform vec4 _MainTex_ST;
-uniform vec4 _Color;
-uniform vec4 _ReflectColor;
-in highp vec4 in_POSITION0;
-in highp vec4 in_NORMAL0;
-in highp vec4 in_TEXCOORD0;
-out highp vec4 TEXCOORD0;
-out highp vec4 COLOR0;
-highp vec4 phase0_Output2;
-highp vec4 Temp_2;
-highp vec4 Temp_3;
-highp ivec4 Temp_int_0;
-highp ivec4 Temp_int_1;
-void main ()
-{
- Temp_int_0 = floatBitsToInt((in_POSITION0.yyyy * glstate_matrix_mvp[1]));
- Temp_int_0 = floatBitsToInt(((glstate_matrix_mvp[0] * in_POSITION0.xxxx) + intBitsToFloat(Temp_int_0)));
- Temp_int_0 = floatBitsToInt(((glstate_matrix_mvp[2] * in_POSITION0.zzzz) + intBitsToFloat(Temp_int_0)));
- phase0_Output2 = ((glstate_matrix_mvp[3] * in_POSITION0.wwww) + intBitsToFloat(Temp_int_0));
- TEXCOORD0.xy = ((in_TEXCOORD0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- Temp_int_0.xyz = floatBitsToInt((in_POSITION0.yyy * glstate_matrix_modelview0[1].xyz));
- Temp_int_0.xyz = floatBitsToInt(((glstate_matrix_modelview0[0].xyz * in_POSITION0.xxx) + intBitsToFloat(Temp_int_0).xyz));
- Temp_int_0.xyz = floatBitsToInt(((glstate_matrix_modelview0[2].xyz * in_POSITION0.zzz) + intBitsToFloat(Temp_int_0).xyz));
- Temp_int_0.xyz = floatBitsToInt(((glstate_matrix_modelview0[3].xyz * in_POSITION0.www) + intBitsToFloat(Temp_int_0).xyz));
- Temp_int_1.xyz = floatBitsToInt((in_NORMAL0.yyy * glstate_matrix_invtrans_modelview0[1].xyz));
- Temp_int_1.xyz = floatBitsToInt(((glstate_matrix_invtrans_modelview0[0].xyz * in_NORMAL0.xxx) + intBitsToFloat(Temp_int_1).xyz));
- Temp_int_1.xyz = floatBitsToInt(((glstate_matrix_invtrans_modelview0[2].xyz * in_NORMAL0.zzz) + intBitsToFloat(Temp_int_1).xyz));
- Temp_int_0.w = floatBitsToInt(dot (intBitsToFloat(Temp_int_1).xyz, intBitsToFloat(Temp_int_1).xyz));
- Temp_int_0.w = floatBitsToInt(inversesqrt(intBitsToFloat(Temp_int_0).w));
- Temp_int_1.xyz = floatBitsToInt((intBitsToFloat(Temp_int_0).www * intBitsToFloat(Temp_int_1).xyz));
- Temp_2.xyz = glstate_lightmodel_ambient.xyz;
- Temp_int_0.w = 0;
- while (true) {
- if ((Temp_int_0.w >= 4)) {
- break;
- };
- Temp_3.xyz = ((-(
- intBitsToFloat(Temp_int_0)
- .xyz) * unity_LightPosition[Temp_int_0.w].www) + unity_LightPosition[Temp_int_0.w].xyz);
- Temp_int_1.w = floatBitsToInt(dot (Temp_3.xyz, Temp_3.xyz));
- Temp_2.w = inversesqrt(intBitsToFloat(Temp_int_1).w);
- Temp_3.xyz = (Temp_2.www * Temp_3.xyz);
- Temp_int_1.w = floatBitsToInt(((
- intBitsToFloat(Temp_int_1)
- .w * unity_LightAtten[Temp_int_0.w].z) + 1.0));
- Temp_int_1.w = floatBitsToInt((1.0/(intBitsToFloat(Temp_int_1).w)));
- Temp_2.w = dot (Temp_3.xyz, unity_SpotDirection[Temp_int_0.w].xyz);
- Temp_2.w = max (Temp_2.w, 0.0);
- Temp_2.w = (Temp_2.w - unity_LightAtten[Temp_int_0.w].x);
- Temp_2.w = (Temp_2.w * unity_LightAtten[Temp_int_0.w].y);
- Temp_2.w = clamp (Temp_2.w, 0.0, 1.0);
- Temp_int_1.w = floatBitsToInt((intBitsToFloat(Temp_int_1).w * Temp_2.w));
- Temp_2.w = dot (intBitsToFloat(Temp_int_1).xyz, Temp_3.xyz);
- Temp_2.w = max (Temp_2.w, 0.0);
- Temp_int_1.w = floatBitsToInt((intBitsToFloat(Temp_int_1).w * Temp_2.w));
- Temp_2.xyz = ((unity_LightColor[Temp_int_0.w].xyz * intBitsToFloat(Temp_int_1).www) + Temp_2.xyz);
- Temp_int_0.w = (Temp_int_0.w + 1);
- };
- COLOR0.xyz = (Temp_2.xyz * _Color.xyz);
- COLOR0.w = (_Color.w * _ReflectColor.w);
- gl_Position = phase0_Output2;
-}
-
-
-// stats: 88 alu 0 tex 2 flow
-// inputs: 3
-// #0: in_POSITION0 (high float) 4x1 [-1]
-// #1: in_NORMAL0 (high float) 4x1 [-1]
-// #2: in_TEXCOORD0 (high float) 4x1 [-1]
-// uniforms: 11 (total size: 0)
-// #0: unity_LightColor (high float) 4x1 [8]
-// #1: unity_LightPosition (high float) 4x1 [8]
-// #2: unity_LightAtten (high float) 4x1 [8]
-// #3: unity_SpotDirection (high float) 4x1 [8]
-// #4: glstate_matrix_mvp (high float) 4x4 [-1]
-// #5: glstate_matrix_modelview0 (high float) 4x4 [-1]
-// #6: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1]
-// #7: glstate_lightmodel_ambient (high float) 4x1 [-1]
-// #8: _MainTex_ST (high float) 4x1 [-1]
-// #9: _Color (high float) 4x1 [-1]
-// #10: _ReflectColor (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt
deleted file mode 100644
index b7ebf1806aa..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-for-withvec4inductorW-outES3Metal.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 in_POSITION0 [[attribute(0)]];
- float4 in_NORMAL0 [[attribute(1)]];
- float4 in_TEXCOORD0 [[attribute(2)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- float4 TEXCOORD0;
- float4 COLOR0;
-};
-struct xlatMtlShaderUniform {
- float4 unity_LightColor[8];
- float4 unity_LightPosition[8];
- float4 unity_LightAtten[8];
- float4 unity_SpotDirection[8];
- float4x4 glstate_matrix_mvp;
- float4x4 glstate_matrix_modelview0;
- float4x4 glstate_matrix_invtrans_modelview0;
- float4 glstate_lightmodel_ambient;
- float4 _MainTex_ST;
- float4 _Color;
- float4 _ReflectColor;
-};
-;
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
-float4 phase0_Output2_1 = 0;
-float4 Temp_2_2 = 0;
-float4 Temp_3_3 = 0;
-int4 Temp_int_0_4 = 0;
-int4 Temp_int_1_5 = 0;
- Temp_int_0_4 = as_type<int4>((_mtl_i.in_POSITION0.yyyy * _mtl_u.glstate_matrix_mvp[1]));
- Temp_int_0_4 = as_type<int4>(((_mtl_u.glstate_matrix_mvp[0] * _mtl_i.in_POSITION0.xxxx) + as_type<float4>(Temp_int_0_4)));
- Temp_int_0_4 = as_type<int4>(((_mtl_u.glstate_matrix_mvp[2] * _mtl_i.in_POSITION0.zzzz) + as_type<float4>(Temp_int_0_4)));
- phase0_Output2_1 = ((_mtl_u.glstate_matrix_mvp[3] * _mtl_i.in_POSITION0.wwww) + as_type<float4>(Temp_int_0_4));
- _mtl_o.TEXCOORD0.xy = ((_mtl_i.in_TEXCOORD0.xy * _mtl_u._MainTex_ST.xy) + _mtl_u._MainTex_ST.zw);
- Temp_int_0_4.xyz = as_type<int3>((_mtl_i.in_POSITION0.yyy * _mtl_u.glstate_matrix_modelview0[1].xyz));
- Temp_int_0_4.xyz = as_type<int3>(((_mtl_u.glstate_matrix_modelview0[0].xyz * _mtl_i.in_POSITION0.xxx) + as_type<float4>(Temp_int_0_4).xyz));
- Temp_int_0_4.xyz = as_type<int3>(((_mtl_u.glstate_matrix_modelview0[2].xyz * _mtl_i.in_POSITION0.zzz) + as_type<float4>(Temp_int_0_4).xyz));
- Temp_int_0_4.xyz = as_type<int3>(((_mtl_u.glstate_matrix_modelview0[3].xyz * _mtl_i.in_POSITION0.www) + as_type<float4>(Temp_int_0_4).xyz));
- Temp_int_1_5.xyz = as_type<int3>((_mtl_i.in_NORMAL0.yyy * _mtl_u.glstate_matrix_invtrans_modelview0[1].xyz));
- Temp_int_1_5.xyz = as_type<int3>(((_mtl_u.glstate_matrix_invtrans_modelview0[0].xyz * _mtl_i.in_NORMAL0.xxx) + as_type<float4>(Temp_int_1_5).xyz));
- Temp_int_1_5.xyz = as_type<int3>(((_mtl_u.glstate_matrix_invtrans_modelview0[2].xyz * _mtl_i.in_NORMAL0.zzz) + as_type<float4>(Temp_int_1_5).xyz));
- Temp_int_0_4.w = as_type<int>(dot (as_type<float4>(Temp_int_1_5).xyz, as_type<float4>(Temp_int_1_5).xyz));
- Temp_int_0_4.w = as_type<int>(rsqrt(as_type<float4>(Temp_int_0_4).w));
- Temp_int_1_5.xyz = as_type<int3>((as_type<float4>(Temp_int_0_4).www * as_type<float4>(Temp_int_1_5).xyz));
- Temp_2_2.xyz = _mtl_u.glstate_lightmodel_ambient.xyz;
- Temp_int_0_4.w = 0;
- while (true) {
- if ((Temp_int_0_4.w >= 4)) {
- break;
- };
- Temp_3_3.xyz = ((-(
- as_type<float4>(Temp_int_0_4)
- .xyz) * _mtl_u.unity_LightPosition[Temp_int_0_4.w].www) + _mtl_u.unity_LightPosition[Temp_int_0_4.w].xyz);
- Temp_int_1_5.w = as_type<int>(dot (Temp_3_3.xyz, Temp_3_3.xyz));
- Temp_2_2.w = rsqrt(as_type<float4>(Temp_int_1_5).w);
- Temp_3_3.xyz = (Temp_2_2.www * Temp_3_3.xyz);
- Temp_int_1_5.w = as_type<int>(((
- as_type<float4>(Temp_int_1_5)
- .w * _mtl_u.unity_LightAtten[Temp_int_0_4.w].z) + 1.0));
- Temp_int_1_5.w = as_type<int>((1.0/(as_type<float4>(Temp_int_1_5).w)));
- Temp_2_2.w = dot (Temp_3_3.xyz, _mtl_u.unity_SpotDirection[Temp_int_0_4.w].xyz);
- Temp_2_2.w = max (Temp_2_2.w, 0.0);
- Temp_2_2.w = (Temp_2_2.w - _mtl_u.unity_LightAtten[Temp_int_0_4.w].x);
- Temp_2_2.w = (Temp_2_2.w * _mtl_u.unity_LightAtten[Temp_int_0_4.w].y);
- Temp_2_2.w = clamp (Temp_2_2.w, 0.0, 1.0);
- Temp_int_1_5.w = as_type<int>((as_type<float4>(Temp_int_1_5).w * Temp_2_2.w));
- Temp_2_2.w = dot (as_type<float4>(Temp_int_1_5).xyz, Temp_3_3.xyz);
- Temp_2_2.w = max (Temp_2_2.w, 0.0);
- Temp_int_1_5.w = as_type<int>((as_type<float4>(Temp_int_1_5).w * Temp_2_2.w));
- Temp_2_2.xyz = ((_mtl_u.unity_LightColor[Temp_int_0_4.w].xyz * as_type<float4>(Temp_int_1_5).www) + Temp_2_2.xyz);
- Temp_int_0_4.w = (Temp_int_0_4.w + 1);
- };
- _mtl_o.COLOR0.xyz = (Temp_2_2.xyz * _mtl_u._Color.xyz);
- _mtl_o.COLOR0.w = (_mtl_u._Color.w * _mtl_u._ReflectColor.w);
- _mtl_o.gl_Position = phase0_Output2_1;
- return _mtl_o;
-}
-
-
-// stats: 88 alu 0 tex 2 flow
-// inputs: 3
-// #0: in_POSITION0 (high float) 4x1 [-1] loc 0
-// #1: in_NORMAL0 (high float) 4x1 [-1] loc 1
-// #2: in_TEXCOORD0 (high float) 4x1 [-1] loc 2
-// uniforms: 11 (total size: 768)
-// #0: unity_LightColor (high float) 4x1 [8] loc 0
-// #1: unity_LightPosition (high float) 4x1 [8] loc 128
-// #2: unity_LightAtten (high float) 4x1 [8] loc 256
-// #3: unity_SpotDirection (high float) 4x1 [8] loc 384
-// #4: glstate_matrix_mvp (high float) 4x4 [-1] loc 512
-// #5: glstate_matrix_modelview0 (high float) 4x4 [-1] loc 576
-// #6: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1] loc 640
-// #7: glstate_lightmodel_ambient (high float) 4x1 [-1] loc 704
-// #8: _MainTex_ST (high float) 4x1 [-1] loc 720
-// #9: _Color (high float) 4x1 [-1] loc 736
-// #10: _ReflectColor (high float) 4x1 [-1] loc 752
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES.txt
deleted file mode 100644
index c13e7e1c9f3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-#line 1
-attribute vec4 _glesVertex;
-attribute vec3 _glesNormal;
-struct v2f {
- lowp vec4 color;
- highp vec4 pos;
-};
-struct appdata {
- highp vec3 pos;
- highp vec3 normal;
-};
-uniform mediump vec4 unity_LightColor[8];
-uniform highp vec4 unity_LightPosition[8];
-uniform highp ivec4 unity_VertexLightParams;
-mediump vec3 computeLighting(in highp int idx, in mediump vec3 dirToLight, in mediump vec3 eyeNormal, in mediump float atten)
-{
- mediump float NdotL = max( dot( eyeNormal, dirToLight), 0.0);
- mediump vec3 color = NdotL * unity_LightColor[idx].xyz;
- return color * atten;
-}
-mediump vec3 computeOneLight( in highp int idx, in mediump vec3 eyeNormal)
-{
- highp vec3 dirToLight = unity_LightPosition[idx].xyz;
- mediump float att = 1.0;
-
- att *= 0.5;
- return min( computeLighting( idx, dirToLight, eyeNormal, att), vec3(1.0));
-}
-v2f vert( in appdata IN )
-{
- v2f o;
- mediump vec4 color = vec4(0.0, 0.0, 0.0, 1.1);
-
- mediump vec3 eyeNormal = IN.normal;
-
- mediump vec3 lcolor = vec3(0.0);
-
- // loop doing up to N lights, with max cap
- highp int il = 0;
- for ( ; (float(il) < min( 8.0, float(unity_VertexLightParams.x))); (++il))
- {
- lcolor += computeOneLight(il, eyeNormal);
- }
- color.xyz = lcolor.xyz;
-
- // other forms of a similar loop
- for (int j = 0; j < int(min(float(unity_VertexLightParams.y),4.0)); ++j)
- color.xyz += unity_LightColor[j].xyz;
-
- o.color = color;
- o.pos = vec4(IN.pos,1.0);
- return o;
-}
-varying lowp vec4 xlv_COLOR0;
-void main() {
- v2f xl_retval;
- appdata xlt_IN;
- xlt_IN.pos = _glesVertex.xyz;
- xlt_IN.normal = _glesNormal;
- xl_retval = vert(xlt_IN);
- xlv_COLOR0 = vec4(xl_retval.color);
- gl_Position = vec4(xl_retval.pos);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES3.txt
deleted file mode 100644
index e2f957ddb19..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-inES3.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-#version 300 es
-#line 2
-in vec4 _glesVertex;
-in vec3 _glesNormal;
-struct v2f {
- lowp vec4 color;
- highp vec4 pos;
-};
-struct appdata {
- highp vec3 pos;
- highp vec3 normal;
-};
-uniform mediump vec4 unity_LightColor[8];
-uniform highp vec4 unity_LightPosition[8];
-uniform highp ivec4 unity_VertexLightParams;
-mediump vec3 computeLighting(in highp int idx, in mediump vec3 dirToLight, in mediump vec3 eyeNormal, in mediump float atten)
-{
- mediump float NdotL = max( dot( eyeNormal, dirToLight), 0.0);
- mediump vec3 color = NdotL * unity_LightColor[idx].xyz;
- return color * atten;
-}
-mediump vec3 computeOneLight( in highp int idx, in mediump vec3 eyeNormal)
-{
- highp vec3 dirToLight = unity_LightPosition[idx].xyz;
- mediump float att = 1.0;
-
- att *= 0.5;
- return min( computeLighting( idx, dirToLight, eyeNormal, att), vec3(1.0));
-}
-v2f vert( in appdata IN )
-{
- v2f o;
- mediump vec4 color = vec4(0.0, 0.0, 0.0, 1.1);
-
- mediump vec3 eyeNormal = IN.normal;
-
- mediump vec3 lcolor = vec3(0.0);
-
- // loop doing up to N lights, with max cap
- highp int il = 0;
- for ( ; (float(il) < min( 8.0, float(unity_VertexLightParams.x))); (++il))
- {
- lcolor += computeOneLight(il, eyeNormal);
- }
- color.xyz = lcolor.xyz;
-
- // other forms of a similar loop
- for (int j = 0; j < int(min(float(unity_VertexLightParams.y),4.0)); ++j)
- color.xyz += unity_LightColor[j].xyz;
- for (int j = 0; j < min(unity_VertexLightParams.y,4); ++j)
- color.xyz *= unity_LightColor[j].xyz;
-
- o.color = color;
- o.pos = vec4(IN.pos,1.0);
- return o;
-}
-out lowp vec4 xlv_COLOR0;
-void main() {
- v2f xl_retval;
- appdata xlt_IN;
- xlt_IN.pos = _glesVertex.xyz;
- xlt_IN.normal = _glesNormal;
- xl_retval = vert(xlt_IN);
- xlv_COLOR0 = vec4(xl_retval.color);
- gl_Position = vec4(xl_retval.pos);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES.txt
deleted file mode 100644
index 0a91784e1a8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES.txt
+++ /dev/null
@@ -1,65 +0,0 @@
-attribute vec4 _glesVertex;
-attribute vec3 _glesNormal;
-uniform mediump vec4 unity_LightColor[8];
-uniform highp vec4 unity_LightPosition[8];
-uniform highp ivec4 unity_VertexLightParams;
-varying lowp vec4 xlv_COLOR0;
-void main ()
-{
- highp vec3 tmpvar_1;
- highp vec3 tmpvar_2;
- tmpvar_1 = _glesVertex.xyz;
- tmpvar_2 = _glesNormal;
- highp int j_3;
- highp int il_4;
- mediump vec3 lcolor_5;
- mediump vec3 eyeNormal_6;
- mediump vec4 color_7;
- lowp vec4 tmpvar_8;
- color_7 = vec4(0.0, 0.0, 0.0, 1.1);
- eyeNormal_6 = tmpvar_2;
- lcolor_5 = vec3(0.0, 0.0, 0.0);
- il_4 = 0;
- while (true) {
- highp float tmpvar_9;
- tmpvar_9 = min (8.0, float(unity_VertexLightParams.x));
- if ((float(il_4) >= tmpvar_9)) {
- break;
- };
- highp vec3 tmpvar_10;
- tmpvar_10 = unity_LightPosition[il_4].xyz;
- mediump vec3 dirToLight_11;
- dirToLight_11 = tmpvar_10;
- lcolor_5 = (lcolor_5 + min ((
- (max (dot (eyeNormal_6, dirToLight_11), 0.0) * unity_LightColor[il_4].xyz)
- * 0.5), vec3(1.0, 1.0, 1.0)));
- il_4++;
- };
- color_7.xyz = lcolor_5;
- j_3 = 0;
- while (true) {
- highp float tmpvar_12;
- tmpvar_12 = min (float(unity_VertexLightParams.y), 4.0);
- if ((j_3 >= int(tmpvar_12))) {
- break;
- };
- color_7.xyz = (color_7.xyz + unity_LightColor[j_3].xyz);
- j_3++;
- };
- tmpvar_8 = color_7;
- highp vec4 tmpvar_13;
- tmpvar_13.w = 1.0;
- tmpvar_13.xyz = tmpvar_1;
- xlv_COLOR0 = tmpvar_8;
- gl_Position = tmpvar_13;
-}
-
-
-// stats: 22 alu 0 tex 4 flow
-// inputs: 2
-// #0: _glesVertex (high float) 4x1 [-1]
-// #1: _glesNormal (high float) 3x1 [-1]
-// uniforms: 3 (total size: 0)
-// #0: unity_LightColor (medium float) 4x1 [8]
-// #1: unity_LightPosition (high float) 4x1 [8]
-// #2: unity_VertexLightParams (high int) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3.txt
deleted file mode 100644
index 83f6ba5d505..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-#version 300 es
-in vec4 _glesVertex;
-in vec3 _glesNormal;
-uniform mediump vec4 unity_LightColor[8];
-uniform highp vec4 unity_LightPosition[8];
-uniform highp ivec4 unity_VertexLightParams;
-out lowp vec4 xlv_COLOR0;
-void main ()
-{
- highp vec3 tmpvar_1;
- highp vec3 tmpvar_2;
- tmpvar_1 = _glesVertex.xyz;
- tmpvar_2 = _glesNormal;
- highp int j_3;
- highp int j_4;
- highp int il_5;
- mediump vec3 lcolor_6;
- mediump vec3 eyeNormal_7;
- mediump vec4 color_8;
- lowp vec4 tmpvar_9;
- color_8 = vec4(0.0, 0.0, 0.0, 1.1);
- eyeNormal_7 = tmpvar_2;
- lcolor_6 = vec3(0.0, 0.0, 0.0);
- il_5 = 0;
- while (true) {
- highp float tmpvar_10;
- tmpvar_10 = min (8.0, float(unity_VertexLightParams.x));
- if ((float(il_5) >= tmpvar_10)) {
- break;
- };
- highp vec3 tmpvar_11;
- tmpvar_11 = unity_LightPosition[il_5].xyz;
- mediump vec3 dirToLight_12;
- dirToLight_12 = tmpvar_11;
- lcolor_6 = (lcolor_6 + min ((
- (max (dot (eyeNormal_7, dirToLight_12), 0.0) * unity_LightColor[il_5].xyz)
- * 0.5), vec3(1.0, 1.0, 1.0)));
- il_5++;
- };
- color_8.xyz = lcolor_6;
- j_4 = 0;
- while (true) {
- highp float tmpvar_13;
- tmpvar_13 = min (float(unity_VertexLightParams.y), 4.0);
- if ((j_4 >= int(tmpvar_13))) {
- break;
- };
- color_8.xyz = (color_8.xyz + unity_LightColor[j_4].xyz);
- j_4++;
- };
- j_3 = 0;
- while (true) {
- highp int tmpvar_14;
- tmpvar_14 = min (unity_VertexLightParams.y, 4);
- if ((j_3 >= tmpvar_14)) {
- break;
- };
- color_8.xyz = (color_8.xyz * unity_LightColor[j_3].xyz);
- j_3++;
- };
- tmpvar_9 = color_8;
- highp vec4 tmpvar_15;
- tmpvar_15.w = 1.0;
- tmpvar_15.xyz = tmpvar_1;
- xlv_COLOR0 = tmpvar_9;
- gl_Position = tmpvar_15;
-}
-
-
-// stats: 27 alu 0 tex 6 flow
-// inputs: 2
-// #0: _glesVertex (high float) 4x1 [-1]
-// #1: _glesNormal (high float) 3x1 [-1]
-// uniforms: 3 (total size: 0)
-// #0: unity_LightColor (medium float) 4x1 [8]
-// #1: unity_LightPosition (high float) 4x1 [8]
-// #2: unity_VertexLightParams (high int) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3Metal.txt
deleted file mode 100644
index a46b4aba05b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forlimitbreak-outES3Metal.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 _glesVertex [[attribute(0)]];
- float3 _glesNormal [[attribute(1)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- half4 xlv_COLOR0;
-};
-struct xlatMtlShaderUniform {
- half4 unity_LightColor[8];
- float4 unity_LightPosition[8];
- int4 unity_VertexLightParams;
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float3 tmpvar_1 = 0;
- tmpvar_1 = _mtl_i._glesVertex.xyz;
- int j_2 = 0;
- int j_3 = 0;
- int il_4 = 0;
- half3 lcolor_5 = 0;
- half3 eyeNormal_6 = 0;
- half4 color_7 = 0;
- half4 tmpvar_8 = 0;
- color_7 = half4(float4(0.0, 0.0, 0.0, 1.1));
- eyeNormal_6 = half3(_mtl_i._glesNormal);
- lcolor_5 = half3(float3(0.0, 0.0, 0.0));
- il_4 = 0;
- while (true) {
- float tmpvar_9 = 0;
- tmpvar_9 = min (8.0, float(_mtl_u.unity_VertexLightParams.x));
- if ((float(il_4) >= tmpvar_9)) {
- break;
- };
- float3 tmpvar_10 = 0;
- tmpvar_10 = _mtl_u.unity_LightPosition[il_4].xyz;
- half3 dirToLight_11 = 0;
- dirToLight_11 = half3(tmpvar_10);
- lcolor_5 = (lcolor_5 + min ((
- (max (dot (eyeNormal_6, dirToLight_11), (half)0.0) * _mtl_u.unity_LightColor[il_4].xyz)
- * (half)(0.5)), (half3)float3(1.0, 1.0, 1.0)));
- il_4++;
- };
- color_7.xyz = lcolor_5;
- j_3 = 0;
- while (true) {
- float tmpvar_12 = 0;
- tmpvar_12 = min (float(_mtl_u.unity_VertexLightParams.y), 4.0);
- if ((j_3 >= int(tmpvar_12))) {
- break;
- };
- color_7.xyz = (color_7.xyz + _mtl_u.unity_LightColor[j_3].xyz);
- j_3++;
- };
- j_2 = 0;
- while (true) {
- int tmpvar_13 = 0;
- tmpvar_13 = min (_mtl_u.unity_VertexLightParams.y, 4);
- if ((j_2 >= tmpvar_13)) {
- break;
- };
- color_7.xyz = (color_7.xyz * _mtl_u.unity_LightColor[j_2].xyz);
- j_2++;
- };
- tmpvar_8 = color_7;
- float4 tmpvar_14 = 0;
- tmpvar_14.w = 1.0;
- tmpvar_14.xyz = tmpvar_1;
- _mtl_o.xlv_COLOR0 = tmpvar_8;
- _mtl_o.gl_Position = tmpvar_14;
- return _mtl_o;
-}
-
-
-// stats: 27 alu 0 tex 6 flow
-// inputs: 2
-// #0: _glesVertex (high float) 4x1 [-1] loc 0
-// #1: _glesNormal (high float) 3x1 [-1] loc 1
-// uniforms: 3 (total size: 208)
-// #0: unity_LightColor (medium float) 4x1 [8] loc 0
-// #1: unity_LightPosition (high float) 4x1 [8] loc 64
-// #2: unity_VertexLightParams (high int) 4x1 [-1] loc 192
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-in.txt
deleted file mode 100644
index 91a3ae3aa5f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-in.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-uniform vec4 uniColors[4];
-varying vec4 varColor;
-void main() {
- gl_Position = gl_Vertex;
- vec4 col = vec4(0.0);
- for (int i = 0; i < 4; ++i)
- col += uniColors[i];
- varColor = col;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-out.txt
deleted file mode 100644
index 454265781b7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forsimple-out.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-uniform vec4 uniColors[4];
-varying vec4 varColor;
-void main ()
-{
- vec4 col_1;
- gl_Position = gl_Vertex;
- col_1 = uniColors[0];
- col_1 = (col_1 + uniColors[1]);
- col_1 = (col_1 + uniColors[2]);
- col_1 = (col_1 + uniColors[3]);
- varColor = col_1;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 1 (total size: 0)
-// #0: uniColors (high float) 4x1 [4]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES.txt
deleted file mode 100644
index d335ed21ce0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-
-#line 14
-struct v2f {
- mediump vec4 pos;
- mediump vec4 color;
-};
-#line 9
-struct appdata {
- highp vec4 vertex;
- highp vec3 normal;
-};
-uniform highp mat4 UNITY_MATRIX_MVP;
-uniform highp vec4 unity_LightAtten[4];
-uniform highp vec4 unity_LightColor[4];
-v2f xlat_main( in appdata v );
-#line 35
-v2f xlat_main( in appdata v ) {
- v2f o;
- highp int i = 0;
- highp int i_1 = 0;
- highp int j = 3;
- highp int i_2 = 0;
- highp vec4 l;
- highp int i_3 = 0;
- highp vec4 l_1;
- highp int k = 1;
- highp int z;
- #line 38
- o.pos = (UNITY_MATRIX_MVP * v.vertex);
- o.color = vec4( 0.00000);
- for ( ; (i < 2); (++i)) {
- o.color += unity_LightColor[i];
- }
- #line 45
- for ( ; (i_1 < 4); (++i_1)) {
- o.color += unity_LightColor[i_1];
- }
- #line 49
- for ( ; (j >= 0); j = (j - 1)) {
- o.color += unity_LightColor[j];
- }
- #line 53
- for ( ; (i_2 < 2); (++i_2)) {
- l = (unity_LightColor[i_2] * unity_LightAtten[i_2].x);
- o.color += l;
- }
- #line 59
- for ( ; (i_3 < 2); (++i_3)) {
- l_1 = (unity_LightColor[i_3] * unity_LightAtten[i_3].z);
- o.color += l_1;
- }
- #line 65
- while ( (k < 3) ) {
- o.color += unity_LightColor[k].x;
- #line 69
- z = (k + 1);
- k = z;
- }
- #line 73
- return o;
-}
-varying mediump vec4 xlv_TEXCOORD0;
-void main() {
- v2f xl_retval;
- appdata xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.normal = vec3( gl_Normal);
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_TEXCOORD0 = vec4( xl_retval.color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES3.txt
deleted file mode 100644
index ed4f383c68b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-inES3.txt
+++ /dev/null
@@ -1,74 +0,0 @@
-#version 300 es
-
-#line 14
-struct v2f {
- mediump vec4 pos;
- mediump vec4 color;
-};
-#line 9
-struct appdata {
- highp vec4 vertex;
- highp vec3 normal;
-};
-uniform highp mat4 UNITY_MATRIX_MVP;
-uniform highp vec4 unity_LightAtten[4];
-uniform highp vec4 unity_LightColor[4];
-v2f xlat_main( in appdata v );
-#line 35
-v2f xlat_main( in appdata v ) {
- v2f o;
- highp int i = 0;
- highp int i_1 = 0;
- highp int j = 3;
- highp int i_2 = 0;
- highp vec4 l;
- highp int i_3 = 0;
- highp vec4 l_1;
- highp int k = 1;
- highp int z;
- #line 38
- o.pos = (UNITY_MATRIX_MVP * v.vertex);
- o.color = vec4( 0.00000);
- for ( ; (i < 2); (++i)) {
- o.color += unity_LightColor[i];
- }
- #line 45
- for ( ; (i_1 < 4); (++i_1)) {
- o.color += unity_LightColor[i_1];
- }
- #line 49
- for ( ; (j >= 0); j = (j - 1)) {
- o.color += unity_LightColor[j];
- }
- #line 53
- for ( ; (i_2 < 2); (++i_2)) {
- l = (unity_LightColor[i_2] * unity_LightAtten[i_2].x);
- o.color += l;
- }
- #line 59
- for ( ; (i_3 < 2); (++i_3)) {
- l_1 = (unity_LightColor[i_3] * unity_LightAtten[i_3].z);
- o.color += l_1;
- }
- #line 65
- while ( (k < 3) ) {
- o.color += unity_LightColor[k].x;
- #line 69
- z = (k + 1);
- k = z;
- }
- #line 73
- return o;
-}
-in highp vec4 _inVertex;
-in mediump vec3 _inNormal;
-out mediump vec4 xlv_TEXCOORD0;
-void main() {
- v2f xl_retval;
- appdata xlt_v;
- xlt_v.vertex = vec4(_inVertex);
- xlt_v.normal = vec3(_inNormal);
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_TEXCOORD0 = vec4( xl_retval.color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES.txt
deleted file mode 100644
index b30ed4728c4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-attribute highp vec4 _glesVertex;
-uniform highp mat4 UNITY_MATRIX_MVP;
-uniform highp vec4 unity_LightAtten[4];
-uniform highp vec4 unity_LightColor[4];
-varying mediump vec4 xlv_TEXCOORD0;
-void main ()
-{
- highp vec4 l_1_1;
- highp vec4 l_2;
- mediump vec4 tmpvar_3;
- mediump vec4 tmpvar_4;
- tmpvar_3 = (UNITY_MATRIX_MVP * _glesVertex);
- tmpvar_4 = unity_LightColor[0];
- tmpvar_4 = (tmpvar_4 + unity_LightColor[1]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[0]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[1]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[2]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[3]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[3]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[2]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[1]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[0]);
- l_2 = (unity_LightColor[0] * unity_LightAtten[0].x);
- tmpvar_4 = (tmpvar_4 + l_2);
- l_2 = (unity_LightColor[1] * unity_LightAtten[1].x);
- tmpvar_4 = (tmpvar_4 + l_2);
- l_1_1 = (unity_LightColor[0] * unity_LightAtten[0].z);
- tmpvar_4 = (tmpvar_4 + l_1_1);
- l_1_1 = (unity_LightColor[1] * unity_LightAtten[1].z);
- tmpvar_4 = (tmpvar_4 + l_1_1);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[1].x);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[2].x);
- gl_Position = tmpvar_3;
- xlv_TEXCOORD0 = tmpvar_4;
-}
-
-
-// stats: 20 alu 0 tex 0 flow
-// inputs: 1
-// #0: _glesVertex (high float) 4x1 [-1]
-// uniforms: 3 (total size: 0)
-// #0: UNITY_MATRIX_MVP (high float) 4x4 [-1]
-// #1: unity_LightAtten (high float) 4x1 [4]
-// #2: unity_LightColor (high float) 4x1 [4]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3.txt
deleted file mode 100644
index e24e976c3f0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-#version 300 es
-uniform highp mat4 UNITY_MATRIX_MVP;
-uniform highp vec4 unity_LightAtten[4];
-uniform highp vec4 unity_LightColor[4];
-in highp vec4 _inVertex;
-out mediump vec4 xlv_TEXCOORD0;
-void main ()
-{
- highp vec4 l_1_1;
- highp vec4 l_2;
- mediump vec4 tmpvar_3;
- mediump vec4 tmpvar_4;
- tmpvar_3 = (UNITY_MATRIX_MVP * _inVertex);
- tmpvar_4 = unity_LightColor[0];
- tmpvar_4 = (tmpvar_4 + unity_LightColor[1]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[0]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[1]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[2]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[3]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[3]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[2]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[1]);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[0]);
- l_2 = (unity_LightColor[0] * unity_LightAtten[0].x);
- tmpvar_4 = (tmpvar_4 + l_2);
- l_2 = (unity_LightColor[1] * unity_LightAtten[1].x);
- tmpvar_4 = (tmpvar_4 + l_2);
- l_1_1 = (unity_LightColor[0] * unity_LightAtten[0].z);
- tmpvar_4 = (tmpvar_4 + l_1_1);
- l_1_1 = (unity_LightColor[1] * unity_LightAtten[1].z);
- tmpvar_4 = (tmpvar_4 + l_1_1);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[1].x);
- tmpvar_4 = (tmpvar_4 + unity_LightColor[2].x);
- gl_Position = tmpvar_3;
- xlv_TEXCOORD0 = tmpvar_4;
-}
-
-
-// stats: 20 alu 0 tex 0 flow
-// inputs: 1
-// #0: _inVertex (high float) 4x1 [-1]
-// uniforms: 3 (total size: 0)
-// #0: UNITY_MATRIX_MVP (high float) 4x4 [-1]
-// #1: unity_LightAtten (high float) 4x1 [4]
-// #2: unity_LightColor (high float) 4x1 [4]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3Metal.txt
deleted file mode 100644
index baecd492cfd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forvarious-outES3Metal.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 _inVertex [[attribute(0)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- half4 xlv_TEXCOORD0;
-};
-struct xlatMtlShaderUniform {
- float4x4 UNITY_MATRIX_MVP;
- float4 unity_LightAtten[4];
- float4 unity_LightColor[4];
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float4 l_1_1 = 0;
- float4 l_2 = 0;
- half4 tmpvar_3 = 0;
- half4 tmpvar_4 = 0;
- tmpvar_3 = half4((_mtl_u.UNITY_MATRIX_MVP * _mtl_i._inVertex));
- tmpvar_4 = half4(_mtl_u.unity_LightColor[0]);
- tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[1]));
- tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[0]));
- tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[1]));
- tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[2]));
- tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[3]));
- tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[3]));
- tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[2]));
- tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[1]));
- tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[0]));
- l_2 = (_mtl_u.unity_LightColor[0] * _mtl_u.unity_LightAtten[0].x);
- tmpvar_4 = half4(((float4)(tmpvar_4) + l_2));
- l_2 = (_mtl_u.unity_LightColor[1] * _mtl_u.unity_LightAtten[1].x);
- tmpvar_4 = half4(((float4)(tmpvar_4) + l_2));
- l_1_1 = (_mtl_u.unity_LightColor[0] * _mtl_u.unity_LightAtten[0].z);
- tmpvar_4 = half4(((float4)(tmpvar_4) + l_1_1));
- l_1_1 = (_mtl_u.unity_LightColor[1] * _mtl_u.unity_LightAtten[1].z);
- tmpvar_4 = half4(((float4)(tmpvar_4) + l_1_1));
- tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[1].x));
- tmpvar_4 = half4(((float4)(tmpvar_4) + _mtl_u.unity_LightColor[2].x));
- _mtl_o.gl_Position = float4(tmpvar_3);
- _mtl_o.xlv_TEXCOORD0 = tmpvar_4;
- return _mtl_o;
-}
-
-
-// stats: 20 alu 0 tex 0 flow
-// inputs: 1
-// #0: _inVertex (high float) 4x1 [-1] loc 0
-// uniforms: 3 (total size: 192)
-// #0: UNITY_MATRIX_MVP (high float) 4x4 [-1] loc 0
-// #1: unity_LightAtten (high float) 4x1 [4] loc 64
-// #2: unity_LightColor (high float) 4x1 [4] loc 128
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-in.txt
deleted file mode 100644
index 8647c9e7f5c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-in.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-uniform vec4 uniColors[4];
-varying vec4 varColor;
-void main() {
- gl_Position = gl_Vertex;
- vec4 col = vec4(0.0);
- for (int i = 0; i < 4; ++i)
- col += max (vec4(0.0), uniColors[i]);
- varColor = col;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-out.txt
deleted file mode 100644
index d1f5779b28e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/loops-forwithcalls-out.txt
+++ /dev/null
@@ -1,19 +0,0 @@
-uniform vec4 uniColors[4];
-varying vec4 varColor;
-void main ()
-{
- vec4 col_1;
- gl_Position = gl_Vertex;
- col_1 = max (vec4(0.0, 0.0, 0.0, 0.0), uniColors[0]);
- col_1 = (col_1 + max (vec4(0.0, 0.0, 0.0, 0.0), uniColors[1]));
- col_1 = (col_1 + max (vec4(0.0, 0.0, 0.0, 0.0), uniColors[2]));
- col_1 = (col_1 + max (vec4(0.0, 0.0, 0.0, 0.0), uniColors[3]));
- varColor = col_1;
-}
-
-
-// stats: 7 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 1 (total size: 0)
-// #0: uniColors (high float) 4x1 [4]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-inES3.txt
deleted file mode 100644
index 36132a10afd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-inES3.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-#version 300 es
-
-uniform highp mat4 uniMat4F;
-uniform mediump mat4 uniMat4H;
-uniform highp mat3 uniMat3F;
-uniform mediump mat3 uniMat3H;
-uniform highp mat2 uniMat2F;
-uniform mediump mat2 uniMat2H;
-
-in highp vec4 inf;
-in mediump vec4 inh;
-
-void main()
-{
- highp vec4 r = vec4(0.0);
-
- mediump mat4 ftoh4 = uniMat4F;
- r.x += ftoh4[0][0];
- mediump mat3 ftoh3 = uniMat3F;
- r.x += ftoh4[0][0];
- mediump mat2 ftoh2 = uniMat2F;
- r.x += ftoh2[0][0];
-
- highp mat4 htof4 = uniMat4H;
- r.x += htof4[0][0];
- highp mat3 htof3 = uniMat3H;
- r.x += htof3[0][0];
- highp mat2 htof2 = uniMat2H;
- r.x += htof2[0][0];
-
- gl_Position = r;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3.txt
deleted file mode 100644
index 5172170a5ea..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-#version 300 es
-uniform highp mat4 uniMat4F;
-uniform mediump mat4 uniMat4H;
-uniform mediump mat3 uniMat3H;
-uniform highp mat2 uniMat2F;
-uniform mediump mat2 uniMat2H;
-void main ()
-{
- highp mat2 htof2_1;
- highp mat3 htof3_2;
- highp mat4 htof4_3;
- mediump mat2 ftoh2_4;
- mediump mat4 ftoh4_5;
- highp vec4 r_6;
- r_6.yzw = vec3(0.0, 0.0, 0.0);
- ftoh4_5 = uniMat4F;
- r_6.x = ftoh4_5[0].x;
- r_6.x = (r_6.x + ftoh4_5[0].x);
- ftoh2_4 = uniMat2F;
- r_6.x = (r_6.x + ftoh2_4[0].x);
- htof4_3 = uniMat4H;
- r_6.x = (r_6.x + htof4_3[0].x);
- htof3_2 = uniMat3H;
- r_6.x = (r_6.x + htof3_2[0].x);
- htof2_1 = uniMat2H;
- r_6.x = (r_6.x + htof2_1[0].x);
- gl_Position = r_6;
-}
-
-
-// stats: 6 alu 0 tex 0 flow
-// uniforms: 5 (total size: 0)
-// #0: uniMat4F (high float) 4x4 [-1]
-// #1: uniMat4H (medium float) 4x4 [-1]
-// #2: uniMat3H (medium float) 3x3 [-1]
-// #3: uniMat2F (high float) 2x2 [-1]
-// #4: uniMat2H (medium float) 2x2 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3Metal.txt
deleted file mode 100644
index 853cf69b6cb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/matrix-casts-outES3Metal.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-inline float4x4 _xlcast_float4x4(half4x4 v) { return float4x4(float4(v[0]), float4(v[1]), float4(v[2]), float4(v[3])); }
-inline float3x3 _xlcast_float3x3(half3x3 v) { return float3x3(float3(v[0]), float3(v[1]), float3(v[2])); }
-inline float2x2 _xlcast_float2x2(half2x2 v) { return float2x2(float2(v[0]), float2(v[1])); }
-inline half4x4 _xlcast_half4x4(float4x4 v) { return half4x4(half4(v[0]), half4(v[1]), half4(v[2]), half4(v[3])); }
-inline half3x3 _xlcast_half3x3(float3x3 v) { return half3x3(half3(v[0]), half3(v[1]), half3(v[2])); }
-inline half2x2 _xlcast_half2x2(float2x2 v) { return half2x2(half2(v[0]), half2(v[1])); }
-struct xlatMtlShaderInput {
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
-};
-struct xlatMtlShaderUniform {
- float4x4 uniMat4F;
- half4x4 uniMat4H;
- half3x3 uniMat3H;
- float2x2 uniMat2F;
- half2x2 uniMat2H;
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float2x2 htof2_1;
- float3x3 htof3_2;
- float4x4 htof4_3;
- half2x2 ftoh2_4;
- half4x4 ftoh4_5;
- float4 r_6 = 0;
- r_6.yzw = float3(0.0, 0.0, 0.0);
- ftoh4_5 = _xlcast_half4x4(_mtl_u.uniMat4F);
- r_6.x = float(ftoh4_5[0].x);
- r_6.x = (r_6.x + (float)(ftoh4_5[0].x));
- ftoh2_4 = _xlcast_half2x2(_mtl_u.uniMat2F);
- r_6.x = (r_6.x + (float)(ftoh2_4[0].x));
- htof4_3 = _xlcast_float4x4(_mtl_u.uniMat4H);
- r_6.x = (r_6.x + htof4_3[0].x);
- htof3_2 = _xlcast_float3x3(_mtl_u.uniMat3H);
- r_6.x = (r_6.x + htof3_2[0].x);
- htof2_1 = _xlcast_float2x2(_mtl_u.uniMat2H);
- r_6.x = (r_6.x + htof2_1[0].x);
- _mtl_o.gl_Position = r_6;
- return _mtl_o;
-}
-
-
-// stats: 6 alu 0 tex 0 flow
-// uniforms: 5 (total size: 144)
-// #0: uniMat4F (high float) 4x4 [-1] loc 0
-// #1: uniMat4H (medium float) 4x4 [-1] loc 64
-// #2: uniMat3H (medium float) 3x3 [-1] loc 96
-// #3: uniMat2F (high float) 2x2 [-1] loc 120
-// #4: uniMat2H (medium float) 2x2 [-1] loc 136
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-in.txt
deleted file mode 100644
index fe33b86bfa5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-in.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-float foo (float a, float b, float c) {
- return a+b+c;
-}
-float bar (float a, float b) {
- float c = a*b;
- return foo (a, b, c);
-}
-float har (float a) {
- float b = sqrt(a);
- float c = sqrt(b);
- return bar (a, b) + c;
-}
-void main ()
-{
- gl_Position = vec4(har(gl_Vertex.x));
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-out.txt
deleted file mode 100644
index 3b5f0e7544c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-inline-varnames-out.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-void main ()
-{
- float tmpvar_1;
- tmpvar_1 = sqrt(gl_Vertex.x);
- gl_Position = vec4((((gl_Vertex.x + tmpvar_1) + (gl_Vertex.x * tmpvar_1)) + sqrt(tmpvar_1)));
-}
-
-
-// stats: 6 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-in.txt
deleted file mode 100644
index daa11c346ba..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-in.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-void main() {
- gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
- mat3 m = mat3 (0.1, 0.8, 0.1, 0.3, 0.3, 0.5, 0.9, 0.0, 0.1);
- vec3 n = m * gl_Normal;
- gl_FrontColor = vec4(n*0.5+0.5, 1.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-out.txt
deleted file mode 100644
index 57ef4edd23e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-constr-out.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-void main ()
-{
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_1;
- tmpvar_1.w = 1.0;
- tmpvar_1.xyz = (((mat3(0.1, 0.8, 0.1, 0.3, 0.3, 0.5, 0.9, 0.0, 0.1) * gl_Normal) * 0.5) + 0.5);
- gl_FrontColor = tmpvar_1;
-}
-
-
-// stats: 5 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 1 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES.txt
deleted file mode 100644
index c71dd057bc1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES.txt
+++ /dev/null
@@ -1,81 +0,0 @@
-uniform mat4 glstate_matrix_mvp;
-
-attribute vec4 attrVertex;
-attribute vec3 attrNormal;
-attribute vec4 attrTangent;
-
-mat3 xll_transpose(mat3 m) {
- 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]);
-}
-
-mat3 xll_constructMat3(mat4 m) {
- return mat3(vec3(m[0]), vec3(m[1]), vec3(m[2]));
-}
-
-struct v2f_surf {
- highp vec4 pos;
- lowp vec3 lightDir;
- lowp vec3 viewDir;
- lowp vec3 worldN;
-};
-
-struct appdata {
- highp vec4 vertex;
- highp vec4 tangent;
- highp vec3 normal;
-};
-
-uniform highp mat4 _Object2World;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform lowp vec4 _WorldSpaceLightPos0;
-
-uniform highp vec4 unity_Scale;
-
-highp vec3 ObjSpaceViewDir( in highp vec4 v ) {
- highp vec3 objSpaceCameraPos = (_World2Object * vec4(_WorldSpaceCameraPos.xyz, 1.0)).xyz * unity_Scale.w;
- return objSpaceCameraPos - v.xyz;
-}
-
-highp vec3 ObjSpaceLightDir( in highp vec4 v ) {
- highp vec3 objSpaceLightPos = (_World2Object * _WorldSpaceLightPos0).xyz;
- return objSpaceLightPos.xyz;
-}
-
-v2f_surf vert_surf (in appdata v) {
- v2f_surf o;
- o.pos = glstate_matrix_mvp * v.vertex;
-
- highp vec3 worldN = xll_constructMat3(_Object2World) * v.normal;
- o.worldN = worldN;
-
- highp vec3 binormal = cross(v.normal, v.tangent.xyz) * v.tangent.w;
- highp mat3 rotation = xll_transpose (mat3(v.tangent.xyz, binormal, v.normal));
-
- highp vec3 lightDir = rotation * ObjSpaceLightDir(v.vertex);
- o.lightDir = lightDir;
-
- highp vec3 viewDirForLight = rotation * ObjSpaceViewDir(v.vertex);
- o.viewDir = normalize( (lightDir + normalize( viewDirForLight )) );
- return o;
-}
-
-varying lowp vec3 varWorldN;
-varying lowp vec3 varLightDir;
-varying lowp vec3 varViewDir;
-
-void main() {
- appdata v;
- v.vertex = attrVertex;
- v.tangent = attrTangent;
- v.normal = attrNormal;
-
- v2f_surf rv = vert_surf(v);
-
- gl_Position = rv.pos;
- varWorldN = rv.worldN;
- varLightDir = rv.lightDir;
- varViewDir = rv.viewDir;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES3.txt
deleted file mode 100644
index 363216dabed..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-inES3.txt
+++ /dev/null
@@ -1,83 +0,0 @@
-#version 300 es
-
-uniform mat4 glstate_matrix_mvp;
-
-in highp vec4 attrVertex;
-in mediump vec3 attrNormal;
-in mediump vec4 attrTangent;
-
-mat3 xll_transpose(mat3 m) {
- 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]);
-}
-
-mat3 xll_constructMat3(mat4 m) {
- return mat3(vec3(m[0]), vec3(m[1]), vec3(m[2]));
-}
-
-struct v2f_surf {
- highp vec4 pos;
- lowp vec3 lightDir;
- lowp vec3 viewDir;
- lowp vec3 worldN;
-};
-
-struct appdata {
- highp vec4 vertex;
- mediump vec4 tangent;
- mediump vec3 normal;
-};
-
-uniform highp mat4 _Object2World;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform lowp vec4 _WorldSpaceLightPos0;
-
-uniform highp vec4 unity_Scale;
-
-highp vec3 ObjSpaceViewDir( in highp vec4 v ) {
- highp vec3 objSpaceCameraPos = (_World2Object * vec4(_WorldSpaceCameraPos.xyz, 1.0)).xyz * unity_Scale.w;
- return objSpaceCameraPos - v.xyz;
-}
-
-highp vec3 ObjSpaceLightDir( in highp vec4 v ) {
- highp vec3 objSpaceLightPos = (_World2Object * _WorldSpaceLightPos0).xyz;
- return objSpaceLightPos.xyz;
-}
-
-v2f_surf vert_surf (in appdata v) {
- v2f_surf o;
- o.pos = glstate_matrix_mvp * v.vertex;
-
- highp vec3 worldN = xll_constructMat3(_Object2World) * v.normal;
- o.worldN = worldN;
-
- mediump vec3 binormal = cross(v.normal, v.tangent.xyz) * v.tangent.w;
- mediump mat3 rotation = xll_transpose (mat3(v.tangent.xyz, binormal, v.normal));
-
- mediump vec3 lightDir = rotation * ObjSpaceLightDir(v.vertex);
- o.lightDir = lightDir;
-
- highp vec3 viewDirForLight = rotation * ObjSpaceViewDir(v.vertex);
- o.viewDir = normalize( (lightDir + normalize( viewDirForLight )) );
- return o;
-}
-
-out lowp vec3 varWorldN;
-out lowp vec3 varLightDir;
-out lowp vec3 varViewDir;
-
-void main() {
- appdata v;
- v.vertex = attrVertex;
- v.tangent = attrTangent;
- v.normal = attrNormal;
-
- v2f_surf rv = vert_surf(v);
-
- gl_Position = rv.pos;
- varWorldN = rv.worldN;
- varLightDir = rv.lightDir;
- varViewDir = rv.viewDir;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES.txt
deleted file mode 100644
index 4c002181448..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES.txt
+++ /dev/null
@@ -1,70 +0,0 @@
-uniform mat4 glstate_matrix_mvp;
-attribute vec4 attrVertex;
-attribute vec3 attrNormal;
-attribute vec4 attrTangent;
-uniform highp mat4 _Object2World;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform lowp vec4 _WorldSpaceLightPos0;
-uniform highp vec4 unity_Scale;
-varying lowp vec3 varWorldN;
-varying lowp vec3 varLightDir;
-varying lowp vec3 varViewDir;
-void main ()
-{
- lowp vec3 tmpvar_1;
- lowp vec3 tmpvar_2;
- lowp vec3 tmpvar_3;
- highp mat3 tmpvar_4;
- tmpvar_4[0] = _Object2World[0].xyz;
- tmpvar_4[1] = _Object2World[1].xyz;
- tmpvar_4[2] = _Object2World[2].xyz;
- highp vec3 tmpvar_5;
- tmpvar_5 = (tmpvar_4 * attrNormal);
- tmpvar_3 = tmpvar_5;
- highp vec3 tmpvar_6;
- highp vec3 tmpvar_7;
- highp vec3 tmpvar_8;
- tmpvar_6 = attrTangent.xyz;
- tmpvar_7 = (((attrNormal.yzx * attrTangent.zxy) - (attrNormal.zxy * attrTangent.yzx)) * attrTangent.w);
- tmpvar_8 = attrNormal;
- highp mat3 tmpvar_9;
- tmpvar_9[0].x = tmpvar_6.x;
- tmpvar_9[0].y = tmpvar_7.x;
- tmpvar_9[0].z = tmpvar_8.x;
- tmpvar_9[1].x = tmpvar_6.y;
- tmpvar_9[1].y = tmpvar_7.y;
- tmpvar_9[1].z = tmpvar_8.y;
- tmpvar_9[2].x = tmpvar_6.z;
- tmpvar_9[2].y = tmpvar_7.z;
- tmpvar_9[2].z = tmpvar_8.z;
- highp vec3 tmpvar_10;
- tmpvar_10 = (tmpvar_9 * (_World2Object * _WorldSpaceLightPos0).xyz);
- tmpvar_1 = tmpvar_10;
- highp vec4 tmpvar_11;
- tmpvar_11.w = 1.0;
- tmpvar_11.xyz = _WorldSpaceCameraPos;
- highp vec3 tmpvar_12;
- tmpvar_12 = normalize((tmpvar_10 + normalize(
- (tmpvar_9 * (((_World2Object * tmpvar_11).xyz * unity_Scale.w) - attrVertex.xyz))
- )));
- tmpvar_2 = tmpvar_12;
- gl_Position = (glstate_matrix_mvp * attrVertex);
- varWorldN = tmpvar_3;
- varLightDir = tmpvar_1;
- varViewDir = tmpvar_2;
-}
-
-
-// stats: 16 alu 0 tex 0 flow
-// inputs: 3
-// #0: attrVertex (high float) 4x1 [-1]
-// #1: attrNormal (high float) 3x1 [-1]
-// #2: attrTangent (high float) 4x1 [-1]
-// uniforms: 6 (total size: 0)
-// #0: glstate_matrix_mvp (high float) 4x4 [-1]
-// #1: _Object2World (high float) 4x4 [-1]
-// #2: _World2Object (high float) 4x4 [-1]
-// #3: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #4: _WorldSpaceLightPos0 (low float) 4x1 [-1]
-// #5: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt
deleted file mode 100644
index b2b531d5e26..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-#version 300 es
-uniform mat4 glstate_matrix_mvp;
-in highp vec4 attrVertex;
-in mediump vec3 attrNormal;
-in mediump vec4 attrTangent;
-uniform highp mat4 _Object2World;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform lowp vec4 _WorldSpaceLightPos0;
-uniform highp vec4 unity_Scale;
-out lowp vec3 varWorldN;
-out lowp vec3 varLightDir;
-out lowp vec3 varViewDir;
-void main ()
-{
- mediump vec3 lightDir_1;
- highp vec3 worldN_2;
- lowp vec3 tmpvar_3;
- lowp vec3 tmpvar_4;
- lowp vec3 tmpvar_5;
- highp mat3 tmpvar_6;
- tmpvar_6[uint(0)] = _Object2World[0].xyz;
- tmpvar_6[1u] = _Object2World[1].xyz;
- tmpvar_6[2u] = _Object2World[2].xyz;
- mediump vec3 tmpvar_7;
- tmpvar_7 = (tmpvar_6 * attrNormal);
- worldN_2 = tmpvar_7;
- tmpvar_5 = worldN_2;
- mediump vec3 tmpvar_8;
- mediump vec3 tmpvar_9;
- tmpvar_8 = attrTangent.xyz;
- tmpvar_9 = (((attrNormal.yzx * attrTangent.zxy) - (attrNormal.zxy * attrTangent.yzx)) * attrTangent.w);
- mediump mat3 tmpvar_10;
- tmpvar_10[uint(0)].x = tmpvar_8.x;
- tmpvar_10[uint(0)].y = tmpvar_9.x;
- tmpvar_10[uint(0)].z = attrNormal.x;
- tmpvar_10[1u].x = tmpvar_8.y;
- tmpvar_10[1u].y = tmpvar_9.y;
- tmpvar_10[1u].z = attrNormal.y;
- tmpvar_10[2u].x = tmpvar_8.z;
- tmpvar_10[2u].y = tmpvar_9.z;
- tmpvar_10[2u].z = attrNormal.z;
- highp vec3 tmpvar_11;
- tmpvar_11 = (tmpvar_10 * (_World2Object * _WorldSpaceLightPos0).xyz);
- lightDir_1 = tmpvar_11;
- tmpvar_3 = lightDir_1;
- highp vec4 tmpvar_12;
- tmpvar_12.w = 1.0;
- tmpvar_12.xyz = _WorldSpaceCameraPos;
- highp vec3 tmpvar_13;
- tmpvar_13 = normalize((lightDir_1 + normalize(
- (tmpvar_10 * (((_World2Object * tmpvar_12).xyz * unity_Scale.w) - attrVertex.xyz))
- )));
- tmpvar_4 = tmpvar_13;
- gl_Position = (glstate_matrix_mvp * attrVertex);
- varWorldN = tmpvar_5;
- varLightDir = tmpvar_3;
- varViewDir = tmpvar_4;
-}
-
-
-// stats: 16 alu 0 tex 0 flow
-// inputs: 3
-// #0: attrVertex (high float) 4x1 [-1]
-// #1: attrNormal (medium float) 3x1 [-1]
-// #2: attrTangent (medium float) 4x1 [-1]
-// uniforms: 6 (total size: 0)
-// #0: glstate_matrix_mvp (high float) 4x4 [-1]
-// #1: _Object2World (high float) 4x4 [-1]
-// #2: _World2Object (high float) 4x4 [-1]
-// #3: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #4: _WorldSpaceLightPos0 (low float) 4x1 [-1]
-// #5: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3Metal.txt
deleted file mode 100644
index 316a5357934..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-matrix-transpose-mul-outES3Metal.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 attrVertex [[attribute(0)]];
- half3 attrNormal [[attribute(1)]];
- half4 attrTangent [[attribute(2)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- half3 varWorldN;
- half3 varLightDir;
- half3 varViewDir;
-};
-struct xlatMtlShaderUniform {
- float4x4 glstate_matrix_mvp;
- float4x4 _Object2World;
- float4x4 _World2Object;
- float3 _WorldSpaceCameraPos;
- half4 _WorldSpaceLightPos0;
- float4 unity_Scale;
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half3 lightDir_1 = 0;
- float3 worldN_2 = 0;
- half3 tmpvar_3 = 0;
- half3 tmpvar_4 = 0;
- half3 tmpvar_5 = 0;
- float3x3 tmpvar_6;
- tmpvar_6[0] = _mtl_u._Object2World[0].xyz;
- tmpvar_6[1] = _mtl_u._Object2World[1].xyz;
- tmpvar_6[2] = _mtl_u._Object2World[2].xyz;
- half3 tmpvar_7 = 0;
- tmpvar_7 = ((half3)(tmpvar_6 * (float3)(_mtl_i.attrNormal)));
- worldN_2 = float3(tmpvar_7);
- tmpvar_5 = half3(worldN_2);
- half3 tmpvar_8 = 0;
- half3 tmpvar_9 = 0;
- tmpvar_8 = _mtl_i.attrTangent.xyz;
- tmpvar_9 = (((_mtl_i.attrNormal.yzx * _mtl_i.attrTangent.zxy) - (_mtl_i.attrNormal.zxy * _mtl_i.attrTangent.yzx)) * _mtl_i.attrTangent.w);
- half3x3 tmpvar_10;
- tmpvar_10[0].x = tmpvar_8.x;
- tmpvar_10[0].y = tmpvar_9.x;
- tmpvar_10[0].z = _mtl_i.attrNormal.x;
- tmpvar_10[1].x = tmpvar_8.y;
- tmpvar_10[1].y = tmpvar_9.y;
- tmpvar_10[1].z = _mtl_i.attrNormal.y;
- tmpvar_10[2].x = tmpvar_8.z;
- tmpvar_10[2].y = tmpvar_9.z;
- tmpvar_10[2].z = _mtl_i.attrNormal.z;
- float3 tmpvar_11 = 0;
- tmpvar_11 = ((float3)(tmpvar_10 * (half3)((_mtl_u._World2Object * (float4)(_mtl_u._WorldSpaceLightPos0)).xyz)));
- lightDir_1 = half3(tmpvar_11);
- tmpvar_3 = lightDir_1;
- float4 tmpvar_12 = 0;
- tmpvar_12.w = 1.0;
- tmpvar_12.xyz = _mtl_u._WorldSpaceCameraPos;
- float3 tmpvar_13 = 0;
- tmpvar_13 = normalize(((float3)(lightDir_1) + normalize(
- ((float3)(tmpvar_10 * (half3)((((_mtl_u._World2Object * tmpvar_12).xyz * _mtl_u.unity_Scale.w) - _mtl_i.attrVertex.xyz))))
- )));
- tmpvar_4 = half3(tmpvar_13);
- _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i.attrVertex);
- _mtl_o.varWorldN = tmpvar_5;
- _mtl_o.varLightDir = tmpvar_3;
- _mtl_o.varViewDir = tmpvar_4;
- return _mtl_o;
-}
-
-
-// stats: 16 alu 0 tex 0 flow
-// inputs: 3
-// #0: attrVertex (high float) 4x1 [-1] loc 0
-// #1: attrNormal (medium float) 3x1 [-1] loc 1
-// #2: attrTangent (medium float) 4x1 [-1] loc 2
-// uniforms: 6 (total size: 240)
-// #0: glstate_matrix_mvp (high float) 4x4 [-1] loc 0
-// #1: _Object2World (high float) 4x4 [-1] loc 64
-// #2: _World2Object (high float) 4x4 [-1] loc 128
-// #3: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 192
-// #4: _WorldSpaceLightPos0 (low float) 4x1 [-1] loc 208
-// #5: unity_Scale (high float) 4x1 [-1] loc 224
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-in.txt
deleted file mode 100644
index aa2bf9e1063..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-in.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-uniform mat4 mvp;
-uniform mat3 m3a, m3b, m3c;
-uniform vec4 v3a, v3b, v3c;
-
-void main() {
- gl_Position = mvp * gl_Vertex;
-
- vec3 ta = -(v3a.xyz - gl_Vertex.xyz);
- vec3 ra = m3a * ta;
-
- vec3 tb = -((mvp * v3b).xyz - gl_Vertex.xyz);
- vec3 rb = m3b * tb;
-
- vec3 rc = m3c * (-(v3c.xyz - gl_Vertex.xyz));
-
- gl_FrontColor = vec4(ra+rb+rc,1.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-out.txt
deleted file mode 100644
index 8217deafa20..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-negsub-out.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-uniform mat4 mvp;
-uniform mat3 m3a;
-uniform mat3 m3b;
-uniform mat3 m3c;
-uniform vec4 v3a;
-uniform vec4 v3b;
-uniform vec4 v3c;
-void main ()
-{
- gl_Position = (mvp * gl_Vertex);
- vec4 tmpvar_1;
- tmpvar_1.w = 1.0;
- tmpvar_1.xyz = (((m3a *
- (gl_Vertex.xyz - v3a.xyz)
- ) + (m3b *
- (gl_Vertex.xyz - (mvp * v3b).xyz)
- )) + (m3c * (gl_Vertex.xyz - v3c.xyz)));
- gl_FrontColor = tmpvar_1;
-}
-
-
-// stats: 11 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 7 (total size: 0)
-// #0: mvp (high float) 4x4 [-1]
-// #1: m3a (high float) 3x3 [-1]
-// #2: m3b (high float) 3x3 [-1]
-// #3: m3c (high float) 3x3 [-1]
-// #4: v3a (high float) 4x1 [-1]
-// #5: v3b (high float) 4x1 [-1]
-// #6: v3c (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-in.txt
deleted file mode 100644
index 5019ea3dc26..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-in.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-varying vec3 var_a;
-
-void main() {
- gl_Position = gl_Vertex * normalize(vec4(1.0,2.0,3.0,4.0));
- var_a = gl_Vertex.xyz * normalize(vec3(0.0));
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt
deleted file mode 100644
index d70c93488b6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-normalize-out.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-varying vec3 var_a;
-void main ()
-{
- gl_Position = (gl_Vertex * vec4(0.1825742, 0.3651484, 0.5477225, 0.7302967));
- var_a = (gl_Vertex.xyz * normalize(vec3(0.0, 0.0, 0.0)));
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-in.txt
deleted file mode 100644
index a2f1f172c22..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-in.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-struct appdata_full {
- vec4 vertex;
- vec3 normal;
-};
-struct v2f {
- vec4 pos;
- vec3 backContrib;
- vec3 nl;
-};
-uniform vec3 _TerrainTreeLightDirections[4];
-uniform float _TranslucencyViewDependency;
-
-v2f vert(in appdata_full v)
-{
- v2f o;
- vec3 viewDir;
- o.pos = v.vertex;
- viewDir = v.vertex.xyz;
-
- // Do we unroll this loop?
- // At some point we didn't since the loop body was deemed "too large"
- for (int j = 0; j < 3; j++)
- {
- vec3 lightDir = _TerrainTreeLightDirections[j];
- float nl = dot(v.normal, lightDir);
- float backContrib = dot(viewDir, -lightDir);
- o.backContrib[ j ] = mix(-nl, backContrib, _TranslucencyViewDependency);
- o.nl[ j ] = max(0.0, (nl * 0.6) + 0.4);
- }
- return o;
-}
-
-void main() {
- v2f xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = gl_Vertex;
- xlt_v.normal = gl_Normal;
- xl_retval = vert(xlt_v);
- gl_Position = xl_retval.pos;
- gl_TexCoord[2] = vec4(xl_retval.backContrib, 0.0);
- gl_TexCoord[3] = vec4(xl_retval.nl, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-out.txt
deleted file mode 100644
index 9112d3fde5f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unroll-out.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-uniform vec3 _TerrainTreeLightDirections[4];
-uniform float _TranslucencyViewDependency;
-void main ()
-{
- vec3 tmpvar_1;
- vec3 tmpvar_2;
- vec3 tmpvar_3;
- tmpvar_3 = _TerrainTreeLightDirections[0];
- float tmpvar_4;
- tmpvar_4 = dot (gl_Normal, tmpvar_3);
- vec3 tmpvar_5;
- tmpvar_5.yz = tmpvar_1.yz;
- tmpvar_5.x = mix (-(tmpvar_4), dot (gl_Vertex.xyz, -(tmpvar_3)), _TranslucencyViewDependency);
- vec3 tmpvar_6;
- tmpvar_6.yz = tmpvar_2.yz;
- tmpvar_6.x = max (0.0, ((tmpvar_4 * 0.6) + 0.4));
- vec3 tmpvar_7;
- tmpvar_7 = _TerrainTreeLightDirections[1];
- float tmpvar_8;
- tmpvar_8 = dot (gl_Normal, tmpvar_7);
- vec3 tmpvar_9;
- tmpvar_9.xz = tmpvar_5.xz;
- tmpvar_9.y = mix (-(tmpvar_8), dot (gl_Vertex.xyz, -(tmpvar_7)), _TranslucencyViewDependency);
- vec3 tmpvar_10;
- tmpvar_10.xz = tmpvar_6.xz;
- tmpvar_10.y = max (0.0, ((tmpvar_8 * 0.6) + 0.4));
- vec3 tmpvar_11;
- tmpvar_11 = _TerrainTreeLightDirections[2];
- float tmpvar_12;
- tmpvar_12 = dot (gl_Normal, tmpvar_11);
- vec3 tmpvar_13;
- tmpvar_13.xy = tmpvar_9.xy;
- tmpvar_13.z = mix (-(tmpvar_12), dot (gl_Vertex.xyz, -(tmpvar_11)), _TranslucencyViewDependency);
- tmpvar_1 = tmpvar_13;
- vec3 tmpvar_14;
- tmpvar_14.xy = tmpvar_10.xy;
- tmpvar_14.z = max (0.0, ((tmpvar_12 * 0.6) + 0.4));
- tmpvar_2 = tmpvar_14;
- gl_Position = gl_Vertex;
- vec4 tmpvar_15;
- tmpvar_15.w = 0.0;
- tmpvar_15.xyz = tmpvar_13;
- gl_TexCoord[2] = tmpvar_15;
- vec4 tmpvar_16;
- tmpvar_16.w = 0.0;
- tmpvar_16.xyz = tmpvar_14;
- gl_TexCoord[3] = tmpvar_16;
-}
-
-
-// stats: 26 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: _TerrainTreeLightDirections (high float) 3x1 [4]
-// #1: _TranslucencyViewDependency (high float) 1x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-in.txt
deleted file mode 100644
index 431913263c9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-in.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-uniform mat4 mvp;
-uniform mat4 unusedMatrix;
-uniform float unusedFloat;
-attribute vec4 myColor;
-attribute vec3 myUnused;
-
-void main() {
- gl_Position = mvp * gl_Vertex;
- gl_FrontColor = myColor;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-out.txt
deleted file mode 100644
index c03f9855504..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/opt-unusedvars-out.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-uniform mat4 mvp;
-attribute vec4 myColor;
-void main ()
-{
- gl_Position = (mvp * gl_Vertex);
- gl_FrontColor = myColor;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
-// #1: myColor (high float) 4x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: mvp (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-inES3.txt
deleted file mode 100644
index 081edec0f14..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-inES3.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-#version 300 es
-
-#define gl_Vertex _glesVertex
-in vec4 _glesVertex;
-#define gl_MultiTexCoord0 _glesMultiTexCoord0
-in vec4 _glesMultiTexCoord0;
-float xll_saturate_f( float x) {
- return clamp( x, 0.0, 1.0);
-}
-struct VertexOutputShadowCaster {
- highp vec4 pos;
- mediump vec2 tex;
-};
-struct VertexInput {
- highp vec4 vertex;
- mediump vec4 uv0;
-};
-uniform highp vec4 unity_LightShadowBias;
-uniform highp mat4 glstate_matrix_mvp;
-VertexOutputShadowCaster vertShadowCaster( in VertexInput v ) {
- VertexOutputShadowCaster o;
- o.pos = (glstate_matrix_mvp * v.vertex);
- o.pos.z += xll_saturate_f((unity_LightShadowBias.x / o.pos.w));
- highp float clamped = max( o.pos.z, (o.pos.w * -1.0));
- o.pos.z = mix( o.pos.z, clamped, unity_LightShadowBias.y);
- o.tex.xy = v.uv0.xy;
- return o;
-}
-out mediump vec2 xlv_TEXCOORD1;
-void main() {
- VertexOutputShadowCaster xl_retval;
- VertexInput xlt_v;
- xlt_v.vertex = vec4(gl_Vertex);
- xlt_v.uv0 = vec4(gl_MultiTexCoord0);
- xl_retval = vertShadowCaster( xlt_v);
- gl_Position = vec4(xl_retval.pos);
-
- // Was producing missing precision cast on Metal, _bl_o.xlv_TEXCOORD1 = _bl_i._glesMultiTexCoord0.xy
- xlv_TEXCOORD1 = vec2(xl_retval.tex);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3.txt
deleted file mode 100644
index 5c7bf78fc63..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-#version 300 es
-in vec4 _glesVertex;
-in vec4 _glesMultiTexCoord0;
-uniform highp vec4 unity_LightShadowBias;
-uniform highp mat4 glstate_matrix_mvp;
-out mediump vec2 xlv_TEXCOORD1;
-void main ()
-{
- highp vec4 tmpvar_1;
- tmpvar_1 = (glstate_matrix_mvp * _glesVertex);
- tmpvar_1.z = (tmpvar_1.z + clamp ((unity_LightShadowBias.x / tmpvar_1.w), 0.0, 1.0));
- tmpvar_1.z = mix (tmpvar_1.z, max (tmpvar_1.z, -(tmpvar_1.w)), unity_LightShadowBias.y);
- gl_Position = tmpvar_1;
- xlv_TEXCOORD1 = _glesMultiTexCoord0.xy;
-}
-
-
-// stats: 7 alu 0 tex 0 flow
-// inputs: 2
-// #0: _glesVertex (high float) 4x1 [-1]
-// #1: _glesMultiTexCoord0 (high float) 4x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: unity_LightShadowBias (high float) 4x1 [-1]
-// #1: glstate_matrix_mvp (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3Metal.txt
deleted file mode 100644
index d1cc5bbd16e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzle-casts-outES3Metal.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 _glesVertex [[attribute(0)]];
- float4 _glesMultiTexCoord0 [[attribute(1)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- half2 xlv_TEXCOORD1;
-};
-struct xlatMtlShaderUniform {
- float4 unity_LightShadowBias;
- float4x4 glstate_matrix_mvp;
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half4 tmpvar_1 = 0;
- tmpvar_1 = half4(_mtl_i._glesMultiTexCoord0);
- float4 tmpvar_2 = 0;
- tmpvar_2 = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex);
- tmpvar_2.z = (tmpvar_2.z + clamp ((_mtl_u.unity_LightShadowBias.x / tmpvar_2.w), 0.0, 1.0));
- tmpvar_2.z = mix (tmpvar_2.z, max (tmpvar_2.z, -(tmpvar_2.w)), _mtl_u.unity_LightShadowBias.y);
- _mtl_o.gl_Position = tmpvar_2;
- _mtl_o.xlv_TEXCOORD1 = tmpvar_1.xy;
- return _mtl_o;
-}
-
-
-// stats: 7 alu 0 tex 0 flow
-// inputs: 2
-// #0: _glesVertex (high float) 4x1 [-1] loc 0
-// #1: _glesMultiTexCoord0 (high float) 4x1 [-1] loc 1
-// uniforms: 2 (total size: 80)
-// #0: unity_LightShadowBias (high float) 4x1 [-1] loc 0
-// #1: glstate_matrix_mvp (high float) 4x4 [-1] loc 16
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-in.txt
deleted file mode 100644
index 85325acfd7b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-in.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-varying vec4 texcoord;
-void main()
-{
- gl_Position.zw = gl_Vertex.xy*2.0;
- gl_Position.xy = gl_Vertex.xy;
- texcoord.x = gl_Vertex.z;
- texcoord.yz = gl_Vertex.zw;
- texcoord.w = gl_Vertex.x;
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-out.txt
deleted file mode 100644
index 9db80eb98a5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/swizzlemask-out.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-varying vec4 texcoord;
-void main ()
-{
- gl_Position.zw = (gl_Vertex.xy * 2.0);
- gl_Position.xy = gl_Vertex.xy;
- texcoord.x = gl_Vertex.z;
- texcoord.yz = gl_Vertex.zw;
- texcoord.w = gl_Vertex.x;
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-in.txt
deleted file mode 100644
index c589b2feb7f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-in.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec4 color;
-};
-struct a2v {
- vec4 pos;
- vec2 uv;
- vec3 normal;
- vec4 color;
-};
-uniform mat4 mvp;
-v2f xlat_main( in a2v v );
-v2f xlat_main( in a2v v ) {
- v2f o;
- float dx;
- float dy;
- float dz;
- o.pos = ( mvp * v.pos );
- o.color = v.color;
- o.color.xyz += v.normal;
- o.uv = v.uv;
- dx = v.pos.x ;
- dy = v.pos.y ;
- dz = v.pos.z ;
- return o;
-}
-varying vec2 xlv_TEXCOORD0;
-varying vec4 xlv_COLOR;
-void main() {
- v2f xl_retval;
- a2v xlt_v;
- xlt_v.pos = vec4( gl_Vertex);
- xlt_v.uv = vec2( gl_MultiTexCoord0);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.color = vec4( gl_Color);
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_TEXCOORD0 = vec2( xl_retval.uv);
- xlv_COLOR = vec4( xl_retval.color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-inES.txt
deleted file mode 100644
index fc0488b9626..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-inES.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-struct v2f {
- highp vec4 pos;
- mediump vec2 uv;
- lowp vec4 color;
-};
-struct a2v {
- highp vec4 pos;
- highp vec2 uv;
- mediump vec3 normal;
- lowp vec4 color;
-};
-uniform highp mat4 mvp;
-v2f xlat_main( in a2v v );
-v2f xlat_main( in a2v v ) {
- v2f o;
- highp float dx;
- mediump float dy;
- lowp float dz;
- o.pos = ( mvp * v.pos );
- o.color = v.color;
- o.color.xyz += v.normal;
- o.uv = v.uv;
- dx = v.pos.x ;
- dy = v.pos.y ;
- dz = v.pos.z ;
- return o;
-}
-varying mediump vec2 xlv_TEXCOORD0;
-varying lowp vec4 xlv_COLOR;
-void main() {
- v2f xl_retval;
- a2v xlt_v;
- xlt_v.pos = vec4( gl_Vertex);
- xlt_v.uv = vec2( gl_MultiTexCoord0);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.color = vec4( gl_Color);
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_TEXCOORD0 = vec2( xl_retval.uv);
- xlv_COLOR = vec4( xl_retval.color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-inES3.txt
deleted file mode 100644
index 92db801d05a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-inES3.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-#version 300 es
-
-struct v2f {
- highp vec4 pos;
- mediump vec2 uv;
- lowp vec4 color;
-};
-struct a2v {
- highp vec4 pos;
- highp vec2 uv;
- mediump vec3 normal;
- lowp vec4 color;
-};
-uniform highp mat4 mvp;
-v2f xlat_main( in a2v v );
-v2f xlat_main( in a2v v ) {
- v2f o;
- highp float dx;
- mediump float dy;
- lowp float dz;
- o.pos = ( mvp * v.pos );
- o.color = v.color;
- o.color.xyz += v.normal;
- o.uv = v.uv;
- dx = v.pos.x ;
- dy = v.pos.y ;
- dz = v.pos.z ;
- return o;
-}
-in highp vec4 _inVertex;
-in mediump vec3 _inNormal;
-in highp vec2 _uv0;
-in lowp vec4 _color;
-out mediump vec2 xlv_TEXCOORD0;
-out lowp vec4 xlv_COLOR;
-void main() {
- v2f xl_retval;
- a2v xlt_v;
- xlt_v.pos = _inVertex;
- xlt_v.uv = _uv0;
- xlt_v.normal = _inNormal;
- xlt_v.color = _color;
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_TEXCOORD0 = vec2( xl_retval.uv);
- xlv_COLOR = vec4( xl_retval.color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-out.txt
deleted file mode 100644
index 780f0740b05..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-out.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-uniform mat4 mvp;
-varying vec2 xlv_TEXCOORD0;
-varying vec4 xlv_COLOR;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1.w = gl_Color.w;
- tmpvar_1.xyz = (gl_Color.xyz + gl_Normal);
- gl_Position = (mvp * gl_Vertex);
- xlv_TEXCOORD0 = gl_MultiTexCoord0.xy;
- xlv_COLOR = tmpvar_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 1 (total size: 0)
-// #0: mvp (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES.txt
deleted file mode 100644
index 8420a2b4d5b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-attribute highp vec4 _glesVertex;
-attribute mediump vec3 _glesNormal;
-attribute highp vec4 _glesMultiTexCoord0;
-attribute lowp vec4 _glesColor;
-uniform highp mat4 mvp;
-varying mediump vec2 xlv_TEXCOORD0;
-varying lowp vec4 xlv_COLOR;
-void main ()
-{
- highp vec2 tmpvar_1;
- tmpvar_1 = _glesMultiTexCoord0.xy;
- mediump vec2 tmpvar_2;
- lowp vec4 tmpvar_3;
- tmpvar_3.w = _glesColor.w;
- tmpvar_3.xyz = (_glesColor.xyz + _glesNormal);
- tmpvar_2 = tmpvar_1;
- gl_Position = (mvp * _glesVertex);
- xlv_TEXCOORD0 = tmpvar_2;
- xlv_COLOR = tmpvar_3;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 4
-// #0: _glesVertex (high float) 4x1 [-1]
-// #1: _glesNormal (medium float) 3x1 [-1]
-// #2: _glesMultiTexCoord0 (high float) 4x1 [-1]
-// #3: _glesColor (low float) 4x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: mvp (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES3.txt
deleted file mode 100644
index 17942a68291..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES3.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-#version 300 es
-uniform highp mat4 mvp;
-in highp vec4 _inVertex;
-in mediump vec3 _inNormal;
-in highp vec2 _uv0;
-in lowp vec4 _color;
-out mediump vec2 xlv_TEXCOORD0;
-out lowp vec4 xlv_COLOR;
-void main ()
-{
- mediump vec2 tmpvar_1;
- lowp vec4 tmpvar_2;
- tmpvar_2.w = _color.w;
- tmpvar_2.xyz = (_color.xyz + _inNormal);
- tmpvar_1 = _uv0;
- gl_Position = (mvp * _inVertex);
- xlv_TEXCOORD0 = tmpvar_1;
- xlv_COLOR = tmpvar_2;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 4
-// #0: _inVertex (high float) 4x1 [-1]
-// #1: _inNormal (medium float) 3x1 [-1]
-// #2: _uv0 (high float) 2x1 [-1]
-// #3: _color (low float) 4x1 [-1]
-// uniforms: 1 (total size: 0)
-// #0: mvp (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES3Metal.txt
deleted file mode 100644
index dc2de38e3e8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/types-outES3Metal.txt
+++ /dev/null
@@ -1,40 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 _inVertex [[attribute(0)]];
- half3 _inNormal [[attribute(1)]];
- float2 _uv0 [[attribute(2)]];
- half4 _color [[attribute(3)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- half2 xlv_TEXCOORD0;
- half4 xlv_COLOR;
-};
-struct xlatMtlShaderUniform {
- float4x4 mvp;
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half2 tmpvar_1 = 0;
- half4 tmpvar_2 = 0;
- tmpvar_2.w = _mtl_i._color.w;
- tmpvar_2.xyz = (_mtl_i._color.xyz + _mtl_i._inNormal);
- tmpvar_1 = half2(_mtl_i._uv0);
- _mtl_o.gl_Position = (_mtl_u.mvp * _mtl_i._inVertex);
- _mtl_o.xlv_TEXCOORD0 = tmpvar_1;
- _mtl_o.xlv_COLOR = tmpvar_2;
- return _mtl_o;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 4
-// #0: _inVertex (high float) 4x1 [-1] loc 0
-// #1: _inNormal (medium float) 3x1 [-1] loc 1
-// #2: _uv0 (high float) 2x1 [-1] loc 2
-// #3: _color (low float) 4x1 [-1] loc 3
-// uniforms: 1 (total size: 64)
-// #0: mvp (high float) 4x4 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-inES3.txt
deleted file mode 100644
index 8d518be8879..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-inES3.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-#version 300 es
-
-#define gl_Vertex _glesVertex
-in highp vec4 _glesVertex;
-#define gl_Normal _glesNormal
-in mediump vec3 _glesNormal;
-#define gl_MultiTexCoord0 _glesMultiTexCoord0
-in highp vec4 _glesMultiTexCoord0;
-
-struct v2f {
- highp vec4 pos;
- lowp vec4 color;
- highp vec2 uv;
-};
-uniform mediump vec4 unity_LightColor[8];
-uniform highp vec4 unity_LightPosition[8];
-uniform mediump vec4 unity_LightAtten[8];
-uniform highp mat4 glstate_matrix_mvp;
-uniform highp mat4 glstate_matrix_modelview0;
-uniform highp mat4 glstate_matrix_invtrans_modelview0;
-uniform highp vec4 glstate_lightmodel_ambient;
-uniform mediump vec4 _Color;
-
-highp vec3 ShadeLights( in highp vec3 vertex, in highp vec3 normal ) {
- highp vec3 viewpos = (glstate_matrix_modelview0 * vec4( vertex, 1.0)).xyz;
- highp vec3 viewN = (mat3( glstate_matrix_invtrans_modelview0) * normal);
- highp vec3 lightColor = glstate_lightmodel_ambient.xyz;
- highp int i = 0;
- for ( ; (i < 4); (i++))
- {
- highp vec3 toLight = (unity_LightPosition[i].xyz - (viewpos.xyz * unity_LightPosition[i].w));
- highp float lengthSq = dot( toLight, toLight);
- highp float atten = (1.0 / (1.0 + (lengthSq * unity_LightAtten[i].z)));
- highp float diff = max( 0.0, dot( viewN, normalize(toLight)));
- lightColor += (unity_LightColor[i].xyz * (diff * atten));
- }
- return (lightColor * vec3( _Color));
-}
-v2f vert( in highp vec3 v, in highp vec3 n, in highp vec2 uv ) {
- v2f o;
- o.pos = (glstate_matrix_mvp * vec4(v, 1.0));
- o.color = vec4( (ShadeLights(v, n) * 2.0), 1.0);
- o.uv = uv;
- return o;
-}
-out lowp vec4 xlv_COLOR0;
-out highp vec2 xlv_TEXCOORD0;
-void main() {
- v2f xl_retval;
- xl_retval = vert( vec3(gl_Vertex), vec3(gl_Normal), vec2(gl_MultiTexCoord0));
- gl_Position = vec4(xl_retval.pos);
- xlv_COLOR0 = vec4(xl_retval.color);
- xlv_TEXCOORD0 = vec2(xl_retval.uv);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt
deleted file mode 100644
index 283af1e397e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3.txt
+++ /dev/null
@@ -1,88 +0,0 @@
-#version 300 es
-in highp vec4 _glesVertex;
-in mediump vec3 _glesNormal;
-in highp vec4 _glesMultiTexCoord0;
-uniform mediump vec4 unity_LightColor[8];
-uniform highp vec4 unity_LightPosition[8];
-uniform mediump vec4 unity_LightAtten[8];
-uniform highp mat4 glstate_matrix_mvp;
-uniform highp mat4 glstate_matrix_modelview0;
-uniform highp mat4 glstate_matrix_invtrans_modelview0;
-uniform highp vec4 glstate_lightmodel_ambient;
-uniform mediump vec4 _Color;
-out lowp vec4 xlv_COLOR0;
-out highp vec2 xlv_TEXCOORD0;
-void main ()
-{
- highp vec3 tmpvar_1;
- tmpvar_1 = _glesVertex.xyz;
- highp vec3 n_2;
- n_2 = _glesNormal;
- lowp vec4 tmpvar_3;
- highp vec4 tmpvar_4;
- tmpvar_4.w = 1.0;
- tmpvar_4.xyz = tmpvar_1;
- highp vec3 lightColor_5;
- highp vec3 viewN_6;
- highp vec3 viewpos_7;
- highp vec4 tmpvar_8;
- tmpvar_8.w = 1.0;
- tmpvar_8.xyz = tmpvar_1;
- viewpos_7 = (glstate_matrix_modelview0 * tmpvar_8).xyz;
- highp mat3 tmpvar_9;
- tmpvar_9[uint(0)] = glstate_matrix_invtrans_modelview0[uint(0)].xyz;
- tmpvar_9[1u] = glstate_matrix_invtrans_modelview0[1u].xyz;
- tmpvar_9[2u] = glstate_matrix_invtrans_modelview0[2u].xyz;
- viewN_6 = (tmpvar_9 * n_2);
- highp vec3 tmpvar_10;
- tmpvar_10 = (unity_LightPosition[0].xyz - (viewpos_7 * unity_LightPosition[0].w));
- lightColor_5 = (glstate_lightmodel_ambient.xyz + (unity_LightColor[0].xyz * (
- max (0.0, dot (viewN_6, normalize(tmpvar_10)))
- *
- (1.0/((1.0 + (dot (tmpvar_10, tmpvar_10) * unity_LightAtten[0].z))))
- )));
- highp vec3 tmpvar_11;
- tmpvar_11 = (unity_LightPosition[1].xyz - (viewpos_7 * unity_LightPosition[1].w));
- lightColor_5 = (lightColor_5 + (unity_LightColor[1].xyz * (
- max (0.0, dot (viewN_6, normalize(tmpvar_11)))
- *
- (1.0/((1.0 + (dot (tmpvar_11, tmpvar_11) * unity_LightAtten[1].z))))
- )));
- highp vec3 tmpvar_12;
- tmpvar_12 = (unity_LightPosition[2].xyz - (viewpos_7 * unity_LightPosition[2].w));
- lightColor_5 = (lightColor_5 + (unity_LightColor[2].xyz * (
- max (0.0, dot (viewN_6, normalize(tmpvar_12)))
- *
- (1.0/((1.0 + (dot (tmpvar_12, tmpvar_12) * unity_LightAtten[2].z))))
- )));
- highp vec3 tmpvar_13;
- tmpvar_13 = (unity_LightPosition[3].xyz - (viewpos_7 * unity_LightPosition[3].w));
- lightColor_5 = (lightColor_5 + (unity_LightColor[3].xyz * (
- max (0.0, dot (viewN_6, normalize(tmpvar_13)))
- *
- (1.0/((1.0 + (dot (tmpvar_13, tmpvar_13) * unity_LightAtten[3].z))))
- )));
- highp vec4 tmpvar_14;
- tmpvar_14.w = 1.0;
- tmpvar_14.xyz = ((lightColor_5 * _Color.xyz) * 2.0);
- tmpvar_3 = tmpvar_14;
- gl_Position = (glstate_matrix_mvp * tmpvar_4);
- xlv_COLOR0 = tmpvar_3;
- xlv_TEXCOORD0 = _glesMultiTexCoord0.xy;
-}
-
-
-// stats: 56 alu 0 tex 0 flow
-// inputs: 3
-// #0: _glesVertex (high float) 4x1 [-1]
-// #1: _glesNormal (medium float) 3x1 [-1]
-// #2: _glesMultiTexCoord0 (high float) 4x1 [-1]
-// uniforms: 8 (total size: 0)
-// #0: unity_LightColor (medium float) 4x1 [8]
-// #1: unity_LightPosition (high float) 4x1 [8]
-// #2: unity_LightAtten (medium float) 4x1 [8]
-// #3: glstate_matrix_mvp (high float) 4x4 [-1]
-// #4: glstate_matrix_modelview0 (high float) 4x4 [-1]
-// #5: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1]
-// #6: glstate_lightmodel_ambient (high float) 4x1 [-1]
-// #7: _Color (medium float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3Metal.txt
deleted file mode 100644
index d37be6c3720..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/uniforms-arrays-outES3Metal.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 _glesVertex [[attribute(0)]];
- half3 _glesNormal [[attribute(1)]];
- float4 _glesMultiTexCoord0 [[attribute(2)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- half4 xlv_COLOR0;
- float2 xlv_TEXCOORD0;
-};
-struct xlatMtlShaderUniform {
- half4 unity_LightColor[8];
- float4 unity_LightPosition[8];
- half4 unity_LightAtten[8];
- float4x4 glstate_matrix_mvp;
- float4x4 glstate_matrix_modelview0;
- float4x4 glstate_matrix_invtrans_modelview0;
- float4 glstate_lightmodel_ambient;
- half4 _Color;
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float3 tmpvar_1 = 0;
- tmpvar_1 = _mtl_i._glesVertex.xyz;
- float3 n_2 = 0;
- n_2 = float3(_mtl_i._glesNormal);
- half4 tmpvar_3 = 0;
- float4 tmpvar_4 = 0;
- tmpvar_4.w = 1.0;
- tmpvar_4.xyz = tmpvar_1;
- float3 lightColor_5 = 0;
- float3 viewN_6 = 0;
- float3 viewpos_7 = 0;
- float4 tmpvar_8 = 0;
- tmpvar_8.w = 1.0;
- tmpvar_8.xyz = tmpvar_1;
- viewpos_7 = (_mtl_u.glstate_matrix_modelview0 * tmpvar_8).xyz;
- float3x3 tmpvar_9;
- tmpvar_9[0] = _mtl_u.glstate_matrix_invtrans_modelview0[0].xyz;
- tmpvar_9[1] = _mtl_u.glstate_matrix_invtrans_modelview0[1].xyz;
- tmpvar_9[2] = _mtl_u.glstate_matrix_invtrans_modelview0[2].xyz;
- viewN_6 = (tmpvar_9 * n_2);
- float3 tmpvar_10 = 0;
- tmpvar_10 = (_mtl_u.unity_LightPosition[0].xyz - (viewpos_7 * _mtl_u.unity_LightPosition[0].w));
- lightColor_5 = (_mtl_u.glstate_lightmodel_ambient.xyz + ((float3)(_mtl_u.unity_LightColor[0].xyz) * (
- max (0.0, dot (viewN_6, normalize(tmpvar_10)))
- *
- (1.0/((1.0 + (dot (tmpvar_10, tmpvar_10) * (float)(_mtl_u.unity_LightAtten[0].z)))))
- )));
- float3 tmpvar_11 = 0;
- tmpvar_11 = (_mtl_u.unity_LightPosition[1].xyz - (viewpos_7 * _mtl_u.unity_LightPosition[1].w));
- lightColor_5 = (lightColor_5 + ((float3)(_mtl_u.unity_LightColor[1].xyz) * (
- max (0.0, dot (viewN_6, normalize(tmpvar_11)))
- *
- (1.0/((1.0 + (dot (tmpvar_11, tmpvar_11) * (float)(_mtl_u.unity_LightAtten[1].z)))))
- )));
- float3 tmpvar_12 = 0;
- tmpvar_12 = (_mtl_u.unity_LightPosition[2].xyz - (viewpos_7 * _mtl_u.unity_LightPosition[2].w));
- lightColor_5 = (lightColor_5 + ((float3)(_mtl_u.unity_LightColor[2].xyz) * (
- max (0.0, dot (viewN_6, normalize(tmpvar_12)))
- *
- (1.0/((1.0 + (dot (tmpvar_12, tmpvar_12) * (float)(_mtl_u.unity_LightAtten[2].z)))))
- )));
- float3 tmpvar_13 = 0;
- tmpvar_13 = (_mtl_u.unity_LightPosition[3].xyz - (viewpos_7 * _mtl_u.unity_LightPosition[3].w));
- lightColor_5 = (lightColor_5 + ((float3)(_mtl_u.unity_LightColor[3].xyz) * (
- max (0.0, dot (viewN_6, normalize(tmpvar_13)))
- *
- (1.0/((1.0 + (dot (tmpvar_13, tmpvar_13) * (float)(_mtl_u.unity_LightAtten[3].z)))))
- )));
- float4 tmpvar_14 = 0;
- tmpvar_14.w = 1.0;
- tmpvar_14.xyz = ((lightColor_5 * (float3)(_mtl_u._Color.xyz)) * 2.0);
- tmpvar_3 = half4(tmpvar_14);
- _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * tmpvar_4);
- _mtl_o.xlv_COLOR0 = tmpvar_3;
- _mtl_o.xlv_TEXCOORD0 = _mtl_i._glesMultiTexCoord0.xy;
- return _mtl_o;
-}
-
-
-// stats: 56 alu 0 tex 0 flow
-// inputs: 3
-// #0: _glesVertex (high float) 4x1 [-1] loc 0
-// #1: _glesNormal (medium float) 3x1 [-1] loc 1
-// #2: _glesMultiTexCoord0 (high float) 4x1 [-1] loc 2
-// uniforms: 8 (total size: 472)
-// #0: unity_LightColor (medium float) 4x1 [8] loc 0
-// #1: unity_LightPosition (high float) 4x1 [8] loc 64
-// #2: unity_LightAtten (medium float) 4x1 [8] loc 192
-// #3: glstate_matrix_mvp (high float) 4x4 [-1] loc 256
-// #4: glstate_matrix_modelview0 (high float) 4x4 [-1] loc 320
-// #5: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1] loc 384
-// #6: glstate_lightmodel_ambient (high float) 4x1 [-1] loc 448
-// #7: _Color (medium float) 4x1 [-1] loc 464
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-in.txt
deleted file mode 100644
index 5804c598511..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-in.txt
+++ /dev/null
@@ -1,187 +0,0 @@
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return texture2DLod( s, coord.xy, coord.w);
-}
-mat3 xll_transpose_mf3x3(mat3 m) {
- 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]);
-}
-mat3 xll_constructMat3_mf4x4( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct Lamp {
- vec4 posRange;
- vec4 colorImp;
- vec4 spotParam;
-};
-struct v2f {
- vec4 pos;
- vec3 hybridDir;
- vec3 hybridCol;
- vec3 ambient;
- vec2 uv;
-};
-struct HybridAppData {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 bakedCol;
- vec2 bakedDir;
-};
-uniform vec3 _WorldSpaceCameraPos;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-
-uniform vec3 _Tonemap_blackLevel;
-uniform vec3 _Tonemap_toeLength;
-uniform vec3 _Tonemap_heel;
-uniform vec3 _Tonemap_shoulder;
-uniform vec3 _Tonemap_colorScale1;
-uniform vec3 _Tonemap_colorScale2;
-uniform vec3 _HybridSunDir;
-uniform vec4 _HybridSunCol;
-uniform vec3 GridLightTextureStartCell;
-uniform vec3 GridLightTextureCellSize;
-uniform sampler2D GridLightTexture;
-uniform vec4 IngameGridLimit;
-uniform vec4 LightPos[30];
-uniform vec4 LightCol[30];
-uniform vec4 _MainTex_ST;
-float Luma( in vec3 c ) {
- return dot( c, vec3( 0.22, 0.707, 0.071));
-}
-void CalcDynamicLight( in vec3 worldVert, in vec3 worldNorm, in Lamp lamp[4], inout vec3 hybridDir, inout vec3 hybridCol )
-{
- vec3 lAgg = vec3( 0.0);
- float wAgg = 0.001;
- vec4 atten;
- int i = 0;
- for ( ; (i < 4); (i++)) {
- vec3 lightToVert = (lamp[i].posRange.xyz - worldVert);
- float lengthSq = dot( lightToVert, lightToVert);
- vec3 lightToVertNorm = (lightToVert * inversesqrt(lengthSq));
- atten[i] = max( (1.0 - ((lengthSq * lamp[i].posRange.w) * 0.8)), 0.0);
- atten[i] *= atten[i];
- float nDotL = max( dot( lightToVertNorm, worldNorm), 0.05);
- float weight = ((atten[i] * lamp[i].colorImp.w) * nDotL);
- lAgg += (weight * lightToVertNorm);
- wAgg += weight;
- }
- float w = (Luma( hybridCol) * 2.0);
- lAgg += (hybridDir * w);
- wAgg += w;
- hybridDir = (lAgg / wAgg);
- int j = 0;
- for ( ; (j < 4); (j++)) {
- vec3 lightToVertNorm_1 = normalize((lamp[j].posRange.xyz - worldVert));
- hybridCol += (lamp[j].colorImp.xyz * atten[j]);
- }
-}
-ivec4 GetLightIdxFromGrid( in vec3 worldVert )
-{
- vec2 pos = ((worldVert - GridLightTextureStartCell) * GridLightTextureCellSize).xz;
- pos = clamp( pos, IngameGridLimit.xy, IngameGridLimit.zw);
- return ivec4((xll_tex2Dlod( GridLightTexture, vec4( pos.x, pos.y, 0.0, 0.0)) * 255.0));
-}
-vec3 DecodeBakedCol( in vec3 bakedCol )
-{
- vec3 c = (bakedCol * 3.0);
- return (c * c);
-}
-vec3 DecodeNormal( in vec2 enc )
-{
- vec4 nn = ((enc.xyxy * vec4( 2.0, 2.0, 0.0, 0.0)) + vec4( -1.0, -1.0, 1.01, -1.0));
- float l = dot( nn.xyz, (-nn.xyw));
- nn.z = l;
- nn.xy *= sqrt(l);
- return ((nn.xyz * 2.0) + vec3( 0.0, 0.0, -1.0));
-}
-void DecodeBaking( in vec4 bakedColor, in vec2 bakedDir, out vec3 hybridCol, out vec3 hybridDir )
-{
- hybridDir = (DecodeNormal( bakedDir) * (bakedColor.w * 2.0));
- hybridCol = DecodeBakedCol( bakedColor.xyz);
-}
-void LoadBakedLight( in vec3 worldVert, in vec3 worldNorm, in vec4 bakedColor, in vec2 bakedDir, out vec3 hybridCol, out vec3 hybridDir )
-{
- DecodeBaking( bakedColor, bakedDir, hybridCol, hybridDir);
-}
-void ReadLightArray3( in ivec4 lightIdx, out Lamp l0, out Lamp l1, out Lamp l2, out Lamp l3 )
-{
- l0.posRange = LightPos[lightIdx.x];
- l0.colorImp = LightCol[lightIdx.x];
- l0.spotParam = vec4( 0.0, 0.0, 0.0, 1.0);
- l1.posRange = LightPos[lightIdx.y];
- l1.colorImp = LightCol[lightIdx.y];
- l1.spotParam = vec4( 0.0, 0.0, 0.0, 1.0);
- l2.posRange = LightPos[lightIdx.z];
- l2.colorImp = LightCol[lightIdx.z];
- l2.spotParam = vec4( 0.0, 0.0, 0.0, 1.0);
- l3.posRange = LightPos[lightIdx.w];
- l3.colorImp = LightCol[lightIdx.w];
- l3.spotParam = vec4( 0.0, 0.0, 0.0, 1.0);
-}
-vec3 JimTonemapping( in vec3 x )
-{
- x = max( (x - (_Tonemap_blackLevel * 0.25)), vec3( 0.0, 0.0, 0.0));
- x = ((x * ((_Tonemap_colorScale1 * x) + _Tonemap_heel)) / ((x * ((_Tonemap_colorScale2 * x) + _Tonemap_shoulder)) + _Tonemap_toeLength));
- return x;
-}
-vec3 NichTonemap( in vec3 x )
-{
- return (JimTonemapping( (x * 0.25)) * 4.0);
- float total = (length(x) + 0.0001);
- vec3 norm = (x / total);
- float tonemapped = (JimTonemapping( vec3( 0.0, (total * 0.25), 0.0)).y * 4.0);
- return (norm * tonemapped);
-}
-vec3 VertexTonemap( in vec3 x )
-{
- return NichTonemap( x);
-}
-void DoCalcHybridLight2( in vec3 worldVert, in vec3 worldNorm, out vec3 hybridDir, out vec3 hybridCol, out vec3 ambient, in vec4 bakedColor, in vec2 bakedDir )
-{
- LoadBakedLight( worldVert, worldNorm, bakedColor, bakedDir, hybridCol, hybridDir);
- ivec4 lightIdx = GetLightIdxFromGrid( worldVert);
- Lamp l[4];
- ReadLightArray3( lightIdx, l[0], l[1], l[2], l[3]);
- CalcDynamicLight( worldVert, worldNorm, l, hybridDir, hybridCol);
- hybridCol = VertexTonemap( hybridCol);
- ambient = VertexTonemap( (_HybridSunCol.xyz * dot( worldNorm, _HybridSunDir)));
-}
-v2f vert (in HybridAppData v)
-{
- v2f o;
- o.pos = (gl_ModelViewProjectionMatrix * v.vertex);
- o.uv = ((v.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- vec3 worldVert = (_Object2World * v.vertex).xyz;
- vec3 worldNorm = normalize((xll_constructMat3_mf4x4( _Object2World) * v.normal.xyz));
- DoCalcHybridLight2( worldVert, worldNorm, o.hybridDir, o.hybridCol, o.ambient, v.bakedCol, v.bakedDir);
- vec3 eyeToVert = normalize((_WorldSpaceCameraPos.xyz - worldVert));
- vec3 binormal = (cross( v.normal, v.tangent.xyz) * v.tangent.w);
- mat3 rotation = xll_transpose_mf3x3(mat3( v.tangent.xyz, binormal, v.normal));
- o.hybridDir = (rotation * (xll_constructMat3_mf4x4( _World2Object) * o.hybridDir));
- return o;
-}
-attribute vec4 TANGENT;
-varying vec3 xlv_TEXCOORD0;
-varying vec3 xlv_TEXCOORD1;
-varying vec3 xlv_COLOR;
-varying vec2 xlv_TEXCOORD2;
-void main()
-{
- v2f xl_retval;
- HybridAppData xlt_v;
- xlt_v.vertex = vec4(gl_Vertex);
- xlt_v.tangent = vec4(TANGENT);
- xlt_v.normal = vec3(gl_Normal);
- xlt_v.texcoord = vec4(gl_MultiTexCoord0);
- xlt_v.bakedCol = vec4(gl_Color);
- xlt_v.bakedDir = vec2(gl_MultiTexCoord1);
- xl_retval = vert( xlt_v);
- gl_Position = vec4(xl_retval.pos);
- xlv_TEXCOORD0 = vec3(xl_retval.hybridDir);
- xlv_TEXCOORD1 = vec3(xl_retval.hybridCol);
- xlv_COLOR = vec3(xl_retval.ambient);
- xlv_TEXCOORD2 = vec2(xl_retval.uv);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-out.txt
deleted file mode 100644
index d8342846f0c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLight-out.txt
+++ /dev/null
@@ -1,227 +0,0 @@
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _Tonemap_blackLevel;
-uniform vec3 _Tonemap_toeLength;
-uniform vec3 _Tonemap_heel;
-uniform vec3 _Tonemap_shoulder;
-uniform vec3 _Tonemap_colorScale1;
-uniform vec3 _Tonemap_colorScale2;
-uniform vec3 _HybridSunDir;
-uniform vec4 _HybridSunCol;
-uniform vec3 GridLightTextureStartCell;
-uniform vec3 GridLightTextureCellSize;
-uniform sampler2D GridLightTexture;
-uniform vec4 IngameGridLimit;
-uniform vec4 LightPos[30];
-uniform vec4 LightCol[30];
-uniform vec4 _MainTex_ST;
-attribute vec4 TANGENT;
-varying vec3 xlv_TEXCOORD0;
-varying vec3 xlv_TEXCOORD1;
-varying vec3 xlv_COLOR;
-varying vec2 xlv_TEXCOORD2;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = (_Object2World * gl_Vertex).xyz;
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- vec3 tmpvar_3;
- tmpvar_3 = normalize((tmpvar_2 * gl_Normal));
- vec4 nn_4;
- vec4 tmpvar_5;
- tmpvar_5 = ((gl_MultiTexCoord1.xyxy * vec4(2.0, 2.0, 0.0, 0.0)) + vec4(-1.0, -1.0, 1.01, -1.0));
- nn_4.w = tmpvar_5.w;
- float tmpvar_6;
- tmpvar_6 = dot (tmpvar_5.xyz, -(tmpvar_5.xyw));
- nn_4.z = tmpvar_6;
- nn_4.xy = (tmpvar_5.xy * sqrt(tmpvar_6));
- vec3 tmpvar_7;
- vec3 tmpvar_8;
- tmpvar_8 = (gl_Color.xyz * 3.0);
- tmpvar_7 = (tmpvar_8 * tmpvar_8);
- ivec4 tmpvar_9;
- tmpvar_9 = ivec4((texture2DLod (GridLightTexture, clamp (
- ((tmpvar_1 - GridLightTextureStartCell) * GridLightTextureCellSize)
- .xz, IngameGridLimit.xy, IngameGridLimit.zw), 0.0) * 255.0));
- vec4 tmpvar_10;
- vec4 tmpvar_11;
- vec4 tmpvar_12;
- vec4 tmpvar_13;
- vec4 tmpvar_14;
- vec4 tmpvar_15;
- vec4 tmpvar_16;
- vec4 tmpvar_17;
- tmpvar_10 = LightPos[tmpvar_9.x];
- tmpvar_11 = LightCol[tmpvar_9.x];
- tmpvar_12 = LightPos[tmpvar_9.y];
- tmpvar_13 = LightCol[tmpvar_9.y];
- tmpvar_14 = LightPos[tmpvar_9.z];
- tmpvar_15 = LightCol[tmpvar_9.z];
- tmpvar_16 = LightPos[tmpvar_9.w];
- tmpvar_17 = LightCol[tmpvar_9.w];
- vec3 hybridCol_18;
- vec4 atten_19;
- float wAgg_20;
- vec3 lAgg_21;
- vec3 tmpvar_22;
- tmpvar_22 = (tmpvar_10.xyz - tmpvar_1);
- float tmpvar_23;
- tmpvar_23 = dot (tmpvar_22, tmpvar_22);
- vec3 tmpvar_24;
- tmpvar_24 = (tmpvar_22 * inversesqrt(tmpvar_23));
- vec4 tmpvar_25;
- tmpvar_25.yzw = atten_19.yzw;
- tmpvar_25.x = max ((1.0 - (
- (tmpvar_23 * tmpvar_10.w)
- * 0.8)), 0.0);
- vec4 tmpvar_26;
- tmpvar_26.yzw = tmpvar_25.yzw;
- tmpvar_26.x = (tmpvar_25.x * tmpvar_25.x);
- float tmpvar_27;
- tmpvar_27 = ((tmpvar_26.x * tmpvar_11.w) * max (dot (tmpvar_24, tmpvar_3), 0.05));
- lAgg_21 = (tmpvar_27 * tmpvar_24);
- wAgg_20 = (0.001 + tmpvar_27);
- vec3 tmpvar_28;
- tmpvar_28 = (tmpvar_12.xyz - tmpvar_1);
- float tmpvar_29;
- tmpvar_29 = dot (tmpvar_28, tmpvar_28);
- vec3 tmpvar_30;
- tmpvar_30 = (tmpvar_28 * inversesqrt(tmpvar_29));
- vec4 tmpvar_31;
- tmpvar_31.xzw = tmpvar_26.xzw;
- tmpvar_31.y = max ((1.0 - (
- (tmpvar_29 * tmpvar_12.w)
- * 0.8)), 0.0);
- vec4 tmpvar_32;
- tmpvar_32.xzw = tmpvar_31.xzw;
- tmpvar_32.y = (tmpvar_31.y * tmpvar_31.y);
- float tmpvar_33;
- tmpvar_33 = ((tmpvar_32.y * tmpvar_13.w) * max (dot (tmpvar_30, tmpvar_3), 0.05));
- lAgg_21 = (lAgg_21 + (tmpvar_33 * tmpvar_30));
- wAgg_20 = (wAgg_20 + tmpvar_33);
- vec3 tmpvar_34;
- tmpvar_34 = (tmpvar_14.xyz - tmpvar_1);
- float tmpvar_35;
- tmpvar_35 = dot (tmpvar_34, tmpvar_34);
- vec3 tmpvar_36;
- tmpvar_36 = (tmpvar_34 * inversesqrt(tmpvar_35));
- vec4 tmpvar_37;
- tmpvar_37.xyw = tmpvar_32.xyw;
- tmpvar_37.z = max ((1.0 - (
- (tmpvar_35 * tmpvar_14.w)
- * 0.8)), 0.0);
- vec4 tmpvar_38;
- tmpvar_38.xyw = tmpvar_37.xyw;
- tmpvar_38.z = (tmpvar_37.z * tmpvar_37.z);
- float tmpvar_39;
- tmpvar_39 = ((tmpvar_38.z * tmpvar_15.w) * max (dot (tmpvar_36, tmpvar_3), 0.05));
- lAgg_21 = (lAgg_21 + (tmpvar_39 * tmpvar_36));
- wAgg_20 = (wAgg_20 + tmpvar_39);
- vec3 tmpvar_40;
- tmpvar_40 = (tmpvar_16.xyz - tmpvar_1);
- float tmpvar_41;
- tmpvar_41 = dot (tmpvar_40, tmpvar_40);
- vec3 tmpvar_42;
- tmpvar_42 = (tmpvar_40 * inversesqrt(tmpvar_41));
- vec4 tmpvar_43;
- tmpvar_43.xyz = tmpvar_38.xyz;
- tmpvar_43.w = max ((1.0 - (
- (tmpvar_41 * tmpvar_16.w)
- * 0.8)), 0.0);
- vec4 tmpvar_44;
- tmpvar_44.xyz = tmpvar_43.xyz;
- tmpvar_44.w = (tmpvar_43.w * tmpvar_43.w);
- atten_19 = tmpvar_44;
- float tmpvar_45;
- tmpvar_45 = ((tmpvar_44.w * tmpvar_17.w) * max (dot (tmpvar_42, tmpvar_3), 0.05));
- lAgg_21 = (lAgg_21 + (tmpvar_45 * tmpvar_42));
- wAgg_20 = (wAgg_20 + tmpvar_45);
- float tmpvar_46;
- tmpvar_46 = (dot (tmpvar_7, vec3(0.22, 0.707, 0.071)) * 2.0);
- lAgg_21 = (lAgg_21 + ((
- ((nn_4.xyz * 2.0) + vec3(0.0, 0.0, -1.0))
- *
- (gl_Color.w * 2.0)
- ) * tmpvar_46));
- wAgg_20 = (wAgg_20 + tmpvar_46);
- hybridCol_18 = (tmpvar_7 + (tmpvar_11.xyz * tmpvar_26.x));
- hybridCol_18 = (hybridCol_18 + (tmpvar_13.xyz * tmpvar_32.y));
- hybridCol_18 = (hybridCol_18 + (tmpvar_15.xyz * tmpvar_38.z));
- hybridCol_18 = (hybridCol_18 + (tmpvar_17.xyz * tmpvar_44.w));
- vec3 x_47;
- x_47 = (hybridCol_18 * 0.25);
- vec3 tmpvar_48;
- vec3 tmpvar_49;
- tmpvar_49 = (_Tonemap_blackLevel * 0.25);
- tmpvar_48 = max ((x_47 - tmpvar_49), vec3(0.0, 0.0, 0.0));
- x_47 = ((tmpvar_48 * (
- (_Tonemap_colorScale1 * tmpvar_48)
- + _Tonemap_heel)) / ((tmpvar_48 *
- ((_Tonemap_colorScale2 * tmpvar_48) + _Tonemap_shoulder)
- ) + _Tonemap_toeLength));
- vec3 x_50;
- x_50 = ((_HybridSunCol.xyz * dot (tmpvar_3, _HybridSunDir)) * 0.25);
- vec3 tmpvar_51;
- tmpvar_51 = max ((x_50 - tmpvar_49), vec3(0.0, 0.0, 0.0));
- x_50 = ((tmpvar_51 * (
- (_Tonemap_colorScale1 * tmpvar_51)
- + _Tonemap_heel)) / ((tmpvar_51 *
- ((_Tonemap_colorScale2 * tmpvar_51) + _Tonemap_shoulder)
- ) + _Tonemap_toeLength));
- vec3 tmpvar_52;
- vec3 tmpvar_53;
- tmpvar_52 = TANGENT.xyz;
- tmpvar_53 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_54;
- tmpvar_54[0].x = tmpvar_52.x;
- tmpvar_54[0].y = tmpvar_53.x;
- tmpvar_54[0].z = gl_Normal.x;
- tmpvar_54[1].x = tmpvar_52.y;
- tmpvar_54[1].y = tmpvar_53.y;
- tmpvar_54[1].z = gl_Normal.y;
- tmpvar_54[2].x = tmpvar_52.z;
- tmpvar_54[2].y = tmpvar_53.z;
- tmpvar_54[2].z = gl_Normal.z;
- mat3 tmpvar_55;
- tmpvar_55[0] = _World2Object[0].xyz;
- tmpvar_55[1] = _World2Object[1].xyz;
- tmpvar_55[2] = _World2Object[2].xyz;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- xlv_TEXCOORD0 = (tmpvar_54 * (tmpvar_55 * (lAgg_21 / wAgg_20)));
- xlv_TEXCOORD1 = (x_47 * 4.0);
- xlv_COLOR = (x_50 * 4.0);
- xlv_TEXCOORD2 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
-}
-
-
-// stats: 133 alu 1 tex 0 flow
-// inputs: 6
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Color (high float) 4x1 [-1] loc 3
-// #3: gl_Normal (high float) 3x1 [-1] loc 2
-// #4: gl_Vertex (high float) 4x1 [-1] loc 0
-// #5: TANGENT (high float) 4x1 [-1]
-// uniforms: 17 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _Object2World (high float) 4x4 [-1]
-// #2: _World2Object (high float) 4x4 [-1]
-// #3: _Tonemap_blackLevel (high float) 3x1 [-1]
-// #4: _Tonemap_toeLength (high float) 3x1 [-1]
-// #5: _Tonemap_heel (high float) 3x1 [-1]
-// #6: _Tonemap_shoulder (high float) 3x1 [-1]
-// #7: _Tonemap_colorScale1 (high float) 3x1 [-1]
-// #8: _Tonemap_colorScale2 (high float) 3x1 [-1]
-// #9: _HybridSunDir (high float) 3x1 [-1]
-// #10: _HybridSunCol (high float) 4x1 [-1]
-// #11: GridLightTextureStartCell (high float) 3x1 [-1]
-// #12: GridLightTextureCellSize (high float) 3x1 [-1]
-// #13: IngameGridLimit (high float) 4x1 [-1]
-// #14: LightPos (high float) 4x1 [30]
-// #15: LightCol (high float) 4x1 [30]
-// #16: _MainTex_ST (high float) 4x1 [-1]
-// textures: 1
-// #0: GridLightTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-in.txt
deleted file mode 100644
index 878b0ec91fc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-in.txt
+++ /dev/null
@@ -1,121 +0,0 @@
-// stripped down version of Nicholas' Static Sky
-// hybrid lighting shader that exposed vector_insert_todo
-// bug
-
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return texture2DLod( s, coord.xy, coord.w);
-}
-mat3 xll_constructMat3_mf4x4( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct Lamp {
- vec4 posRange;
- vec4 colorImp;
-};
-struct v2f {
- vec4 pos;
- vec3 diffuse;
-};
-struct HybridAppData {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 bakedCol;
- vec2 bakedDir;
-};
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _ProjectionParams;
-uniform vec4 _ScreenParams;
-uniform vec4 _ZBufferParams;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-
-
-
-uniform float _RenderExposure;
-uniform vec2 _DynLampInfo_bufferSize;
-uniform sampler2D _DynLampInfo;
-uniform float LightVertOffset;
-uniform sampler2D LightVertTexture;
-uniform vec4 LightVertTextureSize;
-void CalcDynamicLight( in vec3 worldVert, in vec3 worldNorm, in Lamp lamp[4], inout vec3 hybridDir, inout vec3 hybridCol ) {
- vec4 atten;
- int i = 0;
- for ( ; (i < 4); (i++)) {
-
- vec3 lightToVert = (lamp[i].posRange.xyz - worldVert);
- float lengthSq = dot( lightToVert, lightToVert);
- vec3 lightToVertNorm = (lightToVert * inversesqrt(lengthSq));
-
- atten[i] = (lengthSq * lamp[i].posRange.w);
- float nDotL = dot( lightToVertNorm, worldNorm);
- float weight = (atten[i] * nDotL);
- }
-
- int j = 0;
- for ( ; (j < 4); (j++)) {
- hybridCol += (lamp[j].colorImp.xyz * atten[j]);
- }
-}
-void LoadBakedLight( out vec3 hybridCol, out vec3 hybridDir ) {
-}
-vec4 DoSampleGPUBuffer( in sampler2D buffer, in vec2 coord, in vec2 dimensions ) {
- return xll_tex2Dlod( buffer, vec4( (coord / dimensions), 0.0, 0.0));
-}
-void ReadLightArray3( in ivec4 lightIdx, out Lamp l0, out Lamp l1, out Lamp l2, out Lamp l3 ) {
-
- l0.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 1.0), _DynLampInfo_bufferSize);
- l0.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 2.0), _DynLampInfo_bufferSize);
- l1.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 1.0), _DynLampInfo_bufferSize);
-
- l1.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 2.0), _DynLampInfo_bufferSize);
- l2.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 1.0), _DynLampInfo_bufferSize);
- l2.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 2.0), _DynLampInfo_bufferSize);
-
- l3.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 1.0), _DynLampInfo_bufferSize);
- l3.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 2.0), _DynLampInfo_bufferSize);
-}
-void DoCalcHybridLight2( in vec3 worldVert, in vec3 worldNorm, out vec3 hybridCol, in vec4 bakedColor, in vec2 bakedDir ) {
- vec3 hybridDir;
- LoadBakedLight( hybridCol, hybridDir);
-
- ivec4 lightIdx = ivec4( int(worldVert.x), int(worldVert.y), int(worldVert.z), int((-worldVert.x)));
- Lamp l[4];
- ReadLightArray3( lightIdx, l[0], l[1], l[2], l[3]);
-
- CalcDynamicLight( worldVert, worldNorm, l, hybridDir, hybridCol);
-}
-vec3 CalcDiffuseHybridLight( in vec3 worldVert, in vec3 worldNorm, in vec4 bakedColor, in vec2 bakedDir ) {
- vec3 hybridCol;
- DoCalcHybridLight2( worldVert, worldNorm, hybridCol, bakedColor, bakedDir);
-
- return hybridCol;
-}
-v2f vert( in HybridAppData v ) {
- v2f o;
-
- vec3 worldVert = (_Object2World * v.vertex).xyz;
- vec3 worldNorm = normalize((xll_constructMat3_mf4x4( _Object2World) * v.normal.xyz));
- o.diffuse = CalcDiffuseHybridLight( worldVert, worldNorm, v.bakedCol, v.bakedDir);
-
- o.pos = (gl_ModelViewProjectionMatrix * v.vertex);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec3 xlv_TEXCOORD2;
-void main() {
- v2f xl_retval;
- HybridAppData xlt_v;
- xlt_v.vertex = vec4(gl_Vertex);
- xlt_v.tangent = vec4(TANGENT);
- xlt_v.normal = vec3(gl_Normal);
- xlt_v.texcoord = vec4(gl_MultiTexCoord0);
- xlt_v.bakedCol = vec4(gl_Color);
- xlt_v.bakedDir = vec2(gl_MultiTexCoord1);
- xl_retval = vert( xlt_v);
- gl_Position = vec4(xl_retval.pos);
- xlv_TEXCOORD2 = vec3(xl_retval.diffuse);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES.txt
deleted file mode 100644
index 644f5c9d6e2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES.txt
+++ /dev/null
@@ -1,139 +0,0 @@
-// stripped down version of Nicholas' Static Sky
-// hybrid lighting shader that exposed vector_insert_todo
-// bug
-
-#define gl_Vertex _glesVertex
-attribute vec4 _glesVertex;
-#define gl_Color _glesColor
-attribute vec4 _glesColor;
-#define gl_Normal _glesNormal
-attribute vec3 _glesNormal;
-#define gl_MultiTexCoord0 _glesMultiTexCoord0
-attribute vec4 _glesMultiTexCoord0;
-#define gl_MultiTexCoord1 _glesMultiTexCoord1
-attribute vec4 _glesMultiTexCoord1;
-#define TANGENT _glesTANGENT
-attribute vec4 _glesTANGENT;
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return texture2DLod( s, coord.xy, coord.w);
-}
-mat3 xll_constructMat3_mf4x4( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct Lamp {
- mediump vec4 posRange;
- mediump vec4 colorImp;
-};
-struct v2f {
- highp vec4 pos;
- mediump vec3 diffuse;
-};
-struct HybridAppData {
- highp vec4 vertex;
- highp vec4 tangent;
- highp vec3 normal;
- highp vec4 texcoord;
- lowp vec4 bakedCol;
- mediump vec2 bakedDir;
-};
-uniform highp vec4 _Time;
-uniform highp vec4 _SinTime;
-uniform highp vec4 _CosTime;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp vec4 _ProjectionParams;
-uniform highp vec4 _ScreenParams;
-uniform highp vec4 _ZBufferParams;
-uniform highp vec4 _WorldSpaceLightPos0;
-uniform highp vec4 _LightPositionRange;
-uniform highp mat4 glstate_matrix_mvp;
-uniform highp mat4 glstate_matrix_modelview0;
-uniform highp mat4 glstate_matrix_invtrans_modelview0;
-uniform highp mat4 _Object2World;
-uniform highp mat4 _World2Object;
-uniform highp mat4 glstate_matrix_transpose_modelview0;
-uniform highp mat4 glstate_matrix_projection;
-uniform lowp vec4 glstate_lightmodel_ambient;
-uniform highp float _RenderExposure;
-uniform mediump vec2 _DynLampInfo_bufferSize;
-uniform sampler2D _DynLampInfo;
-uniform highp float LightVertOffset;
-uniform sampler2D LightVertTexture;
-uniform highp vec4 LightVertTextureSize;
-void CalcDynamicLight( in highp vec3 worldVert, in highp vec3 worldNorm, in Lamp lamp[4], inout mediump vec3 hybridDir, inout mediump vec3 hybridCol ) {
- mediump vec4 atten;
- highp int i = 0;
- for ( ; (i < 4); (i++)) {
-
- highp vec3 lightToVert = (lamp[i].posRange.xyz - worldVert);
- highp float lengthSq = dot( lightToVert, lightToVert);
- highp vec3 lightToVertNorm = (lightToVert * inversesqrt(lengthSq));
-
- atten[i] = (lengthSq * lamp[i].posRange.w);
- mediump float nDotL = dot( lightToVertNorm, worldNorm);
- mediump float weight = (atten[i] * nDotL);
- }
-
- highp int j = 0;
- for ( ; (j < 4); (j++)) {
- hybridCol += (lamp[j].colorImp.xyz * atten[j]);
- }
-}
-void LoadBakedLight( out mediump vec3 hybridCol, out mediump vec3 hybridDir ) {
-}
-mediump vec4 DoSampleGPUBuffer( in sampler2D buffer, in mediump vec2 coord, in mediump vec2 dimensions ) {
- return xll_tex2Dlod( buffer, vec4( (coord / dimensions), 0.0, 0.0));
-}
-void ReadLightArray3( in highp ivec4 lightIdx, out Lamp l0, out Lamp l1, out Lamp l2, out Lamp l3 ) {
-
- l0.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 1.0), _DynLampInfo_bufferSize);
- l0.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 2.0), _DynLampInfo_bufferSize);
- l1.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 1.0), _DynLampInfo_bufferSize);
-
- l1.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 2.0), _DynLampInfo_bufferSize);
- l2.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 1.0), _DynLampInfo_bufferSize);
- l2.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 2.0), _DynLampInfo_bufferSize);
-
- l3.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 1.0), _DynLampInfo_bufferSize);
- l3.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 2.0), _DynLampInfo_bufferSize);
-}
-void DoCalcHybridLight2( in highp vec3 worldVert, in highp vec3 worldNorm, out mediump vec3 hybridCol, in lowp vec4 bakedColor, in mediump vec2 bakedDir ) {
- mediump vec3 hybridDir;
- LoadBakedLight( hybridCol, hybridDir);
-
- highp ivec4 lightIdx = ivec4( int(worldVert.x), int(worldVert.y), int(worldVert.z), int((-worldVert.x)));
- Lamp l[4];
- ReadLightArray3( lightIdx, l[0], l[1], l[2], l[3]);
-
- CalcDynamicLight( worldVert, worldNorm, l, hybridDir, hybridCol);
-}
-highp vec3 CalcDiffuseHybridLight( in highp vec3 worldVert, in highp vec3 worldNorm, in mediump vec4 bakedColor, in mediump vec2 bakedDir ) {
- mediump vec3 hybridCol;
- DoCalcHybridLight2( worldVert, worldNorm, hybridCol, bakedColor, bakedDir);
-
- return hybridCol;
-}
-v2f vert( in HybridAppData v ) {
- v2f o;
-
- highp vec3 worldVert = (_Object2World * v.vertex).xyz;
- highp vec3 worldNorm = normalize((xll_constructMat3_mf4x4( _Object2World) * v.normal.xyz));
- o.diffuse = CalcDiffuseHybridLight( worldVert, worldNorm, v.bakedCol, v.bakedDir);
-
- o.pos = (glstate_matrix_mvp * v.vertex);
- return o;
-}
-
-varying mediump vec3 xlv_TEXCOORD2;
-void main() {
- v2f xl_retval;
- HybridAppData xlt_v;
- xlt_v.vertex = vec4(gl_Vertex);
- xlt_v.tangent = vec4(TANGENT);
- xlt_v.normal = vec3(gl_Normal);
- xlt_v.texcoord = vec4(gl_MultiTexCoord0);
- xlt_v.bakedCol = vec4(gl_Color);
- xlt_v.bakedDir = vec2(gl_MultiTexCoord1);
- xl_retval = vert( xlt_v);
- gl_Position = vec4(xl_retval.pos);
- xlv_TEXCOORD2 = vec3(xl_retval.diffuse);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES3.txt
deleted file mode 100644
index 4ae8b08d92e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-inES3.txt
+++ /dev/null
@@ -1,134 +0,0 @@
-#version 300 es
-
-// stripped down version of Nicholas' Static Sky
-// hybrid lighting shader that exposed vector_insert_todo
-// bug
-
-#define gl_Vertex _glesVertex
-in vec4 _glesVertex;
-#define gl_Color _glesColor
-in vec4 _glesColor;
-#define gl_Normal _glesNormal
-in vec3 _glesNormal;
-#define gl_MultiTexCoord0 _glesMultiTexCoord0
-in vec4 _glesMultiTexCoord0;
-#define gl_MultiTexCoord1 _glesMultiTexCoord1
-in vec4 _glesMultiTexCoord1;
-#define TANGENT _glesTANGENT
-in vec4 _glesTANGENT;
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return textureLod( s, coord.xy, coord.w);
-}
-struct Lamp {
- mediump vec4 posRange;
- mediump vec4 colorImp;
-};
-struct v2f {
- highp vec4 pos;
- mediump vec3 diffuse;
-};
-struct HybridAppData {
- highp vec4 vertex;
- highp vec4 tangent;
- highp vec3 normal;
- highp vec4 texcoord;
- lowp vec4 bakedCol;
- mediump vec2 bakedDir;
-};
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp vec4 _ProjectionParams;
-uniform highp vec4 _ScreenParams;
-uniform highp vec4 _ZBufferParams;
-uniform highp vec4 _WorldSpaceLightPos0;
-uniform highp mat4 glstate_matrix_mvp;
-uniform highp mat4 glstate_matrix_modelview0;
-uniform highp mat4 glstate_matrix_invtrans_modelview0;
-uniform highp mat4 _Object2World;
-uniform highp mat4 _World2Object;
-uniform highp mat4 glstate_matrix_transpose_modelview0;
-uniform highp mat4 glstate_matrix_projection;
-uniform lowp vec4 glstate_lightmodel_ambient;
-uniform highp float _RenderExposure;
-uniform mediump vec2 _DynLampInfo_bufferSize;
-uniform sampler2D _DynLampInfo;
-uniform highp float LightVertOffset;
-uniform sampler2D LightVertTexture;
-uniform highp vec4 LightVertTextureSize;
-void CalcDynamicLight( in highp vec3 worldVert, in highp vec3 worldNorm, in Lamp lamp[4], inout mediump vec3 hybridDir, inout mediump vec3 hybridCol ) {
- mediump vec4 atten;
- highp int i = 0;
- for ( ; (i < 4); (i++)) {
-
- highp vec3 lightToVert = (lamp[i].posRange.xyz - worldVert);
- highp float lengthSq = dot( lightToVert, lightToVert);
- highp vec3 lightToVertNorm = (lightToVert * inversesqrt(lengthSq));
-
- atten[i] = (lengthSq * lamp[i].posRange.w);
- mediump float nDotL = dot( lightToVertNorm, worldNorm);
- mediump float weight = (atten[i] * nDotL);
- }
-
- highp int j = 0;
- for ( ; (j < 4); (j++)) {
- hybridCol += (lamp[j].colorImp.xyz * atten[j]);
- }
-}
-void LoadBakedLight( out mediump vec3 hybridCol, out mediump vec3 hybridDir ) {
-}
-mediump vec4 DoSampleGPUBuffer( in sampler2D buffer, in mediump vec2 coord, in mediump vec2 dimensions ) {
- return xll_tex2Dlod( buffer, vec4( (coord / dimensions), 0.0, 0.0));
-}
-void ReadLightArray3( in highp ivec4 lightIdx, out Lamp l0, out Lamp l1, out Lamp l2, out Lamp l3 ) {
-
- l0.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 1.0), _DynLampInfo_bufferSize);
- l0.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.x), 2.0), _DynLampInfo_bufferSize);
- l1.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 1.0), _DynLampInfo_bufferSize);
-
- l1.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.y), 2.0), _DynLampInfo_bufferSize);
- l2.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 1.0), _DynLampInfo_bufferSize);
- l2.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.z), 2.0), _DynLampInfo_bufferSize);
-
- l3.posRange = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 1.0), _DynLampInfo_bufferSize);
- l3.colorImp = DoSampleGPUBuffer( _DynLampInfo, vec2( float(lightIdx.w), 2.0), _DynLampInfo_bufferSize);
-}
-void DoCalcHybridLight2( in highp vec3 worldVert, in highp vec3 worldNorm, out mediump vec3 hybridCol, in lowp vec4 bakedColor, in mediump vec2 bakedDir ) {
- mediump vec3 hybridDir;
- LoadBakedLight( hybridCol, hybridDir);
-
- highp ivec4 lightIdx = ivec4( int(worldVert.x), int(worldVert.y), int(worldVert.z), int((-worldVert.x)));
- Lamp l[4];
- ReadLightArray3( lightIdx, l[0], l[1], l[2], l[3]);
-
- CalcDynamicLight( worldVert, worldNorm, l, hybridDir, hybridCol);
-}
-highp vec3 CalcDiffuseHybridLight( in highp vec3 worldVert, in highp vec3 worldNorm, in mediump vec4 bakedColor, in mediump vec2 bakedDir ) {
- mediump vec3 hybridCol;
- DoCalcHybridLight2( worldVert, worldNorm, hybridCol, bakedColor, bakedDir);
-
- return hybridCol;
-}
-v2f vert( in HybridAppData v ) {
- v2f o;
-
- highp vec3 worldVert = (_Object2World * v.vertex).xyz;
- highp vec3 worldNorm = normalize((mat3( _Object2World) * v.normal.xyz));
- o.diffuse = CalcDiffuseHybridLight( worldVert, worldNorm, v.bakedCol, v.bakedDir);
-
- o.pos = (glstate_matrix_mvp * v.vertex);
- return o;
-}
-
-out mediump vec3 xlv_TEXCOORD2;
-void main() {
- v2f xl_retval;
- HybridAppData xlt_v;
- xlt_v.vertex = vec4(gl_Vertex);
- xlt_v.tangent = vec4(TANGENT);
- xlt_v.normal = vec3(gl_Normal);
- xlt_v.texcoord = vec4(gl_MultiTexCoord0);
- xlt_v.bakedCol = vec4(gl_Color);
- xlt_v.bakedDir = vec2(gl_MultiTexCoord1);
- xl_retval = vert( xlt_v);
- gl_Position = vec4(xl_retval.pos);
- xlv_TEXCOORD2 = vec3(xl_retval.diffuse);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-out.txt
deleted file mode 100644
index 64b42b38c57..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-out.txt
+++ /dev/null
@@ -1,109 +0,0 @@
-uniform mat4 _Object2World;
-uniform vec2 _DynLampInfo_bufferSize;
-uniform sampler2D _DynLampInfo;
-varying vec3 xlv_TEXCOORD2;
-void main ()
-{
- vec3 tmpvar_1;
- tmpvar_1 = (_Object2World * gl_Vertex).xyz;
- vec3 hybridCol_2;
- ivec4 tmpvar_3;
- tmpvar_3.xyz = ivec3(tmpvar_1);
- tmpvar_3.w = int(-(tmpvar_1.x));
- vec4 tmpvar_4;
- vec4 tmpvar_5;
- vec4 tmpvar_6;
- vec4 tmpvar_7;
- vec2 tmpvar_8;
- tmpvar_8.y = 1.0;
- tmpvar_8.x = float(tmpvar_3.x);
- vec4 tmpvar_9;
- tmpvar_9.zw = vec2(0.0, 0.0);
- tmpvar_9.xy = (tmpvar_8 / _DynLampInfo_bufferSize);
- tmpvar_4 = texture2DLod (_DynLampInfo, tmpvar_9.xy, 0.0);
- vec2 tmpvar_10;
- tmpvar_10.y = 2.0;
- tmpvar_10.x = float(tmpvar_3.x);
- vec4 tmpvar_11;
- tmpvar_11.zw = vec2(0.0, 0.0);
- tmpvar_11.xy = (tmpvar_10 / _DynLampInfo_bufferSize);
- vec2 tmpvar_12;
- tmpvar_12.y = 1.0;
- tmpvar_12.x = float(tmpvar_3.y);
- vec4 tmpvar_13;
- tmpvar_13.zw = vec2(0.0, 0.0);
- tmpvar_13.xy = (tmpvar_12 / _DynLampInfo_bufferSize);
- tmpvar_5 = texture2DLod (_DynLampInfo, tmpvar_13.xy, 0.0);
- vec2 tmpvar_14;
- tmpvar_14.y = 2.0;
- tmpvar_14.x = float(tmpvar_3.y);
- vec4 tmpvar_15;
- tmpvar_15.zw = vec2(0.0, 0.0);
- tmpvar_15.xy = (tmpvar_14 / _DynLampInfo_bufferSize);
- vec2 tmpvar_16;
- tmpvar_16.y = 1.0;
- tmpvar_16.x = float(tmpvar_3.z);
- vec4 tmpvar_17;
- tmpvar_17.zw = vec2(0.0, 0.0);
- tmpvar_17.xy = (tmpvar_16 / _DynLampInfo_bufferSize);
- tmpvar_6 = texture2DLod (_DynLampInfo, tmpvar_17.xy, 0.0);
- vec2 tmpvar_18;
- tmpvar_18.y = 2.0;
- tmpvar_18.x = float(tmpvar_3.z);
- vec4 tmpvar_19;
- tmpvar_19.zw = vec2(0.0, 0.0);
- tmpvar_19.xy = (tmpvar_18 / _DynLampInfo_bufferSize);
- vec2 tmpvar_20;
- tmpvar_20.y = 1.0;
- tmpvar_20.x = float(tmpvar_3.w);
- vec4 tmpvar_21;
- tmpvar_21.zw = vec2(0.0, 0.0);
- tmpvar_21.xy = (tmpvar_20 / _DynLampInfo_bufferSize);
- tmpvar_7 = texture2DLod (_DynLampInfo, tmpvar_21.xy, 0.0);
- vec2 tmpvar_22;
- tmpvar_22.y = 2.0;
- tmpvar_22.x = float(tmpvar_3.w);
- vec4 tmpvar_23;
- tmpvar_23.zw = vec2(0.0, 0.0);
- tmpvar_23.xy = (tmpvar_22 / _DynLampInfo_bufferSize);
- vec3 hybridCol_24;
- vec4 atten_25;
- vec3 tmpvar_26;
- tmpvar_26 = (tmpvar_4.xyz - tmpvar_1);
- vec4 tmpvar_27;
- tmpvar_27.yzw = atten_25.yzw;
- tmpvar_27.x = (dot (tmpvar_26, tmpvar_26) * tmpvar_4.w);
- vec3 tmpvar_28;
- tmpvar_28 = (tmpvar_5.xyz - tmpvar_1);
- vec4 tmpvar_29;
- tmpvar_29.xzw = tmpvar_27.xzw;
- tmpvar_29.y = (dot (tmpvar_28, tmpvar_28) * tmpvar_5.w);
- vec3 tmpvar_30;
- tmpvar_30 = (tmpvar_6.xyz - tmpvar_1);
- vec4 tmpvar_31;
- tmpvar_31.xyw = tmpvar_29.xyw;
- tmpvar_31.z = (dot (tmpvar_30, tmpvar_30) * tmpvar_6.w);
- vec3 tmpvar_32;
- tmpvar_32 = (tmpvar_7.xyz - tmpvar_1);
- vec4 tmpvar_33;
- tmpvar_33.xyz = tmpvar_31.xyz;
- tmpvar_33.w = (dot (tmpvar_32, tmpvar_32) * tmpvar_7.w);
- atten_25 = tmpvar_33;
- hybridCol_24 = (hybridCol_2 + (texture2DLod (_DynLampInfo, tmpvar_11.xy, 0.0).xyz * tmpvar_27.x));
- hybridCol_24 = (hybridCol_24 + (texture2DLod (_DynLampInfo, tmpvar_15.xy, 0.0).xyz * tmpvar_29.y));
- hybridCol_24 = (hybridCol_24 + (texture2DLod (_DynLampInfo, tmpvar_19.xy, 0.0).xyz * tmpvar_31.z));
- hybridCol_24 = (hybridCol_24 + (texture2DLod (_DynLampInfo, tmpvar_23.xy, 0.0).xyz * tmpvar_33.w));
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- xlv_TEXCOORD2 = hybridCol_24;
-}
-
-
-// stats: 57 alu 8 tex 0 flow
-// inputs: 1
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 3 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _Object2World (high float) 4x4 [-1]
-// #2: _DynLampInfo_bufferSize (high float) 2x1 [-1]
-// textures: 1
-// #0: _DynLampInfo (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt
deleted file mode 100644
index b6e32666a2b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES.txt
+++ /dev/null
@@ -1,163 +0,0 @@
-attribute vec4 _glesVertex;
-uniform highp mat4 glstate_matrix_mvp;
-uniform highp mat4 _Object2World;
-uniform mediump vec2 _DynLampInfo_bufferSize;
-uniform sampler2D _DynLampInfo;
-varying mediump vec3 xlv_TEXCOORD2;
-void main ()
-{
- mediump vec3 tmpvar_1;
- highp vec3 tmpvar_2;
- tmpvar_2 = (_Object2World * _glesVertex).xyz;
- highp vec3 tmpvar_3;
- mediump vec3 hybridCol_4;
- highp ivec4 tmpvar_5;
- tmpvar_5.xyz = ivec3(tmpvar_2);
- tmpvar_5.w = int(-(tmpvar_2.x));
- highp vec2 tmpvar_6;
- tmpvar_6.y = 1.0;
- tmpvar_6.x = float(tmpvar_5.x);
- mediump vec2 coord_7;
- coord_7 = tmpvar_6;
- mediump vec4 tmpvar_8;
- tmpvar_8.zw = vec2(0.0, 0.0);
- tmpvar_8.xy = (coord_7 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_9;
- lowp vec4 tmpvar_10;
- tmpvar_10 = texture2DLod (_DynLampInfo, tmpvar_8.xy, 0.0);
- tmpvar_9 = tmpvar_10;
- highp vec2 tmpvar_11;
- tmpvar_11.y = 2.0;
- tmpvar_11.x = float(tmpvar_5.x);
- mediump vec2 coord_12;
- coord_12 = tmpvar_11;
- mediump vec4 tmpvar_13;
- tmpvar_13.zw = vec2(0.0, 0.0);
- tmpvar_13.xy = (coord_12 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_14;
- lowp vec4 tmpvar_15;
- tmpvar_15 = texture2DLod (_DynLampInfo, tmpvar_13.xy, 0.0);
- tmpvar_14 = tmpvar_15;
- highp vec2 tmpvar_16;
- tmpvar_16.y = 1.0;
- tmpvar_16.x = float(tmpvar_5.y);
- mediump vec2 coord_17;
- coord_17 = tmpvar_16;
- mediump vec4 tmpvar_18;
- tmpvar_18.zw = vec2(0.0, 0.0);
- tmpvar_18.xy = (coord_17 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_19;
- lowp vec4 tmpvar_20;
- tmpvar_20 = texture2DLod (_DynLampInfo, tmpvar_18.xy, 0.0);
- tmpvar_19 = tmpvar_20;
- highp vec2 tmpvar_21;
- tmpvar_21.y = 2.0;
- tmpvar_21.x = float(tmpvar_5.y);
- mediump vec2 coord_22;
- coord_22 = tmpvar_21;
- mediump vec4 tmpvar_23;
- tmpvar_23.zw = vec2(0.0, 0.0);
- tmpvar_23.xy = (coord_22 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_24;
- lowp vec4 tmpvar_25;
- tmpvar_25 = texture2DLod (_DynLampInfo, tmpvar_23.xy, 0.0);
- tmpvar_24 = tmpvar_25;
- highp vec2 tmpvar_26;
- tmpvar_26.y = 1.0;
- tmpvar_26.x = float(tmpvar_5.z);
- mediump vec2 coord_27;
- coord_27 = tmpvar_26;
- mediump vec4 tmpvar_28;
- tmpvar_28.zw = vec2(0.0, 0.0);
- tmpvar_28.xy = (coord_27 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_29;
- lowp vec4 tmpvar_30;
- tmpvar_30 = texture2DLod (_DynLampInfo, tmpvar_28.xy, 0.0);
- tmpvar_29 = tmpvar_30;
- highp vec2 tmpvar_31;
- tmpvar_31.y = 2.0;
- tmpvar_31.x = float(tmpvar_5.z);
- mediump vec2 coord_32;
- coord_32 = tmpvar_31;
- mediump vec4 tmpvar_33;
- tmpvar_33.zw = vec2(0.0, 0.0);
- tmpvar_33.xy = (coord_32 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_34;
- lowp vec4 tmpvar_35;
- tmpvar_35 = texture2DLod (_DynLampInfo, tmpvar_33.xy, 0.0);
- tmpvar_34 = tmpvar_35;
- highp vec2 tmpvar_36;
- tmpvar_36.y = 1.0;
- tmpvar_36.x = float(tmpvar_5.w);
- mediump vec2 coord_37;
- coord_37 = tmpvar_36;
- mediump vec4 tmpvar_38;
- tmpvar_38.zw = vec2(0.0, 0.0);
- tmpvar_38.xy = (coord_37 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_39;
- lowp vec4 tmpvar_40;
- tmpvar_40 = texture2DLod (_DynLampInfo, tmpvar_38.xy, 0.0);
- tmpvar_39 = tmpvar_40;
- highp vec2 tmpvar_41;
- tmpvar_41.y = 2.0;
- tmpvar_41.x = float(tmpvar_5.w);
- mediump vec2 coord_42;
- coord_42 = tmpvar_41;
- mediump vec4 tmpvar_43;
- tmpvar_43.zw = vec2(0.0, 0.0);
- tmpvar_43.xy = (coord_42 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_44;
- lowp vec4 tmpvar_45;
- tmpvar_45 = texture2DLod (_DynLampInfo, tmpvar_43.xy, 0.0);
- tmpvar_44 = tmpvar_45;
- mediump vec3 hybridCol_46;
- mediump vec4 atten_47;
- highp vec3 tmpvar_48;
- tmpvar_48 = (tmpvar_9.xyz - tmpvar_2);
- highp float tmpvar_49;
- tmpvar_49 = dot (tmpvar_48, tmpvar_48);
- mediump vec4 tmpvar_50;
- tmpvar_50.yzw = atten_47.yzw;
- tmpvar_50.x = (tmpvar_49 * tmpvar_9.w);
- highp vec3 tmpvar_51;
- tmpvar_51 = (tmpvar_19.xyz - tmpvar_2);
- highp float tmpvar_52;
- tmpvar_52 = dot (tmpvar_51, tmpvar_51);
- mediump vec4 tmpvar_53;
- tmpvar_53.xzw = tmpvar_50.xzw;
- tmpvar_53.y = (tmpvar_52 * tmpvar_19.w);
- highp vec3 tmpvar_54;
- tmpvar_54 = (tmpvar_29.xyz - tmpvar_2);
- highp float tmpvar_55;
- tmpvar_55 = dot (tmpvar_54, tmpvar_54);
- mediump vec4 tmpvar_56;
- tmpvar_56.xyw = tmpvar_53.xyw;
- tmpvar_56.z = (tmpvar_55 * tmpvar_29.w);
- highp vec3 tmpvar_57;
- tmpvar_57 = (tmpvar_39.xyz - tmpvar_2);
- highp float tmpvar_58;
- tmpvar_58 = dot (tmpvar_57, tmpvar_57);
- mediump vec4 tmpvar_59;
- tmpvar_59.xyz = tmpvar_56.xyz;
- tmpvar_59.w = (tmpvar_58 * tmpvar_39.w);
- atten_47 = tmpvar_59;
- hybridCol_46 = (hybridCol_4 + (tmpvar_14.xyz * tmpvar_50.x));
- hybridCol_46 = (hybridCol_46 + (tmpvar_24.xyz * tmpvar_53.y));
- hybridCol_46 = (hybridCol_46 + (tmpvar_34.xyz * tmpvar_56.z));
- hybridCol_46 = (hybridCol_46 + (tmpvar_44.xyz * tmpvar_59.w));
- tmpvar_3 = hybridCol_46;
- tmpvar_1 = tmpvar_3;
- gl_Position = (glstate_matrix_mvp * _glesVertex);
- xlv_TEXCOORD2 = tmpvar_1;
-}
-
-
-// stats: 57 alu 8 tex 0 flow
-// inputs: 1
-// #0: _glesVertex (high float) 4x1 [-1]
-// uniforms: 3 (total size: 0)
-// #0: glstate_matrix_mvp (high float) 4x4 [-1]
-// #1: _Object2World (high float) 4x4 [-1]
-// #2: _DynLampInfo_bufferSize (medium float) 2x1 [-1]
-// textures: 1
-// #0: _DynLampInfo (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt
deleted file mode 100644
index 8b320c4946f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3.txt
+++ /dev/null
@@ -1,164 +0,0 @@
-#version 300 es
-in vec4 _glesVertex;
-uniform highp mat4 glstate_matrix_mvp;
-uniform highp mat4 _Object2World;
-uniform mediump vec2 _DynLampInfo_bufferSize;
-uniform sampler2D _DynLampInfo;
-out mediump vec3 xlv_TEXCOORD2;
-void main ()
-{
- mediump vec3 tmpvar_1;
- highp vec3 tmpvar_2;
- tmpvar_2 = (_Object2World * _glesVertex).xyz;
- highp vec3 tmpvar_3;
- mediump vec3 hybridCol_4;
- highp ivec4 tmpvar_5;
- tmpvar_5.xyz = ivec3(tmpvar_2);
- tmpvar_5.w = int(-(tmpvar_2.x));
- highp vec2 tmpvar_6;
- tmpvar_6.y = 1.0;
- tmpvar_6.x = float(tmpvar_5.x);
- mediump vec2 coord_7;
- coord_7 = tmpvar_6;
- mediump vec4 tmpvar_8;
- tmpvar_8.zw = vec2(0.0, 0.0);
- tmpvar_8.xy = (coord_7 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_9;
- lowp vec4 tmpvar_10;
- tmpvar_10 = textureLod (_DynLampInfo, tmpvar_8.xy, 0.0);
- tmpvar_9 = tmpvar_10;
- highp vec2 tmpvar_11;
- tmpvar_11.y = 2.0;
- tmpvar_11.x = float(tmpvar_5.x);
- mediump vec2 coord_12;
- coord_12 = tmpvar_11;
- mediump vec4 tmpvar_13;
- tmpvar_13.zw = vec2(0.0, 0.0);
- tmpvar_13.xy = (coord_12 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_14;
- lowp vec4 tmpvar_15;
- tmpvar_15 = textureLod (_DynLampInfo, tmpvar_13.xy, 0.0);
- tmpvar_14 = tmpvar_15;
- highp vec2 tmpvar_16;
- tmpvar_16.y = 1.0;
- tmpvar_16.x = float(tmpvar_5.y);
- mediump vec2 coord_17;
- coord_17 = tmpvar_16;
- mediump vec4 tmpvar_18;
- tmpvar_18.zw = vec2(0.0, 0.0);
- tmpvar_18.xy = (coord_17 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_19;
- lowp vec4 tmpvar_20;
- tmpvar_20 = textureLod (_DynLampInfo, tmpvar_18.xy, 0.0);
- tmpvar_19 = tmpvar_20;
- highp vec2 tmpvar_21;
- tmpvar_21.y = 2.0;
- tmpvar_21.x = float(tmpvar_5.y);
- mediump vec2 coord_22;
- coord_22 = tmpvar_21;
- mediump vec4 tmpvar_23;
- tmpvar_23.zw = vec2(0.0, 0.0);
- tmpvar_23.xy = (coord_22 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_24;
- lowp vec4 tmpvar_25;
- tmpvar_25 = textureLod (_DynLampInfo, tmpvar_23.xy, 0.0);
- tmpvar_24 = tmpvar_25;
- highp vec2 tmpvar_26;
- tmpvar_26.y = 1.0;
- tmpvar_26.x = float(tmpvar_5.z);
- mediump vec2 coord_27;
- coord_27 = tmpvar_26;
- mediump vec4 tmpvar_28;
- tmpvar_28.zw = vec2(0.0, 0.0);
- tmpvar_28.xy = (coord_27 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_29;
- lowp vec4 tmpvar_30;
- tmpvar_30 = textureLod (_DynLampInfo, tmpvar_28.xy, 0.0);
- tmpvar_29 = tmpvar_30;
- highp vec2 tmpvar_31;
- tmpvar_31.y = 2.0;
- tmpvar_31.x = float(tmpvar_5.z);
- mediump vec2 coord_32;
- coord_32 = tmpvar_31;
- mediump vec4 tmpvar_33;
- tmpvar_33.zw = vec2(0.0, 0.0);
- tmpvar_33.xy = (coord_32 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_34;
- lowp vec4 tmpvar_35;
- tmpvar_35 = textureLod (_DynLampInfo, tmpvar_33.xy, 0.0);
- tmpvar_34 = tmpvar_35;
- highp vec2 tmpvar_36;
- tmpvar_36.y = 1.0;
- tmpvar_36.x = float(tmpvar_5.w);
- mediump vec2 coord_37;
- coord_37 = tmpvar_36;
- mediump vec4 tmpvar_38;
- tmpvar_38.zw = vec2(0.0, 0.0);
- tmpvar_38.xy = (coord_37 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_39;
- lowp vec4 tmpvar_40;
- tmpvar_40 = textureLod (_DynLampInfo, tmpvar_38.xy, 0.0);
- tmpvar_39 = tmpvar_40;
- highp vec2 tmpvar_41;
- tmpvar_41.y = 2.0;
- tmpvar_41.x = float(tmpvar_5.w);
- mediump vec2 coord_42;
- coord_42 = tmpvar_41;
- mediump vec4 tmpvar_43;
- tmpvar_43.zw = vec2(0.0, 0.0);
- tmpvar_43.xy = (coord_42 / _DynLampInfo_bufferSize);
- mediump vec4 tmpvar_44;
- lowp vec4 tmpvar_45;
- tmpvar_45 = textureLod (_DynLampInfo, tmpvar_43.xy, 0.0);
- tmpvar_44 = tmpvar_45;
- mediump vec3 hybridCol_46;
- mediump vec4 atten_47;
- highp vec3 tmpvar_48;
- tmpvar_48 = (tmpvar_9.xyz - tmpvar_2);
- highp float tmpvar_49;
- tmpvar_49 = dot (tmpvar_48, tmpvar_48);
- mediump vec4 tmpvar_50;
- tmpvar_50.yzw = atten_47.yzw;
- tmpvar_50.x = (tmpvar_49 * tmpvar_9.w);
- highp vec3 tmpvar_51;
- tmpvar_51 = (tmpvar_19.xyz - tmpvar_2);
- highp float tmpvar_52;
- tmpvar_52 = dot (tmpvar_51, tmpvar_51);
- mediump vec4 tmpvar_53;
- tmpvar_53.xzw = tmpvar_50.xzw;
- tmpvar_53.y = (tmpvar_52 * tmpvar_19.w);
- highp vec3 tmpvar_54;
- tmpvar_54 = (tmpvar_29.xyz - tmpvar_2);
- highp float tmpvar_55;
- tmpvar_55 = dot (tmpvar_54, tmpvar_54);
- mediump vec4 tmpvar_56;
- tmpvar_56.xyw = tmpvar_53.xyw;
- tmpvar_56.z = (tmpvar_55 * tmpvar_29.w);
- highp vec3 tmpvar_57;
- tmpvar_57 = (tmpvar_39.xyz - tmpvar_2);
- highp float tmpvar_58;
- tmpvar_58 = dot (tmpvar_57, tmpvar_57);
- mediump vec4 tmpvar_59;
- tmpvar_59.xyz = tmpvar_56.xyz;
- tmpvar_59.w = (tmpvar_58 * tmpvar_39.w);
- atten_47 = tmpvar_59;
- hybridCol_46 = (hybridCol_4 + (tmpvar_14.xyz * tmpvar_50.x));
- hybridCol_46 = (hybridCol_46 + (tmpvar_24.xyz * tmpvar_53.y));
- hybridCol_46 = (hybridCol_46 + (tmpvar_34.xyz * tmpvar_56.z));
- hybridCol_46 = (hybridCol_46 + (tmpvar_44.xyz * tmpvar_59.w));
- tmpvar_3 = hybridCol_46;
- tmpvar_1 = tmpvar_3;
- gl_Position = (glstate_matrix_mvp * _glesVertex);
- xlv_TEXCOORD2 = tmpvar_1;
-}
-
-
-// stats: 57 alu 8 tex 0 flow
-// inputs: 1
-// #0: _glesVertex (high float) 4x1 [-1]
-// uniforms: 3 (total size: 0)
-// #0: glstate_matrix_mvp (high float) 4x4 [-1]
-// #1: _Object2World (high float) 4x4 [-1]
-// #2: _DynLampInfo_bufferSize (medium float) 2x1 [-1]
-// textures: 1
-// #0: _DynLampInfo (low 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt
deleted file mode 100644
index abbb4bb24a7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-NichsHybridLightVectorInsertBug-outES3Metal.txt
+++ /dev/null
@@ -1,175 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 _glesVertex [[attribute(0)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- half3 xlv_TEXCOORD2;
-};
-struct xlatMtlShaderUniform {
- float4x4 glstate_matrix_mvp;
- float4x4 _Object2World;
- half2 _DynLampInfo_bufferSize;
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]]
- , texture2d<half> _DynLampInfo [[texture(0)]], sampler _mtlsmp__DynLampInfo [[sampler(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- half3 tmpvar_1 = 0;
- float3 tmpvar_2 = 0;
- tmpvar_2 = (_mtl_u._Object2World * _mtl_i._glesVertex).xyz;
- float3 tmpvar_3 = 0;
- half3 hybridCol_4 = 0;
- int4 tmpvar_5 = 0;
- tmpvar_5.xyz = int3(tmpvar_2);
- tmpvar_5.w = int(-(tmpvar_2.x));
- float2 tmpvar_6 = 0;
- tmpvar_6.y = 1.0;
- tmpvar_6.x = float(tmpvar_5.x);
- half2 coord_7 = 0;
- coord_7 = half2(tmpvar_6);
- half4 tmpvar_8 = 0;
- tmpvar_8.zw = half2(float2(0.0, 0.0));
- tmpvar_8.xy = (coord_7 / _mtl_u._DynLampInfo_bufferSize);
- half4 tmpvar_9 = 0;
- half4 tmpvar_10 = 0;
- tmpvar_10 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_8.xy), level(0.0));
- tmpvar_9 = tmpvar_10;
- float2 tmpvar_11 = 0;
- tmpvar_11.y = 2.0;
- tmpvar_11.x = float(tmpvar_5.x);
- half2 coord_12 = 0;
- coord_12 = half2(tmpvar_11);
- half4 tmpvar_13 = 0;
- tmpvar_13.zw = half2(float2(0.0, 0.0));
- tmpvar_13.xy = (coord_12 / _mtl_u._DynLampInfo_bufferSize);
- half4 tmpvar_14 = 0;
- half4 tmpvar_15 = 0;
- tmpvar_15 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_13.xy), level(0.0));
- tmpvar_14 = tmpvar_15;
- float2 tmpvar_16 = 0;
- tmpvar_16.y = 1.0;
- tmpvar_16.x = float(tmpvar_5.y);
- half2 coord_17 = 0;
- coord_17 = half2(tmpvar_16);
- half4 tmpvar_18 = 0;
- tmpvar_18.zw = half2(float2(0.0, 0.0));
- tmpvar_18.xy = (coord_17 / _mtl_u._DynLampInfo_bufferSize);
- half4 tmpvar_19 = 0;
- half4 tmpvar_20 = 0;
- tmpvar_20 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_18.xy), level(0.0));
- tmpvar_19 = tmpvar_20;
- float2 tmpvar_21 = 0;
- tmpvar_21.y = 2.0;
- tmpvar_21.x = float(tmpvar_5.y);
- half2 coord_22 = 0;
- coord_22 = half2(tmpvar_21);
- half4 tmpvar_23 = 0;
- tmpvar_23.zw = half2(float2(0.0, 0.0));
- tmpvar_23.xy = (coord_22 / _mtl_u._DynLampInfo_bufferSize);
- half4 tmpvar_24 = 0;
- half4 tmpvar_25 = 0;
- tmpvar_25 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_23.xy), level(0.0));
- tmpvar_24 = tmpvar_25;
- float2 tmpvar_26 = 0;
- tmpvar_26.y = 1.0;
- tmpvar_26.x = float(tmpvar_5.z);
- half2 coord_27 = 0;
- coord_27 = half2(tmpvar_26);
- half4 tmpvar_28 = 0;
- tmpvar_28.zw = half2(float2(0.0, 0.0));
- tmpvar_28.xy = (coord_27 / _mtl_u._DynLampInfo_bufferSize);
- half4 tmpvar_29 = 0;
- half4 tmpvar_30 = 0;
- tmpvar_30 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_28.xy), level(0.0));
- tmpvar_29 = tmpvar_30;
- float2 tmpvar_31 = 0;
- tmpvar_31.y = 2.0;
- tmpvar_31.x = float(tmpvar_5.z);
- half2 coord_32 = 0;
- coord_32 = half2(tmpvar_31);
- half4 tmpvar_33 = 0;
- tmpvar_33.zw = half2(float2(0.0, 0.0));
- tmpvar_33.xy = (coord_32 / _mtl_u._DynLampInfo_bufferSize);
- half4 tmpvar_34 = 0;
- half4 tmpvar_35 = 0;
- tmpvar_35 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_33.xy), level(0.0));
- tmpvar_34 = tmpvar_35;
- float2 tmpvar_36 = 0;
- tmpvar_36.y = 1.0;
- tmpvar_36.x = float(tmpvar_5.w);
- half2 coord_37 = 0;
- coord_37 = half2(tmpvar_36);
- half4 tmpvar_38 = 0;
- tmpvar_38.zw = half2(float2(0.0, 0.0));
- tmpvar_38.xy = (coord_37 / _mtl_u._DynLampInfo_bufferSize);
- half4 tmpvar_39 = 0;
- half4 tmpvar_40 = 0;
- tmpvar_40 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_38.xy), level(0.0));
- tmpvar_39 = tmpvar_40;
- float2 tmpvar_41 = 0;
- tmpvar_41.y = 2.0;
- tmpvar_41.x = float(tmpvar_5.w);
- half2 coord_42 = 0;
- coord_42 = half2(tmpvar_41);
- half4 tmpvar_43 = 0;
- tmpvar_43.zw = half2(float2(0.0, 0.0));
- tmpvar_43.xy = (coord_42 / _mtl_u._DynLampInfo_bufferSize);
- half4 tmpvar_44 = 0;
- half4 tmpvar_45 = 0;
- tmpvar_45 = _DynLampInfo.sample(_mtlsmp__DynLampInfo, (float2)(tmpvar_43.xy), level(0.0));
- tmpvar_44 = tmpvar_45;
- half3 hybridCol_46 = 0;
- half4 atten_47 = 0;
- float3 tmpvar_48 = 0;
- tmpvar_48 = ((float3)(tmpvar_9.xyz) - tmpvar_2);
- float tmpvar_49 = 0;
- tmpvar_49 = dot (tmpvar_48, tmpvar_48);
- half4 tmpvar_50 = 0;
- tmpvar_50.yzw = atten_47.yzw;
- tmpvar_50.x = half((tmpvar_49 * (float)(tmpvar_9.w)));
- float3 tmpvar_51 = 0;
- tmpvar_51 = ((float3)(tmpvar_19.xyz) - tmpvar_2);
- float tmpvar_52 = 0;
- tmpvar_52 = dot (tmpvar_51, tmpvar_51);
- half4 tmpvar_53 = 0;
- tmpvar_53.xzw = tmpvar_50.xzw;
- tmpvar_53.y = half((tmpvar_52 * (float)(tmpvar_19.w)));
- float3 tmpvar_54 = 0;
- tmpvar_54 = ((float3)(tmpvar_29.xyz) - tmpvar_2);
- float tmpvar_55 = 0;
- tmpvar_55 = dot (tmpvar_54, tmpvar_54);
- half4 tmpvar_56 = 0;
- tmpvar_56.xyw = tmpvar_53.xyw;
- tmpvar_56.z = half((tmpvar_55 * (float)(tmpvar_29.w)));
- float3 tmpvar_57 = 0;
- tmpvar_57 = ((float3)(tmpvar_39.xyz) - tmpvar_2);
- float tmpvar_58 = 0;
- tmpvar_58 = dot (tmpvar_57, tmpvar_57);
- half4 tmpvar_59 = 0;
- tmpvar_59.xyz = tmpvar_56.xyz;
- tmpvar_59.w = half((tmpvar_58 * (float)(tmpvar_39.w)));
- atten_47 = tmpvar_59;
- hybridCol_46 = (hybridCol_4 + (tmpvar_14.xyz * tmpvar_50.x));
- hybridCol_46 = (hybridCol_46 + (tmpvar_24.xyz * tmpvar_53.y));
- hybridCol_46 = (hybridCol_46 + (tmpvar_34.xyz * tmpvar_56.z));
- hybridCol_46 = (hybridCol_46 + (tmpvar_44.xyz * tmpvar_59.w));
- tmpvar_3 = float3(hybridCol_46);
- tmpvar_1 = half3(tmpvar_3);
- _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * _mtl_i._glesVertex);
- _mtl_o.xlv_TEXCOORD2 = tmpvar_1;
- return _mtl_o;
-}
-
-
-// stats: 57 alu 8 tex 0 flow
-// inputs: 1
-// #0: _glesVertex (high float) 4x1 [-1] loc 0
-// uniforms: 3 (total size: 132)
-// #0: glstate_matrix_mvp (high float) 4x4 [-1] loc 0
-// #1: _Object2World (high float) 4x4 [-1] loc 64
-// #2: _DynLampInfo_bufferSize (medium float) 2x1 [-1] loc 128
-// textures: 1
-// #0: _DynLampInfo (low 2d) 0x0 [-1] loc 0
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-in.txt
deleted file mode 100644
index a1aeca24271..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-in.txt
+++ /dev/null
@@ -1,132 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec3 vlight;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-vec3 ShadeSH9( in vec4 normal );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-vec3 ShadeSH9( in vec4 normal ) {
- vec3 x1;
- vec4 vB;
- vec3 x2;
- float vC;
- vec3 x3;
- x1.x = dot( unity_SHAr, normal);
- x1.y = dot( unity_SHAg, normal);
- x1.z = dot( unity_SHAb, normal);
- vB = (normal.xyzz * normal.yzzx );
- x2.x = dot( unity_SHBr, vB);
- x2.y = dot( unity_SHBg, vB);
- x2.z = dot( unity_SHBb, vB);
- vC = ((normal.x * normal.x ) - (normal.y * normal.y ));
- x3 = (unity_SHC.xyz * vC);
- return ((x1 + x2) + x3);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return objSpaceLightPos.xyz ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 worldN;
- vec3 binormal;
- mat3 rotation;
- vec3 shlight;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- worldN = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- shlight = ShadeSH9( vec4( worldN, 1.00000));
- o.vlight = shlight;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.vlight, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-out.txt
deleted file mode 100644
index 63a175367a5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-alphabumpspec-out.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec3 worldN_2;
- vec4 tmpvar_3;
- vec4 pos_4;
- pos_4 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_3.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- mat3 tmpvar_5;
- tmpvar_5[0] = _Object2World[0].xyz;
- tmpvar_5[1] = _Object2World[1].xyz;
- tmpvar_5[2] = _Object2World[2].xyz;
- worldN_2 = (tmpvar_5 * (gl_Normal * unity_Scale.w));
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_6;
- tmpvar_6[0].x = TANGENT.x;
- tmpvar_6[0].y = binormal_1.x;
- tmpvar_6[0].z = gl_Normal.x;
- tmpvar_6[1].x = TANGENT.y;
- tmpvar_6[1].y = binormal_1.y;
- tmpvar_6[1].z = gl_Normal.y;
- tmpvar_6[2].x = TANGENT.z;
- tmpvar_6[2].y = binormal_1.z;
- tmpvar_6[2].z = gl_Normal.z;
- vec4 tmpvar_7;
- tmpvar_7.w = 1.0;
- tmpvar_7.xyz = _WorldSpaceCameraPos;
- vec4 tmpvar_8;
- tmpvar_8.w = 1.0;
- tmpvar_8.xyz = worldN_2;
- vec3 x2_9;
- vec4 vB_10;
- vec3 x1_11;
- x1_11.x = dot (unity_SHAr, tmpvar_8);
- x1_11.y = dot (unity_SHAg, tmpvar_8);
- x1_11.z = dot (unity_SHAb, tmpvar_8);
- vB_10 = (worldN_2.xyzz * worldN_2.yzzx);
- x2_9.x = dot (unity_SHBr, vB_10);
- x2_9.y = dot (unity_SHBg, vB_10);
- x2_9.z = dot (unity_SHBb, vB_10);
- gl_Position = pos_4;
- vec4 tmpvar_12;
- tmpvar_12.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_12.x = pos_4.z;
- xlv_FOG = tmpvar_12;
- gl_TexCoord[0] = tmpvar_3;
- vec4 tmpvar_13;
- tmpvar_13.w = 0.0;
- tmpvar_13.xyz = (tmpvar_6 * ((
- (_World2Object * tmpvar_7)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_13;
- vec4 tmpvar_14;
- tmpvar_14.w = 0.0;
- tmpvar_14.xyz = (tmpvar_6 * (_World2Object * _WorldSpaceLightPos0).xyz);
- gl_TexCoord[2] = tmpvar_14;
- vec4 tmpvar_15;
- tmpvar_15.w = 0.0;
- tmpvar_15.xyz = ((x1_11 + x2_9) + (unity_SHC.xyz * (
- (worldN_2.x * worldN_2.x)
- -
- (worldN_2.y * worldN_2.y)
- )));
- gl_TexCoord[3] = tmpvar_15;
-}
-
-
-// stats: 36 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 15 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _World2Object (high float) 4x4 [-1]
-// #5: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #7: unity_SHAb (high float) 4x1 [-1]
-// #8: unity_SHAg (high float) 4x1 [-1]
-// #9: unity_SHAr (high float) 4x1 [-1]
-// #10: unity_SHBb (high float) 4x1 [-1]
-// #11: unity_SHBg (high float) 4x1 [-1]
-// #12: unity_SHBr (high float) 4x1 [-1]
-// #13: unity_SHC (high float) 4x1 [-1]
-// #14: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-in.txt
deleted file mode 100644
index f2bd760a5a9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-in.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform vec4 _MainTex_ST;
-uniform mat4 glstate_matrix_mvp;
-v2f xlat_main( in appdata_t v );
-v2f xlat_main( in appdata_t v ) {
- v2f o;
- o.vertex = ( glstate_matrix_mvp * v.vertex );
- o.color = v.color;
- o.texcoord = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- return o;
-}
-varying vec4 xlv_COLOR;
-varying vec2 xlv_TEXCOORD0;
-void main() {
- v2f xl_retval;
- appdata_t xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.color = vec4( gl_Color);
- xlt_v.texcoord = vec2( gl_MultiTexCoord0);
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.vertex);
- xlv_COLOR = vec4( xl_retval.color);
- xlv_TEXCOORD0 = vec2( xl_retval.texcoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-inES.txt
deleted file mode 100644
index 8ae07255bd0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-inES.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-struct v2f {
- highp vec4 vertex;
- lowp vec4 color;
- mediump vec2 texcoord;
-};
-struct appdata_t {
- highp vec4 vertex;
- lowp vec4 color;
- highp vec2 texcoord;
-};
-uniform highp vec4 _MainTex_ST;
-uniform highp mat4 glstate_matrix_mvp;
-v2f xlat_main( in appdata_t v );
-v2f xlat_main( in appdata_t v ) {
- v2f o;
- o.vertex = ( glstate_matrix_mvp * v.vertex );
- o.color = v.color;
- o.texcoord = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- return o;
-}
-varying lowp vec4 xlv_COLOR;
-varying mediump vec2 xlv_TEXCOORD0;
-void main() {
- v2f xl_retval;
- appdata_t xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.color = vec4( gl_Color);
- xlt_v.texcoord = vec2( gl_MultiTexCoord0);
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.vertex);
- xlv_COLOR = vec4( xl_retval.color);
- xlv_TEXCOORD0 = vec2( xl_retval.texcoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-out.txt
deleted file mode 100644
index a79d92cec0a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-out.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform mat4 glstate_matrix_mvp;
-varying vec4 xlv_COLOR;
-varying vec2 xlv_TEXCOORD0;
-void main ()
-{
- gl_Position = (glstate_matrix_mvp * gl_Vertex);
- xlv_COLOR = gl_Color;
- xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: _MainTex_ST (high float) 4x1 [-1]
-// #1: glstate_matrix_mvp (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-outES.txt
deleted file mode 100644
index ce910f39c2f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-particle-outES.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-attribute highp vec4 _glesVertex;
-attribute highp vec4 _glesMultiTexCoord0;
-attribute lowp vec4 _glesColor;
-uniform highp vec4 _MainTex_ST;
-uniform highp mat4 glstate_matrix_mvp;
-varying lowp vec4 xlv_COLOR;
-varying mediump vec2 xlv_TEXCOORD0;
-void main ()
-{
- mediump vec2 tmpvar_1;
- tmpvar_1 = ((_glesMultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_Position = (glstate_matrix_mvp * _glesVertex);
- xlv_COLOR = _glesColor;
- xlv_TEXCOORD0 = tmpvar_1;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 3
-// #0: _glesVertex (high float) 4x1 [-1]
-// #1: _glesMultiTexCoord0 (high float) 4x1 [-1]
-// #2: _glesColor (low float) 4x1 [-1]
-// uniforms: 2 (total size: 0)
-// #0: _MainTex_ST (high float) 4x1 [-1]
-// #1: glstate_matrix_mvp (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-in.txt
deleted file mode 100644
index 851a2bbfa8a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-in.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-struct v2f {
- vec4 pos;
- vec4 uv;
- vec3 ray;
-};
-struct appdata {
- vec4 vertex;
- vec3 normal;
-};
-uniform vec4 _ProjectionParams;
-uniform mat4 glstate_matrix_modelview0;
-uniform mat4 glstate_matrix_mvp;
-vec4 ComputeScreenPos( in vec4 pos );
-v2f xlat_main( in appdata v );
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f xlat_main( in appdata v ) {
- v2f o;
- o.pos = ( glstate_matrix_mvp * v.vertex );
- o.uv = ComputeScreenPos( o.pos);
- o.ray = (( glstate_matrix_modelview0 * v.vertex ).xyz * vec3( -1.00000, -1.00000, 1.00000));
- o.ray = mix( o.ray, v.normal, vec3( float( (v.normal.z != 0.000000) )));
- return o;
-}
-varying vec4 xlv_TEXCOORD0;
-varying vec3 xlv_TEXCOORD1;
-void main() {
- v2f xl_retval;
- appdata xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.normal = vec3( gl_Normal);
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_TEXCOORD0 = vec4( xl_retval.uv);
- xlv_TEXCOORD1 = vec3( xl_retval.ray);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES.txt
deleted file mode 100644
index 66bb4569823..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-struct v2f {
- highp vec4 pos;
- highp vec4 uv;
- highp vec3 ray;
-};
-struct appdata {
- highp vec4 vertex;
- highp vec3 normal;
-};
-uniform highp vec4 _ProjectionParams;
-uniform highp mat4 glstate_matrix_modelview0;
-uniform highp mat4 glstate_matrix_mvp;
-highp vec4 ComputeScreenPos( in highp vec4 pos );
-v2f xlat_main( in appdata v );
-highp vec4 ComputeScreenPos( in highp vec4 pos ) {
- highp vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f xlat_main( in appdata v ) {
- v2f o;
- o.pos = ( glstate_matrix_mvp * v.vertex );
- o.uv = ComputeScreenPos( o.pos);
- o.ray = (( glstate_matrix_modelview0 * v.vertex ).xyz * vec3( -1.00000, -1.00000, 1.00000));
- o.ray = mix( o.ray, v.normal, vec3( float( (v.normal.z != 0.000000) )));
- return o;
-}
-varying highp vec4 xlv_TEXCOORD0;
-varying highp vec3 xlv_TEXCOORD1;
-void main() {
- v2f xl_retval;
- appdata xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.normal = vec3( gl_Normal);
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_TEXCOORD0 = vec4( xl_retval.uv);
- xlv_TEXCOORD1 = vec3( xl_retval.ray);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES3.txt
deleted file mode 100644
index 26fc7311874..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-inES3.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-#version 300 es
-
-struct v2f {
- highp vec4 pos;
- highp vec4 uv;
- highp vec3 ray;
-};
-struct appdata {
- highp vec4 vertex;
- highp vec3 normal;
-};
-uniform highp vec4 _ProjectionParams;
-uniform highp mat4 glstate_matrix_modelview0;
-uniform highp mat4 glstate_matrix_mvp;
-highp vec4 ComputeScreenPos( in highp vec4 pos );
-v2f xlat_main( in appdata v );
-highp vec4 ComputeScreenPos( in highp vec4 pos ) {
- highp vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f xlat_main( in appdata v ) {
- v2f o;
- o.pos = ( glstate_matrix_mvp * v.vertex );
- o.uv = ComputeScreenPos( o.pos);
- o.ray = (( glstate_matrix_modelview0 * v.vertex ).xyz * vec3( -1.00000, -1.00000, 1.00000));
- o.ray = mix( o.ray, v.normal, vec3( float( (v.normal.z != 0.000000) )));
- return o;
-}
-in highp vec4 _vertex;
-in highp vec3 _normal;
-out highp vec4 xlv_TEXCOORD0;
-out highp vec3 xlv_TEXCOORD1;
-void main() {
- v2f xl_retval;
- appdata xlt_v;
- xlt_v.vertex = _vertex;
- xlt_v.normal = _normal;
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_TEXCOORD0 = vec4( xl_retval.uv);
- xlv_TEXCOORD1 = vec3( xl_retval.ray);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-out.txt
deleted file mode 100644
index 28d6a1074d3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform vec4 _ProjectionParams;
-uniform mat4 glstate_matrix_modelview0;
-uniform mat4 glstate_matrix_mvp;
-varying vec4 xlv_TEXCOORD0;
-varying vec3 xlv_TEXCOORD1;
-void main ()
-{
- vec4 tmpvar_1;
- vec3 tmpvar_2;
- tmpvar_1 = (glstate_matrix_mvp * gl_Vertex);
- vec4 o_3;
- o_3 = (tmpvar_1 * 0.5);
- vec2 tmpvar_4;
- tmpvar_4.x = o_3.x;
- tmpvar_4.y = (o_3.y * _ProjectionParams.x);
- o_3.xy = (tmpvar_4 + o_3.w);
- o_3.zw = tmpvar_1.zw;
- tmpvar_2 = ((glstate_matrix_modelview0 * gl_Vertex).xyz * vec3(-1.0, -1.0, 1.0));
- vec3 tmpvar_5;
- tmpvar_5 = mix (tmpvar_2, gl_Normal, vec3(float((gl_Normal.z != 0.0))));
- tmpvar_2 = tmpvar_5;
- gl_Position = tmpvar_1;
- xlv_TEXCOORD0 = o_3;
- xlv_TEXCOORD1 = tmpvar_5;
-}
-
-
-// stats: 9 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 3 (total size: 0)
-// #0: _ProjectionParams (high float) 4x1 [-1]
-// #1: glstate_matrix_modelview0 (high float) 4x4 [-1]
-// #2: glstate_matrix_mvp (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES.txt
deleted file mode 100644
index 10e772db2cf..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-attribute highp vec4 _glesVertex;
-attribute mediump vec3 _glesNormal;
-uniform highp vec4 _ProjectionParams;
-uniform highp mat4 glstate_matrix_modelview0;
-uniform highp mat4 glstate_matrix_mvp;
-varying highp vec4 xlv_TEXCOORD0;
-varying highp vec3 xlv_TEXCOORD1;
-void main ()
-{
- highp vec3 tmpvar_1;
- tmpvar_1 = _glesNormal;
- highp vec4 tmpvar_2;
- highp vec3 tmpvar_3;
- tmpvar_2 = (glstate_matrix_mvp * _glesVertex);
- highp vec4 o_4;
- o_4 = (tmpvar_2 * 0.5);
- highp vec2 tmpvar_5;
- tmpvar_5.x = o_4.x;
- tmpvar_5.y = (o_4.y * _ProjectionParams.x);
- o_4.xy = (tmpvar_5 + o_4.w);
- o_4.zw = tmpvar_2.zw;
- tmpvar_3 = ((glstate_matrix_modelview0 * _glesVertex).xyz * vec3(-1.0, -1.0, 1.0));
- highp vec3 tmpvar_6;
- tmpvar_6 = mix (tmpvar_3, tmpvar_1, vec3(float((tmpvar_1.z != 0.0))));
- tmpvar_3 = tmpvar_6;
- gl_Position = tmpvar_2;
- xlv_TEXCOORD0 = o_4;
- xlv_TEXCOORD1 = tmpvar_6;
-}
-
-
-// stats: 9 alu 0 tex 0 flow
-// inputs: 2
-// #0: _glesVertex (high float) 4x1 [-1]
-// #1: _glesNormal (medium float) 3x1 [-1]
-// uniforms: 3 (total size: 0)
-// #0: _ProjectionParams (high float) 4x1 [-1]
-// #1: glstate_matrix_modelview0 (high float) 4x4 [-1]
-// #2: glstate_matrix_mvp (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3.txt
deleted file mode 100644
index 78f4982f8d4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-#version 300 es
-uniform highp vec4 _ProjectionParams;
-uniform highp mat4 glstate_matrix_modelview0;
-uniform highp mat4 glstate_matrix_mvp;
-in highp vec4 _vertex;
-in highp vec3 _normal;
-out highp vec4 xlv_TEXCOORD0;
-out highp vec3 xlv_TEXCOORD1;
-void main ()
-{
- highp vec4 tmpvar_1;
- highp vec3 tmpvar_2;
- tmpvar_1 = (glstate_matrix_mvp * _vertex);
- highp vec4 o_3;
- o_3 = (tmpvar_1 * 0.5);
- highp vec2 tmpvar_4;
- tmpvar_4.x = o_3.x;
- tmpvar_4.y = (o_3.y * _ProjectionParams.x);
- o_3.xy = (tmpvar_4 + o_3.w);
- o_3.zw = tmpvar_1.zw;
- tmpvar_2 = ((glstate_matrix_modelview0 * _vertex).xyz * vec3(-1.0, -1.0, 1.0));
- highp vec3 tmpvar_5;
- tmpvar_5 = mix (tmpvar_2, _normal, vec3(float((_normal.z != 0.0))));
- tmpvar_2 = tmpvar_5;
- gl_Position = tmpvar_1;
- xlv_TEXCOORD0 = o_3;
- xlv_TEXCOORD1 = tmpvar_5;
-}
-
-
-// stats: 9 alu 0 tex 0 flow
-// inputs: 2
-// #0: _vertex (high float) 4x1 [-1]
-// #1: _normal (high float) 3x1 [-1]
-// uniforms: 3 (total size: 0)
-// #0: _ProjectionParams (high float) 4x1 [-1]
-// #1: glstate_matrix_modelview0 (high float) 4x4 [-1]
-// #2: glstate_matrix_mvp (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3Metal.txt
deleted file mode 100644
index 6ec726fa790..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-prepasslight-outES3Metal.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 _vertex [[attribute(0)]];
- float3 _normal [[attribute(1)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- float4 xlv_TEXCOORD0;
- float3 xlv_TEXCOORD1;
-};
-struct xlatMtlShaderUniform {
- float4 _ProjectionParams;
- float4x4 glstate_matrix_modelview0;
- float4x4 glstate_matrix_mvp;
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float4 tmpvar_1 = 0;
- float3 tmpvar_2 = 0;
- tmpvar_1 = (_mtl_u.glstate_matrix_mvp * _mtl_i._vertex);
- float4 o_3 = 0;
- o_3 = (tmpvar_1 * 0.5);
- float2 tmpvar_4 = 0;
- tmpvar_4.x = o_3.x;
- tmpvar_4.y = (o_3.y * _mtl_u._ProjectionParams.x);
- o_3.xy = (tmpvar_4 + o_3.w);
- o_3.zw = tmpvar_1.zw;
- tmpvar_2 = ((_mtl_u.glstate_matrix_modelview0 * _mtl_i._vertex).xyz * float3(-1.0, -1.0, 1.0));
- float3 tmpvar_5 = 0;
- tmpvar_5 = mix (tmpvar_2, _mtl_i._normal, float3(float((_mtl_i._normal.z != 0.0))));
- tmpvar_2 = tmpvar_5;
- _mtl_o.gl_Position = tmpvar_1;
- _mtl_o.xlv_TEXCOORD0 = o_3;
- _mtl_o.xlv_TEXCOORD1 = tmpvar_5;
- return _mtl_o;
-}
-
-
-// stats: 9 alu 0 tex 0 flow
-// inputs: 2
-// #0: _vertex (high float) 4x1 [-1] loc 0
-// #1: _normal (high float) 3x1 [-1] loc 1
-// uniforms: 3 (total size: 144)
-// #0: _ProjectionParams (high float) 4x1 [-1] loc 0
-// #1: glstate_matrix_modelview0 (high float) 4x4 [-1] loc 16
-// #2: glstate_matrix_mvp (high float) 4x4 [-1] loc 80
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-in.txt
deleted file mode 100644
index 25c138a7e56..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-in.txt
+++ /dev/null
@@ -1,148 +0,0 @@
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
- vec2 _LightCoord;
-};
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform vec4 _Time;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform mat4 glstate_matrix_invtrans_modelview0;
-uniform mat4 glstate_matrix_mvp;
-uniform vec4 unity_Scale;
-vec4 Squash( in vec4 pos );
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent );
-vec4 TriangleWave( in vec4 x );
-vec4 SmoothCurve( in vec4 x );
-vec4 SmoothTriangleWave( in vec4 x );
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams );
-void TreeVertLeaf( inout appdata_full v );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf xlat_main( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 planeNormal;
- vec3 projectedVertex;
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex = (pos.xyz - ((dot( planeNormal, vec3( pos)) + _SquashPlaneNormal.w ) * planeNormal));
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent ) {
- float isBillboard;
- vec3 norb;
- vec3 tanb;
- isBillboard = (1.00000 - abs( tangent.w ));
- norb = vec3( normalize( ( vec4( normal, 0.000000) * mat ) ));
- tanb = vec3( normalize( ( vec4( tangent.xyz , 0.000000) * mat ) ));
- pos += (( vec4( normal.xy , 0.000000, 0.000000) * mat ) * isBillboard);
- normal = mix( normal, norb, vec3( isBillboard));
- tangent = mix( tangent, vec4( tanb, -1.00000), vec4( isBillboard));
-}
-vec4 TriangleWave( in vec4 x ) {
- return abs( ((fract( (x + 0.500000) ) * 2.00000) - 1.00000) );
-}
-vec4 SmoothCurve( in vec4 x ) {
- return ((x * x) * (3.00000 - (2.00000 * x)));
-}
-vec4 SmoothTriangleWave( in vec4 x ) {
- return SmoothCurve( TriangleWave( x));
-}
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams ) {
- float fDetailAmp = 0.100000;
- float fBranchAmp = 0.300000;
- float fObjPhase;
- float fBranchPhase;
- float fVtxPhase;
- vec2 vWavesIn;
- vec4 vWaves;
- vec2 vWavesSum;
- vec3 bend;
- fObjPhase = dot( _Object2World[ 3 ].xyz , vec3( 1.00000));
- fBranchPhase = (fObjPhase + animParams.x );
- fVtxPhase = dot( pos.xyz , vec3( (animParams.y + fBranchPhase)));
- vWavesIn = (_Time.yy + vec2( fVtxPhase, fBranchPhase));
- vWaves = ((fract( (vWavesIn.xxyy * vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000);
- vWaves = SmoothTriangleWave( vWaves);
- vWavesSum = (vWaves.xz + vWaves.yw );
- bend = ((animParams.y * fDetailAmp) * normal.xyz );
- bend.y = (animParams.w * fBranchAmp);
- pos.xyz += (((vWavesSum.xyx * bend) + ((_Wind.xyz * vWavesSum.y ) * animParams.w )) * _Wind.w );
- pos.xyz += (animParams.z * _Wind.xyz );
- return pos;
-}
-void TreeVertLeaf( inout appdata_full v ) {
- ExpandBillboard( glstate_matrix_invtrans_modelview0, v.vertex, v.normal, v.tangent);
- v.vertex.xyz *= _Scale.xyz ;
- v.vertex = AnimateVertex( v.vertex, v.normal, vec4( v.color.xy , v.texcoord1.xy ));
- v.vertex = Squash( v.vertex);
- v.color = vec4( 1.00000, 1.00000, 1.00000, v.color.w );
- v.normal = normalize( v.normal );
- v.tangent.xyz = normalize( v.tangent.xyz );
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return objSpaceLightPos.xyz ;
-}
-v2f_surf xlat_main( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- TreeVertLeaf( v);
- o.pos = ( glstate_matrix_mvp * v.vertex );
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xy ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec2 xlv_TEXCOORD0;
-varying vec4 xlv_COLOR0;
-varying vec3 xlv_TEXCOORD1;
-varying vec3 xlv_TEXCOORD2;
-varying vec2 xlv_TEXCOORD3;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_TEXCOORD0 = vec2( xl_retval.hip_pack0);
- xlv_COLOR0 = vec4( xl_retval.lop_color);
- xlv_TEXCOORD1 = vec3( xl_retval.lightDir);
- xlv_TEXCOORD2 = vec3( xl_retval.viewDir);
- xlv_TEXCOORD3 = vec2( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES.txt
deleted file mode 100644
index e127550bbe5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES.txt
+++ /dev/null
@@ -1,148 +0,0 @@
-struct appdata_full {
- highp vec4 vertex;
- highp vec4 tangent;
- highp vec3 normal;
- highp vec4 texcoord;
- highp vec4 texcoord1;
- highp vec4 color;
-};
-struct v2f_surf {
- highp vec4 pos;
- highp vec2 hip_pack0;
- highp vec4 lop_color;
- highp vec3 lightDir;
- highp vec3 viewDir;
- highp vec2 _LightCoord;
-};
-uniform highp mat4 _LightMatrix0;
-uniform highp vec4 _MainTex_ST;
-uniform highp mat4 _Object2World;
-uniform highp vec4 _Scale;
-uniform highp float _SquashAmount;
-uniform highp vec4 _SquashPlaneNormal;
-uniform highp vec4 _Time;
-uniform highp vec4 _Wind;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp vec4 _WorldSpaceLightPos0;
-uniform highp mat4 glstate_matrix_invtrans_modelview0;
-uniform highp mat4 glstate_matrix_mvp;
-uniform highp vec4 unity_Scale;
-highp vec4 Squash( in highp vec4 pos );
-void ExpandBillboard( in highp mat4 mat, inout highp vec4 pos, inout highp vec3 normal, inout highp vec4 tangent );
-highp vec4 TriangleWave( in highp vec4 x );
-highp vec4 SmoothCurve( in highp vec4 x );
-highp vec4 SmoothTriangleWave( in highp vec4 x );
-highp vec4 AnimateVertex( in highp vec4 pos, in highp vec3 normal, in highp vec4 animParams );
-void TreeVertLeaf( inout appdata_full v );
-highp vec3 ObjSpaceViewDir( in highp vec4 v );
-highp vec3 ObjSpaceLightDir( in highp vec4 v );
-v2f_surf xlat_main( in appdata_full v );
-highp vec4 Squash( in highp vec4 pos ) {
- highp vec3 planeNormal;
- highp vec3 projectedVertex;
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex = (pos.xyz - ((dot( planeNormal, vec3( pos)) + _SquashPlaneNormal.w ) * planeNormal));
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void ExpandBillboard( in highp mat4 mat, inout highp vec4 pos, inout highp vec3 normal, inout highp vec4 tangent ) {
- highp float isBillboard;
- highp vec3 norb;
- highp vec3 tanb;
- isBillboard = (1.00000 - abs( tangent.w ));
- norb = vec3( normalize( ( vec4( normal, 0.000000) * mat ) ));
- tanb = vec3( normalize( ( vec4( tangent.xyz , 0.000000) * mat ) ));
- pos += (( vec4( normal.xy , 0.000000, 0.000000) * mat ) * isBillboard);
- normal = mix( normal, norb, vec3( isBillboard));
- tangent = mix( tangent, vec4( tanb, -1.00000), vec4( isBillboard));
-}
-highp vec4 TriangleWave( in highp vec4 x ) {
- return abs( ((fract( (x + 0.500000) ) * 2.00000) - 1.00000) );
-}
-highp vec4 SmoothCurve( in highp vec4 x ) {
- return ((x * x) * (3.00000 - (2.00000 * x)));
-}
-highp vec4 SmoothTriangleWave( in highp vec4 x ) {
- return SmoothCurve( TriangleWave( x));
-}
-highp vec4 AnimateVertex( in highp vec4 pos, in highp vec3 normal, in highp vec4 animParams ) {
- highp float fDetailAmp = 0.100000;
- highp float fBranchAmp = 0.300000;
- highp float fObjPhase;
- highp float fBranchPhase;
- highp float fVtxPhase;
- highp vec2 vWavesIn;
- highp vec4 vWaves;
- highp vec2 vWavesSum;
- highp vec3 bend;
- fObjPhase = dot( _Object2World[ 3 ].xyz , vec3( 1.00000));
- fBranchPhase = (fObjPhase + animParams.x );
- fVtxPhase = dot( pos.xyz , vec3( (animParams.y + fBranchPhase)));
- vWavesIn = (_Time.yy + vec2( fVtxPhase, fBranchPhase));
- vWaves = ((fract( (vWavesIn.xxyy * vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000);
- vWaves = SmoothTriangleWave( vWaves);
- vWavesSum = (vWaves.xz + vWaves.yw );
- bend = ((animParams.y * fDetailAmp) * normal.xyz );
- bend.y = (animParams.w * fBranchAmp);
- pos.xyz += (((vWavesSum.xyx * bend) + ((_Wind.xyz * vWavesSum.y ) * animParams.w )) * _Wind.w );
- pos.xyz += (animParams.z * _Wind.xyz );
- return pos;
-}
-void TreeVertLeaf( inout appdata_full v ) {
- ExpandBillboard( glstate_matrix_invtrans_modelview0, v.vertex, v.normal, v.tangent);
- v.vertex.xyz *= _Scale.xyz ;
- v.vertex = AnimateVertex( v.vertex, v.normal, vec4( v.color.xy , v.texcoord1.xy ));
- v.vertex = Squash( v.vertex);
- v.color = vec4( 1.00000, 1.00000, 1.00000, v.color.w );
- v.normal = normalize( v.normal );
- v.tangent.xyz = normalize( v.tangent.xyz );
-}
-highp vec3 ObjSpaceViewDir( in highp vec4 v ) {
- highp vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-highp vec3 ObjSpaceLightDir( in highp vec4 v ) {
- highp vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return objSpaceLightPos.xyz ;
-}
-v2f_surf xlat_main( in appdata_full v ) {
- v2f_surf o;
- highp vec3 binormal;
- highp mat3 rotation;
- TreeVertLeaf( v);
- o.pos = ( glstate_matrix_mvp * v.vertex );
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xy ;
- return o;
-}
-attribute vec4 TANGENT;
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec4 xlv_COLOR0;
-varying highp vec3 xlv_TEXCOORD1;
-varying highp vec3 xlv_TEXCOORD2;
-varying highp vec2 xlv_TEXCOORD3;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_TEXCOORD0 = vec2( xl_retval.hip_pack0);
- xlv_COLOR0 = vec4( xl_retval.lop_color);
- xlv_TEXCOORD1 = vec3( xl_retval.lightDir);
- xlv_TEXCOORD2 = vec3( xl_retval.viewDir);
- xlv_TEXCOORD3 = vec2( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES3.txt
deleted file mode 100644
index 93eef9f9673..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-inES3.txt
+++ /dev/null
@@ -1,155 +0,0 @@
-#version 300 es
-
-struct appdata_full {
- highp vec4 vertex;
- highp vec4 tangent;
- highp vec3 normal;
- highp vec4 texcoord;
- highp vec4 texcoord1;
- highp vec4 color;
-};
-struct v2f_surf {
- highp vec4 pos;
- highp vec2 hip_pack0;
- highp vec4 lop_color;
- highp vec3 lightDir;
- highp vec3 viewDir;
- highp vec2 _LightCoord;
-};
-uniform highp mat4 _LightMatrix0;
-uniform highp vec4 _MainTex_ST;
-uniform highp mat4 _Object2World;
-uniform highp vec4 _Scale;
-uniform highp float _SquashAmount;
-uniform highp vec4 _SquashPlaneNormal;
-uniform highp vec4 _Time;
-uniform highp vec4 _Wind;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp vec4 _WorldSpaceLightPos0;
-uniform highp mat4 glstate_matrix_invtrans_modelview0;
-uniform highp mat4 glstate_matrix_mvp;
-uniform highp vec4 unity_Scale;
-highp vec4 Squash( in highp vec4 pos );
-void ExpandBillboard( in highp mat4 mat, inout highp vec4 pos, inout highp vec3 normal, inout highp vec4 tangent );
-highp vec4 TriangleWave( in highp vec4 x );
-highp vec4 SmoothCurve( in highp vec4 x );
-highp vec4 SmoothTriangleWave( in highp vec4 x );
-highp vec4 AnimateVertex( in highp vec4 pos, in highp vec3 normal, in highp vec4 animParams );
-void TreeVertLeaf( inout appdata_full v );
-highp vec3 ObjSpaceViewDir( in highp vec4 v );
-highp vec3 ObjSpaceLightDir( in highp vec4 v );
-v2f_surf xlat_main( in appdata_full v );
-highp vec4 Squash( in highp vec4 pos ) {
- highp vec3 planeNormal;
- highp vec3 projectedVertex;
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex = (pos.xyz - ((dot( planeNormal, vec3( pos)) + _SquashPlaneNormal.w ) * planeNormal));
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void ExpandBillboard( in highp mat4 mat, inout highp vec4 pos, inout highp vec3 normal, inout highp vec4 tangent ) {
- highp float isBillboard;
- highp vec3 norb;
- highp vec3 tanb;
- isBillboard = (1.00000 - abs( tangent.w ));
- norb = vec3( normalize( ( vec4( normal, 0.000000) * mat ) ));
- tanb = vec3( normalize( ( vec4( tangent.xyz , 0.000000) * mat ) ));
- pos += (( vec4( normal.xy , 0.000000, 0.000000) * mat ) * isBillboard);
- normal = mix( normal, norb, vec3( isBillboard));
- tangent = mix( tangent, vec4( tanb, -1.00000), vec4( isBillboard));
-}
-highp vec4 TriangleWave( in highp vec4 x ) {
- return abs( ((fract( (x + 0.500000) ) * 2.00000) - 1.00000) );
-}
-highp vec4 SmoothCurve( in highp vec4 x ) {
- return ((x * x) * (3.00000 - (2.00000 * x)));
-}
-highp vec4 SmoothTriangleWave( in highp vec4 x ) {
- return SmoothCurve( TriangleWave( x));
-}
-highp vec4 AnimateVertex( in highp vec4 pos, in highp vec3 normal, in highp vec4 animParams ) {
- highp float fDetailAmp = 0.100000;
- highp float fBranchAmp = 0.300000;
- highp float fObjPhase;
- highp float fBranchPhase;
- highp float fVtxPhase;
- highp vec2 vWavesIn;
- highp vec4 vWaves;
- highp vec2 vWavesSum;
- highp vec3 bend;
- fObjPhase = dot( _Object2World[ 3 ].xyz , vec3( 1.00000));
- fBranchPhase = (fObjPhase + animParams.x );
- fVtxPhase = dot( pos.xyz , vec3( (animParams.y + fBranchPhase)));
- vWavesIn = (_Time.yy + vec2( fVtxPhase, fBranchPhase));
- vWaves = ((fract( (vWavesIn.xxyy * vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000);
- vWaves = SmoothTriangleWave( vWaves);
- vWavesSum = (vWaves.xz + vWaves.yw );
- bend = ((animParams.y * fDetailAmp) * normal.xyz );
- bend.y = (animParams.w * fBranchAmp);
- pos.xyz += (((vWavesSum.xyx * bend) + ((_Wind.xyz * vWavesSum.y ) * animParams.w )) * _Wind.w );
- pos.xyz += (animParams.z * _Wind.xyz );
- return pos;
-}
-void TreeVertLeaf( inout appdata_full v ) {
- ExpandBillboard( glstate_matrix_invtrans_modelview0, v.vertex, v.normal, v.tangent);
- v.vertex.xyz *= _Scale.xyz ;
- v.vertex = AnimateVertex( v.vertex, v.normal, vec4( v.color.xy , v.texcoord1.xy ));
- v.vertex = Squash( v.vertex);
- v.color = vec4( 1.00000, 1.00000, 1.00000, v.color.w );
- v.normal = normalize( v.normal );
- v.tangent.xyz = normalize( v.tangent.xyz );
-}
-highp vec3 ObjSpaceViewDir( in highp vec4 v ) {
- highp vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-highp vec3 ObjSpaceLightDir( in highp vec4 v ) {
- highp vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return objSpaceLightPos.xyz ;
-}
-v2f_surf xlat_main( in appdata_full v ) {
- v2f_surf o;
- highp vec3 binormal;
- highp mat3 rotation;
- TreeVertLeaf( v);
- o.pos = ( glstate_matrix_mvp * v.vertex );
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xy ;
- return o;
-}
-in highp vec4 _inVertex;
-in mediump vec3 _inNormal;
-in highp vec4 _uv0;
-in highp vec4 _uv1;
-in lowp vec4 _color;
-in mediump vec4 TANGENT;
-out highp vec2 xlv_TEXCOORD0;
-out lowp vec4 xlv_COLOR0;
-out mediump vec3 xlv_TEXCOORD1;
-out mediump vec3 xlv_TEXCOORD2;
-out mediump vec2 xlv_TEXCOORD3;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = _inVertex;
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = _inNormal;
- xlt_v.texcoord = _uv0;
- xlt_v.texcoord1 = _uv1;
- xlt_v.color = _color;
- xl_retval = xlat_main( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_TEXCOORD0 = vec2( xl_retval.hip_pack0);
- xlv_COLOR0 = vec4( xl_retval.lop_color);
- xlv_TEXCOORD1 = vec3( xl_retval.lightDir);
- xlv_TEXCOORD2 = vec3( xl_retval.viewDir);
- xlv_TEXCOORD3 = vec2( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-out.txt
deleted file mode 100644
index 1587d0253de..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-out.txt
+++ /dev/null
@@ -1,139 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform vec4 _Time;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform mat4 glstate_matrix_invtrans_modelview0;
-uniform mat4 glstate_matrix_mvp;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec2 xlv_TEXCOORD0;
-varying vec4 xlv_COLOR0;
-varying vec3 xlv_TEXCOORD1;
-varying vec3 xlv_TEXCOORD2;
-varying vec2 xlv_TEXCOORD3;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 tmpvar_3;
- vec4 pos_4;
- float isBillboard_5;
- isBillboard_5 = (1.0 - abs(TANGENT.w));
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = gl_Normal;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = TANGENT.xyz;
- vec4 tmpvar_8;
- tmpvar_8.zw = vec2(0.0, 0.0);
- tmpvar_8.xy = gl_Normal.xy;
- pos_4 = (gl_Vertex + ((tmpvar_8 * glstate_matrix_invtrans_modelview0) * isBillboard_5));
- vec3 tmpvar_9;
- tmpvar_9 = mix (gl_Normal, normalize((tmpvar_6 * glstate_matrix_invtrans_modelview0)).xyz, vec3(isBillboard_5));
- vec4 tmpvar_10;
- tmpvar_10.w = -1.0;
- tmpvar_10.xyz = normalize((tmpvar_7 * glstate_matrix_invtrans_modelview0)).xyz;
- vec4 tmpvar_11;
- tmpvar_11 = mix (TANGENT, tmpvar_10, vec4(isBillboard_5));
- tmpvar_2.w = pos_4.w;
- tmpvar_3.w = tmpvar_11.w;
- tmpvar_2.xyz = (pos_4.xyz * _Scale.xyz);
- vec4 pos_12;
- pos_12.w = tmpvar_2.w;
- vec3 bend_13;
- vec2 vWavesSum_14;
- vec4 vWaves_15;
- float fBranchPhase_16;
- fBranchPhase_16 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
- vec2 tmpvar_17;
- tmpvar_17.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_16)));
- tmpvar_17.y = fBranchPhase_16;
- vWaves_15 = ((fract(
- ((_Time.yy + tmpvar_17).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
- ) * 2.0) - 1.0);
- vec4 tmpvar_18;
- tmpvar_18 = abs(((
- fract((vWaves_15 + 0.5))
- * 2.0) - 1.0));
- vec4 tmpvar_19;
- tmpvar_19 = ((tmpvar_18 * tmpvar_18) * (3.0 - (2.0 * tmpvar_18)));
- vWaves_15 = tmpvar_19;
- vWavesSum_14 = (tmpvar_19.xz + tmpvar_19.yw);
- bend_13.xz = ((gl_Color.y * 0.1) * tmpvar_9).xz;
- bend_13.y = (gl_MultiTexCoord1.y * 0.3);
- pos_12.xyz = (tmpvar_2.xyz + ((
- (vWavesSum_14.xyx * bend_13)
- +
- ((_Wind.xyz * vWavesSum_14.y) * gl_MultiTexCoord1.y)
- ) * _Wind.w));
- pos_12.xyz = (pos_12.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
- vec3 tmpvar_20;
- tmpvar_20 = mix ((pos_12.xyz - (
- (dot (_SquashPlaneNormal.xyz, pos_12.xyz) + _SquashPlaneNormal.w)
- * _SquashPlaneNormal.xyz)), pos_12.xyz, vec3(_SquashAmount));
- vec4 tmpvar_21;
- tmpvar_21.w = 1.0;
- tmpvar_21.xyz = tmpvar_20;
- tmpvar_2 = tmpvar_21;
- vec4 tmpvar_22;
- tmpvar_22.xyz = vec3(1.0, 1.0, 1.0);
- tmpvar_22.w = gl_Color.w;
- vec3 tmpvar_23;
- tmpvar_23 = normalize(tmpvar_9);
- tmpvar_3.xyz = normalize(tmpvar_11.xyz);
- binormal_1 = (((tmpvar_23.yzx * tmpvar_3.zxy) - (tmpvar_23.zxy * tmpvar_3.yzx)) * tmpvar_11.w);
- mat3 tmpvar_24;
- tmpvar_24[0].x = tmpvar_3.x;
- tmpvar_24[0].y = binormal_1.x;
- tmpvar_24[0].z = tmpvar_23.x;
- tmpvar_24[1].x = tmpvar_3.y;
- tmpvar_24[1].y = binormal_1.y;
- tmpvar_24[1].z = tmpvar_23.y;
- tmpvar_24[2].x = tmpvar_3.z;
- tmpvar_24[2].y = binormal_1.z;
- tmpvar_24[2].z = tmpvar_23.z;
- vec4 tmpvar_25;
- tmpvar_25.w = 1.0;
- tmpvar_25.xyz = _WorldSpaceCameraPos;
- gl_Position = (glstate_matrix_mvp * tmpvar_21);
- xlv_TEXCOORD0 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- xlv_COLOR0 = tmpvar_22;
- xlv_TEXCOORD1 = (tmpvar_24 * (_World2Object * _WorldSpaceLightPos0).xyz);
- xlv_TEXCOORD2 = (tmpvar_24 * ((
- (_World2Object * tmpvar_25)
- .xyz * unity_Scale.w) - tmpvar_20));
- xlv_TEXCOORD3 = (_LightMatrix0 * (_Object2World * tmpvar_21)).xy;
-}
-
-
-// stats: 71 alu 0 tex 0 flow
-// inputs: 6
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Color (high float) 4x1 [-1] loc 3
-// #3: gl_Normal (high float) 3x1 [-1] loc 2
-// #4: gl_Vertex (high float) 4x1 [-1] loc 0
-// #5: TANGENT (high float) 4x1 [-1]
-// uniforms: 14 (total size: 0)
-// #0: _LightMatrix0 (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _Scale (high float) 4x1 [-1]
-// #4: _SquashAmount (high float) 1x1 [-1]
-// #5: _SquashPlaneNormal (high float) 4x1 [-1]
-// #6: _Time (high float) 4x1 [-1]
-// #7: _Wind (high float) 4x1 [-1]
-// #8: _World2Object (high float) 4x4 [-1]
-// #9: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #10: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #11: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1]
-// #12: glstate_matrix_mvp (high float) 4x4 [-1]
-// #13: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES.txt
deleted file mode 100644
index 02444d44951..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES.txt
+++ /dev/null
@@ -1,148 +0,0 @@
-attribute highp vec4 _glesVertex;
-attribute mediump vec3 _glesNormal;
-attribute highp vec4 _glesMultiTexCoord0;
-attribute highp vec4 _glesMultiTexCoord1;
-attribute lowp vec4 _glesColor;
-uniform highp mat4 _LightMatrix0;
-uniform highp vec4 _MainTex_ST;
-uniform highp mat4 _Object2World;
-uniform highp vec4 _Scale;
-uniform highp float _SquashAmount;
-uniform highp vec4 _SquashPlaneNormal;
-uniform highp vec4 _Time;
-uniform highp vec4 _Wind;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp vec4 _WorldSpaceLightPos0;
-uniform highp mat4 glstate_matrix_invtrans_modelview0;
-uniform highp mat4 glstate_matrix_mvp;
-uniform highp vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying highp vec2 xlv_TEXCOORD0;
-varying highp vec4 xlv_COLOR0;
-varying highp vec3 xlv_TEXCOORD1;
-varying highp vec3 xlv_TEXCOORD2;
-varying highp vec2 xlv_TEXCOORD3;
-void main ()
-{
- highp vec3 tmpvar_1;
- highp vec4 tmpvar_2;
- tmpvar_1 = _glesNormal;
- tmpvar_2 = _glesColor;
- highp vec3 binormal_3;
- highp vec4 tmpvar_4;
- highp vec4 tmpvar_5;
- highp vec4 pos_6;
- highp float isBillboard_7;
- isBillboard_7 = (1.0 - abs(TANGENT.w));
- highp vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = tmpvar_1;
- highp vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = TANGENT.xyz;
- highp vec4 tmpvar_10;
- tmpvar_10.zw = vec2(0.0, 0.0);
- tmpvar_10.xy = tmpvar_1.xy;
- pos_6 = (_glesVertex + ((tmpvar_10 * glstate_matrix_invtrans_modelview0) * isBillboard_7));
- highp vec3 tmpvar_11;
- tmpvar_11 = mix (tmpvar_1, normalize((tmpvar_8 * glstate_matrix_invtrans_modelview0)).xyz, vec3(isBillboard_7));
- highp vec4 tmpvar_12;
- tmpvar_12.w = -1.0;
- tmpvar_12.xyz = normalize((tmpvar_9 * glstate_matrix_invtrans_modelview0)).xyz;
- highp vec4 tmpvar_13;
- tmpvar_13 = mix (TANGENT, tmpvar_12, vec4(isBillboard_7));
- tmpvar_4.w = pos_6.w;
- tmpvar_5.w = tmpvar_13.w;
- tmpvar_4.xyz = (pos_6.xyz * _Scale.xyz);
- highp vec4 pos_14;
- pos_14.w = tmpvar_4.w;
- highp vec3 bend_15;
- highp vec2 vWavesSum_16;
- highp vec4 vWaves_17;
- highp float fBranchPhase_18;
- fBranchPhase_18 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + tmpvar_2.x);
- highp vec2 tmpvar_19;
- tmpvar_19.x = dot (tmpvar_4.xyz, vec3((tmpvar_2.y + fBranchPhase_18)));
- tmpvar_19.y = fBranchPhase_18;
- vWaves_17 = ((fract(
- ((_Time.yy + tmpvar_19).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
- ) * 2.0) - 1.0);
- highp vec4 tmpvar_20;
- tmpvar_20 = abs(((
- fract((vWaves_17 + 0.5))
- * 2.0) - 1.0));
- highp vec4 tmpvar_21;
- tmpvar_21 = ((tmpvar_20 * tmpvar_20) * (3.0 - (2.0 * tmpvar_20)));
- vWaves_17 = tmpvar_21;
- vWavesSum_16 = (tmpvar_21.xz + tmpvar_21.yw);
- bend_15.xz = ((tmpvar_2.y * 0.1) * tmpvar_11).xz;
- bend_15.y = (_glesMultiTexCoord1.y * 0.3);
- pos_14.xyz = (tmpvar_4.xyz + ((
- (vWavesSum_16.xyx * bend_15)
- +
- ((_Wind.xyz * vWavesSum_16.y) * _glesMultiTexCoord1.y)
- ) * _Wind.w));
- pos_14.xyz = (pos_14.xyz + (_glesMultiTexCoord1.x * _Wind.xyz));
- highp vec3 tmpvar_22;
- tmpvar_22 = mix ((pos_14.xyz - (
- (dot (_SquashPlaneNormal.xyz, pos_14.xyz) + _SquashPlaneNormal.w)
- * _SquashPlaneNormal.xyz)), pos_14.xyz, vec3(_SquashAmount));
- highp vec4 tmpvar_23;
- tmpvar_23.w = 1.0;
- tmpvar_23.xyz = tmpvar_22;
- tmpvar_4 = tmpvar_23;
- highp vec4 tmpvar_24;
- tmpvar_24.xyz = vec3(1.0, 1.0, 1.0);
- tmpvar_24.w = tmpvar_2.w;
- highp vec3 tmpvar_25;
- tmpvar_25 = normalize(tmpvar_11);
- tmpvar_5.xyz = normalize(tmpvar_13.xyz);
- binormal_3 = (((tmpvar_25.yzx * tmpvar_5.zxy) - (tmpvar_25.zxy * tmpvar_5.yzx)) * tmpvar_13.w);
- highp mat3 tmpvar_26;
- tmpvar_26[0].x = tmpvar_5.x;
- tmpvar_26[0].y = binormal_3.x;
- tmpvar_26[0].z = tmpvar_25.x;
- tmpvar_26[1].x = tmpvar_5.y;
- tmpvar_26[1].y = binormal_3.y;
- tmpvar_26[1].z = tmpvar_25.y;
- tmpvar_26[2].x = tmpvar_5.z;
- tmpvar_26[2].y = binormal_3.z;
- tmpvar_26[2].z = tmpvar_25.z;
- highp vec4 tmpvar_27;
- tmpvar_27.w = 1.0;
- tmpvar_27.xyz = _WorldSpaceCameraPos;
- gl_Position = (glstate_matrix_mvp * tmpvar_23);
- xlv_TEXCOORD0 = ((_glesMultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- xlv_COLOR0 = tmpvar_24;
- xlv_TEXCOORD1 = (tmpvar_26 * (_World2Object * _WorldSpaceLightPos0).xyz);
- xlv_TEXCOORD2 = (tmpvar_26 * ((
- (_World2Object * tmpvar_27)
- .xyz * unity_Scale.w) - tmpvar_22));
- xlv_TEXCOORD3 = (_LightMatrix0 * (_Object2World * tmpvar_23)).xy;
-}
-
-
-// stats: 71 alu 0 tex 0 flow
-// inputs: 6
-// #0: _glesVertex (high float) 4x1 [-1]
-// #1: _glesNormal (medium float) 3x1 [-1]
-// #2: _glesMultiTexCoord0 (high float) 4x1 [-1]
-// #3: _glesMultiTexCoord1 (high float) 4x1 [-1]
-// #4: _glesColor (low float) 4x1 [-1]
-// #5: TANGENT (high float) 4x1 [-1]
-// uniforms: 14 (total size: 0)
-// #0: _LightMatrix0 (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _Scale (high float) 4x1 [-1]
-// #4: _SquashAmount (high float) 1x1 [-1]
-// #5: _SquashPlaneNormal (high float) 4x1 [-1]
-// #6: _Time (high float) 4x1 [-1]
-// #7: _Wind (high float) 4x1 [-1]
-// #8: _World2Object (high float) 4x4 [-1]
-// #9: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #10: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #11: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1]
-// #12: glstate_matrix_mvp (high float) 4x4 [-1]
-// #13: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt
deleted file mode 100644
index f5b1b028ee8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3.txt
+++ /dev/null
@@ -1,157 +0,0 @@
-#version 300 es
-uniform highp mat4 _LightMatrix0;
-uniform highp vec4 _MainTex_ST;
-uniform highp mat4 _Object2World;
-uniform highp vec4 _Scale;
-uniform highp float _SquashAmount;
-uniform highp vec4 _SquashPlaneNormal;
-uniform highp vec4 _Time;
-uniform highp vec4 _Wind;
-uniform highp mat4 _World2Object;
-uniform highp vec3 _WorldSpaceCameraPos;
-uniform highp vec4 _WorldSpaceLightPos0;
-uniform highp mat4 glstate_matrix_invtrans_modelview0;
-uniform highp mat4 glstate_matrix_mvp;
-uniform highp vec4 unity_Scale;
-in highp vec4 _inVertex;
-in mediump vec3 _inNormal;
-in highp vec4 _uv0;
-in highp vec4 _uv1;
-in lowp vec4 _color;
-in mediump vec4 TANGENT;
-out highp vec2 xlv_TEXCOORD0;
-out lowp vec4 xlv_COLOR0;
-out mediump vec3 xlv_TEXCOORD1;
-out mediump vec3 xlv_TEXCOORD2;
-out mediump vec2 xlv_TEXCOORD3;
-void main ()
-{
- highp vec4 tmpvar_1;
- highp vec3 tmpvar_2;
- highp vec4 tmpvar_3;
- tmpvar_1 = TANGENT;
- tmpvar_2 = _inNormal;
- tmpvar_3 = _color;
- highp vec3 binormal_4;
- highp vec4 tmpvar_5;
- highp vec4 tmpvar_6;
- highp vec4 pos_7;
- highp float isBillboard_8;
- isBillboard_8 = (1.0 - abs(tmpvar_1.w));
- highp vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = tmpvar_2;
- highp vec4 tmpvar_10;
- tmpvar_10.w = 0.0;
- tmpvar_10.xyz = tmpvar_1.xyz;
- highp vec4 tmpvar_11;
- tmpvar_11.zw = vec2(0.0, 0.0);
- tmpvar_11.xy = tmpvar_2.xy;
- pos_7 = (_inVertex + ((tmpvar_11 * glstate_matrix_invtrans_modelview0) * isBillboard_8));
- highp vec3 tmpvar_12;
- tmpvar_12 = mix (tmpvar_2, normalize((tmpvar_9 * glstate_matrix_invtrans_modelview0)).xyz, vec3(isBillboard_8));
- highp vec4 tmpvar_13;
- tmpvar_13.w = -1.0;
- tmpvar_13.xyz = normalize((tmpvar_10 * glstate_matrix_invtrans_modelview0)).xyz;
- highp vec4 tmpvar_14;
- tmpvar_14 = mix (tmpvar_1, tmpvar_13, vec4(isBillboard_8));
- tmpvar_5.w = pos_7.w;
- tmpvar_6.w = tmpvar_14.w;
- tmpvar_5.xyz = (pos_7.xyz * _Scale.xyz);
- highp vec4 pos_15;
- pos_15.w = tmpvar_5.w;
- highp vec3 bend_16;
- highp vec2 vWavesSum_17;
- highp vec4 vWaves_18;
- highp float fBranchPhase_19;
- fBranchPhase_19 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + tmpvar_3.x);
- highp vec2 tmpvar_20;
- tmpvar_20.x = dot (tmpvar_5.xyz, vec3((tmpvar_3.y + fBranchPhase_19)));
- tmpvar_20.y = fBranchPhase_19;
- vWaves_18 = ((fract(
- ((_Time.yy + tmpvar_20).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
- ) * 2.0) - 1.0);
- highp vec4 tmpvar_21;
- tmpvar_21 = abs(((
- fract((vWaves_18 + 0.5))
- * 2.0) - 1.0));
- highp vec4 tmpvar_22;
- tmpvar_22 = ((tmpvar_21 * tmpvar_21) * (3.0 - (2.0 * tmpvar_21)));
- vWaves_18 = tmpvar_22;
- vWavesSum_17 = (tmpvar_22.xz + tmpvar_22.yw);
- bend_16.xz = ((tmpvar_3.y * 0.1) * tmpvar_12).xz;
- bend_16.y = (_uv1.y * 0.3);
- pos_15.xyz = (tmpvar_5.xyz + ((
- (vWavesSum_17.xyx * bend_16)
- +
- ((_Wind.xyz * vWavesSum_17.y) * _uv1.y)
- ) * _Wind.w));
- pos_15.xyz = (pos_15.xyz + (_uv1.x * _Wind.xyz));
- highp vec3 tmpvar_23;
- tmpvar_23 = mix ((pos_15.xyz - (
- (dot (_SquashPlaneNormal.xyz, pos_15.xyz) + _SquashPlaneNormal.w)
- * _SquashPlaneNormal.xyz)), pos_15.xyz, vec3(_SquashAmount));
- highp vec4 tmpvar_24;
- tmpvar_24.w = 1.0;
- tmpvar_24.xyz = tmpvar_23;
- tmpvar_5 = tmpvar_24;
- highp vec4 tmpvar_25;
- tmpvar_25.xyz = vec3(1.0, 1.0, 1.0);
- tmpvar_25.w = tmpvar_3.w;
- highp vec3 tmpvar_26;
- tmpvar_26 = normalize(tmpvar_12);
- tmpvar_6.xyz = normalize(tmpvar_14.xyz);
- binormal_4 = (((tmpvar_26.yzx * tmpvar_6.zxy) - (tmpvar_26.zxy * tmpvar_6.yzx)) * tmpvar_14.w);
- highp mat3 tmpvar_27;
- tmpvar_27[uint(0)].x = tmpvar_6.x;
- tmpvar_27[uint(0)].y = binormal_4.x;
- tmpvar_27[uint(0)].z = tmpvar_26.x;
- tmpvar_27[1u].x = tmpvar_6.y;
- tmpvar_27[1u].y = binormal_4.y;
- tmpvar_27[1u].z = tmpvar_26.y;
- tmpvar_27[2u].x = tmpvar_6.z;
- tmpvar_27[2u].y = binormal_4.z;
- tmpvar_27[2u].z = tmpvar_26.z;
- highp vec4 tmpvar_28;
- tmpvar_28.w = 1.0;
- tmpvar_28.xyz = _WorldSpaceCameraPos;
- gl_Position = (glstate_matrix_mvp * tmpvar_24);
- xlv_TEXCOORD0 = ((_uv0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- xlv_COLOR0 = tmpvar_25;
- highp vec3 tmpvar_29;
- tmpvar_29 = (tmpvar_27 * (_World2Object * _WorldSpaceLightPos0).xyz);
- xlv_TEXCOORD1 = tmpvar_29;
- highp vec3 tmpvar_30;
- tmpvar_30 = (tmpvar_27 * ((
- (_World2Object * tmpvar_28)
- .xyz * unity_Scale.w) - tmpvar_23));
- xlv_TEXCOORD2 = tmpvar_30;
- highp vec2 tmpvar_31;
- tmpvar_31 = (_LightMatrix0 * (_Object2World * tmpvar_24)).xy;
- xlv_TEXCOORD3 = tmpvar_31;
-}
-
-
-// stats: 71 alu 0 tex 0 flow
-// inputs: 6
-// #0: _inVertex (high float) 4x1 [-1]
-// #1: _inNormal (medium float) 3x1 [-1]
-// #2: _uv0 (high float) 4x1 [-1]
-// #3: _uv1 (high float) 4x1 [-1]
-// #4: _color (low float) 4x1 [-1]
-// #5: TANGENT (medium float) 4x1 [-1]
-// uniforms: 14 (total size: 0)
-// #0: _LightMatrix0 (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _Scale (high float) 4x1 [-1]
-// #4: _SquashAmount (high float) 1x1 [-1]
-// #5: _SquashPlaneNormal (high float) 4x1 [-1]
-// #6: _Time (high float) 4x1 [-1]
-// #7: _Wind (high float) 4x1 [-1]
-// #8: _World2Object (high float) 4x4 [-1]
-// #9: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #10: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #11: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1]
-// #12: glstate_matrix_mvp (high float) 4x4 [-1]
-// #13: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3Metal.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3Metal.txt
deleted file mode 100644
index 5991e192410..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-treeleaf-outES3Metal.txt
+++ /dev/null
@@ -1,168 +0,0 @@
-#include <metal_stdlib>
-#pragma clang diagnostic ignored "-Wparentheses-equality"
-using namespace metal;
-struct xlatMtlShaderInput {
- float4 _inVertex [[attribute(0)]];
- half3 _inNormal [[attribute(1)]];
- float4 _uv0 [[attribute(2)]];
- float4 _uv1 [[attribute(3)]];
- half4 _color [[attribute(4)]];
- half4 TANGENT [[attribute(5)]];
-};
-struct xlatMtlShaderOutput {
- float4 gl_Position [[position]];
- float2 xlv_TEXCOORD0;
- half4 xlv_COLOR0;
- half3 xlv_TEXCOORD1;
- half3 xlv_TEXCOORD2;
- half2 xlv_TEXCOORD3;
-};
-struct xlatMtlShaderUniform {
- float4x4 _LightMatrix0;
- float4 _MainTex_ST;
- float4x4 _Object2World;
- float4 _Scale;
- float _SquashAmount;
- float4 _SquashPlaneNormal;
- float4 _Time;
- float4 _Wind;
- float4x4 _World2Object;
- float3 _WorldSpaceCameraPos;
- float4 _WorldSpaceLightPos0;
- float4x4 glstate_matrix_invtrans_modelview0;
- float4x4 glstate_matrix_mvp;
- float4 unity_Scale;
-};
-vertex xlatMtlShaderOutput xlatMtlMain (xlatMtlShaderInput _mtl_i [[stage_in]], constant xlatMtlShaderUniform& _mtl_u [[buffer(0)]])
-{
- xlatMtlShaderOutput _mtl_o;
- float4 tmpvar_1 = 0;
- float3 tmpvar_2 = 0;
- float4 tmpvar_3 = 0;
- tmpvar_1 = float4(_mtl_i.TANGENT);
- tmpvar_2 = float3(_mtl_i._inNormal);
- tmpvar_3 = float4(_mtl_i._color);
- float3 binormal_4 = 0;
- float4 tmpvar_5 = 0;
- float4 tmpvar_6 = 0;
- float4 pos_7 = 0;
- float isBillboard_8 = 0;
- isBillboard_8 = (1.0 - abs(tmpvar_1.w));
- float4 tmpvar_9 = 0;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = tmpvar_2;
- float4 tmpvar_10 = 0;
- tmpvar_10.w = 0.0;
- tmpvar_10.xyz = tmpvar_1.xyz;
- float4 tmpvar_11 = 0;
- tmpvar_11.zw = float2(0.0, 0.0);
- tmpvar_11.xy = tmpvar_2.xy;
- pos_7 = (_mtl_i._inVertex + ((tmpvar_11 * _mtl_u.glstate_matrix_invtrans_modelview0) * isBillboard_8));
- float3 tmpvar_12 = 0;
- tmpvar_12 = mix (tmpvar_2, normalize((tmpvar_9 * _mtl_u.glstate_matrix_invtrans_modelview0)).xyz, float3(isBillboard_8));
- float4 tmpvar_13 = 0;
- tmpvar_13.w = -1.0;
- tmpvar_13.xyz = normalize((tmpvar_10 * _mtl_u.glstate_matrix_invtrans_modelview0)).xyz;
- float4 tmpvar_14 = 0;
- tmpvar_14 = mix (tmpvar_1, tmpvar_13, float4(isBillboard_8));
- tmpvar_5.w = pos_7.w;
- tmpvar_6.w = tmpvar_14.w;
- tmpvar_5.xyz = (pos_7.xyz * _mtl_u._Scale.xyz);
- float4 pos_15 = 0;
- pos_15.w = tmpvar_5.w;
- float3 bend_16 = 0;
- float2 vWavesSum_17 = 0;
- float4 vWaves_18 = 0;
- float fBranchPhase_19 = 0;
- fBranchPhase_19 = (dot (_mtl_u._Object2World[3].xyz, float3(1.0, 1.0, 1.0)) + tmpvar_3.x);
- float2 tmpvar_20 = 0;
- tmpvar_20.x = dot (tmpvar_5.xyz, float3((tmpvar_3.y + fBranchPhase_19)));
- tmpvar_20.y = fBranchPhase_19;
- vWaves_18 = ((fract(
- ((_mtl_u._Time.yy + tmpvar_20).xxyy * float4(1.975, 0.793, 0.375, 0.193))
- ) * 2.0) - 1.0);
- float4 tmpvar_21 = 0;
- tmpvar_21 = abs(((
- fract((vWaves_18 + 0.5))
- * 2.0) - 1.0));
- float4 tmpvar_22 = 0;
- tmpvar_22 = ((tmpvar_21 * tmpvar_21) * (3.0 - (2.0 * tmpvar_21)));
- vWaves_18 = tmpvar_22;
- vWavesSum_17 = (tmpvar_22.xz + tmpvar_22.yw);
- bend_16.xz = ((tmpvar_3.y * 0.1) * tmpvar_12).xz;
- bend_16.y = (_mtl_i._uv1.y * 0.3);
- pos_15.xyz = (tmpvar_5.xyz + ((
- (vWavesSum_17.xyx * bend_16)
- +
- ((_mtl_u._Wind.xyz * vWavesSum_17.y) * _mtl_i._uv1.y)
- ) * _mtl_u._Wind.w));
- pos_15.xyz = (pos_15.xyz + (_mtl_i._uv1.x * _mtl_u._Wind.xyz));
- float3 tmpvar_23 = 0;
- tmpvar_23 = mix ((pos_15.xyz - (
- (dot (_mtl_u._SquashPlaneNormal.xyz, pos_15.xyz) + _mtl_u._SquashPlaneNormal.w)
- * _mtl_u._SquashPlaneNormal.xyz)), pos_15.xyz, float3(_mtl_u._SquashAmount));
- float4 tmpvar_24 = 0;
- tmpvar_24.w = 1.0;
- tmpvar_24.xyz = tmpvar_23;
- tmpvar_5 = tmpvar_24;
- float4 tmpvar_25 = 0;
- tmpvar_25.xyz = float3(1.0, 1.0, 1.0);
- tmpvar_25.w = tmpvar_3.w;
- float3 tmpvar_26 = 0;
- tmpvar_26 = normalize(tmpvar_12);
- tmpvar_6.xyz = normalize(tmpvar_14.xyz);
- binormal_4 = (((tmpvar_26.yzx * tmpvar_6.zxy) - (tmpvar_26.zxy * tmpvar_6.yzx)) * tmpvar_14.w);
- float3x3 tmpvar_27;
- tmpvar_27[0].x = tmpvar_6.x;
- tmpvar_27[0].y = binormal_4.x;
- tmpvar_27[0].z = tmpvar_26.x;
- tmpvar_27[1].x = tmpvar_6.y;
- tmpvar_27[1].y = binormal_4.y;
- tmpvar_27[1].z = tmpvar_26.y;
- tmpvar_27[2].x = tmpvar_6.z;
- tmpvar_27[2].y = binormal_4.z;
- tmpvar_27[2].z = tmpvar_26.z;
- float4 tmpvar_28 = 0;
- tmpvar_28.w = 1.0;
- tmpvar_28.xyz = _mtl_u._WorldSpaceCameraPos;
- _mtl_o.gl_Position = (_mtl_u.glstate_matrix_mvp * tmpvar_24);
- _mtl_o.xlv_TEXCOORD0 = ((_mtl_i._uv0.xy * _mtl_u._MainTex_ST.xy) + _mtl_u._MainTex_ST.zw);
- _mtl_o.xlv_COLOR0 = half4(tmpvar_25);
- float3 tmpvar_29 = 0;
- tmpvar_29 = (tmpvar_27 * (_mtl_u._World2Object * _mtl_u._WorldSpaceLightPos0).xyz);
- _mtl_o.xlv_TEXCOORD1 = half3(tmpvar_29);
- float3 tmpvar_30 = 0;
- tmpvar_30 = (tmpvar_27 * ((
- (_mtl_u._World2Object * tmpvar_28)
- .xyz * _mtl_u.unity_Scale.w) - tmpvar_23));
- _mtl_o.xlv_TEXCOORD2 = half3(tmpvar_30);
- float2 tmpvar_31 = 0;
- tmpvar_31 = (_mtl_u._LightMatrix0 * (_mtl_u._Object2World * tmpvar_24)).xy;
- _mtl_o.xlv_TEXCOORD3 = half2(tmpvar_31);
- return _mtl_o;
-}
-
-
-// stats: 71 alu 0 tex 0 flow
-// inputs: 6
-// #0: _inVertex (high float) 4x1 [-1] loc 0
-// #1: _inNormal (medium float) 3x1 [-1] loc 1
-// #2: _uv0 (high float) 4x1 [-1] loc 2
-// #3: _uv1 (high float) 4x1 [-1] loc 3
-// #4: _color (low float) 4x1 [-1] loc 4
-// #5: TANGENT (medium float) 4x1 [-1] loc 5
-// uniforms: 14 (total size: 464)
-// #0: _LightMatrix0 (high float) 4x4 [-1] loc 0
-// #1: _MainTex_ST (high float) 4x1 [-1] loc 64
-// #2: _Object2World (high float) 4x4 [-1] loc 80
-// #3: _Scale (high float) 4x1 [-1] loc 144
-// #4: _SquashAmount (high float) 1x1 [-1] loc 160
-// #5: _SquashPlaneNormal (high float) 4x1 [-1] loc 176
-// #6: _Time (high float) 4x1 [-1] loc 192
-// #7: _Wind (high float) 4x1 [-1] loc 208
-// #8: _World2Object (high float) 4x4 [-1] loc 224
-// #9: _WorldSpaceCameraPos (high float) 3x1 [-1] loc 288
-// #10: _WorldSpaceLightPos0 (high float) 4x1 [-1] loc 304
-// #11: glstate_matrix_invtrans_modelview0 (high float) 4x4 [-1] loc 320
-// #12: glstate_matrix_mvp (high float) 4x4 [-1] loc 384
-// #13: unity_Scale (high float) 4x1 [-1] loc 448
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-in.txt
deleted file mode 100644
index 3fda534cfdd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-in.txt
+++ /dev/null
@@ -1,109 +0,0 @@
-mat3 xll_constructMat3_mf4x4( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct VertexOutput {
- vec4 pos;
- vec4 tex;
- vec4 posWorld;
- vec3 normalWorld;
- vec4 tangentWorld;
- vec3 extra;
- vec4 _ShadowCoord;
- vec3 lightDir;
-};
-struct VertexInput {
- vec4 vertex;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 tangent;
-};
-uniform vec4 _ProjectionParams;
-uniform vec4 _ScreenParams;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 unity_Scale;
-uniform mat4 glstate_matrix_transpose_modelview0;
-
-uniform samplerCube _Cube;
-uniform sampler2D _MainTex;
-uniform vec4 _MainTex_ST;
-uniform sampler2D _DetailAlbedoMap;
-uniform vec4 _DetailAlbedoMap_ST;
-uniform sampler2D _AlphaMap;
-uniform sampler2D _Occlusion;
-uniform sampler2D _DetailNormalMap;
-uniform vec4 _DetailNormalMap_ST;
-uniform float _DetailNormalMapScale;
-uniform sampler2D _BumpMap;
-uniform float _BumpScale;
-uniform float _Exposure;
-uniform float _DetailBumpScale;
-uniform float _AlphaTestRef;
-uniform float _DetailBumpTiling;
-uniform vec4 _Color;
-uniform vec4 _SpecularColor;
-uniform sampler2D _SpecGlossMap;
-uniform float _Glossiness;
-
-uniform vec4 unity_ColorSpaceGrey;
-
-uniform vec4 _LightColor0;
-
-uniform samplerCube _SpecCube;
-uniform vec4 unity_LightmapST;
-uniform sampler2D unity_Lightmap;
-uniform sampler2D unity_LightmapInd;
-uniform float _SelfIllumScale;
-uniform sampler2D _SelfIllum;
-
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o = (pos * 0.5);
- o.xy = (vec2( o.x, (o.y * _ProjectionParams.x)) + o.w);
- o.zw = pos.zw;
- return o;
-}
-
-VertexOutput vert( in VertexInput v ) {
- VertexOutput o;
- o.posWorld = (_Object2World * v.vertex);
- o.pos = (gl_ModelViewProjectionMatrix * v.vertex);
- o.tex = v.texcoord;
- o.tex.xy = ((v.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- o.tex.zw = ((v.texcoord.xy * _DetailAlbedoMap_ST.xy) + _DetailAlbedoMap_ST.zw);
- o.normalWorld = normalize((xll_constructMat3_mf4x4( _Object2World) * v.normal));
- o.tangentWorld = vec4( (xll_constructMat3_mf4x4( _Object2World) * v.tangent.xyz), v.tangent.w);
- o.tangentWorld.xyz = normalize(o.tangentWorld.xyz);
- o._ShadowCoord = ComputeScreenPos( o.pos);
- o.extra.xy = ((v.texcoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
- o.extra.z = 0.0;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_TEXCOORD0;
-varying vec4 xlv_TEXCOORD1;
-varying vec3 xlv_TEXCOORD2;
-varying vec4 xlv_TEXCOORD3;
-varying vec3 xlv_TEXCOORD4;
-varying vec4 xlv_TEXCOORD5;
-varying vec3 xlv_TEXCOORD7;
-void main() {
- VertexOutput xl_retval;
- VertexInput xlt_v;
- xlt_v.vertex = vec4(gl_Vertex);
- xlt_v.normal = vec3(gl_Normal);
- xlt_v.texcoord = vec4(gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4(gl_MultiTexCoord1);
- xlt_v.tangent = vec4(TANGENT);
- xl_retval = vert( xlt_v);
- gl_Position = vec4(xl_retval.pos);
- xlv_TEXCOORD0 = vec4(xl_retval.tex);
- xlv_TEXCOORD1 = vec4(xl_retval.posWorld);
- xlv_TEXCOORD2 = vec3(xl_retval.normalWorld);
- xlv_TEXCOORD3 = vec4(xl_retval.tangentWorld);
- xlv_TEXCOORD4 = vec3(xl_retval.extra);
- xlv_TEXCOORD5 = vec4(xl_retval._ShadowCoord);
- xlv_TEXCOORD7 = vec3(xl_retval.lightDir);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-out.txt
deleted file mode 100644
index 4b59ad6c280..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/z-unishader-dirlm-out.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-uniform vec4 _ProjectionParams;
-uniform mat4 _Object2World;
-uniform vec4 _MainTex_ST;
-uniform vec4 _DetailAlbedoMap_ST;
-uniform vec4 unity_LightmapST;
-attribute vec4 TANGENT;
-varying vec4 xlv_TEXCOORD0;
-varying vec4 xlv_TEXCOORD1;
-varying vec3 xlv_TEXCOORD2;
-varying vec4 xlv_TEXCOORD3;
-varying vec3 xlv_TEXCOORD4;
-varying vec4 xlv_TEXCOORD5;
-varying vec3 xlv_TEXCOORD7;
-void main ()
-{
- vec4 tmpvar_1;
- vec4 tmpvar_2;
- vec4 tmpvar_3;
- vec3 tmpvar_4;
- vec3 tmpvar_5;
- tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _DetailAlbedoMap_ST.xy) + _DetailAlbedoMap_ST.zw);
- mat3 tmpvar_6;
- tmpvar_6[0] = _Object2World[0].xyz;
- tmpvar_6[1] = _Object2World[1].xyz;
- tmpvar_6[2] = _Object2World[2].xyz;
- mat3 tmpvar_7;
- tmpvar_7[0] = _Object2World[0].xyz;
- tmpvar_7[1] = _Object2World[1].xyz;
- tmpvar_7[2] = _Object2World[2].xyz;
- vec4 tmpvar_8;
- tmpvar_8.xyz = (tmpvar_7 * TANGENT.xyz);
- tmpvar_8.w = TANGENT.w;
- tmpvar_3.w = tmpvar_8.w;
- tmpvar_3.xyz = normalize(tmpvar_8.xyz);
- vec4 o_9;
- vec4 tmpvar_10;
- tmpvar_10 = (tmpvar_1 * 0.5);
- vec2 tmpvar_11;
- tmpvar_11.x = tmpvar_10.x;
- tmpvar_11.y = (tmpvar_10.y * _ProjectionParams.x);
- o_9.xy = (tmpvar_11 + tmpvar_10.w);
- o_9.zw = tmpvar_1.zw;
- tmpvar_4.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
- tmpvar_4.z = 0.0;
- gl_Position = tmpvar_1;
- xlv_TEXCOORD0 = tmpvar_2;
- xlv_TEXCOORD1 = (_Object2World * gl_Vertex);
- xlv_TEXCOORD2 = normalize((tmpvar_6 * gl_Normal));
- xlv_TEXCOORD3 = tmpvar_3;
- xlv_TEXCOORD4 = tmpvar_4;
- xlv_TEXCOORD5 = o_9;
- xlv_TEXCOORD7 = tmpvar_5;
-}
-
-
-// stats: 16 alu 0 tex 0 flow
-// inputs: 5
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// #4: TANGENT (high float) 4x1 [-1]
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _ProjectionParams (high float) 4x1 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _DetailAlbedoMap_ST (high float) 4x1 [-1]
-// #5: unity_LightmapST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-in.txt
deleted file mode 100644
index 845bc9d1641..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-in.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- vec2 hip_pack0;
- vec3 TtoV0;
- vec3 TtoV1;
- vec3 TtoV2;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-
-
-v2f_surf vert_surf( in appdata_full v );
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.hip_pack0.xy = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.TtoV0 = ( rotation * xll_constructMat3( gl_ModelViewMatrixInverseTranspose)[ 0 ].xyz );
- o.TtoV1 = ( rotation * xll_constructMat3( gl_ModelViewMatrixInverseTranspose)[ 1 ].xyz );
- o.TtoV2 = ( rotation * xll_constructMat3( gl_ModelViewMatrixInverseTranspose)[ 2 ].xyz );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.TtoV0, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.TtoV1, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.TtoV2, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-out.txt
deleted file mode 100644
index d1e731e7736..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse-out.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-uniform vec4 _BumpMap_ST;
-attribute vec4 TANGENT;
-void main ()
-{
- vec3 binormal_1;
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_2;
- tmpvar_2[0].x = TANGENT.x;
- tmpvar_2[0].y = binormal_1.x;
- tmpvar_2[0].z = gl_Normal.x;
- tmpvar_2[1].x = TANGENT.y;
- tmpvar_2[1].y = binormal_1.y;
- tmpvar_2[1].z = gl_Normal.y;
- tmpvar_2[2].x = TANGENT.z;
- tmpvar_2[2].y = binormal_1.z;
- tmpvar_2[2].z = gl_Normal.z;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_3;
- tmpvar_3.zw = vec2(0.0, 0.0);
- tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- gl_TexCoord[0] = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.w = 0.0;
- tmpvar_4.xyz = (tmpvar_2 * gl_ModelViewMatrixInverseTranspose[0].xyz);
- gl_TexCoord[1] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * gl_ModelViewMatrixInverseTranspose[1].xyz);
- gl_TexCoord[2] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = (tmpvar_2 * gl_ModelViewMatrixInverseTranspose[2].xyz);
- gl_TexCoord[3] = tmpvar_6;
-}
-
-
-// stats: 14 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 3 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: _BumpMap_ST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-in.txt
deleted file mode 100644
index d4dfb2f5a6b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-in.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-out.txt
deleted file mode 100644
index d66048d5993..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Diffuse1-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_2;
- o_2 = (pos_1 * 0.5);
- vec2 tmpvar_3;
- tmpvar_3.x = o_2.x;
- tmpvar_3.y = (o_2.y * _ProjectionParams.x);
- o_2.xy = (tmpvar_3 + o_2.w);
- o_2.zw = pos_1.zw;
- gl_Position = pos_1;
- vec4 tmpvar_4;
- tmpvar_4.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_4.x = pos_1.z;
- xlv_FOG = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.zw = vec2(0.0, 0.0);
- tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_5;
- gl_TexCoord[1] = o_2;
-}
-
-
-// stats: 8 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 3 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _ProjectionParams (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-in.txt
deleted file mode 100644
index 230f6c882a2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-in.txt
+++ /dev/null
@@ -1,188 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec3 vlight;
- vec4 _ShadowCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_4LightAtten0;
-uniform vec4 unity_4LightPosX0;
-uniform vec4 unity_4LightPosY0;
-uniform vec4 unity_4LightPosZ0;
-uniform vec3 unity_LightColor0;
-uniform vec3 unity_LightColor1;
-uniform vec3 unity_LightColor2;
-uniform vec3 unity_LightColor3;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-vec3 ShadeSH9( in vec4 normal );
-vec3 Shade4PointLights( in vec4 lightPosX, in vec4 lightPosY, in vec4 lightPosZ, in vec3 lightColor0, in vec3 lightColor1, in vec3 lightColor2, in vec3 lightColor3, in vec4 lightAttenSq, in vec3 pos, in vec3 normal );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-vec3 ShadeSH9( in vec4 normal ) {
- vec3 x1;
- vec4 vB;
- vec3 x2;
- float vC;
- vec3 x3;
- x1.x = dot( unity_SHAr, normal);
- x1.y = dot( unity_SHAg, normal);
- x1.z = dot( unity_SHAb, normal);
- vB = (normal.xyzz * normal.yzzx );
- x2.x = dot( unity_SHBr, vB);
- x2.y = dot( unity_SHBg, vB);
- x2.z = dot( unity_SHBb, vB);
- vC = ((normal.x * normal.x ) - (normal.y * normal.y ));
- x3 = (unity_SHC.xyz * vC);
- return ((x1 + x2) + x3);
-}
-vec3 Shade4PointLights( in vec4 lightPosX, in vec4 lightPosY, in vec4 lightPosZ, in vec3 lightColor0, in vec3 lightColor1, in vec3 lightColor2, in vec3 lightColor3, in vec4 lightAttenSq, in vec3 pos, in vec3 normal ) {
- vec4 toLightX;
- vec4 toLightY;
- vec4 toLightZ;
- vec4 lengthSq;
- vec4 ndotl;
- vec4 corr;
- vec4 atten;
- vec4 diff;
- vec3 col;
- toLightX = (lightPosX - pos.x );
- toLightY = (lightPosY - pos.y );
- toLightZ = (lightPosZ - pos.z );
- lengthSq = vec4( 0.000000);
- lengthSq += (toLightX * toLightX);
- lengthSq += (toLightY * toLightY);
- lengthSq += (toLightZ * toLightZ);
- ndotl = vec4( 0.000000);
- ndotl += (toLightX * normal.x );
- ndotl += (toLightY * normal.y );
- ndotl += (toLightZ * normal.z );
- corr = inversesqrt( lengthSq );
- ndotl = max( vec4( 0.000000, 0.000000, 0.000000, 0.000000), (ndotl * corr));
- atten = (1.00000 / (1.00000 + (lengthSq * lightAttenSq)));
- diff = (ndotl * atten);
- col = vec3( 0.000000);
- col += (lightColor0 * diff.x );
- col += (lightColor1 * diff.y );
- col += (lightColor2 * diff.z );
- col += (lightColor3 * diff.w );
- return col;
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return objSpaceLightPos.xyz ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 worldN;
- vec3 binormal;
- mat3 rotation;
- vec3 shlight;
- vec3 worldPos;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- worldN = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- shlight = ShadeSH9( vec4( worldN, 1.00000));
- o.vlight = shlight;
- worldPos = ( _Object2World * v.vertex ).xyz ;
- o.vlight += Shade4PointLights( unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, unity_LightColor0, unity_LightColor1, unity_LightColor2, unity_LightColor3, unity_4LightAtten0, worldPos, worldN);
- o._ShadowCoord = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.vlight, 0.0);
- gl_TexCoord[4] = vec4( xl_retval._ShadowCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-out.txt
deleted file mode 100644
index c32d58fedeb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular-out.txt
+++ /dev/null
@@ -1,158 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_4LightAtten0;
-uniform vec4 unity_4LightPosX0;
-uniform vec4 unity_4LightPosY0;
-uniform vec4 unity_4LightPosZ0;
-uniform vec3 unity_LightColor0;
-uniform vec3 unity_LightColor1;
-uniform vec3 unity_LightColor2;
-uniform vec3 unity_LightColor3;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 worldPos_1;
- vec3 binormal_2;
- vec3 worldN_3;
- vec4 tmpvar_4;
- vec4 pos_5;
- pos_5 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_4.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- mat3 tmpvar_6;
- tmpvar_6[0] = _Object2World[0].xyz;
- tmpvar_6[1] = _Object2World[1].xyz;
- tmpvar_6[2] = _Object2World[2].xyz;
- worldN_3 = (tmpvar_6 * (gl_Normal * unity_Scale.w));
- binormal_2 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_7;
- tmpvar_7[0].x = TANGENT.x;
- tmpvar_7[0].y = binormal_2.x;
- tmpvar_7[0].z = gl_Normal.x;
- tmpvar_7[1].x = TANGENT.y;
- tmpvar_7[1].y = binormal_2.y;
- tmpvar_7[1].z = gl_Normal.y;
- tmpvar_7[2].x = TANGENT.z;
- tmpvar_7[2].y = binormal_2.z;
- tmpvar_7[2].z = gl_Normal.z;
- vec4 tmpvar_8;
- tmpvar_8.w = 1.0;
- tmpvar_8.xyz = _WorldSpaceCameraPos;
- vec4 tmpvar_9;
- tmpvar_9.w = 1.0;
- tmpvar_9.xyz = worldN_3;
- vec3 x2_10;
- vec4 vB_11;
- vec3 x1_12;
- x1_12.x = dot (unity_SHAr, tmpvar_9);
- x1_12.y = dot (unity_SHAg, tmpvar_9);
- x1_12.z = dot (unity_SHAb, tmpvar_9);
- vB_11 = (worldN_3.xyzz * worldN_3.yzzx);
- x2_10.x = dot (unity_SHBr, vB_11);
- x2_10.y = dot (unity_SHBg, vB_11);
- x2_10.z = dot (unity_SHBb, vB_11);
- worldPos_1 = (_Object2World * gl_Vertex).xyz;
- vec3 col_13;
- vec4 diff_14;
- vec4 ndotl_15;
- vec4 lengthSq_16;
- vec4 toLightZ_17;
- vec4 toLightY_18;
- vec4 toLightX_19;
- toLightX_19 = (unity_4LightPosX0 - worldPos_1.x);
- toLightY_18 = (unity_4LightPosY0 - worldPos_1.y);
- toLightZ_17 = (unity_4LightPosZ0 - worldPos_1.z);
- lengthSq_16 = (toLightX_19 * toLightX_19);
- lengthSq_16 = (lengthSq_16 + (toLightY_18 * toLightY_18));
- lengthSq_16 = (lengthSq_16 + (toLightZ_17 * toLightZ_17));
- ndotl_15 = (toLightX_19 * worldN_3.x);
- ndotl_15 = (ndotl_15 + (toLightY_18 * worldN_3.y));
- ndotl_15 = (ndotl_15 + (toLightZ_17 * worldN_3.z));
- vec4 tmpvar_20;
- tmpvar_20 = max (vec4(0.0, 0.0, 0.0, 0.0), (ndotl_15 * inversesqrt(lengthSq_16)));
- ndotl_15 = tmpvar_20;
- diff_14 = (tmpvar_20 * (1.0/((1.0 +
- (lengthSq_16 * unity_4LightAtten0)
- ))));
- col_13 = (unity_LightColor0 * diff_14.x);
- col_13 = (col_13 + (unity_LightColor1 * diff_14.y));
- col_13 = (col_13 + (unity_LightColor2 * diff_14.z));
- col_13 = (col_13 + (unity_LightColor3 * diff_14.w));
- vec4 o_21;
- o_21 = (pos_5 * 0.5);
- vec2 tmpvar_22;
- tmpvar_22.x = o_21.x;
- tmpvar_22.y = (o_21.y * _ProjectionParams.x);
- o_21.xy = (tmpvar_22 + o_21.w);
- o_21.zw = pos_5.zw;
- gl_Position = pos_5;
- vec4 tmpvar_23;
- tmpvar_23.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_23.x = pos_5.z;
- xlv_FOG = tmpvar_23;
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_24;
- tmpvar_24.w = 0.0;
- tmpvar_24.xyz = (tmpvar_7 * ((
- (_World2Object * tmpvar_8)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_24;
- vec4 tmpvar_25;
- tmpvar_25.w = 0.0;
- tmpvar_25.xyz = (tmpvar_7 * (_World2Object * _WorldSpaceLightPos0).xyz);
- gl_TexCoord[2] = tmpvar_25;
- vec4 tmpvar_26;
- tmpvar_26.w = 0.0;
- tmpvar_26.xyz = (((x1_12 + x2_10) + (unity_SHC.xyz *
- ((worldN_3.x * worldN_3.x) - (worldN_3.y * worldN_3.y))
- )) + col_13);
- gl_TexCoord[3] = tmpvar_26;
- gl_TexCoord[4] = o_21;
-}
-
-
-// stats: 68 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 24 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _ProjectionParams (high float) 4x1 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #8: unity_4LightAtten0 (high float) 4x1 [-1]
-// #9: unity_4LightPosX0 (high float) 4x1 [-1]
-// #10: unity_4LightPosY0 (high float) 4x1 [-1]
-// #11: unity_4LightPosZ0 (high float) 4x1 [-1]
-// #12: unity_LightColor0 (high float) 3x1 [-1]
-// #13: unity_LightColor1 (high float) 3x1 [-1]
-// #14: unity_LightColor2 (high float) 3x1 [-1]
-// #15: unity_LightColor3 (high float) 3x1 [-1]
-// #16: unity_SHAb (high float) 4x1 [-1]
-// #17: unity_SHAg (high float) 4x1 [-1]
-// #18: unity_SHAr (high float) 4x1 [-1]
-// #19: unity_SHBb (high float) 4x1 [-1]
-// #20: unity_SHBg (high float) 4x1 [-1]
-// #21: unity_SHBr (high float) 4x1 [-1]
-// #22: unity_SHC (high float) 4x1 [-1]
-// #23: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-in.txt
deleted file mode 100644
index 2b6a86c762c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-in.txt
+++ /dev/null
@@ -1,87 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-
-
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- o.hip_lmapFade.xy = ((v.texcoord1.xy * unity_LightmapST.xy ) + unity_LightmapST.zw );
- o.hip_lmapFade.z = ((( -( gl_ModelViewMatrix * v.vertex ).z ) * unity_LightmapFade.z ) + unity_LightmapFade.w );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
- gl_TexCoord[2] = vec4( xl_retval.hip_lmapFade, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-out.txt
deleted file mode 100644
index 1ddacd6355c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Bumped_Specular2-out.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 tmpvar_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_3;
- o_3 = (pos_2 * 0.5);
- vec2 tmpvar_4;
- tmpvar_4.x = o_3.x;
- tmpvar_4.y = (o_3.y * _ProjectionParams.x);
- o_3.xy = (tmpvar_4 + o_3.w);
- o_3.zw = pos_2.zw;
- tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
- tmpvar_1.z = ((-(
- (gl_ModelViewMatrix * gl_Vertex)
- .z) * unity_LightmapFade.z) + unity_LightmapFade.w);
- gl_Position = pos_2;
- vec4 tmpvar_5;
- tmpvar_5.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_5.x = pos_2.z;
- xlv_FOG = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.zw = vec2(0.0, 0.0);
- tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_6;
- gl_TexCoord[1] = o_3;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = tmpvar_1;
- gl_TexCoord[2] = tmpvar_7;
-}
-
-
-// stats: 15 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
-// #4: unity_LightmapFade (high float) 4x1 [-1]
-// #5: unity_LightmapST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-in.txt
deleted file mode 100644
index d97bb6ad20f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-in.txt
+++ /dev/null
@@ -1,88 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_DecalTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 normal;
- vec3 lightDir;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _DecalTex_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return _WorldSpaceLightPos0.xyz ;
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _DecalTex_ST.xy ) + _DecalTex_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-out.txt
deleted file mode 100644
index 5dadf0873fc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Decal-out.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-uniform vec4 _DecalTex_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 tmpvar_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _DecalTex_ST.xy) + _DecalTex_ST.zw);
- mat3 tmpvar_3;
- tmpvar_3[0] = _Object2World[0].xyz;
- tmpvar_3[1] = _Object2World[1].xyz;
- tmpvar_3[2] = _Object2World[2].xyz;
- gl_Position = pos_2;
- vec4 tmpvar_4;
- tmpvar_4.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_4.x = pos_2.z;
- xlv_FOG = tmpvar_4;
- gl_TexCoord[0] = tmpvar_1;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_3 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = _WorldSpaceLightPos0.xyz;
- gl_TexCoord[2] = tmpvar_6;
-}
-
-
-// stats: 10 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _DecalTex_ST (high float) 4x1 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #5: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-in.txt
deleted file mode 100644
index 95f21641124..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-in.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-out.txt
deleted file mode 100644
index 37a13a0d893..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse-out.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- vec4 tmpvar_7;
- tmpvar_7 = (_Object2World * gl_Vertex);
- tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz);
- gl_TexCoord[2] = tmpvar_6;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (_LightMatrix0 * tmpvar_7).xyz;
- gl_TexCoord[3] = tmpvar_8;
-}
-
-
-// stats: 13 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #5: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-in.txt
deleted file mode 100644
index d531ecd7b47..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-in.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-
-
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- o.hip_lmapFade.xy = ((v.texcoord1.xy * unity_LightmapST.xy ) + unity_LightmapST.zw );
- o.hip_lmapFade.z = ((( -( gl_ModelViewMatrix * v.vertex ).z ) * unity_LightmapFade.z ) + unity_LightmapFade.w );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
- gl_TexCoord[2] = vec4( xl_retval.hip_lmapFade, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-out.txt
deleted file mode 100644
index 1ddacd6355c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse2-out.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 tmpvar_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_3;
- o_3 = (pos_2 * 0.5);
- vec2 tmpvar_4;
- tmpvar_4.x = o_3.x;
- tmpvar_4.y = (o_3.y * _ProjectionParams.x);
- o_3.xy = (tmpvar_4 + o_3.w);
- o_3.zw = pos_2.zw;
- tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
- tmpvar_1.z = ((-(
- (gl_ModelViewMatrix * gl_Vertex)
- .z) * unity_LightmapFade.z) + unity_LightmapFade.w);
- gl_Position = pos_2;
- vec4 tmpvar_5;
- tmpvar_5.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_5.x = pos_2.z;
- xlv_FOG = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.zw = vec2(0.0, 0.0);
- tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_6;
- gl_TexCoord[1] = o_3;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = tmpvar_1;
- gl_TexCoord[2] = tmpvar_7;
-}
-
-
-// stats: 15 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
-// #4: unity_LightmapFade (high float) 4x1 [-1]
-// #5: unity_LightmapST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt
deleted file mode 100644
index 6af216a7c93..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-in.txt
+++ /dev/null
@@ -1,107 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 vlight;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-vec3 ShadeSH9( in vec4 normal );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 ShadeSH9( in vec4 normal ) {
- vec3 x1;
- vec4 vB;
- vec3 x2;
- float vC;
- vec3 x3;
- x1.x = dot( unity_SHAr, normal);
- x1.y = dot( unity_SHAg, normal);
- x1.z = dot( unity_SHAb, normal);
- vB = (normal.xyzz * normal.yzzx );
- x2.x = dot( unity_SHBr, vB);
- x2.y = dot( unity_SHBg, vB);
- x2.z = dot( unity_SHBb, vB);
- vC = ((normal.x * normal.x ) - (normal.y * normal.y ));
- x3 = (unity_SHC.xyz * vC);
- return ((x1 + x2) + x3);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 worldN;
- vec3 shlight;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- worldN = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.normal = worldN;
- shlight = ShadeSH9( vec4( worldN, 1.00000));
- o.vlight = shlight;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.vlight, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt
deleted file mode 100644
index a9a64b26662..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Diffuse_Alpha_Shadowed_ZWrite-out.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 worldN_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_3;
- tmpvar_3[0] = _Object2World[0].xyz;
- tmpvar_3[1] = _Object2World[1].xyz;
- tmpvar_3[2] = _Object2World[2].xyz;
- worldN_1 = (tmpvar_3 * (gl_Normal * unity_Scale.w));
- vec4 tmpvar_4;
- tmpvar_4.w = 1.0;
- tmpvar_4.xyz = worldN_1;
- vec3 x2_5;
- vec4 vB_6;
- vec3 x1_7;
- x1_7.x = dot (unity_SHAr, tmpvar_4);
- x1_7.y = dot (unity_SHAg, tmpvar_4);
- x1_7.z = dot (unity_SHAb, tmpvar_4);
- vB_6 = (worldN_1.xyzz * worldN_1.yzzx);
- x2_5.x = dot (unity_SHBr, vB_6);
- x2_5.y = dot (unity_SHBg, vB_6);
- x2_5.z = dot (unity_SHBb, vB_6);
- gl_Position = pos_2;
- vec4 tmpvar_8;
- tmpvar_8.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_8.x = pos_2.z;
- xlv_FOG = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.zw = vec2(0.0, 0.0);
- tmpvar_9.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_9;
- vec4 tmpvar_10;
- tmpvar_10.w = 0.0;
- tmpvar_10.xyz = worldN_1;
- gl_TexCoord[1] = tmpvar_10;
- vec4 tmpvar_11;
- tmpvar_11.w = 0.0;
- tmpvar_11.xyz = ((x1_7 + x2_5) + (unity_SHC.xyz * (
- (worldN_1.x * worldN_1.x)
- -
- (worldN_1.y * worldN_1.y)
- )));
- gl_TexCoord[2] = tmpvar_11;
-}
-
-
-// stats: 23 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 11 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: unity_SHAb (high float) 4x1 [-1]
-// #4: unity_SHAg (high float) 4x1 [-1]
-// #5: unity_SHAr (high float) 4x1 [-1]
-// #6: unity_SHBb (high float) 4x1 [-1]
-// #7: unity_SHBg (high float) 4x1 [-1]
-// #8: unity_SHBr (high float) 4x1 [-1]
-// #9: unity_SHC (high float) 4x1 [-1]
-// #10: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-in.txt
deleted file mode 100644
index 98c25b20143..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-in.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 uvgrab;
- vec2 uvbump;
- vec2 uvmain;
-};
-struct appdata_t {
- vec4 vertex;
- vec2 texcoord;
-};
-
-
-
-vec2 MultiplyUV( in mat4 mat, in vec2 inUV );
-v2f vert( in appdata_t v );
-vec2 MultiplyUV( in mat4 mat, in vec2 inUV ) {
- vec4 temp;
- temp = vec4( inUV.x , inUV.y , 0.000000, 0.000000);
- temp = ( mat * temp );
- return temp.xy ;
-}
-v2f vert( in appdata_t v ) {
- v2f o;
- float scale = 1.00000;
- o.vertex = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.uvgrab.xy = ((vec2( o.vertex.x , (o.vertex.y * scale)) + o.vertex.w ) * 0.500000);
- o.uvgrab.zw = o.vertex.zw ;
- o.uvbump = MultiplyUV( gl_TextureMatrix[1], v.texcoord);
- o.uvmain = MultiplyUV( gl_TextureMatrix[2], v.texcoord);
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata_t xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.texcoord = vec2( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.vertex);
- gl_TexCoord[0] = vec4( xl_retval.uvgrab);
- gl_TexCoord[1] = vec4( xl_retval.uvbump, 0.0, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.uvmain, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-out.txt
deleted file mode 100644
index 8e0ddac91d5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Glass_Stained_BumpDistort-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-void main ()
-{
- vec2 tmpvar_1;
- tmpvar_1 = gl_MultiTexCoord0.xy;
- vec4 tmpvar_2;
- vec4 tmpvar_3;
- tmpvar_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_3.xy = ((tmpvar_2.xy + tmpvar_2.w) * 0.5);
- tmpvar_3.zw = tmpvar_2.zw;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = tmpvar_1;
- vec4 tmpvar_5;
- tmpvar_5.zw = vec2(0.0, 0.0);
- tmpvar_5.xy = tmpvar_1;
- gl_Position = tmpvar_2;
- gl_TexCoord[0] = tmpvar_3;
- vec4 tmpvar_6;
- tmpvar_6.zw = vec2(0.0, 0.0);
- tmpvar_6.xy = (gl_TextureMatrix[1] * tmpvar_4).xy;
- gl_TexCoord[1] = tmpvar_6;
- vec4 tmpvar_7;
- tmpvar_7.zw = vec2(0.0, 0.0);
- tmpvar_7.xy = (gl_TextureMatrix[2] * tmpvar_5).xy;
- gl_TexCoord[2] = tmpvar_7;
-}
-
-
-// stats: 9 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: gl_TextureMatrix (high float) 4x4 [16]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-in.txt
deleted file mode 100644
index ad02d50cd70..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-in.txt
+++ /dev/null
@@ -1,64 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- float fog;
- vec2 bumpuv[2];
- vec3 viewDir;
-};
-struct appdata {
- vec4 vertex;
- vec3 normal;
-};
-uniform vec4 _WaveOffset;
-uniform float _WaveScale;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-v2f vert( in appdata v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-v2f vert( in appdata v ) {
- v2f o;
- vec4 temp;
- PositionFog( v.vertex, o.pos, o.fog);
- temp.xyzw = ((v.vertex.xzxz * _WaveScale) + _WaveOffset);
- o.bumpuv[ 0 ] = (temp.xy * vec2( 0.400000, 0.450000));
- o.bumpuv[ 1 ] = temp.wz ;
- o.viewDir.xzy = normalize( ObjSpaceViewDir( v.vertex) );
- return o;
-}
-varying vec4 xlv_FOG;
-void main() {
- v2f xl_retval;
- appdata xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.normal = vec3( gl_Normal);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.bumpuv[0], 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.bumpuv[1], 0.0, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.viewDir, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-out.txt
deleted file mode 100644
index 489b359e691..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-FX_Water_(simple)-out.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-uniform vec4 _WaveOffset;
-uniform float _WaveScale;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 temp_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- temp_1 = ((gl_Vertex.xzxz * _WaveScale) + _WaveOffset);
- vec4 tmpvar_3;
- tmpvar_3.w = 1.0;
- tmpvar_3.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_2;
- vec4 tmpvar_4;
- tmpvar_4.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_4.x = pos_2.z;
- xlv_FOG = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.zw = vec2(0.0, 0.0);
- tmpvar_5.xy = (temp_1.xy * vec2(0.4, 0.45));
- gl_TexCoord[0] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.zw = vec2(0.0, 0.0);
- tmpvar_6.xy = temp_1.wz;
- gl_TexCoord[1] = tmpvar_6;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = normalize(((
- (_World2Object * tmpvar_3)
- .xyz * unity_Scale.w) - gl_Vertex.xyz)).xzy;
- gl_TexCoord[2] = tmpvar_7;
-}
-
-
-// stats: 13 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _WaveOffset (high float) 4x1 [-1]
-// #2: _WaveScale (high float) 1x1 [-1]
-// #3: _World2Object (high float) 4x4 [-1]
-// #4: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #5: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-in.txt
deleted file mode 100644
index d0b9184409f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-in.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 uv;
-};
-
-v2f vert( in vec4 vertex, in vec2 uv );
-v2f vert( in vec4 vertex, in vec2 uv ) {
- v2f o;
- float scale = 1.00000;
- o.vertex = ( gl_ModelViewProjectionMatrix * vertex );
- o.uv.xy = ((vec2( o.vertex.x , (o.vertex.y * scale)) + o.vertex.w ) * 0.500000);
- o.uv.zw = o.vertex.zw ;
- return o;
-}
-void main() {
- v2f xl_retval;
- xl_retval = vert( vec4(gl_Vertex), vec2(gl_MultiTexCoord0));
- gl_Position = vec4( xl_retval.vertex);
- gl_TexCoord[0] = vec4( xl_retval.uv);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-out.txt
deleted file mode 100644
index 7e3a01ecb5c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Grab_Invert-out.txt
+++ /dev/null
@@ -1,17 +0,0 @@
-void main ()
-{
- vec4 tmpvar_1;
- vec4 tmpvar_2;
- tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((tmpvar_1.xy + tmpvar_1.w) * 0.5);
- tmpvar_2.zw = tmpvar_1.zw;
- gl_Position = tmpvar_1;
- gl_TexCoord[0] = tmpvar_2;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 1 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-in.txt
deleted file mode 100644
index 1e5fde83a8a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-in.txt
+++ /dev/null
@@ -1,77 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec4 nz;
-};
-struct appdata {
- vec4 vertex;
- vec3 normal;
- vec4 color;
- vec4 texcoord;
-};
-uniform vec4 _ProjectionParams;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-
-
-
-vec4 Squash( in vec4 pos );
-void TerrainAnimateTree( inout vec4 pos, in float alpha );
-v2f vert( in appdata v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void TerrainAnimateTree( inout vec4 pos, in float alpha ) {
- vec3 bent;
- pos.xyz *= _Scale.xyz ;
- bent = ( _TerrainEngineBendTree * vec4( pos.xyz , 0.000000) ).xyz ;
- pos.xyz = mix( pos.xyz , bent, vec3( alpha));
- pos = Squash( pos);
-}
-v2f vert( in appdata v ) {
- v2f o;
- TerrainAnimateTree( v.vertex, v.color.w );
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.uv = v.texcoord.xy ;
- o.nz.xyz = ( xll_constructMat3( gl_ModelViewMatrixInverseTranspose) * v.normal );
- o.nz.w = ( -(( gl_ModelViewMatrix * v.vertex ).z * _ProjectionParams.w ) );
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.color = vec4( gl_Color);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.uv, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.nz);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-out.txt
deleted file mode 100644
index fad74687f4e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture-out.txt
+++ /dev/null
@@ -1,54 +0,0 @@
-uniform vec4 _ProjectionParams;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-void main ()
-{
- vec4 tmpvar_1;
- vec4 pos_2;
- pos_2.w = gl_Vertex.w;
- pos_2.xyz = (gl_Vertex.xyz * _Scale.xyz);
- vec4 tmpvar_3;
- tmpvar_3.w = 0.0;
- tmpvar_3.xyz = pos_2.xyz;
- pos_2.xyz = mix (pos_2.xyz, (_TerrainEngineBendTree * tmpvar_3).xyz, gl_Color.www);
- vec3 tmpvar_4;
- tmpvar_4.xz = vec2(0.0, 0.0);
- tmpvar_4.y = _SquashPlaneNormal.w;
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = mix ((pos_2.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_4 - pos_2.xyz))
- * _SquashPlaneNormal.xyz)), pos_2.xyz, vec3(_SquashAmount));
- pos_2 = tmpvar_5;
- mat3 tmpvar_6;
- tmpvar_6[0] = gl_ModelViewMatrixInverseTranspose[0].xyz;
- tmpvar_6[1] = gl_ModelViewMatrixInverseTranspose[1].xyz;
- tmpvar_6[2] = gl_ModelViewMatrixInverseTranspose[2].xyz;
- tmpvar_1.xyz = (tmpvar_6 * gl_Normal);
- tmpvar_1.w = -(((gl_ModelViewMatrix * tmpvar_5).z * _ProjectionParams.w));
- gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_5);
- vec4 tmpvar_7;
- tmpvar_7.zw = vec2(0.0, 0.0);
- tmpvar_7.xy = gl_MultiTexCoord0.xy;
- gl_TexCoord[0] = tmpvar_7;
- gl_TexCoord[1] = tmpvar_1;
-}
-
-
-// stats: 17 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 8 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
-// #4: _Scale (high float) 4x1 [-1]
-// #5: _SquashAmount (high float) 1x1 [-1]
-// #6: _SquashPlaneNormal (high float) 4x1 [-1]
-// #7: _TerrainEngineBendTree (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-in.txt
deleted file mode 100644
index 9d0ab80c4c5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-in.txt
+++ /dev/null
@@ -1,111 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec4 nz;
-};
-struct appdata_grass {
- vec4 vertex;
- vec4 tangent;
- vec4 color;
- vec4 texcoord;
- vec4 texcoord1;
-};
-uniform vec4 _ProjectionParams;
-uniform vec4 _WaveAndDistance;
-uniform vec4 _WavingTint;
-
-
-void FastSinCos( in vec4 val, out vec4 s, out vec4 c );
-void TerrainWaveGrass( inout vec4 vertex, in float waveAmount, in vec3 color, out vec4 outColor );
-v2f vert( in appdata_grass v );
-void FastSinCos( in vec4 val, out vec4 s, out vec4 c ) {
- vec4 r5;
- vec4 r6;
- vec4 r7;
- vec4 r8;
- vec4 r1;
- vec4 r2;
- vec4 r3;
- vec4 sin7 = vec4( 1.00000, -0.161616, 0.00833330, -0.000198410);
- vec4 cos8 = vec4( -0.500000, 0.0416667, -0.00138889, 2.48016e-005);
- val = ((val * 6.40885) - 3.14159);
- r5 = (val * val);
- r6 = (r5 * r5);
- r7 = (r6 * r5);
- r8 = (r6 * r5);
- r1 = (r5 * val);
- r2 = (r1 * r5);
- r3 = (r2 * r5);
- s = (((val + (r1 * sin7.y )) + (r2 * sin7.z )) + (r3 * sin7.w ));
- c = ((((1.00000 + (r5 * cos8.x )) + (r6 * cos8.y )) + (r7 * cos8.z )) + (r8 * cos8.w ));
-}
-void TerrainWaveGrass( inout vec4 vertex, in float waveAmount, in vec3 color, out vec4 outColor ) {
- vec4 _waveXSize;
- vec4 _waveZSize;
- vec4 waveSpeed = vec4( 1.20000, 2.00000, 1.60000, 4.80000);
- vec4 _waveXmove = vec4( 0.0240000, 0.0400000, -0.120000, 0.0960000);
- vec4 _waveZmove = vec4( 0.00600000, 0.0200000, -0.0200000, 0.100000);
- vec4 waves;
- vec4 s;
- vec4 c;
- float lighting;
- vec3 waveMove = vec3( 0.000000, 0.000000, 0.000000);
- vec3 waveColor;
- _waveXSize = (vec4( 0.0120000, 0.0200000, 0.0600000, 0.0240000) * _WaveAndDistance.y );
- _waveZSize = (vec4( 0.00600000, 0.0200000, 0.0200000, 0.0500000) * _WaveAndDistance.y );
- waves = (vertex.x * _waveXSize);
- waves += (vertex.z * _waveZSize);
- waves += (_WaveAndDistance.x * waveSpeed);
- waves = fract( waves );
- FastSinCos( waves, s, c);
- s = (s * s);
- s = (s * s);
- lighting = (dot( s, normalize( vec4( 1.00000, 1.00000, 0.400000, 0.200000) )) * 0.700000);
- s = (s * waveAmount);
- waveMove.x = dot( s, _waveXmove);
- waveMove.z = dot( s, _waveZmove);
- vertex.xz -= (waveMove.xz * _WaveAndDistance.z );
- waveColor = mix( vec3( 0.500000, 0.500000, 0.500000), _WavingTint.xyz , vec3( lighting));
- outColor.xyz = ((color * waveColor) * 2.00000);
- outColor.w = 1.00000;
-}
-v2f vert( in appdata_grass v ) {
- float waveAmount;
- vec4 dummyColor;
- v2f o;
- waveAmount = (v.color.w * _WaveAndDistance.z );
- dummyColor = vec4( 0.000000);
- TerrainWaveGrass( v.vertex, waveAmount, vec3( dummyColor), dummyColor);
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.uv = vec2( v.texcoord);
- o.nz.xyz = vec3( 0.000000, 0.000000, 1.00000);
- o.nz.w = ( -(( gl_ModelViewMatrix * v.vertex ).z * _ProjectionParams.w ) );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f xl_retval;
- appdata_grass xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.color = vec4( gl_Color);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.uv, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.nz);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-out.txt
deleted file mode 100644
index e88774e464d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthNormalTexture1-out.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-uniform vec4 _ProjectionParams;
-uniform vec4 _WaveAndDistance;
-void main ()
-{
- vec4 tmpvar_1;
- vec4 vertex_2;
- vertex_2.yw = gl_Vertex.yw;
- vec3 waveMove_3;
- vec4 s_4;
- vec4 waves_5;
- waveMove_3.y = 0.0;
- waves_5 = (gl_Vertex.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y));
- waves_5 = (waves_5 + (gl_Vertex.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y)));
- waves_5 = (waves_5 + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8)));
- vec4 tmpvar_6;
- tmpvar_6 = fract(waves_5);
- waves_5 = tmpvar_6;
- vec4 val_7;
- vec4 s_8;
- vec4 r2_9;
- vec4 r1_10;
- vec4 r5_11;
- val_7 = ((tmpvar_6 * 6.40885) - 3.14159);
- r5_11 = (val_7 * val_7);
- r1_10 = (r5_11 * val_7);
- r2_9 = (r1_10 * r5_11);
- s_8 = (((val_7 +
- (r1_10 * -0.161616)
- ) + (r2_9 * 0.0083333)) + ((r2_9 * r5_11) * -0.00019841));
- s_4 = (s_8 * s_8);
- s_4 = (s_4 * s_4);
- s_4 = (s_4 * (gl_Color.w * _WaveAndDistance.z));
- waveMove_3.x = dot (s_4, vec4(0.024, 0.04, -0.12, 0.096));
- waveMove_3.z = dot (s_4, vec4(0.006, 0.02, -0.02, 0.1));
- vertex_2.xz = (gl_Vertex.xz - (waveMove_3.xz * _WaveAndDistance.z));
- tmpvar_1.xyz = vec3(0.0, 0.0, 1.0);
- tmpvar_1.w = -(((gl_ModelViewMatrix * vertex_2).z * _ProjectionParams.w));
- gl_Position = (gl_ModelViewProjectionMatrix * vertex_2);
- vec4 tmpvar_12;
- tmpvar_12.zw = vec2(0.0, 0.0);
- tmpvar_12.xy = gl_MultiTexCoord0.xy;
- gl_TexCoord[0] = tmpvar_12;
- gl_TexCoord[1] = tmpvar_1;
-}
-
-
-// stats: 35 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 4 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _ProjectionParams (high float) 4x1 [-1]
-// #3: _WaveAndDistance (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-in.txt
deleted file mode 100644
index 2c925ea978c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-in.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_tree_billboard {
- vec4 vertex;
- vec4 color;
- vec4 texcoord;
- vec2 texcoord1;
-};
-uniform vec4 _TreeBillboardCameraFront;
-uniform vec4 _TreeBillboardCameraPos;
-uniform vec3 _TreeBillboardCameraRight;
-uniform vec4 _TreeBillboardCameraUp;
-uniform vec4 _TreeBillboardDistances;
-
-void TerrainBillboardTree( inout vec4 pos, in vec2 offset, in float offsetz );
-v2f vert( in appdata_tree_billboard v );
-void TerrainBillboardTree( inout vec4 pos, in vec2 offset, in float offsetz ) {
- vec3 treePos;
- float treeDistanceSqr;
- float billboardAngleFactor;
- float radius;
- float billboardModeFactor;
- float billboardRootOffsetFactor;
- float absRadius;
- treePos = (pos.xyz - _TreeBillboardCameraPos.xyz );
- treeDistanceSqr = dot( treePos, treePos);
- if ( (treeDistanceSqr > _TreeBillboardDistances.x ) ){
- offset.xy = vec2( 0.000000);
- }
- pos.xyz += (_TreeBillboardCameraRight.xyz * offset.x );
- billboardAngleFactor = _TreeBillboardCameraPos.w ;
- radius = mix( offset.y , offsetz, billboardAngleFactor);
- billboardModeFactor = _TreeBillboardCameraUp.w ;
- billboardRootOffsetFactor = _TreeBillboardCameraFront.w ;
- absRadius = abs( radius );
- pos.xyz += mix( ((((_TreeBillboardCameraUp.xyz * max( 0.000000, radius)) * 2.00000) - (vec3( 0.000000, 1.00000, 0.000000) * absRadius)) - ((_TreeBillboardCameraUp.xyz * absRadius) * billboardRootOffsetFactor)), (_TreeBillboardCameraUp.xyz * radius), vec3( billboardModeFactor));
-}
-v2f vert( in appdata_tree_billboard v ) {
- v2f o;
- TerrainBillboardTree( v.vertex, v.texcoord1.xy , v.texcoord.y );
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.uv.x = v.texcoord.x ;
- o.uv.y = float( (v.texcoord.y > 0.000000) );
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata_tree_billboard xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.color = vec4( gl_Color);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec2( gl_MultiTexCoord1);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.uv, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt
deleted file mode 100644
index 3a045f601a0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Camera-DepthTexture-out.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-uniform vec4 _TreeBillboardCameraFront;
-uniform vec4 _TreeBillboardCameraPos;
-uniform vec3 _TreeBillboardCameraRight;
-uniform vec4 _TreeBillboardCameraUp;
-uniform vec4 _TreeBillboardDistances;
-void main ()
-{
- vec2 tmpvar_1;
- vec4 pos_2;
- pos_2 = gl_Vertex;
- vec2 offset_3;
- offset_3 = gl_MultiTexCoord1.xy;
- vec3 treePos_4;
- treePos_4 = (gl_Vertex.xyz - _TreeBillboardCameraPos.xyz);
- float tmpvar_5;
- tmpvar_5 = dot (treePos_4, treePos_4);
- if ((tmpvar_5 > _TreeBillboardDistances.x)) {
- offset_3 = vec2(0.0, 0.0);
- };
- pos_2.xyz = (gl_Vertex.xyz + (_TreeBillboardCameraRight * offset_3.x));
- float tmpvar_6;
- tmpvar_6 = mix (offset_3.y, gl_MultiTexCoord0.y, _TreeBillboardCameraPos.w);
- float tmpvar_7;
- tmpvar_7 = abs(tmpvar_6);
- pos_2.xyz = (pos_2.xyz + mix ((
- (((_TreeBillboardCameraUp.xyz * max (0.0, tmpvar_6)) * 2.0) - (vec3(0.0, 1.0, 0.0) * tmpvar_7))
- -
- ((_TreeBillboardCameraUp.xyz * tmpvar_7) * _TreeBillboardCameraFront.w)
- ), (_TreeBillboardCameraUp.xyz * tmpvar_6), _TreeBillboardCameraUp.www));
- tmpvar_1.x = gl_MultiTexCoord0.x;
- tmpvar_1.y = float((gl_MultiTexCoord0.y > 0.0));
- gl_Position = (gl_ModelViewProjectionMatrix * pos_2);
- vec4 tmpvar_8;
- tmpvar_8.zw = vec2(0.0, 0.0);
- tmpvar_8.xy = tmpvar_1;
- gl_TexCoord[0] = tmpvar_8;
-}
-
-
-// stats: 23 alu 0 tex 1 flow
-// inputs: 3
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _TreeBillboardCameraFront (high float) 4x1 [-1]
-// #2: _TreeBillboardCameraPos (high float) 4x1 [-1]
-// #3: _TreeBillboardCameraRight (high float) 3x1 [-1]
-// #4: _TreeBillboardCameraUp (high float) 4x1 [-1]
-// #5: _TreeBillboardDistances (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-in.txt
deleted file mode 100644
index fea2be053dc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-in.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec4 uv[4];
-};
-uniform vec4 _MainTex_TexelSize;
-
-
-vec2 MultiplyUV( in mat4 mat, in vec2 inUV );
-v2f vert( in appdata_img v );
-vec2 MultiplyUV( in mat4 mat, in vec2 inUV ) {
- vec4 temp;
- temp = vec4( inUV.x , inUV.y , 0.000000, 0.000000);
- temp = ( mat * temp );
- return temp.xy ;
-}
-v2f vert( in appdata_img v ) {
- v2f o;
- vec4 uv;
- float offX;
- float offY;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- uv.xy = MultiplyUV( gl_TextureMatrix[0], v.texcoord);
- uv.zw = vec2( 0.000000);
- offX = _MainTex_TexelSize.x ;
- offY = _MainTex_TexelSize.y ;
- o.uv[ 0 ] = (uv + vec4( ( -offX ), ( -offY ), 0.000000, 1.00000));
- o.uv[ 1 ] = (uv + vec4( offX, ( -offY ), 0.000000, 1.00000));
- o.uv[ 2 ] = (uv + vec4( offX, offY, 0.000000, 1.00000));
- o.uv[ 3 ] = (uv + vec4( ( -offX ), offY, 0.000000, 1.00000));
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata_img xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.texcoord = vec2( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.uv[0]);
- gl_TexCoord[1] = vec4( xl_retval.uv[1]);
- gl_TexCoord[2] = vec4( xl_retval.uv[2]);
- gl_TexCoord[3] = vec4( xl_retval.uv[3]);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-out.txt
deleted file mode 100644
index d148d450ff3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Glow_Downsample-out.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-uniform vec4 _MainTex_TexelSize;
-void main ()
-{
- float offY_1;
- float offX_2;
- vec4 uv_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = gl_MultiTexCoord0.xy;
- uv_3.xy = (gl_TextureMatrix[0] * tmpvar_4).xy;
- uv_3.zw = vec2(0.0, 0.0);
- offX_2 = _MainTex_TexelSize.x;
- offY_1 = _MainTex_TexelSize.y;
- vec4 tmpvar_5;
- tmpvar_5.zw = vec2(0.0, 1.0);
- float tmpvar_6;
- tmpvar_6 = -(_MainTex_TexelSize.x);
- tmpvar_5.x = tmpvar_6;
- float tmpvar_7;
- tmpvar_7 = -(_MainTex_TexelSize.y);
- tmpvar_5.y = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.zw = vec2(0.0, 1.0);
- tmpvar_8.x = offX_2;
- tmpvar_8.y = tmpvar_7;
- vec4 tmpvar_9;
- tmpvar_9.zw = vec2(0.0, 1.0);
- tmpvar_9.x = offX_2;
- tmpvar_9.y = offY_1;
- vec4 tmpvar_10;
- tmpvar_10.zw = vec2(0.0, 1.0);
- tmpvar_10.x = tmpvar_6;
- tmpvar_10.y = offY_1;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- gl_TexCoord[0] = (uv_3 + tmpvar_5);
- gl_TexCoord[1] = (uv_3 + tmpvar_8);
- gl_TexCoord[2] = (uv_3 + tmpvar_9);
- gl_TexCoord[3] = (uv_3 + tmpvar_10);
-}
-
-
-// stats: 14 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 3 (total size: 0)
-// #0: gl_TextureMatrix (high float) 4x4 [16]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: _MainTex_TexelSize (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-in.txt
deleted file mode 100644
index fbf09541653..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-in.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
- vec2 texgencoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform mat4 _GUIClipTextureMatrix;
-uniform vec4 _MainTex_ST;
-
-
-v2f vert( in appdata_t v );
-v2f vert( in appdata_t v ) {
- v2f o;
- vec4 texgen;
- o.vertex = ( gl_ModelViewProjectionMatrix * v.vertex );
- texgen = ( gl_ModelViewMatrix * v.vertex );
- o.texgencoord = vec2( ( _GUIClipTextureMatrix * texgen ));
- o.color = v.color;
- o.texcoord = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata_t xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.color = vec4( gl_Color);
- xlt_v.texcoord = vec2( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.vertex);
- gl_FrontColor = vec4( xl_retval.color);
- gl_TexCoord[0] = vec4( xl_retval.texcoord, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.texgencoord, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-out.txt
deleted file mode 100644
index 77f91ac9713..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-GUITextureClip-out.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-uniform mat4 _GUIClipTextureMatrix;
-uniform vec4 _MainTex_ST;
-void main ()
-{
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- gl_FrontColor = gl_Color;
- vec4 tmpvar_1;
- tmpvar_1.zw = vec2(0.0, 0.0);
- tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_1;
- vec4 tmpvar_2;
- tmpvar_2.zw = vec2(0.0, 0.0);
- tmpvar_2.xy = (_GUIClipTextureMatrix * (gl_ModelViewMatrix * gl_Vertex)).xy;
- gl_TexCoord[1] = tmpvar_2;
-}
-
-
-// stats: 7 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 4 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _GUIClipTextureMatrix (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-in.txt
deleted file mode 100644
index e863a2410ba..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-in.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec4 uv;
- vec3 ray;
-};
-struct appdata {
- vec4 vertex;
- vec3 texcoord;
-};
-uniform vec4 _ProjectionParams;
-
-
-vec4 ComputeScreenPos( in vec4 pos );
-v2f vert( in appdata v );
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f vert( in appdata v ) {
- v2f o;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.uv = ComputeScreenPos( o.pos);
- o.ray = (( gl_ModelViewMatrix * v.vertex ).xyz * vec3( -1.00000, -1.00000, 1.00000));
- o.ray = mix( o.ray, v.texcoord, vec3( float( (v.texcoord.z != 0.000000) )));
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.texcoord = vec3( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.uv);
- gl_TexCoord[1] = vec4( xl_retval.ray, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-out.txt
deleted file mode 100644
index 8c347241a02..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Internal-PrePassLighting-out.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-uniform vec4 _ProjectionParams;
-void main ()
-{
- vec4 tmpvar_1;
- vec3 tmpvar_2;
- tmpvar_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_3;
- o_3 = (tmpvar_1 * 0.5);
- vec2 tmpvar_4;
- tmpvar_4.x = o_3.x;
- tmpvar_4.y = (o_3.y * _ProjectionParams.x);
- o_3.xy = (tmpvar_4 + o_3.w);
- o_3.zw = tmpvar_1.zw;
- tmpvar_2 = ((gl_ModelViewMatrix * gl_Vertex).xyz * vec3(-1.0, -1.0, 1.0));
- vec3 tmpvar_5;
- tmpvar_5 = mix (tmpvar_2, gl_MultiTexCoord0.xyz, vec3(float((gl_MultiTexCoord0.z != 0.0))));
- tmpvar_2 = tmpvar_5;
- gl_Position = tmpvar_1;
- gl_TexCoord[0] = o_3;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = tmpvar_5;
- gl_TexCoord[1] = tmpvar_6;
-}
-
-
-// stats: 10 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 3 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _ProjectionParams (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-in.txt
deleted file mode 100644
index 7400198da8b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-in.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec2 uvg;
- vec2 uvs;
-};
-uniform vec4 _GrainOffsetScale;
-uniform vec4 _ScratchOffsetScale;
-
-
-vec2 MultiplyUV( in mat4 mat, in vec2 inUV );
-v2f vert( in appdata_img v );
-vec2 MultiplyUV( in mat4 mat, in vec2 inUV ) {
- vec4 temp;
- temp = vec4( inUV.x , inUV.y , 0.000000, 0.000000);
- temp = ( mat * temp );
- return temp.xy ;
-}
-v2f vert( in appdata_img v ) {
- v2f o;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.uv = MultiplyUV( gl_TextureMatrix[0], v.texcoord);
- o.uvg = ((v.texcoord.xy * _GrainOffsetScale.zw ) + _GrainOffsetScale.xy );
- o.uvs = ((v.texcoord.xy * _ScratchOffsetScale.zw ) + _ScratchOffsetScale.xy );
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata_img xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.texcoord = vec2( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.uv, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.uvg, 0.0, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.uvs, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-out.txt
deleted file mode 100644
index 486cefab1b8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Noise_Shader_RGB-out.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-uniform vec4 _GrainOffsetScale;
-uniform vec4 _ScratchOffsetScale;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1.zw = vec2(0.0, 0.0);
- tmpvar_1.xy = gl_MultiTexCoord0.xy;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_2;
- tmpvar_2.zw = vec2(0.0, 0.0);
- tmpvar_2.xy = (gl_TextureMatrix[0] * tmpvar_1).xy;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_3;
- tmpvar_3.zw = vec2(0.0, 0.0);
- tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _GrainOffsetScale.zw) + _GrainOffsetScale.xy);
- gl_TexCoord[1] = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _ScratchOffsetScale.zw) + _ScratchOffsetScale.xy);
- gl_TexCoord[2] = tmpvar_4;
-}
-
-
-// stats: 10 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 4 (total size: 0)
-// #0: gl_TextureMatrix (high float) 4x4 [16]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: _GrainOffsetScale (high float) 4x1 [-1]
-// #3: _ScratchOffsetScale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-in.txt
deleted file mode 100644
index f9a5b53ce2f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-in.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- float fog;
- vec4 color;
- vec2 uv;
-};
-struct appdata_tree_billboard {
- vec4 vertex;
- vec4 color;
- vec4 texcoord;
- vec2 texcoord1;
-};
-uniform vec4 _TreeBillboardCameraFront;
-uniform vec4 _TreeBillboardCameraPos;
-uniform vec3 _TreeBillboardCameraRight;
-uniform vec4 _TreeBillboardCameraUp;
-uniform vec4 _TreeBillboardDistances;
-
-void TerrainBillboardTree( inout vec4 pos, in vec2 offset, in float offsetz );
-v2f vert( in appdata_tree_billboard v );
-void TerrainBillboardTree( inout vec4 pos, in vec2 offset, in float offsetz ) {
- vec3 treePos;
- float treeDistanceSqr;
- float billboardAngleFactor;
- float radius;
- float billboardModeFactor;
- float billboardRootOffsetFactor;
- float absRadius;
- treePos = (pos.xyz - _TreeBillboardCameraPos.xyz );
- treeDistanceSqr = dot( treePos, treePos);
- if ( (treeDistanceSqr > _TreeBillboardDistances.x ) ){
- offset.xy = vec2( 0.000000);
- }
- pos.xyz += (_TreeBillboardCameraRight.xyz * offset.x );
- billboardAngleFactor = _TreeBillboardCameraPos.w ;
- radius = mix( offset.y , offsetz, billboardAngleFactor);
- billboardModeFactor = _TreeBillboardCameraUp.w ;
- billboardRootOffsetFactor = _TreeBillboardCameraFront.w ;
- absRadius = abs( radius );
- pos.xyz += mix( ((((_TreeBillboardCameraUp.xyz * max( 0.000000, radius)) * 2.00000) - (vec3( 0.000000, 1.00000, 0.000000) * absRadius)) - ((_TreeBillboardCameraUp.xyz * absRadius) * billboardRootOffsetFactor)), (_TreeBillboardCameraUp.xyz * radius), vec3( billboardModeFactor));
-}
-v2f vert( in appdata_tree_billboard v ) {
- v2f o;
- TerrainBillboardTree( v.vertex, v.texcoord1.xy , v.texcoord.y );
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.fog = o.pos.z ;
- o.uv.x = v.texcoord.x ;
- o.uv.y = float( (v.texcoord.y > 0.000000) );
- o.color = v.color;
- return o;
-}
-varying vec4 xlv_FOG;
-void main() {
- v2f xl_retval;
- appdata_tree_billboard xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.color = vec4( gl_Color);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec2( gl_MultiTexCoord1);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_FrontColor = vec4( xl_retval.color);
- gl_TexCoord[0] = vec4( xl_retval.uv, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-out.txt
deleted file mode 100644
index fa3b6ebec71..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_BillboardTree-out.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-uniform vec4 _TreeBillboardCameraFront;
-uniform vec4 _TreeBillboardCameraPos;
-uniform vec3 _TreeBillboardCameraRight;
-uniform vec4 _TreeBillboardCameraUp;
-uniform vec4 _TreeBillboardDistances;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 tmpvar_1;
- vec2 tmpvar_2;
- vec4 pos_3;
- pos_3 = gl_Vertex;
- vec2 offset_4;
- offset_4 = gl_MultiTexCoord1.xy;
- vec3 treePos_5;
- treePos_5 = (gl_Vertex.xyz - _TreeBillboardCameraPos.xyz);
- float tmpvar_6;
- tmpvar_6 = dot (treePos_5, treePos_5);
- if ((tmpvar_6 > _TreeBillboardDistances.x)) {
- offset_4 = vec2(0.0, 0.0);
- };
- pos_3.xyz = (gl_Vertex.xyz + (_TreeBillboardCameraRight * offset_4.x));
- float tmpvar_7;
- tmpvar_7 = mix (offset_4.y, gl_MultiTexCoord0.y, _TreeBillboardCameraPos.w);
- float tmpvar_8;
- tmpvar_8 = abs(tmpvar_7);
- pos_3.xyz = (pos_3.xyz + mix ((
- (((_TreeBillboardCameraUp.xyz * max (0.0, tmpvar_7)) * 2.0) - (vec3(0.0, 1.0, 0.0) * tmpvar_8))
- -
- ((_TreeBillboardCameraUp.xyz * tmpvar_8) * _TreeBillboardCameraFront.w)
- ), (_TreeBillboardCameraUp.xyz * tmpvar_7), _TreeBillboardCameraUp.www));
- tmpvar_1 = (gl_ModelViewProjectionMatrix * pos_3);
- tmpvar_2.x = gl_MultiTexCoord0.x;
- tmpvar_2.y = float((gl_MultiTexCoord0.y > 0.0));
- gl_Position = tmpvar_1;
- vec4 tmpvar_9;
- tmpvar_9.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_9.x = tmpvar_1.z;
- xlv_FOG = tmpvar_9;
- gl_FrontColor = gl_Color;
- vec4 tmpvar_10;
- tmpvar_10.zw = vec2(0.0, 0.0);
- tmpvar_10.xy = tmpvar_2;
- gl_TexCoord[0] = tmpvar_10;
-}
-
-
-// stats: 24 alu 0 tex 1 flow
-// inputs: 4
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Color (high float) 4x1 [-1] loc 3
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _TreeBillboardCameraFront (high float) 4x1 [-1]
-// #2: _TreeBillboardCameraPos (high float) 4x1 [-1]
-// #3: _TreeBillboardCameraRight (high float) 3x1 [-1]
-// #4: _TreeBillboardCameraUp (high float) 4x1 [-1]
-// #5: _TreeBillboardDistances (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-in.txt
deleted file mode 100644
index 2f032a3330a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-in.txt
+++ /dev/null
@@ -1,233 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 normal;
- vec3 vlight;
-};
-uniform vec4 _CameraPosition;
-uniform vec3 _CameraRight;
-uniform vec3 _CameraUp;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WaveAndDistance;
-uniform vec4 _WavingTint;
-
-uniform vec4 unity_4LightAtten0;
-uniform vec4 unity_4LightPosX0;
-uniform vec4 unity_4LightPosY0;
-uniform vec4 unity_4LightPosZ0;
-uniform vec3 unity_LightColor0;
-uniform vec3 unity_LightColor1;
-uniform vec3 unity_LightColor2;
-uniform vec3 unity_LightColor3;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-void FastSinCos( in vec4 val, out vec4 s, out vec4 c );
-void TerrainWaveGrass( inout vec4 vertex, in float waveAmount, in vec3 color, out vec4 outColor );
-void TerrainBillboardGrass( inout vec4 pos, in vec2 offset );
-void vert( inout appdata_full v );
-vec3 ShadeSH9( in vec4 normal );
-vec3 Shade4PointLights( in vec4 lightPosX, in vec4 lightPosY, in vec4 lightPosZ, in vec3 lightColor0, in vec3 lightColor1, in vec3 lightColor2, in vec3 lightColor3, in vec4 lightAttenSq, in vec3 pos, in vec3 normal );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-void FastSinCos( in vec4 val, out vec4 s, out vec4 c ) {
- vec4 r5;
- vec4 r6;
- vec4 r7;
- vec4 r8;
- vec4 r1;
- vec4 r2;
- vec4 r3;
- vec4 sin7 = vec4( 1.00000, -0.161616, 0.00833330, -0.000198410);
- vec4 cos8 = vec4( -0.500000, 0.0416667, -0.00138889, 2.48016e-005);
- val = ((val * 6.40885) - 3.14159);
- r5 = (val * val);
- r6 = (r5 * r5);
- r7 = (r6 * r5);
- r8 = (r6 * r5);
- r1 = (r5 * val);
- r2 = (r1 * r5);
- r3 = (r2 * r5);
- s = (((val + (r1 * sin7.y )) + (r2 * sin7.z )) + (r3 * sin7.w ));
- c = ((((1.00000 + (r5 * cos8.x )) + (r6 * cos8.y )) + (r7 * cos8.z )) + (r8 * cos8.w ));
-}
-void TerrainWaveGrass( inout vec4 vertex, in float waveAmount, in vec3 color, out vec4 outColor ) {
- vec4 _waveXSize;
- vec4 _waveZSize;
- vec4 waveSpeed = vec4( 1.20000, 2.00000, 1.60000, 4.80000);
- vec4 _waveXmove = vec4( 0.0240000, 0.0400000, -0.120000, 0.0960000);
- vec4 _waveZmove = vec4( 0.00600000, 0.0200000, -0.0200000, 0.100000);
- vec4 waves;
- vec4 s;
- vec4 c;
- float lighting;
- vec3 waveMove = vec3( 0.000000, 0.000000, 0.000000);
- vec3 waveColor;
- _waveXSize = (vec4( 0.0120000, 0.0200000, 0.0600000, 0.0240000) * _WaveAndDistance.y );
- _waveZSize = (vec4( 0.00600000, 0.0200000, 0.0200000, 0.0500000) * _WaveAndDistance.y );
- waves = (vertex.x * _waveXSize);
- waves += (vertex.z * _waveZSize);
- waves += (_WaveAndDistance.x * waveSpeed);
- waves = fract( waves );
- FastSinCos( waves, s, c);
- s = (s * s);
- s = (s * s);
- lighting = (dot( s, normalize( vec4( 1.00000, 1.00000, 0.400000, 0.200000) )) * 0.700000);
- s = (s * waveAmount);
- waveMove.x = dot( s, _waveXmove);
- waveMove.z = dot( s, _waveZmove);
- vertex.xz -= (waveMove.xz * _WaveAndDistance.z );
- waveColor = mix( vec3( 0.500000, 0.500000, 0.500000), _WavingTint.xyz , vec3( lighting));
- outColor.xyz = ((color * waveColor) * 2.00000);
- outColor.w = 1.00000;
-}
-void TerrainBillboardGrass( inout vec4 pos, in vec2 offset ) {
- vec3 grasspos;
- grasspos = (pos.xyz - _CameraPosition.xyz );
- if ( (dot( grasspos, grasspos) > _WaveAndDistance.w ) ){
- offset = vec2( 0.000000);
- }
- pos.xyz += (offset.x * _CameraRight.xyz );
- pos.xyz += (offset.y * _CameraUp.xyz );
-}
-void vert( inout appdata_full v ) {
- float waveAmount;
- vec4 color;
- TerrainBillboardGrass( v.vertex, v.tangent.xy );
- waveAmount = v.tangent.y ;
- TerrainWaveGrass( v.vertex, waveAmount, v.color.xyz , color);
- v.color = color;
-}
-vec3 ShadeSH9( in vec4 normal ) {
- vec3 x1;
- vec4 vB;
- vec3 x2;
- float vC;
- vec3 x3;
- x1.x = dot( unity_SHAr, normal);
- x1.y = dot( unity_SHAg, normal);
- x1.z = dot( unity_SHAb, normal);
- vB = (normal.xyzz * normal.yzzx );
- x2.x = dot( unity_SHBr, vB);
- x2.y = dot( unity_SHBg, vB);
- x2.z = dot( unity_SHBb, vB);
- vC = ((normal.x * normal.x ) - (normal.y * normal.y ));
- x3 = (unity_SHC.xyz * vC);
- return ((x1 + x2) + x3);
-}
-vec3 Shade4PointLights( in vec4 lightPosX, in vec4 lightPosY, in vec4 lightPosZ, in vec3 lightColor0, in vec3 lightColor1, in vec3 lightColor2, in vec3 lightColor3, in vec4 lightAttenSq, in vec3 pos, in vec3 normal ) {
- vec4 toLightX;
- vec4 toLightY;
- vec4 toLightZ;
- vec4 lengthSq;
- vec4 ndotl;
- vec4 corr;
- vec4 atten;
- vec4 diff;
- vec3 col;
- toLightX = (lightPosX - pos.x );
- toLightY = (lightPosY - pos.y );
- toLightZ = (lightPosZ - pos.z );
- lengthSq = vec4( 0.000000);
- lengthSq += (toLightX * toLightX);
- lengthSq += (toLightY * toLightY);
- lengthSq += (toLightZ * toLightZ);
- ndotl = vec4( 0.000000);
- ndotl += (toLightX * normal.x );
- ndotl += (toLightY * normal.y );
- ndotl += (toLightZ * normal.z );
- corr = inversesqrt( lengthSq );
- ndotl = max( vec4( 0.000000, 0.000000, 0.000000, 0.000000), (ndotl * corr));
- atten = (1.00000 / (1.00000 + (lengthSq * lightAttenSq)));
- diff = (ndotl * atten);
- col = vec3( 0.000000);
- col += (lightColor0 * diff.x );
- col += (lightColor1 * diff.y );
- col += (lightColor2 * diff.z );
- col += (lightColor3 * diff.w );
- return col;
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 worldN;
- vec3 shlight;
- vec3 worldPos;
- vert( v);
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- worldN = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.normal = worldN;
- shlight = ShadeSH9( vec4( worldN, 1.00000));
- o.vlight = shlight;
- worldPos = ( _Object2World * v.vertex ).xyz ;
- o.vlight += Shade4PointLights( unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, unity_LightColor0, unity_LightColor1, unity_LightColor2, unity_LightColor3, unity_4LightAtten0, worldPos, worldN);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_FrontColor = vec4( xl_retval.lop_color);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.vlight, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt
deleted file mode 100644
index eae958b8dca..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass-out.txt
+++ /dev/null
@@ -1,179 +0,0 @@
-uniform vec4 _CameraPosition;
-uniform vec3 _CameraRight;
-uniform vec3 _CameraUp;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WaveAndDistance;
-uniform vec4 _WavingTint;
-uniform vec4 unity_4LightAtten0;
-uniform vec4 unity_4LightPosX0;
-uniform vec4 unity_4LightPosY0;
-uniform vec4 unity_4LightPosZ0;
-uniform vec3 unity_LightColor0;
-uniform vec3 unity_LightColor1;
-uniform vec3 unity_LightColor2;
-uniform vec3 unity_LightColor3;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 worldPos_1;
- vec3 worldN_2;
- vec4 pos_3;
- pos_3 = gl_Vertex;
- vec2 offset_4;
- offset_4 = TANGENT.xy;
- vec3 grasspos_5;
- grasspos_5 = (gl_Vertex.xyz - _CameraPosition.xyz);
- float tmpvar_6;
- tmpvar_6 = dot (grasspos_5, grasspos_5);
- if ((tmpvar_6 > _WaveAndDistance.w)) {
- offset_4 = vec2(0.0, 0.0);
- };
- pos_3.xyz = (gl_Vertex.xyz + (offset_4.x * _CameraRight));
- pos_3.xyz = (pos_3.xyz + (offset_4.y * _CameraUp));
- vec4 vertex_7;
- vertex_7.yw = pos_3.yw;
- vec4 outColor_8;
- vec3 waveMove_9;
- float lighting_10;
- vec4 s_11;
- vec4 waves_12;
- waveMove_9.y = 0.0;
- waves_12 = (pos_3.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y));
- waves_12 = (waves_12 + (pos_3.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y)));
- waves_12 = (waves_12 + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8)));
- vec4 tmpvar_13;
- tmpvar_13 = fract(waves_12);
- waves_12 = tmpvar_13;
- vec4 val_14;
- vec4 s_15;
- vec4 r2_16;
- vec4 r1_17;
- vec4 r5_18;
- val_14 = ((tmpvar_13 * 6.40885) - 3.14159);
- r5_18 = (val_14 * val_14);
- r1_17 = (r5_18 * val_14);
- r2_16 = (r1_17 * r5_18);
- s_15 = (((val_14 +
- (r1_17 * -0.161616)
- ) + (r2_16 * 0.0083333)) + ((r2_16 * r5_18) * -0.00019841));
- s_11 = (s_15 * s_15);
- s_11 = (s_11 * s_11);
- lighting_10 = (dot (s_11, vec4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7);
- s_11 = (s_11 * TANGENT.y);
- waveMove_9.x = dot (s_11, vec4(0.024, 0.04, -0.12, 0.096));
- waveMove_9.z = dot (s_11, vec4(0.006, 0.02, -0.02, 0.1));
- vertex_7.xz = (pos_3.xz - (waveMove_9.xz * _WaveAndDistance.z));
- outColor_8.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3(lighting_10))) * 2.0);
- outColor_8.w = 1.0;
- vec4 pos_19;
- pos_19 = (gl_ModelViewProjectionMatrix * vertex_7);
- mat3 tmpvar_20;
- tmpvar_20[0] = _Object2World[0].xyz;
- tmpvar_20[1] = _Object2World[1].xyz;
- tmpvar_20[2] = _Object2World[2].xyz;
- worldN_2 = (tmpvar_20 * (gl_Normal * unity_Scale.w));
- vec4 tmpvar_21;
- tmpvar_21.w = 1.0;
- tmpvar_21.xyz = worldN_2;
- vec3 x2_22;
- vec4 vB_23;
- vec3 x1_24;
- x1_24.x = dot (unity_SHAr, tmpvar_21);
- x1_24.y = dot (unity_SHAg, tmpvar_21);
- x1_24.z = dot (unity_SHAb, tmpvar_21);
- vB_23 = (worldN_2.xyzz * worldN_2.yzzx);
- x2_22.x = dot (unity_SHBr, vB_23);
- x2_22.y = dot (unity_SHBg, vB_23);
- x2_22.z = dot (unity_SHBb, vB_23);
- worldPos_1 = (_Object2World * vertex_7).xyz;
- vec3 col_25;
- vec4 diff_26;
- vec4 ndotl_27;
- vec4 lengthSq_28;
- vec4 toLightZ_29;
- vec4 toLightY_30;
- vec4 toLightX_31;
- toLightX_31 = (unity_4LightPosX0 - worldPos_1.x);
- toLightY_30 = (unity_4LightPosY0 - worldPos_1.y);
- toLightZ_29 = (unity_4LightPosZ0 - worldPos_1.z);
- lengthSq_28 = (toLightX_31 * toLightX_31);
- lengthSq_28 = (lengthSq_28 + (toLightY_30 * toLightY_30));
- lengthSq_28 = (lengthSq_28 + (toLightZ_29 * toLightZ_29));
- ndotl_27 = (toLightX_31 * worldN_2.x);
- ndotl_27 = (ndotl_27 + (toLightY_30 * worldN_2.y));
- ndotl_27 = (ndotl_27 + (toLightZ_29 * worldN_2.z));
- vec4 tmpvar_32;
- tmpvar_32 = max (vec4(0.0, 0.0, 0.0, 0.0), (ndotl_27 * inversesqrt(lengthSq_28)));
- ndotl_27 = tmpvar_32;
- diff_26 = (tmpvar_32 * (1.0/((1.0 +
- (lengthSq_28 * unity_4LightAtten0)
- ))));
- col_25 = (unity_LightColor0 * diff_26.x);
- col_25 = (col_25 + (unity_LightColor1 * diff_26.y));
- col_25 = (col_25 + (unity_LightColor2 * diff_26.z));
- col_25 = (col_25 + (unity_LightColor3 * diff_26.w));
- gl_Position = pos_19;
- vec4 tmpvar_33;
- tmpvar_33.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_33.x = pos_19.z;
- xlv_FOG = tmpvar_33;
- vec4 tmpvar_34;
- tmpvar_34.zw = vec2(0.0, 0.0);
- tmpvar_34.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_34;
- gl_FrontColor = outColor_8;
- vec4 tmpvar_35;
- tmpvar_35.w = 0.0;
- tmpvar_35.xyz = worldN_2;
- gl_TexCoord[1] = tmpvar_35;
- vec4 tmpvar_36;
- tmpvar_36.w = 0.0;
- tmpvar_36.xyz = (((x1_24 + x2_22) + (unity_SHC.xyz *
- ((worldN_2.x * worldN_2.x) - (worldN_2.y * worldN_2.y))
- )) + col_25);
- gl_TexCoord[2] = tmpvar_36;
-}
-
-
-// stats: 94 alu 0 tex 1 flow
-// inputs: 5
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// #4: TANGENT (high float) 4x1 [-1]
-// uniforms: 24 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _CameraPosition (high float) 4x1 [-1]
-// #2: _CameraRight (high float) 3x1 [-1]
-// #3: _CameraUp (high float) 3x1 [-1]
-// #4: _MainTex_ST (high float) 4x1 [-1]
-// #5: _Object2World (high float) 4x4 [-1]
-// #6: _WaveAndDistance (high float) 4x1 [-1]
-// #7: _WavingTint (high float) 4x1 [-1]
-// #8: unity_4LightAtten0 (high float) 4x1 [-1]
-// #9: unity_4LightPosX0 (high float) 4x1 [-1]
-// #10: unity_4LightPosY0 (high float) 4x1 [-1]
-// #11: unity_4LightPosZ0 (high float) 4x1 [-1]
-// #12: unity_LightColor0 (high float) 3x1 [-1]
-// #13: unity_LightColor1 (high float) 3x1 [-1]
-// #14: unity_LightColor2 (high float) 3x1 [-1]
-// #15: unity_LightColor3 (high float) 3x1 [-1]
-// #16: unity_SHAb (high float) 4x1 [-1]
-// #17: unity_SHAg (high float) 4x1 [-1]
-// #18: unity_SHAr (high float) 4x1 [-1]
-// #19: unity_SHBb (high float) 4x1 [-1]
-// #20: unity_SHBg (high float) 4x1 [-1]
-// #21: unity_SHBr (high float) 4x1 [-1]
-// #22: unity_SHC (high float) 4x1 [-1]
-// #23: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-in.txt
deleted file mode 100644
index 9335ce24676..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-in.txt
+++ /dev/null
@@ -1,171 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 normal;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-uniform vec4 _CameraPosition;
-uniform vec3 _CameraRight;
-uniform vec3 _CameraUp;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WaveAndDistance;
-uniform vec4 _WavingTint;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void FastSinCos( in vec4 val, out vec4 s, out vec4 c );
-void TerrainWaveGrass( inout vec4 vertex, in float waveAmount, in vec3 color, out vec4 outColor );
-void TerrainBillboardGrass( inout vec4 pos, in vec2 offset );
-void vert( inout appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-void FastSinCos( in vec4 val, out vec4 s, out vec4 c ) {
- vec4 r5;
- vec4 r6;
- vec4 r7;
- vec4 r8;
- vec4 r1;
- vec4 r2;
- vec4 r3;
- vec4 sin7 = vec4( 1.00000, -0.161616, 0.00833330, -0.000198410);
- vec4 cos8 = vec4( -0.500000, 0.0416667, -0.00138889, 2.48016e-005);
- val = ((val * 6.40885) - 3.14159);
- r5 = (val * val);
- r6 = (r5 * r5);
- r7 = (r6 * r5);
- r8 = (r6 * r5);
- r1 = (r5 * val);
- r2 = (r1 * r5);
- r3 = (r2 * r5);
- s = (((val + (r1 * sin7.y )) + (r2 * sin7.z )) + (r3 * sin7.w ));
- c = ((((1.00000 + (r5 * cos8.x )) + (r6 * cos8.y )) + (r7 * cos8.z )) + (r8 * cos8.w ));
-}
-void TerrainWaveGrass( inout vec4 vertex, in float waveAmount, in vec3 color, out vec4 outColor ) {
- vec4 _waveXSize;
- vec4 _waveZSize;
- vec4 waveSpeed = vec4( 1.20000, 2.00000, 1.60000, 4.80000);
- vec4 _waveXmove = vec4( 0.0240000, 0.0400000, -0.120000, 0.0960000);
- vec4 _waveZmove = vec4( 0.00600000, 0.0200000, -0.0200000, 0.100000);
- vec4 waves;
- vec4 s;
- vec4 c;
- float lighting;
- vec3 waveMove = vec3( 0.000000, 0.000000, 0.000000);
- vec3 waveColor;
- _waveXSize = (vec4( 0.0120000, 0.0200000, 0.0600000, 0.0240000) * _WaveAndDistance.y );
- _waveZSize = (vec4( 0.00600000, 0.0200000, 0.0200000, 0.0500000) * _WaveAndDistance.y );
- waves = (vertex.x * _waveXSize);
- waves += (vertex.z * _waveZSize);
- waves += (_WaveAndDistance.x * waveSpeed);
- waves = fract( waves );
- FastSinCos( waves, s, c);
- s = (s * s);
- s = (s * s);
- lighting = (dot( s, normalize( vec4( 1.00000, 1.00000, 0.400000, 0.200000) )) * 0.700000);
- s = (s * waveAmount);
- waveMove.x = dot( s, _waveXmove);
- waveMove.z = dot( s, _waveZmove);
- vertex.xz -= (waveMove.xz * _WaveAndDistance.z );
- waveColor = mix( vec3( 0.500000, 0.500000, 0.500000), _WavingTint.xyz , vec3( lighting));
- outColor.xyz = ((color * waveColor) * 2.00000);
- outColor.w = 1.00000;
-}
-void TerrainBillboardGrass( inout vec4 pos, in vec2 offset ) {
- vec3 grasspos;
- grasspos = (pos.xyz - _CameraPosition.xyz );
- if ( (dot( grasspos, grasspos) > _WaveAndDistance.w ) ){
- offset = vec2( 0.000000);
- }
- pos.xyz += (offset.x * _CameraRight.xyz );
- pos.xyz += (offset.y * _CameraUp.xyz );
-}
-void vert( inout appdata_full v ) {
- float waveAmount;
- vec4 color;
- TerrainBillboardGrass( v.vertex, v.tangent.xy );
- waveAmount = v.tangent.y ;
- TerrainWaveGrass( v.vertex, waveAmount, v.color.xyz , color);
- v.color = color;
-}
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vert( v);
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_FrontColor = vec4( xl_retval.lop_color);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt
deleted file mode 100644
index 29d43c82105..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass1-out.txt
+++ /dev/null
@@ -1,112 +0,0 @@
-uniform vec4 _CameraPosition;
-uniform vec3 _CameraRight;
-uniform vec3 _CameraUp;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WaveAndDistance;
-uniform vec4 _WavingTint;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = gl_Vertex;
- vec2 offset_2;
- offset_2 = TANGENT.xy;
- vec3 grasspos_3;
- grasspos_3 = (gl_Vertex.xyz - _CameraPosition.xyz);
- float tmpvar_4;
- tmpvar_4 = dot (grasspos_3, grasspos_3);
- if ((tmpvar_4 > _WaveAndDistance.w)) {
- offset_2 = vec2(0.0, 0.0);
- };
- pos_1.xyz = (gl_Vertex.xyz + (offset_2.x * _CameraRight));
- pos_1.xyz = (pos_1.xyz + (offset_2.y * _CameraUp));
- vec4 vertex_5;
- vertex_5.yw = pos_1.yw;
- vec4 outColor_6;
- vec3 waveMove_7;
- float lighting_8;
- vec4 s_9;
- vec4 waves_10;
- waveMove_7.y = 0.0;
- waves_10 = (pos_1.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y));
- waves_10 = (waves_10 + (pos_1.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y)));
- waves_10 = (waves_10 + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8)));
- vec4 tmpvar_11;
- tmpvar_11 = fract(waves_10);
- waves_10 = tmpvar_11;
- vec4 val_12;
- vec4 s_13;
- vec4 r2_14;
- vec4 r1_15;
- vec4 r5_16;
- val_12 = ((tmpvar_11 * 6.40885) - 3.14159);
- r5_16 = (val_12 * val_12);
- r1_15 = (r5_16 * val_12);
- r2_14 = (r1_15 * r5_16);
- s_13 = (((val_12 +
- (r1_15 * -0.161616)
- ) + (r2_14 * 0.0083333)) + ((r2_14 * r5_16) * -0.00019841));
- s_9 = (s_13 * s_13);
- s_9 = (s_9 * s_9);
- lighting_8 = (dot (s_9, vec4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7);
- s_9 = (s_9 * TANGENT.y);
- waveMove_7.x = dot (s_9, vec4(0.024, 0.04, -0.12, 0.096));
- waveMove_7.z = dot (s_9, vec4(0.006, 0.02, -0.02, 0.1));
- vertex_5.xz = (pos_1.xz - (waveMove_7.xz * _WaveAndDistance.z));
- outColor_6.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3(lighting_8))) * 2.0);
- outColor_6.w = 1.0;
- vec4 pos_17;
- pos_17 = (gl_ModelViewProjectionMatrix * vertex_5);
- mat3 tmpvar_18;
- tmpvar_18[0] = _Object2World[0].xyz;
- tmpvar_18[1] = _Object2World[1].xyz;
- tmpvar_18[2] = _Object2World[2].xyz;
- gl_Position = pos_17;
- vec4 tmpvar_19;
- tmpvar_19.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_19.x = pos_17.z;
- xlv_FOG = tmpvar_19;
- vec4 tmpvar_20;
- tmpvar_20.zw = vec2(0.0, 0.0);
- tmpvar_20.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_20;
- gl_FrontColor = outColor_6;
- vec4 tmpvar_21;
- tmpvar_21.w = 0.0;
- tmpvar_21.xyz = (tmpvar_18 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_21;
- vec4 tmpvar_22;
- tmpvar_22.w = 0.0;
- tmpvar_22.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * vertex_5).xyz);
- gl_TexCoord[2] = tmpvar_22;
- vec4 tmpvar_23;
- tmpvar_23.w = 0.0;
- tmpvar_23.xyz = (_LightMatrix0 * (_Object2World * vertex_5)).xyz;
- gl_TexCoord[3] = tmpvar_23;
-}
-
-
-// stats: 56 alu 0 tex 1 flow
-// inputs: 5
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// #4: TANGENT (high float) 4x1 [-1]
-// uniforms: 11 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _CameraPosition (high float) 4x1 [-1]
-// #2: _CameraRight (high float) 3x1 [-1]
-// #3: _CameraUp (high float) 3x1 [-1]
-// #4: _LightMatrix0 (high float) 4x4 [-1]
-// #5: _MainTex_ST (high float) 4x1 [-1]
-// #6: _Object2World (high float) 4x4 [-1]
-// #7: _WaveAndDistance (high float) 4x1 [-1]
-// #8: _WavingTint (high float) 4x1 [-1]
-// #9: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #10: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-in.txt
deleted file mode 100644
index f5ccde33486..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-in.txt
+++ /dev/null
@@ -1,146 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- vec2 hip_pack0;
- vec4 lop_color;
-};
-uniform vec4 _CameraPosition;
-uniform vec3 _CameraRight;
-uniform vec3 _CameraUp;
-uniform vec4 _MainTex_ST;
-uniform vec4 _WaveAndDistance;
-uniform vec4 _WavingTint;
-
-uniform vec4 unity_LightShadowBias;
-void FastSinCos( in vec4 val, out vec4 s, out vec4 c );
-void TerrainWaveGrass( inout vec4 vertex, in float waveAmount, in vec3 color, out vec4 outColor );
-void TerrainBillboardGrass( inout vec4 pos, in vec2 offset );
-void vert( inout appdata_full v );
-v2f_surf vert_surf( in appdata_full v );
-void FastSinCos( in vec4 val, out vec4 s, out vec4 c ) {
- vec4 r5;
- vec4 r6;
- vec4 r7;
- vec4 r8;
- vec4 r1;
- vec4 r2;
- vec4 r3;
- vec4 sin7 = vec4( 1.00000, -0.161616, 0.00833330, -0.000198410);
- vec4 cos8 = vec4( -0.500000, 0.0416667, -0.00138889, 2.48016e-005);
- val = ((val * 6.40885) - 3.14159);
- r5 = (val * val);
- r6 = (r5 * r5);
- r7 = (r6 * r5);
- r8 = (r6 * r5);
- r1 = (r5 * val);
- r2 = (r1 * r5);
- r3 = (r2 * r5);
- s = (((val + (r1 * sin7.y )) + (r2 * sin7.z )) + (r3 * sin7.w ));
- c = ((((1.00000 + (r5 * cos8.x )) + (r6 * cos8.y )) + (r7 * cos8.z )) + (r8 * cos8.w ));
-}
-void TerrainWaveGrass( inout vec4 vertex, in float waveAmount, in vec3 color, out vec4 outColor ) {
- vec4 _waveXSize;
- vec4 _waveZSize;
- vec4 waveSpeed = vec4( 1.20000, 2.00000, 1.60000, 4.80000);
- vec4 _waveXmove = vec4( 0.0240000, 0.0400000, -0.120000, 0.0960000);
- vec4 _waveZmove = vec4( 0.00600000, 0.0200000, -0.0200000, 0.100000);
- vec4 waves;
- vec4 s;
- vec4 c;
- float lighting;
- vec3 waveMove = vec3( 0.000000, 0.000000, 0.000000);
- vec3 waveColor;
- _waveXSize = (vec4( 0.0120000, 0.0200000, 0.0600000, 0.0240000) * _WaveAndDistance.y );
- _waveZSize = (vec4( 0.00600000, 0.0200000, 0.0200000, 0.0500000) * _WaveAndDistance.y );
- waves = (vertex.x * _waveXSize);
- waves += (vertex.z * _waveZSize);
- waves += (_WaveAndDistance.x * waveSpeed);
- waves = fract( waves );
- FastSinCos( waves, s, c);
- s = (s * s);
- s = (s * s);
- lighting = (dot( s, normalize( vec4( 1.00000, 1.00000, 0.400000, 0.200000) )) * 0.700000);
- s = (s * waveAmount);
- waveMove.x = dot( s, _waveXmove);
- waveMove.z = dot( s, _waveZmove);
- vertex.xz -= (waveMove.xz * _WaveAndDistance.z );
- waveColor = mix( vec3( 0.500000, 0.500000, 0.500000), _WavingTint.xyz , vec3( lighting));
- outColor.xyz = ((color * waveColor) * 2.00000);
- outColor.w = 1.00000;
-}
-void TerrainBillboardGrass( inout vec4 pos, in vec2 offset ) {
- vec3 grasspos;
- grasspos = (pos.xyz - _CameraPosition.xyz );
- if ( (dot( grasspos, grasspos) > _WaveAndDistance.w ) ){
- offset = vec2( 0.000000);
- }
- pos.xyz += (offset.x * _CameraRight.xyz );
- pos.xyz += (offset.y * _CameraUp.xyz );
-}
-void vert( inout appdata_full v ) {
- float waveAmount;
- vec4 color;
- TerrainBillboardGrass( v.vertex, v.tangent.xy );
- waveAmount = v.tangent.y ;
- TerrainWaveGrass( v.vertex, waveAmount, v.color.xyz , color);
- v.color = color;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vert( v);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.pos.z += unity_LightShadowBias.x ;
- if ( (o.pos.z < ( -o.pos.w )) ){
- o.pos.z = ( -o.pos.w );
- }
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[1] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_FrontColor = vec4( xl_retval.lop_color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt
deleted file mode 100644
index 75c27cd6b3c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_BillboardWavingDoublePass2-out.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-uniform vec4 _CameraPosition;
-uniform vec3 _CameraRight;
-uniform vec3 _CameraUp;
-uniform vec4 _MainTex_ST;
-uniform vec4 _WaveAndDistance;
-uniform vec4 _WavingTint;
-uniform vec4 unity_LightShadowBias;
-attribute vec4 TANGENT;
-void main ()
-{
- vec4 tmpvar_1;
- vec2 tmpvar_2;
- vec4 pos_3;
- pos_3 = gl_Vertex;
- vec2 offset_4;
- offset_4 = TANGENT.xy;
- vec3 grasspos_5;
- grasspos_5 = (gl_Vertex.xyz - _CameraPosition.xyz);
- float tmpvar_6;
- tmpvar_6 = dot (grasspos_5, grasspos_5);
- if ((tmpvar_6 > _WaveAndDistance.w)) {
- offset_4 = vec2(0.0, 0.0);
- };
- pos_3.xyz = (gl_Vertex.xyz + (offset_4.x * _CameraRight));
- pos_3.xyz = (pos_3.xyz + (offset_4.y * _CameraUp));
- vec4 vertex_7;
- vertex_7.yw = pos_3.yw;
- vec4 outColor_8;
- vec3 waveMove_9;
- float lighting_10;
- vec4 s_11;
- vec4 waves_12;
- waveMove_9.y = 0.0;
- waves_12 = (pos_3.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y));
- waves_12 = (waves_12 + (pos_3.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y)));
- waves_12 = (waves_12 + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8)));
- vec4 tmpvar_13;
- tmpvar_13 = fract(waves_12);
- waves_12 = tmpvar_13;
- vec4 val_14;
- vec4 s_15;
- vec4 r2_16;
- vec4 r1_17;
- vec4 r5_18;
- val_14 = ((tmpvar_13 * 6.40885) - 3.14159);
- r5_18 = (val_14 * val_14);
- r1_17 = (r5_18 * val_14);
- r2_16 = (r1_17 * r5_18);
- s_15 = (((val_14 +
- (r1_17 * -0.161616)
- ) + (r2_16 * 0.0083333)) + ((r2_16 * r5_18) * -0.00019841));
- s_11 = (s_15 * s_15);
- s_11 = (s_11 * s_11);
- lighting_10 = (dot (s_11, vec4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7);
- s_11 = (s_11 * TANGENT.y);
- waveMove_9.x = dot (s_11, vec4(0.024, 0.04, -0.12, 0.096));
- waveMove_9.z = dot (s_11, vec4(0.006, 0.02, -0.02, 0.1));
- vertex_7.xz = (pos_3.xz - (waveMove_9.xz * _WaveAndDistance.z));
- outColor_8.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3(lighting_10))) * 2.0);
- outColor_8.w = 1.0;
- tmpvar_2 = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_1 = (gl_ModelViewProjectionMatrix * vertex_7);
- tmpvar_1.z = (tmpvar_1.z + unity_LightShadowBias.x);
- if ((tmpvar_1.z < -(tmpvar_1.w))) {
- tmpvar_1.z = -(tmpvar_1.w);
- };
- gl_Position = tmpvar_1;
- vec4 tmpvar_19;
- tmpvar_19.zw = vec2(0.0, 0.0);
- tmpvar_19.xy = tmpvar_2;
- gl_TexCoord[1] = tmpvar_19;
- gl_FrontColor = outColor_8;
-}
-
-
-// stats: 50 alu 0 tex 2 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 8 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _CameraPosition (high float) 4x1 [-1]
-// #2: _CameraRight (high float) 3x1 [-1]
-// #3: _CameraUp (high float) 3x1 [-1]
-// #4: _MainTex_ST (high float) 4x1 [-1]
-// #5: _WaveAndDistance (high float) 4x1 [-1]
-// #6: _WavingTint (high float) 4x1 [-1]
-// #7: unity_LightShadowBias (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-in.txt
deleted file mode 100644
index eb98ccded14..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-in.txt
+++ /dev/null
@@ -1,157 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WaveAndDistance;
-uniform vec4 _WavingTint;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void FastSinCos( in vec4 val, out vec4 s, out vec4 c );
-void TerrainWaveGrass( inout vec4 vertex, in float waveAmount, in vec3 color, out vec4 outColor );
-void vert( inout appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-void FastSinCos( in vec4 val, out vec4 s, out vec4 c ) {
- vec4 r5;
- vec4 r6;
- vec4 r7;
- vec4 r8;
- vec4 r1;
- vec4 r2;
- vec4 r3;
- vec4 sin7 = vec4( 1.00000, -0.161616, 0.00833330, -0.000198410);
- vec4 cos8 = vec4( -0.500000, 0.0416667, -0.00138889, 2.48016e-005);
- val = ((val * 6.40885) - 3.14159);
- r5 = (val * val);
- r6 = (r5 * r5);
- r7 = (r6 * r5);
- r8 = (r6 * r5);
- r1 = (r5 * val);
- r2 = (r1 * r5);
- r3 = (r2 * r5);
- s = (((val + (r1 * sin7.y )) + (r2 * sin7.z )) + (r3 * sin7.w ));
- c = ((((1.00000 + (r5 * cos8.x )) + (r6 * cos8.y )) + (r7 * cos8.z )) + (r8 * cos8.w ));
-}
-void TerrainWaveGrass( inout vec4 vertex, in float waveAmount, in vec3 color, out vec4 outColor ) {
- vec4 _waveXSize;
- vec4 _waveZSize;
- vec4 waveSpeed = vec4( 1.20000, 2.00000, 1.60000, 4.80000);
- vec4 _waveXmove = vec4( 0.0240000, 0.0400000, -0.120000, 0.0960000);
- vec4 _waveZmove = vec4( 0.00600000, 0.0200000, -0.0200000, 0.100000);
- vec4 waves;
- vec4 s;
- vec4 c;
- float lighting;
- vec3 waveMove = vec3( 0.000000, 0.000000, 0.000000);
- vec3 waveColor;
- _waveXSize = (vec4( 0.0120000, 0.0200000, 0.0600000, 0.0240000) * _WaveAndDistance.y );
- _waveZSize = (vec4( 0.00600000, 0.0200000, 0.0200000, 0.0500000) * _WaveAndDistance.y );
- waves = (vertex.x * _waveXSize);
- waves += (vertex.z * _waveZSize);
- waves += (_WaveAndDistance.x * waveSpeed);
- waves = fract( waves );
- FastSinCos( waves, s, c);
- s = (s * s);
- s = (s * s);
- lighting = (dot( s, normalize( vec4( 1.00000, 1.00000, 0.400000, 0.200000) )) * 0.700000);
- s = (s * waveAmount);
- waveMove.x = dot( s, _waveXmove);
- waveMove.z = dot( s, _waveZmove);
- vertex.xz -= (waveMove.xz * _WaveAndDistance.z );
- waveColor = mix( vec3( 0.500000, 0.500000, 0.500000), _WavingTint.xyz , vec3( lighting));
- outColor.xyz = ((color * waveColor) * 2.00000);
- outColor.w = 1.00000;
-}
-void vert( inout appdata_full v ) {
- float waveAmount;
- vec4 color;
- waveAmount = (v.color.w * _WaveAndDistance.z );
- TerrainWaveGrass( v.vertex, waveAmount, v.color.xyz , color);
- v.color = color;
-}
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vert( v);
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_FrontColor = vec4( xl_retval.lop_color);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt
deleted file mode 100644
index f733b576756..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Details_WavingDoublePass1-out.txt
+++ /dev/null
@@ -1,88 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WaveAndDistance;
-uniform vec4 _WavingTint;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 vertex_1;
- vertex_1.yw = gl_Vertex.yw;
- vec4 outColor_2;
- vec3 waveMove_3;
- float lighting_4;
- vec4 s_5;
- vec4 waves_6;
- waveMove_3.y = 0.0;
- waves_6 = (gl_Vertex.x * (vec4(0.012, 0.02, 0.06, 0.024) * _WaveAndDistance.y));
- waves_6 = (waves_6 + (gl_Vertex.z * (vec4(0.006, 0.02, 0.02, 0.05) * _WaveAndDistance.y)));
- waves_6 = (waves_6 + (_WaveAndDistance.x * vec4(1.2, 2.0, 1.6, 4.8)));
- vec4 tmpvar_7;
- tmpvar_7 = fract(waves_6);
- waves_6 = tmpvar_7;
- vec4 val_8;
- vec4 s_9;
- vec4 r2_10;
- vec4 r1_11;
- vec4 r5_12;
- val_8 = ((tmpvar_7 * 6.40885) - 3.14159);
- r5_12 = (val_8 * val_8);
- r1_11 = (r5_12 * val_8);
- r2_10 = (r1_11 * r5_12);
- s_9 = (((val_8 +
- (r1_11 * -0.161616)
- ) + (r2_10 * 0.0083333)) + ((r2_10 * r5_12) * -0.00019841));
- s_5 = (s_9 * s_9);
- s_5 = (s_5 * s_5);
- lighting_4 = (dot (s_5, vec4(0.6741998, 0.6741998, 0.2696799, 0.13484)) * 0.7);
- s_5 = (s_5 * (gl_Color.w * _WaveAndDistance.z));
- waveMove_3.x = dot (s_5, vec4(0.024, 0.04, -0.12, 0.096));
- waveMove_3.z = dot (s_5, vec4(0.006, 0.02, -0.02, 0.1));
- vertex_1.xz = (gl_Vertex.xz - (waveMove_3.xz * _WaveAndDistance.z));
- outColor_2.xyz = ((gl_Color.xyz * mix (vec3(0.5, 0.5, 0.5), _WavingTint.xyz, vec3(lighting_4))) * 2.0);
- outColor_2.w = 1.0;
- vec4 pos_13;
- pos_13 = (gl_ModelViewProjectionMatrix * vertex_1);
- mat3 tmpvar_14;
- tmpvar_14[0] = _Object2World[0].xyz;
- tmpvar_14[1] = _Object2World[1].xyz;
- tmpvar_14[2] = _Object2World[2].xyz;
- gl_Position = pos_13;
- vec4 tmpvar_15;
- tmpvar_15.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_15.x = pos_13.z;
- xlv_FOG = tmpvar_15;
- vec4 tmpvar_16;
- tmpvar_16.zw = vec2(0.0, 0.0);
- tmpvar_16.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_16;
- gl_FrontColor = outColor_2;
- vec4 tmpvar_17;
- tmpvar_17.w = 0.0;
- tmpvar_17.xyz = (tmpvar_14 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_17;
- vec4 tmpvar_18;
- tmpvar_18.w = 0.0;
- tmpvar_18.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * vertex_1).xyz);
- gl_TexCoord[2] = tmpvar_18;
- gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * vertex_1));
-}
-
-
-// stats: 48 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 8 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _WaveAndDistance (high float) 4x1 [-1]
-// #5: _WavingTint (high float) 4x1 [-1]
-// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #7: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-in.txt
deleted file mode 100644
index 3deff8f5833..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-in.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- float fog;
- vec4 uv;
- vec4 color;
-};
-struct appdata_tree {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 color;
- vec4 texcoord;
-};
-uniform float _AO;
-uniform vec4 _Color;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-uniform vec4 _TerrainTreeLightColors[4];
-uniform vec3 _TerrainTreeLightDirections[4];
-
-
-
-vec4 Squash( in vec4 pos );
-void TerrainAnimateTree( inout vec4 pos, in float alpha );
-v2f vert( in appdata_tree v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void TerrainAnimateTree( inout vec4 pos, in float alpha ) {
- vec3 bent;
- pos.xyz *= _Scale.xyz ;
- bent = ( _TerrainEngineBendTree * vec4( pos.xyz , 0.000000) ).xyz ;
- pos.xyz = mix( pos.xyz , bent, vec3( alpha));
- pos = Squash( pos);
-}
-v2f vert( in appdata_tree v ) {
- vec3 viewpos;
- v2f o;
- vec4 lightDir;
- vec4 lightColor;
- int i = 0;
- float atten = 1.00000;
- float occ;
- TerrainAnimateTree( v.vertex, v.color.w );
- viewpos = vec3( ( gl_ModelViewMatrix * v.vertex ));
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.fog = o.pos.z ;
- o.uv = v.texcoord;
- lightDir.w = _AO;
- lightColor = gl_LightModel.ambient;
- for ( ; (i < 4); ( i++ )) {
- lightDir.xyz = _TerrainTreeLightDirections[ i ];
- occ = dot( lightDir.xyz , v.normal);
- occ = max( 0.000000, occ);
- occ *= atten;
- lightColor += (_TerrainTreeLightColors[ i ] * occ);
- }
- lightColor.w = 1.00000;
- o.color = (lightColor * _Color);
- o.color.w = 1.00000;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f xl_retval;
- appdata_tree xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.color = vec4( gl_Color);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.uv);
- gl_FrontColor = vec4( xl_retval.color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt
deleted file mode 100644
index b9f328318c1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Bark_rendertex-out.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-uniform float _AO;
-uniform vec4 _Color;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-uniform vec4 _TerrainTreeLightColors[4];
-uniform vec3 _TerrainTreeLightDirections[4];
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 lightColor_1;
- vec4 lightDir_2;
- vec4 tmpvar_3;
- vec4 tmpvar_4;
- vec4 pos_5;
- pos_5.w = gl_Vertex.w;
- pos_5.xyz = (gl_Vertex.xyz * _Scale.xyz);
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = pos_5.xyz;
- pos_5.xyz = mix (pos_5.xyz, (_TerrainEngineBendTree * tmpvar_6).xyz, gl_Color.www);
- vec3 tmpvar_7;
- tmpvar_7.xz = vec2(0.0, 0.0);
- tmpvar_7.y = _SquashPlaneNormal.w;
- vec4 tmpvar_8;
- tmpvar_8.w = 1.0;
- tmpvar_8.xyz = mix ((pos_5.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_7 - pos_5.xyz))
- * _SquashPlaneNormal.xyz)), pos_5.xyz, vec3(_SquashAmount));
- pos_5 = tmpvar_8;
- tmpvar_3 = (gl_ModelViewProjectionMatrix * tmpvar_8);
- lightDir_2.w = _AO;
- lightColor_1 = gl_LightModel.ambient;
- lightDir_2.xyz = _TerrainTreeLightDirections[0];
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0,
- dot (lightDir_2.xyz, gl_Normal)
- )));
- lightDir_2.xyz = _TerrainTreeLightDirections[1];
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[1] * max (0.0,
- dot (lightDir_2.xyz, gl_Normal)
- )));
- lightDir_2.xyz = _TerrainTreeLightDirections[2];
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[2] * max (0.0,
- dot (lightDir_2.xyz, gl_Normal)
- )));
- lightDir_2.xyz = _TerrainTreeLightDirections[3];
- lightColor_1.xyz = (lightColor_1 + (_TerrainTreeLightColors[3] * max (0.0,
- dot (lightDir_2.xyz, gl_Normal)
- ))).xyz;
- lightColor_1.w = 1.0;
- tmpvar_4.xyz = (lightColor_1 * _Color).xyz;
- tmpvar_4.w = 1.0;
- gl_Position = tmpvar_3;
- vec4 tmpvar_9;
- tmpvar_9.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_9.x = tmpvar_3.z;
- xlv_FOG = tmpvar_9;
- gl_TexCoord[0] = gl_MultiTexCoord0;
- gl_FrontColor = tmpvar_4;
-}
-
-
-// stats: 32 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 10 (total size: 0)
-// #0: gl_LightModel (high other) 0x0 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: _AO (high float) 1x1 [-1]
-// #3: _Color (high float) 4x1 [-1]
-// #4: _Scale (high float) 4x1 [-1]
-// #5: _SquashAmount (high float) 1x1 [-1]
-// #6: _SquashPlaneNormal (high float) 4x1 [-1]
-// #7: _TerrainEngineBendTree (high float) 4x4 [-1]
-// #8: _TerrainTreeLightColors (high float) 4x1 [4]
-// #9: _TerrainTreeLightDirections (high float) 3x1 [4]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-in.txt
deleted file mode 100644
index 3deff8f5833..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-in.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- float fog;
- vec4 uv;
- vec4 color;
-};
-struct appdata_tree {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 color;
- vec4 texcoord;
-};
-uniform float _AO;
-uniform vec4 _Color;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-uniform vec4 _TerrainTreeLightColors[4];
-uniform vec3 _TerrainTreeLightDirections[4];
-
-
-
-vec4 Squash( in vec4 pos );
-void TerrainAnimateTree( inout vec4 pos, in float alpha );
-v2f vert( in appdata_tree v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void TerrainAnimateTree( inout vec4 pos, in float alpha ) {
- vec3 bent;
- pos.xyz *= _Scale.xyz ;
- bent = ( _TerrainEngineBendTree * vec4( pos.xyz , 0.000000) ).xyz ;
- pos.xyz = mix( pos.xyz , bent, vec3( alpha));
- pos = Squash( pos);
-}
-v2f vert( in appdata_tree v ) {
- vec3 viewpos;
- v2f o;
- vec4 lightDir;
- vec4 lightColor;
- int i = 0;
- float atten = 1.00000;
- float occ;
- TerrainAnimateTree( v.vertex, v.color.w );
- viewpos = vec3( ( gl_ModelViewMatrix * v.vertex ));
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.fog = o.pos.z ;
- o.uv = v.texcoord;
- lightDir.w = _AO;
- lightColor = gl_LightModel.ambient;
- for ( ; (i < 4); ( i++ )) {
- lightDir.xyz = _TerrainTreeLightDirections[ i ];
- occ = dot( lightDir.xyz , v.normal);
- occ = max( 0.000000, occ);
- occ *= atten;
- lightColor += (_TerrainTreeLightColors[ i ] * occ);
- }
- lightColor.w = 1.00000;
- o.color = (lightColor * _Color);
- o.color.w = 1.00000;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f xl_retval;
- appdata_tree xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.color = vec4( gl_Color);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.uv);
- gl_FrontColor = vec4( xl_retval.color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt
deleted file mode 100644
index b9f328318c1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Soft_Occlusion_Leaves_rendertex-out.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-uniform float _AO;
-uniform vec4 _Color;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-uniform vec4 _TerrainTreeLightColors[4];
-uniform vec3 _TerrainTreeLightDirections[4];
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 lightColor_1;
- vec4 lightDir_2;
- vec4 tmpvar_3;
- vec4 tmpvar_4;
- vec4 pos_5;
- pos_5.w = gl_Vertex.w;
- pos_5.xyz = (gl_Vertex.xyz * _Scale.xyz);
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = pos_5.xyz;
- pos_5.xyz = mix (pos_5.xyz, (_TerrainEngineBendTree * tmpvar_6).xyz, gl_Color.www);
- vec3 tmpvar_7;
- tmpvar_7.xz = vec2(0.0, 0.0);
- tmpvar_7.y = _SquashPlaneNormal.w;
- vec4 tmpvar_8;
- tmpvar_8.w = 1.0;
- tmpvar_8.xyz = mix ((pos_5.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_7 - pos_5.xyz))
- * _SquashPlaneNormal.xyz)), pos_5.xyz, vec3(_SquashAmount));
- pos_5 = tmpvar_8;
- tmpvar_3 = (gl_ModelViewProjectionMatrix * tmpvar_8);
- lightDir_2.w = _AO;
- lightColor_1 = gl_LightModel.ambient;
- lightDir_2.xyz = _TerrainTreeLightDirections[0];
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0,
- dot (lightDir_2.xyz, gl_Normal)
- )));
- lightDir_2.xyz = _TerrainTreeLightDirections[1];
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[1] * max (0.0,
- dot (lightDir_2.xyz, gl_Normal)
- )));
- lightDir_2.xyz = _TerrainTreeLightDirections[2];
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[2] * max (0.0,
- dot (lightDir_2.xyz, gl_Normal)
- )));
- lightDir_2.xyz = _TerrainTreeLightDirections[3];
- lightColor_1.xyz = (lightColor_1 + (_TerrainTreeLightColors[3] * max (0.0,
- dot (lightDir_2.xyz, gl_Normal)
- ))).xyz;
- lightColor_1.w = 1.0;
- tmpvar_4.xyz = (lightColor_1 * _Color).xyz;
- tmpvar_4.w = 1.0;
- gl_Position = tmpvar_3;
- vec4 tmpvar_9;
- tmpvar_9.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_9.x = tmpvar_3.z;
- xlv_FOG = tmpvar_9;
- gl_TexCoord[0] = gl_MultiTexCoord0;
- gl_FrontColor = tmpvar_4;
-}
-
-
-// stats: 32 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 10 (total size: 0)
-// #0: gl_LightModel (high other) 0x0 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: _AO (high float) 1x1 [-1]
-// #3: _Color (high float) 4x1 [-1]
-// #4: _Scale (high float) 4x1 [-1]
-// #5: _SquashAmount (high float) 1x1 [-1]
-// #6: _SquashPlaneNormal (high float) 4x1 [-1]
-// #7: _TerrainEngineBendTree (high float) 4x4 [-1]
-// #8: _TerrainTreeLightColors (high float) 4x1 [4]
-// #9: _TerrainTreeLightDirections (high float) 3x1 [4]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-in.txt
deleted file mode 100644
index f3a8fd1b9f5..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-in.txt
+++ /dev/null
@@ -1,179 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_Control;
- vec2 uv_Splat0;
- vec2 uv_Splat1;
- vec2 uv_Splat2;
- vec2 uv_Splat3;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_pack1;
- vec2 hip_pack2;
- vec3 normal;
- vec3 vlight;
- vec4 _ShadowCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Control_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform vec4 _Splat0_ST;
-uniform vec4 _Splat1_ST;
-uniform vec4 _Splat2_ST;
-uniform vec4 _Splat3_ST;
-
-uniform vec4 unity_4LightAtten0;
-uniform vec4 unity_4LightPosX0;
-uniform vec4 unity_4LightPosY0;
-uniform vec4 unity_4LightPosZ0;
-uniform vec3 unity_LightColor0;
-uniform vec3 unity_LightColor1;
-uniform vec3 unity_LightColor2;
-uniform vec3 unity_LightColor3;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-vec3 ShadeSH9( in vec4 normal );
-vec3 Shade4PointLights( in vec4 lightPosX, in vec4 lightPosY, in vec4 lightPosZ, in vec3 lightColor0, in vec3 lightColor1, in vec3 lightColor2, in vec3 lightColor3, in vec4 lightAttenSq, in vec3 pos, in vec3 normal );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-vec3 ShadeSH9( in vec4 normal ) {
- vec3 x1;
- vec4 vB;
- vec3 x2;
- float vC;
- vec3 x3;
- x1.x = dot( unity_SHAr, normal);
- x1.y = dot( unity_SHAg, normal);
- x1.z = dot( unity_SHAb, normal);
- vB = (normal.xyzz * normal.yzzx );
- x2.x = dot( unity_SHBr, vB);
- x2.y = dot( unity_SHBg, vB);
- x2.z = dot( unity_SHBb, vB);
- vC = ((normal.x * normal.x ) - (normal.y * normal.y ));
- x3 = (unity_SHC.xyz * vC);
- return ((x1 + x2) + x3);
-}
-vec3 Shade4PointLights( in vec4 lightPosX, in vec4 lightPosY, in vec4 lightPosZ, in vec3 lightColor0, in vec3 lightColor1, in vec3 lightColor2, in vec3 lightColor3, in vec4 lightAttenSq, in vec3 pos, in vec3 normal ) {
- vec4 toLightX;
- vec4 toLightY;
- vec4 toLightZ;
- vec4 lengthSq;
- vec4 ndotl;
- vec4 corr;
- vec4 atten;
- vec4 diff;
- vec3 col;
- toLightX = (lightPosX - pos.x );
- toLightY = (lightPosY - pos.y );
- toLightZ = (lightPosZ - pos.z );
- lengthSq = vec4( 0.000000);
- lengthSq += (toLightX * toLightX);
- lengthSq += (toLightY * toLightY);
- lengthSq += (toLightZ * toLightZ);
- ndotl = vec4( 0.000000);
- ndotl += (toLightX * normal.x );
- ndotl += (toLightY * normal.y );
- ndotl += (toLightZ * normal.z );
- corr = inversesqrt( lengthSq );
- ndotl = max( vec4( 0.000000, 0.000000, 0.000000, 0.000000), (ndotl * corr));
- atten = (1.00000 / (1.00000 + (lengthSq * lightAttenSq)));
- diff = (ndotl * atten);
- col = vec3( 0.000000);
- col += (lightColor0 * diff.x );
- col += (lightColor1 * diff.y );
- col += (lightColor2 * diff.z );
- col += (lightColor3 * diff.w );
- return col;
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 worldN;
- vec3 shlight;
- vec3 worldPos;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _Control_ST.xy ) + _Control_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _Splat0_ST.xy ) + _Splat0_ST.zw );
- o.hip_pack1.xy = ((v.texcoord.xy * _Splat1_ST.xy ) + _Splat1_ST.zw );
- o.hip_pack1.zw = ((v.texcoord.xy * _Splat2_ST.xy ) + _Splat2_ST.zw );
- o.hip_pack2.xy = ((v.texcoord.xy * _Splat3_ST.xy ) + _Splat3_ST.zw );
- worldN = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.normal = worldN;
- shlight = ShadeSH9( vec4( worldN, 1.00000));
- o.vlight = shlight;
- worldPos = ( _Object2World * v.vertex ).xyz ;
- o.vlight += Shade4PointLights( unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, unity_LightColor0, unity_LightColor1, unity_LightColor2, unity_LightColor3, unity_4LightAtten0, worldPos, worldN);
- o._ShadowCoord = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.hip_pack1);
- gl_TexCoord[2] = vec4( xl_retval.hip_pack2, 0.0, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[4] = vec4( xl_retval.vlight, 0.0);
- gl_TexCoord[5] = vec4( xl_retval._ShadowCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt
deleted file mode 100644
index f7caa98ee2e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-AddPass-out.txt
+++ /dev/null
@@ -1,143 +0,0 @@
-uniform vec4 _Control_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform vec4 _Splat0_ST;
-uniform vec4 _Splat1_ST;
-uniform vec4 _Splat2_ST;
-uniform vec4 _Splat3_ST;
-uniform vec4 unity_4LightAtten0;
-uniform vec4 unity_4LightPosX0;
-uniform vec4 unity_4LightPosY0;
-uniform vec4 unity_4LightPosZ0;
-uniform vec3 unity_LightColor0;
-uniform vec3 unity_LightColor1;
-uniform vec3 unity_LightColor2;
-uniform vec3 unity_LightColor3;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 worldPos_1;
- vec3 worldN_2;
- vec4 tmpvar_3;
- vec4 tmpvar_4;
- vec4 pos_5;
- pos_5 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _Control_ST.xy) + _Control_ST.zw);
- tmpvar_3.zw = ((gl_MultiTexCoord0.xy * _Splat0_ST.xy) + _Splat0_ST.zw);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _Splat1_ST.xy) + _Splat1_ST.zw);
- tmpvar_4.zw = ((gl_MultiTexCoord0.xy * _Splat2_ST.xy) + _Splat2_ST.zw);
- mat3 tmpvar_6;
- tmpvar_6[0] = _Object2World[0].xyz;
- tmpvar_6[1] = _Object2World[1].xyz;
- tmpvar_6[2] = _Object2World[2].xyz;
- worldN_2 = (tmpvar_6 * (gl_Normal * unity_Scale.w));
- vec4 tmpvar_7;
- tmpvar_7.w = 1.0;
- tmpvar_7.xyz = worldN_2;
- vec3 x2_8;
- vec4 vB_9;
- vec3 x1_10;
- x1_10.x = dot (unity_SHAr, tmpvar_7);
- x1_10.y = dot (unity_SHAg, tmpvar_7);
- x1_10.z = dot (unity_SHAb, tmpvar_7);
- vB_9 = (worldN_2.xyzz * worldN_2.yzzx);
- x2_8.x = dot (unity_SHBr, vB_9);
- x2_8.y = dot (unity_SHBg, vB_9);
- x2_8.z = dot (unity_SHBb, vB_9);
- worldPos_1 = (_Object2World * gl_Vertex).xyz;
- vec3 col_11;
- vec4 diff_12;
- vec4 ndotl_13;
- vec4 lengthSq_14;
- vec4 toLightZ_15;
- vec4 toLightY_16;
- vec4 toLightX_17;
- toLightX_17 = (unity_4LightPosX0 - worldPos_1.x);
- toLightY_16 = (unity_4LightPosY0 - worldPos_1.y);
- toLightZ_15 = (unity_4LightPosZ0 - worldPos_1.z);
- lengthSq_14 = (toLightX_17 * toLightX_17);
- lengthSq_14 = (lengthSq_14 + (toLightY_16 * toLightY_16));
- lengthSq_14 = (lengthSq_14 + (toLightZ_15 * toLightZ_15));
- ndotl_13 = (toLightX_17 * worldN_2.x);
- ndotl_13 = (ndotl_13 + (toLightY_16 * worldN_2.y));
- ndotl_13 = (ndotl_13 + (toLightZ_15 * worldN_2.z));
- vec4 tmpvar_18;
- tmpvar_18 = max (vec4(0.0, 0.0, 0.0, 0.0), (ndotl_13 * inversesqrt(lengthSq_14)));
- ndotl_13 = tmpvar_18;
- diff_12 = (tmpvar_18 * (1.0/((1.0 +
- (lengthSq_14 * unity_4LightAtten0)
- ))));
- col_11 = (unity_LightColor0 * diff_12.x);
- col_11 = (col_11 + (unity_LightColor1 * diff_12.y));
- col_11 = (col_11 + (unity_LightColor2 * diff_12.z));
- col_11 = (col_11 + (unity_LightColor3 * diff_12.w));
- vec4 o_19;
- o_19 = (pos_5 * 0.5);
- vec2 tmpvar_20;
- tmpvar_20.x = o_19.x;
- tmpvar_20.y = (o_19.y * _ProjectionParams.x);
- o_19.xy = (tmpvar_20 + o_19.w);
- o_19.zw = pos_5.zw;
- gl_Position = pos_5;
- vec4 tmpvar_21;
- tmpvar_21.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_21.x = pos_5.z;
- xlv_FOG = tmpvar_21;
- gl_TexCoord[0] = tmpvar_3;
- gl_TexCoord[1] = tmpvar_4;
- vec4 tmpvar_22;
- tmpvar_22.zw = vec2(0.0, 0.0);
- tmpvar_22.xy = ((gl_MultiTexCoord0.xy * _Splat3_ST.xy) + _Splat3_ST.zw);
- gl_TexCoord[2] = tmpvar_22;
- vec4 tmpvar_23;
- tmpvar_23.w = 0.0;
- tmpvar_23.xyz = worldN_2;
- gl_TexCoord[3] = tmpvar_23;
- vec4 tmpvar_24;
- tmpvar_24.w = 0.0;
- tmpvar_24.xyz = (((x1_10 + x2_8) + (unity_SHC.xyz *
- ((worldN_2.x * worldN_2.x) - (worldN_2.y * worldN_2.y))
- )) + col_11);
- gl_TexCoord[4] = tmpvar_24;
- gl_TexCoord[5] = o_19;
-}
-
-
-// stats: 63 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 24 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _Control_ST (high float) 4x1 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
-// #4: _Splat0_ST (high float) 4x1 [-1]
-// #5: _Splat1_ST (high float) 4x1 [-1]
-// #6: _Splat2_ST (high float) 4x1 [-1]
-// #7: _Splat3_ST (high float) 4x1 [-1]
-// #8: unity_4LightAtten0 (high float) 4x1 [-1]
-// #9: unity_4LightPosX0 (high float) 4x1 [-1]
-// #10: unity_4LightPosY0 (high float) 4x1 [-1]
-// #11: unity_4LightPosZ0 (high float) 4x1 [-1]
-// #12: unity_LightColor0 (high float) 3x1 [-1]
-// #13: unity_LightColor1 (high float) 3x1 [-1]
-// #14: unity_LightColor2 (high float) 3x1 [-1]
-// #15: unity_LightColor3 (high float) 3x1 [-1]
-// #16: unity_SHAb (high float) 4x1 [-1]
-// #17: unity_SHAg (high float) 4x1 [-1]
-// #18: unity_SHAr (high float) 4x1 [-1]
-// #19: unity_SHBb (high float) 4x1 [-1]
-// #20: unity_SHBg (high float) 4x1 [-1]
-// #21: unity_SHBr (high float) 4x1 [-1]
-// #22: unity_SHC (high float) 4x1 [-1]
-// #23: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-in.txt
deleted file mode 100644
index 941fcce0965..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-in.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_Control;
- vec2 uv_Splat0;
- vec2 uv_Splat1;
- vec2 uv_Splat2;
- vec2 uv_Splat3;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_pack1;
- vec2 hip_pack2;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Control_ST;
-uniform vec4 _ProjectionParams;
-uniform vec4 _Splat0_ST;
-uniform vec4 _Splat1_ST;
-uniform vec4 _Splat2_ST;
-uniform vec4 _Splat3_ST;
-
-
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _Control_ST.xy ) + _Control_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _Splat0_ST.xy ) + _Splat0_ST.zw );
- o.hip_pack1.xy = ((v.texcoord.xy * _Splat1_ST.xy ) + _Splat1_ST.zw );
- o.hip_pack1.zw = ((v.texcoord.xy * _Splat2_ST.xy ) + _Splat2_ST.zw );
- o.hip_pack2.xy = ((v.texcoord.xy * _Splat3_ST.xy ) + _Splat3_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- o.hip_lmapFade.xy = ((v.texcoord1.xy * unity_LightmapST.xy ) + unity_LightmapST.zw );
- o.hip_lmapFade.z = ((( -( gl_ModelViewMatrix * v.vertex ).z ) * unity_LightmapFade.z ) + unity_LightmapFade.w );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.hip_pack1);
- gl_TexCoord[2] = vec4( xl_retval.hip_pack2, 0.0, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.hip_screen);
- gl_TexCoord[4] = vec4( xl_retval.hip_lmapFade, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt
deleted file mode 100644
index 56d239fc2da..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_TerrainEngine_Splatmap_Lightmap-FirstPass1-out.txt
+++ /dev/null
@@ -1,66 +0,0 @@
-uniform vec4 _Control_ST;
-uniform vec4 _ProjectionParams;
-uniform vec4 _Splat0_ST;
-uniform vec4 _Splat1_ST;
-uniform vec4 _Splat2_ST;
-uniform vec4 _Splat3_ST;
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 tmpvar_1;
- vec4 tmpvar_2;
- vec3 tmpvar_3;
- vec4 pos_4;
- pos_4 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _Control_ST.xy) + _Control_ST.zw);
- tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _Splat0_ST.xy) + _Splat0_ST.zw);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _Splat1_ST.xy) + _Splat1_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _Splat2_ST.xy) + _Splat2_ST.zw);
- vec4 o_5;
- o_5 = (pos_4 * 0.5);
- vec2 tmpvar_6;
- tmpvar_6.x = o_5.x;
- tmpvar_6.y = (o_5.y * _ProjectionParams.x);
- o_5.xy = (tmpvar_6 + o_5.w);
- o_5.zw = pos_4.zw;
- tmpvar_3.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
- tmpvar_3.z = ((-(
- (gl_ModelViewMatrix * gl_Vertex)
- .z) * unity_LightmapFade.z) + unity_LightmapFade.w);
- gl_Position = pos_4;
- vec4 tmpvar_7;
- tmpvar_7.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_7.x = pos_4.z;
- xlv_FOG = tmpvar_7;
- gl_TexCoord[0] = tmpvar_1;
- gl_TexCoord[1] = tmpvar_2;
- vec4 tmpvar_8;
- tmpvar_8.zw = vec2(0.0, 0.0);
- tmpvar_8.xy = ((gl_MultiTexCoord0.xy * _Splat3_ST.xy) + _Splat3_ST.zw);
- gl_TexCoord[2] = tmpvar_8;
- gl_TexCoord[3] = o_5;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = tmpvar_3;
- gl_TexCoord[4] = tmpvar_9;
-}
-
-
-// stats: 23 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 10 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _Control_ST (high float) 4x1 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
-// #4: _Splat0_ST (high float) 4x1 [-1]
-// #5: _Splat1_ST (high float) 4x1 [-1]
-// #6: _Splat2_ST (high float) 4x1 [-1]
-// #7: _Splat3_ST (high float) 4x1 [-1]
-// #8: unity_LightmapFade (high float) 4x1 [-1]
-// #9: unity_LightmapST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt
deleted file mode 100644
index 8c062b20ad4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-in.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec3 color;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _TerrainTreeLightColors[4];
-uniform vec3 _TerrainTreeLightDirections[4];
-
-
-v2f vert( in appdata_full v );
-v2f vert( in appdata_full v ) {
- v2f o;
- vec3 lightColor;
- int i = 0;
- vec3 lightDir;
- float diff;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.uv = v.texcoord.xy ;
- lightColor = gl_LightModel.ambient.xyz ;
- for ( ; (i < 4); ( i++ )) {
- lightDir.xyz = _TerrainTreeLightDirections[ i ];
- diff = max( 0.000000, dot( lightDir.xyz , v.normal));
- lightColor += vec3( (_TerrainTreeLightColors[ i ] * diff));
- }
- o.color = (lightColor * v.color.w );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.uv, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.color, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt
deleted file mode 100644
index 67ca3b3688c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Bark_Shader_Rendertex-out.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-uniform vec4 _TerrainTreeLightColors[4];
-uniform vec3 _TerrainTreeLightDirections[4];
-void main ()
-{
- vec3 lightColor_1;
- lightColor_1 = gl_LightModel.ambient.xyz;
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0,
- dot (_TerrainTreeLightDirections[0], gl_Normal)
- )).xyz);
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[1] * max (0.0,
- dot (_TerrainTreeLightDirections[1], gl_Normal)
- )).xyz);
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[2] * max (0.0,
- dot (_TerrainTreeLightDirections[2], gl_Normal)
- )).xyz);
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[3] * max (0.0,
- dot (_TerrainTreeLightDirections[3], gl_Normal)
- )).xyz);
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_2;
- tmpvar_2.zw = vec2(0.0, 0.0);
- tmpvar_2.xy = gl_MultiTexCoord0.xy;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_3;
- tmpvar_3.w = 0.0;
- tmpvar_3.xyz = (lightColor_1 * gl_Color.w);
- gl_TexCoord[1] = tmpvar_3;
-}
-
-
-// stats: 20 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 4 (total size: 0)
-// #0: gl_LightModel (high other) 0x0 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: _TerrainTreeLightColors (high float) 4x1 [4]
-// #3: _TerrainTreeLightDirections (high float) 3x1 [4]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt
deleted file mode 100644
index 7f2f234846a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-in.txt
+++ /dev/null
@@ -1,94 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec3 color;
-};
-uniform vec4 _TerrainTreeLightColors[4];
-uniform vec3 _TerrainTreeLightDirections[4];
-
-
-
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent );
-v2f vert( in appdata_full v );
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent ) {
- float isBillboard;
- vec3 norb;
- vec3 tanb;
- isBillboard = (1.00000 - abs( tangent.w ));
- norb = vec3( normalize( ( vec4( normal, 0.000000) * mat ) ));
- tanb = vec3( normalize( ( vec4( normal.z , 0.000000, ( -normal.x ), 0.000000) * mat ) ));
- pos += (( tangent * mat ) * isBillboard);
- normal = mix( normal, norb, vec3( isBillboard));
- tangent = mix( tangent, vec4( tanb, -1.00000), vec4( isBillboard));
-}
-v2f vert( in appdata_full v ) {
- v2f o;
- vec3 lightColor;
- int i = 0;
- vec3 lightDir;
- float diff;
- ExpandBillboard( gl_ModelViewMatrixInverseTranspose, v.vertex, v.normal, v.tangent);
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.uv = v.texcoord.xy ;
- lightColor = gl_LightModel.ambient.xyz ;
- for ( ; (i < 4); ( i++ )) {
- lightDir.xyz = _TerrainTreeLightDirections[ i ];
- diff = max( 0.000000, ((dot( lightDir.xyz , v.normal) * 0.500000) + 0.500000));
- lightColor += vec3( (_TerrainTreeLightColors[ i ] * diff));
- }
- o.color = (lightColor * v.color.w );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.uv, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.color, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt
deleted file mode 100644
index 3b432b624db..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Leaf_Shader_Rendertex-out.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-uniform vec4 _TerrainTreeLightColors[4];
-uniform vec3 _TerrainTreeLightDirections[4];
-attribute vec4 TANGENT;
-void main ()
-{
- vec3 lightColor_1;
- float isBillboard_2;
- isBillboard_2 = (1.0 - abs(TANGENT.w));
- vec4 tmpvar_3;
- tmpvar_3.w = 0.0;
- tmpvar_3.xyz = gl_Normal;
- vec3 tmpvar_4;
- tmpvar_4 = mix (gl_Normal, normalize((tmpvar_3 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(isBillboard_2));
- lightColor_1 = gl_LightModel.ambient.xyz;
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[0] * max (0.0,
- ((dot (_TerrainTreeLightDirections[0], tmpvar_4) * 0.5) + 0.5)
- )).xyz);
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[1] * max (0.0,
- ((dot (_TerrainTreeLightDirections[1], tmpvar_4) * 0.5) + 0.5)
- )).xyz);
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[2] * max (0.0,
- ((dot (_TerrainTreeLightDirections[2], tmpvar_4) * 0.5) + 0.5)
- )).xyz);
- lightColor_1 = (lightColor_1 + (_TerrainTreeLightColors[3] * max (0.0,
- ((dot (_TerrainTreeLightDirections[3], tmpvar_4) * 0.5) + 0.5)
- )).xyz);
- gl_Position = (gl_ModelViewProjectionMatrix * (gl_Vertex + (
- (TANGENT * gl_ModelViewMatrixInverseTranspose)
- * isBillboard_2)));
- vec4 tmpvar_5;
- tmpvar_5.zw = vec2(0.0, 0.0);
- tmpvar_5.xy = gl_MultiTexCoord0.xy;
- gl_TexCoord[0] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = (lightColor_1 * gl_Color.w);
- gl_TexCoord[1] = tmpvar_6;
-}
-
-
-// stats: 37 alu 0 tex 0 flow
-// inputs: 5
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// #4: TANGENT (high float) 4x1 [-1]
-// uniforms: 5 (total size: 0)
-// #0: gl_LightModel (high other) 0x0 [-1]
-// #1: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #2: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #3: _TerrainTreeLightColors (high float) 4x1 [4]
-// #4: _TerrainTreeLightDirections (high float) 3x1 [4]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-in.txt
deleted file mode 100644
index 98804e6fe6e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-in.txt
+++ /dev/null
@@ -1,175 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
- vec3 _LightCoord;
-};
-uniform vec4 _Color;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec4 Squash( in vec4 pos );
-vec4 TriangleWave( in vec4 x );
-vec4 SmoothCurve( in vec4 x );
-vec4 SmoothTriangleWave( in vec4 x );
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams );
-void TreeVertBark( inout appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-vec4 TriangleWave( in vec4 x ) {
- return abs( ((fract( (x + 0.500000) ) * 2.00000) - 1.00000) );
-}
-vec4 SmoothCurve( in vec4 x ) {
- return ((x * x) * (3.00000 - (2.00000 * x)));
-}
-vec4 SmoothTriangleWave( in vec4 x ) {
- return SmoothCurve( TriangleWave( x));
-}
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams ) {
- float fDetailAmp = 0.100000;
- float fBranchAmp = 0.300000;
- float fObjPhase;
- float fBranchPhase;
- float fVtxPhase;
- vec2 vWavesIn;
- vec4 vWaves;
- vec2 vWavesSum;
- vec3 bend;
- fObjPhase = dot( _Object2World[ 3 ].xyz , vec3( 1.00000));
- fBranchPhase = (fObjPhase + animParams.x );
- fVtxPhase = dot( pos.xyz , vec3( (animParams.y + fBranchPhase)));
- vWavesIn = (_TimeX + vec2( fVtxPhase, fBranchPhase));
- vWaves = ((fract( (vWavesIn.xxyy * vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000);
- vWaves = SmoothTriangleWave( vWaves);
- vWavesSum = (vWaves.xz + vWaves.yw );
- bend = ((animParams.y * fDetailAmp) * normal.xyz );
- bend.y = (animParams.w * fBranchAmp);
- pos.xyz += (((vWavesSum.xyx * bend) + ((_Wind.xyz * vWavesSum.y ) * animParams.w )) * _Wind.w );
- pos.xyz += (animParams.z * _Wind.xyz );
- return pos;
-}
-void TreeVertBark( inout appdata_full v ) {
- v.vertex.xyz *= _Scale.xyz ;
- v.vertex = AnimateVertex( v.vertex, v.normal, vec4( v.color.xy , v.texcoord1.xy ));
- v.vertex = Squash( v.vertex);
- v.color = vec4( (v.color.w * _Color.xyz ), _Color.w );
- v.normal = normalize( v.normal );
- v.tangent.xyz = normalize( v.tangent.xyz );
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return ((objSpaceLightPos.xyz * unity_Scale.w ) - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- TreeVertBark( v);
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_FrontColor = vec4( xl_retval.lop_color);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt
deleted file mode 100644
index a11d06d2f41..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader-out.txt
+++ /dev/null
@@ -1,137 +0,0 @@
-uniform vec4 _Color;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 tmpvar_3;
- tmpvar_2.w = gl_Vertex.w;
- tmpvar_3.w = TANGENT.w;
- tmpvar_2.xyz = (gl_Vertex.xyz * _Scale.xyz);
- vec4 pos_4;
- pos_4.w = tmpvar_2.w;
- vec3 bend_5;
- vec2 vWavesSum_6;
- vec4 vWaves_7;
- float fBranchPhase_8;
- fBranchPhase_8 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
- vec2 tmpvar_9;
- tmpvar_9.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_8)));
- tmpvar_9.y = fBranchPhase_8;
- vWaves_7 = ((fract(
- ((_TimeX + tmpvar_9).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
- ) * 2.0) - 1.0);
- vec4 tmpvar_10;
- tmpvar_10 = abs(((
- fract((vWaves_7 + 0.5))
- * 2.0) - 1.0));
- vec4 tmpvar_11;
- tmpvar_11 = ((tmpvar_10 * tmpvar_10) * (3.0 - (2.0 * tmpvar_10)));
- vWaves_7 = tmpvar_11;
- vWavesSum_6 = (tmpvar_11.xz + tmpvar_11.yw);
- bend_5.xz = ((gl_Color.y * 0.1) * gl_Normal).xz;
- bend_5.y = (gl_MultiTexCoord1.y * 0.3);
- pos_4.xyz = (tmpvar_2.xyz + ((
- (vWavesSum_6.xyx * bend_5)
- +
- ((_Wind.xyz * vWavesSum_6.y) * gl_MultiTexCoord1.y)
- ) * _Wind.w));
- pos_4.xyz = (pos_4.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
- vec3 tmpvar_12;
- tmpvar_12.xz = vec2(0.0, 0.0);
- tmpvar_12.y = _SquashPlaneNormal.w;
- vec3 tmpvar_13;
- tmpvar_13 = mix ((pos_4.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_12 - pos_4.xyz))
- * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount));
- vec4 tmpvar_14;
- tmpvar_14.w = 1.0;
- tmpvar_14.xyz = tmpvar_13;
- tmpvar_2 = tmpvar_14;
- vec4 tmpvar_15;
- tmpvar_15.xyz = (gl_Color.w * _Color.xyz);
- tmpvar_15.w = _Color.w;
- vec3 tmpvar_16;
- tmpvar_16 = normalize(gl_Normal);
- tmpvar_3.xyz = normalize(TANGENT.xyz);
- vec4 pos_17;
- pos_17 = (gl_ModelViewProjectionMatrix * tmpvar_14);
- binormal_1 = (((tmpvar_16.yzx * tmpvar_3.zxy) - (tmpvar_16.zxy * tmpvar_3.yzx)) * TANGENT.w);
- mat3 tmpvar_18;
- tmpvar_18[0].x = tmpvar_3.x;
- tmpvar_18[0].y = binormal_1.x;
- tmpvar_18[0].z = tmpvar_16.x;
- tmpvar_18[1].x = tmpvar_3.y;
- tmpvar_18[1].y = binormal_1.y;
- tmpvar_18[1].z = tmpvar_16.y;
- tmpvar_18[2].x = tmpvar_3.z;
- tmpvar_18[2].y = binormal_1.z;
- tmpvar_18[2].z = tmpvar_16.z;
- vec4 tmpvar_19;
- tmpvar_19.w = 1.0;
- tmpvar_19.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_17;
- vec4 tmpvar_20;
- tmpvar_20.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_20.x = pos_17.z;
- xlv_FOG = tmpvar_20;
- vec4 tmpvar_21;
- tmpvar_21.zw = vec2(0.0, 0.0);
- tmpvar_21.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_21;
- gl_FrontColor = tmpvar_15;
- vec4 tmpvar_22;
- tmpvar_22.w = 0.0;
- tmpvar_22.xyz = (tmpvar_18 * ((
- (_World2Object * _WorldSpaceLightPos0)
- .xyz * unity_Scale.w) - tmpvar_13));
- gl_TexCoord[1] = tmpvar_22;
- vec4 tmpvar_23;
- tmpvar_23.w = 0.0;
- tmpvar_23.xyz = (tmpvar_18 * ((
- (_World2Object * tmpvar_19)
- .xyz * unity_Scale.w) - tmpvar_13));
- gl_TexCoord[2] = tmpvar_23;
- vec4 tmpvar_24;
- tmpvar_24.w = 0.0;
- tmpvar_24.xyz = (_LightMatrix0 * (_Object2World * tmpvar_14)).xyz;
- gl_TexCoord[3] = tmpvar_24;
-}
-
-
-// stats: 64 alu 0 tex 0 flow
-// inputs: 6
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Color (high float) 4x1 [-1] loc 3
-// #3: gl_Normal (high float) 3x1 [-1] loc 2
-// #4: gl_Vertex (high float) 4x1 [-1] loc 0
-// #5: TANGENT (high float) 4x1 [-1]
-// uniforms: 14 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _Color (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _Scale (high float) 4x1 [-1]
-// #6: _SquashAmount (high float) 1x1 [-1]
-// #7: _SquashPlaneNormal (high float) 4x1 [-1]
-// #8: _TimeX (high float) 1x1 [-1]
-// #9: _Wind (high float) 4x1 [-1]
-// #10: _World2Object (high float) 4x4 [-1]
-// #11: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #12: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #13: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt
deleted file mode 100644
index 7e31c439e72..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-in.txt
+++ /dev/null
@@ -1,135 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
-};
-uniform vec4 _Color;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-
-uniform vec4 unity_LightShadowBias;
-vec4 Squash( in vec4 pos );
-vec4 TriangleWave( in vec4 x );
-vec4 SmoothCurve( in vec4 x );
-vec4 SmoothTriangleWave( in vec4 x );
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams );
-void TreeVertBark( inout appdata_full v );
-v2f_surf vert_surf( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-vec4 TriangleWave( in vec4 x ) {
- return abs( ((fract( (x + 0.500000) ) * 2.00000) - 1.00000) );
-}
-vec4 SmoothCurve( in vec4 x ) {
- return ((x * x) * (3.00000 - (2.00000 * x)));
-}
-vec4 SmoothTriangleWave( in vec4 x ) {
- return SmoothCurve( TriangleWave( x));
-}
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams ) {
- float fDetailAmp = 0.100000;
- float fBranchAmp = 0.300000;
- float fObjPhase;
- float fBranchPhase;
- float fVtxPhase;
- vec2 vWavesIn;
- vec4 vWaves;
- vec2 vWavesSum;
- vec3 bend;
- fObjPhase = dot( _Object2World[ 3 ].xyz , vec3( 1.00000));
- fBranchPhase = (fObjPhase + animParams.x );
- fVtxPhase = dot( pos.xyz , vec3( (animParams.y + fBranchPhase)));
- vWavesIn = (_TimeX + vec2( fVtxPhase, fBranchPhase));
- vWaves = ((fract( (vWavesIn.xxyy * vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000);
- vWaves = SmoothTriangleWave( vWaves);
- vWavesSum = (vWaves.xz + vWaves.yw );
- bend = ((animParams.y * fDetailAmp) * normal.xyz );
- bend.y = (animParams.w * fBranchAmp);
- pos.xyz += (((vWavesSum.xyx * bend) + ((_Wind.xyz * vWavesSum.y ) * animParams.w )) * _Wind.w );
- pos.xyz += (animParams.z * _Wind.xyz );
- return pos;
-}
-void TreeVertBark( inout appdata_full v ) {
- v.vertex.xyz *= _Scale.xyz ;
- v.vertex = AnimateVertex( v.vertex, v.normal, vec4( v.color.xy , v.texcoord1.xy ));
- v.vertex = Squash( v.vertex);
- v.color = vec4( (v.color.w * _Color.xyz ), _Color.w );
- v.normal = normalize( v.normal );
- v.tangent.xyz = normalize( v.tangent.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- TreeVertBark( v);
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.pos.z += unity_LightShadowBias.x ;
- if ( (o.pos.z < ( -o.pos.w )) ){
- o.pos.z = ( -o.pos.w );
- }
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt
deleted file mode 100644
index 01d1b22661c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Bark_Shader1-out.txt
+++ /dev/null
@@ -1,75 +0,0 @@
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform vec4 unity_LightShadowBias;
-void main ()
-{
- vec4 tmpvar_1;
- vec4 tmpvar_2;
- tmpvar_2.w = gl_Vertex.w;
- tmpvar_2.xyz = (gl_Vertex.xyz * _Scale.xyz);
- vec4 pos_3;
- pos_3.w = tmpvar_2.w;
- vec3 bend_4;
- vec2 vWavesSum_5;
- vec4 vWaves_6;
- float fBranchPhase_7;
- fBranchPhase_7 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
- vec2 tmpvar_8;
- tmpvar_8.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_7)));
- tmpvar_8.y = fBranchPhase_7;
- vWaves_6 = ((fract(
- ((_TimeX + tmpvar_8).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
- ) * 2.0) - 1.0);
- vec4 tmpvar_9;
- tmpvar_9 = abs(((
- fract((vWaves_6 + 0.5))
- * 2.0) - 1.0));
- vec4 tmpvar_10;
- tmpvar_10 = ((tmpvar_9 * tmpvar_9) * (3.0 - (2.0 * tmpvar_9)));
- vWaves_6 = tmpvar_10;
- vWavesSum_5 = (tmpvar_10.xz + tmpvar_10.yw);
- bend_4.xz = ((gl_Color.y * 0.1) * gl_Normal).xz;
- bend_4.y = (gl_MultiTexCoord1.y * 0.3);
- pos_3.xyz = (tmpvar_2.xyz + ((
- (vWavesSum_5.xyx * bend_4)
- +
- ((_Wind.xyz * vWavesSum_5.y) * gl_MultiTexCoord1.y)
- ) * _Wind.w));
- pos_3.xyz = (pos_3.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
- vec3 tmpvar_11;
- tmpvar_11.xz = vec2(0.0, 0.0);
- tmpvar_11.y = _SquashPlaneNormal.w;
- vec4 tmpvar_12;
- tmpvar_12.w = 1.0;
- tmpvar_12.xyz = mix ((pos_3.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_11 - pos_3.xyz))
- * _SquashPlaneNormal.xyz)), pos_3.xyz, vec3(_SquashAmount));
- tmpvar_2 = tmpvar_12;
- tmpvar_1 = (gl_ModelViewProjectionMatrix * tmpvar_12);
- tmpvar_1.z = (tmpvar_1.z + unity_LightShadowBias.x);
- if ((tmpvar_1.z < -(tmpvar_1.w))) {
- tmpvar_1.z = -(tmpvar_1.w);
- };
- gl_Position = tmpvar_1;
-}
-
-
-// stats: 43 alu 0 tex 1 flow
-// inputs: 4
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 8 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _Object2World (high float) 4x4 [-1]
-// #2: _Scale (high float) 4x1 [-1]
-// #3: _SquashAmount (high float) 1x1 [-1]
-// #4: _SquashPlaneNormal (high float) 4x1 [-1]
-// #5: _TimeX (high float) 1x1 [-1]
-// #6: _Wind (high float) 4x1 [-1]
-// #7: unity_LightShadowBias (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt
deleted file mode 100644
index 52ba20e7e8b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-in.txt
+++ /dev/null
@@ -1,185 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
-};
-uniform vec4 _Color;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-
-uniform vec4 unity_Scale;
-vec4 Squash( in vec4 pos );
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent );
-vec4 TriangleWave( in vec4 x );
-vec4 SmoothCurve( in vec4 x );
-vec4 SmoothTriangleWave( in vec4 x );
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams );
-void TreeVertLeaf( inout appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent ) {
- float isBillboard;
- vec3 norb;
- vec3 tanb;
- isBillboard = (1.00000 - abs( tangent.w ));
- norb = vec3( normalize( ( vec4( normal, 0.000000) * mat ) ));
- tanb = vec3( normalize( ( vec4( normal.z , 0.000000, ( -normal.x ), 0.000000) * mat ) ));
- pos += (( tangent * mat ) * isBillboard);
- normal = mix( normal, norb, vec3( isBillboard));
- tangent = mix( tangent, vec4( tanb, -1.00000), vec4( isBillboard));
-}
-vec4 TriangleWave( in vec4 x ) {
- return abs( ((fract( (x + 0.500000) ) * 2.00000) - 1.00000) );
-}
-vec4 SmoothCurve( in vec4 x ) {
- return ((x * x) * (3.00000 - (2.00000 * x)));
-}
-vec4 SmoothTriangleWave( in vec4 x ) {
- return SmoothCurve( TriangleWave( x));
-}
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams ) {
- float fDetailAmp = 0.100000;
- float fBranchAmp = 0.300000;
- float fObjPhase;
- float fBranchPhase;
- float fVtxPhase;
- vec2 vWavesIn;
- vec4 vWaves;
- vec2 vWavesSum;
- vec3 bend;
- fObjPhase = dot( _Object2World[ 3 ].xyz , vec3( 1.00000));
- fBranchPhase = (fObjPhase + animParams.x );
- fVtxPhase = dot( pos.xyz , vec3( (animParams.y + fBranchPhase)));
- vWavesIn = (_TimeX + vec2( fVtxPhase, fBranchPhase));
- vWaves = ((fract( (vWavesIn.xxyy * vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000);
- vWaves = SmoothTriangleWave( vWaves);
- vWavesSum = (vWaves.xz + vWaves.yw );
- bend = ((animParams.y * fDetailAmp) * normal.xyz );
- bend.y = (animParams.w * fBranchAmp);
- pos.xyz += (((vWavesSum.xyx * bend) + ((_Wind.xyz * vWavesSum.y ) * animParams.w )) * _Wind.w );
- pos.xyz += (animParams.z * _Wind.xyz );
- return pos;
-}
-void TreeVertLeaf( inout appdata_full v ) {
- ExpandBillboard( gl_ModelViewMatrixInverseTranspose, v.vertex, v.normal, v.tangent);
- v.vertex.xyz *= _Scale.xyz ;
- v.vertex = AnimateVertex( v.vertex, v.normal, vec4( v.color.xy , v.texcoord1.xy ));
- v.vertex = Squash( v.vertex);
- v.color = vec4( (v.color.w * _Color.xyz ), _Color.w );
- v.normal = normalize( v.normal );
- v.tangent.xyz = normalize( v.tangent.xyz );
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return objSpaceLightPos.xyz ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- TreeVertLeaf( v);
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_FrontColor = vec4( xl_retval.lop_color);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.viewDir, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt
deleted file mode 100644
index 1289993f127..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader-out.txt
+++ /dev/null
@@ -1,148 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 tmpvar_3;
- vec4 pos_4;
- float isBillboard_5;
- isBillboard_5 = (1.0 - abs(TANGENT.w));
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = gl_Normal;
- vec4 tmpvar_7;
- tmpvar_7.yw = vec2(0.0, 0.0);
- tmpvar_7.x = gl_Normal.z;
- tmpvar_7.z = -(gl_Normal.x);
- pos_4 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * isBillboard_5));
- vec3 tmpvar_8;
- tmpvar_8 = mix (gl_Normal, normalize((tmpvar_6 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(isBillboard_5));
- vec4 tmpvar_9;
- tmpvar_9.w = -1.0;
- tmpvar_9.xyz = normalize((tmpvar_7 * gl_ModelViewMatrixInverseTranspose)).xyz;
- vec4 tmpvar_10;
- tmpvar_10 = mix (TANGENT, tmpvar_9, vec4(isBillboard_5));
- tmpvar_2.w = pos_4.w;
- tmpvar_3.w = tmpvar_10.w;
- tmpvar_2.xyz = (pos_4.xyz * _Scale.xyz);
- vec4 pos_11;
- pos_11.w = tmpvar_2.w;
- vec3 bend_12;
- vec2 vWavesSum_13;
- vec4 vWaves_14;
- float fBranchPhase_15;
- fBranchPhase_15 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
- vec2 tmpvar_16;
- tmpvar_16.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_15)));
- tmpvar_16.y = fBranchPhase_15;
- vWaves_14 = ((fract(
- ((_TimeX + tmpvar_16).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
- ) * 2.0) - 1.0);
- vec4 tmpvar_17;
- tmpvar_17 = abs(((
- fract((vWaves_14 + 0.5))
- * 2.0) - 1.0));
- vec4 tmpvar_18;
- tmpvar_18 = ((tmpvar_17 * tmpvar_17) * (3.0 - (2.0 * tmpvar_17)));
- vWaves_14 = tmpvar_18;
- vWavesSum_13 = (tmpvar_18.xz + tmpvar_18.yw);
- bend_12.xz = ((gl_Color.y * 0.1) * tmpvar_8).xz;
- bend_12.y = (gl_MultiTexCoord1.y * 0.3);
- pos_11.xyz = (tmpvar_2.xyz + ((
- (vWavesSum_13.xyx * bend_12)
- +
- ((_Wind.xyz * vWavesSum_13.y) * gl_MultiTexCoord1.y)
- ) * _Wind.w));
- pos_11.xyz = (pos_11.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
- vec3 tmpvar_19;
- tmpvar_19.xz = vec2(0.0, 0.0);
- tmpvar_19.y = _SquashPlaneNormal.w;
- vec3 tmpvar_20;
- tmpvar_20 = mix ((pos_11.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_19 - pos_11.xyz))
- * _SquashPlaneNormal.xyz)), pos_11.xyz, vec3(_SquashAmount));
- vec4 tmpvar_21;
- tmpvar_21.w = 1.0;
- tmpvar_21.xyz = tmpvar_20;
- tmpvar_2 = tmpvar_21;
- vec4 tmpvar_22;
- tmpvar_22.xyz = (gl_Color.w * _Color.xyz);
- tmpvar_22.w = _Color.w;
- vec3 tmpvar_23;
- tmpvar_23 = normalize(tmpvar_8);
- tmpvar_3.xyz = normalize(tmpvar_10.xyz);
- vec4 pos_24;
- pos_24 = (gl_ModelViewProjectionMatrix * tmpvar_21);
- binormal_1 = (((tmpvar_23.yzx * tmpvar_3.zxy) - (tmpvar_23.zxy * tmpvar_3.yzx)) * tmpvar_10.w);
- mat3 tmpvar_25;
- tmpvar_25[0].x = tmpvar_3.x;
- tmpvar_25[0].y = binormal_1.x;
- tmpvar_25[0].z = tmpvar_23.x;
- tmpvar_25[1].x = tmpvar_3.y;
- tmpvar_25[1].y = binormal_1.y;
- tmpvar_25[1].z = tmpvar_23.y;
- tmpvar_25[2].x = tmpvar_3.z;
- tmpvar_25[2].y = binormal_1.z;
- tmpvar_25[2].z = tmpvar_23.z;
- vec4 tmpvar_26;
- tmpvar_26.w = 1.0;
- tmpvar_26.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_24;
- vec4 tmpvar_27;
- tmpvar_27.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_27.x = pos_24.z;
- xlv_FOG = tmpvar_27;
- vec4 tmpvar_28;
- tmpvar_28.zw = vec2(0.0, 0.0);
- tmpvar_28.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_28;
- gl_FrontColor = tmpvar_22;
- vec4 tmpvar_29;
- tmpvar_29.w = 0.0;
- tmpvar_29.xyz = (tmpvar_25 * (_World2Object * _WorldSpaceLightPos0).xyz);
- gl_TexCoord[1] = tmpvar_29;
- vec4 tmpvar_30;
- tmpvar_30.w = 0.0;
- tmpvar_30.xyz = (tmpvar_25 * ((
- (_World2Object * tmpvar_26)
- .xyz * unity_Scale.w) - tmpvar_20));
- gl_TexCoord[2] = tmpvar_30;
-}
-
-
-// stats: 74 alu 0 tex 0 flow
-// inputs: 6
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Color (high float) 4x1 [-1] loc 3
-// #3: gl_Normal (high float) 3x1 [-1] loc 2
-// #4: gl_Vertex (high float) 4x1 [-1] loc 0
-// #5: TANGENT (high float) 4x1 [-1]
-// uniforms: 14 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: _Color (high float) 4x1 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _Scale (high float) 4x1 [-1]
-// #6: _SquashAmount (high float) 1x1 [-1]
-// #7: _SquashPlaneNormal (high float) 4x1 [-1]
-// #8: _TimeX (high float) 1x1 [-1]
-// #9: _Wind (high float) 4x1 [-1]
-// #10: _World2Object (high float) 4x4 [-1]
-// #11: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #12: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #13: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt
deleted file mode 100644
index 886c919c50e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-in.txt
+++ /dev/null
@@ -1,189 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
- vec3 _LightCoord;
-};
-uniform vec4 _Color;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-
-uniform vec4 unity_Scale;
-vec4 Squash( in vec4 pos );
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent );
-vec4 TriangleWave( in vec4 x );
-vec4 SmoothCurve( in vec4 x );
-vec4 SmoothTriangleWave( in vec4 x );
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams );
-void TreeVertLeaf( inout appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent ) {
- float isBillboard;
- vec3 norb;
- vec3 tanb;
- isBillboard = (1.00000 - abs( tangent.w ));
- norb = vec3( normalize( ( vec4( normal, 0.000000) * mat ) ));
- tanb = vec3( normalize( ( vec4( normal.z , 0.000000, ( -normal.x ), 0.000000) * mat ) ));
- pos += (( tangent * mat ) * isBillboard);
- normal = mix( normal, norb, vec3( isBillboard));
- tangent = mix( tangent, vec4( tanb, -1.00000), vec4( isBillboard));
-}
-vec4 TriangleWave( in vec4 x ) {
- return abs( ((fract( (x + 0.500000) ) * 2.00000) - 1.00000) );
-}
-vec4 SmoothCurve( in vec4 x ) {
- return ((x * x) * (3.00000 - (2.00000 * x)));
-}
-vec4 SmoothTriangleWave( in vec4 x ) {
- return SmoothCurve( TriangleWave( x));
-}
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams ) {
- float fDetailAmp = 0.100000;
- float fBranchAmp = 0.300000;
- float fObjPhase;
- float fBranchPhase;
- float fVtxPhase;
- vec2 vWavesIn;
- vec4 vWaves;
- vec2 vWavesSum;
- vec3 bend;
- fObjPhase = dot( _Object2World[ 3 ].xyz , vec3( 1.00000));
- fBranchPhase = (fObjPhase + animParams.x );
- fVtxPhase = dot( pos.xyz , vec3( (animParams.y + fBranchPhase)));
- vWavesIn = (_TimeX + vec2( fVtxPhase, fBranchPhase));
- vWaves = ((fract( (vWavesIn.xxyy * vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000);
- vWaves = SmoothTriangleWave( vWaves);
- vWavesSum = (vWaves.xz + vWaves.yw );
- bend = ((animParams.y * fDetailAmp) * normal.xyz );
- bend.y = (animParams.w * fBranchAmp);
- pos.xyz += (((vWavesSum.xyx * bend) + ((_Wind.xyz * vWavesSum.y ) * animParams.w )) * _Wind.w );
- pos.xyz += (animParams.z * _Wind.xyz );
- return pos;
-}
-void TreeVertLeaf( inout appdata_full v ) {
- ExpandBillboard( gl_ModelViewMatrixInverseTranspose, v.vertex, v.normal, v.tangent);
- v.vertex.xyz *= _Scale.xyz ;
- v.vertex = AnimateVertex( v.vertex, v.normal, vec4( v.color.xy , v.texcoord1.xy ));
- v.vertex = Squash( v.vertex);
- v.color = vec4( (v.color.w * _Color.xyz ), _Color.w );
- v.normal = normalize( v.normal );
- v.tangent.xyz = normalize( v.tangent.xyz );
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return ((objSpaceLightPos.xyz * unity_Scale.w ) - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- TreeVertLeaf( v);
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_FrontColor = vec4( xl_retval.lop_color);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt
deleted file mode 100644
index 1dbc26587e3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Tree_Optimized_Leaf_Shader1-out.txt
+++ /dev/null
@@ -1,156 +0,0 @@
-uniform vec4 _Color;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 tmpvar_3;
- vec4 pos_4;
- float isBillboard_5;
- isBillboard_5 = (1.0 - abs(TANGENT.w));
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = gl_Normal;
- vec4 tmpvar_7;
- tmpvar_7.yw = vec2(0.0, 0.0);
- tmpvar_7.x = gl_Normal.z;
- tmpvar_7.z = -(gl_Normal.x);
- pos_4 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * isBillboard_5));
- vec3 tmpvar_8;
- tmpvar_8 = mix (gl_Normal, normalize((tmpvar_6 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(isBillboard_5));
- vec4 tmpvar_9;
- tmpvar_9.w = -1.0;
- tmpvar_9.xyz = normalize((tmpvar_7 * gl_ModelViewMatrixInverseTranspose)).xyz;
- vec4 tmpvar_10;
- tmpvar_10 = mix (TANGENT, tmpvar_9, vec4(isBillboard_5));
- tmpvar_2.w = pos_4.w;
- tmpvar_3.w = tmpvar_10.w;
- tmpvar_2.xyz = (pos_4.xyz * _Scale.xyz);
- vec4 pos_11;
- pos_11.w = tmpvar_2.w;
- vec3 bend_12;
- vec2 vWavesSum_13;
- vec4 vWaves_14;
- float fBranchPhase_15;
- fBranchPhase_15 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
- vec2 tmpvar_16;
- tmpvar_16.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_15)));
- tmpvar_16.y = fBranchPhase_15;
- vWaves_14 = ((fract(
- ((_TimeX + tmpvar_16).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
- ) * 2.0) - 1.0);
- vec4 tmpvar_17;
- tmpvar_17 = abs(((
- fract((vWaves_14 + 0.5))
- * 2.0) - 1.0));
- vec4 tmpvar_18;
- tmpvar_18 = ((tmpvar_17 * tmpvar_17) * (3.0 - (2.0 * tmpvar_17)));
- vWaves_14 = tmpvar_18;
- vWavesSum_13 = (tmpvar_18.xz + tmpvar_18.yw);
- bend_12.xz = ((gl_Color.y * 0.1) * tmpvar_8).xz;
- bend_12.y = (gl_MultiTexCoord1.y * 0.3);
- pos_11.xyz = (tmpvar_2.xyz + ((
- (vWavesSum_13.xyx * bend_12)
- +
- ((_Wind.xyz * vWavesSum_13.y) * gl_MultiTexCoord1.y)
- ) * _Wind.w));
- pos_11.xyz = (pos_11.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
- vec3 tmpvar_19;
- tmpvar_19.xz = vec2(0.0, 0.0);
- tmpvar_19.y = _SquashPlaneNormal.w;
- vec3 tmpvar_20;
- tmpvar_20 = mix ((pos_11.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_19 - pos_11.xyz))
- * _SquashPlaneNormal.xyz)), pos_11.xyz, vec3(_SquashAmount));
- vec4 tmpvar_21;
- tmpvar_21.w = 1.0;
- tmpvar_21.xyz = tmpvar_20;
- tmpvar_2 = tmpvar_21;
- vec4 tmpvar_22;
- tmpvar_22.xyz = (gl_Color.w * _Color.xyz);
- tmpvar_22.w = _Color.w;
- vec3 tmpvar_23;
- tmpvar_23 = normalize(tmpvar_8);
- tmpvar_3.xyz = normalize(tmpvar_10.xyz);
- vec4 pos_24;
- pos_24 = (gl_ModelViewProjectionMatrix * tmpvar_21);
- binormal_1 = (((tmpvar_23.yzx * tmpvar_3.zxy) - (tmpvar_23.zxy * tmpvar_3.yzx)) * tmpvar_10.w);
- mat3 tmpvar_25;
- tmpvar_25[0].x = tmpvar_3.x;
- tmpvar_25[0].y = binormal_1.x;
- tmpvar_25[0].z = tmpvar_23.x;
- tmpvar_25[1].x = tmpvar_3.y;
- tmpvar_25[1].y = binormal_1.y;
- tmpvar_25[1].z = tmpvar_23.y;
- tmpvar_25[2].x = tmpvar_3.z;
- tmpvar_25[2].y = binormal_1.z;
- tmpvar_25[2].z = tmpvar_23.z;
- vec4 tmpvar_26;
- tmpvar_26.w = 1.0;
- tmpvar_26.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_24;
- vec4 tmpvar_27;
- tmpvar_27.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_27.x = pos_24.z;
- xlv_FOG = tmpvar_27;
- vec4 tmpvar_28;
- tmpvar_28.zw = vec2(0.0, 0.0);
- tmpvar_28.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_28;
- gl_FrontColor = tmpvar_22;
- vec4 tmpvar_29;
- tmpvar_29.w = 0.0;
- tmpvar_29.xyz = (tmpvar_25 * ((
- (_World2Object * _WorldSpaceLightPos0)
- .xyz * unity_Scale.w) - tmpvar_20));
- gl_TexCoord[1] = tmpvar_29;
- vec4 tmpvar_30;
- tmpvar_30.w = 0.0;
- tmpvar_30.xyz = (tmpvar_25 * ((
- (_World2Object * tmpvar_26)
- .xyz * unity_Scale.w) - tmpvar_20));
- gl_TexCoord[2] = tmpvar_30;
- vec4 tmpvar_31;
- tmpvar_31.w = 0.0;
- tmpvar_31.xyz = (_LightMatrix0 * (_Object2World * tmpvar_21)).xyz;
- gl_TexCoord[3] = tmpvar_31;
-}
-
-
-// stats: 79 alu 0 tex 0 flow
-// inputs: 6
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Color (high float) 4x1 [-1] loc 3
-// #3: gl_Normal (high float) 3x1 [-1] loc 2
-// #4: gl_Vertex (high float) 4x1 [-1] loc 0
-// #5: TANGENT (high float) 4x1 [-1]
-// uniforms: 15 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: _Color (high float) 4x1 [-1]
-// #3: _LightMatrix0 (high float) 4x4 [-1]
-// #4: _MainTex_ST (high float) 4x1 [-1]
-// #5: _Object2World (high float) 4x4 [-1]
-// #6: _Scale (high float) 4x1 [-1]
-// #7: _SquashAmount (high float) 1x1 [-1]
-// #8: _SquashPlaneNormal (high float) 4x1 [-1]
-// #9: _TimeX (high float) 1x1 [-1]
-// #10: _Wind (high float) 4x1 [-1]
-// #11: _World2Object (high float) 4x4 [-1]
-// #12: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #13: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #14: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-in.txt
deleted file mode 100644
index 965d77b59a9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-in.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec2 uvOrig;
-};
-uniform vec4 _CenterRadius;
-
-
-vec2 MultiplyUV( in mat4 mat, in vec2 inUV );
-v2f vert( in appdata_img v );
-vec2 MultiplyUV( in mat4 mat, in vec2 inUV ) {
- vec4 temp;
- temp = vec4( inUV.x , inUV.y , 0.000000, 0.000000);
- temp = ( mat * temp );
- return temp.xy ;
-}
-v2f vert( in appdata_img v ) {
- v2f o;
- vec2 uv;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- uv = (v.texcoord.xy - _CenterRadius.xy );
- o.uv = MultiplyUV( gl_TextureMatrix[0], uv);
- o.uvOrig = uv;
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata_img xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.texcoord = vec2( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.uv, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.uvOrig, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-out.txt
deleted file mode 100644
index 338641afab7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Hidden_Twist_Effect-out.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-uniform vec4 _CenterRadius;
-void main ()
-{
- vec2 uv_1;
- uv_1 = (gl_MultiTexCoord0.xy - _CenterRadius.xy);
- vec4 tmpvar_2;
- tmpvar_2.zw = vec2(0.0, 0.0);
- tmpvar_2.xy = uv_1;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_3;
- tmpvar_3.zw = vec2(0.0, 0.0);
- tmpvar_3.xy = (gl_TextureMatrix[0] * tmpvar_2).xy;
- gl_TexCoord[0] = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = uv_1;
- gl_TexCoord[1] = tmpvar_4;
-}
-
-
-// stats: 6 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 3 (total size: 0)
-// #0: gl_TextureMatrix (high float) 4x4 [16]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: _CenterRadius (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt
deleted file mode 100644
index a978a434ccc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-in.txt
+++ /dev/null
@@ -1,91 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec2 uv2_LightMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return objSpaceLightPos.xyz ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xy ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval._LightCoord, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt
deleted file mode 100644
index 8191af76f08..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Legacy_Shaders_Lightmapped_Bumped_Diffuse-out.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_4;
- tmpvar_4[0].x = TANGENT.x;
- tmpvar_4[0].y = binormal_1.x;
- tmpvar_4[0].z = gl_Normal.x;
- tmpvar_4[1].x = TANGENT.y;
- tmpvar_4[1].y = binormal_1.y;
- tmpvar_4[1].z = gl_Normal.y;
- tmpvar_4[2].x = TANGENT.z;
- tmpvar_4[2].y = binormal_1.z;
- tmpvar_4[2].z = gl_Normal.z;
- gl_Position = pos_3;
- vec4 tmpvar_5;
- tmpvar_5.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_5.x = pos_3.z;
- xlv_FOG = tmpvar_5;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = (tmpvar_4 * (_World2Object * _WorldSpaceLightPos0).xyz);
- gl_TexCoord[1] = tmpvar_6;
- vec4 tmpvar_7;
- tmpvar_7.zw = vec2(0.0, 0.0);
- tmpvar_7.xy = (_LightMatrix0 * (_Object2World * gl_Vertex)).xy;
- gl_TexCoord[2] = tmpvar_7;
-}
-
-
-// stats: 16 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-in.txt
deleted file mode 100644
index ece7eedd860..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-in.txt
+++ /dev/null
@@ -1,118 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec4 Squash( in vec4 pos );
-void TerrainAnimateTree( inout vec4 pos, in float alpha );
-void treevertex( inout appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void TerrainAnimateTree( inout vec4 pos, in float alpha ) {
- vec3 bent;
- pos.xyz *= _Scale.xyz ;
- bent = ( _TerrainEngineBendTree * vec4( pos.xyz , 0.000000) ).xyz ;
- pos.xyz = mix( pos.xyz , bent, vec3( alpha));
- pos = Squash( pos);
-}
-void treevertex( inout appdata_full v ) {
- TerrainAnimateTree( v.vertex, v.color.w );
-}
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- treevertex( v);
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-out.txt
deleted file mode 100644
index aa705808d60..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark-out.txt
+++ /dev/null
@@ -1,72 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1.w = gl_Vertex.w;
- pos_1.xyz = (gl_Vertex.xyz * _Scale.xyz);
- vec4 tmpvar_2;
- tmpvar_2.w = 0.0;
- tmpvar_2.xyz = pos_1.xyz;
- pos_1.xyz = mix (pos_1.xyz, (_TerrainEngineBendTree * tmpvar_2).xyz, gl_Color.www);
- vec3 tmpvar_3;
- tmpvar_3.xz = vec2(0.0, 0.0);
- tmpvar_3.y = _SquashPlaneNormal.w;
- vec4 tmpvar_4;
- tmpvar_4.w = 1.0;
- tmpvar_4.xyz = mix ((pos_1.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz))
- * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount));
- pos_1 = tmpvar_4;
- vec4 pos_5;
- pos_5 = (gl_ModelViewProjectionMatrix * tmpvar_4);
- mat3 tmpvar_6;
- tmpvar_6[0] = _Object2World[0].xyz;
- tmpvar_6[1] = _Object2World[1].xyz;
- tmpvar_6[2] = _Object2World[2].xyz;
- gl_Position = pos_5;
- vec4 tmpvar_7;
- tmpvar_7.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_7.x = pos_5.z;
- xlv_FOG = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.zw = vec2(0.0, 0.0);
- tmpvar_8.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = (tmpvar_6 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_9;
- vec4 tmpvar_10;
- tmpvar_10.w = 0.0;
- tmpvar_10.xyz = (_WorldSpaceLightPos0.xyz - (_Object2World * tmpvar_4).xyz);
- gl_TexCoord[2] = tmpvar_10;
- gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * tmpvar_4));
-}
-
-
-// stats: 24 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 10 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _Scale (high float) 4x1 [-1]
-// #5: _SquashAmount (high float) 1x1 [-1]
-// #6: _SquashPlaneNormal (high float) 4x1 [-1]
-// #7: _TerrainEngineBendTree (high float) 4x4 [-1]
-// #8: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #9: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-in.txt
deleted file mode 100644
index 86a8c1012e6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-in.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 vec;
-};
-uniform vec4 _LightPositionRange;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-
-vec4 Squash( in vec4 pos );
-void TerrainAnimateTree( inout vec4 pos, in float alpha );
-void treevertex( inout appdata_full v );
-v2f_surf vert_surf( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void TerrainAnimateTree( inout vec4 pos, in float alpha ) {
- vec3 bent;
- pos.xyz *= _Scale.xyz ;
- bent = ( _TerrainEngineBendTree * vec4( pos.xyz , 0.000000) ).xyz ;
- pos.xyz = mix( pos.xyz , bent, vec3( alpha));
- pos = Squash( pos);
-}
-void treevertex( inout appdata_full v ) {
- TerrainAnimateTree( v.vertex, v.color.w );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- treevertex( v);
- o.vec = (( _Object2World * v.vertex ).xyz - _LightPositionRange.xyz );
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.vec, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt
deleted file mode 100644
index b8f445383e6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark2-out.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-uniform vec4 _LightPositionRange;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-void main ()
-{
- vec4 pos_1;
- pos_1.w = gl_Vertex.w;
- pos_1.xyz = (gl_Vertex.xyz * _Scale.xyz);
- vec4 tmpvar_2;
- tmpvar_2.w = 0.0;
- tmpvar_2.xyz = pos_1.xyz;
- pos_1.xyz = mix (pos_1.xyz, (_TerrainEngineBendTree * tmpvar_2).xyz, gl_Color.www);
- vec3 tmpvar_3;
- tmpvar_3.xz = vec2(0.0, 0.0);
- tmpvar_3.y = _SquashPlaneNormal.w;
- vec4 tmpvar_4;
- tmpvar_4.w = 1.0;
- tmpvar_4.xyz = mix ((pos_1.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz))
- * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount));
- pos_1 = tmpvar_4;
- gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_4);
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = ((_Object2World * tmpvar_4).xyz - _LightPositionRange.xyz);
- gl_TexCoord[0] = tmpvar_5;
-}
-
-
-// stats: 15 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 3
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightPositionRange (high float) 4x1 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _Scale (high float) 4x1 [-1]
-// #4: _SquashAmount (high float) 1x1 [-1]
-// #5: _SquashPlaneNormal (high float) 4x1 [-1]
-// #6: _TerrainEngineBendTree (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-in.txt
deleted file mode 100644
index 552b08a0d8d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-in.txt
+++ /dev/null
@@ -1,111 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 _ShadowCoord0;
- vec3 _ShadowCoord1;
- vec3 _ShadowCoord2;
- vec3 _ShadowCoord3;
- vec2 _ShadowZFade;
-};
-uniform vec4 _LightShadowData;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-uniform mat4 _World2Shadow;
-uniform mat4 _World2Shadow1;
-uniform mat4 _World2Shadow2;
-uniform mat4 _World2Shadow3;
-
-
-vec4 Squash( in vec4 pos );
-void TerrainAnimateTree( inout vec4 pos, in float alpha );
-void treevertex( inout appdata_full v );
-v2f_surf vert_surf( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void TerrainAnimateTree( inout vec4 pos, in float alpha ) {
- vec3 bent;
- pos.xyz *= _Scale.xyz ;
- bent = ( _TerrainEngineBendTree * vec4( pos.xyz , 0.000000) ).xyz ;
- pos.xyz = mix( pos.xyz , bent, vec3( alpha));
- pos = Squash( pos);
-}
-void treevertex( inout appdata_full v ) {
- TerrainAnimateTree( v.vertex, v.color.w );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- float z;
- vec4 wpos;
- treevertex( v);
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- z = ( -( gl_ModelViewMatrix * v.vertex ).z );
- o._ShadowZFade.x = z;
- o._ShadowZFade.y = ((z * _LightShadowData.z ) + _LightShadowData.w );
- wpos = ( _Object2World * v.vertex );
- o._ShadowCoord0 = ( _World2Shadow * wpos ).xyz ;
- o._ShadowCoord1 = ( _World2Shadow1 * wpos ).xyz ;
- o._ShadowCoord2 = ( _World2Shadow2 * wpos ).xyz ;
- o._ShadowCoord3 = ( _World2Shadow3 * wpos ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval._ShadowCoord0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval._ShadowCoord1, 0.0);
- gl_TexCoord[2] = vec4( xl_retval._ShadowCoord2, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._ShadowCoord3, 0.0);
- gl_TexCoord[4] = vec4( xl_retval._ShadowZFade, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt
deleted file mode 100644
index 50f0b9f6a4b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Bark3-out.txt
+++ /dev/null
@@ -1,76 +0,0 @@
-uniform vec4 _LightShadowData;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-uniform mat4 _World2Shadow;
-uniform mat4 _World2Shadow1;
-uniform mat4 _World2Shadow2;
-uniform mat4 _World2Shadow3;
-void main ()
-{
- vec4 wpos_1;
- float z_2;
- vec2 tmpvar_3;
- vec4 pos_4;
- pos_4.w = gl_Vertex.w;
- pos_4.xyz = (gl_Vertex.xyz * _Scale.xyz);
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = pos_4.xyz;
- pos_4.xyz = mix (pos_4.xyz, (_TerrainEngineBendTree * tmpvar_5).xyz, gl_Color.www);
- vec3 tmpvar_6;
- tmpvar_6.xz = vec2(0.0, 0.0);
- tmpvar_6.y = _SquashPlaneNormal.w;
- vec4 tmpvar_7;
- tmpvar_7.w = 1.0;
- tmpvar_7.xyz = mix ((pos_4.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_6 - pos_4.xyz))
- * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount));
- pos_4 = tmpvar_7;
- z_2 = -((gl_ModelViewMatrix * tmpvar_7).z);
- tmpvar_3.x = z_2;
- tmpvar_3.y = ((z_2 * _LightShadowData.z) + _LightShadowData.w);
- wpos_1 = (_Object2World * tmpvar_7);
- gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_7);
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (_World2Shadow * wpos_1).xyz;
- gl_TexCoord[0] = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = (_World2Shadow1 * wpos_1).xyz;
- gl_TexCoord[1] = tmpvar_9;
- vec4 tmpvar_10;
- tmpvar_10.w = 0.0;
- tmpvar_10.xyz = (_World2Shadow2 * wpos_1).xyz;
- gl_TexCoord[2] = tmpvar_10;
- vec4 tmpvar_11;
- tmpvar_11.w = 0.0;
- tmpvar_11.xyz = (_World2Shadow3 * wpos_1).xyz;
- gl_TexCoord[3] = tmpvar_11;
- vec4 tmpvar_12;
- tmpvar_12.zw = vec2(0.0, 0.0);
- tmpvar_12.xy = tmpvar_3;
- gl_TexCoord[4] = tmpvar_12;
-}
-
-
-// stats: 26 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Color (high float) 4x1 [-1] loc 3
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 12 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _LightShadowData (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _Scale (high float) 4x1 [-1]
-// #5: _SquashAmount (high float) 1x1 [-1]
-// #6: _SquashPlaneNormal (high float) 4x1 [-1]
-// #7: _TerrainEngineBendTree (high float) 4x4 [-1]
-// #8: _World2Shadow (high float) 4x4 [-1]
-// #9: _World2Shadow1 (high float) 4x4 [-1]
-// #10: _World2Shadow2 (high float) 4x4 [-1]
-// #11: _World2Shadow3 (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-in.txt
deleted file mode 100644
index 94dd93e7dcd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-in.txt
+++ /dev/null
@@ -1,108 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
-};
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-
-vec4 Squash( in vec4 pos );
-void TerrainAnimateTree( inout vec4 pos, in float alpha );
-void treevertex( inout appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void TerrainAnimateTree( inout vec4 pos, in float alpha ) {
- vec3 bent;
- pos.xyz *= _Scale.xyz ;
- bent = ( _TerrainEngineBendTree * vec4( pos.xyz , 0.000000) ).xyz ;
- pos.xyz = mix( pos.xyz , bent, vec3( alpha));
- pos = Squash( pos);
-}
-void treevertex( inout appdata_full v ) {
- TerrainAnimateTree( v.vertex, v.color.w );
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- treevertex( v);
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-out.txt
deleted file mode 100644
index 838b07ee8a1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves1-out.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1.w = gl_Vertex.w;
- pos_1.xyz = (gl_Vertex.xyz * _Scale.xyz);
- vec4 tmpvar_2;
- tmpvar_2.w = 0.0;
- tmpvar_2.xyz = pos_1.xyz;
- pos_1.xyz = mix (pos_1.xyz, (_TerrainEngineBendTree * tmpvar_2).xyz, gl_Color.www);
- vec3 tmpvar_3;
- tmpvar_3.xz = vec2(0.0, 0.0);
- tmpvar_3.y = _SquashPlaneNormal.w;
- vec4 tmpvar_4;
- tmpvar_4.w = 1.0;
- tmpvar_4.xyz = mix ((pos_1.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz))
- * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount));
- pos_1 = tmpvar_4;
- vec4 pos_5;
- pos_5 = (gl_ModelViewProjectionMatrix * tmpvar_4);
- vec4 o_6;
- o_6 = (pos_5 * 0.5);
- vec2 tmpvar_7;
- tmpvar_7.x = o_6.x;
- tmpvar_7.y = (o_6.y * _ProjectionParams.x);
- o_6.xy = (tmpvar_7 + o_6.w);
- o_6.zw = pos_5.zw;
- gl_Position = pos_5;
- vec4 tmpvar_8;
- tmpvar_8.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_8.x = pos_5.z;
- xlv_FOG = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.zw = vec2(0.0, 0.0);
- tmpvar_9.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_9;
- gl_TexCoord[1] = o_6;
-}
-
-
-// stats: 19 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _ProjectionParams (high float) 4x1 [-1]
-// #3: _Scale (high float) 4x1 [-1]
-// #4: _SquashAmount (high float) 1x1 [-1]
-// #5: _SquashPlaneNormal (high float) 4x1 [-1]
-// #6: _TerrainEngineBendTree (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-in.txt
deleted file mode 100644
index 9b0c492c0d6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-in.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 vec;
- vec2 hip_pack0;
-};
-uniform vec4 _LightPositionRange;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-
-vec4 Squash( in vec4 pos );
-void TerrainAnimateTree( inout vec4 pos, in float alpha );
-void treevertex( inout appdata_full v );
-v2f_surf vert_surf( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void TerrainAnimateTree( inout vec4 pos, in float alpha ) {
- vec3 bent;
- pos.xyz *= _Scale.xyz ;
- bent = ( _TerrainEngineBendTree * vec4( pos.xyz , 0.000000) ).xyz ;
- pos.xyz = mix( pos.xyz , bent, vec3( alpha));
- pos = Squash( pos);
-}
-void treevertex( inout appdata_full v ) {
- TerrainAnimateTree( v.vertex, v.color.w );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- treevertex( v);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.vec = (( _Object2World * v.vertex ).xyz - _LightPositionRange.xyz );
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.vec, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-out.txt
deleted file mode 100644
index 731bd8c2a0c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Nature_Soft_Occlusion_Leaves3-out.txt
+++ /dev/null
@@ -1,51 +0,0 @@
-uniform vec4 _LightPositionRange;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform mat4 _TerrainEngineBendTree;
-void main ()
-{
- vec4 pos_1;
- pos_1.w = gl_Vertex.w;
- pos_1.xyz = (gl_Vertex.xyz * _Scale.xyz);
- vec4 tmpvar_2;
- tmpvar_2.w = 0.0;
- tmpvar_2.xyz = pos_1.xyz;
- pos_1.xyz = mix (pos_1.xyz, (_TerrainEngineBendTree * tmpvar_2).xyz, gl_Color.www);
- vec3 tmpvar_3;
- tmpvar_3.xz = vec2(0.0, 0.0);
- tmpvar_3.y = _SquashPlaneNormal.w;
- vec4 tmpvar_4;
- tmpvar_4.w = 1.0;
- tmpvar_4.xyz = mix ((pos_1.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_3 - pos_1.xyz))
- * _SquashPlaneNormal.xyz)), pos_1.xyz, vec3(_SquashAmount));
- pos_1 = tmpvar_4;
- gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_4);
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = ((_Object2World * tmpvar_4).xyz - _LightPositionRange.xyz);
- gl_TexCoord[0] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.zw = vec2(0.0, 0.0);
- tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[1] = tmpvar_6;
-}
-
-
-// stats: 18 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 8 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightPositionRange (high float) 4x1 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _Scale (high float) 4x1 [-1]
-// #5: _SquashAmount (high float) 1x1 [-1]
-// #6: _SquashPlaneNormal (high float) 4x1 [-1]
-// #7: _TerrainEngineBendTree (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-in.txt
deleted file mode 100644
index ecc2785e2ea..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-in.txt
+++ /dev/null
@@ -1,189 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec3 vlight;
- vec4 _ShadowCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_4LightAtten0;
-uniform vec4 unity_4LightPosX0;
-uniform vec4 unity_4LightPosY0;
-uniform vec4 unity_4LightPosZ0;
-uniform vec3 unity_LightColor0;
-uniform vec3 unity_LightColor1;
-uniform vec3 unity_LightColor2;
-uniform vec3 unity_LightColor3;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-vec3 ShadeSH9( in vec4 normal );
-vec3 Shade4PointLights( in vec4 lightPosX, in vec4 lightPosY, in vec4 lightPosZ, in vec3 lightColor0, in vec3 lightColor1, in vec3 lightColor2, in vec3 lightColor3, in vec4 lightAttenSq, in vec3 pos, in vec3 normal );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-vec3 ShadeSH9( in vec4 normal ) {
- vec3 x1;
- vec4 vB;
- vec3 x2;
- float vC;
- vec3 x3;
- x1.x = dot( unity_SHAr, normal);
- x1.y = dot( unity_SHAg, normal);
- x1.z = dot( unity_SHAb, normal);
- vB = (normal.xyzz * normal.yzzx );
- x2.x = dot( unity_SHBr, vB);
- x2.y = dot( unity_SHBg, vB);
- x2.z = dot( unity_SHBb, vB);
- vC = ((normal.x * normal.x ) - (normal.y * normal.y ));
- x3 = (unity_SHC.xyz * vC);
- return ((x1 + x2) + x3);
-}
-vec3 Shade4PointLights( in vec4 lightPosX, in vec4 lightPosY, in vec4 lightPosZ, in vec3 lightColor0, in vec3 lightColor1, in vec3 lightColor2, in vec3 lightColor3, in vec4 lightAttenSq, in vec3 pos, in vec3 normal ) {
- vec4 toLightX;
- vec4 toLightY;
- vec4 toLightZ;
- vec4 lengthSq;
- vec4 ndotl;
- vec4 corr;
- vec4 atten;
- vec4 diff;
- vec3 col;
- toLightX = (lightPosX - pos.x );
- toLightY = (lightPosY - pos.y );
- toLightZ = (lightPosZ - pos.z );
- lengthSq = vec4( 0.000000);
- lengthSq += (toLightX * toLightX);
- lengthSq += (toLightY * toLightY);
- lengthSq += (toLightZ * toLightZ);
- ndotl = vec4( 0.000000);
- ndotl += (toLightX * normal.x );
- ndotl += (toLightY * normal.y );
- ndotl += (toLightZ * normal.z );
- corr = inversesqrt( lengthSq );
- ndotl = max( vec4( 0.000000, 0.000000, 0.000000, 0.000000), (ndotl * corr));
- atten = (1.00000 / (1.00000 + (lengthSq * lightAttenSq)));
- diff = (ndotl * atten);
- col = vec3( 0.000000);
- col += (lightColor0 * diff.x );
- col += (lightColor1 * diff.y );
- col += (lightColor2 * diff.z );
- col += (lightColor3 * diff.w );
- return col;
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return objSpaceLightPos.xyz ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 worldN;
- vec3 binormal;
- mat3 rotation;
- vec3 shlight;
- vec3 worldPos;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- worldN = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- shlight = ShadeSH9( vec4( worldN, 1.00000));
- o.vlight = shlight;
- worldPos = ( _Object2World * v.vertex ).xyz ;
- o.vlight += Shade4PointLights( unity_4LightPosX0, unity_4LightPosY0, unity_4LightPosZ0, unity_LightColor0, unity_LightColor1, unity_LightColor2, unity_LightColor3, unity_4LightAtten0, worldPos, worldN);
- o._ShadowCoord = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.vlight, 0.0);
- gl_TexCoord[4] = vec4( xl_retval._ShadowCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-out.txt
deleted file mode 100644
index c32d58fedeb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse-out.txt
+++ /dev/null
@@ -1,158 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_4LightAtten0;
-uniform vec4 unity_4LightPosX0;
-uniform vec4 unity_4LightPosY0;
-uniform vec4 unity_4LightPosZ0;
-uniform vec3 unity_LightColor0;
-uniform vec3 unity_LightColor1;
-uniform vec3 unity_LightColor2;
-uniform vec3 unity_LightColor3;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 worldPos_1;
- vec3 binormal_2;
- vec3 worldN_3;
- vec4 tmpvar_4;
- vec4 pos_5;
- pos_5 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_4.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- mat3 tmpvar_6;
- tmpvar_6[0] = _Object2World[0].xyz;
- tmpvar_6[1] = _Object2World[1].xyz;
- tmpvar_6[2] = _Object2World[2].xyz;
- worldN_3 = (tmpvar_6 * (gl_Normal * unity_Scale.w));
- binormal_2 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_7;
- tmpvar_7[0].x = TANGENT.x;
- tmpvar_7[0].y = binormal_2.x;
- tmpvar_7[0].z = gl_Normal.x;
- tmpvar_7[1].x = TANGENT.y;
- tmpvar_7[1].y = binormal_2.y;
- tmpvar_7[1].z = gl_Normal.y;
- tmpvar_7[2].x = TANGENT.z;
- tmpvar_7[2].y = binormal_2.z;
- tmpvar_7[2].z = gl_Normal.z;
- vec4 tmpvar_8;
- tmpvar_8.w = 1.0;
- tmpvar_8.xyz = _WorldSpaceCameraPos;
- vec4 tmpvar_9;
- tmpvar_9.w = 1.0;
- tmpvar_9.xyz = worldN_3;
- vec3 x2_10;
- vec4 vB_11;
- vec3 x1_12;
- x1_12.x = dot (unity_SHAr, tmpvar_9);
- x1_12.y = dot (unity_SHAg, tmpvar_9);
- x1_12.z = dot (unity_SHAb, tmpvar_9);
- vB_11 = (worldN_3.xyzz * worldN_3.yzzx);
- x2_10.x = dot (unity_SHBr, vB_11);
- x2_10.y = dot (unity_SHBg, vB_11);
- x2_10.z = dot (unity_SHBb, vB_11);
- worldPos_1 = (_Object2World * gl_Vertex).xyz;
- vec3 col_13;
- vec4 diff_14;
- vec4 ndotl_15;
- vec4 lengthSq_16;
- vec4 toLightZ_17;
- vec4 toLightY_18;
- vec4 toLightX_19;
- toLightX_19 = (unity_4LightPosX0 - worldPos_1.x);
- toLightY_18 = (unity_4LightPosY0 - worldPos_1.y);
- toLightZ_17 = (unity_4LightPosZ0 - worldPos_1.z);
- lengthSq_16 = (toLightX_19 * toLightX_19);
- lengthSq_16 = (lengthSq_16 + (toLightY_18 * toLightY_18));
- lengthSq_16 = (lengthSq_16 + (toLightZ_17 * toLightZ_17));
- ndotl_15 = (toLightX_19 * worldN_3.x);
- ndotl_15 = (ndotl_15 + (toLightY_18 * worldN_3.y));
- ndotl_15 = (ndotl_15 + (toLightZ_17 * worldN_3.z));
- vec4 tmpvar_20;
- tmpvar_20 = max (vec4(0.0, 0.0, 0.0, 0.0), (ndotl_15 * inversesqrt(lengthSq_16)));
- ndotl_15 = tmpvar_20;
- diff_14 = (tmpvar_20 * (1.0/((1.0 +
- (lengthSq_16 * unity_4LightAtten0)
- ))));
- col_13 = (unity_LightColor0 * diff_14.x);
- col_13 = (col_13 + (unity_LightColor1 * diff_14.y));
- col_13 = (col_13 + (unity_LightColor2 * diff_14.z));
- col_13 = (col_13 + (unity_LightColor3 * diff_14.w));
- vec4 o_21;
- o_21 = (pos_5 * 0.5);
- vec2 tmpvar_22;
- tmpvar_22.x = o_21.x;
- tmpvar_22.y = (o_21.y * _ProjectionParams.x);
- o_21.xy = (tmpvar_22 + o_21.w);
- o_21.zw = pos_5.zw;
- gl_Position = pos_5;
- vec4 tmpvar_23;
- tmpvar_23.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_23.x = pos_5.z;
- xlv_FOG = tmpvar_23;
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_24;
- tmpvar_24.w = 0.0;
- tmpvar_24.xyz = (tmpvar_7 * ((
- (_World2Object * tmpvar_8)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_24;
- vec4 tmpvar_25;
- tmpvar_25.w = 0.0;
- tmpvar_25.xyz = (tmpvar_7 * (_World2Object * _WorldSpaceLightPos0).xyz);
- gl_TexCoord[2] = tmpvar_25;
- vec4 tmpvar_26;
- tmpvar_26.w = 0.0;
- tmpvar_26.xyz = (((x1_12 + x2_10) + (unity_SHC.xyz *
- ((worldN_3.x * worldN_3.x) - (worldN_3.y * worldN_3.y))
- )) + col_13);
- gl_TexCoord[3] = tmpvar_26;
- gl_TexCoord[4] = o_21;
-}
-
-
-// stats: 68 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 24 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _ProjectionParams (high float) 4x1 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #8: unity_4LightAtten0 (high float) 4x1 [-1]
-// #9: unity_4LightPosX0 (high float) 4x1 [-1]
-// #10: unity_4LightPosY0 (high float) 4x1 [-1]
-// #11: unity_4LightPosZ0 (high float) 4x1 [-1]
-// #12: unity_LightColor0 (high float) 3x1 [-1]
-// #13: unity_LightColor1 (high float) 3x1 [-1]
-// #14: unity_LightColor2 (high float) 3x1 [-1]
-// #15: unity_LightColor3 (high float) 3x1 [-1]
-// #16: unity_SHAb (high float) 4x1 [-1]
-// #17: unity_SHAg (high float) 4x1 [-1]
-// #18: unity_SHAr (high float) 4x1 [-1]
-// #19: unity_SHBb (high float) 4x1 [-1]
-// #20: unity_SHBg (high float) 4x1 [-1]
-// #21: unity_SHBr (high float) 4x1 [-1]
-// #22: unity_SHC (high float) 4x1 [-1]
-// #23: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-in.txt
deleted file mode 100644
index 415b1f8fa86..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-in.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.hip_screen);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-out.txt
deleted file mode 100644
index 724d93ce3b2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse1-out.txt
+++ /dev/null
@@ -1,67 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- vec4 o_4;
- o_4 = (pos_3 * 0.5);
- vec2 tmpvar_5;
- tmpvar_5.x = o_4.x;
- tmpvar_5.y = (o_4.y * _ProjectionParams.x);
- o_4.xy = (tmpvar_5 + o_4.w);
- o_4.zw = pos_3.zw;
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_6;
- tmpvar_6[0].x = TANGENT.x;
- tmpvar_6[0].y = binormal_1.x;
- tmpvar_6[0].z = gl_Normal.x;
- tmpvar_6[1].x = TANGENT.y;
- tmpvar_6[1].y = binormal_1.y;
- tmpvar_6[1].z = gl_Normal.y;
- tmpvar_6[2].x = TANGENT.z;
- tmpvar_6[2].y = binormal_1.z;
- tmpvar_6[2].z = gl_Normal.z;
- vec4 tmpvar_7;
- tmpvar_7.w = 1.0;
- tmpvar_7.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_3;
- vec4 tmpvar_8;
- tmpvar_8.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_8.x = pos_3.z;
- xlv_FOG = tmpvar_8;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = (tmpvar_6 * ((
- (_World2Object * tmpvar_7)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_9;
- gl_TexCoord[2] = o_4;
-}
-
-
-// stats: 19 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
-// #4: _World2Object (high float) 4x4 [-1]
-// #5: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #6: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-in.txt
deleted file mode 100644
index 065b01e62fd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-in.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-
-
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- o.hip_lmapFade.xy = ((v.texcoord1.xy * unity_LightmapST.xy ) + unity_LightmapST.zw );
- o.hip_lmapFade.z = ((( -( gl_ModelViewMatrix * v.vertex ).z ) * unity_LightmapFade.z ) + unity_LightmapFade.w );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.hip_screen);
- gl_TexCoord[3] = vec4( xl_retval.hip_lmapFade, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-out.txt
deleted file mode 100644
index c7de6c9cb8e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Parallax_Diffuse2-out.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec3 tmpvar_3;
- vec4 pos_4;
- pos_4 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- vec4 o_5;
- o_5 = (pos_4 * 0.5);
- vec2 tmpvar_6;
- tmpvar_6.x = o_5.x;
- tmpvar_6.y = (o_5.y * _ProjectionParams.x);
- o_5.xy = (tmpvar_6 + o_5.w);
- o_5.zw = pos_4.zw;
- tmpvar_3.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
- tmpvar_3.z = ((-(
- (gl_ModelViewMatrix * gl_Vertex)
- .z) * unity_LightmapFade.z) + unity_LightmapFade.w);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_7;
- tmpvar_7[0].x = TANGENT.x;
- tmpvar_7[0].y = binormal_1.x;
- tmpvar_7[0].z = gl_Normal.x;
- tmpvar_7[1].x = TANGENT.y;
- tmpvar_7[1].y = binormal_1.y;
- tmpvar_7[1].z = gl_Normal.y;
- tmpvar_7[2].x = TANGENT.z;
- tmpvar_7[2].y = binormal_1.z;
- tmpvar_7[2].z = gl_Normal.z;
- vec4 tmpvar_8;
- tmpvar_8.w = 1.0;
- tmpvar_8.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_4;
- vec4 tmpvar_9;
- tmpvar_9.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_9.x = pos_4.z;
- xlv_FOG = tmpvar_9;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_10;
- tmpvar_10.w = 0.0;
- tmpvar_10.xyz = (tmpvar_7 * ((
- (_World2Object * tmpvar_8)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_10;
- gl_TexCoord[2] = o_5;
- vec4 tmpvar_11;
- tmpvar_11.w = 0.0;
- tmpvar_11.xyz = tmpvar_3;
- gl_TexCoord[3] = tmpvar_11;
-}
-
-
-// stats: 26 alu 0 tex 0 flow
-// inputs: 5
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// #4: TANGENT (high float) 4x1 [-1]
-// uniforms: 10 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _BumpMap_ST (high float) 4x1 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _ProjectionParams (high float) 4x1 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #7: unity_LightmapFade (high float) 4x1 [-1]
-// #8: unity_LightmapST (high float) 4x1 [-1]
-// #9: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-in.txt
deleted file mode 100644
index 85a87ed392f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-in.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec2 texcoord;
-};
-uniform vec4 _MainTex_ST;
-
-v2f vert( in appdata_t v );
-v2f vert( in appdata_t v ) {
- v2f o;
- o.vertex = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.color = v.color;
- o.texcoord = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata_t xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.color = vec4( gl_Color);
- xlt_v.texcoord = vec2( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.vertex);
- gl_FrontColor = vec4( xl_retval.color);
- gl_TexCoord[0] = vec4( xl_retval.texcoord, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-out.txt
deleted file mode 100644
index 6a7d4dd164e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Particles_Blend-out.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-uniform vec4 _MainTex_ST;
-void main ()
-{
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- gl_FrontColor = gl_Color;
- vec4 tmpvar_1;
- tmpvar_1.zw = vec2(0.0, 0.0);
- tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_1;
-}
-
-
-// stats: 4 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-in.txt
deleted file mode 100644
index fd9ecafc647..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-in.txt
+++ /dev/null
@@ -1,91 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return objSpaceLightPos.xyz ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xy ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval._LightCoord, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-out.txt
deleted file mode 100644
index 8191af76f08..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse-out.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_4;
- tmpvar_4[0].x = TANGENT.x;
- tmpvar_4[0].y = binormal_1.x;
- tmpvar_4[0].z = gl_Normal.x;
- tmpvar_4[1].x = TANGENT.y;
- tmpvar_4[1].y = binormal_1.y;
- tmpvar_4[1].z = gl_Normal.y;
- tmpvar_4[2].x = TANGENT.z;
- tmpvar_4[2].y = binormal_1.z;
- tmpvar_4[2].z = gl_Normal.z;
- gl_Position = pos_3;
- vec4 tmpvar_5;
- tmpvar_5.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_5.x = pos_3.z;
- xlv_FOG = tmpvar_5;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = (tmpvar_4 * (_World2Object * _WorldSpaceLightPos0).xyz);
- gl_TexCoord[1] = tmpvar_6;
- vec4 tmpvar_7;
- tmpvar_7.zw = vec2(0.0, 0.0);
- tmpvar_7.xy = (_LightMatrix0 * (_Object2World * gl_Vertex)).xy;
- gl_TexCoord[2] = tmpvar_7;
-}
-
-
-// stats: 16 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-in.txt
deleted file mode 100644
index 6c2f7d2ed4e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-in.txt
+++ /dev/null
@@ -1,123 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
- vec3 TtoW0;
- vec3 TtoW1;
- vec3 TtoW2;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
- vec4 TtoW0;
- vec4 TtoW1;
- vec4 TtoW2;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-
-
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 viewDir;
- vec3 worldRefl;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- viewDir = ( -ObjSpaceViewDir( v.vertex) );
- worldRefl = ( xll_constructMat3( _Object2World) * viewDir );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.TtoW0 = (vec4( ( rotation * _Object2World[ 0 ].xyz ), worldRefl.x ) * unity_Scale.w );
- o.TtoW1 = (vec4( ( rotation * _Object2World[ 1 ].xyz ), worldRefl.y ) * unity_Scale.w );
- o.TtoW2 = (vec4( ( rotation * _Object2World[ 2 ].xyz ), worldRefl.z ) * unity_Scale.w );
- o.hip_screen = ComputeScreenPos( o.pos);
- o.hip_lmapFade.xy = ((v.texcoord1.xy * unity_LightmapST.xy ) + unity_LightmapST.zw );
- o.hip_lmapFade.z = ((( -( gl_ModelViewMatrix * v.vertex ).z ) * unity_LightmapFade.z ) + unity_LightmapFade.w );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
- gl_TexCoord[2] = vec4( xl_retval.TtoW0);
- gl_TexCoord[3] = vec4( xl_retval.TtoW1);
- gl_TexCoord[4] = vec4( xl_retval.TtoW2);
- gl_TexCoord[5] = vec4( xl_retval.hip_lmapFade, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-out.txt
deleted file mode 100644
index f517daddcc9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Diffuse1-out.txt
+++ /dev/null
@@ -1,98 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec3 worldRefl_2;
- vec4 tmpvar_3;
- vec3 tmpvar_4;
- vec4 pos_5;
- pos_5 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_3.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- vec4 tmpvar_6;
- tmpvar_6.w = 1.0;
- tmpvar_6.xyz = _WorldSpaceCameraPos;
- mat3 tmpvar_7;
- tmpvar_7[0] = _Object2World[0].xyz;
- tmpvar_7[1] = _Object2World[1].xyz;
- tmpvar_7[2] = _Object2World[2].xyz;
- worldRefl_2 = (tmpvar_7 * (gl_Vertex.xyz - (
- (_World2Object * tmpvar_6)
- .xyz * unity_Scale.w)));
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_8;
- tmpvar_8[0].x = TANGENT.x;
- tmpvar_8[0].y = binormal_1.x;
- tmpvar_8[0].z = gl_Normal.x;
- tmpvar_8[1].x = TANGENT.y;
- tmpvar_8[1].y = binormal_1.y;
- tmpvar_8[1].z = gl_Normal.y;
- tmpvar_8[2].x = TANGENT.z;
- tmpvar_8[2].y = binormal_1.z;
- tmpvar_8[2].z = gl_Normal.z;
- vec4 tmpvar_9;
- tmpvar_9.xyz = (tmpvar_8 * _Object2World[0].xyz);
- tmpvar_9.w = worldRefl_2.x;
- vec4 tmpvar_10;
- tmpvar_10.xyz = (tmpvar_8 * _Object2World[1].xyz);
- tmpvar_10.w = worldRefl_2.y;
- vec4 tmpvar_11;
- tmpvar_11.xyz = (tmpvar_8 * _Object2World[2].xyz);
- tmpvar_11.w = worldRefl_2.z;
- vec4 o_12;
- o_12 = (pos_5 * 0.5);
- vec2 tmpvar_13;
- tmpvar_13.x = o_12.x;
- tmpvar_13.y = (o_12.y * _ProjectionParams.x);
- o_12.xy = (tmpvar_13 + o_12.w);
- o_12.zw = pos_5.zw;
- tmpvar_4.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
- tmpvar_4.z = ((-(
- (gl_ModelViewMatrix * gl_Vertex)
- .z) * unity_LightmapFade.z) + unity_LightmapFade.w);
- gl_Position = pos_5;
- vec4 tmpvar_14;
- tmpvar_14.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_14.x = pos_5.z;
- xlv_FOG = tmpvar_14;
- gl_TexCoord[0] = tmpvar_3;
- gl_TexCoord[1] = o_12;
- gl_TexCoord[2] = (tmpvar_9 * unity_Scale.w);
- gl_TexCoord[3] = (tmpvar_10 * unity_Scale.w);
- gl_TexCoord[4] = (tmpvar_11 * unity_Scale.w);
- vec4 tmpvar_15;
- tmpvar_15.w = 0.0;
- tmpvar_15.xyz = tmpvar_4;
- gl_TexCoord[5] = tmpvar_15;
-}
-
-
-// stats: 31 alu 0 tex 0 flow
-// inputs: 5
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// #4: TANGENT (high float) 4x1 [-1]
-// uniforms: 11 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _BumpMap_ST (high float) 4x1 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _ProjectionParams (high float) 4x1 [-1]
-// #6: _World2Object (high float) 4x4 [-1]
-// #7: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #8: unity_LightmapFade (high float) 4x1 [-1]
-// #9: unity_LightmapST (high float) 4x1 [-1]
-// #10: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-in.txt
deleted file mode 100644
index 4088c79eb39..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-in.txt
+++ /dev/null
@@ -1,102 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec3 viewDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return ((objSpaceLightPos.xyz * unity_Scale.w ) - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-out.txt
deleted file mode 100644
index d566b0fe247..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular-out.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_4;
- tmpvar_4[0].x = TANGENT.x;
- tmpvar_4[0].y = binormal_1.x;
- tmpvar_4[0].z = gl_Normal.x;
- tmpvar_4[1].x = TANGENT.y;
- tmpvar_4[1].y = binormal_1.y;
- tmpvar_4[1].z = gl_Normal.y;
- tmpvar_4[2].x = TANGENT.z;
- tmpvar_4[2].y = binormal_1.z;
- tmpvar_4[2].z = gl_Normal.z;
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_3;
- vec4 tmpvar_6;
- tmpvar_6.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_6.x = pos_3.z;
- xlv_FOG = tmpvar_6;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (tmpvar_4 * ((
- (_World2Object * _WorldSpaceLightPos0)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (tmpvar_4 * ((
- (_World2Object * tmpvar_5)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[2] = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = (_LightMatrix0 * (_Object2World * gl_Vertex)).xyz;
- gl_TexCoord[3] = tmpvar_9;
-}
-
-
-// stats: 24 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 9 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #8: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-in.txt
deleted file mode 100644
index 3e3a20d4873..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-in.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- vec2 hip_pack0;
- vec3 TtoV0;
- vec3 TtoV1;
- vec3 TtoV2;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-
-
-v2f_surf vert_surf( in appdata_full v );
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.hip_pack0.xy = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.TtoV0 = ( rotation * xll_constructMat3( gl_ModelViewMatrixInverseTranspose)[ 0 ].xyz );
- o.TtoV1 = ( rotation * xll_constructMat3( gl_ModelViewMatrixInverseTranspose)[ 1 ].xyz );
- o.TtoV2 = ( rotation * xll_constructMat3( gl_ModelViewMatrixInverseTranspose)[ 2 ].xyz );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.TtoV0, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.TtoV1, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.TtoV2, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-out.txt
deleted file mode 100644
index d1e731e7736..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular1-out.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-uniform vec4 _BumpMap_ST;
-attribute vec4 TANGENT;
-void main ()
-{
- vec3 binormal_1;
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_2;
- tmpvar_2[0].x = TANGENT.x;
- tmpvar_2[0].y = binormal_1.x;
- tmpvar_2[0].z = gl_Normal.x;
- tmpvar_2[1].x = TANGENT.y;
- tmpvar_2[1].y = binormal_1.y;
- tmpvar_2[1].z = gl_Normal.y;
- tmpvar_2[2].x = TANGENT.z;
- tmpvar_2[2].y = binormal_1.z;
- tmpvar_2[2].z = gl_Normal.z;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_3;
- tmpvar_3.zw = vec2(0.0, 0.0);
- tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- gl_TexCoord[0] = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.w = 0.0;
- tmpvar_4.xyz = (tmpvar_2 * gl_ModelViewMatrixInverseTranspose[0].xyz);
- gl_TexCoord[1] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * gl_ModelViewMatrixInverseTranspose[1].xyz);
- gl_TexCoord[2] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = (tmpvar_2 * gl_ModelViewMatrixInverseTranspose[2].xyz);
- gl_TexCoord[3] = tmpvar_6;
-}
-
-
-// stats: 14 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 3 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: _BumpMap_ST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-in.txt
deleted file mode 100644
index 90b27e693f1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-in.txt
+++ /dev/null
@@ -1,116 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
- vec3 TtoW0;
- vec3 TtoW1;
- vec3 TtoW2;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
- vec4 TtoW0;
- vec4 TtoW1;
- vec4 TtoW2;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 viewDir;
- vec3 worldRefl;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- viewDir = ( -ObjSpaceViewDir( v.vertex) );
- worldRefl = ( xll_constructMat3( _Object2World) * viewDir );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.TtoW0 = (vec4( ( rotation * _Object2World[ 0 ].xyz ), worldRefl.x ) * unity_Scale.w );
- o.TtoW1 = (vec4( ( rotation * _Object2World[ 1 ].xyz ), worldRefl.y ) * unity_Scale.w );
- o.TtoW2 = (vec4( ( rotation * _Object2World[ 2 ].xyz ), worldRefl.z ) * unity_Scale.w );
- o.hip_screen = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
- gl_TexCoord[2] = vec4( xl_retval.TtoW0);
- gl_TexCoord[3] = vec4( xl_retval.TtoW1);
- gl_TexCoord[4] = vec4( xl_retval.TtoW2);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-out.txt
deleted file mode 100644
index da8cbd00261..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Specular2-out.txt
+++ /dev/null
@@ -1,83 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec3 worldRefl_2;
- vec4 tmpvar_3;
- vec4 pos_4;
- pos_4 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_3.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = _WorldSpaceCameraPos;
- mat3 tmpvar_6;
- tmpvar_6[0] = _Object2World[0].xyz;
- tmpvar_6[1] = _Object2World[1].xyz;
- tmpvar_6[2] = _Object2World[2].xyz;
- worldRefl_2 = (tmpvar_6 * (gl_Vertex.xyz - (
- (_World2Object * tmpvar_5)
- .xyz * unity_Scale.w)));
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_7;
- tmpvar_7[0].x = TANGENT.x;
- tmpvar_7[0].y = binormal_1.x;
- tmpvar_7[0].z = gl_Normal.x;
- tmpvar_7[1].x = TANGENT.y;
- tmpvar_7[1].y = binormal_1.y;
- tmpvar_7[1].z = gl_Normal.y;
- tmpvar_7[2].x = TANGENT.z;
- tmpvar_7[2].y = binormal_1.z;
- tmpvar_7[2].z = gl_Normal.z;
- vec4 tmpvar_8;
- tmpvar_8.xyz = (tmpvar_7 * _Object2World[0].xyz);
- tmpvar_8.w = worldRefl_2.x;
- vec4 tmpvar_9;
- tmpvar_9.xyz = (tmpvar_7 * _Object2World[1].xyz);
- tmpvar_9.w = worldRefl_2.y;
- vec4 tmpvar_10;
- tmpvar_10.xyz = (tmpvar_7 * _Object2World[2].xyz);
- tmpvar_10.w = worldRefl_2.z;
- vec4 o_11;
- o_11 = (pos_4 * 0.5);
- vec2 tmpvar_12;
- tmpvar_12.x = o_11.x;
- tmpvar_12.y = (o_11.y * _ProjectionParams.x);
- o_11.xy = (tmpvar_12 + o_11.w);
- o_11.zw = pos_4.zw;
- gl_Position = pos_4;
- vec4 tmpvar_13;
- tmpvar_13.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_13.x = pos_4.z;
- xlv_FOG = tmpvar_13;
- gl_TexCoord[0] = tmpvar_3;
- gl_TexCoord[1] = o_11;
- gl_TexCoord[2] = (tmpvar_8 * unity_Scale.w);
- gl_TexCoord[3] = (tmpvar_9 * unity_Scale.w);
- gl_TexCoord[4] = (tmpvar_10 * unity_Scale.w);
-}
-
-
-// stats: 24 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 8 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _ProjectionParams (high float) 4x1 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #7: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-in.txt
deleted file mode 100644
index f967a99dd6f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-in.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- float fog;
- vec2 uv;
- vec2 uv2;
- vec3 I;
- vec3 TtoW0;
- vec3 TtoW1;
- vec3 TtoW2;
-};
-struct appdata_tan {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
-};
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec3 _WorldSpaceCameraPos;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceViewDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f vert( in appdata_tan v );
-vec3 WorldSpaceViewDir( in vec4 v ) {
- return (_WorldSpaceCameraPos.xyz - ( _Object2World * v ).xyz );
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f vert( in appdata_tan v ) {
- v2f o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.uv = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.uv2 = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- o.I = ( -WorldSpaceViewDir( v.vertex) );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.TtoW0 = ( rotation * (_Object2World[ 0 ].xyz * unity_Scale.w ) );
- o.TtoW1 = ( rotation * (_Object2World[ 1 ].xyz * unity_Scale.w ) );
- o.TtoW2 = ( rotation * (_Object2World[ 2 ].xyz * unity_Scale.w ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f xl_retval;
- appdata_tan xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.uv, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.uv2, 0.0, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.I, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.TtoW0, 0.0);
- gl_TexCoord[4] = vec4( xl_retval.TtoW1, 0.0);
- gl_TexCoord[5] = vec4( xl_retval.TtoW2, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-out.txt
deleted file mode 100644
index 10bf3c4a465..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Bumped_Unlit-out.txt
+++ /dev/null
@@ -1,68 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_3;
- tmpvar_3[0].x = TANGENT.x;
- tmpvar_3[0].y = binormal_1.x;
- tmpvar_3[0].z = gl_Normal.x;
- tmpvar_3[1].x = TANGENT.y;
- tmpvar_3[1].y = binormal_1.y;
- tmpvar_3[1].z = gl_Normal.y;
- tmpvar_3[2].x = TANGENT.z;
- tmpvar_3[2].y = binormal_1.z;
- tmpvar_3[2].z = gl_Normal.z;
- gl_Position = pos_2;
- vec4 tmpvar_4;
- tmpvar_4.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_4.x = pos_2.z;
- xlv_FOG = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.zw = vec2(0.0, 0.0);
- tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.zw = vec2(0.0, 0.0);
- tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- gl_TexCoord[1] = tmpvar_6;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = ((_Object2World * gl_Vertex).xyz - _WorldSpaceCameraPos);
- gl_TexCoord[2] = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (tmpvar_3 * (_Object2World[0].xyz * unity_Scale.w));
- gl_TexCoord[3] = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = (tmpvar_3 * (_Object2World[1].xyz * unity_Scale.w));
- gl_TexCoord[4] = tmpvar_9;
- vec4 tmpvar_10;
- tmpvar_10.w = 0.0;
- tmpvar_10.xyz = (tmpvar_3 * (_Object2World[2].xyz * unity_Scale.w));
- gl_TexCoord[5] = tmpvar_10;
-}
-
-
-// stats: 24 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #5: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-in.txt
deleted file mode 100644
index 8e6844ed858..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-in.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-out.txt
deleted file mode 100644
index 236ce480d62..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse-out.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- vec4 tmpvar_7;
- tmpvar_7 = (_Object2World * gl_Vertex);
- tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz);
- gl_TexCoord[2] = tmpvar_6;
- gl_TexCoord[3] = (_LightMatrix0 * tmpvar_7);
-}
-
-
-// stats: 12 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #5: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-in.txt
deleted file mode 100644
index eedff876ed0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-in.txt
+++ /dev/null
@@ -1,100 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 worldRefl;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 viewDir;
- vec3 viewRefl;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- viewDir = ( -ObjSpaceViewDir( v.vertex) );
- viewRefl = reflect( viewDir, v.normal);
- o.worldRefl = ( xll_constructMat3( _Object2World) * viewRefl );
- o.hip_screen = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.worldRefl, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.hip_screen);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-out.txt
deleted file mode 100644
index 759d073c5a3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Diffuse1-out.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 viewDir_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_3;
- tmpvar_3.w = 1.0;
- tmpvar_3.xyz = _WorldSpaceCameraPos;
- viewDir_1 = (gl_Vertex.xyz - ((_World2Object * tmpvar_3).xyz * unity_Scale.w));
- mat3 tmpvar_4;
- tmpvar_4[0] = _Object2World[0].xyz;
- tmpvar_4[1] = _Object2World[1].xyz;
- tmpvar_4[2] = _Object2World[2].xyz;
- vec4 o_5;
- o_5 = (pos_2 * 0.5);
- vec2 tmpvar_6;
- tmpvar_6.x = o_5.x;
- tmpvar_6.y = (o_5.y * _ProjectionParams.x);
- o_5.xy = (tmpvar_6 + o_5.w);
- o_5.zw = pos_2.zw;
- gl_Position = pos_2;
- vec4 tmpvar_7;
- tmpvar_7.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_7.x = pos_2.z;
- xlv_FOG = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.zw = vec2(0.0, 0.0);
- tmpvar_8.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = (tmpvar_4 * (viewDir_1 - (2.0 *
- (dot (gl_Normal, viewDir_1) * gl_Normal)
- )));
- gl_TexCoord[1] = tmpvar_9;
- gl_TexCoord[2] = o_5;
-}
-
-
-// stats: 18 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
-// #4: _World2Object (high float) 4x4 [-1]
-// #5: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #6: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-in.txt
deleted file mode 100644
index 9a7ab1102da..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-in.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return ((objSpaceLightPos.xyz * unity_Scale.w ) - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-out.txt
deleted file mode 100644
index 509c4ec3081..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse-out.txt
+++ /dev/null
@@ -1,70 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_4;
- tmpvar_4[0].x = TANGENT.x;
- tmpvar_4[0].y = binormal_1.x;
- tmpvar_4[0].z = gl_Normal.x;
- tmpvar_4[1].x = TANGENT.y;
- tmpvar_4[1].y = binormal_1.y;
- tmpvar_4[1].z = gl_Normal.y;
- tmpvar_4[2].x = TANGENT.z;
- tmpvar_4[2].y = binormal_1.z;
- tmpvar_4[2].z = gl_Normal.z;
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_3;
- vec4 tmpvar_6;
- tmpvar_6.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_6.x = pos_3.z;
- xlv_FOG = tmpvar_6;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (tmpvar_4 * ((
- (_World2Object * tmpvar_5)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (tmpvar_4 * ((
- (_World2Object * _WorldSpaceLightPos0)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[2] = tmpvar_8;
- gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * gl_Vertex));
-}
-
-
-// stats: 23 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 9 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #8: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-in.txt
deleted file mode 100644
index fcfee7b34cf..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-in.txt
+++ /dev/null
@@ -1,120 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
- vec3 viewDir;
- vec3 TtoW0;
- vec3 TtoW1;
- vec3 TtoW2;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec4 hip_screen;
- vec4 TtoW0;
- vec4 TtoW1;
- vec4 TtoW2;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 viewDir;
- vec3 worldRefl;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- viewDir = ( -ObjSpaceViewDir( v.vertex) );
- worldRefl = ( xll_constructMat3( _Object2World) * viewDir );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.TtoW0 = (vec4( ( rotation * _Object2World[ 0 ].xyz ), worldRefl.x ) * unity_Scale.w );
- o.TtoW1 = (vec4( ( rotation * _Object2World[ 1 ].xyz ), worldRefl.y ) * unity_Scale.w );
- o.TtoW2 = (vec4( ( rotation * _Object2World[ 2 ].xyz ), worldRefl.z ) * unity_Scale.w );
- o.hip_screen = ComputeScreenPos( o.pos);
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.hip_screen);
- gl_TexCoord[3] = vec4( xl_retval.TtoW0);
- gl_TexCoord[4] = vec4( xl_retval.TtoW1);
- gl_TexCoord[5] = vec4( xl_retval.TtoW2);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-out.txt
deleted file mode 100644
index 962b77757a7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Diffuse1-out.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec3 worldRefl_2;
- vec4 tmpvar_3;
- vec4 pos_4;
- pos_4 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_3.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = _WorldSpaceCameraPos;
- mat3 tmpvar_6;
- tmpvar_6[0] = _Object2World[0].xyz;
- tmpvar_6[1] = _Object2World[1].xyz;
- tmpvar_6[2] = _Object2World[2].xyz;
- worldRefl_2 = (tmpvar_6 * (gl_Vertex.xyz - (
- (_World2Object * tmpvar_5)
- .xyz * unity_Scale.w)));
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_7;
- tmpvar_7[0].x = TANGENT.x;
- tmpvar_7[0].y = binormal_1.x;
- tmpvar_7[0].z = gl_Normal.x;
- tmpvar_7[1].x = TANGENT.y;
- tmpvar_7[1].y = binormal_1.y;
- tmpvar_7[1].z = gl_Normal.y;
- tmpvar_7[2].x = TANGENT.z;
- tmpvar_7[2].y = binormal_1.z;
- tmpvar_7[2].z = gl_Normal.z;
- vec4 tmpvar_8;
- tmpvar_8.xyz = (tmpvar_7 * _Object2World[0].xyz);
- tmpvar_8.w = worldRefl_2.x;
- vec4 tmpvar_9;
- tmpvar_9.xyz = (tmpvar_7 * _Object2World[1].xyz);
- tmpvar_9.w = worldRefl_2.y;
- vec4 tmpvar_10;
- tmpvar_10.xyz = (tmpvar_7 * _Object2World[2].xyz);
- tmpvar_10.w = worldRefl_2.z;
- vec4 o_11;
- o_11 = (pos_4 * 0.5);
- vec2 tmpvar_12;
- tmpvar_12.x = o_11.x;
- tmpvar_12.y = (o_11.y * _ProjectionParams.x);
- o_11.xy = (tmpvar_12 + o_11.w);
- o_11.zw = pos_4.zw;
- vec4 tmpvar_13;
- tmpvar_13.w = 1.0;
- tmpvar_13.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_4;
- vec4 tmpvar_14;
- tmpvar_14.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_14.x = pos_4.z;
- xlv_FOG = tmpvar_14;
- gl_TexCoord[0] = tmpvar_3;
- vec4 tmpvar_15;
- tmpvar_15.w = 0.0;
- tmpvar_15.xyz = (tmpvar_7 * ((
- (_World2Object * tmpvar_13)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_15;
- gl_TexCoord[2] = o_11;
- gl_TexCoord[3] = (tmpvar_8 * unity_Scale.w);
- gl_TexCoord[4] = (tmpvar_9 * unity_Scale.w);
- gl_TexCoord[5] = (tmpvar_10 * unity_Scale.w);
-}
-
-
-// stats: 30 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 8 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _ProjectionParams (high float) 4x1 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #7: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-in.txt
deleted file mode 100644
index 1cefcd592c4..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-in.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return ((objSpaceLightPos.xyz * unity_Scale.w ) - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-out.txt
deleted file mode 100644
index 0772d920184..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular-out.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_4;
- tmpvar_4[0].x = TANGENT.x;
- tmpvar_4[0].y = binormal_1.x;
- tmpvar_4[0].z = gl_Normal.x;
- tmpvar_4[1].x = TANGENT.y;
- tmpvar_4[1].y = binormal_1.y;
- tmpvar_4[1].z = gl_Normal.y;
- tmpvar_4[2].x = TANGENT.z;
- tmpvar_4[2].y = binormal_1.z;
- tmpvar_4[2].z = gl_Normal.z;
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_3;
- vec4 tmpvar_6;
- tmpvar_6.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_6.x = pos_3.z;
- xlv_FOG = tmpvar_6;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (tmpvar_4 * ((
- (_World2Object * tmpvar_5)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (tmpvar_4 * ((
- (_World2Object * _WorldSpaceLightPos0)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[2] = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = (_LightMatrix0 * (_Object2World * gl_Vertex)).xyz;
- gl_TexCoord[3] = tmpvar_9;
-}
-
-
-// stats: 24 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 9 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #8: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-in.txt
deleted file mode 100644
index 3c1f34f8c4a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-in.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec3 worldRefl;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return objSpaceLightPos.xyz ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xy ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-out.txt
deleted file mode 100644
index 13804cd10c2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Parallax_Specular1-out.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_4;
- tmpvar_4[0].x = TANGENT.x;
- tmpvar_4[0].y = binormal_1.x;
- tmpvar_4[0].z = gl_Normal.x;
- tmpvar_4[1].x = TANGENT.y;
- tmpvar_4[1].y = binormal_1.y;
- tmpvar_4[1].z = gl_Normal.y;
- tmpvar_4[2].x = TANGENT.z;
- tmpvar_4[2].y = binormal_1.z;
- tmpvar_4[2].z = gl_Normal.z;
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_3;
- vec4 tmpvar_6;
- tmpvar_6.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_6.x = pos_3.z;
- xlv_FOG = tmpvar_6;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (tmpvar_4 * ((
- (_World2Object * tmpvar_5)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (tmpvar_4 * (_World2Object * _WorldSpaceLightPos0).xyz);
- gl_TexCoord[2] = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.zw = vec2(0.0, 0.0);
- tmpvar_9.xy = (_LightMatrix0 * (_Object2World * gl_Vertex)).xy;
- gl_TexCoord[3] = tmpvar_9;
-}
-
-
-// stats: 22 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 9 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #8: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-in.txt
deleted file mode 100644
index 5358a14067d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-in.txt
+++ /dev/null
@@ -1,98 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 viewDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceViewDir( in vec4 v );
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceViewDir( in vec4 v ) {
- return (_WorldSpaceCameraPos.xyz - ( _Object2World * v ).xyz );
-}
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o.viewDir = WorldSpaceViewDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[4] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-out.txt
deleted file mode 100644
index 3a372de703e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular-out.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- vec4 tmpvar_7;
- tmpvar_7 = (_Object2World * gl_Vertex);
- tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz);
- gl_TexCoord[2] = tmpvar_6;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (_WorldSpaceCameraPos - tmpvar_7.xyz);
- gl_TexCoord[3] = tmpvar_8;
- gl_TexCoord[4] = (_LightMatrix0 * tmpvar_7);
-}
-
-
-// stats: 14 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #5: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #6: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-in.txt
deleted file mode 100644
index 46682a30681..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-in.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-
-
-v2f_surf vert_surf( in appdata_full v );
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.normal = ( xll_constructMat3( gl_ModelViewMatrixInverseTranspose) * v.normal );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.normal, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-out.txt
deleted file mode 100644
index d87780097b0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular1-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-void main ()
-{
- mat3 tmpvar_1;
- tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz;
- tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz;
- tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_2;
- tmpvar_2.w = 0.0;
- tmpvar_2.xyz = (tmpvar_1 * gl_Normal);
- gl_TexCoord[0] = tmpvar_2;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-in.txt
deleted file mode 100644
index eedff876ed0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-in.txt
+++ /dev/null
@@ -1,100 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 worldRefl;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 viewDir;
- vec3 viewRefl;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- viewDir = ( -ObjSpaceViewDir( v.vertex) );
- viewRefl = reflect( viewDir, v.normal);
- o.worldRefl = ( xll_constructMat3( _Object2World) * viewRefl );
- o.hip_screen = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.worldRefl, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.hip_screen);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-out.txt
deleted file mode 100644
index 759d073c5a3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Reflective_Specular2-out.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 viewDir_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_3;
- tmpvar_3.w = 1.0;
- tmpvar_3.xyz = _WorldSpaceCameraPos;
- viewDir_1 = (gl_Vertex.xyz - ((_World2Object * tmpvar_3).xyz * unity_Scale.w));
- mat3 tmpvar_4;
- tmpvar_4[0] = _Object2World[0].xyz;
- tmpvar_4[1] = _Object2World[1].xyz;
- tmpvar_4[2] = _Object2World[2].xyz;
- vec4 o_5;
- o_5 = (pos_2 * 0.5);
- vec2 tmpvar_6;
- tmpvar_6.x = o_5.x;
- tmpvar_6.y = (o_5.y * _ProjectionParams.x);
- o_5.xy = (tmpvar_6 + o_5.w);
- o_5.zw = pos_2.zw;
- gl_Position = pos_2;
- vec4 tmpvar_7;
- tmpvar_7.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_7.x = pos_2.z;
- xlv_FOG = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.zw = vec2(0.0, 0.0);
- tmpvar_8.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = (tmpvar_4 * (viewDir_1 - (2.0 *
- (dot (gl_Normal, viewDir_1) * gl_Normal)
- )));
- gl_TexCoord[1] = tmpvar_9;
- gl_TexCoord[2] = o_5;
-}
-
-
-// stats: 18 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
-// #4: _World2Object (high float) 4x4 [-1]
-// #5: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #6: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-in.txt
deleted file mode 100644
index f3c17cd0fb1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-in.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec3 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec3 texcoord;
-};
-
-v2f vert( in appdata_t v );
-v2f vert( in appdata_t v ) {
- v2f o;
- o.vertex = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.texcoord = v.texcoord;
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata_t xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.texcoord = vec3( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.vertex);
- gl_TexCoord[0] = vec4( xl_retval.texcoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt
deleted file mode 100644
index 8521c7dadbe..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-RenderFX_Skybox_Cubed-out.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-void main ()
-{
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_1;
- tmpvar_1.w = 0.0;
- tmpvar_1.xyz = gl_MultiTexCoord0.xyz;
- gl_TexCoord[0] = tmpvar_1;
-}
-
-
-// stats: 2 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 1 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-in.txt
deleted file mode 100644
index 8f57a7b3caa..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-in.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return ((objSpaceLightPos.xyz * unity_Scale.w ) - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt
deleted file mode 100644
index e858730a706..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Diffuse-out.txt
+++ /dev/null
@@ -1,59 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_4;
- tmpvar_4[0].x = TANGENT.x;
- tmpvar_4[0].y = binormal_1.x;
- tmpvar_4[0].z = gl_Normal.x;
- tmpvar_4[1].x = TANGENT.y;
- tmpvar_4[1].y = binormal_1.y;
- tmpvar_4[1].z = gl_Normal.y;
- tmpvar_4[2].x = TANGENT.z;
- tmpvar_4[2].y = binormal_1.z;
- tmpvar_4[2].z = gl_Normal.z;
- gl_Position = pos_3;
- vec4 tmpvar_5;
- tmpvar_5.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_5.x = pos_3.z;
- xlv_FOG = tmpvar_5;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = (tmpvar_4 * ((
- (_World2Object * _WorldSpaceLightPos0)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_6;
- gl_TexCoord[2] = (_LightMatrix0 * (_Object2World * gl_Vertex));
-}
-
-
-// stats: 17 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 8 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #7: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-in.txt
deleted file mode 100644
index 394c85d62d2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-in.txt
+++ /dev/null
@@ -1,83 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Illum_ST;
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _Illum_ST.xy ) + _Illum_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-out.txt
deleted file mode 100644
index 2a958175c83..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Bumped_Specular1-out.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-uniform vec4 _Illum_ST;
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 tmpvar_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _Illum_ST.xy) + _Illum_ST.zw);
- vec4 o_3;
- o_3 = (pos_2 * 0.5);
- vec2 tmpvar_4;
- tmpvar_4.x = o_3.x;
- tmpvar_4.y = (o_3.y * _ProjectionParams.x);
- o_3.xy = (tmpvar_4 + o_3.w);
- o_3.zw = pos_2.zw;
- gl_Position = pos_2;
- vec4 tmpvar_5;
- tmpvar_5.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_5.x = pos_2.z;
- xlv_FOG = tmpvar_5;
- gl_TexCoord[0] = tmpvar_1;
- gl_TexCoord[1] = o_3;
-}
-
-
-// stats: 9 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 4 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _Illum_ST (high float) 4x1 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-in.txt
deleted file mode 100644
index 44c693a1907..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-in.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Illum_ST;
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-
-
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _Illum_ST.xy ) + _Illum_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- o.hip_lmapFade.xy = ((v.texcoord1.xy * unity_LightmapST.xy ) + unity_LightmapST.zw );
- o.hip_lmapFade.z = ((( -( gl_ModelViewMatrix * v.vertex ).z ) * unity_LightmapFade.z ) + unity_LightmapFade.w );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
- gl_TexCoord[2] = vec4( xl_retval.hip_lmapFade, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-out.txt
deleted file mode 100644
index 9a18604c858..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Diffuse1-out.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-uniform vec4 _Illum_ST;
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 tmpvar_1;
- vec3 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _Illum_ST.xy) + _Illum_ST.zw);
- vec4 o_4;
- o_4 = (pos_3 * 0.5);
- vec2 tmpvar_5;
- tmpvar_5.x = o_4.x;
- tmpvar_5.y = (o_4.y * _ProjectionParams.x);
- o_4.xy = (tmpvar_5 + o_4.w);
- o_4.zw = pos_3.zw;
- tmpvar_2.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
- tmpvar_2.z = ((-(
- (gl_ModelViewMatrix * gl_Vertex)
- .z) * unity_LightmapFade.z) + unity_LightmapFade.w);
- gl_Position = pos_3;
- vec4 tmpvar_6;
- tmpvar_6.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_6.x = pos_3.z;
- xlv_FOG = tmpvar_6;
- gl_TexCoord[0] = tmpvar_1;
- gl_TexCoord[1] = o_4;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = tmpvar_2;
- gl_TexCoord[2] = tmpvar_7;
-}
-
-
-// stats: 16 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _Illum_ST (high float) 4x1 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _ProjectionParams (high float) 4x1 [-1]
-// #5: unity_LightmapFade (high float) 4x1 [-1]
-// #6: unity_LightmapST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-in.txt
deleted file mode 100644
index f5c8f85bac1..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-in.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec2 uv_Illum;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return ((objSpaceLightPos.xyz * unity_Scale.w ) - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-out.txt
deleted file mode 100644
index 509c4ec3081..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Diffuse-out.txt
+++ /dev/null
@@ -1,70 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_4;
- tmpvar_4[0].x = TANGENT.x;
- tmpvar_4[0].y = binormal_1.x;
- tmpvar_4[0].z = gl_Normal.x;
- tmpvar_4[1].x = TANGENT.y;
- tmpvar_4[1].y = binormal_1.y;
- tmpvar_4[1].z = gl_Normal.y;
- tmpvar_4[2].x = TANGENT.z;
- tmpvar_4[2].y = binormal_1.z;
- tmpvar_4[2].z = gl_Normal.z;
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_3;
- vec4 tmpvar_6;
- tmpvar_6.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_6.x = pos_3.z;
- xlv_FOG = tmpvar_6;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (tmpvar_4 * ((
- (_World2Object * tmpvar_5)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (tmpvar_4 * ((
- (_World2Object * _WorldSpaceLightPos0)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[2] = tmpvar_8;
- gl_TexCoord[3] = (_LightMatrix0 * (_Object2World * gl_Vertex));
-}
-
-
-// stats: 23 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 9 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #8: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-in.txt
deleted file mode 100644
index d7226de8373..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-in.txt
+++ /dev/null
@@ -1,103 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
- vec2 uv_Illum;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 viewDir;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return ((objSpaceLightPos.xyz * unity_Scale.w ) - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-out.txt
deleted file mode 100644
index 0772d920184..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Parallax_Specular1-out.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_4;
- tmpvar_4[0].x = TANGENT.x;
- tmpvar_4[0].y = binormal_1.x;
- tmpvar_4[0].z = gl_Normal.x;
- tmpvar_4[1].x = TANGENT.y;
- tmpvar_4[1].y = binormal_1.y;
- tmpvar_4[1].z = gl_Normal.y;
- tmpvar_4[2].x = TANGENT.z;
- tmpvar_4[2].y = binormal_1.z;
- tmpvar_4[2].z = gl_Normal.z;
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_3;
- vec4 tmpvar_6;
- tmpvar_6.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_6.x = pos_3.z;
- xlv_FOG = tmpvar_6;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (tmpvar_4 * ((
- (_World2Object * tmpvar_5)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (tmpvar_4 * ((
- (_World2Object * _WorldSpaceLightPos0)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[2] = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = (_LightMatrix0 * (_Object2World * gl_Vertex)).xyz;
- gl_TexCoord[3] = tmpvar_9;
-}
-
-
-// stats: 24 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 9 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #8: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-in.txt
deleted file mode 100644
index e8f8f54b279..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-in.txt
+++ /dev/null
@@ -1,63 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_Illum;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-
-
-v2f_surf vert_surf( in appdata_full v );
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.normal = ( xll_constructMat3( gl_ModelViewMatrixInverseTranspose) * v.normal );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.normal, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-out.txt
deleted file mode 100644
index d87780097b0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Self-Illumin_Specular1-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-void main ()
-{
- mat3 tmpvar_1;
- tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz;
- tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz;
- tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_2;
- tmpvar_2.w = 0.0;
- tmpvar_2.xyz = (tmpvar_1 * gl_Normal);
- gl_TexCoord[0] = tmpvar_2;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-in.txt
deleted file mode 100644
index cd75ac2ba8d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-in.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
-};
-struct appdata_t {
- vec4 vertex;
-};
-
-v2f vert( in appdata_t v );
-v2f vert( in appdata_t v ) {
- v2f o;
- o.vertex = ( gl_ModelViewProjectionMatrix * v.vertex );
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata_t xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.vertex);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-out.txt
deleted file mode 100644
index 54aa9f53205..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-ShowDestAlpha-out.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-void main ()
-{
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
-}
-
-
-// stats: 1 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 1 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-in.txt
deleted file mode 100644
index ef605356984..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-in.txt
+++ /dev/null
@@ -1,97 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 viewDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceViewDir( in vec4 v );
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceViewDir( in vec4 v ) {
- return (_WorldSpaceCameraPos.xyz - ( _Object2World * v ).xyz );
-}
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o.viewDir = WorldSpaceViewDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[4] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-out.txt
deleted file mode 100644
index 3a372de703e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular-out.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- vec4 tmpvar_7;
- tmpvar_7 = (_Object2World * gl_Vertex);
- tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz);
- gl_TexCoord[2] = tmpvar_6;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (_WorldSpaceCameraPos - tmpvar_7.xyz);
- gl_TexCoord[3] = tmpvar_8;
- gl_TexCoord[4] = (_LightMatrix0 * tmpvar_7);
-}
-
-
-// stats: 14 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #5: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #6: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-in.txt
deleted file mode 100644
index ffc074864e2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-in.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-
-
-v2f_surf vert_surf( in appdata_full v );
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.normal = ( xll_constructMat3( gl_ModelViewMatrixInverseTranspose) * v.normal );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.normal, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-out.txt
deleted file mode 100644
index d87780097b0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular1-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-void main ()
-{
- mat3 tmpvar_1;
- tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz;
- tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz;
- tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_2;
- tmpvar_2.w = 0.0;
- tmpvar_2.xyz = (tmpvar_1 * gl_Normal);
- gl_TexCoord[0] = tmpvar_2;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-in.txt
deleted file mode 100644
index d531ecd7b47..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-in.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-
-
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- o.hip_lmapFade.xy = ((v.texcoord1.xy * unity_LightmapST.xy ) + unity_LightmapST.zw );
- o.hip_lmapFade.z = ((( -( gl_ModelViewMatrix * v.vertex ).z ) * unity_LightmapFade.z ) + unity_LightmapFade.w );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
- gl_TexCoord[2] = vec4( xl_retval.hip_lmapFade, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-out.txt
deleted file mode 100644
index 1ddacd6355c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Specular2-out.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 tmpvar_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_3;
- o_3 = (pos_2 * 0.5);
- vec2 tmpvar_4;
- tmpvar_4.x = o_3.x;
- tmpvar_4.y = (o_3.y * _ProjectionParams.x);
- o_3.xy = (tmpvar_4 + o_3.w);
- o_3.zw = pos_2.zw;
- tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
- tmpvar_1.z = ((-(
- (gl_ModelViewMatrix * gl_Vertex)
- .z) * unity_LightmapFade.z) + unity_LightmapFade.w);
- gl_Position = pos_2;
- vec4 tmpvar_5;
- tmpvar_5.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_5.x = pos_2.z;
- xlv_FOG = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.zw = vec2(0.0, 0.0);
- tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_6;
- gl_TexCoord[1] = o_3;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = tmpvar_1;
- gl_TexCoord[2] = tmpvar_7;
-}
-
-
-// stats: 15 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
-// #4: unity_LightmapFade (high float) 4x1 [-1]
-// #5: unity_LightmapST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-in.txt
deleted file mode 100644
index 42b2404c9ba..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-in.txt
+++ /dev/null
@@ -1,92 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv2_Detail;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Detail_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord1.xy * _Detail_ST.xy ) + _Detail_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-out.txt
deleted file mode 100644
index f602f14edea..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV-out.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-uniform vec4 _Detail_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 tmpvar_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_1.zw = ((gl_MultiTexCoord1.xy * _Detail_ST.xy) + _Detail_ST.zw);
- mat3 tmpvar_3;
- tmpvar_3[0] = _Object2World[0].xyz;
- tmpvar_3[1] = _Object2World[1].xyz;
- tmpvar_3[2] = _Object2World[2].xyz;
- gl_Position = pos_2;
- vec4 tmpvar_4;
- tmpvar_4.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_4.x = pos_2.z;
- xlv_FOG = tmpvar_4;
- gl_TexCoord[0] = tmpvar_1;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_3 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- vec4 tmpvar_7;
- tmpvar_7 = (_Object2World * gl_Vertex);
- tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz);
- gl_TexCoord[2] = tmpvar_6;
- gl_TexCoord[3] = (_LightMatrix0 * tmpvar_7);
-}
-
-
-// stats: 13 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _Detail_ST (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #6: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-in.txt
deleted file mode 100644
index d1cfb5fbc9d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-in.txt
+++ /dev/null
@@ -1,82 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv2_Detail;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _Detail_ST;
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord1.xy * _Detail_ST.xy ) + _Detail_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-out.txt
deleted file mode 100644
index ee8abb8898c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_2UV1-out.txt
+++ /dev/null
@@ -1,38 +0,0 @@
-uniform vec4 _Detail_ST;
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 tmpvar_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_1.zw = ((gl_MultiTexCoord1.xy * _Detail_ST.xy) + _Detail_ST.zw);
- vec4 o_3;
- o_3 = (pos_2 * 0.5);
- vec2 tmpvar_4;
- tmpvar_4.x = o_3.x;
- tmpvar_4.y = (o_3.y * _ProjectionParams.x);
- o_3.xy = (tmpvar_4 + o_3.w);
- o_3.zw = pos_2.zw;
- gl_Position = pos_2;
- vec4 tmpvar_5;
- tmpvar_5.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_5.x = pos_2.z;
- xlv_FOG = tmpvar_5;
- gl_TexCoord[0] = tmpvar_1;
- gl_TexCoord[1] = o_3;
-}
-
-
-// stats: 9 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 4 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _Detail_ST (high float) 4x1 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-in.txt
deleted file mode 100644
index f383b7a785f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-in.txt
+++ /dev/null
@@ -1,108 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct MySurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- vec3 GlossColor;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_SpecMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 viewDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _SpecMap_ST;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceViewDir( in vec4 v );
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceViewDir( in vec4 v ) {
- return (_WorldSpaceCameraPos.xyz - ( _Object2World * v ).xyz );
-}
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _SpecMap_ST.xy ) + _SpecMap_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o.viewDir = WorldSpaceViewDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[4] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-out.txt
deleted file mode 100644
index d18ed2b3371..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular-out.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _SpecMap_ST;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 tmpvar_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _SpecMap_ST.xy) + _SpecMap_ST.zw);
- mat3 tmpvar_3;
- tmpvar_3[0] = _Object2World[0].xyz;
- tmpvar_3[1] = _Object2World[1].xyz;
- tmpvar_3[2] = _Object2World[2].xyz;
- gl_Position = pos_2;
- vec4 tmpvar_4;
- tmpvar_4.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_4.x = pos_2.z;
- xlv_FOG = tmpvar_4;
- gl_TexCoord[0] = tmpvar_1;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_3 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- vec4 tmpvar_7;
- tmpvar_7 = (_Object2World * gl_Vertex);
- tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz);
- gl_TexCoord[2] = tmpvar_6;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (_WorldSpaceCameraPos - tmpvar_7.xyz);
- gl_TexCoord[3] = tmpvar_8;
- gl_TexCoord[4] = (_LightMatrix0 * tmpvar_7);
-}
-
-
-// stats: 15 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 8 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _SpecMap_ST (high float) 4x1 [-1]
-// #5: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #7: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-in.txt
deleted file mode 100644
index eae0590fed3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-in.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct MySurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- vec3 GlossColor;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_SpecMap;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-
-
-v2f_surf vert_surf( in appdata_full v );
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.normal = ( xll_constructMat3( gl_ModelViewMatrixInverseTranspose) * v.normal );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.normal, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-out.txt
deleted file mode 100644
index d87780097b0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Colored_Specular1-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-void main ()
-{
- mat3 tmpvar_1;
- tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz;
- tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz;
- tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_2;
- tmpvar_2.w = 0.0;
- tmpvar_2.xyz = (tmpvar_1 * gl_Normal);
- gl_TexCoord[0] = tmpvar_2;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-in.txt
deleted file mode 100644
index 971e9284ddc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-in.txt
+++ /dev/null
@@ -1,94 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec3 foo;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec3 cust_foo;
- vec3 normal;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-uniform mat4 _LightMatrix0;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void vert( inout appdata_full v, out Input o );
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-void vert( inout appdata_full v, out Input o ) {
- o.foo = ((v.normal * 0.500000) + 0.500000);
-}
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- Input customInputData;
- v2f_surf o;
- vert( v, customInputData);
- o.cust_foo = customInputData.foo;
- PositionFog( v.vertex, o.pos, o.fog);
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.cust_foo, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-out.txt
deleted file mode 100644
index d3849d5eea0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data-out.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.w = 0.0;
- tmpvar_4.xyz = ((gl_Normal * 0.5) + 0.5);
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- vec4 tmpvar_7;
- tmpvar_7 = (_Object2World * gl_Vertex);
- tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz);
- gl_TexCoord[2] = tmpvar_6;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (_LightMatrix0 * tmpvar_7).xyz;
- gl_TexCoord[3] = tmpvar_8;
-}
-
-
-// stats: 13 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 5 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #4: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-in.txt
deleted file mode 100644
index fcf53d9eba7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-in.txt
+++ /dev/null
@@ -1,94 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec3 foo;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec3 cust_foo;
- vec3 normal;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-uniform mat4 _LightMatrix0;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void vert( inout appdata_full v, out Input o );
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-void vert( inout appdata_full v, out Input o ) {
- o.foo = ((v.normal * 0.500000) + 0.500000);
-}
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return _WorldSpaceLightPos0.xyz ;
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- Input customInputData;
- v2f_surf o;
- vert( v, customInputData);
- o.cust_foo = customInputData.foo;
- PositionFog( v.vertex, o.pos, o.fog);
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xy ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.cust_foo, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-out.txt
deleted file mode 100644
index 40009b34958..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data1-out.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.w = 0.0;
- tmpvar_4.xyz = ((gl_Normal * 0.5) + 0.5);
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = _WorldSpaceLightPos0.xyz;
- gl_TexCoord[2] = tmpvar_6;
- vec4 tmpvar_7;
- tmpvar_7.zw = vec2(0.0, 0.0);
- tmpvar_7.xy = (_LightMatrix0 * (_Object2World * gl_Vertex)).xy;
- gl_TexCoord[3] = tmpvar_7;
-}
-
-
-// stats: 12 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 5 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #4: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-in.txt
deleted file mode 100644
index d160fef8542..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-in.txt
+++ /dev/null
@@ -1,91 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct Input {
- vec3 foo;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec3 cust_foo;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-uniform vec4 _ProjectionParams;
-
-
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-void vert( inout appdata_full v, out Input o );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void vert( inout appdata_full v, out Input o ) {
- o.foo = ((v.normal * 0.500000) + 0.500000);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- Input customInputData;
- v2f_surf o;
- vert( v, customInputData);
- o.cust_foo = customInputData.foo;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_screen = ComputeScreenPos( o.pos);
- o.hip_lmapFade.xy = ((v.texcoord1.xy * unity_LightmapST.xy ) + unity_LightmapST.zw );
- o.hip_lmapFade.z = ((( -( gl_ModelViewMatrix * v.vertex ).z ) * unity_LightmapFade.z ) + unity_LightmapFade.w );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.cust_foo, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
- gl_TexCoord[2] = vec4( xl_retval.hip_lmapFade, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-out.txt
deleted file mode 100644
index eafc976c234..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Custom_Data2-out.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-uniform vec4 _ProjectionParams;
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 tmpvar_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_3;
- o_3 = (pos_2 * 0.5);
- vec2 tmpvar_4;
- tmpvar_4.x = o_3.x;
- tmpvar_4.y = (o_3.y * _ProjectionParams.x);
- o_3.xy = (tmpvar_4 + o_3.w);
- o_3.zw = pos_2.zw;
- tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
- tmpvar_1.z = ((-(
- (gl_ModelViewMatrix * gl_Vertex)
- .z) * unity_LightmapFade.z) + unity_LightmapFade.w);
- gl_Position = pos_2;
- vec4 tmpvar_5;
- tmpvar_5.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_5.x = pos_2.z;
- xlv_FOG = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = ((gl_Normal * 0.5) + 0.5);
- gl_TexCoord[0] = tmpvar_6;
- gl_TexCoord[1] = o_3;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = tmpvar_1;
- gl_TexCoord[2] = tmpvar_7;
-}
-
-
-// stats: 15 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 5 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _ProjectionParams (high float) 4x1 [-1]
-// #3: unity_LightmapFade (high float) 4x1 [-1]
-// #4: unity_LightmapST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-in.txt
deleted file mode 100644
index 8028af06d1b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-in.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return _WorldSpaceLightPos0.xyz ;
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-out.txt
deleted file mode 100644
index aaaaddc73b8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump-out.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = _WorldSpaceLightPos0.xyz;
- gl_TexCoord[2] = tmpvar_6;
-}
-
-
-// stats: 9 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 5 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #4: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-in.txt
deleted file mode 100644
index 26aa0c43e28..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-in.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-out.txt
deleted file mode 100644
index d66048d5993..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump1-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_2;
- o_2 = (pos_1 * 0.5);
- vec2 tmpvar_3;
- tmpvar_3.x = o_2.x;
- tmpvar_3.y = (o_2.y * _ProjectionParams.x);
- o_2.xy = (tmpvar_3 + o_2.w);
- o_2.zw = pos_1.zw;
- gl_Position = pos_1;
- vec4 tmpvar_4;
- tmpvar_4.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_4.x = pos_1.z;
- xlv_FOG = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.zw = vec2(0.0, 0.0);
- tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_5;
- gl_TexCoord[1] = o_2;
-}
-
-
-// stats: 8 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 3 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _ProjectionParams (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-in.txt
deleted file mode 100644
index f35df46d15d..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-in.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_Decal;
- vec2 uv_DecalBump;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec2 hip_lmap;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _DecalBump_ST;
-uniform vec4 _Decal_ST;
-uniform mat4 _Object2World;
-
-uniform vec4 unity_LightmapST;
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 worldN;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _Decal_ST.xy ) + _Decal_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _DecalBump_ST.xy ) + _DecalBump_ST.zw );
- o.hip_lmap.xy = ((v.texcoord1.xy * unity_LightmapST.xy ) + unity_LightmapST.zw );
- worldN = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.hip_lmap, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-out.txt
deleted file mode 100644
index d08d35009eb..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump2-out.txt
+++ /dev/null
@@ -1,34 +0,0 @@
-uniform vec4 _DecalBump_ST;
-uniform vec4 _Decal_ST;
-uniform vec4 unity_LightmapST;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 tmpvar_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_1.xy = ((gl_MultiTexCoord0.xy * _Decal_ST.xy) + _Decal_ST.zw);
- tmpvar_1.zw = ((gl_MultiTexCoord0.xy * _DecalBump_ST.xy) + _DecalBump_ST.zw);
- gl_Position = pos_2;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_2.z;
- xlv_FOG = tmpvar_3;
- gl_TexCoord[0] = tmpvar_1;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
- gl_TexCoord[1] = tmpvar_4;
-}
-
-
-// stats: 9 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 4 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _DecalBump_ST (high float) 4x1 [-1]
-// #2: _Decal_ST (high float) 4x1 [-1]
-// #3: unity_LightmapST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-in.txt
deleted file mode 100644
index 5660f2d8f96..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-in.txt
+++ /dev/null
@@ -1,134 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_Decal;
- vec2 uv_DecalBump;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec3 vlight;
- vec4 _ShadowCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _DecalBump_ST;
-uniform vec4 _Decal_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-vec3 ShadeSH9( in vec4 normal );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceLightDir( in vec4 v );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-vec3 ShadeSH9( in vec4 normal ) {
- vec3 x1;
- vec4 vB;
- vec3 x2;
- float vC;
- vec3 x3;
- x1.x = dot( unity_SHAr, normal);
- x1.y = dot( unity_SHAg, normal);
- x1.z = dot( unity_SHAb, normal);
- vB = (normal.xyzz * normal.yzzx );
- x2.x = dot( unity_SHBr, vB);
- x2.y = dot( unity_SHBg, vB);
- x2.z = dot( unity_SHBb, vB);
- vC = ((normal.x * normal.x ) - (normal.y * normal.y ));
- x3 = (unity_SHC.xyz * vC);
- return ((x1 + x2) + x3);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return objSpaceLightPos.xyz ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 worldN;
- vec3 binormal;
- mat3 rotation;
- vec3 shlight;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _Decal_ST.xy ) + _Decal_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _DecalBump_ST.xy ) + _DecalBump_ST.zw );
- worldN = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- shlight = ShadeSH9( vec4( worldN, 1.00000));
- o.vlight = shlight;
- o._ShadowCoord = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.vlight, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._ShadowCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-out.txt
deleted file mode 100644
index 72939f00612..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_DecalAddBump3-out.txt
+++ /dev/null
@@ -1,105 +0,0 @@
-uniform vec4 _DecalBump_ST;
-uniform vec4 _Decal_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_SHAb;
-uniform vec4 unity_SHAg;
-uniform vec4 unity_SHAr;
-uniform vec4 unity_SHBb;
-uniform vec4 unity_SHBg;
-uniform vec4 unity_SHBr;
-uniform vec4 unity_SHC;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec3 worldN_2;
- vec4 tmpvar_3;
- vec4 pos_4;
- pos_4 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _Decal_ST.xy) + _Decal_ST.zw);
- tmpvar_3.zw = ((gl_MultiTexCoord0.xy * _DecalBump_ST.xy) + _DecalBump_ST.zw);
- mat3 tmpvar_5;
- tmpvar_5[0] = _Object2World[0].xyz;
- tmpvar_5[1] = _Object2World[1].xyz;
- tmpvar_5[2] = _Object2World[2].xyz;
- worldN_2 = (tmpvar_5 * (gl_Normal * unity_Scale.w));
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_6;
- tmpvar_6[0].x = TANGENT.x;
- tmpvar_6[0].y = binormal_1.x;
- tmpvar_6[0].z = gl_Normal.x;
- tmpvar_6[1].x = TANGENT.y;
- tmpvar_6[1].y = binormal_1.y;
- tmpvar_6[1].z = gl_Normal.y;
- tmpvar_6[2].x = TANGENT.z;
- tmpvar_6[2].y = binormal_1.z;
- tmpvar_6[2].z = gl_Normal.z;
- vec4 tmpvar_7;
- tmpvar_7.w = 1.0;
- tmpvar_7.xyz = worldN_2;
- vec3 x2_8;
- vec4 vB_9;
- vec3 x1_10;
- x1_10.x = dot (unity_SHAr, tmpvar_7);
- x1_10.y = dot (unity_SHAg, tmpvar_7);
- x1_10.z = dot (unity_SHAb, tmpvar_7);
- vB_9 = (worldN_2.xyzz * worldN_2.yzzx);
- x2_8.x = dot (unity_SHBr, vB_9);
- x2_8.y = dot (unity_SHBg, vB_9);
- x2_8.z = dot (unity_SHBb, vB_9);
- vec4 o_11;
- o_11 = (pos_4 * 0.5);
- vec2 tmpvar_12;
- tmpvar_12.x = o_11.x;
- tmpvar_12.y = (o_11.y * _ProjectionParams.x);
- o_11.xy = (tmpvar_12 + o_11.w);
- o_11.zw = pos_4.zw;
- gl_Position = pos_4;
- vec4 tmpvar_13;
- tmpvar_13.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_13.x = pos_4.z;
- xlv_FOG = tmpvar_13;
- gl_TexCoord[0] = tmpvar_3;
- vec4 tmpvar_14;
- tmpvar_14.w = 0.0;
- tmpvar_14.xyz = (tmpvar_6 * (_World2Object * _WorldSpaceLightPos0).xyz);
- gl_TexCoord[1] = tmpvar_14;
- vec4 tmpvar_15;
- tmpvar_15.w = 0.0;
- tmpvar_15.xyz = ((x1_10 + x2_8) + (unity_SHC.xyz * (
- (worldN_2.x * worldN_2.x)
- -
- (worldN_2.y * worldN_2.y)
- )));
- gl_TexCoord[2] = tmpvar_15;
- gl_TexCoord[3] = o_11;
-}
-
-
-// stats: 33 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 15 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _DecalBump_ST (high float) 4x1 [-1]
-// #2: _Decal_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _ProjectionParams (high float) 4x1 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #7: unity_SHAb (high float) 4x1 [-1]
-// #8: unity_SHAg (high float) 4x1 [-1]
-// #9: unity_SHAr (high float) 4x1 [-1]
-// #10: unity_SHBb (high float) 4x1 [-1]
-// #11: unity_SHBg (high float) 4x1 [-1]
-// #12: unity_SHBr (high float) 4x1 [-1]
-// #13: unity_SHC (high float) 4x1 [-1]
-// #14: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-in.txt
deleted file mode 100644
index e52d6ea3834..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-in.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return _WorldSpaceLightPos0.xyz ;
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xy ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-out.txt
deleted file mode 100644
index 76da8d25377..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Diffuse_Wrapped-out.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = _WorldSpaceLightPos0.xyz;
- gl_TexCoord[2] = tmpvar_6;
- vec4 tmpvar_7;
- tmpvar_7.zw = vec2(0.0, 0.0);
- tmpvar_7.xy = (_LightMatrix0 * (_Object2World * gl_Vertex)).xy;
- gl_TexCoord[3] = tmpvar_7;
-}
-
-
-// stats: 12 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #5: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-in.txt
deleted file mode 100644
index 280e9a0d6dc..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-in.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return _WorldSpaceLightPos0.xyz ;
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-out.txt
deleted file mode 100644
index aaaaddc73b8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim-out.txt
+++ /dev/null
@@ -1,44 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = _WorldSpaceLightPos0.xyz;
- gl_TexCoord[2] = tmpvar_6;
-}
-
-
-// stats: 9 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 5 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #4: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-in.txt
deleted file mode 100644
index dd486f19ab9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-in.txt
+++ /dev/null
@@ -1,99 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 viewDir;
- vec4 hip_screen;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.normal = ( rotation * (v.normal * unity_Scale.w ) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.hip_screen);
- gl_TexCoord[3] = vec4( xl_retval.normal, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-out.txt
deleted file mode 100644
index 5f95d672cb7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim1-out.txt
+++ /dev/null
@@ -1,69 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_3;
- o_3 = (pos_2 * 0.5);
- vec2 tmpvar_4;
- tmpvar_4.x = o_3.x;
- tmpvar_4.y = (o_3.y * _ProjectionParams.x);
- o_3.xy = (tmpvar_4 + o_3.w);
- o_3.zw = pos_2.zw;
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_5;
- tmpvar_5[0].x = TANGENT.x;
- tmpvar_5[0].y = binormal_1.x;
- tmpvar_5[0].z = gl_Normal.x;
- tmpvar_5[1].x = TANGENT.y;
- tmpvar_5[1].y = binormal_1.y;
- tmpvar_5[1].z = gl_Normal.y;
- tmpvar_5[2].x = TANGENT.z;
- tmpvar_5[2].y = binormal_1.z;
- tmpvar_5[2].z = gl_Normal.z;
- vec4 tmpvar_6;
- tmpvar_6.w = 1.0;
- tmpvar_6.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_2;
- vec4 tmpvar_7;
- tmpvar_7.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_7.x = pos_2.z;
- xlv_FOG = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.zw = vec2(0.0, 0.0);
- tmpvar_8.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = (tmpvar_5 * ((
- (_World2Object * tmpvar_6)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_9;
- gl_TexCoord[2] = o_3;
- vec4 tmpvar_10;
- tmpvar_10.w = 0.0;
- tmpvar_10.xyz = (tmpvar_5 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[3] = tmpvar_10;
-}
-
-
-// stats: 21 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _ProjectionParams (high float) 4x1 [-1]
-// #3: _World2Object (high float) 4x4 [-1]
-// #4: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #5: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-in.txt
deleted file mode 100644
index 387a516aeea..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-in.txt
+++ /dev/null
@@ -1,106 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 viewDir;
- vec4 hip_screen;
- vec3 normal;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-
-
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- o.hip_lmapFade.xy = ((v.texcoord1.xy * unity_LightmapST.xy ) + unity_LightmapST.zw );
- o.hip_lmapFade.z = ((( -( gl_ModelViewMatrix * v.vertex ).z ) * unity_LightmapFade.z ) + unity_LightmapFade.w );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.normal = ( rotation * (v.normal * unity_Scale.w ) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.hip_screen);
- gl_TexCoord[3] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[4] = vec4( xl_retval.hip_lmapFade, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-out.txt
deleted file mode 100644
index 618238a6673..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim2-out.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec3 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_4;
- o_4 = (pos_3 * 0.5);
- vec2 tmpvar_5;
- tmpvar_5.x = o_4.x;
- tmpvar_5.y = (o_4.y * _ProjectionParams.x);
- o_4.xy = (tmpvar_5 + o_4.w);
- o_4.zw = pos_3.zw;
- tmpvar_2.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
- tmpvar_2.z = ((-(
- (gl_ModelViewMatrix * gl_Vertex)
- .z) * unity_LightmapFade.z) + unity_LightmapFade.w);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_6;
- tmpvar_6[0].x = TANGENT.x;
- tmpvar_6[0].y = binormal_1.x;
- tmpvar_6[0].z = gl_Normal.x;
- tmpvar_6[1].x = TANGENT.y;
- tmpvar_6[1].y = binormal_1.y;
- tmpvar_6[1].z = gl_Normal.y;
- tmpvar_6[2].x = TANGENT.z;
- tmpvar_6[2].y = binormal_1.z;
- tmpvar_6[2].z = gl_Normal.z;
- vec4 tmpvar_7;
- tmpvar_7.w = 1.0;
- tmpvar_7.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_3;
- vec4 tmpvar_8;
- tmpvar_8.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_8.x = pos_3.z;
- xlv_FOG = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.zw = vec2(0.0, 0.0);
- tmpvar_9.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_9;
- vec4 tmpvar_10;
- tmpvar_10.w = 0.0;
- tmpvar_10.xyz = (tmpvar_6 * ((
- (_World2Object * tmpvar_7)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_10;
- gl_TexCoord[2] = o_4;
- vec4 tmpvar_11;
- tmpvar_11.w = 0.0;
- tmpvar_11.xyz = (tmpvar_6 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[3] = tmpvar_11;
- vec4 tmpvar_12;
- tmpvar_12.w = 0.0;
- tmpvar_12.xyz = tmpvar_2;
- gl_TexCoord[4] = tmpvar_12;
-}
-
-
-// stats: 28 alu 0 tex 0 flow
-// inputs: 5
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// #4: TANGENT (high float) 4x1 [-1]
-// uniforms: 9 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
-// #4: _World2Object (high float) 4x4 [-1]
-// #5: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #6: unity_LightmapFade (high float) 4x1 [-1]
-// #7: unity_LightmapST (high float) 4x1 [-1]
-// #8: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-in.txt
deleted file mode 100644
index 6e31447bd77..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-in.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_BumpMap;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return ((objSpaceLightPos.xyz * unity_Scale.w ) - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-out.txt
deleted file mode 100644
index 7ee0a0a0b49..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump-out.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_3;
- tmpvar_3[0].x = TANGENT.x;
- tmpvar_3[0].y = binormal_1.x;
- tmpvar_3[0].z = gl_Normal.x;
- tmpvar_3[1].x = TANGENT.y;
- tmpvar_3[1].y = binormal_1.y;
- tmpvar_3[1].z = gl_Normal.y;
- tmpvar_3[2].x = TANGENT.z;
- tmpvar_3[2].y = binormal_1.z;
- tmpvar_3[2].z = gl_Normal.z;
- gl_Position = pos_2;
- vec4 tmpvar_4;
- tmpvar_4.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_4.x = pos_2.z;
- xlv_FOG = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.zw = vec2(0.0, 0.0);
- tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- gl_TexCoord[0] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = (tmpvar_3 * ((
- (_World2Object * _WorldSpaceLightPos0)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_6;
- gl_TexCoord[2] = (_LightMatrix0 * (_Object2World * gl_Vertex));
-}
-
-
-// stats: 16 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _World2Object (high float) 4x4 [-1]
-// #5: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #6: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-in.txt
deleted file mode 100644
index 33f731c9f9f..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-in.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_BumpMap;
- vec3 viewDir;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return ((objSpaceLightPos.xyz * unity_Scale.w ) - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval._LightCoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-out.txt
deleted file mode 100644
index 049b503d058..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Rim_Bump1-out.txt
+++ /dev/null
@@ -1,60 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_3;
- tmpvar_3[0].x = TANGENT.x;
- tmpvar_3[0].y = binormal_1.x;
- tmpvar_3[0].z = gl_Normal.x;
- tmpvar_3[1].x = TANGENT.y;
- tmpvar_3[1].y = binormal_1.y;
- tmpvar_3[1].z = gl_Normal.y;
- tmpvar_3[2].x = TANGENT.z;
- tmpvar_3[2].y = binormal_1.z;
- tmpvar_3[2].z = gl_Normal.z;
- gl_Position = pos_2;
- vec4 tmpvar_4;
- tmpvar_4.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_4.x = pos_2.z;
- xlv_FOG = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.zw = vec2(0.0, 0.0);
- tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- gl_TexCoord[0] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = (tmpvar_3 * ((
- (_World2Object * _WorldSpaceLightPos0)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_6;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (_LightMatrix0 * (_Object2World * gl_Vertex)).xyz;
- gl_TexCoord[2] = tmpvar_7;
-}
-
-
-// stats: 17 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _World2Object (high float) 4x4 [-1]
-// #5: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #6: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-in.txt
deleted file mode 100644
index b31a4160a28..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-in.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec4 screenPos;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform mat4 _LightMatrix0;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-out.txt
deleted file mode 100644
index 8ae2ed55ee8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos-out.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.w = 0.0;
- tmpvar_4.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- vec4 tmpvar_6;
- tmpvar_6 = (_Object2World * gl_Vertex);
- tmpvar_5.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_6.xyz);
- gl_TexCoord[1] = tmpvar_5;
- gl_TexCoord[2] = (_LightMatrix0 * tmpvar_6);
-}
-
-
-// stats: 9 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 5 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #4: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-in.txt
deleted file mode 100644
index 7707c4d4bc8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-in.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec4 screenPos;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec3 normal;
- vec3 lightDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform mat4 _LightMatrix0;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval._LightCoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-out.txt
deleted file mode 100644
index 8ad1a435310..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos1-out.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.w = 0.0;
- tmpvar_4.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- vec4 tmpvar_6;
- tmpvar_6 = (_Object2World * gl_Vertex);
- tmpvar_5.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_6.xyz);
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (_LightMatrix0 * tmpvar_6).xyz;
- gl_TexCoord[2] = tmpvar_7;
-}
-
-
-// stats: 10 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 5 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #4: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-in.txt
deleted file mode 100644
index 643d34ed112..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-in.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec4 screenPos;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-
-
-v2f_surf vert_surf( in appdata_full v );
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.normal = ( xll_constructMat3( gl_ModelViewMatrixInverseTranspose) * v.normal );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.normal, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-out.txt
deleted file mode 100644
index d87780097b0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPos2-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-void main ()
-{
- mat3 tmpvar_1;
- tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz;
- tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz;
- tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_2;
- tmpvar_2.w = 0.0;
- tmpvar_2.xyz = (tmpvar_1 * gl_Normal);
- gl_TexCoord[0] = tmpvar_2;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-in.txt
deleted file mode 100644
index 643d34ed112..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-in.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec4 screenPos;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-
-
-v2f_surf vert_surf( in appdata_full v );
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.normal = ( xll_constructMat3( gl_ModelViewMatrixInverseTranspose) * v.normal );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.normal, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt
deleted file mode 100644
index d87780097b0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-void main ()
-{
- mat3 tmpvar_1;
- tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz;
- tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz;
- tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_2;
- tmpvar_2.w = 0.0;
- tmpvar_2.xyz = (tmpvar_1 * gl_Normal);
- gl_TexCoord[0] = tmpvar_2;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-in.txt
deleted file mode 100644
index 229a380f8e6..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-in.txt
+++ /dev/null
@@ -1,78 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec4 screenPos;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_screenPos;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _ProjectionParams;
-
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_screenPos = ComputeScreenPos( o.pos);
- o.hip_screen = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_screenPos);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-out.txt
deleted file mode 100644
index bfdafda3e13..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_ScreenPosAlbedo1-out.txt
+++ /dev/null
@@ -1,36 +0,0 @@
-uniform vec4 _ProjectionParams;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_2;
- o_2 = (pos_1 * 0.5);
- vec2 tmpvar_3;
- tmpvar_3.x = o_2.x;
- tmpvar_3.y = (o_2.y * _ProjectionParams.x);
- o_2.xy = (tmpvar_3 + o_2.w);
- o_2.zw = pos_1.zw;
- vec4 o_4;
- o_4 = (pos_1 * 0.5);
- vec2 tmpvar_5;
- tmpvar_5.x = o_4.x;
- tmpvar_5.y = (o_4.y * _ProjectionParams.x);
- o_4.xy = (tmpvar_5 + o_4.w);
- o_4.zw = pos_1.zw;
- gl_Position = pos_1;
- vec4 tmpvar_6;
- tmpvar_6.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_6.x = pos_1.z;
- xlv_FOG = tmpvar_6;
- gl_TexCoord[0] = o_2;
- gl_TexCoord[1] = o_4;
-}
-
-
-// stats: 8 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _ProjectionParams (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-in.txt
deleted file mode 100644
index d26d1b3932e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-in.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldPos;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 worldPos;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.worldPos = ( _Object2World * v.vertex ).xyz ;
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.worldPos, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[4] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-out.txt
deleted file mode 100644
index a253178541a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices-out.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- vec4 tmpvar_6;
- tmpvar_6 = (_Object2World * gl_Vertex);
- tmpvar_5.xyz = tmpvar_6.xyz;
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[2] = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_6.xyz);
- gl_TexCoord[3] = tmpvar_8;
- gl_TexCoord[4] = (_LightMatrix0 * tmpvar_6);
-}
-
-
-// stats: 13 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #5: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-in.txt
deleted file mode 100644
index c9868dc4650..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-in.txt
+++ /dev/null
@@ -1,84 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldPos;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 worldPos;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.worldPos = ( _Object2World * v.vertex ).xyz ;
- o.hip_screen = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.worldPos, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.hip_screen);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-out.txt
deleted file mode 100644
index 28176145d29..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices1-out.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_2;
- o_2 = (pos_1 * 0.5);
- vec2 tmpvar_3;
- tmpvar_3.x = o_2.x;
- tmpvar_3.y = (o_2.y * _ProjectionParams.x);
- o_2.xy = (tmpvar_3 + o_2.w);
- o_2.zw = pos_1.zw;
- gl_Position = pos_1;
- vec4 tmpvar_4;
- tmpvar_4.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_4.x = pos_1.z;
- xlv_FOG = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.zw = vec2(0.0, 0.0);
- tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = (_Object2World * gl_Vertex).xyz;
- gl_TexCoord[1] = tmpvar_6;
- gl_TexCoord[2] = o_2;
-}
-
-
-// stats: 10 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 4 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _ProjectionParams (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-in.txt
deleted file mode 100644
index 811bb171c9c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-in.txt
+++ /dev/null
@@ -1,91 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldPos;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 worldPos;
- vec4 hip_screen;
- vec3 hip_lmapFade;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-
-
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.worldPos = ( _Object2World * v.vertex ).xyz ;
- o.hip_screen = ComputeScreenPos( o.pos);
- o.hip_lmapFade.xy = ((v.texcoord1.xy * unity_LightmapST.xy ) + unity_LightmapST.zw );
- o.hip_lmapFade.z = ((( -( gl_ModelViewMatrix * v.vertex ).z ) * unity_LightmapFade.z ) + unity_LightmapFade.w );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.worldPos, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.hip_screen);
- gl_TexCoord[3] = vec4( xl_retval.hip_lmapFade, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-out.txt
deleted file mode 100644
index 289717dd818..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices2-out.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _ProjectionParams;
-uniform vec4 unity_LightmapFade;
-uniform vec4 unity_LightmapST;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 tmpvar_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_3;
- o_3 = (pos_2 * 0.5);
- vec2 tmpvar_4;
- tmpvar_4.x = o_3.x;
- tmpvar_4.y = (o_3.y * _ProjectionParams.x);
- o_3.xy = (tmpvar_4 + o_3.w);
- o_3.zw = pos_2.zw;
- tmpvar_1.xy = ((gl_MultiTexCoord1.xy * unity_LightmapST.xy) + unity_LightmapST.zw);
- tmpvar_1.z = ((-(
- (gl_ModelViewMatrix * gl_Vertex)
- .z) * unity_LightmapFade.z) + unity_LightmapFade.w);
- gl_Position = pos_2;
- vec4 tmpvar_5;
- tmpvar_5.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_5.x = pos_2.z;
- xlv_FOG = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.zw = vec2(0.0, 0.0);
- tmpvar_6.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_6;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (_Object2World * gl_Vertex).xyz;
- gl_TexCoord[1] = tmpvar_7;
- gl_TexCoord[2] = o_3;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = tmpvar_1;
- gl_TexCoord[3] = tmpvar_8;
-}
-
-
-// stats: 17 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _ProjectionParams (high float) 4x1 [-1]
-// #5: unity_LightmapFade (high float) 4x1 [-1]
-// #6: unity_LightmapST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-in.txt
deleted file mode 100644
index 593c0342876..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-in.txt
+++ /dev/null
@@ -1,86 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec3 worldPos;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 _ShadowCoord0;
- vec3 _ShadowCoord1;
- vec3 _ShadowCoord2;
- vec3 _ShadowCoord3;
- vec2 _ShadowZFade;
- vec3 worldPos;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _LightShadowData;
-uniform mat4 _Object2World;
-uniform mat4 _World2Shadow;
-uniform mat4 _World2Shadow1;
-uniform mat4 _World2Shadow2;
-uniform mat4 _World2Shadow3;
-
-
-v2f_surf vert_surf( in appdata_full v );
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- float z;
- vec4 wpos;
- o.worldPos = ( _Object2World * v.vertex ).xyz ;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- z = ( -( gl_ModelViewMatrix * v.vertex ).z );
- o._ShadowZFade.x = z;
- o._ShadowZFade.y = ((z * _LightShadowData.z ) + _LightShadowData.w );
- wpos = ( _Object2World * v.vertex );
- o._ShadowCoord0 = ( _World2Shadow * wpos ).xyz ;
- o._ShadowCoord1 = ( _World2Shadow1 * wpos ).xyz ;
- o._ShadowCoord2 = ( _World2Shadow2 * wpos ).xyz ;
- o._ShadowCoord3 = ( _World2Shadow3 * wpos ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval._ShadowCoord0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval._ShadowCoord1, 0.0);
- gl_TexCoord[2] = vec4( xl_retval._ShadowCoord2, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._ShadowCoord3, 0.0);
- gl_TexCoord[4] = vec4( xl_retval._ShadowZFade, 0.0, 0.0);
- gl_TexCoord[5] = vec4( xl_retval.worldPos, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-out.txt
deleted file mode 100644
index 68b10aa5d05..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_Slices3-out.txt
+++ /dev/null
@@ -1,55 +0,0 @@
-uniform vec4 _LightShadowData;
-uniform mat4 _Object2World;
-uniform mat4 _World2Shadow;
-uniform mat4 _World2Shadow1;
-uniform mat4 _World2Shadow2;
-uniform mat4 _World2Shadow3;
-void main ()
-{
- float z_1;
- vec2 tmpvar_2;
- z_1 = -((gl_ModelViewMatrix * gl_Vertex).z);
- tmpvar_2.x = z_1;
- tmpvar_2.y = ((z_1 * _LightShadowData.z) + _LightShadowData.w);
- vec4 tmpvar_3;
- tmpvar_3 = (_Object2World * gl_Vertex);
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_4;
- tmpvar_4.w = 0.0;
- tmpvar_4.xyz = (_World2Shadow * tmpvar_3).xyz;
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (_World2Shadow1 * tmpvar_3).xyz;
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = (_World2Shadow2 * tmpvar_3).xyz;
- gl_TexCoord[2] = tmpvar_6;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (_World2Shadow3 * tmpvar_3).xyz;
- gl_TexCoord[3] = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.zw = vec2(0.0, 0.0);
- tmpvar_8.xy = tmpvar_2;
- gl_TexCoord[4] = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = tmpvar_3.xyz;
- gl_TexCoord[5] = tmpvar_9;
-}
-
-
-// stats: 16 alu 0 tex 0 flow
-// inputs: 1
-// #0: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 8 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _LightShadowData (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _World2Shadow (high float) 4x4 [-1]
-// #5: _World2Shadow1 (high float) 4x4 [-1]
-// #6: _World2Shadow2 (high float) 4x4 [-1]
-// #7: _World2Shadow3 (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-in.txt
deleted file mode 100644
index f8a0e59febd..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-in.txt
+++ /dev/null
@@ -1,96 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec3 worldRefl;
- vec3 normal;
- vec3 lightDir;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return _WorldSpaceLightPos0.xyz ;
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 viewDir;
- vec3 viewRefl;
- PositionFog( v.vertex, o.pos, o.fog);
- viewDir = ( -ObjSpaceViewDir( v.vertex) );
- viewRefl = reflect( viewDir, v.normal);
- o.worldRefl = ( xll_constructMat3( _Object2World) * viewRefl );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.worldRefl, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-out.txt
deleted file mode 100644
index 94ad7f123f0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl-out.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 viewDir_1;
- vec4 pos_2;
- pos_2 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_3;
- tmpvar_3.w = 1.0;
- tmpvar_3.xyz = _WorldSpaceCameraPos;
- viewDir_1 = (gl_Vertex.xyz - ((_World2Object * tmpvar_3).xyz * unity_Scale.w));
- mat3 tmpvar_4;
- tmpvar_4[0] = _Object2World[0].xyz;
- tmpvar_4[1] = _Object2World[1].xyz;
- tmpvar_4[2] = _Object2World[2].xyz;
- mat3 tmpvar_5;
- tmpvar_5[0] = _Object2World[0].xyz;
- tmpvar_5[1] = _Object2World[1].xyz;
- tmpvar_5[2] = _Object2World[2].xyz;
- gl_Position = pos_2;
- vec4 tmpvar_6;
- tmpvar_6.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_6.x = pos_2.z;
- xlv_FOG = tmpvar_6;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (tmpvar_4 * (viewDir_1 - (2.0 *
- (dot (gl_Normal, viewDir_1) * gl_Normal)
- )));
- gl_TexCoord[0] = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (tmpvar_5 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = _WorldSpaceLightPos0.xyz;
- gl_TexCoord[2] = tmpvar_9;
-}
-
-
-// stats: 16 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _Object2World (high float) 4x4 [-1]
-// #2: _World2Object (high float) 4x4 [-1]
-// #3: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #5: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-in.txt
deleted file mode 100644
index e5f10439ab7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-in.txt
+++ /dev/null
@@ -1,62 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec3 worldRefl;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 normal;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-
-
-v2f_surf vert_surf( in appdata_full v );
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.normal = ( xll_constructMat3( gl_ModelViewMatrixInverseTranspose) * v.normal );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.normal, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-out.txt
deleted file mode 100644
index d87780097b0..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Surface_WorldRefl1-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-void main ()
-{
- mat3 tmpvar_1;
- tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz;
- tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz;
- tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_2;
- tmpvar_2.w = 0.0;
- tmpvar_2.xyz = (tmpvar_1 * gl_Normal);
- gl_TexCoord[0] = tmpvar_2;
-}
-
-
-// stats: 3 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-in.txt
deleted file mode 100644
index f1f5793fe14..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-in.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec4 color;
-};
-struct appdata_base {
- vec4 vertex;
- vec3 normal;
- vec4 texcoord;
-};
-
-
-v2f vert( in appdata_base v );
-v2f vert( in appdata_base v ) {
- v2f o;
- vec3 normal;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- normal = ( xll_constructMat3( gl_ModelViewMatrixInverseTranspose) * v.normal );
- o.color = vec4( ((normal * 0.500000) + 0.500000), 1.00000);
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata_base xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_FrontColor = vec4( xl_retval.color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-out.txt
deleted file mode 100644
index 8e85c479d0c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_CgNormals-out.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-void main ()
-{
- mat3 tmpvar_1;
- tmpvar_1[0] = gl_ModelViewMatrixInverseTranspose[0].xyz;
- tmpvar_1[1] = gl_ModelViewMatrixInverseTranspose[1].xyz;
- tmpvar_1[2] = gl_ModelViewMatrixInverseTranspose[2].xyz;
- vec4 tmpvar_2;
- tmpvar_2.w = 1.0;
- tmpvar_2.xyz = (((tmpvar_1 * gl_Normal) * 0.5) + 0.5);
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- gl_FrontColor = tmpvar_2;
-}
-
-
-// stats: 5 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_Normal (high float) 3x1 [-1] loc 2
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-in.txt
deleted file mode 100644
index dcbb0e44d21..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-in.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return texture2DLod( s, coord.xy, coord.w);
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_base {
- vec4 vertex;
- vec3 normal;
- vec4 texcoord;
-};
-uniform sampler2D _CameraDepthTexture;
-
-v2f vert( in appdata_base v );
-v2f vert( in appdata_base v ) {
- float tex;
- v2f o;
- tex = xll_tex2Dlod( _CameraDepthTexture, vec4( v.texcoord.xy , 0.000000, 0.000000)).x ;
- v.vertex.y += ((1.00000 - float( tex)) * 3.00000);
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.uv = v.texcoord.xy ;
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata_base xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.uv, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt
deleted file mode 100644
index 424b7a36d20..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderDepthTexture-out.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-uniform sampler2D _CameraDepthTexture;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1.xzw = gl_Vertex.xzw;
- tmpvar_1.y = (gl_Vertex.y + ((1.0 - texture2DLod (_CameraDepthTexture, gl_MultiTexCoord0.xy, 0.0).x) * 3.0));
- gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_1);
- vec4 tmpvar_2;
- tmpvar_2.zw = vec2(0.0, 0.0);
- tmpvar_2.xy = gl_MultiTexCoord0.xy;
- gl_TexCoord[0] = tmpvar_2;
-}
-
-
-// stats: 5 alu 1 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 1 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// textures: 1
-// #0: _CameraDepthTexture (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-in.txt
deleted file mode 100644
index 0511cca4c7a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-in.txt
+++ /dev/null
@@ -1,47 +0,0 @@
-vec4 xll_tex2Dlod(sampler2D s, vec4 coord) {
- return texture2DLod( s, coord.xy, coord.w);
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_base {
- vec4 vertex;
- vec3 normal;
- vec4 texcoord;
-};
-uniform sampler2D _MainTex;
-
-v2f vert( in appdata_base v );
-v2f vert( in appdata_base v ) {
- vec4 tex;
- v2f o;
- tex = xll_tex2Dlod( _MainTex, vec4( v.texcoord.xy , 0.000000, 0.000000));
- v.vertex.y += (tex.x * 2.00000);
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.uv = v.texcoord.xy ;
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata_base xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.uv, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-out.txt
deleted file mode 100644
index dca4fac0125..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Test_VertexShaderTexture-out.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-uniform sampler2D _MainTex;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1.xzw = gl_Vertex.xzw;
- tmpvar_1.y = (gl_Vertex.y + (texture2DLod (_MainTex, gl_MultiTexCoord0.xy, 0.0).x * 2.0));
- gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_1);
- vec4 tmpvar_2;
- tmpvar_2.zw = vec2(0.0, 0.0);
- tmpvar_2.xy = gl_MultiTexCoord0.xy;
- gl_TexCoord[0] = tmpvar_2;
-}
-
-
-// stats: 4 alu 1 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 1 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// textures: 1
-// #0: _MainTex (high 2d) 0x0 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-in.txt
deleted file mode 100644
index c438ed98bea..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-in.txt
+++ /dev/null
@@ -1,56 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 vertex;
- vec4 color;
- vec3 texcoord;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec3 normal;
-};
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-
-
-uniform vec4 unity_Scale;
-vec3 ObjSpaceViewDir( in vec4 v );
-v2f vert( in appdata_t v );
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-v2f vert( in appdata_t v ) {
- v2f o;
- vec3 viewDir;
- o.vertex = ( gl_ModelViewProjectionMatrix * v.vertex );
- viewDir = ( -normalize( ObjSpaceViewDir( v.vertex) ) );
- o.texcoord = reflect( viewDir, v.normal);
- o.texcoord = vec3( ( gl_ModelViewMatrix * vec4( o.texcoord, 0.000000) ));
- o.color = v.color;
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata_t xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.color = vec4( gl_Color);
- xlt_v.normal = vec3( gl_Normal);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.vertex);
- gl_FrontColor = vec4( xl_retval.color);
- gl_TexCoord[0] = vec4( xl_retval.texcoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-out.txt
deleted file mode 100644
index 259a2c8b43a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TexGen_Cube_Refl-out.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 unity_Scale;
-void main ()
-{
- vec3 viewDir_1;
- vec4 tmpvar_2;
- tmpvar_2.w = 1.0;
- tmpvar_2.xyz = _WorldSpaceCameraPos;
- viewDir_1 = -(normalize((
- ((_World2Object * tmpvar_2).xyz * unity_Scale.w)
- - gl_Vertex.xyz)));
- vec4 tmpvar_3;
- tmpvar_3.w = 0.0;
- tmpvar_3.xyz = (viewDir_1 - (2.0 * (
- dot (gl_Normal, viewDir_1)
- * gl_Normal)));
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- gl_FrontColor = gl_Color;
- vec4 tmpvar_4;
- tmpvar_4.w = 0.0;
- tmpvar_4.xyz = (gl_ModelViewMatrix * tmpvar_3).xyz;
- gl_TexCoord[0] = tmpvar_4;
-}
-
-
-// stats: 14 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_Color (high float) 4x1 [-1] loc 3
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 5 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _World2Object (high float) 4x4 [-1]
-// #3: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #4: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-in.txt
deleted file mode 100644
index 4722021d7d7..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-in.txt
+++ /dev/null
@@ -1,45 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- vec2 texcoord;
- vec3 cubenormal;
-};
-struct appdata {
- vec4 vertex;
- vec2 texcoord;
- vec3 normal;
-};
-uniform vec4 _MainTex_ST;
-
-
-v2f vert( in appdata v );
-v2f vert( in appdata v ) {
- v2f o;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.texcoord = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.cubenormal = vec3( ( gl_ModelViewMatrix * vec4( v.normal, 0.000000) ));
- return o;
-}
-void main() {
- v2f xl_retval;
- appdata xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.texcoord = vec2( gl_MultiTexCoord0);
- xlt_v.normal = vec3( gl_Normal);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.texcoord, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.cubenormal, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-out.txt
deleted file mode 100644
index fca4052fa27..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Toon_Basic-out.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-uniform vec4 _MainTex_ST;
-void main ()
-{
- vec4 tmpvar_1;
- tmpvar_1.w = 0.0;
- tmpvar_1.xyz = gl_Normal;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 tmpvar_2;
- tmpvar_2.zw = vec2(0.0, 0.0);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_3;
- tmpvar_3.w = 0.0;
- tmpvar_3.xyz = (gl_ModelViewMatrix * tmpvar_1).xyz;
- gl_TexCoord[1] = tmpvar_3;
-}
-
-
-// stats: 7 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 3 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-in.txt
deleted file mode 100644
index 01f68b11fbe..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-in.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
- vec3 viewDir;
- vec3 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return ((objSpaceLightPos.xyz * unity_Scale.w ) - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-out.txt
deleted file mode 100644
index d566b0fe247..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Bumped_Specular-out.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_4;
- tmpvar_4[0].x = TANGENT.x;
- tmpvar_4[0].y = binormal_1.x;
- tmpvar_4[0].z = gl_Normal.x;
- tmpvar_4[1].x = TANGENT.y;
- tmpvar_4[1].y = binormal_1.y;
- tmpvar_4[1].z = gl_Normal.y;
- tmpvar_4[2].x = TANGENT.z;
- tmpvar_4[2].y = binormal_1.z;
- tmpvar_4[2].z = gl_Normal.z;
- vec4 tmpvar_5;
- tmpvar_5.w = 1.0;
- tmpvar_5.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_3;
- vec4 tmpvar_6;
- tmpvar_6.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_6.x = pos_3.z;
- xlv_FOG = tmpvar_6;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (tmpvar_4 * ((
- (_World2Object * _WorldSpaceLightPos0)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[1] = tmpvar_7;
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = (tmpvar_4 * ((
- (_World2Object * tmpvar_5)
- .xyz * unity_Scale.w) - gl_Vertex.xyz));
- gl_TexCoord[2] = tmpvar_8;
- vec4 tmpvar_9;
- tmpvar_9.w = 0.0;
- tmpvar_9.xyz = (_LightMatrix0 * (_Object2World * gl_Vertex)).xyz;
- gl_TexCoord[3] = tmpvar_9;
-}
-
-
-// stats: 24 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 9 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _World2Object (high float) 4x4 [-1]
-// #6: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #7: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #8: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-in.txt
deleted file mode 100644
index f127eb26935..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-in.txt
+++ /dev/null
@@ -1,85 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec4 hip_pack0;
- vec3 lightDir;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return objSpaceLightPos.xyz ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-out.txt
deleted file mode 100644
index aae5c1a7065..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse-out.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-uniform mat4 _World2Object;
-uniform vec4 _WorldSpaceLightPos0;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 pos_3;
- pos_3 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_4;
- tmpvar_4[0].x = TANGENT.x;
- tmpvar_4[0].y = binormal_1.x;
- tmpvar_4[0].z = gl_Normal.x;
- tmpvar_4[1].x = TANGENT.y;
- tmpvar_4[1].y = binormal_1.y;
- tmpvar_4[1].z = gl_Normal.y;
- tmpvar_4[2].x = TANGENT.z;
- tmpvar_4[2].y = binormal_1.z;
- tmpvar_4[2].z = gl_Normal.z;
- gl_Position = pos_3;
- vec4 tmpvar_5;
- tmpvar_5.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_5.x = pos_3.z;
- xlv_FOG = tmpvar_5;
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = (tmpvar_4 * (_World2Object * _WorldSpaceLightPos0).xyz);
- gl_TexCoord[1] = tmpvar_6;
-}
-
-
-// stats: 13 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 5 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _BumpMap_ST (high float) 4x1 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _World2Object (high float) 4x4 [-1]
-// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-in.txt
deleted file mode 100644
index d4dfb2f5a6b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-in.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt
deleted file mode 100644
index d66048d5993..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Diffuse1-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_2;
- o_2 = (pos_1 * 0.5);
- vec2 tmpvar_3;
- tmpvar_3.x = o_2.x;
- tmpvar_3.y = (o_2.y * _ProjectionParams.x);
- o_2.xy = (tmpvar_3 + o_2.w);
- o_2.zw = pos_1.zw;
- gl_Position = pos_1;
- vec4 tmpvar_4;
- tmpvar_4.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_4.x = pos_1.z;
- xlv_FOG = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.zw = vec2(0.0, 0.0);
- tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_5;
- gl_TexCoord[1] = o_2;
-}
-
-
-// stats: 8 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 3 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _ProjectionParams (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-in.txt
deleted file mode 100644
index 9d10e5ee80a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-in.txt
+++ /dev/null
@@ -1,79 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- vec4 hip_pack0;
- vec3 TtoV0;
- vec3 TtoV1;
- vec3 TtoV2;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-
-
-v2f_surf vert_surf( in appdata_full v );
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_pack0.zw = ((v.texcoord.xy * _BumpMap_ST.xy ) + _BumpMap_ST.zw );
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.TtoV0 = ( rotation * xll_constructMat3( gl_ModelViewMatrixInverseTranspose)[ 0 ].xyz );
- o.TtoV1 = ( rotation * xll_constructMat3( gl_ModelViewMatrixInverseTranspose)[ 1 ].xyz );
- o.TtoV2 = ( rotation * xll_constructMat3( gl_ModelViewMatrixInverseTranspose)[ 2 ].xyz );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0);
- gl_TexCoord[1] = vec4( xl_retval.TtoV0, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.TtoV1, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.TtoV2, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-out.txt
deleted file mode 100644
index 725a323c1ea..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular-out.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-uniform vec4 _BumpMap_ST;
-uniform vec4 _MainTex_ST;
-attribute vec4 TANGENT;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- tmpvar_2.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- tmpvar_2.zw = ((gl_MultiTexCoord0.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
- binormal_1 = (((gl_Normal.yzx * TANGENT.zxy) - (gl_Normal.zxy * TANGENT.yzx)) * TANGENT.w);
- mat3 tmpvar_3;
- tmpvar_3[0].x = TANGENT.x;
- tmpvar_3[0].y = binormal_1.x;
- tmpvar_3[0].z = gl_Normal.x;
- tmpvar_3[1].x = TANGENT.y;
- tmpvar_3[1].y = binormal_1.y;
- tmpvar_3[1].z = gl_Normal.y;
- tmpvar_3[2].x = TANGENT.z;
- tmpvar_3[2].y = binormal_1.z;
- tmpvar_3[2].z = gl_Normal.z;
- gl_Position = (gl_ModelViewProjectionMatrix * gl_Vertex);
- gl_TexCoord[0] = tmpvar_2;
- vec4 tmpvar_4;
- tmpvar_4.w = 0.0;
- tmpvar_4.xyz = (tmpvar_3 * gl_ModelViewMatrixInverseTranspose[0].xyz);
- gl_TexCoord[1] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_3 * gl_ModelViewMatrixInverseTranspose[1].xyz);
- gl_TexCoord[2] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = (tmpvar_3 * gl_ModelViewMatrixInverseTranspose[2].xyz);
- gl_TexCoord[3] = tmpvar_6;
-}
-
-
-// stats: 15 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// #3: TANGENT (high float) 4x1 [-1]
-// uniforms: 4 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: _BumpMap_ST (high float) 4x1 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-in.txt
deleted file mode 100644
index d4dfb2f5a6b..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-in.txt
+++ /dev/null
@@ -1,80 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec2 uv_BumpMap;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 hip_screen;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec4 ComputeScreenPos( in vec4 pos );
-v2f_surf vert_surf( in appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec4 ComputeScreenPos( in vec4 pos ) {
- vec4 o;
- o = (pos * 0.500000);
- o.xy = (vec2( o.x , (o.y * _ProjectionParams.x )) + o.w );
- o.zw = pos.zw ;
- return o;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.hip_screen = ComputeScreenPos( o.pos);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.hip_screen);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-out.txt
deleted file mode 100644
index d66048d5993..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Bumped_Specular1-out.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform vec4 _ProjectionParams;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- vec4 o_2;
- o_2 = (pos_1 * 0.5);
- vec2 tmpvar_3;
- tmpvar_3.x = o_2.x;
- tmpvar_3.y = (o_2.y * _ProjectionParams.x);
- o_2.xy = (tmpvar_3 + o_2.w);
- o_2.zw = pos_1.zw;
- gl_Position = pos_1;
- vec4 tmpvar_4;
- tmpvar_4.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_4.x = pos_1.z;
- xlv_FOG = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.zw = vec2(0.0, 0.0);
- tmpvar_5.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_5;
- gl_TexCoord[1] = o_2;
-}
-
-
-// stats: 8 alu 0 tex 0 flow
-// inputs: 2
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 3 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _ProjectionParams (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-in.txt
deleted file mode 100644
index f67229d8216..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-in.txt
+++ /dev/null
@@ -1,89 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec4 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return (_WorldSpaceLightPos0.xyz - worldPos);
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-out.txt
deleted file mode 100644
index 236ce480d62..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Diffuse-out.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- vec4 tmpvar_7;
- tmpvar_7 = (_Object2World * gl_Vertex);
- tmpvar_6.xyz = (_WorldSpaceLightPos0.xyz - tmpvar_7.xyz);
- gl_TexCoord[2] = tmpvar_6;
- gl_TexCoord[3] = (_LightMatrix0 * tmpvar_7);
-}
-
-
-// stats: 12 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #5: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-in.txt
deleted file mode 100644
index 49cc148578a..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-in.txt
+++ /dev/null
@@ -1,93 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 viewDir;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceViewDir( in vec4 v );
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceViewDir( in vec4 v ) {
- return (_WorldSpaceCameraPos.xyz - ( _Object2World * v ).xyz );
-}
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return _WorldSpaceLightPos0.xyz ;
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o.viewDir = WorldSpaceViewDir( v.vertex);
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.viewDir, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-out.txt
deleted file mode 100644
index 07eebdc24b2..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Cutout_Specular-out.txt
+++ /dev/null
@@ -1,50 +0,0 @@
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = _WorldSpaceLightPos0.xyz;
- gl_TexCoord[2] = tmpvar_6;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = (_WorldSpaceCameraPos - (_Object2World * gl_Vertex).xyz);
- gl_TexCoord[3] = tmpvar_7;
-}
-
-
-// stats: 12 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 6 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
-// #2: _Object2World (high float) 4x4 [-1]
-// #3: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #4: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #5: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-in.txt
deleted file mode 100644
index a945920fa51..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-in.txt
+++ /dev/null
@@ -1,97 +0,0 @@
-mat3 xll_constructMat3( mat4 m) {
- return mat3( vec3( m[0]), vec3( m[1]), vec3( m[2]));
-}
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec3 normal;
- vec3 lightDir;
- vec3 viewDir;
- vec2 _LightCoord;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec3 WorldSpaceViewDir( in vec4 v );
-vec3 WorldSpaceLightDir( in vec4 v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f_surf vert_surf( in appdata_full v );
-vec3 WorldSpaceViewDir( in vec4 v ) {
- return (_WorldSpaceCameraPos.xyz - ( _Object2World * v ).xyz );
-}
-vec3 WorldSpaceLightDir( in vec4 v ) {
- vec3 worldPos;
- worldPos = ( _Object2World * v ).xyz ;
- return _WorldSpaceLightPos0.xyz ;
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.normal = ( xll_constructMat3( _Object2World) * (v.normal * unity_Scale.w ) );
- o.lightDir = WorldSpaceLightDir( v.vertex);
- o.viewDir = WorldSpaceViewDir( v.vertex);
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xy ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[4] = vec4( xl_retval._LightCoord, 0.0, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-out.txt
deleted file mode 100644
index 57c25b543ed..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Transparent_Specular-out.txt
+++ /dev/null
@@ -1,58 +0,0 @@
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- mat3 tmpvar_2;
- tmpvar_2[0] = _Object2World[0].xyz;
- tmpvar_2[1] = _Object2World[1].xyz;
- tmpvar_2[2] = _Object2World[2].xyz;
- gl_Position = pos_1;
- vec4 tmpvar_3;
- tmpvar_3.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_3.x = pos_1.z;
- xlv_FOG = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.zw = vec2(0.0, 0.0);
- tmpvar_4.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_4;
- vec4 tmpvar_5;
- tmpvar_5.w = 0.0;
- tmpvar_5.xyz = (tmpvar_2 * (gl_Normal * unity_Scale.w));
- gl_TexCoord[1] = tmpvar_5;
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = _WorldSpaceLightPos0.xyz;
- gl_TexCoord[2] = tmpvar_6;
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- vec4 tmpvar_8;
- tmpvar_8 = (_Object2World * gl_Vertex);
- tmpvar_7.xyz = (_WorldSpaceCameraPos - tmpvar_8.xyz);
- gl_TexCoord[3] = tmpvar_7;
- vec4 tmpvar_9;
- tmpvar_9.zw = vec2(0.0, 0.0);
- tmpvar_9.xy = (_LightMatrix0 * tmpvar_8).xy;
- gl_TexCoord[4] = tmpvar_9;
-}
-
-
-// stats: 14 alu 0 tex 0 flow
-// inputs: 3
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Normal (high float) 3x1 [-1] loc 2
-// #2: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _LightMatrix0 (high float) 4x4 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #5: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #6: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-in.txt
deleted file mode 100644
index ef7be6b86ad..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-in.txt
+++ /dev/null
@@ -1,91 +0,0 @@
-float xll_saturate( float x) {
- return clamp( x, 0.0, 1.0);
-}
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct v2f {
- vec4 pos;
- vec2 uv;
- vec3 color;
- vec3 backContrib;
- vec3 nl;
- vec3 nh;
-};
-uniform vec3 _TerrainTreeLightDirections[4];
-uniform float _TranslucencyViewDependency;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-
-
-uniform vec4 unity_Scale;
-vec3 ObjSpaceViewDir( in vec4 v );
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent );
-v2f vert( in appdata_full v );
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent ) {
- float isBillboard;
- vec3 norb;
- vec3 tanb;
- isBillboard = (1.00000 - abs( tangent.w ));
- norb = vec3( normalize( ( vec4( normal, 0.000000) * mat ) ));
- tanb = vec3( normalize( ( vec4( tangent.xyz , 0.000000) * mat ) ));
- pos += (( vec4( normal.xy , 0.000000, 0.000000) * mat ) * isBillboard);
- normal = mix( normal, norb, vec3( isBillboard));
- tangent = mix( tangent, vec4( tanb, -1.00000), vec4( isBillboard));
-}
-v2f vert( in appdata_full v ) {
- v2f o;
- vec3 viewDir;
- int j = 0;
- vec3 lightDir;
- float nl;
- float backContrib;
- vec3 h;
- float nh;
- ExpandBillboard( gl_ModelViewMatrixInverseTranspose, v.vertex, v.normal, v.tangent);
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- o.uv = v.texcoord.xy ;
- viewDir = normalize( ObjSpaceViewDir( v.vertex) );
- for ( ; (j < 3); ( j++ )) {
- lightDir = _TerrainTreeLightDirections[ j ];
- nl = dot( v.normal, lightDir);
- backContrib = xll_saturate( dot( viewDir, ( -lightDir )) );
- backContrib = mix( xll_saturate( ( -nl ) ), backContrib, _TranslucencyViewDependency);
- o.backContrib[ j ] = (backContrib * 2.00000);
- nl = max( 0.000000, ((nl * 0.600000) + 0.400000));
- o.nl[ j ] = nl;
- h = normalize( (lightDir + viewDir) );
- nh = max( 0.000000, dot( v.normal, h));
- o.nh[ j ] = nh;
- }
- o.color = vec3( v.color.w );
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval.uv, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.color, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.backContrib, 0.0);
- gl_TexCoord[3] = vec4( xl_retval.nl, 0.0);
- gl_TexCoord[4] = vec4( xl_retval.nh, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-out.txt
deleted file mode 100644
index 9a84d06a7f9..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-TreeCreatorLeavesRT-out.txt
+++ /dev/null
@@ -1,127 +0,0 @@
-uniform vec3 _TerrainTreeLightDirections[4];
-uniform float _TranslucencyViewDependency;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-void main ()
-{
- vec3 lightDir_1;
- vec3 viewDir_2;
- vec3 tmpvar_3;
- vec3 tmpvar_4;
- vec3 tmpvar_5;
- vec4 pos_6;
- float isBillboard_7;
- isBillboard_7 = (1.0 - abs(TANGENT.w));
- vec4 tmpvar_8;
- tmpvar_8.w = 0.0;
- tmpvar_8.xyz = gl_Normal;
- vec4 tmpvar_9;
- tmpvar_9.zw = vec2(0.0, 0.0);
- tmpvar_9.xy = gl_Normal.xy;
- pos_6 = (gl_Vertex + ((tmpvar_9 * gl_ModelViewMatrixInverseTranspose) * isBillboard_7));
- vec3 tmpvar_10;
- tmpvar_10 = mix (gl_Normal, normalize((tmpvar_8 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(isBillboard_7));
- vec4 tmpvar_11;
- tmpvar_11.w = 1.0;
- tmpvar_11.xyz = _WorldSpaceCameraPos;
- viewDir_2 = normalize(((
- (_World2Object * tmpvar_11)
- .xyz * unity_Scale.w) - pos_6.xyz));
- lightDir_1 = _TerrainTreeLightDirections[0];
- float tmpvar_12;
- tmpvar_12 = dot (tmpvar_10, lightDir_1);
- vec3 tmpvar_13;
- tmpvar_13.yz = tmpvar_3.yz;
- tmpvar_13.x = (mix (clamp (
- -(tmpvar_12)
- , 0.0, 1.0), clamp (
- dot (viewDir_2, -(lightDir_1))
- , 0.0, 1.0), _TranslucencyViewDependency) * 2.0);
- vec3 tmpvar_14;
- tmpvar_14.yz = tmpvar_4.yz;
- tmpvar_14.x = max (0.0, ((tmpvar_12 * 0.6) + 0.4));
- vec3 tmpvar_15;
- tmpvar_15.yz = tmpvar_5.yz;
- tmpvar_15.x = max (0.0, dot (tmpvar_10, normalize(
- (lightDir_1 + viewDir_2)
- )));
- lightDir_1 = _TerrainTreeLightDirections[1];
- float tmpvar_16;
- tmpvar_16 = dot (tmpvar_10, lightDir_1);
- vec3 tmpvar_17;
- tmpvar_17.xz = tmpvar_13.xz;
- tmpvar_17.y = (mix (clamp (
- -(tmpvar_16)
- , 0.0, 1.0), clamp (
- dot (viewDir_2, -(lightDir_1))
- , 0.0, 1.0), _TranslucencyViewDependency) * 2.0);
- vec3 tmpvar_18;
- tmpvar_18.xz = tmpvar_14.xz;
- tmpvar_18.y = max (0.0, ((tmpvar_16 * 0.6) + 0.4));
- vec3 tmpvar_19;
- tmpvar_19.xz = tmpvar_15.xz;
- tmpvar_19.y = max (0.0, dot (tmpvar_10, normalize(
- (lightDir_1 + viewDir_2)
- )));
- lightDir_1 = _TerrainTreeLightDirections[2];
- float tmpvar_20;
- tmpvar_20 = dot (tmpvar_10, lightDir_1);
- vec3 tmpvar_21;
- tmpvar_21.xy = tmpvar_17.xy;
- tmpvar_21.z = (mix (clamp (
- -(tmpvar_20)
- , 0.0, 1.0), clamp (
- dot (viewDir_2, -(lightDir_1))
- , 0.0, 1.0), _TranslucencyViewDependency) * 2.0);
- tmpvar_3 = tmpvar_21;
- vec3 tmpvar_22;
- tmpvar_22.xy = tmpvar_18.xy;
- tmpvar_22.z = max (0.0, ((tmpvar_20 * 0.6) + 0.4));
- tmpvar_4 = tmpvar_22;
- vec3 tmpvar_23;
- tmpvar_23.xy = tmpvar_19.xy;
- tmpvar_23.z = max (0.0, dot (tmpvar_10, normalize(
- (lightDir_1 + viewDir_2)
- )));
- tmpvar_5 = tmpvar_23;
- gl_Position = (gl_ModelViewProjectionMatrix * pos_6);
- vec4 tmpvar_24;
- tmpvar_24.zw = vec2(0.0, 0.0);
- tmpvar_24.xy = gl_MultiTexCoord0.xy;
- gl_TexCoord[0] = tmpvar_24;
- vec4 tmpvar_25;
- tmpvar_25.w = 0.0;
- tmpvar_25.xyz = gl_Color.www;
- gl_TexCoord[1] = tmpvar_25;
- vec4 tmpvar_26;
- tmpvar_26.w = 0.0;
- tmpvar_26.xyz = tmpvar_21;
- gl_TexCoord[2] = tmpvar_26;
- vec4 tmpvar_27;
- tmpvar_27.w = 0.0;
- tmpvar_27.xyz = tmpvar_22;
- gl_TexCoord[3] = tmpvar_27;
- vec4 tmpvar_28;
- tmpvar_28.w = 0.0;
- tmpvar_28.xyz = tmpvar_23;
- gl_TexCoord[4] = tmpvar_28;
-}
-
-
-// stats: 66 alu 0 tex 0 flow
-// inputs: 5
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// #4: TANGENT (high float) 4x1 [-1]
-// uniforms: 7 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: _TerrainTreeLightDirections (high float) 3x1 [4]
-// #3: _TranslucencyViewDependency (high float) 1x1 [-1]
-// #4: _World2Object (high float) 4x4 [-1]
-// #5: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #6: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-in.txt
deleted file mode 100644
index 82aa34ec08e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-in.txt
+++ /dev/null
@@ -1,171 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
-};
-uniform vec4 _Color;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec4 Squash( in vec4 pos );
-vec4 TriangleWave( in vec4 x );
-vec4 SmoothCurve( in vec4 x );
-vec4 SmoothTriangleWave( in vec4 x );
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams );
-void TreeVertBark( inout appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-vec4 TriangleWave( in vec4 x ) {
- return abs( ((fract( (x + 0.500000) ) * 2.00000) - 1.00000) );
-}
-vec4 SmoothCurve( in vec4 x ) {
- return ((x * x) * (3.00000 - (2.00000 * x)));
-}
-vec4 SmoothTriangleWave( in vec4 x ) {
- return SmoothCurve( TriangleWave( x));
-}
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams ) {
- float fDetailAmp = 0.100000;
- float fBranchAmp = 0.300000;
- float fObjPhase;
- float fBranchPhase;
- float fVtxPhase;
- vec2 vWavesIn;
- vec4 vWaves;
- vec2 vWavesSum;
- vec3 bend;
- fObjPhase = dot( _Object2World[ 3 ].xyz , vec3( 1.00000));
- fBranchPhase = (fObjPhase + animParams.x );
- fVtxPhase = dot( pos.xyz , vec3( (animParams.y + fBranchPhase)));
- vWavesIn = (_TimeX + vec2( fVtxPhase, fBranchPhase));
- vWaves = ((fract( (vWavesIn.xxyy * vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000);
- vWaves = SmoothTriangleWave( vWaves);
- vWavesSum = (vWaves.xz + vWaves.yw );
- bend = ((animParams.y * fDetailAmp) * normal.xyz );
- bend.y = (animParams.w * fBranchAmp);
- pos.xyz += (((vWavesSum.xyx * bend) + ((_Wind.xyz * vWavesSum.y ) * animParams.w )) * _Wind.w );
- pos.xyz += (animParams.z * _Wind.xyz );
- return pos;
-}
-void TreeVertBark( inout appdata_full v ) {
- v.vertex.xyz *= _Scale.xyz ;
- v.vertex = AnimateVertex( v.vertex, v.normal, vec4( v.color.xy , v.texcoord1.xy ));
- v.vertex = Squash( v.vertex);
- v.color = vec4( (v.color.w * _Color.xyz ), _Color.w );
- v.normal = normalize( v.normal );
- v.tangent.xyz = normalize( v.tangent.xyz );
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return objSpaceLightPos.xyz ;
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- TreeVertBark( v);
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_FrontColor = vec4( xl_retval.lop_color);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.viewDir, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-out.txt
deleted file mode 100644
index 9830d8ad731..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader-out.txt
+++ /dev/null
@@ -1,129 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 tmpvar_3;
- tmpvar_2.w = gl_Vertex.w;
- tmpvar_3.w = TANGENT.w;
- tmpvar_2.xyz = (gl_Vertex.xyz * _Scale.xyz);
- vec4 pos_4;
- pos_4.w = tmpvar_2.w;
- vec3 bend_5;
- vec2 vWavesSum_6;
- vec4 vWaves_7;
- float fBranchPhase_8;
- fBranchPhase_8 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
- vec2 tmpvar_9;
- tmpvar_9.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_8)));
- tmpvar_9.y = fBranchPhase_8;
- vWaves_7 = ((fract(
- ((_TimeX + tmpvar_9).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
- ) * 2.0) - 1.0);
- vec4 tmpvar_10;
- tmpvar_10 = abs(((
- fract((vWaves_7 + 0.5))
- * 2.0) - 1.0));
- vec4 tmpvar_11;
- tmpvar_11 = ((tmpvar_10 * tmpvar_10) * (3.0 - (2.0 * tmpvar_10)));
- vWaves_7 = tmpvar_11;
- vWavesSum_6 = (tmpvar_11.xz + tmpvar_11.yw);
- bend_5.xz = ((gl_Color.y * 0.1) * gl_Normal).xz;
- bend_5.y = (gl_MultiTexCoord1.y * 0.3);
- pos_4.xyz = (tmpvar_2.xyz + ((
- (vWavesSum_6.xyx * bend_5)
- +
- ((_Wind.xyz * vWavesSum_6.y) * gl_MultiTexCoord1.y)
- ) * _Wind.w));
- pos_4.xyz = (pos_4.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
- vec3 tmpvar_12;
- tmpvar_12.xz = vec2(0.0, 0.0);
- tmpvar_12.y = _SquashPlaneNormal.w;
- vec3 tmpvar_13;
- tmpvar_13 = mix ((pos_4.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_12 - pos_4.xyz))
- * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount));
- vec4 tmpvar_14;
- tmpvar_14.w = 1.0;
- tmpvar_14.xyz = tmpvar_13;
- tmpvar_2 = tmpvar_14;
- vec4 tmpvar_15;
- tmpvar_15.xyz = (gl_Color.w * _Color.xyz);
- tmpvar_15.w = _Color.w;
- vec3 tmpvar_16;
- tmpvar_16 = normalize(gl_Normal);
- tmpvar_3.xyz = normalize(TANGENT.xyz);
- vec4 pos_17;
- pos_17 = (gl_ModelViewProjectionMatrix * tmpvar_14);
- binormal_1 = (((tmpvar_16.yzx * tmpvar_3.zxy) - (tmpvar_16.zxy * tmpvar_3.yzx)) * TANGENT.w);
- mat3 tmpvar_18;
- tmpvar_18[0].x = tmpvar_3.x;
- tmpvar_18[0].y = binormal_1.x;
- tmpvar_18[0].z = tmpvar_16.x;
- tmpvar_18[1].x = tmpvar_3.y;
- tmpvar_18[1].y = binormal_1.y;
- tmpvar_18[1].z = tmpvar_16.y;
- tmpvar_18[2].x = tmpvar_3.z;
- tmpvar_18[2].y = binormal_1.z;
- tmpvar_18[2].z = tmpvar_16.z;
- vec4 tmpvar_19;
- tmpvar_19.w = 1.0;
- tmpvar_19.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_17;
- vec4 tmpvar_20;
- tmpvar_20.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_20.x = pos_17.z;
- xlv_FOG = tmpvar_20;
- vec4 tmpvar_21;
- tmpvar_21.zw = vec2(0.0, 0.0);
- tmpvar_21.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_21;
- gl_FrontColor = tmpvar_15;
- vec4 tmpvar_22;
- tmpvar_22.w = 0.0;
- tmpvar_22.xyz = (tmpvar_18 * (_World2Object * _WorldSpaceLightPos0).xyz);
- gl_TexCoord[1] = tmpvar_22;
- vec4 tmpvar_23;
- tmpvar_23.w = 0.0;
- tmpvar_23.xyz = (tmpvar_18 * ((
- (_World2Object * tmpvar_19)
- .xyz * unity_Scale.w) - tmpvar_13));
- gl_TexCoord[2] = tmpvar_23;
-}
-
-
-// stats: 59 alu 0 tex 0 flow
-// inputs: 6
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Color (high float) 4x1 [-1] loc 3
-// #3: gl_Normal (high float) 3x1 [-1] loc 2
-// #4: gl_Vertex (high float) 4x1 [-1] loc 0
-// #5: TANGENT (high float) 4x1 [-1]
-// uniforms: 13 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _Color (high float) 4x1 [-1]
-// #2: _MainTex_ST (high float) 4x1 [-1]
-// #3: _Object2World (high float) 4x4 [-1]
-// #4: _Scale (high float) 4x1 [-1]
-// #5: _SquashAmount (high float) 1x1 [-1]
-// #6: _SquashPlaneNormal (high float) 4x1 [-1]
-// #7: _TimeX (high float) 1x1 [-1]
-// #8: _Wind (high float) 4x1 [-1]
-// #9: _World2Object (high float) 4x4 [-1]
-// #10: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #11: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #12: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-in.txt
deleted file mode 100644
index 98804e6fe6e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-in.txt
+++ /dev/null
@@ -1,175 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
- vec3 _LightCoord;
-};
-uniform vec4 _Color;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-uniform vec4 unity_Scale;
-vec4 Squash( in vec4 pos );
-vec4 TriangleWave( in vec4 x );
-vec4 SmoothCurve( in vec4 x );
-vec4 SmoothTriangleWave( in vec4 x );
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams );
-void TreeVertBark( inout appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-vec4 TriangleWave( in vec4 x ) {
- return abs( ((fract( (x + 0.500000) ) * 2.00000) - 1.00000) );
-}
-vec4 SmoothCurve( in vec4 x ) {
- return ((x * x) * (3.00000 - (2.00000 * x)));
-}
-vec4 SmoothTriangleWave( in vec4 x ) {
- return SmoothCurve( TriangleWave( x));
-}
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams ) {
- float fDetailAmp = 0.100000;
- float fBranchAmp = 0.300000;
- float fObjPhase;
- float fBranchPhase;
- float fVtxPhase;
- vec2 vWavesIn;
- vec4 vWaves;
- vec2 vWavesSum;
- vec3 bend;
- fObjPhase = dot( _Object2World[ 3 ].xyz , vec3( 1.00000));
- fBranchPhase = (fObjPhase + animParams.x );
- fVtxPhase = dot( pos.xyz , vec3( (animParams.y + fBranchPhase)));
- vWavesIn = (_TimeX + vec2( fVtxPhase, fBranchPhase));
- vWaves = ((fract( (vWavesIn.xxyy * vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000);
- vWaves = SmoothTriangleWave( vWaves);
- vWavesSum = (vWaves.xz + vWaves.yw );
- bend = ((animParams.y * fDetailAmp) * normal.xyz );
- bend.y = (animParams.w * fBranchAmp);
- pos.xyz += (((vWavesSum.xyx * bend) + ((_Wind.xyz * vWavesSum.y ) * animParams.w )) * _Wind.w );
- pos.xyz += (animParams.z * _Wind.xyz );
- return pos;
-}
-void TreeVertBark( inout appdata_full v ) {
- v.vertex.xyz *= _Scale.xyz ;
- v.vertex = AnimateVertex( v.vertex, v.normal, vec4( v.color.xy , v.texcoord1.xy ));
- v.vertex = Squash( v.vertex);
- v.color = vec4( (v.color.w * _Color.xyz ), _Color.w );
- v.normal = normalize( v.normal );
- v.tangent.xyz = normalize( v.tangent.xyz );
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return ((objSpaceLightPos.xyz * unity_Scale.w ) - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- TreeVertBark( v);
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_FrontColor = vec4( xl_retval.lop_color);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-out.txt
deleted file mode 100644
index a11d06d2f41..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Bark_Shader1-out.txt
+++ /dev/null
@@ -1,137 +0,0 @@
-uniform vec4 _Color;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 tmpvar_3;
- tmpvar_2.w = gl_Vertex.w;
- tmpvar_3.w = TANGENT.w;
- tmpvar_2.xyz = (gl_Vertex.xyz * _Scale.xyz);
- vec4 pos_4;
- pos_4.w = tmpvar_2.w;
- vec3 bend_5;
- vec2 vWavesSum_6;
- vec4 vWaves_7;
- float fBranchPhase_8;
- fBranchPhase_8 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
- vec2 tmpvar_9;
- tmpvar_9.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_8)));
- tmpvar_9.y = fBranchPhase_8;
- vWaves_7 = ((fract(
- ((_TimeX + tmpvar_9).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
- ) * 2.0) - 1.0);
- vec4 tmpvar_10;
- tmpvar_10 = abs(((
- fract((vWaves_7 + 0.5))
- * 2.0) - 1.0));
- vec4 tmpvar_11;
- tmpvar_11 = ((tmpvar_10 * tmpvar_10) * (3.0 - (2.0 * tmpvar_10)));
- vWaves_7 = tmpvar_11;
- vWavesSum_6 = (tmpvar_11.xz + tmpvar_11.yw);
- bend_5.xz = ((gl_Color.y * 0.1) * gl_Normal).xz;
- bend_5.y = (gl_MultiTexCoord1.y * 0.3);
- pos_4.xyz = (tmpvar_2.xyz + ((
- (vWavesSum_6.xyx * bend_5)
- +
- ((_Wind.xyz * vWavesSum_6.y) * gl_MultiTexCoord1.y)
- ) * _Wind.w));
- pos_4.xyz = (pos_4.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
- vec3 tmpvar_12;
- tmpvar_12.xz = vec2(0.0, 0.0);
- tmpvar_12.y = _SquashPlaneNormal.w;
- vec3 tmpvar_13;
- tmpvar_13 = mix ((pos_4.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_12 - pos_4.xyz))
- * _SquashPlaneNormal.xyz)), pos_4.xyz, vec3(_SquashAmount));
- vec4 tmpvar_14;
- tmpvar_14.w = 1.0;
- tmpvar_14.xyz = tmpvar_13;
- tmpvar_2 = tmpvar_14;
- vec4 tmpvar_15;
- tmpvar_15.xyz = (gl_Color.w * _Color.xyz);
- tmpvar_15.w = _Color.w;
- vec3 tmpvar_16;
- tmpvar_16 = normalize(gl_Normal);
- tmpvar_3.xyz = normalize(TANGENT.xyz);
- vec4 pos_17;
- pos_17 = (gl_ModelViewProjectionMatrix * tmpvar_14);
- binormal_1 = (((tmpvar_16.yzx * tmpvar_3.zxy) - (tmpvar_16.zxy * tmpvar_3.yzx)) * TANGENT.w);
- mat3 tmpvar_18;
- tmpvar_18[0].x = tmpvar_3.x;
- tmpvar_18[0].y = binormal_1.x;
- tmpvar_18[0].z = tmpvar_16.x;
- tmpvar_18[1].x = tmpvar_3.y;
- tmpvar_18[1].y = binormal_1.y;
- tmpvar_18[1].z = tmpvar_16.y;
- tmpvar_18[2].x = tmpvar_3.z;
- tmpvar_18[2].y = binormal_1.z;
- tmpvar_18[2].z = tmpvar_16.z;
- vec4 tmpvar_19;
- tmpvar_19.w = 1.0;
- tmpvar_19.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_17;
- vec4 tmpvar_20;
- tmpvar_20.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_20.x = pos_17.z;
- xlv_FOG = tmpvar_20;
- vec4 tmpvar_21;
- tmpvar_21.zw = vec2(0.0, 0.0);
- tmpvar_21.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_21;
- gl_FrontColor = tmpvar_15;
- vec4 tmpvar_22;
- tmpvar_22.w = 0.0;
- tmpvar_22.xyz = (tmpvar_18 * ((
- (_World2Object * _WorldSpaceLightPos0)
- .xyz * unity_Scale.w) - tmpvar_13));
- gl_TexCoord[1] = tmpvar_22;
- vec4 tmpvar_23;
- tmpvar_23.w = 0.0;
- tmpvar_23.xyz = (tmpvar_18 * ((
- (_World2Object * tmpvar_19)
- .xyz * unity_Scale.w) - tmpvar_13));
- gl_TexCoord[2] = tmpvar_23;
- vec4 tmpvar_24;
- tmpvar_24.w = 0.0;
- tmpvar_24.xyz = (_LightMatrix0 * (_Object2World * tmpvar_14)).xyz;
- gl_TexCoord[3] = tmpvar_24;
-}
-
-
-// stats: 64 alu 0 tex 0 flow
-// inputs: 6
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Color (high float) 4x1 [-1] loc 3
-// #3: gl_Normal (high float) 3x1 [-1] loc 2
-// #4: gl_Vertex (high float) 4x1 [-1] loc 0
-// #5: TANGENT (high float) 4x1 [-1]
-// uniforms: 14 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _Color (high float) 4x1 [-1]
-// #2: _LightMatrix0 (high float) 4x4 [-1]
-// #3: _MainTex_ST (high float) 4x1 [-1]
-// #4: _Object2World (high float) 4x4 [-1]
-// #5: _Scale (high float) 4x1 [-1]
-// #6: _SquashAmount (high float) 1x1 [-1]
-// #7: _SquashPlaneNormal (high float) 4x1 [-1]
-// #8: _TimeX (high float) 1x1 [-1]
-// #9: _Wind (high float) 4x1 [-1]
-// #10: _World2Object (high float) 4x4 [-1]
-// #11: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #12: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #13: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-in.txt
deleted file mode 100644
index 886c919c50e..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-in.txt
+++ /dev/null
@@ -1,189 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- float fog;
- vec2 hip_pack0;
- vec4 lop_color;
- vec3 lightDir;
- vec3 viewDir;
- vec3 _LightCoord;
-};
-uniform vec4 _Color;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-
-
-uniform vec4 unity_Scale;
-vec4 Squash( in vec4 pos );
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent );
-vec4 TriangleWave( in vec4 x );
-vec4 SmoothCurve( in vec4 x );
-vec4 SmoothTriangleWave( in vec4 x );
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams );
-void TreeVertLeaf( inout appdata_full v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-vec3 ObjSpaceViewDir( in vec4 v );
-vec3 ObjSpaceLightDir( in vec4 v );
-v2f_surf vert_surf( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent ) {
- float isBillboard;
- vec3 norb;
- vec3 tanb;
- isBillboard = (1.00000 - abs( tangent.w ));
- norb = vec3( normalize( ( vec4( normal, 0.000000) * mat ) ));
- tanb = vec3( normalize( ( vec4( normal.z , 0.000000, ( -normal.x ), 0.000000) * mat ) ));
- pos += (( tangent * mat ) * isBillboard);
- normal = mix( normal, norb, vec3( isBillboard));
- tangent = mix( tangent, vec4( tanb, -1.00000), vec4( isBillboard));
-}
-vec4 TriangleWave( in vec4 x ) {
- return abs( ((fract( (x + 0.500000) ) * 2.00000) - 1.00000) );
-}
-vec4 SmoothCurve( in vec4 x ) {
- return ((x * x) * (3.00000 - (2.00000 * x)));
-}
-vec4 SmoothTriangleWave( in vec4 x ) {
- return SmoothCurve( TriangleWave( x));
-}
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams ) {
- float fDetailAmp = 0.100000;
- float fBranchAmp = 0.300000;
- float fObjPhase;
- float fBranchPhase;
- float fVtxPhase;
- vec2 vWavesIn;
- vec4 vWaves;
- vec2 vWavesSum;
- vec3 bend;
- fObjPhase = dot( _Object2World[ 3 ].xyz , vec3( 1.00000));
- fBranchPhase = (fObjPhase + animParams.x );
- fVtxPhase = dot( pos.xyz , vec3( (animParams.y + fBranchPhase)));
- vWavesIn = (_TimeX + vec2( fVtxPhase, fBranchPhase));
- vWaves = ((fract( (vWavesIn.xxyy * vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000);
- vWaves = SmoothTriangleWave( vWaves);
- vWavesSum = (vWaves.xz + vWaves.yw );
- bend = ((animParams.y * fDetailAmp) * normal.xyz );
- bend.y = (animParams.w * fBranchAmp);
- pos.xyz += (((vWavesSum.xyx * bend) + ((_Wind.xyz * vWavesSum.y ) * animParams.w )) * _Wind.w );
- pos.xyz += (animParams.z * _Wind.xyz );
- return pos;
-}
-void TreeVertLeaf( inout appdata_full v ) {
- ExpandBillboard( gl_ModelViewMatrixInverseTranspose, v.vertex, v.normal, v.tangent);
- v.vertex.xyz *= _Scale.xyz ;
- v.vertex = AnimateVertex( v.vertex, v.normal, vec4( v.color.xy , v.texcoord1.xy ));
- v.vertex = Squash( v.vertex);
- v.color = vec4( (v.color.w * _Color.xyz ), _Color.w );
- v.normal = normalize( v.normal );
- v.tangent.xyz = normalize( v.tangent.xyz );
-}
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-vec3 ObjSpaceViewDir( in vec4 v ) {
- vec3 objSpaceCameraPos;
- objSpaceCameraPos = (( _World2Object * vec4( _WorldSpaceCameraPos.xyz , 1.00000) ).xyz * unity_Scale.w );
- return (objSpaceCameraPos - v.xyz );
-}
-vec3 ObjSpaceLightDir( in vec4 v ) {
- vec3 objSpaceLightPos;
- objSpaceLightPos = ( _World2Object * _WorldSpaceLightPos0 ).xyz ;
- return ((objSpaceLightPos.xyz * unity_Scale.w ) - v.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- vec3 binormal;
- mat3 rotation;
- TreeVertLeaf( v);
- PositionFog( v.vertex, o.pos, o.fog);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- binormal = (cross( v.normal, v.tangent.xyz ) * v.tangent.w );
- rotation = mat3( v.tangent.x , binormal.x , v.normal.x , v.tangent.y , binormal.y , v.normal.y , v.tangent.z , binormal.z , v.normal.z );
- o.lightDir = ( rotation * ObjSpaceLightDir( v.vertex) );
- o.viewDir = ( rotation * ObjSpaceViewDir( v.vertex) );
- o._LightCoord = ( _LightMatrix0 * ( _Object2World * v.vertex ) ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_TexCoord[0] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_FrontColor = vec4( xl_retval.lop_color);
- gl_TexCoord[1] = vec4( xl_retval.lightDir, 0.0);
- gl_TexCoord[2] = vec4( xl_retval.viewDir, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._LightCoord, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-out.txt
deleted file mode 100644
index 1dbc26587e3..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader-out.txt
+++ /dev/null
@@ -1,156 +0,0 @@
-uniform vec4 _Color;
-uniform mat4 _LightMatrix0;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Object;
-uniform vec3 _WorldSpaceCameraPos;
-uniform vec4 _WorldSpaceLightPos0;
-uniform vec4 unity_Scale;
-attribute vec4 TANGENT;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec3 binormal_1;
- vec4 tmpvar_2;
- vec4 tmpvar_3;
- vec4 pos_4;
- float isBillboard_5;
- isBillboard_5 = (1.0 - abs(TANGENT.w));
- vec4 tmpvar_6;
- tmpvar_6.w = 0.0;
- tmpvar_6.xyz = gl_Normal;
- vec4 tmpvar_7;
- tmpvar_7.yw = vec2(0.0, 0.0);
- tmpvar_7.x = gl_Normal.z;
- tmpvar_7.z = -(gl_Normal.x);
- pos_4 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * isBillboard_5));
- vec3 tmpvar_8;
- tmpvar_8 = mix (gl_Normal, normalize((tmpvar_6 * gl_ModelViewMatrixInverseTranspose)).xyz, vec3(isBillboard_5));
- vec4 tmpvar_9;
- tmpvar_9.w = -1.0;
- tmpvar_9.xyz = normalize((tmpvar_7 * gl_ModelViewMatrixInverseTranspose)).xyz;
- vec4 tmpvar_10;
- tmpvar_10 = mix (TANGENT, tmpvar_9, vec4(isBillboard_5));
- tmpvar_2.w = pos_4.w;
- tmpvar_3.w = tmpvar_10.w;
- tmpvar_2.xyz = (pos_4.xyz * _Scale.xyz);
- vec4 pos_11;
- pos_11.w = tmpvar_2.w;
- vec3 bend_12;
- vec2 vWavesSum_13;
- vec4 vWaves_14;
- float fBranchPhase_15;
- fBranchPhase_15 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
- vec2 tmpvar_16;
- tmpvar_16.x = dot (tmpvar_2.xyz, vec3((gl_Color.y + fBranchPhase_15)));
- tmpvar_16.y = fBranchPhase_15;
- vWaves_14 = ((fract(
- ((_TimeX + tmpvar_16).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
- ) * 2.0) - 1.0);
- vec4 tmpvar_17;
- tmpvar_17 = abs(((
- fract((vWaves_14 + 0.5))
- * 2.0) - 1.0));
- vec4 tmpvar_18;
- tmpvar_18 = ((tmpvar_17 * tmpvar_17) * (3.0 - (2.0 * tmpvar_17)));
- vWaves_14 = tmpvar_18;
- vWavesSum_13 = (tmpvar_18.xz + tmpvar_18.yw);
- bend_12.xz = ((gl_Color.y * 0.1) * tmpvar_8).xz;
- bend_12.y = (gl_MultiTexCoord1.y * 0.3);
- pos_11.xyz = (tmpvar_2.xyz + ((
- (vWavesSum_13.xyx * bend_12)
- +
- ((_Wind.xyz * vWavesSum_13.y) * gl_MultiTexCoord1.y)
- ) * _Wind.w));
- pos_11.xyz = (pos_11.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
- vec3 tmpvar_19;
- tmpvar_19.xz = vec2(0.0, 0.0);
- tmpvar_19.y = _SquashPlaneNormal.w;
- vec3 tmpvar_20;
- tmpvar_20 = mix ((pos_11.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_19 - pos_11.xyz))
- * _SquashPlaneNormal.xyz)), pos_11.xyz, vec3(_SquashAmount));
- vec4 tmpvar_21;
- tmpvar_21.w = 1.0;
- tmpvar_21.xyz = tmpvar_20;
- tmpvar_2 = tmpvar_21;
- vec4 tmpvar_22;
- tmpvar_22.xyz = (gl_Color.w * _Color.xyz);
- tmpvar_22.w = _Color.w;
- vec3 tmpvar_23;
- tmpvar_23 = normalize(tmpvar_8);
- tmpvar_3.xyz = normalize(tmpvar_10.xyz);
- vec4 pos_24;
- pos_24 = (gl_ModelViewProjectionMatrix * tmpvar_21);
- binormal_1 = (((tmpvar_23.yzx * tmpvar_3.zxy) - (tmpvar_23.zxy * tmpvar_3.yzx)) * tmpvar_10.w);
- mat3 tmpvar_25;
- tmpvar_25[0].x = tmpvar_3.x;
- tmpvar_25[0].y = binormal_1.x;
- tmpvar_25[0].z = tmpvar_23.x;
- tmpvar_25[1].x = tmpvar_3.y;
- tmpvar_25[1].y = binormal_1.y;
- tmpvar_25[1].z = tmpvar_23.y;
- tmpvar_25[2].x = tmpvar_3.z;
- tmpvar_25[2].y = binormal_1.z;
- tmpvar_25[2].z = tmpvar_23.z;
- vec4 tmpvar_26;
- tmpvar_26.w = 1.0;
- tmpvar_26.xyz = _WorldSpaceCameraPos;
- gl_Position = pos_24;
- vec4 tmpvar_27;
- tmpvar_27.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_27.x = pos_24.z;
- xlv_FOG = tmpvar_27;
- vec4 tmpvar_28;
- tmpvar_28.zw = vec2(0.0, 0.0);
- tmpvar_28.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_28;
- gl_FrontColor = tmpvar_22;
- vec4 tmpvar_29;
- tmpvar_29.w = 0.0;
- tmpvar_29.xyz = (tmpvar_25 * ((
- (_World2Object * _WorldSpaceLightPos0)
- .xyz * unity_Scale.w) - tmpvar_20));
- gl_TexCoord[1] = tmpvar_29;
- vec4 tmpvar_30;
- tmpvar_30.w = 0.0;
- tmpvar_30.xyz = (tmpvar_25 * ((
- (_World2Object * tmpvar_26)
- .xyz * unity_Scale.w) - tmpvar_20));
- gl_TexCoord[2] = tmpvar_30;
- vec4 tmpvar_31;
- tmpvar_31.w = 0.0;
- tmpvar_31.xyz = (_LightMatrix0 * (_Object2World * tmpvar_21)).xyz;
- gl_TexCoord[3] = tmpvar_31;
-}
-
-
-// stats: 79 alu 0 tex 0 flow
-// inputs: 6
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Color (high float) 4x1 [-1] loc 3
-// #3: gl_Normal (high float) 3x1 [-1] loc 2
-// #4: gl_Vertex (high float) 4x1 [-1] loc 0
-// #5: TANGENT (high float) 4x1 [-1]
-// uniforms: 15 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: _Color (high float) 4x1 [-1]
-// #3: _LightMatrix0 (high float) 4x4 [-1]
-// #4: _MainTex_ST (high float) 4x1 [-1]
-// #5: _Object2World (high float) 4x4 [-1]
-// #6: _Scale (high float) 4x1 [-1]
-// #7: _SquashAmount (high float) 1x1 [-1]
-// #8: _SquashPlaneNormal (high float) 4x1 [-1]
-// #9: _TimeX (high float) 1x1 [-1]
-// #10: _Wind (high float) 4x1 [-1]
-// #11: _World2Object (high float) 4x4 [-1]
-// #12: _WorldSpaceCameraPos (high float) 3x1 [-1]
-// #13: _WorldSpaceLightPos0 (high float) 4x1 [-1]
-// #14: unity_Scale (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-in.txt
deleted file mode 100644
index 6ecde6ff5a8..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-in.txt
+++ /dev/null
@@ -1,177 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct SurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct appdata_full {
- vec4 vertex;
- vec4 tangent;
- vec3 normal;
- vec4 texcoord;
- vec4 texcoord1;
- vec4 color;
-};
-struct LeafSurfaceOutput {
- vec3 Albedo;
- vec3 Normal;
- vec3 Emission;
- vec3 Translucency;
- float Specular;
- float Gloss;
- float Alpha;
-};
-struct Input {
- vec2 uv_MainTex;
- vec4 color;
-};
-struct v2f_surf {
- vec4 pos;
- vec3 _ShadowCoord0;
- vec3 _ShadowCoord1;
- vec3 _ShadowCoord2;
- vec3 _ShadowCoord3;
- vec2 _ShadowZFade;
- vec2 hip_pack0;
- vec4 lop_color;
-};
-uniform vec4 _Color;
-uniform vec4 _LightShadowData;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Shadow;
-uniform mat4 _World2Shadow1;
-uniform mat4 _World2Shadow2;
-uniform mat4 _World2Shadow3;
-
-
-
-vec4 Squash( in vec4 pos );
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent );
-vec4 TriangleWave( in vec4 x );
-vec4 SmoothCurve( in vec4 x );
-vec4 SmoothTriangleWave( in vec4 x );
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams );
-void TreeVertLeaf( inout appdata_full v );
-v2f_surf vert_surf( in appdata_full v );
-vec4 Squash( in vec4 pos ) {
- vec3 projectedVertex;
- vec3 planePoint;
- vec3 planeNormal;
- projectedVertex = pos.xyz ;
- planePoint = vec3( 0.000000, _SquashPlaneNormal.w , 0.000000);
- planeNormal = _SquashPlaneNormal.xyz ;
- projectedVertex += (dot( planeNormal, (planePoint - vec3( pos))) * planeNormal);
- pos = vec4( mix( projectedVertex, pos.xyz , vec3( _SquashAmount)), 1.00000);
- return pos;
-}
-void ExpandBillboard( in mat4 mat, inout vec4 pos, inout vec3 normal, inout vec4 tangent ) {
- float isBillboard;
- vec3 norb;
- vec3 tanb;
- isBillboard = (1.00000 - abs( tangent.w ));
- norb = vec3( normalize( ( vec4( normal, 0.000000) * mat ) ));
- tanb = vec3( normalize( ( vec4( normal.z , 0.000000, ( -normal.x ), 0.000000) * mat ) ));
- pos += (( tangent * mat ) * isBillboard);
- normal = mix( normal, norb, vec3( isBillboard));
- tangent = mix( tangent, vec4( tanb, -1.00000), vec4( isBillboard));
-}
-vec4 TriangleWave( in vec4 x ) {
- return abs( ((fract( (x + 0.500000) ) * 2.00000) - 1.00000) );
-}
-vec4 SmoothCurve( in vec4 x ) {
- return ((x * x) * (3.00000 - (2.00000 * x)));
-}
-vec4 SmoothTriangleWave( in vec4 x ) {
- return SmoothCurve( TriangleWave( x));
-}
-vec4 AnimateVertex( in vec4 pos, in vec3 normal, in vec4 animParams ) {
- float fDetailAmp = 0.100000;
- float fBranchAmp = 0.300000;
- float fObjPhase;
- float fBranchPhase;
- float fVtxPhase;
- vec2 vWavesIn;
- vec4 vWaves;
- vec2 vWavesSum;
- vec3 bend;
- fObjPhase = dot( _Object2World[ 3 ].xyz , vec3( 1.00000));
- fBranchPhase = (fObjPhase + animParams.x );
- fVtxPhase = dot( pos.xyz , vec3( (animParams.y + fBranchPhase)));
- vWavesIn = (_TimeX + vec2( fVtxPhase, fBranchPhase));
- vWaves = ((fract( (vWavesIn.xxyy * vec4( 1.97500, 0.793000, 0.375000, 0.193000)) ) * 2.00000) - 1.00000);
- vWaves = SmoothTriangleWave( vWaves);
- vWavesSum = (vWaves.xz + vWaves.yw );
- bend = ((animParams.y * fDetailAmp) * normal.xyz );
- bend.y = (animParams.w * fBranchAmp);
- pos.xyz += (((vWavesSum.xyx * bend) + ((_Wind.xyz * vWavesSum.y ) * animParams.w )) * _Wind.w );
- pos.xyz += (animParams.z * _Wind.xyz );
- return pos;
-}
-void TreeVertLeaf( inout appdata_full v ) {
- ExpandBillboard( gl_ModelViewMatrixInverseTranspose, v.vertex, v.normal, v.tangent);
- v.vertex.xyz *= _Scale.xyz ;
- v.vertex = AnimateVertex( v.vertex, v.normal, vec4( v.color.xy , v.texcoord1.xy ));
- v.vertex = Squash( v.vertex);
- v.color = vec4( (v.color.w * _Color.xyz ), _Color.w );
- v.normal = normalize( v.normal );
- v.tangent.xyz = normalize( v.tangent.xyz );
-}
-v2f_surf vert_surf( in appdata_full v ) {
- v2f_surf o;
- float z;
- vec4 wpos;
- TreeVertLeaf( v);
- o.hip_pack0.xy = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- o.lop_color = v.color;
- o.pos = ( gl_ModelViewProjectionMatrix * v.vertex );
- z = ( -( gl_ModelViewMatrix * v.vertex ).z );
- o._ShadowZFade.x = z;
- o._ShadowZFade.y = ((z * _LightShadowData.z ) + _LightShadowData.w );
- wpos = ( _Object2World * v.vertex );
- o._ShadowCoord0 = ( _World2Shadow * wpos ).xyz ;
- o._ShadowCoord1 = ( _World2Shadow1 * wpos ).xyz ;
- o._ShadowCoord2 = ( _World2Shadow2 * wpos ).xyz ;
- o._ShadowCoord3 = ( _World2Shadow3 * wpos ).xyz ;
- return o;
-}
-attribute vec4 TANGENT;
-void main() {
- v2f_surf xl_retval;
- appdata_full xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.tangent = vec4( TANGENT);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec4( gl_MultiTexCoord0);
- xlt_v.texcoord1 = vec4( gl_MultiTexCoord1);
- xlt_v.color = vec4( gl_Color);
- xl_retval = vert_surf( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- gl_TexCoord[0] = vec4( xl_retval._ShadowCoord0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval._ShadowCoord1, 0.0);
- gl_TexCoord[2] = vec4( xl_retval._ShadowCoord2, 0.0);
- gl_TexCoord[3] = vec4( xl_retval._ShadowCoord3, 0.0);
- gl_TexCoord[4] = vec4( xl_retval._ShadowZFade, 0.0, 0.0);
- gl_TexCoord[5] = vec4( xl_retval.hip_pack0, 0.0, 0.0);
- gl_FrontColor = vec4( xl_retval.lop_color);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-out.txt
deleted file mode 100644
index 34654108366..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Tree_Editor_Leaf_Shader1-out.txt
+++ /dev/null
@@ -1,130 +0,0 @@
-uniform vec4 _Color;
-uniform vec4 _LightShadowData;
-uniform vec4 _MainTex_ST;
-uniform mat4 _Object2World;
-uniform vec4 _Scale;
-uniform float _SquashAmount;
-uniform vec4 _SquashPlaneNormal;
-uniform float _TimeX;
-uniform vec4 _Wind;
-uniform mat4 _World2Shadow;
-uniform mat4 _World2Shadow1;
-uniform mat4 _World2Shadow2;
-uniform mat4 _World2Shadow3;
-attribute vec4 TANGENT;
-void main ()
-{
- vec4 wpos_1;
- float z_2;
- vec2 tmpvar_3;
- vec4 tmpvar_4;
- vec4 pos_5;
- float isBillboard_6;
- isBillboard_6 = (1.0 - abs(TANGENT.w));
- vec4 tmpvar_7;
- tmpvar_7.w = 0.0;
- tmpvar_7.xyz = gl_Normal;
- pos_5 = (gl_Vertex + ((TANGENT * gl_ModelViewMatrixInverseTranspose) * isBillboard_6));
- tmpvar_4.w = pos_5.w;
- tmpvar_4.xyz = (pos_5.xyz * _Scale.xyz);
- vec4 pos_8;
- pos_8.w = tmpvar_4.w;
- vec3 bend_9;
- vec2 vWavesSum_10;
- vec4 vWaves_11;
- float fBranchPhase_12;
- fBranchPhase_12 = (dot (_Object2World[3].xyz, vec3(1.0, 1.0, 1.0)) + gl_Color.x);
- vec2 tmpvar_13;
- tmpvar_13.x = dot (tmpvar_4.xyz, vec3((gl_Color.y + fBranchPhase_12)));
- tmpvar_13.y = fBranchPhase_12;
- vWaves_11 = ((fract(
- ((_TimeX + tmpvar_13).xxyy * vec4(1.975, 0.793, 0.375, 0.193))
- ) * 2.0) - 1.0);
- vec4 tmpvar_14;
- tmpvar_14 = abs(((
- fract((vWaves_11 + 0.5))
- * 2.0) - 1.0));
- vec4 tmpvar_15;
- tmpvar_15 = ((tmpvar_14 * tmpvar_14) * (3.0 - (2.0 * tmpvar_14)));
- vWaves_11 = tmpvar_15;
- vWavesSum_10 = (tmpvar_15.xz + tmpvar_15.yw);
- bend_9.xz = ((gl_Color.y * 0.1) * mix (gl_Normal, normalize(
- (tmpvar_7 * gl_ModelViewMatrixInverseTranspose)
- ).xyz, vec3(isBillboard_6))).xz;
- bend_9.y = (gl_MultiTexCoord1.y * 0.3);
- pos_8.xyz = (tmpvar_4.xyz + ((
- (vWavesSum_10.xyx * bend_9)
- +
- ((_Wind.xyz * vWavesSum_10.y) * gl_MultiTexCoord1.y)
- ) * _Wind.w));
- pos_8.xyz = (pos_8.xyz + (gl_MultiTexCoord1.x * _Wind.xyz));
- vec3 tmpvar_16;
- tmpvar_16.xz = vec2(0.0, 0.0);
- tmpvar_16.y = _SquashPlaneNormal.w;
- vec4 tmpvar_17;
- tmpvar_17.w = 1.0;
- tmpvar_17.xyz = mix ((pos_8.xyz + (
- dot (_SquashPlaneNormal.xyz, (tmpvar_16 - pos_8.xyz))
- * _SquashPlaneNormal.xyz)), pos_8.xyz, vec3(_SquashAmount));
- tmpvar_4 = tmpvar_17;
- vec4 tmpvar_18;
- tmpvar_18.xyz = (gl_Color.w * _Color.xyz);
- tmpvar_18.w = _Color.w;
- z_2 = -((gl_ModelViewMatrix * tmpvar_17).z);
- tmpvar_3.x = z_2;
- tmpvar_3.y = ((z_2 * _LightShadowData.z) + _LightShadowData.w);
- wpos_1 = (_Object2World * tmpvar_17);
- gl_Position = (gl_ModelViewProjectionMatrix * tmpvar_17);
- vec4 tmpvar_19;
- tmpvar_19.w = 0.0;
- tmpvar_19.xyz = (_World2Shadow * wpos_1).xyz;
- gl_TexCoord[0] = tmpvar_19;
- vec4 tmpvar_20;
- tmpvar_20.w = 0.0;
- tmpvar_20.xyz = (_World2Shadow1 * wpos_1).xyz;
- gl_TexCoord[1] = tmpvar_20;
- vec4 tmpvar_21;
- tmpvar_21.w = 0.0;
- tmpvar_21.xyz = (_World2Shadow2 * wpos_1).xyz;
- gl_TexCoord[2] = tmpvar_21;
- vec4 tmpvar_22;
- tmpvar_22.w = 0.0;
- tmpvar_22.xyz = (_World2Shadow3 * wpos_1).xyz;
- gl_TexCoord[3] = tmpvar_22;
- vec4 tmpvar_23;
- tmpvar_23.zw = vec2(0.0, 0.0);
- tmpvar_23.xy = tmpvar_3;
- gl_TexCoord[4] = tmpvar_23;
- vec4 tmpvar_24;
- tmpvar_24.zw = vec2(0.0, 0.0);
- tmpvar_24.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[5] = tmpvar_24;
- gl_FrontColor = tmpvar_18;
-}
-
-
-// stats: 66 alu 0 tex 0 flow
-// inputs: 6
-// #0: gl_MultiTexCoord1 (high float) 4x1 [-1] loc 9
-// #1: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #2: gl_Color (high float) 4x1 [-1] loc 3
-// #3: gl_Normal (high float) 3x1 [-1] loc 2
-// #4: gl_Vertex (high float) 4x1 [-1] loc 0
-// #5: TANGENT (high float) 4x1 [-1]
-// uniforms: 16 (total size: 0)
-// #0: gl_ModelViewMatrixInverseTranspose (high float) 4x4 [-1]
-// #1: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #2: gl_ModelViewMatrix (high float) 4x4 [-1]
-// #3: _Color (high float) 4x1 [-1]
-// #4: _LightShadowData (high float) 4x1 [-1]
-// #5: _MainTex_ST (high float) 4x1 [-1]
-// #6: _Object2World (high float) 4x4 [-1]
-// #7: _Scale (high float) 4x1 [-1]
-// #8: _SquashAmount (high float) 1x1 [-1]
-// #9: _SquashPlaneNormal (high float) 4x1 [-1]
-// #10: _TimeX (high float) 1x1 [-1]
-// #11: _Wind (high float) 4x1 [-1]
-// #12: _World2Shadow (high float) 4x4 [-1]
-// #13: _World2Shadow1 (high float) 4x4 [-1]
-// #14: _World2Shadow2 (high float) 4x4 [-1]
-// #15: _World2Shadow3 (high float) 4x4 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-in.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-in.txt
deleted file mode 100644
index b97a820e781..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-in.txt
+++ /dev/null
@@ -1,57 +0,0 @@
-struct v2f_vertex_lit {
- vec2 uv;
- vec4 diff;
- vec4 spec;
-};
-struct v2f_img {
- vec4 pos;
- vec2 uv;
-};
-struct appdata_img {
- vec4 vertex;
- vec2 texcoord;
-};
-struct v2f {
- vec4 pos;
- float fog;
- vec4 color;
- vec2 texcoord;
- vec3 normal;
-};
-struct appdata_t {
- vec4 vertex;
- vec4 color;
- vec3 normal;
- vec2 texcoord;
-};
-uniform vec4 _MainTex_ST;
-
-void PositionFog( in vec4 v, out vec4 pos, out float fog );
-v2f vert( in appdata_t v );
-void PositionFog( in vec4 v, out vec4 pos, out float fog ) {
- pos = ( gl_ModelViewProjectionMatrix * v );
- fog = pos.z ;
-}
-v2f vert( in appdata_t v ) {
- v2f o;
- PositionFog( v.vertex, o.pos, o.fog);
- o.color = v.color;
- o.normal = v.normal;
- o.texcoord = ((v.texcoord.xy * _MainTex_ST.xy ) + _MainTex_ST.zw );
- return o;
-}
-varying vec4 xlv_FOG;
-void main() {
- v2f xl_retval;
- appdata_t xlt_v;
- xlt_v.vertex = vec4( gl_Vertex);
- xlt_v.color = vec4( gl_Color);
- xlt_v.normal = vec3( gl_Normal);
- xlt_v.texcoord = vec2( gl_MultiTexCoord0);
- xl_retval = vert( xlt_v);
- gl_Position = vec4( xl_retval.pos);
- xlv_FOG = vec4( xl_retval.fog, 0.0, 0.0, 0.0);
- gl_FrontColor = vec4( xl_retval.color);
- gl_TexCoord[0] = vec4( xl_retval.texcoord, 0.0, 0.0);
- gl_TexCoord[1] = vec4( xl_retval.normal, 0.0);
-}
diff --git a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-out.txt b/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-out.txt
deleted file mode 100644
index 94e58e60e1c..00000000000
--- a/3rdparty/bgfx/3rdparty/glsl-optimizer/tests/vertex/zun-Vertex_Colored-out.txt
+++ /dev/null
@@ -1,32 +0,0 @@
-uniform vec4 _MainTex_ST;
-varying vec4 xlv_FOG;
-void main ()
-{
- vec4 pos_1;
- pos_1 = (gl_ModelViewProjectionMatrix * gl_Vertex);
- gl_Position = pos_1;
- vec4 tmpvar_2;
- tmpvar_2.yzw = vec3(0.0, 0.0, 0.0);
- tmpvar_2.x = pos_1.z;
- xlv_FOG = tmpvar_2;
- gl_FrontColor = gl_Color;
- vec4 tmpvar_3;
- tmpvar_3.zw = vec2(0.0, 0.0);
- tmpvar_3.xy = ((gl_MultiTexCoord0.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
- gl_TexCoord[0] = tmpvar_3;
- vec4 tmpvar_4;
- tmpvar_4.w = 0.0;
- tmpvar_4.xyz = gl_Normal;
- gl_TexCoord[1] = tmpvar_4;
-}
-
-
-// stats: 6 alu 0 tex 0 flow
-// inputs: 4
-// #0: gl_MultiTexCoord0 (high float) 4x1 [-1] loc 8
-// #1: gl_Color (high float) 4x1 [-1] loc 3
-// #2: gl_Normal (high float) 3x1 [-1] loc 2
-// #3: gl_Vertex (high float) 4x1 [-1] loc 0
-// uniforms: 2 (total size: 0)
-// #0: gl_ModelViewProjectionMatrix (high float) 4x4 [-1]
-// #1: _MainTex_ST (high float) 4x1 [-1]
diff --git a/3rdparty/bgfx/3rdparty/glslang/CHANGES.md b/3rdparty/bgfx/3rdparty/glslang/CHANGES.md
deleted file mode 100644
index ad4fa400856..00000000000
--- a/3rdparty/bgfx/3rdparty/glslang/CHANGES.md
+++ /dev/null
@@ -1,84 +0,0 @@
-# Revision history for `glslang`
-
-All notable changes to this project will be documented in this file.
-This project adheres to [Semantic Versioning](https://semver.org/).
-
-## 11.6.0 2021-08-25
-
-### Other changes
-* Atomic memory function only for shader storage block member or shared variable
-* Add support for gl_MaxVaryingVectors for ogl
-* Fix loading bool arrays from interface blocks
-* Generate separate stores for partially swizzled memory stores
-* Allow layout(std430) uniform with GL_EXT_scalar_block_layout
-* Support for pragma STDGL invariant(all)
-* Support for GL_NV_ray_tracing_motion_blur
-
-## 11.5.0 2021-06-23
-
-### Other changes
-* Implement GLSL_EXT_shader_atomic_float2
-* Implement GL_EXT_spirv_intrinsics
-* Fixed SPIR-V remapper not remapping OpExtInst instruction set IDs
-* only declare compatibility gl_ variables in compatibility mode
-* Add support for float spec const vector initialization
-* Implement GL_EXT_subgroup_uniform_control_flow.
-* Fix arrays dimensioned with spec constant sized gl_WorkGroupSize
-* Add support for 64bit integer scalar and vector types to bitCount() builtin
-
-## 11.4.0 2021-04-22
-
-### Other changes
-* Fix to keep source compatible with CMake 3.10.2
-
-## 11.3.0 2021-04-21
-
-### Other changes
-* Added --depfile
-* Added --auto-sampled-textures
-* Now supports InterpolateAt-based functions
-* Supports cross-stage automatic IO mapping
-* Supports GL_EXT_vulkan_glsl_relaxed (-R option)
-
-## 11.2.0 2021-02-18
-
-### Other changes
-* Removed Python requirement when not building with spirv-tools
-* Add support for GL_EXT_shared_memory_block
-* Implement GL_EXT_null_initializer
-* Add CMake support for Fuschia
-
-## 11.1.0 2020-12-07
-
-### Other changes
-* Added ray-tracing extension support
-
-## 11.0.0 2020-07-20
-
-### Breaking changes
-
-#### Visual Studio 2013 is no longer supported
-
-[As scheduled](https://github.com/KhronosGroup/glslang/blob/9eef54b2513ca6b40b47b07d24f453848b65c0df/README.md#planned-deprecationsremovals),
-Microsoft Visual Studio 2013 is no longer officially supported. Please upgrade
-to at least Visual Studio 2015.
-
-## 10.15.3847 2020-07-20
-
-### Breaking changes
-
-* The following files have been removed:
- * `glslang/include/revision.h`
- * `glslang/include/revision.template`
-
-The `GLSLANG_MINOR_VERSION` and `GLSLANG_PATCH_LEVEL` defines have been removed
-from the public headers. \
-Instead each build script now uses the new `build_info.py`
-script along with the `build_info.h.tmpl` and this `CHANGES.md` file to generate
-the glslang build-time generated header `glslang/build_info.h`.
-
-The new public API to obtain the `glslang` version is `glslang::GetVersion()`.
-
-### Other changes
-* `glslang` shared objects produced by CMake are now `SONAME` versioned using
- [Semantic Versioning 2.0.0](https://semver.org/).
diff --git a/3rdparty/bgfx/3rdparty/glslang/LICENSE.txt b/3rdparty/bgfx/3rdparty/glslang/LICENSE.txt
index 5f58565dc45..054e68a4614 100644
--- a/3rdparty/bgfx/3rdparty/glslang/LICENSE.txt
+++ b/3rdparty/bgfx/3rdparty/glslang/LICENSE.txt
@@ -303,41 +303,647 @@ APACHE LICENSE, VERSION 2.0
GPL 3 with special bison exception
--------------------------------------------------------------------------------
- Bison implementation for Yacc-like parsers in C
-
- Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-
- As a special exception, you may create a larger work that contains
- part or all of the Bison parser skeleton and distribute that work
- under terms of your choice, so long as that work isn't itself a
- parser generator using the skeleton or a modified version thereof
- as a parser skeleton. Alternatively, if you modify or redistribute
- the parser skeleton itself, you may (at your option) remove this
- special exception, which will cause the skeleton and the resulting
- Bison output files to be licensed under the GNU General Public
- License without this special exception.
-
- This special exception was added by the Free Software Foundation in
- version 2.2 of Bison.
+ GNU GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The GNU General Public License is a free, copyleft license for
+software and other kinds of works.
+
+ The licenses for most software and other practical works are designed
+to take away your freedom to share and change the works. By contrast,
+the GNU General Public License is intended to guarantee your freedom to
+share and change all versions of a program--to make sure it remains free
+software for all its users. We, the Free Software Foundation, use the
+GNU General Public License for most of our software; it applies also to
+any other work released this way by its authors. You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+them if you wish), that you receive source code or can get it if you
+want it, that you can change the software or use pieces of it in new
+free programs, and that you know you can do these things.
+
+ To protect your rights, we need to prevent others from denying you
+these rights or asking you to surrender the rights. Therefore, you have
+certain responsibilities if you distribute copies of the software, or if
+you modify it: responsibilities to respect the freedom of others.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must pass on to the recipients the same
+freedoms that you received. You must make sure that they, too, receive
+or can get the source code. And you must show them these terms so they
+know their rights.
+
+ Developers that use the GNU GPL protect your rights with two steps:
+(1) assert copyright on the software, and (2) offer you this License
+giving you legal permission to copy, distribute and/or modify it.
+
+ For the developers' and authors' protection, the GPL clearly explains
+that there is no warranty for this free software. For both users' and
+authors' sake, the GPL requires that modified versions be marked as
+changed, so that their problems will not be attributed erroneously to
+authors of previous versions.
+
+ Some devices are designed to deny users access to install or run
+modified versions of the software inside them, although the manufacturer
+can do so. This is fundamentally incompatible with the aim of
+protecting users' freedom to change the software. The systematic
+pattern of such abuse occurs in the area of products for individuals to
+use, which is precisely where it is most unacceptable. Therefore, we
+have designed this version of the GPL to prohibit the practice for those
+products. If such problems arise substantially in other domains, we
+stand ready to extend this provision to those domains in future versions
+of the GPL, as needed to protect the freedom of users.
+
+ Finally, every program is threatened constantly by software patents.
+States should not allow patents to restrict development and use of
+software on general-purpose computers, but in those that do, we wish to
+avoid the special danger that patents applied to a free program could
+make it effectively proprietary. To prevent this, the GPL assures that
+patents cannot be used to render the program non-free.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ TERMS AND CONDITIONS
+
+ 0. Definitions.
+
+ "This License" refers to version 3 of the GNU General Public License.
+
+ "Copyright" also means copyright-like laws that apply to other kinds of
+works, such as semiconductor masks.
+
+ "The Program" refers to any copyrightable work licensed under this
+License. Each licensee is addressed as "you". "Licensees" and
+"recipients" may be individuals or organizations.
+
+ To "modify" a work means to copy from or adapt all or part of the work
+in a fashion requiring copyright permission, other than the making of an
+exact copy. The resulting work is called a "modified version" of the
+earlier work or a work "based on" the earlier work.
+
+ A "covered work" means either the unmodified Program or a work based
+on the Program.
+
+ To "propagate" a work means to do anything with it that, without
+permission, would make you directly or secondarily liable for
+infringement under applicable copyright law, except executing it on a
+computer or modifying a private copy. Propagation includes copying,
+distribution (with or without modification), making available to the
+public, and in some countries other activities as well.
+
+ To "convey" a work means any kind of propagation that enables other
+parties to make or receive copies. Mere interaction with a user through
+a computer network, with no transfer of a copy, is not conveying.
+
+ An interactive user interface displays "Appropriate Legal Notices"
+to the extent that it includes a convenient and prominently visible
+feature that (1) displays an appropriate copyright notice, and (2)
+tells the user that there is no warranty for the work (except to the
+extent that warranties are provided), that licensees may convey the
+work under this License, and how to view a copy of this License. If
+the interface presents a list of user commands or options, such as a
+menu, a prominent item in the list meets this criterion.
+
+ 1. Source Code.
+
+ The "source code" for a work means the preferred form of the work
+for making modifications to it. "Object code" means any non-source
+form of a work.
+
+ A "Standard Interface" means an interface that either is an official
+standard defined by a recognized standards body, or, in the case of
+interfaces specified for a particular programming language, one that
+is widely used among developers working in that language.
+
+ The "System Libraries" of an executable work include anything, other
+than the work as a whole, that (a) is included in the normal form of
+packaging a Major Component, but which is not part of that Major
+Component, and (b) serves only to enable use of the work with that
+Major Component, or to implement a Standard Interface for which an
+implementation is available to the public in source code form. A
+"Major Component", in this context, means a major essential component
+(kernel, window system, and so on) of the specific operating system
+(if any) on which the executable work runs, or a compiler used to
+produce the work, or an object code interpreter used to run it.
+
+ The "Corresponding Source" for a work in object code form means all
+the source code needed to generate, install, and (for an executable
+work) run the object code and to modify the work, including scripts to
+control those activities. However, it does not include the work's
+System Libraries, or general-purpose tools or generally available free
+programs which are used unmodified in performing those activities but
+which are not part of the work. For example, Corresponding Source
+includes interface definition files associated with source files for
+the work, and the source code for shared libraries and dynamically
+linked subprograms that the work is specifically designed to require,
+such as by intimate data communication or control flow between those
+subprograms and other parts of the work.
+
+ The Corresponding Source need not include anything that users
+can regenerate automatically from other parts of the Corresponding
+Source.
+
+ The Corresponding Source for a work in source code form is that
+same work.
+
+ 2. Basic Permissions.
+
+ All rights granted under this License are granted for the term of
+copyright on the Program, and are irrevocable provided the stated
+conditions are met. This License explicitly affirms your unlimited
+permission to run the unmodified Program. The output from running a
+covered work is covered by this License only if the output, given its
+content, constitutes a covered work. This License acknowledges your
+rights of fair use or other equivalent, as provided by copyright law.
+
+ You may make, run and propagate covered works that you do not
+convey, without conditions so long as your license otherwise remains
+in force. You may convey covered works to others for the sole purpose
+of having them make modifications exclusively for you, or provide you
+with facilities for running those works, provided that you comply with
+the terms of this License in conveying all material for which you do
+not control copyright. Those thus making or running the covered works
+for you must do so exclusively on your behalf, under your direction
+and control, on terms that prohibit them from making any copies of
+your copyrighted material outside their relationship with you.
+
+ Conveying under any other circumstances is permitted solely under
+the conditions stated below. Sublicensing is not allowed; section 10
+makes it unnecessary.
+
+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
+
+ No covered work shall be deemed part of an effective technological
+measure under any applicable law fulfilling obligations under article
+11 of the WIPO copyright treaty adopted on 20 December 1996, or
+similar laws prohibiting or restricting circumvention of such
+measures.
+
+ When you convey a covered work, you waive any legal power to forbid
+circumvention of technological measures to the extent such circumvention
+is effected by exercising rights under this License with respect to
+the covered work, and you disclaim any intention to limit operation or
+modification of the work as a means of enforcing, against the work's
+users, your or third parties' legal rights to forbid circumvention of
+technological measures.
+
+ 4. Conveying Verbatim Copies.
+
+ You may convey verbatim copies of the Program's source code as you
+receive it, in any medium, provided that you conspicuously and
+appropriately publish on each copy an appropriate copyright notice;
+keep intact all notices stating that this License and any
+non-permissive terms added in accord with section 7 apply to the code;
+keep intact all notices of the absence of any warranty; and give all
+recipients a copy of this License along with the Program.
+
+ You may charge any price or no price for each copy that you convey,
+and you may offer support or warranty protection for a fee.
+
+ 5. Conveying Modified Source Versions.
+
+ You may convey a work based on the Program, or the modifications to
+produce it from the Program, in the form of source code under the
+terms of section 4, provided that you also meet all of these conditions:
+
+ a) The work must carry prominent notices stating that you modified
+ it, and giving a relevant date.
+
+ b) The work must carry prominent notices stating that it is
+ released under this License and any conditions added under section
+ 7. This requirement modifies the requirement in section 4 to
+ "keep intact all notices".
+
+ c) You must license the entire work, as a whole, under this
+ License to anyone who comes into possession of a copy. This
+ License will therefore apply, along with any applicable section 7
+ additional terms, to the whole of the work, and all its parts,
+ regardless of how they are packaged. This License gives no
+ permission to license the work in any other way, but it does not
+ invalidate such permission if you have separately received it.
+
+ d) If the work has interactive user interfaces, each must display
+ Appropriate Legal Notices; however, if the Program has interactive
+ interfaces that do not display Appropriate Legal Notices, your
+ work need not make them do so.
+
+ A compilation of a covered work with other separate and independent
+works, which are not by their nature extensions of the covered work,
+and which are not combined with it such as to form a larger program,
+in or on a volume of a storage or distribution medium, is called an
+"aggregate" if the compilation and its resulting copyright are not
+used to limit the access or legal rights of the compilation's users
+beyond what the individual works permit. Inclusion of a covered work
+in an aggregate does not cause this License to apply to the other
+parts of the aggregate.
+
+ 6. Conveying Non-Source Forms.
+
+ You may convey a covered work in object code form under the terms
+of sections 4 and 5, provided that you also convey the
+machine-readable Corresponding Source under the terms of this License,
+in one of these ways:
+
+ a) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by the
+ Corresponding Source fixed on a durable physical medium
+ customarily used for software interchange.
+
+ b) Convey the object code in, or embodied in, a physical product
+ (including a physical distribution medium), accompanied by a
+ written offer, valid for at least three years and valid for as
+ long as you offer spare parts or customer support for that product
+ model, to give anyone who possesses the object code either (1) a
+ copy of the Corresponding Source for all the software in the
+ product that is covered by this License, on a durable physical
+ medium customarily used for software interchange, for a price no
+ more than your reasonable cost of physically performing this
+ conveying of source, or (2) access to copy the
+ Corresponding Source from a network server at no charge.
+
+ c) Convey individual copies of the object code with a copy of the
+ written offer to provide the Corresponding Source. This
+ alternative is allowed only occasionally and noncommercially, and
+ only if you received the object code with such an offer, in accord
+ with subsection 6b.
+
+ d) Convey the object code by offering access from a designated
+ place (gratis or for a charge), and offer equivalent access to the
+ Corresponding Source in the same way through the same place at no
+ further charge. You need not require recipients to copy the
+ Corresponding Source along with the object code. If the place to
+ copy the object code is a network server, the Corresponding Source
+ may be on a different server (operated by you or a third party)
+ that supports equivalent copying facilities, provided you maintain
+ clear directions next to the object code saying where to find the
+ Corresponding Source. Regardless of what server hosts the
+ Corresponding Source, you remain obligated to ensure that it is
+ available for as long as needed to satisfy these requirements.
+
+ e) Convey the object code using peer-to-peer transmission, provided
+ you inform other peers where the object code and Corresponding
+ Source of the work are being offered to the general public at no
+ charge under subsection 6d.
+
+ A separable portion of the object code, whose source code is excluded
+from the Corresponding Source as a System Library, need not be
+included in conveying the object code work.
+
+ A "User Product" is either (1) a "consumer product", which means any
+tangible personal property which is normally used for personal, family,
+or household purposes, or (2) anything designed or sold for incorporation
+into a dwelling. In determining whether a product is a consumer product,
+doubtful cases shall be resolved in favor of coverage. For a particular
+product received by a particular user, "normally used" refers to a
+typical or common use of that class of product, regardless of the status
+of the particular user or of the way in which the particular user
+actually uses, or expects or is expected to use, the product. A product
+is a consumer product regardless of whether the product has substantial
+commercial, industrial or non-consumer uses, unless such uses represent
+the only significant mode of use of the product.
+
+ "Installation Information" for a User Product means any methods,
+procedures, authorization keys, or other information required to install
+and execute modified versions of a covered work in that User Product from
+a modified version of its Corresponding Source. The information must
+suffice to ensure that the continued functioning of the modified object
+code is in no case prevented or interfered with solely because
+modification has been made.
+
+ If you convey an object code work under this section in, or with, or
+specifically for use in, a User Product, and the conveying occurs as
+part of a transaction in which the right of possession and use of the
+User Product is transferred to the recipient in perpetuity or for a
+fixed term (regardless of how the transaction is characterized), the
+Corresponding Source conveyed under this section must be accompanied
+by the Installation Information. But this requirement does not apply
+if neither you nor any third party retains the ability to install
+modified object code on the User Product (for example, the work has
+been installed in ROM).
+
+ The requirement to provide Installation Information does not include a
+requirement to continue to provide support service, warranty, or updates
+for a work that has been modified or installed by the recipient, or for
+the User Product in which it has been modified or installed. Access to a
+network may be denied when the modification itself materially and
+adversely affects the operation of the network or violates the rules and
+protocols for communication across the network.
+
+ Corresponding Source conveyed, and Installation Information provided,
+in accord with this section must be in a format that is publicly
+documented (and with an implementation available to the public in
+source code form), and must require no special password or key for
+unpacking, reading or copying.
+
+ 7. Additional Terms.
+
+ "Additional permissions" are terms that supplement the terms of this
+License by making exceptions from one or more of its conditions.
+Additional permissions that are applicable to the entire Program shall
+be treated as though they were included in this License, to the extent
+that they are valid under applicable law. If additional permissions
+apply only to part of the Program, that part may be used separately
+under those permissions, but the entire Program remains governed by
+this License without regard to the additional permissions.
+
+ When you convey a copy of a covered work, you may at your option
+remove any additional permissions from that copy, or from any part of
+it. (Additional permissions may be written to require their own
+removal in certain cases when you modify the work.) You may place
+additional permissions on material, added by you to a covered work,
+for which you have or can give appropriate copyright permission.
+
+ Notwithstanding any other provision of this License, for material you
+add to a covered work, you may (if authorized by the copyright holders of
+that material) supplement the terms of this License with terms:
+
+ a) Disclaiming warranty or limiting liability differently from the
+ terms of sections 15 and 16 of this License; or
+
+ b) Requiring preservation of specified reasonable legal notices or
+ author attributions in that material or in the Appropriate Legal
+ Notices displayed by works containing it; or
+
+ c) Prohibiting misrepresentation of the origin of that material, or
+ requiring that modified versions of such material be marked in
+ reasonable ways as different from the original version; or
+
+ d) Limiting the use for publicity purposes of names of licensors or
+ authors of the material; or
+
+ e) Declining to grant rights under trademark law for use of some
+ trade names, trademarks, or service marks; or
+
+ f) Requiring indemnification of licensors and authors of that
+ material by anyone who conveys the material (or modified versions of
+ it) with contractual assumptions of liability to the recipient, for
+ any liability that these contractual assumptions directly impose on
+ those licensors and authors.
+
+ All other non-permissive additional terms are considered "further
+restrictions" within the meaning of section 10. If the Program as you
+received it, or any part of it, contains a notice stating that it is
+governed by this License along with a term that is a further
+restriction, you may remove that term. If a license document contains
+a further restriction but permits relicensing or conveying under this
+License, you may add to a covered work material governed by the terms
+of that license document, provided that the further restriction does
+not survive such relicensing or conveying.
+
+ If you add terms to a covered work in accord with this section, you
+must place, in the relevant source files, a statement of the
+additional terms that apply to those files, or a notice indicating
+where to find the applicable terms.
+
+ Additional terms, permissive or non-permissive, may be stated in the
+form of a separately written license, or stated as exceptions;
+the above requirements apply either way.
+
+ 8. Termination.
+
+ You may not propagate or modify a covered work except as expressly
+provided under this License. Any attempt otherwise to propagate or
+modify it is void, and will automatically terminate your rights under
+this License (including any patent licenses granted under the third
+paragraph of section 11).
+
+ However, if you cease all violation of this License, then your
+license from a particular copyright holder is reinstated (a)
+provisionally, unless and until the copyright holder explicitly and
+finally terminates your license, and (b) permanently, if the copyright
+holder fails to notify you of the violation by some reasonable means
+prior to 60 days after the cessation.
+
+ Moreover, your license from a particular copyright holder is
+reinstated permanently if the copyright holder notifies you of the
+violation by some reasonable means, this is the first time you have
+received notice of violation of this License (for any work) from that
+copyright holder, and you cure the violation prior to 30 days after
+your receipt of the notice.
+
+ Termination of your rights under this section does not terminate the
+licenses of parties who have received copies or rights from you under
+this License. If your rights have been terminated and not permanently
+reinstated, you do not qualify to receive new licenses for the same
+material under section 10.
+
+ 9. Acceptance Not Required for Having Copies.
+
+ You are not required to accept this License in order to receive or
+run a copy of the Program. Ancillary propagation of a covered work
+occurring solely as a consequence of using peer-to-peer transmission
+to receive a copy likewise does not require acceptance. However,
+nothing other than this License grants you permission to propagate or
+modify any covered work. These actions infringe copyright if you do
+not accept this License. Therefore, by modifying or propagating a
+covered work, you indicate your acceptance of this License to do so.
+
+ 10. Automatic Licensing of Downstream Recipients.
+
+ Each time you convey a covered work, the recipient automatically
+receives a license from the original licensors, to run, modify and
+propagate that work, subject to this License. You are not responsible
+for enforcing compliance by third parties with this License.
+
+ An "entity transaction" is a transaction transferring control of an
+organization, or substantially all assets of one, or subdividing an
+organization, or merging organizations. If propagation of a covered
+work results from an entity transaction, each party to that
+transaction who receives a copy of the work also receives whatever
+licenses to the work the party's predecessor in interest had or could
+give under the previous paragraph, plus a right to possession of the
+Corresponding Source of the work from the predecessor in interest, if
+the predecessor has it or can get it with reasonable efforts.
+
+ You may not impose any further restrictions on the exercise of the
+rights granted or affirmed under this License. For example, you may
+not impose a license fee, royalty, or other charge for exercise of
+rights granted under this License, and you may not initiate litigation
+(including a cross-claim or counterclaim in a lawsuit) alleging that
+any patent claim is infringed by making, using, selling, offering for
+sale, or importing the Program or any portion of it.
+
+ 11. Patents.
+
+ A "contributor" is a copyright holder who authorizes use under this
+License of the Program or a work on which the Program is based. The
+work thus licensed is called the contributor's "contributor version".
+
+ A contributor's "essential patent claims" are all patent claims
+owned or controlled by the contributor, whether already acquired or
+hereafter acquired, that would be infringed by some manner, permitted
+by this License, of making, using, or selling its contributor version,
+but do not include claims that would be infringed only as a
+consequence of further modification of the contributor version. For
+purposes of this definition, "control" includes the right to grant
+patent sublicenses in a manner consistent with the requirements of
+this License.
+
+ Each contributor grants you a non-exclusive, worldwide, royalty-free
+patent license under the contributor's essential patent claims, to
+make, use, sell, offer for sale, import and otherwise run, modify and
+propagate the contents of its contributor version.
+
+ In the following three paragraphs, a "patent license" is any express
+agreement or commitment, however denominated, not to enforce a patent
+(such as an express permission to practice a patent or covenant not to
+sue for patent infringement). To "grant" such a patent license to a
+party means to make such an agreement or commitment not to enforce a
+patent against the party.
+
+ If you convey a covered work, knowingly relying on a patent license,
+and the Corresponding Source of the work is not available for anyone
+to copy, free of charge and under the terms of this License, through a
+publicly available network server or other readily accessible means,
+then you must either (1) cause the Corresponding Source to be so
+available, or (2) arrange to deprive yourself of the benefit of the
+patent license for this particular work, or (3) arrange, in a manner
+consistent with the requirements of this License, to extend the patent
+license to downstream recipients. "Knowingly relying" means you have
+actual knowledge that, but for the patent license, your conveying the
+covered work in a country, or your recipient's use of the covered work
+in a country, would infringe one or more identifiable patents in that
+country that you have reason to believe are valid.
+
+ If, pursuant to or in connection with a single transaction or
+arrangement, you convey, or propagate by procuring conveyance of, a
+covered work, and grant a patent license to some of the parties
+receiving the covered work authorizing them to use, propagate, modify
+or convey a specific copy of the covered work, then the patent license
+you grant is automatically extended to all recipients of the covered
+work and works based on it.
+
+ A patent license is "discriminatory" if it does not include within
+the scope of its coverage, prohibits the exercise of, or is
+conditioned on the non-exercise of one or more of the rights that are
+specifically granted under this License. You may not convey a covered
+work if you are a party to an arrangement with a third party that is
+in the business of distributing software, under which you make payment
+to the third party based on the extent of your activity of conveying
+the work, and under which the third party grants, to any of the
+parties who would receive the covered work from you, a discriminatory
+patent license (a) in connection with copies of the covered work
+conveyed by you (or copies made from those copies), or (b) primarily
+for and in connection with specific products or compilations that
+contain the covered work, unless you entered into that arrangement,
+or that patent license was granted, prior to 28 March 2007.
+
+ Nothing in this License shall be construed as excluding or limiting
+any implied license or other defenses to infringement that may
+otherwise be available to you under applicable patent law.
+
+ 12. No Surrender of Others' Freedom.
+
+ If conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot convey a
+covered work so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you may
+not convey it at all. For example, if you agree to terms that obligate you
+to collect a royalty for further conveying from those to whom you convey
+the Program, the only way you could satisfy both those terms and this
+License would be to refrain entirely from conveying the Program.
+
+ 13. Use with the GNU Affero General Public License.
+
+ Notwithstanding any other provision of this License, you have
+permission to link or combine any covered work with a work licensed
+under version 3 of the GNU Affero General Public License into a single
+combined work, and to convey the resulting work. The terms of this
+License will continue to apply to the part which is the covered work,
+but the special requirements of the GNU Affero General Public License,
+section 13, concerning interaction through a network will apply to the
+combination as such.
+
+ 14. Revised Versions of this License.
+
+ The Free Software Foundation may publish revised and/or new versions of
+the GNU General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+ Each version is given a distinguishing version number. If the
+Program specifies that a certain numbered version of the GNU General
+Public License "or any later version" applies to it, you have the
+option of following the terms and conditions either of that numbered
+version or of any later version published by the Free Software
+Foundation. If the Program does not specify a version number of the
+GNU General Public License, you may choose any version ever published
+by the Free Software Foundation.
+
+ If the Program specifies that a proxy can decide which future
+versions of the GNU General Public License can be used, that proxy's
+public statement of acceptance of a version permanently authorizes you
+to choose that version for the Program.
+
+ Later license versions may give you additional or different
+permissions. However, no additional obligations are imposed on any
+author or copyright holder as a result of your choosing to follow a
+later version.
+
+ 15. Disclaimer of Warranty.
+
+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. Limitation of Liability.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
+SUCH DAMAGES.
+
+ 17. Interpretation of Sections 15 and 16.
+
+ If the disclaimer of warranty and limitation of liability provided
+above cannot be given local legal effect according to their terms,
+reviewing courts shall apply local law that most closely approximates
+an absolute waiver of all civil liability in connection with the
+Program, unless a warranty or assumption of liability accompanies a
+copy of the Program in return for a fee.
+
+Bison Exception
+
+As a special exception, you may create a larger work that contains part or all
+of the Bison parser skeleton and distribute that work under terms of your
+choice, so long as that work isn't itself a parser generator using the skeleton
+or a modified version thereof as a parser skeleton. Alternatively, if you
+modify or redistribute the parser skeleton itself, you may (at your option)
+remove this special exception, which will cause the skeleton and the resulting
+Bison output files to be licensed under the GNU General Public License without
+this special exception.
+
+This special exception was added by the Free Software Foundation in version
+2.2 of Bison.
+
+ END OF TERMS AND CONDITIONS
--------------------------------------------------------------------------------
================================================================================
--------------------------------------------------------------------------------
-The preprocessor has the core licenses stated above, plus an additional licence:
+The preprocessor has the core licenses stated above, plus additional licences:
/****************************************************************************\
Copyright (c) 2002, NVIDIA Corporation.
@@ -382,3 +988,29 @@ NVIDIA SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT,
TORT (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF
NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\****************************************************************************/
+
+/*
+** Copyright (c) 2014-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.
+**
+** 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.
+*/
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp b/3rdparty/bgfx/3rdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp
index a0790f48f14..d56ad46e246 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/CInterface/spirv_c_interface.cpp
@@ -36,6 +36,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "SPIRV/Logger.h"
#include "SPIRV/SpvTools.h"
+static_assert(sizeof(glslang_spv_options_t) == sizeof(glslang::SpvOptions), "");
+
typedef struct glslang_program_s {
glslang::TProgram* program;
std::vector<unsigned int> spirv;
@@ -57,22 +59,22 @@ static EShLanguage c_shader_stage(glslang_stage_t stage)
return EShLangFragment;
case GLSLANG_STAGE_COMPUTE:
return EShLangCompute;
- case GLSLANG_STAGE_RAYGEN_NV:
+ case GLSLANG_STAGE_RAYGEN:
return EShLangRayGen;
- case GLSLANG_STAGE_INTERSECT_NV:
+ case GLSLANG_STAGE_INTERSECT:
return EShLangIntersect;
- case GLSLANG_STAGE_ANYHIT_NV:
+ case GLSLANG_STAGE_ANYHIT:
return EShLangAnyHit;
- case GLSLANG_STAGE_CLOSESTHIT_NV:
+ case GLSLANG_STAGE_CLOSESTHIT:
return EShLangClosestHit;
- case GLSLANG_STAGE_MISS_NV:
+ case GLSLANG_STAGE_MISS:
return EShLangMiss;
- case GLSLANG_STAGE_CALLABLE_NV:
+ case GLSLANG_STAGE_CALLABLE:
return EShLangCallable;
- case GLSLANG_STAGE_TASK_NV:
- return EShLangTaskNV;
- case GLSLANG_STAGE_MESH_NV:
- return EShLangMeshNV;
+ case GLSLANG_STAGE_TASK:
+ return EShLangTask;
+ case GLSLANG_STAGE_MESH:
+ return EShLangMesh;
default:
break;
}
@@ -81,13 +83,25 @@ static EShLanguage c_shader_stage(glslang_stage_t stage)
GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage)
{
+ glslang_spv_options_t spv_options;
+ spv_options.generate_debug_info = false;
+ spv_options.strip_debug_info = false;
+ spv_options.emit_nonsemantic_shader_debug_info = false;
+ spv_options.emit_nonsemantic_shader_debug_source = false;
+ spv_options.disable_optimizer = true;
+ spv_options.optimize_size = false;
+ spv_options.disassemble = false;
+ spv_options.validate = true;
+
+ glslang_program_SPIRV_generate_with_options(program, stage, &spv_options);
+}
+
+GLSLANG_EXPORT void glslang_program_SPIRV_generate_with_options(glslang_program_t* program, glslang_stage_t stage, glslang_spv_options_t* spv_options) {
spv::SpvBuildLogger logger;
- glslang::SpvOptions spvOptions;
- spvOptions.validate = true;
const glslang::TIntermediate* intermediate = program->program->getIntermediate(c_shader_stage(stage));
- glslang::GlslangToSpv(*intermediate, program->spirv, &logger, &spvOptions);
+ glslang::GlslangToSpv(*intermediate, program->spirv, &logger, reinterpret_cast<glslang::SpvOptions*>(spv_options));
program->loggerMessages = logger.getAllMessages();
}
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h b/3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h
index f48f1304d65..a247b4cd131 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.EXT.h
@@ -39,5 +39,6 @@ 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_mesh_shader = "SPV_EXT_mesh_shader";
#endif // #ifndef GLSLextEXT_H
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h b/3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h
index 5eb3e944825..d5c670f0e12 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/GLSL.ext.KHR.h
@@ -29,7 +29,7 @@
#define GLSLextKHR_H
static const int GLSLextKHRVersion = 100;
-static const int GLSLextKHRRevision = 2;
+static const int GLSLextKHRRevision = 3;
static const char* const E_SPV_KHR_shader_ballot = "SPV_KHR_shader_ballot";
static const char* const E_SPV_KHR_subgroup_vote = "SPV_KHR_subgroup_vote";
@@ -52,5 +52,7 @@ static const char* const E_SPV_KHR_fragment_shading_rate = "SPV_KHR_fragm
static const char* const E_SPV_KHR_terminate_invocation = "SPV_KHR_terminate_invocation";
static const char* const E_SPV_KHR_workgroup_memory_explicit_layout = "SPV_KHR_workgroup_memory_explicit_layout";
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";
#endif // #ifndef GLSLextKHR_H
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp b/3rdparty/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp
index 63932c2b1ad..842221cba0d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/GlslangToSpv.cpp
@@ -260,6 +260,7 @@ protected:
std::unordered_map<std::string, spv::Id> extBuiltinMap;
std::unordered_map<long long, spv::Id> symbolValues;
+ std::unordered_map<uint32_t, spv::Id> builtInVariableIds;
std::unordered_set<long long> rValueParameters; // set of formal function parameters passed as rValues,
// rather than a pointer
std::unordered_map<std::string, spv::Function*> functionMap;
@@ -279,6 +280,9 @@ protected:
// Used later for generating OpTraceKHR/OpExecuteCallableKHR
std::unordered_map<unsigned int, glslang::TIntermSymbol *> locationToSymbol[2];
+
+ // Used by Task shader while generating opearnds for OpEmitMeshTasksEXT
+ spv::Id taskPayloadID;
};
//
@@ -290,8 +294,6 @@ spv::SourceLanguage TranslateSourceLanguage(glslang::EShSource source, EProfile
{
#ifdef GLSLANG_WEB
return spv::SourceLanguageESSL;
-#elif defined(GLSLANG_ANGLE)
- return spv::SourceLanguageGLSL;
#endif
switch (source) {
@@ -314,7 +316,7 @@ spv::SourceLanguage TranslateSourceLanguage(glslang::EShSource source, EProfile
}
// Translate glslang language (stage) to SPIR-V execution model.
-spv::ExecutionModel TranslateExecutionModel(EShLanguage stage)
+spv::ExecutionModel TranslateExecutionModel(EShLanguage stage, bool isMeshShaderEXT = false)
{
switch (stage) {
case EShLangVertex: return spv::ExecutionModelVertex;
@@ -330,8 +332,8 @@ spv::ExecutionModel TranslateExecutionModel(EShLanguage stage)
case EShLangClosestHit: return spv::ExecutionModelClosestHitKHR;
case EShLangMiss: return spv::ExecutionModelMissKHR;
case EShLangCallable: return spv::ExecutionModelCallableKHR;
- case EShLangTaskNV: return spv::ExecutionModelTaskNV;
- case EShLangMeshNV: return spv::ExecutionModelMeshNV;
+ case EShLangTask: return (isMeshShaderEXT)? spv::ExecutionModelTaskEXT : spv::ExecutionModelTaskNV;
+ case EShLangMesh: return (isMeshShaderEXT)? spv::ExecutionModelMeshEXT: spv::ExecutionModelMeshNV;
#endif
default:
assert(0);
@@ -762,7 +764,7 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
return spv::BuiltInSampleMask;
case glslang::EbvLayer:
- if (glslangIntermediate->getStage() == EShLangMeshNV) {
+ if (glslangIntermediate->getStage() == EShLangMesh) {
return spv::BuiltInLayer;
}
if (glslangIntermediate->getStage() == EShLangGeometry ||
@@ -1007,6 +1009,8 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
return spv::BuiltInRayTminKHR;
case glslang::EbvRayTmax:
return spv::BuiltInRayTmaxKHR;
+ case glslang::EbvCullMask:
+ return spv::BuiltInCullMaskKHR;
case glslang::EbvInstanceCustomIndex:
return spv::BuiltInInstanceCustomIndexKHR;
case glslang::EbvHitT:
@@ -1048,6 +1052,15 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
builder.addCapability(spv::CapabilityFragmentBarycentricNV);
return spv::BuiltInBaryCoordNoPerspNV;
+ case glslang::EbvBaryCoordEXT:
+ builder.addExtension(spv::E_SPV_KHR_fragment_shader_barycentric);
+ builder.addCapability(spv::CapabilityFragmentBarycentricKHR);
+ return spv::BuiltInBaryCoordKHR;
+ case glslang::EbvBaryCoordNoPerspEXT:
+ builder.addExtension(spv::E_SPV_KHR_fragment_shader_barycentric);
+ builder.addCapability(spv::CapabilityFragmentBarycentricKHR);
+ return spv::BuiltInBaryCoordNoPerspKHR;
+
// mesh shaders
case glslang::EbvTaskCountNV:
return spv::BuiltInTaskCountNV;
@@ -1066,6 +1079,16 @@ spv::BuiltIn TGlslangToSpvTraverser::TranslateBuiltInDecoration(glslang::TBuiltI
case glslang::EbvMeshViewIndicesNV:
return spv::BuiltInMeshViewIndicesNV;
+ // SPV_EXT_mesh_shader
+ case glslang::EbvPrimitivePointIndicesEXT:
+ return spv::BuiltInPrimitivePointIndicesEXT;
+ case glslang::EbvPrimitiveLineIndicesEXT:
+ return spv::BuiltInPrimitiveLineIndicesEXT;
+ case glslang::EbvPrimitiveTriangleIndicesEXT:
+ return spv::BuiltInPrimitiveTriangleIndicesEXT;
+ case glslang::EbvCullPrimitiveEXT:
+ return spv::BuiltInCullPrimitiveEXT;
+
// sm builtins
case glslang::EbvWarpsPerSM:
builder.addExtension(spv::E_SPV_NV_shader_sm_builtins);
@@ -1256,8 +1279,10 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
if (type.getBasicType() == glslang::EbtRayQuery)
return spv::StorageClassPrivate;
#ifndef GLSLANG_WEB
- if (type.getQualifier().isSpirvByReference())
- return spv::StorageClassFunction;
+ if (type.getQualifier().isSpirvByReference()) {
+ if (type.getQualifier().isParamInput() || type.getQualifier().isParamOutput())
+ return spv::StorageClassFunction;
+ }
#endif
if (type.getQualifier().isPipeInput())
return spv::StorageClassInput;
@@ -1307,6 +1332,7 @@ spv::StorageClass TGlslangToSpvTraverser::TranslateStorageClass(const glslang::T
case glslang::EvqHitAttr: return spv::StorageClassHitAttributeKHR;
case glslang::EvqCallableData: return spv::StorageClassCallableDataKHR;
case glslang::EvqCallableDataIn: return spv::StorageClassIncomingCallableDataKHR;
+ case glslang::EvqtaskPayloadSharedEXT : return spv::StorageClassTaskPayloadWorkgroupEXT;
case glslang::EvqSpirvStorageClass: return static_cast<spv::StorageClass>(type.getQualifier().spirvStorageClass);
#endif
default:
@@ -1324,7 +1350,9 @@ void TGlslangToSpvTraverser::TranslateLiterals(const glslang::TVector<const glsl
for (auto constant : constants) {
if (constant->getBasicType() == glslang::EbtFloat) {
float floatValue = static_cast<float>(constant->getConstArray()[0].getDConst());
- unsigned literal = *reinterpret_cast<unsigned*>(&floatValue);
+ unsigned literal;
+ static_assert(sizeof(literal) == sizeof(floatValue), "sizeof(unsigned) != sizeof(float)");
+ memcpy(&literal, &floatValue, sizeof(literal));
literals.push_back(literal);
} else if (constant->getBasicType() == glslang::EbtInt) {
unsigned literal = constant->getConstArray()[0].getIConst();
@@ -1450,6 +1478,8 @@ void InheritQualifiers(glslang::TQualifier& child, const glslang::TQualifier& pa
child.perViewNV = true;
if (parent.perTaskNV)
child.perTaskNV = true;
+ if (parent.storage == glslang::EvqtaskPayloadSharedEXT)
+ child.storage = glslang::EvqtaskPayloadSharedEXT;
if (parent.patch)
child.patch = true;
if (parent.sample)
@@ -1509,9 +1539,12 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
inEntryPoint(false), entryPointTerminated(false), linkageOnly(false),
glslangIntermediate(glslangIntermediate),
nanMinMaxClamp(glslangIntermediate->getNanMinMaxClamp()),
- nonSemanticDebugPrintf(0)
+ nonSemanticDebugPrintf(0),
+ taskPayloadID(0)
{
- spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage());
+ bool isMeshShaderExt = (glslangIntermediate->getRequestedExtensions().find(glslang::E_GL_EXT_mesh_shader) !=
+ glslangIntermediate->getRequestedExtensions().end());
+ spv::ExecutionModel executionModel = TranslateExecutionModel(glslangIntermediate->getStage(), isMeshShaderExt);
builder.clearAccessChain();
builder.setSource(TranslateSourceLanguage(glslangIntermediate->getSource(), glslangIntermediate->getProfile()),
@@ -1543,6 +1576,10 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
for (auto iItr = include_txt.begin(); iItr != include_txt.end(); ++iItr)
builder.addInclude(iItr->first, iItr->second);
}
+
+ builder.setEmitNonSemanticShaderDebugInfo(options.emitNonSemanticShaderDebugInfo);
+ builder.setEmitNonSemanticShaderDebugSource(options.emitNonSemanticShaderDebugSource);
+
stdBuiltins = builder.import("GLSL.std.450");
spv::AddressingModel addressingModel = spv::AddressingModelLogical;
@@ -1609,6 +1646,12 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
if (glslangIntermediate->getEarlyFragmentTests())
builder.addExecutionMode(shaderEntry, spv::ExecutionModeEarlyFragmentTests);
+ if (glslangIntermediate->getEarlyAndLateFragmentTestsAMD())
+ {
+ builder.addExecutionMode(shaderEntry, spv::ExecutionModeEarlyAndLateFragmentTestsAMD);
+ builder.addExtension(spv::E_SPV_AMD_shader_early_and_late_fragment_tests);
+ }
+
if (glslangIntermediate->getPostDepthCoverage()) {
builder.addCapability(spv::CapabilitySampleMaskPostDepthCoverage);
builder.addExecutionMode(shaderEntry, spv::ExecutionModePostDepthCoverage);
@@ -1618,6 +1661,9 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
if (glslangIntermediate->isDepthReplacing())
builder.addExecutionMode(shaderEntry, spv::ExecutionModeDepthReplacing);
+ if (glslangIntermediate->isStencilReplacing())
+ builder.addExecutionMode(shaderEntry, spv::ExecutionModeStencilRefReplacingEXT);
+
#ifndef GLSLANG_WEB
switch(glslangIntermediate->getDepth()) {
@@ -1626,6 +1672,20 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
case glslang::EldUnchanged: mode = spv::ExecutionModeDepthUnchanged; break;
default: mode = spv::ExecutionModeMax; break;
}
+
+ if (mode != spv::ExecutionModeMax)
+ builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
+
+ switch (glslangIntermediate->getStencil()) {
+ case glslang::ElsRefUnchangedFrontAMD: mode = spv::ExecutionModeStencilRefUnchangedFrontAMD; break;
+ case glslang::ElsRefGreaterFrontAMD: mode = spv::ExecutionModeStencilRefGreaterFrontAMD; break;
+ case glslang::ElsRefLessFrontAMD: mode = spv::ExecutionModeStencilRefLessFrontAMD; break;
+ case glslang::ElsRefUnchangedBackAMD: mode = spv::ExecutionModeStencilRefUnchangedBackAMD; break;
+ case glslang::ElsRefGreaterBackAMD: mode = spv::ExecutionModeStencilRefGreaterBackAMD; break;
+ case glslang::ElsRefLessBackAMD: mode = spv::ExecutionModeStencilRefLessBackAMD; break;
+ default: mode = spv::ExecutionModeMax; break;
+ }
+
if (mode != spv::ExecutionModeMax)
builder.addExecutionMode(shaderEntry, (spv::ExecutionMode)mode);
switch (glslangIntermediate->getInterlockOrdering()) {
@@ -1662,9 +1722,22 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
case EShLangCompute:
builder.addCapability(spv::CapabilityShader);
- builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0),
- glslangIntermediate->getLocalSize(1),
- glslangIntermediate->getLocalSize(2));
+ if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) {
+ std::vector<spv::Id> dimConstId;
+ for (int dim = 0; dim < 3; ++dim) {
+ bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet);
+ dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst));
+ if (specConst) {
+ builder.addDecoration(dimConstId.back(), spv::DecorationSpecId,
+ glslangIntermediate->getLocalSizeSpecId(dim));
+ }
+ }
+ builder.addExecutionModeId(shaderEntry, spv::ExecutionModeLocalSizeId, dimConstId);
+ } else {
+ builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0),
+ glslangIntermediate->getLocalSize(1),
+ glslangIntermediate->getLocalSize(2));
+ }
if (glslangIntermediate->getLayoutDerivativeModeNone() == glslang::LayoutDerivativeGroupQuads) {
builder.addCapability(spv::CapabilityComputeDerivativeGroupQuadsNV);
builder.addExecutionMode(shaderEntry, spv::ExecutionModeDerivativeGroupQuadsNV);
@@ -1751,7 +1824,7 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
case EShLangAnyHit:
case EShLangClosestHit:
case EShLangMiss:
- case EShLangCallable:
+ case EShLangCallable:
{
auto& extensions = glslangIntermediate->getRequestedExtensions();
if (extensions.find("GL_NV_ray_tracing") == extensions.end()) {
@@ -1762,16 +1835,41 @@ 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");
+ }
+ }
break;
}
- case EShLangTaskNV:
- case EShLangMeshNV:
- builder.addCapability(spv::CapabilityMeshShadingNV);
- builder.addExtension(spv::E_SPV_NV_mesh_shader);
- builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0),
- glslangIntermediate->getLocalSize(1),
- glslangIntermediate->getLocalSize(2));
- if (glslangIntermediate->getStage() == EShLangMeshNV) {
+ case EShLangTask:
+ case EShLangMesh:
+ if(isMeshShaderExt) {
+ builder.addCapability(spv::CapabilityMeshShadingEXT);
+ builder.addExtension(spv::E_SPV_EXT_mesh_shader);
+ } else {
+ builder.addCapability(spv::CapabilityMeshShadingNV);
+ builder.addExtension(spv::E_SPV_NV_mesh_shader);
+ }
+ if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) {
+ std::vector<spv::Id> dimConstId;
+ for (int dim = 0; dim < 3; ++dim) {
+ bool specConst = (glslangIntermediate->getLocalSizeSpecId(dim) != glslang::TQualifier::layoutNotSet);
+ dimConstId.push_back(builder.makeUintConstant(glslangIntermediate->getLocalSize(dim), specConst));
+ if (specConst) {
+ builder.addDecoration(dimConstId.back(), spv::DecorationSpecId,
+ glslangIntermediate->getLocalSizeSpecId(dim));
+ }
+ }
+ builder.addExecutionModeId(shaderEntry, spv::ExecutionModeLocalSizeId, dimConstId);
+ } else {
+ builder.addExecutionMode(shaderEntry, spv::ExecutionModeLocalSize, glslangIntermediate->getLocalSize(0),
+ glslangIntermediate->getLocalSize(1),
+ glslangIntermediate->getLocalSize(2));
+ }
+ if (glslangIntermediate->getStage() == EShLangMesh) {
builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputVertices,
glslangIntermediate->getVertices());
builder.addExecutionMode(shaderEntry, spv::ExecutionModeOutputPrimitivesNV,
@@ -1830,10 +1928,10 @@ TGlslangToSpvTraverser::TGlslangToSpvTraverser(unsigned int spvVersion,
std::vector<spv::Id> operandIds;
assert(!modeId.second.empty());
for (auto extraOperand : modeId.second) {
- int nextConst = 0;
- spv::Id operandId = createSpvConstantFromConstUnionArray(
- extraOperand->getType(), extraOperand->getConstArray(), nextConst, false);
- operandIds.push_back(operandId);
+ if (extraOperand->getType().getQualifier().isSpecConstant())
+ operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode()));
+ else
+ operandIds.push_back(createSpvConstant(*extraOperand));
}
builder.addExecutionModeId(shaderEntry, static_cast<spv::ExecutionMode>(modeId.first), operandIds);
}
@@ -1890,7 +1988,6 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol)
if (symbol->getType().getQualifier().isSpecConstant())
spec_constant_op_mode_setter.turnOnSpecConstantOpMode();
-
#ifdef ENABLE_HLSL
// Skip symbol handling if it is string-typed
if (symbol->getBasicType() == glslang::EbtString)
@@ -1901,6 +1998,9 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol)
// Formal function parameters were mapped during makeFunctions().
spv::Id id = getSymbolId(symbol);
+ if (symbol->getType().getQualifier().isTaskPayload())
+ taskPayloadID = id; // cache the taskPayloadID to be used it as operand for OpEmitMeshTasksEXT
+
if (builder.isPointer(id)) {
if (!symbol->getType().getQualifier().isParamInput() &&
!symbol->getType().getQualifier().isParamOutput()) {
@@ -2428,6 +2528,14 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
return false;
}
+ // Force variable declaration - Debug Mode Only
+ if (node->getOp() == glslang::EOpDeclare) {
+ builder.clearAccessChain();
+ node->getOperand()->traverse(this);
+ builder.clearAccessChain();
+ return false;
+ }
+
// Start by evaluating the operand
// Does it need a swizzle inversion? If so, evaluation is inverted;
@@ -2444,7 +2552,7 @@ bool TGlslangToSpvTraverser::visitUnary(glslang::TVisit /* visit */, glslang::TI
operandNode = node->getOperand()->getAsBinaryNode()->getLeft();
else
operandNode = node->getOperand();
-
+
operandNode->traverse(this);
spv::Id operand = spv::NoResult;
@@ -2688,32 +2796,38 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
spv::Decoration precision = TranslatePrecisionDecoration(node->getOperationPrecision());
switch (node->getOp()) {
+ case glslang::EOpScope:
case glslang::EOpSequence:
{
- if (preVisit)
+ if (visit == glslang::EvPreVisit) {
++sequenceDepth;
- else
- --sequenceDepth;
-
- if (sequenceDepth == 1) {
- // If this is the parent node of all the functions, we want to see them
- // early, so all call points have actual SPIR-V functions to reference.
- // In all cases, still let the traverser visit the children for us.
- makeFunctions(node->getAsAggregate()->getSequence());
+ if (sequenceDepth == 1) {
+ // If this is the parent node of all the functions, we want to see them
+ // early, so all call points have actual SPIR-V functions to reference.
+ // In all cases, still let the traverser visit the children for us.
+ makeFunctions(node->getAsAggregate()->getSequence());
- // Also, we want all globals initializers to go into the beginning of the entry point, before
- // anything else gets there, so visit out of order, doing them all now.
- makeGlobalInitializers(node->getAsAggregate()->getSequence());
+ // Also, we want all globals initializers to go into the beginning of the entry point, before
+ // anything else gets there, so visit out of order, doing them all now.
+ makeGlobalInitializers(node->getAsAggregate()->getSequence());
- //Pre process linker objects for ray tracing stages
- if (glslangIntermediate->isRayTracingStage())
- collectRayTracingLinkerObjects();
+ //Pre process linker objects for ray tracing stages
+ if (glslangIntermediate->isRayTracingStage())
+ collectRayTracingLinkerObjects();
- // Initializers are done, don't want to visit again, but functions and link objects need to be processed,
- // so do them manually.
- visitFunctions(node->getAsAggregate()->getSequence());
+ // Initializers are done, don't want to visit again, but functions and link objects need to be processed,
+ // so do them manually.
+ visitFunctions(node->getAsAggregate()->getSequence());
- return false;
+ return false;
+ } else {
+ if (node->getOp() == glslang::EOpScope)
+ builder.enterScope(0);
+ }
+ } else {
+ if (sequenceDepth > 1 && node->getOp() == glslang::EOpScope)
+ builder.leaveScope();
+ --sequenceDepth;
}
return true;
@@ -2742,10 +2856,17 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
if (isShaderEntryPoint(node)) {
inEntryPoint = true;
builder.setBuildPoint(shaderEntry->getLastBlock());
+ builder.enterFunction(shaderEntry);
currentFunction = shaderEntry;
} else {
handleFunctionEntry(node);
}
+ if (options.generateDebugInfo) {
+ const auto& loc = node->getLoc();
+ const char* sourceFileName = loc.getFilename();
+ spv::Id sourceFileId = sourceFileName ? builder.getStringId(sourceFileName) : builder.getSourceFile();
+ currentFunction->setDebugLineInfo(sourceFileId, loc.line, loc.column);
+ }
} else {
if (inEntryPoint)
entryPointTerminated = true;
@@ -2885,9 +3006,17 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
std::vector<spv::Id> arguments;
translateArguments(*node, arguments, lvalueCoherentFlags);
spv::Id constructed;
- if (node->getOp() == glslang::EOpConstructTextureSampler)
- constructed = builder.createOp(spv::OpSampledImage, resultType(), arguments);
- else if (node->getOp() == glslang::EOpConstructStruct ||
+ if (node->getOp() == glslang::EOpConstructTextureSampler) {
+ const glslang::TType& texType = node->getSequence()[0]->getAsTyped()->getType();
+ if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6 &&
+ texType.getSampler().isBuffer()) {
+ // SamplerBuffer is not supported in spirv1.6 so
+ // `samplerBuffer(textureBuffer, sampler)` is a no-op
+ // and textureBuffer is the result going forward
+ constructed = arguments[0];
+ } else
+ constructed = builder.createOp(spv::OpSampledImage, resultType(), arguments);
+ } else if (node->getOp() == glslang::EOpConstructStruct ||
node->getOp() == glslang::EOpConstructCooperativeMatrix ||
node->getType().isArray()) {
std::vector<spv::Id> constituents;
@@ -3027,6 +3156,8 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
case glslang::EOpExecuteCallableNV:
case glslang::EOpExecuteCallableKHR:
case glslang::EOpWritePackedPrimitiveIndices4x8NV:
+ case glslang::EOpEmitMeshTasksEXT:
+ case glslang::EOpSetMeshOutputsEXT:
noReturnValue = true;
break;
case glslang::EOpRayQueryInitialize:
@@ -3421,7 +3552,7 @@ bool TGlslangToSpvTraverser::visitAggregate(glslang::TVisit visit, glslang::TInt
break;
case 1:
{
- OpDecorations decorations = { precision,
+ OpDecorations decorations = { precision,
TranslateNoContractionDecoration(node->getType().getQualifier()),
TranslateNonUniformDecoration(node->getType().getQualifier()) };
result = createUnaryOperation(
@@ -3543,7 +3674,7 @@ bool TGlslangToSpvTraverser::visitSelection(glslang::TVisit /* visit */, glslang
// smear condition to vector, if necessary (AST is always scalar)
// Before 1.4, smear like for mix(), starting with 1.4, keep it scalar
if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_4 && builder.isVector(trueValue)) {
- condition = builder.smearScalar(spv::NoPrecision, condition,
+ condition = builder.smearScalar(spv::NoPrecision, condition,
builder.makeVectorType(builder.makeBoolType(),
builder.getNumComponents(trueValue)));
}
@@ -3714,8 +3845,8 @@ bool TGlslangToSpvTraverser::visitLoop(glslang::TVisit /* visit */, glslang::TIn
// by a block-ending branch. But we don't want to put any other body/test
// instructions in it, since the body/test may have arbitrary instructions,
// including merges of its own.
- builder.setLine(node->getLoc().line, node->getLoc().getFilename());
builder.setBuildPoint(&blocks.head);
+ builder.setLine(node->getLoc().line, node->getLoc().getFilename());
builder.createLoopMerge(&blocks.merge, &blocks.continue_target, control, operands);
if (node->testFirst() && node->getTest()) {
spv::Block& test = builder.makeNewBlock();
@@ -3777,7 +3908,16 @@ bool TGlslangToSpvTraverser::visitBranch(glslang::TVisit /* visit */, glslang::T
switch (node->getFlowOp()) {
case glslang::EOpKill:
- builder.makeStatementTerminator(spv::OpKill, "post-discard");
+ if (glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) {
+ if (glslangIntermediate->getSource() == glslang::EShSourceHlsl) {
+ builder.addCapability(spv::CapabilityDemoteToHelperInvocation);
+ builder.createNoResultOp(spv::OpDemoteToHelperInvocationEXT);
+ } else {
+ builder.makeStatementTerminator(spv::OpTerminateInvocation, "post-terminate-invocation");
+ }
+ } else {
+ builder.makeStatementTerminator(spv::OpKill, "post-discard");
+ }
break;
case glslang::EOpTerminateInvocation:
builder.addExtension(spv::E_SPV_KHR_terminate_invocation);
@@ -3925,7 +4065,7 @@ spv::Id TGlslangToSpvTraverser::createSpvVariable(const glslang::TIntermSymbol*
initializer = builder.makeNullConstant(spvType);
}
- return builder.createVariable(spv::NoPrecision, storageClass, spvType, name, initializer);
+ return builder.createVariable(spv::NoPrecision, storageClass, spvType, name, initializer, false);
}
// Return type Id of the sampled type.
@@ -4013,7 +4153,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
if (explicitLayout != glslang::ElpNone)
spvType = builder.makeUintType(32);
else
- spvType = builder.makeBoolType();
+ spvType = builder.makeBoolType(false);
break;
case glslang::EbtInt:
spvType = builder.makeIntType(32);
@@ -4113,8 +4253,10 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
spvType = builder.makeImageType(getSampledType(sampler), TranslateDimensionality(sampler),
sampler.isShadow(), sampler.isArrayed(), sampler.isMultiSample(),
sampler.isImageClass() ? 2 : 1, TranslateImageFormat(type));
- if (sampler.isCombined()) {
- // already has both image and sampler, make the combined type
+ if (sampler.isCombined() &&
+ (!sampler.isBuffer() || glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_6)) {
+ // Already has both image and sampler, make the combined type. Only combine sampler to
+ // buffer if before SPIR-V 1.6.
spvType = builder.makeSampledImageType(spvType);
}
}
@@ -4148,68 +4290,57 @@ spv::Id TGlslangToSpvTraverser::convertGlslangToSpvType(const glslang::TType& ty
const auto& spirvType = type.getSpirvType();
const auto& spirvInst = spirvType.spirvInst;
- std::vector<spv::Id> operands;
+ std::vector<spv::IdImmediate> operands;
for (const auto& typeParam : spirvType.typeParams) {
- if (typeParam.isConstant) {
- // Constant expression
- if (typeParam.constant->isLiteral()) {
- if (typeParam.constant->getBasicType() == glslang::EbtFloat) {
- float floatValue = static_cast<float>(typeParam.constant->getConstArray()[0].getDConst());
- unsigned literal = *reinterpret_cast<unsigned*>(&floatValue);
- operands.push_back(literal);
- } else if (typeParam.constant->getBasicType() == glslang::EbtInt) {
- unsigned literal = typeParam.constant->getConstArray()[0].getIConst();
- operands.push_back(literal);
- } else if (typeParam.constant->getBasicType() == glslang::EbtUint) {
- unsigned literal = typeParam.constant->getConstArray()[0].getUConst();
- operands.push_back(literal);
- } else if (typeParam.constant->getBasicType() == glslang::EbtBool) {
- unsigned literal = typeParam.constant->getConstArray()[0].getBConst();
- operands.push_back(literal);
- } else if (typeParam.constant->getBasicType() == glslang::EbtString) {
- auto str = typeParam.constant->getConstArray()[0].getSConst()->c_str();
- unsigned literal = 0;
- char* literalPtr = reinterpret_cast<char*>(&literal);
- unsigned charCount = 0;
- char ch = 0;
- do {
- ch = *(str++);
- *(literalPtr++) = ch;
- ++charCount;
- if (charCount == 4) {
- operands.push_back(literal);
- literalPtr = reinterpret_cast<char*>(&literal);
- charCount = 0;
- }
- } while (ch != 0);
-
- // Partial literal is padded with 0
- if (charCount > 0) {
- for (; charCount < 4; ++charCount)
- *(literalPtr++) = 0;
- operands.push_back(literal);
+ // Constant expression
+ if (typeParam.constant->isLiteral()) {
+ if (typeParam.constant->getBasicType() == glslang::EbtFloat) {
+ float floatValue = static_cast<float>(typeParam.constant->getConstArray()[0].getDConst());
+ unsigned literal;
+ static_assert(sizeof(literal) == sizeof(floatValue), "sizeof(unsigned) != sizeof(float)");
+ memcpy(&literal, &floatValue, sizeof(literal));
+ operands.push_back({false, literal});
+ } else if (typeParam.constant->getBasicType() == glslang::EbtInt) {
+ unsigned literal = typeParam.constant->getConstArray()[0].getIConst();
+ operands.push_back({false, literal});
+ } else if (typeParam.constant->getBasicType() == glslang::EbtUint) {
+ unsigned literal = typeParam.constant->getConstArray()[0].getUConst();
+ operands.push_back({false, literal});
+ } else if (typeParam.constant->getBasicType() == glslang::EbtBool) {
+ unsigned literal = typeParam.constant->getConstArray()[0].getBConst();
+ operands.push_back({false, literal});
+ } else if (typeParam.constant->getBasicType() == glslang::EbtString) {
+ auto str = typeParam.constant->getConstArray()[0].getSConst()->c_str();
+ unsigned literal = 0;
+ char* literalPtr = reinterpret_cast<char*>(&literal);
+ unsigned charCount = 0;
+ char ch = 0;
+ do {
+ ch = *(str++);
+ *(literalPtr++) = ch;
+ ++charCount;
+ if (charCount == 4) {
+ operands.push_back({false, literal});
+ literalPtr = reinterpret_cast<char*>(&literal);
+ charCount = 0;
}
- } else
- assert(0); // Unexpected type
- } else {
- int nextConst = 0;
- spv::Id constant = createSpvConstantFromConstUnionArray(
- typeParam.constant->getType(), typeParam.constant->getConstArray(), nextConst, false);
- operands.push_back(constant);
- }
- } else {
- // Type specifier
- spv::Id typeId = convertGlslangToSpvType(*typeParam.type);
- operands.push_back(typeId);
- }
- }
+ } while (ch != 0);
- if (spirvInst.set == "")
- spvType = builder.createOp(static_cast<spv::Op>(spirvInst.id), spv::NoType, operands);
- else {
- spvType = builder.createBuiltinCall(
- spv::NoType, getExtBuiltins(spirvInst.set.c_str()), spirvInst.id, operands);
+ // Partial literal is padded with 0
+ if (charCount > 0) {
+ for (; charCount < 4; ++charCount)
+ *(literalPtr++) = 0;
+ operands.push_back({false, literal});
+ }
+ } else
+ assert(0); // Unexpected type
+ } else
+ operands.push_back({true, createSpvConstant(*typeParam.constant)});
}
+
+ assert(spirvInst.set == ""); // Currently, couldn't be extended instructions.
+ spvType = builder.makeGenericType(static_cast<spv::Op>(spirvInst.id), operands);
+
break;
}
#endif
@@ -4312,7 +4443,7 @@ bool TGlslangToSpvTraverser::filterMember(const glslang::TType& member)
extensions.find("GL_NV_stereo_view_rendering") == extensions.end())
return true;
- if (glslangIntermediate->getStage() != EShLangMeshNV) {
+ if (glslangIntermediate->getStage() != EShLangMesh) {
if (member.getFieldName() == "gl_ViewportMask" &&
extensions.find("GL_NV_viewport_array2") == extensions.end())
return true;
@@ -4342,14 +4473,14 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy
// except sometimes for blocks
std::vector<std::pair<glslang::TType*, glslang::TQualifier> > deferredForwardPointers;
for (int i = 0; i < (int)glslangMembers->size(); i++) {
- glslang::TType& glslangMember = *(*glslangMembers)[i].type;
- if (glslangMember.hiddenMember()) {
+ auto& glslangMember = (*glslangMembers)[i];
+ if (glslangMember.type->hiddenMember()) {
++memberDelta;
if (type.getBasicType() == glslang::EbtBlock)
memberRemapper[glslangTypeToIdMap[glslangMembers]][i] = -1;
} else {
if (type.getBasicType() == glslang::EbtBlock) {
- if (filterMember(glslangMember)) {
+ if (filterMember(*glslangMember.type)) {
memberDelta++;
memberRemapper[glslangTypeToIdMap[glslangMembers]][i] = -1;
continue;
@@ -4357,7 +4488,7 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy
memberRemapper[glslangTypeToIdMap[glslangMembers]][i] = i - memberDelta;
}
// modify just this child's view of the qualifier
- glslang::TQualifier memberQualifier = glslangMember.getQualifier();
+ glslang::TQualifier memberQualifier = glslangMember.type->getQualifier();
InheritQualifiers(memberQualifier, qualifier);
// manually inherit location
@@ -4368,25 +4499,38 @@ spv::Id TGlslangToSpvTraverser::convertGlslangStructToSpvType(const glslang::TTy
bool lastBufferBlockMember = qualifier.storage == glslang::EvqBuffer &&
i == (int)glslangMembers->size() - 1;
- // Make forward pointers for any pointer members, and create a list of members to
- // convert to spirv types after creating the struct.
- if (glslangMember.isReference()) {
- if (forwardPointers.find(glslangMember.getReferentType()) == forwardPointers.end()) {
- deferredForwardPointers.push_back(std::make_pair(&glslangMember, memberQualifier));
- }
- spvMembers.push_back(
- convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier, lastBufferBlockMember,
- true));
- } else {
- spvMembers.push_back(
- convertGlslangToSpvType(glslangMember, explicitLayout, memberQualifier, lastBufferBlockMember,
- false));
+ // Make forward pointers for any pointer members.
+ if (glslangMember.type->isReference() &&
+ forwardPointers.find(glslangMember.type->getReferentType()) == forwardPointers.end()) {
+ deferredForwardPointers.push_back(std::make_pair(glslangMember.type, memberQualifier));
+ }
+
+ // Create the member type.
+ auto const spvMember = convertGlslangToSpvType(*glslangMember.type, explicitLayout, memberQualifier, lastBufferBlockMember,
+ glslangMember.type->isReference());
+ spvMembers.push_back(spvMember);
+
+ // Update the builder with the type's location so that we can create debug types for the structure members.
+ // There doesn't exist a "clean" entry point for this information to be passed along to the builder so, for now,
+ // it is stored in the builder and consumed during the construction of composite debug types.
+ // TODO: This probably warrants further investigation. This approach was decided to be the least ugly of the
+ // quick and dirty approaches that were tried.
+ // Advantages of this approach:
+ // + Relatively clean. No direct calls into debug type system.
+ // + Handles nested recursive structures.
+ // Disadvantages of this approach:
+ // + Not as clean as desired. Traverser queries/sets persistent state. This is fragile.
+ // + Table lookup during creation of composite debug types. This really shouldn't be necessary.
+ if(options.emitNonSemanticShaderDebugInfo) {
+ builder.debugTypeLocs[spvMember].name = glslangMember.type->getFieldName().c_str();
+ builder.debugTypeLocs[spvMember].line = glslangMember.loc.line;
+ builder.debugTypeLocs[spvMember].column = glslangMember.loc.column;
}
}
}
// Make the SPIR-V type
- spv::Id spvType = builder.makeStructType(spvMembers, type.getTypeName().c_str());
+ spv::Id spvType = builder.makeStructType(spvMembers, type.getTypeName().c_str(), false);
if (! HasNonLayoutQualifiers(type, qualifier))
structMap[explicitLayout][qualifier.layoutMatrix][glslangMembers] = spvType;
@@ -4595,6 +4739,16 @@ spv::Id TGlslangToSpvTraverser::accessChainLoad(const glslang::TType& type)
spv::Builder::AccessChain::CoherentFlags coherentFlags = builder.getAccessChain().coherentFlags;
coherentFlags |= TranslateCoherent(type);
+ spv::MemoryAccessMask accessMask = spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & ~spv::MemoryAccessMakePointerAvailableKHRMask);
+ // If the value being loaded is HelperInvocation, SPIR-V 1.6 is being generated (so that
+ // SPV_EXT_demote_to_helper_invocation is in core) and the memory model is in use, add
+ // the Volatile MemoryAccess semantic.
+ if (type.getQualifier().builtIn == glslang::EbvHelperInvocation &&
+ glslangIntermediate->usingVulkanMemoryModel() &&
+ glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) {
+ accessMask = spv::MemoryAccessMask(accessMask | spv::MemoryAccessVolatileMask);
+ }
+
unsigned int alignment = builder.getAccessChain().alignment;
alignment |= type.getBufferReferenceAlignment();
@@ -4602,7 +4756,7 @@ spv::Id TGlslangToSpvTraverser::accessChainLoad(const glslang::TType& type)
TranslateNonUniformDecoration(builder.getAccessChain().coherentFlags),
TranslateNonUniformDecoration(type.getQualifier()),
nominalTypeId,
- spv::MemoryAccessMask(TranslateMemoryAccess(coherentFlags) & ~spv::MemoryAccessMakePointerAvailableKHRMask),
+ accessMask,
TranslateMemoryScope(coherentFlags),
alignment);
@@ -4980,6 +5134,7 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF
// GLSL has copy-in/copy-out semantics. They can be handled though with a pointer to a copy.
std::vector<spv::Id> paramTypes;
+ std::vector<char const*> paramNames;
std::vector<std::vector<spv::Decoration>> paramDecorations; // list of decorations per parameter
glslang::TIntermSequence& parameters = glslFunction->getSequence()[0]->getAsAggregate()->getSequence();
@@ -5004,10 +5159,14 @@ void TGlslangToSpvTraverser::makeFunctions(const glslang::TIntermSequence& glslF
paramTypes.push_back(typeId);
}
+ for (auto const parameter:parameters) {
+ paramNames.push_back(parameter->getAsSymbolNode()->getName().c_str());
+ }
+
spv::Block* functionBlock;
spv::Function *function = builder.makeFunctionEntry(TranslatePrecisionDecoration(glslFunction->getType()),
convertGlslangToSpvType(glslFunction->getType()),
- glslFunction->getName().c_str(), paramTypes,
+ glslFunction->getName().c_str(), paramTypes, paramNames,
paramDecorations, &functionBlock);
if (implicitThis)
function->setImplicitThis();
@@ -5097,6 +5256,7 @@ void TGlslangToSpvTraverser::handleFunctionEntry(const glslang::TIntermAggregate
currentFunction = functionMap[node->getName().c_str()];
spv::Block* functionBlock = currentFunction->getEntryBlock();
builder.setBuildPoint(functionBlock);
+ builder.enterFunction(currentFunction);
}
void TGlslangToSpvTraverser::translateArguments(const glslang::TIntermAggregate& node, std::vector<spv::Id>& arguments,
@@ -5524,10 +5684,12 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
operands.push_back(sample);
spv::Id resultTypeId;
+ glslang::TBasicType typeProxy = node->getBasicType();
// imageAtomicStore has a void return type so base the pointer type on
// the type of the value operand.
if (node->getOp() == glslang::EOpImageAtomicStore) {
resultTypeId = builder.makePointer(spv::StorageClassImage, builder.getTypeId(*opIt));
+ typeProxy = node->getAsAggregate()->getSequence()[0]->getAsTyped()->getType().getSampler().type;
} else {
resultTypeId = builder.makePointer(spv::StorageClassImage, resultType());
}
@@ -5541,7 +5703,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
for (; opIt != arguments.end(); ++opIt)
operands.push_back(*opIt);
- return createAtomicOperation(node->getOp(), precision, resultType(), operands, node->getBasicType(),
+ return createAtomicOperation(node->getOp(), precision, resultType(), operands, typeProxy,
lvalueCoherentFlags);
}
}
@@ -5745,10 +5907,10 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
assert(builder.isStructType(resultStructType));
//resType (SPIR-V type) contains 6 elements:
- //Member 0 must be a Boolean type scalar(LOD),
- //Member 1 must be a vector of integer type, whose Signedness operand is 0(anchor),
- //Member 2 must be a vector of integer type, whose Signedness operand is 0(offset),
- //Member 3 must be a vector of integer type, whose Signedness operand is 0(mask),
+ //Member 0 must be a Boolean type scalar(LOD),
+ //Member 1 must be a vector of integer type, whose Signedness operand is 0(anchor),
+ //Member 2 must be a vector of integer type, whose Signedness operand is 0(offset),
+ //Member 3 must be a vector of integer type, whose Signedness operand is 0(mask),
//Member 4 must be a scalar of integer type, whose Signedness operand is 0(lod),
//Member 5 must be a scalar of integer type, whose Signedness operand is 0(granularity).
std::vector<spv::Id> members;
@@ -5761,7 +5923,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
//call ImageFootprintNV
spv::Id res = builder.createTextureCall(precision, resType, sparse, cracked.fetch, cracked.proj,
cracked.gather, noImplicitLod, params, signExtensionMask());
-
+
//copy resType (SPIR-V type) to resultStructType(OpenGL type)
for (int i = 0; i < 5; i++) {
builder.clearAccessChain();
@@ -5814,7 +5976,7 @@ spv::Id TGlslangToSpvTraverser::createImageTextureFunctionCall(glslang::TIntermO
}
#endif
- std::vector<spv::Id> result( 1,
+ std::vector<spv::Id> result( 1,
builder.createTextureCall(precision, resultType(), sparse, cracked.fetch, cracked.proj, cracked.gather,
noImplicitLod, params, signExtensionMask())
);
@@ -7337,7 +7499,7 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
} else {
scopeId = builder.makeUintConstant(spv::ScopeDevice);
}
- // semantics default to relaxed
+ // semantics default to relaxed
spv::Id semanticsId = builder.makeUintConstant(lvalueCoherentFlags.isVolatile() &&
glslangIntermediate->usingVulkanMemoryModel() ?
spv::MemorySemanticsVolatileMask :
@@ -8441,6 +8603,15 @@ spv::Id TGlslangToSpvTraverser::createMiscOperation(glslang::TOperator op, spv::
case glslang::EOpWritePackedPrimitiveIndices4x8NV:
builder.createNoResultOp(spv::OpWritePackedPrimitiveIndices4x8NV, operands);
return 0;
+ case glslang::EOpEmitMeshTasksEXT:
+ if (taskPayloadID)
+ operands.push_back(taskPayloadID);
+ // As per SPV_EXT_mesh_shader make it a terminating instruction in the current block
+ builder.makeStatementTerminator(spv::OpEmitMeshTasksEXT, operands, "post-OpEmitMeshTasksEXT");
+ return 0;
+ case glslang::EOpSetMeshOutputsEXT:
+ builder.createNoResultOp(spv::OpSetMeshOutputsEXT, operands);
+ return 0;
case glslang::EOpCooperativeMatrixMulAdd:
opCode = spv::OpCooperativeMatrixMulAddNV;
break;
@@ -8704,7 +8875,32 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
// it was not found, create it
spv::BuiltIn builtIn = TranslateBuiltInDecoration(symbol->getQualifier().builtIn, false);
auto forcedType = getForcedType(symbol->getQualifier().builtIn, symbol->getType());
+
+ // There are pairs of symbols that map to the same SPIR-V built-in:
+ // gl_ObjectToWorldEXT and gl_ObjectToWorld3x4EXT, and gl_WorldToObjectEXT
+ // and gl_WorldToObject3x4EXT. SPIR-V forbids having two OpVariables
+ // with the same BuiltIn in the same storage class, so we must re-use one.
+ const bool mayNeedToReuseBuiltIn =
+ builtIn == spv::BuiltInObjectToWorldKHR ||
+ builtIn == spv::BuiltInWorldToObjectKHR;
+
+ if (mayNeedToReuseBuiltIn) {
+ auto iter = builtInVariableIds.find(uint32_t(builtIn));
+ if (builtInVariableIds.end() != iter) {
+ id = iter->second;
+ symbolValues[symbol->getId()] = id;
+ if (forcedType.second != spv::NoType)
+ forceType[id] = forcedType.second;
+ return id;
+ }
+ }
+
id = createSpvVariable(symbol, forcedType.first);
+
+ if (mayNeedToReuseBuiltIn) {
+ builtInVariableIds.insert({uint32_t(builtIn), id});
+ }
+
symbolValues[symbol->getId()] = id;
if (forcedType.second != spv::NoType)
forceType[id] = forcedType.second;
@@ -8727,8 +8923,18 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
builder.addDecoration(id, spv::DecorationOffset, symbol->getQualifier().layoutOffset);
}
- if (symbol->getQualifier().hasLocation())
- builder.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation);
+ if (symbol->getQualifier().hasLocation()) {
+ if (!(glslangIntermediate->isRayTracingStage() && glslangIntermediate->IsRequestedExtension(glslang::E_GL_EXT_ray_tracing)
+ && (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.addDecoration(id, spv::DecorationLocation, symbol->getQualifier().layoutLocation);
+ }
+ }
+
builder.addDecoration(id, TranslateInvariantDecoration(symbol->getType().getQualifier()));
if (symbol->getQualifier().hasStream() && glslangIntermediate->isMultiStream()) {
builder.addCapability(spv::CapabilityGeometryStreams);
@@ -8762,7 +8968,17 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
// add built-in variable decoration
if (builtIn != spv::BuiltInMax) {
- builder.addDecoration(id, spv::DecorationBuiltIn, (int)builtIn);
+ // WorkgroupSize deprecated in spirv1.6
+ if (glslangIntermediate->getSpv().spv < glslang::EShTargetSpv_1_6 ||
+ builtIn != spv::BuiltInWorkgroupSize)
+ builder.addDecoration(id, spv::DecorationBuiltIn, (int)builtIn);
+ }
+
+ // Add volatile decoration to HelperInvocation for spirv1.6 and beyond
+ if (builtIn == spv::BuiltInHelperInvocation &&
+ !glslangIntermediate->usingVulkanMemoryModel() &&
+ glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_6) {
+ builder.addDecoration(id, spv::DecorationVolatile);
}
#ifndef GLSLANG_WEB
@@ -8814,6 +9030,12 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
builder.addExtension(spv::E_SPV_NV_fragment_shader_barycentric);
}
+ if (symbol->getQualifier().pervertexEXT) {
+ builder.addDecoration(id, spv::DecorationPerVertexKHR);
+ builder.addCapability(spv::CapabilityFragmentBarycentricKHR);
+ builder.addExtension(spv::E_SPV_KHR_fragment_shader_barycentric);
+ }
+
if (glslangIntermediate->getHlslFunctionality1() && symbol->getType().getQualifier().semanticName != nullptr) {
builder.addExtension("SPV_GOOGLE_hlsl_functionality1");
builder.addDecoration(id, (spv::Decoration)spv::DecorationHlslSemanticGOOGLE,
@@ -8847,12 +9069,12 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
std::vector<spv::Id> operandIds;
assert(!decorateId.second.empty());
for (auto extraOperand : decorateId.second) {
- int nextConst = 0;
- spv::Id operandId = createSpvConstantFromConstUnionArray(
- extraOperand->getType(), extraOperand->getConstArray(), nextConst, false);
- operandIds.push_back(operandId);
+ if (extraOperand->getQualifier().isSpecConstant())
+ operandIds.push_back(getSymbolId(extraOperand->getAsSymbolNode()));
+ else
+ operandIds.push_back(createSpvConstant(*extraOperand));
}
- builder.addDecoration(id, static_cast<spv::Decoration>(decorateId.first), operandIds);
+ builder.addDecorationId(id, static_cast<spv::Decoration>(decorateId.first), operandIds);
}
// Add spirv_decorate_string
@@ -8875,13 +9097,21 @@ spv::Id TGlslangToSpvTraverser::getSymbolId(const glslang::TIntermSymbol* symbol
// add per-primitive, per-view. per-task decorations to a struct member (member >= 0) or an object
void TGlslangToSpvTraverser::addMeshNVDecoration(spv::Id id, int member, const glslang::TQualifier& qualifier)
{
+ bool isMeshShaderExt = (glslangIntermediate->getRequestedExtensions().find(glslang::E_GL_EXT_mesh_shader) !=
+ glslangIntermediate->getRequestedExtensions().end());
+
if (member >= 0) {
if (qualifier.perPrimitiveNV) {
// Need to add capability/extension for fragment shader.
// Mesh shader already adds this by default.
if (glslangIntermediate->getStage() == EShLangFragment) {
- builder.addCapability(spv::CapabilityMeshShadingNV);
- builder.addExtension(spv::E_SPV_NV_mesh_shader);
+ if(isMeshShaderExt) {
+ builder.addCapability(spv::CapabilityMeshShadingEXT);
+ builder.addExtension(spv::E_SPV_EXT_mesh_shader);
+ } else {
+ builder.addCapability(spv::CapabilityMeshShadingNV);
+ builder.addExtension(spv::E_SPV_NV_mesh_shader);
+ }
}
builder.addMemberDecoration(id, (unsigned)member, spv::DecorationPerPrimitiveNV);
}
@@ -8894,8 +9124,13 @@ void TGlslangToSpvTraverser::addMeshNVDecoration(spv::Id id, int member, const g
// Need to add capability/extension for fragment shader.
// Mesh shader already adds this by default.
if (glslangIntermediate->getStage() == EShLangFragment) {
- builder.addCapability(spv::CapabilityMeshShadingNV);
- builder.addExtension(spv::E_SPV_NV_mesh_shader);
+ if(isMeshShaderExt) {
+ builder.addCapability(spv::CapabilityMeshShadingEXT);
+ builder.addExtension(spv::E_SPV_EXT_mesh_shader);
+ } else {
+ builder.addCapability(spv::CapabilityMeshShadingNV);
+ builder.addExtension(spv::E_SPV_NV_mesh_shader);
+ }
}
builder.addDecoration(id, spv::DecorationPerPrimitiveNV);
}
@@ -9035,15 +9270,19 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
break;
#ifndef GLSLANG_WEB
case glslang::EbtInt8:
+ builder.addCapability(spv::CapabilityInt8);
spvConsts.push_back(builder.makeInt8Constant(zero ? 0 : consts[nextConst].getI8Const()));
break;
case glslang::EbtUint8:
+ builder.addCapability(spv::CapabilityInt8);
spvConsts.push_back(builder.makeUint8Constant(zero ? 0 : consts[nextConst].getU8Const()));
break;
case glslang::EbtInt16:
+ builder.addCapability(spv::CapabilityInt16);
spvConsts.push_back(builder.makeInt16Constant(zero ? 0 : consts[nextConst].getI16Const()));
break;
case glslang::EbtUint16:
+ builder.addCapability(spv::CapabilityInt16);
spvConsts.push_back(builder.makeUint16Constant(zero ? 0 : consts[nextConst].getU16Const()));
break;
case glslang::EbtInt64:
@@ -9056,6 +9295,7 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
spvConsts.push_back(builder.makeDoubleConstant(zero ? 0.0 : consts[nextConst].getDConst()));
break;
case glslang::EbtFloat16:
+ builder.addCapability(spv::CapabilityFloat16);
spvConsts.push_back(builder.makeFloat16Constant(zero ? 0.0F : (float)consts[nextConst].getDConst()));
break;
#endif
@@ -9084,15 +9324,19 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
break;
#ifndef GLSLANG_WEB
case glslang::EbtInt8:
+ builder.addCapability(spv::CapabilityInt8);
scalar = builder.makeInt8Constant(zero ? 0 : consts[nextConst].getI8Const(), specConstant);
break;
case glslang::EbtUint8:
+ builder.addCapability(spv::CapabilityInt8);
scalar = builder.makeUint8Constant(zero ? 0 : consts[nextConst].getU8Const(), specConstant);
break;
case glslang::EbtInt16:
+ builder.addCapability(spv::CapabilityInt16);
scalar = builder.makeInt16Constant(zero ? 0 : consts[nextConst].getI16Const(), specConstant);
break;
case glslang::EbtUint16:
+ builder.addCapability(spv::CapabilityInt16);
scalar = builder.makeUint16Constant(zero ? 0 : consts[nextConst].getU16Const(), specConstant);
break;
case glslang::EbtInt64:
@@ -9105,6 +9349,7 @@ spv::Id TGlslangToSpvTraverser::createSpvConstantFromConstUnionArray(const glsla
scalar = builder.makeDoubleConstant(zero ? 0.0 : consts[nextConst].getDConst(), specConstant);
break;
case glslang::EbtFloat16:
+ builder.addCapability(spv::CapabilityFloat16);
scalar = builder.makeFloat16Constant(zero ? 0.0F : (float)consts[nextConst].getDConst(), specConstant);
break;
case glslang::EbtReference:
@@ -9302,7 +9547,8 @@ int GetSpirvGeneratorVersion()
// return 7; // GLSL volatile keyword maps to both SPIR-V decorations Volatile and Coherent
// return 8; // switch to new dead block eliminator; use OpUnreachable
// return 9; // don't include opaque function parameters in OpEntryPoint global's operand list
- return 10; // Generate OpFUnordNotEqual for != comparisons
+ // return 10; // Generate OpFUnordNotEqual for != comparisons
+ return 11; // Make OpEmitMeshTasksEXT a terminal instruction
}
// Write SPIR-V out to a binary file
@@ -9322,7 +9568,7 @@ void OutputSpvBin(const std::vector<unsigned int>& spirv, const char* baseName)
// Write SPIR-V out to a text file with 32-bit hexadecimal words
void OutputSpvHex(const std::vector<unsigned int>& spirv, const char* baseName, const char* varName)
{
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
std::ofstream out;
out.open(baseName, std::ios::binary | std::ios::out);
if (out.fail())
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/NonSemanticShaderDebugInfo100.h b/3rdparty/bgfx/3rdparty/glslang/SPIRV/NonSemanticShaderDebugInfo100.h
new file mode 100644
index 00000000000..c52f32f8090
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/NonSemanticShaderDebugInfo100.h
@@ -0,0 +1,171 @@
+// Copyright (c) 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.
+
+#ifndef SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_
+#define SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum {
+ NonSemanticShaderDebugInfo100Version = 100,
+ NonSemanticShaderDebugInfo100Version_BitWidthPadding = 0x7fffffff
+};
+enum {
+ NonSemanticShaderDebugInfo100Revision = 6,
+ NonSemanticShaderDebugInfo100Revision_BitWidthPadding = 0x7fffffff
+};
+
+enum NonSemanticShaderDebugInfo100Instructions {
+ NonSemanticShaderDebugInfo100DebugInfoNone = 0,
+ NonSemanticShaderDebugInfo100DebugCompilationUnit = 1,
+ NonSemanticShaderDebugInfo100DebugTypeBasic = 2,
+ NonSemanticShaderDebugInfo100DebugTypePointer = 3,
+ NonSemanticShaderDebugInfo100DebugTypeQualifier = 4,
+ NonSemanticShaderDebugInfo100DebugTypeArray = 5,
+ NonSemanticShaderDebugInfo100DebugTypeVector = 6,
+ NonSemanticShaderDebugInfo100DebugTypedef = 7,
+ NonSemanticShaderDebugInfo100DebugTypeFunction = 8,
+ NonSemanticShaderDebugInfo100DebugTypeEnum = 9,
+ NonSemanticShaderDebugInfo100DebugTypeComposite = 10,
+ NonSemanticShaderDebugInfo100DebugTypeMember = 11,
+ NonSemanticShaderDebugInfo100DebugTypeInheritance = 12,
+ NonSemanticShaderDebugInfo100DebugTypePtrToMember = 13,
+ NonSemanticShaderDebugInfo100DebugTypeTemplate = 14,
+ NonSemanticShaderDebugInfo100DebugTypeTemplateParameter = 15,
+ NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter = 16,
+ NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack = 17,
+ NonSemanticShaderDebugInfo100DebugGlobalVariable = 18,
+ NonSemanticShaderDebugInfo100DebugFunctionDeclaration = 19,
+ NonSemanticShaderDebugInfo100DebugFunction = 20,
+ NonSemanticShaderDebugInfo100DebugLexicalBlock = 21,
+ NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator = 22,
+ NonSemanticShaderDebugInfo100DebugScope = 23,
+ NonSemanticShaderDebugInfo100DebugNoScope = 24,
+ NonSemanticShaderDebugInfo100DebugInlinedAt = 25,
+ NonSemanticShaderDebugInfo100DebugLocalVariable = 26,
+ NonSemanticShaderDebugInfo100DebugInlinedVariable = 27,
+ NonSemanticShaderDebugInfo100DebugDeclare = 28,
+ NonSemanticShaderDebugInfo100DebugValue = 29,
+ NonSemanticShaderDebugInfo100DebugOperation = 30,
+ NonSemanticShaderDebugInfo100DebugExpression = 31,
+ NonSemanticShaderDebugInfo100DebugMacroDef = 32,
+ NonSemanticShaderDebugInfo100DebugMacroUndef = 33,
+ NonSemanticShaderDebugInfo100DebugImportedEntity = 34,
+ NonSemanticShaderDebugInfo100DebugSource = 35,
+ NonSemanticShaderDebugInfo100DebugFunctionDefinition = 101,
+ NonSemanticShaderDebugInfo100DebugSourceContinued = 102,
+ NonSemanticShaderDebugInfo100DebugLine = 103,
+ NonSemanticShaderDebugInfo100DebugNoLine = 104,
+ NonSemanticShaderDebugInfo100DebugBuildIdentifier = 105,
+ NonSemanticShaderDebugInfo100DebugStoragePath = 106,
+ NonSemanticShaderDebugInfo100DebugEntryPoint = 107,
+ NonSemanticShaderDebugInfo100DebugTypeMatrix = 108,
+ NonSemanticShaderDebugInfo100InstructionsMax = 0x7fffffff
+};
+
+
+enum NonSemanticShaderDebugInfo100DebugInfoFlags {
+ NonSemanticShaderDebugInfo100None = 0x0000,
+ NonSemanticShaderDebugInfo100FlagIsProtected = 0x01,
+ NonSemanticShaderDebugInfo100FlagIsPrivate = 0x02,
+ NonSemanticShaderDebugInfo100FlagIsPublic = 0x03,
+ NonSemanticShaderDebugInfo100FlagIsLocal = 0x04,
+ NonSemanticShaderDebugInfo100FlagIsDefinition = 0x08,
+ NonSemanticShaderDebugInfo100FlagFwdDecl = 0x10,
+ NonSemanticShaderDebugInfo100FlagArtificial = 0x20,
+ NonSemanticShaderDebugInfo100FlagExplicit = 0x40,
+ NonSemanticShaderDebugInfo100FlagPrototyped = 0x80,
+ NonSemanticShaderDebugInfo100FlagObjectPointer = 0x100,
+ NonSemanticShaderDebugInfo100FlagStaticMember = 0x200,
+ NonSemanticShaderDebugInfo100FlagIndirectVariable = 0x400,
+ NonSemanticShaderDebugInfo100FlagLValueReference = 0x800,
+ NonSemanticShaderDebugInfo100FlagRValueReference = 0x1000,
+ NonSemanticShaderDebugInfo100FlagIsOptimized = 0x2000,
+ NonSemanticShaderDebugInfo100FlagIsEnumClass = 0x4000,
+ NonSemanticShaderDebugInfo100FlagTypePassByValue = 0x8000,
+ NonSemanticShaderDebugInfo100FlagTypePassByReference = 0x10000,
+ NonSemanticShaderDebugInfo100FlagUnknownPhysicalLayout = 0x20000,
+ NonSemanticShaderDebugInfo100DebugInfoFlagsMax = 0x7fffffff
+};
+
+enum NonSemanticShaderDebugInfo100BuildIdentifierFlags {
+ NonSemanticShaderDebugInfo100IdentifierPossibleDuplicates = 0x01,
+ NonSemanticShaderDebugInfo100BuildIdentifierFlagsMax = 0x7fffffff
+};
+
+enum NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncoding {
+ NonSemanticShaderDebugInfo100Unspecified = 0,
+ NonSemanticShaderDebugInfo100Address = 1,
+ NonSemanticShaderDebugInfo100Boolean = 2,
+ NonSemanticShaderDebugInfo100Float = 3,
+ NonSemanticShaderDebugInfo100Signed = 4,
+ NonSemanticShaderDebugInfo100SignedChar = 5,
+ NonSemanticShaderDebugInfo100Unsigned = 6,
+ NonSemanticShaderDebugInfo100UnsignedChar = 7,
+ NonSemanticShaderDebugInfo100DebugBaseTypeAttributeEncodingMax = 0x7fffffff
+};
+
+enum NonSemanticShaderDebugInfo100DebugCompositeType {
+ NonSemanticShaderDebugInfo100Class = 0,
+ NonSemanticShaderDebugInfo100Structure = 1,
+ NonSemanticShaderDebugInfo100Union = 2,
+ NonSemanticShaderDebugInfo100DebugCompositeTypeMax = 0x7fffffff
+};
+
+enum NonSemanticShaderDebugInfo100DebugTypeQualifier {
+ NonSemanticShaderDebugInfo100ConstType = 0,
+ NonSemanticShaderDebugInfo100VolatileType = 1,
+ NonSemanticShaderDebugInfo100RestrictType = 2,
+ NonSemanticShaderDebugInfo100AtomicType = 3,
+ NonSemanticShaderDebugInfo100DebugTypeQualifierMax = 0x7fffffff
+};
+
+enum NonSemanticShaderDebugInfo100DebugOperation {
+ NonSemanticShaderDebugInfo100Deref = 0,
+ NonSemanticShaderDebugInfo100Plus = 1,
+ NonSemanticShaderDebugInfo100Minus = 2,
+ NonSemanticShaderDebugInfo100PlusUconst = 3,
+ NonSemanticShaderDebugInfo100BitPiece = 4,
+ NonSemanticShaderDebugInfo100Swap = 5,
+ NonSemanticShaderDebugInfo100Xderef = 6,
+ NonSemanticShaderDebugInfo100StackValue = 7,
+ NonSemanticShaderDebugInfo100Constu = 8,
+ NonSemanticShaderDebugInfo100Fragment = 9,
+ NonSemanticShaderDebugInfo100DebugOperationMax = 0x7fffffff
+};
+
+enum NonSemanticShaderDebugInfo100DebugImportedEntity {
+ NonSemanticShaderDebugInfo100ImportedModule = 0,
+ NonSemanticShaderDebugInfo100ImportedDeclaration = 1,
+ NonSemanticShaderDebugInfo100DebugImportedEntityMax = 0x7fffffff
+};
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // SPIRV_UNIFIED1_NonSemanticShaderDebugInfo100_H_
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.cpp b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.cpp
index 56d6d5d4a58..6aca8cbcf08 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.cpp
@@ -160,15 +160,29 @@ namespace spv {
}
// Is this an opcode we should remove when using --strip?
- bool spirvbin_t::isStripOp(spv::Op opCode) const
+ bool spirvbin_t::isStripOp(spv::Op opCode, unsigned start) const
{
switch (opCode) {
case spv::OpSource:
case spv::OpSourceExtension:
case spv::OpName:
case spv::OpMemberName:
- case spv::OpLine: return true;
- default: return false;
+ case spv::OpLine :
+ {
+ const std::string name = literalString(start + 2);
+
+ std::vector<std::string>::const_iterator it;
+ for (it = stripWhiteList.begin(); it < stripWhiteList.end(); it++)
+ {
+ if (name.find(*it) != std::string::npos) {
+ return false;
+ }
+ }
+
+ return true;
+ }
+ default :
+ return false;
}
}
@@ -297,15 +311,21 @@ namespace spv {
std::string spirvbin_t::literalString(unsigned word) const
{
std::string literal;
+ const spirword_t * pos = spv.data() + word;
literal.reserve(16);
- const char* bytes = reinterpret_cast<const char*>(spv.data() + word);
-
- while (bytes && *bytes)
- literal += *bytes++;
-
- return literal;
+ do {
+ spirword_t word = *pos;
+ for (int i = 0; i < 4; i++) {
+ char c = word & 0xff;
+ if (c == '\0')
+ return literal;
+ literal += c;
+ word >>= 8;
+ }
+ pos++;
+ } while (true);
}
void spirvbin_t::applyMap()
@@ -366,7 +386,7 @@ namespace spv {
process(
[&](spv::Op opCode, unsigned start) {
// remember opcodes we want to strip later
- if (isStripOp(opCode))
+ if (isStripOp(opCode, start))
stripInst(start);
return true;
},
@@ -1488,13 +1508,24 @@ namespace spv {
}
// remap from a memory image
- void spirvbin_t::remap(std::vector<std::uint32_t>& in_spv, std::uint32_t opts)
+ void spirvbin_t::remap(std::vector<std::uint32_t>& in_spv, const std::vector<std::string>& whiteListStrings,
+ std::uint32_t opts)
{
+ stripWhiteList = whiteListStrings;
spv.swap(in_spv);
remap(opts);
spv.swap(in_spv);
}
+ // remap from a memory image - legacy interface without white list
+ void spirvbin_t::remap(std::vector<std::uint32_t>& in_spv, std::uint32_t opts)
+ {
+ stripWhiteList.clear();
+ spv.swap(in_spv);
+ remap(opts);
+ spv.swap(in_spv);
+ }
+
} // namespace SPV
#endif // defined (use_cpp11)
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.h b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.h
index d6b9c346dd1..d21694635ac 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.h
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SPVRemapper.h
@@ -118,6 +118,10 @@ public:
virtual ~spirvbin_t() { }
// remap on an existing binary in memory
+ void remap(std::vector<std::uint32_t>& spv, const std::vector<std::string>& whiteListStrings,
+ std::uint32_t opts = DO_EVERYTHING);
+
+ // remap on an existing binary in memory - legacy interface without white list
void remap(std::vector<std::uint32_t>& spv, std::uint32_t opts = DO_EVERYTHING);
// Type for error/log handler functions
@@ -180,6 +184,8 @@ private:
unsigned typeSizeInWords(spv::Id id) const;
unsigned idTypeSizeInWords(spv::Id id) const;
+ bool isStripOp(spv::Op opCode, unsigned start) const;
+
spv::Id& asId(unsigned word) { return spv[word]; }
const spv::Id& asId(unsigned word) const { return spv[word]; }
spv::Op asOpCode(unsigned word) const { return opOpCode(spv[word]); }
@@ -249,6 +255,8 @@ private:
std::vector<spirword_t> spv; // SPIR words
+ std::vector<std::string> stripWhiteList;
+
namemap_t nameMap; // ID names from OpName
// Since we want to also do binary ops, we can't use std::vector<bool>. we could use
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.cpp b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.cpp
index e83306ebcbf..7c5ea874ba2 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.cpp
@@ -59,12 +59,15 @@ namespace spv {
Builder::Builder(unsigned int spvVersion, unsigned int magicNumber, SpvBuildLogger* buildLogger) :
spvVersion(spvVersion),
- source(SourceLanguageUnknown),
+ sourceLang(SourceLanguageUnknown),
sourceVersion(0),
sourceFileStringId(NoResult),
currentLine(0),
currentFile(nullptr),
+ currentFileId(NoResult),
+ lastDebugScopeId(NoResult),
emitOpLines(false),
+ emitNonSemanticShaderDebugInfo(false),
addressModel(AddressingModelLogical),
memoryModel(MemoryModelGLSL450),
builderNumber(magicNumber),
@@ -98,8 +101,12 @@ void Builder::setLine(int lineNum)
{
if (lineNum != 0 && lineNum != currentLine) {
currentLine = lineNum;
- if (emitOpLines)
- addLine(sourceFileStringId, currentLine, 0);
+ if (emitOpLines) {
+ if (emitNonSemanticShaderDebugInfo)
+ addDebugScopeAndLine(currentFileId, currentLine, 0);
+ else
+ addLine(sourceFileStringId, currentLine, 0);
+ }
}
}
@@ -118,7 +125,10 @@ void Builder::setLine(int lineNum, const char* filename)
currentFile = filename;
if (emitOpLines) {
spv::Id strId = getStringId(filename);
- addLine(strId, currentLine, 0);
+ if (emitNonSemanticShaderDebugInfo)
+ addDebugScopeAndLine(strId, currentLine, 0);
+ else
+ addLine(strId, currentLine, 0);
}
}
}
@@ -132,22 +142,49 @@ void Builder::addLine(Id fileName, int lineNum, int column)
buildPoint->addInstruction(std::unique_ptr<Instruction>(line));
}
+void Builder::addDebugScopeAndLine(Id fileName, int lineNum, int column)
+{
+ if (currentDebugScopeId.top() != lastDebugScopeId) {
+ spv::Id resultId = getUniqueId();
+ Instruction* scopeInst = new Instruction(resultId, makeVoidType(), OpExtInst);
+ scopeInst->addIdOperand(nonSemanticShaderDebugInfo);
+ scopeInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugScope);
+ scopeInst->addIdOperand(currentDebugScopeId.top());
+ buildPoint->addInstruction(std::unique_ptr<Instruction>(scopeInst));
+ lastDebugScopeId = currentDebugScopeId.top();
+ }
+ spv::Id resultId = getUniqueId();
+ Instruction* lineInst = new Instruction(resultId, makeVoidType(), OpExtInst);
+ lineInst->addIdOperand(nonSemanticShaderDebugInfo);
+ lineInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLine);
+ lineInst->addIdOperand(makeDebugSource(fileName));
+ lineInst->addIdOperand(makeUintConstant(lineNum));
+ lineInst->addIdOperand(makeUintConstant(lineNum));
+ lineInst->addIdOperand(makeUintConstant(column));
+ lineInst->addIdOperand(makeUintConstant(column));
+ buildPoint->addInstruction(std::unique_ptr<Instruction>(lineInst));
+}
+
// For creating new groupedTypes (will return old type if the requested one was already made).
Id Builder::makeVoidType()
{
Instruction* type;
if (groupedTypes[OpTypeVoid].size() == 0) {
- type = new Instruction(getUniqueId(), NoType, OpTypeVoid);
+ Id typeId = getUniqueId();
+ type = new Instruction(typeId, NoType, OpTypeVoid);
groupedTypes[OpTypeVoid].push_back(type);
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
+ // Core OpTypeVoid used for debug void type
+ if (emitNonSemanticShaderDebugInfo)
+ debugId[typeId] = typeId;
} else
type = groupedTypes[OpTypeVoid].back();
return type->getResultId();
}
-Id Builder::makeBoolType()
+Id Builder::makeBoolType(bool const compilerGenerated)
{
Instruction* type;
if (groupedTypes[OpTypeBool].size() == 0) {
@@ -158,6 +195,12 @@ Id Builder::makeBoolType()
} else
type = groupedTypes[OpTypeBool].back();
+ if (emitNonSemanticShaderDebugInfo && !compilerGenerated)
+ {
+ auto const debugResultId = makeBoolDebugType(32);
+ debugId[type->getResultId()] = debugResultId;
+ }
+
return type->getResultId();
}
@@ -172,6 +215,12 @@ Id Builder::makeSamplerType()
} else
type = groupedTypes[OpTypeSampler].back();
+ if (emitNonSemanticShaderDebugInfo)
+ {
+ auto const debugResultId = makeCompositeDebugType({}, "type.sampler", NonSemanticShaderDebugInfo100Structure, true);
+ debugId[type->getResultId()] = debugResultId;
+ }
+
return type->getResultId();
}
@@ -268,6 +317,12 @@ Id Builder::makeIntegerType(int width, bool hasSign)
break;
}
+ if (emitNonSemanticShaderDebugInfo)
+ {
+ auto const debugResultId = makeIntegerDebugType(width, hasSign);
+ debugId[type->getResultId()] = debugResultId;
+ }
+
return type->getResultId();
}
@@ -305,6 +360,12 @@ Id Builder::makeFloatType(int width)
break;
}
+ if (emitNonSemanticShaderDebugInfo)
+ {
+ auto const debugResultId = makeFloatDebugType(width);
+ debugId[type->getResultId()] = debugResultId;
+ }
+
return type->getResultId();
}
@@ -312,7 +373,7 @@ Id Builder::makeFloatType(int width)
// See makeStructResultType() for non-decorated structs
// needed as the result of some instructions, which does
// check for duplicates.
-Id Builder::makeStructType(const std::vector<Id>& members, const char* name)
+Id Builder::makeStructType(const std::vector<Id>& members, const char* name, bool const compilerGenerated)
{
// Don't look for previous one, because in the general case,
// structs can be duplicated except for decorations.
@@ -326,6 +387,12 @@ Id Builder::makeStructType(const std::vector<Id>& members, const char* name)
module.mapInstruction(type);
addName(type->getResultId(), name);
+ if (emitNonSemanticShaderDebugInfo && !compilerGenerated)
+ {
+ auto const debugResultId = makeCompositeDebugType(members, name, NonSemanticShaderDebugInfo100Structure);
+ debugId[type->getResultId()] = debugResultId;
+ }
+
return type->getResultId();
}
@@ -372,6 +439,12 @@ Id Builder::makeVectorType(Id component, int size)
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
+ if (emitNonSemanticShaderDebugInfo)
+ {
+ auto const debugResultId = makeVectorDebugType(component, size);
+ debugId[type->getResultId()] = debugResultId;
+ }
+
return type->getResultId();
}
@@ -398,6 +471,12 @@ Id Builder::makeMatrixType(Id component, int cols, int rows)
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
+ if (emitNonSemanticShaderDebugInfo)
+ {
+ auto const debugResultId = makeMatrixDebugType(column, cols);
+ debugId[type->getResultId()] = debugResultId;
+ }
+
return type->getResultId();
}
@@ -427,6 +506,37 @@ Id Builder::makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols)
return type->getResultId();
}
+Id Builder::makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands)
+{
+ // try to find it
+ Instruction* type;
+ for (int t = 0; t < (int)groupedTypes[opcode].size(); ++t) {
+ type = groupedTypes[opcode][t];
+ if (static_cast<size_t>(type->getNumOperands()) != operands.size())
+ continue; // Number mismatch, find next
+
+ bool match = true;
+ for (int op = 0; match && op < (int)operands.size(); ++op) {
+ match = (operands[op].isId ? type->getIdOperand(op) : type->getImmediateOperand(op)) == operands[op].word;
+ }
+ if (match)
+ return type->getResultId();
+ }
+
+ // not found, make it
+ type = new Instruction(getUniqueId(), NoType, opcode);
+ for (size_t op = 0; op < operands.size(); ++op) {
+ if (operands[op].isId)
+ type->addIdOperand(operands[op].word);
+ else
+ type->addImmediateOperand(operands[op].word);
+ }
+ groupedTypes[opcode].push_back(type);
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
+ module.mapInstruction(type);
+
+ return type->getResultId();
+}
// TODO: performance: track arrays per stride
// If a stride is supplied (non-zero) make an array.
@@ -453,6 +563,12 @@ Id Builder::makeArrayType(Id element, Id sizeId, int stride)
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
+ if (emitNonSemanticShaderDebugInfo)
+ {
+ auto const debugResultId = makeArrayDebugType(element, sizeId);
+ debugId[type->getResultId()] = debugResultId;
+ }
+
return type->getResultId();
}
@@ -463,6 +579,12 @@ Id Builder::makeRuntimeArray(Id element)
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
+ if (emitNonSemanticShaderDebugInfo)
+ {
+ auto const debugResultId = makeArrayDebugType(element, makeUintConstant(0));
+ debugId[type->getResultId()] = debugResultId;
+ }
+
return type->getResultId();
}
@@ -482,11 +604,25 @@ Id Builder::makeFunctionType(Id returnType, const std::vector<Id>& paramTypes)
}
}
if (! mismatch)
+ {
+ // If compiling HLSL, glslang will create a wrapper function around the entrypoint. Accordingly, a void(void)
+ // function type is created for the wrapper function. However, nonsemantic shader debug information is disabled
+ // while creating the HLSL wrapper. Consequently, if we encounter another void(void) function, we need to create
+ // the associated debug function type if it hasn't been created yet.
+ if(emitNonSemanticShaderDebugInfo && debugId[type->getResultId()] == 0) {
+ assert(sourceLang == spv::SourceLanguageHLSL);
+ assert(getTypeClass(returnType) == OpTypeVoid && paramTypes.size() == 0);
+
+ Id debugTypeId = makeDebugFunctionType(returnType, {});
+ debugId[type->getResultId()] = debugTypeId;
+ }
return type->getResultId();
+ }
}
// not found, make it
- type = new Instruction(getUniqueId(), NoType, OpTypeFunction);
+ Id typeId = getUniqueId();
+ type = new Instruction(typeId, NoType, OpTypeFunction);
type->addIdOperand(returnType);
for (int p = 0; p < (int)paramTypes.size(); ++p)
type->addIdOperand(paramTypes[p]);
@@ -494,9 +630,34 @@ Id Builder::makeFunctionType(Id returnType, const std::vector<Id>& paramTypes)
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
+ // make debug type and map it
+ if (emitNonSemanticShaderDebugInfo) {
+ Id debugTypeId = makeDebugFunctionType(returnType, paramTypes);
+ debugId[typeId] = debugTypeId;
+ }
+
return type->getResultId();
}
+Id Builder::makeDebugFunctionType(Id returnType, const std::vector<Id>& paramTypes)
+{
+ assert(debugId[returnType] != 0);
+
+ Id typeId = getUniqueId();
+ auto type = new Instruction(typeId, makeVoidType(), OpExtInst);
+ type->addIdOperand(nonSemanticShaderDebugInfo);
+ type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeFunction);
+ type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic));
+ type->addIdOperand(debugId[returnType]);
+ for (auto const paramType : paramTypes) {
+ assert(isPointerType(paramType) || isArrayType(paramType));
+ type->addIdOperand(debugId[getContainedTypeId(paramType)]);
+ }
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
+ module.mapInstruction(type);
+ return typeId;
+}
+
Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, bool ms, unsigned sampled,
ImageFormat format)
{
@@ -578,6 +739,22 @@ Id Builder::makeImageType(Id sampledType, Dim dim, bool depth, bool arrayed, boo
}
#endif
+ if (emitNonSemanticShaderDebugInfo)
+ {
+ auto TypeName = [&dim]() -> char const* {
+ switch (dim) {
+ case Dim1D: return "type.1d.image";
+ case Dim2D: return "type.2d.image";
+ case Dim3D: return "type.3d.image";
+ case DimCube: return "type.cube.image";
+ default: return "type.image";
+ }
+ };
+
+ auto const debugResultId = makeCompositeDebugType({}, TypeName(), NonSemanticShaderDebugInfo100Class, true);
+ debugId[type->getResultId()] = debugResultId;
+ }
+
return type->getResultId();
}
@@ -599,9 +776,376 @@ Id Builder::makeSampledImageType(Id imageType)
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
module.mapInstruction(type);
+ if (emitNonSemanticShaderDebugInfo)
+ {
+ auto const debugResultId = makeCompositeDebugType({}, "type.sampled.image", NonSemanticShaderDebugInfo100Class, true);
+ debugId[type->getResultId()] = debugResultId;
+ }
+
+ return type->getResultId();
+}
+
+Id Builder::makeDebugInfoNone()
+{
+ if (debugInfoNone != 0)
+ return debugInfoNone;
+
+ Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
+ inst->addIdOperand(nonSemanticShaderDebugInfo);
+ inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugInfoNone);
+
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(inst));
+ module.mapInstruction(inst);
+
+ debugInfoNone = inst->getResultId();
+
+ return debugInfoNone;
+}
+
+Id Builder::makeBoolDebugType(int const size)
+{
+ // try to find it
+ Instruction* type;
+ for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) {
+ type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t];
+ if (type->getIdOperand(0) == getStringId("bool") &&
+ type->getIdOperand(1) == static_cast<unsigned int>(size) &&
+ type->getIdOperand(2) == NonSemanticShaderDebugInfo100Boolean)
+ return type->getResultId();
+ }
+
+ type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
+ type->addIdOperand(nonSemanticShaderDebugInfo);
+ type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic);
+
+ type->addIdOperand(getStringId("bool")); // name id
+ type->addIdOperand(makeUintConstant(size)); // size id
+ type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Boolean)); // encoding id
+ type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id
+
+ groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].push_back(type);
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
+ module.mapInstruction(type);
+
+ return type->getResultId();
+}
+
+Id Builder::makeIntegerDebugType(int const width, bool const hasSign)
+{
+ // try to find it
+ Instruction* type;
+ for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) {
+ type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t];
+ if (type->getIdOperand(0) == (hasSign ? getStringId("int") : getStringId("uint")) &&
+ type->getIdOperand(1) == static_cast<unsigned int>(width) &&
+ type->getIdOperand(2) == (hasSign ? NonSemanticShaderDebugInfo100Signed : NonSemanticShaderDebugInfo100Unsigned))
+ return type->getResultId();
+ }
+
+ // not found, make it
+ type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
+ type->addIdOperand(nonSemanticShaderDebugInfo);
+ type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic);
+ if(hasSign == true) {
+ type->addIdOperand(getStringId("int")); // name id
+ } else {
+ type->addIdOperand(getStringId("uint")); // name id
+ }
+ type->addIdOperand(makeUintConstant(width)); // size id
+ if(hasSign == true) {
+ type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Signed)); // encoding id
+ } else {
+ type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Unsigned)); // encoding id
+ }
+ type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id
+
+ groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].push_back(type);
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
+ module.mapInstruction(type);
+
+ return type->getResultId();
+}
+
+Id Builder::makeFloatDebugType(int const width)
+{
+ // try to find it
+ Instruction* type;
+ for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].size(); ++t) {
+ type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic][t];
+ if (type->getIdOperand(0) == getStringId("float") &&
+ type->getIdOperand(1) == static_cast<unsigned int>(width) &&
+ type->getIdOperand(2) == NonSemanticShaderDebugInfo100Float)
+ return type->getResultId();
+ }
+
+ // not found, make it
+ type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
+ type->addIdOperand(nonSemanticShaderDebugInfo);
+ type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeBasic);
+ type->addIdOperand(getStringId("float")); // name id
+ type->addIdOperand(makeUintConstant(width)); // size id
+ type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100Float)); // encoding id
+ type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100None)); // flags id
+
+ groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeBasic].push_back(type);
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
+ module.mapInstruction(type);
+
+ return type->getResultId();
+}
+
+Id Builder::makeSequentialDebugType(Id const baseType, Id const componentCount, NonSemanticShaderDebugInfo100Instructions const sequenceType)
+{
+ assert(sequenceType == NonSemanticShaderDebugInfo100DebugTypeArray ||
+ sequenceType == NonSemanticShaderDebugInfo100DebugTypeVector);
+
+ // try to find it
+ Instruction* type;
+ for (int t = 0; t < (int)groupedDebugTypes[sequenceType].size(); ++t) {
+ type = groupedDebugTypes[sequenceType][t];
+ if (type->getIdOperand(0) == baseType &&
+ type->getIdOperand(1) == makeUintConstant(componentCount))
+ return type->getResultId();
+ }
+
+ // not found, make it
+ type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
+ type->addIdOperand(nonSemanticShaderDebugInfo);
+ type->addImmediateOperand(sequenceType);
+ type->addIdOperand(debugId[baseType]); // base type
+ type->addIdOperand(componentCount); // component count
+
+ groupedDebugTypes[sequenceType].push_back(type);
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
+ module.mapInstruction(type);
+
+ return type->getResultId();
+}
+
+Id Builder::makeArrayDebugType(Id const baseType, Id const componentCount)
+{
+ return makeSequentialDebugType(baseType, componentCount, NonSemanticShaderDebugInfo100DebugTypeArray);
+}
+
+Id Builder::makeVectorDebugType(Id const baseType, int const componentCount)
+{
+ return makeSequentialDebugType(baseType, makeUintConstant(componentCount), NonSemanticShaderDebugInfo100DebugTypeVector);;
+}
+
+Id Builder::makeMatrixDebugType(Id const vectorType, int const vectorCount, bool columnMajor)
+{
+ // try to find it
+ Instruction* type;
+ for (int t = 0; t < (int)groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMatrix].size(); ++t) {
+ type = groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMatrix][t];
+ if (type->getIdOperand(0) == vectorType &&
+ type->getIdOperand(1) == makeUintConstant(vectorCount))
+ return type->getResultId();
+ }
+
+ // not found, make it
+ type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
+ type->addIdOperand(nonSemanticShaderDebugInfo);
+ type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeMatrix);
+ type->addIdOperand(debugId[vectorType]); // vector type id
+ type->addIdOperand(makeUintConstant(vectorCount)); // component count id
+ type->addIdOperand(makeBoolConstant(columnMajor)); // column-major id
+
+ groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMatrix].push_back(type);
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
+ module.mapInstruction(type);
+
return type->getResultId();
}
+Id Builder::makeMemberDebugType(Id const memberType, DebugTypeLoc const& debugTypeLoc)
+{
+ assert(debugId[memberType] != 0);
+
+ Instruction* type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
+ type->addIdOperand(nonSemanticShaderDebugInfo);
+ type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeMember);
+ type->addIdOperand(getStringId(debugTypeLoc.name)); // name id
+ type->addIdOperand(debugId[memberType]); // type id
+ type->addIdOperand(makeDebugSource(sourceFileStringId)); // source id TODO: verify this works across include directives
+ type->addIdOperand(makeUintConstant(debugTypeLoc.line)); // line id TODO: currentLine is always zero
+ type->addIdOperand(makeUintConstant(debugTypeLoc.column)); // TODO: column id
+ type->addIdOperand(makeUintConstant(0)); // TODO: offset id
+ type->addIdOperand(makeUintConstant(0)); // TODO: size id
+ type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); // flags id
+
+ groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeMember].push_back(type);
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
+ module.mapInstruction(type);
+
+ return type->getResultId();
+}
+
+// Note: To represent a source language opaque type, this instruction must have no Members operands, Size operand must be
+// DebugInfoNone, and Name must start with @ to avoid clashes with user defined names.
+Id Builder::makeCompositeDebugType(std::vector<Id> const& memberTypes, char const*const name,
+ NonSemanticShaderDebugInfo100DebugCompositeType const tag, bool const isOpaqueType)
+{
+ // Create the debug member types.
+ std::vector<Id> memberDebugTypes;
+ for(auto const memberType : memberTypes) {
+ assert(debugTypeLocs.find(memberType) != debugTypeLocs.end());
+
+ memberDebugTypes.emplace_back(makeMemberDebugType(memberType, debugTypeLocs[memberType]));
+
+ // TODO: Need to rethink this method of passing location information.
+ // debugTypeLocs.erase(memberType);
+ }
+
+ // Create The structure debug type.
+ Instruction* type = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
+ type->addIdOperand(nonSemanticShaderDebugInfo);
+ type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugTypeComposite);
+ type->addIdOperand(getStringId(name)); // name id
+ type->addIdOperand(makeUintConstant(tag)); // tag id
+ type->addIdOperand(makeDebugSource(sourceFileStringId)); // source id TODO: verify this works across include directives
+ type->addIdOperand(makeUintConstant(currentLine)); // line id TODO: currentLine always zero?
+ type->addIdOperand(makeUintConstant(0)); // TODO: column id
+ type->addIdOperand(makeDebugCompilationUnit()); // scope id
+ if(isOpaqueType == true) {
+ // Prepend '@' to opaque types.
+ type->addIdOperand(getStringId('@' + std::string(name))); // linkage name id
+ type->addIdOperand(makeDebugInfoNone()); // size id
+ } else {
+ type->addIdOperand(getStringId(name)); // linkage name id
+ type->addIdOperand(makeUintConstant(0)); // TODO: size id
+ }
+ type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic)); // flags id
+ assert(isOpaqueType == false || (isOpaqueType == true && memberDebugTypes.empty()));
+ for(auto const memberDebugType : memberDebugTypes) {
+ type->addIdOperand(memberDebugType);
+ }
+
+ groupedDebugTypes[NonSemanticShaderDebugInfo100DebugTypeComposite].push_back(type);
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
+ module.mapInstruction(type);
+
+ return type->getResultId();
+}
+
+Id Builder::makeDebugSource(const Id fileName) {
+ if (debugSourceId.find(fileName) != debugSourceId.end())
+ return debugSourceId[fileName];
+ spv::Id resultId = getUniqueId();
+ Instruction* sourceInst = new Instruction(resultId, makeVoidType(), OpExtInst);
+ sourceInst->addIdOperand(nonSemanticShaderDebugInfo);
+ sourceInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugSource);
+ sourceInst->addIdOperand(fileName);
+ if (emitNonSemanticShaderDebugSource) {
+ spv::Id sourceId = 0;
+ if (fileName == sourceFileStringId) {
+ sourceId = getStringId(sourceText);
+ } else {
+ auto incItr = includeFiles.find(fileName);
+ assert(incItr != includeFiles.end());
+ sourceId = getStringId(*incItr->second);
+ }
+ sourceInst->addIdOperand(sourceId);
+ }
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(sourceInst));
+ module.mapInstruction(sourceInst);
+ debugSourceId[fileName] = resultId;
+ return resultId;
+}
+
+Id Builder::makeDebugCompilationUnit() {
+ if (nonSemanticShaderCompilationUnitId != 0)
+ return nonSemanticShaderCompilationUnitId;
+ spv::Id resultId = getUniqueId();
+ Instruction* sourceInst = new Instruction(resultId, makeVoidType(), OpExtInst);
+ sourceInst->addIdOperand(nonSemanticShaderDebugInfo);
+ sourceInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugCompilationUnit);
+ sourceInst->addIdOperand(makeUintConstant(1)); // TODO(greg-lunarg): Get rid of magic number
+ sourceInst->addIdOperand(makeUintConstant(4)); // TODO(greg-lunarg): Get rid of magic number
+ sourceInst->addIdOperand(makeDebugSource(sourceFileStringId));
+ sourceInst->addIdOperand(makeUintConstant(sourceLang));
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(sourceInst));
+ module.mapInstruction(sourceInst);
+ nonSemanticShaderCompilationUnitId = resultId;
+ return resultId;
+}
+
+Id Builder::createDebugGlobalVariable(Id const type, char const*const name, Id const variable)
+{
+ assert(type != 0);
+
+ Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
+ inst->addIdOperand(nonSemanticShaderDebugInfo);
+ inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugGlobalVariable);
+ inst->addIdOperand(getStringId(name)); // name id
+ inst->addIdOperand(type); // type id
+ inst->addIdOperand(makeDebugSource(sourceFileStringId)); // source id
+ inst->addIdOperand(makeUintConstant(currentLine)); // line id TODO: currentLine always zero?
+ inst->addIdOperand(makeUintConstant(0)); // TODO: column id
+ inst->addIdOperand(makeDebugCompilationUnit()); // scope id
+ inst->addIdOperand(getStringId(name)); // linkage name id
+ inst->addIdOperand(variable); // variable id
+ inst->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsDefinition)); // flags id
+
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(inst));
+ module.mapInstruction(inst);
+
+ return inst->getResultId();
+}
+
+Id Builder::createDebugLocalVariable(Id type, char const*const name, size_t const argNumber)
+{
+ assert(name != nullptr);
+ Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
+ inst->addIdOperand(nonSemanticShaderDebugInfo);
+ inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLocalVariable);
+ inst->addIdOperand(getStringId(name)); // name id
+ inst->addIdOperand(type); // type id
+ inst->addIdOperand(makeDebugSource(sourceFileStringId)); // source id
+ inst->addIdOperand(makeUintConstant(currentLine)); // line id
+ inst->addIdOperand(makeUintConstant(0)); // TODO: column id
+ inst->addIdOperand(currentDebugScopeId.top()); // scope id
+ inst->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsLocal)); // flags id
+ if(argNumber != 0) {
+ inst->addIdOperand(makeUintConstant(argNumber));
+ }
+
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(inst));
+ module.mapInstruction(inst);
+
+ return inst->getResultId();
+}
+
+Id Builder::makeDebugExpression()
+{
+ if (debugExpression != 0)
+ return debugExpression;
+
+ Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
+ inst->addIdOperand(nonSemanticShaderDebugInfo);
+ inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugExpression);
+
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(inst));
+ module.mapInstruction(inst);
+
+ debugExpression = inst->getResultId();
+
+ return debugExpression;
+}
+
+Id Builder::makeDebugDeclare(Id const debugLocalVariable, Id const localVariable)
+{
+ Instruction* inst = new Instruction(getUniqueId(), makeVoidType(), OpExtInst);
+ inst->addIdOperand(nonSemanticShaderDebugInfo);
+ inst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugDeclare);
+ inst->addIdOperand(debugLocalVariable); // debug local variable id
+ inst->addIdOperand(localVariable); // local variable id
+ inst->addIdOperand(makeDebugExpression()); // expression id
+ buildPoint->addInstruction(std::unique_ptr<Instruction>(inst));
+
+ return inst->getResultId();
+}
+
#ifndef GLSLANG_WEB
Id Builder::makeAccelerationStructureType()
{
@@ -889,6 +1433,17 @@ bool Builder::isSpecConstantOpCode(Op opcode) const
}
}
+bool Builder::isRayTracingOpCode(Op opcode) const
+{
+ switch (opcode) {
+ case OpTypeAccelerationStructureKHR:
+ case OpTypeRayQueryKHR:
+ return true;
+ default:
+ return false;
+ }
+}
+
Id Builder::makeNullConstant(Id typeId)
{
Instruction* constant;
@@ -1105,6 +1660,19 @@ Id Builder::makeFpConstant(Id type, double d, bool specConstant)
return NoResult;
}
+Id Builder::importNonSemanticShaderDebugInfoInstructions()
+{
+ assert(emitNonSemanticShaderDebugInfo == true);
+
+ if(nonSemanticShaderDebugInfo == 0)
+ {
+ this->addExtension(spv::E_SPV_KHR_non_semantic_info);
+ nonSemanticShaderDebugInfo = this->import("NonSemantic.Shader.DebugInfo.100");
+ }
+
+ return nonSemanticShaderDebugInfo;
+}
+
Id Builder::findCompositeConstant(Op typeClass, Id typeId, const std::vector<Id>& comps)
{
Instruction* constant = 0;
@@ -1416,23 +1984,34 @@ Function* Builder::makeEntryPoint(const char* entryPoint)
assert(! entryPointFunction);
Block* entry;
- std::vector<Id> params;
+ std::vector<Id> paramsTypes;
+ std::vector<char const*> paramNames;
std::vector<std::vector<Decoration>> decorations;
- entryPointFunction = makeFunctionEntry(NoPrecision, makeVoidType(), entryPoint, params, decorations, &entry);
+ auto const returnType = makeVoidType();
+
+ restoreNonSemanticShaderDebugInfo = emitNonSemanticShaderDebugInfo;
+ if(sourceLang == spv::SourceLanguageHLSL) {
+ emitNonSemanticShaderDebugInfo = false;
+ }
+
+ entryPointFunction = makeFunctionEntry(NoPrecision, returnType, entryPoint, paramsTypes, paramNames, decorations, &entry);
+
+ emitNonSemanticShaderDebugInfo = restoreNonSemanticShaderDebugInfo;
return entryPointFunction;
}
// Comments in header
Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const char* name,
- const std::vector<Id>& paramTypes,
+ const std::vector<Id>& paramTypes, const std::vector<char const*>& paramNames,
const std::vector<std::vector<Decoration>>& decorations, Block **entry)
{
// Make the function and initial instructions in it
Id typeId = makeFunctionType(returnType, paramTypes);
Id firstParamId = paramTypes.size() == 0 ? 0 : getUniqueIds((int)paramTypes.size());
- Function* function = new Function(getUniqueId(), returnType, typeId, firstParamId, module);
+ Id funcId = getUniqueId();
+ Function* function = new Function(funcId, returnType, typeId, firstParamId, module);
// Set up the precisions
setPrecision(function->getId(), precision);
@@ -1444,11 +2023,39 @@ Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const
}
}
+ // Make the debug function instruction
+ if (emitNonSemanticShaderDebugInfo) {
+ Id nameId = getStringId(unmangleFunctionName(name));
+ Id debugFuncId = makeDebugFunction(function, nameId, typeId);
+ debugId[funcId] = debugFuncId;
+ currentDebugScopeId.push(debugFuncId);
+ lastDebugScopeId = NoResult;
+ }
+
// CFG
- if (entry) {
- *entry = new Block(getUniqueId(), *function);
- function->addBlock(*entry);
- setBuildPoint(*entry);
+ assert(entry != nullptr);
+ *entry = new Block(getUniqueId(), *function);
+ function->addBlock(*entry);
+ setBuildPoint(*entry);
+
+ // DebugScope and DebugLine for parameter DebugDeclares
+ if (emitNonSemanticShaderDebugInfo && (int)paramTypes.size() > 0) {
+ addDebugScopeAndLine(currentFileId, currentLine, 0);
+ }
+
+ if (emitNonSemanticShaderDebugInfo) {
+ 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 const& paramName = paramNames[p];
+ auto const debugLocalVariableId = createDebugLocalVariable(debugId[getContainedTypeId(paramType)], paramName, p+1);
+ debugId[firstParamId + p] = debugLocalVariableId;
+
+ makeDebugDeclare(debugLocalVariableId, firstParamId + p);
+ }
}
if (name)
@@ -1456,9 +2063,62 @@ Function* Builder::makeFunctionEntry(Decoration precision, Id returnType, const
functions.push_back(std::unique_ptr<Function>(function));
+ // Clear debug scope stack
+ if (emitNonSemanticShaderDebugInfo)
+ currentDebugScopeId.pop();
+
return function;
}
+Id Builder::makeDebugFunction(Function* function, Id nameId, Id funcTypeId) {
+ assert(function != nullptr);
+ assert(nameId != 0);
+ assert(funcTypeId != 0);
+ assert(debugId[funcTypeId] != 0);
+
+ Id funcId = getUniqueId();
+ auto type = new Instruction(funcId, makeVoidType(), OpExtInst);
+ type->addIdOperand(nonSemanticShaderDebugInfo);
+ type->addImmediateOperand(NonSemanticShaderDebugInfo100DebugFunction);
+ type->addIdOperand(nameId);
+ type->addIdOperand(debugId[funcTypeId]);
+ type->addIdOperand(makeDebugSource(currentFileId)); // Will be fixed later when true filename available
+ type->addIdOperand(makeUintConstant(currentLine)); // Will be fixed later when true line available
+ type->addIdOperand(makeUintConstant(0)); // column
+ type->addIdOperand(makeDebugCompilationUnit()); // scope
+ type->addIdOperand(nameId); // linkage name
+ type->addIdOperand(makeUintConstant(NonSemanticShaderDebugInfo100FlagIsPublic));
+ type->addIdOperand(makeUintConstant(currentLine)); // TODO(greg-lunarg): correct scope line
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(type));
+ module.mapInstruction(type);
+ return funcId;
+}
+
+Id Builder::makeDebugLexicalBlock(uint32_t line) {
+ Id lexId = getUniqueId();
+ auto lex = new Instruction(lexId, makeVoidType(), OpExtInst);
+ lex->addIdOperand(nonSemanticShaderDebugInfo);
+ lex->addImmediateOperand(NonSemanticShaderDebugInfo100DebugLexicalBlock);
+ lex->addIdOperand(makeDebugSource(currentFileId));
+ lex->addIdOperand(makeUintConstant(line));
+ lex->addIdOperand(makeUintConstant(0)); // column
+ lex->addIdOperand(currentDebugScopeId.top()); // scope
+ constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(lex));
+ module.mapInstruction(lex);
+ return lexId;
+}
+
+std::string Builder::unmangleFunctionName(std::string const& name) const
+{
+ assert(name.length() > 0);
+
+ if(name.rfind('(') != std::string::npos) {
+ return name.substr(0, name.rfind('('));
+ } else {
+ return name;
+ }
+}
+
// Comments in header
void Builder::makeReturn(bool implicit, Id retVal)
{
@@ -1474,6 +2134,48 @@ void Builder::makeReturn(bool implicit, Id retVal)
}
// Comments in header
+void Builder::enterScope(uint32_t line)
+{
+ // Generate new lexical scope debug instruction
+ Id lexId = makeDebugLexicalBlock(line);
+ currentDebugScopeId.push(lexId);
+ lastDebugScopeId = NoResult;
+}
+
+// Comments in header
+void Builder::leaveScope()
+{
+ // Pop current scope from stack and clear current scope
+ currentDebugScopeId.pop();
+ lastDebugScopeId = NoResult;
+}
+
+// Comments in header
+void Builder::enterFunction(Function const* function)
+{
+ // Save and disable debugInfo for HLSL entry point function. It is a wrapper
+ // function with no user code in it.
+ restoreNonSemanticShaderDebugInfo = emitNonSemanticShaderDebugInfo;
+ if (sourceLang == spv::SourceLanguageHLSL && function == entryPointFunction) {
+ emitNonSemanticShaderDebugInfo = false;
+ }
+
+ if (emitNonSemanticShaderDebugInfo) {
+ // Initialize scope state
+ Id funcId = function->getFuncId();
+ currentDebugScopeId.push(debugId[funcId]);
+ // Create DebugFunctionDefinition
+ spv::Id resultId = getUniqueId();
+ Instruction* defInst = new Instruction(resultId, makeVoidType(), OpExtInst);
+ defInst->addIdOperand(nonSemanticShaderDebugInfo);
+ defInst->addImmediateOperand(NonSemanticShaderDebugInfo100DebugFunctionDefinition);
+ defInst->addIdOperand(debugId[funcId]);
+ defInst->addIdOperand(funcId);
+ buildPoint->addInstruction(std::unique_ptr<Instruction>(defInst));
+ }
+}
+
+// Comments in header
void Builder::leaveFunction()
{
Block* block = buildPoint;
@@ -1488,6 +2190,12 @@ void Builder::leaveFunction()
makeReturn(true, createUndefined(function.getReturnType()));
}
}
+
+ // Clear function scope from debug scope stack
+ if (emitNonSemanticShaderDebugInfo)
+ currentDebugScopeId.pop();
+
+ emitNonSemanticShaderDebugInfo = restoreNonSemanticShaderDebugInfo;
}
// Comments in header
@@ -1498,7 +2206,18 @@ void Builder::makeStatementTerminator(spv::Op opcode, const char *name)
}
// Comments in header
-Id Builder::createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name, Id initializer)
+void Builder::makeStatementTerminator(spv::Op opcode, const std::vector<Id>& operands, const char* name)
+{
+ // It's assumed that the terminator instruction is always of void return type
+ // However in future if there is a need for non void return type, new helper
+ // methods can be created.
+ createNoResultOp(opcode, operands);
+ createAndSetNoPredecessorBlock(name);
+}
+
+// Comments in header
+Id Builder::createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name, Id initializer,
+ bool const compilerGenerated)
{
Id pointerType = makePointer(storageClass, type);
Instruction* inst = new Instruction(getUniqueId(), pointerType, OpVariable);
@@ -1510,11 +2229,26 @@ Id Builder::createVariable(Decoration precision, StorageClass storageClass, Id t
case StorageClassFunction:
// Validation rules require the declaration in the entry block
buildPoint->getParent().addLocalVariable(std::unique_ptr<Instruction>(inst));
+
+ if (emitNonSemanticShaderDebugInfo && !compilerGenerated)
+ {
+ auto const debugLocalVariableId = createDebugLocalVariable(debugId[type], name);
+ debugId[inst->getResultId()] = debugLocalVariableId;
+
+ makeDebugDeclare(debugLocalVariableId, inst->getResultId());
+ }
+
break;
default:
constantsTypesGlobals.push_back(std::unique_ptr<Instruction>(inst));
module.mapInstruction(inst);
+
+ if (emitNonSemanticShaderDebugInfo && !isRayTracingOpCode(getOpCode(type)))
+ {
+ auto const debugResultId = createDebugGlobalVariable(debugId[type], name, inst->getResultId());
+ debugId[inst->getResultId()] = debugResultId;
+ }
break;
}
@@ -1544,7 +2278,7 @@ spv::MemoryAccessMask Builder::sanitizeMemoryAccessForStorageClass(spv::MemoryAc
case spv::StorageClassPhysicalStorageBufferEXT:
break;
default:
- memoryAccess = spv::MemoryAccessMask(memoryAccess &
+ memoryAccess = spv::MemoryAccessMask(memoryAccess &
~(spv::MemoryAccessMakePointerAvailableKHRMask |
spv::MemoryAccessMakePointerVisibleKHRMask |
spv::MemoryAccessNonPrivatePointerKHRMask));
@@ -2020,7 +2754,7 @@ Id Builder::createTextureCall(Decoration precision, Id resultType, bool sparse,
texArgs[numArgs++] = parameters.granularity;
if (parameters.coarse != NoResult)
texArgs[numArgs++] = parameters.coarse;
-#endif
+#endif
//
// Set up the optional arguments
@@ -3240,10 +3974,10 @@ void Builder::dumpSourceInstructions(const spv::Id fileId, const std::string& te
const int opSourceWordCount = 4;
const int nonNullBytesPerInstruction = 4 * (maxWordCount - opSourceWordCount) - 1;
- if (source != SourceLanguageUnknown) {
+ if (sourceLang != SourceLanguageUnknown) {
// OpSource Language Version File Source
Instruction sourceInst(NoResult, NoType, OpSource);
- sourceInst.addImmediateOperand(source);
+ sourceInst.addImmediateOperand(sourceLang);
sourceInst.addImmediateOperand(sourceVersion);
// File operand
if (fileId != NoResult) {
@@ -3276,6 +4010,7 @@ void Builder::dumpSourceInstructions(const spv::Id fileId, const std::string& te
// Dump an OpSource[Continued] sequence for the source and every include file
void Builder::dumpSourceInstructions(std::vector<unsigned int>& out) const
{
+ if (emitNonSemanticShaderDebugInfo) return;
dumpSourceInstructions(sourceFileStringId, sourceText, out);
for (auto iItr = includeFiles.begin(); iItr != includeFiles.end(); ++iItr)
dumpSourceInstructions(iItr->first, *iItr->second, out);
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h
index 251b9ee8230..f7fdc6ad840 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvBuilder.h
@@ -50,6 +50,10 @@
#include "Logger.h"
#include "spirv.hpp"
#include "spvIR.h"
+namespace spv {
+ #include "GLSL.ext.KHR.h"
+ #include "NonSemanticShaderDebugInfo100.h"
+}
#include <algorithm>
#include <map>
@@ -82,7 +86,7 @@ public:
void setSource(spv::SourceLanguage lang, int version)
{
- source = lang;
+ sourceLang = lang;
sourceVersion = version;
}
spv::Id getStringId(const std::string& str)
@@ -99,14 +103,32 @@ public:
stringIds[file_c_str] = strId;
return strId;
}
+ spv::Id getSourceFile() const
+ {
+ return sourceFileStringId;
+ }
void setSourceFile(const std::string& file)
{
sourceFileStringId = getStringId(file);
+ currentFileId = sourceFileStringId;
}
void setSourceText(const std::string& text) { sourceText = text; }
void addSourceExtension(const char* ext) { sourceExtensions.push_back(ext); }
void addModuleProcessed(const std::string& p) { moduleProcesses.push_back(p.c_str()); }
void setEmitOpLines() { emitOpLines = true; }
+ void setEmitNonSemanticShaderDebugInfo(bool const emit)
+ {
+ emitNonSemanticShaderDebugInfo = emit;
+
+ if(emit)
+ {
+ importNonSemanticShaderDebugInfoInstructions();
+ }
+ }
+ void setEmitNonSemanticShaderDebugSource(bool const src)
+ {
+ emitNonSemanticShaderDebugSource = src;
+ }
void addExtension(const char* ext) { extensions.insert(ext); }
void removeExtension(const char* ext)
{
@@ -159,10 +181,11 @@ public:
void setLine(int line, const char* filename);
// Low-level OpLine. See setLine() for a layered helper.
void addLine(Id fileName, int line, int column);
+ void addDebugScopeAndLine(Id fileName, int line, int column);
// For creating new types (will return old type if the requested one was already made).
Id makeVoidType();
- Id makeBoolType();
+ Id makeBoolType(bool const compilerGenerated = true);
Id makePointer(StorageClass, Id pointee);
Id makeForwardPointer(StorageClass);
Id makePointerFromForwardPointer(StorageClass, Id forwardPointerType, Id pointee);
@@ -170,7 +193,7 @@ public:
Id makeIntType(int width) { return makeIntegerType(width, true); }
Id makeUintType(int width) { return makeIntegerType(width, false); }
Id makeFloatType(int width);
- Id makeStructType(const std::vector<Id>& members, const char*);
+ Id makeStructType(const std::vector<Id>& members, const char* name, bool const compilerGenerated = true);
Id makeStructResultType(Id type0, Id type1);
Id makeVectorType(Id component, int size);
Id makeMatrixType(Id component, int cols, int rows);
@@ -181,6 +204,37 @@ public:
Id makeSamplerType();
Id makeSampledImageType(Id imageType);
Id makeCooperativeMatrixType(Id component, Id scope, Id rows, Id cols);
+ Id makeGenericType(spv::Op opcode, std::vector<spv::IdImmediate>& operands);
+
+ // SPIR-V NonSemantic Shader DebugInfo Instructions
+ struct DebugTypeLoc {
+ std::string name {};
+ int line {0};
+ int column {0};
+ };
+ std::unordered_map<Id, DebugTypeLoc> debugTypeLocs;
+ Id makeDebugInfoNone();
+ Id makeBoolDebugType(int const size);
+ Id makeIntegerDebugType(int const width, bool const hasSign);
+ Id makeFloatDebugType(int const width);
+ Id makeSequentialDebugType(Id const baseType, Id const componentCount, NonSemanticShaderDebugInfo100Instructions const sequenceType);
+ Id makeArrayDebugType(Id const baseType, Id const componentCount);
+ Id makeVectorDebugType(Id const baseType, int const componentCount);
+ Id makeMatrixDebugType(Id const vectorType, int const vectorCount, bool columnMajor = true);
+ Id makeMemberDebugType(Id const memberType, DebugTypeLoc const& debugTypeLoc);
+ Id makeCompositeDebugType(std::vector<Id> const& memberTypes, char const*const name,
+ NonSemanticShaderDebugInfo100DebugCompositeType const tag, bool const isOpaqueType = false);
+ Id makeDebugSource(const Id fileName);
+ Id makeDebugCompilationUnit();
+ Id createDebugGlobalVariable(Id const type, char const*const name, Id const variable);
+ Id createDebugLocalVariable(Id type, char const*const name, size_t const argNumber = 0);
+ Id makeDebugExpression();
+ Id makeDebugDeclare(Id const debugLocalVariable, Id const localVariable);
+ Id makeDebugValue(Id const debugLocalVariable, Id const value);
+ Id makeDebugFunctionType(Id returnType, const std::vector<Id>& paramTypes);
+ Id makeDebugFunction(Function* function, Id nameId, Id funcTypeId);
+ Id makeDebugLexicalBlock(uint32_t line);
+ std::string unmangleFunctionName(std::string const& name) const;
// accelerationStructureNV type
Id makeAccelerationStructureType();
@@ -256,6 +310,8 @@ public:
// See if a resultId is valid for use as an initializer.
bool isValidInitializer(Id resultId) const { return isConstant(resultId) || isGlobalVariable(resultId); }
+ bool isRayTracingOpCode(Op opcode) const;
+
int getScalarTypeWidth(Id typeId) const
{
Id scalarTypeId = getScalarTypeId(typeId);
@@ -317,6 +373,8 @@ public:
Id makeFloat16Constant(float f16, bool specConstant = false);
Id makeFpConstant(Id type, double d, bool specConstant = false);
+ Id importNonSemanticShaderDebugInfoInstructions();
+
// Turn the array of constants into a proper spv constant of the requested type.
Id makeCompositeConstant(Id type, const std::vector<Id>& comps, bool specConst = false);
@@ -339,7 +397,12 @@ public:
void addMemberDecoration(Id, unsigned int member, Decoration, const std::vector<const char*>& strings);
// At the end of what block do the next create*() instructions go?
- void setBuildPoint(Block* bp) { buildPoint = bp; }
+ // Also reset current last DebugScope and current source line to unknown
+ void setBuildPoint(Block* bp) {
+ buildPoint = bp;
+ lastDebugScopeId = NoResult;
+ currentLine = 0;
+ }
Block* getBuildPoint() const { return buildPoint; }
// Make the entry-point function. The returned pointer is only valid
@@ -350,12 +413,22 @@ public:
// Return the function, pass back the entry.
// The returned pointer is only valid for the lifetime of this builder.
Function* makeFunctionEntry(Decoration precision, Id returnType, const char* name,
- const std::vector<Id>& paramTypes, const std::vector<std::vector<Decoration>>& precisions, Block **entry = 0);
+ const std::vector<Id>& paramTypes, const std::vector<char const*>& paramNames,
+ const std::vector<std::vector<Decoration>>& precisions, Block **entry = 0);
// 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.
void makeReturn(bool implicit, Id retVal = 0);
+ // Initialize state and generate instructions for new lexical scope
+ void enterScope(uint32_t line);
+
+ // Set state and generate instructions to exit current lexical scope
+ void leaveScope();
+
+ // Prepare builder for generation of instructions for a function.
+ void enterFunction(Function const* function);
+
// Generate all the code needed to finish up a function.
void leaveFunction();
@@ -363,9 +436,13 @@ public:
// discard, terminate-invocation, terminateRayEXT, or ignoreIntersectionEXT
void makeStatementTerminator(spv::Op opcode, const char *name);
+ // Create block terminator instruction for statements that have input operands
+ // such as OpEmitMeshTasksEXT
+ void makeStatementTerminator(spv::Op opcode, const std::vector<Id>& operands, const char* name);
+
// Create a global or function local or IO variable.
- Id createVariable(Decoration precision, StorageClass, Id type, const char* name = nullptr,
- Id initializer = NoResult);
+ Id createVariable(Decoration precision, StorageClass storageClass, Id type, const char* name = nullptr,
+ Id initializer = NoResult, bool const compilerGenerated = true);
// Create an intermediate with an undefined value.
Id createUndefined(Id type);
@@ -800,13 +877,23 @@ public:
const;
unsigned int spvVersion; // the version of SPIR-V to emit in the header
- SourceLanguage source;
+ SourceLanguage sourceLang;
int sourceVersion;
spv::Id sourceFileStringId;
+ spv::Id nonSemanticShaderCompilationUnitId {0};
+ spv::Id nonSemanticShaderDebugInfo {0};
+ spv::Id debugInfoNone {0};
+ spv::Id debugExpression {0}; // Debug expression with zero operations.
std::string sourceText;
int currentLine;
const char* currentFile;
+ spv::Id currentFileId;
+ std::stack<spv::Id> currentDebugScopeId;
+ spv::Id lastDebugScopeId;
bool emitOpLines;
+ bool emitNonSemanticShaderDebugInfo;
+ bool restoreNonSemanticShaderDebugInfo;
+ bool emitNonSemanticShaderDebugSource;
std::set<std::string> extensions;
std::vector<const char*> sourceExtensions;
std::vector<const char*> moduleProcesses;
@@ -840,6 +927,8 @@ public:
std::unordered_map<unsigned int, std::vector<Instruction*>> groupedStructConstants;
// map type opcodes to type instructions
std::unordered_map<unsigned int, std::vector<Instruction*>> groupedTypes;
+ // map type opcodes to debug type instructions
+ std::unordered_map<unsigned int, std::vector<Instruction*>> groupedDebugTypes;
// list of OpConstantNull instructions
std::vector<Instruction*> nullConstants;
@@ -855,6 +944,12 @@ public:
// map from include file name ids to their contents
std::map<spv::Id, const std::string*> includeFiles;
+ // map from core id to debug id
+ std::map <spv::Id, spv::Id> debugId;
+
+ // map from file name string id to DebugSource id
+ std::unordered_map<spv::Id, spv::Id> debugSourceId;
+
// The stream for outputting warnings and errors.
SpvBuildLogger* logger;
}; // end Builder class
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp
index 23d7b5a4611..dd6dabce0da 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvPostProcess.cpp
@@ -44,10 +44,8 @@
#include <algorithm>
#include "SpvBuilder.h"
-
#include "spirv.hpp"
-#include "GlslangToSpv.h"
-#include "SpvBuilder.h"
+
namespace spv {
#include "GLSL.std.450.h"
#include "GLSL.ext.KHR.h"
@@ -113,8 +111,6 @@ void Builder::postProcessType(const Instruction& inst, Id typeId)
}
}
break;
- case OpAccessChain:
- case OpPtrAccessChain:
case OpCopyObject:
break;
case OpFConvert:
@@ -161,26 +157,43 @@ void Builder::postProcessType(const Instruction& inst, Id typeId)
switch (inst.getImmediateOperand(1)) {
case GLSLstd450Frexp:
case GLSLstd450FrexpStruct:
- if (getSpvVersion() < glslang::EShTargetSpv_1_3 && containsType(typeId, OpTypeInt, 16))
+ if (getSpvVersion() < spv::Spv_1_3 && containsType(typeId, OpTypeInt, 16))
addExtension(spv::E_SPV_AMD_gpu_shader_int16);
break;
case GLSLstd450InterpolateAtCentroid:
case GLSLstd450InterpolateAtSample:
case GLSLstd450InterpolateAtOffset:
- if (getSpvVersion() < glslang::EShTargetSpv_1_3 && containsType(typeId, OpTypeFloat, 16))
+ if (getSpvVersion() < spv::Spv_1_3 && containsType(typeId, OpTypeFloat, 16))
addExtension(spv::E_SPV_AMD_gpu_shader_half_float);
break;
default:
break;
}
break;
+ case OpAccessChain:
+ case OpPtrAccessChain:
+ if (isPointerType(typeId))
+ break;
+ if (basicTypeOp == OpTypeInt) {
+ if (width == 16)
+ addCapability(CapabilityInt16);
+ else if (width == 8)
+ addCapability(CapabilityInt8);
+ }
default:
- if (basicTypeOp == OpTypeFloat && width == 16)
- addCapability(CapabilityFloat16);
- if (basicTypeOp == OpTypeInt && width == 16)
- addCapability(CapabilityInt16);
- if (basicTypeOp == OpTypeInt && width == 8)
- addCapability(CapabilityInt8);
+ if (basicTypeOp == OpTypeInt) {
+ if (width == 16)
+ addCapability(CapabilityInt16);
+ else if (width == 8)
+ addCapability(CapabilityInt8);
+ else if (width == 64)
+ addCapability(CapabilityInt64);
+ } else if (basicTypeOp == OpTypeFloat) {
+ if (width == 16)
+ addCapability(CapabilityFloat16);
+ else if (width == 64)
+ addCapability(CapabilityFloat64);
+ }
break;
}
}
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp
index 8acf9b139a1..25299937a30 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.cpp
@@ -68,6 +68,8 @@ spv_target_env MapToSpirvToolsEnv(const SpvVersion& spvVersion, spv::SpvBuildLog
}
case glslang::EShTargetVulkan_1_2:
return spv_target_env::SPV_ENV_VULKAN_1_2;
+ case glslang::EShTargetVulkan_1_3:
+ return spv_target_env::SPV_ENV_VULKAN_1_3;
default:
break;
}
@@ -210,6 +212,8 @@ 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::CreateAggressiveDCEPass());
optimizer.RegisterPass(spvtools::CreateCFGCleanupPass());
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.h b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.h
index 3fb3cbacd32..5386048ab66 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.h
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/SpvTools.h
@@ -53,14 +53,14 @@
namespace glslang {
struct SpvOptions {
- SpvOptions() : generateDebugInfo(false), stripDebugInfo(false), disableOptimizer(true),
- optimizeSize(false), disassemble(false), validate(false) { }
- bool generateDebugInfo;
- bool stripDebugInfo;
- bool disableOptimizer;
- bool optimizeSize;
- bool disassemble;
- bool validate;
+ bool generateDebugInfo {false};
+ bool stripDebugInfo {false};
+ bool disableOptimizer {true};
+ bool optimizeSize {false};
+ bool disassemble {false};
+ bool validate {false};
+ bool emitNonSemanticShaderDebugInfo {false};
+ bool emitNonSemanticShaderDebugSource{ false };
};
#if ENABLE_OPT
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/disassemble.cpp b/3rdparty/bgfx/3rdparty/glslang/SPIRV/disassemble.cpp
index 73c988c5b32..74dd605409f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/disassemble.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/disassemble.cpp
@@ -43,6 +43,7 @@
#include <stack>
#include <sstream>
#include <cstring>
+#include <utility>
#include "disassemble.h"
#include "doc.h"
@@ -100,6 +101,7 @@ protected:
void outputMask(OperandClass operandClass, unsigned mask);
void disassembleImmediates(int numOperands);
void disassembleIds(int numOperands);
+ std::pair<int, std::string> decodeString();
int disassembleString();
void disassembleInstruction(Id resultId, Id typeId, Op opCode, int numOperands);
@@ -290,31 +292,44 @@ void SpirvStream::disassembleIds(int numOperands)
}
}
-// return the number of operands consumed by the string
-int SpirvStream::disassembleString()
+// decode string from words at current position (non-consuming)
+std::pair<int, std::string> SpirvStream::decodeString()
{
- int startWord = word;
-
- out << " \"";
-
- const char* wordString;
+ std::string res;
+ int wordPos = word;
+ char c;
bool done = false;
+
do {
- unsigned int content = stream[word];
- wordString = (const char*)&content;
+ unsigned int content = stream[wordPos];
for (int charCount = 0; charCount < 4; ++charCount) {
- if (*wordString == 0) {
+ c = content & 0xff;
+ content >>= 8;
+ if (c == '\0') {
done = true;
break;
}
- out << *(wordString++);
+ res += c;
}
- ++word;
- } while (! done);
+ ++wordPos;
+ } while(! done);
+
+ return std::make_pair(wordPos - word, res);
+}
+
+// return the number of operands consumed by the string
+int SpirvStream::disassembleString()
+{
+ out << " \"";
+ std::pair<int, std::string> decoderes = decodeString();
+
+ out << decoderes.second;
out << "\"";
- return word - startWord;
+ word += decoderes.first;
+
+ return decoderes.first;
}
void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode, int numOperands)
@@ -331,7 +346,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
nextNestedControl = 0;
}
} else if (opCode == OpExtInstImport) {
- idDescriptor[resultId] = (const char*)(&stream[word]);
+ idDescriptor[resultId] = decodeString().second;
}
else {
if (resultId != 0 && idDescriptor[resultId].size() == 0) {
@@ -428,7 +443,7 @@ void SpirvStream::disassembleInstruction(Id resultId, Id /*typeId*/, Op opCode,
--numOperands;
// Get names for printing "(XXX)" for readability, *after* this id
if (opCode == OpName)
- idDescriptor[stream[word - 1]] = (const char*)(&stream[word]);
+ idDescriptor[stream[word - 1]] = decodeString().second;
break;
case OperandVariableIds:
disassembleIds(numOperands);
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/doc.cpp b/3rdparty/bgfx/3rdparty/glslang/SPIRV/doc.cpp
index dbdf7077a60..b7fe3e74246 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/doc.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/doc.cpp
@@ -97,6 +97,8 @@ const char* ExecutionModelString(int model)
case 6: return "Kernel";
case ExecutionModelTaskNV: return "TaskNV";
case ExecutionModelMeshNV: return "MeshNV";
+ case ExecutionModelTaskEXT: return "TaskEXT";
+ case ExecutionModelMeshEXT: return "MeshEXT";
default: return "Bad";
@@ -173,28 +175,32 @@ const char* ExecutionModeString(int mode)
case 31: return "ContractionOff";
case 32: return "Bad";
- case ExecutionModeInitializer: return "Initializer";
- case ExecutionModeFinalizer: return "Finalizer";
- case ExecutionModeSubgroupSize: return "SubgroupSize";
- case ExecutionModeSubgroupsPerWorkgroup: return "SubgroupsPerWorkgroup";
- case ExecutionModeSubgroupsPerWorkgroupId: return "SubgroupsPerWorkgroupId";
- case ExecutionModeLocalSizeId: return "LocalSizeId";
- case ExecutionModeLocalSizeHintId: return "LocalSizeHintId";
-
- case ExecutionModePostDepthCoverage: return "PostDepthCoverage";
- case ExecutionModeDenormPreserve: return "DenormPreserve";
- case ExecutionModeDenormFlushToZero: return "DenormFlushToZero";
- case ExecutionModeSignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve";
- case ExecutionModeRoundingModeRTE: return "RoundingModeRTE";
- case ExecutionModeRoundingModeRTZ: return "RoundingModeRTZ";
- case ExecutionModeStencilRefReplacingEXT: return "StencilRefReplacingEXT";
+ case ExecutionModeInitializer: return "Initializer";
+ case ExecutionModeFinalizer: return "Finalizer";
+ case ExecutionModeSubgroupSize: return "SubgroupSize";
+ case ExecutionModeSubgroupsPerWorkgroup: return "SubgroupsPerWorkgroup";
+ case ExecutionModeSubgroupsPerWorkgroupId: return "SubgroupsPerWorkgroupId";
+ case ExecutionModeLocalSizeId: return "LocalSizeId";
+ case ExecutionModeLocalSizeHintId: return "LocalSizeHintId";
+
+ case ExecutionModePostDepthCoverage: return "PostDepthCoverage";
+ case ExecutionModeDenormPreserve: return "DenormPreserve";
+ case ExecutionModeDenormFlushToZero: return "DenormFlushToZero";
+ case ExecutionModeSignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve";
+ case ExecutionModeRoundingModeRTE: return "RoundingModeRTE";
+ case ExecutionModeRoundingModeRTZ: return "RoundingModeRTZ";
+ case ExecutionModeEarlyAndLateFragmentTestsAMD: return "EarlyAndLateFragmentTestsAMD";
+ case ExecutionModeStencilRefUnchangedFrontAMD: return "StencilRefUnchangedFrontAMD";
+ case ExecutionModeStencilRefLessFrontAMD: return "StencilRefLessFrontAMD";
+ case ExecutionModeStencilRefGreaterBackAMD: return "StencilRefGreaterBackAMD";
+ case ExecutionModeStencilRefReplacingEXT: return "StencilRefReplacingEXT";
case ExecutionModeSubgroupUniformControlFlowKHR: return "SubgroupUniformControlFlow";
- case ExecutionModeOutputLinesNV: return "OutputLinesNV";
- case ExecutionModeOutputPrimitivesNV: return "OutputPrimitivesNV";
- case ExecutionModeOutputTrianglesNV: return "OutputTrianglesNV";
- case ExecutionModeDerivativeGroupQuadsNV: return "DerivativeGroupQuadsNV";
- case ExecutionModeDerivativeGroupLinearNV: return "DerivativeGroupLinearNV";
+ case ExecutionModeOutputLinesNV: return "OutputLinesNV";
+ case ExecutionModeOutputPrimitivesNV: return "OutputPrimitivesNV";
+ case ExecutionModeOutputTrianglesNV: return "OutputTrianglesNV";
+ case ExecutionModeDerivativeGroupQuadsNV: return "DerivativeGroupQuadsNV";
+ case ExecutionModeDerivativeGroupLinearNV: return "DerivativeGroupLinearNV";
case ExecutionModePixelInterlockOrderedEXT: return "PixelInterlockOrderedEXT";
case ExecutionModePixelInterlockUnorderedEXT: return "PixelInterlockUnorderedEXT";
@@ -238,7 +244,7 @@ const char* StorageClassString(int StorageClass)
case StorageClassIncomingCallableDataKHR: return "IncomingCallableDataKHR";
case StorageClassPhysicalStorageBufferEXT: return "PhysicalStorageBufferEXT";
-
+ case StorageClassTaskPayloadWorkgroupEXT: return "TaskPayloadWorkgroupEXT";
default: return "Bad";
}
}
@@ -305,7 +311,8 @@ const char* DecorationString(int decoration)
case DecorationPerPrimitiveNV: return "PerPrimitiveNV";
case DecorationPerViewNV: return "PerViewNV";
case DecorationPerTaskNV: return "PerTaskNV";
- case DecorationPerVertexNV: return "PerVertexNV";
+
+ case DecorationPerVertexKHR: return "PerVertexKHR";
case DecorationNonUniformEXT: return "DecorationNonUniformEXT";
case DecorationHlslCounterBufferGOOGLE: return "DecorationHlslCounterBufferGOOGLE";
@@ -392,6 +399,7 @@ const char* BuiltInString(int builtIn)
case BuiltInObjectRayDirectionKHR: return "ObjectRayDirectionKHR";
case BuiltInRayTminKHR: return "RayTminKHR";
case BuiltInRayTmaxKHR: return "RayTmaxKHR";
+ case BuiltInCullMaskKHR: return "CullMaskKHR";
case BuiltInInstanceCustomIndexKHR: return "InstanceCustomIndexKHR";
case BuiltInRayGeometryIndexKHR: return "RayGeometryIndexKHR";
case BuiltInObjectToWorldKHR: return "ObjectToWorldKHR";
@@ -406,8 +414,8 @@ const char* BuiltInString(int builtIn)
case BuiltInViewportMaskPerViewNV: return "ViewportMaskPerViewNV";
// case BuiltInFragmentSizeNV: return "FragmentSizeNV"; // superseded by BuiltInFragSizeEXT
// case BuiltInInvocationsPerPixelNV: return "InvocationsPerPixelNV"; // superseded by BuiltInFragInvocationCountEXT
- case BuiltInBaryCoordNV: return "BaryCoordNV";
- case BuiltInBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
+ case BuiltInBaryCoordKHR: return "BaryCoordKHR";
+ case BuiltInBaryCoordNoPerspKHR: return "BaryCoordNoPerspKHR";
case BuiltInFragSizeEXT: return "FragSizeEXT";
case BuiltInFragInvocationCountEXT: return "FragInvocationCountEXT";
@@ -427,6 +435,10 @@ const char* BuiltInString(int builtIn)
case BuiltInWarpIDNV: return "WarpIDNV";
case BuiltInSMIDNV: return "SMIDNV";
case BuiltInCurrentRayTimeNV: return "CurrentRayTimeNV";
+ case BuiltInPrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT";
+ case BuiltInPrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT";
+ case BuiltInPrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT";
+ case BuiltInCullPrimitiveEXT: return "CullPrimitiveEXT";
default: return "Bad";
}
@@ -900,6 +912,12 @@ const char* CapabilityString(int info)
case CapabilityDeviceGroup: return "DeviceGroup";
case CapabilityMultiView: return "MultiView";
+ case CapabilityDenormPreserve: return "DenormPreserve";
+ case CapabilityDenormFlushToZero: return "DenormFlushToZero";
+ case CapabilitySignedZeroInfNanPreserve: return "SignedZeroInfNanPreserve";
+ case CapabilityRoundingModeRTE: return "RoundingModeRTE";
+ case CapabilityRoundingModeRTZ: return "RoundingModeRTZ";
+
case CapabilityStencilExportEXT: return "StencilExportEXT";
case CapabilityFloat16ImageAMD: return "Float16ImageAMD";
@@ -919,14 +937,16 @@ const char* CapabilityString(int info)
case CapabilityRayTracingNV: return "RayTracingNV";
case CapabilityRayTracingMotionBlurNV: return "RayTracingMotionBlurNV";
case CapabilityRayTracingKHR: return "RayTracingKHR";
+ case CapabilityRayCullMaskKHR: return "RayCullMaskKHR";
case CapabilityRayQueryKHR: return "RayQueryKHR";
case CapabilityRayTracingProvisionalKHR: return "RayTracingProvisionalKHR";
case CapabilityRayTraversalPrimitiveCullingKHR: return "RayTraversalPrimitiveCullingKHR";
case CapabilityComputeDerivativeGroupQuadsNV: return "ComputeDerivativeGroupQuadsNV";
case CapabilityComputeDerivativeGroupLinearNV: return "ComputeDerivativeGroupLinearNV";
- case CapabilityFragmentBarycentricNV: return "FragmentBarycentricNV";
+ case CapabilityFragmentBarycentricKHR: return "FragmentBarycentricKHR";
case CapabilityMeshShadingNV: return "MeshShadingNV";
case CapabilityImageFootprintNV: return "ImageFootprintNV";
+ case CapabilityMeshShadingEXT: return "MeshShadingEXT";
// case CapabilityShadingRateNV: return "ShadingRateNV"; // superseded by FragmentDensityEXT
case CapabilitySampleMaskOverrideCoverageNV: return "SampleMaskOverrideCoverageNV";
case CapabilityFragmentDensityEXT: return "FragmentDensityEXT";
@@ -1394,6 +1414,8 @@ const char* OpcodeString(int op)
case OpGroupNonUniformPartitionNV: return "OpGroupNonUniformPartitionNV";
case OpImageSampleFootprintNV: return "OpImageSampleFootprintNV";
case OpWritePackedPrimitiveIndices4x8NV: return "OpWritePackedPrimitiveIndices4x8NV";
+ case OpEmitMeshTasksEXT: return "OpEmitMeshTasksEXT";
+ case OpSetMeshOutputsEXT: return "OpSetMeshOutputsEXT";
case OpTypeRayQueryKHR: return "OpTypeRayQueryKHR";
case OpRayQueryInitializeKHR: return "OpRayQueryInitializeKHR";
@@ -2968,6 +2990,17 @@ void Parameterize()
InstructionDesc[OpWritePackedPrimitiveIndices4x8NV].operands.push(OperandId, "'Index Offset'");
InstructionDesc[OpWritePackedPrimitiveIndices4x8NV].operands.push(OperandId, "'Packed Indices'");
+ InstructionDesc[OpEmitMeshTasksEXT].operands.push(OperandId, "'groupCountX'");
+ InstructionDesc[OpEmitMeshTasksEXT].operands.push(OperandId, "'groupCountY'");
+ InstructionDesc[OpEmitMeshTasksEXT].operands.push(OperandId, "'groupCountZ'");
+ InstructionDesc[OpEmitMeshTasksEXT].operands.push(OperandId, "'Payload'");
+ InstructionDesc[OpEmitMeshTasksEXT].setResultAndType(false, false);
+
+ InstructionDesc[OpSetMeshOutputsEXT].operands.push(OperandId, "'vertexCount'");
+ InstructionDesc[OpSetMeshOutputsEXT].operands.push(OperandId, "'primitiveCount'");
+ InstructionDesc[OpSetMeshOutputsEXT].setResultAndType(false, false);
+
+
InstructionDesc[OpTypeCooperativeMatrixNV].operands.push(OperandId, "'Component Type'");
InstructionDesc[OpTypeCooperativeMatrixNV].operands.push(OperandId, "'Scope'");
InstructionDesc[OpTypeCooperativeMatrixNV].operands.push(OperandId, "'Rows'");
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/spirv.hpp b/3rdparty/bgfx/3rdparty/glslang/SPIRV/spirv.hpp
index e0fe24980d3..f85469d441e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/spirv.hpp
+++ b/3rdparty/bgfx/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
@@ -27,7 +27,7 @@
// Enumeration tokens for SPIR-V, in various styles:
// C, C++, C++11, JSON, Lua, Python, C#, D
-//
+//
// - 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,7 @@
// - 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
-//
+//
// 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
@@ -49,12 +49,12 @@ namespace spv {
typedef unsigned int Id;
-#define SPV_VERSION 0x10500
-#define SPV_REVISION 4
+#define SPV_VERSION 0x10600
+#define SPV_REVISION 1
static const unsigned int MagicNumber = 0x07230203;
-static const unsigned int Version = 0x00010500;
-static const unsigned int Revision = 4;
+static const unsigned int Version = 0x00010600;
+static const unsigned int Revision = 1;
static const unsigned int OpCodeMask = 0xffff;
static const unsigned int WordCountShift = 16;
@@ -65,6 +65,7 @@ enum SourceLanguage {
SourceLanguageOpenCL_C = 3,
SourceLanguageOpenCL_CPP = 4,
SourceLanguageHLSL = 5,
+ SourceLanguageCPP_for_OpenCL = 6,
SourceLanguageMax = 0x7fffffff,
};
@@ -90,6 +91,8 @@ enum ExecutionModel {
ExecutionModelMissNV = 5317,
ExecutionModelCallableKHR = 5318,
ExecutionModelCallableNV = 5318,
+ ExecutionModelTaskEXT = 5364,
+ ExecutionModelMeshEXT = 5365,
ExecutionModelMax = 0x7fffffff,
};
@@ -157,11 +160,21 @@ enum ExecutionMode {
ExecutionModeSignedZeroInfNanPreserve = 4461,
ExecutionModeRoundingModeRTE = 4462,
ExecutionModeRoundingModeRTZ = 4463,
+ ExecutionModeEarlyAndLateFragmentTestsAMD = 5017,
ExecutionModeStencilRefReplacingEXT = 5027,
+ ExecutionModeStencilRefUnchangedFrontAMD = 5079,
+ ExecutionModeStencilRefGreaterFrontAMD = 5080,
+ ExecutionModeStencilRefLessFrontAMD = 5081,
+ ExecutionModeStencilRefUnchangedBackAMD = 5082,
+ ExecutionModeStencilRefGreaterBackAMD = 5083,
+ ExecutionModeStencilRefLessBackAMD = 5084,
+ ExecutionModeOutputLinesEXT = 5269,
ExecutionModeOutputLinesNV = 5269,
+ ExecutionModeOutputPrimitivesEXT = 5270,
ExecutionModeOutputPrimitivesNV = 5270,
ExecutionModeDerivativeGroupQuadsNV = 5289,
ExecutionModeDerivativeGroupLinearNV = 5290,
+ ExecutionModeOutputTrianglesEXT = 5298,
ExecutionModeOutputTrianglesNV = 5298,
ExecutionModePixelInterlockOrderedEXT = 5366,
ExecutionModePixelInterlockUnorderedEXT = 5367,
@@ -210,6 +223,7 @@ enum StorageClass {
StorageClassShaderRecordBufferNV = 5343,
StorageClassPhysicalStorageBuffer = 5349,
StorageClassPhysicalStorageBufferEXT = 5349,
+ StorageClassTaskPayloadWorkgroupEXT = 5402,
StorageClassCodeSectionINTEL = 5605,
StorageClassDeviceOnlyINTEL = 5936,
StorageClassHostOnlyINTEL = 5937,
@@ -352,6 +366,8 @@ enum ImageOperandsShift {
ImageOperandsVolatileTexelKHRShift = 11,
ImageOperandsSignExtendShift = 12,
ImageOperandsZeroExtendShift = 13,
+ ImageOperandsNontemporalShift = 14,
+ ImageOperandsOffsetsShift = 16,
ImageOperandsMax = 0x7fffffff,
};
@@ -375,6 +391,8 @@ enum ImageOperandsMask {
ImageOperandsVolatileTexelKHRMask = 0x00000800,
ImageOperandsSignExtendMask = 0x00001000,
ImageOperandsZeroExtendMask = 0x00002000,
+ ImageOperandsNontemporalMask = 0x00004000,
+ ImageOperandsOffsetsMask = 0x00010000,
};
enum FPFastMathModeShift {
@@ -488,9 +506,11 @@ enum Decoration {
DecorationPassthroughNV = 5250,
DecorationViewportRelativeNV = 5252,
DecorationSecondaryViewportRelativeNV = 5256,
+ DecorationPerPrimitiveEXT = 5271,
DecorationPerPrimitiveNV = 5271,
DecorationPerViewNV = 5272,
DecorationPerTaskNV = 5273,
+ DecorationPerVertexKHR = 5285,
DecorationPerVertexNV = 5285,
DecorationNonUniform = 5300,
DecorationNonUniformEXT = 5300,
@@ -498,6 +518,10 @@ enum Decoration {
DecorationRestrictPointerEXT = 5355,
DecorationAliasedPointer = 5356,
DecorationAliasedPointerEXT = 5356,
+ DecorationBindlessSamplerNV = 5398,
+ DecorationBindlessImageNV = 5399,
+ DecorationBoundSamplerNV = 5400,
+ DecorationBoundImageNV = 5401,
DecorationSIMTCallINTEL = 5599,
DecorationReferencedIndirectlyINTEL = 5602,
DecorationClobberINTEL = 5607,
@@ -537,6 +561,7 @@ enum Decoration {
DecorationFunctionFloatingPointModeINTEL = 6080,
DecorationSingleElementVectorINTEL = 6085,
DecorationVectorComputeCallableFunctionINTEL = 6087,
+ DecorationMediaBlockIOINTEL = 6140,
DecorationMax = 0x7fffffff,
};
@@ -621,12 +646,18 @@ enum BuiltIn {
BuiltInLayerPerViewNV = 5279,
BuiltInMeshViewCountNV = 5280,
BuiltInMeshViewIndicesNV = 5281,
+ BuiltInBaryCoordKHR = 5286,
BuiltInBaryCoordNV = 5286,
+ BuiltInBaryCoordNoPerspKHR = 5287,
BuiltInBaryCoordNoPerspNV = 5287,
BuiltInFragSizeEXT = 5292,
BuiltInFragmentSizeNV = 5292,
BuiltInFragInvocationCountEXT = 5293,
BuiltInInvocationsPerPixelNV = 5293,
+ BuiltInPrimitivePointIndicesEXT = 5294,
+ BuiltInPrimitiveLineIndicesEXT = 5295,
+ BuiltInPrimitiveTriangleIndicesEXT = 5296,
+ BuiltInCullPrimitiveEXT = 5299,
BuiltInLaunchIdKHR = 5319,
BuiltInLaunchIdNV = 5319,
BuiltInLaunchSizeKHR = 5320,
@@ -660,6 +691,7 @@ enum BuiltIn {
BuiltInSMCountNV = 5375,
BuiltInWarpIDNV = 5376,
BuiltInSMIDNV = 5377,
+ BuiltInCullMaskKHR = 6021,
BuiltInMax = 0x7fffffff,
};
@@ -722,6 +754,7 @@ enum FunctionControlShift {
FunctionControlDontInlineShift = 1,
FunctionControlPureShift = 2,
FunctionControlConstShift = 3,
+ FunctionControlOptNoneINTELShift = 16,
FunctionControlMax = 0x7fffffff,
};
@@ -731,6 +764,7 @@ enum FunctionControlMask {
FunctionControlDontInlineMask = 0x00000002,
FunctionControlPureMask = 0x00000004,
FunctionControlConstMask = 0x00000008,
+ FunctionControlOptNoneINTELMask = 0x00010000,
};
enum MemorySemanticsShift {
@@ -911,6 +945,7 @@ enum Capability {
CapabilityGroupNonUniformQuad = 68,
CapabilityShaderLayer = 69,
CapabilityShaderViewportIndex = 70,
+ CapabilityUniformDecoration = 71,
CapabilityFragmentShadingRateKHR = 4422,
CapabilitySubgroupBallotKHR = 4423,
CapabilityDrawParameters = 4427,
@@ -959,6 +994,8 @@ enum Capability {
CapabilityFragmentFullyCoveredEXT = 5265,
CapabilityMeshShadingNV = 5266,
CapabilityImageFootprintNV = 5282,
+ CapabilityMeshShadingEXT = 5283,
+ CapabilityFragmentBarycentricKHR = 5284,
CapabilityFragmentBarycentricNV = 5284,
CapabilityComputeDerivativeGroupQuadsNV = 5288,
CapabilityFragmentDensityEXT = 5291,
@@ -1003,7 +1040,9 @@ enum Capability {
CapabilityFragmentShaderShadingRateInterlockEXT = 5372,
CapabilityShaderSMBuiltinsNV = 5373,
CapabilityFragmentShaderPixelInterlockEXT = 5378,
+ CapabilityDemoteToHelperInvocation = 5379,
CapabilityDemoteToHelperInvocationEXT = 5379,
+ CapabilityBindlessTextureNV = 5390,
CapabilitySubgroupShuffleINTEL = 5568,
CapabilitySubgroupBufferBlockIOINTEL = 5569,
CapabilitySubgroupImageBlockIOINTEL = 5570,
@@ -1028,6 +1067,7 @@ enum Capability {
CapabilityFPGAMemoryAttributesINTEL = 5824,
CapabilityFPFastMathModeINTEL = 5837,
CapabilityArbitraryPrecisionIntegersINTEL = 5844,
+ CapabilityArbitraryPrecisionFloatingPointINTEL = 5845,
CapabilityUnstructuredLoopControlsINTEL = 5886,
CapabilityFPGALoopControlsINTEL = 5888,
CapabilityKernelAttributesINTEL = 5892,
@@ -1036,14 +1076,27 @@ enum Capability {
CapabilityFPGAClusterAttributesINTEL = 5904,
CapabilityLoopFuseINTEL = 5906,
CapabilityFPGABufferLocationINTEL = 5920,
+ CapabilityArbitraryPrecisionFixedPointINTEL = 5922,
CapabilityUSMStorageClassesINTEL = 5935,
CapabilityIOPipesINTEL = 5943,
CapabilityBlockingPipesINTEL = 5945,
CapabilityFPGARegINTEL = 5948,
+ CapabilityDotProductInputAll = 6016,
+ CapabilityDotProductInputAllKHR = 6016,
+ CapabilityDotProductInput4x8Bit = 6017,
+ CapabilityDotProductInput4x8BitKHR = 6017,
+ CapabilityDotProductInput4x8BitPacked = 6018,
+ CapabilityDotProductInput4x8BitPackedKHR = 6018,
+ CapabilityDotProduct = 6019,
+ CapabilityDotProductKHR = 6019,
+ CapabilityRayCullMaskKHR = 6020,
+ CapabilityBitInstructions = 6025,
CapabilityAtomicFloat32AddEXT = 6033,
CapabilityAtomicFloat64AddEXT = 6034,
CapabilityLongConstantCompositeINTEL = 6089,
+ CapabilityOptNoneINTEL = 6094,
CapabilityAtomicFloat16AddEXT = 6095,
+ CapabilityDebugInfoModuleINTEL = 6114,
CapabilityMax = 0x7fffffff,
};
@@ -1122,6 +1175,32 @@ enum FPOperationMode {
FPOperationModeMax = 0x7fffffff,
};
+enum QuantizationModes {
+ QuantizationModesTRN = 0,
+ QuantizationModesTRN_ZERO = 1,
+ QuantizationModesRND = 2,
+ QuantizationModesRND_ZERO = 3,
+ QuantizationModesRND_INF = 4,
+ QuantizationModesRND_MIN_INF = 5,
+ QuantizationModesRND_CONV = 6,
+ QuantizationModesRND_CONV_ODD = 7,
+ QuantizationModesMax = 0x7fffffff,
+};
+
+enum OverflowModes {
+ OverflowModesWRAP = 0,
+ OverflowModesSAT = 1,
+ OverflowModesSAT_ZERO = 2,
+ OverflowModesSAT_SYM = 3,
+ OverflowModesMax = 0x7fffffff,
+};
+
+enum PackedVectorFormat {
+ PackedVectorFormatPackedVectorFormat4x8Bit = 0,
+ PackedVectorFormatPackedVectorFormat4x8BitKHR = 0,
+ PackedVectorFormatMax = 0x7fffffff,
+};
+
enum Op {
OpNop = 0,
OpUndef = 1,
@@ -1479,6 +1558,18 @@ enum Op {
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,
@@ -1498,6 +1589,8 @@ enum Op {
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
OpImageSampleFootprintNV = 5283,
+ OpEmitMeshTasksEXT = 5294,
+ OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpReportIntersectionKHR = 5334,
@@ -1517,8 +1610,16 @@ enum Op {
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,
@@ -1543,7 +1644,7 @@ enum Op {
OpUSubSatINTEL = 5596,
OpIMul32x16INTEL = 5597,
OpUMul32x16INTEL = 5598,
- OpConstFunctionPointerINTEL = 5600,
+ OpConstantFunctionPointerINTEL = 5600,
OpFunctionPointerCallINTEL = 5601,
OpAsmTargetINTEL = 5609,
OpAsmINTEL = 5610,
@@ -1677,7 +1778,59 @@ enum Op {
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,
+ 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,
@@ -2069,6 +2222,12 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
case OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break;
case OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break;
+ case OpSDot: *hasResult = true; *hasResultType = true; break;
+ case OpUDot: *hasResult = true; *hasResultType = true; break;
+ case OpSUDot: *hasResult = true; *hasResultType = true; break;
+ case OpSDotAccSat: *hasResult = true; *hasResultType = true; break;
+ case OpUDotAccSat: *hasResult = true; *hasResultType = true; break;
+ case OpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@@ -2089,6 +2248,8 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpReadClockKHR: *hasResult = true; *hasResultType = true; 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 OpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break;
case OpReportIntersectionNV: *hasResult = true; *hasResultType = true; break;
case OpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break;
@@ -2105,8 +2266,15 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
case OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
- case OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
+ case OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
+ case OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
+ case OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
+ case OpConvertImageToUNV: *hasResult = true; *hasResultType = true; break;
+ case OpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break;
+ case OpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break;
+ case OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
+ case OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break;
case OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
case OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
case OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2131,7 +2299,7 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break;
case OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
case OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
- case OpConstFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
case OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
case OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
case OpAsmINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2263,7 +2431,59 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break;
case OpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break;
case OpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break;
case OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedSinINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedCosINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedLogINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedExpINTEL: *hasResult = true; *hasResultType = true; break;
case OpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break;
case OpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break;
case OpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2311,4 +2531,3 @@ inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShad
} // end namespace spv
#endif // #ifndef spirv_HPP
-
diff --git a/3rdparty/bgfx/3rdparty/glslang/SPIRV/spvIR.h b/3rdparty/bgfx/3rdparty/glslang/SPIRV/spvIR.h
index 486e80d000f..09691273abf 100644
--- a/3rdparty/bgfx/3rdparty/glslang/SPIRV/spvIR.h
+++ b/3rdparty/bgfx/3rdparty/glslang/SPIRV/spvIR.h
@@ -111,27 +111,23 @@ public:
void addStringOperand(const char* str)
{
- unsigned int word;
- char* wordString = (char*)&word;
- char* wordPtr = wordString;
- int charCount = 0;
+ unsigned int word = 0;
+ unsigned int shiftAmount = 0;
char c;
+
do {
c = *(str++);
- *(wordPtr++) = c;
- ++charCount;
- if (charCount == 4) {
+ word |= ((unsigned int)c) << shiftAmount;
+ shiftAmount += 8;
+ if (shiftAmount == 32) {
addImmediateOperand(word);
- wordPtr = wordString;
- charCount = 0;
+ word = 0;
+ shiftAmount = 0;
}
} while (c != 0);
// deal with partial last word
- if (charCount > 0) {
- // pad with 0s
- for (; charCount < 4; ++charCount)
- *(wordPtr++) = 0;
+ if (shiftAmount > 0) {
addImmediateOperand(word);
}
}
@@ -353,6 +349,7 @@ public:
const std::vector<Block*>& getBlocks() const { return blocks; }
void addLocalVariable(std::unique_ptr<Instruction> inst);
Id getReturnType() const { return functionInstruction.getTypeId(); }
+ Id getFuncId() const { return functionInstruction.getResultId(); }
void setReturnPrecision(Decoration precision)
{
if (precision == DecorationRelaxedPrecision)
@@ -361,6 +358,14 @@ public:
Decoration getReturnPrecision() const
{ return reducedPrecisionReturn ? DecorationRelaxedPrecision : NoPrecision; }
+ void setDebugLineInfo(Id fileName, int line, int column) {
+ lineInstruction = std::unique_ptr<Instruction>{new Instruction(OpLine)};
+ lineInstruction->addIdOperand(fileName);
+ lineInstruction->addImmediateOperand(line);
+ lineInstruction->addImmediateOperand(column);
+ }
+ bool hasDebugLineInfo() const { return lineInstruction != nullptr; }
+
void setImplicitThis() { implicitThis = true; }
bool hasImplicitThis() const { return implicitThis; }
@@ -377,6 +382,11 @@ public:
void dump(std::vector<unsigned int>& out) const
{
+ // OpLine
+ if (lineInstruction != nullptr) {
+ lineInstruction->dump(out);
+ }
+
// OpFunction
functionInstruction.dump(out);
@@ -395,6 +405,7 @@ protected:
Function& operator=(Function&);
Module& parent;
+ std::unique_ptr<Instruction> lineInstruction;
Instruction functionInstruction;
std::vector<Instruction*> parameterInstructions;
std::vector<Block*> blocks;
@@ -461,7 +472,8 @@ protected:
// - the OpFunction instruction
// - all the OpFunctionParameter instructions
__inline Function::Function(Id id, Id resultType, Id functionType, Id firstParamId, Module& parent)
- : parent(parent), functionInstruction(id, resultType, OpFunction), implicitThis(false),
+ : parent(parent), lineInstruction(nullptr),
+ functionInstruction(id, resultType, OpFunction), implicitThis(false),
reducedPrecisionReturn(false)
{
// OpFunction
diff --git a/3rdparty/bgfx/3rdparty/glslang/StandAlone/ResourceLimits.cpp b/3rdparty/bgfx/3rdparty/glslang/StandAlone/ResourceLimits.cpp
index 7c7f4c4e49b..6e1a3d85c0c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/StandAlone/ResourceLimits.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/StandAlone/ResourceLimits.cpp
@@ -37,9 +37,9 @@
#include <sstream>
#include <cctype>
-#include "ResourceLimits.h"
+#include "glslang/Public/ResourceLimits.h"
-namespace glslang {
+TBuiltInResource Resources;
const TBuiltInResource DefaultTBuiltInResource = {
/* .MaxLights = */ 32,
@@ -134,6 +134,15 @@ const TBuiltInResource DefaultTBuiltInResource = {
/* .maxTaskWorkGroupSizeY_NV = */ 1,
/* .maxTaskWorkGroupSizeZ_NV = */ 1,
/* .maxMeshViewCountNV = */ 4,
+ /* .maxMeshOutputVerticesEXT = */ 256,
+ /* .maxMeshOutputPrimitivesEXT = */ 256,
+ /* .maxMeshWorkGroupSizeX_EXT = */ 128,
+ /* .maxMeshWorkGroupSizeY_EXT = */ 128,
+ /* .maxMeshWorkGroupSizeZ_EXT = */ 128,
+ /* .maxTaskWorkGroupSizeX_EXT = */ 128,
+ /* .maxTaskWorkGroupSizeY_EXT = */ 128,
+ /* .maxTaskWorkGroupSizeZ_EXT = */ 128,
+ /* .maxMeshViewCountEXT = */ 4,
/* .maxDualSourceDrawBuffersEXT = */ 1,
/* .limits = */ {
@@ -244,6 +253,15 @@ std::string GetDefaultTBuiltInResourceString()
<< "MaxTaskWorkGroupSizeY_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeY_NV << "\n"
<< "MaxTaskWorkGroupSizeZ_NV " << DefaultTBuiltInResource.maxTaskWorkGroupSizeZ_NV << "\n"
<< "MaxMeshViewCountNV " << DefaultTBuiltInResource.maxMeshViewCountNV << "\n"
+ << "MaxMeshOutputVerticesEXT " << DefaultTBuiltInResource.maxMeshOutputVerticesEXT << "\n"
+ << "MaxMeshOutputPrimitivesEXT " << DefaultTBuiltInResource.maxMeshOutputPrimitivesEXT << "\n"
+ << "MaxMeshWorkGroupSizeX_EXT " << DefaultTBuiltInResource.maxMeshWorkGroupSizeX_EXT << "\n"
+ << "MaxMeshWorkGroupSizeY_EXT " << DefaultTBuiltInResource.maxMeshWorkGroupSizeY_EXT << "\n"
+ << "MaxMeshWorkGroupSizeZ_EXT " << DefaultTBuiltInResource.maxMeshWorkGroupSizeZ_EXT << "\n"
+ << "MaxTaskWorkGroupSizeX_EXT " << DefaultTBuiltInResource.maxTaskWorkGroupSizeX_EXT << "\n"
+ << "MaxTaskWorkGroupSizeY_EXT " << DefaultTBuiltInResource.maxTaskWorkGroupSizeY_EXT << "\n"
+ << "MaxTaskWorkGroupSizeZ_EXT " << DefaultTBuiltInResource.maxTaskWorkGroupSizeZ_EXT << "\n"
+ << "MaxMeshViewCountEXT " << DefaultTBuiltInResource.maxMeshViewCountEXT << "\n"
<< "MaxDualSourceDrawBuffersEXT " << DefaultTBuiltInResource.maxDualSourceDrawBuffersEXT << "\n"
<< "nonInductiveForLoops " << DefaultTBuiltInResource.limits.nonInductiveForLoops << "\n"
<< "whileLoops " << DefaultTBuiltInResource.limits.whileLoops << "\n"
@@ -469,6 +487,24 @@ void DecodeResourceLimits(TBuiltInResource* resources, char* config)
resources->maxTaskWorkGroupSizeZ_NV = value;
else if (tokenStr == "MaxMeshViewCountNV")
resources->maxMeshViewCountNV = value;
+ else if (tokenStr == "MaxMeshOutputVerticesEXT")
+ resources->maxMeshOutputVerticesEXT = value;
+ else if (tokenStr == "MaxMeshOutputPrimitivesEXT")
+ resources->maxMeshOutputPrimitivesEXT = value;
+ else if (tokenStr == "MaxMeshWorkGroupSizeX_EXT")
+ resources->maxMeshWorkGroupSizeX_EXT = value;
+ else if (tokenStr == "MaxMeshWorkGroupSizeY_EXT")
+ resources->maxMeshWorkGroupSizeY_EXT = value;
+ else if (tokenStr == "MaxMeshWorkGroupSizeZ_EXT")
+ resources->maxMeshWorkGroupSizeZ_EXT = value;
+ else if (tokenStr == "MaxTaskWorkGroupSizeX_EXT")
+ resources->maxTaskWorkGroupSizeX_EXT = value;
+ else if (tokenStr == "MaxTaskWorkGroupSizeY_EXT")
+ resources->maxTaskWorkGroupSizeY_EXT = value;
+ else if (tokenStr == "MaxTaskWorkGroupSizeZ_EXT")
+ resources->maxTaskWorkGroupSizeZ_EXT = value;
+ else if (tokenStr == "MaxMeshViewCountEXT")
+ resources->maxMeshViewCountEXT = value;
else if (tokenStr == "nonInductiveForLoops")
resources->limits.nonInductiveForLoops = (value != 0);
else if (tokenStr == "whileLoops")
@@ -493,4 +529,12 @@ void DecodeResourceLimits(TBuiltInResource* resources, char* config)
}
}
-} // end namespace glslang
+TBuiltInResource* GetResources()
+{
+ return &Resources;
+}
+
+const TBuiltInResource* GetDefaultResources()
+{
+ return &DefaultTBuiltInResource;
+}
diff --git a/3rdparty/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp b/3rdparty/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp
index e62f92f7193..53a6b9c2fbc 100644
--- a/3rdparty/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/StandAlone/StandAlone.cpp
@@ -2,6 +2,7 @@
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
// Copyright (C) 2013-2016 LunarG, Inc.
// Copyright (C) 2016-2020 Google, Inc.
+// Modifications Copyright(C) 2021 Advanced Micro Devices, Inc.All rights reserved.
//
// All rights reserved.
//
@@ -40,7 +41,7 @@
#define _CRT_SECURE_NO_WARNINGS
#endif
-#include "ResourceLimits.h"
+#include "glslang/Public/ResourceLimits.h"
#include "Worklist.h"
#include "DirStackFileIncluder.h"
#include "./../glslang/Include/ShHandle.h"
@@ -65,6 +66,8 @@
// Build-time generated includes
#include "glslang/build_info.h"
+#include "glslang/glsl_intrinsic_header.h"
+
extern "C" {
GLSLANG_EXPORT void ShOutputHtml();
}
@@ -110,6 +113,8 @@ bool SpvToolsDisassembler = false;
bool SpvToolsValidate = false;
bool NaNClamp = false;
bool stripDebugInfo = false;
+bool emitNonSemanticShaderDebugInfo = false;
+bool emitNonSemanticShaderDebugSource = false;
bool beQuiet = false;
bool VulkanRulesRelaxed = false;
bool autoSampledTextures = false;
@@ -144,7 +149,6 @@ bool LinkFailed = false;
// array of unique places to leave the shader names and infologs for the asynchronous compiles
std::vector<std::unique_ptr<glslang::TWorkItem>> WorkItems;
-TBuiltInResource Resources;
std::string ConfigFile;
//
@@ -153,11 +157,11 @@ std::string ConfigFile;
void ProcessConfigFile()
{
if (ConfigFile.size() == 0)
- Resources = glslang::DefaultTBuiltInResource;
+ *GetResources() = *GetDefaultResources();
#ifndef GLSLANG_WEB
else {
char* configString = ReadFileData(ConfigFile.c_str());
- glslang::DecodeResourceLimits(&Resources, configString);
+ DecodeResourceLimits(GetResources(), configString);
FreeFileData(configString);
}
#endif
@@ -174,6 +178,8 @@ const char* shaderStageName = nullptr;
const char* variableName = nullptr;
bool HlslEnable16BitTypes = false;
bool HlslDX9compatible = false;
+bool HlslDxPositionW = false;
+bool EnhancedMsgs = false;
bool DumpBuiltinSymbols = false;
std::vector<std::string> IncludeDirectoryList;
@@ -187,6 +193,9 @@ glslang::EShTargetClientVersion ClientVersion; // not valid until Client i
glslang::EShTargetLanguage TargetLanguage = glslang::EShTargetNone;
glslang::EShTargetLanguageVersion TargetVersion; // not valid until TargetLanguage is set
+// GLSL version
+int GlslVersion = 0; // GLSL version specified on CLI, overrides #version in shader source
+
std::vector<std::string> Processes; // what should be recorded by OpModuleProcessed, or equivalent
// Per descriptor-set binding base data
@@ -263,6 +272,7 @@ protected:
// Track the user's #define and #undef from the command line.
TPreamble UserPreamble;
+std::string PreambleString;
//
// Create the default name for saving a binary if -o is not provided.
@@ -284,8 +294,8 @@ const char* GetBinaryName(EShLanguage stage)
case EShLangClosestHit: name = "rchit.spv"; break;
case EShLangMiss: name = "rmiss.spv"; break;
case EShLangCallable: name = "rcall.spv"; break;
- case EShLangMeshNV: name = "mesh.spv"; break;
- case EShLangTaskNV: name = "task.spv"; break;
+ case EShLangMesh : name = "mesh.spv"; break;
+ case EShLangTask : name = "task.spv"; break;
default: name = "unknown"; break;
}
} else
@@ -648,6 +658,48 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
lowerword == "flatten-uniform-array" ||
lowerword == "fua") {
Options |= EOptionFlattenUniformArrays;
+ } else if (lowerword == "glsl-version") {
+ if (argc > 1) {
+ if (strcmp(argv[1], "100") == 0) {
+ GlslVersion = 100;
+ } else if (strcmp(argv[1], "110") == 0) {
+ GlslVersion = 110;
+ } else if (strcmp(argv[1], "120") == 0) {
+ GlslVersion = 120;
+ } else if (strcmp(argv[1], "130") == 0) {
+ GlslVersion = 130;
+ } else if (strcmp(argv[1], "140") == 0) {
+ GlslVersion = 140;
+ } else if (strcmp(argv[1], "150") == 0) {
+ GlslVersion = 150;
+ } else if (strcmp(argv[1], "300es") == 0) {
+ GlslVersion = 300;
+ } else if (strcmp(argv[1], "310es") == 0) {
+ GlslVersion = 310;
+ } else if (strcmp(argv[1], "320es") == 0) {
+ GlslVersion = 320;
+ } else if (strcmp(argv[1], "330") == 0) {
+ GlslVersion = 330;
+ } else if (strcmp(argv[1], "400") == 0) {
+ GlslVersion = 400;
+ } else if (strcmp(argv[1], "410") == 0) {
+ GlslVersion = 410;
+ } else if (strcmp(argv[1], "420") == 0) {
+ GlslVersion = 420;
+ } else if (strcmp(argv[1], "430") == 0) {
+ GlslVersion = 430;
+ } else if (strcmp(argv[1], "440") == 0) {
+ GlslVersion = 440;
+ } else if (strcmp(argv[1], "450") == 0) {
+ GlslVersion = 450;
+ } else if (strcmp(argv[1], "460") == 0) {
+ GlslVersion = 460;
+ } else
+ Error("--glsl-version expected one of: 100, 110, 120, 130, 140, 150,\n"
+ "300es, 310es, 320es, 330\n"
+ "400, 410, 420, 430, 440, 450, 460");
+ }
+ bumpArg();
} else if (lowerword == "hlsl-offsets") {
Options |= EOptionHlslOffsets;
} else if (lowerword == "hlsl-iomap" ||
@@ -658,6 +710,10 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
HlslEnable16BitTypes = true;
} else if (lowerword == "hlsl-dx9-compatible") {
HlslDX9compatible = true;
+ } else if (lowerword == "hlsl-dx-position-w") {
+ HlslDxPositionW = true;
+ } else if (lowerword == "enhanced-msgs") {
+ EnhancedMsgs = true;
} else if (lowerword == "auto-sampled-textures") {
autoSampledTextures = true;
} else if (lowerword == "invert-y" || // synonyms
@@ -760,6 +816,9 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
} else if (strcmp(argv[1], "vulkan1.2") == 0) {
setVulkanSpv();
ClientVersion = glslang::EShTargetVulkan_1_2;
+ } else if (strcmp(argv[1], "vulkan1.3") == 0) {
+ setVulkanSpv();
+ ClientVersion = glslang::EShTargetVulkan_1_3;
} else if (strcmp(argv[1], "opengl") == 0) {
setOpenGlSpv();
ClientVersion = glslang::EShTargetOpenGL_450;
@@ -781,9 +840,13 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
} else if (strcmp(argv[1], "spirv1.5") == 0) {
TargetLanguage = glslang::EShTargetSpv;
TargetVersion = glslang::EShTargetSpv_1_5;
+ } else if (strcmp(argv[1], "spirv1.6") == 0) {
+ TargetLanguage = glslang::EShTargetSpv;
+ TargetVersion = glslang::EShTargetSpv_1_6;
} else
- Error("--target-env expected one of: vulkan1.0, vulkan1.1, vulkan1.2, opengl,\n"
- "spirv1.0, spirv1.1, spirv1.2, spirv1.3, spirv1.4, or spirv1.5");
+ Error("--target-env expected one of: vulkan1.0, vulkan1.1, vulkan1.2,\n"
+ "vulkan1.3, opengl, spirv1.0, spirv1.1, spirv1.2, spirv1.3,\n"
+ "spirv1.4, spirv1.5 or spirv1.6");
}
bumpArg();
} else if (lowerword == "undef-macro" ||
@@ -907,11 +970,21 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
case 'g':
// Override previous -g or -g0 argument
stripDebugInfo = false;
+ emitNonSemanticShaderDebugInfo = false;
Options &= ~EOptionDebug;
if (argv[0][2] == '0')
stripDebugInfo = true;
- else
+ else {
Options |= EOptionDebug;
+ if (argv[0][2] == 'V') {
+ emitNonSemanticShaderDebugInfo = true;
+ if (argv[0][3] == 'S') {
+ emitNonSemanticShaderDebugSource = true;
+ } else {
+ emitNonSemanticShaderDebugSource = false;
+ }
+ }
+ }
break;
case 'h':
usage();
@@ -1008,6 +1081,10 @@ void ProcessArguments(std::vector<std::unique_ptr<glslang::TWorkItem>>& workItem
TargetLanguage = glslang::EShTargetSpv;
TargetVersion = glslang::EShTargetSpv_1_5;
break;
+ case glslang::EShTargetVulkan_1_3:
+ TargetLanguage = glslang::EShTargetSpv;
+ TargetVersion = glslang::EShTargetSpv_1_6;
+ break;
case glslang::EShTargetOpenGL_450:
TargetLanguage = glslang::EShTargetSpv;
TargetVersion = glslang::EShTargetSpv_1_0;
@@ -1055,6 +1132,8 @@ void SetMessageOptions(EShMessages& messages)
messages = (EShMessages)(messages | EShMsgHlslDX9Compatible);
if (DumpBuiltinSymbols)
messages = (EShMessages)(messages | EShMsgBuiltinSymbolTable);
+ if (EnhancedMsgs)
+ messages = (EShMessages)(messages | EShMsgEnhanced);
}
//
@@ -1145,6 +1224,27 @@ struct ShaderCompUnit {
}
};
+// Writes a string into a depfile, escaping some special characters following the Makefile rules.
+static void writeEscapedDepString(std::ofstream& file, const std::string& str)
+{
+ for (char c : str) {
+ switch (c) {
+ case ' ':
+ case ':':
+ case '#':
+ case '[':
+ case ']':
+ case '\\':
+ file << '\\';
+ break;
+ case '$':
+ file << '$';
+ break;
+ }
+ file << c;
+ }
+}
+
// Writes a depfile similar to gcc -MMD foo.c
bool writeDepFile(std::string depfile, std::vector<std::string>& binaryFiles, const std::vector<std::string>& sources)
{
@@ -1152,10 +1252,12 @@ bool writeDepFile(std::string depfile, std::vector<std::string>& binaryFiles, co
if (file.fail())
return false;
- for (auto it = binaryFiles.begin(); it != binaryFiles.end(); it++) {
- file << *it << ":";
- for (auto it = sources.begin(); it != sources.end(); it++) {
- file << " " << *it;
+ for (auto binaryFile = binaryFiles.begin(); binaryFile != binaryFiles.end(); binaryFile++) {
+ writeEscapedDepString(file, *binaryFile);
+ file << ":";
+ for (auto sourceFile = sources.begin(); sourceFile != sources.end(); sourceFile++) {
+ file << " ";
+ writeEscapedDepString(file, *sourceFile);
}
file << std::endl;
}
@@ -1204,8 +1306,19 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
"Use '-e <name>'.\n");
shader->setSourceEntryPoint(sourceEntryPointName);
}
+
+ shader->setOverrideVersion(GlslVersion);
+
+ std::string intrinsicString = getIntrinsic(compUnit.text, compUnit.count);
+
+ PreambleString = "";
if (UserPreamble.isSet())
- shader->setPreamble(UserPreamble.get());
+ PreambleString.append(UserPreamble.get());
+
+ if (!intrinsicString.empty())
+ PreambleString.append(intrinsicString);
+
+ shader->setPreamble(PreambleString.c_str());
shader->addProcesses(Processes);
#ifndef GLSLANG_WEB
@@ -1271,6 +1384,15 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
if (Options & EOptionInvertY)
shader->setInvertY(true);
+ if (HlslDxPositionW)
+ shader->setDxPositionW(true);
+
+ if (EnhancedMsgs)
+ shader->setEnhancedMsgs();
+
+ if (emitNonSemanticShaderDebugInfo)
+ shader->setDebugInfo(true);
+
// Set up the environment, some subsettings take precedence over earlier
// ways of setting things.
if (Options & EOptionSpv) {
@@ -1294,7 +1416,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
#ifndef GLSLANG_WEB
if (Options & EOptionOutputPreprocessed) {
std::string str;
- if (shader->preprocess(&Resources, defaultVersion, ENoProfile, false, false, messages, &str, includer)) {
+ if (shader->preprocess(GetResources(), defaultVersion, ENoProfile, false, false, messages, &str, includer)) {
PutsIfNonEmpty(str.c_str());
} else {
CompileFailed = true;
@@ -1305,7 +1427,7 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
}
#endif
- if (! shader->parse(&Resources, defaultVersion, false, messages, includer))
+ if (! shader->parse(GetResources(), defaultVersion, false, messages, includer))
CompileFailed = true;
program.addShader(shader);
@@ -1362,9 +1484,15 @@ void CompileAndLinkShaderUnits(std::vector<ShaderCompUnit> compUnits)
std::vector<unsigned int> spirv;
spv::SpvBuildLogger logger;
glslang::SpvOptions spvOptions;
- if (Options & EOptionDebug)
+ if (Options & EOptionDebug) {
spvOptions.generateDebugInfo = true;
- else if (stripDebugInfo)
+ if (emitNonSemanticShaderDebugInfo) {
+ spvOptions.emitNonSemanticShaderDebugInfo = true;
+ if (emitNonSemanticShaderDebugSource) {
+ spvOptions.emitNonSemanticShaderDebugSource = true;
+ }
+ }
+ } else if (stripDebugInfo)
spvOptions.stripDebugInfo = true;
spvOptions.disableOptimizer = (Options & EOptionOptimizeDisable) != 0;
spvOptions.optimizeSize = (Options & EOptionOptimizeSize) != 0;
@@ -1483,7 +1611,7 @@ int singleMain()
#ifndef GLSLANG_WEB
if (Options & EOptionDumpConfig) {
- printf("%s", glslang::GetDefaultTBuiltInResourceString().c_str());
+ printf("%s", GetDefaultTBuiltInResourceString().c_str());
if (workList.empty())
return ESuccess;
}
@@ -1672,9 +1800,9 @@ EShLanguage FindLanguage(const std::string& name, bool parseStageName)
else if (stageName == "rcall")
return EShLangCallable;
else if (stageName == "mesh")
- return EShLangMeshNV;
+ return EShLangMesh;
else if (stageName == "task")
- return EShLangTaskNV;
+ return EShLangTask;
usage();
return EShLangVertex;
@@ -1709,7 +1837,7 @@ void CompileFile(const char* fileName, ShHandle compiler)
for (int i = 0; i < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++i) {
for (int j = 0; j < ((Options & EOptionMemoryLeakMode) ? 100 : 1); ++j) {
// ret = ShCompile(compiler, shaderStrings, NumShaderStrings, lengths, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages);
- ret = ShCompile(compiler, &shaderString, 1, nullptr, EShOptNone, &Resources, Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages);
+ ret = ShCompile(compiler, &shaderString, 1, nullptr, EShOptNone, GetResources(), Options, (Options & EOptionDefaultDesktop) ? 110 : 100, false, messages);
// const char* multi[12] = { "# ve", "rsion", " 300 e", "s", "\n#err",
// "or should be l", "ine 1", "string 5\n", "float glo", "bal",
// ";\n#error should be line 2\n void main() {", "global = 2.3;}" };
@@ -1798,6 +1926,8 @@ void usage()
" SPV_GOOGLE_hlsl_functionality1 extension\n"
" -g generate debug information\n"
" -g0 strip debug information\n"
+ " -gV generate nonsemantic shader debug information\n"
+ " -gVS generate nonsemantic shader debug information with source\n"
" -h print this usage message\n"
" -i intermediate tree (glslang AST) is printed out\n"
" -l link all input files together to form a single module\n"
@@ -1827,6 +1957,11 @@ void usage()
" -dumpfullversion | -dumpversion print bare major.minor.patchlevel\n"
" --flatten-uniform-arrays | --fua flatten uniform texture/sampler arrays to\n"
" scalars\n"
+ " --glsl-version {100 | 110 | 120 | 130 | 140 | 150 |\n"
+ " 300es | 310es | 320es | 330\n"
+ " 400 | 410 | 420 | 430 | 440 | 450 | 460}\n"
+ " set GLSL version, overrides #version\n"
+ " in shader sourcen\n"
" --hlsl-offsets allow block offsets to follow HLSL rules\n"
" works independently of source language\n"
" --hlsl-iomap perform IO mapping in HLSL register space\n"
@@ -1834,7 +1969,10 @@ void usage()
" --hlsl-dx9-compatible interprets sampler declarations as a\n"
" texture/sampler combo like DirectX9 would,\n"
" and recognizes DirectX9-specific semantics\n"
+ " --hlsl-dx-position-w W component of SV_Position in HLSL fragment\n"
+ " shaders compatible with DirectX\n"
" --invert-y | --iy invert position.Y output in vertex shader\n"
+ " --enhanced-msgs print more readable error messages (GLSL only)\n"
" --keep-uncalled | --ku don't eliminate uncalled functions\n"
" --nan-clamp favor non-NaN operand in min, max, and clamp\n"
" --no-storage-format | --nsf use Unknown image format\n"
@@ -1909,8 +2047,9 @@ void usage()
" --sep synonym for --source-entrypoint\n"
" --stdin read from stdin instead of from a file;\n"
" requires providing the shader stage using -S\n"
- " --target-env {vulkan1.0 | vulkan1.1 | vulkan1.2 | opengl | \n"
- " spirv1.0 | spirv1.1 | spirv1.2 | spirv1.3 | spirv1.4 | spirv1.5}\n"
+ " --target-env {vulkan1.0 | vulkan1.1 | vulkan1.2 | vulkan1.3 | opengl |\n"
+ " spirv1.0 | spirv1.1 | spirv1.2 | spirv1.3 | spirv1.4 |\n"
+ " spirv1.5 | spirv1.6}\n"
" Set the execution environment that the\n"
" generated code will be executed in.\n"
" Defaults to:\n"
@@ -1919,6 +2058,7 @@ void usage()
" * spirv1.0 under --target-env vulkan1.0\n"
" * spirv1.3 under --target-env vulkan1.1\n"
" * spirv1.5 under --target-env vulkan1.2\n"
+ " * spirv1.6 under --target-env vulkan1.3\n"
" Multiple --target-env can be specified.\n"
" --variable-name <name>\n"
" --vn <name> creates a C header file that contains a\n"
diff --git a/3rdparty/bgfx/3rdparty/glslang/StandAlone/resource_limits_c.cpp b/3rdparty/bgfx/3rdparty/glslang/StandAlone/resource_limits_c.cpp
index a1f681c7b8f..0eeac23a5ea 100644
--- a/3rdparty/bgfx/3rdparty/glslang/StandAlone/resource_limits_c.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/StandAlone/resource_limits_c.cpp
@@ -26,15 +26,20 @@ 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.
**/
-#include "resource_limits_c.h"
-#include "ResourceLimits.h"
+#include "glslang/Public/resource_limits_c.h"
+#include "glslang/Public/ResourceLimits.h"
#include <stdlib.h>
#include <string.h>
#include <string>
+glslang_resource_t* glslang_resource(void)
+{
+ return reinterpret_cast<glslang_resource_t*>(GetResources());
+}
+
const glslang_resource_t* glslang_default_resource(void)
{
- return reinterpret_cast<const glslang_resource_t*>(&glslang::DefaultTBuiltInResource);
+ return reinterpret_cast<const glslang_resource_t*>(GetDefaultResources());
}
#if defined(__clang__) || defined(__GNUC__)
@@ -47,7 +52,7 @@ const glslang_resource_t* glslang_default_resource(void)
const char* glslang_default_resource_string()
{
- std::string cpp_str = glslang::GetDefaultTBuiltInResourceString();
+ std::string cpp_str = GetDefaultTBuiltInResourceString();
char* c_str = (char*)malloc(cpp_str.length() + 1);
strcpy(c_str, cpp_str.c_str());
return c_str;
@@ -61,5 +66,5 @@ const char* glslang_default_resource_string()
void glslang_decode_resource_limits(glslang_resource_t* resources, char* config)
{
- glslang::DecodeResourceLimits(reinterpret_cast<TBuiltInResource*>(resources), config);
+ DecodeResourceLimits(reinterpret_cast<TBuiltInResource*>(resources), config);
}
diff --git a/3rdparty/bgfx/3rdparty/glslang/StandAlone/spirv-remap.cpp b/3rdparty/bgfx/3rdparty/glslang/StandAlone/spirv-remap.cpp
index 48878c3af08..15c3ac513bd 100644
--- a/3rdparty/bgfx/3rdparty/glslang/StandAlone/spirv-remap.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/StandAlone/spirv-remap.cpp
@@ -105,6 +105,32 @@ namespace {
}
}
+ // Read strings from a file
+ void read(std::vector<std::string>& strings, const std::string& inFilename, int verbosity)
+ {
+ std::ifstream fp;
+
+ if (verbosity > 0)
+ logHandler(std::string(" reading: ") + inFilename);
+
+ strings.clear();
+ fp.open(inFilename, std::fstream::in);
+
+ if (fp.fail())
+ errHandler("error opening file for read: ");
+
+ std::string line;
+ while (std::getline(fp, line))
+ {
+ // Ignore empty lines and lines starting with the comment marker '#'.
+ if (line.length() == 0 || line[0] == '#') {
+ continue;
+ }
+
+ strings.push_back(line);
+ }
+ }
+
void write(std::vector<SpvWord>& spv, const std::string& outFile, int verbosity)
{
if (outFile.empty())
@@ -144,6 +170,7 @@ namespace {
<< " [--dce (all|types|funcs)]"
<< " [--opt (all|loadstore)]"
<< " [--strip-all | --strip all | -s]"
+ << " [--strip-white-list]"
<< " [--do-everything]"
<< " --input | -i file1 [file2...] --output|-o DESTDIR"
<< std::endl;
@@ -156,16 +183,18 @@ namespace {
// grind through each SPIR in turn
void execute(const std::vector<std::string>& inputFile, const std::string& outputDir,
- int opts, int verbosity)
+ const std::string& whiteListFile, int opts, int verbosity)
{
+ std::vector<std::string> whiteListStrings;
+ if(!whiteListFile.empty())
+ read(whiteListStrings, whiteListFile, verbosity);
+
for (auto it = inputFile.cbegin(); it != inputFile.cend(); ++it) {
const std::string &filename = *it;
std::vector<SpvWord> spv;
read(spv, filename, verbosity);
- spv::spirvbin_t(verbosity).remap(spv, opts);
-
+ spv::spirvbin_t(verbosity).remap(spv, whiteListStrings, opts);
const std::string outfile = outputDir + path_sep_char() + basename(filename);
-
write(spv, outfile, verbosity);
}
@@ -176,6 +205,7 @@ namespace {
// Parse command line options
void parseCmdLine(int argc, char** argv, std::vector<std::string>& inputFile,
std::string& outputDir,
+ std::string& stripWhiteListFile,
int& options,
int& verbosity)
{
@@ -245,6 +275,9 @@ namespace {
options = options | spv::spirvbin_t::STRIP;
++a;
}
+ } else if (arg == "--strip-white-list") {
+ ++a;
+ stripWhiteListFile = argv[a++];
} else if (arg == "--dce") {
// Parse comma (or colon, etc) separated list of things to dce
++a;
@@ -315,6 +348,7 @@ int main(int argc, char** argv)
{
std::vector<std::string> inputFile;
std::string outputDir;
+ std::string whiteListFile;
int opts;
int verbosity;
@@ -329,13 +363,13 @@ int main(int argc, char** argv)
if (argc < 2)
usage(argv[0]);
- parseCmdLine(argc, argv, inputFile, outputDir, opts, verbosity);
+ parseCmdLine(argc, argv, inputFile, outputDir, whiteListFile, opts, verbosity);
if (outputDir.empty())
usage(argv[0], "Output directory required");
// Main operations: read, remap, and write.
- execute(inputFile, outputDir, opts, verbosity);
+ execute(inputFile, outputDir, whiteListFile, opts, verbosity);
// If we get here, everything went OK! Nothing more to be done.
}
diff --git a/3rdparty/bgfx/3rdparty/glslang/build_info.h b/3rdparty/bgfx/3rdparty/glslang/build_info.h
index 661c4a3c1c4..e711b209572 100644
--- a/3rdparty/bgfx/3rdparty/glslang/build_info.h
+++ b/3rdparty/bgfx/3rdparty/glslang/build_info.h
@@ -35,28 +35,28 @@
#define GLSLANG_BUILD_INFO
#define GLSLANG_VERSION_MAJOR 11
-#define GLSLANG_VERSION_MINOR 6
+#define GLSLANG_VERSION_MINOR 12
#define GLSLANG_VERSION_PATCH 0
#define GLSLANG_VERSION_FLAVOR ""
#define GLSLANG_VERSION_GREATER_THAN(major, minor, patch) \
- (((major) > GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
- (((minor) > GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
- ((patch) > GLSLANG_VERSION_PATCH)))))
+ ((GLSLANG_VERSION_MAJOR) > (major) || ((major) == GLSLANG_VERSION_MAJOR && \
+ ((GLSLANG_VERSION_MINOR) > (minor) || ((minor) == GLSLANG_VERSION_MINOR && \
+ (GLSLANG_VERSION_PATCH) > (patch)))))
#define GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch) \
- (((major) > GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
- (((minor) > GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
- ((patch) >= GLSLANG_VERSION_PATCH)))))
+ ((GLSLANG_VERSION_MAJOR) > (major) || ((major) == GLSLANG_VERSION_MAJOR && \
+ ((GLSLANG_VERSION_MINOR) > (minor) || ((minor) == GLSLANG_VERSION_MINOR && \
+ (GLSLANG_VERSION_PATCH >= (patch))))))
#define GLSLANG_VERSION_LESS_THAN(major, minor, patch) \
- (((major) < GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
- (((minor) < GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
- ((patch) < GLSLANG_VERSION_PATCH)))))
+ ((GLSLANG_VERSION_MAJOR) < (major) || ((major) == GLSLANG_VERSION_MAJOR && \
+ ((GLSLANG_VERSION_MINOR) < (minor) || ((minor) == GLSLANG_VERSION_MINOR && \
+ (GLSLANG_VERSION_PATCH) < (patch)))))
#define GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch) \
- (((major) < GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
- (((minor) < GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
- ((patch) <= GLSLANG_VERSION_PATCH)))))
+ ((GLSLANG_VERSION_MAJOR) < (major) || ((major) == GLSLANG_VERSION_MAJOR && \
+ ((GLSLANG_VERSION_MINOR) < (minor) || ((minor) == GLSLANG_VERSION_MINOR && \
+ (GLSLANG_VERSION_PATCH <= (patch))))))
#endif // GLSLANG_BUILD_INFO
diff --git a/3rdparty/bgfx/3rdparty/glslang/build_info.h.tmpl b/3rdparty/bgfx/3rdparty/glslang/build_info.h.tmpl
deleted file mode 100644
index 5b5e9e62c71..00000000000
--- a/3rdparty/bgfx/3rdparty/glslang/build_info.h.tmpl
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright (C) 2020 The Khronos Group 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 The Khronos Group 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.
-
-#ifndef GLSLANG_BUILD_INFO
-#define GLSLANG_BUILD_INFO
-
-#define GLSLANG_VERSION_MAJOR @major@
-#define GLSLANG_VERSION_MINOR @minor@
-#define GLSLANG_VERSION_PATCH @patch@
-#define GLSLANG_VERSION_FLAVOR "@flavor@"
-
-#define GLSLANG_VERSION_GREATER_THAN(major, minor, patch) \
- (((major) > GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
- (((minor) > GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
- ((patch) > GLSLANG_VERSION_PATCH)))))
-
-#define GLSLANG_VERSION_GREATER_OR_EQUAL_TO(major, minor, patch) \
- (((major) > GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
- (((minor) > GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
- ((patch) >= GLSLANG_VERSION_PATCH)))))
-
-#define GLSLANG_VERSION_LESS_THAN(major, minor, patch) \
- (((major) < GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
- (((minor) < GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
- ((patch) < GLSLANG_VERSION_PATCH)))))
-
-#define GLSLANG_VERSION_LESS_OR_EQUAL_TO(major, minor, patch) \
- (((major) < GLSLANG_VERSION_MAJOR) || ((major) == GLSLANG_VERSION_MAJOR && \
- (((minor) < GLSLANG_VERSION_MINOR) || ((minor) == GLSLANG_VERSION_MINOR && \
- ((patch) <= GLSLANG_VERSION_PATCH)))))
-
-#endif // GLSLANG_BUILD_INFO
diff --git a/3rdparty/bgfx/3rdparty/glslang/build_info.py b/3rdparty/bgfx/3rdparty/glslang/build_info.py
deleted file mode 100755
index 7c1998f6e0e..00000000000
--- a/3rdparty/bgfx/3rdparty/glslang/build_info.py
+++ /dev/null
@@ -1,226 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright (c) 2020 Google 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.
-
-import datetime
-import errno
-import os
-import os.path
-import re
-import subprocess
-import sys
-import time
-
-usage = """{} emits a string to stdout or file with project version information.
-
-args: <project-dir> [<input-string>] [-i <input-file>] [-o <output-file>]
-
-Either <input-string> or -i <input-file> needs to be provided.
-
-The tool will output the provided string or file content with the following
-tokens substituted:
-
- <major> - The major version point parsed from the CHANGES.md file.
- <minor> - The minor version point parsed from the CHANGES.md file.
- <patch> - The point version point parsed from the CHANGES.md file.
- <flavor> - The optional dash suffix parsed from the CHANGES.md file (excluding
- dash prefix).
- <-flavor> - The optional dash suffix parsed from the CHANGES.md file (including
- dash prefix).
- <date> - The optional date of the release in the form YYYY-MM-DD
- <commit> - The git commit information for the directory taken from
- "git describe" if that succeeds, or "git rev-parse HEAD"
- if that succeeds, or otherwise a message containing the phrase
- "unknown hash".
-
--o is an optional flag for writing the output string to the given file. If
- ommitted then the string is printed to stdout.
-"""
-
-def mkdir_p(directory):
- """Make the directory, and all its ancestors as required. Any of the
- directories are allowed to already exist."""
-
- if directory == "":
- # We're being asked to make the current directory.
- return
-
- try:
- os.makedirs(directory)
- except OSError as e:
- if e.errno == errno.EEXIST and os.path.isdir(directory):
- pass
- else:
- raise
-
-
-def command_output(cmd, directory):
- """Runs a command in a directory and returns its standard output stream.
-
- Captures the standard error stream.
-
- Raises a RuntimeError if the command fails to launch or otherwise fails.
- """
- p = subprocess.Popen(cmd,
- cwd=directory,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- (stdout, _) = p.communicate()
- if p.returncode != 0:
- raise RuntimeError('Failed to run %s in %s' % (cmd, directory))
- return stdout
-
-
-def deduce_software_version(directory):
- """Returns a software version number parsed from the CHANGES.md file
- in the given directory.
-
- The CHANGES.md file describes most recent versions first.
- """
-
- # Match the first well-formed version-and-date line.
- # Allow trailing whitespace in the checked-out source code has
- # unexpected carriage returns on a linefeed-only system such as
- # Linux.
- pattern = re.compile(r'^#* +(\d+)\.(\d+)\.(\d+)(-\w+)? (\d\d\d\d-\d\d-\d\d)? *$')
- changes_file = os.path.join(directory, 'CHANGES.md')
- with open(changes_file, mode='r') as f:
- for line in f.readlines():
- match = pattern.match(line)
- if match:
- flavor = match.group(4)
- if flavor == None:
- flavor = ""
- return {
- "major": match.group(1),
- "minor": match.group(2),
- "patch": match.group(3),
- "flavor": flavor.lstrip("-"),
- "-flavor": flavor,
- "date": match.group(5),
- }
- raise Exception('No version number found in {}'.format(changes_file))
-
-
-def describe(directory):
- """Returns a string describing the current Git HEAD version as descriptively
- as possible.
-
- Runs 'git describe', or alternately 'git rev-parse HEAD', in directory. If
- successful, returns the output; otherwise returns 'unknown hash, <date>'."""
- try:
- # decode() is needed here for Python3 compatibility. In Python2,
- # str and bytes are the same type, but not in Python3.
- # Popen.communicate() returns a bytes instance, which needs to be
- # decoded into text data first in Python3. And this decode() won't
- # hurt Python2.
- return command_output(['git', 'describe'], directory).rstrip().decode()
- except:
- try:
- return command_output(
- ['git', 'rev-parse', 'HEAD'], directory).rstrip().decode()
- except:
- # This is the fallback case where git gives us no information,
- # e.g. because the source tree might not be in a git tree.
- # In this case, usually use a timestamp. However, to ensure
- # reproducible builds, allow the builder to override the wall
- # clock time with environment variable SOURCE_DATE_EPOCH
- # containing a (presumably) fixed timestamp.
- timestamp = int(os.environ.get('SOURCE_DATE_EPOCH', time.time()))
- formatted = datetime.datetime.utcfromtimestamp(timestamp).isoformat()
- return 'unknown hash, {}'.format(formatted)
-
-def parse_args():
- directory = None
- input_string = None
- input_file = None
- output_file = None
-
- if len(sys.argv) < 2:
- raise Exception("Invalid number of arguments")
-
- directory = sys.argv[1]
- i = 2
-
- if not sys.argv[i].startswith("-"):
- input_string = sys.argv[i]
- i = i + 1
-
- while i < len(sys.argv):
- opt = sys.argv[i]
- i = i + 1
-
- if opt == "-i" or opt == "-o":
- if i == len(sys.argv):
- raise Exception("Expected path after {}".format(opt))
- val = sys.argv[i]
- i = i + 1
- if (opt == "-i"):
- input_file = val
- elif (opt == "-o"):
- output_file = val
- else:
- raise Exception("Unknown flag {}".format(opt))
-
- return {
- "directory": directory,
- "input_string": input_string,
- "input_file": input_file,
- "output_file": output_file,
- }
-
-def main():
- args = None
- try:
- args = parse_args()
- except Exception as e:
- print(e)
- print("\nUsage:\n")
- print(usage.format(sys.argv[0]))
- sys.exit(1)
-
- directory = args["directory"]
- template = args["input_string"]
- if template == None:
- with open(args["input_file"], 'r') as f:
- template = f.read()
- output_file = args["output_file"]
-
- software_version = deduce_software_version(directory)
- commit = describe(directory)
- output = template \
- .replace("@major@", software_version["major"]) \
- .replace("@minor@", software_version["minor"]) \
- .replace("@patch@", software_version["patch"]) \
- .replace("@flavor@", software_version["flavor"]) \
- .replace("@-flavor@", software_version["-flavor"]) \
- .replace("@date@", software_version["date"]) \
- .replace("@commit@", commit)
-
- if output_file is None:
- print(output)
- else:
- mkdir_p(os.path.dirname(output_file))
-
- if os.path.isfile(output_file):
- with open(output_file, 'r') as f:
- if output == f.read():
- return
-
- with open(output_file, 'w') as f:
- f.write(output)
-
-if __name__ == '__main__':
- main()
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp
index 2e04f53aceb..1465ce17a14 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/CInterface/glslang_c_interface.cpp
@@ -33,11 +33,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "glslang/Include/glslang_c_interface.h"
#include "StandAlone/DirStackFileIncluder.h"
-#include "StandAlone/ResourceLimits.h"
+#include "glslang/Public/ResourceLimits.h"
#include "glslang/Include/ShHandle.h"
#include "glslang/Include/ResourceLimits.h"
#include "glslang/MachineIndependent/Versions.h"
+#include "glslang/MachineIndependent/localintermediate.h"
static_assert(int(GLSLANG_STAGE_COUNT) == EShLangCount, "");
static_assert(int(GLSLANG_STAGE_MASK_COUNT) == EShLanguageMaskCount, "");
@@ -191,10 +192,10 @@ static EShLanguage c_shader_stage(glslang_stage_t stage)
return EShLangMiss;
case GLSLANG_STAGE_CALLABLE_NV:
return EShLangCallable;
- case GLSLANG_STAGE_TASK_NV:
- return EShLangTaskNV;
- case GLSLANG_STAGE_MESH_NV:
- return EShLangMeshNV;
+ case GLSLANG_STAGE_TASK:
+ return EShLangTask;
+ case GLSLANG_STAGE_MESH:
+ return EShLangMesh;
default:
break;
}
@@ -244,6 +245,8 @@ c_shader_target_language_version(glslang_target_language_version_t target_langua
return glslang::EShTargetSpv_1_4;
case GLSLANG_TARGET_SPV_1_5:
return glslang::EShTargetSpv_1_5;
+ case GLSLANG_TARGET_SPV_1_6:
+ return glslang::EShTargetSpv_1_6;
default:
break;
}
@@ -269,6 +272,10 @@ static glslang::EShTargetClientVersion c_shader_client_version(glslang_target_cl
switch (client_version) {
case GLSLANG_TARGET_VULKAN_1_1:
return glslang::EShTargetVulkan_1_1;
+ case GLSLANG_TARGET_VULKAN_1_2:
+ return glslang::EShTargetVulkan_1_2;
+ case GLSLANG_TARGET_VULKAN_1_3:
+ return glslang::EShTargetVulkan_1_3;
case GLSLANG_TARGET_OPENGL_450:
return glslang::EShTargetOpenGL_450;
default:
@@ -344,6 +351,42 @@ GLSLANG_EXPORT glslang_shader_t* glslang_shader_create(const glslang_input_t* in
return shader;
}
+GLSLANG_EXPORT void glslang_shader_set_preamble(glslang_shader_t* shader, const char* s) {
+ shader->shader->setPreamble(s);
+}
+
+GLSLANG_EXPORT void glslang_shader_shift_binding(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base)
+{
+ const glslang::TResourceType res_type = glslang::TResourceType(res);
+ shader->shader->setShiftBinding(res_type, base);
+}
+
+GLSLANG_EXPORT void glslang_shader_shift_binding_for_set(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base, unsigned int set)
+{
+ const glslang::TResourceType res_type = glslang::TResourceType(res);
+ shader->shader->setShiftBindingForSet(res_type, base, set);
+}
+
+GLSLANG_EXPORT void glslang_shader_set_options(glslang_shader_t* shader, int options)
+{
+ if (options & GLSLANG_SHADER_AUTO_MAP_BINDINGS) {
+ shader->shader->setAutoMapBindings(true);
+ }
+
+ if (options & GLSLANG_SHADER_AUTO_MAP_LOCATIONS) {
+ shader->shader->setAutoMapLocations(true);
+ }
+
+ if (options & GLSLANG_SHADER_VULKAN_RULES_RELAXED) {
+ shader->shader->setEnvInputVulkanRulesRelaxed();
+ }
+}
+
+GLSLANG_EXPORT void glslang_shader_set_glsl_version(glslang_shader_t* shader, int version)
+{
+ shader->shader->setOverrideVersion(version);
+}
+
GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader)
{
return shader->preprocessedGLSL.c_str();
@@ -417,6 +460,21 @@ GLSLANG_EXPORT int glslang_program_link(glslang_program_t* program, int messages
return (int)program->program->link((EShMessages)messages);
}
+GLSLANG_EXPORT void glslang_program_add_source_text(glslang_program_t* program, glslang_stage_t stage, const char* text, size_t len) {
+ glslang::TIntermediate* intermediate = program->program->getIntermediate(c_shader_stage(stage));
+ intermediate->addSourceText(text, len);
+}
+
+GLSLANG_EXPORT void glslang_program_set_source_file(glslang_program_t* program, glslang_stage_t stage, const char* file) {
+ glslang::TIntermediate* intermediate = program->program->getIntermediate(c_shader_stage(stage));
+ intermediate->setSourceFile(file);
+}
+
+GLSLANG_EXPORT int glslang_program_map_io(glslang_program_t* program)
+{
+ return (int)program->program->mapIO();
+}
+
GLSLANG_EXPORT const char* glslang_program_get_info_log(glslang_program_t* program)
{
return program->program->getInfoLog();
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Windows/main.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl
index 0bcde7b6603..7cf545d94df 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Windows/main.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/ExtensionHeaders/GL_EXT_shader_realtime_clock.glsl
@@ -1,5 +1,9 @@
//
// Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
+// Copyright (C) 2013-2016 LunarG, Inc.
+// Copyright (C) 2016-2020 Google, Inc.
+// Modifications Copyright(C) 2021 Advanced Micro Devices, Inc.All rights reserved.
+//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -32,43 +36,3 @@
// POSSIBILITY OF SUCH DAMAGE.
//
-#include "InitializeDll.h"
-
-#define STRICT
-#define VC_EXTRALEAN 1
-#include <windows.h>
-#include <assert.h>
-
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
-{
- switch (fdwReason)
- {
- case DLL_PROCESS_ATTACH:
-
- if (! glslang::InitProcess())
- return FALSE;
- break;
- case DLL_THREAD_ATTACH:
-
- if (! glslang::InitThread())
- return FALSE;
- break;
-
- case DLL_THREAD_DETACH:
-
- if (! glslang::DetachThread())
- return FALSE;
- break;
-
- case DLL_PROCESS_DETACH:
-
- glslang::DetachProcess();
- break;
-
- default:
- assert(0 && "DllMain(): Reason for calling DLL Main is unknown");
- return FALSE;
- }
-
- return TRUE;
-}
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp
index bd4af922a02..a01f24035d0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslGrammar.cpp
@@ -3428,7 +3428,7 @@ bool HlslGrammar::acceptCompoundStatement(TIntermNode*& retStatement)
}
}
if (compoundStatement)
- compoundStatement->setOperator(EOpSequence);
+ compoundStatement->setOperator(intermediate.getDebugInfo() ? EOpScope : EOpSequence);
retStatement = compoundStatement;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp
index 39b3ecac9fb..62e46a0934d 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.cpp
@@ -1754,6 +1754,18 @@ void HlslParseContext::handleEntryPointAttributes(const TSourceLoc& loc, const T
intermediate.setLocalSize(lid, sequence[lid]->getAsConstantUnion()->getConstArray()[0].getIConst());
break;
}
+ case EatInstance:
+ {
+ int invocations;
+
+ if (!it->getInt(invocations)) {
+ error(loc, "invalid instance", "", "");
+ } else {
+ if (!intermediate.setInvocations(invocations))
+ error(loc, "cannot change previously set instance attribute", "", "");
+ }
+ break;
+ }
case EatMaxVertexCount:
{
int maxVertexCount;
@@ -2167,8 +2179,21 @@ TIntermNode* HlslParseContext::transformEntryPoint(const TSourceLoc& loc, TFunct
TIntermSymbol* arg = intermediate.addSymbol(*argVars.back());
handleFunctionArgument(&callee, callingArgs, arg);
if (param.type->getQualifier().isParamInput()) {
- intermediate.growAggregate(synthBody, handleAssign(loc, EOpAssign, arg,
- intermediate.addSymbol(**inputIt)));
+ TIntermTyped* input = intermediate.addSymbol(**inputIt);
+ if (input->getType().getQualifier().builtIn == EbvFragCoord && intermediate.getDxPositionW()) {
+ // Replace FragCoord W with reciprocal
+ auto pos_xyz = handleDotDereference(loc, input, "xyz");
+ auto pos_w = handleDotDereference(loc, input, "w");
+ auto one = intermediate.addConstantUnion(1.0, EbtFloat, loc);
+ auto recip_w = intermediate.addBinaryMath(EOpDiv, one, pos_w, loc);
+ TIntermAggregate* dst = new TIntermAggregate(EOpConstructVec4);
+ dst->getSequence().push_back(pos_xyz);
+ dst->getSequence().push_back(recip_w);
+ dst->setType(TType(EbtFloat, EvqTemporary, 4));
+ dst->setLoc(loc);
+ input = dst;
+ }
+ intermediate.growAggregate(synthBody, handleAssign(loc, EOpAssign, arg, input));
inputIt++;
}
if (param.type->getQualifier().storage == EvqUniform) {
@@ -2417,6 +2442,11 @@ void HlslParseContext::remapNonEntryPointIO(TFunction& function)
clearUniformInputOutput(function[i].type->getQualifier());
}
+TIntermNode* HlslParseContext::handleDeclare(const TSourceLoc& loc, TIntermTyped* var)
+{
+ return intermediate.addUnaryNode(EOpDeclare, var, loc, TType(EbtVoid));
+}
+
// Handle function returns, including type conversions to the function return type
// if necessary.
TIntermNode* HlslParseContext::handleReturnValue(const TSourceLoc& loc, TIntermTyped* value)
@@ -2452,6 +2482,62 @@ void HlslParseContext::handleFunctionArgument(TFunction* function,
arguments = newArg;
}
+// FragCoord may require special loading: we can optionally reciprocate W.
+TIntermTyped* HlslParseContext::assignFromFragCoord(const TSourceLoc& loc, TOperator op,
+ TIntermTyped* left, TIntermTyped* right)
+{
+ // If we are not asked for reciprocal W, use a plain old assign.
+ if (!intermediate.getDxPositionW())
+ return intermediate.addAssign(op, left, right, loc);
+
+ // If we get here, we should reciprocate W.
+ TIntermAggregate* assignList = nullptr;
+
+ // If this is a complex rvalue, we don't want to dereference it many times. Create a temporary.
+ TVariable* rhsTempVar = nullptr;
+ rhsTempVar = makeInternalVariable("@fragcoord", right->getType());
+ rhsTempVar->getWritableType().getQualifier().makeTemporary();
+
+ {
+ TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc);
+ assignList = intermediate.growAggregate(assignList,
+ intermediate.addAssign(EOpAssign, rhsTempSym, right, loc), loc);
+ }
+
+ // tmp.w = 1.0 / tmp.w
+ {
+ const int W = 3;
+
+ TIntermTyped* tempSymL = intermediate.addSymbol(*rhsTempVar, loc);
+ TIntermTyped* tempSymR = intermediate.addSymbol(*rhsTempVar, loc);
+ TIntermTyped* index = intermediate.addConstantUnion(W, loc);
+
+ TIntermTyped* lhsElement = intermediate.addIndex(EOpIndexDirect, tempSymL, index, loc);
+ TIntermTyped* rhsElement = intermediate.addIndex(EOpIndexDirect, tempSymR, index, loc);
+
+ const TType derefType(right->getType(), 0);
+
+ lhsElement->setType(derefType);
+ rhsElement->setType(derefType);
+
+ auto one = intermediate.addConstantUnion(1.0, EbtFloat, loc);
+ auto recip_w = intermediate.addBinaryMath(EOpDiv, one, rhsElement, loc);
+
+ assignList = intermediate.growAggregate(assignList, intermediate.addAssign(EOpAssign, lhsElement, recip_w, loc));
+ }
+
+ // Assign the rhs temp (now with W reciprocal) to the final output
+ {
+ TIntermTyped* rhsTempSym = intermediate.addSymbol(*rhsTempVar, loc);
+ assignList = intermediate.growAggregate(assignList, intermediate.addAssign(op, left, rhsTempSym, loc));
+ }
+
+ assert(assignList != nullptr);
+ assignList->setOperator(EOpSequence);
+
+ return assignList;
+}
+
// Position may require special handling: we can optionally invert Y.
// See: https://github.com/KhronosGroup/glslang/issues/1173
// https://github.com/KhronosGroup/glslang/issues/494
@@ -3071,6 +3157,10 @@ TIntermTyped* HlslParseContext::handleAssign(const TSourceLoc& loc, TOperator op
subSplitLeft, subSplitRight);
assignList = intermediate.growAggregate(assignList, clipCullAssign, loc);
+ } else if (subSplitRight->getType().getQualifier().builtIn == EbvFragCoord) {
+ // FragCoord can require special handling: see comment above assignFromFragCoord
+ TIntermTyped* fragCoordAssign = assignFromFragCoord(loc, op, subSplitLeft, subSplitRight);
+ assignList = intermediate.growAggregate(assignList, fragCoordAssign, loc);
} else if (assignsClipPos(subSplitLeft)) {
// Position can require special handling: see comment above assignPosition
TIntermTyped* positionAssign = assignPosition(loc, op, subSplitLeft, subSplitRight);
@@ -5357,7 +5447,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*&
}
case EOpWavePrefixCountBits:
{
- // Mapped to subgroupBallotInclusiveBitCount(subgroupBallot())
+ // Mapped to subgroupBallotExclusiveBitCount(subgroupBallot())
// builtin
// uvec4 type.
@@ -5371,7 +5461,7 @@ void HlslParseContext::decomposeIntrinsic(const TSourceLoc& loc, TIntermTyped*&
TType uintType(EbtUint, EvqTemporary);
node = intermediate.addBuiltInFunctionCall(loc,
- EOpSubgroupBallotInclusiveBitCount, true, res, uintType);
+ EOpSubgroupBallotExclusiveBitCount, true, res, uintType);
break;
}
@@ -6935,6 +7025,9 @@ void HlslParseContext::shareStructBufferType(TType& type)
if (lhs.isStruct() != rhs.isStruct())
return false;
+ if (lhs.getQualifier().builtIn != rhs.getQualifier().builtIn)
+ return false;
+
if (lhs.isStruct() && rhs.isStruct()) {
if (lhs.getStruct()->size() != rhs.getStruct()->size())
return false;
@@ -7947,11 +8040,16 @@ TIntermNode* HlslParseContext::declareVariable(const TSourceLoc& loc, const TStr
if (flattenVar)
flatten(*symbol->getAsVariable(), symbolTable.atGlobalLevel());
- if (initializer == nullptr)
- return nullptr;
+ TVariable* variable = symbol->getAsVariable();
+
+ if (initializer == nullptr) {
+ if (intermediate.getDebugInfo())
+ return executeDeclaration(loc, variable);
+ else
+ return nullptr;
+ }
// Deal with initializer
- TVariable* variable = symbol->getAsVariable();
if (variable == nullptr) {
error(loc, "initializer requires a variable, not a member", identifier.c_str(), "");
return nullptr;
@@ -8018,6 +8116,24 @@ TVariable* HlslParseContext::declareNonArray(const TSourceLoc& loc, const TStrin
return nullptr;
}
+// Return a declaration of a temporary variable
+//
+// This is used to force a variable to be declared in the correct scope
+// when debug information is being generated.
+
+TIntermNode* HlslParseContext::executeDeclaration(const TSourceLoc& loc, TVariable* variable)
+{
+ //
+ // Identifier must be of type temporary.
+ //
+ TStorageQualifier qualifier = variable->getType().getQualifier().storage;
+ if (qualifier != EvqTemporary)
+ return nullptr;
+
+ TIntermSymbol* intermSymbol = intermediate.addSymbol(*variable, loc);
+ return handleDeclare(loc, intermSymbol);
+}
+
//
// Handle all types of initializers from the grammar.
//
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.h b/3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.h
index 2d7165cfcd7..96d85f43479 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/HLSL/hlslParseHelper.h
@@ -87,6 +87,7 @@ public:
void handleFunctionBody(const TSourceLoc&, TFunction&, TIntermNode* functionBody, TIntermNode*& node);
void remapEntryPointIO(TFunction& function, TVariable*& returnValue, TVector<TVariable*>& inputs, TVector<TVariable*>& outputs);
void remapNonEntryPointIO(TFunction& function);
+ TIntermNode* handleDeclare(const TSourceLoc&, TIntermTyped*);
TIntermNode* handleReturnValue(const TSourceLoc&, TIntermTyped*);
void handleFunctionArgument(TFunction*, TIntermTyped*& arguments, TIntermTyped* newArg);
TIntermTyped* handleAssign(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right);
@@ -94,6 +95,7 @@ public:
TIntermTyped* handleFunctionCall(const TSourceLoc&, TFunction*, TIntermTyped*);
TIntermAggregate* assignClipCullDistance(const TSourceLoc&, TOperator, int semanticId, TIntermTyped* left, TIntermTyped* right);
TIntermTyped* assignPosition(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right);
+ TIntermTyped* assignFromFragCoord(const TSourceLoc&, TOperator, TIntermTyped* left, TIntermTyped* right);
void decomposeIntrinsic(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
void decomposeSampleMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
void decomposeStructBufferMethods(const TSourceLoc&, TIntermTyped*& node, TIntermNode* arguments);
@@ -242,6 +244,7 @@ protected:
TIntermSymbol* makeInternalVariableNode(const TSourceLoc&, const char* name, const TType&) const;
TVariable* declareNonArray(const TSourceLoc&, const TString& identifier, const TType&, bool track);
void declareArray(const TSourceLoc&, const TString& identifier, const TType&, TSymbol*&, bool track);
+ TIntermNode* executeDeclaration(const TSourceLoc&, TVariable* variable);
TIntermNode* executeInitializer(const TSourceLoc&, TIntermTyped* initializer, TVariable* variable);
TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer, TIntermTyped* scalarInit);
bool isScalarConstructor(const TIntermNode*);
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/BaseTypes.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/BaseTypes.h
index c8203c22329..156d98b9af0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/BaseTypes.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/BaseTypes.h
@@ -105,6 +105,8 @@ enum TStorageQualifier {
EvqCallableData,
EvqCallableDataIn,
+ EvqtaskPayloadSharedEXT,
+
// parameters
EvqIn, // also, for 'in' in the grammar before we know if it's a pipeline input or an 'in' parameter
EvqOut, // also, for 'out' in the grammar before we know if it's a pipeline output or an 'out' parameter
@@ -128,6 +130,7 @@ enum TStorageQualifier {
// built-ins written by fragment shader
EvqFragColor,
EvqFragDepth,
+ EvqFragStencil,
// end of list
EvqLast
@@ -263,6 +266,7 @@ enum TBuiltInVariable {
EbvObjectRayDirection,
EbvRayTmin,
EbvRayTmax,
+ EbvCullMask,
EbvHitT,
EbvHitKind,
EbvObjectToWorld,
@@ -274,6 +278,8 @@ enum TBuiltInVariable {
// barycentrics
EbvBaryCoordNV,
EbvBaryCoordNoPerspNV,
+ EbvBaryCoordEXT,
+ EbvBaryCoordNoPerspEXT,
// mesh shaders
EbvTaskCountNV,
EbvPrimitiveCountNV,
@@ -283,6 +289,11 @@ enum TBuiltInVariable {
EbvLayerPerViewNV,
EbvMeshViewCountNV,
EbvMeshViewIndicesNV,
+ //GL_EXT_mesh_shader
+ EbvPrimitivePointIndicesEXT,
+ EbvPrimitiveLineIndicesEXT,
+ EbvPrimitiveTriangleIndicesEXT,
+ EbvCullPrimitiveEXT,
// sm builtins
EbvWarpsPerSM,
@@ -350,11 +361,13 @@ __inline const char* GetStorageQualifierString(TStorageQualifier q)
case EvqPointCoord: return "gl_PointCoord"; break;
case EvqFragColor: return "fragColor"; break;
case EvqFragDepth: return "gl_FragDepth"; break;
+ case EvqFragStencil: return "gl_FragStencilRefARB"; break;
case EvqPayload: return "rayPayloadNV"; break;
case EvqPayloadIn: return "rayPayloadInNV"; break;
case EvqHitAttr: return "hitAttributeNV"; break;
case EvqCallableData: return "callableDataNV"; break;
case EvqCallableDataIn: return "callableDataInNV"; break;
+ case EvqtaskPayloadSharedEXT: return "taskPayloadSharedEXT"; break;
default: return "unknown qualifier";
}
}
@@ -478,8 +491,10 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
case EbvWorldToObject: return "WorldToObjectNV";
case EbvCurrentRayTimeNV: return "CurrentRayTimeNV";
- case EbvBaryCoordNV: return "BaryCoordNV";
- case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspNV";
+ case EbvBaryCoordEXT:
+ case EbvBaryCoordNV: return "BaryCoordKHR";
+ case EbvBaryCoordNoPerspEXT:
+ case EbvBaryCoordNoPerspNV: return "BaryCoordNoPerspKHR";
case EbvTaskCountNV: return "TaskCountNV";
case EbvPrimitiveCountNV: return "PrimitiveCountNV";
@@ -489,6 +504,11 @@ __inline const char* GetBuiltInVariableString(TBuiltInVariable v)
case EbvLayerPerViewNV: return "LayerPerViewNV";
case EbvMeshViewCountNV: return "MeshViewCountNV";
case EbvMeshViewIndicesNV: return "MeshViewIndicesNV";
+ // GL_EXT_mesh_shader
+ case EbvPrimitivePointIndicesEXT: return "PrimitivePointIndicesEXT";
+ case EbvPrimitiveLineIndicesEXT: return "PrimitiveLineIndicesEXT";
+ case EbvPrimitiveTriangleIndicesEXT: return "PrimitiveTriangleIndicesEXT";
+ case EbvCullPrimitiveEXT: return "CullPrimitiveEXT";
case EbvWarpsPerSM: return "WarpsPerSMNV";
case EbvSMCount: return "SMCountNV";
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Common.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Common.h
index a6d37c71528..7dbe4559cc0 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Common.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Common.h
@@ -40,6 +40,11 @@
#include <sstream>
#include <algorithm>
#include <cassert>
+#ifdef _MSC_VER
+#include <cfloat>
+#else
+#include <cmath>
+#endif
#include <cstdio>
#include <cstdlib>
#include <list>
@@ -62,7 +67,7 @@ std::string to_string(const T& val) {
}
#endif
-#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || MINGW_HAS_SECURE_API
+#if (defined(_MSC_VER) && _MSC_VER < 1900 /*vs2015*/) || (defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API)
#include <basetsd.h>
#ifndef snprintf
#define snprintf sprintf_s
@@ -214,7 +219,7 @@ template <class T> T Max(const T a, const T b) { return a > b ? a : b; }
//
// Create a TString object from an integer.
//
-#if defined _MSC_VER || MINGW_HAS_SECURE_API
+#if defined(_MSC_VER) || (defined(MINGW_HAS_SECURE_API) && MINGW_HAS_SECURE_API)
inline const TString String(const int i, const int base = 10)
{
char text[16]; // 32 bit ints are at most 10 digits in base 10
@@ -303,6 +308,34 @@ template <class T> int IntLog2(T n)
return result;
}
+inline bool IsInfinity(double x) {
+#ifdef _MSC_VER
+ switch (_fpclass(x)) {
+ case _FPCLASS_NINF:
+ case _FPCLASS_PINF:
+ return true;
+ default:
+ return false;
+ }
+#else
+ return std::isinf(x);
+#endif
+}
+
+inline bool IsNan(double x) {
+#ifdef _MSC_VER
+ switch (_fpclass(x)) {
+ case _FPCLASS_SNAN:
+ case _FPCLASS_QNAN:
+ return true;
+ default:
+ return false;
+ }
+#else
+ return std::isnan(x);
+#endif
+}
+
} // end namespace glslang
#endif // _COMMON_INCLUDED_
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/PoolAlloc.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/PoolAlloc.h
index b8eccb88320..1f5cac76de2 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/PoolAlloc.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/PoolAlloc.h
@@ -306,6 +306,8 @@ public:
TPoolAllocator& getAllocator() const { return allocator; }
+ pool_allocator select_on_container_copy_construction() const { return pool_allocator{}; }
+
protected:
pool_allocator& operator=(const pool_allocator&) { return *this; }
TPoolAllocator& allocator;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/ResourceLimits.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/ResourceLimits.h
index b670cf163f2..b36c8d6273b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/ResourceLimits.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/ResourceLimits.h
@@ -142,6 +142,15 @@ struct TBuiltInResource {
int maxTaskWorkGroupSizeY_NV;
int maxTaskWorkGroupSizeZ_NV;
int maxMeshViewCountNV;
+ int maxMeshOutputVerticesEXT;
+ int maxMeshOutputPrimitivesEXT;
+ int maxMeshWorkGroupSizeX_EXT;
+ int maxMeshWorkGroupSizeY_EXT;
+ int maxMeshWorkGroupSizeZ_EXT;
+ int maxTaskWorkGroupSizeX_EXT;
+ int maxTaskWorkGroupSizeY_EXT;
+ int maxTaskWorkGroupSizeZ_EXT;
+ int maxMeshViewCountEXT;
int maxDualSourceDrawBuffersEXT;
TLimits limits;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h
index e7a999d4086..3c7d72ce97f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/SpirvIntrinsics.h
@@ -65,7 +65,7 @@ struct TSpirvExecutionMode {
// spirv_execution_mode
TMap<int, TVector<const TIntermConstantUnion*>> modes;
// spirv_execution_mode_id
- TMap<int, TVector<const TIntermConstantUnion*> > modeIds;
+ TMap<int, TVector<const TIntermTyped*> > modeIds;
};
// SPIR-V decorations
@@ -75,7 +75,7 @@ struct TSpirvDecorate {
// spirv_decorate
TMap<int, TVector<const TIntermConstantUnion*> > decorates;
// spirv_decorate_id
- TMap<int, TVector<const TIntermConstantUnion*> > decorateIds;
+ TMap<int, TVector<const TIntermTyped*>> decorateIds;
// spirv_decorate_string
TMap<int, TVector<const TIntermConstantUnion*> > decorateStrings;
};
@@ -98,20 +98,12 @@ struct TSpirvInstruction {
struct TSpirvTypeParameter {
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
- TSpirvTypeParameter(const TIntermConstantUnion* arg) { isConstant = true; constant = arg; }
- TSpirvTypeParameter(const TType* arg) { isConstant = false; type = arg; }
+ TSpirvTypeParameter(const TIntermConstantUnion* arg) { constant = arg; }
- bool operator==(const TSpirvTypeParameter& rhs) const
- {
- return isConstant == rhs.isConstant && ((isConstant && constant == rhs.constant) || (!isConstant && type == rhs.type));
- }
+ bool operator==(const TSpirvTypeParameter& rhs) const { return constant == rhs.constant; }
bool operator!=(const TSpirvTypeParameter& rhs) const { return !operator==(rhs); }
- bool isConstant;
- union {
- const TIntermConstantUnion* constant;
- const TType* type;
- };
+ const TIntermConstantUnion* constant;
};
typedef TVector<TSpirvTypeParameter> TSpirvTypeParameters;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h
index f4f3f341d14..a6f47e84768 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/Types.h
@@ -443,6 +443,18 @@ enum TLayoutDepth {
EldCount
};
+enum TLayoutStencil {
+ ElsNone,
+ ElsRefUnchangedFrontAMD,
+ ElsRefGreaterFrontAMD,
+ ElsRefLessFrontAMD,
+ ElsRefUnchangedBackAMD,
+ ElsRefGreaterBackAMD,
+ ElsRefLessBackAMD,
+
+ ElsCount
+};
+
enum TBlendEquationShift {
// No 'EBlendNone':
// These are used as bit-shift amounts. A mask of such shifts will have type 'int',
@@ -552,6 +564,7 @@ public:
perViewNV = false;
perTaskNV = false;
#endif
+ pervertexEXT = false;
}
void clearMemory()
@@ -604,7 +617,8 @@ public:
bool isNoContraction() const { return false; }
void setNoContraction() { }
bool isPervertexNV() const { return false; }
- void setNullInit() { }
+ bool isPervertexEXT() const { return pervertexEXT; }
+ void setNullInit() {}
bool isNullInit() const { return false; }
void setSpirvByReference() { }
bool isSpirvByReference() { return false; }
@@ -615,6 +629,7 @@ public:
bool nopersp : 1;
bool explicitInterp : 1;
bool pervertexNV : 1;
+ bool pervertexEXT : 1;
bool perPrimitiveNV : 1;
bool perViewNV : 1;
bool perTaskNV : 1;
@@ -663,12 +678,13 @@ public:
}
bool isAuxiliary() const
{
- return centroid || patch || sample || pervertexNV;
+ return centroid || patch || sample || pervertexNV || pervertexEXT;
}
bool isPatch() const { return patch; }
bool isNoContraction() const { return noContraction; }
void setNoContraction() { noContraction = true; }
bool isPervertexNV() const { return pervertexNV; }
+ bool isPervertexEXT() const { return pervertexEXT; }
void setNullInit() { nullInit = true; }
bool isNullInit() const { return nullInit; }
void setSpirvByReference() { spirvByReference = true; }
@@ -701,6 +717,7 @@ public:
case EvqVaryingOut:
case EvqFragColor:
case EvqFragDepth:
+ case EvqFragStencil:
return true;
default:
return false;
@@ -768,6 +785,7 @@ public:
case EvqVaryingOut:
case EvqFragColor:
case EvqFragDepth:
+ case EvqFragStencil:
return true;
default:
return false;
@@ -815,7 +833,7 @@ public:
}
storage = EvqUniform;
break;
- case EbsStorageBuffer :
+ case EbsStorageBuffer :
storage = EvqBuffer;
break;
#ifndef GLSLANG_WEB
@@ -838,6 +856,7 @@ public:
bool isPerPrimitive() const { return perPrimitiveNV; }
bool isPerView() const { return perViewNV; }
bool isTaskMemory() const { return perTaskNV; }
+ bool isTaskPayload() const { return storage == EvqtaskPayloadSharedEXT; }
bool isAnyPayload() const {
return storage == EvqPayload || storage == EvqPayloadIn;
}
@@ -856,8 +875,8 @@ public:
case EShLangTessEvaluation:
return ! patch && isPipeInput();
case EShLangFragment:
- return pervertexNV && isPipeInput();
- case EShLangMeshNV:
+ return (pervertexNV || pervertexEXT) && isPipeInput();
+ case EShLangMesh:
return ! perTaskNV && isPipeOutput();
default:
@@ -1235,6 +1254,18 @@ public:
default: return "none";
}
}
+ static const char* getLayoutStencilString(TLayoutStencil s)
+ {
+ switch (s) {
+ case ElsRefUnchangedFrontAMD: return "stencil_ref_unchanged_front_amd";
+ case ElsRefGreaterFrontAMD: return "stencil_ref_greater_front_amd";
+ case ElsRefLessFrontAMD: return "stencil_ref_less_front_amd";
+ case ElsRefUnchangedBackAMD: return "stencil_ref_unchanged_back_amd";
+ case ElsRefGreaterBackAMD: return "stencil_ref_greater_back_amd";
+ case ElsRefLessBackAMD: return "stencil_ref_less_back_amd";
+ default: return "none";
+ }
+ }
static const char* getBlendEquationString(TBlendEquationShift e)
{
switch (e) {
@@ -1332,7 +1363,9 @@ struct TShaderQualifiers {
#ifndef GLSLANG_WEB
bool earlyFragmentTests; // fragment input
bool postDepthCoverage; // fragment input
+ bool earlyAndLateFragmentTestsAMD; //fragment input
TLayoutDepth layoutDepth;
+ TLayoutStencil layoutStencil;
bool blendEquation; // true if any blend equation was specified
int numViews; // multiview extenstions
TInterlockOrdering interlockOrdering;
@@ -1342,6 +1375,7 @@ struct TShaderQualifiers {
int primitives; // mesh shader "max_primitives"DerivativeGroupLinear; // true if layout derivative_group_linearNV set
bool layoutPrimitiveCulling; // true if layout primitive_culling set
TLayoutDepth getDepth() const { return layoutDepth; }
+ TLayoutStencil getStencil() const { return layoutStencil; }
#else
TLayoutDepth getDepth() const { return EldNone; }
#endif
@@ -1367,8 +1401,10 @@ struct TShaderQualifiers {
localSizeSpecId[2] = TQualifier::layoutNotSet;
#ifndef GLSLANG_WEB
earlyFragmentTests = false;
+ earlyAndLateFragmentTestsAMD = false;
postDepthCoverage = false;
layoutDepth = EldNone;
+ layoutStencil = ElsNone;
blendEquation = false;
numViews = TQualifier::layoutNotSet;
layoutOverrideCoverage = false;
@@ -1420,10 +1456,14 @@ struct TShaderQualifiers {
#ifndef GLSLANG_WEB
if (src.earlyFragmentTests)
earlyFragmentTests = true;
+ if (src.earlyAndLateFragmentTestsAMD)
+ earlyAndLateFragmentTestsAMD = true;
if (src.postDepthCoverage)
postDepthCoverage = true;
if (src.layoutDepth)
layoutDepth = src.layoutDepth;
+ if (src.layoutStencil)
+ layoutStencil = src.layoutStencil;
if (src.blendEquation)
blendEquation = src.blendEquation;
if (src.numViews != TQualifier::layoutNotSet)
@@ -1865,10 +1905,12 @@ public:
bool isAtomic() const { return false; }
bool isCoopMat() const { return false; }
bool isReference() const { return false; }
+ bool isSpirvType() const { return false; }
#else
bool isAtomic() const { return basicType == EbtAtomicUint; }
bool isCoopMat() const { return coopmat; }
bool isReference() const { return getBasicType() == EbtReference; }
+ bool isSpirvType() const { return getBasicType() == EbtSpirvType; }
#endif
// return true if this type contains any subtype which satisfies the given predicate.
@@ -2140,7 +2182,8 @@ public:
const char* getPrecisionQualifierString() const { return ""; }
TString getBasicTypeString() const { return ""; }
#else
- TString getCompleteString() const
+ TString getCompleteString(bool syntactic = false, bool getQualifiers = true, bool getPrecision = true,
+ bool getType = true, TString name = "", TString structName = "") const
{
TString typeString;
@@ -2148,232 +2191,337 @@ public:
const auto appendUint = [&](unsigned int u) { typeString.append(std::to_string(u).c_str()); };
const auto appendInt = [&](int i) { typeString.append(std::to_string(i).c_str()); };
- if (qualifier.hasSprivDecorate())
+ if (getQualifiers) {
+ if (qualifier.hasSprivDecorate())
appendStr(qualifier.getSpirvDecorateQualifierString().c_str());
- if (qualifier.hasLayout()) {
+ if (qualifier.hasLayout()) {
// To reduce noise, skip this if the only layout is an xfb_buffer
// with no triggering xfb_offset.
TQualifier noXfbBuffer = qualifier;
noXfbBuffer.layoutXfbBuffer = TQualifier::layoutXfbBufferEnd;
if (noXfbBuffer.hasLayout()) {
- appendStr("layout(");
- if (qualifier.hasAnyLocation()) {
- appendStr(" location=");
- appendUint(qualifier.layoutLocation);
- if (qualifier.hasComponent()) {
- appendStr(" component=");
- appendUint(qualifier.layoutComponent);
- }
- if (qualifier.hasIndex()) {
- appendStr(" index=");
- appendUint(qualifier.layoutIndex);
- }
- }
- if (qualifier.hasSet()) {
- appendStr(" set=");
- appendUint(qualifier.layoutSet);
- }
- if (qualifier.hasBinding()) {
- appendStr(" binding=");
- appendUint(qualifier.layoutBinding);
- }
- if (qualifier.hasStream()) {
- appendStr(" stream=");
- appendUint(qualifier.layoutStream);
- }
- if (qualifier.hasMatrix()) {
- appendStr(" ");
- appendStr(TQualifier::getLayoutMatrixString(qualifier.layoutMatrix));
- }
- if (qualifier.hasPacking()) {
- appendStr(" ");
- appendStr(TQualifier::getLayoutPackingString(qualifier.layoutPacking));
- }
- if (qualifier.hasOffset()) {
- appendStr(" offset=");
- appendInt(qualifier.layoutOffset);
- }
- if (qualifier.hasAlign()) {
- appendStr(" align=");
- appendInt(qualifier.layoutAlign);
- }
- if (qualifier.hasFormat()) {
- appendStr(" ");
- appendStr(TQualifier::getLayoutFormatString(qualifier.layoutFormat));
- }
- if (qualifier.hasXfbBuffer() && qualifier.hasXfbOffset()) {
- appendStr(" xfb_buffer=");
- appendUint(qualifier.layoutXfbBuffer);
+ appendStr("layout(");
+ if (qualifier.hasAnyLocation()) {
+ appendStr(" location=");
+ appendUint(qualifier.layoutLocation);
+ if (qualifier.hasComponent()) {
+ appendStr(" component=");
+ appendUint(qualifier.layoutComponent);
}
- if (qualifier.hasXfbOffset()) {
- appendStr(" xfb_offset=");
- appendUint(qualifier.layoutXfbOffset);
+ if (qualifier.hasIndex()) {
+ appendStr(" index=");
+ appendUint(qualifier.layoutIndex);
}
- if (qualifier.hasXfbStride()) {
- appendStr(" xfb_stride=");
- appendUint(qualifier.layoutXfbStride);
- }
- if (qualifier.hasAttachment()) {
- appendStr(" input_attachment_index=");
- appendUint(qualifier.layoutAttachment);
- }
- if (qualifier.hasSpecConstantId()) {
- appendStr(" constant_id=");
- appendUint(qualifier.layoutSpecConstantId);
- }
- if (qualifier.layoutPushConstant)
- appendStr(" push_constant");
- if (qualifier.layoutBufferReference)
- appendStr(" buffer_reference");
- if (qualifier.hasBufferReferenceAlign()) {
- appendStr(" buffer_reference_align=");
- appendUint(1u << qualifier.layoutBufferReferenceAlign);
- }
-
- if (qualifier.layoutPassthrough)
- appendStr(" passthrough");
- if (qualifier.layoutViewportRelative)
- appendStr(" layoutViewportRelative");
- if (qualifier.layoutSecondaryViewportRelativeOffset != -2048) {
- appendStr(" layoutSecondaryViewportRelativeOffset=");
- appendInt(qualifier.layoutSecondaryViewportRelativeOffset);
- }
- if (qualifier.layoutShaderRecord)
- appendStr(" shaderRecordNV");
-
- appendStr(")");
+ }
+ if (qualifier.hasSet()) {
+ appendStr(" set=");
+ appendUint(qualifier.layoutSet);
+ }
+ if (qualifier.hasBinding()) {
+ appendStr(" binding=");
+ appendUint(qualifier.layoutBinding);
+ }
+ if (qualifier.hasStream()) {
+ appendStr(" stream=");
+ appendUint(qualifier.layoutStream);
+ }
+ if (qualifier.hasMatrix()) {
+ appendStr(" ");
+ appendStr(TQualifier::getLayoutMatrixString(qualifier.layoutMatrix));
+ }
+ if (qualifier.hasPacking()) {
+ appendStr(" ");
+ appendStr(TQualifier::getLayoutPackingString(qualifier.layoutPacking));
+ }
+ if (qualifier.hasOffset()) {
+ appendStr(" offset=");
+ appendInt(qualifier.layoutOffset);
+ }
+ if (qualifier.hasAlign()) {
+ appendStr(" align=");
+ appendInt(qualifier.layoutAlign);
+ }
+ if (qualifier.hasFormat()) {
+ appendStr(" ");
+ appendStr(TQualifier::getLayoutFormatString(qualifier.layoutFormat));
+ }
+ if (qualifier.hasXfbBuffer() && qualifier.hasXfbOffset()) {
+ appendStr(" xfb_buffer=");
+ appendUint(qualifier.layoutXfbBuffer);
+ }
+ if (qualifier.hasXfbOffset()) {
+ appendStr(" xfb_offset=");
+ appendUint(qualifier.layoutXfbOffset);
+ }
+ if (qualifier.hasXfbStride()) {
+ appendStr(" xfb_stride=");
+ appendUint(qualifier.layoutXfbStride);
+ }
+ if (qualifier.hasAttachment()) {
+ appendStr(" input_attachment_index=");
+ appendUint(qualifier.layoutAttachment);
+ }
+ if (qualifier.hasSpecConstantId()) {
+ appendStr(" constant_id=");
+ appendUint(qualifier.layoutSpecConstantId);
+ }
+ if (qualifier.layoutPushConstant)
+ appendStr(" push_constant");
+ if (qualifier.layoutBufferReference)
+ appendStr(" buffer_reference");
+ if (qualifier.hasBufferReferenceAlign()) {
+ appendStr(" buffer_reference_align=");
+ appendUint(1u << qualifier.layoutBufferReferenceAlign);
+ }
+
+ if (qualifier.layoutPassthrough)
+ appendStr(" passthrough");
+ if (qualifier.layoutViewportRelative)
+ appendStr(" layoutViewportRelative");
+ if (qualifier.layoutSecondaryViewportRelativeOffset != -2048) {
+ appendStr(" layoutSecondaryViewportRelativeOffset=");
+ appendInt(qualifier.layoutSecondaryViewportRelativeOffset);
+ }
+ if (qualifier.layoutShaderRecord)
+ appendStr(" shaderRecordNV");
+
+ appendStr(")");
}
- }
+ }
- if (qualifier.invariant)
+ if (qualifier.invariant)
appendStr(" invariant");
- if (qualifier.noContraction)
+ if (qualifier.noContraction)
appendStr(" noContraction");
- if (qualifier.centroid)
+ if (qualifier.centroid)
appendStr(" centroid");
- if (qualifier.smooth)
+ if (qualifier.smooth)
appendStr(" smooth");
- if (qualifier.flat)
+ if (qualifier.flat)
appendStr(" flat");
- if (qualifier.nopersp)
+ if (qualifier.nopersp)
appendStr(" noperspective");
- if (qualifier.explicitInterp)
+ if (qualifier.explicitInterp)
appendStr(" __explicitInterpAMD");
- if (qualifier.pervertexNV)
+ if (qualifier.pervertexNV)
appendStr(" pervertexNV");
- if (qualifier.perPrimitiveNV)
+ if (qualifier.pervertexEXT)
+ appendStr(" pervertexEXT");
+ if (qualifier.perPrimitiveNV)
appendStr(" perprimitiveNV");
- if (qualifier.perViewNV)
+ if (qualifier.perViewNV)
appendStr(" perviewNV");
- if (qualifier.perTaskNV)
+ if (qualifier.perTaskNV)
appendStr(" taskNV");
- if (qualifier.patch)
+ if (qualifier.patch)
appendStr(" patch");
- if (qualifier.sample)
+ if (qualifier.sample)
appendStr(" sample");
- if (qualifier.coherent)
+ if (qualifier.coherent)
appendStr(" coherent");
- if (qualifier.devicecoherent)
+ if (qualifier.devicecoherent)
appendStr(" devicecoherent");
- if (qualifier.queuefamilycoherent)
+ if (qualifier.queuefamilycoherent)
appendStr(" queuefamilycoherent");
- if (qualifier.workgroupcoherent)
+ if (qualifier.workgroupcoherent)
appendStr(" workgroupcoherent");
- if (qualifier.subgroupcoherent)
+ if (qualifier.subgroupcoherent)
appendStr(" subgroupcoherent");
- if (qualifier.shadercallcoherent)
+ if (qualifier.shadercallcoherent)
appendStr(" shadercallcoherent");
- if (qualifier.nonprivate)
+ if (qualifier.nonprivate)
appendStr(" nonprivate");
- if (qualifier.volatil)
+ if (qualifier.volatil)
appendStr(" volatile");
- if (qualifier.restrict)
+ if (qualifier.restrict)
appendStr(" restrict");
- if (qualifier.readonly)
+ if (qualifier.readonly)
appendStr(" readonly");
- if (qualifier.writeonly)
+ if (qualifier.writeonly)
appendStr(" writeonly");
- if (qualifier.specConstant)
+ if (qualifier.specConstant)
appendStr(" specialization-constant");
- if (qualifier.nonUniform)
+ if (qualifier.nonUniform)
appendStr(" nonuniform");
- if (qualifier.isNullInit())
+ if (qualifier.isNullInit())
appendStr(" null-init");
- if (qualifier.isSpirvByReference())
+ if (qualifier.isSpirvByReference())
appendStr(" spirv_by_reference");
- if (qualifier.isSpirvLiteral())
+ if (qualifier.isSpirvLiteral())
appendStr(" spirv_literal");
- appendStr(" ");
- appendStr(getStorageQualifierString());
- if (isArray()) {
- for(int i = 0; i < (int)arraySizes->getNumDims(); ++i) {
+ appendStr(" ");
+ appendStr(getStorageQualifierString());
+ }
+ if (getType) {
+ if (syntactic) {
+ if (getPrecision && qualifier.precision != EpqNone) {
+ appendStr(" ");
+ appendStr(getPrecisionQualifierString());
+ }
+ if (isVector() || isMatrix()) {
+ appendStr(" ");
+ switch (basicType) {
+ case EbtDouble:
+ appendStr("d");
+ break;
+ case EbtInt:
+ appendStr("i");
+ break;
+ case EbtUint:
+ appendStr("u");
+ break;
+ case EbtBool:
+ appendStr("b");
+ break;
+ case EbtFloat:
+ default:
+ break;
+ }
+ if (isVector()) {
+ appendStr("vec");
+ appendInt(vectorSize);
+ } else {
+ appendStr("mat");
+ appendInt(matrixCols);
+ appendStr("x");
+ appendInt(matrixRows);
+ }
+ } else if (isStruct() && structure) {
+ appendStr(" ");
+ appendStr(structName.c_str());
+ appendStr("{");
+ bool hasHiddenMember = true;
+ for (size_t i = 0; i < structure->size(); ++i) {
+ if (!(*structure)[i].type->hiddenMember()) {
+ if (!hasHiddenMember)
+ appendStr(", ");
+ typeString.append((*structure)[i].type->getCompleteString(syntactic, getQualifiers, getPrecision, getType, (*structure)[i].type->getFieldName()));
+ hasHiddenMember = false;
+ }
+ }
+ appendStr("}");
+ } else {
+ appendStr(" ");
+ switch (basicType) {
+ case EbtDouble:
+ appendStr("double");
+ break;
+ case EbtInt:
+ appendStr("int");
+ break;
+ case EbtUint:
+ appendStr("uint");
+ break;
+ case EbtBool:
+ appendStr("bool");
+ break;
+ case EbtFloat:
+ appendStr("float");
+ break;
+ default:
+ appendStr("unexpected");
+ break;
+ }
+ }
+ if (name.length() > 0) {
+ appendStr(" ");
+ appendStr(name.c_str());
+ }
+ if (isArray()) {
+ for (int i = 0; i < (int)arraySizes->getNumDims(); ++i) {
int size = arraySizes->getDimSize(i);
if (size == UnsizedArraySize && i == 0 && arraySizes->isVariablyIndexed())
- appendStr(" runtime-sized array of");
+ appendStr("[]");
else {
- if (size == UnsizedArraySize) {
- appendStr(" unsized");
- if (i == 0) {
- appendStr(" ");
- appendInt(arraySizes->getImplicitSize());
- }
- } else {
- appendStr(" ");
- appendInt(arraySizes->getDimSize(i));
+ if (size == UnsizedArraySize) {
+ appendStr("[");
+ if (i == 0)
+ appendInt(arraySizes->getImplicitSize());
+ appendStr("]");
+ }
+ else {
+ appendStr("[");
+ appendInt(arraySizes->getDimSize(i));
+ appendStr("]");
+ }
+ }
+ }
+ }
+ }
+ else {
+ if (isArray()) {
+ for (int i = 0; i < (int)arraySizes->getNumDims(); ++i) {
+ int size = arraySizes->getDimSize(i);
+ if (size == UnsizedArraySize && i == 0 && arraySizes->isVariablyIndexed())
+ appendStr(" runtime-sized array of");
+ else {
+ if (size == UnsizedArraySize) {
+ appendStr(" unsized");
+ if (i == 0) {
+ appendStr(" ");
+ appendInt(arraySizes->getImplicitSize());
}
- appendStr("-element array of");
+ }
+ else {
+ appendStr(" ");
+ appendInt(arraySizes->getDimSize(i));
+ }
+ appendStr("-element array of");
}
+ }
}
- }
- if (isParameterized()) {
- appendStr("<");
- for(int i = 0; i < (int)typeParameters->getNumDims(); ++i) {
+ if (isParameterized()) {
+ appendStr("<");
+ for (int i = 0; i < (int)typeParameters->getNumDims(); ++i) {
appendInt(typeParameters->getDimSize(i));
if (i != (int)typeParameters->getNumDims() - 1)
- appendStr(", ");
+ appendStr(", ");
+ }
+ appendStr(">");
+ }
+ if (getPrecision && qualifier.precision != EpqNone) {
+ appendStr(" ");
+ appendStr(getPrecisionQualifierString());
+ }
+ if (isMatrix()) {
+ appendStr(" ");
+ appendInt(matrixCols);
+ appendStr("X");
+ appendInt(matrixRows);
+ appendStr(" matrix of");
+ }
+ else if (isVector()) {
+ appendStr(" ");
+ appendInt(vectorSize);
+ appendStr("-component vector of");
}
- appendStr(">");
- }
- if (qualifier.precision != EpqNone) {
- appendStr(" ");
- appendStr(getPrecisionQualifierString());
- }
- if (isMatrix()) {
- appendStr(" ");
- appendInt(matrixCols);
- appendStr("X");
- appendInt(matrixRows);
- appendStr(" matrix of");
- } else if (isVector()) {
- appendStr(" ");
- appendInt(vectorSize);
- appendStr("-component vector of");
- }
-
- appendStr(" ");
- typeString.append(getBasicTypeString());
- if (qualifier.builtIn != EbvNone) {
appendStr(" ");
- appendStr(getBuiltInVariableString());
- }
+ typeString.append(getBasicTypeString());
- // Add struct/block members
- if (isStruct() && structure) {
- appendStr("{");
- bool hasHiddenMember = true;
- for (size_t i = 0; i < structure->size(); ++i) {
- if (! (*structure)[i].type->hiddenMember()) {
- if (!hasHiddenMember)
- appendStr(", ");
- typeString.append((*structure)[i].type->getCompleteString());
- typeString.append(" ");
- typeString.append((*structure)[i].type->getFieldName());
- hasHiddenMember = false;
+ if (qualifier.builtIn != EbvNone) {
+ appendStr(" ");
+ appendStr(getBuiltInVariableString());
+ }
+
+ // Add struct/block members
+ if (isStruct() && structure) {
+ appendStr("{");
+ bool hasHiddenMember = true;
+ for (size_t i = 0; i < structure->size(); ++i) {
+ if (!(*structure)[i].type->hiddenMember()) {
+ if (!hasHiddenMember)
+ appendStr(", ");
+ typeString.append((*structure)[i].type->getCompleteString());
+ typeString.append(" ");
+ typeString.append((*structure)[i].type->getFieldName());
+ hasHiddenMember = false;
}
+ }
+ appendStr("}");
}
- appendStr("}");
+ }
}
return typeString;
@@ -2396,7 +2544,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; }
-
+
int computeNumComponents() const
{
int components = 0;
@@ -2442,13 +2590,27 @@ public:
// type definitions, and member names to be considered the same type.
// This rule applies recursively for nested or embedded types."
//
- bool sameStructType(const TType& right) const
+ // If type mismatch in structure, return member indices through lpidx and rpidx.
+ // If matching members for either block are exhausted, return -1 for exhausted
+ // block and the index of the unmatched member. Otherwise return {-1,-1}.
+ //
+ bool sameStructType(const TType& right, int* lpidx = nullptr, int* rpidx = nullptr) const
{
+ // Initialize error to general type mismatch.
+ if (lpidx != nullptr) {
+ *lpidx = -1;
+ *rpidx = -1;
+ }
+
// Most commonly, they are both nullptr, or the same pointer to the same actual structure
+ // TODO: Why return true when neither types are structures?
if ((!isStruct() && !right.isStruct()) ||
(isStruct() && right.isStruct() && structure == right.structure))
return true;
+ if (!isStruct() || !right.isStruct())
+ return false;
+
// Structure names have to match
if (*typeName != *right.typeName)
return false;
@@ -2458,17 +2620,30 @@ public:
bool isGLPerVertex = *typeName == "gl_PerVertex";
// Both being nullptr was caught above, now they both have to be structures of the same number of elements
- if (!isStruct() || !right.isStruct() ||
- (structure->size() != right.structure->size() && !isGLPerVertex))
+ if (lpidx == nullptr &&
+ (structure->size() != right.structure->size() && !isGLPerVertex)) {
return false;
+ }
// Compare the names and types of all the members, which have to match
for (size_t li = 0, ri = 0; li < structure->size() || ri < right.structure->size(); ++li, ++ri) {
+ if (lpidx != nullptr) {
+ *lpidx = static_cast<int>(li);
+ *rpidx = static_cast<int>(ri);
+ }
if (li < structure->size() && ri < right.structure->size()) {
if ((*structure)[li].type->getFieldName() == (*right.structure)[ri].type->getFieldName()) {
if (*(*structure)[li].type != *(*right.structure)[ri].type)
return false;
} else {
+ // Skip hidden members
+ if ((*structure)[li].type->hiddenMember()) {
+ ri--;
+ continue;
+ } else if ((*right.structure)[ri].type->hiddenMember()) {
+ li--;
+ continue;
+ }
// If one of the members is something that's inconsistently declared, skip over it
// for now.
if (isGLPerVertex) {
@@ -2485,11 +2660,19 @@ public:
}
// If we get here, then there should only be inconsistently declared members left
} else if (li < structure->size()) {
- if (!isInconsistentGLPerVertexMember((*structure)[li].type->getFieldName()))
+ if (!(*structure)[li].type->hiddenMember() && !isInconsistentGLPerVertexMember((*structure)[li].type->getFieldName())) {
+ if (lpidx != nullptr) {
+ *rpidx = -1;
+ }
return false;
+ }
} else {
- if (!isInconsistentGLPerVertexMember((*right.structure)[ri].type->getFieldName()))
+ if (!(*right.structure)[ri].type->hiddenMember() && !isInconsistentGLPerVertexMember((*right.structure)[ri].type->getFieldName())) {
+ if (lpidx != nullptr) {
+ *lpidx = -1;
+ }
return false;
+ }
}
}
@@ -2513,10 +2696,15 @@ public:
return *referentType == *right.referentType;
}
- // See if two types match, in all aspects except arrayness
- bool sameElementType(const TType& right) const
+ // See if two types match, in all aspects except arrayness
+ // If mismatch in structure members, return member indices in lpidx and rpidx.
+ bool sameElementType(const TType& right, int* lpidx = nullptr, int* rpidx = nullptr) const
{
- return basicType == right.basicType && sameElementShape(right);
+ if (lpidx != nullptr) {
+ *lpidx = -1;
+ *rpidx = -1;
+ }
+ return basicType == right.basicType && sameElementShape(right, lpidx, rpidx);
}
// See if two type's arrayness match
@@ -2550,15 +2738,20 @@ public:
#endif
// See if two type's elements match in all ways except basic type
- bool sameElementShape(const TType& right) const
+ // If mismatch in structure members, return member indices in lpidx and rpidx.
+ bool sameElementShape(const TType& right, int* lpidx = nullptr, int* rpidx = nullptr) const
{
- return sampler == right.sampler &&
+ if (lpidx != nullptr) {
+ *lpidx = -1;
+ *rpidx = -1;
+ }
+ return ((basicType != EbtSampler && right.basicType != EbtSampler) || sampler == right.sampler) &&
vectorSize == right.vectorSize &&
matrixCols == right.matrixCols &&
matrixRows == right.matrixRows &&
vector1 == right.vector1 &&
isCoopMat() == right.isCoopMat() &&
- sameStructType(right) &&
+ sameStructType(right, lpidx, rpidx) &&
sameReferenceType(right);
}
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/glslang_c_interface.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/glslang_c_interface.h
index 4b32e2b85fe..f540f26d6c1 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/glslang_c_interface.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/glslang_c_interface.h
@@ -148,6 +148,15 @@ typedef struct glslang_resource_s {
int max_task_work_group_size_y_nv;
int max_task_work_group_size_z_nv;
int max_mesh_view_count_nv;
+ int max_mesh_output_vertices_ext;
+ int max_mesh_output_primitives_ext;
+ int max_mesh_work_group_size_x_ext;
+ int max_mesh_work_group_size_y_ext;
+ int max_mesh_work_group_size_z_ext;
+ int max_task_work_group_size_x_ext;
+ int max_task_work_group_size_y_ext;
+ int max_task_work_group_size_z_ext;
+ int max_mesh_view_count_ext;
int maxDualSourceDrawBuffersEXT;
glslang_limits_t limits;
@@ -199,6 +208,18 @@ typedef struct glsl_include_callbacks_s {
glsl_free_include_result_func free_include_result;
} glsl_include_callbacks_t;
+/* SpvOptions counterpart */
+typedef struct glslang_spv_options_s {
+ bool generate_debug_info;
+ bool strip_debug_info;
+ bool disable_optimizer;
+ bool optimize_size;
+ bool disassemble;
+ bool validate;
+ bool emit_nonsemantic_shader_debug_info;
+ bool emit_nonsemantic_shader_debug_source;
+} glslang_spv_options_t;
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -224,6 +245,11 @@ GLSLANG_EXPORT void glslang_finalize_process();
GLSLANG_EXPORT glslang_shader_t* glslang_shader_create(const glslang_input_t* input);
GLSLANG_EXPORT void glslang_shader_delete(glslang_shader_t* shader);
+GLSLANG_EXPORT void glslang_shader_set_preamble(glslang_shader_t* shader, const char* s);
+GLSLANG_EXPORT void glslang_shader_shift_binding(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base);
+GLSLANG_EXPORT void glslang_shader_shift_binding_for_set(glslang_shader_t* shader, glslang_resource_type_t res, unsigned int base, unsigned int set);
+GLSLANG_EXPORT void glslang_shader_set_options(glslang_shader_t* shader, int options); // glslang_shader_options_t
+GLSLANG_EXPORT void glslang_shader_set_glsl_version(glslang_shader_t* shader, int version);
GLSLANG_EXPORT int glslang_shader_preprocess(glslang_shader_t* shader, const glslang_input_t* input);
GLSLANG_EXPORT int glslang_shader_parse(glslang_shader_t* shader, const glslang_input_t* input);
GLSLANG_EXPORT const char* glslang_shader_get_preprocessed_code(glslang_shader_t* shader);
@@ -234,7 +260,11 @@ GLSLANG_EXPORT glslang_program_t* glslang_program_create();
GLSLANG_EXPORT void glslang_program_delete(glslang_program_t* program);
GLSLANG_EXPORT void glslang_program_add_shader(glslang_program_t* program, glslang_shader_t* shader);
GLSLANG_EXPORT int glslang_program_link(glslang_program_t* program, int messages); // glslang_messages_t
+GLSLANG_EXPORT void glslang_program_add_source_text(glslang_program_t* program, glslang_stage_t stage, const char* text, size_t len);
+GLSLANG_EXPORT void glslang_program_set_source_file(glslang_program_t* program, glslang_stage_t stage, const char* file);
+GLSLANG_EXPORT int glslang_program_map_io(glslang_program_t* program);
GLSLANG_EXPORT void glslang_program_SPIRV_generate(glslang_program_t* program, glslang_stage_t stage);
+GLSLANG_EXPORT void glslang_program_SPIRV_generate_with_options(glslang_program_t* program, glslang_stage_t stage, glslang_spv_options_t* spv_options);
GLSLANG_EXPORT size_t glslang_program_SPIRV_get_size(glslang_program_t* program);
GLSLANG_EXPORT void glslang_program_SPIRV_get(glslang_program_t* program, unsigned int*);
GLSLANG_EXPORT unsigned int* glslang_program_SPIRV_get_ptr(glslang_program_t* program);
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/glslang_c_shader_types.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/glslang_c_shader_types.h
index f100a9aa827..9bc211496c6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/glslang_c_shader_types.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/glslang_c_shader_types.h
@@ -43,14 +43,22 @@ typedef enum {
GLSLANG_STAGE_GEOMETRY,
GLSLANG_STAGE_FRAGMENT,
GLSLANG_STAGE_COMPUTE,
- GLSLANG_STAGE_RAYGEN_NV,
- GLSLANG_STAGE_INTERSECT_NV,
- GLSLANG_STAGE_ANYHIT_NV,
- GLSLANG_STAGE_CLOSESTHIT_NV,
- GLSLANG_STAGE_MISS_NV,
- GLSLANG_STAGE_CALLABLE_NV,
- GLSLANG_STAGE_TASK_NV,
- GLSLANG_STAGE_MESH_NV,
+ GLSLANG_STAGE_RAYGEN,
+ GLSLANG_STAGE_RAYGEN_NV = GLSLANG_STAGE_RAYGEN,
+ GLSLANG_STAGE_INTERSECT,
+ GLSLANG_STAGE_INTERSECT_NV = GLSLANG_STAGE_INTERSECT,
+ GLSLANG_STAGE_ANYHIT,
+ GLSLANG_STAGE_ANYHIT_NV = GLSLANG_STAGE_ANYHIT,
+ GLSLANG_STAGE_CLOSESTHIT,
+ GLSLANG_STAGE_CLOSESTHIT_NV = GLSLANG_STAGE_CLOSESTHIT,
+ GLSLANG_STAGE_MISS,
+ GLSLANG_STAGE_MISS_NV = GLSLANG_STAGE_MISS,
+ GLSLANG_STAGE_CALLABLE,
+ GLSLANG_STAGE_CALLABLE_NV = GLSLANG_STAGE_CALLABLE,
+ GLSLANG_STAGE_TASK,
+ GLSLANG_STAGE_TASK_NV = GLSLANG_STAGE_TASK,
+ GLSLANG_STAGE_MESH,
+ GLSLANG_STAGE_MESH_NV = GLSLANG_STAGE_MESH,
LAST_ELEMENT_MARKER(GLSLANG_STAGE_COUNT),
} glslang_stage_t; // would be better as stage, but this is ancient now
@@ -62,14 +70,22 @@ typedef enum {
GLSLANG_STAGE_GEOMETRY_MASK = (1 << GLSLANG_STAGE_GEOMETRY),
GLSLANG_STAGE_FRAGMENT_MASK = (1 << GLSLANG_STAGE_FRAGMENT),
GLSLANG_STAGE_COMPUTE_MASK = (1 << GLSLANG_STAGE_COMPUTE),
- GLSLANG_STAGE_RAYGEN_NV_MASK = (1 << GLSLANG_STAGE_RAYGEN_NV),
- GLSLANG_STAGE_INTERSECT_NV_MASK = (1 << GLSLANG_STAGE_INTERSECT_NV),
- GLSLANG_STAGE_ANYHIT_NV_MASK = (1 << GLSLANG_STAGE_ANYHIT_NV),
- GLSLANG_STAGE_CLOSESTHIT_NV_MASK = (1 << GLSLANG_STAGE_CLOSESTHIT_NV),
- GLSLANG_STAGE_MISS_NV_MASK = (1 << GLSLANG_STAGE_MISS_NV),
- GLSLANG_STAGE_CALLABLE_NV_MASK = (1 << GLSLANG_STAGE_CALLABLE_NV),
- GLSLANG_STAGE_TASK_NV_MASK = (1 << GLSLANG_STAGE_TASK_NV),
- GLSLANG_STAGE_MESH_NV_MASK = (1 << GLSLANG_STAGE_MESH_NV),
+ GLSLANG_STAGE_RAYGEN_MASK = (1 << GLSLANG_STAGE_RAYGEN),
+ GLSLANG_STAGE_RAYGEN_NV_MASK = GLSLANG_STAGE_RAYGEN_MASK,
+ GLSLANG_STAGE_INTERSECT_MASK = (1 << GLSLANG_STAGE_INTERSECT),
+ GLSLANG_STAGE_INTERSECT_NV_MASK = GLSLANG_STAGE_INTERSECT_MASK,
+ GLSLANG_STAGE_ANYHIT_MASK = (1 << GLSLANG_STAGE_ANYHIT),
+ GLSLANG_STAGE_ANYHIT_NV_MASK = GLSLANG_STAGE_ANYHIT_MASK,
+ GLSLANG_STAGE_CLOSESTHIT_MASK = (1 << GLSLANG_STAGE_CLOSESTHIT),
+ GLSLANG_STAGE_CLOSESTHIT_NV_MASK = GLSLANG_STAGE_CLOSESTHIT_MASK,
+ GLSLANG_STAGE_MISS_MASK = (1 << GLSLANG_STAGE_MISS),
+ GLSLANG_STAGE_MISS_NV_MASK = GLSLANG_STAGE_MISS_MASK,
+ GLSLANG_STAGE_CALLABLE_MASK = (1 << GLSLANG_STAGE_CALLABLE),
+ GLSLANG_STAGE_CALLABLE_NV_MASK = GLSLANG_STAGE_CALLABLE_MASK,
+ GLSLANG_STAGE_TASK_MASK = (1 << GLSLANG_STAGE_TASK),
+ GLSLANG_STAGE_TASK_NV_MASK = GLSLANG_STAGE_TASK_MASK,
+ GLSLANG_STAGE_MESH_MASK = (1 << GLSLANG_STAGE_MESH),
+ GLSLANG_STAGE_MESH_NV_MASK = GLSLANG_STAGE_MESH_MASK,
LAST_ELEMENT_MARKER(GLSLANG_STAGE_MASK_COUNT),
} glslang_stage_mask_t;
@@ -101,8 +117,9 @@ typedef enum {
GLSLANG_TARGET_VULKAN_1_0 = (1 << 22),
GLSLANG_TARGET_VULKAN_1_1 = (1 << 22) | (1 << 12),
GLSLANG_TARGET_VULKAN_1_2 = (1 << 22) | (2 << 12),
+ GLSLANG_TARGET_VULKAN_1_3 = (1 << 22) | (3 << 12),
GLSLANG_TARGET_OPENGL_450 = 450,
- LAST_ELEMENT_MARKER(GLSLANG_TARGET_CLIENT_VERSION_COUNT = 4),
+ LAST_ELEMENT_MARKER(GLSLANG_TARGET_CLIENT_VERSION_COUNT = 5),
} glslang_target_client_version_t;
/* SH_TARGET_LanguageVersion counterpart */
@@ -113,13 +130,16 @@ typedef enum {
GLSLANG_TARGET_SPV_1_3 = (1 << 16) | (3 << 8),
GLSLANG_TARGET_SPV_1_4 = (1 << 16) | (4 << 8),
GLSLANG_TARGET_SPV_1_5 = (1 << 16) | (5 << 8),
- LAST_ELEMENT_MARKER(GLSLANG_TARGET_LANGUAGE_VERSION_COUNT = 6),
+ GLSLANG_TARGET_SPV_1_6 = (1 << 16) | (6 << 8),
+ LAST_ELEMENT_MARKER(GLSLANG_TARGET_LANGUAGE_VERSION_COUNT = 7),
} glslang_target_language_version_t;
/* EShExecutable counterpart */
typedef enum { GLSLANG_EX_VERTEX_FRAGMENT, GLSLANG_EX_FRAGMENT } glslang_executable_t;
-/* EShOptimizationLevel counterpart */
+// EShOptimizationLevel counterpart
+// This enum is not used in the current C interface, but could be added at a later date.
+// GLSLANG_OPT_NONE is the current default.
typedef enum {
GLSLANG_OPT_NO_GENERATION,
GLSLANG_OPT_NONE,
@@ -153,6 +173,7 @@ typedef enum {
GLSLANG_MSG_HLSL_LEGALIZATION_BIT = (1 << 12),
GLSLANG_MSG_HLSL_DX9_COMPATIBLE_BIT = (1 << 13),
GLSLANG_MSG_BUILTIN_SYMBOL_TABLE_BIT = (1 << 14),
+ GLSLANG_MSG_ENHANCED = (1 << 15),
LAST_ELEMENT_MARKER(GLSLANG_MSG_COUNT),
} glslang_messages_t;
@@ -181,6 +202,26 @@ typedef enum {
LAST_ELEMENT_MARKER(GLSLANG_PROFILE_COUNT),
} glslang_profile_t;
+/* Shader options */
+typedef enum {
+ GLSLANG_SHADER_DEFAULT_BIT = 0,
+ GLSLANG_SHADER_AUTO_MAP_BINDINGS = (1 << 0),
+ GLSLANG_SHADER_AUTO_MAP_LOCATIONS = (1 << 1),
+ GLSLANG_SHADER_VULKAN_RULES_RELAXED = (1 << 2),
+ LAST_ELEMENT_MARKER(GLSLANG_SHADER_COUNT),
+} glslang_shader_options_t;
+
+/* TResourceType counterpart */
+typedef enum {
+ GLSLANG_RESOURCE_TYPE_SAMPLER,
+ GLSLANG_RESOURCE_TYPE_TEXTURE,
+ GLSLANG_RESOURCE_TYPE_IMAGE,
+ GLSLANG_RESOURCE_TYPE_UBO,
+ GLSLANG_RESOURCE_TYPE_SSBO,
+ GLSLANG_RESOURCE_TYPE_UAV,
+ LAST_ELEMENT_MARKER(GLSLANG_RESOURCE_TYPE_COUNT),
+} glslang_resource_type_t;
+
#undef LAST_ELEMENT_MARKER
#endif
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/intermediate.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/intermediate.h
index 595bd623dbf..a0240028d13 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Include/intermediate.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Include/intermediate.h
@@ -67,6 +67,7 @@ class TIntermediate;
enum TOperator {
EOpNull, // if in a node, should only mean a node is still being built
EOpSequence, // denotes a list of statements, or parameters, etc.
+ EOpScope, // Used by debugging to denote a scoped list of statements
EOpLinkerObjects, // for aggregate node of objects the linker may need, if not reference by the rest of the AST
EOpFunctionCall,
EOpFunction, // For function definition
@@ -91,6 +92,8 @@ enum TOperator {
EOpCopyObject,
+ EOpDeclare, // Used by debugging to force declaration of variable in correct scope
+
// (u)int* -> bool
EOpConvInt8ToBool,
EOpConvUint8ToBool,
@@ -934,6 +937,8 @@ enum TOperator {
EOpExecuteCallableNV,
EOpExecuteCallableKHR,
EOpWritePackedPrimitiveIndices4x8NV,
+ EOpEmitMeshTasksEXT,
+ EOpSetMeshOutputsEXT,
//
// GL_EXT_ray_query operations
@@ -1155,7 +1160,7 @@ public:
virtual bool isIntegerDomain() const { return type.isIntegerDomain(); }
bool isAtomic() const { return type.isAtomic(); }
bool isReference() const { return type.isReference(); }
- TString getCompleteString() const { return type.getCompleteString(); }
+ TString getCompleteString(bool enhanced = false) const { return type.getCompleteString(enhanced); }
protected:
TIntermTyped& operator=(const TIntermTyped&);
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp
index 7f5d4c4f245..5fc61dbb791 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Constant.cpp
@@ -46,35 +46,6 @@ namespace {
using namespace glslang;
-typedef union {
- double d;
- int i[2];
-} DoubleIntUnion;
-
-// Some helper functions
-
-bool isNan(double x)
-{
- DoubleIntUnion u;
- // tough to find a platform independent library function, do it directly
- u.d = x;
- int bitPatternL = u.i[0];
- int bitPatternH = u.i[1];
- return (bitPatternH & 0x7ff80000) == 0x7ff80000 &&
- ((bitPatternH & 0xFFFFF) != 0 || bitPatternL != 0);
-}
-
-bool isInf(double x)
-{
- DoubleIntUnion u;
- // tough to find a platform independent library function, do it directly
- u.d = x;
- int bitPatternL = u.i[0];
- int bitPatternH = u.i[1];
- return (bitPatternH & 0x7ff00000) == 0x7ff00000 &&
- (bitPatternH & 0xFFFFF) == 0 && bitPatternL == 0;
-}
-
const double pi = 3.1415926535897932384626433832795;
} // end anonymous namespace
@@ -663,12 +634,12 @@ TIntermTyped* TIntermConstantUnion::fold(TOperator op, const TType& returnType)
case EOpIsNan:
{
- newConstArray[i].setBConst(isNan(unionArray[i].getDConst()));
+ newConstArray[i].setBConst(IsNan(unionArray[i].getDConst()));
break;
}
case EOpIsInf:
{
- newConstArray[i].setBConst(isInf(unionArray[i].getDConst()));
+ newConstArray[i].setBConst(IsInfinity(unionArray[i].getDConst()));
break;
}
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp
index ee4e2cab56e..5a9e5003dea 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Initialize.cpp
@@ -3,7 +3,7 @@
// Copyright (C) 2012-2016 LunarG, Inc.
// Copyright (C) 2015-2020 Google, Inc.
// Copyright (C) 2017 ARM Limited.
-// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights reserved.
+// Modifications Copyright (C) 2020-2021 Advanced Micro Devices, Inc. All rights reserved.
//
// All rights reserved.
//
@@ -147,10 +147,6 @@ EProfile EDesktopProfile = static_cast<EProfile>(ENoProfile | ECoreProfile | ECo
#ifdef GLSLANG_WEB
const Versioning* Es300Desktop130 = nullptr;
const Versioning* Es310Desktop420 = nullptr;
-#elif defined(GLSLANG_ANGLE)
- const Versioning* Es300Desktop130 = nullptr;
- const Versioning* Es310Desktop420 = nullptr;
- const Versioning* Es310Desktop450 = nullptr;
#else
const Versioning Es300Desktop130Version[] = { { EEsProfile, 0, 300, 0, nullptr },
{ EDesktopProfile, 0, 130, 0, nullptr },
@@ -316,6 +312,7 @@ const CustomFunction CustomFunctions[] = {
{ EOpTextureQuerySize, "textureSize", nullptr },
{ EOpTextureQueryLod, "textureQueryLod", nullptr },
+ { EOpTextureQueryLod, "textureQueryLOD", nullptr }, // extension GL_ARB_texture_query_lod
{ EOpTextureQueryLevels, "textureQueryLevels", nullptr },
{ EOpTextureQuerySamples, "textureSamples", nullptr },
{ EOpTexture, "texture", nullptr },
@@ -419,7 +416,7 @@ void AddTabledBuiltin(TString& decls, const BuiltInFunction& function)
// See if the tabled versioning information allows the current version.
bool ValidVersion(const BuiltInFunction& function, int version, EProfile profile, const SpvVersion& /* spVersion */)
{
-#if defined(GLSLANG_WEB) || defined(GLSLANG_ANGLE)
+#if defined(GLSLANG_WEB)
// all entries in table are valid
return true;
#endif
@@ -504,7 +501,7 @@ TBuiltIns::TBuiltIns()
prefixes[EbtFloat] = "";
prefixes[EbtInt] = "i";
prefixes[EbtUint] = "u";
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
prefixes[EbtFloat16] = "f16";
prefixes[EbtInt8] = "i8";
prefixes[EbtUint8] = "u8";
@@ -523,9 +520,7 @@ TBuiltIns::TBuiltIns()
dimMap[Esd3D] = 3;
dimMap[EsdCube] = 3;
#ifndef GLSLANG_WEB
-#ifndef GLSLANG_ANGLE
dimMap[Esd1D] = 1;
-#endif
dimMap[EsdRect] = 2;
dimMap[EsdBuffer] = 1;
dimMap[EsdSubpass] = 2; // potentially unused for now
@@ -550,9 +545,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
#ifdef GLSLANG_WEB
version = 310;
profile = EEsProfile;
-#elif defined(GLSLANG_ANGLE)
- version = 450;
- profile = ECoreProfile;
#endif
addTabledBuiltins(version, profile, spvVersion);
@@ -598,7 +590,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"vec4 fwidthCoarse(vec4 p);"
);
-#ifndef GLSLANG_ANGLE
TString derivativesAndControl16bits (
"float16_t dFdx(float16_t);"
"f16vec2 dFdx(f16vec2);"
@@ -1392,7 +1383,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n"
);
}
-#endif // !GLSLANG_ANGLE
if ((profile == EEsProfile && version >= 310) ||
(profile != EEsProfile && version >= 430)) {
@@ -1430,7 +1420,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
-#ifndef GLSLANG_ANGLE
if (profile != EEsProfile && version >= 440) {
commonBuiltins.append(
"uint64_t atomicMin(coherent volatile inout uint64_t, uint64_t);"
@@ -1510,7 +1499,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"void atomicStore(coherent volatile out double, double, int, int, int);"
"\n");
}
-#endif // !GLSLANG_ANGLE
#endif // !GLSLANG_WEB
if ((profile == EEsProfile && version >= 300) ||
@@ -1551,7 +1539,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
-#ifndef GLSLANG_ANGLE
if (profile != EEsProfile && version >= 150) { // ARB_gpu_shader_fp64
commonBuiltins.append(
"double fma(double, double, double);"
@@ -1569,7 +1556,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"f64vec4 fma(f64vec4, f64vec4, f64vec4 );"
"\n");
}
-#endif
if ((profile == EEsProfile && version >= 310) ||
(profile != EEsProfile && version >= 400)) {
@@ -1587,7 +1573,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
-#ifndef GLSLANG_ANGLE
if (profile != EEsProfile && version >= 150) { // ARB_gpu_shader_fp64
commonBuiltins.append(
"double frexp(double, out int);"
@@ -1621,7 +1606,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
#endif
-#endif
if ((profile == EEsProfile && version >= 300) ||
(profile != EEsProfile && version >= 150)) {
@@ -1730,7 +1714,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
}
#ifndef GLSLANG_WEB
-#ifndef GLSLANG_ANGLE
//
// Original-style texture functions existing in all stages.
// (Per-stage functions below.)
@@ -1925,7 +1908,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
}
-#endif // !GLSLANG_ANGLE
// Bitfield
if ((profile == EEsProfile && version >= 310) ||
@@ -2068,7 +2050,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
-#ifndef GLSLANG_ANGLE
// GL_ARB_shader_ballot
if (profile != EEsProfile && version >= 450) {
commonBuiltins.append(
@@ -2267,11 +2248,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n"
);
- stageBuiltins[EShLangMeshNV].append(
+ stageBuiltins[EShLangMesh].append(
"void subgroupMemoryBarrierShared();"
"\n"
);
- stageBuiltins[EShLangTaskNV].append(
+ stageBuiltins[EShLangTask].append(
"void subgroupMemoryBarrierShared();"
"\n"
);
@@ -3389,7 +3370,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"bool textureFootprintGradClampNV(sampler2D, vec2, vec2, vec2, float, int, bool, out gl_TextureFootprint2DNV);"
"\n");
}
-#endif // !GLSLANG_ANGLE
if ((profile == EEsProfile && version >= 300 && version < 310) ||
(profile != EEsProfile && version >= 150 && version < 450)) { // GL_EXT_shader_integer_mix
@@ -3409,7 +3389,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
-#ifndef GLSLANG_ANGLE
// GL_AMD_gpu_shader_half_float/Explicit types
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 310)) {
commonBuiltins.append(
@@ -4159,106 +4138,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"u16vec4 unpack16(uint64_t);"
"i32vec2 unpack32(int64_t);"
"u32vec2 unpack32(uint64_t);"
-
- "float64_t radians(float64_t);"
- "f64vec2 radians(f64vec2);"
- "f64vec3 radians(f64vec3);"
- "f64vec4 radians(f64vec4);"
-
- "float64_t degrees(float64_t);"
- "f64vec2 degrees(f64vec2);"
- "f64vec3 degrees(f64vec3);"
- "f64vec4 degrees(f64vec4);"
-
- "float64_t sin(float64_t);"
- "f64vec2 sin(f64vec2);"
- "f64vec3 sin(f64vec3);"
- "f64vec4 sin(f64vec4);"
-
- "float64_t cos(float64_t);"
- "f64vec2 cos(f64vec2);"
- "f64vec3 cos(f64vec3);"
- "f64vec4 cos(f64vec4);"
-
- "float64_t tan(float64_t);"
- "f64vec2 tan(f64vec2);"
- "f64vec3 tan(f64vec3);"
- "f64vec4 tan(f64vec4);"
-
- "float64_t asin(float64_t);"
- "f64vec2 asin(f64vec2);"
- "f64vec3 asin(f64vec3);"
- "f64vec4 asin(f64vec4);"
-
- "float64_t acos(float64_t);"
- "f64vec2 acos(f64vec2);"
- "f64vec3 acos(f64vec3);"
- "f64vec4 acos(f64vec4);"
-
- "float64_t atan(float64_t, float64_t);"
- "f64vec2 atan(f64vec2, f64vec2);"
- "f64vec3 atan(f64vec3, f64vec3);"
- "f64vec4 atan(f64vec4, f64vec4);"
-
- "float64_t atan(float64_t);"
- "f64vec2 atan(f64vec2);"
- "f64vec3 atan(f64vec3);"
- "f64vec4 atan(f64vec4);"
-
- "float64_t sinh(float64_t);"
- "f64vec2 sinh(f64vec2);"
- "f64vec3 sinh(f64vec3);"
- "f64vec4 sinh(f64vec4);"
-
- "float64_t cosh(float64_t);"
- "f64vec2 cosh(f64vec2);"
- "f64vec3 cosh(f64vec3);"
- "f64vec4 cosh(f64vec4);"
-
- "float64_t tanh(float64_t);"
- "f64vec2 tanh(f64vec2);"
- "f64vec3 tanh(f64vec3);"
- "f64vec4 tanh(f64vec4);"
-
- "float64_t asinh(float64_t);"
- "f64vec2 asinh(f64vec2);"
- "f64vec3 asinh(f64vec3);"
- "f64vec4 asinh(f64vec4);"
-
- "float64_t acosh(float64_t);"
- "f64vec2 acosh(f64vec2);"
- "f64vec3 acosh(f64vec3);"
- "f64vec4 acosh(f64vec4);"
-
- "float64_t atanh(float64_t);"
- "f64vec2 atanh(f64vec2);"
- "f64vec3 atanh(f64vec3);"
- "f64vec4 atanh(f64vec4);"
-
- "float64_t pow(float64_t, float64_t);"
- "f64vec2 pow(f64vec2, f64vec2);"
- "f64vec3 pow(f64vec3, f64vec3);"
- "f64vec4 pow(f64vec4, f64vec4);"
-
- "float64_t exp(float64_t);"
- "f64vec2 exp(f64vec2);"
- "f64vec3 exp(f64vec3);"
- "f64vec4 exp(f64vec4);"
-
- "float64_t log(float64_t);"
- "f64vec2 log(f64vec2);"
- "f64vec3 log(f64vec3);"
- "f64vec4 log(f64vec4);"
-
- "float64_t exp2(float64_t);"
- "f64vec2 exp2(f64vec2);"
- "f64vec3 exp2(f64vec3);"
- "f64vec4 exp2(f64vec4);"
-
- "float64_t log2(float64_t);"
- "f64vec2 log2(f64vec2);"
- "f64vec3 log2(f64vec3);"
- "f64vec4 log2(f64vec4);"
"\n");
}
@@ -4283,7 +4162,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
-#endif // !GLSLANG_ANGLE
//============================================================================
//
@@ -4299,7 +4177,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
if (spvVersion.vulkan == 0 && IncludeLegacy(version, profile, spvVersion))
stageBuiltins[EShLangVertex].append("vec4 ftransform();");
-#ifndef GLSLANG_ANGLE
//
// Original-style texture Functions with lod.
//
@@ -4359,7 +4236,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
}
-#endif // !GLSLANG_ANGLE
if ((profile != EEsProfile && version >= 150) ||
(profile == EEsProfile && version >= 310)) {
@@ -4369,7 +4245,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
//
//============================================================================
- if (profile != EEsProfile && version >= 400) {
+ if (profile != EEsProfile && (version >= 400 || version == 150)) {
stageBuiltins[EShLangGeometry].append(
"void EmitStreamVertex(int);"
"void EndStreamPrimitive(int);"
@@ -4397,10 +4273,10 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"void barrier();"
);
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
- stageBuiltins[EShLangMeshNV].append(
+ stageBuiltins[EShLangMesh].append(
"void barrier();"
);
- stageBuiltins[EShLangTaskNV].append(
+ stageBuiltins[EShLangTask].append(
"void barrier();"
);
}
@@ -4425,11 +4301,11 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
commonBuiltins.append("void memoryBarrierImage();");
}
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
- stageBuiltins[EShLangMeshNV].append(
+ stageBuiltins[EShLangMesh].append(
"void memoryBarrierShared();"
"void groupMemoryBarrier();"
);
- stageBuiltins[EShLangTaskNV].append(
+ stageBuiltins[EShLangTask].append(
"void memoryBarrierShared();"
"void groupMemoryBarrier();"
);
@@ -4440,7 +4316,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
commonBuiltins.append("void debugPrintfEXT();\n");
-#ifndef GLSLANG_ANGLE
if (profile != EEsProfile && version >= 450) {
// coopMatStoreNV perhaps ought to have "out" on the buf parameter, but
// adding it introduces undesirable tempArgs on the stack. What we want
@@ -4564,7 +4439,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
-#endif // !GLSLANG_ANGLE
// GL_ARB_derivative_control
if (profile != EEsProfile && version >= 400) {
@@ -4602,7 +4476,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"bool helperInvocationEXT();"
"\n");
-#ifndef GLSLANG_ANGLE
// GL_AMD_shader_explicit_vertex_parameter
if (profile != EEsProfile && version >= 450) {
stageBuiltins[EShLangFragment].append(
@@ -4653,7 +4526,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
- // GL_ARB_shader_clock & GL_EXT_shader_realtime_clock
+ // GL_ARB_shader_clock& GL_EXT_shader_realtime_clock
if (profile != EEsProfile && version >= 450) {
commonBuiltins.append(
"uvec2 clock2x32ARB();"
@@ -4738,14 +4611,12 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"void executeCallableEXT(uint, int);"
"\n");
}
-#endif // !GLSLANG_ANGLE
//E_SPV_NV_compute_shader_derivatives
if ((profile == EEsProfile && version >= 320) || (profile != EEsProfile && version >= 450)) {
stageBuiltins[EShLangCompute].append(derivativeControls);
stageBuiltins[EShLangCompute].append("\n");
}
-#ifndef GLSLANG_ANGLE
if (profile != EEsProfile && version >= 450) {
stageBuiltins[EShLangCompute].append(derivativesAndControl16bits);
stageBuiltins[EShLangCompute].append(derivativesAndControl64bits);
@@ -4754,11 +4625,21 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
// Builtins for GL_NV_mesh_shader
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
- stageBuiltins[EShLangMeshNV].append(
+ stageBuiltins[EShLangMesh].append(
"void writePackedPrimitiveIndices4x8NV(uint, uint);"
"\n");
}
-#endif // !GLSLANG_ANGLE
+ // Builtins for GL_EXT_mesh_shader
+ if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
+ // Builtins for GL_EXT_mesh_shader
+ stageBuiltins[EShLangTask].append(
+ "void EmitMeshTasksEXT(uint, uint, uint);"
+ "\n");
+
+ stageBuiltins[EShLangMesh].append(
+ "void SetMeshOutputsEXT(uint, uint);"
+ "\n");
+ }
#endif // !GLSLANG_WEB
//============================================================================
@@ -4796,7 +4677,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
if (spvVersion.spv == 0 && IncludeLegacy(version, profile, spvVersion)) {
//
// Matrix state. p. 31, 32, 37, 39, 40.
@@ -4914,7 +4795,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
-#endif // !GLSLANG_WEB && !GLSLANG_ANGLE
+#endif // !GLSLANG_WEB
//============================================================================
//
@@ -4945,7 +4826,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
}
#ifndef GLSLANG_WEB
-#ifndef GLSLANG_ANGLE
//============================================================================
//
// Define the interface to the mesh/task shader.
@@ -4954,7 +4834,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
// per-vertex attributes
- stageBuiltins[EShLangMeshNV].append(
+ stageBuiltins[EShLangMesh].append(
"out gl_MeshPerVertexNV {"
"vec4 gl_Position;"
"float gl_PointSize;"
@@ -4967,7 +4847,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
);
// per-primitive attributes
- stageBuiltins[EShLangMeshNV].append(
+ stageBuiltins[EShLangMesh].append(
"perprimitiveNV out gl_MeshPerPrimitiveNV {"
"int gl_PrimitiveID;"
"int gl_Layer;"
@@ -4978,7 +4858,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"} gl_MeshPrimitivesNV[];"
);
- stageBuiltins[EShLangMeshNV].append(
+ stageBuiltins[EShLangMesh].append(
"out uint gl_PrimitiveCountNV;"
"out uint gl_PrimitiveIndicesNV[];"
@@ -4992,10 +4872,38 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"in highp uvec3 gl_GlobalInvocationID;"
"in highp uint gl_LocalInvocationIndex;"
+ "\n");
+ // GL_EXT_mesh_shader
+ stageBuiltins[EShLangMesh].append(
+ "out uint gl_PrimitivePointIndicesEXT[];"
+ "out uvec2 gl_PrimitiveLineIndicesEXT[];"
+ "out uvec3 gl_PrimitiveTriangleIndicesEXT[];"
+ "in highp uvec3 gl_NumWorkGroups;"
"\n");
- stageBuiltins[EShLangTaskNV].append(
+ // per-vertex attributes
+ stageBuiltins[EShLangMesh].append(
+ "out gl_MeshPerVertexEXT {"
+ "vec4 gl_Position;"
+ "float gl_PointSize;"
+ "float gl_ClipDistance[];"
+ "float gl_CullDistance[];"
+ "} gl_MeshVerticesEXT[];"
+ );
+
+ // per-primitive attributes
+ stageBuiltins[EShLangMesh].append(
+ "perprimitiveEXT out gl_MeshPerPrimitiveEXT {"
+ "int gl_PrimitiveID;"
+ "int gl_Layer;"
+ "int gl_ViewportIndex;"
+ "bool gl_CullPrimitiveEXT;"
+ "int gl_PrimitiveShadingRateEXT;"
+ "} gl_MeshPrimitivesEXT[];"
+ );
+
+ stageBuiltins[EShLangTask].append(
"out uint gl_TaskCountNV;"
"const highp uvec3 gl_WorkGroupSize = uvec3(1,1,1);"
@@ -5008,32 +4916,32 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"in uint gl_MeshViewCountNV;"
"in uint gl_MeshViewIndicesNV[4];"
-
+ "in highp uvec3 gl_NumWorkGroups;"
"\n");
}
if (profile != EEsProfile && version >= 450) {
- stageBuiltins[EShLangMeshNV].append(
+ stageBuiltins[EShLangMesh].append(
"in highp int gl_DeviceIndex;" // GL_EXT_device_group
"in int gl_DrawIDARB;" // GL_ARB_shader_draw_parameters
+ "in int gl_ViewIndex;" // GL_EXT_multiview
"\n");
- stageBuiltins[EShLangTaskNV].append(
+ stageBuiltins[EShLangTask].append(
"in highp int gl_DeviceIndex;" // GL_EXT_device_group
"in int gl_DrawIDARB;" // GL_ARB_shader_draw_parameters
"\n");
if (version >= 460) {
- stageBuiltins[EShLangMeshNV].append(
+ stageBuiltins[EShLangMesh].append(
"in int gl_DrawID;"
"\n");
- stageBuiltins[EShLangTaskNV].append(
+ stageBuiltins[EShLangTask].append(
"in int gl_DrawID;"
"\n");
}
}
-#endif // !GLSLANG_ANGLE
//============================================================================
//
@@ -5174,9 +5082,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
);
}
- if (version >= 450)
+ if (version >= 430)
stageBuiltins[EShLangVertex].append(
"out int gl_ViewportMask[];" // GL_NV_viewport_array2
+ );
+
+ if (version >= 450)
+ stageBuiltins[EShLangVertex].append(
"out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering
"out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering
"out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes
@@ -5312,9 +5224,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"in int gl_InvocationID;"
);
- if (version >= 450)
+ if (version >= 430)
stageBuiltins[EShLangGeometry].append(
"out int gl_ViewportMask[];" // GL_NV_viewport_array2
+ );
+
+ if (version >= 450)
+ stageBuiltins[EShLangGeometry].append(
"out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering
"out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering
"out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes
@@ -5390,7 +5306,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
if (version >= 450)
stageBuiltins[EShLangTessControl].append(
"float gl_CullDistance[];"
+ );
+ if (version >= 430)
+ stageBuiltins[EShLangTessControl].append(
"int gl_ViewportMask[];" // GL_NV_viewport_array2
+ );
+ if (version >= 450)
+ stageBuiltins[EShLangTessControl].append(
"vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering
"int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering
"vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes
@@ -5493,9 +5415,13 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"out int gl_Layer;"
"\n");
- if (version >= 450)
+ if (version >= 430)
stageBuiltins[EShLangTessEvaluation].append(
"out int gl_ViewportMask[];" // GL_NV_viewport_array2
+ );
+
+ if (version >= 450)
+ stageBuiltins[EShLangTessEvaluation].append(
"out vec4 gl_SecondaryPositionNV;" // GL_NV_stereo_view_rendering
"out int gl_SecondaryViewportMaskNV[];" // GL_NV_stereo_view_rendering
"out vec4 gl_PositionPerViewNV[];" // GL_NVX_multiview_per_view_attributes
@@ -5652,6 +5578,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"flat in int gl_InvocationsPerPixelNV;"
"in vec3 gl_BaryCoordNV;" // GL_NV_fragment_shader_barycentric
"in vec3 gl_BaryCoordNoPerspNV;"
+ "in vec3 gl_BaryCoordEXT;" // GL_EXT_fragment_shader_barycentric
+ "in vec3 gl_BaryCoordNoPerspEXT;"
);
if (version >= 450)
@@ -5716,7 +5644,9 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
stageBuiltins[EShLangFragment].append(
"in vec3 gl_BaryCoordNV;"
"in vec3 gl_BaryCoordNoPerspNV;"
- );
+ "in vec3 gl_BaryCoordEXT;"
+ "in vec3 gl_BaryCoordNoPerspEXT;"
+ );
if (version >= 310)
stageBuiltins[EShLangFragment].append(
"flat in highp int gl_ShadingRateEXT;" // GL_EXT_fragment_shading_rate
@@ -5745,7 +5675,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"\n");
}
-#ifndef GLSLANG_ANGLE
// GL_ARB_shader_ballot
if (profile != EEsProfile && version >= 450) {
const char* ballotDecls =
@@ -5781,8 +5710,8 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
stageBuiltins[EShLangGeometry] .append(ballotDecls);
stageBuiltins[EShLangCompute] .append(ballotDecls);
stageBuiltins[EShLangFragment] .append(fragmentBallotDecls);
- stageBuiltins[EShLangMeshNV] .append(ballotDecls);
- stageBuiltins[EShLangTaskNV] .append(ballotDecls);
+ stageBuiltins[EShLangMesh] .append(ballotDecls);
+ stageBuiltins[EShLangTask] .append(ballotDecls);
stageBuiltins[EShLangRayGen] .append(rtBallotDecls);
stageBuiltins[EShLangIntersect] .append(rtBallotDecls);
// No volatile qualifier on these builtins in any-hit
@@ -5850,10 +5779,10 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
stageBuiltins[EShLangCompute] .append(subgroupDecls);
stageBuiltins[EShLangCompute] .append(computeSubgroupDecls);
stageBuiltins[EShLangFragment] .append(fragmentSubgroupDecls);
- stageBuiltins[EShLangMeshNV] .append(subgroupDecls);
- stageBuiltins[EShLangMeshNV] .append(computeSubgroupDecls);
- stageBuiltins[EShLangTaskNV] .append(subgroupDecls);
- stageBuiltins[EShLangTaskNV] .append(computeSubgroupDecls);
+ stageBuiltins[EShLangMesh] .append(subgroupDecls);
+ stageBuiltins[EShLangMesh] .append(computeSubgroupDecls);
+ stageBuiltins[EShLangTask] .append(subgroupDecls);
+ stageBuiltins[EShLangTask] .append(computeSubgroupDecls);
stageBuiltins[EShLangRayGen] .append(rtSubgroupDecls);
stageBuiltins[EShLangIntersect] .append(rtSubgroupDecls);
// No volatile qualifier on these builtins in any-hit
@@ -5887,6 +5816,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"const uint gl_RayFlagsCullNoOpaqueEXT = 128U;"
"const uint gl_RayFlagsSkipTrianglesEXT = 256U;"
"const uint gl_RayFlagsSkipAABBEXT = 512U;"
+ "const uint gl_RayFlagsForceOpacityMicromap2StateEXT = 1024U;"
"const uint gl_HitKindFrontFacingTriangleEXT = 254U;"
"const uint gl_HitKindBackFacingTriangleEXT = 255U;"
"\n";
@@ -5938,6 +5868,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"in uint gl_IncomingRayFlagsNV;"
"in uint gl_IncomingRayFlagsEXT;"
"in float gl_CurrentRayTimeNV;"
+ "in uint gl_CullMaskEXT;"
"\n";
const char *hitDecls =
"in uvec3 gl_LaunchIDNV;"
@@ -5974,6 +5905,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"in uint gl_IncomingRayFlagsNV;"
"in uint gl_IncomingRayFlagsEXT;"
"in float gl_CurrentRayTimeNV;"
+ "in uint gl_CullMaskEXT;"
"\n";
const char *missDecls =
"in uvec3 gl_LaunchIDNV;"
@@ -5993,6 +5925,7 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
"in uint gl_IncomingRayFlagsNV;"
"in uint gl_IncomingRayFlagsEXT;"
"in float gl_CurrentRayTimeNV;"
+ "in uint gl_CullMaskEXT;"
"\n";
const char *callableDecls =
@@ -6100,8 +6033,6 @@ void TBuiltIns::initialize(int version, EProfile profile, const SpvVersion& spvV
}
}
}
-#endif // !GLSLANG_ANGLE
-
#endif // !GLSLANG_WEB
// printf("%s\n", commonBuiltins.c_str());
@@ -6121,7 +6052,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
// enumerate all the types
const TBasicType bTypes[] = { EbtFloat, EbtInt, EbtUint,
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
EbtFloat16
#endif
};
@@ -6155,11 +6086,7 @@ void TBuiltIns::add2ndGenerationSamplingImaging(int version, EProfile profile, c
#ifdef GLSLANG_WEB
for (int dim = Esd2D; dim <= EsdCube; ++dim) { // 2D, 3D, and Cube
#else
-#if defined(GLSLANG_ANGLE)
- for (int dim = Esd2D; dim < EsdNumDims; ++dim) { // 2D, ..., buffer, subpass
-#else
for (int dim = Esd1D; dim < EsdNumDims; ++dim) { // 1D, ..., buffer, subpass
-#endif
if (dim == EsdSubpass && spvVersion.vulkan == 0)
continue;
if (dim == EsdSubpass && (image || shadow || arrayed))
@@ -6329,38 +6256,44 @@ void TBuiltIns::addQueryFunctions(TSampler sampler, const TString& typeName, int
//
// textureQueryLod(), fragment stage only
// Also enabled with extension GL_ARB_texture_query_lod
+ // Extension GL_ARB_texture_query_lod says that textureQueryLOD() also exist at extension.
if (profile != EEsProfile && version >= 150 && sampler.isCombined() && sampler.dim != EsdRect &&
! sampler.isMultiSample() && ! sampler.isBuffer()) {
- for (int f16TexAddr = 0; f16TexAddr < 2; ++f16TexAddr) {
- if (f16TexAddr && sampler.type != EbtFloat16)
- continue;
- stageBuiltins[EShLangFragment].append("vec2 textureQueryLod(");
- stageBuiltins[EShLangFragment].append(typeName);
+
+ const TString funcName[2] = {"vec2 textureQueryLod(", "vec2 textureQueryLOD("};
+
+ for (int i = 0; i < 2; ++i){
+ for (int f16TexAddr = 0; f16TexAddr < 2; ++f16TexAddr) {
+ if (f16TexAddr && sampler.type != EbtFloat16)
+ continue;
+ stageBuiltins[EShLangFragment].append(funcName[i]);
+ stageBuiltins[EShLangFragment].append(typeName);
+ if (dimMap[sampler.dim] == 1)
+ if (f16TexAddr)
+ stageBuiltins[EShLangFragment].append(", float16_t");
+ else
+ stageBuiltins[EShLangFragment].append(", float");
+ else {
+ if (f16TexAddr)
+ stageBuiltins[EShLangFragment].append(", f16vec");
+ else
+ stageBuiltins[EShLangFragment].append(", vec");
+ stageBuiltins[EShLangFragment].append(postfixes[dimMap[sampler.dim]]);
+ }
+ stageBuiltins[EShLangFragment].append(");\n");
+ }
+
+ stageBuiltins[EShLangCompute].append(funcName[i]);
+ stageBuiltins[EShLangCompute].append(typeName);
if (dimMap[sampler.dim] == 1)
- if (f16TexAddr)
- stageBuiltins[EShLangFragment].append(", float16_t");
- else
- stageBuiltins[EShLangFragment].append(", float");
+ stageBuiltins[EShLangCompute].append(", float");
else {
- if (f16TexAddr)
- stageBuiltins[EShLangFragment].append(", f16vec");
- else
- stageBuiltins[EShLangFragment].append(", vec");
- stageBuiltins[EShLangFragment].append(postfixes[dimMap[sampler.dim]]);
+ stageBuiltins[EShLangCompute].append(", vec");
+ stageBuiltins[EShLangCompute].append(postfixes[dimMap[sampler.dim]]);
}
- stageBuiltins[EShLangFragment].append(");\n");
+ stageBuiltins[EShLangCompute].append(");\n");
}
-
- stageBuiltins[EShLangCompute].append("vec2 textureQueryLod(");
- stageBuiltins[EShLangCompute].append(typeName);
- if (dimMap[sampler.dim] == 1)
- stageBuiltins[EShLangCompute].append(", float");
- else {
- stageBuiltins[EShLangCompute].append(", vec");
- stageBuiltins[EShLangCompute].append(postfixes[dimMap[sampler.dim]]);
- }
- stageBuiltins[EShLangCompute].append(");\n");
}
//
@@ -6605,9 +6538,6 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
#ifdef GLSLANG_WEB
profile = EEsProfile;
version = 310;
-#elif defined(GLSLANG_ANGLE)
- profile = ECoreProfile;
- version = 450;
#endif
//
@@ -6684,7 +6614,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
continue;
// loop over 16-bit floating-point texel addressing
-#if defined(GLSLANG_WEB) || defined(GLSLANG_ANGLE)
+#if defined(GLSLANG_WEB)
const int f16TexAddr = 0;
#else
for (int f16TexAddr = 0; f16TexAddr <= 1; ++f16TexAddr)
@@ -6697,7 +6627,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
totalDims--;
}
// loop over "bool" lod clamp
-#if defined(GLSLANG_WEB) || defined(GLSLANG_ANGLE)
+#if defined(GLSLANG_WEB)
const int lodClamp = 0;
#else
for (int lodClamp = 0; lodClamp <= 1 ;++lodClamp)
@@ -6709,7 +6639,7 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, const TString& typeName,
continue;
// loop over "bool" sparse or not
-#if defined(GLSLANG_WEB) || defined(GLSLANG_ANGLE)
+#if defined(GLSLANG_WEB)
const int sparse = 0;
#else
for (int sparse = 0; sparse <= 1; ++sparse)
@@ -6893,9 +6823,6 @@ void TBuiltIns::addGatherFunctions(TSampler sampler, const TString& typeName, in
#ifdef GLSLANG_WEB
profile = EEsProfile;
version = 310;
-#elif defined(GLSLANG_ANGLE)
- profile = ECoreProfile;
- version = 450;
#endif
switch (sampler.dim) {
@@ -7139,9 +7066,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
#ifdef GLSLANG_WEB
version = 310;
profile = EEsProfile;
-#elif defined(GLSLANG_ANGLE)
- version = 450;
- profile = ECoreProfile;
#endif
//
@@ -7574,7 +7498,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
s.append("\n");
}
-#ifndef GLSLANG_ANGLE
// atomic counters (some in compute below)
if ((profile == EEsProfile && version >= 310) ||
(profile != EEsProfile && version >= 420)) {
@@ -7611,7 +7534,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
s.append("\n");
}
-#endif // !GLSLANG_ANGLE
// GL_ARB_cull_distance
if (profile != EEsProfile && version >= 450) {
@@ -7628,7 +7550,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
s.append(builtInConstant);
}
-#ifndef GLSLANG_ANGLE
// SPV_NV_mesh_shader
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
snprintf(builtInConstant, maxSize, "const int gl_MaxMeshOutputVerticesNV = %d;", resources.maxMeshOutputVerticesNV);
@@ -7652,7 +7573,6 @@ void TBuiltIns::initialize(const TBuiltInResource &resources, int version, EProf
s.append("\n");
}
#endif
-#endif
s.append("\n");
}
@@ -7682,6 +7602,23 @@ static void SpecialQualifier(const char* name, TStorageQualifier qualifier, TBui
}
//
+// Modify the symbol's flat decoration.
+//
+// Safe to call even if name is not present.
+//
+// Originally written to transform gl_SubGroupSizeARB from uniform to fragment input in Vulkan.
+//
+static void ModifyFlatDecoration(const char* name, bool flat, TSymbolTable& symbolTable)
+{
+ TSymbol* symbol = symbolTable.find(name);
+ if (symbol == nullptr)
+ return;
+
+ TQualifier& symQualifier = symbol->getWritableType().getQualifier();
+ symQualifier.flat = flat;
+}
+
+//
// To tag built-in variables with their TBuiltInVariable enum. Use this when the
// normal declaration text already gets the qualifier right, and all that's needed
// is setting the builtIn field. This should be the normal way for all new
@@ -7741,9 +7678,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
#ifdef GLSLANG_WEB
version = 310;
profile = EEsProfile;
-#elif defined(GLSLANG_ANGLE)
- version = 450;
- profile = ECoreProfile;
#endif
//
@@ -8064,9 +7998,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable);
BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable);
- if (spvVersion.vulkan > 0)
+ if (spvVersion.vulkan > 0) {
// Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable);
+ if (language == EShLangFragment)
+ ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable);
+ }
else
BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable);
}
@@ -8133,6 +8070,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
SpecialQualifier("gl_FragDepth", EvqFragDepth, EbvFragDepth, symbolTable);
#ifndef GLSLANG_WEB
SpecialQualifier("gl_FragDepthEXT", EvqFragDepth, EbvFragDepth, symbolTable);
+ SpecialQualifier("gl_FragStencilRefARB", EvqFragStencil, EbvFragStencilRef, symbolTable);
SpecialQualifier("gl_HelperInvocation", EvqVaryingIn, EbvHelperInvocation, symbolTable);
BuiltInVariable("gl_ClipDistance", EbvClipDistance, symbolTable);
@@ -8145,7 +8083,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
}
if (profile != EEsProfile && version < 400) {
- symbolTable.setFunctionExtensions("textureQueryLod", 1, &E_GL_ARB_texture_query_lod);
+ symbolTable.setFunctionExtensions("textureQueryLOD", 1, &E_GL_ARB_texture_query_lod);
}
if (profile != EEsProfile && version >= 460) {
@@ -8174,6 +8112,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setFunctionExtensions("rayQueryGetWorldRayDirectionEXT", 1, &E_GL_EXT_ray_query);
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);
}
if ((profile != EEsProfile && version >= 130) ||
@@ -8393,6 +8332,10 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setVariableExtensions("gl_BaryCoordNoPerspNV", 1, &E_GL_NV_fragment_shader_barycentric);
BuiltInVariable("gl_BaryCoordNV", EbvBaryCoordNV, symbolTable);
BuiltInVariable("gl_BaryCoordNoPerspNV", EbvBaryCoordNoPerspNV, symbolTable);
+ symbolTable.setVariableExtensions("gl_BaryCoordEXT", 1, &E_GL_EXT_fragment_shader_barycentric);
+ symbolTable.setVariableExtensions("gl_BaryCoordNoPerspEXT", 1, &E_GL_EXT_fragment_shader_barycentric);
+ BuiltInVariable("gl_BaryCoordEXT", EbvBaryCoordEXT, symbolTable);
+ BuiltInVariable("gl_BaryCoordNoPerspEXT", EbvBaryCoordNoPerspEXT, symbolTable);
}
if ((profile != EEsProfile && version >= 450) ||
@@ -8408,7 +8351,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setFunctionExtensions("clockARB", 1, &E_GL_ARB_shader_clock);
symbolTable.setFunctionExtensions("clock2x32ARB", 1, &E_GL_ARB_shader_clock);
- symbolTable.setFunctionExtensions("clockRealtimeEXT", 1, &E_GL_EXT_shader_realtime_clock);
+ symbolTable.setFunctionExtensions("clockRealtimeEXT", 1, &E_GL_EXT_shader_realtime_clock);
symbolTable.setFunctionExtensions("clockRealtime2x32EXT", 1, &E_GL_EXT_shader_realtime_clock);
if (profile == EEsProfile && version < 320) {
@@ -8428,10 +8371,11 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
}
if (profile != EEsProfile && version < 330 ) {
- symbolTable.setFunctionExtensions("floatBitsToInt", 1, &E_GL_ARB_shader_bit_encoding);
- symbolTable.setFunctionExtensions("floatBitsToUint", 1, &E_GL_ARB_shader_bit_encoding);
- symbolTable.setFunctionExtensions("intBitsToFloat", 1, &E_GL_ARB_shader_bit_encoding);
- symbolTable.setFunctionExtensions("uintBitsToFloat", 1, &E_GL_ARB_shader_bit_encoding);
+ const char* bitsConvertExt[2] = {E_GL_ARB_shader_bit_encoding, E_GL_ARB_gpu_shader5};
+ symbolTable.setFunctionExtensions("floatBitsToInt", 2, bitsConvertExt);
+ symbolTable.setFunctionExtensions("floatBitsToUint", 2, bitsConvertExt);
+ symbolTable.setFunctionExtensions("intBitsToFloat", 2, bitsConvertExt);
+ symbolTable.setFunctionExtensions("uintBitsToFloat", 2, bitsConvertExt);
}
if (profile != EEsProfile && version < 430 ) {
@@ -8492,9 +8436,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable);
BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable);
- if (spvVersion.vulkan > 0)
+ if (spvVersion.vulkan > 0) {
// Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable);
+ if (language == EShLangFragment)
+ ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable);
+ }
else
BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable);
}
@@ -8709,9 +8656,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable);
BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable);
- if (spvVersion.vulkan > 0)
+ if (spvVersion.vulkan > 0) {
// Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable);
+ if (language == EShLangFragment)
+ ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable);
+ }
else
BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable);
}
@@ -8787,7 +8737,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
#endif // !GLSLANG_WEB
break;
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
case EShLangRayGen:
case EShLangIntersect:
case EShLangAnyHit:
@@ -8817,6 +8767,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setVariableExtensions("gl_RayTminEXT", 1, &E_GL_EXT_ray_tracing);
symbolTable.setVariableExtensions("gl_RayTmaxNV", 1, &E_GL_NV_ray_tracing);
symbolTable.setVariableExtensions("gl_RayTmaxEXT", 1, &E_GL_EXT_ray_tracing);
+ symbolTable.setVariableExtensions("gl_CullMaskEXT", 1, &E_GL_EXT_ray_cull_mask);
symbolTable.setVariableExtensions("gl_HitTNV", 1, &E_GL_NV_ray_tracing);
symbolTable.setVariableExtensions("gl_HitTEXT", 1, &E_GL_EXT_ray_tracing);
symbolTable.setVariableExtensions("gl_HitKindNV", 1, &E_GL_NV_ray_tracing);
@@ -8866,6 +8817,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable("gl_RayTminEXT", EbvRayTmin, symbolTable);
BuiltInVariable("gl_RayTmaxNV", EbvRayTmax, symbolTable);
BuiltInVariable("gl_RayTmaxEXT", EbvRayTmax, symbolTable);
+ BuiltInVariable("gl_CullMaskEXT", EbvCullMask, symbolTable);
BuiltInVariable("gl_HitTNV", EbvHitT, symbolTable);
BuiltInVariable("gl_HitTEXT", EbvHitT, symbolTable);
BuiltInVariable("gl_HitKindNV", EbvHitKind, symbolTable);
@@ -8897,9 +8849,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable);
BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable);
- if (spvVersion.vulkan > 0)
+ if (spvVersion.vulkan > 0) {
// Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable);
+ if (language == EShLangFragment)
+ ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable);
+ }
else
BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable);
@@ -8943,7 +8898,7 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
}
break;
- case EShLangMeshNV:
+ case EShLangMesh:
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
// per-vertex builtins
symbolTable.setVariableExtensions("gl_MeshVerticesNV", "gl_Position", 1, &E_GL_NV_mesh_shader);
@@ -8987,12 +8942,19 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setVariableExtensions("gl_PrimitiveIndicesNV", 1, &E_GL_NV_mesh_shader);
symbolTable.setVariableExtensions("gl_MeshViewCountNV", 1, &E_GL_NV_mesh_shader);
symbolTable.setVariableExtensions("gl_MeshViewIndicesNV", 1, &E_GL_NV_mesh_shader);
- symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_NV_mesh_shader);
- symbolTable.setVariableExtensions("gl_WorkGroupID", 1, &E_GL_NV_mesh_shader);
- symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_NV_mesh_shader);
- symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_NV_mesh_shader);
- symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_NV_mesh_shader);
-
+ if (profile != EEsProfile) {
+ symbolTable.setVariableExtensions("gl_WorkGroupSize", Num_AEP_mesh_shader, AEP_mesh_shader);
+ symbolTable.setVariableExtensions("gl_WorkGroupID", Num_AEP_mesh_shader, AEP_mesh_shader);
+ symbolTable.setVariableExtensions("gl_LocalInvocationID", Num_AEP_mesh_shader, AEP_mesh_shader);
+ symbolTable.setVariableExtensions("gl_GlobalInvocationID", Num_AEP_mesh_shader, AEP_mesh_shader);
+ symbolTable.setVariableExtensions("gl_LocalInvocationIndex", Num_AEP_mesh_shader, AEP_mesh_shader);
+ } else {
+ symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_NV_mesh_shader);
+ symbolTable.setVariableExtensions("gl_WorkGroupID", 1, &E_GL_NV_mesh_shader);
+ symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_NV_mesh_shader);
+ symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_NV_mesh_shader);
+ symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_NV_mesh_shader);
+ }
BuiltInVariable("gl_PrimitiveCountNV", EbvPrimitiveCountNV, symbolTable);
BuiltInVariable("gl_PrimitiveIndicesNV", EbvPrimitiveIndicesNV, symbolTable);
BuiltInVariable("gl_MeshViewCountNV", EbvMeshViewCountNV, symbolTable);
@@ -9010,12 +8972,54 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setVariableExtensions("gl_MaxMeshViewCountNV", 1, &E_GL_NV_mesh_shader);
// builtin functions
- symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader);
- symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader);
- symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_NV_mesh_shader);
+ if (profile != EEsProfile) {
+ symbolTable.setFunctionExtensions("barrier", Num_AEP_mesh_shader, AEP_mesh_shader);
+ symbolTable.setFunctionExtensions("memoryBarrierShared", Num_AEP_mesh_shader, AEP_mesh_shader);
+ symbolTable.setFunctionExtensions("groupMemoryBarrier", Num_AEP_mesh_shader, AEP_mesh_shader);
+ } else {
+ symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader);
+ symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader);
+ symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_NV_mesh_shader);
+ }
+ symbolTable.setFunctionExtensions("writePackedPrimitiveIndices4x8NV", 1, &E_GL_NV_mesh_shader);
}
if (profile != EEsProfile && version >= 450) {
+ // GL_EXT_Mesh_shader
+ symbolTable.setVariableExtensions("gl_PrimitivePointIndicesEXT", 1, &E_GL_EXT_mesh_shader);
+ symbolTable.setVariableExtensions("gl_PrimitiveLineIndicesEXT", 1, &E_GL_EXT_mesh_shader);
+ symbolTable.setVariableExtensions("gl_PrimitiveTriangleIndicesEXT", 1, &E_GL_EXT_mesh_shader);
+ symbolTable.setVariableExtensions("gl_NumWorkGroups", 1, &E_GL_EXT_mesh_shader);
+
+ BuiltInVariable("gl_PrimitivePointIndicesEXT", EbvPrimitivePointIndicesEXT, symbolTable);
+ BuiltInVariable("gl_PrimitiveLineIndicesEXT", EbvPrimitiveLineIndicesEXT, symbolTable);
+ BuiltInVariable("gl_PrimitiveTriangleIndicesEXT", EbvPrimitiveTriangleIndicesEXT, symbolTable);
+ BuiltInVariable("gl_NumWorkGroups", EbvNumWorkGroups, symbolTable);
+
+ symbolTable.setVariableExtensions("gl_MeshVerticesEXT", "gl_Position", 1, &E_GL_EXT_mesh_shader);
+ symbolTable.setVariableExtensions("gl_MeshVerticesEXT", "gl_PointSize", 1, &E_GL_EXT_mesh_shader);
+ symbolTable.setVariableExtensions("gl_MeshVerticesEXT", "gl_ClipDistance", 1, &E_GL_EXT_mesh_shader);
+ symbolTable.setVariableExtensions("gl_MeshVerticesEXT", "gl_CullDistance", 1, &E_GL_EXT_mesh_shader);
+
+ BuiltInVariable("gl_MeshVerticesEXT", "gl_Position", EbvPosition, symbolTable);
+ BuiltInVariable("gl_MeshVerticesEXT", "gl_PointSize", EbvPointSize, symbolTable);
+ BuiltInVariable("gl_MeshVerticesEXT", "gl_ClipDistance", EbvClipDistance, symbolTable);
+ BuiltInVariable("gl_MeshVerticesEXT", "gl_CullDistance", EbvCullDistance, symbolTable);
+
+ symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_PrimitiveID", 1, &E_GL_EXT_mesh_shader);
+ symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_Layer", 1, &E_GL_EXT_mesh_shader);
+ symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_ViewportIndex", 1, &E_GL_EXT_mesh_shader);
+ symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_CullPrimitiveEXT", 1, &E_GL_EXT_mesh_shader);
+ symbolTable.setVariableExtensions("gl_MeshPrimitivesEXT", "gl_PrimitiveShadingRateEXT", 1, &E_GL_EXT_mesh_shader);
+
+ BuiltInVariable("gl_MeshPrimitivesEXT", "gl_PrimitiveID", EbvPrimitiveId, symbolTable);
+ BuiltInVariable("gl_MeshPrimitivesEXT", "gl_Layer", EbvLayer, symbolTable);
+ BuiltInVariable("gl_MeshPrimitivesEXT", "gl_ViewportIndex", EbvViewportIndex, symbolTable);
+ BuiltInVariable("gl_MeshPrimitivesEXT", "gl_CullPrimitiveEXT", EbvCullPrimitiveEXT, symbolTable);
+ BuiltInVariable("gl_MeshPrimitivesEXT", "gl_PrimitiveShadingRateEXT", EbvPrimitiveShadingRateKHR, symbolTable);
+
+ symbolTable.setFunctionExtensions("SetMeshOutputsEXT", 1, &E_GL_EXT_mesh_shader);
+
// GL_EXT_device_group
symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group);
BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
@@ -9026,6 +9030,9 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
if (version >= 460) {
BuiltInVariable("gl_DrawID", EbvDrawId, symbolTable);
}
+ // GL_EXT_multiview
+ BuiltInVariable("gl_ViewIndex", EbvViewIndex, symbolTable);
+ symbolTable.setVariableExtensions("gl_ViewIndex", 1, &E_GL_EXT_multiview);
// GL_ARB_shader_ballot
symbolTable.setVariableExtensions("gl_SubGroupSizeARB", 1, &E_GL_ARB_shader_ballot);
@@ -9043,9 +9050,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable);
BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable);
- if (spvVersion.vulkan > 0)
+ if (spvVersion.vulkan > 0) {
// Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable);
+ if (language == EShLangFragment)
+ ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable);
+ }
else
BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable);
}
@@ -9095,16 +9105,24 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
}
break;
- case EShLangTaskNV:
+ case EShLangTask:
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
symbolTable.setVariableExtensions("gl_TaskCountNV", 1, &E_GL_NV_mesh_shader);
- symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_NV_mesh_shader);
- symbolTable.setVariableExtensions("gl_WorkGroupID", 1, &E_GL_NV_mesh_shader);
- symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_NV_mesh_shader);
- symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_NV_mesh_shader);
- symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_NV_mesh_shader);
symbolTable.setVariableExtensions("gl_MeshViewCountNV", 1, &E_GL_NV_mesh_shader);
symbolTable.setVariableExtensions("gl_MeshViewIndicesNV", 1, &E_GL_NV_mesh_shader);
+ if (profile != EEsProfile) {
+ symbolTable.setVariableExtensions("gl_WorkGroupSize", Num_AEP_mesh_shader, AEP_mesh_shader);
+ symbolTable.setVariableExtensions("gl_WorkGroupID", Num_AEP_mesh_shader, AEP_mesh_shader);
+ symbolTable.setVariableExtensions("gl_LocalInvocationID", Num_AEP_mesh_shader, AEP_mesh_shader);
+ symbolTable.setVariableExtensions("gl_GlobalInvocationID", Num_AEP_mesh_shader, AEP_mesh_shader);
+ symbolTable.setVariableExtensions("gl_LocalInvocationIndex", Num_AEP_mesh_shader, AEP_mesh_shader);
+ } else {
+ symbolTable.setVariableExtensions("gl_WorkGroupSize", 1, &E_GL_NV_mesh_shader);
+ symbolTable.setVariableExtensions("gl_WorkGroupID", 1, &E_GL_NV_mesh_shader);
+ symbolTable.setVariableExtensions("gl_LocalInvocationID", 1, &E_GL_NV_mesh_shader);
+ symbolTable.setVariableExtensions("gl_GlobalInvocationID", 1, &E_GL_NV_mesh_shader);
+ symbolTable.setVariableExtensions("gl_LocalInvocationIndex", 1, &E_GL_NV_mesh_shader);
+ }
BuiltInVariable("gl_TaskCountNV", EbvTaskCountNV, symbolTable);
BuiltInVariable("gl_WorkGroupSize", EbvWorkGroupSize, symbolTable);
@@ -9118,12 +9136,23 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.setVariableExtensions("gl_MaxTaskWorkGroupSizeNV", 1, &E_GL_NV_mesh_shader);
symbolTable.setVariableExtensions("gl_MaxMeshViewCountNV", 1, &E_GL_NV_mesh_shader);
- symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader);
- symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader);
- symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_NV_mesh_shader);
+ if (profile != EEsProfile) {
+ symbolTable.setFunctionExtensions("barrier", Num_AEP_mesh_shader, AEP_mesh_shader);
+ symbolTable.setFunctionExtensions("memoryBarrierShared", Num_AEP_mesh_shader, AEP_mesh_shader);
+ symbolTable.setFunctionExtensions("groupMemoryBarrier", Num_AEP_mesh_shader, AEP_mesh_shader);
+ } else {
+ symbolTable.setFunctionExtensions("barrier", 1, &E_GL_NV_mesh_shader);
+ symbolTable.setFunctionExtensions("memoryBarrierShared", 1, &E_GL_NV_mesh_shader);
+ symbolTable.setFunctionExtensions("groupMemoryBarrier", 1, &E_GL_NV_mesh_shader);
+ }
}
if (profile != EEsProfile && version >= 450) {
+ // GL_EXT_mesh_shader
+ symbolTable.setFunctionExtensions("EmitMeshTasksEXT", 1, &E_GL_EXT_mesh_shader);
+ symbolTable.setVariableExtensions("gl_NumWorkGroups", 1, &E_GL_EXT_mesh_shader);
+ BuiltInVariable("gl_NumWorkGroups", EbvNumWorkGroups, symbolTable);
+
// GL_EXT_device_group
symbolTable.setVariableExtensions("gl_DeviceIndex", 1, &E_GL_EXT_device_group);
BuiltInVariable("gl_DeviceIndex", EbvDeviceIndex, symbolTable);
@@ -9151,9 +9180,12 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
BuiltInVariable("gl_SubGroupLeMaskARB", EbvSubGroupLeMask, symbolTable);
BuiltInVariable("gl_SubGroupLtMaskARB", EbvSubGroupLtMask, symbolTable);
- if (spvVersion.vulkan > 0)
+ if (spvVersion.vulkan > 0) {
// Treat "gl_SubGroupSizeARB" as shader input instead of uniform for Vulkan
SpecialQualifier("gl_SubGroupSizeARB", EvqVaryingIn, EbvSubGroupSize, symbolTable);
+ if (language == EShLangFragment)
+ ModifyFlatDecoration("gl_SubGroupSizeARB", true, symbolTable);
+ }
else
BuiltInVariable("gl_SubGroupSizeARB", EbvSubGroupSize, symbolTable);
}
@@ -9747,17 +9779,27 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
symbolTable.relateToOperator("executeCallableEXT", EOpExecuteCallableKHR);
}
break;
- case EShLangMeshNV:
+ case EShLangMesh:
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
symbolTable.relateToOperator("writePackedPrimitiveIndices4x8NV", EOpWritePackedPrimitiveIndices4x8NV);
+ symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared);
+ symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier);
+ symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared);
+ }
+
+ if (profile != EEsProfile && version >= 450) {
+ symbolTable.relateToOperator("SetMeshOutputsEXT", EOpSetMeshOutputsEXT);
}
- // fall through
- case EShLangTaskNV:
+ break;
+ case EShLangTask:
if ((profile != EEsProfile && version >= 450) || (profile == EEsProfile && version >= 320)) {
symbolTable.relateToOperator("memoryBarrierShared", EOpMemoryBarrierShared);
symbolTable.relateToOperator("groupMemoryBarrier", EOpGroupMemoryBarrier);
symbolTable.relateToOperator("subgroupMemoryBarrierShared", EOpSubgroupMemoryBarrierShared);
}
+ if (profile != EEsProfile && version >= 450) {
+ symbolTable.relateToOperator("EmitMeshTasksEXT", EOpEmitMeshTasksEXT);
+ }
break;
default:
@@ -9778,10 +9820,6 @@ void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion
void TBuiltIns::identifyBuiltIns(int version, EProfile profile, const SpvVersion& spvVersion, EShLanguage language, TSymbolTable& symbolTable, const TBuiltInResource &resources)
{
#ifndef GLSLANG_WEB
-#if defined(GLSLANG_ANGLE)
- profile = ECoreProfile;
- version = 450;
-#endif
if (profile != EEsProfile && version >= 430 && version < 440) {
symbolTable.setVariableExtensions("gl_MaxTransformFeedbackBuffers", 1, &E_GL_ARB_enhanced_layouts);
symbolTable.setVariableExtensions("gl_MaxTransformFeedbackInterleavedComponents", 1, &E_GL_ARB_enhanced_layouts);
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
index 1283f449392..6a43ef3e847 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp
@@ -2733,10 +2733,10 @@ TIntermAggregate* TIntermediate::addForLoop(TIntermNode* body, TIntermNode* init
TIntermAggregate* loopSequence = (initializer == nullptr ||
initializer->getAsAggregate() == nullptr) ? makeAggregate(initializer, loc)
: initializer->getAsAggregate();
- if (loopSequence != nullptr && loopSequence->getOp() == EOpSequence)
+ if (loopSequence != nullptr && (loopSequence->getOp() == EOpSequence || loopSequence->getOp() == EOpScope))
loopSequence->setOp(EOpNull);
loopSequence = growAggregate(loopSequence, node);
- loopSequence->setOperator(EOpSequence);
+ loopSequence->setOperator(getDebugInfo() ? EOpScope : EOpSequence);
return loopSequence;
}
@@ -2766,7 +2766,7 @@ void TIntermBranch::updatePrecision(TPrecisionQualifier parentPrecision)
return;
if (exp->getBasicType() == EbtInt || exp->getBasicType() == EbtUint ||
- exp->getBasicType() == EbtFloat || exp->getBasicType() == EbtFloat16) {
+ exp->getBasicType() == EbtFloat) {
if (parentPrecision != EpqNone && exp->getQualifier().precision == EpqNone) {
exp->propagatePrecision(parentPrecision);
}
@@ -3284,7 +3284,7 @@ bool TIntermediate::promoteUnary(TIntermUnary& node)
void TIntermUnary::updatePrecision()
{
if (getBasicType() == EbtInt || getBasicType() == EbtUint ||
- getBasicType() == EbtFloat || getBasicType() == EbtFloat16) {
+ getBasicType() == EbtFloat) {
if (operand->getQualifier().precision > getQualifier().precision)
getQualifier().precision = operand->getQualifier().precision;
}
@@ -3785,7 +3785,7 @@ bool TIntermediate::promoteAggregate(TIntermAggregate& node)
void TIntermAggregate::updatePrecision()
{
if (getBasicType() == EbtInt || getBasicType() == EbtUint ||
- getBasicType() == EbtFloat || getBasicType() == EbtFloat16) {
+ getBasicType() == EbtFloat) {
TPrecisionQualifier maxPrecision = EpqNone;
TIntermSequence operands = getSequence();
for (unsigned int i = 0; i < operands.size(); ++i) {
@@ -3807,7 +3807,7 @@ void TIntermAggregate::updatePrecision()
void TIntermBinary::updatePrecision()
{
if (getBasicType() == EbtInt || getBasicType() == EbtUint ||
- getBasicType() == EbtFloat || getBasicType() == EbtFloat16) {
+ getBasicType() == EbtFloat) {
if (op == EOpRightShift || op == EOpLeftShift) {
// For shifts get precision from left side only and thus no need to propagate
getQualifier().precision = left->getQualifier().precision;
@@ -3902,7 +3902,7 @@ TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermC
case EbtFloat16: PROMOTE(setDConst, double, Get); break; \
case EbtFloat: PROMOTE(setDConst, double, Get); break; \
case EbtDouble: PROMOTE(setDConst, double, Get); break; \
- case EbtInt8: PROMOTE(setI8Const, char, Get); break; \
+ case EbtInt8: PROMOTE(setI8Const, signed char, Get); break; \
case EbtInt16: PROMOTE(setI16Const, short, Get); break; \
case EbtInt: PROMOTE(setIConst, int, Get); break; \
case EbtInt64: PROMOTE(setI64Const, long long, Get); break; \
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp
index 1da50d62f93..616580f993e 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseContextBase.cpp
@@ -74,6 +74,9 @@ void C_DECL TParseContextBase::error(const TSourceLoc& loc, const char* szReason
{
if (messages & EShMsgOnlyPreprocessor)
return;
+ // If enhanced msg readability, only print one error
+ if (messages & EShMsgEnhanced && numErrors > 0)
+ return;
va_list args;
va_start(args, szExtraInfoFormat);
outputMessage(loc, szReason, szToken, szExtraInfoFormat, EPrefixError, args);
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
index b2b187b4fd4..41afbc052ab 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp
@@ -502,6 +502,16 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb
error(loc, "cannot be used (maybe an instance name is needed)", string->c_str(), "");
variable = nullptr;
}
+
+ if (language == EShLangMesh && variable) {
+ TLayoutGeometry primitiveType = intermediate.getOutputPrimitive();
+ if ((variable->getMangledName() == "gl_PrimitiveTriangleIndicesEXT" && primitiveType != ElgTriangles) ||
+ (variable->getMangledName() == "gl_PrimitiveLineIndicesEXT" && primitiveType != ElgLines) ||
+ (variable->getMangledName() == "gl_PrimitivePointIndicesEXT" && primitiveType != ElgPoints)) {
+ error(loc, "cannot be used (ouput primitive type mismatch)", string->c_str(), "");
+ variable = nullptr;
+ }
+ }
} else {
if (symbol)
error(loc, "variable name expected", string->c_str(), "");
@@ -716,8 +726,8 @@ bool TParseContext::isIoResizeArray(const TType& type) const
(language == EShLangTessControl && type.getQualifier().storage == EvqVaryingOut &&
! type.getQualifier().patch) ||
(language == EShLangFragment && type.getQualifier().storage == EvqVaryingIn &&
- type.getQualifier().pervertexNV) ||
- (language == EShLangMeshNV && type.getQualifier().storage == EvqVaryingOut &&
+ (type.getQualifier().pervertexNV || type.getQualifier().pervertexEXT)) ||
+ (language == EShLangMesh && type.getQualifier().storage == EvqVaryingOut &&
!type.getQualifier().perTaskNV));
}
@@ -794,7 +804,7 @@ void TParseContext::checkIoArraysConsistency(const TSourceLoc &loc, bool tailOnl
// As I/O array sizes don't change, fetch requiredSize only once,
// except for mesh shaders which could have different I/O array sizes based on type qualifiers.
- if (firstIteration || (language == EShLangMeshNV)) {
+ if (firstIteration || (language == EShLangMesh)) {
requiredSize = getIoArrayImplicitSize(type.getQualifier(), &featureString);
if (requiredSize == 0)
break;
@@ -823,7 +833,7 @@ int TParseContext::getIoArrayImplicitSize(const TQualifier &qualifier, TString *
// Number of vertices for Fragment shader is always three.
expectedSize = 3;
str = "vertices";
- } else if (language == EShLangMeshNV) {
+ } else if (language == EShLangMesh) {
unsigned int maxPrimitives =
intermediate.getPrimitives() != TQualifier::layoutNotSet ? intermediate.getPrimitives() : 0;
if (qualifier.builtIn == EbvPrimitiveIndicesNV) {
@@ -831,6 +841,11 @@ int TParseContext::getIoArrayImplicitSize(const TQualifier &qualifier, TString *
str = "max_primitives*";
str += TQualifier::getGeometryString(intermediate.getOutputPrimitive());
}
+ else if (qualifier.builtIn == EbvPrimitiveTriangleIndicesEXT || qualifier.builtIn == EbvPrimitiveLineIndicesEXT ||
+ qualifier.builtIn == EbvPrimitivePointIndicesEXT) {
+ expectedSize = maxPrimitives;
+ str = "max_primitives";
+ }
else if (qualifier.isPerPrimitive()) {
expectedSize = maxPrimitives;
str = "max_primitives";
@@ -856,9 +871,9 @@ void TParseContext::checkIoArrayConsistency(const TSourceLoc& loc, int requiredS
error(loc, "inconsistent output number of vertices for array size of", feature, name.c_str());
else if (language == EShLangFragment) {
if (type.getOuterArraySize() > requiredSize)
- error(loc, " cannot be greater than 3 for pervertexNV", feature, name.c_str());
+ error(loc, " cannot be greater than 3 for pervertexEXT", feature, name.c_str());
}
- else if (language == EShLangMeshNV)
+ else if (language == EShLangMesh)
error(loc, "inconsistent output array size of", feature, name.c_str());
else
assert(0);
@@ -902,8 +917,10 @@ TIntermTyped* TParseContext::handleBinaryMath(const TSourceLoc& loc, const char*
result = intermediate.addBinaryMath(op, left, right, loc);
}
- if (result == nullptr)
- binaryOpError(loc, str, left->getCompleteString(), right->getCompleteString());
+ if (result == nullptr) {
+ bool enhanced = intermediate.getEnhancedMsgs();
+ binaryOpError(loc, str, left->getCompleteString(enhanced), right->getCompleteString(enhanced));
+ }
return result;
}
@@ -926,8 +943,10 @@ TIntermTyped* TParseContext::handleUnaryMath(const TSourceLoc& loc, const char*
if (result)
return result;
- else
- unaryOpError(loc, str, childNode->getCompleteString());
+ else {
+ bool enhanced = intermediate.getEnhancedMsgs();
+ unaryOpError(loc, str, childNode->getCompleteString(enhanced));
+ }
return childNode;
}
@@ -953,8 +972,8 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm
requireProfile(loc, ~EEsProfile, feature);
profileRequires(loc, ~EEsProfile, 420, E_GL_ARB_shading_language_420pack, feature);
} else if (!base->getType().isCoopMat()) {
- error(loc, "does not operate on this type:", field.c_str(), base->getType().getCompleteString().c_str());
-
+ bool enhanced = intermediate.getEnhancedMsgs();
+ error(loc, "does not operate on this type:", field.c_str(), base->getType().getCompleteString(enhanced).c_str());
return base;
}
@@ -1005,10 +1024,16 @@ TIntermTyped* TParseContext::handleDotDereference(const TSourceLoc& loc, TInterm
intermediate.addIoAccessed(field);
}
inheritMemoryQualifiers(base->getQualifier(), result->getWritableType().getQualifier());
- } else
- error(loc, "no such field in structure", field.c_str(), "");
+ } 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());
+ }
} else
- error(loc, "does not apply to this type:", field.c_str(), base->getType().getCompleteString().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())
@@ -1314,14 +1339,14 @@ TIntermTyped* TParseContext::handleFunctionCall(const TSourceLoc& loc, TFunction
//
result = addConstructor(loc, arguments, type);
if (result == nullptr)
- error(loc, "cannot construct with these arguments", type.getCompleteString().c_str(), "");
+ error(loc, "cannot construct with these arguments", type.getCompleteString(intermediate.getEnhancedMsgs()).c_str(), "");
}
} else {
//
// Find it in the symbol table.
//
const TFunction* fnCandidate;
- bool builtIn;
+ bool builtIn {false};
fnCandidate = findFunction(loc, *function, builtIn);
if (fnCandidate) {
// This is a declared function that might map to
@@ -1494,7 +1519,7 @@ TIntermTyped* TParseContext::handleBuiltInFunctionCall(TSourceLoc loc, TIntermNo
else
error(arguments->getLoc(), " wrong operand type", "Internal Error",
"built in unary operator function. Type: %s",
- static_cast<TIntermTyped*>(arguments)->getCompleteString().c_str());
+ static_cast<TIntermTyped*>(arguments)->getCompleteString(intermediate.getEnhancedMsgs()).c_str());
} else if (result->getAsOperator())
builtInOpCheck(loc, function, *result->getAsOperator());
@@ -1990,18 +2015,18 @@ void TParseContext::memorySemanticsCheck(const TSourceLoc& loc, const TFunction&
break;
}
- if ((semantics & gl_SemanticsAcquire) &&
+ if ((semantics & gl_SemanticsAcquire) &&
(callNode.getOp() == EOpAtomicStore || callNode.getOp() == EOpImageAtomicStore)) {
error(loc, "gl_SemanticsAcquire must not be used with (image) atomic store",
fnCandidate.getName().c_str(), "");
}
- if ((semantics & gl_SemanticsRelease) &&
+ if ((semantics & gl_SemanticsRelease) &&
(callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpImageAtomicLoad)) {
error(loc, "gl_SemanticsRelease must not be used with (image) atomic load",
fnCandidate.getName().c_str(), "");
}
- if ((semantics & gl_SemanticsAcquireRelease) &&
- (callNode.getOp() == EOpAtomicStore || callNode.getOp() == EOpImageAtomicStore ||
+ if ((semantics & gl_SemanticsAcquireRelease) &&
+ (callNode.getOp() == EOpAtomicStore || callNode.getOp() == EOpImageAtomicStore ||
callNode.getOp() == EOpAtomicLoad || callNode.getOp() == EOpImageAtomicLoad)) {
error(loc, "gl_SemanticsAcquireRelease must not be used with (image) atomic load/store",
fnCandidate.getName().c_str(), "");
@@ -2317,7 +2342,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
error(loc, "argument must be compile-time constant", "payload number", "a");
else {
unsigned int location = (*argp)[10]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
- if (intermediate.checkLocationRT(0, location) < 0)
+ if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(0, location) < 0)
error(loc, "with layout(location =", "no rayPayloadEXT/rayPayloadInEXT declared", "%d)", location);
}
break;
@@ -2330,7 +2355,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
error(loc, "argument must be compile-time constant", "callable data number", "");
else {
unsigned int location = (*argp)[1]->getAsConstantUnion()->getAsConstantUnion()->getConstArray()[0].getUConst();
- if (intermediate.checkLocationRT(1, location) < 0)
+ if (!extensionTurnedOn(E_GL_EXT_spirv_intrinsics) && intermediate.checkLocationRT(1, location) < 0)
error(loc, "with layout(location =", "no callableDataEXT/callableDataInEXT declared", "%d)", location);
}
break;
@@ -2452,7 +2477,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
const TIntermTyped* base = TIntermediate::findLValueBase(arg0, true , true);
const TType* refType = (base->getType().isReference()) ? base->getType().getReferentType() : nullptr;
const TQualifier& qualifier = (refType != nullptr) ? refType->getQualifier() : base->getType().getQualifier();
- if (qualifier.storage != EvqShared && qualifier.storage != EvqBuffer)
+ if (qualifier.storage != EvqShared && qualifier.storage != EvqBuffer && qualifier.storage != EvqtaskPayloadSharedEXT)
error(loc,"Atomic memory function can only be used for shader storage block member or shared variable.",
fnCandidate.getName().c_str(), "");
@@ -2495,6 +2520,8 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
case EOpEmitStreamVertex:
case EOpEndStreamPrimitive:
+ if (version == 150)
+ requireExtensions(loc, 1, &E_GL_ARB_gpu_shader5, "if the verison is 150 , the EmitStreamVertex and EndStreamPrimitive only support at extension GL_ARB_gpu_shader5");
intermediate.setMultiStream();
break;
@@ -2548,7 +2575,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
}
if (profile != EEsProfile && version < 450) {
- if ((*argp)[0]->getAsTyped()->getBasicType() != EbtFloat &&
+ if ((*argp)[0]->getAsTyped()->getBasicType() != EbtFloat &&
(*argp)[0]->getAsTyped()->getBasicType() != EbtDouble &&
(*argp)[1]->getAsTyped()->getBasicType() != EbtFloat &&
(*argp)[1]->getAsTyped()->getBasicType() != EbtDouble &&
@@ -2597,23 +2624,24 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
// Check that if extended types are being used that the correct extensions are enabled.
if (arg0 != nullptr) {
const TType& type = arg0->getType();
+ bool enhanced = intermediate.getEnhancedMsgs();
switch (type.getBasicType()) {
default:
break;
case EbtInt8:
case EbtUint8:
- requireExtensions(loc, 1, &E_GL_EXT_shader_subgroup_extended_types_int8, type.getCompleteString().c_str());
+ requireExtensions(loc, 1, &E_GL_EXT_shader_subgroup_extended_types_int8, type.getCompleteString(enhanced).c_str());
break;
case EbtInt16:
case EbtUint16:
- requireExtensions(loc, 1, &E_GL_EXT_shader_subgroup_extended_types_int16, type.getCompleteString().c_str());
+ requireExtensions(loc, 1, &E_GL_EXT_shader_subgroup_extended_types_int16, type.getCompleteString(enhanced).c_str());
break;
case EbtInt64:
case EbtUint64:
- requireExtensions(loc, 1, &E_GL_EXT_shader_subgroup_extended_types_int64, type.getCompleteString().c_str());
+ requireExtensions(loc, 1, &E_GL_EXT_shader_subgroup_extended_types_int64, type.getCompleteString(enhanced).c_str());
break;
case EbtFloat16:
- requireExtensions(loc, 1, &E_GL_EXT_shader_subgroup_extended_types_float16, type.getCompleteString().c_str());
+ requireExtensions(loc, 1, &E_GL_EXT_shader_subgroup_extended_types_float16, type.getCompleteString(enhanced).c_str());
break;
}
}
@@ -2786,7 +2814,10 @@ TFunction* TParseContext::handleConstructorCall(const TSourceLoc& loc, const TPu
TOperator op = intermediate.mapTypeToConstructorOp(type);
if (op == EOpNull) {
- error(loc, "cannot construct this type", type.getBasicString(), "");
+ if (intermediate.getEnhancedMsgs() && type.getBasicType() == EbtSampler)
+ error(loc, "function not supported in this version; use texture() instead", "texture*D*", "");
+ else
+ error(loc, "cannot construct this type", type.getBasicString(), "");
op = EOpConstructFloat;
TType errorType(EbtFloat);
type.shallowCopy(errorType);
@@ -2972,7 +3003,17 @@ bool TParseContext::lValueErrorCheck(const TSourceLoc& loc, const char* op, TInt
if (isEsProfile() && intermediate.getEarlyFragmentTests())
message = "can't modify gl_FragDepth if using early_fragment_tests";
break;
+ case EvqFragStencil:
+ intermediate.setStencilReplacing();
+ // "In addition, it is an error to statically write to gl_FragDepth in the fragment shader."
+ if (isEsProfile() && intermediate.getEarlyFragmentTests())
+ message = "can't modify EvqFragStencil if using early_fragment_tests";
+ break;
+ case EvqtaskPayloadSharedEXT:
+ if (language == EShLangMesh)
+ message = "can't modify variable with storage qualifier taskPayloadSharedEXT in mesh shaders";
+ break;
default:
break;
}
@@ -3011,7 +3052,7 @@ void TParseContext::rValueErrorCheck(const TSourceLoc& loc, const char* op, TInt
if (symNode && symNode->getQualifier().isExplicitInterpolation())
error(loc, "can't read from explicitly-interpolated object: ", op, symNode->getName().c_str());
- // local_size_{xyz} must be assigned or specialized before gl_WorkGroupSize can be assigned.
+ // local_size_{xyz} must be assigned or specialized before gl_WorkGroupSize can be assigned.
if(node->getQualifier().builtIn == EbvWorkGroupSize &&
!(intermediate.isLocalSizeSet() || intermediate.isLocalSizeSpecialized()))
error(loc, "can't read from gl_WorkGroupSize before a fixed workgroup size has been declared", op, "");
@@ -3029,11 +3070,14 @@ void TParseContext::constantValueCheck(TIntermTyped* node, const char* token)
//
// Both test, and if necessary spit out an error, to see if the node is really
-// an integer.
+// a 32-bit integer or can implicitly convert to one.
//
void TParseContext::integerCheck(const TIntermTyped* node, const char* token)
{
- if ((node->getBasicType() == EbtInt || node->getBasicType() == EbtUint) && node->isScalar())
+ auto from_type = node->getBasicType();
+ if ((from_type == EbtInt || from_type == EbtUint ||
+ intermediate.canImplicitlyPromote(from_type, EbtInt, EOpNull) ||
+ intermediate.canImplicitlyPromote(from_type, EbtUint, EOpNull)) && node->isScalar())
return;
error(node->getLoc(), "scalar integer expression required", token, "");
@@ -3193,6 +3237,12 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
break;
}
+ TString constructorString;
+ if (intermediate.getEnhancedMsgs())
+ constructorString.append(type.getCompleteString(true, false, false, true)).append(" constructor");
+ else
+ constructorString.append("constructor");
+
// See if it's a matrix
bool constructingMatrix = false;
switch (op) {
@@ -3250,7 +3300,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
if (function[arg].type->isArray()) {
if (function[arg].type->isUnsizedArray()) {
// Can't construct from an unsized array.
- error(loc, "array argument must be sized", "constructor", "");
+ error(loc, "array argument must be sized", constructorString.c_str(), "");
return true;
}
arrayArg = true;
@@ -3280,13 +3330,13 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
intArgument = true;
if (type.isStruct()) {
if (function[arg].type->contains16BitFloat()) {
- requireFloat16Arithmetic(loc, "constructor", "can't construct structure containing 16-bit type");
+ requireFloat16Arithmetic(loc, constructorString.c_str(), "can't construct structure containing 16-bit type");
}
if (function[arg].type->contains16BitInt()) {
- requireInt16Arithmetic(loc, "constructor", "can't construct structure containing 16-bit type");
+ requireInt16Arithmetic(loc, constructorString.c_str(), "can't construct structure containing 16-bit type");
}
if (function[arg].type->contains8BitInt()) {
- requireInt8Arithmetic(loc, "constructor", "can't construct structure containing 8-bit type");
+ requireInt8Arithmetic(loc, constructorString.c_str(), "can't construct structure containing 8-bit type");
}
}
}
@@ -3300,9 +3350,9 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
case EOpConstructF16Vec3:
case EOpConstructF16Vec4:
if (type.isArray())
- requireFloat16Arithmetic(loc, "constructor", "16-bit arrays not supported");
+ requireFloat16Arithmetic(loc, constructorString.c_str(), "16-bit arrays not supported");
if (type.isVector() && function.getParamCount() != 1)
- requireFloat16Arithmetic(loc, "constructor", "16-bit vectors only take vector types");
+ requireFloat16Arithmetic(loc, constructorString.c_str(), "16-bit vectors only take vector types");
break;
case EOpConstructUint16:
case EOpConstructU16Vec2:
@@ -3313,9 +3363,9 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
case EOpConstructI16Vec3:
case EOpConstructI16Vec4:
if (type.isArray())
- requireInt16Arithmetic(loc, "constructor", "16-bit arrays not supported");
+ requireInt16Arithmetic(loc, constructorString.c_str(), "16-bit arrays not supported");
if (type.isVector() && function.getParamCount() != 1)
- requireInt16Arithmetic(loc, "constructor", "16-bit vectors only take vector types");
+ requireInt16Arithmetic(loc, constructorString.c_str(), "16-bit vectors only take vector types");
break;
case EOpConstructUint8:
case EOpConstructU8Vec2:
@@ -3326,9 +3376,9 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
case EOpConstructI8Vec3:
case EOpConstructI8Vec4:
if (type.isArray())
- requireInt8Arithmetic(loc, "constructor", "8-bit arrays not supported");
+ requireInt8Arithmetic(loc, constructorString.c_str(), "8-bit arrays not supported");
if (type.isVector() && function.getParamCount() != 1)
- requireInt8Arithmetic(loc, "constructor", "8-bit vectors only take vector types");
+ requireInt8Arithmetic(loc, constructorString.c_str(), "8-bit vectors only take vector types");
break;
default:
break;
@@ -3410,7 +3460,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
if (type.isArray()) {
if (function.getParamCount() == 0) {
- error(loc, "array constructor must have at least one argument", "constructor", "");
+ error(loc, "array constructor must have at least one argument", constructorString.c_str(), "");
return true;
}
@@ -3418,7 +3468,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
// auto adapt the constructor type to the number of arguments
type.changeOuterArraySize(function.getParamCount());
} else if (type.getOuterArraySize() != function.getParamCount()) {
- error(loc, "array constructor needs one argument per array element", "constructor", "");
+ error(loc, "array constructor needs one argument per array element", constructorString.c_str(), "");
return true;
}
@@ -3431,7 +3481,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
// At least the dimensionalities have to match.
if (! function[0].type->isArray() ||
arraySizes.getNumDims() != function[0].type->getArraySizes()->getNumDims() + 1) {
- error(loc, "array constructor argument not correct type to construct array element", "constructor", "");
+ error(loc, "array constructor argument not correct type to construct array element", constructorString.c_str(), "");
return true;
}
@@ -3448,7 +3498,7 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
}
if (arrayArg && op != EOpConstructStruct && ! type.isArrayOfArrays()) {
- error(loc, "constructing non-array constituent from array argument", "constructor", "");
+ error(loc, "constructing non-array constituent from array argument", constructorString.c_str(), "");
return true;
}
@@ -3458,51 +3508,51 @@ bool TParseContext::constructorError(const TSourceLoc& loc, TIntermNode* node, T
// "If a matrix argument is given to a matrix constructor,
// it is a compile-time error to have any other arguments."
if (function.getParamCount() != 1)
- error(loc, "matrix constructed from matrix can only have one argument", "constructor", "");
+ error(loc, "matrix constructed from matrix can only have one argument", constructorString.c_str(), "");
return false;
}
if (overFull) {
- error(loc, "too many arguments", "constructor", "");
+ error(loc, "too many arguments", constructorString.c_str(), "");
return true;
}
if (op == EOpConstructStruct && ! type.isArray() && (int)type.getStruct()->size() != function.getParamCount()) {
- error(loc, "Number of constructor parameters does not match the number of structure fields", "constructor", "");
+ error(loc, "Number of constructor parameters does not match the number of structure fields", constructorString.c_str(), "");
return true;
}
if ((op != EOpConstructStruct && size != 1 && size < type.computeNumComponents()) ||
(op == EOpConstructStruct && size < type.computeNumComponents())) {
- error(loc, "not enough data provided for construction", "constructor", "");
+ error(loc, "not enough data provided for construction", constructorString.c_str(), "");
return true;
}
if (type.isCoopMat() && function.getParamCount() != 1) {
- error(loc, "wrong number of arguments", "constructor", "");
+ error(loc, "wrong number of arguments", constructorString.c_str(), "");
return true;
}
if (type.isCoopMat() &&
!(function[0].type->isScalar() || function[0].type->isCoopMat())) {
- error(loc, "Cooperative matrix constructor argument must be scalar or cooperative matrix", "constructor", "");
+ error(loc, "Cooperative matrix constructor argument must be scalar or cooperative matrix", constructorString.c_str(), "");
return true;
}
TIntermTyped* typed = node->getAsTyped();
if (typed == nullptr) {
- error(loc, "constructor argument does not have a type", "constructor", "");
+ error(loc, "constructor argument does not have a type", constructorString.c_str(), "");
return true;
}
if (op != EOpConstructStruct && op != EOpConstructNonuniform && typed->getBasicType() == EbtSampler) {
- error(loc, "cannot convert a sampler", "constructor", "");
+ error(loc, "cannot convert a sampler", constructorString.c_str(), "");
return true;
}
if (op != EOpConstructStruct && typed->isAtomic()) {
- error(loc, "cannot convert an atomic_uint", "constructor", "");
+ error(loc, "cannot convert an atomic_uint", constructorString.c_str(), "");
return true;
}
if (typed->getBasicType() == EbtVoid) {
- error(loc, "cannot convert a void", "constructor", "");
+ error(loc, "cannot convert a void", constructorString.c_str(), "");
return true;
}
@@ -3781,7 +3831,7 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
if (isTypeInt(publicType.basicType) || publicType.basicType == EbtDouble)
profileRequires(loc, EEsProfile, 300, nullptr, "shader input/output");
- if (!qualifier.flat && !qualifier.isExplicitInterpolation() && !qualifier.isPervertexNV()) {
+ if (!qualifier.flat && !qualifier.isExplicitInterpolation() && !qualifier.isPervertexNV() && !qualifier.isPervertexEXT()) {
if (isTypeInt(publicType.basicType) ||
publicType.basicType == EbtDouble ||
(publicType.userDef && ( publicType.userDef->containsBasicType(EbtInt)
@@ -3800,6 +3850,9 @@ void TParseContext::globalQualifierTypeCheck(const TSourceLoc& loc, const TQuali
if (qualifier.isPatch() && qualifier.isInterpolation())
error(loc, "cannot use interpolation qualifiers with patch", "patch", "");
+ if (qualifier.isTaskPayload() && publicType.basicType == EbtBlock)
+ error(loc, "taskPayloadSharedEXT variables should not be declared as interface blocks", "taskPayloadSharedEXT", "");
+
if (qualifier.isTaskMemory() && publicType.basicType != EbtBlock)
error(loc, "taskNV variables can be declared only as blocks", "taskNV", "");
@@ -3957,7 +4010,7 @@ void TParseContext::mergeQualifiers(const TSourceLoc& loc, TQualifier& dst, cons
(src.workgroupcoherent && (dst.coherent || dst.devicecoherent || dst.queuefamilycoherent || dst.subgroupcoherent || dst.shadercallcoherent)) ||
(src.subgroupcoherent && (dst.coherent || dst.devicecoherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.shadercallcoherent)) ||
(src.shadercallcoherent && (dst.coherent || dst.devicecoherent || dst.queuefamilycoherent || dst.workgroupcoherent || dst.subgroupcoherent)))) {
- error(loc, "only one coherent/devicecoherent/queuefamilycoherent/workgroupcoherent/subgroupcoherent/shadercallcoherent qualifier allowed",
+ error(loc, "only one coherent/devicecoherent/queuefamilycoherent/workgroupcoherent/subgroupcoherent/shadercallcoherent qualifier allowed",
GetPrecisionQualifierString(src.precision), "");
}
#endif
@@ -4315,10 +4368,10 @@ void TParseContext::arraySizesCheck(const TSourceLoc& loc, const TQualifier& qua
extensionsTurnedOn(Num_AEP_tessellation_shader, AEP_tessellation_shader))
return;
break;
- case EShLangMeshNV:
+ case EShLangMesh:
if (qualifier.storage == EvqVaryingOut)
if ((isEsProfile() && version >= 320) ||
- extensionTurnedOn(E_GL_NV_mesh_shader))
+ extensionsTurnedOn(Num_AEP_mesh_shader, AEP_mesh_shader))
return;
break;
default:
@@ -4586,7 +4639,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
if (ssoPre150 ||
(identifier == "gl_FragDepth" && ((nonEsRedecls && version >= 420) || esRedecls)) ||
- (identifier == "gl_FragCoord" && ((nonEsRedecls && version >= 150) || esRedecls)) ||
+ (identifier == "gl_FragCoord" && ((nonEsRedecls && version >= 140) || esRedecls)) ||
identifier == "gl_ClipDistance" ||
identifier == "gl_CullDistance" ||
identifier == "gl_ShadingRateEXT" ||
@@ -4602,6 +4655,9 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
identifier == "gl_SampleMask" ||
identifier == "gl_Layer" ||
identifier == "gl_PrimitiveIndicesNV" ||
+ identifier == "gl_PrimitivePointIndicesEXT" ||
+ identifier == "gl_PrimitiveLineIndicesEXT" ||
+ identifier == "gl_PrimitiveTriangleIndicesEXT" ||
identifier == "gl_TexCoord") {
// Find the existing symbol, if any.
@@ -4655,7 +4711,7 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
symbolQualifier.storage != qualifier.storage)
error(loc, "cannot change qualification of", "redeclaration", symbol->getName().c_str());
} else if (identifier == "gl_FragCoord") {
- if (intermediate.inIoAccessed("gl_FragCoord"))
+ if (!intermediate.getTexCoordRedeclared() && intermediate.inIoAccessed("gl_FragCoord"))
error(loc, "cannot redeclare after use", "gl_FragCoord", "");
if (qualifier.nopersp != symbolQualifier.nopersp || qualifier.flat != symbolQualifier.flat ||
qualifier.isMemory() || qualifier.isAuxiliary())
@@ -4665,6 +4721,9 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
if (! builtIn && (publicType.pixelCenterInteger != intermediate.getPixelCenterInteger() ||
publicType.originUpperLeft != intermediate.getOriginUpperLeft()))
error(loc, "cannot redeclare with different qualification:", "redeclaration", symbol->getName().c_str());
+
+
+ intermediate.setTexCoordRedeclared();
if (publicType.pixelCenterInteger)
intermediate.setPixelCenterInteger();
if (publicType.originUpperLeft)
@@ -4681,10 +4740,22 @@ TSymbol* TParseContext::redeclareBuiltinVariable(const TSourceLoc& loc, const TS
if (! intermediate.setDepth(publicType.layoutDepth))
error(loc, "all redeclarations must use the same depth layout on", "redeclaration", symbol->getName().c_str());
}
+ } else if (identifier == "gl_FragStencilRefARB") {
+ if (qualifier.nopersp != symbolQualifier.nopersp || qualifier.flat != symbolQualifier.flat ||
+ qualifier.isMemory() || qualifier.isAuxiliary())
+ error(loc, "can only change layout qualification of", "redeclaration", symbol->getName().c_str());
+ if (qualifier.storage != EvqVaryingOut)
+ error(loc, "cannot change output storage qualification of", "redeclaration", symbol->getName().c_str());
+ if (publicType.layoutStencil != ElsNone) {
+ if (intermediate.inIoAccessed("gl_FragStencilRefARB"))
+ error(loc, "cannot redeclare after use", "gl_FragStencilRefARB", "");
+ if (!intermediate.setStencil(publicType.layoutStencil))
+ error(loc, "all redeclarations must use the same stencil layout on", "redeclaration",
+ symbol->getName().c_str());
+ }
}
else if (
- identifier == "gl_PrimitiveIndicesNV" ||
- identifier == "gl_FragStencilRefARB") {
+ identifier == "gl_PrimitiveIndicesNV") {
if (qualifier.hasLayout())
error(loc, "cannot apply layout qualifier to", "redeclaration", symbol->getName().c_str());
if (qualifier.storage != EvqVaryingOut)
@@ -4725,7 +4796,8 @@ void TParseContext::redeclareBuiltinBlock(const TSourceLoc& loc, TTypeList& newT
profileRequires(loc, ~EEsProfile, 410, E_GL_ARB_separate_shader_objects, feature);
if (blockName != "gl_PerVertex" && blockName != "gl_PerFragment" &&
- blockName != "gl_MeshPerVertexNV" && blockName != "gl_MeshPerPrimitiveNV") {
+ blockName != "gl_MeshPerVertexNV" && blockName != "gl_MeshPerPrimitiveNV" &&
+ blockName != "gl_MeshPerVertexEXT" && blockName != "gl_MeshPerPrimitiveEXT") {
error(loc, "cannot redeclare block: ", "block declaration", blockName.c_str());
return;
}
@@ -5294,11 +5366,11 @@ void TParseContext::finish()
if (!isEsProfile() && version < 430)
requireExtensions(getCurrentLoc(), 1, &E_GL_ARB_compute_shader, "compute shaders");
break;
- case EShLangTaskNV:
- requireExtensions(getCurrentLoc(), 1, &E_GL_NV_mesh_shader, "task shaders");
+ case EShLangTask:
+ requireExtensions(getCurrentLoc(), Num_AEP_mesh_shader, AEP_mesh_shader, "task shaders");
break;
- case EShLangMeshNV:
- requireExtensions(getCurrentLoc(), 1, &E_GL_NV_mesh_shader, "mesh shaders");
+ case EShLangMesh:
+ requireExtensions(getCurrentLoc(), Num_AEP_mesh_shader, AEP_mesh_shader, "mesh shaders");
break;
default:
break;
@@ -5408,12 +5480,12 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
intermediate.setUsePhysicalStorageBuffer();
return;
}
- if (language == EShLangGeometry || language == EShLangTessEvaluation || language == EShLangMeshNV) {
+ if (language == EShLangGeometry || language == EShLangTessEvaluation || language == EShLangMesh) {
if (id == TQualifier::getGeometryString(ElgTriangles)) {
publicType.shaderQualifiers.geometry = ElgTriangles;
return;
}
- if (language == EShLangGeometry || language == EShLangMeshNV) {
+ if (language == EShLangGeometry || language == EShLangMesh) {
if (id == TQualifier::getGeometryString(ElgPoints)) {
publicType.shaderQualifiers.geometry = ElgPoints;
return;
@@ -5496,12 +5568,19 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
}
if (language == EShLangFragment) {
if (id == "origin_upper_left") {
- requireProfile(loc, ECoreProfile | ECompatibilityProfile, "origin_upper_left");
+ requireProfile(loc, ECoreProfile | ECompatibilityProfile | ENoProfile, "origin_upper_left");
+ if (profile == ENoProfile) {
+ profileRequires(loc,ECoreProfile | ECompatibilityProfile, 140, E_GL_ARB_fragment_coord_conventions, "origin_upper_left");
+ }
+
publicType.shaderQualifiers.originUpperLeft = true;
return;
}
if (id == "pixel_center_integer") {
- requireProfile(loc, ECoreProfile | ECompatibilityProfile, "pixel_center_integer");
+ requireProfile(loc, ECoreProfile | ECompatibilityProfile | ENoProfile, "pixel_center_integer");
+ if (profile == ENoProfile) {
+ profileRequires(loc,ECoreProfile | ECompatibilityProfile, 140, E_GL_ARB_fragment_coord_conventions, "pixel_center_integer");
+ }
publicType.shaderQualifiers.pixelCenterInteger = true;
return;
}
@@ -5511,6 +5590,12 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
publicType.shaderQualifiers.earlyFragmentTests = true;
return;
}
+ if (id == "early_and_late_fragment_tests_amd") {
+ profileRequires(loc, ENoProfile | ECoreProfile | ECompatibilityProfile, 420, E_GL_AMD_shader_early_and_late_fragment_tests, "early_and_late_fragment_tests_amd");
+ profileRequires(loc, EEsProfile, 310, nullptr, "early_and_late_fragment_tests_amd");
+ publicType.shaderQualifiers.earlyAndLateFragmentTestsAMD = true;
+ return;
+ }
if (id == "post_depth_coverage") {
requireExtensions(loc, Num_post_depth_coverageEXTs, post_depth_coverageEXTs, "post depth coverage");
if (extensionTurnedOn(E_GL_ARB_post_depth_coverage)) {
@@ -5527,6 +5612,14 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
return;
}
}
+ for (TLayoutStencil stencil = (TLayoutStencil)(ElsNone + 1); stencil < ElsCount; stencil = (TLayoutStencil)(stencil+1)) {
+ if (id == TQualifier::getLayoutStencilString(stencil)) {
+ requireProfile(loc, ECoreProfile | ECompatibilityProfile, "stencil layout qualifier");
+ profileRequires(loc, ECoreProfile | ECompatibilityProfile, 420, nullptr, "stencil layout qualifier");
+ publicType.shaderQualifiers.layoutStencil = stencil;
+ return;
+ }
+ }
for (TInterlockOrdering order = (TInterlockOrdering)(EioNone + 1); order < EioCount; order = (TInterlockOrdering)(order+1)) {
if (id == TQualifier::getInterlockOrderingString(order)) {
requireProfile(loc, ECoreProfile | ECompatibilityProfile, "fragment shader interlock layout qualifier");
@@ -5670,7 +5763,7 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
return;
} else if (id == "location") {
profileRequires(loc, EEsProfile, 300, nullptr, "location");
- const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location };
+ const char* exts[2] = { E_GL_ARB_separate_shader_objects, E_GL_ARB_explicit_attrib_location };
// GL_ARB_explicit_uniform_location requires 330 or GL_ARB_explicit_attrib_location we do not need to add it here
profileRequires(loc, ~EEsProfile, 330, 2, exts, "location");
if ((unsigned int)value >= TQualifier::layoutLocationEnd)
@@ -5880,35 +5973,47 @@ void TParseContext::setLayoutQualifier(const TSourceLoc& loc, TPublicType& publi
}
break;
- case EShLangMeshNV:
+ case EShLangMesh:
if (id == "max_vertices") {
- requireExtensions(loc, 1, &E_GL_NV_mesh_shader, "max_vertices");
+ requireExtensions(loc, Num_AEP_mesh_shader, AEP_mesh_shader, "max_vertices");
publicType.shaderQualifiers.vertices = value;
- if (value > resources.maxMeshOutputVerticesNV)
- error(loc, "too large, must be less than gl_MaxMeshOutputVerticesNV", "max_vertices", "");
+ int max = extensionTurnedOn(E_GL_EXT_mesh_shader) ? resources.maxMeshOutputVerticesEXT
+ : resources.maxMeshOutputVerticesNV;
+ if (value > max) {
+ TString maxsErrtring = "too large, must be less than ";
+ maxsErrtring.append(extensionTurnedOn(E_GL_EXT_mesh_shader) ? "gl_MaxMeshOutputVerticesEXT"
+ : "gl_MaxMeshOutputVerticesNV");
+ error(loc, maxsErrtring.c_str(), "max_vertices", "");
+ }
if (nonLiteral)
error(loc, "needs a literal integer", "max_vertices", "");
return;
}
if (id == "max_primitives") {
- requireExtensions(loc, 1, &E_GL_NV_mesh_shader, "max_primitives");
+ requireExtensions(loc, Num_AEP_mesh_shader, AEP_mesh_shader, "max_primitives");
publicType.shaderQualifiers.primitives = value;
- if (value > resources.maxMeshOutputPrimitivesNV)
- error(loc, "too large, must be less than gl_MaxMeshOutputPrimitivesNV", "max_primitives", "");
+ int max = extensionTurnedOn(E_GL_EXT_mesh_shader) ? resources.maxMeshOutputPrimitivesEXT
+ : resources.maxMeshOutputPrimitivesNV;
+ if (value > max) {
+ TString maxsErrtring = "too large, must be less than ";
+ maxsErrtring.append(extensionTurnedOn(E_GL_EXT_mesh_shader) ? "gl_MaxMeshOutputPrimitivesEXT"
+ : "gl_MaxMeshOutputPrimitivesNV");
+ error(loc, maxsErrtring.c_str(), "max_primitives", "");
+ }
if (nonLiteral)
error(loc, "needs a literal integer", "max_primitives", "");
return;
}
// Fall through
- case EShLangTaskNV:
+ case EShLangTask:
// Fall through
#endif
case EShLangCompute:
if (id.compare(0, 11, "local_size_") == 0) {
#ifndef GLSLANG_WEB
- if (language == EShLangMeshNV || language == EShLangTaskNV) {
- requireExtensions(loc, 1, &E_GL_NV_mesh_shader, "gl_WorkGroupSize");
+ 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, 430, E_GL_ARB_compute_shader, "gl_WorkGroupSize");
@@ -6034,6 +6139,8 @@ void TParseContext::mergeObjectLayoutQualifiers(TQualifier& dst, const TQualifie
dst.layoutShaderRecord = true;
if (src.pervertexNV)
dst.pervertexNV = true;
+ if (src.pervertexEXT)
+ dst.pervertexEXT = true;
#endif
}
}
@@ -6182,6 +6289,9 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
if (type.getBasicType() == EbtBlock)
error(loc, "cannot apply to uniform or buffer block", "location", "");
break;
+ case EvqtaskPayloadSharedEXT:
+ error(loc, "cannot apply to taskPayloadSharedEXT", "location", "");
+ break;
#ifndef GLSLANG_WEB
case EvqPayload:
case EvqPayloadIn:
@@ -6207,11 +6317,13 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
#ifndef GLSLANG_WEB
if (qualifier.hasXfbOffset() && qualifier.hasXfbBuffer()) {
- int repeated = intermediate.addXfbBufferOffset(type);
- if (repeated >= 0)
- error(loc, "overlapping offsets at", "xfb_offset", "offset %d in buffer %d", repeated, qualifier.layoutXfbBuffer);
- if (type.isUnsizedArray())
+ if (type.isUnsizedArray()) {
error(loc, "unsized array", "xfb_offset", "in buffer %d", qualifier.layoutXfbBuffer);
+ } else {
+ int repeated = intermediate.addXfbBufferOffset(type);
+ if (repeated >= 0)
+ error(loc, "overlapping offsets at", "xfb_offset", "offset %d in buffer %d", repeated, qualifier.layoutXfbBuffer);
+ }
// "The offset must be a multiple of the size of the first component of the first
// qualified variable or block member, or a compile-time error results. Further, if applied to an aggregate
@@ -6331,8 +6443,12 @@ void TParseContext::layoutTypeCheck(const TSourceLoc& loc, const TType& type)
profileRequires(loc, ECoreProfile | ECompatibilityProfile, 0, E_GL_EXT_shader_image_load_formatted, explanation);
}
- if (qualifier.isPushConstant() && type.getBasicType() != EbtBlock)
- error(loc, "can only be used with a block", "push_constant", "");
+ if (qualifier.isPushConstant()) {
+ if (type.getBasicType() != EbtBlock)
+ error(loc, "can only be used with a block", "push_constant", "");
+ if (type.isArray())
+ error(loc, "Push constants blocks can't be an array", "push_constant", "");
+ }
if (qualifier.hasBufferReference() && type.getBasicType() != EbtBlock)
error(loc, "can only be used with a block", "buffer_reference", "");
@@ -6493,6 +6609,8 @@ void TParseContext::layoutQualifierCheck(const TSourceLoc& loc, const TQualifier
error(loc, "can only be used with a uniform", "push_constant", "");
if (qualifier.hasSet())
error(loc, "cannot be used with push_constant", "set", "");
+ if (qualifier.hasBinding())
+ error(loc, "cannot be used with push_constant", "binding", "");
}
if (qualifier.hasBufferReference()) {
if (qualifier.storage != EvqBuffer)
@@ -6535,7 +6653,7 @@ void TParseContext::checkNoShaderLayouts(const TSourceLoc& loc, const TShaderQua
error(loc, message, "local_size id", "");
}
if (shaderQualifiers.vertices != TQualifier::layoutNotSet) {
- if (language == EShLangGeometry || language == EShLangMeshNV)
+ if (language == EShLangGeometry || language == EShLangMesh)
error(loc, message, "max_vertices", "");
else if (language == EShLangTessControl)
error(loc, message, "vertices", "");
@@ -6547,7 +6665,7 @@ void TParseContext::checkNoShaderLayouts(const TSourceLoc& loc, const TShaderQua
if (shaderQualifiers.postDepthCoverage)
error(loc, message, "post_depth_coverage", "");
if (shaderQualifiers.primitives != TQualifier::layoutNotSet) {
- if (language == EShLangMeshNV)
+ if (language == EShLangMesh)
error(loc, message, "max_primitives", "");
else
assert(0);
@@ -6647,8 +6765,10 @@ const TFunction* TParseContext::findFunction(const TSourceLoc& loc, const TFunct
: findFunctionExact(loc, call, builtIn));
else if (version < 120)
function = findFunctionExact(loc, call, builtIn);
- else if (version < 400)
- function = extensionTurnedOn(E_GL_ARB_gpu_shader_fp64) ? findFunction400(loc, call, builtIn) : findFunction120(loc, call, builtIn);
+ else if (version < 400) {
+ bool needfindFunction400 = extensionTurnedOn(E_GL_ARB_gpu_shader_fp64) || extensionTurnedOn(E_GL_ARB_gpu_shader5);
+ function = needfindFunction400 ? findFunction400(loc, call, builtIn) : findFunction120(loc, call, builtIn);
+ }
else if (explicitTypesEnabled)
function = findFunctionExplicitTypes(loc, call, builtIn);
else
@@ -6956,12 +7076,14 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T
TFunction realFunc(&name, function->getType());
+ // Use copyParam to avoid shared ownership of the 'type' field
+ // of the parameter.
for (int i = 0; i < function->getParamCount(); ++i) {
- realFunc.addParameter((*function)[i]);
+ realFunc.addParameter(TParameter().copyParam((*function)[i]));
}
TParameter tmpP = { 0, &uintType };
- realFunc.addParameter(tmpP);
+ realFunc.addParameter(TParameter().copyParam(tmpP));
arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(1, loc, true));
result = handleFunctionCall(loc, &realFunc, arguments);
@@ -6974,11 +7096,11 @@ TIntermTyped* TParseContext::vkRelaxedRemapFunctionCall(const TSourceLoc& loc, T
TFunction realFunc(&name, function->getType());
for (int i = 0; i < function->getParamCount(); ++i) {
- realFunc.addParameter((*function)[i]);
+ realFunc.addParameter(TParameter().copyParam((*function)[i]));
}
TParameter tmpP = { 0, &uintType };
- realFunc.addParameter(tmpP);
+ realFunc.addParameter(TParameter().copyParam(tmpP));
arguments = intermediate.growAggregate(arguments, intermediate.addConstantUnion(-1, loc, true));
result = handleFunctionCall(loc, &realFunc, arguments);
@@ -7189,6 +7311,8 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden
requireInt8Arithmetic(loc, "qualifier", "(u)int8 types can only be in uniform block or buffer storage");
}
+ if (type.getQualifier().storage == EvqtaskPayloadSharedEXT)
+ intermediate.addTaskPayloadEXTCount();
if (type.getQualifier().storage == EvqShared && type.containsCoopMat())
error(loc, "qualifier", "Cooperative matrix types must not be used in shared memory", "");
@@ -7212,6 +7336,8 @@ TIntermNode* TParseContext::declareVariable(const TSourceLoc& loc, TString& iden
error(loc, "can only apply origin_upper_left and pixel_center_origin to gl_FragCoord", "layout qualifier", "");
if (identifier != "gl_FragDepth" && publicType.shaderQualifiers.getDepth() != EldNone)
error(loc, "can only apply depth layout to gl_FragDepth", "layout qualifier", "");
+ if (identifier != "gl_FragStencilRefARB" && publicType.shaderQualifiers.getStencil() != ElsNone)
+ error(loc, "can only apply depth layout to gl_FragStencilRefARB", "layout qualifier", "");
// Check for redeclaration of built-ins and/or attempting to declare a reserved name
TSymbol* symbol = redeclareBuiltinVariable(loc, identifier, type.getQualifier(), publicType.shaderQualifiers);
@@ -7419,14 +7545,14 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp
// Uniforms require a compile-time constant initializer
if (qualifier == EvqUniform && ! initializer->getType().getQualifier().isFrontEndConstant()) {
error(loc, "uniform initializers must be constant", "=", "'%s'",
- variable->getType().getCompleteString().c_str());
+ variable->getType().getCompleteString(intermediate.getEnhancedMsgs()).c_str());
variable->getWritableType().getQualifier().makeTemporary();
return nullptr;
}
// Global consts require a constant initializer (specialization constant is okay)
if (qualifier == EvqConst && symbolTable.atGlobalLevel() && ! initializer->getType().getQualifier().isConstant()) {
error(loc, "global const initializers must be constant", "=", "'%s'",
- variable->getType().getCompleteString().c_str());
+ variable->getType().getCompleteString(intermediate.getEnhancedMsgs()).c_str());
variable->getWritableType().getQualifier().makeTemporary();
return nullptr;
}
@@ -7489,7 +7615,7 @@ TIntermNode* TParseContext::executeInitializer(const TSourceLoc& loc, TIntermTyp
TIntermSymbol* intermSymbol = intermediate.addSymbol(*variable, loc);
TIntermTyped* initNode = intermediate.addAssign(EOpAssign, intermSymbol, initializer, loc);
if (! initNode)
- assignError(loc, "=", intermSymbol->getCompleteString(), initializer->getCompleteString());
+ assignError(loc, "=", intermSymbol->getCompleteString(intermediate.getEnhancedMsgs()), initializer->getCompleteString(intermediate.getEnhancedMsgs()));
return initNode;
}
@@ -7560,7 +7686,7 @@ TIntermTyped* TParseContext::convertInitializerList(const TSourceLoc& loc, const
}
} else if (type.isMatrix()) {
if (type.getMatrixCols() != (int)initList->getSequence().size()) {
- error(loc, "wrong number of matrix columns:", "initializer list", type.getCompleteString().c_str());
+ error(loc, "wrong number of matrix columns:", "initializer list", type.getCompleteString(intermediate.getEnhancedMsgs()).c_str());
return nullptr;
}
TType vectorType(type, 0); // dereferenced type
@@ -7571,20 +7697,20 @@ TIntermTyped* TParseContext::convertInitializerList(const TSourceLoc& loc, const
}
} else if (type.isVector()) {
if (type.getVectorSize() != (int)initList->getSequence().size()) {
- error(loc, "wrong vector size (or rows in a matrix column):", "initializer list", type.getCompleteString().c_str());
+ error(loc, "wrong vector size (or rows in a matrix column):", "initializer list", type.getCompleteString(intermediate.getEnhancedMsgs()).c_str());
return nullptr;
}
TBasicType destType = type.getBasicType();
for (int i = 0; i < type.getVectorSize(); ++i) {
TBasicType initType = initList->getSequence()[i]->getAsTyped()->getBasicType();
if (destType != initType && !intermediate.canImplicitlyPromote(initType, destType)) {
- error(loc, "type mismatch in initializer list", "initializer list", type.getCompleteString().c_str());
+ error(loc, "type mismatch in initializer list", "initializer list", type.getCompleteString(intermediate.getEnhancedMsgs()).c_str());
return nullptr;
}
}
} else {
- error(loc, "unexpected initializer-list type:", "initializer list", type.getCompleteString().c_str());
+ error(loc, "unexpected initializer-list type:", "initializer list", type.getCompleteString(intermediate.getEnhancedMsgs()).c_str());
return nullptr;
}
@@ -8048,12 +8174,12 @@ TIntermTyped* TParseContext::constructBuiltIn(const TType& type, TOperator op, T
case EOpConstructAccStruct:
if ((node->getType().isScalar() && node->getType().getBasicType() == EbtUint64)) {
// construct acceleration structure from uint64
- requireExtensions(loc, 1, &E_GL_EXT_ray_tracing, "uint64_t conversion to acclerationStructureEXT");
+ requireExtensions(loc, Num_ray_tracing_EXTs, ray_tracing_EXTs, "uint64_t conversion to acclerationStructureEXT");
return intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConvUint64ToAccStruct, true, node,
type);
} else if (node->getType().isVector() && node->getType().getBasicType() == EbtUint && node->getVectorSize() == 2) {
// construct acceleration structure from uint64
- requireExtensions(loc, 1, &E_GL_EXT_ray_tracing, "uvec2 conversion to accelerationStructureEXT");
+ requireExtensions(loc, Num_ray_tracing_EXTs, ray_tracing_EXTs, "uvec2 conversion to accelerationStructureEXT");
return intermediate.addBuiltInFunctionCall(node->getLoc(), EOpConvUvec2ToAccStruct, true, node,
type);
} else
@@ -8092,8 +8218,9 @@ TIntermTyped* TParseContext::constructAggregate(TIntermNode* node, const TType&
{
TIntermTyped* converted = intermediate.addConversion(EOpConstructStruct, type, node->getAsTyped());
if (! converted || converted->getType() != type) {
+ bool enhanced = intermediate.getEnhancedMsgs();
error(loc, "", "constructor", "cannot convert parameter %d from '%s' to '%s'", paramCount,
- node->getAsTyped()->getType().getCompleteString().c_str(), type.getCompleteString().c_str());
+ node->getAsTyped()->getType().getCompleteString(enhanced).c_str(), type.getCompleteString(enhanced).c_str());
return nullptr;
}
@@ -8152,6 +8279,8 @@ void TParseContext::declareBlock(const TSourceLoc& loc, TTypeList& typeList, con
memberQualifier.perViewNV = currentBlockQualifier.perViewNV;
if (currentBlockQualifier.perTaskNV)
memberQualifier.perTaskNV = currentBlockQualifier.perTaskNV;
+ if (currentBlockQualifier.storage == EvqtaskPayloadSharedEXT)
+ memberQualifier.storage = EvqtaskPayloadSharedEXT;
if (memberQualifier.storage == EvqSpirvStorageClass)
error(memberLoc, "member cannot have a spirv_storage_class qualifier", memberType.getFieldName().c_str(), "");
if (memberQualifier.hasSprivDecorate() && !memberQualifier.getSpirvDecorate().decorateIds.empty())
@@ -8452,23 +8581,23 @@ void TParseContext::blockStageIoCheck(const TSourceLoc& loc, const TQualifier& q
// It is a compile-time error to have an input block in a vertex shader or an output block in a fragment shader
// "Compute shaders do not permit user-defined input variables..."
requireStage(loc, (EShLanguageMask)(EShLangTessControlMask|EShLangTessEvaluationMask|EShLangGeometryMask|
- EShLangFragmentMask|EShLangMeshNVMask), "input block");
+ EShLangFragmentMask|EShLangMeshMask), "input block");
if (language == EShLangFragment) {
profileRequires(loc, EEsProfile, 320, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, "fragment input block");
- } else if (language == EShLangMeshNV && ! qualifier.isTaskMemory()) {
+ } else if (language == EShLangMesh && ! qualifier.isTaskMemory()) {
error(loc, "input blocks cannot be used in a mesh shader", "out", "");
}
break;
case EvqVaryingOut:
profileRequires(loc, ~EEsProfile, 150, E_GL_ARB_separate_shader_objects, "output block");
requireStage(loc, (EShLanguageMask)(EShLangVertexMask|EShLangTessControlMask|EShLangTessEvaluationMask|
- EShLangGeometryMask|EShLangMeshNVMask|EShLangTaskNVMask), "output block");
+ EShLangGeometryMask|EShLangMeshMask|EShLangTaskMask), "output block");
// ES 310 can have a block before shader_io is turned on, so skip this test for built-ins
if (language == EShLangVertex && ! parsingBuiltins) {
profileRequires(loc, EEsProfile, 320, Num_AEP_shader_io_blocks, AEP_shader_io_blocks, "vertex output block");
- } else if (language == EShLangMeshNV && qualifier.isTaskMemory()) {
+ } else if (language == EShLangMesh && qualifier.isTaskMemory()) {
error(loc, "can only use on input blocks in mesh shader", "taskNV", "");
- } else if (language == EShLangTaskNV && ! qualifier.isTaskMemory()) {
+ } else if (language == EShLangTask && ! qualifier.isTaskMemory()) {
error(loc, "output blocks cannot be used in a task shader", "out", "");
}
break;
@@ -8882,7 +9011,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
{
#ifndef GLSLANG_WEB
if (publicType.shaderQualifiers.vertices != TQualifier::layoutNotSet) {
- assert(language == EShLangTessControl || language == EShLangGeometry || language == EShLangMeshNV);
+ assert(language == EShLangTessControl || language == EShLangGeometry || language == EShLangMesh);
const char* id = (language == EShLangTessControl) ? "vertices" : "max_vertices";
if (publicType.qualifier.storage != EvqVaryingOut)
@@ -8894,7 +9023,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
checkIoArraysConsistency(loc);
}
if (publicType.shaderQualifiers.primitives != TQualifier::layoutNotSet) {
- assert(language == EShLangMeshNV);
+ assert(language == EShLangMesh);
const char* id = "max_primitives";
if (publicType.qualifier.storage != EvqVaryingOut)
@@ -8918,7 +9047,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
case ElgTrianglesAdjacency:
case ElgQuads:
case ElgIsolines:
- if (language == EShLangMeshNV) {
+ if (language == EShLangMesh) {
error(loc, "cannot apply to input", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), "");
break;
}
@@ -8935,7 +9064,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
switch (publicType.shaderQualifiers.geometry) {
case ElgLines:
case ElgTriangles:
- if (language != EShLangMeshNV) {
+ if (language != EShLangMesh) {
error(loc, "cannot apply to 'out'", TQualifier::getGeometryString(publicType.shaderQualifiers.geometry), "");
break;
}
@@ -8991,24 +9120,56 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
error(loc, "too large; see gl_MaxComputeWorkGroupSize", "local_size", "");
}
#ifndef GLSLANG_WEB
- else if (language == EShLangMeshNV) {
+ else if (language == EShLangMesh) {
switch (i) {
- case 0: max = resources.maxMeshWorkGroupSizeX_NV; break;
- case 1: max = resources.maxMeshWorkGroupSizeY_NV; break;
- case 2: max = resources.maxMeshWorkGroupSizeZ_NV; break;
+ case 0:
+ max = extensionTurnedOn(E_GL_EXT_mesh_shader) ?
+ resources.maxMeshWorkGroupSizeX_EXT :
+ resources.maxMeshWorkGroupSizeX_NV;
+ break;
+ case 1:
+ max = extensionTurnedOn(E_GL_EXT_mesh_shader) ?
+ resources.maxMeshWorkGroupSizeY_EXT :
+ resources.maxMeshWorkGroupSizeY_NV ;
+ break;
+ case 2:
+ max = extensionTurnedOn(E_GL_EXT_mesh_shader) ?
+ resources.maxMeshWorkGroupSizeZ_EXT :
+ resources.maxMeshWorkGroupSizeZ_NV ;
+ break;
default: break;
}
- if (intermediate.getLocalSize(i) > (unsigned int)max)
- error(loc, "too large; see gl_MaxMeshWorkGroupSizeNV", "local_size", "");
- } else if (language == EShLangTaskNV) {
+ if (intermediate.getLocalSize(i) > (unsigned int)max) {
+ TString maxsErrtring = "too large, see ";
+ maxsErrtring.append(extensionTurnedOn(E_GL_EXT_mesh_shader) ?
+ "gl_MaxMeshWorkGroupSizeEXT" : "gl_MaxMeshWorkGroupSizeNV");
+ error(loc, maxsErrtring.c_str(), "local_size", "");
+ }
+ } else if (language == EShLangTask) {
switch (i) {
- case 0: max = resources.maxTaskWorkGroupSizeX_NV; break;
- case 1: max = resources.maxTaskWorkGroupSizeY_NV; break;
- case 2: max = resources.maxTaskWorkGroupSizeZ_NV; break;
+ case 0:
+ max = extensionTurnedOn(E_GL_EXT_mesh_shader) ?
+ resources.maxTaskWorkGroupSizeX_EXT :
+ resources.maxTaskWorkGroupSizeX_NV;
+ break;
+ case 1:
+ max = extensionTurnedOn(E_GL_EXT_mesh_shader) ?
+ resources.maxTaskWorkGroupSizeY_EXT:
+ resources.maxTaskWorkGroupSizeY_NV;
+ break;
+ case 2:
+ max = extensionTurnedOn(E_GL_EXT_mesh_shader) ?
+ resources.maxTaskWorkGroupSizeZ_EXT:
+ resources.maxTaskWorkGroupSizeZ_NV;
+ break;
default: break;
}
- if (intermediate.getLocalSize(i) > (unsigned int)max)
- error(loc, "too large; see gl_MaxTaskWorkGroupSizeNV", "local_size", "");
+ if (intermediate.getLocalSize(i) > (unsigned int)max) {
+ TString maxsErrtring = "too large, see ";
+ maxsErrtring.append(extensionTurnedOn(E_GL_EXT_mesh_shader) ?
+ "gl_MaxTaskWorkGroupSizeEXT" : "gl_MaxTaskWorkGroupSizeNV");
+ error(loc, maxsErrtring.c_str(), "local_size", "");
+ }
}
#endif
else {
@@ -9043,6 +9204,12 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
else
error(loc, "can only apply to 'in'", "early_fragment_tests", "");
}
+ if (publicType.shaderQualifiers.earlyAndLateFragmentTestsAMD) {
+ if (publicType.qualifier.storage == EvqVaryingIn)
+ intermediate.setEarlyAndLateFragmentTestsAMD();
+ else
+ error(loc, "can only apply to 'in'", "early_and_late_fragment_tests_amd", "");
+ }
if (publicType.shaderQualifiers.postDepthCoverage) {
if (publicType.qualifier.storage == EvqVaryingIn)
intermediate.setPostDepthCoverage();
@@ -9091,7 +9258,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
error(loc, "can only apply to 'in'", "derivative_group_linearNV", "");
}
// Check mesh out array sizes, once all the necessary out qualifiers are defined.
- if ((language == EShLangMeshNV) &&
+ if ((language == EShLangMesh) &&
(intermediate.getVertices() != TQualifier::layoutNotSet) &&
(intermediate.getPrimitives() != TQualifier::layoutNotSet) &&
(intermediate.getOutputPrimitive() != ElgNone))
@@ -9108,7 +9275,7 @@ void TParseContext::updateStandaloneQualifierDefaults(const TSourceLoc& loc, con
// Exit early as further checks are not valid
return;
}
-#endif
+#endif
const TQualifier& qualifier = publicType.qualifier;
if (qualifier.isAuxiliary() ||
@@ -9243,11 +9410,14 @@ TIntermNode* TParseContext::addSwitch(const TSourceLoc& loc, TIntermTyped* expre
// "it is an error to have no statement between a label and the end of the switch statement."
// The specifications were updated to remove this (being ill-defined what a "statement" was),
// so, this became a warning. However, 3.0 tests still check for the error.
- if (isEsProfile() && version <= 300 && ! relaxedErrors())
+ if (isEsProfile() && (version <= 300 || version >= 320) && ! relaxedErrors())
+ error(loc, "last case/default label not followed by statements", "switch", "");
+ else if (!isEsProfile() && (version <= 430 || version >= 460))
error(loc, "last case/default label not followed by statements", "switch", "");
else
warn(loc, "last case/default label not followed by statements", "switch", "");
+
// emulate a break for error recovery
lastStatements = intermediate.makeAggregate(intermediate.addBranch(EOpBreak, loc));
lastStatements->setOperator(EOpSequence);
@@ -9303,4 +9473,3 @@ const TTypeList* TParseContext::recordStructCopy(TStructRecord& record, const TT
}
} // end namespace glslang
-
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h
index 442741d6d40..885fd90810f 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.h
@@ -480,7 +480,6 @@ public:
TSpirvRequirement* mergeSpirvRequirements(const TSourceLoc& loc, TSpirvRequirement* spirvReq1,
TSpirvRequirement* spirvReq2);
TSpirvTypeParameters* makeSpirvTypeParameters(const TSourceLoc& loc, const TIntermConstantUnion* constant);
- TSpirvTypeParameters* makeSpirvTypeParameters(const TPublicType& type);
TSpirvTypeParameters* mergeSpirvTypeParameters(TSpirvTypeParameters* spirvTypeParams1,
TSpirvTypeParameters* spirvTypeParams2);
TSpirvInstruction* makeSpirvInstruction(const TSourceLoc& loc, const TString& name, const TString& value);
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp
index c387aede0e6..7f51173ebc3 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Scan.cpp
@@ -739,6 +739,7 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["f16subpassInputMS"] = F16SUBPASSINPUTMS;
(*KeywordMap)["__explicitInterpAMD"] = EXPLICITINTERPAMD;
(*KeywordMap)["pervertexNV"] = PERVERTEXNV;
+ (*KeywordMap)["pervertexEXT"] = PERVERTEXEXT;
(*KeywordMap)["precise"] = PRECISE;
(*KeywordMap)["rayPayloadNV"] = PAYLOADNV;
@@ -757,6 +758,8 @@ void TScanContext::fillInKeywordMap()
(*KeywordMap)["perprimitiveNV"] = PERPRIMITIVENV;
(*KeywordMap)["perviewNV"] = PERVIEWNV;
(*KeywordMap)["taskNV"] = PERTASKNV;
+ (*KeywordMap)["perprimitiveEXT"] = PERPRIMITIVEEXT;
+ (*KeywordMap)["taskPayloadSharedEXT"] = TASKPAYLOADWORKGROUPEXT;
(*KeywordMap)["fcoopmatNV"] = FCOOPMATNV;
(*KeywordMap)["icoopmatNV"] = ICOOPMATNV;
@@ -1719,6 +1722,12 @@ int TScanContext::tokenizeIdentifier()
return keyword;
return identifierOrType();
+ case PERVERTEXEXT:
+ if ((!parseContext.isEsProfile() && parseContext.version >= 450) ||
+ parseContext.extensionTurnedOn(E_GL_EXT_fragment_shader_barycentric))
+ return keyword;
+ return identifierOrType();
+
case PRECISE:
if ((parseContext.isEsProfile() &&
(parseContext.version >= 320 || parseContext.extensionsTurnedOn(Num_AEP_gpu_shader5, AEP_gpu_shader5))) ||
@@ -1733,12 +1742,18 @@ int TScanContext::tokenizeIdentifier()
case PERPRIMITIVENV:
case PERVIEWNV:
case PERTASKNV:
- if ((!parseContext.isEsProfile() && parseContext.version >= 450) ||
- (parseContext.isEsProfile() && parseContext.version >= 320) ||
+ if (parseContext.symbolTable.atBuiltInLevel() ||
parseContext.extensionTurnedOn(E_GL_NV_mesh_shader))
return keyword;
return identifierOrType();
+ case PERPRIMITIVEEXT:
+ case TASKPAYLOADWORKGROUPEXT:
+ if (parseContext.symbolTable.atBuiltInLevel() ||
+ parseContext.extensionTurnedOn(E_GL_EXT_mesh_shader))
+ return keyword;
+ return identifierOrType();
+
case FCOOPMATNV:
afterType = true;
if (parseContext.symbolTable.atBuiltInLevel() ||
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp
index d02eae6fcc7..ced00863e37 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/ShaderLang.cpp
@@ -298,9 +298,6 @@ void InitializeStageSymbolTable(TBuiltInParseables& builtInParseables, int versi
#ifdef GLSLANG_WEB
profile = EEsProfile;
version = 310;
-#elif defined(GLSLANG_ANGLE)
- profile = ECoreProfile;
- version = 450;
#endif
(*symbolTables[language]).adoptLevels(*commonTable[CommonIndex(profile, language)]);
@@ -322,9 +319,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
#ifdef GLSLANG_WEB
profile = EEsProfile;
version = 310;
-#elif defined(GLSLANG_ANGLE)
- profile = ECoreProfile;
- version = 450;
#endif
std::unique_ptr<TBuiltInParseables> builtInParseables(CreateBuiltInParseables(infoSink, source));
@@ -371,7 +365,6 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangCompute, source,
infoSink, commonTable, symbolTables);
-#ifndef GLSLANG_ANGLE
// check for ray tracing stages
if (profile != EEsProfile && version >= 450) {
InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangRayGen, source,
@@ -391,15 +384,14 @@ bool InitializeSymbolTables(TInfoSink& infoSink, TSymbolTable** commonTable, TS
// check for mesh
if ((profile != EEsProfile && version >= 450) ||
(profile == EEsProfile && version >= 320))
- InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMeshNV, source,
+ InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangMesh, source,
infoSink, commonTable, symbolTables);
// check for task
if ((profile != EEsProfile && version >= 450) ||
(profile == EEsProfile && version >= 320))
- InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTaskNV, source,
+ InitializeStageSymbolTable(*builtInParseables, version, profile, spvVersion, EShLangTask, source,
infoSink, commonTable, symbolTables);
-#endif // !GLSLANG_ANGLE
#endif // !GLSLANG_WEB
return true;
@@ -502,7 +494,7 @@ void SetupBuiltinSymbolTable(int version, EProfile profile, const SpvVersion& sp
// Function to Print all builtins
void DumpBuiltinSymbolTable(TInfoSink& infoSink, const TSymbolTable& symbolTable)
{
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
infoSink.debug << "BuiltinSymbolTable {\n";
symbolTable.dump(infoSink, true);
@@ -606,7 +598,7 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
break;
}
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
// Correct for stage type...
switch (stage) {
case EShLangGeometry:
@@ -650,8 +642,8 @@ bool DeduceVersionProfile(TInfoSink& infoSink, EShLanguage stage, bool versionNo
version = 460;
}
break;
- case EShLangMeshNV:
- case EShLangTaskNV:
+ case EShLangMesh:
+ case EShLangTask:
if ((profile == EEsProfile && version < 320) ||
(profile != EEsProfile && version < 450)) {
correct = false;
@@ -813,6 +805,7 @@ bool ProcessDeferred(
// set version/profile to defaultVersion/defaultProfile regardless of the #version
// directive in the source code
bool forceDefaultVersionAndProfile,
+ int overrideVersion, // overrides version specified by #verison or default version
bool forwardCompatible, // give errors for use of deprecated features
EShMessages messages, // warnings/errors/AST; things to print out
TIntermediate& intermediate, // returned tree, etc.
@@ -883,7 +876,7 @@ bool ProcessDeferred(
: userInput.scanVersion(version, profile, versionNotFirstToken);
bool versionNotFound = version == 0;
if (forceDefaultVersionAndProfile && source == EShSourceGlsl) {
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
if (! (messages & EShMsgSuppressWarnings) && ! versionNotFound &&
(version != defaultVersion || profile != defaultProfile)) {
compiler->infoSink.info << "Warning, (version, profile) forced to be ("
@@ -900,19 +893,19 @@ bool ProcessDeferred(
version = defaultVersion;
profile = defaultProfile;
}
+ if (source == EShSourceGlsl && overrideVersion != 0) {
+ version = overrideVersion;
+ }
bool goodVersion = DeduceVersionProfile(compiler->infoSink, stage,
versionNotFirst, defaultVersion, source, version, profile, spvVersion);
#ifdef GLSLANG_WEB
profile = EEsProfile;
version = 310;
-#elif defined(GLSLANG_ANGLE)
- profile = ECoreProfile;
- version = 450;
#endif
bool versionWillBeError = (versionNotFound || (profile == EEsProfile && version >= 300 && versionNotFirst));
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
bool warnVersionNotFirst = false;
if (! versionWillBeError && versionNotFirstToken) {
if (messages & EShMsgRelaxedErrors)
@@ -985,7 +978,7 @@ bool ProcessDeferred(
parseContext->setLimits(*resources);
if (! goodVersion)
parseContext->addError();
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
if (warnVersionNotFirst) {
TSourceLoc loc;
loc.init();
@@ -1023,7 +1016,7 @@ bool ProcessDeferred(
return success;
}
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
// Responsible for keeping track of the most recent source string and line in
// the preprocessor and outputting newlines appropriately if the source string
@@ -1246,16 +1239,14 @@ struct DoFullParse{
parseContext.infoSink.info << parseContext.getNumErrors() << " compilation errors. No code generated.\n\n";
}
-#ifndef GLSLANG_ANGLE
if (messages & EShMsgAST)
intermediate.output(parseContext.infoSink, true);
-#endif
return success;
}
};
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
// Take a single compilation unit, and run the preprocessor on it.
// Return: True if there were no issues found in preprocessing,
// False if during preprocessing any unknown version, pragmas or
@@ -1275,6 +1266,7 @@ bool PreprocessDeferred(
int defaultVersion, // use 100 for ES environment, 110 for desktop
EProfile defaultProfile,
bool forceDefaultVersionAndProfile,
+ int overrideVersion, // use 0 if not overriding GLSL version
bool forwardCompatible, // give errors for use of deprecated features
EShMessages messages, // warnings/errors/AST; things to print out
TShader::Includer& includer,
@@ -1285,7 +1277,7 @@ bool PreprocessDeferred(
DoPreprocessing parser(outputString);
return ProcessDeferred(compiler, shaderStrings, numStrings, inputLengths, stringNames,
preamble, optLevel, resources, defaultVersion,
- defaultProfile, forceDefaultVersionAndProfile,
+ defaultProfile, forceDefaultVersionAndProfile, overrideVersion,
forwardCompatible, messages, intermediate, parser,
false, includer, "", environment);
}
@@ -1314,6 +1306,7 @@ bool CompileDeferred(
int defaultVersion, // use 100 for ES environment, 110 for desktop
EProfile defaultProfile,
bool forceDefaultVersionAndProfile,
+ int overrideVersion, // use 0 if not overriding GLSL version
bool forwardCompatible, // give errors for use of deprecated features
EShMessages messages, // warnings/errors/AST; things to print out
TIntermediate& intermediate,// returned tree, etc.
@@ -1324,7 +1317,7 @@ bool CompileDeferred(
DoFullParse parser;
return ProcessDeferred(compiler, shaderStrings, numStrings, inputLengths, stringNames,
preamble, optLevel, resources, defaultVersion,
- defaultProfile, forceDefaultVersionAndProfile,
+ defaultProfile, forceDefaultVersionAndProfile, overrideVersion,
forwardCompatible, messages, intermediate, parser,
true, includer, sourceEntryPointName, environment);
}
@@ -1343,7 +1336,6 @@ int ShInitialize()
glslang::GetGlobalLock();
++NumberOfClients;
- glslang::ReleaseGlobalLock();
if (PerProcessGPA == nullptr)
PerProcessGPA = new TPoolAllocator();
@@ -1353,6 +1345,7 @@ int ShInitialize()
glslang::HlslScanContext::fillInKeywordMap();
#endif
+ glslang::ReleaseGlobalLock();
return 1;
}
@@ -1415,9 +1408,10 @@ int ShFinalize()
--NumberOfClients;
assert(NumberOfClients >= 0);
bool finalize = NumberOfClients == 0;
- glslang::ReleaseGlobalLock();
- if (! finalize)
+ if (! finalize) {
+ glslang::ReleaseGlobalLock();
return 1;
+ }
for (int version = 0; version < VersionCount; ++version) {
for (int spvVersion = 0; spvVersion < SpvVersionCount; ++spvVersion) {
@@ -1455,6 +1449,7 @@ int ShFinalize()
glslang::HlslScanContext::deleteKeywordMap();
#endif
+ glslang::ReleaseGlobalLock();
return 1;
}
@@ -1496,7 +1491,7 @@ int ShCompile(
TIntermediate intermediate(compiler->getLanguage());
TShader::ForbidIncluder includer;
bool success = CompileDeferred(compiler, shaderStrings, numStrings, inputLengths, nullptr,
- "", optLevel, resources, defaultVersion, ENoProfile, false,
+ "", optLevel, resources, defaultVersion, ENoProfile, false, 0,
forwardCompatible, messages, intermediate, includer);
//
@@ -1757,7 +1752,7 @@ public:
};
TShader::TShader(EShLanguage s)
- : stage(s), lengths(nullptr), stringNames(nullptr), preamble("")
+ : stage(s), lengths(nullptr), stringNames(nullptr), preamble(""), overrideVersion(0)
{
pool = new TPoolAllocator;
infoSink = new TInfoSink;
@@ -1826,7 +1821,15 @@ void TShader::setUniqueId(unsigned long long id)
intermediate->setUniqueId(id);
}
+void TShader::setOverrideVersion(int version)
+{
+ overrideVersion = version;
+}
+
+void TShader::setDebugInfo(bool debugInfo) { intermediate->setDebugInfo(debugInfo); }
void TShader::setInvertY(bool invert) { intermediate->setInvertY(invert); }
+void TShader::setDxPositionW(bool invert) { intermediate->setDxPositionW(invert); }
+void TShader::setEnhancedMsgs() { intermediate->setEnhancedMsgs(); }
void TShader::setNanMinMaxClamp(bool useNonNan) { intermediate->setNanMinMaxClamp(useNonNan); }
#ifndef GLSLANG_WEB
@@ -1906,12 +1909,12 @@ bool TShader::parse(const TBuiltInResource* builtInResources, int defaultVersion
return CompileDeferred(compiler, strings, numStrings, lengths, stringNames,
preamble, EShOptNone, builtInResources, defaultVersion,
- defaultProfile, forceDefaultVersionAndProfile,
+ defaultProfile, forceDefaultVersionAndProfile, overrideVersion,
forwardCompatible, messages, *intermediate, includer, sourceEntryPointName,
&environment);
}
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
// Fill in a string with the result of preprocessing ShaderStrings
// Returns true if all extensions, pragmas and version strings were valid.
//
@@ -1933,7 +1936,7 @@ bool TShader::preprocess(const TBuiltInResource* builtInResources,
return PreprocessDeferred(compiler, strings, numStrings, lengths, stringNames, preamble,
EShOptNone, builtInResources, defaultVersion,
- defaultProfile, forceDefaultVersionAndProfile,
+ defaultProfile, forceDefaultVersionAndProfile, overrideVersion,
forwardCompatible, message, includer, *intermediate, output_string,
&environment);
}
@@ -1950,7 +1953,7 @@ const char* TShader::getInfoDebugLog()
}
TProgram::TProgram() :
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
reflection(0),
#endif
linked(false)
@@ -1966,7 +1969,7 @@ TProgram::TProgram() :
TProgram::~TProgram()
{
delete infoSink;
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
delete reflection;
#endif
@@ -2016,7 +2019,7 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
if (stages[stage].size() == 0)
return true;
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
int numEsShaders = 0, numNonEsShaders = 0;
for (auto it = stages[stage].begin(); it != stages[stage].end(); ++it) {
if ((*it)->intermediate->getProfile() == EEsProfile) {
@@ -2046,6 +2049,8 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
firstIntermediate->getVersion(),
firstIntermediate->getProfile());
intermediate[stage]->setLimits(firstIntermediate->getLimits());
+ if (firstIntermediate->getEnhancedMsgs())
+ intermediate[stage]->setEnhancedMsgs();
// The new TIntermediate must use the same origin as the original TIntermediates.
// Otherwise linking will fail due to different coordinate systems.
@@ -2070,10 +2075,8 @@ bool TProgram::linkStage(EShLanguage stage, EShMessages messages)
#endif
intermediate[stage]->finalCheck(*infoSink, (messages & EShMsgKeepUncalled) != 0);
-#ifndef GLSLANG_ANGLE
if (messages & EShMsgAST)
intermediate[stage]->output(*infoSink, true);
-#endif
return intermediate[stage]->getNumErrors() == 0;
}
@@ -2151,7 +2154,7 @@ const char* TProgram::getInfoDebugLog()
return infoSink->debug.c_str();
}
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
//
// Reflection implementation.
@@ -2233,6 +2236,6 @@ bool TProgram::mapIO(TIoMapResolver* pResolver, TIoMapper* pIoMapper)
return ioMapper->doMap(pResolver, *infoSink);
}
-#endif // !GLSLANG_WEB && !GLSLANG_ANGLE
+#endif // !GLSLANG_WEB
} // end namespace glslang
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp
index 38094eaaf7c..6650f7d9eed 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SpirvIntrinsics.cpp
@@ -130,11 +130,11 @@ void TIntermediate::insertSpirvExecutionModeId(int executionMode, const TIntermA
spirvExecutionMode = new TSpirvExecutionMode;
assert(args);
- TVector<const TIntermConstantUnion*> extraOperands;
+ TVector<const TIntermTyped*> extraOperands;
for (auto arg : args->getSequence()) {
- auto extraOperand = arg->getAsConstantUnion();
- assert(extraOperand != nullptr);
+ auto extraOperand = arg->getAsTyped();
+ assert(extraOperand != nullptr && extraOperand->getQualifier().isConstant());
extraOperands.push_back(extraOperand);
}
spirvExecutionMode->modeIds[executionMode] = extraOperands;
@@ -165,10 +165,10 @@ void TQualifier::setSpirvDecorateId(int decoration, const TIntermAggregate* args
spirvDecorate = new TSpirvDecorate;
assert(args);
- TVector<const TIntermConstantUnion*> extraOperands;
+ TVector<const TIntermTyped*> extraOperands;
for (auto arg : args->getSequence()) {
- auto extraOperand = arg->getAsConstantUnion();
- assert(extraOperand != nullptr);
+ auto extraOperand = arg->getAsTyped();
+ assert(extraOperand != nullptr && extraOperand->getQualifier().isConstant());
extraOperands.push_back(extraOperand);
}
spirvDecorate->decorateIds[decoration] = extraOperands;
@@ -201,25 +201,27 @@ TString TQualifier::getSpirvDecorateQualifierString() const
const auto appendBool = [&](bool b) { qualifierString.append(std::to_string(b).c_str()); };
const auto appendStr = [&](const char* s) { qualifierString.append(s); };
- const auto appendDecorate = [&](const TIntermConstantUnion* constant) {
+ 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<float>(constant->getConstArray()[0].getDConst());
+ float value = static_cast<float>(constArray[0].getDConst());
appendFloat(value);
}
else if (constant->getBasicType() == EbtInt) {
- int value = constant->getConstArray()[0].getIConst();
+ int value = constArray[0].getIConst();
appendInt(value);
}
else if (constant->getBasicType() == EbtUint) {
- unsigned value = constant->getConstArray()[0].getUConst();
+ unsigned value = constArray[0].getUConst();
appendUint(value);
}
else if (constant->getBasicType() == EbtBool) {
- bool value = constant->getConstArray()[0].getBConst();
+ bool value = constArray[0].getBConst();
appendBool(value);
}
else if (constant->getBasicType() == EbtString) {
- const TString* value = constant->getConstArray()[0].getSConst();
+ const TString* value = constArray[0].getSConst();
appendStr(value->c_str());
}
else
@@ -290,13 +292,6 @@ TSpirvTypeParameters* TParseContext::makeSpirvTypeParameters(const TSourceLoc& l
return spirvTypeParams;
}
-TSpirvTypeParameters* TParseContext::makeSpirvTypeParameters(const TPublicType& type)
-{
- TSpirvTypeParameters* spirvTypeParams = new TSpirvTypeParameters;
- spirvTypeParams->push_back(TSpirvTypeParameter(new TType(type)));
- return spirvTypeParams;
-}
-
TSpirvTypeParameters* TParseContext::mergeSpirvTypeParameters(TSpirvTypeParameters* spirvTypeParams1, TSpirvTypeParameters* spirvTypeParams2)
{
// Merge SPIR-V type parameters of the second one to the first one
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp
index 5b7e27fa26f..b140686d624 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.cpp
@@ -183,7 +183,7 @@ void TType::buildMangledName(TString& mangledName) const
}
}
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
//
// Dump functions.
@@ -383,7 +383,7 @@ TFunction::TFunction(const TFunction& copyOf) : TSymbol(copyOf)
for (unsigned int i = 0; i < copyOf.parameters.size(); ++i) {
TParameter param;
parameters.push_back(param);
- parameters.back().copyParam(copyOf.parameters[i]);
+ (void)parameters.back().copyParam(copyOf.parameters[i]);
}
extensions = nullptr;
@@ -426,12 +426,7 @@ TSymbolTableLevel* TSymbolTableLevel::clone() const
symTableLevel->thisLevel = thisLevel;
symTableLevel->retargetedSymbols.clear();
for (auto &s : retargetedSymbols) {
- // Extra constructions to make sure they use the correct allocator pool
- TString newFrom;
- newFrom = s.first;
- TString newTo;
- newTo = s.second;
- symTableLevel->retargetedSymbols.push_back({std::move(newFrom), std::move(newTo)});
+ symTableLevel->retargetedSymbols.push_back({s.first, s.second});
}
std::vector<bool> containerCopied(anonId, false);
tLevel::const_iterator iter;
@@ -462,11 +457,7 @@ TSymbolTableLevel* TSymbolTableLevel::clone() const
TSymbol* sym = symTableLevel->find(s.second);
if (!sym)
continue;
-
- // Need to declare and assign so newS is using the correct pool allocator
- TString newS;
- newS = s.first;
- symTableLevel->insert(newS, sym);
+ symTableLevel->insert(s.first, sym);
}
return symTableLevel;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h
index 720999a36a5..0d45e484cde 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/SymbolTable.h
@@ -84,7 +84,7 @@ typedef TVector<const char*> TExtensionList;
class TSymbol {
public:
POOL_ALLOCATOR_NEW_DELETE(GetThreadPoolAllocator())
- explicit TSymbol(const TString *n) : name(n), extensions(0), writable(true) { }
+ explicit TSymbol(const TString *n) : name(n), uniqueId(0), extensions(0), writable(true) { }
virtual TSymbol* clone() const = 0;
virtual ~TSymbol() { } // rely on all symbol owned memory coming from the pool
@@ -117,7 +117,7 @@ public:
virtual int getNumExtensions() const { return extensions == nullptr ? 0 : (int)extensions->size(); }
virtual const char** getExtensions() const { return extensions->data(); }
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
virtual void dump(TInfoSink& infoSink, bool complete = false) const = 0;
void dumpExtensions(TInfoSink& infoSink) const;
#endif
@@ -196,7 +196,7 @@ public:
}
virtual const char** getMemberExtensions(int member) const { return (*memberExtensions)[member].data(); }
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
virtual void dump(TInfoSink& infoSink, bool complete = false) const;
#endif
@@ -224,7 +224,7 @@ struct TParameter {
TString *name;
TType* type;
TIntermTyped* defaultValue;
- void copyParam(const TParameter& param)
+ TParameter& copyParam(const TParameter& param)
{
if (param.name)
name = NewPoolTString(param.name->c_str());
@@ -232,6 +232,7 @@ struct TParameter {
name = 0;
type = param.type->clone();
defaultValue = param.defaultValue;
+ return *this;
}
TBuiltInVariable getDeclaredBuiltIn() const { return type->getQualifier().declaredBuiltIn; }
};
@@ -328,7 +329,7 @@ public:
virtual const TSpirvInstruction& getSpirvInstruction() const { return spirvInst; }
#endif
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
virtual void dump(TInfoSink& infoSink, bool complete = false) const override;
#endif
@@ -394,7 +395,7 @@ public:
virtual const char** getExtensions() const override { return anonContainer.getMemberExtensions(memberNumber); }
virtual int getAnonId() const { return anonId; }
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
virtual void dump(TInfoSink& infoSink, bool complete = false) const override;
#endif
@@ -581,7 +582,7 @@ public:
void relateToOperator(const char* name, TOperator op);
void setFunctionExtensions(const char* name, int num, const char* const extensions[]);
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
void dump(TInfoSink& infoSink, bool complete = false) const;
#endif
TSymbolTableLevel* clone() const;
@@ -911,7 +912,7 @@ public:
}
long long getMaxSymbolId() { return uniqueId; }
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
void dump(TInfoSink& infoSink, bool complete = false) const;
#endif
void copyTable(const TSymbolTable& copyOf);
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp
index 097ee845529..a5fd107535b 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.cpp
@@ -166,7 +166,8 @@ void TParseVersions::initializeExtensionBehavior()
} extensionData;
const extensionData exts[] = { {E_GL_EXT_ray_tracing, EShTargetSpv_1_4},
- {E_GL_NV_ray_tracing_motion_blur, EShTargetSpv_1_4}
+ {E_GL_NV_ray_tracing_motion_blur, EShTargetSpv_1_4},
+ {E_GL_EXT_mesh_shader, EShTargetSpv_1_4}
};
for (size_t ii = 0; ii < sizeof(exts) / sizeof(exts[0]); ii++) {
@@ -225,6 +226,9 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_ARB_shading_language_packing] = EBhDisable;
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_fragment_coord_conventions] = EBhDisable;
+
extensionBehavior[E_GL_KHR_shader_subgroup_basic] = EBhDisable;
extensionBehavior[E_GL_KHR_shader_subgroup_vote] = EBhDisable;
@@ -256,6 +260,8 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_EXT_shader_8bit_storage] = EBhDisable;
extensionBehavior[E_GL_EXT_subgroup_uniform_control_flow] = EBhDisable;
+ extensionBehavior[E_GL_EXT_fragment_shader_barycentric] = EBhDisable;
+
// #line and #include
extensionBehavior[E_GL_GOOGLE_cpp_style_line_directive] = EBhDisable;
extensionBehavior[E_GL_GOOGLE_include_directive] = EBhDisable;
@@ -270,6 +276,7 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_AMD_shader_image_load_store_lod] = EBhDisable;
extensionBehavior[E_GL_AMD_shader_fragment_mask] = EBhDisable;
extensionBehavior[E_GL_AMD_gpu_shader_half_float_fetch] = EBhDisable;
+ extensionBehavior[E_GL_AMD_shader_early_and_late_fragment_tests] = EBhDisable;
extensionBehavior[E_GL_INTEL_shader_integer_functions2] = EBhDisable;
@@ -331,13 +338,16 @@ void TParseVersions::initializeExtensionBehavior()
extensionBehavior[E_GL_EXT_ray_tracing] = EBhDisable;
extensionBehavior[E_GL_EXT_ray_query] = EBhDisable;
extensionBehavior[E_GL_EXT_ray_flags_primitive_culling] = EBhDisable;
+ extensionBehavior[E_GL_EXT_ray_cull_mask] = EBhDisable;
extensionBehavior[E_GL_EXT_blend_func_extended] = EBhDisable;
extensionBehavior[E_GL_EXT_shader_implicit_conversions] = EBhDisable;
extensionBehavior[E_GL_EXT_fragment_shading_rate] = EBhDisable;
- extensionBehavior[E_GL_EXT_shader_image_int64] = EBhDisable;
+ extensionBehavior[E_GL_EXT_shader_image_int64] = EBhDisable;
extensionBehavior[E_GL_EXT_terminate_invocation] = EBhDisable;
extensionBehavior[E_GL_EXT_shared_memory_block] = EBhDisable;
extensionBehavior[E_GL_EXT_spirv_intrinsics] = EBhDisable;
+ extensionBehavior[E_GL_EXT_mesh_shader] = EBhDisable;
+ extensionBehavior[E_GL_EXT_opacity_micromap] = EBhDisable;
// OVR extensions
extensionBehavior[E_GL_OVR_multiview] = EBhDisable;
@@ -465,6 +475,8 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_ARB_shader_storage_buffer_object 1\n"
"#define GL_ARB_texture_query_lod 1\n"
"#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_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"
@@ -482,6 +494,7 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_EXT_debug_printf 1\n"
"#define GL_EXT_fragment_shading_rate 1\n"
"#define GL_EXT_shared_memory_block 1\n"
+ "#define GL_EXT_shader_integer_mix 1\n"
// GL_KHR_shader_subgroup
"#define GL_KHR_shader_subgroup_basic 1\n"
@@ -499,7 +512,9 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_EXT_ray_tracing 1\n"
"#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_spirv_intrinsics 1\n"
+ "#define GL_EXT_mesh_shader 1\n"
"#define GL_AMD_shader_ballot 1\n"
"#define GL_AMD_shader_trinary_minmax 1\n"
@@ -546,6 +561,8 @@ void TParseVersions::getPreamble(std::string& preamble)
"#define GL_EXT_shader_atomic_float 1\n"
"#define GL_EXT_shader_atomic_float2 1\n"
+
+ "#define GL_EXT_fragment_shader_barycentric 1\n"
;
if (version >= 150) {
@@ -628,8 +645,8 @@ void TParseVersions::getPreamble(std::string& preamble)
case EShLangClosestHit: preamble += "#define GL_CLOSEST_HIT_SHADER_EXT 1 \n"; break;
case EShLangMiss: preamble += "#define GL_MISS_SHADER_EXT 1 \n"; break;
case EShLangCallable: preamble += "#define GL_CALLABLE_SHADER_EXT 1 \n"; break;
- case EShLangTaskNV: preamble += "#define GL_TASK_SHADER_NV 1 \n"; break;
- case EShLangMeshNV: preamble += "#define GL_MESH_SHADER_NV 1 \n"; break;
+ case EShLangTask: preamble += "#define GL_TASK_SHADER_NV 1 \n"; break;
+ case EShLangMesh: preamble += "#define GL_MESH_SHADER_NV 1 \n"; break;
default: break;
}
}
@@ -655,8 +672,8 @@ const char* StageName(EShLanguage stage)
case EShLangClosestHit: return "closest-hit";
case EShLangMiss: return "miss";
case EShLangCallable: return "callable";
- case EShLangMeshNV: return "mesh";
- case EShLangTaskNV: return "task";
+ case EShLangMesh: return "mesh";
+ case EShLangTask: return "task";
#endif
default: return "unknown stage";
}
@@ -1047,10 +1064,22 @@ void TParseVersions::checkExtensionStage(const TSourceLoc& loc, const char * con
{
// GL_NV_mesh_shader extension is only allowed in task/mesh shaders
if (strcmp(extension, "GL_NV_mesh_shader") == 0) {
- requireStage(loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask | EShLangFragmentMask),
+ 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");
+ if (extensionTurnedOn(E_GL_EXT_mesh_shader)) {
+ error(loc, "GL_EXT_mesh_shader is already turned on, and not allowed with", "#extension", extension);
+ }
+ }
+ 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");
+ if (extensionTurnedOn(E_GL_NV_mesh_shader)) {
+ error(loc, "GL_NV_mesh_shader is already turned on, and not allowed with", "#extension", extension);
+ }
}
}
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h
index 949a7a17398..f06abdd6f05 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/Versions.h
@@ -161,6 +161,8 @@ const char* const E_GL_ARB_shader_storage_buffer_object = "GL_ARB_shader_storage
const char* const E_GL_ARB_shading_language_packing = "GL_ARB_shading_language_packing";
const char* const E_GL_ARB_texture_query_lod = "GL_ARB_texture_query_lod";
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_KHR_shader_subgroup_basic = "GL_KHR_shader_subgroup_basic";
const char* const E_GL_KHR_shader_subgroup_vote = "GL_KHR_shader_subgroup_vote";
@@ -199,6 +201,7 @@ const char* const E_GL_EXT_debug_printf = "GL_EXT_debug_prin
const char* const E_GL_EXT_ray_tracing = "GL_EXT_ray_tracing";
const char* const E_GL_EXT_ray_query = "GL_EXT_ray_query";
const char* const E_GL_EXT_ray_flags_primitive_culling = "GL_EXT_ray_flags_primitive_culling";
+const char* const E_GL_EXT_ray_cull_mask = "GL_EXT_ray_cull_mask";
const char* const E_GL_EXT_blend_func_extended = "GL_EXT_blend_func_extended";
const char* const E_GL_EXT_shader_implicit_conversions = "GL_EXT_shader_implicit_conversions";
const char* const E_GL_EXT_fragment_shading_rate = "GL_EXT_fragment_shading_rate";
@@ -207,12 +210,19 @@ const char* const E_GL_EXT_null_initializer = "GL_EXT_null_initi
const char* const E_GL_EXT_shared_memory_block = "GL_EXT_shared_memory_block";
const char* const E_GL_EXT_subgroup_uniform_control_flow = "GL_EXT_subgroup_uniform_control_flow";
const char* const E_GL_EXT_spirv_intrinsics = "GL_EXT_spirv_intrinsics";
+const char* const E_GL_EXT_fragment_shader_barycentric = "GL_EXT_fragment_shader_barycentric";
+const char* const E_GL_EXT_mesh_shader = "GL_EXT_mesh_shader";
+const char* const E_GL_EXT_opacity_micromap = "GL_EXT_opacity_micromap";
// Arrays of extensions for the above viewportEXTs duplications
const char* const post_depth_coverageEXTs[] = { E_GL_ARB_post_depth_coverage, E_GL_EXT_post_depth_coverage };
const int Num_post_depth_coverageEXTs = sizeof(post_depth_coverageEXTs) / sizeof(post_depth_coverageEXTs[0]);
+// Array of extensions to cover both extensions providing ray tracing capabilities.
+const char* const ray_tracing_EXTs[] = { E_GL_EXT_ray_query, E_GL_EXT_ray_tracing };
+const int Num_ray_tracing_EXTs = sizeof(ray_tracing_EXTs) / sizeof(ray_tracing_EXTs[0]);
+
// OVR extensions
const char* const E_GL_OVR_multiview = "GL_OVR_multiview";
const char* const E_GL_OVR_multiview2 = "GL_OVR_multiview2";
@@ -234,6 +244,7 @@ const char* const E_GL_AMD_gpu_shader_int16 = "GL_AMD_gpu_sh
const char* const E_GL_AMD_shader_image_load_store_lod = "GL_AMD_shader_image_load_store_lod";
const char* const E_GL_AMD_shader_fragment_mask = "GL_AMD_shader_fragment_mask";
const char* const E_GL_AMD_gpu_shader_half_float_fetch = "GL_AMD_gpu_shader_half_float_fetch";
+const char* const E_GL_AMD_shader_early_and_late_fragment_tests = "GL_AMD_shader_early_and_late_fragment_tests";
const char* const E_GL_INTEL_shader_integer_functions2 = "GL_INTEL_shader_integer_functions2";
@@ -279,7 +290,7 @@ const char* const E_GL_EXT_tessellation_shader = "GL_EXT_tessel
const char* const E_GL_EXT_tessellation_point_size = "GL_EXT_tessellation_point_size";
const char* const E_GL_EXT_texture_buffer = "GL_EXT_texture_buffer";
const char* const E_GL_EXT_texture_cube_map_array = "GL_EXT_texture_cube_map_array";
-const char* const E_GL_EXT_shader_integer_mix = "GL_EXT_shader_integer_mix";
+const char* const E_GL_EXT_shader_integer_mix = "GL_EXT_shader_integer_mix";
// OES matching AEP
const char* const E_GL_OES_geometry_shader = "GL_OES_geometry_shader";
@@ -340,6 +351,9 @@ const int Num_AEP_texture_buffer = sizeof(AEP_texture_buffer)/sizeof(AEP_texture
const char* const AEP_texture_cube_map_array[] = { E_GL_EXT_texture_cube_map_array, E_GL_OES_texture_cube_map_array };
const int Num_AEP_texture_cube_map_array = sizeof(AEP_texture_cube_map_array)/sizeof(AEP_texture_cube_map_array[0]);
+const char* const AEP_mesh_shader[] = { E_GL_NV_mesh_shader, E_GL_EXT_mesh_shader };
+const int Num_AEP_mesh_shader = sizeof(AEP_mesh_shader)/sizeof(AEP_mesh_shader[0]);
+
} // end namespace glslang
#endif // _VERSIONS_INCLUDED_
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4 b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4
index 36265029722..a59da443d9c 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.m4
@@ -315,7 +315,7 @@ GLSLANG_WEB_EXCLUDE_ON
%token <lex> PATCH SAMPLE NONUNIFORM
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
%token <lex> SUBGROUPCOHERENT NONPRIVATE SHADERCALLCOHERENT
-%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV
+%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXEXT PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV PERPRIMITIVEEXT TASKPAYLOADWORKGROUPEXT
%token <lex> PRECISE
GLSLANG_WEB_EXCLUDE_OFF
@@ -798,7 +798,7 @@ conditional_expression
parseContext.rValueErrorCheck($5.loc, ":", $6);
$$ = parseContext.intermediate.addSelection($1, $4, $6, $2.loc);
if ($$ == 0) {
- parseContext.binaryOpError($2.loc, ":", $4->getCompleteString(), $6->getCompleteString());
+ parseContext.binaryOpError($2.loc, ":", $4->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $6->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
$$ = $6;
}
}
@@ -815,7 +815,7 @@ assignment_expression
parseContext.rValueErrorCheck($2.loc, "assign", $3);
$$ = parseContext.addAssign($2.loc, $2.op, $1, $3);
if ($$ == 0) {
- parseContext.assignError($2.loc, "assign", $1->getCompleteString(), $3->getCompleteString());
+ parseContext.assignError($2.loc, "assign", $1->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $3->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
$$ = $1;
}
}
@@ -877,7 +877,7 @@ expression
parseContext.samplerConstructorLocationCheck($2.loc, ",", $3);
$$ = parseContext.intermediate.addComma($1, $3, $2.loc);
if ($$ == 0) {
- parseContext.binaryOpError($2.loc, ",", $1->getCompleteString(), $3->getCompleteString());
+ parseContext.binaryOpError($2.loc, ",", $1->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $3->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
$$ = $3;
}
}
@@ -1290,27 +1290,45 @@ GLSLANG_WEB_EXCLUDE_ON
$$.init($1.loc);
$$.qualifier.pervertexNV = true;
}
+ | PERVERTEXEXT {
+ parseContext.globalCheck($1.loc, "pervertexEXT");
+ parseContext.profileRequires($1.loc, ECoreProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
+ parseContext.profileRequires($1.loc, ECompatibilityProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
+ parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
+ $$.init($1.loc);
+ $$.qualifier.pervertexEXT = true;
+ }
| PERPRIMITIVENV {
// No need for profile version or extension check. Shader stage already checks both.
parseContext.globalCheck($1.loc, "perprimitiveNV");
- parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshNVMask), "perprimitiveNV");
+ parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveNV");
// Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
if (parseContext.language == EShLangFragment)
parseContext.requireExtensions($1.loc, 1, &E_GL_NV_mesh_shader, "perprimitiveNV");
$$.init($1.loc);
$$.qualifier.perPrimitiveNV = true;
}
+ | PERPRIMITIVEEXT {
+ // No need for profile version or extension check. Shader stage already checks both.
+ parseContext.globalCheck($1.loc, "perprimitiveEXT");
+ parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveEXT");
+ // Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
+ if (parseContext.language == EShLangFragment)
+ parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_mesh_shader, "perprimitiveEXT");
+ $$.init($1.loc);
+ $$.qualifier.perPrimitiveNV = true;
+ }
| PERVIEWNV {
// No need for profile version or extension check. Shader stage already checks both.
parseContext.globalCheck($1.loc, "perviewNV");
- parseContext.requireStage($1.loc, EShLangMeshNV, "perviewNV");
+ parseContext.requireStage($1.loc, EShLangMesh, "perviewNV");
$$.init($1.loc);
$$.qualifier.perViewNV = true;
}
| PERTASKNV {
// No need for profile version or extension check. Shader stage already checks both.
parseContext.globalCheck($1.loc, "taskNV");
- parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask), "taskNV");
+ parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskNV");
$$.init($1.loc);
$$.qualifier.perTaskNV = true;
}
@@ -1461,7 +1479,7 @@ storage_qualifier
parseContext.globalCheck($1.loc, "shared");
parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
parseContext.profileRequires($1.loc, EEsProfile, 310, 0, "shared");
- parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshNVMask | EShLangTaskNVMask), "shared");
+ parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshMask | EShLangTaskMask), "shared");
$$.init($1.loc);
$$.qualifier.storage = EvqShared;
}
@@ -1648,6 +1666,13 @@ GLSLANG_WEB_EXCLUDE_ON
parseContext.unimplemented($1.loc, "subroutine");
$$.init($1.loc);
}
+ | TASKPAYLOADWORKGROUPEXT {
+ // No need for profile version or extension check. Shader stage already checks both.
+ parseContext.globalCheck($1.loc, "taskPayloadSharedEXT");
+ parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskPayloadSharedEXT ");
+ $$.init($1.loc);
+ $$.qualifier.storage = EvqtaskPayloadSharedEXT;
+ }
GLSLANG_WEB_EXCLUDE_OFF
;
@@ -3718,7 +3743,7 @@ compound_statement
}
RIGHT_BRACE {
if ($3 && $3->getAsAggregate())
- $3->getAsAggregate()->setOperator(EOpSequence);
+ $3->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence);
$$ = $3;
}
;
@@ -4367,9 +4392,6 @@ spirv_type_parameter
: constant_expression {
$$ = parseContext.makeSpirvTypeParameters($1->getLoc(), $1->getAsConstantUnion());
}
- | type_specifier {
- $$ = parseContext.makeSpirvTypeParameters($1);
- }
spirv_instruction_qualifier
: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN {
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y
index ad483863419..35242f21578 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang.y
@@ -151,7 +151,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%parse-param {glslang::TParseContext* pParseContext}
%lex-param {parseContext}
-%pure-parser // enable thread safety
+%define api.pure // enable thread safety
%expect 1 // One shift reduce conflict because of if | else
%token <lex> CONST BOOL INT UINT FLOAT
@@ -315,7 +315,7 @@ extern int yylex(YYSTYPE*, TParseContext&);
%token <lex> PATCH SAMPLE NONUNIFORM
%token <lex> COHERENT VOLATILE RESTRICT READONLY WRITEONLY DEVICECOHERENT QUEUEFAMILYCOHERENT WORKGROUPCOHERENT
%token <lex> SUBGROUPCOHERENT NONPRIVATE SHADERCALLCOHERENT
-%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV
+%token <lex> NOPERSPECTIVE EXPLICITINTERPAMD PERVERTEXEXT PERVERTEXNV PERPRIMITIVENV PERVIEWNV PERTASKNV PERPRIMITIVEEXT TASKPAYLOADWORKGROUPEXT
%token <lex> PRECISE
@@ -798,7 +798,7 @@ conditional_expression
parseContext.rValueErrorCheck($5.loc, ":", $6);
$$ = parseContext.intermediate.addSelection($1, $4, $6, $2.loc);
if ($$ == 0) {
- parseContext.binaryOpError($2.loc, ":", $4->getCompleteString(), $6->getCompleteString());
+ parseContext.binaryOpError($2.loc, ":", $4->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $6->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
$$ = $6;
}
}
@@ -815,7 +815,7 @@ assignment_expression
parseContext.rValueErrorCheck($2.loc, "assign", $3);
$$ = parseContext.addAssign($2.loc, $2.op, $1, $3);
if ($$ == 0) {
- parseContext.assignError($2.loc, "assign", $1->getCompleteString(), $3->getCompleteString());
+ parseContext.assignError($2.loc, "assign", $1->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $3->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
$$ = $1;
}
}
@@ -877,7 +877,7 @@ expression
parseContext.samplerConstructorLocationCheck($2.loc, ",", $3);
$$ = parseContext.intermediate.addComma($1, $3, $2.loc);
if ($$ == 0) {
- parseContext.binaryOpError($2.loc, ",", $1->getCompleteString(), $3->getCompleteString());
+ parseContext.binaryOpError($2.loc, ",", $1->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), $3->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
$$ = $3;
}
}
@@ -1290,27 +1290,45 @@ interpolation_qualifier
$$.init($1.loc);
$$.qualifier.pervertexNV = true;
}
+ | PERVERTEXEXT {
+ parseContext.globalCheck($1.loc, "pervertexEXT");
+ parseContext.profileRequires($1.loc, ECoreProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
+ parseContext.profileRequires($1.loc, ECompatibilityProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
+ parseContext.profileRequires($1.loc, EEsProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
+ $$.init($1.loc);
+ $$.qualifier.pervertexEXT = true;
+ }
| PERPRIMITIVENV {
// No need for profile version or extension check. Shader stage already checks both.
parseContext.globalCheck($1.loc, "perprimitiveNV");
- parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshNVMask), "perprimitiveNV");
+ parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveNV");
// Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
if (parseContext.language == EShLangFragment)
parseContext.requireExtensions($1.loc, 1, &E_GL_NV_mesh_shader, "perprimitiveNV");
$$.init($1.loc);
$$.qualifier.perPrimitiveNV = true;
}
+ | PERPRIMITIVEEXT {
+ // No need for profile version or extension check. Shader stage already checks both.
+ parseContext.globalCheck($1.loc, "perprimitiveEXT");
+ parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveEXT");
+ // Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
+ if (parseContext.language == EShLangFragment)
+ parseContext.requireExtensions($1.loc, 1, &E_GL_EXT_mesh_shader, "perprimitiveEXT");
+ $$.init($1.loc);
+ $$.qualifier.perPrimitiveNV = true;
+ }
| PERVIEWNV {
// No need for profile version or extension check. Shader stage already checks both.
parseContext.globalCheck($1.loc, "perviewNV");
- parseContext.requireStage($1.loc, EShLangMeshNV, "perviewNV");
+ parseContext.requireStage($1.loc, EShLangMesh, "perviewNV");
$$.init($1.loc);
$$.qualifier.perViewNV = true;
}
| PERTASKNV {
// No need for profile version or extension check. Shader stage already checks both.
parseContext.globalCheck($1.loc, "taskNV");
- parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask), "taskNV");
+ parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskNV");
$$.init($1.loc);
$$.qualifier.perTaskNV = true;
}
@@ -1461,7 +1479,7 @@ storage_qualifier
parseContext.globalCheck($1.loc, "shared");
parseContext.profileRequires($1.loc, ECoreProfile | ECompatibilityProfile, 430, E_GL_ARB_compute_shader, "shared");
parseContext.profileRequires($1.loc, EEsProfile, 310, 0, "shared");
- parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshNVMask | EShLangTaskNVMask), "shared");
+ parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshMask | EShLangTaskMask), "shared");
$$.init($1.loc);
$$.qualifier.storage = EvqShared;
}
@@ -1648,6 +1666,13 @@ storage_qualifier
parseContext.unimplemented($1.loc, "subroutine");
$$.init($1.loc);
}
+ | TASKPAYLOADWORKGROUPEXT {
+ // No need for profile version or extension check. Shader stage already checks both.
+ parseContext.globalCheck($1.loc, "taskPayloadSharedEXT");
+ parseContext.requireStage($1.loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskPayloadSharedEXT ");
+ $$.init($1.loc);
+ $$.qualifier.storage = EvqtaskPayloadSharedEXT;
+ }
;
@@ -3718,7 +3743,7 @@ compound_statement
}
RIGHT_BRACE {
if ($3 && $3->getAsAggregate())
- $3->getAsAggregate()->setOperator(EOpSequence);
+ $3->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence);
$$ = $3;
}
;
@@ -4367,9 +4392,6 @@ spirv_type_parameter
: constant_expression {
$$ = parseContext.makeSpirvTypeParameters($1->getLoc(), $1->getAsConstantUnion());
}
- | type_specifier {
- $$ = parseContext.makeSpirvTypeParameters($1);
- }
spirv_instruction_qualifier
: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN {
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
index 33b8a924171..7ca3e711b20 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp
@@ -571,142 +571,145 @@ enum yysymbol_kind_t
YYSYMBOL_SHADERCALLCOHERENT = 447, /* SHADERCALLCOHERENT */
YYSYMBOL_NOPERSPECTIVE = 448, /* NOPERSPECTIVE */
YYSYMBOL_EXPLICITINTERPAMD = 449, /* EXPLICITINTERPAMD */
- YYSYMBOL_PERVERTEXNV = 450, /* PERVERTEXNV */
- YYSYMBOL_PERPRIMITIVENV = 451, /* PERPRIMITIVENV */
- YYSYMBOL_PERVIEWNV = 452, /* PERVIEWNV */
- YYSYMBOL_PERTASKNV = 453, /* PERTASKNV */
- YYSYMBOL_PRECISE = 454, /* PRECISE */
- YYSYMBOL_YYACCEPT = 455, /* $accept */
- YYSYMBOL_variable_identifier = 456, /* variable_identifier */
- YYSYMBOL_primary_expression = 457, /* primary_expression */
- YYSYMBOL_postfix_expression = 458, /* postfix_expression */
- YYSYMBOL_integer_expression = 459, /* integer_expression */
- YYSYMBOL_function_call = 460, /* function_call */
- YYSYMBOL_function_call_or_method = 461, /* function_call_or_method */
- YYSYMBOL_function_call_generic = 462, /* function_call_generic */
- YYSYMBOL_function_call_header_no_parameters = 463, /* function_call_header_no_parameters */
- YYSYMBOL_function_call_header_with_parameters = 464, /* function_call_header_with_parameters */
- YYSYMBOL_function_call_header = 465, /* function_call_header */
- YYSYMBOL_function_identifier = 466, /* function_identifier */
- YYSYMBOL_unary_expression = 467, /* unary_expression */
- YYSYMBOL_unary_operator = 468, /* unary_operator */
- YYSYMBOL_multiplicative_expression = 469, /* multiplicative_expression */
- YYSYMBOL_additive_expression = 470, /* additive_expression */
- YYSYMBOL_shift_expression = 471, /* shift_expression */
- YYSYMBOL_relational_expression = 472, /* relational_expression */
- YYSYMBOL_equality_expression = 473, /* equality_expression */
- YYSYMBOL_and_expression = 474, /* and_expression */
- YYSYMBOL_exclusive_or_expression = 475, /* exclusive_or_expression */
- YYSYMBOL_inclusive_or_expression = 476, /* inclusive_or_expression */
- YYSYMBOL_logical_and_expression = 477, /* logical_and_expression */
- YYSYMBOL_logical_xor_expression = 478, /* logical_xor_expression */
- YYSYMBOL_logical_or_expression = 479, /* logical_or_expression */
- YYSYMBOL_conditional_expression = 480, /* conditional_expression */
- YYSYMBOL_481_1 = 481, /* $@1 */
- YYSYMBOL_assignment_expression = 482, /* assignment_expression */
- YYSYMBOL_assignment_operator = 483, /* assignment_operator */
- YYSYMBOL_expression = 484, /* expression */
- YYSYMBOL_constant_expression = 485, /* constant_expression */
- YYSYMBOL_declaration = 486, /* declaration */
- YYSYMBOL_block_structure = 487, /* block_structure */
- YYSYMBOL_488_2 = 488, /* $@2 */
- YYSYMBOL_identifier_list = 489, /* identifier_list */
- YYSYMBOL_function_prototype = 490, /* function_prototype */
- YYSYMBOL_function_declarator = 491, /* function_declarator */
- YYSYMBOL_function_header_with_parameters = 492, /* function_header_with_parameters */
- YYSYMBOL_function_header = 493, /* function_header */
- YYSYMBOL_parameter_declarator = 494, /* parameter_declarator */
- YYSYMBOL_parameter_declaration = 495, /* parameter_declaration */
- YYSYMBOL_parameter_type_specifier = 496, /* parameter_type_specifier */
- YYSYMBOL_init_declarator_list = 497, /* init_declarator_list */
- YYSYMBOL_single_declaration = 498, /* single_declaration */
- YYSYMBOL_fully_specified_type = 499, /* fully_specified_type */
- YYSYMBOL_invariant_qualifier = 500, /* invariant_qualifier */
- YYSYMBOL_interpolation_qualifier = 501, /* interpolation_qualifier */
- YYSYMBOL_layout_qualifier = 502, /* layout_qualifier */
- YYSYMBOL_layout_qualifier_id_list = 503, /* layout_qualifier_id_list */
- YYSYMBOL_layout_qualifier_id = 504, /* layout_qualifier_id */
- YYSYMBOL_precise_qualifier = 505, /* precise_qualifier */
- YYSYMBOL_type_qualifier = 506, /* type_qualifier */
- YYSYMBOL_single_type_qualifier = 507, /* single_type_qualifier */
- YYSYMBOL_storage_qualifier = 508, /* storage_qualifier */
- YYSYMBOL_non_uniform_qualifier = 509, /* non_uniform_qualifier */
- YYSYMBOL_type_name_list = 510, /* type_name_list */
- YYSYMBOL_type_specifier = 511, /* type_specifier */
- YYSYMBOL_array_specifier = 512, /* array_specifier */
- YYSYMBOL_type_parameter_specifier_opt = 513, /* type_parameter_specifier_opt */
- YYSYMBOL_type_parameter_specifier = 514, /* type_parameter_specifier */
- YYSYMBOL_type_parameter_specifier_list = 515, /* type_parameter_specifier_list */
- YYSYMBOL_type_specifier_nonarray = 516, /* type_specifier_nonarray */
- YYSYMBOL_precision_qualifier = 517, /* precision_qualifier */
- YYSYMBOL_struct_specifier = 518, /* struct_specifier */
- YYSYMBOL_519_3 = 519, /* $@3 */
- YYSYMBOL_520_4 = 520, /* $@4 */
- YYSYMBOL_struct_declaration_list = 521, /* struct_declaration_list */
- YYSYMBOL_struct_declaration = 522, /* struct_declaration */
- YYSYMBOL_struct_declarator_list = 523, /* struct_declarator_list */
- YYSYMBOL_struct_declarator = 524, /* struct_declarator */
- YYSYMBOL_initializer = 525, /* initializer */
- YYSYMBOL_initializer_list = 526, /* initializer_list */
- YYSYMBOL_declaration_statement = 527, /* declaration_statement */
- YYSYMBOL_statement = 528, /* statement */
- YYSYMBOL_simple_statement = 529, /* simple_statement */
- YYSYMBOL_demote_statement = 530, /* demote_statement */
- YYSYMBOL_compound_statement = 531, /* compound_statement */
- YYSYMBOL_532_5 = 532, /* $@5 */
- YYSYMBOL_533_6 = 533, /* $@6 */
- YYSYMBOL_statement_no_new_scope = 534, /* statement_no_new_scope */
- YYSYMBOL_statement_scoped = 535, /* statement_scoped */
- YYSYMBOL_536_7 = 536, /* $@7 */
- YYSYMBOL_537_8 = 537, /* $@8 */
- YYSYMBOL_compound_statement_no_new_scope = 538, /* compound_statement_no_new_scope */
- YYSYMBOL_statement_list = 539, /* statement_list */
- YYSYMBOL_expression_statement = 540, /* expression_statement */
- YYSYMBOL_selection_statement = 541, /* selection_statement */
- YYSYMBOL_selection_statement_nonattributed = 542, /* selection_statement_nonattributed */
- YYSYMBOL_selection_rest_statement = 543, /* selection_rest_statement */
- YYSYMBOL_condition = 544, /* condition */
- YYSYMBOL_switch_statement = 545, /* switch_statement */
- YYSYMBOL_switch_statement_nonattributed = 546, /* switch_statement_nonattributed */
- YYSYMBOL_547_9 = 547, /* $@9 */
- YYSYMBOL_switch_statement_list = 548, /* switch_statement_list */
- YYSYMBOL_case_label = 549, /* case_label */
- YYSYMBOL_iteration_statement = 550, /* iteration_statement */
- YYSYMBOL_iteration_statement_nonattributed = 551, /* iteration_statement_nonattributed */
- YYSYMBOL_552_10 = 552, /* $@10 */
- YYSYMBOL_553_11 = 553, /* $@11 */
- YYSYMBOL_554_12 = 554, /* $@12 */
- YYSYMBOL_for_init_statement = 555, /* for_init_statement */
- YYSYMBOL_conditionopt = 556, /* conditionopt */
- YYSYMBOL_for_rest_statement = 557, /* for_rest_statement */
- YYSYMBOL_jump_statement = 558, /* jump_statement */
- YYSYMBOL_translation_unit = 559, /* translation_unit */
- YYSYMBOL_external_declaration = 560, /* external_declaration */
- YYSYMBOL_function_definition = 561, /* function_definition */
- YYSYMBOL_562_13 = 562, /* $@13 */
- YYSYMBOL_attribute = 563, /* attribute */
- YYSYMBOL_attribute_list = 564, /* attribute_list */
- YYSYMBOL_single_attribute = 565, /* single_attribute */
- YYSYMBOL_spirv_requirements_list = 566, /* spirv_requirements_list */
- YYSYMBOL_spirv_requirements_parameter = 567, /* spirv_requirements_parameter */
- YYSYMBOL_spirv_extension_list = 568, /* spirv_extension_list */
- YYSYMBOL_spirv_capability_list = 569, /* spirv_capability_list */
- YYSYMBOL_spirv_execution_mode_qualifier = 570, /* spirv_execution_mode_qualifier */
- YYSYMBOL_spirv_execution_mode_parameter_list = 571, /* spirv_execution_mode_parameter_list */
- YYSYMBOL_spirv_execution_mode_parameter = 572, /* spirv_execution_mode_parameter */
- YYSYMBOL_spirv_execution_mode_id_parameter_list = 573, /* spirv_execution_mode_id_parameter_list */
- YYSYMBOL_spirv_storage_class_qualifier = 574, /* spirv_storage_class_qualifier */
- YYSYMBOL_spirv_decorate_qualifier = 575, /* spirv_decorate_qualifier */
- YYSYMBOL_spirv_decorate_parameter_list = 576, /* spirv_decorate_parameter_list */
- YYSYMBOL_spirv_decorate_parameter = 577, /* spirv_decorate_parameter */
- YYSYMBOL_spirv_decorate_id_parameter_list = 578, /* spirv_decorate_id_parameter_list */
- YYSYMBOL_spirv_decorate_string_parameter_list = 579, /* spirv_decorate_string_parameter_list */
- YYSYMBOL_spirv_type_specifier = 580, /* spirv_type_specifier */
- YYSYMBOL_spirv_type_parameter_list = 581, /* spirv_type_parameter_list */
- YYSYMBOL_spirv_type_parameter = 582, /* spirv_type_parameter */
- YYSYMBOL_spirv_instruction_qualifier = 583, /* spirv_instruction_qualifier */
- YYSYMBOL_spirv_instruction_qualifier_list = 584, /* spirv_instruction_qualifier_list */
- YYSYMBOL_spirv_instruction_qualifier_id = 585 /* spirv_instruction_qualifier_id */
+ 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 */
};
typedef enum yysymbol_kind_t yysymbol_kind_t;
@@ -728,7 +731,7 @@ typedef enum yysymbol_kind_t yysymbol_kind_t;
extern int yylex(YYSTYPE*, TParseContext&);
-#line 732 "MachineIndependent/glslang_tab.cpp"
+#line 735 "MachineIndependent/glslang_tab.cpp"
#ifdef short
@@ -1032,21 +1035,21 @@ union yyalloc
#endif /* !YYCOPY_NEEDED */
/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 442
+#define YYFINAL 445
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 12453
+#define YYLAST 12503
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 455
+#define YYNTOKENS 458
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 131
/* YYNRULES -- Number of rules. */
-#define YYNRULES 684
+#define YYNRULES 686
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 930
+#define YYNSTATES 932
/* YYMAXUTOK -- Last valid token kind. */
-#define YYMAXUTOK 709
+#define YYMAXUTOK 712
/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
@@ -1130,7 +1133,8 @@ static const yytype_int16 yytranslate[] =
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
+ 445, 446, 447, 448, 449, 450, 451, 452, 453, 454,
+ 455, 456, 457
};
#if YYDEBUG
@@ -1151,61 +1155,61 @@ static const yytype_int16 yyrline[] =
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, 1303, 1310, 1321, 1327, 1330, 1337,
- 1341, 1345, 1354, 1364, 1367, 1378, 1381, 1384, 1388, 1392,
- 1397, 1401, 1404, 1409, 1413, 1418, 1427, 1431, 1436, 1442,
- 1448, 1455, 1460, 1468, 1474, 1486, 1500, 1506, 1511, 1519,
- 1527, 1535, 1543, 1551, 1559, 1567, 1575, 1582, 1589, 1593,
- 1598, 1603, 1608, 1613, 1618, 1623, 1627, 1631, 1635, 1639,
- 1645, 1656, 1663, 1666, 1675, 1680, 1690, 1695, 1703, 1707,
- 1717, 1720, 1726, 1732, 1739, 1749, 1753, 1757, 1761, 1766,
- 1770, 1775, 1780, 1785, 1790, 1795, 1800, 1805, 1810, 1815,
- 1821, 1827, 1833, 1838, 1843, 1848, 1853, 1858, 1863, 1868,
- 1873, 1878, 1883, 1888, 1894, 1901, 1906, 1911, 1916, 1921,
- 1926, 1931, 1936, 1941, 1946, 1951, 1956, 1964, 1972, 1980,
- 1986, 1992, 1998, 2004, 2010, 2016, 2022, 2028, 2034, 2040,
- 2046, 2052, 2058, 2064, 2070, 2076, 2082, 2088, 2094, 2100,
- 2106, 2112, 2118, 2124, 2130, 2136, 2142, 2148, 2154, 2160,
- 2166, 2172, 2178, 2186, 2194, 2202, 2210, 2218, 2226, 2234,
- 2242, 2250, 2258, 2266, 2274, 2280, 2286, 2292, 2298, 2304,
- 2310, 2316, 2322, 2328, 2334, 2340, 2346, 2352, 2358, 2364,
- 2370, 2376, 2382, 2388, 2394, 2400, 2406, 2412, 2418, 2424,
- 2430, 2436, 2442, 2448, 2454, 2460, 2466, 2472, 2478, 2484,
- 2490, 2494, 2498, 2502, 2507, 2513, 2518, 2523, 2528, 2533,
- 2538, 2543, 2549, 2554, 2559, 2564, 2569, 2574, 2580, 2586,
- 2592, 2598, 2604, 2610, 2616, 2622, 2628, 2634, 2640, 2646,
- 2652, 2658, 2663, 2668, 2673, 2678, 2683, 2688, 2694, 2699,
- 2704, 2709, 2714, 2719, 2724, 2729, 2735, 2740, 2745, 2750,
- 2755, 2760, 2765, 2770, 2775, 2780, 2785, 2790, 2795, 2800,
- 2805, 2811, 2816, 2821, 2827, 2833, 2838, 2843, 2848, 2854,
- 2859, 2864, 2869, 2875, 2880, 2885, 2890, 2896, 2901, 2906,
- 2911, 2917, 2923, 2929, 2935, 2940, 2946, 2952, 2958, 2963,
- 2968, 2973, 2978, 2983, 2989, 2994, 2999, 3004, 3010, 3015,
- 3020, 3025, 3031, 3036, 3041, 3046, 3052, 3057, 3062, 3067,
- 3073, 3078, 3083, 3088, 3094, 3099, 3104, 3109, 3115, 3120,
- 3125, 3130, 3136, 3141, 3146, 3151, 3157, 3162, 3167, 3172,
- 3178, 3183, 3188, 3193, 3199, 3204, 3209, 3214, 3220, 3225,
- 3230, 3235, 3241, 3246, 3251, 3256, 3262, 3267, 3272, 3277,
- 3283, 3288, 3293, 3298, 3303, 3308, 3313, 3318, 3323, 3328,
- 3333, 3338, 3343, 3348, 3353, 3358, 3363, 3368, 3373, 3378,
- 3383, 3388, 3393, 3398, 3403, 3409, 3415, 3421, 3427, 3434,
- 3441, 3447, 3453, 3459, 3465, 3471, 3477, 3483, 3488, 3493,
- 3509, 3514, 3519, 3527, 3527, 3538, 3538, 3548, 3551, 3564,
- 3586, 3613, 3617, 3623, 3628, 3639, 3643, 3649, 3655, 3666,
- 3669, 3676, 3680, 3681, 3687, 3688, 3689, 3690, 3691, 3692,
- 3693, 3695, 3701, 3710, 3711, 3715, 3711, 3727, 3728, 3732,
- 3732, 3739, 3739, 3753, 3756, 3764, 3772, 3783, 3784, 3788,
- 3792, 3800, 3807, 3811, 3819, 3823, 3836, 3840, 3848, 3848,
- 3868, 3871, 3877, 3889, 3901, 3905, 3913, 3913, 3928, 3928,
- 3946, 3946, 3967, 3970, 3976, 3979, 3985, 3989, 3996, 4001,
- 4006, 4013, 4016, 4020, 4025, 4029, 4039, 4043, 4052, 4055,
- 4059, 4068, 4068, 4110, 4115, 4118, 4123, 4126, 4133, 4136,
- 4141, 4144, 4149, 4152, 4157, 4160, 4165, 4169, 4174, 4178,
- 4183, 4187, 4194, 4197, 4202, 4205, 4208, 4211, 4214, 4219,
- 4228, 4239, 4244, 4252, 4256, 4261, 4265, 4270, 4274, 4279,
- 4283, 4290, 4293, 4298, 4301, 4304, 4307, 4312, 4320, 4330,
- 4334, 4339, 4343, 4348, 4352, 4359, 4362, 4367, 4370, 4375,
- 4378, 4384, 4387, 4392, 4395
+ 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
};
#endif
@@ -1319,7 +1323,8 @@ static const char *const yytname[] =
"WRITEONLY", "DEVICECOHERENT", "QUEUEFAMILYCOHERENT",
"WORKGROUPCOHERENT", "SUBGROUPCOHERENT", "NONPRIVATE",
"SHADERCALLCOHERENT", "NOPERSPECTIVE", "EXPLICITINTERPAMD",
- "PERVERTEXNV", "PERPRIMITIVENV", "PERVIEWNV", "PERTASKNV", "PRECISE",
+ "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",
@@ -1429,16 +1434,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
+ 705, 706, 707, 708, 709, 710, 711, 712
};
#endif
-#define YYPACT_NINF (-863)
+#define YYPACT_NINF (-813)
#define yypact_value_is_default(Yyn) \
((Yyn) == YYPACT_NINF)
-#define YYTABLE_NINF (-570)
+#define YYTABLE_NINF (-573)
#define yytable_value_is_error(Yyn) \
0
@@ -1447,99 +1452,100 @@ static const yytype_int16 yytoknum[] =
STATE-NUM. */
static const yytype_int16 yypact[] =
{
- 4549, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -260, -182, -177, -163, -130,
- -115, -100, -89, -863, -863, -196, -863, -863, -863, -863,
- -863, -324, -863, -863, -863, -863, -863, -306, -863, -863,
- -863, -863, -863, -863, -77, -66, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -332, -175,
- -153, -161, 7713, -266, -863, -71, -863, -863, -863, -863,
- 5453, -863, -863, -863, -863, -116, -863, -863, 933, -863,
- -863, 7713, -35, -863, -863, -863, 5905, -54, -139, -138,
- -137, -128, -124, -54, -123, -51, 12061, -863, -15, -347,
- -44, -863, -295, -863, -9, -6, 7713, -863, -863, -863,
- 7713, -39, -38, -863, -303, -863, -226, -863, -863, 10762,
- -3, -863, -863, -863, 1, -32, 7713, -863, -5, -8,
- -1, -863, -230, -863, -219, -2, 3, 4, 5, -215,
- 6, 8, 10, 11, 12, 15, -214, 13, 16, 21,
- -134, -863, 17, 7713, -863, 19, -863, -212, -863, -863,
- -211, 9030, -863, -273, 1385, -863, -863, -863, -863, -863,
- -3, -263, -863, 9463, -236, -863, -28, -863, -106, 10762,
- 10762, -863, 10762, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -264, -863, -863, -863, 23, -203, 11195, 25,
- -863, 10762, -863, -863, -311, 24, -6, 29, -863, -309,
- -54, -863, -20, -863, -323, 28, -118, 10762, -112, -863,
- -155, -111, 10762, -103, 35, -98, -54, -863, 11628, -863,
- -94, 10762, 32, -51, -863, 7713, 18, 6357, -863, 7713,
- 10762, -863, -347, -863, 33, -863, -863, -72, -254, -86,
- -297, -68, -13, 26, 20, 50, 49, -300, 42, 9896,
- -863, 43, -863, -863, 55, 58, 60, -863, 65, 71,
- 62, 10329, 73, 10762, 66, 69, 70, 72, 74, -241,
- -863, -863, -41, -863, -175, 83, 85, -863, -863, -863,
- -863, -863, 1837, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, 5001, 24, 9463, -233, 8164, -863, -863, 9463,
- 7713, -863, 51, -863, -863, -863, -194, -863, -863, 10762,
- 52, -863, -863, 10762, 88, -863, -863, -863, 10762, -863,
- -863, -863, -315, -863, -863, -191, 82, -863, -863, -863,
- -863, -863, -863, -190, -863, -187, -863, -863, -186, 86,
- -863, -863, -863, -863, -169, -863, -168, -863, -167, 89,
- -863, -165, 91, -157, 82, -863, 85, -156, -863, 94,
- 98, -863, -863, 18, -3, -40, -863, -863, -863, 6809,
- -863, -863, -863, 10762, 10762, 10762, 10762, 10762, 10762, 10762,
- 10762, 10762, 10762, 10762, 10762, 10762, 10762, 10762, 10762, 10762,
- 10762, 10762, -863, -863, -863, 97, -863, 2289, -863, -863,
- -863, 2289, -863, 10762, -863, -863, -34, 10762, -79, -863,
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, 10762, 10762, -863, -863, -863,
- -863, -863, -863, -863, 9463, -863, -863, -208, -863, 7261,
- -863, -863, 99, 96, -863, -863, -863, -863, -863, -132,
- -131, -863, -307, -863, -323, -863, -323, -863, 10762, 10762,
- -863, -155, -863, -155, -863, 10762, 10762, -863, 93, 35,
- -863, 11628, -863, 10762, -863, -863, -33, 24, 18, -863,
- -863, -863, -863, -863, -72, -72, -254, -254, -86, -86,
- -86, -86, -297, -297, -68, -13, 26, 20, 50, 49,
- 10762, -863, 2289, 4097, 57, 3645, -154, -863, -152, -863,
- -863, -863, -863, -863, 8597, -863, -863, -863, 105, -863,
- 75, -863, -145, -863, -144, -863, -143, -863, -142, -863,
- -141, -140, -863, -863, -863, -27, 100, 96, 76, 106,
- 109, -863, -863, 4097, 107, -863, -863, -863, -863, -863,
- -863, -863, -863, -863, -863, -863, 10762, -863, 101, 2741,
- 10762, -863, 103, 113, 67, 112, 3193, -863, 114, -863,
- 9463, -863, -863, -863, -133, 10762, 2741, 107, -863, -863,
- 2289, -863, 110, 96, -863, -863, 2289, 116, -863, -863
+ 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
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -1547,137 +1553,138 @@ static const yytype_int16 yypact[] =
means the default is an error. */
static const yytype_int16 yydefact[] =
{
- 0, 166, 219, 217, 218, 216, 223, 224, 225, 226,
- 227, 228, 229, 230, 231, 220, 221, 222, 232, 233,
- 234, 235, 236, 237, 238, 239, 240, 241, 242, 243,
- 345, 346, 347, 348, 349, 350, 351, 371, 372, 373,
- 374, 375, 376, 377, 386, 399, 400, 387, 388, 390,
- 389, 391, 392, 393, 394, 395, 396, 397, 398, 174,
- 175, 245, 246, 244, 247, 254, 255, 252, 253, 250,
- 251, 248, 249, 277, 278, 279, 289, 290, 291, 274,
- 275, 276, 286, 287, 288, 271, 272, 273, 283, 284,
- 285, 268, 269, 270, 280, 281, 282, 256, 257, 258,
- 292, 293, 294, 259, 260, 261, 304, 305, 306, 262,
- 263, 264, 316, 317, 318, 265, 266, 267, 328, 329,
- 330, 295, 296, 297, 298, 299, 300, 301, 302, 303,
- 307, 308, 309, 310, 311, 312, 313, 314, 315, 319,
- 320, 321, 322, 323, 324, 325, 326, 327, 331, 332,
- 333, 334, 335, 336, 337, 338, 339, 343, 340, 341,
- 342, 524, 525, 526, 355, 356, 379, 382, 344, 353,
- 354, 370, 352, 401, 402, 405, 406, 407, 409, 410,
- 411, 413, 414, 415, 417, 418, 514, 515, 378, 380,
- 381, 357, 358, 359, 403, 360, 364, 365, 368, 408,
- 412, 416, 361, 362, 366, 367, 404, 363, 369, 448,
- 450, 451, 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, 449, 453, 457, 461, 465, 473, 477, 481,
- 469, 485, 489, 492, 493, 494, 495, 496, 497, 498,
- 499, 500, 501, 502, 503, 504, 505, 506, 507, 508,
- 509, 510, 511, 512, 513, 383, 384, 385, 419, 428,
- 430, 424, 429, 431, 432, 434, 435, 436, 438, 439,
- 440, 442, 443, 444, 446, 447, 420, 421, 422, 433,
- 423, 425, 426, 427, 437, 441, 445, 516, 517, 520,
- 521, 522, 523, 518, 519, 0, 0, 0, 0, 0,
- 0, 0, 0, 164, 165, 0, 620, 137, 530, 531,
- 532, 0, 529, 170, 168, 169, 167, 0, 215, 171,
- 172, 173, 139, 138, 0, 199, 180, 182, 178, 184,
- 186, 181, 183, 179, 185, 187, 176, 177, 201, 188,
- 195, 196, 197, 198, 189, 190, 191, 192, 193, 194,
- 140, 141, 142, 143, 144, 145, 152, 619, 0, 621,
- 0, 114, 113, 0, 125, 130, 159, 158, 156, 160,
- 0, 153, 155, 161, 135, 211, 157, 528, 0, 616,
- 618, 0, 0, 162, 163, 527, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 535, 0, 0,
- 0, 99, 0, 94, 0, 109, 0, 121, 115, 123,
- 0, 124, 0, 97, 131, 102, 0, 154, 136, 0,
- 204, 210, 1, 617, 0, 0, 0, 96, 0, 0,
- 0, 628, 0, 681, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 626,
- 0, 624, 0, 0, 533, 149, 151, 0, 147, 202,
- 0, 0, 100, 0, 0, 622, 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,
- 213, 0, 36, 34, 0, 205, 111, 0, 95, 0,
- 0, 679, 0, 636, 0, 0, 0, 0, 0, 653,
- 0, 0, 0, 0, 0, 0, 0, 673, 0, 651,
- 0, 0, 0, 0, 98, 0, 0, 0, 537, 0,
- 0, 146, 0, 200, 0, 206, 45, 49, 52, 55,
- 60, 63, 65, 67, 69, 71, 73, 75, 0, 0,
- 101, 564, 573, 577, 0, 0, 0, 598, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 45,
- 78, 91, 0, 551, 0, 161, 135, 554, 575, 553,
- 561, 552, 0, 555, 556, 579, 557, 586, 558, 559,
- 594, 560, 0, 119, 0, 127, 0, 545, 134, 0,
- 0, 107, 0, 104, 38, 39, 0, 22, 23, 0,
- 0, 28, 27, 0, 215, 31, 33, 40, 0, 212,
- 112, 683, 0, 684, 629, 0, 0, 682, 648, 644,
- 645, 646, 647, 0, 642, 0, 93, 649, 0, 0,
- 663, 664, 665, 666, 0, 661, 0, 667, 0, 0,
- 669, 0, 0, 0, 2, 677, 678, 0, 675, 0,
- 0, 623, 625, 0, 543, 0, 541, 536, 538, 0,
- 150, 148, 203, 0, 0, 0, 0, 0, 0, 0,
+ 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, 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, 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, 76, 207, 208, 0, 563, 0, 596, 609,
- 608, 0, 600, 0, 612, 610, 0, 0, 0, 593,
- 613, 614, 615, 562, 81, 82, 84, 83, 86, 87,
- 88, 89, 90, 85, 80, 0, 0, 578, 574, 576,
- 580, 587, 595, 129, 0, 548, 549, 0, 133, 0,
- 108, 4, 0, 24, 21, 32, 214, 632, 634, 0,
- 0, 680, 0, 638, 0, 637, 0, 640, 0, 0,
- 655, 0, 654, 0, 657, 0, 0, 659, 0, 0,
- 674, 0, 671, 0, 652, 627, 0, 544, 0, 539,
- 534, 46, 47, 48, 51, 50, 53, 54, 58, 59,
- 56, 57, 61, 62, 64, 66, 68, 70, 72, 74,
- 0, 209, 565, 0, 0, 0, 0, 611, 0, 592,
- 79, 92, 128, 546, 0, 106, 19, 630, 0, 631,
- 0, 643, 0, 650, 0, 662, 0, 668, 0, 670,
- 0, 0, 676, 540, 542, 0, 0, 584, 0, 0,
- 0, 603, 602, 605, 571, 588, 547, 550, 633, 635,
- 639, 641, 656, 658, 660, 672, 0, 566, 0, 0,
- 0, 604, 0, 0, 583, 0, 0, 581, 0, 77,
- 0, 568, 597, 567, 0, 606, 0, 571, 570, 572,
- 590, 585, 0, 607, 601, 582, 591, 0, 599, 589
+ 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
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -863, -863, -863, -863, -863, -863, -863, -863, -863, -863,
- -863, -863, -418, -863, -380, -379, -484, -382, -258, -256,
- -253, -257, -252, -255, -863, -478, -863, -485, -863, -491,
- -530, 14, -863, -863, -863, 7, -397, -863, -863, 44,
- 53, 47, -863, -863, -400, -863, -863, -863, -863, -92,
- -863, -377, -362, -863, 9, -863, 0, -414, -863, -863,
- -863, -863, 150, -863, -863, -863, -546, -548, -218, -331,
- -624, -863, -359, -609, -862, -863, -417, -863, -863, -427,
- -426, -863, -863, 68, -719, -355, -863, -136, -863, -389,
- -863, -135, -863, -863, -863, -863, -129, -863, -863, -863,
- -863, -863, -863, -863, -863, 102, -863, -863, 2, -863,
- -65, -234, -432, -863, -863, -863, -301, -293, -294, -863,
- -863, -304, -299, -302, -298, -863, -296, -305, -863, -383,
- -526
+ -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
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 520, 521, 522, 782, 523, 524, 525, 526, 527,
- 528, 529, 609, 531, 577, 578, 579, 580, 581, 582,
- 583, 584, 585, 586, 587, 610, 840, 611, 765, 612,
- 695, 613, 378, 640, 498, 614, 380, 381, 382, 427,
- 428, 429, 383, 384, 385, 386, 387, 388, 477, 478,
- 389, 390, 391, 392, 532, 480, 533, 483, 440, 441,
- 534, 395, 396, 397, 569, 473, 567, 568, 705, 706,
- 638, 777, 617, 618, 619, 620, 621, 737, 876, 912,
- 904, 905, 906, 913, 622, 623, 624, 625, 907, 879,
- 626, 627, 908, 927, 628, 629, 630, 843, 741, 845,
- 883, 902, 903, 631, 398, 399, 400, 424, 632, 470,
- 471, 450, 451, 789, 790, 402, 673, 674, 678, 403,
- 404, 684, 685, 688, 691, 405, 697, 698, 406, 452,
- 453
+ -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
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
@@ -1685,145 +1692,191 @@ static const yytype_int16 yydefgoto[] =
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] =
{
- 394, 445, 401, 588, 444, 430, 445, 379, 637, 393,
- 773, 646, 776, 769, 377, 778, 667, 677, 842, 708,
- 494, 530, 687, 709, 446, 668, 535, 421, 437, 446,
- 466, 700, 667, 787, 720, 721, 731, 911, 475, 661,
- 710, 661, 662, 655, 919, 658, 492, 417, 481, 430,
- 328, 329, 330, 422, 911, 493, 481, 659, 669, 670,
- 671, 672, 476, 576, 482, 647, 648, 788, 437, 676,
- 722, 723, 732, 663, 676, 663, 633, 635, 589, 418,
- 676, 644, 645, 676, 437, -35, 590, 649, 481, 407,
- 432, 650, 676, 433, 779, 634, 565, 754, 755, 756,
- 757, 758, 759, 760, 761, 762, 763, 716, 664, 717,
- 746, 735, 748, 657, 664, 589, 664, 764, 589, 664,
- 541, 664, 639, 664, 664, 774, 542, 495, 664, 576,
- 496, 543, 844, 497, 576, 549, 557, 544, 571, 573,
- 576, 550, 558, 576, 572, 574, 853, 652, 854, 637,
- 852, 637, 576, 653, 637, 415, 781, 665, 783, 791,
- 793, 708, 766, 795, 797, 542, 794, 408, 785, 796,
- 798, 576, 409, 693, 456, 458, 460, 462, 464, 465,
- 468, 800, 802, 804, 423, 807, 410, 801, 803, 805,
- 565, 808, 565, 810, 812, 426, 884, 425, 885, 811,
- 813, 926, 766, 437, 766, 890, 891, 892, 893, 894,
- 895, 794, 798, 801, 805, 808, 813, 922, 562, 411,
- 857, 859, 563, 766, 858, 860, 680, 681, 682, 683,
- 887, 708, 445, 769, 412, 444, 828, 829, 830, 831,
- 786, 718, 719, 454, 457, 459, 455, 455, 455, 413,
- 642, 439, 846, 643, 461, 446, 848, 455, 463, 467,
- 414, 455, 455, 565, 675, 724, 725, 455, 863, 677,
- 679, 686, 419, 455, 455, 867, 687, 766, 849, 689,
- 850, 851, 455, 420, 692, 667, 921, 455, 699, 637,
- 817, 455, 713, 714, 715, 821, 822, 823, 576, 576,
- 576, 576, 576, 576, 576, 576, 576, 576, 576, 576,
- 576, 576, 576, 576, 434, 766, 818, 769, 767, 819,
- 676, 676, 766, 818, 447, 847, 873, 676, 676, 766,
- 896, 449, 565, 676, 469, 676, 824, 825, 474, 826,
- 827, 479, 832, 833, 484, 325, 490, 491, 481, 875,
- 539, 536, 877, 537, 538, 540, 545, 641, 726, 546,
- 547, 548, 551, 559, 552, 666, 553, 554, 555, 637,
- 561, 556, 560, 651, 656, 589, 564, 570, 492, 662,
- 576, 576, 431, 690, 701, 729, 730, 576, 576, 728,
- 438, 393, 877, 576, 733, 576, 727, 736, 394, 393,
- 401, 394, 565, 704, 738, 379, 394, 393, 401, 914,
- 393, 909, 377, 448, 742, 393, 472, 739, 712, 740,
- 743, 744, 747, 749, 923, 637, 431, 486, 750, 751,
- 431, 752, -36, 753, -34, 393, 780, 784, -29, 393,
- 792, 869, 799, 878, 814, 806, 438, 809, 815, 841,
- 880, 856, 766, 888, 897, 393, 899, 889, 900, 910,
- -569, 898, 915, 916, 917, 591, 446, 920, 834, 928,
- 929, 835, 837, 566, 488, 836, 839, 489, 838, 487,
- 711, 416, 393, 878, 616, 816, 881, 874, 918, 924,
- 882, 925, 485, 615, 901, 862, 770, 771, 702, 866,
- 443, 861, 865, 772, 868, 864, 446, 0, 872, 0,
- 0, 870, 0, 0, 0, 871, 0, 0, 0, 0,
+ 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,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 660, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 696, 0,
- 0, 0, 0, 0, 0, 703, 0, 566, 0, 566,
- 0, 0, 0, 0, 393, 0, 393, 0, 393, 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, 616, 0, 0, 0, 0, 0, 0, 0,
- 0, 615, 394, 0, 0, 0, 0, 0, 0, 0,
- 566, 393, 0, 0, 0, 0, 0, 0, 0, 393,
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, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 566,
- 0, 0, 0, 0, 0, 0, 0, 0, 393, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 616, 0, 0,
- 0, 616, 0, 0, 0, 0, 615, 0, 0, 0,
- 615, 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, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 566,
- 0, 0, 0, 0, 0, 0, 0, 0, 393, 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, 0,
- 0, 696, 0, 696, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 616, 616, 0, 616, 0, 401, 0, 0,
- 0, 615, 615, 0, 615, 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, 0, 0, 0, 0,
- 0, 0, 0, 616, 0, 0, 0, 0, 0, 0,
- 0, 0, 615, 0, 0, 0, 0, 0, 0, 616,
- 0, 0, 0, 0, 0, 0, 616, 0, 615, 0,
- 0, 0, 0, 0, 0, 615, 616, 0, 0, 0,
- 616, 0, 0, 0, 0, 615, 616, 0, 0, 615,
- 0, 0, 0, 442, 0, 615, 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, 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, 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, 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, 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, 1, 2,
+ 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,
@@ -1856,200 +1909,156 @@ static const yytype_int16 yytable[] =
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, 499, 500, 0, 0, 0, 0,
+ 323, 324, 0, 0, 502, 503, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 501, 502, 0, 325, 0, 591, 592,
- 0, 0, 0, 0, 593, 503, 504, 505, 506, 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, 507, 508, 509, 510,
- 511, 332, 333, 334, 335, 336, 337, 338, 594, 595,
- 596, 597, 0, 598, 599, 600, 601, 602, 603, 604,
- 605, 606, 607, 339, 340, 341, 342, 343, 344, 512,
- 513, 514, 515, 516, 517, 518, 519, 345, 608, 346,
+ 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,
- 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, 499, 500, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 501, 502, 0, 325, 0,
- 591, 768, 0, 0, 0, 0, 593, 503, 504, 505,
- 506, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 327, 328, 329, 330, 331, 0, 0, 0, 507, 508,
- 509, 510, 511, 332, 333, 334, 335, 336, 337, 338,
- 594, 595, 596, 597, 0, 598, 599, 600, 601, 602,
- 603, 604, 605, 606, 607, 339, 340, 341, 342, 343,
- 344, 512, 513, 514, 515, 516, 517, 518, 519, 345,
- 608, 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, 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, 499, 500,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 501, 502, 0,
- 325, 0, 591, 0, 0, 0, 0, 0, 593, 503,
- 504, 505, 506, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 327, 328, 329, 330, 331, 0, 0, 0,
- 507, 508, 509, 510, 511, 332, 333, 334, 335, 336,
- 337, 338, 594, 595, 596, 597, 0, 598, 599, 600,
- 601, 602, 603, 604, 605, 606, 607, 339, 340, 341,
- 342, 343, 344, 512, 513, 514, 515, 516, 517, 518,
- 519, 345, 608, 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, 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,
- 499, 500, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 501,
- 502, 0, 325, 0, 484, 0, 0, 0, 0, 0,
- 593, 503, 504, 505, 506, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 327, 328, 329, 330, 331, 0,
- 0, 0, 507, 508, 509, 510, 511, 332, 333, 334,
- 335, 336, 337, 338, 594, 595, 596, 597, 0, 598,
- 599, 600, 601, 602, 603, 604, 605, 606, 607, 339,
- 340, 341, 342, 343, 344, 512, 513, 514, 515, 516,
- 517, 518, 519, 345, 608, 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, 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, 499, 500, 0, 0, 0, 0, 0, 0,
+ 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, 501, 502, 0, 325, 0, 0, 0, 0, 0,
- 0, 0, 593, 503, 504, 505, 506, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 327, 328, 329, 330,
- 331, 0, 0, 0, 507, 508, 509, 510, 511, 332,
- 333, 334, 335, 336, 337, 338, 594, 595, 596, 597,
- 0, 598, 599, 600, 601, 602, 603, 604, 605, 606,
- 607, 339, 340, 341, 342, 343, 344, 512, 513, 514,
- 515, 516, 517, 518, 519, 345, 608, 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, 1, 2,
+ 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,
@@ -2082,200 +2091,247 @@ static const yytype_int16 yytable[] =
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, 499, 500, 0, 0, 0, 0,
+ 323, 324, 0, 0, 502, 503, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 501, 502, 0, 325, 0, 0, 0,
- 0, 0, 0, 0, 593, 503, 504, 505, 506, 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, 507, 508, 509, 510,
- 511, 332, 333, 334, 335, 336, 337, 338, 0, 0,
+ 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, 512,
- 513, 514, 515, 516, 517, 518, 519, 345, 0, 346,
+ 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,
- 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, 499, 500, 0, 0,
+ 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,
- 0, 0, 0, 0, 0, 501, 502, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 503, 504, 505,
- 506, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 327, 328, 329, 330, 0, 0, 0, 0, 507, 508,
- 509, 510, 511, 332, 333, 334, 335, 336, 337, 338,
+ 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, 339, 340, 341, 342, 343,
- 344, 512, 513, 514, 515, 516, 517, 518, 519, 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, 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, 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,
- 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, 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, 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, 327, 328, 329, 330, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 332, 333, 334,
- 335, 336, 337, 338, 594, 0, 0, 597, 0, 598,
- 599, 0, 0, 602, 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, 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, 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, 0, 435, 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, 436, 332,
- 333, 334, 335, 336, 337, 338, 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, 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, 1, 2,
+ 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,
@@ -2310,7 +2366,7 @@ static const yytype_int16 yytable[] =
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, 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,
@@ -2321,187 +2377,143 @@ static const yytype_int16 yytable[] =
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,
- 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, 707, 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, 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,
+ 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, 820, 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, 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, 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, 855, 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, 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, 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, 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, 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, 2, 3,
+ 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,
@@ -2534,16 +2546,16 @@ static const yytype_int16 yytable[] =
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, 499, 500, 0, 0, 0, 0, 0,
+ 0, 0, 0, 502, 503, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 501, 502, 0, 0, 0, 636, 775, 0,
- 0, 0, 0, 0, 503, 504, 505, 506, 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, 507, 508, 509, 510, 511,
+ 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, 512, 513,
- 514, 515, 516, 517, 518, 519, 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,
@@ -2577,16 +2589,16 @@ 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, 0, 0, 0, 0, 0, 0,
- 321, 0, 0, 0, 0, 0, 499, 500, 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, 501, 502, 0, 0, 0,
- 636, 886, 0, 0, 0, 0, 0, 503, 504, 505,
- 506, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 507, 508,
- 509, 510, 511, 332, 0, 0, 0, 0, 337, 338,
+ 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,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 512, 513, 514, 515, 516, 517, 518, 519, 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,
@@ -2620,17 +2632,17 @@ static const yytype_int16 yytable[] =
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, 499,
- 500, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 501, 502,
- 0, 0, 575, 0, 0, 0, 0, 0, 0, 0,
- 503, 504, 505, 506, 0, 0, 0, 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, 507, 508, 509, 510, 511, 332, 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, 512, 513, 514, 515, 516, 517,
- 518, 519, 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,
@@ -2664,16 +2676,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,
0, 0, 0, 0, 0, 0, 321, 0, 0, 0,
- 0, 0, 499, 500, 0, 0, 0, 0, 0, 0,
+ 0, 0, 502, 503, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 501, 502, 0, 0, 0, 636, 0, 0, 0,
- 0, 0, 0, 503, 504, 505, 506, 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, 507, 508, 509, 510, 511, 332,
+ 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, 512, 513, 514,
- 515, 516, 517, 518, 519, 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,
@@ -2707,16 +2719,16 @@ 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, 0, 0, 0, 0, 0, 0, 321,
- 0, 0, 0, 0, 0, 499, 500, 0, 0, 0,
+ 0, 0, 0, 0, 0, 502, 503, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 501, 502, 0, 0, 734, 0,
- 0, 0, 0, 0, 0, 0, 503, 504, 505, 506,
+ 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, 507, 508, 509,
- 510, 511, 332, 0, 0, 0, 0, 337, 338, 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,
- 512, 513, 514, 515, 516, 517, 518, 519, 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,
@@ -2750,17 +2762,17 @@ static const yytype_int16 yytable[] =
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, 499, 500,
+ 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, 501, 502, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 745, 503,
- 504, 505, 506, 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,
- 507, 508, 509, 510, 511, 332, 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, 512, 513, 514, 515, 516, 517, 518,
- 519, 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,
@@ -2794,16 +2806,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, 0,
0, 0, 0, 0, 0, 321, 0, 0, 0, 0,
- 0, 499, 500, 0, 0, 0, 0, 0, 0, 0,
+ 0, 502, 503, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 501, 502, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 503, 504, 505, 506, 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, 507, 508, 509, 510, 511, 332, 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, 512, 513, 514, 515,
- 516, 517, 518, 519, 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,
@@ -2837,16 +2849,16 @@ static const yytype_int16 yytable[] =
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, 499, 500, 0, 0, 0, 0,
+ 0, 0, 0, 0, 502, 503, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 501, 502, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 503, 504, 505, 506, 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, 507, 508, 509, 510,
- 511, 332, 0, 0, 0, 0, 337, 654, 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, 512,
- 513, 514, 515, 516, 517, 518, 519, 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,
@@ -2880,16 +2892,16 @@ 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, 0, 0, 0, 0, 0,
- 0, 321, 0, 0, 0, 0, 0, 499, 500, 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, 501, 502, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 503, 504,
- 505, 506, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 507,
- 508, 509, 510, 694, 332, 0, 0, 0, 0, 337,
+ 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, 512, 513, 514, 515, 516, 517, 518, 519,
+ 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,
@@ -2935,145 +2947,191 @@ static const yytype_int16 yytable[] =
static const yytype_int16 yycheck[] =
{
- 0, 401, 0, 481, 401, 382, 406, 0, 493, 0,
- 634, 502, 636, 622, 0, 639, 542, 547, 737, 567,
- 434, 439, 552, 569, 401, 348, 440, 359, 390, 406,
- 413, 561, 558, 348, 331, 332, 336, 899, 385, 348,
- 570, 348, 351, 528, 906, 356, 349, 353, 351, 426,
- 374, 375, 376, 385, 916, 358, 351, 368, 381, 382,
- 383, 384, 409, 481, 359, 329, 330, 382, 430, 547,
- 367, 368, 372, 382, 552, 382, 490, 491, 351, 385,
- 558, 499, 500, 561, 446, 349, 359, 351, 351, 349,
- 356, 355, 570, 359, 640, 358, 473, 338, 339, 340,
- 341, 342, 343, 344, 345, 346, 347, 361, 540, 363,
- 601, 589, 603, 531, 546, 351, 548, 358, 351, 551,
- 350, 553, 358, 555, 556, 358, 356, 353, 560, 547,
- 356, 350, 741, 359, 552, 350, 350, 356, 350, 350,
- 558, 356, 356, 561, 356, 356, 354, 350, 356, 634,
- 774, 636, 570, 356, 639, 351, 350, 540, 649, 350,
- 350, 709, 356, 350, 350, 356, 356, 349, 653, 356,
- 356, 589, 349, 556, 408, 409, 410, 411, 412, 413,
- 414, 350, 350, 350, 359, 350, 349, 356, 356, 356,
- 567, 356, 569, 350, 350, 356, 350, 350, 350, 356,
- 356, 920, 356, 565, 356, 350, 350, 350, 350, 350,
- 350, 356, 356, 356, 356, 356, 356, 350, 352, 349,
- 352, 352, 356, 356, 356, 356, 381, 382, 383, 384,
- 854, 779, 632, 842, 349, 632, 720, 721, 722, 723,
- 658, 327, 328, 382, 382, 382, 385, 385, 385, 349,
- 356, 367, 743, 359, 382, 632, 747, 385, 382, 382,
- 349, 385, 385, 640, 382, 333, 334, 385, 798, 799,
- 382, 382, 349, 385, 385, 805, 806, 356, 357, 382,
- 765, 766, 385, 349, 382, 811, 910, 385, 382, 774,
- 704, 385, 364, 365, 366, 713, 714, 715, 716, 717,
- 718, 719, 720, 721, 722, 723, 724, 725, 726, 727,
- 728, 729, 730, 731, 385, 356, 356, 926, 359, 359,
- 798, 799, 356, 356, 359, 359, 359, 805, 806, 356,
- 357, 385, 709, 811, 385, 813, 716, 717, 353, 718,
- 719, 385, 724, 725, 353, 351, 385, 385, 351, 840,
- 358, 350, 843, 385, 359, 356, 358, 385, 371, 356,
- 356, 356, 356, 350, 356, 385, 356, 356, 356, 854,
- 349, 356, 356, 350, 349, 351, 359, 358, 349, 351,
- 798, 799, 382, 348, 352, 335, 337, 805, 806, 369,
- 390, 382, 883, 811, 352, 813, 370, 354, 398, 390,
- 398, 401, 779, 385, 349, 398, 406, 398, 406, 900,
- 401, 896, 398, 406, 349, 406, 416, 359, 385, 359,
- 349, 359, 349, 357, 915, 910, 426, 425, 359, 359,
- 430, 359, 349, 359, 349, 426, 385, 385, 350, 430,
- 358, 348, 356, 843, 350, 356, 446, 356, 350, 352,
- 393, 352, 356, 348, 354, 446, 350, 382, 349, 358,
- 353, 385, 359, 350, 397, 353, 843, 353, 726, 359,
- 354, 727, 729, 473, 430, 728, 731, 430, 730, 426,
- 572, 331, 473, 883, 484, 703, 845, 818, 905, 916,
- 845, 917, 424, 484, 883, 796, 632, 632, 563, 803,
- 398, 794, 801, 632, 806, 799, 883, -1, 813, -1,
- -1, 809, -1, -1, -1, 811, -1, -1, -1, -1,
+ 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, 536, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 558, -1,
- -1, -1, -1, -1, -1, 565, -1, 567, -1, 569,
- -1, -1, -1, -1, 565, -1, 567, -1, 569, -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, 622, -1, -1, -1, -1, -1, -1, -1,
- -1, 622, 632, -1, -1, -1, -1, -1, -1, -1,
- 640, 632, -1, -1, -1, -1, -1, -1, -1, 640,
-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, 709,
- -1, -1, -1, -1, -1, -1, -1, -1, 709, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 737, -1, -1,
- -1, 741, -1, -1, -1, -1, 737, -1, -1, -1,
- 741, -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, 779,
- -1, -1, -1, -1, -1, -1, -1, -1, 779, -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, 811, -1, 813, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 842, 843, -1, 845, -1, 845, -1, -1,
- -1, 842, 843, -1, 845, -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, 883, -1, -1, -1, -1, -1, -1,
- -1, -1, 883, -1, -1, -1, -1, -1, -1, 899,
- -1, -1, -1, -1, -1, -1, 906, -1, 899, -1,
- -1, -1, -1, -1, -1, 906, 916, -1, -1, -1,
- 920, -1, -1, -1, -1, 916, 926, -1, -1, 920,
- -1, -1, -1, 0, -1, 926, 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, 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, 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, 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, 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, 3, 4,
+ -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,
@@ -3119,187 +3177,143 @@ static const yytype_int16 yycheck[] =
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,
- 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, 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, 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, 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,
+ 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, 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, 3, 4,
+ -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,
@@ -3345,187 +3359,234 @@ static const yytype_int16 yycheck[] =
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,
- 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,
+ 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,
- -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,
+ 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, 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, 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, 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,
- 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, 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, 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, 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, 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, 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, -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, 351, -1, -1, -1, -1, -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, 3, 4,
+ -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,
@@ -3560,7 +3621,7 @@ static const yytype_int16 yycheck[] =
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, 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,
@@ -3571,187 +3632,143 @@ static const yytype_int16 yycheck[] =
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,
- 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, 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,
+ 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, 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, 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, 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, 354, -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, 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, 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, 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, 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, 4, 5,
+ -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,
@@ -4224,136 +4241,137 @@ static const yytype_int16 yystos[] =
409, 410, 411, 412, 413, 422, 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, 486, 487, 490,
- 491, 492, 493, 497, 498, 499, 500, 501, 502, 505,
- 506, 507, 508, 509, 511, 516, 517, 518, 559, 560,
- 561, 563, 570, 574, 575, 580, 583, 349, 349, 349,
- 349, 349, 349, 349, 349, 351, 517, 353, 385, 349,
- 349, 359, 385, 359, 562, 350, 356, 494, 495, 496,
- 506, 511, 356, 359, 385, 359, 385, 507, 511, 367,
- 513, 514, 0, 560, 491, 499, 506, 359, 490, 385,
- 566, 567, 584, 585, 382, 385, 566, 382, 566, 382,
- 566, 382, 566, 382, 566, 566, 584, 382, 566, 385,
- 564, 565, 511, 520, 353, 385, 409, 503, 504, 385,
- 510, 351, 359, 512, 353, 538, 563, 495, 494, 496,
- 385, 385, 349, 358, 512, 353, 356, 359, 489, 329,
- 330, 348, 349, 360, 361, 362, 363, 381, 382, 383,
- 384, 385, 414, 415, 416, 417, 418, 419, 420, 421,
- 456, 457, 458, 460, 461, 462, 463, 464, 465, 466,
- 467, 468, 509, 511, 515, 512, 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, 506, 511, 521, 522, 519,
- 358, 350, 356, 350, 356, 352, 467, 469, 470, 471,
- 472, 473, 474, 475, 476, 477, 478, 479, 480, 351,
- 359, 353, 354, 359, 393, 394, 395, 396, 398, 399,
- 400, 401, 402, 403, 404, 405, 406, 407, 423, 467,
- 480, 482, 484, 486, 490, 509, 511, 527, 528, 529,
- 530, 531, 539, 540, 541, 542, 545, 546, 549, 550,
- 551, 558, 563, 512, 358, 512, 353, 482, 525, 358,
- 488, 385, 356, 359, 467, 467, 484, 329, 330, 351,
- 355, 350, 350, 356, 392, 482, 349, 467, 356, 368,
- 563, 348, 351, 382, 567, 584, 385, 585, 348, 381,
- 382, 383, 384, 571, 572, 382, 480, 485, 573, 382,
- 381, 382, 383, 384, 576, 577, 382, 485, 578, 382,
- 348, 579, 382, 584, 385, 485, 511, 581, 582, 382,
- 485, 352, 565, 511, 385, 523, 524, 354, 522, 521,
- 485, 504, 385, 364, 365, 366, 361, 363, 327, 328,
- 331, 332, 367, 368, 333, 334, 371, 370, 369, 335,
- 337, 336, 372, 352, 352, 480, 354, 532, 349, 359,
- 359, 553, 349, 349, 359, 359, 484, 349, 484, 357,
- 359, 359, 359, 359, 338, 339, 340, 341, 342, 343,
- 344, 345, 346, 347, 358, 483, 356, 359, 354, 528,
- 542, 546, 551, 525, 358, 354, 525, 526, 525, 521,
- 385, 350, 459, 484, 385, 482, 467, 348, 382, 568,
- 569, 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, 523, 512, 356, 359,
- 354, 467, 467, 467, 469, 469, 470, 470, 471, 471,
- 471, 471, 472, 472, 473, 474, 475, 476, 477, 478,
- 481, 352, 539, 552, 528, 554, 484, 359, 484, 357,
- 482, 482, 525, 354, 356, 354, 352, 352, 356, 352,
- 356, 572, 571, 485, 573, 577, 576, 485, 578, 348,
- 579, 581, 582, 359, 524, 484, 533, 484, 499, 544,
- 393, 527, 540, 555, 350, 350, 354, 525, 348, 382,
- 350, 350, 350, 350, 350, 350, 357, 354, 385, 350,
- 349, 544, 556, 557, 535, 536, 537, 543, 547, 482,
- 358, 529, 534, 538, 484, 359, 350, 397, 531, 529,
- 353, 525, 350, 484, 534, 535, 539, 548, 359, 354
+ 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
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_int16 yyr1[] =
{
- 0, 455, 456, 457, 457, 457, 457, 457, 457, 457,
- 457, 457, 457, 457, 457, 457, 457, 457, 458, 458,
- 458, 458, 458, 458, 459, 460, 461, 462, 462, 463,
- 463, 464, 464, 465, 466, 466, 466, 467, 467, 467,
- 467, 468, 468, 468, 468, 469, 469, 469, 469, 470,
- 470, 470, 471, 471, 471, 472, 472, 472, 472, 472,
- 473, 473, 473, 474, 474, 475, 475, 476, 476, 477,
- 477, 478, 478, 479, 479, 480, 481, 480, 482, 482,
- 483, 483, 483, 483, 483, 483, 483, 483, 483, 483,
- 483, 484, 484, 485, 486, 486, 486, 486, 486, 486,
- 486, 486, 486, 486, 486, 488, 487, 489, 489, 490,
- 490, 490, 490, 491, 491, 492, 492, 493, 494, 494,
- 495, 495, 495, 495, 496, 497, 497, 497, 497, 497,
- 498, 498, 498, 498, 498, 499, 499, 500, 501, 501,
- 501, 501, 501, 501, 501, 501, 502, 503, 503, 504,
- 504, 504, 505, 506, 506, 507, 507, 507, 507, 507,
- 507, 507, 507, 507, 507, 507, 508, 508, 508, 508,
- 508, 508, 508, 508, 508, 508, 508, 508, 508, 508,
- 508, 508, 508, 508, 508, 508, 508, 508, 508, 508,
- 508, 508, 508, 508, 508, 508, 508, 508, 508, 508,
- 508, 509, 510, 510, 511, 511, 512, 512, 512, 512,
- 513, 513, 514, 515, 515, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 516, 516, 516, 516, 516, 516, 516, 516, 516, 516,
- 517, 517, 517, 519, 518, 520, 518, 521, 521, 522,
- 522, 523, 523, 524, 524, 525, 525, 525, 525, 526,
- 526, 527, 528, 528, 529, 529, 529, 529, 529, 529,
- 529, 529, 530, 531, 532, 533, 531, 534, 534, 536,
- 535, 537, 535, 538, 538, 539, 539, 540, 540, 541,
- 541, 542, 543, 543, 544, 544, 545, 545, 547, 546,
- 548, 548, 549, 549, 550, 550, 552, 551, 553, 551,
- 554, 551, 555, 555, 556, 556, 557, 557, 558, 558,
- 558, 558, 558, 558, 558, 558, 559, 559, 560, 560,
- 560, 562, 561, 563, 564, 564, 565, 565, 566, 566,
- 567, 567, 568, 568, 569, 569, 570, 570, 570, 570,
- 570, 570, 571, 571, 572, 572, 572, 572, 572, 573,
- 573, 574, 574, 575, 575, 575, 575, 575, 575, 575,
- 575, 576, 576, 577, 577, 577, 577, 578, 578, 579,
- 579, 580, 580, 580, 580, 581, 581, 582, 582, 583,
- 583, 584, 584, 585, 585
+ 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
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
@@ -4373,14 +4391,14 @@ static const yytype_int8 yyr2[] =
3, 3, 4, 1, 1, 2, 3, 3, 2, 3,
2, 1, 2, 1, 1, 1, 3, 4, 6, 5,
1, 2, 3, 5, 4, 1, 2, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 4, 1, 3, 1,
- 3, 1, 1, 1, 2, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 4, 1,
+ 3, 1, 3, 1, 1, 1, 2, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 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, 3, 2, 3, 2, 3, 3, 4,
- 1, 0, 3, 1, 3, 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, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -4412,22 +4430,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, 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, 1, 4,
- 6, 1, 3, 3, 3
+ 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
};
@@ -5177,7 +5195,7 @@ yyreduce:
{
(yyval.interm.intermTypedNode) = parseContext.handleVariable((yyvsp[0].lex).loc, (yyvsp[0].lex).symbol, (yyvsp[0].lex).string);
}
-#line 5181 "MachineIndependent/glslang_tab.cpp"
+#line 5199 "MachineIndependent/glslang_tab.cpp"
break;
case 3: /* primary_expression: variable_identifier */
@@ -5185,7 +5203,7 @@ yyreduce:
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
-#line 5189 "MachineIndependent/glslang_tab.cpp"
+#line 5207 "MachineIndependent/glslang_tab.cpp"
break;
case 4: /* primary_expression: LEFT_PAREN expression RIGHT_PAREN */
@@ -5195,7 +5213,7 @@ yyreduce:
if ((yyval.interm.intermTypedNode)->getAsConstantUnion())
(yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression();
}
-#line 5199 "MachineIndependent/glslang_tab.cpp"
+#line 5217 "MachineIndependent/glslang_tab.cpp"
break;
case 5: /* primary_expression: FLOATCONSTANT */
@@ -5203,7 +5221,7 @@ yyreduce:
{
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true);
}
-#line 5207 "MachineIndependent/glslang_tab.cpp"
+#line 5225 "MachineIndependent/glslang_tab.cpp"
break;
case 6: /* primary_expression: INTCONSTANT */
@@ -5211,7 +5229,7 @@ yyreduce:
{
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true);
}
-#line 5215 "MachineIndependent/glslang_tab.cpp"
+#line 5233 "MachineIndependent/glslang_tab.cpp"
break;
case 7: /* primary_expression: UINTCONSTANT */
@@ -5220,7 +5238,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 5224 "MachineIndependent/glslang_tab.cpp"
+#line 5242 "MachineIndependent/glslang_tab.cpp"
break;
case 8: /* primary_expression: BOOLCONSTANT */
@@ -5228,7 +5246,7 @@ yyreduce:
{
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true);
}
-#line 5232 "MachineIndependent/glslang_tab.cpp"
+#line 5250 "MachineIndependent/glslang_tab.cpp"
break;
case 9: /* primary_expression: STRING_LITERAL */
@@ -5236,7 +5254,7 @@ yyreduce:
{
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true);
}
-#line 5240 "MachineIndependent/glslang_tab.cpp"
+#line 5258 "MachineIndependent/glslang_tab.cpp"
break;
case 10: /* primary_expression: INT32CONSTANT */
@@ -5245,7 +5263,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 5249 "MachineIndependent/glslang_tab.cpp"
+#line 5267 "MachineIndependent/glslang_tab.cpp"
break;
case 11: /* primary_expression: UINT32CONSTANT */
@@ -5254,7 +5272,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 5258 "MachineIndependent/glslang_tab.cpp"
+#line 5276 "MachineIndependent/glslang_tab.cpp"
break;
case 12: /* primary_expression: INT64CONSTANT */
@@ -5263,7 +5281,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 5267 "MachineIndependent/glslang_tab.cpp"
+#line 5285 "MachineIndependent/glslang_tab.cpp"
break;
case 13: /* primary_expression: UINT64CONSTANT */
@@ -5272,7 +5290,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 5276 "MachineIndependent/glslang_tab.cpp"
+#line 5294 "MachineIndependent/glslang_tab.cpp"
break;
case 14: /* primary_expression: INT16CONSTANT */
@@ -5281,7 +5299,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 5285 "MachineIndependent/glslang_tab.cpp"
+#line 5303 "MachineIndependent/glslang_tab.cpp"
break;
case 15: /* primary_expression: UINT16CONSTANT */
@@ -5290,7 +5308,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 5294 "MachineIndependent/glslang_tab.cpp"
+#line 5312 "MachineIndependent/glslang_tab.cpp"
break;
case 16: /* primary_expression: DOUBLECONSTANT */
@@ -5301,7 +5319,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 5305 "MachineIndependent/glslang_tab.cpp"
+#line 5323 "MachineIndependent/glslang_tab.cpp"
break;
case 17: /* primary_expression: FLOAT16CONSTANT */
@@ -5310,7 +5328,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 5314 "MachineIndependent/glslang_tab.cpp"
+#line 5332 "MachineIndependent/glslang_tab.cpp"
break;
case 18: /* postfix_expression: primary_expression */
@@ -5318,7 +5336,7 @@ yyreduce:
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
-#line 5322 "MachineIndependent/glslang_tab.cpp"
+#line 5340 "MachineIndependent/glslang_tab.cpp"
break;
case 19: /* postfix_expression: postfix_expression LEFT_BRACKET integer_expression RIGHT_BRACKET */
@@ -5326,7 +5344,7 @@ yyreduce:
{
(yyval.interm.intermTypedNode) = parseContext.handleBracketDereference((yyvsp[-2].lex).loc, (yyvsp[-3].interm.intermTypedNode), (yyvsp[-1].interm.intermTypedNode));
}
-#line 5330 "MachineIndependent/glslang_tab.cpp"
+#line 5348 "MachineIndependent/glslang_tab.cpp"
break;
case 20: /* postfix_expression: function_call */
@@ -5334,7 +5352,7 @@ yyreduce:
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
-#line 5338 "MachineIndependent/glslang_tab.cpp"
+#line 5356 "MachineIndependent/glslang_tab.cpp"
break;
case 21: /* postfix_expression: postfix_expression DOT IDENTIFIER */
@@ -5342,7 +5360,7 @@ yyreduce:
{
(yyval.interm.intermTypedNode) = parseContext.handleDotDereference((yyvsp[0].lex).loc, (yyvsp[-2].interm.intermTypedNode), *(yyvsp[0].lex).string);
}
-#line 5346 "MachineIndependent/glslang_tab.cpp"
+#line 5364 "MachineIndependent/glslang_tab.cpp"
break;
case 22: /* postfix_expression: postfix_expression INC_OP */
@@ -5352,7 +5370,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 5356 "MachineIndependent/glslang_tab.cpp"
+#line 5374 "MachineIndependent/glslang_tab.cpp"
break;
case 23: /* postfix_expression: postfix_expression DEC_OP */
@@ -5362,7 +5380,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 5366 "MachineIndependent/glslang_tab.cpp"
+#line 5384 "MachineIndependent/glslang_tab.cpp"
break;
case 24: /* integer_expression: expression */
@@ -5371,7 +5389,7 @@ yyreduce:
parseContext.integerCheck((yyvsp[0].interm.intermTypedNode), "[]");
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
-#line 5375 "MachineIndependent/glslang_tab.cpp"
+#line 5393 "MachineIndependent/glslang_tab.cpp"
break;
case 25: /* function_call: function_call_or_method */
@@ -5380,7 +5398,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 5384 "MachineIndependent/glslang_tab.cpp"
+#line 5402 "MachineIndependent/glslang_tab.cpp"
break;
case 26: /* function_call_or_method: function_call_generic */
@@ -5388,7 +5406,7 @@ yyreduce:
{
(yyval.interm) = (yyvsp[0].interm);
}
-#line 5392 "MachineIndependent/glslang_tab.cpp"
+#line 5410 "MachineIndependent/glslang_tab.cpp"
break;
case 27: /* function_call_generic: function_call_header_with_parameters RIGHT_PAREN */
@@ -5397,7 +5415,7 @@ yyreduce:
(yyval.interm) = (yyvsp[-1].interm);
(yyval.interm).loc = (yyvsp[0].lex).loc;
}
-#line 5401 "MachineIndependent/glslang_tab.cpp"
+#line 5419 "MachineIndependent/glslang_tab.cpp"
break;
case 28: /* function_call_generic: function_call_header_no_parameters RIGHT_PAREN */
@@ -5406,7 +5424,7 @@ yyreduce:
(yyval.interm) = (yyvsp[-1].interm);
(yyval.interm).loc = (yyvsp[0].lex).loc;
}
-#line 5410 "MachineIndependent/glslang_tab.cpp"
+#line 5428 "MachineIndependent/glslang_tab.cpp"
break;
case 29: /* function_call_header_no_parameters: function_call_header VOID */
@@ -5414,7 +5432,7 @@ yyreduce:
{
(yyval.interm) = (yyvsp[-1].interm);
}
-#line 5418 "MachineIndependent/glslang_tab.cpp"
+#line 5436 "MachineIndependent/glslang_tab.cpp"
break;
case 30: /* function_call_header_no_parameters: function_call_header */
@@ -5422,7 +5440,7 @@ yyreduce:
{
(yyval.interm) = (yyvsp[0].interm);
}
-#line 5426 "MachineIndependent/glslang_tab.cpp"
+#line 5444 "MachineIndependent/glslang_tab.cpp"
break;
case 31: /* function_call_header_with_parameters: function_call_header assignment_expression */
@@ -5434,7 +5452,7 @@ yyreduce:
(yyval.interm).function = (yyvsp[-1].interm).function;
(yyval.interm).intermNode = (yyvsp[0].interm.intermTypedNode);
}
-#line 5438 "MachineIndependent/glslang_tab.cpp"
+#line 5456 "MachineIndependent/glslang_tab.cpp"
break;
case 32: /* function_call_header_with_parameters: function_call_header_with_parameters COMMA assignment_expression */
@@ -5446,7 +5464,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 5450 "MachineIndependent/glslang_tab.cpp"
+#line 5468 "MachineIndependent/glslang_tab.cpp"
break;
case 33: /* function_call_header: function_identifier LEFT_PAREN */
@@ -5454,7 +5472,7 @@ yyreduce:
{
(yyval.interm) = (yyvsp[-1].interm);
}
-#line 5458 "MachineIndependent/glslang_tab.cpp"
+#line 5476 "MachineIndependent/glslang_tab.cpp"
break;
case 34: /* function_identifier: type_specifier */
@@ -5464,7 +5482,7 @@ yyreduce:
(yyval.interm).intermNode = 0;
(yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type));
}
-#line 5468 "MachineIndependent/glslang_tab.cpp"
+#line 5486 "MachineIndependent/glslang_tab.cpp"
break;
case 35: /* function_identifier: postfix_expression */
@@ -5496,7 +5514,7 @@ yyreduce:
(yyval.interm).function = new TFunction(empty, TType(EbtVoid), EOpNull);
}
}
-#line 5500 "MachineIndependent/glslang_tab.cpp"
+#line 5518 "MachineIndependent/glslang_tab.cpp"
break;
case 36: /* function_identifier: non_uniform_qualifier */
@@ -5506,7 +5524,7 @@ yyreduce:
(yyval.interm).intermNode = 0;
(yyval.interm).function = parseContext.handleConstructorCall((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type));
}
-#line 5510 "MachineIndependent/glslang_tab.cpp"
+#line 5528 "MachineIndependent/glslang_tab.cpp"
break;
case 37: /* unary_expression: postfix_expression */
@@ -5517,7 +5535,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 5521 "MachineIndependent/glslang_tab.cpp"
+#line 5539 "MachineIndependent/glslang_tab.cpp"
break;
case 38: /* unary_expression: INC_OP unary_expression */
@@ -5526,7 +5544,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 5530 "MachineIndependent/glslang_tab.cpp"
+#line 5548 "MachineIndependent/glslang_tab.cpp"
break;
case 39: /* unary_expression: DEC_OP unary_expression */
@@ -5535,7 +5553,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 5539 "MachineIndependent/glslang_tab.cpp"
+#line 5557 "MachineIndependent/glslang_tab.cpp"
break;
case 40: /* unary_expression: unary_operator unary_expression */
@@ -5556,38 +5574,38 @@ yyreduce:
(yyval.interm.intermTypedNode)->getAsConstantUnion()->setExpression();
}
}
-#line 5560 "MachineIndependent/glslang_tab.cpp"
+#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 5566 "MachineIndependent/glslang_tab.cpp"
+#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 5572 "MachineIndependent/glslang_tab.cpp"
+#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; }
-#line 5578 "MachineIndependent/glslang_tab.cpp"
+#line 5596 "MachineIndependent/glslang_tab.cpp"
break;
case 44: /* unary_operator: TILDE */
#line 630 "MachineIndependent/glslang.y"
{ (yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpBitwiseNot;
parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise not"); }
-#line 5585 "MachineIndependent/glslang_tab.cpp"
+#line 5603 "MachineIndependent/glslang_tab.cpp"
break;
case 45: /* multiplicative_expression: unary_expression */
#line 636 "MachineIndependent/glslang.y"
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
-#line 5591 "MachineIndependent/glslang_tab.cpp"
+#line 5609 "MachineIndependent/glslang_tab.cpp"
break;
case 46: /* multiplicative_expression: multiplicative_expression STAR unary_expression */
@@ -5597,7 +5615,7 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
-#line 5601 "MachineIndependent/glslang_tab.cpp"
+#line 5619 "MachineIndependent/glslang_tab.cpp"
break;
case 47: /* multiplicative_expression: multiplicative_expression SLASH unary_expression */
@@ -5607,7 +5625,7 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
-#line 5611 "MachineIndependent/glslang_tab.cpp"
+#line 5629 "MachineIndependent/glslang_tab.cpp"
break;
case 48: /* multiplicative_expression: multiplicative_expression PERCENT unary_expression */
@@ -5618,13 +5636,13 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
-#line 5622 "MachineIndependent/glslang_tab.cpp"
+#line 5640 "MachineIndependent/glslang_tab.cpp"
break;
case 49: /* additive_expression: multiplicative_expression */
#line 656 "MachineIndependent/glslang.y"
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
-#line 5628 "MachineIndependent/glslang_tab.cpp"
+#line 5646 "MachineIndependent/glslang_tab.cpp"
break;
case 50: /* additive_expression: additive_expression PLUS multiplicative_expression */
@@ -5634,7 +5652,7 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
-#line 5638 "MachineIndependent/glslang_tab.cpp"
+#line 5656 "MachineIndependent/glslang_tab.cpp"
break;
case 51: /* additive_expression: additive_expression DASH multiplicative_expression */
@@ -5644,13 +5662,13 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
-#line 5648 "MachineIndependent/glslang_tab.cpp"
+#line 5666 "MachineIndependent/glslang_tab.cpp"
break;
case 52: /* shift_expression: additive_expression */
#line 670 "MachineIndependent/glslang.y"
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
-#line 5654 "MachineIndependent/glslang_tab.cpp"
+#line 5672 "MachineIndependent/glslang_tab.cpp"
break;
case 53: /* shift_expression: shift_expression LEFT_OP additive_expression */
@@ -5661,7 +5679,7 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
-#line 5665 "MachineIndependent/glslang_tab.cpp"
+#line 5683 "MachineIndependent/glslang_tab.cpp"
break;
case 54: /* shift_expression: shift_expression RIGHT_OP additive_expression */
@@ -5672,13 +5690,13 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
-#line 5676 "MachineIndependent/glslang_tab.cpp"
+#line 5694 "MachineIndependent/glslang_tab.cpp"
break;
case 55: /* relational_expression: shift_expression */
#line 686 "MachineIndependent/glslang.y"
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
-#line 5682 "MachineIndependent/glslang_tab.cpp"
+#line 5700 "MachineIndependent/glslang_tab.cpp"
break;
case 56: /* relational_expression: relational_expression LEFT_ANGLE shift_expression */
@@ -5688,7 +5706,7 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
-#line 5692 "MachineIndependent/glslang_tab.cpp"
+#line 5710 "MachineIndependent/glslang_tab.cpp"
break;
case 57: /* relational_expression: relational_expression RIGHT_ANGLE shift_expression */
@@ -5698,7 +5716,7 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
-#line 5702 "MachineIndependent/glslang_tab.cpp"
+#line 5720 "MachineIndependent/glslang_tab.cpp"
break;
case 58: /* relational_expression: relational_expression LE_OP shift_expression */
@@ -5708,7 +5726,7 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
-#line 5712 "MachineIndependent/glslang_tab.cpp"
+#line 5730 "MachineIndependent/glslang_tab.cpp"
break;
case 59: /* relational_expression: relational_expression GE_OP shift_expression */
@@ -5718,13 +5736,13 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
-#line 5722 "MachineIndependent/glslang_tab.cpp"
+#line 5740 "MachineIndependent/glslang_tab.cpp"
break;
case 60: /* equality_expression: relational_expression */
#line 710 "MachineIndependent/glslang.y"
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
-#line 5728 "MachineIndependent/glslang_tab.cpp"
+#line 5746 "MachineIndependent/glslang_tab.cpp"
break;
case 61: /* equality_expression: equality_expression EQ_OP relational_expression */
@@ -5738,7 +5756,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 5760 "MachineIndependent/glslang_tab.cpp"
break;
case 62: /* equality_expression: equality_expression NE_OP relational_expression */
@@ -5752,13 +5770,13 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
-#line 5756 "MachineIndependent/glslang_tab.cpp"
+#line 5774 "MachineIndependent/glslang_tab.cpp"
break;
case 63: /* and_expression: equality_expression */
#line 732 "MachineIndependent/glslang.y"
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
-#line 5762 "MachineIndependent/glslang_tab.cpp"
+#line 5780 "MachineIndependent/glslang_tab.cpp"
break;
case 64: /* and_expression: and_expression AMPERSAND equality_expression */
@@ -5769,13 +5787,13 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
-#line 5773 "MachineIndependent/glslang_tab.cpp"
+#line 5791 "MachineIndependent/glslang_tab.cpp"
break;
case 65: /* exclusive_or_expression: and_expression */
#line 742 "MachineIndependent/glslang.y"
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
-#line 5779 "MachineIndependent/glslang_tab.cpp"
+#line 5797 "MachineIndependent/glslang_tab.cpp"
break;
case 66: /* exclusive_or_expression: exclusive_or_expression CARET and_expression */
@@ -5786,13 +5804,13 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
-#line 5790 "MachineIndependent/glslang_tab.cpp"
+#line 5808 "MachineIndependent/glslang_tab.cpp"
break;
case 67: /* inclusive_or_expression: exclusive_or_expression */
#line 752 "MachineIndependent/glslang.y"
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
-#line 5796 "MachineIndependent/glslang_tab.cpp"
+#line 5814 "MachineIndependent/glslang_tab.cpp"
break;
case 68: /* inclusive_or_expression: inclusive_or_expression VERTICAL_BAR exclusive_or_expression */
@@ -5803,13 +5821,13 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
-#line 5807 "MachineIndependent/glslang_tab.cpp"
+#line 5825 "MachineIndependent/glslang_tab.cpp"
break;
case 69: /* logical_and_expression: inclusive_or_expression */
#line 762 "MachineIndependent/glslang.y"
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
-#line 5813 "MachineIndependent/glslang_tab.cpp"
+#line 5831 "MachineIndependent/glslang_tab.cpp"
break;
case 70: /* logical_and_expression: logical_and_expression AND_OP inclusive_or_expression */
@@ -5819,13 +5837,13 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
-#line 5823 "MachineIndependent/glslang_tab.cpp"
+#line 5841 "MachineIndependent/glslang_tab.cpp"
break;
case 71: /* logical_xor_expression: logical_and_expression */
#line 771 "MachineIndependent/glslang.y"
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
-#line 5829 "MachineIndependent/glslang_tab.cpp"
+#line 5847 "MachineIndependent/glslang_tab.cpp"
break;
case 72: /* logical_xor_expression: logical_xor_expression XOR_OP logical_and_expression */
@@ -5835,13 +5853,13 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
-#line 5839 "MachineIndependent/glslang_tab.cpp"
+#line 5857 "MachineIndependent/glslang_tab.cpp"
break;
case 73: /* logical_or_expression: logical_xor_expression */
#line 780 "MachineIndependent/glslang.y"
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
-#line 5845 "MachineIndependent/glslang_tab.cpp"
+#line 5863 "MachineIndependent/glslang_tab.cpp"
break;
case 74: /* logical_or_expression: logical_or_expression OR_OP logical_xor_expression */
@@ -5851,13 +5869,13 @@ yyreduce:
if ((yyval.interm.intermTypedNode) == 0)
(yyval.interm.intermTypedNode) = parseContext.intermediate.addConstantUnion(false, (yyvsp[-1].lex).loc);
}
-#line 5855 "MachineIndependent/glslang_tab.cpp"
+#line 5873 "MachineIndependent/glslang_tab.cpp"
break;
case 75: /* conditional_expression: logical_or_expression */
#line 789 "MachineIndependent/glslang.y"
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
-#line 5861 "MachineIndependent/glslang_tab.cpp"
+#line 5879 "MachineIndependent/glslang_tab.cpp"
break;
case 76: /* $@1: %empty */
@@ -5865,7 +5883,7 @@ yyreduce:
{
++parseContext.controlFlowNestingLevel;
}
-#line 5869 "MachineIndependent/glslang_tab.cpp"
+#line 5887 "MachineIndependent/glslang_tab.cpp"
break;
case 77: /* conditional_expression: logical_or_expression QUESTION $@1 expression COLON assignment_expression */
@@ -5878,17 +5896,17 @@ yyreduce:
parseContext.rValueErrorCheck((yyvsp[-1].lex).loc, ":", (yyvsp[0].interm.intermTypedNode));
(yyval.interm.intermTypedNode) = parseContext.intermediate.addSelection((yyvsp[-5].interm.intermTypedNode), (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yyvsp[-4].lex).loc);
if ((yyval.interm.intermTypedNode) == 0) {
- parseContext.binaryOpError((yyvsp[-4].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString());
+ parseContext.binaryOpError((yyvsp[-4].lex).loc, ":", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), (yyvsp[0].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
}
-#line 5886 "MachineIndependent/glslang_tab.cpp"
+#line 5904 "MachineIndependent/glslang_tab.cpp"
break;
case 78: /* assignment_expression: conditional_expression */
#line 808 "MachineIndependent/glslang.y"
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
-#line 5892 "MachineIndependent/glslang_tab.cpp"
+#line 5910 "MachineIndependent/glslang_tab.cpp"
break;
case 79: /* assignment_expression: unary_expression assignment_operator assignment_expression */
@@ -5902,11 +5920,11 @@ yyreduce:
parseContext.rValueErrorCheck((yyvsp[-1].interm).loc, "assign", (yyvsp[0].interm.intermTypedNode));
(yyval.interm.intermTypedNode) = parseContext.addAssign((yyvsp[-1].interm).loc, (yyvsp[-1].interm).op, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode));
if ((yyval.interm.intermTypedNode) == 0) {
- parseContext.assignError((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString());
+ parseContext.assignError((yyvsp[-1].interm).loc, "assign", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), (yyvsp[0].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
(yyval.interm.intermTypedNode) = (yyvsp[-2].interm.intermTypedNode);
}
}
-#line 5910 "MachineIndependent/glslang_tab.cpp"
+#line 5928 "MachineIndependent/glslang_tab.cpp"
break;
case 80: /* assignment_operator: EQUAL */
@@ -5915,7 +5933,7 @@ yyreduce:
(yyval.interm).loc = (yyvsp[0].lex).loc;
(yyval.interm).op = EOpAssign;
}
-#line 5919 "MachineIndependent/glslang_tab.cpp"
+#line 5937 "MachineIndependent/glslang_tab.cpp"
break;
case 81: /* assignment_operator: MUL_ASSIGN */
@@ -5924,7 +5942,7 @@ yyreduce:
(yyval.interm).loc = (yyvsp[0].lex).loc;
(yyval.interm).op = EOpMulAssign;
}
-#line 5928 "MachineIndependent/glslang_tab.cpp"
+#line 5946 "MachineIndependent/glslang_tab.cpp"
break;
case 82: /* assignment_operator: DIV_ASSIGN */
@@ -5933,7 +5951,7 @@ yyreduce:
(yyval.interm).loc = (yyvsp[0].lex).loc;
(yyval.interm).op = EOpDivAssign;
}
-#line 5937 "MachineIndependent/glslang_tab.cpp"
+#line 5955 "MachineIndependent/glslang_tab.cpp"
break;
case 83: /* assignment_operator: MOD_ASSIGN */
@@ -5943,7 +5961,7 @@ yyreduce:
(yyval.interm).loc = (yyvsp[0].lex).loc;
(yyval.interm).op = EOpModAssign;
}
-#line 5947 "MachineIndependent/glslang_tab.cpp"
+#line 5965 "MachineIndependent/glslang_tab.cpp"
break;
case 84: /* assignment_operator: ADD_ASSIGN */
@@ -5952,7 +5970,7 @@ yyreduce:
(yyval.interm).loc = (yyvsp[0].lex).loc;
(yyval.interm).op = EOpAddAssign;
}
-#line 5956 "MachineIndependent/glslang_tab.cpp"
+#line 5974 "MachineIndependent/glslang_tab.cpp"
break;
case 85: /* assignment_operator: SUB_ASSIGN */
@@ -5961,7 +5979,7 @@ yyreduce:
(yyval.interm).loc = (yyvsp[0].lex).loc;
(yyval.interm).op = EOpSubAssign;
}
-#line 5965 "MachineIndependent/glslang_tab.cpp"
+#line 5983 "MachineIndependent/glslang_tab.cpp"
break;
case 86: /* assignment_operator: LEFT_ASSIGN */
@@ -5970,7 +5988,7 @@ yyreduce:
parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift left assign");
(yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpLeftShiftAssign;
}
-#line 5974 "MachineIndependent/glslang_tab.cpp"
+#line 5992 "MachineIndependent/glslang_tab.cpp"
break;
case 87: /* assignment_operator: RIGHT_ASSIGN */
@@ -5979,7 +5997,7 @@ yyreduce:
parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bit-shift right assign");
(yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpRightShiftAssign;
}
-#line 5983 "MachineIndependent/glslang_tab.cpp"
+#line 6001 "MachineIndependent/glslang_tab.cpp"
break;
case 88: /* assignment_operator: AND_ASSIGN */
@@ -5988,7 +6006,7 @@ yyreduce:
parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-and assign");
(yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpAndAssign;
}
-#line 5992 "MachineIndependent/glslang_tab.cpp"
+#line 6010 "MachineIndependent/glslang_tab.cpp"
break;
case 89: /* assignment_operator: XOR_ASSIGN */
@@ -5997,7 +6015,7 @@ yyreduce:
parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-xor assign");
(yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpExclusiveOrAssign;
}
-#line 6001 "MachineIndependent/glslang_tab.cpp"
+#line 6019 "MachineIndependent/glslang_tab.cpp"
break;
case 90: /* assignment_operator: OR_ASSIGN */
@@ -6006,7 +6024,7 @@ yyreduce:
parseContext.fullIntegerCheck((yyvsp[0].lex).loc, "bitwise-or assign");
(yyval.interm).loc = (yyvsp[0].lex).loc; (yyval.interm).op = EOpInclusiveOrAssign;
}
-#line 6010 "MachineIndependent/glslang_tab.cpp"
+#line 6028 "MachineIndependent/glslang_tab.cpp"
break;
case 91: /* expression: assignment_expression */
@@ -6014,7 +6032,7 @@ yyreduce:
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
-#line 6018 "MachineIndependent/glslang_tab.cpp"
+#line 6036 "MachineIndependent/glslang_tab.cpp"
break;
case 92: /* expression: expression COMMA assignment_expression */
@@ -6023,11 +6041,11 @@ yyreduce:
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);
if ((yyval.interm.intermTypedNode) == 0) {
- parseContext.binaryOpError((yyvsp[-1].lex).loc, ",", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(), (yyvsp[0].interm.intermTypedNode)->getCompleteString());
+ parseContext.binaryOpError((yyvsp[-1].lex).loc, ",", (yyvsp[-2].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()), (yyvsp[0].interm.intermTypedNode)->getCompleteString(parseContext.intermediate.getEnhancedMsgs()));
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
}
-#line 6031 "MachineIndependent/glslang_tab.cpp"
+#line 6049 "MachineIndependent/glslang_tab.cpp"
break;
case 93: /* constant_expression: conditional_expression */
@@ -6036,7 +6054,7 @@ yyreduce:
parseContext.constantValueCheck((yyvsp[0].interm.intermTypedNode), "");
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
-#line 6040 "MachineIndependent/glslang_tab.cpp"
+#line 6058 "MachineIndependent/glslang_tab.cpp"
break;
case 94: /* declaration: function_prototype SEMICOLON */
@@ -6046,7 +6064,7 @@ yyreduce:
(yyval.interm.intermNode) = 0;
// TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
}
-#line 6050 "MachineIndependent/glslang_tab.cpp"
+#line 6068 "MachineIndependent/glslang_tab.cpp"
break;
case 95: /* declaration: spirv_instruction_qualifier function_prototype SEMICOLON */
@@ -6058,7 +6076,7 @@ yyreduce:
(yyval.interm.intermNode) = 0;
// TODO: 4.0 functionality: subroutines: make the identifier a user type for this signature
}
-#line 6062 "MachineIndependent/glslang_tab.cpp"
+#line 6080 "MachineIndependent/glslang_tab.cpp"
break;
case 96: /* declaration: spirv_execution_mode_qualifier SEMICOLON */
@@ -6068,7 +6086,7 @@ yyreduce:
parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_spirv_intrinsics, "SPIR-V execution mode qualifier");
(yyval.interm.intermNode) = 0;
}
-#line 6072 "MachineIndependent/glslang_tab.cpp"
+#line 6090 "MachineIndependent/glslang_tab.cpp"
break;
case 97: /* declaration: init_declarator_list SEMICOLON */
@@ -6078,7 +6096,7 @@ yyreduce:
(yyvsp[-1].interm).intermNode->getAsAggregate()->setOperator(EOpSequence);
(yyval.interm.intermNode) = (yyvsp[-1].interm).intermNode;
}
-#line 6082 "MachineIndependent/glslang_tab.cpp"
+#line 6100 "MachineIndependent/glslang_tab.cpp"
break;
case 98: /* declaration: PRECISION precision_qualifier type_specifier SEMICOLON */
@@ -6090,7 +6108,7 @@ yyreduce:
parseContext.setDefaultPrecision((yyvsp[-3].lex).loc, (yyvsp[-1].interm.type), (yyvsp[-2].interm.type).qualifier.precision);
(yyval.interm.intermNode) = 0;
}
-#line 6094 "MachineIndependent/glslang_tab.cpp"
+#line 6112 "MachineIndependent/glslang_tab.cpp"
break;
case 99: /* declaration: block_structure SEMICOLON */
@@ -6099,7 +6117,7 @@ yyreduce:
parseContext.declareBlock((yyvsp[-1].interm).loc, *(yyvsp[-1].interm).typeList);
(yyval.interm.intermNode) = 0;
}
-#line 6103 "MachineIndependent/glslang_tab.cpp"
+#line 6121 "MachineIndependent/glslang_tab.cpp"
break;
case 100: /* declaration: block_structure IDENTIFIER SEMICOLON */
@@ -6108,7 +6126,7 @@ yyreduce:
parseContext.declareBlock((yyvsp[-2].interm).loc, *(yyvsp[-2].interm).typeList, (yyvsp[-1].lex).string);
(yyval.interm.intermNode) = 0;
}
-#line 6112 "MachineIndependent/glslang_tab.cpp"
+#line 6130 "MachineIndependent/glslang_tab.cpp"
break;
case 101: /* declaration: block_structure IDENTIFIER array_specifier SEMICOLON */
@@ -6117,7 +6135,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 6121 "MachineIndependent/glslang_tab.cpp"
+#line 6139 "MachineIndependent/glslang_tab.cpp"
break;
case 102: /* declaration: type_qualifier SEMICOLON */
@@ -6127,7 +6145,7 @@ yyreduce:
parseContext.updateStandaloneQualifierDefaults((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type));
(yyval.interm.intermNode) = 0;
}
-#line 6131 "MachineIndependent/glslang_tab.cpp"
+#line 6149 "MachineIndependent/glslang_tab.cpp"
break;
case 103: /* declaration: type_qualifier IDENTIFIER SEMICOLON */
@@ -6137,7 +6155,7 @@ yyreduce:
parseContext.addQualifierToExisting((yyvsp[-2].interm.type).loc, (yyvsp[-2].interm.type).qualifier, *(yyvsp[-1].lex).string);
(yyval.interm.intermNode) = 0;
}
-#line 6141 "MachineIndependent/glslang_tab.cpp"
+#line 6159 "MachineIndependent/glslang_tab.cpp"
break;
case 104: /* declaration: type_qualifier IDENTIFIER identifier_list SEMICOLON */
@@ -6148,13 +6166,13 @@ yyreduce:
parseContext.addQualifierToExisting((yyvsp[-3].interm.type).loc, (yyvsp[-3].interm.type).qualifier, *(yyvsp[-1].interm.identifierList));
(yyval.interm.intermNode) = 0;
}
-#line 6152 "MachineIndependent/glslang_tab.cpp"
+#line 6170 "MachineIndependent/glslang_tab.cpp"
break;
case 105: /* $@2: %empty */
#line 956 "MachineIndependent/glslang.y"
{ parseContext.nestedBlockCheck((yyvsp[-2].interm.type).loc); }
-#line 6158 "MachineIndependent/glslang_tab.cpp"
+#line 6176 "MachineIndependent/glslang_tab.cpp"
break;
case 106: /* block_structure: type_qualifier IDENTIFIER LEFT_BRACE $@2 struct_declaration_list RIGHT_BRACE */
@@ -6168,7 +6186,7 @@ yyreduce:
(yyval.interm).loc = (yyvsp[-5].interm.type).loc;
(yyval.interm).typeList = (yyvsp[-1].interm.typeList);
}
-#line 6172 "MachineIndependent/glslang_tab.cpp"
+#line 6190 "MachineIndependent/glslang_tab.cpp"
break;
case 107: /* identifier_list: COMMA IDENTIFIER */
@@ -6177,7 +6195,7 @@ yyreduce:
(yyval.interm.identifierList) = new TIdentifierList;
(yyval.interm.identifierList)->push_back((yyvsp[0].lex).string);
}
-#line 6181 "MachineIndependent/glslang_tab.cpp"
+#line 6199 "MachineIndependent/glslang_tab.cpp"
break;
case 108: /* identifier_list: identifier_list COMMA IDENTIFIER */
@@ -6186,7 +6204,7 @@ yyreduce:
(yyval.interm.identifierList) = (yyvsp[-2].interm.identifierList);
(yyval.interm.identifierList)->push_back((yyvsp[0].lex).string);
}
-#line 6190 "MachineIndependent/glslang_tab.cpp"
+#line 6208 "MachineIndependent/glslang_tab.cpp"
break;
case 109: /* function_prototype: function_declarator RIGHT_PAREN */
@@ -6195,7 +6213,7 @@ yyreduce:
(yyval.interm).function = (yyvsp[-1].interm.function);
(yyval.interm).loc = (yyvsp[0].lex).loc;
}
-#line 6199 "MachineIndependent/glslang_tab.cpp"
+#line 6217 "MachineIndependent/glslang_tab.cpp"
break;
case 110: /* function_prototype: function_declarator RIGHT_PAREN attribute */
@@ -6206,7 +6224,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 6210 "MachineIndependent/glslang_tab.cpp"
+#line 6228 "MachineIndependent/glslang_tab.cpp"
break;
case 111: /* function_prototype: attribute function_declarator RIGHT_PAREN */
@@ -6217,7 +6235,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 6221 "MachineIndependent/glslang_tab.cpp"
+#line 6239 "MachineIndependent/glslang_tab.cpp"
break;
case 112: /* function_prototype: attribute function_declarator RIGHT_PAREN attribute */
@@ -6229,7 +6247,7 @@ yyreduce:
parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[-3].interm.attributes));
parseContext.handleFunctionAttributes((yyvsp[-1].lex).loc, *(yyvsp[0].interm.attributes));
}
-#line 6233 "MachineIndependent/glslang_tab.cpp"
+#line 6251 "MachineIndependent/glslang_tab.cpp"
break;
case 113: /* function_declarator: function_header */
@@ -6237,7 +6255,7 @@ yyreduce:
{
(yyval.interm.function) = (yyvsp[0].interm.function);
}
-#line 6241 "MachineIndependent/glslang_tab.cpp"
+#line 6259 "MachineIndependent/glslang_tab.cpp"
break;
case 114: /* function_declarator: function_header_with_parameters */
@@ -6245,7 +6263,7 @@ yyreduce:
{
(yyval.interm.function) = (yyvsp[0].interm.function);
}
-#line 6249 "MachineIndependent/glslang_tab.cpp"
+#line 6267 "MachineIndependent/glslang_tab.cpp"
break;
case 115: /* function_header_with_parameters: function_header parameter_declaration */
@@ -6258,7 +6276,7 @@ yyreduce:
else
delete (yyvsp[0].interm).param.type;
}
-#line 6262 "MachineIndependent/glslang_tab.cpp"
+#line 6280 "MachineIndependent/glslang_tab.cpp"
break;
case 116: /* function_header_with_parameters: function_header_with_parameters COMMA parameter_declaration */
@@ -6280,7 +6298,7 @@ yyreduce:
(yyvsp[-2].interm.function)->addParameter((yyvsp[0].interm).param);
}
}
-#line 6284 "MachineIndependent/glslang_tab.cpp"
+#line 6302 "MachineIndependent/glslang_tab.cpp"
break;
case 117: /* function_header: fully_specified_type IDENTIFIER LEFT_PAREN */
@@ -6304,7 +6322,7 @@ yyreduce:
function = new TFunction((yyvsp[-1].lex).string, type);
(yyval.interm.function) = function;
}
-#line 6308 "MachineIndependent/glslang_tab.cpp"
+#line 6326 "MachineIndependent/glslang_tab.cpp"
break;
case 118: /* parameter_declarator: type_specifier IDENTIFIER */
@@ -6324,7 +6342,7 @@ yyreduce:
(yyval.interm).loc = (yyvsp[0].lex).loc;
(yyval.interm).param = param;
}
-#line 6328 "MachineIndependent/glslang_tab.cpp"
+#line 6346 "MachineIndependent/glslang_tab.cpp"
break;
case 119: /* parameter_declarator: type_specifier IDENTIFIER array_specifier */
@@ -6348,7 +6366,7 @@ yyreduce:
(yyval.interm).loc = (yyvsp[-1].lex).loc;
(yyval.interm).param = param;
}
-#line 6352 "MachineIndependent/glslang_tab.cpp"
+#line 6370 "MachineIndependent/glslang_tab.cpp"
break;
case 120: /* parameter_declaration: type_qualifier parameter_declarator */
@@ -6364,7 +6382,7 @@ yyreduce:
parseContext.paramCheckFix((yyvsp[-1].interm.type).loc, (yyvsp[-1].interm.type).qualifier, *(yyval.interm).param.type);
}
-#line 6368 "MachineIndependent/glslang_tab.cpp"
+#line 6386 "MachineIndependent/glslang_tab.cpp"
break;
case 121: /* parameter_declaration: parameter_declarator */
@@ -6376,7 +6394,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 6380 "MachineIndependent/glslang_tab.cpp"
+#line 6398 "MachineIndependent/glslang_tab.cpp"
break;
case 122: /* parameter_declaration: type_qualifier parameter_type_specifier */
@@ -6391,7 +6409,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 6395 "MachineIndependent/glslang_tab.cpp"
+#line 6413 "MachineIndependent/glslang_tab.cpp"
break;
case 123: /* parameter_declaration: parameter_type_specifier */
@@ -6403,7 +6421,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 6407 "MachineIndependent/glslang_tab.cpp"
+#line 6425 "MachineIndependent/glslang_tab.cpp"
break;
case 124: /* parameter_type_specifier: type_specifier */
@@ -6414,7 +6432,7 @@ yyreduce:
if ((yyvsp[0].interm.type).arraySizes)
parseContext.arraySizeRequiredCheck((yyvsp[0].interm.type).loc, *(yyvsp[0].interm.type).arraySizes);
}
-#line 6418 "MachineIndependent/glslang_tab.cpp"
+#line 6436 "MachineIndependent/glslang_tab.cpp"
break;
case 125: /* init_declarator_list: single_declaration */
@@ -6422,7 +6440,7 @@ yyreduce:
{
(yyval.interm) = (yyvsp[0].interm);
}
-#line 6426 "MachineIndependent/glslang_tab.cpp"
+#line 6444 "MachineIndependent/glslang_tab.cpp"
break;
case 126: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER */
@@ -6431,7 +6449,7 @@ yyreduce:
(yyval.interm) = (yyvsp[-2].interm);
parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-2].interm).type);
}
-#line 6435 "MachineIndependent/glslang_tab.cpp"
+#line 6453 "MachineIndependent/glslang_tab.cpp"
break;
case 127: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier */
@@ -6440,7 +6458,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 6444 "MachineIndependent/glslang_tab.cpp"
+#line 6462 "MachineIndependent/glslang_tab.cpp"
break;
case 128: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER array_specifier EQUAL initializer */
@@ -6450,7 +6468,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 6454 "MachineIndependent/glslang_tab.cpp"
+#line 6472 "MachineIndependent/glslang_tab.cpp"
break;
case 129: /* init_declarator_list: init_declarator_list COMMA IDENTIFIER EQUAL initializer */
@@ -6460,7 +6478,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 6464 "MachineIndependent/glslang_tab.cpp"
+#line 6482 "MachineIndependent/glslang_tab.cpp"
break;
case 130: /* single_declaration: fully_specified_type */
@@ -6472,7 +6490,7 @@ yyreduce:
parseContext.declareTypeDefaults((yyval.interm).loc, (yyval.interm).type);
}
-#line 6476 "MachineIndependent/glslang_tab.cpp"
+#line 6494 "MachineIndependent/glslang_tab.cpp"
break;
case 131: /* single_declaration: fully_specified_type IDENTIFIER */
@@ -6482,7 +6500,7 @@ yyreduce:
(yyval.interm).intermNode = 0;
parseContext.declareVariable((yyvsp[0].lex).loc, *(yyvsp[0].lex).string, (yyvsp[-1].interm.type));
}
-#line 6486 "MachineIndependent/glslang_tab.cpp"
+#line 6504 "MachineIndependent/glslang_tab.cpp"
break;
case 132: /* single_declaration: fully_specified_type IDENTIFIER array_specifier */
@@ -6492,7 +6510,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 6496 "MachineIndependent/glslang_tab.cpp"
+#line 6514 "MachineIndependent/glslang_tab.cpp"
break;
case 133: /* single_declaration: fully_specified_type IDENTIFIER array_specifier EQUAL initializer */
@@ -6502,7 +6520,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 6506 "MachineIndependent/glslang_tab.cpp"
+#line 6524 "MachineIndependent/glslang_tab.cpp"
break;
case 134: /* single_declaration: fully_specified_type IDENTIFIER EQUAL initializer */
@@ -6512,7 +6530,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 6516 "MachineIndependent/glslang_tab.cpp"
+#line 6534 "MachineIndependent/glslang_tab.cpp"
break;
case 135: /* fully_specified_type: type_specifier */
@@ -6527,7 +6545,7 @@ yyreduce:
}
parseContext.precisionQualifierCheck((yyval.interm.type).loc, (yyval.interm.type).basicType, (yyval.interm.type).qualifier);
}
-#line 6531 "MachineIndependent/glslang_tab.cpp"
+#line 6549 "MachineIndependent/glslang_tab.cpp"
break;
case 136: /* fully_specified_type: type_qualifier type_specifier */
@@ -6556,7 +6574,7 @@ yyreduce:
(parseContext.language == EShLangFragment && (yyval.interm.type).qualifier.storage == EvqVaryingIn)))
(yyval.interm.type).qualifier.smooth = true;
}
-#line 6560 "MachineIndependent/glslang_tab.cpp"
+#line 6578 "MachineIndependent/glslang_tab.cpp"
break;
case 137: /* invariant_qualifier: INVARIANT */
@@ -6567,7 +6585,7 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.invariant = true;
}
-#line 6571 "MachineIndependent/glslang_tab.cpp"
+#line 6589 "MachineIndependent/glslang_tab.cpp"
break;
case 138: /* interpolation_qualifier: SMOOTH */
@@ -6579,7 +6597,7 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.smooth = true;
}
-#line 6583 "MachineIndependent/glslang_tab.cpp"
+#line 6601 "MachineIndependent/glslang_tab.cpp"
break;
case 139: /* interpolation_qualifier: FLAT */
@@ -6591,7 +6609,7 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.flat = true;
}
-#line 6595 "MachineIndependent/glslang_tab.cpp"
+#line 6613 "MachineIndependent/glslang_tab.cpp"
break;
case 140: /* interpolation_qualifier: NOPERSPECTIVE */
@@ -6603,7 +6621,7 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.nopersp = true;
}
-#line 6607 "MachineIndependent/glslang_tab.cpp"
+#line 6625 "MachineIndependent/glslang_tab.cpp"
break;
case 141: /* interpolation_qualifier: EXPLICITINTERPAMD */
@@ -6615,7 +6633,7 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.explicitInterp = true;
}
-#line 6619 "MachineIndependent/glslang_tab.cpp"
+#line 6637 "MachineIndependent/glslang_tab.cpp"
break;
case 142: /* interpolation_qualifier: PERVERTEXNV */
@@ -6628,123 +6646,151 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.pervertexNV = true;
}
-#line 6632 "MachineIndependent/glslang_tab.cpp"
+#line 6650 "MachineIndependent/glslang_tab.cpp"
break;
- case 143: /* interpolation_qualifier: PERPRIMITIVENV */
+ case 143: /* interpolation_qualifier: PERVERTEXEXT */
#line 1293 "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");
+ parseContext.profileRequires((yyvsp[0].lex).loc, ECompatibilityProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
+ parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 0, E_GL_EXT_fragment_shader_barycentric, "fragment shader barycentric");
+ (yyval.interm.type).init((yyvsp[0].lex).loc);
+ (yyval.interm.type).qualifier.pervertexEXT = true;
+ }
+#line 6663 "MachineIndependent/glslang_tab.cpp"
+ break;
+
+ case 144: /* interpolation_qualifier: PERPRIMITIVENV */
+#line 1301 "MachineIndependent/glslang.y"
{
// No need for profile version or extension check. Shader stage already checks both.
parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveNV");
- parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshNVMask), "perprimitiveNV");
+ parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveNV");
// Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
if (parseContext.language == EShLangFragment)
parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_NV_mesh_shader, "perprimitiveNV");
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.perPrimitiveNV = true;
}
-#line 6647 "MachineIndependent/glslang_tab.cpp"
+#line 6678 "MachineIndependent/glslang_tab.cpp"
+ break;
+
+ case 145: /* interpolation_qualifier: PERPRIMITIVEEXT */
+#line 1311 "MachineIndependent/glslang.y"
+ {
+ // No need for profile version or extension check. Shader stage already checks both.
+ parseContext.globalCheck((yyvsp[0].lex).loc, "perprimitiveEXT");
+ parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangFragmentMask | EShLangMeshMask), "perprimitiveEXT");
+ // Fragment shader stage doesn't check for extension. So we explicitly add below extension check.
+ if (parseContext.language == EShLangFragment)
+ parseContext.requireExtensions((yyvsp[0].lex).loc, 1, &E_GL_EXT_mesh_shader, "perprimitiveEXT");
+ (yyval.interm.type).init((yyvsp[0].lex).loc);
+ (yyval.interm.type).qualifier.perPrimitiveNV = true;
+ }
+#line 6693 "MachineIndependent/glslang_tab.cpp"
break;
- case 144: /* interpolation_qualifier: PERVIEWNV */
-#line 1303 "MachineIndependent/glslang.y"
+ case 146: /* interpolation_qualifier: PERVIEWNV */
+#line 1321 "MachineIndependent/glslang.y"
{
// No need for profile version or extension check. Shader stage already checks both.
parseContext.globalCheck((yyvsp[0].lex).loc, "perviewNV");
- parseContext.requireStage((yyvsp[0].lex).loc, EShLangMeshNV, "perviewNV");
+ parseContext.requireStage((yyvsp[0].lex).loc, EShLangMesh, "perviewNV");
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.perViewNV = true;
}
-#line 6659 "MachineIndependent/glslang_tab.cpp"
+#line 6705 "MachineIndependent/glslang_tab.cpp"
break;
- case 145: /* interpolation_qualifier: PERTASKNV */
-#line 1310 "MachineIndependent/glslang.y"
+ case 147: /* interpolation_qualifier: PERTASKNV */
+#line 1328 "MachineIndependent/glslang.y"
{
// No need for profile version or extension check. Shader stage already checks both.
parseContext.globalCheck((yyvsp[0].lex).loc, "taskNV");
- parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTaskNVMask | EShLangMeshNVMask), "taskNV");
+ parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskNV");
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.perTaskNV = true;
}
-#line 6671 "MachineIndependent/glslang_tab.cpp"
+#line 6717 "MachineIndependent/glslang_tab.cpp"
break;
- case 146: /* layout_qualifier: LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN */
-#line 1321 "MachineIndependent/glslang.y"
+ case 148: /* layout_qualifier: LAYOUT LEFT_PAREN layout_qualifier_id_list RIGHT_PAREN */
+#line 1339 "MachineIndependent/glslang.y"
{
(yyval.interm.type) = (yyvsp[-1].interm.type);
}
-#line 6679 "MachineIndependent/glslang_tab.cpp"
+#line 6725 "MachineIndependent/glslang_tab.cpp"
break;
- case 147: /* layout_qualifier_id_list: layout_qualifier_id */
-#line 1327 "MachineIndependent/glslang.y"
+ case 149: /* layout_qualifier_id_list: layout_qualifier_id */
+#line 1345 "MachineIndependent/glslang.y"
{
(yyval.interm.type) = (yyvsp[0].interm.type);
}
-#line 6687 "MachineIndependent/glslang_tab.cpp"
+#line 6733 "MachineIndependent/glslang_tab.cpp"
break;
- case 148: /* layout_qualifier_id_list: layout_qualifier_id_list COMMA layout_qualifier_id */
-#line 1330 "MachineIndependent/glslang.y"
+ case 150: /* layout_qualifier_id_list: layout_qualifier_id_list COMMA layout_qualifier_id */
+#line 1348 "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 6697 "MachineIndependent/glslang_tab.cpp"
+#line 6743 "MachineIndependent/glslang_tab.cpp"
break;
- case 149: /* layout_qualifier_id: IDENTIFIER */
-#line 1337 "MachineIndependent/glslang.y"
+ case 151: /* layout_qualifier_id: IDENTIFIER */
+#line 1355 "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 6706 "MachineIndependent/glslang_tab.cpp"
+#line 6752 "MachineIndependent/glslang_tab.cpp"
break;
- case 150: /* layout_qualifier_id: IDENTIFIER EQUAL constant_expression */
-#line 1341 "MachineIndependent/glslang.y"
+ case 152: /* layout_qualifier_id: IDENTIFIER EQUAL constant_expression */
+#line 1359 "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 6715 "MachineIndependent/glslang_tab.cpp"
+#line 6761 "MachineIndependent/glslang_tab.cpp"
break;
- case 151: /* layout_qualifier_id: SHARED */
-#line 1345 "MachineIndependent/glslang.y"
+ case 153: /* layout_qualifier_id: SHARED */
+#line 1363 "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 6725 "MachineIndependent/glslang_tab.cpp"
+#line 6771 "MachineIndependent/glslang_tab.cpp"
break;
- case 152: /* precise_qualifier: PRECISE */
-#line 1354 "MachineIndependent/glslang.y"
+ case 154: /* precise_qualifier: PRECISE */
+#line 1372 "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 6736 "MachineIndependent/glslang_tab.cpp"
+#line 6782 "MachineIndependent/glslang_tab.cpp"
break;
- case 153: /* type_qualifier: single_type_qualifier */
-#line 1364 "MachineIndependent/glslang.y"
+ case 155: /* type_qualifier: single_type_qualifier */
+#line 1382 "MachineIndependent/glslang.y"
{
(yyval.interm.type) = (yyvsp[0].interm.type);
}
-#line 6744 "MachineIndependent/glslang_tab.cpp"
+#line 6790 "MachineIndependent/glslang_tab.cpp"
break;
- case 154: /* type_qualifier: type_qualifier single_type_qualifier */
-#line 1367 "MachineIndependent/glslang.y"
+ case 156: /* type_qualifier: type_qualifier single_type_qualifier */
+#line 1385 "MachineIndependent/glslang.y"
{
(yyval.interm.type) = (yyvsp[-1].interm.type);
if ((yyval.interm.type).basicType == EbtVoid)
@@ -6753,151 +6799,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 6757 "MachineIndependent/glslang_tab.cpp"
+#line 6803 "MachineIndependent/glslang_tab.cpp"
break;
- case 155: /* single_type_qualifier: storage_qualifier */
-#line 1378 "MachineIndependent/glslang.y"
+ case 157: /* single_type_qualifier: storage_qualifier */
+#line 1396 "MachineIndependent/glslang.y"
{
(yyval.interm.type) = (yyvsp[0].interm.type);
}
-#line 6765 "MachineIndependent/glslang_tab.cpp"
+#line 6811 "MachineIndependent/glslang_tab.cpp"
break;
- case 156: /* single_type_qualifier: layout_qualifier */
-#line 1381 "MachineIndependent/glslang.y"
+ case 158: /* single_type_qualifier: layout_qualifier */
+#line 1399 "MachineIndependent/glslang.y"
{
(yyval.interm.type) = (yyvsp[0].interm.type);
}
-#line 6773 "MachineIndependent/glslang_tab.cpp"
+#line 6819 "MachineIndependent/glslang_tab.cpp"
break;
- case 157: /* single_type_qualifier: precision_qualifier */
-#line 1384 "MachineIndependent/glslang.y"
+ case 159: /* single_type_qualifier: precision_qualifier */
+#line 1402 "MachineIndependent/glslang.y"
{
parseContext.checkPrecisionQualifier((yyvsp[0].interm.type).loc, (yyvsp[0].interm.type).qualifier.precision);
(yyval.interm.type) = (yyvsp[0].interm.type);
}
-#line 6782 "MachineIndependent/glslang_tab.cpp"
+#line 6828 "MachineIndependent/glslang_tab.cpp"
break;
- case 158: /* single_type_qualifier: interpolation_qualifier */
-#line 1388 "MachineIndependent/glslang.y"
+ case 160: /* single_type_qualifier: interpolation_qualifier */
+#line 1406 "MachineIndependent/glslang.y"
{
// allow inheritance of storage qualifier from block declaration
(yyval.interm.type) = (yyvsp[0].interm.type);
}
-#line 6791 "MachineIndependent/glslang_tab.cpp"
+#line 6837 "MachineIndependent/glslang_tab.cpp"
break;
- case 159: /* single_type_qualifier: invariant_qualifier */
-#line 1392 "MachineIndependent/glslang.y"
+ case 161: /* single_type_qualifier: invariant_qualifier */
+#line 1410 "MachineIndependent/glslang.y"
{
// allow inheritance of storage qualifier from block declaration
(yyval.interm.type) = (yyvsp[0].interm.type);
}
-#line 6800 "MachineIndependent/glslang_tab.cpp"
+#line 6846 "MachineIndependent/glslang_tab.cpp"
break;
- case 160: /* single_type_qualifier: precise_qualifier */
-#line 1397 "MachineIndependent/glslang.y"
+ case 162: /* single_type_qualifier: precise_qualifier */
+#line 1415 "MachineIndependent/glslang.y"
{
// allow inheritance of storage qualifier from block declaration
(yyval.interm.type) = (yyvsp[0].interm.type);
}
-#line 6809 "MachineIndependent/glslang_tab.cpp"
+#line 6855 "MachineIndependent/glslang_tab.cpp"
break;
- case 161: /* single_type_qualifier: non_uniform_qualifier */
-#line 1401 "MachineIndependent/glslang.y"
+ case 163: /* single_type_qualifier: non_uniform_qualifier */
+#line 1419 "MachineIndependent/glslang.y"
{
(yyval.interm.type) = (yyvsp[0].interm.type);
}
-#line 6817 "MachineIndependent/glslang_tab.cpp"
+#line 6863 "MachineIndependent/glslang_tab.cpp"
break;
- case 162: /* single_type_qualifier: spirv_storage_class_qualifier */
-#line 1404 "MachineIndependent/glslang.y"
+ case 164: /* single_type_qualifier: spirv_storage_class_qualifier */
+#line 1422 "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 6827 "MachineIndependent/glslang_tab.cpp"
+#line 6873 "MachineIndependent/glslang_tab.cpp"
break;
- case 163: /* single_type_qualifier: spirv_decorate_qualifier */
-#line 1409 "MachineIndependent/glslang.y"
+ case 165: /* single_type_qualifier: spirv_decorate_qualifier */
+#line 1427 "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 6836 "MachineIndependent/glslang_tab.cpp"
+#line 6882 "MachineIndependent/glslang_tab.cpp"
break;
- case 164: /* single_type_qualifier: SPIRV_BY_REFERENCE */
-#line 1413 "MachineIndependent/glslang.y"
+ case 166: /* single_type_qualifier: SPIRV_BY_REFERENCE */
+#line 1431 "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 6846 "MachineIndependent/glslang_tab.cpp"
+#line 6892 "MachineIndependent/glslang_tab.cpp"
break;
- case 165: /* single_type_qualifier: SPIRV_LITERAL */
-#line 1418 "MachineIndependent/glslang.y"
+ case 167: /* single_type_qualifier: SPIRV_LITERAL */
+#line 1436 "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 6856 "MachineIndependent/glslang_tab.cpp"
+#line 6902 "MachineIndependent/glslang_tab.cpp"
break;
- case 166: /* storage_qualifier: CONST */
-#line 1427 "MachineIndependent/glslang.y"
+ case 168: /* storage_qualifier: CONST */
+#line 1445 "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 6865 "MachineIndependent/glslang_tab.cpp"
+#line 6911 "MachineIndependent/glslang_tab.cpp"
break;
- case 167: /* storage_qualifier: INOUT */
-#line 1431 "MachineIndependent/glslang.y"
+ case 169: /* storage_qualifier: INOUT */
+#line 1449 "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 6875 "MachineIndependent/glslang_tab.cpp"
+#line 6921 "MachineIndependent/glslang_tab.cpp"
break;
- case 168: /* storage_qualifier: IN */
-#line 1436 "MachineIndependent/glslang.y"
+ case 170: /* storage_qualifier: IN */
+#line 1454 "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 6886 "MachineIndependent/glslang_tab.cpp"
+#line 6932 "MachineIndependent/glslang_tab.cpp"
break;
- case 169: /* storage_qualifier: OUT */
-#line 1442 "MachineIndependent/glslang.y"
+ case 171: /* storage_qualifier: OUT */
+#line 1460 "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 6897 "MachineIndependent/glslang_tab.cpp"
+#line 6943 "MachineIndependent/glslang_tab.cpp"
break;
- case 170: /* storage_qualifier: CENTROID */
-#line 1448 "MachineIndependent/glslang.y"
+ case 172: /* storage_qualifier: CENTROID */
+#line 1466 "MachineIndependent/glslang.y"
{
parseContext.profileRequires((yyvsp[0].lex).loc, ENoProfile, 120, 0, "centroid");
parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 300, 0, "centroid");
@@ -6905,44 +6951,44 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.centroid = true;
}
-#line 6909 "MachineIndependent/glslang_tab.cpp"
+#line 6955 "MachineIndependent/glslang_tab.cpp"
break;
- case 171: /* storage_qualifier: UNIFORM */
-#line 1455 "MachineIndependent/glslang.y"
+ case 173: /* storage_qualifier: UNIFORM */
+#line 1473 "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 6919 "MachineIndependent/glslang_tab.cpp"
+#line 6965 "MachineIndependent/glslang_tab.cpp"
break;
- case 172: /* storage_qualifier: SHARED */
-#line 1460 "MachineIndependent/glslang.y"
+ case 174: /* storage_qualifier: SHARED */
+#line 1478 "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");
parseContext.profileRequires((yyvsp[0].lex).loc, EEsProfile, 310, 0, "shared");
- parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshNVMask | EShLangTaskNVMask), "shared");
+ parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangComputeMask | EShLangMeshMask | EShLangTaskMask), "shared");
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.storage = EvqShared;
}
-#line 6932 "MachineIndependent/glslang_tab.cpp"
+#line 6978 "MachineIndependent/glslang_tab.cpp"
break;
- case 173: /* storage_qualifier: BUFFER */
-#line 1468 "MachineIndependent/glslang.y"
+ case 175: /* storage_qualifier: BUFFER */
+#line 1486 "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 6942 "MachineIndependent/glslang_tab.cpp"
+#line 6988 "MachineIndependent/glslang_tab.cpp"
break;
- case 174: /* storage_qualifier: ATTRIBUTE */
-#line 1474 "MachineIndependent/glslang.y"
+ case 176: /* storage_qualifier: ATTRIBUTE */
+#line 1492 "MachineIndependent/glslang.y"
{
parseContext.requireStage((yyvsp[0].lex).loc, EShLangVertex, "attribute");
parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "attribute");
@@ -6955,11 +7001,11 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.storage = EvqVaryingIn;
}
-#line 6959 "MachineIndependent/glslang_tab.cpp"
+#line 7005 "MachineIndependent/glslang_tab.cpp"
break;
- case 175: /* storage_qualifier: VARYING */
-#line 1486 "MachineIndependent/glslang.y"
+ case 177: /* storage_qualifier: VARYING */
+#line 1504 "MachineIndependent/glslang.y"
{
parseContext.checkDeprecated((yyvsp[0].lex).loc, ENoProfile, 130, "varying");
parseContext.checkDeprecated((yyvsp[0].lex).loc, ECoreProfile, 130, "varying");
@@ -6974,32 +7020,32 @@ yyreduce:
else
(yyval.interm.type).qualifier.storage = EvqVaryingIn;
}
-#line 6978 "MachineIndependent/glslang_tab.cpp"
+#line 7024 "MachineIndependent/glslang_tab.cpp"
break;
- case 176: /* storage_qualifier: PATCH */
-#line 1500 "MachineIndependent/glslang.y"
+ case 178: /* storage_qualifier: PATCH */
+#line 1518 "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 6989 "MachineIndependent/glslang_tab.cpp"
+#line 7035 "MachineIndependent/glslang_tab.cpp"
break;
- case 177: /* storage_qualifier: SAMPLE */
-#line 1506 "MachineIndependent/glslang.y"
+ case 179: /* storage_qualifier: SAMPLE */
+#line 1524 "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 6999 "MachineIndependent/glslang_tab.cpp"
+#line 7045 "MachineIndependent/glslang_tab.cpp"
break;
- case 178: /* storage_qualifier: HITATTRNV */
-#line 1511 "MachineIndependent/glslang.y"
+ case 180: /* storage_qualifier: HITATTRNV */
+#line 1529 "MachineIndependent/glslang.y"
{
parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeNV");
parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
@@ -7008,11 +7054,11 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.storage = EvqHitAttr;
}
-#line 7012 "MachineIndependent/glslang_tab.cpp"
+#line 7058 "MachineIndependent/glslang_tab.cpp"
break;
- case 179: /* storage_qualifier: HITATTREXT */
-#line 1519 "MachineIndependent/glslang.y"
+ case 181: /* storage_qualifier: HITATTREXT */
+#line 1537 "MachineIndependent/glslang.y"
{
parseContext.globalCheck((yyvsp[0].lex).loc, "hitAttributeEXT");
parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangIntersectMask | EShLangClosestHitMask
@@ -7021,11 +7067,11 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.storage = EvqHitAttr;
}
-#line 7025 "MachineIndependent/glslang_tab.cpp"
+#line 7071 "MachineIndependent/glslang_tab.cpp"
break;
- case 180: /* storage_qualifier: PAYLOADNV */
-#line 1527 "MachineIndependent/glslang.y"
+ case 182: /* storage_qualifier: PAYLOADNV */
+#line 1545 "MachineIndependent/glslang.y"
{
parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadNV");
parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask |
@@ -7034,11 +7080,11 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.storage = EvqPayload;
}
-#line 7038 "MachineIndependent/glslang_tab.cpp"
+#line 7084 "MachineIndependent/glslang_tab.cpp"
break;
- case 181: /* storage_qualifier: PAYLOADEXT */
-#line 1535 "MachineIndependent/glslang.y"
+ case 183: /* storage_qualifier: PAYLOADEXT */
+#line 1553 "MachineIndependent/glslang.y"
{
parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadEXT");
parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask | EShLangClosestHitMask |
@@ -7047,11 +7093,11 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.storage = EvqPayload;
}
-#line 7051 "MachineIndependent/glslang_tab.cpp"
+#line 7097 "MachineIndependent/glslang_tab.cpp"
break;
- case 182: /* storage_qualifier: PAYLOADINNV */
-#line 1543 "MachineIndependent/glslang.y"
+ case 184: /* storage_qualifier: PAYLOADINNV */
+#line 1561 "MachineIndependent/glslang.y"
{
parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInNV");
parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask |
@@ -7060,11 +7106,11 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.storage = EvqPayloadIn;
}
-#line 7064 "MachineIndependent/glslang_tab.cpp"
+#line 7110 "MachineIndependent/glslang_tab.cpp"
break;
- case 183: /* storage_qualifier: PAYLOADINEXT */
-#line 1551 "MachineIndependent/glslang.y"
+ case 185: /* storage_qualifier: PAYLOADINEXT */
+#line 1569 "MachineIndependent/glslang.y"
{
parseContext.globalCheck((yyvsp[0].lex).loc, "rayPayloadInEXT");
parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangClosestHitMask |
@@ -7073,11 +7119,11 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.storage = EvqPayloadIn;
}
-#line 7077 "MachineIndependent/glslang_tab.cpp"
+#line 7123 "MachineIndependent/glslang_tab.cpp"
break;
- case 184: /* storage_qualifier: CALLDATANV */
-#line 1559 "MachineIndependent/glslang.y"
+ case 186: /* storage_qualifier: CALLDATANV */
+#line 1577 "MachineIndependent/glslang.y"
{
parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataNV");
parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask |
@@ -7086,11 +7132,11 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.storage = EvqCallableData;
}
-#line 7090 "MachineIndependent/glslang_tab.cpp"
+#line 7136 "MachineIndependent/glslang_tab.cpp"
break;
- case 185: /* storage_qualifier: CALLDATAEXT */
-#line 1567 "MachineIndependent/glslang.y"
+ case 187: /* storage_qualifier: CALLDATAEXT */
+#line 1585 "MachineIndependent/glslang.y"
{
parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataEXT");
parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangRayGenMask |
@@ -7099,11 +7145,11 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.storage = EvqCallableData;
}
-#line 7103 "MachineIndependent/glslang_tab.cpp"
+#line 7149 "MachineIndependent/glslang_tab.cpp"
break;
- case 186: /* storage_qualifier: CALLDATAINNV */
-#line 1575 "MachineIndependent/glslang.y"
+ case 188: /* storage_qualifier: CALLDATAINNV */
+#line 1593 "MachineIndependent/glslang.y"
{
parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInNV");
parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInNV");
@@ -7111,11 +7157,11 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.storage = EvqCallableDataIn;
}
-#line 7115 "MachineIndependent/glslang_tab.cpp"
+#line 7161 "MachineIndependent/glslang_tab.cpp"
break;
- case 187: /* storage_qualifier: CALLDATAINEXT */
-#line 1582 "MachineIndependent/glslang.y"
+ case 189: /* storage_qualifier: CALLDATAINEXT */
+#line 1600 "MachineIndependent/glslang.y"
{
parseContext.globalCheck((yyvsp[0].lex).loc, "callableDataInEXT");
parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangCallableMask), "callableDataInEXT");
@@ -7123,175 +7169,187 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.storage = EvqCallableDataIn;
}
-#line 7127 "MachineIndependent/glslang_tab.cpp"
+#line 7173 "MachineIndependent/glslang_tab.cpp"
break;
- case 188: /* storage_qualifier: COHERENT */
-#line 1589 "MachineIndependent/glslang.y"
+ case 190: /* storage_qualifier: COHERENT */
+#line 1607 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.coherent = true;
}
-#line 7136 "MachineIndependent/glslang_tab.cpp"
+#line 7182 "MachineIndependent/glslang_tab.cpp"
break;
- case 189: /* storage_qualifier: DEVICECOHERENT */
-#line 1593 "MachineIndependent/glslang.y"
+ case 191: /* storage_qualifier: DEVICECOHERENT */
+#line 1611 "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 7146 "MachineIndependent/glslang_tab.cpp"
+#line 7192 "MachineIndependent/glslang_tab.cpp"
break;
- case 190: /* storage_qualifier: QUEUEFAMILYCOHERENT */
-#line 1598 "MachineIndependent/glslang.y"
+ case 192: /* storage_qualifier: QUEUEFAMILYCOHERENT */
+#line 1616 "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 7156 "MachineIndependent/glslang_tab.cpp"
+#line 7202 "MachineIndependent/glslang_tab.cpp"
break;
- case 191: /* storage_qualifier: WORKGROUPCOHERENT */
-#line 1603 "MachineIndependent/glslang.y"
+ case 193: /* storage_qualifier: WORKGROUPCOHERENT */
+#line 1621 "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 7166 "MachineIndependent/glslang_tab.cpp"
+#line 7212 "MachineIndependent/glslang_tab.cpp"
break;
- case 192: /* storage_qualifier: SUBGROUPCOHERENT */
-#line 1608 "MachineIndependent/glslang.y"
+ case 194: /* storage_qualifier: SUBGROUPCOHERENT */
+#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, "subgroupcoherent");
(yyval.interm.type).qualifier.subgroupcoherent = true;
}
-#line 7176 "MachineIndependent/glslang_tab.cpp"
+#line 7222 "MachineIndependent/glslang_tab.cpp"
break;
- case 193: /* storage_qualifier: NONPRIVATE */
-#line 1613 "MachineIndependent/glslang.y"
+ case 195: /* storage_qualifier: NONPRIVATE */
+#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, "nonprivate");
(yyval.interm.type).qualifier.nonprivate = true;
}
-#line 7186 "MachineIndependent/glslang_tab.cpp"
+#line 7232 "MachineIndependent/glslang_tab.cpp"
break;
- case 194: /* storage_qualifier: SHADERCALLCOHERENT */
-#line 1618 "MachineIndependent/glslang.y"
+ case 196: /* storage_qualifier: SHADERCALLCOHERENT */
+#line 1636 "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 7196 "MachineIndependent/glslang_tab.cpp"
+#line 7242 "MachineIndependent/glslang_tab.cpp"
break;
- case 195: /* storage_qualifier: VOLATILE */
-#line 1623 "MachineIndependent/glslang.y"
+ case 197: /* storage_qualifier: VOLATILE */
+#line 1641 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.volatil = true;
}
-#line 7205 "MachineIndependent/glslang_tab.cpp"
+#line 7251 "MachineIndependent/glslang_tab.cpp"
break;
- case 196: /* storage_qualifier: RESTRICT */
-#line 1627 "MachineIndependent/glslang.y"
+ case 198: /* storage_qualifier: RESTRICT */
+#line 1645 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.restrict = true;
}
-#line 7214 "MachineIndependent/glslang_tab.cpp"
+#line 7260 "MachineIndependent/glslang_tab.cpp"
break;
- case 197: /* storage_qualifier: READONLY */
-#line 1631 "MachineIndependent/glslang.y"
+ case 199: /* storage_qualifier: READONLY */
+#line 1649 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.readonly = true;
}
-#line 7223 "MachineIndependent/glslang_tab.cpp"
+#line 7269 "MachineIndependent/glslang_tab.cpp"
break;
- case 198: /* storage_qualifier: WRITEONLY */
-#line 1635 "MachineIndependent/glslang.y"
+ case 200: /* storage_qualifier: WRITEONLY */
+#line 1653 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.writeonly = true;
}
-#line 7232 "MachineIndependent/glslang_tab.cpp"
+#line 7278 "MachineIndependent/glslang_tab.cpp"
break;
- case 199: /* storage_qualifier: SUBROUTINE */
-#line 1639 "MachineIndependent/glslang.y"
+ case 201: /* storage_qualifier: SUBROUTINE */
+#line 1657 "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 7243 "MachineIndependent/glslang_tab.cpp"
+#line 7289 "MachineIndependent/glslang_tab.cpp"
break;
- case 200: /* storage_qualifier: SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN */
-#line 1645 "MachineIndependent/glslang.y"
+ case 202: /* storage_qualifier: SUBROUTINE LEFT_PAREN type_name_list RIGHT_PAREN */
+#line 1663 "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 7254 "MachineIndependent/glslang_tab.cpp"
+#line 7300 "MachineIndependent/glslang_tab.cpp"
break;
- case 201: /* non_uniform_qualifier: NONUNIFORM */
-#line 1656 "MachineIndependent/glslang.y"
+ case 203: /* storage_qualifier: TASKPAYLOADWORKGROUPEXT */
+#line 1669 "MachineIndependent/glslang.y"
+ {
+ // No need for profile version or extension check. Shader stage already checks both.
+ parseContext.globalCheck((yyvsp[0].lex).loc, "taskPayloadSharedEXT");
+ parseContext.requireStage((yyvsp[0].lex).loc, (EShLanguageMask)(EShLangTaskMask | EShLangMeshMask), "taskPayloadSharedEXT ");
+ (yyval.interm.type).init((yyvsp[0].lex).loc);
+ (yyval.interm.type).qualifier.storage = EvqtaskPayloadSharedEXT;
+ }
+#line 7312 "MachineIndependent/glslang_tab.cpp"
+ break;
+
+ case 204: /* non_uniform_qualifier: NONUNIFORM */
+#line 1681 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[0].lex).loc);
(yyval.interm.type).qualifier.nonUniform = true;
}
-#line 7263 "MachineIndependent/glslang_tab.cpp"
+#line 7321 "MachineIndependent/glslang_tab.cpp"
break;
- case 202: /* type_name_list: IDENTIFIER */
-#line 1663 "MachineIndependent/glslang.y"
+ case 205: /* type_name_list: IDENTIFIER */
+#line 1688 "MachineIndependent/glslang.y"
{
// TODO
}
-#line 7271 "MachineIndependent/glslang_tab.cpp"
+#line 7329 "MachineIndependent/glslang_tab.cpp"
break;
- case 203: /* type_name_list: type_name_list COMMA IDENTIFIER */
-#line 1666 "MachineIndependent/glslang.y"
+ case 206: /* type_name_list: type_name_list COMMA IDENTIFIER */
+#line 1691 "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 7281 "MachineIndependent/glslang_tab.cpp"
+#line 7339 "MachineIndependent/glslang_tab.cpp"
break;
- case 204: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt */
-#line 1675 "MachineIndependent/glslang.y"
+ case 207: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt */
+#line 1700 "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 7291 "MachineIndependent/glslang_tab.cpp"
+#line 7349 "MachineIndependent/glslang_tab.cpp"
break;
- case 205: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt array_specifier */
-#line 1680 "MachineIndependent/glslang.y"
+ case 208: /* type_specifier: type_specifier_nonarray type_parameter_specifier_opt array_specifier */
+#line 1705 "MachineIndependent/glslang.y"
{
parseContext.arrayOfArrayVersionCheck((yyvsp[0].interm).loc, (yyvsp[0].interm).arraySizes);
(yyval.interm.type) = (yyvsp[-2].interm.type);
@@ -7299,21 +7357,21 @@ yyreduce:
(yyval.interm.type).typeParameters = (yyvsp[-1].interm.typeParameters);
(yyval.interm.type).arraySizes = (yyvsp[0].interm).arraySizes;
}
-#line 7303 "MachineIndependent/glslang_tab.cpp"
+#line 7361 "MachineIndependent/glslang_tab.cpp"
break;
- case 206: /* array_specifier: LEFT_BRACKET RIGHT_BRACKET */
-#line 1690 "MachineIndependent/glslang.y"
+ case 209: /* array_specifier: LEFT_BRACKET RIGHT_BRACKET */
+#line 1715 "MachineIndependent/glslang.y"
{
(yyval.interm).loc = (yyvsp[-1].lex).loc;
(yyval.interm).arraySizes = new TArraySizes;
(yyval.interm).arraySizes->addInnerSize();
}
-#line 7313 "MachineIndependent/glslang_tab.cpp"
+#line 7371 "MachineIndependent/glslang_tab.cpp"
break;
- case 207: /* array_specifier: LEFT_BRACKET conditional_expression RIGHT_BRACKET */
-#line 1695 "MachineIndependent/glslang.y"
+ case 210: /* array_specifier: LEFT_BRACKET conditional_expression RIGHT_BRACKET */
+#line 1720 "MachineIndependent/glslang.y"
{
(yyval.interm).loc = (yyvsp[-2].lex).loc;
(yyval.interm).arraySizes = new TArraySizes;
@@ -7322,20 +7380,20 @@ yyreduce:
parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size");
(yyval.interm).arraySizes->addInnerSize(size);
}
-#line 7326 "MachineIndependent/glslang_tab.cpp"
+#line 7384 "MachineIndependent/glslang_tab.cpp"
break;
- case 208: /* array_specifier: array_specifier LEFT_BRACKET RIGHT_BRACKET */
-#line 1703 "MachineIndependent/glslang.y"
+ case 211: /* array_specifier: array_specifier LEFT_BRACKET RIGHT_BRACKET */
+#line 1728 "MachineIndependent/glslang.y"
{
(yyval.interm) = (yyvsp[-2].interm);
(yyval.interm).arraySizes->addInnerSize();
}
-#line 7335 "MachineIndependent/glslang_tab.cpp"
+#line 7393 "MachineIndependent/glslang_tab.cpp"
break;
- case 209: /* array_specifier: array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET */
-#line 1707 "MachineIndependent/glslang.y"
+ case 212: /* array_specifier: array_specifier LEFT_BRACKET conditional_expression RIGHT_BRACKET */
+#line 1732 "MachineIndependent/glslang.y"
{
(yyval.interm) = (yyvsp[-3].interm);
@@ -7343,35 +7401,35 @@ yyreduce:
parseContext.arraySizeCheck((yyvsp[-1].interm.intermTypedNode)->getLoc(), (yyvsp[-1].interm.intermTypedNode), size, "array size");
(yyval.interm).arraySizes->addInnerSize(size);
}
-#line 7347 "MachineIndependent/glslang_tab.cpp"
+#line 7405 "MachineIndependent/glslang_tab.cpp"
break;
- case 210: /* type_parameter_specifier_opt: type_parameter_specifier */
-#line 1717 "MachineIndependent/glslang.y"
+ case 213: /* type_parameter_specifier_opt: type_parameter_specifier */
+#line 1742 "MachineIndependent/glslang.y"
{
(yyval.interm.typeParameters) = (yyvsp[0].interm.typeParameters);
}
-#line 7355 "MachineIndependent/glslang_tab.cpp"
+#line 7413 "MachineIndependent/glslang_tab.cpp"
break;
- case 211: /* type_parameter_specifier_opt: %empty */
-#line 1720 "MachineIndependent/glslang.y"
+ case 214: /* type_parameter_specifier_opt: %empty */
+#line 1745 "MachineIndependent/glslang.y"
{
(yyval.interm.typeParameters) = 0;
}
-#line 7363 "MachineIndependent/glslang_tab.cpp"
+#line 7421 "MachineIndependent/glslang_tab.cpp"
break;
- case 212: /* type_parameter_specifier: LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE */
-#line 1726 "MachineIndependent/glslang.y"
+ case 215: /* type_parameter_specifier: LEFT_ANGLE type_parameter_specifier_list RIGHT_ANGLE */
+#line 1751 "MachineIndependent/glslang.y"
{
(yyval.interm.typeParameters) = (yyvsp[-1].interm.typeParameters);
}
-#line 7371 "MachineIndependent/glslang_tab.cpp"
+#line 7429 "MachineIndependent/glslang_tab.cpp"
break;
- case 213: /* type_parameter_specifier_list: unary_expression */
-#line 1732 "MachineIndependent/glslang.y"
+ case 216: /* type_parameter_specifier_list: unary_expression */
+#line 1757 "MachineIndependent/glslang.y"
{
(yyval.interm.typeParameters) = new TArraySizes;
@@ -7379,11 +7437,11 @@ yyreduce:
parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter");
(yyval.interm.typeParameters)->addInnerSize(size);
}
-#line 7383 "MachineIndependent/glslang_tab.cpp"
+#line 7441 "MachineIndependent/glslang_tab.cpp"
break;
- case 214: /* type_parameter_specifier_list: type_parameter_specifier_list COMMA unary_expression */
-#line 1739 "MachineIndependent/glslang.y"
+ case 217: /* type_parameter_specifier_list: type_parameter_specifier_list COMMA unary_expression */
+#line 1764 "MachineIndependent/glslang.y"
{
(yyval.interm.typeParameters) = (yyvsp[-2].interm.typeParameters);
@@ -7391,300 +7449,300 @@ yyreduce:
parseContext.arraySizeCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode), size, "type parameter");
(yyval.interm.typeParameters)->addInnerSize(size);
}
-#line 7395 "MachineIndependent/glslang_tab.cpp"
+#line 7453 "MachineIndependent/glslang_tab.cpp"
break;
- case 215: /* type_specifier_nonarray: VOID */
-#line 1749 "MachineIndependent/glslang.y"
+ case 218: /* type_specifier_nonarray: VOID */
+#line 1774 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtVoid;
}
-#line 7404 "MachineIndependent/glslang_tab.cpp"
+#line 7462 "MachineIndependent/glslang_tab.cpp"
break;
- case 216: /* type_specifier_nonarray: FLOAT */
-#line 1753 "MachineIndependent/glslang.y"
+ case 219: /* type_specifier_nonarray: FLOAT */
+#line 1778 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtFloat;
}
-#line 7413 "MachineIndependent/glslang_tab.cpp"
+#line 7471 "MachineIndependent/glslang_tab.cpp"
break;
- case 217: /* type_specifier_nonarray: INT */
-#line 1757 "MachineIndependent/glslang.y"
+ case 220: /* type_specifier_nonarray: INT */
+#line 1782 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtInt;
}
-#line 7422 "MachineIndependent/glslang_tab.cpp"
+#line 7480 "MachineIndependent/glslang_tab.cpp"
break;
- case 218: /* type_specifier_nonarray: UINT */
-#line 1761 "MachineIndependent/glslang.y"
+ case 221: /* type_specifier_nonarray: UINT */
+#line 1786 "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 7432 "MachineIndependent/glslang_tab.cpp"
+#line 7490 "MachineIndependent/glslang_tab.cpp"
break;
- case 219: /* type_specifier_nonarray: BOOL */
-#line 1766 "MachineIndependent/glslang.y"
+ 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 7441 "MachineIndependent/glslang_tab.cpp"
+#line 7499 "MachineIndependent/glslang_tab.cpp"
break;
- case 220: /* type_specifier_nonarray: VEC2 */
-#line 1770 "MachineIndependent/glslang.y"
+ 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 7451 "MachineIndependent/glslang_tab.cpp"
+#line 7509 "MachineIndependent/glslang_tab.cpp"
break;
- case 221: /* type_specifier_nonarray: VEC3 */
-#line 1775 "MachineIndependent/glslang.y"
+ case 224: /* type_specifier_nonarray: VEC3 */
+#line 1800 "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 7461 "MachineIndependent/glslang_tab.cpp"
+#line 7519 "MachineIndependent/glslang_tab.cpp"
break;
- case 222: /* type_specifier_nonarray: VEC4 */
-#line 1780 "MachineIndependent/glslang.y"
+ case 225: /* type_specifier_nonarray: VEC4 */
+#line 1805 "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 7471 "MachineIndependent/glslang_tab.cpp"
+#line 7529 "MachineIndependent/glslang_tab.cpp"
break;
- case 223: /* type_specifier_nonarray: BVEC2 */
-#line 1785 "MachineIndependent/glslang.y"
+ case 226: /* type_specifier_nonarray: BVEC2 */
+#line 1810 "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 7481 "MachineIndependent/glslang_tab.cpp"
+#line 7539 "MachineIndependent/glslang_tab.cpp"
break;
- case 224: /* type_specifier_nonarray: BVEC3 */
-#line 1790 "MachineIndependent/glslang.y"
+ case 227: /* type_specifier_nonarray: BVEC3 */
+#line 1815 "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 7491 "MachineIndependent/glslang_tab.cpp"
+#line 7549 "MachineIndependent/glslang_tab.cpp"
break;
- case 225: /* type_specifier_nonarray: BVEC4 */
-#line 1795 "MachineIndependent/glslang.y"
+ case 228: /* type_specifier_nonarray: BVEC4 */
+#line 1820 "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 7501 "MachineIndependent/glslang_tab.cpp"
+#line 7559 "MachineIndependent/glslang_tab.cpp"
break;
- case 226: /* type_specifier_nonarray: IVEC2 */
-#line 1800 "MachineIndependent/glslang.y"
+ case 229: /* type_specifier_nonarray: IVEC2 */
+#line 1825 "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 7511 "MachineIndependent/glslang_tab.cpp"
+#line 7569 "MachineIndependent/glslang_tab.cpp"
break;
- case 227: /* type_specifier_nonarray: IVEC3 */
-#line 1805 "MachineIndependent/glslang.y"
+ case 230: /* type_specifier_nonarray: IVEC3 */
+#line 1830 "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 7521 "MachineIndependent/glslang_tab.cpp"
+#line 7579 "MachineIndependent/glslang_tab.cpp"
break;
- case 228: /* type_specifier_nonarray: IVEC4 */
-#line 1810 "MachineIndependent/glslang.y"
+ case 231: /* type_specifier_nonarray: IVEC4 */
+#line 1835 "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 7531 "MachineIndependent/glslang_tab.cpp"
+#line 7589 "MachineIndependent/glslang_tab.cpp"
break;
- case 229: /* type_specifier_nonarray: UVEC2 */
-#line 1815 "MachineIndependent/glslang.y"
+ case 232: /* type_specifier_nonarray: UVEC2 */
+#line 1840 "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 7542 "MachineIndependent/glslang_tab.cpp"
+#line 7600 "MachineIndependent/glslang_tab.cpp"
break;
- case 230: /* type_specifier_nonarray: UVEC3 */
-#line 1821 "MachineIndependent/glslang.y"
+ case 233: /* type_specifier_nonarray: UVEC3 */
+#line 1846 "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 7553 "MachineIndependent/glslang_tab.cpp"
+#line 7611 "MachineIndependent/glslang_tab.cpp"
break;
- case 231: /* type_specifier_nonarray: UVEC4 */
-#line 1827 "MachineIndependent/glslang.y"
+ case 234: /* type_specifier_nonarray: UVEC4 */
+#line 1852 "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 7564 "MachineIndependent/glslang_tab.cpp"
+#line 7622 "MachineIndependent/glslang_tab.cpp"
break;
- case 232: /* type_specifier_nonarray: MAT2 */
-#line 1833 "MachineIndependent/glslang.y"
+ case 235: /* type_specifier_nonarray: MAT2 */
+#line 1858 "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 7574 "MachineIndependent/glslang_tab.cpp"
+#line 7632 "MachineIndependent/glslang_tab.cpp"
break;
- case 233: /* type_specifier_nonarray: MAT3 */
-#line 1838 "MachineIndependent/glslang.y"
+ case 236: /* type_specifier_nonarray: MAT3 */
+#line 1863 "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 7584 "MachineIndependent/glslang_tab.cpp"
+#line 7642 "MachineIndependent/glslang_tab.cpp"
break;
- case 234: /* type_specifier_nonarray: MAT4 */
-#line 1843 "MachineIndependent/glslang.y"
+ case 237: /* type_specifier_nonarray: MAT4 */
+#line 1868 "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 7594 "MachineIndependent/glslang_tab.cpp"
+#line 7652 "MachineIndependent/glslang_tab.cpp"
break;
- case 235: /* type_specifier_nonarray: MAT2X2 */
-#line 1848 "MachineIndependent/glslang.y"
+ case 238: /* type_specifier_nonarray: MAT2X2 */
+#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 7604 "MachineIndependent/glslang_tab.cpp"
+#line 7662 "MachineIndependent/glslang_tab.cpp"
break;
- case 236: /* type_specifier_nonarray: MAT2X3 */
-#line 1853 "MachineIndependent/glslang.y"
+ case 239: /* type_specifier_nonarray: MAT2X3 */
+#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(2, 3);
}
-#line 7614 "MachineIndependent/glslang_tab.cpp"
+#line 7672 "MachineIndependent/glslang_tab.cpp"
break;
- case 237: /* type_specifier_nonarray: MAT2X4 */
-#line 1858 "MachineIndependent/glslang.y"
+ case 240: /* type_specifier_nonarray: MAT2X4 */
+#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(2, 4);
}
-#line 7624 "MachineIndependent/glslang_tab.cpp"
+#line 7682 "MachineIndependent/glslang_tab.cpp"
break;
- case 238: /* type_specifier_nonarray: MAT3X2 */
-#line 1863 "MachineIndependent/glslang.y"
+ case 241: /* type_specifier_nonarray: MAT3X2 */
+#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(3, 2);
}
-#line 7634 "MachineIndependent/glslang_tab.cpp"
+#line 7692 "MachineIndependent/glslang_tab.cpp"
break;
- case 239: /* type_specifier_nonarray: MAT3X3 */
-#line 1868 "MachineIndependent/glslang.y"
+ case 242: /* type_specifier_nonarray: MAT3X3 */
+#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(3, 3);
}
-#line 7644 "MachineIndependent/glslang_tab.cpp"
+#line 7702 "MachineIndependent/glslang_tab.cpp"
break;
- case 240: /* type_specifier_nonarray: MAT3X4 */
-#line 1873 "MachineIndependent/glslang.y"
+ case 243: /* type_specifier_nonarray: MAT3X4 */
+#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(3, 4);
}
-#line 7654 "MachineIndependent/glslang_tab.cpp"
+#line 7712 "MachineIndependent/glslang_tab.cpp"
break;
- case 241: /* type_specifier_nonarray: MAT4X2 */
-#line 1878 "MachineIndependent/glslang.y"
+ case 244: /* type_specifier_nonarray: MAT4X2 */
+#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(4, 2);
}
-#line 7664 "MachineIndependent/glslang_tab.cpp"
+#line 7722 "MachineIndependent/glslang_tab.cpp"
break;
- case 242: /* type_specifier_nonarray: MAT4X3 */
-#line 1883 "MachineIndependent/glslang.y"
+ case 245: /* type_specifier_nonarray: MAT4X3 */
+#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(4, 3);
}
-#line 7674 "MachineIndependent/glslang_tab.cpp"
+#line 7732 "MachineIndependent/glslang_tab.cpp"
break;
- case 243: /* type_specifier_nonarray: MAT4X4 */
-#line 1888 "MachineIndependent/glslang.y"
+ case 246: /* type_specifier_nonarray: MAT4X4 */
+#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(4, 4);
}
-#line 7684 "MachineIndependent/glslang_tab.cpp"
+#line 7742 "MachineIndependent/glslang_tab.cpp"
break;
- case 244: /* type_specifier_nonarray: DOUBLE */
-#line 1894 "MachineIndependent/glslang.y"
+ case 247: /* type_specifier_nonarray: DOUBLE */
+#line 1919 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -7692,121 +7750,121 @@ yyreduce:
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtDouble;
}
-#line 7696 "MachineIndependent/glslang_tab.cpp"
+#line 7754 "MachineIndependent/glslang_tab.cpp"
break;
- case 245: /* type_specifier_nonarray: FLOAT16_T */
-#line 1901 "MachineIndependent/glslang.y"
+ case 248: /* type_specifier_nonarray: FLOAT16_T */
+#line 1926 "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 7706 "MachineIndependent/glslang_tab.cpp"
+#line 7764 "MachineIndependent/glslang_tab.cpp"
break;
- case 246: /* type_specifier_nonarray: FLOAT32_T */
-#line 1906 "MachineIndependent/glslang.y"
+ case 249: /* type_specifier_nonarray: FLOAT32_T */
+#line 1931 "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 7716 "MachineIndependent/glslang_tab.cpp"
+#line 7774 "MachineIndependent/glslang_tab.cpp"
break;
- case 247: /* type_specifier_nonarray: FLOAT64_T */
-#line 1911 "MachineIndependent/glslang.y"
+ case 250: /* type_specifier_nonarray: FLOAT64_T */
+#line 1936 "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 7726 "MachineIndependent/glslang_tab.cpp"
+#line 7784 "MachineIndependent/glslang_tab.cpp"
break;
- case 248: /* type_specifier_nonarray: INT8_T */
-#line 1916 "MachineIndependent/glslang.y"
+ case 251: /* type_specifier_nonarray: INT8_T */
+#line 1941 "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 7736 "MachineIndependent/glslang_tab.cpp"
+#line 7794 "MachineIndependent/glslang_tab.cpp"
break;
- case 249: /* type_specifier_nonarray: UINT8_T */
-#line 1921 "MachineIndependent/glslang.y"
+ case 252: /* type_specifier_nonarray: UINT8_T */
+#line 1946 "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 7746 "MachineIndependent/glslang_tab.cpp"
+#line 7804 "MachineIndependent/glslang_tab.cpp"
break;
- case 250: /* type_specifier_nonarray: INT16_T */
-#line 1926 "MachineIndependent/glslang.y"
+ case 253: /* type_specifier_nonarray: INT16_T */
+#line 1951 "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 7756 "MachineIndependent/glslang_tab.cpp"
+#line 7814 "MachineIndependent/glslang_tab.cpp"
break;
- case 251: /* type_specifier_nonarray: UINT16_T */
-#line 1931 "MachineIndependent/glslang.y"
+ case 254: /* type_specifier_nonarray: UINT16_T */
+#line 1956 "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 7766 "MachineIndependent/glslang_tab.cpp"
+#line 7824 "MachineIndependent/glslang_tab.cpp"
break;
- case 252: /* type_specifier_nonarray: INT32_T */
-#line 1936 "MachineIndependent/glslang.y"
+ case 255: /* type_specifier_nonarray: INT32_T */
+#line 1961 "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 7776 "MachineIndependent/glslang_tab.cpp"
+#line 7834 "MachineIndependent/glslang_tab.cpp"
break;
- case 253: /* type_specifier_nonarray: UINT32_T */
-#line 1941 "MachineIndependent/glslang.y"
+ case 256: /* type_specifier_nonarray: UINT32_T */
+#line 1966 "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 7786 "MachineIndependent/glslang_tab.cpp"
+#line 7844 "MachineIndependent/glslang_tab.cpp"
break;
- case 254: /* type_specifier_nonarray: INT64_T */
-#line 1946 "MachineIndependent/glslang.y"
+ case 257: /* type_specifier_nonarray: INT64_T */
+#line 1971 "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 7796 "MachineIndependent/glslang_tab.cpp"
+#line 7854 "MachineIndependent/glslang_tab.cpp"
break;
- case 255: /* type_specifier_nonarray: UINT64_T */
-#line 1951 "MachineIndependent/glslang.y"
+ case 258: /* type_specifier_nonarray: UINT64_T */
+#line 1976 "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 7806 "MachineIndependent/glslang_tab.cpp"
+#line 7864 "MachineIndependent/glslang_tab.cpp"
break;
- case 256: /* type_specifier_nonarray: DVEC2 */
-#line 1956 "MachineIndependent/glslang.y"
+ case 259: /* type_specifier_nonarray: DVEC2 */
+#line 1981 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -7815,11 +7873,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setVector(2);
}
-#line 7819 "MachineIndependent/glslang_tab.cpp"
+#line 7877 "MachineIndependent/glslang_tab.cpp"
break;
- case 257: /* type_specifier_nonarray: DVEC3 */
-#line 1964 "MachineIndependent/glslang.y"
+ case 260: /* type_specifier_nonarray: DVEC3 */
+#line 1989 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -7828,11 +7886,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setVector(3);
}
-#line 7832 "MachineIndependent/glslang_tab.cpp"
+#line 7890 "MachineIndependent/glslang_tab.cpp"
break;
- case 258: /* type_specifier_nonarray: DVEC4 */
-#line 1972 "MachineIndependent/glslang.y"
+ case 261: /* type_specifier_nonarray: DVEC4 */
+#line 1997 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double vector");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -7841,374 +7899,374 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setVector(4);
}
-#line 7845 "MachineIndependent/glslang_tab.cpp"
+#line 7903 "MachineIndependent/glslang_tab.cpp"
break;
- case 259: /* type_specifier_nonarray: F16VEC2 */
-#line 1980 "MachineIndependent/glslang.y"
+ case 262: /* type_specifier_nonarray: F16VEC2 */
+#line 2005 "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 7856 "MachineIndependent/glslang_tab.cpp"
+#line 7914 "MachineIndependent/glslang_tab.cpp"
break;
- case 260: /* type_specifier_nonarray: F16VEC3 */
-#line 1986 "MachineIndependent/glslang.y"
+ case 263: /* type_specifier_nonarray: F16VEC3 */
+#line 2011 "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 7867 "MachineIndependent/glslang_tab.cpp"
+#line 7925 "MachineIndependent/glslang_tab.cpp"
break;
- case 261: /* type_specifier_nonarray: F16VEC4 */
-#line 1992 "MachineIndependent/glslang.y"
+ case 264: /* type_specifier_nonarray: F16VEC4 */
+#line 2017 "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 7878 "MachineIndependent/glslang_tab.cpp"
+#line 7936 "MachineIndependent/glslang_tab.cpp"
break;
- case 262: /* type_specifier_nonarray: F32VEC2 */
-#line 1998 "MachineIndependent/glslang.y"
+ case 265: /* type_specifier_nonarray: F32VEC2 */
+#line 2023 "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 7889 "MachineIndependent/glslang_tab.cpp"
+#line 7947 "MachineIndependent/glslang_tab.cpp"
break;
- case 263: /* type_specifier_nonarray: F32VEC3 */
-#line 2004 "MachineIndependent/glslang.y"
+ case 266: /* type_specifier_nonarray: F32VEC3 */
+#line 2029 "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 7900 "MachineIndependent/glslang_tab.cpp"
+#line 7958 "MachineIndependent/glslang_tab.cpp"
break;
- case 264: /* type_specifier_nonarray: F32VEC4 */
-#line 2010 "MachineIndependent/glslang.y"
+ case 267: /* type_specifier_nonarray: F32VEC4 */
+#line 2035 "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 7911 "MachineIndependent/glslang_tab.cpp"
+#line 7969 "MachineIndependent/glslang_tab.cpp"
break;
- case 265: /* type_specifier_nonarray: F64VEC2 */
-#line 2016 "MachineIndependent/glslang.y"
+ case 268: /* type_specifier_nonarray: F64VEC2 */
+#line 2041 "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 7922 "MachineIndependent/glslang_tab.cpp"
+#line 7980 "MachineIndependent/glslang_tab.cpp"
break;
- case 266: /* type_specifier_nonarray: F64VEC3 */
-#line 2022 "MachineIndependent/glslang.y"
+ case 269: /* type_specifier_nonarray: F64VEC3 */
+#line 2047 "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 7933 "MachineIndependent/glslang_tab.cpp"
+#line 7991 "MachineIndependent/glslang_tab.cpp"
break;
- case 267: /* type_specifier_nonarray: F64VEC4 */
-#line 2028 "MachineIndependent/glslang.y"
+ case 270: /* type_specifier_nonarray: F64VEC4 */
+#line 2053 "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 7944 "MachineIndependent/glslang_tab.cpp"
+#line 8002 "MachineIndependent/glslang_tab.cpp"
break;
- case 268: /* type_specifier_nonarray: I8VEC2 */
-#line 2034 "MachineIndependent/glslang.y"
+ case 271: /* type_specifier_nonarray: I8VEC2 */
+#line 2059 "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 7955 "MachineIndependent/glslang_tab.cpp"
+#line 8013 "MachineIndependent/glslang_tab.cpp"
break;
- case 269: /* type_specifier_nonarray: I8VEC3 */
-#line 2040 "MachineIndependent/glslang.y"
+ case 272: /* type_specifier_nonarray: I8VEC3 */
+#line 2065 "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 7966 "MachineIndependent/glslang_tab.cpp"
+#line 8024 "MachineIndependent/glslang_tab.cpp"
break;
- case 270: /* type_specifier_nonarray: I8VEC4 */
-#line 2046 "MachineIndependent/glslang.y"
+ case 273: /* type_specifier_nonarray: I8VEC4 */
+#line 2071 "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 7977 "MachineIndependent/glslang_tab.cpp"
+#line 8035 "MachineIndependent/glslang_tab.cpp"
break;
- case 271: /* type_specifier_nonarray: I16VEC2 */
-#line 2052 "MachineIndependent/glslang.y"
+ case 274: /* type_specifier_nonarray: I16VEC2 */
+#line 2077 "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 7988 "MachineIndependent/glslang_tab.cpp"
+#line 8046 "MachineIndependent/glslang_tab.cpp"
break;
- case 272: /* type_specifier_nonarray: I16VEC3 */
-#line 2058 "MachineIndependent/glslang.y"
+ case 275: /* type_specifier_nonarray: I16VEC3 */
+#line 2083 "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 7999 "MachineIndependent/glslang_tab.cpp"
+#line 8057 "MachineIndependent/glslang_tab.cpp"
break;
- case 273: /* type_specifier_nonarray: I16VEC4 */
-#line 2064 "MachineIndependent/glslang.y"
+ case 276: /* type_specifier_nonarray: I16VEC4 */
+#line 2089 "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 8010 "MachineIndependent/glslang_tab.cpp"
+#line 8068 "MachineIndependent/glslang_tab.cpp"
break;
- case 274: /* type_specifier_nonarray: I32VEC2 */
-#line 2070 "MachineIndependent/glslang.y"
+ case 277: /* type_specifier_nonarray: I32VEC2 */
+#line 2095 "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 8021 "MachineIndependent/glslang_tab.cpp"
+#line 8079 "MachineIndependent/glslang_tab.cpp"
break;
- case 275: /* type_specifier_nonarray: I32VEC3 */
-#line 2076 "MachineIndependent/glslang.y"
+ case 278: /* type_specifier_nonarray: I32VEC3 */
+#line 2101 "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 8032 "MachineIndependent/glslang_tab.cpp"
+#line 8090 "MachineIndependent/glslang_tab.cpp"
break;
- case 276: /* type_specifier_nonarray: I32VEC4 */
-#line 2082 "MachineIndependent/glslang.y"
+ case 279: /* type_specifier_nonarray: I32VEC4 */
+#line 2107 "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 8043 "MachineIndependent/glslang_tab.cpp"
+#line 8101 "MachineIndependent/glslang_tab.cpp"
break;
- case 277: /* type_specifier_nonarray: I64VEC2 */
-#line 2088 "MachineIndependent/glslang.y"
+ case 280: /* type_specifier_nonarray: I64VEC2 */
+#line 2113 "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 8054 "MachineIndependent/glslang_tab.cpp"
+#line 8112 "MachineIndependent/glslang_tab.cpp"
break;
- case 278: /* type_specifier_nonarray: I64VEC3 */
-#line 2094 "MachineIndependent/glslang.y"
+ case 281: /* type_specifier_nonarray: I64VEC3 */
+#line 2119 "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 8065 "MachineIndependent/glslang_tab.cpp"
+#line 8123 "MachineIndependent/glslang_tab.cpp"
break;
- case 279: /* type_specifier_nonarray: I64VEC4 */
-#line 2100 "MachineIndependent/glslang.y"
+ case 282: /* type_specifier_nonarray: I64VEC4 */
+#line 2125 "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 8076 "MachineIndependent/glslang_tab.cpp"
+#line 8134 "MachineIndependent/glslang_tab.cpp"
break;
- case 280: /* type_specifier_nonarray: U8VEC2 */
-#line 2106 "MachineIndependent/glslang.y"
+ case 283: /* type_specifier_nonarray: U8VEC2 */
+#line 2131 "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 8087 "MachineIndependent/glslang_tab.cpp"
+#line 8145 "MachineIndependent/glslang_tab.cpp"
break;
- case 281: /* type_specifier_nonarray: U8VEC3 */
-#line 2112 "MachineIndependent/glslang.y"
+ case 284: /* type_specifier_nonarray: U8VEC3 */
+#line 2137 "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 8098 "MachineIndependent/glslang_tab.cpp"
+#line 8156 "MachineIndependent/glslang_tab.cpp"
break;
- case 282: /* type_specifier_nonarray: U8VEC4 */
-#line 2118 "MachineIndependent/glslang.y"
+ case 285: /* type_specifier_nonarray: U8VEC4 */
+#line 2143 "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 8109 "MachineIndependent/glslang_tab.cpp"
+#line 8167 "MachineIndependent/glslang_tab.cpp"
break;
- case 283: /* type_specifier_nonarray: U16VEC2 */
-#line 2124 "MachineIndependent/glslang.y"
+ case 286: /* type_specifier_nonarray: U16VEC2 */
+#line 2149 "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 8120 "MachineIndependent/glslang_tab.cpp"
+#line 8178 "MachineIndependent/glslang_tab.cpp"
break;
- case 284: /* type_specifier_nonarray: U16VEC3 */
-#line 2130 "MachineIndependent/glslang.y"
+ case 287: /* type_specifier_nonarray: U16VEC3 */
+#line 2155 "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 8131 "MachineIndependent/glslang_tab.cpp"
+#line 8189 "MachineIndependent/glslang_tab.cpp"
break;
- case 285: /* type_specifier_nonarray: U16VEC4 */
-#line 2136 "MachineIndependent/glslang.y"
+ case 288: /* type_specifier_nonarray: U16VEC4 */
+#line 2161 "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 8142 "MachineIndependent/glslang_tab.cpp"
+#line 8200 "MachineIndependent/glslang_tab.cpp"
break;
- case 286: /* type_specifier_nonarray: U32VEC2 */
-#line 2142 "MachineIndependent/glslang.y"
+ case 289: /* type_specifier_nonarray: U32VEC2 */
+#line 2167 "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 8153 "MachineIndependent/glslang_tab.cpp"
+#line 8211 "MachineIndependent/glslang_tab.cpp"
break;
- case 287: /* type_specifier_nonarray: U32VEC3 */
-#line 2148 "MachineIndependent/glslang.y"
+ case 290: /* type_specifier_nonarray: U32VEC3 */
+#line 2173 "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 8164 "MachineIndependent/glslang_tab.cpp"
+#line 8222 "MachineIndependent/glslang_tab.cpp"
break;
- case 288: /* type_specifier_nonarray: U32VEC4 */
-#line 2154 "MachineIndependent/glslang.y"
+ case 291: /* type_specifier_nonarray: U32VEC4 */
+#line 2179 "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 8175 "MachineIndependent/glslang_tab.cpp"
+#line 8233 "MachineIndependent/glslang_tab.cpp"
break;
- case 289: /* type_specifier_nonarray: U64VEC2 */
-#line 2160 "MachineIndependent/glslang.y"
+ case 292: /* type_specifier_nonarray: U64VEC2 */
+#line 2185 "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 8186 "MachineIndependent/glslang_tab.cpp"
+#line 8244 "MachineIndependent/glslang_tab.cpp"
break;
- case 290: /* type_specifier_nonarray: U64VEC3 */
-#line 2166 "MachineIndependent/glslang.y"
+ case 293: /* type_specifier_nonarray: U64VEC3 */
+#line 2191 "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 8197 "MachineIndependent/glslang_tab.cpp"
+#line 8255 "MachineIndependent/glslang_tab.cpp"
break;
- case 291: /* type_specifier_nonarray: U64VEC4 */
-#line 2172 "MachineIndependent/glslang.y"
+ case 294: /* type_specifier_nonarray: U64VEC4 */
+#line 2197 "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 8208 "MachineIndependent/glslang_tab.cpp"
+#line 8266 "MachineIndependent/glslang_tab.cpp"
break;
- case 292: /* type_specifier_nonarray: DMAT2 */
-#line 2178 "MachineIndependent/glslang.y"
+ case 295: /* type_specifier_nonarray: DMAT2 */
+#line 2203 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -8217,11 +8275,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setMatrix(2, 2);
}
-#line 8221 "MachineIndependent/glslang_tab.cpp"
+#line 8279 "MachineIndependent/glslang_tab.cpp"
break;
- case 293: /* type_specifier_nonarray: DMAT3 */
-#line 2186 "MachineIndependent/glslang.y"
+ case 296: /* type_specifier_nonarray: DMAT3 */
+#line 2211 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -8230,11 +8288,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setMatrix(3, 3);
}
-#line 8234 "MachineIndependent/glslang_tab.cpp"
+#line 8292 "MachineIndependent/glslang_tab.cpp"
break;
- case 294: /* type_specifier_nonarray: DMAT4 */
-#line 2194 "MachineIndependent/glslang.y"
+ case 297: /* type_specifier_nonarray: DMAT4 */
+#line 2219 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -8243,11 +8301,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setMatrix(4, 4);
}
-#line 8247 "MachineIndependent/glslang_tab.cpp"
+#line 8305 "MachineIndependent/glslang_tab.cpp"
break;
- case 295: /* type_specifier_nonarray: DMAT2X2 */
-#line 2202 "MachineIndependent/glslang.y"
+ case 298: /* type_specifier_nonarray: DMAT2X2 */
+#line 2227 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -8256,11 +8314,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setMatrix(2, 2);
}
-#line 8260 "MachineIndependent/glslang_tab.cpp"
+#line 8318 "MachineIndependent/glslang_tab.cpp"
break;
- case 296: /* type_specifier_nonarray: DMAT2X3 */
-#line 2210 "MachineIndependent/glslang.y"
+ case 299: /* type_specifier_nonarray: DMAT2X3 */
+#line 2235 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -8269,11 +8327,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setMatrix(2, 3);
}
-#line 8273 "MachineIndependent/glslang_tab.cpp"
+#line 8331 "MachineIndependent/glslang_tab.cpp"
break;
- case 297: /* type_specifier_nonarray: DMAT2X4 */
-#line 2218 "MachineIndependent/glslang.y"
+ case 300: /* type_specifier_nonarray: DMAT2X4 */
+#line 2243 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -8282,11 +8340,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setMatrix(2, 4);
}
-#line 8286 "MachineIndependent/glslang_tab.cpp"
+#line 8344 "MachineIndependent/glslang_tab.cpp"
break;
- case 298: /* type_specifier_nonarray: DMAT3X2 */
-#line 2226 "MachineIndependent/glslang.y"
+ case 301: /* type_specifier_nonarray: DMAT3X2 */
+#line 2251 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -8295,11 +8353,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setMatrix(3, 2);
}
-#line 8299 "MachineIndependent/glslang_tab.cpp"
+#line 8357 "MachineIndependent/glslang_tab.cpp"
break;
- case 299: /* type_specifier_nonarray: DMAT3X3 */
-#line 2234 "MachineIndependent/glslang.y"
+ case 302: /* type_specifier_nonarray: DMAT3X3 */
+#line 2259 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -8308,11 +8366,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setMatrix(3, 3);
}
-#line 8312 "MachineIndependent/glslang_tab.cpp"
+#line 8370 "MachineIndependent/glslang_tab.cpp"
break;
- case 300: /* type_specifier_nonarray: DMAT3X4 */
-#line 2242 "MachineIndependent/glslang.y"
+ case 303: /* type_specifier_nonarray: DMAT3X4 */
+#line 2267 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -8321,11 +8379,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setMatrix(3, 4);
}
-#line 8325 "MachineIndependent/glslang_tab.cpp"
+#line 8383 "MachineIndependent/glslang_tab.cpp"
break;
- case 301: /* type_specifier_nonarray: DMAT4X2 */
-#line 2250 "MachineIndependent/glslang.y"
+ case 304: /* type_specifier_nonarray: DMAT4X2 */
+#line 2275 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -8334,11 +8392,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setMatrix(4, 2);
}
-#line 8338 "MachineIndependent/glslang_tab.cpp"
+#line 8396 "MachineIndependent/glslang_tab.cpp"
break;
- case 302: /* type_specifier_nonarray: DMAT4X3 */
-#line 2258 "MachineIndependent/glslang.y"
+ case 305: /* type_specifier_nonarray: DMAT4X3 */
+#line 2283 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -8347,11 +8405,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setMatrix(4, 3);
}
-#line 8351 "MachineIndependent/glslang_tab.cpp"
+#line 8409 "MachineIndependent/glslang_tab.cpp"
break;
- case 303: /* type_specifier_nonarray: DMAT4X4 */
-#line 2266 "MachineIndependent/glslang.y"
+ case 306: /* type_specifier_nonarray: DMAT4X4 */
+#line 2291 "MachineIndependent/glslang.y"
{
parseContext.requireProfile((yyvsp[0].lex).loc, ECoreProfile | ECompatibilityProfile, "double matrix");
if (! parseContext.symbolTable.atBuiltInLevel())
@@ -8360,2228 +8418,2228 @@ yyreduce:
(yyval.interm.type).basicType = EbtDouble;
(yyval.interm.type).setMatrix(4, 4);
}
-#line 8364 "MachineIndependent/glslang_tab.cpp"
+#line 8422 "MachineIndependent/glslang_tab.cpp"
break;
- case 304: /* type_specifier_nonarray: F16MAT2 */
-#line 2274 "MachineIndependent/glslang.y"
+ case 307: /* type_specifier_nonarray: F16MAT2 */
+#line 2299 "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 8375 "MachineIndependent/glslang_tab.cpp"
+#line 8433 "MachineIndependent/glslang_tab.cpp"
break;
- case 305: /* type_specifier_nonarray: F16MAT3 */
-#line 2280 "MachineIndependent/glslang.y"
+ case 308: /* type_specifier_nonarray: F16MAT3 */
+#line 2305 "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 8386 "MachineIndependent/glslang_tab.cpp"
+#line 8444 "MachineIndependent/glslang_tab.cpp"
break;
- case 306: /* type_specifier_nonarray: F16MAT4 */
-#line 2286 "MachineIndependent/glslang.y"
+ case 309: /* type_specifier_nonarray: F16MAT4 */
+#line 2311 "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 8397 "MachineIndependent/glslang_tab.cpp"
+#line 8455 "MachineIndependent/glslang_tab.cpp"
break;
- case 307: /* type_specifier_nonarray: F16MAT2X2 */
-#line 2292 "MachineIndependent/glslang.y"
+ case 310: /* type_specifier_nonarray: F16MAT2X2 */
+#line 2317 "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 8408 "MachineIndependent/glslang_tab.cpp"
+#line 8466 "MachineIndependent/glslang_tab.cpp"
break;
- case 308: /* type_specifier_nonarray: F16MAT2X3 */
-#line 2298 "MachineIndependent/glslang.y"
+ case 311: /* type_specifier_nonarray: F16MAT2X3 */
+#line 2323 "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 8419 "MachineIndependent/glslang_tab.cpp"
+#line 8477 "MachineIndependent/glslang_tab.cpp"
break;
- case 309: /* type_specifier_nonarray: F16MAT2X4 */
-#line 2304 "MachineIndependent/glslang.y"
+ case 312: /* type_specifier_nonarray: F16MAT2X4 */
+#line 2329 "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 8430 "MachineIndependent/glslang_tab.cpp"
+#line 8488 "MachineIndependent/glslang_tab.cpp"
break;
- case 310: /* type_specifier_nonarray: F16MAT3X2 */
-#line 2310 "MachineIndependent/glslang.y"
+ case 313: /* type_specifier_nonarray: F16MAT3X2 */
+#line 2335 "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 8441 "MachineIndependent/glslang_tab.cpp"
+#line 8499 "MachineIndependent/glslang_tab.cpp"
break;
- case 311: /* type_specifier_nonarray: F16MAT3X3 */
-#line 2316 "MachineIndependent/glslang.y"
+ case 314: /* type_specifier_nonarray: F16MAT3X3 */
+#line 2341 "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 8452 "MachineIndependent/glslang_tab.cpp"
+#line 8510 "MachineIndependent/glslang_tab.cpp"
break;
- case 312: /* type_specifier_nonarray: F16MAT3X4 */
-#line 2322 "MachineIndependent/glslang.y"
+ case 315: /* type_specifier_nonarray: F16MAT3X4 */
+#line 2347 "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 8463 "MachineIndependent/glslang_tab.cpp"
+#line 8521 "MachineIndependent/glslang_tab.cpp"
break;
- case 313: /* type_specifier_nonarray: F16MAT4X2 */
-#line 2328 "MachineIndependent/glslang.y"
+ case 316: /* type_specifier_nonarray: F16MAT4X2 */
+#line 2353 "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 8474 "MachineIndependent/glslang_tab.cpp"
+#line 8532 "MachineIndependent/glslang_tab.cpp"
break;
- case 314: /* type_specifier_nonarray: F16MAT4X3 */
-#line 2334 "MachineIndependent/glslang.y"
+ case 317: /* type_specifier_nonarray: F16MAT4X3 */
+#line 2359 "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 8485 "MachineIndependent/glslang_tab.cpp"
+#line 8543 "MachineIndependent/glslang_tab.cpp"
break;
- case 315: /* type_specifier_nonarray: F16MAT4X4 */
-#line 2340 "MachineIndependent/glslang.y"
+ case 318: /* type_specifier_nonarray: F16MAT4X4 */
+#line 2365 "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 8496 "MachineIndependent/glslang_tab.cpp"
+#line 8554 "MachineIndependent/glslang_tab.cpp"
break;
- case 316: /* type_specifier_nonarray: F32MAT2 */
-#line 2346 "MachineIndependent/glslang.y"
+ case 319: /* type_specifier_nonarray: F32MAT2 */
+#line 2371 "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 8507 "MachineIndependent/glslang_tab.cpp"
+#line 8565 "MachineIndependent/glslang_tab.cpp"
break;
- case 317: /* type_specifier_nonarray: F32MAT3 */
-#line 2352 "MachineIndependent/glslang.y"
+ case 320: /* type_specifier_nonarray: F32MAT3 */
+#line 2377 "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 8518 "MachineIndependent/glslang_tab.cpp"
+#line 8576 "MachineIndependent/glslang_tab.cpp"
break;
- case 318: /* type_specifier_nonarray: F32MAT4 */
-#line 2358 "MachineIndependent/glslang.y"
+ case 321: /* type_specifier_nonarray: F32MAT4 */
+#line 2383 "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 8529 "MachineIndependent/glslang_tab.cpp"
+#line 8587 "MachineIndependent/glslang_tab.cpp"
break;
- case 319: /* type_specifier_nonarray: F32MAT2X2 */
-#line 2364 "MachineIndependent/glslang.y"
+ case 322: /* type_specifier_nonarray: F32MAT2X2 */
+#line 2389 "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 8540 "MachineIndependent/glslang_tab.cpp"
+#line 8598 "MachineIndependent/glslang_tab.cpp"
break;
- case 320: /* type_specifier_nonarray: F32MAT2X3 */
-#line 2370 "MachineIndependent/glslang.y"
+ case 323: /* type_specifier_nonarray: F32MAT2X3 */
+#line 2395 "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 8551 "MachineIndependent/glslang_tab.cpp"
+#line 8609 "MachineIndependent/glslang_tab.cpp"
break;
- case 321: /* type_specifier_nonarray: F32MAT2X4 */
-#line 2376 "MachineIndependent/glslang.y"
+ case 324: /* type_specifier_nonarray: F32MAT2X4 */
+#line 2401 "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 8562 "MachineIndependent/glslang_tab.cpp"
+#line 8620 "MachineIndependent/glslang_tab.cpp"
break;
- case 322: /* type_specifier_nonarray: F32MAT3X2 */
-#line 2382 "MachineIndependent/glslang.y"
+ case 325: /* type_specifier_nonarray: F32MAT3X2 */
+#line 2407 "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 8573 "MachineIndependent/glslang_tab.cpp"
+#line 8631 "MachineIndependent/glslang_tab.cpp"
break;
- case 323: /* type_specifier_nonarray: F32MAT3X3 */
-#line 2388 "MachineIndependent/glslang.y"
+ case 326: /* type_specifier_nonarray: F32MAT3X3 */
+#line 2413 "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 8584 "MachineIndependent/glslang_tab.cpp"
+#line 8642 "MachineIndependent/glslang_tab.cpp"
break;
- case 324: /* type_specifier_nonarray: F32MAT3X4 */
-#line 2394 "MachineIndependent/glslang.y"
+ case 327: /* type_specifier_nonarray: F32MAT3X4 */
+#line 2419 "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 8595 "MachineIndependent/glslang_tab.cpp"
+#line 8653 "MachineIndependent/glslang_tab.cpp"
break;
- case 325: /* type_specifier_nonarray: F32MAT4X2 */
-#line 2400 "MachineIndependent/glslang.y"
+ case 328: /* type_specifier_nonarray: F32MAT4X2 */
+#line 2425 "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 8606 "MachineIndependent/glslang_tab.cpp"
+#line 8664 "MachineIndependent/glslang_tab.cpp"
break;
- case 326: /* type_specifier_nonarray: F32MAT4X3 */
-#line 2406 "MachineIndependent/glslang.y"
+ case 329: /* type_specifier_nonarray: F32MAT4X3 */
+#line 2431 "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 8617 "MachineIndependent/glslang_tab.cpp"
+#line 8675 "MachineIndependent/glslang_tab.cpp"
break;
- case 327: /* type_specifier_nonarray: F32MAT4X4 */
-#line 2412 "MachineIndependent/glslang.y"
+ case 330: /* type_specifier_nonarray: F32MAT4X4 */
+#line 2437 "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 8628 "MachineIndependent/glslang_tab.cpp"
+#line 8686 "MachineIndependent/glslang_tab.cpp"
break;
- case 328: /* type_specifier_nonarray: F64MAT2 */
-#line 2418 "MachineIndependent/glslang.y"
+ case 331: /* type_specifier_nonarray: F64MAT2 */
+#line 2443 "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 8639 "MachineIndependent/glslang_tab.cpp"
+#line 8697 "MachineIndependent/glslang_tab.cpp"
break;
- case 329: /* type_specifier_nonarray: F64MAT3 */
-#line 2424 "MachineIndependent/glslang.y"
+ case 332: /* type_specifier_nonarray: F64MAT3 */
+#line 2449 "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 8650 "MachineIndependent/glslang_tab.cpp"
+#line 8708 "MachineIndependent/glslang_tab.cpp"
break;
- case 330: /* type_specifier_nonarray: F64MAT4 */
-#line 2430 "MachineIndependent/glslang.y"
+ case 333: /* type_specifier_nonarray: F64MAT4 */
+#line 2455 "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 8661 "MachineIndependent/glslang_tab.cpp"
+#line 8719 "MachineIndependent/glslang_tab.cpp"
break;
- case 331: /* type_specifier_nonarray: F64MAT2X2 */
-#line 2436 "MachineIndependent/glslang.y"
+ case 334: /* type_specifier_nonarray: F64MAT2X2 */
+#line 2461 "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 8672 "MachineIndependent/glslang_tab.cpp"
+#line 8730 "MachineIndependent/glslang_tab.cpp"
break;
- case 332: /* type_specifier_nonarray: F64MAT2X3 */
-#line 2442 "MachineIndependent/glslang.y"
+ case 335: /* type_specifier_nonarray: F64MAT2X3 */
+#line 2467 "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 8683 "MachineIndependent/glslang_tab.cpp"
+#line 8741 "MachineIndependent/glslang_tab.cpp"
break;
- case 333: /* type_specifier_nonarray: F64MAT2X4 */
-#line 2448 "MachineIndependent/glslang.y"
+ case 336: /* type_specifier_nonarray: F64MAT2X4 */
+#line 2473 "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 8694 "MachineIndependent/glslang_tab.cpp"
+#line 8752 "MachineIndependent/glslang_tab.cpp"
break;
- case 334: /* type_specifier_nonarray: F64MAT3X2 */
-#line 2454 "MachineIndependent/glslang.y"
+ case 337: /* type_specifier_nonarray: F64MAT3X2 */
+#line 2479 "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 8705 "MachineIndependent/glslang_tab.cpp"
+#line 8763 "MachineIndependent/glslang_tab.cpp"
break;
- case 335: /* type_specifier_nonarray: F64MAT3X3 */
-#line 2460 "MachineIndependent/glslang.y"
+ case 338: /* type_specifier_nonarray: F64MAT3X3 */
+#line 2485 "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 8716 "MachineIndependent/glslang_tab.cpp"
+#line 8774 "MachineIndependent/glslang_tab.cpp"
break;
- case 336: /* type_specifier_nonarray: F64MAT3X4 */
-#line 2466 "MachineIndependent/glslang.y"
+ case 339: /* type_specifier_nonarray: F64MAT3X4 */
+#line 2491 "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 8727 "MachineIndependent/glslang_tab.cpp"
+#line 8785 "MachineIndependent/glslang_tab.cpp"
break;
- case 337: /* type_specifier_nonarray: F64MAT4X2 */
-#line 2472 "MachineIndependent/glslang.y"
+ case 340: /* type_specifier_nonarray: F64MAT4X2 */
+#line 2497 "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 8738 "MachineIndependent/glslang_tab.cpp"
+#line 8796 "MachineIndependent/glslang_tab.cpp"
break;
- case 338: /* type_specifier_nonarray: F64MAT4X3 */
-#line 2478 "MachineIndependent/glslang.y"
+ case 341: /* type_specifier_nonarray: F64MAT4X3 */
+#line 2503 "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 8749 "MachineIndependent/glslang_tab.cpp"
+#line 8807 "MachineIndependent/glslang_tab.cpp"
break;
- case 339: /* type_specifier_nonarray: F64MAT4X4 */
-#line 2484 "MachineIndependent/glslang.y"
+ case 342: /* type_specifier_nonarray: F64MAT4X4 */
+#line 2509 "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 8760 "MachineIndependent/glslang_tab.cpp"
+#line 8818 "MachineIndependent/glslang_tab.cpp"
break;
- case 340: /* type_specifier_nonarray: ACCSTRUCTNV */
-#line 2490 "MachineIndependent/glslang.y"
+ case 343: /* type_specifier_nonarray: ACCSTRUCTNV */
+#line 2515 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtAccStruct;
}
-#line 8769 "MachineIndependent/glslang_tab.cpp"
+#line 8827 "MachineIndependent/glslang_tab.cpp"
break;
- case 341: /* type_specifier_nonarray: ACCSTRUCTEXT */
-#line 2494 "MachineIndependent/glslang.y"
+ case 344: /* type_specifier_nonarray: ACCSTRUCTEXT */
+#line 2519 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtAccStruct;
}
-#line 8778 "MachineIndependent/glslang_tab.cpp"
+#line 8836 "MachineIndependent/glslang_tab.cpp"
break;
- case 342: /* type_specifier_nonarray: RAYQUERYEXT */
-#line 2498 "MachineIndependent/glslang.y"
+ case 345: /* type_specifier_nonarray: RAYQUERYEXT */
+#line 2523 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[0].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).basicType = EbtRayQuery;
}
-#line 8787 "MachineIndependent/glslang_tab.cpp"
+#line 8845 "MachineIndependent/glslang_tab.cpp"
break;
- case 343: /* type_specifier_nonarray: ATOMIC_UINT */
-#line 2502 "MachineIndependent/glslang.y"
+ case 346: /* type_specifier_nonarray: ATOMIC_UINT */
+#line 2527 "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 8797 "MachineIndependent/glslang_tab.cpp"
+#line 8855 "MachineIndependent/glslang_tab.cpp"
break;
- case 344: /* type_specifier_nonarray: SAMPLER1D */
-#line 2507 "MachineIndependent/glslang.y"
+ case 347: /* type_specifier_nonarray: SAMPLER1D */
+#line 2532 "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 8807 "MachineIndependent/glslang_tab.cpp"
+#line 8865 "MachineIndependent/glslang_tab.cpp"
break;
- case 345: /* type_specifier_nonarray: SAMPLER2D */
-#line 2513 "MachineIndependent/glslang.y"
+ case 348: /* type_specifier_nonarray: SAMPLER2D */
+#line 2538 "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 8817 "MachineIndependent/glslang_tab.cpp"
+#line 8875 "MachineIndependent/glslang_tab.cpp"
break;
- case 346: /* type_specifier_nonarray: SAMPLER3D */
-#line 2518 "MachineIndependent/glslang.y"
+ case 349: /* type_specifier_nonarray: SAMPLER3D */
+#line 2543 "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 8827 "MachineIndependent/glslang_tab.cpp"
+#line 8885 "MachineIndependent/glslang_tab.cpp"
break;
- case 347: /* type_specifier_nonarray: SAMPLERCUBE */
-#line 2523 "MachineIndependent/glslang.y"
+ case 350: /* type_specifier_nonarray: SAMPLERCUBE */
+#line 2548 "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 8837 "MachineIndependent/glslang_tab.cpp"
+#line 8895 "MachineIndependent/glslang_tab.cpp"
break;
- case 348: /* type_specifier_nonarray: SAMPLER2DSHADOW */
-#line 2528 "MachineIndependent/glslang.y"
+ case 351: /* type_specifier_nonarray: SAMPLER2DSHADOW */
+#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, false, true);
}
-#line 8847 "MachineIndependent/glslang_tab.cpp"
+#line 8905 "MachineIndependent/glslang_tab.cpp"
break;
- case 349: /* type_specifier_nonarray: SAMPLERCUBESHADOW */
-#line 2533 "MachineIndependent/glslang.y"
+ case 352: /* type_specifier_nonarray: SAMPLERCUBESHADOW */
+#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, EsdCube, false, true);
}
-#line 8857 "MachineIndependent/glslang_tab.cpp"
+#line 8915 "MachineIndependent/glslang_tab.cpp"
break;
- case 350: /* type_specifier_nonarray: SAMPLER2DARRAY */
-#line 2538 "MachineIndependent/glslang.y"
+ case 353: /* type_specifier_nonarray: SAMPLER2DARRAY */
+#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, Esd2D, true);
}
-#line 8867 "MachineIndependent/glslang_tab.cpp"
+#line 8925 "MachineIndependent/glslang_tab.cpp"
break;
- case 351: /* type_specifier_nonarray: SAMPLER2DARRAYSHADOW */
-#line 2543 "MachineIndependent/glslang.y"
+ case 354: /* type_specifier_nonarray: SAMPLER2DARRAYSHADOW */
+#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, true, true);
}
-#line 8877 "MachineIndependent/glslang_tab.cpp"
+#line 8935 "MachineIndependent/glslang_tab.cpp"
break;
- case 352: /* type_specifier_nonarray: SAMPLER1DSHADOW */
-#line 2549 "MachineIndependent/glslang.y"
+ case 355: /* type_specifier_nonarray: SAMPLER1DSHADOW */
+#line 2574 "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 8887 "MachineIndependent/glslang_tab.cpp"
+#line 8945 "MachineIndependent/glslang_tab.cpp"
break;
- case 353: /* type_specifier_nonarray: SAMPLER1DARRAY */
-#line 2554 "MachineIndependent/glslang.y"
+ case 356: /* type_specifier_nonarray: SAMPLER1DARRAY */
+#line 2579 "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 8897 "MachineIndependent/glslang_tab.cpp"
+#line 8955 "MachineIndependent/glslang_tab.cpp"
break;
- case 354: /* type_specifier_nonarray: SAMPLER1DARRAYSHADOW */
-#line 2559 "MachineIndependent/glslang.y"
+ case 357: /* type_specifier_nonarray: SAMPLER1DARRAYSHADOW */
+#line 2584 "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 8907 "MachineIndependent/glslang_tab.cpp"
+#line 8965 "MachineIndependent/glslang_tab.cpp"
break;
- case 355: /* type_specifier_nonarray: SAMPLERCUBEARRAY */
-#line 2564 "MachineIndependent/glslang.y"
+ case 358: /* type_specifier_nonarray: SAMPLERCUBEARRAY */
+#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, EsdCube, true);
}
-#line 8917 "MachineIndependent/glslang_tab.cpp"
+#line 8975 "MachineIndependent/glslang_tab.cpp"
break;
- case 356: /* type_specifier_nonarray: SAMPLERCUBEARRAYSHADOW */
-#line 2569 "MachineIndependent/glslang.y"
+ case 359: /* type_specifier_nonarray: SAMPLERCUBEARRAYSHADOW */
+#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, EsdCube, true, true);
}
-#line 8927 "MachineIndependent/glslang_tab.cpp"
+#line 8985 "MachineIndependent/glslang_tab.cpp"
break;
- case 357: /* type_specifier_nonarray: F16SAMPLER1D */
-#line 2574 "MachineIndependent/glslang.y"
+ case 360: /* type_specifier_nonarray: F16SAMPLER1D */
+#line 2599 "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 8938 "MachineIndependent/glslang_tab.cpp"
+#line 8996 "MachineIndependent/glslang_tab.cpp"
break;
- case 358: /* type_specifier_nonarray: F16SAMPLER2D */
-#line 2580 "MachineIndependent/glslang.y"
+ case 361: /* type_specifier_nonarray: F16SAMPLER2D */
+#line 2605 "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 8949 "MachineIndependent/glslang_tab.cpp"
+#line 9007 "MachineIndependent/glslang_tab.cpp"
break;
- case 359: /* type_specifier_nonarray: F16SAMPLER3D */
-#line 2586 "MachineIndependent/glslang.y"
+ case 362: /* type_specifier_nonarray: F16SAMPLER3D */
+#line 2611 "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 8960 "MachineIndependent/glslang_tab.cpp"
+#line 9018 "MachineIndependent/glslang_tab.cpp"
break;
- case 360: /* type_specifier_nonarray: F16SAMPLERCUBE */
-#line 2592 "MachineIndependent/glslang.y"
+ case 363: /* type_specifier_nonarray: F16SAMPLERCUBE */
+#line 2617 "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 8971 "MachineIndependent/glslang_tab.cpp"
+#line 9029 "MachineIndependent/glslang_tab.cpp"
break;
- case 361: /* type_specifier_nonarray: F16SAMPLER1DSHADOW */
-#line 2598 "MachineIndependent/glslang.y"
+ case 364: /* type_specifier_nonarray: F16SAMPLER1DSHADOW */
+#line 2623 "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 8982 "MachineIndependent/glslang_tab.cpp"
+#line 9040 "MachineIndependent/glslang_tab.cpp"
break;
- case 362: /* type_specifier_nonarray: F16SAMPLER2DSHADOW */
-#line 2604 "MachineIndependent/glslang.y"
+ case 365: /* type_specifier_nonarray: F16SAMPLER2DSHADOW */
+#line 2629 "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 8993 "MachineIndependent/glslang_tab.cpp"
+#line 9051 "MachineIndependent/glslang_tab.cpp"
break;
- case 363: /* type_specifier_nonarray: F16SAMPLERCUBESHADOW */
-#line 2610 "MachineIndependent/glslang.y"
+ case 366: /* type_specifier_nonarray: F16SAMPLERCUBESHADOW */
+#line 2635 "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 9004 "MachineIndependent/glslang_tab.cpp"
+#line 9062 "MachineIndependent/glslang_tab.cpp"
break;
- case 364: /* type_specifier_nonarray: F16SAMPLER1DARRAY */
-#line 2616 "MachineIndependent/glslang.y"
+ case 367: /* type_specifier_nonarray: F16SAMPLER1DARRAY */
+#line 2641 "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 9015 "MachineIndependent/glslang_tab.cpp"
+#line 9073 "MachineIndependent/glslang_tab.cpp"
break;
- case 365: /* type_specifier_nonarray: F16SAMPLER2DARRAY */
-#line 2622 "MachineIndependent/glslang.y"
+ case 368: /* type_specifier_nonarray: F16SAMPLER2DARRAY */
+#line 2647 "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 9026 "MachineIndependent/glslang_tab.cpp"
+#line 9084 "MachineIndependent/glslang_tab.cpp"
break;
- case 366: /* type_specifier_nonarray: F16SAMPLER1DARRAYSHADOW */
-#line 2628 "MachineIndependent/glslang.y"
+ case 369: /* type_specifier_nonarray: F16SAMPLER1DARRAYSHADOW */
+#line 2653 "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 9037 "MachineIndependent/glslang_tab.cpp"
+#line 9095 "MachineIndependent/glslang_tab.cpp"
break;
- case 367: /* type_specifier_nonarray: F16SAMPLER2DARRAYSHADOW */
-#line 2634 "MachineIndependent/glslang.y"
+ case 370: /* type_specifier_nonarray: F16SAMPLER2DARRAYSHADOW */
+#line 2659 "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 9048 "MachineIndependent/glslang_tab.cpp"
+#line 9106 "MachineIndependent/glslang_tab.cpp"
break;
- case 368: /* type_specifier_nonarray: F16SAMPLERCUBEARRAY */
-#line 2640 "MachineIndependent/glslang.y"
+ case 371: /* type_specifier_nonarray: F16SAMPLERCUBEARRAY */
+#line 2665 "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 9059 "MachineIndependent/glslang_tab.cpp"
+#line 9117 "MachineIndependent/glslang_tab.cpp"
break;
- case 369: /* type_specifier_nonarray: F16SAMPLERCUBEARRAYSHADOW */
-#line 2646 "MachineIndependent/glslang.y"
+ case 372: /* type_specifier_nonarray: F16SAMPLERCUBEARRAYSHADOW */
+#line 2671 "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 9070 "MachineIndependent/glslang_tab.cpp"
+#line 9128 "MachineIndependent/glslang_tab.cpp"
break;
- case 370: /* type_specifier_nonarray: ISAMPLER1D */
-#line 2652 "MachineIndependent/glslang.y"
+ case 373: /* type_specifier_nonarray: ISAMPLER1D */
+#line 2677 "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 9080 "MachineIndependent/glslang_tab.cpp"
+#line 9138 "MachineIndependent/glslang_tab.cpp"
break;
- case 371: /* type_specifier_nonarray: ISAMPLER2D */
-#line 2658 "MachineIndependent/glslang.y"
+ case 374: /* type_specifier_nonarray: ISAMPLER2D */
+#line 2683 "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 9090 "MachineIndependent/glslang_tab.cpp"
+#line 9148 "MachineIndependent/glslang_tab.cpp"
break;
- case 372: /* type_specifier_nonarray: ISAMPLER3D */
-#line 2663 "MachineIndependent/glslang.y"
+ case 375: /* type_specifier_nonarray: ISAMPLER3D */
+#line 2688 "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 9100 "MachineIndependent/glslang_tab.cpp"
+#line 9158 "MachineIndependent/glslang_tab.cpp"
break;
- case 373: /* type_specifier_nonarray: ISAMPLERCUBE */
-#line 2668 "MachineIndependent/glslang.y"
+ case 376: /* type_specifier_nonarray: ISAMPLERCUBE */
+#line 2693 "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 9110 "MachineIndependent/glslang_tab.cpp"
+#line 9168 "MachineIndependent/glslang_tab.cpp"
break;
- case 374: /* type_specifier_nonarray: ISAMPLER2DARRAY */
-#line 2673 "MachineIndependent/glslang.y"
+ case 377: /* type_specifier_nonarray: ISAMPLER2DARRAY */
+#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, true);
}
-#line 9120 "MachineIndependent/glslang_tab.cpp"
+#line 9178 "MachineIndependent/glslang_tab.cpp"
break;
- case 375: /* type_specifier_nonarray: USAMPLER2D */
-#line 2678 "MachineIndependent/glslang.y"
+ case 378: /* type_specifier_nonarray: USAMPLER2D */
+#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(EbtUint, Esd2D);
}
-#line 9130 "MachineIndependent/glslang_tab.cpp"
+#line 9188 "MachineIndependent/glslang_tab.cpp"
break;
- case 376: /* type_specifier_nonarray: USAMPLER3D */
-#line 2683 "MachineIndependent/glslang.y"
+ case 379: /* type_specifier_nonarray: USAMPLER3D */
+#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(EbtUint, Esd3D);
}
-#line 9140 "MachineIndependent/glslang_tab.cpp"
+#line 9198 "MachineIndependent/glslang_tab.cpp"
break;
- case 377: /* type_specifier_nonarray: USAMPLERCUBE */
-#line 2688 "MachineIndependent/glslang.y"
+ case 380: /* type_specifier_nonarray: USAMPLERCUBE */
+#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(EbtUint, EsdCube);
}
-#line 9150 "MachineIndependent/glslang_tab.cpp"
+#line 9208 "MachineIndependent/glslang_tab.cpp"
break;
- case 378: /* type_specifier_nonarray: ISAMPLER1DARRAY */
-#line 2694 "MachineIndependent/glslang.y"
+ case 381: /* type_specifier_nonarray: ISAMPLER1DARRAY */
+#line 2719 "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 9160 "MachineIndependent/glslang_tab.cpp"
+#line 9218 "MachineIndependent/glslang_tab.cpp"
break;
- case 379: /* type_specifier_nonarray: ISAMPLERCUBEARRAY */
-#line 2699 "MachineIndependent/glslang.y"
+ case 382: /* type_specifier_nonarray: ISAMPLERCUBEARRAY */
+#line 2724 "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 9170 "MachineIndependent/glslang_tab.cpp"
+#line 9228 "MachineIndependent/glslang_tab.cpp"
break;
- case 380: /* type_specifier_nonarray: USAMPLER1D */
-#line 2704 "MachineIndependent/glslang.y"
+ case 383: /* type_specifier_nonarray: USAMPLER1D */
+#line 2729 "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 9180 "MachineIndependent/glslang_tab.cpp"
+#line 9238 "MachineIndependent/glslang_tab.cpp"
break;
- case 381: /* type_specifier_nonarray: USAMPLER1DARRAY */
-#line 2709 "MachineIndependent/glslang.y"
+ case 384: /* type_specifier_nonarray: USAMPLER1DARRAY */
+#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(EbtUint, Esd1D, true);
}
-#line 9190 "MachineIndependent/glslang_tab.cpp"
+#line 9248 "MachineIndependent/glslang_tab.cpp"
break;
- case 382: /* type_specifier_nonarray: USAMPLERCUBEARRAY */
-#line 2714 "MachineIndependent/glslang.y"
+ case 385: /* type_specifier_nonarray: USAMPLERCUBEARRAY */
+#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(EbtUint, EsdCube, true);
}
-#line 9200 "MachineIndependent/glslang_tab.cpp"
+#line 9258 "MachineIndependent/glslang_tab.cpp"
break;
- case 383: /* type_specifier_nonarray: TEXTURECUBEARRAY */
-#line 2719 "MachineIndependent/glslang.y"
+ case 386: /* type_specifier_nonarray: TEXTURECUBEARRAY */
+#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.setTexture(EbtFloat, EsdCube, true);
}
-#line 9210 "MachineIndependent/glslang_tab.cpp"
+#line 9268 "MachineIndependent/glslang_tab.cpp"
break;
- case 384: /* type_specifier_nonarray: ITEXTURECUBEARRAY */
-#line 2724 "MachineIndependent/glslang.y"
+ case 387: /* type_specifier_nonarray: ITEXTURECUBEARRAY */
+#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.setTexture(EbtInt, EsdCube, true);
}
-#line 9220 "MachineIndependent/glslang_tab.cpp"
+#line 9278 "MachineIndependent/glslang_tab.cpp"
break;
- case 385: /* type_specifier_nonarray: UTEXTURECUBEARRAY */
-#line 2729 "MachineIndependent/glslang.y"
+ case 388: /* type_specifier_nonarray: UTEXTURECUBEARRAY */
+#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.setTexture(EbtUint, EsdCube, true);
}
-#line 9230 "MachineIndependent/glslang_tab.cpp"
+#line 9288 "MachineIndependent/glslang_tab.cpp"
break;
- case 386: /* type_specifier_nonarray: USAMPLER2DARRAY */
-#line 2735 "MachineIndependent/glslang.y"
+ case 389: /* type_specifier_nonarray: USAMPLER2DARRAY */
+#line 2760 "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 9240 "MachineIndependent/glslang_tab.cpp"
+#line 9298 "MachineIndependent/glslang_tab.cpp"
break;
- case 387: /* type_specifier_nonarray: TEXTURE2D */
-#line 2740 "MachineIndependent/glslang.y"
+ case 390: /* type_specifier_nonarray: TEXTURE2D */
+#line 2765 "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 9250 "MachineIndependent/glslang_tab.cpp"
+#line 9308 "MachineIndependent/glslang_tab.cpp"
break;
- case 388: /* type_specifier_nonarray: TEXTURE3D */
-#line 2745 "MachineIndependent/glslang.y"
+ case 391: /* type_specifier_nonarray: TEXTURE3D */
+#line 2770 "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 9260 "MachineIndependent/glslang_tab.cpp"
+#line 9318 "MachineIndependent/glslang_tab.cpp"
break;
- case 389: /* type_specifier_nonarray: TEXTURE2DARRAY */
-#line 2750 "MachineIndependent/glslang.y"
+ case 392: /* type_specifier_nonarray: TEXTURE2DARRAY */
+#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.setTexture(EbtFloat, Esd2D, true);
}
-#line 9270 "MachineIndependent/glslang_tab.cpp"
+#line 9328 "MachineIndependent/glslang_tab.cpp"
break;
- case 390: /* type_specifier_nonarray: TEXTURECUBE */
-#line 2755 "MachineIndependent/glslang.y"
+ case 393: /* type_specifier_nonarray: TEXTURECUBE */
+#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, EsdCube);
}
-#line 9280 "MachineIndependent/glslang_tab.cpp"
+#line 9338 "MachineIndependent/glslang_tab.cpp"
break;
- case 391: /* type_specifier_nonarray: ITEXTURE2D */
-#line 2760 "MachineIndependent/glslang.y"
+ case 394: /* type_specifier_nonarray: ITEXTURE2D */
+#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(EbtInt, Esd2D);
}
-#line 9290 "MachineIndependent/glslang_tab.cpp"
+#line 9348 "MachineIndependent/glslang_tab.cpp"
break;
- case 392: /* type_specifier_nonarray: ITEXTURE3D */
-#line 2765 "MachineIndependent/glslang.y"
+ case 395: /* type_specifier_nonarray: ITEXTURE3D */
+#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(EbtInt, Esd3D);
}
-#line 9300 "MachineIndependent/glslang_tab.cpp"
+#line 9358 "MachineIndependent/glslang_tab.cpp"
break;
- case 393: /* type_specifier_nonarray: ITEXTURECUBE */
-#line 2770 "MachineIndependent/glslang.y"
+ case 396: /* type_specifier_nonarray: ITEXTURECUBE */
+#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(EbtInt, EsdCube);
}
-#line 9310 "MachineIndependent/glslang_tab.cpp"
+#line 9368 "MachineIndependent/glslang_tab.cpp"
break;
- case 394: /* type_specifier_nonarray: ITEXTURE2DARRAY */
-#line 2775 "MachineIndependent/glslang.y"
+ case 397: /* type_specifier_nonarray: ITEXTURE2DARRAY */
+#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, true);
}
-#line 9320 "MachineIndependent/glslang_tab.cpp"
+#line 9378 "MachineIndependent/glslang_tab.cpp"
break;
- case 395: /* type_specifier_nonarray: UTEXTURE2D */
-#line 2780 "MachineIndependent/glslang.y"
+ case 398: /* type_specifier_nonarray: UTEXTURE2D */
+#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(EbtUint, Esd2D);
}
-#line 9330 "MachineIndependent/glslang_tab.cpp"
+#line 9388 "MachineIndependent/glslang_tab.cpp"
break;
- case 396: /* type_specifier_nonarray: UTEXTURE3D */
-#line 2785 "MachineIndependent/glslang.y"
+ case 399: /* type_specifier_nonarray: UTEXTURE3D */
+#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(EbtUint, Esd3D);
}
-#line 9340 "MachineIndependent/glslang_tab.cpp"
+#line 9398 "MachineIndependent/glslang_tab.cpp"
break;
- case 397: /* type_specifier_nonarray: UTEXTURECUBE */
-#line 2790 "MachineIndependent/glslang.y"
+ case 400: /* type_specifier_nonarray: UTEXTURECUBE */
+#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(EbtUint, EsdCube);
}
-#line 9350 "MachineIndependent/glslang_tab.cpp"
+#line 9408 "MachineIndependent/glslang_tab.cpp"
break;
- case 398: /* type_specifier_nonarray: UTEXTURE2DARRAY */
-#line 2795 "MachineIndependent/glslang.y"
+ case 401: /* type_specifier_nonarray: UTEXTURE2DARRAY */
+#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, true);
}
-#line 9360 "MachineIndependent/glslang_tab.cpp"
+#line 9418 "MachineIndependent/glslang_tab.cpp"
break;
- case 399: /* type_specifier_nonarray: SAMPLER */
-#line 2800 "MachineIndependent/glslang.y"
+ case 402: /* type_specifier_nonarray: SAMPLER */
+#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.setPureSampler(false);
}
-#line 9370 "MachineIndependent/glslang_tab.cpp"
+#line 9428 "MachineIndependent/glslang_tab.cpp"
break;
- case 400: /* type_specifier_nonarray: SAMPLERSHADOW */
-#line 2805 "MachineIndependent/glslang.y"
+ case 403: /* type_specifier_nonarray: SAMPLERSHADOW */
+#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.setPureSampler(true);
}
-#line 9380 "MachineIndependent/glslang_tab.cpp"
+#line 9438 "MachineIndependent/glslang_tab.cpp"
break;
- case 401: /* type_specifier_nonarray: SAMPLER2DRECT */
-#line 2811 "MachineIndependent/glslang.y"
+ case 404: /* type_specifier_nonarray: SAMPLER2DRECT */
+#line 2836 "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 9390 "MachineIndependent/glslang_tab.cpp"
+#line 9448 "MachineIndependent/glslang_tab.cpp"
break;
- case 402: /* type_specifier_nonarray: SAMPLER2DRECTSHADOW */
-#line 2816 "MachineIndependent/glslang.y"
+ case 405: /* type_specifier_nonarray: SAMPLER2DRECTSHADOW */
+#line 2841 "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 9400 "MachineIndependent/glslang_tab.cpp"
+#line 9458 "MachineIndependent/glslang_tab.cpp"
break;
- case 403: /* type_specifier_nonarray: F16SAMPLER2DRECT */
-#line 2821 "MachineIndependent/glslang.y"
+ case 406: /* type_specifier_nonarray: F16SAMPLER2DRECT */
+#line 2846 "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 9411 "MachineIndependent/glslang_tab.cpp"
+#line 9469 "MachineIndependent/glslang_tab.cpp"
break;
- case 404: /* type_specifier_nonarray: F16SAMPLER2DRECTSHADOW */
-#line 2827 "MachineIndependent/glslang.y"
+ case 407: /* type_specifier_nonarray: F16SAMPLER2DRECTSHADOW */
+#line 2852 "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 9422 "MachineIndependent/glslang_tab.cpp"
+#line 9480 "MachineIndependent/glslang_tab.cpp"
break;
- case 405: /* type_specifier_nonarray: ISAMPLER2DRECT */
-#line 2833 "MachineIndependent/glslang.y"
+ case 408: /* type_specifier_nonarray: ISAMPLER2DRECT */
+#line 2858 "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 9432 "MachineIndependent/glslang_tab.cpp"
+#line 9490 "MachineIndependent/glslang_tab.cpp"
break;
- case 406: /* type_specifier_nonarray: USAMPLER2DRECT */
-#line 2838 "MachineIndependent/glslang.y"
+ case 409: /* type_specifier_nonarray: USAMPLER2DRECT */
+#line 2863 "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 9442 "MachineIndependent/glslang_tab.cpp"
+#line 9500 "MachineIndependent/glslang_tab.cpp"
break;
- case 407: /* type_specifier_nonarray: SAMPLERBUFFER */
-#line 2843 "MachineIndependent/glslang.y"
+ case 410: /* type_specifier_nonarray: SAMPLERBUFFER */
+#line 2868 "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 9452 "MachineIndependent/glslang_tab.cpp"
+#line 9510 "MachineIndependent/glslang_tab.cpp"
break;
- case 408: /* type_specifier_nonarray: F16SAMPLERBUFFER */
-#line 2848 "MachineIndependent/glslang.y"
+ case 411: /* type_specifier_nonarray: F16SAMPLERBUFFER */
+#line 2873 "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 9463 "MachineIndependent/glslang_tab.cpp"
+#line 9521 "MachineIndependent/glslang_tab.cpp"
break;
- case 409: /* type_specifier_nonarray: ISAMPLERBUFFER */
-#line 2854 "MachineIndependent/glslang.y"
+ case 412: /* type_specifier_nonarray: ISAMPLERBUFFER */
+#line 2879 "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 9473 "MachineIndependent/glslang_tab.cpp"
+#line 9531 "MachineIndependent/glslang_tab.cpp"
break;
- case 410: /* type_specifier_nonarray: USAMPLERBUFFER */
-#line 2859 "MachineIndependent/glslang.y"
+ case 413: /* type_specifier_nonarray: USAMPLERBUFFER */
+#line 2884 "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 9483 "MachineIndependent/glslang_tab.cpp"
+#line 9541 "MachineIndependent/glslang_tab.cpp"
break;
- case 411: /* type_specifier_nonarray: SAMPLER2DMS */
-#line 2864 "MachineIndependent/glslang.y"
+ case 414: /* type_specifier_nonarray: SAMPLER2DMS */
+#line 2889 "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 9493 "MachineIndependent/glslang_tab.cpp"
+#line 9551 "MachineIndependent/glslang_tab.cpp"
break;
- case 412: /* type_specifier_nonarray: F16SAMPLER2DMS */
-#line 2869 "MachineIndependent/glslang.y"
+ case 415: /* type_specifier_nonarray: F16SAMPLER2DMS */
+#line 2894 "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 9504 "MachineIndependent/glslang_tab.cpp"
+#line 9562 "MachineIndependent/glslang_tab.cpp"
break;
- case 413: /* type_specifier_nonarray: ISAMPLER2DMS */
-#line 2875 "MachineIndependent/glslang.y"
+ case 416: /* type_specifier_nonarray: ISAMPLER2DMS */
+#line 2900 "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 9514 "MachineIndependent/glslang_tab.cpp"
+#line 9572 "MachineIndependent/glslang_tab.cpp"
break;
- case 414: /* type_specifier_nonarray: USAMPLER2DMS */
-#line 2880 "MachineIndependent/glslang.y"
+ case 417: /* type_specifier_nonarray: USAMPLER2DMS */
+#line 2905 "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 9524 "MachineIndependent/glslang_tab.cpp"
+#line 9582 "MachineIndependent/glslang_tab.cpp"
break;
- case 415: /* type_specifier_nonarray: SAMPLER2DMSARRAY */
-#line 2885 "MachineIndependent/glslang.y"
+ case 418: /* type_specifier_nonarray: SAMPLER2DMSARRAY */
+#line 2910 "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 9534 "MachineIndependent/glslang_tab.cpp"
+#line 9592 "MachineIndependent/glslang_tab.cpp"
break;
- case 416: /* type_specifier_nonarray: F16SAMPLER2DMSARRAY */
-#line 2890 "MachineIndependent/glslang.y"
+ case 419: /* type_specifier_nonarray: F16SAMPLER2DMSARRAY */
+#line 2915 "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 9545 "MachineIndependent/glslang_tab.cpp"
+#line 9603 "MachineIndependent/glslang_tab.cpp"
break;
- case 417: /* type_specifier_nonarray: ISAMPLER2DMSARRAY */
-#line 2896 "MachineIndependent/glslang.y"
+ case 420: /* type_specifier_nonarray: ISAMPLER2DMSARRAY */
+#line 2921 "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 9555 "MachineIndependent/glslang_tab.cpp"
+#line 9613 "MachineIndependent/glslang_tab.cpp"
break;
- case 418: /* type_specifier_nonarray: USAMPLER2DMSARRAY */
-#line 2901 "MachineIndependent/glslang.y"
+ case 421: /* type_specifier_nonarray: USAMPLER2DMSARRAY */
+#line 2926 "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 9565 "MachineIndependent/glslang_tab.cpp"
+#line 9623 "MachineIndependent/glslang_tab.cpp"
break;
- case 419: /* type_specifier_nonarray: TEXTURE1D */
-#line 2906 "MachineIndependent/glslang.y"
+ case 422: /* type_specifier_nonarray: TEXTURE1D */
+#line 2931 "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 9575 "MachineIndependent/glslang_tab.cpp"
+#line 9633 "MachineIndependent/glslang_tab.cpp"
break;
- case 420: /* type_specifier_nonarray: F16TEXTURE1D */
-#line 2911 "MachineIndependent/glslang.y"
+ case 423: /* type_specifier_nonarray: F16TEXTURE1D */
+#line 2936 "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 9586 "MachineIndependent/glslang_tab.cpp"
+#line 9644 "MachineIndependent/glslang_tab.cpp"
break;
- case 421: /* type_specifier_nonarray: F16TEXTURE2D */
-#line 2917 "MachineIndependent/glslang.y"
+ case 424: /* type_specifier_nonarray: F16TEXTURE2D */
+#line 2942 "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 9597 "MachineIndependent/glslang_tab.cpp"
+#line 9655 "MachineIndependent/glslang_tab.cpp"
break;
- case 422: /* type_specifier_nonarray: F16TEXTURE3D */
-#line 2923 "MachineIndependent/glslang.y"
+ case 425: /* type_specifier_nonarray: F16TEXTURE3D */
+#line 2948 "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 9608 "MachineIndependent/glslang_tab.cpp"
+#line 9666 "MachineIndependent/glslang_tab.cpp"
break;
- case 423: /* type_specifier_nonarray: F16TEXTURECUBE */
-#line 2929 "MachineIndependent/glslang.y"
+ case 426: /* type_specifier_nonarray: F16TEXTURECUBE */
+#line 2954 "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 9619 "MachineIndependent/glslang_tab.cpp"
+#line 9677 "MachineIndependent/glslang_tab.cpp"
break;
- case 424: /* type_specifier_nonarray: TEXTURE1DARRAY */
-#line 2935 "MachineIndependent/glslang.y"
+ case 427: /* type_specifier_nonarray: TEXTURE1DARRAY */
+#line 2960 "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 9629 "MachineIndependent/glslang_tab.cpp"
+#line 9687 "MachineIndependent/glslang_tab.cpp"
break;
- case 425: /* type_specifier_nonarray: F16TEXTURE1DARRAY */
-#line 2940 "MachineIndependent/glslang.y"
+ case 428: /* type_specifier_nonarray: F16TEXTURE1DARRAY */
+#line 2965 "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 9640 "MachineIndependent/glslang_tab.cpp"
+#line 9698 "MachineIndependent/glslang_tab.cpp"
break;
- case 426: /* type_specifier_nonarray: F16TEXTURE2DARRAY */
-#line 2946 "MachineIndependent/glslang.y"
+ case 429: /* type_specifier_nonarray: F16TEXTURE2DARRAY */
+#line 2971 "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 9651 "MachineIndependent/glslang_tab.cpp"
+#line 9709 "MachineIndependent/glslang_tab.cpp"
break;
- case 427: /* type_specifier_nonarray: F16TEXTURECUBEARRAY */
-#line 2952 "MachineIndependent/glslang.y"
+ case 430: /* type_specifier_nonarray: F16TEXTURECUBEARRAY */
+#line 2977 "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 9662 "MachineIndependent/glslang_tab.cpp"
+#line 9720 "MachineIndependent/glslang_tab.cpp"
break;
- case 428: /* type_specifier_nonarray: ITEXTURE1D */
-#line 2958 "MachineIndependent/glslang.y"
+ case 431: /* type_specifier_nonarray: ITEXTURE1D */
+#line 2983 "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 9672 "MachineIndependent/glslang_tab.cpp"
+#line 9730 "MachineIndependent/glslang_tab.cpp"
break;
- case 429: /* type_specifier_nonarray: ITEXTURE1DARRAY */
-#line 2963 "MachineIndependent/glslang.y"
+ case 432: /* type_specifier_nonarray: ITEXTURE1DARRAY */
+#line 2988 "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 9682 "MachineIndependent/glslang_tab.cpp"
+#line 9740 "MachineIndependent/glslang_tab.cpp"
break;
- case 430: /* type_specifier_nonarray: UTEXTURE1D */
-#line 2968 "MachineIndependent/glslang.y"
+ case 433: /* type_specifier_nonarray: UTEXTURE1D */
+#line 2993 "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 9692 "MachineIndependent/glslang_tab.cpp"
+#line 9750 "MachineIndependent/glslang_tab.cpp"
break;
- case 431: /* type_specifier_nonarray: UTEXTURE1DARRAY */
-#line 2973 "MachineIndependent/glslang.y"
+ case 434: /* type_specifier_nonarray: UTEXTURE1DARRAY */
+#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(EbtUint, Esd1D, true);
}
-#line 9702 "MachineIndependent/glslang_tab.cpp"
+#line 9760 "MachineIndependent/glslang_tab.cpp"
break;
- case 432: /* type_specifier_nonarray: TEXTURE2DRECT */
-#line 2978 "MachineIndependent/glslang.y"
+ case 435: /* type_specifier_nonarray: TEXTURE2DRECT */
+#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(EbtFloat, EsdRect);
}
-#line 9712 "MachineIndependent/glslang_tab.cpp"
+#line 9770 "MachineIndependent/glslang_tab.cpp"
break;
- case 433: /* type_specifier_nonarray: F16TEXTURE2DRECT */
-#line 2983 "MachineIndependent/glslang.y"
+ case 436: /* type_specifier_nonarray: F16TEXTURE2DRECT */
+#line 3008 "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 9723 "MachineIndependent/glslang_tab.cpp"
+#line 9781 "MachineIndependent/glslang_tab.cpp"
break;
- case 434: /* type_specifier_nonarray: ITEXTURE2DRECT */
-#line 2989 "MachineIndependent/glslang.y"
+ case 437: /* type_specifier_nonarray: ITEXTURE2DRECT */
+#line 3014 "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 9733 "MachineIndependent/glslang_tab.cpp"
+#line 9791 "MachineIndependent/glslang_tab.cpp"
break;
- case 435: /* type_specifier_nonarray: UTEXTURE2DRECT */
-#line 2994 "MachineIndependent/glslang.y"
+ case 438: /* type_specifier_nonarray: UTEXTURE2DRECT */
+#line 3019 "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 9743 "MachineIndependent/glslang_tab.cpp"
+#line 9801 "MachineIndependent/glslang_tab.cpp"
break;
- case 436: /* type_specifier_nonarray: TEXTUREBUFFER */
-#line 2999 "MachineIndependent/glslang.y"
+ case 439: /* type_specifier_nonarray: TEXTUREBUFFER */
+#line 3024 "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 9753 "MachineIndependent/glslang_tab.cpp"
+#line 9811 "MachineIndependent/glslang_tab.cpp"
break;
- case 437: /* type_specifier_nonarray: F16TEXTUREBUFFER */
-#line 3004 "MachineIndependent/glslang.y"
+ case 440: /* type_specifier_nonarray: F16TEXTUREBUFFER */
+#line 3029 "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 9764 "MachineIndependent/glslang_tab.cpp"
+#line 9822 "MachineIndependent/glslang_tab.cpp"
break;
- case 438: /* type_specifier_nonarray: ITEXTUREBUFFER */
-#line 3010 "MachineIndependent/glslang.y"
+ case 441: /* type_specifier_nonarray: ITEXTUREBUFFER */
+#line 3035 "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 9774 "MachineIndependent/glslang_tab.cpp"
+#line 9832 "MachineIndependent/glslang_tab.cpp"
break;
- case 439: /* type_specifier_nonarray: UTEXTUREBUFFER */
-#line 3015 "MachineIndependent/glslang.y"
+ case 442: /* type_specifier_nonarray: UTEXTUREBUFFER */
+#line 3040 "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 9784 "MachineIndependent/glslang_tab.cpp"
+#line 9842 "MachineIndependent/glslang_tab.cpp"
break;
- case 440: /* type_specifier_nonarray: TEXTURE2DMS */
-#line 3020 "MachineIndependent/glslang.y"
+ case 443: /* type_specifier_nonarray: TEXTURE2DMS */
+#line 3045 "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 9794 "MachineIndependent/glslang_tab.cpp"
+#line 9852 "MachineIndependent/glslang_tab.cpp"
break;
- case 441: /* type_specifier_nonarray: F16TEXTURE2DMS */
-#line 3025 "MachineIndependent/glslang.y"
+ case 444: /* type_specifier_nonarray: F16TEXTURE2DMS */
+#line 3050 "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 9805 "MachineIndependent/glslang_tab.cpp"
+#line 9863 "MachineIndependent/glslang_tab.cpp"
break;
- case 442: /* type_specifier_nonarray: ITEXTURE2DMS */
-#line 3031 "MachineIndependent/glslang.y"
+ case 445: /* type_specifier_nonarray: ITEXTURE2DMS */
+#line 3056 "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 9815 "MachineIndependent/glslang_tab.cpp"
+#line 9873 "MachineIndependent/glslang_tab.cpp"
break;
- case 443: /* type_specifier_nonarray: UTEXTURE2DMS */
-#line 3036 "MachineIndependent/glslang.y"
+ case 446: /* type_specifier_nonarray: UTEXTURE2DMS */
+#line 3061 "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 9825 "MachineIndependent/glslang_tab.cpp"
+#line 9883 "MachineIndependent/glslang_tab.cpp"
break;
- case 444: /* type_specifier_nonarray: TEXTURE2DMSARRAY */
-#line 3041 "MachineIndependent/glslang.y"
+ case 447: /* type_specifier_nonarray: TEXTURE2DMSARRAY */
+#line 3066 "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 9835 "MachineIndependent/glslang_tab.cpp"
+#line 9893 "MachineIndependent/glslang_tab.cpp"
break;
- case 445: /* type_specifier_nonarray: F16TEXTURE2DMSARRAY */
-#line 3046 "MachineIndependent/glslang.y"
+ case 448: /* type_specifier_nonarray: F16TEXTURE2DMSARRAY */
+#line 3071 "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 9846 "MachineIndependent/glslang_tab.cpp"
+#line 9904 "MachineIndependent/glslang_tab.cpp"
break;
- case 446: /* type_specifier_nonarray: ITEXTURE2DMSARRAY */
-#line 3052 "MachineIndependent/glslang.y"
+ case 449: /* type_specifier_nonarray: ITEXTURE2DMSARRAY */
+#line 3077 "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 9856 "MachineIndependent/glslang_tab.cpp"
+#line 9914 "MachineIndependent/glslang_tab.cpp"
break;
- case 447: /* type_specifier_nonarray: UTEXTURE2DMSARRAY */
-#line 3057 "MachineIndependent/glslang.y"
+ case 450: /* type_specifier_nonarray: UTEXTURE2DMSARRAY */
+#line 3082 "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 9866 "MachineIndependent/glslang_tab.cpp"
+#line 9924 "MachineIndependent/glslang_tab.cpp"
break;
- case 448: /* type_specifier_nonarray: IMAGE1D */
-#line 3062 "MachineIndependent/glslang.y"
+ case 451: /* type_specifier_nonarray: IMAGE1D */
+#line 3087 "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 9876 "MachineIndependent/glslang_tab.cpp"
+#line 9934 "MachineIndependent/glslang_tab.cpp"
break;
- case 449: /* type_specifier_nonarray: F16IMAGE1D */
-#line 3067 "MachineIndependent/glslang.y"
+ case 452: /* type_specifier_nonarray: F16IMAGE1D */
+#line 3092 "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 9887 "MachineIndependent/glslang_tab.cpp"
+#line 9945 "MachineIndependent/glslang_tab.cpp"
break;
- case 450: /* type_specifier_nonarray: IIMAGE1D */
-#line 3073 "MachineIndependent/glslang.y"
+ case 453: /* type_specifier_nonarray: IIMAGE1D */
+#line 3098 "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 9897 "MachineIndependent/glslang_tab.cpp"
+#line 9955 "MachineIndependent/glslang_tab.cpp"
break;
- case 451: /* type_specifier_nonarray: UIMAGE1D */
-#line 3078 "MachineIndependent/glslang.y"
+ case 454: /* type_specifier_nonarray: UIMAGE1D */
+#line 3103 "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 9907 "MachineIndependent/glslang_tab.cpp"
+#line 9965 "MachineIndependent/glslang_tab.cpp"
break;
- case 452: /* type_specifier_nonarray: IMAGE2D */
-#line 3083 "MachineIndependent/glslang.y"
+ case 455: /* type_specifier_nonarray: IMAGE2D */
+#line 3108 "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 9917 "MachineIndependent/glslang_tab.cpp"
+#line 9975 "MachineIndependent/glslang_tab.cpp"
break;
- case 453: /* type_specifier_nonarray: F16IMAGE2D */
-#line 3088 "MachineIndependent/glslang.y"
+ case 456: /* type_specifier_nonarray: F16IMAGE2D */
+#line 3113 "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 9928 "MachineIndependent/glslang_tab.cpp"
+#line 9986 "MachineIndependent/glslang_tab.cpp"
break;
- case 454: /* type_specifier_nonarray: IIMAGE2D */
-#line 3094 "MachineIndependent/glslang.y"
+ case 457: /* type_specifier_nonarray: IIMAGE2D */
+#line 3119 "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 9938 "MachineIndependent/glslang_tab.cpp"
+#line 9996 "MachineIndependent/glslang_tab.cpp"
break;
- case 455: /* type_specifier_nonarray: UIMAGE2D */
-#line 3099 "MachineIndependent/glslang.y"
+ case 458: /* type_specifier_nonarray: UIMAGE2D */
+#line 3124 "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 9948 "MachineIndependent/glslang_tab.cpp"
+#line 10006 "MachineIndependent/glslang_tab.cpp"
break;
- case 456: /* type_specifier_nonarray: IMAGE3D */
-#line 3104 "MachineIndependent/glslang.y"
+ case 459: /* type_specifier_nonarray: IMAGE3D */
+#line 3129 "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 9958 "MachineIndependent/glslang_tab.cpp"
+#line 10016 "MachineIndependent/glslang_tab.cpp"
break;
- case 457: /* type_specifier_nonarray: F16IMAGE3D */
-#line 3109 "MachineIndependent/glslang.y"
+ case 460: /* type_specifier_nonarray: F16IMAGE3D */
+#line 3134 "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 9969 "MachineIndependent/glslang_tab.cpp"
+#line 10027 "MachineIndependent/glslang_tab.cpp"
break;
- case 458: /* type_specifier_nonarray: IIMAGE3D */
-#line 3115 "MachineIndependent/glslang.y"
+ case 461: /* type_specifier_nonarray: IIMAGE3D */
+#line 3140 "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 9979 "MachineIndependent/glslang_tab.cpp"
+#line 10037 "MachineIndependent/glslang_tab.cpp"
break;
- case 459: /* type_specifier_nonarray: UIMAGE3D */
-#line 3120 "MachineIndependent/glslang.y"
+ case 462: /* type_specifier_nonarray: UIMAGE3D */
+#line 3145 "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 9989 "MachineIndependent/glslang_tab.cpp"
+#line 10047 "MachineIndependent/glslang_tab.cpp"
break;
- case 460: /* type_specifier_nonarray: IMAGE2DRECT */
-#line 3125 "MachineIndependent/glslang.y"
+ case 463: /* type_specifier_nonarray: IMAGE2DRECT */
+#line 3150 "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 9999 "MachineIndependent/glslang_tab.cpp"
+#line 10057 "MachineIndependent/glslang_tab.cpp"
break;
- case 461: /* type_specifier_nonarray: F16IMAGE2DRECT */
-#line 3130 "MachineIndependent/glslang.y"
+ case 464: /* type_specifier_nonarray: F16IMAGE2DRECT */
+#line 3155 "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 10010 "MachineIndependent/glslang_tab.cpp"
+#line 10068 "MachineIndependent/glslang_tab.cpp"
break;
- case 462: /* type_specifier_nonarray: IIMAGE2DRECT */
-#line 3136 "MachineIndependent/glslang.y"
+ case 465: /* type_specifier_nonarray: IIMAGE2DRECT */
+#line 3161 "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 10020 "MachineIndependent/glslang_tab.cpp"
+#line 10078 "MachineIndependent/glslang_tab.cpp"
break;
- case 463: /* type_specifier_nonarray: UIMAGE2DRECT */
-#line 3141 "MachineIndependent/glslang.y"
+ case 466: /* type_specifier_nonarray: UIMAGE2DRECT */
+#line 3166 "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 10030 "MachineIndependent/glslang_tab.cpp"
+#line 10088 "MachineIndependent/glslang_tab.cpp"
break;
- case 464: /* type_specifier_nonarray: IMAGECUBE */
-#line 3146 "MachineIndependent/glslang.y"
+ case 467: /* type_specifier_nonarray: IMAGECUBE */
+#line 3171 "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 10040 "MachineIndependent/glslang_tab.cpp"
+#line 10098 "MachineIndependent/glslang_tab.cpp"
break;
- case 465: /* type_specifier_nonarray: F16IMAGECUBE */
-#line 3151 "MachineIndependent/glslang.y"
+ case 468: /* type_specifier_nonarray: F16IMAGECUBE */
+#line 3176 "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 10051 "MachineIndependent/glslang_tab.cpp"
+#line 10109 "MachineIndependent/glslang_tab.cpp"
break;
- case 466: /* type_specifier_nonarray: IIMAGECUBE */
-#line 3157 "MachineIndependent/glslang.y"
+ case 469: /* type_specifier_nonarray: IIMAGECUBE */
+#line 3182 "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 10061 "MachineIndependent/glslang_tab.cpp"
+#line 10119 "MachineIndependent/glslang_tab.cpp"
break;
- case 467: /* type_specifier_nonarray: UIMAGECUBE */
-#line 3162 "MachineIndependent/glslang.y"
+ case 470: /* type_specifier_nonarray: UIMAGECUBE */
+#line 3187 "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 10071 "MachineIndependent/glslang_tab.cpp"
+#line 10129 "MachineIndependent/glslang_tab.cpp"
break;
- case 468: /* type_specifier_nonarray: IMAGEBUFFER */
-#line 3167 "MachineIndependent/glslang.y"
+ case 471: /* type_specifier_nonarray: IMAGEBUFFER */
+#line 3192 "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 10081 "MachineIndependent/glslang_tab.cpp"
+#line 10139 "MachineIndependent/glslang_tab.cpp"
break;
- case 469: /* type_specifier_nonarray: F16IMAGEBUFFER */
-#line 3172 "MachineIndependent/glslang.y"
+ case 472: /* type_specifier_nonarray: F16IMAGEBUFFER */
+#line 3197 "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 10092 "MachineIndependent/glslang_tab.cpp"
+#line 10150 "MachineIndependent/glslang_tab.cpp"
break;
- case 470: /* type_specifier_nonarray: IIMAGEBUFFER */
-#line 3178 "MachineIndependent/glslang.y"
+ case 473: /* type_specifier_nonarray: IIMAGEBUFFER */
+#line 3203 "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 10102 "MachineIndependent/glslang_tab.cpp"
+#line 10160 "MachineIndependent/glslang_tab.cpp"
break;
- case 471: /* type_specifier_nonarray: UIMAGEBUFFER */
-#line 3183 "MachineIndependent/glslang.y"
+ case 474: /* type_specifier_nonarray: UIMAGEBUFFER */
+#line 3208 "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 10112 "MachineIndependent/glslang_tab.cpp"
+#line 10170 "MachineIndependent/glslang_tab.cpp"
break;
- case 472: /* type_specifier_nonarray: IMAGE1DARRAY */
-#line 3188 "MachineIndependent/glslang.y"
+ case 475: /* type_specifier_nonarray: IMAGE1DARRAY */
+#line 3213 "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 10122 "MachineIndependent/glslang_tab.cpp"
+#line 10180 "MachineIndependent/glslang_tab.cpp"
break;
- case 473: /* type_specifier_nonarray: F16IMAGE1DARRAY */
-#line 3193 "MachineIndependent/glslang.y"
+ case 476: /* type_specifier_nonarray: F16IMAGE1DARRAY */
+#line 3218 "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 10133 "MachineIndependent/glslang_tab.cpp"
+#line 10191 "MachineIndependent/glslang_tab.cpp"
break;
- case 474: /* type_specifier_nonarray: IIMAGE1DARRAY */
-#line 3199 "MachineIndependent/glslang.y"
+ case 477: /* type_specifier_nonarray: IIMAGE1DARRAY */
+#line 3224 "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 10143 "MachineIndependent/glslang_tab.cpp"
+#line 10201 "MachineIndependent/glslang_tab.cpp"
break;
- case 475: /* type_specifier_nonarray: UIMAGE1DARRAY */
-#line 3204 "MachineIndependent/glslang.y"
+ case 478: /* type_specifier_nonarray: UIMAGE1DARRAY */
+#line 3229 "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 10153 "MachineIndependent/glslang_tab.cpp"
+#line 10211 "MachineIndependent/glslang_tab.cpp"
break;
- case 476: /* type_specifier_nonarray: IMAGE2DARRAY */
-#line 3209 "MachineIndependent/glslang.y"
+ case 479: /* type_specifier_nonarray: IMAGE2DARRAY */
+#line 3234 "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 10163 "MachineIndependent/glslang_tab.cpp"
+#line 10221 "MachineIndependent/glslang_tab.cpp"
break;
- case 477: /* type_specifier_nonarray: F16IMAGE2DARRAY */
-#line 3214 "MachineIndependent/glslang.y"
+ case 480: /* type_specifier_nonarray: F16IMAGE2DARRAY */
+#line 3239 "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 10174 "MachineIndependent/glslang_tab.cpp"
+#line 10232 "MachineIndependent/glslang_tab.cpp"
break;
- case 478: /* type_specifier_nonarray: IIMAGE2DARRAY */
-#line 3220 "MachineIndependent/glslang.y"
+ case 481: /* type_specifier_nonarray: IIMAGE2DARRAY */
+#line 3245 "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 10184 "MachineIndependent/glslang_tab.cpp"
+#line 10242 "MachineIndependent/glslang_tab.cpp"
break;
- case 479: /* type_specifier_nonarray: UIMAGE2DARRAY */
-#line 3225 "MachineIndependent/glslang.y"
+ case 482: /* type_specifier_nonarray: UIMAGE2DARRAY */
+#line 3250 "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 10194 "MachineIndependent/glslang_tab.cpp"
+#line 10252 "MachineIndependent/glslang_tab.cpp"
break;
- case 480: /* type_specifier_nonarray: IMAGECUBEARRAY */
-#line 3230 "MachineIndependent/glslang.y"
+ case 483: /* type_specifier_nonarray: IMAGECUBEARRAY */
+#line 3255 "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 10204 "MachineIndependent/glslang_tab.cpp"
+#line 10262 "MachineIndependent/glslang_tab.cpp"
break;
- case 481: /* type_specifier_nonarray: F16IMAGECUBEARRAY */
-#line 3235 "MachineIndependent/glslang.y"
+ case 484: /* type_specifier_nonarray: F16IMAGECUBEARRAY */
+#line 3260 "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 10215 "MachineIndependent/glslang_tab.cpp"
+#line 10273 "MachineIndependent/glslang_tab.cpp"
break;
- case 482: /* type_specifier_nonarray: IIMAGECUBEARRAY */
-#line 3241 "MachineIndependent/glslang.y"
+ case 485: /* type_specifier_nonarray: IIMAGECUBEARRAY */
+#line 3266 "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 10225 "MachineIndependent/glslang_tab.cpp"
+#line 10283 "MachineIndependent/glslang_tab.cpp"
break;
- case 483: /* type_specifier_nonarray: UIMAGECUBEARRAY */
-#line 3246 "MachineIndependent/glslang.y"
+ case 486: /* type_specifier_nonarray: UIMAGECUBEARRAY */
+#line 3271 "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 10235 "MachineIndependent/glslang_tab.cpp"
+#line 10293 "MachineIndependent/glslang_tab.cpp"
break;
- case 484: /* type_specifier_nonarray: IMAGE2DMS */
-#line 3251 "MachineIndependent/glslang.y"
+ case 487: /* type_specifier_nonarray: IMAGE2DMS */
+#line 3276 "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 10245 "MachineIndependent/glslang_tab.cpp"
+#line 10303 "MachineIndependent/glslang_tab.cpp"
break;
- case 485: /* type_specifier_nonarray: F16IMAGE2DMS */
-#line 3256 "MachineIndependent/glslang.y"
+ case 488: /* type_specifier_nonarray: F16IMAGE2DMS */
+#line 3281 "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 10256 "MachineIndependent/glslang_tab.cpp"
+#line 10314 "MachineIndependent/glslang_tab.cpp"
break;
- case 486: /* type_specifier_nonarray: IIMAGE2DMS */
-#line 3262 "MachineIndependent/glslang.y"
+ case 489: /* type_specifier_nonarray: IIMAGE2DMS */
+#line 3287 "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 10266 "MachineIndependent/glslang_tab.cpp"
+#line 10324 "MachineIndependent/glslang_tab.cpp"
break;
- case 487: /* type_specifier_nonarray: UIMAGE2DMS */
-#line 3267 "MachineIndependent/glslang.y"
+ case 490: /* type_specifier_nonarray: UIMAGE2DMS */
+#line 3292 "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 10276 "MachineIndependent/glslang_tab.cpp"
+#line 10334 "MachineIndependent/glslang_tab.cpp"
break;
- case 488: /* type_specifier_nonarray: IMAGE2DMSARRAY */
-#line 3272 "MachineIndependent/glslang.y"
+ case 491: /* type_specifier_nonarray: IMAGE2DMSARRAY */
+#line 3297 "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 10286 "MachineIndependent/glslang_tab.cpp"
+#line 10344 "MachineIndependent/glslang_tab.cpp"
break;
- case 489: /* type_specifier_nonarray: F16IMAGE2DMSARRAY */
-#line 3277 "MachineIndependent/glslang.y"
+ case 492: /* type_specifier_nonarray: F16IMAGE2DMSARRAY */
+#line 3302 "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 10297 "MachineIndependent/glslang_tab.cpp"
+#line 10355 "MachineIndependent/glslang_tab.cpp"
break;
- case 490: /* type_specifier_nonarray: IIMAGE2DMSARRAY */
-#line 3283 "MachineIndependent/glslang.y"
+ case 493: /* type_specifier_nonarray: IIMAGE2DMSARRAY */
+#line 3308 "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 10307 "MachineIndependent/glslang_tab.cpp"
+#line 10365 "MachineIndependent/glslang_tab.cpp"
break;
- case 491: /* type_specifier_nonarray: UIMAGE2DMSARRAY */
-#line 3288 "MachineIndependent/glslang.y"
+ case 494: /* type_specifier_nonarray: UIMAGE2DMSARRAY */
+#line 3313 "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 10317 "MachineIndependent/glslang_tab.cpp"
+#line 10375 "MachineIndependent/glslang_tab.cpp"
break;
- case 492: /* type_specifier_nonarray: I64IMAGE1D */
-#line 3293 "MachineIndependent/glslang.y"
+ case 495: /* type_specifier_nonarray: I64IMAGE1D */
+#line 3318 "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 10327 "MachineIndependent/glslang_tab.cpp"
+#line 10385 "MachineIndependent/glslang_tab.cpp"
break;
- case 493: /* type_specifier_nonarray: U64IMAGE1D */
-#line 3298 "MachineIndependent/glslang.y"
+ case 496: /* type_specifier_nonarray: U64IMAGE1D */
+#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(EbtUint64, Esd1D);
}
-#line 10337 "MachineIndependent/glslang_tab.cpp"
+#line 10395 "MachineIndependent/glslang_tab.cpp"
break;
- case 494: /* type_specifier_nonarray: I64IMAGE2D */
-#line 3303 "MachineIndependent/glslang.y"
+ case 497: /* type_specifier_nonarray: I64IMAGE2D */
+#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(EbtInt64, Esd2D);
}
-#line 10347 "MachineIndependent/glslang_tab.cpp"
+#line 10405 "MachineIndependent/glslang_tab.cpp"
break;
- case 495: /* type_specifier_nonarray: U64IMAGE2D */
-#line 3308 "MachineIndependent/glslang.y"
+ case 498: /* type_specifier_nonarray: U64IMAGE2D */
+#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(EbtUint64, Esd2D);
}
-#line 10357 "MachineIndependent/glslang_tab.cpp"
+#line 10415 "MachineIndependent/glslang_tab.cpp"
break;
- case 496: /* type_specifier_nonarray: I64IMAGE3D */
-#line 3313 "MachineIndependent/glslang.y"
+ case 499: /* type_specifier_nonarray: I64IMAGE3D */
+#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(EbtInt64, Esd3D);
}
-#line 10367 "MachineIndependent/glslang_tab.cpp"
+#line 10425 "MachineIndependent/glslang_tab.cpp"
break;
- case 497: /* type_specifier_nonarray: U64IMAGE3D */
-#line 3318 "MachineIndependent/glslang.y"
+ case 500: /* type_specifier_nonarray: U64IMAGE3D */
+#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(EbtUint64, Esd3D);
}
-#line 10377 "MachineIndependent/glslang_tab.cpp"
+#line 10435 "MachineIndependent/glslang_tab.cpp"
break;
- case 498: /* type_specifier_nonarray: I64IMAGE2DRECT */
-#line 3323 "MachineIndependent/glslang.y"
+ case 501: /* type_specifier_nonarray: I64IMAGE2DRECT */
+#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(EbtInt64, EsdRect);
}
-#line 10387 "MachineIndependent/glslang_tab.cpp"
+#line 10445 "MachineIndependent/glslang_tab.cpp"
break;
- case 499: /* type_specifier_nonarray: U64IMAGE2DRECT */
-#line 3328 "MachineIndependent/glslang.y"
+ case 502: /* type_specifier_nonarray: U64IMAGE2DRECT */
+#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(EbtUint64, EsdRect);
}
-#line 10397 "MachineIndependent/glslang_tab.cpp"
+#line 10455 "MachineIndependent/glslang_tab.cpp"
break;
- case 500: /* type_specifier_nonarray: I64IMAGECUBE */
-#line 3333 "MachineIndependent/glslang.y"
+ case 503: /* type_specifier_nonarray: I64IMAGECUBE */
+#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(EbtInt64, EsdCube);
}
-#line 10407 "MachineIndependent/glslang_tab.cpp"
+#line 10465 "MachineIndependent/glslang_tab.cpp"
break;
- case 501: /* type_specifier_nonarray: U64IMAGECUBE */
-#line 3338 "MachineIndependent/glslang.y"
+ case 504: /* type_specifier_nonarray: U64IMAGECUBE */
+#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(EbtUint64, EsdCube);
}
-#line 10417 "MachineIndependent/glslang_tab.cpp"
+#line 10475 "MachineIndependent/glslang_tab.cpp"
break;
- case 502: /* type_specifier_nonarray: I64IMAGEBUFFER */
-#line 3343 "MachineIndependent/glslang.y"
+ case 505: /* type_specifier_nonarray: I64IMAGEBUFFER */
+#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(EbtInt64, EsdBuffer);
}
-#line 10427 "MachineIndependent/glslang_tab.cpp"
+#line 10485 "MachineIndependent/glslang_tab.cpp"
break;
- case 503: /* type_specifier_nonarray: U64IMAGEBUFFER */
-#line 3348 "MachineIndependent/glslang.y"
+ case 506: /* type_specifier_nonarray: U64IMAGEBUFFER */
+#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(EbtUint64, EsdBuffer);
}
-#line 10437 "MachineIndependent/glslang_tab.cpp"
+#line 10495 "MachineIndependent/glslang_tab.cpp"
break;
- case 504: /* type_specifier_nonarray: I64IMAGE1DARRAY */
-#line 3353 "MachineIndependent/glslang.y"
+ case 507: /* type_specifier_nonarray: I64IMAGE1DARRAY */
+#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(EbtInt64, Esd1D, true);
}
-#line 10447 "MachineIndependent/glslang_tab.cpp"
+#line 10505 "MachineIndependent/glslang_tab.cpp"
break;
- case 505: /* type_specifier_nonarray: U64IMAGE1DARRAY */
-#line 3358 "MachineIndependent/glslang.y"
+ case 508: /* type_specifier_nonarray: U64IMAGE1DARRAY */
+#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(EbtUint64, Esd1D, true);
}
-#line 10457 "MachineIndependent/glslang_tab.cpp"
+#line 10515 "MachineIndependent/glslang_tab.cpp"
break;
- case 506: /* type_specifier_nonarray: I64IMAGE2DARRAY */
-#line 3363 "MachineIndependent/glslang.y"
+ case 509: /* type_specifier_nonarray: I64IMAGE2DARRAY */
+#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(EbtInt64, Esd2D, true);
}
-#line 10467 "MachineIndependent/glslang_tab.cpp"
+#line 10525 "MachineIndependent/glslang_tab.cpp"
break;
- case 507: /* type_specifier_nonarray: U64IMAGE2DARRAY */
-#line 3368 "MachineIndependent/glslang.y"
+ case 510: /* type_specifier_nonarray: U64IMAGE2DARRAY */
+#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(EbtUint64, Esd2D, true);
}
-#line 10477 "MachineIndependent/glslang_tab.cpp"
+#line 10535 "MachineIndependent/glslang_tab.cpp"
break;
- case 508: /* type_specifier_nonarray: I64IMAGECUBEARRAY */
-#line 3373 "MachineIndependent/glslang.y"
+ case 511: /* type_specifier_nonarray: I64IMAGECUBEARRAY */
+#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(EbtInt64, EsdCube, true);
}
-#line 10487 "MachineIndependent/glslang_tab.cpp"
+#line 10545 "MachineIndependent/glslang_tab.cpp"
break;
- case 509: /* type_specifier_nonarray: U64IMAGECUBEARRAY */
-#line 3378 "MachineIndependent/glslang.y"
+ case 512: /* type_specifier_nonarray: U64IMAGECUBEARRAY */
+#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(EbtUint64, EsdCube, true);
}
-#line 10497 "MachineIndependent/glslang_tab.cpp"
+#line 10555 "MachineIndependent/glslang_tab.cpp"
break;
- case 510: /* type_specifier_nonarray: I64IMAGE2DMS */
-#line 3383 "MachineIndependent/glslang.y"
+ case 513: /* type_specifier_nonarray: I64IMAGE2DMS */
+#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(EbtInt64, Esd2D, false, false, true);
}
-#line 10507 "MachineIndependent/glslang_tab.cpp"
+#line 10565 "MachineIndependent/glslang_tab.cpp"
break;
- case 511: /* type_specifier_nonarray: U64IMAGE2DMS */
-#line 3388 "MachineIndependent/glslang.y"
+ case 514: /* type_specifier_nonarray: U64IMAGE2DMS */
+#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(EbtUint64, Esd2D, false, false, true);
}
-#line 10517 "MachineIndependent/glslang_tab.cpp"
+#line 10575 "MachineIndependent/glslang_tab.cpp"
break;
- case 512: /* type_specifier_nonarray: I64IMAGE2DMSARRAY */
-#line 3393 "MachineIndependent/glslang.y"
+ case 515: /* type_specifier_nonarray: I64IMAGE2DMSARRAY */
+#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(EbtInt64, Esd2D, true, false, true);
}
-#line 10527 "MachineIndependent/glslang_tab.cpp"
+#line 10585 "MachineIndependent/glslang_tab.cpp"
break;
- case 513: /* type_specifier_nonarray: U64IMAGE2DMSARRAY */
-#line 3398 "MachineIndependent/glslang.y"
+ case 516: /* type_specifier_nonarray: U64IMAGE2DMSARRAY */
+#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(EbtUint64, Esd2D, true, false, true);
}
-#line 10537 "MachineIndependent/glslang_tab.cpp"
+#line 10595 "MachineIndependent/glslang_tab.cpp"
break;
- case 514: /* type_specifier_nonarray: SAMPLEREXTERNALOES */
-#line 3403 "MachineIndependent/glslang.y"
+ case 517: /* type_specifier_nonarray: SAMPLEREXTERNALOES */
+#line 3428 "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 10548 "MachineIndependent/glslang_tab.cpp"
+#line 10606 "MachineIndependent/glslang_tab.cpp"
break;
- case 515: /* type_specifier_nonarray: SAMPLEREXTERNAL2DY2YEXT */
-#line 3409 "MachineIndependent/glslang.y"
+ case 518: /* type_specifier_nonarray: SAMPLEREXTERNAL2DY2YEXT */
+#line 3434 "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 10559 "MachineIndependent/glslang_tab.cpp"
+#line 10617 "MachineIndependent/glslang_tab.cpp"
break;
- case 516: /* type_specifier_nonarray: SUBPASSINPUT */
-#line 3415 "MachineIndependent/glslang.y"
+ case 519: /* type_specifier_nonarray: SUBPASSINPUT */
+#line 3440 "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 10570 "MachineIndependent/glslang_tab.cpp"
+#line 10628 "MachineIndependent/glslang_tab.cpp"
break;
- case 517: /* type_specifier_nonarray: SUBPASSINPUTMS */
-#line 3421 "MachineIndependent/glslang.y"
+ case 520: /* type_specifier_nonarray: SUBPASSINPUTMS */
+#line 3446 "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 10581 "MachineIndependent/glslang_tab.cpp"
+#line 10639 "MachineIndependent/glslang_tab.cpp"
break;
- case 518: /* type_specifier_nonarray: F16SUBPASSINPUT */
-#line 3427 "MachineIndependent/glslang.y"
+ case 521: /* type_specifier_nonarray: F16SUBPASSINPUT */
+#line 3452 "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");
@@ -10589,11 +10647,11 @@ yyreduce:
(yyval.interm.type).basicType = EbtSampler;
(yyval.interm.type).sampler.setSubpass(EbtFloat16);
}
-#line 10593 "MachineIndependent/glslang_tab.cpp"
+#line 10651 "MachineIndependent/glslang_tab.cpp"
break;
- case 519: /* type_specifier_nonarray: F16SUBPASSINPUTMS */
-#line 3434 "MachineIndependent/glslang.y"
+ case 522: /* type_specifier_nonarray: F16SUBPASSINPUTMS */
+#line 3459 "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");
@@ -10601,107 +10659,107 @@ yyreduce:
(yyval.interm.type).basicType = EbtSampler;
(yyval.interm.type).sampler.setSubpass(EbtFloat16, true);
}
-#line 10605 "MachineIndependent/glslang_tab.cpp"
+#line 10663 "MachineIndependent/glslang_tab.cpp"
break;
- case 520: /* type_specifier_nonarray: ISUBPASSINPUT */
-#line 3441 "MachineIndependent/glslang.y"
+ case 523: /* type_specifier_nonarray: ISUBPASSINPUT */
+#line 3466 "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 10616 "MachineIndependent/glslang_tab.cpp"
+#line 10674 "MachineIndependent/glslang_tab.cpp"
break;
- case 521: /* type_specifier_nonarray: ISUBPASSINPUTMS */
-#line 3447 "MachineIndependent/glslang.y"
+ case 524: /* type_specifier_nonarray: ISUBPASSINPUTMS */
+#line 3472 "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 10627 "MachineIndependent/glslang_tab.cpp"
+#line 10685 "MachineIndependent/glslang_tab.cpp"
break;
- case 522: /* type_specifier_nonarray: USUBPASSINPUT */
-#line 3453 "MachineIndependent/glslang.y"
+ case 525: /* type_specifier_nonarray: USUBPASSINPUT */
+#line 3478 "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 10638 "MachineIndependent/glslang_tab.cpp"
+#line 10696 "MachineIndependent/glslang_tab.cpp"
break;
- case 523: /* type_specifier_nonarray: USUBPASSINPUTMS */
-#line 3459 "MachineIndependent/glslang.y"
+ case 526: /* type_specifier_nonarray: USUBPASSINPUTMS */
+#line 3484 "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 10649 "MachineIndependent/glslang_tab.cpp"
+#line 10707 "MachineIndependent/glslang_tab.cpp"
break;
- case 524: /* type_specifier_nonarray: FCOOPMATNV */
-#line 3465 "MachineIndependent/glslang.y"
+ case 527: /* type_specifier_nonarray: FCOOPMATNV */
+#line 3490 "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 10660 "MachineIndependent/glslang_tab.cpp"
+#line 10718 "MachineIndependent/glslang_tab.cpp"
break;
- case 525: /* type_specifier_nonarray: ICOOPMATNV */
-#line 3471 "MachineIndependent/glslang.y"
+ case 528: /* type_specifier_nonarray: ICOOPMATNV */
+#line 3496 "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 10671 "MachineIndependent/glslang_tab.cpp"
+#line 10729 "MachineIndependent/glslang_tab.cpp"
break;
- case 526: /* type_specifier_nonarray: UCOOPMATNV */
-#line 3477 "MachineIndependent/glslang.y"
+ case 529: /* type_specifier_nonarray: UCOOPMATNV */
+#line 3502 "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 10682 "MachineIndependent/glslang_tab.cpp"
+#line 10740 "MachineIndependent/glslang_tab.cpp"
break;
- case 527: /* type_specifier_nonarray: spirv_type_specifier */
-#line 3483 "MachineIndependent/glslang.y"
+ case 530: /* type_specifier_nonarray: spirv_type_specifier */
+#line 3508 "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 10691 "MachineIndependent/glslang_tab.cpp"
+#line 10749 "MachineIndependent/glslang_tab.cpp"
break;
- case 528: /* type_specifier_nonarray: struct_specifier */
-#line 3488 "MachineIndependent/glslang.y"
+ case 531: /* type_specifier_nonarray: struct_specifier */
+#line 3513 "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 10701 "MachineIndependent/glslang_tab.cpp"
+#line 10759 "MachineIndependent/glslang_tab.cpp"
break;
- case 529: /* type_specifier_nonarray: TYPE_NAME */
-#line 3493 "MachineIndependent/glslang.y"
+ case 532: /* type_specifier_nonarray: TYPE_NAME */
+#line 3518 "MachineIndependent/glslang.y"
{
//
// This is for user defined type names. The lexical phase looked up the
@@ -10715,47 +10773,47 @@ yyreduce:
} else
parseContext.error((yyvsp[0].lex).loc, "expected type name", (yyvsp[0].lex).string->c_str(), "");
}
-#line 10719 "MachineIndependent/glslang_tab.cpp"
+#line 10777 "MachineIndependent/glslang_tab.cpp"
break;
- case 530: /* precision_qualifier: HIGH_PRECISION */
-#line 3509 "MachineIndependent/glslang.y"
+ case 533: /* precision_qualifier: HIGH_PRECISION */
+#line 3534 "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 10729 "MachineIndependent/glslang_tab.cpp"
+#line 10787 "MachineIndependent/glslang_tab.cpp"
break;
- case 531: /* precision_qualifier: MEDIUM_PRECISION */
-#line 3514 "MachineIndependent/glslang.y"
+ case 534: /* precision_qualifier: MEDIUM_PRECISION */
+#line 3539 "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 10739 "MachineIndependent/glslang_tab.cpp"
+#line 10797 "MachineIndependent/glslang_tab.cpp"
break;
- case 532: /* precision_qualifier: LOW_PRECISION */
-#line 3519 "MachineIndependent/glslang.y"
+ case 535: /* precision_qualifier: LOW_PRECISION */
+#line 3544 "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 10749 "MachineIndependent/glslang_tab.cpp"
+#line 10807 "MachineIndependent/glslang_tab.cpp"
break;
- case 533: /* $@3: %empty */
-#line 3527 "MachineIndependent/glslang.y"
+ case 536: /* $@3: %empty */
+#line 3552 "MachineIndependent/glslang.y"
{ parseContext.nestedStructCheck((yyvsp[-2].lex).loc); }
-#line 10755 "MachineIndependent/glslang_tab.cpp"
+#line 10813 "MachineIndependent/glslang_tab.cpp"
break;
- case 534: /* struct_specifier: STRUCT IDENTIFIER LEFT_BRACE $@3 struct_declaration_list RIGHT_BRACE */
-#line 3527 "MachineIndependent/glslang.y"
+ case 537: /* struct_specifier: STRUCT IDENTIFIER LEFT_BRACE $@3 struct_declaration_list RIGHT_BRACE */
+#line 3552 "MachineIndependent/glslang.y"
{
TType* structure = new TType((yyvsp[-1].interm.typeList), *(yyvsp[-4].lex).string);
parseContext.structArrayCheck((yyvsp[-4].lex).loc, *structure);
@@ -10767,17 +10825,17 @@ yyreduce:
(yyval.interm.type).userDef = structure;
--parseContext.structNestingLevel;
}
-#line 10771 "MachineIndependent/glslang_tab.cpp"
+#line 10829 "MachineIndependent/glslang_tab.cpp"
break;
- case 535: /* $@4: %empty */
-#line 3538 "MachineIndependent/glslang.y"
+ case 538: /* $@4: %empty */
+#line 3563 "MachineIndependent/glslang.y"
{ parseContext.nestedStructCheck((yyvsp[-1].lex).loc); }
-#line 10777 "MachineIndependent/glslang_tab.cpp"
+#line 10835 "MachineIndependent/glslang_tab.cpp"
break;
- case 536: /* struct_specifier: STRUCT LEFT_BRACE $@4 struct_declaration_list RIGHT_BRACE */
-#line 3538 "MachineIndependent/glslang.y"
+ case 539: /* struct_specifier: STRUCT LEFT_BRACE $@4 struct_declaration_list RIGHT_BRACE */
+#line 3563 "MachineIndependent/glslang.y"
{
TType* structure = new TType((yyvsp[-1].interm.typeList), TString(""));
(yyval.interm.type).init((yyvsp[-4].lex).loc);
@@ -10785,19 +10843,19 @@ yyreduce:
(yyval.interm.type).userDef = structure;
--parseContext.structNestingLevel;
}
-#line 10789 "MachineIndependent/glslang_tab.cpp"
+#line 10847 "MachineIndependent/glslang_tab.cpp"
break;
- case 537: /* struct_declaration_list: struct_declaration */
-#line 3548 "MachineIndependent/glslang.y"
+ case 540: /* struct_declaration_list: struct_declaration */
+#line 3573 "MachineIndependent/glslang.y"
{
(yyval.interm.typeList) = (yyvsp[0].interm.typeList);
}
-#line 10797 "MachineIndependent/glslang_tab.cpp"
+#line 10855 "MachineIndependent/glslang_tab.cpp"
break;
- case 538: /* struct_declaration_list: struct_declaration_list struct_declaration */
-#line 3551 "MachineIndependent/glslang.y"
+ case 541: /* struct_declaration_list: struct_declaration_list struct_declaration */
+#line 3576 "MachineIndependent/glslang.y"
{
(yyval.interm.typeList) = (yyvsp[-1].interm.typeList);
for (unsigned int i = 0; i < (yyvsp[0].interm.typeList)->size(); ++i) {
@@ -10808,11 +10866,11 @@ yyreduce:
(yyval.interm.typeList)->push_back((*(yyvsp[0].interm.typeList))[i]);
}
}
-#line 10812 "MachineIndependent/glslang_tab.cpp"
+#line 10870 "MachineIndependent/glslang_tab.cpp"
break;
- case 539: /* struct_declaration: type_specifier struct_declarator_list SEMICOLON */
-#line 3564 "MachineIndependent/glslang.y"
+ case 542: /* struct_declaration: type_specifier struct_declarator_list SEMICOLON */
+#line 3589 "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");
@@ -10835,11 +10893,11 @@ yyreduce:
(*(yyval.interm.typeList))[i].type->shallowCopy(type);
}
}
-#line 10839 "MachineIndependent/glslang_tab.cpp"
+#line 10897 "MachineIndependent/glslang_tab.cpp"
break;
- case 540: /* struct_declaration: type_qualifier type_specifier struct_declarator_list SEMICOLON */
-#line 3586 "MachineIndependent/glslang.y"
+ case 543: /* struct_declaration: type_qualifier type_specifier struct_declarator_list SEMICOLON */
+#line 3611 "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");
@@ -10864,38 +10922,38 @@ yyreduce:
(*(yyval.interm.typeList))[i].type->shallowCopy(type);
}
}
-#line 10868 "MachineIndependent/glslang_tab.cpp"
+#line 10926 "MachineIndependent/glslang_tab.cpp"
break;
- case 541: /* struct_declarator_list: struct_declarator */
-#line 3613 "MachineIndependent/glslang.y"
+ case 544: /* struct_declarator_list: struct_declarator */
+#line 3638 "MachineIndependent/glslang.y"
{
(yyval.interm.typeList) = new TTypeList;
(yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine));
}
-#line 10877 "MachineIndependent/glslang_tab.cpp"
+#line 10935 "MachineIndependent/glslang_tab.cpp"
break;
- case 542: /* struct_declarator_list: struct_declarator_list COMMA struct_declarator */
-#line 3617 "MachineIndependent/glslang.y"
+ case 545: /* struct_declarator_list: struct_declarator_list COMMA struct_declarator */
+#line 3642 "MachineIndependent/glslang.y"
{
(yyval.interm.typeList)->push_back((yyvsp[0].interm.typeLine));
}
-#line 10885 "MachineIndependent/glslang_tab.cpp"
+#line 10943 "MachineIndependent/glslang_tab.cpp"
break;
- case 543: /* struct_declarator: IDENTIFIER */
-#line 3623 "MachineIndependent/glslang.y"
+ case 546: /* struct_declarator: IDENTIFIER */
+#line 3648 "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 10895 "MachineIndependent/glslang_tab.cpp"
+#line 10953 "MachineIndependent/glslang_tab.cpp"
break;
- case 544: /* struct_declarator: IDENTIFIER array_specifier */
-#line 3628 "MachineIndependent/glslang.y"
+ case 547: /* struct_declarator: IDENTIFIER array_specifier */
+#line 3653 "MachineIndependent/glslang.y"
{
parseContext.arrayOfArrayVersionCheck((yyvsp[-1].lex).loc, (yyvsp[0].interm).arraySizes);
@@ -10904,246 +10962,246 @@ yyreduce:
(yyval.interm.typeLine).type->setFieldName(*(yyvsp[-1].lex).string);
(yyval.interm.typeLine).type->transferArraySizes((yyvsp[0].interm).arraySizes);
}
-#line 10908 "MachineIndependent/glslang_tab.cpp"
+#line 10966 "MachineIndependent/glslang_tab.cpp"
break;
- case 545: /* initializer: assignment_expression */
-#line 3639 "MachineIndependent/glslang.y"
+ case 548: /* initializer: assignment_expression */
+#line 3664 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
-#line 10916 "MachineIndependent/glslang_tab.cpp"
+#line 10974 "MachineIndependent/glslang_tab.cpp"
break;
- case 546: /* initializer: LEFT_BRACE initializer_list RIGHT_BRACE */
-#line 3643 "MachineIndependent/glslang.y"
+ case 549: /* initializer: LEFT_BRACE initializer_list RIGHT_BRACE */
+#line 3668 "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 10927 "MachineIndependent/glslang_tab.cpp"
+#line 10985 "MachineIndependent/glslang_tab.cpp"
break;
- case 547: /* initializer: LEFT_BRACE initializer_list COMMA RIGHT_BRACE */
-#line 3649 "MachineIndependent/glslang.y"
+ case 550: /* initializer: LEFT_BRACE initializer_list COMMA RIGHT_BRACE */
+#line 3674 "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 10938 "MachineIndependent/glslang_tab.cpp"
+#line 10996 "MachineIndependent/glslang_tab.cpp"
break;
- case 548: /* initializer: LEFT_BRACE RIGHT_BRACE */
-#line 3655 "MachineIndependent/glslang.y"
+ case 551: /* initializer: LEFT_BRACE RIGHT_BRACE */
+#line 3680 "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 10949 "MachineIndependent/glslang_tab.cpp"
+#line 11007 "MachineIndependent/glslang_tab.cpp"
break;
- case 549: /* initializer_list: initializer */
-#line 3666 "MachineIndependent/glslang.y"
+ 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 10957 "MachineIndependent/glslang_tab.cpp"
+#line 11015 "MachineIndependent/glslang_tab.cpp"
break;
- case 550: /* initializer_list: initializer_list COMMA initializer */
-#line 3669 "MachineIndependent/glslang.y"
+ 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 10965 "MachineIndependent/glslang_tab.cpp"
+#line 11023 "MachineIndependent/glslang_tab.cpp"
break;
- case 551: /* declaration_statement: declaration */
-#line 3676 "MachineIndependent/glslang.y"
+ case 554: /* declaration_statement: declaration */
+#line 3701 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
-#line 10971 "MachineIndependent/glslang_tab.cpp"
+#line 11029 "MachineIndependent/glslang_tab.cpp"
break;
- case 552: /* statement: compound_statement */
-#line 3680 "MachineIndependent/glslang.y"
+ case 555: /* statement: compound_statement */
+#line 3705 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
-#line 10977 "MachineIndependent/glslang_tab.cpp"
+#line 11035 "MachineIndependent/glslang_tab.cpp"
break;
- case 553: /* statement: simple_statement */
-#line 3681 "MachineIndependent/glslang.y"
+ case 556: /* statement: simple_statement */
+#line 3706 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
-#line 10983 "MachineIndependent/glslang_tab.cpp"
+#line 11041 "MachineIndependent/glslang_tab.cpp"
break;
- case 554: /* simple_statement: declaration_statement */
-#line 3687 "MachineIndependent/glslang.y"
+ case 557: /* simple_statement: declaration_statement */
+#line 3712 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
-#line 10989 "MachineIndependent/glslang_tab.cpp"
+#line 11047 "MachineIndependent/glslang_tab.cpp"
break;
- case 555: /* simple_statement: expression_statement */
-#line 3688 "MachineIndependent/glslang.y"
+ case 558: /* simple_statement: expression_statement */
+#line 3713 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
-#line 10995 "MachineIndependent/glslang_tab.cpp"
+#line 11053 "MachineIndependent/glslang_tab.cpp"
break;
- case 556: /* simple_statement: selection_statement */
-#line 3689 "MachineIndependent/glslang.y"
+ case 559: /* simple_statement: selection_statement */
+#line 3714 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
-#line 11001 "MachineIndependent/glslang_tab.cpp"
+#line 11059 "MachineIndependent/glslang_tab.cpp"
break;
- case 557: /* simple_statement: switch_statement */
-#line 3690 "MachineIndependent/glslang.y"
+ case 560: /* simple_statement: switch_statement */
+#line 3715 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
-#line 11007 "MachineIndependent/glslang_tab.cpp"
+#line 11065 "MachineIndependent/glslang_tab.cpp"
break;
- case 558: /* simple_statement: case_label */
-#line 3691 "MachineIndependent/glslang.y"
+ case 561: /* simple_statement: case_label */
+#line 3716 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
-#line 11013 "MachineIndependent/glslang_tab.cpp"
+#line 11071 "MachineIndependent/glslang_tab.cpp"
break;
- case 559: /* simple_statement: iteration_statement */
-#line 3692 "MachineIndependent/glslang.y"
+ case 562: /* simple_statement: iteration_statement */
+#line 3717 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
-#line 11019 "MachineIndependent/glslang_tab.cpp"
+#line 11077 "MachineIndependent/glslang_tab.cpp"
break;
- case 560: /* simple_statement: jump_statement */
-#line 3693 "MachineIndependent/glslang.y"
+ case 563: /* simple_statement: jump_statement */
+#line 3718 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
-#line 11025 "MachineIndependent/glslang_tab.cpp"
+#line 11083 "MachineIndependent/glslang_tab.cpp"
break;
- case 561: /* simple_statement: demote_statement */
-#line 3695 "MachineIndependent/glslang.y"
+ case 564: /* simple_statement: demote_statement */
+#line 3720 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
-#line 11031 "MachineIndependent/glslang_tab.cpp"
+#line 11089 "MachineIndependent/glslang_tab.cpp"
break;
- case 562: /* demote_statement: DEMOTE SEMICOLON */
-#line 3701 "MachineIndependent/glslang.y"
+ case 565: /* demote_statement: DEMOTE SEMICOLON */
+#line 3726 "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 11041 "MachineIndependent/glslang_tab.cpp"
+#line 11099 "MachineIndependent/glslang_tab.cpp"
break;
- case 563: /* compound_statement: LEFT_BRACE RIGHT_BRACE */
-#line 3710 "MachineIndependent/glslang.y"
+ case 566: /* compound_statement: LEFT_BRACE RIGHT_BRACE */
+#line 3735 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = 0; }
-#line 11047 "MachineIndependent/glslang_tab.cpp"
+#line 11105 "MachineIndependent/glslang_tab.cpp"
break;
- case 564: /* $@5: %empty */
-#line 3711 "MachineIndependent/glslang.y"
+ case 567: /* $@5: %empty */
+#line 3736 "MachineIndependent/glslang.y"
{
parseContext.symbolTable.push();
++parseContext.statementNestingLevel;
}
-#line 11056 "MachineIndependent/glslang_tab.cpp"
+#line 11114 "MachineIndependent/glslang_tab.cpp"
break;
- case 565: /* $@6: %empty */
-#line 3715 "MachineIndependent/glslang.y"
+ case 568: /* $@6: %empty */
+#line 3740 "MachineIndependent/glslang.y"
{
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
--parseContext.statementNestingLevel;
}
-#line 11065 "MachineIndependent/glslang_tab.cpp"
+#line 11123 "MachineIndependent/glslang_tab.cpp"
break;
- case 566: /* compound_statement: LEFT_BRACE $@5 statement_list $@6 RIGHT_BRACE */
-#line 3719 "MachineIndependent/glslang.y"
+ case 569: /* compound_statement: LEFT_BRACE $@5 statement_list $@6 RIGHT_BRACE */
+#line 3744 "MachineIndependent/glslang.y"
{
if ((yyvsp[-2].interm.intermNode) && (yyvsp[-2].interm.intermNode)->getAsAggregate())
- (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(EOpSequence);
+ (yyvsp[-2].interm.intermNode)->getAsAggregate()->setOperator(parseContext.intermediate.getDebugInfo() ? EOpScope : EOpSequence);
(yyval.interm.intermNode) = (yyvsp[-2].interm.intermNode);
}
-#line 11075 "MachineIndependent/glslang_tab.cpp"
+#line 11133 "MachineIndependent/glslang_tab.cpp"
break;
- case 567: /* statement_no_new_scope: compound_statement_no_new_scope */
-#line 3727 "MachineIndependent/glslang.y"
+ case 570: /* statement_no_new_scope: compound_statement_no_new_scope */
+#line 3752 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
-#line 11081 "MachineIndependent/glslang_tab.cpp"
+#line 11139 "MachineIndependent/glslang_tab.cpp"
break;
- case 568: /* statement_no_new_scope: simple_statement */
-#line 3728 "MachineIndependent/glslang.y"
+ case 571: /* statement_no_new_scope: simple_statement */
+#line 3753 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
-#line 11087 "MachineIndependent/glslang_tab.cpp"
+#line 11145 "MachineIndependent/glslang_tab.cpp"
break;
- case 569: /* $@7: %empty */
-#line 3732 "MachineIndependent/glslang.y"
+ case 572: /* $@7: %empty */
+#line 3757 "MachineIndependent/glslang.y"
{
++parseContext.controlFlowNestingLevel;
}
-#line 11095 "MachineIndependent/glslang_tab.cpp"
+#line 11153 "MachineIndependent/glslang_tab.cpp"
break;
- case 570: /* statement_scoped: $@7 compound_statement */
-#line 3735 "MachineIndependent/glslang.y"
+ case 573: /* statement_scoped: $@7 compound_statement */
+#line 3760 "MachineIndependent/glslang.y"
{
--parseContext.controlFlowNestingLevel;
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
-#line 11104 "MachineIndependent/glslang_tab.cpp"
+#line 11162 "MachineIndependent/glslang_tab.cpp"
break;
- case 571: /* $@8: %empty */
-#line 3739 "MachineIndependent/glslang.y"
+ case 574: /* $@8: %empty */
+#line 3764 "MachineIndependent/glslang.y"
{
parseContext.symbolTable.push();
++parseContext.statementNestingLevel;
++parseContext.controlFlowNestingLevel;
}
-#line 11114 "MachineIndependent/glslang_tab.cpp"
+#line 11172 "MachineIndependent/glslang_tab.cpp"
break;
- case 572: /* statement_scoped: $@8 simple_statement */
-#line 3744 "MachineIndependent/glslang.y"
+ case 575: /* statement_scoped: $@8 simple_statement */
+#line 3769 "MachineIndependent/glslang.y"
{
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
--parseContext.statementNestingLevel;
--parseContext.controlFlowNestingLevel;
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
-#line 11125 "MachineIndependent/glslang_tab.cpp"
+#line 11183 "MachineIndependent/glslang_tab.cpp"
break;
- case 573: /* compound_statement_no_new_scope: LEFT_BRACE RIGHT_BRACE */
-#line 3753 "MachineIndependent/glslang.y"
+ case 576: /* compound_statement_no_new_scope: LEFT_BRACE RIGHT_BRACE */
+#line 3778 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = 0;
}
-#line 11133 "MachineIndependent/glslang_tab.cpp"
+#line 11191 "MachineIndependent/glslang_tab.cpp"
break;
- case 574: /* compound_statement_no_new_scope: LEFT_BRACE statement_list RIGHT_BRACE */
-#line 3756 "MachineIndependent/glslang.y"
+ case 577: /* compound_statement_no_new_scope: LEFT_BRACE statement_list RIGHT_BRACE */
+#line 3781 "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 11143 "MachineIndependent/glslang_tab.cpp"
+#line 11201 "MachineIndependent/glslang_tab.cpp"
break;
- case 575: /* statement_list: statement */
-#line 3764 "MachineIndependent/glslang.y"
+ case 578: /* statement_list: statement */
+#line 3789 "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 ||
@@ -11152,11 +11210,11 @@ yyreduce:
(yyval.interm.intermNode) = 0; // start a fresh subsequence for what's after this case
}
}
-#line 11156 "MachineIndependent/glslang_tab.cpp"
+#line 11214 "MachineIndependent/glslang_tab.cpp"
break;
- case 576: /* statement_list: statement_list statement */
-#line 3772 "MachineIndependent/glslang.y"
+ case 579: /* statement_list: statement_list statement */
+#line 3797 "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)) {
@@ -11165,77 +11223,77 @@ yyreduce:
} else
(yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-1].interm.intermNode), (yyvsp[0].interm.intermNode));
}
-#line 11169 "MachineIndependent/glslang_tab.cpp"
+#line 11227 "MachineIndependent/glslang_tab.cpp"
break;
- case 577: /* expression_statement: SEMICOLON */
-#line 3783 "MachineIndependent/glslang.y"
+ case 580: /* expression_statement: SEMICOLON */
+#line 3808 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = 0; }
-#line 11175 "MachineIndependent/glslang_tab.cpp"
+#line 11233 "MachineIndependent/glslang_tab.cpp"
break;
- case 578: /* expression_statement: expression SEMICOLON */
-#line 3784 "MachineIndependent/glslang.y"
+ case 581: /* expression_statement: expression SEMICOLON */
+#line 3809 "MachineIndependent/glslang.y"
{ (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[-1].interm.intermTypedNode)); }
-#line 11181 "MachineIndependent/glslang_tab.cpp"
+#line 11239 "MachineIndependent/glslang_tab.cpp"
break;
- case 579: /* selection_statement: selection_statement_nonattributed */
-#line 3788 "MachineIndependent/glslang.y"
+ case 582: /* selection_statement: selection_statement_nonattributed */
+#line 3813 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
-#line 11189 "MachineIndependent/glslang_tab.cpp"
+#line 11247 "MachineIndependent/glslang_tab.cpp"
break;
- case 580: /* selection_statement: attribute selection_statement_nonattributed */
-#line 3792 "MachineIndependent/glslang.y"
+ case 583: /* selection_statement: attribute selection_statement_nonattributed */
+#line 3817 "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 11199 "MachineIndependent/glslang_tab.cpp"
+#line 11257 "MachineIndependent/glslang_tab.cpp"
break;
- case 581: /* selection_statement_nonattributed: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement */
-#line 3800 "MachineIndependent/glslang.y"
+ case 584: /* selection_statement_nonattributed: IF LEFT_PAREN expression RIGHT_PAREN selection_rest_statement */
+#line 3825 "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 11208 "MachineIndependent/glslang_tab.cpp"
+#line 11266 "MachineIndependent/glslang_tab.cpp"
break;
- case 582: /* selection_rest_statement: statement_scoped ELSE statement_scoped */
-#line 3807 "MachineIndependent/glslang.y"
+ case 585: /* selection_rest_statement: statement_scoped ELSE statement_scoped */
+#line 3832 "MachineIndependent/glslang.y"
{
(yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode);
(yyval.interm.nodePair).node2 = (yyvsp[0].interm.intermNode);
}
-#line 11217 "MachineIndependent/glslang_tab.cpp"
+#line 11275 "MachineIndependent/glslang_tab.cpp"
break;
- case 583: /* selection_rest_statement: statement_scoped */
-#line 3811 "MachineIndependent/glslang.y"
+ case 586: /* selection_rest_statement: statement_scoped */
+#line 3836 "MachineIndependent/glslang.y"
{
(yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode);
(yyval.interm.nodePair).node2 = 0;
}
-#line 11226 "MachineIndependent/glslang_tab.cpp"
+#line 11284 "MachineIndependent/glslang_tab.cpp"
break;
- case 584: /* condition: expression */
-#line 3819 "MachineIndependent/glslang.y"
+ case 587: /* condition: expression */
+#line 3844 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
parseContext.boolCheck((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode));
}
-#line 11235 "MachineIndependent/glslang_tab.cpp"
+#line 11293 "MachineIndependent/glslang_tab.cpp"
break;
- case 585: /* condition: fully_specified_type IDENTIFIER EQUAL initializer */
-#line 3823 "MachineIndependent/glslang.y"
+ case 588: /* condition: fully_specified_type IDENTIFIER EQUAL initializer */
+#line 3848 "MachineIndependent/glslang.y"
{
parseContext.boolCheck((yyvsp[-2].lex).loc, (yyvsp[-3].interm.type));
@@ -11246,29 +11304,29 @@ yyreduce:
else
(yyval.interm.intermTypedNode) = 0;
}
-#line 11250 "MachineIndependent/glslang_tab.cpp"
+#line 11308 "MachineIndependent/glslang_tab.cpp"
break;
- case 586: /* switch_statement: switch_statement_nonattributed */
-#line 3836 "MachineIndependent/glslang.y"
+ case 589: /* switch_statement: switch_statement_nonattributed */
+#line 3861 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
-#line 11258 "MachineIndependent/glslang_tab.cpp"
+#line 11316 "MachineIndependent/glslang_tab.cpp"
break;
- case 587: /* switch_statement: attribute switch_statement_nonattributed */
-#line 3840 "MachineIndependent/glslang.y"
+ case 590: /* switch_statement: attribute switch_statement_nonattributed */
+#line 3865 "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 11268 "MachineIndependent/glslang_tab.cpp"
+#line 11326 "MachineIndependent/glslang_tab.cpp"
break;
- case 588: /* $@9: %empty */
-#line 3848 "MachineIndependent/glslang.y"
+ case 591: /* $@9: %empty */
+#line 3873 "MachineIndependent/glslang.y"
{
// start new switch sequence on the switch stack
++parseContext.controlFlowNestingLevel;
@@ -11277,11 +11335,11 @@ yyreduce:
parseContext.switchLevel.push_back(parseContext.statementNestingLevel);
parseContext.symbolTable.push();
}
-#line 11281 "MachineIndependent/glslang_tab.cpp"
+#line 11339 "MachineIndependent/glslang_tab.cpp"
break;
- case 589: /* switch_statement_nonattributed: SWITCH LEFT_PAREN expression RIGHT_PAREN $@9 LEFT_BRACE switch_statement_list RIGHT_BRACE */
-#line 3856 "MachineIndependent/glslang.y"
+ case 592: /* switch_statement_nonattributed: SWITCH LEFT_PAREN expression RIGHT_PAREN $@9 LEFT_BRACE switch_statement_list RIGHT_BRACE */
+#line 3881 "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();
@@ -11291,27 +11349,27 @@ yyreduce:
--parseContext.statementNestingLevel;
--parseContext.controlFlowNestingLevel;
}
-#line 11295 "MachineIndependent/glslang_tab.cpp"
+#line 11353 "MachineIndependent/glslang_tab.cpp"
break;
- case 590: /* switch_statement_list: %empty */
-#line 3868 "MachineIndependent/glslang.y"
+ case 593: /* switch_statement_list: %empty */
+#line 3893 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = 0;
}
-#line 11303 "MachineIndependent/glslang_tab.cpp"
+#line 11361 "MachineIndependent/glslang_tab.cpp"
break;
- case 591: /* switch_statement_list: statement_list */
-#line 3871 "MachineIndependent/glslang.y"
+ case 594: /* switch_statement_list: statement_list */
+#line 3896 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
-#line 11311 "MachineIndependent/glslang_tab.cpp"
+#line 11369 "MachineIndependent/glslang_tab.cpp"
break;
- case 592: /* case_label: CASE expression COLON */
-#line 3877 "MachineIndependent/glslang.y"
+ case 595: /* case_label: CASE expression COLON */
+#line 3902 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = 0;
if (parseContext.switchLevel.size() == 0)
@@ -11324,11 +11382,11 @@ yyreduce:
(yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpCase, (yyvsp[-1].interm.intermTypedNode), (yyvsp[-2].lex).loc);
}
}
-#line 11328 "MachineIndependent/glslang_tab.cpp"
+#line 11386 "MachineIndependent/glslang_tab.cpp"
break;
- case 593: /* case_label: DEFAULT COLON */
-#line 3889 "MachineIndependent/glslang.y"
+ case 596: /* case_label: DEFAULT COLON */
+#line 3914 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = 0;
if (parseContext.switchLevel.size() == 0)
@@ -11338,29 +11396,29 @@ yyreduce:
else
(yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpDefault, (yyvsp[-1].lex).loc);
}
-#line 11342 "MachineIndependent/glslang_tab.cpp"
+#line 11400 "MachineIndependent/glslang_tab.cpp"
break;
- case 594: /* iteration_statement: iteration_statement_nonattributed */
-#line 3901 "MachineIndependent/glslang.y"
+ case 597: /* iteration_statement: iteration_statement_nonattributed */
+#line 3926 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
-#line 11350 "MachineIndependent/glslang_tab.cpp"
+#line 11408 "MachineIndependent/glslang_tab.cpp"
break;
- case 595: /* iteration_statement: attribute iteration_statement_nonattributed */
-#line 3905 "MachineIndependent/glslang.y"
+ case 598: /* iteration_statement: attribute iteration_statement_nonattributed */
+#line 3930 "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 11360 "MachineIndependent/glslang_tab.cpp"
+#line 11418 "MachineIndependent/glslang_tab.cpp"
break;
- case 596: /* $@10: %empty */
-#line 3913 "MachineIndependent/glslang.y"
+ case 599: /* $@10: %empty */
+#line 3938 "MachineIndependent/glslang.y"
{
if (! parseContext.limits.whileLoops)
parseContext.error((yyvsp[-1].lex).loc, "while loops not available", "limitation", "");
@@ -11369,11 +11427,11 @@ yyreduce:
++parseContext.statementNestingLevel;
++parseContext.controlFlowNestingLevel;
}
-#line 11373 "MachineIndependent/glslang_tab.cpp"
+#line 11431 "MachineIndependent/glslang_tab.cpp"
break;
- case 597: /* iteration_statement_nonattributed: WHILE LEFT_PAREN $@10 condition RIGHT_PAREN statement_no_new_scope */
-#line 3921 "MachineIndependent/glslang.y"
+ case 600: /* iteration_statement_nonattributed: WHILE LEFT_PAREN $@10 condition RIGHT_PAREN statement_no_new_scope */
+#line 3946 "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);
@@ -11381,22 +11439,22 @@ yyreduce:
--parseContext.statementNestingLevel;
--parseContext.controlFlowNestingLevel;
}
-#line 11385 "MachineIndependent/glslang_tab.cpp"
+#line 11443 "MachineIndependent/glslang_tab.cpp"
break;
- case 598: /* $@11: %empty */
-#line 3928 "MachineIndependent/glslang.y"
+ case 601: /* $@11: %empty */
+#line 3953 "MachineIndependent/glslang.y"
{
parseContext.symbolTable.push();
++parseContext.loopNestingLevel;
++parseContext.statementNestingLevel;
++parseContext.controlFlowNestingLevel;
}
-#line 11396 "MachineIndependent/glslang_tab.cpp"
+#line 11454 "MachineIndependent/glslang_tab.cpp"
break;
- case 599: /* iteration_statement_nonattributed: DO $@11 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON */
-#line 3934 "MachineIndependent/glslang.y"
+ case 602: /* iteration_statement_nonattributed: DO $@11 statement WHILE LEFT_PAREN expression RIGHT_PAREN SEMICOLON */
+#line 3959 "MachineIndependent/glslang.y"
{
if (! parseContext.limits.whileLoops)
parseContext.error((yyvsp[-7].lex).loc, "do-while loops not available", "limitation", "");
@@ -11409,22 +11467,22 @@ yyreduce:
--parseContext.statementNestingLevel;
--parseContext.controlFlowNestingLevel;
}
-#line 11413 "MachineIndependent/glslang_tab.cpp"
+#line 11471 "MachineIndependent/glslang_tab.cpp"
break;
- case 600: /* $@12: %empty */
-#line 3946 "MachineIndependent/glslang.y"
+ case 603: /* $@12: %empty */
+#line 3971 "MachineIndependent/glslang.y"
{
parseContext.symbolTable.push();
++parseContext.loopNestingLevel;
++parseContext.statementNestingLevel;
++parseContext.controlFlowNestingLevel;
}
-#line 11424 "MachineIndependent/glslang_tab.cpp"
+#line 11482 "MachineIndependent/glslang_tab.cpp"
break;
- case 601: /* iteration_statement_nonattributed: FOR LEFT_PAREN $@12 for_init_statement for_rest_statement RIGHT_PAREN statement_no_new_scope */
-#line 3952 "MachineIndependent/glslang.y"
+ 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"
{
parseContext.symbolTable.pop(&parseContext.defaultPrecision[0]);
(yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[-3].interm.intermNode), (yyvsp[-5].lex).loc);
@@ -11437,81 +11495,81 @@ yyreduce:
--parseContext.statementNestingLevel;
--parseContext.controlFlowNestingLevel;
}
-#line 11441 "MachineIndependent/glslang_tab.cpp"
+#line 11499 "MachineIndependent/glslang_tab.cpp"
break;
- case 602: /* for_init_statement: expression_statement */
-#line 3967 "MachineIndependent/glslang.y"
+ case 605: /* for_init_statement: expression_statement */
+#line 3992 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
-#line 11449 "MachineIndependent/glslang_tab.cpp"
+#line 11507 "MachineIndependent/glslang_tab.cpp"
break;
- case 603: /* for_init_statement: declaration_statement */
-#line 3970 "MachineIndependent/glslang.y"
+ case 606: /* for_init_statement: declaration_statement */
+#line 3995 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
-#line 11457 "MachineIndependent/glslang_tab.cpp"
+#line 11515 "MachineIndependent/glslang_tab.cpp"
break;
- case 604: /* conditionopt: condition */
-#line 3976 "MachineIndependent/glslang.y"
+ case 607: /* conditionopt: condition */
+#line 4001 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
-#line 11465 "MachineIndependent/glslang_tab.cpp"
+#line 11523 "MachineIndependent/glslang_tab.cpp"
break;
- case 605: /* conditionopt: %empty */
-#line 3979 "MachineIndependent/glslang.y"
+ case 608: /* conditionopt: %empty */
+#line 4004 "MachineIndependent/glslang.y"
{
(yyval.interm.intermTypedNode) = 0;
}
-#line 11473 "MachineIndependent/glslang_tab.cpp"
+#line 11531 "MachineIndependent/glslang_tab.cpp"
break;
- case 606: /* for_rest_statement: conditionopt SEMICOLON */
-#line 3985 "MachineIndependent/glslang.y"
+ 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 11482 "MachineIndependent/glslang_tab.cpp"
+#line 11540 "MachineIndependent/glslang_tab.cpp"
break;
- case 607: /* for_rest_statement: conditionopt SEMICOLON expression */
-#line 3989 "MachineIndependent/glslang.y"
+ 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 11491 "MachineIndependent/glslang_tab.cpp"
+#line 11549 "MachineIndependent/glslang_tab.cpp"
break;
- case 608: /* jump_statement: CONTINUE SEMICOLON */
-#line 3996 "MachineIndependent/glslang.y"
+ case 611: /* jump_statement: CONTINUE SEMICOLON */
+#line 4021 "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 11501 "MachineIndependent/glslang_tab.cpp"
+#line 11559 "MachineIndependent/glslang_tab.cpp"
break;
- case 609: /* jump_statement: BREAK SEMICOLON */
-#line 4001 "MachineIndependent/glslang.y"
+ case 612: /* jump_statement: BREAK SEMICOLON */
+#line 4026 "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 11511 "MachineIndependent/glslang_tab.cpp"
+#line 11569 "MachineIndependent/glslang_tab.cpp"
break;
- case 610: /* jump_statement: RETURN SEMICOLON */
-#line 4006 "MachineIndependent/glslang.y"
+ case 613: /* jump_statement: RETURN SEMICOLON */
+#line 4031 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpReturn, (yyvsp[-1].lex).loc);
if (parseContext.currentFunctionType->getBasicType() != EbtVoid)
@@ -11519,101 +11577,101 @@ yyreduce:
if (parseContext.inMain)
parseContext.postEntryPointReturn = true;
}
-#line 11523 "MachineIndependent/glslang_tab.cpp"
+#line 11581 "MachineIndependent/glslang_tab.cpp"
break;
- case 611: /* jump_statement: RETURN expression SEMICOLON */
-#line 4013 "MachineIndependent/glslang.y"
+ case 614: /* jump_statement: RETURN expression SEMICOLON */
+#line 4038 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.handleReturnValue((yyvsp[-2].lex).loc, (yyvsp[-1].interm.intermTypedNode));
}
-#line 11531 "MachineIndependent/glslang_tab.cpp"
+#line 11589 "MachineIndependent/glslang_tab.cpp"
break;
- case 612: /* jump_statement: DISCARD SEMICOLON */
-#line 4016 "MachineIndependent/glslang.y"
+ case 615: /* jump_statement: DISCARD SEMICOLON */
+#line 4041 "MachineIndependent/glslang.y"
{
parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "discard");
(yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpKill, (yyvsp[-1].lex).loc);
}
-#line 11540 "MachineIndependent/glslang_tab.cpp"
+#line 11598 "MachineIndependent/glslang_tab.cpp"
break;
- case 613: /* jump_statement: TERMINATE_INVOCATION SEMICOLON */
-#line 4020 "MachineIndependent/glslang.y"
+ case 616: /* jump_statement: TERMINATE_INVOCATION SEMICOLON */
+#line 4045 "MachineIndependent/glslang.y"
{
parseContext.requireStage((yyvsp[-1].lex).loc, EShLangFragment, "terminateInvocation");
(yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateInvocation, (yyvsp[-1].lex).loc);
}
-#line 11549 "MachineIndependent/glslang_tab.cpp"
+#line 11607 "MachineIndependent/glslang_tab.cpp"
break;
- case 614: /* jump_statement: TERMINATE_RAY SEMICOLON */
-#line 4025 "MachineIndependent/glslang.y"
+ case 617: /* jump_statement: TERMINATE_RAY SEMICOLON */
+#line 4050 "MachineIndependent/glslang.y"
{
parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "terminateRayEXT");
(yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpTerminateRayKHR, (yyvsp[-1].lex).loc);
}
-#line 11558 "MachineIndependent/glslang_tab.cpp"
+#line 11616 "MachineIndependent/glslang_tab.cpp"
break;
- case 615: /* jump_statement: IGNORE_INTERSECTION SEMICOLON */
-#line 4029 "MachineIndependent/glslang.y"
+ case 618: /* jump_statement: IGNORE_INTERSECTION SEMICOLON */
+#line 4054 "MachineIndependent/glslang.y"
{
parseContext.requireStage((yyvsp[-1].lex).loc, EShLangAnyHit, "ignoreIntersectionEXT");
(yyval.interm.intermNode) = parseContext.intermediate.addBranch(EOpIgnoreIntersectionKHR, (yyvsp[-1].lex).loc);
}
-#line 11567 "MachineIndependent/glslang_tab.cpp"
+#line 11625 "MachineIndependent/glslang_tab.cpp"
break;
- case 616: /* translation_unit: external_declaration */
-#line 4039 "MachineIndependent/glslang.y"
+ case 619: /* translation_unit: external_declaration */
+#line 4064 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
parseContext.intermediate.setTreeRoot((yyval.interm.intermNode));
}
-#line 11576 "MachineIndependent/glslang_tab.cpp"
+#line 11634 "MachineIndependent/glslang_tab.cpp"
break;
- case 617: /* translation_unit: translation_unit external_declaration */
-#line 4043 "MachineIndependent/glslang.y"
+ case 620: /* translation_unit: translation_unit external_declaration */
+#line 4068 "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 11587 "MachineIndependent/glslang_tab.cpp"
+#line 11645 "MachineIndependent/glslang_tab.cpp"
break;
- case 618: /* external_declaration: function_definition */
-#line 4052 "MachineIndependent/glslang.y"
+ case 621: /* external_declaration: function_definition */
+#line 4077 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
-#line 11595 "MachineIndependent/glslang_tab.cpp"
+#line 11653 "MachineIndependent/glslang_tab.cpp"
break;
- case 619: /* external_declaration: declaration */
-#line 4055 "MachineIndependent/glslang.y"
+ case 622: /* external_declaration: declaration */
+#line 4080 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
}
-#line 11603 "MachineIndependent/glslang_tab.cpp"
+#line 11661 "MachineIndependent/glslang_tab.cpp"
break;
- case 620: /* external_declaration: SEMICOLON */
-#line 4059 "MachineIndependent/glslang.y"
+ case 623: /* external_declaration: SEMICOLON */
+#line 4084 "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 11613 "MachineIndependent/glslang_tab.cpp"
+#line 11671 "MachineIndependent/glslang_tab.cpp"
break;
- case 621: /* $@13: %empty */
-#line 4068 "MachineIndependent/glslang.y"
+ case 624: /* $@13: %empty */
+#line 4093 "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);
@@ -11626,11 +11684,11 @@ yyreduce:
++parseContext.statementNestingLevel;
}
}
-#line 11630 "MachineIndependent/glslang_tab.cpp"
+#line 11688 "MachineIndependent/glslang_tab.cpp"
break;
- case 622: /* function_definition: function_prototype $@13 compound_statement_no_new_scope */
-#line 4080 "MachineIndependent/glslang.y"
+ case 625: /* function_definition: function_prototype $@13 compound_statement_no_new_scope */
+#line 4105 "MachineIndependent/glslang.y"
{
// May be best done as post process phase on intermediate code
if (parseContext.currentFunctionType->getBasicType() != EbtVoid && ! parseContext.functionReturnsValue)
@@ -11657,228 +11715,228 @@ yyreduce:
--parseContext.statementNestingLevel;
}
}
-#line 11661 "MachineIndependent/glslang_tab.cpp"
+#line 11719 "MachineIndependent/glslang_tab.cpp"
break;
- case 623: /* attribute: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET */
-#line 4110 "MachineIndependent/glslang.y"
+ case 626: /* attribute: LEFT_BRACKET LEFT_BRACKET attribute_list RIGHT_BRACKET RIGHT_BRACKET */
+#line 4135 "MachineIndependent/glslang.y"
{
(yyval.interm.attributes) = (yyvsp[-2].interm.attributes);
}
-#line 11669 "MachineIndependent/glslang_tab.cpp"
+#line 11727 "MachineIndependent/glslang_tab.cpp"
break;
- case 624: /* attribute_list: single_attribute */
-#line 4115 "MachineIndependent/glslang.y"
+ case 627: /* attribute_list: single_attribute */
+#line 4140 "MachineIndependent/glslang.y"
{
(yyval.interm.attributes) = (yyvsp[0].interm.attributes);
}
-#line 11677 "MachineIndependent/glslang_tab.cpp"
+#line 11735 "MachineIndependent/glslang_tab.cpp"
break;
- case 625: /* attribute_list: attribute_list COMMA single_attribute */
-#line 4118 "MachineIndependent/glslang.y"
+ case 628: /* attribute_list: attribute_list COMMA single_attribute */
+#line 4143 "MachineIndependent/glslang.y"
{
(yyval.interm.attributes) = parseContext.mergeAttributes((yyvsp[-2].interm.attributes), (yyvsp[0].interm.attributes));
}
-#line 11685 "MachineIndependent/glslang_tab.cpp"
+#line 11743 "MachineIndependent/glslang_tab.cpp"
break;
- case 626: /* single_attribute: IDENTIFIER */
-#line 4123 "MachineIndependent/glslang.y"
+ case 629: /* single_attribute: IDENTIFIER */
+#line 4148 "MachineIndependent/glslang.y"
{
(yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[0].lex).string);
}
-#line 11693 "MachineIndependent/glslang_tab.cpp"
+#line 11751 "MachineIndependent/glslang_tab.cpp"
break;
- case 627: /* single_attribute: IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN */
-#line 4126 "MachineIndependent/glslang.y"
+ case 630: /* single_attribute: IDENTIFIER LEFT_PAREN constant_expression RIGHT_PAREN */
+#line 4151 "MachineIndependent/glslang.y"
{
(yyval.interm.attributes) = parseContext.makeAttributes(*(yyvsp[-3].lex).string, (yyvsp[-1].interm.intermTypedNode));
}
-#line 11701 "MachineIndependent/glslang_tab.cpp"
+#line 11759 "MachineIndependent/glslang_tab.cpp"
break;
- case 628: /* spirv_requirements_list: spirv_requirements_parameter */
-#line 4133 "MachineIndependent/glslang.y"
+ case 631: /* spirv_requirements_list: spirv_requirements_parameter */
+#line 4158 "MachineIndependent/glslang.y"
{
(yyval.interm.spirvReq) = (yyvsp[0].interm.spirvReq);
}
-#line 11709 "MachineIndependent/glslang_tab.cpp"
+#line 11767 "MachineIndependent/glslang_tab.cpp"
break;
- case 629: /* spirv_requirements_list: spirv_requirements_list COMMA spirv_requirements_parameter */
-#line 4136 "MachineIndependent/glslang.y"
+ case 632: /* spirv_requirements_list: spirv_requirements_list COMMA spirv_requirements_parameter */
+#line 4161 "MachineIndependent/glslang.y"
{
(yyval.interm.spirvReq) = parseContext.mergeSpirvRequirements((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvReq), (yyvsp[0].interm.spirvReq));
}
-#line 11717 "MachineIndependent/glslang_tab.cpp"
+#line 11775 "MachineIndependent/glslang_tab.cpp"
break;
- case 630: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET */
-#line 4141 "MachineIndependent/glslang.y"
+ case 633: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_extension_list RIGHT_BRACKET */
+#line 4166 "MachineIndependent/glslang.y"
{
(yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, (yyvsp[-1].interm.intermNode)->getAsAggregate(), nullptr);
}
-#line 11725 "MachineIndependent/glslang_tab.cpp"
+#line 11783 "MachineIndependent/glslang_tab.cpp"
break;
- case 631: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET */
-#line 4144 "MachineIndependent/glslang.y"
+ case 634: /* spirv_requirements_parameter: IDENTIFIER EQUAL LEFT_BRACKET spirv_capability_list RIGHT_BRACKET */
+#line 4169 "MachineIndependent/glslang.y"
{
(yyval.interm.spirvReq) = parseContext.makeSpirvRequirement((yyvsp[-3].lex).loc, *(yyvsp[-4].lex).string, nullptr, (yyvsp[-1].interm.intermNode)->getAsAggregate());
}
-#line 11733 "MachineIndependent/glslang_tab.cpp"
+#line 11791 "MachineIndependent/glslang_tab.cpp"
break;
- case 632: /* spirv_extension_list: STRING_LITERAL */
-#line 4149 "MachineIndependent/glslang.y"
+ case 635: /* spirv_extension_list: STRING_LITERAL */
+#line 4174 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true));
}
-#line 11741 "MachineIndependent/glslang_tab.cpp"
+#line 11799 "MachineIndependent/glslang_tab.cpp"
break;
- case 633: /* spirv_extension_list: spirv_extension_list COMMA STRING_LITERAL */
-#line 4152 "MachineIndependent/glslang.y"
+ case 636: /* spirv_extension_list: spirv_extension_list COMMA STRING_LITERAL */
+#line 4177 "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 11749 "MachineIndependent/glslang_tab.cpp"
+#line 11807 "MachineIndependent/glslang_tab.cpp"
break;
- case 634: /* spirv_capability_list: INTCONSTANT */
-#line 4157 "MachineIndependent/glslang.y"
+ case 637: /* spirv_capability_list: INTCONSTANT */
+#line 4182 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true));
}
-#line 11757 "MachineIndependent/glslang_tab.cpp"
+#line 11815 "MachineIndependent/glslang_tab.cpp"
break;
- case 635: /* spirv_capability_list: spirv_capability_list COMMA INTCONSTANT */
-#line 4160 "MachineIndependent/glslang.y"
+ case 638: /* spirv_capability_list: spirv_capability_list COMMA INTCONSTANT */
+#line 4185 "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 11765 "MachineIndependent/glslang_tab.cpp"
+#line 11823 "MachineIndependent/glslang_tab.cpp"
break;
- case 636: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN */
-#line 4165 "MachineIndependent/glslang.y"
+ case 639: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT RIGHT_PAREN */
+#line 4190 "MachineIndependent/glslang.y"
{
parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i);
(yyval.interm.intermNode) = 0;
}
-#line 11774 "MachineIndependent/glslang_tab.cpp"
+#line 11832 "MachineIndependent/glslang_tab.cpp"
break;
- case 637: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */
-#line 4169 "MachineIndependent/glslang.y"
+ case 640: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */
+#line 4194 "MachineIndependent/glslang.y"
{
parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq));
parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-1].lex).i);
(yyval.interm.intermNode) = 0;
}
-#line 11784 "MachineIndependent/glslang_tab.cpp"
+#line 11842 "MachineIndependent/glslang_tab.cpp"
break;
- case 638: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */
-#line 4174 "MachineIndependent/glslang.y"
+ 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"
{
parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate());
(yyval.interm.intermNode) = 0;
}
-#line 11793 "MachineIndependent/glslang_tab.cpp"
+#line 11851 "MachineIndependent/glslang_tab.cpp"
break;
- case 639: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_execution_mode_parameter_list RIGHT_PAREN */
-#line 4178 "MachineIndependent/glslang.y"
+ 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"
{
parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq));
parseContext.intermediate.insertSpirvExecutionMode((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate());
(yyval.interm.intermNode) = 0;
}
-#line 11803 "MachineIndependent/glslang_tab.cpp"
+#line 11861 "MachineIndependent/glslang_tab.cpp"
break;
- case 640: /* spirv_execution_mode_qualifier: SPIRV_EXECUTION_MODE_ID LEFT_PAREN INTCONSTANT COMMA spirv_execution_mode_id_parameter_list RIGHT_PAREN */
-#line 4183 "MachineIndependent/glslang.y"
+ 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"
{
parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate());
(yyval.interm.intermNode) = 0;
}
-#line 11812 "MachineIndependent/glslang_tab.cpp"
+#line 11870 "MachineIndependent/glslang_tab.cpp"
break;
- case 641: /* 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 4187 "MachineIndependent/glslang.y"
+ 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"
{
parseContext.intermediate.insertSpirvRequirement((yyvsp[-5].interm.spirvReq));
parseContext.intermediate.insertSpirvExecutionModeId((yyvsp[-3].lex).i, (yyvsp[-1].interm.intermNode)->getAsAggregate());
(yyval.interm.intermNode) = 0;
}
-#line 11822 "MachineIndependent/glslang_tab.cpp"
+#line 11880 "MachineIndependent/glslang_tab.cpp"
break;
- case 642: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter */
-#line 4194 "MachineIndependent/glslang.y"
+ case 645: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter */
+#line 4219 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode));
}
-#line 11830 "MachineIndependent/glslang_tab.cpp"
+#line 11888 "MachineIndependent/glslang_tab.cpp"
break;
- case 643: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter */
-#line 4197 "MachineIndependent/glslang.y"
+ case 646: /* spirv_execution_mode_parameter_list: spirv_execution_mode_parameter_list COMMA spirv_execution_mode_parameter */
+#line 4222 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode));
}
-#line 11838 "MachineIndependent/glslang_tab.cpp"
+#line 11896 "MachineIndependent/glslang_tab.cpp"
break;
- case 644: /* spirv_execution_mode_parameter: FLOATCONSTANT */
-#line 4202 "MachineIndependent/glslang.y"
+ case 647: /* spirv_execution_mode_parameter: FLOATCONSTANT */
+#line 4227 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true);
}
-#line 11846 "MachineIndependent/glslang_tab.cpp"
+#line 11904 "MachineIndependent/glslang_tab.cpp"
break;
- case 645: /* spirv_execution_mode_parameter: INTCONSTANT */
-#line 4205 "MachineIndependent/glslang.y"
+ case 648: /* spirv_execution_mode_parameter: INTCONSTANT */
+#line 4230 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true);
}
-#line 11854 "MachineIndependent/glslang_tab.cpp"
+#line 11912 "MachineIndependent/glslang_tab.cpp"
break;
- case 646: /* spirv_execution_mode_parameter: UINTCONSTANT */
-#line 4208 "MachineIndependent/glslang.y"
+ case 649: /* spirv_execution_mode_parameter: UINTCONSTANT */
+#line 4233 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true);
}
-#line 11862 "MachineIndependent/glslang_tab.cpp"
+#line 11920 "MachineIndependent/glslang_tab.cpp"
break;
- case 647: /* spirv_execution_mode_parameter: BOOLCONSTANT */
-#line 4211 "MachineIndependent/glslang.y"
+ case 650: /* spirv_execution_mode_parameter: BOOLCONSTANT */
+#line 4236 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true);
}
-#line 11870 "MachineIndependent/glslang_tab.cpp"
+#line 11928 "MachineIndependent/glslang_tab.cpp"
break;
- case 648: /* spirv_execution_mode_parameter: STRING_LITERAL */
-#line 4214 "MachineIndependent/glslang.y"
+ case 651: /* spirv_execution_mode_parameter: STRING_LITERAL */
+#line 4239 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true);
}
-#line 11878 "MachineIndependent/glslang_tab.cpp"
+#line 11936 "MachineIndependent/glslang_tab.cpp"
break;
- case 649: /* spirv_execution_mode_id_parameter_list: constant_expression */
-#line 4219 "MachineIndependent/glslang.y"
+ case 652: /* spirv_execution_mode_id_parameter_list: constant_expression */
+#line 4244 "MachineIndependent/glslang.y"
{
if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat &&
(yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt &&
@@ -11888,11 +11946,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 11892 "MachineIndependent/glslang_tab.cpp"
+#line 11950 "MachineIndependent/glslang_tab.cpp"
break;
- case 650: /* spirv_execution_mode_id_parameter_list: spirv_execution_mode_id_parameter_list COMMA constant_expression */
-#line 4228 "MachineIndependent/glslang.y"
+ case 653: /* spirv_execution_mode_id_parameter_list: spirv_execution_mode_id_parameter_list COMMA constant_expression */
+#line 4253 "MachineIndependent/glslang.y"
{
if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat &&
(yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt &&
@@ -11902,156 +11960,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 11906 "MachineIndependent/glslang_tab.cpp"
+#line 11964 "MachineIndependent/glslang_tab.cpp"
break;
- case 651: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN */
-#line 4239 "MachineIndependent/glslang.y"
+ case 654: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN INTCONSTANT RIGHT_PAREN */
+#line 4264 "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 11916 "MachineIndependent/glslang_tab.cpp"
+#line 11974 "MachineIndependent/glslang_tab.cpp"
break;
- case 652: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */
-#line 4244 "MachineIndependent/glslang.y"
+ case 655: /* spirv_storage_class_qualifier: SPIRV_STORAGE_CLASS LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */
+#line 4269 "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 11927 "MachineIndependent/glslang_tab.cpp"
+#line 11985 "MachineIndependent/glslang_tab.cpp"
break;
- case 653: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN */
-#line 4252 "MachineIndependent/glslang.y"
+ case 656: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT RIGHT_PAREN */
+#line 4277 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[-3].lex).loc);
(yyval.interm.type).qualifier.setSpirvDecorate((yyvsp[-1].lex).i);
}
-#line 11936 "MachineIndependent/glslang_tab.cpp"
+#line 11994 "MachineIndependent/glslang_tab.cpp"
break;
- case 654: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */
-#line 4256 "MachineIndependent/glslang.y"
+ case 657: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT RIGHT_PAREN */
+#line 4281 "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 11946 "MachineIndependent/glslang_tab.cpp"
+#line 12004 "MachineIndependent/glslang_tab.cpp"
break;
- case 655: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */
-#line 4261 "MachineIndependent/glslang.y"
+ case 658: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */
+#line 4286 "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 11955 "MachineIndependent/glslang_tab.cpp"
+#line 12013 "MachineIndependent/glslang_tab.cpp"
break;
- case 656: /* spirv_decorate_qualifier: SPIRV_DECORATE LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_parameter_list RIGHT_PAREN */
-#line 4265 "MachineIndependent/glslang.y"
+ 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"
{
(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 11965 "MachineIndependent/glslang_tab.cpp"
+#line 12023 "MachineIndependent/glslang_tab.cpp"
break;
- case 657: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */
-#line 4270 "MachineIndependent/glslang.y"
+ case 660: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */
+#line 4295 "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 11974 "MachineIndependent/glslang_tab.cpp"
+#line 12032 "MachineIndependent/glslang_tab.cpp"
break;
- case 658: /* spirv_decorate_qualifier: SPIRV_DECORATE_ID LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_id_parameter_list RIGHT_PAREN */
-#line 4274 "MachineIndependent/glslang.y"
+ 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"
{
(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 11984 "MachineIndependent/glslang_tab.cpp"
+#line 12042 "MachineIndependent/glslang_tab.cpp"
break;
- case 659: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */
-#line 4279 "MachineIndependent/glslang.y"
+ case 662: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */
+#line 4304 "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 11993 "MachineIndependent/glslang_tab.cpp"
+#line 12051 "MachineIndependent/glslang_tab.cpp"
break;
- case 660: /* spirv_decorate_qualifier: SPIRV_DECORATE_STRING LEFT_PAREN spirv_requirements_list COMMA INTCONSTANT COMMA spirv_decorate_string_parameter_list RIGHT_PAREN */
-#line 4283 "MachineIndependent/glslang.y"
+ 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"
{
(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 12003 "MachineIndependent/glslang_tab.cpp"
+#line 12061 "MachineIndependent/glslang_tab.cpp"
break;
- case 661: /* spirv_decorate_parameter_list: spirv_decorate_parameter */
-#line 4290 "MachineIndependent/glslang.y"
+ case 664: /* spirv_decorate_parameter_list: spirv_decorate_parameter */
+#line 4315 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.makeAggregate((yyvsp[0].interm.intermNode));
}
-#line 12011 "MachineIndependent/glslang_tab.cpp"
+#line 12069 "MachineIndependent/glslang_tab.cpp"
break;
- case 662: /* spirv_decorate_parameter_list: spirv_decorate_parameter_list COMMA spirv_decorate_parameter */
-#line 4293 "MachineIndependent/glslang.y"
+ case 665: /* spirv_decorate_parameter_list: spirv_decorate_parameter_list COMMA spirv_decorate_parameter */
+#line 4318 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.growAggregate((yyvsp[-2].interm.intermNode), (yyvsp[0].interm.intermNode));
}
-#line 12019 "MachineIndependent/glslang_tab.cpp"
+#line 12077 "MachineIndependent/glslang_tab.cpp"
break;
- case 663: /* spirv_decorate_parameter: FLOATCONSTANT */
-#line 4298 "MachineIndependent/glslang.y"
+ case 666: /* spirv_decorate_parameter: FLOATCONSTANT */
+#line 4323 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).d, EbtFloat, (yyvsp[0].lex).loc, true);
}
-#line 12027 "MachineIndependent/glslang_tab.cpp"
+#line 12085 "MachineIndependent/glslang_tab.cpp"
break;
- case 664: /* spirv_decorate_parameter: INTCONSTANT */
-#line 4301 "MachineIndependent/glslang.y"
+ case 667: /* spirv_decorate_parameter: INTCONSTANT */
+#line 4326 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).i, (yyvsp[0].lex).loc, true);
}
-#line 12035 "MachineIndependent/glslang_tab.cpp"
+#line 12093 "MachineIndependent/glslang_tab.cpp"
break;
- case 665: /* spirv_decorate_parameter: UINTCONSTANT */
-#line 4304 "MachineIndependent/glslang.y"
+ case 668: /* spirv_decorate_parameter: UINTCONSTANT */
+#line 4329 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).u, (yyvsp[0].lex).loc, true);
}
-#line 12043 "MachineIndependent/glslang_tab.cpp"
+#line 12101 "MachineIndependent/glslang_tab.cpp"
break;
- case 666: /* spirv_decorate_parameter: BOOLCONSTANT */
-#line 4307 "MachineIndependent/glslang.y"
+ case 669: /* spirv_decorate_parameter: BOOLCONSTANT */
+#line 4332 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.addConstantUnion((yyvsp[0].lex).b, (yyvsp[0].lex).loc, true);
}
-#line 12051 "MachineIndependent/glslang_tab.cpp"
+#line 12109 "MachineIndependent/glslang_tab.cpp"
break;
- case 667: /* spirv_decorate_id_parameter_list: constant_expression */
-#line 4312 "MachineIndependent/glslang.y"
+ case 670: /* spirv_decorate_id_parameter_list: constant_expression */
+#line 4337 "MachineIndependent/glslang.y"
{
if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat &&
(yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt &&
@@ -12060,11 +12118,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 12064 "MachineIndependent/glslang_tab.cpp"
+#line 12122 "MachineIndependent/glslang_tab.cpp"
break;
- case 668: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA constant_expression */
-#line 4320 "MachineIndependent/glslang.y"
+ case 671: /* spirv_decorate_id_parameter_list: spirv_decorate_id_parameter_list COMMA constant_expression */
+#line 4345 "MachineIndependent/glslang.y"
{
if ((yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtFloat &&
(yyvsp[0].interm.intermTypedNode)->getBasicType() != EbtInt &&
@@ -12073,147 +12131,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 12077 "MachineIndependent/glslang_tab.cpp"
+#line 12135 "MachineIndependent/glslang_tab.cpp"
break;
- case 669: /* spirv_decorate_string_parameter_list: STRING_LITERAL */
-#line 4330 "MachineIndependent/glslang.y"
+ case 672: /* spirv_decorate_string_parameter_list: STRING_LITERAL */
+#line 4355 "MachineIndependent/glslang.y"
{
(yyval.interm.intermNode) = parseContext.intermediate.makeAggregate(
parseContext.intermediate.addConstantUnion((yyvsp[0].lex).string, (yyvsp[0].lex).loc, true));
}
-#line 12086 "MachineIndependent/glslang_tab.cpp"
+#line 12144 "MachineIndependent/glslang_tab.cpp"
break;
- case 670: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */
-#line 4334 "MachineIndependent/glslang.y"
+ case 673: /* spirv_decorate_string_parameter_list: spirv_decorate_string_parameter_list COMMA STRING_LITERAL */
+#line 4359 "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 12094 "MachineIndependent/glslang_tab.cpp"
+#line 12152 "MachineIndependent/glslang_tab.cpp"
break;
- case 671: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */
-#line 4339 "MachineIndependent/glslang.y"
+ 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"
{
(yyval.interm.type).init((yyvsp[-5].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).setSpirvType(*(yyvsp[-3].interm.spirvInst), (yyvsp[-1].interm.spirvTypeParams));
}
-#line 12103 "MachineIndependent/glslang_tab.cpp"
+#line 12161 "MachineIndependent/glslang_tab.cpp"
break;
- case 672: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list COMMA spirv_type_parameter_list RIGHT_PAREN */
-#line 4343 "MachineIndependent/glslang.y"
+ 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"
{
(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 12113 "MachineIndependent/glslang_tab.cpp"
+#line 12171 "MachineIndependent/glslang_tab.cpp"
break;
- case 673: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */
-#line 4348 "MachineIndependent/glslang.y"
+ case 676: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */
+#line 4373 "MachineIndependent/glslang.y"
{
(yyval.interm.type).init((yyvsp[-3].lex).loc, parseContext.symbolTable.atGlobalLevel());
(yyval.interm.type).setSpirvType(*(yyvsp[-1].interm.spirvInst));
}
-#line 12122 "MachineIndependent/glslang_tab.cpp"
+#line 12180 "MachineIndependent/glslang_tab.cpp"
break;
- case 674: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */
-#line 4352 "MachineIndependent/glslang.y"
+ case 677: /* spirv_type_specifier: SPIRV_TYPE LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */
+#line 4377 "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 12132 "MachineIndependent/glslang_tab.cpp"
+#line 12190 "MachineIndependent/glslang_tab.cpp"
break;
- case 675: /* spirv_type_parameter_list: spirv_type_parameter */
-#line 4359 "MachineIndependent/glslang.y"
+ case 678: /* spirv_type_parameter_list: spirv_type_parameter */
+#line 4384 "MachineIndependent/glslang.y"
{
(yyval.interm.spirvTypeParams) = (yyvsp[0].interm.spirvTypeParams);
}
-#line 12140 "MachineIndependent/glslang_tab.cpp"
+#line 12198 "MachineIndependent/glslang_tab.cpp"
break;
- case 676: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */
-#line 4362 "MachineIndependent/glslang.y"
+ case 679: /* spirv_type_parameter_list: spirv_type_parameter_list COMMA spirv_type_parameter */
+#line 4387 "MachineIndependent/glslang.y"
{
(yyval.interm.spirvTypeParams) = parseContext.mergeSpirvTypeParameters((yyvsp[-2].interm.spirvTypeParams), (yyvsp[0].interm.spirvTypeParams));
}
-#line 12148 "MachineIndependent/glslang_tab.cpp"
+#line 12206 "MachineIndependent/glslang_tab.cpp"
break;
- case 677: /* spirv_type_parameter: constant_expression */
-#line 4367 "MachineIndependent/glslang.y"
+ case 680: /* spirv_type_parameter: constant_expression */
+#line 4392 "MachineIndependent/glslang.y"
{
(yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.intermTypedNode)->getLoc(), (yyvsp[0].interm.intermTypedNode)->getAsConstantUnion());
}
-#line 12156 "MachineIndependent/glslang_tab.cpp"
- break;
-
- case 678: /* spirv_type_parameter: type_specifier */
-#line 4370 "MachineIndependent/glslang.y"
- {
- (yyval.interm.spirvTypeParams) = parseContext.makeSpirvTypeParameters((yyvsp[0].interm.type));
- }
-#line 12164 "MachineIndependent/glslang_tab.cpp"
+#line 12214 "MachineIndependent/glslang_tab.cpp"
break;
- case 679: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */
-#line 4375 "MachineIndependent/glslang.y"
+ case 681: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_instruction_qualifier_list RIGHT_PAREN */
+#line 4397 "MachineIndependent/glslang.y"
{
(yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst);
}
-#line 12172 "MachineIndependent/glslang_tab.cpp"
+#line 12222 "MachineIndependent/glslang_tab.cpp"
break;
- case 680: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */
-#line 4378 "MachineIndependent/glslang.y"
+ case 682: /* spirv_instruction_qualifier: SPIRV_INSTRUCTION LEFT_PAREN spirv_requirements_list COMMA spirv_instruction_qualifier_list RIGHT_PAREN */
+#line 4400 "MachineIndependent/glslang.y"
{
parseContext.intermediate.insertSpirvRequirement((yyvsp[-3].interm.spirvReq));
(yyval.interm.spirvInst) = (yyvsp[-1].interm.spirvInst);
}
-#line 12181 "MachineIndependent/glslang_tab.cpp"
+#line 12231 "MachineIndependent/glslang_tab.cpp"
break;
- case 681: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */
-#line 4384 "MachineIndependent/glslang.y"
+ case 683: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_id */
+#line 4406 "MachineIndependent/glslang.y"
{
(yyval.interm.spirvInst) = (yyvsp[0].interm.spirvInst);
}
-#line 12189 "MachineIndependent/glslang_tab.cpp"
+#line 12239 "MachineIndependent/glslang_tab.cpp"
break;
- case 682: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */
-#line 4387 "MachineIndependent/glslang.y"
+ case 684: /* spirv_instruction_qualifier_list: spirv_instruction_qualifier_list COMMA spirv_instruction_qualifier_id */
+#line 4409 "MachineIndependent/glslang.y"
{
(yyval.interm.spirvInst) = parseContext.mergeSpirvInstruction((yyvsp[-1].lex).loc, (yyvsp[-2].interm.spirvInst), (yyvsp[0].interm.spirvInst));
}
-#line 12197 "MachineIndependent/glslang_tab.cpp"
+#line 12247 "MachineIndependent/glslang_tab.cpp"
break;
- case 683: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */
-#line 4392 "MachineIndependent/glslang.y"
+ case 685: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL STRING_LITERAL */
+#line 4414 "MachineIndependent/glslang.y"
{
(yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, *(yyvsp[0].lex).string);
}
-#line 12205 "MachineIndependent/glslang_tab.cpp"
+#line 12255 "MachineIndependent/glslang_tab.cpp"
break;
- case 684: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */
-#line 4395 "MachineIndependent/glslang.y"
+ case 686: /* spirv_instruction_qualifier_id: IDENTIFIER EQUAL INTCONSTANT */
+#line 4417 "MachineIndependent/glslang.y"
{
(yyval.interm.spirvInst) = parseContext.makeSpirvInstruction((yyvsp[-1].lex).loc, *(yyvsp[-2].lex).string, (yyvsp[0].lex).i);
}
-#line 12213 "MachineIndependent/glslang_tab.cpp"
+#line 12263 "MachineIndependent/glslang_tab.cpp"
break;
-#line 12217 "MachineIndependent/glslang_tab.cpp"
+#line 12267 "MachineIndependent/glslang_tab.cpp"
default: break;
}
@@ -12438,5 +12488,5 @@ yyreturn:
return yyresult;
}
-#line 4400 "MachineIndependent/glslang.y"
+#line 4422 "MachineIndependent/glslang.y"
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
index 596a10e6d98..18cef4688ef 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/glslang_tab.cpp.h
@@ -501,11 +501,14 @@ extern int yydebug;
SHADERCALLCOHERENT = 702, /* SHADERCALLCOHERENT */
NOPERSPECTIVE = 703, /* NOPERSPECTIVE */
EXPLICITINTERPAMD = 704, /* EXPLICITINTERPAMD */
- PERVERTEXNV = 705, /* PERVERTEXNV */
- PERPRIMITIVENV = 706, /* PERPRIMITIVENV */
- PERVIEWNV = 707, /* PERVIEWNV */
- PERTASKNV = 708, /* PERTASKNV */
- PRECISE = 709 /* PRECISE */
+ PERVERTEXEXT = 705, /* PERVERTEXEXT */
+ PERVERTEXNV = 706, /* PERVERTEXNV */
+ PERPRIMITIVENV = 707, /* PERPRIMITIVENV */
+ PERVIEWNV = 708, /* PERVIEWNV */
+ PERTASKNV = 709, /* PERTASKNV */
+ PERPRIMITIVEEXT = 710, /* PERPRIMITIVEEXT */
+ TASKPAYLOADWORKGROUPEXT = 711, /* TASKPAYLOADWORKGROUPEXT */
+ PRECISE = 712 /* PRECISE */
};
typedef enum yytokentype yytoken_kind_t;
#endif
@@ -553,7 +556,7 @@ union YYSTYPE
glslang::TArraySizes* typeParameters;
} interm;
-#line 557 "MachineIndependent/glslang_tab.cpp.h"
+#line 560 "MachineIndependent/glslang_tab.cpp.h"
};
typedef union YYSTYPE YYSTYPE;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp
index a0fade16c03..a79a6928bc7 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/intermOut.cpp
@@ -36,7 +36,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
#include "localintermediate.h"
#include "../Include/InfoSink.h"
@@ -48,37 +48,6 @@
#endif
#include <cstdint>
-namespace {
-
-bool IsInfinity(double x) {
-#ifdef _MSC_VER
- switch (_fpclass(x)) {
- case _FPCLASS_NINF:
- case _FPCLASS_PINF:
- return true;
- default:
- return false;
- }
-#else
- return std::isinf(x);
-#endif
-}
-
-bool IsNan(double x) {
-#ifdef _MSC_VER
- switch (_fpclass(x)) {
- case _FPCLASS_SNAN:
- case _FPCLASS_QNAN:
- return true;
- default:
- return false;
- }
-#else
- return std::isnan(x);
-#endif
-}
-
-}
namespace glslang {
@@ -696,6 +665,8 @@ bool TOutputTraverser::visitUnary(TVisit /* visit */, TIntermUnary* node)
case EOpConstructReference: out.debug << "Construct reference type"; break;
+ case EOpDeclare: out.debug << "Declare"; break;
+
#ifndef GLSLANG_WEB
case EOpSpirvInst: out.debug << "spirv_instruction"; break;
#endif
@@ -723,6 +694,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
switch (node->getOp()) {
case EOpSequence: out.debug << "Sequence\n"; return true;
+ case EOpScope: out.debug << "Scope\n"; return true;
case EOpLinkerObjects: out.debug << "Linker Objects\n"; return true;
case EOpComma: out.debug << "Comma"; break;
case EOpFunction: out.debug << "Function Definition: " << node->getName(); break;
@@ -1099,6 +1071,8 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
case EOpExecuteCallableNV: out.debug << "executeCallableNV"; break;
case EOpExecuteCallableKHR: out.debug << "executeCallableKHR"; break;
case EOpWritePackedPrimitiveIndices4x8NV: out.debug << "writePackedPrimitiveIndices4x8NV"; break;
+ case EOpEmitMeshTasksEXT: out.debug << "EmitMeshTasksEXT"; break;
+ case EOpSetMeshOutputsEXT: out.debug << "SetMeshOutputsEXT"; break;
case EOpRayQueryInitialize: out.debug << "rayQueryInitializeEXT"; break;
case EOpRayQueryTerminate: out.debug << "rayQueryTerminateEXT"; break;
@@ -1138,7 +1112,7 @@ bool TOutputTraverser::visitAggregate(TVisit /* visit */, TIntermAggregate* node
default: out.debug.message(EPrefixError, "Bad aggregation op");
}
- if (node->getOp() != EOpSequence && node->getOp() != EOpParameters)
+ if (node->getOp() != EOpSequence && node->getOp() != EOpScope && node->getOp() != EOpParameters)
out.debug << " (" << node->getCompleteString() << ")";
out.debug << "\n";
@@ -1553,12 +1527,12 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
infoSink.debug << "interlock ordering = " << TQualifier::getInterlockOrderingString(interlockOrdering) << "\n";
break;
- case EShLangMeshNV:
+ case EShLangMesh:
infoSink.debug << "max_vertices = " << vertices << "\n";
infoSink.debug << "max_primitives = " << primitives << "\n";
infoSink.debug << "output primitive = " << TQualifier::getGeometryString(outputPrimitive) << "\n";
// Fall through
- case EShLangTaskNV:
+ case EShLangTask:
// Fall through
case EShLangCompute:
infoSink.debug << "local_size = (" << localSize[0] << ", " << localSize[1] << ", " << localSize[2] << ")\n";
@@ -1589,4 +1563,4 @@ void TIntermediate::output(TInfoSink& infoSink, bool tree)
} // end namespace glslang
-#endif // !GLSLANG_WEB && !GLSLANG_ANGLE
+#endif // !GLSLANG_WEB
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp
index 3486ea6d05b..0ae281d965a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.cpp
@@ -33,7 +33,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
#include "../Include/Common.h"
#include "../Include/InfoSink.h"
@@ -79,7 +79,7 @@ public:
target = &inputList;
else if (base->getQualifier().storage == EvqVaryingOut)
target = &outputList;
- else if (base->getQualifier().isUniformOrBuffer() && !base->getQualifier().isPushConstant())
+ else if (base->getQualifier().isUniformOrBuffer() && !base->getQualifier().isPushConstant() && !base->getQualifier().isShaderRecord())
target = &uniformList;
// If a global is being visited, then we should also traverse it incase it's evaluation
// ends up visiting inputs we want to tag as live
@@ -203,11 +203,7 @@ struct TResolverUniformAdaptor {
inline void operator()(std::pair<const TString, TVarEntryInfo>& entKey) {
TVarEntryInfo& ent = entKey.second;
- ent.newLocation = -1;
- ent.newComponent = -1;
- ent.newBinding = -1;
- ent.newSet = -1;
- ent.newIndex = -1;
+ ent.clearNewAssignments();
const bool isValid = resolver.validateBinding(stage, ent);
if (isValid) {
resolver.resolveSet(ent.stage, ent);
@@ -281,11 +277,7 @@ struct TResolverInOutAdaptor {
inline void operator()(std::pair<const TString, TVarEntryInfo>& entKey)
{
TVarEntryInfo& ent = entKey.second;
- ent.newLocation = -1;
- ent.newComponent = -1;
- ent.newBinding = -1;
- ent.newSet = -1;
- ent.newIndex = -1;
+ ent.clearNewAssignments();
const bool isValid = resolver.validateInOut(ent.stage, ent);
if (isValid) {
resolver.resolveInOutLocation(stage, ent);
@@ -514,6 +506,24 @@ struct TSymbolValidater
return;
}
else {
+ // Deal with input/output pairs where one is a block member but the other is loose,
+ // e.g. with ARB_separate_shader_objects
+ if (type1.getBasicType() == EbtBlock &&
+ type1.isStruct() && !type2.isStruct()) {
+ // Iterate through block members tracking layout
+ glslang::TString name;
+ type1.getStruct()->begin()->type->appendMangledName(name);
+ if (name == mangleName2
+ && type1.getQualifier().layoutLocation == type2.getQualifier().layoutLocation) return;
+ }
+ if (type2.getBasicType() == EbtBlock &&
+ type2.isStruct() && !type1.isStruct()) {
+ // Iterate through block members tracking layout
+ glslang::TString name;
+ type2.getStruct()->begin()->type->appendMangledName(name);
+ if (name == mangleName1
+ && type1.getQualifier().layoutLocation == type2.getQualifier().layoutLocation) return;
+ }
TString err = "Invalid In/Out variable type : " + entKey.first;
infoSink.info.message(EPrefixInternalError, err.c_str());
hadError = true;
@@ -748,7 +758,7 @@ private:
};
TDefaultIoResolverBase::TDefaultIoResolverBase(const TIntermediate& intermediate)
- : intermediate(intermediate)
+ : referenceIntermediate(intermediate)
, nextUniformLocation(intermediate.getUniformLocationBase())
, nextInputLocation(0)
, nextOutputLocation(0)
@@ -760,17 +770,17 @@ TDefaultIoResolverBase::TDefaultIoResolverBase(const TIntermediate& intermediate
int TDefaultIoResolverBase::getBaseBinding(EShLanguage stage, TResourceType res, unsigned int set) const {
return stageIntermediates[stage] ? selectBaseBinding(stageIntermediates[stage]->getShiftBinding(res), stageIntermediates[stage]->getShiftBindingForSet(res, set))
- : selectBaseBinding(intermediate.getShiftBinding(res), intermediate.getShiftBindingForSet(res, set));
+ : selectBaseBinding(referenceIntermediate.getShiftBinding(res), referenceIntermediate.getShiftBindingForSet(res, set));
}
const std::vector<std::string>& TDefaultIoResolverBase::getResourceSetBinding(EShLanguage stage) const {
return stageIntermediates[stage] ? stageIntermediates[stage]->getResourceSetBinding()
- : intermediate.getResourceSetBinding();
+ : referenceIntermediate.getResourceSetBinding();
}
-bool TDefaultIoResolverBase::doAutoBindingMapping() const { return intermediate.getAutoMapBindings(); }
+bool TDefaultIoResolverBase::doAutoBindingMapping() const { return referenceIntermediate.getAutoMapBindings(); }
-bool TDefaultIoResolverBase::doAutoLocationMapping() const { return intermediate.getAutoMapLocations(); }
+bool TDefaultIoResolverBase::doAutoLocationMapping() const { return referenceIntermediate.getAutoMapLocations(); }
TDefaultIoResolverBase::TSlotSet::iterator TDefaultIoResolverBase::findSlot(int set, int slot) {
return std::lower_bound(slots[set].begin(), slots[set].end(), slot);
@@ -827,7 +837,7 @@ int TDefaultIoResolverBase::resolveUniformLocation(EShLanguage /*stage*/, TVarEn
}
// no locations added if already present, a built-in variable, a block, or an opaque
if (type.getQualifier().hasLocation() || type.isBuiltIn() || type.getBasicType() == EbtBlock ||
- type.isAtomic() || (type.containsOpaque() && intermediate.getSpv().openGl == 0)) {
+ type.isAtomic() || type.isSpirvType() || (type.containsOpaque() && referenceIntermediate.getSpv().openGl == 0)) {
return ent.newLocation = -1;
}
// no locations on blocks of built-in variables
@@ -839,7 +849,7 @@ int TDefaultIoResolverBase::resolveUniformLocation(EShLanguage /*stage*/, TVarEn
return ent.newLocation = -1;
}
}
- int location = intermediate.getUniformLocationOverride(name);
+ int location = referenceIntermediate.getUniformLocationOverride(name);
if (location != -1) {
return ent.newLocation = location;
}
@@ -855,8 +865,8 @@ int TDefaultIoResolverBase::resolveInOutLocation(EShLanguage stage, TVarEntryInf
return ent.newLocation = -1;
}
- // no locations added if already present, or a built-in variable
- if (type.getQualifier().hasLocation() || type.isBuiltIn()) {
+ // no locations added if already present, a built-in variable, or a variable with SPIR-V decorate
+ if (type.getQualifier().hasLocation() || type.isBuiltIn() || type.getQualifier().hasSprivDecorate()) {
return ent.newLocation = -1;
}
@@ -942,8 +952,8 @@ int TDefaultGlslIoResolver::resolveInOutLocation(EShLanguage stage, TVarEntryInf
if (type.getQualifier().hasLocation()) {
return ent.newLocation = type.getQualifier().layoutLocation;
}
- // no locations added if already present, or a built-in variable
- if (type.isBuiltIn()) {
+ // no locations added if already present, a built-in variable, or a variable with SPIR-V decorate
+ if (type.isBuiltIn() || type.getQualifier().hasSprivDecorate()) {
return ent.newLocation = -1;
}
// no locations on blocks of built-in variables
@@ -1024,7 +1034,8 @@ int TDefaultGlslIoResolver::resolveUniformLocation(EShLanguage /*stage*/, TVarEn
} else {
// no locations added if already present, a built-in variable, a block, or an opaque
if (type.getQualifier().hasLocation() || type.isBuiltIn() || type.getBasicType() == EbtBlock ||
- type.isAtomic() || (type.containsOpaque() && intermediate.getSpv().openGl == 0)) {
+ type.isAtomic() || type.isSpirvType() ||
+ (type.containsOpaque() && referenceIntermediate.getSpv().openGl == 0)) {
return ent.newLocation = -1;
}
// no locations on blocks of built-in variables
@@ -1037,7 +1048,7 @@ int TDefaultGlslIoResolver::resolveUniformLocation(EShLanguage /*stage*/, TVarEn
}
}
}
- int location = intermediate.getUniformLocationOverride(name.c_str());
+ int location = referenceIntermediate.getUniformLocationOverride(name.c_str());
if (location != -1) {
return ent.newLocation = location;
}
@@ -1086,7 +1097,7 @@ int TDefaultGlslIoResolver::resolveBinding(EShLanguage stage, TVarEntryInfo& ent
const TType& type = ent.symbol->getType();
const TString& name = ent.symbol->getAccessName();
// On OpenGL arrays of opaque types take a separate binding for each element
- int numBindings = intermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1;
+ int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1;
TResourceType resource = getResourceType(type);
// don't need to handle uniform symbol, it will be handled in resolveUniformLocation
if (resource == EResUbo && type.getBasicType() != EbtBlock) {
@@ -1095,7 +1106,7 @@ int TDefaultGlslIoResolver::resolveBinding(EShLanguage stage, TVarEntryInfo& ent
// There is no 'set' qualifier in OpenGL shading language, each resource has its own
// binding name space, so remap the 'set' to resource type which make each resource
// binding is valid from 0 to MAX_XXRESOURCE_BINDINGS
- int set = intermediate.getSpv().openGl != 0 ? resource : ent.newSet;
+ int set = referenceIntermediate.getSpv().openGl != 0 ? resource : ent.newSet;
int resourceKey = set;
if (resource < EResCount) {
if (type.getQualifier().hasBinding()) {
@@ -1223,7 +1234,7 @@ void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink&
const TType& type = ent.symbol->getType();
const TString& name = ent.symbol->getAccessName();
TResourceType resource = getResourceType(type);
- int set = intermediate.getSpv().openGl != 0 ? resource : resolveSet(ent.stage, ent);
+ int set = referenceIntermediate.getSpv().openGl != 0 ? resource : resolveSet(ent.stage, ent);
int resourceKey = set;
if (type.getQualifier().hasBinding()) {
@@ -1233,7 +1244,7 @@ void TDefaultGlslIoResolver::reserverResourceSlot(TVarEntryInfo& ent, TInfoSink&
if (iter == varSlotMap.end()) {
// Reserve the slots for the ubo, ssbo and opaques who has explicit binding
- int numBindings = intermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1;
+ int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1;
varSlotMap[name] = binding;
reserveSlot(resourceKey, binding, numBindings);
} else {
@@ -1288,7 +1299,7 @@ struct TDefaultIoResolver : public TDefaultIoResolverBase {
const TType& type = ent.symbol->getType();
const int set = getLayoutSet(type);
// On OpenGL arrays of opaque types take a seperate binding for each element
- int numBindings = intermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1;
+ int numBindings = referenceIntermediate.getSpv().openGl != 0 && type.isSizedArray() ? type.getCumulativeArraySize() : 1;
TResourceType resource = getResourceType(type);
if (resource < EResCount) {
if (type.getQualifier().hasBinding()) {
@@ -1651,6 +1662,10 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) {
if (size <= int(autoPushConstantMaxSize)) {
qualifier.setBlockStorage(EbsPushConstant);
qualifier.layoutPacking = autoPushConstantBlockPacking;
+ // Push constants don't have set/binding etc. decorations, remove those.
+ qualifier.layoutSet = TQualifier::layoutSetEnd;
+ at->second.clearNewAssignments();
+
upgraded = true;
}
}
@@ -1658,10 +1673,14 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) {
// If it's been upgraded to push_constant, then remove it from the uniformVector
// so it doesn't get a set/binding assigned to it.
if (upgraded) {
- auto at = std::find_if(uniformVector.begin(), uniformVector.end(),
- [this](const TVarLivePair& p) { return p.first == autoPushConstantBlockName; });
- if (at != uniformVector.end())
- uniformVector.erase(at);
+ while (1) {
+ auto at = std::find_if(uniformVector.begin(), uniformVector.end(),
+ [this](const TVarLivePair& p) { return p.first == autoPushConstantBlockName; });
+ if (at != uniformVector.end())
+ uniformVector.erase(at);
+ else
+ break;
+ }
}
}
for (size_t stage = 0; stage < EShLangCount; stage++) {
@@ -1691,4 +1710,4 @@ bool TGlslIoMapper::doMap(TIoMapResolver* resolver, TInfoSink& infoSink) {
} // end namespace glslang
-#endif // !GLSLANG_WEB && !GLSLANG_ANGLE
+#endif // !GLSLANG_WEB
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h
index 843ea73c011..0003a74e099 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/iomapper.h
@@ -33,7 +33,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
#ifndef _IOMAPPER_INCLUDED
#define _IOMAPPER_INCLUDED
@@ -61,6 +61,15 @@ struct TVarEntryInfo {
int newComponent;
int newIndex;
EShLanguage stage;
+
+ void clearNewAssignments() {
+ newBinding = -1;
+ newSet = -1;
+ newLocation = -1;
+ newComponent = -1;
+ newIndex = -1;
+ }
+
struct TOrderById {
inline bool operator()(const TVarEntryInfo& l, const TVarEntryInfo& r) { return l.id < r.id; }
};
@@ -165,7 +174,7 @@ public:
protected:
TDefaultIoResolverBase(TDefaultIoResolverBase&);
TDefaultIoResolverBase& operator=(TDefaultIoResolverBase&);
- const TIntermediate& intermediate;
+ const TIntermediate& referenceIntermediate;
int nextUniformLocation;
int nextInputLocation;
int nextOutputLocation;
@@ -322,8 +331,8 @@ public:
intermediates[stage] = nullptr;
}
}
- // If set, the uniform block with the given name will be changed to be backed by
- // push_constant if it's size is <= maxSize
+ // If set, the uniform block with the given name will be changed to be backed by
+ // push_constant if it's size is <= maxSize
void setAutoPushConstantBlock(const char* name, unsigned int maxSize, TLayoutPacking packing) {
autoPushConstantBlockName = name;
autoPushConstantMaxSize = maxSize;
@@ -349,4 +358,4 @@ private:
#endif // _IOMAPPER_INCLUDED
-#endif // !GLSLANG_WEB && !GLSLANG_ANGLE
+#endif // !GLSLANG_WEB
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp
index 4edd2a9052c..fab65a76ef2 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/linkValidate.cpp
@@ -55,22 +55,28 @@ namespace glslang {
//
// Link-time error emitter.
//
-void TIntermediate::error(TInfoSink& infoSink, const char* message)
+void TIntermediate::error(TInfoSink& infoSink, const char* message, EShLanguage unitStage)
{
#ifndef GLSLANG_WEB
infoSink.info.prefix(EPrefixError);
- infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n";
+ if (unitStage < EShLangCount)
+ infoSink.info << "Linking " << StageName(getStage()) << " and " << StageName(unitStage) << " stages: " << message << "\n";
+ else
+ infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n";
#endif
++numErrors;
}
// Link-time warning.
-void TIntermediate::warn(TInfoSink& infoSink, const char* message)
+void TIntermediate::warn(TInfoSink& infoSink, const char* message, EShLanguage unitStage)
{
#ifndef GLSLANG_WEB
infoSink.info.prefix(EPrefixWarning);
- infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n";
+ if (unitStage < EShLangCount)
+ infoSink.info << "Linking " << StageName(language) << " and " << StageName(unitStage) << " stages: " << message << "\n";
+ else
+ infoSink.info << "Linking " << StageName(language) << " stage: " << message << "\n";
#endif
}
@@ -83,7 +89,7 @@ void TIntermediate::warn(TInfoSink& infoSink, const char* message)
//
void TIntermediate::merge(TInfoSink& infoSink, TIntermediate& unit)
{
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
mergeCallGraphs(infoSink, unit);
mergeModes(infoSink, unit);
mergeTrees(infoSink, unit);
@@ -114,7 +120,7 @@ void TIntermediate::mergeUniformObjects(TInfoSink& infoSink, TIntermediate& unit
}
//
-// do error checking on the shader boundary in / out vars
+// do error checking on the shader boundary in / out vars
//
void TIntermediate::checkStageIO(TInfoSink& infoSink, TIntermediate& unit) {
if (unit.treeRoot == nullptr || treeRoot == nullptr)
@@ -155,7 +161,7 @@ void TIntermediate::mergeCallGraphs(TInfoSink& infoSink, TIntermediate& unit)
callGraph.insert(callGraph.end(), unit.callGraph.begin(), unit.callGraph.end());
}
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
#define MERGE_MAX(member) member = std::max(member, unit.member)
#define MERGE_TRUE(member) if (unit.member) member = unit.member;
@@ -206,7 +212,7 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
if (vertices == TQualifier::layoutNotSet)
vertices = unit.vertices;
else if (unit.vertices != TQualifier::layoutNotSet && vertices != unit.vertices) {
- if (language == EShLangGeometry || language == EShLangMeshNV)
+ if (language == EShLangGeometry || language == EShLangMesh)
error(infoSink, "Contradictory layout max_vertices values");
else if (language == EShLangTessControl)
error(infoSink, "Contradictory layout vertices values");
@@ -216,7 +222,7 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
if (primitives == TQualifier::layoutNotSet)
primitives = unit.primitives;
else if (primitives != unit.primitives) {
- if (language == EShLangMeshNV)
+ if (language == EShLangMesh)
error(infoSink, "Contradictory layout max_primitives values");
else
assert(0);
@@ -312,6 +318,8 @@ void TIntermediate::mergeModes(TInfoSink& infoSink, TIntermediate& unit)
MERGE_TRUE(autoMapBindings);
MERGE_TRUE(autoMapLocations);
MERGE_TRUE(invertY);
+ MERGE_TRUE(dxPositionW);
+ MERGE_TRUE(debugInfo);
MERGE_TRUE(flattenUniformArrays);
MERGE_TRUE(useUnknownFormat);
MERGE_TRUE(hlslOffsets);
@@ -579,9 +587,6 @@ void TIntermediate::mergeGlobalUniformBlocks(TInfoSink& infoSink, TIntermediate&
}
void TIntermediate::mergeBlockDefinitions(TInfoSink& infoSink, TIntermSymbol* block, TIntermSymbol* unitBlock, TIntermediate* unit) {
- if (block->getType() == unitBlock->getType()) {
- return;
- }
if (block->getType().getTypeName() != unitBlock->getType().getTypeName() ||
block->getType().getBasicType() != unitBlock->getType().getBasicType() ||
@@ -628,44 +633,42 @@ void TIntermediate::mergeBlockDefinitions(TInfoSink& infoSink, TIntermSymbol* bl
}
}
- TType unitType;
- unitType.shallowCopy(unitBlock->getType());
-
// update symbol node in unit tree,
// and other nodes that may reference it
class TMergeBlockTraverser : public TIntermTraverser {
public:
- TMergeBlockTraverser(const glslang::TType &type, const glslang::TType& unitType,
- glslang::TIntermediate& unit,
- const std::map<unsigned int, unsigned int>& memberIdxUpdates) :
- newType(type), unitType(unitType), unit(unit), memberIndexUpdates(memberIdxUpdates)
- { }
- virtual ~TMergeBlockTraverser() { }
-
- const glslang::TType& newType; // type with modifications
- const glslang::TType& unitType; // copy of original type
- glslang::TIntermediate& unit; // intermediate that is being updated
- const std::map<unsigned int, unsigned int>& memberIndexUpdates;
-
- virtual void visitSymbol(TIntermSymbol* symbol)
+ TMergeBlockTraverser(const TIntermSymbol* newSym)
+ : newSymbol(newSym), newType(nullptr), unit(nullptr), memberIndexUpdates(nullptr)
{
- glslang::TType& symType = symbol->getWritableType();
+ }
+ TMergeBlockTraverser(const TIntermSymbol* newSym, const glslang::TType* unitType, glslang::TIntermediate* unit,
+ const std::map<unsigned int, unsigned int>* memberIdxUpdates)
+ : TIntermTraverser(false, true), newSymbol(newSym), newType(unitType), unit(unit), memberIndexUpdates(memberIdxUpdates)
+ {
+ }
+ virtual ~TMergeBlockTraverser() {}
- if (symType == unitType) {
- // each symbol node has a local copy of the unitType
- // if merging involves changing properties that aren't shared objects
- // they should be updated in all instances
+ const TIntermSymbol* newSymbol;
+ const glslang::TType* newType; // shallow copy of the new type
+ glslang::TIntermediate* unit; // intermediate that is being updated
+ const std::map<unsigned int, unsigned int>* memberIndexUpdates;
- // e.g. the struct list is a ptr to an object, so it can be updated
- // once, outside the traverser
- //*symType.getWritableStruct() = *newType.getStruct();
+ virtual void visitSymbol(TIntermSymbol* symbol)
+ {
+ if (newSymbol->getAccessName() == symbol->getAccessName() &&
+ newSymbol->getQualifier().getBlockStorage() == symbol->getQualifier().getBlockStorage()) {
+ // Each symbol node may have a local copy of the block structure.
+ // Update those structures to match the new one post-merge
+ *(symbol->getWritableType().getWritableStruct()) = *(newSymbol->getType().getStruct());
}
-
}
virtual bool visitBinary(TVisit, glslang::TIntermBinary* node)
{
- if (node->getOp() == EOpIndexDirectStruct && node->getLeft()->getType() == unitType) {
+ if (!unit || !newType || !memberIndexUpdates || memberIndexUpdates->empty())
+ return true;
+
+ if (node->getOp() == EOpIndexDirectStruct && node->getLeft()->getType() == *newType) {
// this is a dereference to a member of the block since the
// member list changed, need to update this to point to the
// right index
@@ -673,8 +676,8 @@ void TIntermediate::mergeBlockDefinitions(TInfoSink& infoSink, TIntermSymbol* bl
glslang::TIntermConstantUnion* constNode = node->getRight()->getAsConstantUnion();
unsigned int memberIdx = constNode->getConstArray()[0].getUConst();
- unsigned int newIdx = memberIndexUpdates.at(memberIdx);
- TIntermTyped* newConstNode = unit.addConstantUnion(newIdx, node->getRight()->getLoc());
+ unsigned int newIdx = memberIndexUpdates->at(memberIdx);
+ TIntermTyped* newConstNode = unit->addConstantUnion(newIdx, node->getRight()->getLoc());
node->setRight(newConstNode);
delete constNode;
@@ -683,10 +686,20 @@ void TIntermediate::mergeBlockDefinitions(TInfoSink& infoSink, TIntermSymbol* bl
}
return true;
}
- } finalLinkTraverser(block->getType(), unitType, *unit, memberIndexUpdates);
+ };
- // update the tree to use the new type
- unit->getTreeRoot()->traverse(&finalLinkTraverser);
+ // 'this' may have symbols that are using the old block structure, so traverse the tree to update those
+ // in 'visitSymbol'
+ TMergeBlockTraverser finalLinkTraverser(block);
+ getTreeRoot()->traverse(&finalLinkTraverser);
+
+ // The 'unit' intermediate needs the block structures update, but also structure entry indices
+ // may have changed from the old block to the new one that it was merged into, so update those
+ // in 'visitBinary'
+ TType newType;
+ newType.shallowCopy(block->getType());
+ TMergeBlockTraverser unitFinalLinkTraverser(block, &newType, unit, &memberIndexUpdates);
+ unit->getTreeRoot()->traverse(&unitFinalLinkTraverser);
// update the member list
(*unitMemberList) = (*memberList);
@@ -759,7 +772,10 @@ void TIntermediate::mergeLinkerObjects(TInfoSink& infoSink, TIntermSequence& lin
auto checkName = [this, unitSymbol, &infoSink](const TString& name) {
for (unsigned int i = 0; i < unitSymbol->getType().getStruct()->size(); ++i) {
- if (name == (*unitSymbol->getType().getStruct())[i].type->getFieldName()) {
+ if (name == (*unitSymbol->getType().getStruct())[i].type->getFieldName()
+ && !((*unitSymbol->getType().getStruct())[i].type->getQualifier().hasLocation()
+ || unitSymbol->getType().getQualifier().hasLocation())
+ ) {
error(infoSink, "Anonymous member name used for global variable or other anonymous member: ");
infoSink.info << (*unitSymbol->getType().getStruct())[i].type->getCompleteString() << "\n";
}
@@ -812,9 +828,13 @@ void TIntermediate::mergeImplicitArraySizes(TType& type, const TType& unitType)
//
void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& symbol, const TIntermSymbol& unitSymbol, EShLanguage unitStage)
{
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
bool crossStage = getStage() != unitStage;
bool writeTypeComparison = false;
+ bool errorReported = false;
+ bool printQualifiers = false;
+ bool printPrecision = false;
+ bool printType = false;
// Types have to match
{
@@ -846,11 +866,48 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
(symbol.getType().isUnsizedArray() || unitSymbol.getType().isUnsizedArray()));
}
- if (!symbol.getType().sameElementType(unitSymbol.getType()) ||
- !symbol.getType().sameTypeParameters(unitSymbol.getType()) ||
- !arraysMatch ) {
+ int lpidx = -1;
+ int rpidx = -1;
+ if (!symbol.getType().sameElementType(unitSymbol.getType(), &lpidx, &rpidx)) {
+ if (lpidx >= 0 && rpidx >= 0) {
+ error(infoSink, "Member names and types must match:", unitStage);
+ infoSink.info << " Block: " << symbol.getType().getTypeName() << "\n";
+ infoSink.info << " " << StageName(getStage()) << " stage: \""
+ << (*symbol.getType().getStruct())[lpidx].type->getCompleteString(true, false, false, true,
+ (*symbol.getType().getStruct())[lpidx].type->getFieldName()) << "\"\n";
+ infoSink.info << " " << StageName(unitStage) << " stage: \""
+ << (*unitSymbol.getType().getStruct())[rpidx].type->getCompleteString(true, false, false, true,
+ (*unitSymbol.getType().getStruct())[rpidx].type->getFieldName()) << "\"\n";
+ errorReported = true;
+ } else if (lpidx >= 0 && rpidx == -1) {
+ TString errmsg = StageName(getStage());
+ errmsg.append(" block member has no corresponding member in ").append(StageName(unitStage)).append(" block:");
+ error(infoSink, errmsg.c_str(), unitStage);
+ infoSink.info << " " << StageName(getStage()) << " stage: Block: " << symbol.getType().getTypeName() << ", Member: "
+ << (*symbol.getType().getStruct())[lpidx].type->getFieldName() << "\n";
+ infoSink.info << " " << StageName(unitStage) << " stage: Block: " << unitSymbol.getType().getTypeName() << ", Member: n/a \n";
+ errorReported = true;
+ } else if (lpidx == -1 && rpidx >= 0) {
+ TString errmsg = StageName(unitStage);
+ errmsg.append(" block member has no corresponding member in ").append(StageName(getStage())).append(" block:");
+ error(infoSink, errmsg.c_str(), unitStage);
+ infoSink.info << " " << StageName(unitStage) << " stage: Block: " << unitSymbol.getType().getTypeName() << ", Member: "
+ << (*unitSymbol.getType().getStruct())[rpidx].type->getFieldName() << "\n";
+ infoSink.info << " " << StageName(getStage()) << " stage: Block: " << symbol.getType().getTypeName() << ", Member: n/a \n";
+ errorReported = true;
+ } else {
+ error(infoSink, "Types must match:", unitStage);
+ writeTypeComparison = true;
+ printType = true;
+ }
+ } else if (!arraysMatch) {
+ error(infoSink, "Array sizes must be compatible:", unitStage);
+ writeTypeComparison = true;
+ printType = true;
+ } else if (!symbol.getType().sameTypeParameters(unitSymbol.getType())) {
+ error(infoSink, "Type parameters must match:", unitStage);
writeTypeComparison = true;
- error(infoSink, "Types must match:");
+ printType = true;
}
}
@@ -858,17 +915,51 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
if (symbol.getType().getBasicType() == EbtBlock && unitSymbol.getType().getBasicType() == EbtBlock &&
symbol.getType().getStruct() && unitSymbol.getType().getStruct() &&
symbol.getType().sameStructType(unitSymbol.getType())) {
- for (unsigned int i = 0; i < symbol.getType().getStruct()->size(); ++i) {
- const TQualifier& qualifier = (*symbol.getType().getStruct())[i].type->getQualifier();
- const TQualifier& unitQualifier = (*unitSymbol.getType().getStruct())[i].type->getQualifier();
- if (qualifier.layoutMatrix != unitQualifier.layoutMatrix ||
- qualifier.layoutOffset != unitQualifier.layoutOffset ||
- qualifier.layoutAlign != unitQualifier.layoutAlign ||
- qualifier.layoutLocation != unitQualifier.layoutLocation ||
- qualifier.layoutComponent != unitQualifier.layoutComponent) {
- error(infoSink, "Interface block member layout qualifiers must match:");
- writeTypeComparison = true;
+ unsigned int li = 0;
+ unsigned int ri = 0;
+ while (li < symbol.getType().getStruct()->size() && ri < unitSymbol.getType().getStruct()->size()) {
+ if ((*symbol.getType().getStruct())[li].type->hiddenMember()) {
+ ++li;
+ continue;
+ }
+ if ((*unitSymbol.getType().getStruct())[ri].type->hiddenMember()) {
+ ++ri;
+ continue;
+ }
+ const TQualifier& qualifier = (*symbol.getType().getStruct())[li].type->getQualifier();
+ const TQualifier & unitQualifier = (*unitSymbol.getType().getStruct())[ri].type->getQualifier();
+ bool layoutQualifierError = false;
+ if (qualifier.layoutMatrix != unitQualifier.layoutMatrix) {
+ error(infoSink, "Interface block member layout matrix qualifier must match:", unitStage);
+ layoutQualifierError = true;
+ }
+ if (qualifier.layoutOffset != unitQualifier.layoutOffset) {
+ error(infoSink, "Interface block member layout offset qualifier must match:", unitStage);
+ layoutQualifierError = true;
+ }
+ if (qualifier.layoutAlign != unitQualifier.layoutAlign) {
+ error(infoSink, "Interface block member layout align qualifier must match:", unitStage);
+ layoutQualifierError = true;
+ }
+ if (qualifier.layoutLocation != unitQualifier.layoutLocation) {
+ error(infoSink, "Interface block member layout location qualifier must match:", unitStage);
+ layoutQualifierError = true;
+ }
+ if (qualifier.layoutComponent != unitQualifier.layoutComponent) {
+ error(infoSink, "Interface block member layout component qualifier must match:", unitStage);
+ layoutQualifierError = true;
}
+ if (layoutQualifierError) {
+ infoSink.info << " " << StageName(getStage()) << " stage: Block: " << symbol.getType().getTypeName() << ", Member: "
+ << (*symbol.getType().getStruct())[li].type->getFieldName() << " \""
+ << (*symbol.getType().getStruct())[li].type->getCompleteString(true, true, false, false) << "\"\n";
+ infoSink.info << " " << StageName(unitStage) << " stage: Block: " << unitSymbol.getType().getTypeName() << ", Member: "
+ << (*unitSymbol.getType().getStruct())[ri].type->getFieldName() << " \""
+ << (*unitSymbol.getType().getStruct())[ri].type->getCompleteString(true, true, false, false) << "\"\n";
+ errorReported = true;
+ }
+ ++li;
+ ++ri;
}
}
@@ -879,8 +970,9 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
// Qualifiers have to (almost) match
// Storage...
if (!isInOut && symbol.getQualifier().storage != unitSymbol.getQualifier().storage) {
- error(infoSink, "Storage qualifiers must match:");
+ error(infoSink, "Storage qualifiers must match:", unitStage);
writeTypeComparison = true;
+ printQualifiers = true;
}
// Uniform and buffer blocks must either both have an instance name, or
@@ -888,37 +980,40 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
if (symbol.getQualifier().isUniformOrBuffer() &&
(IsAnonymous(symbol.getName()) != IsAnonymous(unitSymbol.getName()))) {
error(infoSink, "Matched Uniform or Storage blocks must all be anonymous,"
- " or all be named:");
+ " or all be named:", unitStage);
writeTypeComparison = true;
}
if (symbol.getQualifier().storage == unitSymbol.getQualifier().storage &&
(IsAnonymous(symbol.getName()) != IsAnonymous(unitSymbol.getName()) ||
(!IsAnonymous(symbol.getName()) && symbol.getName() != unitSymbol.getName()))) {
- warn(infoSink, "Matched shader interfaces are using different instance names.");
+ warn(infoSink, "Matched shader interfaces are using different instance names.", unitStage);
writeTypeComparison = true;
}
// Precision...
if (!isInOut && symbol.getQualifier().precision != unitSymbol.getQualifier().precision) {
- error(infoSink, "Precision qualifiers must match:");
+ error(infoSink, "Precision qualifiers must match:", unitStage);
writeTypeComparison = true;
+ printPrecision = true;
}
// Invariance...
if (! crossStage && symbol.getQualifier().invariant != unitSymbol.getQualifier().invariant) {
- error(infoSink, "Presence of invariant qualifier must match:");
+ error(infoSink, "Presence of invariant qualifier must match:", unitStage);
writeTypeComparison = true;
+ printQualifiers = true;
}
// Precise...
if (! crossStage && symbol.getQualifier().isNoContraction() != unitSymbol.getQualifier().isNoContraction()) {
- error(infoSink, "Presence of precise qualifier must match:");
+ error(infoSink, "Presence of precise qualifier must match:", unitStage);
writeTypeComparison = true;
+ printPrecision = true;
}
// Auxiliary and interpolation...
- // "interpolation qualification (e.g., flat) and auxiliary qualification (e.g. centroid) may differ.
+ // "interpolation qualification (e.g., flat) and auxiliary qualification (e.g. centroid) may differ.
// These mismatches are allowed between any pair of stages ...
// those provided in the fragment shader supersede those provided in previous stages."
if (!crossStage &&
@@ -928,57 +1023,137 @@ void TIntermediate::mergeErrorCheck(TInfoSink& infoSink, const TIntermSymbol& sy
symbol.getQualifier().isSample()!= unitSymbol.getQualifier().isSample() ||
symbol.getQualifier().isPatch() != unitSymbol.getQualifier().isPatch() ||
symbol.getQualifier().isNonPerspective() != unitSymbol.getQualifier().isNonPerspective())) {
- error(infoSink, "Interpolation and auxiliary storage qualifiers must match:");
+ error(infoSink, "Interpolation and auxiliary storage qualifiers must match:", unitStage);
writeTypeComparison = true;
+ printQualifiers = true;
}
// Memory...
- if (symbol.getQualifier().coherent != unitSymbol.getQualifier().coherent ||
- symbol.getQualifier().devicecoherent != unitSymbol.getQualifier().devicecoherent ||
- symbol.getQualifier().queuefamilycoherent != unitSymbol.getQualifier().queuefamilycoherent ||
- symbol.getQualifier().workgroupcoherent != unitSymbol.getQualifier().workgroupcoherent ||
- symbol.getQualifier().subgroupcoherent != unitSymbol.getQualifier().subgroupcoherent ||
- symbol.getQualifier().shadercallcoherent!= unitSymbol.getQualifier().shadercallcoherent ||
- symbol.getQualifier().nonprivate != unitSymbol.getQualifier().nonprivate ||
- symbol.getQualifier().volatil != unitSymbol.getQualifier().volatil ||
- symbol.getQualifier().restrict != unitSymbol.getQualifier().restrict ||
- symbol.getQualifier().readonly != unitSymbol.getQualifier().readonly ||
- symbol.getQualifier().writeonly != unitSymbol.getQualifier().writeonly) {
- error(infoSink, "Memory qualifiers must match:");
- writeTypeComparison = true;
+ bool memoryQualifierError = false;
+ if (symbol.getQualifier().coherent != unitSymbol.getQualifier().coherent) {
+ error(infoSink, "Memory coherent qualifier must match:", unitStage);
+ memoryQualifierError = true;
+ }
+ if (symbol.getQualifier().devicecoherent != unitSymbol.getQualifier().devicecoherent) {
+ error(infoSink, "Memory devicecoherent qualifier must match:", unitStage);
+ memoryQualifierError = true;
+ }
+ if (symbol.getQualifier().queuefamilycoherent != unitSymbol.getQualifier().queuefamilycoherent) {
+ error(infoSink, "Memory queuefamilycoherent qualifier must match:", unitStage);
+ memoryQualifierError = true;
+ }
+ if (symbol.getQualifier().workgroupcoherent != unitSymbol.getQualifier().workgroupcoherent) {
+ error(infoSink, "Memory workgroupcoherent qualifier must match:", unitStage);
+ memoryQualifierError = true;
+ }
+ if (symbol.getQualifier().subgroupcoherent != unitSymbol.getQualifier().subgroupcoherent) {
+ error(infoSink, "Memory subgroupcoherent qualifier must match:", unitStage);
+ memoryQualifierError = true;
+ }
+ if (symbol.getQualifier().shadercallcoherent != unitSymbol.getQualifier().shadercallcoherent) {
+ error(infoSink, "Memory shadercallcoherent qualifier must match:", unitStage);
+ memoryQualifierError = true;
+ }
+ if (symbol.getQualifier().nonprivate != unitSymbol.getQualifier().nonprivate) {
+ error(infoSink, "Memory nonprivate qualifier must match:", unitStage);
+ memoryQualifierError = true;
+ }
+ if (symbol.getQualifier().volatil != unitSymbol.getQualifier().volatil) {
+ error(infoSink, "Memory volatil qualifier must match:", unitStage);
+ memoryQualifierError = true;
+ }
+ if (symbol.getQualifier().restrict != unitSymbol.getQualifier().restrict) {
+ error(infoSink, "Memory restrict qualifier must match:", unitStage);
+ memoryQualifierError = true;
+ }
+ if (symbol.getQualifier().readonly != unitSymbol.getQualifier().readonly) {
+ error(infoSink, "Memory readonly qualifier must match:", unitStage);
+ memoryQualifierError = true;
+ }
+ if (symbol.getQualifier().writeonly != unitSymbol.getQualifier().writeonly) {
+ error(infoSink, "Memory writeonly qualifier must match:", unitStage);
+ memoryQualifierError = true;
+ }
+ if (memoryQualifierError) {
+ writeTypeComparison = true;
+ printQualifiers = true;
}
// Layouts...
// TODO: 4.4 enhanced layouts: Generalize to include offset/align: current spec
// requires separate user-supplied offset from actual computed offset, but
// current implementation only has one offset.
- if (symbol.getQualifier().layoutMatrix != unitSymbol.getQualifier().layoutMatrix ||
- symbol.getQualifier().layoutPacking != unitSymbol.getQualifier().layoutPacking ||
- symbol.getQualifier().layoutLocation != unitSymbol.getQualifier().layoutLocation ||
- symbol.getQualifier().layoutComponent != unitSymbol.getQualifier().layoutComponent ||
- symbol.getQualifier().layoutIndex != unitSymbol.getQualifier().layoutIndex ||
- symbol.getQualifier().layoutBinding != unitSymbol.getQualifier().layoutBinding ||
- (symbol.getQualifier().hasBinding() && (symbol.getQualifier().layoutOffset != unitSymbol.getQualifier().layoutOffset))) {
- error(infoSink, "Layout qualification must match:");
+ bool layoutQualifierError = false;
+ if (symbol.getQualifier().layoutMatrix != unitSymbol.getQualifier().layoutMatrix) {
+ error(infoSink, "Layout matrix qualifier must match:", unitStage);
+ layoutQualifierError = true;
+ }
+ if (symbol.getQualifier().layoutPacking != unitSymbol.getQualifier().layoutPacking) {
+ error(infoSink, "Layout packing qualifier must match:", unitStage);
+ layoutQualifierError = true;
+ }
+ if (symbol.getQualifier().hasLocation() && unitSymbol.getQualifier().hasLocation() && symbol.getQualifier().layoutLocation != unitSymbol.getQualifier().layoutLocation) {
+ error(infoSink, "Layout location qualifier must match:", unitStage);
+ layoutQualifierError = true;
+ }
+ if (symbol.getQualifier().layoutComponent != unitSymbol.getQualifier().layoutComponent) {
+ error(infoSink, "Layout component qualifier must match:", unitStage);
+ layoutQualifierError = true;
+ }
+ if (symbol.getQualifier().layoutIndex != unitSymbol.getQualifier().layoutIndex) {
+ error(infoSink, "Layout index qualifier must match:", unitStage);
+ layoutQualifierError = true;
+ }
+ if (symbol.getQualifier().hasBinding() && unitSymbol.getQualifier().hasBinding() && symbol.getQualifier().layoutBinding != unitSymbol.getQualifier().layoutBinding) {
+ error(infoSink, "Layout binding qualifier must match:", unitStage);
+ layoutQualifierError = true;
+ }
+ if (symbol.getQualifier().hasBinding() && (symbol.getQualifier().layoutOffset != unitSymbol.getQualifier().layoutOffset)) {
+ error(infoSink, "Layout offset qualifier must match:", unitStage);
+ layoutQualifierError = true;
+ }
+ if (layoutQualifierError) {
writeTypeComparison = true;
+ printQualifiers = true;
}
// Initializers have to match, if both are present, and if we don't already know the types don't match
- if (! writeTypeComparison) {
+ if (! writeTypeComparison && ! errorReported) {
if (! symbol.getConstArray().empty() && ! unitSymbol.getConstArray().empty()) {
if (symbol.getConstArray() != unitSymbol.getConstArray()) {
- error(infoSink, "Initializers must match:");
+ error(infoSink, "Initializers must match:", unitStage);
infoSink.info << " " << symbol.getName() << "\n";
}
}
}
if (writeTypeComparison) {
- infoSink.info << " " << symbol.getName() << ": \"" << symbol.getType().getCompleteString() << "\" versus ";
- if (symbol.getName() != unitSymbol.getName())
- infoSink.info << unitSymbol.getName() << ": ";
-
- infoSink.info << "\"" << unitSymbol.getType().getCompleteString() << "\"\n";
+ if (symbol.getType().getBasicType() == EbtBlock && unitSymbol.getType().getBasicType() == EbtBlock &&
+ symbol.getType().getStruct() && unitSymbol.getType().getStruct()) {
+ if (printType) {
+ infoSink.info << " " << StageName(getStage()) << " stage: \"" << symbol.getType().getCompleteString(true, printQualifiers, printPrecision,
+ printType, symbol.getName(), symbol.getType().getTypeName()) << "\"\n";
+ infoSink.info << " " << StageName(unitStage) << " stage: \"" << unitSymbol.getType().getCompleteString(true, printQualifiers, printPrecision,
+ printType, unitSymbol.getName(), unitSymbol.getType().getTypeName()) << "\"\n";
+ } else {
+ infoSink.info << " " << StageName(getStage()) << " stage: Block: " << symbol.getType().getTypeName() << " Instance: " << symbol.getName()
+ << ": \"" << symbol.getType().getCompleteString(true, printQualifiers, printPrecision, printType) << "\"\n";
+ infoSink.info << " " << StageName(unitStage) << " stage: Block: " << unitSymbol.getType().getTypeName() << " Instance: " << unitSymbol.getName()
+ << ": \"" << unitSymbol.getType().getCompleteString(true, printQualifiers, printPrecision, printType) << "\"\n";
+ }
+ } else {
+ if (printType) {
+ infoSink.info << " " << StageName(getStage()) << " stage: \""
+ << symbol.getType().getCompleteString(true, printQualifiers, printPrecision, printType, symbol.getName()) << "\"\n";
+ infoSink.info << " " << StageName(unitStage) << " stage: \""
+ << unitSymbol.getType().getCompleteString(true, printQualifiers, printPrecision, printType, unitSymbol.getName()) << "\"\n";
+ } else {
+ infoSink.info << " " << StageName(getStage()) << " stage: " << symbol.getName() << " \""
+ << symbol.getType().getCompleteString(true, printQualifiers, printPrecision, printType) << "\"\n";
+ infoSink.info << " " << StageName(unitStage) << " stage: " << unitSymbol.getName() << " \""
+ << unitSymbol.getType().getCompleteString(true, printQualifiers, printPrecision, printType) << "\"\n";
+ }
+ }
}
#endif
}
@@ -1120,8 +1295,8 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
error(infoSink, "At least one shader must specify a layout(max_vertices = value)");
break;
case EShLangFragment:
- // for GL_ARB_post_depth_coverage, EarlyFragmentTest is set automatically in
- // ParseHelper.cpp. So if we reach here, this must be GL_EXT_post_depth_coverage
+ // for GL_ARB_post_depth_coverage, EarlyFragmentTest is set automatically in
+ // ParseHelper.cpp. So if we reach here, this must be GL_EXT_post_depth_coverage
// requiring explicit early_fragment_tests
if (getPostDepthCoverage() && !getEarlyFragmentTests())
error(infoSink, "post_depth_coverage requires early_fragment_tests");
@@ -1138,7 +1313,7 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
if (numShaderRecordBlocks > 1)
error(infoSink, "Only one shaderRecordNV buffer block is allowed per stage");
break;
- case EShLangMeshNV:
+ case EShLangMesh:
// NV_mesh_shader doesn't allow use of both single-view and per-view builtins.
if (inIoAccessed("gl_Position") && inIoAccessed("gl_PositionPerViewNV"))
error(infoSink, "Can only use one of gl_Position or gl_PositionPerViewNV");
@@ -1157,9 +1332,11 @@ void TIntermediate::finalCheck(TInfoSink& infoSink, bool keepUncalled)
if (primitives == TQualifier::layoutNotSet)
error(infoSink, "At least one shader must specify a layout(max_primitives = value)");
// fall through
- case EShLangTaskNV:
+ case EShLangTask:
if (numTaskNVBlocks > 1)
error(infoSink, "Only one taskNV interface block is allowed per shader");
+ if (numTaskEXTPayloads > 1)
+ error(infoSink, "Only single variable of type taskPayloadSharedEXT is allowed per shader");
sharedBlockCheck(infoSink);
break;
default:
@@ -1786,7 +1963,7 @@ unsigned int TIntermediate::computeTypeXfbSize(const TType& type, bool& contains
return size;
}
- int numComponents;
+ int numComponents {0};
if (type.isScalar())
numComponents = 1;
else if (type.isVector())
@@ -2052,7 +2229,7 @@ int TIntermediate::getScalarAlignment(const TType& type, int& size, int& stride,
if (type.isVector()) {
int scalarAlign = getBaseAlignmentScalar(type, size);
-
+
size *= type.getVectorSize();
return scalarAlign;
}
@@ -2073,7 +2250,7 @@ int TIntermediate::getScalarAlignment(const TType& type, int& size, int& stride,
assert(0); // all cases should be covered above
size = 1;
- return 1;
+ return 1;
}
int TIntermediate::getMemberAlignment(const TType& type, int& size, int& stride, TLayoutPacking layoutPacking, bool rowMajor)
@@ -2163,8 +2340,8 @@ bool TIntermediate::isIoResizeArray(const TType& type, EShLanguage language) {
! type.getQualifier().patch) ||
(language == EShLangTessEvaluation && type.getQualifier().storage == EvqVaryingIn) ||
(language == EShLangFragment && type.getQualifier().storage == EvqVaryingIn &&
- type.getQualifier().pervertexNV) ||
- (language == EShLangMeshNV && type.getQualifier().storage == EvqVaryingOut &&
+ (type.getQualifier().pervertexNV || type.getQualifier().pervertexEXT)) ||
+ (language == EShLangMesh && type.getQualifier().storage == EvqVaryingOut &&
!type.getQualifier().perTaskNV));
}
#endif // not GLSLANG_WEB
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h
index 6aa9399dcc1..1bb4e977098 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/localintermediate.h
@@ -283,17 +283,19 @@ class TIntermediate {
public:
explicit TIntermediate(EShLanguage l, int v = 0, EProfile p = ENoProfile) :
language(l),
-#ifndef GLSLANG_ANGLE
profile(p), version(v),
-#endif
treeRoot(0),
resources(TBuiltInResource{}),
numEntryPoints(0), numErrors(0), numPushConstants(0), recursive(false),
invertY(false),
+ dxPositionW(false),
+ enhancedMsgs(false),
+ debugInfo(false),
useStorageBuffer(false),
invariantAll(false),
nanMinMaxClamp(false),
depthReplacing(false),
+ stencilReplacing(false),
uniqueId(0),
globalUniformBlockName(""),
atomicCounterBlockName(""),
@@ -307,9 +309,9 @@ public:
useVulkanMemoryModel(false),
invocations(TQualifier::layoutNotSet), vertices(TQualifier::layoutNotSet),
inputPrimitive(ElgNone), outputPrimitive(ElgNone),
- pixelCenterInteger(false), originUpperLeft(false),
+ pixelCenterInteger(false), originUpperLeft(false),texCoordBuiltinRedeclared(false),
vertexSpacing(EvsNone), vertexOrder(EvoNone), interlockOrdering(EioNone), pointMode(false), earlyFragmentTests(false),
- postDepthCoverage(false), depthLayout(EldNone),
+ postDepthCoverage(false), earlyAndLateFragmentTestsAMD(false), depthLayout(EldNone), stencilLayout(ElsNone),
hlslFunctionality1(false),
blendEquations(0), xfbMode(false), multiStream(false),
layoutOverrideCoverage(false),
@@ -319,6 +321,7 @@ public:
primitives(TQualifier::layoutNotSet),
numTaskNVBlocks(0),
layoutPrimitiveCulling(false),
+ numTaskEXTPayloads(0),
autoMapBindings(false),
autoMapLocations(false),
flattenUniformArrays(false),
@@ -353,15 +356,11 @@ public:
void setVersion(int v)
{
-#ifndef GLSLANG_ANGLE
version = v;
-#endif
}
void setProfile(EProfile p)
{
-#ifndef GLSLANG_ANGLE
profile = p;
-#endif
}
int getVersion() const { return version; }
@@ -397,6 +396,9 @@ public:
case EShTargetSpv_1_5:
processes.addProcess("target-env spirv1.5");
break;
+ case EShTargetSpv_1_6:
+ processes.addProcess("target-env spirv1.6");
+ break;
default:
processes.addProcess("target-env spirvUnknown");
break;
@@ -415,6 +417,9 @@ public:
case EShTargetVulkan_1_2:
processes.addProcess("target-env vulkan1.2");
break;
+ case EShTargetVulkan_1_3:
+ processes.addProcess("target-env vulkan1.3");
+ break;
default:
processes.addProcess("target-env vulkanUnknown");
break;
@@ -452,6 +457,12 @@ public:
const std::string& getEntryPointName() const { return entryPointName; }
const std::string& getEntryPointMangledName() const { return entryPointMangledName; }
+ void setDebugInfo(bool debuginfo)
+ {
+ debugInfo = debuginfo;
+ }
+ bool getDebugInfo() const { return debugInfo; }
+
void setInvertY(bool invert)
{
invertY = invert;
@@ -460,6 +471,20 @@ public:
}
bool getInvertY() const { return invertY; }
+ void setDxPositionW(bool dxPosW)
+ {
+ dxPositionW = dxPosW;
+ if (dxPositionW)
+ processes.addProcess("dx-position-w");
+ }
+ bool getDxPositionW() const { return dxPositionW; }
+
+ void setEnhancedMsgs()
+ {
+ enhancedMsgs = true;
+ }
+ bool getEnhancedMsgs() const { return enhancedMsgs && getSource() == EShSourceGlsl; }
+
#ifdef ENABLE_HLSL
void setSource(EShSource s) { source = s; }
EShSource getSource() const { return source; }
@@ -565,6 +590,8 @@ public:
bool isInvariantAll() const { return invariantAll; }
void setDepthReplacing() { depthReplacing = true; }
bool isDepthReplacing() const { return depthReplacing; }
+ void setStencilReplacing() { stencilReplacing = true; }
+ bool isStencilReplacing() const { return stencilReplacing; }
bool setLocalSize(int dim, int size)
{
if (localSizeNotDefault[dim])
@@ -614,6 +641,7 @@ public:
int getNumPushConstants() const { return 0; }
void addShaderRecordCount() { }
void addTaskNVCount() { }
+ void addTaskPayloadEXTCount() { }
void setUseVulkanMemoryModel() { }
bool usingVulkanMemoryModel() const { return false; }
bool usingPhysicalStorageBuffer() const { return false; }
@@ -731,6 +759,7 @@ public:
int getNumPushConstants() const { return numPushConstants; }
void addShaderRecordCount() { ++numShaderRecordBlocks; }
void addTaskNVCount() { ++numTaskNVBlocks; }
+ void addTaskPayloadEXTCount() { ++numTaskEXTPayloads; }
bool setInvocations(int i)
{
@@ -799,7 +828,9 @@ public:
void setPostDepthCoverage() { postDepthCoverage = true; }
bool getPostDepthCoverage() const { return postDepthCoverage; }
void setEarlyFragmentTests() { earlyFragmentTests = true; }
+ void setEarlyAndLateFragmentTestsAMD() { earlyAndLateFragmentTestsAMD = true; }
bool getEarlyFragmentTests() const { return earlyFragmentTests; }
+ bool getEarlyAndLateFragmentTestsAMD() const { return earlyAndLateFragmentTestsAMD; }
bool setDepth(TLayoutDepth d)
{
if (depthLayout != EldNone)
@@ -807,11 +838,21 @@ public:
depthLayout = d;
return true;
}
+ bool setStencil(TLayoutStencil s)
+ {
+ if (stencilLayout != ElsNone)
+ return stencilLayout == s;
+ stencilLayout = s;
+ return true;
+ }
TLayoutDepth getDepth() const { return depthLayout; }
+ TLayoutStencil getStencil() const { return stencilLayout; }
void setOriginUpperLeft() { originUpperLeft = true; }
bool getOriginUpperLeft() const { return originUpperLeft; }
void setPixelCenterInteger() { pixelCenterInteger = true; }
bool getPixelCenterInteger() const { return pixelCenterInteger; }
+ void setTexCoordRedeclared() { texCoordBuiltinRedeclared = true; }
+ bool getTexCoordRedeclared() const { return texCoordBuiltinRedeclared; }
void addBlendEquation(TBlendEquationShift b) { blendEquations |= (1 << b); }
unsigned int getBlendEquations() const { return blendEquations; }
bool setXfbBufferStride(int buffer, unsigned stride)
@@ -1016,8 +1057,8 @@ public:
protected:
TIntermSymbol* addSymbol(long long Id, const TString&, const TType&, const TConstUnionArray&, TIntermTyped* subtree, const TSourceLoc&);
- void error(TInfoSink& infoSink, const char*);
- void warn(TInfoSink& infoSink, const char*);
+ void error(TInfoSink& infoSink, const char*, EShLanguage unitStage = EShLangCount);
+ void warn(TInfoSink& infoSink, const char*, EShLanguage unitStage = EShLangCount);
void mergeCallGraphs(TInfoSink&, TIntermediate&);
void mergeModes(TInfoSink&, TIntermediate&);
void mergeTrees(TInfoSink&, TIntermediate&);
@@ -1054,13 +1095,8 @@ protected:
typedef std::list<TCall> TGraph;
TGraph callGraph;
-#ifdef GLSLANG_ANGLE
- const EProfile profile = ECoreProfile;
- const int version = 450;
-#else
EProfile profile; // source profile
int version; // source version
-#endif
SpvVersion spvVersion;
TIntermNode* treeRoot;
std::set<std::string> requestedExtensions; // cumulation of all enabled or required extensions; not connected to what subset of the shader used them
@@ -1070,10 +1106,14 @@ protected:
int numPushConstants;
bool recursive;
bool invertY;
+ bool dxPositionW;
+ bool enhancedMsgs;
+ bool debugInfo;
bool useStorageBuffer;
bool invariantAll;
bool nanMinMaxClamp; // true if desiring min/max/clamp to favor non-NaN over NaN
bool depthReplacing;
+ bool stencilReplacing;
int localSize[3];
bool localSizeNotDefault[3];
int localSizeSpecId[3];
@@ -1098,13 +1138,16 @@ protected:
TLayoutGeometry outputPrimitive;
bool pixelCenterInteger;
bool originUpperLeft;
+ bool texCoordBuiltinRedeclared;
TVertexSpacing vertexSpacing;
TVertexOrder vertexOrder;
TInterlockOrdering interlockOrdering;
bool pointMode;
bool earlyFragmentTests;
bool postDepthCoverage;
+ bool earlyAndLateFragmentTestsAMD;
TLayoutDepth depthLayout;
+ TLayoutStencil stencilLayout;
bool hlslFunctionality1;
int blendEquations; // an 'or'ing of masks of shifts of TBlendEquationShift
bool xfbMode;
@@ -1117,6 +1160,7 @@ protected:
int primitives;
int numTaskNVBlocks;
bool layoutPrimitiveCulling;
+ int numTaskEXTPayloads;
// Base shift values
std::array<unsigned int, EResCount> shiftBinding;
@@ -1158,6 +1202,7 @@ protected:
// for callableData/callableDataIn
// set of names of statically read/written I/O that might need extra checking
std::set<TString> ioAccessed;
+
// source code of shader, useful as part of debug information
std::string sourceFile;
std::string sourceText;
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h
index 7248354e4b6..3c52ff1aab8 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/parseVersions.h
@@ -58,7 +58,7 @@ public:
const SpvVersion& spvVersion, EShLanguage language, TInfoSink& infoSink,
bool forwardCompatible, EShMessages messages)
:
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
forwardCompatible(forwardCompatible),
profile(profile),
#endif
@@ -117,13 +117,8 @@ public:
bool suppressWarnings() const { return true; }
bool isForwardCompatible() const { return false; }
#else
-#ifdef GLSLANG_ANGLE
- const bool forwardCompatible = true;
- const EProfile profile = ECoreProfile;
-#else
bool forwardCompatible; // true if errors are to be given for use of deprecated features
EProfile profile; // the declared profile in the shader (core by default)
-#endif
bool isEsProfile() const { return profile == EEsProfile; }
void requireProfile(const TSourceLoc& loc, int profileMask, const char* featureDesc);
void profileRequires(const TSourceLoc& loc, int profileMask, int minVersion, int numExtensions,
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp
index 9ea48c452df..3061ff79e7a 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.cpp
@@ -33,7 +33,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
#include "../Include/Common.h"
#include "reflection.h"
@@ -1271,4 +1271,4 @@ void TReflection::dump()
} // end namespace glslang
-#endif // !GLSLANG_WEB && !GLSLANG_ANGLE
+#endif // !GLSLANG_WEB
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.h b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.h
index 5af4467c1fb..bfd54526669 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/MachineIndependent/reflection.h
@@ -33,7 +33,7 @@
// POSSIBILITY OF SUCH DAMAGE.
//
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
#ifndef _REFLECTION_INCLUDED
#define _REFLECTION_INCLUDED
@@ -220,4 +220,4 @@ protected:
#endif // _REFLECTION_INCLUDED
-#endif // !GLSLANG_WEB && !GLSLANG_ANGLE
+#endif // !GLSLANG_WEB
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp
index 3f029f0239a..b98df9348de 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Unix/ossource.cpp
@@ -57,52 +57,6 @@ namespace glslang {
//
//
-// Wrapper for Linux call to DetachThread. This is required as pthread_cleanup_push() expects
-// the cleanup routine to return void.
-//
-static void DetachThreadLinux(void *)
-{
- DetachThread();
-}
-
-//
-// Registers cleanup handler, sets cancel type and state, and executes the thread specific
-// cleanup handler. This function will be called in the Standalone.cpp for regression
-// testing. When OpenGL applications are run with the driver code, Linux OS does the
-// thread cleanup.
-//
-void OS_CleanupThreadData(void)
-{
-#if defined(__ANDROID__) || defined(__Fuchsia__)
- DetachThreadLinux(NULL);
-#else
- int old_cancel_state, old_cancel_type;
- void *cleanupArg = NULL;
-
- //
- // Set thread cancel state and push cleanup handler.
- //
- pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, &old_cancel_state);
- pthread_cleanup_push(DetachThreadLinux, (void *) cleanupArg);
-
- //
- // Put the thread in deferred cancellation mode.
- //
- pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, &old_cancel_type);
-
- //
- // Pop cleanup handler and execute it prior to unregistering the cleanup handler.
- //
- pthread_cleanup_pop(1);
-
- //
- // Restore the thread's previous cancellation mode.
- //
- pthread_setcanceltype(old_cancel_state, NULL);
-#endif
-}
-
-//
// Thread Local Storage Operations
//
inline OS_TLSIndex PthreadKeyToTLSIndex(pthread_key_t key)
@@ -172,7 +126,7 @@ namespace {
pthread_mutex_t gMutex;
}
-void InitGlobalLock()
+static void InitMutex(void)
{
pthread_mutexattr_t mutexattr;
pthread_mutexattr_init(&mutexattr);
@@ -180,6 +134,12 @@ void InitGlobalLock()
pthread_mutex_init(&gMutex, &mutexattr);
}
+void InitGlobalLock()
+{
+ static pthread_once_t once = PTHREAD_ONCE_INIT;
+ pthread_once(&once, InitMutex);
+}
+
void GetGlobalLock()
{
pthread_mutex_lock(&gMutex);
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.after.js b/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.after.js
deleted file mode 100644
index c2cfc35a483..00000000000
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.after.js
+++ /dev/null
@@ -1,26 +0,0 @@
-export default (() => {
- const initialize = () => {
- return new Promise(resolve => {
- Module({
- locateFile() {
- const i = import.meta.url.lastIndexOf('/')
- return import.meta.url.substring(0, i) + '/glslang.wasm';
- },
- onRuntimeInitialized() {
- resolve({
- compileGLSLZeroCopy: this.compileGLSLZeroCopy,
- compileGLSL: this.compileGLSL,
- });
- },
- });
- });
- };
-
- let instance;
- return () => {
- if (!instance) {
- instance = initialize();
- }
- return instance;
- };
-})();
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.js.cpp b/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.js.cpp
deleted file mode 100644
index f2306a60922..00000000000
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.js.cpp
+++ /dev/null
@@ -1,287 +0,0 @@
-//
-// Copyright (C) 2019 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 3Dlabs Inc. Ltd. 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.
-//
-
-#include <cstdio>
-#include <cstdint>
-#include <memory>
-
-#ifdef __EMSCRIPTEN__
-#include <emscripten.h>
-#endif
-
-#include "../../../SPIRV/GlslangToSpv.h"
-#include "../../../glslang/Public/ShaderLang.h"
-
-#ifndef __EMSCRIPTEN__
-#define EMSCRIPTEN_KEEPALIVE
-#endif
-
-const TBuiltInResource DefaultTBuiltInResource = {
- /* .MaxLights = */ 32,
- /* .MaxClipPlanes = */ 6,
- /* .MaxTextureUnits = */ 32,
- /* .MaxTextureCoords = */ 32,
- /* .MaxVertexAttribs = */ 64,
- /* .MaxVertexUniformComponents = */ 4096,
- /* .MaxVaryingFloats = */ 64,
- /* .MaxVertexTextureImageUnits = */ 32,
- /* .MaxCombinedTextureImageUnits = */ 80,
- /* .MaxTextureImageUnits = */ 32,
- /* .MaxFragmentUniformComponents = */ 4096,
- /* .MaxDrawBuffers = */ 32,
- /* .MaxVertexUniformVectors = */ 128,
- /* .MaxVaryingVectors = */ 8,
- /* .MaxFragmentUniformVectors = */ 16,
- /* .MaxVertexOutputVectors = */ 16,
- /* .MaxFragmentInputVectors = */ 15,
- /* .MinProgramTexelOffset = */ -8,
- /* .MaxProgramTexelOffset = */ 7,
- /* .MaxClipDistances = */ 8,
- /* .MaxComputeWorkGroupCountX = */ 65535,
- /* .MaxComputeWorkGroupCountY = */ 65535,
- /* .MaxComputeWorkGroupCountZ = */ 65535,
- /* .MaxComputeWorkGroupSizeX = */ 1024,
- /* .MaxComputeWorkGroupSizeY = */ 1024,
- /* .MaxComputeWorkGroupSizeZ = */ 64,
- /* .MaxComputeUniformComponents = */ 1024,
- /* .MaxComputeTextureImageUnits = */ 16,
- /* .MaxComputeImageUniforms = */ 8,
- /* .MaxComputeAtomicCounters = */ 8,
- /* .MaxComputeAtomicCounterBuffers = */ 1,
- /* .MaxVaryingComponents = */ 60,
- /* .MaxVertexOutputComponents = */ 64,
- /* .MaxGeometryInputComponents = */ 64,
- /* .MaxGeometryOutputComponents = */ 128,
- /* .MaxFragmentInputComponents = */ 128,
- /* .MaxImageUnits = */ 8,
- /* .MaxCombinedImageUnitsAndFragmentOutputs = */ 8,
- /* .MaxCombinedShaderOutputResources = */ 8,
- /* .MaxImageSamples = */ 0,
- /* .MaxVertexImageUniforms = */ 0,
- /* .MaxTessControlImageUniforms = */ 0,
- /* .MaxTessEvaluationImageUniforms = */ 0,
- /* .MaxGeometryImageUniforms = */ 0,
- /* .MaxFragmentImageUniforms = */ 8,
- /* .MaxCombinedImageUniforms = */ 8,
- /* .MaxGeometryTextureImageUnits = */ 16,
- /* .MaxGeometryOutputVertices = */ 256,
- /* .MaxGeometryTotalOutputComponents = */ 1024,
- /* .MaxGeometryUniformComponents = */ 1024,
- /* .MaxGeometryVaryingComponents = */ 64,
- /* .MaxTessControlInputComponents = */ 128,
- /* .MaxTessControlOutputComponents = */ 128,
- /* .MaxTessControlTextureImageUnits = */ 16,
- /* .MaxTessControlUniformComponents = */ 1024,
- /* .MaxTessControlTotalOutputComponents = */ 4096,
- /* .MaxTessEvaluationInputComponents = */ 128,
- /* .MaxTessEvaluationOutputComponents = */ 128,
- /* .MaxTessEvaluationTextureImageUnits = */ 16,
- /* .MaxTessEvaluationUniformComponents = */ 1024,
- /* .MaxTessPatchComponents = */ 120,
- /* .MaxPatchVertices = */ 32,
- /* .MaxTessGenLevel = */ 64,
- /* .MaxViewports = */ 16,
- /* .MaxVertexAtomicCounters = */ 0,
- /* .MaxTessControlAtomicCounters = */ 0,
- /* .MaxTessEvaluationAtomicCounters = */ 0,
- /* .MaxGeometryAtomicCounters = */ 0,
- /* .MaxFragmentAtomicCounters = */ 8,
- /* .MaxCombinedAtomicCounters = */ 8,
- /* .MaxAtomicCounterBindings = */ 1,
- /* .MaxVertexAtomicCounterBuffers = */ 0,
- /* .MaxTessControlAtomicCounterBuffers = */ 0,
- /* .MaxTessEvaluationAtomicCounterBuffers = */ 0,
- /* .MaxGeometryAtomicCounterBuffers = */ 0,
- /* .MaxFragmentAtomicCounterBuffers = */ 1,
- /* .MaxCombinedAtomicCounterBuffers = */ 1,
- /* .MaxAtomicCounterBufferSize = */ 16384,
- /* .MaxTransformFeedbackBuffers = */ 4,
- /* .MaxTransformFeedbackInterleavedComponents = */ 64,
- /* .MaxCullDistances = */ 8,
- /* .MaxCombinedClipAndCullDistances = */ 8,
- /* .MaxSamples = */ 4,
- /* .maxMeshOutputVerticesNV = */ 256,
- /* .maxMeshOutputPrimitivesNV = */ 512,
- /* .maxMeshWorkGroupSizeX_NV = */ 32,
- /* .maxMeshWorkGroupSizeY_NV = */ 1,
- /* .maxMeshWorkGroupSizeZ_NV = */ 1,
- /* .maxTaskWorkGroupSizeX_NV = */ 32,
- /* .maxTaskWorkGroupSizeY_NV = */ 1,
- /* .maxTaskWorkGroupSizeZ_NV = */ 1,
- /* .maxMeshViewCountNV = */ 4,
- /* .maxDualSourceDrawBuffersEXT = */ 1,
-
- /* .limits = */ {
- /* .nonInductiveForLoops = */ 1,
- /* .whileLoops = */ 1,
- /* .doWhileLoops = */ 1,
- /* .generalUniformIndexing = */ 1,
- /* .generalAttributeMatrixVectorIndexing = */ 1,
- /* .generalVaryingIndexing = */ 1,
- /* .generalSamplerIndexing = */ 1,
- /* .generalVariableIndexing = */ 1,
- /* .generalConstantMatrixVectorIndexing = */ 1,
- }};
-
-static bool initialized = false;
-
-extern "C" {
-
-/*
- * Takes in a GLSL shader as a string and converts it to SPIR-V in binary form.
- *
- * |glsl| Null-terminated string containing the shader to be converted.
- * |stage_int| Magic number indicating the type of shader being processed.
-* Legal values are as follows:
- * Vertex = 0
- * Fragment = 4
- * Compute = 5
- * |gen_debug| Flag to indicate if debug information should be generated.
- * |spirv| Output parameter for a pointer to the resulting SPIR-V data.
- * |spirv_len| Output parameter for the length of the output binary buffer.
- *
- * Returns a void* pointer which, if not null, must be destroyed by
- * destroy_output_buffer.o. (This is not the same pointer returned in |spirv|.)
- * If null, the compilation failed.
- */
-EMSCRIPTEN_KEEPALIVE
-void* convert_glsl_to_spirv(const char* glsl,
- int stage_int,
- bool gen_debug,
- glslang::EShTargetLanguageVersion spirv_version,
- uint32_t** spirv,
- size_t* spirv_len)
-{
- if (glsl == nullptr) {
- fprintf(stderr, "Input pointer null\n");
- return nullptr;
- }
- if (spirv == nullptr || spirv_len == nullptr) {
- fprintf(stderr, "Output pointer null\n");
- return nullptr;
- }
- *spirv = nullptr;
- *spirv_len = 0;
-
- if (stage_int != 0 && stage_int != 4 && stage_int != 5) {
- fprintf(stderr, "Invalid shader stage\n");
- return nullptr;
- }
- EShLanguage stage = static_cast<EShLanguage>(stage_int);
- switch (spirv_version) {
- case glslang::EShTargetSpv_1_0:
- case glslang::EShTargetSpv_1_1:
- case glslang::EShTargetSpv_1_2:
- case glslang::EShTargetSpv_1_3:
- case glslang::EShTargetSpv_1_4:
- case glslang::EShTargetSpv_1_5:
- break;
- default:
- fprintf(stderr, "Invalid SPIR-V version number\n");
- return nullptr;
- }
-
- if (!initialized) {
- glslang::InitializeProcess();
- initialized = true;
- }
-
- glslang::TShader shader(stage);
- shader.setStrings(&glsl, 1);
- shader.setEnvInput(glslang::EShSourceGlsl, stage, glslang::EShClientVulkan, 100);
- shader.setEnvClient(glslang::EShClientVulkan, glslang::EShTargetVulkan_1_0);
- shader.setEnvTarget(glslang::EShTargetSpv, spirv_version);
- if (!shader.parse(&DefaultTBuiltInResource, 100, true, EShMsgDefault)) {
- fprintf(stderr, "Parse failed\n");
- fprintf(stderr, "%s\n", shader.getInfoLog());
- return nullptr;
- }
-
- glslang::TProgram program;
- program.addShader(&shader);
- if (!program.link(EShMsgDefault)) {
- fprintf(stderr, "Link failed\n");
- fprintf(stderr, "%s\n", program.getInfoLog());
- return nullptr;
- }
-
- glslang::SpvOptions spvOptions;
- spvOptions.generateDebugInfo = gen_debug;
- spvOptions.optimizeSize = false;
- spvOptions.disassemble = false;
- spvOptions.validate = false;
-
- std::vector<uint32_t>* output = new std::vector<uint32_t>;
- glslang::GlslangToSpv(*program.getIntermediate(stage), *output, nullptr, &spvOptions);
-
- *spirv_len = output->size();
- *spirv = output->data();
- return output;
-}
-
-/*
- * Destroys a buffer created by convert_glsl_to_spirv
- */
-EMSCRIPTEN_KEEPALIVE
-void destroy_output_buffer(void* p)
-{
- delete static_cast<std::vector<uint32_t>*>(p);
-}
-
-} // extern "C"
-
-/*
- * For non-Emscripten builds we supply a generic main, so that the glslang.js
- * build target can generate an executable with a trivial use case instead of
- * generating a WASM binary. This is done so that there is a target that can be
- * built and output analyzed using desktop tools, since WASM binaries are
- * specific to the Emscripten toolchain.
- */
-#ifndef __EMSCRIPTEN__
-int main() {
- const char* input = R"(#version 310 es
-
-void main() { })";
-
- uint32_t* output;
- size_t output_len;
-
- void* id = convert_glsl_to_spirv(input, 4, false, glslang::EShTargetSpv_1_0, &output, &output_len);
- assert(output != nullptr);
- assert(output_len != 0);
- destroy_output_buffer(id);
- return 0;
-}
-#endif // ifndef __EMSCRIPTEN__
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.pre.js b/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.pre.js
deleted file mode 100644
index 46a569506d7..00000000000
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/Web/glslang.pre.js
+++ /dev/null
@@ -1,56 +0,0 @@
-Module['compileGLSLZeroCopy'] = function(glsl, shader_stage, gen_debug, spirv_version) {
- gen_debug = !!gen_debug;
-
- var shader_stage_int; // EShLanguage
- switch (shader_stage) {
- case 'vertex': shader_stage_int = 0; break;
- case 'fragment': shader_stage_int = 4; break;
- case 'compute': shader_stage_int = 5; break;
- default:
- throw new Error("shader_stage must be 'vertex', 'fragment', or 'compute'.");
- }
-
- spirv_version = spirv_version || '1.0';
- var spirv_version_int; // EShTargetLanguageVersion
- switch (spirv_version) {
- case '1.0': spirv_version_int = (1 << 16) | (0 << 8); break;
- case '1.1': spirv_version_int = (1 << 16) | (1 << 8); break;
- case '1.2': spirv_version_int = (1 << 16) | (2 << 8); break;
- case '1.3': spirv_version_int = (1 << 16) | (3 << 8); break;
- case '1.4': spirv_version_int = (1 << 16) | (4 << 8); break;
- case '1.5': spirv_version_int = (1 << 16) | (5 << 8); break;
- default:
- throw new Error("spirv_version must be '1.0' ~ '1.5'.");
- }
-
- var p_output = Module['_malloc'](4);
- var p_output_len = Module['_malloc'](4);
- var id = ccall('convert_glsl_to_spirv',
- 'number',
- ['string', 'number', 'boolean', 'number', 'number', 'number'],
- [glsl, shader_stage_int, gen_debug, spirv_version_int, p_output, p_output_len]);
- var output = getValue(p_output, 'i32');
- var output_len = getValue(p_output_len, 'i32');
- Module['_free'](p_output);
- Module['_free'](p_output_len);
-
- if (id === 0) {
- throw new Error('GLSL compilation failed');
- }
-
- var ret = {};
- var outputIndexU32 = output / 4;
- ret['data'] = Module['HEAPU32'].subarray(outputIndexU32, outputIndexU32 + output_len);
- ret['free'] = function() {
- Module['_destroy_output_buffer'](id);
- };
-
- return ret;
-};
-
-Module['compileGLSL'] = function(glsl, shader_stage, gen_debug, spirv_version) {
- var compiled = Module['compileGLSLZeroCopy'](glsl, shader_stage, gen_debug, spirv_version);
- var ret = compiled['data'].slice()
- compiled['free']();
- return ret;
-};
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/osinclude.h b/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/osinclude.h
index 218abe4f23f..fcfeff2cc41 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/osinclude.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/OSDependent/osinclude.h
@@ -54,8 +54,6 @@ void ReleaseGlobalLock();
typedef unsigned int (*TThreadEntrypoint)(void*);
-void OS_CleanupThreadData(void);
-
void OS_DumpMemoryCounters();
} // end namespace glslang
diff --git a/3rdparty/bgfx/3rdparty/glslang/StandAlone/ResourceLimits.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Public/ResourceLimits.h
index 736248eb390..f70be8172a6 100644
--- a/3rdparty/bgfx/3rdparty/glslang/StandAlone/ResourceLimits.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Public/ResourceLimits.h
@@ -37,14 +37,16 @@
#include <string>
-#include "../glslang/Include/ResourceLimits.h"
+#include "../Include/ResourceLimits.h"
-namespace glslang {
+// Return pointer to user-writable Resource to pass through API in
+// future-proof way.
+extern TBuiltInResource* GetResources();
// These are the default resources for TBuiltInResources, used for both
// - parsing this string for the case where the user didn't supply one,
// - dumping out a template for user construction of a config file.
-extern const TBuiltInResource DefaultTBuiltInResource;
+extern const TBuiltInResource* GetDefaultResources();
// Returns the DefaultTBuiltInResource as a human-readable string.
std::string GetDefaultTBuiltInResourceString();
@@ -52,6 +54,4 @@ std::string GetDefaultTBuiltInResourceString();
// Decodes the resource limits from |config| to |resources|.
void DecodeResourceLimits(TBuiltInResource* resources, char* config);
-} // end namespace glslang
-
#endif // _STAND_ALONE_RESOURCE_LIMITS_INCLUDED_
diff --git a/3rdparty/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h
index d2a4bf40a05..90a5302a821 100644
--- a/3rdparty/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Public/ShaderLang.h
@@ -108,8 +108,10 @@ typedef enum {
EShLangMissNV = EShLangMiss,
EShLangCallable,
EShLangCallableNV = EShLangCallable,
- EShLangTaskNV,
- EShLangMeshNV,
+ EShLangTask,
+ EShLangTaskNV = EShLangTask,
+ EShLangMesh,
+ EShLangMeshNV = EShLangMesh,
LAST_ELEMENT_MARKER(EShLangCount),
} EShLanguage; // would be better as stage, but this is ancient now
@@ -132,8 +134,10 @@ typedef enum : unsigned {
EShLangMissNVMask = EShLangMissMask,
EShLangCallableMask = (1 << EShLangCallable),
EShLangCallableNVMask = EShLangCallableMask,
- EShLangTaskNVMask = (1 << EShLangTaskNV),
- EShLangMeshNVMask = (1 << EShLangMeshNV),
+ EShLangTaskMask = (1 << EShLangTask),
+ EShLangTaskNVMask = EShLangTaskMask,
+ EShLangMeshMask = (1 << EShLangMesh),
+ EShLangMeshNVMask = EShLangMeshMask,
LAST_ELEMENT_MARKER(EShLanguageMaskCount),
} EShLanguageMask;
@@ -150,8 +154,8 @@ typedef enum {
typedef enum {
EShClientNone, // use when there is no client, e.g. for validation
- EShClientVulkan,
- EShClientOpenGL,
+ EShClientVulkan, // as GLSL dialect, specifies KHR_vulkan_glsl extension
+ EShClientOpenGL, // as GLSL dialect, specifies ARB_gl_spirv extension
LAST_ELEMENT_MARKER(EShClientCount),
} EShClient;
@@ -166,8 +170,9 @@ typedef enum {
EShTargetVulkan_1_0 = (1 << 22), // Vulkan 1.0
EShTargetVulkan_1_1 = (1 << 22) | (1 << 12), // Vulkan 1.1
EShTargetVulkan_1_2 = (1 << 22) | (2 << 12), // Vulkan 1.2
+ EShTargetVulkan_1_3 = (1 << 22) | (3 << 12), // Vulkan 1.3
EShTargetOpenGL_450 = 450, // OpenGL
- LAST_ELEMENT_MARKER(EShTargetClientVersionCount = 4),
+ LAST_ELEMENT_MARKER(EShTargetClientVersionCount = 5),
} EShTargetClientVersion;
typedef EShTargetClientVersion EshTargetClientVersion;
@@ -179,7 +184,8 @@ typedef enum {
EShTargetSpv_1_3 = (1 << 16) | (3 << 8), // SPIR-V 1.3
EShTargetSpv_1_4 = (1 << 16) | (4 << 8), // SPIR-V 1.4
EShTargetSpv_1_5 = (1 << 16) | (5 << 8), // SPIR-V 1.5
- LAST_ELEMENT_MARKER(EShTargetLanguageVersionCount = 6),
+ EShTargetSpv_1_6 = (1 << 16) | (6 << 8), // SPIR-V 1.6
+ LAST_ELEMENT_MARKER(EShTargetLanguageVersionCount = 7),
} EShTargetLanguageVersion;
struct TInputLanguage {
@@ -262,6 +268,7 @@ enum EShMessages : unsigned {
EShMsgHlslLegalization = (1 << 12), // enable HLSL Legalization messages
EShMsgHlslDX9Compatible = (1 << 13), // enable HLSL DX9 compatible mode (for samplers and semantics)
EShMsgBuiltinSymbolTable = (1 << 14), // print the builtin symbol table
+ EShMsgEnhanced = (1 << 15), // enhanced message readability
LAST_ELEMENT_MARKER(EShMsgCount),
};
@@ -298,7 +305,7 @@ typedef struct {
//
// ShHandle held by but opaque to the driver. It is allocated,
-// managed, and de-allocated by the compiler/linker. It's contents
+// managed, and de-allocated by the compiler/linker. Its contents
// are defined by and used by the compiler and linker. For example,
// symbol table information and object code passed from the compiler
// to the linker can be stored where ShHandle points.
@@ -468,6 +475,8 @@ public:
GLSLANG_EXPORT void setSourceEntryPoint(const char* sourceEntryPointName);
GLSLANG_EXPORT void addProcesses(const std::vector<std::string>&);
GLSLANG_EXPORT void setUniqueId(unsigned long long id);
+ GLSLANG_EXPORT void setOverrideVersion(int version);
+ GLSLANG_EXPORT void setDebugInfo(bool debugInfo);
// IO resolver binding data: see comments in ShaderLang.cpp
GLSLANG_EXPORT void setShiftBinding(TResourceType res, unsigned int base);
@@ -485,6 +494,8 @@ public:
GLSLANG_EXPORT void addUniformLocationOverride(const char* name, int loc);
GLSLANG_EXPORT void setUniformLocationBase(int base);
GLSLANG_EXPORT void setInvertY(bool invert);
+ GLSLANG_EXPORT void setDxPositionW(bool dxPosW);
+ GLSLANG_EXPORT void setEnhancedMsgs();
#ifdef ENABLE_HLSL
GLSLANG_EXPORT void setHlslIoMapping(bool hlslIoMap);
GLSLANG_EXPORT void setFlattenUniformArrays(bool flatten);
@@ -512,11 +523,14 @@ public:
// use EShClientNone and version of 0, e.g. for validation mode.
// Note 'version' does not describe the target environment,
// just the version of the source dialect to compile under.
+ // For example, to choose the Vulkan dialect of GLSL defined by
+ // version 100 of the KHR_vulkan_glsl extension: lang = EShSourceGlsl,
+ // dialect = EShClientVulkan, and version = 100.
//
// See the definitions of TEnvironment, EShSource, EShLanguage,
// and EShClient for choices and more detail.
//
- // setEnvClient: The client that will be hosting the execution, and it's version.
+ // setEnvClient: The client that will be hosting the execution, and its version.
// Note 'version' is not the version of the languages involved, but
// the version of the client environment.
// Use EShClientNone and version of 0 if there is no client, e.g.
@@ -703,6 +717,9 @@ protected:
// a function in the source string can be renamed FROM this TO the name given in setEntryPoint.
std::string sourceEntryPointName;
+ // overrides #version in shader source or default version if #version isn't present
+ int overrideVersion;
+
TEnvironment environment;
friend class TProgram;
@@ -711,7 +728,7 @@ private:
TShader& operator=(TShader&);
};
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
//
// A reflection database and its interface, consistent with the OpenGL API reflection queries.
@@ -829,7 +846,7 @@ public:
virtual void addStage(EShLanguage stage, TIntermediate& stageIntermediate) = 0;
};
-#endif // !GLSLANG_WEB && !GLSLANG_ANGLE
+#endif // !GLSLANG_WEB
// Make one TProgram per set of shaders that will get linked together. Add all
// the shaders that are to be linked together. After calling shader.parse()
@@ -850,7 +867,7 @@ public:
TIntermediate* getIntermediate(EShLanguage stage) const { return intermediate[stage]; }
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
// Reflection Interface
@@ -944,7 +961,7 @@ public:
// If resolver is not provided it uses the previous approach
// and respects auto assignment and offsets.
GLSLANG_EXPORT bool mapIO(TIoMapResolver* pResolver = nullptr, TIoMapper* pIoMapper = nullptr);
-#endif // !GLSLANG_WEB && !GLSLANG_ANGLE
+#endif // !GLSLANG_WEB
protected:
GLSLANG_EXPORT bool linkStage(EShLanguage, EShMessages);
@@ -955,7 +972,7 @@ protected:
TIntermediate* intermediate[EShLangCount];
bool newedIntermediate[EShLangCount]; // track which intermediate were "new" versus reusing a singleton unit in a stage
TInfoSink* infoSink;
-#if !defined(GLSLANG_WEB) && !defined(GLSLANG_ANGLE)
+#if !defined(GLSLANG_WEB)
TReflection* reflection;
#endif
bool linked;
diff --git a/3rdparty/bgfx/3rdparty/glslang/StandAlone/resource_limits_c.h b/3rdparty/bgfx/3rdparty/glslang/glslang/Public/resource_limits_c.h
index 108fd5e21ed..05aa8eb0269 100644
--- a/3rdparty/bgfx/3rdparty/glslang/StandAlone/resource_limits_c.h
+++ b/3rdparty/bgfx/3rdparty/glslang/glslang/Public/resource_limits_c.h
@@ -29,12 +29,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_
#define _STAND_ALONE_RESOURCE_LIMITS_C_INCLUDED_
-#include "../glslang/Include/glslang_c_interface.h"
+#include "../Include/glslang_c_interface.h"
#ifdef __cplusplus
extern "C" {
#endif
+// Returns a struct that can be use to create custom resource values.
+glslang_resource_t* glslang_resource(void);
+
// These are the default resources for TBuiltInResources, used for both
// - parsing this string for the case where the user didn't supply one,
// - dumping out a template for user construction of a config file.
diff --git a/3rdparty/bgfx/3rdparty/iconfontheaders/.gitignore b/3rdparty/bgfx/3rdparty/iconfontheaders/.gitignore
deleted file mode 100644
index 31b83a9bc9a..00000000000
--- a/3rdparty/bgfx/3rdparty/iconfontheaders/.gitignore
+++ /dev/null
@@ -1,58 +0,0 @@
-# Byte-compiled / optimized / DLL files
-__pycache__/
-*.py[cod]
-
-# C extensions
-*.so
-
-# Distribution / packaging
-.Python
-env/
-build/
-develop-eggs/
-dist/
-downloads/
-eggs/
-.eggs/
-lib/
-lib64/
-parts/
-sdist/
-var/
-*.egg-info/
-.installed.cfg
-*.egg
-
-# PyInstaller
-# Usually these files are written by a python script from a template
-# before PyInstaller builds the exe, so as to inject date/other infos into it.
-*.manifest
-*.spec
-
-# Installer logs
-pip-log.txt
-pip-delete-this-directory.txt
-
-# Unit test / coverage reports
-htmlcov/
-.tox/
-.coverage
-.coverage.*
-.cache
-nosetests.xml
-coverage.xml
-*,cover
-
-# Translations
-*.mo
-*.pot
-
-# Django stuff:
-*.log
-
-# Sphinx documentation
-docs/_build/
-
-# PyBuilder
-target/
-.idea/
diff --git a/3rdparty/bgfx/3rdparty/iconfontheaders/README.md b/3rdparty/bgfx/3rdparty/iconfontheaders/README.md
deleted file mode 100644
index f22b76057e0..00000000000
--- a/3rdparty/bgfx/3rdparty/iconfontheaders/README.md
+++ /dev/null
@@ -1,53 +0,0 @@
-# IconFontCppHeaders
-
-[https://github.com/juliettef/IconFontCppHeaders](https://github.com/juliettef/IconFontCppHeaders)
-
-C++11, C89 and None headers for icon fonts Font Awesome, Google Material Design icons and Kenney game icons.
-
-A set of header files for using icon fonts in C, C++ and [None](https://bitbucket.org/duangle/nonelang/src), along with the python generator used to create the files.
-
-Each header contains defines for one font, with each icon code point defined as ICON_*, along with the min and max code points for font loading purposes.
-
-## Fonts
-
-* [Font Awesome](http://fontawesome.io/)
- * [github repository](https://github.com/FortAwesome/Font-Awesome/)
- * [fontawesome-webfont.ttf](https://github.com/FortAwesome/Font-Awesome/blob/master/fonts/fontawesome-webfont.ttf)
-* [Google Material Design icons](https://design.google.com/icons/)
- * [github repository](https://github.com/google/material-design-icons/)
- * [MaterialIcons-Regular.ttf](https://github.com/google/material-design-icons/blob/master/iconfont/MaterialIcons-Regular.ttf)
-* [Kenney Game icons](http://kenney.nl/assets/game-icons) and [Game icons expansion](http://kenney.nl/assets/game-icons-expansion)
- * [github repository](https://github.com/SamBrishes/kenney-icon-font)
- * [kenney-icon-font.ttf](https://github.com/SamBrishes/kenney-icon-font/blob/master/fonts/kenney-icon-font.ttf)
-
-## Example Code
-
-Using [dear imgui](https://github.com/ocornut/imgui) as an example UI library:
-
- #include "IconsFontAwesome.h"
-
- ImGuiIO& io = ImGui::GetIO();
- io.Fonts->AddFontDefault();
-
- // merge in icons from Font Awesome
- static const ImWchar icons_ranges[] = { ICON_MIN_FA, ICON_MAX_FA, 0 };
- ImFontConfig icons_config; icons_config.MergeMode = true; icons_config.PixelSnapH = true;
- io.Fonts->AddFontFromFileTTF( fontFile.c_str(), 16.0f, &icons_config, icons_ranges);
-
- // in an imgui window somewhere...
- ImGui::Text( ICON_FA_FILE " File" ); // use string literal concatenation, ouputs a file icon and File as a string.
-
-## Projects using the font icon header files
-
-### [bgfx](https://github.com/bkaradzic/bgfx) - Cross-platform rendering library
-
-### [Avoyd](http://www.avoyd.com) - Game
-The Edit Tool UI uses [dear imgui](https://github.com/ocornut/imgui) with [Font Awesome](http://fontawesome.io/) fonts.
-
-![Avoyd Edit Tool with Font Awesome fonts](https://www.enkisoftware.com/images/2017-02-22_Avoyd_Editor_UI_ImGui_Font_Awesome.png)
-
-## Credits
-
-Development - [Juliette Foucaut](http://www.enkisoftware.com/about.html#juliette) - [@juliettef](https://github.com/juliettef)
-Requirements - [Doug Binks](http://www.enkisoftware.com/about.html#doug) - [@dougbinks](https://github.com/dougbinks)
-[None language](https://bitbucket.org/duangle/nonelang/src) [format definition and refactoring](https://gist.github.com/paniq/4a734e9d8e86a2373b5bc4ca719855ec) - [Leonard Ritter](http://www.leonard-ritter.com/) - [@paniq](https://github.com/paniq)
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_icd.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_icd.h
index ae006d06d13..44b15277f79 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_icd.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_icd.h
@@ -33,7 +33,7 @@
// Version 2 - Add Loader/ICD Interface version negotiation
// via vk_icdNegotiateLoaderICDInterfaceVersion.
// Version 3 - Add ICD creation/destruction of KHR_surface objects.
-// Version 4 - Add unknown physical device extension qyering via
+// Version 4 - Add unknown physical device extension querying via
// vk_icdGetPhysicalDeviceProcAddr.
// Version 5 - Tells ICDs that the loader is now paying attention to the
// application version of Vulkan passed into the ApplicationInfo
@@ -123,6 +123,7 @@ typedef enum {
VK_ICD_WSI_PLATFORM_VI,
VK_ICD_WSI_PLATFORM_GGP,
VK_ICD_WSI_PLATFORM_SCREEN,
+ VK_ICD_WSI_PLATFORM_FUCHSIA,
} VkIcdWsiPlatform;
typedef struct {
@@ -242,4 +243,10 @@ typedef struct {
} VkIcdSurfaceScreen;
#endif // VK_USE_PLATFORM_SCREEN_QNX
+#ifdef VK_USE_PLATFORM_FUCHSIA
+typedef struct {
+ VkIcdSurfaceBase base;
+} VkIcdSurfaceImagePipe;
+#endif // VK_USE_PLATFORM_FUCHSIA
+
#endif // VKICD_H
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_platform.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_platform.h
index 18b913abc6a..3ff8c5d1467 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_platform.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_platform.h
@@ -2,7 +2,7 @@
// File: vk_platform.h
//
/*
-** Copyright 2014-2021 The Khronos Group Inc.
+** Copyright 2014-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -42,7 +42,7 @@ extern "C"
#define VKAPI_CALL __stdcall
#define VKAPI_PTR VKAPI_CALL
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH < 7
- #error "Vulkan isn't supported for the 'armeabi' NDK ABI"
+ #error "Vulkan is not supported for the 'armeabi' NDK ABI"
#elif defined(__ANDROID__) && defined(__ARM_ARCH) && __ARM_ARCH >= 7 && defined(__ARM_32BIT_STATE)
// On Android 32-bit ARM targets, Vulkan functions use the "hardfloat"
// calling convention, i.e. float parameters are passed in registers. This
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_sdk_platform.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_sdk_platform.h
index 96d8676949e..f192c1c6193 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_sdk_platform.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vk_sdk_platform.h
@@ -23,7 +23,9 @@
#define VK_SDK_PLATFORM_H
#if defined(_WIN32)
+#ifndef NOMINMAX
#define NOMINMAX
+#endif
#ifndef __cplusplus
#undef inline
#define inline __inline
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan.h
index 3f7cdba5845..3510ac912b6 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan.h
@@ -2,7 +2,7 @@
#define VULKAN_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -38,7 +38,6 @@
#ifdef VK_USE_PLATFORM_WAYLAND_KHR
-#include <wayland-client.h>
#include "vulkan_wayland.h"
#endif
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_android.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_android.h
index 2160e3e7c60..11f5397966c 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_android.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_android.h
@@ -2,7 +2,7 @@
#define VULKAN_ANDROID_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -44,7 +44,7 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateAndroidSurfaceKHR(
#define VK_ANDROID_external_memory_android_hardware_buffer 1
struct AHardwareBuffer;
-#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 3
+#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_SPEC_VERSION 5
#define VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME "VK_ANDROID_external_memory_android_hardware_buffer"
typedef struct VkAndroidHardwareBufferUsageANDROID {
VkStructureType sType;
@@ -90,6 +90,19 @@ typedef struct VkExternalFormatANDROID {
uint64_t externalFormat;
} VkExternalFormatANDROID;
+typedef struct VkAndroidHardwareBufferFormatProperties2ANDROID {
+ VkStructureType sType;
+ void* pNext;
+ VkFormat format;
+ uint64_t externalFormat;
+ VkFormatFeatureFlags2 formatFeatures;
+ VkComponentMapping samplerYcbcrConversionComponents;
+ VkSamplerYcbcrModelConversion suggestedYcbcrModel;
+ VkSamplerYcbcrRange suggestedYcbcrRange;
+ VkChromaLocation suggestedXChromaOffset;
+ VkChromaLocation suggestedYChromaOffset;
+} VkAndroidHardwareBufferFormatProperties2ANDROID;
+
typedef VkResult (VKAPI_PTR *PFN_vkGetAndroidHardwareBufferPropertiesANDROID)(VkDevice device, const struct AHardwareBuffer* buffer, VkAndroidHardwareBufferPropertiesANDROID* pProperties);
typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryAndroidHardwareBufferANDROID)(VkDevice device, const VkMemoryGetAndroidHardwareBufferInfoANDROID* pInfo, struct AHardwareBuffer** pBuffer);
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_beta.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_beta.h
index f67fab36a65..db511024fb7 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_beta.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_beta.h
@@ -2,7 +2,7 @@
#define VULKAN_BETA_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -22,7 +22,7 @@ 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 2
+#define VK_KHR_VIDEO_QUEUE_SPEC_VERSION 7
#define VK_KHR_VIDEO_QUEUE_EXTENSION_NAME "VK_KHR_video_queue"
typedef enum VkQueryResultStatusKHR {
@@ -33,11 +33,14 @@ typedef enum VkQueryResultStatusKHR {
} VkQueryResultStatusKHR;
typedef enum VkVideoCodecOperationFlagBitsKHR {
- VK_VIDEO_CODEC_OPERATION_INVALID_BIT_KHR = 0,
+ 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
@@ -48,7 +51,7 @@ typedef enum VkVideoCodecOperationFlagBitsKHR {
typedef VkFlags VkVideoCodecOperationFlagsKHR;
typedef enum VkVideoChromaSubsamplingFlagBitsKHR {
- VK_VIDEO_CHROMA_SUBSAMPLING_INVALID_BIT_KHR = 0,
+ 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,
@@ -74,126 +77,136 @@ typedef enum VkVideoCapabilityFlagBitsKHR {
typedef VkFlags VkVideoCapabilityFlagsKHR;
typedef enum VkVideoSessionCreateFlagBitsKHR {
- VK_VIDEO_SESSION_CREATE_DEFAULT_KHR = 0,
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_DEFAULT_KHR = 0,
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 enum VkVideoCodingQualityPresetFlagBitsKHR {
- VK_VIDEO_CODING_QUALITY_PRESET_NORMAL_BIT_KHR = 0x00000001,
- VK_VIDEO_CODING_QUALITY_PRESET_POWER_BIT_KHR = 0x00000002,
- VK_VIDEO_CODING_QUALITY_PRESET_QUALITY_BIT_KHR = 0x00000004,
- VK_VIDEO_CODING_QUALITY_PRESET_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
-} VkVideoCodingQualityPresetFlagBitsKHR;
-typedef VkFlags VkVideoCodingQualityPresetFlagsKHR;
-typedef struct VkVideoQueueFamilyProperties2KHR {
+typedef struct VkQueueFamilyVideoPropertiesKHR {
VkStructureType sType;
void* pNext;
VkVideoCodecOperationFlagsKHR videoCodecOperations;
-} VkVideoQueueFamilyProperties2KHR;
+} VkQueueFamilyVideoPropertiesKHR;
-typedef struct VkVideoProfileKHR {
+typedef struct VkVideoProfileInfoKHR {
VkStructureType sType;
- void* pNext;
+ const void* pNext;
VkVideoCodecOperationFlagBitsKHR videoCodecOperation;
VkVideoChromaSubsamplingFlagsKHR chromaSubsampling;
VkVideoComponentBitDepthFlagsKHR lumaBitDepth;
VkVideoComponentBitDepthFlagsKHR chromaBitDepth;
-} VkVideoProfileKHR;
+} VkVideoProfileInfoKHR;
-typedef struct VkVideoProfilesKHR {
- VkStructureType sType;
- void* pNext;
- uint32_t profileCount;
- const VkVideoProfileKHR* pProfiles;
-} VkVideoProfilesKHR;
+typedef struct VkVideoProfileListInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t profileCount;
+ const VkVideoProfileInfoKHR* pProfiles;
+} VkVideoProfileListInfoKHR;
typedef struct VkVideoCapabilitiesKHR {
VkStructureType sType;
void* pNext;
- VkVideoCapabilityFlagsKHR capabilityFlags;
+ VkVideoCapabilityFlagsKHR flags;
VkDeviceSize minBitstreamBufferOffsetAlignment;
VkDeviceSize minBitstreamBufferSizeAlignment;
- VkExtent2D videoPictureExtentGranularity;
- VkExtent2D minExtent;
- VkExtent2D maxExtent;
- uint32_t maxReferencePicturesSlotsCount;
- uint32_t maxReferencePicturesActiveCount;
+ VkExtent2D pictureAccessGranularity;
+ VkExtent2D minCodedExtent;
+ VkExtent2D maxCodedExtent;
+ uint32_t maxDpbSlots;
+ uint32_t maxActiveReferencePictures;
+ VkExtensionProperties stdHeaderVersion;
} VkVideoCapabilitiesKHR;
typedef struct VkPhysicalDeviceVideoFormatInfoKHR {
- VkStructureType sType;
- void* pNext;
- VkImageUsageFlags imageUsage;
- const VkVideoProfilesKHR* pVideoProfiles;
+ VkStructureType sType;
+ const void* pNext;
+ VkImageUsageFlags imageUsage;
} VkPhysicalDeviceVideoFormatInfoKHR;
typedef struct VkVideoFormatPropertiesKHR {
- VkStructureType sType;
- void* pNext;
- VkFormat format;
+ VkStructureType sType;
+ void* pNext;
+ VkFormat format;
+ VkComponentMapping componentMapping;
+ VkImageCreateFlags imageCreateFlags;
+ VkImageType imageType;
+ VkImageTiling imageTiling;
+ VkImageUsageFlags imageUsageFlags;
} VkVideoFormatPropertiesKHR;
-typedef struct VkVideoPictureResourceKHR {
+typedef struct VkVideoPictureResourceInfoKHR {
VkStructureType sType;
const void* pNext;
VkOffset2D codedOffset;
VkExtent2D codedExtent;
uint32_t baseArrayLayer;
VkImageView imageViewBinding;
-} VkVideoPictureResourceKHR;
-
-typedef struct VkVideoReferenceSlotKHR {
- VkStructureType sType;
- const void* pNext;
- int8_t slotIndex;
- const VkVideoPictureResourceKHR* pPictureResource;
-} VkVideoReferenceSlotKHR;
-
-typedef struct VkVideoGetMemoryPropertiesKHR {
- VkStructureType sType;
- const void* pNext;
- uint32_t memoryBindIndex;
- VkMemoryRequirements2* pMemoryRequirements;
-} VkVideoGetMemoryPropertiesKHR;
+} VkVideoPictureResourceInfoKHR;
-typedef struct VkVideoBindMemoryKHR {
+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;
-} VkVideoBindMemoryKHR;
+} VkBindVideoSessionMemoryInfoKHR;
typedef struct VkVideoSessionCreateInfoKHR {
VkStructureType sType;
const void* pNext;
uint32_t queueFamilyIndex;
VkVideoSessionCreateFlagsKHR flags;
- const VkVideoProfileKHR* pVideoProfile;
+ const VkVideoProfileInfoKHR* pVideoProfile;
VkFormat pictureFormat;
VkExtent2D maxCodedExtent;
- VkFormat referencePicturesFormat;
- uint32_t maxReferencePicturesSlotsCount;
- uint32_t maxReferencePicturesActiveCount;
+ VkFormat referencePictureFormat;
+ uint32_t maxDpbSlots;
+ uint32_t maxActiveReferencePictures;
+ const VkExtensionProperties* pStdHeaderVersion;
} VkVideoSessionCreateInfoKHR;
typedef struct VkVideoSessionParametersCreateInfoKHR {
- VkStructureType sType;
- const void* pNext;
- VkVideoSessionParametersKHR videoSessionParametersTemplate;
- VkVideoSessionKHR videoSession;
+ VkStructureType sType;
+ const void* pNext;
+ VkVideoSessionParametersCreateFlagsKHR flags;
+ VkVideoSessionParametersKHR videoSessionParametersTemplate;
+ VkVideoSessionKHR videoSession;
} VkVideoSessionParametersCreateInfoKHR;
typedef struct VkVideoSessionParametersUpdateInfoKHR {
@@ -206,11 +219,10 @@ typedef struct VkVideoBeginCodingInfoKHR {
VkStructureType sType;
const void* pNext;
VkVideoBeginCodingFlagsKHR flags;
- VkVideoCodingQualityPresetFlagsKHR codecQualityPreset;
VkVideoSessionKHR videoSession;
VkVideoSessionParametersKHR videoSessionParameters;
uint32_t referenceSlotCount;
- const VkVideoReferenceSlotKHR* pReferenceSlots;
+ const VkVideoReferenceSlotInfoKHR* pReferenceSlots;
} VkVideoBeginCodingInfoKHR;
typedef struct VkVideoEndCodingInfoKHR {
@@ -225,12 +237,12 @@ typedef struct VkVideoCodingControlInfoKHR {
VkVideoCodingControlFlagsKHR flags;
} VkVideoCodingControlInfoKHR;
-typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR)(VkPhysicalDevice physicalDevice, const VkVideoProfileKHR* pVideoProfile, VkVideoCapabilitiesKHR* pCapabilities);
+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* pVideoSessionMemoryRequirementsCount, VkVideoGetMemoryPropertiesKHR* pVideoSessionMemoryRequirements);
-typedef VkResult (VKAPI_PTR *PFN_vkBindVideoSessionMemoryKHR)(VkDevice device, VkVideoSessionKHR videoSession, uint32_t videoSessionBindMemoryCount, const VkVideoBindMemoryKHR* pVideoSessionBindMemories);
+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);
@@ -241,7 +253,7 @@ typedef void (VKAPI_PTR *PFN_vkCmdControlVideoCodingKHR)(VkCommandBuffer command
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceVideoCapabilitiesKHR(
VkPhysicalDevice physicalDevice,
- const VkVideoProfileKHR* pVideoProfile,
+ const VkVideoProfileInfoKHR* pVideoProfile,
VkVideoCapabilitiesKHR* pCapabilities);
VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceVideoFormatPropertiesKHR(
@@ -264,14 +276,14 @@ VKAPI_ATTR void VKAPI_CALL vkDestroyVideoSessionKHR(
VKAPI_ATTR VkResult VKAPI_CALL vkGetVideoSessionMemoryRequirementsKHR(
VkDevice device,
VkVideoSessionKHR videoSession,
- uint32_t* pVideoSessionMemoryRequirementsCount,
- VkVideoGetMemoryPropertiesKHR* pVideoSessionMemoryRequirements);
+ uint32_t* pMemoryRequirementsCount,
+ VkVideoSessionMemoryRequirementsKHR* pMemoryRequirements);
VKAPI_ATTR VkResult VKAPI_CALL vkBindVideoSessionMemoryKHR(
VkDevice device,
VkVideoSessionKHR videoSession,
- uint32_t videoSessionBindMemoryCount,
- const VkVideoBindMemoryKHR* pVideoSessionBindMemories);
+ uint32_t bindSessionMemoryInfoCount,
+ const VkBindVideoSessionMemoryInfoKHR* pBindSessionMemoryInfos);
VKAPI_ATTR VkResult VKAPI_CALL vkCreateVideoSessionParametersKHR(
VkDevice device,
@@ -304,36 +316,56 @@ VKAPI_ATTR void VKAPI_CALL vkCmdControlVideoCodingKHR(
#define VK_KHR_video_decode_queue 1
-#define VK_KHR_VIDEO_DECODE_QUEUE_SPEC_VERSION 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 VkVideoDecodeFlagBitsKHR {
- VK_VIDEO_DECODE_DEFAULT_KHR = 0,
- VK_VIDEO_DECODE_RESERVED_0_BIT_KHR = 0x00000001,
- VK_VIDEO_DECODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
-} VkVideoDecodeFlagBitsKHR;
+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;
- VkOffset2D codedOffset;
- VkExtent2D codedExtent;
- VkBuffer srcBuffer;
- VkDeviceSize srcBufferOffset;
- VkDeviceSize srcBufferRange;
- VkVideoPictureResourceKHR dstPictureResource;
- const VkVideoReferenceSlotKHR* pSetupReferenceSlot;
- uint32_t referenceSlotCount;
- const VkVideoReferenceSlotKHR* pReferenceSlots;
+ 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* pFrameInfo);
+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* pFrameInfo);
+ const VkVideoDecodeInfoKHR* pDecodeInfo);
#endif
@@ -369,22 +401,24 @@ typedef struct VkPhysicalDevicePortabilitySubsetPropertiesKHR {
#define VK_KHR_video_encode_queue 1
-#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 2
+#define VK_KHR_VIDEO_ENCODE_QUEUE_SPEC_VERSION 7
#define VK_KHR_VIDEO_ENCODE_QUEUE_EXTENSION_NAME "VK_KHR_video_encode_queue"
-typedef enum VkVideoEncodeFlagBitsKHR {
- VK_VIDEO_ENCODE_DEFAULT_KHR = 0,
- VK_VIDEO_ENCODE_RESERVED_0_BIT_KHR = 0x00000001,
- VK_VIDEO_ENCODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
-} VkVideoEncodeFlagBitsKHR;
+typedef enum VkVideoEncodeTuningModeKHR {
+ VK_VIDEO_ENCODE_TUNING_MODE_DEFAULT_KHR = 0,
+ VK_VIDEO_ENCODE_TUNING_MODE_HIGH_QUALITY_KHR = 1,
+ VK_VIDEO_ENCODE_TUNING_MODE_LOW_LATENCY_KHR = 2,
+ VK_VIDEO_ENCODE_TUNING_MODE_ULTRA_LOW_LATENCY_KHR = 3,
+ VK_VIDEO_ENCODE_TUNING_MODE_LOSSLESS_KHR = 4,
+ VK_VIDEO_ENCODE_TUNING_MODE_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkVideoEncodeTuningModeKHR;
typedef VkFlags VkVideoEncodeFlagsKHR;
-typedef enum VkVideoEncodeRateControlFlagBitsKHR {
- VK_VIDEO_ENCODE_RATE_CONTROL_DEFAULT_KHR = 0,
- VK_VIDEO_ENCODE_RATE_CONTROL_RESET_BIT_KHR = 0x00000001,
- VK_VIDEO_ENCODE_RATE_CONTROL_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
-} VkVideoEncodeRateControlFlagBitsKHR;
-typedef VkFlags VkVideoEncodeRateControlFlagsKHR;
+typedef enum VkVideoEncodeCapabilityFlagBitsKHR {
+ VK_VIDEO_ENCODE_CAPABILITY_PRECEDING_EXTERNALLY_ENCODED_BYTES_BIT_KHR = 0x00000001,
+ VK_VIDEO_ENCODE_CAPABILITY_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkVideoEncodeCapabilityFlagBitsKHR;
+typedef VkFlags VkVideoEncodeCapabilityFlagsKHR;
typedef enum VkVideoEncodeRateControlModeFlagBitsKHR {
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_NONE_BIT_KHR = 0,
@@ -393,31 +427,77 @@ typedef enum VkVideoEncodeRateControlModeFlagBitsKHR {
VK_VIDEO_ENCODE_RATE_CONTROL_MODE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
} VkVideoEncodeRateControlModeFlagBitsKHR;
typedef VkFlags VkVideoEncodeRateControlModeFlagsKHR;
+
+typedef enum VkVideoEncodeUsageFlagBitsKHR {
+ VK_VIDEO_ENCODE_USAGE_DEFAULT_KHR = 0,
+ VK_VIDEO_ENCODE_USAGE_TRANSCODING_BIT_KHR = 0x00000001,
+ VK_VIDEO_ENCODE_USAGE_STREAMING_BIT_KHR = 0x00000002,
+ VK_VIDEO_ENCODE_USAGE_RECORDING_BIT_KHR = 0x00000004,
+ VK_VIDEO_ENCODE_USAGE_CONFERENCING_BIT_KHR = 0x00000008,
+ VK_VIDEO_ENCODE_USAGE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkVideoEncodeUsageFlagBitsKHR;
+typedef VkFlags VkVideoEncodeUsageFlagsKHR;
+
+typedef enum VkVideoEncodeContentFlagBitsKHR {
+ VK_VIDEO_ENCODE_CONTENT_DEFAULT_KHR = 0,
+ VK_VIDEO_ENCODE_CONTENT_CAMERA_BIT_KHR = 0x00000001,
+ VK_VIDEO_ENCODE_CONTENT_DESKTOP_BIT_KHR = 0x00000002,
+ VK_VIDEO_ENCODE_CONTENT_RENDERED_BIT_KHR = 0x00000004,
+ VK_VIDEO_ENCODE_CONTENT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkVideoEncodeContentFlagBitsKHR;
+typedef VkFlags VkVideoEncodeContentFlagsKHR;
+typedef VkFlags VkVideoEncodeRateControlFlagsKHR;
typedef struct VkVideoEncodeInfoKHR {
- VkStructureType sType;
- const void* pNext;
- VkVideoEncodeFlagsKHR flags;
- uint32_t qualityLevel;
- VkExtent2D codedExtent;
- VkBuffer dstBitstreamBuffer;
- VkDeviceSize dstBitstreamBufferOffset;
- VkDeviceSize dstBitstreamBufferMaxRange;
- VkVideoPictureResourceKHR srcPictureResource;
- const VkVideoReferenceSlotKHR* pSetupReferenceSlot;
- uint32_t referenceSlotCount;
- const VkVideoReferenceSlotKHR* pReferenceSlots;
+ VkStructureType sType;
+ const void* pNext;
+ VkVideoEncodeFlagsKHR flags;
+ uint32_t qualityLevel;
+ VkBuffer dstBitstreamBuffer;
+ VkDeviceSize dstBitstreamBufferOffset;
+ VkDeviceSize dstBitstreamBufferMaxRange;
+ VkVideoPictureResourceInfoKHR srcPictureResource;
+ const VkVideoReferenceSlotInfoKHR* pSetupReferenceSlot;
+ uint32_t referenceSlotCount;
+ const VkVideoReferenceSlotInfoKHR* pReferenceSlots;
+ uint32_t precedingExternallyEncodedBytes;
} VkVideoEncodeInfoKHR;
+typedef struct VkVideoEncodeCapabilitiesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkVideoEncodeCapabilityFlagsKHR flags;
+ VkVideoEncodeRateControlModeFlagsKHR rateControlModes;
+ uint8_t rateControlLayerCount;
+ uint8_t qualityLevelCount;
+ VkExtent2D inputImageDataFillAlignment;
+} VkVideoEncodeCapabilitiesKHR;
+
+typedef struct VkVideoEncodeUsageInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkVideoEncodeUsageFlagsKHR videoUsageHints;
+ VkVideoEncodeContentFlagsKHR videoContentHints;
+ VkVideoEncodeTuningModeKHR tuningMode;
+} VkVideoEncodeUsageInfoKHR;
+
+typedef struct VkVideoEncodeRateControlLayerInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t averageBitrate;
+ uint32_t maxBitrate;
+ uint32_t frameRateNumerator;
+ uint32_t frameRateDenominator;
+ uint32_t virtualBufferSizeInMs;
+ uint32_t initialVirtualBufferSizeInMs;
+} VkVideoEncodeRateControlLayerInfoKHR;
+
typedef struct VkVideoEncodeRateControlInfoKHR {
- VkStructureType sType;
- const void* pNext;
- VkVideoEncodeRateControlFlagsKHR flags;
- VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode;
- uint32_t averageBitrate;
- uint16_t peakToAverageBitrateRatio;
- uint16_t frameRateNumerator;
- uint16_t frameRateDenominator;
- uint32_t virtualBufferSizeInMs;
+ VkStructureType sType;
+ const void* pNext;
+ VkVideoEncodeRateControlFlagsKHR flags;
+ VkVideoEncodeRateControlModeFlagBitsKHR rateControlMode;
+ uint8_t layerCount;
+ const VkVideoEncodeRateControlLayerInfoKHR* pLayerConfigs;
} VkVideoEncodeRateControlInfoKHR;
typedef void (VKAPI_PTR *PFN_vkCmdEncodeVideoKHR)(VkCommandBuffer commandBuffer, const VkVideoEncodeInfoKHR* pEncodeInfo);
@@ -432,21 +512,42 @@ 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 2
+#define VK_EXT_VIDEO_ENCODE_H264_SPEC_VERSION 9
#define VK_EXT_VIDEO_ENCODE_H264_EXTENSION_NAME "VK_EXT_video_encode_h264"
+typedef enum VkVideoEncodeH264RateControlStructureEXT {
+ VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0,
+ VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_FLAT_EXT = 1,
+ VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_DYADIC_EXT = 2,
+ VK_VIDEO_ENCODE_H264_RATE_CONTROL_STRUCTURE_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkVideoEncodeH264RateControlStructureEXT;
+
typedef enum VkVideoEncodeH264CapabilityFlagBitsEXT {
- VK_VIDEO_ENCODE_H264_CAPABILITY_CABAC_BIT_EXT = 0x00000001,
- VK_VIDEO_ENCODE_H264_CAPABILITY_CAVLC_BIT_EXT = 0x00000002,
- VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BI_PRED_IMPLICIT_BIT_EXT = 0x00000004,
- VK_VIDEO_ENCODE_H264_CAPABILITY_TRANSFORM_8X8_BIT_EXT = 0x00000008,
- VK_VIDEO_ENCODE_H264_CAPABILITY_CHROMA_QP_OFFSET_BIT_EXT = 0x00000010,
- VK_VIDEO_ENCODE_H264_CAPABILITY_SECOND_CHROMA_QP_OFFSET_BIT_EXT = 0x00000020,
- VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_DISABLED_BIT_EXT = 0x00000040,
- VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_ENABLED_BIT_EXT = 0x00000080,
- VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_PARTIAL_BIT_EXT = 0x00000100,
- VK_VIDEO_ENCODE_H264_CAPABILITY_MULTIPLE_SLICE_PER_FRAME_BIT_EXT = 0x00000200,
- VK_VIDEO_ENCODE_H264_CAPABILITY_EVENLY_DISTRIBUTED_SLICE_SIZE_BIT_EXT = 0x00000400,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_DIRECT_8X8_INFERENCE_ENABLED_BIT_EXT = 0x00000001,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_DIRECT_8X8_INFERENCE_DISABLED_BIT_EXT = 0x00000002,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_SEPARATE_COLOUR_PLANE_BIT_EXT = 0x00000004,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_QPPRIME_Y_ZERO_TRANSFORM_BYPASS_BIT_EXT = 0x00000008,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_SCALING_LISTS_BIT_EXT = 0x00000010,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_HRD_COMPLIANCE_BIT_EXT = 0x00000020,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_CHROMA_QP_OFFSET_BIT_EXT = 0x00000040,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_SECOND_CHROMA_QP_OFFSET_BIT_EXT = 0x00000080,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_PIC_INIT_QP_MINUS26_BIT_EXT = 0x00000100,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_PRED_BIT_EXT = 0x00000200,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BIPRED_EXPLICIT_BIT_EXT = 0x00000400,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_BIPRED_IMPLICIT_BIT_EXT = 0x00000800,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_WEIGHTED_PRED_NO_TABLE_BIT_EXT = 0x00001000,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_TRANSFORM_8X8_BIT_EXT = 0x00002000,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_CABAC_BIT_EXT = 0x00004000,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_CAVLC_BIT_EXT = 0x00008000,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_DISABLED_BIT_EXT = 0x00010000,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_ENABLED_BIT_EXT = 0x00020000,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_DEBLOCKING_FILTER_PARTIAL_BIT_EXT = 0x00040000,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_DISABLE_DIRECT_SPATIAL_MV_PRED_BIT_EXT = 0x00080000,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_MULTIPLE_SLICE_PER_FRAME_BIT_EXT = 0x00100000,
+ VK_VIDEO_ENCODE_H264_CAPABILITY_SLICE_MB_COUNT_BIT_EXT = 0x00200000,
+ 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_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH264CapabilityFlagBitsEXT;
typedef VkFlags VkVideoEncodeH264CapabilityFlagsEXT;
@@ -466,107 +567,339 @@ typedef enum VkVideoEncodeH264OutputModeFlagBitsEXT {
VK_VIDEO_ENCODE_H264_OUTPUT_MODE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoEncodeH264OutputModeFlagBitsEXT;
typedef VkFlags VkVideoEncodeH264OutputModeFlagsEXT;
-
-typedef enum VkVideoEncodeH264CreateFlagBitsEXT {
- VK_VIDEO_ENCODE_H264_CREATE_DEFAULT_EXT = 0,
- VK_VIDEO_ENCODE_H264_CREATE_RESERVED_0_BIT_EXT = 0x00000001,
- VK_VIDEO_ENCODE_H264_CREATE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
-} VkVideoEncodeH264CreateFlagBitsEXT;
-typedef VkFlags VkVideoEncodeH264CreateFlagsEXT;
typedef struct VkVideoEncodeH264CapabilitiesEXT {
VkStructureType sType;
- const void* pNext;
+ void* pNext;
VkVideoEncodeH264CapabilityFlagsEXT flags;
VkVideoEncodeH264InputModeFlagsEXT inputModeFlags;
VkVideoEncodeH264OutputModeFlagsEXT outputModeFlags;
- VkExtent2D minPictureSizeInMbs;
- VkExtent2D maxPictureSizeInMbs;
- VkExtent2D inputImageDataAlignment;
- uint8_t maxNumL0ReferenceForP;
- uint8_t maxNumL0ReferenceForB;
- uint8_t maxNumL1Reference;
- uint8_t qualityLevelCount;
- VkExtensionProperties stdExtensionVersion;
+ uint8_t maxPPictureL0ReferenceCount;
+ uint8_t maxBPictureL0ReferenceCount;
+ uint8_t maxL1ReferenceCount;
+ VkBool32 motionVectorsOverPicBoundariesFlag;
+ uint32_t maxBytesPerPicDenom;
+ uint32_t maxBitsPerMbDenom;
+ uint32_t log2MaxMvLengthHorizontal;
+ uint32_t log2MaxMvLengthVertical;
} VkVideoEncodeH264CapabilitiesEXT;
-typedef struct VkVideoEncodeH264SessionCreateInfoEXT {
- VkStructureType sType;
- const void* pNext;
- VkVideoEncodeH264CreateFlagsEXT flags;
- VkExtent2D maxPictureSizeInMbs;
- const VkExtensionProperties* pStdExtensionVersion;
-} VkVideoEncodeH264SessionCreateInfoEXT;
-
typedef struct VkVideoEncodeH264SessionParametersAddInfoEXT {
VkStructureType sType;
const void* pNext;
- uint32_t spsStdCount;
- const StdVideoH264SequenceParameterSet* pSpsStd;
- uint32_t ppsStdCount;
- const StdVideoH264PictureParameterSet* pPpsStd;
+ uint32_t stdSPSCount;
+ const StdVideoH264SequenceParameterSet* pStdSPSs;
+ uint32_t stdPPSCount;
+ const StdVideoH264PictureParameterSet* pStdPPSs;
} VkVideoEncodeH264SessionParametersAddInfoEXT;
typedef struct VkVideoEncodeH264SessionParametersCreateInfoEXT {
VkStructureType sType;
const void* pNext;
- uint32_t maxSpsStdCount;
- uint32_t maxPpsStdCount;
+ uint32_t maxStdSPSCount;
+ uint32_t maxStdPPSCount;
const VkVideoEncodeH264SessionParametersAddInfoEXT* pParametersAddInfo;
} VkVideoEncodeH264SessionParametersCreateInfoEXT;
typedef struct VkVideoEncodeH264DpbSlotInfoEXT {
- VkStructureType sType;
- const void* pNext;
- int8_t slotIndex;
- const StdVideoEncodeH264PictureInfo* pStdPictureInfo;
-} VkVideoEncodeH264DpbSlotInfoEXT;
-
-typedef struct VkVideoEncodeH264NaluSliceEXT {
VkStructureType sType;
const void* pNext;
- const StdVideoEncodeH264SliceHeader* pSliceHeaderStd;
- uint32_t mbCount;
- uint8_t refFinalList0EntryCount;
- const VkVideoEncodeH264DpbSlotInfoEXT* pRefFinalList0Entries;
- uint8_t refFinalList1EntryCount;
- const VkVideoEncodeH264DpbSlotInfoEXT* pRefFinalList1Entries;
- uint32_t precedingNaluBytes;
- uint8_t minQp;
- uint8_t maxQp;
-} VkVideoEncodeH264NaluSliceEXT;
+ 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;
+} VkVideoEncodeH264NaluSliceInfoEXT;
typedef struct VkVideoEncodeH264VclFrameInfoEXT {
- VkStructureType sType;
- const void* pNext;
- uint8_t refDefaultFinalList0EntryCount;
- const VkVideoEncodeH264DpbSlotInfoEXT* pRefDefaultFinalList0Entries;
- uint8_t refDefaultFinalList1EntryCount;
- const VkVideoEncodeH264DpbSlotInfoEXT* pRefDefaultFinalList1Entries;
- uint32_t naluSliceEntryCount;
- const VkVideoEncodeH264NaluSliceEXT* pNaluSliceEntries;
- const VkVideoEncodeH264DpbSlotInfoEXT* pCurrentPictureInfo;
+ VkStructureType sType;
+ const void* pNext;
+ const VkVideoEncodeH264ReferenceListsInfoEXT* pReferenceFinalLists;
+ uint32_t naluSliceEntryCount;
+ const VkVideoEncodeH264NaluSliceInfoEXT* pNaluSliceEntries;
+ const StdVideoEncodeH264PictureInfo* pCurrentPictureInfo;
} VkVideoEncodeH264VclFrameInfoEXT;
-typedef struct VkVideoEncodeH264EmitPictureParametersEXT {
+typedef struct VkVideoEncodeH264EmitPictureParametersInfoEXT {
VkStructureType sType;
const void* pNext;
uint8_t spsId;
VkBool32 emitSpsEnable;
uint32_t ppsIdEntryCount;
const uint8_t* ppsIdEntries;
-} VkVideoEncodeH264EmitPictureParametersEXT;
+} VkVideoEncodeH264EmitPictureParametersInfoEXT;
-typedef struct VkVideoEncodeH264ProfileEXT {
+typedef struct VkVideoEncodeH264ProfileInfoEXT {
VkStructureType sType;
const void* pNext;
StdVideoH264ProfileIdc stdProfileIdc;
-} VkVideoEncodeH264ProfileEXT;
+} VkVideoEncodeH264ProfileInfoEXT;
+
+typedef struct VkVideoEncodeH264RateControlInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t gopFrameCount;
+ uint32_t idrPeriod;
+ uint32_t consecutiveBFrameCount;
+ VkVideoEncodeH264RateControlStructureEXT rateControlStructure;
+ uint8_t temporalLayerCount;
+} VkVideoEncodeH264RateControlInfoEXT;
+
+typedef struct VkVideoEncodeH264QpEXT {
+ int32_t qpI;
+ int32_t qpP;
+ int32_t qpB;
+} VkVideoEncodeH264QpEXT;
+
+typedef struct VkVideoEncodeH264FrameSizeEXT {
+ uint32_t frameISize;
+ uint32_t framePSize;
+ uint32_t frameBSize;
+} VkVideoEncodeH264FrameSizeEXT;
+
+typedef struct VkVideoEncodeH264RateControlLayerInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint8_t temporalLayerId;
+ VkBool32 useInitialRcQp;
+ VkVideoEncodeH264QpEXT initialRcQp;
+ VkBool32 useMinQp;
+ VkVideoEncodeH264QpEXT minQp;
+ VkBool32 useMaxQp;
+ VkVideoEncodeH264QpEXT maxQp;
+ VkBool32 useMaxFrameSize;
+ VkVideoEncodeH264FrameSizeEXT maxFrameSize;
+} 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_EXTENSION_NAME "VK_EXT_video_encode_h265"
+
+typedef enum VkVideoEncodeH265RateControlStructureEXT {
+ VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_UNKNOWN_EXT = 0,
+ VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_FLAT_EXT = 1,
+ VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_DYADIC_EXT = 2,
+ VK_VIDEO_ENCODE_H265_RATE_CONTROL_STRUCTURE_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkVideoEncodeH265RateControlStructureEXT;
+
+typedef enum VkVideoEncodeH265CapabilityFlagBitsEXT {
+ VK_VIDEO_ENCODE_H265_CAPABILITY_SEPARATE_COLOUR_PLANE_BIT_EXT = 0x00000001,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_SCALING_LISTS_BIT_EXT = 0x00000002,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_SAMPLE_ADAPTIVE_OFFSET_ENABLED_BIT_EXT = 0x00000004,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_PCM_ENABLE_BIT_EXT = 0x00000008,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_SPS_TEMPORAL_MVP_ENABLED_BIT_EXT = 0x00000010,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_HRD_COMPLIANCE_BIT_EXT = 0x00000020,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_INIT_QP_MINUS26_BIT_EXT = 0x00000040,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_LOG2_PARALLEL_MERGE_LEVEL_MINUS2_BIT_EXT = 0x00000080,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_SIGN_DATA_HIDING_ENABLED_BIT_EXT = 0x00000100,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSFORM_SKIP_ENABLED_BIT_EXT = 0x00000200,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSFORM_SKIP_DISABLED_BIT_EXT = 0x00000400,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_PPS_SLICE_CHROMA_QP_OFFSETS_PRESENT_BIT_EXT = 0x00000800,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_PRED_BIT_EXT = 0x00001000,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_BIPRED_BIT_EXT = 0x00002000,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_WEIGHTED_PRED_NO_TABLE_BIT_EXT = 0x00004000,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_TRANSQUANT_BYPASS_ENABLED_BIT_EXT = 0x00008000,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_ENTROPY_CODING_SYNC_ENABLED_BIT_EXT = 0x00010000,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_DEBLOCKING_FILTER_OVERRIDE_ENABLED_BIT_EXT = 0x00020000,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILE_PER_FRAME_BIT_EXT = 0x00040000,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_SLICE_PER_TILE_BIT_EXT = 0x00080000,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_MULTIPLE_TILE_PER_SLICE_BIT_EXT = 0x00100000,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_SLICE_SEGMENT_CTB_COUNT_BIT_EXT = 0x00200000,
+ VK_VIDEO_ENCODE_H265_CAPABILITY_ROW_UNALIGNED_SLICE_SEGMENT_BIT_EXT = 0x00400000,
+ 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_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,
+ VK_VIDEO_ENCODE_H265_CTB_SIZE_64_BIT_EXT = 0x00000004,
+ VK_VIDEO_ENCODE_H265_CTB_SIZE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkVideoEncodeH265CtbSizeFlagBitsEXT;
+typedef VkFlags VkVideoEncodeH265CtbSizeFlagsEXT;
+
+typedef enum VkVideoEncodeH265TransformBlockSizeFlagBitsEXT {
+ VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_4_BIT_EXT = 0x00000001,
+ VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_8_BIT_EXT = 0x00000002,
+ VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_16_BIT_EXT = 0x00000004,
+ VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_32_BIT_EXT = 0x00000008,
+ VK_VIDEO_ENCODE_H265_TRANSFORM_BLOCK_SIZE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkVideoEncodeH265TransformBlockSizeFlagBitsEXT;
+typedef VkFlags VkVideoEncodeH265TransformBlockSizeFlagsEXT;
+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;
+} VkVideoEncodeH265CapabilitiesEXT;
+
+typedef struct VkVideoEncodeH265SessionParametersAddInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t stdVPSCount;
+ const StdVideoH265VideoParameterSet* pStdVPSs;
+ uint32_t stdSPSCount;
+ const StdVideoH265SequenceParameterSet* pStdSPSs;
+ uint32_t stdPPSCount;
+ const StdVideoH265PictureParameterSet* pStdPPSs;
+} VkVideoEncodeH265SessionParametersAddInfoEXT;
+
+typedef struct VkVideoEncodeH265SessionParametersCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t maxStdVPSCount;
+ uint32_t maxStdSPSCount;
+ uint32_t maxStdPPSCount;
+ 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;
+} VkVideoEncodeH265NaluSliceSegmentInfoEXT;
+
+typedef struct VkVideoEncodeH265VclFrameInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ const VkVideoEncodeH265ReferenceListsInfoEXT* pReferenceFinalLists;
+ uint32_t naluSliceSegmentEntryCount;
+ const VkVideoEncodeH265NaluSliceSegmentInfoEXT* pNaluSliceSegmentEntries;
+ const StdVideoEncodeH265PictureInfo* pCurrentPictureInfo;
+} 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 VkVideoEncodeH265ProfileInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ StdVideoH265ProfileIdc stdProfileIdc;
+} VkVideoEncodeH265ProfileInfoEXT;
+
+typedef struct VkVideoEncodeH265RateControlInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t gopFrameCount;
+ uint32_t idrPeriod;
+ uint32_t consecutiveBFrameCount;
+ VkVideoEncodeH265RateControlStructureEXT rateControlStructure;
+ uint8_t subLayerCount;
+} VkVideoEncodeH265RateControlInfoEXT;
+
+typedef struct VkVideoEncodeH265QpEXT {
+ int32_t qpI;
+ int32_t qpP;
+ int32_t qpB;
+} VkVideoEncodeH265QpEXT;
+
+typedef struct VkVideoEncodeH265FrameSizeEXT {
+ uint32_t frameISize;
+ uint32_t framePSize;
+ uint32_t frameBSize;
+} VkVideoEncodeH265FrameSizeEXT;
+
+typedef struct VkVideoEncodeH265RateControlLayerInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint8_t temporalId;
+ VkBool32 useInitialRcQp;
+ VkVideoEncodeH265QpEXT initialRcQp;
+ VkBool32 useMinQp;
+ VkVideoEncodeH265QpEXT minQp;
+ VkBool32 useMaxQp;
+ VkVideoEncodeH265QpEXT maxQp;
+ VkBool32 useMaxFrameSize;
+ VkVideoEncodeH265FrameSizeEXT maxFrameSize;
+} 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 3
+#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 {
@@ -576,43 +909,34 @@ typedef enum VkVideoDecodeH264PictureLayoutFlagBitsEXT {
VK_VIDEO_DECODE_H264_PICTURE_LAYOUT_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkVideoDecodeH264PictureLayoutFlagBitsEXT;
typedef VkFlags VkVideoDecodeH264PictureLayoutFlagsEXT;
-typedef VkFlags VkVideoDecodeH264CreateFlagsEXT;
-typedef struct VkVideoDecodeH264ProfileEXT {
- VkStructureType sType;
- const void* pNext;
- StdVideoH264ProfileIdc stdProfileIdc;
- VkVideoDecodeH264PictureLayoutFlagsEXT pictureLayout;
-} VkVideoDecodeH264ProfileEXT;
+typedef struct VkVideoDecodeH264ProfileInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ StdVideoH264ProfileIdc stdProfileIdc;
+ VkVideoDecodeH264PictureLayoutFlagBitsEXT pictureLayout;
+} VkVideoDecodeH264ProfileInfoEXT;
typedef struct VkVideoDecodeH264CapabilitiesEXT {
- VkStructureType sType;
- void* pNext;
- uint32_t maxLevel;
- VkOffset2D fieldOffsetGranularity;
- VkExtensionProperties stdExtensionVersion;
+ VkStructureType sType;
+ void* pNext;
+ StdVideoH264LevelIdc maxLevelIdc;
+ VkOffset2D fieldOffsetGranularity;
} VkVideoDecodeH264CapabilitiesEXT;
-typedef struct VkVideoDecodeH264SessionCreateInfoEXT {
- VkStructureType sType;
- const void* pNext;
- VkVideoDecodeH264CreateFlagsEXT flags;
- const VkExtensionProperties* pStdExtensionVersion;
-} VkVideoDecodeH264SessionCreateInfoEXT;
-
typedef struct VkVideoDecodeH264SessionParametersAddInfoEXT {
VkStructureType sType;
const void* pNext;
- uint32_t spsStdCount;
- const StdVideoH264SequenceParameterSet* pSpsStd;
- uint32_t ppsStdCount;
- const StdVideoH264PictureParameterSet* pPpsStd;
+ uint32_t stdSPSCount;
+ const StdVideoH264SequenceParameterSet* pStdSPSs;
+ uint32_t stdPPSCount;
+ const StdVideoH264PictureParameterSet* pStdPPSs;
} VkVideoDecodeH264SessionParametersAddInfoEXT;
typedef struct VkVideoDecodeH264SessionParametersCreateInfoEXT {
VkStructureType sType;
const void* pNext;
- uint32_t maxSpsStdCount;
- uint32_t maxPpsStdCount;
+ uint32_t maxStdSPSCount;
+ uint32_t maxStdPPSCount;
const VkVideoDecodeH264SessionParametersAddInfoEXT* pParametersAddInfo;
} VkVideoDecodeH264SessionParametersCreateInfoEXT;
@@ -620,16 +944,10 @@ typedef struct VkVideoDecodeH264PictureInfoEXT {
VkStructureType sType;
const void* pNext;
const StdVideoDecodeH264PictureInfo* pStdPictureInfo;
- uint32_t slicesCount;
- const uint32_t* pSlicesDataOffsets;
+ uint32_t sliceCount;
+ const uint32_t* pSliceOffsets;
} VkVideoDecodeH264PictureInfoEXT;
-typedef struct VkVideoDecodeH264MvcEXT {
- VkStructureType sType;
- const void* pNext;
- const StdVideoDecodeH264Mvc* pStdMvc;
-} VkVideoDecodeH264MvcEXT;
-
typedef struct VkVideoDecodeH264DpbSlotInfoEXT {
VkStructureType sType;
const void* pNext;
@@ -639,45 +957,38 @@ typedef struct VkVideoDecodeH264DpbSlotInfoEXT {
#define VK_EXT_video_decode_h265 1
-#include "vk_video/vulkan_video_codec_h265std.h"
#include "vk_video/vulkan_video_codec_h265std_decode.h"
-#define VK_EXT_VIDEO_DECODE_H265_SPEC_VERSION 1
+#define VK_EXT_VIDEO_DECODE_H265_SPEC_VERSION 5
#define VK_EXT_VIDEO_DECODE_H265_EXTENSION_NAME "VK_EXT_video_decode_h265"
-typedef VkFlags VkVideoDecodeH265CreateFlagsEXT;
-typedef struct VkVideoDecodeH265ProfileEXT {
+typedef struct VkVideoDecodeH265ProfileInfoEXT {
VkStructureType sType;
const void* pNext;
StdVideoH265ProfileIdc stdProfileIdc;
-} VkVideoDecodeH265ProfileEXT;
+} VkVideoDecodeH265ProfileInfoEXT;
typedef struct VkVideoDecodeH265CapabilitiesEXT {
- VkStructureType sType;
- void* pNext;
- uint32_t maxLevel;
- VkExtensionProperties stdExtensionVersion;
+ VkStructureType sType;
+ void* pNext;
+ StdVideoH265LevelIdc maxLevelIdc;
} VkVideoDecodeH265CapabilitiesEXT;
-typedef struct VkVideoDecodeH265SessionCreateInfoEXT {
- VkStructureType sType;
- const void* pNext;
- VkVideoDecodeH265CreateFlagsEXT flags;
- const VkExtensionProperties* pStdExtensionVersion;
-} VkVideoDecodeH265SessionCreateInfoEXT;
-
typedef struct VkVideoDecodeH265SessionParametersAddInfoEXT {
VkStructureType sType;
const void* pNext;
- uint32_t spsStdCount;
- const StdVideoH265SequenceParameterSet* pSpsStd;
- uint32_t ppsStdCount;
- const StdVideoH265PictureParameterSet* pPpsStd;
+ 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 maxSpsStdCount;
- uint32_t maxPpsStdCount;
+ uint32_t maxStdVPSCount;
+ uint32_t maxStdSPSCount;
+ uint32_t maxStdPPSCount;
const VkVideoDecodeH265SessionParametersAddInfoEXT* pParametersAddInfo;
} VkVideoDecodeH265SessionParametersCreateInfoEXT;
@@ -685,8 +996,8 @@ typedef struct VkVideoDecodeH265PictureInfoEXT {
VkStructureType sType;
const void* pNext;
StdVideoDecodeH265PictureInfo* pStdPictureInfo;
- uint32_t slicesCount;
- const uint32_t* pSlicesDataOffsets;
+ uint32_t sliceCount;
+ const uint32_t* pSliceOffsets;
} VkVideoDecodeH265PictureInfoEXT;
typedef struct VkVideoDecodeH265DpbSlotInfoEXT {
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_core.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_core.h
index 4a595573f21..b9c5e254d21 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_core.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_core.h
@@ -2,7 +2,7 @@
#define VULKAN_CORE_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -72,10 +72,10 @@ 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 193
+#define VK_HEADER_VERSION 235
// Complete version of this file
-#define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 2, VK_HEADER_VERSION)
+#define VK_HEADER_VERSION_COMPLETE VK_MAKE_API_VERSION(0, 1, 3, VK_HEADER_VERSION)
// DEPRECATED: This define is deprecated. VK_API_VERSION_MAJOR should be used instead.
#define VK_VERSION_MAJOR(version) ((uint32_t)(version) >> 22)
@@ -120,7 +120,6 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorSet)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDescriptorPool)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkFramebuffer)
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool)
-#define VK_UUID_SIZE 16U
#define VK_ATTACHMENT_UNUSED (~0U)
#define VK_FALSE 0U
#define VK_LOD_CLAMP_NONE 1000.0F
@@ -131,10 +130,11 @@ VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkCommandPool)
#define VK_TRUE 1U
#define VK_WHOLE_SIZE (~0ULL)
#define VK_MAX_MEMORY_TYPES 32U
-#define VK_MAX_MEMORY_HEAPS 16U
#define VK_MAX_PHYSICAL_DEVICE_NAME_SIZE 256U
+#define VK_UUID_SIZE 16U
#define VK_MAX_EXTENSION_NAME_SIZE 256U
#define VK_MAX_DESCRIPTION_SIZE 256U
+#define VK_MAX_MEMORY_HEAPS 16U
typedef enum VkResult {
VK_SUCCESS = 0,
@@ -160,6 +160,7 @@ typedef enum VkResult {
VK_ERROR_INVALID_EXTERNAL_HANDLE = -1000072003,
VK_ERROR_FRAGMENTATION = -1000161000,
VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS = -1000257000,
+ VK_PIPELINE_COMPILE_REQUIRED = 1000297000,
VK_ERROR_SURFACE_LOST_KHR = -1000000000,
VK_ERROR_NATIVE_WINDOW_IN_USE_KHR = -1000000001,
VK_SUBOPTIMAL_KHR = 1000001003,
@@ -167,20 +168,40 @@ 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_EXT = -1000174001,
+ VK_ERROR_NOT_PERMITTED_KHR = -1000174001,
VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT = -1000255000,
VK_THREAD_IDLE_KHR = 1000268000,
VK_THREAD_DONE_KHR = 1000268001,
VK_OPERATION_DEFERRED_KHR = 1000268002,
VK_OPERATION_NOT_DEFERRED_KHR = 1000268003,
- VK_PIPELINE_COMPILE_REQUIRED_EXT = 1000297000,
+ 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,
VK_ERROR_FRAGMENTATION_EXT = VK_ERROR_FRAGMENTATION,
+ VK_ERROR_NOT_PERMITTED_EXT = VK_ERROR_NOT_PERMITTED_KHR,
VK_ERROR_INVALID_DEVICE_ADDRESS_EXT = VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS,
VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS_KHR = VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS,
- VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT = VK_PIPELINE_COMPILE_REQUIRED_EXT,
+ VK_PIPELINE_COMPILE_REQUIRED_EXT = VK_PIPELINE_COMPILE_REQUIRED,
+ VK_ERROR_PIPELINE_COMPILE_REQUIRED_EXT = VK_PIPELINE_COMPILE_REQUIRED,
VK_RESULT_MAX_ENUM = 0x7FFFFFFF
} VkResult;
@@ -349,6 +370,58 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_BUFFER_OPAQUE_CAPTURE_ADDRESS_CREATE_INFO = 1000257002,
VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO = 1000257003,
VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO = 1000257004,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_FEATURES = 53,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_3_PROPERTIES = 54,
+ VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO = 1000192000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES = 1000215000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES = 1000245000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES = 1000276000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES = 1000295000,
+ VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO = 1000295001,
+ VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO = 1000295002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES = 1000297000,
+ VK_STRUCTURE_TYPE_MEMORY_BARRIER_2 = 1000314000,
+ VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2 = 1000314001,
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2 = 1000314002,
+ VK_STRUCTURE_TYPE_DEPENDENCY_INFO = 1000314003,
+ VK_STRUCTURE_TYPE_SUBMIT_INFO_2 = 1000314004,
+ VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO = 1000314005,
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO = 1000314006,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES = 1000314007,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES = 1000325000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES = 1000335000,
+ VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2 = 1000337000,
+ VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2 = 1000337001,
+ VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2 = 1000337002,
+ VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2 = 1000337003,
+ VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2 = 1000337004,
+ VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2 = 1000337005,
+ VK_STRUCTURE_TYPE_BUFFER_COPY_2 = 1000337006,
+ VK_STRUCTURE_TYPE_IMAGE_COPY_2 = 1000337007,
+ VK_STRUCTURE_TYPE_IMAGE_BLIT_2 = 1000337008,
+ VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2 = 1000337009,
+ VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2 = 1000337010,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES = 1000225000,
+ VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO = 1000225001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES = 1000225002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES = 1000138000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES = 1000138001,
+ VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK = 1000138002,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO = 1000138003,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES = 1000066000,
+ VK_STRUCTURE_TYPE_RENDERING_INFO = 1000044000,
+ VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO = 1000044001,
+ VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO = 1000044002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES = 1000044003,
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO = 1000044004,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES = 1000280000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES = 1000280001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES = 1000281001,
+ VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3 = 1000360000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES = 1000413000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_PROPERTIES = 1000413001,
+ VK_STRUCTURE_TYPE_DEVICE_BUFFER_MEMORY_REQUIREMENTS = 1000413002,
+ VK_STRUCTURE_TYPE_DEVICE_IMAGE_MEMORY_REQUIREMENTS = 1000413003,
VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR = 1000001000,
VK_STRUCTURE_TYPE_PRESENT_INFO_KHR = 1000001001,
VK_STRUCTURE_TYPE_DEVICE_GROUP_PRESENT_CAPABILITIES_KHR = 1000060007,
@@ -371,19 +444,19 @@ typedef enum VkStructureType {
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_KHR = 1000023000,
+ 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_KHR = 1000023002,
+ VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR = 1000023002,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_GET_MEMORY_PROPERTIES_KHR = 1000023003,
+ VK_STRUCTURE_TYPE_VIDEO_SESSION_MEMORY_REQUIREMENTS_KHR = 1000023003,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_BIND_MEMORY_KHR = 1000023004,
+ 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,
@@ -404,13 +477,13 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_VIDEO_CODING_CONTROL_INFO_KHR = 1000023010,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_KHR = 1000023011,
+ VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR = 1000023011,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_QUEUE_FAMILY_PROPERTIES_2_KHR = 1000023012,
+ VK_STRUCTURE_TYPE_QUEUE_FAMILY_VIDEO_PROPERTIES_KHR = 1000023012,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_PROFILES_KHR = 1000023013,
+ 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,
@@ -419,8 +492,17 @@ typedef enum VkStructureType {
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,
@@ -436,54 +518,91 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_CAPABILITIES_EXT = 1000038000,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_CREATE_INFO_EXT = 1000038001,
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT = 1000038001,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_CREATE_INFO_EXT = 1000038002,
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT = 1000038002,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_SESSION_PARAMETERS_ADD_INFO_EXT = 1000038003,
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT = 1000038003,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_VCL_FRAME_INFO_EXT = 1000038004,
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT = 1000038004,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_DPB_SLOT_INFO_EXT = 1000038005,
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_INFO_EXT = 1000038005,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_NALU_SLICE_EXT = 1000038006,
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_INFO_EXT = 1000038006,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_EMIT_PICTURE_PARAMETERS_EXT = 1000038007,
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_EXT = 1000038007,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_EXT = 1000038008,
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_RATE_CONTROL_INFO_EXT = 1000038008,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT = 1000040000,
+ 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
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT = 1000039001,
+#endif
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_SESSION_PARAMETERS_ADD_INFO_EXT = 1000039002,
+#endif
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_VCL_FRAME_INFO_EXT = 1000039003,
+#endif
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_DPB_SLOT_INFO_EXT = 1000039004,
+#endif
+#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
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_SESSION_CREATE_INFO_EXT = 1000040001,
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_RATE_CONTROL_LAYER_INFO_EXT = 1000039010,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT = 1000040002,
+ VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_CAPABILITIES_EXT = 1000040000,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_MVC_EXT = 1000040003,
+ VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PICTURE_INFO_EXT = 1000040001,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_PROFILE_EXT = 1000040004,
+ 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 = 1000040005,
+ 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 = 1000040006,
+ 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 = 1000040007,
+ VK_STRUCTURE_TYPE_VIDEO_DECODE_H264_DPB_SLOT_INFO_EXT = 1000040006,
#endif
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,
+ VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD = 1000044008,
+ VK_STRUCTURE_TYPE_MULTIVIEW_PER_VIEW_ATTRIBUTES_INFO_NVX = 1000044009,
VK_STRUCTURE_TYPE_STREAM_DESCRIPTOR_SURFACE_CREATE_INFO_GGP = 1000049000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CORNER_SAMPLED_IMAGE_FEATURES_NV = 1000050000,
VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO_NV = 1000056000,
@@ -493,9 +612,11 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_WIN32_KEYED_MUTEX_ACQUIRE_RELEASE_INFO_NV = 1000058000,
VK_STRUCTURE_TYPE_VALIDATION_FLAGS_EXT = 1000061000,
VK_STRUCTURE_TYPE_VI_SURFACE_CREATE_INFO_NN = 1000062000,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT = 1000066000,
VK_STRUCTURE_TYPE_IMAGE_VIEW_ASTC_DECODE_MODE_EXT = 1000067000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ASTC_DECODE_FEATURES_EXT = 1000067001,
+ VK_STRUCTURE_TYPE_PIPELINE_ROBUSTNESS_CREATE_INFO_EXT = 1000068000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_FEATURES_EXT = 1000068001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_ROBUSTNESS_PROPERTIES_EXT = 1000068002,
VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073000,
VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR = 1000073001,
VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR = 1000073002,
@@ -565,10 +686,7 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_IMPORT_ANDROID_HARDWARE_BUFFER_INFO_ANDROID = 1000129003,
VK_STRUCTURE_TYPE_MEMORY_GET_ANDROID_HARDWARE_BUFFER_INFO_ANDROID = 1000129004,
VK_STRUCTURE_TYPE_EXTERNAL_FORMAT_ANDROID = 1000129005,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT = 1000138000,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT = 1000138001,
- VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT = 1000138002,
- VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT = 1000138003,
+ VK_STRUCTURE_TYPE_ANDROID_HARDWARE_BUFFER_FORMAT_PROPERTIES_2_ANDROID = 1000129006,
VK_STRUCTURE_TYPE_SAMPLE_LOCATIONS_INFO_EXT = 1000143000,
VK_STRUCTURE_TYPE_RENDER_PASS_SAMPLE_LOCATIONS_BEGIN_INFO_EXT = 1000143001,
VK_STRUCTURE_TYPE_PIPELINE_SAMPLE_LOCATIONS_STATE_CREATE_INFO_EXT = 1000143002,
@@ -607,6 +725,7 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_LIST_CREATE_INFO_EXT = 1000158003,
VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT = 1000158004,
VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_PROPERTIES_EXT = 1000158005,
+ VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_2_EXT = 1000158006,
VK_STRUCTURE_TYPE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160000,
VK_STRUCTURE_TYPE_SHADER_MODULE_VALIDATION_CACHE_CREATE_INFO_EXT = 1000160001,
#ifdef VK_ENABLE_BETA_EXTENSIONS
@@ -634,7 +753,6 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_PIPELINE_REPRESENTATIVE_FRAGMENT_TEST_STATE_CREATE_INFO_NV = 1000166001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_IMAGE_FORMAT_INFO_EXT = 1000170000,
VK_STRUCTURE_TYPE_FILTER_CUBIC_IMAGE_VIEW_IMAGE_FORMAT_PROPERTIES_EXT = 1000170001,
- VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = 1000174000,
VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT = 1000178000,
VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT = 1000178001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT = 1000178002,
@@ -646,33 +764,31 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_CAPABILITIES_EXT = 1000187000,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_CREATE_INFO_EXT = 1000187001,
-#endif
-#ifdef VK_ENABLE_BETA_EXTENSIONS
- VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_SESSION_PARAMETERS_CREATE_INFO_EXT = 1000187002,
+ 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 = 1000187003,
+ 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_EXT = 1000187004,
+ 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 = 1000187005,
+ 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 = 1000187006,
+ VK_STRUCTURE_TYPE_VIDEO_DECODE_H265_DPB_SLOT_INFO_EXT = 1000187005,
#endif
+ 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,
VK_STRUCTURE_TYPE_DEVICE_MEMORY_OVERALLOCATION_CREATE_INFO_AMD = 1000189000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_PROPERTIES_EXT = 1000190000,
VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_DIVISOR_STATE_CREATE_INFO_EXT = 1000190001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_ATTRIBUTE_DIVISOR_FEATURES_EXT = 1000190002,
VK_STRUCTURE_TYPE_PRESENT_FRAME_TOKEN_GGP = 1000191000,
- VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT = 1000192000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COMPUTE_SHADER_DERIVATIVES_FEATURES_NV = 1000201000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_NV = 1000202000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_NV = 1000202001,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV = 1000203000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_IMAGE_FOOTPRINT_FEATURES_NV = 1000204000,
VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_EXCLUSIVE_SCISSOR_STATE_CREATE_INFO_NV = 1000205000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXCLUSIVE_SCISSOR_FEATURES_NV = 1000205002,
@@ -689,14 +805,10 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_DISPLAY_NATIVE_HDR_SURFACE_CAPABILITIES_AMD = 1000213000,
VK_STRUCTURE_TYPE_SWAPCHAIN_DISPLAY_NATIVE_HDR_CREATE_INFO_AMD = 1000213001,
VK_STRUCTURE_TYPE_IMAGEPIPE_SURFACE_CREATE_INFO_FUCHSIA = 1000214000,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR = 1000215000,
VK_STRUCTURE_TYPE_METAL_SURFACE_CREATE_INFO_EXT = 1000217000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_FEATURES_EXT = 1000218000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_PROPERTIES_EXT = 1000218001,
VK_STRUCTURE_TYPE_RENDER_PASS_FRAGMENT_DENSITY_MAP_CREATE_INFO_EXT = 1000218002,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT = 1000225000,
- VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT = 1000225001,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT = 1000225002,
VK_STRUCTURE_TYPE_FRAGMENT_SHADING_RATE_ATTACHMENT_INFO_KHR = 1000226000,
VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_STATE_CREATE_INFO_KHR = 1000226001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_PROPERTIES_KHR = 1000226002,
@@ -712,7 +824,6 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEDICATED_ALLOCATION_IMAGE_ALIASING_FEATURES_NV = 1000240000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT = 1000244000,
VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_CREATE_INFO_EXT = 1000244002,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT = 1000245000,
VK_STRUCTURE_TYPE_VALIDATION_FEATURES_EXT = 1000247000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_WAIT_FEATURES_KHR = 1000248000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COOPERATIVE_MATRIX_FEATURES_NV = 1000249000,
@@ -743,7 +854,6 @@ 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_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT = 1000276000,
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,
@@ -754,10 +864,7 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_GENERATED_COMMANDS_FEATURES_NV = 1000277007,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INHERITED_VIEWPORT_SCISSOR_FEATURES_NV = 1000278000,
VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_VIEWPORT_SCISSOR_INFO_NV = 1000278001,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR = 1000280000,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR = 1000280001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_FEATURES_EXT = 1000281000,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT = 1000281001,
VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDER_PASS_TRANSFORM_INFO_QCOM = 1000282000,
VK_STRUCTURE_TYPE_RENDER_PASS_TRANSFORM_BEGIN_INFO_QCOM = 1000282001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEVICE_MEMORY_REPORT_FEATURES_EXT = 1000284000,
@@ -769,87 +876,202 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_PROPERTIES_EXT = 1000287001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT = 1000287002,
VK_STRUCTURE_TYPE_PIPELINE_LIBRARY_CREATE_INFO_KHR = 1000290000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_BARRIER_FEATURES_NV = 1000292000,
+ VK_STRUCTURE_TYPE_SURFACE_CAPABILITIES_PRESENT_BARRIER_NV = 1000292001,
+ VK_STRUCTURE_TYPE_SWAPCHAIN_PRESENT_BARRIER_CREATE_INFO_NV = 1000292002,
VK_STRUCTURE_TYPE_PRESENT_ID_KHR = 1000294000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRESENT_ID_FEATURES_KHR = 1000294001,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT = 1000295000,
- VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT = 1000295001,
- VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT = 1000295002,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT = 1000297000,
#ifdef VK_ENABLE_BETA_EXTENSIONS
VK_STRUCTURE_TYPE_VIDEO_ENCODE_INFO_KHR = 1000299000,
#endif
#ifdef VK_ENABLE_BETA_EXTENSIONS
VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_INFO_KHR = 1000299001,
#endif
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_RATE_CONTROL_LAYER_INFO_KHR = 1000299002,
+#endif
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_CAPABILITIES_KHR = 1000299003,
+#endif
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+ VK_STRUCTURE_TYPE_VIDEO_ENCODE_USAGE_INFO_KHR = 1000299004,
+#endif
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DIAGNOSTICS_CONFIG_FEATURES_NV = 1000300000,
VK_STRUCTURE_TYPE_DEVICE_DIAGNOSTICS_CONFIG_CREATE_INFO_NV = 1000300001,
- VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR = 1000314000,
- VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2_KHR = 1000314001,
- VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2_KHR = 1000314002,
- VK_STRUCTURE_TYPE_DEPENDENCY_INFO_KHR = 1000314003,
- VK_STRUCTURE_TYPE_SUBMIT_INFO_2_KHR = 1000314004,
- VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO_KHR = 1000314005,
- VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO_KHR = 1000314006,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR = 1000314007,
+ 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,
+ VK_STRUCTURE_TYPE_EXPORT_METAL_COMMAND_QUEUE_INFO_EXT = 1000311003,
+ VK_STRUCTURE_TYPE_EXPORT_METAL_BUFFER_INFO_EXT = 1000311004,
+ VK_STRUCTURE_TYPE_IMPORT_METAL_BUFFER_INFO_EXT = 1000311005,
+ VK_STRUCTURE_TYPE_EXPORT_METAL_TEXTURE_INFO_EXT = 1000311006,
+ VK_STRUCTURE_TYPE_IMPORT_METAL_TEXTURE_INFO_EXT = 1000311007,
+ VK_STRUCTURE_TYPE_EXPORT_METAL_IO_SURFACE_INFO_EXT = 1000311008,
+ VK_STRUCTURE_TYPE_IMPORT_METAL_IO_SURFACE_INFO_EXT = 1000311009,
+ VK_STRUCTURE_TYPE_EXPORT_METAL_SHARED_EVENT_INFO_EXT = 1000311010,
+ VK_STRUCTURE_TYPE_IMPORT_METAL_SHARED_EVENT_INFO_EXT = 1000311011,
VK_STRUCTURE_TYPE_QUEUE_FAMILY_CHECKPOINT_PROPERTIES_2_NV = 1000314008,
VK_STRUCTURE_TYPE_CHECKPOINT_DATA_2_NV = 1000314009,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_PROPERTIES_EXT = 1000316000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_DENSITY_MAP_PROPERTIES_EXT = 1000316001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_BUFFER_FEATURES_EXT = 1000316002,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_ADDRESS_INFO_EXT = 1000316003,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_GET_INFO_EXT = 1000316004,
+ VK_STRUCTURE_TYPE_BUFFER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316005,
+ VK_STRUCTURE_TYPE_IMAGE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316006,
+ VK_STRUCTURE_TYPE_IMAGE_VIEW_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316007,
+ VK_STRUCTURE_TYPE_SAMPLER_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316008,
+ VK_STRUCTURE_TYPE_OPAQUE_CAPTURE_DESCRIPTOR_DATA_CREATE_INFO_EXT = 1000316010,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_INFO_EXT = 1000316011,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_BUFFER_BINDING_PUSH_DESCRIPTOR_BUFFER_HANDLE_EXT = 1000316012,
+ VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_CAPTURE_DESCRIPTOR_DATA_INFO_EXT = 1000316009,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_FEATURES_EXT = 1000320000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GRAPHICS_PIPELINE_LIBRARY_PROPERTIES_EXT = 1000320001,
+ VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_LIBRARY_CREATE_INFO_EXT = 1000320002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_FEATURES_AMD = 1000321000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR = 1000203000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_PROPERTIES_KHR = 1000322000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_FEATURES_KHR = 1000323000,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR = 1000325000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_PROPERTIES_NV = 1000326000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_ENUMS_FEATURES_NV = 1000326001,
VK_STRUCTURE_TYPE_PIPELINE_FRAGMENT_SHADING_RATE_ENUM_STATE_CREATE_INFO_NV = 1000326002,
VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_GEOMETRY_MOTION_TRIANGLES_DATA_NV = 1000327000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MOTION_BLUR_FEATURES_NV = 1000327001,
VK_STRUCTURE_TYPE_ACCELERATION_STRUCTURE_MOTION_INFO_NV = 1000327002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT = 1000328000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_PROPERTIES_EXT = 1000328001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_YCBCR_2_PLANE_444_FORMATS_FEATURES_EXT = 1000330000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_FEATURES_EXT = 1000332000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_2_PROPERTIES_EXT = 1000332001,
VK_STRUCTURE_TYPE_COPY_COMMAND_TRANSFORM_INFO_QCOM = 1000333000,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT = 1000335000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_WORKGROUP_MEMORY_EXPLICIT_LAYOUT_FEATURES_KHR = 1000336000,
- VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR = 1000337000,
- VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR = 1000337001,
- VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR = 1000337002,
- VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR = 1000337003,
- VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR = 1000337004,
- VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR = 1000337005,
- VK_STRUCTURE_TYPE_BUFFER_COPY_2_KHR = 1000337006,
- VK_STRUCTURE_TYPE_IMAGE_COPY_2_KHR = 1000337007,
- VK_STRUCTURE_TYPE_IMAGE_BLIT_2_KHR = 1000337008,
- VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR = 1000337009,
- VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR = 1000337010,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_FEATURES_EXT = 1000338000,
+ VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_CONTROL_EXT = 1000338001,
+ VK_STRUCTURE_TYPE_SUBRESOURCE_LAYOUT_2_EXT = 1000338002,
+ VK_STRUCTURE_TYPE_IMAGE_SUBRESOURCE_2_EXT = 1000338003,
+ VK_STRUCTURE_TYPE_IMAGE_COMPRESSION_PROPERTIES_EXT = 1000338004,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_FEATURES_EXT = 1000339000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_4444_FORMATS_FEATURES_EXT = 1000340000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT = 1000341000,
+ VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT = 1000341001,
+ VK_STRUCTURE_TYPE_DEVICE_FAULT_INFO_EXT = 1000341002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RGBA10X6_FORMATS_FEATURES_EXT = 1000344000,
VK_STRUCTURE_TYPE_DIRECTFB_SURFACE_CREATE_INFO_EXT = 1000346000,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE = 1000351000,
- VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE = 1000351002,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VERTEX_INPUT_DYNAMIC_STATE_FEATURES_EXT = 1000352000,
VK_STRUCTURE_TYPE_VERTEX_INPUT_BINDING_DESCRIPTION_2_EXT = 1000352001,
VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT = 1000352002,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT = 1000353000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ADDRESS_BINDING_REPORT_FEATURES_EXT = 1000354000,
+ VK_STRUCTURE_TYPE_DEVICE_ADDRESS_BINDING_CALLBACK_DATA_EXT = 1000354001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLIP_CONTROL_FEATURES_EXT = 1000355000,
+ VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_DEPTH_CLIP_CONTROL_CREATE_INFO_EXT = 1000355001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVE_TOPOLOGY_LIST_RESTART_FEATURES_EXT = 1000356000,
VK_STRUCTURE_TYPE_IMPORT_MEMORY_ZIRCON_HANDLE_INFO_FUCHSIA = 1000364000,
VK_STRUCTURE_TYPE_MEMORY_ZIRCON_HANDLE_PROPERTIES_FUCHSIA = 1000364001,
VK_STRUCTURE_TYPE_MEMORY_GET_ZIRCON_HANDLE_INFO_FUCHSIA = 1000364002,
VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_ZIRCON_HANDLE_INFO_FUCHSIA = 1000365000,
VK_STRUCTURE_TYPE_SEMAPHORE_GET_ZIRCON_HANDLE_INFO_FUCHSIA = 1000365001,
+ VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CREATE_INFO_FUCHSIA = 1000366000,
+ VK_STRUCTURE_TYPE_IMPORT_MEMORY_BUFFER_COLLECTION_FUCHSIA = 1000366001,
+ VK_STRUCTURE_TYPE_BUFFER_COLLECTION_IMAGE_CREATE_INFO_FUCHSIA = 1000366002,
+ VK_STRUCTURE_TYPE_BUFFER_COLLECTION_PROPERTIES_FUCHSIA = 1000366003,
+ VK_STRUCTURE_TYPE_BUFFER_CONSTRAINTS_INFO_FUCHSIA = 1000366004,
+ VK_STRUCTURE_TYPE_BUFFER_COLLECTION_BUFFER_CREATE_INFO_FUCHSIA = 1000366005,
+ VK_STRUCTURE_TYPE_IMAGE_CONSTRAINTS_INFO_FUCHSIA = 1000366006,
+ VK_STRUCTURE_TYPE_IMAGE_FORMAT_CONSTRAINTS_INFO_FUCHSIA = 1000366007,
+ VK_STRUCTURE_TYPE_SYSMEM_COLOR_SPACE_FUCHSIA = 1000366008,
+ VK_STRUCTURE_TYPE_BUFFER_COLLECTION_CONSTRAINTS_INFO_FUCHSIA = 1000366009,
VK_STRUCTURE_TYPE_SUBPASS_SHADING_PIPELINE_CREATE_INFO_HUAWEI = 1000369000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_FEATURES_HUAWEI = 1000369001,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_SHADING_PROPERTIES_HUAWEI = 1000369002,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INVOCATION_MASK_FEATURES_HUAWEI = 1000370000,
VK_STRUCTURE_TYPE_MEMORY_GET_REMOTE_ADDRESS_INFO_NV = 1000371000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_RDMA_FEATURES_NV = 1000371001,
+ VK_STRUCTURE_TYPE_PIPELINE_PROPERTIES_IDENTIFIER_EXT = 1000372000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_PROPERTIES_FEATURES_EXT = 1000372001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_FEATURES_EXT = 1000376000,
+ VK_STRUCTURE_TYPE_SUBPASS_RESOLVE_PERFORMANCE_QUERY_EXT = 1000376001,
+ VK_STRUCTURE_TYPE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_INFO_EXT = 1000376002,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_2_FEATURES_EXT = 1000377000,
VK_STRUCTURE_TYPE_SCREEN_SURFACE_CREATE_INFO_QNX = 1000378000,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COLOR_WRITE_ENABLE_FEATURES_EXT = 1000381000,
VK_STRUCTURE_TYPE_PIPELINE_COLOR_WRITE_CREATE_INFO_EXT = 1000381001,
- VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT = 1000388000,
- VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT = 1000388001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIMITIVES_GENERATED_QUERY_FEATURES_EXT = 1000382000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_TRACING_MAINTENANCE_1_FEATURES_KHR = 1000386000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_VIEW_MIN_LOD_FEATURES_EXT = 1000391000,
+ VK_STRUCTURE_TYPE_IMAGE_VIEW_MIN_LOD_CREATE_INFO_EXT = 1000391001,
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_MICROMAP_BUILD_INFO_EXT = 1000396000,
+ VK_STRUCTURE_TYPE_MICROMAP_VERSION_INFO_EXT = 1000396001,
+ VK_STRUCTURE_TYPE_COPY_MICROMAP_INFO_EXT = 1000396002,
+ VK_STRUCTURE_TYPE_COPY_MICROMAP_TO_MEMORY_INFO_EXT = 1000396003,
+ VK_STRUCTURE_TYPE_COPY_MEMORY_TO_MICROMAP_INFO_EXT = 1000396004,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_FEATURES_EXT = 1000396005,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPACITY_MICROMAP_PROPERTIES_EXT = 1000396006,
+ 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_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_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,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_CLAMP_ZERO_ONE_FEATURES_EXT = 1000421000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_NON_SEAMLESS_CUBE_MAP_FEATURES_EXT = 1000422000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_FEATURES_QCOM = 1000425000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_DENSITY_MAP_OFFSET_PROPERTIES_QCOM = 1000425001,
+ VK_STRUCTURE_TYPE_SUBPASS_FRAGMENT_DENSITY_MAP_OFFSET_END_INFO_QCOM = 1000425002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_FEATURES_NV = 1000426000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_COPY_MEMORY_INDIRECT_PROPERTIES_NV = 1000426001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_FEATURES_NV = 1000427000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MEMORY_DECOMPRESSION_PROPERTIES_NV = 1000427001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_LINEAR_COLOR_ATTACHMENT_FEATURES_NV = 1000430000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_FEATURES_EXT = 1000437000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_FEATURES_QCOM = 1000440000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_PROCESSING_PROPERTIES_QCOM = 1000440001,
+ VK_STRUCTURE_TYPE_IMAGE_VIEW_SAMPLE_WEIGHT_CREATE_INFO_QCOM = 1000440002,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_FEATURES_EXT = 1000455000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_3_PROPERTIES_EXT = 1000455001,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBPASS_MERGE_FEEDBACK_FEATURES_EXT = 1000458000,
+ 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_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,
+ VK_STRUCTURE_TYPE_SHADER_MODULE_IDENTIFIER_EXT = 1000462003,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT = 1000342000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_FEATURES_NV = 1000464000,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_OPTICAL_FLOW_PROPERTIES_NV = 1000464001,
+ VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_INFO_NV = 1000464002,
+ VK_STRUCTURE_TYPE_OPTICAL_FLOW_IMAGE_FORMAT_PROPERTIES_NV = 1000464003,
+ VK_STRUCTURE_TYPE_OPTICAL_FLOW_SESSION_CREATE_INFO_NV = 1000464004,
+ VK_STRUCTURE_TYPE_OPTICAL_FLOW_EXECUTE_INFO_NV = 1000464005,
+ 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_TILE_PROPERTIES_FEATURES_QCOM = 1000484000,
+ 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_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,
+ 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_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,
+ VK_STRUCTURE_TYPE_RENDERING_INFO_KHR = VK_STRUCTURE_TYPE_RENDERING_INFO,
+ VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO_KHR = VK_STRUCTURE_TYPE_RENDERING_ATTACHMENT_INFO,
+ VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_PIPELINE_RENDERING_CREATE_INFO,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DYNAMIC_RENDERING_FEATURES,
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO_KHR = VK_STRUCTURE_TYPE_COMMAND_BUFFER_INHERITANCE_RENDERING_INFO,
+ VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_NV = VK_STRUCTURE_TYPE_ATTACHMENT_SAMPLE_COUNT_INFO_AMD,
VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_RENDER_PASS_MULTIVIEW_CREATE_INFO,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_PROPERTIES,
@@ -869,6 +1091,7 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_BIND_SPARSE_INFO,
VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO_KHR = VK_STRUCTURE_TYPE_BIND_BUFFER_MEMORY_DEVICE_GROUP_INFO,
VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO_KHR = VK_STRUCTURE_TYPE_BIND_IMAGE_MEMORY_DEVICE_GROUP_INFO,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXTURE_COMPRESSION_ASTC_HDR_FEATURES,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GROUP_PROPERTIES,
VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_GROUP_DEVICE_CREATE_INFO,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_IMAGE_FORMAT_INFO,
@@ -911,6 +1134,10 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_DEDICATED_ALLOCATE_INFO,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SAMPLER_FILTER_MINMAX_PROPERTIES,
VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_SAMPLER_REDUCTION_MODE_CREATE_INFO,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_FEATURES,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_INLINE_UNIFORM_BLOCK_PROPERTIES,
+ VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK_EXT = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET_INLINE_UNIFORM_BLOCK,
+ VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_INLINE_UNIFORM_BLOCK_CREATE_INFO,
VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_BUFFER_MEMORY_REQUIREMENTS_INFO_2,
VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_IMAGE_MEMORY_REQUIREMENTS_INFO_2,
VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2_KHR = VK_STRUCTURE_TYPE_IMAGE_SPARSE_MEMORY_REQUIREMENTS_INFO_2,
@@ -932,13 +1159,16 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT_EXT = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_VARIABLE_DESCRIPTOR_COUNT_LAYOUT_SUPPORT,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_3_PROPERTIES,
VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT_KHR = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_SUPPORT,
+ VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEVICE_QUEUE_GLOBAL_PRIORITY_CREATE_INFO_KHR,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_SUBGROUP_EXTENDED_TYPES_FEATURES,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_8BIT_STORAGE_FEATURES,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_ATOMIC_INT64_FEATURES,
+ VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_CREATION_FEEDBACK_CREATE_INFO,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FLOAT_CONTROLS_PROPERTIES,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DEPTH_STENCIL_RESOLVE_PROPERTIES,
VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE_KHR = VK_STRUCTURE_TYPE_SUBPASS_DESCRIPTION_DEPTH_STENCIL_RESOLVE,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_NV = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADER_BARYCENTRIC_FEATURES_KHR,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_PROPERTIES,
VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO_KHR = VK_STRUCTURE_TYPE_SEMAPHORE_TYPE_CREATE_INFO,
@@ -947,12 +1177,17 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO_KHR = VK_STRUCTURE_TYPE_SEMAPHORE_SIGNAL_INFO,
VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO_INTEL = VK_STRUCTURE_TYPE_QUERY_POOL_PERFORMANCE_QUERY_CREATE_INFO_INTEL,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_MEMORY_MODEL_FEATURES,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_TERMINATE_INVOCATION_FEATURES,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SCALAR_BLOCK_LAYOUT_FEATURES,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES,
+ VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_REQUIRED_SUBGROUP_SIZE_CREATE_INFO,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_FEATURES,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SEPARATE_DEPTH_STENCIL_LAYOUTS_FEATURES,
VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT_KHR = VK_STRUCTURE_TYPE_ATTACHMENT_REFERENCE_STENCIL_LAYOUT,
VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT_KHR = VK_STRUCTURE_TYPE_ATTACHMENT_DESCRIPTION_STENCIL_LAYOUT,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_ADDRESS_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_EXT,
VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO_EXT = VK_STRUCTURE_TYPE_BUFFER_DEVICE_ADDRESS_INFO,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TOOL_PROPERTIES,
VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_UNIFORM_BUFFER_STANDARD_LAYOUT_FEATURES,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_BUFFER_DEVICE_ADDRESS_FEATURES,
@@ -961,9 +1196,54 @@ typedef enum VkStructureType {
VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO_KHR = VK_STRUCTURE_TYPE_MEMORY_OPAQUE_CAPTURE_ADDRESS_ALLOCATE_INFO,
VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO_KHR = VK_STRUCTURE_TYPE_DEVICE_MEMORY_OPAQUE_CAPTURE_ADDRESS_INFO,
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_HOST_QUERY_RESET_FEATURES,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_DEMOTE_TO_HELPER_INVOCATION_FEATURES,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_FEATURES,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SHADER_INTEGER_DOT_PRODUCT_PROPERTIES,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TEXEL_BUFFER_ALIGNMENT_PROPERTIES,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PRIVATE_DATA_FEATURES,
+ VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_DEVICE_PRIVATE_DATA_CREATE_INFO,
+ VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO_EXT = VK_STRUCTURE_TYPE_PRIVATE_DATA_SLOT_CREATE_INFO,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PIPELINE_CREATION_CACHE_CONTROL_FEATURES,
+ VK_STRUCTURE_TYPE_MEMORY_BARRIER_2_KHR = VK_STRUCTURE_TYPE_MEMORY_BARRIER_2,
+ VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2_KHR = VK_STRUCTURE_TYPE_BUFFER_MEMORY_BARRIER_2,
+ VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2_KHR = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER_2,
+ VK_STRUCTURE_TYPE_DEPENDENCY_INFO_KHR = VK_STRUCTURE_TYPE_DEPENDENCY_INFO,
+ VK_STRUCTURE_TYPE_SUBMIT_INFO_2_KHR = VK_STRUCTURE_TYPE_SUBMIT_INFO_2,
+ VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO,
+ VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO_KHR = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SYNCHRONIZATION_2_FEATURES,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ZERO_INITIALIZE_WORKGROUP_MEMORY_FEATURES,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_IMAGE_ROBUSTNESS_FEATURES,
+ VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2_KHR = VK_STRUCTURE_TYPE_COPY_BUFFER_INFO_2,
+ VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2_KHR = VK_STRUCTURE_TYPE_COPY_IMAGE_INFO_2,
+ VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2_KHR = VK_STRUCTURE_TYPE_COPY_BUFFER_TO_IMAGE_INFO_2,
+ VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2_KHR = VK_STRUCTURE_TYPE_COPY_IMAGE_TO_BUFFER_INFO_2,
+ VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2_KHR = VK_STRUCTURE_TYPE_BLIT_IMAGE_INFO_2,
+ VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2_KHR = VK_STRUCTURE_TYPE_RESOLVE_IMAGE_INFO_2,
+ VK_STRUCTURE_TYPE_BUFFER_COPY_2_KHR = VK_STRUCTURE_TYPE_BUFFER_COPY_2,
+ VK_STRUCTURE_TYPE_IMAGE_COPY_2_KHR = VK_STRUCTURE_TYPE_IMAGE_COPY_2,
+ VK_STRUCTURE_TYPE_IMAGE_BLIT_2_KHR = VK_STRUCTURE_TYPE_IMAGE_BLIT_2,
+ VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2_KHR = VK_STRUCTURE_TYPE_BUFFER_IMAGE_COPY_2,
+ VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2_KHR = VK_STRUCTURE_TYPE_IMAGE_RESOLVE_2,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_ARM = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_FEATURES_EXT,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_VALVE = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MUTABLE_DESCRIPTOR_TYPE_FEATURES_EXT,
+ VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_VALVE = VK_STRUCTURE_TYPE_MUTABLE_DESCRIPTOR_TYPE_CREATE_INFO_EXT,
+ VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3_KHR = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_3,
+ VK_STRUCTURE_TYPE_PIPELINE_INFO_EXT = VK_STRUCTURE_TYPE_PIPELINE_INFO_KHR,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_EXT = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_GLOBAL_PRIORITY_QUERY_FEATURES_KHR,
+ VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_EXT = VK_STRUCTURE_TYPE_QUEUE_FAMILY_GLOBAL_PRIORITY_PROPERTIES_KHR,
+ VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES_KHR = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MAINTENANCE_4_FEATURES,
+ 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_MAX_ENUM = 0x7FFFFFFF
} VkStructureType;
+typedef enum VkPipelineCacheHeaderVersion {
+ VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
+ VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 0x7FFFFFFF
+} VkPipelineCacheHeaderVersion;
+
typedef enum VkImageLayout {
VK_IMAGE_LAYOUT_UNDEFINED = 0,
VK_IMAGE_LAYOUT_GENERAL = 1,
@@ -980,6 +1260,8 @@ typedef enum VkImageLayout {
VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL = 1000241001,
VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL = 1000241002,
VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL = 1000241003,
+ 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,
@@ -1002,8 +1284,7 @@ typedef enum VkImageLayout {
#ifdef VK_ENABLE_BETA_EXTENSIONS
VK_IMAGE_LAYOUT_VIDEO_ENCODE_DPB_KHR = 1000299002,
#endif
- VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR = 1000314000,
- VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR = 1000314001,
+ VK_IMAGE_LAYOUT_ATTACHMENT_FEEDBACK_LOOP_OPTIMAL_EXT = 1000339000,
VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL,
VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL,
VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV = VK_IMAGE_LAYOUT_FRAGMENT_SHADING_RATE_ATTACHMENT_OPTIMAL_KHR,
@@ -1011,6 +1292,8 @@ typedef enum VkImageLayout {
VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_OPTIMAL,
VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_STENCIL_ATTACHMENT_OPTIMAL,
VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_STENCIL_READ_ONLY_OPTIMAL,
+ VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL_KHR = VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL,
+ VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL_KHR = VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL,
VK_IMAGE_LAYOUT_MAX_ENUM = 0x7FFFFFFF
} VkImageLayout;
@@ -1043,6 +1326,7 @@ typedef enum VkObjectType {
VK_OBJECT_TYPE_COMMAND_POOL = 25,
VK_OBJECT_TYPE_SAMPLER_YCBCR_CONVERSION = 1000156000,
VK_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE = 1000085000,
+ VK_OBJECT_TYPE_PRIVATE_DATA_SLOT = 1000295000,
VK_OBJECT_TYPE_SURFACE_KHR = 1000000000,
VK_OBJECT_TYPE_SWAPCHAIN_KHR = 1000001000,
VK_OBJECT_TYPE_DISPLAY_KHR = 1000002000,
@@ -1063,17 +1347,15 @@ typedef enum VkObjectType {
VK_OBJECT_TYPE_PERFORMANCE_CONFIGURATION_INTEL = 1000210000,
VK_OBJECT_TYPE_DEFERRED_OPERATION_KHR = 1000268000,
VK_OBJECT_TYPE_INDIRECT_COMMANDS_LAYOUT_NV = 1000277000,
- VK_OBJECT_TYPE_PRIVATE_DATA_SLOT_EXT = 1000295000,
+ VK_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA = 1000366000,
+ VK_OBJECT_TYPE_MICROMAP_EXT = 1000396000,
+ VK_OBJECT_TYPE_OPTICAL_FLOW_SESSION_NV = 1000464000,
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,
VK_OBJECT_TYPE_MAX_ENUM = 0x7FFFFFFF
} VkObjectType;
-typedef enum VkPipelineCacheHeaderVersion {
- VK_PIPELINE_CACHE_HEADER_VERSION_ONE = 1,
- VK_PIPELINE_CACHE_HEADER_VERSION_MAX_ENUM = 0x7FFFFFFF
-} VkPipelineCacheHeaderVersion;
-
typedef enum VkVendorId {
VK_VENDOR_ID_VIV = 0x10001,
VK_VENDOR_ID_VSI = 0x10002,
@@ -1318,6 +1600,26 @@ typedef enum VkFormat {
VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM = 1000156031,
VK_FORMAT_G16_B16R16_2PLANE_422_UNORM = 1000156032,
VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM = 1000156033,
+ VK_FORMAT_G8_B8R8_2PLANE_444_UNORM = 1000330000,
+ VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16 = 1000330001,
+ VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16 = 1000330002,
+ VK_FORMAT_G16_B16R16_2PLANE_444_UNORM = 1000330003,
+ VK_FORMAT_A4R4G4B4_UNORM_PACK16 = 1000340000,
+ VK_FORMAT_A4B4G4R4_UNORM_PACK16 = 1000340001,
+ VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK = 1000066000,
+ VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK = 1000066001,
+ VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK = 1000066002,
+ VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK = 1000066003,
+ VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK = 1000066004,
+ VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK = 1000066005,
+ VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK = 1000066006,
+ VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK = 1000066007,
+ VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK = 1000066008,
+ VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK = 1000066009,
+ VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK = 1000066010,
+ VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK = 1000066011,
+ VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK = 1000066012,
+ VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK = 1000066013,
VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000,
VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001,
VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002,
@@ -1326,26 +1628,21 @@ typedef enum VkFormat {
VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005,
VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006,
VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007,
- VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT = 1000066000,
- VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT = 1000066001,
- VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT = 1000066002,
- VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT = 1000066003,
- VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT = 1000066004,
- VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT = 1000066005,
- VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT = 1000066006,
- VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT = 1000066007,
- VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT = 1000066008,
- VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT = 1000066009,
- VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT = 1000066010,
- VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT = 1000066011,
- VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT = 1000066012,
- VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT = 1000066013,
- VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT = 1000330000,
- VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT = 1000330001,
- VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT = 1000330002,
- VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT = 1000330003,
- VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT = 1000340000,
- VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT = 1000340001,
+ VK_FORMAT_R16G16_S10_5_NV = 1000464000,
+ VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_4x4_SFLOAT_BLOCK,
+ VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_5x4_SFLOAT_BLOCK,
+ VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_5x5_SFLOAT_BLOCK,
+ VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_6x5_SFLOAT_BLOCK,
+ VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_6x6_SFLOAT_BLOCK,
+ VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_8x5_SFLOAT_BLOCK,
+ VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_8x6_SFLOAT_BLOCK,
+ VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_8x8_SFLOAT_BLOCK,
+ VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x5_SFLOAT_BLOCK,
+ VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x6_SFLOAT_BLOCK,
+ VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x8_SFLOAT_BLOCK,
+ VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_10x10_SFLOAT_BLOCK,
+ VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_12x10_SFLOAT_BLOCK,
+ VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK_EXT = VK_FORMAT_ASTC_12x12_SFLOAT_BLOCK,
VK_FORMAT_G8B8G8R8_422_UNORM_KHR = VK_FORMAT_G8B8G8R8_422_UNORM,
VK_FORMAT_B8G8R8G8_422_UNORM_KHR = VK_FORMAT_B8G8R8G8_422_UNORM,
VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR = VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM,
@@ -1380,6 +1677,12 @@ typedef enum VkFormat {
VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM,
VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR = VK_FORMAT_G16_B16R16_2PLANE_422_UNORM,
VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR = VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM,
+ VK_FORMAT_G8_B8R8_2PLANE_444_UNORM_EXT = VK_FORMAT_G8_B8R8_2PLANE_444_UNORM,
+ VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16_EXT = VK_FORMAT_G10X6_B10X6R10X6_2PLANE_444_UNORM_3PACK16,
+ VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16_EXT = VK_FORMAT_G12X4_B12X4R12X4_2PLANE_444_UNORM_3PACK16,
+ VK_FORMAT_G16_B16R16_2PLANE_444_UNORM_EXT = VK_FORMAT_G16_B16R16_2PLANE_444_UNORM,
+ VK_FORMAT_A4R4G4B4_UNORM_PACK16_EXT = VK_FORMAT_A4R4G4B4_UNORM_PACK16,
+ VK_FORMAT_A4B4G4R4_UNORM_PACK16_EXT = VK_FORMAT_A4B4G4R4_UNORM_PACK16,
VK_FORMAT_MAX_ENUM = 0x7FFFFFFF
} VkFormat;
@@ -1422,6 +1725,12 @@ typedef enum VkQueryType {
#ifdef VK_ENABLE_BETA_EXTENSIONS
VK_QUERY_TYPE_VIDEO_ENCODE_BITSTREAM_BUFFER_RANGE_KHR = 1000299000,
#endif
+ VK_QUERY_TYPE_MESH_PRIMITIVES_GENERATED_EXT = 1000328000,
+ VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT = 1000382000,
+ VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SERIALIZATION_BOTTOM_LEVEL_POINTERS_KHR = 1000386000,
+ VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR = 1000386001,
+ VK_QUERY_TYPE_MICROMAP_SERIALIZATION_SIZE_EXT = 1000396000,
+ VK_QUERY_TYPE_MICROMAP_COMPACTED_SIZE_EXT = 1000396001,
VK_QUERY_TYPE_MAX_ENUM = 0x7FFFFFFF
} VkQueryType;
@@ -1553,6 +1862,21 @@ typedef enum VkDynamicState {
VK_DYNAMIC_STATE_STENCIL_COMPARE_MASK = 6,
VK_DYNAMIC_STATE_STENCIL_WRITE_MASK = 7,
VK_DYNAMIC_STATE_STENCIL_REFERENCE = 8,
+ VK_DYNAMIC_STATE_CULL_MODE = 1000267000,
+ VK_DYNAMIC_STATE_FRONT_FACE = 1000267001,
+ VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY = 1000267002,
+ VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT = 1000267003,
+ VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT = 1000267004,
+ VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE = 1000267005,
+ VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE = 1000267006,
+ VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE = 1000267007,
+ VK_DYNAMIC_STATE_DEPTH_COMPARE_OP = 1000267008,
+ VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE = 1000267009,
+ VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE = 1000267010,
+ VK_DYNAMIC_STATE_STENCIL_OP = 1000267011,
+ VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE = 1000377001,
+ VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE = 1000377002,
+ 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_SAMPLE_LOCATIONS_EXT = 1000143000,
@@ -1562,25 +1886,56 @@ typedef enum VkDynamicState {
VK_DYNAMIC_STATE_EXCLUSIVE_SCISSOR_NV = 1000205001,
VK_DYNAMIC_STATE_FRAGMENT_SHADING_RATE_KHR = 1000226000,
VK_DYNAMIC_STATE_LINE_STIPPLE_EXT = 1000259000,
- VK_DYNAMIC_STATE_CULL_MODE_EXT = 1000267000,
- VK_DYNAMIC_STATE_FRONT_FACE_EXT = 1000267001,
- VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY_EXT = 1000267002,
- VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT = 1000267003,
- VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT = 1000267004,
- VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT = 1000267005,
- VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE_EXT = 1000267006,
- VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT = 1000267007,
- VK_DYNAMIC_STATE_DEPTH_COMPARE_OP_EXT = 1000267008,
- VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE_EXT = 1000267009,
- VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE_EXT = 1000267010,
- VK_DYNAMIC_STATE_STENCIL_OP_EXT = 1000267011,
VK_DYNAMIC_STATE_VERTEX_INPUT_EXT = 1000352000,
VK_DYNAMIC_STATE_PATCH_CONTROL_POINTS_EXT = 1000377000,
- VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT = 1000377001,
- VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT = 1000377002,
VK_DYNAMIC_STATE_LOGIC_OP_EXT = 1000377003,
- VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT = 1000377004,
VK_DYNAMIC_STATE_COLOR_WRITE_ENABLE_EXT = 1000381000,
+ VK_DYNAMIC_STATE_TESSELLATION_DOMAIN_ORIGIN_EXT = 1000455002,
+ VK_DYNAMIC_STATE_DEPTH_CLAMP_ENABLE_EXT = 1000455003,
+ VK_DYNAMIC_STATE_POLYGON_MODE_EXT = 1000455004,
+ VK_DYNAMIC_STATE_RASTERIZATION_SAMPLES_EXT = 1000455005,
+ VK_DYNAMIC_STATE_SAMPLE_MASK_EXT = 1000455006,
+ VK_DYNAMIC_STATE_ALPHA_TO_COVERAGE_ENABLE_EXT = 1000455007,
+ VK_DYNAMIC_STATE_ALPHA_TO_ONE_ENABLE_EXT = 1000455008,
+ VK_DYNAMIC_STATE_LOGIC_OP_ENABLE_EXT = 1000455009,
+ VK_DYNAMIC_STATE_COLOR_BLEND_ENABLE_EXT = 1000455010,
+ VK_DYNAMIC_STATE_COLOR_BLEND_EQUATION_EXT = 1000455011,
+ VK_DYNAMIC_STATE_COLOR_WRITE_MASK_EXT = 1000455012,
+ VK_DYNAMIC_STATE_RASTERIZATION_STREAM_EXT = 1000455013,
+ VK_DYNAMIC_STATE_CONSERVATIVE_RASTERIZATION_MODE_EXT = 1000455014,
+ VK_DYNAMIC_STATE_EXTRA_PRIMITIVE_OVERESTIMATION_SIZE_EXT = 1000455015,
+ VK_DYNAMIC_STATE_DEPTH_CLIP_ENABLE_EXT = 1000455016,
+ VK_DYNAMIC_STATE_SAMPLE_LOCATIONS_ENABLE_EXT = 1000455017,
+ VK_DYNAMIC_STATE_COLOR_BLEND_ADVANCED_EXT = 1000455018,
+ VK_DYNAMIC_STATE_PROVOKING_VERTEX_MODE_EXT = 1000455019,
+ VK_DYNAMIC_STATE_LINE_RASTERIZATION_MODE_EXT = 1000455020,
+ VK_DYNAMIC_STATE_LINE_STIPPLE_ENABLE_EXT = 1000455021,
+ VK_DYNAMIC_STATE_DEPTH_CLIP_NEGATIVE_ONE_TO_ONE_EXT = 1000455022,
+ VK_DYNAMIC_STATE_VIEWPORT_W_SCALING_ENABLE_NV = 1000455023,
+ VK_DYNAMIC_STATE_VIEWPORT_SWIZZLE_NV = 1000455024,
+ VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_ENABLE_NV = 1000455025,
+ VK_DYNAMIC_STATE_COVERAGE_TO_COLOR_LOCATION_NV = 1000455026,
+ VK_DYNAMIC_STATE_COVERAGE_MODULATION_MODE_NV = 1000455027,
+ VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_ENABLE_NV = 1000455028,
+ VK_DYNAMIC_STATE_COVERAGE_MODULATION_TABLE_NV = 1000455029,
+ 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_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,
+ VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT_EXT = VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT,
+ VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT_EXT = VK_DYNAMIC_STATE_SCISSOR_WITH_COUNT,
+ VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE_EXT = VK_DYNAMIC_STATE_VERTEX_INPUT_BINDING_STRIDE,
+ VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_TEST_ENABLE,
+ VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_WRITE_ENABLE,
+ VK_DYNAMIC_STATE_DEPTH_COMPARE_OP_EXT = VK_DYNAMIC_STATE_DEPTH_COMPARE_OP,
+ VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_BOUNDS_TEST_ENABLE,
+ VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE_EXT = VK_DYNAMIC_STATE_STENCIL_TEST_ENABLE,
+ VK_DYNAMIC_STATE_STENCIL_OP_EXT = VK_DYNAMIC_STATE_STENCIL_OP,
+ VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE_EXT = VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE,
+ VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE_EXT = VK_DYNAMIC_STATE_DEPTH_BIAS_ENABLE,
+ VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE_EXT = VK_DYNAMIC_STATE_PRIMITIVE_RESTART_ENABLE,
VK_DYNAMIC_STATE_MAX_ENUM = 0x7FFFFFFF
} VkDynamicState;
@@ -1666,8 +2021,8 @@ typedef enum VkBorderColor {
typedef enum VkFilter {
VK_FILTER_NEAREST = 0,
VK_FILTER_LINEAR = 1,
- VK_FILTER_CUBIC_IMG = 1000015000,
- VK_FILTER_CUBIC_EXT = VK_FILTER_CUBIC_IMG,
+ VK_FILTER_CUBIC_EXT = 1000015000,
+ VK_FILTER_CUBIC_IMG = VK_FILTER_CUBIC_EXT,
VK_FILTER_MAX_ENUM = 0x7FFFFFFF
} VkFilter;
@@ -1699,10 +2054,14 @@ typedef enum VkDescriptorType {
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC = 8,
VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC = 9,
VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT = 10,
- VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT = 1000138000,
+ VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK = 1000138000,
VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_KHR = 1000150000,
VK_DESCRIPTOR_TYPE_ACCELERATION_STRUCTURE_NV = 1000165000,
- VK_DESCRIPTOR_TYPE_MUTABLE_VALVE = 1000351000,
+ VK_DESCRIPTOR_TYPE_SAMPLE_WEIGHT_IMAGE_QCOM = 1000440000,
+ VK_DESCRIPTOR_TYPE_BLOCK_MATCH_IMAGE_QCOM = 1000440001,
+ VK_DESCRIPTOR_TYPE_MUTABLE_EXT = 1000351000,
+ VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK_EXT = VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK,
+ VK_DESCRIPTOR_TYPE_MUTABLE_VALVE = VK_DESCRIPTOR_TYPE_MUTABLE_EXT,
VK_DESCRIPTOR_TYPE_MAX_ENUM = 0x7FFFFFFF
} VkDescriptorType;
@@ -1717,8 +2076,10 @@ typedef enum VkAttachmentLoadOp {
typedef enum VkAttachmentStoreOp {
VK_ATTACHMENT_STORE_OP_STORE = 0,
VK_ATTACHMENT_STORE_OP_DONT_CARE = 1,
- VK_ATTACHMENT_STORE_OP_NONE_EXT = 1000301000,
- VK_ATTACHMENT_STORE_OP_NONE_QCOM = VK_ATTACHMENT_STORE_OP_NONE_EXT,
+ VK_ATTACHMENT_STORE_OP_NONE = 1000301000,
+ VK_ATTACHMENT_STORE_OP_NONE_KHR = VK_ATTACHMENT_STORE_OP_NONE,
+ VK_ATTACHMENT_STORE_OP_NONE_QCOM = VK_ATTACHMENT_STORE_OP_NONE,
+ VK_ATTACHMENT_STORE_OP_NONE_EXT = VK_ATTACHMENT_STORE_OP_NONE,
VK_ATTACHMENT_STORE_OP_MAX_ENUM = 0x7FFFFFFF
} VkAttachmentStoreOp;
@@ -1770,6 +2131,7 @@ typedef enum VkAccessFlagBits {
VK_ACCESS_HOST_WRITE_BIT = 0x00004000,
VK_ACCESS_MEMORY_READ_BIT = 0x00008000,
VK_ACCESS_MEMORY_WRITE_BIT = 0x00010000,
+ VK_ACCESS_NONE = 0,
VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0x02000000,
VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0x04000000,
VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0x08000000,
@@ -1781,10 +2143,10 @@ typedef enum VkAccessFlagBits {
VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR = 0x00800000,
VK_ACCESS_COMMAND_PREPROCESS_READ_BIT_NV = 0x00020000,
VK_ACCESS_COMMAND_PREPROCESS_WRITE_BIT_NV = 0x00040000,
- VK_ACCESS_NONE_KHR = 0,
VK_ACCESS_SHADING_RATE_IMAGE_READ_BIT_NV = VK_ACCESS_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR,
VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_NV = VK_ACCESS_ACCELERATION_STRUCTURE_READ_BIT_KHR,
VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_NV = VK_ACCESS_ACCELERATION_STRUCTURE_WRITE_BIT_KHR,
+ VK_ACCESS_NONE_KHR = VK_ACCESS_NONE,
VK_ACCESS_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkAccessFlagBits;
typedef VkFlags VkAccessFlags;
@@ -1797,6 +2159,7 @@ typedef enum VkImageAspectFlagBits {
VK_IMAGE_ASPECT_PLANE_0_BIT = 0x00000010,
VK_IMAGE_ASPECT_PLANE_1_BIT = 0x00000020,
VK_IMAGE_ASPECT_PLANE_2_BIT = 0x00000040,
+ VK_IMAGE_ASPECT_NONE = 0,
VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT = 0x00000080,
VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT = 0x00000100,
VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT = 0x00000200,
@@ -1804,6 +2167,7 @@ typedef enum VkImageAspectFlagBits {
VK_IMAGE_ASPECT_PLANE_0_BIT_KHR = VK_IMAGE_ASPECT_PLANE_0_BIT,
VK_IMAGE_ASPECT_PLANE_1_BIT_KHR = VK_IMAGE_ASPECT_PLANE_1_BIT,
VK_IMAGE_ASPECT_PLANE_2_BIT_KHR = VK_IMAGE_ASPECT_PLANE_2_BIT,
+ VK_IMAGE_ASPECT_NONE_KHR = VK_IMAGE_ASPECT_NONE,
VK_IMAGE_ASPECT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkImageAspectFlagBits;
typedef VkFlags VkImageAspectFlags;
@@ -1832,7 +2196,6 @@ 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,
- VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = 0x00002000,
#ifdef VK_ENABLE_BETA_EXTENSIONS
VK_FORMAT_FEATURE_VIDEO_DECODE_OUTPUT_BIT_KHR = 0x02000000,
#endif
@@ -1840,6 +2203,7 @@ typedef enum VkFormatFeatureFlagBits {
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,
VK_FORMAT_FEATURE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x40000000,
#ifdef VK_ENABLE_BETA_EXTENSIONS
@@ -1848,6 +2212,7 @@ typedef enum VkFormatFeatureFlagBits {
#ifdef VK_ENABLE_BETA_EXTENSIONS
VK_FORMAT_FEATURE_VIDEO_ENCODE_DPB_BIT_KHR = 0x10000000,
#endif
+ VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT,
VK_FORMAT_FEATURE_TRANSFER_SRC_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_SRC_BIT,
VK_FORMAT_FEATURE_TRANSFER_DST_BIT_KHR = VK_FORMAT_FEATURE_TRANSFER_DST_BIT,
VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT_EXT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_MINMAX_BIT,
@@ -1858,7 +2223,6 @@ typedef enum VkFormatFeatureFlagBits {
VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = VK_FORMAT_FEATURE_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT,
VK_FORMAT_FEATURE_DISJOINT_BIT_KHR = VK_FORMAT_FEATURE_DISJOINT_BIT,
VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT_KHR = VK_FORMAT_FEATURE_COSITED_CHROMA_SAMPLES_BIT,
- VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = VK_FORMAT_FEATURE_SAMPLED_IMAGE_FILTER_CUBIC_BIT_IMG,
VK_FORMAT_FEATURE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkFormatFeatureFlagBits;
typedef VkFlags VkFormatFeatureFlags;
@@ -1879,6 +2243,10 @@ typedef enum VkImageCreateFlagBits {
VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV = 0x00002000,
VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT = 0x00001000,
VK_IMAGE_CREATE_SUBSAMPLED_BIT_EXT = 0x00004000,
+ VK_IMAGE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00010000,
+ VK_IMAGE_CREATE_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_BIT_EXT = 0x00040000,
+ VK_IMAGE_CREATE_2D_VIEW_COMPATIBLE_BIT_EXT = 0x00020000,
+ VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM = 0x00008000,
VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT_KHR = VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT,
VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT,
VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT_KHR = VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT,
@@ -1930,11 +2298,19 @@ typedef enum VkImageUsageFlagBits {
#ifdef VK_ENABLE_BETA_EXTENSIONS
VK_IMAGE_USAGE_VIDEO_ENCODE_DPB_BIT_KHR = 0x00008000,
#endif
+ VK_IMAGE_USAGE_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT = 0x00080000,
VK_IMAGE_USAGE_INVOCATION_MASK_BIT_HUAWEI = 0x00040000,
+ VK_IMAGE_USAGE_SAMPLE_WEIGHT_BIT_QCOM = 0x00100000,
+ VK_IMAGE_USAGE_SAMPLE_BLOCK_MATCH_BIT_QCOM = 0x00200000,
VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV = VK_IMAGE_USAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR,
VK_IMAGE_USAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkImageUsageFlagBits;
typedef VkFlags VkImageUsageFlags;
+
+typedef enum VkInstanceCreateFlagBits {
+ VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR = 0x00000001,
+ VK_INSTANCE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkInstanceCreateFlagBits;
typedef VkFlags VkInstanceCreateFlags;
typedef enum VkMemoryHeapFlagBits {
@@ -1971,6 +2347,7 @@ typedef enum VkQueueFlagBits {
#ifdef VK_ENABLE_BETA_EXTENSIONS
VK_QUEUE_VIDEO_ENCODE_BIT_KHR = 0x00000040,
#endif
+ VK_QUEUE_OPTICAL_FLOW_BIT_NV = 0x00000100,
VK_QUEUE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkQueueFlagBits;
typedef VkFlags VkQueueFlags;
@@ -2000,19 +2377,22 @@ typedef enum VkPipelineStageFlagBits {
VK_PIPELINE_STAGE_HOST_BIT = 0x00004000,
VK_PIPELINE_STAGE_ALL_GRAPHICS_BIT = 0x00008000,
VK_PIPELINE_STAGE_ALL_COMMANDS_BIT = 0x00010000,
+ VK_PIPELINE_STAGE_NONE = 0,
VK_PIPELINE_STAGE_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000,
VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000,
VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR = 0x02000000,
VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR = 0x00200000,
- VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV = 0x00080000,
- VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV = 0x00100000,
VK_PIPELINE_STAGE_FRAGMENT_DENSITY_PROCESS_BIT_EXT = 0x00800000,
VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00400000,
VK_PIPELINE_STAGE_COMMAND_PREPROCESS_BIT_NV = 0x00020000,
- VK_PIPELINE_STAGE_NONE_KHR = 0,
+ VK_PIPELINE_STAGE_TASK_SHADER_BIT_EXT = 0x00080000,
+ VK_PIPELINE_STAGE_MESH_SHADER_BIT_EXT = 0x00100000,
VK_PIPELINE_STAGE_SHADING_RATE_IMAGE_BIT_NV = VK_PIPELINE_STAGE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR,
VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_NV = VK_PIPELINE_STAGE_RAY_TRACING_SHADER_BIT_KHR,
VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_NV = VK_PIPELINE_STAGE_ACCELERATION_STRUCTURE_BUILD_BIT_KHR,
+ VK_PIPELINE_STAGE_TASK_SHADER_BIT_NV = VK_PIPELINE_STAGE_TASK_SHADER_BIT_EXT,
+ VK_PIPELINE_STAGE_MESH_SHADER_BIT_NV = VK_PIPELINE_STAGE_MESH_SHADER_BIT_EXT,
+ VK_PIPELINE_STAGE_NONE_KHR = VK_PIPELINE_STAGE_NONE,
VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkPipelineStageFlagBits;
typedef VkFlags VkPipelineStageFlags;
@@ -2040,7 +2420,8 @@ typedef VkFlags VkFenceCreateFlags;
typedef VkFlags VkSemaphoreCreateFlags;
typedef enum VkEventCreateFlagBits {
- VK_EVENT_CREATE_DEVICE_ONLY_BIT_KHR = 0x00000001,
+ VK_EVENT_CREATE_DEVICE_ONLY_BIT = 0x00000001,
+ VK_EVENT_CREATE_DEVICE_ONLY_BIT_KHR = VK_EVENT_CREATE_DEVICE_ONLY_BIT,
VK_EVENT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkEventCreateFlagBits;
typedef VkFlags VkEventCreateFlags;
@@ -2057,6 +2438,8 @@ typedef enum VkQueryPipelineStatisticFlagBits {
VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT = 0x00000100,
VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT = 0x00000200,
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_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkQueryPipelineStatisticFlagBits;
typedef VkFlags VkQueryPipelineStatisticFlags;
@@ -2080,6 +2463,7 @@ typedef enum VkBufferCreateFlagBits {
VK_BUFFER_CREATE_SPARSE_ALIASED_BIT = 0x00000004,
VK_BUFFER_CREATE_PROTECTED_BIT = 0x00000008,
VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT = 0x00000010,
+ VK_BUFFER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000020,
VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT = VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT,
VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = VK_BUFFER_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT,
VK_BUFFER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
@@ -2115,6 +2499,11 @@ typedef enum VkBufferUsageFlagBits {
#ifdef VK_ENABLE_BETA_EXTENSIONS
VK_BUFFER_USAGE_VIDEO_ENCODE_SRC_BIT_KHR = 0x00010000,
#endif
+ VK_BUFFER_USAGE_SAMPLER_DESCRIPTOR_BUFFER_BIT_EXT = 0x00200000,
+ VK_BUFFER_USAGE_RESOURCE_DESCRIPTOR_BUFFER_BIT_EXT = 0x00400000,
+ VK_BUFFER_USAGE_PUSH_DESCRIPTORS_DESCRIPTOR_BUFFER_BIT_EXT = 0x04000000,
+ VK_BUFFER_USAGE_MICROMAP_BUILD_INPUT_READ_ONLY_BIT_EXT = 0x00800000,
+ VK_BUFFER_USAGE_MICROMAP_STORAGE_BIT_EXT = 0x01000000,
VK_BUFFER_USAGE_RAY_TRACING_BIT_NV = VK_BUFFER_USAGE_SHADER_BINDING_TABLE_BIT_KHR,
VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_EXT = VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT,
VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_KHR = VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT,
@@ -2125,6 +2514,7 @@ typedef VkFlags VkBufferViewCreateFlags;
typedef enum VkImageViewCreateFlagBits {
VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DYNAMIC_BIT_EXT = 0x00000001,
+ VK_IMAGE_VIEW_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000004,
VK_IMAGE_VIEW_CREATE_FRAGMENT_DENSITY_MAP_DEFERRED_BIT_EXT = 0x00000002,
VK_IMAGE_VIEW_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkImageViewCreateFlagBits;
@@ -2132,7 +2522,8 @@ typedef VkFlags VkImageViewCreateFlags;
typedef VkFlags VkShaderModuleCreateFlags;
typedef enum VkPipelineCacheCreateFlagBits {
- VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT = 0x00000001,
+ VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = 0x00000001,
+ VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT_EXT = VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT,
VK_PIPELINE_CACHE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkPipelineCacheCreateFlagBits;
typedef VkFlags VkPipelineCacheCreateFlags;
@@ -2152,6 +2543,10 @@ typedef enum VkPipelineCreateFlagBits {
VK_PIPELINE_CREATE_DERIVATIVE_BIT = 0x00000004,
VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT = 0x00000008,
VK_PIPELINE_CREATE_DISPATCH_BASE_BIT = 0x00000010,
+ VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT = 0x00000100,
+ VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT = 0x00000200,
+ VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00200000,
+ VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = 0x00400000,
VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_ANY_HIT_SHADERS_BIT_KHR = 0x00004000,
VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_CLOSEST_HIT_SHADERS_BIT_KHR = 0x00008000,
VK_PIPELINE_CREATE_RAY_TRACING_NO_NULL_MISS_SHADERS_BIT_KHR = 0x00010000,
@@ -2164,19 +2559,31 @@ typedef enum VkPipelineCreateFlagBits {
VK_PIPELINE_CREATE_CAPTURE_INTERNAL_REPRESENTATIONS_BIT_KHR = 0x00000080,
VK_PIPELINE_CREATE_INDIRECT_BINDABLE_BIT_NV = 0x00040000,
VK_PIPELINE_CREATE_LIBRARY_BIT_KHR = 0x00000800,
- VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT = 0x00000100,
- VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT = 0x00000200,
+ VK_PIPELINE_CREATE_DESCRIPTOR_BUFFER_BIT_EXT = 0x20000000,
+ VK_PIPELINE_CREATE_RETAIN_LINK_TIME_OPTIMIZATION_INFO_BIT_EXT = 0x00800000,
+ VK_PIPELINE_CREATE_LINK_TIME_OPTIMIZATION_BIT_EXT = 0x00000400,
VK_PIPELINE_CREATE_RAY_TRACING_ALLOW_MOTION_BIT_NV = 0x00100000,
+ 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,
+ 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,
+ VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR,
+ VK_PIPELINE_RASTERIZATION_STATE_CREATE_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT = VK_PIPELINE_CREATE_RENDERING_FRAGMENT_DENSITY_MAP_ATTACHMENT_BIT_EXT,
VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT_KHR = VK_PIPELINE_CREATE_VIEW_INDEX_FROM_DEVICE_INDEX_BIT,
VK_PIPELINE_CREATE_DISPATCH_BASE_KHR = VK_PIPELINE_CREATE_DISPATCH_BASE,
+ VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT_EXT = VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED_BIT,
+ VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT_EXT = VK_PIPELINE_CREATE_EARLY_RETURN_ON_FAILURE_BIT,
VK_PIPELINE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkPipelineCreateFlagBits;
typedef VkFlags VkPipelineCreateFlags;
typedef enum VkPipelineShaderStageCreateFlagBits {
- VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT = 0x00000001,
- VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT = 0x00000002,
+ VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT = 0x00000001,
+ VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT = 0x00000002,
+ VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT_EXT = VK_PIPELINE_SHADER_STAGE_CREATE_ALLOW_VARYING_SUBGROUP_SIZE_BIT,
+ VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT = VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT,
VK_PIPELINE_SHADER_STAGE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkPipelineShaderStageCreateFlagBits;
typedef VkFlags VkPipelineShaderStageCreateFlags;
@@ -2196,8 +2603,8 @@ typedef enum VkShaderStageFlagBits {
VK_SHADER_STAGE_MISS_BIT_KHR = 0x00000800,
VK_SHADER_STAGE_INTERSECTION_BIT_KHR = 0x00001000,
VK_SHADER_STAGE_CALLABLE_BIT_KHR = 0x00002000,
- VK_SHADER_STAGE_TASK_BIT_NV = 0x00000040,
- VK_SHADER_STAGE_MESH_BIT_NV = 0x00000080,
+ 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_RAYGEN_BIT_NV = VK_SHADER_STAGE_RAYGEN_BIT_KHR,
VK_SHADER_STAGE_ANY_HIT_BIT_NV = VK_SHADER_STAGE_ANY_HIT_BIT_KHR,
@@ -2205,6 +2612,8 @@ typedef enum VkShaderStageFlagBits {
VK_SHADER_STAGE_MISS_BIT_NV = VK_SHADER_STAGE_MISS_BIT_KHR,
VK_SHADER_STAGE_INTERSECTION_BIT_NV = VK_SHADER_STAGE_INTERSECTION_BIT_KHR,
VK_SHADER_STAGE_CALLABLE_BIT_NV = VK_SHADER_STAGE_CALLABLE_BIT_KHR,
+ VK_SHADER_STAGE_TASK_BIT_NV = VK_SHADER_STAGE_TASK_BIT_EXT,
+ VK_SHADER_STAGE_MESH_BIT_NV = VK_SHADER_STAGE_MESH_BIT_EXT,
VK_SHADER_STAGE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkShaderStageFlagBits;
@@ -2222,15 +2631,37 @@ typedef VkFlags VkPipelineTessellationStateCreateFlags;
typedef VkFlags VkPipelineViewportStateCreateFlags;
typedef VkFlags VkPipelineRasterizationStateCreateFlags;
typedef VkFlags VkPipelineMultisampleStateCreateFlags;
+
+typedef enum VkPipelineDepthStencilStateCreateFlagBits {
+ VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT = 0x00000001,
+ VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT = 0x00000002,
+ VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_ARM = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT,
+ VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_ARM = VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT,
+ VK_PIPELINE_DEPTH_STENCIL_STATE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkPipelineDepthStencilStateCreateFlagBits;
typedef VkFlags VkPipelineDepthStencilStateCreateFlags;
+
+typedef enum VkPipelineColorBlendStateCreateFlagBits {
+ VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT = 0x00000001,
+ VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_ARM = VK_PIPELINE_COLOR_BLEND_STATE_CREATE_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_BIT_EXT,
+ VK_PIPELINE_COLOR_BLEND_STATE_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkPipelineColorBlendStateCreateFlagBits;
typedef VkFlags VkPipelineColorBlendStateCreateFlags;
typedef VkFlags VkPipelineDynamicStateCreateFlags;
+
+typedef enum VkPipelineLayoutCreateFlagBits {
+ VK_PIPELINE_LAYOUT_CREATE_INDEPENDENT_SETS_BIT_EXT = 0x00000002,
+ VK_PIPELINE_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkPipelineLayoutCreateFlagBits;
typedef VkFlags VkPipelineLayoutCreateFlags;
typedef VkFlags VkShaderStageFlags;
typedef enum VkSamplerCreateFlagBits {
VK_SAMPLER_CREATE_SUBSAMPLED_BIT_EXT = 0x00000001,
VK_SAMPLER_CREATE_SUBSAMPLED_COARSE_RECONSTRUCTION_BIT_EXT = 0x00000002,
+ VK_SAMPLER_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000008,
+ VK_SAMPLER_CREATE_NON_SEAMLESS_CUBE_MAP_BIT_EXT = 0x00000004,
+ VK_SAMPLER_CREATE_IMAGE_PROCESSING_BIT_QCOM = 0x00000010,
VK_SAMPLER_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkSamplerCreateFlagBits;
typedef VkFlags VkSamplerCreateFlags;
@@ -2238,8 +2669,9 @@ typedef VkFlags VkSamplerCreateFlags;
typedef enum VkDescriptorPoolCreateFlagBits {
VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT = 0x00000001,
VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT = 0x00000002,
- VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE = 0x00000004,
+ VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT = 0x00000004,
VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT_EXT = VK_DESCRIPTOR_POOL_CREATE_UPDATE_AFTER_BIND_BIT,
+ VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE = VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_EXT,
VK_DESCRIPTOR_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkDescriptorPoolCreateFlagBits;
typedef VkFlags VkDescriptorPoolCreateFlags;
@@ -2248,8 +2680,11 @@ typedef VkFlags VkDescriptorPoolResetFlags;
typedef enum VkDescriptorSetLayoutCreateFlagBits {
VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT = 0x00000002,
VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR = 0x00000001,
- VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE = 0x00000004,
+ VK_DESCRIPTOR_SET_LAYOUT_CREATE_DESCRIPTOR_BUFFER_BIT_EXT = 0x00000010,
+ VK_DESCRIPTOR_SET_LAYOUT_CREATE_EMBEDDED_IMMUTABLE_SAMPLERS_BIT_EXT = 0x00000020,
+ VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT = 0x00000004,
VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT_EXT = VK_DESCRIPTOR_SET_LAYOUT_CREATE_UPDATE_AFTER_BIND_POOL_BIT,
+ VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_VALVE = VK_DESCRIPTOR_SET_LAYOUT_CREATE_HOST_ONLY_POOL_BIT_EXT,
VK_DESCRIPTOR_SET_LAYOUT_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkDescriptorSetLayoutCreateFlagBits;
typedef VkFlags VkDescriptorSetLayoutCreateFlags;
@@ -2264,6 +2699,7 @@ typedef enum VkDependencyFlagBits {
VK_DEPENDENCY_BY_REGION_BIT = 0x00000001,
VK_DEPENDENCY_DEVICE_GROUP_BIT = 0x00000004,
VK_DEPENDENCY_VIEW_LOCAL_BIT = 0x00000002,
+ VK_DEPENDENCY_FEEDBACK_LOOP_BIT_EXT = 0x00000008,
VK_DEPENDENCY_VIEW_LOCAL_BIT_KHR = VK_DEPENDENCY_VIEW_LOCAL_BIT,
VK_DEPENDENCY_DEVICE_GROUP_BIT_KHR = VK_DEPENDENCY_DEVICE_GROUP_BIT,
VK_DEPENDENCY_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
@@ -2288,6 +2724,13 @@ typedef enum VkSubpassDescriptionFlagBits {
VK_SUBPASS_DESCRIPTION_PER_VIEW_POSITION_X_ONLY_BIT_NVX = 0x00000002,
VK_SUBPASS_DESCRIPTION_FRAGMENT_REGION_BIT_QCOM = 0x00000004,
VK_SUBPASS_DESCRIPTION_SHADER_RESOLVE_BIT_QCOM = 0x00000008,
+ VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_EXT = 0x00000010,
+ VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT = 0x00000020,
+ VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT = 0x00000040,
+ VK_SUBPASS_DESCRIPTION_ENABLE_LEGACY_DITHERING_BIT_EXT = 0x00000080,
+ VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_ARM = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_COLOR_ACCESS_BIT_EXT,
+ VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_ARM = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_DEPTH_ACCESS_BIT_EXT,
+ VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_ARM = VK_SUBPASS_DESCRIPTION_RASTERIZATION_ORDER_ATTACHMENT_STENCIL_ACCESS_BIT_EXT,
VK_SUBPASS_DESCRIPTION_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
} VkSubpassDescriptionFlagBits;
typedef VkFlags VkSubpassDescriptionFlags;
@@ -5288,6 +5731,10 @@ typedef enum VkDriverId {
VK_DRIVER_ID_MESA_TURNIP = 18,
VK_DRIVER_ID_MESA_V3DV = 19,
VK_DRIVER_ID_MESA_PANVK = 20,
+ VK_DRIVER_ID_SAMSUNG_PROPRIETARY = 21,
+ VK_DRIVER_ID_MESA_VENUS = 22,
+ VK_DRIVER_ID_MESA_DOZEN = 23,
+ VK_DRIVER_ID_MESA_NVK = 24,
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,
@@ -6009,6 +6456,1056 @@ VKAPI_ATTR uint64_t VKAPI_CALL vkGetDeviceMemoryOpaqueCaptureAddress(
#endif
+#define VK_VERSION_1_3 1
+// Vulkan 1.3 version number
+#define VK_API_VERSION_1_3 VK_MAKE_API_VERSION(0, 1, 3, 0)// Patch version should always be set to 0
+
+typedef uint64_t VkFlags64;
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPrivateDataSlot)
+
+typedef enum VkPipelineCreationFeedbackFlagBits {
+ VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT = 0x00000001,
+ VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT = 0x00000002,
+ VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT = 0x00000004,
+ VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT = VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT,
+ VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT = VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT,
+ VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT = VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT,
+ VK_PIPELINE_CREATION_FEEDBACK_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkPipelineCreationFeedbackFlagBits;
+typedef VkFlags VkPipelineCreationFeedbackFlags;
+
+typedef enum VkToolPurposeFlagBits {
+ VK_TOOL_PURPOSE_VALIDATION_BIT = 0x00000001,
+ VK_TOOL_PURPOSE_PROFILING_BIT = 0x00000002,
+ VK_TOOL_PURPOSE_TRACING_BIT = 0x00000004,
+ VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT = 0x00000008,
+ VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT = 0x00000010,
+ VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT = 0x00000020,
+ VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT = 0x00000040,
+ VK_TOOL_PURPOSE_VALIDATION_BIT_EXT = VK_TOOL_PURPOSE_VALIDATION_BIT,
+ VK_TOOL_PURPOSE_PROFILING_BIT_EXT = VK_TOOL_PURPOSE_PROFILING_BIT,
+ VK_TOOL_PURPOSE_TRACING_BIT_EXT = VK_TOOL_PURPOSE_TRACING_BIT,
+ VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT = VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT,
+ VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT_EXT = VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT,
+ VK_TOOL_PURPOSE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkToolPurposeFlagBits;
+typedef VkFlags VkToolPurposeFlags;
+typedef VkFlags VkPrivateDataSlotCreateFlags;
+typedef VkFlags64 VkPipelineStageFlags2;
+
+// Flag bits for VkPipelineStageFlagBits2
+typedef VkFlags64 VkPipelineStageFlagBits2;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_NONE = 0ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_NONE_KHR = 0ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT = 0x00000001ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT_KHR = 0x00000001ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT = 0x00000002ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT_KHR = 0x00000002ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT = 0x00000004ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT_KHR = 0x00000004ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT = 0x00000008ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT_KHR = 0x00000008ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT = 0x00000010ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT_KHR = 0x00000010ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT = 0x00000020ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT_KHR = 0x00000020ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT = 0x00000040ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT_KHR = 0x00000040ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT = 0x00000080ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT_KHR = 0x00000080ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT = 0x00000100ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT_KHR = 0x00000100ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT = 0x00000200ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT_KHR = 0x00000200ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT = 0x00000400ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT_KHR = 0x00000400ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT = 0x00000800ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT_KHR = 0x00000800ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT = 0x00001000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT_KHR = 0x00001000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TRANSFER_BIT = 0x00001000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TRANSFER_BIT_KHR = 0x00001000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT = 0x00002000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT_KHR = 0x00002000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_HOST_BIT = 0x00004000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_HOST_BIT_KHR = 0x00004000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT = 0x00008000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT_KHR = 0x00008000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT = 0x00010000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR = 0x00010000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COPY_BIT = 0x100000000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COPY_BIT_KHR = 0x100000000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RESOLVE_BIT = 0x200000000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RESOLVE_BIT_KHR = 0x200000000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BLIT_BIT = 0x400000000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_BLIT_BIT_KHR = 0x400000000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CLEAR_BIT = 0x800000000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CLEAR_BIT_KHR = 0x800000000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT = 0x1000000000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT_KHR = 0x1000000000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT = 0x2000000000ULL;
+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
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV = 0x00020000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00400000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SHADING_RATE_IMAGE_BIT_NV = 0x00400000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR = 0x02000000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR = 0x00200000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_NV = 0x00200000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_NV = 0x02000000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT = 0x00800000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_NV = 0x00080000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_NV = 0x00100000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_EXT = 0x00080000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_EXT = 0x00100000ULL;
+static const VkPipelineStageFlagBits2 VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEI = 0x8000000000ULL;
+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_OPTICAL_FLOW_BIT_NV = 0x20000000ULL;
+
+typedef VkFlags64 VkAccessFlags2;
+
+// Flag bits for VkAccessFlagBits2
+typedef VkFlags64 VkAccessFlagBits2;
+static const VkAccessFlagBits2 VK_ACCESS_2_NONE = 0ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_NONE_KHR = 0ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT = 0x00000001ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT_KHR = 0x00000001ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_INDEX_READ_BIT = 0x00000002ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_INDEX_READ_BIT_KHR = 0x00000002ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT = 0x00000004ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT_KHR = 0x00000004ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_UNIFORM_READ_BIT = 0x00000008ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_UNIFORM_READ_BIT_KHR = 0x00000008ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT = 0x00000010ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT_KHR = 0x00000010ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_READ_BIT = 0x00000020ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_READ_BIT_KHR = 0x00000020ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_WRITE_BIT = 0x00000040ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_WRITE_BIT_KHR = 0x00000040ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT = 0x00000080ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT_KHR = 0x00000080ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT = 0x00000100ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT_KHR = 0x00000100ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT = 0x00000200ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT_KHR = 0x00000200ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT = 0x00000400ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT_KHR = 0x00000400ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_READ_BIT = 0x00000800ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_READ_BIT_KHR = 0x00000800ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_WRITE_BIT = 0x00001000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFER_WRITE_BIT_KHR = 0x00001000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_HOST_READ_BIT = 0x00002000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_HOST_READ_BIT_KHR = 0x00002000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_HOST_WRITE_BIT = 0x00004000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_HOST_WRITE_BIT_KHR = 0x00004000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_READ_BIT = 0x00008000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_READ_BIT_KHR = 0x00008000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_WRITE_BIT = 0x00010000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_MEMORY_WRITE_BIT_KHR = 0x00010000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_SAMPLED_READ_BIT = 0x100000000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_SAMPLED_READ_BIT_KHR = 0x100000000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_STORAGE_READ_BIT = 0x200000000ULL;
+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
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+static const VkAccessFlagBits2 VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR = 0x4000000000ULL;
+#endif
+static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0x02000000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0x04000000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0x08000000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT = 0x00100000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV = 0x00020000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV = 0x00040000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR = 0x00800000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADING_RATE_IMAGE_READ_BIT_NV = 0x00800000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR = 0x00200000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR = 0x00400000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_NV = 0x00200000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_NV = 0x00400000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT = 0x01000000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_DESCRIPTOR_BUFFER_READ_BIT_EXT = 0x20000000000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI = 0x8000000000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_SHADER_BINDING_TABLE_READ_BIT_KHR = 0x10000000000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_MICROMAP_READ_BIT_EXT = 0x100000000000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_MICROMAP_WRITE_BIT_EXT = 0x200000000000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_OPTICAL_FLOW_READ_BIT_NV = 0x40000000000ULL;
+static const VkAccessFlagBits2 VK_ACCESS_2_OPTICAL_FLOW_WRITE_BIT_NV = 0x80000000000ULL;
+
+
+typedef enum VkSubmitFlagBits {
+ VK_SUBMIT_PROTECTED_BIT = 0x00000001,
+ VK_SUBMIT_PROTECTED_BIT_KHR = VK_SUBMIT_PROTECTED_BIT,
+ VK_SUBMIT_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkSubmitFlagBits;
+typedef VkFlags VkSubmitFlags;
+
+typedef enum VkRenderingFlagBits {
+ VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT = 0x00000001,
+ VK_RENDERING_SUSPENDING_BIT = 0x00000002,
+ VK_RENDERING_RESUMING_BIT = 0x00000004,
+ VK_RENDERING_ENABLE_LEGACY_DITHERING_BIT_EXT = 0x00000008,
+ VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT_KHR = VK_RENDERING_CONTENTS_SECONDARY_COMMAND_BUFFERS_BIT,
+ VK_RENDERING_SUSPENDING_BIT_KHR = VK_RENDERING_SUSPENDING_BIT,
+ VK_RENDERING_RESUMING_BIT_KHR = VK_RENDERING_RESUMING_BIT,
+ VK_RENDERING_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF
+} VkRenderingFlagBits;
+typedef VkFlags VkRenderingFlags;
+typedef VkFlags64 VkFormatFeatureFlags2;
+
+// Flag bits for VkFormatFeatureFlagBits2
+typedef VkFlags64 VkFormatFeatureFlagBits2;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT = 0x00000001ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_BIT_KHR = 0x00000001ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT = 0x00000002ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_BIT_KHR = 0x00000002ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT = 0x00000004ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_IMAGE_ATOMIC_BIT_KHR = 0x00000004ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT = 0x00000008ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_UNIFORM_TEXEL_BUFFER_BIT_KHR = 0x00000008ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT = 0x00000010ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_BIT_KHR = 0x00000010ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT = 0x00000020ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_TEXEL_BUFFER_ATOMIC_BIT_KHR = 0x00000020ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT = 0x00000040ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VERTEX_BUFFER_BIT_KHR = 0x00000040ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT = 0x00000080ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BIT_KHR = 0x00000080ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT = 0x00000100ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT_KHR = 0x00000100ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT = 0x00000200ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DEPTH_STENCIL_ATTACHMENT_BIT_KHR = 0x00000200ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_SRC_BIT = 0x00000400ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_SRC_BIT_KHR = 0x00000400ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_DST_BIT = 0x00000800ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLIT_DST_BIT_KHR = 0x00000800ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT = 0x00001000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_LINEAR_BIT_KHR = 0x00001000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT = 0x00002000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_CUBIC_BIT_EXT = 0x00002000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT = 0x00004000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_SRC_BIT_KHR = 0x00004000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT = 0x00008000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_TRANSFER_DST_BIT_KHR = 0x00008000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT = 0x00010000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_FILTER_MINMAX_BIT_KHR = 0x00010000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT = 0x00020000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_MIDPOINT_CHROMA_SAMPLES_BIT_KHR = 0x00020000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT = 0x00040000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_LINEAR_FILTER_BIT_KHR = 0x00040000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT = 0x00080000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_SEPARATE_RECONSTRUCTION_FILTER_BIT_KHR = 0x00080000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT = 0x00100000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_BIT_KHR = 0x00100000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT = 0x00200000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_SAMPLED_IMAGE_YCBCR_CONVERSION_CHROMA_RECONSTRUCTION_EXPLICIT_FORCEABLE_BIT_KHR = 0x00200000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DISJOINT_BIT = 0x00400000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_DISJOINT_BIT_KHR = 0x00400000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT = 0x00800000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_COSITED_CHROMA_SAMPLES_BIT_KHR = 0x00800000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT = 0x80000000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_READ_WITHOUT_FORMAT_BIT_KHR = 0x80000000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_STORAGE_WRITE_WITHOUT_FORMAT_BIT = 0x100000000ULL;
+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;
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_ENCODE_INPUT_BIT_KHR = 0x08000000ULL;
+#endif
+#ifdef VK_ENABLE_BETA_EXTENSIONS
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_VIDEO_ENCODE_DPB_BIT_KHR = 0x10000000ULL;
+#endif
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_LINEAR_COLOR_ATTACHMENT_BIT_NV = 0x4000000000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_WEIGHT_IMAGE_BIT_QCOM = 0x400000000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_WEIGHT_SAMPLED_IMAGE_BIT_QCOM = 0x800000000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BLOCK_MATCHING_BIT_QCOM = 0x1000000000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_BOX_FILTER_SAMPLED_BIT_QCOM = 0x2000000000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_OPTICAL_FLOW_IMAGE_BIT_NV = 0x10000000000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_OPTICAL_FLOW_VECTOR_BIT_NV = 0x20000000000ULL;
+static const VkFormatFeatureFlagBits2 VK_FORMAT_FEATURE_2_OPTICAL_FLOW_COST_BIT_NV = 0x40000000000ULL;
+
+typedef struct VkPhysicalDeviceVulkan13Features {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 robustImageAccess;
+ VkBool32 inlineUniformBlock;
+ VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind;
+ VkBool32 pipelineCreationCacheControl;
+ VkBool32 privateData;
+ VkBool32 shaderDemoteToHelperInvocation;
+ VkBool32 shaderTerminateInvocation;
+ VkBool32 subgroupSizeControl;
+ VkBool32 computeFullSubgroups;
+ VkBool32 synchronization2;
+ VkBool32 textureCompressionASTC_HDR;
+ VkBool32 shaderZeroInitializeWorkgroupMemory;
+ VkBool32 dynamicRendering;
+ VkBool32 shaderIntegerDotProduct;
+ VkBool32 maintenance4;
+} VkPhysicalDeviceVulkan13Features;
+
+typedef struct VkPhysicalDeviceVulkan13Properties {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t minSubgroupSize;
+ uint32_t maxSubgroupSize;
+ uint32_t maxComputeWorkgroupSubgroups;
+ VkShaderStageFlags requiredSubgroupSizeStages;
+ uint32_t maxInlineUniformBlockSize;
+ uint32_t maxPerStageDescriptorInlineUniformBlocks;
+ uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks;
+ uint32_t maxDescriptorSetInlineUniformBlocks;
+ uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks;
+ uint32_t maxInlineUniformTotalSize;
+ VkBool32 integerDotProduct8BitUnsignedAccelerated;
+ VkBool32 integerDotProduct8BitSignedAccelerated;
+ VkBool32 integerDotProduct8BitMixedSignednessAccelerated;
+ VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated;
+ VkBool32 integerDotProduct4x8BitPackedSignedAccelerated;
+ VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated;
+ VkBool32 integerDotProduct16BitUnsignedAccelerated;
+ VkBool32 integerDotProduct16BitSignedAccelerated;
+ VkBool32 integerDotProduct16BitMixedSignednessAccelerated;
+ VkBool32 integerDotProduct32BitUnsignedAccelerated;
+ VkBool32 integerDotProduct32BitSignedAccelerated;
+ VkBool32 integerDotProduct32BitMixedSignednessAccelerated;
+ VkBool32 integerDotProduct64BitUnsignedAccelerated;
+ VkBool32 integerDotProduct64BitSignedAccelerated;
+ VkBool32 integerDotProduct64BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated;
+ VkDeviceSize storageTexelBufferOffsetAlignmentBytes;
+ VkBool32 storageTexelBufferOffsetSingleTexelAlignment;
+ VkDeviceSize uniformTexelBufferOffsetAlignmentBytes;
+ VkBool32 uniformTexelBufferOffsetSingleTexelAlignment;
+ VkDeviceSize maxBufferSize;
+} VkPhysicalDeviceVulkan13Properties;
+
+typedef struct VkPipelineCreationFeedback {
+ VkPipelineCreationFeedbackFlags flags;
+ uint64_t duration;
+} VkPipelineCreationFeedback;
+
+typedef struct VkPipelineCreationFeedbackCreateInfo {
+ VkStructureType sType;
+ const void* pNext;
+ VkPipelineCreationFeedback* pPipelineCreationFeedback;
+ uint32_t pipelineStageCreationFeedbackCount;
+ VkPipelineCreationFeedback* pPipelineStageCreationFeedbacks;
+} VkPipelineCreationFeedbackCreateInfo;
+
+typedef struct VkPhysicalDeviceShaderTerminateInvocationFeatures {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 shaderTerminateInvocation;
+} VkPhysicalDeviceShaderTerminateInvocationFeatures;
+
+typedef struct VkPhysicalDeviceToolProperties {
+ VkStructureType sType;
+ void* pNext;
+ char name[VK_MAX_EXTENSION_NAME_SIZE];
+ char version[VK_MAX_EXTENSION_NAME_SIZE];
+ VkToolPurposeFlags purposes;
+ char description[VK_MAX_DESCRIPTION_SIZE];
+ char layer[VK_MAX_EXTENSION_NAME_SIZE];
+} VkPhysicalDeviceToolProperties;
+
+typedef struct VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 shaderDemoteToHelperInvocation;
+} VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures;
+
+typedef struct VkPhysicalDevicePrivateDataFeatures {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 privateData;
+} VkPhysicalDevicePrivateDataFeatures;
+
+typedef struct VkDevicePrivateDataCreateInfo {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t privateDataSlotRequestCount;
+} VkDevicePrivateDataCreateInfo;
+
+typedef struct VkPrivateDataSlotCreateInfo {
+ VkStructureType sType;
+ const void* pNext;
+ VkPrivateDataSlotCreateFlags flags;
+} VkPrivateDataSlotCreateInfo;
+
+typedef struct VkPhysicalDevicePipelineCreationCacheControlFeatures {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 pipelineCreationCacheControl;
+} VkPhysicalDevicePipelineCreationCacheControlFeatures;
+
+typedef struct VkMemoryBarrier2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkPipelineStageFlags2 srcStageMask;
+ VkAccessFlags2 srcAccessMask;
+ VkPipelineStageFlags2 dstStageMask;
+ VkAccessFlags2 dstAccessMask;
+} VkMemoryBarrier2;
+
+typedef struct VkBufferMemoryBarrier2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkPipelineStageFlags2 srcStageMask;
+ VkAccessFlags2 srcAccessMask;
+ VkPipelineStageFlags2 dstStageMask;
+ VkAccessFlags2 dstAccessMask;
+ uint32_t srcQueueFamilyIndex;
+ uint32_t dstQueueFamilyIndex;
+ VkBuffer buffer;
+ VkDeviceSize offset;
+ VkDeviceSize size;
+} VkBufferMemoryBarrier2;
+
+typedef struct VkImageMemoryBarrier2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkPipelineStageFlags2 srcStageMask;
+ VkAccessFlags2 srcAccessMask;
+ VkPipelineStageFlags2 dstStageMask;
+ VkAccessFlags2 dstAccessMask;
+ VkImageLayout oldLayout;
+ VkImageLayout newLayout;
+ uint32_t srcQueueFamilyIndex;
+ uint32_t dstQueueFamilyIndex;
+ VkImage image;
+ VkImageSubresourceRange subresourceRange;
+} VkImageMemoryBarrier2;
+
+typedef struct VkDependencyInfo {
+ VkStructureType sType;
+ const void* pNext;
+ VkDependencyFlags dependencyFlags;
+ uint32_t memoryBarrierCount;
+ const VkMemoryBarrier2* pMemoryBarriers;
+ uint32_t bufferMemoryBarrierCount;
+ const VkBufferMemoryBarrier2* pBufferMemoryBarriers;
+ uint32_t imageMemoryBarrierCount;
+ const VkImageMemoryBarrier2* pImageMemoryBarriers;
+} VkDependencyInfo;
+
+typedef struct VkSemaphoreSubmitInfo {
+ VkStructureType sType;
+ const void* pNext;
+ VkSemaphore semaphore;
+ uint64_t value;
+ VkPipelineStageFlags2 stageMask;
+ uint32_t deviceIndex;
+} VkSemaphoreSubmitInfo;
+
+typedef struct VkCommandBufferSubmitInfo {
+ VkStructureType sType;
+ const void* pNext;
+ VkCommandBuffer commandBuffer;
+ uint32_t deviceMask;
+} VkCommandBufferSubmitInfo;
+
+typedef struct VkSubmitInfo2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkSubmitFlags flags;
+ uint32_t waitSemaphoreInfoCount;
+ const VkSemaphoreSubmitInfo* pWaitSemaphoreInfos;
+ uint32_t commandBufferInfoCount;
+ const VkCommandBufferSubmitInfo* pCommandBufferInfos;
+ uint32_t signalSemaphoreInfoCount;
+ const VkSemaphoreSubmitInfo* pSignalSemaphoreInfos;
+} VkSubmitInfo2;
+
+typedef struct VkPhysicalDeviceSynchronization2Features {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 synchronization2;
+} VkPhysicalDeviceSynchronization2Features;
+
+typedef struct VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 shaderZeroInitializeWorkgroupMemory;
+} VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures;
+
+typedef struct VkPhysicalDeviceImageRobustnessFeatures {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 robustImageAccess;
+} VkPhysicalDeviceImageRobustnessFeatures;
+
+typedef struct VkBufferCopy2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkDeviceSize srcOffset;
+ VkDeviceSize dstOffset;
+ VkDeviceSize size;
+} VkBufferCopy2;
+
+typedef struct VkCopyBufferInfo2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkBuffer srcBuffer;
+ VkBuffer dstBuffer;
+ uint32_t regionCount;
+ const VkBufferCopy2* pRegions;
+} VkCopyBufferInfo2;
+
+typedef struct VkImageCopy2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkImageSubresourceLayers srcSubresource;
+ VkOffset3D srcOffset;
+ VkImageSubresourceLayers dstSubresource;
+ VkOffset3D dstOffset;
+ VkExtent3D extent;
+} VkImageCopy2;
+
+typedef struct VkCopyImageInfo2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkImage srcImage;
+ VkImageLayout srcImageLayout;
+ VkImage dstImage;
+ VkImageLayout dstImageLayout;
+ uint32_t regionCount;
+ const VkImageCopy2* pRegions;
+} VkCopyImageInfo2;
+
+typedef struct VkBufferImageCopy2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkDeviceSize bufferOffset;
+ uint32_t bufferRowLength;
+ uint32_t bufferImageHeight;
+ VkImageSubresourceLayers imageSubresource;
+ VkOffset3D imageOffset;
+ VkExtent3D imageExtent;
+} VkBufferImageCopy2;
+
+typedef struct VkCopyBufferToImageInfo2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkBuffer srcBuffer;
+ VkImage dstImage;
+ VkImageLayout dstImageLayout;
+ uint32_t regionCount;
+ const VkBufferImageCopy2* pRegions;
+} VkCopyBufferToImageInfo2;
+
+typedef struct VkCopyImageToBufferInfo2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkImage srcImage;
+ VkImageLayout srcImageLayout;
+ VkBuffer dstBuffer;
+ uint32_t regionCount;
+ const VkBufferImageCopy2* pRegions;
+} VkCopyImageToBufferInfo2;
+
+typedef struct VkImageBlit2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkImageSubresourceLayers srcSubresource;
+ VkOffset3D srcOffsets[2];
+ VkImageSubresourceLayers dstSubresource;
+ VkOffset3D dstOffsets[2];
+} VkImageBlit2;
+
+typedef struct VkBlitImageInfo2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkImage srcImage;
+ VkImageLayout srcImageLayout;
+ VkImage dstImage;
+ VkImageLayout dstImageLayout;
+ uint32_t regionCount;
+ const VkImageBlit2* pRegions;
+ VkFilter filter;
+} VkBlitImageInfo2;
+
+typedef struct VkImageResolve2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkImageSubresourceLayers srcSubresource;
+ VkOffset3D srcOffset;
+ VkImageSubresourceLayers dstSubresource;
+ VkOffset3D dstOffset;
+ VkExtent3D extent;
+} VkImageResolve2;
+
+typedef struct VkResolveImageInfo2 {
+ VkStructureType sType;
+ const void* pNext;
+ VkImage srcImage;
+ VkImageLayout srcImageLayout;
+ VkImage dstImage;
+ VkImageLayout dstImageLayout;
+ uint32_t regionCount;
+ const VkImageResolve2* pRegions;
+} VkResolveImageInfo2;
+
+typedef struct VkPhysicalDeviceSubgroupSizeControlFeatures {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 subgroupSizeControl;
+ VkBool32 computeFullSubgroups;
+} VkPhysicalDeviceSubgroupSizeControlFeatures;
+
+typedef struct VkPhysicalDeviceSubgroupSizeControlProperties {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t minSubgroupSize;
+ uint32_t maxSubgroupSize;
+ uint32_t maxComputeWorkgroupSubgroups;
+ VkShaderStageFlags requiredSubgroupSizeStages;
+} VkPhysicalDeviceSubgroupSizeControlProperties;
+
+typedef struct VkPipelineShaderStageRequiredSubgroupSizeCreateInfo {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t requiredSubgroupSize;
+} VkPipelineShaderStageRequiredSubgroupSizeCreateInfo;
+
+typedef struct VkPhysicalDeviceInlineUniformBlockFeatures {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 inlineUniformBlock;
+ VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind;
+} VkPhysicalDeviceInlineUniformBlockFeatures;
+
+typedef struct VkPhysicalDeviceInlineUniformBlockProperties {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t maxInlineUniformBlockSize;
+ uint32_t maxPerStageDescriptorInlineUniformBlocks;
+ uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks;
+ uint32_t maxDescriptorSetInlineUniformBlocks;
+ uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks;
+} VkPhysicalDeviceInlineUniformBlockProperties;
+
+typedef struct VkWriteDescriptorSetInlineUniformBlock {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t dataSize;
+ const void* pData;
+} VkWriteDescriptorSetInlineUniformBlock;
+
+typedef struct VkDescriptorPoolInlineUniformBlockCreateInfo {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t maxInlineUniformBlockBindings;
+} VkDescriptorPoolInlineUniformBlockCreateInfo;
+
+typedef struct VkPhysicalDeviceTextureCompressionASTCHDRFeatures {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 textureCompressionASTC_HDR;
+} VkPhysicalDeviceTextureCompressionASTCHDRFeatures;
+
+typedef struct VkRenderingAttachmentInfo {
+ VkStructureType sType;
+ const void* pNext;
+ VkImageView imageView;
+ VkImageLayout imageLayout;
+ VkResolveModeFlagBits resolveMode;
+ VkImageView resolveImageView;
+ VkImageLayout resolveImageLayout;
+ VkAttachmentLoadOp loadOp;
+ VkAttachmentStoreOp storeOp;
+ VkClearValue clearValue;
+} VkRenderingAttachmentInfo;
+
+typedef struct VkRenderingInfo {
+ VkStructureType sType;
+ const void* pNext;
+ VkRenderingFlags flags;
+ VkRect2D renderArea;
+ uint32_t layerCount;
+ uint32_t viewMask;
+ uint32_t colorAttachmentCount;
+ const VkRenderingAttachmentInfo* pColorAttachments;
+ const VkRenderingAttachmentInfo* pDepthAttachment;
+ const VkRenderingAttachmentInfo* pStencilAttachment;
+} VkRenderingInfo;
+
+typedef struct VkPipelineRenderingCreateInfo {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t viewMask;
+ uint32_t colorAttachmentCount;
+ const VkFormat* pColorAttachmentFormats;
+ VkFormat depthAttachmentFormat;
+ VkFormat stencilAttachmentFormat;
+} VkPipelineRenderingCreateInfo;
+
+typedef struct VkPhysicalDeviceDynamicRenderingFeatures {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 dynamicRendering;
+} VkPhysicalDeviceDynamicRenderingFeatures;
+
+typedef struct VkCommandBufferInheritanceRenderingInfo {
+ VkStructureType sType;
+ const void* pNext;
+ VkRenderingFlags flags;
+ uint32_t viewMask;
+ uint32_t colorAttachmentCount;
+ const VkFormat* pColorAttachmentFormats;
+ VkFormat depthAttachmentFormat;
+ VkFormat stencilAttachmentFormat;
+ VkSampleCountFlagBits rasterizationSamples;
+} VkCommandBufferInheritanceRenderingInfo;
+
+typedef struct VkPhysicalDeviceShaderIntegerDotProductFeatures {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 shaderIntegerDotProduct;
+} VkPhysicalDeviceShaderIntegerDotProductFeatures;
+
+typedef struct VkPhysicalDeviceShaderIntegerDotProductProperties {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 integerDotProduct8BitUnsignedAccelerated;
+ VkBool32 integerDotProduct8BitSignedAccelerated;
+ VkBool32 integerDotProduct8BitMixedSignednessAccelerated;
+ VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated;
+ VkBool32 integerDotProduct4x8BitPackedSignedAccelerated;
+ VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated;
+ VkBool32 integerDotProduct16BitUnsignedAccelerated;
+ VkBool32 integerDotProduct16BitSignedAccelerated;
+ VkBool32 integerDotProduct16BitMixedSignednessAccelerated;
+ VkBool32 integerDotProduct32BitUnsignedAccelerated;
+ VkBool32 integerDotProduct32BitSignedAccelerated;
+ VkBool32 integerDotProduct32BitMixedSignednessAccelerated;
+ VkBool32 integerDotProduct64BitUnsignedAccelerated;
+ VkBool32 integerDotProduct64BitSignedAccelerated;
+ VkBool32 integerDotProduct64BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated;
+ VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated;
+} VkPhysicalDeviceShaderIntegerDotProductProperties;
+
+typedef struct VkPhysicalDeviceTexelBufferAlignmentProperties {
+ VkStructureType sType;
+ void* pNext;
+ VkDeviceSize storageTexelBufferOffsetAlignmentBytes;
+ VkBool32 storageTexelBufferOffsetSingleTexelAlignment;
+ VkDeviceSize uniformTexelBufferOffsetAlignmentBytes;
+ VkBool32 uniformTexelBufferOffsetSingleTexelAlignment;
+} VkPhysicalDeviceTexelBufferAlignmentProperties;
+
+typedef struct VkFormatProperties3 {
+ VkStructureType sType;
+ void* pNext;
+ VkFormatFeatureFlags2 linearTilingFeatures;
+ VkFormatFeatureFlags2 optimalTilingFeatures;
+ VkFormatFeatureFlags2 bufferFeatures;
+} VkFormatProperties3;
+
+typedef struct VkPhysicalDeviceMaintenance4Features {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 maintenance4;
+} VkPhysicalDeviceMaintenance4Features;
+
+typedef struct VkPhysicalDeviceMaintenance4Properties {
+ VkStructureType sType;
+ void* pNext;
+ VkDeviceSize maxBufferSize;
+} VkPhysicalDeviceMaintenance4Properties;
+
+typedef struct VkDeviceBufferMemoryRequirements {
+ VkStructureType sType;
+ const void* pNext;
+ const VkBufferCreateInfo* pCreateInfo;
+} VkDeviceBufferMemoryRequirements;
+
+typedef struct VkDeviceImageMemoryRequirements {
+ VkStructureType sType;
+ const void* pNext;
+ const VkImageCreateInfo* pCreateInfo;
+ VkImageAspectFlagBits planeAspect;
+} VkDeviceImageMemoryRequirements;
+
+typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceToolProperties)(VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolProperties* pToolProperties);
+typedef VkResult (VKAPI_PTR *PFN_vkCreatePrivateDataSlot)(VkDevice device, const VkPrivateDataSlotCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPrivateDataSlot* pPrivateDataSlot);
+typedef void (VKAPI_PTR *PFN_vkDestroyPrivateDataSlot)(VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks* pAllocator);
+typedef VkResult (VKAPI_PTR *PFN_vkSetPrivateData)(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data);
+typedef void (VKAPI_PTR *PFN_vkGetPrivateData)(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t* pData);
+typedef void (VKAPI_PTR *PFN_vkCmdSetEvent2)(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo* pDependencyInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdResetEvent2)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask);
+typedef void (VKAPI_PTR *PFN_vkCmdWaitEvents2)(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, const VkDependencyInfo* pDependencyInfos);
+typedef void (VKAPI_PTR *PFN_vkCmdPipelineBarrier2)(VkCommandBuffer commandBuffer, const VkDependencyInfo* pDependencyInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp2)(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query);
+typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit2)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence);
+typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer2)(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdCopyImage2)(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdCopyBufferToImage2)(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdCopyImageToBuffer2)(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdBlitImage2)(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdResolveImage2)(VkCommandBuffer commandBuffer, const VkResolveImageInfo2* pResolveImageInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdBeginRendering)(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdEndRendering)(VkCommandBuffer commandBuffer);
+typedef void (VKAPI_PTR *PFN_vkCmdSetCullMode)(VkCommandBuffer commandBuffer, VkCullModeFlags cullMode);
+typedef void (VKAPI_PTR *PFN_vkCmdSetFrontFace)(VkCommandBuffer commandBuffer, VkFrontFace frontFace);
+typedef void (VKAPI_PTR *PFN_vkCmdSetPrimitiveTopology)(VkCommandBuffer commandBuffer, VkPrimitiveTopology primitiveTopology);
+typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWithCount)(VkCommandBuffer commandBuffer, uint32_t viewportCount, const VkViewport* pViewports);
+typedef void (VKAPI_PTR *PFN_vkCmdSetScissorWithCount)(VkCommandBuffer commandBuffer, uint32_t scissorCount, const VkRect2D* pScissors);
+typedef void (VKAPI_PTR *PFN_vkCmdBindVertexBuffers2)(VkCommandBuffer commandBuffer, uint32_t firstBinding, uint32_t bindingCount, const VkBuffer* pBuffers, const VkDeviceSize* pOffsets, const VkDeviceSize* pSizes, const VkDeviceSize* pStrides);
+typedef void (VKAPI_PTR *PFN_vkCmdSetDepthTestEnable)(VkCommandBuffer commandBuffer, VkBool32 depthTestEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetDepthWriteEnable)(VkCommandBuffer commandBuffer, VkBool32 depthWriteEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetDepthCompareOp)(VkCommandBuffer commandBuffer, VkCompareOp depthCompareOp);
+typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBoundsTestEnable)(VkCommandBuffer commandBuffer, VkBool32 depthBoundsTestEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetStencilTestEnable)(VkCommandBuffer commandBuffer, VkBool32 stencilTestEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetStencilOp)(VkCommandBuffer commandBuffer, VkStencilFaceFlags faceMask, VkStencilOp failOp, VkStencilOp passOp, VkStencilOp depthFailOp, VkCompareOp compareOp);
+typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizerDiscardEnable)(VkCommandBuffer commandBuffer, VkBool32 rasterizerDiscardEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetDepthBiasEnable)(VkCommandBuffer commandBuffer, VkBool32 depthBiasEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetPrimitiveRestartEnable)(VkCommandBuffer commandBuffer, VkBool32 primitiveRestartEnable);
+typedef void (VKAPI_PTR *PFN_vkGetDeviceBufferMemoryRequirements)(VkDevice device, const VkDeviceBufferMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements);
+typedef void (VKAPI_PTR *PFN_vkGetDeviceImageMemoryRequirements)(VkDevice device, const VkDeviceImageMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements);
+typedef void (VKAPI_PTR *PFN_vkGetDeviceImageSparseMemoryRequirements)(VkDevice device, const VkDeviceImageMemoryRequirements* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceToolProperties(
+ VkPhysicalDevice physicalDevice,
+ uint32_t* pToolCount,
+ VkPhysicalDeviceToolProperties* pToolProperties);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkCreatePrivateDataSlot(
+ VkDevice device,
+ const VkPrivateDataSlotCreateInfo* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkPrivateDataSlot* pPrivateDataSlot);
+
+VKAPI_ATTR void VKAPI_CALL vkDestroyPrivateDataSlot(
+ VkDevice device,
+ VkPrivateDataSlot privateDataSlot,
+ const VkAllocationCallbacks* pAllocator);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkSetPrivateData(
+ VkDevice device,
+ VkObjectType objectType,
+ uint64_t objectHandle,
+ VkPrivateDataSlot privateDataSlot,
+ uint64_t data);
+
+VKAPI_ATTR void VKAPI_CALL vkGetPrivateData(
+ VkDevice device,
+ VkObjectType objectType,
+ uint64_t objectHandle,
+ VkPrivateDataSlot privateDataSlot,
+ uint64_t* pData);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent2(
+ VkCommandBuffer commandBuffer,
+ VkEvent event,
+ const VkDependencyInfo* pDependencyInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdResetEvent2(
+ VkCommandBuffer commandBuffer,
+ VkEvent event,
+ VkPipelineStageFlags2 stageMask);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdWaitEvents2(
+ VkCommandBuffer commandBuffer,
+ uint32_t eventCount,
+ const VkEvent* pEvents,
+ const VkDependencyInfo* pDependencyInfos);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier2(
+ VkCommandBuffer commandBuffer,
+ const VkDependencyInfo* pDependencyInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp2(
+ VkCommandBuffer commandBuffer,
+ VkPipelineStageFlags2 stage,
+ VkQueryPool queryPool,
+ uint32_t query);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit2(
+ VkQueue queue,
+ uint32_t submitCount,
+ const VkSubmitInfo2* pSubmits,
+ VkFence fence);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer2(
+ VkCommandBuffer commandBuffer,
+ const VkCopyBufferInfo2* pCopyBufferInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage2(
+ VkCommandBuffer commandBuffer,
+ const VkCopyImageInfo2* pCopyImageInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage2(
+ VkCommandBuffer commandBuffer,
+ const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer2(
+ VkCommandBuffer commandBuffer,
+ const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdBlitImage2(
+ VkCommandBuffer commandBuffer,
+ const VkBlitImageInfo2* pBlitImageInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage2(
+ VkCommandBuffer commandBuffer,
+ const VkResolveImageInfo2* pResolveImageInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdBeginRendering(
+ VkCommandBuffer commandBuffer,
+ const VkRenderingInfo* pRenderingInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdEndRendering(
+ VkCommandBuffer commandBuffer);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetCullMode(
+ VkCommandBuffer commandBuffer,
+ VkCullModeFlags cullMode);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetFrontFace(
+ VkCommandBuffer commandBuffer,
+ VkFrontFace frontFace);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetPrimitiveTopology(
+ VkCommandBuffer commandBuffer,
+ VkPrimitiveTopology primitiveTopology);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportWithCount(
+ VkCommandBuffer commandBuffer,
+ uint32_t viewportCount,
+ const VkViewport* pViewports);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetScissorWithCount(
+ VkCommandBuffer commandBuffer,
+ uint32_t scissorCount,
+ const VkRect2D* pScissors);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdBindVertexBuffers2(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstBinding,
+ uint32_t bindingCount,
+ const VkBuffer* pBuffers,
+ const VkDeviceSize* pOffsets,
+ const VkDeviceSize* pSizes,
+ const VkDeviceSize* pStrides);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthTestEnable(
+ VkCommandBuffer commandBuffer,
+ VkBool32 depthTestEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthWriteEnable(
+ VkCommandBuffer commandBuffer,
+ VkBool32 depthWriteEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthCompareOp(
+ VkCommandBuffer commandBuffer,
+ VkCompareOp depthCompareOp);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBoundsTestEnable(
+ VkCommandBuffer commandBuffer,
+ VkBool32 depthBoundsTestEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilTestEnable(
+ VkCommandBuffer commandBuffer,
+ VkBool32 stencilTestEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetStencilOp(
+ VkCommandBuffer commandBuffer,
+ VkStencilFaceFlags faceMask,
+ VkStencilOp failOp,
+ VkStencilOp passOp,
+ VkStencilOp depthFailOp,
+ VkCompareOp compareOp);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetRasterizerDiscardEnable(
+ VkCommandBuffer commandBuffer,
+ VkBool32 rasterizerDiscardEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthBiasEnable(
+ VkCommandBuffer commandBuffer,
+ VkBool32 depthBiasEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetPrimitiveRestartEnable(
+ VkCommandBuffer commandBuffer,
+ VkBool32 primitiveRestartEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkGetDeviceBufferMemoryRequirements(
+ VkDevice device,
+ const VkDeviceBufferMemoryRequirements* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements);
+
+VKAPI_ATTR void VKAPI_CALL vkGetDeviceImageMemoryRequirements(
+ VkDevice device,
+ const VkDeviceImageMemoryRequirements* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements);
+
+VKAPI_ATTR void VKAPI_CALL vkGetDeviceImageSparseMemoryRequirements(
+ VkDevice device,
+ const VkDeviceImageMemoryRequirements* pInfo,
+ uint32_t* pSparseMemoryRequirementCount,
+ VkSparseImageMemoryRequirements2* pSparseMemoryRequirements);
+#endif
+
+
#define VK_KHR_surface 1
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkSurfaceKHR)
#define VK_KHR_SURFACE_SPEC_VERSION 25
@@ -6435,6 +7932,68 @@ 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_dynamic_rendering 1
+#define VK_KHR_DYNAMIC_RENDERING_SPEC_VERSION 1
+#define VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME "VK_KHR_dynamic_rendering"
+typedef VkRenderingFlags VkRenderingFlagsKHR;
+
+typedef VkRenderingFlagBits VkRenderingFlagBitsKHR;
+
+typedef VkRenderingInfo VkRenderingInfoKHR;
+
+typedef VkRenderingAttachmentInfo VkRenderingAttachmentInfoKHR;
+
+typedef VkPipelineRenderingCreateInfo VkPipelineRenderingCreateInfoKHR;
+
+typedef VkPhysicalDeviceDynamicRenderingFeatures VkPhysicalDeviceDynamicRenderingFeaturesKHR;
+
+typedef VkCommandBufferInheritanceRenderingInfo VkCommandBufferInheritanceRenderingInfoKHR;
+
+typedef struct VkRenderingFragmentShadingRateAttachmentInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkImageView imageView;
+ VkImageLayout imageLayout;
+ VkExtent2D shadingRateAttachmentTexelSize;
+} VkRenderingFragmentShadingRateAttachmentInfoKHR;
+
+typedef struct VkRenderingFragmentDensityMapAttachmentInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkImageView imageView;
+ VkImageLayout imageLayout;
+} VkRenderingFragmentDensityMapAttachmentInfoEXT;
+
+typedef struct VkAttachmentSampleCountInfoAMD {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t colorAttachmentCount;
+ const VkSampleCountFlagBits* pColorAttachmentSamples;
+ VkSampleCountFlagBits depthStencilAttachmentSamples;
+} VkAttachmentSampleCountInfoAMD;
+
+typedef VkAttachmentSampleCountInfoAMD VkAttachmentSampleCountInfoNV;
+
+typedef struct VkMultiviewPerViewAttributesInfoNVX {
+ VkStructureType sType;
+ const void* pNext;
+ VkBool32 perViewAttributes;
+ VkBool32 perViewAttributesPositionXOnly;
+} VkMultiviewPerViewAttributesInfoNVX;
+
+typedef void (VKAPI_PTR *PFN_vkCmdBeginRenderingKHR)(VkCommandBuffer commandBuffer, const VkRenderingInfo* pRenderingInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdEndRenderingKHR)(VkCommandBuffer commandBuffer);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkCmdBeginRenderingKHR(
+ VkCommandBuffer commandBuffer,
+ const VkRenderingInfo* pRenderingInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdEndRenderingKHR(
+ VkCommandBuffer commandBuffer);
+#endif
+
+
#define VK_KHR_multiview 1
#define VK_KHR_MULTIVIEW_SPEC_VERSION 1
#define VK_KHR_MULTIVIEW_EXTENSION_NAME "VK_KHR_multiview"
@@ -7486,6 +9045,43 @@ typedef struct VkPhysicalDeviceShaderClockFeaturesKHR {
+#define VK_KHR_global_priority 1
+#define VK_MAX_GLOBAL_PRIORITY_SIZE_KHR 16U
+#define VK_KHR_GLOBAL_PRIORITY_SPEC_VERSION 1
+#define VK_KHR_GLOBAL_PRIORITY_EXTENSION_NAME "VK_KHR_global_priority"
+
+typedef enum VkQueueGlobalPriorityKHR {
+ VK_QUEUE_GLOBAL_PRIORITY_LOW_KHR = 128,
+ VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR = 256,
+ VK_QUEUE_GLOBAL_PRIORITY_HIGH_KHR = 512,
+ VK_QUEUE_GLOBAL_PRIORITY_REALTIME_KHR = 1024,
+ VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT = VK_QUEUE_GLOBAL_PRIORITY_LOW_KHR,
+ VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT = VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_KHR,
+ VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT = VK_QUEUE_GLOBAL_PRIORITY_HIGH_KHR,
+ VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT = VK_QUEUE_GLOBAL_PRIORITY_REALTIME_KHR,
+ VK_QUEUE_GLOBAL_PRIORITY_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkQueueGlobalPriorityKHR;
+typedef struct VkDeviceQueueGlobalPriorityCreateInfoKHR {
+ VkStructureType sType;
+ const void* pNext;
+ VkQueueGlobalPriorityKHR globalPriority;
+} VkDeviceQueueGlobalPriorityCreateInfoKHR;
+
+typedef struct VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 globalPriorityQuery;
+} VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR;
+
+typedef struct VkQueueFamilyGlobalPriorityPropertiesKHR {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t priorityCount;
+ VkQueueGlobalPriorityKHR priorities[VK_MAX_GLOBAL_PRIORITY_SIZE_KHR];
+} VkQueueFamilyGlobalPriorityPropertiesKHR;
+
+
+
#define VK_KHR_driver_properties 1
#define VK_KHR_DRIVER_PROPERTIES_SPEC_VERSION 1
#define VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME "VK_KHR_driver_properties"
@@ -7578,16 +9174,12 @@ typedef VkPhysicalDeviceVulkanMemoryModelFeatures VkPhysicalDeviceVulkanMemoryMo
#define VK_KHR_shader_terminate_invocation 1
#define VK_KHR_SHADER_TERMINATE_INVOCATION_SPEC_VERSION 1
#define VK_KHR_SHADER_TERMINATE_INVOCATION_EXTENSION_NAME "VK_KHR_shader_terminate_invocation"
-typedef struct VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR {
- VkStructureType sType;
- void* pNext;
- VkBool32 shaderTerminateInvocation;
-} VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR;
+typedef VkPhysicalDeviceShaderTerminateInvocationFeatures VkPhysicalDeviceShaderTerminateInvocationFeaturesKHR;
#define VK_KHR_fragment_shading_rate 1
-#define VK_KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION 1
+#define VK_KHR_FRAGMENT_SHADING_RATE_SPEC_VERSION 2
#define VK_KHR_FRAGMENT_SHADING_RATE_EXTENSION_NAME "VK_KHR_fragment_shading_rate"
typedef enum VkFragmentShadingRateCombinerOpKHR {
@@ -7879,46 +9471,9 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelineExecutableInternalRepresentationsKHR
#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"
-typedef struct VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR {
- VkStructureType sType;
- void* pNext;
- VkBool32 shaderIntegerDotProduct;
-} VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR;
+typedef VkPhysicalDeviceShaderIntegerDotProductFeatures VkPhysicalDeviceShaderIntegerDotProductFeaturesKHR;
-typedef struct VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR {
- VkStructureType sType;
- void* pNext;
- VkBool32 integerDotProduct8BitUnsignedAccelerated;
- VkBool32 integerDotProduct8BitSignedAccelerated;
- VkBool32 integerDotProduct8BitMixedSignednessAccelerated;
- VkBool32 integerDotProduct4x8BitPackedUnsignedAccelerated;
- VkBool32 integerDotProduct4x8BitPackedSignedAccelerated;
- VkBool32 integerDotProduct4x8BitPackedMixedSignednessAccelerated;
- VkBool32 integerDotProduct16BitUnsignedAccelerated;
- VkBool32 integerDotProduct16BitSignedAccelerated;
- VkBool32 integerDotProduct16BitMixedSignednessAccelerated;
- VkBool32 integerDotProduct32BitUnsignedAccelerated;
- VkBool32 integerDotProduct32BitSignedAccelerated;
- VkBool32 integerDotProduct32BitMixedSignednessAccelerated;
- VkBool32 integerDotProduct64BitUnsignedAccelerated;
- VkBool32 integerDotProduct64BitSignedAccelerated;
- VkBool32 integerDotProduct64BitMixedSignednessAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating8BitUnsignedAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating8BitSignedAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating8BitMixedSignednessAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedUnsignedAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedSignedAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating4x8BitPackedMixedSignednessAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating16BitUnsignedAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating16BitSignedAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating16BitMixedSignednessAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating32BitUnsignedAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating32BitSignedAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating32BitMixedSignednessAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating64BitUnsignedAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating64BitSignedAccelerated;
- VkBool32 integerDotProductAccumulatingSaturating64BitMixedSignednessAccelerated;
-} VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR;
+typedef VkPhysicalDeviceShaderIntegerDotProductProperties VkPhysicalDeviceShaderIntegerDotProductPropertiesKHR;
@@ -7958,261 +9513,94 @@ typedef struct VkPhysicalDevicePresentIdFeaturesKHR {
#define VK_KHR_synchronization2 1
-typedef uint64_t VkFlags64;
#define VK_KHR_SYNCHRONIZATION_2_SPEC_VERSION 1
#define VK_KHR_SYNCHRONIZATION_2_EXTENSION_NAME "VK_KHR_synchronization2"
-typedef VkFlags64 VkPipelineStageFlags2KHR;
-
-// Flag bits for VkPipelineStageFlagBits2KHR
-typedef VkFlags64 VkPipelineStageFlagBits2KHR;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_NONE_KHR = 0ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT_KHR = 0x00000001ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_DRAW_INDIRECT_BIT_KHR = 0x00000002ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_VERTEX_INPUT_BIT_KHR = 0x00000004ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_VERTEX_SHADER_BIT_KHR = 0x00000008ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_TESSELLATION_CONTROL_SHADER_BIT_KHR = 0x00000010ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_TESSELLATION_EVALUATION_SHADER_BIT_KHR = 0x00000020ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_GEOMETRY_SHADER_BIT_KHR = 0x00000040ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_FRAGMENT_SHADER_BIT_KHR = 0x00000080ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_EARLY_FRAGMENT_TESTS_BIT_KHR = 0x00000100ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_LATE_FRAGMENT_TESTS_BIT_KHR = 0x00000200ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_COLOR_ATTACHMENT_OUTPUT_BIT_KHR = 0x00000400ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT_KHR = 0x00000800ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_ALL_TRANSFER_BIT_KHR = 0x00001000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_TRANSFER_BIT_KHR = 0x00001000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT_KHR = 0x00002000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_HOST_BIT_KHR = 0x00004000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_ALL_GRAPHICS_BIT_KHR = 0x00008000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT_KHR = 0x00010000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_COPY_BIT_KHR = 0x100000000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_RESOLVE_BIT_KHR = 0x200000000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_BLIT_BIT_KHR = 0x400000000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_CLEAR_BIT_KHR = 0x800000000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_INDEX_INPUT_BIT_KHR = 0x1000000000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_VERTEX_ATTRIBUTE_INPUT_BIT_KHR = 0x2000000000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_PRE_RASTERIZATION_SHADERS_BIT_KHR = 0x4000000000ULL;
-#ifdef VK_ENABLE_BETA_EXTENSIONS
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_VIDEO_DECODE_BIT_KHR = 0x04000000ULL;
-#endif
-#ifdef VK_ENABLE_BETA_EXTENSIONS
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_VIDEO_ENCODE_BIT_KHR = 0x08000000ULL;
-#endif
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_TRANSFORM_FEEDBACK_BIT_EXT = 0x01000000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_CONDITIONAL_RENDERING_BIT_EXT = 0x00040000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_COMMAND_PREPROCESS_BIT_NV = 0x00020000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_FRAGMENT_SHADING_RATE_ATTACHMENT_BIT_KHR = 0x00400000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_SHADING_RATE_IMAGE_BIT_NV = 0x00400000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_KHR = 0x02000000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_KHR = 0x00200000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_RAY_TRACING_SHADER_BIT_NV = 0x00200000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_ACCELERATION_STRUCTURE_BUILD_BIT_NV = 0x02000000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_FRAGMENT_DENSITY_PROCESS_BIT_EXT = 0x00800000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_TASK_SHADER_BIT_NV = 0x00080000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_MESH_SHADER_BIT_NV = 0x00100000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_SUBPASS_SHADING_BIT_HUAWEI = 0x8000000000ULL;
-static const VkPipelineStageFlagBits2KHR VK_PIPELINE_STAGE_2_INVOCATION_MASK_BIT_HUAWEI = 0x10000000000ULL;
-
-typedef VkFlags64 VkAccessFlags2KHR;
-
-// Flag bits for VkAccessFlagBits2KHR
-typedef VkFlags64 VkAccessFlagBits2KHR;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_NONE_KHR = 0ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_INDIRECT_COMMAND_READ_BIT_KHR = 0x00000001ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_INDEX_READ_BIT_KHR = 0x00000002ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_VERTEX_ATTRIBUTE_READ_BIT_KHR = 0x00000004ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_UNIFORM_READ_BIT_KHR = 0x00000008ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_INPUT_ATTACHMENT_READ_BIT_KHR = 0x00000010ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_SHADER_READ_BIT_KHR = 0x00000020ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_SHADER_WRITE_BIT_KHR = 0x00000040ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_COLOR_ATTACHMENT_READ_BIT_KHR = 0x00000080ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_COLOR_ATTACHMENT_WRITE_BIT_KHR = 0x00000100ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_READ_BIT_KHR = 0x00000200ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT_KHR = 0x00000400ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_TRANSFER_READ_BIT_KHR = 0x00000800ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_TRANSFER_WRITE_BIT_KHR = 0x00001000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_HOST_READ_BIT_KHR = 0x00002000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_HOST_WRITE_BIT_KHR = 0x00004000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_MEMORY_READ_BIT_KHR = 0x00008000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_MEMORY_WRITE_BIT_KHR = 0x00010000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_SHADER_SAMPLED_READ_BIT_KHR = 0x100000000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_SHADER_STORAGE_READ_BIT_KHR = 0x200000000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT_KHR = 0x400000000ULL;
-#ifdef VK_ENABLE_BETA_EXTENSIONS
-static const VkAccessFlagBits2KHR VK_ACCESS_2_VIDEO_DECODE_READ_BIT_KHR = 0x800000000ULL;
-#endif
-#ifdef VK_ENABLE_BETA_EXTENSIONS
-static const VkAccessFlagBits2KHR VK_ACCESS_2_VIDEO_DECODE_WRITE_BIT_KHR = 0x1000000000ULL;
-#endif
-#ifdef VK_ENABLE_BETA_EXTENSIONS
-static const VkAccessFlagBits2KHR VK_ACCESS_2_VIDEO_ENCODE_READ_BIT_KHR = 0x2000000000ULL;
-#endif
-#ifdef VK_ENABLE_BETA_EXTENSIONS
-static const VkAccessFlagBits2KHR VK_ACCESS_2_VIDEO_ENCODE_WRITE_BIT_KHR = 0x4000000000ULL;
-#endif
-static const VkAccessFlagBits2KHR VK_ACCESS_2_TRANSFORM_FEEDBACK_WRITE_BIT_EXT = 0x02000000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_READ_BIT_EXT = 0x04000000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT = 0x08000000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_CONDITIONAL_RENDERING_READ_BIT_EXT = 0x00100000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_COMMAND_PREPROCESS_READ_BIT_NV = 0x00020000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_COMMAND_PREPROCESS_WRITE_BIT_NV = 0x00040000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_FRAGMENT_SHADING_RATE_ATTACHMENT_READ_BIT_KHR = 0x00800000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_SHADING_RATE_IMAGE_READ_BIT_NV = 0x00800000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_KHR = 0x00200000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_KHR = 0x00400000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_ACCELERATION_STRUCTURE_READ_BIT_NV = 0x00200000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_ACCELERATION_STRUCTURE_WRITE_BIT_NV = 0x00400000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_FRAGMENT_DENSITY_MAP_READ_BIT_EXT = 0x01000000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_COLOR_ATTACHMENT_READ_NONCOHERENT_BIT_EXT = 0x00080000ULL;
-static const VkAccessFlagBits2KHR VK_ACCESS_2_INVOCATION_MASK_READ_BIT_HUAWEI = 0x8000000000ULL;
-
-
-typedef enum VkSubmitFlagBitsKHR {
- VK_SUBMIT_PROTECTED_BIT_KHR = 0x00000001,
- VK_SUBMIT_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
-} VkSubmitFlagBitsKHR;
-typedef VkFlags VkSubmitFlagsKHR;
-typedef struct VkMemoryBarrier2KHR {
- VkStructureType sType;
- const void* pNext;
- VkPipelineStageFlags2KHR srcStageMask;
- VkAccessFlags2KHR srcAccessMask;
- VkPipelineStageFlags2KHR dstStageMask;
- VkAccessFlags2KHR dstAccessMask;
-} VkMemoryBarrier2KHR;
+typedef VkPipelineStageFlags2 VkPipelineStageFlags2KHR;
-typedef struct VkBufferMemoryBarrier2KHR {
- VkStructureType sType;
- const void* pNext;
- VkPipelineStageFlags2KHR srcStageMask;
- VkAccessFlags2KHR srcAccessMask;
- VkPipelineStageFlags2KHR dstStageMask;
- VkAccessFlags2KHR dstAccessMask;
- uint32_t srcQueueFamilyIndex;
- uint32_t dstQueueFamilyIndex;
- VkBuffer buffer;
- VkDeviceSize offset;
- VkDeviceSize size;
-} VkBufferMemoryBarrier2KHR;
+typedef VkPipelineStageFlagBits2 VkPipelineStageFlagBits2KHR;
-typedef struct VkImageMemoryBarrier2KHR {
- VkStructureType sType;
- const void* pNext;
- VkPipelineStageFlags2KHR srcStageMask;
- VkAccessFlags2KHR srcAccessMask;
- VkPipelineStageFlags2KHR dstStageMask;
- VkAccessFlags2KHR dstAccessMask;
- VkImageLayout oldLayout;
- VkImageLayout newLayout;
- uint32_t srcQueueFamilyIndex;
- uint32_t dstQueueFamilyIndex;
- VkImage image;
- VkImageSubresourceRange subresourceRange;
-} VkImageMemoryBarrier2KHR;
-
-typedef struct VkDependencyInfoKHR {
- VkStructureType sType;
- const void* pNext;
- VkDependencyFlags dependencyFlags;
- uint32_t memoryBarrierCount;
- const VkMemoryBarrier2KHR* pMemoryBarriers;
- uint32_t bufferMemoryBarrierCount;
- const VkBufferMemoryBarrier2KHR* pBufferMemoryBarriers;
- uint32_t imageMemoryBarrierCount;
- const VkImageMemoryBarrier2KHR* pImageMemoryBarriers;
-} VkDependencyInfoKHR;
-
-typedef struct VkSemaphoreSubmitInfoKHR {
- VkStructureType sType;
- const void* pNext;
- VkSemaphore semaphore;
- uint64_t value;
- VkPipelineStageFlags2KHR stageMask;
- uint32_t deviceIndex;
-} VkSemaphoreSubmitInfoKHR;
+typedef VkAccessFlags2 VkAccessFlags2KHR;
-typedef struct VkCommandBufferSubmitInfoKHR {
- VkStructureType sType;
- const void* pNext;
- VkCommandBuffer commandBuffer;
- uint32_t deviceMask;
-} VkCommandBufferSubmitInfoKHR;
+typedef VkAccessFlagBits2 VkAccessFlagBits2KHR;
-typedef struct VkSubmitInfo2KHR {
- VkStructureType sType;
- const void* pNext;
- VkSubmitFlagsKHR flags;
- uint32_t waitSemaphoreInfoCount;
- const VkSemaphoreSubmitInfoKHR* pWaitSemaphoreInfos;
- uint32_t commandBufferInfoCount;
- const VkCommandBufferSubmitInfoKHR* pCommandBufferInfos;
- uint32_t signalSemaphoreInfoCount;
- const VkSemaphoreSubmitInfoKHR* pSignalSemaphoreInfos;
-} VkSubmitInfo2KHR;
+typedef VkSubmitFlagBits VkSubmitFlagBitsKHR;
-typedef struct VkPhysicalDeviceSynchronization2FeaturesKHR {
- VkStructureType sType;
- void* pNext;
- VkBool32 synchronization2;
-} VkPhysicalDeviceSynchronization2FeaturesKHR;
+typedef VkSubmitFlags VkSubmitFlagsKHR;
+
+typedef VkMemoryBarrier2 VkMemoryBarrier2KHR;
+
+typedef VkBufferMemoryBarrier2 VkBufferMemoryBarrier2KHR;
+
+typedef VkImageMemoryBarrier2 VkImageMemoryBarrier2KHR;
+
+typedef VkDependencyInfo VkDependencyInfoKHR;
+
+typedef VkSubmitInfo2 VkSubmitInfo2KHR;
+
+typedef VkSemaphoreSubmitInfo VkSemaphoreSubmitInfoKHR;
+
+typedef VkCommandBufferSubmitInfo VkCommandBufferSubmitInfoKHR;
+
+typedef VkPhysicalDeviceSynchronization2Features VkPhysicalDeviceSynchronization2FeaturesKHR;
typedef struct VkQueueFamilyCheckpointProperties2NV {
- VkStructureType sType;
- void* pNext;
- VkPipelineStageFlags2KHR checkpointExecutionStageMask;
+ VkStructureType sType;
+ void* pNext;
+ VkPipelineStageFlags2 checkpointExecutionStageMask;
} VkQueueFamilyCheckpointProperties2NV;
typedef struct VkCheckpointData2NV {
- VkStructureType sType;
- void* pNext;
- VkPipelineStageFlags2KHR stage;
- void* pCheckpointMarker;
+ VkStructureType sType;
+ void* pNext;
+ VkPipelineStageFlags2 stage;
+ void* pCheckpointMarker;
} VkCheckpointData2NV;
-typedef void (VKAPI_PTR *PFN_vkCmdSetEvent2KHR)(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfoKHR* pDependencyInfo);
-typedef void (VKAPI_PTR *PFN_vkCmdResetEvent2KHR)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2KHR stageMask);
-typedef void (VKAPI_PTR *PFN_vkCmdWaitEvents2KHR)(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, const VkDependencyInfoKHR* pDependencyInfos);
-typedef void (VKAPI_PTR *PFN_vkCmdPipelineBarrier2KHR)(VkCommandBuffer commandBuffer, const VkDependencyInfoKHR* pDependencyInfo);
-typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp2KHR)(VkCommandBuffer commandBuffer, VkPipelineStageFlags2KHR stage, VkQueryPool queryPool, uint32_t query);
-typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit2KHR)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2KHR* pSubmits, VkFence fence);
-typedef void (VKAPI_PTR *PFN_vkCmdWriteBufferMarker2AMD)(VkCommandBuffer commandBuffer, VkPipelineStageFlags2KHR stage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker);
+typedef void (VKAPI_PTR *PFN_vkCmdSetEvent2KHR)(VkCommandBuffer commandBuffer, VkEvent event, const VkDependencyInfo* pDependencyInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdResetEvent2KHR)(VkCommandBuffer commandBuffer, VkEvent event, VkPipelineStageFlags2 stageMask);
+typedef void (VKAPI_PTR *PFN_vkCmdWaitEvents2KHR)(VkCommandBuffer commandBuffer, uint32_t eventCount, const VkEvent* pEvents, const VkDependencyInfo* pDependencyInfos);
+typedef void (VKAPI_PTR *PFN_vkCmdPipelineBarrier2KHR)(VkCommandBuffer commandBuffer, const VkDependencyInfo* pDependencyInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdWriteTimestamp2KHR)(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkQueryPool queryPool, uint32_t query);
+typedef VkResult (VKAPI_PTR *PFN_vkQueueSubmit2KHR)(VkQueue queue, uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence);
+typedef void (VKAPI_PTR *PFN_vkCmdWriteBufferMarker2AMD)(VkCommandBuffer commandBuffer, VkPipelineStageFlags2 stage, VkBuffer dstBuffer, VkDeviceSize dstOffset, uint32_t marker);
typedef void (VKAPI_PTR *PFN_vkGetQueueCheckpointData2NV)(VkQueue queue, uint32_t* pCheckpointDataCount, VkCheckpointData2NV* pCheckpointData);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdSetEvent2KHR(
VkCommandBuffer commandBuffer,
VkEvent event,
- const VkDependencyInfoKHR* pDependencyInfo);
+ const VkDependencyInfo* pDependencyInfo);
VKAPI_ATTR void VKAPI_CALL vkCmdResetEvent2KHR(
VkCommandBuffer commandBuffer,
VkEvent event,
- VkPipelineStageFlags2KHR stageMask);
+ VkPipelineStageFlags2 stageMask);
VKAPI_ATTR void VKAPI_CALL vkCmdWaitEvents2KHR(
VkCommandBuffer commandBuffer,
uint32_t eventCount,
const VkEvent* pEvents,
- const VkDependencyInfoKHR* pDependencyInfos);
+ const VkDependencyInfo* pDependencyInfos);
VKAPI_ATTR void VKAPI_CALL vkCmdPipelineBarrier2KHR(
VkCommandBuffer commandBuffer,
- const VkDependencyInfoKHR* pDependencyInfo);
+ const VkDependencyInfo* pDependencyInfo);
VKAPI_ATTR void VKAPI_CALL vkCmdWriteTimestamp2KHR(
VkCommandBuffer commandBuffer,
- VkPipelineStageFlags2KHR stage,
+ VkPipelineStageFlags2 stage,
VkQueryPool queryPool,
uint32_t query);
VKAPI_ATTR VkResult VKAPI_CALL vkQueueSubmit2KHR(
VkQueue queue,
uint32_t submitCount,
- const VkSubmitInfo2KHR* pSubmits,
+ const VkSubmitInfo2* pSubmits,
VkFence fence);
VKAPI_ATTR void VKAPI_CALL vkCmdWriteBufferMarker2AMD(
VkCommandBuffer commandBuffer,
- VkPipelineStageFlags2KHR stage,
+ VkPipelineStageFlags2 stage,
VkBuffer dstBuffer,
VkDeviceSize dstOffset,
uint32_t marker);
@@ -8224,6 +9612,23 @@ VKAPI_ATTR void VKAPI_CALL vkGetQueueCheckpointData2NV(
#endif
+#define VK_KHR_fragment_shader_barycentric 1
+#define VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION 1
+#define VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME "VK_KHR_fragment_shader_barycentric"
+typedef struct VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 fragmentShaderBarycentric;
+} VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR;
+
+typedef struct VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 triStripVertexOrderIndependentOfProvokingVertex;
+} VkPhysicalDeviceFragmentShaderBarycentricPropertiesKHR;
+
+
+
#define VK_KHR_shader_subgroup_uniform_control_flow 1
#define VK_KHR_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_SPEC_VERSION 1
#define VK_KHR_SHADER_SUBGROUP_UNIFORM_CONTROL_FLOW_EXTENSION_NAME "VK_KHR_shader_subgroup_uniform_control_flow"
@@ -8238,11 +9643,7 @@ typedef struct VkPhysicalDeviceShaderSubgroupUniformControlFlowFeaturesKHR {
#define VK_KHR_zero_initialize_workgroup_memory 1
#define VK_KHR_ZERO_INITIALIZE_WORKGROUP_MEMORY_SPEC_VERSION 1
#define VK_KHR_ZERO_INITIALIZE_WORKGROUP_MEMORY_EXTENSION_NAME "VK_KHR_zero_initialize_workgroup_memory"
-typedef struct VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR {
- VkStructureType sType;
- void* pNext;
- VkBool32 shaderZeroInitializeWorkgroupMemory;
-} VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR;
+typedef VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeatures VkPhysicalDeviceZeroInitializeWorkgroupMemoryFeaturesKHR;
@@ -8263,148 +9664,145 @@ typedef struct VkPhysicalDeviceWorkgroupMemoryExplicitLayoutFeaturesKHR {
#define VK_KHR_copy_commands2 1
#define VK_KHR_COPY_COMMANDS_2_SPEC_VERSION 1
#define VK_KHR_COPY_COMMANDS_2_EXTENSION_NAME "VK_KHR_copy_commands2"
-typedef struct VkBufferCopy2KHR {
- VkStructureType sType;
- const void* pNext;
- VkDeviceSize srcOffset;
- VkDeviceSize dstOffset;
- VkDeviceSize size;
-} VkBufferCopy2KHR;
+typedef VkCopyBufferInfo2 VkCopyBufferInfo2KHR;
-typedef struct VkCopyBufferInfo2KHR {
- VkStructureType sType;
- const void* pNext;
- VkBuffer srcBuffer;
- VkBuffer dstBuffer;
- uint32_t regionCount;
- const VkBufferCopy2KHR* pRegions;
-} VkCopyBufferInfo2KHR;
+typedef VkCopyImageInfo2 VkCopyImageInfo2KHR;
-typedef struct VkImageCopy2KHR {
- VkStructureType sType;
- const void* pNext;
- VkImageSubresourceLayers srcSubresource;
- VkOffset3D srcOffset;
- VkImageSubresourceLayers dstSubresource;
- VkOffset3D dstOffset;
- VkExtent3D extent;
-} VkImageCopy2KHR;
+typedef VkCopyBufferToImageInfo2 VkCopyBufferToImageInfo2KHR;
-typedef struct VkCopyImageInfo2KHR {
- VkStructureType sType;
- const void* pNext;
- VkImage srcImage;
- VkImageLayout srcImageLayout;
- VkImage dstImage;
- VkImageLayout dstImageLayout;
- uint32_t regionCount;
- const VkImageCopy2KHR* pRegions;
-} VkCopyImageInfo2KHR;
+typedef VkCopyImageToBufferInfo2 VkCopyImageToBufferInfo2KHR;
-typedef struct VkBufferImageCopy2KHR {
- VkStructureType sType;
- const void* pNext;
- VkDeviceSize bufferOffset;
- uint32_t bufferRowLength;
- uint32_t bufferImageHeight;
- VkImageSubresourceLayers imageSubresource;
- VkOffset3D imageOffset;
- VkExtent3D imageExtent;
-} VkBufferImageCopy2KHR;
+typedef VkBlitImageInfo2 VkBlitImageInfo2KHR;
-typedef struct VkCopyBufferToImageInfo2KHR {
- VkStructureType sType;
- const void* pNext;
- VkBuffer srcBuffer;
- VkImage dstImage;
- VkImageLayout dstImageLayout;
- uint32_t regionCount;
- const VkBufferImageCopy2KHR* pRegions;
-} VkCopyBufferToImageInfo2KHR;
-
-typedef struct VkCopyImageToBufferInfo2KHR {
- VkStructureType sType;
- const void* pNext;
- VkImage srcImage;
- VkImageLayout srcImageLayout;
- VkBuffer dstBuffer;
- uint32_t regionCount;
- const VkBufferImageCopy2KHR* pRegions;
-} VkCopyImageToBufferInfo2KHR;
-
-typedef struct VkImageBlit2KHR {
- VkStructureType sType;
- const void* pNext;
- VkImageSubresourceLayers srcSubresource;
- VkOffset3D srcOffsets[2];
- VkImageSubresourceLayers dstSubresource;
- VkOffset3D dstOffsets[2];
-} VkImageBlit2KHR;
+typedef VkResolveImageInfo2 VkResolveImageInfo2KHR;
-typedef struct VkBlitImageInfo2KHR {
- VkStructureType sType;
- const void* pNext;
- VkImage srcImage;
- VkImageLayout srcImageLayout;
- VkImage dstImage;
- VkImageLayout dstImageLayout;
- uint32_t regionCount;
- const VkImageBlit2KHR* pRegions;
- VkFilter filter;
-} VkBlitImageInfo2KHR;
+typedef VkBufferCopy2 VkBufferCopy2KHR;
-typedef struct VkImageResolve2KHR {
- VkStructureType sType;
- const void* pNext;
- VkImageSubresourceLayers srcSubresource;
- VkOffset3D srcOffset;
- VkImageSubresourceLayers dstSubresource;
- VkOffset3D dstOffset;
- VkExtent3D extent;
-} VkImageResolve2KHR;
+typedef VkImageCopy2 VkImageCopy2KHR;
-typedef struct VkResolveImageInfo2KHR {
- VkStructureType sType;
- const void* pNext;
- VkImage srcImage;
- VkImageLayout srcImageLayout;
- VkImage dstImage;
- VkImageLayout dstImageLayout;
- uint32_t regionCount;
- const VkImageResolve2KHR* pRegions;
-} VkResolveImageInfo2KHR;
+typedef VkImageBlit2 VkImageBlit2KHR;
+
+typedef VkBufferImageCopy2 VkBufferImageCopy2KHR;
+
+typedef VkImageResolve2 VkImageResolve2KHR;
-typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer2KHR)(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2KHR* pCopyBufferInfo);
-typedef void (VKAPI_PTR *PFN_vkCmdCopyImage2KHR)(VkCommandBuffer commandBuffer, const VkCopyImageInfo2KHR* pCopyImageInfo);
-typedef void (VKAPI_PTR *PFN_vkCmdCopyBufferToImage2KHR)(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo);
-typedef void (VKAPI_PTR *PFN_vkCmdCopyImageToBuffer2KHR)(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo);
-typedef void (VKAPI_PTR *PFN_vkCmdBlitImage2KHR)(VkCommandBuffer commandBuffer, const VkBlitImageInfo2KHR* pBlitImageInfo);
-typedef void (VKAPI_PTR *PFN_vkCmdResolveImage2KHR)(VkCommandBuffer commandBuffer, const VkResolveImageInfo2KHR* pResolveImageInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdCopyBuffer2KHR)(VkCommandBuffer commandBuffer, const VkCopyBufferInfo2* pCopyBufferInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdCopyImage2KHR)(VkCommandBuffer commandBuffer, const VkCopyImageInfo2* pCopyImageInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdCopyBufferToImage2KHR)(VkCommandBuffer commandBuffer, const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdCopyImageToBuffer2KHR)(VkCommandBuffer commandBuffer, const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdBlitImage2KHR)(VkCommandBuffer commandBuffer, const VkBlitImageInfo2* pBlitImageInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdResolveImage2KHR)(VkCommandBuffer commandBuffer, const VkResolveImageInfo2* pResolveImageInfo);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR void VKAPI_CALL vkCmdCopyBuffer2KHR(
VkCommandBuffer commandBuffer,
- const VkCopyBufferInfo2KHR* pCopyBufferInfo);
+ const VkCopyBufferInfo2* pCopyBufferInfo);
VKAPI_ATTR void VKAPI_CALL vkCmdCopyImage2KHR(
VkCommandBuffer commandBuffer,
- const VkCopyImageInfo2KHR* pCopyImageInfo);
+ const VkCopyImageInfo2* pCopyImageInfo);
VKAPI_ATTR void VKAPI_CALL vkCmdCopyBufferToImage2KHR(
VkCommandBuffer commandBuffer,
- const VkCopyBufferToImageInfo2KHR* pCopyBufferToImageInfo);
+ const VkCopyBufferToImageInfo2* pCopyBufferToImageInfo);
VKAPI_ATTR void VKAPI_CALL vkCmdCopyImageToBuffer2KHR(
VkCommandBuffer commandBuffer,
- const VkCopyImageToBufferInfo2KHR* pCopyImageToBufferInfo);
+ const VkCopyImageToBufferInfo2* pCopyImageToBufferInfo);
VKAPI_ATTR void VKAPI_CALL vkCmdBlitImage2KHR(
VkCommandBuffer commandBuffer,
- const VkBlitImageInfo2KHR* pBlitImageInfo);
+ const VkBlitImageInfo2* pBlitImageInfo);
VKAPI_ATTR void VKAPI_CALL vkCmdResolveImage2KHR(
VkCommandBuffer commandBuffer,
- const VkResolveImageInfo2KHR* pResolveImageInfo);
+ const VkResolveImageInfo2* pResolveImageInfo);
+#endif
+
+
+#define VK_KHR_format_feature_flags2 1
+#define VK_KHR_FORMAT_FEATURE_FLAGS_2_SPEC_VERSION 2
+#define VK_KHR_FORMAT_FEATURE_FLAGS_2_EXTENSION_NAME "VK_KHR_format_feature_flags2"
+typedef VkFormatFeatureFlags2 VkFormatFeatureFlags2KHR;
+
+typedef VkFormatFeatureFlagBits2 VkFormatFeatureFlagBits2KHR;
+
+typedef VkFormatProperties3 VkFormatProperties3KHR;
+
+
+
+#define VK_KHR_ray_tracing_maintenance1 1
+#define VK_KHR_RAY_TRACING_MAINTENANCE_1_SPEC_VERSION 1
+#define VK_KHR_RAY_TRACING_MAINTENANCE_1_EXTENSION_NAME "VK_KHR_ray_tracing_maintenance1"
+typedef struct VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 rayTracingMaintenance1;
+ VkBool32 rayTracingPipelineTraceRaysIndirect2;
+} VkPhysicalDeviceRayTracingMaintenance1FeaturesKHR;
+
+typedef struct VkTraceRaysIndirectCommand2KHR {
+ VkDeviceAddress raygenShaderRecordAddress;
+ VkDeviceSize raygenShaderRecordSize;
+ VkDeviceAddress missShaderBindingTableAddress;
+ VkDeviceSize missShaderBindingTableSize;
+ VkDeviceSize missShaderBindingTableStride;
+ VkDeviceAddress hitShaderBindingTableAddress;
+ VkDeviceSize hitShaderBindingTableSize;
+ VkDeviceSize hitShaderBindingTableStride;
+ VkDeviceAddress callableShaderBindingTableAddress;
+ VkDeviceSize callableShaderBindingTableSize;
+ VkDeviceSize callableShaderBindingTableStride;
+ uint32_t width;
+ uint32_t height;
+ uint32_t depth;
+} VkTraceRaysIndirectCommand2KHR;
+
+typedef void (VKAPI_PTR *PFN_vkCmdTraceRaysIndirect2KHR)(VkCommandBuffer commandBuffer, VkDeviceAddress indirectDeviceAddress);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkCmdTraceRaysIndirect2KHR(
+ VkCommandBuffer commandBuffer,
+ VkDeviceAddress indirectDeviceAddress);
+#endif
+
+
+#define VK_KHR_portability_enumeration 1
+#define VK_KHR_PORTABILITY_ENUMERATION_SPEC_VERSION 1
+#define VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME "VK_KHR_portability_enumeration"
+
+
+#define VK_KHR_maintenance4 1
+#define VK_KHR_MAINTENANCE_4_SPEC_VERSION 2
+#define VK_KHR_MAINTENANCE_4_EXTENSION_NAME "VK_KHR_maintenance4"
+typedef VkPhysicalDeviceMaintenance4Features VkPhysicalDeviceMaintenance4FeaturesKHR;
+
+typedef VkPhysicalDeviceMaintenance4Properties VkPhysicalDeviceMaintenance4PropertiesKHR;
+
+typedef VkDeviceBufferMemoryRequirements VkDeviceBufferMemoryRequirementsKHR;
+
+typedef VkDeviceImageMemoryRequirements VkDeviceImageMemoryRequirementsKHR;
+
+typedef void (VKAPI_PTR *PFN_vkGetDeviceBufferMemoryRequirementsKHR)(VkDevice device, const VkDeviceBufferMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements);
+typedef void (VKAPI_PTR *PFN_vkGetDeviceImageMemoryRequirementsKHR)(VkDevice device, const VkDeviceImageMemoryRequirements* pInfo, VkMemoryRequirements2* pMemoryRequirements);
+typedef void (VKAPI_PTR *PFN_vkGetDeviceImageSparseMemoryRequirementsKHR)(VkDevice device, const VkDeviceImageMemoryRequirements* pInfo, uint32_t* pSparseMemoryRequirementCount, VkSparseImageMemoryRequirements2* pSparseMemoryRequirements);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkGetDeviceBufferMemoryRequirementsKHR(
+ VkDevice device,
+ const VkDeviceBufferMemoryRequirements* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements);
+
+VKAPI_ATTR void VKAPI_CALL vkGetDeviceImageMemoryRequirementsKHR(
+ VkDevice device,
+ const VkDeviceImageMemoryRequirements* pInfo,
+ VkMemoryRequirements2* pMemoryRequirements);
+
+VKAPI_ATTR void VKAPI_CALL vkGetDeviceImageSparseMemoryRequirementsKHR(
+ VkDevice device,
+ const VkDeviceImageMemoryRequirements* pInfo,
+ uint32_t* pSparseMemoryRequirementCount,
+ VkSparseImageMemoryRequirements2* pSparseMemoryRequirements);
#endif
@@ -8452,6 +9850,7 @@ typedef enum VkDebugReportObjectTypeEXT {
VK_DEBUG_REPORT_OBJECT_TYPE_CU_FUNCTION_NVX_EXT = 1000029001,
VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_KHR_EXT = 1000150000,
VK_DEBUG_REPORT_OBJECT_TYPE_ACCELERATION_STRUCTURE_NV_EXT = 1000165000,
+ VK_DEBUG_REPORT_OBJECT_TYPE_BUFFER_COLLECTION_FUCHSIA_EXT = 1000366000,
VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DEBUG_REPORT_CALLBACK_EXT_EXT,
VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_VALIDATION_CACHE_EXT_EXT,
VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_KHR_EXT = VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_UPDATE_TEMPLATE_EXT,
@@ -9037,11 +10436,7 @@ typedef struct VkValidationFlagsEXT {
#define VK_EXT_texture_compression_astc_hdr 1
#define VK_EXT_TEXTURE_COMPRESSION_ASTC_HDR_SPEC_VERSION 1
#define VK_EXT_TEXTURE_COMPRESSION_ASTC_HDR_EXTENSION_NAME "VK_EXT_texture_compression_astc_hdr"
-typedef struct VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT {
- VkStructureType sType;
- void* pNext;
- VkBool32 textureCompressionASTC_HDR;
-} VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT;
+typedef VkPhysicalDeviceTextureCompressionASTCHDRFeatures VkPhysicalDeviceTextureCompressionASTCHDRFeaturesEXT;
@@ -9062,6 +10457,51 @@ typedef struct VkPhysicalDeviceASTCDecodeFeaturesEXT {
+#define VK_EXT_pipeline_robustness 1
+#define VK_EXT_PIPELINE_ROBUSTNESS_SPEC_VERSION 1
+#define VK_EXT_PIPELINE_ROBUSTNESS_EXTENSION_NAME "VK_EXT_pipeline_robustness"
+
+typedef enum VkPipelineRobustnessBufferBehaviorEXT {
+ VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DEVICE_DEFAULT_EXT = 0,
+ VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_DISABLED_EXT = 1,
+ VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_EXT = 2,
+ VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_ROBUST_BUFFER_ACCESS_2_EXT = 3,
+ VK_PIPELINE_ROBUSTNESS_BUFFER_BEHAVIOR_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkPipelineRobustnessBufferBehaviorEXT;
+
+typedef enum VkPipelineRobustnessImageBehaviorEXT {
+ VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DEVICE_DEFAULT_EXT = 0,
+ VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_DISABLED_EXT = 1,
+ VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_EXT = 2,
+ VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_ROBUST_IMAGE_ACCESS_2_EXT = 3,
+ VK_PIPELINE_ROBUSTNESS_IMAGE_BEHAVIOR_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkPipelineRobustnessImageBehaviorEXT;
+typedef struct VkPhysicalDevicePipelineRobustnessFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 pipelineRobustness;
+} VkPhysicalDevicePipelineRobustnessFeaturesEXT;
+
+typedef struct VkPhysicalDevicePipelineRobustnessPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessStorageBuffers;
+ VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessUniformBuffers;
+ VkPipelineRobustnessBufferBehaviorEXT defaultRobustnessVertexInputs;
+ VkPipelineRobustnessImageBehaviorEXT defaultRobustnessImages;
+} VkPhysicalDevicePipelineRobustnessPropertiesEXT;
+
+typedef struct VkPipelineRobustnessCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkPipelineRobustnessBufferBehaviorEXT storageBuffers;
+ VkPipelineRobustnessBufferBehaviorEXT uniformBuffers;
+ VkPipelineRobustnessBufferBehaviorEXT vertexInputs;
+ VkPipelineRobustnessImageBehaviorEXT images;
+} VkPipelineRobustnessCreateInfoEXT;
+
+
+
#define VK_EXT_conditional_rendering 1
#define VK_EXT_CONDITIONAL_RENDERING_SPEC_VERSION 2
#define VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME "VK_EXT_conditional_rendering"
@@ -9517,6 +10957,7 @@ typedef enum VkDebugUtilsMessageTypeFlagBitsEXT {
VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT = 0x00000001,
VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT = 0x00000002,
VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT = 0x00000004,
+ VK_DEBUG_UTILS_MESSAGE_TYPE_DEVICE_ADDRESS_BINDING_BIT_EXT = 0x00000008,
VK_DEBUG_UTILS_MESSAGE_TYPE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
} VkDebugUtilsMessageTypeFlagBitsEXT;
typedef VkFlags VkDebugUtilsMessageTypeFlagsEXT;
@@ -9669,35 +11110,13 @@ typedef VkPhysicalDeviceSamplerFilterMinmaxProperties VkPhysicalDeviceSamplerFil
#define VK_EXT_inline_uniform_block 1
#define VK_EXT_INLINE_UNIFORM_BLOCK_SPEC_VERSION 1
#define VK_EXT_INLINE_UNIFORM_BLOCK_EXTENSION_NAME "VK_EXT_inline_uniform_block"
-typedef struct VkPhysicalDeviceInlineUniformBlockFeaturesEXT {
- VkStructureType sType;
- void* pNext;
- VkBool32 inlineUniformBlock;
- VkBool32 descriptorBindingInlineUniformBlockUpdateAfterBind;
-} VkPhysicalDeviceInlineUniformBlockFeaturesEXT;
+typedef VkPhysicalDeviceInlineUniformBlockFeatures VkPhysicalDeviceInlineUniformBlockFeaturesEXT;
-typedef struct VkPhysicalDeviceInlineUniformBlockPropertiesEXT {
- VkStructureType sType;
- void* pNext;
- uint32_t maxInlineUniformBlockSize;
- uint32_t maxPerStageDescriptorInlineUniformBlocks;
- uint32_t maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks;
- uint32_t maxDescriptorSetInlineUniformBlocks;
- uint32_t maxDescriptorSetUpdateAfterBindInlineUniformBlocks;
-} VkPhysicalDeviceInlineUniformBlockPropertiesEXT;
+typedef VkPhysicalDeviceInlineUniformBlockProperties VkPhysicalDeviceInlineUniformBlockPropertiesEXT;
-typedef struct VkWriteDescriptorSetInlineUniformBlockEXT {
- VkStructureType sType;
- const void* pNext;
- uint32_t dataSize;
- const void* pData;
-} VkWriteDescriptorSetInlineUniformBlockEXT;
+typedef VkWriteDescriptorSetInlineUniformBlock VkWriteDescriptorSetInlineUniformBlockEXT;
-typedef struct VkDescriptorPoolInlineUniformBlockCreateInfoEXT {
- VkStructureType sType;
- const void* pNext;
- uint32_t maxInlineUniformBlockBindings;
-} VkDescriptorPoolInlineUniformBlockCreateInfoEXT;
+typedef VkDescriptorPoolInlineUniformBlockCreateInfo VkDescriptorPoolInlineUniformBlockCreateInfoEXT;
@@ -9884,7 +11303,7 @@ typedef struct VkPhysicalDeviceShaderSMBuiltinsFeaturesNV {
#define VK_EXT_image_drm_format_modifier 1
-#define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_SPEC_VERSION 1
+#define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_SPEC_VERSION 2
#define VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME "VK_EXT_image_drm_format_modifier"
typedef struct VkDrmFormatModifierPropertiesEXT {
uint64_t drmFormatModifier;
@@ -9929,6 +11348,19 @@ typedef struct VkImageDrmFormatModifierPropertiesEXT {
uint64_t drmFormatModifier;
} VkImageDrmFormatModifierPropertiesEXT;
+typedef struct VkDrmFormatModifierProperties2EXT {
+ uint64_t drmFormatModifier;
+ uint32_t drmFormatModifierPlaneCount;
+ VkFormatFeatureFlags2 drmFormatModifierTilingFeatures;
+} VkDrmFormatModifierProperties2EXT;
+
+typedef struct VkDrmFormatModifierPropertiesList2EXT {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t drmFormatModifierCount;
+ VkDrmFormatModifierProperties2EXT* pDrmFormatModifierProperties;
+} VkDrmFormatModifierPropertiesList2EXT;
+
typedef VkResult (VKAPI_PTR *PFN_vkGetImageDrmFormatModifierPropertiesEXT)(VkDevice device, VkImage image, VkImageDrmFormatModifierPropertiesEXT* pProperties);
#ifndef VK_NO_PROTOTYPES
@@ -10196,6 +11628,8 @@ typedef enum VkGeometryInstanceFlagBitsKHR {
VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR = 0x00000002,
VK_GEOMETRY_INSTANCE_FORCE_OPAQUE_BIT_KHR = 0x00000004,
VK_GEOMETRY_INSTANCE_FORCE_NO_OPAQUE_BIT_KHR = 0x00000008,
+ VK_GEOMETRY_INSTANCE_FORCE_OPACITY_MICROMAP_2_STATE_EXT = 0x00000010,
+ VK_GEOMETRY_INSTANCE_DISABLE_OPACITY_MICROMAPS_EXT = 0x00000020,
VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR = VK_GEOMETRY_INSTANCE_TRIANGLE_FLIP_FACING_BIT_KHR,
VK_GEOMETRY_INSTANCE_TRIANGLE_CULL_DISABLE_BIT_NV = VK_GEOMETRY_INSTANCE_TRIANGLE_FACING_CULL_DISABLE_BIT_KHR,
VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_NV = VK_GEOMETRY_INSTANCE_TRIANGLE_FRONT_COUNTERCLOCKWISE_BIT_KHR,
@@ -10216,6 +11650,9 @@ typedef enum VkBuildAccelerationStructureFlagBitsKHR {
VK_BUILD_ACCELERATION_STRUCTURE_PREFER_FAST_BUILD_BIT_KHR = 0x00000008,
VK_BUILD_ACCELERATION_STRUCTURE_LOW_MEMORY_BIT_KHR = 0x00000010,
VK_BUILD_ACCELERATION_STRUCTURE_MOTION_BIT_NV = 0x00000020,
+ 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,
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,
@@ -10530,19 +11967,9 @@ typedef struct VkFilterCubicImageViewImageFormatPropertiesEXT {
#define VK_EXT_global_priority 1
#define VK_EXT_GLOBAL_PRIORITY_SPEC_VERSION 2
#define VK_EXT_GLOBAL_PRIORITY_EXTENSION_NAME "VK_EXT_global_priority"
+typedef VkQueueGlobalPriorityKHR VkQueueGlobalPriorityEXT;
-typedef enum VkQueueGlobalPriorityEXT {
- VK_QUEUE_GLOBAL_PRIORITY_LOW_EXT = 128,
- VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT = 256,
- VK_QUEUE_GLOBAL_PRIORITY_HIGH_EXT = 512,
- VK_QUEUE_GLOBAL_PRIORITY_REALTIME_EXT = 1024,
- VK_QUEUE_GLOBAL_PRIORITY_MAX_ENUM_EXT = 0x7FFFFFFF
-} VkQueueGlobalPriorityEXT;
-typedef struct VkDeviceQueueGlobalPriorityCreateInfoEXT {
- VkStructureType sType;
- const void* pNext;
- VkQueueGlobalPriorityEXT globalPriority;
-} VkDeviceQueueGlobalPriorityCreateInfoEXT;
+typedef VkDeviceQueueGlobalPriorityCreateInfoKHR VkDeviceQueueGlobalPriorityCreateInfoEXT;
@@ -10720,26 +12147,13 @@ typedef struct VkPhysicalDeviceVertexAttributeDivisorFeaturesEXT {
#define VK_EXT_pipeline_creation_feedback 1
#define VK_EXT_PIPELINE_CREATION_FEEDBACK_SPEC_VERSION 1
#define VK_EXT_PIPELINE_CREATION_FEEDBACK_EXTENSION_NAME "VK_EXT_pipeline_creation_feedback"
+typedef VkPipelineCreationFeedbackFlagBits VkPipelineCreationFeedbackFlagBitsEXT;
-typedef enum VkPipelineCreationFeedbackFlagBitsEXT {
- VK_PIPELINE_CREATION_FEEDBACK_VALID_BIT_EXT = 0x00000001,
- VK_PIPELINE_CREATION_FEEDBACK_APPLICATION_PIPELINE_CACHE_HIT_BIT_EXT = 0x00000002,
- VK_PIPELINE_CREATION_FEEDBACK_BASE_PIPELINE_ACCELERATION_BIT_EXT = 0x00000004,
- VK_PIPELINE_CREATION_FEEDBACK_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
-} VkPipelineCreationFeedbackFlagBitsEXT;
-typedef VkFlags VkPipelineCreationFeedbackFlagsEXT;
-typedef struct VkPipelineCreationFeedbackEXT {
- VkPipelineCreationFeedbackFlagsEXT flags;
- uint64_t duration;
-} VkPipelineCreationFeedbackEXT;
-
-typedef struct VkPipelineCreationFeedbackCreateInfoEXT {
- VkStructureType sType;
- const void* pNext;
- VkPipelineCreationFeedbackEXT* pPipelineCreationFeedback;
- uint32_t pipelineStageCreationFeedbackCount;
- VkPipelineCreationFeedbackEXT* pPipelineStageCreationFeedbacks;
-} VkPipelineCreationFeedbackCreateInfoEXT;
+typedef VkPipelineCreationFeedbackFlags VkPipelineCreationFeedbackFlagsEXT;
+
+typedef VkPipelineCreationFeedbackCreateInfo VkPipelineCreationFeedbackCreateInfoEXT;
+
+typedef VkPipelineCreationFeedback VkPipelineCreationFeedbackEXT;
@@ -10824,11 +12238,7 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDrawMeshTasksIndirectCountNV(
#define VK_NV_fragment_shader_barycentric 1
#define VK_NV_FRAGMENT_SHADER_BARYCENTRIC_SPEC_VERSION 1
#define VK_NV_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME "VK_NV_fragment_shader_barycentric"
-typedef struct VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV {
- VkStructureType sType;
- void* pNext;
- VkBool32 fragmentShaderBarycentric;
-} VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV;
+typedef VkPhysicalDeviceFragmentShaderBarycentricFeaturesKHR VkPhysicalDeviceFragmentShaderBarycentricFeaturesNV;
@@ -11090,7 +12500,7 @@ VKAPI_ATTR void VKAPI_CALL vkSetLocalDimmingAMD(
#define VK_EXT_fragment_density_map 1
-#define VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION 1
+#define VK_EXT_FRAGMENT_DENSITY_MAP_SPEC_VERSION 2
#define VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME "VK_EXT_fragment_density_map"
typedef struct VkPhysicalDeviceFragmentDensityMapFeaturesEXT {
VkStructureType sType;
@@ -11138,27 +12548,11 @@ typedef VkPhysicalDeviceScalarBlockLayoutFeatures VkPhysicalDeviceScalarBlockLay
#define VK_EXT_subgroup_size_control 1
#define VK_EXT_SUBGROUP_SIZE_CONTROL_SPEC_VERSION 2
#define VK_EXT_SUBGROUP_SIZE_CONTROL_EXTENSION_NAME "VK_EXT_subgroup_size_control"
-typedef struct VkPhysicalDeviceSubgroupSizeControlFeaturesEXT {
- VkStructureType sType;
- void* pNext;
- VkBool32 subgroupSizeControl;
- VkBool32 computeFullSubgroups;
-} VkPhysicalDeviceSubgroupSizeControlFeaturesEXT;
+typedef VkPhysicalDeviceSubgroupSizeControlFeatures VkPhysicalDeviceSubgroupSizeControlFeaturesEXT;
-typedef struct VkPhysicalDeviceSubgroupSizeControlPropertiesEXT {
- VkStructureType sType;
- void* pNext;
- uint32_t minSubgroupSize;
- uint32_t maxSubgroupSize;
- uint32_t maxComputeWorkgroupSubgroups;
- VkShaderStageFlags requiredSubgroupSizeStages;
-} VkPhysicalDeviceSubgroupSizeControlPropertiesEXT;
+typedef VkPhysicalDeviceSubgroupSizeControlProperties VkPhysicalDeviceSubgroupSizeControlPropertiesEXT;
-typedef struct VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT {
- VkStructureType sType;
- void* pNext;
- uint32_t requiredSubgroupSize;
-} VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT;
+typedef VkPipelineShaderStageRequiredSubgroupSizeCreateInfo VkPipelineShaderStageRequiredSubgroupSizeCreateInfoEXT;
@@ -11275,35 +12669,19 @@ VKAPI_ATTR VkDeviceAddress VKAPI_CALL vkGetBufferDeviceAddressEXT(
#define VK_EXT_tooling_info 1
#define VK_EXT_TOOLING_INFO_SPEC_VERSION 1
#define VK_EXT_TOOLING_INFO_EXTENSION_NAME "VK_EXT_tooling_info"
+typedef VkToolPurposeFlagBits VkToolPurposeFlagBitsEXT;
-typedef enum VkToolPurposeFlagBitsEXT {
- VK_TOOL_PURPOSE_VALIDATION_BIT_EXT = 0x00000001,
- VK_TOOL_PURPOSE_PROFILING_BIT_EXT = 0x00000002,
- VK_TOOL_PURPOSE_TRACING_BIT_EXT = 0x00000004,
- VK_TOOL_PURPOSE_ADDITIONAL_FEATURES_BIT_EXT = 0x00000008,
- VK_TOOL_PURPOSE_MODIFYING_FEATURES_BIT_EXT = 0x00000010,
- VK_TOOL_PURPOSE_DEBUG_REPORTING_BIT_EXT = 0x00000020,
- VK_TOOL_PURPOSE_DEBUG_MARKERS_BIT_EXT = 0x00000040,
- VK_TOOL_PURPOSE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
-} VkToolPurposeFlagBitsEXT;
-typedef VkFlags VkToolPurposeFlagsEXT;
-typedef struct VkPhysicalDeviceToolPropertiesEXT {
- VkStructureType sType;
- void* pNext;
- char name[VK_MAX_EXTENSION_NAME_SIZE];
- char version[VK_MAX_EXTENSION_NAME_SIZE];
- VkToolPurposeFlagsEXT purposes;
- char description[VK_MAX_DESCRIPTION_SIZE];
- char layer[VK_MAX_EXTENSION_NAME_SIZE];
-} VkPhysicalDeviceToolPropertiesEXT;
+typedef VkToolPurposeFlags VkToolPurposeFlagsEXT;
+
+typedef VkPhysicalDeviceToolProperties VkPhysicalDeviceToolPropertiesEXT;
-typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceToolPropertiesEXT)(VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolPropertiesEXT* pToolProperties);
+typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceToolPropertiesEXT)(VkPhysicalDevice physicalDevice, uint32_t* pToolCount, VkPhysicalDeviceToolProperties* pToolProperties);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceToolPropertiesEXT(
VkPhysicalDevice physicalDevice,
uint32_t* pToolCount,
- VkPhysicalDeviceToolPropertiesEXT* pToolProperties);
+ VkPhysicalDeviceToolProperties* pToolProperties);
#endif
@@ -11734,11 +13112,7 @@ typedef struct VkPhysicalDeviceShaderAtomicFloat2FeaturesEXT {
#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"
-typedef struct VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT {
- VkStructureType sType;
- void* pNext;
- VkBool32 shaderDemoteToHelperInvocation;
-} VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT;
+typedef VkPhysicalDeviceShaderDemoteToHelperInvocationFeatures VkPhysicalDeviceShaderDemoteToHelperInvocationFeaturesEXT;
@@ -11756,6 +13130,7 @@ typedef enum VkIndirectCommandsTokenTypeNV {
VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_INDEXED_NV = 5,
VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_NV = 6,
VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_TASKS_NV = 7,
+ VK_INDIRECT_COMMANDS_TOKEN_TYPE_DRAW_MESH_TASKS_NV = 1000328000,
VK_INDIRECT_COMMANDS_TOKEN_TYPE_MAX_ENUM_NV = 0x7FFFFFFF
} VkIndirectCommandsTokenTypeNV;
@@ -11960,19 +13335,12 @@ typedef struct VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT {
VkBool32 texelBufferAlignment;
} VkPhysicalDeviceTexelBufferAlignmentFeaturesEXT;
-typedef struct VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT {
- VkStructureType sType;
- void* pNext;
- VkDeviceSize storageTexelBufferOffsetAlignmentBytes;
- VkBool32 storageTexelBufferOffsetSingleTexelAlignment;
- VkDeviceSize uniformTexelBufferOffsetAlignmentBytes;
- VkBool32 uniformTexelBufferOffsetSingleTexelAlignment;
-} VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT;
+typedef VkPhysicalDeviceTexelBufferAlignmentProperties VkPhysicalDeviceTexelBufferAlignmentPropertiesEXT;
#define VK_QCOM_render_pass_transform 1
-#define VK_QCOM_RENDER_PASS_TRANSFORM_SPEC_VERSION 2
+#define VK_QCOM_RENDER_PASS_TRANSFORM_SPEC_VERSION 3
#define VK_QCOM_RENDER_PASS_TRANSFORM_EXTENSION_NAME "VK_QCOM_render_pass_transform"
typedef struct VkRenderPassTransformBeginInfoQCOM {
VkStructureType sType;
@@ -12104,62 +13472,71 @@ typedef struct VkPhysicalDeviceCustomBorderColorFeaturesEXT {
#define VK_GOOGLE_USER_TYPE_EXTENSION_NAME "VK_GOOGLE_user_type"
-#define VK_EXT_private_data 1
-VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkPrivateDataSlotEXT)
-#define VK_EXT_PRIVATE_DATA_SPEC_VERSION 1
-#define VK_EXT_PRIVATE_DATA_EXTENSION_NAME "VK_EXT_private_data"
+#define VK_NV_present_barrier 1
+#define VK_NV_PRESENT_BARRIER_SPEC_VERSION 1
+#define VK_NV_PRESENT_BARRIER_EXTENSION_NAME "VK_NV_present_barrier"
+typedef struct VkPhysicalDevicePresentBarrierFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 presentBarrier;
+} VkPhysicalDevicePresentBarrierFeaturesNV;
-typedef enum VkPrivateDataSlotCreateFlagBitsEXT {
- VK_PRIVATE_DATA_SLOT_CREATE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
-} VkPrivateDataSlotCreateFlagBitsEXT;
-typedef VkFlags VkPrivateDataSlotCreateFlagsEXT;
-typedef struct VkPhysicalDevicePrivateDataFeaturesEXT {
+typedef struct VkSurfaceCapabilitiesPresentBarrierNV {
VkStructureType sType;
void* pNext;
- VkBool32 privateData;
-} VkPhysicalDevicePrivateDataFeaturesEXT;
+ VkBool32 presentBarrierSupported;
+} VkSurfaceCapabilitiesPresentBarrierNV;
-typedef struct VkDevicePrivateDataCreateInfoEXT {
+typedef struct VkSwapchainPresentBarrierCreateInfoNV {
VkStructureType sType;
- const void* pNext;
- uint32_t privateDataSlotRequestCount;
-} VkDevicePrivateDataCreateInfoEXT;
+ void* pNext;
+ VkBool32 presentBarrierEnable;
+} VkSwapchainPresentBarrierCreateInfoNV;
-typedef struct VkPrivateDataSlotCreateInfoEXT {
- VkStructureType sType;
- const void* pNext;
- VkPrivateDataSlotCreateFlagsEXT flags;
-} VkPrivateDataSlotCreateInfoEXT;
-typedef VkResult (VKAPI_PTR *PFN_vkCreatePrivateDataSlotEXT)(VkDevice device, const VkPrivateDataSlotCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPrivateDataSlotEXT* pPrivateDataSlot);
-typedef void (VKAPI_PTR *PFN_vkDestroyPrivateDataSlotEXT)(VkDevice device, VkPrivateDataSlotEXT privateDataSlot, const VkAllocationCallbacks* pAllocator);
-typedef VkResult (VKAPI_PTR *PFN_vkSetPrivateDataEXT)(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t data);
-typedef void (VKAPI_PTR *PFN_vkGetPrivateDataEXT)(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlotEXT privateDataSlot, uint64_t* pData);
+
+#define VK_EXT_private_data 1
+typedef VkPrivateDataSlot VkPrivateDataSlotEXT;
+
+#define VK_EXT_PRIVATE_DATA_SPEC_VERSION 1
+#define VK_EXT_PRIVATE_DATA_EXTENSION_NAME "VK_EXT_private_data"
+typedef VkPrivateDataSlotCreateFlags VkPrivateDataSlotCreateFlagsEXT;
+
+typedef VkPhysicalDevicePrivateDataFeatures VkPhysicalDevicePrivateDataFeaturesEXT;
+
+typedef VkDevicePrivateDataCreateInfo VkDevicePrivateDataCreateInfoEXT;
+
+typedef VkPrivateDataSlotCreateInfo VkPrivateDataSlotCreateInfoEXT;
+
+typedef VkResult (VKAPI_PTR *PFN_vkCreatePrivateDataSlotEXT)(VkDevice device, const VkPrivateDataSlotCreateInfo* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkPrivateDataSlot* pPrivateDataSlot);
+typedef void (VKAPI_PTR *PFN_vkDestroyPrivateDataSlotEXT)(VkDevice device, VkPrivateDataSlot privateDataSlot, const VkAllocationCallbacks* pAllocator);
+typedef VkResult (VKAPI_PTR *PFN_vkSetPrivateDataEXT)(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t data);
+typedef void (VKAPI_PTR *PFN_vkGetPrivateDataEXT)(VkDevice device, VkObjectType objectType, uint64_t objectHandle, VkPrivateDataSlot privateDataSlot, uint64_t* pData);
#ifndef VK_NO_PROTOTYPES
VKAPI_ATTR VkResult VKAPI_CALL vkCreatePrivateDataSlotEXT(
VkDevice device,
- const VkPrivateDataSlotCreateInfoEXT* pCreateInfo,
+ const VkPrivateDataSlotCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator,
- VkPrivateDataSlotEXT* pPrivateDataSlot);
+ VkPrivateDataSlot* pPrivateDataSlot);
VKAPI_ATTR void VKAPI_CALL vkDestroyPrivateDataSlotEXT(
VkDevice device,
- VkPrivateDataSlotEXT privateDataSlot,
+ VkPrivateDataSlot privateDataSlot,
const VkAllocationCallbacks* pAllocator);
VKAPI_ATTR VkResult VKAPI_CALL vkSetPrivateDataEXT(
VkDevice device,
VkObjectType objectType,
uint64_t objectHandle,
- VkPrivateDataSlotEXT privateDataSlot,
+ VkPrivateDataSlot privateDataSlot,
uint64_t data);
VKAPI_ATTR void VKAPI_CALL vkGetPrivateDataEXT(
VkDevice device,
VkObjectType objectType,
uint64_t objectHandle,
- VkPrivateDataSlotEXT privateDataSlot,
+ VkPrivateDataSlot privateDataSlot,
uint64_t* pData);
#endif
@@ -12167,22 +13544,19 @@ VKAPI_ATTR void VKAPI_CALL vkGetPrivateDataEXT(
#define VK_EXT_pipeline_creation_cache_control 1
#define VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_SPEC_VERSION 3
#define VK_EXT_PIPELINE_CREATION_CACHE_CONTROL_EXTENSION_NAME "VK_EXT_pipeline_creation_cache_control"
-typedef struct VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT {
- VkStructureType sType;
- void* pNext;
- VkBool32 pipelineCreationCacheControl;
-} VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT;
+typedef VkPhysicalDevicePipelineCreationCacheControlFeatures VkPhysicalDevicePipelineCreationCacheControlFeaturesEXT;
#define VK_NV_device_diagnostics_config 1
-#define VK_NV_DEVICE_DIAGNOSTICS_CONFIG_SPEC_VERSION 1
+#define VK_NV_DEVICE_DIAGNOSTICS_CONFIG_SPEC_VERSION 2
#define VK_NV_DEVICE_DIAGNOSTICS_CONFIG_EXTENSION_NAME "VK_NV_device_diagnostics_config"
typedef enum VkDeviceDiagnosticsConfigFlagBitsNV {
VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_DEBUG_INFO_BIT_NV = 0x00000001,
VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_RESOURCE_TRACKING_BIT_NV = 0x00000002,
VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_AUTOMATIC_CHECKPOINTS_BIT_NV = 0x00000004,
+ VK_DEVICE_DIAGNOSTICS_CONFIG_ENABLE_SHADER_ERROR_REPORTING_BIT_NV = 0x00000008,
VK_DEVICE_DIAGNOSTICS_CONFIG_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF
} VkDeviceDiagnosticsConfigFlagBitsNV;
typedef VkFlags VkDeviceDiagnosticsConfigFlagsNV;
@@ -12205,6 +13579,262 @@ typedef struct VkDeviceDiagnosticsConfigCreateInfoNV {
#define VK_QCOM_RENDER_PASS_STORE_OPS_EXTENSION_NAME "VK_QCOM_render_pass_store_ops"
+#define VK_EXT_descriptor_buffer 1
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureKHR)
+#define VK_EXT_DESCRIPTOR_BUFFER_SPEC_VERSION 1
+#define VK_EXT_DESCRIPTOR_BUFFER_EXTENSION_NAME "VK_EXT_descriptor_buffer"
+typedef struct VkPhysicalDeviceDescriptorBufferPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 combinedImageSamplerDescriptorSingleArray;
+ VkBool32 bufferlessPushDescriptors;
+ VkBool32 allowSamplerImageViewPostSubmitCreation;
+ VkDeviceSize descriptorBufferOffsetAlignment;
+ uint32_t maxDescriptorBufferBindings;
+ uint32_t maxResourceDescriptorBufferBindings;
+ uint32_t maxSamplerDescriptorBufferBindings;
+ uint32_t maxEmbeddedImmutableSamplerBindings;
+ uint32_t maxEmbeddedImmutableSamplers;
+ size_t bufferCaptureReplayDescriptorDataSize;
+ size_t imageCaptureReplayDescriptorDataSize;
+ size_t imageViewCaptureReplayDescriptorDataSize;
+ size_t samplerCaptureReplayDescriptorDataSize;
+ size_t accelerationStructureCaptureReplayDescriptorDataSize;
+ size_t samplerDescriptorSize;
+ size_t combinedImageSamplerDescriptorSize;
+ size_t sampledImageDescriptorSize;
+ size_t storageImageDescriptorSize;
+ size_t uniformTexelBufferDescriptorSize;
+ size_t robustUniformTexelBufferDescriptorSize;
+ size_t storageTexelBufferDescriptorSize;
+ size_t robustStorageTexelBufferDescriptorSize;
+ size_t uniformBufferDescriptorSize;
+ size_t robustUniformBufferDescriptorSize;
+ size_t storageBufferDescriptorSize;
+ size_t robustStorageBufferDescriptorSize;
+ size_t inputAttachmentDescriptorSize;
+ size_t accelerationStructureDescriptorSize;
+ VkDeviceSize maxSamplerDescriptorBufferRange;
+ VkDeviceSize maxResourceDescriptorBufferRange;
+ VkDeviceSize samplerDescriptorBufferAddressSpaceSize;
+ VkDeviceSize resourceDescriptorBufferAddressSpaceSize;
+ VkDeviceSize descriptorBufferAddressSpaceSize;
+} VkPhysicalDeviceDescriptorBufferPropertiesEXT;
+
+typedef struct VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ size_t combinedImageSamplerDensityMapDescriptorSize;
+} VkPhysicalDeviceDescriptorBufferDensityMapPropertiesEXT;
+
+typedef struct VkPhysicalDeviceDescriptorBufferFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 descriptorBuffer;
+ VkBool32 descriptorBufferCaptureReplay;
+ VkBool32 descriptorBufferImageLayoutIgnored;
+ VkBool32 descriptorBufferPushDescriptors;
+} VkPhysicalDeviceDescriptorBufferFeaturesEXT;
+
+typedef struct VkDescriptorAddressInfoEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkDeviceAddress address;
+ VkDeviceSize range;
+ VkFormat format;
+} VkDescriptorAddressInfoEXT;
+
+typedef struct VkDescriptorBufferBindingInfoEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkDeviceAddress address;
+ VkBufferUsageFlags usage;
+} VkDescriptorBufferBindingInfoEXT;
+
+typedef struct VkDescriptorBufferBindingPushDescriptorBufferHandleEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBuffer buffer;
+} VkDescriptorBufferBindingPushDescriptorBufferHandleEXT;
+
+typedef union VkDescriptorDataEXT {
+ const VkSampler* pSampler;
+ const VkDescriptorImageInfo* pCombinedImageSampler;
+ const VkDescriptorImageInfo* pInputAttachmentImage;
+ const VkDescriptorImageInfo* pSampledImage;
+ const VkDescriptorImageInfo* pStorageImage;
+ const VkDescriptorAddressInfoEXT* pUniformTexelBuffer;
+ const VkDescriptorAddressInfoEXT* pStorageTexelBuffer;
+ const VkDescriptorAddressInfoEXT* pUniformBuffer;
+ const VkDescriptorAddressInfoEXT* pStorageBuffer;
+ VkDeviceAddress accelerationStructure;
+} VkDescriptorDataEXT;
+
+typedef struct VkDescriptorGetInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkDescriptorType type;
+ VkDescriptorDataEXT data;
+} VkDescriptorGetInfoEXT;
+
+typedef struct VkBufferCaptureDescriptorDataInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkBuffer buffer;
+} VkBufferCaptureDescriptorDataInfoEXT;
+
+typedef struct VkImageCaptureDescriptorDataInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkImage image;
+} VkImageCaptureDescriptorDataInfoEXT;
+
+typedef struct VkImageViewCaptureDescriptorDataInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkImageView imageView;
+} VkImageViewCaptureDescriptorDataInfoEXT;
+
+typedef struct VkSamplerCaptureDescriptorDataInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkSampler sampler;
+} VkSamplerCaptureDescriptorDataInfoEXT;
+
+typedef struct VkOpaqueCaptureDescriptorDataCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ const void* opaqueCaptureDescriptorData;
+} VkOpaqueCaptureDescriptorDataCreateInfoEXT;
+
+typedef struct VkAccelerationStructureCaptureDescriptorDataInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkAccelerationStructureKHR accelerationStructure;
+ VkAccelerationStructureNV accelerationStructureNV;
+} VkAccelerationStructureCaptureDescriptorDataInfoEXT;
+
+typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutSizeEXT)(VkDevice device, VkDescriptorSetLayout layout, VkDeviceSize* pLayoutSizeInBytes);
+typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutBindingOffsetEXT)(VkDevice device, VkDescriptorSetLayout layout, uint32_t binding, VkDeviceSize* pOffset);
+typedef void (VKAPI_PTR *PFN_vkGetDescriptorEXT)(VkDevice device, const VkDescriptorGetInfoEXT* pDescriptorInfo, size_t dataSize, void* pDescriptor);
+typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorBuffersEXT)(VkCommandBuffer commandBuffer, uint32_t bufferCount, const VkDescriptorBufferBindingInfoEXT* pBindingInfos);
+typedef void (VKAPI_PTR *PFN_vkCmdSetDescriptorBufferOffsetsEXT)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t firstSet, uint32_t setCount, const uint32_t* pBufferIndices, const VkDeviceSize* pOffsets);
+typedef void (VKAPI_PTR *PFN_vkCmdBindDescriptorBufferEmbeddedSamplersEXT)(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipelineBindPoint, VkPipelineLayout layout, uint32_t set);
+typedef VkResult (VKAPI_PTR *PFN_vkGetBufferOpaqueCaptureDescriptorDataEXT)(VkDevice device, const VkBufferCaptureDescriptorDataInfoEXT* pInfo, void* pData);
+typedef VkResult (VKAPI_PTR *PFN_vkGetImageOpaqueCaptureDescriptorDataEXT)(VkDevice device, const VkImageCaptureDescriptorDataInfoEXT* pInfo, void* pData);
+typedef VkResult (VKAPI_PTR *PFN_vkGetImageViewOpaqueCaptureDescriptorDataEXT)(VkDevice device, const VkImageViewCaptureDescriptorDataInfoEXT* pInfo, void* pData);
+typedef VkResult (VKAPI_PTR *PFN_vkGetSamplerOpaqueCaptureDescriptorDataEXT)(VkDevice device, const VkSamplerCaptureDescriptorDataInfoEXT* pInfo, void* pData);
+typedef VkResult (VKAPI_PTR *PFN_vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT)(VkDevice device, const VkAccelerationStructureCaptureDescriptorDataInfoEXT* pInfo, void* pData);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutSizeEXT(
+ VkDevice device,
+ VkDescriptorSetLayout layout,
+ VkDeviceSize* pLayoutSizeInBytes);
+
+VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutBindingOffsetEXT(
+ VkDevice device,
+ VkDescriptorSetLayout layout,
+ uint32_t binding,
+ VkDeviceSize* pOffset);
+
+VKAPI_ATTR void VKAPI_CALL vkGetDescriptorEXT(
+ VkDevice device,
+ const VkDescriptorGetInfoEXT* pDescriptorInfo,
+ size_t dataSize,
+ void* pDescriptor);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorBuffersEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t bufferCount,
+ const VkDescriptorBufferBindingInfoEXT* pBindingInfos);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetDescriptorBufferOffsetsEXT(
+ VkCommandBuffer commandBuffer,
+ VkPipelineBindPoint pipelineBindPoint,
+ VkPipelineLayout layout,
+ uint32_t firstSet,
+ uint32_t setCount,
+ const uint32_t* pBufferIndices,
+ const VkDeviceSize* pOffsets);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdBindDescriptorBufferEmbeddedSamplersEXT(
+ VkCommandBuffer commandBuffer,
+ VkPipelineBindPoint pipelineBindPoint,
+ VkPipelineLayout layout,
+ uint32_t set);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetBufferOpaqueCaptureDescriptorDataEXT(
+ VkDevice device,
+ const VkBufferCaptureDescriptorDataInfoEXT* pInfo,
+ void* pData);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetImageOpaqueCaptureDescriptorDataEXT(
+ VkDevice device,
+ const VkImageCaptureDescriptorDataInfoEXT* pInfo,
+ void* pData);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetImageViewOpaqueCaptureDescriptorDataEXT(
+ VkDevice device,
+ const VkImageViewCaptureDescriptorDataInfoEXT* pInfo,
+ void* pData);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetSamplerOpaqueCaptureDescriptorDataEXT(
+ VkDevice device,
+ const VkSamplerCaptureDescriptorDataInfoEXT* pInfo,
+ void* pData);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetAccelerationStructureOpaqueCaptureDescriptorDataEXT(
+ VkDevice device,
+ const VkAccelerationStructureCaptureDescriptorDataInfoEXT* pInfo,
+ void* pData);
+#endif
+
+
+#define VK_EXT_graphics_pipeline_library 1
+#define VK_EXT_GRAPHICS_PIPELINE_LIBRARY_SPEC_VERSION 1
+#define VK_EXT_GRAPHICS_PIPELINE_LIBRARY_EXTENSION_NAME "VK_EXT_graphics_pipeline_library"
+
+typedef enum VkGraphicsPipelineLibraryFlagBitsEXT {
+ VK_GRAPHICS_PIPELINE_LIBRARY_VERTEX_INPUT_INTERFACE_BIT_EXT = 0x00000001,
+ VK_GRAPHICS_PIPELINE_LIBRARY_PRE_RASTERIZATION_SHADERS_BIT_EXT = 0x00000002,
+ VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_SHADER_BIT_EXT = 0x00000004,
+ VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT = 0x00000008,
+ VK_GRAPHICS_PIPELINE_LIBRARY_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkGraphicsPipelineLibraryFlagBitsEXT;
+typedef VkFlags VkGraphicsPipelineLibraryFlagsEXT;
+typedef struct VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 graphicsPipelineLibrary;
+} VkPhysicalDeviceGraphicsPipelineLibraryFeaturesEXT;
+
+typedef struct VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 graphicsPipelineLibraryFastLinking;
+ VkBool32 graphicsPipelineLibraryIndependentInterpolationDecoration;
+} VkPhysicalDeviceGraphicsPipelineLibraryPropertiesEXT;
+
+typedef struct VkGraphicsPipelineLibraryCreateInfoEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkGraphicsPipelineLibraryFlagsEXT flags;
+} VkGraphicsPipelineLibraryCreateInfoEXT;
+
+
+
+#define VK_AMD_shader_early_and_late_fragment_tests 1
+#define VK_AMD_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_SPEC_VERSION 1
+#define VK_AMD_SHADER_EARLY_AND_LATE_FRAGMENT_TESTS_EXTENSION_NAME "VK_AMD_shader_early_and_late_fragment_tests"
+typedef struct VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 shaderEarlyAndLateFragmentTests;
+} VkPhysicalDeviceShaderEarlyAndLateFragmentTestsFeaturesAMD;
+
+
+
#define VK_NV_fragment_shading_rate_enums 1
#define VK_NV_FRAGMENT_SHADING_RATE_ENUMS_SPEC_VERSION 1
#define VK_NV_FRAGMENT_SHADING_RATE_ENUMS_EXTENSION_NAME "VK_NV_fragment_shading_rate_enums"
@@ -12397,11 +14027,104 @@ typedef struct VkCopyCommandTransformInfoQCOM {
#define VK_EXT_image_robustness 1
#define VK_EXT_IMAGE_ROBUSTNESS_SPEC_VERSION 1
#define VK_EXT_IMAGE_ROBUSTNESS_EXTENSION_NAME "VK_EXT_image_robustness"
-typedef struct VkPhysicalDeviceImageRobustnessFeaturesEXT {
+typedef VkPhysicalDeviceImageRobustnessFeatures VkPhysicalDeviceImageRobustnessFeaturesEXT;
+
+
+
+#define VK_EXT_image_compression_control 1
+#define VK_EXT_IMAGE_COMPRESSION_CONTROL_SPEC_VERSION 1
+#define VK_EXT_IMAGE_COMPRESSION_CONTROL_EXTENSION_NAME "VK_EXT_image_compression_control"
+
+typedef enum VkImageCompressionFlagBitsEXT {
+ VK_IMAGE_COMPRESSION_DEFAULT_EXT = 0,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_DEFAULT_EXT = 0x00000001,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_EXPLICIT_EXT = 0x00000002,
+ VK_IMAGE_COMPRESSION_DISABLED_EXT = 0x00000004,
+ VK_IMAGE_COMPRESSION_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkImageCompressionFlagBitsEXT;
+typedef VkFlags VkImageCompressionFlagsEXT;
+
+typedef enum VkImageCompressionFixedRateFlagBitsEXT {
+ VK_IMAGE_COMPRESSION_FIXED_RATE_NONE_EXT = 0,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_1BPC_BIT_EXT = 0x00000001,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_2BPC_BIT_EXT = 0x00000002,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_3BPC_BIT_EXT = 0x00000004,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_4BPC_BIT_EXT = 0x00000008,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_5BPC_BIT_EXT = 0x00000010,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_6BPC_BIT_EXT = 0x00000020,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_7BPC_BIT_EXT = 0x00000040,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_8BPC_BIT_EXT = 0x00000080,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_9BPC_BIT_EXT = 0x00000100,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_10BPC_BIT_EXT = 0x00000200,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_11BPC_BIT_EXT = 0x00000400,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_12BPC_BIT_EXT = 0x00000800,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_13BPC_BIT_EXT = 0x00001000,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_14BPC_BIT_EXT = 0x00002000,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_15BPC_BIT_EXT = 0x00004000,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_16BPC_BIT_EXT = 0x00008000,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_17BPC_BIT_EXT = 0x00010000,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_18BPC_BIT_EXT = 0x00020000,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_19BPC_BIT_EXT = 0x00040000,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_20BPC_BIT_EXT = 0x00080000,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_21BPC_BIT_EXT = 0x00100000,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_22BPC_BIT_EXT = 0x00200000,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_23BPC_BIT_EXT = 0x00400000,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_24BPC_BIT_EXT = 0x00800000,
+ VK_IMAGE_COMPRESSION_FIXED_RATE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkImageCompressionFixedRateFlagBitsEXT;
+typedef VkFlags VkImageCompressionFixedRateFlagsEXT;
+typedef struct VkPhysicalDeviceImageCompressionControlFeaturesEXT {
VkStructureType sType;
void* pNext;
- VkBool32 robustImageAccess;
-} VkPhysicalDeviceImageRobustnessFeaturesEXT;
+ VkBool32 imageCompressionControl;
+} VkPhysicalDeviceImageCompressionControlFeaturesEXT;
+
+typedef struct VkImageCompressionControlEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkImageCompressionFlagsEXT flags;
+ uint32_t compressionControlPlaneCount;
+ VkImageCompressionFixedRateFlagsEXT* pFixedRateFlags;
+} VkImageCompressionControlEXT;
+
+typedef struct VkSubresourceLayout2EXT {
+ VkStructureType sType;
+ void* pNext;
+ VkSubresourceLayout subresourceLayout;
+} VkSubresourceLayout2EXT;
+
+typedef struct VkImageSubresource2EXT {
+ VkStructureType sType;
+ void* pNext;
+ VkImageSubresource imageSubresource;
+} VkImageSubresource2EXT;
+
+typedef struct VkImageCompressionPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkImageCompressionFlagsEXT imageCompressionFlags;
+ VkImageCompressionFixedRateFlagsEXT imageCompressionFixedRateFlags;
+} VkImageCompressionPropertiesEXT;
+
+typedef void (VKAPI_PTR *PFN_vkGetImageSubresourceLayout2EXT)(VkDevice device, VkImage image, const VkImageSubresource2EXT* pSubresource, VkSubresourceLayout2EXT* pLayout);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkGetImageSubresourceLayout2EXT(
+ VkDevice device,
+ VkImage image,
+ const VkImageSubresource2EXT* pSubresource,
+ VkSubresourceLayout2EXT* pLayout);
+#endif
+
+
+#define VK_EXT_attachment_feedback_loop_layout 1
+#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_SPEC_VERSION 2
+#define VK_EXT_ATTACHMENT_FEEDBACK_LOOP_LAYOUT_EXTENSION_NAME "VK_EXT_attachment_feedback_loop_layout"
+typedef struct VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 attachmentFeedbackLoopLayout;
+} VkPhysicalDeviceAttachmentFeedbackLoopLayoutFeaturesEXT;
@@ -12417,6 +14140,109 @@ typedef struct VkPhysicalDevice4444FormatsFeaturesEXT {
+#define VK_EXT_device_fault 1
+#define VK_EXT_DEVICE_FAULT_SPEC_VERSION 1
+#define VK_EXT_DEVICE_FAULT_EXTENSION_NAME "VK_EXT_device_fault"
+
+typedef enum VkDeviceFaultAddressTypeEXT {
+ VK_DEVICE_FAULT_ADDRESS_TYPE_NONE_EXT = 0,
+ VK_DEVICE_FAULT_ADDRESS_TYPE_READ_INVALID_EXT = 1,
+ VK_DEVICE_FAULT_ADDRESS_TYPE_WRITE_INVALID_EXT = 2,
+ VK_DEVICE_FAULT_ADDRESS_TYPE_EXECUTE_INVALID_EXT = 3,
+ VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_UNKNOWN_EXT = 4,
+ VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_INVALID_EXT = 5,
+ VK_DEVICE_FAULT_ADDRESS_TYPE_INSTRUCTION_POINTER_FAULT_EXT = 6,
+ VK_DEVICE_FAULT_ADDRESS_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkDeviceFaultAddressTypeEXT;
+
+typedef enum VkDeviceFaultVendorBinaryHeaderVersionEXT {
+ VK_DEVICE_FAULT_VENDOR_BINARY_HEADER_VERSION_ONE_EXT = 1,
+ VK_DEVICE_FAULT_VENDOR_BINARY_HEADER_VERSION_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkDeviceFaultVendorBinaryHeaderVersionEXT;
+typedef struct VkPhysicalDeviceFaultFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 deviceFault;
+ VkBool32 deviceFaultVendorBinary;
+} VkPhysicalDeviceFaultFeaturesEXT;
+
+typedef struct VkDeviceFaultCountsEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t addressInfoCount;
+ uint32_t vendorInfoCount;
+ VkDeviceSize vendorBinarySize;
+} VkDeviceFaultCountsEXT;
+
+typedef struct VkDeviceFaultAddressInfoEXT {
+ VkDeviceFaultAddressTypeEXT addressType;
+ VkDeviceAddress reportedAddress;
+ VkDeviceSize addressPrecision;
+} VkDeviceFaultAddressInfoEXT;
+
+typedef struct VkDeviceFaultVendorInfoEXT {
+ char description[VK_MAX_DESCRIPTION_SIZE];
+ uint64_t vendorFaultCode;
+ uint64_t vendorFaultData;
+} VkDeviceFaultVendorInfoEXT;
+
+typedef struct VkDeviceFaultInfoEXT {
+ VkStructureType sType;
+ void* pNext;
+ char description[VK_MAX_DESCRIPTION_SIZE];
+ VkDeviceFaultAddressInfoEXT* pAddressInfos;
+ VkDeviceFaultVendorInfoEXT* pVendorInfos;
+ void* pVendorBinaryData;
+} VkDeviceFaultInfoEXT;
+
+typedef struct VkDeviceFaultVendorBinaryHeaderVersionOneEXT {
+ uint32_t headerSize;
+ VkDeviceFaultVendorBinaryHeaderVersionEXT headerVersion;
+ uint32_t vendorID;
+ uint32_t deviceID;
+ uint32_t driverVersion;
+ uint8_t pipelineCacheUUID[VK_UUID_SIZE];
+ uint32_t applicationNameOffset;
+ uint32_t applicationVersion;
+ uint32_t engineNameOffset;
+} VkDeviceFaultVendorBinaryHeaderVersionOneEXT;
+
+typedef VkResult (VKAPI_PTR *PFN_vkGetDeviceFaultInfoEXT)(VkDevice device, VkDeviceFaultCountsEXT* pFaultCounts, VkDeviceFaultInfoEXT* pFaultInfo);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkGetDeviceFaultInfoEXT(
+ VkDevice device,
+ VkDeviceFaultCountsEXT* pFaultCounts,
+ VkDeviceFaultInfoEXT* pFaultInfo);
+#endif
+
+
+#define VK_ARM_rasterization_order_attachment_access 1
+#define VK_ARM_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_SPEC_VERSION 1
+#define VK_ARM_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_EXTENSION_NAME "VK_ARM_rasterization_order_attachment_access"
+typedef struct VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 rasterizationOrderColorAttachmentAccess;
+ VkBool32 rasterizationOrderDepthAttachmentAccess;
+ VkBool32 rasterizationOrderStencilAttachmentAccess;
+} VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT;
+
+typedef VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesEXT VkPhysicalDeviceRasterizationOrderAttachmentAccessFeaturesARM;
+
+
+
+#define VK_EXT_rgba10x6_formats 1
+#define VK_EXT_RGBA10X6_FORMATS_SPEC_VERSION 1
+#define VK_EXT_RGBA10X6_FORMATS_EXTENSION_NAME "VK_EXT_rgba10x6_formats"
+typedef struct VkPhysicalDeviceRGBA10X6FormatsFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 formatRgba10x6WithoutYCbCrSampler;
+} 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"
@@ -12438,23 +14264,29 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetWinrtDisplayNV(
#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"
-typedef struct VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE {
+typedef struct VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT {
VkStructureType sType;
void* pNext;
VkBool32 mutableDescriptorType;
-} VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE;
+} VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT;
-typedef struct VkMutableDescriptorTypeListVALVE {
+typedef VkPhysicalDeviceMutableDescriptorTypeFeaturesEXT VkPhysicalDeviceMutableDescriptorTypeFeaturesVALVE;
+
+typedef struct VkMutableDescriptorTypeListEXT {
uint32_t descriptorTypeCount;
const VkDescriptorType* pDescriptorTypes;
-} VkMutableDescriptorTypeListVALVE;
+} VkMutableDescriptorTypeListEXT;
-typedef struct VkMutableDescriptorTypeCreateInfoVALVE {
- VkStructureType sType;
- const void* pNext;
- uint32_t mutableDescriptorTypeListCount;
- const VkMutableDescriptorTypeListVALVE* pMutableDescriptorTypeLists;
-} VkMutableDescriptorTypeCreateInfoVALVE;
+typedef VkMutableDescriptorTypeListEXT VkMutableDescriptorTypeListVALVE;
+
+typedef struct VkMutableDescriptorTypeCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t mutableDescriptorTypeListCount;
+ const VkMutableDescriptorTypeListEXT* pMutableDescriptorTypeLists;
+} VkMutableDescriptorTypeCreateInfoEXT;
+
+typedef VkMutableDescriptorTypeCreateInfoEXT VkMutableDescriptorTypeCreateInfoVALVE;
@@ -12513,6 +14345,55 @@ typedef struct VkPhysicalDeviceDrmPropertiesEXT {
+#define VK_EXT_device_address_binding_report 1
+#define VK_EXT_DEVICE_ADDRESS_BINDING_REPORT_SPEC_VERSION 1
+#define VK_EXT_DEVICE_ADDRESS_BINDING_REPORT_EXTENSION_NAME "VK_EXT_device_address_binding_report"
+
+typedef enum VkDeviceAddressBindingTypeEXT {
+ VK_DEVICE_ADDRESS_BINDING_TYPE_BIND_EXT = 0,
+ VK_DEVICE_ADDRESS_BINDING_TYPE_UNBIND_EXT = 1,
+ VK_DEVICE_ADDRESS_BINDING_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkDeviceAddressBindingTypeEXT;
+
+typedef enum VkDeviceAddressBindingFlagBitsEXT {
+ VK_DEVICE_ADDRESS_BINDING_INTERNAL_OBJECT_BIT_EXT = 0x00000001,
+ VK_DEVICE_ADDRESS_BINDING_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkDeviceAddressBindingFlagBitsEXT;
+typedef VkFlags VkDeviceAddressBindingFlagsEXT;
+typedef struct VkPhysicalDeviceAddressBindingReportFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 reportAddressBinding;
+} VkPhysicalDeviceAddressBindingReportFeaturesEXT;
+
+typedef struct VkDeviceAddressBindingCallbackDataEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkDeviceAddressBindingFlagsEXT flags;
+ VkDeviceAddress baseAddress;
+ VkDeviceSize size;
+ VkDeviceAddressBindingTypeEXT bindingType;
+} VkDeviceAddressBindingCallbackDataEXT;
+
+
+
+#define VK_EXT_depth_clip_control 1
+#define VK_EXT_DEPTH_CLIP_CONTROL_SPEC_VERSION 1
+#define VK_EXT_DEPTH_CLIP_CONTROL_EXTENSION_NAME "VK_EXT_depth_clip_control"
+typedef struct VkPhysicalDeviceDepthClipControlFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 depthClipControl;
+} VkPhysicalDeviceDepthClipControlFeaturesEXT;
+
+typedef struct VkPipelineViewportDepthClipControlCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkBool32 negativeOneToOne;
+} VkPipelineViewportDepthClipControlCreateInfoEXT;
+
+
+
#define VK_EXT_primitive_topology_list_restart 1
#define VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_SPEC_VERSION 1
#define VK_EXT_PRIMITIVE_TOPOLOGY_LIST_RESTART_EXTENSION_NAME "VK_EXT_primitive_topology_list_restart"
@@ -12607,6 +14488,57 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryRemoteAddressNV(
#endif
+#define VK_EXT_pipeline_properties 1
+#define VK_EXT_PIPELINE_PROPERTIES_SPEC_VERSION 1
+#define VK_EXT_PIPELINE_PROPERTIES_EXTENSION_NAME "VK_EXT_pipeline_properties"
+typedef VkPipelineInfoKHR VkPipelineInfoEXT;
+
+typedef struct VkPipelinePropertiesIdentifierEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint8_t pipelineIdentifier[VK_UUID_SIZE];
+} VkPipelinePropertiesIdentifierEXT;
+
+typedef struct VkPhysicalDevicePipelinePropertiesFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 pipelinePropertiesIdentifier;
+} VkPhysicalDevicePipelinePropertiesFeaturesEXT;
+
+typedef VkResult (VKAPI_PTR *PFN_vkGetPipelinePropertiesEXT)(VkDevice device, const VkPipelineInfoEXT* pPipelineInfo, VkBaseOutStructure* pPipelineProperties);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkGetPipelinePropertiesEXT(
+ VkDevice device,
+ const VkPipelineInfoEXT* pPipelineInfo,
+ VkBaseOutStructure* pPipelineProperties);
+#endif
+
+
+#define VK_EXT_multisampled_render_to_single_sampled 1
+#define VK_EXT_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_SPEC_VERSION 1
+#define VK_EXT_MULTISAMPLED_RENDER_TO_SINGLE_SAMPLED_EXTENSION_NAME "VK_EXT_multisampled_render_to_single_sampled"
+typedef struct VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 multisampledRenderToSingleSampled;
+} VkPhysicalDeviceMultisampledRenderToSingleSampledFeaturesEXT;
+
+typedef struct VkSubpassResolvePerformanceQueryEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 optimal;
+} VkSubpassResolvePerformanceQueryEXT;
+
+typedef struct VkMultisampledRenderToSingleSampledInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkBool32 multisampledRenderToSingleSampledEnable;
+ VkSampleCountFlagBits rasterizationSamples;
+} VkMultisampledRenderToSingleSampledInfoEXT;
+
+
+
#define VK_EXT_extended_dynamic_state2 1
#define VK_EXT_EXTENDED_DYNAMIC_STATE_2_SPEC_VERSION 1
#define VK_EXT_EXTENDED_DYNAMIC_STATE_2_EXTENSION_NAME "VK_EXT_extended_dynamic_state2"
@@ -12673,22 +14605,43 @@ VKAPI_ATTR void VKAPI_CALL vkCmdSetColorWrite
#endif
+#define VK_EXT_primitives_generated_query 1
+#define VK_EXT_PRIMITIVES_GENERATED_QUERY_SPEC_VERSION 1
+#define VK_EXT_PRIMITIVES_GENERATED_QUERY_EXTENSION_NAME "VK_EXT_primitives_generated_query"
+typedef struct VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 primitivesGeneratedQuery;
+ VkBool32 primitivesGeneratedQueryWithRasterizerDiscard;
+ VkBool32 primitivesGeneratedQueryWithNonZeroStreams;
+} VkPhysicalDevicePrimitivesGeneratedQueryFeaturesEXT;
+
+
+
#define VK_EXT_global_priority_query 1
-#define VK_MAX_GLOBAL_PRIORITY_SIZE_EXT 16U
#define VK_EXT_GLOBAL_PRIORITY_QUERY_SPEC_VERSION 1
#define VK_EXT_GLOBAL_PRIORITY_QUERY_EXTENSION_NAME "VK_EXT_global_priority_query"
-typedef struct VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT {
+#define VK_MAX_GLOBAL_PRIORITY_SIZE_EXT VK_MAX_GLOBAL_PRIORITY_SIZE_KHR
+typedef VkPhysicalDeviceGlobalPriorityQueryFeaturesKHR VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT;
+
+typedef VkQueueFamilyGlobalPriorityPropertiesKHR VkQueueFamilyGlobalPriorityPropertiesEXT;
+
+
+
+#define VK_EXT_image_view_min_lod 1
+#define VK_EXT_IMAGE_VIEW_MIN_LOD_SPEC_VERSION 1
+#define VK_EXT_IMAGE_VIEW_MIN_LOD_EXTENSION_NAME "VK_EXT_image_view_min_lod"
+typedef struct VkPhysicalDeviceImageViewMinLodFeaturesEXT {
VkStructureType sType;
void* pNext;
- VkBool32 globalPriorityQuery;
-} VkPhysicalDeviceGlobalPriorityQueryFeaturesEXT;
+ VkBool32 minLod;
+} VkPhysicalDeviceImageViewMinLodFeaturesEXT;
-typedef struct VkQueueFamilyGlobalPriorityPropertiesEXT {
- VkStructureType sType;
- void* pNext;
- uint32_t priorityCount;
- VkQueueGlobalPriorityEXT priorities[VK_MAX_GLOBAL_PRIORITY_SIZE_EXT];
-} VkQueueFamilyGlobalPriorityPropertiesEXT;
+typedef struct VkImageViewMinLodCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ float minLod;
+} VkImageViewMinLodCreateInfoEXT;
@@ -12741,11 +14694,310 @@ VKAPI_ATTR void VKAPI_CALL vkCmdDrawMultiIndexedEXT(
#endif
+#define VK_EXT_image_2d_view_of_3d 1
+#define VK_EXT_IMAGE_2D_VIEW_OF_3D_SPEC_VERSION 1
+#define VK_EXT_IMAGE_2D_VIEW_OF_3D_EXTENSION_NAME "VK_EXT_image_2d_view_of_3d"
+typedef struct VkPhysicalDeviceImage2DViewOf3DFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 image2DViewOf3D;
+ VkBool32 sampler2DViewOf3D;
+} VkPhysicalDeviceImage2DViewOf3DFeaturesEXT;
+
+
+
+#define VK_EXT_opacity_micromap 1
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkMicromapEXT)
+#define VK_EXT_OPACITY_MICROMAP_SPEC_VERSION 2
+#define VK_EXT_OPACITY_MICROMAP_EXTENSION_NAME "VK_EXT_opacity_micromap"
+
+typedef enum VkMicromapTypeEXT {
+ VK_MICROMAP_TYPE_OPACITY_MICROMAP_EXT = 0,
+ VK_MICROMAP_TYPE_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkMicromapTypeEXT;
+
+typedef enum VkBuildMicromapModeEXT {
+ VK_BUILD_MICROMAP_MODE_BUILD_EXT = 0,
+ VK_BUILD_MICROMAP_MODE_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkBuildMicromapModeEXT;
+
+typedef enum VkCopyMicromapModeEXT {
+ VK_COPY_MICROMAP_MODE_CLONE_EXT = 0,
+ VK_COPY_MICROMAP_MODE_SERIALIZE_EXT = 1,
+ VK_COPY_MICROMAP_MODE_DESERIALIZE_EXT = 2,
+ VK_COPY_MICROMAP_MODE_COMPACT_EXT = 3,
+ VK_COPY_MICROMAP_MODE_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkCopyMicromapModeEXT;
+
+typedef enum VkOpacityMicromapFormatEXT {
+ VK_OPACITY_MICROMAP_FORMAT_2_STATE_EXT = 1,
+ VK_OPACITY_MICROMAP_FORMAT_4_STATE_EXT = 2,
+ VK_OPACITY_MICROMAP_FORMAT_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkOpacityMicromapFormatEXT;
+
+typedef enum VkOpacityMicromapSpecialIndexEXT {
+ VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_TRANSPARENT_EXT = -1,
+ VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_OPAQUE_EXT = -2,
+ VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_UNKNOWN_TRANSPARENT_EXT = -3,
+ VK_OPACITY_MICROMAP_SPECIAL_INDEX_FULLY_UNKNOWN_OPAQUE_EXT = -4,
+ VK_OPACITY_MICROMAP_SPECIAL_INDEX_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkOpacityMicromapSpecialIndexEXT;
+
+typedef enum VkAccelerationStructureCompatibilityKHR {
+ VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR = 0,
+ VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR = 1,
+ VK_ACCELERATION_STRUCTURE_COMPATIBILITY_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkAccelerationStructureCompatibilityKHR;
+
+typedef enum VkAccelerationStructureBuildTypeKHR {
+ VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR = 0,
+ VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR = 1,
+ VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR = 2,
+ VK_ACCELERATION_STRUCTURE_BUILD_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF
+} VkAccelerationStructureBuildTypeKHR;
+
+typedef enum VkBuildMicromapFlagBitsEXT {
+ VK_BUILD_MICROMAP_PREFER_FAST_TRACE_BIT_EXT = 0x00000001,
+ VK_BUILD_MICROMAP_PREFER_FAST_BUILD_BIT_EXT = 0x00000002,
+ VK_BUILD_MICROMAP_ALLOW_COMPACTION_BIT_EXT = 0x00000004,
+ VK_BUILD_MICROMAP_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkBuildMicromapFlagBitsEXT;
+typedef VkFlags VkBuildMicromapFlagsEXT;
+
+typedef enum VkMicromapCreateFlagBitsEXT {
+ VK_MICROMAP_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_EXT = 0x00000001,
+ VK_MICROMAP_CREATE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkMicromapCreateFlagBitsEXT;
+typedef VkFlags VkMicromapCreateFlagsEXT;
+typedef struct VkMicromapUsageEXT {
+ uint32_t count;
+ uint32_t subdivisionLevel;
+ uint32_t format;
+} VkMicromapUsageEXT;
+
+typedef union VkDeviceOrHostAddressKHR {
+ VkDeviceAddress deviceAddress;
+ void* hostAddress;
+} VkDeviceOrHostAddressKHR;
+
+typedef struct VkMicromapBuildInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkMicromapTypeEXT type;
+ VkBuildMicromapFlagsEXT flags;
+ VkBuildMicromapModeEXT mode;
+ VkMicromapEXT dstMicromap;
+ uint32_t usageCountsCount;
+ const VkMicromapUsageEXT* pUsageCounts;
+ const VkMicromapUsageEXT* const* ppUsageCounts;
+ VkDeviceOrHostAddressConstKHR data;
+ VkDeviceOrHostAddressKHR scratchData;
+ VkDeviceOrHostAddressConstKHR triangleArray;
+ VkDeviceSize triangleArrayStride;
+} VkMicromapBuildInfoEXT;
+
+typedef struct VkMicromapCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkMicromapCreateFlagsEXT createFlags;
+ VkBuffer buffer;
+ VkDeviceSize offset;
+ VkDeviceSize size;
+ VkMicromapTypeEXT type;
+ VkDeviceAddress deviceAddress;
+} VkMicromapCreateInfoEXT;
+
+typedef struct VkPhysicalDeviceOpacityMicromapFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 micromap;
+ VkBool32 micromapCaptureReplay;
+ VkBool32 micromapHostCommands;
+} VkPhysicalDeviceOpacityMicromapFeaturesEXT;
+
+typedef struct VkPhysicalDeviceOpacityMicromapPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t maxOpacity2StateSubdivisionLevel;
+ uint32_t maxOpacity4StateSubdivisionLevel;
+} VkPhysicalDeviceOpacityMicromapPropertiesEXT;
+
+typedef struct VkMicromapVersionInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ const uint8_t* pVersionData;
+} VkMicromapVersionInfoEXT;
+
+typedef struct VkCopyMicromapToMemoryInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkMicromapEXT src;
+ VkDeviceOrHostAddressKHR dst;
+ VkCopyMicromapModeEXT mode;
+} VkCopyMicromapToMemoryInfoEXT;
+
+typedef struct VkCopyMemoryToMicromapInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkDeviceOrHostAddressConstKHR src;
+ VkMicromapEXT dst;
+ VkCopyMicromapModeEXT mode;
+} VkCopyMemoryToMicromapInfoEXT;
+
+typedef struct VkCopyMicromapInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkMicromapEXT src;
+ VkMicromapEXT dst;
+ VkCopyMicromapModeEXT mode;
+} VkCopyMicromapInfoEXT;
+
+typedef struct VkMicromapBuildSizesInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkDeviceSize micromapSize;
+ VkDeviceSize buildScratchSize;
+ VkBool32 discardable;
+} VkMicromapBuildSizesInfoEXT;
+
+typedef struct VkAccelerationStructureTrianglesOpacityMicromapEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkIndexType indexType;
+ VkDeviceOrHostAddressConstKHR indexBuffer;
+ VkDeviceSize indexStride;
+ uint32_t baseTriangle;
+ uint32_t usageCountsCount;
+ const VkMicromapUsageEXT* pUsageCounts;
+ const VkMicromapUsageEXT* const* ppUsageCounts;
+ VkMicromapEXT micromap;
+} VkAccelerationStructureTrianglesOpacityMicromapEXT;
+
+typedef struct VkMicromapTriangleEXT {
+ uint32_t dataOffset;
+ uint16_t subdivisionLevel;
+ uint16_t format;
+} VkMicromapTriangleEXT;
+
+typedef VkResult (VKAPI_PTR *PFN_vkCreateMicromapEXT)(VkDevice device, const VkMicromapCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkMicromapEXT* pMicromap);
+typedef void (VKAPI_PTR *PFN_vkDestroyMicromapEXT)(VkDevice device, VkMicromapEXT micromap, const VkAllocationCallbacks* pAllocator);
+typedef void (VKAPI_PTR *PFN_vkCmdBuildMicromapsEXT)(VkCommandBuffer commandBuffer, uint32_t infoCount, const VkMicromapBuildInfoEXT* pInfos);
+typedef VkResult (VKAPI_PTR *PFN_vkBuildMicromapsEXT)(VkDevice device, VkDeferredOperationKHR deferredOperation, uint32_t infoCount, const VkMicromapBuildInfoEXT* pInfos);
+typedef VkResult (VKAPI_PTR *PFN_vkCopyMicromapEXT)(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapInfoEXT* pInfo);
+typedef VkResult (VKAPI_PTR *PFN_vkCopyMicromapToMemoryEXT)(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMicromapToMemoryInfoEXT* pInfo);
+typedef VkResult (VKAPI_PTR *PFN_vkCopyMemoryToMicromapEXT)(VkDevice device, VkDeferredOperationKHR deferredOperation, const VkCopyMemoryToMicromapInfoEXT* pInfo);
+typedef VkResult (VKAPI_PTR *PFN_vkWriteMicromapsPropertiesEXT)(VkDevice device, uint32_t micromapCount, const VkMicromapEXT* pMicromaps, VkQueryType queryType, size_t dataSize, void* pData, size_t stride);
+typedef void (VKAPI_PTR *PFN_vkCmdCopyMicromapEXT)(VkCommandBuffer commandBuffer, const VkCopyMicromapInfoEXT* pInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdCopyMicromapToMemoryEXT)(VkCommandBuffer commandBuffer, const VkCopyMicromapToMemoryInfoEXT* pInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryToMicromapEXT)(VkCommandBuffer commandBuffer, const VkCopyMemoryToMicromapInfoEXT* pInfo);
+typedef void (VKAPI_PTR *PFN_vkCmdWriteMicromapsPropertiesEXT)(VkCommandBuffer commandBuffer, uint32_t micromapCount, const VkMicromapEXT* pMicromaps, VkQueryType queryType, VkQueryPool queryPool, uint32_t firstQuery);
+typedef void (VKAPI_PTR *PFN_vkGetDeviceMicromapCompatibilityEXT)(VkDevice device, const VkMicromapVersionInfoEXT* pVersionInfo, VkAccelerationStructureCompatibilityKHR* pCompatibility);
+typedef void (VKAPI_PTR *PFN_vkGetMicromapBuildSizesEXT)(VkDevice device, VkAccelerationStructureBuildTypeKHR buildType, const VkMicromapBuildInfoEXT* pBuildInfo, VkMicromapBuildSizesInfoEXT* pSizeInfo);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkCreateMicromapEXT(
+ VkDevice device,
+ const VkMicromapCreateInfoEXT* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkMicromapEXT* pMicromap);
+
+VKAPI_ATTR void VKAPI_CALL vkDestroyMicromapEXT(
+ VkDevice device,
+ VkMicromapEXT micromap,
+ const VkAllocationCallbacks* pAllocator);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdBuildMicromapsEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t infoCount,
+ const VkMicromapBuildInfoEXT* pInfos);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkBuildMicromapsEXT(
+ VkDevice device,
+ VkDeferredOperationKHR deferredOperation,
+ uint32_t infoCount,
+ const VkMicromapBuildInfoEXT* pInfos);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkCopyMicromapEXT(
+ VkDevice device,
+ VkDeferredOperationKHR deferredOperation,
+ const VkCopyMicromapInfoEXT* pInfo);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkCopyMicromapToMemoryEXT(
+ VkDevice device,
+ VkDeferredOperationKHR deferredOperation,
+ const VkCopyMicromapToMemoryInfoEXT* pInfo);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkCopyMemoryToMicromapEXT(
+ VkDevice device,
+ VkDeferredOperationKHR deferredOperation,
+ const VkCopyMemoryToMicromapInfoEXT* pInfo);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkWriteMicromapsPropertiesEXT(
+ VkDevice device,
+ uint32_t micromapCount,
+ const VkMicromapEXT* pMicromaps,
+ VkQueryType queryType,
+ size_t dataSize,
+ void* pData,
+ size_t stride);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdCopyMicromapEXT(
+ VkCommandBuffer commandBuffer,
+ const VkCopyMicromapInfoEXT* pInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdCopyMicromapToMemoryEXT(
+ VkCommandBuffer commandBuffer,
+ const VkCopyMicromapToMemoryInfoEXT* pInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdCopyMemoryToMicromapEXT(
+ VkCommandBuffer commandBuffer,
+ const VkCopyMemoryToMicromapInfoEXT* pInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdWriteMicromapsPropertiesEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t micromapCount,
+ const VkMicromapEXT* pMicromaps,
+ VkQueryType queryType,
+ VkQueryPool queryPool,
+ uint32_t firstQuery);
+
+VKAPI_ATTR void VKAPI_CALL vkGetDeviceMicromapCompatibilityEXT(
+ VkDevice device,
+ const VkMicromapVersionInfoEXT* pVersionInfo,
+ VkAccelerationStructureCompatibilityKHR* pCompatibility);
+
+VKAPI_ATTR void VKAPI_CALL vkGetMicromapBuildSizesEXT(
+ VkDevice device,
+ VkAccelerationStructureBuildTypeKHR buildType,
+ const VkMicromapBuildInfoEXT* pBuildInfo,
+ VkMicromapBuildSizesInfoEXT* pSizeInfo);
+#endif
+
+
#define VK_EXT_load_store_op_none 1
#define VK_EXT_LOAD_STORE_OP_NONE_SPEC_VERSION 1
#define VK_EXT_LOAD_STORE_OP_NONE_EXTENSION_NAME "VK_EXT_load_store_op_none"
+#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"
+typedef struct VkPhysicalDeviceBorderColorSwizzleFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 borderColorSwizzle;
+ VkBool32 borderColorSwizzleFromImage;
+} VkPhysicalDeviceBorderColorSwizzleFeaturesEXT;
+
+typedef struct VkSamplerBorderColorComponentMappingCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkComponentMapping components;
+ VkBool32 srgb;
+} VkSamplerBorderColorComponentMappingCreateInfoEXT;
+
+
+
#define VK_EXT_pageable_device_local_memory 1
#define VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_SPEC_VERSION 1
#define VK_EXT_PAGEABLE_DEVICE_LOCAL_MEMORY_EXTENSION_NAME "VK_EXT_pageable_device_local_memory"
@@ -12765,9 +15017,874 @@ VKAPI_ATTR void VKAPI_CALL vkSetDeviceMemoryPriorityEXT(
#endif
+#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"
+typedef struct VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 descriptorSetHostMapping;
+} VkPhysicalDeviceDescriptorSetHostMappingFeaturesVALVE;
+
+typedef struct VkDescriptorSetBindingReferenceVALVE {
+ VkStructureType sType;
+ const void* pNext;
+ VkDescriptorSetLayout descriptorSetLayout;
+ uint32_t binding;
+} VkDescriptorSetBindingReferenceVALVE;
+
+typedef struct VkDescriptorSetLayoutHostMappingInfoVALVE {
+ VkStructureType sType;
+ void* pNext;
+ size_t descriptorOffset;
+ uint32_t descriptorSize;
+} VkDescriptorSetLayoutHostMappingInfoVALVE;
+
+typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetLayoutHostMappingInfoVALVE)(VkDevice device, const VkDescriptorSetBindingReferenceVALVE* pBindingReference, VkDescriptorSetLayoutHostMappingInfoVALVE* pHostMapping);
+typedef void (VKAPI_PTR *PFN_vkGetDescriptorSetHostMappingVALVE)(VkDevice device, VkDescriptorSet descriptorSet, void** ppData);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetLayoutHostMappingInfoVALVE(
+ VkDevice device,
+ const VkDescriptorSetBindingReferenceVALVE* pBindingReference,
+ VkDescriptorSetLayoutHostMappingInfoVALVE* pHostMapping);
+
+VKAPI_ATTR void VKAPI_CALL vkGetDescriptorSetHostMappingVALVE(
+ VkDevice device,
+ VkDescriptorSet descriptorSet,
+ void** ppData);
+#endif
+
+
+#define VK_EXT_depth_clamp_zero_one 1
+#define VK_EXT_DEPTH_CLAMP_ZERO_ONE_SPEC_VERSION 1
+#define VK_EXT_DEPTH_CLAMP_ZERO_ONE_EXTENSION_NAME "VK_EXT_depth_clamp_zero_one"
+typedef struct VkPhysicalDeviceDepthClampZeroOneFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 depthClampZeroOne;
+} VkPhysicalDeviceDepthClampZeroOneFeaturesEXT;
+
+
+
+#define VK_EXT_non_seamless_cube_map 1
+#define VK_EXT_NON_SEAMLESS_CUBE_MAP_SPEC_VERSION 1
+#define VK_EXT_NON_SEAMLESS_CUBE_MAP_EXTENSION_NAME "VK_EXT_non_seamless_cube_map"
+typedef struct VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 nonSeamlessCubeMap;
+} VkPhysicalDeviceNonSeamlessCubeMapFeaturesEXT;
+
+
+
+#define VK_QCOM_fragment_density_map_offset 1
+#define VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_SPEC_VERSION 1
+#define VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME "VK_QCOM_fragment_density_map_offset"
+typedef struct VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 fragmentDensityMapOffset;
+} VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM;
+
+typedef struct VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM {
+ VkStructureType sType;
+ void* pNext;
+ VkExtent2D fragmentDensityOffsetGranularity;
+} VkPhysicalDeviceFragmentDensityMapOffsetPropertiesQCOM;
+
+typedef struct VkSubpassFragmentDensityMapOffsetEndInfoQCOM {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t fragmentDensityOffsetCount;
+ const VkOffset2D* pFragmentDensityOffsets;
+} VkSubpassFragmentDensityMapOffsetEndInfoQCOM;
+
+
+
+#define VK_NV_copy_memory_indirect 1
+#define VK_NV_COPY_MEMORY_INDIRECT_SPEC_VERSION 1
+#define VK_NV_COPY_MEMORY_INDIRECT_EXTENSION_NAME "VK_NV_copy_memory_indirect"
+typedef struct VkCopyMemoryIndirectCommandNV {
+ VkDeviceAddress srcAddress;
+ VkDeviceAddress dstAddress;
+ VkDeviceSize size;
+} VkCopyMemoryIndirectCommandNV;
+
+typedef struct VkCopyMemoryToImageIndirectCommandNV {
+ VkDeviceAddress srcAddress;
+ uint32_t bufferRowLength;
+ uint32_t bufferImageHeight;
+ VkImageSubresourceLayers imageSubresource;
+ VkOffset3D imageOffset;
+ VkExtent3D imageExtent;
+} VkCopyMemoryToImageIndirectCommandNV;
+
+typedef struct VkPhysicalDeviceCopyMemoryIndirectFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 indirectCopy;
+} VkPhysicalDeviceCopyMemoryIndirectFeaturesNV;
+
+typedef struct VkPhysicalDeviceCopyMemoryIndirectPropertiesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkQueueFlags supportedQueues;
+} VkPhysicalDeviceCopyMemoryIndirectPropertiesNV;
+
+typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryIndirectNV)(VkCommandBuffer commandBuffer, VkDeviceAddress copyBufferAddress, uint32_t copyCount, uint32_t stride);
+typedef void (VKAPI_PTR *PFN_vkCmdCopyMemoryToImageIndirectNV)(VkCommandBuffer commandBuffer, VkDeviceAddress copyBufferAddress, uint32_t copyCount, uint32_t stride, VkImage dstImage, VkImageLayout dstImageLayout, const VkImageSubresourceLayers* pImageSubresources);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkCmdCopyMemoryIndirectNV(
+ VkCommandBuffer commandBuffer,
+ VkDeviceAddress copyBufferAddress,
+ uint32_t copyCount,
+ uint32_t stride);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdCopyMemoryToImageIndirectNV(
+ VkCommandBuffer commandBuffer,
+ VkDeviceAddress copyBufferAddress,
+ uint32_t copyCount,
+ uint32_t stride,
+ VkImage dstImage,
+ VkImageLayout dstImageLayout,
+ const VkImageSubresourceLayers* pImageSubresources);
+#endif
+
+
+#define VK_NV_memory_decompression 1
+#define VK_NV_MEMORY_DECOMPRESSION_SPEC_VERSION 1
+#define VK_NV_MEMORY_DECOMPRESSION_EXTENSION_NAME "VK_NV_memory_decompression"
+
+// Flag bits for VkMemoryDecompressionMethodFlagBitsNV
+typedef VkFlags64 VkMemoryDecompressionMethodFlagBitsNV;
+static const VkMemoryDecompressionMethodFlagBitsNV VK_MEMORY_DECOMPRESSION_METHOD_GDEFLATE_1_0_BIT_NV = 0x00000001ULL;
+
+typedef VkFlags64 VkMemoryDecompressionMethodFlagsNV;
+typedef struct VkDecompressMemoryRegionNV {
+ VkDeviceAddress srcAddress;
+ VkDeviceAddress dstAddress;
+ VkDeviceSize compressedSize;
+ VkDeviceSize decompressedSize;
+ VkMemoryDecompressionMethodFlagsNV decompressionMethod;
+} VkDecompressMemoryRegionNV;
+
+typedef struct VkPhysicalDeviceMemoryDecompressionFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 memoryDecompression;
+} VkPhysicalDeviceMemoryDecompressionFeaturesNV;
+
+typedef struct VkPhysicalDeviceMemoryDecompressionPropertiesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkMemoryDecompressionMethodFlagsNV decompressionMethods;
+ uint64_t maxDecompressionIndirectCount;
+} VkPhysicalDeviceMemoryDecompressionPropertiesNV;
+
+typedef void (VKAPI_PTR *PFN_vkCmdDecompressMemoryNV)(VkCommandBuffer commandBuffer, uint32_t decompressRegionCount, const VkDecompressMemoryRegionNV* pDecompressMemoryRegions);
+typedef void (VKAPI_PTR *PFN_vkCmdDecompressMemoryIndirectCountNV)(VkCommandBuffer commandBuffer, VkDeviceAddress indirectCommandsAddress, VkDeviceAddress indirectCommandsCountAddress, uint32_t stride);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkCmdDecompressMemoryNV(
+ VkCommandBuffer commandBuffer,
+ uint32_t decompressRegionCount,
+ const VkDecompressMemoryRegionNV* pDecompressMemoryRegions);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdDecompressMemoryIndirectCountNV(
+ VkCommandBuffer commandBuffer,
+ VkDeviceAddress indirectCommandsAddress,
+ VkDeviceAddress indirectCommandsCountAddress,
+ uint32_t stride);
+#endif
+
+
+#define VK_NV_linear_color_attachment 1
+#define VK_NV_LINEAR_COLOR_ATTACHMENT_SPEC_VERSION 1
+#define VK_NV_LINEAR_COLOR_ATTACHMENT_EXTENSION_NAME "VK_NV_linear_color_attachment"
+typedef struct VkPhysicalDeviceLinearColorAttachmentFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 linearColorAttachment;
+} VkPhysicalDeviceLinearColorAttachmentFeaturesNV;
+
+
+
+#define VK_GOOGLE_surfaceless_query 1
+#define VK_GOOGLE_SURFACELESS_QUERY_SPEC_VERSION 2
+#define VK_GOOGLE_SURFACELESS_QUERY_EXTENSION_NAME "VK_GOOGLE_surfaceless_query"
+
+
+#define VK_EXT_image_compression_control_swapchain 1
+#define VK_EXT_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_SPEC_VERSION 1
+#define VK_EXT_IMAGE_COMPRESSION_CONTROL_SWAPCHAIN_EXTENSION_NAME "VK_EXT_image_compression_control_swapchain"
+typedef struct VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 imageCompressionControlSwapchain;
+} VkPhysicalDeviceImageCompressionControlSwapchainFeaturesEXT;
+
+
+
+#define VK_QCOM_image_processing 1
+#define VK_QCOM_IMAGE_PROCESSING_SPEC_VERSION 1
+#define VK_QCOM_IMAGE_PROCESSING_EXTENSION_NAME "VK_QCOM_image_processing"
+typedef struct VkImageViewSampleWeightCreateInfoQCOM {
+ VkStructureType sType;
+ const void* pNext;
+ VkOffset2D filterCenter;
+ VkExtent2D filterSize;
+ uint32_t numPhases;
+} VkImageViewSampleWeightCreateInfoQCOM;
+
+typedef struct VkPhysicalDeviceImageProcessingFeaturesQCOM {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 textureSampleWeighted;
+ VkBool32 textureBoxFilter;
+ VkBool32 textureBlockMatch;
+} VkPhysicalDeviceImageProcessingFeaturesQCOM;
+
+typedef struct VkPhysicalDeviceImageProcessingPropertiesQCOM {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t maxWeightFilterPhases;
+ VkExtent2D maxWeightFilterDimension;
+ VkExtent2D maxBlockMatchRegion;
+ VkExtent2D maxBoxFilterBlockSize;
+} VkPhysicalDeviceImageProcessingPropertiesQCOM;
+
+
+
+#define VK_EXT_extended_dynamic_state3 1
+#define VK_EXT_EXTENDED_DYNAMIC_STATE_3_SPEC_VERSION 2
+#define VK_EXT_EXTENDED_DYNAMIC_STATE_3_EXTENSION_NAME "VK_EXT_extended_dynamic_state3"
+typedef struct VkPhysicalDeviceExtendedDynamicState3FeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 extendedDynamicState3TessellationDomainOrigin;
+ VkBool32 extendedDynamicState3DepthClampEnable;
+ VkBool32 extendedDynamicState3PolygonMode;
+ VkBool32 extendedDynamicState3RasterizationSamples;
+ VkBool32 extendedDynamicState3SampleMask;
+ VkBool32 extendedDynamicState3AlphaToCoverageEnable;
+ VkBool32 extendedDynamicState3AlphaToOneEnable;
+ VkBool32 extendedDynamicState3LogicOpEnable;
+ VkBool32 extendedDynamicState3ColorBlendEnable;
+ VkBool32 extendedDynamicState3ColorBlendEquation;
+ VkBool32 extendedDynamicState3ColorWriteMask;
+ VkBool32 extendedDynamicState3RasterizationStream;
+ VkBool32 extendedDynamicState3ConservativeRasterizationMode;
+ VkBool32 extendedDynamicState3ExtraPrimitiveOverestimationSize;
+ VkBool32 extendedDynamicState3DepthClipEnable;
+ VkBool32 extendedDynamicState3SampleLocationsEnable;
+ VkBool32 extendedDynamicState3ColorBlendAdvanced;
+ VkBool32 extendedDynamicState3ProvokingVertexMode;
+ VkBool32 extendedDynamicState3LineRasterizationMode;
+ VkBool32 extendedDynamicState3LineStippleEnable;
+ VkBool32 extendedDynamicState3DepthClipNegativeOneToOne;
+ VkBool32 extendedDynamicState3ViewportWScalingEnable;
+ VkBool32 extendedDynamicState3ViewportSwizzle;
+ VkBool32 extendedDynamicState3CoverageToColorEnable;
+ VkBool32 extendedDynamicState3CoverageToColorLocation;
+ VkBool32 extendedDynamicState3CoverageModulationMode;
+ VkBool32 extendedDynamicState3CoverageModulationTableEnable;
+ VkBool32 extendedDynamicState3CoverageModulationTable;
+ VkBool32 extendedDynamicState3CoverageReductionMode;
+ VkBool32 extendedDynamicState3RepresentativeFragmentTestEnable;
+ VkBool32 extendedDynamicState3ShadingRateImageEnable;
+} VkPhysicalDeviceExtendedDynamicState3FeaturesEXT;
+
+typedef struct VkPhysicalDeviceExtendedDynamicState3PropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 dynamicPrimitiveTopologyUnrestricted;
+} VkPhysicalDeviceExtendedDynamicState3PropertiesEXT;
+
+typedef struct VkColorBlendEquationEXT {
+ VkBlendFactor srcColorBlendFactor;
+ VkBlendFactor dstColorBlendFactor;
+ VkBlendOp colorBlendOp;
+ VkBlendFactor srcAlphaBlendFactor;
+ VkBlendFactor dstAlphaBlendFactor;
+ VkBlendOp alphaBlendOp;
+} VkColorBlendEquationEXT;
+
+typedef struct VkColorBlendAdvancedEXT {
+ VkBlendOp advancedBlendOp;
+ VkBool32 srcPremultiplied;
+ VkBool32 dstPremultiplied;
+ VkBlendOverlapEXT blendOverlap;
+ VkBool32 clampResults;
+} VkColorBlendAdvancedEXT;
+
+typedef void (VKAPI_PTR *PFN_vkCmdSetTessellationDomainOriginEXT)(VkCommandBuffer commandBuffer, VkTessellationDomainOrigin domainOrigin);
+typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClampEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 depthClampEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetPolygonModeEXT)(VkCommandBuffer commandBuffer, VkPolygonMode polygonMode);
+typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizationSamplesEXT)(VkCommandBuffer commandBuffer, VkSampleCountFlagBits rasterizationSamples);
+typedef void (VKAPI_PTR *PFN_vkCmdSetSampleMaskEXT)(VkCommandBuffer commandBuffer, VkSampleCountFlagBits samples, const VkSampleMask* pSampleMask);
+typedef void (VKAPI_PTR *PFN_vkCmdSetAlphaToCoverageEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 alphaToCoverageEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetAlphaToOneEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 alphaToOneEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetLogicOpEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 logicOpEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendEnableEXT)(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkBool32* pColorBlendEnables);
+typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendEquationEXT)(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorBlendEquationEXT* pColorBlendEquations);
+typedef void (VKAPI_PTR *PFN_vkCmdSetColorWriteMaskEXT)(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorComponentFlags* pColorWriteMasks);
+typedef void (VKAPI_PTR *PFN_vkCmdSetRasterizationStreamEXT)(VkCommandBuffer commandBuffer, uint32_t rasterizationStream);
+typedef void (VKAPI_PTR *PFN_vkCmdSetConservativeRasterizationModeEXT)(VkCommandBuffer commandBuffer, VkConservativeRasterizationModeEXT conservativeRasterizationMode);
+typedef void (VKAPI_PTR *PFN_vkCmdSetExtraPrimitiveOverestimationSizeEXT)(VkCommandBuffer commandBuffer, float extraPrimitiveOverestimationSize);
+typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClipEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 depthClipEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetSampleLocationsEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 sampleLocationsEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetColorBlendAdvancedEXT)(VkCommandBuffer commandBuffer, uint32_t firstAttachment, uint32_t attachmentCount, const VkColorBlendAdvancedEXT* pColorBlendAdvanced);
+typedef void (VKAPI_PTR *PFN_vkCmdSetProvokingVertexModeEXT)(VkCommandBuffer commandBuffer, VkProvokingVertexModeEXT provokingVertexMode);
+typedef void (VKAPI_PTR *PFN_vkCmdSetLineRasterizationModeEXT)(VkCommandBuffer commandBuffer, VkLineRasterizationModeEXT lineRasterizationMode);
+typedef void (VKAPI_PTR *PFN_vkCmdSetLineStippleEnableEXT)(VkCommandBuffer commandBuffer, VkBool32 stippledLineEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetDepthClipNegativeOneToOneEXT)(VkCommandBuffer commandBuffer, VkBool32 negativeOneToOne);
+typedef void (VKAPI_PTR *PFN_vkCmdSetViewportWScalingEnableNV)(VkCommandBuffer commandBuffer, VkBool32 viewportWScalingEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetViewportSwizzleNV)(VkCommandBuffer commandBuffer, uint32_t firstViewport, uint32_t viewportCount, const VkViewportSwizzleNV* pViewportSwizzles);
+typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageToColorEnableNV)(VkCommandBuffer commandBuffer, VkBool32 coverageToColorEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageToColorLocationNV)(VkCommandBuffer commandBuffer, uint32_t coverageToColorLocation);
+typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageModulationModeNV)(VkCommandBuffer commandBuffer, VkCoverageModulationModeNV coverageModulationMode);
+typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageModulationTableEnableNV)(VkCommandBuffer commandBuffer, VkBool32 coverageModulationTableEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageModulationTableNV)(VkCommandBuffer commandBuffer, uint32_t coverageModulationTableCount, const float* pCoverageModulationTable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetShadingRateImageEnableNV)(VkCommandBuffer commandBuffer, VkBool32 shadingRateImageEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetRepresentativeFragmentTestEnableNV)(VkCommandBuffer commandBuffer, VkBool32 representativeFragmentTestEnable);
+typedef void (VKAPI_PTR *PFN_vkCmdSetCoverageReductionModeNV)(VkCommandBuffer commandBuffer, VkCoverageReductionModeNV coverageReductionMode);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkCmdSetTessellationDomainOriginEXT(
+ VkCommandBuffer commandBuffer,
+ VkTessellationDomainOrigin domainOrigin);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthClampEnableEXT(
+ VkCommandBuffer commandBuffer,
+ VkBool32 depthClampEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetPolygonModeEXT(
+ VkCommandBuffer commandBuffer,
+ VkPolygonMode polygonMode);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetRasterizationSamplesEXT(
+ VkCommandBuffer commandBuffer,
+ VkSampleCountFlagBits rasterizationSamples);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetSampleMaskEXT(
+ VkCommandBuffer commandBuffer,
+ VkSampleCountFlagBits samples,
+ const VkSampleMask* pSampleMask);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetAlphaToCoverageEnableEXT(
+ VkCommandBuffer commandBuffer,
+ VkBool32 alphaToCoverageEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetAlphaToOneEnableEXT(
+ VkCommandBuffer commandBuffer,
+ VkBool32 alphaToOneEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetLogicOpEnableEXT(
+ VkCommandBuffer commandBuffer,
+ VkBool32 logicOpEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetColorBlendEnableEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstAttachment,
+ uint32_t attachmentCount,
+ const VkBool32* pColorBlendEnables);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetColorBlendEquationEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstAttachment,
+ uint32_t attachmentCount,
+ const VkColorBlendEquationEXT* pColorBlendEquations);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetColorWriteMaskEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstAttachment,
+ uint32_t attachmentCount,
+ const VkColorComponentFlags* pColorWriteMasks);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetRasterizationStreamEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t rasterizationStream);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetConservativeRasterizationModeEXT(
+ VkCommandBuffer commandBuffer,
+ VkConservativeRasterizationModeEXT conservativeRasterizationMode);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetExtraPrimitiveOverestimationSizeEXT(
+ VkCommandBuffer commandBuffer,
+ float extraPrimitiveOverestimationSize);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthClipEnableEXT(
+ VkCommandBuffer commandBuffer,
+ VkBool32 depthClipEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetSampleLocationsEnableEXT(
+ VkCommandBuffer commandBuffer,
+ VkBool32 sampleLocationsEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetColorBlendAdvancedEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstAttachment,
+ uint32_t attachmentCount,
+ const VkColorBlendAdvancedEXT* pColorBlendAdvanced);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetProvokingVertexModeEXT(
+ VkCommandBuffer commandBuffer,
+ VkProvokingVertexModeEXT provokingVertexMode);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetLineRasterizationModeEXT(
+ VkCommandBuffer commandBuffer,
+ VkLineRasterizationModeEXT lineRasterizationMode);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetLineStippleEnableEXT(
+ VkCommandBuffer commandBuffer,
+ VkBool32 stippledLineEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetDepthClipNegativeOneToOneEXT(
+ VkCommandBuffer commandBuffer,
+ VkBool32 negativeOneToOne);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportWScalingEnableNV(
+ VkCommandBuffer commandBuffer,
+ VkBool32 viewportWScalingEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetViewportSwizzleNV(
+ VkCommandBuffer commandBuffer,
+ uint32_t firstViewport,
+ uint32_t viewportCount,
+ const VkViewportSwizzleNV* pViewportSwizzles);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetCoverageToColorEnableNV(
+ VkCommandBuffer commandBuffer,
+ VkBool32 coverageToColorEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetCoverageToColorLocationNV(
+ VkCommandBuffer commandBuffer,
+ uint32_t coverageToColorLocation);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetCoverageModulationModeNV(
+ VkCommandBuffer commandBuffer,
+ VkCoverageModulationModeNV coverageModulationMode);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetCoverageModulationTableEnableNV(
+ VkCommandBuffer commandBuffer,
+ VkBool32 coverageModulationTableEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetCoverageModulationTableNV(
+ VkCommandBuffer commandBuffer,
+ uint32_t coverageModulationTableCount,
+ const float* pCoverageModulationTable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetShadingRateImageEnableNV(
+ VkCommandBuffer commandBuffer,
+ VkBool32 shadingRateImageEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetRepresentativeFragmentTestEnableNV(
+ VkCommandBuffer commandBuffer,
+ VkBool32 representativeFragmentTestEnable);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdSetCoverageReductionModeNV(
+ VkCommandBuffer commandBuffer,
+ VkCoverageReductionModeNV coverageReductionMode);
+#endif
+
+
+#define VK_EXT_subpass_merge_feedback 1
+#define VK_EXT_SUBPASS_MERGE_FEEDBACK_SPEC_VERSION 2
+#define VK_EXT_SUBPASS_MERGE_FEEDBACK_EXTENSION_NAME "VK_EXT_subpass_merge_feedback"
+
+typedef enum VkSubpassMergeStatusEXT {
+ VK_SUBPASS_MERGE_STATUS_MERGED_EXT = 0,
+ VK_SUBPASS_MERGE_STATUS_DISALLOWED_EXT = 1,
+ VK_SUBPASS_MERGE_STATUS_NOT_MERGED_SIDE_EFFECTS_EXT = 2,
+ VK_SUBPASS_MERGE_STATUS_NOT_MERGED_SAMPLES_MISMATCH_EXT = 3,
+ VK_SUBPASS_MERGE_STATUS_NOT_MERGED_VIEWS_MISMATCH_EXT = 4,
+ VK_SUBPASS_MERGE_STATUS_NOT_MERGED_ALIASING_EXT = 5,
+ VK_SUBPASS_MERGE_STATUS_NOT_MERGED_DEPENDENCIES_EXT = 6,
+ VK_SUBPASS_MERGE_STATUS_NOT_MERGED_INCOMPATIBLE_INPUT_ATTACHMENT_EXT = 7,
+ VK_SUBPASS_MERGE_STATUS_NOT_MERGED_TOO_MANY_ATTACHMENTS_EXT = 8,
+ VK_SUBPASS_MERGE_STATUS_NOT_MERGED_INSUFFICIENT_STORAGE_EXT = 9,
+ VK_SUBPASS_MERGE_STATUS_NOT_MERGED_DEPTH_STENCIL_COUNT_EXT = 10,
+ VK_SUBPASS_MERGE_STATUS_NOT_MERGED_RESOLVE_ATTACHMENT_REUSE_EXT = 11,
+ VK_SUBPASS_MERGE_STATUS_NOT_MERGED_SINGLE_SUBPASS_EXT = 12,
+ VK_SUBPASS_MERGE_STATUS_NOT_MERGED_UNSPECIFIED_EXT = 13,
+ VK_SUBPASS_MERGE_STATUS_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkSubpassMergeStatusEXT;
+typedef struct VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 subpassMergeFeedback;
+} VkPhysicalDeviceSubpassMergeFeedbackFeaturesEXT;
+
+typedef struct VkRenderPassCreationControlEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkBool32 disallowMerging;
+} VkRenderPassCreationControlEXT;
+
+typedef struct VkRenderPassCreationFeedbackInfoEXT {
+ uint32_t postMergeSubpassCount;
+} VkRenderPassCreationFeedbackInfoEXT;
+
+typedef struct VkRenderPassCreationFeedbackCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkRenderPassCreationFeedbackInfoEXT* pRenderPassFeedback;
+} VkRenderPassCreationFeedbackCreateInfoEXT;
+
+typedef struct VkRenderPassSubpassFeedbackInfoEXT {
+ VkSubpassMergeStatusEXT subpassMergeStatus;
+ char description[VK_MAX_DESCRIPTION_SIZE];
+ uint32_t postMergeIndex;
+} VkRenderPassSubpassFeedbackInfoEXT;
+
+typedef struct VkRenderPassSubpassFeedbackCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkRenderPassSubpassFeedbackInfoEXT* pSubpassFeedback;
+} VkRenderPassSubpassFeedbackCreateInfoEXT;
+
+
+
+#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
+#define VK_EXT_SHADER_MODULE_IDENTIFIER_EXTENSION_NAME "VK_EXT_shader_module_identifier"
+typedef struct VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 shaderModuleIdentifier;
+} VkPhysicalDeviceShaderModuleIdentifierFeaturesEXT;
+
+typedef struct VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint8_t shaderModuleIdentifierAlgorithmUUID[VK_UUID_SIZE];
+} VkPhysicalDeviceShaderModuleIdentifierPropertiesEXT;
+
+typedef struct VkPipelineShaderStageModuleIdentifierCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t identifierSize;
+ const uint8_t* pIdentifier;
+} VkPipelineShaderStageModuleIdentifierCreateInfoEXT;
+
+typedef struct VkShaderModuleIdentifierEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t identifierSize;
+ uint8_t identifier[VK_MAX_SHADER_MODULE_IDENTIFIER_SIZE_EXT];
+} VkShaderModuleIdentifierEXT;
+
+typedef void (VKAPI_PTR *PFN_vkGetShaderModuleIdentifierEXT)(VkDevice device, VkShaderModule shaderModule, VkShaderModuleIdentifierEXT* pIdentifier);
+typedef void (VKAPI_PTR *PFN_vkGetShaderModuleCreateInfoIdentifierEXT)(VkDevice device, const VkShaderModuleCreateInfo* pCreateInfo, VkShaderModuleIdentifierEXT* pIdentifier);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkGetShaderModuleIdentifierEXT(
+ VkDevice device,
+ VkShaderModule shaderModule,
+ VkShaderModuleIdentifierEXT* pIdentifier);
+
+VKAPI_ATTR void VKAPI_CALL vkGetShaderModuleCreateInfoIdentifierEXT(
+ VkDevice device,
+ const VkShaderModuleCreateInfo* pCreateInfo,
+ VkShaderModuleIdentifierEXT* pIdentifier);
+#endif
+
+
+#define VK_EXT_rasterization_order_attachment_access 1
+#define VK_EXT_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_SPEC_VERSION 1
+#define VK_EXT_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_EXTENSION_NAME "VK_EXT_rasterization_order_attachment_access"
+
+
+#define VK_NV_optical_flow 1
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkOpticalFlowSessionNV)
+#define VK_NV_OPTICAL_FLOW_SPEC_VERSION 1
+#define VK_NV_OPTICAL_FLOW_EXTENSION_NAME "VK_NV_optical_flow"
+
+typedef enum VkOpticalFlowPerformanceLevelNV {
+ VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_UNKNOWN_NV = 0,
+ VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_SLOW_NV = 1,
+ VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_MEDIUM_NV = 2,
+ VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_FAST_NV = 3,
+ VK_OPTICAL_FLOW_PERFORMANCE_LEVEL_MAX_ENUM_NV = 0x7FFFFFFF
+} VkOpticalFlowPerformanceLevelNV;
+
+typedef enum VkOpticalFlowSessionBindingPointNV {
+ VK_OPTICAL_FLOW_SESSION_BINDING_POINT_UNKNOWN_NV = 0,
+ VK_OPTICAL_FLOW_SESSION_BINDING_POINT_INPUT_NV = 1,
+ VK_OPTICAL_FLOW_SESSION_BINDING_POINT_REFERENCE_NV = 2,
+ VK_OPTICAL_FLOW_SESSION_BINDING_POINT_HINT_NV = 3,
+ VK_OPTICAL_FLOW_SESSION_BINDING_POINT_FLOW_VECTOR_NV = 4,
+ VK_OPTICAL_FLOW_SESSION_BINDING_POINT_BACKWARD_FLOW_VECTOR_NV = 5,
+ VK_OPTICAL_FLOW_SESSION_BINDING_POINT_COST_NV = 6,
+ VK_OPTICAL_FLOW_SESSION_BINDING_POINT_BACKWARD_COST_NV = 7,
+ VK_OPTICAL_FLOW_SESSION_BINDING_POINT_GLOBAL_FLOW_NV = 8,
+ VK_OPTICAL_FLOW_SESSION_BINDING_POINT_MAX_ENUM_NV = 0x7FFFFFFF
+} VkOpticalFlowSessionBindingPointNV;
+
+typedef enum VkOpticalFlowGridSizeFlagBitsNV {
+ VK_OPTICAL_FLOW_GRID_SIZE_UNKNOWN_NV = 0,
+ VK_OPTICAL_FLOW_GRID_SIZE_1X1_BIT_NV = 0x00000001,
+ VK_OPTICAL_FLOW_GRID_SIZE_2X2_BIT_NV = 0x00000002,
+ VK_OPTICAL_FLOW_GRID_SIZE_4X4_BIT_NV = 0x00000004,
+ VK_OPTICAL_FLOW_GRID_SIZE_8X8_BIT_NV = 0x00000008,
+ VK_OPTICAL_FLOW_GRID_SIZE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF
+} VkOpticalFlowGridSizeFlagBitsNV;
+typedef VkFlags VkOpticalFlowGridSizeFlagsNV;
+
+typedef enum VkOpticalFlowUsageFlagBitsNV {
+ VK_OPTICAL_FLOW_USAGE_UNKNOWN_NV = 0,
+ VK_OPTICAL_FLOW_USAGE_INPUT_BIT_NV = 0x00000001,
+ VK_OPTICAL_FLOW_USAGE_OUTPUT_BIT_NV = 0x00000002,
+ VK_OPTICAL_FLOW_USAGE_HINT_BIT_NV = 0x00000004,
+ VK_OPTICAL_FLOW_USAGE_COST_BIT_NV = 0x00000008,
+ VK_OPTICAL_FLOW_USAGE_GLOBAL_FLOW_BIT_NV = 0x00000010,
+ VK_OPTICAL_FLOW_USAGE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF
+} VkOpticalFlowUsageFlagBitsNV;
+typedef VkFlags VkOpticalFlowUsageFlagsNV;
+
+typedef enum VkOpticalFlowSessionCreateFlagBitsNV {
+ VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_HINT_BIT_NV = 0x00000001,
+ VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_COST_BIT_NV = 0x00000002,
+ VK_OPTICAL_FLOW_SESSION_CREATE_ENABLE_GLOBAL_FLOW_BIT_NV = 0x00000004,
+ VK_OPTICAL_FLOW_SESSION_CREATE_ALLOW_REGIONS_BIT_NV = 0x00000008,
+ VK_OPTICAL_FLOW_SESSION_CREATE_BOTH_DIRECTIONS_BIT_NV = 0x00000010,
+ VK_OPTICAL_FLOW_SESSION_CREATE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF
+} VkOpticalFlowSessionCreateFlagBitsNV;
+typedef VkFlags VkOpticalFlowSessionCreateFlagsNV;
+
+typedef enum VkOpticalFlowExecuteFlagBitsNV {
+ VK_OPTICAL_FLOW_EXECUTE_DISABLE_TEMPORAL_HINTS_BIT_NV = 0x00000001,
+ VK_OPTICAL_FLOW_EXECUTE_FLAG_BITS_MAX_ENUM_NV = 0x7FFFFFFF
+} VkOpticalFlowExecuteFlagBitsNV;
+typedef VkFlags VkOpticalFlowExecuteFlagsNV;
+typedef struct VkPhysicalDeviceOpticalFlowFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 opticalFlow;
+} VkPhysicalDeviceOpticalFlowFeaturesNV;
+
+typedef struct VkPhysicalDeviceOpticalFlowPropertiesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkOpticalFlowGridSizeFlagsNV supportedOutputGridSizes;
+ VkOpticalFlowGridSizeFlagsNV supportedHintGridSizes;
+ VkBool32 hintSupported;
+ VkBool32 costSupported;
+ VkBool32 bidirectionalFlowSupported;
+ VkBool32 globalFlowSupported;
+ uint32_t minWidth;
+ uint32_t minHeight;
+ uint32_t maxWidth;
+ uint32_t maxHeight;
+ uint32_t maxNumRegionsOfInterest;
+} VkPhysicalDeviceOpticalFlowPropertiesNV;
+
+typedef struct VkOpticalFlowImageFormatInfoNV {
+ VkStructureType sType;
+ const void* pNext;
+ VkOpticalFlowUsageFlagsNV usage;
+} VkOpticalFlowImageFormatInfoNV;
+
+typedef struct VkOpticalFlowImageFormatPropertiesNV {
+ VkStructureType sType;
+ const void* pNext;
+ VkFormat format;
+} VkOpticalFlowImageFormatPropertiesNV;
+
+typedef struct VkOpticalFlowSessionCreateInfoNV {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t width;
+ uint32_t height;
+ VkFormat imageFormat;
+ VkFormat flowVectorFormat;
+ VkFormat costFormat;
+ VkOpticalFlowGridSizeFlagsNV outputGridSize;
+ VkOpticalFlowGridSizeFlagsNV hintGridSize;
+ VkOpticalFlowPerformanceLevelNV performanceLevel;
+ VkOpticalFlowSessionCreateFlagsNV flags;
+} VkOpticalFlowSessionCreateInfoNV;
+
+typedef struct VkOpticalFlowSessionCreatePrivateDataInfoNV {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t id;
+ uint32_t size;
+ const void* pPrivateData;
+} VkOpticalFlowSessionCreatePrivateDataInfoNV;
+
+typedef struct VkOpticalFlowExecuteInfoNV {
+ VkStructureType sType;
+ void* pNext;
+ VkOpticalFlowExecuteFlagsNV flags;
+ uint32_t regionCount;
+ const VkRect2D* pRegions;
+} VkOpticalFlowExecuteInfoNV;
+
+typedef VkResult (VKAPI_PTR *PFN_vkGetPhysicalDeviceOpticalFlowImageFormatsNV)(VkPhysicalDevice physicalDevice, const VkOpticalFlowImageFormatInfoNV* pOpticalFlowImageFormatInfo, uint32_t* pFormatCount, VkOpticalFlowImageFormatPropertiesNV* pImageFormatProperties);
+typedef VkResult (VKAPI_PTR *PFN_vkCreateOpticalFlowSessionNV)(VkDevice device, const VkOpticalFlowSessionCreateInfoNV* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkOpticalFlowSessionNV* pSession);
+typedef void (VKAPI_PTR *PFN_vkDestroyOpticalFlowSessionNV)(VkDevice device, VkOpticalFlowSessionNV session, const VkAllocationCallbacks* pAllocator);
+typedef VkResult (VKAPI_PTR *PFN_vkBindOpticalFlowSessionImageNV)(VkDevice device, VkOpticalFlowSessionNV session, VkOpticalFlowSessionBindingPointNV bindingPoint, VkImageView view, VkImageLayout layout);
+typedef void (VKAPI_PTR *PFN_vkCmdOpticalFlowExecuteNV)(VkCommandBuffer commandBuffer, VkOpticalFlowSessionNV session, const VkOpticalFlowExecuteInfoNV* pExecuteInfo);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceOpticalFlowImageFormatsNV(
+ VkPhysicalDevice physicalDevice,
+ const VkOpticalFlowImageFormatInfoNV* pOpticalFlowImageFormatInfo,
+ uint32_t* pFormatCount,
+ VkOpticalFlowImageFormatPropertiesNV* pImageFormatProperties);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkCreateOpticalFlowSessionNV(
+ VkDevice device,
+ const VkOpticalFlowSessionCreateInfoNV* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkOpticalFlowSessionNV* pSession);
+
+VKAPI_ATTR void VKAPI_CALL vkDestroyOpticalFlowSessionNV(
+ VkDevice device,
+ VkOpticalFlowSessionNV session,
+ const VkAllocationCallbacks* pAllocator);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkBindOpticalFlowSessionImageNV(
+ VkDevice device,
+ VkOpticalFlowSessionNV session,
+ VkOpticalFlowSessionBindingPointNV bindingPoint,
+ VkImageView view,
+ VkImageLayout layout);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdOpticalFlowExecuteNV(
+ VkCommandBuffer commandBuffer,
+ VkOpticalFlowSessionNV session,
+ const VkOpticalFlowExecuteInfoNV* pExecuteInfo);
+#endif
+
+
+#define VK_EXT_legacy_dithering 1
+#define VK_EXT_LEGACY_DITHERING_SPEC_VERSION 1
+#define VK_EXT_LEGACY_DITHERING_EXTENSION_NAME "VK_EXT_legacy_dithering"
+typedef struct VkPhysicalDeviceLegacyDitheringFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 legacyDithering;
+} VkPhysicalDeviceLegacyDitheringFeaturesEXT;
+
+
+
+#define VK_EXT_pipeline_protected_access 1
+#define VK_EXT_PIPELINE_PROTECTED_ACCESS_SPEC_VERSION 1
+#define VK_EXT_PIPELINE_PROTECTED_ACCESS_EXTENSION_NAME "VK_EXT_pipeline_protected_access"
+typedef struct VkPhysicalDevicePipelineProtectedAccessFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 pipelineProtectedAccess;
+} VkPhysicalDevicePipelineProtectedAccessFeaturesEXT;
+
+
+
+#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"
+typedef struct VkPhysicalDeviceTilePropertiesFeaturesQCOM {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 tileProperties;
+} VkPhysicalDeviceTilePropertiesFeaturesQCOM;
+
+typedef struct VkTilePropertiesQCOM {
+ VkStructureType sType;
+ void* pNext;
+ VkExtent3D tileSize;
+ VkExtent2D apronSize;
+ VkOffset2D origin;
+} VkTilePropertiesQCOM;
+
+typedef VkResult (VKAPI_PTR *PFN_vkGetFramebufferTilePropertiesQCOM)(VkDevice device, VkFramebuffer framebuffer, uint32_t* pPropertiesCount, VkTilePropertiesQCOM* pProperties);
+typedef VkResult (VKAPI_PTR *PFN_vkGetDynamicRenderingTilePropertiesQCOM)(VkDevice device, const VkRenderingInfo* pRenderingInfo, VkTilePropertiesQCOM* pProperties);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkGetFramebufferTilePropertiesQCOM(
+ VkDevice device,
+ VkFramebuffer framebuffer,
+ uint32_t* pPropertiesCount,
+ VkTilePropertiesQCOM* pProperties);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetDynamicRenderingTilePropertiesQCOM(
+ VkDevice device,
+ const VkRenderingInfo* pRenderingInfo,
+ VkTilePropertiesQCOM* pProperties);
+#endif
+
+
+#define VK_SEC_amigo_profiling 1
+#define VK_SEC_AMIGO_PROFILING_SPEC_VERSION 1
+#define VK_SEC_AMIGO_PROFILING_EXTENSION_NAME "VK_SEC_amigo_profiling"
+typedef struct VkPhysicalDeviceAmigoProfilingFeaturesSEC {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 amigoProfiling;
+} VkPhysicalDeviceAmigoProfilingFeaturesSEC;
+
+typedef struct VkAmigoProfilingSubmitInfoSEC {
+ VkStructureType sType;
+ const void* pNext;
+ uint64_t firstDrawTimestamp;
+ uint64_t swapBufferTimestamp;
+} VkAmigoProfilingSubmitInfoSEC;
+
+
+
+#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"
+
+typedef enum VkRayTracingInvocationReorderModeNV {
+ VK_RAY_TRACING_INVOCATION_REORDER_MODE_NONE_NV = 0,
+ VK_RAY_TRACING_INVOCATION_REORDER_MODE_REORDER_NV = 1,
+ VK_RAY_TRACING_INVOCATION_REORDER_MODE_MAX_ENUM_NV = 0x7FFFFFFF
+} VkRayTracingInvocationReorderModeNV;
+typedef struct VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkRayTracingInvocationReorderModeNV rayTracingInvocationReorderReorderingHint;
+} VkPhysicalDeviceRayTracingInvocationReorderPropertiesNV;
+
+typedef struct VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 rayTracingInvocationReorder;
+} VkPhysicalDeviceRayTracingInvocationReorderFeaturesNV;
+
+
+
+#define VK_EXT_mutable_descriptor_type 1
+#define VK_EXT_MUTABLE_DESCRIPTOR_TYPE_SPEC_VERSION 1
+#define VK_EXT_MUTABLE_DESCRIPTOR_TYPE_EXTENSION_NAME "VK_EXT_mutable_descriptor_type"
+
+
+#define VK_ARM_shader_core_builtins 1
+#define VK_ARM_SHADER_CORE_BUILTINS_SPEC_VERSION 2
+#define VK_ARM_SHADER_CORE_BUILTINS_EXTENSION_NAME "VK_ARM_shader_core_builtins"
+typedef struct VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 shaderCoreBuiltins;
+} VkPhysicalDeviceShaderCoreBuiltinsFeaturesARM;
+
+typedef struct VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM {
+ VkStructureType sType;
+ void* pNext;
+ uint64_t shaderCoreMask;
+ uint32_t shaderCoreCount;
+ uint32_t shaderWarpsPerCore;
+} VkPhysicalDeviceShaderCoreBuiltinsPropertiesARM;
+
+
+
#define VK_KHR_acceleration_structure 1
-VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkAccelerationStructureKHR)
-#define VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION 12
+#define VK_KHR_ACCELERATION_STRUCTURE_SPEC_VERSION 13
#define VK_KHR_ACCELERATION_STRUCTURE_EXTENSION_NAME "VK_KHR_acceleration_structure"
typedef enum VkBuildAccelerationStructureModeKHR {
@@ -12776,30 +15893,13 @@ typedef enum VkBuildAccelerationStructureModeKHR {
VK_BUILD_ACCELERATION_STRUCTURE_MODE_MAX_ENUM_KHR = 0x7FFFFFFF
} VkBuildAccelerationStructureModeKHR;
-typedef enum VkAccelerationStructureBuildTypeKHR {
- VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_KHR = 0,
- VK_ACCELERATION_STRUCTURE_BUILD_TYPE_DEVICE_KHR = 1,
- VK_ACCELERATION_STRUCTURE_BUILD_TYPE_HOST_OR_DEVICE_KHR = 2,
- VK_ACCELERATION_STRUCTURE_BUILD_TYPE_MAX_ENUM_KHR = 0x7FFFFFFF
-} VkAccelerationStructureBuildTypeKHR;
-
-typedef enum VkAccelerationStructureCompatibilityKHR {
- VK_ACCELERATION_STRUCTURE_COMPATIBILITY_COMPATIBLE_KHR = 0,
- VK_ACCELERATION_STRUCTURE_COMPATIBILITY_INCOMPATIBLE_KHR = 1,
- VK_ACCELERATION_STRUCTURE_COMPATIBILITY_MAX_ENUM_KHR = 0x7FFFFFFF
-} VkAccelerationStructureCompatibilityKHR;
-
typedef enum VkAccelerationStructureCreateFlagBitsKHR {
VK_ACCELERATION_STRUCTURE_CREATE_DEVICE_ADDRESS_CAPTURE_REPLAY_BIT_KHR = 0x00000001,
+ VK_ACCELERATION_STRUCTURE_CREATE_DESCRIPTOR_BUFFER_CAPTURE_REPLAY_BIT_EXT = 0x00000008,
VK_ACCELERATION_STRUCTURE_CREATE_MOTION_BIT_NV = 0x00000004,
VK_ACCELERATION_STRUCTURE_CREATE_FLAG_BITS_MAX_ENUM_KHR = 0x7FFFFFFF
} VkAccelerationStructureCreateFlagBitsKHR;
typedef VkFlags VkAccelerationStructureCreateFlagsKHR;
-typedef union VkDeviceOrHostAddressKHR {
- VkDeviceAddress deviceAddress;
- void* hostAddress;
-} VkDeviceOrHostAddressKHR;
-
typedef struct VkAccelerationStructureBuildRangeInfoKHR {
uint32_t primitiveCount;
uint32_t primitiveOffset;
@@ -13204,6 +16304,87 @@ typedef struct VkPhysicalDeviceRayQueryFeaturesKHR {
} VkPhysicalDeviceRayQueryFeaturesKHR;
+
+#define VK_EXT_mesh_shader 1
+#define VK_EXT_MESH_SHADER_SPEC_VERSION 1
+#define VK_EXT_MESH_SHADER_EXTENSION_NAME "VK_EXT_mesh_shader"
+typedef struct VkPhysicalDeviceMeshShaderFeaturesEXT {
+ VkStructureType sType;
+ void* pNext;
+ VkBool32 taskShader;
+ VkBool32 meshShader;
+ VkBool32 multiviewMeshShader;
+ VkBool32 primitiveFragmentShadingRateMeshShader;
+ VkBool32 meshShaderQueries;
+} VkPhysicalDeviceMeshShaderFeaturesEXT;
+
+typedef struct VkPhysicalDeviceMeshShaderPropertiesEXT {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t maxTaskWorkGroupTotalCount;
+ uint32_t maxTaskWorkGroupCount[3];
+ uint32_t maxTaskWorkGroupInvocations;
+ uint32_t maxTaskWorkGroupSize[3];
+ uint32_t maxTaskPayloadSize;
+ uint32_t maxTaskSharedMemorySize;
+ uint32_t maxTaskPayloadAndSharedMemorySize;
+ uint32_t maxMeshWorkGroupTotalCount;
+ uint32_t maxMeshWorkGroupCount[3];
+ uint32_t maxMeshWorkGroupInvocations;
+ uint32_t maxMeshWorkGroupSize[3];
+ uint32_t maxMeshSharedMemorySize;
+ uint32_t maxMeshPayloadAndSharedMemorySize;
+ uint32_t maxMeshOutputMemorySize;
+ uint32_t maxMeshPayloadAndOutputMemorySize;
+ uint32_t maxMeshOutputComponents;
+ uint32_t maxMeshOutputVertices;
+ uint32_t maxMeshOutputPrimitives;
+ uint32_t maxMeshOutputLayers;
+ uint32_t maxMeshMultiviewViewCount;
+ uint32_t meshOutputPerVertexGranularity;
+ uint32_t meshOutputPerPrimitiveGranularity;
+ uint32_t maxPreferredTaskWorkGroupInvocations;
+ uint32_t maxPreferredMeshWorkGroupInvocations;
+ VkBool32 prefersLocalInvocationVertexOutput;
+ VkBool32 prefersLocalInvocationPrimitiveOutput;
+ VkBool32 prefersCompactVertexOutput;
+ VkBool32 prefersCompactPrimitiveOutput;
+} VkPhysicalDeviceMeshShaderPropertiesEXT;
+
+typedef struct VkDrawMeshTasksIndirectCommandEXT {
+ uint32_t groupCountX;
+ uint32_t groupCountY;
+ uint32_t groupCountZ;
+} VkDrawMeshTasksIndirectCommandEXT;
+
+typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksEXT)(VkCommandBuffer commandBuffer, uint32_t groupCountX, uint32_t groupCountY, uint32_t groupCountZ);
+typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectEXT)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, uint32_t drawCount, uint32_t stride);
+typedef void (VKAPI_PTR *PFN_vkCmdDrawMeshTasksIndirectCountEXT)(VkCommandBuffer commandBuffer, VkBuffer buffer, VkDeviceSize offset, VkBuffer countBuffer, VkDeviceSize countBufferOffset, uint32_t maxDrawCount, uint32_t stride);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkCmdDrawMeshTasksEXT(
+ VkCommandBuffer commandBuffer,
+ uint32_t groupCountX,
+ uint32_t groupCountY,
+ uint32_t groupCountZ);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdDrawMeshTasksIndirectEXT(
+ VkCommandBuffer commandBuffer,
+ VkBuffer buffer,
+ VkDeviceSize offset,
+ uint32_t drawCount,
+ uint32_t stride);
+
+VKAPI_ATTR void VKAPI_CALL vkCmdDrawMeshTasksIndirectCountEXT(
+ VkCommandBuffer commandBuffer,
+ VkBuffer buffer,
+ VkDeviceSize offset,
+ VkBuffer countBuffer,
+ VkDeviceSize countBufferOffset,
+ uint32_t maxDrawCount,
+ uint32_t stride);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_directfb.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_directfb.h
index 8eaac6e48d1..ab3504efafd 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_directfb.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_directfb.h
@@ -2,7 +2,7 @@
#define VULKAN_DIRECTFB_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_fuchsia.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_fuchsia.h
index d5587157380..61774ff9cb7 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_fuchsia.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_fuchsia.h
@@ -2,7 +2,7 @@
#define VULKAN_FUCHSIA_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -114,6 +114,143 @@ VKAPI_ATTR VkResult VKAPI_CALL vkGetSemaphoreZirconHandleFUCHSIA(
zx_handle_t* pZirconHandle);
#endif
+
+#define VK_FUCHSIA_buffer_collection 1
+VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkBufferCollectionFUCHSIA)
+#define VK_FUCHSIA_BUFFER_COLLECTION_SPEC_VERSION 2
+#define VK_FUCHSIA_BUFFER_COLLECTION_EXTENSION_NAME "VK_FUCHSIA_buffer_collection"
+typedef VkFlags VkImageFormatConstraintsFlagsFUCHSIA;
+
+typedef enum VkImageConstraintsInfoFlagBitsFUCHSIA {
+ VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_RARELY_FUCHSIA = 0x00000001,
+ VK_IMAGE_CONSTRAINTS_INFO_CPU_READ_OFTEN_FUCHSIA = 0x00000002,
+ VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_RARELY_FUCHSIA = 0x00000004,
+ VK_IMAGE_CONSTRAINTS_INFO_CPU_WRITE_OFTEN_FUCHSIA = 0x00000008,
+ VK_IMAGE_CONSTRAINTS_INFO_PROTECTED_OPTIONAL_FUCHSIA = 0x00000010,
+ VK_IMAGE_CONSTRAINTS_INFO_FLAG_BITS_MAX_ENUM_FUCHSIA = 0x7FFFFFFF
+} VkImageConstraintsInfoFlagBitsFUCHSIA;
+typedef VkFlags VkImageConstraintsInfoFlagsFUCHSIA;
+typedef struct VkBufferCollectionCreateInfoFUCHSIA {
+ VkStructureType sType;
+ const void* pNext;
+ zx_handle_t collectionToken;
+} VkBufferCollectionCreateInfoFUCHSIA;
+
+typedef struct VkImportMemoryBufferCollectionFUCHSIA {
+ VkStructureType sType;
+ const void* pNext;
+ VkBufferCollectionFUCHSIA collection;
+ uint32_t index;
+} VkImportMemoryBufferCollectionFUCHSIA;
+
+typedef struct VkBufferCollectionImageCreateInfoFUCHSIA {
+ VkStructureType sType;
+ const void* pNext;
+ VkBufferCollectionFUCHSIA collection;
+ uint32_t index;
+} VkBufferCollectionImageCreateInfoFUCHSIA;
+
+typedef struct VkBufferCollectionConstraintsInfoFUCHSIA {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t minBufferCount;
+ uint32_t maxBufferCount;
+ uint32_t minBufferCountForCamping;
+ uint32_t minBufferCountForDedicatedSlack;
+ uint32_t minBufferCountForSharedSlack;
+} VkBufferCollectionConstraintsInfoFUCHSIA;
+
+typedef struct VkBufferConstraintsInfoFUCHSIA {
+ VkStructureType sType;
+ const void* pNext;
+ VkBufferCreateInfo createInfo;
+ VkFormatFeatureFlags requiredFormatFeatures;
+ VkBufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints;
+} VkBufferConstraintsInfoFUCHSIA;
+
+typedef struct VkBufferCollectionBufferCreateInfoFUCHSIA {
+ VkStructureType sType;
+ const void* pNext;
+ VkBufferCollectionFUCHSIA collection;
+ uint32_t index;
+} VkBufferCollectionBufferCreateInfoFUCHSIA;
+
+typedef struct VkSysmemColorSpaceFUCHSIA {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t colorSpace;
+} VkSysmemColorSpaceFUCHSIA;
+
+typedef struct VkBufferCollectionPropertiesFUCHSIA {
+ VkStructureType sType;
+ void* pNext;
+ uint32_t memoryTypeBits;
+ uint32_t bufferCount;
+ uint32_t createInfoIndex;
+ uint64_t sysmemPixelFormat;
+ VkFormatFeatureFlags formatFeatures;
+ VkSysmemColorSpaceFUCHSIA sysmemColorSpaceIndex;
+ VkComponentMapping samplerYcbcrConversionComponents;
+ VkSamplerYcbcrModelConversion suggestedYcbcrModel;
+ VkSamplerYcbcrRange suggestedYcbcrRange;
+ VkChromaLocation suggestedXChromaOffset;
+ VkChromaLocation suggestedYChromaOffset;
+} VkBufferCollectionPropertiesFUCHSIA;
+
+typedef struct VkImageFormatConstraintsInfoFUCHSIA {
+ VkStructureType sType;
+ const void* pNext;
+ VkImageCreateInfo imageCreateInfo;
+ VkFormatFeatureFlags requiredFormatFeatures;
+ VkImageFormatConstraintsFlagsFUCHSIA flags;
+ uint64_t sysmemPixelFormat;
+ uint32_t colorSpaceCount;
+ const VkSysmemColorSpaceFUCHSIA* pColorSpaces;
+} VkImageFormatConstraintsInfoFUCHSIA;
+
+typedef struct VkImageConstraintsInfoFUCHSIA {
+ VkStructureType sType;
+ const void* pNext;
+ uint32_t formatConstraintsCount;
+ const VkImageFormatConstraintsInfoFUCHSIA* pFormatConstraints;
+ VkBufferCollectionConstraintsInfoFUCHSIA bufferCollectionConstraints;
+ VkImageConstraintsInfoFlagsFUCHSIA flags;
+} VkImageConstraintsInfoFUCHSIA;
+
+typedef VkResult (VKAPI_PTR *PFN_vkCreateBufferCollectionFUCHSIA)(VkDevice device, const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkBufferCollectionFUCHSIA* pCollection);
+typedef VkResult (VKAPI_PTR *PFN_vkSetBufferCollectionImageConstraintsFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo);
+typedef VkResult (VKAPI_PTR *PFN_vkSetBufferCollectionBufferConstraintsFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo);
+typedef void (VKAPI_PTR *PFN_vkDestroyBufferCollectionFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, const VkAllocationCallbacks* pAllocator);
+typedef VkResult (VKAPI_PTR *PFN_vkGetBufferCollectionPropertiesFUCHSIA)(VkDevice device, VkBufferCollectionFUCHSIA collection, VkBufferCollectionPropertiesFUCHSIA* pProperties);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR VkResult VKAPI_CALL vkCreateBufferCollectionFUCHSIA(
+ VkDevice device,
+ const VkBufferCollectionCreateInfoFUCHSIA* pCreateInfo,
+ const VkAllocationCallbacks* pAllocator,
+ VkBufferCollectionFUCHSIA* pCollection);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkSetBufferCollectionImageConstraintsFUCHSIA(
+ VkDevice device,
+ VkBufferCollectionFUCHSIA collection,
+ const VkImageConstraintsInfoFUCHSIA* pImageConstraintsInfo);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkSetBufferCollectionBufferConstraintsFUCHSIA(
+ VkDevice device,
+ VkBufferCollectionFUCHSIA collection,
+ const VkBufferConstraintsInfoFUCHSIA* pBufferConstraintsInfo);
+
+VKAPI_ATTR void VKAPI_CALL vkDestroyBufferCollectionFUCHSIA(
+ VkDevice device,
+ VkBufferCollectionFUCHSIA collection,
+ const VkAllocationCallbacks* pAllocator);
+
+VKAPI_ATTR VkResult VKAPI_CALL vkGetBufferCollectionPropertiesFUCHSIA(
+ VkDevice device,
+ VkBufferCollectionFUCHSIA collection,
+ VkBufferCollectionPropertiesFUCHSIA* pProperties);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_ggp.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_ggp.h
index 9a6a582c5b0..19dfd22617e 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_ggp.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_ggp.h
@@ -2,7 +2,7 @@
#define VULKAN_GGP_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_ios.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_ios.h
index 6e7e6afea6c..57922054393 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_ios.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_ios.h
@@ -2,7 +2,7 @@
#define VULKAN_IOS_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_macos.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_macos.h
index c49b123d078..8e197c7cff4 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_macos.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_macos.h
@@ -2,7 +2,7 @@
#define VULKAN_MACOS_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_metal.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_metal.h
index 5cf4a703acc..11b9640919d 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_metal.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_metal.h
@@ -2,7 +2,7 @@
#define VULKAN_METAL_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
@@ -20,7 +20,6 @@ extern "C" {
#define VK_EXT_metal_surface 1
-
#ifdef __OBJC__
@class CAMetalLayer;
#else
@@ -47,6 +46,146 @@ VKAPI_ATTR VkResult VKAPI_CALL vkCreateMetalSurfaceEXT(
VkSurfaceKHR* pSurface);
#endif
+
+#define VK_EXT_metal_objects 1
+#ifdef __OBJC__
+@protocol MTLDevice;
+typedef id<MTLDevice> MTLDevice_id;
+#else
+typedef void* MTLDevice_id;
+#endif
+
+#ifdef __OBJC__
+@protocol MTLCommandQueue;
+typedef id<MTLCommandQueue> MTLCommandQueue_id;
+#else
+typedef void* MTLCommandQueue_id;
+#endif
+
+#ifdef __OBJC__
+@protocol MTLBuffer;
+typedef id<MTLBuffer> MTLBuffer_id;
+#else
+typedef void* MTLBuffer_id;
+#endif
+
+#ifdef __OBJC__
+@protocol MTLTexture;
+typedef id<MTLTexture> MTLTexture_id;
+#else
+typedef void* MTLTexture_id;
+#endif
+
+typedef struct __IOSurface* IOSurfaceRef;
+#ifdef __OBJC__
+@protocol MTLSharedEvent;
+typedef id<MTLSharedEvent> MTLSharedEvent_id;
+#else
+typedef void* MTLSharedEvent_id;
+#endif
+
+#define VK_EXT_METAL_OBJECTS_SPEC_VERSION 1
+#define VK_EXT_METAL_OBJECTS_EXTENSION_NAME "VK_EXT_metal_objects"
+
+typedef enum VkExportMetalObjectTypeFlagBitsEXT {
+ VK_EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT = 0x00000001,
+ VK_EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT = 0x00000002,
+ VK_EXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT = 0x00000004,
+ VK_EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT = 0x00000008,
+ VK_EXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT = 0x00000010,
+ VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT = 0x00000020,
+ VK_EXPORT_METAL_OBJECT_TYPE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
+} VkExportMetalObjectTypeFlagBitsEXT;
+typedef VkFlags VkExportMetalObjectTypeFlagsEXT;
+typedef struct VkExportMetalObjectCreateInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkExportMetalObjectTypeFlagBitsEXT exportObjectType;
+} VkExportMetalObjectCreateInfoEXT;
+
+typedef struct VkExportMetalObjectsInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+} VkExportMetalObjectsInfoEXT;
+
+typedef struct VkExportMetalDeviceInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ MTLDevice_id mtlDevice;
+} VkExportMetalDeviceInfoEXT;
+
+typedef struct VkExportMetalCommandQueueInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkQueue queue;
+ MTLCommandQueue_id mtlCommandQueue;
+} VkExportMetalCommandQueueInfoEXT;
+
+typedef struct VkExportMetalBufferInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkDeviceMemory memory;
+ MTLBuffer_id mtlBuffer;
+} VkExportMetalBufferInfoEXT;
+
+typedef struct VkImportMetalBufferInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ MTLBuffer_id mtlBuffer;
+} VkImportMetalBufferInfoEXT;
+
+typedef struct VkExportMetalTextureInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkImage image;
+ VkImageView imageView;
+ VkBufferView bufferView;
+ VkImageAspectFlagBits plane;
+ MTLTexture_id mtlTexture;
+} VkExportMetalTextureInfoEXT;
+
+typedef struct VkImportMetalTextureInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkImageAspectFlagBits plane;
+ MTLTexture_id mtlTexture;
+} VkImportMetalTextureInfoEXT;
+
+typedef struct VkExportMetalIOSurfaceInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkImage image;
+ IOSurfaceRef ioSurface;
+} VkExportMetalIOSurfaceInfoEXT;
+
+typedef struct VkImportMetalIOSurfaceInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ IOSurfaceRef ioSurface;
+} VkImportMetalIOSurfaceInfoEXT;
+
+typedef struct VkExportMetalSharedEventInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ VkSemaphore semaphore;
+ VkEvent event;
+ MTLSharedEvent_id mtlSharedEvent;
+} VkExportMetalSharedEventInfoEXT;
+
+typedef struct VkImportMetalSharedEventInfoEXT {
+ VkStructureType sType;
+ const void* pNext;
+ MTLSharedEvent_id mtlSharedEvent;
+} VkImportMetalSharedEventInfoEXT;
+
+typedef void (VKAPI_PTR *PFN_vkExportMetalObjectsEXT)(VkDevice device, VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
+
+#ifndef VK_NO_PROTOTYPES
+VKAPI_ATTR void VKAPI_CALL vkExportMetalObjectsEXT(
+ VkDevice device,
+ VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
+#endif
+
#ifdef __cplusplus
}
#endif
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_screen.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_screen.h
index 92ad9bfab41..f0ef40a6caf 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_screen.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_screen.h
@@ -2,7 +2,7 @@
#define VULKAN_SCREEN_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_vi.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_vi.h
index 9e0dcca2001..0355e7a162c 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_vi.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_vi.h
@@ -2,7 +2,7 @@
#define VULKAN_VI_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_wayland.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_wayland.h
index 2a329be9dde..9afd0b76d5f 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_wayland.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_wayland.h
@@ -2,7 +2,7 @@
#define VULKAN_WAYLAND_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_win32.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_win32.h
index 1b680f0b1a2..affe0c02aef 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_win32.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_win32.h
@@ -2,7 +2,7 @@
#define VULKAN_WIN32_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xcb.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xcb.h
index 5ba2ad850a2..68e61b88f0d 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xcb.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xcb.h
@@ -2,7 +2,7 @@
#define VULKAN_XCB_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib.h
index 75c75dc2e38..ea5360ab647 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib.h
@@ -2,7 +2,7 @@
#define VULKAN_XLIB_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
diff --git a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib_xrandr.h b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib_xrandr.h
index fa274934226..8fc35cfc56e 100644
--- a/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib_xrandr.h
+++ b/3rdparty/bgfx/3rdparty/khronos/vulkan-local/vulkan_xlib_xrandr.h
@@ -2,7 +2,7 @@
#define VULKAN_XLIB_XRANDR_H_ 1
/*
-** Copyright 2015-2021 The Khronos Group Inc.
+** Copyright 2015-2022 The Khronos Group Inc.
**
** SPDX-License-Identifier: Apache-2.0
*/
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/LICENSE.md b/3rdparty/bgfx/3rdparty/meshoptimizer/LICENSE.md
index 3c52415f625..b673c248b22 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/LICENSE.md
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/LICENSE.md
@@ -1,6 +1,6 @@
MIT License
-Copyright (c) 2016-2021 Arseny Kapoulkine
+Copyright (c) 2016-2022 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/bgfx/3rdparty/meshoptimizer/src/allocator.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/src/allocator.cpp
index da7cc540b29..072e8e51ac8 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/allocator.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/allocator.cpp
@@ -1,7 +1,7 @@
// This file is part of meshoptimizer library; see meshoptimizer.h for version/license details
#include "meshoptimizer.h"
-void meshopt_setAllocator(void* (*allocate)(size_t), void (*deallocate)(void*))
+void meshopt_setAllocator(void* (MESHOPTIMIZER_ALLOC_CALLCONV *allocate)(size_t), void (MESHOPTIMIZER_ALLOC_CALLCONV *deallocate)(void*))
{
meshopt_Allocator::Storage::allocate = allocate;
meshopt_Allocator::Storage::deallocate = deallocate;
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/clusterizer.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/src/clusterizer.cpp
index b1f7b359c18..c4672ad6063 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/clusterizer.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/clusterizer.cpp
@@ -283,6 +283,79 @@ static bool appendMeshlet(meshopt_Meshlet& meshlet, unsigned int a, unsigned int
return result;
}
+static unsigned int getNeighborTriangle(const meshopt_Meshlet& meshlet, const Cone* meshlet_cone, unsigned int* meshlet_vertices, const unsigned int* indices, const TriangleAdjacency2& adjacency, const Cone* triangles, const unsigned int* live_triangles, const unsigned char* used, float meshlet_expected_radius, float cone_weight, unsigned int* out_extra)
+{
+ unsigned int best_triangle = ~0u;
+ unsigned int best_extra = 5;
+ float best_score = FLT_MAX;
+
+ for (size_t i = 0; i < meshlet.vertex_count; ++i)
+ {
+ unsigned int index = meshlet_vertices[meshlet.vertex_offset + i];
+
+ unsigned int* neighbors = &adjacency.data[0] + adjacency.offsets[index];
+ size_t neighbors_size = adjacency.counts[index];
+
+ for (size_t j = 0; j < neighbors_size; ++j)
+ {
+ unsigned int triangle = neighbors[j];
+ unsigned int a = indices[triangle * 3 + 0], b = indices[triangle * 3 + 1], c = indices[triangle * 3 + 2];
+
+ unsigned int extra = (used[a] == 0xff) + (used[b] == 0xff) + (used[c] == 0xff);
+
+ // triangles that don't add new vertices to meshlets are max. priority
+ if (extra != 0)
+ {
+ // artificially increase the priority of dangling triangles as they're expensive to add to new meshlets
+ if (live_triangles[a] == 1 || live_triangles[b] == 1 || live_triangles[c] == 1)
+ extra = 0;
+
+ extra++;
+ }
+
+ // since topology-based priority is always more important than the score, we can skip scoring in some cases
+ if (extra > best_extra)
+ continue;
+
+ float score = 0;
+
+ // caller selects one of two scoring functions: geometrical (based on meshlet cone) or topological (based on remaining triangles)
+ if (meshlet_cone)
+ {
+ const Cone& tri_cone = triangles[triangle];
+
+ float distance2 =
+ (tri_cone.px - meshlet_cone->px) * (tri_cone.px - meshlet_cone->px) +
+ (tri_cone.py - meshlet_cone->py) * (tri_cone.py - meshlet_cone->py) +
+ (tri_cone.pz - meshlet_cone->pz) * (tri_cone.pz - meshlet_cone->pz);
+
+ float spread = tri_cone.nx * meshlet_cone->nx + tri_cone.ny * meshlet_cone->ny + tri_cone.nz * meshlet_cone->nz;
+
+ score = getMeshletScore(distance2, spread, cone_weight, meshlet_expected_radius);
+ }
+ else
+ {
+ // each live_triangles entry is >= 1 since it includes the current triangle we're processing
+ score = float(live_triangles[a] + live_triangles[b] + live_triangles[c] - 3);
+ }
+
+ // note that topology-based priority is always more important than the score
+ // this helps maintain reasonable effectiveness of meshlet data and reduces scoring cost
+ if (extra < best_extra || score < best_score)
+ {
+ best_triangle = triangle;
+ best_extra = extra;
+ best_score = score;
+ }
+ }
+ }
+
+ if (out_extra)
+ *out_extra = best_extra;
+
+ return best_triangle;
+}
+
struct KDNode
{
union
@@ -464,13 +537,15 @@ size_t meshopt_buildMeshlets(meshopt_Meshlet* meshlets, unsigned int* meshlet_ve
using namespace meshopt;
assert(index_count % 3 == 0);
- assert(vertex_positions_stride > 0 && vertex_positions_stride <= 256);
+ assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256);
assert(vertex_positions_stride % sizeof(float) == 0);
assert(max_vertices >= 3 && max_vertices <= kMeshletMaxVertices);
assert(max_triangles >= 1 && max_triangles <= kMeshletMaxTriangles);
assert(max_triangles % 4 == 0); // ensures the caller will compute output space properly as index data is 4b aligned
+ assert(cone_weight >= 0 && cone_weight <= 1);
+
meshopt_Allocator allocator;
TriangleAdjacency2 adjacency = {};
@@ -511,65 +586,18 @@ size_t meshopt_buildMeshlets(meshopt_Meshlet* meshlets, unsigned int* meshlet_ve
for (;;)
{
- unsigned int best_triangle = ~0u;
- unsigned int best_extra = 5;
- float best_score = FLT_MAX;
-
Cone meshlet_cone = getMeshletCone(meshlet_cone_acc, meshlet.triangle_count);
- for (size_t i = 0; i < meshlet.vertex_count; ++i)
- {
- unsigned int index = meshlet_vertices[meshlet.vertex_offset + i];
-
- unsigned int* neighbours = &adjacency.data[0] + adjacency.offsets[index];
- size_t neighbours_size = adjacency.counts[index];
-
- for (size_t j = 0; j < neighbours_size; ++j)
- {
- unsigned int triangle = neighbours[j];
- assert(!emitted_flags[triangle]);
-
- unsigned int a = indices[triangle * 3 + 0], b = indices[triangle * 3 + 1], c = indices[triangle * 3 + 2];
- assert(a < vertex_count && b < vertex_count && c < vertex_count);
-
- unsigned int extra = (used[a] == 0xff) + (used[b] == 0xff) + (used[c] == 0xff);
-
- // triangles that don't add new vertices to meshlets are max. priority
- if (extra != 0)
- {
- // artificially increase the priority of dangling triangles as they're expensive to add to new meshlets
- if (live_triangles[a] == 1 || live_triangles[b] == 1 || live_triangles[c] == 1)
- extra = 0;
-
- extra++;
- }
-
- // since topology-based priority is always more important than the score, we can skip scoring in some cases
- if (extra > best_extra)
- continue;
-
- const Cone& tri_cone = triangles[triangle];
-
- float distance2 =
- (tri_cone.px - meshlet_cone.px) * (tri_cone.px - meshlet_cone.px) +
- (tri_cone.py - meshlet_cone.py) * (tri_cone.py - meshlet_cone.py) +
- (tri_cone.pz - meshlet_cone.pz) * (tri_cone.pz - meshlet_cone.pz);
-
- float spread = tri_cone.nx * meshlet_cone.nx + tri_cone.ny * meshlet_cone.ny + tri_cone.nz * meshlet_cone.nz;
+ unsigned int best_extra = 0;
+ unsigned int best_triangle = getNeighborTriangle(meshlet, &meshlet_cone, meshlet_vertices, indices, adjacency, triangles, live_triangles, used, meshlet_expected_radius, cone_weight, &best_extra);
- float score = getMeshletScore(distance2, spread, cone_weight, meshlet_expected_radius);
-
- // note that topology-based priority is always more important than the score
- // this helps maintain reasonable effectiveness of meshlet data and reduces scoring cost
- if (extra < best_extra || score < best_score)
- {
- best_triangle = triangle;
- best_extra = extra;
- best_score = score;
- }
- }
+ // if the best triangle doesn't fit into current meshlet, the spatial scoring we've used is not very meaningful, so we re-select using topological scoring
+ if (best_triangle != ~0u && (meshlet.vertex_count + best_extra > max_vertices || meshlet.triangle_count >= max_triangles))
+ {
+ best_triangle = getNeighborTriangle(meshlet, NULL, meshlet_vertices, indices, adjacency, triangles, live_triangles, used, meshlet_expected_radius, 0.f, NULL);
}
+ // when we run out of neighboring triangles we need to switch to spatial search; we currently just pick the closest triangle irrespective of connectivity
if (best_triangle == ~0u)
{
float position[3] = {meshlet_cone.px, meshlet_cone.py, meshlet_cone.pz};
@@ -604,16 +632,16 @@ size_t meshopt_buildMeshlets(meshopt_Meshlet* meshlets, unsigned int* meshlet_ve
{
unsigned int index = indices[best_triangle * 3 + k];
- unsigned int* neighbours = &adjacency.data[0] + adjacency.offsets[index];
- size_t neighbours_size = adjacency.counts[index];
+ unsigned int* neighbors = &adjacency.data[0] + adjacency.offsets[index];
+ size_t neighbors_size = adjacency.counts[index];
- for (size_t i = 0; i < neighbours_size; ++i)
+ for (size_t i = 0; i < neighbors_size; ++i)
{
- unsigned int tri = neighbours[i];
+ unsigned int tri = neighbors[i];
if (tri == best_triangle)
{
- neighbours[i] = neighbours[neighbours_size - 1];
+ neighbors[i] = neighbors[neighbors_size - 1];
adjacency.counts[index]--;
break;
}
@@ -687,7 +715,7 @@ meshopt_Bounds meshopt_computeClusterBounds(const unsigned int* indices, size_t
assert(index_count % 3 == 0);
assert(index_count / 3 <= kMeshletMaxTriangles);
- assert(vertex_positions_stride > 0 && vertex_positions_stride <= 256);
+ assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256);
assert(vertex_positions_stride % sizeof(float) == 0);
(void)vertex_count;
@@ -839,7 +867,7 @@ meshopt_Bounds meshopt_computeMeshletBounds(const unsigned int* meshlet_vertices
using namespace meshopt;
assert(triangle_count <= kMeshletMaxTriangles);
- assert(vertex_positions_stride > 0 && vertex_positions_stride <= 256);
+ assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256);
assert(vertex_positions_stride % sizeof(float) == 0);
unsigned int indices[kMeshletMaxTriangles * 3];
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/indexgenerator.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/src/indexgenerator.cpp
index f60db0dc4f8..cad808a2b18 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/indexgenerator.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/indexgenerator.cpp
@@ -187,7 +187,7 @@ size_t meshopt_generateVertexRemap(unsigned int* destination, const unsigned int
using namespace meshopt;
assert(indices || index_count == vertex_count);
- assert(index_count % 3 == 0);
+ assert(!indices || index_count % 3 == 0);
assert(vertex_size > 0 && vertex_size <= 256);
meshopt_Allocator allocator;
@@ -412,7 +412,7 @@ void meshopt_generateAdjacencyIndexBuffer(unsigned int* destination, const unsig
using namespace meshopt;
assert(index_count % 3 == 0);
- assert(vertex_positions_stride > 0 && vertex_positions_stride <= 256);
+ assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256);
assert(vertex_positions_stride % sizeof(float) == 0);
meshopt_Allocator allocator;
@@ -483,7 +483,7 @@ void meshopt_generateTessellationIndexBuffer(unsigned int* destination, const un
using namespace meshopt;
assert(index_count % 3 == 0);
- assert(vertex_positions_stride > 0 && vertex_positions_stride <= 256);
+ assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256);
assert(vertex_positions_stride % sizeof(float) == 0);
meshopt_Allocator allocator;
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h b/3rdparty/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h
index 55aea9086c5..d95725dd71b 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/meshoptimizer.h
@@ -1,7 +1,7 @@
/**
- * meshoptimizer - version 0.16
+ * meshoptimizer - version 0.18
*
- * Copyright (C) 2016-2021, by Arseny Kapoulkine (arseny.kapoulkine@gmail.com)
+ * Copyright (C) 2016-2022, 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.
@@ -12,13 +12,22 @@
#include <stddef.h>
/* Version macro; major * 1000 + minor * 10 + patch */
-#define MESHOPTIMIZER_VERSION 160 /* 0.16 */
+#define MESHOPTIMIZER_VERSION 180 /* 0.18 */
/* If no API is defined, assume default */
#ifndef MESHOPTIMIZER_API
#define MESHOPTIMIZER_API
#endif
+/* Set the calling-convention for alloc/dealloc function pointers */
+#ifndef MESHOPTIMIZER_ALLOC_CALLCONV
+#ifdef _MSC_VER
+#define MESHOPTIMIZER_ALLOC_CALLCONV __cdecl
+#else
+#define MESHOPTIMIZER_ALLOC_CALLCONV
+#endif
+#endif
+
/* Experimental APIs have unstable interface and might have implementation that's not fully tested or optimized */
#define MESHOPTIMIZER_EXPERIMENTAL MESHOPTIMIZER_API
@@ -28,8 +37,8 @@ extern "C" {
#endif
/**
- * Vertex attribute stream, similar to glVertexPointer
- * Each element takes size bytes, with stride controlling the spacing between successive elements.
+ * Vertex attribute stream
+ * Each element takes size bytes, beginning at data, with stride controlling the spacing between successive elements (stride >= size).
*/
struct meshopt_Stream
{
@@ -106,9 +115,9 @@ MESHOPTIMIZER_API void meshopt_generateShadowIndexBufferMulti(unsigned int* dest
* This can be used to implement algorithms like silhouette detection/expansion and other forms of GS-driven rendering.
*
* destination must contain enough space for the resulting index buffer (index_count*2 elements)
- * vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer
+ * vertex_positions should have float3 position in the first 12 bytes of each vertex
*/
-MESHOPTIMIZER_EXPERIMENTAL void meshopt_generateAdjacencyIndexBuffer(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
+MESHOPTIMIZER_API void meshopt_generateAdjacencyIndexBuffer(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
/**
* Generate index buffer that can be used for PN-AEN tessellation with crack-free displacement
@@ -122,9 +131,9 @@ MESHOPTIMIZER_EXPERIMENTAL void meshopt_generateAdjacencyIndexBuffer(unsigned in
* See "Tessellation on Any Budget" (John McDonald, GDC 2011) for implementation details.
*
* destination must contain enough space for the resulting index buffer (index_count*4 elements)
- * vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer
+ * vertex_positions should have float3 position in the first 12 bytes of each vertex
*/
-MESHOPTIMIZER_EXPERIMENTAL void meshopt_generateTessellationIndexBuffer(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
+MESHOPTIMIZER_API void meshopt_generateTessellationIndexBuffer(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
/**
* Vertex transform cache optimizer
@@ -162,7 +171,7 @@ MESHOPTIMIZER_API void meshopt_optimizeVertexCacheFifo(unsigned int* destination
*
* destination must contain enough space for the resulting index buffer (index_count elements)
* indices must contain index data that is the result of meshopt_optimizeVertexCache (*not* the original mesh indices!)
- * vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer
+ * vertex_positions should have float3 position in the first 12 bytes of each vertex
* threshold indicates how much the overdraw optimizer can degrade vertex cache efficiency (1.05 = up to 5%) to reduce overdraw more efficiently
*/
MESHOPTIMIZER_API void meshopt_optimizeOverdraw(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, float threshold);
@@ -201,10 +210,10 @@ MESHOPTIMIZER_API size_t meshopt_encodeIndexBuffer(unsigned char* buffer, size_t
MESHOPTIMIZER_API size_t meshopt_encodeIndexBufferBound(size_t index_count, size_t vertex_count);
/**
- * Experimental: Set index encoder format version
+ * Set index encoder format version
* version must specify the data format version to encode; valid values are 0 (decodable by all library versions) and 1 (decodable by 0.14+)
*/
-MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeIndexVersion(int version);
+MESHOPTIMIZER_API void meshopt_encodeIndexVersion(int version);
/**
* Index buffer decoder
@@ -217,15 +226,15 @@ MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeIndexVersion(int version);
MESHOPTIMIZER_API int meshopt_decodeIndexBuffer(void* destination, size_t index_count, size_t index_size, const unsigned char* buffer, size_t buffer_size);
/**
- * Experimental: Index sequence encoder
+ * Index sequence encoder
* Encodes index sequence into an array of bytes that is generally smaller and compresses better compared to original.
* Input index sequence can represent arbitrary topology; for triangle lists meshopt_encodeIndexBuffer is likely to be better.
* Returns encoded data size on success, 0 on error; the only error condition is if buffer doesn't have enough space
*
* buffer must contain enough space for the encoded index sequence (use meshopt_encodeIndexSequenceBound to compute worst case size)
*/
-MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_encodeIndexSequence(unsigned char* buffer, size_t buffer_size, const unsigned int* indices, size_t index_count);
-MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_encodeIndexSequenceBound(size_t index_count, size_t vertex_count);
+MESHOPTIMIZER_API size_t meshopt_encodeIndexSequence(unsigned char* buffer, size_t buffer_size, const unsigned int* indices, size_t index_count);
+MESHOPTIMIZER_API size_t meshopt_encodeIndexSequenceBound(size_t index_count, size_t vertex_count);
/**
* Index sequence decoder
@@ -235,7 +244,7 @@ MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_encodeIndexSequenceBound(size_t index_
*
* destination must contain enough space for the resulting index sequence (index_count elements)
*/
-MESHOPTIMIZER_EXPERIMENTAL int meshopt_decodeIndexSequence(void* destination, size_t index_count, size_t index_size, const unsigned char* buffer, size_t buffer_size);
+MESHOPTIMIZER_API int meshopt_decodeIndexSequence(void* destination, size_t index_count, size_t index_size, const unsigned char* buffer, size_t buffer_size);
/**
* Vertex buffer encoder
@@ -250,10 +259,10 @@ MESHOPTIMIZER_API size_t meshopt_encodeVertexBuffer(unsigned char* buffer, size_
MESHOPTIMIZER_API size_t meshopt_encodeVertexBufferBound(size_t vertex_count, size_t vertex_size);
/**
- * Experimental: Set vertex encoder format version
+ * Set vertex encoder format version
* version must specify the data format version to encode; valid values are 0 (decodable by all library versions)
*/
-MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeVertexVersion(int version);
+MESHOPTIMIZER_API void meshopt_encodeVertexVersion(int version);
/**
* Vertex buffer decoder
@@ -285,15 +294,15 @@ MESHOPTIMIZER_EXPERIMENTAL void meshopt_decodeFilterExp(void* buffer, size_t cou
/**
* Vertex buffer filter encoders
* These functions can be used to encode data in a format that meshopt_decodeFilter can decode
- *
+ *
* meshopt_encodeFilterOct encodes unit vectors with K-bit (K <= 16) signed X/Y as an output.
* Each component is stored as an 8-bit or 16-bit normalized integer; stride must be equal to 4 or 8. W is preserved as is.
* Input data must contain 4 floats for every vector (count*4 total).
- *
+ *
* meshopt_encodeFilterQuat encodes unit quaternions with K-bit (4 <= K <= 16) component encoding.
* Each component is stored as an 16-bit integer; stride must be equal to 8.
* 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.
* Input data must contain stride/4 floats for every vector (count*stride/4 total).
@@ -304,7 +313,16 @@ MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeFilterQuat(void* destination, size
MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeFilterExp(void* destination, size_t count, size_t stride, int bits, const float* data);
/**
- * Experimental: Mesh simplifier
+ * Simplification options
+ */
+enum
+{
+ /* Do not move vertices that are located on the topological border (vertices on triangle edges that don't have a paired triangle). Useful for simplifying portions of the larger mesh. */
+ meshopt_SimplifyLockBorder = 1 << 0,
+};
+
+/**
+ * Mesh simplifier
* Reduces the number of triangles in the mesh, attempting to preserve mesh appearance as much as possible
* The algorithm tries to preserve mesh topology and can stop short of the target goal based on topology constraints or target error.
* If not all attributes from the input mesh are required, it's recommended to reindex the mesh using meshopt_generateShadowIndexBuffer prior to simplification.
@@ -313,11 +331,12 @@ MESHOPTIMIZER_EXPERIMENTAL void meshopt_encodeFilterExp(void* destination, size_
* If the original vertex data isn't required, creating a compact vertex buffer using meshopt_optimizeVertexFetch is recommended.
*
* destination must contain enough space for the target index buffer, worst case is index_count elements (*not* target_index_count)!
- * vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer
- * target_error represents the error relative to mesh extents that can be tolerated, e.g. 0.01 = 1% deformation
+ * vertex_positions should have float3 position in the first 12 bytes of each vertex
+ * target_error represents the error relative to mesh extents that can be tolerated, e.g. 0.01 = 1% deformation; value range [0..1]
+ * options must be a bitmask composed of meshopt_SimplifyX options; 0 is a safe default
* result_error can be NULL; when it's not NULL, it will contain the resulting (relative) error after simplification
*/
-MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplify(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error);
+MESHOPTIMIZER_API size_t meshopt_simplify(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options, float* result_error);
/**
* Experimental: Mesh simplifier (sloppy)
@@ -328,8 +347,8 @@ MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplify(unsigned int* destination, co
* If the original vertex data isn't required, creating a compact vertex buffer using meshopt_optimizeVertexFetch is recommended.
*
* destination must contain enough space for the target index buffer, worst case is index_count elements (*not* target_index_count)!
- * vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer
- * target_error represents the error relative to mesh extents that can be tolerated, e.g. 0.01 = 1% deformation
+ * vertex_positions should have float3 position in the first 12 bytes of each vertex
+ * target_error represents the error relative to mesh extents that can be tolerated, e.g. 0.01 = 1% deformation; value range [0..1]
* result_error can be NULL; when it's not NULL, it will contain the resulting (relative) error after simplification
*/
MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifySloppy(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error);
@@ -342,17 +361,17 @@ MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifySloppy(unsigned int* destinati
* If the original vertex data isn't required, creating a compact vertex buffer using meshopt_optimizeVertexFetch is recommended.
*
* destination must contain enough space for the target index buffer (target_vertex_count elements)
- * vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer
+ * vertex_positions should have float3 position in the first 12 bytes of each vertex
*/
MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_vertex_count);
/**
- * Experimental: Returns the error scaling factor used by the simplifier to convert between absolute and relative extents
- *
+ * Returns the error scaling factor used by the simplifier to convert between absolute and relative extents
+ *
* Absolute error must be *divided* by the scaling factor before passing it to meshopt_simplify as target_error
* Relative error returned by meshopt_simplify via result_error must be *multiplied* by the scaling factor to get absolute error.
*/
-MESHOPTIMIZER_EXPERIMENTAL float meshopt_simplifyScale(const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
+MESHOPTIMIZER_API float meshopt_simplifyScale(const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
/**
* Mesh stripifier
@@ -404,7 +423,7 @@ struct meshopt_OverdrawStatistics
* Returns overdraw statistics using a software rasterizer
* Results may not match actual GPU performance
*
- * vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer
+ * vertex_positions should have float3 position in the first 12 bytes of each vertex
*/
MESHOPTIMIZER_API struct meshopt_OverdrawStatistics meshopt_analyzeOverdraw(const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
@@ -433,7 +452,7 @@ struct meshopt_Meshlet
};
/**
- * Experimental: Meshlet builder
+ * Meshlet builder
* Splits the mesh into a set of meshlets where each meshlet has a micro index buffer indexing into meshlet vertices that refer to the original vertex buffer
* The resulting data can be used to render meshes using NVidia programmable mesh shading pipeline, or in other cluster-based renderers.
* When using buildMeshlets, vertex positions need to be provided to minimize the size of the resulting clusters.
@@ -442,13 +461,13 @@ struct meshopt_Meshlet
* meshlets must contain enough space for all meshlets, worst case size can be computed with meshopt_buildMeshletsBound
* meshlet_vertices must contain enough space for all meshlets, worst case size is equal to max_meshlets * max_vertices
* meshlet_triangles must contain enough space for all meshlets, worst case size is equal to max_meshlets * max_triangles * 3
- * vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer
+ * vertex_positions should have float3 position in the first 12 bytes of each vertex
* max_vertices and max_triangles must not exceed implementation limits (max_vertices <= 255 - not 256!, max_triangles <= 512)
* cone_weight should be set to 0 when cone culling is not used, and a value between 0 and 1 otherwise to balance between cluster size and cone culling efficiency
*/
-MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_buildMeshlets(struct meshopt_Meshlet* meshlets, unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t max_vertices, size_t max_triangles, float cone_weight);
-MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_buildMeshletsScan(struct meshopt_Meshlet* meshlets, unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, const unsigned int* indices, size_t index_count, size_t vertex_count, size_t max_vertices, size_t max_triangles);
-MESHOPTIMIZER_EXPERIMENTAL size_t meshopt_buildMeshletsBound(size_t index_count, size_t max_vertices, size_t max_triangles);
+MESHOPTIMIZER_API size_t meshopt_buildMeshlets(struct meshopt_Meshlet* meshlets, unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t max_vertices, size_t max_triangles, float cone_weight);
+MESHOPTIMIZER_API size_t meshopt_buildMeshletsScan(struct meshopt_Meshlet* meshlets, unsigned int* meshlet_vertices, unsigned char* meshlet_triangles, const unsigned int* indices, size_t index_count, size_t vertex_count, size_t max_vertices, size_t max_triangles);
+MESHOPTIMIZER_API size_t meshopt_buildMeshletsBound(size_t index_count, size_t max_vertices, size_t max_triangles);
struct meshopt_Bounds
{
@@ -467,7 +486,7 @@ struct meshopt_Bounds
};
/**
- * Experimental: Cluster bounds generator
+ * Cluster bounds generator
* Creates bounding volumes that can be used for frustum, backface and occlusion culling.
*
* For backface culling with orthographic projection, use the following formula to reject backfacing clusters:
@@ -484,11 +503,11 @@ struct meshopt_Bounds
* 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.
*
- * vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer
+ * 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)
*/
-MESHOPTIMIZER_EXPERIMENTAL struct meshopt_Bounds meshopt_computeClusterBounds(const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
-MESHOPTIMIZER_EXPERIMENTAL struct meshopt_Bounds meshopt_computeMeshletBounds(const unsigned int* meshlet_vertices, const unsigned char* meshlet_triangles, size_t triangle_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
+MESHOPTIMIZER_API struct meshopt_Bounds meshopt_computeClusterBounds(const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
+MESHOPTIMIZER_API struct meshopt_Bounds meshopt_computeMeshletBounds(const unsigned int* meshlet_vertices, const unsigned char* meshlet_triangles, size_t triangle_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
/**
* Experimental: Spatial sorter
@@ -504,7 +523,7 @@ MESHOPTIMIZER_EXPERIMENTAL void meshopt_spatialSortRemap(unsigned int* destinati
* Reorders triangles for spatial locality, and generates a new index buffer. The resulting index buffer can be used with other functions like optimizeVertexCache.
*
* destination must contain enough space for the resulting index buffer (index_count elements)
- * vertex_positions should have float3 position in the first 12 bytes of each vertex - similar to glVertexPointer
+ * vertex_positions should have float3 position in the first 12 bytes of each vertex
*/
MESHOPTIMIZER_EXPERIMENTAL void meshopt_spatialSortTriangles(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride);
@@ -514,7 +533,7 @@ MESHOPTIMIZER_EXPERIMENTAL void meshopt_spatialSortTriangles(unsigned int* desti
* Note that all algorithms only allocate memory for temporary use.
* allocate/deallocate are always called in a stack-like order - last pointer to be allocated is deallocated first.
*/
-MESHOPTIMIZER_API void meshopt_setAllocator(void* (*allocate)(size_t), void (*deallocate)(void*));
+MESHOPTIMIZER_API void meshopt_setAllocator(void* (MESHOPTIMIZER_ALLOC_CALLCONV *allocate)(size_t), void (MESHOPTIMIZER_ALLOC_CALLCONV *deallocate)(void*));
#ifdef __cplusplus
} /* extern "C" */
@@ -596,7 +615,7 @@ inline size_t meshopt_encodeIndexSequence(unsigned char* buffer, size_t buffer_s
template <typename T>
inline int meshopt_decodeIndexSequence(T* destination, size_t index_count, const unsigned char* buffer, size_t buffer_size);
template <typename T>
-inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error = 0);
+inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options = 0, float* result_error = 0);
template <typename T>
inline size_t meshopt_simplifySloppy(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error = 0);
template <typename T>
@@ -696,8 +715,8 @@ public:
template <typename T>
struct StorageT
{
- static void* (*allocate)(size_t);
- static void (*deallocate)(void*);
+ static void* (MESHOPTIMIZER_ALLOC_CALLCONV *allocate)(size_t);
+ static void (MESHOPTIMIZER_ALLOC_CALLCONV *deallocate)(void*);
};
typedef StorageT<void> Storage;
@@ -728,8 +747,8 @@ private:
};
// This makes sure that allocate/deallocate are lazily generated in translation units that need them and are deduplicated by the linker
-template <typename T> void* (*meshopt_Allocator::StorageT<T>::allocate)(size_t) = operator new;
-template <typename T> void (*meshopt_Allocator::StorageT<T>::deallocate)(void*) = operator delete;
+template <typename T> void* (MESHOPTIMIZER_ALLOC_CALLCONV *meshopt_Allocator::StorageT<T>::allocate)(size_t) = operator new;
+template <typename T> void (MESHOPTIMIZER_ALLOC_CALLCONV *meshopt_Allocator::StorageT<T>::deallocate)(void*) = operator delete;
#endif
/* Inline implementation for C++ templated wrappers */
@@ -931,12 +950,12 @@ inline int meshopt_decodeIndexSequence(T* destination, size_t index_count, const
}
template <typename T>
-inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* result_error)
+inline size_t meshopt_simplify(T* destination, const T* indices, size_t index_count, const float* vertex_positions, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options, float* result_error)
{
meshopt_IndexAdapter<T> in(0, indices, index_count);
meshopt_IndexAdapter<T> out(destination, 0, index_count);
- return meshopt_simplify(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, target_index_count, target_error, result_error);
+ return meshopt_simplify(out.data, in.data, index_count, vertex_positions, vertex_count, vertex_positions_stride, target_index_count, target_error, options, result_error);
}
template <typename T>
@@ -1025,7 +1044,7 @@ inline void meshopt_spatialSortTriangles(T* destination, const T* indices, size_
#endif
/**
- * Copyright (c) 2016-2021 Arseny Kapoulkine
+ * Copyright (c) 2016-2022 Arseny Kapoulkine
*
* Permission is hereby granted, free of charge, to any person
* obtaining a copy of this software and associated documentation
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/overdrawanalyzer.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/src/overdrawanalyzer.cpp
index 8d5859ba396..8b6f254134b 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/overdrawanalyzer.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/overdrawanalyzer.cpp
@@ -147,7 +147,7 @@ meshopt_OverdrawStatistics meshopt_analyzeOverdraw(const unsigned int* indices,
using namespace meshopt;
assert(index_count % 3 == 0);
- assert(vertex_positions_stride > 0 && vertex_positions_stride <= 256);
+ assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256);
assert(vertex_positions_stride % sizeof(float) == 0);
meshopt_Allocator allocator;
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/overdrawoptimizer.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/src/overdrawoptimizer.cpp
index 143656ed762..cc22dbcffc1 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/overdrawoptimizer.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/overdrawoptimizer.cpp
@@ -272,7 +272,7 @@ void meshopt_optimizeOverdraw(unsigned int* destination, const unsigned int* ind
using namespace meshopt;
assert(index_count % 3 == 0);
- assert(vertex_positions_stride > 0 && vertex_positions_stride <= 256);
+ assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256);
assert(vertex_positions_stride % sizeof(float) == 0);
meshopt_Allocator allocator;
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp
index bf1431269db..5f0e9bac313 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/simplifier.cpp
@@ -252,7 +252,7 @@ static bool hasEdge(const EdgeAdjacency& adjacency, unsigned int a, unsigned int
return false;
}
-static void classifyVertices(unsigned char* result, unsigned int* loop, unsigned int* loopback, size_t vertex_count, const EdgeAdjacency& adjacency, const unsigned int* remap, const unsigned int* wedge)
+static void classifyVertices(unsigned char* result, unsigned int* loop, unsigned int* loopback, size_t vertex_count, const EdgeAdjacency& adjacency, const unsigned int* remap, const unsigned int* wedge, unsigned int options)
{
memset(loop, -1, vertex_count * sizeof(unsigned int));
memset(loopback, -1, vertex_count * sizeof(unsigned int));
@@ -274,7 +274,15 @@ static void classifyVertices(unsigned char* result, unsigned int* loop, unsigned
{
unsigned int target = edges[j].next;
- if (!hasEdge(adjacency, target, vertex))
+ if (target == vertex)
+ {
+ // degenerate triangles have two distinct edges instead of three, and the self edge
+ // is bi-directional by definition; this can break border/seam classification by "closing"
+ // the open edge from another triangle and falsely marking the vertex as manifold
+ // instead we mark the vertex as having >1 open edges which turns it into locked/complex
+ openinc[vertex] = openout[vertex] = vertex;
+ }
+ else if (!hasEdge(adjacency, target, vertex))
{
openinc[target] = (openinc[target] == ~0u) ? vertex : target;
openout[vertex] = (openout[vertex] == ~0u) ? target : vertex;
@@ -354,6 +362,11 @@ static void classifyVertices(unsigned char* result, unsigned int* loop, unsigned
}
}
+ if (options & meshopt_SimplifyLockBorder)
+ for (size_t i = 0; i < vertex_count; ++i)
+ if (result[i] == Kind_Border)
+ result[i] = Kind_Locked;
+
#if TRACE
printf("locked: many open edges %d, disconnected seam %d, many seam edges %d, many wedges %d\n",
int(stats[0]), int(stats[1]), int(stats[2]), int(stats[3]));
@@ -1264,14 +1277,15 @@ MESHOPTIMIZER_API unsigned int* meshopt_simplifyDebugLoop = 0;
MESHOPTIMIZER_API unsigned int* meshopt_simplifyDebugLoopBack = 0;
#endif
-size_t meshopt_simplify(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, float* out_result_error)
+size_t meshopt_simplify(unsigned int* destination, const unsigned int* indices, size_t index_count, const float* vertex_positions_data, size_t vertex_count, size_t vertex_positions_stride, size_t target_index_count, float target_error, unsigned int options, float* out_result_error)
{
using namespace meshopt;
assert(index_count % 3 == 0);
- assert(vertex_positions_stride > 0 && vertex_positions_stride <= 256);
+ assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256);
assert(vertex_positions_stride % sizeof(float) == 0);
assert(target_index_count <= index_count);
+ assert((options & ~(meshopt_SimplifyLockBorder)) == 0);
meshopt_Allocator allocator;
@@ -1291,7 +1305,7 @@ size_t meshopt_simplify(unsigned int* destination, const unsigned int* indices,
unsigned char* vertex_kind = allocator.allocate<unsigned char>(vertex_count);
unsigned int* loop = allocator.allocate<unsigned int>(vertex_count);
unsigned int* loopback = allocator.allocate<unsigned int>(vertex_count);
- classifyVertices(vertex_kind, loop, loopback, vertex_count, adjacency, remap, wedge);
+ classifyVertices(vertex_kind, loop, loopback, vertex_count, adjacency, remap, wedge, options);
#if TRACE
size_t unique_positions = 0;
@@ -1411,7 +1425,7 @@ size_t meshopt_simplifySloppy(unsigned int* destination, const unsigned int* ind
using namespace meshopt;
assert(index_count % 3 == 0);
- assert(vertex_positions_stride > 0 && vertex_positions_stride <= 256);
+ assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256);
assert(vertex_positions_stride % sizeof(float) == 0);
assert(target_index_count <= index_count);
@@ -1542,7 +1556,7 @@ size_t meshopt_simplifyPoints(unsigned int* destination, const float* vertex_pos
{
using namespace meshopt;
- assert(vertex_positions_stride > 0 && vertex_positions_stride <= 256);
+ assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256);
assert(vertex_positions_stride % sizeof(float) == 0);
assert(target_vertex_count <= vertex_count);
@@ -1654,7 +1668,7 @@ float meshopt_simplifyScale(const float* vertex_positions, size_t vertex_count,
{
using namespace meshopt;
- assert(vertex_positions_stride > 0 && vertex_positions_stride <= 256);
+ assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256);
assert(vertex_positions_stride % sizeof(float) == 0);
float extent = rescalePositions(NULL, vertex_positions, vertex_count, vertex_positions_stride);
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/spatialorder.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/src/spatialorder.cpp
index b09f80ac6f3..7b1a0694501 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/spatialorder.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/spatialorder.cpp
@@ -113,7 +113,7 @@ void meshopt_spatialSortRemap(unsigned int* destination, const float* vertex_pos
{
using namespace meshopt;
- assert(vertex_positions_stride > 0 && vertex_positions_stride <= 256);
+ assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256);
assert(vertex_positions_stride % sizeof(float) == 0);
meshopt_Allocator allocator;
@@ -144,7 +144,7 @@ void meshopt_spatialSortTriangles(unsigned int* destination, const unsigned int*
using namespace meshopt;
assert(index_count % 3 == 0);
- assert(vertex_positions_stride > 0 && vertex_positions_stride <= 256);
+ assert(vertex_positions_stride >= 12 && vertex_positions_stride <= 256);
assert(vertex_positions_stride % sizeof(float) == 0);
(void)vertex_count;
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/vcacheoptimizer.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/src/vcacheoptimizer.cpp
index fb8ade4b771..ce8fd3a887b 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/vcacheoptimizer.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/vcacheoptimizer.cpp
@@ -110,7 +110,7 @@ static unsigned int getNextVertexDeadEnd(const unsigned int* dead_end, unsigned
return ~0u;
}
-static unsigned int getNextVertexNeighbour(const unsigned int* next_candidates_begin, const unsigned int* next_candidates_end, const unsigned int* live_triangles, const unsigned int* cache_timestamps, unsigned int timestamp, unsigned int cache_size)
+static unsigned int getNextVertexNeighbor(const unsigned int* next_candidates_begin, const unsigned int* next_candidates_end, const unsigned int* live_triangles, const unsigned int* cache_timestamps, unsigned int timestamp, unsigned int cache_size)
{
unsigned int best_candidate = ~0u;
int best_priority = -1;
@@ -281,16 +281,16 @@ void meshopt_optimizeVertexCacheTable(unsigned int* destination, const unsigned
{
unsigned int index = indices[current_triangle * 3 + k];
- unsigned int* neighbours = &adjacency.data[0] + adjacency.offsets[index];
- size_t neighbours_size = adjacency.counts[index];
+ unsigned int* neighbors = &adjacency.data[0] + adjacency.offsets[index];
+ size_t neighbors_size = adjacency.counts[index];
- for (size_t i = 0; i < neighbours_size; ++i)
+ for (size_t i = 0; i < neighbors_size; ++i)
{
- unsigned int tri = neighbours[i];
+ unsigned int tri = neighbors[i];
if (tri == current_triangle)
{
- neighbours[i] = neighbours[neighbours_size - 1];
+ neighbors[i] = neighbors[neighbors_size - 1];
adjacency.counts[index]--;
break;
}
@@ -314,10 +314,10 @@ void meshopt_optimizeVertexCacheTable(unsigned int* destination, const unsigned
vertex_scores[index] = score;
// update scores of vertex triangles
- const unsigned int* neighbours_begin = &adjacency.data[0] + adjacency.offsets[index];
- const unsigned int* neighbours_end = neighbours_begin + adjacency.counts[index];
+ const unsigned int* neighbors_begin = &adjacency.data[0] + adjacency.offsets[index];
+ const unsigned int* neighbors_end = neighbors_begin + adjacency.counts[index];
- for (const unsigned int* it = neighbours_begin; it != neighbours_end; ++it)
+ for (const unsigned int* it = neighbors_begin; it != neighbors_end; ++it)
{
unsigned int tri = *it;
assert(!emitted_flags[tri]);
@@ -412,11 +412,11 @@ void meshopt_optimizeVertexCacheFifo(unsigned int* destination, const unsigned i
{
const unsigned int* next_candidates_begin = &dead_end[0] + dead_end_top;
- // emit all vertex neighbours
- const unsigned int* neighbours_begin = &adjacency.data[0] + adjacency.offsets[current_vertex];
- const unsigned int* neighbours_end = neighbours_begin + adjacency.counts[current_vertex];
+ // emit all vertex neighbors
+ const unsigned int* neighbors_begin = &adjacency.data[0] + adjacency.offsets[current_vertex];
+ const unsigned int* neighbors_end = neighbors_begin + adjacency.counts[current_vertex];
- for (const unsigned int* it = neighbours_begin; it != neighbours_end; ++it)
+ for (const unsigned int* it = neighbors_begin; it != neighbors_end; ++it)
{
unsigned int triangle = *it;
@@ -461,7 +461,7 @@ void meshopt_optimizeVertexCacheFifo(unsigned int* destination, const unsigned i
const unsigned int* next_candidates_end = &dead_end[0] + dead_end_top;
// get next vertex
- current_vertex = getNextVertexNeighbour(next_candidates_begin, next_candidates_end, &live_triangles[0], &cache_timestamps[0], timestamp, cache_size);
+ current_vertex = getNextVertexNeighbor(next_candidates_begin, next_candidates_end, &live_triangles[0], &cache_timestamps[0], timestamp, cache_size);
if (current_vertex == ~0u)
{
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp
index 5f3ec204ab1..4bd11121d2f 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexcodec.cpp
@@ -50,6 +50,12 @@
#define SIMD_TARGET
#endif
+// When targeting AArch64/x64, optimize for latency to allow decoding of individual 16-byte groups to overlap
+// We don't do this for 32-bit systems because we need 64-bit math for this and this will hurt in-order CPUs
+#if defined(__x86_64__) || defined(_M_X64) || defined(__aarch64__) || defined(_M_ARM64)
+#define SIMD_LATENCYOPT
+#endif
+
#endif // !MESHOPTIMIZER_NO_SIMD
#ifdef SIMD_SSE
@@ -77,6 +83,8 @@
#endif
#ifdef SIMD_WASM
+#undef __DEPRECATED
+#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#include <wasm_simd128.h>
#endif
@@ -470,6 +478,18 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi
typedef int unaligned_int;
#endif
+#ifdef SIMD_LATENCYOPT
+ unsigned int data32;
+ memcpy(&data32, data, 4);
+ data32 &= data32 >> 1;
+
+ // arrange bits such that low bits of nibbles of data64 contain all 2-bit elements of data32
+ unsigned long long data64 = ((unsigned long long)data32 << 30) | (data32 & 0x3fffffff);
+
+ // adds all 1-bit nibbles together; the sum fits in 4 bits because datacnt=16 would have used mode 3
+ int datacnt = int(((data64 & 0x1111111111111111ull) * 0x1111111111111111ull) >> 60);
+#endif
+
__m128i sel2 = _mm_cvtsi32_si128(*reinterpret_cast<const unaligned_int*>(data));
__m128i rest = _mm_loadu_si128(reinterpret_cast<const __m128i*>(data + 4));
@@ -488,11 +508,25 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi
_mm_storeu_si128(reinterpret_cast<__m128i*>(buffer), result);
+#ifdef SIMD_LATENCYOPT
+ return data + 4 + datacnt;
+#else
return data + 4 + kDecodeBytesGroupCount[mask0] + kDecodeBytesGroupCount[mask1];
+#endif
}
case 2:
{
+#ifdef SIMD_LATENCYOPT
+ unsigned long long data64;
+ memcpy(&data64, data, 8);
+ data64 &= data64 >> 1;
+ data64 &= data64 >> 2;
+
+ // adds all 1-bit nibbles together; the sum fits in 4 bits because datacnt=16 would have used mode 3
+ int datacnt = int(((data64 & 0x1111111111111111ull) * 0x1111111111111111ull) >> 60);
+#endif
+
__m128i sel4 = _mm_loadl_epi64(reinterpret_cast<const __m128i*>(data));
__m128i rest = _mm_loadu_si128(reinterpret_cast<const __m128i*>(data + 8));
@@ -510,7 +544,11 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi
_mm_storeu_si128(reinterpret_cast<__m128i*>(buffer), result);
+#ifdef SIMD_LATENCYOPT
+ return data + 8 + datacnt;
+#else
return data + 8 + kDecodeBytesGroupCount[mask0] + kDecodeBytesGroupCount[mask1];
+#endif
}
case 3:
@@ -602,24 +640,13 @@ static uint8x16_t shuffleBytes(unsigned char mask0, unsigned char mask1, uint8x8
static void neonMoveMask(uint8x16_t mask, unsigned char& mask0, unsigned char& mask1)
{
- static const unsigned char byte_mask_data[16] = {1, 2, 4, 8, 16, 32, 64, 128, 1, 2, 4, 8, 16, 32, 64, 128};
-
- uint8x16_t byte_mask = vld1q_u8(byte_mask_data);
- uint8x16_t masked = vandq_u8(mask, byte_mask);
+ // magic constant found using z3 SMT assuming mask has 8 groups of 0xff or 0x00
+ const uint64_t magic = 0x000103070f1f3f80ull;
-#ifdef __aarch64__
- // aarch64 has horizontal sums; MSVC doesn't expose this via arm64_neon.h so this path is exclusive to clang/gcc
- mask0 = vaddv_u8(vget_low_u8(masked));
- mask1 = vaddv_u8(vget_high_u8(masked));
-#else
- // we need horizontal sums of each half of masked, which can be done in 3 steps (yielding sums of sizes 2, 4, 8)
- uint8x8_t sum1 = vpadd_u8(vget_low_u8(masked), vget_high_u8(masked));
- uint8x8_t sum2 = vpadd_u8(sum1, sum1);
- uint8x8_t sum3 = vpadd_u8(sum2, sum2);
+ uint64x2_t mask2 = vreinterpretq_u64_u8(mask);
- mask0 = vget_lane_u8(sum3, 0);
- mask1 = vget_lane_u8(sum3, 1);
-#endif
+ mask0 = uint8_t((vgetq_lane_u64(mask2, 0) * magic) >> 56);
+ mask1 = uint8_t((vgetq_lane_u64(mask2, 1) * magic) >> 56);
}
static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsigned char* buffer, int bitslog2)
@@ -637,6 +664,18 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi
case 1:
{
+#ifdef SIMD_LATENCYOPT
+ unsigned int data32;
+ memcpy(&data32, data, 4);
+ data32 &= data32 >> 1;
+
+ // arrange bits such that low bits of nibbles of data64 contain all 2-bit elements of data32
+ unsigned long long data64 = ((unsigned long long)data32 << 30) | (data32 & 0x3fffffff);
+
+ // adds all 1-bit nibbles together; the sum fits in 4 bits because datacnt=16 would have used mode 3
+ int datacnt = int(((data64 & 0x1111111111111111ull) * 0x1111111111111111ull) >> 60);
+#endif
+
uint8x8_t sel2 = vld1_u8(data);
uint8x8_t sel22 = vzip_u8(vshr_n_u8(sel2, 4), sel2).val[0];
uint8x8x2_t sel2222 = vzip_u8(vshr_n_u8(sel22, 2), sel22);
@@ -653,11 +692,25 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi
vst1q_u8(buffer, result);
+#ifdef SIMD_LATENCYOPT
+ return data + 4 + datacnt;
+#else
return data + 4 + kDecodeBytesGroupCount[mask0] + kDecodeBytesGroupCount[mask1];
+#endif
}
case 2:
{
+#ifdef SIMD_LATENCYOPT
+ unsigned long long data64;
+ memcpy(&data64, data, 8);
+ data64 &= data64 >> 1;
+ data64 &= data64 >> 2;
+
+ // adds all 1-bit nibbles together; the sum fits in 4 bits because datacnt=16 would have used mode 3
+ int datacnt = int(((data64 & 0x1111111111111111ull) * 0x1111111111111111ull) >> 60);
+#endif
+
uint8x8_t sel4 = vld1_u8(data);
uint8x8x2_t sel44 = vzip_u8(vshr_n_u8(sel4, 4), vand_u8(sel4, vdup_n_u8(15)));
uint8x16_t sel = vcombine_u8(sel44.val[0], sel44.val[1]);
@@ -673,7 +726,11 @@ static const unsigned char* decodeBytesGroupSimd(const unsigned char* data, unsi
vst1q_u8(buffer, result);
+#ifdef SIMD_LATENCYOPT
+ return data + 8 + datacnt;
+#else
return data + 8 + kDecodeBytesGroupCount[mask0] + kDecodeBytesGroupCount[mask1];
+#endif
}
case 3:
@@ -713,7 +770,6 @@ static void wasmMoveMask(v128_t mask, unsigned char& mask0, unsigned char& mask1
// magic constant found using z3 SMT assuming mask has 8 groups of 0xff or 0x00
const uint64_t magic = 0x000103070f1f3f80ull;
- // TODO: This can use v8x16_bitmask in the future
mask0 = uint8_t((wasm_i64x2_extract_lane(mask, 0) * magic) >> 56);
mask1 = uint8_t((wasm_i64x2_extract_lane(mask, 1) * magic) >> 56);
}
@@ -1028,7 +1084,7 @@ static unsigned int getCpuFeatures()
return cpuinfo[2];
}
-unsigned int cpuid = getCpuFeatures();
+static unsigned int cpuid = getCpuFeatures();
#endif
} // namespace meshopt
diff --git a/3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexfilter.cpp b/3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexfilter.cpp
index 023452c2a99..14a73b1dddc 100644
--- a/3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexfilter.cpp
+++ b/3rdparty/bgfx/3rdparty/meshoptimizer/src/vertexfilter.cpp
@@ -52,6 +52,7 @@
#endif
#ifdef SIMD_WASM
+#undef __DEPRECATED
#include <wasm_simd128.h>
#endif
@@ -930,7 +931,7 @@ void meshopt_encodeFilterExp(void* destination_, size_t count, size_t stride, in
const float* v = &data[i * stride_float];
unsigned int* d = &destination[i * stride_float];
- // use maximum exponent to encode values; this guarantess that mantissa is [-1, 1]
+ // use maximum exponent to encode values; this guarantees that mantissa is [-1, 1]
int exp = -100;
for (size_t j = 0; j < stride_float; ++j)
diff --git a/3rdparty/bgfx/3rdparty/native_app_glue/LICENSE b/3rdparty/bgfx/3rdparty/native_app_glue/LICENSE
new file mode 100644
index 00000000000..da97d2988e7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/native_app_glue/LICENSE
@@ -0,0 +1,13 @@
+Copyright (C) 2010 The Android Open Source Project
+
+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.
diff --git a/3rdparty/bgfx/3rdparty/native_app_glue/android_native_app_glue.c b/3rdparty/bgfx/3rdparty/native_app_glue/android_native_app_glue.c
new file mode 100644
index 00000000000..0c23142e02a
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/native_app_glue/android_native_app_glue.c
@@ -0,0 +1,457 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * 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 "android_native_app_glue.h"
+
+#include <jni.h>
+
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <android/log.h>
+
+#define LOGI(...) ((void)__android_log_print(ANDROID_LOG_INFO, "threaded_app", __VA_ARGS__))
+#define LOGE(...) ((void)__android_log_print(ANDROID_LOG_ERROR, "threaded_app", __VA_ARGS__))
+
+/* For debug builds, always enable the debug traces in this library */
+#ifndef NDEBUG
+# define LOGV(...) ((void)__android_log_print(ANDROID_LOG_VERBOSE, "threaded_app", __VA_ARGS__))
+#else
+# define LOGV(...) ((void)0)
+#endif
+
+static void free_saved_state(struct android_app* android_app) {
+ pthread_mutex_lock(&android_app->mutex);
+ if (android_app->savedState != NULL) {
+ free(android_app->savedState);
+ android_app->savedState = NULL;
+ android_app->savedStateSize = 0;
+ }
+ pthread_mutex_unlock(&android_app->mutex);
+}
+
+int8_t android_app_read_cmd(struct android_app* android_app) {
+ int8_t cmd;
+ if (read(android_app->msgread, &cmd, sizeof(cmd)) != sizeof(cmd)) {
+ LOGE("No data on command pipe!");
+ return -1;
+ }
+ if (cmd == APP_CMD_SAVE_STATE) free_saved_state(android_app);
+ return cmd;
+}
+
+static void print_cur_config(struct android_app* android_app) {
+ char lang[2], country[2];
+ AConfiguration_getLanguage(android_app->config, lang);
+ AConfiguration_getCountry(android_app->config, country);
+
+ LOGV("Config: mcc=%d mnc=%d lang=%c%c cnt=%c%c orien=%d touch=%d dens=%d "
+ "keys=%d nav=%d keysHid=%d navHid=%d sdk=%d size=%d long=%d "
+ "modetype=%d modenight=%d",
+ AConfiguration_getMcc(android_app->config),
+ AConfiguration_getMnc(android_app->config),
+ lang[0], lang[1], country[0], country[1],
+ AConfiguration_getOrientation(android_app->config),
+ AConfiguration_getTouchscreen(android_app->config),
+ AConfiguration_getDensity(android_app->config),
+ AConfiguration_getKeyboard(android_app->config),
+ AConfiguration_getNavigation(android_app->config),
+ AConfiguration_getKeysHidden(android_app->config),
+ AConfiguration_getNavHidden(android_app->config),
+ AConfiguration_getSdkVersion(android_app->config),
+ AConfiguration_getScreenSize(android_app->config),
+ AConfiguration_getScreenLong(android_app->config),
+ AConfiguration_getUiModeType(android_app->config),
+ AConfiguration_getUiModeNight(android_app->config));
+}
+
+void android_app_pre_exec_cmd(struct android_app* android_app, int8_t cmd) {
+ switch (cmd) {
+ case APP_CMD_INPUT_CHANGED:
+ LOGV("APP_CMD_INPUT_CHANGED");
+ pthread_mutex_lock(&android_app->mutex);
+ if (android_app->inputQueue != NULL) {
+ AInputQueue_detachLooper(android_app->inputQueue);
+ }
+ android_app->inputQueue = android_app->pendingInputQueue;
+ if (android_app->inputQueue != NULL) {
+ LOGV("Attaching input queue to looper");
+ AInputQueue_attachLooper(android_app->inputQueue,
+ android_app->looper, LOOPER_ID_INPUT, NULL,
+ &android_app->inputPollSource);
+ }
+ pthread_cond_broadcast(&android_app->cond);
+ pthread_mutex_unlock(&android_app->mutex);
+ break;
+
+ case APP_CMD_INIT_WINDOW:
+ LOGV("APP_CMD_INIT_WINDOW");
+ pthread_mutex_lock(&android_app->mutex);
+ android_app->window = android_app->pendingWindow;
+ pthread_cond_broadcast(&android_app->cond);
+ pthread_mutex_unlock(&android_app->mutex);
+ break;
+
+ case APP_CMD_TERM_WINDOW:
+ LOGV("APP_CMD_TERM_WINDOW");
+ pthread_cond_broadcast(&android_app->cond);
+ break;
+
+ case APP_CMD_RESUME:
+ case APP_CMD_START:
+ case APP_CMD_PAUSE:
+ case APP_CMD_STOP:
+ LOGV("activityState=%d", cmd);
+ pthread_mutex_lock(&android_app->mutex);
+ android_app->activityState = cmd;
+ pthread_cond_broadcast(&android_app->cond);
+ pthread_mutex_unlock(&android_app->mutex);
+ break;
+
+ case APP_CMD_CONFIG_CHANGED:
+ LOGV("APP_CMD_CONFIG_CHANGED");
+ AConfiguration_fromAssetManager(android_app->config,
+ android_app->activity->assetManager);
+ print_cur_config(android_app);
+ break;
+
+ case APP_CMD_DESTROY:
+ LOGV("APP_CMD_DESTROY");
+ android_app->destroyRequested = 1;
+ break;
+ }
+}
+
+void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd) {
+ switch (cmd) {
+ case APP_CMD_TERM_WINDOW:
+ LOGV("APP_CMD_TERM_WINDOW");
+ pthread_mutex_lock(&android_app->mutex);
+ android_app->window = NULL;
+ pthread_cond_broadcast(&android_app->cond);
+ pthread_mutex_unlock(&android_app->mutex);
+ break;
+
+ case APP_CMD_SAVE_STATE:
+ LOGV("APP_CMD_SAVE_STATE");
+ pthread_mutex_lock(&android_app->mutex);
+ android_app->stateSaved = 1;
+ pthread_cond_broadcast(&android_app->cond);
+ pthread_mutex_unlock(&android_app->mutex);
+ break;
+
+ case APP_CMD_RESUME:
+ free_saved_state(android_app);
+ break;
+ }
+}
+
+void app_dummy() {
+}
+
+static void android_app_destroy(struct android_app* android_app) {
+ LOGV("android_app_destroy!");
+ free_saved_state(android_app);
+ pthread_mutex_lock(&android_app->mutex);
+ if (android_app->inputQueue != NULL) {
+ AInputQueue_detachLooper(android_app->inputQueue);
+ }
+ AConfiguration_delete(android_app->config);
+ android_app->destroyed = 1;
+ pthread_cond_broadcast(&android_app->cond);
+ pthread_mutex_unlock(&android_app->mutex);
+ // Can't touch android_app object after this.
+}
+
+static void process_input(struct android_app* app, struct android_poll_source* source) {
+ AInputEvent* event = NULL;
+ while (AInputQueue_getEvent(app->inputQueue, &event) >= 0) {
+ LOGV("New input event: type=%d", AInputEvent_getType(event));
+ if (AInputQueue_preDispatchEvent(app->inputQueue, event)) {
+ continue;
+ }
+ int32_t handled = 0;
+ if (app->onInputEvent != NULL) handled = app->onInputEvent(app, event);
+ AInputQueue_finishEvent(app->inputQueue, event, handled);
+ }
+}
+
+static void process_cmd(struct android_app* app, struct android_poll_source* source) {
+ int8_t cmd = android_app_read_cmd(app);
+ android_app_pre_exec_cmd(app, cmd);
+ if (app->onAppCmd != NULL) app->onAppCmd(app, cmd);
+ android_app_post_exec_cmd(app, cmd);
+}
+
+static void* android_app_entry(void* param) {
+ struct android_app* android_app = (struct android_app*)param;
+
+ android_app->config = AConfiguration_new();
+ AConfiguration_fromAssetManager(android_app->config, android_app->activity->assetManager);
+
+ print_cur_config(android_app);
+
+ android_app->cmdPollSource.id = LOOPER_ID_MAIN;
+ android_app->cmdPollSource.app = android_app;
+ android_app->cmdPollSource.process = process_cmd;
+ android_app->inputPollSource.id = LOOPER_ID_INPUT;
+ android_app->inputPollSource.app = android_app;
+ android_app->inputPollSource.process = process_input;
+
+ ALooper* looper = ALooper_prepare(ALOOPER_PREPARE_ALLOW_NON_CALLBACKS);
+ ALooper_addFd(looper, android_app->msgread, LOOPER_ID_MAIN, ALOOPER_EVENT_INPUT, NULL,
+ &android_app->cmdPollSource);
+ android_app->looper = looper;
+
+ pthread_mutex_lock(&android_app->mutex);
+ android_app->running = 1;
+ pthread_cond_broadcast(&android_app->cond);
+ pthread_mutex_unlock(&android_app->mutex);
+
+ android_main(android_app);
+
+ android_app_destroy(android_app);
+ return NULL;
+}
+
+// --------------------------------------------------------------------
+// Native activity interaction (called from main thread)
+// --------------------------------------------------------------------
+
+static struct android_app* android_app_create(ANativeActivity* activity,
+ void* savedState, size_t savedStateSize) {
+ struct android_app* android_app = (struct android_app*)calloc(1, sizeof(struct android_app));
+ android_app->activity = activity;
+
+ pthread_mutex_init(&android_app->mutex, NULL);
+ pthread_cond_init(&android_app->cond, NULL);
+
+ if (savedState != NULL) {
+ android_app->savedState = malloc(savedStateSize);
+ android_app->savedStateSize = savedStateSize;
+ memcpy(android_app->savedState, savedState, savedStateSize);
+ }
+
+ int msgpipe[2];
+ if (pipe(msgpipe)) {
+ LOGE("could not create pipe: %s", strerror(errno));
+ return NULL;
+ }
+ android_app->msgread = msgpipe[0];
+ android_app->msgwrite = msgpipe[1];
+
+ pthread_attr_t attr;
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
+ pthread_create(&android_app->thread, &attr, android_app_entry, android_app);
+
+ // Wait for thread to start.
+ pthread_mutex_lock(&android_app->mutex);
+ while (!android_app->running) {
+ pthread_cond_wait(&android_app->cond, &android_app->mutex);
+ }
+ pthread_mutex_unlock(&android_app->mutex);
+
+ return android_app;
+}
+
+static void android_app_write_cmd(struct android_app* android_app, int8_t cmd) {
+ if (write(android_app->msgwrite, &cmd, sizeof(cmd)) != sizeof(cmd)) {
+ LOGE("Failure writing android_app cmd: %s", strerror(errno));
+ }
+}
+
+static void android_app_set_input(struct android_app* android_app, AInputQueue* inputQueue) {
+ pthread_mutex_lock(&android_app->mutex);
+ android_app->pendingInputQueue = inputQueue;
+ android_app_write_cmd(android_app, APP_CMD_INPUT_CHANGED);
+ while (android_app->inputQueue != android_app->pendingInputQueue) {
+ pthread_cond_wait(&android_app->cond, &android_app->mutex);
+ }
+ pthread_mutex_unlock(&android_app->mutex);
+}
+
+static void android_app_set_window(struct android_app* android_app, ANativeWindow* window) {
+ pthread_mutex_lock(&android_app->mutex);
+ if (android_app->pendingWindow != NULL) {
+ android_app_write_cmd(android_app, APP_CMD_TERM_WINDOW);
+ }
+ android_app->pendingWindow = window;
+ if (window != NULL) {
+ android_app_write_cmd(android_app, APP_CMD_INIT_WINDOW);
+ }
+ while (android_app->window != android_app->pendingWindow) {
+ pthread_cond_wait(&android_app->cond, &android_app->mutex);
+ }
+ pthread_mutex_unlock(&android_app->mutex);
+}
+
+static void android_app_set_activity_state(struct android_app* android_app, int8_t cmd) {
+ pthread_mutex_lock(&android_app->mutex);
+ android_app_write_cmd(android_app, cmd);
+ while (android_app->activityState != cmd) {
+ pthread_cond_wait(&android_app->cond, &android_app->mutex);
+ }
+ pthread_mutex_unlock(&android_app->mutex);
+}
+
+static void android_app_free(struct android_app* android_app) {
+ pthread_mutex_lock(&android_app->mutex);
+ android_app_write_cmd(android_app, APP_CMD_DESTROY);
+ while (!android_app->destroyed) {
+ pthread_cond_wait(&android_app->cond, &android_app->mutex);
+ }
+ pthread_mutex_unlock(&android_app->mutex);
+
+ close(android_app->msgread);
+ close(android_app->msgwrite);
+ pthread_cond_destroy(&android_app->cond);
+ pthread_mutex_destroy(&android_app->mutex);
+ free(android_app);
+}
+
+static struct android_app* ToApp(ANativeActivity* activity) {
+ return (struct android_app*) activity->instance;
+}
+
+static void onDestroy(ANativeActivity* activity) {
+ LOGV("Destroy: %p", activity);
+ android_app_free(ToApp(activity));
+}
+
+static void onStart(ANativeActivity* activity) {
+ LOGV("Start: %p", activity);
+ android_app_set_activity_state(ToApp(activity), APP_CMD_START);
+}
+
+static void onResume(ANativeActivity* activity) {
+ LOGV("Resume: %p", activity);
+ android_app_set_activity_state(ToApp(activity), APP_CMD_RESUME);
+}
+
+static void* onSaveInstanceState(ANativeActivity* activity, size_t* outLen) {
+ LOGV("SaveInstanceState: %p", activity);
+
+ struct android_app* android_app = ToApp(activity);
+ void* savedState = NULL;
+ pthread_mutex_lock(&android_app->mutex);
+ android_app->stateSaved = 0;
+ android_app_write_cmd(android_app, APP_CMD_SAVE_STATE);
+ while (!android_app->stateSaved) {
+ pthread_cond_wait(&android_app->cond, &android_app->mutex);
+ }
+
+ if (android_app->savedState != NULL) {
+ savedState = android_app->savedState;
+ *outLen = android_app->savedStateSize;
+ android_app->savedState = NULL;
+ android_app->savedStateSize = 0;
+ }
+
+ pthread_mutex_unlock(&android_app->mutex);
+
+ return savedState;
+}
+
+static void onPause(ANativeActivity* activity) {
+ LOGV("Pause: %p", activity);
+ android_app_set_activity_state(ToApp(activity), APP_CMD_PAUSE);
+}
+
+static void onStop(ANativeActivity* activity) {
+ LOGV("Stop: %p", activity);
+ android_app_set_activity_state(ToApp(activity), APP_CMD_STOP);
+}
+
+static void onConfigurationChanged(ANativeActivity* activity) {
+ LOGV("ConfigurationChanged: %p", activity);
+ android_app_write_cmd(ToApp(activity), APP_CMD_CONFIG_CHANGED);
+}
+
+static void onContentRectChanged(ANativeActivity* activity, const ARect* r) {
+ LOGV("ContentRectChanged: l=%d,t=%d,r=%d,b=%d", r->left, r->top, r->right, r->bottom);
+ struct android_app* android_app = ToApp(activity);
+ pthread_mutex_lock(&android_app->mutex);
+ android_app->contentRect = *r;
+ pthread_mutex_unlock(&android_app->mutex);
+ android_app_write_cmd(ToApp(activity), APP_CMD_CONTENT_RECT_CHANGED);
+}
+
+static void onLowMemory(ANativeActivity* activity) {
+ LOGV("LowMemory: %p", activity);
+ android_app_write_cmd(ToApp(activity), APP_CMD_LOW_MEMORY);
+}
+
+static void onWindowFocusChanged(ANativeActivity* activity, int focused) {
+ LOGV("WindowFocusChanged: %p -- %d", activity, focused);
+ android_app_write_cmd(ToApp(activity), focused ? APP_CMD_GAINED_FOCUS : APP_CMD_LOST_FOCUS);
+}
+
+static void onNativeWindowCreated(ANativeActivity* activity, ANativeWindow* window) {
+ LOGV("NativeWindowCreated: %p -- %p", activity, window);
+ android_app_set_window(ToApp(activity), window);
+}
+
+static void onNativeWindowDestroyed(ANativeActivity* activity, ANativeWindow* window) {
+ LOGV("NativeWindowDestroyed: %p -- %p", activity, window);
+ android_app_set_window(ToApp(activity), NULL);
+}
+
+static void onNativeWindowRedrawNeeded(ANativeActivity* activity, ANativeWindow* window) {
+ LOGV("NativeWindowRedrawNeeded: %p -- %p", activity, window);
+ android_app_write_cmd(ToApp(activity), APP_CMD_WINDOW_REDRAW_NEEDED);
+}
+
+static void onNativeWindowResized(ANativeActivity* activity, ANativeWindow* window) {
+ LOGV("NativeWindowResized: %p -- %p", activity, window);
+ android_app_write_cmd(ToApp(activity), APP_CMD_WINDOW_RESIZED);
+}
+
+static void onInputQueueCreated(ANativeActivity* activity, AInputQueue* queue) {
+ LOGV("InputQueueCreated: %p -- %p", activity, queue);
+ android_app_set_input(ToApp(activity), queue);
+}
+
+static void onInputQueueDestroyed(ANativeActivity* activity, AInputQueue* queue) {
+ LOGV("InputQueueDestroyed: %p -- %p", activity, queue);
+ android_app_set_input(ToApp(activity), NULL);
+}
+
+JNIEXPORT
+void ANativeActivity_onCreate(ANativeActivity* activity, void* savedState, size_t savedStateSize) {
+ LOGV("Creating: %p", activity);
+
+ activity->callbacks->onConfigurationChanged = onConfigurationChanged;
+ activity->callbacks->onContentRectChanged = onContentRectChanged;
+ activity->callbacks->onDestroy = onDestroy;
+ activity->callbacks->onInputQueueCreated = onInputQueueCreated;
+ activity->callbacks->onInputQueueDestroyed = onInputQueueDestroyed;
+ activity->callbacks->onLowMemory = onLowMemory;
+ activity->callbacks->onNativeWindowCreated = onNativeWindowCreated;
+ activity->callbacks->onNativeWindowDestroyed = onNativeWindowDestroyed;
+ activity->callbacks->onNativeWindowRedrawNeeded = onNativeWindowRedrawNeeded;
+ activity->callbacks->onNativeWindowResized = onNativeWindowResized;
+ activity->callbacks->onPause = onPause;
+ activity->callbacks->onResume = onResume;
+ activity->callbacks->onSaveInstanceState = onSaveInstanceState;
+ activity->callbacks->onStart = onStart;
+ activity->callbacks->onStop = onStop;
+ activity->callbacks->onWindowFocusChanged = onWindowFocusChanged;
+
+ activity->instance = android_app_create(activity, savedState, savedStateSize);
+}
diff --git a/3rdparty/bgfx/3rdparty/native_app_glue/android_native_app_glue.h b/3rdparty/bgfx/3rdparty/native_app_glue/android_native_app_glue.h
new file mode 100644
index 00000000000..89eafe3ff9f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/native_app_glue/android_native_app_glue.h
@@ -0,0 +1,350 @@
+/*
+ * Copyright (C) 2010 The Android Open Source Project
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <poll.h>
+#include <pthread.h>
+#include <sched.h>
+
+#include <android/configuration.h>
+#include <android/looper.h>
+#include <android/native_activity.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * The native activity interface provided by <android/native_activity.h>
+ * is based on a set of application-provided callbacks that will be called
+ * by the Activity's main thread when certain events occur.
+ *
+ * This means that each one of this callbacks _should_ _not_ block, or they
+ * risk having the system force-close the application. This programming
+ * model is direct, lightweight, but constraining.
+ *
+ * The 'android_native_app_glue' static library is used to provide a different
+ * execution model where the application can implement its own main event
+ * loop in a different thread instead. Here's how it works:
+ *
+ * 1/ The application must provide a function named "android_main()" that
+ * will be called when the activity is created, in a new thread that is
+ * distinct from the activity's main thread.
+ *
+ * 2/ android_main() receives a pointer to a valid "android_app" structure
+ * that contains references to other important objects, e.g. the
+ * ANativeActivity obejct instance the application is running in.
+ *
+ * 3/ the "android_app" object holds an ALooper instance that already
+ * listens to two important things:
+ *
+ * - activity lifecycle events (e.g. "pause", "resume"). See APP_CMD_XXX
+ * declarations below.
+ *
+ * - input events coming from the AInputQueue attached to the activity.
+ *
+ * Each of these correspond to an ALooper identifier returned by
+ * ALooper_pollOnce with values of LOOPER_ID_MAIN and LOOPER_ID_INPUT,
+ * respectively.
+ *
+ * Your application can use the same ALooper to listen to additional
+ * file-descriptors. They can either be callback based, or with return
+ * identifiers starting with LOOPER_ID_USER.
+ *
+ * 4/ Whenever you receive a LOOPER_ID_MAIN or LOOPER_ID_INPUT event,
+ * the returned data will point to an android_poll_source structure. You
+ * can call the process() function on it, and fill in android_app->onAppCmd
+ * and android_app->onInputEvent to be called for your own processing
+ * of the event.
+ *
+ * Alternatively, you can call the low-level functions to read and process
+ * the data directly... look at the process_cmd() and process_input()
+ * implementations in the glue to see how to do this.
+ *
+ * See the sample named "native-activity" that comes with the NDK with a
+ * full usage example. Also look at the JavaDoc of NativeActivity.
+ */
+
+struct android_app;
+
+/**
+ * Data associated with an ALooper fd that will be returned as the "outData"
+ * when that source has data ready.
+ */
+struct android_poll_source {
+ // The identifier of this source. May be LOOPER_ID_MAIN or
+ // LOOPER_ID_INPUT.
+ int32_t id;
+
+ // The android_app this ident is associated with.
+ struct android_app* app;
+
+ // Function to call to perform the standard processing of data from
+ // this source.
+ void (*process)(struct android_app* app, struct android_poll_source* source);
+};
+
+/**
+ * This is the interface for the standard glue code of a threaded
+ * application. In this model, the application's code is running
+ * in its own thread separate from the main thread of the process.
+ * It is not required that this thread be associated with the Java
+ * VM, although it will need to be in order to make JNI calls any
+ * Java objects.
+ */
+struct android_app {
+ // The application can place a pointer to its own state object
+ // here if it likes.
+ void* userData;
+
+ // Fill this in with the function to process main app commands (APP_CMD_*)
+ void (*onAppCmd)(struct android_app* app, int32_t cmd);
+
+ // Fill this in with the function to process input events. At this point
+ // the event has already been pre-dispatched, and it will be finished upon
+ // return. Return 1 if you have handled the event, 0 for any default
+ // dispatching.
+ int32_t (*onInputEvent)(struct android_app* app, AInputEvent* event);
+
+ // The ANativeActivity object instance that this app is running in.
+ ANativeActivity* activity;
+
+ // The current configuration the app is running in.
+ AConfiguration* config;
+
+ // This is the last instance's saved state, as provided at creation time.
+ // It is NULL if there was no state. You can use this as you need; the
+ // memory will remain around until you call android_app_exec_cmd() for
+ // APP_CMD_RESUME, at which point it will be freed and savedState set to NULL.
+ // These variables should only be changed when processing a APP_CMD_SAVE_STATE,
+ // at which point they will be initialized to NULL and you can malloc your
+ // state and place the information here. In that case the memory will be
+ // freed for you later.
+ void* savedState;
+ size_t savedStateSize;
+
+ // The ALooper associated with the app's thread.
+ ALooper* looper;
+
+ // When non-NULL, this is the input queue from which the app will
+ // receive user input events.
+ AInputQueue* inputQueue;
+
+ // When non-NULL, this is the window surface that the app can draw in.
+ ANativeWindow* window;
+
+ // Current content rectangle of the window; this is the area where the
+ // window's content should be placed to be seen by the user.
+ ARect contentRect;
+
+ // Current state of the app's activity. May be either APP_CMD_START,
+ // APP_CMD_RESUME, APP_CMD_PAUSE, or APP_CMD_STOP; see below.
+ int activityState;
+
+ // This is non-zero when the application's NativeActivity is being
+ // destroyed and waiting for the app thread to complete.
+ int destroyRequested;
+
+ // -------------------------------------------------
+ // Below are "private" implementation of the glue code.
+
+ pthread_mutex_t mutex;
+ pthread_cond_t cond;
+
+ int msgread;
+ int msgwrite;
+
+ pthread_t thread;
+
+ struct android_poll_source cmdPollSource;
+ struct android_poll_source inputPollSource;
+
+ int running;
+ int stateSaved;
+ int destroyed;
+ int redrawNeeded;
+ AInputQueue* pendingInputQueue;
+ ANativeWindow* pendingWindow;
+ ARect pendingContentRect;
+};
+
+enum {
+ /**
+ * Looper data ID of commands coming from the app's main thread, which
+ * is returned as an identifier from ALooper_pollOnce(). The data for this
+ * identifier is a pointer to an android_poll_source structure.
+ * These can be retrieved and processed with android_app_read_cmd()
+ * and android_app_exec_cmd().
+ */
+ LOOPER_ID_MAIN = 1,
+
+ /**
+ * Looper data ID of events coming from the AInputQueue of the
+ * application's window, which is returned as an identifier from
+ * ALooper_pollOnce(). The data for this identifier is a pointer to an
+ * android_poll_source structure. These can be read via the inputQueue
+ * object of android_app.
+ */
+ LOOPER_ID_INPUT = 2,
+
+ /**
+ * Start of user-defined ALooper identifiers.
+ */
+ LOOPER_ID_USER = 3,
+};
+
+enum {
+ /**
+ * Command from main thread: the AInputQueue has changed. Upon processing
+ * this command, android_app->inputQueue will be updated to the new queue
+ * (or NULL).
+ */
+ APP_CMD_INPUT_CHANGED,
+
+ /**
+ * Command from main thread: a new ANativeWindow is ready for use. Upon
+ * receiving this command, android_app->window will contain the new window
+ * surface.
+ */
+ APP_CMD_INIT_WINDOW,
+
+ /**
+ * Command from main thread: the existing ANativeWindow needs to be
+ * terminated. Upon receiving this command, android_app->window still
+ * contains the existing window; after calling android_app_exec_cmd
+ * it will be set to NULL.
+ */
+ APP_CMD_TERM_WINDOW,
+
+ /**
+ * Command from main thread: the current ANativeWindow has been resized.
+ * Please redraw with its new size.
+ */
+ APP_CMD_WINDOW_RESIZED,
+
+ /**
+ * Command from main thread: the system needs that the current ANativeWindow
+ * be redrawn. You should redraw the window before handing this to
+ * android_app_exec_cmd() in order to avoid transient drawing glitches.
+ */
+ APP_CMD_WINDOW_REDRAW_NEEDED,
+
+ /**
+ * Command from main thread: the content area of the window has changed,
+ * such as from the soft input window being shown or hidden. You can
+ * find the new content rect in android_app::contentRect.
+ */
+ APP_CMD_CONTENT_RECT_CHANGED,
+
+ /**
+ * Command from main thread: the app's activity window has gained
+ * input focus.
+ */
+ APP_CMD_GAINED_FOCUS,
+
+ /**
+ * Command from main thread: the app's activity window has lost
+ * input focus.
+ */
+ APP_CMD_LOST_FOCUS,
+
+ /**
+ * Command from main thread: the current device configuration has changed.
+ */
+ APP_CMD_CONFIG_CHANGED,
+
+ /**
+ * Command from main thread: the system is running low on memory.
+ * Try to reduce your memory use.
+ */
+ APP_CMD_LOW_MEMORY,
+
+ /**
+ * Command from main thread: the app's activity has been started.
+ */
+ APP_CMD_START,
+
+ /**
+ * Command from main thread: the app's activity has been resumed.
+ */
+ APP_CMD_RESUME,
+
+ /**
+ * Command from main thread: the app should generate a new saved state
+ * for itself, to restore from later if needed. If you have saved state,
+ * allocate it with malloc and place it in android_app.savedState with
+ * the size in android_app.savedStateSize. The will be freed for you
+ * later.
+ */
+ APP_CMD_SAVE_STATE,
+
+ /**
+ * Command from main thread: the app's activity has been paused.
+ */
+ APP_CMD_PAUSE,
+
+ /**
+ * Command from main thread: the app's activity has been stopped.
+ */
+ APP_CMD_STOP,
+
+ /**
+ * Command from main thread: the app's activity is being destroyed,
+ * and waiting for the app thread to clean up and exit before proceeding.
+ */
+ APP_CMD_DESTROY,
+};
+
+/**
+ * Call when ALooper_pollAll() returns LOOPER_ID_MAIN, reading the next
+ * app command message.
+ */
+int8_t android_app_read_cmd(struct android_app* android_app);
+
+/**
+ * Call with the command returned by android_app_read_cmd() to do the
+ * initial pre-processing of the given command. You can perform your own
+ * actions for the command after calling this function.
+ */
+void android_app_pre_exec_cmd(struct android_app* android_app, int8_t cmd);
+
+/**
+ * Call with the command returned by android_app_read_cmd() to do the
+ * final post-processing of the given command. You must have done your own
+ * actions for the command before calling this function.
+ */
+void android_app_post_exec_cmd(struct android_app* android_app, int8_t cmd);
+
+/**
+ * No-op function that used to be used to prevent the linker from stripping app
+ * glue code. No longer necessary, since __attribute__((visibility("default")))
+ * does this for us.
+ */
+__attribute__((
+ deprecated("Calls to app_dummy are no longer necessary. See "
+ "https://github.com/android-ndk/ndk/issues/381."))) void
+app_dummy();
+
+/**
+ * This is the function that application code must implement, representing
+ * the main entry to the app.
+ */
+extern void android_main(struct android_app* app);
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/3rdparty/bgfx/3rdparty/renderdoc/renderdoc_app.h b/3rdparty/bgfx/3rdparty/renderdoc/renderdoc_app.h
index 075306c0479..402dd3d4a47 100644
--- a/3rdparty/bgfx/3rdparty/renderdoc/renderdoc_app.h
+++ b/3rdparty/bgfx/3rdparty/renderdoc/renderdoc_app.h
@@ -1,7 +1,7 @@
/******************************************************************************
* The MIT License (MIT)
*
- * Copyright (c) 2019-2020 Baldur Karlsson
+ * Copyright (c) 2019-2022 Baldur Karlsson
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@@ -107,15 +107,16 @@ typedef enum RENDERDOC_CaptureOption {
// 0 - no callstacks are captured
eRENDERDOC_Option_CaptureCallstacks = 3,
- // When capturing CPU callstacks, only capture them from drawcalls.
+ // When capturing CPU callstacks, only capture them from actions.
// This option does nothing without the above option being enabled
//
// Default - disabled
//
- // 1 - Only captures callstacks for drawcall type API events.
+ // 1 - Only captures callstacks for actions.
// Ignored if CaptureCallstacks is disabled
// 0 - Callstacks, if enabled, are captured for every event.
eRENDERDOC_Option_CaptureCallstacksOnlyDraws = 4,
+ eRENDERDOC_Option_CaptureCallstacksOnlyActions = 4,
// Specify a delay in seconds to wait for a debugger to attach, after
// creating or injecting into a process, before continuing to allow it to run.
@@ -451,6 +452,15 @@ typedef uint32_t(RENDERDOC_CC *pRENDERDOC_LaunchReplayUI)(uint32_t connectTarget
// ignored and the others will be filled out.
typedef void(RENDERDOC_CC *pRENDERDOC_GetAPIVersion)(int *major, int *minor, int *patch);
+// Requests that the replay UI show itself (if hidden or not the current top window). This can be
+// used in conjunction with IsTargetControlConnected and LaunchReplayUI to intelligently handle
+// showing the UI after making a capture.
+//
+// This will return 1 if the request was successfully passed on, though it's not guaranteed that
+// the UI will be on top in all cases depending on OS rules. It will return 0 if there is no current
+// target control connection to make such a request, or if there was another error
+typedef uint32_t(RENDERDOC_CC *pRENDERDOC_ShowReplayUI)();
+
//////////////////////////////////////////////////////////////////////////
// Capturing functions
//
@@ -524,6 +534,16 @@ typedef uint32_t(RENDERDOC_CC *pRENDERDOC_EndFrameCapture)(RENDERDOC_DevicePoint
typedef uint32_t(RENDERDOC_CC *pRENDERDOC_DiscardFrameCapture)(RENDERDOC_DevicePointer device,
RENDERDOC_WindowHandle wndHandle);
+// Only valid to be called between a call to StartFrameCapture and EndFrameCapture. Gives a custom
+// title to the capture produced which will be displayed in the UI.
+//
+// If multiple captures are ongoing, this title will be applied to the first capture to end after
+// this call. The second capture to end will have no title, unless this function is called again.
+//
+// Calling this function has no effect if no capture is currently running, and if it is called
+// multiple times only the last title will be used.
+typedef void(RENDERDOC_CC *pRENDERDOC_SetCaptureTitle)(const char *title);
+
//////////////////////////////////////////////////////////////////////////////////////////////////
// RenderDoc API versions
//
@@ -548,6 +568,9 @@ typedef enum RENDERDOC_Version {
eRENDERDOC_API_Version_1_3_0 = 10300, // RENDERDOC_API_1_3_0 = 1 03 00
eRENDERDOC_API_Version_1_4_0 = 10400, // RENDERDOC_API_1_4_0 = 1 04 00
eRENDERDOC_API_Version_1_4_1 = 10401, // RENDERDOC_API_1_4_1 = 1 04 01
+ eRENDERDOC_API_Version_1_4_2 = 10402, // RENDERDOC_API_1_4_2 = 1 04 02
+ eRENDERDOC_API_Version_1_5_0 = 10500, // RENDERDOC_API_1_5_0 = 1 05 00
+ eRENDERDOC_API_Version_1_6_0 = 10600, // RENDERDOC_API_1_6_0 = 1 06 00
} RENDERDOC_Version;
// API version changelog:
@@ -574,8 +597,12 @@ typedef enum RENDERDOC_Version {
// 1.4.0 - Added feature: DiscardFrameCapture() to discard a frame capture in progress and stop
// capturing without saving anything to disk.
// 1.4.1 - Refactor: Renamed Shutdown to RemoveHooks to better clarify what is happening
+// 1.4.2 - Refactor: Renamed 'draws' to 'actions' in callstack capture option.
+// 1.5.0 - Added feature: ShowReplayUI() to request that the replay UI show itself if connected
+// 1.6.0 - Added feature: SetCaptureTitle() which can be used to set a title for a
+// capture made with StartFrameCapture() or EndFrameCapture()
-typedef struct RENDERDOC_API_1_4_1
+typedef struct RENDERDOC_API_1_6_0
{
pRENDERDOC_GetAPIVersion GetAPIVersion;
@@ -647,17 +674,26 @@ typedef struct RENDERDOC_API_1_4_1
// new function in 1.4.0
pRENDERDOC_DiscardFrameCapture DiscardFrameCapture;
-} RENDERDOC_API_1_4_1;
-
-typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_0_0;
-typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_0_1;
-typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_0_2;
-typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_1_0;
-typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_1_1;
-typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_1_2;
-typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_2_0;
-typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_3_0;
-typedef RENDERDOC_API_1_4_1 RENDERDOC_API_1_4_0;
+
+ // new function in 1.5.0
+ pRENDERDOC_ShowReplayUI ShowReplayUI;
+
+ // new function in 1.6.0
+ pRENDERDOC_SetCaptureTitle SetCaptureTitle;
+} RENDERDOC_API_1_6_0;
+
+typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_0_0;
+typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_0_1;
+typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_0_2;
+typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_1_0;
+typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_1_1;
+typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_1_2;
+typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_2_0;
+typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_3_0;
+typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_4_0;
+typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_4_1;
+typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_4_2;
+typedef RENDERDOC_API_1_6_0 RENDERDOC_API_1_5_0;
//////////////////////////////////////////////////////////////////////////////////////////////////
// RenderDoc API entry point
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/main.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/main.cpp
index e5b4e3a1988..58c7d0eb4f1 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/main.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/main.cpp
@@ -77,7 +77,7 @@ struct CLICallbacks
struct CLIParser
{
CLIParser(CLICallbacks cbs_, int argc_, char *argv_[])
- : cbs(move(cbs_))
+ : cbs(std::move(cbs_))
, argc(argc_)
, argv(argv_)
{
@@ -400,6 +400,12 @@ static void print_resources(const Compiler &compiler, const char *tag, const Sma
fprintf(stderr, " writeonly");
if (mask.get(DecorationNonWritable))
fprintf(stderr, " readonly");
+ if (mask.get(DecorationRestrict))
+ fprintf(stderr, " restrict");
+ if (mask.get(DecorationCoherent))
+ fprintf(stderr, " coherent");
+ if (mask.get(DecorationVolatile))
+ fprintf(stderr, " volatile");
if (is_sized_block)
{
fprintf(stderr, " (BlockSize : %u bytes)", block_size);
@@ -530,6 +536,7 @@ static void print_resources(const Compiler &compiler, const ShaderResources &res
print_resources(compiler, "push", res.push_constant_buffers);
print_resources(compiler, "counters", res.atomic_counters);
print_resources(compiler, "acceleration structures", res.acceleration_structures);
+ print_resources(compiler, "record buffers", res.shader_record_buffers);
print_resources(compiler, spv::StorageClassInput, res.builtin_inputs);
print_resources(compiler, spv::StorageClassOutput, res.builtin_outputs);
}
@@ -606,6 +613,12 @@ struct InterfaceVariableRename
string variable_name;
};
+struct HLSLVertexAttributeRemapNamed
+{
+ std::string name;
+ std::string semantic;
+};
+
struct CLIArguments
{
const char *input = nullptr;
@@ -647,6 +660,7 @@ struct CLIArguments
bool msl_enable_frag_stencil_ref_builtin = true;
uint32_t msl_enable_frag_output_mask = 0xffffffff;
bool msl_enable_clip_distance_user_varying = true;
+ bool msl_raw_buffer_tese_input = false;
bool msl_multi_patch_workgroup = false;
bool msl_vertex_for_tessellation = false;
uint32_t msl_additional_fixed_sample_mask = 0xffffffff;
@@ -658,6 +672,8 @@ struct CLIArguments
bool msl_emulate_subgroups = false;
uint32_t msl_fixed_subgroup_size = 0;
bool msl_force_sample_rate_shading = false;
+ bool msl_manual_helper_invocation_updates = true;
+ bool msl_check_discarded_frag_stores = false;
const char *msl_combined_sampler_suffix = nullptr;
bool glsl_emit_push_constant_as_ubo = false;
bool glsl_emit_ubo_as_plain_uniforms = false;
@@ -669,11 +685,14 @@ struct CLIArguments
bool emit_line_directives = false;
bool enable_storage_image_qualifier_deduction = true;
bool force_zero_initialized_variables = false;
+ bool relax_nan_checks = false;
+ uint32_t force_recompile_max_debug_iterations = 3;
SmallVector<uint32_t> msl_discrete_descriptor_sets;
SmallVector<uint32_t> msl_device_argument_buffers;
SmallVector<pair<uint32_t, uint32_t>> msl_dynamic_buffers;
SmallVector<pair<uint32_t, uint32_t>> msl_inline_uniform_blocks;
- SmallVector<MSLShaderInput> msl_shader_inputs;
+ SmallVector<MSLShaderInterfaceVariable> msl_shader_inputs;
+ SmallVector<MSLShaderInterfaceVariable> msl_shader_outputs;
SmallVector<PLSArg> pls_in;
SmallVector<PLSArg> pls_out;
SmallVector<Remap> remaps;
@@ -681,6 +700,7 @@ struct CLIArguments
SmallVector<VariableTypeRemap> variable_type_remaps;
SmallVector<InterfaceVariableRename> interface_variable_renames;
SmallVector<HLSLVertexAttributeRemap> hlsl_attr_remap;
+ SmallVector<HLSLVertexAttributeRemapNamed> hlsl_attr_remap_named;
SmallVector<std::pair<uint32_t, uint32_t>> masked_stage_outputs;
SmallVector<BuiltIn> masked_stage_builtins;
string entry;
@@ -700,7 +720,12 @@ struct CLIArguments
bool msl = false;
bool hlsl = false;
bool hlsl_compat = false;
+
bool hlsl_support_nonzero_base = false;
+ bool hlsl_base_vertex_index_explicit_binding = false;
+ uint32_t hlsl_base_vertex_index_register_index = 0;
+ uint32_t hlsl_base_vertex_index_register_space = 0;
+
bool hlsl_force_storage_buffer_as_uav = false;
bool hlsl_nonwritable_uav_texture_as_srv = false;
bool hlsl_enable_16bit_types = false;
@@ -790,10 +815,14 @@ static void print_help_hlsl()
// clang-format off
fprintf(stderr, "\nHLSL options:\n"
"\t[--shader-model]:\n\t\tEnables a specific shader model, e.g. --shader-model 50 for SM 5.0.\n"
+ "\t[--flatten-ubo]:\n\t\tEmit UBOs as plain uniform arrays.\n"
+ "\t\tE.g.: uniform MyUBO { vec4 a; float b, c, d, e; }; will be emitted as uniform float4 MyUBO[2];\n"
+ "\t\tCaveat: You cannot mix and match floating-point and integer in the same UBO with this option.\n"
"\t[--hlsl-enable-compat]:\n\t\tAllow point size and point coord to be used, even if they won't work as expected.\n"
"\t\tPointSize is ignored, and PointCoord returns (0.5, 0.5).\n"
"\t[--hlsl-support-nonzero-basevertex-baseinstance]:\n\t\tSupport base vertex and base instance by emitting a special cbuffer declared as:\n"
"\t\tcbuffer SPIRV_Cross_VertexInfo { int SPIRV_Cross_BaseVertex; int SPIRV_Cross_BaseInstance; };\n"
+ "\t[--hlsl-basevertex-baseinstance-binding <register index> <register space>]:\n\t\tAssign a fixed binding to SPIRV_Cross_VertexInfo.\n"
"\t[--hlsl-auto-binding (push, cbv, srv, uav, sampler, all)]\n"
"\t\tDo not emit any : register(#) bindings for specific resource types, and rely on HLSL compiler to assign something.\n"
"\t[--hlsl-force-storage-buffer-as-uav]:\n\t\tAlways emit SSBOs as UAVs, even when marked as read-only.\n"
@@ -804,6 +833,8 @@ static void print_help_hlsl()
"\t\tShader must ensure that read/write state is consistent at all call sites.\n"
"\t[--set-hlsl-vertex-input-semantic <location> <semantic>]:\n\t\tEmits a specific vertex input semantic for a given location.\n"
"\t\tOtherwise, TEXCOORD# is used as semantics, where # is location.\n"
+ "\t[--set-hlsl-named-vertex-input-semantic <name> <semantic>]:\n\t\tEmits a specific vertex input semantic for a given name.\n"
+ "\t\tOpName reflection information must be intact.\n"
"\t[--hlsl-enable-16bit-types]:\n\t\tEnables native use of half/int16_t/uint16_t and ByteAddressBuffer interaction with these types. Requires SM 6.2.\n"
"\t[--hlsl-flatten-matrix-vertex-input-semantics]:\n\t\tEmits matrix vertex inputs with input semantics as if they were independent vectors, e.g. TEXCOORD{2,3,4} rather than matrix form TEXCOORD2_{0,1,2}.\n"
);
@@ -859,16 +890,33 @@ static void print_help_msl()
"\t[--msl-disable-frag-stencil-ref-builtin]:\n\t\tDisable FragStencilRef output. Useful if pipeline does not enable stencil output, as pipeline creation might otherwise fail.\n"
"\t[--msl-enable-frag-output-mask <mask>]:\n\t\tOnly selectively enable fragment outputs. Useful if pipeline does not enable fragment output for certain locations, as pipeline creation might otherwise fail.\n"
"\t[--msl-no-clip-distance-user-varying]:\n\t\tDo not emit user varyings to emulate gl_ClipDistance in fragment shaders.\n"
- "\t[--msl-shader-input <index> <format> <size>]:\n\t\tSpecify the format of the shader input at <index>.\n"
+ "\t[--msl-add-shader-input <index> <format> <size> <rate>]:\n\t\tSpecify the format of the shader input at <index>.\n"
"\t\t<format> can be 'any32', 'any16', 'u16', 'u8', or 'other', to indicate a 32-bit opaque value, 16-bit opaque value, 16-bit unsigned integer, 8-bit unsigned integer, "
- "or other-typed variable. <size> is the vector length of the variable, which must be greater than or equal to that declared in the shader.\n"
+ "or other-typed variable. <size> is the vector length of the variable, which must be greater than or equal to that declared in the shader. <rate> can be 'vertex', "
+ "'primitive', or 'patch' to indicate a per-vertex, per-primitive, or per-patch variable.\n"
"\t\tUseful if shader stage interfaces don't match up, as pipeline creation might otherwise fail.\n"
+ "\t[--msl-add-shader-output <index> <format> <size> <rate>]:\n\t\tSpecify the format of the shader output at <index>.\n"
+ "\t\t<format> can be 'any32', 'any16', 'u16', 'u8', or 'other', to indicate a 32-bit opaque value, 16-bit opaque value, 16-bit unsigned integer, 8-bit unsigned integer, "
+ "or other-typed variable. <size> is the vector length of the variable, which must be greater than or equal to that declared in the shader. <rate> can be 'vertex', "
+ "'primitive', or 'patch' to indicate a per-vertex, per-primitive, or per-patch variable.\n"
+ "\t\tUseful if shader stage interfaces don't match up, as pipeline creation might otherwise fail.\n"
+ "\t[--msl-shader-input <index> <format> <size>]:\n\t\tSpecify the format of the shader input at <index>.\n"
+ "\t\t<format> can be 'any32', 'any16', 'u16', 'u8', or 'other', to indicate a 32-bit opaque value, 16-bit opaque value, 16-bit unsigned integer, 8-bit unsigned integer, "
+ "or other-typed variable. <size> is the vector length of the variable, which must be greater than or equal to that declared in the shader."
+ "\t\tEquivalent to --msl-add-shader-input with a rate of 'vertex'.\n"
+ "\t[--msl-shader-output <index> <format> <size>]:\n\t\tSpecify the format of the shader output at <index>.\n"
+ "\t\t<format> can be 'any32', 'any16', 'u16', 'u8', or 'other', to indicate a 32-bit opaque value, 16-bit opaque value, 16-bit unsigned integer, 8-bit unsigned integer, "
+ "or other-typed variable. <size> is the vector length of the variable, which must be greater than or equal to that declared in the shader."
+ "\t\tEquivalent to --msl-add-shader-output with a rate of 'vertex'.\n"
+ "\t[--msl-raw-buffer-tese-input]:\n\t\tUse raw buffers for tessellation evaluation input.\n"
+ "\t\tThis allows the use of nested structures and arrays.\n"
+ "\t\tIn a future version of SPIRV-Cross, this will become the default.\n"
"\t[--msl-multi-patch-workgroup]:\n\t\tUse the new style of tessellation control processing, where multiple patches are processed per workgroup.\n"
- "\t\tThis should increase throughput by ensuring all the GPU's SIMD lanes are occupied, but it is not compatible with the old style.\n"
- "\t\tIn addition, this style also passes input variables in buffers directly instead of using vertex attribute processing.\n"
- "\t\tIn a future version of SPIRV-Cross, this will become the default.\n"
+ "\t\tThis should increase throughput by ensuring all the GPU's SIMD lanes are occupied, but it is not compatible with the old style.\n"
+ "\t\tIn addition, this style also passes input variables in buffers directly instead of using vertex attribute processing.\n"
+ "\t\tIn a future version of SPIRV-Cross, this will become the default.\n"
"\t[--msl-vertex-for-tessellation]:\n\t\tWhen handling a vertex shader, marks it as one that will be used with a new-style tessellation control shader.\n"
- "\t\tThe vertex shader is output to MSL as a compute kernel which outputs vertices to the buffer in the order they are received, rather than in index order as with --msl-capture-output normally.\n"
+ "\t\tThe vertex shader is output to MSL as a compute kernel which outputs vertices to the buffer in the order they are received, rather than in index order as with --msl-capture-output normally.\n"
"\t[--msl-additional-fixed-sample-mask <mask>]:\n"
"\t\tSet an additional fixed sample mask. If the shader outputs a sample mask, then the final sample mask will be a bitwise AND of the two.\n"
"\t[--msl-arrayed-subpass-input]:\n\t\tAssume that images of dimension SubpassData have multiple layers. Layered input attachments are accessed relative to BuiltInLayer.\n"
@@ -888,6 +936,13 @@ static void print_help_msl()
"\t\tIf 0, assume variable subgroup size as actually exposed by Metal.\n"
"\t[--msl-force-sample-rate-shading]:\n\t\tForce fragment shaders to run per sample.\n"
"\t\tThis adds a [[sample_id]] parameter if none is already present.\n"
+ "\t[--msl-no-manual-helper-invocation-updates]:\n\t\tDo not manually update the HelperInvocation builtin when a fragment is discarded.\n"
+ "\t\tSome Metal devices have a bug where simd_is_helper_thread() does not return true\n"
+ "\t\tafter the fragment is discarded. This behavior is required by Vulkan and SPIR-V, however.\n"
+ "\t[--msl-check-discarded-frag-stores]:\n\t\tAdd additional checks to resource stores in a fragment shader.\n"
+ "\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-combined-sampler-suffix <suffix>]:\n\t\tUses a custom suffix for combined samplers.\n");
// clang-format on
}
@@ -897,7 +952,7 @@ static void print_help_common()
// clang-format off
fprintf(stderr, "\nCommon options:\n"
"\t[--entry name]:\n\t\tUse a specific entry point. By default, the first entry point in the module is used.\n"
- "\t[--stage <stage (vert, frag, geom, tesc, tese comp)>]:\n\t\tForces use of a certain shader stage.\n"
+ "\t[--stage <stage (vert, frag, geom, tesc, tese, comp)>]:\n\t\tForces use of a certain shader stage.\n"
"\t\tCan disambiguate the entry point if more than one entry point exists with same name, but different stage.\n"
"\t[--emit-line-directives]:\n\t\tIf SPIR-V has OpLine directives, aim to emit those accurately in output code as well.\n"
"\t[--rename-entry-point <old> <new> <stage>]:\n\t\tRenames an entry point from what is declared in SPIR-V to code output.\n"
@@ -915,6 +970,7 @@ static void print_help_common()
"\t[--mask-stage-output-builtin <Position|PointSize|ClipDistance|CullDistance>]:\n"
"\t\tIf a stage output variable with matching builtin is active, "
"optimize away the variable if it can affect cross-stage linking correctness.\n"
+ "\t[--relax-nan-checks]:\n\t\tRelax NaN checks for N{Clamp,Min,Max} and ordered vs. unordered compare instructions.\n"
);
// clang-format on
}
@@ -932,6 +988,8 @@ static void print_help_obscure()
"\t\tdo not attempt to analyze usage, and always emit read/write state.\n"
"\t[--flatten-multidimensional-arrays]:\n\t\tDo not support multi-dimensional arrays and flatten them to one dimension.\n"
"\t[--cpp-interface-name <name>]:\n\t\tEmit a specific class name in C++ codegen.\n"
+ "\t[--force-recompile-max-debug-iterations <count>]:\n\t\tAllow compilation loop to run for N loops.\n"
+ "\t\tCan be used to triage workarounds, but should not be used as a crutch, since it masks an implementation bug.\n"
);
// clang-format on
}
@@ -1056,6 +1114,22 @@ static ExecutionModel stage_to_execution_model(const std::string &stage)
return ExecutionModelTessellationEvaluation;
else if (stage == "geom")
return ExecutionModelGeometry;
+ else if (stage == "rgen")
+ return ExecutionModelRayGenerationKHR;
+ else if (stage == "rint")
+ return ExecutionModelIntersectionKHR;
+ else if (stage == "rahit")
+ return ExecutionModelAnyHitKHR;
+ else if (stage == "rchit")
+ return ExecutionModelClosestHitKHR;
+ else if (stage == "rmiss")
+ return ExecutionModelMissKHR;
+ else if (stage == "rcall")
+ return ExecutionModelCallableKHR;
+ else if (stage == "mesh")
+ return spv::ExecutionModelMeshEXT;
+ else if (stage == "task")
+ return spv::ExecutionModelTaskEXT;
else
SPIRV_CROSS_THROW("Invalid stage.");
}
@@ -1083,7 +1157,7 @@ static HLSLBindingFlags hlsl_resource_type_to_flag(const std::string &arg)
static string compile_iteration(const CLIArguments &args, std::vector<uint32_t> spirv_file)
{
- Parser spirv_parser(move(spirv_file));
+ Parser spirv_parser(std::move(spirv_file));
spirv_parser.parse();
unique_ptr<CompilerGLSL> compiler;
@@ -1092,13 +1166,13 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
if (args.cpp)
{
- compiler.reset(new CompilerCPP(move(spirv_parser.get_parsed_ir())));
+ compiler.reset(new CompilerCPP(std::move(spirv_parser.get_parsed_ir())));
if (args.cpp_interface_name)
static_cast<CompilerCPP *>(compiler.get())->set_interface_name(args.cpp_interface_name);
}
else if (args.msl)
{
- compiler.reset(new CompilerMSL(move(spirv_parser.get_parsed_ir())));
+ compiler.reset(new CompilerMSL(std::move(spirv_parser.get_parsed_ir())));
auto *msl_comp = static_cast<CompilerMSL *>(compiler.get());
auto msl_opts = msl_comp->get_msl_options();
@@ -1128,6 +1202,7 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
msl_opts.enable_frag_stencil_ref_builtin = args.msl_enable_frag_stencil_ref_builtin;
msl_opts.enable_frag_output_mask = args.msl_enable_frag_output_mask;
msl_opts.enable_clip_distance_user_varying = args.msl_enable_clip_distance_user_varying;
+ msl_opts.raw_buffer_tese_input = args.msl_raw_buffer_tese_input;
msl_opts.multi_patch_workgroup = args.msl_multi_patch_workgroup;
msl_opts.vertex_for_tessellation = args.msl_vertex_for_tessellation;
msl_opts.additional_fixed_sample_mask = args.msl_additional_fixed_sample_mask;
@@ -1139,6 +1214,8 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
msl_opts.emulate_subgroups = args.msl_emulate_subgroups;
msl_opts.fixed_subgroup_size = args.msl_fixed_subgroup_size;
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.ios_support_base_vertex_instance = true;
msl_comp->set_msl_options(msl_opts);
for (auto &v : args.msl_discrete_descriptor_sets)
@@ -1152,17 +1229,19 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
msl_comp->add_inline_uniform_block(v.first, v.second);
for (auto &v : args.msl_shader_inputs)
msl_comp->add_msl_shader_input(v);
+ for (auto &v : args.msl_shader_outputs)
+ msl_comp->add_msl_shader_output(v);
if (args.msl_combined_sampler_suffix)
msl_comp->set_combined_sampler_suffix(args.msl_combined_sampler_suffix);
}
else if (args.hlsl)
- compiler.reset(new CompilerHLSL(move(spirv_parser.get_parsed_ir())));
+ compiler.reset(new CompilerHLSL(std::move(spirv_parser.get_parsed_ir())));
else
{
combined_image_samplers = !args.vulkan_semantics;
if (!args.vulkan_semantics || args.vulkan_glsl_disable_ext_samplerless_texture_functions)
build_dummy_sampler = true;
- compiler.reset(new CompilerGLSL(move(spirv_parser.get_parsed_ir())));
+ compiler.reset(new CompilerGLSL(std::move(spirv_parser.get_parsed_ir())));
}
if (!args.variable_type_remaps.empty())
@@ -1173,7 +1252,7 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
out = remap.new_variable_type;
};
- compiler->set_variable_type_remap_callback(move(remap_cb));
+ compiler->set_variable_type_remap_callback(std::move(remap_cb));
}
for (auto &masked : args.masked_stage_outputs)
@@ -1286,6 +1365,8 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
opts.emit_line_directives = args.emit_line_directives;
opts.enable_storage_image_qualifier_deduction = args.enable_storage_image_qualifier_deduction;
opts.force_zero_initialized_variables = args.force_zero_initialized_variables;
+ opts.relax_nan_checks = args.relax_nan_checks;
+ opts.force_recompile_max_debug_iterations = args.force_recompile_max_debug_iterations;
compiler->set_common_options(opts);
for (auto &fetch : args.glsl_ext_framebuffer_fetch)
@@ -1320,6 +1401,10 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
build_dummy_sampler = true;
}
+ // If we're explicitly renaming, we probably want that name to be output.
+ if (!args.entry_point_rename.empty())
+ hlsl_opts.use_entry_point_name = true;
+
hlsl_opts.support_nonzero_base_vertex_base_instance = args.hlsl_support_nonzero_base;
hlsl_opts.force_storage_buffer_as_uav = args.hlsl_force_storage_buffer_as_uav;
hlsl_opts.nonwritable_uav_texture_as_srv = args.hlsl_nonwritable_uav_texture_as_srv;
@@ -1327,6 +1412,12 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
hlsl_opts.flatten_matrix_vertex_input_semantics = args.hlsl_flatten_matrix_vertex_input_semantics;
hlsl->set_hlsl_options(hlsl_opts);
hlsl->set_resource_binding_flags(args.hlsl_binding_flags);
+ if (args.hlsl_base_vertex_index_explicit_binding)
+ {
+ hlsl->set_hlsl_aux_buffer_binding(HLSL_AUX_BINDING_BASE_VERTEX_INSTANCE,
+ args.hlsl_base_vertex_index_register_index,
+ args.hlsl_base_vertex_index_register_space);
+ }
}
if (build_dummy_sampler)
@@ -1345,7 +1436,7 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
{
auto active = compiler->get_active_interface_variables();
res = compiler->get_shader_resources(active);
- compiler->set_enabled_interface_variables(move(active));
+ compiler->set_enabled_interface_variables(std::move(active));
}
else
res = compiler->get_shader_resources();
@@ -1360,7 +1451,7 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
auto pls_inputs = remap_pls(args.pls_in, res.stage_inputs, &res.subpass_inputs);
auto pls_outputs = remap_pls(args.pls_out, res.stage_outputs, nullptr);
- compiler->remap_pixel_local_storage(move(pls_inputs), move(pls_outputs));
+ compiler->remap_pixel_local_storage(std::move(pls_inputs), std::move(pls_outputs));
for (auto &ext : args.extensions)
compiler->require_extension(ext);
@@ -1407,18 +1498,29 @@ static string compile_iteration(const CLIArguments &args, std::vector<uint32_t>
if (args.hlsl)
{
auto *hlsl_compiler = static_cast<CompilerHLSL *>(compiler.get());
- uint32_t new_builtin = hlsl_compiler->remap_num_workgroups_builtin();
- if (new_builtin)
- {
- hlsl_compiler->set_decoration(new_builtin, DecorationDescriptorSet, 0);
- hlsl_compiler->set_decoration(new_builtin, DecorationBinding, 0);
- }
+ hlsl_compiler->remap_num_workgroups_builtin();
}
if (args.hlsl)
{
for (auto &remap : args.hlsl_attr_remap)
static_cast<CompilerHLSL *>(compiler.get())->add_vertex_attribute_remap(remap);
+
+ for (auto &named_remap : args.hlsl_attr_remap_named)
+ {
+ auto itr = std::find_if(res.stage_inputs.begin(), res.stage_inputs.end(), [&](const Resource &input_res) {
+ return input_res.name == named_remap.name;
+ });
+
+ if (itr != res.stage_inputs.end())
+ {
+ HLSLVertexAttributeRemap remap = {
+ compiler->get_decoration(itr->id, DecorationLocation),
+ named_remap.semantic,
+ };
+ static_cast<CompilerHLSL *>(compiler.get())->add_vertex_attribute_remap(remap);
+ }
+ }
}
auto ret = compiler->compile();
@@ -1494,6 +1596,11 @@ static int main_inner(int argc, char *argv[])
cbs.add("--hlsl-enable-compat", [&args](CLIParser &) { args.hlsl_compat = true; });
cbs.add("--hlsl-support-nonzero-basevertex-baseinstance",
[&args](CLIParser &) { args.hlsl_support_nonzero_base = true; });
+ cbs.add("--hlsl-basevertex-baseinstance-binding", [&args](CLIParser &parser) {
+ args.hlsl_base_vertex_index_explicit_binding = true;
+ args.hlsl_base_vertex_index_register_index = parser.next_uint();
+ args.hlsl_base_vertex_index_register_space = parser.next_uint();
+ });
cbs.add("--hlsl-auto-binding", [&args](CLIParser &parser) {
args.hlsl_binding_flags |= hlsl_resource_type_to_flag(parser.next_string());
});
@@ -1553,24 +1660,93 @@ static int main_inner(int argc, char *argv[])
[&args](CLIParser &parser) { args.msl_enable_frag_output_mask = parser.next_hex_uint(); });
cbs.add("--msl-no-clip-distance-user-varying",
[&args](CLIParser &) { args.msl_enable_clip_distance_user_varying = false; });
+ cbs.add("--msl-add-shader-input", [&args](CLIParser &parser) {
+ MSLShaderInterfaceVariable input;
+ // Make sure next_uint() is called in-order.
+ input.location = parser.next_uint();
+ const char *format = parser.next_value_string("other");
+ if (strcmp(format, "any32") == 0)
+ input.format = MSL_SHADER_VARIABLE_FORMAT_ANY32;
+ else if (strcmp(format, "any16") == 0)
+ input.format = MSL_SHADER_VARIABLE_FORMAT_ANY16;
+ else if (strcmp(format, "u16") == 0)
+ input.format = MSL_SHADER_VARIABLE_FORMAT_UINT16;
+ else if (strcmp(format, "u8") == 0)
+ input.format = MSL_SHADER_VARIABLE_FORMAT_UINT8;
+ else
+ input.format = MSL_SHADER_VARIABLE_FORMAT_OTHER;
+ input.vecsize = parser.next_uint();
+ const char *rate = parser.next_value_string("vertex");
+ if (strcmp(rate, "primitive") == 0)
+ input.rate = MSL_SHADER_VARIABLE_RATE_PER_PRIMITIVE;
+ else if (strcmp(rate, "patch") == 0)
+ input.rate = MSL_SHADER_VARIABLE_RATE_PER_PATCH;
+ else
+ input.rate = MSL_SHADER_VARIABLE_RATE_PER_VERTEX;
+ args.msl_shader_inputs.push_back(input);
+ });
+ cbs.add("--msl-add-shader-output", [&args](CLIParser &parser) {
+ MSLShaderInterfaceVariable output;
+ // Make sure next_uint() is called in-order.
+ output.location = parser.next_uint();
+ const char *format = parser.next_value_string("other");
+ if (strcmp(format, "any32") == 0)
+ output.format = MSL_SHADER_VARIABLE_FORMAT_ANY32;
+ else if (strcmp(format, "any16") == 0)
+ output.format = MSL_SHADER_VARIABLE_FORMAT_ANY16;
+ else if (strcmp(format, "u16") == 0)
+ output.format = MSL_SHADER_VARIABLE_FORMAT_UINT16;
+ else if (strcmp(format, "u8") == 0)
+ output.format = MSL_SHADER_VARIABLE_FORMAT_UINT8;
+ else
+ output.format = MSL_SHADER_VARIABLE_FORMAT_OTHER;
+ output.vecsize = parser.next_uint();
+ const char *rate = parser.next_value_string("vertex");
+ if (strcmp(rate, "primitive") == 0)
+ output.rate = MSL_SHADER_VARIABLE_RATE_PER_PRIMITIVE;
+ else if (strcmp(rate, "patch") == 0)
+ output.rate = MSL_SHADER_VARIABLE_RATE_PER_PATCH;
+ else
+ output.rate = MSL_SHADER_VARIABLE_RATE_PER_VERTEX;
+ args.msl_shader_outputs.push_back(output);
+ });
cbs.add("--msl-shader-input", [&args](CLIParser &parser) {
- MSLShaderInput input;
+ MSLShaderInterfaceVariable input;
// Make sure next_uint() is called in-order.
input.location = parser.next_uint();
const char *format = parser.next_value_string("other");
if (strcmp(format, "any32") == 0)
- input.format = MSL_SHADER_INPUT_FORMAT_ANY32;
+ input.format = MSL_SHADER_VARIABLE_FORMAT_ANY32;
else if (strcmp(format, "any16") == 0)
- input.format = MSL_SHADER_INPUT_FORMAT_ANY16;
+ input.format = MSL_SHADER_VARIABLE_FORMAT_ANY16;
else if (strcmp(format, "u16") == 0)
- input.format = MSL_SHADER_INPUT_FORMAT_UINT16;
+ input.format = MSL_SHADER_VARIABLE_FORMAT_UINT16;
else if (strcmp(format, "u8") == 0)
- input.format = MSL_SHADER_INPUT_FORMAT_UINT8;
+ input.format = MSL_SHADER_VARIABLE_FORMAT_UINT8;
else
- input.format = MSL_SHADER_INPUT_FORMAT_OTHER;
+ input.format = MSL_SHADER_VARIABLE_FORMAT_OTHER;
input.vecsize = parser.next_uint();
args.msl_shader_inputs.push_back(input);
});
+ cbs.add("--msl-shader-output", [&args](CLIParser &parser) {
+ MSLShaderInterfaceVariable output;
+ // Make sure next_uint() is called in-order.
+ output.location = parser.next_uint();
+ const char *format = parser.next_value_string("other");
+ if (strcmp(format, "any32") == 0)
+ output.format = MSL_SHADER_VARIABLE_FORMAT_ANY32;
+ else if (strcmp(format, "any16") == 0)
+ output.format = MSL_SHADER_VARIABLE_FORMAT_ANY16;
+ else if (strcmp(format, "u16") == 0)
+ output.format = MSL_SHADER_VARIABLE_FORMAT_UINT16;
+ else if (strcmp(format, "u8") == 0)
+ output.format = MSL_SHADER_VARIABLE_FORMAT_UINT8;
+ else
+ output.format = MSL_SHADER_VARIABLE_FORMAT_OTHER;
+ output.vecsize = parser.next_uint();
+ args.msl_shader_outputs.push_back(output);
+ });
+ cbs.add("--msl-raw-buffer-tese-input", [&args](CLIParser &) { args.msl_raw_buffer_tese_input = true; });
cbs.add("--msl-multi-patch-workgroup", [&args](CLIParser &) { args.msl_multi_patch_workgroup = true; });
cbs.add("--msl-vertex-for-tessellation", [&args](CLIParser &) { args.msl_vertex_for_tessellation = true; });
cbs.add("--msl-additional-fixed-sample-mask",
@@ -1586,6 +1762,9 @@ static int main_inner(int argc, char *argv[])
cbs.add("--msl-fixed-subgroup-size",
[&args](CLIParser &parser) { args.msl_fixed_subgroup_size = parser.next_uint(); });
cbs.add("--msl-force-sample-rate-shading", [&args](CLIParser &) { args.msl_force_sample_rate_shading = true; });
+ 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-combined-sampler-suffix", [&args](CLIParser &parser) {
args.msl_combined_sampler_suffix = parser.next_string();
});
@@ -1594,7 +1773,7 @@ static int main_inner(int argc, char *argv[])
auto old_name = parser.next_string();
auto new_name = parser.next_string();
auto model = stage_to_execution_model(parser.next_string());
- args.entry_point_rename.push_back({ old_name, new_name, move(model) });
+ args.entry_point_rename.push_back({ old_name, new_name, std::move(model) });
});
cbs.add("--entry", [&args](CLIParser &parser) { args.entry = parser.next_string(); });
cbs.add("--stage", [&args](CLIParser &parser) { args.entry_stage = parser.next_string(); });
@@ -1603,20 +1782,26 @@ static int main_inner(int argc, char *argv[])
HLSLVertexAttributeRemap remap;
remap.location = parser.next_uint();
remap.semantic = parser.next_string();
- args.hlsl_attr_remap.push_back(move(remap));
+ args.hlsl_attr_remap.push_back(std::move(remap));
+ });
+ cbs.add("--set-hlsl-named-vertex-input-semantic", [&args](CLIParser &parser) {
+ HLSLVertexAttributeRemapNamed remap;
+ remap.name = parser.next_string();
+ remap.semantic = parser.next_string();
+ args.hlsl_attr_remap_named.push_back(std::move(remap));
});
cbs.add("--remap", [&args](CLIParser &parser) {
string src = parser.next_string();
string dst = parser.next_string();
uint32_t components = parser.next_uint();
- args.remaps.push_back({ move(src), move(dst), components });
+ args.remaps.push_back({ std::move(src), std::move(dst), components });
});
cbs.add("--remap-variable-type", [&args](CLIParser &parser) {
string var_name = parser.next_string();
string new_type = parser.next_string();
- args.variable_type_remaps.push_back({ move(var_name), move(new_type) });
+ args.variable_type_remaps.push_back({ std::move(var_name), std::move(new_type) });
});
cbs.add("--rename-interface-variable", [&args](CLIParser &parser) {
@@ -1629,18 +1814,18 @@ static int main_inner(int argc, char *argv[])
uint32_t loc = parser.next_uint();
string var_name = parser.next_string();
- args.interface_variable_renames.push_back({ cls, loc, move(var_name) });
+ args.interface_variable_renames.push_back({ cls, loc, std::move(var_name) });
});
cbs.add("--pls-in", [&args](CLIParser &parser) {
auto fmt = pls_format(parser.next_string());
auto name = parser.next_string();
- args.pls_in.push_back({ move(fmt), move(name) });
+ args.pls_in.push_back({ std::move(fmt), std::move(name) });
});
cbs.add("--pls-out", [&args](CLIParser &parser) {
auto fmt = pls_format(parser.next_string());
auto name = parser.next_string();
- args.pls_out.push_back({ move(fmt), move(name) });
+ args.pls_out.push_back({ std::move(fmt), std::move(name) });
});
cbs.add("--shader-model", [&args](CLIParser &parser) {
args.shader_model = parser.next_uint();
@@ -1683,11 +1868,17 @@ static int main_inner(int argc, char *argv[])
args.masked_stage_builtins.push_back(masked_builtin);
});
+ cbs.add("--force-recompile-max-debug-iterations", [&](CLIParser &parser) {
+ args.force_recompile_max_debug_iterations = parser.next_uint();
+ });
+
+ cbs.add("--relax-nan-checks", [&](CLIParser &) { args.relax_nan_checks = true; });
+
cbs.default_handler = [&args](const char *value) { args.input = value; };
cbs.add("-", [&args](CLIParser &) { args.input = "-"; });
cbs.error_handler = [] { print_help(); };
- CLIParser parser{ move(cbs), argc - 1, argv + 1 };
+ CLIParser parser{ std::move(cbs), argc - 1, argv + 1 };
if (!parser.parse())
return EXIT_FAILURE;
else if (parser.ended_state)
@@ -1707,10 +1898,10 @@ static int main_inner(int argc, char *argv[])
// Special case reflection because it has little to do with the path followed by code-outputting compilers
if (!args.reflect.empty())
{
- Parser spirv_parser(move(spirv_file));
+ Parser spirv_parser(std::move(spirv_file));
spirv_parser.parse();
- CompilerReflection compiler(move(spirv_parser.get_parsed_ir()));
+ CompilerReflection compiler(std::move(spirv_parser.get_parsed_ir()));
compiler.set_format(args.reflect);
auto json = compiler.compile();
if (args.output)
@@ -1723,7 +1914,7 @@ static int main_inner(int argc, char *argv[])
string compiled_output;
if (args.iterations == 1)
- compiled_output = compile_iteration(args, move(spirv_file));
+ compiled_output = compile_iteration(args, std::move(spirv_file));
else
{
for (unsigned i = 0; i < args.iterations; i++)
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv.h b/3rdparty/bgfx/3rdparty/spirv-cross/spirv.h
index 949f1980e76..5b6e8aaf475 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv.h
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv.h
@@ -31,7 +31,7 @@
/*
** 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
@@ -41,6 +41,8 @@
** - 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
@@ -53,12 +55,12 @@
typedef unsigned int SpvId;
-#define SPV_VERSION 0x10500
-#define SPV_REVISION 4
+#define SPV_VERSION 0x10600
+#define SPV_REVISION 1
static const unsigned int SpvMagicNumber = 0x07230203;
-static const unsigned int SpvVersion = 0x00010500;
-static const unsigned int SpvRevision = 4;
+static const unsigned int SpvVersion = 0x00010600;
+static const unsigned int SpvRevision = 1;
static const unsigned int SpvOpCodeMask = 0xffff;
static const unsigned int SpvWordCountShift = 16;
@@ -69,6 +71,8 @@ typedef enum SpvSourceLanguage_ {
SpvSourceLanguageOpenCL_C = 3,
SpvSourceLanguageOpenCL_CPP = 4,
SpvSourceLanguageHLSL = 5,
+ SpvSourceLanguageCPP_for_OpenCL = 6,
+ SpvSourceLanguageSYCL = 7,
SpvSourceLanguageMax = 0x7fffffff,
} SpvSourceLanguage;
@@ -94,6 +98,8 @@ typedef enum SpvExecutionModel_ {
SpvExecutionModelMissNV = 5317,
SpvExecutionModelCallableKHR = 5318,
SpvExecutionModelCallableNV = 5318,
+ SpvExecutionModelTaskEXT = 5364,
+ SpvExecutionModelMeshEXT = 5365,
SpvExecutionModelMax = 0x7fffffff,
} SpvExecutionModel;
@@ -154,17 +160,28 @@ typedef enum SpvExecutionMode_ {
SpvExecutionModeSubgroupsPerWorkgroupId = 37,
SpvExecutionModeLocalSizeId = 38,
SpvExecutionModeLocalSizeHintId = 39,
+ SpvExecutionModeSubgroupUniformControlFlowKHR = 4421,
SpvExecutionModePostDepthCoverage = 4446,
SpvExecutionModeDenormPreserve = 4459,
SpvExecutionModeDenormFlushToZero = 4460,
SpvExecutionModeSignedZeroInfNanPreserve = 4461,
SpvExecutionModeRoundingModeRTE = 4462,
SpvExecutionModeRoundingModeRTZ = 4463,
+ SpvExecutionModeEarlyAndLateFragmentTestsAMD = 5017,
SpvExecutionModeStencilRefReplacingEXT = 5027,
+ SpvExecutionModeStencilRefUnchangedFrontAMD = 5079,
+ SpvExecutionModeStencilRefGreaterFrontAMD = 5080,
+ SpvExecutionModeStencilRefLessFrontAMD = 5081,
+ SpvExecutionModeStencilRefUnchangedBackAMD = 5082,
+ SpvExecutionModeStencilRefGreaterBackAMD = 5083,
+ SpvExecutionModeStencilRefLessBackAMD = 5084,
+ SpvExecutionModeOutputLinesEXT = 5269,
SpvExecutionModeOutputLinesNV = 5269,
+ SpvExecutionModeOutputPrimitivesEXT = 5270,
SpvExecutionModeOutputPrimitivesNV = 5270,
SpvExecutionModeDerivativeGroupQuadsNV = 5289,
SpvExecutionModeDerivativeGroupLinearNV = 5290,
+ SpvExecutionModeOutputTrianglesEXT = 5298,
SpvExecutionModeOutputTrianglesNV = 5298,
SpvExecutionModePixelInterlockOrderedEXT = 5366,
SpvExecutionModePixelInterlockUnorderedEXT = 5367,
@@ -172,10 +189,17 @@ typedef enum SpvExecutionMode_ {
SpvExecutionModeSampleInterlockUnorderedEXT = 5369,
SpvExecutionModeShadingRateInterlockOrderedEXT = 5370,
SpvExecutionModeShadingRateInterlockUnorderedEXT = 5371,
+ SpvExecutionModeSharedLocalMemorySizeINTEL = 5618,
+ SpvExecutionModeRoundingModeRTPINTEL = 5620,
+ SpvExecutionModeRoundingModeRTNINTEL = 5621,
+ SpvExecutionModeFloatingPointModeALTINTEL = 5622,
+ SpvExecutionModeFloatingPointModeIEEEINTEL = 5623,
SpvExecutionModeMaxWorkgroupSizeINTEL = 5893,
SpvExecutionModeMaxWorkDimINTEL = 5894,
SpvExecutionModeNoGlobalOffsetINTEL = 5895,
SpvExecutionModeNumSIMDWorkitemsINTEL = 5896,
+ SpvExecutionModeSchedulerTargetFmaxMhzINTEL = 5903,
+ SpvExecutionModeNamedBarrierCountINTEL = 6417,
SpvExecutionModeMax = 0x7fffffff,
} SpvExecutionMode;
@@ -207,7 +231,10 @@ typedef enum SpvStorageClass_ {
SpvStorageClassShaderRecordBufferNV = 5343,
SpvStorageClassPhysicalStorageBuffer = 5349,
SpvStorageClassPhysicalStorageBufferEXT = 5349,
+ SpvStorageClassTaskPayloadWorkgroupEXT = 5402,
SpvStorageClassCodeSectionINTEL = 5605,
+ SpvStorageClassDeviceOnlyINTEL = 5936,
+ SpvStorageClassHostOnlyINTEL = 5937,
SpvStorageClassMax = 0x7fffffff,
} SpvStorageClass;
@@ -347,6 +374,8 @@ typedef enum SpvImageOperandsShift_ {
SpvImageOperandsVolatileTexelKHRShift = 11,
SpvImageOperandsSignExtendShift = 12,
SpvImageOperandsZeroExtendShift = 13,
+ SpvImageOperandsNontemporalShift = 14,
+ SpvImageOperandsOffsetsShift = 16,
SpvImageOperandsMax = 0x7fffffff,
} SpvImageOperandsShift;
@@ -370,6 +399,8 @@ typedef enum SpvImageOperandsMask_ {
SpvImageOperandsVolatileTexelKHRMask = 0x00000800,
SpvImageOperandsSignExtendMask = 0x00001000,
SpvImageOperandsZeroExtendMask = 0x00002000,
+ SpvImageOperandsNontemporalMask = 0x00004000,
+ SpvImageOperandsOffsetsMask = 0x00010000,
} SpvImageOperandsMask;
typedef enum SpvFPFastMathModeShift_ {
@@ -378,6 +409,8 @@ typedef enum SpvFPFastMathModeShift_ {
SpvFPFastMathModeNSZShift = 2,
SpvFPFastMathModeAllowRecipShift = 3,
SpvFPFastMathModeFastShift = 4,
+ SpvFPFastMathModeAllowContractFastINTELShift = 16,
+ SpvFPFastMathModeAllowReassocINTELShift = 17,
SpvFPFastMathModeMax = 0x7fffffff,
} SpvFPFastMathModeShift;
@@ -388,6 +421,8 @@ typedef enum SpvFPFastMathModeMask_ {
SpvFPFastMathModeNSZMask = 0x00000004,
SpvFPFastMathModeAllowRecipMask = 0x00000008,
SpvFPFastMathModeFastMask = 0x00000010,
+ SpvFPFastMathModeAllowContractFastINTELMask = 0x00010000,
+ SpvFPFastMathModeAllowReassocINTELMask = 0x00020000,
} SpvFPFastMathModeMask;
typedef enum SpvFPRoundingMode_ {
@@ -401,6 +436,7 @@ typedef enum SpvFPRoundingMode_ {
typedef enum SpvLinkageType_ {
SpvLinkageTypeExport = 0,
SpvLinkageTypeImport = 1,
+ SpvLinkageTypeLinkOnceODR = 2,
SpvLinkageTypeMax = 0x7fffffff,
} SpvLinkageType;
@@ -478,9 +514,11 @@ typedef enum SpvDecoration_ {
SpvDecorationPassthroughNV = 5250,
SpvDecorationViewportRelativeNV = 5252,
SpvDecorationSecondaryViewportRelativeNV = 5256,
+ SpvDecorationPerPrimitiveEXT = 5271,
SpvDecorationPerPrimitiveNV = 5271,
SpvDecorationPerViewNV = 5272,
SpvDecorationPerTaskNV = 5273,
+ SpvDecorationPerVertexKHR = 5285,
SpvDecorationPerVertexNV = 5285,
SpvDecorationNonUniform = 5300,
SpvDecorationNonUniformEXT = 5300,
@@ -488,12 +526,26 @@ typedef enum SpvDecoration_ {
SpvDecorationRestrictPointerEXT = 5355,
SpvDecorationAliasedPointer = 5356,
SpvDecorationAliasedPointerEXT = 5356,
+ SpvDecorationBindlessSamplerNV = 5398,
+ SpvDecorationBindlessImageNV = 5399,
+ SpvDecorationBoundSamplerNV = 5400,
+ SpvDecorationBoundImageNV = 5401,
+ SpvDecorationSIMTCallINTEL = 5599,
SpvDecorationReferencedIndirectlyINTEL = 5602,
+ SpvDecorationClobberINTEL = 5607,
+ SpvDecorationSideEffectsINTEL = 5608,
+ SpvDecorationVectorComputeVariableINTEL = 5624,
+ SpvDecorationFuncParamIOKindINTEL = 5625,
+ SpvDecorationVectorComputeFunctionINTEL = 5626,
+ SpvDecorationStackCallINTEL = 5627,
+ SpvDecorationGlobalVariableOffsetINTEL = 5628,
SpvDecorationCounterBuffer = 5634,
SpvDecorationHlslCounterBufferGOOGLE = 5634,
SpvDecorationHlslSemanticGOOGLE = 5635,
SpvDecorationUserSemantic = 5635,
SpvDecorationUserTypeGOOGLE = 5636,
+ SpvDecorationFunctionRoundingModeINTEL = 5822,
+ SpvDecorationFunctionDenormModeINTEL = 5823,
SpvDecorationRegisterINTEL = 5825,
SpvDecorationMemoryINTEL = 5826,
SpvDecorationNumbanksINTEL = 5827,
@@ -506,6 +558,20 @@ typedef enum SpvDecoration_ {
SpvDecorationMergeINTEL = 5834,
SpvDecorationBankBitsINTEL = 5835,
SpvDecorationForcePow2DepthINTEL = 5836,
+ SpvDecorationBurstCoalesceINTEL = 5899,
+ SpvDecorationCacheSizeINTEL = 5900,
+ SpvDecorationDontStaticallyCoalesceINTEL = 5901,
+ SpvDecorationPrefetchINTEL = 5902,
+ SpvDecorationStallEnableINTEL = 5905,
+ SpvDecorationFuseLoopsInFunctionINTEL = 5907,
+ SpvDecorationAliasScopeINTEL = 5914,
+ SpvDecorationNoAliasINTEL = 5915,
+ SpvDecorationBufferLocationINTEL = 5921,
+ SpvDecorationIOPipeStorageINTEL = 5944,
+ SpvDecorationFunctionFloatingPointModeINTEL = 6080,
+ SpvDecorationSingleElementVectorINTEL = 6085,
+ SpvDecorationVectorComputeCallableFunctionINTEL = 6087,
+ SpvDecorationMediaBlockIOINTEL = 6140,
SpvDecorationMax = 0x7fffffff,
} SpvDecoration;
@@ -590,12 +656,18 @@ typedef enum SpvBuiltIn_ {
SpvBuiltInLayerPerViewNV = 5279,
SpvBuiltInMeshViewCountNV = 5280,
SpvBuiltInMeshViewIndicesNV = 5281,
+ SpvBuiltInBaryCoordKHR = 5286,
SpvBuiltInBaryCoordNV = 5286,
+ SpvBuiltInBaryCoordNoPerspKHR = 5287,
SpvBuiltInBaryCoordNoPerspNV = 5287,
SpvBuiltInFragSizeEXT = 5292,
SpvBuiltInFragmentSizeNV = 5292,
SpvBuiltInFragInvocationCountEXT = 5293,
SpvBuiltInInvocationsPerPixelNV = 5293,
+ SpvBuiltInPrimitivePointIndicesEXT = 5294,
+ SpvBuiltInPrimitiveLineIndicesEXT = 5295,
+ SpvBuiltInPrimitiveTriangleIndicesEXT = 5296,
+ SpvBuiltInCullPrimitiveEXT = 5299,
SpvBuiltInLaunchIdKHR = 5319,
SpvBuiltInLaunchIdNV = 5319,
SpvBuiltInLaunchSizeKHR = 5320,
@@ -621,6 +693,7 @@ typedef enum SpvBuiltIn_ {
SpvBuiltInHitTNV = 5332,
SpvBuiltInHitKindKHR = 5333,
SpvBuiltInHitKindNV = 5333,
+ SpvBuiltInCurrentRayTimeNV = 5334,
SpvBuiltInIncomingRayFlagsKHR = 5351,
SpvBuiltInIncomingRayFlagsNV = 5351,
SpvBuiltInRayGeometryIndexKHR = 5352,
@@ -628,6 +701,7 @@ typedef enum SpvBuiltIn_ {
SpvBuiltInSMCountNV = 5375,
SpvBuiltInWarpIDNV = 5376,
SpvBuiltInSMIDNV = 5377,
+ SpvBuiltInCullMaskKHR = 6021,
SpvBuiltInMax = 0x7fffffff,
} SpvBuiltIn;
@@ -660,6 +734,7 @@ typedef enum SpvLoopControlShift_ {
SpvLoopControlLoopCoalesceINTELShift = 20,
SpvLoopControlMaxInterleavingINTELShift = 21,
SpvLoopControlSpeculatedIterationsINTELShift = 22,
+ SpvLoopControlNoFusionINTELShift = 23,
SpvLoopControlMax = 0x7fffffff,
} SpvLoopControlShift;
@@ -681,6 +756,7 @@ typedef enum SpvLoopControlMask_ {
SpvLoopControlLoopCoalesceINTELMask = 0x00100000,
SpvLoopControlMaxInterleavingINTELMask = 0x00200000,
SpvLoopControlSpeculatedIterationsINTELMask = 0x00400000,
+ SpvLoopControlNoFusionINTELMask = 0x00800000,
} SpvLoopControlMask;
typedef enum SpvFunctionControlShift_ {
@@ -688,6 +764,7 @@ typedef enum SpvFunctionControlShift_ {
SpvFunctionControlDontInlineShift = 1,
SpvFunctionControlPureShift = 2,
SpvFunctionControlConstShift = 3,
+ SpvFunctionControlOptNoneINTELShift = 16,
SpvFunctionControlMax = 0x7fffffff,
} SpvFunctionControlShift;
@@ -697,6 +774,7 @@ typedef enum SpvFunctionControlMask_ {
SpvFunctionControlDontInlineMask = 0x00000002,
SpvFunctionControlPureMask = 0x00000004,
SpvFunctionControlConstMask = 0x00000008,
+ SpvFunctionControlOptNoneINTELMask = 0x00010000,
} SpvFunctionControlMask;
typedef enum SpvMemorySemanticsShift_ {
@@ -751,6 +829,8 @@ typedef enum SpvMemoryAccessShift_ {
SpvMemoryAccessMakePointerVisibleKHRShift = 4,
SpvMemoryAccessNonPrivatePointerShift = 5,
SpvMemoryAccessNonPrivatePointerKHRShift = 5,
+ SpvMemoryAccessAliasScopeINTELMaskShift = 16,
+ SpvMemoryAccessNoAliasINTELMaskShift = 17,
SpvMemoryAccessMax = 0x7fffffff,
} SpvMemoryAccessShift;
@@ -765,6 +845,8 @@ typedef enum SpvMemoryAccessMask_ {
SpvMemoryAccessMakePointerVisibleKHRMask = 0x00000010,
SpvMemoryAccessNonPrivatePointerMask = 0x00000020,
SpvMemoryAccessNonPrivatePointerKHRMask = 0x00000020,
+ SpvMemoryAccessAliasScopeINTELMaskMask = 0x00010000,
+ SpvMemoryAccessNoAliasINTELMaskMask = 0x00020000,
} SpvMemoryAccessMask;
typedef enum SpvScope_ {
@@ -877,9 +959,13 @@ typedef enum SpvCapability_ {
SpvCapabilityGroupNonUniformQuad = 68,
SpvCapabilityShaderLayer = 69,
SpvCapabilityShaderViewportIndex = 70,
+ SpvCapabilityUniformDecoration = 71,
SpvCapabilityFragmentShadingRateKHR = 4422,
SpvCapabilitySubgroupBallotKHR = 4423,
SpvCapabilityDrawParameters = 4427,
+ SpvCapabilityWorkgroupMemoryExplicitLayoutKHR = 4428,
+ SpvCapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR = 4429,
+ SpvCapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR = 4430,
SpvCapabilitySubgroupVoteKHR = 4431,
SpvCapabilityStorageBuffer16BitAccess = 4433,
SpvCapabilityStorageUniformBufferBlock16 = 4433,
@@ -922,6 +1008,8 @@ typedef enum SpvCapability_ {
SpvCapabilityFragmentFullyCoveredEXT = 5265,
SpvCapabilityMeshShadingNV = 5266,
SpvCapabilityImageFootprintNV = 5282,
+ SpvCapabilityMeshShadingEXT = 5283,
+ SpvCapabilityFragmentBarycentricKHR = 5284,
SpvCapabilityFragmentBarycentricNV = 5284,
SpvCapabilityComputeDerivativeGroupQuadsNV = 5288,
SpvCapabilityFragmentDensityEXT = 5291,
@@ -952,6 +1040,7 @@ typedef enum SpvCapability_ {
SpvCapabilityStorageTexelBufferArrayNonUniformIndexing = 5312,
SpvCapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
SpvCapabilityRayTracingNV = 5340,
+ SpvCapabilityRayTracingMotionBlurNV = 5341,
SpvCapabilityVulkanMemoryModel = 5345,
SpvCapabilityVulkanMemoryModelKHR = 5345,
SpvCapabilityVulkanMemoryModelDeviceScope = 5346,
@@ -965,26 +1054,67 @@ typedef enum SpvCapability_ {
SpvCapabilityFragmentShaderShadingRateInterlockEXT = 5372,
SpvCapabilityShaderSMBuiltinsNV = 5373,
SpvCapabilityFragmentShaderPixelInterlockEXT = 5378,
+ SpvCapabilityDemoteToHelperInvocation = 5379,
SpvCapabilityDemoteToHelperInvocationEXT = 5379,
+ SpvCapabilityBindlessTextureNV = 5390,
SpvCapabilitySubgroupShuffleINTEL = 5568,
SpvCapabilitySubgroupBufferBlockIOINTEL = 5569,
SpvCapabilitySubgroupImageBlockIOINTEL = 5570,
SpvCapabilitySubgroupImageMediaBlockIOINTEL = 5579,
+ SpvCapabilityRoundToInfinityINTEL = 5582,
+ SpvCapabilityFloatingPointModeINTEL = 5583,
SpvCapabilityIntegerFunctions2INTEL = 5584,
SpvCapabilityFunctionPointersINTEL = 5603,
SpvCapabilityIndirectReferencesINTEL = 5604,
+ SpvCapabilityAsmINTEL = 5606,
+ SpvCapabilityAtomicFloat32MinMaxEXT = 5612,
+ SpvCapabilityAtomicFloat64MinMaxEXT = 5613,
+ SpvCapabilityAtomicFloat16MinMaxEXT = 5616,
+ SpvCapabilityVectorComputeINTEL = 5617,
+ SpvCapabilityVectorAnyINTEL = 5619,
+ SpvCapabilityExpectAssumeKHR = 5629,
SpvCapabilitySubgroupAvcMotionEstimationINTEL = 5696,
SpvCapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697,
SpvCapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698,
+ SpvCapabilityVariableLengthArrayINTEL = 5817,
+ SpvCapabilityFunctionFloatControlINTEL = 5821,
SpvCapabilityFPGAMemoryAttributesINTEL = 5824,
+ SpvCapabilityFPFastMathModeINTEL = 5837,
+ SpvCapabilityArbitraryPrecisionIntegersINTEL = 5844,
+ SpvCapabilityArbitraryPrecisionFloatingPointINTEL = 5845,
SpvCapabilityUnstructuredLoopControlsINTEL = 5886,
SpvCapabilityFPGALoopControlsINTEL = 5888,
SpvCapabilityKernelAttributesINTEL = 5892,
SpvCapabilityFPGAKernelAttributesINTEL = 5897,
+ SpvCapabilityFPGAMemoryAccessesINTEL = 5898,
+ SpvCapabilityFPGAClusterAttributesINTEL = 5904,
+ SpvCapabilityLoopFuseINTEL = 5906,
+ SpvCapabilityMemoryAccessAliasingINTEL = 5910,
+ SpvCapabilityFPGABufferLocationINTEL = 5920,
+ SpvCapabilityArbitraryPrecisionFixedPointINTEL = 5922,
+ SpvCapabilityUSMStorageClassesINTEL = 5935,
+ SpvCapabilityIOPipesINTEL = 5943,
SpvCapabilityBlockingPipesINTEL = 5945,
SpvCapabilityFPGARegINTEL = 5948,
+ SpvCapabilityDotProductInputAll = 6016,
+ SpvCapabilityDotProductInputAllKHR = 6016,
+ SpvCapabilityDotProductInput4x8Bit = 6017,
+ SpvCapabilityDotProductInput4x8BitKHR = 6017,
+ SpvCapabilityDotProductInput4x8BitPacked = 6018,
+ SpvCapabilityDotProductInput4x8BitPackedKHR = 6018,
+ SpvCapabilityDotProduct = 6019,
+ SpvCapabilityDotProductKHR = 6019,
+ SpvCapabilityRayCullMaskKHR = 6020,
+ SpvCapabilityBitInstructions = 6025,
+ SpvCapabilityGroupNonUniformRotateKHR = 6026,
SpvCapabilityAtomicFloat32AddEXT = 6033,
SpvCapabilityAtomicFloat64AddEXT = 6034,
+ SpvCapabilityLongConstantCompositeINTEL = 6089,
+ SpvCapabilityOptNoneINTEL = 6094,
+ SpvCapabilityAtomicFloat16AddEXT = 6095,
+ SpvCapabilityDebugInfoModuleINTEL = 6114,
+ SpvCapabilitySplitBarrierINTEL = 6141,
+ SpvCapabilityGroupUniformArithmeticKHR = 6400,
SpvCapabilityMax = 0x7fffffff,
} SpvCapability;
@@ -1051,6 +1181,44 @@ typedef enum SpvFragmentShadingRateMask_ {
SpvFragmentShadingRateHorizontal4PixelsMask = 0x00000008,
} SpvFragmentShadingRateMask;
+typedef enum SpvFPDenormMode_ {
+ SpvFPDenormModePreserve = 0,
+ SpvFPDenormModeFlushToZero = 1,
+ SpvFPDenormModeMax = 0x7fffffff,
+} SpvFPDenormMode;
+
+typedef enum SpvFPOperationMode_ {
+ SpvFPOperationModeIEEE = 0,
+ SpvFPOperationModeALT = 1,
+ SpvFPOperationModeMax = 0x7fffffff,
+} SpvFPOperationMode;
+
+typedef enum SpvQuantizationModes_ {
+ SpvQuantizationModesTRN = 0,
+ SpvQuantizationModesTRN_ZERO = 1,
+ SpvQuantizationModesRND = 2,
+ SpvQuantizationModesRND_ZERO = 3,
+ SpvQuantizationModesRND_INF = 4,
+ SpvQuantizationModesRND_MIN_INF = 5,
+ SpvQuantizationModesRND_CONV = 6,
+ SpvQuantizationModesRND_CONV_ODD = 7,
+ SpvQuantizationModesMax = 0x7fffffff,
+} SpvQuantizationModes;
+
+typedef enum SpvOverflowModes_ {
+ SpvOverflowModesWRAP = 0,
+ SpvOverflowModesSAT = 1,
+ SpvOverflowModesSAT_ZERO = 2,
+ SpvOverflowModesSAT_SYM = 3,
+ SpvOverflowModesMax = 0x7fffffff,
+} SpvOverflowModes;
+
+typedef enum SpvPackedVectorFormat_ {
+ SpvPackedVectorFormatPackedVectorFormat4x8Bit = 0,
+ SpvPackedVectorFormatPackedVectorFormat4x8BitKHR = 0,
+ SpvPackedVectorFormatMax = 0x7fffffff,
+} SpvPackedVectorFormat;
+
typedef enum SpvOp_ {
SpvOpNop = 0,
SpvOpUndef = 1,
@@ -1402,12 +1570,25 @@ typedef enum SpvOp_ {
SpvOpSubgroupAllKHR = 4428,
SpvOpSubgroupAnyKHR = 4429,
SpvOpSubgroupAllEqualKHR = 4430,
+ SpvOpGroupNonUniformRotateKHR = 4431,
SpvOpSubgroupReadInvocationKHR = 4432,
SpvOpTraceRayKHR = 4445,
SpvOpExecuteCallableKHR = 4446,
SpvOpConvertUToAccelerationStructureKHR = 4447,
SpvOpIgnoreIntersectionKHR = 4448,
SpvOpTerminateRayKHR = 4449,
+ SpvOpSDot = 4450,
+ SpvOpSDotKHR = 4450,
+ SpvOpUDot = 4451,
+ SpvOpUDotKHR = 4451,
+ SpvOpSUDot = 4452,
+ SpvOpSUDotKHR = 4452,
+ SpvOpSDotAccSat = 4453,
+ SpvOpSDotAccSatKHR = 4453,
+ SpvOpUDotAccSat = 4454,
+ SpvOpUDotAccSatKHR = 4454,
+ SpvOpSUDotAccSat = 4455,
+ SpvOpSUDotAccSatKHR = 4455,
SpvOpTypeRayQueryKHR = 4472,
SpvOpRayQueryInitializeKHR = 4473,
SpvOpRayQueryTerminateKHR = 4474,
@@ -1427,6 +1608,8 @@ typedef enum SpvOp_ {
SpvOpFragmentFetchAMD = 5012,
SpvOpReadClockKHR = 5056,
SpvOpImageSampleFootprintNV = 5283,
+ SpvOpEmitMeshTasksEXT = 5294,
+ SpvOpSetMeshOutputsEXT = 5295,
SpvOpGroupNonUniformPartitionNV = 5296,
SpvOpWritePackedPrimitiveIndices4x8NV = 5299,
SpvOpReportIntersectionKHR = 5334,
@@ -1434,6 +1617,8 @@ typedef enum SpvOp_ {
SpvOpIgnoreIntersectionNV = 5335,
SpvOpTerminateRayNV = 5336,
SpvOpTraceNV = 5337,
+ SpvOpTraceMotionNV = 5338,
+ SpvOpTraceRayMotionNV = 5339,
SpvOpTypeAccelerationStructureKHR = 5341,
SpvOpTypeAccelerationStructureNV = 5341,
SpvOpExecuteCallableNV = 5344,
@@ -1444,8 +1629,16 @@ typedef enum SpvOp_ {
SpvOpCooperativeMatrixLengthNV = 5362,
SpvOpBeginInvocationInterlockEXT = 5364,
SpvOpEndInvocationInterlockEXT = 5365,
+ SpvOpDemoteToHelperInvocation = 5380,
SpvOpDemoteToHelperInvocationEXT = 5380,
SpvOpIsHelperInvocationEXT = 5381,
+ SpvOpConvertUToImageNV = 5391,
+ SpvOpConvertUToSamplerNV = 5392,
+ SpvOpConvertImageToUNV = 5393,
+ SpvOpConvertSamplerToUNV = 5394,
+ SpvOpConvertUToSampledImageNV = 5395,
+ SpvOpConvertSampledImageToUNV = 5396,
+ SpvOpSamplerImageAddressingModeNV = 5397,
SpvOpSubgroupShuffleINTEL = 5571,
SpvOpSubgroupShuffleDownINTEL = 5572,
SpvOpSubgroupShuffleUpINTEL = 5573,
@@ -1470,8 +1663,15 @@ typedef enum SpvOp_ {
SpvOpUSubSatINTEL = 5596,
SpvOpIMul32x16INTEL = 5597,
SpvOpUMul32x16INTEL = 5598,
- SpvOpFunctionPointerINTEL = 5600,
+ SpvOpConstantFunctionPointerINTEL = 5600,
SpvOpFunctionPointerCallINTEL = 5601,
+ SpvOpAsmTargetINTEL = 5609,
+ SpvOpAsmINTEL = 5610,
+ SpvOpAsmCallINTEL = 5611,
+ SpvOpAtomicFMinEXT = 5614,
+ SpvOpAtomicFMaxEXT = 5615,
+ SpvOpAssumeTrueKHR = 5630,
+ SpvOpExpectKHR = 5631,
SpvOpDecorateString = 5632,
SpvOpDecorateStringGOOGLE = 5632,
SpvOpMemberDecorateString = 5633,
@@ -1594,7 +1794,67 @@ typedef enum SpvOp_ {
SpvOpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL = 5814,
SpvOpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL = 5815,
SpvOpSubgroupAvcSicGetInterRawSadsINTEL = 5816,
+ SpvOpVariableLengthArrayINTEL = 5818,
+ SpvOpSaveMemoryINTEL = 5819,
+ SpvOpRestoreMemoryINTEL = 5820,
+ SpvOpArbitraryFloatSinCosPiINTEL = 5840,
+ SpvOpArbitraryFloatCastINTEL = 5841,
+ SpvOpArbitraryFloatCastFromIntINTEL = 5842,
+ SpvOpArbitraryFloatCastToIntINTEL = 5843,
+ SpvOpArbitraryFloatAddINTEL = 5846,
+ SpvOpArbitraryFloatSubINTEL = 5847,
+ SpvOpArbitraryFloatMulINTEL = 5848,
+ SpvOpArbitraryFloatDivINTEL = 5849,
+ SpvOpArbitraryFloatGTINTEL = 5850,
+ SpvOpArbitraryFloatGEINTEL = 5851,
+ SpvOpArbitraryFloatLTINTEL = 5852,
+ SpvOpArbitraryFloatLEINTEL = 5853,
+ SpvOpArbitraryFloatEQINTEL = 5854,
+ SpvOpArbitraryFloatRecipINTEL = 5855,
+ SpvOpArbitraryFloatRSqrtINTEL = 5856,
+ SpvOpArbitraryFloatCbrtINTEL = 5857,
+ SpvOpArbitraryFloatHypotINTEL = 5858,
+ SpvOpArbitraryFloatSqrtINTEL = 5859,
+ SpvOpArbitraryFloatLogINTEL = 5860,
+ SpvOpArbitraryFloatLog2INTEL = 5861,
+ SpvOpArbitraryFloatLog10INTEL = 5862,
+ SpvOpArbitraryFloatLog1pINTEL = 5863,
+ SpvOpArbitraryFloatExpINTEL = 5864,
+ SpvOpArbitraryFloatExp2INTEL = 5865,
+ SpvOpArbitraryFloatExp10INTEL = 5866,
+ SpvOpArbitraryFloatExpm1INTEL = 5867,
+ SpvOpArbitraryFloatSinINTEL = 5868,
+ SpvOpArbitraryFloatCosINTEL = 5869,
+ SpvOpArbitraryFloatSinCosINTEL = 5870,
+ SpvOpArbitraryFloatSinPiINTEL = 5871,
+ SpvOpArbitraryFloatCosPiINTEL = 5872,
+ SpvOpArbitraryFloatASinINTEL = 5873,
+ SpvOpArbitraryFloatASinPiINTEL = 5874,
+ SpvOpArbitraryFloatACosINTEL = 5875,
+ SpvOpArbitraryFloatACosPiINTEL = 5876,
+ SpvOpArbitraryFloatATanINTEL = 5877,
+ SpvOpArbitraryFloatATanPiINTEL = 5878,
+ SpvOpArbitraryFloatATan2INTEL = 5879,
+ SpvOpArbitraryFloatPowINTEL = 5880,
+ SpvOpArbitraryFloatPowRINTEL = 5881,
+ SpvOpArbitraryFloatPowNINTEL = 5882,
SpvOpLoopControlINTEL = 5887,
+ SpvOpAliasDomainDeclINTEL = 5911,
+ SpvOpAliasScopeDeclINTEL = 5912,
+ SpvOpAliasScopeListDeclINTEL = 5913,
+ SpvOpFixedSqrtINTEL = 5923,
+ SpvOpFixedRecipINTEL = 5924,
+ SpvOpFixedRsqrtINTEL = 5925,
+ SpvOpFixedSinINTEL = 5926,
+ SpvOpFixedCosINTEL = 5927,
+ SpvOpFixedSinCosINTEL = 5928,
+ SpvOpFixedSinPiINTEL = 5929,
+ SpvOpFixedCosPiINTEL = 5930,
+ SpvOpFixedSinCosPiINTEL = 5931,
+ SpvOpFixedLogINTEL = 5932,
+ SpvOpFixedExpINTEL = 5933,
+ SpvOpPtrCastToCrossWorkgroupINTEL = 5934,
+ SpvOpCrossWorkgroupCastToPtrINTEL = 5938,
SpvOpReadPipeBlockingINTEL = 5946,
SpvOpWritePipeBlockingINTEL = 5947,
SpvOpFPGARegINTEL = 5949,
@@ -1616,10 +1876,27 @@ typedef enum SpvOp_ {
SpvOpRayQueryGetIntersectionObjectToWorldKHR = 6031,
SpvOpRayQueryGetIntersectionWorldToObjectKHR = 6032,
SpvOpAtomicFAddEXT = 6035,
+ SpvOpTypeBufferSurfaceINTEL = 6086,
+ SpvOpTypeStructContinuedINTEL = 6090,
+ SpvOpConstantCompositeContinuedINTEL = 6091,
+ SpvOpSpecConstantCompositeContinuedINTEL = 6092,
+ SpvOpControlBarrierArriveINTEL = 6142,
+ SpvOpControlBarrierWaitINTEL = 6143,
+ SpvOpGroupIMulKHR = 6401,
+ SpvOpGroupFMulKHR = 6402,
+ SpvOpGroupBitwiseAndKHR = 6403,
+ SpvOpGroupBitwiseOrKHR = 6404,
+ SpvOpGroupBitwiseXorKHR = 6405,
+ SpvOpGroupLogicalAndKHR = 6406,
+ SpvOpGroupLogicalOrKHR = 6407,
+ SpvOpGroupLogicalXorKHR = 6408,
SpvOpMax = 0x7fffffff,
} SpvOp;
#ifdef SPV_ENABLE_UTILITY_CODE
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultType) {
*hasResult = *hasResultType = false;
switch (opcode) {
@@ -1974,12 +2251,19 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpTerminateRayKHR: *hasResult = false; *hasResultType = false; break;
+ case SpvOpSDot: *hasResult = true; *hasResultType = true; break;
+ case SpvOpUDot: *hasResult = true; *hasResultType = true; break;
+ case SpvOpSUDot: *hasResult = true; *hasResultType = true; break;
+ case SpvOpSDotAccSat: *hasResult = true; *hasResultType = true; break;
+ case SpvOpUDotAccSat: *hasResult = true; *hasResultType = true; break;
+ case SpvOpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
case SpvOpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
case SpvOpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@@ -1999,12 +2283,16 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
case SpvOpReadClockKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break;
+ case SpvOpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break;
case SpvOpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break;
case SpvOpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break;
case SpvOpReportIntersectionNV: *hasResult = true; *hasResultType = true; break;
case SpvOpIgnoreIntersectionNV: *hasResult = false; *hasResultType = false; break;
case SpvOpTerminateRayNV: *hasResult = false; *hasResultType = false; break;
case SpvOpTraceNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpTraceMotionNV: *hasResult = false; *hasResultType = false; break;
+ case SpvOpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
case SpvOpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break;
case SpvOpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
case SpvOpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
@@ -2014,8 +2302,15 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
case SpvOpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case SpvOpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
- case SpvOpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
+ case SpvOpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
case SpvOpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertImageToUNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break;
case SpvOpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2040,8 +2335,15 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpUSubSatINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
- case SpvOpFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpAsmINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpAsmCallINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break;
+ case SpvOpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break;
+ case SpvOpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break;
+ case SpvOpExpectKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpDecorateString: *hasResult = false; *hasResultType = false; break;
case SpvOpMemberDecorateString: *hasResult = false; *hasResultType = false; break;
case SpvOpVmeImageINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2162,7 +2464,67 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break;
+ case SpvOpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break;
+ case SpvOpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break;
+ case SpvOpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpFixedSinINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpFixedCosINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpFixedLogINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpFixedExpINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpWritePipeBlockingINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpFPGARegINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2184,6 +2546,20 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpAtomicFAddEXT: *hasResult = true; *hasResultType = true; break;
+ case SpvOpTypeBufferSurfaceINTEL: *hasResult = true; *hasResultType = false; break;
+ case SpvOpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
}
}
#endif /* SPV_ENABLE_UTILITY_CODE */
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv.hpp
index 43dd2aaeec6..e25264af28f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv.hpp
@@ -26,7 +26,7 @@
// 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
@@ -36,6 +36,8 @@
// - 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
@@ -49,12 +51,12 @@ namespace spv {
typedef unsigned int Id;
-#define SPV_VERSION 0x10500
-#define SPV_REVISION 4
+#define SPV_VERSION 0x10600
+#define SPV_REVISION 1
static const unsigned int MagicNumber = 0x07230203;
-static const unsigned int Version = 0x00010500;
-static const unsigned int Revision = 4;
+static const unsigned int Version = 0x00010600;
+static const unsigned int Revision = 1;
static const unsigned int OpCodeMask = 0xffff;
static const unsigned int WordCountShift = 16;
@@ -65,6 +67,8 @@ enum SourceLanguage {
SourceLanguageOpenCL_C = 3,
SourceLanguageOpenCL_CPP = 4,
SourceLanguageHLSL = 5,
+ SourceLanguageCPP_for_OpenCL = 6,
+ SourceLanguageSYCL = 7,
SourceLanguageMax = 0x7fffffff,
};
@@ -90,6 +94,8 @@ enum ExecutionModel {
ExecutionModelMissNV = 5317,
ExecutionModelCallableKHR = 5318,
ExecutionModelCallableNV = 5318,
+ ExecutionModelTaskEXT = 5364,
+ ExecutionModelMeshEXT = 5365,
ExecutionModelMax = 0x7fffffff,
};
@@ -150,17 +156,28 @@ enum ExecutionMode {
ExecutionModeSubgroupsPerWorkgroupId = 37,
ExecutionModeLocalSizeId = 38,
ExecutionModeLocalSizeHintId = 39,
+ ExecutionModeSubgroupUniformControlFlowKHR = 4421,
ExecutionModePostDepthCoverage = 4446,
ExecutionModeDenormPreserve = 4459,
ExecutionModeDenormFlushToZero = 4460,
ExecutionModeSignedZeroInfNanPreserve = 4461,
ExecutionModeRoundingModeRTE = 4462,
ExecutionModeRoundingModeRTZ = 4463,
+ ExecutionModeEarlyAndLateFragmentTestsAMD = 5017,
ExecutionModeStencilRefReplacingEXT = 5027,
+ ExecutionModeStencilRefUnchangedFrontAMD = 5079,
+ ExecutionModeStencilRefGreaterFrontAMD = 5080,
+ ExecutionModeStencilRefLessFrontAMD = 5081,
+ ExecutionModeStencilRefUnchangedBackAMD = 5082,
+ ExecutionModeStencilRefGreaterBackAMD = 5083,
+ ExecutionModeStencilRefLessBackAMD = 5084,
+ ExecutionModeOutputLinesEXT = 5269,
ExecutionModeOutputLinesNV = 5269,
+ ExecutionModeOutputPrimitivesEXT = 5270,
ExecutionModeOutputPrimitivesNV = 5270,
ExecutionModeDerivativeGroupQuadsNV = 5289,
ExecutionModeDerivativeGroupLinearNV = 5290,
+ ExecutionModeOutputTrianglesEXT = 5298,
ExecutionModeOutputTrianglesNV = 5298,
ExecutionModePixelInterlockOrderedEXT = 5366,
ExecutionModePixelInterlockUnorderedEXT = 5367,
@@ -168,10 +185,17 @@ enum ExecutionMode {
ExecutionModeSampleInterlockUnorderedEXT = 5369,
ExecutionModeShadingRateInterlockOrderedEXT = 5370,
ExecutionModeShadingRateInterlockUnorderedEXT = 5371,
+ ExecutionModeSharedLocalMemorySizeINTEL = 5618,
+ ExecutionModeRoundingModeRTPINTEL = 5620,
+ ExecutionModeRoundingModeRTNINTEL = 5621,
+ ExecutionModeFloatingPointModeALTINTEL = 5622,
+ ExecutionModeFloatingPointModeIEEEINTEL = 5623,
ExecutionModeMaxWorkgroupSizeINTEL = 5893,
ExecutionModeMaxWorkDimINTEL = 5894,
ExecutionModeNoGlobalOffsetINTEL = 5895,
ExecutionModeNumSIMDWorkitemsINTEL = 5896,
+ ExecutionModeSchedulerTargetFmaxMhzINTEL = 5903,
+ ExecutionModeNamedBarrierCountINTEL = 6417,
ExecutionModeMax = 0x7fffffff,
};
@@ -203,7 +227,10 @@ enum StorageClass {
StorageClassShaderRecordBufferNV = 5343,
StorageClassPhysicalStorageBuffer = 5349,
StorageClassPhysicalStorageBufferEXT = 5349,
+ StorageClassTaskPayloadWorkgroupEXT = 5402,
StorageClassCodeSectionINTEL = 5605,
+ StorageClassDeviceOnlyINTEL = 5936,
+ StorageClassHostOnlyINTEL = 5937,
StorageClassMax = 0x7fffffff,
};
@@ -343,6 +370,8 @@ enum ImageOperandsShift {
ImageOperandsVolatileTexelKHRShift = 11,
ImageOperandsSignExtendShift = 12,
ImageOperandsZeroExtendShift = 13,
+ ImageOperandsNontemporalShift = 14,
+ ImageOperandsOffsetsShift = 16,
ImageOperandsMax = 0x7fffffff,
};
@@ -366,6 +395,8 @@ enum ImageOperandsMask {
ImageOperandsVolatileTexelKHRMask = 0x00000800,
ImageOperandsSignExtendMask = 0x00001000,
ImageOperandsZeroExtendMask = 0x00002000,
+ ImageOperandsNontemporalMask = 0x00004000,
+ ImageOperandsOffsetsMask = 0x00010000,
};
enum FPFastMathModeShift {
@@ -374,6 +405,8 @@ enum FPFastMathModeShift {
FPFastMathModeNSZShift = 2,
FPFastMathModeAllowRecipShift = 3,
FPFastMathModeFastShift = 4,
+ FPFastMathModeAllowContractFastINTELShift = 16,
+ FPFastMathModeAllowReassocINTELShift = 17,
FPFastMathModeMax = 0x7fffffff,
};
@@ -384,6 +417,8 @@ enum FPFastMathModeMask {
FPFastMathModeNSZMask = 0x00000004,
FPFastMathModeAllowRecipMask = 0x00000008,
FPFastMathModeFastMask = 0x00000010,
+ FPFastMathModeAllowContractFastINTELMask = 0x00010000,
+ FPFastMathModeAllowReassocINTELMask = 0x00020000,
};
enum FPRoundingMode {
@@ -397,6 +432,7 @@ enum FPRoundingMode {
enum LinkageType {
LinkageTypeExport = 0,
LinkageTypeImport = 1,
+ LinkageTypeLinkOnceODR = 2,
LinkageTypeMax = 0x7fffffff,
};
@@ -474,9 +510,11 @@ enum Decoration {
DecorationPassthroughNV = 5250,
DecorationViewportRelativeNV = 5252,
DecorationSecondaryViewportRelativeNV = 5256,
+ DecorationPerPrimitiveEXT = 5271,
DecorationPerPrimitiveNV = 5271,
DecorationPerViewNV = 5272,
DecorationPerTaskNV = 5273,
+ DecorationPerVertexKHR = 5285,
DecorationPerVertexNV = 5285,
DecorationNonUniform = 5300,
DecorationNonUniformEXT = 5300,
@@ -484,12 +522,26 @@ enum Decoration {
DecorationRestrictPointerEXT = 5355,
DecorationAliasedPointer = 5356,
DecorationAliasedPointerEXT = 5356,
+ DecorationBindlessSamplerNV = 5398,
+ DecorationBindlessImageNV = 5399,
+ DecorationBoundSamplerNV = 5400,
+ DecorationBoundImageNV = 5401,
+ DecorationSIMTCallINTEL = 5599,
DecorationReferencedIndirectlyINTEL = 5602,
+ DecorationClobberINTEL = 5607,
+ DecorationSideEffectsINTEL = 5608,
+ DecorationVectorComputeVariableINTEL = 5624,
+ DecorationFuncParamIOKindINTEL = 5625,
+ DecorationVectorComputeFunctionINTEL = 5626,
+ DecorationStackCallINTEL = 5627,
+ DecorationGlobalVariableOffsetINTEL = 5628,
DecorationCounterBuffer = 5634,
DecorationHlslCounterBufferGOOGLE = 5634,
DecorationHlslSemanticGOOGLE = 5635,
DecorationUserSemantic = 5635,
DecorationUserTypeGOOGLE = 5636,
+ DecorationFunctionRoundingModeINTEL = 5822,
+ DecorationFunctionDenormModeINTEL = 5823,
DecorationRegisterINTEL = 5825,
DecorationMemoryINTEL = 5826,
DecorationNumbanksINTEL = 5827,
@@ -502,6 +554,20 @@ enum Decoration {
DecorationMergeINTEL = 5834,
DecorationBankBitsINTEL = 5835,
DecorationForcePow2DepthINTEL = 5836,
+ DecorationBurstCoalesceINTEL = 5899,
+ DecorationCacheSizeINTEL = 5900,
+ DecorationDontStaticallyCoalesceINTEL = 5901,
+ DecorationPrefetchINTEL = 5902,
+ DecorationStallEnableINTEL = 5905,
+ DecorationFuseLoopsInFunctionINTEL = 5907,
+ DecorationAliasScopeINTEL = 5914,
+ DecorationNoAliasINTEL = 5915,
+ DecorationBufferLocationINTEL = 5921,
+ DecorationIOPipeStorageINTEL = 5944,
+ DecorationFunctionFloatingPointModeINTEL = 6080,
+ DecorationSingleElementVectorINTEL = 6085,
+ DecorationVectorComputeCallableFunctionINTEL = 6087,
+ DecorationMediaBlockIOINTEL = 6140,
DecorationMax = 0x7fffffff,
};
@@ -586,12 +652,18 @@ enum BuiltIn {
BuiltInLayerPerViewNV = 5279,
BuiltInMeshViewCountNV = 5280,
BuiltInMeshViewIndicesNV = 5281,
+ BuiltInBaryCoordKHR = 5286,
BuiltInBaryCoordNV = 5286,
+ BuiltInBaryCoordNoPerspKHR = 5287,
BuiltInBaryCoordNoPerspNV = 5287,
BuiltInFragSizeEXT = 5292,
BuiltInFragmentSizeNV = 5292,
BuiltInFragInvocationCountEXT = 5293,
BuiltInInvocationsPerPixelNV = 5293,
+ BuiltInPrimitivePointIndicesEXT = 5294,
+ BuiltInPrimitiveLineIndicesEXT = 5295,
+ BuiltInPrimitiveTriangleIndicesEXT = 5296,
+ BuiltInCullPrimitiveEXT = 5299,
BuiltInLaunchIdKHR = 5319,
BuiltInLaunchIdNV = 5319,
BuiltInLaunchSizeKHR = 5320,
@@ -617,6 +689,7 @@ enum BuiltIn {
BuiltInHitTNV = 5332,
BuiltInHitKindKHR = 5333,
BuiltInHitKindNV = 5333,
+ BuiltInCurrentRayTimeNV = 5334,
BuiltInIncomingRayFlagsKHR = 5351,
BuiltInIncomingRayFlagsNV = 5351,
BuiltInRayGeometryIndexKHR = 5352,
@@ -624,6 +697,7 @@ enum BuiltIn {
BuiltInSMCountNV = 5375,
BuiltInWarpIDNV = 5376,
BuiltInSMIDNV = 5377,
+ BuiltInCullMaskKHR = 6021,
BuiltInMax = 0x7fffffff,
};
@@ -656,6 +730,7 @@ enum LoopControlShift {
LoopControlLoopCoalesceINTELShift = 20,
LoopControlMaxInterleavingINTELShift = 21,
LoopControlSpeculatedIterationsINTELShift = 22,
+ LoopControlNoFusionINTELShift = 23,
LoopControlMax = 0x7fffffff,
};
@@ -677,6 +752,7 @@ enum LoopControlMask {
LoopControlLoopCoalesceINTELMask = 0x00100000,
LoopControlMaxInterleavingINTELMask = 0x00200000,
LoopControlSpeculatedIterationsINTELMask = 0x00400000,
+ LoopControlNoFusionINTELMask = 0x00800000,
};
enum FunctionControlShift {
@@ -684,6 +760,7 @@ enum FunctionControlShift {
FunctionControlDontInlineShift = 1,
FunctionControlPureShift = 2,
FunctionControlConstShift = 3,
+ FunctionControlOptNoneINTELShift = 16,
FunctionControlMax = 0x7fffffff,
};
@@ -693,6 +770,7 @@ enum FunctionControlMask {
FunctionControlDontInlineMask = 0x00000002,
FunctionControlPureMask = 0x00000004,
FunctionControlConstMask = 0x00000008,
+ FunctionControlOptNoneINTELMask = 0x00010000,
};
enum MemorySemanticsShift {
@@ -747,6 +825,8 @@ enum MemoryAccessShift {
MemoryAccessMakePointerVisibleKHRShift = 4,
MemoryAccessNonPrivatePointerShift = 5,
MemoryAccessNonPrivatePointerKHRShift = 5,
+ MemoryAccessAliasScopeINTELMaskShift = 16,
+ MemoryAccessNoAliasINTELMaskShift = 17,
MemoryAccessMax = 0x7fffffff,
};
@@ -761,6 +841,8 @@ enum MemoryAccessMask {
MemoryAccessMakePointerVisibleKHRMask = 0x00000010,
MemoryAccessNonPrivatePointerMask = 0x00000020,
MemoryAccessNonPrivatePointerKHRMask = 0x00000020,
+ MemoryAccessAliasScopeINTELMaskMask = 0x00010000,
+ MemoryAccessNoAliasINTELMaskMask = 0x00020000,
};
enum Scope {
@@ -873,9 +955,13 @@ enum Capability {
CapabilityGroupNonUniformQuad = 68,
CapabilityShaderLayer = 69,
CapabilityShaderViewportIndex = 70,
+ CapabilityUniformDecoration = 71,
CapabilityFragmentShadingRateKHR = 4422,
CapabilitySubgroupBallotKHR = 4423,
CapabilityDrawParameters = 4427,
+ CapabilityWorkgroupMemoryExplicitLayoutKHR = 4428,
+ CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR = 4429,
+ CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR = 4430,
CapabilitySubgroupVoteKHR = 4431,
CapabilityStorageBuffer16BitAccess = 4433,
CapabilityStorageUniformBufferBlock16 = 4433,
@@ -918,6 +1004,8 @@ enum Capability {
CapabilityFragmentFullyCoveredEXT = 5265,
CapabilityMeshShadingNV = 5266,
CapabilityImageFootprintNV = 5282,
+ CapabilityMeshShadingEXT = 5283,
+ CapabilityFragmentBarycentricKHR = 5284,
CapabilityFragmentBarycentricNV = 5284,
CapabilityComputeDerivativeGroupQuadsNV = 5288,
CapabilityFragmentDensityEXT = 5291,
@@ -948,6 +1036,7 @@ enum Capability {
CapabilityStorageTexelBufferArrayNonUniformIndexing = 5312,
CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
CapabilityRayTracingNV = 5340,
+ CapabilityRayTracingMotionBlurNV = 5341,
CapabilityVulkanMemoryModel = 5345,
CapabilityVulkanMemoryModelKHR = 5345,
CapabilityVulkanMemoryModelDeviceScope = 5346,
@@ -961,26 +1050,67 @@ enum Capability {
CapabilityFragmentShaderShadingRateInterlockEXT = 5372,
CapabilityShaderSMBuiltinsNV = 5373,
CapabilityFragmentShaderPixelInterlockEXT = 5378,
+ CapabilityDemoteToHelperInvocation = 5379,
CapabilityDemoteToHelperInvocationEXT = 5379,
+ CapabilityBindlessTextureNV = 5390,
CapabilitySubgroupShuffleINTEL = 5568,
CapabilitySubgroupBufferBlockIOINTEL = 5569,
CapabilitySubgroupImageBlockIOINTEL = 5570,
CapabilitySubgroupImageMediaBlockIOINTEL = 5579,
+ CapabilityRoundToInfinityINTEL = 5582,
+ CapabilityFloatingPointModeINTEL = 5583,
CapabilityIntegerFunctions2INTEL = 5584,
CapabilityFunctionPointersINTEL = 5603,
CapabilityIndirectReferencesINTEL = 5604,
+ CapabilityAsmINTEL = 5606,
+ CapabilityAtomicFloat32MinMaxEXT = 5612,
+ CapabilityAtomicFloat64MinMaxEXT = 5613,
+ CapabilityAtomicFloat16MinMaxEXT = 5616,
+ CapabilityVectorComputeINTEL = 5617,
+ CapabilityVectorAnyINTEL = 5619,
+ CapabilityExpectAssumeKHR = 5629,
CapabilitySubgroupAvcMotionEstimationINTEL = 5696,
CapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697,
CapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698,
+ CapabilityVariableLengthArrayINTEL = 5817,
+ CapabilityFunctionFloatControlINTEL = 5821,
CapabilityFPGAMemoryAttributesINTEL = 5824,
+ CapabilityFPFastMathModeINTEL = 5837,
+ CapabilityArbitraryPrecisionIntegersINTEL = 5844,
+ CapabilityArbitraryPrecisionFloatingPointINTEL = 5845,
CapabilityUnstructuredLoopControlsINTEL = 5886,
CapabilityFPGALoopControlsINTEL = 5888,
CapabilityKernelAttributesINTEL = 5892,
CapabilityFPGAKernelAttributesINTEL = 5897,
+ CapabilityFPGAMemoryAccessesINTEL = 5898,
+ CapabilityFPGAClusterAttributesINTEL = 5904,
+ CapabilityLoopFuseINTEL = 5906,
+ CapabilityMemoryAccessAliasingINTEL = 5910,
+ CapabilityFPGABufferLocationINTEL = 5920,
+ CapabilityArbitraryPrecisionFixedPointINTEL = 5922,
+ CapabilityUSMStorageClassesINTEL = 5935,
+ CapabilityIOPipesINTEL = 5943,
CapabilityBlockingPipesINTEL = 5945,
CapabilityFPGARegINTEL = 5948,
+ CapabilityDotProductInputAll = 6016,
+ CapabilityDotProductInputAllKHR = 6016,
+ CapabilityDotProductInput4x8Bit = 6017,
+ CapabilityDotProductInput4x8BitKHR = 6017,
+ CapabilityDotProductInput4x8BitPacked = 6018,
+ CapabilityDotProductInput4x8BitPackedKHR = 6018,
+ CapabilityDotProduct = 6019,
+ CapabilityDotProductKHR = 6019,
+ CapabilityRayCullMaskKHR = 6020,
+ CapabilityBitInstructions = 6025,
+ CapabilityGroupNonUniformRotateKHR = 6026,
CapabilityAtomicFloat32AddEXT = 6033,
CapabilityAtomicFloat64AddEXT = 6034,
+ CapabilityLongConstantCompositeINTEL = 6089,
+ CapabilityOptNoneINTEL = 6094,
+ CapabilityAtomicFloat16AddEXT = 6095,
+ CapabilityDebugInfoModuleINTEL = 6114,
+ CapabilitySplitBarrierINTEL = 6141,
+ CapabilityGroupUniformArithmeticKHR = 6400,
CapabilityMax = 0x7fffffff,
};
@@ -1047,6 +1177,44 @@ enum FragmentShadingRateMask {
FragmentShadingRateHorizontal4PixelsMask = 0x00000008,
};
+enum FPDenormMode {
+ FPDenormModePreserve = 0,
+ FPDenormModeFlushToZero = 1,
+ FPDenormModeMax = 0x7fffffff,
+};
+
+enum FPOperationMode {
+ FPOperationModeIEEE = 0,
+ FPOperationModeALT = 1,
+ FPOperationModeMax = 0x7fffffff,
+};
+
+enum QuantizationModes {
+ QuantizationModesTRN = 0,
+ QuantizationModesTRN_ZERO = 1,
+ QuantizationModesRND = 2,
+ QuantizationModesRND_ZERO = 3,
+ QuantizationModesRND_INF = 4,
+ QuantizationModesRND_MIN_INF = 5,
+ QuantizationModesRND_CONV = 6,
+ QuantizationModesRND_CONV_ODD = 7,
+ QuantizationModesMax = 0x7fffffff,
+};
+
+enum OverflowModes {
+ OverflowModesWRAP = 0,
+ OverflowModesSAT = 1,
+ OverflowModesSAT_ZERO = 2,
+ OverflowModesSAT_SYM = 3,
+ OverflowModesMax = 0x7fffffff,
+};
+
+enum PackedVectorFormat {
+ PackedVectorFormatPackedVectorFormat4x8Bit = 0,
+ PackedVectorFormatPackedVectorFormat4x8BitKHR = 0,
+ PackedVectorFormatMax = 0x7fffffff,
+};
+
enum Op {
OpNop = 0,
OpUndef = 1,
@@ -1398,12 +1566,25 @@ enum Op {
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,
@@ -1423,6 +1604,8 @@ enum Op {
OpFragmentFetchAMD = 5012,
OpReadClockKHR = 5056,
OpImageSampleFootprintNV = 5283,
+ OpEmitMeshTasksEXT = 5294,
+ OpSetMeshOutputsEXT = 5295,
OpGroupNonUniformPartitionNV = 5296,
OpWritePackedPrimitiveIndices4x8NV = 5299,
OpReportIntersectionKHR = 5334,
@@ -1430,6 +1613,8 @@ enum Op {
OpIgnoreIntersectionNV = 5335,
OpTerminateRayNV = 5336,
OpTraceNV = 5337,
+ OpTraceMotionNV = 5338,
+ OpTraceRayMotionNV = 5339,
OpTypeAccelerationStructureKHR = 5341,
OpTypeAccelerationStructureNV = 5341,
OpExecuteCallableNV = 5344,
@@ -1440,8 +1625,16 @@ enum Op {
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,
@@ -1466,8 +1659,15 @@ enum Op {
OpUSubSatINTEL = 5596,
OpIMul32x16INTEL = 5597,
OpUMul32x16INTEL = 5598,
- OpFunctionPointerINTEL = 5600,
+ OpConstantFunctionPointerINTEL = 5600,
OpFunctionPointerCallINTEL = 5601,
+ OpAsmTargetINTEL = 5609,
+ OpAsmINTEL = 5610,
+ OpAsmCallINTEL = 5611,
+ OpAtomicFMinEXT = 5614,
+ OpAtomicFMaxEXT = 5615,
+ OpAssumeTrueKHR = 5630,
+ OpExpectKHR = 5631,
OpDecorateString = 5632,
OpDecorateStringGOOGLE = 5632,
OpMemberDecorateString = 5633,
@@ -1590,7 +1790,67 @@ enum Op {
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,
@@ -1612,10 +1872,27 @@ enum Op {
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,
OpMax = 0x7fffffff,
};
#ifdef SPV_ENABLE_UTILITY_CODE
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
*hasResult = *hasResultType = false;
switch (opcode) {
@@ -1970,12 +2247,19 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
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;
case OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
case OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break;
case OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break;
+ case OpSDot: *hasResult = true; *hasResultType = true; break;
+ case OpUDot: *hasResult = true; *hasResultType = true; break;
+ case OpSUDot: *hasResult = true; *hasResultType = true; break;
+ case OpSDotAccSat: *hasResult = true; *hasResultType = true; break;
+ case OpUDotAccSat: *hasResult = true; *hasResultType = true; break;
+ case OpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@@ -1995,12 +2279,16 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
case OpReadClockKHR: *hasResult = true; *hasResultType = true; break;
case OpImageSampleFootprintNV: *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;
case OpTerminateRayNV: *hasResult = false; *hasResultType = false; break;
case OpTraceNV: *hasResult = false; *hasResultType = false; break;
+ case OpTraceMotionNV: *hasResult = false; *hasResultType = false; break;
+ case OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
case OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break;
case OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
case OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
@@ -2010,8 +2298,15 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
case OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
- case OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
+ case OpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
+ case OpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
+ case OpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
+ case OpConvertImageToUNV: *hasResult = true; *hasResultType = true; break;
+ case OpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break;
+ case OpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break;
+ case OpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
+ case OpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break;
case OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
case OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
case OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2036,8 +2331,15 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break;
case OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
case OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
- case OpFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
case OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpAsmINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break;
+ case OpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break;
+ case OpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break;
+ case OpExpectKHR: *hasResult = true; *hasResultType = true; break;
case OpDecorateString: *hasResult = false; *hasResultType = false; break;
case OpMemberDecorateString: *hasResult = false; *hasResultType = false; break;
case OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2158,7 +2460,67 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break;
case OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break;
case OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break;
+ case OpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break;
+ case OpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break;
+ 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;
+ case OpFixedSinINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedCosINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedLogINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpFixedExpINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break;
+ case OpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break;
case OpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break;
case OpWritePipeBlockingINTEL: *hasResult = true; *hasResultType = true; break;
case OpFPGARegINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2180,6 +2542,20 @@ inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
case OpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break;
case OpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break;
case OpAtomicFAddEXT: *hasResult = true; *hasResultType = true; break;
+ case OpTypeBufferSurfaceINTEL: *hasResult = true; *hasResultType = false; break;
+ 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 */
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.cpp
index 9081a664610..93299479815 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.cpp
@@ -135,7 +135,9 @@ bool CFG::post_order_visit(uint32_t block_id)
break;
case SPIRBlock::MultiSelect:
- for (auto &target : block.cases)
+ {
+ const auto &cases = compiler.get_case_list(block);
+ for (const auto &target : cases)
{
if (post_order_visit(target.block))
add_branch(block_id, target.block);
@@ -143,7 +145,7 @@ bool CFG::post_order_visit(uint32_t block_id)
if (block.default_block && post_order_visit(block.default_block))
add_branch(block_id, block.default_block);
break;
-
+ }
default:
break;
}
@@ -304,15 +306,36 @@ bool CFG::node_terminates_control_flow_in_sub_graph(BlockID from, BlockID to) co
bool true_path_ignore = false;
bool false_path_ignore = false;
- if (ignore_block_id && dom.terminator == SPIRBlock::Select)
+
+ bool merges_to_nothing = dom.merge == SPIRBlock::MergeNone ||
+ (dom.merge == SPIRBlock::MergeSelection && dom.next_block &&
+ compiler.get<SPIRBlock>(dom.next_block).terminator == SPIRBlock::Unreachable) ||
+ (dom.merge == SPIRBlock::MergeLoop && dom.merge_block &&
+ compiler.get<SPIRBlock>(dom.merge_block).terminator == SPIRBlock::Unreachable);
+
+ if (dom.self == from || merges_to_nothing)
{
- auto &true_block = compiler.get<SPIRBlock>(dom.true_block);
- auto &false_block = compiler.get<SPIRBlock>(dom.false_block);
- auto &ignore_block = compiler.get<SPIRBlock>(ignore_block_id);
- true_path_ignore = compiler.execution_is_branchless(true_block, ignore_block);
- false_path_ignore = compiler.execution_is_branchless(false_block, ignore_block);
+ // We can only ignore inner branchy paths if there is no merge,
+ // i.e. no code is generated afterwards. E.g. this allows us to elide continue:
+ // for (;;) { if (cond) { continue; } else { break; } }.
+ // Codegen here in SPIR-V will be something like either no merge if one path directly breaks, or
+ // we merge to Unreachable.
+ if (ignore_block_id && dom.terminator == SPIRBlock::Select)
+ {
+ auto &true_block = compiler.get<SPIRBlock>(dom.true_block);
+ auto &false_block = compiler.get<SPIRBlock>(dom.false_block);
+ auto &ignore_block = compiler.get<SPIRBlock>(ignore_block_id);
+ true_path_ignore = compiler.execution_is_branchless(true_block, ignore_block);
+ false_path_ignore = compiler.execution_is_branchless(false_block, ignore_block);
+ }
}
+ // Cases where we allow traversal. This serves as a proxy for post-dominance in a loop body.
+ // TODO: Might want to do full post-dominance analysis, but it's a lot of churn for something like this ...
+ // - We're the merge block of a selection construct. Jump to header.
+ // - We're the merge block of a loop. Jump to header.
+ // - Direct branch. Trivial.
+ // - Allow cases inside a branch if the header cannot merge execution before loop exit.
if ((dom.merge == SPIRBlock::MergeSelection && dom.next_block == to) ||
(dom.merge == SPIRBlock::MergeLoop && dom.merge_block == to) ||
(dom.terminator == SPIRBlock::Direct && dom.next_block == to) ||
@@ -385,7 +408,9 @@ void DominatorBuilder::lift_continue_block_dominator()
break;
case SPIRBlock::MultiSelect:
- for (auto &target : block.cases)
+ {
+ auto &cases = cfg.get_compiler().get_case_list(block);
+ for (auto &target : cases)
{
if (cfg.get_visit_order(target.block) > post_order)
back_edge_dominator = true;
@@ -393,6 +418,7 @@ void DominatorBuilder::lift_continue_block_dominator()
if (block.default_block && cfg.get_visit_order(block.default_block) > post_order)
back_edge_dominator = true;
break;
+ }
default:
break;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.hpp
index 90973b56707..1d85fe0a97b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cfg.hpp
@@ -59,6 +59,11 @@ public:
return 0;
}
+ bool is_reachable(uint32_t block) const
+ {
+ return visit_order.count(block) != 0;
+ }
+
uint32_t get_visit_order(uint32_t block) const
{
auto itr = visit_order.find(block);
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_common.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_common.hpp
index 4bafbf93df6..71b1eada6db 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_common.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_common.hpp
@@ -24,7 +24,11 @@
#ifndef SPIRV_CROSS_COMMON_HPP
#define SPIRV_CROSS_COMMON_HPP
+#ifndef SPV_ENABLE_UTILITY_CODE
+#define SPV_ENABLE_UTILITY_CODE
+#endif
#include "spirv.hpp"
+
#include "spirv_cross_containers.hpp"
#include "spirv_cross_error_handling.hpp"
#include <functional>
@@ -211,6 +215,28 @@ inline std::string convert_to_string(const T &t)
return std::to_string(t);
}
+static inline std::string convert_to_string(int32_t value)
+{
+ // INT_MIN is ... special on some backends. If we use a decimal literal, and negate it, we
+ // could accidentally promote the literal to long first, then negate.
+ // To workaround it, emit int(0x80000000) instead.
+ if (value == std::numeric_limits<int32_t>::min())
+ return "int(0x80000000)";
+ else
+ return std::to_string(value);
+}
+
+static inline std::string convert_to_string(int64_t value, const std::string &int64_type, bool long_long_literal_suffix)
+{
+ // INT64_MIN is ... special on some backends.
+ // If we use a decimal literal, and negate it, we might overflow the representable numbers.
+ // To workaround it, emit int(0x80000000) instead.
+ if (value == std::numeric_limits<int64_t>::min())
+ return join(int64_type, "(0x8000000000000000u", (long_long_literal_suffix ? "ll" : "l"), ")");
+ else
+ return std::to_string(value) + (long_long_literal_suffix ? "ll" : "l");
+}
+
// Allow implementations to set a convenient standard precision
#ifndef SPIRV_CROSS_FLT_FMT
#define SPIRV_CROSS_FLT_FMT "%.32g"
@@ -616,7 +642,9 @@ struct SPIRExtension : IVariant
SPV_AMD_shader_ballot,
SPV_AMD_shader_explicit_vertex_parameter,
SPV_AMD_shader_trinary_minmax,
- SPV_AMD_gcn_shader
+ SPV_AMD_gcn_shader,
+ NonSemanticDebugPrintf,
+ NonSemanticShaderDebugInfo
};
explicit SPIRExtension(Extension ext_)
@@ -650,10 +678,12 @@ struct SPIREntryPoint
struct WorkgroupSize
{
uint32_t x = 0, y = 0, z = 0;
+ uint32_t id_x = 0, id_y = 0, id_z = 0;
uint32_t constant = 0; // Workgroup size can be expressed as a constant/spec-constant instead.
} workgroup_size;
uint32_t invocations = 0;
uint32_t output_vertices = 0;
+ uint32_t output_primitives = 0;
spv::ExecutionModel model = spv::ExecutionModelMax;
bool geometry_passthrough = false;
};
@@ -667,7 +697,7 @@ struct SPIRExpression : IVariant
// Only created by the backend target to avoid creating tons of temporaries.
SPIRExpression(std::string expr, TypeID expression_type_, bool immutable_)
- : expression(move(expr))
+ : expression(std::move(expr))
, expression_type(expression_type_)
, immutable(immutable_)
{
@@ -748,7 +778,8 @@ struct SPIRBlock : IVariant
Unreachable, // Noop
Kill, // Discard
IgnoreIntersection, // Ray Tracing
- TerminateRay // Ray Tracing
+ TerminateRay, // Ray Tracing
+ EmitMeshTasks // Mesh shaders
};
enum Merge
@@ -810,6 +841,13 @@ struct SPIRBlock : IVariant
BlockID false_block = 0;
BlockID default_block = 0;
+ // If terminator is EmitMeshTasksEXT.
+ struct
+ {
+ ID groups[3];
+ ID payload;
+ } mesh = {};
+
SmallVector<Instruction> ops;
struct Phi
@@ -832,10 +870,11 @@ struct SPIRBlock : IVariant
struct Case
{
- uint32_t value;
+ uint64_t value;
BlockID block;
};
- SmallVector<Case> cases;
+ SmallVector<Case> cases_32bit;
+ SmallVector<Case> cases_64bit;
// If we have tried to optimize code for this block but failed,
// keep track of this.
@@ -1048,7 +1087,6 @@ struct SPIRVariable : IVariant
// Temporaries which can remain forwarded as long as this variable is not modified.
SmallVector<ID> dependees;
- bool forwardable = true;
bool deferred_declaration = false;
bool phi_variable = false;
@@ -1377,7 +1415,7 @@ public:
~Variant()
{
if (holder)
- group->pools[type]->free_opaque(holder);
+ group->pools[type]->deallocate_opaque(holder);
}
// Marking custom move constructor as noexcept is important.
@@ -1396,7 +1434,7 @@ public:
if (this != &other)
{
if (holder)
- group->pools[type]->free_opaque(holder);
+ group->pools[type]->deallocate_opaque(holder);
holder = other.holder;
group = other.group;
type = other.type;
@@ -1420,7 +1458,7 @@ public:
if (this != &other)
{
if (holder)
- group->pools[type]->free_opaque(holder);
+ group->pools[type]->deallocate_opaque(holder);
if (other.holder)
holder = other.holder->clone(group->pools[other.type].get());
@@ -1436,13 +1474,13 @@ public:
void set(IVariant *val, Types new_type)
{
if (holder)
- group->pools[type]->free_opaque(holder);
+ group->pools[type]->deallocate_opaque(holder);
holder = nullptr;
if (!allow_type_rewrite && type != TypeNone && type != new_type)
{
if (val)
- group->pools[new_type]->free_opaque(val);
+ group->pools[new_type]->deallocate_opaque(val);
SPIRV_CROSS_THROW("Overwriting a variant with new type.");
}
@@ -1497,7 +1535,7 @@ public:
void reset()
{
if (holder)
- group->pools[type]->free_opaque(holder);
+ group->pools[type]->deallocate_opaque(holder);
holder = nullptr;
type = TypeNone;
}
@@ -1540,6 +1578,7 @@ struct AccessChainMeta
bool storage_is_packed = false;
bool storage_is_invariant = false;
bool flattened_struct = false;
+ bool relaxed_precision = false;
};
enum ExtendedDecorations
@@ -1607,6 +1646,12 @@ enum ExtendedDecorations
// results of interpolation can.
SPIRVCrossDecorationInterpolantComponentExpr,
+ // Apply to any struct type that is used in the Workgroup storage class.
+ // This causes matrices in MSL prior to Metal 3.0 to be emitted using a special
+ // class that is convertible to the standard matrix type, to work around the
+ // lack of constructors in the 'threadgroup' address space.
+ SPIRVCrossDecorationWorkgroupStruct,
+
SPIRVCrossDecorationCount
};
@@ -1752,6 +1797,33 @@ static inline bool opcode_is_sign_invariant(spv::Op opcode)
}
}
+static inline bool opcode_can_promote_integer_implicitly(spv::Op opcode)
+{
+ switch (opcode)
+ {
+ case spv::OpSNegate:
+ case spv::OpNot:
+ case spv::OpBitwiseAnd:
+ case spv::OpBitwiseOr:
+ case spv::OpBitwiseXor:
+ case spv::OpShiftLeftLogical:
+ case spv::OpShiftRightLogical:
+ case spv::OpShiftRightArithmetic:
+ case spv::OpIAdd:
+ case spv::OpISub:
+ case spv::OpIMul:
+ case spv::OpSDiv:
+ case spv::OpUDiv:
+ case spv::OpSRem:
+ case spv::OpUMod:
+ case spv::OpSMod:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
struct SetBindingPair
{
uint32_t desc_set;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cpp.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cpp.cpp
index b7946bf337f..dd0a84c8312 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cpp.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cpp.cpp
@@ -274,8 +274,6 @@ void CompilerCPP::emit_resources()
if (emitted)
statement("");
- declare_undefined_values();
-
statement("inline void init(spirv_cross_shader& s)");
begin_scope();
statement(resource_type, "::init(s);");
@@ -338,11 +336,8 @@ string CompilerCPP::compile()
uint32_t pass_count = 0;
do
{
- if (pass_count >= 3)
- SPIRV_CROSS_THROW("Over 3 compilation loops detected. Must be a bug!");
-
resource_registrations.clear();
- reset();
+ reset(pass_count);
// Move constructor for this type is broken on GCC 4.9 ...
buffer.reset();
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.cpp
index 519350611c4..77bb0819733 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.cpp
@@ -36,16 +36,16 @@ using namespace SPIRV_CROSS_NAMESPACE;
Compiler::Compiler(vector<uint32_t> ir_)
{
- Parser parser(move(ir_));
+ Parser parser(std::move(ir_));
parser.parse();
- set_ir(move(parser.get_parsed_ir()));
+ set_ir(std::move(parser.get_parsed_ir()));
}
Compiler::Compiler(const uint32_t *ir_, size_t word_count)
{
Parser parser(ir_, word_count);
parser.parse();
- set_ir(move(parser.get_parsed_ir()));
+ set_ir(std::move(parser.get_parsed_ir()));
}
Compiler::Compiler(const ParsedIR &ir_)
@@ -55,12 +55,12 @@ Compiler::Compiler(const ParsedIR &ir_)
Compiler::Compiler(ParsedIR &&ir_)
{
- set_ir(move(ir_));
+ set_ir(std::move(ir_));
}
void Compiler::set_ir(ParsedIR &&ir_)
{
- ir = move(ir_);
+ ir = std::move(ir_);
parse_fixup();
}
@@ -98,7 +98,8 @@ bool Compiler::block_is_pure(const SPIRBlock &block)
// This is a global side effect of the function.
if (block.terminator == SPIRBlock::Kill ||
block.terminator == SPIRBlock::TerminateRay ||
- block.terminator == SPIRBlock::IgnoreIntersection)
+ block.terminator == SPIRBlock::IgnoreIntersection ||
+ block.terminator == SPIRBlock::EmitMeshTasks)
return false;
for (auto &i : block.ops)
@@ -154,6 +155,11 @@ bool Compiler::block_is_pure(const SPIRBlock &block)
case OpEmitVertex:
return false;
+ // Mesh shader functions modify global state.
+ // (EmitMeshTasks is a terminator).
+ case OpSetMeshOutputsEXT:
+ return false;
+
// Barriers disallow any reordering, so we should treat blocks with barrier as writing.
case OpControlBarrier:
case OpMemoryBarrier:
@@ -181,6 +187,30 @@ bool Compiler::block_is_pure(const SPIRBlock &block)
// This is a global side effect of the function.
return false;
+ case OpExtInst:
+ {
+ uint32_t extension_set = ops[2];
+ if (get<SPIRExtension>(extension_set).ext == SPIRExtension::GLSL)
+ {
+ auto op_450 = static_cast<GLSLstd450>(ops[3]);
+ switch (op_450)
+ {
+ case GLSLstd450Modf:
+ case GLSLstd450Frexp:
+ {
+ auto &type = expression_type(ops[5]);
+ if (type.storage != StorageClassFunction)
+ return false;
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
+ break;
+ }
+
default:
break;
}
@@ -695,7 +725,7 @@ bool Compiler::InterfaceVariableAccessHandler::handle(Op opcode, const uint32_t
case OpExtInst:
{
- if (length < 5)
+ if (length < 3)
return false;
auto &extension_set = compiler.get<SPIRExtension>(args[2]);
switch (extension_set.ext)
@@ -716,6 +746,15 @@ bool Compiler::InterfaceVariableAccessHandler::handle(Op opcode, const uint32_t
break;
}
+ case GLSLstd450Modf:
+ case GLSLstd450Fract:
+ {
+ auto *var = compiler.maybe_get<SPIRVariable>(args[5]);
+ if (var && storage_class_is_interface(var->storage))
+ variables.insert(args[5]);
+ break;
+ }
+
default:
break;
}
@@ -819,7 +858,7 @@ unordered_set<VariableID> Compiler::get_active_interface_variables() const
void Compiler::set_enabled_interface_variables(std::unordered_set<VariableID> active_variables)
{
- active_interface_variables = move(active_variables);
+ active_interface_variables = std::move(active_variables);
check_active_interface_variables = true;
}
@@ -952,6 +991,10 @@ ShaderResources Compiler::get_shader_resources(const unordered_set<VariableID> *
// in the future.
res.push_constant_buffers.push_back({ var.self, var.basetype, type.self, get_name(var.self) });
}
+ else if (type.storage == StorageClassShaderRecordBufferKHR)
+ {
+ res.shader_record_buffers.push_back({ var.self, var.basetype, type.self, get_remapped_declared_block_name(var.self, ssbo_instance_name) });
+ }
// Images
else if (type.storage == StorageClassUniformConstant && type.basetype == SPIRType::Image &&
type.image.sampled == 2)
@@ -1017,10 +1060,12 @@ void Compiler::parse_fixup()
if (id.get_type() == TypeConstant)
{
auto &c = id.get<SPIRConstant>();
- if (ir.meta[c.self].decoration.builtin && ir.meta[c.self].decoration.builtin_type == BuiltInWorkgroupSize)
+ if (has_decoration(c.self, DecorationBuiltIn) &&
+ BuiltIn(get_decoration(c.self, DecorationBuiltIn)) == BuiltInWorkgroupSize)
{
// In current SPIR-V, there can be just one constant like this.
// All entry points will receive the constant value.
+ // WorkgroupSize take precedence over LocalSizeId.
for (auto &entry : ir.entry_points)
{
entry.second.workgroup_size.constant = c.self;
@@ -1034,8 +1079,11 @@ void Compiler::parse_fixup()
{
auto &var = id.get<SPIRVariable>();
if (var.storage == StorageClassPrivate || var.storage == StorageClassWorkgroup ||
+ var.storage == StorageClassTaskPayloadWorkgroupEXT ||
var.storage == StorageClassOutput)
+ {
global_variables.push_back(var.self);
+ }
if (variable_storage_is_aliased(var))
aliased_variables.push_back(var.self);
}
@@ -1626,6 +1674,44 @@ SPIRBlock::ContinueBlockType Compiler::continue_block_type(const SPIRBlock &bloc
}
}
+const SmallVector<SPIRBlock::Case> &Compiler::get_case_list(const SPIRBlock &block) const
+{
+ uint32_t width = 0;
+
+ // First we check if we can get the type directly from the block.condition
+ // since it can be a SPIRConstant or a SPIRVariable.
+ if (const auto *constant = maybe_get<SPIRConstant>(block.condition))
+ {
+ const auto &type = get<SPIRType>(constant->constant_type);
+ width = type.width;
+ }
+ else if (const auto *var = maybe_get<SPIRVariable>(block.condition))
+ {
+ const auto &type = get<SPIRType>(var->basetype);
+ width = type.width;
+ }
+ else if (const auto *undef = maybe_get<SPIRUndef>(block.condition))
+ {
+ const auto &type = get<SPIRType>(undef->basetype);
+ width = type.width;
+ }
+ else
+ {
+ auto search = ir.load_type_width.find(block.condition);
+ if (search == ir.load_type_width.end())
+ {
+ SPIRV_CROSS_THROW("Use of undeclared variable on a switch statement.");
+ }
+
+ width = search->second;
+ }
+
+ if (width > 32)
+ return block.cases_64bit;
+
+ return block.cases_32bit;
+}
+
bool Compiler::traverse_all_reachable_opcodes(const SPIRBlock &block, OpcodeHandler &handler) const
{
handler.set_current_block(block);
@@ -1729,10 +1815,22 @@ size_t Compiler::get_declared_struct_size(const SPIRType &type) const
if (type.member_types.empty())
SPIRV_CROSS_THROW("Declared struct in block cannot be empty.");
- uint32_t last = uint32_t(type.member_types.size() - 1);
- size_t offset = type_struct_member_offset(type, last);
- size_t size = get_declared_struct_member_size(type, last);
- return offset + size;
+ // Offsets can be declared out of order, so we need to deduce the actual size
+ // based on last member instead.
+ uint32_t member_index = 0;
+ size_t highest_offset = 0;
+ for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++)
+ {
+ size_t offset = type_struct_member_offset(type, i);
+ if (offset > highest_offset)
+ {
+ highest_offset = offset;
+ member_index = i;
+ }
+ }
+
+ size_t size = get_declared_struct_member_size(type, member_index);
+ return highest_offset + size;
}
size_t Compiler::get_declared_struct_size_runtime_array(const SPIRType &type, size_t array_size) const
@@ -2078,6 +2176,12 @@ void Compiler::set_execution_mode(ExecutionMode mode, uint32_t arg0, uint32_t ar
execution.workgroup_size.z = arg2;
break;
+ case ExecutionModeLocalSizeId:
+ execution.workgroup_size.id_x = arg0;
+ execution.workgroup_size.id_y = arg1;
+ execution.workgroup_size.id_z = arg2;
+ break;
+
case ExecutionModeInvocations:
execution.invocations = arg0;
break;
@@ -2086,6 +2190,10 @@ void Compiler::set_execution_mode(ExecutionMode mode, uint32_t arg0, uint32_t ar
execution.output_vertices = arg0;
break;
+ case ExecutionModeOutputPrimitivesEXT:
+ execution.output_primitives = arg0;
+ break;
+
default:
break;
}
@@ -2105,6 +2213,7 @@ uint32_t Compiler::get_work_group_size_specialization_constants(SpecializationCo
y = { 0, 0 };
z = { 0, 0 };
+ // WorkgroupSize builtin takes precedence over LocalSize / LocalSizeId.
if (execution.workgroup_size.constant != 0)
{
auto &c = get<SPIRConstant>(execution.workgroup_size.constant);
@@ -2127,6 +2236,29 @@ uint32_t Compiler::get_work_group_size_specialization_constants(SpecializationCo
z.constant_id = get_decoration(c.m.c[0].id[2], DecorationSpecId);
}
}
+ else if (execution.flags.get(ExecutionModeLocalSizeId))
+ {
+ auto &cx = get<SPIRConstant>(execution.workgroup_size.id_x);
+ if (cx.specialization)
+ {
+ x.id = execution.workgroup_size.id_x;
+ x.constant_id = get_decoration(execution.workgroup_size.id_x, DecorationSpecId);
+ }
+
+ auto &cy = get<SPIRConstant>(execution.workgroup_size.id_y);
+ if (cy.specialization)
+ {
+ y.id = execution.workgroup_size.id_y;
+ y.constant_id = get_decoration(execution.workgroup_size.id_y, DecorationSpecId);
+ }
+
+ auto &cz = get<SPIRConstant>(execution.workgroup_size.id_z);
+ if (cz.specialization)
+ {
+ z.id = execution.workgroup_size.id_z;
+ z.constant_id = get_decoration(execution.workgroup_size.id_z, DecorationSpecId);
+ }
+ }
return execution.workgroup_size.constant;
}
@@ -2136,15 +2268,42 @@ uint32_t Compiler::get_execution_mode_argument(spv::ExecutionMode mode, uint32_t
auto &execution = get_entry_point();
switch (mode)
{
+ case ExecutionModeLocalSizeId:
+ if (execution.flags.get(ExecutionModeLocalSizeId))
+ {
+ switch (index)
+ {
+ case 0:
+ return execution.workgroup_size.id_x;
+ case 1:
+ return execution.workgroup_size.id_y;
+ case 2:
+ return execution.workgroup_size.id_z;
+ default:
+ return 0;
+ }
+ }
+ else
+ return 0;
+
case ExecutionModeLocalSize:
switch (index)
{
case 0:
- return execution.workgroup_size.x;
+ if (execution.flags.get(ExecutionModeLocalSizeId) && execution.workgroup_size.id_x != 0)
+ return get<SPIRConstant>(execution.workgroup_size.id_x).scalar();
+ else
+ return execution.workgroup_size.x;
case 1:
- return execution.workgroup_size.y;
+ if (execution.flags.get(ExecutionModeLocalSizeId) && execution.workgroup_size.id_y != 0)
+ return get<SPIRConstant>(execution.workgroup_size.id_y).scalar();
+ else
+ return execution.workgroup_size.y;
case 2:
- return execution.workgroup_size.z;
+ if (execution.flags.get(ExecutionModeLocalSizeId) && execution.workgroup_size.id_z != 0)
+ return get<SPIRConstant>(execution.workgroup_size.id_z).scalar();
+ else
+ return execution.workgroup_size.z;
default:
return 0;
}
@@ -2155,6 +2314,9 @@ uint32_t Compiler::get_execution_mode_argument(spv::ExecutionMode mode, uint32_t
case ExecutionModeOutputVertices:
return execution.output_vertices;
+ case ExecutionModeOutputPrimitivesEXT:
+ return execution.output_primitives;
+
default:
return 0;
}
@@ -2183,6 +2345,11 @@ bool Compiler::is_tessellation_shader() const
return is_tessellation_shader(get_execution_model());
}
+bool Compiler::is_tessellating_triangles() const
+{
+ return get_execution_mode_bitset().get(ExecutionModeTriangles);
+}
+
void Compiler::set_remapped_variable_state(VariableID id, bool remap_enable)
{
get<SPIRVariable>(id).remapped_variable = remap_enable;
@@ -2217,6 +2384,19 @@ void Compiler::add_implied_read_expression(SPIRAccessChain &e, uint32_t source)
e.implied_read_expressions.push_back(source);
}
+void Compiler::add_active_interface_variable(uint32_t var_id)
+{
+ active_interface_variables.insert(var_id);
+
+ // In SPIR-V 1.4 and up we must also track the interface variable in the entry point.
+ if (ir.get_spirv_version() >= 0x10400)
+ {
+ auto &vars = get_entry_point().interface_variables;
+ if (find(begin(vars), end(vars), VariableID(var_id)) == end(vars))
+ vars.push_back(var_id);
+ }
+}
+
void Compiler::inherit_expression_dependencies(uint32_t dst, uint32_t source_expression)
{
// Don't inherit any expression dependencies if the expression in dst
@@ -2371,7 +2551,7 @@ void Compiler::CombinedImageSamplerHandler::push_remap_parameters(const SPIRFunc
unordered_map<uint32_t, uint32_t> remapping;
for (uint32_t i = 0; i < length; i++)
remapping[func.arguments[i].id] = remap_parameter(args[i]);
- parameter_remapping.push(move(remapping));
+ parameter_remapping.push(std::move(remapping));
}
void Compiler::CombinedImageSamplerHandler::pop_remap_parameters()
@@ -3012,12 +3192,15 @@ void Compiler::AnalyzeVariableScopeAccessHandler::set_current_block(const SPIRBl
break;
case SPIRBlock::MultiSelect:
+ {
notify_variable_access(block.condition, block.self);
- for (auto &target : block.cases)
+ auto &cases = compiler.get_case_list(block);
+ for (auto &target : cases)
test_phi(target.block);
if (block.default_block)
test_phi(block.default_block);
break;
+ }
default:
break;
@@ -3084,7 +3267,20 @@ bool Compiler::AnalyzeVariableScopeAccessHandler::handle(spv::Op op, const uint3
// Keep track of the types of temporaries, so we can hoist them out as necessary.
uint32_t result_type, result_id;
if (compiler.instruction_to_result_type(result_type, result_id, op, args, length))
+ {
+ // For some opcodes, we will need to override the result id.
+ // If we need to hoist the temporary, the temporary type is the input, not the result.
+ // FIXME: This will likely break with OpCopyObject + hoisting, but we'll have to
+ // solve it if we ever get there ...
+ if (op == OpConvertUToAccelerationStructureKHR)
+ {
+ auto itr = result_id_to_type.find(args[2]);
+ if (itr != result_id_to_type.end())
+ result_type = itr->second;
+ }
+
result_id_to_type[result_id] = result_type;
+ }
switch (op)
{
@@ -3278,6 +3474,33 @@ bool Compiler::AnalyzeVariableScopeAccessHandler::handle(spv::Op op, const uint3
for (uint32_t i = 4; i < length; i++)
notify_variable_access(args[i], current_block->self);
notify_variable_access(args[1], current_block->self);
+
+ uint32_t extension_set = args[2];
+ if (compiler.get<SPIRExtension>(extension_set).ext == SPIRExtension::GLSL)
+ {
+ auto op_450 = static_cast<GLSLstd450>(args[3]);
+ switch (op_450)
+ {
+ case GLSLstd450Modf:
+ case GLSLstd450Frexp:
+ {
+ uint32_t ptr = args[5];
+ auto *var = compiler.maybe_get_backing_variable(ptr);
+ if (var)
+ {
+ accessed_variables_to_block[var->self].insert(current_block->self);
+ if (var->self == ptr)
+ complete_write_variables_to_block[var->self].insert(current_block->self);
+ else
+ partial_write_variables_to_block[var->self].insert(current_block->self);
+ }
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
break;
}
@@ -3559,6 +3782,7 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry, AnalyzeVariableScopeA
DominatorBuilder builder(cfg);
auto &blocks = var.second;
auto &type = expression_type(var.first);
+ BlockID potential_continue_block = 0;
// Figure out which block is dominating all accesses of those variables.
for (auto &block : blocks)
@@ -3580,14 +3804,13 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry, AnalyzeVariableScopeA
{
// The variable is used in multiple continue blocks, this is not a loop
// candidate, signal that by setting block to -1u.
- auto &potential = potential_loop_variables[var.first];
-
- if (potential == 0)
- potential = block;
+ if (potential_continue_block == 0)
+ potential_continue_block = block;
else
- potential = ~(0u);
+ potential_continue_block = ~(0u);
}
}
+
builder.add_block(block);
}
@@ -3596,6 +3819,34 @@ void Compiler::analyze_variable_scope(SPIRFunction &entry, AnalyzeVariableScopeA
// Add it to a per-block list of variables.
BlockID dominating_block = builder.get_dominator();
+ if (dominating_block && potential_continue_block != 0 && potential_continue_block != ~0u)
+ {
+ auto &inner_block = get<SPIRBlock>(dominating_block);
+
+ BlockID merge_candidate = 0;
+
+ // Analyze the dominator. If it lives in a different loop scope than the candidate continue
+ // block, reject the loop variable candidate.
+ if (inner_block.merge == SPIRBlock::MergeLoop)
+ merge_candidate = inner_block.merge_block;
+ else if (inner_block.loop_dominator != SPIRBlock::NoDominator)
+ merge_candidate = get<SPIRBlock>(inner_block.loop_dominator).merge_block;
+
+ if (merge_candidate != 0 && cfg.is_reachable(merge_candidate))
+ {
+ // If the merge block has a higher post-visit order, we know that continue candidate
+ // cannot reach the merge block, and we have two separate scopes.
+ if (!cfg.is_reachable(potential_continue_block) ||
+ cfg.get_visit_order(merge_candidate) > cfg.get_visit_order(potential_continue_block))
+ {
+ potential_continue_block = 0;
+ }
+ }
+ }
+
+ if (potential_continue_block != 0 && potential_continue_block != ~0u)
+ potential_loop_variables[var.first] = potential_continue_block;
+
// For variables whose dominating block is inside a loop, there is a risk that these variables
// actually need to be preserved across loop iterations. We can express this by adding
// a "read" access to the loop header.
@@ -4195,8 +4446,9 @@ void Compiler::analyze_image_and_sampler_usage()
handler.dependency_hierarchy.clear();
traverse_all_reachable_opcodes(get<SPIRFunction>(ir.default_entry_point), handler);
- comparison_ids = move(handler.comparison_ids);
+ comparison_ids = std::move(handler.comparison_ids);
need_subpass_input = handler.need_subpass_input;
+ need_subpass_input_ms = handler.need_subpass_input_ms;
// Forward information from separate images and samplers into combined image samplers.
for (auto &combined : combined_image_samplers)
@@ -4248,7 +4500,7 @@ void Compiler::build_function_control_flow_graphs_and_analyze()
CFGBuilder handler(*this);
handler.function_cfgs[ir.default_entry_point].reset(new CFG(*this, get<SPIRFunction>(ir.default_entry_point)));
traverse_all_reachable_opcodes(get<SPIRFunction>(ir.default_entry_point), handler);
- function_cfgs = move(handler.function_cfgs);
+ function_cfgs = std::move(handler.function_cfgs);
bool single_function = function_cfgs.size() <= 1;
for (auto &f : function_cfgs)
@@ -4363,7 +4615,11 @@ bool Compiler::CombinedImageSamplerUsageHandler::handle(Op opcode, const uint32_
// If we load an image, we're going to use it and there is little harm in declaring an unused gl_FragCoord.
auto &type = compiler.get<SPIRType>(args[0]);
if (type.image.dim == DimSubpassData)
+ {
need_subpass_input = true;
+ if (type.image.ms)
+ need_subpass_input_ms = true;
+ }
// If we load a SampledImage and it will be used with Dref, propagate the state up.
if (dref_combined_samplers.count(args[1]) != 0)
@@ -4376,16 +4632,13 @@ bool Compiler::CombinedImageSamplerUsageHandler::handle(Op opcode, const uint32_
if (length < 4)
return false;
- uint32_t result_type = args[0];
- uint32_t result_id = args[1];
- auto &type = compiler.get<SPIRType>(result_type);
-
// If the underlying resource has been used for comparison then duplicate loads of that resource must be too.
// This image must be a depth image.
+ uint32_t result_id = args[1];
uint32_t image = args[2];
uint32_t sampler = args[3];
- if (type.image.depth || dref_combined_samplers.count(result_id) != 0)
+ if (dref_combined_samplers.count(result_id) != 0)
{
add_hierarchy_to_comparison_ids(image);
@@ -4541,46 +4794,22 @@ bool Compiler::reflection_ssbo_instance_name_is_significant() const
return aliased_ssbo_types;
}
-bool Compiler::instruction_to_result_type(uint32_t &result_type, uint32_t &result_id, spv::Op op, const uint32_t *args,
- uint32_t length)
+bool Compiler::instruction_to_result_type(uint32_t &result_type, uint32_t &result_id, spv::Op op,
+ const uint32_t *args, uint32_t length)
{
- // Most instructions follow the pattern of <result-type> <result-id> <arguments>.
- // There are some exceptions.
- switch (op)
- {
- case OpStore:
- case OpCopyMemory:
- case OpCopyMemorySized:
- case OpImageWrite:
- case OpAtomicStore:
- case OpAtomicFlagClear:
- case OpEmitStreamVertex:
- case OpEndStreamPrimitive:
- case OpControlBarrier:
- case OpMemoryBarrier:
- case OpGroupWaitEvents:
- case OpRetainEvent:
- case OpReleaseEvent:
- case OpSetUserEventStatus:
- case OpCaptureEventProfilingInfo:
- case OpCommitReadPipe:
- case OpCommitWritePipe:
- case OpGroupCommitReadPipe:
- case OpGroupCommitWritePipe:
- case OpLine:
- case OpNoLine:
+ if (length < 2)
return false;
- default:
- if (length > 1 && maybe_get<SPIRType>(args[0]) != nullptr)
- {
- result_type = args[0];
- result_id = args[1];
- return true;
- }
- else
- return false;
+ bool has_result_id = false, has_result_type = false;
+ HasResultAndType(op, &has_result_id, &has_result_type);
+ if (has_result_id && has_result_type)
+ {
+ result_type = args[0];
+ result_id = args[1];
+ return true;
}
+ else
+ return false;
}
Bitset Compiler::combined_decoration_for_member(const SPIRType &type, uint32_t index) const
@@ -4645,9 +4874,11 @@ bool Compiler::is_desktop_only_format(spv::ImageFormat format)
return false;
}
-bool Compiler::image_is_comparison(const SPIRType &type, uint32_t id) const
+// An image is determined to be a depth image if it is marked as a depth image and is not also
+// explicitly marked with a color format, or if there are any sample/gather compare operations on it.
+bool Compiler::is_depth_image(const SPIRType &type, uint32_t id) const
{
- return type.image.depth || (comparison_ids.count(id) != 0);
+ return (type.image.depth && type.image.format == ImageFormatUnknown) || comparison_ids.count(id);
}
bool Compiler::type_is_opaque_value(const SPIRType &type) const
@@ -4662,6 +4893,12 @@ void Compiler::force_recompile()
is_force_recompile = true;
}
+void Compiler::force_recompile_guarantee_forward_progress()
+{
+ force_recompile();
+ is_force_recompile_forward_progress = true;
+}
+
bool Compiler::is_forcing_recompilation() const
{
return is_force_recompile;
@@ -4670,6 +4907,7 @@ bool Compiler::is_forcing_recompilation() const
void Compiler::clear_force_recompile()
{
is_force_recompile = false;
+ is_force_recompile_forward_progress = false;
}
Compiler::PhysicalStorageBufferPointerHandler::PhysicalStorageBufferPointerHandler(Compiler &compiler_)
@@ -4677,31 +4915,181 @@ Compiler::PhysicalStorageBufferPointerHandler::PhysicalStorageBufferPointerHandl
{
}
-bool Compiler::PhysicalStorageBufferPointerHandler::handle(Op op, const uint32_t *args, uint32_t)
+Compiler::PhysicalBlockMeta *Compiler::PhysicalStorageBufferPointerHandler::find_block_meta(uint32_t id) const
+{
+ auto chain_itr = access_chain_to_physical_block.find(id);
+ if (chain_itr != access_chain_to_physical_block.end())
+ return chain_itr->second;
+ else
+ return nullptr;
+}
+
+void Compiler::PhysicalStorageBufferPointerHandler::mark_aligned_access(uint32_t id, const uint32_t *args, uint32_t length)
+{
+ uint32_t mask = *args;
+ args++;
+ length--;
+ if (length && (mask & MemoryAccessVolatileMask) != 0)
+ {
+ args++;
+ length--;
+ }
+
+ if (length && (mask & MemoryAccessAlignedMask) != 0)
+ {
+ uint32_t alignment = *args;
+ auto *meta = find_block_meta(id);
+
+ // This makes the assumption that the application does not rely on insane edge cases like:
+ // Bind buffer with ADDR = 8, use block offset of 8 bytes, load/store with 16 byte alignment.
+ // If we emit the buffer with alignment = 16 here, the first element at offset = 0 should
+ // actually have alignment of 8 bytes, but this is too theoretical and awkward to support.
+ // We could potentially keep track of any offset in the access chain, but it's
+ // practically impossible for high level compilers to emit code like that,
+ // so deducing overall alignment requirement based on maximum observed Alignment value is probably fine.
+ if (meta && alignment > meta->alignment)
+ meta->alignment = alignment;
+ }
+}
+
+bool Compiler::PhysicalStorageBufferPointerHandler::type_is_bda_block_entry(uint32_t type_id) const
+{
+ auto &type = compiler.get<SPIRType>(type_id);
+ return type.storage == StorageClassPhysicalStorageBufferEXT && type.pointer &&
+ type.pointer_depth == 1 && !compiler.type_is_array_of_pointers(type);
+}
+
+uint32_t Compiler::PhysicalStorageBufferPointerHandler::get_minimum_scalar_alignment(const SPIRType &type) const
{
- if (op == OpConvertUToPtr || op == OpBitcast)
+ if (type.storage == spv::StorageClassPhysicalStorageBufferEXT)
+ return 8;
+ else if (type.basetype == SPIRType::Struct)
{
- auto &type = compiler.get<SPIRType>(args[0]);
- if (type.storage == StorageClassPhysicalStorageBufferEXT && type.pointer && type.pointer_depth == 1)
+ uint32_t alignment = 0;
+ for (auto &member_type : type.member_types)
{
- // If we need to cast to a pointer type which is not a block, we might need to synthesize ourselves
- // a block type which wraps this POD type.
- if (type.basetype != SPIRType::Struct)
- types.insert(args[0]);
+ uint32_t member_align = get_minimum_scalar_alignment(compiler.get<SPIRType>(member_type));
+ if (member_align > alignment)
+ alignment = member_align;
}
+ return alignment;
+ }
+ else
+ return type.width / 8;
+}
+
+void Compiler::PhysicalStorageBufferPointerHandler::setup_meta_chain(uint32_t type_id, uint32_t var_id)
+{
+ if (type_is_bda_block_entry(type_id))
+ {
+ auto &meta = physical_block_type_meta[type_id];
+ access_chain_to_physical_block[var_id] = &meta;
+
+ auto &type = compiler.get<SPIRType>(type_id);
+ if (type.basetype != SPIRType::Struct)
+ non_block_types.insert(type_id);
+
+ if (meta.alignment == 0)
+ meta.alignment = get_minimum_scalar_alignment(compiler.get_pointee_type(type));
+ }
+}
+
+bool Compiler::PhysicalStorageBufferPointerHandler::handle(Op op, const uint32_t *args, uint32_t length)
+{
+ // When a BDA pointer comes to life, we need to keep a mapping of SSA ID -> type ID for the pointer type.
+ // For every load and store, we'll need to be able to look up the type ID being accessed and mark any alignment
+ // requirements.
+ switch (op)
+ {
+ case OpConvertUToPtr:
+ case OpBitcast:
+ case OpCompositeExtract:
+ // Extract can begin a new chain if we had a struct or array of pointers as input.
+ // We don't begin chains before we have a pure scalar pointer.
+ setup_meta_chain(args[0], args[1]);
+ break;
+
+ case OpAccessChain:
+ case OpInBoundsAccessChain:
+ case OpPtrAccessChain:
+ case OpCopyObject:
+ {
+ auto itr = access_chain_to_physical_block.find(args[2]);
+ if (itr != access_chain_to_physical_block.end())
+ access_chain_to_physical_block[args[1]] = itr->second;
+ break;
+ }
+
+ case OpLoad:
+ {
+ setup_meta_chain(args[0], args[1]);
+ if (length >= 4)
+ mark_aligned_access(args[2], args + 3, length - 3);
+ break;
+ }
+
+ case OpStore:
+ {
+ if (length >= 3)
+ mark_aligned_access(args[0], args + 2, length - 2);
+ break;
+ }
+
+ default:
+ break;
}
return true;
}
+uint32_t Compiler::PhysicalStorageBufferPointerHandler::get_base_non_block_type_id(uint32_t type_id) const
+{
+ auto *type = &compiler.get<SPIRType>(type_id);
+ while (type->pointer &&
+ type->storage == StorageClassPhysicalStorageBufferEXT &&
+ !type_is_bda_block_entry(type_id))
+ {
+ type_id = type->parent_type;
+ type = &compiler.get<SPIRType>(type_id);
+ }
+
+ assert(type_is_bda_block_entry(type_id));
+ return type_id;
+}
+
+void Compiler::PhysicalStorageBufferPointerHandler::analyze_non_block_types_from_block(const SPIRType &type)
+{
+ for (auto &member : type.member_types)
+ {
+ auto &subtype = compiler.get<SPIRType>(member);
+ if (subtype.basetype != SPIRType::Struct && subtype.pointer &&
+ subtype.storage == spv::StorageClassPhysicalStorageBufferEXT)
+ {
+ non_block_types.insert(get_base_non_block_type_id(member));
+ }
+ else if (subtype.basetype == SPIRType::Struct && !subtype.pointer)
+ analyze_non_block_types_from_block(subtype);
+ }
+}
+
void Compiler::analyze_non_block_pointer_types()
{
PhysicalStorageBufferPointerHandler handler(*this);
traverse_all_reachable_opcodes(get<SPIRFunction>(ir.default_entry_point), handler);
- physical_storage_non_block_pointer_types.reserve(handler.types.size());
- for (auto type : handler.types)
+
+ // Analyze any block declaration we have to make. It might contain
+ // physical pointers to POD types which we never used, and thus never added to the list.
+ // We'll need to add those pointer types to the set of types we declare.
+ ir.for_each_typed_id<SPIRType>([&](uint32_t, SPIRType &type) {
+ if (has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock))
+ handler.analyze_non_block_types_from_block(type);
+ });
+
+ physical_storage_non_block_pointer_types.reserve(handler.non_block_types.size());
+ for (auto type : handler.non_block_types)
physical_storage_non_block_pointer_types.push_back(type);
sort(begin(physical_storage_non_block_pointer_types), end(physical_storage_non_block_pointer_types));
+ physical_storage_type_to_alignment = std::move(handler.physical_block_type_meta);
}
bool Compiler::InterlockedResourceAccessPrepassHandler::handle(Op op, const uint32_t *, uint32_t)
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.hpp
index 27308601a14..789010faf1d 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross.hpp
@@ -24,6 +24,9 @@
#ifndef SPIRV_CROSS_HPP
#define SPIRV_CROSS_HPP
+#ifndef SPV_ENABLE_UTILITY_CODE
+#define SPV_ENABLE_UTILITY_CODE
+#endif
#include "spirv.hpp"
#include "spirv_cfg.hpp"
#include "spirv_cross_parsed_ir.hpp"
@@ -96,6 +99,8 @@ struct ShaderResources
// but keep the vector in case this restriction is lifted in the future.
SmallVector<Resource> push_constant_buffers;
+ SmallVector<Resource> shader_record_buffers;
+
// For Vulkan GLSL and HLSL source,
// these correspond to separate texture2D and samplers respectively.
SmallVector<Resource> separate_images;
@@ -357,12 +362,16 @@ public:
void set_execution_mode(spv::ExecutionMode mode, uint32_t arg0 = 0, uint32_t arg1 = 0, uint32_t arg2 = 0);
// Gets argument for an execution mode (LocalSize, Invocations, OutputVertices).
- // For LocalSize, the index argument is used to select the dimension (X = 0, Y = 1, Z = 2).
+ // For LocalSize or LocalSizeId, the index argument is used to select the dimension (X = 0, Y = 1, Z = 2).
// For execution modes which do not have arguments, 0 is returned.
+ // LocalSizeId query returns an ID. If LocalSizeId execution mode is not used, it returns 0.
+ // LocalSize always returns a literal. If execution mode is LocalSizeId,
+ // the literal (spec constant or not) is still returned.
uint32_t get_execution_mode_argument(spv::ExecutionMode mode, uint32_t index = 0) const;
spv::ExecutionModel get_execution_model() const;
bool is_tessellation_shader() const;
+ bool is_tessellating_triangles() const;
// In SPIR-V, the compute work group size can be represented by a constant vector, in which case
// the LocalSize execution mode is ignored.
@@ -380,6 +389,8 @@ public:
// If the component is not a specialization constant, a zeroed out struct will be written.
// The return value is the constant ID of the builtin WorkGroupSize, but this is not expected to be useful
// for most use cases.
+ // If LocalSizeId is used, there is no uvec3 value representing the workgroup size, so the return value is 0,
+ // but x, y and z are written as normal if the components are specialization constants.
uint32_t get_work_group_size_specialization_constants(SpecializationConstant &x, SpecializationConstant &y,
SpecializationConstant &z) const;
@@ -551,6 +562,11 @@ protected:
}
}
+ uint32_t *stream_mutable(const Instruction &instr) const
+ {
+ return const_cast<uint32_t *>(stream(instr));
+ }
+
ParsedIR ir;
// Marks variables which have global scope and variables which can alias with other variables
// (SSBO, image load store, etc)
@@ -730,9 +746,11 @@ protected:
SPIRBlock::ContinueBlockType continue_block_type(const SPIRBlock &continue_block) const;
void force_recompile();
+ void force_recompile_guarantee_forward_progress();
void clear_force_recompile();
bool is_forcing_recompilation() const;
bool is_force_recompile = false;
+ bool is_force_recompile_forward_progress = false;
bool block_is_loop_candidate(const SPIRBlock &block, SPIRBlock::Method method) const;
@@ -740,6 +758,7 @@ protected:
void inherit_expression_dependencies(uint32_t dst, uint32_t source);
void add_implied_read_expression(SPIRExpression &e, uint32_t source);
void add_implied_read_expression(SPIRAccessChain &e, uint32_t source);
+ void add_active_interface_variable(uint32_t var_id);
// For proper multiple entry point support, allow querying if an Input or Output
// variable is part of that entry points interface.
@@ -915,6 +934,7 @@ protected:
// Similar is implemented for images, as well as if subpass inputs are needed.
std::unordered_set<uint32_t> comparison_ids;
bool need_subpass_input = false;
+ bool need_subpass_input_ms = false;
// In certain backends, we will need to use a dummy sampler to be able to emit code.
// GLSL does not support texelFetch on texture2D objects, but SPIR-V does,
@@ -954,6 +974,7 @@ protected:
void add_hierarchy_to_comparison_ids(uint32_t ids);
bool need_subpass_input = false;
+ bool need_subpass_input_ms = false;
void add_dependency(uint32_t dst, uint32_t src);
};
@@ -1010,15 +1031,32 @@ protected:
uint32_t write_count = 0;
};
+ struct PhysicalBlockMeta
+ {
+ uint32_t alignment = 0;
+ };
+
struct PhysicalStorageBufferPointerHandler : OpcodeHandler
{
explicit PhysicalStorageBufferPointerHandler(Compiler &compiler_);
bool handle(spv::Op op, const uint32_t *args, uint32_t length) override;
Compiler &compiler;
- std::unordered_set<uint32_t> types;
+
+ std::unordered_set<uint32_t> non_block_types;
+ std::unordered_map<uint32_t, PhysicalBlockMeta> physical_block_type_meta;
+ std::unordered_map<uint32_t, PhysicalBlockMeta *> access_chain_to_physical_block;
+
+ void mark_aligned_access(uint32_t id, const uint32_t *args, uint32_t length);
+ PhysicalBlockMeta *find_block_meta(uint32_t id) const;
+ bool type_is_bda_block_entry(uint32_t type_id) const;
+ void setup_meta_chain(uint32_t type_id, uint32_t var_id);
+ uint32_t get_minimum_scalar_alignment(const SPIRType &type) const;
+ void analyze_non_block_types_from_block(const SPIRType &type);
+ uint32_t get_base_non_block_type_id(uint32_t type_id) const;
};
void analyze_non_block_pointer_types();
SmallVector<uint32_t> physical_storage_non_block_pointer_types;
+ std::unordered_map<uint32_t, PhysicalBlockMeta> physical_storage_type_to_alignment;
void analyze_variable_scope(SPIRFunction &function, AnalyzeVariableScopeAccessHandler &handler);
void find_function_local_luts(SPIRFunction &function, const AnalyzeVariableScopeAccessHandler &handler,
@@ -1090,7 +1128,7 @@ protected:
Bitset combined_decoration_for_member(const SPIRType &type, uint32_t index) const;
static bool is_desktop_only_format(spv::ImageFormat format);
- bool image_is_comparison(const SPIRType &type, uint32_t id) const;
+ bool is_depth_image(const SPIRType &type, uint32_t id) const;
void set_extended_decoration(uint32_t id, ExtendedDecorations decoration, uint32_t value = 0);
uint32_t get_extended_decoration(uint32_t id, ExtendedDecorations decoration) const;
@@ -1118,6 +1156,11 @@ protected:
bool is_vertex_like_shader() const;
+ // Get the correct case list for the OpSwitch, since it can be either a
+ // 32 bit wide condition or a 64 bit, but the type is not embedded in the
+ // instruction itself.
+ const SmallVector<SPIRBlock::Case> &get_case_list(const SPIRBlock &block) const;
+
private:
// Used only to implement the old deprecated get_entry_point() interface.
const SPIREntryPoint &get_first_entry_point(const std::string &name) const;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp
index 4d5615404e2..4d8e40759d8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.cpp
@@ -194,6 +194,7 @@ struct spvc_resources_s : ScratchMemoryAllocation
SmallVector<spvc_reflected_resource> sampled_images;
SmallVector<spvc_reflected_resource> atomic_counters;
SmallVector<spvc_reflected_resource> push_constant_buffers;
+ SmallVector<spvc_reflected_resource> shader_record_buffers;
SmallVector<spvc_reflected_resource> separate_images;
SmallVector<spvc_reflected_resource> separate_samplers;
SmallVector<spvc_reflected_resource> acceleration_structures;
@@ -251,7 +252,7 @@ spvc_result spvc_context_parse_spirv(spvc_context context, const SpvId *spirv, s
pir->context = context;
Parser parser(spirv, word_count);
parser.parse();
- pir->parsed = move(parser.get_parsed_ir());
+ pir->parsed = std::move(parser.get_parsed_ir());
*parsed_ir = pir.get();
context->allocations.push_back(std::move(pir));
}
@@ -283,7 +284,7 @@ spvc_result spvc_context_create_compiler(spvc_context context, spvc_backend back
{
case SPVC_BACKEND_NONE:
if (mode == SPVC_CAPTURE_MODE_TAKE_OWNERSHIP)
- comp->compiler.reset(new Compiler(move(parsed_ir->parsed)));
+ comp->compiler.reset(new Compiler(std::move(parsed_ir->parsed)));
else if (mode == SPVC_CAPTURE_MODE_COPY)
comp->compiler.reset(new Compiler(parsed_ir->parsed));
break;
@@ -291,7 +292,7 @@ spvc_result spvc_context_create_compiler(spvc_context context, spvc_backend back
#if SPIRV_CROSS_C_API_GLSL
case SPVC_BACKEND_GLSL:
if (mode == SPVC_CAPTURE_MODE_TAKE_OWNERSHIP)
- comp->compiler.reset(new CompilerGLSL(move(parsed_ir->parsed)));
+ comp->compiler.reset(new CompilerGLSL(std::move(parsed_ir->parsed)));
else if (mode == SPVC_CAPTURE_MODE_COPY)
comp->compiler.reset(new CompilerGLSL(parsed_ir->parsed));
break;
@@ -300,7 +301,7 @@ spvc_result spvc_context_create_compiler(spvc_context context, spvc_backend back
#if SPIRV_CROSS_C_API_HLSL
case SPVC_BACKEND_HLSL:
if (mode == SPVC_CAPTURE_MODE_TAKE_OWNERSHIP)
- comp->compiler.reset(new CompilerHLSL(move(parsed_ir->parsed)));
+ comp->compiler.reset(new CompilerHLSL(std::move(parsed_ir->parsed)));
else if (mode == SPVC_CAPTURE_MODE_COPY)
comp->compiler.reset(new CompilerHLSL(parsed_ir->parsed));
break;
@@ -309,7 +310,7 @@ spvc_result spvc_context_create_compiler(spvc_context context, spvc_backend back
#if SPIRV_CROSS_C_API_MSL
case SPVC_BACKEND_MSL:
if (mode == SPVC_CAPTURE_MODE_TAKE_OWNERSHIP)
- comp->compiler.reset(new CompilerMSL(move(parsed_ir->parsed)));
+ comp->compiler.reset(new CompilerMSL(std::move(parsed_ir->parsed)));
else if (mode == SPVC_CAPTURE_MODE_COPY)
comp->compiler.reset(new CompilerMSL(parsed_ir->parsed));
break;
@@ -318,7 +319,7 @@ spvc_result spvc_context_create_compiler(spvc_context context, spvc_backend back
#if SPIRV_CROSS_C_API_CPP
case SPVC_BACKEND_CPP:
if (mode == SPVC_CAPTURE_MODE_TAKE_OWNERSHIP)
- comp->compiler.reset(new CompilerCPP(move(parsed_ir->parsed)));
+ comp->compiler.reset(new CompilerCPP(std::move(parsed_ir->parsed)));
else if (mode == SPVC_CAPTURE_MODE_COPY)
comp->compiler.reset(new CompilerCPP(parsed_ir->parsed));
break;
@@ -327,7 +328,7 @@ spvc_result spvc_context_create_compiler(spvc_context context, spvc_backend back
#if SPIRV_CROSS_C_API_REFLECT
case SPVC_BACKEND_JSON:
if (mode == SPVC_CAPTURE_MODE_TAKE_OWNERSHIP)
- comp->compiler.reset(new CompilerReflection(move(parsed_ir->parsed)));
+ comp->compiler.reset(new CompilerReflection(std::move(parsed_ir->parsed)));
else if (mode == SPVC_CAPTURE_MODE_COPY)
comp->compiler.reset(new CompilerReflection(parsed_ir->parsed));
break;
@@ -475,6 +476,9 @@ spvc_result spvc_compiler_options_set_uint(spvc_compiler_options options, spvc_c
case SPVC_COMPILER_OPTION_GLSL_OVR_MULTIVIEW_VIEW_COUNT:
options->glsl.ovr_multiview_view_count = value;
break;
+ case SPVC_COMPILER_OPTION_RELAX_NAN_CHECKS:
+ options->glsl.relax_nan_checks = value != 0;
+ break;
#endif
#if SPIRV_CROSS_C_API_HLSL
@@ -711,6 +715,22 @@ spvc_result spvc_compiler_options_set_uint(spvc_compiler_options options, spvc_c
case SPVC_COMPILER_OPTION_MSL_IOS_SUPPORT_BASE_VERTEX_INSTANCE:
options->msl.ios_support_base_vertex_instance = value != 0;
break;
+
+ case SPVC_COMPILER_OPTION_MSL_RAW_BUFFER_TESE_INPUT:
+ options->msl.raw_buffer_tese_input = value != 0;
+ break;
+
+ case SPVC_COMPILER_OPTION_MSL_SHADER_PATCH_INPUT_BUFFER_INDEX:
+ options->msl.shader_patch_input_buffer_index = value;
+ break;
+
+ case SPVC_COMPILER_OPTION_MSL_MANUAL_HELPER_INVOCATION_UPDATES:
+ options->msl.manual_helper_invocation_updates = value != 0;
+ break;
+
+ case SPVC_COMPILER_OPTION_MSL_CHECK_DISCARDED_FRAG_STORES:
+ options->msl.check_discarded_frag_stores = value != 0;
+ break;
#endif
default:
@@ -1133,9 +1153,9 @@ spvc_result spvc_compiler_msl_add_vertex_attribute(spvc_compiler compiler, const
}
auto &msl = *static_cast<CompilerMSL *>(compiler->compiler.get());
- MSLShaderInput attr;
+ MSLShaderInterfaceVariable attr;
attr.location = va->location;
- attr.format = static_cast<MSLShaderInputFormat>(va->format);
+ attr.format = static_cast<MSLShaderVariableFormat>(va->format);
attr.builtin = static_cast<spv::BuiltIn>(va->builtin);
msl.add_msl_shader_input(attr);
return SPVC_SUCCESS;
@@ -1146,7 +1166,7 @@ spvc_result spvc_compiler_msl_add_vertex_attribute(spvc_compiler compiler, const
#endif
}
-spvc_result spvc_compiler_msl_add_shader_input(spvc_compiler compiler, const spvc_msl_shader_input *si)
+spvc_result spvc_compiler_msl_add_shader_input(spvc_compiler compiler, const spvc_msl_shader_interface_var *si)
{
#if SPIRV_CROSS_C_API_MSL
if (compiler->backend != SPVC_BACKEND_MSL)
@@ -1156,9 +1176,9 @@ spvc_result spvc_compiler_msl_add_shader_input(spvc_compiler compiler, const spv
}
auto &msl = *static_cast<CompilerMSL *>(compiler->compiler.get());
- MSLShaderInput input;
+ MSLShaderInterfaceVariable input;
input.location = si->location;
- input.format = static_cast<MSLShaderInputFormat>(si->format);
+ input.format = static_cast<MSLShaderVariableFormat>(si->format);
input.builtin = static_cast<spv::BuiltIn>(si->builtin);
input.vecsize = si->vecsize;
msl.add_msl_shader_input(input);
@@ -1170,6 +1190,80 @@ spvc_result spvc_compiler_msl_add_shader_input(spvc_compiler compiler, const spv
#endif
}
+spvc_result spvc_compiler_msl_add_shader_input_2(spvc_compiler compiler, const spvc_msl_shader_interface_var_2 *si)
+{
+#if SPIRV_CROSS_C_API_MSL
+ if (compiler->backend != SPVC_BACKEND_MSL)
+ {
+ compiler->context->report_error("MSL function used on a non-MSL backend.");
+ return SPVC_ERROR_INVALID_ARGUMENT;
+ }
+
+ auto &msl = *static_cast<CompilerMSL *>(compiler->compiler.get());
+ MSLShaderInterfaceVariable input;
+ input.location = si->location;
+ input.format = static_cast<MSLShaderVariableFormat>(si->format);
+ input.builtin = static_cast<spv::BuiltIn>(si->builtin);
+ input.vecsize = si->vecsize;
+ input.rate = static_cast<MSLShaderVariableRate>(si->rate);
+ msl.add_msl_shader_input(input);
+ return SPVC_SUCCESS;
+#else
+ (void)si;
+ compiler->context->report_error("MSL function used on a non-MSL backend.");
+ return SPVC_ERROR_INVALID_ARGUMENT;
+#endif
+}
+
+spvc_result spvc_compiler_msl_add_shader_output(spvc_compiler compiler, const spvc_msl_shader_interface_var *so)
+{
+#if SPIRV_CROSS_C_API_MSL
+ if (compiler->backend != SPVC_BACKEND_MSL)
+ {
+ compiler->context->report_error("MSL function used on a non-MSL backend.");
+ return SPVC_ERROR_INVALID_ARGUMENT;
+ }
+
+ auto &msl = *static_cast<CompilerMSL *>(compiler->compiler.get());
+ MSLShaderInterfaceVariable output;
+ output.location = so->location;
+ output.format = static_cast<MSLShaderVariableFormat>(so->format);
+ output.builtin = static_cast<spv::BuiltIn>(so->builtin);
+ output.vecsize = so->vecsize;
+ msl.add_msl_shader_output(output);
+ return SPVC_SUCCESS;
+#else
+ (void)so;
+ compiler->context->report_error("MSL function used on a non-MSL backend.");
+ return SPVC_ERROR_INVALID_ARGUMENT;
+#endif
+}
+
+spvc_result spvc_compiler_msl_add_shader_output_2(spvc_compiler compiler, const spvc_msl_shader_interface_var_2 *so)
+{
+#if SPIRV_CROSS_C_API_MSL
+ if (compiler->backend != SPVC_BACKEND_MSL)
+ {
+ compiler->context->report_error("MSL function used on a non-MSL backend.");
+ return SPVC_ERROR_INVALID_ARGUMENT;
+ }
+
+ auto &msl = *static_cast<CompilerMSL *>(compiler->compiler.get());
+ MSLShaderInterfaceVariable output;
+ output.location = so->location;
+ output.format = static_cast<MSLShaderVariableFormat>(so->format);
+ output.builtin = static_cast<spv::BuiltIn>(so->builtin);
+ output.vecsize = so->vecsize;
+ output.rate = static_cast<MSLShaderVariableRate>(so->rate);
+ msl.add_msl_shader_output(output);
+ return SPVC_SUCCESS;
+#else
+ (void)so;
+ compiler->context->report_error("MSL function used on a non-MSL backend.");
+ return SPVC_ERROR_INVALID_ARGUMENT;
+#endif
+}
+
spvc_result spvc_compiler_msl_add_resource_binding(spvc_compiler compiler,
const spvc_msl_resource_binding *binding)
{
@@ -1295,6 +1389,24 @@ spvc_bool spvc_compiler_msl_is_shader_input_used(spvc_compiler compiler, unsigne
#endif
}
+spvc_bool spvc_compiler_msl_is_shader_output_used(spvc_compiler compiler, unsigned location)
+{
+#if SPIRV_CROSS_C_API_MSL
+ if (compiler->backend != SPVC_BACKEND_MSL)
+ {
+ compiler->context->report_error("MSL function used on a non-MSL backend.");
+ return SPVC_FALSE;
+ }
+
+ auto &msl = *static_cast<CompilerMSL *>(compiler->compiler.get());
+ return msl.is_msl_shader_output_used(location) ? SPVC_TRUE : SPVC_FALSE;
+#else
+ (void)location;
+ compiler->context->report_error("MSL function used on a non-MSL backend.");
+ return SPVC_FALSE;
+#endif
+}
+
spvc_bool spvc_compiler_msl_is_vertex_attribute_used(spvc_compiler compiler, unsigned location)
{
return spvc_compiler_msl_is_shader_input_used(compiler, location);
@@ -1639,6 +1751,8 @@ bool spvc_resources_s::copy_resources(const ShaderResources &resources)
return false;
if (!copy_resources(push_constant_buffers, resources.push_constant_buffers))
return false;
+ if (!copy_resources(shader_record_buffers, resources.shader_record_buffers))
+ return false;
if (!copy_resources(separate_images, resources.separate_images))
return false;
if (!copy_resources(separate_samplers, resources.separate_samplers))
@@ -1792,6 +1906,10 @@ spvc_result spvc_resources_get_resource_list_for_type(spvc_resources resources,
list = &resources->acceleration_structures;
break;
+ case SPVC_RESOURCE_TYPE_SHADER_RECORD_BUFFER:
+ list = &resources->shader_record_buffers;
+ break;
+
default:
break;
}
@@ -2508,7 +2626,7 @@ void spvc_msl_vertex_attribute_init(spvc_msl_vertex_attribute *attr)
{
#if SPIRV_CROSS_C_API_MSL
// Crude, but works.
- MSLShaderInput attr_default;
+ MSLShaderInterfaceVariable attr_default;
attr->location = attr_default.location;
attr->format = static_cast<spvc_msl_vertex_format>(attr_default.format);
attr->builtin = static_cast<SpvBuiltIn>(attr_default.builtin);
@@ -2517,16 +2635,35 @@ void spvc_msl_vertex_attribute_init(spvc_msl_vertex_attribute *attr)
#endif
}
+void spvc_msl_shader_interface_var_init(spvc_msl_shader_interface_var *var)
+{
+#if SPIRV_CROSS_C_API_MSL
+ MSLShaderInterfaceVariable var_default;
+ var->location = var_default.location;
+ var->format = static_cast<spvc_msl_shader_variable_format>(var_default.format);
+ var->builtin = static_cast<SpvBuiltIn>(var_default.builtin);
+ var->vecsize = var_default.vecsize;
+#else
+ memset(var, 0, sizeof(*var));
+#endif
+}
+
void spvc_msl_shader_input_init(spvc_msl_shader_input *input)
{
+ spvc_msl_shader_interface_var_init(input);
+}
+
+void spvc_msl_shader_interface_var_init_2(spvc_msl_shader_interface_var_2 *var)
+{
#if SPIRV_CROSS_C_API_MSL
- MSLShaderInput input_default;
- input->location = input_default.location;
- input->format = static_cast<spvc_msl_shader_input_format>(input_default.format);
- input->builtin = static_cast<SpvBuiltIn>(input_default.builtin);
- input->vecsize = input_default.vecsize;
+ MSLShaderInterfaceVariable var_default;
+ var->location = var_default.location;
+ var->format = static_cast<spvc_msl_shader_variable_format>(var_default.format);
+ var->builtin = static_cast<SpvBuiltIn>(var_default.builtin);
+ var->vecsize = var_default.vecsize;
+ var->rate = static_cast<spvc_msl_shader_variable_rate>(var_default.rate);
#else
- memset(input, 0, sizeof(*input));
+ memset(var, 0, sizeof(*var));
#endif
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.h b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.h
index a590c805a9d..601a6cfb0eb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_c.h
+++ b/3rdparty/bgfx/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 48
+#define SPVC_C_API_VERSION_MINOR 52
/* Bumped if internal implementation details change. */
#define SPVC_C_API_VERSION_PATCH 0
@@ -225,6 +225,7 @@ typedef enum spvc_resource_type
SPVC_RESOURCE_TYPE_SEPARATE_SAMPLERS = 11,
SPVC_RESOURCE_TYPE_ACCELERATION_STRUCTURE = 12,
SPVC_RESOURCE_TYPE_RAY_QUERY = 13,
+ SPVC_RESOURCE_TYPE_SHADER_RECORD_BUFFER = 14,
SPVC_RESOURCE_TYPE_INT_MAX = 0x7fffffff
} spvc_resource_type;
@@ -290,23 +291,29 @@ typedef enum spvc_msl_index_type
} spvc_msl_index_type;
/* Maps to C++ API. */
-typedef enum spvc_msl_shader_input_format
+typedef enum spvc_msl_shader_variable_format
{
- SPVC_MSL_SHADER_INPUT_FORMAT_OTHER = 0,
- SPVC_MSL_SHADER_INPUT_FORMAT_UINT8 = 1,
- SPVC_MSL_SHADER_INPUT_FORMAT_UINT16 = 2,
- SPVC_MSL_SHADER_INPUT_FORMAT_ANY16 = 3,
- SPVC_MSL_SHADER_INPUT_FORMAT_ANY32 = 4,
+ SPVC_MSL_SHADER_VARIABLE_FORMAT_OTHER = 0,
+ SPVC_MSL_SHADER_VARIABLE_FORMAT_UINT8 = 1,
+ SPVC_MSL_SHADER_VARIABLE_FORMAT_UINT16 = 2,
+ SPVC_MSL_SHADER_VARIABLE_FORMAT_ANY16 = 3,
+ SPVC_MSL_SHADER_VARIABLE_FORMAT_ANY32 = 4,
/* Deprecated names. */
- SPVC_MSL_VERTEX_FORMAT_OTHER = SPVC_MSL_SHADER_INPUT_FORMAT_OTHER,
- SPVC_MSL_VERTEX_FORMAT_UINT8 = SPVC_MSL_SHADER_INPUT_FORMAT_UINT8,
- SPVC_MSL_VERTEX_FORMAT_UINT16 = SPVC_MSL_SHADER_INPUT_FORMAT_UINT16,
+ SPVC_MSL_VERTEX_FORMAT_OTHER = SPVC_MSL_SHADER_VARIABLE_FORMAT_OTHER,
+ SPVC_MSL_VERTEX_FORMAT_UINT8 = SPVC_MSL_SHADER_VARIABLE_FORMAT_UINT8,
+ SPVC_MSL_VERTEX_FORMAT_UINT16 = SPVC_MSL_SHADER_VARIABLE_FORMAT_UINT16,
+ SPVC_MSL_SHADER_INPUT_FORMAT_OTHER = SPVC_MSL_SHADER_VARIABLE_FORMAT_OTHER,
+ SPVC_MSL_SHADER_INPUT_FORMAT_UINT8 = SPVC_MSL_SHADER_VARIABLE_FORMAT_UINT8,
+ SPVC_MSL_SHADER_INPUT_FORMAT_UINT16 = SPVC_MSL_SHADER_VARIABLE_FORMAT_UINT16,
+ SPVC_MSL_SHADER_INPUT_FORMAT_ANY16 = SPVC_MSL_SHADER_VARIABLE_FORMAT_ANY16,
+ SPVC_MSL_SHADER_INPUT_FORMAT_ANY32 = SPVC_MSL_SHADER_VARIABLE_FORMAT_ANY32,
+
SPVC_MSL_SHADER_INPUT_FORMAT_INT_MAX = 0x7fffffff
-} spvc_msl_shader_input_format, spvc_msl_vertex_format;
+} spvc_msl_shader_variable_format, spvc_msl_shader_input_format, spvc_msl_vertex_format;
-/* Maps to C++ API. Deprecated; use spvc_msl_shader_input. */
+/* Maps to C++ API. Deprecated; use spvc_msl_shader_interface_var. */
typedef struct spvc_msl_vertex_attribute
{
unsigned location;
@@ -329,21 +336,51 @@ typedef struct spvc_msl_vertex_attribute
*/
SPVC_PUBLIC_API void spvc_msl_vertex_attribute_init(spvc_msl_vertex_attribute *attr);
-/* Maps to C++ API. */
-typedef struct spvc_msl_shader_input
+/* Maps to C++ API. Deprecated; use spvc_msl_shader_interface_var_2. */
+typedef struct spvc_msl_shader_interface_var
{
unsigned location;
spvc_msl_vertex_format format;
SpvBuiltIn builtin;
unsigned vecsize;
-} spvc_msl_shader_input;
+} spvc_msl_shader_interface_var, spvc_msl_shader_input;
/*
* Initializes the shader input struct.
+ * Deprecated. Use spvc_msl_shader_interface_var_init_2().
+ */
+SPVC_PUBLIC_API void spvc_msl_shader_interface_var_init(spvc_msl_shader_interface_var *var);
+/*
+ * Deprecated. Use spvc_msl_shader_interface_var_init_2().
*/
SPVC_PUBLIC_API void spvc_msl_shader_input_init(spvc_msl_shader_input *input);
/* Maps to C++ API. */
+typedef enum spvc_msl_shader_variable_rate
+{
+ SPVC_MSL_SHADER_VARIABLE_RATE_PER_VERTEX = 0,
+ SPVC_MSL_SHADER_VARIABLE_RATE_PER_PRIMITIVE = 1,
+ SPVC_MSL_SHADER_VARIABLE_RATE_PER_PATCH = 2,
+
+ SPVC_MSL_SHADER_VARIABLE_RATE_INT_MAX = 0x7fffffff,
+} spvc_msl_shader_variable_rate;
+
+/* Maps to C++ API. */
+typedef struct spvc_msl_shader_interface_var_2
+{
+ unsigned location;
+ spvc_msl_shader_variable_format format;
+ SpvBuiltIn builtin;
+ unsigned vecsize;
+ spvc_msl_shader_variable_rate rate;
+} spvc_msl_shader_interface_var_2;
+
+/*
+ * Initializes the shader interface variable struct.
+ */
+SPVC_PUBLIC_API void spvc_msl_shader_interface_var_init_2(spvc_msl_shader_interface_var_2 *var);
+
+/* Maps to C++ API. */
typedef struct spvc_msl_resource_binding
{
SpvExecutionModel stage;
@@ -677,6 +714,13 @@ typedef enum spvc_compiler_option
SPVC_COMPILER_OPTION_GLSL_OVR_MULTIVIEW_VIEW_COUNT = 77 | SPVC_COMPILER_OPTION_GLSL_BIT,
+ SPVC_COMPILER_OPTION_RELAX_NAN_CHECKS = 78 | SPVC_COMPILER_OPTION_COMMON_BIT,
+
+ SPVC_COMPILER_OPTION_MSL_RAW_BUFFER_TESE_INPUT = 79 | SPVC_COMPILER_OPTION_MSL_BIT,
+ SPVC_COMPILER_OPTION_MSL_SHADER_PATCH_INPUT_BUFFER_INDEX = 80 | SPVC_COMPILER_OPTION_MSL_BIT,
+ 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_INT_MAX = 0x7fffffff
} spvc_compiler_option;
@@ -783,14 +827,23 @@ SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_vertex_attribute(spvc_compiler
const spvc_msl_vertex_attribute *attrs);
SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_resource_binding(spvc_compiler compiler,
const spvc_msl_resource_binding *binding);
+/* Deprecated; use spvc_compiler_msl_add_shader_input_2(). */
SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_shader_input(spvc_compiler compiler,
- const spvc_msl_shader_input *input);
+ const spvc_msl_shader_interface_var *input);
+SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_shader_input_2(spvc_compiler compiler,
+ const spvc_msl_shader_interface_var_2 *input);
+/* Deprecated; use spvc_compiler_msl_add_shader_output_2(). */
+SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_shader_output(spvc_compiler compiler,
+ const spvc_msl_shader_interface_var *output);
+SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_shader_output_2(spvc_compiler compiler,
+ const spvc_msl_shader_interface_var_2 *output);
SPVC_PUBLIC_API spvc_result spvc_compiler_msl_add_discrete_descriptor_set(spvc_compiler compiler, unsigned desc_set);
SPVC_PUBLIC_API spvc_result spvc_compiler_msl_set_argument_buffer_device_address_space(spvc_compiler compiler, unsigned desc_set, spvc_bool device_address);
/* Obsolete, use is_shader_input_used. */
SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_is_vertex_attribute_used(spvc_compiler compiler, unsigned location);
SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_is_shader_input_used(spvc_compiler compiler, unsigned location);
+SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_is_shader_output_used(spvc_compiler compiler, unsigned location);
SPVC_PUBLIC_API spvc_bool spvc_compiler_msl_is_resource_used(spvc_compiler compiler,
SpvExecutionModel model,
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_containers.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_containers.hpp
index f2179b4ed35..1b32870e55d 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_containers.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_containers.hpp
@@ -210,7 +210,8 @@ public:
buffer_capacity = N;
}
- SmallVector(const T *arg_list_begin, const T *arg_list_end) SPIRV_CROSS_NOEXCEPT : SmallVector()
+ template <typename U>
+ SmallVector(const U *arg_list_begin, const U *arg_list_end) SPIRV_CROSS_NOEXCEPT : SmallVector()
{
auto count = size_t(arg_list_end - arg_list_begin);
reserve(count);
@@ -219,7 +220,13 @@ public:
this->buffer_size = count;
}
- SmallVector(std::initializer_list<T> init) SPIRV_CROSS_NOEXCEPT : SmallVector(init.begin(), init.end())
+ template <typename U>
+ SmallVector(std::initializer_list<U> init) SPIRV_CROSS_NOEXCEPT : SmallVector(init.begin(), init.end())
+ {
+ }
+
+ template <typename U, size_t M>
+ SmallVector(const U (&init)[M]) SPIRV_CROSS_NOEXCEPT : SmallVector(init, init + M)
{
}
@@ -327,8 +334,8 @@ public:
void reserve(size_t count) SPIRV_CROSS_NOEXCEPT
{
- if ((count > std::numeric_limits<size_t>::max() / sizeof(T)) ||
- (count > std::numeric_limits<size_t>::max() / 2))
+ if ((count > (std::numeric_limits<size_t>::max)() / sizeof(T)) ||
+ (count > (std::numeric_limits<size_t>::max)() / 2))
{
// Only way this should ever happen is with garbage input, terminate.
std::terminate();
@@ -546,7 +553,7 @@ class ObjectPoolBase
{
public:
virtual ~ObjectPoolBase() = default;
- virtual void free_opaque(void *ptr) = 0;
+ virtual void deallocate_opaque(void *ptr) = 0;
};
template <typename T>
@@ -580,15 +587,15 @@ public:
return ptr;
}
- void free(T *ptr)
+ void deallocate(T *ptr)
{
ptr->~T();
vacants.push_back(ptr);
}
- void free_opaque(void *ptr) override
+ void deallocate_opaque(void *ptr) override
{
- free(static_cast<T *>(ptr));
+ deallocate(static_cast<T *>(ptr));
}
void clear()
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp
index d6cea923e06..8d1acf69f97 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.cpp
@@ -54,26 +54,26 @@ ParsedIR::ParsedIR()
// Should have been default-implemented, but need this on MSVC 2013.
ParsedIR::ParsedIR(ParsedIR &&other) SPIRV_CROSS_NOEXCEPT
{
- *this = move(other);
+ *this = std::move(other);
}
ParsedIR &ParsedIR::operator=(ParsedIR &&other) SPIRV_CROSS_NOEXCEPT
{
if (this != &other)
{
- pool_group = move(other.pool_group);
- spirv = move(other.spirv);
- meta = move(other.meta);
+ pool_group = std::move(other.pool_group);
+ spirv = std::move(other.spirv);
+ meta = std::move(other.meta);
for (int i = 0; i < TypeCount; i++)
- ids_for_type[i] = move(other.ids_for_type[i]);
- ids_for_constant_or_type = move(other.ids_for_constant_or_type);
- ids_for_constant_or_variable = move(other.ids_for_constant_or_variable);
- declared_capabilities = move(other.declared_capabilities);
- declared_extensions = move(other.declared_extensions);
- block_meta = move(other.block_meta);
- continue_block_to_loop_header = move(other.continue_block_to_loop_header);
- entry_points = move(other.entry_points);
- ids = move(other.ids);
+ ids_for_type[i] = std::move(other.ids_for_type[i]);
+ ids_for_constant_undef_or_type = std::move(other.ids_for_constant_undef_or_type);
+ ids_for_constant_or_variable = std::move(other.ids_for_constant_or_variable);
+ declared_capabilities = std::move(other.declared_capabilities);
+ declared_extensions = std::move(other.declared_extensions);
+ block_meta = std::move(other.block_meta);
+ continue_block_to_loop_header = std::move(other.continue_block_to_loop_header);
+ entry_points = std::move(other.entry_points);
+ ids = std::move(other.ids);
addressing_model = other.addressing_model;
memory_model = other.memory_model;
@@ -83,6 +83,7 @@ ParsedIR &ParsedIR::operator=(ParsedIR &&other) SPIRV_CROSS_NOEXCEPT
loop_iteration_depth_soft = other.loop_iteration_depth_soft;
meta_needing_name_fixup = std::move(other.meta_needing_name_fixup);
+ load_type_width = std::move(other.load_type_width);
}
return *this;
}
@@ -101,7 +102,7 @@ ParsedIR &ParsedIR::operator=(const ParsedIR &other)
meta = other.meta;
for (int i = 0; i < TypeCount; i++)
ids_for_type[i] = other.ids_for_type[i];
- ids_for_constant_or_type = other.ids_for_constant_or_type;
+ ids_for_constant_undef_or_type = other.ids_for_constant_undef_or_type;
ids_for_constant_or_variable = other.ids_for_constant_or_variable;
declared_capabilities = other.declared_capabilities;
declared_extensions = other.declared_extensions;
@@ -115,7 +116,9 @@ ParsedIR &ParsedIR::operator=(const ParsedIR &other)
addressing_model = other.addressing_model;
memory_model = other.memory_model;
+
meta_needing_name_fixup = other.meta_needing_name_fixup;
+ load_type_width = other.load_type_width;
// Very deliberate copying of IDs. There is no default copy constructor, nor a simple default constructor.
// Construct object first so we have the correct allocator set-up, then we can copy object into our new pool group.
@@ -327,6 +330,10 @@ void ParsedIR::fixup_reserved_names()
{
for (uint32_t id : meta_needing_name_fixup)
{
+ // Don't rename remapped variables like 'gl_LastFragDepthARM'.
+ if (ids[id].get_type() == TypeVariable && get<SPIRVariable>(id).remapped_variable)
+ continue;
+
auto &m = meta[id];
sanitize_identifier(m.decoration.alias, false, false);
for (auto &memb : m.members)
@@ -346,7 +353,7 @@ void ParsedIR::set_name(ID id, const string &name)
void ParsedIR::set_member_name(TypeID id, uint32_t index, const string &name)
{
auto &m = meta[id];
- m.members.resize(max(meta[id].members.size(), size_t(index) + 1));
+ m.members.resize(max(m.members.size(), size_t(index) + 1));
m.members[index].alias = name;
if (!is_valid_identifier(name) || is_reserved_identifier(name, true, false))
meta_needing_name_fixup.insert(id);
@@ -448,8 +455,9 @@ void ParsedIR::set_decoration(ID id, Decoration decoration, uint32_t argument)
void ParsedIR::set_member_decoration(TypeID id, uint32_t index, Decoration decoration, uint32_t argument)
{
- meta[id].members.resize(max(meta[id].members.size(), size_t(index) + 1));
- auto &dec = meta[id].members[index];
+ auto &m = meta[id];
+ m.members.resize(max(m.members.size(), size_t(index) + 1));
+ auto &dec = m.members[index];
dec.decoration_flags.set(decoration);
switch (decoration)
@@ -789,7 +797,8 @@ const Bitset &ParsedIR::get_decoration_bitset(ID id) const
void ParsedIR::set_member_decoration_string(TypeID id, uint32_t index, Decoration decoration, const string &argument)
{
- meta[id].members.resize(max(meta[id].members.size(), size_t(index) + 1));
+ auto &m = meta[id];
+ m.members.resize(max(m.members.size(), size_t(index) + 1));
auto &dec = meta[id].members[index];
dec.decoration_flags.set(decoration);
@@ -925,7 +934,7 @@ void ParsedIR::add_typed_id(Types type, ID id)
{
case TypeConstant:
ids_for_constant_or_variable.push_back(id);
- ids_for_constant_or_type.push_back(id);
+ ids_for_constant_undef_or_type.push_back(id);
break;
case TypeVariable:
@@ -934,7 +943,8 @@ void ParsedIR::add_typed_id(Types type, ID id)
case TypeType:
case TypeConstantOp:
- ids_for_constant_or_type.push_back(id);
+ case TypeUndef:
+ ids_for_constant_undef_or_type.push_back(id);
break;
default:
@@ -996,7 +1006,7 @@ ParsedIR::LoopLock::LoopLock(uint32_t *lock_)
ParsedIR::LoopLock::LoopLock(LoopLock &&other) SPIRV_CROSS_NOEXCEPT
{
- *this = move(other);
+ *this = std::move(other);
}
ParsedIR::LoopLock &ParsedIR::LoopLock::operator=(LoopLock &&other) SPIRV_CROSS_NOEXCEPT
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp
index 8971a970715..7f35c3815cd 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_cross_parsed_ir.hpp
@@ -74,10 +74,17 @@ public:
// Special purpose lists which contain a union of types.
// This is needed so we can declare specialization constants and structs in an interleaved fashion,
// among other things.
- // Constants can be of struct type, and struct array sizes can use specialization constants.
- SmallVector<ID> ids_for_constant_or_type;
+ // Constants can be undef or of struct type, and struct array sizes can use specialization constants.
+ SmallVector<ID> ids_for_constant_undef_or_type;
SmallVector<ID> ids_for_constant_or_variable;
+ // We need to keep track of the width the Ops that contains a type for the
+ // OpSwitch instruction, since this one doesn't contains the type in the
+ // instruction itself. And in some case we need to cast the condition to
+ // wider types. We only need the width to do the branch fixup since the
+ // type check itself can be done at runtime
+ std::unordered_map<ID, uint32_t> load_type_width;
+
// Declared capabilities and extensions in the SPIR-V module.
// Not really used except for reflection at the moment.
SmallVector<spv::Capability> declared_capabilities;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp
index 2b19346d944..07956247601 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.cpp
@@ -296,8 +296,19 @@ const char *CompilerGLSL::vector_swizzle(int vecsize, int index)
return swizzle[vecsize - 1][index];
}
-void CompilerGLSL::reset()
-{
+void CompilerGLSL::reset(uint32_t iteration_count)
+{
+ // Sanity check the iteration count to be robust against a certain class of bugs where
+ // we keep forcing recompilations without making clear forward progress.
+ // In buggy situations we will loop forever, or loop for an unbounded number of iterations.
+ // Certain types of recompilations are considered to make forward progress,
+ // but in almost all situations, we'll never see more than 3 iterations.
+ // It is highly context-sensitive when we need to force recompilation,
+ // and it is not practical with the current architecture
+ // to resolve everything up front.
+ if (iteration_count >= options.force_recompile_max_debug_iterations && !is_force_recompile_forward_progress)
+ SPIRV_CROSS_THROW("Maximum compilation loops detected and no forward progress was made. Must be a SPIRV-Cross bug!");
+
// We do some speculative optimizations which should pretty much always work out,
// but just in case the SPIR-V is rather weird, recompile until it's happy.
// This typically only means one extra pass.
@@ -305,6 +316,7 @@ void CompilerGLSL::reset()
// Clear invalid expression tracking.
invalid_expressions.clear();
+ composite_insert_overwritten.clear();
current_function = nullptr;
// Clear temporary usage tracking.
@@ -315,6 +327,8 @@ void CompilerGLSL::reset()
// Ensure that we declare phi-variable copies even if the original declaration isn't deferred
flushed_phi_variables.clear();
+ current_emitting_switch_stack.clear();
+
reset_name_caches();
ir.for_each_typed_id<SPIRFunction>([&](uint32_t, SPIRFunction &func) {
@@ -393,10 +407,9 @@ void CompilerGLSL::find_static_extensions()
}
else if (type.basetype == SPIRType::Int64 || type.basetype == SPIRType::UInt64)
{
- if (options.es)
- SPIRV_CROSS_THROW("64-bit integers not supported in ES profile.");
- if (!options.es)
- require_extension_internal("GL_ARB_gpu_shader_int64");
+ if (options.es && options.version < 310) // GL_NV_gpu_shader5 fallback requires 310.
+ SPIRV_CROSS_THROW("64-bit integers not supported in ES profile before version 310.");
+ require_extension_internal("GL_ARB_gpu_shader_int64");
}
else if (type.basetype == SPIRType::Half)
{
@@ -484,6 +497,15 @@ void CompilerGLSL::find_static_extensions()
require_extension_internal("GL_NV_ray_tracing");
break;
+ case ExecutionModelMeshEXT:
+ case ExecutionModelTaskEXT:
+ if (options.es || options.version < 450)
+ SPIRV_CROSS_THROW("Mesh shaders require GLSL 450 or above.");
+ if (!options.vulkan_semantics)
+ SPIRV_CROSS_THROW("Mesh shaders require Vulkan semantics.");
+ require_extension_internal("GL_EXT_mesh_shader");
+ break;
+
default:
break;
}
@@ -607,6 +629,11 @@ void CompilerGLSL::find_static_extensions()
SPIRV_CROSS_THROW("OVR_multiview2 can only be used with Vertex shaders.");
require_extension_internal("GL_OVR_multiview2");
}
+
+ // KHR one is likely to get promoted at some point, so if we don't see an explicit SPIR-V extension, assume KHR.
+ for (auto &ext : ir.declared_extensions)
+ if (ext == "SPV_NV_fragment_shader_barycentric")
+ barycentric_is_nv = true;
}
void CompilerGLSL::ray_tracing_khr_fixup_locations()
@@ -631,19 +658,22 @@ string CompilerGLSL::compile()
{
// only NV_gpu_shader5 supports divergent indexing on OpenGL, and it does so without extra qualifiers
backend.nonuniform_qualifier = "";
- backend.needs_row_major_load_workaround = true;
+ backend.needs_row_major_load_workaround = options.enable_row_major_load_workaround;
}
backend.allow_precision_qualifiers = options.vulkan_semantics || options.es;
backend.force_gl_in_out_block = true;
backend.supports_extensions = true;
backend.use_array_constructor = true;
-
- backend.support_precise_qualifier = (!options.es && options.version >= 400) || (options.es && options.version >= 320);
+ backend.workgroup_size_is_hidden = true;
+ backend.requires_relaxed_precision_analysis = options.es || options.vulkan_semantics;
+ backend.support_precise_qualifier =
+ (!options.es && options.version >= 400) || (options.es && options.version >= 320);
if (is_legacy_es())
backend.support_case_fallthrough = false;
// Scan the SPIR-V to find trivial uses of extensions.
+ fixup_anonymous_struct_names();
fixup_type_alias();
reorder_type_alias();
build_function_control_flow_graphs_and_analyze();
@@ -663,10 +693,7 @@ string CompilerGLSL::compile()
uint32_t pass_count = 0;
do
{
- if (pass_count >= 3)
- SPIRV_CROSS_THROW("Over 3 compilation loops detected. Must be a bug!");
-
- reset();
+ reset(pass_count);
buffer.reset();
@@ -686,15 +713,9 @@ string CompilerGLSL::compile()
statement("void main()");
begin_scope();
statement("// Interlocks were used in a way not compatible with GLSL, this is very slow.");
- if (options.es)
- statement("beginInvocationInterlockNV();");
- else
- statement("beginInvocationInterlockARB();");
+ statement("SPIRV_Cross_beginInvocationInterlock();");
statement("spvMainInterlockedBody();");
- if (options.es)
- statement("endInvocationInterlockNV();");
- else
- statement("endInvocationInterlockARB();");
+ statement("SPIRV_Cross_endInvocationInterlock();");
end_scope();
}
@@ -713,6 +734,8 @@ void CompilerGLSL::build_workgroup_size(SmallVector<string> &arguments, const Sp
const SpecializationConstant &wg_y, const SpecializationConstant &wg_z)
{
auto &execution = get_entry_point();
+ bool builtin_workgroup = execution.workgroup_size.constant != 0;
+ bool use_local_size_id = !builtin_workgroup && execution.flags.get(ExecutionModeLocalSizeId);
if (wg_x.id)
{
@@ -721,6 +744,8 @@ void CompilerGLSL::build_workgroup_size(SmallVector<string> &arguments, const Sp
else
arguments.push_back(join("local_size_x = ", get<SPIRConstant>(wg_x.id).specialization_constant_macro_name));
}
+ else if (use_local_size_id && execution.workgroup_size.id_x)
+ arguments.push_back(join("local_size_x = ", get<SPIRConstant>(execution.workgroup_size.id_x).scalar()));
else
arguments.push_back(join("local_size_x = ", execution.workgroup_size.x));
@@ -731,6 +756,8 @@ void CompilerGLSL::build_workgroup_size(SmallVector<string> &arguments, const Sp
else
arguments.push_back(join("local_size_y = ", get<SPIRConstant>(wg_y.id).specialization_constant_macro_name));
}
+ else if (use_local_size_id && execution.workgroup_size.id_y)
+ arguments.push_back(join("local_size_y = ", get<SPIRConstant>(execution.workgroup_size.id_y).scalar()));
else
arguments.push_back(join("local_size_y = ", execution.workgroup_size.y));
@@ -741,6 +768,8 @@ void CompilerGLSL::build_workgroup_size(SmallVector<string> &arguments, const Sp
else
arguments.push_back(join("local_size_z = ", get<SPIRConstant>(wg_z.id).specialization_constant_macro_name));
}
+ else if (use_local_size_id && execution.workgroup_size.id_z)
+ arguments.push_back(join("local_size_z = ", get<SPIRConstant>(execution.workgroup_size.id_z).scalar()));
else
arguments.push_back(join("local_size_z = ", execution.workgroup_size.z));
}
@@ -784,10 +813,12 @@ void CompilerGLSL::emit_header()
require_extension_internal("GL_ARB_post_depth_coverage");
// Needed for: layout({pixel,sample}_interlock_[un]ordered) in;
- if (execution.flags.get(ExecutionModePixelInterlockOrderedEXT) ||
- execution.flags.get(ExecutionModePixelInterlockUnorderedEXT) ||
- execution.flags.get(ExecutionModeSampleInterlockOrderedEXT) ||
- execution.flags.get(ExecutionModeSampleInterlockUnorderedEXT))
+ bool interlock_used = execution.flags.get(ExecutionModePixelInterlockOrderedEXT) ||
+ execution.flags.get(ExecutionModePixelInterlockUnorderedEXT) ||
+ execution.flags.get(ExecutionModeSampleInterlockOrderedEXT) ||
+ execution.flags.get(ExecutionModeSampleInterlockUnorderedEXT);
+
+ if (interlock_used)
{
if (options.es)
{
@@ -805,7 +836,20 @@ void CompilerGLSL::emit_header()
for (auto &ext : forced_extensions)
{
- if (ext == "GL_EXT_shader_explicit_arithmetic_types_float16")
+ if (ext == "GL_ARB_gpu_shader_int64")
+ {
+ statement("#if defined(GL_ARB_gpu_shader_int64)");
+ statement("#extension GL_ARB_gpu_shader_int64 : require");
+ if (!options.vulkan_semantics || options.es)
+ {
+ statement("#elif defined(GL_NV_gpu_shader5)");
+ statement("#extension GL_NV_gpu_shader5 : require");
+ }
+ statement("#else");
+ statement("#error No extension available for 64-bit integers.");
+ statement("#endif");
+ }
+ else if (ext == "GL_EXT_shader_explicit_arithmetic_types_float16")
{
// Special case, this extension has a potential fallback to another vendor extension in normal GLSL.
// GL_AMD_gpu_shader_half_float is a superset, so try that first.
@@ -825,13 +869,30 @@ void CompilerGLSL::emit_header()
statement("#error No extension available for FP16.");
statement("#endif");
}
+ else if (ext == "GL_EXT_shader_explicit_arithmetic_types_int8")
+ {
+ if (options.vulkan_semantics)
+ statement("#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require");
+ else
+ {
+ statement("#if defined(GL_EXT_shader_explicit_arithmetic_types_int8)");
+ statement("#extension GL_EXT_shader_explicit_arithmetic_types_int8 : require");
+ statement("#elif defined(GL_NV_gpu_shader5)");
+ statement("#extension GL_NV_gpu_shader5 : require");
+ statement("#else");
+ statement("#error No extension available for Int8.");
+ statement("#endif");
+ }
+ }
else if (ext == "GL_EXT_shader_explicit_arithmetic_types_int16")
{
if (options.vulkan_semantics)
statement("#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require");
else
{
- statement("#if defined(GL_AMD_gpu_shader_int16)");
+ statement("#if defined(GL_EXT_shader_explicit_arithmetic_types_int16)");
+ statement("#extension GL_EXT_shader_explicit_arithmetic_types_int16 : require");
+ statement("#elif defined(GL_AMD_gpu_shader_int16)");
statement("#extension GL_AMD_gpu_shader_int16 : require");
statement("#elif defined(GL_NV_gpu_shader5)");
statement("#extension GL_NV_gpu_shader5 : require");
@@ -876,6 +937,24 @@ void CompilerGLSL::emit_header()
statement("#define SPIRV_CROSS_LOOP");
statement("#endif");
}
+ else if (ext == "GL_NV_fragment_shader_interlock")
+ {
+ statement("#extension GL_NV_fragment_shader_interlock : require");
+ statement("#define SPIRV_Cross_beginInvocationInterlock() beginInvocationInterlockNV()");
+ statement("#define SPIRV_Cross_endInvocationInterlock() endInvocationInterlockNV()");
+ }
+ else if (ext == "GL_ARB_fragment_shader_interlock")
+ {
+ statement("#ifdef GL_ARB_fragment_shader_interlock");
+ statement("#extension GL_ARB_fragment_shader_interlock : enable");
+ statement("#define SPIRV_Cross_beginInvocationInterlock() beginInvocationInterlockARB()");
+ statement("#define SPIRV_Cross_endInvocationInterlock() endInvocationInterlockARB()");
+ statement("#elif defined(GL_INTEL_fragment_shader_ordering)");
+ statement("#extension GL_INTEL_fragment_shader_ordering : enable");
+ statement("#define SPIRV_Cross_beginInvocationInterlock() beginFragmentShaderOrderingINTEL()");
+ statement("#define SPIRV_Cross_endInvocationInterlock()");
+ statement("#endif");
+ }
else
statement("#extension ", ext, " : require");
}
@@ -990,8 +1069,10 @@ void CompilerGLSL::emit_header()
break;
case ExecutionModelGLCompute:
+ case ExecutionModelTaskEXT:
+ case ExecutionModelMeshEXT:
{
- if (execution.workgroup_size.constant != 0)
+ if (execution.workgroup_size.constant != 0 || execution.flags.get(ExecutionModeLocalSizeId))
{
SpecializationConstant wg_x, wg_y, wg_z;
get_work_group_size_specialization_constants(wg_x, wg_y, wg_z);
@@ -1008,6 +1089,18 @@ void CompilerGLSL::emit_header()
inputs.push_back(join("local_size_y = ", execution.workgroup_size.y));
inputs.push_back(join("local_size_z = ", execution.workgroup_size.z));
}
+
+ if (execution.model == ExecutionModelMeshEXT)
+ {
+ outputs.push_back(join("max_vertices = ", execution.output_vertices));
+ outputs.push_back(join("max_primitives = ", execution.output_primitives));
+ if (execution.flags.get(ExecutionModeOutputTrianglesEXT))
+ outputs.push_back("triangles");
+ else if (execution.flags.get(ExecutionModeOutputLinesEXT))
+ outputs.push_back("lines");
+ else if (execution.flags.get(ExecutionModeOutputPoints))
+ outputs.push_back("points");
+ }
break;
}
@@ -1056,14 +1149,24 @@ void CompilerGLSL::emit_header()
if (execution.flags.get(ExecutionModePostDepthCoverage))
inputs.push_back("post_depth_coverage");
+ if (interlock_used)
+ statement("#if defined(GL_ARB_fragment_shader_interlock)");
+
if (execution.flags.get(ExecutionModePixelInterlockOrderedEXT))
- inputs.push_back("pixel_interlock_ordered");
+ statement("layout(pixel_interlock_ordered) in;");
else if (execution.flags.get(ExecutionModePixelInterlockUnorderedEXT))
- inputs.push_back("pixel_interlock_unordered");
+ statement("layout(pixel_interlock_unordered) in;");
else if (execution.flags.get(ExecutionModeSampleInterlockOrderedEXT))
- inputs.push_back("sample_interlock_ordered");
+ statement("layout(sample_interlock_ordered) in;");
else if (execution.flags.get(ExecutionModeSampleInterlockUnorderedEXT))
- inputs.push_back("sample_interlock_unordered");
+ statement("layout(sample_interlock_unordered) in;");
+
+ if (interlock_used)
+ {
+ statement("#elif !defined(GL_INTEL_fragment_shader_ordering)");
+ statement("#error Fragment Shader Interlock/Ordering extension missing!");
+ statement("#endif");
+ }
if (!options.es && execution.flags.get(ExecutionModeDepthGreater))
statement("layout(depth_greater) out float gl_FragDepth;");
@@ -1155,6 +1258,8 @@ string CompilerGLSL::to_interpolation_qualifiers(const Bitset &flags)
res += "sample ";
if (flags.get(DecorationInvariant))
res += "invariant ";
+ if (flags.get(DecorationPerPrimitiveEXT))
+ res += "perprimitiveEXT ";
if (flags.get(DecorationExplicitInterpAMD))
{
@@ -1162,14 +1267,23 @@ string CompilerGLSL::to_interpolation_qualifiers(const Bitset &flags)
res += "__explicitInterpAMD ";
}
- if (flags.get(DecorationPerVertexNV))
+ if (flags.get(DecorationPerVertexKHR))
{
if (options.es && options.version < 320)
- SPIRV_CROSS_THROW("pervertexNV requires ESSL 320.");
+ SPIRV_CROSS_THROW("pervertexEXT requires ESSL 320.");
else if (!options.es && options.version < 450)
- SPIRV_CROSS_THROW("pervertexNV requires GLSL 450.");
- require_extension_internal("GL_NV_fragment_shader_barycentric");
- res += "pervertexNV ";
+ SPIRV_CROSS_THROW("pervertexEXT requires GLSL 450.");
+
+ if (barycentric_is_nv)
+ {
+ require_extension_internal("GL_NV_fragment_shader_barycentric");
+ res += "pervertexNV ";
+ }
+ else
+ {
+ require_extension_internal("GL_EXT_fragment_shader_barycentric");
+ res += "pervertexEXT ";
+ }
}
return res;
@@ -2088,9 +2202,8 @@ void CompilerGLSL::emit_push_constant_block_glsl(const SPIRVariable &var)
// OpenGL has no concept of push constant blocks, implement it as a uniform struct.
auto &type = get<SPIRType>(var.basetype);
- auto &flags = ir.meta[var.self].decoration.decoration_flags;
- flags.clear(DecorationBinding);
- flags.clear(DecorationDescriptorSet);
+ unset_decoration(var.self, DecorationBinding);
+ unset_decoration(var.self, DecorationDescriptorSet);
#if 0
if (flags & ((1ull << DecorationBinding) | (1ull << DecorationDescriptorSet)))
@@ -2100,14 +2213,13 @@ void CompilerGLSL::emit_push_constant_block_glsl(const SPIRVariable &var)
// We're emitting the push constant block as a regular struct, so disable the block qualifier temporarily.
// Otherwise, we will end up emitting layout() qualifiers on naked structs which is not allowed.
- auto &block_flags = ir.meta[type.self].decoration.decoration_flags;
- bool block_flag = block_flags.get(DecorationBlock);
- block_flags.clear(DecorationBlock);
+ bool block_flag = has_decoration(type.self, DecorationBlock);
+ unset_decoration(type.self, DecorationBlock);
emit_struct(type);
if (block_flag)
- block_flags.set(DecorationBlock);
+ set_decoration(type.self, DecorationBlock);
emit_uniform(var);
statement("");
@@ -2147,8 +2259,9 @@ void CompilerGLSL::emit_buffer_block_legacy(const SPIRVariable &var)
statement("");
}
-void CompilerGLSL::emit_buffer_reference_block(SPIRType &type, bool forward_declaration)
+void CompilerGLSL::emit_buffer_reference_block(uint32_t type_id, bool forward_declaration)
{
+ auto &type = get<SPIRType>(type_id);
string buffer_name;
if (forward_declaration)
@@ -2191,8 +2304,19 @@ void CompilerGLSL::emit_buffer_reference_block(SPIRType &type, bool forward_decl
if (!forward_declaration)
{
+ auto itr = physical_storage_type_to_alignment.find(type_id);
+ uint32_t alignment = 0;
+ if (itr != physical_storage_type_to_alignment.end())
+ alignment = itr->second.alignment;
+
if (type.basetype == SPIRType::Struct)
{
+ SmallVector<std::string> attributes;
+ attributes.push_back("buffer_reference");
+ if (alignment)
+ attributes.push_back(join("buffer_reference_align = ", alignment));
+ attributes.push_back(buffer_to_packing_standard(type, true));
+
auto flags = ir.get_buffer_block_type_flags(type);
string decorations;
if (flags.get(DecorationRestrict))
@@ -2203,9 +2327,11 @@ void CompilerGLSL::emit_buffer_reference_block(SPIRType &type, bool forward_decl
decorations += " writeonly";
if (flags.get(DecorationNonWritable))
decorations += " readonly";
- statement("layout(buffer_reference, ", buffer_to_packing_standard(type, true),
- ")", decorations, " buffer ", buffer_name);
+
+ statement("layout(", merge(attributes), ")", decorations, " buffer ", buffer_name);
}
+ else if (alignment)
+ statement("layout(buffer_reference, buffer_reference_align = ", alignment, ") buffer ", buffer_name);
else
statement("layout(buffer_reference) buffer ", buffer_name);
@@ -2523,7 +2649,7 @@ void CompilerGLSL::emit_interface_block(const SPIRVariable &var)
}
// Workaround to make sure we can emit "patch in/out" correctly.
- fixup_io_block_patch_qualifiers(var);
+ fixup_io_block_patch_primitive_qualifiers(var);
// Block names should never alias.
auto block_name = to_name(type.self, false);
@@ -2546,8 +2672,15 @@ void CompilerGLSL::emit_interface_block(const SPIRVariable &var)
// Instance names cannot alias block names.
resource_names.insert(block_name);
- bool is_patch = has_decoration(var.self, DecorationPatch);
- statement(layout_for_variable(var), (is_patch ? "patch " : ""), qual, block_name);
+ const char *block_qualifier;
+ if (has_decoration(var.self, DecorationPatch))
+ block_qualifier = "patch ";
+ else if (has_decoration(var.self, DecorationPerPrimitiveEXT))
+ block_qualifier = "perprimitiveEXT ";
+ else
+ block_qualifier = "";
+
+ statement(layout_for_variable(var), block_qualifier, qual, block_name);
begin_scope();
type.member_name_cache.clear();
@@ -2631,14 +2764,34 @@ string CompilerGLSL::constant_value_macro_name(uint32_t id)
void CompilerGLSL::emit_specialization_constant_op(const SPIRConstantOp &constant)
{
auto &type = get<SPIRType>(constant.basetype);
+ add_resource_name(constant.self);
auto name = to_name(constant.self);
statement("const ", variable_decl(type, name), " = ", constant_op_expression(constant), ";");
}
+int CompilerGLSL::get_constant_mapping_to_workgroup_component(const SPIRConstant &c) const
+{
+ auto &entry_point = get_entry_point();
+ int index = -1;
+
+ // Need to redirect specialization constants which are used as WorkGroupSize to the builtin,
+ // since the spec constant declarations are never explicitly declared.
+ if (entry_point.workgroup_size.constant == 0 && entry_point.flags.get(ExecutionModeLocalSizeId))
+ {
+ if (c.self == entry_point.workgroup_size.id_x)
+ index = 0;
+ else if (c.self == entry_point.workgroup_size.id_y)
+ index = 1;
+ else if (c.self == entry_point.workgroup_size.id_z)
+ index = 2;
+ }
+
+ return index;
+}
+
void CompilerGLSL::emit_constant(const SPIRConstant &constant)
{
auto &type = get<SPIRType>(constant.constant_type);
- auto name = to_name(constant.self);
SpecializationConstant wg_x, wg_y, wg_z;
ID workgroup_size_id = get_work_group_size_specialization_constants(wg_x, wg_y, wg_z);
@@ -2665,6 +2818,9 @@ void CompilerGLSL::emit_constant(const SPIRConstant &constant)
return;
}
+ add_resource_name(constant.self);
+ auto name = to_name(constant.self);
+
// Only scalars have constant IDs.
if (has_decoration(constant.self, DecorationSpecId))
{
@@ -2907,11 +3063,10 @@ void CompilerGLSL::fixup_image_load_store_access()
// Solve this by making the image access as restricted as possible and loosen up if we need to.
// If any no-read/no-write flags are actually set, assume that the compiler knows what it's doing.
- auto &flags = ir.meta[var].decoration.decoration_flags;
- if (!flags.get(DecorationNonWritable) && !flags.get(DecorationNonReadable))
+ if (!has_decoration(var, DecorationNonWritable) && !has_decoration(var, DecorationNonReadable))
{
- flags.set(DecorationNonWritable);
- flags.set(DecorationNonReadable);
+ set_decoration(var, DecorationNonWritable);
+ set_decoration(var, DecorationNonReadable);
}
}
});
@@ -2961,7 +3116,8 @@ bool CompilerGLSL::should_force_emit_builtin_block(StorageClass storage)
});
// If we're declaring clip/cull planes with control points we need to force block declaration.
- if (get_execution_model() == ExecutionModelTessellationControl &&
+ if ((get_execution_model() == ExecutionModelTessellationControl ||
+ get_execution_model() == ExecutionModelMeshEXT) &&
(clip_distance_count || cull_distance_count))
{
should_force = true;
@@ -2970,7 +3126,7 @@ bool CompilerGLSL::should_force_emit_builtin_block(StorageClass storage)
return should_force;
}
-void CompilerGLSL::fixup_implicit_builtin_block_names()
+void CompilerGLSL::fixup_implicit_builtin_block_names(ExecutionModel model)
{
ir.for_each_typed_id<SPIRVariable>([&](uint32_t, SPIRVariable &var) {
auto &type = this->get<SPIRType>(var.basetype);
@@ -2978,11 +3134,43 @@ void CompilerGLSL::fixup_implicit_builtin_block_names()
if ((var.storage == StorageClassOutput || var.storage == StorageClassInput) && block &&
is_builtin_variable(var))
{
- // Make sure the array has a supported name in the code.
- if (var.storage == StorageClassOutput)
- set_name(var.self, "gl_out");
- else if (var.storage == StorageClassInput)
- set_name(var.self, "gl_in");
+ if (model != ExecutionModelMeshEXT)
+ {
+ // Make sure the array has a supported name in the code.
+ if (var.storage == StorageClassOutput)
+ set_name(var.self, "gl_out");
+ else if (var.storage == StorageClassInput)
+ set_name(var.self, "gl_in");
+ }
+ else
+ {
+ auto flags = get_buffer_block_flags(var.self);
+ if (flags.get(DecorationPerPrimitiveEXT))
+ {
+ set_name(var.self, "gl_MeshPrimitivesEXT");
+ set_name(type.self, "gl_MeshPerPrimitiveEXT");
+ }
+ else
+ {
+ set_name(var.self, "gl_MeshVerticesEXT");
+ set_name(type.self, "gl_MeshPerVertexEXT");
+ }
+ }
+ }
+
+ if (model == ExecutionModelMeshEXT && var.storage == StorageClassOutput && !block)
+ {
+ auto *m = ir.find_meta(var.self);
+ if (m && m->decoration.builtin)
+ {
+ auto builtin_type = m->decoration.builtin_type;
+ if (builtin_type == BuiltInPrimitivePointIndicesEXT)
+ set_name(var.self, "gl_PrimitivePointIndicesEXT");
+ else if (builtin_type == BuiltInPrimitiveLineIndicesEXT)
+ set_name(var.self, "gl_PrimitiveLineIndicesEXT");
+ else if (builtin_type == BuiltInPrimitiveTriangleIndicesEXT)
+ set_name(var.self, "gl_PrimitiveTriangleIndicesEXT");
+ }
}
});
}
@@ -3006,6 +3194,11 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo
uint32_t xfb_stride = 0, xfb_buffer = 0, geom_stream = 0;
std::unordered_map<uint32_t, uint32_t> builtin_xfb_offsets;
+ const auto builtin_is_per_vertex_set = [](BuiltIn builtin) -> bool {
+ return builtin == BuiltInPosition || builtin == BuiltInPointSize ||
+ builtin == BuiltInClipDistance || builtin == BuiltInCullDistance;
+ };
+
ir.for_each_typed_id<SPIRVariable>([&](uint32_t, SPIRVariable &var) {
auto &type = this->get<SPIRType>(var.basetype);
bool block = has_decoration(type.self, DecorationBlock);
@@ -3016,7 +3209,7 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo
uint32_t index = 0;
for (auto &m : ir.meta[type.self].members)
{
- if (m.builtin)
+ if (m.builtin && builtin_is_per_vertex_set(m.builtin_type))
{
builtins.set(m.builtin_type);
if (m.builtin_type == BuiltInCullDistance)
@@ -3069,7 +3262,7 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo
{
// While we're at it, collect all declared global builtins (HLSL mostly ...).
auto &m = ir.meta[var.self].decoration;
- if (m.builtin)
+ if (m.builtin && builtin_is_per_vertex_set(m.builtin_type))
{
global_builtins.set(m.builtin_type);
if (m.builtin_type == BuiltInCullDistance)
@@ -3158,7 +3351,9 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo
attr.push_back(join("stream = ", geom_stream));
}
- if (!attr.empty())
+ if (model == ExecutionModelMeshEXT)
+ statement("out gl_MeshPerVertexEXT");
+ else if (!attr.empty())
statement("layout(", merge(attr), ") out gl_PerVertex");
else
statement("out gl_PerVertex");
@@ -3221,27 +3416,6 @@ void CompilerGLSL::emit_declared_builtin_block(StorageClass storage, ExecutionMo
statement("");
}
-void CompilerGLSL::declare_undefined_values()
-{
- bool emitted = false;
- ir.for_each_typed_id<SPIRUndef>([&](uint32_t, const SPIRUndef &undef) {
- auto &type = this->get<SPIRType>(undef.basetype);
- // OpUndef can be void for some reason ...
- if (type.basetype == SPIRType::Void)
- return;
-
- string initializer;
- if (options.force_zero_initialized_variables && type_can_zero_initialize(type))
- initializer = join(" = ", to_zero_initialized_expression(undef.basetype));
-
- statement(variable_decl(type, to_name(undef.self), undef.self), initializer, ";");
- emitted = true;
- });
-
- if (emitted)
- statement("");
-}
-
bool CompilerGLSL::variable_is_lut(const SPIRVariable &var) const
{
bool statically_assigned = var.statically_assigned && var.static_expression != ID(0) && var.remapped_variable;
@@ -3276,7 +3450,8 @@ void CompilerGLSL::emit_resources()
case ExecutionModelGeometry:
case ExecutionModelTessellationControl:
case ExecutionModelTessellationEvaluation:
- fixup_implicit_builtin_block_names();
+ case ExecutionModelMeshEXT:
+ fixup_implicit_builtin_block_names(execution.model);
break;
default:
@@ -3296,6 +3471,7 @@ void CompilerGLSL::emit_resources()
break;
case ExecutionModelVertex:
+ case ExecutionModelMeshEXT:
emit_declared_builtin_block(StorageClassOutput, execution.model);
break;
@@ -3340,7 +3516,7 @@ void CompilerGLSL::emit_resources()
//
{
auto loop_lock = ir.create_loop_hard_lock();
- for (auto &id_ : ir.ids_for_constant_or_type)
+ for (auto &id_ : ir.ids_for_constant_undef_or_type)
{
auto &id = ir.ids[id_];
@@ -3393,6 +3569,22 @@ void CompilerGLSL::emit_resources()
emit_struct(*type);
}
}
+ else if (id.get_type() == TypeUndef)
+ {
+ auto &undef = id.get<SPIRUndef>();
+ auto &type = this->get<SPIRType>(undef.basetype);
+ // OpUndef can be void for some reason ...
+ if (type.basetype == SPIRType::Void)
+ return;
+
+ string initializer;
+ if (options.force_zero_initialized_variables && type_can_zero_initialize(type))
+ initializer = join(" = ", to_zero_initialized_expression(undef.basetype));
+
+ // FIXME: If used in a constant, we must declare it as one.
+ statement(variable_decl(type, to_name(undef.self), undef.self), initializer, ";");
+ emitted = true;
+ }
}
}
@@ -3403,7 +3595,7 @@ void CompilerGLSL::emit_resources()
// If the work group size depends on a specialization constant, we need to declare the layout() block
// after constants (and their macros) have been declared.
if (execution.model == ExecutionModelGLCompute && !options.vulkan_semantics &&
- execution.workgroup_size.constant != 0)
+ (execution.workgroup_size.constant != 0 || execution.flags.get(ExecutionModeLocalSizeId)))
{
SpecializationConstant wg_x, wg_y, wg_z;
get_work_group_size_specialization_constants(wg_x, wg_y, wg_z);
@@ -3423,28 +3615,28 @@ void CompilerGLSL::emit_resources()
{
for (auto type : physical_storage_non_block_pointer_types)
{
- emit_buffer_reference_block(get<SPIRType>(type), false);
+ emit_buffer_reference_block(type, false);
}
// Output buffer reference blocks.
// Do this in two stages, one with forward declaration,
// and one without. Buffer reference blocks can reference themselves
// to support things like linked lists.
- ir.for_each_typed_id<SPIRType>([&](uint32_t, SPIRType &type) {
- bool has_block_flags = has_decoration(type.self, DecorationBlock);
- if (has_block_flags && type.pointer && type.pointer_depth == 1 && !type_is_array_of_pointers(type) &&
+ ir.for_each_typed_id<SPIRType>([&](uint32_t self, SPIRType &type) {
+ if (type.basetype == SPIRType::Struct && type.pointer &&
+ type.pointer_depth == 1 && !type_is_array_of_pointers(type) &&
type.storage == StorageClassPhysicalStorageBufferEXT)
{
- emit_buffer_reference_block(type, true);
+ emit_buffer_reference_block(self, true);
}
});
- ir.for_each_typed_id<SPIRType>([&](uint32_t, SPIRType &type) {
- bool has_block_flags = has_decoration(type.self, DecorationBlock);
- if (has_block_flags && type.pointer && type.pointer_depth == 1 && !type_is_array_of_pointers(type) &&
+ ir.for_each_typed_id<SPIRType>([&](uint32_t self, SPIRType &type) {
+ if (type.basetype == SPIRType::Struct &&
+ type.pointer && type.pointer_depth == 1 && !type_is_array_of_pointers(type) &&
type.storage == StorageClassPhysicalStorageBufferEXT)
{
- emit_buffer_reference_block(type, false);
+ emit_buffer_reference_block(self, false);
}
});
}
@@ -3527,6 +3719,11 @@ void CompilerGLSL::emit_resources()
(var.storage == StorageClassInput || var.storage == StorageClassOutput) &&
interface_variable_exists_in_entry_point(var.self) && !is_hidden)
{
+ if (options.es && get_execution_model() == ExecutionModelVertex && var.storage == StorageClassInput &&
+ type.array.size() == 1)
+ {
+ SPIRV_CROSS_THROW("OpenGL ES doesn't support array input variables in vertex shader.");
+ }
emit_interface_block(var);
emitted = true;
}
@@ -3604,8 +3801,6 @@ void CompilerGLSL::emit_resources()
if (emitted)
statement("");
-
- declare_undefined_values();
}
void CompilerGLSL::emit_output_variable_initializer(const SPIRVariable &var)
@@ -4215,12 +4410,96 @@ string CompilerGLSL::to_func_call_arg(const SPIRFunction::Parameter &, uint32_t
return to_expression(name_id);
}
+void CompilerGLSL::force_temporary_and_recompile(uint32_t id)
+{
+ auto res = forced_temporaries.insert(id);
+
+ // Forcing new temporaries guarantees forward progress.
+ if (res.second)
+ force_recompile_guarantee_forward_progress();
+ else
+ force_recompile();
+}
+
+uint32_t CompilerGLSL::consume_temporary_in_precision_context(uint32_t type_id, uint32_t id, Options::Precision precision)
+{
+ // Constants do not have innate precision.
+ auto handle_type = ir.ids[id].get_type();
+ if (handle_type == TypeConstant || handle_type == TypeConstantOp || handle_type == TypeUndef)
+ return id;
+
+ // Ignore anything that isn't 32-bit values.
+ auto &type = get<SPIRType>(type_id);
+ if (type.pointer)
+ return id;
+ if (type.basetype != SPIRType::Float && type.basetype != SPIRType::UInt && type.basetype != SPIRType::Int)
+ return id;
+
+ if (precision == Options::DontCare)
+ {
+ // If precision is consumed as don't care (operations only consisting of constants),
+ // we need to bind the expression to a temporary,
+ // otherwise we have no way of controlling the precision later.
+ auto itr = forced_temporaries.insert(id);
+ if (itr.second)
+ force_recompile_guarantee_forward_progress();
+ return id;
+ }
+
+ auto current_precision = has_decoration(id, DecorationRelaxedPrecision) ? Options::Mediump : Options::Highp;
+ if (current_precision == precision)
+ return id;
+
+ auto itr = temporary_to_mirror_precision_alias.find(id);
+ if (itr == temporary_to_mirror_precision_alias.end())
+ {
+ uint32_t alias_id = ir.increase_bound_by(1);
+ auto &m = ir.meta[alias_id];
+ if (auto *input_m = ir.find_meta(id))
+ m = *input_m;
+
+ const char *prefix;
+ if (precision == Options::Mediump)
+ {
+ set_decoration(alias_id, DecorationRelaxedPrecision);
+ prefix = "mp_copy_";
+ }
+ else
+ {
+ unset_decoration(alias_id, DecorationRelaxedPrecision);
+ prefix = "hp_copy_";
+ }
+
+ auto alias_name = join(prefix, to_name(id));
+ ParsedIR::sanitize_underscores(alias_name);
+ set_name(alias_id, alias_name);
+
+ emit_op(type_id, alias_id, to_expression(id), true);
+ temporary_to_mirror_precision_alias[id] = alias_id;
+ forced_temporaries.insert(id);
+ forced_temporaries.insert(alias_id);
+ force_recompile_guarantee_forward_progress();
+ id = alias_id;
+ }
+ else
+ {
+ id = itr->second;
+ }
+
+ return id;
+}
+
void CompilerGLSL::handle_invalid_expression(uint32_t id)
{
// We tried to read an invalidated expression.
- // This means we need another pass at compilation, but next time, force temporary variables so that they cannot be invalidated.
- forced_temporaries.insert(id);
- force_recompile();
+ // This means we need another pass at compilation, but next time,
+ // force temporary variables so that they cannot be invalidated.
+ force_temporary_and_recompile(id);
+
+ // If the invalid expression happened as a result of a CompositeInsert
+ // overwrite, we must block this from happening next iteration.
+ if (composite_insert_overwritten.count(id))
+ block_composite_insert_overwrite.insert(id);
}
// Converts the format of the current expression from packed to unpacked,
@@ -4375,19 +4654,7 @@ string CompilerGLSL::to_unpacked_expression(uint32_t id, bool register_expressio
string CompilerGLSL::to_enclosed_unpacked_expression(uint32_t id, bool register_expression_read)
{
- // If we need to transpose, it will also take care of unpacking rules.
- auto *e = maybe_get<SPIRExpression>(id);
- bool need_transpose = e && e->need_transpose;
- bool is_remapped = has_extended_decoration(id, SPIRVCrossDecorationPhysicalTypeID);
- bool is_packed = has_extended_decoration(id, SPIRVCrossDecorationPhysicalTypePacked);
- if (!need_transpose && (is_remapped || is_packed))
- {
- return unpack_expression_type(to_expression(id, register_expression_read), expression_type(id),
- get_extended_decoration(id, SPIRVCrossDecorationPhysicalTypeID),
- has_extended_decoration(id, SPIRVCrossDecorationPhysicalTypePacked), false);
- }
- else
- return to_enclosed_expression(id, register_expression_read);
+ return enclose_expression(to_unpacked_expression(id, register_expression_read));
}
string CompilerGLSL::to_dereferenced_expression(uint32_t id, bool register_expression_read)
@@ -4486,12 +4753,13 @@ string CompilerGLSL::to_rerolled_array_expression(const string &base_expr, const
return expr;
}
-string CompilerGLSL::to_composite_constructor_expression(uint32_t id, bool uses_buffer_offset)
+string CompilerGLSL::to_composite_constructor_expression(uint32_t id, bool block_like_type)
{
auto &type = expression_type(id);
- bool reroll_array = !type.array.empty() && (!backend.array_is_value_type ||
- (uses_buffer_offset && !backend.buffer_offset_array_is_value_type));
+ bool reroll_array = !type.array.empty() &&
+ (!backend.array_is_value_type ||
+ (block_like_type && !backend.array_is_value_type_in_buffer_blocks));
if (reroll_array)
{
@@ -4589,11 +4857,27 @@ string CompilerGLSL::to_expression(uint32_t id, bool register_expression_read)
auto &type = get<SPIRType>(c.constant_type);
// WorkGroupSize may be a constant.
- auto &dec = ir.meta[c.self].decoration;
- if (dec.builtin)
- return builtin_to_glsl(dec.builtin_type, StorageClassGeneric);
+ if (has_decoration(c.self, DecorationBuiltIn))
+ return builtin_to_glsl(BuiltIn(get_decoration(c.self, DecorationBuiltIn)), StorageClassGeneric);
else if (c.specialization)
+ {
+ if (backend.workgroup_size_is_hidden)
+ {
+ int wg_index = get_constant_mapping_to_workgroup_component(c);
+ if (wg_index >= 0)
+ {
+ auto wg_size = join(builtin_to_glsl(BuiltInWorkgroupSize, StorageClassInput), vector_swizzle(1, wg_index));
+ if (type.basetype != SPIRType::UInt)
+ wg_size = bitcast_expression(type, SPIRType::UInt, wg_size);
+ return wg_size;
+ }
+ }
+
+ if (expression_is_forwarded(id))
+ return constant_expression(c);
+
return to_name(id);
+ }
else if (c.is_used_as_lut)
return to_name(id);
else if (type.basetype == SPIRType::Struct && !backend.can_declare_struct_inline)
@@ -4613,7 +4897,20 @@ string CompilerGLSL::to_expression(uint32_t id, bool register_expression_read)
// If we try to use a loop variable before the loop header, we have to redirect it to the static expression,
// the variable has not been declared yet.
if (var.statically_assigned || (var.loop_variable && !var.loop_variable_enable))
- return to_expression(var.static_expression);
+ {
+ // We might try to load from a loop variable before it has been initialized.
+ // Prefer static expression and fallback to initializer.
+ if (var.static_expression)
+ return to_expression(var.static_expression);
+ else if (var.initializer)
+ return to_expression(var.initializer);
+ else
+ {
+ // We cannot declare the variable yet, so have to fake it.
+ uint32_t undef_id = ir.increase_bound_by(1);
+ return emit_uninitialized_temporary_expression(get_variable_data_type_id(var), undef_id).expression;
+ }
+ }
else if (var.deferred_declaration)
{
var.deferred_declaration = false;
@@ -4650,6 +4947,80 @@ string CompilerGLSL::to_expression(uint32_t id, bool register_expression_read)
}
}
+SmallVector<ConstantID> CompilerGLSL::get_composite_constant_ids(ConstantID const_id)
+{
+ if (auto *constant = maybe_get<SPIRConstant>(const_id))
+ {
+ const auto &type = get<SPIRType>(constant->constant_type);
+ if (is_array(type) || type.basetype == SPIRType::Struct)
+ return constant->subconstants;
+ if (is_matrix(type))
+ return constant->m.id;
+ if (is_vector(type))
+ return constant->m.c[0].id;
+ SPIRV_CROSS_THROW("Unexpected scalar constant!");
+ }
+ if (!const_composite_insert_ids.count(const_id))
+ SPIRV_CROSS_THROW("Unimplemented for this OpSpecConstantOp!");
+ return const_composite_insert_ids[const_id];
+}
+
+void CompilerGLSL::fill_composite_constant(SPIRConstant &constant, TypeID type_id,
+ const SmallVector<ConstantID> &initializers)
+{
+ auto &type = get<SPIRType>(type_id);
+ constant.specialization = true;
+ if (is_array(type) || type.basetype == SPIRType::Struct)
+ {
+ constant.subconstants = initializers;
+ }
+ else if (is_matrix(type))
+ {
+ constant.m.columns = type.columns;
+ for (uint32_t i = 0; i < type.columns; ++i)
+ {
+ constant.m.id[i] = initializers[i];
+ constant.m.c[i].vecsize = type.vecsize;
+ }
+ }
+ else if (is_vector(type))
+ {
+ constant.m.c[0].vecsize = type.vecsize;
+ for (uint32_t i = 0; i < type.vecsize; ++i)
+ constant.m.c[0].id[i] = initializers[i];
+ }
+ else
+ SPIRV_CROSS_THROW("Unexpected scalar in SpecConstantOp CompositeInsert!");
+}
+
+void CompilerGLSL::set_composite_constant(ConstantID const_id, TypeID type_id,
+ const SmallVector<ConstantID> &initializers)
+{
+ if (maybe_get<SPIRConstantOp>(const_id))
+ {
+ const_composite_insert_ids[const_id] = initializers;
+ return;
+ }
+
+ auto &constant = set<SPIRConstant>(const_id, type_id);
+ fill_composite_constant(constant, type_id, initializers);
+ forwarded_temporaries.insert(const_id);
+}
+
+TypeID CompilerGLSL::get_composite_member_type(TypeID type_id, uint32_t member_idx)
+{
+ auto &type = get<SPIRType>(type_id);
+ if (is_array(type))
+ return type.parent_type;
+ if (type.basetype == SPIRType::Struct)
+ return type.member_types[member_idx];
+ if (is_matrix(type))
+ return type.parent_type;
+ if (is_vector(type))
+ return type.parent_type;
+ SPIRV_CROSS_THROW("Shouldn't reach lower than vector handling OpSpecConstantOp CompositeInsert!");
+}
+
string CompilerGLSL::constant_op_expression(const SPIRConstantOp &cop)
{
auto &type = get<SPIRType>(cop.basetype);
@@ -4754,10 +5125,21 @@ string CompilerGLSL::constant_op_expression(const SPIRConstantOp &cop)
for (uint32_t i = 2; i < uint32_t(cop.arguments.size()); i++)
{
uint32_t index = cop.arguments[i];
- if (index >= left_components)
+ if (index == 0xFFFFFFFF)
+ {
+ SPIRConstant c;
+ c.constant_type = type.parent_type;
+ assert(type.parent_type != ID(0));
+ expr += constant_expression(c);
+ }
+ else if (index >= left_components)
+ {
expr += right_arg + "." + "xyzw"[index - left_components];
+ }
else
+ {
expr += left_arg + "." + "xyzw"[index];
+ }
if (i + 1 < uint32_t(cop.arguments.size()))
expr += ", ";
@@ -4775,7 +5157,30 @@ string CompilerGLSL::constant_op_expression(const SPIRConstantOp &cop)
}
case OpCompositeInsert:
- SPIRV_CROSS_THROW("OpCompositeInsert spec constant op is not supported.");
+ {
+ SmallVector<ConstantID> new_init = get_composite_constant_ids(cop.arguments[1]);
+ uint32_t idx;
+ uint32_t target_id = cop.self;
+ uint32_t target_type_id = cop.basetype;
+ // We have to drill down to the part we want to modify, and create new
+ // constants for each containing part.
+ for (idx = 2; idx < cop.arguments.size() - 1; ++idx)
+ {
+ uint32_t new_const = ir.increase_bound_by(1);
+ uint32_t old_const = new_init[cop.arguments[idx]];
+ new_init[cop.arguments[idx]] = new_const;
+ set_composite_constant(target_id, target_type_id, new_init);
+ new_init = get_composite_constant_ids(old_const);
+ target_id = new_const;
+ target_type_id = get_composite_member_type(target_type_id, cop.arguments[idx]);
+ }
+ // Now replace the initializer with the one from this instruction.
+ new_init[cop.arguments[idx]] = cop.arguments[0];
+ set_composite_constant(target_id, target_type_id, new_init);
+ SPIRConstant tmp_const(cop.basetype);
+ fill_composite_constant(tmp_const, cop.basetype, const_composite_insert_ids[cop.self]);
+ return constant_expression(tmp_const);
+ }
default:
// Some opcodes are unimplemented here, these are currently not possible to test from glslang.
@@ -4880,7 +5285,7 @@ string CompilerGLSL::constant_op_expression(const SPIRConstantOp &cop)
}
}
-string CompilerGLSL::constant_expression(const SPIRConstant &c)
+string CompilerGLSL::constant_expression(const SPIRConstant &c, bool inside_block_like_struct_scope)
{
auto &type = get<SPIRType>(c.constant_type);
@@ -4893,6 +5298,14 @@ string CompilerGLSL::constant_expression(const SPIRConstant &c)
// Handles Arrays and structures.
string res;
+ // Only consider the decay if we are inside a struct scope where we are emitting a member with Offset decoration.
+ // Outside a block-like struct declaration, we can always bind to a constant array with templated type.
+ // Should look at ArrayStride here as well, but it's possible to declare a constant struct
+ // with Offset = 0, using no ArrayStride on the enclosed array type.
+ // A particular CTS test hits this scenario.
+ bool array_type_decays = inside_block_like_struct_scope &&
+ !type.array.empty() && !backend.array_is_value_type_in_buffer_blocks;
+
// Allow Metal to use the array<T> template to make arrays a value type
bool needs_trailing_tracket = false;
if (backend.use_initializer_list && backend.use_typed_initializer_list && type.basetype == SPIRType::Struct &&
@@ -4901,7 +5314,7 @@ string CompilerGLSL::constant_expression(const SPIRConstant &c)
res = type_to_glsl_constructor(type) + "{ ";
}
else if (backend.use_initializer_list && backend.use_typed_initializer_list && backend.array_is_value_type &&
- !type.array.empty())
+ !type.array.empty() && !array_type_decays)
{
res = type_to_glsl_constructor(type) + "({ ";
needs_trailing_tracket = true;
@@ -4915,16 +5328,40 @@ string CompilerGLSL::constant_expression(const SPIRConstant &c)
res = type_to_glsl_constructor(type) + "(";
}
+ uint32_t subconstant_index = 0;
for (auto &elem : c.subconstants)
{
- auto &subc = get<SPIRConstant>(elem);
- if (subc.specialization)
+ if (auto *op = maybe_get<SPIRConstantOp>(elem))
+ {
+ res += constant_op_expression(*op);
+ }
+ else if (maybe_get<SPIRUndef>(elem) != nullptr)
+ {
res += to_name(elem);
+ }
else
- res += constant_expression(subc);
+ {
+ auto &subc = get<SPIRConstant>(elem);
+ if (subc.specialization && !expression_is_forwarded(elem))
+ res += to_name(elem);
+ else
+ {
+ if (type.array.empty() && type.basetype == SPIRType::Struct)
+ {
+ // When we get down to emitting struct members, override the block-like information.
+ // For constants, we can freely mix and match block-like state.
+ inside_block_like_struct_scope =
+ has_member_decoration(type.self, subconstant_index, DecorationOffset);
+ }
+
+ res += constant_expression(subc, inside_block_like_struct_scope);
+ }
+ }
if (&elem != &c.subconstants.back())
res += ", ";
+
+ subconstant_index++;
}
res += backend.use_initializer_list ? " }" : ")";
@@ -4968,8 +5405,8 @@ string CompilerGLSL::constant_expression(const SPIRConstant &c)
}
#ifdef _MSC_VER
-// sprintf warning.
-// We cannot rely on snprintf existing because, ..., MSVC.
+// snprintf does not exist or is buggy on older MSVC versions, some of them
+// being used by MinGW. Use sprintf instead and disable corresponding warning.
#pragma warning(push)
#pragma warning(disable : 4996)
#endif
@@ -5029,7 +5466,11 @@ string CompilerGLSL::convert_float_to_string(const SPIRConstant &c, uint32_t col
in_type.width = 32;
char print_buffer[32];
+#ifdef _WIN32
sprintf(print_buffer, "0x%xu", c.scalar(col, row));
+#else
+ snprintf(print_buffer, sizeof(print_buffer), "0x%xu", c.scalar(col, row));
+#endif
const char *comment = "inf";
if (float_value == -numeric_limits<float>::infinity())
@@ -5096,13 +5537,18 @@ std::string CompilerGLSL::convert_double_to_string(const SPIRConstant &c, uint32
uint64_t u64_value = c.scalar_u64(col, row);
- if (options.es)
- SPIRV_CROSS_THROW("64-bit integers/float not supported in ES profile.");
+ if (options.es && options.version < 310) // GL_NV_gpu_shader5 fallback requires 310.
+ SPIRV_CROSS_THROW("64-bit integers not supported in ES profile before version 310.");
require_extension_internal("GL_ARB_gpu_shader_int64");
char print_buffer[64];
+#ifdef _WIN32
sprintf(print_buffer, "0x%llx%s", static_cast<unsigned long long>(u64_value),
backend.long_long_literal_suffix ? "ull" : "ul");
+#else
+ snprintf(print_buffer, sizeof(print_buffer), "0x%llx%s", static_cast<unsigned long long>(u64_value),
+ backend.long_long_literal_suffix ? "ull" : "ul");
+#endif
const char *comment = "inf";
if (double_value == -numeric_limits<double>::infinity())
@@ -5235,7 +5681,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
for (uint32_t i = 0; i < c.vector_size(); i++)
{
if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0)
- res += to_name(c.specialization_constant_id(vector, i));
+ res += to_expression(c.specialization_constant_id(vector, i));
else
res += convert_half_to_string(c, vector, i);
@@ -5257,7 +5703,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
for (uint32_t i = 0; i < c.vector_size(); i++)
{
if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0)
- res += to_name(c.specialization_constant_id(vector, i));
+ res += to_expression(c.specialization_constant_id(vector, i));
else
res += convert_float_to_string(c, vector, i);
@@ -5279,7 +5725,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
for (uint32_t i = 0; i < c.vector_size(); i++)
{
if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0)
- res += to_name(c.specialization_constant_id(vector, i));
+ res += to_expression(c.specialization_constant_id(vector, i));
else
res += convert_double_to_string(c, vector, i);
@@ -5290,34 +5736,31 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
break;
case SPIRType::Int64:
+ {
+ auto tmp = type;
+ tmp.vecsize = 1;
+ tmp.columns = 1;
+ auto int64_type = type_to_glsl(tmp);
+
if (splat)
{
- res += convert_to_string(c.scalar_i64(vector, 0));
- if (backend.long_long_literal_suffix)
- res += "ll";
- else
- res += "l";
+ res += convert_to_string(c.scalar_i64(vector, 0), int64_type, backend.long_long_literal_suffix);
}
else
{
for (uint32_t i = 0; i < c.vector_size(); i++)
{
if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0)
- res += to_name(c.specialization_constant_id(vector, i));
+ res += to_expression(c.specialization_constant_id(vector, i));
else
- {
- res += convert_to_string(c.scalar_i64(vector, i));
- if (backend.long_long_literal_suffix)
- res += "ll";
- else
- res += "l";
- }
+ res += convert_to_string(c.scalar_i64(vector, i), int64_type, backend.long_long_literal_suffix);
if (i + 1 < c.vector_size())
res += ", ";
}
}
break;
+ }
case SPIRType::UInt64:
if (splat)
@@ -5333,7 +5776,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
for (uint32_t i = 0; i < c.vector_size(); i++)
{
if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0)
- res += to_name(c.specialization_constant_id(vector, i));
+ res += to_expression(c.specialization_constant_id(vector, i));
else
{
res += convert_to_string(c.scalar_u64(vector, i));
@@ -5368,7 +5811,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
for (uint32_t i = 0; i < c.vector_size(); i++)
{
if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0)
- res += to_name(c.specialization_constant_id(vector, i));
+ res += to_expression(c.specialization_constant_id(vector, i));
else
{
res += convert_to_string(c.scalar(vector, i));
@@ -5398,7 +5841,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
for (uint32_t i = 0; i < c.vector_size(); i++)
{
if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0)
- res += to_name(c.specialization_constant_id(vector, i));
+ res += to_expression(c.specialization_constant_id(vector, i));
else
res += convert_to_string(c.scalar_i32(vector, i));
if (i + 1 < c.vector_size())
@@ -5417,7 +5860,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
for (uint32_t i = 0; i < c.vector_size(); i++)
{
if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0)
- res += to_name(c.specialization_constant_id(vector, i));
+ res += to_expression(c.specialization_constant_id(vector, i));
else
{
if (*backend.uint16_t_literal_suffix)
@@ -5451,7 +5894,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
for (uint32_t i = 0; i < c.vector_size(); i++)
{
if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0)
- res += to_name(c.specialization_constant_id(vector, i));
+ res += to_expression(c.specialization_constant_id(vector, i));
else
{
if (*backend.int16_t_literal_suffix)
@@ -5485,7 +5928,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
for (uint32_t i = 0; i < c.vector_size(); i++)
{
if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0)
- res += to_name(c.specialization_constant_id(vector, i));
+ res += to_expression(c.specialization_constant_id(vector, i));
else
{
res += type_to_glsl(scalar_type);
@@ -5510,7 +5953,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
for (uint32_t i = 0; i < c.vector_size(); i++)
{
if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0)
- res += to_name(c.specialization_constant_id(vector, i));
+ res += to_expression(c.specialization_constant_id(vector, i));
else
{
res += type_to_glsl(scalar_type);
@@ -5533,7 +5976,7 @@ string CompilerGLSL::constant_expression_vector(const SPIRConstant &c, uint32_t
for (uint32_t i = 0; i < c.vector_size(); i++)
{
if (c.vector_size() > 1 && c.specialization_constant_id(vector, i) != 0)
- res += to_name(c.specialization_constant_id(vector, i));
+ res += to_expression(c.specialization_constant_id(vector, i));
else
res += c.scalar(vector, i) ? "true" : "false";
@@ -5564,7 +6007,7 @@ void CompilerGLSL::emit_uninitialized_temporary(uint32_t result_type, uint32_t r
{
// If we're declaring temporaries inside continue blocks,
// we must declare the temporary in the loop header so that the continue block can avoid declaring new variables.
- if (current_continue_block && !hoisted_temporaries.count(result_id))
+ if (!block_temporary_hoisting && current_continue_block && !hoisted_temporaries.count(result_id))
{
auto &header = get<SPIRBlock>(current_continue_block->loop_dominator);
if (find_if(begin(header.declare_temporary), end(header.declare_temporary),
@@ -5580,7 +6023,7 @@ void CompilerGLSL::emit_uninitialized_temporary(uint32_t result_type, uint32_t r
else if (hoisted_temporaries.count(result_id) == 0)
{
auto &type = get<SPIRType>(result_type);
- auto &flags = ir.meta[result_id].decoration.decoration_flags;
+ auto &flags = get_decoration_bitset(result_id);
// The result_id has not been made into an expression yet, so use flags interface.
add_local_variable_name(result_id);
@@ -5596,11 +6039,10 @@ void CompilerGLSL::emit_uninitialized_temporary(uint32_t result_type, uint32_t r
string CompilerGLSL::declare_temporary(uint32_t result_type, uint32_t result_id)
{
auto &type = get<SPIRType>(result_type);
- auto &flags = ir.meta[result_id].decoration.decoration_flags;
// If we're declaring temporaries inside continue blocks,
// we must declare the temporary in the loop header so that the continue block can avoid declaring new variables.
- if (current_continue_block && !hoisted_temporaries.count(result_id))
+ if (!block_temporary_hoisting && current_continue_block && !hoisted_temporaries.count(result_id))
{
auto &header = get<SPIRBlock>(current_continue_block->loop_dominator);
if (find_if(begin(header.declare_temporary), end(header.declare_temporary),
@@ -5610,7 +6052,7 @@ string CompilerGLSL::declare_temporary(uint32_t result_type, uint32_t result_id)
{
header.declare_temporary.emplace_back(result_type, result_id);
hoisted_temporaries.insert(result_id);
- force_recompile();
+ force_recompile_guarantee_forward_progress();
}
return join(to_name(result_id), " = ");
@@ -5624,6 +6066,7 @@ string CompilerGLSL::declare_temporary(uint32_t result_type, uint32_t result_id)
{
// The result_id has not been made into an expression yet, so use flags interface.
add_local_variable_name(result_id);
+ auto &flags = get_decoration_bitset(result_id);
return join(flags_to_qualifiers_glsl(type, flags), variable_decl(type, to_name(result_id)), " = ");
}
}
@@ -5677,6 +6120,14 @@ void CompilerGLSL::emit_unary_op(uint32_t result_type, uint32_t result_id, uint3
inherit_expression_dependencies(result_id, op0);
}
+void CompilerGLSL::emit_unary_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, const char *op)
+{
+ auto &type = get<SPIRType>(result_type);
+ bool forward = should_forward(op0);
+ emit_op(result_type, result_id, join(type_to_glsl(type), "(", op, to_enclosed_unpacked_expression(op0), ")"), forward);
+ inherit_expression_dependencies(result_id, op0);
+}
+
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.
@@ -5820,7 +6271,9 @@ bool CompilerGLSL::emit_complex_bitcast(uint32_t result_type, uint32_t id, uint3
}
void CompilerGLSL::emit_binary_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1,
- const char *op, SPIRType::BaseType input_type, bool skip_cast_if_equal_type)
+ const char *op, SPIRType::BaseType input_type,
+ bool skip_cast_if_equal_type,
+ bool implicit_integer_promotion)
{
string cast_op0, cast_op1;
auto expected_type = binary_op_bitcast_helper(cast_op0, cast_op1, input_type, op0, op1, skip_cast_if_equal_type);
@@ -5829,17 +6282,23 @@ void CompilerGLSL::emit_binary_op_cast(uint32_t result_type, uint32_t result_id,
// We might have casted away from the result type, so bitcast again.
// For example, arithmetic right shift with uint inputs.
// Special case boolean outputs since relational opcodes output booleans instead of int/uint.
+ auto bitop = join(cast_op0, " ", op, " ", cast_op1);
string expr;
- if (out_type.basetype != input_type && out_type.basetype != SPIRType::Boolean)
+
+ if (implicit_integer_promotion)
+ {
+ // Simple value cast.
+ expr = join(type_to_glsl(out_type), '(', bitop, ')');
+ }
+ else if (out_type.basetype != input_type && out_type.basetype != SPIRType::Boolean)
{
expected_type.basetype = input_type;
- expr = bitcast_glsl_op(out_type, expected_type);
- expr += '(';
- expr += join(cast_op0, " ", op, " ", cast_op1);
- expr += ')';
+ expr = join(bitcast_glsl_op(out_type, expected_type), '(', bitop, ')');
}
else
- expr += join(cast_op0, " ", op, " ", cast_op1);
+ {
+ expr = std::move(bitop);
+ }
emit_op(result_type, result_id, expr, should_forward(op0) && should_forward(op1));
inherit_expression_dependencies(result_id, op0);
@@ -5866,6 +6325,16 @@ void CompilerGLSL::emit_binary_func_op(uint32_t result_type, uint32_t result_id,
void CompilerGLSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1,
const char *op)
{
+ auto &type = get<SPIRType>(result_type);
+ if (type_is_floating_point(type))
+ {
+ if (!options.vulkan_semantics)
+ SPIRV_CROSS_THROW("Floating point atomics requires Vulkan semantics.");
+ if (options.es)
+ SPIRV_CROSS_THROW("Floating point atomics requires desktop GLSL.");
+ require_extension_internal("GL_EXT_shader_atomic_float");
+ }
+
forced_temporaries.insert(result_id);
emit_op(result_type, result_id,
join(op, "(", to_non_uniform_aware_expression(op0), ", ",
@@ -6140,7 +6609,11 @@ string CompilerGLSL::legacy_tex_op(const std::string &op, const SPIRType &imgtyp
switch (imgtype.image.dim)
{
case spv::Dim1D:
- type = (imgtype.image.arrayed && !options.es) ? "1DArray" : "1D";
+ // Force 2D path for ES.
+ if (options.es)
+ type = (imgtype.image.arrayed && !options.es) ? "2DArray" : "2D";
+ else
+ type = (imgtype.image.arrayed && !options.es) ? "1DArray" : "1D";
break;
case spv::Dim2D:
type = (imgtype.image.arrayed && !options.es) ? "2DArray" : "2D";
@@ -6192,7 +6665,7 @@ string CompilerGLSL::legacy_tex_op(const std::string &op, const SPIRType &imgtyp
// GLES has very limited support for shadow samplers.
// Basically shadow2D and shadow2DProj work through EXT_shadow_samplers,
// everything else can just throw
- bool is_comparison = image_is_comparison(imgtype, tex);
+ bool is_comparison = is_depth_image(imgtype, tex);
if (is_comparison && is_legacy_es())
{
if (op == "texture" || op == "textureProj")
@@ -6266,48 +6739,49 @@ bool CompilerGLSL::to_trivial_mix_op(const SPIRType &type, string &op, uint32_t
if (!backend.use_constructor_splatting && value_type.vecsize != lerptype.vecsize)
return false;
+ // Only valid way in SPIR-V 1.4 to use matrices in select is a scalar select.
+ // matrix(scalar) constructor fills in diagnonals, so gets messy very quickly.
+ // Just avoid this case.
+ if (value_type.columns > 1)
+ return false;
+
// If our bool selects between 0 and 1, we can cast from bool instead, making our trivial constructor.
bool ret = true;
- for (uint32_t col = 0; col < value_type.columns; col++)
+ for (uint32_t row = 0; ret && row < value_type.vecsize; row++)
{
- for (uint32_t row = 0; row < value_type.vecsize; row++)
+ switch (type.basetype)
{
- switch (type.basetype)
- {
- case SPIRType::Short:
- case SPIRType::UShort:
- ret = cleft->scalar_u16(col, row) == 0 && cright->scalar_u16(col, row) == 1;
- break;
-
- case SPIRType::Int:
- case SPIRType::UInt:
- ret = cleft->scalar(col, row) == 0 && cright->scalar(col, row) == 1;
- break;
+ case SPIRType::Short:
+ case SPIRType::UShort:
+ ret = cleft->scalar_u16(0, row) == 0 && cright->scalar_u16(0, row) == 1;
+ break;
- case SPIRType::Half:
- ret = cleft->scalar_f16(col, row) == 0.0f && cright->scalar_f16(col, row) == 1.0f;
- break;
+ case SPIRType::Int:
+ case SPIRType::UInt:
+ ret = cleft->scalar(0, row) == 0 && cright->scalar(0, row) == 1;
+ break;
- case SPIRType::Float:
- ret = cleft->scalar_f32(col, row) == 0.0f && cright->scalar_f32(col, row) == 1.0f;
- break;
+ case SPIRType::Half:
+ ret = cleft->scalar_f16(0, row) == 0.0f && cright->scalar_f16(0, row) == 1.0f;
+ break;
- case SPIRType::Double:
- ret = cleft->scalar_f64(col, row) == 0.0 && cright->scalar_f64(col, row) == 1.0;
- break;
+ case SPIRType::Float:
+ ret = cleft->scalar_f32(0, row) == 0.0f && cright->scalar_f32(0, row) == 1.0f;
+ break;
- case SPIRType::Int64:
- case SPIRType::UInt64:
- ret = cleft->scalar_u64(col, row) == 0 && cright->scalar_u64(col, row) == 1;
- break;
+ case SPIRType::Double:
+ ret = cleft->scalar_f64(0, row) == 0.0 && cright->scalar_f64(0, row) == 1.0;
+ break;
- default:
- return false;
- }
- }
+ case SPIRType::Int64:
+ case SPIRType::UInt64:
+ ret = cleft->scalar_u64(0, row) == 0 && cright->scalar_u64(0, row) == 1;
+ break;
- if (!ret)
+ default:
+ ret = false;
break;
+ }
}
if (ret)
@@ -6817,8 +7291,8 @@ std::string CompilerGLSL::to_texture_op(const Instruction &i, bool sparse, bool
expr += to_function_args(args, forward);
expr += ")";
- // texture(samplerXShadow) returns float. shadowX() returns vec4. Swizzle here.
- if (is_legacy() && image_is_comparison(imgtype, img))
+ // texture(samplerXShadow) returns float. shadowX() returns vec4, but only in desktop GLSL. Swizzle here.
+ if (is_legacy() && !options.es && is_depth_image(imgtype, img))
expr += ".r";
// Sampling from a texture which was deduced to be a depth image, might actually return 1 component here.
@@ -6829,16 +7303,16 @@ std::string CompilerGLSL::to_texture_op(const Instruction &i, bool sparse, bool
const auto *combined = maybe_get<SPIRCombinedImageSampler>(img);
VariableID image_id = combined ? combined->image : img;
- if (combined && image_is_comparison(imgtype, combined->image))
+ if (combined && is_depth_image(imgtype, combined->image))
image_is_depth = true;
- else if (image_is_comparison(imgtype, img))
+ else if (is_depth_image(imgtype, img))
image_is_depth = true;
// We must also check the backing variable for the image.
// We might have loaded an OpImage, and used that handle for two different purposes.
// Once with comparison, once without.
auto *image_variable = maybe_get_backing_variable(image_id);
- if (image_variable && image_is_comparison(get<SPIRType>(image_variable->basetype), image_variable->self))
+ if (image_variable && is_depth_image(get<SPIRType>(image_variable->basetype), image_variable->self))
image_is_depth = true;
if (image_is_depth)
@@ -6881,7 +7355,7 @@ bool CompilerGLSL::expression_is_non_value_type_array(uint32_t ptr)
return false;
auto &backed_type = get<SPIRType>(var->basetype);
- return !backend.buffer_offset_array_is_value_type && backed_type.basetype == SPIRType::Struct &&
+ return !backend.array_is_value_type_in_buffer_blocks && backed_type.basetype == SPIRType::Struct &&
has_member_decoration(backed_type.self, 0, DecorationOffset);
}
@@ -6906,7 +7380,7 @@ string CompilerGLSL::to_function_name(const TextureFunctionNameArguments &args)
// This happens for HLSL SampleCmpLevelZero on Texture2DArray and TextureCube.
bool workaround_lod_array_shadow_as_grad = false;
if (((imgtype.image.arrayed && imgtype.image.dim == Dim2D) || imgtype.image.dim == DimCube) &&
- image_is_comparison(imgtype, tex) && args.lod)
+ is_depth_image(imgtype, tex) && args.lod && !args.base.is_fetch)
{
if (!expression_is_constant_null(args.lod))
{
@@ -7050,7 +7524,7 @@ string CompilerGLSL::to_function_args(const TextureFunctionArguments &args, bool
// This happens for HLSL SampleCmpLevelZero on Texture2DArray and TextureCube.
bool workaround_lod_array_shadow_as_grad =
((imgtype.image.arrayed && imgtype.image.dim == Dim2D) || imgtype.image.dim == DimCube) &&
- image_is_comparison(imgtype, img) && args.lod != 0;
+ is_depth_image(imgtype, img) && args.lod != 0 && !args.base.is_fetch;
if (args.dref)
{
@@ -7099,10 +7573,29 @@ string CompilerGLSL::to_function_args(const TextureFunctionArguments &args, bool
// Create a composite which merges coord/dref into a single vector.
auto type = expression_type(args.coord);
type.vecsize = args.coord_components + 1;
+ if (imgtype.image.dim == Dim1D && options.es)
+ type.vecsize++;
farg_str += ", ";
farg_str += type_to_glsl_constructor(type);
farg_str += "(";
- farg_str += coord_expr;
+
+ if (imgtype.image.dim == Dim1D && options.es)
+ {
+ if (imgtype.image.arrayed)
+ {
+ farg_str += enclose_expression(coord_expr) + ".x";
+ farg_str += ", 0.0, ";
+ farg_str += enclose_expression(coord_expr) + ".y";
+ }
+ else
+ {
+ farg_str += coord_expr;
+ farg_str += ", 0.0";
+ }
+ }
+ else
+ farg_str += coord_expr;
+
farg_str += ", ";
farg_str += to_expression(args.dref);
farg_str += ")";
@@ -7110,6 +7603,33 @@ string CompilerGLSL::to_function_args(const TextureFunctionArguments &args, bool
}
else
{
+ if (imgtype.image.dim == Dim1D && options.es)
+ {
+ // Have to fake a second coordinate.
+ if (type_is_floating_point(coord_type))
+ {
+ // Cannot mix proj and array.
+ if (imgtype.image.arrayed || args.base.is_proj)
+ {
+ coord_expr = join("vec3(", enclose_expression(coord_expr), ".x, 0.0, ",
+ enclose_expression(coord_expr), ".y)");
+ }
+ else
+ coord_expr = join("vec2(", coord_expr, ", 0.0)");
+ }
+ else
+ {
+ if (imgtype.image.arrayed)
+ {
+ coord_expr = join("ivec3(", enclose_expression(coord_expr),
+ ".x, 0, ",
+ enclose_expression(coord_expr), ".y)");
+ }
+ else
+ coord_expr = join("ivec2(", coord_expr, ", 0)");
+ }
+ }
+
farg_str += ", ";
farg_str += coord_expr;
}
@@ -7140,18 +7660,11 @@ string CompilerGLSL::to_function_args(const TextureFunctionArguments &args, bool
forward = forward && should_forward(args.lod);
farg_str += ", ";
- auto &lod_expr_type = expression_type(args.lod);
-
// Lod expression for TexelFetch in GLSL must be int, and only int.
- if (args.base.is_fetch && imgtype.image.dim != DimBuffer && !imgtype.image.ms &&
- lod_expr_type.basetype != SPIRType::Int)
- {
- farg_str += join("int(", to_expression(args.lod), ")");
- }
+ if (args.base.is_fetch && imgtype.image.dim != DimBuffer && !imgtype.image.ms)
+ farg_str += bitcast_expression(SPIRType::Int, args.lod);
else
- {
farg_str += to_expression(args.lod);
- }
}
}
else if (args.base.is_fetch && imgtype.image.dim != DimBuffer && !imgtype.image.ms)
@@ -7164,19 +7677,19 @@ string CompilerGLSL::to_function_args(const TextureFunctionArguments &args, bool
{
forward = forward && should_forward(args.coffset);
farg_str += ", ";
- farg_str += to_expression(args.coffset);
+ farg_str += bitcast_expression(SPIRType::Int, args.coffset);
}
else if (args.offset)
{
forward = forward && should_forward(args.offset);
farg_str += ", ";
- farg_str += to_expression(args.offset);
+ farg_str += bitcast_expression(SPIRType::Int, args.offset);
}
if (args.sample)
{
farg_str += ", ";
- farg_str += to_expression(args.sample);
+ farg_str += bitcast_expression(SPIRType::Int, args.sample);
}
if (args.min_lod)
@@ -7203,11 +7716,7 @@ string CompilerGLSL::to_function_args(const TextureFunctionArguments &args, bool
{
forward = forward && should_forward(args.component);
farg_str += ", ";
- auto &component_type = expression_type(args.component);
- if (component_type.basetype == SPIRType::Int)
- farg_str += to_expression(args.component);
- else
- farg_str += join("int(", to_expression(args.component), ")");
+ farg_str += bitcast_expression(SPIRType::Int, args.component);
}
*p_forward = forward;
@@ -7215,6 +7724,63 @@ string CompilerGLSL::to_function_args(const TextureFunctionArguments &args, bool
return farg_str;
}
+Op CompilerGLSL::get_remapped_spirv_op(Op op) const
+{
+ if (options.relax_nan_checks)
+ {
+ switch (op)
+ {
+ case OpFUnordLessThan:
+ op = OpFOrdLessThan;
+ break;
+ case OpFUnordLessThanEqual:
+ op = OpFOrdLessThanEqual;
+ break;
+ case OpFUnordGreaterThan:
+ op = OpFOrdGreaterThan;
+ break;
+ case OpFUnordGreaterThanEqual:
+ op = OpFOrdGreaterThanEqual;
+ break;
+ case OpFUnordEqual:
+ op = OpFOrdEqual;
+ break;
+ case OpFOrdNotEqual:
+ op = OpFUnordNotEqual;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+ return op;
+}
+
+GLSLstd450 CompilerGLSL::get_remapped_glsl_op(GLSLstd450 std450_op) const
+{
+ // Relax to non-NaN aware opcodes.
+ if (options.relax_nan_checks)
+ {
+ switch (std450_op)
+ {
+ case GLSLstd450NClamp:
+ std450_op = GLSLstd450FClamp;
+ break;
+ case GLSLstd450NMin:
+ std450_op = GLSLstd450FMin;
+ break;
+ case GLSLstd450NMax:
+ std450_op = GLSLstd450FMax;
+ break;
+ default:
+ break;
+ }
+ }
+
+ return std450_op;
+}
+
void CompilerGLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop, const uint32_t *args, uint32_t length)
{
auto op = static_cast<GLSLstd450>(eop);
@@ -7227,6 +7793,8 @@ void CompilerGLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop,
auto int_type = to_signed_basetype(integer_width);
auto uint_type = to_unsigned_basetype(integer_width);
+ op = get_remapped_glsl_op(op);
+
switch (op)
{
// FP fiddling
@@ -8449,24 +9017,42 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage)
case BuiltInIncomingRayFlagsKHR:
return ray_tracing_is_khr ? "gl_IncomingRayFlagsEXT" : "gl_IncomingRayFlagsNV";
- case BuiltInBaryCoordNV:
+ case BuiltInBaryCoordKHR:
{
if (options.es && options.version < 320)
- SPIRV_CROSS_THROW("gl_BaryCoordNV requires ESSL 320.");
+ SPIRV_CROSS_THROW("gl_BaryCoordEXT requires ESSL 320.");
else if (!options.es && options.version < 450)
- SPIRV_CROSS_THROW("gl_BaryCoordNV requires GLSL 450.");
- require_extension_internal("GL_NV_fragment_shader_barycentric");
- return "gl_BaryCoordNV";
+ SPIRV_CROSS_THROW("gl_BaryCoordEXT requires GLSL 450.");
+
+ if (barycentric_is_nv)
+ {
+ require_extension_internal("GL_NV_fragment_shader_barycentric");
+ return "gl_BaryCoordNV";
+ }
+ else
+ {
+ require_extension_internal("GL_EXT_fragment_shader_barycentric");
+ return "gl_BaryCoordEXT";
+ }
}
case BuiltInBaryCoordNoPerspNV:
{
if (options.es && options.version < 320)
- SPIRV_CROSS_THROW("gl_BaryCoordNoPerspNV requires ESSL 320.");
+ SPIRV_CROSS_THROW("gl_BaryCoordNoPerspEXT requires ESSL 320.");
else if (!options.es && options.version < 450)
- SPIRV_CROSS_THROW("gl_BaryCoordNoPerspNV requires GLSL 450.");
- require_extension_internal("GL_NV_fragment_shader_barycentric");
- return "gl_BaryCoordNoPerspNV";
+ SPIRV_CROSS_THROW("gl_BaryCoordNoPerspEXT requires GLSL 450.");
+
+ if (barycentric_is_nv)
+ {
+ require_extension_internal("GL_NV_fragment_shader_barycentric");
+ return "gl_BaryCoordNoPerspNV";
+ }
+ else
+ {
+ require_extension_internal("GL_EXT_fragment_shader_barycentric");
+ return "gl_BaryCoordNoPerspEXT";
+ }
}
case BuiltInFragStencilRefEXT:
@@ -8509,6 +9095,15 @@ string CompilerGLSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage)
SPIRV_CROSS_THROW("Need desktop GL to use GL_NV_conservative_raster_underestimation.");
return "gl_FragFullyCoveredNV";
+ case BuiltInPrimitiveTriangleIndicesEXT:
+ return "gl_PrimitiveTriangleIndicesEXT";
+ case BuiltInPrimitiveLineIndicesEXT:
+ return "gl_PrimitiveLineIndicesEXT";
+ case BuiltInPrimitivePointIndicesEXT:
+ return "gl_PrimitivePointIndicesEXT";
+ case BuiltInCullPrimitiveEXT:
+ return "gl_CullPrimitiveEXT";
+
default:
return join("gl_BuiltIn_", convert_to_string(builtin));
}
@@ -8527,25 +9122,36 @@ const char *CompilerGLSL::index_to_swizzle(uint32_t index)
case 3:
return "w";
default:
- SPIRV_CROSS_THROW("Swizzle index out of range");
+ return "x"; // Don't crash, but engage the "undefined behavior" described for out-of-bounds logical addressing in spec.
}
}
void CompilerGLSL::access_chain_internal_append_index(std::string &expr, uint32_t /*base*/, const SPIRType * /*type*/,
- AccessChainFlags flags, bool & /*access_chain_is_arrayed*/,
+ AccessChainFlags flags, bool &access_chain_is_arrayed,
uint32_t index)
{
bool index_is_literal = (flags & ACCESS_CHAIN_INDEX_IS_LITERAL_BIT) != 0;
+ bool ptr_chain = (flags & ACCESS_CHAIN_PTR_CHAIN_BIT) != 0;
bool register_expression_read = (flags & ACCESS_CHAIN_SKIP_REGISTER_EXPRESSION_READ_BIT) == 0;
- expr += "[";
+ string idx_expr = index_is_literal ? convert_to_string(index) : to_unpacked_expression(index, register_expression_read);
- if (index_is_literal)
- expr += convert_to_string(index);
+ // For the case where the base of an OpPtrAccessChain already ends in [n],
+ // we need to use the index as an offset to the existing index, otherwise,
+ // we can just use the index directly.
+ if (ptr_chain && access_chain_is_arrayed)
+ {
+ size_t split_pos = expr.find_last_of(']');
+ string expr_front = expr.substr(0, split_pos);
+ string expr_back = expr.substr(split_pos);
+ expr = expr_front + " + " + enclose_expression(idx_expr) + expr_back;
+ }
else
- expr += to_expression(index, register_expression_read);
-
- expr += "]";
+ {
+ expr += "[";
+ expr += idx_expr;
+ expr += "]";
+ }
}
bool CompilerGLSL::access_chain_needs_stage_io_builtin_translation(uint32_t)
@@ -8602,14 +9208,18 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice
bool is_packed = has_extended_decoration(base, SPIRVCrossDecorationPhysicalTypePacked);
uint32_t physical_type = get_extended_decoration(base, SPIRVCrossDecorationPhysicalTypeID);
bool is_invariant = has_decoration(base, DecorationInvariant);
+ bool relaxed_precision = has_decoration(base, DecorationRelaxedPrecision);
bool pending_array_enclose = false;
bool dimension_flatten = false;
- const auto append_index = [&](uint32_t index, bool is_literal) {
+ const auto append_index = [&](uint32_t index, bool is_literal, bool is_ptr_chain = false) {
AccessChainFlags mod_flags = flags;
if (!is_literal)
mod_flags &= ~ACCESS_CHAIN_INDEX_IS_LITERAL_BIT;
+ if (!is_ptr_chain)
+ mod_flags &= ~ACCESS_CHAIN_PTR_CHAIN_BIT;
access_chain_internal_append_index(expr, base, type, mod_flags, access_chain_is_arrayed, index);
+ check_physical_type_cast(expr, type, physical_type);
};
for (uint32_t i = 0; i < count; i++)
@@ -8660,7 +9270,7 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice
}
else
{
- append_index(index, is_literal);
+ append_index(index, is_literal, true);
}
if (type->basetype == SPIRType::ControlPointArray)
@@ -8695,14 +9305,19 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice
// but HLSL seems to just emit straight arrays here.
// We must pretend this access goes through gl_in/gl_out arrays
// to be able to access certain builtins as arrays.
+ // Similar concerns apply for mesh shaders where we have to redirect to gl_MeshVerticesEXT or MeshPrimitivesEXT.
auto builtin = ir.meta[base].decoration.builtin_type;
+ bool mesh_shader = get_execution_model() == ExecutionModelMeshEXT;
+
switch (builtin)
{
// case BuiltInCullDistance: // These are already arrays, need to figure out rules for these in tess/geom.
// case BuiltInClipDistance:
case BuiltInPosition:
case BuiltInPointSize:
- if (var->storage == StorageClassInput)
+ if (mesh_shader)
+ expr = join("gl_MeshVerticesEXT[", to_expression(index, register_expression_read), "].", expr);
+ else if (var->storage == StorageClassInput)
expr = join("gl_in[", to_expression(index, register_expression_read), "].", expr);
else if (var->storage == StorageClassOutput)
expr = join("gl_out[", to_expression(index, register_expression_read), "].", expr);
@@ -8710,11 +9325,30 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice
append_index(index, is_literal);
break;
+ case BuiltInPrimitiveId:
+ case BuiltInLayer:
+ case BuiltInViewportIndex:
+ case BuiltInCullPrimitiveEXT:
+ case BuiltInPrimitiveShadingRateKHR:
+ if (mesh_shader)
+ expr = join("gl_MeshPrimitivesEXT[", to_expression(index, register_expression_read), "].", expr);
+ else
+ append_index(index, is_literal);
+ break;
+
default:
append_index(index, is_literal);
break;
}
}
+ else if (backend.force_merged_mesh_block && i == 0 && var &&
+ !is_builtin_variable(*var) && var->storage == StorageClassOutput)
+ {
+ if (is_per_primitive_variable(*var))
+ expr = join("gl_MeshPrimitivesEXT[", to_expression(index, register_expression_read), "].", expr);
+ else
+ expr = join("gl_MeshVerticesEXT[", to_expression(index, register_expression_read), "].", expr);
+ }
else if (options.flatten_multidimensional_arrays && dimension_flatten)
{
// If we are flattening multidimensional arrays, do manual stride computation.
@@ -8751,17 +9385,20 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice
access_chain_is_arrayed = true;
}
- // For structs, the index refers to a constant, which indexes into the members.
+ // For structs, the index refers to a constant, which indexes into the members, possibly through a redirection mapping.
// We also check if this member is a builtin, since we then replace the entire expression with the builtin one.
else if (type->basetype == SPIRType::Struct)
{
if (!is_literal)
index = evaluate_constant_u32(index);
+ if (index < uint32_t(type->member_type_index_redirection.size()))
+ index = type->member_type_index_redirection[index];
+
if (index >= type->member_types.size())
SPIRV_CROSS_THROW("Member index is out of bounds!");
- BuiltIn builtin;
+ BuiltIn builtin = BuiltInMax;
if (is_member_builtin(*type, index, &builtin) && access_chain_needs_stage_io_builtin_translation(base))
{
if (access_chain_is_arrayed)
@@ -8781,11 +9418,19 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice
else if (flatten_member_reference)
expr += join("_", to_member_name(*type, index));
else
- expr += to_member_reference(base, *type, index, ptr_chain);
+ {
+ // Any pointer de-refences for values are handled in the first access chain.
+ // For pointer chains, the pointer-ness is resolved through an array access.
+ // The only time this is not true is when accessing array of SSBO/UBO.
+ // This case is explicitly handled.
+ expr += to_member_reference(base, *type, index, ptr_chain || i != 0);
+ }
}
if (has_member_decoration(type->self, index, DecorationInvariant))
is_invariant = true;
+ if (has_member_decoration(type->self, index, DecorationRelaxedPrecision))
+ relaxed_precision = true;
is_packed = member_is_packed_physical_type(*type, index);
if (member_is_remapped_physical_type(*type, index))
@@ -8807,7 +9452,7 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice
if (is_literal)
expr += convert_to_string(index);
else
- expr += to_expression(index, register_expression_read);
+ expr += to_unpacked_expression(index, register_expression_read);
expr += "]";
type_id = type->parent_type;
@@ -8862,34 +9507,41 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice
is_packed);
}
- if (is_literal && !is_packed && !row_major_matrix_needs_conversion)
+ if (is_literal)
{
- expr += ".";
- expr += index_to_swizzle(index);
+ bool out_of_bounds = (index >= type->vecsize);
+
+ if (!is_packed && !row_major_matrix_needs_conversion)
+ {
+ expr += ".";
+ expr += index_to_swizzle(out_of_bounds ? 0 : index);
+ }
+ else
+ {
+ // For packed vectors, we can only access them as an array, not by swizzle.
+ expr += join("[", out_of_bounds ? 0 : index, "]");
+ }
}
else if (ir.ids[index].get_type() == TypeConstant && !is_packed && !row_major_matrix_needs_conversion)
{
auto &c = get<SPIRConstant>(index);
+ bool out_of_bounds = (c.scalar() >= type->vecsize);
+
if (c.specialization)
{
// If the index is a spec constant, we cannot turn extract into a swizzle.
- expr += join("[", to_expression(index), "]");
+ expr += join("[", out_of_bounds ? "0" : to_expression(index), "]");
}
else
{
expr += ".";
- expr += index_to_swizzle(c.scalar());
+ expr += index_to_swizzle(out_of_bounds ? 0 : c.scalar());
}
}
- else if (is_literal)
- {
- // For packed vectors, we can only access them as an array, not by swizzle.
- expr += join("[", index, "]");
- }
else
{
expr += "[";
- expr += to_expression(index, register_expression_read);
+ expr += to_unpacked_expression(index, register_expression_read);
expr += "]";
}
@@ -8924,11 +9576,16 @@ string CompilerGLSL::access_chain_internal(uint32_t base, const uint32_t *indice
meta->storage_is_packed = is_packed;
meta->storage_is_invariant = is_invariant;
meta->storage_physical_type = physical_type;
+ meta->relaxed_precision = relaxed_precision;
}
return expr;
}
+void CompilerGLSL::check_physical_type_cast(std::string &, const SPIRType *, uint32_t)
+{
+}
+
void CompilerGLSL::prepare_access_chain_for_scalar_access(std::string &, const SPIRType &, spv::StorageClass, bool &)
{
}
@@ -9082,8 +9739,13 @@ std::string CompilerGLSL::flattened_access_chain_struct(uint32_t base, const uin
{
std::string expr;
- expr += type_to_glsl_constructor(target_type);
- expr += "(";
+ if (backend.can_declare_struct_inline)
+ {
+ expr += type_to_glsl_constructor(target_type);
+ expr += "(";
+ }
+ else
+ expr += "{";
for (uint32_t i = 0; i < uint32_t(target_type.member_types.size()); ++i)
{
@@ -9113,7 +9775,7 @@ std::string CompilerGLSL::flattened_access_chain_struct(uint32_t base, const uin
expr += tmp;
}
- expr += ")";
+ expr += backend.can_declare_struct_inline ? ")" : "}";
return expr;
}
@@ -9405,9 +10067,32 @@ bool CompilerGLSL::should_dereference(uint32_t id)
if (auto *var = maybe_get<SPIRVariable>(id))
return var->phi_variable;
- // If id is an access chain, we should not dereference it.
if (auto *expr = maybe_get<SPIRExpression>(id))
- return !expr->access_chain;
+ {
+ // If id is an access chain, we should not dereference it.
+ if (expr->access_chain)
+ return false;
+
+ // If id is a forwarded copy of a variable pointer, we should not dereference it.
+ SPIRVariable *var = nullptr;
+ while (expr->loaded_from && expression_is_forwarded(expr->self))
+ {
+ auto &src_type = expression_type(expr->loaded_from);
+ // To be a copy, the pointer and its source expression must be the
+ // 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 ||
+ src_type.parent_type != type.parent_type)
+ break;
+ if ((var = maybe_get<SPIRVariable>(expr->loaded_from)))
+ break;
+ if (!(expr = maybe_get<SPIRExpression>(expr->loaded_from)))
+ break;
+ }
+
+ return !var || var->phi_variable;
+ }
// Otherwise, we should dereference this pointer expression.
return true;
@@ -9417,14 +10102,33 @@ bool CompilerGLSL::should_forward(uint32_t id) const
{
// If id is a variable we will try to forward it regardless of force_temporary check below
// This is important because otherwise we'll get local sampler copies (highp sampler2D foo = bar) that are invalid in OpenGL GLSL
+
auto *var = maybe_get<SPIRVariable>(id);
- if (var && var->forwardable)
- return true;
+ if (var)
+ {
+ // Never forward volatile builtin variables, e.g. SPIR-V 1.6 HelperInvocation.
+ return !(has_decoration(id, DecorationBuiltIn) && has_decoration(id, DecorationVolatile));
+ }
// For debugging emit temporary variables for all expressions
if (options.force_temporary)
return false;
+ // If an expression carries enough dependencies we need to stop forwarding at some point,
+ // or we explode compilers. There are usually limits to how much we can nest expressions.
+ auto *expr = maybe_get<SPIRExpression>(id);
+ const uint32_t max_expression_dependencies = 64;
+ if (expr && expr->expression_dependencies.size() >= max_expression_dependencies)
+ return false;
+
+ if (expr && expr->loaded_from
+ && has_decoration(expr->loaded_from, DecorationBuiltIn)
+ && has_decoration(expr->loaded_from, DecorationVolatile))
+ {
+ // Never forward volatile builtin variables, e.g. SPIR-V 1.6 HelperInvocation.
+ return false;
+ }
+
// Immutable expression can always be forwarded.
if (is_immutable(id))
return true;
@@ -9481,9 +10185,8 @@ void CompilerGLSL::track_expression_read(uint32_t id)
//if (v == 2)
// fprintf(stderr, "ID %u was forced to temporary due to more than 1 expression use!\n", id);
- forced_temporaries.insert(id);
// Force a recompile after this pass to avoid forwarding this variable.
- force_recompile();
+ force_temporary_and_recompile(id);
}
}
}
@@ -9824,8 +10527,51 @@ void CompilerGLSL::register_control_dependent_expression(uint32_t expr)
void CompilerGLSL::emit_block_instructions(SPIRBlock &block)
{
current_emitting_block = &block;
+
+ if (backend.requires_relaxed_precision_analysis)
+ {
+ // If PHI variables are consumed in unexpected precision contexts, copy them here.
+ for (auto &phi : block.phi_variables)
+ {
+ auto itr = temporary_to_mirror_precision_alias.find(phi.function_variable);
+ if (itr != temporary_to_mirror_precision_alias.end())
+ {
+ // Explicitly, we don't want to inherit RelaxedPrecision state in this CopyObject,
+ // so it helps to have handle_instruction_precision() on the outside of emit_instruction().
+ EmbeddedInstruction inst;
+ inst.op = OpCopyObject;
+ inst.length = 3;
+ inst.ops.push_back(expression_type_id(itr->first));
+ inst.ops.push_back(itr->second);
+ inst.ops.push_back(itr->first);
+ emit_instruction(inst);
+ }
+ }
+ }
+
for (auto &op : block.ops)
+ {
+ auto temporary_copy = handle_instruction_precision(op);
emit_instruction(op);
+ if (temporary_copy.dst_id)
+ {
+ // Explicitly, we don't want to inherit RelaxedPrecision state in this CopyObject,
+ // so it helps to have handle_instruction_precision() on the outside of emit_instruction().
+ EmbeddedInstruction inst;
+ inst.op = OpCopyObject;
+ inst.length = 3;
+ inst.ops.push_back(expression_type_id(temporary_copy.src_id));
+ inst.ops.push_back(temporary_copy.dst_id);
+ inst.ops.push_back(temporary_copy.src_id);
+
+ // Never attempt to hoist mirrored temporaries.
+ // They are hoisted in lock-step with their parents.
+ block_temporary_hoisting = true;
+ emit_instruction(inst);
+ block_temporary_hoisting = false;
+ }
+ }
+
current_emitting_block = nullptr;
}
@@ -9837,9 +10583,8 @@ void CompilerGLSL::disallow_forwarding_in_expression_chain(const SPIRExpression
if (expression_is_forwarded(expr.self) && !expression_suppresses_usage_tracking(expr.self) &&
forced_invariant_temporaries.count(expr.self) == 0)
{
- forced_temporaries.insert(expr.self);
+ force_temporary_and_recompile(expr.self);
forced_invariant_temporaries.insert(expr.self);
- force_recompile();
for (auto &dependent : expr.expression_dependencies)
disallow_forwarding_in_expression_chain(get<SPIRExpression>(dependent));
@@ -9881,7 +10626,7 @@ void CompilerGLSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_ex
convert_non_uniform_expression(lhs, lhs_expression);
// We might need to cast in order to store to a builtin.
- cast_to_builtin_store(lhs_expression, rhs, expression_type(rhs_expression));
+ cast_to_variable_store(lhs_expression, rhs, expression_type(rhs_expression));
// Tries to optimize assignments like "<lhs> = <lhs> op expr".
// While this is purely cosmetic, this is important for legacy ESSL where loop
@@ -9958,6 +10703,235 @@ uint32_t CompilerGLSL::get_integer_width_for_glsl_instruction(GLSLstd450 op, con
}
}
+void CompilerGLSL::forward_relaxed_precision(uint32_t dst_id, const uint32_t *args, uint32_t length)
+{
+ // Only GLSL supports RelaxedPrecision directly.
+ // We cannot implement this in HLSL or MSL because it is tied to the type system.
+ // In SPIR-V, everything must masquerade as 32-bit.
+ if (!backend.requires_relaxed_precision_analysis)
+ return;
+
+ auto input_precision = analyze_expression_precision(args, length);
+
+ // For expressions which are loaded or directly forwarded, we inherit mediump implicitly.
+ // For dst_id to be analyzed properly, it must inherit any relaxed precision decoration from src_id.
+ if (input_precision == Options::Mediump)
+ set_decoration(dst_id, DecorationRelaxedPrecision);
+}
+
+CompilerGLSL::Options::Precision CompilerGLSL::analyze_expression_precision(const uint32_t *args, uint32_t length) const
+{
+ // Now, analyze the precision at which the arguments would run.
+ // GLSL rules are such that the precision used to evaluate an expression is equal to the highest precision
+ // for the inputs. Constants do not have inherent precision and do not contribute to this decision.
+ // If all inputs are constants, they inherit precision from outer expressions, including an l-value.
+ // In this case, we'll have to force a temporary for dst_id so that we can bind the constant expression with
+ // correct precision.
+ bool expression_has_highp = false;
+ bool expression_has_mediump = false;
+
+ for (uint32_t i = 0; i < length; i++)
+ {
+ uint32_t arg = args[i];
+
+ auto handle_type = ir.ids[arg].get_type();
+ if (handle_type == TypeConstant || handle_type == TypeConstantOp || handle_type == TypeUndef)
+ continue;
+
+ if (has_decoration(arg, DecorationRelaxedPrecision))
+ expression_has_mediump = true;
+ else
+ expression_has_highp = true;
+ }
+
+ if (expression_has_highp)
+ return Options::Highp;
+ else if (expression_has_mediump)
+ return Options::Mediump;
+ else
+ return Options::DontCare;
+}
+
+void CompilerGLSL::analyze_precision_requirements(uint32_t type_id, uint32_t dst_id, uint32_t *args, uint32_t length)
+{
+ if (!backend.requires_relaxed_precision_analysis)
+ return;
+
+ auto &type = get<SPIRType>(type_id);
+
+ // RelaxedPrecision only applies to 32-bit values.
+ if (type.basetype != SPIRType::Float && type.basetype != SPIRType::Int && type.basetype != SPIRType::UInt)
+ return;
+
+ bool operation_is_highp = !has_decoration(dst_id, DecorationRelaxedPrecision);
+
+ auto input_precision = analyze_expression_precision(args, length);
+ if (input_precision == Options::DontCare)
+ {
+ consume_temporary_in_precision_context(type_id, dst_id, input_precision);
+ return;
+ }
+
+ // In SPIR-V and GLSL, the semantics are flipped for how relaxed precision is determined.
+ // In SPIR-V, the operation itself marks RelaxedPrecision, meaning that inputs can be truncated to 16-bit.
+ // However, if the expression is not, inputs must be expanded to 32-bit first,
+ // since the operation must run at high precision.
+ // This is the awkward part, because if we have mediump inputs, or expressions which derived from mediump,
+ // we might have to forcefully bind the source IDs to highp temporaries. This is done by clearing decorations
+ // and forcing temporaries. Similarly for mediump operations. We bind highp expressions to mediump variables.
+ if ((operation_is_highp && input_precision == Options::Mediump) ||
+ (!operation_is_highp && input_precision == Options::Highp))
+ {
+ auto precision = operation_is_highp ? Options::Highp : Options::Mediump;
+ for (uint32_t i = 0; i < length; i++)
+ {
+ // Rewrites the opcode so that we consume an ID in correct precision context.
+ // This is pretty hacky, but it's the most straight forward way of implementing this without adding
+ // lots of extra passes to rewrite all code blocks.
+ args[i] = consume_temporary_in_precision_context(expression_type_id(args[i]), args[i], precision);
+ }
+ }
+}
+
+// This is probably not exhaustive ...
+static bool opcode_is_precision_sensitive_operation(Op op)
+{
+ switch (op)
+ {
+ case OpFAdd:
+ case OpFSub:
+ case OpFMul:
+ case OpFNegate:
+ case OpIAdd:
+ case OpISub:
+ case OpIMul:
+ case OpSNegate:
+ case OpFMod:
+ case OpFDiv:
+ case OpFRem:
+ case OpSMod:
+ case OpSDiv:
+ case OpSRem:
+ case OpUMod:
+ case OpUDiv:
+ case OpVectorTimesMatrix:
+ case OpMatrixTimesVector:
+ case OpMatrixTimesMatrix:
+ case OpDPdx:
+ case OpDPdy:
+ case OpDPdxCoarse:
+ case OpDPdyCoarse:
+ case OpDPdxFine:
+ case OpDPdyFine:
+ case OpFwidth:
+ case OpFwidthCoarse:
+ case OpFwidthFine:
+ case OpVectorTimesScalar:
+ case OpMatrixTimesScalar:
+ case OpOuterProduct:
+ case OpFConvert:
+ case OpSConvert:
+ case OpUConvert:
+ case OpConvertSToF:
+ case OpConvertUToF:
+ case OpConvertFToU:
+ case OpConvertFToS:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+// Instructions which just load data but don't do any arithmetic operation should just inherit the decoration.
+// SPIR-V doesn't require this, but it's somewhat implied it has to work this way, relaxed precision is only
+// relevant when operating on the IDs, not when shuffling things around.
+static bool opcode_is_precision_forwarding_instruction(Op op, uint32_t &arg_count)
+{
+ switch (op)
+ {
+ case OpLoad:
+ case OpAccessChain:
+ case OpInBoundsAccessChain:
+ case OpCompositeExtract:
+ case OpVectorExtractDynamic:
+ case OpSampledImage:
+ case OpImage:
+ case OpCopyObject:
+
+ case OpImageRead:
+ case OpImageFetch:
+ case OpImageSampleImplicitLod:
+ case OpImageSampleProjImplicitLod:
+ case OpImageSampleDrefImplicitLod:
+ case OpImageSampleProjDrefImplicitLod:
+ case OpImageSampleExplicitLod:
+ case OpImageSampleProjExplicitLod:
+ case OpImageSampleDrefExplicitLod:
+ case OpImageSampleProjDrefExplicitLod:
+ case OpImageGather:
+ case OpImageDrefGather:
+ case OpImageSparseRead:
+ case OpImageSparseFetch:
+ case OpImageSparseSampleImplicitLod:
+ case OpImageSparseSampleProjImplicitLod:
+ case OpImageSparseSampleDrefImplicitLod:
+ case OpImageSparseSampleProjDrefImplicitLod:
+ case OpImageSparseSampleExplicitLod:
+ case OpImageSparseSampleProjExplicitLod:
+ case OpImageSparseSampleDrefExplicitLod:
+ case OpImageSparseSampleProjDrefExplicitLod:
+ case OpImageSparseGather:
+ case OpImageSparseDrefGather:
+ arg_count = 1;
+ return true;
+
+ case OpVectorShuffle:
+ arg_count = 2;
+ return true;
+
+ case OpCompositeConstruct:
+ return true;
+
+ default:
+ break;
+ }
+
+ return false;
+}
+
+CompilerGLSL::TemporaryCopy CompilerGLSL::handle_instruction_precision(const Instruction &instruction)
+{
+ auto ops = stream_mutable(instruction);
+ auto opcode = static_cast<Op>(instruction.op);
+ uint32_t length = instruction.length;
+
+ if (backend.requires_relaxed_precision_analysis)
+ {
+ if (length > 2)
+ {
+ uint32_t forwarding_length = length - 2;
+
+ if (opcode_is_precision_sensitive_operation(opcode))
+ analyze_precision_requirements(ops[0], ops[1], &ops[2], forwarding_length);
+ else if (opcode == OpExtInst && length >= 5 && get<SPIRExtension>(ops[2]).ext == SPIRExtension::GLSL)
+ analyze_precision_requirements(ops[0], ops[1], &ops[4], forwarding_length - 2);
+ else if (opcode_is_precision_forwarding_instruction(opcode, forwarding_length))
+ forward_relaxed_precision(ops[1], &ops[2], forwarding_length);
+ }
+
+ uint32_t result_type = 0, result_id = 0;
+ if (instruction_to_result_type(result_type, result_id, opcode, ops, length))
+ {
+ auto itr = temporary_to_mirror_precision_alias.find(ops[1]);
+ if (itr != temporary_to_mirror_precision_alias.end())
+ return { itr->second, itr->first };
+ }
+ }
+
+ return {};
+}
+
void CompilerGLSL::emit_instruction(const Instruction &instruction)
{
auto ops = stream(instruction);
@@ -9966,8 +10940,10 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
#define GLSL_BOP(op) emit_binary_op(ops[0], ops[1], ops[2], ops[3], #op)
#define GLSL_BOP_CAST(op, type) \
- emit_binary_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, opcode_is_sign_invariant(opcode))
+ emit_binary_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, \
+ opcode_is_sign_invariant(opcode), implicit_integer_promotion)
#define GLSL_UOP(op) emit_unary_op(ops[0], ops[1], ops[2], #op)
+#define GLSL_UOP_CAST(op) emit_unary_op_cast(ops[0], ops[1], ops[2], #op)
#define GLSL_QFOP(op) emit_quaternary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], #op)
#define GLSL_TFOP(op) emit_trinary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], #op)
#define GLSL_BFOP(op) emit_binary_func_op(ops[0], ops[1], ops[2], ops[3], #op)
@@ -9981,6 +10957,15 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
auto int_type = to_signed_basetype(integer_width);
auto uint_type = to_unsigned_basetype(integer_width);
+ // Handle C implicit integer promotion rules.
+ // If we get implicit promotion to int, need to make sure we cast by value to intended return type,
+ // otherwise, future sign-dependent operations and bitcasts will break.
+ bool implicit_integer_promotion = integer_width < 32 && backend.implicit_c_integer_promotion_rules &&
+ opcode_can_promote_integer_implicitly(opcode) &&
+ get<SPIRType>(ops[0]).vecsize == 1;
+
+ opcode = get_remapped_spirv_op(opcode);
+
switch (opcode)
{
// Dealing with memory
@@ -10045,8 +11030,14 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
if (expr_type.vecsize > type.vecsize)
expr = enclose_expression(expr + vector_swizzle(type.vecsize, 0));
+ if (forward && ptr_expression)
+ ptr_expression->need_transpose = old_need_transpose;
+
// We might need to cast in order to load from a builtin.
- cast_from_builtin_load(ptr, expr, type);
+ cast_from_variable_load(ptr, expr, type);
+
+ if (forward && ptr_expression)
+ ptr_expression->need_transpose = false;
// We might be trying to load a gl_Position[N], where we should be
// doing float4[](gl_in[i].gl_Position, ...) instead.
@@ -10124,9 +11115,19 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
// If an expression is mutable and forwardable, we speculate that it is immutable.
AccessChainMeta meta;
bool ptr_chain = opcode == OpPtrAccessChain;
- auto e = access_chain(ops[2], &ops[3], length - 3, get<SPIRType>(ops[0]), &meta, ptr_chain);
+ auto &target_type = get<SPIRType>(ops[0]);
+ auto e = access_chain(ops[2], &ops[3], length - 3, target_type, &meta, ptr_chain);
+
+ // If the base is flattened UBO of struct type, the expression has to be a composite.
+ // In that case, backends which do not support inline syntax need it to be bound to a temporary.
+ // Otherwise, invalid expressions like ({UBO[0].xyz, UBO[0].w, UBO[1]}).member are emitted.
+ bool requires_temporary = false;
+ if (flattened_buffer_blocks.count(ops[2]) && target_type.basetype == SPIRType::Struct)
+ requires_temporary = !backend.can_declare_struct_inline;
- auto &expr = set<SPIRExpression>(ops[1], move(e), ops[0], should_forward(ops[2]));
+ auto &expr = requires_temporary ?
+ emit_op(ops[0], ops[1], std::move(e), false) :
+ set<SPIRExpression>(ops[1], std::move(e), ops[0], should_forward(ops[2]));
auto *backing_variable = maybe_get_backing_variable(ops[2]);
expr.loaded_from = backing_variable ? backing_variable->self : ID(ops[2]);
@@ -10142,6 +11143,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
set_decoration(ops[1], DecorationInvariant);
if (meta.flattened_struct)
flattened_structs[ops[1]] = true;
+ if (meta.relaxed_precision && backend.requires_relaxed_precision_analysis)
+ set_decoration(ops[1], DecorationRelaxedPrecision);
// If we have some expression dependencies in our access chain, this access chain is technically a forwarded
// temporary which could be subject to invalidation.
@@ -10506,6 +11509,9 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
e = &emit_op(result_type, id, expr, true, should_suppress_usage_tracking(ops[2]));
inherit_expression_dependencies(id, ops[2]);
e->base_expression = ops[2];
+
+ if (meta.relaxed_precision && backend.requires_relaxed_precision_analysis)
+ set_decoration(ops[1], DecorationRelaxedPrecision);
}
else
{
@@ -10540,11 +11546,66 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
flush_variable_declaration(composite);
- // Make a copy, then use access chain to store the variable.
- statement(declare_temporary(result_type, id), to_expression(composite), ";");
- set<SPIRExpression>(id, to_name(id), result_type, true);
- auto chain = access_chain_internal(id, elems, length, ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, nullptr);
- statement(chain, " = ", to_unpacked_expression(obj), ";");
+ // CompositeInsert requires a copy + modification, but this is very awkward code in HLL.
+ // Speculate that the input composite is no longer used, and we can modify it in-place.
+ // There are various scenarios where this is not possible to satisfy.
+ bool can_modify_in_place = true;
+ forced_temporaries.insert(id);
+
+ // Cannot safely RMW PHI variables since they have no way to be invalidated,
+ // forcing temporaries is not going to help.
+ // This is similar for Constant and Undef inputs.
+ // The only safe thing to RMW is SPIRExpression.
+ // If the expression has already been used (i.e. used in a continue block), we have to keep using
+ // that loop variable, since we won't be able to override the expression after the fact.
+ // If the composite is hoisted, we might never be able to properly invalidate any usage
+ // of that composite in a subsequent loop iteration.
+ if (invalid_expressions.count(composite) ||
+ block_composite_insert_overwrite.count(composite) ||
+ hoisted_temporaries.count(id) || hoisted_temporaries.count(composite) ||
+ maybe_get<SPIRExpression>(composite) == nullptr)
+ {
+ can_modify_in_place = false;
+ }
+ else if (backend.requires_relaxed_precision_analysis &&
+ has_decoration(composite, DecorationRelaxedPrecision) !=
+ has_decoration(id, DecorationRelaxedPrecision) &&
+ get<SPIRType>(result_type).basetype != SPIRType::Struct)
+ {
+ // Similarly, if precision does not match for input and output,
+ // we cannot alias them. If we write a composite into a relaxed precision
+ // ID, we might get a false truncation.
+ can_modify_in_place = false;
+ }
+
+ if (can_modify_in_place)
+ {
+ // Have to make sure the modified SSA value is bound to a temporary so we can modify it in-place.
+ if (!forced_temporaries.count(composite))
+ force_temporary_and_recompile(composite);
+
+ auto chain = access_chain_internal(composite, elems, length, ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, nullptr);
+ statement(chain, " = ", to_unpacked_expression(obj), ";");
+ set<SPIRExpression>(id, to_expression(composite), result_type, true);
+ invalid_expressions.insert(composite);
+ composite_insert_overwritten.insert(composite);
+ }
+ else
+ {
+ if (maybe_get<SPIRUndef>(composite) != nullptr)
+ {
+ emit_uninitialized_temporary_expression(result_type, id);
+ }
+ else
+ {
+ // Make a copy, then use access chain to store the variable.
+ statement(declare_temporary(result_type, id), to_expression(composite), ";");
+ set<SPIRExpression>(id, to_name(id), result_type, true);
+ }
+
+ auto chain = access_chain_internal(id, elems, length, ACCESS_CHAIN_INDEX_IS_LITERAL_BIT, nullptr);
+ statement(chain, " = ", to_unpacked_expression(obj), ";");
+ }
break;
}
@@ -10621,15 +11682,14 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
{
// Need a copy.
// For pointer types, we copy the pointer itself.
- statement(declare_temporary(result_type, id), to_unpacked_expression(rhs), ";");
- set<SPIRExpression>(id, to_name(id), result_type, true);
+ emit_op(result_type, id, to_unpacked_expression(rhs), false);
}
else
{
// RHS expression is immutable, so just forward it.
// Copying these things really make no sense, but
// seems to be allowed anyways.
- auto &e = set<SPIRExpression>(id, to_expression(rhs), result_type, true);
+ auto &e = emit_op(result_type, id, to_expression(rhs), true, true);
if (pointer)
{
auto *var = maybe_get_backing_variable(rhs);
@@ -10738,6 +11798,12 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
break;
case OpSNegate:
+ if (implicit_integer_promotion || expression_type_id(ops[2]) != ops[0])
+ GLSL_UOP_CAST(-);
+ else
+ GLSL_UOP(-);
+ break;
+
case OpFNegate:
GLSL_UOP(-);
break;
@@ -10882,6 +11948,9 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
auto expr = join(to_enclosed_expression(op0), " - ", to_enclosed_expression(op1), " * ", "(",
to_enclosed_expression(op0), " / ", to_enclosed_expression(op1), ")");
+ if (implicit_integer_promotion)
+ expr = join(type_to_glsl(get<SPIRType>(result_type)), '(', expr, ')');
+
emit_op(result_type, result_id, expr, forward);
inherit_expression_dependencies(result_id, op0);
inherit_expression_dependencies(result_id, op1);
@@ -10979,7 +12048,10 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
}
case OpNot:
- GLSL_UOP(~);
+ if (implicit_integer_promotion || expression_type_id(ops[2]) != ops[0])
+ GLSL_UOP_CAST(~);
+ else
+ GLSL_UOP(~);
break;
case OpUMod:
@@ -11097,7 +12169,11 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
case OpLogicalNotEqual:
case OpFOrdNotEqual:
+ case OpFUnordNotEqual:
{
+ // GLSL is fuzzy on what to do with ordered vs unordered not equal.
+ // glslang started emitting UnorderedNotEqual some time ago to harmonize with IEEE,
+ // but this means we have no easy way of implementing ordered not equal.
if (expression_type(ops[2]).vecsize > 1)
GLSL_BFOP(notEqual);
else
@@ -11505,6 +12581,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
}
case OpAtomicIAdd:
+ case OpAtomicFAddEXT:
{
const char *op = check_atomic_image(ops[2]) ? "imageAtomicAdd" : "atomicAdd";
emit_atomic_func_op(ops[0], ops[1], ops[2], ops[5], op);
@@ -11730,12 +12807,12 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
uint32_t result_type = ops[0];
uint32_t id = ops[1];
uint32_t img = ops[2];
+ auto &type = expression_type(img);
+ auto &imgtype = get<SPIRType>(type.self);
std::string fname = "textureSize";
if (is_legacy_desktop())
{
- auto &type = expression_type(img);
- auto &imgtype = get<SPIRType>(type.self);
fname = legacy_tex_op(fname, imgtype, img);
}
else if (is_legacy_es())
@@ -11743,6 +12820,11 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
auto expr = join(fname, "(", convert_separate_image_to_expression(img), ", ",
bitcast_expression(SPIRType::Int, ops[3]), ")");
+
+ // ES needs to emulate 1D images as 2D.
+ if (type.image.dim == Dim1D && options.es)
+ expr = join(expr, ".x");
+
auto &restype = get<SPIRType>(ops[0]);
expr = bitcast_expression(restype, SPIRType::Int, expr);
emit_op(result_type, id, expr, true);
@@ -11759,10 +12841,10 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
auto *var = maybe_get_backing_variable(ops[2]);
if (var)
{
- auto &flags = ir.meta[var->self].decoration.decoration_flags;
+ auto &flags = get_decoration_bitset(var->self);
if (flags.get(DecorationNonReadable))
{
- flags.clear(DecorationNonReadable);
+ unset_decoration(var->self, DecorationNonReadable);
force_recompile();
}
}
@@ -11857,6 +12939,10 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
target_coord_type.basetype = SPIRType::Int;
coord_expr = bitcast_expression(target_coord_type, expression_type(ops[3]).basetype, coord_expr);
+ // ES needs to emulate 1D images as 2D.
+ if (type.image.dim == Dim1D && options.es)
+ coord_expr = join("ivec2(", coord_expr, ", 0)");
+
// Plain image load/store.
if (sparse)
{
@@ -11901,7 +12987,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
pure = false;
}
- if (var && var->forwardable)
+ if (var)
{
bool forward = forced_temporaries.find(id) == end(forced_temporaries);
auto &e = emit_op(result_type, id, imgexpr, forward);
@@ -11951,10 +13037,9 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
auto *var = maybe_get_backing_variable(ops[0]);
if (var)
{
- auto &flags = ir.meta[var->self].decoration.decoration_flags;
- if (flags.get(DecorationNonWritable))
+ if (has_decoration(var->self, DecorationNonWritable))
{
- flags.clear(DecorationNonWritable);
+ unset_decoration(var->self, DecorationNonWritable);
force_recompile();
}
}
@@ -11970,6 +13055,10 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
target_coord_type.basetype = SPIRType::Int;
coord_expr = bitcast_expression(target_coord_type, expression_type(ops[1]).basetype, coord_expr);
+ // ES needs to emulate 1D images as 2D.
+ if (type.image.dim == Dim1D && options.es)
+ coord_expr = join("ivec2(", coord_expr, ", 0)");
+
if (type.image.ms)
{
uint32_t operands = ops[3];
@@ -12198,31 +13287,51 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
case OpExtInst:
{
uint32_t extension_set = ops[2];
+ auto ext = get<SPIRExtension>(extension_set).ext;
- if (get<SPIRExtension>(extension_set).ext == SPIRExtension::GLSL)
+ if (ext == SPIRExtension::GLSL)
{
emit_glsl_op(ops[0], ops[1], ops[3], &ops[4], length - 4);
}
- else if (get<SPIRExtension>(extension_set).ext == SPIRExtension::SPV_AMD_shader_ballot)
+ else if (ext == SPIRExtension::SPV_AMD_shader_ballot)
{
emit_spv_amd_shader_ballot_op(ops[0], ops[1], ops[3], &ops[4], length - 4);
}
- else if (get<SPIRExtension>(extension_set).ext == SPIRExtension::SPV_AMD_shader_explicit_vertex_parameter)
+ else if (ext == SPIRExtension::SPV_AMD_shader_explicit_vertex_parameter)
{
emit_spv_amd_shader_explicit_vertex_parameter_op(ops[0], ops[1], ops[3], &ops[4], length - 4);
}
- else if (get<SPIRExtension>(extension_set).ext == SPIRExtension::SPV_AMD_shader_trinary_minmax)
+ else if (ext == SPIRExtension::SPV_AMD_shader_trinary_minmax)
{
emit_spv_amd_shader_trinary_minmax_op(ops[0], ops[1], ops[3], &ops[4], length - 4);
}
- else if (get<SPIRExtension>(extension_set).ext == SPIRExtension::SPV_AMD_gcn_shader)
+ else if (ext == SPIRExtension::SPV_AMD_gcn_shader)
{
emit_spv_amd_gcn_shader_op(ops[0], ops[1], ops[3], &ops[4], length - 4);
}
- else if (get<SPIRExtension>(extension_set).ext == SPIRExtension::SPV_debug_info)
+ else if (ext == SPIRExtension::SPV_debug_info ||
+ ext == SPIRExtension::NonSemanticShaderDebugInfo)
{
break; // Ignore SPIR-V debug information extended instructions.
}
+ else if (ext == SPIRExtension::NonSemanticDebugPrintf)
+ {
+ // Operation 1 is printf.
+ if (ops[3] == 1)
+ {
+ if (!options.vulkan_semantics)
+ SPIRV_CROSS_THROW("Debug printf is only supported in Vulkan GLSL.\n");
+ require_extension_internal("GL_EXT_debug_printf");
+ auto &format_string = get<SPIRString>(ops[4]).str;
+ string expr = join("debugPrintfEXT(\"", format_string, "\"");
+ for (uint32_t i = 5; i < length; i++)
+ {
+ expr += ", ";
+ expr += to_expression(ops[i]);
+ }
+ statement(expr, ");");
+ }
+ }
else
{
statement("// unimplemented ext op ", instruction.op);
@@ -12417,7 +13526,6 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
break;
case OpFUnordEqual:
- case OpFUnordNotEqual:
case OpFUnordLessThan:
case OpFUnordGreaterThan:
case OpFUnordLessThanEqual:
@@ -12440,10 +13548,6 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
comp_op = "notEqual";
break;
- case OpFUnordNotEqual:
- comp_op = "equal";
- break;
-
case OpFUnordLessThan:
comp_op = "greaterThanEqual";
break;
@@ -12476,10 +13580,6 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
comp_op = " != ";
break;
- case OpFUnordNotEqual:
- comp_op = " == ";
- break;
-
case OpFUnordLessThan:
comp_op = " >= ";
break;
@@ -12613,9 +13713,30 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
#undef GLSL_RAY_QUERY_GET_OP2
case OpConvertUToAccelerationStructureKHR:
+ {
require_extension_internal("GL_EXT_ray_tracing");
- GLSL_UFOP(accelerationStructureEXT);
+
+ bool elide_temporary = should_forward(ops[2]) && forced_temporaries.count(ops[1]) == 0 &&
+ !hoisted_temporaries.count(ops[1]);
+
+ if (elide_temporary)
+ {
+ GLSL_UFOP(accelerationStructureEXT);
+ }
+ else
+ {
+ // Force this path in subsequent iterations.
+ forced_temporaries.insert(ops[1]);
+
+ // We cannot declare a temporary acceleration structure in GLSL.
+ // If we get to this point, we'll have to emit a temporary uvec2,
+ // and cast to RTAS on demand.
+ statement(declare_temporary(expression_type_id(ops[2]), ops[1]), to_unpacked_expression(ops[2]), ";");
+ // Use raw SPIRExpression interface to block all usage tracking.
+ set<SPIRExpression>(ops[1], join("accelerationStructureEXT(", to_name(ops[1]), ")"), ops[0], true);
+ }
break;
+ }
case OpConvertUToPtr:
{
@@ -12671,6 +13792,8 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
if (!options.vulkan_semantics)
SPIRV_CROSS_THROW("GL_EXT_demote_to_helper_invocation is only supported in Vulkan GLSL.");
require_extension_internal("GL_EXT_demote_to_helper_invocation");
+ // Helper lane state with demote is volatile by nature.
+ // Do not forward this.
emit_op(ops[0], ops[1], "helperInvocationEXT()", false);
break;
@@ -12678,11 +13801,7 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
// If the interlock is complex, we emit this elsewhere.
if (!interlocked_is_complex)
{
- if (options.es)
- statement("beginInvocationInterlockNV();");
- else
- statement("beginInvocationInterlockARB();");
-
+ statement("SPIRV_Cross_beginInvocationInterlock();");
flush_all_active_variables();
// Make sure forwarding doesn't propagate outside interlock region.
}
@@ -12692,16 +13811,16 @@ void CompilerGLSL::emit_instruction(const Instruction &instruction)
// If the interlock is complex, we emit this elsewhere.
if (!interlocked_is_complex)
{
- if (options.es)
- statement("endInvocationInterlockNV();");
- else
- statement("endInvocationInterlockARB();");
-
+ statement("SPIRV_Cross_endInvocationInterlock();");
flush_all_active_variables();
// Make sure forwarding doesn't propagate outside interlock region.
}
break;
+ case OpSetMeshOutputsEXT:
+ statement("SetMeshOutputsEXT(", to_unpacked_expression(ops[0]), ", ", to_unpacked_expression(ops[1]), ");");
+ break;
+
default:
statement("// unimplemented op ", instruction.op);
break;
@@ -13010,40 +14129,55 @@ string CompilerGLSL::to_precision_qualifiers_glsl(uint32_t id)
return flags_to_qualifiers_glsl(type, ir.meta[id].decoration.decoration_flags);
}
-void CompilerGLSL::fixup_io_block_patch_qualifiers(const SPIRVariable &var)
+void CompilerGLSL::fixup_io_block_patch_primitive_qualifiers(const SPIRVariable &var)
{
// Works around weird behavior in glslangValidator where
// a patch out block is translated to just block members getting the decoration.
// To make glslang not complain when we compile again, we have to transform this back to a case where
// the variable itself has Patch decoration, and not members.
+ // Same for perprimitiveEXT.
auto &type = get<SPIRType>(var.basetype);
if (has_decoration(type.self, DecorationBlock))
{
uint32_t member_count = uint32_t(type.member_types.size());
+ Decoration promoted_decoration = {};
+ bool do_promote_decoration = false;
for (uint32_t i = 0; i < member_count; i++)
{
if (has_member_decoration(type.self, i, DecorationPatch))
{
- set_decoration(var.self, DecorationPatch);
+ promoted_decoration = DecorationPatch;
+ do_promote_decoration = true;
+ break;
+ }
+ else if (has_member_decoration(type.self, i, DecorationPerPrimitiveEXT))
+ {
+ promoted_decoration = DecorationPerPrimitiveEXT;
+ do_promote_decoration = true;
break;
}
}
- if (has_decoration(var.self, DecorationPatch))
+ if (do_promote_decoration)
+ {
+ set_decoration(var.self, promoted_decoration);
for (uint32_t i = 0; i < member_count; i++)
- unset_member_decoration(type.self, i, DecorationPatch);
+ unset_member_decoration(type.self, i, promoted_decoration);
+ }
}
}
string CompilerGLSL::to_qualifiers_glsl(uint32_t id)
{
- auto &flags = ir.meta[id].decoration.decoration_flags;
+ auto &flags = get_decoration_bitset(id);
string res;
auto *var = maybe_get<SPIRVariable>(id);
if (var && var->storage == StorageClassWorkgroup && !backend.shared_is_implied)
res += "shared ";
+ else if (var && var->storage == StorageClassTaskPayloadWorkgroupEXT && !backend.shared_is_implied)
+ res += "taskPayloadSharedEXT ";
res += to_interpolation_qualifiers(flags);
if (var)
@@ -13100,7 +14234,7 @@ string CompilerGLSL::argument_decl(const SPIRFunction::Parameter &arg)
string CompilerGLSL::to_initializer_expression(const SPIRVariable &var)
{
- return to_expression(var.initializer);
+ return to_unpacked_expression(var.initializer);
}
string CompilerGLSL::to_zero_initialized_expression(uint32_t type_id)
@@ -13148,7 +14282,7 @@ string CompilerGLSL::variable_decl(const SPIRVariable &variable)
{
uint32_t expr = variable.static_expression;
if (ir.ids[expr].get_type() != TypeUndef)
- res += join(" = ", to_expression(variable.static_expression));
+ res += join(" = ", to_unpacked_expression(variable.static_expression));
else if (options.force_zero_initialized_variables && type_can_zero_initialize(type))
res += join(" = ", to_zero_initialized_expression(get_variable_data_type_id(variable)));
}
@@ -13166,7 +14300,7 @@ string CompilerGLSL::variable_decl(const SPIRVariable &variable)
const char *CompilerGLSL::to_pls_qualifiers_glsl(const SPIRVariable &variable)
{
- auto &flags = ir.meta[variable.self].decoration.decoration_flags;
+ auto &flags = get_decoration_bitset(variable.self);
if (flags.get(DecorationRelaxedPrecision))
return "mediump ";
else
@@ -13326,7 +14460,8 @@ string CompilerGLSL::image_type_glsl(const SPIRType &type, uint32_t id)
switch (type.image.dim)
{
case Dim1D:
- res += "1D";
+ // ES doesn't support 1D. Fake it with 2D.
+ res += options.es ? "2D" : "1D";
break;
case Dim2D:
res += "2D";
@@ -13349,7 +14484,7 @@ string CompilerGLSL::image_type_glsl(const SPIRType &type, uint32_t id)
case DimBuffer:
if (options.es && options.version < 320)
- require_extension_internal("GL_OES_texture_buffer");
+ require_extension_internal("GL_EXT_texture_buffer");
else if (!options.es && options.version < 300)
require_extension_internal("GL_EXT_texture_buffer_object");
res += "Buffer";
@@ -13373,7 +14508,7 @@ string CompilerGLSL::image_type_glsl(const SPIRType &type, uint32_t id)
// "Shadow" state in GLSL only exists for samplers and combined image samplers.
if (((type.basetype == SPIRType::SampledImage) || (type.basetype == SPIRType::Sampler)) &&
- image_is_comparison(type, id))
+ is_depth_image(type, id))
{
res += "Shadow";
}
@@ -13624,7 +14759,7 @@ void CompilerGLSL::flatten_buffer_block(VariableID id)
auto &var = get<SPIRVariable>(id);
auto &type = get<SPIRType>(var.basetype);
auto name = to_name(type.self, false);
- auto &flags = ir.meta[type.self].decoration.decoration_flags;
+ auto &flags = get_decoration_bitset(type.self);
if (!type.array.empty())
SPIRV_CROSS_THROW(name + " is an array of UBOs.");
@@ -13654,11 +14789,10 @@ bool CompilerGLSL::check_atomic_image(uint32_t id)
auto *var = maybe_get_backing_variable(id);
if (var)
{
- auto &flags = ir.meta[var->self].decoration.decoration_flags;
- if (flags.get(DecorationNonWritable) || flags.get(DecorationNonReadable))
+ if (has_decoration(var->self, DecorationNonWritable) || has_decoration(var->self, DecorationNonReadable))
{
- flags.clear(DecorationNonWritable);
- flags.clear(DecorationNonReadable);
+ unset_decoration(var->self, DecorationNonWritable);
+ unset_decoration(var->self, DecorationNonReadable);
force_recompile();
}
}
@@ -13911,7 +15045,11 @@ void CompilerGLSL::emit_function(SPIRFunction &func, const Bitset &return_flags)
// Loop variables are never declared outside their for-loop, so block any implicit declaration.
if (var.loop_variable)
+ {
var.deferred_declaration = false;
+ // Need to reset the static expression so we can fallback to initializer if need be.
+ var.static_expression = 0;
+ }
}
// Enforce declaration order for regression testing purposes.
@@ -14096,21 +15234,32 @@ void CompilerGLSL::branch(BlockID from, BlockID to)
// - Break merge target all at once ...
// Very dirty workaround.
- // Switch constructs are able to break, but they cannot break out of a loop at the same time.
+ // Switch constructs are able to break, but they cannot break out of a loop at the same time,
+ // yet SPIR-V allows it.
// Only sensible solution is to make a ladder variable, which we declare at the top of the switch block,
// write to the ladder here, and defer the break.
// The loop we're breaking out of must dominate the switch block, or there is no ladder breaking case.
- if (current_emitting_switch && is_loop_break(to) &&
- current_emitting_switch->loop_dominator != BlockID(SPIRBlock::NoDominator) &&
- get<SPIRBlock>(current_emitting_switch->loop_dominator).merge_block == to)
+ if (is_loop_break(to))
{
- if (!current_emitting_switch->need_ladder_break)
+ for (size_t n = current_emitting_switch_stack.size(); n; n--)
{
- force_recompile();
- current_emitting_switch->need_ladder_break = true;
- }
+ auto *current_emitting_switch = current_emitting_switch_stack[n - 1];
- statement("_", current_emitting_switch->self, "_ladder_break = true;");
+ if (current_emitting_switch &&
+ current_emitting_switch->loop_dominator != BlockID(SPIRBlock::NoDominator) &&
+ get<SPIRBlock>(current_emitting_switch->loop_dominator).merge_block == to)
+ {
+ if (!current_emitting_switch->need_ladder_break)
+ {
+ force_recompile();
+ current_emitting_switch->need_ladder_break = true;
+ }
+
+ statement("_", current_emitting_switch->self, "_ladder_break = true;");
+ }
+ else
+ break;
+ }
}
statement("break;");
}
@@ -14530,10 +15679,17 @@ void CompilerGLSL::emit_hoisted_temporaries(SmallVector<pair<TypeID, ID>> &tempo
for (auto &tmp : temporaries)
{
- add_local_variable_name(tmp.second);
- auto &flags = ir.meta[tmp.second].decoration.decoration_flags;
auto &type = get<SPIRType>(tmp.first);
+ // There are some rare scenarios where we are asked to declare pointer types as hoisted temporaries.
+ // This should be ignored unless we're doing actual variable pointers and backend supports it.
+ // Access chains cannot normally be lowered to temporaries in GLSL and HLSL.
+ if (type.pointer && !backend.native_pointers)
+ continue;
+
+ add_local_variable_name(tmp.second);
+ auto &flags = get_decoration_bitset(tmp.second);
+
// Not all targets support pointer literals, so don't bother with that case.
string initializer;
if (options.force_zero_initialized_variables && type_can_zero_initialize(type))
@@ -14546,6 +15702,21 @@ void CompilerGLSL::emit_hoisted_temporaries(SmallVector<pair<TypeID, ID>> &tempo
// The temporary might be read from before it's assigned, set up the expression now.
set<SPIRExpression>(tmp.second, to_name(tmp.second), tmp.first, true);
+
+ // If we have hoisted temporaries in multi-precision contexts, emit that here too ...
+ // We will not be able to analyze hoisted-ness for dependent temporaries that we hallucinate here.
+ auto mirrored_precision_itr = temporary_to_mirror_precision_alias.find(tmp.second);
+ if (mirrored_precision_itr != temporary_to_mirror_precision_alias.end())
+ {
+ uint32_t mirror_id = mirrored_precision_itr->second;
+ auto &mirror_flags = get_decoration_bitset(mirror_id);
+ statement(flags_to_qualifiers_glsl(type, mirror_flags),
+ variable_decl(type, to_name(mirror_id)),
+ initializer, ";");
+ // The temporary might be read from before it's assigned, set up the expression now.
+ set<SPIRExpression>(mirror_id, to_name(mirror_id), tmp.first, true);
+ hoisted_temporaries.insert(mirror_id);
+ }
}
}
@@ -14679,7 +15850,7 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
// as writes to said loop variables might have been masked out, we need a recompile.
if (!emitted_loop_header_variables && !block.loop_variables.empty())
{
- force_recompile();
+ force_recompile_guarantee_forward_progress();
for (auto var : block.loop_variables)
get<SPIRVariable>(var).loop_variable = false;
block.loop_variables.clear();
@@ -14749,13 +15920,13 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
case SPIRBlock::MultiSelect:
{
auto &type = expression_type(block.condition);
- bool unsigned_case =
- type.basetype == SPIRType::UInt || type.basetype == SPIRType::UShort || type.basetype == SPIRType::UByte;
+ bool unsigned_case = type.basetype == SPIRType::UInt || type.basetype == SPIRType::UShort ||
+ type.basetype == SPIRType::UByte || type.basetype == SPIRType::UInt64;
if (block.merge == SPIRBlock::MergeNone)
SPIRV_CROSS_THROW("Switch statement is not structured");
- if (type.basetype == SPIRType::UInt64 || type.basetype == SPIRType::Int64)
+ if (!backend.support_64bit_switch && (type.basetype == SPIRType::UInt64 || type.basetype == SPIRType::Int64))
{
// SPIR-V spec suggests this is allowed, but we cannot support it in higher level languages.
SPIRV_CROSS_THROW("Cannot use 64-bit switch selectors.");
@@ -14764,27 +15935,31 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
const char *label_suffix = "";
if (type.basetype == SPIRType::UInt && backend.uint32_t_literal_suffix)
label_suffix = "u";
+ else if (type.basetype == SPIRType::Int64 && backend.support_64bit_switch)
+ label_suffix = "l";
+ else if (type.basetype == SPIRType::UInt64 && backend.support_64bit_switch)
+ label_suffix = "ul";
else if (type.basetype == SPIRType::UShort)
label_suffix = backend.uint16_t_literal_suffix;
else if (type.basetype == SPIRType::Short)
label_suffix = backend.int16_t_literal_suffix;
- SPIRBlock *old_emitting_switch = current_emitting_switch;
- current_emitting_switch = &block;
+ current_emitting_switch_stack.push_back(&block);
if (block.need_ladder_break)
statement("bool _", block.self, "_ladder_break = false;");
// Find all unique case constructs.
- unordered_map<uint32_t, SmallVector<uint32_t>> case_constructs;
+ unordered_map<uint32_t, SmallVector<uint64_t>> case_constructs;
SmallVector<uint32_t> block_declaration_order;
- SmallVector<uint32_t> literals_to_merge;
+ SmallVector<uint64_t> literals_to_merge;
// If a switch case branches to the default block for some reason, we can just remove that literal from consideration
// and let the default: block handle it.
// 2.11 in SPIR-V spec states that for fall-through cases, there is a very strict declaration order which we can take advantage of here.
// We only need to consider possible fallthrough if order[i] branches to order[i + 1].
- for (auto &c : block.cases)
+ auto &cases = get_case_list(block);
+ for (auto &c : cases)
{
if (c.block != block.next_block && c.block != block.default_block)
{
@@ -14841,11 +16016,22 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
size_t num_blocks = block_declaration_order.size();
- const auto to_case_label = [](uint32_t literal, bool is_unsigned_case) -> string {
- return is_unsigned_case ? convert_to_string(literal) : convert_to_string(int32_t(literal));
+ const auto to_case_label = [](uint64_t literal, uint32_t width, bool is_unsigned_case) -> string
+ {
+ if (is_unsigned_case)
+ return convert_to_string(literal);
+
+ // For smaller cases, the literals are compiled as 32 bit wide
+ // literals so we don't need to care for all sizes specifically.
+ if (width <= 32)
+ {
+ return convert_to_string(int64_t(int32_t(literal)));
+ }
+
+ return convert_to_string(int64_t(literal));
};
- const auto to_legacy_case_label = [&](uint32_t condition, const SmallVector<uint32_t> &labels,
+ const auto to_legacy_case_label = [&](uint32_t condition, const SmallVector<uint64_t> &labels,
const char *suffix) -> string {
string ret;
size_t count = labels.size();
@@ -14887,7 +16073,7 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
auto &negative_literals = case_constructs[block_declaration_order[j]];
for (auto &case_label : negative_literals)
conditions.push_back(join(to_enclosed_expression(block.condition),
- " != ", to_case_label(case_label, unsigned_case)));
+ " != ", to_case_label(case_label, type.width, unsigned_case)));
}
statement("if (", merge(conditions, " && "), ")");
@@ -14901,7 +16087,7 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
conditions.reserve(literals.size());
for (auto &case_label : literals)
conditions.push_back(join(to_enclosed_expression(block.condition),
- " == ", to_case_label(case_label, unsigned_case)));
+ " == ", to_case_label(case_label, type.width, unsigned_case)));
statement("if (", merge(conditions, " || "), ")");
begin_scope();
flush_phi(block.self, target_block);
@@ -14916,26 +16102,32 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
// If there is only one default block, and no cases, this is a case where SPIRV-opt decided to emulate
// non-structured exits with the help of a switch block.
// This is buggy on FXC, so just emit the logical equivalent of a do { } while(false), which is more idiomatic.
- bool degenerate_switch = block.default_block != block.merge_block && block.cases.empty();
+ bool block_like_switch = cases.empty();
+
+ // If this is true, the switch is completely meaningless, and we should just avoid it.
+ bool collapsed_switch = block_like_switch && block.default_block == block.next_block;
- if (degenerate_switch || is_legacy_es())
+ if (!collapsed_switch)
{
- // ESSL 1.0 is not guaranteed to support do/while.
- if (is_legacy_es())
+ if (block_like_switch || is_legacy_es())
{
- uint32_t counter = statement_count;
- statement("for (int spvDummy", counter, " = 0; spvDummy", counter,
- " < 1; spvDummy", counter, "++)");
+ // ESSL 1.0 is not guaranteed to support do/while.
+ if (is_legacy_es())
+ {
+ uint32_t counter = statement_count;
+ statement("for (int spvDummy", counter, " = 0; spvDummy", counter, " < 1; spvDummy", counter,
+ "++)");
+ }
+ else
+ statement("do");
}
else
- statement("do");
- }
- else
- {
- emit_block_hints(block);
- statement("switch (", to_expression(block.condition), ")");
+ {
+ emit_block_hints(block);
+ statement("switch (", to_unpacked_expression(block.condition), ")");
+ }
+ begin_scope();
}
- begin_scope();
for (size_t i = 0; i < num_blocks; i++)
{
@@ -14945,7 +16137,7 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
if (literals.empty())
{
// Default case.
- if (!degenerate_switch)
+ if (!block_like_switch)
{
if (is_legacy_es())
statement("else");
@@ -14965,7 +16157,7 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
for (auto &case_literal : literals)
{
// The case label value must be sign-extended properly in SPIR-V, so we can assume 32-bit values here.
- statement("case ", to_case_label(case_literal, unsigned_case), label_suffix, ":");
+ statement("case ", to_case_label(case_literal, type.width, unsigned_case), label_suffix, ":");
}
}
}
@@ -14983,10 +16175,10 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
else
current_emitting_switch_fallthrough = false;
- if (!degenerate_switch)
+ if (!block_like_switch)
begin_scope();
branch(block.self, target_block);
- if (!degenerate_switch)
+ if (!block_like_switch)
end_scope();
current_emitting_switch_fallthrough = false;
@@ -15000,10 +16192,10 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
// - Header -> Merge requires flushing PHI. In this case, we need to collect all cases and flush PHI there.
bool header_merge_requires_phi = flush_phi_required(block.self, block.next_block);
bool need_fallthrough_block = block.default_block == block.next_block || !literals_to_merge.empty();
- if ((header_merge_requires_phi && need_fallthrough_block) || !literals_to_merge.empty())
+ if (!collapsed_switch && ((header_merge_requires_phi && need_fallthrough_block) || !literals_to_merge.empty()))
{
for (auto &case_literal : literals_to_merge)
- statement("case ", to_case_label(case_literal, unsigned_case), label_suffix, ":");
+ statement("case ", to_case_label(case_literal, type.width, unsigned_case), label_suffix, ":");
if (block.default_block == block.next_block)
{
@@ -15019,10 +16211,15 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
end_scope();
}
- if (degenerate_switch && !is_legacy_es())
- end_scope_decl("while(false)");
+ if (!collapsed_switch)
+ {
+ if (block_like_switch && !is_legacy_es())
+ end_scope_decl("while(false)");
+ else
+ end_scope();
+ }
else
- end_scope();
+ flush_phi(block.self, block.next_block);
if (block.need_ladder_break)
{
@@ -15032,7 +16229,7 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
end_scope();
}
- current_emitting_switch = old_emitting_switch;
+ current_emitting_switch_stack.pop_back();
break;
}
@@ -15069,7 +16266,7 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
{
// OpReturnValue can return Undef, so don't emit anything for this case.
if (ir.ids[block.return_value].get_type() != TypeUndef)
- statement("return ", to_expression(block.return_value), ";");
+ statement("return ", to_unpacked_expression(block.return_value), ";");
}
}
else if (!cfg.node_terminates_control_flow_in_sub_graph(current_function->entry_block, block.self) ||
@@ -15088,12 +16285,47 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
case SPIRBlock::Kill:
statement(backend.discard_literal, ";");
if (block.return_value)
- statement("return ", to_expression(block.return_value), ";");
+ statement("return ", to_unpacked_expression(block.return_value), ";");
break;
case SPIRBlock::Unreachable:
+ {
+ // Avoid emitting false fallthrough, which can happen for
+ // if (cond) break; else discard; inside a case label.
+ // Discard is not always implementable as a terminator.
+
+ auto &cfg = get_cfg_for_current_function();
+ bool inner_dominator_is_switch = false;
+ ID id = block.self;
+
+ while (id)
+ {
+ auto &iter_block = get<SPIRBlock>(id);
+ if (iter_block.terminator == SPIRBlock::MultiSelect ||
+ iter_block.merge == SPIRBlock::MergeLoop)
+ {
+ ID next_block = iter_block.merge == SPIRBlock::MergeLoop ?
+ iter_block.merge_block : iter_block.next_block;
+ bool outside_construct = next_block && cfg.find_common_dominator(next_block, block.self) == next_block;
+ if (!outside_construct)
+ {
+ inner_dominator_is_switch = iter_block.terminator == SPIRBlock::MultiSelect;
+ break;
+ }
+ }
+
+ if (cfg.get_preceding_edges(id).empty())
+ break;
+
+ id = cfg.get_immediate_dominator(id);
+ }
+
+ if (inner_dominator_is_switch)
+ statement("break; // unreachable workaround");
+
emit_next_block = false;
break;
+ }
case SPIRBlock::IgnoreIntersection:
statement("ignoreIntersectionEXT;");
@@ -15103,6 +16335,13 @@ void CompilerGLSL::emit_block_chain(SPIRBlock &block)
statement("terminateRayEXT;");
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]), ");");
+ break;
+
default:
SPIRV_CROSS_THROW("Unimplemented block terminator.");
}
@@ -15379,11 +16618,11 @@ void CompilerGLSL::unroll_array_from_complex_load(uint32_t target_id, uint32_t s
statement(new_expr, "[i] = ", expr, "[i];");
end_scope();
- expr = move(new_expr);
+ expr = std::move(new_expr);
}
}
-void CompilerGLSL::cast_from_builtin_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type)
+void CompilerGLSL::cast_from_variable_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type)
{
// We will handle array cases elsewhere.
if (!expr_type.array.empty())
@@ -15431,6 +16670,9 @@ void CompilerGLSL::cast_from_builtin_load(uint32_t source_id, std::string &expr,
case BuiltInIncomingRayFlagsNV:
case BuiltInLaunchIdNV:
case BuiltInLaunchSizeNV:
+ case BuiltInPrimitiveTriangleIndicesEXT:
+ case BuiltInPrimitiveLineIndicesEXT:
+ case BuiltInPrimitivePointIndicesEXT:
expected_type = SPIRType::UInt;
break;
@@ -15442,7 +16684,7 @@ void CompilerGLSL::cast_from_builtin_load(uint32_t source_id, std::string &expr,
expr = bitcast_expression(expr_type, expected_type, expr);
}
-void CompilerGLSL::cast_to_builtin_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type)
+void CompilerGLSL::cast_to_variable_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type)
{
auto *var = maybe_get_backing_variable(target_id);
if (var)
@@ -15586,6 +16828,52 @@ void CompilerGLSL::reset_name_caches()
function_overloads.clear();
}
+void CompilerGLSL::fixup_anonymous_struct_names(std::unordered_set<uint32_t> &visited, const SPIRType &type)
+{
+ if (visited.count(type.self))
+ return;
+ visited.insert(type.self);
+
+ for (uint32_t i = 0; i < uint32_t(type.member_types.size()); i++)
+ {
+ auto &mbr_type = get<SPIRType>(type.member_types[i]);
+
+ if (mbr_type.basetype == SPIRType::Struct)
+ {
+ // If there are multiple aliases, the output might be somewhat unpredictable,
+ // but the only real alternative in that case is to do nothing, which isn't any better.
+ // This check should be fine in practice.
+ if (get_name(mbr_type.self).empty() && !get_member_name(type.self, i).empty())
+ {
+ auto anon_name = join("anon_", get_member_name(type.self, i));
+ ParsedIR::sanitize_underscores(anon_name);
+ set_name(mbr_type.self, anon_name);
+ }
+
+ fixup_anonymous_struct_names(visited, mbr_type);
+ }
+ }
+}
+
+void CompilerGLSL::fixup_anonymous_struct_names()
+{
+ // HLSL codegen can often end up emitting anonymous structs inside blocks, which
+ // breaks GL linking since all names must match ...
+ // Try to emit sensible code, so attempt to find such structs and emit anon_$member.
+
+ // Breaks exponential explosion with weird type trees.
+ std::unordered_set<uint32_t> visited;
+
+ ir.for_each_typed_id<SPIRType>([&](uint32_t, SPIRType &type) {
+ if (type.basetype == SPIRType::Struct &&
+ (has_decoration(type.self, DecorationBlock) ||
+ has_decoration(type.self, DecorationBufferBlock)))
+ {
+ fixup_anonymous_struct_names(visited, type);
+ }
+ });
+}
+
void CompilerGLSL::fixup_type_alias()
{
// Due to how some backends work, the "master" type of type_alias must be a block-like type if it exists.
@@ -15638,7 +16926,7 @@ void CompilerGLSL::reorder_type_alias()
if (alias_itr < master_itr)
{
// Must also swap the type order for the constant-type joined array.
- auto &joined_types = ir.ids_for_constant_or_type;
+ auto &joined_types = ir.ids_for_constant_undef_or_type;
auto alt_alias_itr = find(begin(joined_types), end(joined_types), *alias_itr);
auto alt_master_itr = find(begin(joined_types), end(joined_types), *master_itr);
assert(alt_alias_itr != end(joined_types));
@@ -15714,7 +17002,7 @@ void CompilerGLSL::emit_copy_logical_type(uint32_t lhs_id, uint32_t lhs_type_id,
rhs_id = id + 1;
{
- auto &lhs_expr = set<SPIRExpression>(lhs_id, move(lhs), lhs_type_id, true);
+ auto &lhs_expr = set<SPIRExpression>(lhs_id, std::move(lhs), lhs_type_id, true);
lhs_expr.need_transpose = lhs_meta.need_transpose;
if (lhs_meta.storage_is_packed)
@@ -15727,7 +17015,7 @@ void CompilerGLSL::emit_copy_logical_type(uint32_t lhs_id, uint32_t lhs_type_id,
}
{
- auto &rhs_expr = set<SPIRExpression>(rhs_id, move(rhs), rhs_type_id, true);
+ auto &rhs_expr = set<SPIRExpression>(rhs_id, std::move(rhs), rhs_type_id, true);
rhs_expr.need_transpose = rhs_meta.need_transpose;
if (rhs_meta.storage_is_packed)
@@ -15812,7 +17100,7 @@ void CompilerGLSL::emit_inout_fragment_outputs_copy_to_subpass_inputs()
bool CompilerGLSL::variable_is_depth_or_compare(VariableID id) const
{
- return image_is_comparison(get<SPIRType>(get<SPIRVariable>(id).basetype), id);
+ return is_depth_image(get<SPIRType>(get<SPIRVariable>(id).basetype), id);
}
const char *CompilerGLSL::ShaderSubgroupSupportHelper::get_extension_name(Candidate c)
@@ -16133,6 +17421,22 @@ bool CompilerGLSL::is_stage_output_block_member_masked(const SPIRVariable &var,
}
}
+bool CompilerGLSL::is_per_primitive_variable(const SPIRVariable &var) const
+{
+ if (has_decoration(var.self, DecorationPerPrimitiveEXT))
+ return true;
+
+ auto &type = get<SPIRType>(var.basetype);
+ if (!has_decoration(type.self, DecorationBlock))
+ return false;
+
+ for (uint32_t i = 0, n = uint32_t(type.member_types.size()); i < n; i++)
+ if (!has_member_decoration(type.self, i, DecorationPerPrimitiveEXT))
+ return false;
+
+ return true;
+}
+
bool CompilerGLSL::is_stage_output_location_masked(uint32_t location, uint32_t component) const
{
return masked_output_locations.count({ location, component }) != 0;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp
index d9594d30424..c3f2bfc871c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_glsl.hpp
@@ -83,6 +83,11 @@ public:
// Debug option to always emit temporary variables for all expressions.
bool force_temporary = false;
+ // Debug option, can be increased in an attempt to workaround SPIRV-Cross bugs temporarily.
+ // If this limit has to be increased, it points to an implementation bug.
+ // In certain scenarios, the maximum number of debug iterations may increase beyond this limit
+ // as long as we can prove we're making certain kinds of forward progress.
+ uint32_t force_recompile_max_debug_iterations = 3;
// If true, Vulkan GLSL features are used instead of GL-compatible features.
// Mostly useful for debugging SPIR-V files.
@@ -133,6 +138,19 @@ public:
// what happens on legacy GLSL targets for blocks and structs.
bool force_flattened_io_blocks = false;
+ // For opcodes where we have to perform explicit additional nan checks, very ugly code is generated.
+ // If we opt-in, ignore these requirements.
+ // In opcodes like NClamp/NMin/NMax and FP compare, ignore NaN behavior.
+ // Use FClamp/FMin/FMax semantics for clamps and lets implementation choose ordered or unordered
+ // compares.
+ bool relax_nan_checks = false;
+
+ // Loading row-major matrices from UBOs on older AMD Windows OpenGL drivers is problematic.
+ // To load these types correctly, we must generate a wrapper. them in a dummy function which only purpose is to
+ // ensure row_major decoration is actually respected.
+ // This workaround may cause significant performance degeneration on some Android devices.
+ bool enable_row_major_load_workaround = true;
+
// If non-zero, controls layout(num_views = N) in; in GL_OVR_multiview2.
uint32_t ovr_multiview_view_count = 0;
@@ -342,7 +360,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);
- void reset();
+ void reset(uint32_t iteration_count);
void emit_function(SPIRFunction &func, const Bitset &return_flags);
bool has_extension(const std::string &ext) const;
@@ -352,11 +370,22 @@ protected:
virtual void emit_function_prototype(SPIRFunction &func, const Bitset &return_flags);
SPIRBlock *current_emitting_block = nullptr;
- SPIRBlock *current_emitting_switch = nullptr;
+ SmallVector<SPIRBlock *> current_emitting_switch_stack;
bool current_emitting_switch_fallthrough = false;
virtual void emit_instruction(const Instruction &instr);
+ struct TemporaryCopy
+ {
+ uint32_t dst_id;
+ uint32_t src_id;
+ };
+ TemporaryCopy handle_instruction_precision(const Instruction &instr);
void emit_block_instructions(SPIRBlock &block);
+
+ // For relax_nan_checks.
+ GLSLstd450 get_remapped_glsl_op(GLSLstd450 std450_op) const;
+ spv::Op get_remapped_spirv_op(spv::Op op) const;
+
virtual void emit_glsl_op(uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args,
uint32_t count);
virtual void emit_spv_amd_shader_ballot_op(uint32_t result_type, uint32_t result_id, uint32_t op,
@@ -385,7 +414,7 @@ protected:
const std::string &qualifier = "", uint32_t base_offset = 0);
virtual void emit_struct_padding_target(const SPIRType &type);
virtual std::string image_type_glsl(const SPIRType &type, uint32_t id = 0);
- std::string constant_expression(const SPIRConstant &c);
+ std::string constant_expression(const SPIRConstant &c, bool inside_block_like_struct_scope = false);
virtual std::string constant_op_expression(const SPIRConstantOp &cop);
virtual std::string constant_expression_vector(const SPIRConstant &c, uint32_t vector);
virtual void emit_fixup();
@@ -495,6 +524,7 @@ protected:
// on a single line separated by comma.
SmallVector<std::string> *redirect_statement = nullptr;
const SPIRBlock *current_continue_block = nullptr;
+ bool block_temporary_hoisting = false;
void begin_scope();
void end_scope();
@@ -572,12 +602,13 @@ protected:
bool allow_precision_qualifiers = false;
bool can_swizzle_scalar = false;
bool force_gl_in_out_block = false;
+ bool force_merged_mesh_block = false;
bool can_return_array = true;
bool allow_truncated_access_chain = false;
bool supports_extensions = false;
bool supports_empty_struct = false;
bool array_is_value_type = true;
- bool buffer_offset_array_is_value_type = true;
+ bool array_is_value_type_in_buffer_blocks = true;
bool comparison_image_samples_scalar = false;
bool native_pointers = false;
bool support_small_type_sampling_result = false;
@@ -586,16 +617,20 @@ protected:
bool needs_row_major_load_workaround = false;
bool support_pointer_to_pointer = false;
bool support_precise_qualifier = false;
+ bool support_64bit_switch = false;
+ bool workgroup_size_is_hidden = false;
+ bool requires_relaxed_precision_analysis = false;
+ bool implicit_c_integer_promotion_rules = false;
} backend;
void emit_struct(SPIRType &type);
void emit_resources();
void emit_extension_workarounds(spv::ExecutionModel model);
void emit_buffer_block_native(const SPIRVariable &var);
- void emit_buffer_reference_block(SPIRType &type, bool forward_declaration);
+ void emit_buffer_reference_block(uint32_t type_id, bool forward_declaration);
void emit_buffer_block_legacy(const SPIRVariable &var);
void emit_buffer_block_flattened(const SPIRVariable &type);
- void fixup_implicit_builtin_block_names();
+ void fixup_implicit_builtin_block_names(spv::ExecutionModel model);
void emit_declared_builtin_block(spv::StorageClass storage, spv::ExecutionModel model);
bool should_force_emit_builtin_block(spv::StorageClass storage);
void emit_push_constant_block_vulkan(const SPIRVariable &var);
@@ -609,6 +644,7 @@ protected:
void emit_block_chain(SPIRBlock &block);
void emit_hoisted_temporaries(SmallVector<std::pair<TypeID, ID>> &temporaries);
std::string constant_value_macro_name(uint32_t id);
+ int get_constant_mapping_to_workgroup_component(const SPIRConstant &constant) const;
void emit_constant(const SPIRConstant &constant);
void emit_specialization_constant_op(const SPIRConstantOp &constant);
std::string emit_continue_block(uint32_t continue_block, bool follow_true_block, bool follow_false_block);
@@ -657,7 +693,7 @@ protected:
void emit_unrolled_binary_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op,
bool negate, SPIRType::BaseType expected_type);
void emit_binary_op_cast(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op,
- SPIRType::BaseType input_type, bool skip_cast_if_equal_type);
+ SPIRType::BaseType input_type, bool skip_cast_if_equal_type, bool implicit_integer_promotion);
SPIRType binary_op_bitcast_helper(std::string &cast_op0, std::string &cast_op1, SPIRType::BaseType &input_type,
uint32_t op0, uint32_t op1, bool skip_cast_if_equal_type);
@@ -668,6 +704,7 @@ protected:
uint32_t false_value);
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);
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;
@@ -683,6 +720,7 @@ protected:
spv::StorageClass get_expression_effective_storage_class(uint32_t ptr);
virtual bool access_chain_needs_stage_io_builtin_translation(uint32_t base);
+ virtual void check_physical_type_cast(std::string &expr, const SPIRType *type, uint32_t physical_type);
virtual void prepare_access_chain_for_scalar_access(std::string &expr, const SPIRType &type,
spv::StorageClass storage, bool &is_packed);
@@ -715,7 +753,7 @@ protected:
void append_global_func_args(const SPIRFunction &func, uint32_t index, SmallVector<std::string> &arglist);
std::string to_non_uniform_aware_expression(uint32_t id);
std::string to_expression(uint32_t id, bool register_expression_read = true);
- std::string to_composite_constructor_expression(uint32_t id, bool uses_buffer_offset);
+ std::string to_composite_constructor_expression(uint32_t id, bool block_like_type);
std::string to_rerolled_array_expression(const std::string &expr, const SPIRType &type);
std::string to_enclosed_expression(uint32_t id, bool register_expression_read = true);
std::string to_unpacked_expression(uint32_t id, bool register_expression_read = true);
@@ -732,12 +770,12 @@ protected:
std::string address_of_expression(const std::string &expr);
void strip_enclosed_expression(std::string &expr);
std::string to_member_name(const SPIRType &type, uint32_t index);
- virtual std::string to_member_reference(uint32_t base, const SPIRType &type, uint32_t index, bool ptr_chain);
+ virtual std::string to_member_reference(uint32_t base, const SPIRType &type, uint32_t index, bool ptr_chain_is_resolved);
std::string to_multi_member_reference(const SPIRType &type, const SmallVector<uint32_t> &indices);
std::string type_to_glsl_constructor(const SPIRType &type);
std::string argument_decl(const SPIRFunction::Parameter &arg);
virtual std::string to_qualifiers_glsl(uint32_t id);
- void fixup_io_block_patch_qualifiers(const SPIRVariable &var);
+ void fixup_io_block_patch_primitive_qualifiers(const SPIRVariable &var);
void emit_output_variable_initializer(const SPIRVariable &var);
std::string to_precision_qualifiers_glsl(uint32_t id);
virtual const char *to_storage_qualifiers_glsl(const SPIRVariable &var);
@@ -788,6 +826,10 @@ protected:
void replace_fragment_outputs();
std::string legacy_tex_op(const std::string &op, const SPIRType &imgtype, uint32_t id);
+ void forward_relaxed_precision(uint32_t dst_id, const uint32_t *args, uint32_t length);
+ void analyze_precision_requirements(uint32_t type_id, uint32_t dst_id, uint32_t *args, uint32_t length);
+ Options::Precision analyze_expression_precision(const uint32_t *args, uint32_t length) const;
+
uint32_t indent = 0;
std::unordered_set<uint32_t> emitted_functions;
@@ -845,6 +887,7 @@ protected:
bool requires_transpose_3x3 = false;
bool requires_transpose_4x4 = false;
bool ray_tracing_is_khr = false;
+ bool barycentric_is_nv = false;
void ray_tracing_khr_fixup_locations();
bool args_will_forward(uint32_t id, const uint32_t *args, uint32_t num_args, bool pure);
@@ -878,8 +921,14 @@ protected:
void check_function_call_constraints(const uint32_t *args, uint32_t length);
void handle_invalid_expression(uint32_t id);
+ void force_temporary_and_recompile(uint32_t id);
void find_static_extensions();
+ uint32_t consume_temporary_in_precision_context(uint32_t type_id, uint32_t id, Options::Precision precision);
+ std::unordered_map<uint32_t, uint32_t> temporary_to_mirror_precision_alias;
+ std::unordered_set<uint32_t> composite_insert_overwritten;
+ std::unordered_set<uint32_t> block_composite_insert_overwrite;
+
std::string emit_for_loop_initializers(const SPIRBlock &block);
void emit_while_loop_initializers(const SPIRBlock &block);
bool for_loop_initializers_are_same_type(const SPIRBlock &block);
@@ -888,8 +937,6 @@ protected:
bool type_is_empty(const SPIRType &type);
- virtual void declare_undefined_values();
-
bool can_use_io_location(spv::StorageClass storage, bool block);
const Instruction *get_next_instruction_in_block(const Instruction &instr);
static uint32_t mask_relevant_memory_semantics(uint32_t semantics);
@@ -903,8 +950,8 @@ protected:
// Builtins in GLSL are always specific signedness, but the SPIR-V can declare them
// as either unsigned or signed.
// Sometimes we will need to automatically perform casts on load and store to make this work.
- virtual void cast_to_builtin_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type);
- virtual void cast_from_builtin_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type);
+ virtual void cast_to_variable_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type);
+ virtual void cast_from_variable_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type);
void unroll_array_from_complex_load(uint32_t target_id, uint32_t source_id, std::string &expr);
bool unroll_array_to_complex_store(uint32_t target_id, uint32_t source_id);
void convert_non_uniform_expression(std::string &expr, uint32_t ptr_id);
@@ -925,6 +972,8 @@ protected:
void fixup_type_alias();
void reorder_type_alias();
+ void fixup_anonymous_struct_names();
+ void fixup_anonymous_struct_names(std::unordered_set<uint32_t> &visited, const SPIRType &type);
static const char *vector_swizzle(int vecsize, int index);
@@ -932,6 +981,7 @@ protected:
bool is_stage_output_builtin_masked(spv::BuiltIn builtin) const;
bool is_stage_output_variable_masked(const SPIRVariable &var) const;
bool is_stage_output_block_member_masked(const SPIRVariable &var, uint32_t index, bool strip_array) const;
+ bool is_per_primitive_variable(const SPIRVariable &var) const;
uint32_t get_accumulated_member_location(const SPIRVariable &var, uint32_t mbr_idx, bool strip_array) const;
uint32_t get_declared_member_location(const SPIRVariable &var, uint32_t mbr_idx, bool strip_array) const;
std::unordered_set<LocationComponentPair, InternalHasher> masked_output_locations;
@@ -939,6 +989,12 @@ protected:
private:
void init();
+
+ SmallVector<ConstantID> get_composite_constant_ids(ConstantID const_id);
+ void fill_composite_constant(SPIRConstant &constant, TypeID type_id, const SmallVector<ConstantID> &initializers);
+ void set_composite_constant(ConstantID const_id, TypeID type_id, const SmallVector<ConstantID> &initializers);
+ TypeID get_composite_member_type(TypeID type_id, uint32_t member_idx);
+ std::unordered_map<uint32_t, SmallVector<ConstantID>> const_composite_insert_ids;
};
} // namespace SPIRV_CROSS_NAMESPACE
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp
index 3ca4c2f90f1..b3ba58041ae 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.cpp
@@ -462,6 +462,10 @@ string CompilerHLSL::type_to_glsl(const SPIRType &type, uint32_t id)
if (hlsl_options.shader_model < 60)
SPIRV_CROSS_THROW("64-bit integers only supported in SM 6.0.");
return "uint64_t";
+ case SPIRType::AccelerationStructure:
+ return "RaytracingAccelerationStructure";
+ case SPIRType::RayQuery:
+ return "RayQuery<RAY_FLAG_NONE>";
default:
return "???";
}
@@ -599,36 +603,80 @@ void CompilerHLSL::emit_builtin_outputs_in_struct()
break;
case BuiltInClipDistance:
+ {
+ static const char *types[] = { "float", "float2", "float3", "float4" };
+
// HLSL is a bit weird here, use SV_ClipDistance0, SV_ClipDistance1 and so on with vectors.
- for (uint32_t clip = 0; clip < clip_distance_count; clip += 4)
+ if (execution.model == ExecutionModelMeshEXT)
{
- uint32_t to_declare = clip_distance_count - clip;
- if (to_declare > 4)
- to_declare = 4;
+ if (clip_distance_count > 4)
+ SPIRV_CROSS_THROW("Clip distance count > 4 not supported for mesh shaders.");
- uint32_t semantic_index = clip / 4;
+ if (clip_distance_count == 1)
+ {
+ // Avoids having to hack up access_chain code. Makes it trivially indexable.
+ statement("float gl_ClipDistance[1] : SV_ClipDistance;");
+ }
+ else
+ {
+ // Replace array with vector directly, avoids any weird fixup path.
+ statement(types[clip_distance_count - 1], " gl_ClipDistance : SV_ClipDistance;");
+ }
+ }
+ else
+ {
+ for (uint32_t clip = 0; clip < clip_distance_count; clip += 4)
+ {
+ uint32_t to_declare = clip_distance_count - clip;
+ if (to_declare > 4)
+ to_declare = 4;
- static const char *types[] = { "float", "float2", "float3", "float4" };
- statement(types[to_declare - 1], " ", builtin_to_glsl(builtin, StorageClassOutput), semantic_index,
- " : SV_ClipDistance", semantic_index, ";");
+ uint32_t semantic_index = clip / 4;
+
+ statement(types[to_declare - 1], " ", builtin_to_glsl(builtin, StorageClassOutput), semantic_index,
+ " : SV_ClipDistance", semantic_index, ";");
+ }
}
break;
+ }
case BuiltInCullDistance:
+ {
+ static const char *types[] = { "float", "float2", "float3", "float4" };
+
// HLSL is a bit weird here, use SV_CullDistance0, SV_CullDistance1 and so on with vectors.
- for (uint32_t cull = 0; cull < cull_distance_count; cull += 4)
+ if (execution.model == ExecutionModelMeshEXT)
{
- uint32_t to_declare = cull_distance_count - cull;
- if (to_declare > 4)
- to_declare = 4;
+ if (cull_distance_count > 4)
+ SPIRV_CROSS_THROW("Cull distance count > 4 not supported for mesh shaders.");
- uint32_t semantic_index = cull / 4;
+ if (cull_distance_count == 1)
+ {
+ // Avoids having to hack up access_chain code. Makes it trivially indexable.
+ statement("float gl_CullDistance[1] : SV_CullDistance;");
+ }
+ else
+ {
+ // Replace array with vector directly, avoids any weird fixup path.
+ statement(types[cull_distance_count - 1], " gl_CullDistance : SV_CullDistance;");
+ }
+ }
+ else
+ {
+ for (uint32_t cull = 0; cull < cull_distance_count; cull += 4)
+ {
+ uint32_t to_declare = cull_distance_count - cull;
+ if (to_declare > 4)
+ to_declare = 4;
- static const char *types[] = { "float", "float2", "float3", "float4" };
- statement(types[to_declare - 1], " ", builtin_to_glsl(builtin, StorageClassOutput), semantic_index,
- " : SV_CullDistance", semantic_index, ";");
+ uint32_t semantic_index = cull / 4;
+
+ statement(types[to_declare - 1], " ", builtin_to_glsl(builtin, StorageClassOutput), semantic_index,
+ " : SV_CullDistance", semantic_index, ";");
+ }
}
break;
+ }
case BuiltInPointSize:
// If point_size_compat is enabled, just ignore PointSize.
@@ -639,12 +687,74 @@ void CompilerHLSL::emit_builtin_outputs_in_struct()
else
SPIRV_CROSS_THROW("Unsupported builtin in HLSL.");
+ case BuiltInLayer:
+ case BuiltInPrimitiveId:
+ case BuiltInViewportIndex:
+ case BuiltInPrimitiveShadingRateKHR:
+ case BuiltInCullPrimitiveEXT:
+ // per-primitive attributes handled separatly
+ break;
+
+ case BuiltInPrimitivePointIndicesEXT:
+ case BuiltInPrimitiveLineIndicesEXT:
+ case BuiltInPrimitiveTriangleIndicesEXT:
+ // meshlet local-index buffer handled separatly
+ break;
+
default:
SPIRV_CROSS_THROW("Unsupported builtin in HLSL.");
}
if (type && semantic)
statement(type, " ", builtin_to_glsl(builtin, StorageClassOutput), " : ", semantic, ";");
+ });
+}
+
+void CompilerHLSL::emit_builtin_primitive_outputs_in_struct()
+{
+ active_output_builtins.for_each_bit([&](uint32_t i) {
+ const char *type = nullptr;
+ const char *semantic = nullptr;
+ auto builtin = static_cast<BuiltIn>(i);
+ switch (builtin)
+ {
+ 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.");
+ type = "uint";
+ semantic = "SV_RenderTargetArrayIndex";
+ break;
+ }
+
+ case BuiltInPrimitiveId:
+ type = "uint";
+ semantic = "SV_PrimitiveID";
+ break;
+
+ case BuiltInViewportIndex:
+ type = "uint";
+ semantic = "SV_ViewportArrayIndex";
+ break;
+
+ case BuiltInPrimitiveShadingRateKHR:
+ type = "uint";
+ semantic = "SV_ShadingRate";
+ break;
+
+ case BuiltInCullPrimitiveEXT:
+ type = "bool";
+ semantic = "SV_CullPrimitive";
+ break;
+
+ default:
+ break;
+ }
+
+ if (type && semantic)
+ statement(type, " ", builtin_to_glsl(builtin, StorageClassOutput), " : ", semantic, ";");
});
}
@@ -670,6 +780,11 @@ void CompilerHLSL::emit_builtin_inputs_in_struct()
semantic = "SV_VertexID";
break;
+ case BuiltInPrimitiveId:
+ type = "uint";
+ semantic = "SV_PrimitiveID";
+ break;
+
case BuiltInInstanceId:
case BuiltInInstanceIndex:
if (legacy)
@@ -717,6 +832,13 @@ void CompilerHLSL::emit_builtin_inputs_in_struct()
semantic = "SV_IsFrontFace";
break;
+ case BuiltInViewIndex:
+ if (hlsl_options.shader_model < 61 || (get_entry_point().model != ExecutionModelVertex && get_entry_point().model != ExecutionModelFragment))
+ SPIRV_CROSS_THROW("View Index input is only supported in VS and PS 6.1 or higher.");
+ type = "uint";
+ semantic = "SV_ViewID";
+ break;
+
case BuiltInNumWorkgroups:
case BuiltInSubgroupSize:
case BuiltInSubgroupLocalInvocationId:
@@ -725,9 +847,16 @@ void CompilerHLSL::emit_builtin_inputs_in_struct()
case BuiltInSubgroupLeMask:
case BuiltInSubgroupGtMask:
case BuiltInSubgroupGeMask:
+ case BuiltInBaseVertex:
+ case BuiltInBaseInstance:
// Handled specially.
break;
+ case BuiltInHelperInvocation:
+ if (hlsl_options.shader_model < 50 || get_entry_point().model != ExecutionModelFragment)
+ SPIRV_CROSS_THROW("Helper Invocation input is only supported in PS 5.0 or higher.");
+ break;
+
case BuiltInClipDistance:
// HLSL is a bit weird here, use SV_ClipDistance0, SV_ClipDistance1 and so on with vectors.
for (uint32_t clip = 0; clip < clip_distance_count; clip += 4)
@@ -767,6 +896,13 @@ void CompilerHLSL::emit_builtin_inputs_in_struct()
else
SPIRV_CROSS_THROW("Unsupported builtin in HLSL.");
+ case BuiltInLayer:
+ if (hlsl_options.shader_model < 50 || get_entry_point().model != ExecutionModelFragment)
+ SPIRV_CROSS_THROW("Render target array index input is only supported in PS 5.0 or higher.");
+ type = "uint";
+ semantic = "SV_RenderTargetArrayIndex";
+ break;
+
default:
SPIRV_CROSS_THROW("Unsupported builtin in HLSL.");
}
@@ -944,17 +1080,25 @@ void CompilerHLSL::emit_interface_block_in_struct(const SPIRVariable &var, unord
}
else
{
- statement(to_interpolation_qualifiers(get_decoration_bitset(var.self)), variable_decl(type, name), " : ",
+ auto decl_type = type;
+ if (execution.model == ExecutionModelMeshEXT)
+ {
+ decl_type.array.erase(decl_type.array.begin());
+ decl_type.array_size_literal.erase(decl_type.array_size_literal.begin());
+ }
+ statement(to_interpolation_qualifiers(get_decoration_bitset(var.self)), variable_decl(decl_type, name), " : ",
semantic, ";");
// Structs and arrays should consume more locations.
- uint32_t consumed_locations = type_to_consumed_locations(type);
+ uint32_t consumed_locations = type_to_consumed_locations(decl_type);
for (uint32_t i = 0; i < consumed_locations; i++)
active_locations.insert(location_number + i);
}
}
else
+ {
statement(variable_decl(type, name), " : ", binding, ";");
+ }
}
std::string CompilerHLSL::builtin_to_glsl(spv::BuiltIn builtin, spv::StorageClass storage)
@@ -984,6 +1128,8 @@ std::string CompilerHLSL::builtin_to_glsl(spv::BuiltIn builtin, spv::StorageClas
return "WaveGetLaneIndex()";
case BuiltInSubgroupSize:
return "WaveGetLaneCount()";
+ case BuiltInHelperInvocation:
+ return "IsHelperLane()";
default:
return CompilerGLSL::builtin_to_glsl(builtin, storage);
@@ -995,8 +1141,6 @@ void CompilerHLSL::emit_builtin_variables()
Bitset builtins = active_input_builtins;
builtins.merge_or(active_output_builtins);
- bool need_base_vertex_info = false;
-
std::unordered_map<uint32_t, ID> builtin_to_initializer;
ir.for_each_typed_id<SPIRVariable>([&](uint32_t, SPIRVariable &var) {
if (!is_builtin_variable(var) || var.storage != StorageClassOutput || !var.initializer)
@@ -1034,6 +1178,18 @@ void CompilerHLSL::emit_builtin_variables()
if (init_itr != builtin_to_initializer.end())
init_expr = join(" = ", to_expression(init_itr->second));
+ if (get_execution_model() == ExecutionModelMeshEXT)
+ {
+ if (builtin == BuiltInPosition || builtin == BuiltInPointSize || builtin == BuiltInClipDistance ||
+ builtin == BuiltInCullDistance || builtin == BuiltInLayer || builtin == BuiltInPrimitiveId ||
+ builtin == BuiltInViewportIndex || builtin == BuiltInCullPrimitiveEXT ||
+ builtin == BuiltInPrimitiveShadingRateKHR || builtin == BuiltInPrimitivePointIndicesEXT ||
+ builtin == BuiltInPrimitiveLineIndicesEXT || builtin == BuiltInPrimitiveTriangleIndicesEXT)
+ {
+ return;
+ }
+ }
+
switch (builtin)
{
case BuiltInFragCoord:
@@ -1050,7 +1206,13 @@ void CompilerHLSL::emit_builtin_variables()
case BuiltInInstanceIndex:
type = "int";
if (hlsl_options.support_nonzero_base_vertex_base_instance)
- need_base_vertex_info = true;
+ base_vertex_info.used = true;
+ break;
+
+ case BuiltInBaseVertex:
+ case BuiltInBaseInstance:
+ type = "int";
+ base_vertex_info.used = true;
break;
case BuiltInInstanceId:
@@ -1103,6 +1265,11 @@ void CompilerHLSL::emit_builtin_variables()
type = "uint4";
break;
+ case BuiltInHelperInvocation:
+ if (hlsl_options.shader_model < 50)
+ SPIRV_CROSS_THROW("Need SM 5.0 for Helper Invocation.");
+ break;
+
case BuiltInClipDistance:
array_size = clip_distance_count;
type = "float";
@@ -1117,6 +1284,19 @@ void CompilerHLSL::emit_builtin_variables()
type = "int";
break;
+ case BuiltInPrimitiveId:
+ case BuiltInViewIndex:
+ case BuiltInLayer:
+ type = "uint";
+ break;
+
+ case BuiltInViewportIndex:
+ case BuiltInPrimitiveShadingRateKHR:
+ case BuiltInPrimitiveLineIndicesEXT:
+ case BuiltInCullPrimitiveEXT:
+ type = "uint";
+ break;
+
default:
SPIRV_CROSS_THROW(join("Unsupported builtin in HLSL: ", unsigned(builtin)));
}
@@ -1139,9 +1319,17 @@ void CompilerHLSL::emit_builtin_variables()
}
});
- if (need_base_vertex_info)
+ if (base_vertex_info.used)
{
- statement("cbuffer SPIRV_Cross_VertexInfo");
+ string binding_info;
+ if (base_vertex_info.explicit_binding)
+ {
+ binding_info = join(" : register(b", base_vertex_info.register_index);
+ if (base_vertex_info.register_space)
+ binding_info += join(", space", base_vertex_info.register_space);
+ binding_info += ")";
+ }
+ statement("cbuffer SPIRV_Cross_VertexInfo", binding_info);
begin_scope();
statement("int SPIRV_Cross_BaseVertex;");
statement("int SPIRV_Cross_BaseInstance;");
@@ -1150,6 +1338,30 @@ void CompilerHLSL::emit_builtin_variables()
}
}
+void CompilerHLSL::set_hlsl_aux_buffer_binding(HLSLAuxBinding binding, uint32_t register_index, uint32_t register_space)
+{
+ if (binding == HLSL_AUX_BINDING_BASE_VERTEX_INSTANCE)
+ {
+ base_vertex_info.explicit_binding = true;
+ base_vertex_info.register_space = register_space;
+ base_vertex_info.register_index = register_index;
+ }
+}
+
+void CompilerHLSL::unset_hlsl_aux_buffer_binding(HLSLAuxBinding binding)
+{
+ if (binding == HLSL_AUX_BINDING_BASE_VERTEX_INSTANCE)
+ base_vertex_info.explicit_binding = false;
+}
+
+bool CompilerHLSL::is_hlsl_aux_buffer_binding_used(HLSLAuxBinding binding) const
+{
+ if (binding == HLSL_AUX_BINDING_BASE_VERTEX_INSTANCE)
+ return base_vertex_info.used;
+ else
+ return false;
+}
+
void CompilerHLSL::emit_composite_constants()
{
// HLSL cannot declare structs or arrays inline, so we must move them out to
@@ -1167,6 +1379,7 @@ void CompilerHLSL::emit_composite_constants()
if (type.basetype == SPIRType::Struct || !type.array.empty())
{
+ add_resource_name(c.self);
auto name = to_name(c.self);
statement("static const ", variable_decl(type, name), " = ", constant_expression(c), ";");
emitted = true;
@@ -1196,7 +1409,7 @@ void CompilerHLSL::emit_specialization_constants_and_structs()
});
auto loop_lock = ir.create_loop_hard_lock();
- for (auto &id_ : ir.ids_for_constant_or_type)
+ for (auto &id_ : ir.ids_for_constant_undef_or_type)
{
auto &id = ir.ids[id_];
@@ -1213,16 +1426,23 @@ void CompilerHLSL::emit_specialization_constants_and_structs()
else if (c.specialization)
{
auto &type = get<SPIRType>(c.constant_type);
+ add_resource_name(c.self);
auto name = to_name(c.self);
- // HLSL does not support specialization constants, so fallback to macros.
- c.specialization_constant_macro_name =
- constant_value_macro_name(get_decoration(c.self, DecorationSpecId));
+ if (has_decoration(c.self, DecorationSpecId))
+ {
+ // HLSL does not support specialization constants, so fallback to macros.
+ c.specialization_constant_macro_name =
+ constant_value_macro_name(get_decoration(c.self, DecorationSpecId));
+
+ statement("#ifndef ", c.specialization_constant_macro_name);
+ statement("#define ", c.specialization_constant_macro_name, " ", constant_expression(c));
+ statement("#endif");
+ statement("static const ", variable_decl(type, name), " = ", c.specialization_constant_macro_name, ";");
+ }
+ else
+ statement("static const ", variable_decl(type, name), " = ", constant_expression(c), ";");
- statement("#ifndef ", c.specialization_constant_macro_name);
- statement("#define ", c.specialization_constant_macro_name, " ", constant_expression(c));
- statement("#endif");
- statement("static const ", variable_decl(type, name), " = ", c.specialization_constant_macro_name, ";");
emitted = true;
}
}
@@ -1230,6 +1450,7 @@ void CompilerHLSL::emit_specialization_constants_and_structs()
{
auto &c = id.get<SPIRConstantOp>();
auto &type = get<SPIRType>(c.basetype);
+ add_resource_name(c.self);
auto name = to_name(c.self);
statement("static const ", variable_decl(type, name), " = ", constant_op_expression(c), ";");
emitted = true;
@@ -1250,6 +1471,21 @@ void CompilerHLSL::emit_specialization_constants_and_structs()
emit_struct(type);
}
}
+ else if (id.get_type() == TypeUndef)
+ {
+ auto &undef = id.get<SPIRUndef>();
+ auto &type = this->get<SPIRType>(undef.basetype);
+ // OpUndef can be void for some reason ...
+ if (type.basetype == SPIRType::Void)
+ return;
+
+ string initializer;
+ if (options.force_zero_initialized_variables && type_can_zero_initialize(type))
+ initializer = join(" = ", to_zero_initialized_expression(undef.basetype));
+
+ statement("static ", variable_decl(type, to_name(undef.self), undef.self), initializer, ";");
+ emitted = true;
+ }
}
if (emitted)
@@ -1260,40 +1496,58 @@ void CompilerHLSL::replace_illegal_names()
{
static const unordered_set<string> keywords = {
// Additional HLSL specific keywords.
- "line", "linear", "matrix", "point", "row_major", "sampler", "vector"
+ // From https://docs.microsoft.com/en-US/windows/win32/direct3dhlsl/dx-graphics-hlsl-appendix-keywords
+ "AppendStructuredBuffer", "asm", "asm_fragment",
+ "BlendState", "bool", "break", "Buffer", "ByteAddressBuffer",
+ "case", "cbuffer", "centroid", "class", "column_major", "compile",
+ "compile_fragment", "CompileShader", "const", "continue", "ComputeShader",
+ "ConsumeStructuredBuffer",
+ "default", "DepthStencilState", "DepthStencilView", "discard", "do",
+ "double", "DomainShader", "dword",
+ "else", "export", "false", "float", "for", "fxgroup",
+ "GeometryShader", "groupshared", "half", "HullShader",
+ "indices", "if", "in", "inline", "inout", "InputPatch", "int", "interface",
+ "line", "lineadj", "linear", "LineStream",
+ "matrix", "min16float", "min10float", "min16int", "min16uint",
+ "namespace", "nointerpolation", "noperspective", "NULL",
+ "out", "OutputPatch",
+ "payload", "packoffset", "pass", "pixelfragment", "PixelShader", "point",
+ "PointStream", "precise", "RasterizerState", "RenderTargetView",
+ "return", "register", "row_major", "RWBuffer", "RWByteAddressBuffer",
+ "RWStructuredBuffer", "RWTexture1D", "RWTexture1DArray", "RWTexture2D",
+ "RWTexture2DArray", "RWTexture3D", "sample", "sampler", "SamplerState",
+ "SamplerComparisonState", "shared", "snorm", "stateblock", "stateblock_state",
+ "static", "string", "struct", "switch", "StructuredBuffer", "tbuffer",
+ "technique", "technique10", "technique11", "texture", "Texture1D",
+ "Texture1DArray", "Texture2D", "Texture2DArray", "Texture2DMS", "Texture2DMSArray",
+ "Texture3D", "TextureCube", "TextureCubeArray", "true", "typedef", "triangle",
+ "triangleadj", "TriangleStream", "uint", "uniform", "unorm", "unsigned",
+ "vector", "vertexfragment", "VertexShader", "vertices", "void", "volatile", "while",
};
CompilerGLSL::replace_illegal_names(keywords);
CompilerGLSL::replace_illegal_names();
}
-void CompilerHLSL::declare_undefined_values()
-{
- bool emitted = false;
- ir.for_each_typed_id<SPIRUndef>([&](uint32_t, const SPIRUndef &undef) {
- auto &type = this->get<SPIRType>(undef.basetype);
- // OpUndef can be void for some reason ...
- if (type.basetype == SPIRType::Void)
- return;
-
- string initializer;
- if (options.force_zero_initialized_variables && type_can_zero_initialize(type))
- initializer = join(" = ", to_zero_initialized_expression(undef.basetype));
-
- statement("static ", variable_decl(type, to_name(undef.self), undef.self), initializer, ";");
- emitted = true;
- });
-
- if (emitted)
- statement("");
-}
-
void CompilerHLSL::emit_resources()
{
auto &execution = get_entry_point();
replace_illegal_names();
+ switch (execution.model)
+ {
+ case ExecutionModelGeometry:
+ case ExecutionModelTessellationControl:
+ case ExecutionModelTessellationEvaluation:
+ case ExecutionModelMeshEXT:
+ fixup_implicit_builtin_block_names(execution.model);
+ break;
+
+ default:
+ break;
+ }
+
emit_specialization_constants_and_structs();
emit_composite_constants();
@@ -1326,7 +1580,8 @@ void CompilerHLSL::emit_resources()
}
});
- if (execution.model == ExecutionModelVertex && hlsl_options.shader_model <= 30)
+ if (execution.model == ExecutionModelVertex && hlsl_options.shader_model <= 30 &&
+ active_output_builtins.get(BuiltInPosition))
{
statement("uniform float4 gl_HalfPixel;");
emitted = true;
@@ -1365,18 +1620,21 @@ void CompilerHLSL::emit_resources()
// Emit builtin input and output variables here.
emit_builtin_variables();
- ir.for_each_typed_id<SPIRVariable>([&](uint32_t, SPIRVariable &var) {
- auto &type = this->get<SPIRType>(var.basetype);
+ if (execution.model != ExecutionModelMeshEXT)
+ {
+ ir.for_each_typed_id<SPIRVariable>([&](uint32_t, SPIRVariable &var) {
+ auto &type = this->get<SPIRType>(var.basetype);
- if (var.storage != StorageClassFunction && !var.remapped_variable && type.pointer &&
- (var.storage == StorageClassInput || var.storage == StorageClassOutput) && !is_builtin_variable(var) &&
- interface_variable_exists_in_entry_point(var.self))
- {
- // Builtin variables are handled separately.
- emit_interface_block_globally(var);
- emitted = true;
- }
- });
+ if (var.storage != StorageClassFunction && !var.remapped_variable && type.pointer &&
+ (var.storage == StorageClassInput || var.storage == StorageClassOutput) && !is_builtin_variable(var) &&
+ interface_variable_exists_in_entry_point(var.self))
+ {
+ // Builtin variables are handled separately.
+ emit_interface_block_globally(var);
+ emitted = true;
+ }
+ });
+ }
if (emitted)
statement("");
@@ -1490,23 +1748,48 @@ void CompilerHLSL::emit_resources()
statement("");
}
+ const bool is_mesh_shader = execution.model == ExecutionModelMeshEXT;
if (!output_variables.empty() || !active_output_builtins.empty())
{
- require_output = true;
- statement("struct SPIRV_Cross_Output");
+ sort(output_variables.begin(), output_variables.end(), variable_compare);
+ require_output = !is_mesh_shader;
+ statement(is_mesh_shader ? "struct gl_MeshPerVertexEXT" : "struct SPIRV_Cross_Output");
begin_scope();
- sort(output_variables.begin(), output_variables.end(), variable_compare);
for (auto &var : output_variables)
{
- if (var.block)
+ if (is_per_primitive_variable(*var.var))
+ continue;
+ if (var.block && is_mesh_shader && var.block_member_index != 0)
+ continue;
+ if (var.block && !is_mesh_shader)
emit_interface_block_member_in_struct(*var.var, var.block_member_index, var.location, active_outputs);
else
emit_interface_block_in_struct(*var.var, active_outputs);
}
emit_builtin_outputs_in_struct();
+ if (!is_mesh_shader)
+ emit_builtin_primitive_outputs_in_struct();
end_scope_decl();
statement("");
+
+ if (is_mesh_shader)
+ {
+ statement("struct gl_MeshPerPrimitiveEXT");
+ begin_scope();
+ for (auto &var : output_variables)
+ {
+ if (!is_per_primitive_variable(*var.var))
+ continue;
+ if (var.block && var.block_member_index != 0)
+ continue;
+
+ emit_interface_block_in_struct(*var.var, active_outputs);
+ }
+ emit_builtin_primitive_outputs_in_struct();
+ end_scope_decl();
+ statement("");
+ }
}
// Global variables.
@@ -1516,7 +1799,8 @@ void CompilerHLSL::emit_resources()
if (is_hidden_variable(var, true))
continue;
- if (var.storage != StorageClassOutput)
+ if (var.storage != StorageClassOutput &&
+ var.storage != StorageClassTaskPayloadWorkgroupEXT)
{
if (!variable_is_lut(var))
{
@@ -1550,8 +1834,6 @@ void CompilerHLSL::emit_resources()
if (emitted)
statement("");
- declare_undefined_values();
-
if (requires_op_fmod)
{
static const char *types[] = {
@@ -2042,6 +2324,194 @@ void CompilerHLSL::emit_texture_size_variants(uint64_t variant_mask, const char
}
}
+void CompilerHLSL::analyze_meshlet_writes()
+{
+ uint32_t id_per_vertex = 0;
+ uint32_t id_per_primitive = 0;
+ bool need_per_primitive = false;
+ bool need_per_vertex = false;
+
+ ir.for_each_typed_id<SPIRVariable>([&](uint32_t, SPIRVariable &var) {
+ auto &type = this->get<SPIRType>(var.basetype);
+ bool block = has_decoration(type.self, DecorationBlock);
+ if (var.storage == StorageClassOutput && block && is_builtin_variable(var))
+ {
+ auto flags = get_buffer_block_flags(var.self);
+ if (flags.get(DecorationPerPrimitiveEXT))
+ id_per_primitive = var.self;
+ else
+ id_per_vertex = var.self;
+ }
+ else if (var.storage == StorageClassOutput)
+ {
+ Bitset flags;
+ if (block)
+ flags = get_buffer_block_flags(var.self);
+ else
+ flags = get_decoration_bitset(var.self);
+
+ if (flags.get(DecorationPerPrimitiveEXT))
+ need_per_primitive = true;
+ else
+ need_per_vertex = true;
+ }
+ });
+
+ // If we have per-primitive outputs, and no per-primitive builtins,
+ // empty version of gl_MeshPerPrimitiveEXT will be emitted.
+ // If we don't use block IO for vertex output, we'll also need to synthesize the PerVertex block.
+
+ const auto generate_block = [&](const char *block_name, const char *instance_name, bool per_primitive) -> uint32_t {
+ auto &execution = get_entry_point();
+
+ uint32_t op_type = ir.increase_bound_by(4);
+ uint32_t op_arr = op_type + 1;
+ uint32_t op_ptr = op_type + 2;
+ uint32_t op_var = op_type + 3;
+
+ auto &type = set<SPIRType>(op_type);
+ type.basetype = SPIRType::Struct;
+ set_name(op_type, block_name);
+ set_decoration(op_type, DecorationBlock);
+ if (per_primitive)
+ set_decoration(op_type, DecorationPerPrimitiveEXT);
+
+ auto &arr = set<SPIRType>(op_arr, type);
+ arr.parent_type = type.self;
+ arr.array.push_back(per_primitive ? execution.output_primitives : execution.output_vertices);
+ arr.array_size_literal.push_back(true);
+
+ auto &ptr = set<SPIRType>(op_ptr, arr);
+ ptr.parent_type = arr.self;
+ ptr.pointer = true;
+ ptr.pointer_depth++;
+ ptr.storage = StorageClassOutput;
+ set_decoration(op_ptr, DecorationBlock);
+ set_name(op_ptr, block_name);
+
+ auto &var = set<SPIRVariable>(op_var, op_ptr, StorageClassOutput);
+ if (per_primitive)
+ set_decoration(op_var, DecorationPerPrimitiveEXT);
+ set_name(op_var, instance_name);
+ execution.interface_variables.push_back(var.self);
+
+ return op_var;
+ };
+
+ if (id_per_vertex == 0 && need_per_vertex)
+ id_per_vertex = generate_block("gl_MeshPerVertexEXT", "gl_MeshVerticesEXT", false);
+ if (id_per_primitive == 0 && need_per_primitive)
+ id_per_primitive = generate_block("gl_MeshPerPrimitiveEXT", "gl_MeshPrimitivesEXT", true);
+
+ unordered_set<uint32_t> processed_func_ids;
+ analyze_meshlet_writes(ir.default_entry_point, id_per_vertex, id_per_primitive, processed_func_ids);
+}
+
+void CompilerHLSL::analyze_meshlet_writes(uint32_t func_id, uint32_t id_per_vertex, uint32_t id_per_primitive,
+ std::unordered_set<uint32_t> &processed_func_ids)
+{
+ // Avoid processing a function more than once
+ if (processed_func_ids.find(func_id) != processed_func_ids.end())
+ return;
+ processed_func_ids.insert(func_id);
+
+ auto &func = get<SPIRFunction>(func_id);
+ // Recursively establish global args added to functions on which we depend.
+ for (auto& block : func.blocks)
+ {
+ auto &b = get<SPIRBlock>(block);
+ for (auto &i : b.ops)
+ {
+ auto ops = stream(i);
+ auto op = static_cast<Op>(i.op);
+
+ switch (op)
+ {
+ case OpFunctionCall:
+ {
+ // Then recurse into the function itself to extract globals used internally in the function
+ uint32_t inner_func_id = ops[2];
+ analyze_meshlet_writes(inner_func_id, id_per_vertex, id_per_primitive, processed_func_ids);
+ auto &inner_func = get<SPIRFunction>(inner_func_id);
+ for (auto &iarg : inner_func.arguments)
+ {
+ if (!iarg.alias_global_variable)
+ continue;
+
+ bool already_declared = false;
+ for (auto &arg : func.arguments)
+ {
+ if (arg.id == iarg.id)
+ {
+ already_declared = true;
+ break;
+ }
+ }
+
+ if (!already_declared)
+ {
+ // basetype is effectively ignored here since we declare the argument
+ // with explicit types. Just pass down a valid type.
+ func.arguments.push_back({ expression_type_id(iarg.id), iarg.id,
+ iarg.read_count, iarg.write_count, true });
+ }
+ }
+ break;
+ }
+
+ case OpStore:
+ case OpLoad:
+ case OpInBoundsAccessChain:
+ case OpAccessChain:
+ case OpPtrAccessChain:
+ case OpInBoundsPtrAccessChain:
+ case OpArrayLength:
+ {
+ auto *var = maybe_get<SPIRVariable>(ops[op == OpStore ? 0 : 2]);
+ if (var && (var->storage == StorageClassOutput || var->storage == StorageClassTaskPayloadWorkgroupEXT))
+ {
+ bool already_declared = false;
+ auto builtin_type = BuiltIn(get_decoration(var->self, DecorationBuiltIn));
+
+ uint32_t var_id = var->self;
+ if (var->storage != StorageClassTaskPayloadWorkgroupEXT &&
+ builtin_type != BuiltInPrimitivePointIndicesEXT &&
+ builtin_type != BuiltInPrimitiveLineIndicesEXT &&
+ builtin_type != BuiltInPrimitiveTriangleIndicesEXT)
+ {
+ var_id = is_per_primitive_variable(*var) ? id_per_primitive : id_per_vertex;
+ }
+
+ for (auto &arg : func.arguments)
+ {
+ if (arg.id == var_id)
+ {
+ already_declared = true;
+ break;
+ }
+ }
+
+ if (!already_declared)
+ {
+ // basetype is effectively ignored here since we declare the argument
+ // with explicit types. Just pass down a valid type.
+ uint32_t type_id = expression_type_id(var_id);
+ if (var->storage == StorageClassTaskPayloadWorkgroupEXT)
+ func.arguments.push_back({ type_id, var_id, 1u, 0u, true });
+ else
+ func.arguments.push_back({ type_id, var_id, 1u, 1u, true });
+ }
+ }
+ break;
+ }
+
+ default:
+ break;
+ }
+ }
+ }
+}
+
string CompilerHLSL::layout_for_member(const SPIRType &type, uint32_t index)
{
auto &flags = get_member_decoration_bitset(type.self, index);
@@ -2087,13 +2557,24 @@ void CompilerHLSL::emit_struct_member(const SPIRType &type, uint32_t member_type
variable_decl(membertype, to_member_name(type, index)), packing_offset, ";");
}
+void CompilerHLSL::emit_rayquery_function(const char *commited, const char *candidate, const uint32_t *ops)
+{
+ flush_variable_declaration(ops[0]);
+ uint32_t is_commited = evaluate_constant_u32(ops[3]);
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), is_commited ? commited : candidate), false);
+}
+
void CompilerHLSL::emit_buffer_block(const SPIRVariable &var)
{
auto &type = get<SPIRType>(var.basetype);
bool is_uav = var.storage == StorageClassStorageBuffer || has_decoration(type.self, DecorationBufferBlock);
- if (is_uav)
+ if (flattened_buffer_blocks.count(var.self))
+ {
+ emit_buffer_block_flattened(var);
+ }
+ else if (is_uav)
{
Bitset flags = ir.get_buffer_block_flags(var);
bool is_readonly = flags.get(DecorationNonWritable) && !is_hlsl_force_storage_buffer_as_uav(var.self);
@@ -2198,7 +2679,11 @@ void CompilerHLSL::emit_buffer_block(const SPIRVariable &var)
void CompilerHLSL::emit_push_constant_block(const SPIRVariable &var)
{
- if (root_constants_layout.empty())
+ if (flattened_buffer_blocks.count(var.self))
+ {
+ emit_buffer_block_flattened(var);
+ }
+ else if (root_constants_layout.empty())
{
emit_buffer_block(var);
}
@@ -2305,12 +2790,34 @@ string CompilerHLSL::to_func_call_arg(const SPIRFunction::Parameter &arg, uint32
return arg_str;
}
+string CompilerHLSL::get_inner_entry_point_name() const
+{
+ auto &execution = get_entry_point();
+
+ if (hlsl_options.use_entry_point_name)
+ {
+ auto name = join(execution.name, "_inner");
+ ParsedIR::sanitize_underscores(name);
+ return name;
+ }
+
+ if (execution.model == ExecutionModelVertex)
+ return "vert_main";
+ else if (execution.model == ExecutionModelFragment)
+ return "frag_main";
+ else if (execution.model == ExecutionModelGLCompute)
+ return "comp_main";
+ else if (execution.model == ExecutionModelMeshEXT)
+ return "mesh_main";
+ else
+ SPIRV_CROSS_THROW("Unsupported execution model.");
+}
+
void CompilerHLSL::emit_function_prototype(SPIRFunction &func, const Bitset &return_flags)
{
if (func.self != ir.default_entry_point)
add_function_overload(func);
- auto &execution = get_entry_point();
// Avoid shadow declarations.
local_variable_names = resource_names;
@@ -2331,14 +2838,7 @@ void CompilerHLSL::emit_function_prototype(SPIRFunction &func, const Bitset &ret
if (func.self == ir.default_entry_point)
{
- if (execution.model == ExecutionModelVertex)
- decl += "vert_main";
- else if (execution.model == ExecutionModelFragment)
- decl += "frag_main";
- else if (execution.model == ExecutionModelGLCompute)
- decl += "comp_main";
- else
- SPIRV_CROSS_THROW("Unsupported execution model.");
+ decl += get_inner_entry_point_name();
processing_entry_point = true;
}
else
@@ -2356,7 +2856,7 @@ void CompilerHLSL::emit_function_prototype(SPIRFunction &func, const Bitset &ret
out_argument += " ";
out_argument += "spvReturnValue";
out_argument += type_to_array_glsl(type);
- arglist.push_back(move(out_argument));
+ arglist.push_back(std::move(out_argument));
}
for (auto &arg : func.arguments)
@@ -2380,7 +2880,7 @@ void CompilerHLSL::emit_function_prototype(SPIRFunction &func, const Bitset &ret
arg_type.image.dim != DimBuffer)
{
// Manufacture automatic sampler arg for SampledImage texture
- arglist.push_back(join(image_is_comparison(arg_type, arg.id) ? "SamplerComparisonState " : "SamplerState ",
+ arglist.push_back(join(is_depth_image(arg_type, arg.id) ? "SamplerComparisonState " : "SamplerState ",
to_sampler_expression(arg.id), type_to_array_glsl(arg_type)));
}
@@ -2422,8 +2922,58 @@ void CompilerHLSL::emit_hlsl_entry_point()
switch (execution.model)
{
+ case ExecutionModelMeshEXT:
+ case ExecutionModelMeshNV:
case ExecutionModelGLCompute:
{
+ if (execution.model == ExecutionModelMeshEXT)
+ {
+ if (execution.flags.get(ExecutionModeOutputTrianglesEXT))
+ statement("[outputtopology(\"triangle\")]");
+ else if (execution.flags.get(ExecutionModeOutputLinesEXT))
+ statement("[outputtopology(\"line\")]");
+ else if (execution.flags.get(ExecutionModeOutputPoints))
+ SPIRV_CROSS_THROW("Topology mode \"points\" is not supported in DirectX");
+
+ auto &func = get<SPIRFunction>(ir.default_entry_point);
+ for (auto &arg : func.arguments)
+ {
+ auto &var = get<SPIRVariable>(arg.id);
+ auto &base_type = get<SPIRType>(var.basetype);
+ bool block = has_decoration(base_type.self, DecorationBlock);
+ if (var.storage == StorageClassTaskPayloadWorkgroupEXT)
+ {
+ arguments.push_back("in payload " + variable_decl(var));
+ }
+ else if (block)
+ {
+ auto flags = get_buffer_block_flags(var.self);
+ if (flags.get(DecorationPerPrimitiveEXT) || has_decoration(arg.id, DecorationPerPrimitiveEXT))
+ {
+ arguments.push_back("out primitives gl_MeshPerPrimitiveEXT gl_MeshPrimitivesEXT[" +
+ std::to_string(execution.output_primitives) + "]");
+ }
+ else
+ {
+ arguments.push_back("out vertices gl_MeshPerVertexEXT gl_MeshVerticesEXT[" +
+ std::to_string(execution.output_vertices) + "]");
+ }
+ }
+ else
+ {
+ if (execution.flags.get(ExecutionModeOutputTrianglesEXT))
+ {
+ arguments.push_back("out indices uint3 gl_PrimitiveTriangleIndicesEXT[" +
+ std::to_string(execution.output_primitives) + "]");
+ }
+ else
+ {
+ arguments.push_back("out indices uint2 gl_PrimitiveLineIndicesEXT[" +
+ std::to_string(execution.output_primitives) + "]");
+ }
+ }
+ }
+ }
SpecializationConstant wg_x, wg_y, wg_z;
get_work_group_size_specialization_constants(wg_x, wg_y, wg_z);
@@ -2431,6 +2981,16 @@ void CompilerHLSL::emit_hlsl_entry_point()
uint32_t y = execution.workgroup_size.y;
uint32_t z = execution.workgroup_size.z;
+ if (!execution.workgroup_size.constant && execution.flags.get(ExecutionModeLocalSizeId))
+ {
+ if (execution.workgroup_size.id_x)
+ x = get<SPIRConstant>(execution.workgroup_size.id_x).scalar();
+ if (execution.workgroup_size.id_y)
+ y = get<SPIRConstant>(execution.workgroup_size.id_y).scalar();
+ if (execution.workgroup_size.id_z)
+ z = get<SPIRConstant>(execution.workgroup_size.id_z).scalar();
+ }
+
auto x_expr = wg_x.id ? get<SPIRConstant>(wg_x.id).specialization_constant_macro_name : to_string(x);
auto y_expr = wg_y.id ? get<SPIRConstant>(wg_y.id).specialization_constant_macro_name : to_string(y);
auto z_expr = wg_z.id ? get<SPIRConstant>(wg_z.id).specialization_constant_macro_name : to_string(z);
@@ -2446,7 +3006,13 @@ void CompilerHLSL::emit_hlsl_entry_point()
break;
}
- statement(require_output ? "SPIRV_Cross_Output " : "void ", "main(", merge(arguments), ")");
+ const char *entry_point_name;
+ if (hlsl_options.use_entry_point_name)
+ entry_point_name = get_entry_point().name.c_str();
+ else
+ entry_point_name = "main";
+
+ statement(require_output ? "SPIRV_Cross_Output " : "void ", entry_point_name, "(", merge(arguments), ")");
begin_scope();
bool legacy = hlsl_options.shader_model <= 30;
@@ -2484,6 +3050,14 @@ void CompilerHLSL::emit_hlsl_entry_point()
statement(builtin, " = int(stage_input.", builtin, ");");
break;
+ case BuiltInBaseVertex:
+ statement(builtin, " = SPIRV_Cross_BaseVertex;");
+ break;
+
+ case BuiltInBaseInstance:
+ statement(builtin, " = SPIRV_Cross_BaseInstance;");
+ break;
+
case BuiltInInstanceId:
// D3D semantics are uint, but shader wants int.
statement(builtin, " = int(stage_input.", builtin, ");");
@@ -2493,6 +3067,7 @@ void CompilerHLSL::emit_hlsl_entry_point()
case BuiltInPointCoord:
case BuiltInSubgroupSize:
case BuiltInSubgroupLocalInvocationId:
+ case BuiltInHelperInvocation:
break;
case BuiltInSubgroupEqMask:
@@ -2618,12 +3193,21 @@ void CompilerHLSL::emit_hlsl_entry_point()
});
// Run the shader.
- if (execution.model == ExecutionModelVertex)
- statement("vert_main();");
- else if (execution.model == ExecutionModelFragment)
- statement("frag_main();");
- else if (execution.model == ExecutionModelGLCompute)
- statement("comp_main();");
+ if (execution.model == ExecutionModelVertex ||
+ execution.model == ExecutionModelFragment ||
+ execution.model == ExecutionModelGLCompute ||
+ execution.model == ExecutionModelMeshEXT)
+ {
+ // 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,
+ // but DXC post-inlining seems to magically fix it up anyways *shrug*.
+ SmallVector<string> arglist;
+ auto &func = get<SPIRFunction>(ir.default_entry_point);
+ // The arguments are marked out, avoid detecting reads and emitting inout.
+ for (auto &arg : func.arguments)
+ arglist.push_back(to_expression(arg.id, false));
+ statement(get_inner_entry_point_name(), "(", merge(arglist), ");");
+ }
else
SPIRV_CROSS_THROW("Unsupported shader stage.");
@@ -2712,7 +3296,7 @@ void CompilerHLSL::emit_hlsl_entry_point()
void CompilerHLSL::emit_fixup()
{
- if (is_vertex_like_shader())
+ if (is_vertex_like_shader() && active_output_builtins.get(BuiltInPosition))
{
// Do various mangling on the gl_Position.
if (hlsl_options.shader_model <= 30)
@@ -2910,7 +3494,7 @@ void CompilerHLSL::emit_texture_op(const Instruction &i, bool sparse)
{
texop += img_expr;
- if (image_is_comparison(imgtype, img))
+ if (is_depth_image(imgtype, img))
{
if (gather)
{
@@ -3248,6 +3832,11 @@ string CompilerHLSL::to_resource_binding(const SPIRVariable &var)
resource_flags = HLSL_BINDING_AUTO_SAMPLER_BIT;
break;
+ case SPIRType::AccelerationStructure:
+ space = 't'; // SRV
+ resource_flags = HLSL_BINDING_AUTO_SRV_BIT;
+ break;
+
case SPIRType::Struct:
{
auto storage = type.storage;
@@ -3386,7 +3975,7 @@ void CompilerHLSL::emit_modern_uniform(const SPIRVariable &var)
if (type.basetype == SPIRType::SampledImage && type.image.dim != DimBuffer)
{
// For combined image samplers, also emit a combined image sampler.
- if (image_is_comparison(type, var.self))
+ if (is_depth_image(type, var.self))
statement("SamplerComparisonState ", to_sampler_expression(var.self), type_to_array_glsl(type),
to_resource_binding_sampler(var), ";");
else
@@ -3483,6 +4072,18 @@ string CompilerHLSL::bitcast_glsl_op(const SPIRType &out_type, const SPIRType &i
}
return "spvPackFloat2x16";
}
+ else if (out_type.basetype == SPIRType::UShort && in_type.basetype == SPIRType::Half)
+ {
+ if (hlsl_options.shader_model < 40)
+ SPIRV_CROSS_THROW("Half to UShort requires Shader Model 4.");
+ return "(" + type_to_glsl(out_type) + ")f32tof16";
+ }
+ else if (out_type.basetype == SPIRType::Half && in_type.basetype == SPIRType::UShort)
+ {
+ if (hlsl_options.shader_model < 40)
+ SPIRV_CROSS_THROW("UShort to Half requires Shader Model 4.");
+ return "(" + type_to_glsl(out_type) + ")f16tof32";
+ }
else
return "";
}
@@ -3496,6 +4097,8 @@ void CompilerHLSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop,
auto int_type = to_signed_basetype(integer_width);
auto uint_type = to_unsigned_basetype(integer_width);
+ op = get_remapped_glsl_op(op);
+
switch (op)
{
case GLSLstd450InverseSqrt:
@@ -3968,7 +4571,7 @@ void CompilerHLSL::read_access_chain(string *expr, const string &lhs, const SPIR
if (lhs.empty())
{
assert(expr);
- *expr = move(load_expr);
+ *expr = std::move(load_expr);
}
else
statement(lhs, " = ", load_expr, ";");
@@ -4599,9 +5202,9 @@ void CompilerHLSL::emit_subgroup_op(const Instruction &i)
case OpGroupNonUniformBallotBitCount:
{
auto operation = static_cast<GroupOperation>(ops[3]);
+ bool forward = should_forward(ops[4]);
if (operation == GroupOperationReduce)
{
- bool forward = should_forward(ops[4]);
auto left = join("countbits(", to_enclosed_expression(ops[4]), ".x) + countbits(",
to_enclosed_expression(ops[4]), ".y)");
auto right = join("countbits(", to_enclosed_expression(ops[4]), ".z) + countbits(",
@@ -4610,9 +5213,31 @@ void CompilerHLSL::emit_subgroup_op(const Instruction &i)
inherit_expression_dependencies(id, ops[4]);
}
else if (operation == GroupOperationInclusiveScan)
- SPIRV_CROSS_THROW("Cannot trivially implement BallotBitCount Inclusive Scan in HLSL.");
+ {
+ auto left = join("countbits(", to_enclosed_expression(ops[4]), ".x & gl_SubgroupLeMask.x) + countbits(",
+ to_enclosed_expression(ops[4]), ".y & gl_SubgroupLeMask.y)");
+ auto right = join("countbits(", to_enclosed_expression(ops[4]), ".z & gl_SubgroupLeMask.z) + countbits(",
+ to_enclosed_expression(ops[4]), ".w & gl_SubgroupLeMask.w)");
+ emit_op(result_type, id, join(left, " + ", right), forward);
+ if (!active_input_builtins.get(BuiltInSubgroupLeMask))
+ {
+ active_input_builtins.set(BuiltInSubgroupLeMask);
+ force_recompile_guarantee_forward_progress();
+ }
+ }
else if (operation == GroupOperationExclusiveScan)
- SPIRV_CROSS_THROW("Cannot trivially implement BallotBitCount Exclusive Scan in HLSL.");
+ {
+ auto left = join("countbits(", to_enclosed_expression(ops[4]), ".x & gl_SubgroupLtMask.x) + countbits(",
+ to_enclosed_expression(ops[4]), ".y & gl_SubgroupLtMask.y)");
+ auto right = join("countbits(", to_enclosed_expression(ops[4]), ".z & gl_SubgroupLtMask.z) + countbits(",
+ to_enclosed_expression(ops[4]), ".w & gl_SubgroupLtMask.w)");
+ emit_op(result_type, id, join(left, " + ", right), forward);
+ if (!active_input_builtins.get(BuiltInSubgroupLtMask))
+ {
+ active_input_builtins.set(BuiltInSubgroupLtMask);
+ force_recompile_guarantee_forward_progress();
+ }
+ }
else
SPIRV_CROSS_THROW("Invalid BitCount operation.");
break;
@@ -4749,7 +5374,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
#define HLSL_BOP(op) emit_binary_op(ops[0], ops[1], ops[2], ops[3], #op)
#define HLSL_BOP_CAST(op, type) \
- emit_binary_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, opcode_is_sign_invariant(opcode))
+ emit_binary_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, opcode_is_sign_invariant(opcode), false)
#define HLSL_UOP(op) emit_unary_op(ops[0], ops[1], ops[2], #op)
#define HLSL_QFOP(op) emit_quaternary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], #op)
#define HLSL_TFOP(op) emit_trinary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], #op)
@@ -4764,6 +5389,8 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
auto int_type = to_signed_basetype(integer_width);
auto uint_type = to_unsigned_basetype(integer_width);
+ opcode = get_remapped_spirv_op(opcode);
+
switch (opcode)
{
case OpAccessChain:
@@ -5314,7 +5941,7 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
image_format_to_components(get<SPIRType>(var->basetype).image.format), imgexpr);
}
- if (var && var->forwardable)
+ if (var)
{
bool forward = forced_temporaries.find(id) == end(forced_temporaries);
auto &e = emit_op(result_type, id, imgexpr, forward);
@@ -5558,7 +6185,12 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
}
case OpIsHelperInvocationEXT:
- SPIRV_CROSS_THROW("helperInvocationEXT() is not supported in HLSL.");
+ if (hlsl_options.shader_model < 50 || get_entry_point().model != ExecutionModelFragment)
+ SPIRV_CROSS_THROW("Helper Invocation input is only supported in PS 5.0 or higher.");
+ // Helper lane state with demote is volatile by nature.
+ // Do not forward this.
+ emit_op(ops[0], ops[1], "IsHelperLane()", false);
+ break;
case OpBeginInvocationInterlockEXT:
case OpEndInvocationInterlockEXT:
@@ -5566,6 +6198,149 @@ void CompilerHLSL::emit_instruction(const Instruction &instruction)
SPIRV_CROSS_THROW("Rasterizer order views require Shader Model 5.1.");
break; // Nothing to do in the body
+ case OpRayQueryInitializeKHR:
+ {
+ flush_variable_declaration(ops[0]);
+
+ std::string ray_desc_name = get_unique_identifier();
+ statement("RayDesc ", ray_desc_name, " = {", to_expression(ops[4]), ", ", to_expression(ops[5]), ", ",
+ to_expression(ops[6]), ", ", to_expression(ops[7]), "};");
+
+ statement(to_expression(ops[0]), ".TraceRayInline(",
+ to_expression(ops[1]), ", ", // acc structure
+ to_expression(ops[2]), ", ", // ray flags
+ to_expression(ops[3]), ", ", // mask
+ ray_desc_name, ");"); // ray
+ break;
+ }
+ case OpRayQueryProceedKHR:
+ {
+ flush_variable_declaration(ops[0]);
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".Proceed()"), false);
+ break;
+ }
+ case OpRayQueryTerminateKHR:
+ {
+ flush_variable_declaration(ops[0]);
+ statement(to_expression(ops[0]), ".Abort();");
+ break;
+ }
+ case OpRayQueryGenerateIntersectionKHR:
+ {
+ flush_variable_declaration(ops[0]);
+ statement(to_expression(ops[0]), ".CommitProceduralPrimitiveHit(", ops[1], ");");
+ break;
+ }
+ case OpRayQueryConfirmIntersectionKHR:
+ {
+ flush_variable_declaration(ops[0]);
+ statement(to_expression(ops[0]), ".CommitNonOpaqueTriangleHit();");
+ break;
+ }
+ case OpRayQueryGetIntersectionTypeKHR:
+ {
+ emit_rayquery_function(".CommittedStatus()", ".CandidateType()", ops);
+ break;
+ }
+ case OpRayQueryGetIntersectionTKHR:
+ {
+ emit_rayquery_function(".CommittedRayT()", ".CandidateTriangleRayT()", ops);
+ break;
+ }
+ case OpRayQueryGetIntersectionInstanceCustomIndexKHR:
+ {
+ emit_rayquery_function(".CommittedInstanceID()", ".CandidateInstanceID()", ops);
+ break;
+ }
+ case OpRayQueryGetIntersectionInstanceIdKHR:
+ {
+ emit_rayquery_function(".CommittedInstanceIndex()", ".CandidateInstanceIndex()", ops);
+ break;
+ }
+ case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR:
+ {
+ emit_rayquery_function(".CommittedInstanceContributionToHitGroupIndex()",
+ ".CandidateInstanceContributionToHitGroupIndex()", ops);
+ break;
+ }
+ case OpRayQueryGetIntersectionGeometryIndexKHR:
+ {
+ emit_rayquery_function(".CommittedGeometryIndex()",
+ ".CandidateGeometryIndex()", ops);
+ break;
+ }
+ case OpRayQueryGetIntersectionPrimitiveIndexKHR:
+ {
+ emit_rayquery_function(".CommittedPrimitiveIndex()", ".CandidatePrimitiveIndex()", ops);
+ break;
+ }
+ case OpRayQueryGetIntersectionBarycentricsKHR:
+ {
+ emit_rayquery_function(".CommittedTriangleBarycentrics()", ".CandidateTriangleBarycentrics()", ops);
+ break;
+ }
+ case OpRayQueryGetIntersectionFrontFaceKHR:
+ {
+ emit_rayquery_function(".CommittedTriangleFrontFace()", ".CandidateTriangleFrontFace()", ops);
+ break;
+ }
+ case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR:
+ {
+ flush_variable_declaration(ops[0]);
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".CandidateProceduralPrimitiveNonOpaque()"), false);
+ break;
+ }
+ case OpRayQueryGetIntersectionObjectRayDirectionKHR:
+ {
+ emit_rayquery_function(".CommittedObjectRayDirection()", ".CandidateObjectRayDirection()", ops);
+ break;
+ }
+ case OpRayQueryGetIntersectionObjectRayOriginKHR:
+ {
+ flush_variable_declaration(ops[0]);
+ emit_rayquery_function(".CommittedObjectRayOrigin()", ".CandidateObjectRayOrigin()", ops);
+ break;
+ }
+ case OpRayQueryGetIntersectionObjectToWorldKHR:
+ {
+ emit_rayquery_function(".CommittedObjectToWorld4x3()", ".CandidateObjectToWorld4x3()", ops);
+ break;
+ }
+ case OpRayQueryGetIntersectionWorldToObjectKHR:
+ {
+ emit_rayquery_function(".CommittedWorldToObject4x3()", ".CandidateWorldToObject4x3()", ops);
+ break;
+ }
+ case OpRayQueryGetRayFlagsKHR:
+ {
+ flush_variable_declaration(ops[0]);
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".RayFlags()"), false);
+ break;
+ }
+ case OpRayQueryGetRayTMinKHR:
+ {
+ flush_variable_declaration(ops[0]);
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".RayTMin()"), false);
+ break;
+ }
+ case OpRayQueryGetWorldRayOriginKHR:
+ {
+ flush_variable_declaration(ops[0]);
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".WorldRayOrigin()"), false);
+ break;
+ }
+ case OpRayQueryGetWorldRayDirectionKHR:
+ {
+ flush_variable_declaration(ops[0]);
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".WorldRayDirection()"), false);
+ break;
+ }
+ case OpSetMeshOutputsEXT:
+ {
+ statement("SetMeshOutputCounts(", to_unpacked_expression(ops[0]), ", ", to_unpacked_expression(ops[1]), ");");
+ break;
+ }
+
default:
CompilerGLSL::emit_instruction(instruction);
break;
@@ -5645,7 +6420,7 @@ void CompilerHLSL::require_texture_query_variant(uint32_t var_id)
void CompilerHLSL::set_root_constant_layouts(std::vector<RootConstants> layout)
{
- root_constants_layout = move(layout);
+ root_constants_layout = std::move(layout);
}
void CompilerHLSL::add_vertex_attribute_remap(const HLSLVertexAttributeRemap &vertex_attributes)
@@ -5696,6 +6471,7 @@ VariableID CompilerHLSL::remap_num_workgroups_builtin()
ir.meta[variable_id].decoration.alias = "SPIRV_Cross_NumWorkgroups";
num_workgroups_builtin = variable_id;
+ get_entry_point().interface_variables.push_back(num_workgroups_builtin);
return variable_id;
}
@@ -5765,10 +6541,13 @@ string CompilerHLSL::compile()
backend.can_return_array = false;
backend.nonuniform_qualifier = "NonUniformResourceIndex";
backend.support_case_fallthrough = false;
+ backend.force_merged_mesh_block = get_execution_model() == ExecutionModelMeshEXT;
+ backend.force_gl_in_out_block = backend.force_merged_mesh_block;
// SM 4.1 does not support precise for some reason.
backend.support_precise_qualifier = hlsl_options.shader_model >= 50 || hlsl_options.shader_model == 40;
+ fixup_anonymous_struct_names();
fixup_type_alias();
reorder_type_alias();
build_function_control_flow_graphs_and_analyze();
@@ -5776,6 +6555,8 @@ string CompilerHLSL::compile()
update_active_builtins();
analyze_image_and_sampler_usage();
analyze_interlocked_resource_usage();
+ if (get_execution_model() == ExecutionModelMeshEXT)
+ analyze_meshlet_writes();
// Subpass input needs SV_Position.
if (need_subpass_input)
@@ -5784,10 +6565,7 @@ string CompilerHLSL::compile()
uint32_t pass_count = 0;
do
{
- if (pass_count >= 3)
- SPIRV_CROSS_THROW("Over 3 compilation loops detected. Must be a bug!");
-
- reset();
+ reset(pass_count);
// Move constructor for this type is broken on GCC 4.9 ...
buffer.reset();
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.hpp
index 54a49dafa25..57d1c2cdc01 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_hlsl.hpp
@@ -98,6 +98,11 @@ struct HLSLResourceBinding
} cbv, uav, srv, sampler;
};
+enum HLSLAuxBinding
+{
+ HLSL_AUX_BINDING_BASE_VERTEX_INSTANCE = 0
+};
+
class CompilerHLSL : public CompilerGLSL
{
public:
@@ -137,6 +142,9 @@ public:
// If add_vertex_attribute_remap is used and this feature is used,
// the semantic name will be queried once per active location.
bool flatten_matrix_vertex_input_semantics = false;
+
+ // Rather than emitting main() for the entry point, use the name in SPIR-V.
+ bool use_entry_point_name = false;
};
explicit CompilerHLSL(std::vector<uint32_t> spirv_)
@@ -208,6 +216,11 @@ public:
// Controls which storage buffer bindings will be forced to be declared as UAVs.
void set_hlsl_force_storage_buffer_as_uav(uint32_t desc_set, uint32_t binding);
+ // By default, these magic buffers are not assigned a specific binding.
+ void set_hlsl_aux_buffer_binding(HLSLAuxBinding binding, uint32_t register_index, uint32_t register_space);
+ void unset_hlsl_aux_buffer_binding(HLSLAuxBinding binding);
+ bool is_hlsl_aux_buffer_binding_used(HLSLAuxBinding binding) const;
+
private:
std::string type_to_glsl(const SPIRType &type, uint32_t id = 0) override;
std::string image_type_hlsl(const SPIRType &type, uint32_t id);
@@ -217,14 +230,13 @@ private:
void emit_hlsl_entry_point();
void emit_header() override;
void emit_resources();
- void declare_undefined_values() override;
void emit_interface_block_globally(const SPIRVariable &type);
void emit_interface_block_in_struct(const SPIRVariable &var, std::unordered_set<uint32_t> &active_locations);
- void emit_interface_block_member_in_struct(const SPIRVariable &var, uint32_t member_index,
- uint32_t location,
+ void emit_interface_block_member_in_struct(const SPIRVariable &var, uint32_t member_index, uint32_t location,
std::unordered_set<uint32_t> &active_locations);
void emit_builtin_inputs_in_struct();
void emit_builtin_outputs_in_struct();
+ void emit_builtin_primitive_outputs_in_struct();
void emit_texture_op(const Instruction &i, bool sparse) override;
void emit_instruction(const Instruction &instruction) override;
void emit_glsl_op(uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args,
@@ -267,6 +279,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);
const char *to_storage_qualifiers_glsl(const SPIRVariable &var) override;
void replace_illegal_names() override;
@@ -341,6 +354,10 @@ private:
TypeUnpackUint64
};
+ void analyze_meshlet_writes();
+ void analyze_meshlet_writes(uint32_t func_id, uint32_t id_per_vertex, uint32_t id_per_primitive,
+ std::unordered_set<uint32_t> &processed_func_ids);
+
BitcastType get_bitcast_type(uint32_t result_type, uint32_t op0);
void emit_builtin_variables();
@@ -369,10 +386,20 @@ private:
std::unordered_set<SetBindingPair, InternalHasher> force_uav_buffer_bindings;
+ struct
+ {
+ uint32_t register_index = 0;
+ uint32_t register_space = 0;
+ bool explicit_binding = false;
+ bool used = false;
+ } base_vertex_info;
+
// Returns true for BuiltInSampleMask because gl_SampleMask[] is an array in SPIR-V, but SV_Coverage is a scalar in HLSL.
bool builtin_translates_to_nonarray(spv::BuiltIn builtin) const override;
std::vector<TypeID> composite_selection_workaround_types;
+
+ std::string get_inner_entry_point_name() const;
};
} // namespace SPIRV_CROSS_NAMESPACE
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.cpp
index 2b1e0626312..6ccbee87807 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.cpp
@@ -37,7 +37,7 @@ static const uint32_t k_unknown_component = ~0u;
static const char *force_inline = "static inline __attribute__((always_inline))";
CompilerMSL::CompilerMSL(std::vector<uint32_t> spirv_)
- : CompilerGLSL(move(spirv_))
+ : CompilerGLSL(std::move(spirv_))
{
}
@@ -56,13 +56,20 @@ CompilerMSL::CompilerMSL(ParsedIR &&ir_)
{
}
-void CompilerMSL::add_msl_shader_input(const MSLShaderInput &si)
+void CompilerMSL::add_msl_shader_input(const MSLShaderInterfaceVariable &si)
{
- inputs_by_location[si.location] = si;
+ inputs_by_location[{si.location, si.component}] = si;
if (si.builtin != BuiltInMax && !inputs_by_builtin.count(si.builtin))
inputs_by_builtin[si.builtin] = si;
}
+void CompilerMSL::add_msl_shader_output(const MSLShaderInterfaceVariable &so)
+{
+ outputs_by_location[{so.location, so.component}] = so;
+ if (so.builtin != BuiltInMax && !outputs_by_builtin.count(so.builtin))
+ outputs_by_builtin[so.builtin] = so;
+}
+
void CompilerMSL::add_msl_resource_binding(const MSLResourceBinding &binding)
{
StageSetBinding tuple = { binding.stage, binding.desc_set, binding.binding };
@@ -150,6 +157,13 @@ bool CompilerMSL::is_msl_shader_input_used(uint32_t location)
location_inputs_in_use_fallback.count(location) == 0;
}
+bool CompilerMSL::is_msl_shader_output_used(uint32_t location)
+{
+ // Don't report internal location allocations to app.
+ return location_outputs_in_use.count(location) != 0 &&
+ location_outputs_in_use_fallback.count(location) == 0;
+}
+
uint32_t CompilerMSL::get_automatic_builtin_input_location(spv::BuiltIn builtin) const
{
auto itr = builtin_to_automatic_input_location.find(builtin);
@@ -159,6 +173,15 @@ uint32_t CompilerMSL::get_automatic_builtin_input_location(spv::BuiltIn builtin)
return itr->second;
}
+uint32_t CompilerMSL::get_automatic_builtin_output_location(spv::BuiltIn builtin) const
+{
+ auto itr = builtin_to_automatic_output_location.find(builtin);
+ if (itr == builtin_to_automatic_output_location.end())
+ return k_unknown_location;
+ else
+ return itr->second;
+}
+
bool CompilerMSL::is_msl_resource_binding_used(ExecutionModel model, uint32_t desc_set, uint32_t binding) const
{
StageSetBinding tuple = { model, desc_set, binding };
@@ -211,7 +234,8 @@ void CompilerMSL::build_implicit_builtins()
bool need_sample_pos = active_input_builtins.get(BuiltInSamplePosition);
bool need_vertex_params = capture_output_to_buffer && get_execution_model() == ExecutionModelVertex &&
!msl_options.vertex_for_tessellation;
- bool need_tesc_params = get_execution_model() == ExecutionModelTessellationControl;
+ bool need_tesc_params = is_tesc_shader();
+ bool need_tese_params = is_tese_shader() && msl_options.raw_buffer_tese_input;
bool need_subgroup_mask =
active_input_builtins.get(BuiltInSubgroupEqMask) || active_input_builtins.get(BuiltInSubgroupGeMask) ||
active_input_builtins.get(BuiltInSubgroupGtMask) || active_input_builtins.get(BuiltInSubgroupLeMask) ||
@@ -234,9 +258,9 @@ void CompilerMSL::build_implicit_builtins()
bool need_workgroup_size = msl_options.emulate_subgroups && active_input_builtins.get(BuiltInNumSubgroups);
if (need_subpass_input || need_sample_pos || need_subgroup_mask || need_vertex_params || need_tesc_params ||
- need_multiview || need_dispatch_base || need_vertex_base_params || need_grid_params || needs_sample_id ||
- needs_subgroup_invocation_id || needs_subgroup_size || has_additional_fixed_sample_mask() || need_local_invocation_index ||
- need_workgroup_size)
+ need_tese_params || need_multiview || need_dispatch_base || need_vertex_base_params || need_grid_params ||
+ needs_sample_id || needs_subgroup_invocation_id || needs_subgroup_size || needs_helper_invocation ||
+ has_additional_fixed_sample_mask() || need_local_invocation_index || need_workgroup_size)
{
bool has_frag_coord = false;
bool has_sample_id = false;
@@ -250,6 +274,7 @@ void CompilerMSL::build_implicit_builtins()
bool has_subgroup_size = false;
bool has_view_idx = false;
bool has_layer = false;
+ bool has_helper_invocation = false;
bool has_local_invocation_index = false;
bool has_workgroup_size = false;
uint32_t workgroup_id_type = 0;
@@ -342,23 +367,28 @@ void CompilerMSL::build_implicit_builtins()
}
}
- if (need_tesc_params)
+ if (need_tesc_params && builtin == BuiltInInvocationId)
{
- switch (builtin)
- {
- case BuiltInInvocationId:
- builtin_invocation_id_id = var.self;
- mark_implicit_builtin(StorageClassInput, BuiltInInvocationId, var.self);
- has_invocation_id = true;
- break;
- case BuiltInPrimitiveId:
- builtin_primitive_id_id = var.self;
- mark_implicit_builtin(StorageClassInput, BuiltInPrimitiveId, var.self);
- has_primitive_id = true;
- break;
- default:
- break;
- }
+ builtin_invocation_id_id = var.self;
+ mark_implicit_builtin(StorageClassInput, BuiltInInvocationId, var.self);
+ has_invocation_id = true;
+ }
+
+ if ((need_tesc_params || need_tese_params) && builtin == BuiltInPrimitiveId)
+ {
+ builtin_primitive_id_id = var.self;
+ mark_implicit_builtin(StorageClassInput, BuiltInPrimitiveId, var.self);
+ has_primitive_id = true;
+ }
+
+ if (need_tese_params && builtin == BuiltInTessLevelOuter)
+ {
+ tess_level_outer_var_id = var.self;
+ }
+
+ if (need_tese_params && builtin == BuiltInTessLevelInner)
+ {
+ tess_level_inner_var_id = var.self;
}
if ((need_subgroup_mask || needs_subgroup_invocation_id) && builtin == BuiltInSubgroupLocalInvocationId)
@@ -401,6 +431,13 @@ void CompilerMSL::build_implicit_builtins()
}
}
+ if (needs_helper_invocation && builtin == BuiltInHelperInvocation)
+ {
+ builtin_helper_invocation_id = var.self;
+ mark_implicit_builtin(StorageClassInput, BuiltInHelperInvocation, var.self);
+ has_helper_invocation = true;
+ }
+
if (need_local_invocation_index && builtin == BuiltInLocalInvocationIndex)
{
builtin_local_invocation_index_id = var.self;
@@ -617,7 +654,7 @@ void CompilerMSL::build_implicit_builtins()
}
if ((need_tesc_params && (msl_options.multi_patch_workgroup || !has_invocation_id || !has_primitive_id)) ||
- need_grid_params)
+ (need_tese_params && !has_primitive_id) || need_grid_params)
{
uint32_t type_ptr_id = ir.increase_bound_by(1);
@@ -630,7 +667,7 @@ void CompilerMSL::build_implicit_builtins()
auto &ptr_type = set<SPIRType>(type_ptr_id, uint_type_ptr);
ptr_type.self = get_uint_type_id();
- if (msl_options.multi_patch_workgroup || need_grid_params)
+ if ((need_tesc_params && msl_options.multi_patch_workgroup) || need_grid_params)
{
uint32_t var_id = ir.increase_bound_by(1);
@@ -651,7 +688,7 @@ void CompilerMSL::build_implicit_builtins()
mark_implicit_builtin(StorageClassInput, BuiltInInvocationId, var_id);
}
- if (need_tesc_params && !has_primitive_id)
+ if ((need_tesc_params || need_tese_params) && !has_primitive_id)
{
uint32_t var_id = ir.increase_bound_by(1);
@@ -777,6 +814,35 @@ void CompilerMSL::build_implicit_builtins()
mark_implicit_builtin(StorageClassOutput, BuiltInSampleMask, var_id);
}
+ if (!has_helper_invocation && needs_helper_invocation)
+ {
+ uint32_t offset = ir.increase_bound_by(3);
+ uint32_t type_id = offset;
+ uint32_t type_ptr_id = offset + 1;
+ uint32_t var_id = offset + 2;
+
+ // Create gl_HelperInvocation.
+ SPIRType bool_type;
+ bool_type.basetype = SPIRType::Boolean;
+ bool_type.width = 8;
+ bool_type.vecsize = 1;
+ set<SPIRType>(type_id, bool_type);
+
+ SPIRType bool_type_ptr_in;
+ bool_type_ptr_in = bool_type;
+ bool_type_ptr_in.pointer = true;
+ bool_type_ptr_in.pointer_depth++;
+ bool_type_ptr_in.parent_type = type_id;
+ bool_type_ptr_in.storage = StorageClassInput;
+
+ auto &ptr_in_type = set<SPIRType>(type_ptr_id, bool_type_ptr_in);
+ ptr_in_type.self = type_id;
+ set<SPIRVariable>(var_id, type_ptr_id, StorageClassInput);
+ set_decoration(var_id, DecorationBuiltIn, BuiltInHelperInvocation);
+ builtin_helper_invocation_id = var_id;
+ mark_implicit_builtin(StorageClassInput, BuiltInHelperInvocation, var_id);
+ }
+
if (need_local_invocation_index && !has_local_invocation_index)
{
uint32_t offset = ir.increase_bound_by(2);
@@ -833,7 +899,7 @@ void CompilerMSL::build_implicit_builtins()
swizzle_buffer_id = var_id;
}
- if (!buffers_requiring_array_length.empty())
+ if (needs_buffer_size_buffer())
{
uint32_t var_id = build_constant_uint_array_pointer();
set_name(var_id, "spvBufferSizeConstants");
@@ -868,11 +934,9 @@ void CompilerMSL::build_implicit_builtins()
}
// If we're returning a struct from a vertex-like entry point, we must return a position attribute.
- bool need_position =
- (get_execution_model() == ExecutionModelVertex ||
- get_execution_model() == ExecutionModelTessellationEvaluation) &&
- !capture_output_to_buffer && !get_is_rasterization_disabled() &&
- !active_output_builtins.get(BuiltInPosition);
+ bool need_position = (get_execution_model() == ExecutionModelVertex || is_tese_shader()) &&
+ !capture_output_to_buffer && !get_is_rasterization_disabled() &&
+ !active_output_builtins.get(BuiltInPosition);
if (need_position)
{
@@ -1062,7 +1126,7 @@ SPIRType &CompilerMSL::get_patch_stage_out_struct_type()
std::string CompilerMSL::get_tess_factor_struct_name()
{
- if (get_entry_point().flags.get(ExecutionModeTriangles))
+ if (is_tessellating_triangles())
return "MTLTriangleTessellationFactorsHalf";
return "MTLQuadTessellationFactorsHalf";
}
@@ -1248,7 +1312,7 @@ void CompilerMSL::emit_entry_point_declarations()
else
{
is_using_builtin_array = true;
- statement(get_argument_address_space(var), " ", type_to_glsl(type), "* ", to_restrict(var_id), name,
+ statement(get_argument_address_space(var), " ", type_to_glsl(type), "* ", to_restrict(var_id, true), name,
type_to_array_glsl(type), " =");
uint32_t dim = uint32_t(type.array.size());
@@ -1283,7 +1347,7 @@ void CompilerMSL::emit_entry_point_declarations()
}
else
{
- statement(get_argument_address_space(var), " auto& ", to_restrict(var_id), name, " = *(",
+ statement(get_argument_address_space(var), " auto& ", to_restrict(var_id, true), name, " = *(",
get_argument_address_space(var), " ", type_to_glsl(type), "* ", to_restrict(var_id, false), ")((",
get_argument_address_space(var), " char* ", to_restrict(var_id, false), ")", to_name(arg_id), ".",
ensure_valid_name(name, "m"), " + ", to_name(dynamic_offsets_buffer_id), "[", base_index, "]);");
@@ -1291,13 +1355,13 @@ void CompilerMSL::emit_entry_point_declarations()
}
// Emit buffer arrays here.
- for (uint32_t array_id : buffer_arrays)
+ for (uint32_t array_id : buffer_arrays_discrete)
{
const auto &var = get<SPIRVariable>(array_id);
const auto &type = get_variable_data_type(var);
const auto &buffer_type = get_variable_element_type(var);
string name = to_name(array_id);
- statement(get_argument_address_space(var), " ", type_to_glsl(buffer_type), "* ", to_restrict(array_id), name,
+ statement(get_argument_address_space(var), " ", type_to_glsl(buffer_type), "* ", to_restrict(array_id, true), name,
"[] =");
begin_scope();
for (uint32_t i = 0; i < to_array_size_literal(type); ++i)
@@ -1305,8 +1369,57 @@ void CompilerMSL::emit_entry_point_declarations()
end_scope_decl();
statement_no_indent("");
}
- // For some reason, without this, we end up emitting the arrays twice.
- buffer_arrays.clear();
+ // Discrete descriptors are processed in entry point emission every compiler iteration.
+ buffer_arrays_discrete.clear();
+
+ // Emit buffer aliases here.
+ for (auto &var_id : buffer_aliases_discrete)
+ {
+ const auto &var = get<SPIRVariable>(var_id);
+ const auto &type = get_variable_data_type(var);
+ auto addr_space = get_argument_address_space(var);
+ auto name = to_name(var_id);
+
+ uint32_t desc_set = get_decoration(var_id, DecorationDescriptorSet);
+ uint32_t desc_binding = get_decoration(var_id, DecorationBinding);
+ auto alias_name = join("spvBufferAliasSet", desc_set, "Binding", desc_binding);
+
+ statement(addr_space, " auto& ", to_restrict(var_id, true),
+ name,
+ " = *(", addr_space, " ", type_to_glsl(type), "*)", alias_name, ";");
+ }
+ // Discrete descriptors are processed in entry point emission every compiler iteration.
+ buffer_aliases_discrete.clear();
+
+ for (auto &var_pair : buffer_aliases_argument)
+ {
+ uint32_t var_id = var_pair.first;
+ uint32_t alias_id = var_pair.second;
+
+ const auto &var = get<SPIRVariable>(var_id);
+ const auto &type = get_variable_data_type(var);
+ auto addr_space = get_argument_address_space(var);
+
+ if (type.array.empty())
+ {
+ statement(addr_space, " auto& ", to_restrict(var_id, true), to_name(var_id), " = (", addr_space, " ",
+ type_to_glsl(type), "&)", ir.meta[alias_id].decoration.qualified_alias, ";");
+ }
+ else
+ {
+ const char *desc_addr_space = descriptor_address_space(var_id, var.storage, "thread");
+
+ // Esoteric type cast. Reference to array of pointers.
+ // Auto here defers to UBO or SSBO. The address space of the reference needs to refer to the
+ // address space of the argument buffer itself, which is usually constant, but can be const device for
+ // large argument buffers.
+ is_using_builtin_array = true;
+ statement(desc_addr_space, " auto& ", to_restrict(var_id, true), to_name(var_id), " = (", addr_space, " ",
+ type_to_glsl(type), "* ", desc_addr_space, " (&)",
+ type_to_array_glsl(type), ")", ir.meta[alias_id].decoration.qualified_alias, ";");
+ is_using_builtin_array = false;
+ }
+ }
// Emit disabled fragment outputs.
std::sort(disabled_frag_outputs.begin(), disabled_frag_outputs.end());
@@ -1339,8 +1452,6 @@ string CompilerMSL::compile()
backend.basic_uint8_type = "uchar";
backend.basic_int16_type = "short";
backend.basic_uint16_type = "ushort";
- backend.discard_literal = "discard_fragment()";
- backend.demote_literal = "discard_fragment()";
backend.boolean_mix_function = "select";
backend.swizzle_is_function = false;
backend.shared_is_implied = false;
@@ -1355,13 +1466,15 @@ string CompilerMSL::compile()
backend.nonuniform_qualifier = "";
backend.support_small_type_sampling_result = true;
backend.supports_empty_struct = true;
+ backend.support_64bit_switch = true;
// Allow Metal to use the array<T> template unless we force it off.
backend.can_return_array = !msl_options.force_native_arrays;
backend.array_is_value_type = !msl_options.force_native_arrays;
- // Arrays which are part of buffer objects are never considered to be native arrays.
- backend.buffer_offset_array_is_value_type = false;
+ // Arrays which are part of buffer objects are never considered to be value types (just plain C-style).
+ backend.array_is_value_type_in_buffer_blocks = false;
backend.support_pointer_to_pointer = true;
+ backend.implicit_c_integer_promotion_rules = true;
capture_output_to_buffer = msl_options.capture_output_to_buffer;
is_rasterization_disabled = msl_options.disable_rasterization || capture_output_to_buffer;
@@ -1370,6 +1483,7 @@ string CompilerMSL::compile()
for (auto &id : next_metal_resource_ids)
id = 0;
+ fixup_anonymous_struct_names();
fixup_type_alias();
replace_illegal_names();
sync_entry_point_aliases_and_names();
@@ -1382,6 +1496,20 @@ string CompilerMSL::compile()
preprocess_op_codes();
build_implicit_builtins();
+ if (needs_manual_helper_invocation_updates() &&
+ (active_input_builtins.get(BuiltInHelperInvocation) || needs_helper_invocation))
+ {
+ string discard_expr =
+ join(builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput), " = true, discard_fragment()");
+ backend.discard_literal = discard_expr;
+ backend.demote_literal = discard_expr;
+ }
+ else
+ {
+ backend.discard_literal = "discard_fragment()";
+ backend.demote_literal = "discard_fragment()";
+ }
+
fixup_image_load_store_access();
set_enabled_interface_variables(get_active_interface_variables());
@@ -1389,19 +1517,19 @@ string CompilerMSL::compile()
activate_argument_buffer_resources();
if (swizzle_buffer_id)
- active_interface_variables.insert(swizzle_buffer_id);
+ add_active_interface_variable(swizzle_buffer_id);
if (buffer_size_buffer_id)
- active_interface_variables.insert(buffer_size_buffer_id);
+ add_active_interface_variable(buffer_size_buffer_id);
if (view_mask_buffer_id)
- active_interface_variables.insert(view_mask_buffer_id);
+ add_active_interface_variable(view_mask_buffer_id);
if (dynamic_offsets_buffer_id)
- active_interface_variables.insert(dynamic_offsets_buffer_id);
+ add_active_interface_variable(dynamic_offsets_buffer_id);
if (builtin_layer_id)
- active_interface_variables.insert(builtin_layer_id);
+ add_active_interface_variable(builtin_layer_id);
if (builtin_dispatch_base_id && !msl_options.supports_msl_version(1, 2))
- active_interface_variables.insert(builtin_dispatch_base_id);
+ add_active_interface_variable(builtin_dispatch_base_id);
if (builtin_sample_mask_id)
- active_interface_variables.insert(builtin_sample_mask_id);
+ add_active_interface_variable(builtin_sample_mask_id);
// Create structs to hold input, output and uniform variables.
// Do output first to ensure out. is declared at top of entry function.
@@ -1409,10 +1537,10 @@ string CompilerMSL::compile()
stage_out_var_id = add_interface_block(StorageClassOutput);
patch_stage_out_var_id = add_interface_block(StorageClassOutput, true);
stage_in_var_id = add_interface_block(StorageClassInput);
- if (get_execution_model() == ExecutionModelTessellationEvaluation)
+ if (is_tese_shader())
patch_stage_in_var_id = add_interface_block(StorageClassInput, true);
- if (get_execution_model() == ExecutionModelTessellationControl)
+ if (is_tesc_shader())
stage_out_ptr_var_id = add_interface_block_pointer(stage_out_var_id, StorageClassOutput);
if (is_tessellation_shader())
stage_in_ptr_var_id = add_interface_block_pointer(stage_in_var_id, StorageClassInput);
@@ -1445,10 +1573,7 @@ string CompilerMSL::compile()
uint32_t pass_count = 0;
do
{
- if (pass_count >= 3)
- SPIRV_CROSS_THROW("Over 3 compilation loops detected. Must be a bug!");
-
- reset();
+ reset(pass_count);
// Start bindings at zero.
next_metal_resource_index_buffer = 0;
@@ -1462,9 +1587,9 @@ string CompilerMSL::compile()
emit_header();
emit_custom_templates();
+ emit_custom_functions();
emit_specialization_constants_and_structs();
emit_resources();
- emit_custom_functions();
emit_function(get<SPIRFunction>(ir.default_entry_point), Bitset());
pass_count++;
@@ -1489,13 +1614,13 @@ void CompilerMSL::preprocess_op_codes()
// Before MSL 2.1 (2.2 for textures), Metal vertex functions that write to
// resources must disable rasterization and return void.
- if (preproc.uses_resource_write)
+ if ((preproc.uses_buffer_write && !msl_options.supports_msl_version(2, 1)) ||
+ (preproc.uses_image_write && !msl_options.supports_msl_version(2, 2)))
is_rasterization_disabled = true;
// Tessellation control shaders are run as compute functions in Metal, and so
// must capture their output to a buffer.
- if (get_execution_model() == ExecutionModelTessellationControl ||
- (get_execution_model() == ExecutionModelVertex && msl_options.vertex_for_tessellation))
+ if (is_tesc_shader() || (get_execution_model() == ExecutionModelVertex && msl_options.vertex_for_tessellation))
{
is_rasterization_disabled = true;
capture_output_to_buffer = true;
@@ -1510,8 +1635,37 @@ void CompilerMSL::preprocess_op_codes()
// that function would add gl_FragCoord.
if (preproc.needs_sample_id || msl_options.force_sample_rate_shading ||
(is_sample_rate() && (active_input_builtins.get(BuiltInFragCoord) ||
- (need_subpass_input && !msl_options.use_framebuffer_fetch_subpasses))))
+ (need_subpass_input_ms && !msl_options.use_framebuffer_fetch_subpasses))))
needs_sample_id = true;
+ if (preproc.needs_helper_invocation)
+ needs_helper_invocation = true;
+
+ // OpKill is removed by the parser, so we need to identify those by inspecting
+ // blocks.
+ ir.for_each_typed_id<SPIRBlock>([&preproc](uint32_t, SPIRBlock &block) {
+ if (block.terminator == SPIRBlock::Kill)
+ preproc.uses_discard = true;
+ });
+
+ // Fragment shaders that both write to storage resources and discard fragments
+ // need checks on the writes, to work around Metal allowing these writes despite
+ // the fragment being dead.
+ if (msl_options.check_discarded_frag_stores && preproc.uses_discard &&
+ (preproc.uses_buffer_write || preproc.uses_image_write))
+ {
+ frag_shader_needs_discard_checks = true;
+ needs_helper_invocation = true;
+ // Fragment discard store checks imply manual HelperInvocation updates.
+ msl_options.manual_helper_invocation_updates = true;
+ }
+
+ if (is_intersection_query())
+ {
+ add_header_line("#if __METAL_VERSION__ >= 230");
+ add_header_line("#include <metal_raytracing>");
+ add_header_line("using namespace metal::raytracing;");
+ add_header_line("#endif");
+ }
}
// Move the Private and Workgroup global variables to the entry function.
@@ -1542,6 +1696,30 @@ void CompilerMSL::extract_global_variables_from_functions()
// Uniforms
unordered_set<uint32_t> global_var_ids;
ir.for_each_typed_id<SPIRVariable>([&](uint32_t, SPIRVariable &var) {
+ // Some builtins resolve directly to a function call which does not need any declared variables.
+ // Skip these.
+ if (var.storage == StorageClassInput && has_decoration(var.self, DecorationBuiltIn))
+ {
+ auto bi_type = BuiltIn(get_decoration(var.self, DecorationBuiltIn));
+ if (bi_type == BuiltInHelperInvocation && !needs_manual_helper_invocation_updates())
+ return;
+ if (bi_type == BuiltInHelperInvocation && needs_manual_helper_invocation_updates())
+ {
+ if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 3))
+ SPIRV_CROSS_THROW("simd_is_helper_thread() requires version 2.3 on iOS.");
+ else if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 1))
+ SPIRV_CROSS_THROW("simd_is_helper_thread() requires version 2.1 on macOS.");
+ // Make sure this is declared and initialized.
+ // Force this to have the proper name.
+ set_name(var.self, builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput));
+ auto &entry_func = this->get<SPIRFunction>(ir.default_entry_point);
+ entry_func.add_local_variable(var.self);
+ vars_needing_early_declaration.push_back(var.self);
+ entry_func.fixup_hooks_in.push_back([this, &var]()
+ { statement(to_name(var.self), " = simd_is_helper_thread();"); });
+ }
+ }
+
if (var.storage == StorageClassInput || var.storage == StorageClassOutput ||
var.storage == StorageClassUniform || var.storage == StorageClassUniformConstant ||
var.storage == StorageClassPushConstant || var.storage == StorageClassStorageBuffer)
@@ -1655,6 +1833,9 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std::
if (global_var_ids.find(rvalue_id) != global_var_ids.end())
added_arg_ids.insert(rvalue_id);
+ if (needs_frag_discard_checks())
+ added_arg_ids.insert(builtin_helper_invocation_id);
+
break;
}
@@ -1669,6 +1850,25 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std::
break;
}
+ case OpAtomicExchange:
+ case OpAtomicCompareExchange:
+ case OpAtomicStore:
+ case OpAtomicIIncrement:
+ case OpAtomicIDecrement:
+ case OpAtomicIAdd:
+ case OpAtomicISub:
+ case OpAtomicSMin:
+ case OpAtomicUMin:
+ case OpAtomicSMax:
+ case OpAtomicUMax:
+ case OpAtomicAnd:
+ case OpAtomicOr:
+ case OpAtomicXor:
+ case OpImageWrite:
+ if (needs_frag_discard_checks())
+ added_arg_ids.insert(builtin_helper_invocation_id);
+ break;
+
// Emulate texture2D atomic operations
case OpImageTexelPointer:
{
@@ -1702,6 +1902,16 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std::
added_arg_ids.insert(stage_in_var_id);
break;
}
+
+ case GLSLstd450Modf:
+ case GLSLstd450Frexp:
+ {
+ uint32_t base_id = ops[5];
+ if (global_var_ids.find(base_id) != global_var_ids.end())
+ added_arg_ids.insert(base_id);
+ break;
+ }
+
default:
break;
}
@@ -1740,10 +1950,64 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std::
break;
}
+ case OpDemoteToHelperInvocation:
+ if (needs_manual_helper_invocation_updates() &&
+ (active_input_builtins.get(BuiltInHelperInvocation) || needs_helper_invocation))
+ added_arg_ids.insert(builtin_helper_invocation_id);
+ break;
+
+ case OpIsHelperInvocationEXT:
+ if (needs_manual_helper_invocation_updates())
+ added_arg_ids.insert(builtin_helper_invocation_id);
+ break;
+
+ case OpRayQueryInitializeKHR:
+ case OpRayQueryProceedKHR:
+ case OpRayQueryTerminateKHR:
+ case OpRayQueryGenerateIntersectionKHR:
+ case OpRayQueryConfirmIntersectionKHR:
+ {
+ // Ray query accesses memory directly, need check pass down object if using Private storage class.
+ uint32_t base_id = ops[0];
+ if (global_var_ids.find(base_id) != global_var_ids.end())
+ added_arg_ids.insert(base_id);
+ break;
+ }
+
+ case OpRayQueryGetRayTMinKHR:
+ case OpRayQueryGetRayFlagsKHR:
+ case OpRayQueryGetWorldRayOriginKHR:
+ case OpRayQueryGetWorldRayDirectionKHR:
+ case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR:
+ case OpRayQueryGetIntersectionTypeKHR:
+ case OpRayQueryGetIntersectionTKHR:
+ case OpRayQueryGetIntersectionInstanceCustomIndexKHR:
+ case OpRayQueryGetIntersectionInstanceIdKHR:
+ case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR:
+ case OpRayQueryGetIntersectionGeometryIndexKHR:
+ case OpRayQueryGetIntersectionPrimitiveIndexKHR:
+ case OpRayQueryGetIntersectionBarycentricsKHR:
+ case OpRayQueryGetIntersectionFrontFaceKHR:
+ case OpRayQueryGetIntersectionObjectRayDirectionKHR:
+ case OpRayQueryGetIntersectionObjectRayOriginKHR:
+ case OpRayQueryGetIntersectionObjectToWorldKHR:
+ case OpRayQueryGetIntersectionWorldToObjectKHR:
+ {
+ // Ray query accesses memory directly, need check pass down object if using Private storage class.
+ uint32_t base_id = ops[2];
+ if (global_var_ids.find(base_id) != global_var_ids.end())
+ added_arg_ids.insert(base_id);
+ break;
+ }
+
default:
break;
}
+ if (needs_manual_helper_invocation_updates() && b.terminator == SPIRBlock::Kill &&
+ (active_input_builtins.get(BuiltInHelperInvocation) || needs_helper_invocation))
+ added_arg_ids.insert(builtin_helper_invocation_id);
+
// TODO: Add all other operations which can affect memory.
// We should consider a more unified system here to reduce boiler-plate.
// This kind of analysis is done in several places ...
@@ -1770,9 +2034,8 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std::
bool is_patch = has_decoration(arg_id, DecorationPatch) || is_patch_block(*p_type);
bool is_block = has_decoration(p_type->self, DecorationBlock);
bool is_control_point_storage =
- !is_patch &&
- ((is_tessellation_shader() && var.storage == StorageClassInput) ||
- (get_execution_model() == ExecutionModelTessellationControl && var.storage == StorageClassOutput));
+ !is_patch && ((is_tessellation_shader() && var.storage == StorageClassInput) ||
+ (is_tesc_shader() && var.storage == StorageClassOutput));
bool is_patch_block_storage = is_patch && is_block && var.storage == StorageClassOutput;
bool is_builtin = is_builtin_variable(var);
bool variable_is_stage_io =
@@ -1788,8 +2051,8 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std::
if (is_redirected_to_global_stage_io)
{
- // Tessellation control shaders see inputs and per-vertex outputs as arrays.
- // Similarly, tessellation evaluation shaders see per-vertex inputs as arrays.
+ // Tessellation control shaders see inputs and per-point outputs as arrays.
+ // Similarly, tessellation evaluation shaders see per-point inputs as arrays.
// We collected them into a structure; we must pass the array of this
// structure to the function.
std::string name;
@@ -1812,10 +2075,6 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std::
}
}
- // Tessellation control shaders see inputs and per-vertex outputs as arrays.
- // Similarly, tessellation evaluation shaders see per-vertex inputs as arrays.
- // We collected them into a structure; we must pass the array of this
- // structure to the function.
if (var.storage == StorageClassInput)
{
auto &added_in = is_patch ? patch_added_in : control_point_added_in;
@@ -1839,6 +2098,8 @@ void CompilerMSL::extract_global_variables_from_function(uint32_t func_id, std::
set<SPIRVariable>(next_id, type_id, StorageClassFunction, 0, arg_id);
set_name(next_id, name);
+ if (is_tese_shader() && msl_options.raw_buffer_tese_input && var.storage == StorageClassInput)
+ set_decoration(next_id, DecorationNonWritable);
}
else if (is_builtin && has_decoration(p_type->self, DecorationBlock))
{
@@ -1902,6 +2163,20 @@ void CompilerMSL::mark_packable_structs()
(has_decoration(type.self, DecorationBlock) || has_decoration(type.self, DecorationBufferBlock)))
mark_as_packable(type);
}
+
+ if (var.storage == StorageClassWorkgroup)
+ {
+ auto *type = &this->get<SPIRType>(var.basetype);
+ if (type->basetype == SPIRType::Struct)
+ mark_as_workgroup_struct(*type);
+ }
+ });
+
+ // Physical storage buffer pointers can appear outside of the context of a variable, if the address
+ // is calculated from a ulong or uvec2 and cast to a pointer, so check if they need to be packed too.
+ ir.for_each_typed_id<SPIRType>([&](uint32_t, SPIRType &type) {
+ if (type.basetype == SPIRType::Struct && type.pointer && type.storage == StorageClassPhysicalStorageBuffer)
+ mark_as_packable(type);
});
}
@@ -1916,7 +2191,8 @@ void CompilerMSL::mark_as_packable(SPIRType &type)
return;
}
- if (type.basetype == SPIRType::Struct)
+ // Handle possible recursion when a struct contains a pointer to its own type nested somewhere.
+ if (type.basetype == SPIRType::Struct && !has_extended_decoration(type.self, SPIRVCrossDecorationBufferBlockRepacked))
{
set_extended_decoration(type.self, SPIRVCrossDecorationBufferBlockRepacked);
@@ -1936,19 +2212,63 @@ void CompilerMSL::mark_as_packable(SPIRType &type)
}
}
+// If the specified type is a struct, it and any nested structs
+// are marked as used with workgroup storage using the SPIRVCrossDecorationWorkgroupStruct decoration.
+void CompilerMSL::mark_as_workgroup_struct(SPIRType &type)
+{
+ // If this is not the base type (eg. it's a pointer or array), tunnel down
+ if (type.parent_type)
+ {
+ mark_as_workgroup_struct(get<SPIRType>(type.parent_type));
+ return;
+ }
+
+ // Handle possible recursion when a struct contains a pointer to its own type nested somewhere.
+ if (type.basetype == SPIRType::Struct && !has_extended_decoration(type.self, SPIRVCrossDecorationWorkgroupStruct))
+ {
+ set_extended_decoration(type.self, SPIRVCrossDecorationWorkgroupStruct);
+
+ // Recurse
+ uint32_t mbr_cnt = uint32_t(type.member_types.size());
+ for (uint32_t mbr_idx = 0; mbr_idx < mbr_cnt; mbr_idx++)
+ {
+ uint32_t mbr_type_id = type.member_types[mbr_idx];
+ auto &mbr_type = get<SPIRType>(mbr_type_id);
+ mark_as_workgroup_struct(mbr_type);
+ if (mbr_type.type_alias)
+ {
+ auto &mbr_type_alias = get<SPIRType>(mbr_type.type_alias);
+ mark_as_workgroup_struct(mbr_type_alias);
+ }
+ }
+ }
+}
+
// If a shader input exists at the location, it is marked as being used by this shader
void CompilerMSL::mark_location_as_used_by_shader(uint32_t location, const SPIRType &type,
StorageClass storage, bool fallback)
{
- if (storage != StorageClassInput)
- return;
-
uint32_t count = type_to_location_count(type);
- for (uint32_t i = 0; i < count; i++)
+ switch (storage)
{
- location_inputs_in_use.insert(location + i);
- if (fallback)
- location_inputs_in_use_fallback.insert(location + i);
+ case StorageClassInput:
+ for (uint32_t i = 0; i < count; i++)
+ {
+ location_inputs_in_use.insert(location + i);
+ if (fallback)
+ location_inputs_in_use_fallback.insert(location + i);
+ }
+ break;
+ case StorageClassOutput:
+ for (uint32_t i = 0; i < count; i++)
+ {
+ location_outputs_in_use.insert(location + i);
+ if (fallback)
+ location_outputs_in_use_fallback.insert(location + i);
+ }
+ break;
+ default:
+ return;
}
}
@@ -2224,9 +2544,10 @@ void CompilerMSL::add_plain_variable_to_interface_block(StorageClass storage, co
if (get_decoration_bitset(var.self).get(DecorationLocation))
{
uint32_t locn = get_decoration(var.self, DecorationLocation);
+ uint32_t comp = get_decoration(var.self, DecorationComponent);
if (storage == StorageClassInput)
{
- type_id = ensure_correct_input_type(var.basetype, locn, 0, meta.strip_array);
+ type_id = ensure_correct_input_type(var.basetype, locn, comp, 0, meta.strip_array);
var.basetype = type_id;
type_id = get_pointee_type_id(type_id);
@@ -2238,14 +2559,22 @@ void CompilerMSL::add_plain_variable_to_interface_block(StorageClass storage, co
ib_type.member_types[ib_mbr_idx] = type_id;
}
set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn);
+ if (comp)
+ set_member_decoration(ib_type.self, ib_mbr_idx, DecorationComponent, comp);
mark_location_as_used_by_shader(locn, get<SPIRType>(type_id), storage);
}
- else if (is_builtin && is_tessellation_shader() && inputs_by_builtin.count(builtin))
+ else if (is_builtin && is_tessellation_shader() && storage == StorageClassInput && inputs_by_builtin.count(builtin))
{
uint32_t locn = inputs_by_builtin[builtin].location;
set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn);
mark_location_as_used_by_shader(locn, type, storage);
}
+ else if (is_builtin && capture_output_to_buffer && storage == StorageClassOutput && outputs_by_builtin.count(builtin))
+ {
+ uint32_t locn = outputs_by_builtin[builtin].location;
+ set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn);
+ mark_location_as_used_by_shader(locn, type, storage);
+ }
if (get_decoration_bitset(var.self).get(DecorationComponent))
{
@@ -2393,8 +2722,8 @@ void CompilerMSL::add_composite_variable_to_interface_block(StorageClass storage
uint32_t comp = get_decoration(var.self, DecorationComponent);
if (storage == StorageClassInput)
{
- var.basetype = ensure_correct_input_type(var.basetype, locn, 0, meta.strip_array);
- uint32_t mbr_type_id = ensure_correct_input_type(usable_type->self, locn, 0, meta.strip_array);
+ var.basetype = ensure_correct_input_type(var.basetype, locn, comp, 0, meta.strip_array);
+ uint32_t mbr_type_id = ensure_correct_input_type(usable_type->self, locn, comp, 0, meta.strip_array);
if (storage == StorageClassInput && pull_model_inputs.count(var.self))
ib_type.member_types[ib_mbr_idx] = build_msl_interpolant_type(mbr_type_id, is_noperspective);
else
@@ -2405,12 +2734,18 @@ void CompilerMSL::add_composite_variable_to_interface_block(StorageClass storage
set_member_decoration(ib_type.self, ib_mbr_idx, DecorationComponent, comp);
mark_location_as_used_by_shader(locn, *usable_type, storage);
}
- else if (is_builtin && is_tessellation_shader() && inputs_by_builtin.count(builtin))
+ else if (is_builtin && is_tessellation_shader() && storage == StorageClassInput && inputs_by_builtin.count(builtin))
{
uint32_t locn = inputs_by_builtin[builtin].location + i;
set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn);
mark_location_as_used_by_shader(locn, *usable_type, storage);
}
+ else if (is_builtin && capture_output_to_buffer && storage == StorageClassOutput && outputs_by_builtin.count(builtin))
+ {
+ uint32_t locn = outputs_by_builtin[builtin].location + i;
+ set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn);
+ mark_location_as_used_by_shader(locn, *usable_type, storage);
+ }
else if (is_builtin && (builtin == BuiltInClipDistance || builtin == BuiltInCullDistance))
{
// Declare the Clip/CullDistance as [[user(clip/cullN)]].
@@ -2489,12 +2824,15 @@ void CompilerMSL::add_composite_variable_to_interface_block(StorageClass storage
}
}
-void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass storage, const string &ib_var_ref,
- SPIRType &ib_type, SPIRVariable &var,
- uint32_t mbr_idx, InterfaceBlockMeta &meta)
+void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass storage,
+ const string &ib_var_ref, SPIRType &ib_type,
+ SPIRVariable &var, SPIRType &var_type,
+ uint32_t mbr_idx, InterfaceBlockMeta &meta,
+ const string &mbr_name_qual,
+ const string &var_chain_qual,
+ uint32_t &location, uint32_t &var_mbr_idx)
{
auto &entry_func = get<SPIRFunction>(ir.default_entry_point);
- auto &var_type = meta.strip_array ? get_variable_element_type(var) : get_variable_data_type(var);
BuiltIn builtin = BuiltInMax;
bool is_builtin = is_member_builtin(var_type, mbr_idx, &builtin);
@@ -2509,13 +2847,15 @@ void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass
uint32_t mbr_type_id = var_type.member_types[mbr_idx];
auto &mbr_type = get<SPIRType>(mbr_type_id);
- uint32_t elem_cnt = 0;
+ bool mbr_is_indexable = false;
+ uint32_t elem_cnt = 1;
if (is_matrix(mbr_type))
{
if (is_array(mbr_type))
SPIRV_CROSS_THROW("MSL cannot emit arrays-of-matrices in input and output variables.");
+ mbr_is_indexable = true;
elem_cnt = mbr_type.columns;
}
else if (is_array(mbr_type))
@@ -2523,6 +2863,7 @@ void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass
if (mbr_type.array.size() != 1)
SPIRV_CROSS_THROW("MSL cannot emit arrays-of-arrays in input and output variables.");
+ mbr_is_indexable = true;
elem_cnt = to_array_size_literal(mbr_type);
}
@@ -2553,6 +2894,27 @@ void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass
return;
}
+ // Recursively handle nested structures.
+ if (mbr_type.basetype == SPIRType::Struct)
+ {
+ for (uint32_t i = 0; i < elem_cnt; i++)
+ {
+ string mbr_name = append_member_name(mbr_name_qual, var_type, mbr_idx) + (mbr_is_indexable ? join("_", i) : "");
+ string var_chain = join(var_chain_qual, ".", to_member_name(var_type, mbr_idx), (mbr_is_indexable ? join("[", i, "]") : ""));
+ uint32_t sub_mbr_cnt = uint32_t(mbr_type.member_types.size());
+ for (uint32_t sub_mbr_idx = 0; sub_mbr_idx < sub_mbr_cnt; sub_mbr_idx++)
+ {
+ add_composite_member_variable_to_interface_block(storage, ib_var_ref, ib_type,
+ var, mbr_type, sub_mbr_idx,
+ meta, mbr_name, var_chain,
+ location, var_mbr_idx);
+ // FIXME: Recursive structs and tessellation breaks here.
+ var_mbr_idx++;
+ }
+ }
+ return;
+ }
+
for (uint32_t i = 0; i < elem_cnt; i++)
{
// Add a reference to the variable type to the interface struct.
@@ -2563,26 +2925,47 @@ void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass
ib_type.member_types.push_back(usable_type->self);
// Give the member a name
- string mbr_name = ensure_valid_name(join(to_qualified_member_name(var_type, mbr_idx), "_", i), "m");
+ string mbr_name = ensure_valid_name(append_member_name(mbr_name_qual, var_type, mbr_idx) + (mbr_is_indexable ? join("_", i) : ""), "m");
set_member_name(ib_type.self, ib_mbr_idx, mbr_name);
- if (has_member_decoration(var_type.self, mbr_idx, DecorationLocation))
+ // Once we determine the location of the first member within nested structures,
+ // from a var of the topmost structure, the remaining flattened members of
+ // the nested structures will have consecutive location values. At this point,
+ // we've recursively tunnelled into structs, arrays, and matrices, and are
+ // down to a single location for each member now.
+ if (!is_builtin && location != UINT32_MAX)
{
- uint32_t locn = get_member_decoration(var_type.self, mbr_idx, DecorationLocation) + i;
- set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn);
- mark_location_as_used_by_shader(locn, *usable_type, storage);
+ set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, location);
+ mark_location_as_used_by_shader(location, *usable_type, storage);
+ location++;
+ }
+ else if (has_member_decoration(var_type.self, mbr_idx, DecorationLocation))
+ {
+ location = get_member_decoration(var_type.self, mbr_idx, DecorationLocation) + i;
+ set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, location);
+ mark_location_as_used_by_shader(location, *usable_type, storage);
+ location++;
}
else if (has_decoration(var.self, DecorationLocation))
{
- uint32_t locn = get_accumulated_member_location(var, mbr_idx, meta.strip_array) + i;
- set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn);
- mark_location_as_used_by_shader(locn, *usable_type, storage);
+ location = get_accumulated_member_location(var, mbr_idx, meta.strip_array) + i;
+ set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, location);
+ mark_location_as_used_by_shader(location, *usable_type, storage);
+ location++;
}
- else if (is_builtin && is_tessellation_shader() && inputs_by_builtin.count(builtin))
+ else if (is_builtin && is_tessellation_shader() && storage == StorageClassInput && inputs_by_builtin.count(builtin))
{
- uint32_t locn = inputs_by_builtin[builtin].location + i;
- set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn);
- mark_location_as_used_by_shader(locn, *usable_type, storage);
+ location = inputs_by_builtin[builtin].location + i;
+ set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, location);
+ mark_location_as_used_by_shader(location, *usable_type, storage);
+ location++;
+ }
+ else if (is_builtin && capture_output_to_buffer && storage == StorageClassOutput && outputs_by_builtin.count(builtin))
+ {
+ location = outputs_by_builtin[builtin].location + i;
+ set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, location);
+ mark_location_as_used_by_shader(location, *usable_type, storage);
+ location++;
}
else if (is_builtin && (builtin == BuiltInClipDistance || builtin == BuiltInCullDistance))
{
@@ -2592,7 +2975,7 @@ void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass
}
if (has_member_decoration(var_type.self, mbr_idx, DecorationComponent))
- SPIRV_CROSS_THROW("DecorationComponent on matrices and arrays make little sense.");
+ SPIRV_CROSS_THROW("DecorationComponent on matrices and arrays is not supported.");
if (storage != StorageClassInput || !pull_model_inputs.count(var.self))
{
@@ -2608,47 +2991,36 @@ void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass
}
set_extended_member_decoration(ib_type.self, ib_mbr_idx, SPIRVCrossDecorationInterfaceOrigID, var.self);
- set_extended_member_decoration(ib_type.self, ib_mbr_idx, SPIRVCrossDecorationInterfaceMemberIndex, mbr_idx);
+ set_extended_member_decoration(ib_type.self, ib_mbr_idx, SPIRVCrossDecorationInterfaceMemberIndex, var_mbr_idx);
// Unflatten or flatten from [[stage_in]] or [[stage_out]] as appropriate.
if (!meta.strip_array && meta.allow_local_declaration)
{
+ string var_chain = join(var_chain_qual, ".", to_member_name(var_type, mbr_idx), (mbr_is_indexable ? join("[", i, "]") : ""));
switch (storage)
{
case StorageClassInput:
- entry_func.fixup_hooks_in.push_back([=, &var, &var_type]() {
+ entry_func.fixup_hooks_in.push_back([=, &var]() {
+ string lerp_call;
if (pull_model_inputs.count(var.self))
{
- string lerp_call;
if (is_centroid)
lerp_call = ".interpolate_at_centroid()";
else if (is_sample)
lerp_call = join(".interpolate_at_sample(", to_expression(builtin_sample_id_id), ")");
else
lerp_call = ".interpolate_at_center()";
- statement(to_name(var.self), ".", to_member_name(var_type, mbr_idx), "[", i, "] = ", ib_var_ref,
- ".", mbr_name, lerp_call, ";");
- }
- else
- {
- statement(to_name(var.self), ".", to_member_name(var_type, mbr_idx), "[", i, "] = ", ib_var_ref,
- ".", mbr_name, ";");
}
+ statement(var_chain, " = ", ib_var_ref, ".", mbr_name, lerp_call, ";");
});
break;
case StorageClassOutput:
- entry_func.fixup_hooks_out.push_back([=, &var, &var_type]() {
+ entry_func.fixup_hooks_out.push_back([=]() {
if (flatten_from_ib_var)
- {
- statement(ib_var_ref, ".", mbr_name, " = ", ib_var_ref, ".", flatten_from_ib_mbr_name, "[", i,
- "];");
- }
+ statement(ib_var_ref, ".", mbr_name, " = ", ib_var_ref, ".", flatten_from_ib_mbr_name, "[", i, "];");
else
- {
- statement(ib_var_ref, ".", mbr_name, " = ", to_name(var.self), ".",
- to_member_name(var_type, mbr_idx), "[", i, "];");
- }
+ statement(ib_var_ref, ".", mbr_name, " = ", var_chain, ";");
});
break;
@@ -2659,11 +3031,14 @@ void CompilerMSL::add_composite_member_variable_to_interface_block(StorageClass
}
}
-void CompilerMSL::add_plain_member_variable_to_interface_block(StorageClass storage, const string &ib_var_ref,
- SPIRType &ib_type, SPIRVariable &var, uint32_t mbr_idx,
- InterfaceBlockMeta &meta)
+void CompilerMSL::add_plain_member_variable_to_interface_block(StorageClass storage,
+ const string &ib_var_ref, SPIRType &ib_type,
+ SPIRVariable &var, SPIRType &var_type,
+ uint32_t mbr_idx, InterfaceBlockMeta &meta,
+ const string &mbr_name_qual,
+ const string &var_chain_qual,
+ uint32_t &location, uint32_t &var_mbr_idx)
{
- auto &var_type = meta.strip_array ? get_variable_element_type(var) : get_variable_data_type(var);
auto &entry_func = get<SPIRFunction>(ir.default_entry_point);
BuiltIn builtin = BuiltInMax;
@@ -2688,7 +3063,7 @@ void CompilerMSL::add_plain_member_variable_to_interface_block(StorageClass stor
ib_type.member_types.push_back(mbr_type_id);
// Give the member a name
- string mbr_name = ensure_valid_name(to_qualified_member_name(var_type, mbr_idx), "m");
+ string mbr_name = ensure_valid_name(append_member_name(mbr_name_qual, var_type, mbr_idx), "m");
set_member_name(ib_type.self, ib_mbr_idx, mbr_name);
// Update the original variable reference to include the structure reference
@@ -2705,7 +3080,7 @@ void CompilerMSL::add_plain_member_variable_to_interface_block(StorageClass stor
}
bool flatten_stage_out = false;
-
+ string var_chain = var_chain_qual + "." + to_member_name(var_type, mbr_idx);
if (is_builtin && !meta.strip_array)
{
// For the builtin gl_PerVertex, we cannot treat it as a block anyways,
@@ -2718,15 +3093,15 @@ void CompilerMSL::add_plain_member_variable_to_interface_block(StorageClass stor
switch (storage)
{
case StorageClassInput:
- entry_func.fixup_hooks_in.push_back([=, &var, &var_type]() {
- statement(to_name(var.self), ".", to_member_name(var_type, mbr_idx), " = ", qual_var_name, ";");
+ entry_func.fixup_hooks_in.push_back([=]() {
+ statement(var_chain, " = ", qual_var_name, ";");
});
break;
case StorageClassOutput:
flatten_stage_out = true;
- entry_func.fixup_hooks_out.push_back([=, &var, &var_type]() {
- statement(qual_var_name, " = ", to_name(var.self), ".", to_member_name(var_type, mbr_idx), ";");
+ entry_func.fixup_hooks_out.push_back([=]() {
+ statement(qual_var_name, " = ", var_chain, ";");
});
break;
@@ -2735,47 +3110,63 @@ void CompilerMSL::add_plain_member_variable_to_interface_block(StorageClass stor
}
}
- // Copy the variable location from the original variable to the member
- if (has_member_decoration(var_type.self, mbr_idx, DecorationLocation))
+ // Once we determine the location of the first member within nested structures,
+ // from a var of the topmost structure, the remaining flattened members of
+ // the nested structures will have consecutive location values. At this point,
+ // we've recursively tunnelled into structs, arrays, and matrices, and are
+ // down to a single location for each member now.
+ if (!is_builtin && location != UINT32_MAX)
{
- uint32_t locn = get_member_decoration(var_type.self, mbr_idx, DecorationLocation);
+ set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, location);
+ mark_location_as_used_by_shader(location, get<SPIRType>(mbr_type_id), storage);
+ location += type_to_location_count(get<SPIRType>(mbr_type_id));
+ }
+ else if (has_member_decoration(var_type.self, mbr_idx, DecorationLocation))
+ {
+ location = get_member_decoration(var_type.self, mbr_idx, DecorationLocation);
+ uint32_t comp = get_member_decoration(var_type.self, mbr_idx, DecorationComponent);
if (storage == StorageClassInput)
{
- mbr_type_id = ensure_correct_input_type(mbr_type_id, locn, 0, meta.strip_array);
+ mbr_type_id = ensure_correct_input_type(mbr_type_id, location, comp, 0, meta.strip_array);
var_type.member_types[mbr_idx] = mbr_type_id;
if (storage == StorageClassInput && pull_model_inputs.count(var.self))
ib_type.member_types[ib_mbr_idx] = build_msl_interpolant_type(mbr_type_id, is_noperspective);
else
ib_type.member_types[ib_mbr_idx] = mbr_type_id;
}
- set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn);
- mark_location_as_used_by_shader(locn, get<SPIRType>(mbr_type_id), storage);
+ set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, location);
+ mark_location_as_used_by_shader(location, get<SPIRType>(mbr_type_id), storage);
+ location += type_to_location_count(get<SPIRType>(mbr_type_id));
}
else if (has_decoration(var.self, DecorationLocation))
{
- // The block itself might have a location and in this case, all members of the block
- // receive incrementing locations.
- uint32_t locn = get_accumulated_member_location(var, mbr_idx, meta.strip_array);
+ location = get_accumulated_member_location(var, mbr_idx, meta.strip_array);
if (storage == StorageClassInput)
{
- mbr_type_id = ensure_correct_input_type(mbr_type_id, locn, 0, meta.strip_array);
+ mbr_type_id = ensure_correct_input_type(mbr_type_id, location, 0, 0, meta.strip_array);
var_type.member_types[mbr_idx] = mbr_type_id;
if (storage == StorageClassInput && pull_model_inputs.count(var.self))
ib_type.member_types[ib_mbr_idx] = build_msl_interpolant_type(mbr_type_id, is_noperspective);
else
ib_type.member_types[ib_mbr_idx] = mbr_type_id;
}
- set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn);
- mark_location_as_used_by_shader(locn, get<SPIRType>(mbr_type_id), storage);
+ set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, location);
+ mark_location_as_used_by_shader(location, get<SPIRType>(mbr_type_id), storage);
+ location += type_to_location_count(get<SPIRType>(mbr_type_id));
}
- else if (is_builtin && is_tessellation_shader() && inputs_by_builtin.count(builtin))
+ else if (is_builtin && is_tessellation_shader() && storage == StorageClassInput && inputs_by_builtin.count(builtin))
{
- uint32_t locn = 0;
- auto builtin_itr = inputs_by_builtin.find(builtin);
- if (builtin_itr != end(inputs_by_builtin))
- locn = builtin_itr->second.location;
- set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, locn);
- mark_location_as_used_by_shader(locn, get<SPIRType>(mbr_type_id), storage);
+ location = inputs_by_builtin[builtin].location;
+ set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, location);
+ mark_location_as_used_by_shader(location, get<SPIRType>(mbr_type_id), storage);
+ location += type_to_location_count(get<SPIRType>(mbr_type_id));
+ }
+ else if (is_builtin && capture_output_to_buffer && storage == StorageClassOutput && outputs_by_builtin.count(builtin))
+ {
+ location = outputs_by_builtin[builtin].location;
+ set_member_decoration(ib_type.self, ib_mbr_idx, DecorationLocation, location);
+ mark_location_as_used_by_shader(location, get<SPIRType>(mbr_type_id), storage);
+ location += type_to_location_count(get<SPIRType>(mbr_type_id));
}
// Copy the component location, if present.
@@ -2834,7 +3225,7 @@ void CompilerMSL::add_plain_member_variable_to_interface_block(StorageClass stor
}
set_extended_member_decoration(ib_type.self, ib_mbr_idx, SPIRVCrossDecorationInterfaceOrigID, var.self);
- set_extended_member_decoration(ib_type.self, ib_mbr_idx, SPIRVCrossDecorationInterfaceMemberIndex, mbr_idx);
+ set_extended_member_decoration(ib_type.self, ib_mbr_idx, SPIRVCrossDecorationInterfaceMemberIndex, var_mbr_idx);
}
// In Metal, the tessellation levels are stored as tightly packed half-precision floating point values.
@@ -2845,19 +3236,10 @@ void CompilerMSL::add_plain_member_variable_to_interface_block(StorageClass stor
void CompilerMSL::add_tess_level_input_to_interface_block(const std::string &ib_var_ref, SPIRType &ib_type,
SPIRVariable &var)
{
- auto &entry_func = get<SPIRFunction>(ir.default_entry_point);
auto &var_type = get_variable_element_type(var);
BuiltIn builtin = BuiltIn(get_decoration(var.self, DecorationBuiltIn));
-
- // Force the variable to have the proper name.
- string var_name = builtin_to_glsl(builtin, StorageClassFunction);
- set_name(var.self, var_name);
-
- // We need to declare the variable early and at entry-point scope.
- entry_func.add_local_variable(var.self);
- vars_needing_early_declaration.push_back(var.self);
- bool triangles = get_execution_mode_bitset().get(ExecutionModeTriangles);
+ bool triangles = is_tessellating_triangles();
string mbr_name;
// Add a reference to the variable type to the interface struct.
@@ -2903,7 +3285,7 @@ void CompilerMSL::add_tess_level_input_to_interface_block(const std::string &ib_
}
else
{
- mbr_name = var_name;
+ mbr_name = builtin_to_glsl(builtin, StorageClassFunction);
uint32_t type_id = build_extended_vector_type(var_type.self, builtin == BuiltInTessLevelOuter ? 4 : 2);
@@ -2923,27 +3305,49 @@ void CompilerMSL::add_tess_level_input_to_interface_block(const std::string &ib_
mark_locations(new_var_type);
}
+ add_tess_level_input(ib_var_ref, mbr_name, var);
+}
+
+void CompilerMSL::add_tess_level_input(const std::string &base_ref, const std::string &mbr_name, SPIRVariable &var)
+{
+ auto &entry_func = get<SPIRFunction>(ir.default_entry_point);
+ BuiltIn builtin = BuiltIn(get_decoration(var.self, DecorationBuiltIn));
+
+ // Force the variable to have the proper name.
+ string var_name = builtin_to_glsl(builtin, StorageClassFunction);
+ set_name(var.self, var_name);
+
+ // We need to declare the variable early and at entry-point scope.
+ entry_func.add_local_variable(var.self);
+ vars_needing_early_declaration.push_back(var.self);
+ bool triangles = is_tessellating_triangles();
+
if (builtin == BuiltInTessLevelOuter)
{
- entry_func.fixup_hooks_in.push_back([=]() {
- statement(var_name, "[0] = ", ib_var_ref, ".", mbr_name, ".x;");
- statement(var_name, "[1] = ", ib_var_ref, ".", mbr_name, ".y;");
- statement(var_name, "[2] = ", ib_var_ref, ".", mbr_name, ".z;");
- if (!triangles)
- statement(var_name, "[3] = ", ib_var_ref, ".", mbr_name, ".w;");
- });
+ entry_func.fixup_hooks_in.push_back(
+ [=]()
+ {
+ statement(var_name, "[0] = ", base_ref, ".", mbr_name, "[0];");
+ statement(var_name, "[1] = ", base_ref, ".", mbr_name, "[1];");
+ statement(var_name, "[2] = ", base_ref, ".", mbr_name, "[2];");
+ if (!triangles)
+ statement(var_name, "[3] = ", base_ref, ".", mbr_name, "[3];");
+ });
}
else
{
entry_func.fixup_hooks_in.push_back([=]() {
if (triangles)
{
- statement(var_name, "[0] = ", ib_var_ref, ".", mbr_name, ".w;");
+ if (msl_options.raw_buffer_tese_input)
+ statement(var_name, "[0] = ", base_ref, ".", mbr_name, ";");
+ else
+ statement(var_name, "[0] = ", base_ref, ".", mbr_name, "[3];");
}
else
{
- statement(var_name, "[0] = ", ib_var_ref, ".", mbr_name, ".x;");
- statement(var_name, "[1] = ", ib_var_ref, ".", mbr_name, ".y;");
+ statement(var_name, "[0] = ", base_ref, ".", mbr_name, "[0];");
+ statement(var_name, "[1] = ", base_ref, ".", mbr_name, "[1];");
}
});
}
@@ -2954,7 +3358,8 @@ bool CompilerMSL::variable_storage_requires_stage_io(spv::StorageClass storage)
if (storage == StorageClassOutput)
return !capture_output_to_buffer;
else if (storage == StorageClassInput)
- return !(get_execution_model() == ExecutionModelTessellationControl && msl_options.multi_patch_workgroup);
+ return !(is_tesc_shader() && msl_options.multi_patch_workgroup) &&
+ !(is_tese_shader() && msl_options.raw_buffer_tese_input);
else
return false;
}
@@ -3066,9 +3471,21 @@ void CompilerMSL::add_variable_to_interface_block(StorageClass storage, const st
return;
}
+ if (storage == StorageClassInput && has_decoration(var.self, DecorationPerVertexKHR))
+ SPIRV_CROSS_THROW("PerVertexKHR decoration is not supported in MSL.");
+
+ // If variable names alias, they will end up with wrong names in the interface struct, because
+ // there might be aliases in the member name cache and there would be a mismatch in fixup_in code.
+ // Make sure to register the variables as unique resource names ahead of time.
+ // This would normally conflict with the name cache when emitting local variables,
+ // but this happens in the setup stage, before we hit compilation loops.
+ // The name cache is cleared before we actually emit code, so this is safe.
+ add_resource_name(var.self);
+
if (var_type.basetype == SPIRType::Struct)
{
- bool block_requires_flattening = variable_storage_requires_stage_io(storage) || is_block;
+ bool block_requires_flattening =
+ variable_storage_requires_stage_io(storage) || (is_block && var_type.array.empty());
bool needs_local_declaration = !is_builtin && block_requires_flattening && meta.allow_local_declaration;
if (needs_local_declaration)
@@ -3094,74 +3511,110 @@ void CompilerMSL::add_variable_to_interface_block(StorageClass storage, const st
else
{
bool masked_block = false;
+ uint32_t location = UINT32_MAX;
+ uint32_t var_mbr_idx = 0;
+ uint32_t elem_cnt = 1;
+ if (is_matrix(var_type))
+ {
+ if (is_array(var_type))
+ SPIRV_CROSS_THROW("MSL cannot emit arrays-of-matrices in input and output variables.");
- // Flatten the struct members into the interface struct
- for (uint32_t mbr_idx = 0; mbr_idx < uint32_t(var_type.member_types.size()); mbr_idx++)
+ elem_cnt = var_type.columns;
+ }
+ else if (is_array(var_type))
{
- builtin = BuiltInMax;
- is_builtin = is_member_builtin(var_type, mbr_idx, &builtin);
- auto &mbr_type = get<SPIRType>(var_type.member_types[mbr_idx]);
+ if (var_type.array.size() != 1)
+ SPIRV_CROSS_THROW("MSL cannot emit arrays-of-arrays in input and output variables.");
+
+ elem_cnt = to_array_size_literal(var_type);
+ }
- if (storage == StorageClassOutput && is_stage_output_block_member_masked(var, mbr_idx, meta.strip_array))
+ for (uint32_t elem_idx = 0; elem_idx < elem_cnt; elem_idx++)
+ {
+ // Flatten the struct members into the interface struct
+ for (uint32_t mbr_idx = 0; mbr_idx < uint32_t(var_type.member_types.size()); mbr_idx++)
{
- if (is_block)
- masked_block = true;
+ builtin = BuiltInMax;
+ is_builtin = is_member_builtin(var_type, mbr_idx, &builtin);
+ auto &mbr_type = get<SPIRType>(var_type.member_types[mbr_idx]);
- // Non-builtin block output variables are just ignored, since they will still access
- // the block variable as-is. They're just not flattened.
- if (is_builtin && !meta.strip_array)
+ if (storage == StorageClassOutput && is_stage_output_block_member_masked(var, mbr_idx, meta.strip_array))
{
- // Emit a fake variable instead.
- uint32_t ids = ir.increase_bound_by(2);
- uint32_t ptr_type_id = ids + 0;
- uint32_t var_id = ids + 1;
-
- auto ptr_type = mbr_type;
- ptr_type.pointer = true;
- ptr_type.pointer_depth++;
- ptr_type.parent_type = var_type.member_types[mbr_idx];
- ptr_type.storage = StorageClassOutput;
-
- uint32_t initializer = 0;
- if (var.initializer)
- if (auto *c = maybe_get<SPIRConstant>(var.initializer))
- initializer = c->subconstants[mbr_idx];
-
- set<SPIRType>(ptr_type_id, ptr_type);
- set<SPIRVariable>(var_id, ptr_type_id, StorageClassOutput, initializer);
- entry_func.add_local_variable(var_id);
- vars_needing_early_declaration.push_back(var_id);
- set_name(var_id, builtin_to_glsl(builtin, StorageClassOutput));
- set_decoration(var_id, DecorationBuiltIn, builtin);
- }
- }
- else if (!is_builtin || has_active_builtin(builtin, storage))
- {
- bool is_composite_type = is_matrix(mbr_type) || is_array(mbr_type);
- bool attribute_load_store =
- storage == StorageClassInput && get_execution_model() != ExecutionModelFragment;
- bool storage_is_stage_io = variable_storage_requires_stage_io(storage);
+ location = UINT32_MAX; // Skip this member and resolve location again on next var member
- // Clip/CullDistance always need to be declared as user attributes.
- if (builtin == BuiltInClipDistance || builtin == BuiltInCullDistance)
- is_builtin = false;
+ if (is_block)
+ masked_block = true;
- if ((!is_builtin || attribute_load_store) && storage_is_stage_io && is_composite_type)
- {
- add_composite_member_variable_to_interface_block(storage, ib_var_ref, ib_type, var, mbr_idx,
- meta);
+ // Non-builtin block output variables are just ignored, since they will still access
+ // the block variable as-is. They're just not flattened.
+ if (is_builtin && !meta.strip_array)
+ {
+ // Emit a fake variable instead.
+ uint32_t ids = ir.increase_bound_by(2);
+ uint32_t ptr_type_id = ids + 0;
+ uint32_t var_id = ids + 1;
+
+ auto ptr_type = mbr_type;
+ ptr_type.pointer = true;
+ ptr_type.pointer_depth++;
+ ptr_type.parent_type = var_type.member_types[mbr_idx];
+ ptr_type.storage = StorageClassOutput;
+
+ uint32_t initializer = 0;
+ if (var.initializer)
+ if (auto *c = maybe_get<SPIRConstant>(var.initializer))
+ initializer = c->subconstants[mbr_idx];
+
+ set<SPIRType>(ptr_type_id, ptr_type);
+ set<SPIRVariable>(var_id, ptr_type_id, StorageClassOutput, initializer);
+ entry_func.add_local_variable(var_id);
+ vars_needing_early_declaration.push_back(var_id);
+ set_name(var_id, builtin_to_glsl(builtin, StorageClassOutput));
+ set_decoration(var_id, DecorationBuiltIn, builtin);
+ }
}
- else
+ else if (!is_builtin || has_active_builtin(builtin, storage))
{
- add_plain_member_variable_to_interface_block(storage, ib_var_ref, ib_type, var, mbr_idx, meta);
+ bool is_composite_type = is_matrix(mbr_type) || is_array(mbr_type) || mbr_type.basetype == SPIRType::Struct;
+ bool attribute_load_store =
+ storage == StorageClassInput && get_execution_model() != ExecutionModelFragment;
+ bool storage_is_stage_io = variable_storage_requires_stage_io(storage);
+
+ // Clip/CullDistance always need to be declared as user attributes.
+ if (builtin == BuiltInClipDistance || builtin == BuiltInCullDistance)
+ is_builtin = false;
+
+ const string var_name = to_name(var.self);
+ string mbr_name_qual = var_name;
+ string var_chain_qual = var_name;
+ if (elem_cnt > 1)
+ {
+ mbr_name_qual += join("_", elem_idx);
+ var_chain_qual += join("[", elem_idx, "]");
+ }
+
+ if ((!is_builtin || attribute_load_store) && storage_is_stage_io && is_composite_type)
+ {
+ add_composite_member_variable_to_interface_block(storage, ib_var_ref, ib_type,
+ var, var_type, mbr_idx, meta,
+ mbr_name_qual, var_chain_qual,
+ location, var_mbr_idx);
+ }
+ else
+ {
+ add_plain_member_variable_to_interface_block(storage, ib_var_ref, ib_type,
+ var, var_type, mbr_idx, meta,
+ mbr_name_qual, var_chain_qual,
+ location, var_mbr_idx);
+ }
}
+ var_mbr_idx++;
}
}
// If we're redirecting a block, we might still need to access the original block
// variable if we're masking some members.
- if (masked_block && !needs_local_declaration &&
- (!is_builtin_variable(var) || get_execution_model() == ExecutionModelTessellationControl))
+ if (masked_block && !needs_local_declaration && (!is_builtin_variable(var) || is_tesc_shader()))
{
if (is_builtin_variable(var))
{
@@ -3182,8 +3635,8 @@ void CompilerMSL::add_variable_to_interface_block(StorageClass storage, const st
}
}
}
- else if (get_execution_model() == ExecutionModelTessellationEvaluation && storage == StorageClassInput &&
- !meta.strip_array && is_builtin && (builtin == BuiltInTessLevelOuter || builtin == BuiltInTessLevelInner))
+ else if (is_tese_shader() && storage == StorageClassInput && !meta.strip_array && is_builtin &&
+ (builtin == BuiltInTessLevelOuter || builtin == BuiltInTessLevelInner))
{
add_tess_level_input_to_interface_block(ib_var_ref, ib_type, var);
}
@@ -3220,8 +3673,7 @@ void CompilerMSL::fix_up_interface_member_indices(StorageClass storage, uint32_t
// Only needed for tessellation shaders and pull-model interpolants.
// Need to redirect interface indices back to variables themselves.
// For structs, each member of the struct need a separate instance.
- if (get_execution_model() != ExecutionModelTessellationControl &&
- !(get_execution_model() == ExecutionModelTessellationEvaluation && storage == StorageClassInput) &&
+ if (!is_tesc_shader() && !(is_tese_shader() && storage == StorageClassInput) &&
!(get_execution_model() == ExecutionModelFragment && storage == StorageClassInput &&
!pull_model_inputs.empty()))
return;
@@ -3304,15 +3756,14 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch)
bool builtin_is_stage_in_out = builtin_is_gl_in_out ||
bi_type == BuiltInLayer || bi_type == BuiltInViewportIndex ||
- bi_type == BuiltInBaryCoordNV || bi_type == BuiltInBaryCoordNoPerspNV ||
+ bi_type == BuiltInBaryCoordKHR || bi_type == BuiltInBaryCoordNoPerspKHR ||
bi_type == BuiltInFragDepth ||
bi_type == BuiltInFragStencilRefEXT || bi_type == BuiltInSampleMask;
// These builtins are part of the stage in/out structs.
bool is_interface_block_builtin =
- builtin_is_stage_in_out ||
- (get_execution_model() == ExecutionModelTessellationEvaluation &&
- (bi_type == BuiltInTessLevelOuter || bi_type == BuiltInTessLevelInner));
+ builtin_is_stage_in_out || (is_tese_shader() && !msl_options.raw_buffer_tese_input &&
+ (bi_type == BuiltInTessLevelOuter || bi_type == BuiltInTessLevelInner));
bool is_active = interface_variable_exists_in_entry_point(var.self);
if (is_builtin && is_active)
@@ -3342,20 +3793,26 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch)
// It's not enough to simply avoid marking fragment outputs if the pipeline won't
// accept them. We can't put them in the struct at all, or otherwise the compiler
// complains that the outputs weren't explicitly marked.
+ // Frag depth and stencil outputs are incompatible with explicit early fragment tests.
+ // In GLSL, depth and stencil outputs are just ignored when explicit early fragment tests are required.
+ // In Metal, it's a compilation error, so we need to exclude them from the output struct.
if (get_execution_model() == ExecutionModelFragment && storage == StorageClassOutput && !patch &&
- ((is_builtin && ((bi_type == BuiltInFragDepth && !msl_options.enable_frag_depth_builtin) ||
- (bi_type == BuiltInFragStencilRefEXT && !msl_options.enable_frag_stencil_ref_builtin))) ||
+ ((is_builtin && ((bi_type == BuiltInFragDepth && (!msl_options.enable_frag_depth_builtin || uses_explicit_early_fragment_test())) ||
+ (bi_type == BuiltInFragStencilRefEXT && (!msl_options.enable_frag_stencil_ref_builtin || uses_explicit_early_fragment_test())))) ||
(!is_builtin && !(msl_options.enable_frag_output_mask & (1 << location)))))
{
hidden = true;
disabled_frag_outputs.push_back(var_id);
- // If a builtin, force it to have the proper name.
+ // If a builtin, force it to have the proper name, and mark it as not part of the output struct.
if (is_builtin)
+ {
set_name(var_id, builtin_to_glsl(bi_type, StorageClassFunction));
+ mask_stage_output_by_builtin(bi_type);
+ }
}
// Barycentric inputs must be emitted in stage-in, because they can have interpolation arguments.
- if (is_active && (bi_type == BuiltInBaryCoordNV || bi_type == BuiltInBaryCoordNoPerspNV))
+ if (is_active && (bi_type == BuiltInBaryCoordKHR || bi_type == BuiltInBaryCoordNoPerspKHR))
{
if (has_seen_barycentric)
SPIRV_CROSS_THROW("Cannot declare both BaryCoordNV and BaryCoordNoPerspNV in same shader in MSL.");
@@ -3402,12 +3859,29 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch)
}
}
}
+
+ if (is_tese_shader() && msl_options.raw_buffer_tese_input && patch && storage == StorageClassInput &&
+ (bi_type == BuiltInTessLevelOuter || bi_type == BuiltInTessLevelInner))
+ {
+ // In this case, we won't add the builtin to the interface struct,
+ // but we still need the hook to run to populate the arrays.
+ string base_ref = join(tess_factor_buffer_var_name, "[", to_expression(builtin_primitive_id_id), "]");
+ const char *mbr_name =
+ bi_type == BuiltInTessLevelOuter ? "edgeTessellationFactor" : "insideTessellationFactor";
+ add_tess_level_input(base_ref, mbr_name, var);
+ if (inputs_by_builtin.count(bi_type))
+ {
+ uint32_t locn = inputs_by_builtin[bi_type].location;
+ mark_location_as_used_by_shader(locn, type, StorageClassInput);
+ }
+ }
});
// If no variables qualify, leave.
// For patch input in a tessellation evaluation shader, the per-vertex stage inputs
// are included in a special patch control point array.
- if (vars.empty() && !(storage == StorageClassInput && patch && stage_in_var_id))
+ if (vars.empty() &&
+ !(!msl_options.raw_buffer_tese_input && storage == StorageClassInput && patch && stage_in_var_id))
return 0;
// Add a new typed variable for this interface structure.
@@ -3430,8 +3904,9 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch)
{
case StorageClassInput:
ib_var_ref = patch ? patch_stage_in_var_name : stage_in_var_name;
- if (get_execution_model() == ExecutionModelTessellationControl)
+ switch (get_execution_model())
{
+ case ExecutionModelTessellationControl:
// Add a hook to populate the shared workgroup memory containing the gl_in array.
entry_func.fixup_hooks_in.push_back([=]() {
// Can't use PatchVertices, PrimitiveId, or InvocationId yet; the hooks for those may not have run yet.
@@ -3457,6 +3932,33 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch)
statement(" return;");
}
});
+ break;
+ case ExecutionModelTessellationEvaluation:
+ if (!msl_options.raw_buffer_tese_input)
+ break;
+ if (patch)
+ {
+ entry_func.fixup_hooks_in.push_back(
+ [=]()
+ {
+ statement("const device ", to_name(ir.default_entry_point), "_", ib_var_ref, "& ", ib_var_ref,
+ " = ", patch_input_buffer_var_name, "[", to_expression(builtin_primitive_id_id),
+ "];");
+ });
+ }
+ else
+ {
+ entry_func.fixup_hooks_in.push_back(
+ [=]()
+ {
+ statement("const device ", to_name(ir.default_entry_point), "_", ib_var_ref, "* gl_in = &",
+ input_buffer_var_name, "[", to_expression(builtin_primitive_id_id), " * ",
+ get_entry_point().output_vertices, "];");
+ });
+ }
+ break;
+ default:
+ break;
}
break;
@@ -3582,27 +4084,31 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch)
for (auto *p_var : vars)
{
- bool strip_array =
- (get_execution_model() == ExecutionModelTessellationControl ||
- (get_execution_model() == ExecutionModelTessellationEvaluation && storage == StorageClassInput)) &&
- !patch;
+ bool strip_array = (is_tesc_shader() || (is_tese_shader() && storage == StorageClassInput)) && !patch;
// Fixing up flattened stores in TESC is impossible since the memory is group shared either via
// device (not masked) or threadgroup (masked) storage classes and it's race condition city.
meta.strip_array = strip_array;
- meta.allow_local_declaration = !strip_array && !(get_execution_model() == ExecutionModelTessellationControl &&
- storage == StorageClassOutput);
+ meta.allow_local_declaration = !strip_array && !(is_tesc_shader() && storage == StorageClassOutput);
add_variable_to_interface_block(storage, ib_var_ref, ib_type, *p_var, meta);
}
- if (get_execution_model() == ExecutionModelTessellationControl && msl_options.multi_patch_workgroup &&
+ if (((is_tesc_shader() && msl_options.multi_patch_workgroup) ||
+ (is_tese_shader() && msl_options.raw_buffer_tese_input)) &&
storage == StorageClassInput)
{
- // For tessellation control inputs, add all outputs from the vertex shader to ensure
+ // For tessellation inputs, add all outputs from the previous stage to ensure
// the struct containing them is the correct size and layout.
for (auto &input : inputs_by_location)
{
- if (location_inputs_in_use.count(input.first) != 0)
+ if (location_inputs_in_use.count(input.first.location) != 0)
+ continue;
+
+ if (patch != (input.second.rate == MSL_SHADER_VARIABLE_RATE_PER_PATCH))
+ continue;
+
+ // Tessellation levels have their own struct, so there's no need to add them here.
+ if (input.second.builtin == BuiltInTessLevelOuter || input.second.builtin == BuiltInTessLevelInner)
continue;
// Create a fake variable to put at the location.
@@ -3615,12 +4121,12 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch)
SPIRType type;
switch (input.second.format)
{
- case MSL_SHADER_INPUT_FORMAT_UINT16:
- case MSL_SHADER_INPUT_FORMAT_ANY16:
+ case MSL_SHADER_VARIABLE_FORMAT_UINT16:
+ case MSL_SHADER_VARIABLE_FORMAT_ANY16:
type.basetype = SPIRType::UShort;
type.width = 16;
break;
- case MSL_SHADER_INPUT_FORMAT_ANY32:
+ case MSL_SHADER_VARIABLE_FORMAT_ANY32:
default:
type.basetype = SPIRType::UInt;
type.width = 32;
@@ -3642,7 +4148,71 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch)
ptr_type.self = array_type_id;
auto &fake_var = set<SPIRVariable>(var_id, ptr_type_id, storage);
- set_decoration(var_id, DecorationLocation, input.first);
+ set_decoration(var_id, DecorationLocation, input.first.location);
+ if (input.first.component)
+ set_decoration(var_id, DecorationComponent, input.first.component);
+
+ meta.strip_array = true;
+ meta.allow_local_declaration = false;
+ add_variable_to_interface_block(storage, ib_var_ref, ib_type, fake_var, meta);
+ }
+ }
+
+ if (capture_output_to_buffer && storage == StorageClassOutput)
+ {
+ // For captured output, add all inputs from the next stage to ensure
+ // the struct containing them is the correct size and layout. This is
+ // necessary for certain implicit builtins that may nonetheless be read,
+ // even when they aren't written.
+ for (auto &output : outputs_by_location)
+ {
+ if (location_outputs_in_use.count(output.first.location) != 0)
+ continue;
+
+ // Create a fake variable to put at the location.
+ uint32_t offset = ir.increase_bound_by(4);
+ uint32_t type_id = offset;
+ uint32_t array_type_id = offset + 1;
+ uint32_t ptr_type_id = offset + 2;
+ uint32_t var_id = offset + 3;
+
+ SPIRType type;
+ switch (output.second.format)
+ {
+ case MSL_SHADER_VARIABLE_FORMAT_UINT16:
+ case MSL_SHADER_VARIABLE_FORMAT_ANY16:
+ type.basetype = SPIRType::UShort;
+ type.width = 16;
+ break;
+ case MSL_SHADER_VARIABLE_FORMAT_ANY32:
+ default:
+ type.basetype = SPIRType::UInt;
+ type.width = 32;
+ break;
+ }
+ type.vecsize = output.second.vecsize;
+ set<SPIRType>(type_id, type);
+
+ if (is_tesc_shader())
+ {
+ type.array.push_back(0);
+ type.array_size_literal.push_back(true);
+ type.parent_type = type_id;
+ set<SPIRType>(array_type_id, type);
+ }
+
+ type.pointer = true;
+ type.pointer_depth++;
+ type.parent_type = is_tesc_shader() ? array_type_id : type_id;
+ type.storage = storage;
+ auto &ptr_type = set<SPIRType>(ptr_type_id, type);
+ ptr_type.self = type.parent_type;
+
+ auto &fake_var = set<SPIRVariable>(var_id, ptr_type_id, storage);
+ set_decoration(var_id, DecorationLocation, output.first.location);
+ if (output.first.component)
+ set_decoration(var_id, DecorationComponent, output.first.component);
+
meta.strip_array = true;
meta.allow_local_declaration = false;
add_variable_to_interface_block(storage, ib_var_ref, ib_type, fake_var, meta);
@@ -3683,7 +4253,7 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch)
fix_up_interface_member_indices(storage, ib_type_id);
// For patch inputs, add one more member, holding the array of control point data.
- if (get_execution_model() == ExecutionModelTessellationEvaluation && storage == StorageClassInput && patch &&
+ if (is_tese_shader() && !msl_options.raw_buffer_tese_input && storage == StorageClassInput && patch &&
stage_in_var_id)
{
uint32_t pcp_type_id = ir.increase_bound_by(1);
@@ -3697,6 +4267,9 @@ uint32_t CompilerMSL::add_interface_block(StorageClass storage, bool patch)
set_member_name(ib_type.self, mbr_idx, "gl_in");
}
+ if (storage == StorageClassInput)
+ set_decoration(ib_var_id, DecorationNonWritable);
+
return ib_var_id;
}
@@ -3708,7 +4281,7 @@ uint32_t CompilerMSL::add_interface_block_pointer(uint32_t ib_var_id, StorageCla
uint32_t ib_ptr_var_id;
uint32_t next_id = ir.increase_bound_by(3);
auto &ib_type = expression_type(ib_var_id);
- if (get_execution_model() == ExecutionModelTessellationControl)
+ if (is_tesc_shader() || (is_tese_shader() && msl_options.raw_buffer_tese_input))
{
// Tessellation control per-vertex I/O is presented as an array, so we must
// do the same with our struct here.
@@ -3717,10 +4290,12 @@ uint32_t CompilerMSL::add_interface_block_pointer(uint32_t ib_var_id, StorageCla
ib_ptr_type.parent_type = ib_ptr_type.type_alias = ib_type.self;
ib_ptr_type.pointer = true;
ib_ptr_type.pointer_depth++;
- ib_ptr_type.storage =
- storage == StorageClassInput ?
- (msl_options.multi_patch_workgroup ? StorageClassStorageBuffer : StorageClassWorkgroup) :
- StorageClassStorageBuffer;
+ ib_ptr_type.storage = storage == StorageClassInput ?
+ ((is_tesc_shader() && msl_options.multi_patch_workgroup) ||
+ (is_tese_shader() && msl_options.raw_buffer_tese_input) ?
+ StorageClassStorageBuffer :
+ StorageClassWorkgroup) :
+ StorageClassStorageBuffer;
ir.meta[ib_ptr_type_id] = ir.meta[ib_type.self];
// To ensure that get_variable_data_type() doesn't strip off the pointer,
// which we need, use another pointer.
@@ -3734,6 +4309,8 @@ uint32_t CompilerMSL::add_interface_block_pointer(uint32_t ib_var_id, StorageCla
ib_ptr_var_id = next_id;
set<SPIRVariable>(ib_ptr_var_id, ib_ptr_ptr_type_id, StorageClassFunction, 0);
set_name(ib_ptr_var_id, storage == StorageClassInput ? "gl_in" : "gl_out");
+ if (storage == StorageClassInput)
+ set_decoration(ib_ptr_var_id, DecorationNonWritable);
}
else
{
@@ -3794,7 +4371,7 @@ uint32_t CompilerMSL::ensure_correct_builtin_type(uint32_t type_id, BuiltIn buil
// Ensure that the type is compatible with the shader input.
// If it is, simply return the given type ID.
// Otherwise, create a new type, and return its ID.
-uint32_t CompilerMSL::ensure_correct_input_type(uint32_t type_id, uint32_t location, uint32_t num_components, bool strip_array)
+uint32_t CompilerMSL::ensure_correct_input_type(uint32_t type_id, uint32_t location, uint32_t component, uint32_t num_components, bool strip_array)
{
auto &type = get<SPIRType>(type_id);
@@ -3804,7 +4381,7 @@ uint32_t CompilerMSL::ensure_correct_input_type(uint32_t type_id, uint32_t locat
if (type.basetype == SPIRType::Struct || type.array.size() > max_array_dimensions)
return type_id;
- auto p_va = inputs_by_location.find(location);
+ auto p_va = inputs_by_location.find({location, component});
if (p_va == end(inputs_by_location))
{
if (num_components > type.vecsize)
@@ -3818,7 +4395,7 @@ uint32_t CompilerMSL::ensure_correct_input_type(uint32_t type_id, uint32_t locat
switch (p_va->second.format)
{
- case MSL_SHADER_INPUT_FORMAT_UINT8:
+ case MSL_SHADER_VARIABLE_FORMAT_UINT8:
{
switch (type.basetype)
{
@@ -3842,7 +4419,7 @@ uint32_t CompilerMSL::ensure_correct_input_type(uint32_t type_id, uint32_t locat
}
}
- case MSL_SHADER_INPUT_FORMAT_UINT16:
+ case MSL_SHADER_VARIABLE_FORMAT_UINT16:
{
switch (type.basetype)
{
@@ -3873,6 +4450,10 @@ uint32_t CompilerMSL::ensure_correct_input_type(uint32_t type_id, uint32_t locat
void CompilerMSL::mark_struct_members_packed(const SPIRType &type)
{
+ // Handle possible recursion when a struct contains a pointer to its own type nested somewhere.
+ if (has_extended_decoration(type.self, SPIRVCrossDecorationPhysicalTypePacked))
+ return;
+
set_extended_decoration(type.self, SPIRVCrossDecorationPhysicalTypePacked);
// Problem case! Struct needs to be placed at an awkward alignment.
@@ -3899,8 +4480,9 @@ void CompilerMSL::mark_scalar_layout_structs(const SPIRType &type)
uint32_t mbr_cnt = uint32_t(type.member_types.size());
for (uint32_t i = 0; i < mbr_cnt; i++)
{
+ // Handle possible recursion when a struct contains a pointer to its own type nested somewhere.
auto &mbr_type = get<SPIRType>(type.member_types[i]);
- if (mbr_type.basetype == SPIRType::Struct)
+ if (mbr_type.basetype == SPIRType::Struct && !(mbr_type.pointer && mbr_type.storage == StorageClassPhysicalStorageBuffer))
{
auto *struct_type = &mbr_type;
while (!struct_type->array.empty())
@@ -4112,8 +4694,10 @@ void CompilerMSL::ensure_member_packing_rules_msl(SPIRType &ib_type, uint32_t in
// This case will be nightmare-ish to deal with. This could possibly happen if struct alignment does not quite
// match up with what we want. Scalar block layout comes to mind here where we might have to work around the rule
// that struct alignment == max alignment of all members and struct size depends on this alignment.
+ // Can't repack structs, but can repack pointers to structs.
auto &mbr_type = get<SPIRType>(ib_type.member_types[index]);
- if (mbr_type.basetype == SPIRType::Struct)
+ bool is_buff_ptr = mbr_type.pointer && mbr_type.storage == StorageClassPhysicalStorageBuffer;
+ if (mbr_type.basetype == SPIRType::Struct && !is_buff_ptr)
SPIRV_CROSS_THROW("Cannot perform any repacking for structs when it is used as a member of another struct.");
// Perform remapping here.
@@ -4140,7 +4724,9 @@ void CompilerMSL::ensure_member_packing_rules_msl(SPIRType &ib_type, uint32_t in
for (uint32_t dim = 0; dim < dimensions; dim++)
array_stride /= max(to_array_size_literal(mbr_type, dim), 1u);
- uint32_t elems_per_stride = array_stride / (mbr_type.width / 8);
+ // Pointers are 8 bytes
+ uint32_t mbr_width_in_bytes = is_buff_ptr ? 8 : (mbr_type.width / 8);
+ uint32_t elems_per_stride = array_stride / mbr_width_in_bytes;
if (elems_per_stride == 3)
SPIRV_CROSS_THROW("Cannot use ArrayStride of 3 elements in remapping scenarios.");
@@ -4150,17 +4736,24 @@ void CompilerMSL::ensure_member_packing_rules_msl(SPIRType &ib_type, uint32_t in
auto physical_type = mbr_type;
physical_type.vecsize = elems_per_stride;
physical_type.parent_type = 0;
+
+ // If this is a physical buffer pointer, replace type with a ulongn vector.
+ if (is_buff_ptr)
+ {
+ physical_type.width = 64;
+ physical_type.basetype = to_unsigned_basetype(physical_type.width);
+ physical_type.pointer = false;
+ physical_type.pointer_depth = false;
+ physical_type.forward_pointer = false;
+ }
+
uint32_t type_id = ir.increase_bound_by(1);
set<SPIRType>(type_id, physical_type);
set_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypeID, type_id);
set_decoration(type_id, DecorationArrayStride, array_stride);
// Remove packed_ for vectors of size 1, 2 and 4.
- if (has_extended_decoration(ib_type.self, SPIRVCrossDecorationPhysicalTypePacked))
- SPIRV_CROSS_THROW("Unable to remove packed decoration as entire struct must be fully packed. Do not mix "
- "scalar and std140 layout rules.");
- else
- unset_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypePacked);
+ unset_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypePacked);
}
else if (is_matrix(mbr_type))
{
@@ -4187,11 +4780,7 @@ void CompilerMSL::ensure_member_packing_rules_msl(SPIRType &ib_type, uint32_t in
set_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypeID, type_id);
// Remove packed_ for vectors of size 1, 2 and 4.
- if (has_extended_decoration(ib_type.self, SPIRVCrossDecorationPhysicalTypePacked))
- SPIRV_CROSS_THROW("Unable to remove packed decoration as entire struct must be fully packed. Do not mix "
- "scalar and std140 layout rules.");
- else
- unset_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypePacked);
+ unset_extended_member_decoration(ib_type.self, index, SPIRVCrossDecorationPhysicalTypePacked);
}
else
SPIRV_CROSS_THROW("Found a buffer packing case which we cannot represent in MSL.");
@@ -4344,6 +4933,11 @@ void CompilerMSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_exp
auto &physical_type = get<SPIRType>(physical_type_id);
+ string cast_addr_space = "thread";
+ auto *p_var_lhs = maybe_get_backing_variable(lhs_expression);
+ if (p_var_lhs)
+ cast_addr_space = get_type_address_space(get<SPIRType>(p_var_lhs->basetype), lhs_expression);
+
if (is_matrix(type))
{
const char *packed_pfx = lhs_packed_type ? "packed_" : "";
@@ -4371,7 +4965,7 @@ void CompilerMSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_exp
write_type.columns = 1;
if (physical_type.columns != type.columns)
- cast_expr = join("(device ", packed_pfx, type_to_glsl(write_type), "&)");
+ cast_expr = join("(", cast_addr_space, " ", packed_pfx, type_to_glsl(write_type), "&)");
if (rhs_transpose)
{
@@ -4413,7 +5007,7 @@ void CompilerMSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_exp
write_type.columns = 1;
if (physical_type.vecsize != type.vecsize)
- cast_expr = join("(device ", packed_pfx, type_to_glsl(write_type), "&)");
+ cast_expr = join("(", cast_addr_space, " ", packed_pfx, type_to_glsl(write_type), "&)");
if (rhs_transpose)
{
@@ -4468,7 +5062,7 @@ void CompilerMSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_exp
auto column_index = lhs_expr.find_last_of('[');
if (column_index != string::npos)
{
- statement("((device ", type_to_glsl(write_type), "*)&",
+ statement("((", cast_addr_space, " ", type_to_glsl(write_type), "*)&",
lhs_expr.insert(column_index, join('[', c, ']', ")")), " = ",
to_extract_component_expression(rhs_expression, c), ";");
}
@@ -4491,7 +5085,7 @@ void CompilerMSL::emit_store_statement(uint32_t lhs_expression, uint32_t rhs_exp
// Unpack the expression so we can store to it with a float or float2.
// It's still an l-value, so it's fine. Most other unpacking of expressions turn them into r-values instead.
- lhs = join("(device ", type_to_glsl(type), "&)", enclose_expression(lhs));
+ lhs = join("(", cast_addr_space, " ", type_to_glsl(type), "&)", enclose_expression(lhs));
if (!optimize_read_modify_write(expression_type(rhs_expression), lhs, rhs))
statement(lhs, " = ", rhs, ";");
}
@@ -4642,6 +5236,10 @@ void CompilerMSL::add_typedef_line(const string &line)
// Template struct like spvUnsafeArray<> need to be declared *before* any resources are declared
void CompilerMSL::emit_custom_templates()
{
+ static const char * const address_spaces[] = {
+ "thread", "constant", "device", "threadgroup", "threadgroup_imageblock", "ray_data", "object_data"
+ };
+
for (const auto &spv_func : spv_function_implementations)
{
switch (spv_func)
@@ -4687,6 +5285,122 @@ void CompilerMSL::emit_custom_templates()
statement("");
break;
+ case SPVFuncImplStorageMatrix:
+ statement("template<typename T, int Cols, int Rows=Cols>");
+ statement("struct spvStorageMatrix");
+ begin_scope();
+ statement("vec<T, Rows> columns[Cols];");
+ statement("");
+ for (size_t method_idx = 0; method_idx < sizeof(address_spaces) / sizeof(address_spaces[0]); ++method_idx)
+ {
+ // Some address spaces require particular features.
+ if (method_idx == 4) // threadgroup_imageblock
+ statement("#ifdef __HAVE_IMAGEBLOCKS__");
+ else if (method_idx == 5) // ray_data
+ statement("#ifdef __HAVE_RAYTRACING__");
+ else if (method_idx == 6) // object_data
+ statement("#ifdef __HAVE_MESH__");
+ const string &method_as = address_spaces[method_idx];
+ statement("spvStorageMatrix() ", method_as, " = default;");
+ if (method_idx != 1) // constant
+ {
+ statement(method_as, " spvStorageMatrix& operator=(initializer_list<vec<T, Rows>> cols) ",
+ method_as);
+ begin_scope();
+ statement("size_t i;");
+ statement("thread vec<T, Rows>* col;");
+ statement("for (i = 0, col = cols.begin(); i < Cols; ++i, ++col)");
+ statement(" columns[i] = *col;");
+ statement("return *this;");
+ end_scope();
+ }
+ statement("");
+ for (size_t param_idx = 0; param_idx < sizeof(address_spaces) / sizeof(address_spaces[0]); ++param_idx)
+ {
+ if (param_idx != method_idx)
+ {
+ if (param_idx == 4) // threadgroup_imageblock
+ statement("#ifdef __HAVE_IMAGEBLOCKS__");
+ else if (param_idx == 5) // ray_data
+ statement("#ifdef __HAVE_RAYTRACING__");
+ else if (param_idx == 6) // object_data
+ statement("#ifdef __HAVE_MESH__");
+ }
+ const string &param_as = address_spaces[param_idx];
+ statement("spvStorageMatrix(const ", param_as, " matrix<T, Cols, Rows>& m) ", method_as);
+ begin_scope();
+ statement("for (size_t i = 0; i < Cols; ++i)");
+ statement(" columns[i] = m.columns[i];");
+ end_scope();
+ statement("spvStorageMatrix(const ", param_as, " spvStorageMatrix& m) ", method_as, " = default;");
+ if (method_idx != 1) // constant
+ {
+ statement(method_as, " spvStorageMatrix& operator=(const ", param_as,
+ " matrix<T, Cols, Rows>& m) ", method_as);
+ begin_scope();
+ statement("for (size_t i = 0; i < Cols; ++i)");
+ statement(" columns[i] = m.columns[i];");
+ statement("return *this;");
+ end_scope();
+ statement(method_as, " spvStorageMatrix& operator=(const ", param_as, " spvStorageMatrix& m) ",
+ method_as, " = default;");
+ }
+ if (param_idx != method_idx && param_idx >= 4)
+ statement("#endif");
+ statement("");
+ }
+ statement("operator matrix<T, Cols, Rows>() const ", method_as);
+ begin_scope();
+ statement("matrix<T, Cols, Rows> m;");
+ statement("for (int i = 0; i < Cols; ++i)");
+ statement(" m.columns[i] = columns[i];");
+ statement("return m;");
+ end_scope();
+ statement("");
+ statement("vec<T, Rows> operator[](size_t idx) const ", method_as);
+ begin_scope();
+ statement("return columns[idx];");
+ end_scope();
+ if (method_idx != 1) // constant
+ {
+ statement(method_as, " vec<T, Rows>& operator[](size_t idx) ", method_as);
+ begin_scope();
+ statement("return columns[idx];");
+ end_scope();
+ }
+ if (method_idx >= 4)
+ statement("#endif");
+ statement("");
+ }
+ end_scope_decl();
+ statement("");
+ statement("template<typename T, int Cols, int Rows>");
+ statement("matrix<T, Rows, Cols> transpose(spvStorageMatrix<T, Cols, Rows> m)");
+ begin_scope();
+ statement("return transpose(matrix<T, Cols, Rows>(m));");
+ end_scope();
+ statement("");
+ statement("typedef spvStorageMatrix<half, 2, 2> spvStorage_half2x2;");
+ statement("typedef spvStorageMatrix<half, 2, 3> spvStorage_half2x3;");
+ statement("typedef spvStorageMatrix<half, 2, 4> spvStorage_half2x4;");
+ statement("typedef spvStorageMatrix<half, 3, 2> spvStorage_half3x2;");
+ statement("typedef spvStorageMatrix<half, 3, 3> spvStorage_half3x3;");
+ statement("typedef spvStorageMatrix<half, 3, 4> spvStorage_half3x4;");
+ statement("typedef spvStorageMatrix<half, 4, 2> spvStorage_half4x2;");
+ statement("typedef spvStorageMatrix<half, 4, 3> spvStorage_half4x3;");
+ statement("typedef spvStorageMatrix<half, 4, 4> spvStorage_half4x4;");
+ statement("typedef spvStorageMatrix<float, 2, 2> spvStorage_float2x2;");
+ statement("typedef spvStorageMatrix<float, 2, 3> spvStorage_float2x3;");
+ statement("typedef spvStorageMatrix<float, 2, 4> spvStorage_float2x4;");
+ statement("typedef spvStorageMatrix<float, 3, 2> spvStorage_float3x2;");
+ statement("typedef spvStorageMatrix<float, 3, 3> spvStorage_float3x3;");
+ statement("typedef spvStorageMatrix<float, 3, 4> spvStorage_float3x4;");
+ statement("typedef spvStorageMatrix<float, 4, 2> spvStorage_float4x2;");
+ statement("typedef spvStorageMatrix<float, 4, 3> spvStorage_float4x3;");
+ statement("typedef spvStorageMatrix<float, 4, 4> spvStorage_float4x4;");
+ statement("");
+ break;
+
default:
break;
}
@@ -4838,7 +5552,7 @@ void CompilerMSL::emit_custom_functions()
for (uint32_t variant = 0; variant < 12; variant++)
{
- uint32_t dimensions = spv_func - SPVFuncImplArrayCopyMultidimBase;
+ uint8_t dimensions = spv_func - SPVFuncImplArrayCopyMultidimBase;
string tmp = "template<typename T";
for (uint8_t i = 0; i < dimensions; i++)
{
@@ -5001,6 +5715,24 @@ void CompilerMSL::emit_custom_functions()
statement("");
break;
+ case SPVFuncImplQuantizeToF16:
+ // Ensure fast-math is disabled to match Vulkan results.
+ // SpvHalfTypeSelector is used to match the half* template type to the float* template type.
+ // Depending on GPU, MSL does not always flush converted subnormal halfs to zero,
+ // as required by OpQuantizeToF16, so check for subnormals and flush them to zero.
+ statement("template <typename F> struct SpvHalfTypeSelector;");
+ statement("template <> struct SpvHalfTypeSelector<float> { public: using H = half; };");
+ statement("template<uint N> struct SpvHalfTypeSelector<vec<float, N>> { using H = vec<half, N>; };");
+ statement("template<typename F, typename H = typename SpvHalfTypeSelector<F>::H>");
+ statement("[[clang::optnone]] F spvQuantizeToF16(F fval)");
+ begin_scope();
+ statement("H hval = H(fval);");
+ statement("hval = select(copysign(H(0), hval), hval, isnormal(hval) || isinf(hval) || isnan(hval));");
+ statement("return F(hval);");
+ end_scope();
+ statement("");
+ break;
+
// Emulate texturecube_array with texture2d_array for iOS where this type is not available
case SPVFuncImplCubemapTo2DArrayFace:
statement(force_inline);
@@ -5331,7 +6063,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<typename T>");
statement("inline T spvSubgroupBroadcast(T value, ushort lane)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return quad_broadcast(value, lane);");
else
statement("return simd_broadcast(value, lane);");
@@ -5340,7 +6072,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<>");
statement("inline bool spvSubgroupBroadcast(bool value, ushort lane)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return !!quad_broadcast((ushort)value, lane);");
else
statement("return !!simd_broadcast((ushort)value, lane);");
@@ -5349,7 +6081,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<uint N>");
statement("inline vec<bool, N> spvSubgroupBroadcast(vec<bool, N> value, ushort lane)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return (vec<bool, N>)quad_broadcast((vec<ushort, N>)value, lane);");
else
statement("return (vec<bool, N>)simd_broadcast((vec<ushort, N>)value, lane);");
@@ -5361,7 +6093,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<typename T>");
statement("inline T spvSubgroupBroadcastFirst(T value)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return quad_broadcast_first(value);");
else
statement("return simd_broadcast_first(value);");
@@ -5370,7 +6102,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<>");
statement("inline bool spvSubgroupBroadcastFirst(bool value)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return !!quad_broadcast_first((ushort)value);");
else
statement("return !!simd_broadcast_first((ushort)value);");
@@ -5379,7 +6111,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<uint N>");
statement("inline vec<bool, N> spvSubgroupBroadcastFirst(vec<bool, N> value)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return (vec<bool, N>)quad_broadcast_first((vec<ushort, N>)value);");
else
statement("return (vec<bool, N>)simd_broadcast_first((vec<ushort, N>)value);");
@@ -5390,7 +6122,7 @@ void CompilerMSL::emit_custom_functions()
case SPVFuncImplSubgroupBallot:
statement("inline uint4 spvSubgroupBallot(bool value)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
{
statement("return uint4((quad_vote::vote_t)quad_ballot(value), 0, 0, 0);");
}
@@ -5518,7 +6250,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<typename T>");
statement("inline bool spvSubgroupAllEqual(T value)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return quad_all(all(value == quad_broadcast_first(value)));");
else
statement("return simd_all(all(value == simd_broadcast_first(value)));");
@@ -5527,7 +6259,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<>");
statement("inline bool spvSubgroupAllEqual(bool value)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return quad_all(value) || !quad_any(value);");
else
statement("return simd_all(value) || !simd_any(value);");
@@ -5536,7 +6268,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<uint N>");
statement("inline bool spvSubgroupAllEqual(vec<bool, N> value)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return quad_all(all(value == (vec<bool, N>)quad_broadcast_first((vec<ushort, N>)value)));");
else
statement("return simd_all(all(value == (vec<bool, N>)simd_broadcast_first((vec<ushort, N>)value)));");
@@ -5548,7 +6280,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<typename T>");
statement("inline T spvSubgroupShuffle(T value, ushort lane)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return quad_shuffle(value, lane);");
else
statement("return simd_shuffle(value, lane);");
@@ -5557,7 +6289,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<>");
statement("inline bool spvSubgroupShuffle(bool value, ushort lane)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return !!quad_shuffle((ushort)value, lane);");
else
statement("return !!simd_shuffle((ushort)value, lane);");
@@ -5566,7 +6298,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<uint N>");
statement("inline vec<bool, N> spvSubgroupShuffle(vec<bool, N> value, ushort lane)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return (vec<bool, N>)quad_shuffle((vec<ushort, N>)value, lane);");
else
statement("return (vec<bool, N>)simd_shuffle((vec<ushort, N>)value, lane);");
@@ -5578,7 +6310,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<typename T>");
statement("inline T spvSubgroupShuffleXor(T value, ushort mask)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return quad_shuffle_xor(value, mask);");
else
statement("return simd_shuffle_xor(value, mask);");
@@ -5587,7 +6319,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<>");
statement("inline bool spvSubgroupShuffleXor(bool value, ushort mask)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return !!quad_shuffle_xor((ushort)value, mask);");
else
statement("return !!simd_shuffle_xor((ushort)value, mask);");
@@ -5596,7 +6328,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<uint N>");
statement("inline vec<bool, N> spvSubgroupShuffleXor(vec<bool, N> value, ushort mask)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return (vec<bool, N>)quad_shuffle_xor((vec<ushort, N>)value, mask);");
else
statement("return (vec<bool, N>)simd_shuffle_xor((vec<ushort, N>)value, mask);");
@@ -5608,7 +6340,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<typename T>");
statement("inline T spvSubgroupShuffleUp(T value, ushort delta)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return quad_shuffle_up(value, delta);");
else
statement("return simd_shuffle_up(value, delta);");
@@ -5617,7 +6349,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<>");
statement("inline bool spvSubgroupShuffleUp(bool value, ushort delta)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return !!quad_shuffle_up((ushort)value, delta);");
else
statement("return !!simd_shuffle_up((ushort)value, delta);");
@@ -5626,7 +6358,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<uint N>");
statement("inline vec<bool, N> spvSubgroupShuffleUp(vec<bool, N> value, ushort delta)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return (vec<bool, N>)quad_shuffle_up((vec<ushort, N>)value, delta);");
else
statement("return (vec<bool, N>)simd_shuffle_up((vec<ushort, N>)value, delta);");
@@ -5638,7 +6370,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<typename T>");
statement("inline T spvSubgroupShuffleDown(T value, ushort delta)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return quad_shuffle_down(value, delta);");
else
statement("return simd_shuffle_down(value, delta);");
@@ -5647,7 +6379,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<>");
statement("inline bool spvSubgroupShuffleDown(bool value, ushort delta)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return !!quad_shuffle_down((ushort)value, delta);");
else
statement("return !!simd_shuffle_down((ushort)value, delta);");
@@ -5656,7 +6388,7 @@ void CompilerMSL::emit_custom_functions()
statement("template<uint N>");
statement("inline vec<bool, N> spvSubgroupShuffleDown(vec<bool, N> value, ushort delta)");
begin_scope();
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
statement("return (vec<bool, N>)quad_shuffle_down((vec<ushort, N>)value, delta);");
else
statement("return (vec<bool, N>)simd_shuffle_down((vec<ushort, N>)value, delta);");
@@ -6485,28 +7217,6 @@ static string inject_top_level_storage_qualifier(const string &expr, const strin
}
}
-// Undefined global memory is not allowed in MSL.
-// Declare constant and init to zeros. Use {}, as global constructors can break Metal.
-void CompilerMSL::declare_undefined_values()
-{
- bool emitted = false;
- ir.for_each_typed_id<SPIRUndef>([&](uint32_t, SPIRUndef &undef) {
- auto &type = this->get<SPIRType>(undef.basetype);
- // OpUndef can be void for some reason ...
- if (type.basetype == SPIRType::Void)
- return;
-
- statement(inject_top_level_storage_qualifier(
- variable_decl(type, to_name(undef.self), undef.self),
- "constant"),
- " = {};");
- emitted = true;
- });
-
- if (emitted)
- statement("");
-}
-
void CompilerMSL::declare_constant_arrays()
{
bool fully_inlined = ir.ids_for_type[TypeFunction].size() == 1;
@@ -6526,6 +7236,7 @@ void CompilerMSL::declare_constant_arrays()
// link into Metal libraries. This is hacky.
if (!type.array.empty() && (!fully_inlined || is_scalar(type) || is_vector(type)))
{
+ add_resource_name(c.self);
auto name = to_name(c.self);
statement(inject_top_level_storage_qualifier(variable_decl(type, name), "constant"),
" = ", constant_expression(c), ";");
@@ -6557,6 +7268,7 @@ void CompilerMSL::declare_complex_constant_arrays()
auto &type = this->get<SPIRType>(c.constant_type);
if (!type.array.empty() && !(is_scalar(type) || is_vector(type)))
{
+ add_resource_name(c.self);
auto name = to_name(c.self);
statement("", variable_decl(type, name), " = ", constant_expression(c), ";");
emitted = true;
@@ -6570,7 +7282,6 @@ void CompilerMSL::declare_complex_constant_arrays()
void CompilerMSL::emit_resources()
{
declare_constant_arrays();
- declare_undefined_values();
// Emit the special [[stage_in]] and [[stage_out]] interface blocks which we created.
emit_interface_block(stage_out_var_id);
@@ -6614,7 +7325,26 @@ void CompilerMSL::emit_specialization_constants_and_structs()
// these types for purpose of iterating over them in ir.ids_for_type and friends.
auto loop_lock = ir.create_loop_soft_lock();
- for (auto &id_ : ir.ids_for_constant_or_type)
+ // Physical storage buffer pointers can have cyclical references,
+ // so emit forward declarations of them before other structs.
+ // Ignore type_id because we want the underlying struct type from the pointer.
+ ir.for_each_typed_id<SPIRType>([&](uint32_t /* type_id */, const SPIRType &type) {
+ if (type.basetype == SPIRType::Struct &&
+ type.pointer && type.storage == StorageClassPhysicalStorageBuffer &&
+ declared_structs.count(type.self) == 0)
+ {
+ statement("struct ", to_name(type.self), ";");
+ declared_structs.insert(type.self);
+ emitted = true;
+ }
+ });
+ if (emitted)
+ statement("");
+
+ emitted = false;
+ declared_structs.clear();
+
+ for (auto &id_ : ir.ids_for_constant_undef_or_type)
{
auto &id = ir.ids[id_];
@@ -6635,6 +7365,7 @@ void CompilerMSL::emit_specialization_constants_and_structs()
{
auto &type = get<SPIRType>(c.constant_type);
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";
@@ -6677,6 +7408,7 @@ void CompilerMSL::emit_specialization_constants_and_structs()
{
auto &c = id.get<SPIRConstantOp>();
auto &type = get<SPIRType>(c.basetype);
+ add_resource_name(c.self);
auto name = to_name(c.self);
statement("constant ", variable_decl(type, name), " = ", constant_op_expression(c), ";");
emitted = true;
@@ -6725,12 +7457,44 @@ void CompilerMSL::emit_specialization_constants_and_structs()
emit_struct(get<SPIRType>(type_id));
}
}
+ else if (id.get_type() == TypeUndef)
+ {
+ auto &undef = id.get<SPIRUndef>();
+ auto &type = get<SPIRType>(undef.basetype);
+ // OpUndef can be void for some reason ...
+ if (type.basetype == SPIRType::Void)
+ return;
+
+ // Undefined global memory is not allowed in MSL.
+ // Declare constant and init to zeros. Use {}, as global constructors can break Metal.
+ statement(
+ inject_top_level_storage_qualifier(variable_decl(type, to_name(undef.self), undef.self), "constant"),
+ " = {};");
+ emitted = true;
+ }
}
if (emitted)
statement("");
}
+void CompilerMSL::emit_binary_ptr_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);
+ emit_op(result_type, result_id, join(to_ptr_expression(op0), " ", op, " ", to_ptr_expression(op1)), forward);
+ inherit_expression_dependencies(result_id, op0);
+ inherit_expression_dependencies(result_id, op1);
+}
+
+string CompilerMSL::to_ptr_expression(uint32_t id, bool register_expression_read)
+{
+ auto *e = maybe_get<SPIRExpression>(id);
+ auto expr = enclose_expression(e && e->need_transpose ? e->expression : to_expression(id, register_expression_read));
+ if (!should_dereference(id))
+ expr = address_of_expression(expr);
+ return expr;
+}
+
void CompilerMSL::emit_binary_unord_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1,
const char *op)
{
@@ -6751,7 +7515,7 @@ bool CompilerMSL::emit_tessellation_io_load(uint32_t result_type_id, uint32_t id
auto &result_type = get<SPIRType>(result_type_id);
if (ptr_type.storage != StorageClassInput && ptr_type.storage != StorageClassOutput)
return false;
- if (ptr_type.storage == StorageClassOutput && get_execution_model() == ExecutionModelTessellationEvaluation)
+ if (ptr_type.storage == StorageClassOutput && is_tese_shader())
return false;
if (has_decoration(ptr, DecorationPatch))
@@ -7073,21 +7837,22 @@ bool CompilerMSL::emit_tessellation_access_chain(const uint32_t *ops, uint32_t l
bool flatten_composites = false;
bool is_block = false;
-
- if (var)
- is_block = has_decoration(get_variable_data_type(*var).self, DecorationBlock);
+ bool is_arrayed = false;
if (var)
{
+ auto &type = get_variable_data_type(*var);
+ is_block = has_decoration(type.self, DecorationBlock);
+ is_arrayed = !type.array.empty();
+
flatten_composites = variable_storage_requires_stage_io(var->storage);
- patch = has_decoration(ops[2], DecorationPatch) || is_patch_block(get_variable_data_type(*var));
+ patch = has_decoration(ops[2], DecorationPatch) || is_patch_block(type);
// Should match strip_array in add_interface_block.
- flat_data = var->storage == StorageClassInput ||
- (var->storage == StorageClassOutput && get_execution_model() == ExecutionModelTessellationControl);
+ flat_data = var->storage == StorageClassInput || (var->storage == StorageClassOutput && is_tesc_shader());
// Patch inputs are treated as normal block IO variables, so they don't deal with this path at all.
- if (patch && (!is_block || var->storage == StorageClassInput))
+ if (patch && (!is_block || is_arrayed || var->storage == StorageClassInput))
flat_data = false;
// We might have a chained access chain, where
@@ -7325,7 +8090,7 @@ bool CompilerMSL::emit_tessellation_access_chain(const uint32_t *ops, uint32_t l
expr_type->vecsize > result_ptr_type.vecsize)
e += vector_swizzle(result_ptr_type.vecsize, 0);
- auto &expr = set<SPIRExpression>(ops[1], move(e), ops[0], should_forward(ops[2]));
+ auto &expr = set<SPIRExpression>(ops[1], std::move(e), ops[0], should_forward(ops[2]));
expr.loaded_from = var->self;
expr.need_transpose = meta.need_transpose;
expr.access_chain = true;
@@ -7368,8 +8133,8 @@ bool CompilerMSL::emit_tessellation_access_chain(const uint32_t *ops, uint32_t l
// Don't do this if the index is a constant 1, though. We need to drop stores
// to that one.
auto *m = ir.find_meta(var ? var->self : ID(0));
- if (get_execution_model() == ExecutionModelTessellationControl && var && m &&
- m->decoration.builtin_type == BuiltInTessLevelInner && get_entry_point().flags.get(ExecutionModeTriangles))
+ if (is_tesc_shader() && var && m && m->decoration.builtin_type == BuiltInTessLevelInner &&
+ is_tessellating_triangles())
{
auto *c = maybe_get<SPIRConstant>(ops[3]);
if (c && c->scalar() == 1)
@@ -7386,7 +8151,7 @@ bool CompilerMSL::emit_tessellation_access_chain(const uint32_t *ops, uint32_t l
bool CompilerMSL::is_out_of_bounds_tessellation_level(uint32_t id_lhs)
{
- if (!get_entry_point().flags.get(ExecutionModeTriangles))
+ if (!is_tessellating_triangles())
return false;
// In SPIR-V, TessLevelInner always has two elements and TessLevelOuter always has
@@ -7396,7 +8161,7 @@ bool CompilerMSL::is_out_of_bounds_tessellation_level(uint32_t id_lhs)
// In Metal, however, only the first element of TessLevelInner and the first three
// of TessLevelOuter are accessible. This stems from how in Metal, the tessellation
// levels must be stored to a dedicated buffer in a particular format that depends
- // on the patch type. Therefore, in Triangles mode, any access to the second
+ // on the patch type. Therefore, in Triangles mode, any store to the second
// inner level or the fourth outer level must be dropped.
const auto *e = maybe_get<SPIRExpression>(id_lhs);
if (!e || !e->access_chain)
@@ -7438,8 +8203,7 @@ bool CompilerMSL::access_chain_needs_stage_io_builtin_translation(uint32_t base)
// Avoid overriding it back to just gl_ClipDistance.
// This can only happen in scenarios where we cannot flatten/unflatten access chains, so, the only case
// where this triggers is evaluation shader inputs.
- bool redirect_builtin = get_execution_model() == ExecutionModelTessellationEvaluation ?
- var->storage == StorageClassOutput : false;
+ bool redirect_builtin = is_tese_shader() ? var->storage == StorageClassOutput : false;
return redirect_builtin;
}
@@ -7498,12 +8262,31 @@ void CompilerMSL::fix_up_interpolant_access_chain(const uint32_t *ops, uint32_t
set_extended_decoration(ops[1], SPIRVCrossDecorationInterfaceMemberIndex, interface_index);
}
+
+// If the physical type of a physical buffer pointer has been changed
+// to a ulong or ulongn vector, add a cast back to the pointer type.
+void CompilerMSL::check_physical_type_cast(std::string &expr, const SPIRType *type, uint32_t physical_type)
+{
+ auto *p_physical_type = maybe_get<SPIRType>(physical_type);
+ if (p_physical_type &&
+ p_physical_type->storage == StorageClassPhysicalStorageBuffer &&
+ p_physical_type->basetype == to_unsigned_basetype(64))
+ {
+ if (p_physical_type->vecsize > 1)
+ expr += ".x";
+
+ expr = join("((", type_to_glsl(*type), ")", expr, ")");
+ }
+}
+
// Override for MSL-specific syntax instructions
void CompilerMSL::emit_instruction(const Instruction &instruction)
{
#define MSL_BOP(op) emit_binary_op(ops[0], ops[1], ops[2], ops[3], #op)
+#define MSL_PTR_BOP(op) emit_binary_ptr_op(ops[0], ops[1], ops[2], ops[3], #op)
+ // MSL does care about implicit integer promotion, but those cases are all handled in common code.
#define MSL_BOP_CAST(op, type) \
- emit_binary_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, opcode_is_sign_invariant(opcode))
+ emit_binary_op_cast(ops[0], ops[1], ops[2], ops[3], #op, type, opcode_is_sign_invariant(opcode), false)
#define MSL_UOP(op) emit_unary_op(ops[0], ops[1], ops[2], #op)
#define MSL_QFOP(op) emit_quaternary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], ops[5], #op)
#define MSL_TFOP(op) emit_trinary_func_op(ops[0], ops[1], ops[2], ops[3], ops[4], #op)
@@ -7516,6 +8299,8 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
auto ops = stream(instruction);
auto opcode = static_cast<Op>(instruction.op);
+ opcode = get_remapped_spirv_op(opcode);
+
// If we need to do implicit bitcasts, make sure we do it with the correct type.
uint32_t integer_width = get_integer_width_for_instruction(instruction);
auto int_type = to_signed_basetype(integer_width);
@@ -7558,6 +8343,10 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
case OpLogicalNotEqual:
case OpFOrdNotEqual:
+ // TODO: Should probably negate the == result here.
+ // Typically OrdNotEqual comes from GLSL which itself does not really specify what
+ // happens with NaN.
+ // Consider fixing this if we run into real issues.
MSL_BOP(!=);
break;
@@ -7614,7 +8403,9 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
break;
case OpFUnordNotEqual:
- MSL_UNORD_BOP(!=);
+ // not equal in MSL generates une opcodes to begin with.
+ // Since unordered not equal is how it works in C, just inherit that behavior.
+ MSL_BOP(!=);
break;
case OpFUnordGreaterThan:
@@ -7633,6 +8424,19 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
MSL_UNORD_BOP(<=);
break;
+ // Pointer math
+ case OpPtrEqual:
+ MSL_PTR_BOP(==);
+ break;
+
+ case OpPtrNotEqual:
+ MSL_PTR_BOP(!=);
+ break;
+
+ case OpPtrDiff:
+ MSL_PTR_BOP(-);
+ break;
+
// Derivatives
case OpDPdx:
case OpDPdxFine:
@@ -7721,7 +8525,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
uint32_t ptr = ops[2];
uint32_t mem_sem = ops[4];
uint32_t val = ops[5];
- emit_atomic_func_op(result_type, id, "atomic_exchange_explicit", mem_sem, mem_sem, false, ptr, val);
+ emit_atomic_func_op(result_type, id, "atomic_exchange_explicit", opcode, mem_sem, mem_sem, false, ptr, val);
break;
}
@@ -7734,7 +8538,8 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
uint32_t mem_sem_fail = ops[5];
uint32_t val = ops[6];
uint32_t comp = ops[7];
- emit_atomic_func_op(result_type, id, "atomic_compare_exchange_weak_explicit", mem_sem_pass, mem_sem_fail, true,
+ emit_atomic_func_op(result_type, id, "atomic_compare_exchange_weak_explicit", opcode,
+ mem_sem_pass, mem_sem_fail, true,
ptr, comp, true, false, val);
break;
}
@@ -7748,7 +8553,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
uint32_t id = ops[1];
uint32_t ptr = ops[2];
uint32_t mem_sem = ops[4];
- emit_atomic_func_op(result_type, id, "atomic_load_explicit", mem_sem, mem_sem, false, ptr, 0);
+ emit_atomic_func_op(result_type, id, "atomic_load_explicit", opcode, mem_sem, mem_sem, false, ptr, 0);
break;
}
@@ -7759,7 +8564,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
uint32_t ptr = ops[0];
uint32_t mem_sem = ops[2];
uint32_t val = ops[3];
- emit_atomic_func_op(result_type, id, "atomic_store_explicit", mem_sem, mem_sem, false, ptr, val);
+ emit_atomic_func_op(result_type, id, "atomic_store_explicit", opcode, mem_sem, mem_sem, false, ptr, val);
break;
}
@@ -7771,7 +8576,8 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
uint32_t ptr = ops[2]; \
uint32_t mem_sem = ops[4]; \
uint32_t val = valsrc; \
- emit_atomic_func_op(result_type, id, "atomic_fetch_" #op "_explicit", mem_sem, mem_sem, false, ptr, val, \
+ emit_atomic_func_op(result_type, id, "atomic_fetch_" #op "_explicit", opcode, \
+ mem_sem, mem_sem, false, ptr, val, \
false, valconst); \
} while (false)
@@ -7926,9 +8732,16 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
args.base.is_fetch = true;
args.coord = coord_id;
args.lod = lod;
- statement(join(to_expression(img_id), ".write(",
- remap_swizzle(store_type, texel_type.vecsize, to_expression(texel_id)), ", ",
- CompilerMSL::to_function_args(args, &forward), ");"));
+
+ string expr;
+ if (needs_frag_discard_checks())
+ expr = join("(", builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput), " ? ((void)0) : ");
+ expr += join(to_expression(img_id), ".write(",
+ remap_swizzle(store_type, texel_type.vecsize, to_expression(texel_id)), ", ",
+ CompilerMSL::to_function_args(args, &forward), ")");
+ if (needs_frag_discard_checks())
+ expr += ")";
+ statement(expr, ";");
if (p_var && variable_storage_is_aliased(*p_var))
flush_all_aliased_variables();
@@ -8064,28 +8877,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
uint32_t result_type = ops[0];
uint32_t id = ops[1];
uint32_t arg = ops[2];
-
- string exp;
- auto &type = get<SPIRType>(result_type);
-
- switch (type.vecsize)
- {
- case 1:
- exp = join("float(half(", to_expression(arg), "))");
- break;
- case 2:
- exp = join("float2(half2(", to_expression(arg), "))");
- break;
- case 3:
- exp = join("float3(half3(", to_expression(arg), "))");
- break;
- case 4:
- exp = join("float4(half4(", to_expression(arg), "))");
- break;
- default:
- SPIRV_CROSS_THROW("Illegal argument to OpQuantizeToF16.");
- }
-
+ string exp = join("spvQuantizeToF16(", to_expression(arg), ")");
emit_op(result_type, id, exp, should_forward(arg));
break;
}
@@ -8104,14 +8896,34 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
break;
case OpStore:
- if (is_out_of_bounds_tessellation_level(ops[0]))
- break;
+ {
+ const auto &type = expression_type(ops[0]);
- if (maybe_emit_array_assignment(ops[0], ops[1]))
+ if (is_out_of_bounds_tessellation_level(ops[0]))
break;
- CompilerGLSL::emit_instruction(instruction);
+ if (needs_frag_discard_checks() &&
+ (type.storage == StorageClassStorageBuffer || type.storage == StorageClassUniform))
+ {
+ // If we're in a continue block, this kludge will make the block too complex
+ // to emit normally.
+ assert(current_emitting_block);
+ auto cont_type = continue_block_type(*current_emitting_block);
+ if (cont_type != SPIRBlock::ContinueNone && cont_type != SPIRBlock::ComplexLoop)
+ {
+ current_emitting_block->complex_continue = true;
+ force_recompile();
+ }
+ statement("if (!", builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput), ")");
+ begin_scope();
+ }
+ if (!maybe_emit_array_assignment(ops[0], ops[1]))
+ CompilerGLSL::emit_instruction(instruction);
+ if (needs_frag_discard_checks() &&
+ (type.storage == StorageClassStorageBuffer || type.storage == StorageClassUniform))
+ end_scope();
break;
+ }
// Compute barriers
case OpMemoryBarrier:
@@ -8138,7 +8950,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
expr += "(";
for (uint32_t col = 0; col < type.columns; col++)
{
- expr += to_enclosed_expression(a);
+ expr += to_enclosed_unpacked_expression(a);
expr += " * ";
expr += to_extract_component_expression(b, col);
if (col + 1 < type.columns)
@@ -8243,19 +9055,19 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
auto &res_type = get<SPIRType>(type.member_types[1]);
if (opcode == OpIAddCarry)
{
- statement(to_expression(result_id), ".", to_member_name(type, 0), " = ", to_enclosed_expression(op0), " + ",
- to_enclosed_expression(op1), ";");
+ statement(to_expression(result_id), ".", to_member_name(type, 0), " = ",
+ to_enclosed_unpacked_expression(op0), " + ", to_enclosed_unpacked_expression(op1), ";");
statement(to_expression(result_id), ".", to_member_name(type, 1), " = select(", type_to_glsl(res_type),
- "(1), ", type_to_glsl(res_type), "(0), ", to_expression(result_id), ".", to_member_name(type, 0),
- " >= max(", to_expression(op0), ", ", to_expression(op1), "));");
+ "(1), ", type_to_glsl(res_type), "(0), ", to_unpacked_expression(result_id), ".", to_member_name(type, 0),
+ " >= max(", to_unpacked_expression(op0), ", ", to_unpacked_expression(op1), "));");
}
else
{
- statement(to_expression(result_id), ".", to_member_name(type, 0), " = ", to_enclosed_expression(op0), " - ",
- to_enclosed_expression(op1), ";");
+ statement(to_expression(result_id), ".", to_member_name(type, 0), " = ", to_enclosed_unpacked_expression(op0), " - ",
+ to_enclosed_unpacked_expression(op1), ";");
statement(to_expression(result_id), ".", to_member_name(type, 1), " = select(", type_to_glsl(res_type),
- "(1), ", type_to_glsl(res_type), "(0), ", to_enclosed_expression(op0),
- " >= ", to_enclosed_expression(op1), ");");
+ "(1), ", type_to_glsl(res_type), "(0), ", to_enclosed_unpacked_expression(op0),
+ " >= ", to_enclosed_unpacked_expression(op1), ");");
}
break;
}
@@ -8268,12 +9080,33 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
uint32_t op0 = ops[2];
uint32_t op1 = ops[3];
auto &type = get<SPIRType>(result_type);
+ auto input_type = opcode == OpSMulExtended ? int_type : uint_type;
+ auto &output_type = get_type(result_type);
+ string cast_op0, cast_op1;
+
+ auto expected_type = binary_op_bitcast_helper(cast_op0, cast_op1, input_type, op0, op1, false);
+
emit_uninitialized_temporary_expression(result_type, result_id);
- statement(to_expression(result_id), ".", to_member_name(type, 0), " = ", to_enclosed_expression(op0), " * ",
- to_enclosed_expression(op1), ";");
- statement(to_expression(result_id), ".", to_member_name(type, 1), " = mulhi(", to_expression(op0), ", ",
- to_expression(op1), ");");
+ string mullo_expr, mulhi_expr;
+ mullo_expr = join(cast_op0, " * ", cast_op1);
+ mulhi_expr = join("mulhi(", cast_op0, ", ", cast_op1, ")");
+
+ auto &low_type = get_type(output_type.member_types[0]);
+ auto &high_type = get_type(output_type.member_types[1]);
+ if (low_type.basetype != input_type)
+ {
+ expected_type.basetype = input_type;
+ mullo_expr = join(bitcast_glsl_op(low_type, expected_type), "(", mullo_expr, ")");
+ }
+ if (high_type.basetype != input_type)
+ {
+ expected_type.basetype = input_type;
+ mulhi_expr = join(bitcast_glsl_op(high_type, expected_type), "(", mulhi_expr, ")");
+ }
+
+ statement(to_expression(result_id), ".", to_member_name(type, 0), " = ", mullo_expr, ";");
+ statement(to_expression(result_id), ".", to_member_name(type, 1), " = ", mulhi_expr, ";");
break;
}
@@ -8328,8 +9161,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
uint32_t id = ops[1];
uint32_t a = ops[2], b = ops[3];
bool forward = should_forward(a) && should_forward(b);
- emit_op(result_type, id, join("int(short(", to_expression(a), ")) * int(short(", to_expression(b), "))"),
- forward);
+ emit_op(result_type, id, join("int(short(", to_unpacked_expression(a), ")) * int(short(", to_unpacked_expression(b), "))"), forward);
inherit_expression_dependencies(id, a);
inherit_expression_dependencies(id, b);
break;
@@ -8341,8 +9173,7 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
uint32_t id = ops[1];
uint32_t a = ops[2], b = ops[3];
bool forward = should_forward(a) && should_forward(b);
- emit_op(result_type, id, join("uint(ushort(", to_expression(a), ")) * uint(ushort(", to_expression(b), "))"),
- forward);
+ emit_op(result_type, id, join("uint(ushort(", to_unpacked_expression(a), ")) * uint(ushort(", to_unpacked_expression(b), "))"), forward);
inherit_expression_dependencies(id, a);
inherit_expression_dependencies(id, b);
break;
@@ -8360,7 +9191,10 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
SPIRV_CROSS_THROW("simd_is_helper_thread() requires MSL 2.3 on iOS.");
else if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 1))
SPIRV_CROSS_THROW("simd_is_helper_thread() requires MSL 2.1 on macOS.");
- emit_op(ops[0], ops[1], "simd_is_helper_thread()", false);
+ emit_op(ops[0], ops[1],
+ needs_manual_helper_invocation_updates() ? builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput) :
+ "simd_is_helper_thread()",
+ false);
break;
case OpBeginInvocationInterlockEXT:
@@ -8369,6 +9203,126 @@ void CompilerMSL::emit_instruction(const Instruction &instruction)
SPIRV_CROSS_THROW("Raster order groups require MSL 2.0.");
break; // Nothing to do in the body
+ case OpConvertUToAccelerationStructureKHR:
+ SPIRV_CROSS_THROW("ConvertUToAccelerationStructure is not supported in MSL.");
+ case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR:
+ SPIRV_CROSS_THROW("BindingTableRecordOffset is not supported in MSL.");
+
+ case OpRayQueryInitializeKHR:
+ {
+ flush_variable_declaration(ops[0]);
+
+ statement(to_expression(ops[0]), ".reset(", "ray(", to_expression(ops[4]), ", ", to_expression(ops[6]), ", ",
+ to_expression(ops[5]), ", ", to_expression(ops[7]), "), ", to_expression(ops[1]),
+ ", intersection_params());");
+ break;
+ }
+ case OpRayQueryProceedKHR:
+ {
+ flush_variable_declaration(ops[0]);
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".next()"), false);
+ break;
+ }
+#define MSL_RAY_QUERY_IS_CANDIDATE get<SPIRConstant>(ops[3]).scalar_i32() == 0
+
+#define MSL_RAY_QUERY_GET_OP(op, msl_op) \
+ case OpRayQueryGet##op##KHR: \
+ flush_variable_declaration(ops[2]); \
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".get_" #msl_op "()"), false); \
+ break
+
+#define MSL_RAY_QUERY_OP_INNER2(op, msl_prefix, msl_op) \
+ case OpRayQueryGet##op##KHR: \
+ flush_variable_declaration(ops[2]); \
+ if (MSL_RAY_QUERY_IS_CANDIDATE) \
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), #msl_prefix "_candidate_" #msl_op "()"), false); \
+ else \
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), #msl_prefix "_committed_" #msl_op "()"), false); \
+ break
+
+#define MSL_RAY_QUERY_GET_OP2(op, msl_op) MSL_RAY_QUERY_OP_INNER2(op, .get, msl_op)
+#define MSL_RAY_QUERY_IS_OP2(op, msl_op) MSL_RAY_QUERY_OP_INNER2(op, .is, msl_op)
+
+ MSL_RAY_QUERY_GET_OP(RayTMin, ray_min_distance);
+ MSL_RAY_QUERY_GET_OP(WorldRayOrigin, world_space_ray_origin);
+ MSL_RAY_QUERY_GET_OP(WorldRayDirection, world_space_ray_direction);
+ MSL_RAY_QUERY_GET_OP2(IntersectionInstanceId, instance_id);
+ MSL_RAY_QUERY_GET_OP2(IntersectionInstanceCustomIndex, user_instance_id);
+ MSL_RAY_QUERY_GET_OP2(IntersectionBarycentrics, triangle_barycentric_coord);
+ MSL_RAY_QUERY_GET_OP2(IntersectionPrimitiveIndex, primitive_id);
+ MSL_RAY_QUERY_GET_OP2(IntersectionGeometryIndex, geometry_id);
+ MSL_RAY_QUERY_GET_OP2(IntersectionObjectRayOrigin, ray_origin);
+ MSL_RAY_QUERY_GET_OP2(IntersectionObjectRayDirection, ray_direction);
+ MSL_RAY_QUERY_GET_OP2(IntersectionObjectToWorld, object_to_world_transform);
+ MSL_RAY_QUERY_GET_OP2(IntersectionWorldToObject, world_to_object_transform);
+ MSL_RAY_QUERY_IS_OP2(IntersectionFrontFace, triangle_front_facing);
+
+ case OpRayQueryGetIntersectionTypeKHR:
+ flush_variable_declaration(ops[2]);
+ if (MSL_RAY_QUERY_IS_CANDIDATE)
+ emit_op(ops[0], ops[1], join("uint(", to_expression(ops[2]), ".get_candidate_intersection_type()) - 1"),
+ false);
+ else
+ emit_op(ops[0], ops[1], join("uint(", to_expression(ops[2]), ".get_committed_intersection_type())"), false);
+ break;
+ case OpRayQueryGetIntersectionTKHR:
+ flush_variable_declaration(ops[2]);
+ if (MSL_RAY_QUERY_IS_CANDIDATE)
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".get_candidate_triangle_distance()"), false);
+ else
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".get_committed_distance()"), false);
+ break;
+ case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR:
+ {
+ flush_variable_declaration(ops[0]);
+ emit_op(ops[0], ops[1], join(to_expression(ops[2]), ".is_candidate_non_opaque_bounding_box()"), false);
+ break;
+ }
+ case OpRayQueryConfirmIntersectionKHR:
+ flush_variable_declaration(ops[0]);
+ statement(to_expression(ops[0]), ".commit_triangle_intersection();");
+ break;
+ case OpRayQueryGenerateIntersectionKHR:
+ flush_variable_declaration(ops[0]);
+ statement(to_expression(ops[0]), ".commit_bounding_box_intersection(", to_expression(ops[1]), ");");
+ break;
+ case OpRayQueryTerminateKHR:
+ flush_variable_declaration(ops[0]);
+ statement(to_expression(ops[0]), ".abort();");
+ break;
+#undef MSL_RAY_QUERY_GET_OP
+#undef MSL_RAY_QUERY_IS_CANDIDATE
+#undef MSL_RAY_QUERY_IS_OP2
+#undef MSL_RAY_QUERY_GET_OP2
+#undef MSL_RAY_QUERY_OP_INNER2
+
+ case OpConvertPtrToU:
+ case OpConvertUToPtr:
+ case OpBitcast:
+ {
+ auto &type = get<SPIRType>(ops[0]);
+ auto &input_type = expression_type(ops[2]);
+
+ if (opcode != OpBitcast || type.pointer || input_type.pointer)
+ {
+ string op;
+
+ if (type.vecsize == 1 && input_type.vecsize == 1)
+ op = join("reinterpret_cast<", type_to_glsl(type), ">(", to_unpacked_expression(ops[2]), ")");
+ else if (input_type.vecsize == 2)
+ op = join("reinterpret_cast<", type_to_glsl(type), ">(as_type<ulong>(", to_unpacked_expression(ops[2]), "))");
+ else
+ op = join("as_type<", type_to_glsl(type), ">(reinterpret_cast<ulong>(", to_unpacked_expression(ops[2]), "))");
+
+ emit_op(ops[0], ops[1], op, should_forward(ops[2]));
+ inherit_expression_dependencies(ops[1], ops[2]);
+ }
+ else
+ CompilerGLSL::emit_instruction(instruction);
+
+ break;
+ }
+
default:
CompilerGLSL::emit_instruction(instruction);
break;
@@ -8410,7 +9364,7 @@ void CompilerMSL::emit_texture_op(const Instruction &i, bool sparse)
void CompilerMSL::emit_barrier(uint32_t id_exe_scope, uint32_t id_mem_scope, uint32_t id_mem_sem)
{
- if (get_execution_model() != ExecutionModelGLCompute && get_execution_model() != ExecutionModelTessellationControl)
+ if (get_execution_model() != ExecutionModelGLCompute && !is_tesc_shader())
return;
uint32_t exe_scope = id_exe_scope ? evaluate_constant_u32(id_exe_scope) : uint32_t(ScopeInvocation);
@@ -8437,13 +9391,12 @@ void CompilerMSL::emit_barrier(uint32_t id_exe_scope, uint32_t id_mem_scope, uin
string mem_flags = "";
// For tesc shaders, this also affects objects in the Output storage class.
// Since in Metal, these are placed in a device buffer, we have to sync device memory here.
- if (get_execution_model() == ExecutionModelTessellationControl ||
+ if (is_tesc_shader() ||
(mem_sem & (MemorySemanticsUniformMemoryMask | MemorySemanticsCrossWorkgroupMemoryMask)))
mem_flags += "mem_flags::mem_device";
// Fix tessellation patch function processing
- if (get_execution_model() == ExecutionModelTessellationControl ||
- (mem_sem & (MemorySemanticsSubgroupMemoryMask | MemorySemanticsWorkgroupMemoryMask)))
+ if (is_tesc_shader() || (mem_sem & (MemorySemanticsSubgroupMemoryMask | MemorySemanticsWorkgroupMemoryMask)))
{
if (!mem_flags.empty())
mem_flags += " | ";
@@ -8560,7 +9513,7 @@ void CompilerMSL::emit_array_copy(const string &lhs, uint32_t lhs_id, uint32_t r
{
is_constant = true;
}
- else if (rhs_storage == StorageClassUniform)
+ else if (rhs_storage == StorageClassUniform || rhs_storage == StorageClassUniformConstant)
{
is_constant = true;
}
@@ -8621,7 +9574,7 @@ void CompilerMSL::emit_array_copy(const string &lhs, uint32_t lhs_id, uint32_t r
uint32_t CompilerMSL::get_physical_tess_level_array_size(spv::BuiltIn builtin) const
{
- if (get_execution_mode_bitset().get(ExecutionModeTriangles))
+ if (is_tessellating_triangles())
return builtin == BuiltInTessLevelInner ? 1 : 3;
else
return builtin == BuiltInTessLevelInner ? 2 : 4;
@@ -8655,8 +9608,7 @@ bool CompilerMSL::maybe_emit_array_assignment(uint32_t id_lhs, uint32_t id_rhs)
return true;
}
- if (get_execution_model() == ExecutionModelTessellationControl &&
- has_decoration(id_lhs, DecorationBuiltIn))
+ if (is_tesc_shader() && has_decoration(id_lhs, DecorationBuiltIn))
{
auto builtin = BuiltIn(get_decoration(id_lhs, DecorationBuiltIn));
// Need to manually unroll the array store.
@@ -8688,20 +9640,52 @@ bool CompilerMSL::maybe_emit_array_assignment(uint32_t id_lhs, uint32_t id_rhs)
}
// Emits one of the atomic functions. In MSL, the atomic functions operate on pointers
-void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, uint32_t mem_order_1,
- uint32_t mem_order_2, bool has_mem_order_2, uint32_t obj, uint32_t op1,
+void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, Op opcode,
+ uint32_t mem_order_1, uint32_t mem_order_2, bool has_mem_order_2, uint32_t obj, uint32_t op1,
bool op1_is_pointer, bool op1_is_literal, uint32_t op2)
{
- string exp = string(op) + "(";
+ string exp;
auto &type = get_pointee_type(expression_type(obj));
- exp += "(";
+ auto expected_type = type.basetype;
+ if (opcode == OpAtomicUMax || opcode == OpAtomicUMin)
+ expected_type = to_unsigned_basetype(type.width);
+ else if (opcode == OpAtomicSMax || opcode == OpAtomicSMin)
+ expected_type = to_signed_basetype(type.width);
+
+ if (type.width == 64)
+ SPIRV_CROSS_THROW("MSL currently does not support 64-bit atomics.");
+
+ auto remapped_type = type;
+ remapped_type.basetype = expected_type;
+
auto *var = maybe_get_backing_variable(obj);
if (!var)
SPIRV_CROSS_THROW("No backing variable for atomic operation.");
+ const auto &res_type = get<SPIRType>(var->basetype);
+
+ bool is_atomic_compare_exchange_strong = op1_is_pointer && op1;
+
+ bool check_discard = opcode != OpAtomicLoad && needs_frag_discard_checks() &&
+ ((res_type.storage == StorageClassUniformConstant && res_type.basetype == SPIRType::Image) ||
+ var->storage == StorageClassStorageBuffer || var->storage == StorageClassUniform);
+ if (check_discard)
+ {
+ if (is_atomic_compare_exchange_strong)
+ {
+ // We're already emitting a CAS loop here; a conditional won't hurt.
+ emit_uninitialized_temporary_expression(result_type, result_id);
+ statement("if (!", builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput), ")");
+ begin_scope();
+ }
+ else
+ exp = join("(!", builtin_to_glsl(BuiltInHelperInvocation, StorageClassInput), " ? ");
+ }
+
+ exp += string(op) + "(";
+ exp += "(";
// Emulate texture2D atomic operations
- const auto &res_type = get<SPIRType>(var->basetype);
if (res_type.storage == StorageClassUniformConstant && res_type.basetype == SPIRType::Image)
{
exp += "device";
@@ -8712,14 +9696,14 @@ void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id,
}
exp += " atomic_";
- exp += type_to_glsl(type);
+ // For signed and unsigned min/max, we can signal this through the pointer type.
+ // There is no other way, since C++ does not have explicit signage for atomics.
+ exp += type_to_glsl(remapped_type);
exp += "*)";
exp += "&";
exp += to_enclosed_expression(obj);
- bool is_atomic_compare_exchange_strong = op1_is_pointer && op1;
-
if (is_atomic_compare_exchange_strong)
{
assert(strcmp(op, "atomic_compare_exchange_weak_explicit") == 0);
@@ -8741,11 +9725,42 @@ void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id,
// the CAS loop, otherwise it will loop infinitely, with the comparison test always failing.
// The function updates the comparitor value from the memory value, so the additional
// comparison test evaluates the memory value against the expected value.
- emit_uninitialized_temporary_expression(result_type, result_id);
+ if (!check_discard)
+ emit_uninitialized_temporary_expression(result_type, result_id);
statement("do");
begin_scope();
statement(to_name(result_id), " = ", to_expression(op1), ";");
end_scope_decl(join("while (!", exp, " && ", to_name(result_id), " == ", to_enclosed_expression(op1), ")"));
+ if (check_discard)
+ {
+ end_scope();
+ statement("else");
+ begin_scope();
+ exp = "atomic_load_explicit(";
+ exp += "(";
+ // Emulate texture2D atomic operations
+ if (res_type.storage == StorageClassUniformConstant && res_type.basetype == SPIRType::Image)
+ exp += "device";
+ else
+ exp += get_argument_address_space(*var);
+
+ exp += " atomic_";
+ exp += type_to_glsl(remapped_type);
+ exp += "*)";
+
+ exp += "&";
+ exp += to_enclosed_expression(obj);
+
+ if (has_mem_order_2)
+ exp += string(", ") + get_memory_order(mem_order_2);
+ else
+ exp += string(", ") + get_memory_order(mem_order_1);
+
+ exp += ")";
+
+ statement(to_name(result_id), " = ", exp, ";");
+ end_scope();
+ }
}
else
{
@@ -8755,7 +9770,7 @@ void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id,
if (op1_is_literal)
exp += join(", ", op1);
else
- exp += ", " + to_expression(op1);
+ exp += ", " + bitcast_expression(expected_type, op1);
}
if (op2)
exp += ", " + to_expression(op2);
@@ -8766,6 +9781,41 @@ void CompilerMSL::emit_atomic_func_op(uint32_t result_type, uint32_t result_id,
exp += ")";
+ if (check_discard)
+ {
+ exp += " : ";
+ if (strcmp(op, "atomic_store_explicit") != 0)
+ {
+ exp += "atomic_load_explicit(";
+ exp += "(";
+ // Emulate texture2D atomic operations
+ if (res_type.storage == StorageClassUniformConstant && res_type.basetype == SPIRType::Image)
+ exp += "device";
+ else
+ exp += get_argument_address_space(*var);
+
+ exp += " atomic_";
+ exp += type_to_glsl(remapped_type);
+ exp += "*)";
+
+ exp += "&";
+ exp += to_enclosed_expression(obj);
+
+ if (has_mem_order_2)
+ exp += string(", ") + get_memory_order(mem_order_2);
+ else
+ exp += string(", ") + get_memory_order(mem_order_1);
+
+ exp += ")";
+ }
+ else
+ exp += "((void)0)";
+ exp += ")";
+ }
+
+ if (expected_type != type.basetype)
+ exp = bitcast_expression(type, expected_type, exp);
+
if (strcmp(op, "atomic_store_explicit") != 0)
emit_op(result_type, result_id, exp, false);
else
@@ -8792,6 +9842,8 @@ void CompilerMSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop,
auto int_type = to_signed_basetype(integer_width);
auto uint_type = to_unsigned_basetype(integer_width);
+ op = get_remapped_glsl_op(op);
+
switch (op)
{
case GLSLstd450Sinh:
@@ -9036,14 +10088,19 @@ void CompilerMSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop,
break;
case GLSLstd450Normalize:
+ {
+ auto &exp_type = expression_type(args[0]);
// MSL does not support scalar versions here.
+ // MSL has no implementation for normalize in the fast:: namespace for half2 and half3
// Returns -1 or 1 for valid input, sign() does the job.
- if (expression_type(args[0]).vecsize == 1)
+ if (exp_type.vecsize == 1)
emit_unary_func_op(result_type, id, args[0], "sign");
+ else if (exp_type.vecsize <= 3 && exp_type.basetype == SPIRType::Half)
+ emit_unary_func_op(result_type, id, args[0], "normalize");
else
emit_unary_func_op(result_type, id, args[0], "fast::normalize");
break;
-
+ }
case GLSLstd450Reflect:
if (get<SPIRType>(result_type).vecsize == 1)
emit_binary_func_op(result_type, id, args[0], args[1], "spvReflect");
@@ -9069,8 +10126,16 @@ void CompilerMSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop,
case GLSLstd450Frexp:
{
// Special case. If the variable is a scalar access chain, we cannot use it directly. We have to emit a temporary.
+ // Another special case is if the variable is in a storage class which is not thread.
auto *ptr = maybe_get<SPIRExpression>(args[1]);
- if (ptr && ptr->access_chain && is_scalar(expression_type(args[1])))
+ auto &type = expression_type(args[1]);
+
+ bool is_thread_storage = storage_class_array_is_thread(type.storage);
+ if (type.storage == StorageClassOutput && capture_output_to_buffer)
+ is_thread_storage = false;
+
+ if (!is_thread_storage ||
+ (ptr && ptr->access_chain && is_scalar(expression_type(args[1]))))
{
register_call_out_argument(args[1]);
forced_temporaries.insert(id);
@@ -9081,7 +10146,7 @@ void CompilerMSL::emit_glsl_op(uint32_t result_type, uint32_t id, uint32_t eop,
if (!tmp_id)
tmp_id = ir.increase_bound_by(1);
- uint32_t tmp_type_id = get_pointee_type_id(ptr->expression_type);
+ uint32_t tmp_type_id = get_pointee_type_id(expression_type_id(args[1]));
emit_uninitialized_temporary_expression(tmp_type_id, tmp_id);
emit_binary_func_op(result_type, id, args[0], tmp_id, eop == GLSLstd450Modf ? "modf" : "frexp");
statement(to_expression(args[1]), " = ", to_expression(tmp_id), ";");
@@ -9194,6 +10259,9 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &)
else
decl += entry_point_args_classic(!func.arguments.empty());
+ // append entry point args to avoid conflicts in local variable names.
+ local_variable_names.insert(resource_names.begin(), resource_names.end());
+
// If entry point function has variables that require early declaration,
// ensure they each have an empty initializer, creating one if needed.
// This is done at this late stage because the initialization expression
@@ -9245,7 +10313,20 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &)
// Manufacture automatic sampler arg for SampledImage texture
if (arg_type.image.dim != DimBuffer)
- decl += join(", thread const ", sampler_type(arg_type, arg.id), " ", to_sampler_expression(arg.id));
+ {
+ if (arg_type.array.empty())
+ {
+ decl += join(", ", sampler_type(arg_type, arg.id), " ", to_sampler_expression(arg.id));
+ }
+ else
+ {
+ const char *sampler_address_space =
+ descriptor_address_space(name_id,
+ StorageClassUniformConstant,
+ "thread const");
+ decl += join(", ", sampler_address_space, " ", sampler_type(arg_type, arg.id), "& ", to_sampler_expression(arg.id));
+ }
+ }
}
// Manufacture automatic swizzle arg.
@@ -9256,7 +10337,7 @@ void CompilerMSL::emit_function_prototype(SPIRFunction &func, const Bitset &)
decl += join(", constant uint", arg_is_array ? "* " : "& ", to_swizzle_expression(arg.id));
}
- if (buffers_requiring_array_length.count(name_id))
+ if (buffer_requires_array_length(name_id))
{
bool arg_is_array = !arg_type.array.empty();
decl += join(", constant uint", arg_is_array ? "* " : "& ", to_buffer_size_expression(name_id));
@@ -9281,8 +10362,6 @@ static bool needs_chroma_reconstruction(const MSLConstexprSampler *constexpr_sam
string CompilerMSL::to_function_name(const TextureFunctionNameArguments &args)
{
VariableID img = args.base.img;
- auto &imgtype = *args.base.imgtype;
-
const MSLConstexprSampler *constexpr_sampler = nullptr;
bool is_dynamic_img_sampler = false;
if (auto *var = maybe_get_backing_variable(img))
@@ -9296,8 +10375,9 @@ string CompilerMSL::to_function_name(const TextureFunctionNameArguments &args)
if (msl_options.swizzle_texture_samples && args.base.is_gather && !is_dynamic_img_sampler &&
(!constexpr_sampler || !constexpr_sampler->ycbcr_conversion_enable))
{
- add_spv_func_and_recompile(imgtype.image.depth ? SPVFuncImplGatherCompareSwizzle : SPVFuncImplGatherSwizzle);
- return imgtype.image.depth ? "spvGatherCompareSwizzle" : "spvGatherSwizzle";
+ bool is_compare = comparison_ids.count(img);
+ add_spv_func_and_recompile(is_compare ? SPVFuncImplGatherCompareSwizzle : SPVFuncImplGatherSwizzle);
+ return is_compare ? "spvGatherCompareSwizzle" : "spvGatherSwizzle";
}
auto *combined = maybe_get<SPIRCombinedImageSampler>(img);
@@ -9909,7 +10989,7 @@ string CompilerMSL::to_function_args(const TextureFunctionArguments &args, bool
image_var = var->self;
}
- if (image_var == 0 || !image_is_comparison(expression_type(image_var), image_var))
+ if (image_var == 0 || !is_depth_image(expression_type(image_var), image_var))
farg_str += ", " + to_component_argument(args.component);
}
}
@@ -10195,6 +11275,10 @@ string CompilerMSL::to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_
constants.push_back(id);
}
}
+ // Dereference pointer variables where needed.
+ // FIXME: This dereference is actually backwards. We should really just support passing pointer variables between functions.
+ else if (should_dereference(id))
+ arg_str += dereference_expression(type, CompilerGLSL::to_func_call_arg(arg, id));
else
arg_str += CompilerGLSL::to_func_call_arg(arg, id);
@@ -10290,7 +11374,7 @@ string CompilerMSL::to_func_call_arg(const SPIRFunction::Parameter &arg, uint32_
else if (msl_options.swizzle_texture_samples && has_sampled_images && is_sampled_image_type(type))
arg_str += ", " + to_swizzle_expression(var_id ? var_id : id);
- if (buffers_requiring_array_length.count(var_id))
+ if (buffer_requires_array_length(var_id))
arg_str += ", " + to_buffer_size_expression(var_id ? var_id : id);
if (is_dynamic_img_sampler)
@@ -10414,7 +11498,7 @@ string CompilerMSL::convert_row_major_matrix(string exp_str, const SPIRType &exp
{
if (!is_matrix(exp_type))
{
- return CompilerGLSL::convert_row_major_matrix(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);
}
else
{
@@ -10505,12 +11589,23 @@ string CompilerMSL::to_struct_member(const SPIRType &type, uint32_t member_type_
else if (!is_scalar(physical_type)) // scalar type is already packed.
pack_pfx = "packed_";
}
- else if (row_major)
+ else if (is_matrix(physical_type))
{
- // Need to declare type with flipped vecsize/columns.
- row_major_physical_type = physical_type;
- swap(row_major_physical_type.vecsize, row_major_physical_type.columns);
- declared_type = &row_major_physical_type;
+ if (!msl_options.supports_msl_version(3, 0) &&
+ has_extended_decoration(type.self, SPIRVCrossDecorationWorkgroupStruct))
+ {
+ pack_pfx = "spvStorage_";
+ add_spv_func_and_recompile(SPVFuncImplStorageMatrix);
+ // The pack prefix causes problems with array<T> wrappers.
+ is_using_builtin_array = true;
+ }
+ if (row_major)
+ {
+ // Need to declare type with flipped vecsize/columns.
+ row_major_physical_type = physical_type;
+ swap(row_major_physical_type.vecsize, row_major_physical_type.columns);
+ declared_type = &row_major_physical_type;
+ }
}
// Very specifically, image load-store in argument buffers are disallowed on MSL on iOS.
@@ -10540,8 +11635,8 @@ string CompilerMSL::to_struct_member(const SPIRType &type, uint32_t member_type_
array_type = type_to_array_glsl(physical_type);
}
- auto result = join(pack_pfx, type_to_glsl(*declared_type, orig_id), " ", qualifier, to_member_name(type, index),
- member_attribute_qualifier(type, index), array_type, ";");
+ auto result = join(pack_pfx, type_to_glsl(*declared_type, orig_id, true), " ", qualifier,
+ to_member_name(type, index), member_attribute_qualifier(type, index), array_type, ";");
is_using_builtin_array = false;
return result;
@@ -10632,8 +11727,7 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in
}
// Vertex and tessellation evaluation function outputs
- if (((execution.model == ExecutionModelVertex && !msl_options.vertex_for_tessellation) ||
- execution.model == ExecutionModelTessellationEvaluation) &&
+ if (((execution.model == ExecutionModelVertex && !msl_options.vertex_for_tessellation) || is_tese_shader()) &&
type.storage == StorageClassOutput)
{
if (is_builtin)
@@ -10676,8 +11770,18 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in
return join(" [[", loc_qual, "]]");
}
+ if (execution.model == ExecutionModelVertex && msl_options.vertex_for_tessellation && type.storage == StorageClassOutput)
+ {
+ // For this type of shader, we always arrange for it to capture its
+ // output to a buffer. For this reason, qualifiers are irrelevant here.
+ if (is_builtin)
+ // We still have to assign a location so the output struct will sort correctly.
+ get_or_allocate_builtin_output_member_location(builtin, type.self, index);
+ return "";
+ }
+
// Tessellation control function inputs
- if (execution.model == ExecutionModelTessellationControl && type.storage == StorageClassInput)
+ if (is_tesc_shader() && type.storage == StorageClassInput)
{
if (is_builtin)
{
@@ -10714,15 +11818,18 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in
}
// Tessellation control function outputs
- if (execution.model == ExecutionModelTessellationControl && type.storage == StorageClassOutput)
+ if (is_tesc_shader() && type.storage == StorageClassOutput)
{
// For this type of shader, we always arrange for it to capture its
// output to a buffer. For this reason, qualifiers are irrelevant here.
+ if (is_builtin)
+ // We still have to assign a location so the output struct will sort correctly.
+ get_or_allocate_builtin_output_member_location(builtin, type.self, index);
return "";
}
// Tessellation evaluation function inputs
- if (execution.model == ExecutionModelTessellationEvaluation && type.storage == StorageClassInput)
+ if (is_tese_shader() && type.storage == StorageClassInput)
{
if (is_builtin)
{
@@ -10738,6 +11845,10 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in
break;
}
}
+
+ if (msl_options.raw_buffer_tese_input)
+ return "";
+
// The special control point array must not be marked with an attribute.
if (get_type(type.member_types[index]).basetype == SPIRType::ControlPointArray)
return "";
@@ -10772,8 +11883,8 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in
case BuiltInSampleId:
case BuiltInSampleMask:
case BuiltInLayer:
- case BuiltInBaryCoordNV:
- case BuiltInBaryCoordNoPerspNV:
+ case BuiltInBaryCoordKHR:
+ case BuiltInBaryCoordNoPerspKHR:
quals = builtin_qualifier(builtin);
break;
@@ -10789,7 +11900,7 @@ string CompilerMSL::member_attribute_qualifier(const SPIRType &type, uint32_t in
else
quals = member_location_attribute_qualifier(type, index);
- if (builtin == BuiltInBaryCoordNV || builtin == BuiltInBaryCoordNoPerspNV)
+ if (builtin == BuiltInBaryCoordKHR || builtin == BuiltInBaryCoordNoPerspKHR)
{
if (has_member_decoration(type.self, index, DecorationFlat) ||
has_member_decoration(type.self, index, DecorationCentroid) ||
@@ -10995,7 +12106,7 @@ uint32_t CompilerMSL::get_or_allocate_builtin_input_member_location(spv::BuiltIn
// Triangle tess level inputs are shared in one packed float4,
// mark both builtins as sharing one location.
- if (get_execution_mode_bitset().get(ExecutionModeTriangles) &&
+ if (!msl_options.raw_buffer_tese_input && is_tessellating_triangles() &&
(builtin == BuiltInTessLevelInner || builtin == BuiltInTessLevelOuter))
{
builtin_to_automatic_input_location[BuiltInTessLevelInner] = loc;
@@ -11008,6 +12119,49 @@ uint32_t CompilerMSL::get_or_allocate_builtin_input_member_location(spv::BuiltIn
return loc;
}
+uint32_t CompilerMSL::get_or_allocate_builtin_output_member_location(spv::BuiltIn builtin,
+ uint32_t type_id, uint32_t index,
+ uint32_t *comp)
+{
+ uint32_t loc = get_member_location(type_id, index, comp);
+ if (loc != k_unknown_location)
+ return loc;
+ loc = 0;
+
+ if (comp)
+ *comp = k_unknown_component;
+
+ // Late allocation. Find a location which is unused by the application.
+ // This can happen for built-in outputs in tessellation which are mixed and matched with user inputs.
+ auto &mbr_type = get<SPIRType>(get<SPIRType>(type_id).member_types[index]);
+ uint32_t count = type_to_location_count(mbr_type);
+
+ const auto location_range_in_use = [this](uint32_t location, uint32_t location_count) -> bool {
+ for (uint32_t i = 0; i < location_count; i++)
+ if (location_outputs_in_use.count(location + i) != 0)
+ return true;
+ return false;
+ };
+
+ while (location_range_in_use(loc, count))
+ loc++;
+
+ set_member_decoration(type_id, index, DecorationLocation, loc);
+
+ // Triangle tess level inputs are shared in one packed float4;
+ // mark both builtins as sharing one location.
+ if (is_tessellating_triangles() && (builtin == BuiltInTessLevelInner || builtin == BuiltInTessLevelOuter))
+ {
+ builtin_to_automatic_output_location[BuiltInTessLevelInner] = loc;
+ builtin_to_automatic_output_location[BuiltInTessLevelOuter] = loc;
+ }
+ else
+ builtin_to_automatic_output_location[builtin] = loc;
+
+ mark_location_as_used_by_shader(loc, mbr_type, StorageClassOutput, true);
+ return loc;
+}
+
// Returns the type declaration for a function, including the
// entry type if the current function is the entry point function
string CompilerMSL::func_type_decl(SPIRType &type)
@@ -11038,17 +12192,13 @@ string CompilerMSL::func_type_decl(SPIRType &type)
if (execution.flags.get(ExecutionModeIsolines))
SPIRV_CROSS_THROW("Metal does not support isoline tessellation.");
if (msl_options.is_ios())
- entry_type =
- join("[[ patch(", execution.flags.get(ExecutionModeTriangles) ? "triangle" : "quad", ") ]] vertex");
+ entry_type = join("[[ patch(", is_tessellating_triangles() ? "triangle" : "quad", ") ]] vertex");
else
- entry_type = join("[[ patch(", execution.flags.get(ExecutionModeTriangles) ? "triangle" : "quad", ", ",
+ entry_type = join("[[ patch(", is_tessellating_triangles() ? "triangle" : "quad", ", ",
execution.output_vertices, ") ]] vertex");
break;
case ExecutionModelFragment:
- entry_type = execution.flags.get(ExecutionModeEarlyFragmentTests) ||
- execution.flags.get(ExecutionModePostDepthCoverage) ?
- "[[ early_fragment_tests ]] fragment" :
- "fragment";
+ entry_type = uses_explicit_early_fragment_test() ? "[[ early_fragment_tests ]] fragment" : "fragment";
break;
case ExecutionModelTessellationControl:
if (!msl_options.supports_msl_version(1, 2))
@@ -11068,6 +12218,22 @@ string CompilerMSL::func_type_decl(SPIRType &type)
return entry_type + " " + return_type;
}
+bool CompilerMSL::is_tesc_shader() const
+{
+ return get_execution_model() == ExecutionModelTessellationControl;
+}
+
+bool CompilerMSL::is_tese_shader() const
+{
+ return get_execution_model() == ExecutionModelTessellationEvaluation;
+}
+
+bool CompilerMSL::uses_explicit_early_fragment_test()
+{
+ auto &ep_flags = get_entry_point().flags;
+ return ep_flags.get(ExecutionModeEarlyFragmentTests) || ep_flags.get(ExecutionModePostDepthCoverage);
+}
+
// In MSL, address space qualifiers are required for all pointer or reference variables
string CompilerMSL::get_argument_address_space(const SPIRVariable &argument)
{
@@ -11094,6 +12260,7 @@ string CompilerMSL::get_type_address_space(const SPIRType &type, uint32_t id, bo
break;
case StorageClassStorageBuffer:
+ case StorageClassPhysicalStorageBuffer:
{
// For arguments from variable pointers, we use the write count deduction, so
// we should not assume any constness here. Only for global SSBOs.
@@ -11132,9 +12299,20 @@ string CompilerMSL::get_type_address_space(const SPIRType &type, uint32_t id, bo
break;
case StorageClassInput:
- if (get_execution_model() == ExecutionModelTessellationControl && var &&
- var->basevariable == stage_in_ptr_var_id)
- addr_space = msl_options.multi_patch_workgroup ? "constant" : "threadgroup";
+ if (is_tesc_shader() && var && var->basevariable == stage_in_ptr_var_id)
+ addr_space = msl_options.multi_patch_workgroup ? "const device" : "threadgroup";
+ // Don't pass tessellation levels in the device AS; we load and convert them
+ // to float manually.
+ if (is_tese_shader() && msl_options.raw_buffer_tese_input && var)
+ {
+ bool is_stage_in = var->basevariable == stage_in_ptr_var_id;
+ bool is_patch_stage_in = has_decoration(var->self, DecorationPatch);
+ bool is_builtin = has_decoration(var->self, DecorationBuiltIn);
+ BuiltIn builtin = (BuiltIn)get_decoration(var->self, DecorationBuiltIn);
+ bool is_tess_level = is_builtin && (builtin == BuiltInTessLevelOuter || builtin == BuiltInTessLevelInner);
+ if (is_stage_in || (is_patch_stage_in && !is_tess_level))
+ addr_space = "const device";
+ }
if (get_execution_model() == ExecutionModelFragment && var && var->basevariable == stage_in_var_id)
addr_space = "thread";
break;
@@ -11192,19 +12370,21 @@ const char *CompilerMSL::to_restrict(uint32_t id, bool space)
else
flags = get_decoration_bitset(id);
- return flags.get(DecorationRestrict) ? (space ? "restrict " : "restrict") : "";
+ return flags.get(DecorationRestrict) || flags.get(DecorationRestrictPointerEXT) ?
+ (space ? "__restrict " : "__restrict") : "";
}
string CompilerMSL::entry_point_arg_stage_in()
{
string decl;
- if (get_execution_model() == ExecutionModelTessellationControl && msl_options.multi_patch_workgroup)
+ if ((is_tesc_shader() && msl_options.multi_patch_workgroup) ||
+ (is_tese_shader() && msl_options.raw_buffer_tese_input))
return decl;
// Stage-in structure
uint32_t stage_in_id;
- if (get_execution_model() == ExecutionModelTessellationEvaluation)
+ if (is_tese_shader())
stage_in_id = patch_stage_in_var_id;
else
stage_in_id = stage_in_var_id;
@@ -11244,7 +12424,7 @@ bool CompilerMSL::is_direct_input_builtin(BuiltIn bi_type)
return false;
case BuiltInInvocationId:
case BuiltInPrimitiveId:
- return get_execution_model() != ExecutionModelTessellationControl || !msl_options.multi_patch_workgroup;
+ return !is_tesc_shader() || !msl_options.multi_patch_workgroup;
// Tess. evaluation function in
case BuiltInTessLevelInner:
case BuiltInTessLevelOuter:
@@ -11252,8 +12432,8 @@ bool CompilerMSL::is_direct_input_builtin(BuiltIn bi_type)
// Fragment function in
case BuiltInSamplePosition:
case BuiltInHelperInvocation:
- case BuiltInBaryCoordNV:
- case BuiltInBaryCoordNoPerspNV:
+ case BuiltInBaryCoordKHR:
+ case BuiltInBaryCoordNoPerspKHR:
return false;
case BuiltInViewIndex:
return get_execution_model() == ExecutionModelFragment && msl_options.multiview &&
@@ -11288,7 +12468,13 @@ bool CompilerMSL::is_sample_rate() const
return get_execution_model() == ExecutionModelFragment &&
(msl_options.force_sample_rate_shading ||
std::find(caps.begin(), caps.end(), CapabilitySampleRateShading) != caps.end() ||
- (msl_options.use_framebuffer_fetch_subpasses && need_subpass_input));
+ (msl_options.use_framebuffer_fetch_subpasses && need_subpass_input_ms));
+}
+
+bool CompilerMSL::is_intersection_query() const
+{
+ auto &caps = get_declared_capabilities();
+ return std::find(caps.begin(), caps.end(), CapabilityRayQueryKHR) != caps.end();
}
void CompilerMSL::entry_point_args_builtin(string &ep_args)
@@ -11322,7 +12508,13 @@ void CompilerMSL::entry_point_args_builtin(string &ep_args)
// Handle HLSL-style 0-based vertex/instance index.
builtin_declaration = true;
- ep_args += builtin_type_decl(bi_type, var_id) + " " + to_expression(var_id);
+
+ // Handle different MSL gl_TessCoord types. (float2, float3)
+ if (bi_type == BuiltInTessCoord && get_entry_point().flags.get(ExecutionModeQuads))
+ ep_args += "float2 " + to_expression(var_id) + "In";
+ else
+ ep_args += builtin_type_decl(bi_type, var_id) + " " + to_expression(var_id);
+
ep_args += " [[" + builtin_qualifier(bi_type);
if (bi_type == BuiltInSampleMask && get_entry_point().flags.get(ExecutionModePostDepthCoverage))
{
@@ -11387,7 +12579,7 @@ void CompilerMSL::entry_point_args_builtin(string &ep_args)
" [[buffer(", msl_options.shader_output_buffer_index, ")]]");
}
- if (get_execution_model() == ExecutionModelTessellationControl)
+ if (is_tesc_shader())
{
if (!ep_args.empty())
ep_args += ", ";
@@ -11429,7 +12621,7 @@ void CompilerMSL::entry_point_args_builtin(string &ep_args)
// a buffer to hold the per-patch data, a buffer to hold the per-patch
// tessellation levels, and a block of workgroup memory to hold the
// input control point data.
- if (get_execution_model() == ExecutionModelTessellationControl)
+ if (is_tesc_shader())
{
if (patch_stage_out_var_id)
{
@@ -11463,20 +12655,22 @@ void CompilerMSL::entry_point_args_builtin(string &ep_args)
if (outer_factor_initializer_id && (c = maybe_get<SPIRConstant>(outer_factor_initializer_id)))
{
auto &entry_func = get<SPIRFunction>(ir.default_entry_point);
- entry_func.fixup_hooks_in.push_back([=]() {
- uint32_t components = get_execution_mode_bitset().get(ExecutionModeTriangles) ? 3 : 4;
- for (uint32_t i = 0; i < components; i++)
- {
- statement(builtin_to_glsl(BuiltInTessLevelOuter, StorageClassOutput), "[", i, "] = ",
- "half(", to_expression(c->subconstants[i]), ");");
- }
- });
+ entry_func.fixup_hooks_in.push_back(
+ [=]()
+ {
+ uint32_t components = is_tessellating_triangles() ? 3 : 4;
+ for (uint32_t i = 0; i < components; i++)
+ {
+ statement(builtin_to_glsl(BuiltInTessLevelOuter, StorageClassOutput), "[", i,
+ "] = ", "half(", to_expression(c->subconstants[i]), ");");
+ }
+ });
}
if (inner_factor_initializer_id && (c = maybe_get<SPIRConstant>(inner_factor_initializer_id)))
{
auto &entry_func = get<SPIRFunction>(ir.default_entry_point);
- if (get_execution_mode_bitset().get(ExecutionModeTriangles))
+ if (is_tessellating_triangles())
{
entry_func.fixup_hooks_in.push_back([=]() {
statement(builtin_to_glsl(BuiltInTessLevelInner, StorageClassOutput), " = ", "half(",
@@ -11512,6 +12706,36 @@ void CompilerMSL::entry_point_args_builtin(string &ep_args)
}
}
}
+ // Tessellation evaluation shaders get three additional parameters:
+ // a buffer for the per-patch data, a buffer for the per-patch
+ // tessellation levels, and a buffer for the control point data.
+ if (is_tese_shader() && msl_options.raw_buffer_tese_input)
+ {
+ if (patch_stage_in_var_id)
+ {
+ if (!ep_args.empty())
+ ep_args += ", ";
+ ep_args +=
+ join("const device ", type_to_glsl(get_patch_stage_in_struct_type()), "* ", patch_input_buffer_var_name,
+ " [[buffer(", convert_to_string(msl_options.shader_patch_input_buffer_index), ")]]");
+ }
+
+ if (tess_level_inner_var_id || tess_level_outer_var_id)
+ {
+ if (!ep_args.empty())
+ ep_args += ", ";
+ ep_args += join("const device ", get_tess_factor_struct_name(), "* ", tess_factor_buffer_var_name,
+ " [[buffer(", convert_to_string(msl_options.shader_tess_factor_buffer_index), ")]]");
+ }
+
+ if (stage_in_var_id)
+ {
+ if (!ep_args.empty())
+ ep_args += ", ";
+ ep_args += join("const device ", type_to_glsl(get_stage_in_struct_type()), "* ", input_buffer_var_name,
+ " [[buffer(", convert_to_string(msl_options.shader_input_buffer_index), ")]]");
+ }
+ }
}
string CompilerMSL::entry_point_args_argument_buffer(bool append_comma)
@@ -11552,7 +12776,7 @@ string CompilerMSL::entry_point_args_argument_buffer(bool append_comma)
claimed_bindings.set(buffer_binding);
- ep_args += get_argument_address_space(var) + " " + type_to_glsl(type) + "& " + to_restrict(id) + to_name(id);
+ ep_args += get_argument_address_space(var) + " " + type_to_glsl(type) + "& " + to_restrict(id, true) + to_name(id);
ep_args += " [[buffer(" + convert_to_string(buffer_binding) + ")]]";
next_metal_resource_index_buffer = max(next_metal_resource_index_buffer, buffer_binding + 1);
@@ -11597,6 +12821,7 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
struct Resource
{
SPIRVariable *var;
+ SPIRVariable *descriptor_alias;
string name;
SPIRType::BaseType basetype;
uint32_t index;
@@ -11620,6 +12845,37 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
return;
}
+ // Handle descriptor aliasing. We can handle aliasing of buffers by casting pointers,
+ // but not for typed resources.
+ SPIRVariable *descriptor_alias = nullptr;
+ if (var.storage == StorageClassUniform || var.storage == StorageClassStorageBuffer)
+ {
+ for (auto &resource : resources)
+ {
+ if (get_decoration(resource.var->self, DecorationDescriptorSet) ==
+ get_decoration(var_id, DecorationDescriptorSet) &&
+ get_decoration(resource.var->self, DecorationBinding) ==
+ get_decoration(var_id, DecorationBinding) &&
+ resource.basetype == SPIRType::Struct && type.basetype == SPIRType::Struct &&
+ (resource.var->storage == StorageClassUniform ||
+ resource.var->storage == StorageClassStorageBuffer))
+ {
+ // Possible, but horrible to implement, ignore for now.
+ if (!type.array.empty())
+ SPIRV_CROSS_THROW("Aliasing arrayed discrete descriptors is currently not supported.");
+
+ descriptor_alias = resource.var;
+ // Self-reference marks that we should declare the resource,
+ // and it's being used as an alias (so we can emit void* instead).
+ resource.descriptor_alias = resource.var;
+ // Need to promote interlocked usage so that the primary declaration is correct.
+ if (interlocked_resources.count(var_id))
+ interlocked_resources.insert(resource.var->self);
+ break;
+ }
+ }
+ }
+
const MSLConstexprSampler *constexpr_sampler = nullptr;
if (type.basetype == SPIRType::SampledImage || type.basetype == SPIRType::Sampler)
{
@@ -11647,12 +12903,12 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
plane_count = constexpr_sampler->planes;
for (uint32_t i = 0; i < plane_count; i++)
- resources.push_back({ &var, to_name(var_id), SPIRType::Image,
+ resources.push_back({ &var, descriptor_alias, to_name(var_id), SPIRType::Image,
get_metal_resource_index(var, SPIRType::Image, i), i, secondary_index });
if (type.image.dim != DimBuffer && !constexpr_sampler)
{
- resources.push_back({ &var, to_sampler_expression(var_id), SPIRType::Sampler,
+ resources.push_back({ &var, descriptor_alias, to_sampler_expression(var_id), SPIRType::Sampler,
get_metal_resource_index(var, SPIRType::Sampler), 0, 0 });
}
}
@@ -11660,13 +12916,19 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
{
// constexpr samplers are not declared as resources.
add_resource_name(var_id);
- resources.push_back({ &var, to_name(var_id), type.basetype,
- get_metal_resource_index(var, type.basetype), 0, secondary_index });
+
+ // Don't allocate resource indices for aliases.
+ uint32_t resource_index = ~0u;
+ if (!descriptor_alias)
+ resource_index = get_metal_resource_index(var, type.basetype);
+
+ resources.push_back({ &var, descriptor_alias, to_name(var_id), type.basetype,
+ resource_index, 0, secondary_index });
}
}
});
- sort(resources.begin(), resources.end(), [](const Resource &lhs, const Resource &rhs) {
+ stable_sort(resources.begin(), resources.end(), [](const Resource &lhs, const Resource &rhs) {
return tie(lhs.basetype, lhs.index) < tie(rhs.basetype, rhs.index);
});
@@ -11684,7 +12946,29 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
auto &m = ir.meta[type.self];
if (m.members.size() == 0)
break;
- if (!type.array.empty())
+
+ if (r.descriptor_alias)
+ {
+ if (r.var == r.descriptor_alias)
+ {
+ auto primary_name = join("spvBufferAliasSet",
+ get_decoration(var_id, DecorationDescriptorSet),
+ "Binding",
+ get_decoration(var_id, DecorationBinding));
+
+ // Declare the primary alias as void*
+ if (!ep_args.empty())
+ ep_args += ", ";
+ ep_args += get_argument_address_space(var) + " void* " + primary_name;
+ ep_args += " [[buffer(" + convert_to_string(r.index) + ")";
+ if (interlocked_resources.count(var_id))
+ ep_args += ", raster_order_group(0)";
+ ep_args += "]]";
+ }
+
+ buffer_aliases_discrete.push_back(r.var->self);
+ }
+ else if (!type.array.empty())
{
if (type.array.size() > 1)
SPIRV_CROSS_THROW("Arrays of arrays of buffers are not supported.");
@@ -11699,12 +12983,12 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
// Allow Metal to use the array<T> template to make arrays a value type
is_using_builtin_array = true;
- buffer_arrays.push_back(var_id);
+ buffer_arrays_discrete.push_back(var_id);
for (uint32_t i = 0; i < array_size; ++i)
{
if (!ep_args.empty())
ep_args += ", ";
- ep_args += get_argument_address_space(var) + " " + type_to_glsl(type) + "* " + to_restrict(var_id) +
+ ep_args += get_argument_address_space(var) + " " + type_to_glsl(type) + "* " + to_restrict(var_id, true) +
r.name + "_" + convert_to_string(i);
ep_args += " [[buffer(" + convert_to_string(r.index + i) + ")";
if (interlocked_resources.count(var_id))
@@ -11718,7 +13002,7 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
if (!ep_args.empty())
ep_args += ", ";
ep_args +=
- get_argument_address_space(var) + " " + type_to_glsl(type) + "& " + to_restrict(var_id) + r.name;
+ get_argument_address_space(var) + " " + type_to_glsl(type) + "& " + to_restrict(var_id, true) + r.name;
ep_args += " [[buffer(" + convert_to_string(r.index) + ")";
if (interlocked_resources.count(var_id))
ep_args += ", raster_order_group(0)";
@@ -11769,6 +13053,10 @@ void CompilerMSL::entry_point_args_discrete_descriptors(string &ep_args)
}
break;
}
+ case SPIRType::AccelerationStructure:
+ ep_args += ", " + type_to_glsl(type, var_id) + " " + r.name;
+ ep_args += " [[buffer(" + convert_to_string(r.index) + ")]]";
+ break;
default:
if (!ep_args.empty())
ep_args += ", ";
@@ -11851,7 +13139,7 @@ void CompilerMSL::fix_up_shader_inputs_outputs()
else if ((var.storage == StorageClassStorageBuffer || (var.storage == StorageClassUniform && ssbo)) &&
!is_hidden_variable(var))
{
- if (buffers_requiring_array_length.count(var.self))
+ if (buffer_requires_array_length(var.self))
{
entry_func.fixup_hooks_in.push_back([this, &type, &var, var_id]() {
bool is_array_type = !type.array.empty();
@@ -11905,19 +13193,9 @@ void CompilerMSL::fix_up_shader_inputs_outputs()
});
}
break;
- case BuiltInHelperInvocation:
- if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 3))
- SPIRV_CROSS_THROW("simd_is_helper_thread() requires version 2.3 on iOS.");
- else if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 1))
- SPIRV_CROSS_THROW("simd_is_helper_thread() requires version 2.1 on macOS.");
-
- entry_func.fixup_hooks_in.push_back([=]() {
- statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = simd_is_helper_thread();");
- });
- break;
case BuiltInInvocationId:
// This is direct-mapped without multi-patch workgroups.
- if (get_execution_model() != ExecutionModelTessellationControl || !msl_options.multi_patch_workgroup)
+ if (!is_tesc_shader() || !msl_options.multi_patch_workgroup)
break;
entry_func.fixup_hooks_in.push_back([=]() {
@@ -11929,7 +13207,7 @@ void CompilerMSL::fix_up_shader_inputs_outputs()
case BuiltInPrimitiveId:
// This is natively supported by fragment and tessellation evaluation shaders.
// In tessellation control shaders, this is direct-mapped without multi-patch workgroups.
- if (get_execution_model() != ExecutionModelTessellationControl || !msl_options.multi_patch_workgroup)
+ if (!is_tesc_shader() || !msl_options.multi_patch_workgroup)
break;
entry_func.fixup_hooks_in.push_back([=]() {
@@ -11939,7 +13217,7 @@ void CompilerMSL::fix_up_shader_inputs_outputs()
});
break;
case BuiltInPatchVertices:
- if (get_execution_model() == ExecutionModelTessellationEvaluation)
+ if (is_tese_shader())
entry_func.fixup_hooks_in.push_back([=]() {
statement(builtin_type_decl(bi_type), " ", to_expression(var_id), " = ",
to_expression(patch_stage_in_var_id), ".gl_in.size();");
@@ -11950,9 +13228,19 @@ void CompilerMSL::fix_up_shader_inputs_outputs()
});
break;
case BuiltInTessCoord:
+ if (get_entry_point().flags.get(ExecutionModeQuads))
+ {
+ // The entry point will only have a float2 TessCoord variable.
+ // Pad to float3.
+ entry_func.fixup_hooks_in.push_back([=]() {
+ auto name = builtin_to_glsl(BuiltInTessCoord, StorageClassInput);
+ statement("float3 " + name + " = float3(" + name + "In.x, " + name + "In.y, 0.0);");
+ });
+ }
+
// Emit a fixup to account for the shifted domain. Don't do this for triangles;
// MoltenVK will just reverse the winding order instead.
- if (msl_options.tess_domain_origin_lower_left && !get_entry_point().flags.get(ExecutionModeTriangles))
+ if (msl_options.tess_domain_origin_lower_left && !is_tessellating_triangles())
{
string tc = to_expression(var_id);
entry_func.fixup_hooks_in.push_back([=]() { statement(tc, ".y = 1.0 - ", tc, ".y;"); });
@@ -12505,6 +13793,39 @@ bool CompilerMSL::type_is_pointer_to_pointer(const SPIRType &type) const
return type.pointer_depth > parent_type.pointer_depth && type_is_pointer(parent_type);
}
+const char *CompilerMSL::descriptor_address_space(uint32_t id, StorageClass storage, const char *plain_address_space) const
+{
+ if (msl_options.argument_buffers)
+ {
+ bool storage_class_is_descriptor = storage == StorageClassUniform ||
+ storage == StorageClassStorageBuffer ||
+ storage == StorageClassUniformConstant;
+
+ uint32_t desc_set = get_decoration(id, DecorationDescriptorSet);
+ if (storage_class_is_descriptor && descriptor_set_is_argument_buffer(desc_set))
+ {
+ // An awkward case where we need to emit *more* address space declarations (yay!).
+ // An example is where we pass down an array of buffer pointers to leaf functions.
+ // It's a constant array containing pointers to constants.
+ // The pointer array is always constant however. E.g.
+ // device SSBO * constant (&array)[N].
+ // const device SSBO * constant (&array)[N].
+ // constant SSBO * constant (&array)[N].
+ // However, this only matters for argument buffers, since for MSL 1.0 style codegen,
+ // we emit the buffer array on stack instead, and that seems to work just fine apparently.
+
+ // If the argument was marked as being in device address space, any pointer to member would
+ // be const device, not constant.
+ if (argument_buffer_device_storage_mask & (1u << desc_set))
+ return "const device";
+ else
+ return "constant";
+ }
+ }
+
+ return plain_address_space;
+}
+
string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg)
{
auto &var = get<SPIRVariable>(arg.id);
@@ -12523,15 +13844,14 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg)
// Framebuffer fetch is plain value, const looks out of place, but it is not wrong.
if (type_is_msl_framebuffer_fetch(type))
constref = false;
+ else if (type_storage == StorageClassUniformConstant)
+ constref = true;
bool type_is_image = type.basetype == SPIRType::Image || type.basetype == SPIRType::SampledImage ||
type.basetype == SPIRType::Sampler;
- // Arrays of images/samplers in MSL are always const.
- if (!type.array.empty() && type_is_image)
- constref = true;
-
- const char *cv_qualifier = constref ? "const " : "";
+ // For opaque types we handle const later due to descriptor address spaces.
+ const char *cv_qualifier = (constref && !type_is_image) ? "const " : "";
string decl;
// If this is a combined image-sampler for a 2D image with floating-point type,
@@ -12603,9 +13923,7 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg)
decl = join(cv_qualifier, type_to_glsl(type, arg.id));
}
- bool opaque_handle = type_storage == StorageClassUniformConstant;
-
- if (!builtin && !opaque_handle && !is_pointer &&
+ if (!builtin && !is_pointer &&
(type_storage == StorageClassFunction || type_storage == StorageClassGeneric))
{
// If the argument is a pure value and not an opaque type, we will pass by value.
@@ -12620,7 +13938,7 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg)
// non-constant arrays, but we can create thread const from constant.
decl = string("thread const ") + decl;
decl += " (&";
- const char *restrict_kw = to_restrict(name_id);
+ const char *restrict_kw = to_restrict(name_id, true);
if (*restrict_kw)
{
decl += " ";
@@ -12640,37 +13958,19 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg)
}
else if (is_array(type) && !type_is_image)
{
- // Arrays of images and samplers are special cased.
+ // Arrays of opaque types are special cased.
if (!address_space.empty())
decl = join(address_space, " ", decl);
- if (msl_options.argument_buffers)
+ const char *argument_buffer_space = descriptor_address_space(name_id, type_storage, nullptr);
+ if (argument_buffer_space)
{
- uint32_t desc_set = get_decoration(name_id, DecorationDescriptorSet);
- if ((type_storage == StorageClassUniform || type_storage == StorageClassStorageBuffer) &&
- descriptor_set_is_argument_buffer(desc_set))
- {
- // An awkward case where we need to emit *more* address space declarations (yay!).
- // An example is where we pass down an array of buffer pointers to leaf functions.
- // It's a constant array containing pointers to constants.
- // The pointer array is always constant however. E.g.
- // device SSBO * constant (&array)[N].
- // const device SSBO * constant (&array)[N].
- // constant SSBO * constant (&array)[N].
- // However, this only matters for argument buffers, since for MSL 1.0 style codegen,
- // we emit the buffer array on stack instead, and that seems to work just fine apparently.
-
- // If the argument was marked as being in device address space, any pointer to member would
- // be const device, not constant.
- if (argument_buffer_device_storage_mask & (1u << desc_set))
- decl += " const device";
- else
- decl += " constant";
- }
+ decl += " ";
+ decl += argument_buffer_space;
}
// Special case, need to override the array size here if we're using tess level as an argument.
- if (get_execution_model() == ExecutionModelTessellationControl && builtin &&
+ if (is_tesc_shader() && builtin &&
(builtin_type == BuiltInTessLevelInner || builtin_type == BuiltInTessLevelOuter))
{
uint32_t array_size = get_physical_tess_level_array_size(builtin_type);
@@ -12695,7 +13995,7 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg)
else
decl += " (&";
- const char *restrict_kw = to_restrict(name_id);
+ const char *restrict_kw = to_restrict(name_id, true);
if (*restrict_kw)
{
decl += " ";
@@ -12710,7 +14010,7 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg)
}
}
}
- else if (!opaque_handle && (!pull_model_inputs.count(var.basevariable) || type.basetype == SPIRType::Struct))
+ else if (!type_is_image && (!pull_model_inputs.count(var.basevariable) || type.basetype == SPIRType::Struct))
{
// If this is going to be a reference to a variable pointer, the address space
// for the reference has to go before the '&', but after the '*'.
@@ -12727,9 +14027,30 @@ string CompilerMSL::argument_decl(const SPIRFunction::Parameter &arg)
}
decl += "&";
decl += " ";
- decl += to_restrict(name_id);
+ decl += to_restrict(name_id, true);
decl += to_expression(name_id);
}
+ else if (type_is_image)
+ {
+ if (type.array.empty())
+ {
+ // For non-arrayed types we can just pass opaque descriptors by value.
+ // This fixes problems if descriptors are passed by value from argument buffers and plain descriptors
+ // in same shader.
+ // There is no address space we can actually use, but value will work.
+ // This will break if applications attempt to pass down descriptor arrays as arguments, but
+ // fortunately that is extremely unlikely ...
+ decl += " ";
+ decl += to_expression(name_id);
+ }
+ else
+ {
+ const char *img_address_space = descriptor_address_space(name_id, type_storage, "thread const");
+ decl = join(img_address_space, " ", decl);
+ decl += "& ";
+ decl += to_expression(name_id);
+ }
+ }
else
{
if (!address_space.empty())
@@ -12764,8 +14085,8 @@ string CompilerMSL::to_name(uint32_t id, bool allow_alias) const
return Compiler::to_name(id, allow_alias);
}
-// Returns a name that combines the name of the struct with the name of the member, except for Builtins
-string CompilerMSL::to_qualified_member_name(const SPIRType &type, uint32_t index)
+// Appends the name of the member to the variable qualifier string, except for Builtins.
+string CompilerMSL::append_member_name(const string &qualifier, const SPIRType &type, uint32_t index)
{
// Don't qualify Builtin names because they are unique and are treated as such when building expressions
BuiltIn builtin = BuiltInMax;
@@ -12776,7 +14097,7 @@ string CompilerMSL::to_qualified_member_name(const SPIRType &type, uint32_t inde
string mbr_name = to_member_name(type, index);
size_t startPos = mbr_name.find_first_not_of("_");
mbr_name = (startPos != string::npos) ? mbr_name.substr(startPos) : "";
- return join(to_name(type.self), "_", mbr_name);
+ return join(qualifier, "_", mbr_name);
}
// Ensures that the specified name is permanently usable by prepending a prefix
@@ -12793,6 +14114,8 @@ const std::unordered_set<std::string> &CompilerMSL::get_reserved_keyword_set()
"vertex",
"fragment",
"compute",
+ "constant",
+ "device",
"bias",
"level",
"gradient2d",
@@ -12919,6 +14242,8 @@ const std::unordered_set<std::string> &CompilerMSL::get_reserved_keyword_set()
"M_SQRT2",
"M_SQRT1_2",
"quad_broadcast",
+ "thread",
+ "threadgroup",
};
return keywords;
@@ -13120,12 +14445,9 @@ void CompilerMSL::sync_entry_point_aliases_and_names()
entry.second.name = ir.meta[entry.first].decoration.alias;
}
-string CompilerMSL::to_member_reference(uint32_t base, const SPIRType &type, uint32_t index, bool ptr_chain)
+string CompilerMSL::to_member_reference(uint32_t base, const SPIRType &type, uint32_t index, bool ptr_chain_is_resolved)
{
- if (index < uint32_t(type.member_type_index_redirection.size()))
- index = type.member_type_index_redirection[index];
-
- auto *var = maybe_get<SPIRVariable>(base);
+ auto *var = maybe_get_backing_variable(base);
// If this is a buffer array, we have to dereference the buffer pointers.
// Otherwise, if this is a pointer expression, dereference it.
@@ -13142,7 +14464,7 @@ string CompilerMSL::to_member_reference(uint32_t base, const SPIRType &type, uin
declared_as_pointer = is_buffer_variable && is_array(get<SPIRType>(var->basetype));
}
- if (declared_as_pointer || (!ptr_chain && should_dereference(base)))
+ if (declared_as_pointer || (!ptr_chain_is_resolved && should_dereference(base)))
return join("->", to_member_name(type, index));
else
return join(".", to_member_name(type, index));
@@ -13164,7 +14486,7 @@ string CompilerMSL::to_qualifiers_glsl(uint32_t id)
// The optional id parameter indicates the object whose type we are trying
// to find the description for. It is optional. Most type descriptions do not
// depend on a specific object's use of that type.
-string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id)
+string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id, bool member)
{
string type_name;
@@ -13176,7 +14498,7 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id)
const char *restrict_kw;
auto type_address_space = get_type_address_space(type, id);
- auto type_decl = type_to_glsl(get<SPIRType>(type.parent_type), id);
+ const auto *p_parent_type = &get<SPIRType>(type.parent_type);
// Work around C pointer qualifier rules. If glsl_type is a pointer type as well
// we'll need to emit the address space to the right.
@@ -13184,9 +14506,16 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id)
// Prefer emitting thread T *foo over T thread* foo since it's more readable,
// but we'll have to emit thread T * thread * T constant bar; for example.
if (type_is_pointer_to_pointer(type))
- type_name = join(type_decl, " ", type_address_space, " ");
+ type_name = join(type_to_glsl(*p_parent_type, id), " ", type_address_space, " ");
else
- type_name = join(type_address_space, " ", type_decl);
+ {
+ // Since this is not a pointer-to-pointer, ensure we've dug down to the base type.
+ // Some situations chain pointers even though they are not formally pointers-of-pointers.
+ while (type_is_pointer(*p_parent_type))
+ p_parent_type = &get<SPIRType>(p_parent_type->parent_type);
+
+ type_name = join(type_address_space, " ", type_to_glsl(*p_parent_type, id));
+ }
switch (type.basetype)
{
@@ -13198,7 +14527,7 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id)
default:
// Anything else can be a raw pointer.
type_name += "*";
- restrict_kw = to_restrict(id);
+ restrict_kw = to_restrict(id, false);
if (*restrict_kw)
{
type_name += " ";
@@ -13239,8 +14568,21 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id)
// Scalars
case SPIRType::Boolean:
- type_name = "bool";
+ {
+ auto *var = maybe_get_backing_variable(id);
+ if (var && var->basevariable)
+ var = &get<SPIRVariable>(var->basevariable);
+
+ // Need to special-case threadgroup booleans. They are supposed to be logical
+ // storage, but MSL compilers will sometimes crash if you use threadgroup bool.
+ // Workaround this by using 16-bit types instead and fixup on load-store to this data.
+ if ((var && var->storage == StorageClassWorkgroup) || type.storage == StorageClassWorkgroup || member)
+ type_name = "short";
+ else
+ type_name = "bool";
break;
+ }
+
case SPIRType::Char:
case SPIRType::SByte:
type_name = "char";
@@ -13279,6 +14621,16 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id)
case SPIRType::Double:
type_name = "double"; // Currently unsupported
break;
+ case SPIRType::AccelerationStructure:
+ if (msl_options.supports_msl_version(2, 4))
+ type_name = "raytracing::acceleration_structure<raytracing::instancing>";
+ else if (msl_options.supports_msl_version(2, 3))
+ type_name = "raytracing::instance_acceleration_structure";
+ else
+ SPIRV_CROSS_THROW("Acceleration Structure Type is supported in MSL 2.3 and above.");
+ break;
+ case SPIRType::RayQuery:
+ return "raytracing::intersection_query<raytracing::instancing, raytracing::triangle_data>";
default:
return "unknown_type";
@@ -13286,7 +14638,24 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id)
// Matrix?
if (type.columns > 1)
+ {
+ auto *var = maybe_get_backing_variable(id);
+ if (var && var->basevariable)
+ var = &get<SPIRVariable>(var->basevariable);
+
+ // Need to special-case threadgroup matrices. Due to an oversight, Metal's
+ // matrix struct prior to Metal 3 lacks constructors in the threadgroup AS,
+ // preventing us from default-constructing or initializing matrices in threadgroup storage.
+ // Work around this by using our own type as storage.
+ if (((var && var->storage == StorageClassWorkgroup) || type.storage == StorageClassWorkgroup) &&
+ !msl_options.supports_msl_version(3, 0))
+ {
+ add_spv_func_and_recompile(SPVFuncImplStorageMatrix);
+ type_name = "spvStorage_" + type_name;
+ }
+
type_name += to_string(type.columns) + "x";
+ }
// Vector or Matrix?
if (type.vecsize > 1)
@@ -13316,6 +14685,11 @@ string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id)
}
}
+string CompilerMSL::type_to_glsl(const SPIRType &type, uint32_t id)
+{
+ return type_to_glsl(type, id, false);
+}
+
string CompilerMSL::type_to_array_glsl(const SPIRType &type)
{
// Allow Metal to use the array<T> template to make arrays a value type
@@ -13323,46 +14697,24 @@ string CompilerMSL::type_to_array_glsl(const SPIRType &type)
{
case SPIRType::AtomicCounter:
case SPIRType::ControlPointArray:
- {
+ case SPIRType::RayQuery:
return CompilerGLSL::type_to_array_glsl(type);
- }
+
default:
- {
- if (using_builtin_array())
+ if (type_is_array_of_pointers(type) || using_builtin_array())
return CompilerGLSL::type_to_array_glsl(type);
else
return "";
}
- }
}
string CompilerMSL::constant_op_expression(const SPIRConstantOp &cop)
{
- auto &type = get<SPIRType>(cop.basetype);
- string op;
-
switch (cop.opcode)
{
case OpQuantizeToF16:
- switch (type.vecsize)
- {
- case 1:
- op = "float(half(";
- break;
- case 2:
- op = "float2(half2(";
- break;
- case 3:
- op = "float3(half3(";
- break;
- case 4:
- op = "float4(half4(";
- break;
- default:
- SPIRV_CROSS_THROW("Illegal argument to OpSpecConstantOp QuantizeToF16.");
- }
- return join(op, to_expression(cop.arguments[0]), "))");
-
+ add_spv_func_and_recompile(SPVFuncImplQuantizeToF16);
+ return join("spvQuantizeToF16(", to_expression(cop.arguments[0]), ")");
default:
return CompilerGLSL::constant_op_expression(cop);
}
@@ -13375,23 +14727,25 @@ bool CompilerMSL::variable_decl_is_remapped_storage(const SPIRVariable &variable
if (storage == StorageClassWorkgroup)
{
- auto model = get_execution_model();
-
// Specially masked IO block variable.
// Normally, we will never access IO blocks directly here.
// The only scenario which that should occur is with a masked IO block.
- if (model == ExecutionModelTessellationControl && variable.storage == StorageClassOutput &&
+ if (is_tesc_shader() && variable.storage == StorageClassOutput &&
has_decoration(get<SPIRType>(variable.basetype).self, DecorationBlock))
{
return true;
}
- return variable.storage == StorageClassOutput &&
- model == ExecutionModelTessellationControl &&
- is_stage_output_variable_masked(variable);
+ return variable.storage == StorageClassOutput && is_tesc_shader() && is_stage_output_variable_masked(variable);
}
else if (storage == StorageClassStorageBuffer)
{
+ // These builtins are passed directly; we don't want to use remapping
+ // for them.
+ auto builtin = (BuiltIn)get_decoration(variable.self, DecorationBuiltIn);
+ if (is_tese_shader() && is_builtin_variable(variable) && (builtin == BuiltInTessCoord || builtin == BuiltInPrimitiveId))
+ return false;
+
// We won't be able to catch writes to control point outputs here since variable
// refers to a function local pointer.
// This is fine, as there cannot be concurrent writers to that memory anyways,
@@ -13415,7 +14769,7 @@ std::string CompilerMSL::variable_decl(const SPIRVariable &variable)
if (variable_decl_is_remapped_storage(variable, StorageClassWorkgroup))
is_using_builtin_array = true;
- std::string expr = CompilerGLSL::variable_decl(variable);
+ auto expr = CompilerGLSL::variable_decl(variable);
is_using_builtin_array = old_is_using_builtin_array;
return expr;
}
@@ -13506,7 +14860,7 @@ string CompilerMSL::image_type_glsl(const SPIRType &type, uint32_t id)
// Bypass pointers because we need the real image struct
auto &img_type = get<SPIRType>(type.self).image;
- if (image_is_comparison(type, id))
+ if (is_depth_image(type, id))
{
switch (img_type.dim)
{
@@ -13751,7 +15105,7 @@ void CompilerMSL::emit_subgroup_op(const Instruction &i)
switch (op)
{
case OpGroupNonUniformElect:
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
emit_op(result_type, id, "quad_is_first()", false);
else
emit_op(result_type, id, "simd_is_first()", false);
@@ -13824,14 +15178,14 @@ void CompilerMSL::emit_subgroup_op(const Instruction &i)
break;
case OpGroupNonUniformAll:
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
emit_unary_func_op(result_type, id, ops[3], "quad_all");
else
emit_unary_func_op(result_type, id, ops[3], "simd_all");
break;
case OpGroupNonUniformAny:
- if (msl_options.is_ios() && !msl_options.ios_use_simdgroup_functions)
+ if (msl_options.use_quadgroup_operation())
emit_unary_func_op(result_type, id, ops[3], "quad_any");
else
emit_unary_func_op(result_type, id, ops[3], "simd_any");
@@ -13965,17 +15319,14 @@ string CompilerMSL::bitcast_glsl_op(const SPIRType &out_type, const SPIRType &in
// size (eg. short shift right becomes int), which means chaining integer ops
// together may introduce size variations that SPIR-V doesn't know about.
if (same_size_cast && !integral_cast)
- {
return "as_type<" + type_to_glsl(out_type) + ">";
- }
else
- {
return type_to_glsl(out_type);
- }
}
bool CompilerMSL::emit_complex_bitcast(uint32_t, uint32_t, uint32_t)
{
+ // This is handled from the outside where we deal with PtrToU/UToPtr and friends.
return false;
}
@@ -14114,7 +15465,7 @@ string CompilerMSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage)
case BuiltInClipDistance:
case BuiltInCullDistance:
case BuiltInLayer:
- if (get_execution_model() == ExecutionModelTessellationControl)
+ if (is_tesc_shader())
break;
if (storage != StorageClassInput && current_function && (current_function->self == ir.default_entry_point) &&
!is_stage_output_builtin_masked(builtin))
@@ -14139,15 +15490,15 @@ string CompilerMSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage)
return stage_out_var_name + "." + CompilerGLSL::builtin_to_glsl(builtin, storage);
break;
- case BuiltInBaryCoordNV:
- case BuiltInBaryCoordNoPerspNV:
+ case BuiltInBaryCoordKHR:
+ case BuiltInBaryCoordNoPerspKHR:
if (storage == StorageClassInput && current_function && (current_function->self == ir.default_entry_point))
return stage_in_var_name + "." + CompilerGLSL::builtin_to_glsl(builtin, storage);
break;
case BuiltInTessLevelOuter:
- if (get_execution_model() == ExecutionModelTessellationControl &&
- storage != StorageClassInput && current_function && (current_function->self == ir.default_entry_point))
+ if (is_tesc_shader() && storage != StorageClassInput && current_function &&
+ (current_function->self == ir.default_entry_point))
{
return join(tess_factor_buffer_var_name, "[", to_expression(builtin_primitive_id_id),
"].edgeTessellationFactor");
@@ -14155,14 +15506,24 @@ string CompilerMSL::builtin_to_glsl(BuiltIn builtin, StorageClass storage)
break;
case BuiltInTessLevelInner:
- if (get_execution_model() == ExecutionModelTessellationControl &&
- storage != StorageClassInput && current_function && (current_function->self == ir.default_entry_point))
+ if (is_tesc_shader() && storage != StorageClassInput && current_function &&
+ (current_function->self == ir.default_entry_point))
{
return join(tess_factor_buffer_var_name, "[", to_expression(builtin_primitive_id_id),
"].insideTessellationFactor");
}
break;
+ case BuiltInHelperInvocation:
+ if (needs_manual_helper_invocation_updates())
+ break;
+ if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 3))
+ SPIRV_CROSS_THROW("simd_is_helper_thread() requires version 2.3 on iOS.");
+ else if (msl_options.is_macos() && !msl_options.supports_msl_version(2, 1))
+ SPIRV_CROSS_THROW("simd_is_helper_thread() requires version 2.1 on macOS.");
+ // In SPIR-V 1.6 with Volatile HelperInvocation, we cannot emit a fixup early.
+ return "simd_is_helper_thread()";
+
default:
break;
}
@@ -14329,7 +15690,7 @@ string CompilerMSL::builtin_qualifier(BuiltIn builtin)
SPIRV_CROSS_THROW("NumSubgroups is handled specially with emulation.");
if (!msl_options.supports_msl_version(2))
SPIRV_CROSS_THROW("Subgroup builtins require Metal 2.0.");
- return msl_options.is_ios() ? "quadgroups_per_threadgroup" : "simdgroups_per_threadgroup";
+ return msl_options.use_quadgroup_operation() ? "quadgroups_per_threadgroup" : "simdgroups_per_threadgroup";
case BuiltInSubgroupId:
if (msl_options.emulate_subgroups)
@@ -14337,7 +15698,7 @@ string CompilerMSL::builtin_qualifier(BuiltIn builtin)
SPIRV_CROSS_THROW("SubgroupId is handled specially with emulation.");
if (!msl_options.supports_msl_version(2))
SPIRV_CROSS_THROW("Subgroup builtins require Metal 2.0.");
- return msl_options.is_ios() ? "quadgroup_index_in_threadgroup" : "simdgroup_index_in_threadgroup";
+ return msl_options.use_quadgroup_operation() ? "quadgroup_index_in_threadgroup" : "simdgroup_index_in_threadgroup";
case BuiltInSubgroupLocalInvocationId:
if (msl_options.emulate_subgroups)
@@ -14356,7 +15717,7 @@ string CompilerMSL::builtin_qualifier(BuiltIn builtin)
// We are generating a Metal kernel function.
if (!msl_options.supports_msl_version(2))
SPIRV_CROSS_THROW("Subgroup builtins in kernel functions require Metal 2.0.");
- return msl_options.is_ios() ? "thread_index_in_quadgroup" : "thread_index_in_simdgroup";
+ return msl_options.use_quadgroup_operation() ? "thread_index_in_quadgroup" : "thread_index_in_simdgroup";
}
else
SPIRV_CROSS_THROW("Subgroup builtins are not available in this type of function.");
@@ -14369,16 +15730,14 @@ string CompilerMSL::builtin_qualifier(BuiltIn builtin)
// Shouldn't be reached.
SPIRV_CROSS_THROW("Subgroup ballot masks are handled specially in MSL.");
- case BuiltInBaryCoordNV:
- // TODO: AMD barycentrics as well? Seem to have different swizzle and 2 components rather than 3.
+ case BuiltInBaryCoordKHR:
if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 3))
SPIRV_CROSS_THROW("Barycentrics are only supported in MSL 2.3 and above on iOS.");
else if (!msl_options.supports_msl_version(2, 2))
SPIRV_CROSS_THROW("Barycentrics are only supported in MSL 2.2 and above on macOS.");
return "barycentric_coord, center_perspective";
- case BuiltInBaryCoordNoPerspNV:
- // TODO: AMD barycentrics as well? Seem to have different swizzle and 2 components rather than 3.
+ case BuiltInBaryCoordNoPerspKHR:
if (msl_options.is_ios() && !msl_options.supports_msl_version(2, 3))
SPIRV_CROSS_THROW("Barycentrics are only supported in MSL 2.3 and above on iOS.");
else if (!msl_options.supports_msl_version(2, 2))
@@ -14393,7 +15752,6 @@ string CompilerMSL::builtin_qualifier(BuiltIn builtin)
// Returns an MSL string type declaration for a SPIR-V builtin
string CompilerMSL::builtin_type_decl(BuiltIn builtin, uint32_t id)
{
- const SPIREntryPoint &execution = get_entry_point();
switch (builtin)
{
// Vertex function in
@@ -14437,17 +15795,17 @@ string CompilerMSL::builtin_type_decl(BuiltIn builtin, uint32_t id)
// Tess. control function out
case BuiltInTessLevelInner:
- if (execution.model == ExecutionModelTessellationEvaluation)
- return !execution.flags.get(ExecutionModeTriangles) ? "float2" : "float";
+ if (is_tese_shader())
+ return (msl_options.raw_buffer_tese_input || is_tessellating_triangles()) ? "float" : "float2";
return "half";
case BuiltInTessLevelOuter:
- if (execution.model == ExecutionModelTessellationEvaluation)
- return !execution.flags.get(ExecutionModeTriangles) ? "float4" : "float";
+ if (is_tese_shader())
+ return (msl_options.raw_buffer_tese_input || is_tessellating_triangles()) ? "float" : "float4";
return "half";
// Tess. evaluation function in
case BuiltInTessCoord:
- return execution.flags.get(ExecutionModeTriangles) ? "float3" : "float2";
+ return "float3";
// Fragment function in
case BuiltInFrontFacing:
@@ -14468,8 +15826,8 @@ string CompilerMSL::builtin_type_decl(BuiltIn builtin, uint32_t id)
case BuiltInHelperInvocation:
return "bool";
- case BuiltInBaryCoordNV:
- case BuiltInBaryCoordNoPerspNV:
+ case BuiltInBaryCoordKHR:
+ case BuiltInBaryCoordNoPerspKHR:
// Use the type as declared, can be 1, 2 or 3 components.
return type_to_glsl(get_variable_data_type(get<SPIRVariable>(id)));
@@ -14536,11 +15894,11 @@ SPIRType CompilerMSL::get_presumed_input_type(const SPIRType &ib_type, uint32_t
{
SPIRType type = get_physical_member_type(ib_type, index);
uint32_t loc = get_member_decoration(ib_type.self, index, DecorationLocation);
- if (inputs_by_location.count(loc))
- {
- if (inputs_by_location.at(loc).vecsize > type.vecsize)
- type.vecsize = inputs_by_location.at(loc).vecsize;
- }
+ uint32_t cmp = get_member_decoration(ib_type.self, index, DecorationComponent);
+ auto p_va = inputs_by_location.find({loc, cmp});
+ if (p_va != end(inputs_by_location) && p_va->second.vecsize > type.vecsize)
+ type.vecsize = p_va->second.vecsize;
+
return type;
}
@@ -14643,6 +16001,25 @@ uint32_t CompilerMSL::get_declared_struct_size_msl(const SPIRType &struct_type,
// Returns the byte size of a struct member.
uint32_t CompilerMSL::get_declared_type_size_msl(const SPIRType &type, bool is_packed, bool row_major) const
{
+ // Pointers take 8 bytes each
+ if (type.pointer && type.storage == StorageClassPhysicalStorageBuffer)
+ {
+ uint32_t type_size = 8 * (type.vecsize == 3 ? 4 : type.vecsize);
+
+ // Work our way through potentially layered arrays,
+ // stopping when we hit a pointer that is not also an array.
+ int32_t dim_idx = (int32_t)type.array.size() - 1;
+ auto *p_type = &type;
+ while (!type_is_pointer(*p_type) && dim_idx >= 0)
+ {
+ type_size *= to_array_size_literal(*p_type, dim_idx);
+ p_type = &get<SPIRType>(p_type->parent_type);
+ dim_idx--;
+ }
+
+ return type_size;
+ }
+
switch (type.basetype)
{
case SPIRType::Unknown:
@@ -14702,6 +16079,10 @@ uint32_t CompilerMSL::get_declared_input_size_msl(const SPIRType &type, uint32_t
// Returns the byte alignment of a type.
uint32_t CompilerMSL::get_declared_type_alignment_msl(const SPIRType &type, bool is_packed, bool row_major) const
{
+ // Pointers aligns on multiples of 8 bytes
+ if (type.pointer && type.storage == StorageClassPhysicalStorageBuffer)
+ return 8 * (type.vecsize == 3 ? 4 : type.vecsize);
+
switch (type.basetype)
{
case SPIRType::Unknown:
@@ -14849,6 +16230,10 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui
suppress_missing_prototypes = true;
break;
+ case OpDemoteToHelperInvocationEXT:
+ uses_discard = true;
+ break;
+
// Emulate texture2D atomic operations
case OpImageTexelPointer:
{
@@ -14858,8 +16243,7 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui
}
case OpImageWrite:
- if (!compiler.msl_options.supports_msl_version(2, 2))
- uses_resource_write = true;
+ uses_image_write = true;
break;
case OpStore:
@@ -14886,9 +16270,11 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui
auto it = image_pointers.find(args[2]);
if (it != image_pointers.end())
{
+ uses_image_write = true;
compiler.atomic_image_vars.insert(it->second);
}
- check_resource_write(args[2]);
+ else
+ check_resource_write(args[2]);
break;
}
@@ -14899,8 +16285,10 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui
if (it != image_pointers.end())
{
compiler.atomic_image_vars.insert(it->second);
+ uses_image_write = true;
}
- check_resource_write(args[0]);
+ else
+ check_resource_write(args[0]);
break;
}
@@ -15003,6 +16391,11 @@ bool CompilerMSL::OpCodePreprocessor::handle(Op opcode, const uint32_t *args, ui
break;
}
+ case OpIsHelperInvocationEXT:
+ if (compiler.needs_manual_helper_invocation_updates())
+ needs_helper_invocation = true;
+ break;
+
default:
break;
}
@@ -15020,9 +16413,8 @@ void CompilerMSL::OpCodePreprocessor::check_resource_write(uint32_t var_id)
{
auto *p_var = compiler.maybe_get_backing_variable(var_id);
StorageClass sc = p_var ? p_var->storage : StorageClassMax;
- if (!compiler.msl_options.supports_msl_version(2, 1) &&
- (sc == StorageClassUniform || sc == StorageClassStorageBuffer))
- uses_resource_write = true;
+ if (sc == StorageClassUniform || sc == StorageClassStorageBuffer)
+ uses_buffer_write = true;
}
// Returns an enumeration of a SPIR-V function that needs to be output for certain Op codes.
@@ -15054,6 +16446,9 @@ CompilerMSL::SPVFuncImpl CompilerMSL::OpCodePreprocessor::get_spv_func_impl(Op o
}
break;
+ case OpQuantizeToF16:
+ return SPVFuncImplQuantizeToF16;
+
case OpTypeArray:
{
// Allow Metal to use the array<T> template to make arrays a value type
@@ -15253,11 +16648,13 @@ void CompilerMSL::MemberSorter::sort()
meta.members[mbr_idx] = mbr_meta_cpy[mbr_idxs[mbr_idx]];
}
+ // If we're sorting by Offset, this might affect user code which accesses a buffer block.
+ // We will need to redirect member indices from defined index to sorted index using reverse lookup.
if (sort_aspect == SortAspect::Offset)
{
- // If we're sorting by Offset, this might affect user code which accesses a buffer block.
- // We will need to redirect member indices from one index to sorted index.
- type.member_type_index_redirection = std::move(mbr_idxs);
+ type.member_type_index_redirection.resize(mbr_cnt);
+ for (uint32_t map_idx = 0; map_idx < mbr_cnt; map_idx++)
+ type.member_type_index_redirection[mbr_idxs[map_idx]] = map_idx;
}
}
@@ -15307,15 +16704,56 @@ void CompilerMSL::remap_constexpr_sampler_by_binding(uint32_t desc_set, uint32_t
constexpr_samplers_by_binding[{ desc_set, binding }] = sampler;
}
-void CompilerMSL::cast_from_builtin_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type)
+void CompilerMSL::cast_from_variable_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type)
{
+ bool is_packed = has_extended_decoration(source_id, SPIRVCrossDecorationPhysicalTypePacked);
+ auto *source_expr = maybe_get<SPIRExpression>(source_id);
auto *var = maybe_get_backing_variable(source_id);
+ const SPIRType *var_type, *phys_type;
+ if (uint32_t phys_id = get_extended_decoration(source_id, SPIRVCrossDecorationPhysicalTypeID))
+ phys_type = &get<SPIRType>(phys_id);
+ else
+ phys_type = &expr_type;
if (var)
+ {
source_id = var->self;
-
- // Only interested in standalone builtin variables.
+ var_type = &get_variable_data_type(*var);
+ }
+
+ // Type fixups for workgroup variables if they are booleans.
+ if (var && (var->storage == StorageClassWorkgroup || var_type->basetype == SPIRType::Struct) &&
+ expr_type.basetype == SPIRType::Boolean)
+ expr = join(type_to_glsl(expr_type), "(", expr, ")");
+ // Type fixups for workgroup variables if they are matrices.
+ // Don't do fixup for packed types; those are handled specially.
+ // FIXME: Maybe use a type like spvStorageMatrix for packed matrices?
+ if (!msl_options.supports_msl_version(3, 0) && var &&
+ (var->storage == StorageClassWorkgroup ||
+ (var_type->basetype == SPIRType::Struct &&
+ has_extended_decoration(var_type->self, SPIRVCrossDecorationWorkgroupStruct) && !is_packed)) &&
+ expr_type.columns > 1)
+ {
+ SPIRType matrix_type = *phys_type;
+ if (source_expr && source_expr->need_transpose)
+ swap(matrix_type.vecsize, matrix_type.columns);
+ matrix_type.array.clear();
+ matrix_type.array_size_literal.clear();
+ expr = join(type_to_glsl(matrix_type), "(", expr, ")");
+ }
+
+ // Only interested in standalone builtin variables in the switch below.
if (!has_decoration(source_id, DecorationBuiltIn))
+ {
+ // If the backing variable does not match our expected sign, we can fix it up here.
+ // See ensure_correct_input_type().
+ if (var && var->storage == StorageClassInput)
+ {
+ auto &base_type = get<SPIRType>(var->basetype);
+ if (base_type.basetype != SPIRType::Struct && expr_type.basetype != base_type.basetype)
+ expr = join(type_to_glsl(expr_type), "(", expr, ")");
+ }
return;
+ }
auto builtin = static_cast<BuiltIn>(get_decoration(source_id, DecorationBuiltIn));
auto expected_type = expr_type.basetype;
@@ -15345,7 +16783,7 @@ void CompilerMSL::cast_from_builtin_load(uint32_t source_id, std::string &expr,
case BuiltInTessLevelInner:
case BuiltInTessLevelOuter:
- if (get_execution_model() == ExecutionModelTessellationControl)
+ if (is_tesc_shader())
{
expected_type = SPIRType::Half;
expected_width = 16;
@@ -15375,7 +16813,7 @@ void CompilerMSL::cast_from_builtin_load(uint32_t source_id, std::string &expr,
wrap_expr += ", ";
}
- if (get_execution_mode_bitset().get(ExecutionModeTriangles))
+ if (is_tessellating_triangles())
wrap_expr += ", 0.0";
wrap_expr += " })";
@@ -15390,20 +16828,46 @@ void CompilerMSL::cast_from_builtin_load(uint32_t source_id, std::string &expr,
expr = bitcast_expression(expr_type, expected_type, expr);
}
}
-
- if (builtin == BuiltInTessCoord && get_entry_point().flags.get(ExecutionModeQuads) && expr_type.vecsize == 3)
- {
- // In SPIR-V, this is always a vec3, even for quads. In Metal, though, it's a float2 for quads.
- // The code is expecting a float3, so we need to widen this.
- expr = join("float3(", expr, ", 0)");
- }
}
-void CompilerMSL::cast_to_builtin_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type)
+void CompilerMSL::cast_to_variable_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type)
{
+ bool is_packed = has_extended_decoration(target_id, SPIRVCrossDecorationPhysicalTypePacked);
+ auto *target_expr = maybe_get<SPIRExpression>(target_id);
auto *var = maybe_get_backing_variable(target_id);
+ const SPIRType *var_type, *phys_type;
+ if (uint32_t phys_id = get_extended_decoration(target_id, SPIRVCrossDecorationPhysicalTypeID))
+ phys_type = &get<SPIRType>(phys_id);
+ else
+ phys_type = &expr_type;
if (var)
+ {
target_id = var->self;
+ var_type = &get_variable_data_type(*var);
+ }
+
+ // Type fixups for workgroup variables if they are booleans.
+ if (var && (var->storage == StorageClassWorkgroup || var_type->basetype == SPIRType::Struct) &&
+ expr_type.basetype == SPIRType::Boolean)
+ {
+ auto short_type = expr_type;
+ short_type.basetype = SPIRType::Short;
+ expr = join(type_to_glsl(short_type), "(", expr, ")");
+ }
+ // Type fixups for workgroup variables if they are matrices.
+ // Don't do fixup for packed types; those are handled specially.
+ // FIXME: Maybe use a type like spvStorageMatrix for packed matrices?
+ if (!msl_options.supports_msl_version(3, 0) && var &&
+ (var->storage == StorageClassWorkgroup ||
+ (var_type->basetype == SPIRType::Struct &&
+ has_extended_decoration(var_type->self, SPIRVCrossDecorationWorkgroupStruct) && !is_packed)) &&
+ expr_type.columns > 1)
+ {
+ SPIRType matrix_type = *phys_type;
+ if (target_expr && target_expr->need_transpose)
+ swap(matrix_type.vecsize, matrix_type.columns);
+ expr = join("spvStorage_", type_to_glsl(matrix_type), "(", expr, ")");
+ }
// Only interested in standalone builtin variables.
if (!has_decoration(target_id, DecorationBuiltIn))
@@ -15514,6 +16978,7 @@ void CompilerMSL::analyze_argument_buffers()
struct Resource
{
SPIRVariable *var;
+ SPIRVariable *descriptor_alias;
string name;
SPIRType::BaseType basetype;
uint32_t index;
@@ -15553,6 +17018,32 @@ void CompilerMSL::analyze_argument_buffers()
}
}
+ // Handle descriptor aliasing as well as we can.
+ // We can handle aliasing of buffers by casting pointers, but not for typed resources.
+ // Inline UBOs cannot be handled since it's not a pointer, but inline data.
+ SPIRVariable *descriptor_alias = nullptr;
+ if (var.storage == StorageClassUniform || var.storage == StorageClassStorageBuffer)
+ {
+ for (auto &resource : resources_in_set[desc_set])
+ {
+ if (get_decoration(resource.var->self, DecorationBinding) ==
+ get_decoration(var_id, DecorationBinding) &&
+ resource.basetype == SPIRType::Struct && type.basetype == SPIRType::Struct &&
+ (resource.var->storage == StorageClassUniform ||
+ resource.var->storage == StorageClassStorageBuffer))
+ {
+ descriptor_alias = resource.var;
+ // Self-reference marks that we should declare the resource,
+ // and it's being used as an alias (so we can emit void* instead).
+ resource.descriptor_alias = resource.var;
+ // Need to promote interlocked usage so that the primary declaration is correct.
+ if (interlocked_resources.count(var_id))
+ interlocked_resources.insert(resource.var->self);
+ break;
+ }
+ }
+ }
+
uint32_t binding = get_decoration(var_id, DecorationBinding);
if (type.basetype == SPIRType::SampledImage)
{
@@ -15566,14 +17057,14 @@ void CompilerMSL::analyze_argument_buffers()
{
uint32_t image_resource_index = get_metal_resource_index(var, SPIRType::Image, i);
resources_in_set[desc_set].push_back(
- { &var, to_name(var_id), SPIRType::Image, image_resource_index, i });
+ { &var, descriptor_alias, to_name(var_id), SPIRType::Image, image_resource_index, i });
}
if (type.image.dim != DimBuffer && !constexpr_sampler)
{
uint32_t sampler_resource_index = get_metal_resource_index(var, SPIRType::Sampler);
resources_in_set[desc_set].push_back(
- { &var, to_sampler_expression(var_id), SPIRType::Sampler, sampler_resource_index, 0 });
+ { &var, descriptor_alias, to_sampler_expression(var_id), SPIRType::Sampler, sampler_resource_index, 0 });
}
}
else if (inline_uniform_blocks.count(SetBindingPair{ desc_set, binding }))
@@ -15585,22 +17076,27 @@ void CompilerMSL::analyze_argument_buffers()
// constexpr samplers are not declared as resources.
// Inline uniform blocks are always emitted at the end.
add_resource_name(var_id);
+
+ uint32_t resource_index = ~0u;
+ if (!descriptor_alias)
+ resource_index = get_metal_resource_index(var, type.basetype);
+
resources_in_set[desc_set].push_back(
- { &var, to_name(var_id), type.basetype, get_metal_resource_index(var, type.basetype), 0 });
+ { &var, descriptor_alias, to_name(var_id), type.basetype, resource_index, 0 });
// Emulate texture2D atomic operations
if (atomic_image_vars.count(var.self))
{
uint32_t buffer_resource_index = get_metal_resource_index(var, SPIRType::AtomicCounter, 0);
resources_in_set[desc_set].push_back(
- { &var, to_name(var_id) + "_atomic", SPIRType::Struct, buffer_resource_index, 0 });
+ { &var, descriptor_alias, to_name(var_id) + "_atomic", SPIRType::Struct, buffer_resource_index, 0 });
}
}
// Check if this descriptor set needs a swizzle buffer.
if (needs_swizzle_buffer_def && is_sampled_image_type(type))
set_needs_swizzle_buffer[desc_set] = true;
- else if (buffers_requiring_array_length.count(var_id) != 0)
+ else if (buffer_requires_array_length(var_id))
{
set_needs_buffer_sizes[desc_set] = true;
needs_buffer_sizes = true;
@@ -15640,7 +17136,7 @@ void CompilerMSL::analyze_argument_buffers()
set_decoration(var_id, DecorationDescriptorSet, desc_set);
set_decoration(var_id, DecorationBinding, kSwizzleBufferBinding);
resources_in_set[desc_set].push_back(
- { &var, to_name(var_id), SPIRType::UInt, get_metal_resource_index(var, SPIRType::UInt), 0 });
+ { &var, nullptr, to_name(var_id), SPIRType::UInt, get_metal_resource_index(var, SPIRType::UInt), 0 });
}
if (set_needs_buffer_sizes[desc_set])
@@ -15651,7 +17147,7 @@ void CompilerMSL::analyze_argument_buffers()
set_decoration(var_id, DecorationDescriptorSet, desc_set);
set_decoration(var_id, DecorationBinding, kBufferSizeBufferBinding);
resources_in_set[desc_set].push_back(
- { &var, to_name(var_id), SPIRType::UInt, get_metal_resource_index(var, SPIRType::UInt), 0 });
+ { &var, nullptr, to_name(var_id), SPIRType::UInt, get_metal_resource_index(var, SPIRType::UInt), 0 });
}
}
}
@@ -15663,7 +17159,7 @@ void CompilerMSL::analyze_argument_buffers()
uint32_t desc_set = get_decoration(var_id, DecorationDescriptorSet);
add_resource_name(var_id);
resources_in_set[desc_set].push_back(
- { &var, to_name(var_id), SPIRType::Struct, get_metal_resource_index(var, SPIRType::Struct), 0 });
+ { &var, nullptr, to_name(var_id), SPIRType::Struct, get_metal_resource_index(var, SPIRType::Struct), 0 });
}
for (uint32_t desc_set = 0; desc_set < kMaxArgumentBuffers; desc_set++)
@@ -15707,7 +17203,7 @@ void CompilerMSL::analyze_argument_buffers()
set_name(buffer_variable_id, join("spvDescriptorSet", desc_set));
// Ids must be emitted in ID order.
- sort(begin(resources), end(resources), [&](const Resource &lhs, const Resource &rhs) -> bool {
+ stable_sort(begin(resources), end(resources), [&](const Resource &lhs, const Resource &rhs) -> bool {
return tie(lhs.index, lhs.basetype) < tie(rhs.index, rhs.basetype);
});
@@ -15812,12 +17308,18 @@ void CompilerMSL::analyze_argument_buffers()
}
else if (buffers_requiring_dynamic_offset.count(pair))
{
+ if (resource.descriptor_alias)
+ SPIRV_CROSS_THROW("Descriptor aliasing is currently not supported with dynamic offsets.");
+
// Don't set the qualified name here; we'll define a variable holding the corrected buffer address later.
buffer_type.member_types.push_back(var.basetype);
buffers_requiring_dynamic_offset[pair].second = var.self;
}
else if (inline_uniform_blocks.count(pair))
{
+ if (resource.descriptor_alias)
+ SPIRV_CROSS_THROW("Descriptor aliasing is currently not supported with inline UBOs.");
+
// Put the buffer block itself into the argument buffer.
buffer_type.member_types.push_back(get_variable_data_type_id(var));
set_qualified_name(var.self, join(to_name(buffer_variable_id), ".", mbr_name));
@@ -15849,9 +17351,12 @@ void CompilerMSL::analyze_argument_buffers()
}
else
{
- // Resources will be declared as pointers not references, so automatically dereference as appropriate.
- buffer_type.member_types.push_back(var.basetype);
- if (type.array.empty())
+ if (!resource.descriptor_alias || resource.descriptor_alias == resource.var)
+ buffer_type.member_types.push_back(var.basetype);
+
+ if (resource.descriptor_alias && resource.descriptor_alias != resource.var)
+ buffer_aliases_argument.push_back({ var.self, resource.descriptor_alias->self });
+ else if (type.array.empty())
set_qualified_name(var.self, join("(*", to_name(buffer_variable_id), ".", mbr_name, ")"));
else
set_qualified_name(var.self, join(to_name(buffer_variable_id), ".", mbr_name));
@@ -15995,7 +17500,7 @@ void CompilerMSL::activate_argument_buffer_resources()
uint32_t desc_set = get_decoration(self, DecorationDescriptorSet);
if (descriptor_set_is_argument_buffer(desc_set))
- active_interface_variables.insert(self);
+ add_active_interface_variable(self);
});
}
@@ -16021,6 +17526,20 @@ void CompilerMSL::emit_block_hints(const SPIRBlock &)
string CompilerMSL::additional_fixed_sample_mask_str() const
{
char print_buffer[32];
+#ifdef _MSC_VER
+ // snprintf does not exist or is buggy on older MSVC versions, some of
+ // them being used by MinGW. Use sprintf instead and disable
+ // corresponding warning.
+#pragma warning(push)
+#pragma warning(disable : 4996)
+#endif
+#if _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);
+#endif
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
return print_buffer;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.hpp
index 9dc1a1a0370..7cd34c73f6c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_msl.hpp
@@ -34,35 +34,53 @@
namespace SPIRV_CROSS_NAMESPACE
{
-// Indicates the format of a shader input. Currently limited to specifying
+// Indicates the format of a shader interface variable. Currently limited to specifying
// if the input is an 8-bit unsigned integer, 16-bit unsigned integer, or
// some other format.
-enum MSLShaderInputFormat
+enum MSLShaderVariableFormat
{
- MSL_SHADER_INPUT_FORMAT_OTHER = 0,
- MSL_SHADER_INPUT_FORMAT_UINT8 = 1,
- MSL_SHADER_INPUT_FORMAT_UINT16 = 2,
- MSL_SHADER_INPUT_FORMAT_ANY16 = 3,
- MSL_SHADER_INPUT_FORMAT_ANY32 = 4,
+ MSL_SHADER_VARIABLE_FORMAT_OTHER = 0,
+ MSL_SHADER_VARIABLE_FORMAT_UINT8 = 1,
+ MSL_SHADER_VARIABLE_FORMAT_UINT16 = 2,
+ MSL_SHADER_VARIABLE_FORMAT_ANY16 = 3,
+ MSL_SHADER_VARIABLE_FORMAT_ANY32 = 4,
// Deprecated aliases.
- MSL_VERTEX_FORMAT_OTHER = MSL_SHADER_INPUT_FORMAT_OTHER,
- MSL_VERTEX_FORMAT_UINT8 = MSL_SHADER_INPUT_FORMAT_UINT8,
- MSL_VERTEX_FORMAT_UINT16 = MSL_SHADER_INPUT_FORMAT_UINT16,
+ MSL_VERTEX_FORMAT_OTHER = MSL_SHADER_VARIABLE_FORMAT_OTHER,
+ MSL_VERTEX_FORMAT_UINT8 = MSL_SHADER_VARIABLE_FORMAT_UINT8,
+ MSL_VERTEX_FORMAT_UINT16 = MSL_SHADER_VARIABLE_FORMAT_UINT16,
+ MSL_SHADER_INPUT_FORMAT_OTHER = MSL_SHADER_VARIABLE_FORMAT_OTHER,
+ MSL_SHADER_INPUT_FORMAT_UINT8 = MSL_SHADER_VARIABLE_FORMAT_UINT8,
+ MSL_SHADER_INPUT_FORMAT_UINT16 = MSL_SHADER_VARIABLE_FORMAT_UINT16,
+ MSL_SHADER_INPUT_FORMAT_ANY16 = MSL_SHADER_VARIABLE_FORMAT_ANY16,
+ MSL_SHADER_INPUT_FORMAT_ANY32 = MSL_SHADER_VARIABLE_FORMAT_ANY32,
+
+ MSL_SHADER_VARIABLE_FORMAT_INT_MAX = 0x7fffffff
+};
+
+// Indicates the rate at which a variable changes value, one of: per-vertex,
+// per-primitive, or per-patch.
+enum MSLShaderVariableRate
+{
+ MSL_SHADER_VARIABLE_RATE_PER_VERTEX = 0,
+ MSL_SHADER_VARIABLE_RATE_PER_PRIMITIVE = 1,
+ MSL_SHADER_VARIABLE_RATE_PER_PATCH = 2,
- MSL_SHADER_INPUT_FORMAT_INT_MAX = 0x7fffffff
+ MSL_SHADER_VARIABLE_RATE_INT_MAX = 0x7fffffff,
};
-// Defines MSL characteristics of an input variable at a particular location.
+// Defines MSL characteristics of a shader interface variable at a particular location.
// After compilation, it is possible to query whether or not this location was used.
// If vecsize is nonzero, it must be greater than or equal to the vecsize declared in the shader,
// or behavior is undefined.
-struct MSLShaderInput
+struct MSLShaderInterfaceVariable
{
uint32_t location = 0;
- MSLShaderInputFormat format = MSL_SHADER_INPUT_FORMAT_OTHER;
+ uint32_t component = 0;
+ MSLShaderVariableFormat format = MSL_SHADER_VARIABLE_FORMAT_OTHER;
spv::BuiltIn builtin = spv::BuiltInMax;
uint32_t vecsize = 0;
+ MSLShaderVariableRate rate = MSL_SHADER_VARIABLE_RATE_PER_VERTEX;
};
// Matches the binding index of a MSL resource for a binding within a descriptor set.
@@ -300,6 +318,7 @@ public:
uint32_t dynamic_offsets_buffer_index = 23;
uint32_t shader_input_buffer_index = 22;
uint32_t shader_index_buffer_index = 21;
+ uint32_t shader_patch_input_buffer_index = 20;
uint32_t shader_input_wg_index = 0;
uint32_t device_index = 0;
uint32_t enable_frag_output_mask = 0xffffffff;
@@ -381,6 +400,11 @@ public:
// builtins are processed, but should result in more efficient usage of the GPU.
bool multi_patch_workgroup = false;
+ // Use storage buffers instead of vertex-style attributes for tessellation evaluation
+ // input. This may require conversion of inputs in the generated post-tessellation
+ // vertex shader, but allows the use of nested arrays.
+ bool raw_buffer_tese_input = false;
+
// If set, a vertex shader will be compiled as part of a tessellation pipeline.
// It will be translated as a compute kernel, so it can use the global invocation ID
// to index the output buffer.
@@ -392,7 +416,7 @@ public:
// and will be addressed using the current ViewIndex.
bool arrayed_subpass_input = false;
- // Whether to use SIMD-group or quadgroup functions to implement group nnon-uniform
+ // Whether to use SIMD-group or quadgroup functions to implement group non-uniform
// operations. Some GPUs on iOS do not support the SIMD-group functions, only the
// quadgroup functions.
bool ios_use_simdgroup_functions = false;
@@ -434,6 +458,20 @@ public:
// the extra threads away.
bool force_sample_rate_shading = false;
+ // If set, gl_HelperInvocation will be set manually whenever a fragment is discarded.
+ // Some Metal devices have a bug where simd_is_helper_thread() does not return true
+ // after a fragment has been discarded. This is a workaround that is only expected to be needed
+ // until the bug is fixed in Metal; it is provided as an option to allow disabling it when that occurs.
+ bool manual_helper_invocation_updates = true;
+
+ // If set, extra checks will be emitted in fragment shaders to prevent writes
+ // from discarded fragments. Some Metal devices have a bug where writes to storage resources
+ // from discarded fragment threads continue to occur, despite the fragment being
+ // discarded. 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 check_discarded_frag_stores = false;
+
bool is_ios() const
{
return platform == iOS;
@@ -444,6 +482,11 @@ public:
return platform == macOS;
}
+ bool use_quadgroup_operation() const
+ {
+ return is_ios() && !ios_use_simdgroup_functions;
+ }
+
void set_msl_version(uint32_t major, uint32_t minor = 0, uint32_t patch = 0)
{
msl_version = make_msl_version(major, minor, patch);
@@ -493,6 +536,11 @@ public:
return !buffers_requiring_array_length.empty();
}
+ bool buffer_requires_array_length(VariableID id) const
+ {
+ return buffers_requiring_array_length.count(id) != 0;
+ }
+
// Provide feedback to calling API to allow it to pass a buffer
// containing the view mask for the current multiview subpass.
bool needs_view_mask_buffer() const
@@ -533,10 +581,15 @@ public:
explicit CompilerMSL(const ParsedIR &ir);
explicit CompilerMSL(ParsedIR &&ir);
- // input is a shader input description used to fix up shader input variables.
+ // input is a shader interface variable description used to fix up shader input variables.
// If shader inputs are provided, is_msl_shader_input_used() will return true after
- // calling ::compile() if the location was used by the MSL code.
- void add_msl_shader_input(const MSLShaderInput &input);
+ // calling ::compile() if the location were used by the MSL code.
+ void add_msl_shader_input(const MSLShaderInterfaceVariable &input);
+
+ // output is a shader interface variable description used to fix up shader output variables.
+ // If shader outputs are provided, is_msl_shader_output_used() will return true after
+ // calling ::compile() if the location were used by the MSL code.
+ void add_msl_shader_output(const MSLShaderInterfaceVariable &output);
// resource is a resource binding to indicate the MSL buffer,
// texture or sampler index to use for a particular SPIR-V description set
@@ -571,6 +624,9 @@ public:
// Query after compilation is done. This allows you to check if an input location was used by the shader.
bool is_msl_shader_input_used(uint32_t location);
+ // Query after compilation is done. This allows you to check if an output location were used by the shader.
+ bool is_msl_shader_output_used(uint32_t location);
+
// If not using add_msl_shader_input, it's possible
// that certain builtin attributes need to be automatically assigned locations.
// This is typical for tessellation builtin inputs such as tess levels, gl_Position, etc.
@@ -578,6 +634,13 @@ public:
// add_msl_shader_input or the builtin is not used, otherwise returns N in [[attribute(N)]].
uint32_t get_automatic_builtin_input_location(spv::BuiltIn builtin) const;
+ // If not using add_msl_shader_output, it's possible
+ // that certain builtin attributes need to be automatically assigned locations.
+ // This is typical for tessellation builtin outputs such as tess levels, gl_Position, etc.
+ // This returns k_unknown_location if the location were explicitly assigned with
+ // add_msl_shader_output or the builtin were not used, otherwise returns N in [[attribute(N)]].
+ uint32_t get_automatic_builtin_output_location(spv::BuiltIn builtin) const;
+
// NOTE: Only resources which are remapped using add_msl_resource_binding will be reported here.
// Constexpr samplers are always assumed to be emitted.
// No specific MSLResourceBinding remapping is required for constexpr samplers as long as they are remapped
@@ -632,7 +695,7 @@ public:
protected:
// An enum of SPIR-V functions that are implemented in additional
// source code that is added to the shader if necessary.
- enum SPVFuncImpl
+ enum SPVFuncImpl : uint8_t
{
SPVFuncImplNone,
SPVFuncImplMod,
@@ -656,8 +719,10 @@ protected:
SPVFuncImplFMul,
SPVFuncImplFAdd,
SPVFuncImplFSub,
+ SPVFuncImplQuantizeToF16,
SPVFuncImplCubemapTo2DArrayFace,
SPVFuncImplUnsafeArray, // Allow Metal to use the array<T> template to make arrays a value type
+ SPVFuncImplStorageMatrix, // Allow threadgroup construction of matrices
SPVFuncImplInverse4x4,
SPVFuncImplInverse3x3,
SPVFuncImplInverse2x2,
@@ -711,6 +776,8 @@ protected:
// If the underlying resource has been used for comparison then duplicate loads of that resource must be too
// Use Metal's native frame-buffer fetch API for subpass inputs.
void emit_texture_op(const Instruction &i, bool sparse) override;
+ void emit_binary_ptr_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op);
+ std::string to_ptr_expression(uint32_t id, bool register_expression_read = true);
void emit_binary_unord_op(uint32_t result_type, uint32_t result_id, uint32_t op0, uint32_t op1, const char *op);
void emit_instruction(const Instruction &instr) override;
void emit_glsl_op(uint32_t result_type, uint32_t result_id, uint32_t op, const uint32_t *args,
@@ -729,6 +796,7 @@ protected:
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_struct_padding_target(const SPIRType &type) override;
+ std::string type_to_glsl(const SPIRType &type, uint32_t id, bool member);
std::string type_to_glsl(const SPIRType &type, uint32_t id = 0) override;
void emit_block_hints(const SPIRBlock &block) override;
@@ -763,10 +831,9 @@ protected:
std::string bitcast_glsl_op(const SPIRType &result_type, const SPIRType &argument_type) override;
bool emit_complex_bitcast(uint32_t result_id, uint32_t id, uint32_t op0) override;
bool skip_argument(uint32_t id) const override;
- std::string to_member_reference(uint32_t base, const SPIRType &type, uint32_t index, bool ptr_chain) override;
+ std::string to_member_reference(uint32_t base, const SPIRType &type, uint32_t index, bool ptr_chain_is_resolved) override;
std::string to_qualifiers_glsl(uint32_t id) override;
void replace_illegal_names() override;
- void declare_undefined_values() override;
void declare_constant_arrays();
void replace_illegal_entry_point_names();
@@ -784,11 +851,15 @@ protected:
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_tesc_shader() const;
+ bool is_tese_shader() const;
+
void preprocess_op_codes();
void localize_global_variables();
void extract_global_variables_from_functions();
void mark_packable_structs();
void mark_as_packable(SPIRType &type);
+ void mark_as_workgroup_struct(SPIRType &type);
std::unordered_map<uint32_t, std::set<uint32_t>> function_global_vars;
void extract_global_variables_from_function(uint32_t func_id, std::set<uint32_t> &added_arg_ids,
@@ -824,20 +895,29 @@ protected:
bool add_component_variable_to_interface_block(spv::StorageClass storage, const std::string &ib_var_ref,
SPIRVariable &var, const SPIRType &type,
InterfaceBlockMeta &meta);
- void add_plain_member_variable_to_interface_block(spv::StorageClass storage, const std::string &ib_var_ref,
- SPIRType &ib_type, SPIRVariable &var, uint32_t index,
- InterfaceBlockMeta &meta);
- void add_composite_member_variable_to_interface_block(spv::StorageClass storage, const std::string &ib_var_ref,
- SPIRType &ib_type, SPIRVariable &var, uint32_t index,
- InterfaceBlockMeta &meta);
+ void add_plain_member_variable_to_interface_block(spv::StorageClass storage,
+ const std::string &ib_var_ref, SPIRType &ib_type,
+ SPIRVariable &var, SPIRType &var_type,
+ uint32_t mbr_idx, InterfaceBlockMeta &meta,
+ const std::string &mbr_name_qual,
+ const std::string &var_chain_qual,
+ uint32_t &location, uint32_t &var_mbr_idx);
+ void add_composite_member_variable_to_interface_block(spv::StorageClass storage,
+ const std::string &ib_var_ref, SPIRType &ib_type,
+ SPIRVariable &var, SPIRType &var_type,
+ uint32_t mbr_idx, InterfaceBlockMeta &meta,
+ const std::string &mbr_name_qual,
+ const std::string &var_chain_qual,
+ uint32_t &location, uint32_t &var_mbr_idx);
void add_tess_level_input_to_interface_block(const std::string &ib_var_ref, SPIRType &ib_type, SPIRVariable &var);
+ void add_tess_level_input(const std::string &base_ref, const std::string &mbr_name, SPIRVariable &var);
void fix_up_interface_member_indices(spv::StorageClass storage, uint32_t ib_type_id);
void mark_location_as_used_by_shader(uint32_t location, const SPIRType &type,
spv::StorageClass storage, bool fallback = false);
uint32_t ensure_correct_builtin_type(uint32_t type_id, spv::BuiltIn builtin);
- uint32_t ensure_correct_input_type(uint32_t type_id, uint32_t location,
+ uint32_t ensure_correct_input_type(uint32_t type_id, uint32_t location, uint32_t component,
uint32_t num_components, bool strip_array);
void emit_custom_templates();
@@ -856,12 +936,13 @@ protected:
std::string entry_point_arg_stage_in();
void entry_point_args_builtin(std::string &args);
void entry_point_args_discrete_descriptors(std::string &args);
- std::string to_qualified_member_name(const SPIRType &type, uint32_t index);
+ std::string append_member_name(const std::string &qualifier, const SPIRType &type, uint32_t index);
std::string ensure_valid_name(std::string name, std::string pfx);
std::string to_sampler_expression(uint32_t id);
std::string to_swizzle_expression(uint32_t id);
std::string to_buffer_size_expression(uint32_t id);
bool is_sample_rate() const;
+ bool is_intersection_query() const;
bool is_direct_input_builtin(spv::BuiltIn builtin);
std::string builtin_qualifier(spv::BuiltIn builtin);
std::string builtin_type_decl(spv::BuiltIn builtin, uint32_t id = 0);
@@ -869,11 +950,14 @@ protected:
std::string member_attribute_qualifier(const SPIRType &type, uint32_t index);
std::string member_location_attribute_qualifier(const SPIRType &type, uint32_t index);
std::string argument_decl(const SPIRFunction::Parameter &arg);
+ const char *descriptor_address_space(uint32_t id, spv::StorageClass storage, const char *plain_address_space) const;
std::string round_fp_tex_coords(std::string tex_coords, bool coord_is_fp);
uint32_t get_metal_resource_index(SPIRVariable &var, SPIRType::BaseType basetype, uint32_t plane = 0);
uint32_t get_member_location(uint32_t type_id, uint32_t index, uint32_t *comp = nullptr) const;
uint32_t get_or_allocate_builtin_input_member_location(spv::BuiltIn builtin,
uint32_t type_id, uint32_t index, uint32_t *comp = nullptr);
+ uint32_t get_or_allocate_builtin_output_member_location(spv::BuiltIn builtin,
+ uint32_t type_id, uint32_t index, uint32_t *comp = nullptr);
uint32_t get_physical_tess_level_array_size(spv::BuiltIn builtin) const;
@@ -909,7 +993,7 @@ protected:
bool validate_member_packing_rules_msl(const SPIRType &type, uint32_t index) const;
std::string get_argument_address_space(const SPIRVariable &argument);
std::string get_type_address_space(const SPIRType &type, uint32_t id, bool argument = false);
- const char *to_restrict(uint32_t id, bool space = true);
+ const char *to_restrict(uint32_t id, bool space);
SPIRType &get_stage_in_struct_type();
SPIRType &get_stage_out_struct_type();
SPIRType &get_patch_stage_in_struct_type();
@@ -917,8 +1001,8 @@ protected:
std::string get_tess_factor_struct_name();
SPIRType &get_uint_type();
uint32_t get_uint_type_id();
- void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, uint32_t mem_order_1,
- uint32_t mem_order_2, bool has_mem_order_2, uint32_t op0, uint32_t op1 = 0,
+ void emit_atomic_func_op(uint32_t result_type, uint32_t result_id, const char *op, spv::Op opcode,
+ uint32_t mem_order_1, uint32_t mem_order_2, bool has_mem_order_2, uint32_t op0, uint32_t op1 = 0,
bool op1_is_pointer = false, bool op1_is_literal = false, uint32_t op2 = 0);
const char *get_memory_order(uint32_t spv_mem_sem);
void add_pragma_line(const std::string &line);
@@ -929,9 +1013,12 @@ protected:
void build_implicit_builtins();
uint32_t build_constant_uint_array_pointer();
void emit_entry_point_declarations() override;
+ bool uses_explicit_early_fragment_test();
+
uint32_t builtin_frag_coord_id = 0;
uint32_t builtin_sample_id_id = 0;
uint32_t builtin_sample_mask_id = 0;
+ uint32_t builtin_helper_invocation_id = 0;
uint32_t builtin_vertex_idx_id = 0;
uint32_t builtin_base_vertex_id = 0;
uint32_t builtin_instance_idx_id = 0;
@@ -956,9 +1043,10 @@ protected:
uint32_t argument_buffer_padding_sampler_type_id = 0;
bool does_shader_write_sample_mask = false;
+ bool frag_shader_needs_discard_checks = false;
- void cast_to_builtin_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type) override;
- void cast_from_builtin_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type) override;
+ void cast_to_variable_store(uint32_t target_id, std::string &expr, const SPIRType &expr_type) override;
+ void cast_from_variable_load(uint32_t source_id, std::string &expr, const SPIRType &expr_type) override;
void emit_store_statement(uint32_t lhs_expression, uint32_t rhs_expression) override;
void analyze_sampled_image_usage();
@@ -967,6 +1055,8 @@ protected:
void prepare_access_chain_for_scalar_access(std::string &expr, const SPIRType &type, spv::StorageClass storage,
bool &is_packed) override;
void fix_up_interpolant_access_chain(const uint32_t *ops, uint32_t length);
+ void check_physical_type_cast(std::string &expr, const SPIRType *type, uint32_t physical_type) override;
+
bool emit_tessellation_access_chain(const uint32_t *ops, uint32_t length);
bool emit_tessellation_io_load(uint32_t result_type, uint32_t id, uint32_t ptr);
bool is_out_of_bounds_tessellation_level(uint32_t id_lhs);
@@ -980,12 +1070,17 @@ protected:
Options msl_options;
std::set<SPVFuncImpl> spv_function_implementations;
// Must be ordered to ensure declarations are in a specific order.
- std::map<uint32_t, MSLShaderInput> inputs_by_location;
- std::unordered_map<uint32_t, MSLShaderInput> inputs_by_builtin;
+ std::map<LocationComponentPair, MSLShaderInterfaceVariable> inputs_by_location;
+ std::unordered_map<uint32_t, MSLShaderInterfaceVariable> inputs_by_builtin;
+ std::map<LocationComponentPair, MSLShaderInterfaceVariable> outputs_by_location;
+ std::unordered_map<uint32_t, MSLShaderInterfaceVariable> outputs_by_builtin;
std::unordered_set<uint32_t> location_inputs_in_use;
std::unordered_set<uint32_t> location_inputs_in_use_fallback;
+ std::unordered_set<uint32_t> location_outputs_in_use;
+ std::unordered_set<uint32_t> location_outputs_in_use_fallback;
std::unordered_map<uint32_t, uint32_t> fragment_output_components;
std::unordered_map<uint32_t, uint32_t> builtin_to_automatic_input_location;
+ std::unordered_map<uint32_t, uint32_t> builtin_to_automatic_output_location;
std::set<std::string> pragma_lines;
std::set<std::string> typedef_lines;
SmallVector<uint32_t> vars_needing_early_declaration;
@@ -1005,6 +1100,8 @@ protected:
VariableID patch_stage_out_var_id = 0;
VariableID stage_in_ptr_var_id = 0;
VariableID stage_out_ptr_var_id = 0;
+ VariableID tess_level_inner_var_id = 0;
+ VariableID tess_level_outer_var_id = 0;
VariableID stage_out_masked_builtin_type_id = 0;
// Handle HLSL-style 0-based vertex/instance index.
@@ -1031,6 +1128,7 @@ protected:
bool needs_subgroup_invocation_id = false;
bool needs_subgroup_size = false;
bool needs_sample_id = false;
+ bool needs_helper_invocation = false;
std::string qual_pos_var_name;
std::string stage_in_var_name = "in";
std::string stage_out_var_name = "out";
@@ -1043,6 +1141,7 @@ protected:
std::string input_wg_var_name = "gl_in";
std::string input_buffer_var_name = "spvIn";
std::string output_buffer_var_name = "spvOut";
+ std::string patch_input_buffer_var_name = "spvPatchIn";
std::string patch_output_buffer_var_name = "spvPatchOut";
std::string tess_factor_buffer_var_name = "spvTessLevel";
std::string index_buffer_var_name = "spvIndices";
@@ -1054,7 +1153,9 @@ protected:
const MSLConstexprSampler *find_constexpr_sampler(uint32_t id) const;
std::unordered_set<uint32_t> buffers_requiring_array_length;
- SmallVector<uint32_t> buffer_arrays;
+ SmallVector<uint32_t> buffer_arrays_discrete;
+ SmallVector<std::pair<uint32_t, uint32_t>> buffer_aliases_argument;
+ SmallVector<uint32_t> buffer_aliases_discrete;
std::unordered_set<uint32_t> atomic_image_vars; // Emulate texture2D atomic operations
std::unordered_set<uint32_t> pull_model_inputs;
@@ -1095,6 +1196,16 @@ protected:
bool variable_storage_requires_stage_io(spv::StorageClass storage) const;
+ bool needs_manual_helper_invocation_updates() const
+ {
+ return msl_options.manual_helper_invocation_updates && msl_options.supports_msl_version(2, 3);
+ }
+ bool needs_frag_discard_checks() const
+ {
+ return get_execution_model() == spv::ExecutionModelFragment && msl_options.supports_msl_version(2, 3) &&
+ msl_options.check_discarded_frag_stores && frag_shader_needs_discard_checks;
+ }
+
bool has_additional_fixed_sample_mask() const { return msl_options.additional_fixed_sample_mask != 0xffffffff; }
std::string additional_fixed_sample_mask_str() const;
@@ -1115,10 +1226,13 @@ protected:
std::unordered_map<uint32_t, uint32_t> image_pointers; // Emulate texture2D atomic operations
bool suppress_missing_prototypes = false;
bool uses_atomics = false;
- bool uses_resource_write = false;
+ bool uses_image_write = false;
+ bool uses_buffer_write = false;
+ bool uses_discard = false;
bool needs_subgroup_invocation_id = false;
bool needs_subgroup_size = false;
bool needs_sample_id = false;
+ bool needs_helper_invocation = false;
};
// OpcodeHandler that scans for uses of sampled images
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_parser.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_parser.cpp
index d50d2e842db..39bd1adf7f4 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_parser.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_parser.cpp
@@ -31,7 +31,7 @@ namespace SPIRV_CROSS_NAMESPACE
{
Parser::Parser(vector<uint32_t> spirv)
{
- ir.spirv = move(spirv);
+ ir.spirv = std::move(spirv);
}
Parser::Parser(const uint32_t *spirv_data, size_t word_count)
@@ -68,6 +68,7 @@ static bool is_valid_spirv_version(uint32_t version)
case 0x10300: // SPIR-V 1.3
case 0x10400: // SPIR-V 1.4
case 0x10500: // SPIR-V 1.5
+ case 0x10600: // SPIR-V 1.6
return true;
default:
@@ -182,6 +183,15 @@ void Parser::parse(const Instruction &instruction)
auto op = static_cast<Op>(instruction.op);
uint32_t length = instruction.length;
+ // HACK for glslang that might emit OpEmitMeshTasksEXT followed by return / branch.
+ // Instead of failing hard, just ignore it.
+ if (ignore_trailing_block_opcodes)
+ {
+ ignore_trailing_block_opcodes = false;
+ if (op == OpReturn || op == OpBranch || op == OpUnreachable)
+ return;
+ }
+
switch (op)
{
case OpSourceContinued:
@@ -258,29 +268,35 @@ void Parser::parse(const Instruction &instruction)
case OpExtension:
{
auto ext = extract_string(ir.spirv, instruction.offset);
- ir.declared_extensions.push_back(move(ext));
+ ir.declared_extensions.push_back(std::move(ext));
break;
}
case OpExtInstImport:
{
uint32_t id = ops[0];
+
+ SPIRExtension::Extension spirv_ext = SPIRExtension::Unsupported;
+
auto ext = extract_string(ir.spirv, instruction.offset + 1);
if (ext == "GLSL.std.450")
- set<SPIRExtension>(id, SPIRExtension::GLSL);
+ spirv_ext = SPIRExtension::GLSL;
else if (ext == "DebugInfo")
- set<SPIRExtension>(id, SPIRExtension::SPV_debug_info);
+ spirv_ext = SPIRExtension::SPV_debug_info;
else if (ext == "SPV_AMD_shader_ballot")
- set<SPIRExtension>(id, SPIRExtension::SPV_AMD_shader_ballot);
+ spirv_ext = SPIRExtension::SPV_AMD_shader_ballot;
else if (ext == "SPV_AMD_shader_explicit_vertex_parameter")
- set<SPIRExtension>(id, SPIRExtension::SPV_AMD_shader_explicit_vertex_parameter);
+ spirv_ext = SPIRExtension::SPV_AMD_shader_explicit_vertex_parameter;
else if (ext == "SPV_AMD_shader_trinary_minmax")
- set<SPIRExtension>(id, SPIRExtension::SPV_AMD_shader_trinary_minmax);
+ spirv_ext = SPIRExtension::SPV_AMD_shader_trinary_minmax;
else if (ext == "SPV_AMD_gcn_shader")
- set<SPIRExtension>(id, SPIRExtension::SPV_AMD_gcn_shader);
- else
- set<SPIRExtension>(id, SPIRExtension::Unsupported);
+ spirv_ext = SPIRExtension::SPV_AMD_gcn_shader;
+ else if (ext == "NonSemantic.DebugPrintf")
+ spirv_ext = SPIRExtension::NonSemanticDebugPrintf;
+ else if (ext == "NonSemantic.Shader.DebugInfo.100")
+ spirv_ext = SPIRExtension::NonSemanticShaderDebugInfo;
+ set<SPIRExtension>(id, spirv_ext);
// Other SPIR-V extensions which have ExtInstrs are currently not supported.
break;
@@ -290,7 +306,15 @@ void Parser::parse(const Instruction &instruction)
{
// The SPIR-V debug information extended instructions might come at global scope.
if (current_block)
+ {
current_block->ops.push_back(instruction);
+ if (length >= 2)
+ {
+ const auto *type = maybe_get<SPIRType>(ops[0]);
+ if (type)
+ ir.load_type_width.insert({ ops[1], type->width });
+ }
+ }
break;
}
@@ -338,12 +362,32 @@ void Parser::parse(const Instruction &instruction)
execution.output_vertices = ops[2];
break;
+ case ExecutionModeOutputPrimitivesEXT:
+ execution.output_primitives = ops[2];
+ break;
+
default:
break;
}
break;
}
+ case OpExecutionModeId:
+ {
+ auto &execution = ir.entry_points[ops[0]];
+ auto mode = static_cast<ExecutionMode>(ops[1]);
+ execution.flags.set(mode);
+
+ if (mode == ExecutionModeLocalSizeId)
+ {
+ execution.workgroup_size.id_x = ops[2];
+ execution.workgroup_size.id_y = ops[3];
+ execution.workgroup_size.id_z = ops[4];
+ }
+
+ break;
+ }
+
case OpName:
{
uint32_t id = ops[0];
@@ -961,6 +1005,58 @@ void Parser::parse(const Instruction &instruction)
current_block->false_block = ops[2];
current_block->terminator = SPIRBlock::Select;
+
+ if (current_block->true_block == current_block->false_block)
+ {
+ // Bogus conditional, translate to a direct branch.
+ // Avoids some ugly edge cases later when analyzing CFGs.
+
+ // There are some super jank cases where the merge block is different from the true/false,
+ // and later branches can "break" out of the selection construct this way.
+ // This is complete nonsense, but CTS hits this case.
+ // In this scenario, we should see the selection construct as more of a Switch with one default case.
+ // The problem here is that this breaks any attempt to break out of outer switch statements,
+ // but it's theoretically solvable if this ever comes up using the ladder breaking system ...
+
+ if (current_block->true_block != current_block->next_block &&
+ current_block->merge == SPIRBlock::MergeSelection)
+ {
+ uint32_t ids = ir.increase_bound_by(2);
+
+ SPIRType type;
+ type.basetype = SPIRType::Int;
+ type.width = 32;
+ set<SPIRType>(ids, type);
+ auto &c = set<SPIRConstant>(ids + 1, ids);
+
+ current_block->condition = c.self;
+ current_block->default_block = current_block->true_block;
+ current_block->terminator = SPIRBlock::MultiSelect;
+ ir.block_meta[current_block->next_block] &= ~ParsedIR::BLOCK_META_SELECTION_MERGE_BIT;
+ ir.block_meta[current_block->next_block] |= ParsedIR::BLOCK_META_MULTISELECT_MERGE_BIT;
+ }
+ else
+ {
+ // Collapse loops if we have to.
+ bool collapsed_loop = current_block->true_block == current_block->merge_block &&
+ current_block->merge == SPIRBlock::MergeLoop;
+
+ if (collapsed_loop)
+ {
+ ir.block_meta[current_block->merge_block] &= ~ParsedIR::BLOCK_META_LOOP_MERGE_BIT;
+ ir.block_meta[current_block->continue_block] &= ~ParsedIR::BLOCK_META_CONTINUE_BIT;
+ }
+
+ current_block->next_block = current_block->true_block;
+ current_block->condition = 0;
+ current_block->true_block = 0;
+ current_block->false_block = 0;
+ current_block->merge_block = 0;
+ current_block->merge = SPIRBlock::MergeNone;
+ current_block->terminator = SPIRBlock::Direct;
+ }
+ }
+
current_block = nullptr;
break;
}
@@ -975,8 +1071,21 @@ void Parser::parse(const Instruction &instruction)
current_block->condition = ops[0];
current_block->default_block = ops[1];
- for (uint32_t i = 2; i + 2 <= length; i += 2)
- current_block->cases.push_back({ ops[i], ops[i + 1] });
+ uint32_t remaining_ops = length - 2;
+ if ((remaining_ops % 2) == 0)
+ {
+ for (uint32_t i = 2; i + 2 <= length; i += 2)
+ current_block->cases_32bit.push_back({ ops[i], ops[i + 1] });
+ }
+
+ if ((remaining_ops % 3) == 0)
+ {
+ for (uint32_t i = 2; i + 3 <= length; i += 3)
+ {
+ uint64_t value = (static_cast<uint64_t>(ops[i + 1]) << 32) | ops[i];
+ current_block->cases_64bit.push_back({ value, ops[i + 2] });
+ }
+ }
// If we jump to next block, make it break instead since we're inside a switch case block at that point.
ir.block_meta[current_block->next_block] |= ParsedIR::BLOCK_META_MULTISELECT_MERGE_BIT;
@@ -986,6 +1095,7 @@ void Parser::parse(const Instruction &instruction)
}
case OpKill:
+ case OpTerminateInvocation:
{
if (!current_block)
SPIRV_CROSS_THROW("Trying to end a non-existing block.");
@@ -1010,6 +1120,18 @@ void Parser::parse(const Instruction &instruction)
current_block = nullptr;
break;
+ case OpEmitMeshTasksEXT:
+ if (!current_block)
+ SPIRV_CROSS_THROW("Trying to end a non-existing block.");
+ current_block->terminator = SPIRBlock::EmitMeshTasks;
+ for (uint32_t i = 0; i < 3; i++)
+ current_block->mesh.groups[i] = ops[i];
+ current_block->mesh.payload = length >= 4 ? ops[3] : 0;
+ current_block = nullptr;
+ // Currently glslang is bugged and does not treat EmitMeshTasksEXT as a terminator.
+ ignore_trailing_block_opcodes = true;
+ break;
+
case OpReturn:
{
if (!current_block)
@@ -1134,6 +1256,13 @@ void Parser::parse(const Instruction &instruction)
// Actual opcodes.
default:
{
+ if (length >= 2)
+ {
+ const auto *type = maybe_get<SPIRType>(ops[0]);
+ if (type)
+ ir.load_type_width.insert({ ops[1], type->width });
+ }
+
if (!current_block)
SPIRV_CROSS_THROW("Currently no block to insert opcode.");
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_parser.hpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_parser.hpp
index d72fc71d86b..dabc0e22446 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_parser.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_parser.hpp
@@ -46,6 +46,8 @@ private:
ParsedIR ir;
SPIRFunction *current_function = nullptr;
SPIRBlock *current_block = nullptr;
+ // For workarounds.
+ bool ignore_trailing_block_opcodes = false;
void parse(const Instruction &instr);
const uint32_t *stream(const Instruction &instr) const;
diff --git a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp
index ee2fe930dcc..0bd224e6c2b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-cross/spirv_reflect.cpp
@@ -587,18 +587,18 @@ void CompilerReflection::emit_resources(const char *tag, const SmallVector<Resou
{
bool ssbo_block = type.storage == StorageClassStorageBuffer ||
(type.storage == StorageClassUniform && typeflags.get(DecorationBufferBlock));
- if (ssbo_block)
- {
- auto buffer_flags = get_buffer_block_flags(res.id);
- if (buffer_flags.get(DecorationNonReadable))
- json_stream->emit_json_key_value("writeonly", true);
- if (buffer_flags.get(DecorationNonWritable))
- json_stream->emit_json_key_value("readonly", true);
- if (buffer_flags.get(DecorationRestrict))
- json_stream->emit_json_key_value("restrict", true);
- if (buffer_flags.get(DecorationCoherent))
- json_stream->emit_json_key_value("coherent", true);
- }
+ Bitset qualifier_mask = ssbo_block ? get_buffer_block_flags(res.id) : mask;
+
+ if (qualifier_mask.get(DecorationNonReadable))
+ json_stream->emit_json_key_value("writeonly", true);
+ if (qualifier_mask.get(DecorationNonWritable))
+ json_stream->emit_json_key_value("readonly", true);
+ if (qualifier_mask.get(DecorationRestrict))
+ json_stream->emit_json_key_value("restrict", true);
+ if (qualifier_mask.get(DecorationCoherent))
+ json_stream->emit_json_key_value("coherent", true);
+ if (qualifier_mask.get(DecorationVolatile))
+ json_stream->emit_json_key_value("volatile", true);
}
emit_type_array(type);
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/SPIRV-Headers.pc.in b/3rdparty/bgfx/3rdparty/spirv-headers/SPIRV-Headers.pc.in
deleted file mode 100644
index 345f5f80403..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/SPIRV-Headers.pc.in
+++ /dev/null
@@ -1,9 +0,0 @@
-prefix=@CMAKE_INSTALL_PREFIX@
-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
-
-Name: SPIRV-Headers
-Description: Header files from the SPIR-V registry
-Version: @CMAKE_PROJECT_VERSION@
-Requires:
-Libs:
-Cflags: -I${includedir}
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.cs b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.cs
deleted file mode 100644
index de325cc4aad..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.cs
+++ /dev/null
@@ -1,993 +0,0 @@
-// 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#
-//
-// - 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
-//
-// 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.
-
-namespace Spv
-{
-
- public static class Specification
- {
- public const uint MagicNumber = 0x07230203;
- public const uint Version = 0x00010000;
- public const uint Revision = 12;
- public const uint OpCodeMask = 0xffff;
- public const uint WordCountShift = 16;
-
- public enum SourceLanguage
- {
- Unknown = 0,
- ESSL = 1,
- GLSL = 2,
- OpenCL_C = 3,
- OpenCL_CPP = 4,
- HLSL = 5,
- }
-
- public enum ExecutionModel
- {
- Vertex = 0,
- TessellationControl = 1,
- TessellationEvaluation = 2,
- Geometry = 3,
- Fragment = 4,
- GLCompute = 5,
- Kernel = 6,
- }
-
- public enum AddressingModel
- {
- Logical = 0,
- Physical32 = 1,
- Physical64 = 2,
- }
-
- public enum MemoryModel
- {
- Simple = 0,
- GLSL450 = 1,
- OpenCL = 2,
- }
-
- public enum ExecutionMode
- {
- 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,
- }
-
- public enum StorageClass
- {
- 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,
- }
-
- public enum Dim
- {
- Dim1D = 0,
- Dim2D = 1,
- Dim3D = 2,
- Cube = 3,
- Rect = 4,
- Buffer = 5,
- SubpassData = 6,
- }
-
- public enum SamplerAddressingMode
- {
- None = 0,
- ClampToEdge = 1,
- Clamp = 2,
- Repeat = 3,
- RepeatMirrored = 4,
- }
-
- public enum SamplerFilterMode
- {
- Nearest = 0,
- Linear = 1,
- }
-
- public enum ImageFormat
- {
- 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,
- }
-
- public enum ImageChannelOrder
- {
- 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,
- }
-
- public enum ImageChannelDataType
- {
- 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,
- }
-
- public enum ImageOperandsShift
- {
- Bias = 0,
- Lod = 1,
- Grad = 2,
- ConstOffset = 3,
- Offset = 4,
- ConstOffsets = 5,
- Sample = 6,
- MinLod = 7,
- }
-
- public enum ImageOperandsMask
- {
- MaskNone = 0,
- Bias = 0x00000001,
- Lod = 0x00000002,
- Grad = 0x00000004,
- ConstOffset = 0x00000008,
- Offset = 0x00000010,
- ConstOffsets = 0x00000020,
- Sample = 0x00000040,
- MinLod = 0x00000080,
- }
-
- public enum FPFastMathModeShift
- {
- NotNaN = 0,
- NotInf = 1,
- NSZ = 2,
- AllowRecip = 3,
- Fast = 4,
- }
-
- public enum FPFastMathModeMask
- {
- MaskNone = 0,
- NotNaN = 0x00000001,
- NotInf = 0x00000002,
- NSZ = 0x00000004,
- AllowRecip = 0x00000008,
- Fast = 0x00000010,
- }
-
- public enum FPRoundingMode
- {
- RTE = 0,
- RTZ = 1,
- RTP = 2,
- RTN = 3,
- }
-
- public enum LinkageType
- {
- Export = 0,
- Import = 1,
- }
-
- public enum AccessQualifier
- {
- ReadOnly = 0,
- WriteOnly = 1,
- ReadWrite = 2,
- }
-
- public enum FunctionParameterAttribute
- {
- Zext = 0,
- Sext = 1,
- ByVal = 2,
- Sret = 3,
- NoAlias = 4,
- NoCapture = 5,
- NoWrite = 6,
- NoReadWrite = 7,
- }
-
- public enum Decoration
- {
- 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,
- }
-
- public enum BuiltIn
- {
- 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,
- }
-
- public enum SelectionControlShift
- {
- Flatten = 0,
- DontFlatten = 1,
- }
-
- public enum SelectionControlMask
- {
- MaskNone = 0,
- Flatten = 0x00000001,
- DontFlatten = 0x00000002,
- }
-
- public enum LoopControlShift
- {
- Unroll = 0,
- DontUnroll = 1,
- }
-
- public enum LoopControlMask
- {
- MaskNone = 0,
- Unroll = 0x00000001,
- DontUnroll = 0x00000002,
- }
-
- public enum FunctionControlShift
- {
- Inline = 0,
- DontInline = 1,
- Pure = 2,
- Const = 3,
- }
-
- public enum FunctionControlMask
- {
- MaskNone = 0,
- Inline = 0x00000001,
- DontInline = 0x00000002,
- Pure = 0x00000004,
- Const = 0x00000008,
- }
-
- public enum MemorySemanticsShift
- {
- Acquire = 1,
- Release = 2,
- AcquireRelease = 3,
- SequentiallyConsistent = 4,
- UniformMemory = 6,
- SubgroupMemory = 7,
- WorkgroupMemory = 8,
- CrossWorkgroupMemory = 9,
- AtomicCounterMemory = 10,
- ImageMemory = 11,
- }
-
- public enum MemorySemanticsMask
- {
- MaskNone = 0,
- Acquire = 0x00000002,
- Release = 0x00000004,
- AcquireRelease = 0x00000008,
- SequentiallyConsistent = 0x00000010,
- UniformMemory = 0x00000040,
- SubgroupMemory = 0x00000080,
- WorkgroupMemory = 0x00000100,
- CrossWorkgroupMemory = 0x00000200,
- AtomicCounterMemory = 0x00000400,
- ImageMemory = 0x00000800,
- }
-
- public enum MemoryAccessShift
- {
- Volatile = 0,
- Aligned = 1,
- Nontemporal = 2,
- }
-
- public enum MemoryAccessMask
- {
- MaskNone = 0,
- Volatile = 0x00000001,
- Aligned = 0x00000002,
- Nontemporal = 0x00000004,
- }
-
- public enum Scope
- {
- CrossDevice = 0,
- Device = 1,
- Workgroup = 2,
- Subgroup = 3,
- Invocation = 4,
- }
-
- public enum GroupOperation
- {
- Reduce = 0,
- InclusiveScan = 1,
- ExclusiveScan = 2,
- }
-
- public enum KernelEnqueueFlags
- {
- NoWait = 0,
- WaitKernel = 1,
- WaitWorkGroup = 2,
- }
-
- public enum KernelProfilingInfoShift
- {
- CmdExecTime = 0,
- }
-
- public enum KernelProfilingInfoMask
- {
- MaskNone = 0,
- CmdExecTime = 0x00000001,
- }
-
- public enum Capability
- {
- 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,
- }
-
- public enum Op
- {
- 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,
- }
- }
-}
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp
deleted file mode 100644
index e98a89cee74..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp
+++ /dev/null
@@ -1,1002 +0,0 @@
-// 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 SourceLanguage {
- SourceLanguageUnknown = 0,
- SourceLanguageESSL = 1,
- SourceLanguageGLSL = 2,
- SourceLanguageOpenCL_C = 3,
- SourceLanguageOpenCL_CPP = 4,
- SourceLanguageHLSL = 5,
- SourceLanguageMax = 0x7fffffff,
-};
-
-enum ExecutionModel {
- ExecutionModelVertex = 0,
- ExecutionModelTessellationControl = 1,
- ExecutionModelTessellationEvaluation = 2,
- ExecutionModelGeometry = 3,
- ExecutionModelFragment = 4,
- ExecutionModelGLCompute = 5,
- ExecutionModelKernel = 6,
- ExecutionModelMax = 0x7fffffff,
-};
-
-enum AddressingModel {
- AddressingModelLogical = 0,
- AddressingModelPhysical32 = 1,
- AddressingModelPhysical64 = 2,
- AddressingModelMax = 0x7fffffff,
-};
-
-enum MemoryModel {
- MemoryModelSimple = 0,
- MemoryModelGLSL450 = 1,
- MemoryModelOpenCL = 2,
- MemoryModelMax = 0x7fffffff,
-};
-
-enum ExecutionMode {
- ExecutionModeInvocations = 0,
- ExecutionModeSpacingEqual = 1,
- ExecutionModeSpacingFractionalEven = 2,
- ExecutionModeSpacingFractionalOdd = 3,
- ExecutionModeVertexOrderCw = 4,
- ExecutionModeVertexOrderCcw = 5,
- ExecutionModePixelCenterInteger = 6,
- ExecutionModeOriginUpperLeft = 7,
- ExecutionModeOriginLowerLeft = 8,
- ExecutionModeEarlyFragmentTests = 9,
- ExecutionModePointMode = 10,
- ExecutionModeXfb = 11,
- ExecutionModeDepthReplacing = 12,
- ExecutionModeDepthGreater = 14,
- ExecutionModeDepthLess = 15,
- ExecutionModeDepthUnchanged = 16,
- ExecutionModeLocalSize = 17,
- ExecutionModeLocalSizeHint = 18,
- ExecutionModeInputPoints = 19,
- ExecutionModeInputLines = 20,
- ExecutionModeInputLinesAdjacency = 21,
- ExecutionModeTriangles = 22,
- ExecutionModeInputTrianglesAdjacency = 23,
- ExecutionModeQuads = 24,
- ExecutionModeIsolines = 25,
- ExecutionModeOutputVertices = 26,
- ExecutionModeOutputPoints = 27,
- ExecutionModeOutputLineStrip = 28,
- ExecutionModeOutputTriangleStrip = 29,
- ExecutionModeVecTypeHint = 30,
- ExecutionModeContractionOff = 31,
- ExecutionModePostDepthCoverage = 4446,
- ExecutionModeStencilRefReplacingEXT = 5027,
- ExecutionModeMax = 0x7fffffff,
-};
-
-enum StorageClass {
- StorageClassUniformConstant = 0,
- StorageClassInput = 1,
- StorageClassUniform = 2,
- StorageClassOutput = 3,
- StorageClassWorkgroup = 4,
- StorageClassCrossWorkgroup = 5,
- StorageClassPrivate = 6,
- StorageClassFunction = 7,
- StorageClassGeneric = 8,
- StorageClassPushConstant = 9,
- StorageClassAtomicCounter = 10,
- StorageClassImage = 11,
- StorageClassStorageBuffer = 12,
- StorageClassMax = 0x7fffffff,
-};
-
-enum Dim {
- Dim1D = 0,
- Dim2D = 1,
- Dim3D = 2,
- DimCube = 3,
- DimRect = 4,
- DimBuffer = 5,
- DimSubpassData = 6,
- DimMax = 0x7fffffff,
-};
-
-enum SamplerAddressingMode {
- SamplerAddressingModeNone = 0,
- SamplerAddressingModeClampToEdge = 1,
- SamplerAddressingModeClamp = 2,
- SamplerAddressingModeRepeat = 3,
- SamplerAddressingModeRepeatMirrored = 4,
- SamplerAddressingModeMax = 0x7fffffff,
-};
-
-enum SamplerFilterMode {
- SamplerFilterModeNearest = 0,
- SamplerFilterModeLinear = 1,
- SamplerFilterModeMax = 0x7fffffff,
-};
-
-enum ImageFormat {
- ImageFormatUnknown = 0,
- ImageFormatRgba32f = 1,
- ImageFormatRgba16f = 2,
- ImageFormatR32f = 3,
- ImageFormatRgba8 = 4,
- ImageFormatRgba8Snorm = 5,
- ImageFormatRg32f = 6,
- ImageFormatRg16f = 7,
- ImageFormatR11fG11fB10f = 8,
- ImageFormatR16f = 9,
- ImageFormatRgba16 = 10,
- ImageFormatRgb10A2 = 11,
- ImageFormatRg16 = 12,
- ImageFormatRg8 = 13,
- ImageFormatR16 = 14,
- ImageFormatR8 = 15,
- ImageFormatRgba16Snorm = 16,
- ImageFormatRg16Snorm = 17,
- ImageFormatRg8Snorm = 18,
- ImageFormatR16Snorm = 19,
- ImageFormatR8Snorm = 20,
- ImageFormatRgba32i = 21,
- ImageFormatRgba16i = 22,
- ImageFormatRgba8i = 23,
- ImageFormatR32i = 24,
- ImageFormatRg32i = 25,
- ImageFormatRg16i = 26,
- ImageFormatRg8i = 27,
- ImageFormatR16i = 28,
- ImageFormatR8i = 29,
- ImageFormatRgba32ui = 30,
- ImageFormatRgba16ui = 31,
- ImageFormatRgba8ui = 32,
- ImageFormatR32ui = 33,
- ImageFormatRgb10a2ui = 34,
- ImageFormatRg32ui = 35,
- ImageFormatRg16ui = 36,
- ImageFormatRg8ui = 37,
- ImageFormatR16ui = 38,
- ImageFormatR8ui = 39,
- ImageFormatMax = 0x7fffffff,
-};
-
-enum ImageChannelOrder {
- ImageChannelOrderR = 0,
- ImageChannelOrderA = 1,
- ImageChannelOrderRG = 2,
- ImageChannelOrderRA = 3,
- ImageChannelOrderRGB = 4,
- ImageChannelOrderRGBA = 5,
- ImageChannelOrderBGRA = 6,
- ImageChannelOrderARGB = 7,
- ImageChannelOrderIntensity = 8,
- ImageChannelOrderLuminance = 9,
- ImageChannelOrderRx = 10,
- ImageChannelOrderRGx = 11,
- ImageChannelOrderRGBx = 12,
- ImageChannelOrderDepth = 13,
- ImageChannelOrderDepthStencil = 14,
- ImageChannelOrdersRGB = 15,
- ImageChannelOrdersRGBx = 16,
- ImageChannelOrdersRGBA = 17,
- ImageChannelOrdersBGRA = 18,
- ImageChannelOrderABGR = 19,
- ImageChannelOrderMax = 0x7fffffff,
-};
-
-enum ImageChannelDataType {
- ImageChannelDataTypeSnormInt8 = 0,
- ImageChannelDataTypeSnormInt16 = 1,
- ImageChannelDataTypeUnormInt8 = 2,
- ImageChannelDataTypeUnormInt16 = 3,
- ImageChannelDataTypeUnormShort565 = 4,
- ImageChannelDataTypeUnormShort555 = 5,
- ImageChannelDataTypeUnormInt101010 = 6,
- ImageChannelDataTypeSignedInt8 = 7,
- ImageChannelDataTypeSignedInt16 = 8,
- ImageChannelDataTypeSignedInt32 = 9,
- ImageChannelDataTypeUnsignedInt8 = 10,
- ImageChannelDataTypeUnsignedInt16 = 11,
- ImageChannelDataTypeUnsignedInt32 = 12,
- ImageChannelDataTypeHalfFloat = 13,
- ImageChannelDataTypeFloat = 14,
- ImageChannelDataTypeUnormInt24 = 15,
- ImageChannelDataTypeUnormInt101010_2 = 16,
- ImageChannelDataTypeMax = 0x7fffffff,
-};
-
-enum ImageOperandsShift {
- ImageOperandsBiasShift = 0,
- ImageOperandsLodShift = 1,
- ImageOperandsGradShift = 2,
- ImageOperandsConstOffsetShift = 3,
- ImageOperandsOffsetShift = 4,
- ImageOperandsConstOffsetsShift = 5,
- ImageOperandsSampleShift = 6,
- ImageOperandsMinLodShift = 7,
- ImageOperandsMax = 0x7fffffff,
-};
-
-enum ImageOperandsMask {
- ImageOperandsMaskNone = 0,
- ImageOperandsBiasMask = 0x00000001,
- ImageOperandsLodMask = 0x00000002,
- ImageOperandsGradMask = 0x00000004,
- ImageOperandsConstOffsetMask = 0x00000008,
- ImageOperandsOffsetMask = 0x00000010,
- ImageOperandsConstOffsetsMask = 0x00000020,
- ImageOperandsSampleMask = 0x00000040,
- ImageOperandsMinLodMask = 0x00000080,
-};
-
-enum FPFastMathModeShift {
- FPFastMathModeNotNaNShift = 0,
- FPFastMathModeNotInfShift = 1,
- FPFastMathModeNSZShift = 2,
- FPFastMathModeAllowRecipShift = 3,
- FPFastMathModeFastShift = 4,
- FPFastMathModeMax = 0x7fffffff,
-};
-
-enum FPFastMathModeMask {
- FPFastMathModeMaskNone = 0,
- FPFastMathModeNotNaNMask = 0x00000001,
- FPFastMathModeNotInfMask = 0x00000002,
- FPFastMathModeNSZMask = 0x00000004,
- FPFastMathModeAllowRecipMask = 0x00000008,
- FPFastMathModeFastMask = 0x00000010,
-};
-
-enum FPRoundingMode {
- FPRoundingModeRTE = 0,
- FPRoundingModeRTZ = 1,
- FPRoundingModeRTP = 2,
- FPRoundingModeRTN = 3,
- FPRoundingModeMax = 0x7fffffff,
-};
-
-enum LinkageType {
- LinkageTypeExport = 0,
- LinkageTypeImport = 1,
- LinkageTypeMax = 0x7fffffff,
-};
-
-enum AccessQualifier {
- AccessQualifierReadOnly = 0,
- AccessQualifierWriteOnly = 1,
- AccessQualifierReadWrite = 2,
- AccessQualifierMax = 0x7fffffff,
-};
-
-enum FunctionParameterAttribute {
- FunctionParameterAttributeZext = 0,
- FunctionParameterAttributeSext = 1,
- FunctionParameterAttributeByVal = 2,
- FunctionParameterAttributeSret = 3,
- FunctionParameterAttributeNoAlias = 4,
- FunctionParameterAttributeNoCapture = 5,
- FunctionParameterAttributeNoWrite = 6,
- FunctionParameterAttributeNoReadWrite = 7,
- FunctionParameterAttributeMax = 0x7fffffff,
-};
-
-enum Decoration {
- DecorationRelaxedPrecision = 0,
- DecorationSpecId = 1,
- DecorationBlock = 2,
- DecorationBufferBlock = 3,
- DecorationRowMajor = 4,
- DecorationColMajor = 5,
- DecorationArrayStride = 6,
- DecorationMatrixStride = 7,
- DecorationGLSLShared = 8,
- DecorationGLSLPacked = 9,
- DecorationCPacked = 10,
- DecorationBuiltIn = 11,
- DecorationNoPerspective = 13,
- DecorationFlat = 14,
- DecorationPatch = 15,
- DecorationCentroid = 16,
- DecorationSample = 17,
- DecorationInvariant = 18,
- DecorationRestrict = 19,
- DecorationAliased = 20,
- DecorationVolatile = 21,
- DecorationConstant = 22,
- DecorationCoherent = 23,
- DecorationNonWritable = 24,
- DecorationNonReadable = 25,
- DecorationUniform = 26,
- DecorationSaturatedConversion = 28,
- DecorationStream = 29,
- DecorationLocation = 30,
- DecorationComponent = 31,
- DecorationIndex = 32,
- DecorationBinding = 33,
- DecorationDescriptorSet = 34,
- DecorationOffset = 35,
- DecorationXfbBuffer = 36,
- DecorationXfbStride = 37,
- DecorationFuncParamAttr = 38,
- DecorationFPRoundingMode = 39,
- DecorationFPFastMathMode = 40,
- DecorationLinkageAttributes = 41,
- DecorationNoContraction = 42,
- DecorationInputAttachmentIndex = 43,
- DecorationAlignment = 44,
- DecorationExplicitInterpAMD = 4999,
- DecorationOverrideCoverageNV = 5248,
- DecorationPassthroughNV = 5250,
- DecorationViewportRelativeNV = 5252,
- DecorationSecondaryViewportRelativeNV = 5256,
- DecorationHlslCounterBufferGOOGLE = 5634,
- DecorationHlslSemanticGOOGLE = 5635,
- DecorationMax = 0x7fffffff,
-};
-
-enum BuiltIn {
- BuiltInPosition = 0,
- BuiltInPointSize = 1,
- BuiltInClipDistance = 3,
- BuiltInCullDistance = 4,
- BuiltInVertexId = 5,
- BuiltInInstanceId = 6,
- BuiltInPrimitiveId = 7,
- BuiltInInvocationId = 8,
- BuiltInLayer = 9,
- BuiltInViewportIndex = 10,
- BuiltInTessLevelOuter = 11,
- BuiltInTessLevelInner = 12,
- BuiltInTessCoord = 13,
- BuiltInPatchVertices = 14,
- BuiltInFragCoord = 15,
- BuiltInPointCoord = 16,
- BuiltInFrontFacing = 17,
- BuiltInSampleId = 18,
- BuiltInSamplePosition = 19,
- BuiltInSampleMask = 20,
- BuiltInFragDepth = 22,
- BuiltInHelperInvocation = 23,
- BuiltInNumWorkgroups = 24,
- BuiltInWorkgroupSize = 25,
- BuiltInWorkgroupId = 26,
- BuiltInLocalInvocationId = 27,
- BuiltInGlobalInvocationId = 28,
- BuiltInLocalInvocationIndex = 29,
- BuiltInWorkDim = 30,
- BuiltInGlobalSize = 31,
- BuiltInEnqueuedWorkgroupSize = 32,
- BuiltInGlobalOffset = 33,
- BuiltInGlobalLinearId = 34,
- BuiltInSubgroupSize = 36,
- BuiltInSubgroupMaxSize = 37,
- BuiltInNumSubgroups = 38,
- BuiltInNumEnqueuedSubgroups = 39,
- BuiltInSubgroupId = 40,
- BuiltInSubgroupLocalInvocationId = 41,
- BuiltInVertexIndex = 42,
- BuiltInInstanceIndex = 43,
- BuiltInSubgroupEqMaskKHR = 4416,
- BuiltInSubgroupGeMaskKHR = 4417,
- BuiltInSubgroupGtMaskKHR = 4418,
- BuiltInSubgroupLeMaskKHR = 4419,
- BuiltInSubgroupLtMaskKHR = 4420,
- BuiltInBaseVertex = 4424,
- BuiltInBaseInstance = 4425,
- BuiltInDrawIndex = 4426,
- BuiltInDeviceIndex = 4438,
- BuiltInViewIndex = 4440,
- BuiltInBaryCoordNoPerspAMD = 4992,
- BuiltInBaryCoordNoPerspCentroidAMD = 4993,
- BuiltInBaryCoordNoPerspSampleAMD = 4994,
- BuiltInBaryCoordSmoothAMD = 4995,
- BuiltInBaryCoordSmoothCentroidAMD = 4996,
- BuiltInBaryCoordSmoothSampleAMD = 4997,
- BuiltInBaryCoordPullModelAMD = 4998,
- BuiltInFragStencilRefEXT = 5014,
- BuiltInViewportMaskNV = 5253,
- BuiltInSecondaryPositionNV = 5257,
- BuiltInSecondaryViewportMaskNV = 5258,
- BuiltInPositionPerViewNV = 5261,
- BuiltInViewportMaskPerViewNV = 5262,
- BuiltInMax = 0x7fffffff,
-};
-
-enum SelectionControlShift {
- SelectionControlFlattenShift = 0,
- SelectionControlDontFlattenShift = 1,
- SelectionControlMax = 0x7fffffff,
-};
-
-enum SelectionControlMask {
- SelectionControlMaskNone = 0,
- SelectionControlFlattenMask = 0x00000001,
- SelectionControlDontFlattenMask = 0x00000002,
-};
-
-enum LoopControlShift {
- LoopControlUnrollShift = 0,
- LoopControlDontUnrollShift = 1,
- LoopControlMax = 0x7fffffff,
-};
-
-enum LoopControlMask {
- LoopControlMaskNone = 0,
- LoopControlUnrollMask = 0x00000001,
- LoopControlDontUnrollMask = 0x00000002,
-};
-
-enum FunctionControlShift {
- FunctionControlInlineShift = 0,
- FunctionControlDontInlineShift = 1,
- FunctionControlPureShift = 2,
- FunctionControlConstShift = 3,
- FunctionControlMax = 0x7fffffff,
-};
-
-enum FunctionControlMask {
- FunctionControlMaskNone = 0,
- FunctionControlInlineMask = 0x00000001,
- FunctionControlDontInlineMask = 0x00000002,
- FunctionControlPureMask = 0x00000004,
- FunctionControlConstMask = 0x00000008,
-};
-
-enum MemorySemanticsShift {
- MemorySemanticsAcquireShift = 1,
- MemorySemanticsReleaseShift = 2,
- MemorySemanticsAcquireReleaseShift = 3,
- MemorySemanticsSequentiallyConsistentShift = 4,
- MemorySemanticsUniformMemoryShift = 6,
- MemorySemanticsSubgroupMemoryShift = 7,
- MemorySemanticsWorkgroupMemoryShift = 8,
- MemorySemanticsCrossWorkgroupMemoryShift = 9,
- MemorySemanticsAtomicCounterMemoryShift = 10,
- MemorySemanticsImageMemoryShift = 11,
- MemorySemanticsMax = 0x7fffffff,
-};
-
-enum MemorySemanticsMask {
- MemorySemanticsMaskNone = 0,
- MemorySemanticsAcquireMask = 0x00000002,
- MemorySemanticsReleaseMask = 0x00000004,
- MemorySemanticsAcquireReleaseMask = 0x00000008,
- MemorySemanticsSequentiallyConsistentMask = 0x00000010,
- MemorySemanticsUniformMemoryMask = 0x00000040,
- MemorySemanticsSubgroupMemoryMask = 0x00000080,
- MemorySemanticsWorkgroupMemoryMask = 0x00000100,
- MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
- MemorySemanticsAtomicCounterMemoryMask = 0x00000400,
- MemorySemanticsImageMemoryMask = 0x00000800,
-};
-
-enum MemoryAccessShift {
- MemoryAccessVolatileShift = 0,
- MemoryAccessAlignedShift = 1,
- MemoryAccessNontemporalShift = 2,
- MemoryAccessMax = 0x7fffffff,
-};
-
-enum MemoryAccessMask {
- MemoryAccessMaskNone = 0,
- MemoryAccessVolatileMask = 0x00000001,
- MemoryAccessAlignedMask = 0x00000002,
- MemoryAccessNontemporalMask = 0x00000004,
-};
-
-enum Scope {
- ScopeCrossDevice = 0,
- ScopeDevice = 1,
- ScopeWorkgroup = 2,
- ScopeSubgroup = 3,
- ScopeInvocation = 4,
- ScopeMax = 0x7fffffff,
-};
-
-enum GroupOperation {
- GroupOperationReduce = 0,
- GroupOperationInclusiveScan = 1,
- GroupOperationExclusiveScan = 2,
- GroupOperationMax = 0x7fffffff,
-};
-
-enum KernelEnqueueFlags {
- KernelEnqueueFlagsNoWait = 0,
- KernelEnqueueFlagsWaitKernel = 1,
- KernelEnqueueFlagsWaitWorkGroup = 2,
- KernelEnqueueFlagsMax = 0x7fffffff,
-};
-
-enum KernelProfilingInfoShift {
- KernelProfilingInfoCmdExecTimeShift = 0,
- KernelProfilingInfoMax = 0x7fffffff,
-};
-
-enum KernelProfilingInfoMask {
- KernelProfilingInfoMaskNone = 0,
- KernelProfilingInfoCmdExecTimeMask = 0x00000001,
-};
-
-enum Capability {
- CapabilityMatrix = 0,
- CapabilityShader = 1,
- CapabilityGeometry = 2,
- CapabilityTessellation = 3,
- CapabilityAddresses = 4,
- CapabilityLinkage = 5,
- CapabilityKernel = 6,
- CapabilityVector16 = 7,
- CapabilityFloat16Buffer = 8,
- CapabilityFloat16 = 9,
- CapabilityFloat64 = 10,
- CapabilityInt64 = 11,
- CapabilityInt64Atomics = 12,
- CapabilityImageBasic = 13,
- CapabilityImageReadWrite = 14,
- CapabilityImageMipmap = 15,
- CapabilityPipes = 17,
- CapabilityGroups = 18,
- CapabilityDeviceEnqueue = 19,
- CapabilityLiteralSampler = 20,
- CapabilityAtomicStorage = 21,
- CapabilityInt16 = 22,
- CapabilityTessellationPointSize = 23,
- CapabilityGeometryPointSize = 24,
- CapabilityImageGatherExtended = 25,
- CapabilityStorageImageMultisample = 27,
- CapabilityUniformBufferArrayDynamicIndexing = 28,
- CapabilitySampledImageArrayDynamicIndexing = 29,
- CapabilityStorageBufferArrayDynamicIndexing = 30,
- CapabilityStorageImageArrayDynamicIndexing = 31,
- CapabilityClipDistance = 32,
- CapabilityCullDistance = 33,
- CapabilityImageCubeArray = 34,
- CapabilitySampleRateShading = 35,
- CapabilityImageRect = 36,
- CapabilitySampledRect = 37,
- CapabilityGenericPointer = 38,
- CapabilityInt8 = 39,
- CapabilityInputAttachment = 40,
- CapabilitySparseResidency = 41,
- CapabilityMinLod = 42,
- CapabilitySampled1D = 43,
- CapabilityImage1D = 44,
- CapabilitySampledCubeArray = 45,
- CapabilitySampledBuffer = 46,
- CapabilityImageBuffer = 47,
- CapabilityImageMSArray = 48,
- CapabilityStorageImageExtendedFormats = 49,
- CapabilityImageQuery = 50,
- CapabilityDerivativeControl = 51,
- CapabilityInterpolationFunction = 52,
- CapabilityTransformFeedback = 53,
- CapabilityGeometryStreams = 54,
- CapabilityStorageImageReadWithoutFormat = 55,
- CapabilityStorageImageWriteWithoutFormat = 56,
- CapabilityMultiViewport = 57,
- CapabilitySubgroupBallotKHR = 4423,
- CapabilityDrawParameters = 4427,
- CapabilitySubgroupVoteKHR = 4431,
- CapabilityStorageBuffer16BitAccess = 4433,
- CapabilityStorageUniformBufferBlock16 = 4433,
- CapabilityStorageUniform16 = 4434,
- CapabilityUniformAndStorageBuffer16BitAccess = 4434,
- CapabilityStoragePushConstant16 = 4435,
- CapabilityStorageInputOutput16 = 4436,
- CapabilityDeviceGroup = 4437,
- CapabilityMultiView = 4439,
- CapabilityVariablePointersStorageBuffer = 4441,
- CapabilityVariablePointers = 4442,
- CapabilityAtomicStorageOps = 4445,
- CapabilitySampleMaskPostDepthCoverage = 4447,
- CapabilityImageGatherBiasLodAMD = 5009,
- CapabilityFragmentMaskAMD = 5010,
- CapabilityStencilExportEXT = 5013,
- CapabilityImageReadWriteLodAMD = 5015,
- CapabilitySampleMaskOverrideCoverageNV = 5249,
- CapabilityGeometryShaderPassthroughNV = 5251,
- CapabilityShaderViewportIndexLayerEXT = 5254,
- CapabilityShaderViewportIndexLayerNV = 5254,
- CapabilityShaderViewportMaskNV = 5255,
- CapabilityShaderStereoViewNV = 5259,
- CapabilityPerViewAttributesNV = 5260,
- CapabilitySubgroupShuffleINTEL = 5568,
- CapabilitySubgroupBufferBlockIOINTEL = 5569,
- CapabilitySubgroupImageBlockIOINTEL = 5570,
- CapabilityMax = 0x7fffffff,
-};
-
-enum Op {
- 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,
- OpMax = 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/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp11 b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp11
deleted file mode 100644
index 8896e81b7c4..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.hpp11
+++ /dev/null
@@ -1,1002 +0,0 @@
-// 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/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.lua b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.lua
deleted file mode 100644
index 2bd33ba082b..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.lua
+++ /dev/null
@@ -1,949 +0,0 @@
--- 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.
-
-spv = {
- MagicNumber = 0x07230203,
- Version = 0x00010000,
- Revision = 12,
- OpCodeMask = 0xffff,
- WordCountShift = 16,
-
- SourceLanguage = {
- Unknown = 0,
- ESSL = 1,
- GLSL = 2,
- OpenCL_C = 3,
- OpenCL_CPP = 4,
- HLSL = 5,
- },
-
- ExecutionModel = {
- Vertex = 0,
- TessellationControl = 1,
- TessellationEvaluation = 2,
- Geometry = 3,
- Fragment = 4,
- GLCompute = 5,
- Kernel = 6,
- },
-
- AddressingModel = {
- Logical = 0,
- Physical32 = 1,
- Physical64 = 2,
- },
-
- MemoryModel = {
- Simple = 0,
- GLSL450 = 1,
- OpenCL = 2,
- },
-
- ExecutionMode = {
- 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,
- },
-
- StorageClass = {
- 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,
- },
-
- Dim = {
- Dim1D = 0,
- Dim2D = 1,
- Dim3D = 2,
- Cube = 3,
- Rect = 4,
- Buffer = 5,
- SubpassData = 6,
- },
-
- SamplerAddressingMode = {
- None = 0,
- ClampToEdge = 1,
- Clamp = 2,
- Repeat = 3,
- RepeatMirrored = 4,
- },
-
- SamplerFilterMode = {
- Nearest = 0,
- Linear = 1,
- },
-
- ImageFormat = {
- 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,
- },
-
- ImageChannelOrder = {
- 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,
- },
-
- ImageChannelDataType = {
- 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,
- },
-
- ImageOperandsShift = {
- Bias = 0,
- Lod = 1,
- Grad = 2,
- ConstOffset = 3,
- Offset = 4,
- ConstOffsets = 5,
- Sample = 6,
- MinLod = 7,
- },
-
- ImageOperandsMask = {
- MaskNone = 0,
- Bias = 0x00000001,
- Lod = 0x00000002,
- Grad = 0x00000004,
- ConstOffset = 0x00000008,
- Offset = 0x00000010,
- ConstOffsets = 0x00000020,
- Sample = 0x00000040,
- MinLod = 0x00000080,
- },
-
- FPFastMathModeShift = {
- NotNaN = 0,
- NotInf = 1,
- NSZ = 2,
- AllowRecip = 3,
- Fast = 4,
- },
-
- FPFastMathModeMask = {
- MaskNone = 0,
- NotNaN = 0x00000001,
- NotInf = 0x00000002,
- NSZ = 0x00000004,
- AllowRecip = 0x00000008,
- Fast = 0x00000010,
- },
-
- FPRoundingMode = {
- RTE = 0,
- RTZ = 1,
- RTP = 2,
- RTN = 3,
- },
-
- LinkageType = {
- Export = 0,
- Import = 1,
- },
-
- AccessQualifier = {
- ReadOnly = 0,
- WriteOnly = 1,
- ReadWrite = 2,
- },
-
- FunctionParameterAttribute = {
- Zext = 0,
- Sext = 1,
- ByVal = 2,
- Sret = 3,
- NoAlias = 4,
- NoCapture = 5,
- NoWrite = 6,
- NoReadWrite = 7,
- },
-
- Decoration = {
- 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,
- },
-
- BuiltIn = {
- 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,
- },
-
- SelectionControlShift = {
- Flatten = 0,
- DontFlatten = 1,
- },
-
- SelectionControlMask = {
- MaskNone = 0,
- Flatten = 0x00000001,
- DontFlatten = 0x00000002,
- },
-
- LoopControlShift = {
- Unroll = 0,
- DontUnroll = 1,
- },
-
- LoopControlMask = {
- MaskNone = 0,
- Unroll = 0x00000001,
- DontUnroll = 0x00000002,
- },
-
- FunctionControlShift = {
- Inline = 0,
- DontInline = 1,
- Pure = 2,
- Const = 3,
- },
-
- FunctionControlMask = {
- MaskNone = 0,
- Inline = 0x00000001,
- DontInline = 0x00000002,
- Pure = 0x00000004,
- Const = 0x00000008,
- },
-
- MemorySemanticsShift = {
- Acquire = 1,
- Release = 2,
- AcquireRelease = 3,
- SequentiallyConsistent = 4,
- UniformMemory = 6,
- SubgroupMemory = 7,
- WorkgroupMemory = 8,
- CrossWorkgroupMemory = 9,
- AtomicCounterMemory = 10,
- ImageMemory = 11,
- },
-
- MemorySemanticsMask = {
- MaskNone = 0,
- Acquire = 0x00000002,
- Release = 0x00000004,
- AcquireRelease = 0x00000008,
- SequentiallyConsistent = 0x00000010,
- UniformMemory = 0x00000040,
- SubgroupMemory = 0x00000080,
- WorkgroupMemory = 0x00000100,
- CrossWorkgroupMemory = 0x00000200,
- AtomicCounterMemory = 0x00000400,
- ImageMemory = 0x00000800,
- },
-
- MemoryAccessShift = {
- Volatile = 0,
- Aligned = 1,
- Nontemporal = 2,
- },
-
- MemoryAccessMask = {
- MaskNone = 0,
- Volatile = 0x00000001,
- Aligned = 0x00000002,
- Nontemporal = 0x00000004,
- },
-
- Scope = {
- CrossDevice = 0,
- Device = 1,
- Workgroup = 2,
- Subgroup = 3,
- Invocation = 4,
- },
-
- GroupOperation = {
- Reduce = 0,
- InclusiveScan = 1,
- ExclusiveScan = 2,
- },
-
- KernelEnqueueFlags = {
- NoWait = 0,
- WaitKernel = 1,
- WaitWorkGroup = 2,
- },
-
- KernelProfilingInfoShift = {
- CmdExecTime = 0,
- },
-
- KernelProfilingInfoMask = {
- MaskNone = 0,
- CmdExecTime = 0x00000001,
- },
-
- Capability = {
- 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,
- },
-
- Op = {
- 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,
- },
-
-}
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.py b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.py
deleted file mode 100644
index 8a200e7655f..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.0/spirv.py
+++ /dev/null
@@ -1,949 +0,0 @@
-# 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.
-
-spv = {
- 'MagicNumber' : 0x07230203,
- 'Version' : 0x00010000,
- 'Revision' : 12,
- 'OpCodeMask' : 0xffff,
- 'WordCountShift' : 16,
-
- 'SourceLanguage' : {
- 'Unknown' : 0,
- 'ESSL' : 1,
- 'GLSL' : 2,
- 'OpenCL_C' : 3,
- 'OpenCL_CPP' : 4,
- 'HLSL' : 5,
- },
-
- 'ExecutionModel' : {
- 'Vertex' : 0,
- 'TessellationControl' : 1,
- 'TessellationEvaluation' : 2,
- 'Geometry' : 3,
- 'Fragment' : 4,
- 'GLCompute' : 5,
- 'Kernel' : 6,
- },
-
- 'AddressingModel' : {
- 'Logical' : 0,
- 'Physical32' : 1,
- 'Physical64' : 2,
- },
-
- 'MemoryModel' : {
- 'Simple' : 0,
- 'GLSL450' : 1,
- 'OpenCL' : 2,
- },
-
- 'ExecutionMode' : {
- '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,
- },
-
- 'StorageClass' : {
- '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,
- },
-
- 'Dim' : {
- 'Dim1D' : 0,
- 'Dim2D' : 1,
- 'Dim3D' : 2,
- 'Cube' : 3,
- 'Rect' : 4,
- 'Buffer' : 5,
- 'SubpassData' : 6,
- },
-
- 'SamplerAddressingMode' : {
- 'None' : 0,
- 'ClampToEdge' : 1,
- 'Clamp' : 2,
- 'Repeat' : 3,
- 'RepeatMirrored' : 4,
- },
-
- 'SamplerFilterMode' : {
- 'Nearest' : 0,
- 'Linear' : 1,
- },
-
- 'ImageFormat' : {
- '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,
- },
-
- 'ImageChannelOrder' : {
- '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,
- },
-
- 'ImageChannelDataType' : {
- '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,
- },
-
- 'ImageOperandsShift' : {
- 'Bias' : 0,
- 'Lod' : 1,
- 'Grad' : 2,
- 'ConstOffset' : 3,
- 'Offset' : 4,
- 'ConstOffsets' : 5,
- 'Sample' : 6,
- 'MinLod' : 7,
- },
-
- 'ImageOperandsMask' : {
- 'MaskNone' : 0,
- 'Bias' : 0x00000001,
- 'Lod' : 0x00000002,
- 'Grad' : 0x00000004,
- 'ConstOffset' : 0x00000008,
- 'Offset' : 0x00000010,
- 'ConstOffsets' : 0x00000020,
- 'Sample' : 0x00000040,
- 'MinLod' : 0x00000080,
- },
-
- 'FPFastMathModeShift' : {
- 'NotNaN' : 0,
- 'NotInf' : 1,
- 'NSZ' : 2,
- 'AllowRecip' : 3,
- 'Fast' : 4,
- },
-
- 'FPFastMathModeMask' : {
- 'MaskNone' : 0,
- 'NotNaN' : 0x00000001,
- 'NotInf' : 0x00000002,
- 'NSZ' : 0x00000004,
- 'AllowRecip' : 0x00000008,
- 'Fast' : 0x00000010,
- },
-
- 'FPRoundingMode' : {
- 'RTE' : 0,
- 'RTZ' : 1,
- 'RTP' : 2,
- 'RTN' : 3,
- },
-
- 'LinkageType' : {
- 'Export' : 0,
- 'Import' : 1,
- },
-
- 'AccessQualifier' : {
- 'ReadOnly' : 0,
- 'WriteOnly' : 1,
- 'ReadWrite' : 2,
- },
-
- 'FunctionParameterAttribute' : {
- 'Zext' : 0,
- 'Sext' : 1,
- 'ByVal' : 2,
- 'Sret' : 3,
- 'NoAlias' : 4,
- 'NoCapture' : 5,
- 'NoWrite' : 6,
- 'NoReadWrite' : 7,
- },
-
- 'Decoration' : {
- '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,
- },
-
- 'BuiltIn' : {
- '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,
- },
-
- 'SelectionControlShift' : {
- 'Flatten' : 0,
- 'DontFlatten' : 1,
- },
-
- 'SelectionControlMask' : {
- 'MaskNone' : 0,
- 'Flatten' : 0x00000001,
- 'DontFlatten' : 0x00000002,
- },
-
- 'LoopControlShift' : {
- 'Unroll' : 0,
- 'DontUnroll' : 1,
- },
-
- 'LoopControlMask' : {
- 'MaskNone' : 0,
- 'Unroll' : 0x00000001,
- 'DontUnroll' : 0x00000002,
- },
-
- 'FunctionControlShift' : {
- 'Inline' : 0,
- 'DontInline' : 1,
- 'Pure' : 2,
- 'Const' : 3,
- },
-
- 'FunctionControlMask' : {
- 'MaskNone' : 0,
- 'Inline' : 0x00000001,
- 'DontInline' : 0x00000002,
- 'Pure' : 0x00000004,
- 'Const' : 0x00000008,
- },
-
- 'MemorySemanticsShift' : {
- 'Acquire' : 1,
- 'Release' : 2,
- 'AcquireRelease' : 3,
- 'SequentiallyConsistent' : 4,
- 'UniformMemory' : 6,
- 'SubgroupMemory' : 7,
- 'WorkgroupMemory' : 8,
- 'CrossWorkgroupMemory' : 9,
- 'AtomicCounterMemory' : 10,
- 'ImageMemory' : 11,
- },
-
- 'MemorySemanticsMask' : {
- 'MaskNone' : 0,
- 'Acquire' : 0x00000002,
- 'Release' : 0x00000004,
- 'AcquireRelease' : 0x00000008,
- 'SequentiallyConsistent' : 0x00000010,
- 'UniformMemory' : 0x00000040,
- 'SubgroupMemory' : 0x00000080,
- 'WorkgroupMemory' : 0x00000100,
- 'CrossWorkgroupMemory' : 0x00000200,
- 'AtomicCounterMemory' : 0x00000400,
- 'ImageMemory' : 0x00000800,
- },
-
- 'MemoryAccessShift' : {
- 'Volatile' : 0,
- 'Aligned' : 1,
- 'Nontemporal' : 2,
- },
-
- 'MemoryAccessMask' : {
- 'MaskNone' : 0,
- 'Volatile' : 0x00000001,
- 'Aligned' : 0x00000002,
- 'Nontemporal' : 0x00000004,
- },
-
- 'Scope' : {
- 'CrossDevice' : 0,
- 'Device' : 1,
- 'Workgroup' : 2,
- 'Subgroup' : 3,
- 'Invocation' : 4,
- },
-
- 'GroupOperation' : {
- 'Reduce' : 0,
- 'InclusiveScan' : 1,
- 'ExclusiveScan' : 2,
- },
-
- 'KernelEnqueueFlags' : {
- 'NoWait' : 0,
- 'WaitKernel' : 1,
- 'WaitWorkGroup' : 2,
- },
-
- 'KernelProfilingInfoShift' : {
- 'CmdExecTime' : 0,
- },
-
- 'KernelProfilingInfoMask' : {
- 'MaskNone' : 0,
- 'CmdExecTime' : 0x00000001,
- },
-
- 'Capability' : {
- '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,
- },
-
- 'Op' : {
- '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,
- },
-
-}
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.cs b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.cs
deleted file mode 100644
index 99194e51450..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.cs
+++ /dev/null
@@ -1,1015 +0,0 @@
-// 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#
-//
-// - 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
-//
-// 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.
-
-namespace Spv
-{
-
- public static class Specification
- {
- public const uint MagicNumber = 0x07230203;
- public const uint Version = 0x00010100;
- public const uint Revision = 8;
- public const uint OpCodeMask = 0xffff;
- public const uint WordCountShift = 16;
-
- public enum SourceLanguage
- {
- Unknown = 0,
- ESSL = 1,
- GLSL = 2,
- OpenCL_C = 3,
- OpenCL_CPP = 4,
- HLSL = 5,
- }
-
- public enum ExecutionModel
- {
- Vertex = 0,
- TessellationControl = 1,
- TessellationEvaluation = 2,
- Geometry = 3,
- Fragment = 4,
- GLCompute = 5,
- Kernel = 6,
- }
-
- public enum AddressingModel
- {
- Logical = 0,
- Physical32 = 1,
- Physical64 = 2,
- }
-
- public enum MemoryModel
- {
- Simple = 0,
- GLSL450 = 1,
- OpenCL = 2,
- }
-
- public enum ExecutionMode
- {
- 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,
- }
-
- public enum StorageClass
- {
- 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,
- }
-
- public enum Dim
- {
- Dim1D = 0,
- Dim2D = 1,
- Dim3D = 2,
- Cube = 3,
- Rect = 4,
- Buffer = 5,
- SubpassData = 6,
- }
-
- public enum SamplerAddressingMode
- {
- None = 0,
- ClampToEdge = 1,
- Clamp = 2,
- Repeat = 3,
- RepeatMirrored = 4,
- }
-
- public enum SamplerFilterMode
- {
- Nearest = 0,
- Linear = 1,
- }
-
- public enum ImageFormat
- {
- 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,
- }
-
- public enum ImageChannelOrder
- {
- 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,
- }
-
- public enum ImageChannelDataType
- {
- 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,
- }
-
- public enum ImageOperandsShift
- {
- Bias = 0,
- Lod = 1,
- Grad = 2,
- ConstOffset = 3,
- Offset = 4,
- ConstOffsets = 5,
- Sample = 6,
- MinLod = 7,
- }
-
- public enum ImageOperandsMask
- {
- MaskNone = 0,
- Bias = 0x00000001,
- Lod = 0x00000002,
- Grad = 0x00000004,
- ConstOffset = 0x00000008,
- Offset = 0x00000010,
- ConstOffsets = 0x00000020,
- Sample = 0x00000040,
- MinLod = 0x00000080,
- }
-
- public enum FPFastMathModeShift
- {
- NotNaN = 0,
- NotInf = 1,
- NSZ = 2,
- AllowRecip = 3,
- Fast = 4,
- }
-
- public enum FPFastMathModeMask
- {
- MaskNone = 0,
- NotNaN = 0x00000001,
- NotInf = 0x00000002,
- NSZ = 0x00000004,
- AllowRecip = 0x00000008,
- Fast = 0x00000010,
- }
-
- public enum FPRoundingMode
- {
- RTE = 0,
- RTZ = 1,
- RTP = 2,
- RTN = 3,
- }
-
- public enum LinkageType
- {
- Export = 0,
- Import = 1,
- }
-
- public enum AccessQualifier
- {
- ReadOnly = 0,
- WriteOnly = 1,
- ReadWrite = 2,
- }
-
- public enum FunctionParameterAttribute
- {
- Zext = 0,
- Sext = 1,
- ByVal = 2,
- Sret = 3,
- NoAlias = 4,
- NoCapture = 5,
- NoWrite = 6,
- NoReadWrite = 7,
- }
-
- public enum Decoration
- {
- 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,
- }
-
- public enum BuiltIn
- {
- 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,
- }
-
- public enum SelectionControlShift
- {
- Flatten = 0,
- DontFlatten = 1,
- }
-
- public enum SelectionControlMask
- {
- MaskNone = 0,
- Flatten = 0x00000001,
- DontFlatten = 0x00000002,
- }
-
- public enum LoopControlShift
- {
- Unroll = 0,
- DontUnroll = 1,
- DependencyInfinite = 2,
- DependencyLength = 3,
- }
-
- public enum LoopControlMask
- {
- MaskNone = 0,
- Unroll = 0x00000001,
- DontUnroll = 0x00000002,
- DependencyInfinite = 0x00000004,
- DependencyLength = 0x00000008,
- }
-
- public enum FunctionControlShift
- {
- Inline = 0,
- DontInline = 1,
- Pure = 2,
- Const = 3,
- }
-
- public enum FunctionControlMask
- {
- MaskNone = 0,
- Inline = 0x00000001,
- DontInline = 0x00000002,
- Pure = 0x00000004,
- Const = 0x00000008,
- }
-
- public enum MemorySemanticsShift
- {
- Acquire = 1,
- Release = 2,
- AcquireRelease = 3,
- SequentiallyConsistent = 4,
- UniformMemory = 6,
- SubgroupMemory = 7,
- WorkgroupMemory = 8,
- CrossWorkgroupMemory = 9,
- AtomicCounterMemory = 10,
- ImageMemory = 11,
- }
-
- public enum MemorySemanticsMask
- {
- MaskNone = 0,
- Acquire = 0x00000002,
- Release = 0x00000004,
- AcquireRelease = 0x00000008,
- SequentiallyConsistent = 0x00000010,
- UniformMemory = 0x00000040,
- SubgroupMemory = 0x00000080,
- WorkgroupMemory = 0x00000100,
- CrossWorkgroupMemory = 0x00000200,
- AtomicCounterMemory = 0x00000400,
- ImageMemory = 0x00000800,
- }
-
- public enum MemoryAccessShift
- {
- Volatile = 0,
- Aligned = 1,
- Nontemporal = 2,
- }
-
- public enum MemoryAccessMask
- {
- MaskNone = 0,
- Volatile = 0x00000001,
- Aligned = 0x00000002,
- Nontemporal = 0x00000004,
- }
-
- public enum Scope
- {
- CrossDevice = 0,
- Device = 1,
- Workgroup = 2,
- Subgroup = 3,
- Invocation = 4,
- }
-
- public enum GroupOperation
- {
- Reduce = 0,
- InclusiveScan = 1,
- ExclusiveScan = 2,
- }
-
- public enum KernelEnqueueFlags
- {
- NoWait = 0,
- WaitKernel = 1,
- WaitWorkGroup = 2,
- }
-
- public enum KernelProfilingInfoShift
- {
- CmdExecTime = 0,
- }
-
- public enum KernelProfilingInfoMask
- {
- MaskNone = 0,
- CmdExecTime = 0x00000001,
- }
-
- public enum Capability
- {
- 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,
- }
-
- public enum Op
- {
- 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,
- }
- }
-}
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp
deleted file mode 100644
index c26ac1f26c6..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp
+++ /dev/null
@@ -1,1024 +0,0 @@
-// 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 SourceLanguage {
- SourceLanguageUnknown = 0,
- SourceLanguageESSL = 1,
- SourceLanguageGLSL = 2,
- SourceLanguageOpenCL_C = 3,
- SourceLanguageOpenCL_CPP = 4,
- SourceLanguageHLSL = 5,
- SourceLanguageMax = 0x7fffffff,
-};
-
-enum ExecutionModel {
- ExecutionModelVertex = 0,
- ExecutionModelTessellationControl = 1,
- ExecutionModelTessellationEvaluation = 2,
- ExecutionModelGeometry = 3,
- ExecutionModelFragment = 4,
- ExecutionModelGLCompute = 5,
- ExecutionModelKernel = 6,
- ExecutionModelMax = 0x7fffffff,
-};
-
-enum AddressingModel {
- AddressingModelLogical = 0,
- AddressingModelPhysical32 = 1,
- AddressingModelPhysical64 = 2,
- AddressingModelMax = 0x7fffffff,
-};
-
-enum MemoryModel {
- MemoryModelSimple = 0,
- MemoryModelGLSL450 = 1,
- MemoryModelOpenCL = 2,
- MemoryModelMax = 0x7fffffff,
-};
-
-enum ExecutionMode {
- ExecutionModeInvocations = 0,
- ExecutionModeSpacingEqual = 1,
- ExecutionModeSpacingFractionalEven = 2,
- ExecutionModeSpacingFractionalOdd = 3,
- ExecutionModeVertexOrderCw = 4,
- ExecutionModeVertexOrderCcw = 5,
- ExecutionModePixelCenterInteger = 6,
- ExecutionModeOriginUpperLeft = 7,
- ExecutionModeOriginLowerLeft = 8,
- ExecutionModeEarlyFragmentTests = 9,
- ExecutionModePointMode = 10,
- ExecutionModeXfb = 11,
- ExecutionModeDepthReplacing = 12,
- ExecutionModeDepthGreater = 14,
- ExecutionModeDepthLess = 15,
- ExecutionModeDepthUnchanged = 16,
- ExecutionModeLocalSize = 17,
- ExecutionModeLocalSizeHint = 18,
- ExecutionModeInputPoints = 19,
- ExecutionModeInputLines = 20,
- ExecutionModeInputLinesAdjacency = 21,
- ExecutionModeTriangles = 22,
- ExecutionModeInputTrianglesAdjacency = 23,
- ExecutionModeQuads = 24,
- ExecutionModeIsolines = 25,
- ExecutionModeOutputVertices = 26,
- ExecutionModeOutputPoints = 27,
- ExecutionModeOutputLineStrip = 28,
- ExecutionModeOutputTriangleStrip = 29,
- ExecutionModeVecTypeHint = 30,
- ExecutionModeContractionOff = 31,
- ExecutionModeInitializer = 33,
- ExecutionModeFinalizer = 34,
- ExecutionModeSubgroupSize = 35,
- ExecutionModeSubgroupsPerWorkgroup = 36,
- ExecutionModePostDepthCoverage = 4446,
- ExecutionModeStencilRefReplacingEXT = 5027,
- ExecutionModeMax = 0x7fffffff,
-};
-
-enum StorageClass {
- StorageClassUniformConstant = 0,
- StorageClassInput = 1,
- StorageClassUniform = 2,
- StorageClassOutput = 3,
- StorageClassWorkgroup = 4,
- StorageClassCrossWorkgroup = 5,
- StorageClassPrivate = 6,
- StorageClassFunction = 7,
- StorageClassGeneric = 8,
- StorageClassPushConstant = 9,
- StorageClassAtomicCounter = 10,
- StorageClassImage = 11,
- StorageClassStorageBuffer = 12,
- StorageClassMax = 0x7fffffff,
-};
-
-enum Dim {
- Dim1D = 0,
- Dim2D = 1,
- Dim3D = 2,
- DimCube = 3,
- DimRect = 4,
- DimBuffer = 5,
- DimSubpassData = 6,
- DimMax = 0x7fffffff,
-};
-
-enum SamplerAddressingMode {
- SamplerAddressingModeNone = 0,
- SamplerAddressingModeClampToEdge = 1,
- SamplerAddressingModeClamp = 2,
- SamplerAddressingModeRepeat = 3,
- SamplerAddressingModeRepeatMirrored = 4,
- SamplerAddressingModeMax = 0x7fffffff,
-};
-
-enum SamplerFilterMode {
- SamplerFilterModeNearest = 0,
- SamplerFilterModeLinear = 1,
- SamplerFilterModeMax = 0x7fffffff,
-};
-
-enum ImageFormat {
- ImageFormatUnknown = 0,
- ImageFormatRgba32f = 1,
- ImageFormatRgba16f = 2,
- ImageFormatR32f = 3,
- ImageFormatRgba8 = 4,
- ImageFormatRgba8Snorm = 5,
- ImageFormatRg32f = 6,
- ImageFormatRg16f = 7,
- ImageFormatR11fG11fB10f = 8,
- ImageFormatR16f = 9,
- ImageFormatRgba16 = 10,
- ImageFormatRgb10A2 = 11,
- ImageFormatRg16 = 12,
- ImageFormatRg8 = 13,
- ImageFormatR16 = 14,
- ImageFormatR8 = 15,
- ImageFormatRgba16Snorm = 16,
- ImageFormatRg16Snorm = 17,
- ImageFormatRg8Snorm = 18,
- ImageFormatR16Snorm = 19,
- ImageFormatR8Snorm = 20,
- ImageFormatRgba32i = 21,
- ImageFormatRgba16i = 22,
- ImageFormatRgba8i = 23,
- ImageFormatR32i = 24,
- ImageFormatRg32i = 25,
- ImageFormatRg16i = 26,
- ImageFormatRg8i = 27,
- ImageFormatR16i = 28,
- ImageFormatR8i = 29,
- ImageFormatRgba32ui = 30,
- ImageFormatRgba16ui = 31,
- ImageFormatRgba8ui = 32,
- ImageFormatR32ui = 33,
- ImageFormatRgb10a2ui = 34,
- ImageFormatRg32ui = 35,
- ImageFormatRg16ui = 36,
- ImageFormatRg8ui = 37,
- ImageFormatR16ui = 38,
- ImageFormatR8ui = 39,
- ImageFormatMax = 0x7fffffff,
-};
-
-enum ImageChannelOrder {
- ImageChannelOrderR = 0,
- ImageChannelOrderA = 1,
- ImageChannelOrderRG = 2,
- ImageChannelOrderRA = 3,
- ImageChannelOrderRGB = 4,
- ImageChannelOrderRGBA = 5,
- ImageChannelOrderBGRA = 6,
- ImageChannelOrderARGB = 7,
- ImageChannelOrderIntensity = 8,
- ImageChannelOrderLuminance = 9,
- ImageChannelOrderRx = 10,
- ImageChannelOrderRGx = 11,
- ImageChannelOrderRGBx = 12,
- ImageChannelOrderDepth = 13,
- ImageChannelOrderDepthStencil = 14,
- ImageChannelOrdersRGB = 15,
- ImageChannelOrdersRGBx = 16,
- ImageChannelOrdersRGBA = 17,
- ImageChannelOrdersBGRA = 18,
- ImageChannelOrderABGR = 19,
- ImageChannelOrderMax = 0x7fffffff,
-};
-
-enum ImageChannelDataType {
- ImageChannelDataTypeSnormInt8 = 0,
- ImageChannelDataTypeSnormInt16 = 1,
- ImageChannelDataTypeUnormInt8 = 2,
- ImageChannelDataTypeUnormInt16 = 3,
- ImageChannelDataTypeUnormShort565 = 4,
- ImageChannelDataTypeUnormShort555 = 5,
- ImageChannelDataTypeUnormInt101010 = 6,
- ImageChannelDataTypeSignedInt8 = 7,
- ImageChannelDataTypeSignedInt16 = 8,
- ImageChannelDataTypeSignedInt32 = 9,
- ImageChannelDataTypeUnsignedInt8 = 10,
- ImageChannelDataTypeUnsignedInt16 = 11,
- ImageChannelDataTypeUnsignedInt32 = 12,
- ImageChannelDataTypeHalfFloat = 13,
- ImageChannelDataTypeFloat = 14,
- ImageChannelDataTypeUnormInt24 = 15,
- ImageChannelDataTypeUnormInt101010_2 = 16,
- ImageChannelDataTypeMax = 0x7fffffff,
-};
-
-enum ImageOperandsShift {
- ImageOperandsBiasShift = 0,
- ImageOperandsLodShift = 1,
- ImageOperandsGradShift = 2,
- ImageOperandsConstOffsetShift = 3,
- ImageOperandsOffsetShift = 4,
- ImageOperandsConstOffsetsShift = 5,
- ImageOperandsSampleShift = 6,
- ImageOperandsMinLodShift = 7,
- ImageOperandsMax = 0x7fffffff,
-};
-
-enum ImageOperandsMask {
- ImageOperandsMaskNone = 0,
- ImageOperandsBiasMask = 0x00000001,
- ImageOperandsLodMask = 0x00000002,
- ImageOperandsGradMask = 0x00000004,
- ImageOperandsConstOffsetMask = 0x00000008,
- ImageOperandsOffsetMask = 0x00000010,
- ImageOperandsConstOffsetsMask = 0x00000020,
- ImageOperandsSampleMask = 0x00000040,
- ImageOperandsMinLodMask = 0x00000080,
-};
-
-enum FPFastMathModeShift {
- FPFastMathModeNotNaNShift = 0,
- FPFastMathModeNotInfShift = 1,
- FPFastMathModeNSZShift = 2,
- FPFastMathModeAllowRecipShift = 3,
- FPFastMathModeFastShift = 4,
- FPFastMathModeMax = 0x7fffffff,
-};
-
-enum FPFastMathModeMask {
- FPFastMathModeMaskNone = 0,
- FPFastMathModeNotNaNMask = 0x00000001,
- FPFastMathModeNotInfMask = 0x00000002,
- FPFastMathModeNSZMask = 0x00000004,
- FPFastMathModeAllowRecipMask = 0x00000008,
- FPFastMathModeFastMask = 0x00000010,
-};
-
-enum FPRoundingMode {
- FPRoundingModeRTE = 0,
- FPRoundingModeRTZ = 1,
- FPRoundingModeRTP = 2,
- FPRoundingModeRTN = 3,
- FPRoundingModeMax = 0x7fffffff,
-};
-
-enum LinkageType {
- LinkageTypeExport = 0,
- LinkageTypeImport = 1,
- LinkageTypeMax = 0x7fffffff,
-};
-
-enum AccessQualifier {
- AccessQualifierReadOnly = 0,
- AccessQualifierWriteOnly = 1,
- AccessQualifierReadWrite = 2,
- AccessQualifierMax = 0x7fffffff,
-};
-
-enum FunctionParameterAttribute {
- FunctionParameterAttributeZext = 0,
- FunctionParameterAttributeSext = 1,
- FunctionParameterAttributeByVal = 2,
- FunctionParameterAttributeSret = 3,
- FunctionParameterAttributeNoAlias = 4,
- FunctionParameterAttributeNoCapture = 5,
- FunctionParameterAttributeNoWrite = 6,
- FunctionParameterAttributeNoReadWrite = 7,
- FunctionParameterAttributeMax = 0x7fffffff,
-};
-
-enum Decoration {
- DecorationRelaxedPrecision = 0,
- DecorationSpecId = 1,
- DecorationBlock = 2,
- DecorationBufferBlock = 3,
- DecorationRowMajor = 4,
- DecorationColMajor = 5,
- DecorationArrayStride = 6,
- DecorationMatrixStride = 7,
- DecorationGLSLShared = 8,
- DecorationGLSLPacked = 9,
- DecorationCPacked = 10,
- DecorationBuiltIn = 11,
- DecorationNoPerspective = 13,
- DecorationFlat = 14,
- DecorationPatch = 15,
- DecorationCentroid = 16,
- DecorationSample = 17,
- DecorationInvariant = 18,
- DecorationRestrict = 19,
- DecorationAliased = 20,
- DecorationVolatile = 21,
- DecorationConstant = 22,
- DecorationCoherent = 23,
- DecorationNonWritable = 24,
- DecorationNonReadable = 25,
- DecorationUniform = 26,
- DecorationSaturatedConversion = 28,
- DecorationStream = 29,
- DecorationLocation = 30,
- DecorationComponent = 31,
- DecorationIndex = 32,
- DecorationBinding = 33,
- DecorationDescriptorSet = 34,
- DecorationOffset = 35,
- DecorationXfbBuffer = 36,
- DecorationXfbStride = 37,
- DecorationFuncParamAttr = 38,
- DecorationFPRoundingMode = 39,
- DecorationFPFastMathMode = 40,
- DecorationLinkageAttributes = 41,
- DecorationNoContraction = 42,
- DecorationInputAttachmentIndex = 43,
- DecorationAlignment = 44,
- DecorationMaxByteOffset = 45,
- DecorationExplicitInterpAMD = 4999,
- DecorationOverrideCoverageNV = 5248,
- DecorationPassthroughNV = 5250,
- DecorationViewportRelativeNV = 5252,
- DecorationSecondaryViewportRelativeNV = 5256,
- DecorationHlslCounterBufferGOOGLE = 5634,
- DecorationHlslSemanticGOOGLE = 5635,
- DecorationMax = 0x7fffffff,
-};
-
-enum BuiltIn {
- BuiltInPosition = 0,
- BuiltInPointSize = 1,
- BuiltInClipDistance = 3,
- BuiltInCullDistance = 4,
- BuiltInVertexId = 5,
- BuiltInInstanceId = 6,
- BuiltInPrimitiveId = 7,
- BuiltInInvocationId = 8,
- BuiltInLayer = 9,
- BuiltInViewportIndex = 10,
- BuiltInTessLevelOuter = 11,
- BuiltInTessLevelInner = 12,
- BuiltInTessCoord = 13,
- BuiltInPatchVertices = 14,
- BuiltInFragCoord = 15,
- BuiltInPointCoord = 16,
- BuiltInFrontFacing = 17,
- BuiltInSampleId = 18,
- BuiltInSamplePosition = 19,
- BuiltInSampleMask = 20,
- BuiltInFragDepth = 22,
- BuiltInHelperInvocation = 23,
- BuiltInNumWorkgroups = 24,
- BuiltInWorkgroupSize = 25,
- BuiltInWorkgroupId = 26,
- BuiltInLocalInvocationId = 27,
- BuiltInGlobalInvocationId = 28,
- BuiltInLocalInvocationIndex = 29,
- BuiltInWorkDim = 30,
- BuiltInGlobalSize = 31,
- BuiltInEnqueuedWorkgroupSize = 32,
- BuiltInGlobalOffset = 33,
- BuiltInGlobalLinearId = 34,
- BuiltInSubgroupSize = 36,
- BuiltInSubgroupMaxSize = 37,
- BuiltInNumSubgroups = 38,
- BuiltInNumEnqueuedSubgroups = 39,
- BuiltInSubgroupId = 40,
- BuiltInSubgroupLocalInvocationId = 41,
- BuiltInVertexIndex = 42,
- BuiltInInstanceIndex = 43,
- BuiltInSubgroupEqMaskKHR = 4416,
- BuiltInSubgroupGeMaskKHR = 4417,
- BuiltInSubgroupGtMaskKHR = 4418,
- BuiltInSubgroupLeMaskKHR = 4419,
- BuiltInSubgroupLtMaskKHR = 4420,
- BuiltInBaseVertex = 4424,
- BuiltInBaseInstance = 4425,
- BuiltInDrawIndex = 4426,
- BuiltInDeviceIndex = 4438,
- BuiltInViewIndex = 4440,
- BuiltInBaryCoordNoPerspAMD = 4992,
- BuiltInBaryCoordNoPerspCentroidAMD = 4993,
- BuiltInBaryCoordNoPerspSampleAMD = 4994,
- BuiltInBaryCoordSmoothAMD = 4995,
- BuiltInBaryCoordSmoothCentroidAMD = 4996,
- BuiltInBaryCoordSmoothSampleAMD = 4997,
- BuiltInBaryCoordPullModelAMD = 4998,
- BuiltInFragStencilRefEXT = 5014,
- BuiltInViewportMaskNV = 5253,
- BuiltInSecondaryPositionNV = 5257,
- BuiltInSecondaryViewportMaskNV = 5258,
- BuiltInPositionPerViewNV = 5261,
- BuiltInViewportMaskPerViewNV = 5262,
- BuiltInMax = 0x7fffffff,
-};
-
-enum SelectionControlShift {
- SelectionControlFlattenShift = 0,
- SelectionControlDontFlattenShift = 1,
- SelectionControlMax = 0x7fffffff,
-};
-
-enum SelectionControlMask {
- SelectionControlMaskNone = 0,
- SelectionControlFlattenMask = 0x00000001,
- SelectionControlDontFlattenMask = 0x00000002,
-};
-
-enum LoopControlShift {
- LoopControlUnrollShift = 0,
- LoopControlDontUnrollShift = 1,
- LoopControlDependencyInfiniteShift = 2,
- LoopControlDependencyLengthShift = 3,
- LoopControlMax = 0x7fffffff,
-};
-
-enum LoopControlMask {
- LoopControlMaskNone = 0,
- LoopControlUnrollMask = 0x00000001,
- LoopControlDontUnrollMask = 0x00000002,
- LoopControlDependencyInfiniteMask = 0x00000004,
- LoopControlDependencyLengthMask = 0x00000008,
-};
-
-enum FunctionControlShift {
- FunctionControlInlineShift = 0,
- FunctionControlDontInlineShift = 1,
- FunctionControlPureShift = 2,
- FunctionControlConstShift = 3,
- FunctionControlMax = 0x7fffffff,
-};
-
-enum FunctionControlMask {
- FunctionControlMaskNone = 0,
- FunctionControlInlineMask = 0x00000001,
- FunctionControlDontInlineMask = 0x00000002,
- FunctionControlPureMask = 0x00000004,
- FunctionControlConstMask = 0x00000008,
-};
-
-enum MemorySemanticsShift {
- MemorySemanticsAcquireShift = 1,
- MemorySemanticsReleaseShift = 2,
- MemorySemanticsAcquireReleaseShift = 3,
- MemorySemanticsSequentiallyConsistentShift = 4,
- MemorySemanticsUniformMemoryShift = 6,
- MemorySemanticsSubgroupMemoryShift = 7,
- MemorySemanticsWorkgroupMemoryShift = 8,
- MemorySemanticsCrossWorkgroupMemoryShift = 9,
- MemorySemanticsAtomicCounterMemoryShift = 10,
- MemorySemanticsImageMemoryShift = 11,
- MemorySemanticsMax = 0x7fffffff,
-};
-
-enum MemorySemanticsMask {
- MemorySemanticsMaskNone = 0,
- MemorySemanticsAcquireMask = 0x00000002,
- MemorySemanticsReleaseMask = 0x00000004,
- MemorySemanticsAcquireReleaseMask = 0x00000008,
- MemorySemanticsSequentiallyConsistentMask = 0x00000010,
- MemorySemanticsUniformMemoryMask = 0x00000040,
- MemorySemanticsSubgroupMemoryMask = 0x00000080,
- MemorySemanticsWorkgroupMemoryMask = 0x00000100,
- MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
- MemorySemanticsAtomicCounterMemoryMask = 0x00000400,
- MemorySemanticsImageMemoryMask = 0x00000800,
-};
-
-enum MemoryAccessShift {
- MemoryAccessVolatileShift = 0,
- MemoryAccessAlignedShift = 1,
- MemoryAccessNontemporalShift = 2,
- MemoryAccessMax = 0x7fffffff,
-};
-
-enum MemoryAccessMask {
- MemoryAccessMaskNone = 0,
- MemoryAccessVolatileMask = 0x00000001,
- MemoryAccessAlignedMask = 0x00000002,
- MemoryAccessNontemporalMask = 0x00000004,
-};
-
-enum Scope {
- ScopeCrossDevice = 0,
- ScopeDevice = 1,
- ScopeWorkgroup = 2,
- ScopeSubgroup = 3,
- ScopeInvocation = 4,
- ScopeMax = 0x7fffffff,
-};
-
-enum GroupOperation {
- GroupOperationReduce = 0,
- GroupOperationInclusiveScan = 1,
- GroupOperationExclusiveScan = 2,
- GroupOperationMax = 0x7fffffff,
-};
-
-enum KernelEnqueueFlags {
- KernelEnqueueFlagsNoWait = 0,
- KernelEnqueueFlagsWaitKernel = 1,
- KernelEnqueueFlagsWaitWorkGroup = 2,
- KernelEnqueueFlagsMax = 0x7fffffff,
-};
-
-enum KernelProfilingInfoShift {
- KernelProfilingInfoCmdExecTimeShift = 0,
- KernelProfilingInfoMax = 0x7fffffff,
-};
-
-enum KernelProfilingInfoMask {
- KernelProfilingInfoMaskNone = 0,
- KernelProfilingInfoCmdExecTimeMask = 0x00000001,
-};
-
-enum Capability {
- CapabilityMatrix = 0,
- CapabilityShader = 1,
- CapabilityGeometry = 2,
- CapabilityTessellation = 3,
- CapabilityAddresses = 4,
- CapabilityLinkage = 5,
- CapabilityKernel = 6,
- CapabilityVector16 = 7,
- CapabilityFloat16Buffer = 8,
- CapabilityFloat16 = 9,
- CapabilityFloat64 = 10,
- CapabilityInt64 = 11,
- CapabilityInt64Atomics = 12,
- CapabilityImageBasic = 13,
- CapabilityImageReadWrite = 14,
- CapabilityImageMipmap = 15,
- CapabilityPipes = 17,
- CapabilityGroups = 18,
- CapabilityDeviceEnqueue = 19,
- CapabilityLiteralSampler = 20,
- CapabilityAtomicStorage = 21,
- CapabilityInt16 = 22,
- CapabilityTessellationPointSize = 23,
- CapabilityGeometryPointSize = 24,
- CapabilityImageGatherExtended = 25,
- CapabilityStorageImageMultisample = 27,
- CapabilityUniformBufferArrayDynamicIndexing = 28,
- CapabilitySampledImageArrayDynamicIndexing = 29,
- CapabilityStorageBufferArrayDynamicIndexing = 30,
- CapabilityStorageImageArrayDynamicIndexing = 31,
- CapabilityClipDistance = 32,
- CapabilityCullDistance = 33,
- CapabilityImageCubeArray = 34,
- CapabilitySampleRateShading = 35,
- CapabilityImageRect = 36,
- CapabilitySampledRect = 37,
- CapabilityGenericPointer = 38,
- CapabilityInt8 = 39,
- CapabilityInputAttachment = 40,
- CapabilitySparseResidency = 41,
- CapabilityMinLod = 42,
- CapabilitySampled1D = 43,
- CapabilityImage1D = 44,
- CapabilitySampledCubeArray = 45,
- CapabilitySampledBuffer = 46,
- CapabilityImageBuffer = 47,
- CapabilityImageMSArray = 48,
- CapabilityStorageImageExtendedFormats = 49,
- CapabilityImageQuery = 50,
- CapabilityDerivativeControl = 51,
- CapabilityInterpolationFunction = 52,
- CapabilityTransformFeedback = 53,
- CapabilityGeometryStreams = 54,
- CapabilityStorageImageReadWithoutFormat = 55,
- CapabilityStorageImageWriteWithoutFormat = 56,
- CapabilityMultiViewport = 57,
- CapabilitySubgroupDispatch = 58,
- CapabilityNamedBarrier = 59,
- CapabilityPipeStorage = 60,
- CapabilitySubgroupBallotKHR = 4423,
- CapabilityDrawParameters = 4427,
- CapabilitySubgroupVoteKHR = 4431,
- CapabilityStorageBuffer16BitAccess = 4433,
- CapabilityStorageUniformBufferBlock16 = 4433,
- CapabilityStorageUniform16 = 4434,
- CapabilityUniformAndStorageBuffer16BitAccess = 4434,
- CapabilityStoragePushConstant16 = 4435,
- CapabilityStorageInputOutput16 = 4436,
- CapabilityDeviceGroup = 4437,
- CapabilityMultiView = 4439,
- CapabilityVariablePointersStorageBuffer = 4441,
- CapabilityVariablePointers = 4442,
- CapabilityAtomicStorageOps = 4445,
- CapabilitySampleMaskPostDepthCoverage = 4447,
- CapabilityImageGatherBiasLodAMD = 5009,
- CapabilityFragmentMaskAMD = 5010,
- CapabilityStencilExportEXT = 5013,
- CapabilityImageReadWriteLodAMD = 5015,
- CapabilitySampleMaskOverrideCoverageNV = 5249,
- CapabilityGeometryShaderPassthroughNV = 5251,
- CapabilityShaderViewportIndexLayerEXT = 5254,
- CapabilityShaderViewportIndexLayerNV = 5254,
- CapabilityShaderViewportMaskNV = 5255,
- CapabilityShaderStereoViewNV = 5259,
- CapabilityPerViewAttributesNV = 5260,
- CapabilitySubgroupShuffleINTEL = 5568,
- CapabilitySubgroupBufferBlockIOINTEL = 5569,
- CapabilitySubgroupImageBlockIOINTEL = 5570,
- CapabilityMax = 0x7fffffff,
-};
-
-enum Op {
- 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,
- OpMax = 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/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp11 b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp11
deleted file mode 100644
index 992d43b5f54..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.hpp11
+++ /dev/null
@@ -1,1024 +0,0 @@
-// 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/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.lua b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.lua
deleted file mode 100644
index ad34e0abe9d..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.lua
+++ /dev/null
@@ -1,971 +0,0 @@
--- 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.
-
-spv = {
- MagicNumber = 0x07230203,
- Version = 0x00010100,
- Revision = 8,
- OpCodeMask = 0xffff,
- WordCountShift = 16,
-
- SourceLanguage = {
- Unknown = 0,
- ESSL = 1,
- GLSL = 2,
- OpenCL_C = 3,
- OpenCL_CPP = 4,
- HLSL = 5,
- },
-
- ExecutionModel = {
- Vertex = 0,
- TessellationControl = 1,
- TessellationEvaluation = 2,
- Geometry = 3,
- Fragment = 4,
- GLCompute = 5,
- Kernel = 6,
- },
-
- AddressingModel = {
- Logical = 0,
- Physical32 = 1,
- Physical64 = 2,
- },
-
- MemoryModel = {
- Simple = 0,
- GLSL450 = 1,
- OpenCL = 2,
- },
-
- ExecutionMode = {
- 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,
- },
-
- StorageClass = {
- 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,
- },
-
- Dim = {
- Dim1D = 0,
- Dim2D = 1,
- Dim3D = 2,
- Cube = 3,
- Rect = 4,
- Buffer = 5,
- SubpassData = 6,
- },
-
- SamplerAddressingMode = {
- None = 0,
- ClampToEdge = 1,
- Clamp = 2,
- Repeat = 3,
- RepeatMirrored = 4,
- },
-
- SamplerFilterMode = {
- Nearest = 0,
- Linear = 1,
- },
-
- ImageFormat = {
- 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,
- },
-
- ImageChannelOrder = {
- 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,
- },
-
- ImageChannelDataType = {
- 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,
- },
-
- ImageOperandsShift = {
- Bias = 0,
- Lod = 1,
- Grad = 2,
- ConstOffset = 3,
- Offset = 4,
- ConstOffsets = 5,
- Sample = 6,
- MinLod = 7,
- },
-
- ImageOperandsMask = {
- MaskNone = 0,
- Bias = 0x00000001,
- Lod = 0x00000002,
- Grad = 0x00000004,
- ConstOffset = 0x00000008,
- Offset = 0x00000010,
- ConstOffsets = 0x00000020,
- Sample = 0x00000040,
- MinLod = 0x00000080,
- },
-
- FPFastMathModeShift = {
- NotNaN = 0,
- NotInf = 1,
- NSZ = 2,
- AllowRecip = 3,
- Fast = 4,
- },
-
- FPFastMathModeMask = {
- MaskNone = 0,
- NotNaN = 0x00000001,
- NotInf = 0x00000002,
- NSZ = 0x00000004,
- AllowRecip = 0x00000008,
- Fast = 0x00000010,
- },
-
- FPRoundingMode = {
- RTE = 0,
- RTZ = 1,
- RTP = 2,
- RTN = 3,
- },
-
- LinkageType = {
- Export = 0,
- Import = 1,
- },
-
- AccessQualifier = {
- ReadOnly = 0,
- WriteOnly = 1,
- ReadWrite = 2,
- },
-
- FunctionParameterAttribute = {
- Zext = 0,
- Sext = 1,
- ByVal = 2,
- Sret = 3,
- NoAlias = 4,
- NoCapture = 5,
- NoWrite = 6,
- NoReadWrite = 7,
- },
-
- Decoration = {
- 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,
- },
-
- BuiltIn = {
- 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,
- },
-
- SelectionControlShift = {
- Flatten = 0,
- DontFlatten = 1,
- },
-
- SelectionControlMask = {
- MaskNone = 0,
- Flatten = 0x00000001,
- DontFlatten = 0x00000002,
- },
-
- LoopControlShift = {
- Unroll = 0,
- DontUnroll = 1,
- DependencyInfinite = 2,
- DependencyLength = 3,
- },
-
- LoopControlMask = {
- MaskNone = 0,
- Unroll = 0x00000001,
- DontUnroll = 0x00000002,
- DependencyInfinite = 0x00000004,
- DependencyLength = 0x00000008,
- },
-
- FunctionControlShift = {
- Inline = 0,
- DontInline = 1,
- Pure = 2,
- Const = 3,
- },
-
- FunctionControlMask = {
- MaskNone = 0,
- Inline = 0x00000001,
- DontInline = 0x00000002,
- Pure = 0x00000004,
- Const = 0x00000008,
- },
-
- MemorySemanticsShift = {
- Acquire = 1,
- Release = 2,
- AcquireRelease = 3,
- SequentiallyConsistent = 4,
- UniformMemory = 6,
- SubgroupMemory = 7,
- WorkgroupMemory = 8,
- CrossWorkgroupMemory = 9,
- AtomicCounterMemory = 10,
- ImageMemory = 11,
- },
-
- MemorySemanticsMask = {
- MaskNone = 0,
- Acquire = 0x00000002,
- Release = 0x00000004,
- AcquireRelease = 0x00000008,
- SequentiallyConsistent = 0x00000010,
- UniformMemory = 0x00000040,
- SubgroupMemory = 0x00000080,
- WorkgroupMemory = 0x00000100,
- CrossWorkgroupMemory = 0x00000200,
- AtomicCounterMemory = 0x00000400,
- ImageMemory = 0x00000800,
- },
-
- MemoryAccessShift = {
- Volatile = 0,
- Aligned = 1,
- Nontemporal = 2,
- },
-
- MemoryAccessMask = {
- MaskNone = 0,
- Volatile = 0x00000001,
- Aligned = 0x00000002,
- Nontemporal = 0x00000004,
- },
-
- Scope = {
- CrossDevice = 0,
- Device = 1,
- Workgroup = 2,
- Subgroup = 3,
- Invocation = 4,
- },
-
- GroupOperation = {
- Reduce = 0,
- InclusiveScan = 1,
- ExclusiveScan = 2,
- },
-
- KernelEnqueueFlags = {
- NoWait = 0,
- WaitKernel = 1,
- WaitWorkGroup = 2,
- },
-
- KernelProfilingInfoShift = {
- CmdExecTime = 0,
- },
-
- KernelProfilingInfoMask = {
- MaskNone = 0,
- CmdExecTime = 0x00000001,
- },
-
- Capability = {
- 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,
- },
-
- Op = {
- 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,
- },
-
-}
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.py b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.py
deleted file mode 100644
index 519a59710d1..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.1/spirv.py
+++ /dev/null
@@ -1,971 +0,0 @@
-# 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.
-
-spv = {
- 'MagicNumber' : 0x07230203,
- 'Version' : 0x00010100,
- 'Revision' : 8,
- 'OpCodeMask' : 0xffff,
- 'WordCountShift' : 16,
-
- 'SourceLanguage' : {
- 'Unknown' : 0,
- 'ESSL' : 1,
- 'GLSL' : 2,
- 'OpenCL_C' : 3,
- 'OpenCL_CPP' : 4,
- 'HLSL' : 5,
- },
-
- 'ExecutionModel' : {
- 'Vertex' : 0,
- 'TessellationControl' : 1,
- 'TessellationEvaluation' : 2,
- 'Geometry' : 3,
- 'Fragment' : 4,
- 'GLCompute' : 5,
- 'Kernel' : 6,
- },
-
- 'AddressingModel' : {
- 'Logical' : 0,
- 'Physical32' : 1,
- 'Physical64' : 2,
- },
-
- 'MemoryModel' : {
- 'Simple' : 0,
- 'GLSL450' : 1,
- 'OpenCL' : 2,
- },
-
- 'ExecutionMode' : {
- '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,
- },
-
- 'StorageClass' : {
- '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,
- },
-
- 'Dim' : {
- 'Dim1D' : 0,
- 'Dim2D' : 1,
- 'Dim3D' : 2,
- 'Cube' : 3,
- 'Rect' : 4,
- 'Buffer' : 5,
- 'SubpassData' : 6,
- },
-
- 'SamplerAddressingMode' : {
- 'None' : 0,
- 'ClampToEdge' : 1,
- 'Clamp' : 2,
- 'Repeat' : 3,
- 'RepeatMirrored' : 4,
- },
-
- 'SamplerFilterMode' : {
- 'Nearest' : 0,
- 'Linear' : 1,
- },
-
- 'ImageFormat' : {
- '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,
- },
-
- 'ImageChannelOrder' : {
- '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,
- },
-
- 'ImageChannelDataType' : {
- '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,
- },
-
- 'ImageOperandsShift' : {
- 'Bias' : 0,
- 'Lod' : 1,
- 'Grad' : 2,
- 'ConstOffset' : 3,
- 'Offset' : 4,
- 'ConstOffsets' : 5,
- 'Sample' : 6,
- 'MinLod' : 7,
- },
-
- 'ImageOperandsMask' : {
- 'MaskNone' : 0,
- 'Bias' : 0x00000001,
- 'Lod' : 0x00000002,
- 'Grad' : 0x00000004,
- 'ConstOffset' : 0x00000008,
- 'Offset' : 0x00000010,
- 'ConstOffsets' : 0x00000020,
- 'Sample' : 0x00000040,
- 'MinLod' : 0x00000080,
- },
-
- 'FPFastMathModeShift' : {
- 'NotNaN' : 0,
- 'NotInf' : 1,
- 'NSZ' : 2,
- 'AllowRecip' : 3,
- 'Fast' : 4,
- },
-
- 'FPFastMathModeMask' : {
- 'MaskNone' : 0,
- 'NotNaN' : 0x00000001,
- 'NotInf' : 0x00000002,
- 'NSZ' : 0x00000004,
- 'AllowRecip' : 0x00000008,
- 'Fast' : 0x00000010,
- },
-
- 'FPRoundingMode' : {
- 'RTE' : 0,
- 'RTZ' : 1,
- 'RTP' : 2,
- 'RTN' : 3,
- },
-
- 'LinkageType' : {
- 'Export' : 0,
- 'Import' : 1,
- },
-
- 'AccessQualifier' : {
- 'ReadOnly' : 0,
- 'WriteOnly' : 1,
- 'ReadWrite' : 2,
- },
-
- 'FunctionParameterAttribute' : {
- 'Zext' : 0,
- 'Sext' : 1,
- 'ByVal' : 2,
- 'Sret' : 3,
- 'NoAlias' : 4,
- 'NoCapture' : 5,
- 'NoWrite' : 6,
- 'NoReadWrite' : 7,
- },
-
- 'Decoration' : {
- '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,
- },
-
- 'BuiltIn' : {
- '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,
- },
-
- 'SelectionControlShift' : {
- 'Flatten' : 0,
- 'DontFlatten' : 1,
- },
-
- 'SelectionControlMask' : {
- 'MaskNone' : 0,
- 'Flatten' : 0x00000001,
- 'DontFlatten' : 0x00000002,
- },
-
- 'LoopControlShift' : {
- 'Unroll' : 0,
- 'DontUnroll' : 1,
- 'DependencyInfinite' : 2,
- 'DependencyLength' : 3,
- },
-
- 'LoopControlMask' : {
- 'MaskNone' : 0,
- 'Unroll' : 0x00000001,
- 'DontUnroll' : 0x00000002,
- 'DependencyInfinite' : 0x00000004,
- 'DependencyLength' : 0x00000008,
- },
-
- 'FunctionControlShift' : {
- 'Inline' : 0,
- 'DontInline' : 1,
- 'Pure' : 2,
- 'Const' : 3,
- },
-
- 'FunctionControlMask' : {
- 'MaskNone' : 0,
- 'Inline' : 0x00000001,
- 'DontInline' : 0x00000002,
- 'Pure' : 0x00000004,
- 'Const' : 0x00000008,
- },
-
- 'MemorySemanticsShift' : {
- 'Acquire' : 1,
- 'Release' : 2,
- 'AcquireRelease' : 3,
- 'SequentiallyConsistent' : 4,
- 'UniformMemory' : 6,
- 'SubgroupMemory' : 7,
- 'WorkgroupMemory' : 8,
- 'CrossWorkgroupMemory' : 9,
- 'AtomicCounterMemory' : 10,
- 'ImageMemory' : 11,
- },
-
- 'MemorySemanticsMask' : {
- 'MaskNone' : 0,
- 'Acquire' : 0x00000002,
- 'Release' : 0x00000004,
- 'AcquireRelease' : 0x00000008,
- 'SequentiallyConsistent' : 0x00000010,
- 'UniformMemory' : 0x00000040,
- 'SubgroupMemory' : 0x00000080,
- 'WorkgroupMemory' : 0x00000100,
- 'CrossWorkgroupMemory' : 0x00000200,
- 'AtomicCounterMemory' : 0x00000400,
- 'ImageMemory' : 0x00000800,
- },
-
- 'MemoryAccessShift' : {
- 'Volatile' : 0,
- 'Aligned' : 1,
- 'Nontemporal' : 2,
- },
-
- 'MemoryAccessMask' : {
- 'MaskNone' : 0,
- 'Volatile' : 0x00000001,
- 'Aligned' : 0x00000002,
- 'Nontemporal' : 0x00000004,
- },
-
- 'Scope' : {
- 'CrossDevice' : 0,
- 'Device' : 1,
- 'Workgroup' : 2,
- 'Subgroup' : 3,
- 'Invocation' : 4,
- },
-
- 'GroupOperation' : {
- 'Reduce' : 0,
- 'InclusiveScan' : 1,
- 'ExclusiveScan' : 2,
- },
-
- 'KernelEnqueueFlags' : {
- 'NoWait' : 0,
- 'WaitKernel' : 1,
- 'WaitWorkGroup' : 2,
- },
-
- 'KernelProfilingInfoShift' : {
- 'CmdExecTime' : 0,
- },
-
- 'KernelProfilingInfoMask' : {
- 'MaskNone' : 0,
- 'CmdExecTime' : 0x00000001,
- },
-
- 'Capability' : {
- '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,
- },
-
- 'Op' : {
- '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,
- },
-
-}
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.cs b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.cs
deleted file mode 100644
index 493303d6ab0..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.cs
+++ /dev/null
@@ -1,1021 +0,0 @@
-// 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#
-//
-// - 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
-//
-// 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.
-
-namespace Spv
-{
-
- public static class Specification
- {
- public const uint MagicNumber = 0x07230203;
- public const uint Version = 0x00010200;
- public const uint Revision = 2;
- public const uint OpCodeMask = 0xffff;
- public const uint WordCountShift = 16;
-
- public enum SourceLanguage
- {
- Unknown = 0,
- ESSL = 1,
- GLSL = 2,
- OpenCL_C = 3,
- OpenCL_CPP = 4,
- HLSL = 5,
- }
-
- public enum ExecutionModel
- {
- Vertex = 0,
- TessellationControl = 1,
- TessellationEvaluation = 2,
- Geometry = 3,
- Fragment = 4,
- GLCompute = 5,
- Kernel = 6,
- }
-
- public enum AddressingModel
- {
- Logical = 0,
- Physical32 = 1,
- Physical64 = 2,
- }
-
- public enum MemoryModel
- {
- Simple = 0,
- GLSL450 = 1,
- OpenCL = 2,
- }
-
- public enum ExecutionMode
- {
- 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,
- }
-
- public enum StorageClass
- {
- 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,
- }
-
- public enum Dim
- {
- Dim1D = 0,
- Dim2D = 1,
- Dim3D = 2,
- Cube = 3,
- Rect = 4,
- Buffer = 5,
- SubpassData = 6,
- }
-
- public enum SamplerAddressingMode
- {
- None = 0,
- ClampToEdge = 1,
- Clamp = 2,
- Repeat = 3,
- RepeatMirrored = 4,
- }
-
- public enum SamplerFilterMode
- {
- Nearest = 0,
- Linear = 1,
- }
-
- public enum ImageFormat
- {
- 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,
- }
-
- public enum ImageChannelOrder
- {
- 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,
- }
-
- public enum ImageChannelDataType
- {
- 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,
- }
-
- public enum ImageOperandsShift
- {
- Bias = 0,
- Lod = 1,
- Grad = 2,
- ConstOffset = 3,
- Offset = 4,
- ConstOffsets = 5,
- Sample = 6,
- MinLod = 7,
- }
-
- public enum ImageOperandsMask
- {
- MaskNone = 0,
- Bias = 0x00000001,
- Lod = 0x00000002,
- Grad = 0x00000004,
- ConstOffset = 0x00000008,
- Offset = 0x00000010,
- ConstOffsets = 0x00000020,
- Sample = 0x00000040,
- MinLod = 0x00000080,
- }
-
- public enum FPFastMathModeShift
- {
- NotNaN = 0,
- NotInf = 1,
- NSZ = 2,
- AllowRecip = 3,
- Fast = 4,
- }
-
- public enum FPFastMathModeMask
- {
- MaskNone = 0,
- NotNaN = 0x00000001,
- NotInf = 0x00000002,
- NSZ = 0x00000004,
- AllowRecip = 0x00000008,
- Fast = 0x00000010,
- }
-
- public enum FPRoundingMode
- {
- RTE = 0,
- RTZ = 1,
- RTP = 2,
- RTN = 3,
- }
-
- public enum LinkageType
- {
- Export = 0,
- Import = 1,
- }
-
- public enum AccessQualifier
- {
- ReadOnly = 0,
- WriteOnly = 1,
- ReadWrite = 2,
- }
-
- public enum FunctionParameterAttribute
- {
- Zext = 0,
- Sext = 1,
- ByVal = 2,
- Sret = 3,
- NoAlias = 4,
- NoCapture = 5,
- NoWrite = 6,
- NoReadWrite = 7,
- }
-
- public enum Decoration
- {
- 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,
- }
-
- public enum BuiltIn
- {
- 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,
- }
-
- public enum SelectionControlShift
- {
- Flatten = 0,
- DontFlatten = 1,
- }
-
- public enum SelectionControlMask
- {
- MaskNone = 0,
- Flatten = 0x00000001,
- DontFlatten = 0x00000002,
- }
-
- public enum LoopControlShift
- {
- Unroll = 0,
- DontUnroll = 1,
- DependencyInfinite = 2,
- DependencyLength = 3,
- }
-
- public enum LoopControlMask
- {
- MaskNone = 0,
- Unroll = 0x00000001,
- DontUnroll = 0x00000002,
- DependencyInfinite = 0x00000004,
- DependencyLength = 0x00000008,
- }
-
- public enum FunctionControlShift
- {
- Inline = 0,
- DontInline = 1,
- Pure = 2,
- Const = 3,
- }
-
- public enum FunctionControlMask
- {
- MaskNone = 0,
- Inline = 0x00000001,
- DontInline = 0x00000002,
- Pure = 0x00000004,
- Const = 0x00000008,
- }
-
- public enum MemorySemanticsShift
- {
- Acquire = 1,
- Release = 2,
- AcquireRelease = 3,
- SequentiallyConsistent = 4,
- UniformMemory = 6,
- SubgroupMemory = 7,
- WorkgroupMemory = 8,
- CrossWorkgroupMemory = 9,
- AtomicCounterMemory = 10,
- ImageMemory = 11,
- }
-
- public enum MemorySemanticsMask
- {
- MaskNone = 0,
- Acquire = 0x00000002,
- Release = 0x00000004,
- AcquireRelease = 0x00000008,
- SequentiallyConsistent = 0x00000010,
- UniformMemory = 0x00000040,
- SubgroupMemory = 0x00000080,
- WorkgroupMemory = 0x00000100,
- CrossWorkgroupMemory = 0x00000200,
- AtomicCounterMemory = 0x00000400,
- ImageMemory = 0x00000800,
- }
-
- public enum MemoryAccessShift
- {
- Volatile = 0,
- Aligned = 1,
- Nontemporal = 2,
- }
-
- public enum MemoryAccessMask
- {
- MaskNone = 0,
- Volatile = 0x00000001,
- Aligned = 0x00000002,
- Nontemporal = 0x00000004,
- }
-
- public enum Scope
- {
- CrossDevice = 0,
- Device = 1,
- Workgroup = 2,
- Subgroup = 3,
- Invocation = 4,
- }
-
- public enum GroupOperation
- {
- Reduce = 0,
- InclusiveScan = 1,
- ExclusiveScan = 2,
- }
-
- public enum KernelEnqueueFlags
- {
- NoWait = 0,
- WaitKernel = 1,
- WaitWorkGroup = 2,
- }
-
- public enum KernelProfilingInfoShift
- {
- CmdExecTime = 0,
- }
-
- public enum KernelProfilingInfoMask
- {
- MaskNone = 0,
- CmdExecTime = 0x00000001,
- }
-
- public enum Capability
- {
- 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,
- }
-
- public enum Op
- {
- 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,
- }
- }
-}
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp
deleted file mode 100644
index 57bd97a0210..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp
+++ /dev/null
@@ -1,1030 +0,0 @@
-// 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 SourceLanguage {
- SourceLanguageUnknown = 0,
- SourceLanguageESSL = 1,
- SourceLanguageGLSL = 2,
- SourceLanguageOpenCL_C = 3,
- SourceLanguageOpenCL_CPP = 4,
- SourceLanguageHLSL = 5,
- SourceLanguageMax = 0x7fffffff,
-};
-
-enum ExecutionModel {
- ExecutionModelVertex = 0,
- ExecutionModelTessellationControl = 1,
- ExecutionModelTessellationEvaluation = 2,
- ExecutionModelGeometry = 3,
- ExecutionModelFragment = 4,
- ExecutionModelGLCompute = 5,
- ExecutionModelKernel = 6,
- ExecutionModelMax = 0x7fffffff,
-};
-
-enum AddressingModel {
- AddressingModelLogical = 0,
- AddressingModelPhysical32 = 1,
- AddressingModelPhysical64 = 2,
- AddressingModelMax = 0x7fffffff,
-};
-
-enum MemoryModel {
- MemoryModelSimple = 0,
- MemoryModelGLSL450 = 1,
- MemoryModelOpenCL = 2,
- MemoryModelMax = 0x7fffffff,
-};
-
-enum ExecutionMode {
- ExecutionModeInvocations = 0,
- ExecutionModeSpacingEqual = 1,
- ExecutionModeSpacingFractionalEven = 2,
- ExecutionModeSpacingFractionalOdd = 3,
- ExecutionModeVertexOrderCw = 4,
- ExecutionModeVertexOrderCcw = 5,
- ExecutionModePixelCenterInteger = 6,
- ExecutionModeOriginUpperLeft = 7,
- ExecutionModeOriginLowerLeft = 8,
- ExecutionModeEarlyFragmentTests = 9,
- ExecutionModePointMode = 10,
- ExecutionModeXfb = 11,
- ExecutionModeDepthReplacing = 12,
- ExecutionModeDepthGreater = 14,
- ExecutionModeDepthLess = 15,
- ExecutionModeDepthUnchanged = 16,
- ExecutionModeLocalSize = 17,
- ExecutionModeLocalSizeHint = 18,
- ExecutionModeInputPoints = 19,
- ExecutionModeInputLines = 20,
- ExecutionModeInputLinesAdjacency = 21,
- ExecutionModeTriangles = 22,
- ExecutionModeInputTrianglesAdjacency = 23,
- ExecutionModeQuads = 24,
- ExecutionModeIsolines = 25,
- ExecutionModeOutputVertices = 26,
- ExecutionModeOutputPoints = 27,
- ExecutionModeOutputLineStrip = 28,
- ExecutionModeOutputTriangleStrip = 29,
- ExecutionModeVecTypeHint = 30,
- ExecutionModeContractionOff = 31,
- ExecutionModeInitializer = 33,
- ExecutionModeFinalizer = 34,
- ExecutionModeSubgroupSize = 35,
- ExecutionModeSubgroupsPerWorkgroup = 36,
- ExecutionModeSubgroupsPerWorkgroupId = 37,
- ExecutionModeLocalSizeId = 38,
- ExecutionModeLocalSizeHintId = 39,
- ExecutionModePostDepthCoverage = 4446,
- ExecutionModeStencilRefReplacingEXT = 5027,
- ExecutionModeMax = 0x7fffffff,
-};
-
-enum StorageClass {
- StorageClassUniformConstant = 0,
- StorageClassInput = 1,
- StorageClassUniform = 2,
- StorageClassOutput = 3,
- StorageClassWorkgroup = 4,
- StorageClassCrossWorkgroup = 5,
- StorageClassPrivate = 6,
- StorageClassFunction = 7,
- StorageClassGeneric = 8,
- StorageClassPushConstant = 9,
- StorageClassAtomicCounter = 10,
- StorageClassImage = 11,
- StorageClassStorageBuffer = 12,
- StorageClassMax = 0x7fffffff,
-};
-
-enum Dim {
- Dim1D = 0,
- Dim2D = 1,
- Dim3D = 2,
- DimCube = 3,
- DimRect = 4,
- DimBuffer = 5,
- DimSubpassData = 6,
- DimMax = 0x7fffffff,
-};
-
-enum SamplerAddressingMode {
- SamplerAddressingModeNone = 0,
- SamplerAddressingModeClampToEdge = 1,
- SamplerAddressingModeClamp = 2,
- SamplerAddressingModeRepeat = 3,
- SamplerAddressingModeRepeatMirrored = 4,
- SamplerAddressingModeMax = 0x7fffffff,
-};
-
-enum SamplerFilterMode {
- SamplerFilterModeNearest = 0,
- SamplerFilterModeLinear = 1,
- SamplerFilterModeMax = 0x7fffffff,
-};
-
-enum ImageFormat {
- ImageFormatUnknown = 0,
- ImageFormatRgba32f = 1,
- ImageFormatRgba16f = 2,
- ImageFormatR32f = 3,
- ImageFormatRgba8 = 4,
- ImageFormatRgba8Snorm = 5,
- ImageFormatRg32f = 6,
- ImageFormatRg16f = 7,
- ImageFormatR11fG11fB10f = 8,
- ImageFormatR16f = 9,
- ImageFormatRgba16 = 10,
- ImageFormatRgb10A2 = 11,
- ImageFormatRg16 = 12,
- ImageFormatRg8 = 13,
- ImageFormatR16 = 14,
- ImageFormatR8 = 15,
- ImageFormatRgba16Snorm = 16,
- ImageFormatRg16Snorm = 17,
- ImageFormatRg8Snorm = 18,
- ImageFormatR16Snorm = 19,
- ImageFormatR8Snorm = 20,
- ImageFormatRgba32i = 21,
- ImageFormatRgba16i = 22,
- ImageFormatRgba8i = 23,
- ImageFormatR32i = 24,
- ImageFormatRg32i = 25,
- ImageFormatRg16i = 26,
- ImageFormatRg8i = 27,
- ImageFormatR16i = 28,
- ImageFormatR8i = 29,
- ImageFormatRgba32ui = 30,
- ImageFormatRgba16ui = 31,
- ImageFormatRgba8ui = 32,
- ImageFormatR32ui = 33,
- ImageFormatRgb10a2ui = 34,
- ImageFormatRg32ui = 35,
- ImageFormatRg16ui = 36,
- ImageFormatRg8ui = 37,
- ImageFormatR16ui = 38,
- ImageFormatR8ui = 39,
- ImageFormatMax = 0x7fffffff,
-};
-
-enum ImageChannelOrder {
- ImageChannelOrderR = 0,
- ImageChannelOrderA = 1,
- ImageChannelOrderRG = 2,
- ImageChannelOrderRA = 3,
- ImageChannelOrderRGB = 4,
- ImageChannelOrderRGBA = 5,
- ImageChannelOrderBGRA = 6,
- ImageChannelOrderARGB = 7,
- ImageChannelOrderIntensity = 8,
- ImageChannelOrderLuminance = 9,
- ImageChannelOrderRx = 10,
- ImageChannelOrderRGx = 11,
- ImageChannelOrderRGBx = 12,
- ImageChannelOrderDepth = 13,
- ImageChannelOrderDepthStencil = 14,
- ImageChannelOrdersRGB = 15,
- ImageChannelOrdersRGBx = 16,
- ImageChannelOrdersRGBA = 17,
- ImageChannelOrdersBGRA = 18,
- ImageChannelOrderABGR = 19,
- ImageChannelOrderMax = 0x7fffffff,
-};
-
-enum ImageChannelDataType {
- ImageChannelDataTypeSnormInt8 = 0,
- ImageChannelDataTypeSnormInt16 = 1,
- ImageChannelDataTypeUnormInt8 = 2,
- ImageChannelDataTypeUnormInt16 = 3,
- ImageChannelDataTypeUnormShort565 = 4,
- ImageChannelDataTypeUnormShort555 = 5,
- ImageChannelDataTypeUnormInt101010 = 6,
- ImageChannelDataTypeSignedInt8 = 7,
- ImageChannelDataTypeSignedInt16 = 8,
- ImageChannelDataTypeSignedInt32 = 9,
- ImageChannelDataTypeUnsignedInt8 = 10,
- ImageChannelDataTypeUnsignedInt16 = 11,
- ImageChannelDataTypeUnsignedInt32 = 12,
- ImageChannelDataTypeHalfFloat = 13,
- ImageChannelDataTypeFloat = 14,
- ImageChannelDataTypeUnormInt24 = 15,
- ImageChannelDataTypeUnormInt101010_2 = 16,
- ImageChannelDataTypeMax = 0x7fffffff,
-};
-
-enum ImageOperandsShift {
- ImageOperandsBiasShift = 0,
- ImageOperandsLodShift = 1,
- ImageOperandsGradShift = 2,
- ImageOperandsConstOffsetShift = 3,
- ImageOperandsOffsetShift = 4,
- ImageOperandsConstOffsetsShift = 5,
- ImageOperandsSampleShift = 6,
- ImageOperandsMinLodShift = 7,
- ImageOperandsMax = 0x7fffffff,
-};
-
-enum ImageOperandsMask {
- ImageOperandsMaskNone = 0,
- ImageOperandsBiasMask = 0x00000001,
- ImageOperandsLodMask = 0x00000002,
- ImageOperandsGradMask = 0x00000004,
- ImageOperandsConstOffsetMask = 0x00000008,
- ImageOperandsOffsetMask = 0x00000010,
- ImageOperandsConstOffsetsMask = 0x00000020,
- ImageOperandsSampleMask = 0x00000040,
- ImageOperandsMinLodMask = 0x00000080,
-};
-
-enum FPFastMathModeShift {
- FPFastMathModeNotNaNShift = 0,
- FPFastMathModeNotInfShift = 1,
- FPFastMathModeNSZShift = 2,
- FPFastMathModeAllowRecipShift = 3,
- FPFastMathModeFastShift = 4,
- FPFastMathModeMax = 0x7fffffff,
-};
-
-enum FPFastMathModeMask {
- FPFastMathModeMaskNone = 0,
- FPFastMathModeNotNaNMask = 0x00000001,
- FPFastMathModeNotInfMask = 0x00000002,
- FPFastMathModeNSZMask = 0x00000004,
- FPFastMathModeAllowRecipMask = 0x00000008,
- FPFastMathModeFastMask = 0x00000010,
-};
-
-enum FPRoundingMode {
- FPRoundingModeRTE = 0,
- FPRoundingModeRTZ = 1,
- FPRoundingModeRTP = 2,
- FPRoundingModeRTN = 3,
- FPRoundingModeMax = 0x7fffffff,
-};
-
-enum LinkageType {
- LinkageTypeExport = 0,
- LinkageTypeImport = 1,
- LinkageTypeMax = 0x7fffffff,
-};
-
-enum AccessQualifier {
- AccessQualifierReadOnly = 0,
- AccessQualifierWriteOnly = 1,
- AccessQualifierReadWrite = 2,
- AccessQualifierMax = 0x7fffffff,
-};
-
-enum FunctionParameterAttribute {
- FunctionParameterAttributeZext = 0,
- FunctionParameterAttributeSext = 1,
- FunctionParameterAttributeByVal = 2,
- FunctionParameterAttributeSret = 3,
- FunctionParameterAttributeNoAlias = 4,
- FunctionParameterAttributeNoCapture = 5,
- FunctionParameterAttributeNoWrite = 6,
- FunctionParameterAttributeNoReadWrite = 7,
- FunctionParameterAttributeMax = 0x7fffffff,
-};
-
-enum Decoration {
- DecorationRelaxedPrecision = 0,
- DecorationSpecId = 1,
- DecorationBlock = 2,
- DecorationBufferBlock = 3,
- DecorationRowMajor = 4,
- DecorationColMajor = 5,
- DecorationArrayStride = 6,
- DecorationMatrixStride = 7,
- DecorationGLSLShared = 8,
- DecorationGLSLPacked = 9,
- DecorationCPacked = 10,
- DecorationBuiltIn = 11,
- DecorationNoPerspective = 13,
- DecorationFlat = 14,
- DecorationPatch = 15,
- DecorationCentroid = 16,
- DecorationSample = 17,
- DecorationInvariant = 18,
- DecorationRestrict = 19,
- DecorationAliased = 20,
- DecorationVolatile = 21,
- DecorationConstant = 22,
- DecorationCoherent = 23,
- DecorationNonWritable = 24,
- DecorationNonReadable = 25,
- DecorationUniform = 26,
- DecorationSaturatedConversion = 28,
- DecorationStream = 29,
- DecorationLocation = 30,
- DecorationComponent = 31,
- DecorationIndex = 32,
- DecorationBinding = 33,
- DecorationDescriptorSet = 34,
- DecorationOffset = 35,
- DecorationXfbBuffer = 36,
- DecorationXfbStride = 37,
- DecorationFuncParamAttr = 38,
- DecorationFPRoundingMode = 39,
- DecorationFPFastMathMode = 40,
- DecorationLinkageAttributes = 41,
- DecorationNoContraction = 42,
- DecorationInputAttachmentIndex = 43,
- DecorationAlignment = 44,
- DecorationMaxByteOffset = 45,
- DecorationAlignmentId = 46,
- DecorationMaxByteOffsetId = 47,
- DecorationExplicitInterpAMD = 4999,
- DecorationOverrideCoverageNV = 5248,
- DecorationPassthroughNV = 5250,
- DecorationViewportRelativeNV = 5252,
- DecorationSecondaryViewportRelativeNV = 5256,
- DecorationHlslCounterBufferGOOGLE = 5634,
- DecorationHlslSemanticGOOGLE = 5635,
- DecorationMax = 0x7fffffff,
-};
-
-enum BuiltIn {
- BuiltInPosition = 0,
- BuiltInPointSize = 1,
- BuiltInClipDistance = 3,
- BuiltInCullDistance = 4,
- BuiltInVertexId = 5,
- BuiltInInstanceId = 6,
- BuiltInPrimitiveId = 7,
- BuiltInInvocationId = 8,
- BuiltInLayer = 9,
- BuiltInViewportIndex = 10,
- BuiltInTessLevelOuter = 11,
- BuiltInTessLevelInner = 12,
- BuiltInTessCoord = 13,
- BuiltInPatchVertices = 14,
- BuiltInFragCoord = 15,
- BuiltInPointCoord = 16,
- BuiltInFrontFacing = 17,
- BuiltInSampleId = 18,
- BuiltInSamplePosition = 19,
- BuiltInSampleMask = 20,
- BuiltInFragDepth = 22,
- BuiltInHelperInvocation = 23,
- BuiltInNumWorkgroups = 24,
- BuiltInWorkgroupSize = 25,
- BuiltInWorkgroupId = 26,
- BuiltInLocalInvocationId = 27,
- BuiltInGlobalInvocationId = 28,
- BuiltInLocalInvocationIndex = 29,
- BuiltInWorkDim = 30,
- BuiltInGlobalSize = 31,
- BuiltInEnqueuedWorkgroupSize = 32,
- BuiltInGlobalOffset = 33,
- BuiltInGlobalLinearId = 34,
- BuiltInSubgroupSize = 36,
- BuiltInSubgroupMaxSize = 37,
- BuiltInNumSubgroups = 38,
- BuiltInNumEnqueuedSubgroups = 39,
- BuiltInSubgroupId = 40,
- BuiltInSubgroupLocalInvocationId = 41,
- BuiltInVertexIndex = 42,
- BuiltInInstanceIndex = 43,
- BuiltInSubgroupEqMaskKHR = 4416,
- BuiltInSubgroupGeMaskKHR = 4417,
- BuiltInSubgroupGtMaskKHR = 4418,
- BuiltInSubgroupLeMaskKHR = 4419,
- BuiltInSubgroupLtMaskKHR = 4420,
- BuiltInBaseVertex = 4424,
- BuiltInBaseInstance = 4425,
- BuiltInDrawIndex = 4426,
- BuiltInDeviceIndex = 4438,
- BuiltInViewIndex = 4440,
- BuiltInBaryCoordNoPerspAMD = 4992,
- BuiltInBaryCoordNoPerspCentroidAMD = 4993,
- BuiltInBaryCoordNoPerspSampleAMD = 4994,
- BuiltInBaryCoordSmoothAMD = 4995,
- BuiltInBaryCoordSmoothCentroidAMD = 4996,
- BuiltInBaryCoordSmoothSampleAMD = 4997,
- BuiltInBaryCoordPullModelAMD = 4998,
- BuiltInFragStencilRefEXT = 5014,
- BuiltInViewportMaskNV = 5253,
- BuiltInSecondaryPositionNV = 5257,
- BuiltInSecondaryViewportMaskNV = 5258,
- BuiltInPositionPerViewNV = 5261,
- BuiltInViewportMaskPerViewNV = 5262,
- BuiltInMax = 0x7fffffff,
-};
-
-enum SelectionControlShift {
- SelectionControlFlattenShift = 0,
- SelectionControlDontFlattenShift = 1,
- SelectionControlMax = 0x7fffffff,
-};
-
-enum SelectionControlMask {
- SelectionControlMaskNone = 0,
- SelectionControlFlattenMask = 0x00000001,
- SelectionControlDontFlattenMask = 0x00000002,
-};
-
-enum LoopControlShift {
- LoopControlUnrollShift = 0,
- LoopControlDontUnrollShift = 1,
- LoopControlDependencyInfiniteShift = 2,
- LoopControlDependencyLengthShift = 3,
- LoopControlMax = 0x7fffffff,
-};
-
-enum LoopControlMask {
- LoopControlMaskNone = 0,
- LoopControlUnrollMask = 0x00000001,
- LoopControlDontUnrollMask = 0x00000002,
- LoopControlDependencyInfiniteMask = 0x00000004,
- LoopControlDependencyLengthMask = 0x00000008,
-};
-
-enum FunctionControlShift {
- FunctionControlInlineShift = 0,
- FunctionControlDontInlineShift = 1,
- FunctionControlPureShift = 2,
- FunctionControlConstShift = 3,
- FunctionControlMax = 0x7fffffff,
-};
-
-enum FunctionControlMask {
- FunctionControlMaskNone = 0,
- FunctionControlInlineMask = 0x00000001,
- FunctionControlDontInlineMask = 0x00000002,
- FunctionControlPureMask = 0x00000004,
- FunctionControlConstMask = 0x00000008,
-};
-
-enum MemorySemanticsShift {
- MemorySemanticsAcquireShift = 1,
- MemorySemanticsReleaseShift = 2,
- MemorySemanticsAcquireReleaseShift = 3,
- MemorySemanticsSequentiallyConsistentShift = 4,
- MemorySemanticsUniformMemoryShift = 6,
- MemorySemanticsSubgroupMemoryShift = 7,
- MemorySemanticsWorkgroupMemoryShift = 8,
- MemorySemanticsCrossWorkgroupMemoryShift = 9,
- MemorySemanticsAtomicCounterMemoryShift = 10,
- MemorySemanticsImageMemoryShift = 11,
- MemorySemanticsMax = 0x7fffffff,
-};
-
-enum MemorySemanticsMask {
- MemorySemanticsMaskNone = 0,
- MemorySemanticsAcquireMask = 0x00000002,
- MemorySemanticsReleaseMask = 0x00000004,
- MemorySemanticsAcquireReleaseMask = 0x00000008,
- MemorySemanticsSequentiallyConsistentMask = 0x00000010,
- MemorySemanticsUniformMemoryMask = 0x00000040,
- MemorySemanticsSubgroupMemoryMask = 0x00000080,
- MemorySemanticsWorkgroupMemoryMask = 0x00000100,
- MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
- MemorySemanticsAtomicCounterMemoryMask = 0x00000400,
- MemorySemanticsImageMemoryMask = 0x00000800,
-};
-
-enum MemoryAccessShift {
- MemoryAccessVolatileShift = 0,
- MemoryAccessAlignedShift = 1,
- MemoryAccessNontemporalShift = 2,
- MemoryAccessMax = 0x7fffffff,
-};
-
-enum MemoryAccessMask {
- MemoryAccessMaskNone = 0,
- MemoryAccessVolatileMask = 0x00000001,
- MemoryAccessAlignedMask = 0x00000002,
- MemoryAccessNontemporalMask = 0x00000004,
-};
-
-enum Scope {
- ScopeCrossDevice = 0,
- ScopeDevice = 1,
- ScopeWorkgroup = 2,
- ScopeSubgroup = 3,
- ScopeInvocation = 4,
- ScopeMax = 0x7fffffff,
-};
-
-enum GroupOperation {
- GroupOperationReduce = 0,
- GroupOperationInclusiveScan = 1,
- GroupOperationExclusiveScan = 2,
- GroupOperationMax = 0x7fffffff,
-};
-
-enum KernelEnqueueFlags {
- KernelEnqueueFlagsNoWait = 0,
- KernelEnqueueFlagsWaitKernel = 1,
- KernelEnqueueFlagsWaitWorkGroup = 2,
- KernelEnqueueFlagsMax = 0x7fffffff,
-};
-
-enum KernelProfilingInfoShift {
- KernelProfilingInfoCmdExecTimeShift = 0,
- KernelProfilingInfoMax = 0x7fffffff,
-};
-
-enum KernelProfilingInfoMask {
- KernelProfilingInfoMaskNone = 0,
- KernelProfilingInfoCmdExecTimeMask = 0x00000001,
-};
-
-enum Capability {
- CapabilityMatrix = 0,
- CapabilityShader = 1,
- CapabilityGeometry = 2,
- CapabilityTessellation = 3,
- CapabilityAddresses = 4,
- CapabilityLinkage = 5,
- CapabilityKernel = 6,
- CapabilityVector16 = 7,
- CapabilityFloat16Buffer = 8,
- CapabilityFloat16 = 9,
- CapabilityFloat64 = 10,
- CapabilityInt64 = 11,
- CapabilityInt64Atomics = 12,
- CapabilityImageBasic = 13,
- CapabilityImageReadWrite = 14,
- CapabilityImageMipmap = 15,
- CapabilityPipes = 17,
- CapabilityGroups = 18,
- CapabilityDeviceEnqueue = 19,
- CapabilityLiteralSampler = 20,
- CapabilityAtomicStorage = 21,
- CapabilityInt16 = 22,
- CapabilityTessellationPointSize = 23,
- CapabilityGeometryPointSize = 24,
- CapabilityImageGatherExtended = 25,
- CapabilityStorageImageMultisample = 27,
- CapabilityUniformBufferArrayDynamicIndexing = 28,
- CapabilitySampledImageArrayDynamicIndexing = 29,
- CapabilityStorageBufferArrayDynamicIndexing = 30,
- CapabilityStorageImageArrayDynamicIndexing = 31,
- CapabilityClipDistance = 32,
- CapabilityCullDistance = 33,
- CapabilityImageCubeArray = 34,
- CapabilitySampleRateShading = 35,
- CapabilityImageRect = 36,
- CapabilitySampledRect = 37,
- CapabilityGenericPointer = 38,
- CapabilityInt8 = 39,
- CapabilityInputAttachment = 40,
- CapabilitySparseResidency = 41,
- CapabilityMinLod = 42,
- CapabilitySampled1D = 43,
- CapabilityImage1D = 44,
- CapabilitySampledCubeArray = 45,
- CapabilitySampledBuffer = 46,
- CapabilityImageBuffer = 47,
- CapabilityImageMSArray = 48,
- CapabilityStorageImageExtendedFormats = 49,
- CapabilityImageQuery = 50,
- CapabilityDerivativeControl = 51,
- CapabilityInterpolationFunction = 52,
- CapabilityTransformFeedback = 53,
- CapabilityGeometryStreams = 54,
- CapabilityStorageImageReadWithoutFormat = 55,
- CapabilityStorageImageWriteWithoutFormat = 56,
- CapabilityMultiViewport = 57,
- CapabilitySubgroupDispatch = 58,
- CapabilityNamedBarrier = 59,
- CapabilityPipeStorage = 60,
- CapabilitySubgroupBallotKHR = 4423,
- CapabilityDrawParameters = 4427,
- CapabilitySubgroupVoteKHR = 4431,
- CapabilityStorageBuffer16BitAccess = 4433,
- CapabilityStorageUniformBufferBlock16 = 4433,
- CapabilityStorageUniform16 = 4434,
- CapabilityUniformAndStorageBuffer16BitAccess = 4434,
- CapabilityStoragePushConstant16 = 4435,
- CapabilityStorageInputOutput16 = 4436,
- CapabilityDeviceGroup = 4437,
- CapabilityMultiView = 4439,
- CapabilityVariablePointersStorageBuffer = 4441,
- CapabilityVariablePointers = 4442,
- CapabilityAtomicStorageOps = 4445,
- CapabilitySampleMaskPostDepthCoverage = 4447,
- CapabilityImageGatherBiasLodAMD = 5009,
- CapabilityFragmentMaskAMD = 5010,
- CapabilityStencilExportEXT = 5013,
- CapabilityImageReadWriteLodAMD = 5015,
- CapabilitySampleMaskOverrideCoverageNV = 5249,
- CapabilityGeometryShaderPassthroughNV = 5251,
- CapabilityShaderViewportIndexLayerEXT = 5254,
- CapabilityShaderViewportIndexLayerNV = 5254,
- CapabilityShaderViewportMaskNV = 5255,
- CapabilityShaderStereoViewNV = 5259,
- CapabilityPerViewAttributesNV = 5260,
- CapabilitySubgroupShuffleINTEL = 5568,
- CapabilitySubgroupBufferBlockIOINTEL = 5569,
- CapabilitySubgroupImageBlockIOINTEL = 5570,
- CapabilityMax = 0x7fffffff,
-};
-
-enum Op {
- 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,
- OpMax = 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/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp11 b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp11
deleted file mode 100644
index 7a875fdb166..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.hpp11
+++ /dev/null
@@ -1,1030 +0,0 @@
-// 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/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.lua b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.lua
deleted file mode 100644
index 0de507d5c91..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.lua
+++ /dev/null
@@ -1,977 +0,0 @@
--- 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.
-
-spv = {
- MagicNumber = 0x07230203,
- Version = 0x00010200,
- Revision = 2,
- OpCodeMask = 0xffff,
- WordCountShift = 16,
-
- SourceLanguage = {
- Unknown = 0,
- ESSL = 1,
- GLSL = 2,
- OpenCL_C = 3,
- OpenCL_CPP = 4,
- HLSL = 5,
- },
-
- ExecutionModel = {
- Vertex = 0,
- TessellationControl = 1,
- TessellationEvaluation = 2,
- Geometry = 3,
- Fragment = 4,
- GLCompute = 5,
- Kernel = 6,
- },
-
- AddressingModel = {
- Logical = 0,
- Physical32 = 1,
- Physical64 = 2,
- },
-
- MemoryModel = {
- Simple = 0,
- GLSL450 = 1,
- OpenCL = 2,
- },
-
- ExecutionMode = {
- 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,
- },
-
- StorageClass = {
- 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,
- },
-
- Dim = {
- Dim1D = 0,
- Dim2D = 1,
- Dim3D = 2,
- Cube = 3,
- Rect = 4,
- Buffer = 5,
- SubpassData = 6,
- },
-
- SamplerAddressingMode = {
- None = 0,
- ClampToEdge = 1,
- Clamp = 2,
- Repeat = 3,
- RepeatMirrored = 4,
- },
-
- SamplerFilterMode = {
- Nearest = 0,
- Linear = 1,
- },
-
- ImageFormat = {
- 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,
- },
-
- ImageChannelOrder = {
- 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,
- },
-
- ImageChannelDataType = {
- 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,
- },
-
- ImageOperandsShift = {
- Bias = 0,
- Lod = 1,
- Grad = 2,
- ConstOffset = 3,
- Offset = 4,
- ConstOffsets = 5,
- Sample = 6,
- MinLod = 7,
- },
-
- ImageOperandsMask = {
- MaskNone = 0,
- Bias = 0x00000001,
- Lod = 0x00000002,
- Grad = 0x00000004,
- ConstOffset = 0x00000008,
- Offset = 0x00000010,
- ConstOffsets = 0x00000020,
- Sample = 0x00000040,
- MinLod = 0x00000080,
- },
-
- FPFastMathModeShift = {
- NotNaN = 0,
- NotInf = 1,
- NSZ = 2,
- AllowRecip = 3,
- Fast = 4,
- },
-
- FPFastMathModeMask = {
- MaskNone = 0,
- NotNaN = 0x00000001,
- NotInf = 0x00000002,
- NSZ = 0x00000004,
- AllowRecip = 0x00000008,
- Fast = 0x00000010,
- },
-
- FPRoundingMode = {
- RTE = 0,
- RTZ = 1,
- RTP = 2,
- RTN = 3,
- },
-
- LinkageType = {
- Export = 0,
- Import = 1,
- },
-
- AccessQualifier = {
- ReadOnly = 0,
- WriteOnly = 1,
- ReadWrite = 2,
- },
-
- FunctionParameterAttribute = {
- Zext = 0,
- Sext = 1,
- ByVal = 2,
- Sret = 3,
- NoAlias = 4,
- NoCapture = 5,
- NoWrite = 6,
- NoReadWrite = 7,
- },
-
- Decoration = {
- 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,
- },
-
- BuiltIn = {
- 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,
- },
-
- SelectionControlShift = {
- Flatten = 0,
- DontFlatten = 1,
- },
-
- SelectionControlMask = {
- MaskNone = 0,
- Flatten = 0x00000001,
- DontFlatten = 0x00000002,
- },
-
- LoopControlShift = {
- Unroll = 0,
- DontUnroll = 1,
- DependencyInfinite = 2,
- DependencyLength = 3,
- },
-
- LoopControlMask = {
- MaskNone = 0,
- Unroll = 0x00000001,
- DontUnroll = 0x00000002,
- DependencyInfinite = 0x00000004,
- DependencyLength = 0x00000008,
- },
-
- FunctionControlShift = {
- Inline = 0,
- DontInline = 1,
- Pure = 2,
- Const = 3,
- },
-
- FunctionControlMask = {
- MaskNone = 0,
- Inline = 0x00000001,
- DontInline = 0x00000002,
- Pure = 0x00000004,
- Const = 0x00000008,
- },
-
- MemorySemanticsShift = {
- Acquire = 1,
- Release = 2,
- AcquireRelease = 3,
- SequentiallyConsistent = 4,
- UniformMemory = 6,
- SubgroupMemory = 7,
- WorkgroupMemory = 8,
- CrossWorkgroupMemory = 9,
- AtomicCounterMemory = 10,
- ImageMemory = 11,
- },
-
- MemorySemanticsMask = {
- MaskNone = 0,
- Acquire = 0x00000002,
- Release = 0x00000004,
- AcquireRelease = 0x00000008,
- SequentiallyConsistent = 0x00000010,
- UniformMemory = 0x00000040,
- SubgroupMemory = 0x00000080,
- WorkgroupMemory = 0x00000100,
- CrossWorkgroupMemory = 0x00000200,
- AtomicCounterMemory = 0x00000400,
- ImageMemory = 0x00000800,
- },
-
- MemoryAccessShift = {
- Volatile = 0,
- Aligned = 1,
- Nontemporal = 2,
- },
-
- MemoryAccessMask = {
- MaskNone = 0,
- Volatile = 0x00000001,
- Aligned = 0x00000002,
- Nontemporal = 0x00000004,
- },
-
- Scope = {
- CrossDevice = 0,
- Device = 1,
- Workgroup = 2,
- Subgroup = 3,
- Invocation = 4,
- },
-
- GroupOperation = {
- Reduce = 0,
- InclusiveScan = 1,
- ExclusiveScan = 2,
- },
-
- KernelEnqueueFlags = {
- NoWait = 0,
- WaitKernel = 1,
- WaitWorkGroup = 2,
- },
-
- KernelProfilingInfoShift = {
- CmdExecTime = 0,
- },
-
- KernelProfilingInfoMask = {
- MaskNone = 0,
- CmdExecTime = 0x00000001,
- },
-
- Capability = {
- 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,
- },
-
- Op = {
- 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,
- },
-
-}
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.py b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.py
deleted file mode 100644
index cefee4d66ac..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/1.2/spirv.py
+++ /dev/null
@@ -1,977 +0,0 @@
-# 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.
-
-spv = {
- 'MagicNumber' : 0x07230203,
- 'Version' : 0x00010200,
- 'Revision' : 2,
- 'OpCodeMask' : 0xffff,
- 'WordCountShift' : 16,
-
- 'SourceLanguage' : {
- 'Unknown' : 0,
- 'ESSL' : 1,
- 'GLSL' : 2,
- 'OpenCL_C' : 3,
- 'OpenCL_CPP' : 4,
- 'HLSL' : 5,
- },
-
- 'ExecutionModel' : {
- 'Vertex' : 0,
- 'TessellationControl' : 1,
- 'TessellationEvaluation' : 2,
- 'Geometry' : 3,
- 'Fragment' : 4,
- 'GLCompute' : 5,
- 'Kernel' : 6,
- },
-
- 'AddressingModel' : {
- 'Logical' : 0,
- 'Physical32' : 1,
- 'Physical64' : 2,
- },
-
- 'MemoryModel' : {
- 'Simple' : 0,
- 'GLSL450' : 1,
- 'OpenCL' : 2,
- },
-
- 'ExecutionMode' : {
- '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,
- },
-
- 'StorageClass' : {
- '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,
- },
-
- 'Dim' : {
- 'Dim1D' : 0,
- 'Dim2D' : 1,
- 'Dim3D' : 2,
- 'Cube' : 3,
- 'Rect' : 4,
- 'Buffer' : 5,
- 'SubpassData' : 6,
- },
-
- 'SamplerAddressingMode' : {
- 'None' : 0,
- 'ClampToEdge' : 1,
- 'Clamp' : 2,
- 'Repeat' : 3,
- 'RepeatMirrored' : 4,
- },
-
- 'SamplerFilterMode' : {
- 'Nearest' : 0,
- 'Linear' : 1,
- },
-
- 'ImageFormat' : {
- '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,
- },
-
- 'ImageChannelOrder' : {
- '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,
- },
-
- 'ImageChannelDataType' : {
- '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,
- },
-
- 'ImageOperandsShift' : {
- 'Bias' : 0,
- 'Lod' : 1,
- 'Grad' : 2,
- 'ConstOffset' : 3,
- 'Offset' : 4,
- 'ConstOffsets' : 5,
- 'Sample' : 6,
- 'MinLod' : 7,
- },
-
- 'ImageOperandsMask' : {
- 'MaskNone' : 0,
- 'Bias' : 0x00000001,
- 'Lod' : 0x00000002,
- 'Grad' : 0x00000004,
- 'ConstOffset' : 0x00000008,
- 'Offset' : 0x00000010,
- 'ConstOffsets' : 0x00000020,
- 'Sample' : 0x00000040,
- 'MinLod' : 0x00000080,
- },
-
- 'FPFastMathModeShift' : {
- 'NotNaN' : 0,
- 'NotInf' : 1,
- 'NSZ' : 2,
- 'AllowRecip' : 3,
- 'Fast' : 4,
- },
-
- 'FPFastMathModeMask' : {
- 'MaskNone' : 0,
- 'NotNaN' : 0x00000001,
- 'NotInf' : 0x00000002,
- 'NSZ' : 0x00000004,
- 'AllowRecip' : 0x00000008,
- 'Fast' : 0x00000010,
- },
-
- 'FPRoundingMode' : {
- 'RTE' : 0,
- 'RTZ' : 1,
- 'RTP' : 2,
- 'RTN' : 3,
- },
-
- 'LinkageType' : {
- 'Export' : 0,
- 'Import' : 1,
- },
-
- 'AccessQualifier' : {
- 'ReadOnly' : 0,
- 'WriteOnly' : 1,
- 'ReadWrite' : 2,
- },
-
- 'FunctionParameterAttribute' : {
- 'Zext' : 0,
- 'Sext' : 1,
- 'ByVal' : 2,
- 'Sret' : 3,
- 'NoAlias' : 4,
- 'NoCapture' : 5,
- 'NoWrite' : 6,
- 'NoReadWrite' : 7,
- },
-
- 'Decoration' : {
- '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,
- },
-
- 'BuiltIn' : {
- '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,
- },
-
- 'SelectionControlShift' : {
- 'Flatten' : 0,
- 'DontFlatten' : 1,
- },
-
- 'SelectionControlMask' : {
- 'MaskNone' : 0,
- 'Flatten' : 0x00000001,
- 'DontFlatten' : 0x00000002,
- },
-
- 'LoopControlShift' : {
- 'Unroll' : 0,
- 'DontUnroll' : 1,
- 'DependencyInfinite' : 2,
- 'DependencyLength' : 3,
- },
-
- 'LoopControlMask' : {
- 'MaskNone' : 0,
- 'Unroll' : 0x00000001,
- 'DontUnroll' : 0x00000002,
- 'DependencyInfinite' : 0x00000004,
- 'DependencyLength' : 0x00000008,
- },
-
- 'FunctionControlShift' : {
- 'Inline' : 0,
- 'DontInline' : 1,
- 'Pure' : 2,
- 'Const' : 3,
- },
-
- 'FunctionControlMask' : {
- 'MaskNone' : 0,
- 'Inline' : 0x00000001,
- 'DontInline' : 0x00000002,
- 'Pure' : 0x00000004,
- 'Const' : 0x00000008,
- },
-
- 'MemorySemanticsShift' : {
- 'Acquire' : 1,
- 'Release' : 2,
- 'AcquireRelease' : 3,
- 'SequentiallyConsistent' : 4,
- 'UniformMemory' : 6,
- 'SubgroupMemory' : 7,
- 'WorkgroupMemory' : 8,
- 'CrossWorkgroupMemory' : 9,
- 'AtomicCounterMemory' : 10,
- 'ImageMemory' : 11,
- },
-
- 'MemorySemanticsMask' : {
- 'MaskNone' : 0,
- 'Acquire' : 0x00000002,
- 'Release' : 0x00000004,
- 'AcquireRelease' : 0x00000008,
- 'SequentiallyConsistent' : 0x00000010,
- 'UniformMemory' : 0x00000040,
- 'SubgroupMemory' : 0x00000080,
- 'WorkgroupMemory' : 0x00000100,
- 'CrossWorkgroupMemory' : 0x00000200,
- 'AtomicCounterMemory' : 0x00000400,
- 'ImageMemory' : 0x00000800,
- },
-
- 'MemoryAccessShift' : {
- 'Volatile' : 0,
- 'Aligned' : 1,
- 'Nontemporal' : 2,
- },
-
- 'MemoryAccessMask' : {
- 'MaskNone' : 0,
- 'Volatile' : 0x00000001,
- 'Aligned' : 0x00000002,
- 'Nontemporal' : 0x00000004,
- },
-
- 'Scope' : {
- 'CrossDevice' : 0,
- 'Device' : 1,
- 'Workgroup' : 2,
- 'Subgroup' : 3,
- 'Invocation' : 4,
- },
-
- 'GroupOperation' : {
- 'Reduce' : 0,
- 'InclusiveScan' : 1,
- 'ExclusiveScan' : 2,
- },
-
- 'KernelEnqueueFlags' : {
- 'NoWait' : 0,
- 'WaitKernel' : 1,
- 'WaitWorkGroup' : 2,
- },
-
- 'KernelProfilingInfoShift' : {
- 'CmdExecTime' : 0,
- },
-
- 'KernelProfilingInfoMask' : {
- 'MaskNone' : 0,
- 'CmdExecTime' : 0x00000001,
- },
-
- 'Capability' : {
- '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,
- },
-
- 'Op' : {
- '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,
- },
-
-}
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/spir-v.xml b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/spir-v.xml
index 525c97ddc46..dad141be17d 100644
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/spir-v.xml
+++ b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/spir-v.xml
@@ -55,7 +55,7 @@
<id value="2" vendor="Valve" comment="Contact TBD"/>
<id value="3" vendor="Codeplay" comment="Contact Victor Lomuller, victor@codeplay.com"/>
<id value="4" vendor="NVIDIA" comment="Contact Kerch Holt, kholt@nvidia.com"/>
- <id value="5" vendor="ARM" comment="Contact Alexander Galazin, alexander.galazin@arm.com"/>
+ <id value="5" vendor="ARM" comment="Contact Kevin Petit, kevin.petit@arm.com"/>
<id value="6" vendor="Khronos" tool="LLVM/SPIR-V Translator" comment="Contact Yaxun (Sam) Liu, yaxun.liu@amd.com"/>
<id value="7" vendor="Khronos" tool="SPIR-V Tools Assembler" comment="Contact David Neto, dneto@google.com"/>
<id value="8" vendor="Khronos" tool="Glslang Reference Front End" comment="Contact John Kessenich, johnkessenich@google.com"/>
@@ -81,7 +81,12 @@
<id value="28" vendor="gfx-rs community" tool="Naga" comment="https://github.com/gfx-rs/naga"/>
<id value="29" vendor="Mikkosoft Productions" tool="MSP Shader Compiler" comment="Contact Mikko Rasa, tdb@tdb.fi"/>
<id value="30" vendor="SpvGenTwo community" tool="SpvGenTwo SPIR-V IR Tools" comment="https://github.com/rAzoR8/SpvGenTwo"/>
- <unused start="31" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/>
+ <id value="31" vendor="Google" tool="Skia SkSL" comment="Contact Ethan Nicholas, ethannicholas@google.com"/>
+ <id value="32" vendor="TornadoVM" tool="SPIRV Beehive Toolkit" comment="https://github.com/beehive-lab/spirv-beehive-toolkit"/>
+ <id value="33" vendor="DragonJoker" tool="ShaderWriter" comment="Contact Sylvain Doremus, https://github.com/DragonJoker/ShaderWriter"/>
+ <id value="34" vendor="Rayan Hatout" tool="SPIRVSmith" comment="Contact Rayan Hatout rayan.hatout@gmail.com, Repo https://github.com/rayanht/SPIRVSmith"/>
+ <id value="35" vendor="Saarland University" tool="Shady" comment="Contact Hugo Devillers devillers@uni-saarland.de, Repo https://github.com/Hugobros3/shady"/>
+ <unused start="36" end="0xFFFF" comment="Tool ID range reservable for future use by vendors"/>
</ids>
<!-- SECTION: SPIR-V Opcodes and Enumerants -->
@@ -118,7 +123,7 @@
<!-- Begin reservations of opcode enumerants -->
<ids type="opcode" start="0" end="4095" vendor="Khronos" comment="Reserved opcodes, not available to vendors - see the SPIR-V Specification"/>
<ids type="opcode" start="4096" end="4159" vendor="Mesa" comment="Contact TBD"/>
- <ids type="opcode" start="4160" end="4415" vendor="ARM"/>
+ <ids type="opcode" start="4160" end="4415" vendor="ARM" comment="Contact kevin.petit@arm.com"/>
<ids type="opcode" start="4416" end="4479" vendor="Khronos" comment="SPV_ARB_shader_ballot - contact Neil Henning, neil.henning@amd.com"/>
<ids type="opcode" start="4480" end="4991" vendor="Qualcomm" comment="Contact weifengz@qti.qualcomm.com"/>
<ids type="opcode" start="4992" end="5247" vendor="AMD"/>
@@ -133,20 +138,21 @@
<ids type="opcode" start="6080" end="6143" vendor="Intel" comment="Contact mariusz.merecki@intel.com"/>
<ids type="opcode" start="6144" end="6271" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
<ids type="opcode" start="6272" end="6399" vendor="Huawei" comment="Contact wanghuilong2@xunweitech.com"/>
+ <ids type="opcode" start="6400" end="6463" vendor="Intel" comment="Contact ben.ashbaugh@intel.com"/>
<!-- Opcode enumerants to reserve for future use. To get a block, allocate
multiples of 64 starting at the lowest available point in this
block and add a corresponding <ids> tag immediately above. Make
sure to fill in the vendor attribute, and preferably add a contact
person/address in a comment attribute. -->
<!-- Example new block: <ids type="opcode" start="XXXX" end="XXXX+64n-1" vendor="Add vendor" comment="Contact TBD"/> -->
- <ids type="opcode" start="6400" end="65535" comment="Opcode range reservable for future use by vendors"/>
+ <ids type="opcode" start="6464" end="65535" comment="Opcode range reservable for future use by vendors"/>
<!-- End reservations of opcodes -->
<!-- Begin reservations of non-opcode enumerants -->
<ids type="enumerant" start="0" end="4095" vendor="Khronos" comment="Reserved enumerants, not available to vendors - see the SPIR-V Specification"/>
<ids type="enumerant" start="4096" end="4159" vendor="Mesa" comment="Contact TBD"/>
- <ids type="enumerant" start="4160" end="4415" vendor="ARM"/>
+ <ids type="enumerant" start="4160" end="4415" vendor="ARM" comment="Contact kevin.petit@arm.com"/>
<ids type="enumerant" start="4416" end="4479" vendor="Khronos" comment="SPV_ARB_shader_ballot - contact Neil Henning, neil.henning@amd.com"/>
<ids type="enumerant" start="4480" end="4991" vendor="Qualcomm" comment="Contact weifengz@qti.qualcomm.com"/>
<ids type="enumerant" start="4992" end="5247" vendor="AMD"/>
@@ -161,13 +167,15 @@
<ids type="enumerant" start="6080" end="6143" vendor="Intel" comment="Contact mariusz.merecki@intel.com"/>
<ids type="enumerant" start="6144" end="6271" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
<ids type="enumerant" start="6272" end="6399" vendor="Huawei" comment="Contact wanghuilong2@xunweitech.com"/>
+ <ids type="enumerant" start="6400" end="6463" vendor="Intel" comment="Contact ben.ashbaugh@intel.com"/>
+ <ids type="enumerant" start="6464" end="6527" vendor="Mikkosoft Productions" comment="Contact Mikko Rasa, tdb@tdb.fi"/>
<!-- Enumerants to reserve for future use. To get a block, allocate
multiples of 64 starting at the lowest available point in this
block and add a corresponding <ids> tag immediately above. Make
sure to fill in the vendor attribute, and preferably add a contact
person/address in a comment attribute. -->
<!-- Example new block: <ids type="enumerant" start="XXXX" end="XXXX+64n-1" vendor="Add vendor" comment="Contact TBD"/> -->
- <ids type="enumerant" start="6400" end="4294967295" comment="Enumerant range reservable for future use by vendors"/>
+ <ids type="enumerant" start="6528" end="4294967295" comment="Enumerant range reservable for future use by vendors"/>
<!-- End reservations of enumerants -->
@@ -187,8 +195,8 @@
<!-- Reserved loop control bits -->
<ids type="LoopControl" start="0" end="15" vendor="Khronos" comment="Reserved LoopControl bits, not available to vendors - see the SPIR-V Specification"/>
- <ids type="LoopControl" start="16" end="24" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
- <ids type="LoopControl" start="25" end="30" comment="Unreserved bits reservable for use by vendors"/>
+ <ids type="LoopControl" start="16" end="25" vendor="Intel" comment="Contact michael.kinsner@intel.com"/>
+ <ids type="LoopControl" start="26" end="30" comment="Unreserved bits reservable for use by vendors"/>
<ids type="LoopControl" start="31" end="31" vendor="Khronos" comment="Reserved LoopControl bit, not available to vendors"/>
@@ -251,4 +259,24 @@
<ids type="MemoryOperand" start="18" end="30" comment="Unreserved bits reservable for use by vendors"/>
<ids type="MemoryOperand" start="31" end="31" vendor="Khronos" comment="Reserved MemoryOperand bit, not available to vendors"/>
+ <!-- SECTION: SPIR-V Image Operand Bit Reservations -->
+ <!-- Reserve ranges of bits in the image operands bitfield.
+
+ Each vendor determines the use of values in their own ranges.
+ Vendors are not required to disclose those uses. If the use of a
+ value is included in an extension that is adopted by a Khronos
+ extension or specification, then that value's use may be permanently
+ fixed as if originally reserved in a Khronos range.
+
+ The SPIR Working Group strongly recommends:
+ - Each value is used for only one purpose.
+ - All values in a range should be used before allocating a new range.
+ -->
+
+ <!-- Reserved image operand bits -->
+ <ids type="ImageOperand" start="0" end="15" vendor="Khronos" comment="Reserved ImageOperand bits, not available to vendors - see the SPIR-V Specification"/>
+ <ids type="ImageOperand" start="16" end="16" vendor="Nvidia" comment="Contact pmistry@nvidia.com"/>
+ <ids type="ImageOperand" start="17" end="30" comment="Unreserved bits reservable for use by vendors"/>
+ <ids type="ImageOperand" start="31" end="31" vendor="Khronos" comment="Reserved ImageOperand bit, not available to vendors"/>
+
</registry>
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h
index fa7061d8454..0cdf29d1297 100644
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h
+++ b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/NonSemanticClspvReflection.h
@@ -33,7 +33,7 @@ extern "C" {
#endif
enum {
- NonSemanticClspvReflectionRevision = 1,
+ NonSemanticClspvReflectionRevision = 4,
NonSemanticClspvReflectionRevision_BitWidthPadding = 0x7fffffff
};
@@ -62,6 +62,17 @@ enum NonSemanticClspvReflectionInstructions {
NonSemanticClspvReflectionConstantDataUniform = 22,
NonSemanticClspvReflectionLiteralSampler = 23,
NonSemanticClspvReflectionPropertyRequiredWorkgroupSize = 24,
+ NonSemanticClspvReflectionSpecConstantSubgroupMaxSize = 25,
+ NonSemanticClspvReflectionArgumentPointerPushConstant = 26,
+ NonSemanticClspvReflectionArgumentPointerUniform = 27,
+ NonSemanticClspvReflectionProgramScopeVariablesStorageBuffer = 28,
+ NonSemanticClspvReflectionProgramScopeVariablePointerRelocation = 29,
+ NonSemanticClspvReflectionImageArgumentInfoChannelOrderPushConstant = 30,
+ NonSemanticClspvReflectionImageArgumentInfoChannelDataTypePushConstant = 31,
+ NonSemanticClspvReflectionImageArgumentInfoChannelOrderUniform = 32,
+ NonSemanticClspvReflectionImageArgumentInfoChannelDataTypeUniform = 33,
+ NonSemanticClspvReflectionArgumentStorageTexelBuffer = 34,
+ NonSemanticClspvReflectionArgumentUniformTexelBuffer = 35,
NonSemanticClspvReflectionInstructionsMax = 0x7fffffff
};
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json
index 15e56990a15..b5a66372180 100644
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json
+++ b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/extinst.nonsemantic.clspvreflection.grammar.json
@@ -1,5 +1,5 @@
{
- "revision" : 1,
+ "revision" : 4,
"instructions" : [
{
"opname" : "Kernel",
@@ -232,6 +232,121 @@
{ "kind" : "IdRef", "name" : "Y" },
{ "kind" : "IdRef", "name" : "Z" }
]
+ },
+ {
+ "opname" : "SpecConstantSubgroupMaxSize",
+ "opcode" : 25,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Size" }
+ ]
+ },
+ {
+ "opname" : "ArgumentPointerPushConstant",
+ "opcode" : 26,
+ "operands": [
+ { "kind" : "IdRef", "name" : "Kernel" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
+ ]
+ },
+ {
+ "opname" : "ArgumentPointerUniform",
+ "opcode" : 27,
+ "operands": [
+ { "kind" : "IdRef", "name" : "Kernel" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "DescriptorSet" },
+ { "kind" : "IdRef", "name" : "Binding" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" },
+ { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
+ ]
+ },
+ {
+ "opname" : "ProgramScopeVariablesStorageBuffer",
+ "opcode" : 28,
+ "operands": [
+ { "kind" : "IdRef", "name" : "DescriptorSet" },
+ { "kind" : "IdRef", "name" : "Binding" },
+ { "kind" : "IdRef", "name" : "Data" }
+ ]
+ },
+ {
+ "opname" : "ProgramScopeVariablePointerRelocation",
+ "opcode" : 29,
+ "operands": [
+ { "kind" : "IdRef", "name" : "ObjectOffset" },
+ { "kind" : "IdRef", "name" : "PointerOffset" },
+ { "kind" : "IdRef", "name" : "PointerSize" }
+ ]
+ },
+ {
+ "opname" : "ImageArgumentInfoChannelOrderPushConstant",
+ "opcode" : 30,
+ "operands": [
+ { "kind" : "IdRef", "name" : "Kernel" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" }
+ ]
+ },
+ {
+ "opname" : "ImageArgumentInfoChannelDataTypePushConstant",
+ "opcode" : 31,
+ "operands": [
+ { "kind" : "IdRef", "name" : "Kernel" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" }
+ ]
+ },
+ {
+ "opname" : "ImageArgumentInfoChannelOrderUniform",
+ "opcode" : 32,
+ "operands": [
+ { "kind" : "IdRef", "name" : "Kernel" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "DescriptorSet" },
+ { "kind" : "IdRef", "name" : "Binding" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" }
+ ]
+ },
+ {
+ "opname" : "ImageArgumentInfoChannelDataTypeUniform",
+ "opcode" : 33,
+ "operands": [
+ { "kind" : "IdRef", "name" : "Kernel" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "DescriptorSet" },
+ { "kind" : "IdRef", "name" : "Binding" },
+ { "kind" : "IdRef", "name" : "Offset" },
+ { "kind" : "IdRef", "name" : "Size" }
+ ]
+ },
+ {
+ "opname" : "ArgumentStorageTexelBuffer",
+ "opcode" : 34,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Decl" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "DescriptorSet" },
+ { "kind" : "IdRef", "name" : "Binding" },
+ { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
+ ]
+ },
+ {
+ "opname" : "ArgumentUniformTexelBuffer",
+ "opcode" : 35,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "Decl" },
+ { "kind" : "IdRef", "name" : "Ordinal" },
+ { "kind" : "IdRef", "name" : "DescriptorSet" },
+ { "kind" : "IdRef", "name" : "Binding" },
+ { "kind" : "IdRef", "name" : "ArgInfo", "quantifier" : "?" }
+ ]
}
]
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json
index 9154496bac2..c6517c4c4b6 100644
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json
+++ b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.core.grammar.json
@@ -26,8 +26,8 @@
],
"magic_number" : "0x07230203",
"major_version" : 1,
- "minor_version" : 5,
- "revision" : 4,
+ "minor_version" : 6,
+ "revision" : 1,
"instruction_printing_class" : [
{
"tag" : "@exclude"
@@ -1735,7 +1735,8 @@
{ "kind" : "IdRef", "name" : "'x'" },
{ "kind" : "IdRef", "name" : "'y'" }
],
- "capabilities" : [ "Kernel" ]
+ "capabilities" : [ "Kernel" ],
+ "lastVersion" : "1.5"
},
{
"opname" : "OpOrdered",
@@ -4109,7 +4110,7 @@
"SPV_KHR_terminate_invocation"
],
"capabilities" : [ "Shader" ],
- "version" : "None"
+ "version" : "1.6"
},
{
"opname" : "OpSubgroupBallotKHR",
@@ -4183,6 +4184,21 @@
"version" : "None"
},
{
+ "opname" : "OpGroupNonUniformRotateKHR",
+ "class" : "Group",
+ "opcode" : 4431,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdScope", "name" : "'Execution'" },
+ { "kind" : "IdRef", "name" : "'Value'" },
+ { "kind" : "IdRef", "name" : "'Delta'" },
+ { "kind" : "IdRef", "name" : "'ClusterSize'", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "GroupNonUniformRotateKHR" ],
+ "version" : "None"
+ },
+ {
"opname" : "OpSubgroupReadInvocationKHR",
"class" : "Group",
"opcode" : 4432,
@@ -4261,6 +4277,20 @@
"version" : "None"
},
{
+ "opname" : "OpSDot",
+ "class" : "Arithmetic",
+ "opcode" : 4450,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "'Vector 1'" },
+ { "kind" : "IdRef", "name" : "'Vector 2'" },
+ { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "DotProduct" ],
+ "version" : "1.6"
+ },
+ {
"opname" : "OpSDotKHR",
"class" : "Arithmetic",
"opcode" : 4450,
@@ -4272,7 +4302,22 @@
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProductKHR" ],
- "version" : "None"
+ "extensions" : [ "SPV_KHR_integer_dot_product" ],
+ "version" : "1.6"
+ },
+ {
+ "opname" : "OpUDot",
+ "class" : "Arithmetic",
+ "opcode" : 4451,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "'Vector 1'" },
+ { "kind" : "IdRef", "name" : "'Vector 2'" },
+ { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "DotProduct" ],
+ "version" : "1.6"
},
{
"opname" : "OpUDotKHR",
@@ -4286,7 +4331,22 @@
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProductKHR" ],
- "version" : "None"
+ "extensions" : [ "SPV_KHR_integer_dot_product" ],
+ "version" : "1.6"
+ },
+ {
+ "opname" : "OpSUDot",
+ "class" : "Arithmetic",
+ "opcode" : 4452,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "'Vector 1'" },
+ { "kind" : "IdRef", "name" : "'Vector 2'" },
+ { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "DotProduct" ],
+ "version" : "1.6"
},
{
"opname" : "OpSUDotKHR",
@@ -4300,7 +4360,23 @@
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProductKHR" ],
- "version" : "None"
+ "extensions" : [ "SPV_KHR_integer_dot_product" ],
+ "version" : "1.6"
+ },
+ {
+ "opname" : "OpSDotAccSat",
+ "class" : "Arithmetic",
+ "opcode" : 4453,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "'Vector 1'" },
+ { "kind" : "IdRef", "name" : "'Vector 2'" },
+ { "kind" : "IdRef", "name" : "'Accumulator'" },
+ { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "DotProduct" ],
+ "version" : "1.6"
},
{
"opname" : "OpSDotAccSatKHR",
@@ -4315,7 +4391,23 @@
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProductKHR" ],
- "version" : "None"
+ "extensions" : [ "SPV_KHR_integer_dot_product" ],
+ "version" : "1.6"
+ },
+ {
+ "opname" : "OpUDotAccSat",
+ "class" : "Arithmetic",
+ "opcode" : 4454,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "'Vector 1'" },
+ { "kind" : "IdRef", "name" : "'Vector 2'" },
+ { "kind" : "IdRef", "name" : "'Accumulator'" },
+ { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "DotProduct" ],
+ "version" : "1.6"
},
{
"opname" : "OpUDotAccSatKHR",
@@ -4330,7 +4422,23 @@
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProductKHR" ],
- "version" : "None"
+ "extensions" : [ "SPV_KHR_integer_dot_product" ],
+ "version" : "1.6"
+ },
+ {
+ "opname" : "OpSUDotAccSat",
+ "class" : "Arithmetic",
+ "opcode" : 4455,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "'Vector 1'" },
+ { "kind" : "IdRef", "name" : "'Vector 2'" },
+ { "kind" : "IdRef", "name" : "'Accumulator'" },
+ { "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
+ ],
+ "capabilities" : [ "DotProduct" ],
+ "version" : "1.6"
},
{
"opname" : "OpSUDotAccSatKHR",
@@ -4345,7 +4453,8 @@
{ "kind" : "PackedVectorFormat", "name" : "'Packed Vector Format'", "quantifier" : "?" }
],
"capabilities" : [ "DotProductKHR" ],
- "version" : "None"
+ "extensions" : [ "SPV_KHR_integer_dot_product" ],
+ "version" : "1.6"
},
{
"opname" : "OpTypeRayQueryKHR",
@@ -4663,6 +4772,30 @@
"version" : "None"
},
{
+ "opname" : "OpEmitMeshTasksEXT",
+ "class" : "Reserved",
+ "opcode" : 5294,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Group Count X'" },
+ { "kind" : "IdRef", "name" : "'Group Count Y'" },
+ { "kind" : "IdRef", "name" : "'Group Count Z'" },
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "'Payload'" }
+ ],
+ "capabilities" : [ "MeshShadingEXT" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpSetMeshOutputsEXT",
+ "class" : "Reserved",
+ "opcode" : 5295,
+ "operands" : [
+ { "kind" : "IdRef", "name" : "'Vertex Count'" },
+ { "kind" : "IdRef", "name" : "'Primitive Count'" }
+ ],
+ "capabilities" : [ "MeshShadingEXT" ],
+ "version" : "None"
+ },
+ {
"opname" : "OpGroupNonUniformPartitionNV",
"class" : "Non-Uniform",
"opcode" : 5296,
@@ -4925,12 +5058,18 @@
"version" : "None"
},
{
+ "opname" : "OpDemoteToHelperInvocation",
+ "class" : "Control-Flow",
+ "opcode" : 5380,
+ "capabilities" : [ "DemoteToHelperInvocation" ],
+ "version" : "1.6"
+ },
+ {
"opname" : "OpDemoteToHelperInvocationEXT",
- "class" : "Reserved",
+ "class" : "Control-Flow",
"opcode" : 5380,
"capabilities" : [ "DemoteToHelperInvocationEXT" ],
- "extensions" : [ "SPV_EXT_demote_to_helper_invocation" ],
- "version" : "None"
+ "version" : "1.6"
},
{
"opname" : "OpIsHelperInvocationEXT",
@@ -4945,6 +5084,88 @@
"version" : "None"
},
{
+ "opname" : "OpConvertUToImageNV",
+ "class" : "Reserved",
+ "opcode" : 5391,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "'Operand'" }
+ ],
+ "capabilities" : [ "BindlessTextureNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpConvertUToSamplerNV",
+ "class" : "Reserved",
+ "opcode" : 5392,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "'Operand'" }
+ ],
+ "capabilities" : [ "BindlessTextureNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpConvertImageToUNV",
+ "class" : "Reserved",
+ "opcode" : 5393,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "'Operand'" }
+ ],
+ "capabilities" : [ "BindlessTextureNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpConvertSamplerToUNV",
+ "class" : "Reserved",
+ "opcode" : 5394,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "'Operand'" }
+ ],
+ "capabilities" : [ "BindlessTextureNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpConvertUToSampledImageNV",
+ "class" : "Reserved",
+ "opcode" : 5395,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "'Operand'" }
+ ],
+ "capabilities" : [ "BindlessTextureNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpConvertSampledImageToUNV",
+ "class" : "Reserved",
+ "opcode" : 5396,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdRef", "name" : "'Operand'" }
+ ],
+ "capabilities" : [ "BindlessTextureNV" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpSamplerImageAddressingModeNV",
+ "class" : "Reserved",
+ "opcode" : 5397,
+ "operands" : [
+ { "kind" : "LiteralInteger", "name" : "'Bit Width'" }
+ ],
+ "capabilities" : [ "BindlessTextureNV" ],
+ "version" : "None"
+ },
+ {
"opname" : "OpSubgroupShuffleINTEL",
"class" : "Group",
"opcode" : 5571,
@@ -5256,7 +5477,7 @@
"version" : "None"
},
{
- "opname" : "OpConstFunctionPointerINTEL",
+ "opname" : "OpConstantFunctionPointerINTEL",
"class" : "@exclude",
"opcode" : 5600,
"operands" : [
@@ -7688,6 +7909,43 @@
"version" : "None"
},
{
+ "opname" : "OpAliasDomainDeclINTEL",
+ "class" : "@exclude",
+ "opcode" : 5911,
+ "operands" : [
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "'Name'" }
+ ],
+ "capabilities" : [ "MemoryAccessAliasingINTEL" ],
+ "extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpAliasScopeDeclINTEL",
+ "class" : "@exclude",
+ "opcode" : 5912,
+ "operands" : [
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "name" : "'Alias Domain'"},
+ { "kind" : "IdRef", "quantifier" : "?", "name" : "'Name'" }
+ ],
+ "capabilities" : [ "MemoryAccessAliasingINTEL" ],
+ "extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpAliasScopeListDeclINTEL",
+ "class" : "@exclude",
+ "opcode" : 5913,
+ "operands" : [
+ { "kind" : "IdResult"},
+ { "kind" : "IdRef", "quantifier" : "*", "name" : "'AliasScope1, AliasScope2, ...'" }
+ ],
+ "capabilities" : [ "MemoryAccessAliasingINTEL" ],
+ "extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
+ "version" : "None"
+ },
+ {
"opname" : "OpFixedSqrtINTEL",
"class" : "@exclude",
"opcode" : 5923,
@@ -8330,6 +8588,142 @@
],
"capabilities" : [ "LongConstantCompositeINTEL" ],
"version" : "None"
+ },
+ {
+ "opname" : "OpControlBarrierArriveINTEL",
+ "class" : "Barrier",
+ "opcode" : 6142,
+ "operands" : [
+ { "kind" : "IdScope", "name" : "'Execution'" },
+ { "kind" : "IdScope", "name" : "'Memory'" },
+ { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
+ ],
+ "capabilities" : [ "SplitBarrierINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpControlBarrierWaitINTEL",
+ "class" : "Barrier",
+ "opcode" : 6143,
+ "operands" : [
+ { "kind" : "IdScope", "name" : "'Execution'" },
+ { "kind" : "IdScope", "name" : "'Memory'" },
+ { "kind" : "IdMemorySemantics", "name" : "'Semantics'" }
+ ],
+ "capabilities" : [ "SplitBarrierINTEL" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGroupIMulKHR",
+ "class" : "Group",
+ "opcode" : 6401,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdScope", "name" : "'Execution'" },
+ { "kind" : "GroupOperation", "name" : "'Operation'" },
+ { "kind" : "IdRef", "name" : "'X'" }
+ ],
+ "capabilities" : [ "GroupUniformArithmeticKHR" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGroupFMulKHR",
+ "class" : "Group",
+ "opcode" : 6402,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdScope", "name" : "'Execution'" },
+ { "kind" : "GroupOperation", "name" : "'Operation'" },
+ { "kind" : "IdRef", "name" : "'X'" }
+ ],
+ "capabilities" : [ "GroupUniformArithmeticKHR" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGroupBitwiseAndKHR",
+ "class" : "Group",
+ "opcode" : 6403,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdScope", "name" : "'Execution'" },
+ { "kind" : "GroupOperation", "name" : "'Operation'" },
+ { "kind" : "IdRef", "name" : "'X'" }
+ ],
+ "capabilities" : [ "GroupUniformArithmeticKHR" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGroupBitwiseOrKHR",
+ "class" : "Group",
+ "opcode" : 6404,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdScope", "name" : "'Execution'" },
+ { "kind" : "GroupOperation", "name" : "'Operation'" },
+ { "kind" : "IdRef", "name" : "'X'" }
+ ],
+ "capabilities" : [ "GroupUniformArithmeticKHR" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGroupBitwiseXorKHR",
+ "class" : "Group",
+ "opcode" : 6405,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdScope", "name" : "'Execution'" },
+ { "kind" : "GroupOperation", "name" : "'Operation'" },
+ { "kind" : "IdRef", "name" : "'X'" }
+ ],
+ "capabilities" : [ "GroupUniformArithmeticKHR" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGroupLogicalAndKHR",
+ "class" : "Group",
+ "opcode" : 6406,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdScope", "name" : "'Execution'" },
+ { "kind" : "GroupOperation", "name" : "'Operation'" },
+ { "kind" : "IdRef", "name" : "'X'" }
+ ],
+ "capabilities" : [ "GroupUniformArithmeticKHR" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGroupLogicalOrKHR",
+ "class" : "Group",
+ "opcode" : 6407,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdScope", "name" : "'Execution'" },
+ { "kind" : "GroupOperation", "name" : "'Operation'" },
+ { "kind" : "IdRef", "name" : "'X'" }
+ ],
+ "capabilities" : [ "GroupUniformArithmeticKHR" ],
+ "version" : "None"
+ },
+ {
+ "opname" : "OpGroupLogicalXorKHR",
+ "class" : "Group",
+ "opcode" : 6408,
+ "operands" : [
+ { "kind" : "IdResultType" },
+ { "kind" : "IdResult" },
+ { "kind" : "IdScope", "name" : "'Execution'" },
+ { "kind" : "GroupOperation", "name" : "'Operation'" },
+ { "kind" : "IdRef", "name" : "'X'" }
+ ],
+ "capabilities" : [ "GroupUniformArithmeticKHR" ],
+ "version" : "None"
}
],
"operand_kinds" : [
@@ -8475,6 +8869,18 @@
"enumerant" : "ZeroExtend",
"value" : "0x2000",
"version" : "1.4"
+ },
+ {
+ "enumerant" : "Nontemporal",
+ "value" : "0x4000",
+ "version" : "1.6"
+ },
+ {
+ "enumerant" : "Offsets",
+ "value" : "0x10000",
+ "parameters" : [
+ { "kind" : "IdRef" }
+ ]
}
]
},
@@ -8896,6 +9302,26 @@
"capabilities" : [ "VulkanMemoryModel" ],
"extensions" : [ "SPV_KHR_vulkan_memory_model" ],
"version" : "1.5"
+ },
+ {
+ "enumerant" : "AliasScopeINTELMask",
+ "value" : "0x10000",
+ "parameters" : [
+ { "kind" : "IdRef" }
+ ],
+ "capabilities" : [ "MemoryAccessAliasingINTEL" ],
+ "extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "NoAliasINTELMask",
+ "parameters" : [
+ { "kind" : "IdRef" }
+ ],
+ "value" : "0x20000",
+ "capabilities" : [ "MemoryAccessAliasingINTEL" ],
+ "extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
+ "version" : "None"
}
]
},
@@ -8983,6 +9409,12 @@
"value" : "0x0200",
"capabilities" : [ "RayTraversalPrimitiveCullingKHR" ],
"version" : "None"
+ },
+ {
+ "enumerant" : "ForceOpacityMicromap2StateEXT",
+ "value" : "0x0400",
+ "capabilities" : [ "RayTracingOpacityMicromapEXT" ],
+ "version" : "None"
}
]
},
@@ -9047,6 +9479,10 @@
{
"enumerant" : "CPP_for_OpenCL",
"value" : 6
+ },
+ {
+ "enumerant" : "SYCL",
+ "value" : 7
}
]
},
@@ -9172,6 +9608,18 @@
"value" : 5318,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
"version" : "None"
+ },
+ {
+ "enumerant" : "TaskEXT",
+ "value" : 5364,
+ "capabilities" : [ "MeshShadingEXT" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "MeshEXT",
+ "value" : 5365,
+ "capabilities" : [ "MeshShadingEXT" ],
+ "version" : "None"
}
]
},
@@ -9387,7 +9835,7 @@
{
"enumerant" : "OutputVertices",
"value" : 26,
- "capabilities" : [ "Geometry", "Tessellation", "MeshShadingNV" ],
+ "capabilities" : [ "Geometry", "Tessellation", "MeshShadingNV", "MeshShadingEXT" ],
"parameters" : [
{ "kind" : "LiteralInteger", "name" : "'Vertex count'" }
]
@@ -9395,7 +9843,7 @@
{
"enumerant" : "OutputPoints",
"value" : 27,
- "capabilities" : [ "Geometry", "MeshShadingNV" ]
+ "capabilities" : [ "Geometry", "MeshShadingNV", "MeshShadingEXT" ]
},
{
"enumerant" : "OutputLineStrip",
@@ -9545,6 +9993,13 @@
"version" : "1.4"
},
{
+ "enumerant": "EarlyAndLateFragmentTestsAMD",
+ "value": 5017,
+ "capabilities": [ "Shader" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests" ],
+ "version": "None"
+ },
+ {
"enumerant" : "StencilRefReplacingEXT",
"value" : 5027,
"capabilities" : [ "StencilExportEXT" ],
@@ -9552,20 +10007,79 @@
"version" : "None"
},
{
+ "enumerant": "StencilRefUnchangedFrontAMD",
+ "value": 5079,
+ "capabilities": [ "StencilExportEXT" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_EXT_shader_stencil_export" ],
+ "version": "None"
+ },
+ {
+ "enumerant": "StencilRefGreaterFrontAMD",
+ "value": 5080,
+ "capabilities": [ "StencilExportEXT" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_EXT_shader_stencil_export" ],
+ "version": "None"
+ },
+ {
+ "enumerant": "StencilRefLessFrontAMD",
+ "value": 5081,
+ "capabilities": [ "StencilExportEXT" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_EXT_shader_stencil_export" ],
+ "version": "None"
+ },
+ {
+ "enumerant": "StencilRefUnchangedBackAMD",
+ "value": 5082,
+ "capabilities": [ "StencilExportEXT" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_EXT_shader_stencil_export" ],
+ "version": "None"
+ },
+ {
+ "enumerant": "StencilRefGreaterBackAMD",
+ "value": 5083,
+ "capabilities": [ "StencilExportEXT" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_EXT_shader_stencil_export" ],
+ "version": "None"
+ },
+ {
+ "enumerant": "StencilRefLessBackAMD",
+ "value": 5084,
+ "capabilities": [ "StencilExportEXT" ],
+ "extensions": [ "SPV_AMD_shader_early_and_late_fragment_tests", "SPV_EXT_shader_stencil_export" ],
+ "version": "None"
+ },
+ {
"enumerant" : "OutputLinesNV",
"value" : 5269,
- "capabilities" : [ "MeshShadingNV" ],
- "extensions" : [ "SPV_NV_mesh_shader" ],
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "OutputLinesEXT",
+ "value" : 5269,
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
"version" : "None"
},
{
"enumerant" : "OutputPrimitivesNV",
"value" : 5270,
- "capabilities" : [ "MeshShadingNV" ],
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
"parameters" : [
{ "kind" : "LiteralInteger", "name" : "'Primitive count'" }
],
- "extensions" : [ "SPV_NV_mesh_shader" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "OutputPrimitivesEXT",
+ "value" : 5270,
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "parameters" : [
+ { "kind" : "LiteralInteger", "name" : "'Primitive count'" }
+ ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
"version" : "None"
},
{
@@ -9585,8 +10099,15 @@
{
"enumerant" : "OutputTrianglesNV",
"value" : 5298,
- "capabilities" : [ "MeshShadingNV" ],
- "extensions" : [ "SPV_NV_mesh_shader" ],
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "OutputTrianglesEXT",
+ "value" : 5298,
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
"version" : "None"
},
{
@@ -9723,6 +10244,15 @@
],
"capabilities" : [ "FPGAKernelAttributesINTEL" ],
"version" : "None"
+ },
+ {
+ "enumerant" : "NamedBarrierCountINTEL",
+ "value" : 6417,
+ "parameters" : [
+ { "kind" : "LiteralInteger", "name" : "'Barrier Count'" }
+ ],
+ "capabilities" : [ "VectorComputeINTEL" ],
+ "version" : "None"
}
]
},
@@ -9893,6 +10423,13 @@
"version" : "1.5"
},
{
+ "enumerant" : "TaskPayloadWorkgroupEXT",
+ "value" : 5402,
+ "extensions" : [ "SPV_EXT_mesh_shader" ],
+ "capabilities" : [ "MeshShadingEXT" ],
+ "version" : "1.4"
+ },
+ {
"enumerant" : "CodeSectionINTEL",
"value" : 5605,
"extensions" : [ "SPV_INTEL_function_pointers" ],
@@ -10788,12 +11325,12 @@
{
"enumerant" : "Uniform",
"value" : 26,
- "capabilities" : [ "Shader" ]
+ "capabilities" : [ "Shader", "UniformDecoration" ]
},
{
"enumerant" : "UniformId",
"value" : 27,
- "capabilities" : [ "Shader" ],
+ "capabilities" : [ "Shader", "UniformDecoration" ],
"parameters" : [
{ "kind" : "IdScope", "name" : "'Execution'" }
],
@@ -11007,8 +11544,15 @@
{
"enumerant" : "PerPrimitiveNV",
"value" : 5271,
- "capabilities" : [ "MeshShadingNV" ],
- "extensions" : [ "SPV_NV_mesh_shader" ],
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "PerPrimitiveEXT",
+ "value" : 5271,
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
"version" : "None"
},
{
@@ -11021,15 +11565,22 @@
{
"enumerant" : "PerTaskNV",
"value" : 5273,
- "capabilities" : [ "MeshShadingNV" ],
- "extensions" : [ "SPV_NV_mesh_shader" ],
+ "capabilities" : [ "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "PerVertexKHR",
+ "value" : 5285,
+ "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
+ "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
"enumerant" : "PerVertexNV",
"value" : 5285,
- "capabilities" : [ "FragmentBarycentricNV" ],
- "extensions" : [ "SPV_NV_fragment_shader_barycentric" ],
+ "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
+ "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
@@ -11074,6 +11625,30 @@
"version" : "1.5"
},
{
+ "enumerant" : "BindlessSamplerNV",
+ "value" : 5398,
+ "capabilities" : [ "BindlessTextureNV" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "BindlessImageNV",
+ "value" : 5399,
+ "capabilities" : [ "BindlessTextureNV" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "BoundSamplerNV",
+ "value" : 5400,
+ "capabilities" : [ "BindlessTextureNV" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "BoundImageNV",
+ "value" : 5401,
+ "capabilities" : [ "BindlessTextureNV" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "SIMTCallINTEL",
"value" : 5599,
"parameters" : [
@@ -11355,6 +11930,24 @@
"version" : "None"
},
{
+ "enumerant" : "AliasScopeINTEL",
+ "value" : 5914,
+ "parameters" : [
+ { "kind" : "IdRef", "name" : "'Aliasing Scopes List'" }
+ ],
+ "capabilities" : [ "MemoryAccessAliasingINTEL" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "NoAliasINTEL",
+ "value" : 5915,
+ "parameters" : [
+ { "kind" : "IdRef", "name" : "'Aliasing Scopes List'" }
+ ],
+ "capabilities" : [ "MemoryAccessAliasingINTEL" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "BufferLocationINTEL",
"value" : 5921,
"parameters" : [
@@ -11393,6 +11986,12 @@
"value" : 6087,
"capabilities" : [ "VectorComputeINTEL" ],
"version" : "None"
+ },
+ {
+ "enumerant" : "MediaBlockIOINTEL",
+ "value" : 6140,
+ "capabilities" : [ "VectorComputeINTEL" ],
+ "version" : "None"
}
]
},
@@ -11433,7 +12032,7 @@
{
"enumerant" : "PrimitiveId",
"value" : 7,
- "capabilities" : [ "Geometry", "Tessellation", "RayTracingNV", "RayTracingKHR", "MeshShadingNV" ]
+ "capabilities" : [ "Geometry", "Tessellation", "RayTracingNV", "RayTracingKHR", "MeshShadingNV", "MeshShadingEXT" ]
},
{
"enumerant" : "InvocationId",
@@ -11443,12 +12042,12 @@
{
"enumerant" : "Layer",
"value" : 9,
- "capabilities" : [ "Geometry", "ShaderLayer", "ShaderViewportIndexLayerEXT", "MeshShadingNV" ]
+ "capabilities" : [ "Geometry", "ShaderLayer", "ShaderViewportIndexLayerEXT", "MeshShadingNV", "MeshShadingEXT" ]
},
{
"enumerant" : "ViewportIndex",
"value" : 10,
- "capabilities" : [ "MultiViewport", "ShaderViewportIndex", "ShaderViewportIndexLayerEXT", "MeshShadingNV" ]
+ "capabilities" : [ "MultiViewport", "ShaderViewportIndex", "ShaderViewportIndexLayerEXT", "MeshShadingNV", "MeshShadingEXT" ]
},
{
"enumerant" : "TessLevelOuter",
@@ -11600,6 +12199,31 @@
"capabilities" : [ "Shader" ]
},
{
+ "enumerant" : "CoreIDARM",
+ "value" : 4160,
+ "capabilities" : [ "CoreBuiltinsARM" ]
+ },
+ {
+ "enumerant" : "CoreCountARM",
+ "value" : 4161,
+ "capabilities" : [ "CoreBuiltinsARM" ]
+ },
+ {
+ "enumerant" : "CoreMaxIDARM",
+ "value" : 4162,
+ "capabilities" : [ "CoreBuiltinsARM" ]
+ },
+ {
+ "enumerant" : "WarpIDARM",
+ "value" : 4163,
+ "capabilities" : [ "CoreBuiltinsARM" ]
+ },
+ {
+ "enumerant" : "WarpMaxIDARM",
+ "value" : 4164,
+ "capabilities" : [ "CoreBuiltinsARM" ]
+ },
+ {
"enumerant" : "SubgroupEqMask",
"value" : 4416,
"capabilities" : [ "SubgroupBallotKHR", "GroupNonUniformBallot" ],
@@ -11681,8 +12305,8 @@
{
"enumerant" : "DrawIndex",
"value" : 4426,
- "capabilities" : [ "DrawParameters", "MeshShadingNV" ],
- "extensions" : [ "SPV_KHR_shader_draw_parameters", "SPV_NV_mesh_shader" ],
+ "capabilities" : [ "DrawParameters", "MeshShadingNV", "MeshShadingEXT" ],
+ "extensions" : [ "SPV_KHR_shader_draw_parameters", "SPV_NV_mesh_shader", "SPV_EXT_mesh_shader" ],
"version" : "1.3"
},
{
@@ -11861,17 +12485,31 @@
"version" : "None"
},
{
+ "enumerant" : "BaryCoordKHR",
+ "value" : 5286,
+ "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
+ "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "BaryCoordNV",
"value" : 5286,
- "capabilities" : [ "FragmentBarycentricNV" ],
- "extensions" : [ "SPV_NV_fragment_shader_barycentric" ],
+ "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
+ "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "BaryCoordNoPerspKHR",
+ "value" : 5287,
+ "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
+ "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
"enumerant" : "BaryCoordNoPerspNV",
"value" : 5287,
- "capabilities" : [ "FragmentBarycentricNV" ],
- "extensions" : [ "SPV_NV_fragment_shader_barycentric" ],
+ "capabilities" : [ "FragmentBarycentricNV", "FragmentBarycentricKHR" ],
+ "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
@@ -11903,6 +12541,34 @@
"version" : "None"
},
{
+ "enumerant" : "PrimitivePointIndicesEXT",
+ "value" : 5294,
+ "capabilities" : [ "MeshShadingEXT" ],
+ "extensions" : [ "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "PrimitiveLineIndicesEXT",
+ "value" : 5295,
+ "capabilities" : [ "MeshShadingEXT" ],
+ "extensions" : [ "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "PrimitiveTriangleIndicesEXT",
+ "value" : 5296,
+ "capabilities" : [ "MeshShadingEXT" ],
+ "extensions" : [ "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "CullPrimitiveEXT",
+ "value" : 5299,
+ "capabilities" : [ "MeshShadingEXT" ],
+ "extensions" : [ "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "LaunchIdNV",
"value" : 5319,
"capabilities" : [ "RayTracingNV" , "RayTracingKHR" ],
@@ -12132,6 +12798,13 @@
"capabilities" : [ "ShaderSMBuiltinsNV" ],
"extensions" : [ "SPV_NV_shader_sm_builtins" ],
"version" : "None"
+ },
+ {
+ "enumerant" : "CullMaskKHR",
+ "value" : 6021,
+ "capabilities" : [ "RayCullMaskKHR" ],
+ "extensions" : [ "SPV_KHR_ray_cull_mask" ],
+ "version" : "None"
}
]
},
@@ -12597,6 +13270,16 @@
"version" : "1.5"
},
{
+ "enumerant" : "UniformDecoration",
+ "value" : 71,
+ "version" : "1.6"
+ },
+ {
+ "enumerant" : "CoreBuiltinsARM",
+ "value" : 4165,
+ "extensions" : [ "SPV_ARM_core_builtins" ]
+ },
+ {
"enumerant" : "FragmentShadingRateKHR",
"value" : 4422,
"capabilities" : [ "Shader" ],
@@ -12922,9 +13605,22 @@
"version" : "None"
},
{
+ "enumerant" : "MeshShadingEXT",
+ "value" : 5283,
+ "capabilities" : [ "Shader" ],
+ "extensions" : [ "SPV_EXT_mesh_shader" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "FragmentBarycentricKHR",
+ "value" : 5284,
+ "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "FragmentBarycentricNV",
"value" : 5284,
- "extensions" : [ "SPV_NV_fragment_shader_barycentric" ],
+ "extensions" : [ "SPV_NV_fragment_shader_barycentric", "SPV_KHR_fragment_shader_barycentric" ],
"version" : "None"
},
{
@@ -13208,10 +13904,29 @@
"version" : "None"
},
{
+ "enumerant" : "DemoteToHelperInvocation",
+ "value" : 5379,
+ "capabilities" : [ "Shader" ],
+ "version" : "1.6"
+ },
+ {
"enumerant" : "DemoteToHelperInvocationEXT",
"value" : 5379,
"capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_demote_to_helper_invocation" ],
+ "version" : "1.6"
+ },
+ {
+ "enumerant" : "RayTracingOpacityMicromapEXT",
+ "value" : 5381,
+ "capabilities" : [ "RayQueryKHR","RayTracingKHR" ],
+ "extensions" : [ "SPV_EXT_opacity_micromap" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "BindlessTextureNV",
+ "value" : 5390,
+ "extensions" : [ "SPV_NV_bindless_texture" ],
"version" : "None"
},
{
@@ -13410,6 +14125,12 @@
"version" : "None"
},
{
+ "enumerant" : "MemoryAccessAliasingINTEL",
+ "value" : 5910,
+ "extensions" : [ "SPV_INTEL_memory_access_aliasing" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "FPGABufferLocationINTEL",
"value" : 5920,
"extensions" : [ "SPV_INTEL_fpga_buffer_location" ],
@@ -13446,28 +14167,55 @@
"version" : "None"
},
{
+ "enumerant" : "DotProductInputAll",
+ "value" : 6016,
+ "version" : "1.6"
+ },
+ {
"enumerant" : "DotProductInputAllKHR",
"value" : 6016,
"extensions" : [ "SPV_KHR_integer_dot_product" ],
- "version" : "None"
+ "version" : "1.6"
+ },
+ {
+ "enumerant" : "DotProductInput4x8Bit",
+ "value" : 6017,
+ "capabilities" : [ "Int8" ],
+ "version" : "1.6"
},
{
"enumerant" : "DotProductInput4x8BitKHR",
"value" : 6017,
"capabilities" : [ "Int8" ],
"extensions" : [ "SPV_KHR_integer_dot_product" ],
- "version" : "None"
+ "version" : "1.6"
+ },
+ {
+ "enumerant" : "DotProductInput4x8BitPacked",
+ "value" : 6018,
+ "version" : "1.6"
},
{
"enumerant" : "DotProductInput4x8BitPackedKHR",
"value" : 6018,
"extensions" : [ "SPV_KHR_integer_dot_product" ],
- "version" : "None"
+ "version" : "1.6"
+ },
+ {
+ "enumerant" : "DotProduct",
+ "value" : 6019,
+ "version" : "1.6"
},
{
"enumerant" : "DotProductKHR",
"value" : 6019,
"extensions" : [ "SPV_KHR_integer_dot_product" ],
+ "version" : "1.6"
+ },
+ {
+ "enumerant" : "RayCullMaskKHR",
+ "value" : 6020,
+ "extensions" : [ "SPV_KHR_ray_cull_mask" ],
"version" : "None"
},
{
@@ -13477,16 +14225,21 @@
"version" : "None"
},
{
+ "enumerant" : "GroupNonUniformRotateKHR",
+ "value" : 6026,
+ "capabilities" : [ "GroupNonUniform" ],
+ "extensions" : [ "SPV_KHR_subgroup_rotate" ],
+ "version" : "None"
+ },
+ {
"enumerant" : "AtomicFloat32AddEXT",
"value" : 6033,
- "capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_shader_atomic_float_add" ],
"version" : "None"
},
{
"enumerant" : "AtomicFloat64AddEXT",
"value" : 6034,
- "capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_shader_atomic_float_add" ],
"version" : "None"
},
@@ -13505,7 +14258,6 @@
{
"enumerant" : "AtomicFloat16AddEXT",
"value" : 6095,
- "capabilities" : [ "Shader" ],
"extensions" : [ "SPV_EXT_shader_atomic_float16_add" ],
"version" : "None"
},
@@ -13514,6 +14266,18 @@
"value" : 6114,
"extensions" : [ "SPV_INTEL_debug_module" ],
"version" : "None"
+ },
+ {
+ "enumerant" : "SplitBarrierINTEL",
+ "value" : 6141,
+ "extensions" : [ "SPV_INTEL_split_barrier" ],
+ "version" : "None"
+ },
+ {
+ "enumerant" : "GroupUniformArithmeticKHR",
+ "value" : 6400,
+ "extensions" : [ "SPV_KHR_uniform_group_instructions"],
+ "version" : "None"
}
]
},
@@ -13582,10 +14346,15 @@
"kind" : "PackedVectorFormat",
"enumerants" : [
{
+ "enumerant" : "PackedVectorFormat4x8Bit",
+ "value" : 0,
+ "version" : "1.6"
+ },
+ {
"enumerant" : "PackedVectorFormat4x8BitKHR",
"value" : 0,
"extensions" : [ "SPV_KHR_integer_dot_product" ],
- "version" : "None"
+ "version" : "1.6"
}
]
},
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.cs b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.cs
deleted file mode 100644
index b2ca3f0de89..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.cs
+++ /dev/null
@@ -1,1812 +0,0 @@
-// 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
-//
-// - 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
-//
-// 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.
-
-namespace Spv
-{
-
- public static class Specification
- {
- public const uint MagicNumber = 0x07230203;
- public const uint Version = 0x00010500;
- public const uint Revision = 4;
- public const uint OpCodeMask = 0xffff;
- public const uint WordCountShift = 16;
-
- public enum SourceLanguage
- {
- Unknown = 0,
- ESSL = 1,
- GLSL = 2,
- OpenCL_C = 3,
- OpenCL_CPP = 4,
- HLSL = 5,
- CPP_for_OpenCL = 6,
- }
-
- public enum ExecutionModel
- {
- 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,
- }
-
- public enum AddressingModel
- {
- Logical = 0,
- Physical32 = 1,
- Physical64 = 2,
- PhysicalStorageBuffer64 = 5348,
- PhysicalStorageBuffer64EXT = 5348,
- }
-
- public enum MemoryModel
- {
- Simple = 0,
- GLSL450 = 1,
- OpenCL = 2,
- Vulkan = 3,
- VulkanKHR = 3,
- }
-
- public enum ExecutionMode
- {
- 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,
- StencilRefReplacingEXT = 5027,
- OutputLinesNV = 5269,
- OutputPrimitivesNV = 5270,
- DerivativeGroupQuadsNV = 5289,
- DerivativeGroupLinearNV = 5290,
- 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,
- }
-
- public enum StorageClass
- {
- 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,
- CodeSectionINTEL = 5605,
- DeviceOnlyINTEL = 5936,
- HostOnlyINTEL = 5937,
- }
-
- public enum Dim
- {
- Dim1D = 0,
- Dim2D = 1,
- Dim3D = 2,
- Cube = 3,
- Rect = 4,
- Buffer = 5,
- SubpassData = 6,
- }
-
- public enum SamplerAddressingMode
- {
- None = 0,
- ClampToEdge = 1,
- Clamp = 2,
- Repeat = 3,
- RepeatMirrored = 4,
- }
-
- public enum SamplerFilterMode
- {
- Nearest = 0,
- Linear = 1,
- }
-
- public enum ImageFormat
- {
- 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,
- }
-
- public enum ImageChannelOrder
- {
- 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,
- }
-
- public enum ImageChannelDataType
- {
- 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,
- }
-
- public enum ImageOperandsShift
- {
- 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,
- }
-
- public enum ImageOperandsMask
- {
- 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,
- }
-
- public enum FPFastMathModeShift
- {
- NotNaN = 0,
- NotInf = 1,
- NSZ = 2,
- AllowRecip = 3,
- Fast = 4,
- AllowContractFastINTEL = 16,
- AllowReassocINTEL = 17,
- }
-
- public enum FPFastMathModeMask
- {
- MaskNone = 0,
- NotNaN = 0x00000001,
- NotInf = 0x00000002,
- NSZ = 0x00000004,
- AllowRecip = 0x00000008,
- Fast = 0x00000010,
- AllowContractFastINTEL = 0x00010000,
- AllowReassocINTEL = 0x00020000,
- }
-
- public enum FPRoundingMode
- {
- RTE = 0,
- RTZ = 1,
- RTP = 2,
- RTN = 3,
- }
-
- public enum LinkageType
- {
- Export = 0,
- Import = 1,
- LinkOnceODR = 2,
- }
-
- public enum AccessQualifier
- {
- ReadOnly = 0,
- WriteOnly = 1,
- ReadWrite = 2,
- }
-
- public enum FunctionParameterAttribute
- {
- Zext = 0,
- Sext = 1,
- ByVal = 2,
- Sret = 3,
- NoAlias = 4,
- NoCapture = 5,
- NoWrite = 6,
- NoReadWrite = 7,
- }
-
- public enum Decoration
- {
- 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,
- PerPrimitiveNV = 5271,
- PerViewNV = 5272,
- PerTaskNV = 5273,
- PerVertexNV = 5285,
- NonUniform = 5300,
- NonUniformEXT = 5300,
- RestrictPointer = 5355,
- RestrictPointerEXT = 5355,
- AliasedPointer = 5356,
- AliasedPointerEXT = 5356,
- 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,
- BufferLocationINTEL = 5921,
- IOPipeStorageINTEL = 5944,
- FunctionFloatingPointModeINTEL = 6080,
- SingleElementVectorINTEL = 6085,
- VectorComputeCallableFunctionINTEL = 6087,
- }
-
- public enum BuiltIn
- {
- 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,
- 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,
- BaryCoordNV = 5286,
- BaryCoordNoPerspNV = 5287,
- FragSizeEXT = 5292,
- FragmentSizeNV = 5292,
- FragInvocationCountEXT = 5293,
- InvocationsPerPixelNV = 5293,
- 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,
- }
-
- public enum SelectionControlShift
- {
- Flatten = 0,
- DontFlatten = 1,
- }
-
- public enum SelectionControlMask
- {
- MaskNone = 0,
- Flatten = 0x00000001,
- DontFlatten = 0x00000002,
- }
-
- public enum LoopControlShift
- {
- 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,
- }
-
- public enum LoopControlMask
- {
- 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,
- }
-
- public enum FunctionControlShift
- {
- Inline = 0,
- DontInline = 1,
- Pure = 2,
- Const = 3,
- OptNoneINTEL = 16,
- }
-
- public enum FunctionControlMask
- {
- MaskNone = 0,
- Inline = 0x00000001,
- DontInline = 0x00000002,
- Pure = 0x00000004,
- Const = 0x00000008,
- OptNoneINTEL = 0x00010000,
- }
-
- public enum MemorySemanticsShift
- {
- 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,
- }
-
- public enum MemorySemanticsMask
- {
- 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,
- }
-
- public enum MemoryAccessShift
- {
- Volatile = 0,
- Aligned = 1,
- Nontemporal = 2,
- MakePointerAvailable = 3,
- MakePointerAvailableKHR = 3,
- MakePointerVisible = 4,
- MakePointerVisibleKHR = 4,
- NonPrivatePointer = 5,
- NonPrivatePointerKHR = 5,
- }
-
- public enum MemoryAccessMask
- {
- MaskNone = 0,
- Volatile = 0x00000001,
- Aligned = 0x00000002,
- Nontemporal = 0x00000004,
- MakePointerAvailable = 0x00000008,
- MakePointerAvailableKHR = 0x00000008,
- MakePointerVisible = 0x00000010,
- MakePointerVisibleKHR = 0x00000010,
- NonPrivatePointer = 0x00000020,
- NonPrivatePointerKHR = 0x00000020,
- }
-
- public enum Scope
- {
- CrossDevice = 0,
- Device = 1,
- Workgroup = 2,
- Subgroup = 3,
- Invocation = 4,
- QueueFamily = 5,
- QueueFamilyKHR = 5,
- ShaderCallKHR = 6,
- }
-
- public enum GroupOperation
- {
- Reduce = 0,
- InclusiveScan = 1,
- ExclusiveScan = 2,
- ClusteredReduce = 3,
- PartitionedReduceNV = 6,
- PartitionedInclusiveScanNV = 7,
- PartitionedExclusiveScanNV = 8,
- }
-
- public enum KernelEnqueueFlags
- {
- NoWait = 0,
- WaitKernel = 1,
- WaitWorkGroup = 2,
- }
-
- public enum KernelProfilingInfoShift
- {
- CmdExecTime = 0,
- }
-
- public enum KernelProfilingInfoMask
- {
- MaskNone = 0,
- CmdExecTime = 0x00000001,
- }
-
- public enum Capability
- {
- 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,
- 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,
- 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,
- DemoteToHelperInvocationEXT = 5379,
- 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,
- FPGABufferLocationINTEL = 5920,
- ArbitraryPrecisionFixedPointINTEL = 5922,
- USMStorageClassesINTEL = 5935,
- IOPipesINTEL = 5943,
- BlockingPipesINTEL = 5945,
- FPGARegINTEL = 5948,
- DotProductInputAllKHR = 6016,
- DotProductInput4x8BitKHR = 6017,
- DotProductInput4x8BitPackedKHR = 6018,
- DotProductKHR = 6019,
- BitInstructions = 6025,
- AtomicFloat32AddEXT = 6033,
- AtomicFloat64AddEXT = 6034,
- LongConstantCompositeINTEL = 6089,
- OptNoneINTEL = 6094,
- AtomicFloat16AddEXT = 6095,
- DebugInfoModuleINTEL = 6114,
- }
-
- public enum RayFlagsShift
- {
- OpaqueKHR = 0,
- NoOpaqueKHR = 1,
- TerminateOnFirstHitKHR = 2,
- SkipClosestHitShaderKHR = 3,
- CullBackFacingTrianglesKHR = 4,
- CullFrontFacingTrianglesKHR = 5,
- CullOpaqueKHR = 6,
- CullNoOpaqueKHR = 7,
- SkipTrianglesKHR = 8,
- SkipAABBsKHR = 9,
- }
-
- public enum RayFlagsMask
- {
- MaskNone = 0,
- OpaqueKHR = 0x00000001,
- NoOpaqueKHR = 0x00000002,
- TerminateOnFirstHitKHR = 0x00000004,
- SkipClosestHitShaderKHR = 0x00000008,
- CullBackFacingTrianglesKHR = 0x00000010,
- CullFrontFacingTrianglesKHR = 0x00000020,
- CullOpaqueKHR = 0x00000040,
- CullNoOpaqueKHR = 0x00000080,
- SkipTrianglesKHR = 0x00000100,
- SkipAABBsKHR = 0x00000200,
- }
-
- public enum RayQueryIntersection
- {
- RayQueryCandidateIntersectionKHR = 0,
- RayQueryCommittedIntersectionKHR = 1,
- }
-
- public enum RayQueryCommittedIntersectionType
- {
- RayQueryCommittedIntersectionNoneKHR = 0,
- RayQueryCommittedIntersectionTriangleKHR = 1,
- RayQueryCommittedIntersectionGeneratedKHR = 2,
- }
-
- public enum RayQueryCandidateIntersectionType
- {
- RayQueryCandidateIntersectionTriangleKHR = 0,
- RayQueryCandidateIntersectionAABBKHR = 1,
- }
-
- public enum FragmentShadingRateShift
- {
- Vertical2Pixels = 0,
- Vertical4Pixels = 1,
- Horizontal2Pixels = 2,
- Horizontal4Pixels = 3,
- }
-
- public enum FragmentShadingRateMask
- {
- MaskNone = 0,
- Vertical2Pixels = 0x00000001,
- Vertical4Pixels = 0x00000002,
- Horizontal2Pixels = 0x00000004,
- Horizontal4Pixels = 0x00000008,
- }
-
- public enum FPDenormMode
- {
- Preserve = 0,
- FlushToZero = 1,
- }
-
- public enum FPOperationMode
- {
- IEEE = 0,
- ALT = 1,
- }
-
- public enum QuantizationModes
- {
- TRN = 0,
- TRN_ZERO = 1,
- RND = 2,
- RND_ZERO = 3,
- RND_INF = 4,
- RND_MIN_INF = 5,
- RND_CONV = 6,
- RND_CONV_ODD = 7,
- }
-
- public enum OverflowModes
- {
- WRAP = 0,
- SAT = 1,
- SAT_ZERO = 2,
- SAT_SYM = 3,
- }
-
- public enum PackedVectorFormat
- {
- PackedVectorFormat4x8BitKHR = 0,
- }
-
- public enum Op
- {
- 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,
- OpSubgroupReadInvocationKHR = 4432,
- OpTraceRayKHR = 4445,
- OpExecuteCallableKHR = 4446,
- OpConvertUToAccelerationStructureKHR = 4447,
- OpIgnoreIntersectionKHR = 4448,
- OpTerminateRayKHR = 4449,
- OpSDotKHR = 4450,
- OpUDotKHR = 4451,
- OpSUDotKHR = 4452,
- OpSDotAccSatKHR = 4453,
- OpUDotAccSatKHR = 4454,
- 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,
- OpImageSampleFootprintNV = 5283,
- 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,
- OpDemoteToHelperInvocationEXT = 5380,
- OpIsHelperInvocationEXT = 5381,
- 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,
- OpConstFunctionPointerINTEL = 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,
- 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,
- }
- }
-}
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h
index 14439632356..af4f06b7748 100644
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h
+++ b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.h
@@ -31,7 +31,7 @@
/*
** 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
@@ -41,6 +41,8 @@
** - 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
@@ -53,12 +55,12 @@
typedef unsigned int SpvId;
-#define SPV_VERSION 0x10500
-#define SPV_REVISION 4
+#define SPV_VERSION 0x10600
+#define SPV_REVISION 1
static const unsigned int SpvMagicNumber = 0x07230203;
-static const unsigned int SpvVersion = 0x00010500;
-static const unsigned int SpvRevision = 4;
+static const unsigned int SpvVersion = 0x00010600;
+static const unsigned int SpvRevision = 1;
static const unsigned int SpvOpCodeMask = 0xffff;
static const unsigned int SpvWordCountShift = 16;
@@ -70,6 +72,7 @@ typedef enum SpvSourceLanguage_ {
SpvSourceLanguageOpenCL_CPP = 4,
SpvSourceLanguageHLSL = 5,
SpvSourceLanguageCPP_for_OpenCL = 6,
+ SpvSourceLanguageSYCL = 7,
SpvSourceLanguageMax = 0x7fffffff,
} SpvSourceLanguage;
@@ -95,6 +98,8 @@ typedef enum SpvExecutionModel_ {
SpvExecutionModelMissNV = 5317,
SpvExecutionModelCallableKHR = 5318,
SpvExecutionModelCallableNV = 5318,
+ SpvExecutionModelTaskEXT = 5364,
+ SpvExecutionModelMeshEXT = 5365,
SpvExecutionModelMax = 0x7fffffff,
} SpvExecutionModel;
@@ -162,11 +167,21 @@ typedef enum SpvExecutionMode_ {
SpvExecutionModeSignedZeroInfNanPreserve = 4461,
SpvExecutionModeRoundingModeRTE = 4462,
SpvExecutionModeRoundingModeRTZ = 4463,
+ SpvExecutionModeEarlyAndLateFragmentTestsAMD = 5017,
SpvExecutionModeStencilRefReplacingEXT = 5027,
+ SpvExecutionModeStencilRefUnchangedFrontAMD = 5079,
+ SpvExecutionModeStencilRefGreaterFrontAMD = 5080,
+ SpvExecutionModeStencilRefLessFrontAMD = 5081,
+ SpvExecutionModeStencilRefUnchangedBackAMD = 5082,
+ SpvExecutionModeStencilRefGreaterBackAMD = 5083,
+ SpvExecutionModeStencilRefLessBackAMD = 5084,
+ SpvExecutionModeOutputLinesEXT = 5269,
SpvExecutionModeOutputLinesNV = 5269,
+ SpvExecutionModeOutputPrimitivesEXT = 5270,
SpvExecutionModeOutputPrimitivesNV = 5270,
SpvExecutionModeDerivativeGroupQuadsNV = 5289,
SpvExecutionModeDerivativeGroupLinearNV = 5290,
+ SpvExecutionModeOutputTrianglesEXT = 5298,
SpvExecutionModeOutputTrianglesNV = 5298,
SpvExecutionModePixelInterlockOrderedEXT = 5366,
SpvExecutionModePixelInterlockUnorderedEXT = 5367,
@@ -184,6 +199,7 @@ typedef enum SpvExecutionMode_ {
SpvExecutionModeNoGlobalOffsetINTEL = 5895,
SpvExecutionModeNumSIMDWorkitemsINTEL = 5896,
SpvExecutionModeSchedulerTargetFmaxMhzINTEL = 5903,
+ SpvExecutionModeNamedBarrierCountINTEL = 6417,
SpvExecutionModeMax = 0x7fffffff,
} SpvExecutionMode;
@@ -215,6 +231,7 @@ typedef enum SpvStorageClass_ {
SpvStorageClassShaderRecordBufferNV = 5343,
SpvStorageClassPhysicalStorageBuffer = 5349,
SpvStorageClassPhysicalStorageBufferEXT = 5349,
+ SpvStorageClassTaskPayloadWorkgroupEXT = 5402,
SpvStorageClassCodeSectionINTEL = 5605,
SpvStorageClassDeviceOnlyINTEL = 5936,
SpvStorageClassHostOnlyINTEL = 5937,
@@ -357,6 +374,8 @@ typedef enum SpvImageOperandsShift_ {
SpvImageOperandsVolatileTexelKHRShift = 11,
SpvImageOperandsSignExtendShift = 12,
SpvImageOperandsZeroExtendShift = 13,
+ SpvImageOperandsNontemporalShift = 14,
+ SpvImageOperandsOffsetsShift = 16,
SpvImageOperandsMax = 0x7fffffff,
} SpvImageOperandsShift;
@@ -380,6 +399,8 @@ typedef enum SpvImageOperandsMask_ {
SpvImageOperandsVolatileTexelKHRMask = 0x00000800,
SpvImageOperandsSignExtendMask = 0x00001000,
SpvImageOperandsZeroExtendMask = 0x00002000,
+ SpvImageOperandsNontemporalMask = 0x00004000,
+ SpvImageOperandsOffsetsMask = 0x00010000,
} SpvImageOperandsMask;
typedef enum SpvFPFastMathModeShift_ {
@@ -493,9 +514,11 @@ typedef enum SpvDecoration_ {
SpvDecorationPassthroughNV = 5250,
SpvDecorationViewportRelativeNV = 5252,
SpvDecorationSecondaryViewportRelativeNV = 5256,
+ SpvDecorationPerPrimitiveEXT = 5271,
SpvDecorationPerPrimitiveNV = 5271,
SpvDecorationPerViewNV = 5272,
SpvDecorationPerTaskNV = 5273,
+ SpvDecorationPerVertexKHR = 5285,
SpvDecorationPerVertexNV = 5285,
SpvDecorationNonUniform = 5300,
SpvDecorationNonUniformEXT = 5300,
@@ -503,6 +526,10 @@ typedef enum SpvDecoration_ {
SpvDecorationRestrictPointerEXT = 5355,
SpvDecorationAliasedPointer = 5356,
SpvDecorationAliasedPointerEXT = 5356,
+ SpvDecorationBindlessSamplerNV = 5398,
+ SpvDecorationBindlessImageNV = 5399,
+ SpvDecorationBoundSamplerNV = 5400,
+ SpvDecorationBoundImageNV = 5401,
SpvDecorationSIMTCallINTEL = 5599,
SpvDecorationReferencedIndirectlyINTEL = 5602,
SpvDecorationClobberINTEL = 5607,
@@ -537,11 +564,14 @@ typedef enum SpvDecoration_ {
SpvDecorationPrefetchINTEL = 5902,
SpvDecorationStallEnableINTEL = 5905,
SpvDecorationFuseLoopsInFunctionINTEL = 5907,
+ SpvDecorationAliasScopeINTEL = 5914,
+ SpvDecorationNoAliasINTEL = 5915,
SpvDecorationBufferLocationINTEL = 5921,
SpvDecorationIOPipeStorageINTEL = 5944,
SpvDecorationFunctionFloatingPointModeINTEL = 6080,
SpvDecorationSingleElementVectorINTEL = 6085,
SpvDecorationVectorComputeCallableFunctionINTEL = 6087,
+ SpvDecorationMediaBlockIOINTEL = 6140,
SpvDecorationMax = 0x7fffffff,
} SpvDecoration;
@@ -587,6 +617,11 @@ typedef enum SpvBuiltIn_ {
SpvBuiltInSubgroupLocalInvocationId = 41,
SpvBuiltInVertexIndex = 42,
SpvBuiltInInstanceIndex = 43,
+ SpvBuiltInCoreIDARM = 4160,
+ SpvBuiltInCoreCountARM = 4161,
+ SpvBuiltInCoreMaxIDARM = 4162,
+ SpvBuiltInWarpIDARM = 4163,
+ SpvBuiltInWarpMaxIDARM = 4164,
SpvBuiltInSubgroupEqMask = 4416,
SpvBuiltInSubgroupEqMaskKHR = 4416,
SpvBuiltInSubgroupGeMask = 4417,
@@ -626,12 +661,18 @@ typedef enum SpvBuiltIn_ {
SpvBuiltInLayerPerViewNV = 5279,
SpvBuiltInMeshViewCountNV = 5280,
SpvBuiltInMeshViewIndicesNV = 5281,
+ SpvBuiltInBaryCoordKHR = 5286,
SpvBuiltInBaryCoordNV = 5286,
+ SpvBuiltInBaryCoordNoPerspKHR = 5287,
SpvBuiltInBaryCoordNoPerspNV = 5287,
SpvBuiltInFragSizeEXT = 5292,
SpvBuiltInFragmentSizeNV = 5292,
SpvBuiltInFragInvocationCountEXT = 5293,
SpvBuiltInInvocationsPerPixelNV = 5293,
+ SpvBuiltInPrimitivePointIndicesEXT = 5294,
+ SpvBuiltInPrimitiveLineIndicesEXT = 5295,
+ SpvBuiltInPrimitiveTriangleIndicesEXT = 5296,
+ SpvBuiltInCullPrimitiveEXT = 5299,
SpvBuiltInLaunchIdKHR = 5319,
SpvBuiltInLaunchIdNV = 5319,
SpvBuiltInLaunchSizeKHR = 5320,
@@ -665,6 +706,7 @@ typedef enum SpvBuiltIn_ {
SpvBuiltInSMCountNV = 5375,
SpvBuiltInWarpIDNV = 5376,
SpvBuiltInSMIDNV = 5377,
+ SpvBuiltInCullMaskKHR = 6021,
SpvBuiltInMax = 0x7fffffff,
} SpvBuiltIn;
@@ -792,6 +834,8 @@ typedef enum SpvMemoryAccessShift_ {
SpvMemoryAccessMakePointerVisibleKHRShift = 4,
SpvMemoryAccessNonPrivatePointerShift = 5,
SpvMemoryAccessNonPrivatePointerKHRShift = 5,
+ SpvMemoryAccessAliasScopeINTELMaskShift = 16,
+ SpvMemoryAccessNoAliasINTELMaskShift = 17,
SpvMemoryAccessMax = 0x7fffffff,
} SpvMemoryAccessShift;
@@ -806,6 +850,8 @@ typedef enum SpvMemoryAccessMask_ {
SpvMemoryAccessMakePointerVisibleKHRMask = 0x00000010,
SpvMemoryAccessNonPrivatePointerMask = 0x00000020,
SpvMemoryAccessNonPrivatePointerKHRMask = 0x00000020,
+ SpvMemoryAccessAliasScopeINTELMaskMask = 0x00010000,
+ SpvMemoryAccessNoAliasINTELMaskMask = 0x00020000,
} SpvMemoryAccessMask;
typedef enum SpvScope_ {
@@ -918,6 +964,8 @@ typedef enum SpvCapability_ {
SpvCapabilityGroupNonUniformQuad = 68,
SpvCapabilityShaderLayer = 69,
SpvCapabilityShaderViewportIndex = 70,
+ SpvCapabilityUniformDecoration = 71,
+ SpvCapabilityCoreBuiltinsARM = 4165,
SpvCapabilityFragmentShadingRateKHR = 4422,
SpvCapabilitySubgroupBallotKHR = 4423,
SpvCapabilityDrawParameters = 4427,
@@ -966,6 +1014,8 @@ typedef enum SpvCapability_ {
SpvCapabilityFragmentFullyCoveredEXT = 5265,
SpvCapabilityMeshShadingNV = 5266,
SpvCapabilityImageFootprintNV = 5282,
+ SpvCapabilityMeshShadingEXT = 5283,
+ SpvCapabilityFragmentBarycentricKHR = 5284,
SpvCapabilityFragmentBarycentricNV = 5284,
SpvCapabilityComputeDerivativeGroupQuadsNV = 5288,
SpvCapabilityFragmentDensityEXT = 5291,
@@ -1010,7 +1060,10 @@ typedef enum SpvCapability_ {
SpvCapabilityFragmentShaderShadingRateInterlockEXT = 5372,
SpvCapabilityShaderSMBuiltinsNV = 5373,
SpvCapabilityFragmentShaderPixelInterlockEXT = 5378,
+ SpvCapabilityDemoteToHelperInvocation = 5379,
SpvCapabilityDemoteToHelperInvocationEXT = 5379,
+ SpvCapabilityRayTracingOpacityMicromapEXT = 5381,
+ SpvCapabilityBindlessTextureNV = 5390,
SpvCapabilitySubgroupShuffleINTEL = 5568,
SpvCapabilitySubgroupBufferBlockIOINTEL = 5569,
SpvCapabilitySubgroupImageBlockIOINTEL = 5570,
@@ -1043,23 +1096,32 @@ typedef enum SpvCapability_ {
SpvCapabilityFPGAMemoryAccessesINTEL = 5898,
SpvCapabilityFPGAClusterAttributesINTEL = 5904,
SpvCapabilityLoopFuseINTEL = 5906,
+ SpvCapabilityMemoryAccessAliasingINTEL = 5910,
SpvCapabilityFPGABufferLocationINTEL = 5920,
SpvCapabilityArbitraryPrecisionFixedPointINTEL = 5922,
SpvCapabilityUSMStorageClassesINTEL = 5935,
SpvCapabilityIOPipesINTEL = 5943,
SpvCapabilityBlockingPipesINTEL = 5945,
SpvCapabilityFPGARegINTEL = 5948,
+ SpvCapabilityDotProductInputAll = 6016,
SpvCapabilityDotProductInputAllKHR = 6016,
+ SpvCapabilityDotProductInput4x8Bit = 6017,
SpvCapabilityDotProductInput4x8BitKHR = 6017,
+ SpvCapabilityDotProductInput4x8BitPacked = 6018,
SpvCapabilityDotProductInput4x8BitPackedKHR = 6018,
+ SpvCapabilityDotProduct = 6019,
SpvCapabilityDotProductKHR = 6019,
+ SpvCapabilityRayCullMaskKHR = 6020,
SpvCapabilityBitInstructions = 6025,
+ SpvCapabilityGroupNonUniformRotateKHR = 6026,
SpvCapabilityAtomicFloat32AddEXT = 6033,
SpvCapabilityAtomicFloat64AddEXT = 6034,
SpvCapabilityLongConstantCompositeINTEL = 6089,
SpvCapabilityOptNoneINTEL = 6094,
SpvCapabilityAtomicFloat16AddEXT = 6095,
SpvCapabilityDebugInfoModuleINTEL = 6114,
+ SpvCapabilitySplitBarrierINTEL = 6141,
+ SpvCapabilityGroupUniformArithmeticKHR = 6400,
SpvCapabilityMax = 0x7fffffff,
} SpvCapability;
@@ -1074,6 +1136,7 @@ typedef enum SpvRayFlagsShift_ {
SpvRayFlagsCullNoOpaqueKHRShift = 7,
SpvRayFlagsSkipTrianglesKHRShift = 8,
SpvRayFlagsSkipAABBsKHRShift = 9,
+ SpvRayFlagsForceOpacityMicromap2StateEXTShift = 10,
SpvRayFlagsMax = 0x7fffffff,
} SpvRayFlagsShift;
@@ -1089,6 +1152,7 @@ typedef enum SpvRayFlagsMask_ {
SpvRayFlagsCullNoOpaqueKHRMask = 0x00000080,
SpvRayFlagsSkipTrianglesKHRMask = 0x00000100,
SpvRayFlagsSkipAABBsKHRMask = 0x00000200,
+ SpvRayFlagsForceOpacityMicromap2StateEXTMask = 0x00000400,
} SpvRayFlagsMask;
typedef enum SpvRayQueryIntersection_ {
@@ -1159,6 +1223,7 @@ typedef enum SpvOverflowModes_ {
} SpvOverflowModes;
typedef enum SpvPackedVectorFormat_ {
+ SpvPackedVectorFormatPackedVectorFormat4x8Bit = 0,
SpvPackedVectorFormatPackedVectorFormat4x8BitKHR = 0,
SpvPackedVectorFormatMax = 0x7fffffff,
} SpvPackedVectorFormat;
@@ -1514,17 +1579,24 @@ typedef enum SpvOp_ {
SpvOpSubgroupAllKHR = 4428,
SpvOpSubgroupAnyKHR = 4429,
SpvOpSubgroupAllEqualKHR = 4430,
+ SpvOpGroupNonUniformRotateKHR = 4431,
SpvOpSubgroupReadInvocationKHR = 4432,
SpvOpTraceRayKHR = 4445,
SpvOpExecuteCallableKHR = 4446,
SpvOpConvertUToAccelerationStructureKHR = 4447,
SpvOpIgnoreIntersectionKHR = 4448,
SpvOpTerminateRayKHR = 4449,
+ SpvOpSDot = 4450,
SpvOpSDotKHR = 4450,
+ SpvOpUDot = 4451,
SpvOpUDotKHR = 4451,
+ SpvOpSUDot = 4452,
SpvOpSUDotKHR = 4452,
+ SpvOpSDotAccSat = 4453,
SpvOpSDotAccSatKHR = 4453,
+ SpvOpUDotAccSat = 4454,
SpvOpUDotAccSatKHR = 4454,
+ SpvOpSUDotAccSat = 4455,
SpvOpSUDotAccSatKHR = 4455,
SpvOpTypeRayQueryKHR = 4472,
SpvOpRayQueryInitializeKHR = 4473,
@@ -1545,6 +1617,8 @@ typedef enum SpvOp_ {
SpvOpFragmentFetchAMD = 5012,
SpvOpReadClockKHR = 5056,
SpvOpImageSampleFootprintNV = 5283,
+ SpvOpEmitMeshTasksEXT = 5294,
+ SpvOpSetMeshOutputsEXT = 5295,
SpvOpGroupNonUniformPartitionNV = 5296,
SpvOpWritePackedPrimitiveIndices4x8NV = 5299,
SpvOpReportIntersectionKHR = 5334,
@@ -1564,8 +1638,16 @@ typedef enum SpvOp_ {
SpvOpCooperativeMatrixLengthNV = 5362,
SpvOpBeginInvocationInterlockEXT = 5364,
SpvOpEndInvocationInterlockEXT = 5365,
+ SpvOpDemoteToHelperInvocation = 5380,
SpvOpDemoteToHelperInvocationEXT = 5380,
SpvOpIsHelperInvocationEXT = 5381,
+ SpvOpConvertUToImageNV = 5391,
+ SpvOpConvertUToSamplerNV = 5392,
+ SpvOpConvertImageToUNV = 5393,
+ SpvOpConvertSamplerToUNV = 5394,
+ SpvOpConvertUToSampledImageNV = 5395,
+ SpvOpConvertSampledImageToUNV = 5396,
+ SpvOpSamplerImageAddressingModeNV = 5397,
SpvOpSubgroupShuffleINTEL = 5571,
SpvOpSubgroupShuffleDownINTEL = 5572,
SpvOpSubgroupShuffleUpINTEL = 5573,
@@ -1590,7 +1672,7 @@ typedef enum SpvOp_ {
SpvOpUSubSatINTEL = 5596,
SpvOpIMul32x16INTEL = 5597,
SpvOpUMul32x16INTEL = 5598,
- SpvOpConstFunctionPointerINTEL = 5600,
+ SpvOpConstantFunctionPointerINTEL = 5600,
SpvOpFunctionPointerCallINTEL = 5601,
SpvOpAsmTargetINTEL = 5609,
SpvOpAsmINTEL = 5610,
@@ -1766,6 +1848,9 @@ typedef enum SpvOp_ {
SpvOpArbitraryFloatPowRINTEL = 5881,
SpvOpArbitraryFloatPowNINTEL = 5882,
SpvOpLoopControlINTEL = 5887,
+ SpvOpAliasDomainDeclINTEL = 5911,
+ SpvOpAliasScopeDeclINTEL = 5912,
+ SpvOpAliasScopeListDeclINTEL = 5913,
SpvOpFixedSqrtINTEL = 5923,
SpvOpFixedRecipINTEL = 5924,
SpvOpFixedRsqrtINTEL = 5925,
@@ -1804,10 +1889,23 @@ typedef enum SpvOp_ {
SpvOpTypeStructContinuedINTEL = 6090,
SpvOpConstantCompositeContinuedINTEL = 6091,
SpvOpSpecConstantCompositeContinuedINTEL = 6092,
+ SpvOpControlBarrierArriveINTEL = 6142,
+ SpvOpControlBarrierWaitINTEL = 6143,
+ SpvOpGroupIMulKHR = 6401,
+ SpvOpGroupFMulKHR = 6402,
+ SpvOpGroupBitwiseAndKHR = 6403,
+ SpvOpGroupBitwiseOrKHR = 6404,
+ SpvOpGroupBitwiseXorKHR = 6405,
+ SpvOpGroupLogicalAndKHR = 6406,
+ SpvOpGroupLogicalOrKHR = 6407,
+ SpvOpGroupLogicalXorKHR = 6408,
SpvOpMax = 0x7fffffff,
} SpvOp;
#ifdef SPV_ENABLE_UTILITY_CODE
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultType) {
*hasResult = *hasResultType = false;
switch (opcode) {
@@ -2162,18 +2260,19 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpSubgroupAllKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupAnyKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupAllEqualKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupNonUniformRotateKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpTerminateRayKHR: *hasResult = false; *hasResultType = false; break;
- case SpvOpSDotKHR: *hasResult = true; *hasResultType = true; break;
- case SpvOpUDotKHR: *hasResult = true; *hasResultType = true; break;
- case SpvOpSUDotKHR: *hasResult = true; *hasResultType = true; break;
- case SpvOpSDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
- case SpvOpUDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
- case SpvOpSUDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpSDot: *hasResult = true; *hasResultType = true; break;
+ case SpvOpUDot: *hasResult = true; *hasResultType = true; break;
+ case SpvOpSUDot: *hasResult = true; *hasResultType = true; break;
+ case SpvOpSDotAccSat: *hasResult = true; *hasResultType = true; break;
+ case SpvOpUDotAccSat: *hasResult = true; *hasResultType = true; break;
+ case SpvOpSUDotAccSat: *hasResult = true; *hasResultType = true; break;
case SpvOpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
case SpvOpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
case SpvOpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
@@ -2193,6 +2292,8 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
case SpvOpReadClockKHR: *hasResult = true; *hasResultType = true; break;
case SpvOpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpEmitMeshTasksEXT: *hasResult = false; *hasResultType = false; break;
+ case SpvOpSetMeshOutputsEXT: *hasResult = false; *hasResultType = false; break;
case SpvOpGroupNonUniformPartitionNV: *hasResult = true; *hasResultType = true; break;
case SpvOpWritePackedPrimitiveIndices4x8NV: *hasResult = false; *hasResultType = false; break;
case SpvOpReportIntersectionNV: *hasResult = true; *hasResultType = true; break;
@@ -2210,8 +2311,15 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
case SpvOpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
case SpvOpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
- case SpvOpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
+ case SpvOpDemoteToHelperInvocation: *hasResult = false; *hasResultType = false; break;
case SpvOpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertUToImageNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertUToSamplerNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertImageToUNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertSamplerToUNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertUToSampledImageNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConvertSampledImageToUNV: *hasResult = true; *hasResultType = true; break;
+ case SpvOpSamplerImageAddressingModeNV: *hasResult = false; *hasResultType = false; break;
case SpvOpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2236,7 +2344,7 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpUSubSatINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
- case SpvOpConstFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
+ case SpvOpConstantFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpAsmINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2410,6 +2518,9 @@ inline void SpvHasResultAndType(SpvOp opcode, bool *hasResult, bool *hasResultTy
case SpvOpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpAliasDomainDeclINTEL: *hasResult = true; *hasResultType = false; break;
+ case SpvOpAliasScopeDeclINTEL: *hasResult = true; *hasResultType = false; break;
+ case SpvOpAliasScopeListDeclINTEL: *hasResult = true; *hasResultType = false; break;
case SpvOpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break;
case SpvOpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break;
@@ -2448,6 +2559,16 @@ 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 SpvOpControlBarrierArriveINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpControlBarrierWaitINTEL: *hasResult = false; *hasResultType = false; break;
+ case SpvOpGroupIMulKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupFMulKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupBitwiseAndKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupBitwiseOrKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupBitwiseXorKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupLogicalAndKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupLogicalOrKHR: *hasResult = true; *hasResultType = true; break;
+ case SpvOpGroupLogicalXorKHR: *hasResult = true; *hasResultType = true; break;
}
}
#endif /* SPV_ENABLE_UTILITY_CODE */
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp
deleted file mode 100644
index 5180457ce0a..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp
+++ /dev/null
@@ -1,2467 +0,0 @@
-// 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
-//
-// - 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
-//
-// 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 0x10500
-#define SPV_REVISION 4
-
-static const unsigned int MagicNumber = 0x07230203;
-static const unsigned int Version = 0x00010500;
-static const unsigned int Revision = 4;
-static const unsigned int OpCodeMask = 0xffff;
-static const unsigned int WordCountShift = 16;
-
-enum SourceLanguage {
- SourceLanguageUnknown = 0,
- SourceLanguageESSL = 1,
- SourceLanguageGLSL = 2,
- SourceLanguageOpenCL_C = 3,
- SourceLanguageOpenCL_CPP = 4,
- SourceLanguageHLSL = 5,
- SourceLanguageCPP_for_OpenCL = 6,
- SourceLanguageMax = 0x7fffffff,
-};
-
-enum ExecutionModel {
- ExecutionModelVertex = 0,
- ExecutionModelTessellationControl = 1,
- ExecutionModelTessellationEvaluation = 2,
- ExecutionModelGeometry = 3,
- ExecutionModelFragment = 4,
- ExecutionModelGLCompute = 5,
- ExecutionModelKernel = 6,
- ExecutionModelTaskNV = 5267,
- ExecutionModelMeshNV = 5268,
- ExecutionModelRayGenerationKHR = 5313,
- ExecutionModelRayGenerationNV = 5313,
- ExecutionModelIntersectionKHR = 5314,
- ExecutionModelIntersectionNV = 5314,
- ExecutionModelAnyHitKHR = 5315,
- ExecutionModelAnyHitNV = 5315,
- ExecutionModelClosestHitKHR = 5316,
- ExecutionModelClosestHitNV = 5316,
- ExecutionModelMissKHR = 5317,
- ExecutionModelMissNV = 5317,
- ExecutionModelCallableKHR = 5318,
- ExecutionModelCallableNV = 5318,
- ExecutionModelMax = 0x7fffffff,
-};
-
-enum AddressingModel {
- AddressingModelLogical = 0,
- AddressingModelPhysical32 = 1,
- AddressingModelPhysical64 = 2,
- AddressingModelPhysicalStorageBuffer64 = 5348,
- AddressingModelPhysicalStorageBuffer64EXT = 5348,
- AddressingModelMax = 0x7fffffff,
-};
-
-enum MemoryModel {
- MemoryModelSimple = 0,
- MemoryModelGLSL450 = 1,
- MemoryModelOpenCL = 2,
- MemoryModelVulkan = 3,
- MemoryModelVulkanKHR = 3,
- MemoryModelMax = 0x7fffffff,
-};
-
-enum ExecutionMode {
- ExecutionModeInvocations = 0,
- ExecutionModeSpacingEqual = 1,
- ExecutionModeSpacingFractionalEven = 2,
- ExecutionModeSpacingFractionalOdd = 3,
- ExecutionModeVertexOrderCw = 4,
- ExecutionModeVertexOrderCcw = 5,
- ExecutionModePixelCenterInteger = 6,
- ExecutionModeOriginUpperLeft = 7,
- ExecutionModeOriginLowerLeft = 8,
- ExecutionModeEarlyFragmentTests = 9,
- ExecutionModePointMode = 10,
- ExecutionModeXfb = 11,
- ExecutionModeDepthReplacing = 12,
- ExecutionModeDepthGreater = 14,
- ExecutionModeDepthLess = 15,
- ExecutionModeDepthUnchanged = 16,
- ExecutionModeLocalSize = 17,
- ExecutionModeLocalSizeHint = 18,
- ExecutionModeInputPoints = 19,
- ExecutionModeInputLines = 20,
- ExecutionModeInputLinesAdjacency = 21,
- ExecutionModeTriangles = 22,
- ExecutionModeInputTrianglesAdjacency = 23,
- ExecutionModeQuads = 24,
- ExecutionModeIsolines = 25,
- ExecutionModeOutputVertices = 26,
- ExecutionModeOutputPoints = 27,
- ExecutionModeOutputLineStrip = 28,
- ExecutionModeOutputTriangleStrip = 29,
- ExecutionModeVecTypeHint = 30,
- ExecutionModeContractionOff = 31,
- ExecutionModeInitializer = 33,
- ExecutionModeFinalizer = 34,
- ExecutionModeSubgroupSize = 35,
- ExecutionModeSubgroupsPerWorkgroup = 36,
- ExecutionModeSubgroupsPerWorkgroupId = 37,
- ExecutionModeLocalSizeId = 38,
- ExecutionModeLocalSizeHintId = 39,
- ExecutionModeSubgroupUniformControlFlowKHR = 4421,
- ExecutionModePostDepthCoverage = 4446,
- ExecutionModeDenormPreserve = 4459,
- ExecutionModeDenormFlushToZero = 4460,
- ExecutionModeSignedZeroInfNanPreserve = 4461,
- ExecutionModeRoundingModeRTE = 4462,
- ExecutionModeRoundingModeRTZ = 4463,
- ExecutionModeStencilRefReplacingEXT = 5027,
- ExecutionModeOutputLinesNV = 5269,
- ExecutionModeOutputPrimitivesNV = 5270,
- ExecutionModeDerivativeGroupQuadsNV = 5289,
- ExecutionModeDerivativeGroupLinearNV = 5290,
- ExecutionModeOutputTrianglesNV = 5298,
- ExecutionModePixelInterlockOrderedEXT = 5366,
- ExecutionModePixelInterlockUnorderedEXT = 5367,
- ExecutionModeSampleInterlockOrderedEXT = 5368,
- ExecutionModeSampleInterlockUnorderedEXT = 5369,
- ExecutionModeShadingRateInterlockOrderedEXT = 5370,
- ExecutionModeShadingRateInterlockUnorderedEXT = 5371,
- ExecutionModeSharedLocalMemorySizeINTEL = 5618,
- ExecutionModeRoundingModeRTPINTEL = 5620,
- ExecutionModeRoundingModeRTNINTEL = 5621,
- ExecutionModeFloatingPointModeALTINTEL = 5622,
- ExecutionModeFloatingPointModeIEEEINTEL = 5623,
- ExecutionModeMaxWorkgroupSizeINTEL = 5893,
- ExecutionModeMaxWorkDimINTEL = 5894,
- ExecutionModeNoGlobalOffsetINTEL = 5895,
- ExecutionModeNumSIMDWorkitemsINTEL = 5896,
- ExecutionModeSchedulerTargetFmaxMhzINTEL = 5903,
- ExecutionModeMax = 0x7fffffff,
-};
-
-enum StorageClass {
- StorageClassUniformConstant = 0,
- StorageClassInput = 1,
- StorageClassUniform = 2,
- StorageClassOutput = 3,
- StorageClassWorkgroup = 4,
- StorageClassCrossWorkgroup = 5,
- StorageClassPrivate = 6,
- StorageClassFunction = 7,
- StorageClassGeneric = 8,
- StorageClassPushConstant = 9,
- StorageClassAtomicCounter = 10,
- StorageClassImage = 11,
- StorageClassStorageBuffer = 12,
- StorageClassCallableDataKHR = 5328,
- StorageClassCallableDataNV = 5328,
- StorageClassIncomingCallableDataKHR = 5329,
- StorageClassIncomingCallableDataNV = 5329,
- StorageClassRayPayloadKHR = 5338,
- StorageClassRayPayloadNV = 5338,
- StorageClassHitAttributeKHR = 5339,
- StorageClassHitAttributeNV = 5339,
- StorageClassIncomingRayPayloadKHR = 5342,
- StorageClassIncomingRayPayloadNV = 5342,
- StorageClassShaderRecordBufferKHR = 5343,
- StorageClassShaderRecordBufferNV = 5343,
- StorageClassPhysicalStorageBuffer = 5349,
- StorageClassPhysicalStorageBufferEXT = 5349,
- StorageClassCodeSectionINTEL = 5605,
- StorageClassDeviceOnlyINTEL = 5936,
- StorageClassHostOnlyINTEL = 5937,
- StorageClassMax = 0x7fffffff,
-};
-
-enum Dim {
- Dim1D = 0,
- Dim2D = 1,
- Dim3D = 2,
- DimCube = 3,
- DimRect = 4,
- DimBuffer = 5,
- DimSubpassData = 6,
- DimMax = 0x7fffffff,
-};
-
-enum SamplerAddressingMode {
- SamplerAddressingModeNone = 0,
- SamplerAddressingModeClampToEdge = 1,
- SamplerAddressingModeClamp = 2,
- SamplerAddressingModeRepeat = 3,
- SamplerAddressingModeRepeatMirrored = 4,
- SamplerAddressingModeMax = 0x7fffffff,
-};
-
-enum SamplerFilterMode {
- SamplerFilterModeNearest = 0,
- SamplerFilterModeLinear = 1,
- SamplerFilterModeMax = 0x7fffffff,
-};
-
-enum ImageFormat {
- ImageFormatUnknown = 0,
- ImageFormatRgba32f = 1,
- ImageFormatRgba16f = 2,
- ImageFormatR32f = 3,
- ImageFormatRgba8 = 4,
- ImageFormatRgba8Snorm = 5,
- ImageFormatRg32f = 6,
- ImageFormatRg16f = 7,
- ImageFormatR11fG11fB10f = 8,
- ImageFormatR16f = 9,
- ImageFormatRgba16 = 10,
- ImageFormatRgb10A2 = 11,
- ImageFormatRg16 = 12,
- ImageFormatRg8 = 13,
- ImageFormatR16 = 14,
- ImageFormatR8 = 15,
- ImageFormatRgba16Snorm = 16,
- ImageFormatRg16Snorm = 17,
- ImageFormatRg8Snorm = 18,
- ImageFormatR16Snorm = 19,
- ImageFormatR8Snorm = 20,
- ImageFormatRgba32i = 21,
- ImageFormatRgba16i = 22,
- ImageFormatRgba8i = 23,
- ImageFormatR32i = 24,
- ImageFormatRg32i = 25,
- ImageFormatRg16i = 26,
- ImageFormatRg8i = 27,
- ImageFormatR16i = 28,
- ImageFormatR8i = 29,
- ImageFormatRgba32ui = 30,
- ImageFormatRgba16ui = 31,
- ImageFormatRgba8ui = 32,
- ImageFormatR32ui = 33,
- ImageFormatRgb10a2ui = 34,
- ImageFormatRg32ui = 35,
- ImageFormatRg16ui = 36,
- ImageFormatRg8ui = 37,
- ImageFormatR16ui = 38,
- ImageFormatR8ui = 39,
- ImageFormatR64ui = 40,
- ImageFormatR64i = 41,
- ImageFormatMax = 0x7fffffff,
-};
-
-enum ImageChannelOrder {
- ImageChannelOrderR = 0,
- ImageChannelOrderA = 1,
- ImageChannelOrderRG = 2,
- ImageChannelOrderRA = 3,
- ImageChannelOrderRGB = 4,
- ImageChannelOrderRGBA = 5,
- ImageChannelOrderBGRA = 6,
- ImageChannelOrderARGB = 7,
- ImageChannelOrderIntensity = 8,
- ImageChannelOrderLuminance = 9,
- ImageChannelOrderRx = 10,
- ImageChannelOrderRGx = 11,
- ImageChannelOrderRGBx = 12,
- ImageChannelOrderDepth = 13,
- ImageChannelOrderDepthStencil = 14,
- ImageChannelOrdersRGB = 15,
- ImageChannelOrdersRGBx = 16,
- ImageChannelOrdersRGBA = 17,
- ImageChannelOrdersBGRA = 18,
- ImageChannelOrderABGR = 19,
- ImageChannelOrderMax = 0x7fffffff,
-};
-
-enum ImageChannelDataType {
- ImageChannelDataTypeSnormInt8 = 0,
- ImageChannelDataTypeSnormInt16 = 1,
- ImageChannelDataTypeUnormInt8 = 2,
- ImageChannelDataTypeUnormInt16 = 3,
- ImageChannelDataTypeUnormShort565 = 4,
- ImageChannelDataTypeUnormShort555 = 5,
- ImageChannelDataTypeUnormInt101010 = 6,
- ImageChannelDataTypeSignedInt8 = 7,
- ImageChannelDataTypeSignedInt16 = 8,
- ImageChannelDataTypeSignedInt32 = 9,
- ImageChannelDataTypeUnsignedInt8 = 10,
- ImageChannelDataTypeUnsignedInt16 = 11,
- ImageChannelDataTypeUnsignedInt32 = 12,
- ImageChannelDataTypeHalfFloat = 13,
- ImageChannelDataTypeFloat = 14,
- ImageChannelDataTypeUnormInt24 = 15,
- ImageChannelDataTypeUnormInt101010_2 = 16,
- ImageChannelDataTypeMax = 0x7fffffff,
-};
-
-enum ImageOperandsShift {
- ImageOperandsBiasShift = 0,
- ImageOperandsLodShift = 1,
- ImageOperandsGradShift = 2,
- ImageOperandsConstOffsetShift = 3,
- ImageOperandsOffsetShift = 4,
- ImageOperandsConstOffsetsShift = 5,
- ImageOperandsSampleShift = 6,
- ImageOperandsMinLodShift = 7,
- ImageOperandsMakeTexelAvailableShift = 8,
- ImageOperandsMakeTexelAvailableKHRShift = 8,
- ImageOperandsMakeTexelVisibleShift = 9,
- ImageOperandsMakeTexelVisibleKHRShift = 9,
- ImageOperandsNonPrivateTexelShift = 10,
- ImageOperandsNonPrivateTexelKHRShift = 10,
- ImageOperandsVolatileTexelShift = 11,
- ImageOperandsVolatileTexelKHRShift = 11,
- ImageOperandsSignExtendShift = 12,
- ImageOperandsZeroExtendShift = 13,
- ImageOperandsMax = 0x7fffffff,
-};
-
-enum ImageOperandsMask {
- ImageOperandsMaskNone = 0,
- ImageOperandsBiasMask = 0x00000001,
- ImageOperandsLodMask = 0x00000002,
- ImageOperandsGradMask = 0x00000004,
- ImageOperandsConstOffsetMask = 0x00000008,
- ImageOperandsOffsetMask = 0x00000010,
- ImageOperandsConstOffsetsMask = 0x00000020,
- ImageOperandsSampleMask = 0x00000040,
- ImageOperandsMinLodMask = 0x00000080,
- ImageOperandsMakeTexelAvailableMask = 0x00000100,
- ImageOperandsMakeTexelAvailableKHRMask = 0x00000100,
- ImageOperandsMakeTexelVisibleMask = 0x00000200,
- ImageOperandsMakeTexelVisibleKHRMask = 0x00000200,
- ImageOperandsNonPrivateTexelMask = 0x00000400,
- ImageOperandsNonPrivateTexelKHRMask = 0x00000400,
- ImageOperandsVolatileTexelMask = 0x00000800,
- ImageOperandsVolatileTexelKHRMask = 0x00000800,
- ImageOperandsSignExtendMask = 0x00001000,
- ImageOperandsZeroExtendMask = 0x00002000,
-};
-
-enum FPFastMathModeShift {
- FPFastMathModeNotNaNShift = 0,
- FPFastMathModeNotInfShift = 1,
- FPFastMathModeNSZShift = 2,
- FPFastMathModeAllowRecipShift = 3,
- FPFastMathModeFastShift = 4,
- FPFastMathModeAllowContractFastINTELShift = 16,
- FPFastMathModeAllowReassocINTELShift = 17,
- FPFastMathModeMax = 0x7fffffff,
-};
-
-enum FPFastMathModeMask {
- FPFastMathModeMaskNone = 0,
- FPFastMathModeNotNaNMask = 0x00000001,
- FPFastMathModeNotInfMask = 0x00000002,
- FPFastMathModeNSZMask = 0x00000004,
- FPFastMathModeAllowRecipMask = 0x00000008,
- FPFastMathModeFastMask = 0x00000010,
- FPFastMathModeAllowContractFastINTELMask = 0x00010000,
- FPFastMathModeAllowReassocINTELMask = 0x00020000,
-};
-
-enum FPRoundingMode {
- FPRoundingModeRTE = 0,
- FPRoundingModeRTZ = 1,
- FPRoundingModeRTP = 2,
- FPRoundingModeRTN = 3,
- FPRoundingModeMax = 0x7fffffff,
-};
-
-enum LinkageType {
- LinkageTypeExport = 0,
- LinkageTypeImport = 1,
- LinkageTypeLinkOnceODR = 2,
- LinkageTypeMax = 0x7fffffff,
-};
-
-enum AccessQualifier {
- AccessQualifierReadOnly = 0,
- AccessQualifierWriteOnly = 1,
- AccessQualifierReadWrite = 2,
- AccessQualifierMax = 0x7fffffff,
-};
-
-enum FunctionParameterAttribute {
- FunctionParameterAttributeZext = 0,
- FunctionParameterAttributeSext = 1,
- FunctionParameterAttributeByVal = 2,
- FunctionParameterAttributeSret = 3,
- FunctionParameterAttributeNoAlias = 4,
- FunctionParameterAttributeNoCapture = 5,
- FunctionParameterAttributeNoWrite = 6,
- FunctionParameterAttributeNoReadWrite = 7,
- FunctionParameterAttributeMax = 0x7fffffff,
-};
-
-enum Decoration {
- DecorationRelaxedPrecision = 0,
- DecorationSpecId = 1,
- DecorationBlock = 2,
- DecorationBufferBlock = 3,
- DecorationRowMajor = 4,
- DecorationColMajor = 5,
- DecorationArrayStride = 6,
- DecorationMatrixStride = 7,
- DecorationGLSLShared = 8,
- DecorationGLSLPacked = 9,
- DecorationCPacked = 10,
- DecorationBuiltIn = 11,
- DecorationNoPerspective = 13,
- DecorationFlat = 14,
- DecorationPatch = 15,
- DecorationCentroid = 16,
- DecorationSample = 17,
- DecorationInvariant = 18,
- DecorationRestrict = 19,
- DecorationAliased = 20,
- DecorationVolatile = 21,
- DecorationConstant = 22,
- DecorationCoherent = 23,
- DecorationNonWritable = 24,
- DecorationNonReadable = 25,
- DecorationUniform = 26,
- DecorationUniformId = 27,
- DecorationSaturatedConversion = 28,
- DecorationStream = 29,
- DecorationLocation = 30,
- DecorationComponent = 31,
- DecorationIndex = 32,
- DecorationBinding = 33,
- DecorationDescriptorSet = 34,
- DecorationOffset = 35,
- DecorationXfbBuffer = 36,
- DecorationXfbStride = 37,
- DecorationFuncParamAttr = 38,
- DecorationFPRoundingMode = 39,
- DecorationFPFastMathMode = 40,
- DecorationLinkageAttributes = 41,
- DecorationNoContraction = 42,
- DecorationInputAttachmentIndex = 43,
- DecorationAlignment = 44,
- DecorationMaxByteOffset = 45,
- DecorationAlignmentId = 46,
- DecorationMaxByteOffsetId = 47,
- DecorationNoSignedWrap = 4469,
- DecorationNoUnsignedWrap = 4470,
- DecorationExplicitInterpAMD = 4999,
- DecorationOverrideCoverageNV = 5248,
- DecorationPassthroughNV = 5250,
- DecorationViewportRelativeNV = 5252,
- DecorationSecondaryViewportRelativeNV = 5256,
- DecorationPerPrimitiveNV = 5271,
- DecorationPerViewNV = 5272,
- DecorationPerTaskNV = 5273,
- DecorationPerVertexNV = 5285,
- DecorationNonUniform = 5300,
- DecorationNonUniformEXT = 5300,
- DecorationRestrictPointer = 5355,
- DecorationRestrictPointerEXT = 5355,
- DecorationAliasedPointer = 5356,
- DecorationAliasedPointerEXT = 5356,
- DecorationSIMTCallINTEL = 5599,
- DecorationReferencedIndirectlyINTEL = 5602,
- DecorationClobberINTEL = 5607,
- DecorationSideEffectsINTEL = 5608,
- DecorationVectorComputeVariableINTEL = 5624,
- DecorationFuncParamIOKindINTEL = 5625,
- DecorationVectorComputeFunctionINTEL = 5626,
- DecorationStackCallINTEL = 5627,
- DecorationGlobalVariableOffsetINTEL = 5628,
- DecorationCounterBuffer = 5634,
- DecorationHlslCounterBufferGOOGLE = 5634,
- DecorationHlslSemanticGOOGLE = 5635,
- DecorationUserSemantic = 5635,
- DecorationUserTypeGOOGLE = 5636,
- DecorationFunctionRoundingModeINTEL = 5822,
- DecorationFunctionDenormModeINTEL = 5823,
- DecorationRegisterINTEL = 5825,
- DecorationMemoryINTEL = 5826,
- DecorationNumbanksINTEL = 5827,
- DecorationBankwidthINTEL = 5828,
- DecorationMaxPrivateCopiesINTEL = 5829,
- DecorationSinglepumpINTEL = 5830,
- DecorationDoublepumpINTEL = 5831,
- DecorationMaxReplicatesINTEL = 5832,
- DecorationSimpleDualPortINTEL = 5833,
- DecorationMergeINTEL = 5834,
- DecorationBankBitsINTEL = 5835,
- DecorationForcePow2DepthINTEL = 5836,
- DecorationBurstCoalesceINTEL = 5899,
- DecorationCacheSizeINTEL = 5900,
- DecorationDontStaticallyCoalesceINTEL = 5901,
- DecorationPrefetchINTEL = 5902,
- DecorationStallEnableINTEL = 5905,
- DecorationFuseLoopsInFunctionINTEL = 5907,
- DecorationBufferLocationINTEL = 5921,
- DecorationIOPipeStorageINTEL = 5944,
- DecorationFunctionFloatingPointModeINTEL = 6080,
- DecorationSingleElementVectorINTEL = 6085,
- DecorationVectorComputeCallableFunctionINTEL = 6087,
- DecorationMax = 0x7fffffff,
-};
-
-enum BuiltIn {
- BuiltInPosition = 0,
- BuiltInPointSize = 1,
- BuiltInClipDistance = 3,
- BuiltInCullDistance = 4,
- BuiltInVertexId = 5,
- BuiltInInstanceId = 6,
- BuiltInPrimitiveId = 7,
- BuiltInInvocationId = 8,
- BuiltInLayer = 9,
- BuiltInViewportIndex = 10,
- BuiltInTessLevelOuter = 11,
- BuiltInTessLevelInner = 12,
- BuiltInTessCoord = 13,
- BuiltInPatchVertices = 14,
- BuiltInFragCoord = 15,
- BuiltInPointCoord = 16,
- BuiltInFrontFacing = 17,
- BuiltInSampleId = 18,
- BuiltInSamplePosition = 19,
- BuiltInSampleMask = 20,
- BuiltInFragDepth = 22,
- BuiltInHelperInvocation = 23,
- BuiltInNumWorkgroups = 24,
- BuiltInWorkgroupSize = 25,
- BuiltInWorkgroupId = 26,
- BuiltInLocalInvocationId = 27,
- BuiltInGlobalInvocationId = 28,
- BuiltInLocalInvocationIndex = 29,
- BuiltInWorkDim = 30,
- BuiltInGlobalSize = 31,
- BuiltInEnqueuedWorkgroupSize = 32,
- BuiltInGlobalOffset = 33,
- BuiltInGlobalLinearId = 34,
- BuiltInSubgroupSize = 36,
- BuiltInSubgroupMaxSize = 37,
- BuiltInNumSubgroups = 38,
- BuiltInNumEnqueuedSubgroups = 39,
- BuiltInSubgroupId = 40,
- BuiltInSubgroupLocalInvocationId = 41,
- BuiltInVertexIndex = 42,
- BuiltInInstanceIndex = 43,
- BuiltInSubgroupEqMask = 4416,
- BuiltInSubgroupEqMaskKHR = 4416,
- BuiltInSubgroupGeMask = 4417,
- BuiltInSubgroupGeMaskKHR = 4417,
- BuiltInSubgroupGtMask = 4418,
- BuiltInSubgroupGtMaskKHR = 4418,
- BuiltInSubgroupLeMask = 4419,
- BuiltInSubgroupLeMaskKHR = 4419,
- BuiltInSubgroupLtMask = 4420,
- BuiltInSubgroupLtMaskKHR = 4420,
- BuiltInBaseVertex = 4424,
- BuiltInBaseInstance = 4425,
- BuiltInDrawIndex = 4426,
- BuiltInPrimitiveShadingRateKHR = 4432,
- BuiltInDeviceIndex = 4438,
- BuiltInViewIndex = 4440,
- BuiltInShadingRateKHR = 4444,
- BuiltInBaryCoordNoPerspAMD = 4992,
- BuiltInBaryCoordNoPerspCentroidAMD = 4993,
- BuiltInBaryCoordNoPerspSampleAMD = 4994,
- BuiltInBaryCoordSmoothAMD = 4995,
- BuiltInBaryCoordSmoothCentroidAMD = 4996,
- BuiltInBaryCoordSmoothSampleAMD = 4997,
- BuiltInBaryCoordPullModelAMD = 4998,
- BuiltInFragStencilRefEXT = 5014,
- BuiltInViewportMaskNV = 5253,
- BuiltInSecondaryPositionNV = 5257,
- BuiltInSecondaryViewportMaskNV = 5258,
- BuiltInPositionPerViewNV = 5261,
- BuiltInViewportMaskPerViewNV = 5262,
- BuiltInFullyCoveredEXT = 5264,
- BuiltInTaskCountNV = 5274,
- BuiltInPrimitiveCountNV = 5275,
- BuiltInPrimitiveIndicesNV = 5276,
- BuiltInClipDistancePerViewNV = 5277,
- BuiltInCullDistancePerViewNV = 5278,
- BuiltInLayerPerViewNV = 5279,
- BuiltInMeshViewCountNV = 5280,
- BuiltInMeshViewIndicesNV = 5281,
- BuiltInBaryCoordNV = 5286,
- BuiltInBaryCoordNoPerspNV = 5287,
- BuiltInFragSizeEXT = 5292,
- BuiltInFragmentSizeNV = 5292,
- BuiltInFragInvocationCountEXT = 5293,
- BuiltInInvocationsPerPixelNV = 5293,
- BuiltInLaunchIdKHR = 5319,
- BuiltInLaunchIdNV = 5319,
- BuiltInLaunchSizeKHR = 5320,
- BuiltInLaunchSizeNV = 5320,
- BuiltInWorldRayOriginKHR = 5321,
- BuiltInWorldRayOriginNV = 5321,
- BuiltInWorldRayDirectionKHR = 5322,
- BuiltInWorldRayDirectionNV = 5322,
- BuiltInObjectRayOriginKHR = 5323,
- BuiltInObjectRayOriginNV = 5323,
- BuiltInObjectRayDirectionKHR = 5324,
- BuiltInObjectRayDirectionNV = 5324,
- BuiltInRayTminKHR = 5325,
- BuiltInRayTminNV = 5325,
- BuiltInRayTmaxKHR = 5326,
- BuiltInRayTmaxNV = 5326,
- BuiltInInstanceCustomIndexKHR = 5327,
- BuiltInInstanceCustomIndexNV = 5327,
- BuiltInObjectToWorldKHR = 5330,
- BuiltInObjectToWorldNV = 5330,
- BuiltInWorldToObjectKHR = 5331,
- BuiltInWorldToObjectNV = 5331,
- BuiltInHitTNV = 5332,
- BuiltInHitKindKHR = 5333,
- BuiltInHitKindNV = 5333,
- BuiltInCurrentRayTimeNV = 5334,
- BuiltInIncomingRayFlagsKHR = 5351,
- BuiltInIncomingRayFlagsNV = 5351,
- BuiltInRayGeometryIndexKHR = 5352,
- BuiltInWarpsPerSMNV = 5374,
- BuiltInSMCountNV = 5375,
- BuiltInWarpIDNV = 5376,
- BuiltInSMIDNV = 5377,
- BuiltInMax = 0x7fffffff,
-};
-
-enum SelectionControlShift {
- SelectionControlFlattenShift = 0,
- SelectionControlDontFlattenShift = 1,
- SelectionControlMax = 0x7fffffff,
-};
-
-enum SelectionControlMask {
- SelectionControlMaskNone = 0,
- SelectionControlFlattenMask = 0x00000001,
- SelectionControlDontFlattenMask = 0x00000002,
-};
-
-enum LoopControlShift {
- LoopControlUnrollShift = 0,
- LoopControlDontUnrollShift = 1,
- LoopControlDependencyInfiniteShift = 2,
- LoopControlDependencyLengthShift = 3,
- LoopControlMinIterationsShift = 4,
- LoopControlMaxIterationsShift = 5,
- LoopControlIterationMultipleShift = 6,
- LoopControlPeelCountShift = 7,
- LoopControlPartialCountShift = 8,
- LoopControlInitiationIntervalINTELShift = 16,
- LoopControlMaxConcurrencyINTELShift = 17,
- LoopControlDependencyArrayINTELShift = 18,
- LoopControlPipelineEnableINTELShift = 19,
- LoopControlLoopCoalesceINTELShift = 20,
- LoopControlMaxInterleavingINTELShift = 21,
- LoopControlSpeculatedIterationsINTELShift = 22,
- LoopControlNoFusionINTELShift = 23,
- LoopControlMax = 0x7fffffff,
-};
-
-enum LoopControlMask {
- LoopControlMaskNone = 0,
- LoopControlUnrollMask = 0x00000001,
- LoopControlDontUnrollMask = 0x00000002,
- LoopControlDependencyInfiniteMask = 0x00000004,
- LoopControlDependencyLengthMask = 0x00000008,
- LoopControlMinIterationsMask = 0x00000010,
- LoopControlMaxIterationsMask = 0x00000020,
- LoopControlIterationMultipleMask = 0x00000040,
- LoopControlPeelCountMask = 0x00000080,
- LoopControlPartialCountMask = 0x00000100,
- LoopControlInitiationIntervalINTELMask = 0x00010000,
- LoopControlMaxConcurrencyINTELMask = 0x00020000,
- LoopControlDependencyArrayINTELMask = 0x00040000,
- LoopControlPipelineEnableINTELMask = 0x00080000,
- LoopControlLoopCoalesceINTELMask = 0x00100000,
- LoopControlMaxInterleavingINTELMask = 0x00200000,
- LoopControlSpeculatedIterationsINTELMask = 0x00400000,
- LoopControlNoFusionINTELMask = 0x00800000,
-};
-
-enum FunctionControlShift {
- FunctionControlInlineShift = 0,
- FunctionControlDontInlineShift = 1,
- FunctionControlPureShift = 2,
- FunctionControlConstShift = 3,
- FunctionControlOptNoneINTELShift = 16,
- FunctionControlMax = 0x7fffffff,
-};
-
-enum FunctionControlMask {
- FunctionControlMaskNone = 0,
- FunctionControlInlineMask = 0x00000001,
- FunctionControlDontInlineMask = 0x00000002,
- FunctionControlPureMask = 0x00000004,
- FunctionControlConstMask = 0x00000008,
- FunctionControlOptNoneINTELMask = 0x00010000,
-};
-
-enum MemorySemanticsShift {
- MemorySemanticsAcquireShift = 1,
- MemorySemanticsReleaseShift = 2,
- MemorySemanticsAcquireReleaseShift = 3,
- MemorySemanticsSequentiallyConsistentShift = 4,
- MemorySemanticsUniformMemoryShift = 6,
- MemorySemanticsSubgroupMemoryShift = 7,
- MemorySemanticsWorkgroupMemoryShift = 8,
- MemorySemanticsCrossWorkgroupMemoryShift = 9,
- MemorySemanticsAtomicCounterMemoryShift = 10,
- MemorySemanticsImageMemoryShift = 11,
- MemorySemanticsOutputMemoryShift = 12,
- MemorySemanticsOutputMemoryKHRShift = 12,
- MemorySemanticsMakeAvailableShift = 13,
- MemorySemanticsMakeAvailableKHRShift = 13,
- MemorySemanticsMakeVisibleShift = 14,
- MemorySemanticsMakeVisibleKHRShift = 14,
- MemorySemanticsVolatileShift = 15,
- MemorySemanticsMax = 0x7fffffff,
-};
-
-enum MemorySemanticsMask {
- MemorySemanticsMaskNone = 0,
- MemorySemanticsAcquireMask = 0x00000002,
- MemorySemanticsReleaseMask = 0x00000004,
- MemorySemanticsAcquireReleaseMask = 0x00000008,
- MemorySemanticsSequentiallyConsistentMask = 0x00000010,
- MemorySemanticsUniformMemoryMask = 0x00000040,
- MemorySemanticsSubgroupMemoryMask = 0x00000080,
- MemorySemanticsWorkgroupMemoryMask = 0x00000100,
- MemorySemanticsCrossWorkgroupMemoryMask = 0x00000200,
- MemorySemanticsAtomicCounterMemoryMask = 0x00000400,
- MemorySemanticsImageMemoryMask = 0x00000800,
- MemorySemanticsOutputMemoryMask = 0x00001000,
- MemorySemanticsOutputMemoryKHRMask = 0x00001000,
- MemorySemanticsMakeAvailableMask = 0x00002000,
- MemorySemanticsMakeAvailableKHRMask = 0x00002000,
- MemorySemanticsMakeVisibleMask = 0x00004000,
- MemorySemanticsMakeVisibleKHRMask = 0x00004000,
- MemorySemanticsVolatileMask = 0x00008000,
-};
-
-enum MemoryAccessShift {
- MemoryAccessVolatileShift = 0,
- MemoryAccessAlignedShift = 1,
- MemoryAccessNontemporalShift = 2,
- MemoryAccessMakePointerAvailableShift = 3,
- MemoryAccessMakePointerAvailableKHRShift = 3,
- MemoryAccessMakePointerVisibleShift = 4,
- MemoryAccessMakePointerVisibleKHRShift = 4,
- MemoryAccessNonPrivatePointerShift = 5,
- MemoryAccessNonPrivatePointerKHRShift = 5,
- MemoryAccessMax = 0x7fffffff,
-};
-
-enum MemoryAccessMask {
- MemoryAccessMaskNone = 0,
- MemoryAccessVolatileMask = 0x00000001,
- MemoryAccessAlignedMask = 0x00000002,
- MemoryAccessNontemporalMask = 0x00000004,
- MemoryAccessMakePointerAvailableMask = 0x00000008,
- MemoryAccessMakePointerAvailableKHRMask = 0x00000008,
- MemoryAccessMakePointerVisibleMask = 0x00000010,
- MemoryAccessMakePointerVisibleKHRMask = 0x00000010,
- MemoryAccessNonPrivatePointerMask = 0x00000020,
- MemoryAccessNonPrivatePointerKHRMask = 0x00000020,
-};
-
-enum Scope {
- ScopeCrossDevice = 0,
- ScopeDevice = 1,
- ScopeWorkgroup = 2,
- ScopeSubgroup = 3,
- ScopeInvocation = 4,
- ScopeQueueFamily = 5,
- ScopeQueueFamilyKHR = 5,
- ScopeShaderCallKHR = 6,
- ScopeMax = 0x7fffffff,
-};
-
-enum GroupOperation {
- GroupOperationReduce = 0,
- GroupOperationInclusiveScan = 1,
- GroupOperationExclusiveScan = 2,
- GroupOperationClusteredReduce = 3,
- GroupOperationPartitionedReduceNV = 6,
- GroupOperationPartitionedInclusiveScanNV = 7,
- GroupOperationPartitionedExclusiveScanNV = 8,
- GroupOperationMax = 0x7fffffff,
-};
-
-enum KernelEnqueueFlags {
- KernelEnqueueFlagsNoWait = 0,
- KernelEnqueueFlagsWaitKernel = 1,
- KernelEnqueueFlagsWaitWorkGroup = 2,
- KernelEnqueueFlagsMax = 0x7fffffff,
-};
-
-enum KernelProfilingInfoShift {
- KernelProfilingInfoCmdExecTimeShift = 0,
- KernelProfilingInfoMax = 0x7fffffff,
-};
-
-enum KernelProfilingInfoMask {
- KernelProfilingInfoMaskNone = 0,
- KernelProfilingInfoCmdExecTimeMask = 0x00000001,
-};
-
-enum Capability {
- CapabilityMatrix = 0,
- CapabilityShader = 1,
- CapabilityGeometry = 2,
- CapabilityTessellation = 3,
- CapabilityAddresses = 4,
- CapabilityLinkage = 5,
- CapabilityKernel = 6,
- CapabilityVector16 = 7,
- CapabilityFloat16Buffer = 8,
- CapabilityFloat16 = 9,
- CapabilityFloat64 = 10,
- CapabilityInt64 = 11,
- CapabilityInt64Atomics = 12,
- CapabilityImageBasic = 13,
- CapabilityImageReadWrite = 14,
- CapabilityImageMipmap = 15,
- CapabilityPipes = 17,
- CapabilityGroups = 18,
- CapabilityDeviceEnqueue = 19,
- CapabilityLiteralSampler = 20,
- CapabilityAtomicStorage = 21,
- CapabilityInt16 = 22,
- CapabilityTessellationPointSize = 23,
- CapabilityGeometryPointSize = 24,
- CapabilityImageGatherExtended = 25,
- CapabilityStorageImageMultisample = 27,
- CapabilityUniformBufferArrayDynamicIndexing = 28,
- CapabilitySampledImageArrayDynamicIndexing = 29,
- CapabilityStorageBufferArrayDynamicIndexing = 30,
- CapabilityStorageImageArrayDynamicIndexing = 31,
- CapabilityClipDistance = 32,
- CapabilityCullDistance = 33,
- CapabilityImageCubeArray = 34,
- CapabilitySampleRateShading = 35,
- CapabilityImageRect = 36,
- CapabilitySampledRect = 37,
- CapabilityGenericPointer = 38,
- CapabilityInt8 = 39,
- CapabilityInputAttachment = 40,
- CapabilitySparseResidency = 41,
- CapabilityMinLod = 42,
- CapabilitySampled1D = 43,
- CapabilityImage1D = 44,
- CapabilitySampledCubeArray = 45,
- CapabilitySampledBuffer = 46,
- CapabilityImageBuffer = 47,
- CapabilityImageMSArray = 48,
- CapabilityStorageImageExtendedFormats = 49,
- CapabilityImageQuery = 50,
- CapabilityDerivativeControl = 51,
- CapabilityInterpolationFunction = 52,
- CapabilityTransformFeedback = 53,
- CapabilityGeometryStreams = 54,
- CapabilityStorageImageReadWithoutFormat = 55,
- CapabilityStorageImageWriteWithoutFormat = 56,
- CapabilityMultiViewport = 57,
- CapabilitySubgroupDispatch = 58,
- CapabilityNamedBarrier = 59,
- CapabilityPipeStorage = 60,
- CapabilityGroupNonUniform = 61,
- CapabilityGroupNonUniformVote = 62,
- CapabilityGroupNonUniformArithmetic = 63,
- CapabilityGroupNonUniformBallot = 64,
- CapabilityGroupNonUniformShuffle = 65,
- CapabilityGroupNonUniformShuffleRelative = 66,
- CapabilityGroupNonUniformClustered = 67,
- CapabilityGroupNonUniformQuad = 68,
- CapabilityShaderLayer = 69,
- CapabilityShaderViewportIndex = 70,
- CapabilityFragmentShadingRateKHR = 4422,
- CapabilitySubgroupBallotKHR = 4423,
- CapabilityDrawParameters = 4427,
- CapabilityWorkgroupMemoryExplicitLayoutKHR = 4428,
- CapabilityWorkgroupMemoryExplicitLayout8BitAccessKHR = 4429,
- CapabilityWorkgroupMemoryExplicitLayout16BitAccessKHR = 4430,
- CapabilitySubgroupVoteKHR = 4431,
- CapabilityStorageBuffer16BitAccess = 4433,
- CapabilityStorageUniformBufferBlock16 = 4433,
- CapabilityStorageUniform16 = 4434,
- CapabilityUniformAndStorageBuffer16BitAccess = 4434,
- CapabilityStoragePushConstant16 = 4435,
- CapabilityStorageInputOutput16 = 4436,
- CapabilityDeviceGroup = 4437,
- CapabilityMultiView = 4439,
- CapabilityVariablePointersStorageBuffer = 4441,
- CapabilityVariablePointers = 4442,
- CapabilityAtomicStorageOps = 4445,
- CapabilitySampleMaskPostDepthCoverage = 4447,
- CapabilityStorageBuffer8BitAccess = 4448,
- CapabilityUniformAndStorageBuffer8BitAccess = 4449,
- CapabilityStoragePushConstant8 = 4450,
- CapabilityDenormPreserve = 4464,
- CapabilityDenormFlushToZero = 4465,
- CapabilitySignedZeroInfNanPreserve = 4466,
- CapabilityRoundingModeRTE = 4467,
- CapabilityRoundingModeRTZ = 4468,
- CapabilityRayQueryProvisionalKHR = 4471,
- CapabilityRayQueryKHR = 4472,
- CapabilityRayTraversalPrimitiveCullingKHR = 4478,
- CapabilityRayTracingKHR = 4479,
- CapabilityFloat16ImageAMD = 5008,
- CapabilityImageGatherBiasLodAMD = 5009,
- CapabilityFragmentMaskAMD = 5010,
- CapabilityStencilExportEXT = 5013,
- CapabilityImageReadWriteLodAMD = 5015,
- CapabilityInt64ImageEXT = 5016,
- CapabilityShaderClockKHR = 5055,
- CapabilitySampleMaskOverrideCoverageNV = 5249,
- CapabilityGeometryShaderPassthroughNV = 5251,
- CapabilityShaderViewportIndexLayerEXT = 5254,
- CapabilityShaderViewportIndexLayerNV = 5254,
- CapabilityShaderViewportMaskNV = 5255,
- CapabilityShaderStereoViewNV = 5259,
- CapabilityPerViewAttributesNV = 5260,
- CapabilityFragmentFullyCoveredEXT = 5265,
- CapabilityMeshShadingNV = 5266,
- CapabilityImageFootprintNV = 5282,
- CapabilityFragmentBarycentricNV = 5284,
- CapabilityComputeDerivativeGroupQuadsNV = 5288,
- CapabilityFragmentDensityEXT = 5291,
- CapabilityShadingRateNV = 5291,
- CapabilityGroupNonUniformPartitionedNV = 5297,
- CapabilityShaderNonUniform = 5301,
- CapabilityShaderNonUniformEXT = 5301,
- CapabilityRuntimeDescriptorArray = 5302,
- CapabilityRuntimeDescriptorArrayEXT = 5302,
- CapabilityInputAttachmentArrayDynamicIndexing = 5303,
- CapabilityInputAttachmentArrayDynamicIndexingEXT = 5303,
- CapabilityUniformTexelBufferArrayDynamicIndexing = 5304,
- CapabilityUniformTexelBufferArrayDynamicIndexingEXT = 5304,
- CapabilityStorageTexelBufferArrayDynamicIndexing = 5305,
- CapabilityStorageTexelBufferArrayDynamicIndexingEXT = 5305,
- CapabilityUniformBufferArrayNonUniformIndexing = 5306,
- CapabilityUniformBufferArrayNonUniformIndexingEXT = 5306,
- CapabilitySampledImageArrayNonUniformIndexing = 5307,
- CapabilitySampledImageArrayNonUniformIndexingEXT = 5307,
- CapabilityStorageBufferArrayNonUniformIndexing = 5308,
- CapabilityStorageBufferArrayNonUniformIndexingEXT = 5308,
- CapabilityStorageImageArrayNonUniformIndexing = 5309,
- CapabilityStorageImageArrayNonUniformIndexingEXT = 5309,
- CapabilityInputAttachmentArrayNonUniformIndexing = 5310,
- CapabilityInputAttachmentArrayNonUniformIndexingEXT = 5310,
- CapabilityUniformTexelBufferArrayNonUniformIndexing = 5311,
- CapabilityUniformTexelBufferArrayNonUniformIndexingEXT = 5311,
- CapabilityStorageTexelBufferArrayNonUniformIndexing = 5312,
- CapabilityStorageTexelBufferArrayNonUniformIndexingEXT = 5312,
- CapabilityRayTracingNV = 5340,
- CapabilityRayTracingMotionBlurNV = 5341,
- CapabilityVulkanMemoryModel = 5345,
- CapabilityVulkanMemoryModelKHR = 5345,
- CapabilityVulkanMemoryModelDeviceScope = 5346,
- CapabilityVulkanMemoryModelDeviceScopeKHR = 5346,
- CapabilityPhysicalStorageBufferAddresses = 5347,
- CapabilityPhysicalStorageBufferAddressesEXT = 5347,
- CapabilityComputeDerivativeGroupLinearNV = 5350,
- CapabilityRayTracingProvisionalKHR = 5353,
- CapabilityCooperativeMatrixNV = 5357,
- CapabilityFragmentShaderSampleInterlockEXT = 5363,
- CapabilityFragmentShaderShadingRateInterlockEXT = 5372,
- CapabilityShaderSMBuiltinsNV = 5373,
- CapabilityFragmentShaderPixelInterlockEXT = 5378,
- CapabilityDemoteToHelperInvocationEXT = 5379,
- CapabilitySubgroupShuffleINTEL = 5568,
- CapabilitySubgroupBufferBlockIOINTEL = 5569,
- CapabilitySubgroupImageBlockIOINTEL = 5570,
- CapabilitySubgroupImageMediaBlockIOINTEL = 5579,
- CapabilityRoundToInfinityINTEL = 5582,
- CapabilityFloatingPointModeINTEL = 5583,
- CapabilityIntegerFunctions2INTEL = 5584,
- CapabilityFunctionPointersINTEL = 5603,
- CapabilityIndirectReferencesINTEL = 5604,
- CapabilityAsmINTEL = 5606,
- CapabilityAtomicFloat32MinMaxEXT = 5612,
- CapabilityAtomicFloat64MinMaxEXT = 5613,
- CapabilityAtomicFloat16MinMaxEXT = 5616,
- CapabilityVectorComputeINTEL = 5617,
- CapabilityVectorAnyINTEL = 5619,
- CapabilityExpectAssumeKHR = 5629,
- CapabilitySubgroupAvcMotionEstimationINTEL = 5696,
- CapabilitySubgroupAvcMotionEstimationIntraINTEL = 5697,
- CapabilitySubgroupAvcMotionEstimationChromaINTEL = 5698,
- CapabilityVariableLengthArrayINTEL = 5817,
- CapabilityFunctionFloatControlINTEL = 5821,
- CapabilityFPGAMemoryAttributesINTEL = 5824,
- CapabilityFPFastMathModeINTEL = 5837,
- CapabilityArbitraryPrecisionIntegersINTEL = 5844,
- CapabilityArbitraryPrecisionFloatingPointINTEL = 5845,
- CapabilityUnstructuredLoopControlsINTEL = 5886,
- CapabilityFPGALoopControlsINTEL = 5888,
- CapabilityKernelAttributesINTEL = 5892,
- CapabilityFPGAKernelAttributesINTEL = 5897,
- CapabilityFPGAMemoryAccessesINTEL = 5898,
- CapabilityFPGAClusterAttributesINTEL = 5904,
- CapabilityLoopFuseINTEL = 5906,
- CapabilityFPGABufferLocationINTEL = 5920,
- CapabilityArbitraryPrecisionFixedPointINTEL = 5922,
- CapabilityUSMStorageClassesINTEL = 5935,
- CapabilityIOPipesINTEL = 5943,
- CapabilityBlockingPipesINTEL = 5945,
- CapabilityFPGARegINTEL = 5948,
- CapabilityDotProductInputAllKHR = 6016,
- CapabilityDotProductInput4x8BitKHR = 6017,
- CapabilityDotProductInput4x8BitPackedKHR = 6018,
- CapabilityDotProductKHR = 6019,
- CapabilityBitInstructions = 6025,
- CapabilityAtomicFloat32AddEXT = 6033,
- CapabilityAtomicFloat64AddEXT = 6034,
- CapabilityLongConstantCompositeINTEL = 6089,
- CapabilityOptNoneINTEL = 6094,
- CapabilityAtomicFloat16AddEXT = 6095,
- CapabilityDebugInfoModuleINTEL = 6114,
- CapabilityMax = 0x7fffffff,
-};
-
-enum RayFlagsShift {
- RayFlagsOpaqueKHRShift = 0,
- RayFlagsNoOpaqueKHRShift = 1,
- RayFlagsTerminateOnFirstHitKHRShift = 2,
- RayFlagsSkipClosestHitShaderKHRShift = 3,
- RayFlagsCullBackFacingTrianglesKHRShift = 4,
- RayFlagsCullFrontFacingTrianglesKHRShift = 5,
- RayFlagsCullOpaqueKHRShift = 6,
- RayFlagsCullNoOpaqueKHRShift = 7,
- RayFlagsSkipTrianglesKHRShift = 8,
- RayFlagsSkipAABBsKHRShift = 9,
- RayFlagsMax = 0x7fffffff,
-};
-
-enum RayFlagsMask {
- RayFlagsMaskNone = 0,
- RayFlagsOpaqueKHRMask = 0x00000001,
- RayFlagsNoOpaqueKHRMask = 0x00000002,
- RayFlagsTerminateOnFirstHitKHRMask = 0x00000004,
- RayFlagsSkipClosestHitShaderKHRMask = 0x00000008,
- RayFlagsCullBackFacingTrianglesKHRMask = 0x00000010,
- RayFlagsCullFrontFacingTrianglesKHRMask = 0x00000020,
- RayFlagsCullOpaqueKHRMask = 0x00000040,
- RayFlagsCullNoOpaqueKHRMask = 0x00000080,
- RayFlagsSkipTrianglesKHRMask = 0x00000100,
- RayFlagsSkipAABBsKHRMask = 0x00000200,
-};
-
-enum RayQueryIntersection {
- RayQueryIntersectionRayQueryCandidateIntersectionKHR = 0,
- RayQueryIntersectionRayQueryCommittedIntersectionKHR = 1,
- RayQueryIntersectionMax = 0x7fffffff,
-};
-
-enum RayQueryCommittedIntersectionType {
- RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionNoneKHR = 0,
- RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionTriangleKHR = 1,
- RayQueryCommittedIntersectionTypeRayQueryCommittedIntersectionGeneratedKHR = 2,
- RayQueryCommittedIntersectionTypeMax = 0x7fffffff,
-};
-
-enum RayQueryCandidateIntersectionType {
- RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionTriangleKHR = 0,
- RayQueryCandidateIntersectionTypeRayQueryCandidateIntersectionAABBKHR = 1,
- RayQueryCandidateIntersectionTypeMax = 0x7fffffff,
-};
-
-enum FragmentShadingRateShift {
- FragmentShadingRateVertical2PixelsShift = 0,
- FragmentShadingRateVertical4PixelsShift = 1,
- FragmentShadingRateHorizontal2PixelsShift = 2,
- FragmentShadingRateHorizontal4PixelsShift = 3,
- FragmentShadingRateMax = 0x7fffffff,
-};
-
-enum FragmentShadingRateMask {
- FragmentShadingRateMaskNone = 0,
- FragmentShadingRateVertical2PixelsMask = 0x00000001,
- FragmentShadingRateVertical4PixelsMask = 0x00000002,
- FragmentShadingRateHorizontal2PixelsMask = 0x00000004,
- FragmentShadingRateHorizontal4PixelsMask = 0x00000008,
-};
-
-enum FPDenormMode {
- FPDenormModePreserve = 0,
- FPDenormModeFlushToZero = 1,
- FPDenormModeMax = 0x7fffffff,
-};
-
-enum FPOperationMode {
- FPOperationModeIEEE = 0,
- FPOperationModeALT = 1,
- FPOperationModeMax = 0x7fffffff,
-};
-
-enum QuantizationModes {
- QuantizationModesTRN = 0,
- QuantizationModesTRN_ZERO = 1,
- QuantizationModesRND = 2,
- QuantizationModesRND_ZERO = 3,
- QuantizationModesRND_INF = 4,
- QuantizationModesRND_MIN_INF = 5,
- QuantizationModesRND_CONV = 6,
- QuantizationModesRND_CONV_ODD = 7,
- QuantizationModesMax = 0x7fffffff,
-};
-
-enum OverflowModes {
- OverflowModesWRAP = 0,
- OverflowModesSAT = 1,
- OverflowModesSAT_ZERO = 2,
- OverflowModesSAT_SYM = 3,
- OverflowModesMax = 0x7fffffff,
-};
-
-enum PackedVectorFormat {
- PackedVectorFormatPackedVectorFormat4x8BitKHR = 0,
- PackedVectorFormatMax = 0x7fffffff,
-};
-
-enum Op {
- 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,
- OpSubgroupReadInvocationKHR = 4432,
- OpTraceRayKHR = 4445,
- OpExecuteCallableKHR = 4446,
- OpConvertUToAccelerationStructureKHR = 4447,
- OpIgnoreIntersectionKHR = 4448,
- OpTerminateRayKHR = 4449,
- OpSDotKHR = 4450,
- OpUDotKHR = 4451,
- OpSUDotKHR = 4452,
- OpSDotAccSatKHR = 4453,
- OpUDotAccSatKHR = 4454,
- 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,
- OpImageSampleFootprintNV = 5283,
- 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,
- OpDemoteToHelperInvocationEXT = 5380,
- OpIsHelperInvocationEXT = 5381,
- 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,
- OpConstFunctionPointerINTEL = 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,
- 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,
- OpMax = 0x7fffffff,
-};
-
-#ifdef SPV_ENABLE_UTILITY_CODE
-inline void HasResultAndType(Op opcode, bool *hasResult, bool *hasResultType) {
- *hasResult = *hasResultType = false;
- switch (opcode) {
- default: /* unknown opcode */ break;
- case OpNop: *hasResult = false; *hasResultType = false; break;
- case OpUndef: *hasResult = true; *hasResultType = true; break;
- case OpSourceContinued: *hasResult = false; *hasResultType = false; break;
- case OpSource: *hasResult = false; *hasResultType = false; break;
- case OpSourceExtension: *hasResult = false; *hasResultType = false; break;
- case OpName: *hasResult = false; *hasResultType = false; break;
- case OpMemberName: *hasResult = false; *hasResultType = false; break;
- case OpString: *hasResult = true; *hasResultType = false; break;
- case OpLine: *hasResult = false; *hasResultType = false; break;
- case OpExtension: *hasResult = false; *hasResultType = false; break;
- case OpExtInstImport: *hasResult = true; *hasResultType = false; break;
- case OpExtInst: *hasResult = true; *hasResultType = true; break;
- case OpMemoryModel: *hasResult = false; *hasResultType = false; break;
- case OpEntryPoint: *hasResult = false; *hasResultType = false; break;
- case OpExecutionMode: *hasResult = false; *hasResultType = false; break;
- case OpCapability: *hasResult = false; *hasResultType = false; break;
- case OpTypeVoid: *hasResult = true; *hasResultType = false; break;
- case OpTypeBool: *hasResult = true; *hasResultType = false; break;
- case OpTypeInt: *hasResult = true; *hasResultType = false; break;
- case OpTypeFloat: *hasResult = true; *hasResultType = false; break;
- case OpTypeVector: *hasResult = true; *hasResultType = false; break;
- case OpTypeMatrix: *hasResult = true; *hasResultType = false; break;
- case OpTypeImage: *hasResult = true; *hasResultType = false; break;
- case OpTypeSampler: *hasResult = true; *hasResultType = false; break;
- case OpTypeSampledImage: *hasResult = true; *hasResultType = false; break;
- case OpTypeArray: *hasResult = true; *hasResultType = false; break;
- case OpTypeRuntimeArray: *hasResult = true; *hasResultType = false; break;
- case OpTypeStruct: *hasResult = true; *hasResultType = false; break;
- case OpTypeOpaque: *hasResult = true; *hasResultType = false; break;
- case OpTypePointer: *hasResult = true; *hasResultType = false; break;
- case OpTypeFunction: *hasResult = true; *hasResultType = false; break;
- case OpTypeEvent: *hasResult = true; *hasResultType = false; break;
- case OpTypeDeviceEvent: *hasResult = true; *hasResultType = false; break;
- case OpTypeReserveId: *hasResult = true; *hasResultType = false; break;
- case OpTypeQueue: *hasResult = true; *hasResultType = false; break;
- case OpTypePipe: *hasResult = true; *hasResultType = false; break;
- case OpTypeForwardPointer: *hasResult = false; *hasResultType = false; break;
- case OpConstantTrue: *hasResult = true; *hasResultType = true; break;
- case OpConstantFalse: *hasResult = true; *hasResultType = true; break;
- case OpConstant: *hasResult = true; *hasResultType = true; break;
- case OpConstantComposite: *hasResult = true; *hasResultType = true; break;
- case OpConstantSampler: *hasResult = true; *hasResultType = true; break;
- case OpConstantNull: *hasResult = true; *hasResultType = true; break;
- case OpSpecConstantTrue: *hasResult = true; *hasResultType = true; break;
- case OpSpecConstantFalse: *hasResult = true; *hasResultType = true; break;
- case OpSpecConstant: *hasResult = true; *hasResultType = true; break;
- case OpSpecConstantComposite: *hasResult = true; *hasResultType = true; break;
- case OpSpecConstantOp: *hasResult = true; *hasResultType = true; break;
- case OpFunction: *hasResult = true; *hasResultType = true; break;
- case OpFunctionParameter: *hasResult = true; *hasResultType = true; break;
- case OpFunctionEnd: *hasResult = false; *hasResultType = false; break;
- case OpFunctionCall: *hasResult = true; *hasResultType = true; break;
- case OpVariable: *hasResult = true; *hasResultType = true; break;
- case OpImageTexelPointer: *hasResult = true; *hasResultType = true; break;
- case OpLoad: *hasResult = true; *hasResultType = true; break;
- case OpStore: *hasResult = false; *hasResultType = false; break;
- case OpCopyMemory: *hasResult = false; *hasResultType = false; break;
- case OpCopyMemorySized: *hasResult = false; *hasResultType = false; break;
- case OpAccessChain: *hasResult = true; *hasResultType = true; break;
- case OpInBoundsAccessChain: *hasResult = true; *hasResultType = true; break;
- case OpPtrAccessChain: *hasResult = true; *hasResultType = true; break;
- case OpArrayLength: *hasResult = true; *hasResultType = true; break;
- case OpGenericPtrMemSemantics: *hasResult = true; *hasResultType = true; break;
- case OpInBoundsPtrAccessChain: *hasResult = true; *hasResultType = true; break;
- case OpDecorate: *hasResult = false; *hasResultType = false; break;
- case OpMemberDecorate: *hasResult = false; *hasResultType = false; break;
- case OpDecorationGroup: *hasResult = true; *hasResultType = false; break;
- case OpGroupDecorate: *hasResult = false; *hasResultType = false; break;
- case OpGroupMemberDecorate: *hasResult = false; *hasResultType = false; break;
- case OpVectorExtractDynamic: *hasResult = true; *hasResultType = true; break;
- case OpVectorInsertDynamic: *hasResult = true; *hasResultType = true; break;
- case OpVectorShuffle: *hasResult = true; *hasResultType = true; break;
- case OpCompositeConstruct: *hasResult = true; *hasResultType = true; break;
- case OpCompositeExtract: *hasResult = true; *hasResultType = true; break;
- case OpCompositeInsert: *hasResult = true; *hasResultType = true; break;
- case OpCopyObject: *hasResult = true; *hasResultType = true; break;
- case OpTranspose: *hasResult = true; *hasResultType = true; break;
- case OpSampledImage: *hasResult = true; *hasResultType = true; break;
- case OpImageSampleImplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSampleExplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageFetch: *hasResult = true; *hasResultType = true; break;
- case OpImageGather: *hasResult = true; *hasResultType = true; break;
- case OpImageDrefGather: *hasResult = true; *hasResultType = true; break;
- case OpImageRead: *hasResult = true; *hasResultType = true; break;
- case OpImageWrite: *hasResult = false; *hasResultType = false; break;
- case OpImage: *hasResult = true; *hasResultType = true; break;
- case OpImageQueryFormat: *hasResult = true; *hasResultType = true; break;
- case OpImageQueryOrder: *hasResult = true; *hasResultType = true; break;
- case OpImageQuerySizeLod: *hasResult = true; *hasResultType = true; break;
- case OpImageQuerySize: *hasResult = true; *hasResultType = true; break;
- case OpImageQueryLod: *hasResult = true; *hasResultType = true; break;
- case OpImageQueryLevels: *hasResult = true; *hasResultType = true; break;
- case OpImageQuerySamples: *hasResult = true; *hasResultType = true; break;
- case OpConvertFToU: *hasResult = true; *hasResultType = true; break;
- case OpConvertFToS: *hasResult = true; *hasResultType = true; break;
- case OpConvertSToF: *hasResult = true; *hasResultType = true; break;
- case OpConvertUToF: *hasResult = true; *hasResultType = true; break;
- case OpUConvert: *hasResult = true; *hasResultType = true; break;
- case OpSConvert: *hasResult = true; *hasResultType = true; break;
- case OpFConvert: *hasResult = true; *hasResultType = true; break;
- case OpQuantizeToF16: *hasResult = true; *hasResultType = true; break;
- case OpConvertPtrToU: *hasResult = true; *hasResultType = true; break;
- case OpSatConvertSToU: *hasResult = true; *hasResultType = true; break;
- case OpSatConvertUToS: *hasResult = true; *hasResultType = true; break;
- case OpConvertUToPtr: *hasResult = true; *hasResultType = true; break;
- case OpPtrCastToGeneric: *hasResult = true; *hasResultType = true; break;
- case OpGenericCastToPtr: *hasResult = true; *hasResultType = true; break;
- case OpGenericCastToPtrExplicit: *hasResult = true; *hasResultType = true; break;
- case OpBitcast: *hasResult = true; *hasResultType = true; break;
- case OpSNegate: *hasResult = true; *hasResultType = true; break;
- case OpFNegate: *hasResult = true; *hasResultType = true; break;
- case OpIAdd: *hasResult = true; *hasResultType = true; break;
- case OpFAdd: *hasResult = true; *hasResultType = true; break;
- case OpISub: *hasResult = true; *hasResultType = true; break;
- case OpFSub: *hasResult = true; *hasResultType = true; break;
- case OpIMul: *hasResult = true; *hasResultType = true; break;
- case OpFMul: *hasResult = true; *hasResultType = true; break;
- case OpUDiv: *hasResult = true; *hasResultType = true; break;
- case OpSDiv: *hasResult = true; *hasResultType = true; break;
- case OpFDiv: *hasResult = true; *hasResultType = true; break;
- case OpUMod: *hasResult = true; *hasResultType = true; break;
- case OpSRem: *hasResult = true; *hasResultType = true; break;
- case OpSMod: *hasResult = true; *hasResultType = true; break;
- case OpFRem: *hasResult = true; *hasResultType = true; break;
- case OpFMod: *hasResult = true; *hasResultType = true; break;
- case OpVectorTimesScalar: *hasResult = true; *hasResultType = true; break;
- case OpMatrixTimesScalar: *hasResult = true; *hasResultType = true; break;
- case OpVectorTimesMatrix: *hasResult = true; *hasResultType = true; break;
- case OpMatrixTimesVector: *hasResult = true; *hasResultType = true; break;
- case OpMatrixTimesMatrix: *hasResult = true; *hasResultType = true; break;
- case OpOuterProduct: *hasResult = true; *hasResultType = true; break;
- case OpDot: *hasResult = true; *hasResultType = true; break;
- case OpIAddCarry: *hasResult = true; *hasResultType = true; break;
- case OpISubBorrow: *hasResult = true; *hasResultType = true; break;
- case OpUMulExtended: *hasResult = true; *hasResultType = true; break;
- case OpSMulExtended: *hasResult = true; *hasResultType = true; break;
- case OpAny: *hasResult = true; *hasResultType = true; break;
- case OpAll: *hasResult = true; *hasResultType = true; break;
- case OpIsNan: *hasResult = true; *hasResultType = true; break;
- case OpIsInf: *hasResult = true; *hasResultType = true; break;
- case OpIsFinite: *hasResult = true; *hasResultType = true; break;
- case OpIsNormal: *hasResult = true; *hasResultType = true; break;
- case OpSignBitSet: *hasResult = true; *hasResultType = true; break;
- case OpLessOrGreater: *hasResult = true; *hasResultType = true; break;
- case OpOrdered: *hasResult = true; *hasResultType = true; break;
- case OpUnordered: *hasResult = true; *hasResultType = true; break;
- case OpLogicalEqual: *hasResult = true; *hasResultType = true; break;
- case OpLogicalNotEqual: *hasResult = true; *hasResultType = true; break;
- case OpLogicalOr: *hasResult = true; *hasResultType = true; break;
- case OpLogicalAnd: *hasResult = true; *hasResultType = true; break;
- case OpLogicalNot: *hasResult = true; *hasResultType = true; break;
- case OpSelect: *hasResult = true; *hasResultType = true; break;
- case OpIEqual: *hasResult = true; *hasResultType = true; break;
- case OpINotEqual: *hasResult = true; *hasResultType = true; break;
- case OpUGreaterThan: *hasResult = true; *hasResultType = true; break;
- case OpSGreaterThan: *hasResult = true; *hasResultType = true; break;
- case OpUGreaterThanEqual: *hasResult = true; *hasResultType = true; break;
- case OpSGreaterThanEqual: *hasResult = true; *hasResultType = true; break;
- case OpULessThan: *hasResult = true; *hasResultType = true; break;
- case OpSLessThan: *hasResult = true; *hasResultType = true; break;
- case OpULessThanEqual: *hasResult = true; *hasResultType = true; break;
- case OpSLessThanEqual: *hasResult = true; *hasResultType = true; break;
- case OpFOrdEqual: *hasResult = true; *hasResultType = true; break;
- case OpFUnordEqual: *hasResult = true; *hasResultType = true; break;
- case OpFOrdNotEqual: *hasResult = true; *hasResultType = true; break;
- case OpFUnordNotEqual: *hasResult = true; *hasResultType = true; break;
- case OpFOrdLessThan: *hasResult = true; *hasResultType = true; break;
- case OpFUnordLessThan: *hasResult = true; *hasResultType = true; break;
- case OpFOrdGreaterThan: *hasResult = true; *hasResultType = true; break;
- case OpFUnordGreaterThan: *hasResult = true; *hasResultType = true; break;
- case OpFOrdLessThanEqual: *hasResult = true; *hasResultType = true; break;
- case OpFUnordLessThanEqual: *hasResult = true; *hasResultType = true; break;
- case OpFOrdGreaterThanEqual: *hasResult = true; *hasResultType = true; break;
- case OpFUnordGreaterThanEqual: *hasResult = true; *hasResultType = true; break;
- case OpShiftRightLogical: *hasResult = true; *hasResultType = true; break;
- case OpShiftRightArithmetic: *hasResult = true; *hasResultType = true; break;
- case OpShiftLeftLogical: *hasResult = true; *hasResultType = true; break;
- case OpBitwiseOr: *hasResult = true; *hasResultType = true; break;
- case OpBitwiseXor: *hasResult = true; *hasResultType = true; break;
- case OpBitwiseAnd: *hasResult = true; *hasResultType = true; break;
- case OpNot: *hasResult = true; *hasResultType = true; break;
- case OpBitFieldInsert: *hasResult = true; *hasResultType = true; break;
- case OpBitFieldSExtract: *hasResult = true; *hasResultType = true; break;
- case OpBitFieldUExtract: *hasResult = true; *hasResultType = true; break;
- case OpBitReverse: *hasResult = true; *hasResultType = true; break;
- case OpBitCount: *hasResult = true; *hasResultType = true; break;
- case OpDPdx: *hasResult = true; *hasResultType = true; break;
- case OpDPdy: *hasResult = true; *hasResultType = true; break;
- case OpFwidth: *hasResult = true; *hasResultType = true; break;
- case OpDPdxFine: *hasResult = true; *hasResultType = true; break;
- case OpDPdyFine: *hasResult = true; *hasResultType = true; break;
- case OpFwidthFine: *hasResult = true; *hasResultType = true; break;
- case OpDPdxCoarse: *hasResult = true; *hasResultType = true; break;
- case OpDPdyCoarse: *hasResult = true; *hasResultType = true; break;
- case OpFwidthCoarse: *hasResult = true; *hasResultType = true; break;
- case OpEmitVertex: *hasResult = false; *hasResultType = false; break;
- case OpEndPrimitive: *hasResult = false; *hasResultType = false; break;
- case OpEmitStreamVertex: *hasResult = false; *hasResultType = false; break;
- case OpEndStreamPrimitive: *hasResult = false; *hasResultType = false; break;
- case OpControlBarrier: *hasResult = false; *hasResultType = false; break;
- case OpMemoryBarrier: *hasResult = false; *hasResultType = false; break;
- case OpAtomicLoad: *hasResult = true; *hasResultType = true; break;
- case OpAtomicStore: *hasResult = false; *hasResultType = false; break;
- case OpAtomicExchange: *hasResult = true; *hasResultType = true; break;
- case OpAtomicCompareExchange: *hasResult = true; *hasResultType = true; break;
- case OpAtomicCompareExchangeWeak: *hasResult = true; *hasResultType = true; break;
- case OpAtomicIIncrement: *hasResult = true; *hasResultType = true; break;
- case OpAtomicIDecrement: *hasResult = true; *hasResultType = true; break;
- case OpAtomicIAdd: *hasResult = true; *hasResultType = true; break;
- case OpAtomicISub: *hasResult = true; *hasResultType = true; break;
- case OpAtomicSMin: *hasResult = true; *hasResultType = true; break;
- case OpAtomicUMin: *hasResult = true; *hasResultType = true; break;
- case OpAtomicSMax: *hasResult = true; *hasResultType = true; break;
- case OpAtomicUMax: *hasResult = true; *hasResultType = true; break;
- case OpAtomicAnd: *hasResult = true; *hasResultType = true; break;
- case OpAtomicOr: *hasResult = true; *hasResultType = true; break;
- case OpAtomicXor: *hasResult = true; *hasResultType = true; break;
- case OpPhi: *hasResult = true; *hasResultType = true; break;
- case OpLoopMerge: *hasResult = false; *hasResultType = false; break;
- case OpSelectionMerge: *hasResult = false; *hasResultType = false; break;
- case OpLabel: *hasResult = true; *hasResultType = false; break;
- case OpBranch: *hasResult = false; *hasResultType = false; break;
- case OpBranchConditional: *hasResult = false; *hasResultType = false; break;
- case OpSwitch: *hasResult = false; *hasResultType = false; break;
- case OpKill: *hasResult = false; *hasResultType = false; break;
- case OpReturn: *hasResult = false; *hasResultType = false; break;
- case OpReturnValue: *hasResult = false; *hasResultType = false; break;
- case OpUnreachable: *hasResult = false; *hasResultType = false; break;
- case OpLifetimeStart: *hasResult = false; *hasResultType = false; break;
- case OpLifetimeStop: *hasResult = false; *hasResultType = false; break;
- case OpGroupAsyncCopy: *hasResult = true; *hasResultType = true; break;
- case OpGroupWaitEvents: *hasResult = false; *hasResultType = false; break;
- case OpGroupAll: *hasResult = true; *hasResultType = true; break;
- case OpGroupAny: *hasResult = true; *hasResultType = true; break;
- case OpGroupBroadcast: *hasResult = true; *hasResultType = true; break;
- case OpGroupIAdd: *hasResult = true; *hasResultType = true; break;
- case OpGroupFAdd: *hasResult = true; *hasResultType = true; break;
- case OpGroupFMin: *hasResult = true; *hasResultType = true; break;
- case OpGroupUMin: *hasResult = true; *hasResultType = true; break;
- case OpGroupSMin: *hasResult = true; *hasResultType = true; break;
- case OpGroupFMax: *hasResult = true; *hasResultType = true; break;
- case OpGroupUMax: *hasResult = true; *hasResultType = true; break;
- case OpGroupSMax: *hasResult = true; *hasResultType = true; break;
- case OpReadPipe: *hasResult = true; *hasResultType = true; break;
- case OpWritePipe: *hasResult = true; *hasResultType = true; break;
- case OpReservedReadPipe: *hasResult = true; *hasResultType = true; break;
- case OpReservedWritePipe: *hasResult = true; *hasResultType = true; break;
- case OpReserveReadPipePackets: *hasResult = true; *hasResultType = true; break;
- case OpReserveWritePipePackets: *hasResult = true; *hasResultType = true; break;
- case OpCommitReadPipe: *hasResult = false; *hasResultType = false; break;
- case OpCommitWritePipe: *hasResult = false; *hasResultType = false; break;
- case OpIsValidReserveId: *hasResult = true; *hasResultType = true; break;
- case OpGetNumPipePackets: *hasResult = true; *hasResultType = true; break;
- case OpGetMaxPipePackets: *hasResult = true; *hasResultType = true; break;
- case OpGroupReserveReadPipePackets: *hasResult = true; *hasResultType = true; break;
- case OpGroupReserveWritePipePackets: *hasResult = true; *hasResultType = true; break;
- case OpGroupCommitReadPipe: *hasResult = false; *hasResultType = false; break;
- case OpGroupCommitWritePipe: *hasResult = false; *hasResultType = false; break;
- case OpEnqueueMarker: *hasResult = true; *hasResultType = true; break;
- case OpEnqueueKernel: *hasResult = true; *hasResultType = true; break;
- case OpGetKernelNDrangeSubGroupCount: *hasResult = true; *hasResultType = true; break;
- case OpGetKernelNDrangeMaxSubGroupSize: *hasResult = true; *hasResultType = true; break;
- case OpGetKernelWorkGroupSize: *hasResult = true; *hasResultType = true; break;
- case OpGetKernelPreferredWorkGroupSizeMultiple: *hasResult = true; *hasResultType = true; break;
- case OpRetainEvent: *hasResult = false; *hasResultType = false; break;
- case OpReleaseEvent: *hasResult = false; *hasResultType = false; break;
- case OpCreateUserEvent: *hasResult = true; *hasResultType = true; break;
- case OpIsValidEvent: *hasResult = true; *hasResultType = true; break;
- case OpSetUserEventStatus: *hasResult = false; *hasResultType = false; break;
- case OpCaptureEventProfilingInfo: *hasResult = false; *hasResultType = false; break;
- case OpGetDefaultQueue: *hasResult = true; *hasResultType = true; break;
- case OpBuildNDRange: *hasResult = true; *hasResultType = true; break;
- case OpImageSparseSampleImplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSparseSampleExplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSparseSampleDrefImplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSparseSampleDrefExplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSparseSampleProjImplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSparseSampleProjExplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSparseSampleProjDrefImplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSparseSampleProjDrefExplicitLod: *hasResult = true; *hasResultType = true; break;
- case OpImageSparseFetch: *hasResult = true; *hasResultType = true; break;
- case OpImageSparseGather: *hasResult = true; *hasResultType = true; break;
- case OpImageSparseDrefGather: *hasResult = true; *hasResultType = true; break;
- case OpImageSparseTexelsResident: *hasResult = true; *hasResultType = true; break;
- case OpNoLine: *hasResult = false; *hasResultType = false; break;
- case OpAtomicFlagTestAndSet: *hasResult = true; *hasResultType = true; break;
- case OpAtomicFlagClear: *hasResult = false; *hasResultType = false; break;
- case OpImageSparseRead: *hasResult = true; *hasResultType = true; break;
- case OpSizeOf: *hasResult = true; *hasResultType = true; break;
- case OpTypePipeStorage: *hasResult = true; *hasResultType = false; break;
- case OpConstantPipeStorage: *hasResult = true; *hasResultType = true; break;
- case OpCreatePipeFromPipeStorage: *hasResult = true; *hasResultType = true; break;
- case OpGetKernelLocalSizeForSubgroupCount: *hasResult = true; *hasResultType = true; break;
- case OpGetKernelMaxNumSubgroups: *hasResult = true; *hasResultType = true; break;
- case OpTypeNamedBarrier: *hasResult = true; *hasResultType = false; break;
- case OpNamedBarrierInitialize: *hasResult = true; *hasResultType = true; break;
- case OpMemoryNamedBarrier: *hasResult = false; *hasResultType = false; break;
- case OpModuleProcessed: *hasResult = false; *hasResultType = false; break;
- case OpExecutionModeId: *hasResult = false; *hasResultType = false; break;
- case OpDecorateId: *hasResult = false; *hasResultType = false; break;
- case OpGroupNonUniformElect: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformAll: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformAny: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformAllEqual: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformBroadcast: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformBroadcastFirst: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformBallot: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformInverseBallot: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformBallotBitExtract: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformBallotBitCount: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformBallotFindLSB: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformBallotFindMSB: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformShuffle: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformShuffleXor: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformShuffleUp: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformShuffleDown: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformIAdd: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformFAdd: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformIMul: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformFMul: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformSMin: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformUMin: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformFMin: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformSMax: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformUMax: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformFMax: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformBitwiseAnd: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformBitwiseOr: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformBitwiseXor: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformLogicalAnd: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformLogicalOr: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformLogicalXor: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformQuadBroadcast: *hasResult = true; *hasResultType = true; break;
- case OpGroupNonUniformQuadSwap: *hasResult = true; *hasResultType = true; break;
- case OpCopyLogical: *hasResult = true; *hasResultType = true; break;
- case OpPtrEqual: *hasResult = true; *hasResultType = true; break;
- case OpPtrNotEqual: *hasResult = true; *hasResultType = true; break;
- case OpPtrDiff: *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 OpSubgroupReadInvocationKHR: *hasResult = true; *hasResultType = true; break;
- case OpTraceRayKHR: *hasResult = false; *hasResultType = false; break;
- case OpExecuteCallableKHR: *hasResult = false; *hasResultType = false; break;
- case OpConvertUToAccelerationStructureKHR: *hasResult = true; *hasResultType = true; break;
- case OpIgnoreIntersectionKHR: *hasResult = false; *hasResultType = false; break;
- case OpTerminateRayKHR: *hasResult = false; *hasResultType = false; break;
- case OpSDotKHR: *hasResult = true; *hasResultType = true; break;
- case OpUDotKHR: *hasResult = true; *hasResultType = true; break;
- case OpSUDotKHR: *hasResult = true; *hasResultType = true; break;
- case OpSDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
- case OpUDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
- case OpSUDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
- case OpTypeRayQueryKHR: *hasResult = true; *hasResultType = false; break;
- case OpRayQueryInitializeKHR: *hasResult = false; *hasResultType = false; break;
- case OpRayQueryTerminateKHR: *hasResult = false; *hasResultType = false; break;
- case OpRayQueryGenerateIntersectionKHR: *hasResult = false; *hasResultType = false; break;
- case OpRayQueryConfirmIntersectionKHR: *hasResult = false; *hasResultType = false; break;
- case OpRayQueryProceedKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionTypeKHR: *hasResult = true; *hasResultType = true; break;
- case OpGroupIAddNonUniformAMD: *hasResult = true; *hasResultType = true; break;
- case OpGroupFAddNonUniformAMD: *hasResult = true; *hasResultType = true; break;
- case OpGroupFMinNonUniformAMD: *hasResult = true; *hasResultType = true; break;
- case OpGroupUMinNonUniformAMD: *hasResult = true; *hasResultType = true; break;
- case OpGroupSMinNonUniformAMD: *hasResult = true; *hasResultType = true; break;
- case OpGroupFMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break;
- case OpGroupUMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break;
- case OpGroupSMaxNonUniformAMD: *hasResult = true; *hasResultType = true; break;
- case OpFragmentMaskFetchAMD: *hasResult = true; *hasResultType = true; break;
- case OpFragmentFetchAMD: *hasResult = true; *hasResultType = true; break;
- case OpReadClockKHR: *hasResult = true; *hasResultType = true; break;
- case OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; 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;
- case OpTerminateRayNV: *hasResult = false; *hasResultType = false; break;
- case OpTraceNV: *hasResult = false; *hasResultType = false; break;
- case OpTraceMotionNV: *hasResult = false; *hasResultType = false; break;
- case OpTraceRayMotionNV: *hasResult = false; *hasResultType = false; break;
- case OpTypeAccelerationStructureNV: *hasResult = true; *hasResultType = false; break;
- case OpExecuteCallableNV: *hasResult = false; *hasResultType = false; break;
- case OpTypeCooperativeMatrixNV: *hasResult = true; *hasResultType = false; break;
- case OpCooperativeMatrixLoadNV: *hasResult = true; *hasResultType = true; break;
- case OpCooperativeMatrixStoreNV: *hasResult = false; *hasResultType = false; break;
- case OpCooperativeMatrixMulAddNV: *hasResult = true; *hasResultType = true; break;
- case OpCooperativeMatrixLengthNV: *hasResult = true; *hasResultType = true; break;
- case OpBeginInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
- case OpEndInvocationInterlockEXT: *hasResult = false; *hasResultType = false; break;
- case OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
- case OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupShuffleINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupShuffleDownINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupShuffleUpINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupShuffleXorINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupBlockReadINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupBlockWriteINTEL: *hasResult = false; *hasResultType = false; break;
- case OpSubgroupImageBlockReadINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupImageBlockWriteINTEL: *hasResult = false; *hasResultType = false; break;
- case OpSubgroupImageMediaBlockReadINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupImageMediaBlockWriteINTEL: *hasResult = false; *hasResultType = false; break;
- case OpUCountLeadingZerosINTEL: *hasResult = true; *hasResultType = true; break;
- case OpUCountTrailingZerosINTEL: *hasResult = true; *hasResultType = true; break;
- case OpAbsISubINTEL: *hasResult = true; *hasResultType = true; break;
- case OpAbsUSubINTEL: *hasResult = true; *hasResultType = true; break;
- case OpIAddSatINTEL: *hasResult = true; *hasResultType = true; break;
- case OpUAddSatINTEL: *hasResult = true; *hasResultType = true; break;
- case OpIAverageINTEL: *hasResult = true; *hasResultType = true; break;
- case OpUAverageINTEL: *hasResult = true; *hasResultType = true; break;
- case OpIAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break;
- case OpUAverageRoundedINTEL: *hasResult = true; *hasResultType = true; break;
- case OpISubSatINTEL: *hasResult = true; *hasResultType = true; break;
- case OpUSubSatINTEL: *hasResult = true; *hasResultType = true; break;
- case OpIMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
- case OpUMul32x16INTEL: *hasResult = true; *hasResultType = true; break;
- case OpConstFunctionPointerINTEL: *hasResult = true; *hasResultType = true; break;
- case OpFunctionPointerCallINTEL: *hasResult = true; *hasResultType = true; break;
- case OpAsmTargetINTEL: *hasResult = true; *hasResultType = true; break;
- case OpAsmINTEL: *hasResult = true; *hasResultType = true; break;
- case OpAsmCallINTEL: *hasResult = true; *hasResultType = true; break;
- case OpAtomicFMinEXT: *hasResult = true; *hasResultType = true; break;
- case OpAtomicFMaxEXT: *hasResult = true; *hasResultType = true; break;
- case OpAssumeTrueKHR: *hasResult = false; *hasResultType = false; break;
- case OpExpectKHR: *hasResult = true; *hasResultType = true; break;
- case OpDecorateString: *hasResult = false; *hasResultType = false; break;
- case OpMemberDecorateString: *hasResult = false; *hasResultType = false; break;
- case OpVmeImageINTEL: *hasResult = true; *hasResultType = true; break;
- case OpTypeVmeImageINTEL: *hasResult = true; *hasResultType = false; break;
- case OpTypeAvcImePayloadINTEL: *hasResult = true; *hasResultType = false; break;
- case OpTypeAvcRefPayloadINTEL: *hasResult = true; *hasResultType = false; break;
- case OpTypeAvcSicPayloadINTEL: *hasResult = true; *hasResultType = false; break;
- case OpTypeAvcMcePayloadINTEL: *hasResult = true; *hasResultType = false; break;
- case OpTypeAvcMceResultINTEL: *hasResult = true; *hasResultType = false; break;
- case OpTypeAvcImeResultINTEL: *hasResult = true; *hasResultType = false; break;
- case OpTypeAvcImeResultSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break;
- case OpTypeAvcImeResultDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = false; break;
- case OpTypeAvcImeSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break;
- case OpTypeAvcImeDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = false; break;
- case OpTypeAvcRefResultINTEL: *hasResult = true; *hasResultType = false; break;
- case OpTypeAvcSicResultINTEL: *hasResult = true; *hasResultType = false; break;
- case OpSubgroupAvcMceGetDefaultInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceSetInterBaseMultiReferencePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetDefaultInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceSetInterShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetDefaultInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceSetInterDirectionPenaltyINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetDefaultIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetDefaultInterMotionVectorCostTableINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetDefaultHighPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetDefaultMediumPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetDefaultLowPenaltyCostTableINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceSetMotionVectorCostFunctionINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetDefaultIntraLumaModePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetDefaultNonDcLumaIntraPenaltyINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetDefaultIntraChromaModeBasePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceSetAcOnlyHaarINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceSetSourceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceSetSingleReferenceInterlacedFieldPolarityINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceSetDualReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceConvertToImePayloadINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceConvertToImeResultINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceConvertToRefPayloadINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceConvertToRefResultINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceConvertToSicPayloadINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceConvertToSicResultINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetBestInterDistortionsINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetInterMajorShapeINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetInterMinorShapeINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetInterDirectionsINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetInterMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetInterReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcMceGetInterReferenceInterlacedFieldPolaritiesINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeInitializeINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeSetSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeSetDualReferenceINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeRefWindowSizeINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeAdjustRefOffsetINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeSetMaxMotionVectorCountINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeSetUnidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeSetEarlySearchTerminationThresholdINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeSetWeightedSadINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeEvaluateWithSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeEvaluateWithDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeEvaluateWithSingleReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeEvaluateWithDualReferenceStreaminoutINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeGetSingleReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeGetDualReferenceStreaminINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeStripSingleReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeStripDualReferenceStreamoutINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeGetStreamoutSingleReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeMotionVectorsINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeDistortionsINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeGetStreamoutDualReferenceMajorShapeReferenceIdsINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeGetBorderReachedINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeGetTruncatedSearchIndicationINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcImeGetWeightingPatternMinimumDistortionINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcFmeInitializeINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcBmeInitializeINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcRefConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcRefSetBidirectionalMixDisableINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcRefSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcRefEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcRefEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcRefEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcRefEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcRefConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicInitializeINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicConfigureSkcINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicConfigureIpeLumaINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicConfigureIpeLumaChromaINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicGetMotionVectorMaskINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicConvertToMcePayloadINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicSetIntraLumaShapePenaltyINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicSetIntraLumaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicSetIntraChromaModeCostFunctionINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicSetBilinearFilterEnableINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicSetSkcForwardTransformEnableINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicSetBlockBasedRawSkipSadINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicEvaluateIpeINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicEvaluateWithSingleReferenceINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicEvaluateWithDualReferenceINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicEvaluateWithMultiReferenceINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicEvaluateWithMultiReferenceInterlacedINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicConvertToMceResultINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicGetIpeLumaShapeINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicGetBestIpeLumaDistortionINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicGetBestIpeChromaDistortionINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicGetPackedIpeLumaModesINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicGetIpeChromaModeINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicGetPackedSkcLumaCountThresholdINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicGetPackedSkcLumaSumThresholdINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSubgroupAvcSicGetInterRawSadsINTEL: *hasResult = true; *hasResultType = true; break;
- case OpVariableLengthArrayINTEL: *hasResult = true; *hasResultType = true; break;
- case OpSaveMemoryINTEL: *hasResult = true; *hasResultType = true; break;
- case OpRestoreMemoryINTEL: *hasResult = false; *hasResultType = false; break;
- case OpArbitraryFloatSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatCastINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatCastFromIntINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatCastToIntINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatAddINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatSubINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatMulINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatDivINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatGTINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatGEINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatLTINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatLEINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatEQINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatRecipINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatRSqrtINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatCbrtINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatHypotINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatSqrtINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatLogINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatLog2INTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatLog10INTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatLog1pINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatExpINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatExp2INTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatExp10INTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatExpm1INTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatSinINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatCosINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatSinCosINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatSinPiINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatCosPiINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatASinINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatASinPiINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatACosINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatACosPiINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatATanINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatATanPiINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatATan2INTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatPowINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatPowRINTEL: *hasResult = true; *hasResultType = true; break;
- case OpArbitraryFloatPowNINTEL: *hasResult = true; *hasResultType = true; break;
- case OpLoopControlINTEL: *hasResult = false; *hasResultType = false; break;
- case OpFixedSqrtINTEL: *hasResult = true; *hasResultType = true; break;
- case OpFixedRecipINTEL: *hasResult = true; *hasResultType = true; break;
- case OpFixedRsqrtINTEL: *hasResult = true; *hasResultType = true; break;
- case OpFixedSinINTEL: *hasResult = true; *hasResultType = true; break;
- case OpFixedCosINTEL: *hasResult = true; *hasResultType = true; break;
- case OpFixedSinCosINTEL: *hasResult = true; *hasResultType = true; break;
- case OpFixedSinPiINTEL: *hasResult = true; *hasResultType = true; break;
- case OpFixedCosPiINTEL: *hasResult = true; *hasResultType = true; break;
- case OpFixedSinCosPiINTEL: *hasResult = true; *hasResultType = true; break;
- case OpFixedLogINTEL: *hasResult = true; *hasResultType = true; break;
- case OpFixedExpINTEL: *hasResult = true; *hasResultType = true; break;
- case OpPtrCastToCrossWorkgroupINTEL: *hasResult = true; *hasResultType = true; break;
- case OpCrossWorkgroupCastToPtrINTEL: *hasResult = true; *hasResultType = true; break;
- case OpReadPipeBlockingINTEL: *hasResult = true; *hasResultType = true; break;
- case OpWritePipeBlockingINTEL: *hasResult = true; *hasResultType = true; break;
- case OpFPGARegINTEL: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetRayTMinKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetRayFlagsKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionTKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionInstanceCustomIndexKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionInstanceIdKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionGeometryIndexKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionPrimitiveIndexKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionBarycentricsKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionFrontFaceKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionCandidateAABBOpaqueKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionObjectRayDirectionKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionObjectRayOriginKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetWorldRayDirectionKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetWorldRayOriginKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionObjectToWorldKHR: *hasResult = true; *hasResultType = true; break;
- case OpRayQueryGetIntersectionWorldToObjectKHR: *hasResult = true; *hasResultType = true; break;
- case OpAtomicFAddEXT: *hasResult = true; *hasResultType = true; break;
- case OpTypeBufferSurfaceINTEL: *hasResult = true; *hasResultType = false; break;
- case OpTypeStructContinuedINTEL: *hasResult = false; *hasResultType = false; break;
- case OpConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
- case OpSpecConstantCompositeContinuedINTEL: *hasResult = false; *hasResultType = false; break;
- }
-}
-#endif /* SPV_ENABLE_UTILITY_CODE */
-
-// 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)); }
-inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); }
-inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); }
-
-} // end namespace spv
-
-#endif // #ifndef spirv_HPP
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11 b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11
deleted file mode 100644
index 51e902498a0..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.hpp11
+++ /dev/null
@@ -1,2467 +0,0 @@
-// 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
-//
-// - 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
-//
-// 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 0x10500
-#define SPV_REVISION 4
-
-static const unsigned int MagicNumber = 0x07230203;
-static const unsigned int Version = 0x00010500;
-static const unsigned int Revision = 4;
-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,
- 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,
- 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,
- StencilRefReplacingEXT = 5027,
- OutputLinesNV = 5269,
- OutputPrimitivesNV = 5270,
- DerivativeGroupQuadsNV = 5289,
- DerivativeGroupLinearNV = 5290,
- 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,
- 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,
- 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,
- 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,
-};
-
-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,
- 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,
- PerPrimitiveNV = 5271,
- PerViewNV = 5272,
- PerTaskNV = 5273,
- PerVertexNV = 5285,
- NonUniform = 5300,
- NonUniformEXT = 5300,
- RestrictPointer = 5355,
- RestrictPointerEXT = 5355,
- AliasedPointer = 5356,
- AliasedPointerEXT = 5356,
- 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,
- BufferLocationINTEL = 5921,
- IOPipeStorageINTEL = 5944,
- FunctionFloatingPointModeINTEL = 6080,
- SingleElementVectorINTEL = 6085,
- VectorComputeCallableFunctionINTEL = 6087,
- 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,
- 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,
- BaryCoordNV = 5286,
- BaryCoordNoPerspNV = 5287,
- FragSizeEXT = 5292,
- FragmentSizeNV = 5292,
- FragInvocationCountEXT = 5293,
- InvocationsPerPixelNV = 5293,
- 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,
- 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,
- 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,
-};
-
-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,
- 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,
-};
-
-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,
- 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,
- 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,
- DemoteToHelperInvocationEXT = 5379,
- 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,
- FPGABufferLocationINTEL = 5920,
- ArbitraryPrecisionFixedPointINTEL = 5922,
- USMStorageClassesINTEL = 5935,
- IOPipesINTEL = 5943,
- BlockingPipesINTEL = 5945,
- FPGARegINTEL = 5948,
- DotProductInputAllKHR = 6016,
- DotProductInput4x8BitKHR = 6017,
- DotProductInput4x8BitPackedKHR = 6018,
- DotProductKHR = 6019,
- BitInstructions = 6025,
- AtomicFloat32AddEXT = 6033,
- AtomicFloat64AddEXT = 6034,
- LongConstantCompositeINTEL = 6089,
- OptNoneINTEL = 6094,
- AtomicFloat16AddEXT = 6095,
- DebugInfoModuleINTEL = 6114,
- 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,
- 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,
-};
-
-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 {
- 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,
- OpSubgroupReadInvocationKHR = 4432,
- OpTraceRayKHR = 4445,
- OpExecuteCallableKHR = 4446,
- OpConvertUToAccelerationStructureKHR = 4447,
- OpIgnoreIntersectionKHR = 4448,
- OpTerminateRayKHR = 4449,
- OpSDotKHR = 4450,
- OpUDotKHR = 4451,
- OpSUDotKHR = 4452,
- OpSDotAccSatKHR = 4453,
- OpUDotAccSatKHR = 4454,
- 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,
- OpImageSampleFootprintNV = 5283,
- 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,
- OpDemoteToHelperInvocationEXT = 5380,
- OpIsHelperInvocationEXT = 5381,
- 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,
- OpConstFunctionPointerINTEL = 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,
- 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,
- Max = 0x7fffffff,
-};
-
-#ifdef SPV_ENABLE_UTILITY_CODE
-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::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::OpSDotKHR: *hasResult = true; *hasResultType = true; break;
- case Op::OpUDotKHR: *hasResult = true; *hasResultType = true; break;
- case Op::OpSUDotKHR: *hasResult = true; *hasResultType = true; break;
- case Op::OpSDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
- case Op::OpUDotAccSatKHR: *hasResult = true; *hasResultType = true; break;
- case Op::OpSUDotAccSatKHR: *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::OpImageSampleFootprintNV: *hasResult = true; *hasResultType = true; 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::OpDemoteToHelperInvocationEXT: *hasResult = false; *hasResultType = false; break;
- case Op::OpIsHelperInvocationEXT: *hasResult = true; *hasResultType = true; 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::OpConstFunctionPointerINTEL: *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::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;
- }
-}
-#endif /* SPV_ENABLE_UTILITY_CODE */
-
-// 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)); }
-inline RayFlagsMask operator|(RayFlagsMask a, RayFlagsMask b) { return RayFlagsMask(unsigned(a) | unsigned(b)); }
-inline FragmentShadingRateMask operator|(FragmentShadingRateMask a, FragmentShadingRateMask b) { return FragmentShadingRateMask(unsigned(a) | unsigned(b)); }
-
-} // end namespace spv
-
-#endif // #ifndef spirv_HPP
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.json b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.json
index 017b842b0ac..466f0b0974b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.json
+++ b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.json
@@ -36,7 +36,7 @@
],
[
"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",
@@ -46,6 +46,8 @@
"- 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",
@@ -54,8 +56,8 @@
]
],
"MagicNumber": 119734787,
- "Version": 66816,
- "Revision": 4,
+ "Version": 67072,
+ "Revision": 1,
"OpCodeMask": 65535,
"WordCountShift": 16
},
@@ -72,7 +74,8 @@
"OpenCL_C": 3,
"OpenCL_CPP": 4,
"HLSL": 5,
- "CPP_for_OpenCL": 6
+ "CPP_for_OpenCL": 6,
+ "SYCL": 7
}
},
{
@@ -100,7 +103,9 @@
"MissKHR": 5317,
"MissNV": 5317,
"CallableKHR": 5318,
- "CallableNV": 5318
+ "CallableNV": 5318,
+ "TaskEXT": 5364,
+ "MeshEXT": 5365
}
},
{
@@ -177,11 +182,21 @@
"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,
@@ -198,7 +213,8 @@
"MaxWorkDimINTEL": 5894,
"NoGlobalOffsetINTEL": 5895,
"NumSIMDWorkitemsINTEL": 5896,
- "SchedulerTargetFmaxMhzINTEL": 5903
+ "SchedulerTargetFmaxMhzINTEL": 5903,
+ "NamedBarrierCountINTEL": 6417
}
},
{
@@ -233,6 +249,7 @@
"ShaderRecordBufferNV": 5343,
"PhysicalStorageBuffer": 5349,
"PhysicalStorageBufferEXT": 5349,
+ "TaskPayloadWorkgroupEXT": 5402,
"CodeSectionINTEL": 5605,
"DeviceOnlyINTEL": 5936,
"HostOnlyINTEL": 5937
@@ -395,7 +412,9 @@
"VolatileTexel": 11,
"VolatileTexelKHR": 11,
"SignExtend": 12,
- "ZeroExtend": 13
+ "ZeroExtend": 13,
+ "Nontemporal": 14,
+ "Offsets": 16
}
},
{
@@ -517,9 +536,11 @@
"PassthroughNV": 5250,
"ViewportRelativeNV": 5252,
"SecondaryViewportRelativeNV": 5256,
+ "PerPrimitiveEXT": 5271,
"PerPrimitiveNV": 5271,
"PerViewNV": 5272,
"PerTaskNV": 5273,
+ "PerVertexKHR": 5285,
"PerVertexNV": 5285,
"NonUniform": 5300,
"NonUniformEXT": 5300,
@@ -527,6 +548,10 @@
"RestrictPointerEXT": 5355,
"AliasedPointer": 5356,
"AliasedPointerEXT": 5356,
+ "BindlessSamplerNV": 5398,
+ "BindlessImageNV": 5399,
+ "BoundSamplerNV": 5400,
+ "BoundImageNV": 5401,
"SIMTCallINTEL": 5599,
"ReferencedIndirectlyINTEL": 5602,
"ClobberINTEL": 5607,
@@ -561,11 +586,14 @@
"PrefetchINTEL": 5902,
"StallEnableINTEL": 5905,
"FuseLoopsInFunctionINTEL": 5907,
+ "AliasScopeINTEL": 5914,
+ "NoAliasINTEL": 5915,
"BufferLocationINTEL": 5921,
"IOPipeStorageINTEL": 5944,
"FunctionFloatingPointModeINTEL": 6080,
"SingleElementVectorINTEL": 6085,
- "VectorComputeCallableFunctionINTEL": 6087
+ "VectorComputeCallableFunctionINTEL": 6087,
+ "MediaBlockIOINTEL": 6140
}
},
{
@@ -614,6 +642,11 @@
"SubgroupLocalInvocationId": 41,
"VertexIndex": 42,
"InstanceIndex": 43,
+ "CoreIDARM": 4160,
+ "CoreCountARM": 4161,
+ "CoreMaxIDARM": 4162,
+ "WarpIDARM": 4163,
+ "WarpMaxIDARM": 4164,
"SubgroupEqMask": 4416,
"SubgroupEqMaskKHR": 4416,
"SubgroupGeMask": 4417,
@@ -653,12 +686,18 @@
"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,
@@ -691,7 +730,8 @@
"WarpsPerSMNV": 5374,
"SMCountNV": 5375,
"WarpIDNV": 5376,
- "SMIDNV": 5377
+ "SMIDNV": 5377,
+ "CullMaskKHR": 6021
}
},
{
@@ -776,7 +816,9 @@
"MakePointerVisible": 4,
"MakePointerVisibleKHR": 4,
"NonPrivatePointer": 5,
- "NonPrivatePointerKHR": 5
+ "NonPrivatePointerKHR": 5,
+ "AliasScopeINTELMask": 16,
+ "NoAliasINTELMask": 17
}
},
{
@@ -900,6 +942,8 @@
"GroupNonUniformQuad": 68,
"ShaderLayer": 69,
"ShaderViewportIndex": 70,
+ "UniformDecoration": 71,
+ "CoreBuiltinsARM": 4165,
"FragmentShadingRateKHR": 4422,
"SubgroupBallotKHR": 4423,
"DrawParameters": 4427,
@@ -948,6 +992,8 @@
"FragmentFullyCoveredEXT": 5265,
"MeshShadingNV": 5266,
"ImageFootprintNV": 5282,
+ "MeshShadingEXT": 5283,
+ "FragmentBarycentricKHR": 5284,
"FragmentBarycentricNV": 5284,
"ComputeDerivativeGroupQuadsNV": 5288,
"FragmentDensityEXT": 5291,
@@ -992,7 +1038,10 @@
"FragmentShaderShadingRateInterlockEXT": 5372,
"ShaderSMBuiltinsNV": 5373,
"FragmentShaderPixelInterlockEXT": 5378,
+ "DemoteToHelperInvocation": 5379,
"DemoteToHelperInvocationEXT": 5379,
+ "RayTracingOpacityMicromapEXT": 5381,
+ "BindlessTextureNV": 5390,
"SubgroupShuffleINTEL": 5568,
"SubgroupBufferBlockIOINTEL": 5569,
"SubgroupImageBlockIOINTEL": 5570,
@@ -1025,23 +1074,32 @@
"FPGAMemoryAccessesINTEL": 5898,
"FPGAClusterAttributesINTEL": 5904,
"LoopFuseINTEL": 5906,
+ "MemoryAccessAliasingINTEL": 5910,
"FPGABufferLocationINTEL": 5920,
"ArbitraryPrecisionFixedPointINTEL": 5922,
"USMStorageClassesINTEL": 5935,
"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
+ "DebugInfoModuleINTEL": 6114,
+ "SplitBarrierINTEL": 6141,
+ "GroupUniformArithmeticKHR": 6400
}
},
{
@@ -1058,7 +1116,8 @@
"CullOpaqueKHR": 6,
"CullNoOpaqueKHR": 7,
"SkipTrianglesKHR": 8,
- "SkipAABBsKHR": 9
+ "SkipAABBsKHR": 9,
+ "ForceOpacityMicromap2StateEXT": 10
}
},
{
@@ -1149,6 +1208,7 @@
"Type": "Value",
"Values":
{
+ "PackedVectorFormat4x8Bit": 0,
"PackedVectorFormat4x8BitKHR": 0
}
},
@@ -1507,17 +1567,24 @@
"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,
@@ -1538,6 +1605,8 @@
"OpFragmentFetchAMD": 5012,
"OpReadClockKHR": 5056,
"OpImageSampleFootprintNV": 5283,
+ "OpEmitMeshTasksEXT": 5294,
+ "OpSetMeshOutputsEXT": 5295,
"OpGroupNonUniformPartitionNV": 5296,
"OpWritePackedPrimitiveIndices4x8NV": 5299,
"OpReportIntersectionKHR": 5334,
@@ -1557,8 +1626,16 @@
"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,
@@ -1583,7 +1660,7 @@
"OpUSubSatINTEL": 5596,
"OpIMul32x16INTEL": 5597,
"OpUMul32x16INTEL": 5598,
- "OpConstFunctionPointerINTEL": 5600,
+ "OpConstantFunctionPointerINTEL": 5600,
"OpFunctionPointerCallINTEL": 5601,
"OpAsmTargetINTEL": 5609,
"OpAsmINTEL": 5610,
@@ -1759,6 +1836,9 @@
"OpArbitraryFloatPowRINTEL": 5881,
"OpArbitraryFloatPowNINTEL": 5882,
"OpLoopControlINTEL": 5887,
+ "OpAliasDomainDeclINTEL": 5911,
+ "OpAliasScopeDeclINTEL": 5912,
+ "OpAliasScopeListDeclINTEL": 5913,
"OpFixedSqrtINTEL": 5923,
"OpFixedRecipINTEL": 5924,
"OpFixedRsqrtINTEL": 5925,
@@ -1796,7 +1876,17 @@
"OpTypeBufferSurfaceINTEL": 6086,
"OpTypeStructContinuedINTEL": 6090,
"OpConstantCompositeContinuedINTEL": 6091,
- "OpSpecConstantCompositeContinuedINTEL": 6092
+ "OpSpecConstantCompositeContinuedINTEL": 6092,
+ "OpControlBarrierArriveINTEL": 6142,
+ "OpControlBarrierWaitINTEL": 6143,
+ "OpGroupIMulKHR": 6401,
+ "OpGroupFMulKHR": 6402,
+ "OpGroupBitwiseAndKHR": 6403,
+ "OpGroupBitwiseOrKHR": 6404,
+ "OpGroupBitwiseXorKHR": 6405,
+ "OpGroupLogicalAndKHR": 6406,
+ "OpGroupLogicalOrKHR": 6407,
+ "OpGroupLogicalXorKHR": 6408
}
}
]
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.lua b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.lua
deleted file mode 100644
index 46665d82183..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.lua
+++ /dev/null
@@ -1,1757 +0,0 @@
--- 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
---
--- - 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
---
--- 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.
-
-spv = {
- MagicNumber = 0x07230203,
- Version = 0x00010500,
- Revision = 4,
- OpCodeMask = 0xffff,
- WordCountShift = 16,
-
- SourceLanguage = {
- Unknown = 0,
- ESSL = 1,
- GLSL = 2,
- OpenCL_C = 3,
- OpenCL_CPP = 4,
- HLSL = 5,
- CPP_for_OpenCL = 6,
- },
-
- ExecutionModel = {
- 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,
- },
-
- AddressingModel = {
- Logical = 0,
- Physical32 = 1,
- Physical64 = 2,
- PhysicalStorageBuffer64 = 5348,
- PhysicalStorageBuffer64EXT = 5348,
- },
-
- MemoryModel = {
- Simple = 0,
- GLSL450 = 1,
- OpenCL = 2,
- Vulkan = 3,
- VulkanKHR = 3,
- },
-
- ExecutionMode = {
- 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,
- StencilRefReplacingEXT = 5027,
- OutputLinesNV = 5269,
- OutputPrimitivesNV = 5270,
- DerivativeGroupQuadsNV = 5289,
- DerivativeGroupLinearNV = 5290,
- 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,
- },
-
- StorageClass = {
- 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,
- CodeSectionINTEL = 5605,
- DeviceOnlyINTEL = 5936,
- HostOnlyINTEL = 5937,
- },
-
- Dim = {
- Dim1D = 0,
- Dim2D = 1,
- Dim3D = 2,
- Cube = 3,
- Rect = 4,
- Buffer = 5,
- SubpassData = 6,
- },
-
- SamplerAddressingMode = {
- None = 0,
- ClampToEdge = 1,
- Clamp = 2,
- Repeat = 3,
- RepeatMirrored = 4,
- },
-
- SamplerFilterMode = {
- Nearest = 0,
- Linear = 1,
- },
-
- ImageFormat = {
- 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,
- },
-
- ImageChannelOrder = {
- 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,
- },
-
- ImageChannelDataType = {
- 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,
- },
-
- ImageOperandsShift = {
- 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,
- },
-
- ImageOperandsMask = {
- 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,
- },
-
- FPFastMathModeShift = {
- NotNaN = 0,
- NotInf = 1,
- NSZ = 2,
- AllowRecip = 3,
- Fast = 4,
- AllowContractFastINTEL = 16,
- AllowReassocINTEL = 17,
- },
-
- FPFastMathModeMask = {
- MaskNone = 0,
- NotNaN = 0x00000001,
- NotInf = 0x00000002,
- NSZ = 0x00000004,
- AllowRecip = 0x00000008,
- Fast = 0x00000010,
- AllowContractFastINTEL = 0x00010000,
- AllowReassocINTEL = 0x00020000,
- },
-
- FPRoundingMode = {
- RTE = 0,
- RTZ = 1,
- RTP = 2,
- RTN = 3,
- },
-
- LinkageType = {
- Export = 0,
- Import = 1,
- LinkOnceODR = 2,
- },
-
- AccessQualifier = {
- ReadOnly = 0,
- WriteOnly = 1,
- ReadWrite = 2,
- },
-
- FunctionParameterAttribute = {
- Zext = 0,
- Sext = 1,
- ByVal = 2,
- Sret = 3,
- NoAlias = 4,
- NoCapture = 5,
- NoWrite = 6,
- NoReadWrite = 7,
- },
-
- Decoration = {
- 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,
- PerPrimitiveNV = 5271,
- PerViewNV = 5272,
- PerTaskNV = 5273,
- PerVertexNV = 5285,
- NonUniform = 5300,
- NonUniformEXT = 5300,
- RestrictPointer = 5355,
- RestrictPointerEXT = 5355,
- AliasedPointer = 5356,
- AliasedPointerEXT = 5356,
- 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,
- BufferLocationINTEL = 5921,
- IOPipeStorageINTEL = 5944,
- FunctionFloatingPointModeINTEL = 6080,
- SingleElementVectorINTEL = 6085,
- VectorComputeCallableFunctionINTEL = 6087,
- },
-
- BuiltIn = {
- 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,
- 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,
- BaryCoordNV = 5286,
- BaryCoordNoPerspNV = 5287,
- FragSizeEXT = 5292,
- FragmentSizeNV = 5292,
- FragInvocationCountEXT = 5293,
- InvocationsPerPixelNV = 5293,
- 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,
- },
-
- SelectionControlShift = {
- Flatten = 0,
- DontFlatten = 1,
- },
-
- SelectionControlMask = {
- MaskNone = 0,
- Flatten = 0x00000001,
- DontFlatten = 0x00000002,
- },
-
- LoopControlShift = {
- 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,
- },
-
- LoopControlMask = {
- 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,
- },
-
- FunctionControlShift = {
- Inline = 0,
- DontInline = 1,
- Pure = 2,
- Const = 3,
- OptNoneINTEL = 16,
- },
-
- FunctionControlMask = {
- MaskNone = 0,
- Inline = 0x00000001,
- DontInline = 0x00000002,
- Pure = 0x00000004,
- Const = 0x00000008,
- OptNoneINTEL = 0x00010000,
- },
-
- MemorySemanticsShift = {
- 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,
- },
-
- MemorySemanticsMask = {
- 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,
- },
-
- MemoryAccessShift = {
- Volatile = 0,
- Aligned = 1,
- Nontemporal = 2,
- MakePointerAvailable = 3,
- MakePointerAvailableKHR = 3,
- MakePointerVisible = 4,
- MakePointerVisibleKHR = 4,
- NonPrivatePointer = 5,
- NonPrivatePointerKHR = 5,
- },
-
- MemoryAccessMask = {
- MaskNone = 0,
- Volatile = 0x00000001,
- Aligned = 0x00000002,
- Nontemporal = 0x00000004,
- MakePointerAvailable = 0x00000008,
- MakePointerAvailableKHR = 0x00000008,
- MakePointerVisible = 0x00000010,
- MakePointerVisibleKHR = 0x00000010,
- NonPrivatePointer = 0x00000020,
- NonPrivatePointerKHR = 0x00000020,
- },
-
- Scope = {
- CrossDevice = 0,
- Device = 1,
- Workgroup = 2,
- Subgroup = 3,
- Invocation = 4,
- QueueFamily = 5,
- QueueFamilyKHR = 5,
- ShaderCallKHR = 6,
- },
-
- GroupOperation = {
- Reduce = 0,
- InclusiveScan = 1,
- ExclusiveScan = 2,
- ClusteredReduce = 3,
- PartitionedReduceNV = 6,
- PartitionedInclusiveScanNV = 7,
- PartitionedExclusiveScanNV = 8,
- },
-
- KernelEnqueueFlags = {
- NoWait = 0,
- WaitKernel = 1,
- WaitWorkGroup = 2,
- },
-
- KernelProfilingInfoShift = {
- CmdExecTime = 0,
- },
-
- KernelProfilingInfoMask = {
- MaskNone = 0,
- CmdExecTime = 0x00000001,
- },
-
- Capability = {
- 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,
- 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,
- 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,
- DemoteToHelperInvocationEXT = 5379,
- 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,
- FPGABufferLocationINTEL = 5920,
- ArbitraryPrecisionFixedPointINTEL = 5922,
- USMStorageClassesINTEL = 5935,
- IOPipesINTEL = 5943,
- BlockingPipesINTEL = 5945,
- FPGARegINTEL = 5948,
- DotProductInputAllKHR = 6016,
- DotProductInput4x8BitKHR = 6017,
- DotProductInput4x8BitPackedKHR = 6018,
- DotProductKHR = 6019,
- BitInstructions = 6025,
- AtomicFloat32AddEXT = 6033,
- AtomicFloat64AddEXT = 6034,
- LongConstantCompositeINTEL = 6089,
- OptNoneINTEL = 6094,
- AtomicFloat16AddEXT = 6095,
- DebugInfoModuleINTEL = 6114,
- },
-
- RayFlagsShift = {
- OpaqueKHR = 0,
- NoOpaqueKHR = 1,
- TerminateOnFirstHitKHR = 2,
- SkipClosestHitShaderKHR = 3,
- CullBackFacingTrianglesKHR = 4,
- CullFrontFacingTrianglesKHR = 5,
- CullOpaqueKHR = 6,
- CullNoOpaqueKHR = 7,
- SkipTrianglesKHR = 8,
- SkipAABBsKHR = 9,
- },
-
- RayFlagsMask = {
- MaskNone = 0,
- OpaqueKHR = 0x00000001,
- NoOpaqueKHR = 0x00000002,
- TerminateOnFirstHitKHR = 0x00000004,
- SkipClosestHitShaderKHR = 0x00000008,
- CullBackFacingTrianglesKHR = 0x00000010,
- CullFrontFacingTrianglesKHR = 0x00000020,
- CullOpaqueKHR = 0x00000040,
- CullNoOpaqueKHR = 0x00000080,
- SkipTrianglesKHR = 0x00000100,
- SkipAABBsKHR = 0x00000200,
- },
-
- RayQueryIntersection = {
- RayQueryCandidateIntersectionKHR = 0,
- RayQueryCommittedIntersectionKHR = 1,
- },
-
- RayQueryCommittedIntersectionType = {
- RayQueryCommittedIntersectionNoneKHR = 0,
- RayQueryCommittedIntersectionTriangleKHR = 1,
- RayQueryCommittedIntersectionGeneratedKHR = 2,
- },
-
- RayQueryCandidateIntersectionType = {
- RayQueryCandidateIntersectionTriangleKHR = 0,
- RayQueryCandidateIntersectionAABBKHR = 1,
- },
-
- FragmentShadingRateShift = {
- Vertical2Pixels = 0,
- Vertical4Pixels = 1,
- Horizontal2Pixels = 2,
- Horizontal4Pixels = 3,
- },
-
- FragmentShadingRateMask = {
- MaskNone = 0,
- Vertical2Pixels = 0x00000001,
- Vertical4Pixels = 0x00000002,
- Horizontal2Pixels = 0x00000004,
- Horizontal4Pixels = 0x00000008,
- },
-
- FPDenormMode = {
- Preserve = 0,
- FlushToZero = 1,
- },
-
- FPOperationMode = {
- IEEE = 0,
- ALT = 1,
- },
-
- QuantizationModes = {
- TRN = 0,
- TRN_ZERO = 1,
- RND = 2,
- RND_ZERO = 3,
- RND_INF = 4,
- RND_MIN_INF = 5,
- RND_CONV = 6,
- RND_CONV_ODD = 7,
- },
-
- OverflowModes = {
- WRAP = 0,
- SAT = 1,
- SAT_ZERO = 2,
- SAT_SYM = 3,
- },
-
- PackedVectorFormat = {
- PackedVectorFormat4x8BitKHR = 0,
- },
-
- Op = {
- 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,
- OpSubgroupReadInvocationKHR = 4432,
- OpTraceRayKHR = 4445,
- OpExecuteCallableKHR = 4446,
- OpConvertUToAccelerationStructureKHR = 4447,
- OpIgnoreIntersectionKHR = 4448,
- OpTerminateRayKHR = 4449,
- OpSDotKHR = 4450,
- OpUDotKHR = 4451,
- OpSUDotKHR = 4452,
- OpSDotAccSatKHR = 4453,
- OpUDotAccSatKHR = 4454,
- 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,
- OpImageSampleFootprintNV = 5283,
- 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,
- OpDemoteToHelperInvocationEXT = 5380,
- OpIsHelperInvocationEXT = 5381,
- 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,
- OpConstFunctionPointerINTEL = 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,
- 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,
- },
-
-}
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.py b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.py
deleted file mode 100644
index a7801919c71..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spirv.py
+++ /dev/null
@@ -1,1757 +0,0 @@
-# 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
-#
-# - 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
-#
-# 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.
-
-spv = {
- 'MagicNumber' : 0x07230203,
- 'Version' : 0x00010500,
- 'Revision' : 4,
- 'OpCodeMask' : 0xffff,
- 'WordCountShift' : 16,
-
- 'SourceLanguage' : {
- 'Unknown' : 0,
- 'ESSL' : 1,
- 'GLSL' : 2,
- 'OpenCL_C' : 3,
- 'OpenCL_CPP' : 4,
- 'HLSL' : 5,
- 'CPP_for_OpenCL' : 6,
- },
-
- 'ExecutionModel' : {
- '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,
- },
-
- 'AddressingModel' : {
- 'Logical' : 0,
- 'Physical32' : 1,
- 'Physical64' : 2,
- 'PhysicalStorageBuffer64' : 5348,
- 'PhysicalStorageBuffer64EXT' : 5348,
- },
-
- 'MemoryModel' : {
- 'Simple' : 0,
- 'GLSL450' : 1,
- 'OpenCL' : 2,
- 'Vulkan' : 3,
- 'VulkanKHR' : 3,
- },
-
- 'ExecutionMode' : {
- '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,
- 'StencilRefReplacingEXT' : 5027,
- 'OutputLinesNV' : 5269,
- 'OutputPrimitivesNV' : 5270,
- 'DerivativeGroupQuadsNV' : 5289,
- 'DerivativeGroupLinearNV' : 5290,
- '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,
- },
-
- 'StorageClass' : {
- '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,
- 'CodeSectionINTEL' : 5605,
- 'DeviceOnlyINTEL' : 5936,
- 'HostOnlyINTEL' : 5937,
- },
-
- 'Dim' : {
- 'Dim1D' : 0,
- 'Dim2D' : 1,
- 'Dim3D' : 2,
- 'Cube' : 3,
- 'Rect' : 4,
- 'Buffer' : 5,
- 'SubpassData' : 6,
- },
-
- 'SamplerAddressingMode' : {
- 'None' : 0,
- 'ClampToEdge' : 1,
- 'Clamp' : 2,
- 'Repeat' : 3,
- 'RepeatMirrored' : 4,
- },
-
- 'SamplerFilterMode' : {
- 'Nearest' : 0,
- 'Linear' : 1,
- },
-
- 'ImageFormat' : {
- '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,
- },
-
- 'ImageChannelOrder' : {
- '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,
- },
-
- 'ImageChannelDataType' : {
- '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,
- },
-
- 'ImageOperandsShift' : {
- '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,
- },
-
- 'ImageOperandsMask' : {
- '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,
- },
-
- 'FPFastMathModeShift' : {
- 'NotNaN' : 0,
- 'NotInf' : 1,
- 'NSZ' : 2,
- 'AllowRecip' : 3,
- 'Fast' : 4,
- 'AllowContractFastINTEL' : 16,
- 'AllowReassocINTEL' : 17,
- },
-
- 'FPFastMathModeMask' : {
- 'MaskNone' : 0,
- 'NotNaN' : 0x00000001,
- 'NotInf' : 0x00000002,
- 'NSZ' : 0x00000004,
- 'AllowRecip' : 0x00000008,
- 'Fast' : 0x00000010,
- 'AllowContractFastINTEL' : 0x00010000,
- 'AllowReassocINTEL' : 0x00020000,
- },
-
- 'FPRoundingMode' : {
- 'RTE' : 0,
- 'RTZ' : 1,
- 'RTP' : 2,
- 'RTN' : 3,
- },
-
- 'LinkageType' : {
- 'Export' : 0,
- 'Import' : 1,
- 'LinkOnceODR' : 2,
- },
-
- 'AccessQualifier' : {
- 'ReadOnly' : 0,
- 'WriteOnly' : 1,
- 'ReadWrite' : 2,
- },
-
- 'FunctionParameterAttribute' : {
- 'Zext' : 0,
- 'Sext' : 1,
- 'ByVal' : 2,
- 'Sret' : 3,
- 'NoAlias' : 4,
- 'NoCapture' : 5,
- 'NoWrite' : 6,
- 'NoReadWrite' : 7,
- },
-
- 'Decoration' : {
- '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,
- 'PerPrimitiveNV' : 5271,
- 'PerViewNV' : 5272,
- 'PerTaskNV' : 5273,
- 'PerVertexNV' : 5285,
- 'NonUniform' : 5300,
- 'NonUniformEXT' : 5300,
- 'RestrictPointer' : 5355,
- 'RestrictPointerEXT' : 5355,
- 'AliasedPointer' : 5356,
- 'AliasedPointerEXT' : 5356,
- '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,
- 'BufferLocationINTEL' : 5921,
- 'IOPipeStorageINTEL' : 5944,
- 'FunctionFloatingPointModeINTEL' : 6080,
- 'SingleElementVectorINTEL' : 6085,
- 'VectorComputeCallableFunctionINTEL' : 6087,
- },
-
- 'BuiltIn' : {
- '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,
- '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,
- 'BaryCoordNV' : 5286,
- 'BaryCoordNoPerspNV' : 5287,
- 'FragSizeEXT' : 5292,
- 'FragmentSizeNV' : 5292,
- 'FragInvocationCountEXT' : 5293,
- 'InvocationsPerPixelNV' : 5293,
- '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,
- },
-
- 'SelectionControlShift' : {
- 'Flatten' : 0,
- 'DontFlatten' : 1,
- },
-
- 'SelectionControlMask' : {
- 'MaskNone' : 0,
- 'Flatten' : 0x00000001,
- 'DontFlatten' : 0x00000002,
- },
-
- 'LoopControlShift' : {
- '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,
- },
-
- 'LoopControlMask' : {
- '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,
- },
-
- 'FunctionControlShift' : {
- 'Inline' : 0,
- 'DontInline' : 1,
- 'Pure' : 2,
- 'Const' : 3,
- 'OptNoneINTEL' : 16,
- },
-
- 'FunctionControlMask' : {
- 'MaskNone' : 0,
- 'Inline' : 0x00000001,
- 'DontInline' : 0x00000002,
- 'Pure' : 0x00000004,
- 'Const' : 0x00000008,
- 'OptNoneINTEL' : 0x00010000,
- },
-
- 'MemorySemanticsShift' : {
- '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,
- },
-
- 'MemorySemanticsMask' : {
- '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,
- },
-
- 'MemoryAccessShift' : {
- 'Volatile' : 0,
- 'Aligned' : 1,
- 'Nontemporal' : 2,
- 'MakePointerAvailable' : 3,
- 'MakePointerAvailableKHR' : 3,
- 'MakePointerVisible' : 4,
- 'MakePointerVisibleKHR' : 4,
- 'NonPrivatePointer' : 5,
- 'NonPrivatePointerKHR' : 5,
- },
-
- 'MemoryAccessMask' : {
- 'MaskNone' : 0,
- 'Volatile' : 0x00000001,
- 'Aligned' : 0x00000002,
- 'Nontemporal' : 0x00000004,
- 'MakePointerAvailable' : 0x00000008,
- 'MakePointerAvailableKHR' : 0x00000008,
- 'MakePointerVisible' : 0x00000010,
- 'MakePointerVisibleKHR' : 0x00000010,
- 'NonPrivatePointer' : 0x00000020,
- 'NonPrivatePointerKHR' : 0x00000020,
- },
-
- 'Scope' : {
- 'CrossDevice' : 0,
- 'Device' : 1,
- 'Workgroup' : 2,
- 'Subgroup' : 3,
- 'Invocation' : 4,
- 'QueueFamily' : 5,
- 'QueueFamilyKHR' : 5,
- 'ShaderCallKHR' : 6,
- },
-
- 'GroupOperation' : {
- 'Reduce' : 0,
- 'InclusiveScan' : 1,
- 'ExclusiveScan' : 2,
- 'ClusteredReduce' : 3,
- 'PartitionedReduceNV' : 6,
- 'PartitionedInclusiveScanNV' : 7,
- 'PartitionedExclusiveScanNV' : 8,
- },
-
- 'KernelEnqueueFlags' : {
- 'NoWait' : 0,
- 'WaitKernel' : 1,
- 'WaitWorkGroup' : 2,
- },
-
- 'KernelProfilingInfoShift' : {
- 'CmdExecTime' : 0,
- },
-
- 'KernelProfilingInfoMask' : {
- 'MaskNone' : 0,
- 'CmdExecTime' : 0x00000001,
- },
-
- 'Capability' : {
- '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,
- '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,
- '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,
- 'DemoteToHelperInvocationEXT' : 5379,
- '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,
- 'FPGABufferLocationINTEL' : 5920,
- 'ArbitraryPrecisionFixedPointINTEL' : 5922,
- 'USMStorageClassesINTEL' : 5935,
- 'IOPipesINTEL' : 5943,
- 'BlockingPipesINTEL' : 5945,
- 'FPGARegINTEL' : 5948,
- 'DotProductInputAllKHR' : 6016,
- 'DotProductInput4x8BitKHR' : 6017,
- 'DotProductInput4x8BitPackedKHR' : 6018,
- 'DotProductKHR' : 6019,
- 'BitInstructions' : 6025,
- 'AtomicFloat32AddEXT' : 6033,
- 'AtomicFloat64AddEXT' : 6034,
- 'LongConstantCompositeINTEL' : 6089,
- 'OptNoneINTEL' : 6094,
- 'AtomicFloat16AddEXT' : 6095,
- 'DebugInfoModuleINTEL' : 6114,
- },
-
- 'RayFlagsShift' : {
- 'OpaqueKHR' : 0,
- 'NoOpaqueKHR' : 1,
- 'TerminateOnFirstHitKHR' : 2,
- 'SkipClosestHitShaderKHR' : 3,
- 'CullBackFacingTrianglesKHR' : 4,
- 'CullFrontFacingTrianglesKHR' : 5,
- 'CullOpaqueKHR' : 6,
- 'CullNoOpaqueKHR' : 7,
- 'SkipTrianglesKHR' : 8,
- 'SkipAABBsKHR' : 9,
- },
-
- 'RayFlagsMask' : {
- 'MaskNone' : 0,
- 'OpaqueKHR' : 0x00000001,
- 'NoOpaqueKHR' : 0x00000002,
- 'TerminateOnFirstHitKHR' : 0x00000004,
- 'SkipClosestHitShaderKHR' : 0x00000008,
- 'CullBackFacingTrianglesKHR' : 0x00000010,
- 'CullFrontFacingTrianglesKHR' : 0x00000020,
- 'CullOpaqueKHR' : 0x00000040,
- 'CullNoOpaqueKHR' : 0x00000080,
- 'SkipTrianglesKHR' : 0x00000100,
- 'SkipAABBsKHR' : 0x00000200,
- },
-
- 'RayQueryIntersection' : {
- 'RayQueryCandidateIntersectionKHR' : 0,
- 'RayQueryCommittedIntersectionKHR' : 1,
- },
-
- 'RayQueryCommittedIntersectionType' : {
- 'RayQueryCommittedIntersectionNoneKHR' : 0,
- 'RayQueryCommittedIntersectionTriangleKHR' : 1,
- 'RayQueryCommittedIntersectionGeneratedKHR' : 2,
- },
-
- 'RayQueryCandidateIntersectionType' : {
- 'RayQueryCandidateIntersectionTriangleKHR' : 0,
- 'RayQueryCandidateIntersectionAABBKHR' : 1,
- },
-
- 'FragmentShadingRateShift' : {
- 'Vertical2Pixels' : 0,
- 'Vertical4Pixels' : 1,
- 'Horizontal2Pixels' : 2,
- 'Horizontal4Pixels' : 3,
- },
-
- 'FragmentShadingRateMask' : {
- 'MaskNone' : 0,
- 'Vertical2Pixels' : 0x00000001,
- 'Vertical4Pixels' : 0x00000002,
- 'Horizontal2Pixels' : 0x00000004,
- 'Horizontal4Pixels' : 0x00000008,
- },
-
- 'FPDenormMode' : {
- 'Preserve' : 0,
- 'FlushToZero' : 1,
- },
-
- 'FPOperationMode' : {
- 'IEEE' : 0,
- 'ALT' : 1,
- },
-
- 'QuantizationModes' : {
- 'TRN' : 0,
- 'TRN_ZERO' : 1,
- 'RND' : 2,
- 'RND_ZERO' : 3,
- 'RND_INF' : 4,
- 'RND_MIN_INF' : 5,
- 'RND_CONV' : 6,
- 'RND_CONV_ODD' : 7,
- },
-
- 'OverflowModes' : {
- 'WRAP' : 0,
- 'SAT' : 1,
- 'SAT_ZERO' : 2,
- 'SAT_SYM' : 3,
- },
-
- 'PackedVectorFormat' : {
- 'PackedVectorFormat4x8BitKHR' : 0,
- },
-
- 'Op' : {
- '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,
- 'OpSubgroupReadInvocationKHR' : 4432,
- 'OpTraceRayKHR' : 4445,
- 'OpExecuteCallableKHR' : 4446,
- 'OpConvertUToAccelerationStructureKHR' : 4447,
- 'OpIgnoreIntersectionKHR' : 4448,
- 'OpTerminateRayKHR' : 4449,
- 'OpSDotKHR' : 4450,
- 'OpUDotKHR' : 4451,
- 'OpSUDotKHR' : 4452,
- 'OpSDotAccSatKHR' : 4453,
- 'OpUDotAccSatKHR' : 4454,
- '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,
- 'OpImageSampleFootprintNV' : 5283,
- '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,
- 'OpDemoteToHelperInvocationEXT' : 5380,
- 'OpIsHelperInvocationEXT' : 5381,
- '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,
- 'OpConstFunctionPointerINTEL' : 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,
- '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,
- },
-
-}
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spv.d b/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spv.d
deleted file mode 100644
index b85517a2f9c..00000000000
--- a/3rdparty/bgfx/3rdparty/spirv-headers/include/spirv/unified1/spv.d
+++ /dev/null
@@ -1,1814 +0,0 @@
-/+
- + 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
- +
- + - 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
- +
- + 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.
- +/
-
-module spv;
-
-enum uint MagicNumber = 0x07230203;
-enum uint Version = 0x00010500;
-enum uint Revision = 4;
-enum uint OpCodeMask = 0xffff;
-enum uint WordCountShift = 16;
-
-enum SourceLanguage : uint
-{
- Unknown = 0,
- ESSL = 1,
- GLSL = 2,
- OpenCL_C = 3,
- OpenCL_CPP = 4,
- HLSL = 5,
- CPP_for_OpenCL = 6,
-}
-
-enum ExecutionModel : uint
-{
- 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,
-}
-
-enum AddressingModel : uint
-{
- Logical = 0,
- Physical32 = 1,
- Physical64 = 2,
- PhysicalStorageBuffer64 = 5348,
- PhysicalStorageBuffer64EXT = 5348,
-}
-
-enum MemoryModel : uint
-{
- Simple = 0,
- GLSL450 = 1,
- OpenCL = 2,
- Vulkan = 3,
- VulkanKHR = 3,
-}
-
-enum ExecutionMode : uint
-{
- 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,
- StencilRefReplacingEXT = 5027,
- OutputLinesNV = 5269,
- OutputPrimitivesNV = 5270,
- DerivativeGroupQuadsNV = 5289,
- DerivativeGroupLinearNV = 5290,
- 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,
-}
-
-enum StorageClass : uint
-{
- 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,
- CodeSectionINTEL = 5605,
- DeviceOnlyINTEL = 5936,
- HostOnlyINTEL = 5937,
-}
-
-enum Dim : uint
-{
- _1D = 0,
- _2D = 1,
- _3D = 2,
- Cube = 3,
- Rect = 4,
- Buffer = 5,
- SubpassData = 6,
-}
-
-enum SamplerAddressingMode : uint
-{
- None = 0,
- ClampToEdge = 1,
- Clamp = 2,
- Repeat = 3,
- RepeatMirrored = 4,
-}
-
-enum SamplerFilterMode : uint
-{
- Nearest = 0,
- Linear = 1,
-}
-
-enum ImageFormat : uint
-{
- 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,
-}
-
-enum ImageChannelOrder : uint
-{
- 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,
-}
-
-enum ImageChannelDataType : uint
-{
- 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,
-}
-
-enum ImageOperandsShift : uint
-{
- 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,
-}
-
-enum ImageOperandsMask : uint
-{
- 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,
-}
-
-enum FPFastMathModeShift : uint
-{
- NotNaN = 0,
- NotInf = 1,
- NSZ = 2,
- AllowRecip = 3,
- Fast = 4,
- AllowContractFastINTEL = 16,
- AllowReassocINTEL = 17,
-}
-
-enum FPFastMathModeMask : uint
-{
- MaskNone = 0,
- NotNaN = 0x00000001,
- NotInf = 0x00000002,
- NSZ = 0x00000004,
- AllowRecip = 0x00000008,
- Fast = 0x00000010,
- AllowContractFastINTEL = 0x00010000,
- AllowReassocINTEL = 0x00020000,
-}
-
-enum FPRoundingMode : uint
-{
- RTE = 0,
- RTZ = 1,
- RTP = 2,
- RTN = 3,
-}
-
-enum LinkageType : uint
-{
- Export = 0,
- Import = 1,
- LinkOnceODR = 2,
-}
-
-enum AccessQualifier : uint
-{
- ReadOnly = 0,
- WriteOnly = 1,
- ReadWrite = 2,
-}
-
-enum FunctionParameterAttribute : uint
-{
- Zext = 0,
- Sext = 1,
- ByVal = 2,
- Sret = 3,
- NoAlias = 4,
- NoCapture = 5,
- NoWrite = 6,
- NoReadWrite = 7,
-}
-
-enum Decoration : uint
-{
- 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,
- PerPrimitiveNV = 5271,
- PerViewNV = 5272,
- PerTaskNV = 5273,
- PerVertexNV = 5285,
- NonUniform = 5300,
- NonUniformEXT = 5300,
- RestrictPointer = 5355,
- RestrictPointerEXT = 5355,
- AliasedPointer = 5356,
- AliasedPointerEXT = 5356,
- 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,
- BufferLocationINTEL = 5921,
- IOPipeStorageINTEL = 5944,
- FunctionFloatingPointModeINTEL = 6080,
- SingleElementVectorINTEL = 6085,
- VectorComputeCallableFunctionINTEL = 6087,
-}
-
-enum BuiltIn : uint
-{
- 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,
- 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,
- BaryCoordNV = 5286,
- BaryCoordNoPerspNV = 5287,
- FragSizeEXT = 5292,
- FragmentSizeNV = 5292,
- FragInvocationCountEXT = 5293,
- InvocationsPerPixelNV = 5293,
- 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,
-}
-
-enum SelectionControlShift : uint
-{
- Flatten = 0,
- DontFlatten = 1,
-}
-
-enum SelectionControlMask : uint
-{
- MaskNone = 0,
- Flatten = 0x00000001,
- DontFlatten = 0x00000002,
-}
-
-enum LoopControlShift : uint
-{
- 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,
-}
-
-enum LoopControlMask : uint
-{
- 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,
-}
-
-enum FunctionControlShift : uint
-{
- Inline = 0,
- DontInline = 1,
- Pure = 2,
- Const = 3,
- OptNoneINTEL = 16,
-}
-
-enum FunctionControlMask : uint
-{
- MaskNone = 0,
- Inline = 0x00000001,
- DontInline = 0x00000002,
- Pure = 0x00000004,
- Const = 0x00000008,
- OptNoneINTEL = 0x00010000,
-}
-
-enum MemorySemanticsShift : uint
-{
- 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,
-}
-
-enum MemorySemanticsMask : uint
-{
- 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 MemoryAccessShift : uint
-{
- Volatile = 0,
- Aligned = 1,
- Nontemporal = 2,
- MakePointerAvailable = 3,
- MakePointerAvailableKHR = 3,
- MakePointerVisible = 4,
- MakePointerVisibleKHR = 4,
- NonPrivatePointer = 5,
- NonPrivatePointerKHR = 5,
-}
-
-enum MemoryAccessMask : uint
-{
- MaskNone = 0,
- Volatile = 0x00000001,
- Aligned = 0x00000002,
- Nontemporal = 0x00000004,
- MakePointerAvailable = 0x00000008,
- MakePointerAvailableKHR = 0x00000008,
- MakePointerVisible = 0x00000010,
- MakePointerVisibleKHR = 0x00000010,
- NonPrivatePointer = 0x00000020,
- NonPrivatePointerKHR = 0x00000020,
-}
-
-enum Scope : uint
-{
- CrossDevice = 0,
- Device = 1,
- Workgroup = 2,
- Subgroup = 3,
- Invocation = 4,
- QueueFamily = 5,
- QueueFamilyKHR = 5,
- ShaderCallKHR = 6,
-}
-
-enum GroupOperation : uint
-{
- Reduce = 0,
- InclusiveScan = 1,
- ExclusiveScan = 2,
- ClusteredReduce = 3,
- PartitionedReduceNV = 6,
- PartitionedInclusiveScanNV = 7,
- PartitionedExclusiveScanNV = 8,
-}
-
-enum KernelEnqueueFlags : uint
-{
- NoWait = 0,
- WaitKernel = 1,
- WaitWorkGroup = 2,
-}
-
-enum KernelProfilingInfoShift : uint
-{
- CmdExecTime = 0,
-}
-
-enum KernelProfilingInfoMask : uint
-{
- MaskNone = 0,
- CmdExecTime = 0x00000001,
-}
-
-enum Capability : uint
-{
- 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,
- 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,
- 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,
- DemoteToHelperInvocationEXT = 5379,
- 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,
- FPGABufferLocationINTEL = 5920,
- ArbitraryPrecisionFixedPointINTEL = 5922,
- USMStorageClassesINTEL = 5935,
- IOPipesINTEL = 5943,
- BlockingPipesINTEL = 5945,
- FPGARegINTEL = 5948,
- DotProductInputAllKHR = 6016,
- DotProductInput4x8BitKHR = 6017,
- DotProductInput4x8BitPackedKHR = 6018,
- DotProductKHR = 6019,
- BitInstructions = 6025,
- AtomicFloat32AddEXT = 6033,
- AtomicFloat64AddEXT = 6034,
- LongConstantCompositeINTEL = 6089,
- OptNoneINTEL = 6094,
- AtomicFloat16AddEXT = 6095,
- DebugInfoModuleINTEL = 6114,
-}
-
-enum RayFlagsShift : uint
-{
- OpaqueKHR = 0,
- NoOpaqueKHR = 1,
- TerminateOnFirstHitKHR = 2,
- SkipClosestHitShaderKHR = 3,
- CullBackFacingTrianglesKHR = 4,
- CullFrontFacingTrianglesKHR = 5,
- CullOpaqueKHR = 6,
- CullNoOpaqueKHR = 7,
- SkipTrianglesKHR = 8,
- SkipAABBsKHR = 9,
-}
-
-enum RayFlagsMask : uint
-{
- MaskNone = 0,
- OpaqueKHR = 0x00000001,
- NoOpaqueKHR = 0x00000002,
- TerminateOnFirstHitKHR = 0x00000004,
- SkipClosestHitShaderKHR = 0x00000008,
- CullBackFacingTrianglesKHR = 0x00000010,
- CullFrontFacingTrianglesKHR = 0x00000020,
- CullOpaqueKHR = 0x00000040,
- CullNoOpaqueKHR = 0x00000080,
- SkipTrianglesKHR = 0x00000100,
- SkipAABBsKHR = 0x00000200,
-}
-
-enum RayQueryIntersection : uint
-{
- RayQueryCandidateIntersectionKHR = 0,
- RayQueryCommittedIntersectionKHR = 1,
-}
-
-enum RayQueryCommittedIntersectionType : uint
-{
- RayQueryCommittedIntersectionNoneKHR = 0,
- RayQueryCommittedIntersectionTriangleKHR = 1,
- RayQueryCommittedIntersectionGeneratedKHR = 2,
-}
-
-enum RayQueryCandidateIntersectionType : uint
-{
- RayQueryCandidateIntersectionTriangleKHR = 0,
- RayQueryCandidateIntersectionAABBKHR = 1,
-}
-
-enum FragmentShadingRateShift : uint
-{
- Vertical2Pixels = 0,
- Vertical4Pixels = 1,
- Horizontal2Pixels = 2,
- Horizontal4Pixels = 3,
-}
-
-enum FragmentShadingRateMask : uint
-{
- MaskNone = 0,
- Vertical2Pixels = 0x00000001,
- Vertical4Pixels = 0x00000002,
- Horizontal2Pixels = 0x00000004,
- Horizontal4Pixels = 0x00000008,
-}
-
-enum FPDenormMode : uint
-{
- Preserve = 0,
- FlushToZero = 1,
-}
-
-enum FPOperationMode : uint
-{
- IEEE = 0,
- ALT = 1,
-}
-
-enum QuantizationModes : uint
-{
- TRN = 0,
- TRN_ZERO = 1,
- RND = 2,
- RND_ZERO = 3,
- RND_INF = 4,
- RND_MIN_INF = 5,
- RND_CONV = 6,
- RND_CONV_ODD = 7,
-}
-
-enum OverflowModes : uint
-{
- WRAP = 0,
- SAT = 1,
- SAT_ZERO = 2,
- SAT_SYM = 3,
-}
-
-enum PackedVectorFormat : uint
-{
- PackedVectorFormat4x8BitKHR = 0,
-}
-
-enum Op : uint
-{
- 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,
- OpSubgroupReadInvocationKHR = 4432,
- OpTraceRayKHR = 4445,
- OpExecuteCallableKHR = 4446,
- OpConvertUToAccelerationStructureKHR = 4447,
- OpIgnoreIntersectionKHR = 4448,
- OpTerminateRayKHR = 4449,
- OpSDotKHR = 4450,
- OpUDotKHR = 4451,
- OpSUDotKHR = 4452,
- OpSDotAccSatKHR = 4453,
- OpUDotAccSatKHR = 4454,
- 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,
- OpImageSampleFootprintNV = 5283,
- 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,
- OpDemoteToHelperInvocationEXT = 5380,
- OpIsHelperInvocationEXT = 5381,
- 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,
- OpConstFunctionPointerINTEL = 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,
- 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,
-}
-
-
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc
index 59e49342d67..af6113d9f1a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/build-version.inc
@@ -1 +1 @@
-"v2021.4-dev", "SPIRV-Tools v2021.4-dev 133b7ce91f51ffb26e674a856ec6692cca650ab3"
+"v2022.5-dev", "SPIRV-Tools v2022.5-dev 01f246880b501c751d62ad543d886e08bfa756b5"
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc
index 88c578b201c..88d806909dc 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/core.insts-unified1.inc
@@ -7,11 +7,14 @@ static const SpvCapability pygen_variable_caps_ArbitraryPrecisionFloatingPointIN
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};
@@ -25,9 +28,11 @@ static const SpvCapability pygen_variable_caps_GroupNonUniformArithmeticGroupNon
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};
@@ -37,6 +42,8 @@ static const SpvCapability pygen_variable_caps_KernelImageQuery[] = {SpvCapabili
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};
@@ -52,6 +59,7 @@ 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};
@@ -77,8 +85,10 @@ static const spvtools::Extension pygen_variable_exts_SPV_GOOGLE_hlsl_functionali
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_fpga_reg[] = {spvtools::Extension::kSPV_INTEL_fpga_reg};
static const spvtools::Extension pygen_variable_exts_SPV_INTEL_function_pointers[] = {spvtools::Extension::kSPV_INTEL_function_pointers};
+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_unstructured_loop_controls[] = {spvtools::Extension::kSPV_INTEL_unstructured_loop_controls};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_expect_assume[] = {spvtools::Extension::kSPV_KHR_expect_assume};
+static const spvtools::Extension pygen_variable_exts_SPV_KHR_integer_dot_product[] = {spvtools::Extension::kSPV_KHR_integer_dot_product};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_query[] = {spvtools::Extension::kSPV_KHR_ray_query};
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};
@@ -245,7 +255,7 @@ static const spv_opcode_desc_t kOpcodeTableEntries[] = {
{"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), 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},
@@ -440,24 +450,31 @@ static const spv_opcode_desc_t kOpcodeTableEntries[] = {
{"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, 0xffffffffu, 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},
- {"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, 0, nullptr, 0xffffffffu, 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, 0, nullptr, 0xffffffffu, 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, 0, nullptr, 0xffffffffu, 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, 0, nullptr, 0xffffffffu, 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, 0, nullptr, 0xffffffffu, 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, 0, nullptr, 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},
@@ -477,6 +494,8 @@ static const spv_opcode_desc_t kOpcodeTableEntries[] = {
{"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},
@@ -496,8 +515,16 @@ static const spv_opcode_desc_t kOpcodeTableEntries[] = {
{"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},
- {"DemoteToHelperInvocationEXT", SpvOpDemoteToHelperInvocationEXT, 1, pygen_variable_caps_DemoteToHelperInvocationEXT, 0, {}, 0, 0, 1, pygen_variable_exts_SPV_EXT_demote_to_helper_invocation, 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},
@@ -522,7 +549,7 @@ static const spv_opcode_desc_t kOpcodeTableEntries[] = {
{"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},
- {"ConstFunctionPointerINTEL", SpvOpConstFunctionPointerINTEL, 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},
+ {"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},
@@ -698,6 +725,9 @@ static const spv_opcode_desc_t kOpcodeTableEntries[] = {
{"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},
@@ -735,5 +765,15 @@ static const spv_opcode_desc_t kOpcodeTableEntries[] = {
{"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}
+ {"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}
}; \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc
index 9b7aba927cb..4e60e7cc04f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/enum_string_mapping.inc
@@ -10,6 +10,8 @@ const char* ExtensionToString(Extension extension) {
return "SPV_AMD_gpu_shader_int16";
case Extension::kSPV_AMD_shader_ballot:
return "SPV_AMD_shader_ballot";
+ case Extension::kSPV_AMD_shader_early_and_late_fragment_tests:
+ return "SPV_AMD_shader_early_and_late_fragment_tests";
case Extension::kSPV_AMD_shader_explicit_vertex_parameter:
return "SPV_AMD_shader_explicit_vertex_parameter";
case Extension::kSPV_AMD_shader_fragment_mask:
@@ -20,6 +22,8 @@ const char* ExtensionToString(Extension extension) {
return "SPV_AMD_shader_trinary_minmax";
case Extension::kSPV_AMD_texture_gather_bias_lod:
return "SPV_AMD_texture_gather_bias_lod";
+ case Extension::kSPV_ARM_core_builtins:
+ return "SPV_ARM_core_builtins";
case Extension::kSPV_EXT_demote_to_helper_invocation:
return "SPV_EXT_demote_to_helper_invocation";
case Extension::kSPV_EXT_descriptor_indexing:
@@ -30,6 +34,10 @@ const char* ExtensionToString(Extension extension) {
return "SPV_EXT_fragment_invocation_density";
case Extension::kSPV_EXT_fragment_shader_interlock:
return "SPV_EXT_fragment_shader_interlock";
+ case Extension::kSPV_EXT_mesh_shader:
+ return "SPV_EXT_mesh_shader";
+ case Extension::kSPV_EXT_opacity_micromap:
+ return "SPV_EXT_opacity_micromap";
case Extension::kSPV_EXT_physical_storage_buffer:
return "SPV_EXT_physical_storage_buffer";
case Extension::kSPV_EXT_shader_atomic_float16_add:
@@ -92,10 +100,14 @@ const char* ExtensionToString(Extension extension) {
return "SPV_INTEL_loop_fuse";
case Extension::kSPV_INTEL_media_block_io:
return "SPV_INTEL_media_block_io";
+ case Extension::kSPV_INTEL_memory_access_aliasing:
+ return "SPV_INTEL_memory_access_aliasing";
case Extension::kSPV_INTEL_optnone:
return "SPV_INTEL_optnone";
case Extension::kSPV_INTEL_shader_integer_functions2:
return "SPV_INTEL_shader_integer_functions2";
+ case Extension::kSPV_INTEL_split_barrier:
+ return "SPV_INTEL_split_barrier";
case Extension::kSPV_INTEL_subgroups:
return "SPV_INTEL_subgroups";
case Extension::kSPV_INTEL_unstructured_loop_controls:
@@ -118,6 +130,8 @@ const char* ExtensionToString(Extension extension) {
return "SPV_KHR_expect_assume";
case Extension::kSPV_KHR_float_controls:
return "SPV_KHR_float_controls";
+ case Extension::kSPV_KHR_fragment_shader_barycentric:
+ return "SPV_KHR_fragment_shader_barycentric";
case Extension::kSPV_KHR_fragment_shading_rate:
return "SPV_KHR_fragment_shading_rate";
case Extension::kSPV_KHR_integer_dot_product:
@@ -134,6 +148,8 @@ const char* ExtensionToString(Extension extension) {
return "SPV_KHR_physical_storage_buffer";
case Extension::kSPV_KHR_post_depth_coverage:
return "SPV_KHR_post_depth_coverage";
+ case Extension::kSPV_KHR_ray_cull_mask:
+ return "SPV_KHR_ray_cull_mask";
case Extension::kSPV_KHR_ray_query:
return "SPV_KHR_ray_query";
case Extension::kSPV_KHR_ray_tracing:
@@ -148,12 +164,16 @@ const char* ExtensionToString(Extension extension) {
return "SPV_KHR_shader_draw_parameters";
case Extension::kSPV_KHR_storage_buffer_storage_class:
return "SPV_KHR_storage_buffer_storage_class";
+ case Extension::kSPV_KHR_subgroup_rotate:
+ return "SPV_KHR_subgroup_rotate";
case Extension::kSPV_KHR_subgroup_uniform_control_flow:
return "SPV_KHR_subgroup_uniform_control_flow";
case Extension::kSPV_KHR_subgroup_vote:
return "SPV_KHR_subgroup_vote";
case Extension::kSPV_KHR_terminate_invocation:
return "SPV_KHR_terminate_invocation";
+ case Extension::kSPV_KHR_uniform_group_instructions:
+ return "SPV_KHR_uniform_group_instructions";
case Extension::kSPV_KHR_variable_pointers:
return "SPV_KHR_variable_pointers";
case Extension::kSPV_KHR_vulkan_memory_model:
@@ -162,6 +182,8 @@ const char* ExtensionToString(Extension extension) {
return "SPV_KHR_workgroup_memory_explicit_layout";
case Extension::kSPV_NVX_multiview_per_view_attributes:
return "SPV_NVX_multiview_per_view_attributes";
+ case Extension::kSPV_NV_bindless_texture:
+ return "SPV_NV_bindless_texture";
case Extension::kSPV_NV_compute_shader_derivatives:
return "SPV_NV_compute_shader_derivatives";
case Extension::kSPV_NV_cooperative_matrix:
@@ -199,8 +221,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_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_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_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_optnone", "SPV_INTEL_shader_integer_functions2", "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_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_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_uniform_control_flow", "SPV_KHR_subgroup_vote", "SPV_KHR_terminate_invocation", "SPV_KHR_variable_pointers", "SPV_KHR_vulkan_memory_model", "SPV_KHR_workgroup_memory_explicit_layout", "SPV_NVX_multiview_per_view_attributes", "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_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_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_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_optnone, Extension::kSPV_INTEL_shader_integer_functions2, 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_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_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_uniform_control_flow, Extension::kSPV_KHR_subgroup_vote, Extension::kSPV_KHR_terminate_invocation, 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_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_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 };
const auto b = std::begin(known_ext_strs);
const auto e = std::end(known_ext_strs);
const auto found = std::equal_range(
@@ -354,6 +376,10 @@ const char* CapabilityToString(SpvCapability capability) {
return "ShaderLayer";
case SpvCapabilityShaderViewportIndex:
return "ShaderViewportIndex";
+ case SpvCapabilityUniformDecoration:
+ return "UniformDecoration";
+ case SpvCapabilityCoreBuiltinsARM:
+ return "CoreBuiltinsARM";
case SpvCapabilityFragmentShadingRateKHR:
return "FragmentShadingRateKHR";
case SpvCapabilitySubgroupBallotKHR:
@@ -444,8 +470,10 @@ const char* CapabilityToString(SpvCapability capability) {
return "MeshShadingNV";
case SpvCapabilityImageFootprintNV:
return "ImageFootprintNV";
- case SpvCapabilityFragmentBarycentricNV:
- return "FragmentBarycentricNV";
+ case SpvCapabilityMeshShadingEXT:
+ return "MeshShadingEXT";
+ case SpvCapabilityFragmentBarycentricKHR:
+ return "FragmentBarycentricKHR";
case SpvCapabilityComputeDerivativeGroupQuadsNV:
return "ComputeDerivativeGroupQuadsNV";
case SpvCapabilityFragmentDensityEXT:
@@ -500,8 +528,12 @@ const char* CapabilityToString(SpvCapability capability) {
return "ShaderSMBuiltinsNV";
case SpvCapabilityFragmentShaderPixelInterlockEXT:
return "FragmentShaderPixelInterlockEXT";
- case SpvCapabilityDemoteToHelperInvocationEXT:
- return "DemoteToHelperInvocationEXT";
+ case SpvCapabilityDemoteToHelperInvocation:
+ return "DemoteToHelperInvocation";
+ case SpvCapabilityRayTracingOpacityMicromapEXT:
+ return "RayTracingOpacityMicromapEXT";
+ case SpvCapabilityBindlessTextureNV:
+ return "BindlessTextureNV";
case SpvCapabilitySubgroupShuffleINTEL:
return "SubgroupShuffleINTEL";
case SpvCapabilitySubgroupBufferBlockIOINTEL:
@@ -566,6 +598,8 @@ const char* CapabilityToString(SpvCapability capability) {
return "FPGAClusterAttributesINTEL";
case SpvCapabilityLoopFuseINTEL:
return "LoopFuseINTEL";
+ case SpvCapabilityMemoryAccessAliasingINTEL:
+ return "MemoryAccessAliasingINTEL";
case SpvCapabilityFPGABufferLocationINTEL:
return "FPGABufferLocationINTEL";
case SpvCapabilityArbitraryPrecisionFixedPointINTEL:
@@ -578,16 +612,20 @@ const char* CapabilityToString(SpvCapability capability) {
return "BlockingPipesINTEL";
case SpvCapabilityFPGARegINTEL:
return "FPGARegINTEL";
- case SpvCapabilityDotProductInputAllKHR:
- return "DotProductInputAllKHR";
- case SpvCapabilityDotProductInput4x8BitKHR:
- return "DotProductInput4x8BitKHR";
- case SpvCapabilityDotProductInput4x8BitPackedKHR:
- return "DotProductInput4x8BitPackedKHR";
- case SpvCapabilityDotProductKHR:
- return "DotProductKHR";
+ case SpvCapabilityDotProductInputAll:
+ return "DotProductInputAll";
+ case SpvCapabilityDotProductInput4x8Bit:
+ return "DotProductInput4x8Bit";
+ case SpvCapabilityDotProductInput4x8BitPacked:
+ return "DotProductInput4x8BitPacked";
+ case SpvCapabilityDotProduct:
+ return "DotProduct";
+ case SpvCapabilityRayCullMaskKHR:
+ return "RayCullMaskKHR";
case SpvCapabilityBitInstructions:
return "BitInstructions";
+ case SpvCapabilityGroupNonUniformRotateKHR:
+ return "GroupNonUniformRotateKHR";
case SpvCapabilityAtomicFloat32AddEXT:
return "AtomicFloat32AddEXT";
case SpvCapabilityAtomicFloat64AddEXT:
@@ -600,6 +638,10 @@ const char* CapabilityToString(SpvCapability capability) {
return "AtomicFloat16AddEXT";
case SpvCapabilityDebugInfoModuleINTEL:
return "DebugInfoModuleINTEL";
+ case SpvCapabilitySplitBarrierINTEL:
+ return "SplitBarrierINTEL";
+ case SpvCapabilityGroupUniformArithmeticKHR:
+ return "GroupUniformArithmeticKHR";
case SpvCapabilityMax:
assert(0 && "Attempting to convert SpvCapabilityMax to string");
return "";
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/extension_enum.inc b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/extension_enum.inc
index 8499ab6fabb..5597f09a695 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/extension_enum.inc
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/extension_enum.inc
@@ -3,16 +3,20 @@ kSPV_AMD_gpu_shader_half_float,
kSPV_AMD_gpu_shader_half_float_fetch,
kSPV_AMD_gpu_shader_int16,
kSPV_AMD_shader_ballot,
+kSPV_AMD_shader_early_and_late_fragment_tests,
kSPV_AMD_shader_explicit_vertex_parameter,
kSPV_AMD_shader_fragment_mask,
kSPV_AMD_shader_image_load_store_lod,
kSPV_AMD_shader_trinary_minmax,
kSPV_AMD_texture_gather_bias_lod,
+kSPV_ARM_core_builtins,
kSPV_EXT_demote_to_helper_invocation,
kSPV_EXT_descriptor_indexing,
kSPV_EXT_fragment_fully_covered,
kSPV_EXT_fragment_invocation_density,
kSPV_EXT_fragment_shader_interlock,
+kSPV_EXT_mesh_shader,
+kSPV_EXT_opacity_micromap,
kSPV_EXT_physical_storage_buffer,
kSPV_EXT_shader_atomic_float16_add,
kSPV_EXT_shader_atomic_float_add,
@@ -44,8 +48,10 @@ kSPV_INTEL_kernel_attributes,
kSPV_INTEL_long_constant_composite,
kSPV_INTEL_loop_fuse,
kSPV_INTEL_media_block_io,
+kSPV_INTEL_memory_access_aliasing,
kSPV_INTEL_optnone,
kSPV_INTEL_shader_integer_functions2,
+kSPV_INTEL_split_barrier,
kSPV_INTEL_subgroups,
kSPV_INTEL_unstructured_loop_controls,
kSPV_INTEL_usm_storage_classes,
@@ -57,6 +63,7 @@ kSPV_KHR_bit_instructions,
kSPV_KHR_device_group,
kSPV_KHR_expect_assume,
kSPV_KHR_float_controls,
+kSPV_KHR_fragment_shader_barycentric,
kSPV_KHR_fragment_shading_rate,
kSPV_KHR_integer_dot_product,
kSPV_KHR_linkonce_odr,
@@ -65,6 +72,7 @@ kSPV_KHR_no_integer_wrap_decoration,
kSPV_KHR_non_semantic_info,
kSPV_KHR_physical_storage_buffer,
kSPV_KHR_post_depth_coverage,
+kSPV_KHR_ray_cull_mask,
kSPV_KHR_ray_query,
kSPV_KHR_ray_tracing,
kSPV_KHR_shader_atomic_counter_ops,
@@ -72,13 +80,16 @@ kSPV_KHR_shader_ballot,
kSPV_KHR_shader_clock,
kSPV_KHR_shader_draw_parameters,
kSPV_KHR_storage_buffer_storage_class,
+kSPV_KHR_subgroup_rotate,
kSPV_KHR_subgroup_uniform_control_flow,
kSPV_KHR_subgroup_vote,
kSPV_KHR_terminate_invocation,
+kSPV_KHR_uniform_group_instructions,
kSPV_KHR_variable_pointers,
kSPV_KHR_vulkan_memory_model,
kSPV_KHR_workgroup_memory_explicit_layout,
kSPV_NVX_multiview_per_view_attributes,
+kSPV_NV_bindless_texture,
kSPV_NV_compute_shader_derivatives,
kSPV_NV_cooperative_matrix,
kSPV_NV_fragment_shader_barycentric,
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/generators.inc b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/generators.inc
index 91fc0922ea6..a0ff5fefbed 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/generators.inc
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/generators.inc
@@ -28,4 +28,9 @@
{27, "Embark Studios", "Rust GPU Compiler Backend", "Embark Studios Rust GPU Compiler Backend"},
{28, "gfx-rs community", "Naga", "gfx-rs community Naga"},
{29, "Mikkosoft Productions", "MSP Shader Compiler", "Mikkosoft Productions MSP Shader Compiler"},
-{30, "SpvGenTwo community", "SpvGenTwo SPIR-V IR Tools", "SpvGenTwo community SpvGenTwo SPIR-V IR Tools"}, \ No newline at end of file
+{30, "SpvGenTwo community", "SpvGenTwo SPIR-V IR Tools", "SpvGenTwo community SpvGenTwo SPIR-V IR Tools"},
+{31, "Google", "Skia SkSL", "Google Skia SkSL"},
+{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
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/nonsemantic.clspvreflection.insts.inc b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/nonsemantic.clspvreflection.insts.inc
index 4f559f6aeb1..c3e38dd4c7b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/nonsemantic.clspvreflection.insts.inc
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/nonsemantic.clspvreflection.insts.inc
@@ -24,5 +24,16 @@ static const spv_ext_inst_desc_t nonsemantic_clspvreflection_entries[] = {
{"ConstantDataStorageBuffer", 21, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}},
{"ConstantDataUniform", 22, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}},
{"LiteralSampler", 23, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}},
- {"PropertyRequiredWorkgroupSize", 24, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}}
+ {"PropertyRequiredWorkgroupSize", 24, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}},
+ {"SpecConstantSubgroupMaxSize", 25, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}},
+ {"ArgumentPointerPushConstant", 26, 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}},
+ {"ArgumentPointerUniform", 27, 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_OPTIONAL_ID, SPV_OPERAND_TYPE_NONE}},
+ {"ProgramScopeVariablesStorageBuffer", 28, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}},
+ {"ProgramScopeVariablePointerRelocation", 29, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}},
+ {"ImageArgumentInfoChannelOrderPushConstant", 30, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}},
+ {"ImageArgumentInfoChannelDataTypePushConstant", 31, 0, nullptr, {SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_ID, SPV_OPERAND_TYPE_NONE}},
+ {"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}}
}; \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc
index 408e379c2ad..543a6e99ff2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/include/generated/operand.kinds-unified1.inc
@@ -2,16 +2,18 @@ static const SpvCapability pygen_variable_caps_Addresses[] = {SpvCapabilityAddre
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_DrawParametersMeshShadingNV[] = {SpvCapabilityDrawParameters, SpvCapabilityMeshShadingNV};
+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};
@@ -19,7 +21,7 @@ static const SpvCapability pygen_variable_caps_FPGAKernelAttributesINTEL[] = {Sp
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_FragmentBarycentricNV[] = {SpvCapabilityFragmentBarycentricNV};
+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};
@@ -30,11 +32,11 @@ static const SpvCapability pygen_variable_caps_FunctionFloatControlINTEL[] = {Sp
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_GeometryMeshShadingNV[] = {SpvCapabilityGeometry, SpvCapabilityMeshShadingNV};
-static const SpvCapability pygen_variable_caps_GeometryShaderLayerShaderViewportIndexLayerEXTMeshShadingNV[] = {SpvCapabilityGeometry, SpvCapabilityShaderLayer, SpvCapabilityShaderViewportIndexLayerEXT, SpvCapabilityMeshShadingNV};
+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_GeometryTessellationMeshShadingNV[] = {SpvCapabilityGeometry, SpvCapabilityTessellation, SpvCapabilityMeshShadingNV};
-static const SpvCapability pygen_variable_caps_GeometryTessellationRayTracingNVRayTracingKHRMeshShadingNV[] = {SpvCapabilityGeometry, SpvCapabilityTessellation, SpvCapabilityRayTracingNV, SpvCapabilityRayTracingKHR, SpvCapabilityMeshShadingNV};
+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};
@@ -59,21 +61,26 @@ static const SpvCapability pygen_variable_caps_KernelAttributesINTEL[] = {SpvCap
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_MultiViewportShaderViewportIndexShaderViewportIndexLayerEXTMeshShadingNV[] = {SpvCapabilityMultiViewport, SpvCapabilityShaderViewportIndex, SpvCapabilityShaderViewportIndexLayerEXT, SpvCapabilityMeshShadingNV};
+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};
@@ -93,6 +100,7 @@ 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};
@@ -119,15 +127,22 @@ static const SpvCapability pygen_variable_caps_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};
+static const spvtools::Extension pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_tests[] = {spvtools::Extension::kSPV_AMD_shader_early_and_late_fragment_tests};
+static const spvtools::Extension pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export[] = {spvtools::Extension::kSPV_AMD_shader_early_and_late_fragment_tests, spvtools::Extension::kSPV_EXT_shader_stencil_export};
static const spvtools::Extension pygen_variable_exts_SPV_AMD_shader_explicit_vertex_parameter[] = {spvtools::Extension::kSPV_AMD_shader_explicit_vertex_parameter};
static const spvtools::Extension pygen_variable_exts_SPV_AMD_shader_fragment_mask[] = {spvtools::Extension::kSPV_AMD_shader_fragment_mask};
static const spvtools::Extension pygen_variable_exts_SPV_AMD_shader_image_load_store_lod[] = {spvtools::Extension::kSPV_AMD_shader_image_load_store_lod};
static const spvtools::Extension pygen_variable_exts_SPV_AMD_texture_gather_bias_lod[] = {spvtools::Extension::kSPV_AMD_texture_gather_bias_lod};
+static const spvtools::Extension pygen_variable_exts_SPV_ARM_core_builtins[] = {spvtools::Extension::kSPV_ARM_core_builtins};
static const spvtools::Extension pygen_variable_exts_SPV_EXT_demote_to_helper_invocation[] = {spvtools::Extension::kSPV_EXT_demote_to_helper_invocation};
static const spvtools::Extension pygen_variable_exts_SPV_EXT_descriptor_indexing[] = {spvtools::Extension::kSPV_EXT_descriptor_indexing};
static const spvtools::Extension pygen_variable_exts_SPV_EXT_fragment_fully_covered[] = {spvtools::Extension::kSPV_EXT_fragment_fully_covered};
static const spvtools::Extension pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate[] = {spvtools::Extension::kSPV_EXT_fragment_invocation_density, spvtools::Extension::kSPV_NV_shading_rate};
static const spvtools::Extension pygen_variable_exts_SPV_EXT_fragment_shader_interlock[] = {spvtools::Extension::kSPV_EXT_fragment_shader_interlock};
+static const spvtools::Extension pygen_variable_exts_SPV_EXT_mesh_shader[] = {spvtools::Extension::kSPV_EXT_mesh_shader};
+static const spvtools::Extension pygen_variable_exts_SPV_EXT_mesh_shaderSPV_KHR_shader_draw_parametersSPV_NV_mesh_shader[] = {spvtools::Extension::kSPV_EXT_mesh_shader, spvtools::Extension::kSPV_KHR_shader_draw_parameters, spvtools::Extension::kSPV_NV_mesh_shader};
+static const spvtools::Extension pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader[] = {spvtools::Extension::kSPV_EXT_mesh_shader, spvtools::Extension::kSPV_NV_mesh_shader};
+static const spvtools::Extension pygen_variable_exts_SPV_EXT_opacity_micromap[] = {spvtools::Extension::kSPV_EXT_opacity_micromap};
static const spvtools::Extension pygen_variable_exts_SPV_EXT_physical_storage_bufferSPV_KHR_physical_storage_buffer[] = {spvtools::Extension::kSPV_EXT_physical_storage_buffer, spvtools::Extension::kSPV_KHR_physical_storage_buffer};
static const spvtools::Extension pygen_variable_exts_SPV_EXT_shader_atomic_float16_add[] = {spvtools::Extension::kSPV_EXT_shader_atomic_float16_add};
static const spvtools::Extension pygen_variable_exts_SPV_EXT_shader_atomic_float_add[] = {spvtools::Extension::kSPV_EXT_shader_atomic_float_add};
@@ -158,8 +173,10 @@ static const spvtools::Extension pygen_variable_exts_SPV_INTEL_kernel_attributes
static const spvtools::Extension pygen_variable_exts_SPV_INTEL_long_constant_composite[] = {spvtools::Extension::kSPV_INTEL_long_constant_composite};
static const spvtools::Extension pygen_variable_exts_SPV_INTEL_loop_fuse[] = {spvtools::Extension::kSPV_INTEL_loop_fuse};
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_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};
static const spvtools::Extension pygen_variable_exts_SPV_INTEL_unstructured_loop_controls[] = {spvtools::Extension::kSPV_INTEL_unstructured_loop_controls};
static const spvtools::Extension pygen_variable_exts_SPV_INTEL_usm_storage_classes[] = {spvtools::Extension::kSPV_INTEL_usm_storage_classes};
@@ -171,12 +188,14 @@ static const spvtools::Extension pygen_variable_exts_SPV_KHR_bit_instructions[]
static const spvtools::Extension pygen_variable_exts_SPV_KHR_device_group[] = {spvtools::Extension::kSPV_KHR_device_group};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_expect_assume[] = {spvtools::Extension::kSPV_KHR_expect_assume};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_float_controls[] = {spvtools::Extension::kSPV_KHR_float_controls};
+static const spvtools::Extension pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric[] = {spvtools::Extension::kSPV_KHR_fragment_shader_barycentric, spvtools::Extension::kSPV_NV_fragment_shader_barycentric};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_fragment_shading_rate[] = {spvtools::Extension::kSPV_KHR_fragment_shading_rate};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_integer_dot_product[] = {spvtools::Extension::kSPV_KHR_integer_dot_product};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_linkonce_odr[] = {spvtools::Extension::kSPV_KHR_linkonce_odr};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_multiview[] = {spvtools::Extension::kSPV_KHR_multiview};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_no_integer_wrap_decoration[] = {spvtools::Extension::kSPV_KHR_no_integer_wrap_decoration};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_post_depth_coverage[] = {spvtools::Extension::kSPV_KHR_post_depth_coverage};
+static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_cull_mask[] = {spvtools::Extension::kSPV_KHR_ray_cull_mask};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_ray_query[] = {spvtools::Extension::kSPV_KHR_ray_query};
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};
@@ -185,18 +204,19 @@ static const spvtools::Extension pygen_variable_exts_SPV_KHR_shader_atomic_count
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_shader_draw_parameters[] = {spvtools::Extension::kSPV_KHR_shader_draw_parameters};
-static const spvtools::Extension pygen_variable_exts_SPV_KHR_shader_draw_parametersSPV_NV_mesh_shader[] = {spvtools::Extension::kSPV_KHR_shader_draw_parameters, spvtools::Extension::kSPV_NV_mesh_shader};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_storage_buffer_storage_classSPV_KHR_variable_pointers[] = {spvtools::Extension::kSPV_KHR_storage_buffer_storage_class, spvtools::Extension::kSPV_KHR_variable_pointers};
+static const spvtools::Extension pygen_variable_exts_SPV_KHR_subgroup_rotate[] = {spvtools::Extension::kSPV_KHR_subgroup_rotate};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_subgroup_uniform_control_flow[] = {spvtools::Extension::kSPV_KHR_subgroup_uniform_control_flow};
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_uniform_group_instructions[] = {spvtools::Extension::kSPV_KHR_uniform_group_instructions};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_variable_pointers[] = {spvtools::Extension::kSPV_KHR_variable_pointers};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_vulkan_memory_model[] = {spvtools::Extension::kSPV_KHR_vulkan_memory_model};
static const spvtools::Extension pygen_variable_exts_SPV_KHR_workgroup_memory_explicit_layout[] = {spvtools::Extension::kSPV_KHR_workgroup_memory_explicit_layout};
static const spvtools::Extension pygen_variable_exts_SPV_NVX_multiview_per_view_attributes[] = {spvtools::Extension::kSPV_NVX_multiview_per_view_attributes};
static const spvtools::Extension pygen_variable_exts_SPV_NVX_multiview_per_view_attributesSPV_NV_mesh_shader[] = {spvtools::Extension::kSPV_NVX_multiview_per_view_attributes, spvtools::Extension::kSPV_NV_mesh_shader};
+static const spvtools::Extension pygen_variable_exts_SPV_NV_bindless_texture[] = {spvtools::Extension::kSPV_NV_bindless_texture};
static const spvtools::Extension pygen_variable_exts_SPV_NV_compute_shader_derivatives[] = {spvtools::Extension::kSPV_NV_compute_shader_derivatives};
static const spvtools::Extension pygen_variable_exts_SPV_NV_cooperative_matrix[] = {spvtools::Extension::kSPV_NV_cooperative_matrix};
-static const spvtools::Extension pygen_variable_exts_SPV_NV_fragment_shader_barycentric[] = {spvtools::Extension::kSPV_NV_fragment_shader_barycentric};
static const spvtools::Extension pygen_variable_exts_SPV_NV_geometry_shader_passthrough[] = {spvtools::Extension::kSPV_NV_geometry_shader_passthrough};
static const spvtools::Extension pygen_variable_exts_SPV_NV_mesh_shader[] = {spvtools::Extension::kSPV_NV_mesh_shader};
static const spvtools::Extension pygen_variable_exts_SPV_NV_mesh_shaderSPV_NV_viewport_array2[] = {spvtools::Extension::kSPV_NV_mesh_shader, spvtools::Extension::kSPV_NV_viewport_array2};
@@ -228,7 +248,9 @@ static const spv_operand_desc_t pygen_variable_ImageOperandsEntries[] = {
{"VolatileTexel", 0x0800, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu},
{"VolatileTexelKHR", 0x0800, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu},
{"SignExtend", 0x1000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu},
- {"ZeroExtend", 0x2000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu}
+ {"ZeroExtend", 0x2000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu},
+ {"Nontemporal", 0x4000, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu},
+ {"Offsets", 0x10000, 0, nullptr, 0, nullptr, {SPV_OPERAND_TYPE_ID}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}
};
static const spv_operand_desc_t pygen_variable_FPFastMathModeEntries[] = {
@@ -310,7 +332,9 @@ static const spv_operand_desc_t pygen_variable_MemoryAccessEntries[] = {
{"MakePointerVisible", 0x0010, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu},
{"MakePointerVisibleKHR", 0x0010, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu},
{"NonPrivatePointer", 0x0020, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu},
- {"NonPrivatePointerKHR", 0x0020, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu}
+ {"NonPrivatePointerKHR", 0x0020, 1, pygen_variable_caps_VulkanMemoryModel, 1, pygen_variable_exts_SPV_KHR_vulkan_memory_model, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu},
+ {"AliasScopeINTELMask", 0x10000, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu},
+ {"NoAliasINTELMask", 0x20000, 1, pygen_variable_caps_MemoryAccessAliasingINTEL, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, {SPV_OPERAND_TYPE_ID}, 0xffffffffu, 0xffffffffu}
};
static const spv_operand_desc_t pygen_variable_KernelProfilingInfoEntries[] = {
@@ -329,7 +353,8 @@ static const spv_operand_desc_t pygen_variable_RayFlagsEntries[] = {
{"CullOpaqueKHR", 0x0040, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu},
{"CullNoOpaqueKHR", 0x0080, 2, pygen_variable_caps_RayQueryKHRRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu},
{"SkipTrianglesKHR", 0x0100, 1, pygen_variable_caps_RayTraversalPrimitiveCullingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu},
- {"SkipAABBsKHR", 0x0200, 1, pygen_variable_caps_RayTraversalPrimitiveCullingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}
+ {"SkipAABBsKHR", 0x0200, 1, pygen_variable_caps_RayTraversalPrimitiveCullingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu},
+ {"ForceOpacityMicromap2StateEXT", 0x0400, 1, pygen_variable_caps_RayTracingOpacityMicromapEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}
};
static const spv_operand_desc_t pygen_variable_FragmentShadingRateEntries[] = {
@@ -346,7 +371,8 @@ static const spv_operand_desc_t pygen_variable_SourceLanguageEntries[] = {
{"OpenCL_C", 3, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"OpenCL_CPP", 4, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"HLSL", 5, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
- {"CPP_for_OpenCL", 6, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}
+ {"CPP_for_OpenCL", 6, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
+ {"SYCL", 7, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu}
};
static const spv_operand_desc_t pygen_variable_ExecutionModelEntries[] = {
@@ -370,7 +396,9 @@ static const spv_operand_desc_t pygen_variable_ExecutionModelEntries[] = {
{"MissNV", 5317, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu},
{"MissKHR", 5317, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu},
{"CallableNV", 5318, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu},
- {"CallableKHR", 5318, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}
+ {"CallableKHR", 5318, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 0, nullptr, {}, 0xffffffffu, 0xffffffffu},
+ {"TaskEXT", 5364, 1, pygen_variable_caps_MeshShadingEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu},
+ {"MeshEXT", 5365, 1, pygen_variable_caps_MeshShadingEXT, 0, nullptr, {}, 0xffffffffu, 0xffffffffu}
};
static const spv_operand_desc_t pygen_variable_AddressingModelEntries[] = {
@@ -415,8 +443,8 @@ static const spv_operand_desc_t pygen_variable_ExecutionModeEntries[] = {
{"InputTrianglesAdjacency", 23, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"Quads", 24, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"Isolines", 25, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
- {"OutputVertices", 26, 3, pygen_variable_caps_GeometryTessellationMeshShadingNV, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
- {"OutputPoints", 27, 2, pygen_variable_caps_GeometryMeshShadingNV, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
+ {"OutputVertices", 26, 4, pygen_variable_caps_GeometryTessellationMeshShadingNVMeshShadingEXT, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
+ {"OutputPoints", 27, 3, pygen_variable_caps_GeometryMeshShadingNVMeshShadingEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"OutputLineStrip", 28, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"OutputTriangleStrip", 29, 1, pygen_variable_caps_Geometry, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"VecTypeHint", 30, 1, pygen_variable_caps_Kernel, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
@@ -435,12 +463,22 @@ static const spv_operand_desc_t pygen_variable_ExecutionModeEntries[] = {
{"SignedZeroInfNanPreserve", 4461, 1, pygen_variable_caps_SignedZeroInfNanPreserve, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu},
{"RoundingModeRTE", 4462, 1, pygen_variable_caps_RoundingModeRTE, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu},
{"RoundingModeRTZ", 4463, 1, pygen_variable_caps_RoundingModeRTZ, 1, pygen_variable_exts_SPV_KHR_float_controls, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu},
+ {"EarlyAndLateFragmentTestsAMD", 5017, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_tests, {}, 0xffffffffu, 0xffffffffu},
{"StencilRefReplacingEXT", 5027, 1, pygen_variable_caps_StencilExportEXT, 1, pygen_variable_exts_SPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu},
- {"OutputLinesNV", 5269, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
- {"OutputPrimitivesNV", 5270, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu},
+ {"StencilRefUnchangedFrontAMD", 5079, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu},
+ {"StencilRefGreaterFrontAMD", 5080, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu},
+ {"StencilRefLessFrontAMD", 5081, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu},
+ {"StencilRefUnchangedBackAMD", 5082, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu},
+ {"StencilRefGreaterBackAMD", 5083, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu},
+ {"StencilRefLessBackAMD", 5084, 1, pygen_variable_caps_StencilExportEXT, 2, pygen_variable_exts_SPV_AMD_shader_early_and_late_fragment_testsSPV_EXT_shader_stencil_export, {}, 0xffffffffu, 0xffffffffu},
+ {"OutputLinesNV", 5269, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
+ {"OutputLinesEXT", 5269, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
+ {"OutputPrimitivesNV", 5270, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu},
+ {"OutputPrimitivesEXT", 5270, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu},
{"DerivativeGroupQuadsNV", 5289, 1, pygen_variable_caps_ComputeDerivativeGroupQuadsNV, 1, pygen_variable_exts_SPV_NV_compute_shader_derivatives, {}, 0xffffffffu, 0xffffffffu},
{"DerivativeGroupLinearNV", 5290, 1, pygen_variable_caps_ComputeDerivativeGroupLinearNV, 1, pygen_variable_exts_SPV_NV_compute_shader_derivatives, {}, 0xffffffffu, 0xffffffffu},
- {"OutputTrianglesNV", 5298, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
+ {"OutputTrianglesNV", 5298, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
+ {"OutputTrianglesEXT", 5298, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
{"PixelInterlockOrderedEXT", 5366, 1, pygen_variable_caps_FragmentShaderPixelInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu},
{"PixelInterlockUnorderedEXT", 5367, 1, pygen_variable_caps_FragmentShaderPixelInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu},
{"SampleInterlockOrderedEXT", 5368, 1, pygen_variable_caps_FragmentShaderSampleInterlockEXT, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu},
@@ -456,7 +494,8 @@ static const spv_operand_desc_t pygen_variable_ExecutionModeEntries[] = {
{"MaxWorkDimINTEL", 5894, 1, pygen_variable_caps_KernelAttributesINTEL, 1, pygen_variable_exts_SPV_INTEL_kernel_attributes, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu},
{"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}
+ {"SchedulerTargetFmaxMhzINTEL", 5903, 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}
};
static const spv_operand_desc_t pygen_variable_StorageClassEntries[] = {
@@ -487,6 +526,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},
+ {"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},
{"HostOnlyINTEL", 5937, 1, pygen_variable_caps_USMStorageClassesINTEL, 1, pygen_variable_exts_SPV_INTEL_usm_storage_classes, {}, 0xffffffffu, 0xffffffffu}
@@ -687,8 +727,8 @@ static const spv_operand_desc_t pygen_variable_DecorationEntries[] = {
{"Coherent", 23, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"NonWritable", 24, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"NonReadable", 25, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
- {"Uniform", 26, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
- {"UniformId", 27, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu},
+ {"Uniform", 26, 2, pygen_variable_caps_ShaderUniformDecoration, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
+ {"UniformId", 27, 2, pygen_variable_caps_ShaderUniformDecoration, 0, nullptr, {SPV_OPERAND_TYPE_SCOPE_ID}, SPV_SPIRV_VERSION_WORD(1,4), 0xffffffffu},
{"SaturatedConversion", 28, 1, pygen_variable_caps_Kernel, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"Stream", 29, 1, pygen_variable_caps_GeometryStreams, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"Location", 30, 1, pygen_variable_caps_Shader, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
@@ -716,16 +756,22 @@ static const spv_operand_desc_t pygen_variable_DecorationEntries[] = {
{"PassthroughNV", 5250, 1, pygen_variable_caps_GeometryShaderPassthroughNV, 1, pygen_variable_exts_SPV_NV_geometry_shader_passthrough, {}, 0xffffffffu, 0xffffffffu},
{"ViewportRelativeNV", 5252, 1, pygen_variable_caps_ShaderViewportMaskNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu},
{"SecondaryViewportRelativeNV", 5256, 1, pygen_variable_caps_ShaderStereoViewNV, 1, pygen_variable_exts_SPV_NV_stereo_view_rendering, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu},
- {"PerPrimitiveNV", 5271, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
+ {"PerPrimitiveNV", 5271, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
+ {"PerPrimitiveEXT", 5271, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
{"PerViewNV", 5272, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
- {"PerTaskNV", 5273, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
- {"PerVertexNV", 5285, 1, pygen_variable_caps_FragmentBarycentricNV, 1, pygen_variable_exts_SPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu},
+ {"PerTaskNV", 5273, 2, pygen_variable_caps_MeshShadingNVMeshShadingEXT, 2, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
+ {"PerVertexKHR", 5285, 2, pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu},
+ {"PerVertexNV", 5285, 2, pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu},
{"NonUniform", 5300, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu},
{"NonUniformEXT", 5300, 1, pygen_variable_caps_ShaderNonUniform, 1, pygen_variable_exts_SPV_EXT_descriptor_indexing, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu},
{"RestrictPointer", 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},
{"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},
+ {"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},
+ {"BoundImageNV", 5401, 1, pygen_variable_caps_BindlessTextureNV, 0, nullptr, {}, 0xffffffffu, 0xffffffffu},
{"SIMTCallINTEL", 5599, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_INTEGER}, 0xffffffffu, 0xffffffffu},
{"ReferencedIndirectlyINTEL", 5602, 1, pygen_variable_caps_IndirectReferencesINTEL, 1, pygen_variable_exts_SPV_INTEL_function_pointers, {}, 0xffffffffu, 0xffffffffu},
{"ClobberINTEL", 5607, 1, pygen_variable_caps_AsmINTEL, 0, nullptr, {SPV_OPERAND_TYPE_LITERAL_STRING}, 0xffffffffu, 0xffffffffu},
@@ -760,11 +806,14 @@ 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},
+ {"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},
{"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},
{"SingleElementVectorINTEL", 6085, 1, pygen_variable_caps_VectorComputeINTEL, 0, nullptr, {}, 0xffffffffu, 0xffffffffu},
- {"VectorComputeCallableFunctionINTEL", 6087, 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}
};
static const spv_operand_desc_t pygen_variable_BuiltInEntries[] = {
@@ -774,10 +823,10 @@ static const spv_operand_desc_t pygen_variable_BuiltInEntries[] = {
{"CullDistance", 4, 1, pygen_variable_caps_CullDistance, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"VertexId", 5, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"InstanceId", 6, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
- {"PrimitiveId", 7, 5, pygen_variable_caps_GeometryTessellationRayTracingNVRayTracingKHRMeshShadingNV, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
+ {"PrimitiveId", 7, 6, pygen_variable_caps_GeometryTessellationRayTracingNVRayTracingKHRMeshShadingNVMeshShadingEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"InvocationId", 8, 2, pygen_variable_caps_GeometryTessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
- {"Layer", 9, 4, pygen_variable_caps_GeometryShaderLayerShaderViewportIndexLayerEXTMeshShadingNV, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
- {"ViewportIndex", 10, 4, pygen_variable_caps_MultiViewportShaderViewportIndexShaderViewportIndexLayerEXTMeshShadingNV, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
+ {"Layer", 9, 5, pygen_variable_caps_GeometryShaderLayerShaderViewportIndexLayerEXTMeshShadingNVMeshShadingEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
+ {"ViewportIndex", 10, 5, pygen_variable_caps_MultiViewportShaderViewportIndexShaderViewportIndexLayerEXTMeshShadingNVMeshShadingEXT, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"TessLevelOuter", 11, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"TessLevelInner", 12, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"TessCoord", 13, 1, pygen_variable_caps_Tessellation, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
@@ -809,6 +858,11 @@ static const spv_operand_desc_t pygen_variable_BuiltInEntries[] = {
{"SubgroupLocalInvocationId", 41, 3, pygen_variable_caps_KernelGroupNonUniformSubgroupBallotKHR, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"VertexIndex", 42, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"InstanceIndex", 43, 1, pygen_variable_caps_Shader, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
+ {"CoreIDARM", 4160, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
+ {"CoreCountARM", 4161, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
+ {"CoreMaxIDARM", 4162, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
+ {"WarpIDARM", 4163, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
+ {"WarpMaxIDARM", 4164, 1, pygen_variable_caps_CoreBuiltinsARM, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1, 0), 0xffffffffu},
{"SubgroupEqMask", 4416, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu},
{"SubgroupEqMaskKHR", 4416, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu},
{"SubgroupGeMask", 4417, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu},
@@ -821,7 +875,7 @@ static const spv_operand_desc_t pygen_variable_BuiltInEntries[] = {
{"SubgroupLtMaskKHR", 4420, 2, pygen_variable_caps_SubgroupBallotKHRGroupNonUniformBallot, 1, pygen_variable_exts_SPV_KHR_shader_ballot, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu},
{"BaseVertex", 4424, 1, pygen_variable_caps_DrawParameters, 1, pygen_variable_exts_SPV_KHR_shader_draw_parameters, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu},
{"BaseInstance", 4425, 1, pygen_variable_caps_DrawParameters, 1, pygen_variable_exts_SPV_KHR_shader_draw_parameters, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu},
- {"DrawIndex", 4426, 2, pygen_variable_caps_DrawParametersMeshShadingNV, 2, pygen_variable_exts_SPV_KHR_shader_draw_parametersSPV_NV_mesh_shader, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu},
+ {"DrawIndex", 4426, 3, pygen_variable_caps_DrawParametersMeshShadingNVMeshShadingEXT, 3, pygen_variable_exts_SPV_EXT_mesh_shaderSPV_KHR_shader_draw_parametersSPV_NV_mesh_shader, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu},
{"PrimitiveShadingRateKHR", 4432, 1, pygen_variable_caps_FragmentShadingRateKHR, 1, pygen_variable_exts_SPV_KHR_fragment_shading_rate, {}, 0xffffffffu, 0xffffffffu},
{"DeviceIndex", 4438, 1, pygen_variable_caps_DeviceGroup, 1, pygen_variable_exts_SPV_KHR_device_group, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu},
{"ViewIndex", 4440, 1, pygen_variable_caps_MultiView, 1, pygen_variable_exts_SPV_KHR_multiview, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu},
@@ -848,12 +902,18 @@ static const spv_operand_desc_t pygen_variable_BuiltInEntries[] = {
{"LayerPerViewNV", 5279, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
{"MeshViewCountNV", 5280, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
{"MeshViewIndicesNV", 5281, 1, pygen_variable_caps_MeshShadingNV, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
- {"BaryCoordNV", 5286, 1, pygen_variable_caps_FragmentBarycentricNV, 1, pygen_variable_exts_SPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu},
- {"BaryCoordNoPerspNV", 5287, 1, pygen_variable_caps_FragmentBarycentricNV, 1, pygen_variable_exts_SPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu},
+ {"BaryCoordKHR", 5286, 2, pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu},
+ {"BaryCoordNV", 5286, 2, pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu},
+ {"BaryCoordNoPerspKHR", 5287, 2, pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu},
+ {"BaryCoordNoPerspNV", 5287, 2, pygen_variable_caps_FragmentBarycentricNVFragmentBarycentricKHR, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu},
{"FragSizeEXT", 5292, 2, pygen_variable_caps_FragmentDensityEXTShadingRateNV, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu},
{"FragmentSizeNV", 5292, 2, pygen_variable_caps_ShadingRateNVFragmentDensityEXT, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu},
{"FragInvocationCountEXT", 5293, 2, pygen_variable_caps_FragmentDensityEXTShadingRateNV, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu},
{"InvocationsPerPixelNV", 5293, 2, pygen_variable_caps_ShadingRateNVFragmentDensityEXT, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu},
+ {"PrimitivePointIndicesEXT", 5294, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
+ {"PrimitiveLineIndicesEXT", 5295, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
+ {"PrimitiveTriangleIndicesEXT", 5296, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
+ {"CullPrimitiveEXT", 5299, 1, pygen_variable_caps_MeshShadingEXT, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
{"LaunchIdNV", 5319, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu},
{"LaunchIdKHR", 5319, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu},
{"LaunchSizeNV", 5320, 2, pygen_variable_caps_RayTracingNVRayTracingKHR, 2, pygen_variable_exts_SPV_KHR_ray_tracingSPV_NV_ray_tracing, {}, 0xffffffffu, 0xffffffffu},
@@ -886,7 +946,8 @@ static const spv_operand_desc_t pygen_variable_BuiltInEntries[] = {
{"WarpsPerSMNV", 5374, 1, pygen_variable_caps_ShaderSMBuiltinsNV, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu},
{"SMCountNV", 5375, 1, pygen_variable_caps_ShaderSMBuiltinsNV, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu},
{"WarpIDNV", 5376, 1, pygen_variable_caps_ShaderSMBuiltinsNV, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu},
- {"SMIDNV", 5377, 1, pygen_variable_caps_ShaderSMBuiltinsNV, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu}
+ {"SMIDNV", 5377, 1, pygen_variable_caps_ShaderSMBuiltinsNV, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu},
+ {"CullMaskKHR", 6021, 1, pygen_variable_caps_RayCullMaskKHR, 1, pygen_variable_exts_SPV_KHR_ray_cull_mask, {}, 0xffffffffu, 0xffffffffu}
};
static const spv_operand_desc_t pygen_variable_ScopeEntries[] = {
@@ -986,6 +1047,8 @@ static const spv_operand_desc_t pygen_variable_CapabilityEntries[] = {
{"GroupNonUniformQuad", 68, 1, pygen_variable_caps_GroupNonUniform, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,3), 0xffffffffu},
{"ShaderLayer", 69, 0, nullptr, 0, nullptr, {}, SPV_SPIRV_VERSION_WORD(1,5), 0xffffffffu},
{"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},
{"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},
@@ -1034,7 +1097,9 @@ static const spv_operand_desc_t pygen_variable_CapabilityEntries[] = {
{"FragmentFullyCoveredEXT", 5265, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_fragment_fully_covered, {}, 0xffffffffu, 0xffffffffu},
{"MeshShadingNV", 5266, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
{"ImageFootprintNV", 5282, 0, nullptr, 1, pygen_variable_exts_SPV_NV_shader_image_footprint, {}, 0xffffffffu, 0xffffffffu},
- {"FragmentBarycentricNV", 5284, 0, nullptr, 1, pygen_variable_exts_SPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu},
+ {"MeshShadingEXT", 5283, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_mesh_shader, {}, 0xffffffffu, 0xffffffffu},
+ {"FragmentBarycentricKHR", 5284, 0, nullptr, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu},
+ {"FragmentBarycentricNV", 5284, 0, nullptr, 2, pygen_variable_exts_SPV_KHR_fragment_shader_barycentricSPV_NV_fragment_shader_barycentric, {}, 0xffffffffu, 0xffffffffu},
{"ComputeDerivativeGroupQuadsNV", 5288, 0, nullptr, 1, pygen_variable_exts_SPV_NV_compute_shader_derivatives, {}, 0xffffffffu, 0xffffffffu},
{"FragmentDensityEXT", 5291, 1, pygen_variable_caps_Shader, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu},
{"ShadingRateNV", 5291, 1, pygen_variable_caps_Shader, 2, pygen_variable_exts_SPV_EXT_fragment_invocation_densitySPV_NV_shading_rate, {}, 0xffffffffu, 0xffffffffu},
@@ -1078,7 +1143,10 @@ static const spv_operand_desc_t pygen_variable_CapabilityEntries[] = {
{"FragmentShaderShadingRateInterlockEXT", 5372, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu},
{"ShaderSMBuiltinsNV", 5373, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_NV_shader_sm_builtins, {}, 0xffffffffu, 0xffffffffu},
{"FragmentShaderPixelInterlockEXT", 5378, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_fragment_shader_interlock, {}, 0xffffffffu, 0xffffffffu},
- {"DemoteToHelperInvocationEXT", 5379, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_demote_to_helper_invocation, {}, 0xffffffffu, 0xffffffffu},
+ {"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},
+ {"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},
{"SubgroupImageBlockIOINTEL", 5570, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_subgroups, {}, 0xffffffffu, 0xffffffffu},
@@ -1111,23 +1179,32 @@ 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},
+ {"MemoryAccessAliasingINTEL", 5910, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_memory_access_aliasing, {}, 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},
{"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},
- {"DotProductInputAllKHR", 6016, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, 0xffffffffu, 0xffffffffu},
- {"DotProductInput4x8BitKHR", 6017, 1, pygen_variable_caps_Int8, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, 0xffffffffu, 0xffffffffu},
- {"DotProductInput4x8BitPackedKHR", 6018, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, 0xffffffffu, 0xffffffffu},
- {"DotProductKHR", 6019, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, 0xffffffffu, 0xffffffffu},
+ {"DotProductInputAll", 6016, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu},
+ {"DotProductInputAllKHR", 6016, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu},
+ {"DotProductInput4x8Bit", 6017, 1, pygen_variable_caps_Int8, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu},
+ {"DotProductInput4x8BitKHR", 6017, 1, pygen_variable_caps_Int8, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu},
+ {"DotProductInput4x8BitPacked", 6018, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu},
+ {"DotProductInput4x8BitPackedKHR", 6018, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu},
+ {"DotProduct", 6019, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu},
+ {"DotProductKHR", 6019, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu},
+ {"RayCullMaskKHR", 6020, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_ray_cull_mask, {}, 0xffffffffu, 0xffffffffu},
{"BitInstructions", 6025, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_bit_instructions, {}, 0xffffffffu, 0xffffffffu},
- {"AtomicFloat32AddEXT", 6033, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_add, {}, 0xffffffffu, 0xffffffffu},
- {"AtomicFloat64AddEXT", 6034, 1, pygen_variable_caps_Shader, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_add, {}, 0xffffffffu, 0xffffffffu},
+ {"GroupNonUniformRotateKHR", 6026, 1, pygen_variable_caps_GroupNonUniform, 1, pygen_variable_exts_SPV_KHR_subgroup_rotate, {}, 0xffffffffu, 0xffffffffu},
+ {"AtomicFloat32AddEXT", 6033, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_add, {}, 0xffffffffu, 0xffffffffu},
+ {"AtomicFloat64AddEXT", 6034, 0, nullptr, 1, pygen_variable_exts_SPV_EXT_shader_atomic_float_add, {}, 0xffffffffu, 0xffffffffu},
{"LongConstantCompositeINTEL", 6089, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_long_constant_composite, {}, 0xffffffffu, 0xffffffffu},
{"OptNoneINTEL", 6094, 0, nullptr, 1, pygen_variable_exts_SPV_INTEL_optnone, {}, 0xffffffffu, 0xffffffffu},
- {"AtomicFloat16AddEXT", 6095, 1, pygen_variable_caps_Shader, 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}
+ {"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},
+ {"GroupUniformArithmeticKHR", 6400, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_uniform_group_instructions, {}, 0xffffffffu, 0xffffffffu}
};
static const spv_operand_desc_t pygen_variable_RayQueryIntersectionEntries[] = {
@@ -1147,7 +1224,8 @@ static const spv_operand_desc_t pygen_variable_RayQueryCandidateIntersectionType
};
static const spv_operand_desc_t pygen_variable_PackedVectorFormatEntries[] = {
- {"PackedVectorFormat4x8BitKHR", 0, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, 0xffffffffu, 0xffffffffu}
+ {"PackedVectorFormat4x8Bit", 0, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu},
+ {"PackedVectorFormat4x8BitKHR", 0, 0, nullptr, 1, pygen_variable_exts_SPV_KHR_integer_dot_product, {}, SPV_SPIRV_VERSION_WORD(1,6), 0xffffffffu}
};
static const spv_operand_desc_t pygen_variable_DebugInfoFlagsEntries[] = {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.h b/3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.h
index 981446b61a5..1643b5a9bfc 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.h
@@ -483,6 +483,7 @@ SPIRV_TOOLS_EXPORT const char* spvSoftwareVersionDetailsString(void);
// SPV_ENV_VULKAN_1_1 -> SPIR-V 1.3
// SPV_ENV_VULKAN_1_1_SPIRV_1_4 -> SPIR-V 1.4
// SPV_ENV_VULKAN_1_2 -> SPIR-V 1.5
+// SPV_ENV_VULKAN_1_3 -> SPIR-V 1.6
// Consult the description of API entry points for specific rules.
typedef enum {
SPV_ENV_UNIVERSAL_1_0, // SPIR-V 1.0 latest revision, no other restrictions.
@@ -517,6 +518,11 @@ typedef enum {
SPV_ENV_UNIVERSAL_1_5, // SPIR-V 1.5 latest revision, no other restrictions.
SPV_ENV_VULKAN_1_2, // Vulkan 1.2 latest revision.
+
+ SPV_ENV_UNIVERSAL_1_6, // SPIR-V 1.6 latest revision, no other restrictions.
+ SPV_ENV_VULKAN_1_3, // Vulkan 1.3 latest revision.
+
+ SPV_ENV_MAX // Keep this as the last enum value.
} spv_target_env;
// SPIR-V Validator can be parameterized with the following Universal Limits.
@@ -555,7 +561,7 @@ SPIRV_TOOLS_EXPORT bool spvParseVulkanEnv(uint32_t vulkan_ver,
// Creates a context object for most of the SPIRV-Tools API.
// Returns null if env is invalid.
//
-// See specific API calls for how the target environment is interpeted
+// See specific API calls for how the target environment is interpreted
// (particularly assembly and validation).
SPIRV_TOOLS_EXPORT spv_context spvContextCreate(spv_target_env env);
@@ -607,7 +613,7 @@ SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetRelaxLogicalPointer(
// set that option.
// 2) Pointers that are pass as parameters to function calls do not have to
// match the storage class of the formal parameter.
-// 3) Pointers that are actaul parameters on function calls do not have to point
+// 3) Pointers that are actual parameters on function calls do not have to point
// to the same type pointed as the formal parameter. The types just need to
// logically match.
// 4) GLSLstd450 Interpolate* instructions can have a load of an interpolant
@@ -633,7 +639,7 @@ SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetUniformBufferStandardLayout(
// Records whether the validator should use "scalar" block layout rules.
// Scalar layout rules are more permissive than relaxed block layout.
//
-// See Vulkan extnesion VK_EXT_scalar_block_layout. The scalar alignment is
+// See Vulkan extension VK_EXT_scalar_block_layout. The scalar alignment is
// defined as follows:
// - scalar alignment of a scalar is the scalar size
// - scalar alignment of a vector is the scalar alignment of its component
@@ -665,6 +671,10 @@ SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetSkipBlockLayout(
SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetAllowLocalSizeId(
spv_validator_options options, bool val);
+// Whether friendly names should be used in validation error messages.
+SPIRV_TOOLS_EXPORT void spvValidatorOptionsSetFriendlyNames(
+ spv_validator_options options, bool val);
+
// Creates an optimizer options object with default options. Returns a valid
// options object. The object remains valid until it is passed into
// |spvOptimizerOptionsDestroy|.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.hpp b/3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.hpp
index 8dfb46b7742..408e3ebb237 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/libspirv.hpp
@@ -36,7 +36,7 @@ class Context {
public:
// Constructs a context targeting the given environment |env|.
//
- // See specific API calls for how the target environment is interpeted
+ // See specific API calls for how the target environment is interpreted
// (particularly assembly and validation).
//
// The constructed instance will have an empty message consumer, which just
@@ -139,7 +139,7 @@ class ValidatorOptions {
// set that option.
// 2) Pointers that are pass as parameters to function calls do not have to
// match the storage class of the formal parameter.
- // 3) Pointers that are actaul parameters on function calls do not have to
+ // 3) Pointers that are actual parameters on function calls do not have to
// point to the same type pointed as the formal parameter. The types just
// need to logically match.
// 4) GLSLstd450 Interpolate* instructions can have a load of an interpolant
@@ -148,6 +148,11 @@ class ValidatorOptions {
spvValidatorOptionsSetBeforeHlslLegalization(options_, val);
}
+ // Whether friendly names should be used in validation error messages.
+ void SetFriendlyNames(bool val) {
+ spvValidatorOptionsSetFriendlyNames(options_, val);
+ }
+
private:
spv_validator_options options_;
};
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp b/3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp
index 42eb6442ec1..949735608db 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/include/spirv-tools/optimizer.hpp
@@ -43,7 +43,7 @@ class Optimizer {
// consumed by the RegisterPass() method. Tokens are one-time objects that
// only support move; copying is not allowed.
struct PassToken {
- struct Impl; // Opaque struct for holding inernal data.
+ struct Impl; // Opaque struct for holding internal data.
PassToken(std::unique_ptr<Impl>);
@@ -227,16 +227,17 @@ Optimizer::PassToken CreateNullPass();
// Creates a strip-debug-info pass.
// A strip-debug-info pass removes all debug instructions (as documented in
-// Section 3.32.2 of the SPIR-V spec) of the SPIR-V module to be optimized.
+// Section 3.42.2 of the SPIR-V spec) of the SPIR-V module to be optimized.
Optimizer::PassToken CreateStripDebugInfoPass();
-// Creates a strip-reflect-info pass.
-// A strip-reflect-info pass removes all reflections instructions.
-// For now, this is limited to removing decorations defined in
-// SPV_GOOGLE_hlsl_functionality1. The coverage may expand in
-// the future.
+// [Deprecated] This will create a strip-nonsemantic-info pass. See below.
Optimizer::PassToken CreateStripReflectInfoPass();
+// Creates a strip-nonsemantic-info pass.
+// A strip-nonsemantic-info pass removes all reflections and explicitly
+// non-semantic instructions.
+Optimizer::PassToken CreateStripNonSemanticInfoPass();
+
// Creates an eliminate-dead-functions pass.
// An eliminate-dead-functions pass will remove all functions that are not in
// the call trees rooted at entry points and exported functions. These
@@ -295,11 +296,11 @@ Optimizer::PassToken CreateFreezeSpecConstantValuePass();
// and can be changed in future. A spec constant is foldable if all of its
// value(s) can be determined from the module. E.g., an integer spec constant
// defined with OpSpecConstantOp instruction can be folded if its value won't
-// change later. This pass will replace the original OpSpecContantOp instruction
-// with an OpConstant instruction. When folding composite spec constants,
-// new instructions may be inserted to define the components of the composite
-// constant first, then the original spec constants will be replaced by
-// OpConstantComposite instructions.
+// change later. This pass will replace the original OpSpecConstantOp
+// instruction with an OpConstant instruction. When folding composite spec
+// constants, new instructions may be inserted to define the components of the
+// composite constant first, then the original spec constants will be replaced
+// by OpConstantComposite instructions.
//
// There are some operations not supported yet:
// OpSConvert, OpFConvert, OpQuantizeToF16 and
@@ -325,7 +326,7 @@ Optimizer::PassToken CreateUnifyConstantPass();
// Creates a eliminate-dead-constant pass.
// A eliminate-dead-constant pass removes dead constants, including normal
-// contants defined by OpConstant, OpConstantComposite, OpConstantTrue, or
+// constants defined by OpConstant, OpConstantComposite, OpConstantTrue, or
// OpConstantFalse and spec constants defined by OpSpecConstant,
// OpSpecConstantComposite, OpSpecConstantTrue, OpSpecConstantFalse or
// OpSpecConstantOp.
@@ -389,7 +390,7 @@ Optimizer::PassToken CreateInlineOpaquePass();
// Only modules with relaxed logical addressing (see opt/instruction.h) are
// currently processed.
//
-// This pass is most effective if preceeded by Inlining and
+// This pass is most effective if preceded by Inlining and
// LocalAccessChainConvert. This pass will reduce the work needed to be done
// by LocalSingleStoreElim and LocalMultiStoreElim.
//
@@ -407,7 +408,7 @@ Optimizer::PassToken CreateLocalSingleBlockLoadStoreElimPass();
// Note that some branches and blocks may be left to avoid creating invalid
// control flow. Improving this is left to future work.
//
-// This pass is most effective when preceeded by passes which eliminate
+// This pass is most effective when preceded by passes which eliminate
// local loads and stores, effectively propagating constant values where
// possible.
Optimizer::PassToken CreateDeadBranchElimPass();
@@ -424,7 +425,7 @@ Optimizer::PassToken CreateDeadBranchElimPass();
// are currently processed. Currently modules with any extensions enabled are
// not processed. This is left for future work.
//
-// This pass is most effective if preceeded by Inlining and
+// This pass is most effective if preceded by Inlining and
// LocalAccessChainConvert. LocalSingleStoreElim and LocalSingleBlockElim
// will reduce the work that this pass has to do.
Optimizer::PassToken CreateLocalMultiStoreElimPass();
@@ -519,7 +520,8 @@ 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(bool preserve_interface = false);
+Optimizer::PassToken CreateAggressiveDCEPass();
+Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface);
// Creates a remove-unused-interface-variables pass.
// Removes variables referenced on the |OpEntryPoint| instruction that are not
@@ -628,7 +630,7 @@ Optimizer::PassToken CreateRedundancyEliminationPass();
Optimizer::PassToken CreateScalarReplacementPass(uint32_t size_limit = 100);
// Create a private to local pass.
-// This pass looks for variables delcared in the private storage class that are
+// This pass looks for variables declared in the private storage class that are
// used in only one function. Those variables are moved to the function storage
// class in the function that they are used.
Optimizer::PassToken CreatePrivateToLocalPass();
@@ -833,6 +835,26 @@ Optimizer::PassToken CreateFixStorageClassPass();
// inclusive.
Optimizer::PassToken CreateGraphicsRobustAccessPass();
+// Create a pass to spread Volatile semantics to variables with SMIDNV,
+// WarpIDNV, SubgroupSize, SubgroupLocalInvocationId, SubgroupEqMask,
+// SubgroupGeMask, SubgroupGtMask, SubgroupLeMask, or SubgroupLtMask BuiltIn
+// decorations or OpLoad for them when the shader model is the ray generation,
+// closest hit, miss, intersection, or callable. This pass can be used for
+// VUID-StandaloneSpirv-VulkanMemoryModel-04678 and
+// VUID-StandaloneSpirv-VulkanMemoryModel-04679 (See "Standalone SPIR-V
+// Validation" section of Vulkan spec "Appendix A: Vulkan Environment for
+// SPIR-V"). When the SPIR-V version is 1.6 or above, the pass also spreads
+// the Volatile semantics to a variable with HelperInvocation BuiltIn decoration
+// in the fragement shader.
+Optimizer::PassToken CreateSpreadVolatileSemanticsPass();
+
+// Create a pass to replace a descriptor access using variable index.
+// This pass replaces every access using a variable index to array variable
+// |desc| that has a DescriptorSet and Binding decorations with a constant
+// element of the array. In order to replace the access using a variable index
+// with the constant element, it uses a switch statement.
+Optimizer::PassToken CreateReplaceDescArrayAccessUsingVarIndexPass();
+
// Create descriptor scalar replacement pass.
// This pass replaces every array variable |desc| that has a DescriptorSet and
// Binding decorations with a new variable for each element of the array.
@@ -864,6 +886,13 @@ Optimizer::PassToken CreateAmdExtToKhrPass();
// propagated into their final positions.
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.
+Optimizer::PassToken CreateEliminateDeadInputComponentsPass();
+
// 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
@@ -874,6 +903,20 @@ Optimizer::PassToken CreateConvertToSampledImagePass(
const std::vector<opt::DescriptorSetAndBinding>&
descriptor_set_binding_pairs);
+// Create an interface-variable-scalar-replacement pass that replaces array or
+// matrix interface variables with a series of scalar or vector interface
+// variables. For example, it replaces `float3 foo[2]` with `float3 foo0, foo1`.
+Optimizer::PassToken CreateInterfaceVariableScalarReplacementPass();
+
+// Creates a remove-dont-inline pass to remove the |DontInline| function control
+// from every function in the module. This is useful if you want the inliner to
+// inline these functions some reason.
+Optimizer::PassToken CreateRemoveDontInlinePass();
+// Create a fix-func-call-param pass to fix non memory argument for the function
+// call, as spirv-validation requires function parameters to be an memory
+// object, currently the pass would remove accesschain pointer argument passed
+// to the function
+Optimizer::PassToken CreateFixFuncCallArgumentsPass();
} // namespace spvtools
#endif // INCLUDE_SPIRV_TOOLS_OPTIMIZER_HPP_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/assembly_grammar.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/assembly_grammar.cpp
index 79f18eee392..4f5942ab4f7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/assembly_grammar.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/assembly_grammar.cpp
@@ -62,9 +62,9 @@ spv_result_t spvTextParseMaskOperand(spv_target_env env,
end = std::find(begin, text_end, separator);
spv_operand_desc entry = nullptr;
- if (spvOperandTableNameLookup(env, operandTable, type, begin, end - begin,
- &entry)) {
- return SPV_ERROR_INVALID_TEXT;
+ if (auto error = spvOperandTableNameLookup(env, operandTable, type, begin,
+ end - begin, &entry)) {
+ return error;
}
value |= entry->value;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp
index 93d5da7aba7..24d32f8c4a5 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.cpp
@@ -33,6 +33,7 @@
#include "source/operand.h"
#include "source/spirv_constant.h"
#include "source/spirv_endian.h"
+#include "source/util/string_utils.h"
spv_result_t spvBinaryHeaderGet(const spv_const_binary binary,
const spv_endianness_t endian,
@@ -62,6 +63,15 @@ spv_result_t spvBinaryHeaderGet(const spv_const_binary binary,
return SPV_SUCCESS;
}
+std::string spvDecodeLiteralStringOperand(const spv_parsed_instruction_t& inst,
+ const uint16_t operand_index) {
+ assert(operand_index < inst.num_operands);
+ const spv_parsed_operand_t& operand = inst.operands[operand_index];
+
+ return spvtools::utils::MakeString(inst.words + operand.offset,
+ operand.num_words);
+}
+
namespace {
// A SPIR-V binary parser. A parser instance communicates detailed parse
@@ -205,7 +215,7 @@ class Parser {
size_t word_index; // The current position in words.
size_t instruction_count; // The count of processed instructions
spv_endianness_t endian; // The endianness of the binary.
- // Is the SPIR-V binary in a different endiannes from the host native
+ // Is the SPIR-V binary in a different endianness from the host native
// endianness?
bool requires_endian_conversion;
@@ -290,7 +300,7 @@ spv_result_t Parser::parseInstruction() {
const uint32_t first_word = peek();
// If the module's endianness is different from the host native endianness,
- // then converted_words contains the the endian-translated words in the
+ // then converted_words contains the endian-translated words in the
// instruction.
_.endian_converted_words.clear();
_.endian_converted_words.push_back(first_word);
@@ -577,27 +587,18 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
case SPV_OPERAND_TYPE_LITERAL_STRING:
case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_STRING: {
- convert_operand_endianness = false;
- const char* string =
- reinterpret_cast<const char*>(_.words + _.word_index);
- // Compute the length of the string, but make sure we don't run off the
- // end of the input.
- const size_t remaining_input_bytes =
- sizeof(uint32_t) * (_.num_words - _.word_index);
- const size_t string_num_content_bytes =
- spv_strnlen_s(string, remaining_input_bytes);
- // If there was no terminating null byte, then that's an end-of-input
- // error.
- if (string_num_content_bytes == remaining_input_bytes)
+ const size_t max_words = _.num_words - _.word_index;
+ std::string string =
+ spvtools::utils::MakeString(_.words + _.word_index, max_words, false);
+
+ if (string.length() == max_words * 4)
return exhaustedInputDiagnostic(inst_offset, opcode, type);
- // Account for null in the word length, so add 1 for null, then add 3 to
- // make sure we round up. The following is equivalent to:
- // (string_num_content_bytes + 1 + 3) / 4
- const size_t string_num_words = string_num_content_bytes / 4 + 1;
+
// Make sure we can record the word count without overflow.
//
// This error can't currently be triggered because of validity
// checks elsewhere.
+ const size_t string_num_words = string.length() / 4 + 1;
if (string_num_words > std::numeric_limits<uint16_t>::max()) {
return diagnostic() << "Literal string is longer than "
<< std::numeric_limits<uint16_t>::max()
@@ -611,7 +612,7 @@ spv_result_t Parser::parseOperand(size_t inst_offset,
// There is only one string literal argument to OpExtInstImport,
// so it's sufficient to guard this just on the opcode.
const spv_ext_inst_type_t ext_inst_type =
- spvExtInstImportTypeGet(string);
+ spvExtInstImportTypeGet(string.c_str());
if (SPV_EXT_INST_TYPE_NONE == ext_inst_type) {
return diagnostic()
<< "Invalid extended instruction import '" << string << "'";
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.h
index 66d24c7e41f..eb3beacac34 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/binary.h
@@ -15,6 +15,8 @@
#ifndef SOURCE_BINARY_H_
#define SOURCE_BINARY_H_
+#include <string>
+
#include "source/spirv_definition.h"
#include "spirv-tools/libspirv.h"
@@ -33,4 +35,9 @@ spv_result_t spvBinaryHeaderGet(const spv_const_binary binary,
// replacement for C11's strnlen_s which might not exist in all environments.
size_t spv_strnlen_s(const char* str, size_t strsz);
+// Decode the string literal operand with index operand_index from instruction
+// inst.
+std::string spvDecodeLiteralStringOperand(const spv_parsed_instruction_t& inst,
+ const uint16_t operand_index);
+
#endif // SOURCE_BINARY_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/cfa.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/cfa.h
index 0d09014c9a7..9ae3e39a191 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/cfa.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/cfa.h
@@ -42,7 +42,7 @@ class CFA {
/// Returns true if a block with @p id is found in the @p work_list vector
///
- /// @param[in] work_list Set of blocks visited in the the depth first
+ /// @param[in] work_list Set of blocks visited in the depth first
/// traversal
/// of the CFG
/// @param[in] id The ID of the block being checked
@@ -56,8 +56,33 @@ class CFA {
///
/// This function performs a depth first traversal from the \p entry
/// BasicBlock and calls the pre/postorder functions when it needs to process
+ /// the node in pre order, post order.
+ ///
+ /// @param[in] entry The root BasicBlock of a CFG
+ /// @param[in] successor_func A function which will return a pointer to the
+ /// successor nodes
+ /// @param[in] preorder A function that will be called for every block in a
+ /// CFG following preorder traversal semantics
+ /// @param[in] postorder A function that will be called for every block in a
+ /// CFG following postorder traversal semantics
+ /// @param[in] terminal A function that will be called to determine if the
+ /// search should stop at the given node.
+ /// NOTE: The @p successor_func and predecessor_func each return a pointer to
+ /// a collection such that iterators to that collection remain valid for the
+ /// lifetime of the algorithm.
+ static void DepthFirstTraversal(const BB* entry,
+ get_blocks_func successor_func,
+ std::function<void(cbb_ptr)> preorder,
+ std::function<void(cbb_ptr)> postorder,
+ std::function<bool(cbb_ptr)> terminal);
+
+ /// @brief Depth first traversal starting from the \p entry BasicBlock
+ ///
+ /// This function performs a depth first traversal from the \p entry
+ /// BasicBlock and calls the pre/postorder functions when it needs to process
/// the node in pre order, post order. It also calls the backedge function
- /// when a back edge is encountered.
+ /// when a back edge is encountered. The backedge function can be empty. The
+ /// runtime of the algorithm is improved if backedge is empty.
///
/// @param[in] entry The root BasicBlock of a CFG
/// @param[in] successor_func A function which will return a pointer to the
@@ -67,16 +92,18 @@ class CFA {
/// @param[in] postorder A function that will be called for every block in a
/// CFG following postorder traversal semantics
/// @param[in] backedge A function that will be called when a backedge is
- /// encountered during a traversal
+ /// encountered during a traversal.
+ /// @param[in] terminal A function that will be called to determine if the
+ /// search should stop at the given node.
/// NOTE: The @p successor_func and predecessor_func each return a pointer to
- /// a
- /// collection such that iterators to that collection remain valid for the
+ /// a collection such that iterators to that collection remain valid for the
/// lifetime of the algorithm.
static void DepthFirstTraversal(
const BB* entry, get_blocks_func successor_func,
std::function<void(cbb_ptr)> preorder,
std::function<void(cbb_ptr)> postorder,
- std::function<void(cbb_ptr, cbb_ptr)> backedge);
+ std::function<void(cbb_ptr, cbb_ptr)> backedge,
+ std::function<bool(cbb_ptr)> terminal);
/// @brief Calculates dominator edges for a set of blocks
///
@@ -134,11 +161,27 @@ bool CFA<BB>::FindInWorkList(const std::vector<block_info>& work_list,
}
template <class BB>
+void CFA<BB>::DepthFirstTraversal(const BB* entry,
+ get_blocks_func successor_func,
+ std::function<void(cbb_ptr)> preorder,
+ std::function<void(cbb_ptr)> postorder,
+ std::function<bool(cbb_ptr)> terminal) {
+ DepthFirstTraversal(entry, successor_func, preorder, postorder,
+ /* backedge = */ {}, terminal);
+}
+
+template <class BB>
void CFA<BB>::DepthFirstTraversal(
const BB* entry, get_blocks_func successor_func,
std::function<void(cbb_ptr)> preorder,
std::function<void(cbb_ptr)> postorder,
- std::function<void(cbb_ptr, cbb_ptr)> backedge) {
+ std::function<void(cbb_ptr, cbb_ptr)> backedge,
+ std::function<bool(cbb_ptr)> terminal) {
+ assert(successor_func && "The successor function cannot be empty.");
+ assert(preorder && "The preorder function cannot be empty.");
+ assert(postorder && "The postorder function cannot be empty.");
+ assert(terminal && "The terminal function cannot be empty.");
+
std::unordered_set<uint32_t> processed;
/// NOTE: work_list is the sequence of nodes from the root node to the node
@@ -152,13 +195,13 @@ void CFA<BB>::DepthFirstTraversal(
while (!work_list.empty()) {
block_info& top = work_list.back();
- if (top.iter == end(*successor_func(top.block))) {
+ if (terminal(top.block) || top.iter == end(*successor_func(top.block))) {
postorder(top.block);
work_list.pop_back();
} else {
BB* child = *top.iter;
top.iter++;
- if (FindInWorkList(work_list, child->id())) {
+ if (backedge && FindInWorkList(work_list, child->id())) {
backedge(top.block, child);
}
if (processed.count(child->id()) == 0) {
@@ -232,10 +275,16 @@ std::vector<std::pair<BB*, BB*>> CFA<BB>::CalculateDominators(
std::vector<std::pair<bb_ptr, bb_ptr>> out;
for (auto idom : idoms) {
+ // At this point if there is no dominator for the node, just make it
+ // reflexive.
+ auto dominator = std::get<1>(idom).dominator;
+ if (dominator == undefined_dom) {
+ dominator = std::get<1>(idom).postorder_index;
+ }
// NOTE: performing a const cast for convenient usage with
// UpdateImmediateDominators
out.push_back({const_cast<BB*>(std::get<0>(idom)),
- const_cast<BB*>(postorder[std::get<1>(idom).dominator])});
+ const_cast<BB*>(postorder[dominator])});
}
// Sort by postorder index to generate a deterministic ordering of edges.
@@ -265,12 +314,12 @@ std::vector<BB*> CFA<BB>::TraversalRoots(const std::vector<BB*>& blocks,
auto mark_visited = [&visited](const BB* b) { visited.insert(b); };
auto ignore_block = [](const BB*) {};
- auto ignore_blocks = [](const BB*, const BB*) {};
+ auto no_terminal_blocks = [](const BB*) { return false; };
auto traverse_from_root = [&mark_visited, &succ_func, &ignore_block,
- &ignore_blocks](const BB* entry) {
+ &no_terminal_blocks](const BB* entry) {
DepthFirstTraversal(entry, succ_func, mark_visited, ignore_block,
- ignore_blocks);
+ no_terminal_blocks);
};
std::vector<BB*> result;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/diff/diff.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/diff/diff.cpp
new file mode 100644
index 00000000000..7ed41de58f8
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/diff/diff.cpp
@@ -0,0 +1,2869 @@
+// Copyright (c) 2022 Google LLC.
+//
+// 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/diff/diff.h"
+
+#include "source/diff/lcs.h"
+#include "source/disassemble.h"
+#include "source/ext_inst.h"
+#include "source/latest_version_spirv_header.h"
+#include "source/print.h"
+#include "spirv-tools/libspirv.hpp"
+
+namespace spvtools {
+namespace diff {
+
+namespace {
+
+// A map from an id to the instruction that defines it.
+using IdToInstructionMap = std::vector<const opt::Instruction*>;
+// A map from an id to the instructions that decorate it, or name it, etc.
+using IdToInfoMap = std::vector<std::vector<const opt::Instruction*>>;
+// A map from an instruction to another, used for instructions without id.
+using InstructionToInstructionMap =
+ std::unordered_map<const opt::Instruction*, const opt::Instruction*>;
+// A flat list of instructions in a function for easier iteration.
+using InstructionList = std::vector<const opt::Instruction*>;
+// A map from a function to its list of instructions.
+using FunctionInstMap = std::map<uint32_t, InstructionList>;
+// A list of ids with some similar property, for example functions with the same
+// name.
+using IdGroup = std::vector<uint32_t>;
+// A map of names to ids with the same name. This is an ordered map so
+// different implementations produce identical results.
+using IdGroupMapByName = std::map<std::string, IdGroup>;
+using IdGroupMapByTypeId = std::map<uint32_t, IdGroup>;
+using IdGroupMapByOp = std::map<SpvOp, IdGroup>;
+using IdGroupMapByStorageClass = std::map<SpvStorageClass, IdGroup>;
+
+// 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
+// appear in src and dst to facilitate matching dependent instructions. For
+// example, this guarantees that when matching OpTypeVector, the basic type of
+// the vector is already (potentially) matched.
+struct PotentialIdMap {
+ std::vector<uint32_t> src_ids;
+ std::vector<uint32_t> dst_ids;
+};
+
+void CompactIds(std::vector<uint32_t>& ids) {
+ size_t write_index = 0;
+ for (size_t i = 0; i < ids.size(); ++i) {
+ if (ids[i] != 0) {
+ ids[write_index++] = ids[i];
+ }
+ }
+ ids.resize(write_index);
+}
+
+// A mapping between src and dst ids.
+class IdMap {
+ public:
+ IdMap(size_t id_bound) { id_map_.resize(id_bound, 0); }
+
+ void MapIds(uint32_t from, uint32_t to) {
+ assert(from != 0);
+ assert(to != 0);
+ assert(from < id_map_.size());
+ assert(id_map_[from] == 0);
+
+ id_map_[from] = to;
+ }
+
+ uint32_t MappedId(uint32_t from) const {
+ assert(from != 0);
+ return from < id_map_.size() ? id_map_[from] : 0;
+ }
+ const opt::Instruction* MappedInst(const opt::Instruction* from_inst) const {
+ assert(from_inst != nullptr);
+ assert(!from_inst->HasResultId());
+
+ auto mapped = inst_map_.find(from_inst);
+ if (mapped == inst_map_.end()) {
+ return nullptr;
+ }
+ return mapped->second;
+ }
+
+ bool IsMapped(uint32_t from) const {
+ assert(from != 0);
+ return from < id_map_.size() && id_map_[from] != 0;
+ }
+
+ // Map any ids in src and dst that have not been mapped to new ids in dst and
+ // src respectively.
+ void MapUnmatchedIds(IdMap& other_way);
+
+ // Some instructions don't have result ids. Those are mapped by pointer.
+ void MapInsts(const opt::Instruction* from_inst,
+ const opt::Instruction* to_inst) {
+ assert(from_inst != nullptr);
+ assert(to_inst != nullptr);
+ assert(inst_map_.find(from_inst) == inst_map_.end());
+
+ inst_map_[from_inst] = to_inst;
+ }
+
+ uint32_t IdBound() const { return static_cast<uint32_t>(id_map_.size()); }
+
+ private:
+ // Given an id, returns the corresponding id in the other module, or 0 if not
+ // matched yet.
+ std::vector<uint32_t> id_map_;
+
+ // Same for instructions that don't have an id.
+ InstructionToInstructionMap inst_map_;
+};
+
+// Two way mapping of ids.
+class SrcDstIdMap {
+ public:
+ SrcDstIdMap(size_t src_id_bound, size_t dst_id_bound)
+ : src_to_dst_(src_id_bound), dst_to_src_(dst_id_bound) {}
+
+ void MapIds(uint32_t src, uint32_t dst) {
+ src_to_dst_.MapIds(src, dst);
+ dst_to_src_.MapIds(dst, src);
+ }
+
+ uint32_t MappedDstId(uint32_t src) {
+ uint32_t dst = src_to_dst_.MappedId(src);
+ assert(dst == 0 || dst_to_src_.MappedId(dst) == src);
+ return dst;
+ }
+ uint32_t MappedSrcId(uint32_t dst) {
+ uint32_t src = dst_to_src_.MappedId(dst);
+ assert(src == 0 || src_to_dst_.MappedId(src) == dst);
+ return src;
+ }
+
+ bool IsSrcMapped(uint32_t src) { return src_to_dst_.IsMapped(src); }
+ bool IsDstMapped(uint32_t dst) { return dst_to_src_.IsMapped(dst); }
+
+ // Map any ids in src and dst that have not been mapped to new ids in dst and
+ // src respectively.
+ void MapUnmatchedIds();
+
+ // Some instructions don't have result ids. Those are mapped by pointer.
+ void MapInsts(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst) {
+ assert(src_inst->HasResultId() == dst_inst->HasResultId());
+ if (src_inst->HasResultId()) {
+ MapIds(src_inst->result_id(), dst_inst->result_id());
+ } else {
+ src_to_dst_.MapInsts(src_inst, dst_inst);
+ dst_to_src_.MapInsts(dst_inst, src_inst);
+ }
+ }
+
+ const IdMap& SrcToDstMap() const { return src_to_dst_; }
+ const IdMap& DstToSrcMap() const { return dst_to_src_; }
+
+ private:
+ IdMap src_to_dst_;
+ IdMap dst_to_src_;
+};
+
+struct IdInstructions {
+ IdInstructions(const opt::Module* module)
+ : inst_map_(module->IdBound(), nullptr),
+ name_map_(module->IdBound()),
+ decoration_map_(module->IdBound()),
+ forward_pointer_map_(module->IdBound()) {
+ // Map ids from all sections to instructions that define them.
+ MapIdsToInstruction(module->ext_inst_imports());
+ MapIdsToInstruction(module->types_values());
+ for (const opt::Function& function : *module) {
+ function.ForEachInst(
+ [this](const opt::Instruction* inst) {
+ if (inst->HasResultId()) {
+ MapIdToInstruction(inst->result_id(), inst);
+ }
+ },
+ true, true);
+ }
+
+ // Gather decorations applied to ids that could be useful in matching them
+ // between src and dst modules.
+ MapIdsToInfos(module->debugs2());
+ MapIdsToInfos(module->annotations());
+ MapIdsToInfos(module->types_values());
+ }
+
+ void MapIdToInstruction(uint32_t id, const opt::Instruction* inst);
+
+ void MapIdsToInstruction(
+ opt::IteratorRange<opt::Module::const_inst_iterator> section);
+ void MapIdsToInfos(
+ opt::IteratorRange<opt::Module::const_inst_iterator> section);
+
+ IdToInstructionMap inst_map_;
+ IdToInfoMap name_map_;
+ IdToInfoMap decoration_map_;
+ IdToInstructionMap forward_pointer_map_;
+};
+
+class Differ {
+ public:
+ Differ(opt::IRContext* src, opt::IRContext* dst, std::ostream& out,
+ Options options)
+ : src_context_(src),
+ dst_context_(dst),
+ src_(src->module()),
+ dst_(dst->module()),
+ options_(options),
+ out_(out),
+ src_id_to_(src_),
+ dst_id_to_(dst_),
+ id_map_(src_->IdBound(), dst_->IdBound()) {
+ // Cache function bodies in canonicalization order.
+ GetFunctionBodies(src_context_, &src_funcs_, &src_func_insts_);
+ GetFunctionBodies(dst_context_, &dst_funcs_, &dst_func_insts_);
+ }
+
+ // Match ids or instructions of different sections.
+ void MatchCapabilities();
+ void MatchExtensions();
+ void MatchExtInstImportIds();
+ void MatchMemoryModel();
+ void MatchEntryPointIds();
+ void MatchExecutionModes();
+ void MatchTypeForwardPointers();
+ void MatchTypeIds();
+ void MatchConstants();
+ void MatchVariableIds();
+ void MatchFunctions();
+
+ // Debug info and annotations are matched only after ids are matched.
+ void MatchDebugs1();
+ void MatchDebugs2();
+ void MatchDebugs3();
+ void MatchExtInstDebugInfo();
+ void MatchAnnotations();
+
+ // Output the diff.
+ spv_result_t Output();
+
+ void DumpIdMap() {
+ if (!options_.dump_id_map) {
+ return;
+ }
+
+ out_ << " Src -> Dst\n";
+ for (uint32_t src_id = 1; src_id < src_->IdBound(); ++src_id) {
+ uint32_t dst_id = id_map_.MappedDstId(src_id);
+ if (src_id_to_.inst_map_[src_id] != nullptr && dst_id != 0)
+ out_ << std::setw(4) << src_id << " -> " << std::setw(4) << dst_id
+ << " [" << spvOpcodeString(src_id_to_.inst_map_[src_id]->opcode())
+ << "]\n";
+ }
+ }
+
+ private:
+ // Helper functions that match ids between src and dst
+ void PoolPotentialIds(
+ opt::IteratorRange<opt::Module::const_inst_iterator> section,
+ std::vector<uint32_t>& ids, bool is_src,
+ std::function<bool(const opt::Instruction&)> filter,
+ std::function<uint32_t(const opt::Instruction&)> get_id);
+ void MatchIds(
+ PotentialIdMap& potential,
+ std::function<bool(const opt::Instruction*, const opt::Instruction*)>
+ match);
+ // Helper functions that match id-less instructions between src and dst.
+ void MatchPreambleInstructions(
+ opt::IteratorRange<opt::Module::const_inst_iterator> src_insts,
+ opt::IteratorRange<opt::Module::const_inst_iterator> dst_insts);
+ InstructionList SortPreambleInstructions(
+ const opt::Module* module,
+ opt::IteratorRange<opt::Module::const_inst_iterator> insts);
+ int ComparePreambleInstructions(const opt::Instruction* a,
+ const opt::Instruction* b,
+ const opt::Module* src_inst_module,
+ const opt::Module* dst_inst_module);
+ // Helper functions that match debug and annotation instructions of already
+ // matched ids.
+ void MatchDebugAndAnnotationInstructions(
+ opt::IteratorRange<opt::Module::const_inst_iterator> src_insts,
+ opt::IteratorRange<opt::Module::const_inst_iterator> dst_insts);
+
+ // 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(
+ const IdInstructions& id_to, uint32_t id);
+ SpvOp 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
+ // ids are bucketed based on that (and output in `groups`). This is useful to
+ // attempt to match ids between src and dst only when said property is
+ // identical.
+ template <typename T>
+ void GroupIds(const IdGroup& ids, bool is_src, std::map<T, IdGroup>* groups,
+ T (Differ::*get_group)(const IdInstructions&, uint32_t));
+
+ // Calls GroupIds to bucket ids in src and dst based on a property returned by
+ // `get_group`. This function then calls `match_group` for each bucket (i.e.
+ // "group") with identical values for said property.
+ //
+ // For example, say src and dst ids have the following properties
+ // correspondingly:
+ //
+ // - src ids' properties: {id0: A, id1: A, id2: B, id3: C, id4: B}
+ // - dst ids' properties: {id0': B, id1': C, id2': B, id3': D, id4': B}
+ //
+ // Then `match_group` is called 2 times:
+ //
+ // - Once with: ([id2, id4], [id0', id2', id4']) corresponding to B
+ // - Once with: ([id3], [id2']) corresponding to C
+ //
+ // Ids corresponding to A and D cannot match based on this property.
+ template <typename T>
+ void GroupIdsAndMatch(
+ const IdGroup& src_ids, const IdGroup& dst_ids, T invalid_group_key,
+ T (Differ::*get_group)(const IdInstructions&, uint32_t),
+ std::function<void(const IdGroup& src_group, const IdGroup& dst_group)>
+ match_group);
+
+ // Helper functions that determine if two instructions match
+ bool DoIdsMatch(uint32_t src_id, uint32_t dst_id);
+ bool DoesOperandMatch(const opt::Operand& src_operand,
+ const opt::Operand& dst_operand);
+ bool DoOperandsMatch(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst,
+ uint32_t in_operand_index_start,
+ uint32_t in_operand_count);
+ bool DoInstructionsMatch(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst);
+ bool DoIdsMatchFuzzy(uint32_t src_id, uint32_t dst_id);
+ bool DoesOperandMatchFuzzy(const opt::Operand& src_operand,
+ const opt::Operand& dst_operand);
+ bool DoInstructionsMatchFuzzy(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst);
+ bool AreIdenticalUintConstants(uint32_t src_id, uint32_t dst_id);
+ bool DoDebugAndAnnotationInstructionsMatch(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst);
+ bool AreVariablesMatchable(uint32_t src_id, uint32_t dst_id,
+ uint32_t flexibility);
+ bool MatchOpTypeStruct(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst,
+ uint32_t flexibility);
+ bool MatchOpConstant(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst, uint32_t flexibility);
+ bool MatchOpSpecConstant(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst);
+ bool MatchOpVariable(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst, uint32_t flexibility);
+ bool MatchPerVertexType(uint32_t src_type_id, uint32_t dst_type_id);
+ bool MatchPerVertexVariable(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst);
+
+ // Helper functions for matching OpTypeForwardPointer
+ void MatchTypeForwardPointersByName(const IdGroup& src, const IdGroup& dst);
+ void MatchTypeForwardPointersByTypeOp(const IdGroup& src, const IdGroup& dst);
+
+ // Helper functions for function matching.
+ using FunctionMap = std::map<uint32_t, const opt::Function*>;
+
+ InstructionList GetFunctionBody(opt::IRContext* context,
+ opt::Function& function);
+ InstructionList GetFunctionHeader(const opt::Function& function);
+ void GetFunctionBodies(opt::IRContext* context, FunctionMap* functions,
+ FunctionInstMap* function_insts);
+ void GetFunctionHeaderInstructions(const opt::Module* module,
+ FunctionInstMap* function_insts);
+ void BestEffortMatchFunctions(const IdGroup& src_func_ids,
+ const IdGroup& dst_func_ids,
+ const FunctionInstMap& src_func_insts,
+ const FunctionInstMap& dst_func_insts);
+
+ // Calculates the diff of two function bodies. Note that the matched
+ // instructions themselves may not be identical; output of exact matches
+ // should produce the exact instruction while inexact matches should produce a
+ // diff as well.
+ //
+ // Returns the similarity of the two bodies = 2*N_match / (N_src + N_dst)
+ void MatchFunctionParamIds(const opt::Function* src_func,
+ const opt::Function* dst_func);
+ float MatchFunctionBodies(const InstructionList& src_body,
+ const InstructionList& dst_body,
+ DiffMatch* src_match_result,
+ DiffMatch* dst_match_result);
+ void MatchIdsInFunctionBodies(const InstructionList& src_body,
+ const InstructionList& dst_body,
+ const DiffMatch& src_match_result,
+ const DiffMatch& dst_match_result,
+ uint32_t flexibility);
+ void MatchVariablesUsedByMatchedInstructions(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst,
+ uint32_t flexibility);
+
+ // 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);
+ 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);
+ // Get the OpName associated with an id, with argument types stripped for
+ // functions. Some tools don't encode function argument types in the OpName
+ // 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);
+ bool GetDecorationValue(const IdInstructions& id_to, uint32_t id,
+ SpvDecoration 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 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_ext_inst_type_t GetExtInstType(const IdInstructions& id_to,
+ uint32_t set_id);
+ spv_number_kind_t GetNumberKind(const IdInstructions& id_to,
+ const opt::Instruction& inst,
+ uint32_t operand_index,
+ uint32_t* number_bit_width);
+ spv_number_kind_t GetTypeNumberKind(const IdInstructions& id_to, uint32_t id,
+ uint32_t* number_bit_width);
+
+ // Helper functions to output a diff line
+ const opt::Instruction* MappedDstInst(const opt::Instruction* src_inst);
+ const opt::Instruction* MappedSrcInst(const opt::Instruction* dst_inst);
+ const opt::Instruction* MappedInstImpl(const opt::Instruction* inst,
+ const IdMap& to_other,
+ const IdInstructions& other_id_to);
+ void OutputLine(std::function<bool()> are_lines_identical,
+ std::function<void()> output_src_line,
+ std::function<void()> output_dst_line);
+ template <typename InstList>
+ void OutputSection(
+ const InstList& src_insts, const InstList& dst_insts,
+ std::function<void(const opt::Instruction&, const IdInstructions&,
+ const opt::Instruction&)>
+ write_inst);
+ void ToParsedInstruction(const opt::Instruction& inst,
+ const IdInstructions& id_to,
+ const opt::Instruction& original_inst,
+ spv_parsed_instruction_t* parsed_inst,
+ std::vector<spv_parsed_operand_t>& parsed_operands,
+ std::vector<uint32_t>& inst_binary);
+ opt::Instruction ToMappedSrcIds(const opt::Instruction& dst_inst);
+
+ void OutputRed() {
+ if (options_.color_output) out_ << spvtools::clr::red{true};
+ }
+ void OutputGreen() {
+ if (options_.color_output) out_ << spvtools::clr::green{true};
+ }
+ void OutputResetColor() {
+ if (options_.color_output) out_ << spvtools::clr::reset{true};
+ }
+
+ opt::IRContext* src_context_;
+ opt::IRContext* dst_context_;
+ const opt::Module* src_;
+ const opt::Module* dst_;
+ Options options_;
+ std::ostream& out_;
+
+ // Helpers to look up instructions based on id.
+ IdInstructions src_id_to_;
+ IdInstructions dst_id_to_;
+
+ // The ids that have been matched between src and dst so far.
+ SrcDstIdMap id_map_;
+
+ // List of instructions in function bodies after canonicalization. Cached
+ // here to avoid duplicate work. More importantly, some maps use
+ // opt::Instruction pointers so they need to be unique.
+ FunctionInstMap src_func_insts_;
+ FunctionInstMap dst_func_insts_;
+ FunctionMap src_funcs_;
+ FunctionMap dst_funcs_;
+};
+
+void IdMap::MapUnmatchedIds(IdMap& other_way) {
+ const uint32_t src_id_bound = static_cast<uint32_t>(id_map_.size());
+ const uint32_t dst_id_bound = static_cast<uint32_t>(other_way.id_map_.size());
+
+ uint32_t next_src_id = src_id_bound;
+ uint32_t next_dst_id = dst_id_bound;
+
+ for (uint32_t src_id = 1; src_id < src_id_bound; ++src_id) {
+ if (!IsMapped(src_id)) {
+ MapIds(src_id, next_dst_id);
+
+ other_way.id_map_.push_back(0);
+ other_way.MapIds(next_dst_id++, src_id);
+ }
+ }
+
+ for (uint32_t dst_id = 1; dst_id < dst_id_bound; ++dst_id) {
+ if (!other_way.IsMapped(dst_id)) {
+ id_map_.push_back(0);
+ MapIds(next_src_id, dst_id);
+
+ other_way.MapIds(dst_id, next_src_id++);
+ }
+ }
+}
+
+void SrcDstIdMap::MapUnmatchedIds() {
+ src_to_dst_.MapUnmatchedIds(dst_to_src_);
+}
+
+void IdInstructions::MapIdToInstruction(uint32_t id,
+ const opt::Instruction* inst) {
+ assert(id != 0);
+ assert(id < inst_map_.size());
+ assert(inst_map_[id] == nullptr);
+
+ inst_map_[id] = inst;
+}
+
+void IdInstructions::MapIdsToInstruction(
+ opt::IteratorRange<opt::Module::const_inst_iterator> section) {
+ for (const opt::Instruction& inst : section) {
+ uint32_t result_id = inst.result_id();
+ if (result_id == 0) {
+ continue;
+ }
+
+ MapIdToInstruction(result_id, &inst);
+ }
+}
+
+void IdInstructions::MapIdsToInfos(
+ opt::IteratorRange<opt::Module::const_inst_iterator> section) {
+ for (const opt::Instruction& inst : section) {
+ IdToInfoMap* info_map = nullptr;
+ uint32_t id_operand = 0;
+
+ switch (inst.opcode()) {
+ case SpvOpName:
+ info_map = &name_map_;
+ break;
+ case SpvOpMemberName:
+ info_map = &name_map_;
+ break;
+ case SpvOpDecorate:
+ info_map = &decoration_map_;
+ break;
+ case SpvOpMemberDecorate:
+ info_map = &decoration_map_;
+ break;
+ case SpvOpTypeForwardPointer: {
+ uint32_t id = inst.GetSingleWordOperand(0);
+ assert(id != 0);
+
+ assert(id < forward_pointer_map_.size());
+ forward_pointer_map_[id] = &inst;
+ continue;
+ }
+ default:
+ // Currently unsupported instruction, don't attempt to use it for
+ // matching.
+ break;
+ }
+
+ if (info_map == nullptr) {
+ continue;
+ }
+
+ uint32_t id = inst.GetOperand(id_operand).AsId();
+ assert(id != 0);
+
+ assert(id < info_map->size());
+ assert(std::find((*info_map)[id].begin(), (*info_map)[id].end(), &inst) ==
+ (*info_map)[id].end());
+
+ (*info_map)[id].push_back(&inst);
+ }
+}
+
+void Differ::PoolPotentialIds(
+ opt::IteratorRange<opt::Module::const_inst_iterator> section,
+ std::vector<uint32_t>& ids, bool is_src,
+ std::function<bool(const opt::Instruction&)> filter,
+ std::function<uint32_t(const opt::Instruction&)> get_id) {
+ for (const opt::Instruction& inst : section) {
+ if (!filter(inst)) {
+ continue;
+ }
+
+ uint32_t result_id = get_id(inst);
+ assert(result_id != 0);
+
+ assert(std::find(ids.begin(), ids.end(), result_id) == ids.end());
+
+ // Don't include ids that are already matched, for example through
+ // OpTypeForwardPointer.
+ const bool is_matched = is_src ? id_map_.IsSrcMapped(result_id)
+ : id_map_.IsDstMapped(result_id);
+ if (is_matched) {
+ continue;
+ }
+
+ ids.push_back(result_id);
+ }
+}
+
+void Differ::MatchIds(
+ PotentialIdMap& potential,
+ std::function<bool(const opt::Instruction*, const opt::Instruction*)>
+ match) {
+ for (size_t src_index = 0; src_index < potential.src_ids.size();
+ ++src_index) {
+ for (size_t dst_index = 0; dst_index < potential.dst_ids.size();
+ ++dst_index) {
+ const uint32_t src_id = potential.src_ids[src_index];
+ const uint32_t dst_id = potential.dst_ids[dst_index];
+
+ if (dst_id == 0) {
+ // Already matched.
+ continue;
+ }
+
+ const opt::Instruction* src_inst = src_id_to_.inst_map_[src_id];
+ const opt::Instruction* dst_inst = dst_id_to_.inst_map_[dst_id];
+
+ if (match(src_inst, dst_inst)) {
+ id_map_.MapIds(src_id, dst_id);
+
+ // Remove the ids from the potential list.
+ potential.src_ids[src_index] = 0;
+ potential.dst_ids[dst_index] = 0;
+
+ // Find a match for the next src id.
+ break;
+ }
+ }
+ }
+
+ // Remove matched ids to make the next iteration faster.
+ CompactIds(potential.src_ids);
+ CompactIds(potential.dst_ids);
+}
+
+void Differ::MatchPreambleInstructions(
+ opt::IteratorRange<opt::Module::const_inst_iterator> src_insts,
+ opt::IteratorRange<opt::Module::const_inst_iterator> dst_insts) {
+ // First, pool all instructions from each section and sort them.
+ InstructionList sorted_src_insts = SortPreambleInstructions(src_, src_insts);
+ InstructionList sorted_dst_insts = SortPreambleInstructions(dst_, dst_insts);
+
+ // Then walk and match them.
+ size_t src_cur = 0;
+ size_t dst_cur = 0;
+
+ while (src_cur < sorted_src_insts.size() &&
+ dst_cur < sorted_dst_insts.size()) {
+ const opt::Instruction* src_inst = sorted_src_insts[src_cur];
+ const opt::Instruction* dst_inst = sorted_dst_insts[dst_cur];
+
+ int compare = ComparePreambleInstructions(src_inst, dst_inst, src_, dst_);
+ if (compare == 0) {
+ id_map_.MapInsts(src_inst, dst_inst);
+ }
+ if (compare <= 0) {
+ ++src_cur;
+ }
+ if (compare >= 0) {
+ ++dst_cur;
+ }
+ }
+}
+
+InstructionList Differ::SortPreambleInstructions(
+ const opt::Module* module,
+ opt::IteratorRange<opt::Module::const_inst_iterator> insts) {
+ InstructionList sorted;
+ for (const opt::Instruction& inst : insts) {
+ sorted.push_back(&inst);
+ }
+ std::sort(
+ sorted.begin(), sorted.end(),
+ [this, module](const opt::Instruction* a, const opt::Instruction* b) {
+ return ComparePreambleInstructions(a, b, module, module) < 0;
+ });
+ return sorted;
+}
+
+int Differ::ComparePreambleInstructions(const opt::Instruction* a,
+ const opt::Instruction* b,
+ const opt::Module* src_inst_module,
+ const opt::Module* dst_inst_module) {
+ assert(a->opcode() == b->opcode());
+ assert(!a->HasResultId());
+ assert(!a->HasResultType());
+
+ const uint32_t a_operand_count = a->NumOperands();
+ const uint32_t b_operand_count = b->NumOperands();
+
+ if (a_operand_count < b_operand_count) {
+ return -1;
+ }
+ if (a_operand_count > b_operand_count) {
+ return 1;
+ }
+
+ // 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 =
+ GetExecutionModel(src_inst_module, a->GetSingleWordOperand(0));
+ const SpvExecutionModel dst_model =
+ GetExecutionModel(dst_inst_module, b->GetSingleWordOperand(0));
+
+ if (src_model < dst_model) {
+ return -1;
+ }
+ if (src_model > dst_model) {
+ return 1;
+ }
+ }
+
+ // Match every operand of the instruction.
+ for (uint32_t operand_index = 0; operand_index < a_operand_count;
+ ++operand_index) {
+ const opt::Operand& a_operand = a->GetOperand(operand_index);
+ const opt::Operand& b_operand = b->GetOperand(operand_index);
+
+ if (a_operand.type < b_operand.type) {
+ return -1;
+ }
+ if (a_operand.type > b_operand.type) {
+ return 1;
+ }
+
+ switch (a_operand.type) {
+ case SPV_OPERAND_TYPE_ID:
+ // Don't compare ids, there can't be multiple instances of the
+ // OpExecutionMode with different ids of the same execution model.
+ break;
+ case SPV_OPERAND_TYPE_TYPE_ID:
+ case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID:
+ case SPV_OPERAND_TYPE_SCOPE_ID:
+ assert(false && "Unreachable");
+ break;
+ case SPV_OPERAND_TYPE_LITERAL_STRING: {
+ int str_compare =
+ strcmp(a_operand.AsString().c_str(), b_operand.AsString().c_str());
+ if (str_compare != 0) {
+ return str_compare;
+ }
+ break;
+ }
+ default:
+ // Expect literal values to match.
+ assert(a_operand.words.size() == 1);
+ assert(b_operand.words.size() == 1);
+
+ if (a_operand.words[0] < b_operand.words[0]) {
+ return -1;
+ }
+ if (a_operand.words[0] > b_operand.words[0]) {
+ return 1;
+ }
+ break;
+ }
+ }
+
+ return 0;
+}
+
+void Differ::MatchDebugAndAnnotationInstructions(
+ opt::IteratorRange<opt::Module::const_inst_iterator> src_insts,
+ opt::IteratorRange<opt::Module::const_inst_iterator> dst_insts) {
+ for (const opt::Instruction& src_inst : src_insts) {
+ for (const opt::Instruction& dst_inst : dst_insts) {
+ if (MappedSrcInst(&dst_inst) != nullptr) {
+ continue;
+ }
+
+ // Map instructions as soon as they match. Debug and annotation
+ // instructions are matched such that there can't be multiple matches.
+ if (DoDebugAndAnnotationInstructionsMatch(&src_inst, &dst_inst)) {
+ id_map_.MapInsts(&src_inst, &dst_inst);
+ break;
+ }
+ }
+ }
+}
+
+uint32_t Differ::GroupIdsHelperGetTypeId(const IdInstructions& id_to,
+ uint32_t id) {
+ return GetInst(id_to, id)->type_id();
+}
+
+SpvStorageClass 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));
+}
+
+SpvOp Differ::GroupIdsHelperGetTypePointerTypeOp(const IdInstructions& id_to,
+ uint32_t id) {
+ const opt::Instruction* inst = GetInst(id_to, id);
+ assert(inst && inst->opcode() == SpvOpTypePointer);
+
+ const uint32_t type_id = inst->GetSingleWordInOperand(1);
+ const opt::Instruction* type_inst = GetInst(id_to, type_id);
+ assert(type_inst);
+
+ return type_inst->opcode();
+}
+
+template <typename T>
+void Differ::GroupIds(const IdGroup& ids, bool is_src,
+ std::map<T, IdGroup>* groups,
+ T (Differ::*get_group)(const IdInstructions&, uint32_t)) {
+ assert(groups->empty());
+
+ const IdInstructions& id_to = is_src ? src_id_to_ : dst_id_to_;
+
+ for (const uint32_t id : ids) {
+ // Don't include ids that are already matched, for example through
+ // OpEntryPoint.
+ const bool is_matched =
+ is_src ? id_map_.IsSrcMapped(id) : id_map_.IsDstMapped(id);
+ if (is_matched) {
+ continue;
+ }
+
+ T group = (this->*get_group)(id_to, id);
+ (*groups)[group].push_back(id);
+ }
+}
+
+template <typename T>
+void Differ::GroupIdsAndMatch(
+ const IdGroup& src_ids, const IdGroup& dst_ids, T invalid_group_key,
+ T (Differ::*get_group)(const IdInstructions&, uint32_t),
+ std::function<void(const IdGroup& src_group, const IdGroup& dst_group)>
+ match_group) {
+ // Group the ids based on a key (get_group)
+ std::map<T, IdGroup> src_groups;
+ std::map<T, IdGroup> dst_groups;
+
+ GroupIds<T>(src_ids, true, &src_groups, get_group);
+ GroupIds<T>(dst_ids, false, &dst_groups, get_group);
+
+ // Iterate over the groups, and match those with identical keys
+ for (const auto& iter : src_groups) {
+ const T& key = iter.first;
+ const IdGroup& src_group = iter.second;
+
+ if (key == invalid_group_key) {
+ continue;
+ }
+
+ const IdGroup& dst_group = dst_groups[key];
+
+ // Let the caller match the groups as appropriate.
+ match_group(src_group, dst_group);
+ }
+}
+
+bool Differ::DoIdsMatch(uint32_t src_id, uint32_t dst_id) {
+ assert(dst_id != 0);
+ return id_map_.MappedDstId(src_id) == dst_id;
+}
+
+bool Differ::DoesOperandMatch(const opt::Operand& src_operand,
+ const opt::Operand& dst_operand) {
+ assert(src_operand.type == dst_operand.type);
+
+ switch (src_operand.type) {
+ case SPV_OPERAND_TYPE_ID:
+ case SPV_OPERAND_TYPE_TYPE_ID:
+ case SPV_OPERAND_TYPE_RESULT_ID:
+ case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID:
+ case SPV_OPERAND_TYPE_SCOPE_ID:
+ // Match ids only if they are already matched in the id map.
+ return DoIdsMatch(src_operand.AsId(), dst_operand.AsId());
+ case SPV_OPERAND_TYPE_LITERAL_STRING:
+ return src_operand.AsString() == dst_operand.AsString();
+ default:
+ // Otherwise expect them to match exactly.
+ assert(src_operand.type != SPV_OPERAND_TYPE_LITERAL_STRING);
+ if (src_operand.words.size() != dst_operand.words.size()) {
+ return false;
+ }
+ for (size_t i = 0; i < src_operand.words.size(); ++i) {
+ if (src_operand.words[i] != dst_operand.words[i]) {
+ return false;
+ }
+ }
+ return true;
+ }
+}
+
+bool Differ::DoOperandsMatch(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst,
+ uint32_t in_operand_index_start,
+ uint32_t in_operand_count) {
+ // Caller should have returned early for instructions with different opcode.
+ assert(src_inst->opcode() == dst_inst->opcode());
+
+ bool match = true;
+ for (uint32_t i = 0; i < in_operand_count; ++i) {
+ const uint32_t in_operand_index = in_operand_index_start + i;
+
+ const opt::Operand& src_operand = src_inst->GetInOperand(in_operand_index);
+ const opt::Operand& dst_operand = dst_inst->GetInOperand(in_operand_index);
+
+ match = match && DoesOperandMatch(src_operand, dst_operand);
+ }
+
+ return match;
+}
+
+bool Differ::DoInstructionsMatch(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst) {
+ // Check whether the two instructions are identical, that is the instructions
+ // themselves are matched, every id is matched, and every other value is
+ // identical.
+ if (MappedDstInst(src_inst) != dst_inst) {
+ return false;
+ }
+
+ assert(src_inst->opcode() == dst_inst->opcode());
+ if (src_inst->NumOperands() != dst_inst->NumOperands()) {
+ return false;
+ }
+
+ for (uint32_t operand_index = 0; operand_index < src_inst->NumOperands();
+ ++operand_index) {
+ const opt::Operand& src_operand = src_inst->GetOperand(operand_index);
+ const opt::Operand& dst_operand = dst_inst->GetOperand(operand_index);
+
+ if (!DoesOperandMatch(src_operand, dst_operand)) {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool Differ::DoIdsMatchFuzzy(uint32_t src_id, uint32_t dst_id) {
+ assert(dst_id != 0);
+ const uint32_t mapped_dst_id = id_map_.MappedDstId(src_id);
+
+ // Consider unmatched ids as a match. In function bodies, no result id is
+ // matched yet and thus they are excluded from instruction matching when used
+ // as parameters in subsequent instructions.
+ if (mapped_dst_id == 0 || mapped_dst_id == dst_id) {
+ return true;
+ }
+
+ // Int and Uint constants are interchangeable, match them in that case.
+ if (AreIdenticalUintConstants(src_id, dst_id)) {
+ return true;
+ }
+
+ return false;
+}
+
+bool Differ::DoesOperandMatchFuzzy(const opt::Operand& src_operand,
+ const opt::Operand& dst_operand) {
+ if (src_operand.type != dst_operand.type) {
+ return false;
+ }
+
+ assert(src_operand.type != SPV_OPERAND_TYPE_RESULT_ID);
+ assert(dst_operand.type != SPV_OPERAND_TYPE_RESULT_ID);
+
+ switch (src_operand.type) {
+ case SPV_OPERAND_TYPE_ID:
+ case SPV_OPERAND_TYPE_TYPE_ID:
+ case SPV_OPERAND_TYPE_MEMORY_SEMANTICS_ID:
+ case SPV_OPERAND_TYPE_SCOPE_ID:
+ // Match id operands only if they are already matched in the id map.
+ return DoIdsMatchFuzzy(src_operand.AsId(), dst_operand.AsId());
+ default:
+ // Otherwise allow everything to match.
+ return true;
+ }
+}
+
+bool Differ::DoInstructionsMatchFuzzy(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst) {
+ // Similar to DoOperandsMatch, but only checks that ids that have already been
+ // matched are identical. Ids that are unknown are allowed to match, as well
+ // as any non-id operand.
+ if (src_inst->opcode() != dst_inst->opcode()) {
+ return false;
+ }
+ // For external instructions, make sure the set and opcode of the external
+ // instruction matches too.
+ if (src_inst->opcode() == SpvOpExtInst) {
+ if (!DoOperandsMatch(src_inst, dst_inst, 0, 2)) {
+ return false;
+ }
+ }
+
+ assert(src_inst->HasResultType() == dst_inst->HasResultType());
+ if (src_inst->HasResultType() &&
+ !DoIdsMatchFuzzy(src_inst->type_id(), dst_inst->type_id())) {
+ return false;
+ }
+
+ // TODO: allow some instructions to match with different instruction lengths,
+ // for example OpImage* with additional operands.
+ if (src_inst->NumInOperandWords() != dst_inst->NumInOperandWords()) {
+ return false;
+ }
+
+ bool match = true;
+ for (uint32_t in_operand_index = 0;
+ in_operand_index < src_inst->NumInOperandWords(); ++in_operand_index) {
+ const opt::Operand& src_operand = src_inst->GetInOperand(in_operand_index);
+ const opt::Operand& dst_operand = dst_inst->GetInOperand(in_operand_index);
+
+ match = match && DoesOperandMatchFuzzy(src_operand, dst_operand);
+ }
+
+ return match;
+}
+
+bool Differ::AreIdenticalUintConstants(uint32_t src_id, uint32_t dst_id) {
+ return IsConstantUint(src_id_to_, src_id) &&
+ IsConstantUint(dst_id_to_, dst_id) &&
+ GetConstantUint(src_id_to_, src_id) ==
+ GetConstantUint(dst_id_to_, dst_id);
+}
+
+bool Differ::DoDebugAndAnnotationInstructionsMatch(
+ const opt::Instruction* src_inst, const opt::Instruction* dst_inst) {
+ if (src_inst->opcode() != dst_inst->opcode()) {
+ return false;
+ }
+
+ switch (src_inst->opcode()) {
+ case SpvOpString:
+ case SpvOpSourceExtension:
+ case SpvOpModuleProcessed:
+ return DoesOperandMatch(src_inst->GetOperand(0), dst_inst->GetOperand(0));
+ case SpvOpSource:
+ return DoOperandsMatch(src_inst, dst_inst, 0, 2);
+ case SpvOpSourceContinued:
+ return true;
+ case SpvOpName:
+ return DoOperandsMatch(src_inst, dst_inst, 0, 1);
+ case SpvOpMemberName:
+ return DoOperandsMatch(src_inst, dst_inst, 0, 2);
+ case SpvOpDecorate:
+ return DoOperandsMatch(src_inst, dst_inst, 0, 2);
+ case SpvOpMemberDecorate:
+ return DoOperandsMatch(src_inst, dst_inst, 0, 3);
+ case SpvOpExtInst:
+ case SpvOpDecorationGroup:
+ case SpvOpGroupDecorate:
+ case SpvOpGroupMemberDecorate:
+ return false;
+ default:
+ return false;
+ }
+}
+
+bool Differ::AreVariablesMatchable(uint32_t src_id, uint32_t dst_id,
+ uint32_t flexibility) {
+ // 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);
+ const bool dst_is_built_in = GetDecorationValue(
+ dst_id_to_, dst_id, SpvDecorationBuiltIn, &dst_built_in_decoration);
+
+ if (src_is_built_in != dst_is_built_in) {
+ return false;
+ }
+ if (src_is_built_in && src_built_in_decoration != dst_built_in_decoration) {
+ return false;
+ }
+
+ // Check their types and storage classes.
+ SpvStorageClass 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 =
+ GetVarTypeId(dst_id_to_, dst_id, &dst_storage_class);
+
+ if (!DoIdsMatch(src_type_id, dst_type_id)) {
+ return false;
+ }
+ switch (flexibility) {
+ case 0:
+ if (src_storage_class != dst_storage_class) {
+ return false;
+ }
+ break;
+ case 1:
+ if (src_storage_class != dst_storage_class) {
+ // 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;
+
+ if (!((src_is_io && dst_is_private) || (src_is_private && dst_is_io))) {
+ return false;
+ }
+ }
+ break;
+ default:
+ assert(false && "Unreachable");
+ return false;
+ }
+
+ // TODO: Is there any other way to check compatiblity of the variables? It's
+ // easy to tell when the variables definitely don't match, but there's little
+ // information that can be used for a definite match.
+ return true;
+}
+
+bool Differ::MatchOpTypeStruct(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst,
+ uint32_t flexibility) {
+ const uint32_t src_type_id = src_inst->result_id();
+ const uint32_t dst_type_id = dst_inst->result_id();
+
+ bool src_has_name = false, dst_has_name = false;
+ std::string src_name = GetName(src_id_to_, src_type_id, &src_has_name);
+ std::string dst_name = GetName(dst_id_to_, dst_type_id, &dst_has_name);
+
+ // If debug info is present, always match the structs by name.
+ if (src_has_name && dst_has_name) {
+ if (src_name != dst_name) {
+ return false;
+ }
+
+ // 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.
+ if (src_name == "gl_PerVertex") {
+ return MatchPerVertexType(src_type_id, dst_type_id);
+ }
+
+ return true;
+ }
+
+ // If debug info is not present, match the structs by their type.
+
+ // For gl_PerVertex, find the type pointer of this type (array) and match by
+ // storage class. The gl_PerVertex struct is itself found by the BuiltIn
+ // decorations applied to its members.
+ const bool src_is_per_vertex = IsPerVertexType(src_id_to_, src_type_id);
+ const bool dst_is_per_vertex = IsPerVertexType(dst_id_to_, dst_type_id);
+ if (src_is_per_vertex != dst_is_per_vertex) {
+ return false;
+ }
+
+ if (src_is_per_vertex) {
+ return MatchPerVertexType(src_type_id, dst_type_id);
+ }
+
+ switch (flexibility) {
+ case 0:
+ if (src_inst->NumInOperandWords() != dst_inst->NumInOperandWords()) {
+ return false;
+ }
+ return DoOperandsMatch(src_inst, dst_inst, 0,
+ src_inst->NumInOperandWords());
+ case 1:
+ // TODO: match by taking a diff of the fields, and see if there's a >75%
+ // match. Need to then make sure OpMemberName, OpMemberDecorate,
+ // OpAccessChain etc are aware of the struct field matching.
+ return false;
+ default:
+ assert(false && "Unreachable");
+ return false;
+ }
+}
+
+bool Differ::MatchOpConstant(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst,
+ uint32_t flexibility) {
+ // The constants' type must match. In flexibility == 1, match constants of
+ // int and uint, as they are generally interchangeable.
+ switch (flexibility) {
+ case 0:
+ if (!DoesOperandMatch(src_inst->GetOperand(0), dst_inst->GetOperand(0))) {
+ return false;
+ }
+ break;
+ case 1:
+ if (!IsIntType(src_id_to_, src_inst->type_id()) ||
+ !IsIntType(dst_id_to_, dst_inst->type_id())) {
+ return false;
+ }
+ break;
+ default:
+ assert(false && "Unreachable");
+ return false;
+ }
+
+ const opt::Operand& src_value_operand = src_inst->GetOperand(2);
+ const opt::Operand& dst_value_operand = dst_inst->GetOperand(2);
+
+ const uint64_t src_value = src_value_operand.AsLiteralUint64();
+ const uint64_t dst_value = dst_value_operand.AsLiteralUint64();
+
+ // If values are identical, it's a match.
+ if (src_value == dst_value) {
+ return true;
+ }
+
+ // Otherwise, only allow flexibility for float types.
+ if (IsFloatType(src_id_to_, src_inst->type_id()) && flexibility == 1) {
+ // Tolerance is:
+ //
+ // - For float: allow 4 bits of mantissa as error
+ // - For double: allow 6 bits of mantissa as error
+ //
+ // TODO: the above values are arbitrary and a placeholder; investigate the
+ // amount of error resulting from using `printf("%f", f)` and `printf("%lf",
+ // d)` and having glslang parse them.
+ const uint64_t tolerance = src_value_operand.words.size() == 1 ? 16 : 64;
+ return src_value - dst_value < tolerance ||
+ dst_value - src_value < tolerance;
+ }
+
+ return false;
+}
+
+bool Differ::MatchOpSpecConstant(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst) {
+ const uint32_t src_id = src_inst->result_id();
+ const uint32_t dst_id = dst_inst->result_id();
+
+ bool src_has_name = false, dst_has_name = false;
+ std::string src_name = GetName(src_id_to_, src_id, &src_has_name);
+ std::string dst_name = GetName(dst_id_to_, dst_id, &dst_has_name);
+
+ // If debug info is present, always match the spec consts by name.
+ if (src_has_name && dst_has_name) {
+ return src_name == dst_name;
+ }
+
+ // Otherwise, match them by SpecId.
+ uint32_t src_spec_id, dst_spec_id;
+
+ if (GetDecorationValue(src_id_to_, src_id, SpvDecorationSpecId,
+ &src_spec_id) &&
+ GetDecorationValue(dst_id_to_, dst_id, SpvDecorationSpecId,
+ &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->NumInOperandWords() == dst_inst->NumInOperandWords()) {
+ return DoOperandsMatch(src_inst, dst_inst, 0,
+ src_inst->NumInOperandWords());
+ }
+ }
+
+ return false;
+}
+
+bool Differ::MatchOpVariable(const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst,
+ uint32_t flexibility) {
+ const uint32_t src_id = src_inst->result_id();
+ const uint32_t dst_id = dst_inst->result_id();
+
+ const bool src_is_pervertex = IsPerVertexVariable(src_id_to_, src_id);
+ const bool dst_is_pervertex = IsPerVertexVariable(dst_id_to_, dst_id);
+
+ // For gl_PerVertex, make sure the input and output instances are matched
+ // correctly.
+ if (src_is_pervertex != dst_is_pervertex) {
+ return false;
+ }
+ if (src_is_pervertex) {
+ return MatchPerVertexVariable(src_inst, dst_inst);
+ }
+
+ bool src_has_name = false, dst_has_name = false;
+ std::string src_name = GetName(src_id_to_, src_id, &src_has_name);
+ std::string dst_name = GetName(dst_id_to_, dst_id, &dst_has_name);
+
+ // If debug info is present, always match the variables by name.
+ if (src_has_name && dst_has_name) {
+ return src_name == dst_name;
+ }
+
+ // If debug info is not present, see if the variables can be matched by their
+ // 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);
+
+ if (src_is_built_in && AreVariablesMatchable(src_id, dst_id, flexibility)) {
+ return true;
+ }
+
+ SpvStorageClass src_storage_class, dst_storage_class;
+ GetVarTypeId(src_id_to_, src_id, &src_storage_class);
+ GetVarTypeId(dst_id_to_, dst_id, &dst_storage_class);
+
+ if (src_storage_class != dst_storage_class) {
+ return false;
+ }
+
+ // If variables are decorated with set/binding, match by the value of those
+ // decorations.
+ if (!options_.ignore_set_binding) {
+ uint32_t src_set = 0, dst_set = 0;
+ uint32_t src_binding = 0, dst_binding = 0;
+
+ const bool src_has_set = GetDecorationValue(
+ src_id_to_, src_id, SpvDecorationDescriptorSet, &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);
+
+ if (src_has_set && dst_has_set && src_has_binding && dst_has_binding) {
+ return src_set == dst_set && src_binding == dst_binding;
+ }
+ }
+
+ // If variables are decorated with location, match by the value of that
+ // decoration.
+ if (!options_.ignore_location) {
+ uint32_t src_location, dst_location;
+
+ const bool src_has_location = GetDecorationValue(
+ src_id_to_, src_id, SpvDecorationLocation, &src_location);
+ const bool dst_has_location = GetDecorationValue(
+ dst_id_to_, dst_id, SpvDecorationLocation, &dst_location);
+
+ if (src_has_location && dst_has_location) {
+ return src_location == dst_location;
+ }
+ }
+
+ // Currently, there's no other way to match variables.
+ return false;
+}
+
+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 =
+ GetPerVertexStorageClass(src_, src_type_id);
+ SpvStorageClass 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);
+
+ 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));
+
+ return src_storage_class == dst_storage_class;
+}
+
+void Differ::MatchTypeForwardPointersByName(const IdGroup& src,
+ const IdGroup& dst) {
+ // Given two sets of compatible groups of OpTypeForwardPointer instructions,
+ // attempts to match them by name.
+
+ // Group them by debug info and loop over them.
+ GroupIdsAndMatch<std::string>(
+ src, dst, "", &Differ::GetSanitizedName,
+ [this](const IdGroup& src_group, const IdGroup& dst_group) {
+
+ // Match only if there's a unique forward declaration with this debug
+ // name.
+ if (src_group.size() == 1 && dst_group.size() == 1) {
+ id_map_.MapIds(src_group[0], dst_group[0]);
+ }
+ });
+}
+
+void Differ::MatchTypeForwardPointersByTypeOp(const IdGroup& src,
+ const IdGroup& dst) {
+ // Given two sets of compatible groups of OpTypeForwardPointer instructions,
+ // attempts to match them by type op. Must be called after
+ // MatchTypeForwardPointersByName to match as many as possible by debug info.
+
+ // Remove ids that are matched with debug info in
+ // MatchTypeForwardPointersByName.
+ IdGroup src_unmatched_ids;
+ IdGroup dst_unmatched_ids;
+
+ std::copy_if(src.begin(), src.end(), std::back_inserter(src_unmatched_ids),
+ [this](uint32_t id) { return !id_map_.IsSrcMapped(id); });
+ std::copy_if(dst.begin(), dst.end(), std::back_inserter(dst_unmatched_ids),
+ [this](uint32_t id) { return !id_map_.IsDstMapped(id); });
+
+ // Match only if there's a unique forward declaration with this
+ // storage class and type opcode. If both have debug info, they
+ // must not have been matchable.
+ if (src_unmatched_ids.size() == 1 && dst_unmatched_ids.size() == 1) {
+ uint32_t src_id = src_unmatched_ids[0];
+ uint32_t dst_id = dst_unmatched_ids[0];
+ if (!HasName(src_id_to_, src_id) || !HasName(dst_id_to_, dst_id)) {
+ id_map_.MapIds(src_id, dst_id);
+ }
+ }
+}
+
+InstructionList Differ::GetFunctionBody(opt::IRContext* context,
+ opt::Function& function) {
+ // Canonicalize the blocks of the function to produce better diff, for example
+ // to not produce any diff if the src and dst have the same switch/case blocks
+ // but with the cases simply reordered.
+ std::list<opt::BasicBlock*> order;
+ context->cfg()->ComputeStructuredOrder(&function, &*function.begin(), &order);
+
+ // Go over the instructions of the function and add the instructions to a flat
+ // list to simplify future iterations.
+ InstructionList body;
+ for (opt::BasicBlock* block : order) {
+ block->ForEachInst(
+ [&body](const opt::Instruction* inst) { body.push_back(inst); }, true);
+ }
+ body.push_back(function.EndInst());
+
+ return body;
+}
+
+InstructionList Differ::GetFunctionHeader(const opt::Function& function) {
+ // Go over the instructions of the function and add the header instructions to
+ // a flat list to simplify diff generation.
+ InstructionList body;
+ function.WhileEachInst(
+ [&body](const opt::Instruction* inst) {
+ if (inst->opcode() == SpvOpLabel) {
+ return false;
+ }
+ body.push_back(inst);
+ return true;
+ },
+ true, true);
+
+ return body;
+}
+
+void Differ::GetFunctionBodies(opt::IRContext* context, FunctionMap* functions,
+ FunctionInstMap* function_insts) {
+ for (opt::Function& function : *context->module()) {
+ uint32_t id = function.result_id();
+ assert(functions->find(id) == functions->end());
+ assert(function_insts->find(id) == function_insts->end());
+
+ (*functions)[id] = &function;
+
+ InstructionList body = GetFunctionBody(context, function);
+ (*function_insts)[id] = std::move(body);
+ }
+}
+
+void Differ::GetFunctionHeaderInstructions(const opt::Module* module,
+ FunctionInstMap* function_insts) {
+ for (opt::Function& function : *module) {
+ InstructionList body = GetFunctionHeader(function);
+ (*function_insts)[function.result_id()] = std::move(body);
+ }
+}
+
+void Differ::BestEffortMatchFunctions(const IdGroup& src_func_ids,
+ const IdGroup& dst_func_ids,
+ const FunctionInstMap& src_func_insts,
+ const FunctionInstMap& dst_func_insts) {
+ struct MatchResult {
+ uint32_t src_id;
+ uint32_t dst_id;
+ DiffMatch src_match;
+ DiffMatch dst_match;
+ float match_rate;
+ bool operator<(const MatchResult& other) const {
+ return match_rate > other.match_rate;
+ }
+ };
+ std::vector<MatchResult> all_match_results;
+
+ for (const uint32_t src_func_id : src_func_ids) {
+ if (id_map_.IsSrcMapped(src_func_id)) {
+ continue;
+ }
+ const std::string src_name = GetSanitizedName(src_id_to_, src_func_id);
+
+ for (const uint32_t dst_func_id : dst_func_ids) {
+ if (id_map_.IsDstMapped(dst_func_id)) {
+ continue;
+ }
+
+ // Don't match functions that are named, but the names are different.
+ const std::string dst_name = GetSanitizedName(dst_id_to_, dst_func_id);
+ if (src_name != "" && dst_name != "" && src_name != dst_name) {
+ continue;
+ }
+
+ DiffMatch src_match_result, dst_match_result;
+ float match_rate = MatchFunctionBodies(
+ src_func_insts.at(src_func_id), dst_func_insts.at(dst_func_id),
+ &src_match_result, &dst_match_result);
+
+ // Only consider the functions a match if there's at least 60% match.
+ // This is an arbitrary limit that should be tuned.
+ constexpr float pass_match_rate = 0.6f;
+ if (match_rate >= pass_match_rate) {
+ all_match_results.emplace_back(
+ MatchResult{src_func_id, dst_func_id, std::move(src_match_result),
+ std::move(dst_match_result), match_rate});
+ }
+ }
+ }
+
+ std::sort(all_match_results.begin(), all_match_results.end());
+
+ for (const MatchResult& match_result : all_match_results) {
+ if (id_map_.IsSrcMapped(match_result.src_id) ||
+ id_map_.IsDstMapped(match_result.dst_id)) {
+ continue;
+ }
+
+ id_map_.MapIds(match_result.src_id, match_result.dst_id);
+
+ MatchIdsInFunctionBodies(src_func_insts.at(match_result.src_id),
+ dst_func_insts.at(match_result.dst_id),
+ match_result.src_match, match_result.dst_match, 0);
+ }
+}
+
+void Differ::MatchFunctionParamIds(const opt::Function* src_func,
+ const opt::Function* dst_func) {
+ IdGroup src_params;
+ IdGroup dst_params;
+ src_func->ForEachParam(
+ [&src_params](const opt::Instruction* param) {
+ src_params.push_back(param->result_id());
+ },
+ false);
+ dst_func->ForEachParam(
+ [&dst_params](const opt::Instruction* param) {
+ dst_params.push_back(param->result_id());
+ },
+ false);
+
+ GroupIdsAndMatch<std::string>(
+ src_params, dst_params, "", &Differ::GetSanitizedName,
+ [this](const IdGroup& src_group, const IdGroup& dst_group) {
+
+ // There shouldn't be two parameters with the same name, so the ids
+ // should match. There is nothing restricting the SPIR-V however to have
+ // two parameters with the same name, so be resilient against that.
+ if (src_group.size() == 1 && dst_group.size() == 1) {
+ id_map_.MapIds(src_group[0], dst_group[0]);
+ }
+ });
+
+ // Then match the parameters by their type. If there are multiple of them,
+ // match them by their order.
+ GroupIdsAndMatch<uint32_t>(
+ src_params, dst_params, 0, &Differ::GroupIdsHelperGetTypeId,
+ [this](const IdGroup& src_group_by_type_id,
+ const IdGroup& dst_group_by_type_id) {
+
+ const size_t shared_param_count =
+ std::min(src_group_by_type_id.size(), dst_group_by_type_id.size());
+
+ for (size_t param_index = 0; param_index < shared_param_count;
+ ++param_index) {
+ id_map_.MapIds(src_group_by_type_id[0], dst_group_by_type_id[0]);
+ }
+ });
+}
+
+float Differ::MatchFunctionBodies(const InstructionList& src_body,
+ const InstructionList& dst_body,
+ DiffMatch* src_match_result,
+ DiffMatch* dst_match_result) {
+ LongestCommonSubsequence<std::vector<const opt::Instruction*>> lcs(src_body,
+ dst_body);
+
+ uint32_t best_match_length = lcs.Get<const opt::Instruction*>(
+ [this](const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst) {
+ return DoInstructionsMatchFuzzy(src_inst, dst_inst);
+ },
+ src_match_result, dst_match_result);
+
+ // TODO: take the gaps in between matches and match those again with a relaxed
+ // instruction-and-type-only comparison. This can produce a better diff for
+ // example if an array index is changed, causing the OpAccessChain id to not
+ // match and subsequently every operation that's derived from that id.
+ // Usually this mismatch cascades until the next OpStore which doesn't produce
+ // an id.
+
+ return static_cast<float>(best_match_length) * 2.0f /
+ static_cast<float>(src_body.size() + dst_body.size());
+}
+
+void Differ::MatchIdsInFunctionBodies(const InstructionList& src_body,
+ const InstructionList& dst_body,
+ const DiffMatch& src_match_result,
+ const DiffMatch& dst_match_result,
+ uint32_t flexibility) {
+ size_t src_cur = 0;
+ size_t dst_cur = 0;
+
+ while (src_cur < src_body.size() && dst_cur < dst_body.size()) {
+ if (src_match_result[src_cur] && dst_match_result[dst_cur]) {
+ // Match instructions the src and dst instructions.
+ //
+ // TODO: count the matchings between variables discovered this way and
+ // choose the "best match" after all functions have been diffed and all
+ // instructions analyzed.
+ const opt::Instruction* src_inst = src_body[src_cur++];
+ const opt::Instruction* dst_inst = dst_body[dst_cur++];
+
+ // Record the matching between the instructions. This is done only once
+ // (hence flexibility == 0). Calls with non-zero flexibility values will
+ // only deal with matching other ids based on the operands.
+ if (flexibility == 0) {
+ id_map_.MapInsts(src_inst, dst_inst);
+ }
+
+ // Match any unmatched variables referenced by the instructions.
+ MatchVariablesUsedByMatchedInstructions(src_inst, dst_inst, flexibility);
+ continue;
+ }
+ if (!src_match_result[src_cur]) {
+ ++src_cur;
+ }
+ if (!dst_match_result[dst_cur]) {
+ ++dst_cur;
+ }
+ }
+}
+
+void Differ::MatchVariablesUsedByMatchedInstructions(
+ const opt::Instruction* src_inst, const opt::Instruction* dst_inst,
+ uint32_t flexibility) {
+ // For OpAccessChain, OpLoad and OpStore instructions that reference unmatched
+ // variables, match them as a best effort.
+ assert(src_inst->opcode() == dst_inst->opcode());
+ switch (src_inst->opcode()) {
+ default:
+ // TODO: match functions based on OpFunctionCall?
+ break;
+ case SpvOpAccessChain:
+ case SpvOpInBoundsAccessChain:
+ case SpvOpPtrAccessChain:
+ case SpvOpInBoundsPtrAccessChain:
+ case SpvOpLoad:
+ case SpvOpStore:
+ 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) &&
+ IsVariable(dst_id_to_, dst_pointer_id) &&
+ !id_map_.IsSrcMapped(src_pointer_id) &&
+ !id_map_.IsDstMapped(dst_pointer_id) &&
+ AreVariablesMatchable(src_pointer_id, dst_pointer_id, flexibility)) {
+ id_map_.MapIds(src_pointer_id, dst_pointer_id);
+ }
+ break;
+ }
+}
+
+const opt::Instruction* Differ::GetInst(const IdInstructions& id_to,
+ uint32_t id) {
+ assert(id != 0);
+ assert(id < id_to.inst_map_.size());
+
+ const opt::Instruction* inst = id_to.inst_map_[id];
+ assert(inst != nullptr);
+
+ return inst;
+}
+
+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);
+
+ return constant_inst->GetSingleWordInOperand(0);
+}
+
+SpvExecutionModel Differ::GetExecutionModel(const opt::Module* module,
+ uint32_t entry_point_id) {
+ for (const opt::Instruction& inst : module->entry_points()) {
+ assert(inst.opcode() == SpvOpEntryPoint);
+ if (inst.GetSingleWordOperand(1) == entry_point_id) {
+ return SpvExecutionModel(inst.GetSingleWordOperand(0));
+ }
+ }
+
+ assert(false && "Unreachable");
+ return SpvExecutionModel(0xFFF);
+}
+
+bool Differ::HasName(const IdInstructions& id_to, uint32_t id) {
+ assert(id != 0);
+ assert(id < id_to.name_map_.size());
+
+ for (const opt::Instruction* inst : id_to.name_map_[id]) {
+ if (inst->opcode() == SpvOpName) {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+std::string Differ::GetName(const IdInstructions& id_to, uint32_t id,
+ bool* has_name) {
+ assert(id != 0);
+ assert(id < id_to.name_map_.size());
+
+ for (const opt::Instruction* inst : id_to.name_map_[id]) {
+ if (inst->opcode() == SpvOpName) {
+ *has_name = true;
+ return inst->GetOperand(1).AsString();
+ }
+ }
+
+ *has_name = false;
+ return "";
+}
+
+std::string Differ::GetSanitizedName(const IdInstructions& id_to, uint32_t id) {
+ bool has_name = false;
+ std::string name = GetName(id_to, id, &has_name);
+
+ if (!has_name) {
+ return "";
+ }
+
+ // Remove args from the name, in case this is a function name
+ return name.substr(0, name.find('('));
+}
+
+uint32_t Differ::GetVarTypeId(const IdInstructions& id_to, uint32_t var_id,
+ SpvStorageClass* storage_class) {
+ const opt::Instruction* var_inst = GetInst(id_to, var_id);
+ assert(var_inst->opcode() == SpvOpVariable);
+
+ *storage_class = SpvStorageClass(var_inst->GetSingleWordInOperand(0));
+
+ // Get the type pointer from the variable.
+ const uint32_t type_pointer_id = var_inst->type_id();
+ const opt::Instruction* type_pointer_inst = GetInst(id_to, type_pointer_id);
+
+ // Get the type from the type pointer.
+ return type_pointer_inst->GetSingleWordInOperand(1);
+}
+
+bool Differ::GetDecorationValue(const IdInstructions& id_to, uint32_t id,
+ SpvDecoration 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 &&
+ inst->GetSingleWordOperand(0) == id &&
+ inst->GetSingleWordOperand(1) == decoration) {
+ *decoration_value = inst->GetSingleWordOperand(2);
+ return true;
+ }
+ }
+
+ return false;
+}
+
+const opt::Instruction* Differ::GetForwardPointerInst(
+ const IdInstructions& id_to, uint32_t id) {
+ assert(id != 0);
+ assert(id < id_to.forward_pointer_map_.size());
+ return id_to.forward_pointer_map_[id];
+}
+
+bool Differ::IsIntType(const IdInstructions& id_to, uint32_t type_id) {
+ return IsOp(id_to, type_id, SpvOpTypeInt);
+}
+
+bool Differ::IsFloatType(const IdInstructions& id_to, uint32_t type_id) {
+ return IsOp(id_to, type_id, SpvOpTypeFloat);
+}
+
+bool Differ::IsConstantUint(const IdInstructions& id_to, uint32_t id) {
+ const opt::Instruction* constant_inst = GetInst(id_to, id);
+ if (constant_inst->opcode() != SpvOpConstant) {
+ return false;
+ }
+
+ const opt::Instruction* type_inst = GetInst(id_to, constant_inst->type_id());
+ return type_inst->opcode() == SpvOpTypeInt;
+}
+
+bool Differ::IsVariable(const IdInstructions& id_to, uint32_t pointer_id) {
+ return IsOp(id_to, pointer_id, SpvOpVariable);
+}
+
+bool Differ::IsOp(const IdInstructions& id_to, uint32_t id, SpvOp op) {
+ return GetInst(id_to, id)->opcode() == op;
+}
+
+bool Differ::IsPerVertexType(const IdInstructions& id_to, uint32_t type_id) {
+ assert(type_id != 0);
+ assert(type_id < id_to.decoration_map_.size());
+
+ for (const opt::Instruction* inst : id_to.decoration_map_[type_id]) {
+ if (inst->opcode() == SpvOpMemberDecorate &&
+ inst->GetSingleWordOperand(0) == type_id &&
+ inst->GetSingleWordOperand(2) == SpvDecorationBuiltIn) {
+ SpvBuiltIn built_in = SpvBuiltIn(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 false;
+}
+
+bool Differ::IsPerVertexVariable(const IdInstructions& id_to, uint32_t var_id) {
+ // Get the type from the type pointer.
+ SpvStorageClass 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) {
+ type_id = type_inst->GetSingleWordInOperand(0);
+ }
+
+ // Now check if the type is gl_PerVertex.
+ return IsPerVertexType(id_to, type_id);
+}
+
+SpvStorageClass Differ::GetPerVertexStorageClass(const opt::Module* module,
+ uint32_t type_id) {
+ for (const opt::Instruction& inst : module->types_values()) {
+ switch (inst.opcode()) {
+ case SpvOpTypeArray:
+ // 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:
+ // Find the storage class of the pointer to this type.
+ if (inst.GetSingleWordInOperand(1) == type_id) {
+ return SpvStorageClass(inst.GetSingleWordInOperand(0));
+ }
+ break;
+ default:
+ break;
+ }
+ }
+
+ // 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;
+}
+
+spv_ext_inst_type_t Differ::GetExtInstType(const IdInstructions& id_to,
+ uint32_t set_id) {
+ const opt::Instruction* set_inst = GetInst(id_to, set_id);
+ return spvExtInstImportTypeGet(set_inst->GetInOperand(0).AsString().c_str());
+}
+
+spv_number_kind_t Differ::GetNumberKind(const IdInstructions& id_to,
+ const opt::Instruction& inst,
+ uint32_t operand_index,
+ uint32_t* number_bit_width) {
+ const opt::Operand& operand = inst.GetOperand(operand_index);
+ *number_bit_width = 0;
+
+ // A very limited version of Parser::parseOperand.
+ switch (operand.type) {
+ case SPV_OPERAND_TYPE_LITERAL_INTEGER:
+ case SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER:
+ // Always unsigned integers.
+ *number_bit_width = 32;
+ return SPV_NUMBER_UNSIGNED_INT;
+ case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER:
+ case SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER:
+ switch (inst.opcode()) {
+ case SpvOpSwitch:
+ case SpvOpConstant:
+ case SpvOpSpecConstant:
+ // Same kind of number as the selector (OpSwitch) or the type
+ // (Op*Constant).
+ return GetTypeNumberKind(id_to, inst.GetSingleWordOperand(0),
+ number_bit_width);
+ default:
+ assert(false && "Unreachable");
+ break;
+ }
+ break;
+ default:
+ break;
+ }
+
+ return SPV_NUMBER_NONE;
+}
+
+spv_number_kind_t Differ::GetTypeNumberKind(const IdInstructions& id_to,
+ uint32_t id,
+ uint32_t* number_bit_width) {
+ const opt::Instruction* type_inst = GetInst(id_to, id);
+ if (!spvOpcodeIsScalarType(type_inst->opcode())) {
+ type_inst = GetInst(id_to, type_inst->type_id());
+ }
+
+ switch (type_inst->opcode()) {
+ case SpvOpTypeInt:
+ *number_bit_width = type_inst->GetSingleWordOperand(1);
+ return type_inst->GetSingleWordOperand(2) == 0 ? SPV_NUMBER_UNSIGNED_INT
+ : SPV_NUMBER_SIGNED_INT;
+ break;
+ case SpvOpTypeFloat:
+ *number_bit_width = type_inst->GetSingleWordOperand(1);
+ return SPV_NUMBER_FLOATING;
+ default:
+ assert(false && "Unreachable");
+ return SPV_NUMBER_NONE;
+ }
+}
+
+void Differ::MatchCapabilities() {
+ MatchPreambleInstructions(src_->capabilities(), dst_->capabilities());
+}
+
+void Differ::MatchExtensions() {
+ MatchPreambleInstructions(src_->extensions(), dst_->extensions());
+}
+
+void Differ::MatchExtInstImportIds() {
+ // Bunch all of this section's ids as potential matches.
+ PotentialIdMap potential_id_map;
+ auto get_result_id = [](const opt::Instruction& inst) {
+ return inst.result_id();
+ };
+ auto accept_all = [](const opt::Instruction&) { return true; };
+
+ PoolPotentialIds(src_->ext_inst_imports(), potential_id_map.src_ids, true,
+ accept_all, get_result_id);
+ PoolPotentialIds(dst_->ext_inst_imports(), potential_id_map.dst_ids, false,
+ accept_all, get_result_id);
+
+ // Then match the ids.
+ MatchIds(potential_id_map, [](const opt::Instruction* src_inst,
+ const opt::Instruction* dst_inst) {
+ // Match OpExtInstImport by exact name, which is operand 1
+ const opt::Operand& src_name = src_inst->GetOperand(1);
+ const opt::Operand& dst_name = dst_inst->GetOperand(1);
+
+ return src_name.AsString() == dst_name.AsString();
+ });
+}
+void Differ::MatchMemoryModel() {
+ // Always match the memory model instructions, there is always a single one of
+ // it.
+ id_map_.MapInsts(src_->GetMemoryModel(), dst_->GetMemoryModel());
+}
+
+void Differ::MatchEntryPointIds() {
+ // Match OpEntryPoint ids (at index 1) by ExecutionModel (at index 0) and
+ // possibly name (at index 2). OpEntryPoint doesn't produce a result id, so
+ // this function doesn't use the helpers the other functions use.
+
+ // Map from execution model to OpEntryPoint instructions of that model.
+ using ExecutionModelMap =
+ std::unordered_map<uint32_t, std::vector<const opt::Instruction*>>;
+ ExecutionModelMap src_entry_points_map;
+ ExecutionModelMap dst_entry_points_map;
+ std::set<uint32_t> all_execution_models;
+
+ for (const opt::Instruction& src_inst : src_->entry_points()) {
+ uint32_t execution_model = src_inst.GetSingleWordOperand(0);
+ src_entry_points_map[execution_model].push_back(&src_inst);
+ all_execution_models.insert(execution_model);
+ }
+ for (const opt::Instruction& dst_inst : dst_->entry_points()) {
+ uint32_t execution_model = dst_inst.GetSingleWordOperand(0);
+ dst_entry_points_map[execution_model].push_back(&dst_inst);
+ all_execution_models.insert(execution_model);
+ }
+
+ // Go through each model and match the ids.
+ for (const uint32_t execution_model : all_execution_models) {
+ auto& src_insts = src_entry_points_map[execution_model];
+ auto& dst_insts = dst_entry_points_map[execution_model];
+
+ // If there is only one entry point in src and dst with that model, match
+ // them unconditionally.
+ if (src_insts.size() == 1 && dst_insts.size() == 1) {
+ uint32_t src_id = src_insts[0]->GetSingleWordOperand(1);
+ uint32_t dst_id = dst_insts[0]->GetSingleWordOperand(1);
+ id_map_.MapIds(src_id, dst_id);
+ id_map_.MapInsts(src_insts[0], dst_insts[0]);
+ continue;
+ }
+
+ // Otherwise match them by name.
+ bool matched = false;
+ for (const opt::Instruction* src_inst : src_insts) {
+ for (const opt::Instruction* dst_inst : dst_insts) {
+ const opt::Operand& src_name = src_inst->GetOperand(2);
+ const opt::Operand& dst_name = dst_inst->GetOperand(2);
+
+ if (src_name.AsString() == dst_name.AsString()) {
+ uint32_t src_id = src_inst->GetSingleWordOperand(1);
+ uint32_t dst_id = dst_inst->GetSingleWordOperand(1);
+ id_map_.MapIds(src_id, dst_id);
+ id_map_.MapInsts(src_inst, dst_inst);
+ matched = true;
+ break;
+ }
+ }
+ if (matched) {
+ break;
+ }
+ }
+ }
+}
+
+void Differ::MatchExecutionModes() {
+ MatchPreambleInstructions(src_->execution_modes(), dst_->execution_modes());
+}
+
+void Differ::MatchTypeForwardPointers() {
+ // Bunch all of type forward pointers as potential matches.
+ PotentialIdMap potential_id_map;
+ auto get_pointer_type_id = [](const opt::Instruction& inst) {
+ return inst.GetSingleWordOperand(0);
+ };
+ auto accept_type_forward_pointer_ops = [](const opt::Instruction& inst) {
+ return inst.opcode() == SpvOpTypeForwardPointer;
+ };
+
+ PoolPotentialIds(src_->types_values(), potential_id_map.src_ids, true,
+ accept_type_forward_pointer_ops, get_pointer_type_id);
+ PoolPotentialIds(dst_->types_values(), potential_id_map.dst_ids, false,
+ accept_type_forward_pointer_ops, get_pointer_type_id);
+
+ // Matching types with cyclical references (i.e. in the style of linked lists)
+ // can get very complex. Currently, the diff tool matches types bottom up, so
+ // on every instruction it expects to know if its operands are already matched
+ // or not. With cyclical references, it cannot know that. Type matching may
+ // need significant modifications to be able to support this use case.
+ //
+ // Currently, forwarded types are only matched by storage class and debug
+ // info, with minimal matching of the type being forwarded:
+ //
+ // - Group by class
+ // - Group by OpType being pointed to
+ // - Group by debug info
+ // - If same name and unique, match
+ // - If leftover is unique, match
+
+ // Group forwarded pointers by storage class first and loop over them.
+ GroupIdsAndMatch<SpvStorageClass>(
+ potential_id_map.src_ids, potential_id_map.dst_ids, SpvStorageClassMax,
+ &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<SpvOp>(
+ src_group_by_storage_class, dst_group_by_storage_class, SpvOpMax,
+ &Differ::GroupIdsHelperGetTypePointerTypeOp,
+ [this](const IdGroup& src_group_by_type_op,
+ const IdGroup& dst_group_by_type_op) {
+
+ // Group them even further by debug info, if possible and match by
+ // debug name.
+ MatchTypeForwardPointersByName(src_group_by_type_op,
+ dst_group_by_type_op);
+
+ // Match the leftovers only if they lack debug info and there is
+ // only one instance of them.
+ MatchTypeForwardPointersByTypeOp(src_group_by_type_op,
+ dst_group_by_type_op);
+ });
+ });
+
+ // Match the instructions that forward declare the same type themselves
+ for (uint32_t src_id : potential_id_map.src_ids) {
+ uint32_t dst_id = id_map_.MappedDstId(src_id);
+ if (dst_id == 0) continue;
+
+ const opt::Instruction* src_forward_inst =
+ GetForwardPointerInst(src_id_to_, src_id);
+ const opt::Instruction* dst_forward_inst =
+ GetForwardPointerInst(dst_id_to_, dst_id);
+
+ assert(src_forward_inst);
+ assert(dst_forward_inst);
+
+ id_map_.MapInsts(src_forward_inst, dst_forward_inst);
+ }
+}
+
+void Differ::MatchTypeIds() {
+ // Bunch all of type ids as potential matches.
+ PotentialIdMap potential_id_map;
+ auto get_result_id = [](const opt::Instruction& inst) {
+ return inst.result_id();
+ };
+ auto accept_type_ops = [](const opt::Instruction& inst) {
+ return spvOpcodeGeneratesType(inst.opcode());
+ };
+
+ PoolPotentialIds(src_->types_values(), potential_id_map.src_ids, true,
+ accept_type_ops, get_result_id);
+ PoolPotentialIds(dst_->types_values(), potential_id_map.dst_ids, false,
+ accept_type_ops, get_result_id);
+
+ // Then match the ids. Start with exact matches, then match the leftover with
+ // gradually loosening degrees of strictness. For example, in the absence of
+ // debug info, two block types will be matched if they differ only in a few of
+ // the fields.
+ for (uint32_t flexibility = 0; flexibility < 2; ++flexibility) {
+ 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();
+
+ // Don't match if the opcode is not the same.
+ if (src_op != dst_op) {
+ return false;
+ }
+
+ switch (src_op) {
+ case SpvOpTypeVoid:
+ case SpvOpTypeBool:
+ case SpvOpTypeSampler:
+ // void, bool and sampler are unique, match them.
+ return true;
+ case SpvOpTypeInt:
+ case SpvOpTypeFloat:
+ case SpvOpTypeVector:
+ case SpvOpTypeMatrix:
+ case SpvOpTypeSampledImage:
+ case SpvOpTypeRuntimeArray:
+ case SpvOpTypePointer:
+ // 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:
+ // 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
+ // to match (if provided in both)
+ if (src_inst->NumInOperandWords() != dst_inst->NumInOperandWords()) {
+ return false;
+ }
+ return DoOperandsMatch(src_inst, dst_inst, 0,
+ src_inst->NumInOperandWords());
+
+ case SpvOpTypeArray:
+ // 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.
+ if (!DoOperandsMatch(src_inst, dst_inst, 0, 1)) {
+ return false;
+ }
+
+ if (AreIdenticalUintConstants(src_inst->GetSingleWordInOperand(1),
+ dst_inst->GetSingleWordInOperand(1))) {
+ return true;
+ }
+
+ // If size is not OpConstant, expect the ids to match exactly (for
+ // example if a spec contant is used).
+ return DoOperandsMatch(src_inst, dst_inst, 1, 1);
+
+ case SpvOpTypeStruct:
+ return MatchOpTypeStruct(src_inst, dst_inst, flexibility);
+
+ default:
+ return false;
+ }
+ });
+ }
+}
+
+void Differ::MatchConstants() {
+ // Bunch all of constant ids as potential matches.
+ PotentialIdMap potential_id_map;
+ auto get_result_id = [](const opt::Instruction& inst) {
+ return inst.result_id();
+ };
+ auto accept_type_ops = [](const opt::Instruction& inst) {
+ return spvOpcodeIsConstant(inst.opcode());
+ };
+
+ PoolPotentialIds(src_->types_values(), potential_id_map.src_ids, true,
+ accept_type_ops, get_result_id);
+ PoolPotentialIds(dst_->types_values(), potential_id_map.dst_ids, false,
+ accept_type_ops, get_result_id);
+
+ // Then match the ids. Constants are matched exactly, except for float types
+ // that are first matched exactly, then leftovers are matched with a small
+ // error.
+ for (uint32_t flexibility = 0; flexibility < 2; ++flexibility) {
+ 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();
+
+ // Don't match if the opcode is not the same.
+ if (src_op != dst_op) {
+ return false;
+ }
+
+ switch (src_op) {
+ case SpvOpConstantTrue:
+ case SpvOpConstantFalse:
+ // true and false are unique, match them.
+ return true;
+ case SpvOpConstant:
+ return MatchOpConstant(src_inst, dst_inst, flexibility);
+ case SpvOpConstantComposite:
+ case SpvOpSpecConstantComposite:
+ // Composite constants must match in type and value.
+ //
+ // TODO: match OpConstantNull with OpConstantComposite with all zeros
+ // at flexibility == 1
+ // TODO: match constants from structs that have been flexibly-matched.
+ if (src_inst->NumInOperandWords() != dst_inst->NumInOperandWords()) {
+ return false;
+ }
+ return DoesOperandMatch(src_inst->GetOperand(0),
+ dst_inst->GetOperand(0)) &&
+ DoOperandsMatch(src_inst, dst_inst, 0,
+ src_inst->NumInOperandWords());
+ case SpvOpConstantSampler:
+ // Match sampler constants exactly.
+ // TODO: Allow flexibility in parameters to better diff shaders where
+ // the sampler param has changed.
+ assert(src_inst->NumInOperandWords() ==
+ dst_inst->NumInOperandWords());
+ return DoOperandsMatch(src_inst, dst_inst, 0,
+ src_inst->NumInOperandWords());
+ case SpvOpConstantNull:
+ // 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:
+ // Match spec constants by name if available, then by the SpecId
+ // decoration.
+ return MatchOpSpecConstant(src_inst, dst_inst);
+
+ default:
+ return false;
+ }
+ });
+ }
+}
+
+void Differ::MatchVariableIds() {
+ // Bunch all of variable ids as potential matches.
+ PotentialIdMap potential_id_map;
+ auto get_result_id = [](const opt::Instruction& inst) {
+ return inst.result_id();
+ };
+ auto accept_type_ops = [](const opt::Instruction& inst) {
+ return inst.opcode() == SpvOpVariable;
+ };
+
+ PoolPotentialIds(src_->types_values(), potential_id_map.src_ids, true,
+ accept_type_ops, get_result_id);
+ PoolPotentialIds(dst_->types_values(), potential_id_map.dst_ids, false,
+ accept_type_ops, get_result_id);
+
+ // Then match the ids. Start with exact matches, then match the leftover with
+ // gradually loosening degrees of strictness. For example, in the absence of
+ // debug info, two otherwise identical variables will be matched if one of
+ // them has a Private storage class and the other doesn't.
+ for (uint32_t flexibility = 0; flexibility < 2; ++flexibility) {
+ 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);
+
+ return MatchOpVariable(src_inst, dst_inst, flexibility);
+ });
+ }
+}
+
+void Differ::MatchFunctions() {
+ IdGroup src_func_ids;
+ IdGroup dst_func_ids;
+
+ for (const auto& func : src_funcs_) {
+ src_func_ids.push_back(func.first);
+ }
+ for (const auto& func : dst_funcs_) {
+ dst_func_ids.push_back(func.first);
+ }
+
+ // Base the matching of functions on debug info when available.
+ GroupIdsAndMatch<std::string>(
+ src_func_ids, dst_func_ids, "", &Differ::GetSanitizedName,
+ [this](const IdGroup& src_group, const IdGroup& dst_group) {
+
+ // If there is a single function with this name in src and dst, it's a
+ // definite match.
+ if (src_group.size() == 1 && dst_group.size() == 1) {
+ id_map_.MapIds(src_group[0], dst_group[0]);
+ return;
+ }
+
+ // If there are multiple functions with the same name, group them by
+ // type, and match only if the types match (and are unique).
+ GroupIdsAndMatch<uint32_t>(src_group, dst_group, 0,
+ &Differ::GroupIdsHelperGetTypeId,
+ [this](const IdGroup& src_group_by_type_id,
+ const IdGroup& dst_group_by_type_id) {
+
+ if (src_group_by_type_id.size() == 1 &&
+ dst_group_by_type_id.size() == 1) {
+ id_map_.MapIds(src_group_by_type_id[0],
+ dst_group_by_type_id[0]);
+ }
+ });
+ });
+
+ // Any functions that are left are pooled together and matched as if unnamed,
+ // with the only exception that two functions with mismatching names are not
+ // matched.
+ //
+ // Before that however, the diff of the functions that are matched are taken
+ // and processed, so that more of the global variables can be matched before
+ // attempting to match the rest of the functions. They can contribute to the
+ // precision of the diff of those functions.
+ for (const uint32_t src_func_id : src_func_ids) {
+ const uint32_t dst_func_id = id_map_.MappedDstId(src_func_id);
+ if (dst_func_id == 0) {
+ continue;
+ }
+
+ // Since these functions are definite matches, match their parameters for a
+ // better diff.
+ MatchFunctionParamIds(src_funcs_[src_func_id], dst_funcs_[dst_func_id]);
+
+ // Take the diff of the two functions.
+ DiffMatch src_match_result, dst_match_result;
+ MatchFunctionBodies(src_func_insts_[src_func_id],
+ dst_func_insts_[dst_func_id], &src_match_result,
+ &dst_match_result);
+
+ // Match ids between the two function bodies; which can also result in
+ // global variables getting matched.
+ MatchIdsInFunctionBodies(src_func_insts_[src_func_id],
+ dst_func_insts_[dst_func_id], src_match_result,
+ dst_match_result, 0);
+ }
+
+ // Best effort match functions with matching type.
+ GroupIdsAndMatch<uint32_t>(
+ src_func_ids, dst_func_ids, 0, &Differ::GroupIdsHelperGetTypeId,
+ [this](const IdGroup& src_group_by_type_id,
+ const IdGroup& dst_group_by_type_id) {
+
+ BestEffortMatchFunctions(src_group_by_type_id, dst_group_by_type_id,
+ src_func_insts_, dst_func_insts_);
+ });
+
+ // Any function that's left, best effort match them.
+ BestEffortMatchFunctions(src_func_ids, dst_func_ids, src_func_insts_,
+ dst_func_insts_);
+}
+
+void Differ::MatchDebugs1() {
+ // This section in cludes: OpString, OpSourceExtension, OpSource,
+ // OpSourceContinued
+ MatchDebugAndAnnotationInstructions(src_->debugs1(), dst_->debugs1());
+}
+
+void Differ::MatchDebugs2() {
+ // This section includes: OpName, OpMemberName
+ MatchDebugAndAnnotationInstructions(src_->debugs2(), dst_->debugs2());
+}
+
+void Differ::MatchDebugs3() {
+ // This section includes: OpModuleProcessed
+ MatchDebugAndAnnotationInstructions(src_->debugs3(), dst_->debugs3());
+}
+
+void Differ::MatchExtInstDebugInfo() {
+ // This section includes OpExtInst for DebugInfo extension
+ MatchDebugAndAnnotationInstructions(src_->ext_inst_debuginfo(),
+ dst_->ext_inst_debuginfo());
+}
+
+void Differ::MatchAnnotations() {
+ // This section includes OpDecorate and family.
+ MatchDebugAndAnnotationInstructions(src_->annotations(), dst_->annotations());
+}
+
+const opt::Instruction* Differ::MappedDstInst(
+ const opt::Instruction* src_inst) {
+ return MappedInstImpl(src_inst, id_map_.SrcToDstMap(), dst_id_to_);
+}
+
+const opt::Instruction* Differ::MappedSrcInst(
+ const opt::Instruction* dst_inst) {
+ return MappedInstImpl(dst_inst, id_map_.DstToSrcMap(), src_id_to_);
+}
+
+const opt::Instruction* Differ::MappedInstImpl(
+ const opt::Instruction* inst, const IdMap& to_other,
+ const IdInstructions& other_id_to) {
+ if (inst->HasResultId()) {
+ if (to_other.IsMapped(inst->result_id())) {
+ const uint32_t other_result_id = to_other.MappedId(inst->result_id());
+
+ assert(other_result_id < other_id_to.inst_map_.size());
+ return other_id_to.inst_map_[other_result_id];
+ }
+
+ return nullptr;
+ }
+
+ return to_other.MappedInst(inst);
+}
+
+void Differ::OutputLine(std::function<bool()> are_lines_identical,
+ std::function<void()> output_src_line,
+ std::function<void()> output_dst_line) {
+ if (are_lines_identical()) {
+ out_ << " ";
+ output_src_line();
+ } else {
+ OutputRed();
+ out_ << "-";
+ output_src_line();
+
+ OutputGreen();
+ out_ << "+";
+ output_dst_line();
+
+ OutputResetColor();
+ }
+}
+
+const opt::Instruction* IterInst(opt::Module::const_inst_iterator& iter) {
+ return &*iter;
+}
+
+const opt::Instruction* IterInst(InstructionList::const_iterator& iter) {
+ return *iter;
+}
+
+template <typename InstList>
+void Differ::OutputSection(
+ const InstList& src_insts, const InstList& dst_insts,
+ std::function<void(const opt::Instruction&, const IdInstructions&,
+ const opt::Instruction&)>
+ write_inst) {
+ auto src_iter = src_insts.begin();
+ auto dst_iter = dst_insts.begin();
+
+ // - While src_inst doesn't have a match, output it with -
+ // - While dst_inst doesn't have a match, output it with +
+ // - Now src_inst and dst_inst both have matches; might not match each other!
+ // * If section is unordered, just process src_inst and its match (dst_inst
+ // or not),
+ // dst_inst will eventually be processed when its match is seen.
+ // * If section is ordered, also just process src_inst and its match. Its
+ // match must
+ // necessarily be dst_inst.
+ while (src_iter != src_insts.end() || dst_iter != dst_insts.end()) {
+ OutputRed();
+ while (src_iter != src_insts.end() &&
+ MappedDstInst(IterInst(src_iter)) == nullptr) {
+ out_ << "-";
+ write_inst(*IterInst(src_iter), src_id_to_, *IterInst(src_iter));
+ ++src_iter;
+ }
+ OutputGreen();
+ while (dst_iter != dst_insts.end() &&
+ MappedSrcInst(IterInst(dst_iter)) == nullptr) {
+ out_ << "+";
+ write_inst(ToMappedSrcIds(*IterInst(dst_iter)), dst_id_to_,
+ *IterInst(dst_iter));
+ ++dst_iter;
+ }
+ OutputResetColor();
+
+ if (src_iter != src_insts.end() && dst_iter != dst_insts.end()) {
+ const opt::Instruction* src_inst = IterInst(src_iter);
+ const opt::Instruction* matched_dst_inst = MappedDstInst(src_inst);
+
+ assert(matched_dst_inst != nullptr);
+ assert(MappedSrcInst(IterInst(dst_iter)) != nullptr);
+
+ OutputLine(
+ [this, src_inst, matched_dst_inst]() {
+ return DoInstructionsMatch(src_inst, matched_dst_inst);
+ },
+ [this, src_inst, &write_inst]() {
+ write_inst(*src_inst, src_id_to_, *src_inst);
+ },
+ [this, matched_dst_inst, &write_inst]() {
+ write_inst(ToMappedSrcIds(*matched_dst_inst), dst_id_to_,
+ *matched_dst_inst);
+ });
+
+ ++src_iter;
+ ++dst_iter;
+ }
+ }
+}
+
+void Differ::ToParsedInstruction(
+ const opt::Instruction& inst, const IdInstructions& id_to,
+ const opt::Instruction& original_inst,
+ spv_parsed_instruction_t* parsed_inst,
+ std::vector<spv_parsed_operand_t>& parsed_operands,
+ std::vector<uint32_t>& inst_binary) {
+ inst.ToBinaryWithoutAttachedDebugInsts(&inst_binary);
+ parsed_operands.resize(inst.NumOperands());
+
+ parsed_inst->words = inst_binary.data();
+ parsed_inst->num_words = static_cast<uint16_t>(inst_binary.size());
+ parsed_inst->opcode = static_cast<uint16_t>(inst.opcode());
+ parsed_inst->ext_inst_type =
+ inst.opcode() == SpvOpExtInst
+ ? GetExtInstType(id_to, original_inst.GetSingleWordInOperand(0))
+ : SPV_EXT_INST_TYPE_NONE;
+ parsed_inst->type_id =
+ inst.HasResultType() ? inst.GetSingleWordOperand(0) : 0;
+ parsed_inst->result_id = inst.HasResultId() ? inst.result_id() : 0;
+ parsed_inst->operands = parsed_operands.data();
+ parsed_inst->num_operands = static_cast<uint16_t>(parsed_operands.size());
+
+ // Word 0 is always op and num_words, so operands start at offset 1.
+ uint32_t offset = 1;
+ for (uint16_t operand_index = 0; operand_index < parsed_inst->num_operands;
+ ++operand_index) {
+ const opt::Operand& operand = inst.GetOperand(operand_index);
+ spv_parsed_operand_t& parsed_operand = parsed_operands[operand_index];
+
+ parsed_operand.offset = static_cast<uint16_t>(offset);
+ parsed_operand.num_words = static_cast<uint16_t>(operand.words.size());
+ parsed_operand.type = operand.type;
+ parsed_operand.number_kind = GetNumberKind(
+ id_to, original_inst, operand_index, &parsed_operand.number_bit_width);
+
+ offset += parsed_operand.num_words;
+ }
+}
+
+opt::Instruction Differ::ToMappedSrcIds(const opt::Instruction& dst_inst) {
+ // Create an identical instruction to dst_inst, except ids are changed to the
+ // mapped one.
+ opt::Instruction mapped_inst = dst_inst;
+
+ for (uint32_t operand_index = 0; operand_index < mapped_inst.NumOperands();
+ ++operand_index) {
+ opt::Operand& operand = mapped_inst.GetOperand(operand_index);
+
+ if (spvIsIdType(operand.type)) {
+ assert(id_map_.IsDstMapped(operand.AsId()));
+ operand.words[0] = id_map_.MappedSrcId(operand.AsId());
+ }
+ }
+
+ return mapped_inst;
+}
+
+spv_result_t Differ::Output() {
+ id_map_.MapUnmatchedIds();
+ src_id_to_.inst_map_.resize(id_map_.SrcToDstMap().IdBound(), nullptr);
+ dst_id_to_.inst_map_.resize(id_map_.DstToSrcMap().IdBound(), nullptr);
+
+ const spv_target_env target_env = SPV_ENV_UNIVERSAL_1_6;
+ spv_opcode_table opcode_table;
+ spv_operand_table operand_table;
+ spv_ext_inst_table ext_inst_table;
+ spv_result_t result;
+
+ result = spvOpcodeTableGet(&opcode_table, target_env);
+ if (result != SPV_SUCCESS) return result;
+
+ result = spvOperandTableGet(&operand_table, target_env);
+ if (result != SPV_SUCCESS) return result;
+
+ result = spvExtInstTableGet(&ext_inst_table, target_env);
+ if (result != SPV_SUCCESS) return result;
+
+ spv_context_t context{
+ target_env,
+ opcode_table,
+ operand_table,
+ ext_inst_table,
+ };
+
+ const AssemblyGrammar grammar(&context);
+ if (!grammar.isValid()) return SPV_ERROR_INVALID_TABLE;
+
+ uint32_t disassembly_options = SPV_BINARY_TO_TEXT_OPTION_PRINT;
+ if (options_.indent) {
+ disassembly_options |= SPV_BINARY_TO_TEXT_OPTION_INDENT;
+ }
+
+ NameMapper name_mapper = GetTrivialNameMapper();
+ disassemble::InstructionDisassembler dis(grammar, out_, disassembly_options,
+ name_mapper);
+
+ if (!options_.no_header) {
+ // Output the header
+ // TODO: when using diff with text, the assembler overrides the version and
+ // generator, so these aren't reflected correctly in the output. Could
+ // potentially extract this info from the header comment.
+ OutputLine([]() { return true; }, [&dis]() { dis.EmitHeaderSpirv(); },
+ []() { assert(false && "Unreachable"); });
+ OutputLine([this]() { return src_->version() == dst_->version(); },
+ [this, &dis]() { dis.EmitHeaderVersion(src_->version()); },
+ [this, &dis]() { dis.EmitHeaderVersion(dst_->version()); });
+ OutputLine([this]() { return src_->generator() == dst_->generator(); },
+ [this, &dis]() { dis.EmitHeaderGenerator(src_->generator()); },
+ [this, &dis]() { dis.EmitHeaderGenerator(dst_->generator()); });
+ OutputLine(
+ [this]() { return src_->IdBound() == id_map_.SrcToDstMap().IdBound(); },
+ [this, &dis]() { dis.EmitHeaderIdBound(src_->IdBound()); },
+ [this, &dis]() {
+ dis.EmitHeaderIdBound(id_map_.SrcToDstMap().IdBound());
+ });
+ OutputLine([this]() { return src_->schema() == dst_->schema(); },
+ [this, &dis]() { dis.EmitHeaderSchema(src_->schema()); },
+ [this, &dis]() { dis.EmitHeaderSchema(dst_->schema()); });
+ }
+
+ // For each section, iterate both modules and output the disassembly.
+ auto write_inst = [this, &dis](const opt::Instruction& inst,
+ const IdInstructions& id_to,
+ const opt::Instruction& original_inst) {
+ spv_parsed_instruction_t parsed_inst;
+ std::vector<spv_parsed_operand_t> parsed_operands;
+ std::vector<uint32_t> inst_binary;
+
+ ToParsedInstruction(inst, id_to, original_inst, &parsed_inst,
+ parsed_operands, inst_binary);
+
+ dis.EmitInstruction(parsed_inst, 0);
+ };
+
+ OutputSection(src_->capabilities(), dst_->capabilities(), write_inst);
+ OutputSection(src_->extensions(), dst_->extensions(), write_inst);
+ OutputSection(src_->ext_inst_imports(), dst_->ext_inst_imports(), write_inst);
+
+ // There is only one memory model.
+ OutputLine(
+ [this]() {
+ return DoInstructionsMatch(src_->GetMemoryModel(),
+ dst_->GetMemoryModel());
+ },
+ [this, &write_inst]() {
+ write_inst(*src_->GetMemoryModel(), src_id_to_,
+ *src_->GetMemoryModel());
+ },
+ [this, &write_inst]() {
+ write_inst(*dst_->GetMemoryModel(), dst_id_to_,
+ *dst_->GetMemoryModel());
+ });
+
+ OutputSection(src_->entry_points(), dst_->entry_points(), write_inst);
+ OutputSection(src_->execution_modes(), dst_->execution_modes(), write_inst);
+ OutputSection(src_->debugs1(), dst_->debugs1(), write_inst);
+ OutputSection(src_->debugs2(), dst_->debugs2(), write_inst);
+ OutputSection(src_->debugs3(), dst_->debugs3(), write_inst);
+ OutputSection(src_->ext_inst_debuginfo(), dst_->ext_inst_debuginfo(),
+ write_inst);
+ OutputSection(src_->annotations(), dst_->annotations(), write_inst);
+ OutputSection(src_->types_values(), dst_->types_values(), write_inst);
+
+ // Get the body of all the functions.
+ FunctionInstMap src_func_header_insts;
+ FunctionInstMap dst_func_header_insts;
+
+ GetFunctionHeaderInstructions(src_, &src_func_header_insts);
+ GetFunctionHeaderInstructions(dst_, &dst_func_header_insts);
+
+ for (const auto& src_func : src_func_insts_) {
+ const uint32_t src_func_id = src_func.first;
+ const InstructionList& src_insts = src_func.second;
+ const InstructionList& src_header_insts =
+ src_func_header_insts[src_func_id];
+
+ const uint32_t dst_func_id = id_map_.MappedDstId(src_func_id);
+ if (dst_func_insts_.find(dst_func_id) == dst_func_insts_.end()) {
+ OutputSection(src_header_insts, InstructionList(), write_inst);
+ OutputSection(src_insts, InstructionList(), write_inst);
+ continue;
+ }
+
+ const InstructionList& dst_insts = dst_func_insts_[dst_func_id];
+ const InstructionList& dst_header_insts =
+ dst_func_header_insts[dst_func_id];
+ OutputSection(src_header_insts, dst_header_insts, write_inst);
+ OutputSection(src_insts, dst_insts, write_inst);
+ }
+
+ for (const auto& dst_func : dst_func_insts_) {
+ const uint32_t dst_func_id = dst_func.first;
+ const InstructionList& dst_insts = dst_func.second;
+ const InstructionList& dst_header_insts =
+ dst_func_header_insts[dst_func_id];
+
+ const uint32_t src_func_id = id_map_.MappedSrcId(dst_func_id);
+ if (src_func_insts_.find(src_func_id) == src_func_insts_.end()) {
+ OutputSection(InstructionList(), dst_header_insts, write_inst);
+ OutputSection(InstructionList(), dst_insts, write_inst);
+ }
+ }
+
+ out_ << std::flush;
+
+ return SPV_SUCCESS;
+}
+
+} // anonymous namespace
+
+spv_result_t Diff(opt::IRContext* src, opt::IRContext* dst, std::ostream& out,
+ Options options) {
+ // High level algorithm:
+ //
+ // - Some sections of SPIR-V don't deal with ids; instructions in those
+ // sections are matched identically. For example OpCapability instructions.
+ // - Some sections produce ids, and they can be trivially matched by their
+ // parameters. For example OpExtInstImport instructions.
+ // - Some sections annotate ids. These are matched at the end, after the ids
+ // themselves are matched. For example OpName or OpDecorate instructions.
+ // - Some sections produce ids that depend on other ids and they can be
+ // recursively matched. For example OpType* instructions.
+ // - Some sections produce ids that are not trivially matched. For these ids,
+ // the debug info is used when possible, or a best guess (such as through
+ // decorations) is used. For example OpVariable instructions.
+ // - Matching functions is done with multiple attempts:
+ // * Functions with identical debug names are matched if there are no
+ // overloads.
+ // * Otherwise, functions with identical debug names and types are matched.
+ // * The rest of the functions are best-effort matched, first in groups of
+ // identical type, then any with any.
+ // * The best-effort matching takes the diff of every pair of functions in
+ // a group and selects the top matches that also meet a similarity
+ // index.
+ // * Once a pair of functions are matched, the fuzzy diff of the
+ // instructions is used to match the instructions in the function body.
+ // The fuzzy diff makes sure that sufficiently similar instructions are
+ // matched and that yet-to-be-matched result ids don't result in a larger
+ // diff.
+ //
+ // Once the instructions are matched between the src and dst SPIR-V, the src
+ // is traversed and its disassembly is output. In the process, any unmatched
+ // instruction is prefixed with -, and any unmatched instruction in dst in the
+ // same section is output prefixed with +. To avoid confusion, the
+ // instructions in dst are output with matching ids in src so the output
+ // assembly is consistent.
+
+ Differ differ(src, dst, out, options);
+
+ // First, match instructions between the different non-annotation sections of
+ // the SPIR-V.
+ differ.MatchCapabilities();
+ differ.MatchExtensions();
+ differ.MatchExtInstImportIds();
+ differ.MatchMemoryModel();
+ differ.MatchEntryPointIds();
+ differ.MatchExecutionModes();
+ differ.MatchTypeForwardPointers();
+ differ.MatchTypeIds();
+ differ.MatchConstants();
+ differ.MatchVariableIds();
+ differ.MatchFunctions();
+
+ // Match instructions that annotate previously-matched ids.
+ differ.MatchDebugs1();
+ differ.MatchDebugs2();
+ differ.MatchDebugs3();
+ differ.MatchExtInstDebugInfo();
+ differ.MatchAnnotations();
+
+ // Show the disassembly with the diff.
+ //
+ // TODO: Based on an option, output either based on src or dst, i.e. the diff
+ // can show the ids and instruction/function order either from src or dst.
+ spv_result_t result = differ.Output();
+
+ differ.DumpIdMap();
+
+ return result;
+}
+
+} // namespace diff
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/diff/diff.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/diff/diff.h
new file mode 100644
index 00000000000..932de9eedb3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/diff/diff.h
@@ -0,0 +1,48 @@
+// Copyright (c) 2022 Google LLC.
+//
+// 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_DIFF_DIFF_H_
+#define SOURCE_DIFF_DIFF_H_
+
+#include "source/opt/ir_context.h"
+
+namespace spvtools {
+namespace diff {
+
+struct Options {
+ bool ignore_set_binding = false;
+ bool ignore_location = false;
+ bool indent = false;
+ bool no_header = false;
+ bool color_output = false;
+ bool dump_id_map = false;
+};
+
+// Given two SPIR-V modules, this function outputs the textual diff of their
+// assembly in `out`. The diff is *semantic*, so that the ordering of certain
+// instructions wouldn't matter.
+//
+// The output is a disassembly of src, with diff(1)-style + and - lines that
+// show how the src is changed into dst. To make this disassembly
+// self-consistent, the ids that are output are all in the space of the src
+// module; e.g. any + lines (showing instructions from the dst module) have
+// their ids mapped to the matched instruction in the src module (or a new id
+// allocated in the src module if unmatched).
+spv_result_t Diff(opt::IRContext* src, opt::IRContext* dst, std::ostream& out,
+ Options options);
+
+} // namespace diff
+} // namespace spvtools
+
+#endif // SOURCE_DIFF_DIFF_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/diff/lcs.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/diff/lcs.h
new file mode 100644
index 00000000000..6c00e86499e
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/diff/lcs.h
@@ -0,0 +1,224 @@
+// Copyright (c) 2022 Google LLC.
+//
+// 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_DIFF_LCS_H_
+#define SOURCE_DIFF_LCS_H_
+
+#include <algorithm>
+#include <cassert>
+#include <cstddef>
+#include <cstdint>
+#include <functional>
+#include <stack>
+#include <vector>
+
+namespace spvtools {
+namespace diff {
+
+// The result of a diff.
+using DiffMatch = std::vector<bool>;
+
+// Helper class to find the longest common subsequence between two function
+// bodies.
+template <typename Sequence>
+class LongestCommonSubsequence {
+ public:
+ LongestCommonSubsequence(const Sequence& src, const Sequence& dst)
+ : src_(src),
+ dst_(dst),
+ table_(src.size(), std::vector<DiffMatchEntry>(dst.size())) {}
+
+ // Given two sequences, it creates a matching between them. The elements are
+ // simply marked as matched in src and dst, with any unmatched element in src
+ // implying a removal and any unmatched element in dst implying an addition.
+ //
+ // Returns the length of the longest common subsequence.
+ template <typename T>
+ uint32_t Get(std::function<bool(T src_elem, T dst_elem)> match,
+ DiffMatch* src_match_result, DiffMatch* dst_match_result);
+
+ private:
+ struct DiffMatchIndex {
+ uint32_t src_offset;
+ uint32_t dst_offset;
+ };
+
+ template <typename T>
+ void CalculateLCS(std::function<bool(T src_elem, T dst_elem)> match);
+ void RetrieveMatch(DiffMatch* src_match_result, DiffMatch* dst_match_result);
+ bool IsInBound(DiffMatchIndex index) {
+ return index.src_offset < src_.size() && index.dst_offset < dst_.size();
+ }
+ bool IsCalculated(DiffMatchIndex index) {
+ assert(IsInBound(index));
+ return table_[index.src_offset][index.dst_offset].valid;
+ }
+ bool IsCalculatedOrOutOfBound(DiffMatchIndex index) {
+ return !IsInBound(index) || IsCalculated(index);
+ }
+ uint32_t GetMemoizedLength(DiffMatchIndex index) {
+ if (!IsInBound(index)) {
+ return 0;
+ }
+ assert(IsCalculated(index));
+ return table_[index.src_offset][index.dst_offset].best_match_length;
+ }
+ bool IsMatched(DiffMatchIndex index) {
+ assert(IsCalculated(index));
+ return table_[index.src_offset][index.dst_offset].matched;
+ }
+ void MarkMatched(DiffMatchIndex index, uint32_t best_match_length,
+ bool matched) {
+ assert(IsInBound(index));
+ DiffMatchEntry& entry = table_[index.src_offset][index.dst_offset];
+ assert(!entry.valid);
+
+ entry.best_match_length = best_match_length & 0x3FFFFFFF;
+ assert(entry.best_match_length == best_match_length);
+ entry.matched = matched;
+ entry.valid = true;
+ }
+
+ const Sequence& src_;
+ const Sequence& dst_;
+
+ struct DiffMatchEntry {
+ DiffMatchEntry() : best_match_length(0), matched(false), valid(false) {}
+
+ uint32_t best_match_length : 30;
+ // Whether src[i] and dst[j] matched. This is an optimization to avoid
+ // calling the `match` function again when walking the LCS table.
+ uint32_t matched : 1;
+ // Use for the recursive algorithm to know if the contents of this entry are
+ // valid.
+ uint32_t valid : 1;
+ };
+
+ std::vector<std::vector<DiffMatchEntry>> table_;
+};
+
+template <typename Sequence>
+template <typename T>
+uint32_t LongestCommonSubsequence<Sequence>::Get(
+ std::function<bool(T src_elem, T dst_elem)> match,
+ DiffMatch* src_match_result, DiffMatch* dst_match_result) {
+ CalculateLCS(match);
+ RetrieveMatch(src_match_result, dst_match_result);
+ return GetMemoizedLength({0, 0});
+}
+
+template <typename Sequence>
+template <typename T>
+void LongestCommonSubsequence<Sequence>::CalculateLCS(
+ std::function<bool(T src_elem, T dst_elem)> match) {
+ // The LCS algorithm is simple. Given sequences s and d, with a:b depicting a
+ // range in python syntax:
+ //
+ // lcs(s[i:], d[j:]) =
+ // lcs(s[i+1:], d[j+1:]) + 1 if s[i] == d[j]
+ // max(lcs(s[i+1:], d[j:]), lcs(s[i:], d[j+1:])) o.w.
+ //
+ // Once the LCS table is filled according to the above, it can be walked and
+ // the best match retrieved.
+ //
+ // This is a recursive function with memoization, which avoids filling table
+ // entries where unnecessary. This makes the best case O(N) instead of
+ // O(N^2). The implemention uses a std::stack to avoid stack overflow on long
+ // sequences.
+
+ if (src_.empty() || dst_.empty()) {
+ return;
+ }
+
+ std::stack<DiffMatchIndex> to_calculate;
+ to_calculate.push({0, 0});
+
+ while (!to_calculate.empty()) {
+ DiffMatchIndex current = to_calculate.top();
+ to_calculate.pop();
+ assert(IsInBound(current));
+
+ // If already calculated through another path, ignore it.
+ if (IsCalculated(current)) {
+ continue;
+ }
+
+ if (match(src_[current.src_offset], dst_[current.dst_offset])) {
+ // If the current elements match, advance both indices and calculate the
+ // LCS if not already. Visit `current` again afterwards, so its
+ // corresponding entry will be updated.
+ DiffMatchIndex next = {current.src_offset + 1, current.dst_offset + 1};
+ if (IsCalculatedOrOutOfBound(next)) {
+ MarkMatched(current, GetMemoizedLength(next) + 1, true);
+ } else {
+ to_calculate.push(current);
+ to_calculate.push(next);
+ }
+ continue;
+ }
+
+ // We've reached a pair of elements that don't match. Calculate the LCS for
+ // both cases of either being left unmatched and take the max. Visit
+ // `current` again afterwards, so its corresponding entry will be updated.
+ DiffMatchIndex next_src = {current.src_offset + 1, current.dst_offset};
+ DiffMatchIndex next_dst = {current.src_offset, current.dst_offset + 1};
+
+ if (IsCalculatedOrOutOfBound(next_src) &&
+ IsCalculatedOrOutOfBound(next_dst)) {
+ uint32_t best_match_length =
+ std::max(GetMemoizedLength(next_src), GetMemoizedLength(next_dst));
+ MarkMatched(current, best_match_length, false);
+ continue;
+ }
+
+ to_calculate.push(current);
+ if (!IsCalculatedOrOutOfBound(next_src)) {
+ to_calculate.push(next_src);
+ }
+ if (!IsCalculatedOrOutOfBound(next_dst)) {
+ to_calculate.push(next_dst);
+ }
+ }
+}
+
+template <typename Sequence>
+void LongestCommonSubsequence<Sequence>::RetrieveMatch(
+ DiffMatch* src_match_result, DiffMatch* dst_match_result) {
+ src_match_result->clear();
+ dst_match_result->clear();
+
+ src_match_result->resize(src_.size(), false);
+ dst_match_result->resize(dst_.size(), false);
+
+ DiffMatchIndex current = {0, 0};
+ while (IsInBound(current)) {
+ if (IsMatched(current)) {
+ (*src_match_result)[current.src_offset++] = true;
+ (*dst_match_result)[current.dst_offset++] = true;
+ continue;
+ }
+
+ if (GetMemoizedLength({current.src_offset + 1, current.dst_offset}) >=
+ GetMemoizedLength({current.src_offset, current.dst_offset + 1})) {
+ ++current.src_offset;
+ } else {
+ ++current.dst_offset;
+ }
+ }
+}
+
+} // namespace diff
+} // namespace spvtools
+
+#endif // SOURCE_DIFF_LCS_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/disassemble.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/disassemble.cpp
index c553988f386..1d61b9f9eac 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/disassemble.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/disassemble.cpp
@@ -17,6 +17,8 @@
// This file contains a disassembler: It converts a SPIR-V binary
// to text.
+#include "source/disassemble.h"
+
#include <algorithm>
#include <cassert>
#include <cstring>
@@ -28,9 +30,7 @@
#include "source/assembly_grammar.h"
#include "source/binary.h"
#include "source/diagnostic.h"
-#include "source/disassemble.h"
#include "source/ext_inst.h"
-#include "source/name_mapper.h"
#include "source/opcode.h"
#include "source/parsed_operand.h"
#include "source/print.h"
@@ -40,29 +40,21 @@
#include "source/util/make_unique.h"
#include "spirv-tools/libspirv.h"
+namespace spvtools {
namespace {
// A Disassembler instance converts a SPIR-V binary to its assembly
// representation.
class Disassembler {
public:
- Disassembler(const spvtools::AssemblyGrammar& grammar, uint32_t options,
- spvtools::NameMapper name_mapper)
- : grammar_(grammar),
- print_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_PRINT, options)),
- color_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COLOR, options)),
- indent_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_INDENT, options)
- ? kStandardIndent
- : 0),
- comment_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COMMENT, options)),
+ Disassembler(const AssemblyGrammar& grammar, uint32_t options,
+ NameMapper name_mapper)
+ : print_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_PRINT, options)),
text_(),
out_(print_ ? out_stream() : out_stream(text_)),
- stream_(out_.get()),
+ instruction_disassembler_(grammar, out_.get(), options, name_mapper),
header_(!spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_NO_HEADER, options)),
- show_byte_offset_(spvIsInBitfield(
- SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET, options)),
- byte_offset_(0),
- name_mapper_(std::move(name_mapper)) {}
+ byte_offset_(0) {}
// Emits the assembly header for the module, and sets up internal state
// so subsequent callbacks can handle the cases where the entire module
@@ -78,56 +70,13 @@ class Disassembler {
spv_result_t SaveTextResult(spv_text* text_result) const;
private:
- enum { kStandardIndent = 15 };
-
- using out_stream = spvtools::out_stream;
-
- // Emits an operand for the given instruction, where the instruction
- // is at offset words from the start of the binary.
- void EmitOperand(const spv_parsed_instruction_t& inst,
- const uint16_t operand_index);
-
- // Emits a mask expression for the given mask word of the specified type.
- void EmitMaskOperand(const spv_operand_type_t type, const uint32_t word);
-
- // Resets the output color, if color is turned on.
- void ResetColor() {
- if (color_) out_.get() << spvtools::clr::reset{print_};
- }
- // Sets the output to grey, if color is turned on.
- void SetGrey() {
- if (color_) out_.get() << spvtools::clr::grey{print_};
- }
- // Sets the output to blue, if color is turned on.
- void SetBlue() {
- if (color_) out_.get() << spvtools::clr::blue{print_};
- }
- // Sets the output to yellow, if color is turned on.
- void SetYellow() {
- if (color_) out_.get() << spvtools::clr::yellow{print_};
- }
- // Sets the output to red, if color is turned on.
- void SetRed() {
- if (color_) out_.get() << spvtools::clr::red{print_};
- }
- // Sets the output to green, if color is turned on.
- void SetGreen() {
- if (color_) out_.get() << spvtools::clr::green{print_};
- }
-
- const spvtools::AssemblyGrammar& grammar_;
const bool print_; // Should we also print to the standard output stream?
- const bool color_; // Should we print in colour?
- const int indent_; // How much to indent. 0 means don't indent
- const int comment_; // Should we comment the source
spv_endianness_t endian_; // The detected endianness of the binary.
std::stringstream text_; // Captures the text, if not printing.
out_stream out_; // The Output stream. Either to text_ or standard output.
- std::ostream& stream_; // The output std::stream.
- const bool header_; // Should we output header as the leading comment?
- const bool show_byte_offset_; // Should we print byte offset, in hex?
- size_t byte_offset_; // The number of bytes processed so far.
- spvtools::NameMapper name_mapper_;
+ disassemble::InstructionDisassembler instruction_disassembler_;
+ const bool header_; // Should we output header as the leading comment?
+ size_t byte_offset_; // The number of bytes processed so far.
bool inserted_decoration_space_ = false;
bool inserted_debug_space_ = false;
bool inserted_type_space_ = false;
@@ -139,21 +88,11 @@ spv_result_t Disassembler::HandleHeader(spv_endianness_t endian,
endian_ = endian;
if (header_) {
- const char* generator_tool =
- spvGeneratorStr(SPV_GENERATOR_TOOL_PART(generator));
- stream_ << "; SPIR-V\n"
- << "; Version: " << SPV_SPIRV_VERSION_MAJOR_PART(version) << "."
- << SPV_SPIRV_VERSION_MINOR_PART(version) << "\n"
- << "; Generator: " << generator_tool;
- // For unknown tools, print the numeric tool value.
- if (0 == strcmp("Unknown", generator_tool)) {
- stream_ << "(" << SPV_GENERATOR_TOOL_PART(generator) << ")";
- }
- // Print the miscellaneous part of the generator word on the same
- // line as the tool name.
- stream_ << "; " << SPV_GENERATOR_MISC_PART(generator) << "\n"
- << "; Bound: " << id_bound << "\n"
- << "; Schema: " << schema << "\n";
+ instruction_disassembler_.EmitHeaderSpirv();
+ instruction_disassembler_.EmitHeaderVersion(version);
+ instruction_disassembler_.EmitHeaderGenerator(generator);
+ instruction_disassembler_.EmitHeaderIdBound(id_bound);
+ instruction_disassembler_.EmitHeaderSchema(schema);
}
byte_offset_ = SPV_INDEX_INSTRUCTION * sizeof(uint32_t);
@@ -163,31 +102,149 @@ spv_result_t Disassembler::HandleHeader(spv_endianness_t endian,
spv_result_t Disassembler::HandleInstruction(
const spv_parsed_instruction_t& inst) {
- auto opcode = static_cast<SpvOp>(inst.opcode);
- if (comment_ && opcode == SpvOpFunction) {
- stream_ << std::endl;
- stream_ << std::string(indent_, ' ');
- stream_ << "; Function " << name_mapper_(inst.result_id) << std::endl;
- }
- if (comment_ && !inserted_decoration_space_ &&
- spvOpcodeIsDecoration(opcode)) {
- inserted_decoration_space_ = true;
- stream_ << std::endl;
- stream_ << std::string(indent_, ' ');
- stream_ << "; Annotations" << std::endl;
+ instruction_disassembler_.EmitSectionComment(inst, inserted_decoration_space_,
+ inserted_debug_space_,
+ inserted_type_space_);
+
+ instruction_disassembler_.EmitInstruction(inst, byte_offset_);
+
+ byte_offset_ += inst.num_words * sizeof(uint32_t);
+
+ return SPV_SUCCESS;
+}
+
+spv_result_t Disassembler::SaveTextResult(spv_text* text_result) const {
+ if (!print_) {
+ size_t length = text_.str().size();
+ char* str = new char[length + 1];
+ if (!str) return SPV_ERROR_OUT_OF_MEMORY;
+ strncpy(str, text_.str().c_str(), length + 1);
+ spv_text text = new spv_text_t();
+ if (!text) {
+ delete[] str;
+ return SPV_ERROR_OUT_OF_MEMORY;
+ }
+ text->str = str;
+ text->length = length;
+ *text_result = text;
}
- if (comment_ && !inserted_debug_space_ && spvOpcodeIsDebug(opcode)) {
- inserted_debug_space_ = true;
- stream_ << std::endl;
- stream_ << std::string(indent_, ' ');
- stream_ << "; Debug Information" << std::endl;
+ return SPV_SUCCESS;
+}
+
+spv_result_t DisassembleHeader(void* user_data, spv_endianness_t endian,
+ uint32_t /* magic */, uint32_t version,
+ uint32_t generator, uint32_t id_bound,
+ uint32_t schema) {
+ assert(user_data);
+ auto disassembler = static_cast<Disassembler*>(user_data);
+ return disassembler->HandleHeader(endian, version, generator, id_bound,
+ schema);
+}
+
+spv_result_t DisassembleInstruction(
+ void* user_data, const spv_parsed_instruction_t* parsed_instruction) {
+ assert(user_data);
+ auto disassembler = static_cast<Disassembler*>(user_data);
+ return disassembler->HandleInstruction(*parsed_instruction);
+}
+
+// Simple wrapper class to provide extra data necessary for targeted
+// instruction disassembly.
+class WrappedDisassembler {
+ public:
+ WrappedDisassembler(Disassembler* dis, const uint32_t* binary, size_t wc)
+ : disassembler_(dis), inst_binary_(binary), word_count_(wc) {}
+
+ Disassembler* disassembler() { return disassembler_; }
+ const uint32_t* inst_binary() const { return inst_binary_; }
+ size_t word_count() const { return word_count_; }
+
+ private:
+ Disassembler* disassembler_;
+ const uint32_t* inst_binary_;
+ const size_t word_count_;
+};
+
+spv_result_t DisassembleTargetHeader(void* user_data, spv_endianness_t endian,
+ uint32_t /* magic */, uint32_t version,
+ uint32_t generator, uint32_t id_bound,
+ uint32_t schema) {
+ assert(user_data);
+ auto wrapped = static_cast<WrappedDisassembler*>(user_data);
+ return wrapped->disassembler()->HandleHeader(endian, version, generator,
+ id_bound, schema);
+}
+
+spv_result_t DisassembleTargetInstruction(
+ void* user_data, const spv_parsed_instruction_t* parsed_instruction) {
+ assert(user_data);
+ auto wrapped = static_cast<WrappedDisassembler*>(user_data);
+ // Check if this is the instruction we want to disassemble.
+ if (wrapped->word_count() == parsed_instruction->num_words &&
+ std::equal(wrapped->inst_binary(),
+ wrapped->inst_binary() + wrapped->word_count(),
+ parsed_instruction->words)) {
+ // Found the target instruction. Disassemble it and signal that we should
+ // stop searching so we don't output the same instruction again.
+ if (auto error =
+ wrapped->disassembler()->HandleInstruction(*parsed_instruction))
+ return error;
+ return SPV_REQUESTED_TERMINATION;
}
- if (comment_ && !inserted_type_space_ && spvOpcodeGeneratesType(opcode)) {
- inserted_type_space_ = true;
- stream_ << std::endl;
- stream_ << std::string(indent_, ' ');
- stream_ << "; Types, variables and constants" << std::endl;
+ return SPV_SUCCESS;
+}
+
+constexpr int kStandardIndent = 15;
+} // namespace
+
+namespace disassemble {
+InstructionDisassembler::InstructionDisassembler(const AssemblyGrammar& grammar,
+ std::ostream& stream,
+ uint32_t options,
+ NameMapper name_mapper)
+ : grammar_(grammar),
+ stream_(stream),
+ print_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_PRINT, options)),
+ color_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COLOR, options)),
+ indent_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_INDENT, options)
+ ? kStandardIndent
+ : 0),
+ comment_(spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_COMMENT, options)),
+ show_byte_offset_(
+ spvIsInBitfield(SPV_BINARY_TO_TEXT_OPTION_SHOW_BYTE_OFFSET, options)),
+ name_mapper_(std::move(name_mapper)) {}
+
+void InstructionDisassembler::EmitHeaderSpirv() { stream_ << "; SPIR-V\n"; }
+
+void InstructionDisassembler::EmitHeaderVersion(uint32_t version) {
+ stream_ << "; Version: " << SPV_SPIRV_VERSION_MAJOR_PART(version) << "."
+ << SPV_SPIRV_VERSION_MINOR_PART(version) << "\n";
+}
+
+void InstructionDisassembler::EmitHeaderGenerator(uint32_t generator) {
+ const char* generator_tool =
+ spvGeneratorStr(SPV_GENERATOR_TOOL_PART(generator));
+ stream_ << "; Generator: " << generator_tool;
+ // For unknown tools, print the numeric tool value.
+ if (0 == strcmp("Unknown", generator_tool)) {
+ stream_ << "(" << SPV_GENERATOR_TOOL_PART(generator) << ")";
}
+ // Print the miscellaneous part of the generator word on the same
+ // line as the tool name.
+ stream_ << "; " << SPV_GENERATOR_MISC_PART(generator) << "\n";
+}
+
+void InstructionDisassembler::EmitHeaderIdBound(uint32_t id_bound) {
+ stream_ << "; Bound: " << id_bound << "\n";
+}
+
+void InstructionDisassembler::EmitHeaderSchema(uint32_t schema) {
+ stream_ << "; Schema: " << schema << "\n";
+}
+
+void InstructionDisassembler::EmitInstruction(
+ const spv_parsed_instruction_t& inst, size_t inst_byte_offset) {
+ auto opcode = static_cast<SpvOp>(inst.opcode);
if (inst.result_id) {
SetBlue();
@@ -222,20 +279,45 @@ spv_result_t Disassembler::HandleInstruction(
auto saved_flags = stream_.flags();
auto saved_fill = stream_.fill();
stream_ << " ; 0x" << std::setw(8) << std::hex << std::setfill('0')
- << byte_offset_;
+ << inst_byte_offset;
stream_.flags(saved_flags);
stream_.fill(saved_fill);
ResetColor();
}
-
- byte_offset_ += inst.num_words * sizeof(uint32_t);
-
stream_ << "\n";
- return SPV_SUCCESS;
}
-void Disassembler::EmitOperand(const spv_parsed_instruction_t& inst,
- const uint16_t operand_index) {
+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<SpvOp>(inst.opcode);
+ if (comment_ && opcode == SpvOpFunction) {
+ stream_ << std::endl;
+ stream_ << std::string(indent_, ' ');
+ stream_ << "; Function " << name_mapper_(inst.result_id) << std::endl;
+ }
+ if (comment_ && !inserted_decoration_space && spvOpcodeIsDecoration(opcode)) {
+ inserted_decoration_space = true;
+ stream_ << std::endl;
+ stream_ << std::string(indent_, ' ');
+ stream_ << "; Annotations" << std::endl;
+ }
+ if (comment_ && !inserted_debug_space && spvOpcodeIsDebug(opcode)) {
+ inserted_debug_space = true;
+ stream_ << std::endl;
+ stream_ << std::string(indent_, ' ');
+ stream_ << "; Debug Information" << std::endl;
+ }
+ if (comment_ && !inserted_type_space && spvOpcodeGeneratesType(opcode)) {
+ inserted_type_space = true;
+ stream_ << std::endl;
+ stream_ << std::string(indent_, ' ');
+ stream_ << "; Types, variables and constants" << std::endl;
+ }
+}
+
+void InstructionDisassembler::EmitOperand(const spv_parsed_instruction_t& inst,
+ const uint16_t operand_index) {
assert(operand_index < inst.num_operands);
const spv_parsed_operand_t& operand = inst.operands[operand_index];
const uint32_t word = inst.words[operand.offset];
@@ -277,19 +359,17 @@ void Disassembler::EmitOperand(const spv_parsed_instruction_t& inst,
case SPV_OPERAND_TYPE_LITERAL_INTEGER:
case SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER: {
SetRed();
- spvtools::EmitNumericLiteral(&stream_, inst, operand);
+ EmitNumericLiteral(&stream_, inst, operand);
ResetColor();
} break;
case SPV_OPERAND_TYPE_LITERAL_STRING: {
stream_ << "\"";
SetGreen();
- // Strings are always little-endian, and null-terminated.
- // Write out the characters, escaping as needed, and without copying
- // the entire string.
- auto c_str = reinterpret_cast<const char*>(inst.words + operand.offset);
- for (auto p = c_str; *p; ++p) {
- if (*p == '"' || *p == '\\') stream_ << '\\';
- stream_ << *p;
+
+ std::string str = spvDecodeLiteralStringOperand(inst, operand_index);
+ for (char const& c : str) {
+ if (c == '"' || c == '\\') stream_ << '\\';
+ stream_ << c;
}
ResetColor();
stream_ << '"';
@@ -362,8 +442,8 @@ void Disassembler::EmitOperand(const spv_parsed_instruction_t& inst,
ResetColor();
}
-void Disassembler::EmitMaskOperand(const spv_operand_type_t type,
- const uint32_t word) {
+void InstructionDisassembler::EmitMaskOperand(const spv_operand_type_t type,
+ const uint32_t word) {
// Scan the mask from least significant bit to most significant bit. For each
// set bit, emit the name of that bit. Separate multiple names with '|'.
uint32_t remaining_word = word;
@@ -389,88 +469,66 @@ void Disassembler::EmitMaskOperand(const spv_operand_type_t type,
}
}
-spv_result_t Disassembler::SaveTextResult(spv_text* text_result) const {
- if (!print_) {
- size_t length = text_.str().size();
- char* str = new char[length + 1];
- if (!str) return SPV_ERROR_OUT_OF_MEMORY;
- strncpy(str, text_.str().c_str(), length + 1);
- spv_text text = new spv_text_t();
- if (!text) {
- delete[] str;
- return SPV_ERROR_OUT_OF_MEMORY;
- }
- text->str = str;
- text->length = length;
- *text_result = text;
- }
- return SPV_SUCCESS;
+void InstructionDisassembler::ResetColor() {
+ if (color_) stream_ << spvtools::clr::reset{print_};
}
-
-spv_result_t DisassembleHeader(void* user_data, spv_endianness_t endian,
- uint32_t /* magic */, uint32_t version,
- uint32_t generator, uint32_t id_bound,
- uint32_t schema) {
- assert(user_data);
- auto disassembler = static_cast<Disassembler*>(user_data);
- return disassembler->HandleHeader(endian, version, generator, id_bound,
- schema);
+void InstructionDisassembler::SetGrey() {
+ if (color_) stream_ << spvtools::clr::grey{print_};
}
-
-spv_result_t DisassembleInstruction(
- void* user_data, const spv_parsed_instruction_t* parsed_instruction) {
- assert(user_data);
- auto disassembler = static_cast<Disassembler*>(user_data);
- return disassembler->HandleInstruction(*parsed_instruction);
+void InstructionDisassembler::SetBlue() {
+ if (color_) stream_ << spvtools::clr::blue{print_};
}
+void InstructionDisassembler::SetYellow() {
+ if (color_) stream_ << spvtools::clr::yellow{print_};
+}
+void InstructionDisassembler::SetRed() {
+ if (color_) stream_ << spvtools::clr::red{print_};
+}
+void InstructionDisassembler::SetGreen() {
+ if (color_) stream_ << spvtools::clr::green{print_};
+}
+} // namespace disassemble
+
+std::string spvInstructionBinaryToText(const spv_target_env env,
+ const uint32_t* instCode,
+ const size_t instWordCount,
+ const uint32_t* code,
+ const size_t wordCount,
+ const uint32_t options) {
+ spv_context context = spvContextCreate(env);
+ const AssemblyGrammar grammar(context);
+ if (!grammar.isValid()) {
+ spvContextDestroy(context);
+ return "";
+ }
-// Simple wrapper class to provide extra data necessary for targeted
-// instruction disassembly.
-class WrappedDisassembler {
- public:
- WrappedDisassembler(Disassembler* dis, const uint32_t* binary, size_t wc)
- : disassembler_(dis), inst_binary_(binary), word_count_(wc) {}
-
- Disassembler* disassembler() { return disassembler_; }
- const uint32_t* inst_binary() const { return inst_binary_; }
- size_t word_count() const { return word_count_; }
-
- private:
- Disassembler* disassembler_;
- const uint32_t* inst_binary_;
- const size_t word_count_;
-};
+ // Generate friendly names for Ids if requested.
+ std::unique_ptr<FriendlyNameMapper> friendly_mapper;
+ NameMapper name_mapper = GetTrivialNameMapper();
+ if (options & SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES) {
+ friendly_mapper = MakeUnique<FriendlyNameMapper>(context, code, wordCount);
+ name_mapper = friendly_mapper->GetNameMapper();
+ }
-spv_result_t DisassembleTargetHeader(void* user_data, spv_endianness_t endian,
- uint32_t /* magic */, uint32_t version,
- uint32_t generator, uint32_t id_bound,
- uint32_t schema) {
- assert(user_data);
- auto wrapped = static_cast<WrappedDisassembler*>(user_data);
- return wrapped->disassembler()->HandleHeader(endian, version, generator,
- id_bound, schema);
-}
+ // Now disassemble!
+ Disassembler disassembler(grammar, options, name_mapper);
+ WrappedDisassembler wrapped(&disassembler, instCode, instWordCount);
+ spvBinaryParse(context, &wrapped, code, wordCount, DisassembleTargetHeader,
+ DisassembleTargetInstruction, nullptr);
-spv_result_t DisassembleTargetInstruction(
- void* user_data, const spv_parsed_instruction_t* parsed_instruction) {
- assert(user_data);
- auto wrapped = static_cast<WrappedDisassembler*>(user_data);
- // Check if this is the instruction we want to disassemble.
- if (wrapped->word_count() == parsed_instruction->num_words &&
- std::equal(wrapped->inst_binary(),
- wrapped->inst_binary() + wrapped->word_count(),
- parsed_instruction->words)) {
- // Found the target instruction. Disassemble it and signal that we should
- // stop searching so we don't output the same instruction again.
- if (auto error =
- wrapped->disassembler()->HandleInstruction(*parsed_instruction))
- return error;
- return SPV_REQUESTED_TERMINATION;
+ spv_text text = nullptr;
+ std::string output;
+ if (disassembler.SaveTextResult(&text) == SPV_SUCCESS) {
+ output.assign(text->str, text->str + text->length);
+ // Drop trailing newline characters.
+ while (!output.empty() && output.back() == '\n') output.pop_back();
}
- return SPV_SUCCESS;
-}
+ spvTextDestroy(text);
+ spvContextDestroy(context);
-} // namespace
+ return output;
+}
+} // namespace spvtools
spv_result_t spvBinaryToText(const spv_const_context context,
const uint32_t* code, const size_t wordCount,
@@ -495,53 +553,13 @@ spv_result_t spvBinaryToText(const spv_const_context context,
}
// Now disassemble!
- Disassembler disassembler(grammar, options, name_mapper);
- if (auto error = spvBinaryParse(&hijack_context, &disassembler, code,
- wordCount, DisassembleHeader,
- DisassembleInstruction, pDiagnostic)) {
+ spvtools::Disassembler disassembler(grammar, options, name_mapper);
+ if (auto error =
+ spvBinaryParse(&hijack_context, &disassembler, code, wordCount,
+ spvtools::DisassembleHeader,
+ spvtools::DisassembleInstruction, pDiagnostic)) {
return error;
}
return disassembler.SaveTextResult(pText);
}
-
-std::string spvtools::spvInstructionBinaryToText(const spv_target_env env,
- const uint32_t* instCode,
- const size_t instWordCount,
- const uint32_t* code,
- const size_t wordCount,
- const uint32_t options) {
- spv_context context = spvContextCreate(env);
- const spvtools::AssemblyGrammar grammar(context);
- if (!grammar.isValid()) {
- spvContextDestroy(context);
- return "";
- }
-
- // Generate friendly names for Ids if requested.
- std::unique_ptr<spvtools::FriendlyNameMapper> friendly_mapper;
- spvtools::NameMapper name_mapper = spvtools::GetTrivialNameMapper();
- if (options & SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES) {
- friendly_mapper = spvtools::MakeUnique<spvtools::FriendlyNameMapper>(
- context, code, wordCount);
- name_mapper = friendly_mapper->GetNameMapper();
- }
-
- // Now disassemble!
- Disassembler disassembler(grammar, options, name_mapper);
- WrappedDisassembler wrapped(&disassembler, instCode, instWordCount);
- spvBinaryParse(context, &wrapped, code, wordCount, DisassembleTargetHeader,
- DisassembleTargetInstruction, nullptr);
-
- spv_text text = nullptr;
- std::string output;
- if (disassembler.SaveTextResult(&text) == SPV_SUCCESS) {
- output.assign(text->str, text->str + text->length);
- // Drop trailing newline characters.
- while (!output.empty() && output.back() == '\n') output.pop_back();
- }
- spvTextDestroy(text);
- spvContextDestroy(context);
-
- return output;
-}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/disassemble.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/disassemble.h
index ac3574272a9..b520a1ea91a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/disassemble.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/disassemble.h
@@ -15,17 +15,20 @@
#ifndef SOURCE_DISASSEMBLE_H_
#define SOURCE_DISASSEMBLE_H_
+#include <iosfwd>
#include <string>
+#include "source/name_mapper.h"
#include "spirv-tools/libspirv.h"
namespace spvtools {
// Decodes the given SPIR-V instruction binary representation to its assembly
// text. The context is inferred from the provided module binary. The options
-// parameter is a bit field of spv_binary_to_text_options_t. Decoded text will
-// be stored into *text. Any error will be written into *diagnostic if
-// diagnostic is non-null.
+// parameter is a bit field of spv_binary_to_text_options_t (note: the option
+// SPV_BINARY_TO_TEXT_OPTION_PRINT will be ignored). Decoded text will be
+// stored into *text. Any error will be written into *diagnostic if diagnostic
+// is non-null.
std::string spvInstructionBinaryToText(const spv_target_env env,
const uint32_t* inst_binary,
const size_t inst_word_count,
@@ -33,6 +36,63 @@ std::string spvInstructionBinaryToText(const spv_target_env env,
const size_t word_count,
const uint32_t options);
+class AssemblyGrammar;
+namespace disassemble {
+
+// Shared code with other tools (than the disassembler) that might need to
+// output disassembly. An InstructionDisassembler instance converts SPIR-V
+// binary for an instruction to its assembly representation.
+class InstructionDisassembler {
+ public:
+ InstructionDisassembler(const AssemblyGrammar& grammar, std::ostream& stream,
+ uint32_t options, NameMapper name_mapper);
+
+ // Emits the assembly header for the module.
+ void EmitHeaderSpirv();
+ void EmitHeaderVersion(uint32_t version);
+ void EmitHeaderGenerator(uint32_t generator);
+ void EmitHeaderIdBound(uint32_t id_bound);
+ void EmitHeaderSchema(uint32_t schema);
+
+ // Emits the assembly text for the given instruction.
+ void EmitInstruction(const spv_parsed_instruction_t& inst,
+ size_t inst_byte_offset);
+
+ // Emits a comment between different sections of the module.
+ void EmitSectionComment(const spv_parsed_instruction_t& inst,
+ bool& inserted_decoration_space,
+ bool& inserted_debug_space,
+ bool& inserted_type_space);
+
+ // Resets the output color, if color is turned on.
+ void ResetColor();
+ // Set the output color, if color is turned on.
+ void SetGrey();
+ void SetBlue();
+ void SetYellow();
+ void SetRed();
+ void SetGreen();
+
+ private:
+ // Emits an operand for the given instruction, where the instruction
+ // is at offset words from the start of the binary.
+ void EmitOperand(const spv_parsed_instruction_t& inst,
+ const uint16_t operand_index);
+
+ // Emits a mask expression for the given mask word of the specified type.
+ void EmitMaskOperand(const spv_operand_type_t type, const uint32_t word);
+
+ const spvtools::AssemblyGrammar& grammar_;
+ std::ostream& stream_;
+ const bool print_; // Should we also print to the standard output stream?
+ const bool color_; // Should we print in colour?
+ const int indent_; // How much to indent. 0 means don't indent
+ const int comment_; // Should we comment the source
+ const bool show_byte_offset_; // Should we print byte offset, in hex?
+ spvtools::NameMapper name_mapper_;
+};
+
+} // namespace disassemble
} // namespace spvtools
#endif // SOURCE_DISASSEMBLE_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/ext_inst.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/ext_inst.cpp
index 812053ec0ab..4e2795453f4 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/ext_inst.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/ext_inst.cpp
@@ -96,6 +96,8 @@ spv_result_t spvExtInstTableGet(spv_ext_inst_table* pExtInstTable,
case SPV_ENV_UNIVERSAL_1_4:
case SPV_ENV_UNIVERSAL_1_5:
case SPV_ENV_VULKAN_1_2:
+ case SPV_ENV_UNIVERSAL_1_6:
+ case SPV_ENV_VULKAN_1_3:
*pExtInstTable = &kTable_1_0;
return SPV_SUCCESS;
default:
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/ext_inst.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/ext_inst.h
index aff6e308c7d..4027f4c3c81 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/ext_inst.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/ext_inst.h
@@ -27,7 +27,7 @@ bool spvExtInstIsNonSemantic(const spv_ext_inst_type_t type);
// Returns true if the extended instruction set is debug info
bool spvExtInstIsDebugInfo(const spv_ext_inst_type_t type);
-// Finds the named extented instruction of the given type in the given extended
+// Finds the named extended instruction of the given type in the given extended
// instruction table. On success, returns SPV_SUCCESS and writes a handle of
// the instruction entry into *entry.
spv_result_t spvExtInstTableNameLookup(const spv_ext_inst_table table,
@@ -35,7 +35,7 @@ spv_result_t spvExtInstTableNameLookup(const spv_ext_inst_table table,
const char* name,
spv_ext_inst_desc* entry);
-// Finds the extented instruction of the given type in the given extended
+// Finds the extended instruction of the given type in the given extended
// instruction table by value. On success, returns SPV_SUCCESS and writes a
// handle of the instruction entry into *entry.
spv_result_t spvExtInstTableValueLookup(const spv_ext_inst_table table,
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/extensions.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/extensions.cpp
index a94db273e73..049a3ad10ae 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/extensions.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/extensions.cpp
@@ -18,6 +18,7 @@
#include <sstream>
#include <string>
+#include "source/binary.h"
#include "source/enum_string_mapping.h"
namespace spvtools {
@@ -30,8 +31,9 @@ std::string GetExtensionString(const spv_parsed_instruction_t* inst) {
const auto& operand = inst->operands[0];
assert(operand.type == SPV_OPERAND_TYPE_LITERAL_STRING);
assert(inst->num_words > operand.offset);
+ (void)operand; /* No unused variables in release builds. */
- return reinterpret_cast<const char*>(inst->words + operand.offset);
+ return spvDecodeLiteralStringOperand(*inst, 0);
}
std::string ExtensionSetToString(const ExtensionSet& extensions) {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/libspirv.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/libspirv.cpp
index 0bc0935083a..be76caaa8b3 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/libspirv.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/libspirv.cpp
@@ -99,7 +99,9 @@ bool SpirvTools::Disassemble(const uint32_t* binary, const size_t binary_size,
spv_text spvtext = nullptr;
spv_result_t status = spvBinaryToText(impl_->context, binary, binary_size,
options, &spvtext, nullptr);
- if (status == SPV_SUCCESS) {
+ if (status == SPV_SUCCESS &&
+ (options & SPV_BINARY_TO_TEXT_OPTION_PRINT) == 0) {
+ assert(spvtext);
text->assign(spvtext->str, spvtext->str + spvtext->length);
}
spvTextDestroy(spvtext);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/link/linker.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/link/linker.cpp
index 8da4a98d887..3b388cc6ea0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/link/linker.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/link/linker.cpp
@@ -19,6 +19,7 @@
#include <cstring>
#include <iostream>
#include <memory>
+#include <numeric>
#include <string>
#include <unordered_map>
#include <unordered_set>
@@ -33,9 +34,12 @@
#include "source/opt/ir_loader.h"
#include "source/opt/pass_manager.h"
#include "source/opt/remove_duplicates_pass.h"
+#include "source/opt/remove_unused_interface_variables_pass.h"
#include "source/opt/type_manager.h"
+#include "source/spirv_constant.h"
#include "source/spirv_target_env.h"
#include "source/util/make_unique.h"
+#include "source/util/string_utils.h"
#include "spirv-tools/libspirv.hpp"
namespace spvtools {
@@ -85,10 +89,6 @@ spv_result_t ShiftIdsInModules(const MessageConsumer& consumer,
//
// |header| should not be null, |modules| should not be empty and pointers
// should be non-null. |max_id_bound| should be strictly greater than 0.
-//
-// TODO(pierremoreau): What to do when binaries use different versions of
-// SPIR-V? For now, use the max of all versions found in
-// the input modules.
spv_result_t GenerateHeader(const MessageConsumer& consumer,
const std::vector<opt::Module*>& modules,
uint32_t max_id_bound, opt::ModuleHeader* header);
@@ -129,7 +129,7 @@ spv_result_t CheckImportExportCompatibility(const MessageConsumer& consumer,
// Remove linkage specific instructions, such as prototypes of imported
// functions, declarations of imported variables, import (and export if
-// necessary) linkage attribtes.
+// necessary) linkage attributes.
//
// |linked_context| and |decoration_manager| should not be null, and the
// 'RemoveDuplicatePass' should be run first.
@@ -147,6 +147,15 @@ spv_result_t RemoveLinkageSpecificInstructions(
spv_result_t VerifyIds(const MessageConsumer& consumer,
opt::IRContext* linked_context);
+// Verify that the universal limits are not crossed, and warn the user
+// otherwise.
+//
+// TODO(pierremoreau):
+// - Verify against the limits of the environment (e.g. Vulkan limits if
+// consuming vulkan1.x)
+spv_result_t VerifyLimits(const MessageConsumer& consumer,
+ const opt::IRContext& linked_context);
+
spv_result_t ShiftIdsInModules(const MessageConsumer& consumer,
std::vector<opt::Module*>* modules,
uint32_t* max_id_bound) {
@@ -162,29 +171,31 @@ spv_result_t ShiftIdsInModules(const MessageConsumer& consumer,
return DiagnosticStream(position, consumer, "", SPV_ERROR_INVALID_DATA)
<< "|max_id_bound| of ShiftIdsInModules should not be null.";
- uint32_t id_bound = modules->front()->IdBound() - 1u;
+ const size_t id_bound =
+ std::accumulate(modules->begin(), modules->end(), static_cast<size_t>(1),
+ [](const size_t& accumulation, opt::Module* module) {
+ return accumulation + module->IdBound() - 1u;
+ });
+ if (id_bound > std::numeric_limits<uint32_t>::max())
+ return DiagnosticStream(position, consumer, "", SPV_ERROR_INVALID_DATA)
+ << "Too many IDs (" << id_bound
+ << "): combining all modules would overflow the 32-bit word of the "
+ "SPIR-V header.";
+
+ *max_id_bound = static_cast<uint32_t>(id_bound);
+
+ uint32_t id_offset = modules->front()->IdBound() - 1u;
for (auto module_iter = modules->begin() + 1; module_iter != modules->end();
++module_iter) {
Module* module = *module_iter;
- module->ForEachInst([&id_bound](Instruction* insn) {
- insn->ForEachId([&id_bound](uint32_t* id) { *id += id_bound; });
+ module->ForEachInst([&id_offset](Instruction* insn) {
+ insn->ForEachId([&id_offset](uint32_t* id) { *id += id_offset; });
});
- id_bound += module->IdBound() - 1u;
- if (id_bound > 0x3FFFFF)
- return DiagnosticStream(position, consumer, "", SPV_ERROR_INVALID_ID)
- << "The limit of IDs, 4194303, was exceeded:"
- << " " << id_bound << " is the current ID bound.";
+ id_offset += module->IdBound() - 1u;
// Invalidate the DefUseManager
module->context()->InvalidateAnalyses(opt::IRContext::kAnalysisDefUse);
}
- ++id_bound;
- if (id_bound > 0x3FFFFF)
- return DiagnosticStream(position, consumer, "", SPV_ERROR_INVALID_ID)
- << "The limit of IDs, 4194303, was exceeded:"
- << " " << id_bound << " is the current ID bound.";
-
- *max_id_bound = id_bound;
return SPV_SUCCESS;
}
@@ -201,15 +212,25 @@ spv_result_t GenerateHeader(const MessageConsumer& consumer,
return DiagnosticStream(position, consumer, "", SPV_ERROR_INVALID_DATA)
<< "|max_id_bound| of GenerateHeader should not be null.";
- uint32_t version = 0u;
- for (const auto& module : modules)
- version = std::max(version, module->version());
+ const uint32_t linked_version = modules.front()->version();
+ for (std::size_t i = 1; i < modules.size(); ++i) {
+ const uint32_t module_version = modules[i]->version();
+ if (module_version != linked_version)
+ return DiagnosticStream({0, 0, 1}, consumer, "", SPV_ERROR_INTERNAL)
+ << "Conflicting SPIR-V versions: "
+ << SPV_SPIRV_VERSION_MAJOR_PART(linked_version) << "."
+ << SPV_SPIRV_VERSION_MINOR_PART(linked_version)
+ << " (input modules 1 through " << i << ") vs "
+ << SPV_SPIRV_VERSION_MAJOR_PART(module_version) << "."
+ << SPV_SPIRV_VERSION_MINOR_PART(module_version)
+ << " (input module " << (i + 1) << ").";
+ }
header->magic_number = SpvMagicNumber;
- header->version = version;
- header->generator = 17u;
+ header->version = linked_version;
+ header->generator = SPV_GENERATOR_WORD(SPV_GENERATOR_KHRONOS_LINKER, 0);
header->bound = max_id_bound;
- header->reserved = 0u;
+ header->schema = 0u;
return SPV_SUCCESS;
}
@@ -242,55 +263,65 @@ spv_result_t MergeModules(const MessageConsumer& consumer,
linked_module->AddExtInstImport(
std::unique_ptr<Instruction>(inst.Clone(linked_context)));
- do {
- const Instruction* memory_model_inst = input_modules[0]->GetMemoryModel();
- if (memory_model_inst == nullptr) break;
-
- uint32_t addressing_model = memory_model_inst->GetSingleWordOperand(0u);
- uint32_t memory_model = memory_model_inst->GetSingleWordOperand(1u);
- for (const auto& module : input_modules) {
- memory_model_inst = module->GetMemoryModel();
- if (memory_model_inst == nullptr) continue;
-
- if (addressing_model != memory_model_inst->GetSingleWordOperand(0u)) {
- spv_operand_desc initial_desc = nullptr, current_desc = nullptr;
- grammar.lookupOperand(SPV_OPERAND_TYPE_ADDRESSING_MODEL,
- addressing_model, &initial_desc);
- grammar.lookupOperand(SPV_OPERAND_TYPE_ADDRESSING_MODEL,
- memory_model_inst->GetSingleWordOperand(0u),
- &current_desc);
- return DiagnosticStream(position, consumer, "", SPV_ERROR_INTERNAL)
- << "Conflicting addressing models: " << initial_desc->name
- << " vs " << current_desc->name << ".";
- }
- if (memory_model != memory_model_inst->GetSingleWordOperand(1u)) {
- spv_operand_desc initial_desc = nullptr, current_desc = nullptr;
- grammar.lookupOperand(SPV_OPERAND_TYPE_MEMORY_MODEL, memory_model,
- &initial_desc);
- grammar.lookupOperand(SPV_OPERAND_TYPE_MEMORY_MODEL,
- memory_model_inst->GetSingleWordOperand(1u),
- &current_desc);
- return DiagnosticStream(position, consumer, "", SPV_ERROR_INTERNAL)
- << "Conflicting memory models: " << initial_desc->name << " vs "
- << current_desc->name << ".";
- }
+ const Instruction* linked_memory_model_inst =
+ input_modules.front()->GetMemoryModel();
+ if (linked_memory_model_inst == nullptr) {
+ return DiagnosticStream(position, consumer, "", SPV_ERROR_INVALID_BINARY)
+ << "Input module 1 is lacking an OpMemoryModel instruction.";
+ }
+ const uint32_t linked_addressing_model =
+ linked_memory_model_inst->GetSingleWordOperand(0u);
+ const uint32_t linked_memory_model =
+ linked_memory_model_inst->GetSingleWordOperand(1u);
+
+ for (std::size_t i = 1; i < input_modules.size(); ++i) {
+ const Module* module = input_modules[i];
+ const Instruction* memory_model_inst = module->GetMemoryModel();
+ if (memory_model_inst == nullptr)
+ return DiagnosticStream(position, consumer, "", SPV_ERROR_INVALID_BINARY)
+ << "Input module " << (i + 1)
+ << " is lacking an OpMemoryModel instruction.";
+
+ const uint32_t module_addressing_model =
+ memory_model_inst->GetSingleWordOperand(0u);
+ if (module_addressing_model != linked_addressing_model) {
+ spv_operand_desc linked_desc = nullptr, module_desc = nullptr;
+ grammar.lookupOperand(SPV_OPERAND_TYPE_ADDRESSING_MODEL,
+ linked_addressing_model, &linked_desc);
+ grammar.lookupOperand(SPV_OPERAND_TYPE_ADDRESSING_MODEL,
+ module_addressing_model, &module_desc);
+ return DiagnosticStream(position, consumer, "", SPV_ERROR_INTERNAL)
+ << "Conflicting addressing models: " << linked_desc->name
+ << " (input modules 1 through " << i << ") vs "
+ << module_desc->name << " (input module " << (i + 1) << ").";
}
- if (memory_model_inst != nullptr)
- linked_module->SetMemoryModel(std::unique_ptr<Instruction>(
- memory_model_inst->Clone(linked_context)));
- } while (false);
+ const uint32_t module_memory_model =
+ memory_model_inst->GetSingleWordOperand(1u);
+ if (module_memory_model != linked_memory_model) {
+ spv_operand_desc linked_desc = nullptr, module_desc = nullptr;
+ grammar.lookupOperand(SPV_OPERAND_TYPE_MEMORY_MODEL, linked_memory_model,
+ &linked_desc);
+ grammar.lookupOperand(SPV_OPERAND_TYPE_MEMORY_MODEL, module_memory_model,
+ &module_desc);
+ return DiagnosticStream(position, consumer, "", SPV_ERROR_INTERNAL)
+ << "Conflicting memory models: " << linked_desc->name
+ << " (input modules 1 through " << i << ") vs "
+ << module_desc->name << " (input module " << (i + 1) << ").";
+ }
+ }
+ linked_module->SetMemoryModel(std::unique_ptr<Instruction>(
+ linked_memory_model_inst->Clone(linked_context)));
- std::vector<std::pair<uint32_t, const char*>> entry_points;
+ std::vector<std::pair<uint32_t, std::string>> entry_points;
for (const auto& module : input_modules)
for (const auto& inst : module->entry_points()) {
const uint32_t model = inst.GetSingleWordInOperand(0);
- const char* const name =
- reinterpret_cast<const char*>(inst.GetInOperand(2).words.data());
+ const std::string name = inst.GetInOperand(2).AsString();
const auto i = std::find_if(
entry_points.begin(), entry_points.end(),
- [model, name](const std::pair<uint32_t, const char*>& v) {
- return v.first == model && strcmp(name, v.second) == 0;
+ [model, name](const std::pair<uint32_t, std::string>& v) {
+ return v.first == model && v.second == name;
});
if (i != entry_points.end()) {
spv_operand_desc desc = nullptr;
@@ -331,13 +362,10 @@ spv_result_t MergeModules(const MessageConsumer& consumer,
// If the generated module uses SPIR-V 1.1 or higher, add an
// OpModuleProcessed instruction about the linking step.
- if (linked_module->version() >= 0x10100) {
+ if (linked_module->version() >= SPV_SPIRV_VERSION_WORD(1, 1)) {
const std::string processed_string("Linked by SPIR-V Tools Linker");
- const auto num_chars = processed_string.size();
- // Compute num words, accommodate the terminating null character.
- const auto num_words = (num_chars + 1 + 3) / 4;
- std::vector<uint32_t> processed_words(num_words, 0u);
- std::memcpy(processed_words.data(), processed_string.data(), num_chars);
+ std::vector<uint32_t> processed_words =
+ spvtools::utils::MakeVector(processed_string);
linked_module->AddDebug3Inst(std::unique_ptr<Instruction>(
new Instruction(linked_context, SpvOpModuleProcessed, 0u, 0u,
{{SPV_OPERAND_TYPE_LITERAL_STRING, processed_words}})));
@@ -351,18 +379,12 @@ spv_result_t MergeModules(const MessageConsumer& consumer,
// TODO(pierremoreau): Since the modules have not been validate, should we
// expect SpvStorageClassFunction variables outside
// functions?
- uint32_t num_global_values = 0u;
for (const auto& module : input_modules) {
for (const auto& inst : module->types_values()) {
linked_module->AddType(
std::unique_ptr<Instruction>(inst.Clone(linked_context)));
- num_global_values += inst.opcode() == SpvOpVariable;
}
}
- if (num_global_values > 0xFFFF)
- return DiagnosticStream(position, consumer, "", SPV_ERROR_INTERNAL)
- << "The limit of global values, 65535, was exceeded;"
- << " " << num_global_values << " global values were found.";
// Process functions and their basic blocks
for (const auto& module : input_modules) {
@@ -413,8 +435,7 @@ spv_result_t GetImportExportPairs(const MessageConsumer& consumer,
const uint32_t type = decoration.GetSingleWordInOperand(3u);
LinkageSymbolInfo symbol_info;
- symbol_info.name =
- reinterpret_cast<const char*>(decoration.GetInOperand(2u).words.data());
+ symbol_info.name = decoration.GetInOperand(2u).AsString();
symbol_info.id = id;
symbol_info.type_id = 0u;
@@ -635,6 +656,34 @@ spv_result_t VerifyIds(const MessageConsumer& consumer,
return SPV_SUCCESS;
}
+spv_result_t VerifyLimits(const MessageConsumer& consumer,
+ const opt::IRContext& linked_context) {
+ spv_position_t position = {};
+
+ const uint32_t max_id_bound = linked_context.module()->id_bound();
+ if (max_id_bound >= SPV_LIMIT_RESULT_ID_BOUND)
+ DiagnosticStream({0u, 0u, 4u}, consumer, "", SPV_WARNING)
+ << "The minimum limit of IDs, " << (SPV_LIMIT_RESULT_ID_BOUND - 1)
+ << ", was exceeded:"
+ << " " << max_id_bound << " is the current ID bound.\n"
+ << "The resulting module might not be supported by all "
+ "implementations.";
+
+ size_t num_global_values = 0u;
+ for (const auto& inst : linked_context.module()->types_values()) {
+ num_global_values += inst.opcode() == SpvOpVariable;
+ }
+ if (num_global_values >= SPV_LIMIT_GLOBAL_VARIABLES_MAX)
+ DiagnosticStream(position, consumer, "", SPV_WARNING)
+ << "The minimum limit of global values, "
+ << (SPV_LIMIT_GLOBAL_VARIABLES_MAX - 1) << ", was exceeded;"
+ << " " << num_global_values << " global values were found.\n"
+ << "The resulting module might not be supported by all "
+ "implementations.";
+
+ return SPV_SUCCESS;
+}
+
} // namespace
spv_result_t Link(const Context& context,
@@ -759,7 +808,16 @@ spv_result_t Link(const Context& context, const uint32_t* const* binaries,
pass_res = manager.Run(&linked_context);
if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA;
- // Phase 11: Output the module
+ // Phase 11: Recompute EntryPoint variables
+ manager.AddPass<opt::RemoveUnusedInterfaceVariablesPass>();
+ pass_res = manager.Run(&linked_context);
+ if (pass_res == opt::Pass::Status::Failure) return SPV_ERROR_INVALID_DATA;
+
+ // Phase 12: Warn if SPIR-V limits were exceeded
+ res = VerifyLimits(consumer, linked_context);
+ if (res != SPV_SUCCESS) return res;
+
+ // Phase 13: Output the module
linked_context.module()->ToBinary(linked_binary, true);
return SPV_SUCCESS;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/name_mapper.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/name_mapper.cpp
index eb08f8fed35..3b31d33a818 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/name_mapper.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/name_mapper.cpp
@@ -22,10 +22,10 @@
#include <unordered_map>
#include <unordered_set>
-#include "spirv-tools/libspirv.h"
-
+#include "source/binary.h"
#include "source/latest_version_spirv_header.h"
#include "source/parsed_operand.h"
+#include "spirv-tools/libspirv.h"
namespace spvtools {
namespace {
@@ -172,7 +172,7 @@ spv_result_t FriendlyNameMapper::ParseInstruction(
const auto result_id = inst.result_id;
switch (inst.opcode) {
case SpvOpName:
- SaveName(inst.words[1], reinterpret_cast<const char*>(inst.words + 2));
+ SaveName(inst.words[1], spvDecodeLiteralStringOperand(inst, 1));
break;
case SpvOpDecorate:
// Decorations come after OpName. So OpName will take precedence over
@@ -274,9 +274,8 @@ spv_result_t FriendlyNameMapper::ParseInstruction(
SaveName(result_id, "Queue");
break;
case SpvOpTypeOpaque:
- SaveName(result_id,
- std::string("Opaque_") +
- Sanitize(reinterpret_cast<const char*>(inst.words + 2)));
+ SaveName(result_id, std::string("Opaque_") +
+ Sanitize(spvDecodeLiteralStringOperand(inst, 1)));
break;
case SpvOpTypePipeStorage:
SaveName(result_id, "PipeStorage");
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opcode.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opcode.cpp
index c96cde8d69f..3f927290ec7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opcode.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opcode.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2015-2020 The Khronos Group Inc.
+// Copyright (c) 2015-2022 The Khronos Group Inc.
// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights
// reserved.
//
@@ -40,12 +40,12 @@ struct OpcodeDescPtrLen {
static const spv_opcode_table_t kOpcodeTable = {ARRAY_SIZE(kOpcodeTableEntries),
kOpcodeTableEntries};
-// Represents a vendor tool entry in the SPIR-V XML Regsitry.
+// Represents a vendor tool entry in the SPIR-V XML Registry.
struct VendorTool {
uint32_t value;
const char* vendor;
const char* tool; // Might be empty string.
- const char* vendor_tool; // Combiantion of vendor and tool.
+ const char* vendor_tool; // Combination of vendor and tool.
};
const VendorTool vendor_tools[] = {
@@ -453,6 +453,7 @@ bool spvOpcodeIsAbort(SpvOp opcode) {
case SpvOpTerminateInvocation:
case SpvOpTerminateRayKHR:
case SpvOpIgnoreIntersectionKHR:
+ case SpvOpEmitMeshTasksEXT:
return true;
default:
return false;
@@ -467,11 +468,6 @@ bool spvOpcodeIsBlockTerminator(SpvOp opcode) {
return spvOpcodeIsBranch(opcode) || spvOpcodeIsReturnOrAbort(opcode);
}
-bool spvOpcodeTerminatesExecution(SpvOp opcode) {
- return opcode == SpvOpKill || opcode == SpvOpTerminateInvocation ||
- opcode == SpvOpTerminateRayKHR || opcode == SpvOpIgnoreIntersectionKHR;
-}
-
bool spvOpcodeIsBaseOpaqueType(SpvOp opcode) {
switch (opcode) {
case SpvOpTypeImage:
@@ -528,6 +524,7 @@ bool spvOpcodeIsNonUniformGroupOperation(SpvOp opcode) {
case SpvOpGroupNonUniformLogicalXor:
case SpvOpGroupNonUniformQuadBroadcast:
case SpvOpGroupNonUniformQuadSwap:
+ case SpvOpGroupNonUniformRotateKHR:
return true;
default:
return false;
@@ -631,6 +628,7 @@ bool spvOpcodeIsDebug(SpvOp opcode) {
case SpvOpString:
case SpvOpLine:
case SpvOpNoLine:
+ case SpvOpModuleProcessed:
return true;
default:
return false;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opcode.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opcode.h
index c8525a253a4..77a0bed25d8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opcode.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opcode.h
@@ -110,18 +110,16 @@ bool spvOpcodeIsBranch(SpvOp opcode);
// Returns true if the given opcode is a return instruction.
bool spvOpcodeIsReturn(SpvOp opcode);
-// Returns true if the given opcode aborts execution.
+// 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);
// Returns true if the given opcode is a return instruction or it aborts
// execution.
bool spvOpcodeIsReturnOrAbort(SpvOp opcode);
-// Returns true if the given opcode is a kill instruction or it terminates
-// execution. Note that branches, returns, and unreachables do not terminate
-// execution.
-bool spvOpcodeTerminatesExecution(SpvOp opcode);
-
// Returns true if the given opcode is a basic block terminator.
bool spvOpcodeIsBlockTerminator(SpvOp opcode);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/operand.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/operand.cpp
index 6d83e81e2fe..0c255a352d5 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/operand.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/operand.cpp
@@ -72,12 +72,16 @@ spv_result_t spvOperandTableNameLookup(spv_target_env env,
// Note that the second rule assumes the extension enabling this operand
// is indeed requested in the SPIR-V code; checking that should be
// validator's work.
- if (((version >= entry.minVersion && version <= entry.lastVersion) ||
- entry.numExtensions > 0u || entry.numCapabilities > 0u) &&
- nameLength == strlen(entry.name) &&
+ if (nameLength == strlen(entry.name) &&
!strncmp(entry.name, name, nameLength)) {
- *pEntry = &entry;
- return SPV_SUCCESS;
+ if ((version >= entry.minVersion && version <= entry.lastVersion) ||
+ entry.numExtensions > 0u || entry.numCapabilities > 0u) {
+ *pEntry = &entry;
+ return SPV_SUCCESS;
+ } else {
+ // if there is no extension/capability then the version is wrong
+ return SPV_ERROR_WRONG_VERSION;
+ }
}
}
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp
index ac90fd3434f..7fa5c8a95b1 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.cpp
@@ -1,7 +1,7 @@
// Copyright (c) 2017 The Khronos Group Inc.
// Copyright (c) 2017 Valve Corporation
// Copyright (c) 2017 LunarG Inc.
-// Copyright (c) 2018 Google LLC
+// Copyright (c) 2018-2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -23,9 +23,11 @@
#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"
namespace spvtools {
namespace opt {
@@ -38,6 +40,7 @@ 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;
@@ -95,16 +98,21 @@ bool AggressiveDCEPass::IsVarOfStorage(uint32_t varId, uint32_t storageClass) {
storageClass;
}
-bool AggressiveDCEPass::IsLocalVar(uint32_t varId) {
+bool AggressiveDCEPass::IsLocalVar(uint32_t varId, Function* func) {
if (IsVarOfStorage(varId, SpvStorageClassFunction)) {
return true;
}
- if (!private_like_local_) {
+
+ if (!IsVarOfStorage(varId, SpvStorageClassPrivate) &&
+ !IsVarOfStorage(varId, SpvStorageClassWorkgroup)) {
return false;
}
- return IsVarOfStorage(varId, SpvStorageClassPrivate) ||
- IsVarOfStorage(varId, SpvStorageClassWorkgroup);
+ // For a variable in the Private or WorkGroup storage class, the variable will
+ // get a new instance for every call to an entry point. If the entry point
+ // does not have a call, then no other function can read or write to that
+ // instance of the variable.
+ return IsEntryPointWithNoCalls(func);
}
void AggressiveDCEPass::AddStores(Function* func, uint32_t ptrId) {
@@ -139,8 +147,7 @@ void AggressiveDCEPass::AddStores(Function* func, uint32_t ptrId) {
bool AggressiveDCEPass::AllExtensionsSupported() const {
// If any extension not in allowlist, return false
for (auto& ei : get_module()->extensions()) {
- const char* extName =
- reinterpret_cast<const char*>(&ei.GetInOperand(0).words[0]);
+ const std::string extName = ei.GetInOperand(0).AsString();
if (extensions_allowlist_.find(extName) == extensions_allowlist_.end())
return false;
}
@@ -149,25 +156,15 @@ bool AggressiveDCEPass::AllExtensionsSupported() const {
for (auto& inst : context()->module()->ext_inst_imports()) {
assert(inst.opcode() == SpvOpExtInstImport &&
"Expecting an import of an extension's instruction set.");
- const char* extension_name =
- reinterpret_cast<const char*>(&inst.GetInOperand(0).words[0]);
- if (0 == std::strncmp(extension_name, "NonSemantic.", 12) &&
- 0 != std::strncmp(extension_name, "NonSemantic.Shader.DebugInfo.100",
- 32)) {
+ const std::string extension_name = inst.GetInOperand(0).AsString();
+ if (spvtools::utils::starts_with(extension_name, "NonSemantic.") &&
+ extension_name != "NonSemantic.Shader.DebugInfo.100") {
return false;
}
}
return true;
}
-bool AggressiveDCEPass::IsDead(Instruction* inst) {
- if (IsLive(inst)) return false;
- if ((inst->IsBranch() || inst->opcode() == SpvOpUnreachable) &&
- context()->get_instr_block(inst)->GetMergeInst() == nullptr)
- return false;
- return true;
-}
-
bool AggressiveDCEPass::IsTargetDead(Instruction* inst) {
const uint32_t tId = inst->GetSingleWordInOperand(0);
Instruction* tInst = get_def_use_mgr()->GetDef(tId);
@@ -184,12 +181,12 @@ bool AggressiveDCEPass::IsTargetDead(Instruction* inst) {
});
return dead;
}
- return IsDead(tInst);
+ return !IsLive(tInst);
}
void AggressiveDCEPass::ProcessLoad(Function* func, uint32_t varId) {
// Only process locals
- if (!IsLocalVar(varId)) return;
+ if (!IsLocalVar(varId, func)) return;
// Return if already processed
if (live_local_vars_.find(varId) != live_local_vars_.end()) return;
// Mark all stores to varId as live
@@ -265,170 +262,36 @@ void AggressiveDCEPass::AddBreaksAndContinuesToWorklist(
}
bool AggressiveDCEPass::AggressiveDCE(Function* func) {
- // Mark function parameters as live.
- AddToWorklist(&func->DefInst());
- MarkFunctionParameterAsLive(func);
-
- std::list<BasicBlock*> structuredOrder;
- cfg()->ComputeStructuredOrder(func, &*func->begin(), &structuredOrder);
- bool modified = false;
+ std::list<BasicBlock*> structured_order;
+ cfg()->ComputeStructuredOrder(func, &*func->begin(), &structured_order);
live_local_vars_.clear();
- InitializeWorkList(func, structuredOrder);
-
- // Perform closure on live instruction set.
- while (!worklist_.empty()) {
- Instruction* liveInst = worklist_.front();
- // Add all operand instructions of Debug[No]Lines
- for (auto& lineInst : liveInst->dbg_line_insts()) {
- if (lineInst.IsDebugLineInst()) {
- lineInst.ForEachInId([this](const uint32_t* iid) {
- AddToWorklist(get_def_use_mgr()->GetDef(*iid));
- });
- }
- }
- // Add all operand instructions if not already live
- liveInst->ForEachInId([&liveInst, this](const uint32_t* iid) {
- Instruction* inInst = get_def_use_mgr()->GetDef(*iid);
- // Do not add label if an operand of a branch. This is not needed
- // as part of live code discovery and can create false live code,
- // for example, the branch to a header of a loop.
- if (inInst->opcode() == SpvOpLabel && liveInst->IsBranch()) return;
- AddToWorklist(inInst);
- });
- if (liveInst->type_id() != 0) {
- AddToWorklist(get_def_use_mgr()->GetDef(liveInst->type_id()));
- }
- BasicBlock* basic_block = context()->get_instr_block(liveInst);
- if (basic_block != nullptr) {
- AddToWorklist(basic_block->GetLabelInst());
- }
-
- // If in a structured if or loop construct, add the controlling
- // conditional branch and its merge.
- BasicBlock* blk = context()->get_instr_block(liveInst);
- Instruction* branchInst = GetHeaderBranch(blk);
- if (branchInst != nullptr) {
- AddToWorklist(branchInst);
- Instruction* mergeInst = GetMergeInstruction(branchInst);
- AddToWorklist(mergeInst);
- }
- // If the block is a header, add the next outermost controlling
- // conditional branch and its merge.
- Instruction* nextBranchInst = GetBranchForNextHeader(blk);
- if (nextBranchInst != nullptr) {
- AddToWorklist(nextBranchInst);
- Instruction* mergeInst = GetMergeInstruction(nextBranchInst);
- AddToWorklist(mergeInst);
- }
- // If local load, add all variable's stores if variable not already live
- if (liveInst->opcode() == SpvOpLoad || liveInst->IsAtomicWithLoad()) {
- uint32_t varId;
- (void)GetPtr(liveInst, &varId);
- if (varId != 0) {
- ProcessLoad(func, varId);
- }
- // Process memory copies like loads
- } else if (liveInst->opcode() == SpvOpCopyMemory ||
- liveInst->opcode() == SpvOpCopyMemorySized) {
- uint32_t varId;
- (void)GetPtr(liveInst->GetSingleWordInOperand(kCopyMemorySourceAddrInIdx),
- &varId);
- if (varId != 0) {
- ProcessLoad(func, varId);
- }
- // If DebugDeclare, process as load of variable
- } else if (liveInst->GetCommonDebugOpcode() ==
- CommonDebugInfoDebugDeclare) {
- uint32_t varId =
- liveInst->GetSingleWordOperand(kDebugDeclareOperandVariableIndex);
- ProcessLoad(func, varId);
- // If DebugValue with Deref, process as load of variable
- } else if (liveInst->GetCommonDebugOpcode() == CommonDebugInfoDebugValue) {
- uint32_t varId = context()
- ->get_debug_info_mgr()
- ->GetVariableIdOfDebugValueUsedForDeclare(liveInst);
- if (varId != 0) ProcessLoad(func, varId);
- // If merge, add other branches that are part of its control structure
- } else if (liveInst->opcode() == SpvOpLoopMerge ||
- liveInst->opcode() == SpvOpSelectionMerge) {
- AddBreaksAndContinuesToWorklist(liveInst);
- // If function call, treat as if it loads from all pointer arguments
- } else if (liveInst->opcode() == SpvOpFunctionCall) {
- liveInst->ForEachInId([this, func](const uint32_t* iid) {
- // Skip non-ptr args
- if (!IsPtr(*iid)) return;
- uint32_t varId;
- (void)GetPtr(*iid, &varId);
- ProcessLoad(func, varId);
- });
- // If function parameter, treat as if it's result id is loaded from
- } else if (liveInst->opcode() == SpvOpFunctionParameter) {
- ProcessLoad(func, liveInst->result_id());
- // We treat an OpImageTexelPointer as a load of the pointer, and
- // that value is manipulated to get the result.
- } else if (liveInst->opcode() == SpvOpImageTexelPointer) {
- uint32_t varId;
- (void)GetPtr(liveInst, &varId);
- if (varId != 0) {
- ProcessLoad(func, varId);
- }
- }
-
- // Add OpDecorateId instructions that apply to this instruction to the work
- // list. We use the decoration manager to look through the group
- // decorations to get to the OpDecorate* instructions themselves.
- auto decorations =
- get_decoration_mgr()->GetDecorationsFor(liveInst->result_id(), false);
- for (Instruction* dec : decorations) {
- // 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) {
- continue;
- }
- if (dec->GetSingleWordInOperand(1) ==
- SpvDecorationHlslCounterBufferGOOGLE) {
- // 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;
- }
- AddToWorklist(dec);
- }
-
- // Add DebugScope and DebugInlinedAt for |liveInst| to the work list.
- if (liveInst->GetDebugScope().GetLexicalScope() != kNoDebugScope) {
- auto* scope = get_def_use_mgr()->GetDef(
- liveInst->GetDebugScope().GetLexicalScope());
- AddToWorklist(scope);
- }
- if (liveInst->GetDebugInlinedAt() != kNoInlinedAt) {
- auto* inlined_at =
- get_def_use_mgr()->GetDef(liveInst->GetDebugInlinedAt());
- AddToWorklist(inlined_at);
- }
- worklist_.pop();
- }
+ InitializeWorkList(func, structured_order);
+ ProcessWorkList(func);
+ return KillDeadInstructions(func, structured_order);
+}
- // Kill dead instructions and remember dead blocks
- for (auto bi = structuredOrder.begin(); bi != structuredOrder.end();) {
- uint32_t mergeBlockId = 0;
- (*bi)->ForEachInst([this, &modified, &mergeBlockId](Instruction* inst) {
- if (!IsDead(inst)) return;
+bool AggressiveDCEPass::KillDeadInstructions(
+ const Function* func, std::list<BasicBlock*>& structured_order) {
+ bool modified = false;
+ for (auto bi = structured_order.begin(); bi != structured_order.end();) {
+ 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 dead instruction is selection merge, remember merge block
// for new branch at end of block
if (inst->opcode() == SpvOpSelectionMerge ||
inst->opcode() == SpvOpLoopMerge)
- mergeBlockId = inst->GetSingleWordInOperand(0);
+ merge_block_id = inst->GetSingleWordInOperand(0);
to_kill_.push_back(inst);
modified = true;
});
// If a structured if or loop was deleted, add a branch to its merge
// block, and traverse to the merge block and continue processing there.
// We know the block still exists because the label is not deleted.
- if (mergeBlockId != 0) {
- AddBranch(mergeBlockId, *bi);
- for (++bi; (*bi)->id() != mergeBlockId; ++bi) {
+ if (merge_block_id != 0) {
+ AddBranch(merge_block_id, *bi);
+ for (++bi; (*bi)->id() != merge_block_id; ++bi) {
}
auto merge_terminator = (*bi)->terminator();
@@ -451,94 +314,252 @@ bool AggressiveDCEPass::AggressiveDCE(Function* func) {
live_insts_.Set(merge_terminator->unique_id());
}
} else {
+ Instruction* inst = (*bi)->terminator();
+ if (!IsLive(inst)) {
+ // If the terminator is not live, this block has no live instructions,
+ // and it will be unreachable.
+ AddUnreachable(*bi);
+ }
++bi;
}
}
-
return modified;
}
+void AggressiveDCEPass::ProcessWorkList(Function* func) {
+ while (!worklist_.empty()) {
+ Instruction* live_inst = worklist_.front();
+ worklist_.pop();
+ AddOperandsToWorkList(live_inst);
+ MarkBlockAsLive(live_inst);
+ MarkLoadedVariablesAsLive(func, live_inst);
+ AddDecorationsToWorkList(live_inst);
+ AddDebugInstructionsToWorkList(live_inst);
+ }
+}
+
+void AggressiveDCEPass::AddDebugScopeToWorkList(const Instruction* inst) {
+ auto scope = inst->GetDebugScope();
+ auto lex_scope_id = scope.GetLexicalScope();
+ if (lex_scope_id != kNoDebugScope)
+ AddToWorklist(get_def_use_mgr()->GetDef(lex_scope_id));
+ auto inlined_at_id = scope.GetInlinedAt();
+ if (inlined_at_id != kNoInlinedAt)
+ AddToWorklist(get_def_use_mgr()->GetDef(inlined_at_id));
+}
+
+void AggressiveDCEPass::AddDebugInstructionsToWorkList(
+ const Instruction* inst) {
+ for (auto& line_inst : inst->dbg_line_insts()) {
+ if (line_inst.IsDebugLineInst()) {
+ AddOperandsToWorkList(&line_inst);
+ }
+ AddDebugScopeToWorkList(&line_inst);
+ }
+ AddDebugScopeToWorkList(inst);
+}
+
+void AggressiveDCEPass::AddDecorationsToWorkList(const Instruction* inst) {
+ // Add OpDecorateId instructions that apply to this instruction to the work
+ // list. We use the decoration manager to look through the group
+ // decorations to get to the OpDecorate* instructions themselves.
+ auto decorations =
+ get_decoration_mgr()->GetDecorationsFor(inst->result_id(), false);
+ for (Instruction* dec : decorations) {
+ // 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) {
+ continue;
+ }
+ if (dec->GetSingleWordInOperand(1) ==
+ SpvDecorationHlslCounterBufferGOOGLE) {
+ // 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;
+ }
+ AddToWorklist(dec);
+ }
+}
+
+void AggressiveDCEPass::MarkLoadedVariablesAsLive(Function* func,
+ Instruction* inst) {
+ std::vector<uint32_t> live_variables = GetLoadedVariables(inst);
+ for (uint32_t var_id : live_variables) {
+ ProcessLoad(func, var_id);
+ }
+}
+
+std::vector<uint32_t> AggressiveDCEPass::GetLoadedVariables(Instruction* inst) {
+ if (inst->opcode() == SpvOpFunctionCall) {
+ return GetLoadedVariablesFromFunctionCall(inst);
+ }
+ uint32_t var_id = GetLoadedVariableFromNonFunctionCalls(inst);
+ if (var_id == 0) {
+ return {};
+ }
+ return {var_id};
+}
+
+uint32_t AggressiveDCEPass::GetLoadedVariableFromNonFunctionCalls(
+ Instruction* inst) {
+ std::vector<uint32_t> live_variables;
+ if (inst->IsAtomicWithLoad()) {
+ return GetVariableId(inst->GetSingleWordInOperand(kLoadSourceAddrInIdx));
+ }
+
+ switch (inst->opcode()) {
+ case SpvOpLoad:
+ case SpvOpImageTexelPointer:
+ return GetVariableId(inst->GetSingleWordInOperand(kLoadSourceAddrInIdx));
+ case SpvOpCopyMemory:
+ case SpvOpCopyMemorySized:
+ return GetVariableId(
+ inst->GetSingleWordInOperand(kCopyMemorySourceAddrInIdx));
+ default:
+ break;
+ }
+
+ switch (inst->GetCommonDebugOpcode()) {
+ case CommonDebugInfoDebugDeclare:
+ return inst->GetSingleWordOperand(kDebugDeclareOperandVariableIndex);
+ case CommonDebugInfoDebugValue: {
+ analysis::DebugInfoManager* debug_info_mgr =
+ context()->get_debug_info_mgr();
+ return debug_info_mgr->GetVariableIdOfDebugValueUsedForDeclare(inst);
+ }
+ default:
+ break;
+ }
+ return 0;
+}
+
+std::vector<uint32_t> AggressiveDCEPass::GetLoadedVariablesFromFunctionCall(
+ const Instruction* inst) {
+ assert(inst->opcode() == SpvOpFunctionCall);
+ std::vector<uint32_t> live_variables;
+ inst->ForEachInId([this, &live_variables](const uint32_t* operand_id) {
+ if (!IsPtr(*operand_id)) return;
+ uint32_t var_id = GetVariableId(*operand_id);
+ live_variables.push_back(var_id);
+ });
+ return live_variables;
+}
+
+uint32_t AggressiveDCEPass::GetVariableId(uint32_t ptr_id) {
+ assert(IsPtr(ptr_id) &&
+ "Cannot get the variable when input is not a pointer.");
+ uint32_t varId = 0;
+ (void)GetPtr(ptr_id, &varId);
+ return varId;
+}
+
+void AggressiveDCEPass::MarkBlockAsLive(Instruction* inst) {
+ BasicBlock* basic_block = context()->get_instr_block(inst);
+ if (basic_block == nullptr) {
+ return;
+ }
+
+ // If we intend to keep this instruction, we need the block label and
+ // block terminator to have a valid block for the instruction.
+ AddToWorklist(basic_block->GetLabelInst());
+
+ // We need to mark the successors blocks that follow as live. If this is
+ // header of the merge construct, the construct may be folded, but we will
+ // definitely need the merge label. If it is not a construct, the terminator
+ // must be live, and the successor blocks will be marked as live when
+ // processing the terminator.
+ uint32_t merge_id = basic_block->MergeBlockIdIfAny();
+ if (merge_id == 0) {
+ AddToWorklist(basic_block->terminator());
+ } else {
+ AddToWorklist(context()->get_def_use_mgr()->GetDef(merge_id));
+ }
+
+ // Mark the structured control flow constructs that contains this block as
+ // live. If |inst| is an instruction in the loop header, then it is part of
+ // 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)
+ MarkLoopConstructAsLiveIfLoopHeader(basic_block);
+
+ Instruction* next_branch_inst = GetBranchForNextHeader(basic_block);
+ if (next_branch_inst != nullptr) {
+ AddToWorklist(next_branch_inst);
+ Instruction* mergeInst = GetMergeInstruction(next_branch_inst);
+ AddToWorklist(mergeInst);
+ }
+
+ if (inst->opcode() == SpvOpLoopMerge ||
+ inst->opcode() == SpvOpSelectionMerge) {
+ AddBreaksAndContinuesToWorklist(inst);
+ }
+}
+void AggressiveDCEPass::MarkLoopConstructAsLiveIfLoopHeader(
+ BasicBlock* basic_block) {
+ // If this is the header for a loop, then loop structure needs to keep as well
+ // because the loop header is also part of the loop.
+ Instruction* merge_inst = basic_block->GetLoopMergeInst();
+ if (merge_inst != nullptr) {
+ AddToWorklist(basic_block->terminator());
+ AddToWorklist(merge_inst);
+ }
+}
+
+void AggressiveDCEPass::AddOperandsToWorkList(const Instruction* inst) {
+ inst->ForEachInId([this](const uint32_t* iid) {
+ Instruction* inInst = get_def_use_mgr()->GetDef(*iid);
+ AddToWorklist(inInst);
+ });
+ if (inst->type_id() != 0) {
+ AddToWorklist(get_def_use_mgr()->GetDef(inst->type_id()));
+ }
+}
+
void AggressiveDCEPass::InitializeWorkList(
- Function* func, std::list<BasicBlock*>& structuredOrder) {
+ Function* func, std::list<BasicBlock*>& structured_order) {
+ AddToWorklist(&func->DefInst());
+ MarkFunctionParameterAsLive(func);
+ MarkFirstBlockAsLive(func);
+
// Add instructions with external side effects to the worklist. Also add
// branches that are not attached to a structured construct.
// TODO(s-perron): The handling of branch seems to be adhoc. This needs to be
// cleaned up.
- bool call_in_func = false;
- bool func_is_entry_point = false;
-
- // TODO(s-perron): We need to check if this is actually needed. In cases
- // where private variable can be treated as if they are function scope, the
- // private-to-local pass should be able to change them to function scope.
- std::vector<Instruction*> private_stores;
-
- for (auto bi = structuredOrder.begin(); bi != structuredOrder.end(); ++bi) {
- for (auto ii = (*bi)->begin(); ii != (*bi)->end(); ++ii) {
+ for (auto& bi : structured_order) {
+ for (auto ii = bi->begin(); ii != bi->end(); ++ii) {
SpvOp op = ii->opcode();
+ if (ii->IsBranch()) {
+ continue;
+ }
switch (op) {
case SpvOpStore: {
- uint32_t varId;
- (void)GetPtr(&*ii, &varId);
- // Mark stores as live if their variable is not function scope
- // and is not private scope. Remember private stores for possible
- // later inclusion. We cannot call IsLocalVar at this point because
- // private_like_local_ has not been set yet.
- if (IsVarOfStorage(varId, SpvStorageClassPrivate) ||
- IsVarOfStorage(varId, SpvStorageClassWorkgroup))
- private_stores.push_back(&*ii);
- else if (!IsVarOfStorage(varId, SpvStorageClassFunction))
- AddToWorklist(&*ii);
+ uint32_t var_id = 0;
+ (void)GetPtr(&*ii, &var_id);
+ if (!IsLocalVar(var_id, func)) AddToWorklist(&*ii);
} break;
case SpvOpCopyMemory:
case SpvOpCopyMemorySized: {
- uint32_t varId;
- (void)GetPtr(ii->GetSingleWordInOperand(kCopyMemoryTargetAddrInIdx),
- &varId);
- if (IsVarOfStorage(varId, SpvStorageClassPrivate) ||
- IsVarOfStorage(varId, SpvStorageClassWorkgroup))
- private_stores.push_back(&*ii);
- else if (!IsVarOfStorage(varId, SpvStorageClassFunction))
- AddToWorklist(&*ii);
- } break;
- case SpvOpSwitch:
- case SpvOpBranch:
- case SpvOpBranchConditional:
- case SpvOpUnreachable: {
- bool branchRelatedToConstruct =
- (GetMergeInstruction(&*ii) == nullptr &&
- GetHeaderBlock(context()->get_instr_block(&*ii)) == nullptr);
- if (branchRelatedToConstruct) {
- AddToWorklist(&*ii);
- }
+ 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:
break;
default: {
// Function calls, atomics, function params, function returns, etc.
if (!ii->IsOpcodeSafeToDelete()) {
AddToWorklist(&*ii);
}
- // Remember function calls
- if (op == SpvOpFunctionCall) call_in_func = true;
} break;
}
}
}
- // See if current function is an entry point
- for (auto& ei : get_module()->entry_points()) {
- if (ei.GetSingleWordInOperand(kEntryPointFunctionIdInIdx) ==
- func->result_id()) {
- func_is_entry_point = true;
- break;
- }
- }
- // If the current function is an entry point and has no function calls,
- // we can optimize private variables as locals
- private_like_local_ = func_is_entry_point && !call_in_func;
- // If privates are not like local, add their stores to worklist
- if (!private_like_local_)
- for (auto& ps : private_stores) AddToWorklist(ps);
}
void AggressiveDCEPass::InitializeModuleScopeLiveInstructions() {
@@ -548,12 +569,7 @@ void AggressiveDCEPass::InitializeModuleScopeLiveInstructions() {
}
// Keep all entry points.
for (auto& entry : get_module()->entry_points()) {
- if (get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 4) &&
- !preserve_interface_) {
- // In SPIR-V 1.4 and later, entry points must list all global variables
- // used. DCE can still remove non-input/output variables and update the
- // interface list. Mark the entry point as live and inputs and outputs as
- // live, but defer decisions all other interfaces.
+ if (!preserve_interface_) {
live_insts_.Set(entry.unique_id());
// The actual function is live always.
AddToWorklist(
@@ -561,8 +577,9 @@ void AggressiveDCEPass::InitializeModuleScopeLiveInstructions() {
for (uint32_t i = 3; i < entry.NumInOperands(); ++i) {
auto* var = get_def_use_mgr()->GetDef(entry.GetSingleWordInOperand(i));
auto storage_class = var->GetSingleWordInOperand(0u);
- if (storage_class == SpvStorageClassInput ||
- storage_class == SpvStorageClassOutput) {
+ // Vulkan support outputs without an associated input, but not inputs
+ // without an associated output.
+ if (storage_class == SpvStorageClassOutput) {
AddToWorklist(var);
}
}
@@ -596,16 +613,35 @@ void AggressiveDCEPass::InitializeModuleScopeLiveInstructions() {
}
// For each DebugInfo GlobalVariable keep all operands except the Variable.
- // Later, if the variable is dead, we will set the operand to DebugInfoNone.
+ // Later, if the variable is killed with KillInst(), we will set the operand
+ // to DebugInfoNone. Create and save DebugInfoNone now for this possible
+ // later use. This is slightly unoptimal, but it avoids generating it during
+ // instruction killing when the module is not consistent.
+ bool debug_global_seen = false;
for (auto& dbg : get_module()->ext_inst_debuginfo()) {
if (dbg.GetCommonDebugOpcode() != CommonDebugInfoDebugGlobalVariable)
continue;
+ debug_global_seen = true;
dbg.ForEachInId([this](const uint32_t* iid) {
- Instruction* inInst = get_def_use_mgr()->GetDef(*iid);
- if (inInst->opcode() == SpvOpVariable) return;
- AddToWorklist(inInst);
+ Instruction* in_inst = get_def_use_mgr()->GetDef(*iid);
+ if (in_inst->opcode() == SpvOpVariable) return;
+ AddToWorklist(in_inst);
});
}
+ if (debug_global_seen) {
+ auto dbg_none = context()->get_debug_info_mgr()->GetDebugInfoNone();
+ AddToWorklist(dbg_none);
+ }
+
+ // Add top level DebugInfo to worklist
+ for (auto& dbg : get_module()->ext_inst_debuginfo()) {
+ auto op = dbg.GetShader100DebugOpcode();
+ if (op == NonSemanticShaderDebugInfo100DebugCompilationUnit ||
+ op == NonSemanticShaderDebugInfo100DebugEntryPoint ||
+ op == NonSemanticShaderDebugInfo100DebugSourceContinued) {
+ AddToWorklist(&dbg);
+ }
+ }
}
Pass::Status AggressiveDCEPass::ProcessImpl() {
@@ -635,9 +671,14 @@ Pass::Status AggressiveDCEPass::ProcessImpl() {
InitializeModuleScopeLiveInstructions();
- // Process all entry point functions.
- ProcessFunction pfn = [this](Function* fp) { return AggressiveDCE(fp); };
- modified |= context()->ProcessReachableCallTree(pfn);
+ // Run |AggressiveDCE| on the remaining functions. The order does not matter,
+ // since |AggressiveDCE| is intra-procedural. This can mean that function
+ // will become dead if all function call to them are removed. These dead
+ // function will still be in the module after this pass. We expect this to be
+ // rare.
+ for (Function& fp : *context()->module()) {
+ modified |= AggressiveDCE(&fp);
+ }
// If the decoration manager is kept live then the context will try to keep it
// up to date. ADCE deals with group decorations by changing the operands in
@@ -663,8 +704,9 @@ Pass::Status AggressiveDCEPass::ProcessImpl() {
}
// Cleanup all CFG including all unreachable blocks.
- ProcessFunction cleanup = [this](Function* f) { return CFGCleanup(f); };
- modified |= context()->ProcessReachableCallTree(cleanup);
+ for (Function& fp : *context()->module()) {
+ modified |= CFGCleanup(&fp);
+ }
return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange;
}
@@ -743,7 +785,7 @@ bool AggressiveDCEPass::ProcessGlobalValues() {
uint32_t counter_buffer_id = annotation->GetSingleWordInOperand(2);
Instruction* counter_buffer_inst =
get_def_use_mgr()->GetDef(counter_buffer_id);
- if (IsDead(counter_buffer_inst)) {
+ if (!IsLive(counter_buffer_inst)) {
context()->KillInst(annotation);
modified = true;
}
@@ -758,7 +800,7 @@ bool AggressiveDCEPass::ProcessGlobalValues() {
for (uint32_t i = 1; i < annotation->NumOperands();) {
Instruction* opInst =
get_def_use_mgr()->GetDef(annotation->GetSingleWordOperand(i));
- if (IsDead(opInst)) {
+ if (!IsLive(opInst)) {
// Don't increment |i|.
annotation->RemoveOperand(i);
modified = true;
@@ -785,7 +827,7 @@ bool AggressiveDCEPass::ProcessGlobalValues() {
for (uint32_t i = 1; i < annotation->NumOperands();) {
Instruction* opInst =
get_def_use_mgr()->GetDef(annotation->GetSingleWordOperand(i));
- if (IsDead(opInst)) {
+ if (!IsLive(opInst)) {
// Don't increment |i|.
annotation->RemoveOperand(i + 1);
annotation->RemoveOperand(i);
@@ -819,13 +861,13 @@ bool AggressiveDCEPass::ProcessGlobalValues() {
}
for (auto& dbg : get_module()->ext_inst_debuginfo()) {
- if (!IsDead(&dbg)) continue;
+ if (IsLive(&dbg)) continue;
// Save GlobalVariable if its variable is live, otherwise null out variable
// index
if (dbg.GetCommonDebugOpcode() == CommonDebugInfoDebugGlobalVariable) {
auto var_id = dbg.GetSingleWordOperand(kGlobalVariableVariableIndex);
Instruction* var_inst = get_def_use_mgr()->GetDef(var_id);
- if (!IsDead(var_inst)) continue;
+ if (IsLive(var_inst)) continue;
context()->ForgetUses(&dbg);
dbg.SetOperand(
kGlobalVariableVariableIndex,
@@ -840,7 +882,7 @@ bool AggressiveDCEPass::ProcessGlobalValues() {
// Since ADCE is disabled for non-shaders, we don't check for export linkage
// attributes here.
for (auto& val : get_module()->types_values()) {
- if (IsDead(&val)) {
+ if (!IsLive(&val)) {
// Save forwarded pointer if pointer is live since closure does not mark
// 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
@@ -848,15 +890,14 @@ bool AggressiveDCEPass::ProcessGlobalValues() {
if (val.opcode() == SpvOpTypeForwardPointer) {
uint32_t ptr_ty_id = val.GetSingleWordInOperand(0);
Instruction* ptr_ty_inst = get_def_use_mgr()->GetDef(ptr_ty_id);
- if (!IsDead(ptr_ty_inst)) continue;
+ if (IsLive(ptr_ty_inst)) continue;
}
to_kill_.push_back(&val);
modified = true;
}
}
- if (get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 4) &&
- !preserve_interface_) {
+ if (!preserve_interface_) {
// Remove the dead interface variables from the entry point interface list.
for (auto& entry : get_module()->entry_points()) {
std::vector<Operand> new_operands;
@@ -867,7 +908,7 @@ bool AggressiveDCEPass::ProcessGlobalValues() {
} else {
auto* var =
get_def_use_mgr()->GetDef(entry.GetSingleWordInOperand(i));
- if (!IsDead(var)) {
+ if (IsLive(var)) {
new_operands.push_back(entry.GetInOperand(i));
}
}
@@ -944,6 +985,8 @@ void AggressiveDCEPass::InitExtensions() {
"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",
});
}
@@ -1018,5 +1061,43 @@ bool AggressiveDCEPass::BlockIsInConstruct(BasicBlock* header_block,
return false;
}
+bool AggressiveDCEPass::IsEntryPointWithNoCalls(Function* func) {
+ auto cached_result = entry_point_with_no_calls_cache_.find(func->result_id());
+ if (cached_result != entry_point_with_no_calls_cache_.end()) {
+ return cached_result->second;
+ }
+ bool result = IsEntryPoint(func) && !HasCall(func);
+ entry_point_with_no_calls_cache_[func->result_id()] = result;
+ return result;
+}
+
+bool AggressiveDCEPass::IsEntryPoint(Function* func) {
+ for (const Instruction& entry_point : get_module()->entry_points()) {
+ uint32_t entry_point_id =
+ entry_point.GetSingleWordInOperand(kEntryPointFunctionIdInIdx);
+ if (entry_point_id == func->result_id()) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool AggressiveDCEPass::HasCall(Function* func) {
+ return !func->WhileEachInst(
+ [](Instruction* inst) { return inst->opcode() != SpvOpFunctionCall; });
+}
+
+void AggressiveDCEPass::MarkFirstBlockAsLive(Function* func) {
+ BasicBlock* first_block = &*func->begin();
+ MarkBlockAsLive(first_block->GetLabelInst());
+}
+
+void AggressiveDCEPass::AddUnreachable(BasicBlock*& block) {
+ InstructionBuilder builder(
+ context(), block,
+ IRContext::kAnalysisInstrToBlockMapping | IRContext::kAnalysisDefUse);
+ builder.AddUnreachable();
+}
+
} // namespace opt
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h
index cd697b532e3..c1291dc47b6 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/aggressive_dead_code_elim_pass.h
@@ -67,19 +67,16 @@ class AggressiveDCEPass : public MemPass {
// be 0 or the result of an instruction.
bool IsVarOfStorage(uint32_t varId, uint32_t storageClass);
- // Return true if |varId| is variable of function storage class or is
- // private variable and privates can be optimized like locals (see
- // privates_like_local_).
- bool IsLocalVar(uint32_t varId);
+ // 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
+ // where |func| is an entry point with no function calls.
+ bool IsLocalVar(uint32_t varId, Function* func);
// Return true if |inst| is marked live.
bool IsLive(const Instruction* inst) const {
return live_insts_.Get(inst->unique_id());
}
- // Returns true if |inst| is dead.
- bool IsDead(Instruction* inst);
-
// Adds entry points, execution modes and workgroup size decorations to the
// worklist for processing with the first function.
void InitializeModuleScopeLiveInstructions();
@@ -139,7 +136,53 @@ class AggressiveDCEPass : public MemPass {
// Adds instructions which must be kept because of they have side-effects
// that ADCE cannot model to the work list.
void InitializeWorkList(Function* func,
- std::list<BasicBlock*>& structuredOrder);
+ std::list<BasicBlock*>& structured_order);
+
+ // Process each instruction in the work list by marking any instruction that
+ // that it depends on as live, and adding it to the work list. The work list
+ // will be empty at the end.
+ void ProcessWorkList(Function* func);
+
+ // Kills any instructions in |func| that have not been marked as live.
+ bool KillDeadInstructions(const Function* func,
+ std::list<BasicBlock*>& structured_order);
+
+ // Adds the instructions that define the operands of |inst| to the work list.
+ void AddOperandsToWorkList(const Instruction* inst);
+
+ // Marks all of the labels and branch that inst requires as live.
+ void MarkBlockAsLive(Instruction* inst);
+
+ // Marks any variables from which |inst| may require data as live.
+ void MarkLoadedVariablesAsLive(Function* func, Instruction* inst);
+
+ // Returns the id of the variable that |ptr_id| point to. |ptr_id| must be a
+ // value whose type is a pointer.
+ uint32_t GetVariableId(uint32_t ptr_id);
+
+ // Returns all of the ids for the variables from which |inst| will load data.
+ std::vector<uint32_t> GetLoadedVariables(Instruction* inst);
+
+ // Returns all of the ids for the variables from which |inst| will load data.
+ // The opcode of |inst| must be OpFunctionCall.
+ std::vector<uint32_t> GetLoadedVariablesFromFunctionCall(
+ const Instruction* inst);
+
+ // Returns the id of the variable from which |inst| will load data. |inst|
+ // must not be an OpFunctionCall. Returns 0 if no data is read or the
+ // variable cannot be determined. Note that in logical addressing mode the
+ // latter is not possible for function and private storage class because there
+ // cannot be variable pointers pointing to those storage classes.
+ uint32_t GetLoadedVariableFromNonFunctionCalls(Instruction* inst);
+
+ // Adds all decorations of |inst| to the work list.
+ void AddDecorationsToWorkList(const Instruction* inst);
+
+ // Adds DebugScope instruction associated with |inst| to the work list.
+ void AddDebugScopeToWorkList(const Instruction* inst);
+
+ // Adds all debug instruction associated with |inst| to the work list.
+ void AddDebugInstructionsToWorkList(const Instruction* inst);
// Marks all of the OpFunctionParameter instructions in |func| as live.
void MarkFunctionParameterAsLive(const Function* func);
@@ -164,8 +207,29 @@ class AggressiveDCEPass : public MemPass {
// Returns true if |bb| is in the construct with header |header_block|.
bool BlockIsInConstruct(BasicBlock* header_block, BasicBlock* bb);
- // True if current function is entry point and has no function calls.
- bool private_like_local_;
+ // Returns true if |func| is an entry point that does not have any function
+ // calls.
+ bool IsEntryPointWithNoCalls(Function* func);
+
+ // Returns true if |func| is an entry point.
+ bool IsEntryPoint(Function* func);
+
+ // Returns true if |func| contains a function call.
+ bool HasCall(Function* func);
+
+ // Marks the first block, which is the entry block, in |func| as live.
+ void MarkFirstBlockAsLive(Function* func);
+
+ // Adds an OpUnreachable instruction at the end of |block|.
+ void AddUnreachable(BasicBlock*& block);
+
+ // Marks the OpLoopMerge and the terminator in |basic_block| as live if
+ // |basic_block| is a loop header.
+ void MarkLoopConstructAsLiveIfLoopHeader(BasicBlock* basic_block);
+
+ // The cached results for |IsEntryPointWithNoCalls|. It maps the function's
+ // result id to the return value.
+ std::unordered_map<uint32_t, bool> entry_point_with_no_calls_cache_;
// Live Instruction Worklist. An instruction is added to this list
// if it might have a side effect, either directly or indirectly.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.cpp
index ccedc0bc5ce..dd9bafda32b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.cpp
@@ -584,9 +584,9 @@ bool ReplaceCubeFaceCoord(IRContext* ctx, Instruction* inst,
}
// Get the constants that will be used.
- uint32_t f0_const_id = const_mgr->GetFloatConst(0.0);
- uint32_t f2_const_id = const_mgr->GetFloatConst(2.0);
- uint32_t f0_5_const_id = const_mgr->GetFloatConst(0.5);
+ uint32_t f0_const_id = const_mgr->GetFloatConstId(0.0);
+ uint32_t f2_const_id = const_mgr->GetFloatConstId(2.0);
+ uint32_t f0_5_const_id = const_mgr->GetFloatConstId(0.5);
const analysis::Constant* vec_const =
const_mgr->GetConstant(v2_float_type, {f0_5_const_id, f0_5_const_id});
uint32_t vec_const_id =
@@ -731,12 +731,12 @@ bool ReplaceCubeFaceIndex(IRContext* ctx, Instruction* inst,
}
// Get the constants that will be used.
- uint32_t f0_const_id = const_mgr->GetFloatConst(0.0);
- uint32_t f1_const_id = const_mgr->GetFloatConst(1.0);
- uint32_t f2_const_id = const_mgr->GetFloatConst(2.0);
- uint32_t f3_const_id = const_mgr->GetFloatConst(3.0);
- uint32_t f4_const_id = const_mgr->GetFloatConst(4.0);
- uint32_t f5_const_id = const_mgr->GetFloatConst(5.0);
+ uint32_t f0_const_id = const_mgr->GetFloatConstId(0.0);
+ uint32_t f1_const_id = const_mgr->GetFloatConstId(1.0);
+ uint32_t f2_const_id = const_mgr->GetFloatConstId(2.0);
+ uint32_t f3_const_id = const_mgr->GetFloatConstId(3.0);
+ uint32_t f4_const_id = const_mgr->GetFloatConstId(4.0);
+ uint32_t f5_const_id = const_mgr->GetFloatConstId(5.0);
// Extract the input values.
Instruction* x = ir_builder.AddCompositeExtract(float_type_id, input_id, {0});
@@ -935,8 +935,7 @@ Pass::Status AmdExtensionToKhrPass::Process() {
std::vector<Instruction*> to_be_killed;
for (Instruction& inst : context()->module()->extensions()) {
if (inst.opcode() == SpvOpExtension) {
- if (ext_to_remove.count(reinterpret_cast<const char*>(
- &(inst.GetInOperand(0).words[0]))) != 0) {
+ if (ext_to_remove.count(inst.GetInOperand(0).AsString()) != 0) {
to_be_killed.push_back(&inst);
}
}
@@ -944,8 +943,7 @@ Pass::Status AmdExtensionToKhrPass::Process() {
for (Instruction& inst : context()->ext_inst_imports()) {
if (inst.opcode() == SpvOpExtInstImport) {
- if (ext_to_remove.count(reinterpret_cast<const char*>(
- &(inst.GetInOperand(0).words[0]))) != 0) {
+ if (ext_to_remove.count(inst.GetInOperand(0).AsString()) != 0) {
to_be_killed.push_back(&inst);
}
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.h
index fd3dab4e7d1..6a39d953a11 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/amd_ext_to_khr.h
@@ -23,7 +23,7 @@ namespace spvtools {
namespace opt {
// Replaces the extensions VK_AMD_shader_ballot, VK_AMD_gcn_shader, and
-// VK_AMD_shader_trinary_minmax with equivalant code using core instructions and
+// VK_AMD_shader_trinary_minmax with equivalent code using core instructions and
// capabilities.
class AmdExtensionToKhrPass : public Pass {
public:
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/basic_block.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/basic_block.h
index 6741a50f269..dd3b2e2871f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/basic_block.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/basic_block.h
@@ -83,7 +83,7 @@ class BasicBlock {
const Instruction* GetMergeInst() const;
Instruction* GetMergeInst();
- // Returns the OpLoopMerge instruciton in this basic block, if it exists.
+ // Returns the OpLoopMerge instruction in this basic block, if it exists.
// Otherwise return null. May be used whenever tail() can be used.
const Instruction* GetLoopMergeInst() const;
Instruction* GetLoopMergeInst();
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/block_merge_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/block_merge_pass.cpp
index 04e47f1c2e6..ef7f31fe0b5 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/block_merge_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/block_merge_pass.cpp
@@ -44,7 +44,7 @@ bool BlockMergePass::MergeBlocks(Function* func) {
Pass::Status BlockMergePass::Process() {
// Process all entry point functions.
ProcessFunction pfn = [this](Function* fp) { return MergeBlocks(fp); };
- bool modified = context()->ProcessEntryPointCallTree(pfn);
+ bool modified = context()->ProcessReachableCallTree(pfn);
return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/block_merge_util.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/block_merge_util.cpp
index e4ba10fc9f8..83c702ca3b7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/block_merge_util.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/block_merge_util.cpp
@@ -125,6 +125,26 @@ bool CanMergeWithSuccessor(IRContext* context, BasicBlock* block) {
return false;
}
}
+
+ if (succ_is_merge || IsContinue(context, lab_id)) {
+ auto* struct_cfg = context->GetStructuredCFGAnalysis();
+ auto switch_block_id = struct_cfg->ContainingSwitch(block->id());
+ if (switch_block_id) {
+ auto switch_merge_id = struct_cfg->SwitchMergeBlock(switch_block_id);
+ const auto* switch_inst =
+ &*block->GetParent()->FindBlock(switch_block_id)->tail();
+ for (uint32_t i = 1; i < switch_inst->NumInOperands(); i += 2) {
+ auto target_id = switch_inst->GetSingleWordInOperand(i);
+ if (target_id == block->id() && target_id != switch_merge_id) {
+ // Case constructs must be structurally dominated by the OpSwitch.
+ // Since the successor is the merge/continue for another construct,
+ // merging the blocks would break that requirement.
+ return false;
+ }
+ }
+ }
+ }
+
return true;
}
@@ -171,12 +191,17 @@ void MergeWithSuccessor(IRContext* context, Function* func,
// and OpBranchConditional.
auto terminator = bi->terminator();
auto& vec = terminator->dbg_line_insts();
- auto& new_vec = merge_inst->dbg_line_insts();
- new_vec.insert(new_vec.end(), vec.begin(), vec.end());
- terminator->ClearDbgLineInsts();
- for (auto& l_inst : new_vec)
- context->get_def_use_mgr()->AnalyzeInstDefUse(&l_inst);
-
+ if (vec.size() > 0) {
+ merge_inst->ClearDbgLineInsts();
+ auto& new_vec = merge_inst->dbg_line_insts();
+ new_vec.insert(new_vec.end(), vec.begin(), vec.end());
+ terminator->ClearDbgLineInsts();
+ for (auto& l_inst : new_vec)
+ context->get_def_use_mgr()->AnalyzeInstDefUse(&l_inst);
+ }
+ // Clear debug scope of terminator to avoid DebugScope
+ // emitted between terminator and merge.
+ terminator->SetDebugScope(DebugScope(kNoDebugScope, kNoInlinedAt));
// Move the merge instruction to just before the terminator.
merge_inst->InsertBefore(terminator);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ccp_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ccp_pass.cpp
index d84f13f5d14..5f855027602 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ccp_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ccp_pass.cpp
@@ -102,6 +102,34 @@ SSAPropagator::PropStatus CCPPass::VisitPhi(Instruction* phi) {
return SSAPropagator::kInteresting;
}
+uint32_t CCPPass::ComputeLatticeMeet(Instruction* instr, uint32_t val2) {
+ // Given two values val1 and val2, the meet operation in the constant
+ // lattice uses the following rules:
+ //
+ // meet(val1, UNDEFINED) = val1
+ // meet(val1, VARYING) = VARYING
+ // meet(val1, val2) = val1 if val1 == val2
+ // meet(val1, val2) = VARYING if val1 != val2
+ //
+ // When two different values meet, the result is always varying because CCP
+ // does not allow lateral transitions in the lattice. This prevents
+ // infinite cycles during propagation.
+ auto val1_it = values_.find(instr->result_id());
+ if (val1_it == values_.end()) {
+ return val2;
+ }
+
+ uint32_t val1 = val1_it->second;
+ if (IsVaryingValue(val1)) {
+ return val1;
+ } else if (IsVaryingValue(val2)) {
+ return val2;
+ } else if (val1 != val2) {
+ return kVaryingSSAId;
+ }
+ return val2;
+}
+
SSAPropagator::PropStatus CCPPass::VisitAssignment(Instruction* instr) {
assert(instr->result_id() != 0 &&
"Expecting an instruction that produces a result");
@@ -115,8 +143,10 @@ SSAPropagator::PropStatus CCPPass::VisitAssignment(Instruction* instr) {
if (IsVaryingValue(it->second)) {
return MarkInstructionVarying(instr);
} else {
- values_[instr->result_id()] = it->second;
- return SSAPropagator::kInteresting;
+ uint32_t new_val = ComputeLatticeMeet(instr, it->second);
+ values_[instr->result_id()] = new_val;
+ return IsVaryingValue(new_val) ? SSAPropagator::kVarying
+ : SSAPropagator::kInteresting;
}
}
return SSAPropagator::kNotInteresting;
@@ -142,9 +172,13 @@ SSAPropagator::PropStatus CCPPass::VisitAssignment(Instruction* instr) {
if (folded_inst != nullptr) {
// We do not want to change the body of the function by adding new
// instructions. When folding we can only generate new constants.
- assert(folded_inst->IsConstant() && "CCP is only interested in constant.");
- values_[instr->result_id()] = folded_inst->result_id();
- return SSAPropagator::kInteresting;
+ assert((folded_inst->IsConstant() ||
+ IsSpecConstantInst(folded_inst->opcode())) &&
+ "CCP is only interested in constant values.");
+ uint32_t new_val = ComputeLatticeMeet(instr, folded_inst->result_id());
+ values_[instr->result_id()] = new_val;
+ return IsVaryingValue(new_val) ? SSAPropagator::kVarying
+ : SSAPropagator::kInteresting;
}
// Conservatively mark this instruction as varying if any input id is varying.
@@ -291,6 +325,10 @@ bool CCPPass::ReplaceValues() {
}
bool CCPPass::PropagateConstants(Function* fp) {
+ if (fp->IsDeclaration()) {
+ return false;
+ }
+
// Mark function parameters as varying.
fp->ForEachParam([this](const Instruction* inst) {
values_[inst->result_id()] = kVaryingSSAId;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ccp_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ccp_pass.h
index fb20c78089c..77ea9f80daa 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ccp_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ccp_pass.h
@@ -92,6 +92,22 @@ class CCPPass : public MemPass {
// generated during propagation.
analysis::ConstantManager* const_mgr_;
+ // Returns a new value for |instr| by computing the meet operation between
+ // its existing value and |val2|.
+ //
+ // Given two values val1 and val2, the meet operation in the constant
+ // lattice uses the following rules:
+ //
+ // meet(val1, UNDEFINED) = val1
+ // meet(val1, VARYING) = VARYING
+ // meet(val1, val2) = val1 if val1 == val2
+ // meet(val1, val2) = VARYING if val1 != val2
+ //
+ // When two different values meet, the result is always varying because CCP
+ // does not allow lateral transitions in the lattice. This prevents
+ // infinite cycles during propagation.
+ uint32_t ComputeLatticeMeet(Instruction* instr, uint32_t val2);
+
// Constant value table. Each entry <id, const_decl_id> in this map
// represents the compile-time constant value for |id| as declared by
// |const_decl_id|. Each |const_decl_id| in this table is an OpConstant
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/cfg.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/cfg.cpp
index ac0fcc3685b..a0248d54c48 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/cfg.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/cfg.cpp
@@ -74,6 +74,12 @@ void CFG::RemoveNonExistingEdges(uint32_t blk_id) {
void CFG::ComputeStructuredOrder(Function* func, BasicBlock* root,
std::list<BasicBlock*>* order) {
+ ComputeStructuredOrder(func, root, nullptr, order);
+}
+
+void CFG::ComputeStructuredOrder(Function* func, BasicBlock* root,
+ BasicBlock* end,
+ std::list<BasicBlock*>* order) {
assert(module_->context()->get_feature_mgr()->HasCapability(
SpvCapabilityShader) &&
"This only works on structured control flow");
@@ -81,7 +87,8 @@ void CFG::ComputeStructuredOrder(Function* func, BasicBlock* root,
// Compute structured successors and do DFS.
ComputeStructuredSuccessors(func);
auto ignore_block = [](cbb_ptr) {};
- auto ignore_edge = [](cbb_ptr, cbb_ptr) {};
+ auto terminal = [end](cbb_ptr bb) { return bb == end; };
+
auto get_structured_successors = [this](const BasicBlock* b) {
return &(block2structured_succs_[b]);
};
@@ -92,7 +99,7 @@ void CFG::ComputeStructuredOrder(Function* func, BasicBlock* root,
order->push_front(const_cast<BasicBlock*>(b));
};
CFA<BasicBlock>::DepthFirstTraversal(root, get_structured_successors,
- ignore_block, post_order, ignore_edge);
+ ignore_block, post_order, terminal);
}
void CFG::ForEachBlockInPostOrder(BasicBlock* bb,
@@ -205,7 +212,7 @@ BasicBlock* CFG::SplitLoopHeader(BasicBlock* bb) {
// Find the back edge
BasicBlock* latch_block = nullptr;
Function::iterator latch_block_iter = header_it;
- while (++latch_block_iter != fn->end()) {
+ for (; latch_block_iter != fn->end(); ++latch_block_iter) {
// If blocks are in the proper order, then the only branch that appears
// after the header is the latch.
if (std::find(pred.begin(), pred.end(), latch_block_iter->id()) !=
@@ -237,6 +244,15 @@ BasicBlock* CFG::SplitLoopHeader(BasicBlock* bb) {
context->set_instr_block(inst, new_header);
});
+ // If |bb| was the latch block, the branch back to the header is not in
+ // |new_header|.
+ if (latch_block == bb) {
+ if (new_header->ContinueBlockId() == bb->id()) {
+ new_header->GetLoopMergeInst()->SetInOperand(1, {new_header_id});
+ }
+ latch_block = new_header;
+ }
+
// Adjust the OpPhi instructions as needed.
bb->ForEachPhiInst([latch_block, bb, new_header, context](Instruction* phi) {
std::vector<uint32_t> preheader_phi_ops;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/cfg.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/cfg.h
index f2806822950..fa4fef2d5a9 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/cfg.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/cfg.h
@@ -30,7 +30,7 @@ class CFG {
public:
explicit CFG(Module* module);
- // Return the list of predecesors for basic block with label |blkid|.
+ // Return the list of predecessors for basic block with label |blkid|.
// TODO(dnovillo): Move this to BasicBlock.
const std::vector<uint32_t>& preds(uint32_t blk_id) const {
assert(label2preds_.count(blk_id));
@@ -66,6 +66,14 @@ class CFG {
void ComputeStructuredOrder(Function* func, BasicBlock* root,
std::list<BasicBlock*>* order);
+ // Compute structured block order into |order| for |func| starting at |root|
+ // and ending at |end|. This order has the property that dominators come
+ // before all blocks they dominate, merge blocks come after all blocks that
+ // are in the control constructs of their header, and continue blocks come
+ // after all the blocks in the body of their loop.
+ void ComputeStructuredOrder(Function* func, BasicBlock* root, BasicBlock* end,
+ std::list<BasicBlock*>* order);
+
// Applies |f| to all blocks that can be reach from |bb| in post order.
void ForEachBlockInPostOrder(BasicBlock* bb,
const std::function<void(BasicBlock*)>& f);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/combine_access_chains.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/combine_access_chains.cpp
index facfc24b6c0..142897a2e14 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/combine_access_chains.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/combine_access_chains.cpp
@@ -34,6 +34,10 @@ Pass::Status CombineAccessChains::Process() {
}
bool CombineAccessChains::ProcessFunction(Function& function) {
+ if (function.IsDeclaration()) {
+ return false;
+ }
+
bool modified = false;
cfg()->ForEachBlockInReversePostOrder(
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/compact_ids_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/compact_ids_pass.cpp
index 8815b8c6583..5a2a54b1789 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/compact_ids_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/compact_ids_pass.cpp
@@ -44,6 +44,11 @@ Pass::Status CompactIdsPass::Process() {
bool modified = false;
std::unordered_map<uint32_t, uint32_t> result_id_mapping;
+ // Disable automatic DebugInfo analysis for the life of the CompactIds pass.
+ // The DebugInfo manager requires the SPIR-V to be valid to run, but this is
+ // not true at all times in CompactIds as it remaps all ids.
+ context()->InvalidateAnalyses(IRContext::kAnalysisDebugInfo);
+
context()->module()->ForEachInst(
[&result_id_mapping, &modified](Instruction* inst) {
auto operand = inst->begin();
@@ -86,7 +91,8 @@ Pass::Status CompactIdsPass::Process() {
},
true);
- if (modified) {
+ if (context()->module()->id_bound() != result_id_mapping.size() + 1) {
+ modified = true;
context()->module()->SetIdBound(
static_cast<uint32_t>(result_id_mapping.size() + 1));
// There are ids in the feature manager that could now be invalid
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp
index 515a3ed5dfa..0ad755c94a2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/const_folding_rules.cpp
@@ -22,6 +22,45 @@ namespace {
const 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.
+const analysis::Constant* GetNan(const analysis::Type* type,
+ analysis::ConstantManager* const_mgr) {
+ const analysis::Float* float_type = type->AsFloat();
+ if (float_type == nullptr) {
+ return nullptr;
+ }
+
+ switch (float_type->width()) {
+ case 32:
+ return const_mgr->GetFloatConst(std::numeric_limits<float>::quiet_NaN());
+ case 64:
+ return const_mgr->GetDoubleConst(
+ std::numeric_limits<double>::quiet_NaN());
+ default:
+ return nullptr;
+ }
+}
+
+// Returns a constants with the value INF of the given type. Only works for
+// 32-bit and 64-bit float point types. Returns |nullptr| if an error occurs.
+const analysis::Constant* GetInf(const analysis::Type* type,
+ analysis::ConstantManager* const_mgr) {
+ const analysis::Float* float_type = type->AsFloat();
+ if (float_type == nullptr) {
+ return nullptr;
+ }
+
+ switch (float_type->width()) {
+ case 32:
+ return const_mgr->GetFloatConst(std::numeric_limits<float>::infinity());
+ case 64:
+ return const_mgr->GetDoubleConst(std::numeric_limits<double>::infinity());
+ default:
+ return nullptr;
+ }
+}
+
// Returns true if |type| is Float or a vector of Float.
bool HasFloatingPoint(const analysis::Type* type) {
if (type->AsFloat()) {
@@ -33,6 +72,23 @@ bool HasFloatingPoint(const analysis::Type* type) {
return false;
}
+// Returns a constants with the value |-val| of the given type. Only works for
+// 32-bit and 64-bit float point types. Returns |nullptr| if an error occurs.
+const analysis::Constant* NegateFPConst(const analysis::Type* result_type,
+ const analysis::Constant* val,
+ analysis::ConstantManager* const_mgr) {
+ const analysis::Float* float_type = result_type->AsFloat();
+ assert(float_type != nullptr);
+ if (float_type->width() == 32) {
+ float fa = val->GetFloat();
+ return const_mgr->GetFloatConst(-fa);
+ } else if (float_type->width() == 64) {
+ double da = val->GetDouble();
+ return const_mgr->GetDoubleConst(-da);
+ }
+ return nullptr;
+}
+
// Folds an OpcompositeExtract where input is a composite constant.
ConstantFoldingRule FoldExtractWithConstants() {
return [](IRContext* context, Instruction* inst,
@@ -195,6 +251,193 @@ ConstantFoldingRule FoldVectorTimesScalar() {
};
}
+ConstantFoldingRule FoldVectorTimesMatrix() {
+ return [](IRContext* context, Instruction* inst,
+ const std::vector<const analysis::Constant*>& constants)
+ -> const analysis::Constant* {
+ assert(inst->opcode() == SpvOpVectorTimesMatrix);
+ analysis::ConstantManager* const_mgr = context->get_constant_mgr();
+ analysis::TypeManager* type_mgr = context->get_type_mgr();
+
+ if (!inst->IsFloatingPointFoldingAllowed()) {
+ if (HasFloatingPoint(type_mgr->GetType(inst->type_id()))) {
+ return nullptr;
+ }
+ }
+
+ const analysis::Constant* c1 = constants[0];
+ const analysis::Constant* c2 = constants[1];
+
+ if (c1 == nullptr || c2 == nullptr) {
+ return nullptr;
+ }
+
+ // Check result type.
+ const analysis::Type* result_type = type_mgr->GetType(inst->type_id());
+ const analysis::Vector* vector_type = result_type->AsVector();
+ assert(vector_type != nullptr);
+ const analysis::Type* element_type = vector_type->element_type();
+ assert(element_type != nullptr);
+ const analysis::Float* float_type = element_type->AsFloat();
+ assert(float_type != nullptr);
+
+ // Check types of c1 and c2.
+ assert(c1->type()->AsVector() == vector_type);
+ assert(c1->type()->AsVector()->element_type() == element_type &&
+ c2->type()->AsMatrix()->element_type() == vector_type);
+
+ // Get a float vector that is the result of vector-times-matrix.
+ std::vector<const analysis::Constant*> c1_components =
+ c1->GetVectorComponents(const_mgr);
+ std::vector<const analysis::Constant*> c2_components =
+ c2->AsMatrixConstant()->GetComponents();
+ uint32_t resultVectorSize = result_type->AsVector()->element_count();
+
+ std::vector<uint32_t> ids;
+
+ if ((c1 && c1->IsZero()) || (c2 && c2->IsZero())) {
+ std::vector<uint32_t> words(float_type->width() / 32, 0);
+ for (uint32_t i = 0; i < resultVectorSize; ++i) {
+ const analysis::Constant* new_elem =
+ const_mgr->GetConstant(float_type, words);
+ ids.push_back(const_mgr->GetDefiningInstruction(new_elem)->result_id());
+ }
+ return const_mgr->GetConstant(vector_type, ids);
+ }
+
+ 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;
+ }
+ utils::FloatProxy<float> result(result_scalar);
+ std::vector<uint32_t> words = result.GetWords();
+ const analysis::Constant* new_elem =
+ const_mgr->GetConstant(float_type, words);
+ ids.push_back(const_mgr->GetDefiningInstruction(new_elem)->result_id());
+ }
+ return const_mgr->GetConstant(vector_type, ids);
+ } 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;
+ }
+ utils::FloatProxy<double> result(result_scalar);
+ std::vector<uint32_t> words = result.GetWords();
+ const analysis::Constant* new_elem =
+ const_mgr->GetConstant(float_type, words);
+ ids.push_back(const_mgr->GetDefiningInstruction(new_elem)->result_id());
+ }
+ return const_mgr->GetConstant(vector_type, ids);
+ }
+ return nullptr;
+ };
+}
+
+ConstantFoldingRule FoldMatrixTimesVector() {
+ return [](IRContext* context, Instruction* inst,
+ const std::vector<const analysis::Constant*>& constants)
+ -> const analysis::Constant* {
+ assert(inst->opcode() == SpvOpMatrixTimesVector);
+ analysis::ConstantManager* const_mgr = context->get_constant_mgr();
+ analysis::TypeManager* type_mgr = context->get_type_mgr();
+
+ if (!inst->IsFloatingPointFoldingAllowed()) {
+ if (HasFloatingPoint(type_mgr->GetType(inst->type_id()))) {
+ return nullptr;
+ }
+ }
+
+ const analysis::Constant* c1 = constants[0];
+ const analysis::Constant* c2 = constants[1];
+
+ if (c1 == nullptr || c2 == nullptr) {
+ return nullptr;
+ }
+
+ // Check result type.
+ const analysis::Type* result_type = type_mgr->GetType(inst->type_id());
+ const analysis::Vector* vector_type = result_type->AsVector();
+ assert(vector_type != nullptr);
+ const analysis::Type* element_type = vector_type->element_type();
+ assert(element_type != nullptr);
+ const analysis::Float* float_type = element_type->AsFloat();
+ assert(float_type != nullptr);
+
+ // Check types of c1 and c2.
+ assert(c1->type()->AsMatrix()->element_type() == vector_type);
+ assert(c2->type()->AsVector()->element_type() == element_type);
+
+ // Get a float vector that is the result of matrix-times-vector.
+ std::vector<const analysis::Constant*> c1_components =
+ c1->AsMatrixConstant()->GetComponents();
+ std::vector<const analysis::Constant*> c2_components =
+ c2->GetVectorComponents(const_mgr);
+ uint32_t resultVectorSize = result_type->AsVector()->element_count();
+
+ std::vector<uint32_t> ids;
+
+ if ((c1 && c1->IsZero()) || (c2 && c2->IsZero())) {
+ std::vector<uint32_t> words(float_type->width() / 32, 0);
+ for (uint32_t i = 0; i < resultVectorSize; ++i) {
+ const analysis::Constant* new_elem =
+ const_mgr->GetConstant(float_type, words);
+ ids.push_back(const_mgr->GetDefiningInstruction(new_elem)->result_id());
+ }
+ return const_mgr->GetConstant(vector_type, ids);
+ }
+
+ if (float_type->width() == 32) {
+ 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;
+ }
+ utils::FloatProxy<float> result(result_scalar);
+ std::vector<uint32_t> words = result.GetWords();
+ const analysis::Constant* new_elem =
+ const_mgr->GetConstant(float_type, words);
+ ids.push_back(const_mgr->GetDefiningInstruction(new_elem)->result_id());
+ }
+ return const_mgr->GetConstant(vector_type, ids);
+ } else if (float_type->width() == 64) {
+ 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;
+ }
+ utils::FloatProxy<double> result(result_scalar);
+ std::vector<uint32_t> words = result.GetWords();
+ const analysis::Constant* new_elem =
+ const_mgr->GetConstant(float_type, words);
+ ids.push_back(const_mgr->GetDefiningInstruction(new_elem)->result_id());
+ }
+ return const_mgr->GetConstant(vector_type, ids);
+ }
+ return nullptr;
+ };
+}
+
ConstantFoldingRule FoldCompositeWithConstants() {
// Folds an OpCompositeConstruct where all of the inputs are constants to a
// constant. A new constant is created if necessary.
@@ -492,7 +735,60 @@ ConstantFoldingRule FoldQuantizeToF16() {
ConstantFoldingRule FoldFSub() { return FoldFPBinaryOp(FOLD_FPARITH_OP(-)); }
ConstantFoldingRule FoldFAdd() { return FoldFPBinaryOp(FOLD_FPARITH_OP(+)); }
ConstantFoldingRule FoldFMul() { return FoldFPBinaryOp(FOLD_FPARITH_OP(*)); }
-ConstantFoldingRule FoldFDiv() { return FoldFPBinaryOp(FOLD_FPARITH_OP(/)); }
+
+// Returns the constant that results from evaluating |numerator| / 0.0. Returns
+// |nullptr| if the result could not be evaluated.
+const analysis::Constant* FoldFPScalarDivideByZero(
+ const analysis::Type* result_type, const analysis::Constant* numerator,
+ analysis::ConstantManager* const_mgr) {
+ if (numerator == nullptr) {
+ return nullptr;
+ }
+
+ if (numerator->IsZero()) {
+ return GetNan(result_type, const_mgr);
+ }
+
+ const analysis::Constant* result = GetInf(result_type, const_mgr);
+ if (result == nullptr) {
+ return nullptr;
+ }
+
+ if (numerator->AsFloatConstant()->GetValueAsDouble() < 0.0) {
+ result = NegateFPConst(result_type, result, const_mgr);
+ }
+ return result;
+}
+
+// Returns the result of folding |numerator| / |denominator|. Returns |nullptr|
+// if it cannot be folded.
+const analysis::Constant* FoldScalarFPDivide(
+ const analysis::Type* result_type, const analysis::Constant* numerator,
+ const analysis::Constant* denominator,
+ analysis::ConstantManager* const_mgr) {
+ if (denominator == nullptr) {
+ return nullptr;
+ }
+
+ if (denominator->IsZero()) {
+ return FoldFPScalarDivideByZero(result_type, numerator, const_mgr);
+ }
+
+ const analysis::FloatConstant* denominator_float =
+ denominator->AsFloatConstant();
+ if (denominator_float && denominator->GetValueAsDouble() == -0.0) {
+ const analysis::Constant* result =
+ FoldFPScalarDivideByZero(result_type, numerator, const_mgr);
+ if (result != nullptr)
+ result = NegateFPConst(result_type, result, const_mgr);
+ return result;
+ } else {
+ return FOLD_FPARITH_OP(/)(result_type, numerator, denominator, const_mgr);
+ }
+}
+
+// Returns the constant folding rule to fold |OpFDiv| with two constants.
+ConstantFoldingRule FoldFDiv() { return FoldFPBinaryOp(FoldScalarFPDivide); }
bool CompareFloatingPoint(bool op_result, bool op_unordered,
bool need_ordered) {
@@ -655,20 +951,7 @@ UnaryScalarFoldingRule FoldFNegateOp() {
analysis::ConstantManager* const_mgr) -> const analysis::Constant* {
assert(result_type != nullptr && a != nullptr);
assert(result_type == a->type());
- const analysis::Float* float_type = result_type->AsFloat();
- assert(float_type != nullptr);
- if (float_type->width() == 32) {
- float fa = a->GetFloat();
- utils::FloatProxy<float> result(-fa);
- std::vector<uint32_t> words = result.GetWords();
- return const_mgr->GetConstant(result_type, words);
- } else if (float_type->width() == 64) {
- double da = a->GetDouble();
- utils::FloatProxy<double> result(-da);
- std::vector<uint32_t> words = result.GetWords();
- return const_mgr->GetConstant(result_type, words);
- }
- return nullptr;
+ return NegateFPConst(result_type, a, const_mgr);
};
}
@@ -900,17 +1183,6 @@ ConstantFoldingRule FoldFMix() {
};
}
-template <class IntType>
-IntType FoldIClamp(IntType x, IntType min_val, IntType max_val) {
- if (x < min_val) {
- x = min_val;
- }
- if (x > max_val) {
- x = max_val;
- }
- return x;
-}
-
const analysis::Constant* FoldMin(const analysis::Type* result_type,
const analysis::Constant* a,
const analysis::Constant* b,
@@ -1192,6 +1464,8 @@ void ConstantFoldingRules::AddFoldingRules() {
rules_[SpvOpVectorShuffle].push_back(FoldVectorShuffleWithConstants());
rules_[SpvOpVectorTimesScalar].push_back(FoldVectorTimesScalar());
+ rules_[SpvOpVectorTimesMatrix].push_back(FoldVectorTimesMatrix());
+ rules_[SpvOpMatrixTimesVector].push_back(FoldMatrixTimesVector());
rules_[SpvOpFNegate].push_back(FoldFNegate());
rules_[SpvOpQuantizeToF16].push_back(FoldQuantizeToF16());
@@ -1250,7 +1524,7 @@ void ConstantFoldingRules::AddFoldingRules() {
FoldFPUnaryOp(FoldFTranscendentalUnary(std::log)));
#ifdef __ANDROID__
- // Android NDK r15c tageting ABI 15 doesn't have full support for C++11
+ // Android NDK r15c targeting ABI 15 doesn't have full support for C++11
// (no std::exp2/log2). ::exp2 is available from C99 but ::log2 isn't
// available up until ABI 18 so we use a shim
auto log2_shim = [](double v) -> double { return log(v) / log(2.0); };
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/constants.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/constants.cpp
index a3dac5d7757..bcff08c1359 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/constants.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/constants.cpp
@@ -158,6 +158,7 @@ Type* ConstantManager::GetType(const Instruction* inst) const {
std::vector<const Constant*> ConstantManager::GetOperandConstants(
const Instruction* inst) const {
std::vector<const Constant*> constants;
+ constants.reserve(inst->NumInOperands());
for (uint32_t i = 0; i < inst->NumInOperands(); i++) {
const Operand* operand = &inst->GetInOperand(i);
if (operand->type != SPV_OPERAND_TYPE_ID) {
@@ -217,7 +218,8 @@ Instruction* ConstantManager::BuildInstructionAndAddToModule(
auto* new_inst_ptr = new_inst.get();
*pos = pos->InsertBefore(std::move(new_inst));
++(*pos);
- context()->get_def_use_mgr()->AnalyzeInstDefUse(new_inst_ptr);
+ if (context()->AreAnalysesValid(IRContext::Analysis::kAnalysisDefUse))
+ context()->get_def_use_mgr()->AnalyzeInstDefUse(new_inst_ptr);
MapConstantToInst(new_const, new_inst_ptr);
return new_inst_ptr;
}
@@ -419,13 +421,30 @@ const Constant* ConstantManager::GetNumericVectorConstantWithWords(
return GetConstant(type, element_ids);
}
-uint32_t ConstantManager::GetFloatConst(float val) {
+uint32_t ConstantManager::GetFloatConstId(float val) {
+ const Constant* c = GetFloatConst(val);
+ return GetDefiningInstruction(c)->result_id();
+}
+
+const Constant* ConstantManager::GetFloatConst(float val) {
Type* float_type = context()->get_type_mgr()->GetFloatType();
utils::FloatProxy<float> v(val);
const Constant* c = GetConstant(float_type, v.GetWords());
+ return c;
+}
+
+uint32_t ConstantManager::GetDoubleConstId(double val) {
+ const Constant* c = GetDoubleConst(val);
return GetDefiningInstruction(c)->result_id();
}
+const Constant* ConstantManager::GetDoubleConst(double val) {
+ Type* float_type = context()->get_type_mgr()->GetDoubleType();
+ utils::FloatProxy<double> v(val);
+ const Constant* c = GetConstant(float_type, v.GetWords());
+ return c;
+}
+
uint32_t ConstantManager::GetSIntConst(int32_t val) {
Type* sint_type = context()->get_type_mgr()->GetSIntType();
const Constant* c = GetConstant(sint_type, {static_cast<uint32_t>(val)});
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/constants.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/constants.h
index acc64cd2d16..620991efac8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/constants.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/constants.h
@@ -163,6 +163,21 @@ class ScalarConstant : public Constant {
return is_zero;
}
+ uint32_t GetU32BitValue() const {
+ // Relies on unsigned values smaller than 32-bit being zero extended. See
+ // section 2.2.1 of the SPIR-V spec.
+ assert(words().size() == 1);
+ return words()[0];
+ }
+
+ uint64_t GetU64BitValue() const {
+ // Relies on unsigned values smaller than 64-bit being zero extended. See
+ // section 2.2.1 of the SPIR-V spec.
+ assert(words().size() == 2);
+ return static_cast<uint64_t>(words()[1]) << 32 |
+ static_cast<uint64_t>(words()[0]);
+ }
+
protected:
ScalarConstant(const Type* ty, const std::vector<uint32_t>& w)
: Constant(ty), words_(w) {}
@@ -189,13 +204,6 @@ class IntConstant : public ScalarConstant {
return words()[0];
}
- uint32_t GetU32BitValue() const {
- // Relies on unsigned values smaller than 32-bit being zero extended. See
- // section 2.2.1 of the SPIR-V spec.
- assert(words().size() == 1);
- return words()[0];
- }
-
int64_t GetS64BitValue() const {
// Relies on unsigned values smaller than 64-bit being sign extended. See
// section 2.2.1 of the SPIR-V spec.
@@ -204,14 +212,6 @@ class IntConstant : public ScalarConstant {
static_cast<uint64_t>(words()[0]);
}
- uint64_t GetU64BitValue() const {
- // Relies on unsigned values smaller than 64-bit being zero extended. See
- // section 2.2.1 of the SPIR-V spec.
- assert(words().size() == 2);
- return static_cast<uint64_t>(words()[1]) << 32 |
- static_cast<uint64_t>(words()[0]);
- }
-
// Make a copy of this IntConstant instance.
std::unique_ptr<IntConstant> CopyIntConstant() const {
return MakeUnique<IntConstant>(type_->AsInteger(), words_);
@@ -541,7 +541,7 @@ class ConstantManager {
// instruction at the end of the current module's types section.
//
// |type_id| is an optional argument for disambiguating equivalent types. If
- // |type_id| is specified, the contant returned will have that type id.
+ // |type_id| is specified, the constant returned will have that type id.
Instruction* GetDefiningInstruction(const Constant* c, uint32_t type_id = 0,
Module::inst_iterator* pos = nullptr);
@@ -637,7 +637,16 @@ class ConstantManager {
}
// Returns the id of a 32-bit floating point constant with value |val|.
- uint32_t GetFloatConst(float val);
+ uint32_t GetFloatConstId(float val);
+
+ // Returns a 32-bit float constant with the given value.
+ const Constant* GetFloatConst(float val);
+
+ // Returns the id of a 64-bit floating point constant with value |val|.
+ uint32_t GetDoubleConstId(double val);
+
+ // Returns a 64-bit float constant with the given value.
+ const Constant* GetDoubleConst(double val);
// Returns the id of a 32-bit signed integer constant with value |val|.
uint32_t GetSIntConst(int32_t val);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp
index 6b3b540aa42..4086e31ac16 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.cpp
@@ -177,18 +177,21 @@ bool ConvertToHalfPass::GenHalfArith(Instruction* inst) {
return modified;
}
-bool ConvertToHalfPass::ProcessPhi(Instruction* inst) {
- // Add float16 converts of any float32 operands and change type
- // of phi to float16 equivalent. Operand converts need to be added to
- // preceeding blocks.
+bool ConvertToHalfPass::ProcessPhi(Instruction* inst, uint32_t from_width,
+ uint32_t to_width) {
+ // Add converts of any float operands to to_width if they are of from_width.
+ // If converting to 16, change type of phi to float16 equivalent and remember
+ // result id. Converts need to be added to preceding blocks.
uint32_t ocnt = 0;
uint32_t* prev_idp;
- inst->ForEachInId([&ocnt, &prev_idp, this](uint32_t* idp) {
+ bool modified = false;
+ inst->ForEachInId([&ocnt, &prev_idp, &from_width, &to_width, &modified,
+ this](uint32_t* idp) {
if (ocnt % 2 == 0) {
prev_idp = idp;
} else {
Instruction* val_inst = get_def_use_mgr()->GetDef(*prev_idp);
- if (IsFloat(val_inst, 32)) {
+ if (IsFloat(val_inst, from_width)) {
BasicBlock* bp = context()->get_instr_block(*idp);
auto insert_before = bp->tail();
if (insert_before != bp->begin()) {
@@ -197,15 +200,19 @@ bool ConvertToHalfPass::ProcessPhi(Instruction* inst) {
insert_before->opcode() != SpvOpLoopMerge)
++insert_before;
}
- GenConvert(prev_idp, 16, &*insert_before);
+ GenConvert(prev_idp, to_width, &*insert_before);
+ modified = true;
}
}
++ocnt;
});
- inst->SetResultType(EquivFloatTypeId(inst->type_id(), 16));
- get_def_use_mgr()->AnalyzeInstUse(inst);
- converted_ids_.insert(inst->result_id());
- return true;
+ if (to_width == 16u) {
+ inst->SetResultType(EquivFloatTypeId(inst->type_id(), 16u));
+ converted_ids_.insert(inst->result_id());
+ modified = true;
+ }
+ if (modified) get_def_use_mgr()->AnalyzeInstUse(inst);
+ return modified;
}
bool ConvertToHalfPass::ProcessConvert(Instruction* inst) {
@@ -242,9 +249,10 @@ bool ConvertToHalfPass::ProcessImageRef(Instruction* inst) {
}
bool ConvertToHalfPass::ProcessDefault(Instruction* inst) {
- bool modified = false;
// If non-relaxed instruction has changed operands, need to convert
// them back to float32
+ if (inst->opcode() == SpvOpPhi) return ProcessPhi(inst, 16u, 32u);
+ bool modified = false;
inst->ForEachInId([&inst, &modified, this](uint32_t* idp) {
if (converted_ids_.count(*idp) == 0) return;
uint32_t old_id = *idp;
@@ -262,7 +270,7 @@ bool ConvertToHalfPass::GenHalfInst(Instruction* inst) {
if (IsArithmetic(inst) && inst_relaxed)
modified = GenHalfArith(inst);
else if (inst->opcode() == SpvOpPhi && inst_relaxed)
- modified = ProcessPhi(inst);
+ modified = ProcessPhi(inst, 32u, 16u);
else if (inst->opcode() == SpvOpFConvert)
modified = ProcessConvert(inst);
else if (image_ops_.count(inst->opcode()) != 0)
@@ -340,7 +348,7 @@ Pass::Status ConvertToHalfPass::ProcessImpl() {
Pass::ProcessFunction pfn = [this](Function* fp) {
return ProcessFunction(fp);
};
- bool modified = context()->ProcessEntryPointCallTree(pfn);
+ bool modified = context()->ProcessReachableCallTree(pfn);
// If modified, make sure module has Float16 capability
if (modified) context()->AddCapability(SpvCapabilityFloat16);
// Remove all RelaxedPrecision decorations from instructions and globals
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.h
index b647dd4a315..c6e84d1b741 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/convert_to_half_pass.h
@@ -93,7 +93,7 @@ class ConvertToHalfPass : public Pass {
bool GenHalfArith(Instruction* inst);
// Gen code for relaxed phi |inst|
- bool ProcessPhi(Instruction* inst);
+ bool ProcessPhi(Instruction* inst, uint32_t from_width, uint32_t to_width);
// Gen code for relaxed convert |inst|
bool ProcessConvert(Instruction* inst);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.cpp
index f505d8a5d29..0b235629bfd 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.cpp
@@ -40,6 +40,10 @@ bool IsDebugDeclareOrValue(Instruction* di) {
Pass::Status CopyPropagateArrays::Process() {
bool modified = false;
for (Function& function : *get_module()) {
+ if (function.IsDeclaration()) {
+ continue;
+ }
+
BasicBlock* entry_bb = &*function.begin();
for (auto var_inst = entry_bb->begin(); var_inst->opcode() == SpvOpVariable;
@@ -147,9 +151,17 @@ Instruction* CopyPropagateArrays::BuildNewAccessChain(
return source->GetVariable();
}
+ source->BuildConstants();
+ std::vector<uint32_t> access_ids(source->AccessChain().size());
+ std::transform(
+ source->AccessChain().cbegin(), source->AccessChain().cend(),
+ access_ids.begin(), [](const AccessChainEntry& entry) {
+ assert(entry.is_result_id && "Constants needs to be built first.");
+ return entry.result_id;
+ });
+
return builder.AddAccessChain(source->GetPointerTypeId(this),
- source->GetVariable()->result_id(),
- source->AccessChain());
+ source->GetVariable()->result_id(), access_ids);
}
bool CopyPropagateArrays::HasNoStores(Instruction* ptr_inst) {
@@ -164,6 +176,8 @@ bool CopyPropagateArrays::HasNoStores(Instruction* ptr_inst) {
return false;
} else if (use->opcode() == SpvOpImageTexelPointer) {
return true;
+ } else if (use->opcode() == SpvOpEntryPoint) {
+ return true;
}
// Some other instruction. Be conservative.
return false;
@@ -264,30 +278,20 @@ std::unique_ptr<CopyPropagateArrays::MemoryObject>
CopyPropagateArrays::BuildMemoryObjectFromExtract(Instruction* extract_inst) {
assert(extract_inst->opcode() == SpvOpCompositeExtract &&
"Expecting an OpCompositeExtract instruction.");
- analysis::ConstantManager* const_mgr = context()->get_constant_mgr();
-
std::unique_ptr<MemoryObject> result = GetSourceObjectIfAny(
extract_inst->GetSingleWordInOperand(kCompositeExtractObjectInOperand));
- if (result) {
- analysis::Integer int_type(32, false);
- const analysis::Type* uint32_type =
- context()->get_type_mgr()->GetRegisteredType(&int_type);
-
- std::vector<uint32_t> components;
- // Convert the indices in the extract instruction to a series of ids that
- // can be used by the |OpAccessChain| instruction.
- for (uint32_t i = 1; i < extract_inst->NumInOperands(); ++i) {
- uint32_t index = extract_inst->GetSingleWordInOperand(i);
- const analysis::Constant* index_const =
- const_mgr->GetConstant(uint32_type, {index});
- components.push_back(
- const_mgr->GetDefiningInstruction(index_const)->result_id());
- }
- result->GetMember(components);
- return result;
+ if (!result) {
+ return nullptr;
}
- return nullptr;
+
+ // Copy the indices of the extract instruction to |OpAccessChain| indices.
+ std::vector<AccessChainEntry> components;
+ for (uint32_t i = 1; i < extract_inst->NumInOperands(); ++i) {
+ components.push_back({false, {extract_inst->GetSingleWordInOperand(i)}});
+ }
+ result->PushIndirection(components);
+ return result;
}
std::unique_ptr<CopyPropagateArrays::MemoryObject>
@@ -311,19 +315,12 @@ CopyPropagateArrays::BuildMemoryObjectFromCompositeConstruct(
return nullptr;
}
- analysis::ConstantManager* const_mgr = context()->get_constant_mgr();
- const analysis::Constant* last_access =
- const_mgr->FindDeclaredConstant(memory_object->AccessChain().back());
- if (!last_access || !last_access->type()->AsInteger()) {
- return nullptr;
- }
-
- if (last_access->GetU32() != 0) {
+ AccessChainEntry last_access = memory_object->AccessChain().back();
+ if (!IsAccessChainIndexValidAndEqualTo(last_access, 0)) {
return nullptr;
}
- memory_object->GetParent();
-
+ memory_object->PopIndirection();
if (memory_object->GetNumberOfMembers() !=
conststruct_inst->NumInOperands()) {
return nullptr;
@@ -345,13 +342,8 @@ CopyPropagateArrays::BuildMemoryObjectFromCompositeConstruct(
return nullptr;
}
- last_access =
- const_mgr->FindDeclaredConstant(member_object->AccessChain().back());
- if (!last_access || !last_access->type()->AsInteger()) {
- return nullptr;
- }
-
- if (last_access->GetU32() != i) {
+ last_access = member_object->AccessChain().back();
+ if (!IsAccessChainIndexValidAndEqualTo(last_access, i)) {
return nullptr;
}
}
@@ -405,17 +397,12 @@ CopyPropagateArrays::BuildMemoryObjectFromInsert(Instruction* insert_inst) {
return nullptr;
}
- const analysis::Constant* last_access =
- const_mgr->FindDeclaredConstant(memory_object->AccessChain().back());
- if (!last_access || !last_access->type()->AsInteger()) {
- return nullptr;
- }
-
- if (last_access->GetU32() != number_of_elements - 1) {
+ AccessChainEntry last_access = memory_object->AccessChain().back();
+ if (!IsAccessChainIndexValidAndEqualTo(last_access, number_of_elements - 1)) {
return nullptr;
}
- memory_object->GetParent();
+ memory_object->PopIndirection();
Instruction* current_insert =
def_use_mgr->GetDef(insert_inst->GetSingleWordInOperand(1));
@@ -452,14 +439,9 @@ CopyPropagateArrays::BuildMemoryObjectFromInsert(Instruction* insert_inst) {
return nullptr;
}
- const analysis::Constant* current_last_access =
- const_mgr->FindDeclaredConstant(
- current_memory_object->AccessChain().back());
- if (!current_last_access || !current_last_access->type()->AsInteger()) {
- return nullptr;
- }
-
- if (current_last_access->GetU32() != i - 1) {
+ AccessChainEntry current_last_access =
+ current_memory_object->AccessChain().back();
+ if (!IsAccessChainIndexValidAndEqualTo(current_last_access, i - 1)) {
return nullptr;
}
current_insert =
@@ -469,6 +451,21 @@ CopyPropagateArrays::BuildMemoryObjectFromInsert(Instruction* insert_inst) {
return memory_object;
}
+bool CopyPropagateArrays::IsAccessChainIndexValidAndEqualTo(
+ const AccessChainEntry& entry, uint32_t value) const {
+ if (!entry.is_result_id) {
+ return entry.immediate == value;
+ }
+
+ analysis::ConstantManager* const_mgr = context()->get_constant_mgr();
+ const analysis::Constant* constant =
+ const_mgr->FindDeclaredConstant(entry.result_id);
+ if (!constant || !constant->type()->AsInteger()) {
+ return false;
+ }
+ return constant->GetU32() == value;
+}
+
bool CopyPropagateArrays::IsPointerToArrayType(uint32_t type_id) {
analysis::TypeManager* type_mgr = context()->get_type_mgr();
analysis::Pointer* pointer_type = type_mgr->GetType(type_id)->AsPointer();
@@ -526,6 +523,12 @@ bool CopyPropagateArrays::CanUpdateUses(Instruction* original_ptr_inst,
// Variable index means the type is a type where every element
// is the same type. Use element 0 to get the type.
access_chain.push_back(0);
+
+ // We are trying to access a struct with variable indices.
+ // This cannot happen.
+ if (pointee_type->kind() == analysis::Type::kStruct) {
+ return false;
+ }
}
}
@@ -741,11 +744,11 @@ void CopyPropagateArrays::UpdateUses(Instruction* original_ptr_inst,
context()->AnalyzeUses(use);
}
break;
+ case SpvOpDecorate:
+ // 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:
- // We treat an OpImageTexelPointer as a load. The result type should
- // always have the Image storage class, and should not need to be
- // updated.
-
// Replace the actual use.
context()->ForgetUses(use);
use->SetOperand(index, {new_ptr_inst->result_id()});
@@ -781,8 +784,8 @@ uint32_t CopyPropagateArrays::GetMemberTypeId(
return id;
}
-void CopyPropagateArrays::MemoryObject::GetMember(
- const std::vector<uint32_t>& access_chain) {
+void CopyPropagateArrays::MemoryObject::PushIndirection(
+ const std::vector<AccessChainEntry>& access_chain) {
access_chain_.insert(access_chain_.end(), access_chain.begin(),
access_chain.end());
}
@@ -817,23 +820,29 @@ uint32_t CopyPropagateArrays::MemoryObject::GetNumberOfMembers() {
template <class iterator>
CopyPropagateArrays::MemoryObject::MemoryObject(Instruction* var_inst,
iterator begin, iterator end)
- : variable_inst_(var_inst), access_chain_(begin, end) {}
+ : variable_inst_(var_inst) {
+ std::transform(begin, end, std::back_inserter(access_chain_),
+ [](uint32_t id) {
+ return AccessChainEntry{true, {id}};
+ });
+}
std::vector<uint32_t> CopyPropagateArrays::MemoryObject::GetAccessIds() const {
analysis::ConstantManager* const_mgr =
variable_inst_->context()->get_constant_mgr();
- std::vector<uint32_t> access_indices;
- for (uint32_t id : AccessChain()) {
- const analysis::Constant* element_index_const =
- const_mgr->FindDeclaredConstant(id);
- if (!element_index_const) {
- access_indices.push_back(0);
- } else {
- access_indices.push_back(element_index_const->GetU32());
- }
- }
- return access_indices;
+ std::vector<uint32_t> indices(AccessChain().size());
+ std::transform(AccessChain().cbegin(), AccessChain().cend(), indices.begin(),
+ [&const_mgr](const AccessChainEntry& entry) {
+ if (entry.is_result_id) {
+ const analysis::Constant* constant =
+ const_mgr->FindDeclaredConstant(entry.result_id);
+ return constant == nullptr ? 0 : constant->GetU32();
+ }
+
+ return entry.immediate;
+ });
+ return indices;
}
bool CopyPropagateArrays::MemoryObject::Contains(
@@ -854,5 +863,24 @@ bool CopyPropagateArrays::MemoryObject::Contains(
return true;
}
+void CopyPropagateArrays::MemoryObject::BuildConstants() {
+ for (auto& entry : access_chain_) {
+ if (entry.is_result_id) {
+ continue;
+ }
+
+ auto context = variable_inst_->context();
+ analysis::Integer int_type(32, false);
+ const analysis::Type* uint32_type =
+ context->get_type_mgr()->GetRegisteredType(&int_type);
+ analysis::ConstantManager* const_mgr = context->get_constant_mgr();
+ const analysis::Constant* index_const =
+ const_mgr->GetConstant(uint32_type, {entry.immediate});
+ entry.result_id =
+ const_mgr->GetDefiningInstruction(index_const)->result_id();
+ entry.is_result_id = true;
+ }
+}
+
} // namespace opt
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.h
index f4314a74b7a..9e7641f6157 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/copy_prop_arrays.h
@@ -35,7 +35,7 @@ namespace opt {
//
// The hard part is keeping all of the types correct. We do not want to
// have to do too large a search to update everything, which may not be
-// possible, do we give up if we see any instruction that might be hard to
+// possible, so we give up if we see any instruction that might be hard to
// update.
class CopyPropagateArrays : public MemPass {
@@ -52,6 +52,22 @@ class CopyPropagateArrays : public MemPass {
}
private:
+ // Represents one index in the OpAccessChain instruction. It can be either
+ // an instruction's result_id (OpConstant by ex), or a immediate value.
+ // Immediate values are used to prepare the final access chain without
+ // creating OpConstant instructions until done.
+ struct AccessChainEntry {
+ bool is_result_id;
+ union {
+ uint32_t result_id;
+ uint32_t immediate;
+ };
+
+ bool operator!=(const AccessChainEntry& other) const {
+ return other.is_result_id != is_result_id || other.result_id != result_id;
+ }
+ };
+
// The class used to identify a particular memory object. This memory object
// will be owned by a particular variable, meaning that the memory is part of
// that variable. It could be the entire variable or a member of the
@@ -70,12 +86,12 @@ class CopyPropagateArrays : public MemPass {
// (starting from the current member). The elements in |access_chain| are
// interpreted the same as the indices in the |OpAccessChain|
// instruction.
- void GetMember(const std::vector<uint32_t>& access_chain);
+ void PushIndirection(const std::vector<AccessChainEntry>& access_chain);
// Change |this| to now represent the first enclosing object to which it
// belongs. (Remove the last element off the access_chain). It is invalid
// to call this function if |this| does not represent a member of its owner.
- void GetParent() {
+ void PopIndirection() {
assert(IsMember());
access_chain_.pop_back();
}
@@ -95,7 +111,13 @@ class CopyPropagateArrays : public MemPass {
// member that |this| represents starting from the owning variable. These
// values are to be interpreted the same way the indices are in an
// |OpAccessChain| instruction.
- const std::vector<uint32_t>& AccessChain() const { return access_chain_; }
+ const std::vector<AccessChainEntry>& AccessChain() const {
+ return access_chain_;
+ }
+
+ // Converts all immediate values in the AccessChain their OpConstant
+ // equivalent.
+ void BuildConstants();
// Returns the type id of the pointer type that can be used to point to this
// memory object.
@@ -137,7 +159,7 @@ class CopyPropagateArrays : public MemPass {
// The access chain to reach the particular member the memory object
// represents. It should be interpreted the same way the indices in an
// |OpAccessChain| are interpreted.
- std::vector<uint32_t> access_chain_;
+ std::vector<AccessChainEntry> access_chain_;
std::vector<uint32_t> GetAccessIds() const;
};
@@ -192,10 +214,14 @@ class CopyPropagateArrays : public MemPass {
std::unique_ptr<MemoryObject> BuildMemoryObjectFromInsert(
Instruction* insert_inst);
+ // Return true if the given entry can represent the given value.
+ bool IsAccessChainIndexValidAndEqualTo(const AccessChainEntry& entry,
+ uint32_t value) const;
+
// Return true if |type_id| is a pointer type whose pointee type is an array.
bool IsPointerToArrayType(uint32_t type_id);
- // Returns true of there are not stores using |ptr_inst| or something derived
+ // Returns true if there are not stores using |ptr_inst| or something derived
// from it.
bool HasNoStores(Instruction* ptr_inst);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.cpp
index 0054f57647e..d99b7f78ab9 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.cpp
@@ -207,7 +207,7 @@ bool DeadBranchElimPass::SimplifyBranch(BasicBlock* block,
Instruction::OperandList new_operands;
new_operands.push_back(terminator->GetInOperand(0));
new_operands.push_back({SPV_OPERAND_TYPE_ID, {live_lab_id}});
- terminator->SetInOperands(move(new_operands));
+ terminator->SetInOperands(std::move(new_operands));
context()->UpdateDefUse(terminator);
} else {
// Check if the merge instruction is still needed because of a
@@ -346,6 +346,7 @@ bool DeadBranchElimPass::FixPhiNodesInLiveBlocks(
if (operands.size() == 4) {
// First input data operands is at index 2.
uint32_t replId = operands[2u].words[0];
+ context()->KillNamesAndDecorates(inst->result_id());
context()->ReplaceAllUsesWith(inst->result_id(), replId);
iter = context()->KillInst(&*inst);
} else {
@@ -419,6 +420,10 @@ bool DeadBranchElimPass::EraseDeadBlocks(
}
bool DeadBranchElimPass::EliminateDeadBranches(Function* func) {
+ if (func->IsDeclaration()) {
+ return false;
+ }
+
bool modified = false;
std::unordered_set<BasicBlock*> live_blocks;
modified |= MarkLiveBlocks(func, &live_blocks);
@@ -454,17 +459,8 @@ void DeadBranchElimPass::FixBlockOrder() {
};
// Reorders blocks according to structured order.
- ProcessFunction reorder_structured = [this](Function* function) {
- std::list<BasicBlock*> order;
- context()->cfg()->ComputeStructuredOrder(function, &*function->begin(),
- &order);
- std::vector<BasicBlock*> blocks;
- for (auto block : order) {
- blocks.push_back(block);
- }
- for (uint32_t i = 1; i < blocks.size(); ++i) {
- function->MoveBasicBlockToAfter(blocks[i]->id(), blocks[i - 1]);
- }
+ ProcessFunction reorder_structured = [](Function* function) {
+ function->ReorderBasicBlocksInStructuredOrder();
return true;
};
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.h
index 7841bc4705f..198bad2dcb0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_branch_elim_pass.h
@@ -98,7 +98,7 @@ class DeadBranchElimPass : public MemPass {
// Fix phis in reachable blocks so that only live (or unremovable) incoming
// edges are present. If the block now only has a single live incoming edge,
// remove the phi and replace its uses with its data input. If the single
- // remaining incoming edge is from the phi itself, the the phi is in an
+ // remaining incoming edge is from the phi itself, the phi is in an
// unreachable single block loop. Either the block is dead and will be
// removed, or it's reachable from an unreachable continue target. In the
// latter case that continue target block will be collapsed into a block that
@@ -158,7 +158,7 @@ class DeadBranchElimPass : public MemPass {
uint32_t cont_id, uint32_t header_id, uint32_t merge_id,
std::unordered_set<BasicBlock*>* blocks_with_back_edges);
- // Returns true if there is a brach to the merge node of the selection
+ // Returns true if there is a branch to the merge node of the selection
// construct |switch_header_id| that is inside a nested selection construct or
// in the header of the nested selection construct.
bool SwitchHasNestedBreak(uint32_t switch_header_id);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_insert_elim_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_insert_elim_pass.cpp
index fb5c1634649..d877f0f96ac 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_insert_elim_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dead_insert_elim_pass.cpp
@@ -256,7 +256,7 @@ Pass::Status DeadInsertElimPass::Process() {
ProcessFunction pfn = [this](Function* fp) {
return EliminateDeadInserts(fp);
};
- bool modified = context()->ProcessEntryPointCallTree(pfn);
+ bool modified = context()->ProcessReachableCallTree(pfn);
return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.cpp
index 6593c3fbded..3585186f4a9 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.cpp
@@ -1,4 +1,5 @@
-// Copyright (c) 2020 Google LLC
+// Copyright (c) 2020-2022 Google LLC
+// 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.
@@ -24,6 +25,7 @@
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;
@@ -146,6 +148,25 @@ void DebugInfoManager::RegisterDbgDeclare(uint32_t var_id,
}
}
+// Create new constant directly into global value area, bypassing the
+// Constant manager. This is used when the DefUse or Constant managers
+// are invalid and cannot be regenerated due to the module being in an
+// inconsistent state e.g. in the middle of significant modification
+// such as inlining. Invalidate Constant and DefUse managers if used.
+uint32_t AddNewConstInGlobals(IRContext* context, uint32_t const_value) {
+ uint32_t id = context->TakeNextId();
+ std::unique_ptr<Instruction> new_const(new Instruction(
+ context, SpvOpConstant, context->get_type_mgr()->GetUIntTypeId(), id,
+ {
+ {spv_operand_type_t::SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER,
+ {const_value}},
+ }));
+ context->module()->AddGlobalValue(std::move(new_const));
+ context->InvalidateAnalyses(IRContext::kAnalysisConstants);
+ context->InvalidateAnalyses(IRContext::kAnalysisDefUse);
+ return id;
+}
+
uint32_t DebugInfoManager::CreateDebugInlinedAt(const Instruction* line,
const DebugScope& scope) {
uint32_t setId = GetDbgSetImportId();
@@ -191,13 +212,30 @@ uint32_t DebugInfoManager::CreateDebugInlinedAt(const Instruction* line,
break;
}
} else {
- line_number = line->GetSingleWordOperand(kOpLineOperandLineIndex);
+ if (line->opcode() == SpvOpLine) {
+ line_number = line->GetSingleWordOperand(kOpLineOperandLineIndex);
+ } else if (line->GetShader100DebugOpcode() ==
+ NonSemanticShaderDebugInfo100DebugLine) {
+ line_number = line->GetSingleWordOperand(kLineOperandIndexDebugLine);
+ } else {
+ assert(false &&
+ "Unreachable. A line instruction must be OpLine or DebugLine");
+ }
// If we need the line number as an ID, generate that constant now.
- if (line_number_type == spv_operand_type_t::SPV_OPERAND_TYPE_ID) {
- uint32_t line_id =
- context()->get_constant_mgr()->GetUIntConst(line_number);
- line_number = line_id;
+ // If Constant or DefUse managers are invalid, generate constant
+ // directly into the global value section of the module; do not
+ // use Constant manager which may attempt to invoke building of the
+ // DefUse manager which cannot be done during inlining. The extra
+ // 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) {
+ 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);
}
}
@@ -519,10 +557,10 @@ bool DebugInfoManager::IsDeclareVisibleToInstr(Instruction* dbg_declare,
return false;
}
-bool DebugInfoManager::AddDebugValueIfVarDeclIsVisible(
- Instruction* scope_and_line, uint32_t variable_id, uint32_t value_id,
- Instruction* insert_pos,
- std::unordered_set<Instruction*>* invisible_decls) {
+bool DebugInfoManager::AddDebugValueForVariable(Instruction* scope_and_line,
+ uint32_t variable_id,
+ uint32_t value_id,
+ Instruction* insert_pos) {
assert(scope_and_line != nullptr);
auto dbg_decl_itr = var_id_to_dbg_decl_.find(variable_id);
@@ -530,11 +568,6 @@ bool DebugInfoManager::AddDebugValueIfVarDeclIsVisible(
bool modified = false;
for (auto* dbg_decl_or_val : dbg_decl_itr->second) {
- if (!IsDeclareVisibleToInstr(dbg_decl_or_val, scope_and_line)) {
- if (invisible_decls) invisible_decls->insert(dbg_decl_or_val);
- continue;
- }
-
// Avoid inserting the new DebugValue between OpPhi or OpVariable
// instructions.
Instruction* insert_before = insert_pos->NextNode();
@@ -822,7 +855,7 @@ void DebugInfoManager::ClearDebugInfo(Instruction* instr) {
fn_id_to_dbg_fn_.erase(fn_id);
}
if (instr->GetShader100DebugOpcode() ==
- NonSemanticShaderDebugInfo100DebugFunction) {
+ NonSemanticShaderDebugInfo100DebugFunctionDefinition) {
auto fn_id = instr->GetSingleWordOperand(
kDebugFunctionDefinitionOperandOpFunctionIndex);
fn_id_to_dbg_fn_.erase(fn_id);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.h
index df34b30f400..abb7b9a08b7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/debug_info_manager.h
@@ -15,6 +15,7 @@
#ifndef SOURCE_OPT_DEBUG_INFO_MANAGER_H_
#define SOURCE_OPT_DEBUG_INFO_MANAGER_H_
+#include <set>
#include <unordered_map>
#include <unordered_set>
@@ -144,12 +145,10 @@ class DebugInfoManager {
// Generates a DebugValue instruction with value |value_id| for every local
// variable that is in the scope of |scope_and_line| and whose memory is
// |variable_id| and inserts it after the instruction |insert_pos|.
- // Returns whether a DebugValue is added or not. |invisible_decls| returns
- // DebugDeclares invisible to |scope_and_line|.
- bool AddDebugValueIfVarDeclIsVisible(
- Instruction* scope_and_line, uint32_t variable_id, uint32_t value_id,
- Instruction* insert_pos,
- std::unordered_set<Instruction*>* invisible_decls);
+ // Returns whether a DebugValue is added or not.
+ bool AddDebugValueForVariable(Instruction* scope_and_line,
+ uint32_t variable_id, uint32_t value_id,
+ Instruction* insert_pos);
// Creates a DebugValue for DebugDeclare |dbg_decl| and inserts it before
// |insert_before|. The new DebugValue has the same line and scope as
@@ -244,9 +243,18 @@ class DebugInfoManager {
// operand is the function.
std::unordered_map<uint32_t, Instruction*> fn_id_to_dbg_fn_;
+ // Orders Instruction* for use in associative containers (i.e. less than
+ // ordering). Unique Id is used.
+ typedef Instruction* InstPtr;
+ struct InstPtrLess {
+ bool operator()(const InstPtr& lhs, const InstPtr& rhs) const {
+ return lhs->unique_id() < rhs->unique_id();
+ }
+ };
+
// Mapping from variable or value ids to DebugDeclare or DebugValue
// instructions whose operand is the variable or value.
- std::unordered_map<uint32_t, std::unordered_set<Instruction*>>
+ std::unordered_map<uint32_t, std::set<InstPtr, InstPtrLess>>
var_id_to_dbg_decl_;
// Mapping from DebugScope ids to users.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.cpp
index 4bf026efd8e..2146c359d69 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.cpp
@@ -490,6 +490,14 @@ void DecorationManager::ForEachDecoration(
});
}
+bool DecorationManager::HasDecoration(uint32_t id, uint32_t decoration) {
+ bool has_decoration = false;
+ ForEachDecoration(id, decoration, [&has_decoration](const Instruction&) {
+ has_decoration = true;
+ });
+ return has_decoration;
+}
+
bool DecorationManager::FindDecoration(
uint32_t id, uint32_t decoration,
std::function<bool(const Instruction&)> f) {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.h
index b753e6be1d6..fe78f2ce688 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/decoration_manager.h
@@ -90,6 +90,10 @@ class DecorationManager {
bool AreDecorationsTheSame(const Instruction* inst1, const Instruction* inst2,
bool ignore_target) const;
+ // Returns whether a decoration instruction for |id| with decoration
+ // |decoration| exists or not.
+ bool HasDecoration(uint32_t id, uint32_t decoration);
+
// |f| is run on each decoration instruction for |id| with decoration
// |decoration|. Processed are all decorations which target |id| either
// directly or indirectly by Decoration Groups.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.cpp
index 394b9fa174c..d54fdb65dd1 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.cpp
@@ -14,11 +14,6 @@
#include "source/opt/def_use_manager.h"
-#include <iostream>
-
-#include "source/opt/log.h"
-#include "source/opt/reflect.h"
-
namespace spvtools {
namespace opt {
namespace analysis {
@@ -58,8 +53,8 @@ void DefUseManager::AnalyzeInstUse(Instruction* inst) {
case SPV_OPERAND_TYPE_SCOPE_ID: {
uint32_t use_id = inst->GetSingleWordOperand(i);
Instruction* def = GetDef(use_id);
- if (!def) assert(false && "Definition is not registered.");
- id_to_users_.insert(UserEntry(def, inst));
+ assert(def && "Definition is not registered.");
+ id_to_users_.insert(UserEntry{def, inst});
used_ids->push_back(use_id);
} break;
default:
@@ -102,13 +97,13 @@ const Instruction* DefUseManager::GetDef(uint32_t id) const {
DefUseManager::IdToUsersMap::const_iterator DefUseManager::UsersBegin(
const Instruction* def) const {
return id_to_users_.lower_bound(
- UserEntry(const_cast<Instruction*>(def), nullptr));
+ UserEntry{const_cast<Instruction*>(def), nullptr});
}
bool DefUseManager::UsersNotEnd(const IdToUsersMap::const_iterator& iter,
const IdToUsersMap::const_iterator& cached_end,
const Instruction* inst) const {
- return (iter != cached_end && iter->first == inst);
+ return (iter != cached_end && iter->def == inst);
}
bool DefUseManager::UsersNotEnd(const IdToUsersMap::const_iterator& iter,
@@ -125,7 +120,7 @@ bool DefUseManager::WhileEachUser(
auto end = id_to_users_.end();
for (auto iter = UsersBegin(def); UsersNotEnd(iter, end, def); ++iter) {
- if (!f(iter->second)) return false;
+ if (!f(iter->user)) return false;
}
return true;
}
@@ -158,7 +153,7 @@ bool DefUseManager::WhileEachUse(
auto end = id_to_users_.end();
for (auto iter = UsersBegin(def); UsersNotEnd(iter, end, def); ++iter) {
- Instruction* user = iter->second;
+ Instruction* user = iter->user;
for (uint32_t idx = 0; idx != user->NumOperands(); ++idx) {
const Operand& op = user->GetOperand(idx);
if (op.type != SPV_OPERAND_TYPE_RESULT_ID && spvIsIdType(op.type)) {
@@ -258,55 +253,59 @@ void DefUseManager::EraseUseRecordsOfOperandIds(const Instruction* inst) {
if (iter != inst_to_used_ids_.end()) {
for (auto use_id : iter->second) {
id_to_users_.erase(
- UserEntry(GetDef(use_id), const_cast<Instruction*>(inst)));
+ UserEntry{GetDef(use_id), const_cast<Instruction*>(inst)});
}
- inst_to_used_ids_.erase(inst);
+ inst_to_used_ids_.erase(iter);
}
}
-bool operator==(const DefUseManager& lhs, const DefUseManager& rhs) {
+bool CompareAndPrintDifferences(const DefUseManager& lhs,
+ const DefUseManager& rhs) {
+ bool same = true;
+
if (lhs.id_to_def_ != rhs.id_to_def_) {
for (auto p : lhs.id_to_def_) {
if (rhs.id_to_def_.find(p.first) == rhs.id_to_def_.end()) {
- return false;
+ printf("Diff in id_to_def: missing value in rhs\n");
}
}
for (auto p : rhs.id_to_def_) {
if (lhs.id_to_def_.find(p.first) == lhs.id_to_def_.end()) {
- return false;
+ printf("Diff in id_to_def: missing value in lhs\n");
}
}
- return false;
+ same = false;
}
if (lhs.id_to_users_ != rhs.id_to_users_) {
for (auto p : lhs.id_to_users_) {
if (rhs.id_to_users_.count(p) == 0) {
- return false;
+ printf("Diff in id_to_users: missing value in rhs\n");
}
}
for (auto p : rhs.id_to_users_) {
if (lhs.id_to_users_.count(p) == 0) {
- return false;
+ printf("Diff in id_to_users: missing value in lhs\n");
}
}
- return false;
+ same = false;
}
if (lhs.inst_to_used_ids_ != rhs.inst_to_used_ids_) {
for (auto p : lhs.inst_to_used_ids_) {
if (rhs.inst_to_used_ids_.count(p.first) == 0) {
- return false;
+ printf("Diff in inst_to_used_ids: missing value in rhs\n");
}
}
for (auto p : rhs.inst_to_used_ids_) {
if (lhs.inst_to_used_ids_.count(p.first) == 0) {
- return false;
+ printf("Diff in inst_to_used_ids: missing value in lhs\n");
}
}
- return false;
+ same = false;
}
- return true;
+
+ return same;
}
} // namespace analysis
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.h
index 0499e82b545..a8dbbc60b69 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/def_use_manager.h
@@ -15,10 +15,8 @@
#ifndef SOURCE_OPT_DEF_USE_MANAGER_H_
#define SOURCE_OPT_DEF_USE_MANAGER_H_
-#include <list>
#include <set>
#include <unordered_map>
-#include <utility>
#include <vector>
#include "source/opt/instruction.h"
@@ -51,15 +49,17 @@ inline bool operator<(const Use& lhs, const Use& rhs) {
return lhs.operand_index < rhs.operand_index;
}
-// Definition and user pair.
-//
-// The first element of the pair is the definition.
-// The second element of the pair is the user.
-//
// Definition should never be null. User can be null, however, such an entry
// should be used only for searching (e.g. all users of a particular definition)
// and never stored in a container.
-using UserEntry = std::pair<Instruction*, Instruction*>;
+struct UserEntry {
+ Instruction* def;
+ Instruction* user;
+};
+
+inline bool operator==(const UserEntry& lhs, const UserEntry& rhs) {
+ return lhs.def == rhs.def && lhs.user == rhs.user;
+}
// Orders UserEntry for use in associative containers (i.e. less than ordering).
//
@@ -72,24 +72,24 @@ using UserEntry = std::pair<Instruction*, Instruction*>;
// definition (i.e. using {def, nullptr}).
struct UserEntryLess {
bool operator()(const UserEntry& lhs, const UserEntry& rhs) const {
- // If lhs.first and rhs.first are both null, fall through to checking the
+ // If lhs.def and rhs.def are both null, fall through to checking the
// second entries.
- if (!lhs.first && rhs.first) return true;
- if (lhs.first && !rhs.first) return false;
+ if (!lhs.def && rhs.def) return true;
+ if (lhs.def && !rhs.def) return false;
// If neither definition is null, then compare unique ids.
- if (lhs.first && rhs.first) {
- if (lhs.first->unique_id() < rhs.first->unique_id()) return true;
- if (rhs.first->unique_id() < lhs.first->unique_id()) return false;
+ if (lhs.def && rhs.def) {
+ if (lhs.def->unique_id() < rhs.def->unique_id()) return true;
+ if (rhs.def->unique_id() < lhs.def->unique_id()) return false;
}
// Return false on equality.
- if (!lhs.second && !rhs.second) return false;
- if (!lhs.second) return true;
- if (!rhs.second) return false;
+ if (!lhs.user && !rhs.user) return false;
+ if (!lhs.user) return true;
+ if (!rhs.user) return false;
// If neither user is null then compare unique ids.
- return lhs.second->unique_id() < rhs.second->unique_id();
+ return lhs.user->unique_id() < rhs.user->unique_id();
}
};
@@ -97,7 +97,6 @@ struct UserEntryLess {
class DefUseManager {
public:
using IdToDefMap = std::unordered_map<uint32_t, Instruction*>;
- using IdToUsersMap = std::set<UserEntry, UserEntryLess>;
// Constructs a def-use manager from the given |module|. All internal messages
// will be communicated to the outside via the given message |consumer|. This
@@ -191,14 +190,12 @@ class DefUseManager {
// Returns the annotation instrunctions which are a direct use of the given
// |id|. This means when the decorations are applied through decoration
// group(s), this function will just return the OpGroupDecorate
- // instrcution(s) which refer to the given id as an operand. The OpDecorate
+ // instruction(s) which refer to the given id as an operand. The OpDecorate
// instructions which decorate the decoration group will not be returned.
std::vector<Instruction*> GetAnnotations(uint32_t id) const;
// Returns the map from ids to their def instructions.
const IdToDefMap& id_to_defs() const { return id_to_def_; }
- // Returns the map from instructions to their users.
- const IdToUsersMap& id_to_users() const { return id_to_users_; }
// Clear the internal def-use record of the given instruction |inst|. This
// method will update the use information of the operand ids of |inst|. The
@@ -210,16 +207,15 @@ class DefUseManager {
// Erases the records that a given instruction uses its operand ids.
void EraseUseRecordsOfOperandIds(const Instruction* inst);
- friend bool operator==(const DefUseManager&, const DefUseManager&);
- friend bool operator!=(const DefUseManager& lhs, const DefUseManager& rhs) {
- return !(lhs == rhs);
- }
+ friend bool CompareAndPrintDifferences(const DefUseManager&,
+ const DefUseManager&);
- // If |inst| has not already been analysed, then analyses its defintion and
+ // If |inst| has not already been analysed, then analyses its definition and
// uses.
void UpdateDefUse(Instruction* inst);
private:
+ using IdToUsersMap = std::set<UserEntry, UserEntryLess>;
using InstToUsedIdsMap =
std::unordered_map<const Instruction*, std::vector<uint32_t>>;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.cpp
index 5e950069dad..b130ca806cb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.cpp
@@ -14,10 +14,19 @@
#include "source/opt/desc_sroa.h"
+#include "source/opt/desc_sroa_util.h"
#include "source/util/string_utils.h"
namespace spvtools {
namespace opt {
+namespace {
+
+bool IsDecorationBinding(Instruction* inst) {
+ if (inst->opcode() != SpvOpDecorate) return false;
+ return inst->GetSingleWordInOperand(1u) == SpvDecorationBinding;
+}
+
+} // namespace
Pass::Status DescriptorScalarReplacement::Process() {
bool modified = false;
@@ -25,7 +34,7 @@ Pass::Status DescriptorScalarReplacement::Process() {
std::vector<Instruction*> vars_to_kill;
for (Instruction& var : context()->types_values()) {
- if (IsCandidate(&var)) {
+ if (descsroautil::IsDescriptorArray(context(), &var)) {
modified = true;
if (!ReplaceCandidate(&var)) {
return Status::Failure;
@@ -41,72 +50,6 @@ Pass::Status DescriptorScalarReplacement::Process() {
return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange);
}
-bool DescriptorScalarReplacement::IsCandidate(Instruction* var) {
- if (var->opcode() != SpvOpVariable) {
- 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) {
- 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) {
- return false;
- }
-
- // All structures with descriptor assignments must be replaced by variables,
- // one for each of their members - with the exceptions of buffers.
- if (IsTypeOfStructuredBuffer(var_type_inst)) {
- return false;
- }
-
- bool has_desc_set_decoration = false;
- context()->get_decoration_mgr()->ForEachDecoration(
- var->result_id(), SpvDecorationDescriptorSet,
- [&has_desc_set_decoration](const Instruction&) {
- has_desc_set_decoration = true;
- });
- if (!has_desc_set_decoration) {
- return false;
- }
-
- bool has_binding_decoration = false;
- context()->get_decoration_mgr()->ForEachDecoration(
- var->result_id(), SpvDecorationBinding,
- [&has_binding_decoration](const Instruction&) {
- has_binding_decoration = true;
- });
- if (!has_binding_decoration) {
- return false;
- }
-
- return true;
-}
-
-bool DescriptorScalarReplacement::IsTypeOfStructuredBuffer(
- const Instruction* type) const {
- if (type->opcode() != SpvOpTypeStruct) {
- return false;
- }
-
- // All buffers have offset decorations for members of their structure types.
- // This is how we distinguish it from a structure of descriptors.
- bool has_offset_decoration = false;
- context()->get_decoration_mgr()->ForEachDecoration(
- type->result_id(), SpvDecorationOffset,
- [&has_offset_decoration](const Instruction&) {
- has_offset_decoration = true;
- });
- return has_offset_decoration;
-}
-
bool DescriptorScalarReplacement::ReplaceCandidate(Instruction* var) {
std::vector<Instruction*> access_chain_work_list;
std::vector<Instruction*> load_work_list;
@@ -162,21 +105,20 @@ bool DescriptorScalarReplacement::ReplaceAccessChain(Instruction* var,
return false;
}
- uint32_t idx_id = use->GetSingleWordInOperand(1);
- const analysis::Constant* idx_const =
- context()->get_constant_mgr()->FindDeclaredConstant(idx_id);
- if (idx_const == nullptr) {
+ const analysis::Constant* const_index =
+ descsroautil::GetAccessChainIndexAsConst(context(), use);
+ if (const_index == nullptr) {
context()->EmitErrorMessage("Variable cannot be replaced: invalid index",
use);
return false;
}
- uint32_t idx = idx_const->GetU32();
+ uint32_t idx = const_index->GetU32();
uint32_t replacement_var = GetReplacementVariable(var, idx);
if (use->NumInOperands() == 2) {
// We are not indexing into the replacement variable. We can replaces the
- // access chain with the replacement varibale itself.
+ // access chain with the replacement variable itself.
context()->ReplaceAllUsesWith(use->result_id(), replacement_var);
context()->KillInst(use);
return true;
@@ -193,8 +135,8 @@ bool DescriptorScalarReplacement::ReplaceAccessChain(Instruction* var,
// Use the replacement variable as the base address.
new_operands.push_back({SPV_OPERAND_TYPE_ID, {replacement_var}});
- // Drop the first index because it is consumed by the replacment, and copy the
- // rest.
+ // Drop the first index because it is consumed by the replacement, and copy
+ // the rest.
for (uint32_t i = 4; i < use->NumOperands(); i++) {
new_operands.emplace_back(use->GetOperand(i));
}
@@ -208,39 +150,12 @@ uint32_t DescriptorScalarReplacement::GetReplacementVariable(Instruction* var,
uint32_t idx) {
auto replacement_vars = replacement_variables_.find(var);
if (replacement_vars == replacement_variables_.end()) {
- 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 &&
- "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;
- assert((is_array || is_struct) &&
- "Variable should be a pointer to an array or structure.");
-
- // For arrays, each array element should be replaced with a new replacement
- // variable
- if (is_array) {
- uint32_t array_len_id = pointee_type_inst->GetSingleWordInOperand(1);
- const analysis::Constant* array_len_const =
- context()->get_constant_mgr()->FindDeclaredConstant(array_len_id);
- assert(array_len_const != nullptr && "Array length must be a constant.");
- uint32_t array_len = array_len_const->GetU32();
-
- replacement_vars = replacement_variables_
- .insert({var, std::vector<uint32_t>(array_len, 0)})
- .first;
- }
- // For structures, each member should be replaced with a new replacement
- // variable
- if (is_struct) {
- const uint32_t num_members = pointee_type_inst->NumInOperands();
- replacement_vars =
- replacement_variables_
- .insert({var, std::vector<uint32_t>(num_members, 0)})
- .first;
- }
+ uint32_t number_of_elements =
+ descsroautil::GetNumberOfElementsForArrayOrStruct(context(), var);
+ replacement_vars =
+ replacement_variables_
+ .insert({var, std::vector<uint32_t>(number_of_elements, 0)})
+ .first;
}
if (replacement_vars->second[idx] == 0) {
@@ -250,6 +165,75 @@ uint32_t DescriptorScalarReplacement::GetReplacementVariable(Instruction* var,
return replacement_vars->second[idx];
}
+void DescriptorScalarReplacement::CopyDecorationsForNewVariable(
+ Instruction* old_var, uint32_t index, uint32_t new_var_id,
+ uint32_t new_var_ptr_type_id, const bool is_old_var_array,
+ const bool is_old_var_struct, Instruction* old_var_type) {
+ // Handle OpDecorate and OpDecorateString instructions.
+ for (auto old_decoration :
+ get_decoration_mgr()->GetDecorationsFor(old_var->result_id(), true)) {
+ uint32_t new_binding = 0;
+ if (IsDecorationBinding(old_decoration)) {
+ new_binding = GetNewBindingForElement(
+ old_decoration->GetSingleWordInOperand(2), index, new_var_ptr_type_id,
+ is_old_var_array, is_old_var_struct, old_var_type);
+ }
+ CreateNewDecorationForNewVariable(old_decoration, new_var_id, new_binding);
+ }
+
+ // Handle OpMemberDecorate instructions.
+ for (auto old_decoration : get_decoration_mgr()->GetDecorationsFor(
+ old_var_type->result_id(), true)) {
+ assert(old_decoration->opcode() == SpvOpMemberDecorate);
+ if (old_decoration->GetSingleWordInOperand(1u) != index) continue;
+ CreateNewDecorationForMemberDecorate(old_decoration, new_var_id);
+ }
+}
+
+uint32_t DescriptorScalarReplacement::GetNewBindingForElement(
+ uint32_t old_binding, uint32_t index, uint32_t new_var_ptr_type_id,
+ const bool is_old_var_array, const bool is_old_var_struct,
+ Instruction* old_var_type) {
+ if (is_old_var_array) {
+ return old_binding + index * GetNumBindingsUsedByType(new_var_ptr_type_id);
+ }
+ if (is_old_var_struct) {
+ // The binding offset that should be added is the sum of binding
+ // numbers used by previous members of the current struct.
+ uint32_t new_binding = old_binding;
+ for (uint32_t i = 0; i < index; ++i) {
+ new_binding +=
+ GetNumBindingsUsedByType(old_var_type->GetSingleWordInOperand(i));
+ }
+ return new_binding;
+ }
+ return old_binding;
+}
+
+void DescriptorScalarReplacement::CreateNewDecorationForNewVariable(
+ Instruction* old_decoration, uint32_t new_var_id, uint32_t new_binding) {
+ assert(old_decoration->opcode() == SpvOpDecorate ||
+ old_decoration->opcode() == SpvOpDecorateString);
+ std::unique_ptr<Instruction> new_decoration(old_decoration->Clone(context()));
+ new_decoration->SetInOperand(0, {new_var_id});
+
+ if (IsDecorationBinding(new_decoration.get())) {
+ new_decoration->SetInOperand(2, {new_binding});
+ }
+ context()->AddAnnotationInst(std::move(new_decoration));
+}
+
+void DescriptorScalarReplacement::CreateNewDecorationForMemberDecorate(
+ Instruction* old_member_decoration, uint32_t new_var_id) {
+ std::vector<Operand> operands(
+ {{spv_operand_type_t::SPV_OPERAND_TYPE_ID, {new_var_id}}});
+ auto new_decorate_operand_begin = old_member_decoration->begin() + 2u;
+ 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));
+}
+
uint32_t DescriptorScalarReplacement::CreateReplacementVariable(
Instruction* var, uint32_t idx) {
// The storage class for the new variable is the same as the original.
@@ -285,33 +269,8 @@ uint32_t DescriptorScalarReplacement::CreateReplacementVariable(
{static_cast<uint32_t>(storage_class)}}}));
context()->AddGlobalValue(std::move(variable));
- // Copy all of the decorations to the new variable. The only difference is
- // the Binding decoration needs to be adjusted.
- for (auto old_decoration :
- get_decoration_mgr()->GetDecorationsFor(var->result_id(), true)) {
- assert(old_decoration->opcode() == SpvOpDecorate);
- std::unique_ptr<Instruction> new_decoration(
- old_decoration->Clone(context()));
- new_decoration->SetInOperand(0, {id});
-
- uint32_t decoration = new_decoration->GetSingleWordInOperand(1u);
- if (decoration == SpvDecorationBinding) {
- uint32_t new_binding = new_decoration->GetSingleWordInOperand(2);
- if (is_array) {
- new_binding += idx * GetNumBindingsUsedByType(ptr_element_type_id);
- }
- if (is_struct) {
- // The binding offset that should be added is the sum of binding numbers
- // used by previous members of the current struct.
- for (uint32_t i = 0; i < idx; ++i) {
- new_binding += GetNumBindingsUsedByType(
- pointee_type_inst->GetSingleWordInOperand(i));
- }
- }
- new_decoration->SetInOperand(2, {new_binding});
- }
- context()->AddAnnotationInst(std::move(new_decoration));
- }
+ CopyDecorationsForNewVariable(var, idx, id, ptr_element_type_id, is_array,
+ is_struct, pointee_type_inst);
// Create a new OpName for the replacement variable.
std::vector<std::unique_ptr<Instruction>> names_to_add;
@@ -377,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 &&
- !IsTypeOfStructuredBuffer(type_inst)) {
+ !descsroautil::IsTypeOfStructuredBuffer(context(), type_inst)) {
uint32_t sum = 0;
for (uint32_t i = 0; i < type_inst->NumInOperands(); i++)
sum += GetNumBindingsUsedByType(type_inst->GetSingleWordInOperand(i));
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.h
index cd72fd30197..6a24fd8714e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa.h
@@ -46,10 +46,6 @@ class DescriptorScalarReplacement : public Pass {
}
private:
- // Returns true if |var| is an OpVariable instruction that represents a
- // descriptor array. These are the variables that we want to replace.
- bool IsCandidate(Instruction* var);
-
// Replaces all references to |var| by new variables, one for each element of
// the array |var|. The binding for the new variables corresponding to
// element i will be the binding of |var| plus i. Returns true if successful.
@@ -93,14 +89,50 @@ class DescriptorScalarReplacement : public Pass {
// bindings used by its members.
uint32_t GetNumBindingsUsedByType(uint32_t type_id);
- // Returns true if |type| is a type that could be used for a structured buffer
- // as opposed to a type that would be used for a structure of resource
- // descriptors.
- bool IsTypeOfStructuredBuffer(const Instruction* type) const;
+ // Copy all of the decorations of variable |old_var| and make them as
+ // decorations for the new variable whose id is |new_var_id|. The new variable
+ // is supposed to replace |index|th element of |old_var|.
+ // |new_var_ptr_type_id| is the id of the pointer to the type of the new
+ // variable. |is_old_var_array| is true if |old_var| has an array type.
+ // |is_old_var_struct| is true if |old_var| has a structure type.
+ // |old_var_type| is the pointee type of |old_var|.
+ void CopyDecorationsForNewVariable(Instruction* old_var, uint32_t index,
+ uint32_t new_var_id,
+ uint32_t new_var_ptr_type_id,
+ const bool is_old_var_array,
+ const bool is_old_var_struct,
+ Instruction* old_var_type);
+
+ // Get the new binding number for a new variable that will be replaced with an
+ // |index|th element of an old variable. The old variable has |old_binding|
+ // as its binding number. |ptr_elem_type_id| the id of the pointer to the
+ // element type. |is_old_var_array| is true if the old variable has an array
+ // type. |is_old_var_struct| is true if the old variable has a structure type.
+ // |old_var_type| is the pointee type of the old variable.
+ uint32_t GetNewBindingForElement(uint32_t old_binding, uint32_t index,
+ uint32_t ptr_elem_type_id,
+ const bool is_old_var_array,
+ const bool is_old_var_struct,
+ Instruction* old_var_type);
+
+ // Create a new OpDecorate(String) instruction by cloning |old_decoration|.
+ // The new OpDecorate(String) instruction will be used for a variable whose id
+ // is |new_var_ptr_type_id|. If |old_decoration| is a decoration for a
+ // binding, the new OpDecorate(String) instruction will have |new_binding| as
+ // its binding.
+ void CreateNewDecorationForNewVariable(Instruction* old_decoration,
+ uint32_t new_var_id,
+ uint32_t new_binding);
+
+ // Create a new OpDecorate instruction whose operand is the same as an
+ // OpMemberDecorate instruction |old_member_decoration| except Target operand.
+ // The Target operand of the new OpDecorate instruction will be |new_var_id|.
+ void CreateNewDecorationForMemberDecorate(Instruction* old_decoration,
+ uint32_t new_var_id);
// A map from an OpVariable instruction to the set of variables that will be
// used to replace it. The entry |replacement_variables_[var][i]| is the id of
- // a variable that will be used in the place of the the ith element of the
+ // a variable that will be used in the place of the ith element of the
// array |var|. If the entry is |0|, then the variable has not been
// created yet.
std::map<Instruction*, std::vector<uint32_t>> replacement_variables_;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.cpp
new file mode 100644
index 00000000000..1954e2cc36b
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.cpp
@@ -0,0 +1,117 @@
+// Copyright (c) 2021 Google LLC
+//
+// 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/desc_sroa_util.h"
+
+namespace spvtools {
+namespace opt {
+namespace {
+
+const 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");
+ uint32_t length_id = type->GetSingleWordInOperand(1);
+ const analysis::Constant* length_const =
+ context->get_constant_mgr()->FindDeclaredConstant(length_id);
+ assert(length_const != nullptr);
+ return length_const->GetU32();
+}
+
+} // namespace
+
+namespace descsroautil {
+
+bool IsDescriptorArray(IRContext* context, Instruction* var) {
+ if (var->opcode() != SpvOpVariable) {
+ 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) {
+ 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) {
+ return false;
+ }
+
+ // All structures with descriptor assignments must be replaced by variables,
+ // one for each of their members - with the exceptions of buffers.
+ if (IsTypeOfStructuredBuffer(context, var_type_inst)) {
+ return false;
+ }
+
+ if (!context->get_decoration_mgr()->HasDecoration(
+ var->result_id(), SpvDecorationDescriptorSet)) {
+ return false;
+ }
+
+ return context->get_decoration_mgr()->HasDecoration(var->result_id(),
+ SpvDecorationBinding);
+}
+
+bool IsTypeOfStructuredBuffer(IRContext* context, const Instruction* type) {
+ if (type->opcode() != SpvOpTypeStruct) {
+ 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);
+}
+
+const analysis::Constant* GetAccessChainIndexAsConst(
+ IRContext* context, Instruction* access_chain) {
+ if (access_chain->NumInOperands() <= 1) {
+ return nullptr;
+ }
+ uint32_t idx_id = GetFirstIndexOfAccessChain(access_chain);
+ const analysis::Constant* idx_const =
+ context->get_constant_mgr()->FindDeclaredConstant(idx_id);
+ return idx_const;
+}
+
+uint32_t GetFirstIndexOfAccessChain(Instruction* access_chain) {
+ assert(access_chain->NumInOperands() > 1 &&
+ "OpAccessChain does not have Indexes operand");
+ return access_chain->GetSingleWordInOperand(kOpAccessChainInOperandIndexes);
+}
+
+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 &&
+ "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) {
+ return GetLengthOfArrayType(context, pointee_type_inst);
+ }
+ assert(pointee_type_inst->opcode() == SpvOpTypeStruct &&
+ "Variable should be a pointer to an array or structure.");
+ return pointee_type_inst->NumInOperands();
+}
+
+} // namespace descsroautil
+} // namespace opt
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.h
new file mode 100644
index 00000000000..2f45c0c2f4f
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/desc_sroa_util.h
@@ -0,0 +1,54 @@
+// Copyright (c) 2021 Google LLC
+//
+// 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_DESC_SROA_UTIL_H_
+#define SOURCE_OPT_DESC_SROA_UTIL_H_
+
+#include "source/opt/ir_context.h"
+
+namespace spvtools {
+namespace opt {
+
+// Provides functions for the descriptor array SROA.
+namespace descsroautil {
+
+// Returns true if |var| is an OpVariable instruction that represents a
+// descriptor array.
+bool IsDescriptorArray(IRContext* context, Instruction* var);
+
+// Returns true if |type| is a type that could be used for a structured buffer
+// as opposed to a type that would be used for a structure of resource
+// descriptors.
+bool IsTypeOfStructuredBuffer(IRContext* context, const Instruction* type);
+
+// Returns the first index of the OpAccessChain instruction |access_chain| as
+// a constant. Returns nullptr if it is not a constant.
+const analysis::Constant* GetAccessChainIndexAsConst(IRContext* context,
+ Instruction* access_chain);
+
+// Returns the number of elements of an OpVariable instruction |var| whose type
+// must be a pointer to an array or a struct.
+uint32_t GetNumberOfElementsForArrayOrStruct(IRContext* context,
+ Instruction* var);
+
+// Returns the first Indexes operand id of the OpAccessChain or
+// OpInBoundsAccessChain instruction |access_chain|. The access chain must have
+// at least 1 index.
+uint32_t GetFirstIndexOfAccessChain(Instruction* access_chain);
+
+} // namespace descsroautil
+} // namespace opt
+} // namespace spvtools
+
+#endif // SOURCE_OPT_DESC_SROA_UTIL_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dominator_tree.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dominator_tree.cpp
index 55287f44413..2680be2af49 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dominator_tree.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dominator_tree.cpp
@@ -48,7 +48,7 @@ namespace {
// BBType - BasicBlock type. Will either be BasicBlock or DominatorTreeNode
// SuccessorLambda - Lamdba matching the signature of 'const
// std::vector<BBType>*(const BBType *A)'. Will return a vector of the nodes
-// succeding BasicBlock A.
+// succeeding BasicBlock A.
// PostLambda - Lamdba matching the signature of 'void (const BBType*)' will be
// called on each node traversed AFTER their children.
// PreLambda - Lamdba matching the signature of 'void (const BBType*)' will be
@@ -57,9 +57,9 @@ template <typename BBType, typename SuccessorLambda, typename PreLambda,
typename PostLambda>
static void DepthFirstSearch(const BBType* bb, SuccessorLambda successors,
PreLambda pre, PostLambda post) {
- // Ignore backedge operation.
- auto nop_backedge = [](const BBType*, const BBType*) {};
- CFA<BBType>::DepthFirstTraversal(bb, successors, pre, post, nop_backedge);
+ auto no_terminal_blocks = [](const BBType*) { return false; };
+ CFA<BBType>::DepthFirstTraversal(bb, successors, pre, post,
+ no_terminal_blocks);
}
// Wrapper around CFA::DepthFirstTraversal to provide an interface to perform
@@ -69,7 +69,7 @@ static void DepthFirstSearch(const BBType* bb, SuccessorLambda successors,
// BBType - BasicBlock type. Will either be BasicBlock or DominatorTreeNode
// SuccessorLambda - Lamdba matching the signature of 'const
// std::vector<BBType>*(const BBType *A)'. Will return a vector of the nodes
-// succeding BasicBlock A.
+// succeeding BasicBlock A.
// PostLambda - Lamdba matching the signature of 'void (const BBType*)' will be
// called on each node traversed after their children.
template <typename BBType, typename SuccessorLambda, typename PostLambda>
@@ -103,7 +103,8 @@ class BasicBlockSuccessorHelper {
using Function = typename GetFunctionClass<BBType>::FunctionType;
using BasicBlockListTy = std::vector<BasicBlock*>;
- using BasicBlockMapTy = std::map<const BasicBlock*, BasicBlockListTy>;
+ using BasicBlockMapTy =
+ std::unordered_map<const BasicBlock*, BasicBlockListTy>;
public:
// For compliance with the dominance tree computation, entry nodes are
@@ -158,19 +159,7 @@ BasicBlockSuccessorHelper<BBType>::BasicBlockSuccessorHelper(
template <typename BBType>
void BasicBlockSuccessorHelper<BBType>::CreateSuccessorMap(
Function& f, const BasicBlock* placeholder_start_node) {
- std::map<uint32_t, BasicBlock*> id_to_BB_map;
- auto GetSuccessorBasicBlock = [&f, &id_to_BB_map](uint32_t successor_id) {
- BasicBlock*& Succ = id_to_BB_map[successor_id];
- if (!Succ) {
- for (BasicBlock& BBIt : f) {
- if (successor_id == BBIt.id()) {
- Succ = &BBIt;
- break;
- }
- }
- }
- return Succ;
- };
+ IRContext* context = f.DefInst().context();
if (invert_graph_) {
// For the post dominator tree, we see the inverted graph.
@@ -184,9 +173,8 @@ void BasicBlockSuccessorHelper<BBType>::CreateSuccessorMap(
BasicBlockListTy& pred_list = predecessors_[&bb];
const auto& const_bb = bb;
const_bb.ForEachSuccessorLabel(
- [this, &pred_list, &bb,
- &GetSuccessorBasicBlock](const uint32_t successor_id) {
- BasicBlock* succ = GetSuccessorBasicBlock(successor_id);
+ [this, &pred_list, &bb, context](const uint32_t successor_id) {
+ BasicBlock* succ = context->get_instr_block(successor_id);
// Inverted graph: our successors in the CFG
// are our predecessors in the inverted graph.
this->successors_[succ].push_back(&bb);
@@ -207,7 +195,7 @@ void BasicBlockSuccessorHelper<BBType>::CreateSuccessorMap(
const auto& const_bb = bb;
const_bb.ForEachSuccessorLabel([&](const uint32_t successor_id) {
- BasicBlock* succ = GetSuccessorBasicBlock(successor_id);
+ BasicBlock* succ = context->get_instr_block(successor_id);
succ_list.push_back(succ);
predecessors_[succ].push_back(&bb);
});
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dominator_tree.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dominator_tree.h
index 0024bc508a8..1674b228fd7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dominator_tree.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/dominator_tree.h
@@ -278,7 +278,7 @@ class DominatorTree {
private:
// Wrapper function which gets the list of pairs of each BasicBlocks to its
- // immediately dominating BasicBlock and stores the result in the the edges
+ // immediately dominating BasicBlock and stores the result in the edges
// parameter.
//
// The |edges| vector will contain the dominator tree as pairs of nodes.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.cpp
new file mode 100644
index 00000000000..aa2776bbd38
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.cpp
@@ -0,0 +1,189 @@
+// 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 <set>
+#include <vector>
+
+#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<std::pair<Instruction*, unsigned>> 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<unsigned>(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<const analysis::Type*> 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/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.h
new file mode 100644
index 00000000000..a3a133c2bb7
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_input_components_pass.h
@@ -0,0 +1,65 @@
+// 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_INPUT_COMPONENTS_H_
+#define SOURCE_OPT_ELIMINATE_DEAD_INPUT_COMPONENTS_H_
+
+#include <unordered_map>
+
+#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 EliminateDeadInputComponentsPass : public Pass {
+ public:
+ explicit EliminateDeadInputComponentsPass() {}
+
+ const char* name() const override {
+ return "eliminate-dead-input-components";
+ }
+
+ 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:
+ // 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);
+
+ // 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);
+};
+
+} // namespace opt
+} // namespace spvtools
+
+#endif // SOURCE_OPT_ELIMINATE_DEAD_INPUT_COMPONENTS_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_members_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_members_pass.cpp
index 173df6209a6..52aca5254d7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_members_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/eliminate_dead_members_pass.cpp
@@ -20,6 +20,7 @@
namespace {
const uint32_t kRemovedMember = 0xFFFFFFFF;
const uint32_t kSpecConstOpOpcodeIdx = 0;
+constexpr uint32_t kArrayElementTypeIdx = 0;
} // namespace
namespace spvtools {
@@ -37,7 +38,7 @@ Pass::Status EliminateDeadMembersPass::Process() {
}
void EliminateDeadMembersPass::FindLiveMembers() {
- // Until we have implemented the rewritting of OpSpecConsantOp instructions,
+ // 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) {
@@ -64,6 +65,10 @@ void EliminateDeadMembersPass::FindLiveMembers() {
MarkPointeeTypeAsFullUsed(inst.type_id());
break;
default:
+ // Ignore structured buffers as layout(offset) qualifiers cannot be
+ // applied to structure fields
+ if (inst.IsVulkanStorageBufferVariable())
+ MarkPointeeTypeAsFullUsed(inst.type_id());
break;
}
}
@@ -136,18 +141,22 @@ void EliminateDeadMembersPass::MarkMembersAsLiveForStore(
void EliminateDeadMembersPass::MarkTypeAsFullyUsed(uint32_t type_id) {
Instruction* type_inst = get_def_use_mgr()->GetDef(type_id);
assert(type_inst != nullptr);
- if (type_inst->opcode() != SpvOpTypeStruct) {
- return;
- }
-
- // Mark every member of the current struct as used.
- for (uint32_t i = 0; i < type_inst->NumInOperands(); ++i) {
- used_members_[type_id].insert(i);
- }
- // Mark any sub struct as fully used.
- for (uint32_t i = 0; i < type_inst->NumInOperands(); ++i) {
- MarkTypeAsFullyUsed(type_inst->GetSingleWordInOperand(i));
+ switch (type_inst->opcode()) {
+ case SpvOpTypeStruct:
+ // 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:
+ MarkTypeAsFullyUsed(
+ type_inst->GetSingleWordInOperand(kArrayElementTypeIdx));
+ break;
+ default:
+ break;
}
}
@@ -561,7 +570,7 @@ bool EliminateDeadMembersPass::UpdateCompsiteExtract(Instruction* inst) {
Instruction* type_inst = get_def_use_mgr()->GetDef(type_id);
switch (type_inst->opcode()) {
case SpvOpTypeStruct:
- // The type will have already been rewriten, so use the new member
+ // The type will have already been rewritten, so use the new member
// index.
type_id = type_inst->GetSingleWordInOperand(new_member_idx);
break;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/feature_manager.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/feature_manager.cpp
index 39a4a3486ea..a5902716794 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/feature_manager.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/feature_manager.cpp
@@ -39,8 +39,7 @@ void FeatureManager::AddExtension(Instruction* ext) {
assert(ext->opcode() == SpvOpExtension &&
"Expecting an extension instruction.");
- const std::string name =
- reinterpret_cast<const char*>(ext->GetInOperand(0u).words.data());
+ const std::string name = ext->GetInOperand(0u).AsString();
Extension extension;
if (GetExtensionFromString(name.c_str(), &extension)) {
extensions_.Add(extension);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.cpp
new file mode 100644
index 00000000000..d140fb4b0e0
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.cpp
@@ -0,0 +1,90 @@
+// Copyright (c) 2022 Advanced Micro Devices, 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 "fix_func_call_arguments.h"
+
+#include "ir_builder.h"
+
+using namespace spvtools;
+using namespace opt;
+
+bool FixFuncCallArgumentsPass::ModuleHasASingleFunction() {
+ auto funcsNum = get_module()->end() - get_module()->begin();
+ return funcsNum == 1;
+}
+
+Pass::Status FixFuncCallArgumentsPass::Process() {
+ bool modified = false;
+ if (ModuleHasASingleFunction()) return Status::SuccessWithoutChange;
+ for (auto& func : *get_module()) {
+ func.ForEachInst([this, &modified](Instruction* inst) {
+ if (inst->opcode() == SpvOpFunctionCall) {
+ modified |= FixFuncCallArguments(inst);
+ }
+ });
+ }
+ return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange;
+}
+
+bool FixFuncCallArgumentsPass::FixFuncCallArguments(
+ Instruction* func_call_inst) {
+ bool modified = false;
+ for (uint32_t i = 0; i < func_call_inst->NumInOperands(); ++i) {
+ 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) {
+ uint32_t var_id =
+ ReplaceAccessChainFuncCallArguments(func_call_inst, operand_inst);
+ func_call_inst->SetInOperand(i, {var_id});
+ modified = true;
+ }
+ }
+ if (modified) {
+ context()->UpdateDefUse(func_call_inst);
+ }
+ return modified;
+}
+
+uint32_t FixFuncCallArgumentsPass::ReplaceAccessChainFuncCallArguments(
+ Instruction* func_call_inst, Instruction* operand_inst) {
+ InstructionBuilder builder(
+ context(), func_call_inst,
+ IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
+
+ Instruction* next_insert_point = func_call_inst->NextNode();
+ // Get Variable insertion point
+ Function* func = context()->get_instr_block(func_call_inst)->GetParent();
+ Instruction* variable_insertion_point = &*(func->begin()->begin());
+ Instruction* op_ptr_type = get_def_use_mgr()->GetDef(operand_inst->type_id());
+ 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);
+ // Create new variable
+ builder.SetInsertPoint(variable_insertion_point);
+ Instruction* var = builder.AddVariable(varType, SpvStorageClassFunction);
+ // Load access chain to the new variable before function call
+ builder.SetInsertPoint(func_call_inst);
+
+ uint32_t operand_id = operand_inst->result_id();
+ Instruction* load = builder.AddLoad(op_type->result_id(), operand_id);
+ builder.AddStore(var->result_id(), load->result_id());
+ // Load return value to the acesschain after function call
+ builder.SetInsertPoint(next_insert_point);
+ load = builder.AddLoad(op_type->result_id(), var->result_id());
+ builder.AddStore(operand_id, load->result_id());
+
+ return var->result_id();
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.h
new file mode 100644
index 00000000000..15781b8c6b5
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fix_func_call_arguments.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2022 Advanced Micro Devices, 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 _VAR_FUNC_CALL_PASS_H
+#define _VAR_FUNC_CALL_PASS_H
+
+#include "source/opt/pass.h"
+
+namespace spvtools {
+namespace opt {
+class FixFuncCallArgumentsPass : public Pass {
+ public:
+ FixFuncCallArgumentsPass() {}
+ const char* name() const override { return "fix-for-funcall-param"; }
+ Status Process() override;
+ // Returns true if the module has one one function.
+ bool ModuleHasASingleFunction();
+ // Copies from the memory pointed to by |operand_inst| to a new function scope
+ // variable created before |func_call_inst|, and
+ // copies the value of the new variable back to the memory pointed to by
+ // |operand_inst| after |funct_call_inst| Returns the id of
+ // the new variable.
+ uint32_t ReplaceAccessChainFuncCallArguments(Instruction* func_call_inst,
+ Instruction* operand_inst);
+
+ // Fix function call |func_call_inst| non memory object arguments
+ bool FixFuncCallArguments(Instruction* func_call_inst);
+
+ IRContext::Analysis GetPreservedAnalyses() override {
+ return IRContext::kAnalysisTypes;
+ }
+};
+} // namespace opt
+} // namespace spvtools
+
+#endif // _VAR_FUNC_CALL_PASS_H \ No newline at end of file
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp
index 6550fb4fdb4..315741ad7ba 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold.cpp
@@ -540,7 +540,7 @@ std::vector<uint32_t> InstructionFolder::FoldVectors(
// in 32-bit words here. The reason of not using FoldScalars() here
// is that we do not create temporary null constants as components
// when the vector operand is a NullConstant because Constant creation
- // may need extra checks for the validity and that is not manageed in
+ // may need extra checks for the validity and that is not managed in
// here.
if (const analysis::ScalarConstant* scalar_component =
vector_operand->GetComponents().at(d)->AsScalarConstant()) {
@@ -627,8 +627,7 @@ Instruction* InstructionFolder::FoldInstructionToConstant(
Instruction* inst, std::function<uint32_t(uint32_t)> id_map) const {
analysis::ConstantManager* const_mgr = context_->get_constant_mgr();
- if (!inst->IsFoldableByFoldScalar() &&
- !GetConstantFoldingRules().HasFoldingRule(inst)) {
+ if (!inst->IsFoldableByFoldScalar() && !HasConstFoldingRule(inst)) {
return nullptr;
}
// Collect the values of the constant parameters.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp
index 8ab717ea8a8..7a518701039 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.cpp
@@ -28,6 +28,7 @@ namespace opt {
Pass::Status FoldSpecConstantOpAndCompositePass::Process() {
bool modified = false;
+ analysis::ConstantManager* const_mgr = context()->get_constant_mgr();
// Traverse through all the constant defining instructions. For Normal
// Constants whose values are determined and do not depend on OpUndef
// instructions, records their values in two internal maps: id_to_const_val_
@@ -62,8 +63,8 @@ Pass::Status FoldSpecConstantOpAndCompositePass::Process() {
// used in OpSpecConstant{Composite|Op} instructions.
// TODO(qining): If the constant or its type has decoration, we may need
// to skip it.
- if (context()->get_constant_mgr()->GetType(inst) &&
- !context()->get_constant_mgr()->GetType(inst)->decoration_empty())
+ if (const_mgr->GetType(inst) &&
+ !const_mgr->GetType(inst)->decoration_empty())
continue;
switch (SpvOp opcode = inst->opcode()) {
// Records the values of Normal Constants.
@@ -80,15 +81,14 @@ Pass::Status FoldSpecConstantOpAndCompositePass::Process() {
// Constant will be turned in to a Normal Constant. In that case, a
// Constant instance should also be created successfully and recorded
// in the id_to_const_val_ and const_val_to_id_ mapps.
- if (auto const_value =
- context()->get_constant_mgr()->GetConstantFromInst(inst)) {
+ 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);
modified = true;
}
- context()->get_constant_mgr()->MapConstantToInst(const_value, inst);
+ const_mgr->MapConstantToInst(const_value, inst);
}
break;
}
@@ -115,7 +115,7 @@ bool FoldSpecConstantOpAndCompositePass::ProcessOpSpecConstantOp(
Instruction* folded_inst = nullptr;
assert(inst->GetInOperand(0).type ==
SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER &&
- "The first in-operand of OpSpecContantOp instruction must be of "
+ "The first in-operand of OpSpecConstantOp instruction must be of "
"SPV_OPERAND_TYPE_SPEC_CONSTANT_OP_NUMBER type");
switch (static_cast<SpvOp>(inst->GetSingleWordInOperand(0))) {
@@ -144,17 +144,9 @@ bool FoldSpecConstantOpAndCompositePass::ProcessOpSpecConstantOp(
return true;
}
-uint32_t FoldSpecConstantOpAndCompositePass::GetTypeComponent(
- uint32_t typeId, uint32_t element) const {
- Instruction* type = context()->get_def_use_mgr()->GetDef(typeId);
- uint32_t subtype = type->GetTypeComponent(element);
- assert(subtype != 0);
-
- return subtype;
-}
-
Instruction* FoldSpecConstantOpAndCompositePass::FoldWithInstructionFolder(
Module::inst_iterator* inst_iter_ptr) {
+ analysis::ConstantManager* const_mgr = context()->get_constant_mgr();
// If one of operands to the instruction is not a
// constant, then we cannot fold this spec constant.
for (uint32_t i = 1; i < (*inst_iter_ptr)->NumInOperands(); i++) {
@@ -164,7 +156,7 @@ Instruction* FoldSpecConstantOpAndCompositePass::FoldWithInstructionFolder(
continue;
}
uint32_t id = operand.words[0];
- if (context()->get_constant_mgr()->FindDeclaredConstant(id) == nullptr) {
+ if (const_mgr->FindDeclaredConstant(id) == nullptr) {
return nullptr;
}
}
@@ -211,89 +203,10 @@ Instruction* FoldSpecConstantOpAndCompositePass::FoldWithInstructionFolder(
new_const_inst->InsertAfter(insert_pos);
get_def_use_mgr()->AnalyzeInstDefUse(new_const_inst);
}
+ const_mgr->MapInst(new_const_inst);
return new_const_inst;
}
-Instruction* FoldSpecConstantOpAndCompositePass::DoVectorShuffle(
- Module::inst_iterator* pos) {
- Instruction* inst = &**pos;
- analysis::Vector* result_vec_type =
- context()->get_constant_mgr()->GetType(inst)->AsVector();
- assert(inst->NumInOperands() - 1 > 2 &&
- "OpSpecConstantOp DoVectorShuffle instruction requires more than 2 "
- "operands (2 vector ids and at least one literal operand");
- assert(result_vec_type &&
- "The result of VectorShuffle must be of type vector");
-
- // A temporary null constants that can be used as the components of the result
- // vector. This is needed when any one of the vector operands are null
- // constant.
- const analysis::Constant* null_component_constants = nullptr;
-
- // Get a concatenated vector of scalar constants. The vector should be built
- // with the components from the first and the second operand of VectorShuffle.
- std::vector<const analysis::Constant*> concatenated_components;
- // Note that for OpSpecConstantOp, the second in-operand is the first id
- // operand. The first in-operand is the spec opcode.
- for (uint32_t i : {1, 2}) {
- assert(inst->GetInOperand(i).type == SPV_OPERAND_TYPE_ID &&
- "The vector operand must have a SPV_OPERAND_TYPE_ID type");
- uint32_t operand_id = inst->GetSingleWordInOperand(i);
- auto operand_const =
- context()->get_constant_mgr()->FindDeclaredConstant(operand_id);
- if (!operand_const) return nullptr;
- const analysis::Type* operand_type = operand_const->type();
- assert(operand_type->AsVector() &&
- "The first two operand of VectorShuffle must be of vector type");
- if (auto vec_const = operand_const->AsVectorConstant()) {
- // case 1: current operand is a non-null vector constant.
- concatenated_components.insert(concatenated_components.end(),
- vec_const->GetComponents().begin(),
- vec_const->GetComponents().end());
- } else if (operand_const->AsNullConstant()) {
- // case 2: current operand is a null vector constant. Create a temporary
- // null scalar constant as the component.
- if (!null_component_constants) {
- const analysis::Type* component_type =
- operand_type->AsVector()->element_type();
- null_component_constants =
- context()->get_constant_mgr()->GetConstant(component_type, {});
- }
- // Append the null scalar consts to the concatenated components
- // vector.
- concatenated_components.insert(concatenated_components.end(),
- operand_type->AsVector()->element_count(),
- null_component_constants);
- } else {
- // no other valid cases
- return nullptr;
- }
- }
- // Create null component constants if there are any. The component constants
- // must be added to the module before the dependee composite constants to
- // satisfy SSA def-use dominance.
- if (null_component_constants) {
- context()->get_constant_mgr()->BuildInstructionAndAddToModule(
- null_component_constants, pos);
- }
- // Create the new vector constant with the selected components.
- std::vector<const analysis::Constant*> selected_components;
- for (uint32_t i = 3; i < inst->NumInOperands(); i++) {
- assert(inst->GetInOperand(i).type == SPV_OPERAND_TYPE_LITERAL_INTEGER &&
- "The literal operand must of type SPV_OPERAND_TYPE_LITERAL_INTEGER");
- uint32_t literal = inst->GetSingleWordInOperand(i);
- assert(literal < concatenated_components.size() &&
- "Literal index out of bound of the concatenated vector");
- selected_components.push_back(concatenated_components[literal]);
- }
- auto new_vec_const = MakeUnique<analysis::VectorConstant>(
- result_vec_type, selected_components);
- auto reg_vec_const =
- context()->get_constant_mgr()->RegisterConstant(std::move(new_vec_const));
- return context()->get_constant_mgr()->BuildInstructionAndAddToModule(
- reg_vec_const, pos);
-}
-
namespace {
// A helper function to check the type for component wise operations. Returns
// true if the type:
@@ -374,8 +287,8 @@ utils::SmallVector<uint32_t, 2> EncodeIntegerAsWords(const analysis::Type& type,
Instruction* FoldSpecConstantOpAndCompositePass::DoComponentWiseOperation(
Module::inst_iterator* pos) {
const Instruction* inst = &**pos;
- const analysis::Type* result_type =
- context()->get_constant_mgr()->GetType(inst);
+ analysis::ConstantManager* const_mgr = context()->get_constant_mgr();
+ const analysis::Type* result_type = const_mgr->GetType(inst);
SpvOp spec_opcode = static_cast<SpvOp>(inst->GetSingleWordInOperand(0));
// Check and collect operands.
std::vector<const analysis::Constant*> operands;
@@ -400,10 +313,9 @@ Instruction* FoldSpecConstantOpAndCompositePass::DoComponentWiseOperation(
// Scalar operation
const uint32_t result_val =
context()->get_instruction_folder().FoldScalars(spec_opcode, operands);
- auto result_const = context()->get_constant_mgr()->GetConstant(
+ auto result_const = const_mgr->GetConstant(
result_type, EncodeIntegerAsWords(*result_type, result_val));
- return context()->get_constant_mgr()->BuildInstructionAndAddToModule(
- result_const, pos);
+ return const_mgr->BuildInstructionAndAddToModule(result_const, pos);
} else if (result_type->AsVector()) {
// Vector operation
const analysis::Type* element_type =
@@ -414,11 +326,10 @@ Instruction* FoldSpecConstantOpAndCompositePass::DoComponentWiseOperation(
operands);
std::vector<const analysis::Constant*> result_vector_components;
for (const uint32_t r : result_vec) {
- if (auto rc = context()->get_constant_mgr()->GetConstant(
+ if (auto rc = const_mgr->GetConstant(
element_type, EncodeIntegerAsWords(*element_type, r))) {
result_vector_components.push_back(rc);
- if (!context()->get_constant_mgr()->BuildInstructionAndAddToModule(
- rc, pos)) {
+ if (!const_mgr->BuildInstructionAndAddToModule(rc, pos)) {
assert(false &&
"Failed to build and insert constant declaring instruction "
"for the given vector component constant");
@@ -429,10 +340,8 @@ Instruction* FoldSpecConstantOpAndCompositePass::DoComponentWiseOperation(
}
auto new_vec_const = MakeUnique<analysis::VectorConstant>(
result_type->AsVector(), result_vector_components);
- auto reg_vec_const = context()->get_constant_mgr()->RegisterConstant(
- std::move(new_vec_const));
- return context()->get_constant_mgr()->BuildInstructionAndAddToModule(
- reg_vec_const, pos);
+ auto reg_vec_const = const_mgr->RegisterConstant(std::move(new_vec_const));
+ return const_mgr->BuildInstructionAndAddToModule(reg_vec_const, pos);
} else {
// Cannot process invalid component wise operation. The result of component
// wise operation must be of integer or bool scalar or vector of
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.h
index 361d3cacb45..9a8fb403d7c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/fold_spec_constant_op_and_composite_pass.h
@@ -58,22 +58,11 @@ class FoldSpecConstantOpAndCompositePass : public Pass {
// |inst_iter_ptr| using the instruction folder.
Instruction* FoldWithInstructionFolder(Module::inst_iterator* inst_iter_ptr);
- // Try to fold the OpSpecConstantOp VectorShuffle instruction pointed by the
- // given instruction iterator to a normal constant defining instruction.
- // Returns the pointer to the new constant defining instruction if succeeded.
- // Otherwise return nullptr.
- Instruction* DoVectorShuffle(Module::inst_iterator* inst_iter_ptr);
-
// Try to fold the OpSpecConstantOp <component wise operations> instruction
// pointed by the given instruction iterator to a normal constant defining
// instruction. Returns the pointer to the new constant defining instruction
// if succeeded, otherwise return nullptr.
Instruction* DoComponentWiseOperation(Module::inst_iterator* inst_iter_ptr);
-
- // Returns the |element|'th subtype of |type|.
- //
- // |type| must be a composite type.
- uint32_t GetTypeComponent(uint32_t type, uint32_t element) const;
};
} // namespace opt
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp
index 886c03fd686..3d803addcc3 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/folding_rules.cpp
@@ -136,25 +136,28 @@ std::vector<uint32_t> GetWordsFromScalarIntConstant(
const analysis::IntConstant* c) {
assert(c != nullptr);
uint32_t width = c->type()->AsInteger()->width();
- assert(width == 32 || width == 64);
+ assert(width == 8 || width == 16 || width == 32 || width == 64);
if (width == 64) {
uint64_t uval = static_cast<uint64_t>(c->GetU64());
return ExtractInts(uval);
}
- return {c->GetU32()};
+ // Section 2.2.1 of the SPIR-V spec guarantees that all integer types
+ // smaller than 32-bits are automatically zero or sign extended to 32-bits.
+ return {c->GetU32BitValue()};
}
std::vector<uint32_t> GetWordsFromScalarFloatConstant(
const analysis::FloatConstant* c) {
assert(c != nullptr);
uint32_t width = c->type()->AsFloat()->width();
- assert(width == 32 || width == 64);
+ assert(width == 16 || width == 32 || width == 64);
if (width == 64) {
utils::FloatProxy<double> result(c->GetDouble());
return result.GetWords();
}
- utils::FloatProxy<float> result(c->GetFloat());
- return result.GetWords();
+ // Section 2.2.1 of the SPIR-V spec guarantees that all floating-point types
+ // smaller than 32-bits are automatically zero extended to 32-bits.
+ return {c->GetU32BitValue()};
}
std::vector<uint32_t> GetWordsFromNumericScalarOrVectorConstant(
@@ -277,6 +280,11 @@ uint32_t Reciprocal(analysis::ConstantManager* const_mgr,
uint32_t width = c->type()->AsFloat()->width();
assert(width == 32 || width == 64);
std::vector<uint32_t> words;
+
+ if (c->IsZero()) {
+ return 0;
+ }
+
if (width == 64) {
spvtools::utils::FloatProxy<double> result(1.0 / c->GetDouble());
if (!IsValidResult(result.getAsFloat())) return 0;
@@ -968,25 +976,17 @@ FoldingRule MergeDivMulArithmetic() {
FoldingRule MergeDivNegateArithmetic() {
return [](IRContext* context, Instruction* inst,
const std::vector<const analysis::Constant*>& constants) {
- assert(inst->opcode() == SpvOpFDiv || inst->opcode() == SpvOpSDiv);
+ assert(inst->opcode() == SpvOpFDiv);
analysis::ConstantManager* const_mgr = context->get_constant_mgr();
- const analysis::Type* type =
- context->get_type_mgr()->GetType(inst->type_id());
- bool uses_float = HasFloatingPoint(type);
- if (uses_float && !inst->IsFloatingPointFoldingAllowed()) return false;
-
- uint32_t width = ElementWidth(type);
- if (width != 32 && width != 64) return false;
+ if (!inst->IsFloatingPointFoldingAllowed()) return false;
const analysis::Constant* const_input1 = ConstInput(constants);
if (!const_input1) return false;
Instruction* other_inst = NonConstInput(context, constants[0], inst);
- if (uses_float && !other_inst->IsFloatingPointFoldingAllowed())
- return false;
+ if (!other_inst->IsFloatingPointFoldingAllowed()) return false;
bool first_is_variable = constants[0] == nullptr;
- if (other_inst->opcode() == SpvOpFNegate ||
- other_inst->opcode() == SpvOpSNegate) {
+ if (other_inst->opcode() == SpvOpFNegate) {
uint32_t neg_id = NegateConstant(const_mgr, const_input1);
if (first_is_variable) {
@@ -1438,6 +1438,132 @@ FoldingRule FactorAddMuls() {
};
}
+// Replaces |inst| inplace with an FMA instruction |(x*y)+a|.
+void ReplaceWithFma(Instruction* inst, uint32_t x, uint32_t y, uint32_t a) {
+ uint32_t ext =
+ inst->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450();
+
+ if (ext == 0) {
+ inst->context()->AddExtInstImport("GLSL.std.450");
+ ext = inst->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450();
+ assert(ext != 0 &&
+ "Could not add the GLSL.std.450 extended instruction set");
+ }
+
+ std::vector<Operand> operands;
+ operands.push_back({SPV_OPERAND_TYPE_ID, {ext}});
+ operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {GLSLstd450Fma}});
+ operands.push_back({SPV_OPERAND_TYPE_ID, {x}});
+ operands.push_back({SPV_OPERAND_TYPE_ID, {y}});
+ operands.push_back({SPV_OPERAND_TYPE_ID, {a}});
+
+ inst->SetOpcode(SpvOpExtInst);
+ inst->SetInOperands(std::move(operands));
+}
+
+// Folds a multiple and add into an Fma.
+//
+// Cases:
+// (x * y) + a = Fma x y a
+// a + (x * y) = Fma x y a
+bool MergeMulAddArithmetic(IRContext* context, Instruction* inst,
+ const std::vector<const analysis::Constant*>&) {
+ assert(inst->opcode() == SpvOpFAdd);
+
+ if (!inst->IsFloatingPointFoldingAllowed()) {
+ return false;
+ }
+
+ analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr();
+ for (int 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() != SpvOpFMul) {
+ continue;
+ }
+
+ if (!op_inst->IsFloatingPointFoldingAllowed()) {
+ continue;
+ }
+
+ uint32_t x = op_inst->GetSingleWordInOperand(0);
+ uint32_t y = op_inst->GetSingleWordInOperand(1);
+ uint32_t a = inst->GetSingleWordInOperand((i + 1) % 2);
+ ReplaceWithFma(inst, x, y, a);
+ return true;
+ }
+ return false;
+}
+
+// Replaces |sub| inplace with an FMA instruction |(x*y)+a| where |a| first gets
+// negated if |negate_addition| is true, otherwise |x| gets negated.
+void ReplaceWithFmaAndNegate(Instruction* sub, uint32_t x, uint32_t y,
+ uint32_t a, bool negate_addition) {
+ uint32_t ext =
+ sub->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450();
+
+ if (ext == 0) {
+ sub->context()->AddExtInstImport("GLSL.std.450");
+ ext = sub->context()->get_feature_mgr()->GetExtInstImportId_GLSLstd450();
+ assert(ext != 0 &&
+ "Could not add the GLSL.std.450 extended instruction set");
+ }
+
+ InstructionBuilder ir_builder(
+ sub->context(), sub,
+ IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
+
+ Instruction* neg = ir_builder.AddUnaryOp(sub->type_id(), SpvOpFNegate,
+ negate_addition ? a : x);
+ uint32_t neg_op = neg->result_id(); // -a : -x
+
+ std::vector<Operand> operands;
+ operands.push_back({SPV_OPERAND_TYPE_ID, {ext}});
+ operands.push_back({SPV_OPERAND_TYPE_LITERAL_INTEGER, {GLSLstd450Fma}});
+ operands.push_back({SPV_OPERAND_TYPE_ID, {negate_addition ? x : neg_op}});
+ operands.push_back({SPV_OPERAND_TYPE_ID, {y}});
+ operands.push_back({SPV_OPERAND_TYPE_ID, {negate_addition ? neg_op : a}});
+
+ sub->SetOpcode(SpvOpExtInst);
+ sub->SetInOperands(std::move(operands));
+}
+
+// Folds a multiply and subtract into an Fma and negation.
+//
+// Cases:
+// (x * y) - a = Fma x y -a
+// a - (x * y) = Fma -x y a
+bool MergeMulSubArithmetic(IRContext* context, Instruction* sub,
+ const std::vector<const analysis::Constant*>&) {
+ assert(sub->opcode() == SpvOpFSub);
+
+ if (!sub->IsFloatingPointFoldingAllowed()) {
+ return false;
+ }
+
+ analysis::DefUseManager* def_use_mgr = context->get_def_use_mgr();
+ for (int i = 0; i < 2; i++) {
+ uint32_t op_id = sub->GetSingleWordInOperand(i);
+ Instruction* mul = def_use_mgr->GetDef(op_id);
+
+ if (mul->opcode() != SpvOpFMul) {
+ continue;
+ }
+
+ if (!mul->IsFloatingPointFoldingAllowed()) {
+ continue;
+ }
+
+ uint32_t x = mul->GetSingleWordInOperand(0);
+ uint32_t y = mul->GetSingleWordInOperand(1);
+ uint32_t a = sub->GetSingleWordInOperand((i + 1) % 2);
+ ReplaceWithFmaAndNegate(sub, x, y, a, i == 0);
+ return true;
+ }
+ return false;
+}
+
FoldingRule IntMultipleBy1() {
return [](IRContext*, Instruction* inst,
const std::vector<const analysis::Constant*>& constants) {
@@ -1581,6 +1707,57 @@ bool CompositeConstructFeedingExtract(
return true;
}
+// Walks the indexes chain from |start| to |end| of an OpCompositeInsert or
+// OpCompositeExtract instruction, and returns the type of the final element
+// being accessed.
+const analysis::Type* GetElementType(uint32_t type_id,
+ Instruction::iterator start,
+ Instruction::iterator end,
+ const analysis::TypeManager* type_mgr) {
+ const analysis::Type* type = type_mgr->GetType(type_id);
+ for (auto index : make_range(std::move(start), std::move(end))) {
+ assert(index.type == SPV_OPERAND_TYPE_LITERAL_INTEGER &&
+ index.words.size() == 1);
+ if (auto* array_type = type->AsArray()) {
+ type = array_type->element_type();
+ } else if (auto* matrix_type = type->AsMatrix()) {
+ type = matrix_type->element_type();
+ } else if (auto* struct_type = type->AsStruct()) {
+ type = struct_type->element_types()[index.words[0]];
+ } else {
+ type = nullptr;
+ }
+ }
+ return type;
+}
+
+// Returns true of |inst_1| and |inst_2| have the same indexes that will be used
+// to index into a composite object, excluding the last index. The two
+// instructions must have the same opcode, and be either OpCompositeExtract or
+// OpCompositeInsert instructions.
+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) &&
+ "Instructions must be OpCompositeInsert or OpCompositeExtract.");
+
+ if (inst_1->NumInOperands() != inst_2->NumInOperands()) {
+ return false;
+ }
+
+ uint32_t first_index_position =
+ (inst_1->opcode() == SpvOpCompositeInsert ? 2 : 1);
+ for (uint32_t i = first_index_position; i < inst_1->NumInOperands() - 1;
+ i++) {
+ if (inst_1->GetSingleWordInOperand(i) !=
+ inst_2->GetSingleWordInOperand(i)) {
+ return false;
+ }
+ }
+ return true;
+}
+
// If the OpCompositeConstruct is simply putting back together elements that
// where extracted from the same source, we can simply reuse the source.
//
@@ -1603,19 +1780,24 @@ bool CompositeExtractFeedingConstruct(
// - extractions
// - extracting the same position they are inserting
// - all extract from the same id.
+ Instruction* first_element_inst = nullptr;
for (uint32_t i = 0; i < inst->NumInOperands(); ++i) {
const uint32_t element_id = inst->GetSingleWordInOperand(i);
Instruction* element_inst = def_use_mgr->GetDef(element_id);
+ if (first_element_inst == nullptr) {
+ first_element_inst = element_inst;
+ }
if (element_inst->opcode() != SpvOpCompositeExtract) {
return false;
}
- if (element_inst->NumInOperands() != 2) {
+ if (!HaveSameIndexesExceptForLast(element_inst, first_element_inst)) {
return false;
}
- if (element_inst->GetSingleWordInOperand(1) != i) {
+ if (element_inst->GetSingleWordInOperand(element_inst->NumInOperands() -
+ 1) != i) {
return false;
}
@@ -1631,13 +1813,31 @@ bool CompositeExtractFeedingConstruct(
// The last check it to see that the object being extracted from is the
// correct type.
Instruction* original_inst = def_use_mgr->GetDef(original_id);
- if (original_inst->type_id() != inst->type_id()) {
+ analysis::TypeManager* type_mgr = context->get_type_mgr();
+ const analysis::Type* original_type =
+ GetElementType(original_inst->type_id(), first_element_inst->begin() + 3,
+ first_element_inst->end() - 1, type_mgr);
+
+ if (original_type == nullptr) {
return false;
}
- // Simplify by using the original object.
- inst->SetOpcode(SpvOpCopyObject);
- inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {original_id}}});
+ if (inst->type_id() != type_mgr->GetId(original_type)) {
+ return false;
+ }
+
+ if (first_element_inst->NumInOperands() == 2) {
+ // Simplify by using the original object.
+ inst->SetOpcode(SpvOpCopyObject);
+ 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->SetInOperands(std::vector<Operand>(first_element_inst->begin() + 2,
+ first_element_inst->end() - 1));
return true;
}
@@ -1841,6 +2041,139 @@ FoldingRule FMixFeedingExtract() {
};
}
+// Returns the number of elements in the composite type |type|. Returns 0 if
+// |type| is a scalar value.
+uint32_t GetNumberOfElements(const analysis::Type* type) {
+ if (auto* vector_type = type->AsVector()) {
+ return vector_type->element_count();
+ }
+ if (auto* matrix_type = type->AsMatrix()) {
+ return matrix_type->element_count();
+ }
+ if (auto* struct_type = type->AsStruct()) {
+ return static_cast<uint32_t>(struct_type->element_types().size());
+ }
+ if (auto* array_type = type->AsArray()) {
+ return array_type->length_info().words[0];
+ }
+ return 0;
+}
+
+// Returns a map with the set of values that were inserted into an object by
+// the chain of OpCompositeInsertInstruction starting with |inst|.
+// The map will map the index to the value inserted at that index.
+std::map<uint32_t, uint32_t> GetInsertedValues(Instruction* inst) {
+ analysis::DefUseManager* def_use_mgr = inst->context()->get_def_use_mgr();
+ std::map<uint32_t, uint32_t> values_inserted;
+ Instruction* current_inst = inst;
+ while (current_inst->opcode() == SpvOpCompositeInsert) {
+ if (current_inst->NumInOperands() > inst->NumInOperands()) {
+ // This is the catch the case
+ // %2 = OpCompositeInsert %m2x2int %v2int_1_0 %m2x2int_undef 0
+ // %3 = OpCompositeInsert %m2x2int %int_4 %2 0 0
+ // %4 = OpCompositeInsert %m2x2int %v2int_2_3 %3 1
+ // In this case we cannot do a single construct to get the matrix.
+ uint32_t partially_inserted_element_index =
+ current_inst->GetSingleWordInOperand(inst->NumInOperands() - 1);
+ if (values_inserted.count(partially_inserted_element_index) == 0)
+ return {};
+ }
+ if (HaveSameIndexesExceptForLast(inst, current_inst)) {
+ values_inserted.insert(
+ {current_inst->GetSingleWordInOperand(current_inst->NumInOperands() -
+ 1),
+ current_inst->GetSingleWordInOperand(kInsertObjectIdInIdx)});
+ }
+ current_inst = def_use_mgr->GetDef(
+ current_inst->GetSingleWordInOperand(kInsertCompositeIdInIdx));
+ }
+ return values_inserted;
+}
+
+// Returns true of there is an entry in |values_inserted| for every element of
+// |Type|.
+bool DoInsertedValuesCoverEntireObject(
+ const analysis::Type* type, std::map<uint32_t, uint32_t>& values_inserted) {
+ uint32_t container_size = GetNumberOfElements(type);
+ if (container_size != values_inserted.size()) {
+ return false;
+ }
+
+ if (values_inserted.rbegin()->first >= container_size) {
+ return false;
+ }
+ return true;
+}
+
+// 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);
+ analysis::TypeManager* type_mgr = inst->context()->get_type_mgr();
+ return GetElementType(inst->type_id(), inst->begin() + 4, inst->end() - 1,
+ type_mgr);
+}
+
+// Returns an OpCompositeConstruct instruction that build an object with
+// |type_id| out of the values in |values_inserted|. Each value will be
+// placed at the index corresponding to the value. The new instruction will
+// be placed before |insert_before|.
+Instruction* BuildCompositeConstruct(
+ uint32_t type_id, const std::map<uint32_t, uint32_t>& values_inserted,
+ Instruction* insert_before) {
+ InstructionBuilder ir_builder(
+ insert_before->context(), insert_before,
+ IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
+
+ std::vector<uint32_t> ids_in_order;
+ for (auto it : values_inserted) {
+ ids_in_order.push_back(it.second);
+ }
+ Instruction* construct =
+ ir_builder.AddCompositeConstruct(type_id, ids_in_order);
+ return construct;
+}
+
+// Replaces the OpCompositeInsert |inst| that inserts |construct| into the same
+// object as |inst| with final index removed. If the resulting
+// OpCompositeInsert instruction would have no remaining indexes, the
+// instruction is replaced with an OpCopyObject instead.
+void InsertConstructedObject(Instruction* inst, const Instruction* construct) {
+ if (inst->NumInOperands() == 3) {
+ inst->SetOpcode(SpvOpCopyObject);
+ inst->SetInOperands({{SPV_OPERAND_TYPE_ID, {construct->result_id()}}});
+ } else {
+ inst->SetInOperand(kInsertObjectIdInIdx, {construct->result_id()});
+ inst->RemoveOperand(inst->NumOperands() - 1);
+ }
+}
+
+// Replaces a series of |OpCompositeInsert| instruction that cover the entire
+// object with an |OpCompositeConstruct|.
+bool CompositeInsertToCompositeConstruct(
+ IRContext* context, Instruction* inst,
+ const std::vector<const analysis::Constant*>&) {
+ assert(inst->opcode() == SpvOpCompositeInsert &&
+ "Wrong opcode. Should be OpCompositeInsert.");
+ if (inst->NumInOperands() < 3) return false;
+
+ std::map<uint32_t, uint32_t> values_inserted = GetInsertedValues(inst);
+ const analysis::Type* container_type = GetContainerType(inst);
+ if (container_type == nullptr) {
+ return false;
+ }
+
+ if (!DoInsertedValuesCoverEntireObject(container_type, values_inserted)) {
+ return false;
+ }
+
+ analysis::TypeManager* type_mgr = context->get_type_mgr();
+ Instruction* construct = BuildCompositeConstruct(
+ type_mgr->GetId(container_type), values_inserted, inst);
+ InsertConstructedObject(inst, construct);
+ return true;
+}
+
FoldingRule RedundantPhi() {
// An OpPhi instruction where all values are the same or the result of the phi
// itself, can be replaced by the value itself.
@@ -2376,7 +2709,7 @@ FoldingRule VectorShuffleFeedingShuffle() {
// fold.
return false;
}
- } else {
+ } else if (component_index != undef_literal) {
if (new_feeder_id == 0) {
// First time through, save the id of the operand the element comes
// from.
@@ -2390,7 +2723,7 @@ FoldingRule VectorShuffleFeedingShuffle() {
component_index -= feeder_op0_length;
}
- if (!feeder_is_op0) {
+ if (!feeder_is_op0 && component_index != undef_literal) {
component_index += op0_length;
}
}
@@ -2418,7 +2751,8 @@ FoldingRule VectorShuffleFeedingShuffle() {
if (adjustment != 0) {
for (uint32_t i = 2; i < new_operands.size(); i++) {
- if (inst->GetSingleWordInOperand(i) >= op0_length) {
+ uint32_t operand = inst->GetSingleWordInOperand(i);
+ if (operand >= op0_length && operand != undef_literal) {
new_operands[i].words[0] -= adjustment;
}
}
@@ -2541,6 +2875,8 @@ void FoldingRules::AddFoldingRules() {
rules_[SpvOpCompositeExtract].push_back(VectorShuffleFeedingExtract());
rules_[SpvOpCompositeExtract].push_back(FMixFeedingExtract());
+ rules_[SpvOpCompositeInsert].push_back(CompositeInsertToCompositeConstruct);
+
rules_[SpvOpDot].push_back(DotProductDoingExtract());
rules_[SpvOpEntryPoint].push_back(RemoveRedundantOperands());
@@ -2551,6 +2887,7 @@ void FoldingRules::AddFoldingRules() {
rules_[SpvOpFAdd].push_back(MergeAddSubArithmetic());
rules_[SpvOpFAdd].push_back(MergeGenericAddSubArithmetic());
rules_[SpvOpFAdd].push_back(FactorAddMuls());
+ rules_[SpvOpFAdd].push_back(MergeMulAddArithmetic);
rules_[SpvOpFDiv].push_back(RedundantFDiv());
rules_[SpvOpFDiv].push_back(ReciprocalFDiv());
@@ -2571,6 +2908,7 @@ void FoldingRules::AddFoldingRules() {
rules_[SpvOpFSub].push_back(MergeSubNegateArithmetic());
rules_[SpvOpFSub].push_back(MergeSubAddArithmetic());
rules_[SpvOpFSub].push_back(MergeSubSubArithmetic());
+ rules_[SpvOpFSub].push_back(MergeMulSubArithmetic);
rules_[SpvOpIAdd].push_back(RedundantIAdd());
rules_[SpvOpIAdd].push_back(MergeAddNegateArithmetic());
@@ -2589,8 +2927,6 @@ void FoldingRules::AddFoldingRules() {
rules_[SpvOpPhi].push_back(RedundantPhi());
- rules_[SpvOpSDiv].push_back(MergeDivNegateArithmetic());
-
rules_[SpvOpSNegate].push_back(MergeNegateArithmetic());
rules_[SpvOpSNegate].push_back(MergeNegateMulDivArithmetic());
rules_[SpvOpSNegate].push_back(MergeNegateAddSubArithmetic());
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/function.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/function.cpp
index 38c669510b8..bb51df3f963 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/function.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/function.cpp
@@ -270,5 +270,13 @@ std::string Function::PrettyPrint(uint32_t options) const {
});
return str.str();
}
+
+void Function::ReorderBasicBlocksInStructuredOrder() {
+ std::list<BasicBlock*> order;
+ IRContext* context = this->def_inst_->context();
+ context->cfg()->ComputeStructuredOrder(this, blocks_[0].get(), &order);
+ ReorderBasicBlocks(order.begin(), order.end());
+}
+
} // namespace opt
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/function.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/function.h
index 9e1c72746ef..146cbe3408a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/function.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/function.h
@@ -19,6 +19,7 @@
#include <functional>
#include <memory>
#include <string>
+#include <unordered_set>
#include <utility>
#include <vector>
@@ -177,7 +178,22 @@ class Function {
// debuggers.
void Dump() const;
+ // Returns true is a function declaration and not a function definition.
+ bool IsDeclaration() { return begin() == end(); }
+
+ // Reorders the basic blocks in the function to match the structured order.
+ void ReorderBasicBlocksInStructuredOrder();
+
private:
+ // Reorders the basic blocks in the function to match the order given by the
+ // range |{begin,end}|. The range must contain every basic block in the
+ // function, and no extras.
+ template <class It>
+ void ReorderBasicBlocks(It begin, It end);
+
+ template <class It>
+ bool ContainsAllBlocksInTheFunction(It begin, It end);
+
// The OpFunction instruction that begins the definition of this function.
std::unique_ptr<Instruction> def_inst_;
// All parameters to this function.
@@ -259,6 +275,34 @@ inline void Function::AddNonSemanticInstruction(
non_semantic_.emplace_back(std::move(non_semantic));
}
+template <class It>
+void Function::ReorderBasicBlocks(It begin, It end) {
+ // Asserts to make sure every node in the function is in new_order.
+ assert(ContainsAllBlocksInTheFunction(begin, end));
+
+ // We have a pointer to all the elements in order, so we can release all
+ // pointers in |block_|, and then create the new unique pointers from |{begin,
+ // end}|.
+ std::for_each(blocks_.begin(), blocks_.end(),
+ [](std::unique_ptr<BasicBlock>& bb) { bb.release(); });
+ std::transform(begin, end, blocks_.begin(), [](BasicBlock* bb) {
+ return std::unique_ptr<BasicBlock>(bb);
+ });
+}
+
+template <class It>
+bool Function::ContainsAllBlocksInTheFunction(It begin, It end) {
+ std::unordered_multiset<BasicBlock*> range(begin, end);
+ if (range.size() != blocks_.size()) {
+ return false;
+ }
+
+ for (auto& bb : blocks_) {
+ if (range.count(bb.get()) == 0) return false;
+ }
+ return true;
+}
+
} // namespace opt
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp
index 1b28f9b529f..4652d72d5cb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.cpp
@@ -13,7 +13,7 @@
// limitations under the License.
// This pass injects code in a graphics shader to implement guarantees
-// satisfying Vulkan's robustBufferAcces rules. Robust access rules permit
+// satisfying Vulkan's robustBufferAccess rules. Robust access rules permit
// an out-of-bounds access to be redirected to an access of the same type
// (load, store, etc.) but within the same root object.
//
@@ -74,7 +74,7 @@
// Pointers are always (correctly) typed and so the address and number of
// consecutive locations are fully determined by the pointer.
//
-// - A pointer value orginates as one of few cases:
+// - A pointer value originates as one of few cases:
//
// - OpVariable for an interface object or an array of them: image,
// buffer (UBO or SSBO), sampler, sampled-image, push-constant, input
@@ -559,21 +559,17 @@ uint32_t GraphicsRobustAccessPass::GetGlslInsts() {
if (module_status_.glsl_insts_id == 0) {
// This string serves double-duty as raw data for a string and for a vector
// of 32-bit words
- const char glsl[] = "GLSL.std.450\0\0\0\0";
- const size_t glsl_str_byte_len = 16;
+ const char glsl[] = "GLSL.std.450";
// Use an existing import if we can.
for (auto& inst : context()->module()->ext_inst_imports()) {
- const auto& name_words = inst.GetInOperand(0).words;
- if (0 == std::strncmp(reinterpret_cast<const char*>(name_words.data()),
- glsl, glsl_str_byte_len)) {
+ if (inst.GetInOperand(0).AsString() == glsl) {
module_status_.glsl_insts_id = inst.result_id();
}
}
if (module_status_.glsl_insts_id == 0) {
// Make a new import instruction.
module_status_.glsl_insts_id = TakeNextId();
- std::vector<uint32_t> words(glsl_str_byte_len / sizeof(uint32_t));
- std::memcpy(words.data(), glsl, glsl_str_byte_len);
+ std::vector<uint32_t> words = spvtools::utils::MakeVector(glsl);
auto import_inst = MakeUnique<Instruction>(
context(), SpvOpExtInstImport, 0, module_status_.glsl_insts_id,
std::initializer_list<Operand>{
@@ -962,7 +958,7 @@ spv_result_t GraphicsRobustAccessPass::ClampCoordinateForImageTexelPointer(
constant_mgr->GetDefiningInstruction(component_0)->result_id();
// If the image is a cube array, then the last component of the queried
- // size is the layer count. In the query, we have to accomodate folding
+ // size is the layer count. In the query, we have to accommodate folding
// 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;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h
index 6fc692c133c..8f4c9dc7dbd 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/graphics_robust_access_pass.h
@@ -111,7 +111,7 @@ class GraphicsRobustAccessPass : public Pass {
Instruction* max, Instruction* where);
// Returns a new instruction which evaluates to the length the runtime array
- // referenced by the access chain at the specfied index. The instruction is
+ // referenced by the access chain at the specified index. The instruction is
// inserted before the access chain instruction. Returns a null pointer in
// some cases if assumptions are violated (rather than asserting out).
opt::Instruction* MakeRuntimeArrayLengthInst(Instruction* access_chain,
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/if_conversion.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/if_conversion.cpp
index 492066177fd..1232796e5d8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/if_conversion.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/if_conversion.cpp
@@ -160,6 +160,11 @@ bool IfConversion::CheckBlock(BasicBlock* block, DominatorAnalysis* dominators,
BasicBlock* inc1 = context()->get_instr_block(preds[1]);
if (dominators->Dominates(block, inc1)) return false;
+ if (inc0 == inc1) {
+ // If the predecessor blocks are the same, then there is only 1 value for
+ // the OpPhi. Other transformation should be able to simplify that.
+ return false;
+ }
// All phis will have the same common dominator, so cache the result
// for this block. If there is no common dominator, then we cannot transform
// any phi in this basic block.
@@ -169,6 +174,8 @@ bool IfConversion::CheckBlock(BasicBlock* block, DominatorAnalysis* dominators,
if (branch->opcode() != SpvOpBranchConditional) return false;
auto merge = (*common)->GetMergeInst();
if (!merge || merge->opcode() != SpvOpSelectionMerge) return false;
+ if (merge->GetSingleWordInOperand(1) == SpvSelectionControlDontFlattenMask)
+ return false;
if ((*common)->MergeBlockIdIfAny() != block->id()) return false;
return true;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_exhaustive_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_exhaustive_pass.cpp
index f24f744d054..bef45017f21 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_exhaustive_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_exhaustive_pass.cpp
@@ -65,7 +65,7 @@ Pass::Status InlineExhaustivePass::ProcessImpl() {
status = CombineStatus(status, InlineExhaustive(fp));
return false;
};
- context()->ProcessEntryPointCallTree(pfn);
+ context()->ProcessReachableCallTree(pfn);
return status;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_opaque_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_opaque_pass.cpp
index 6ccaf908701..fe9c67993ff 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_opaque_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_opaque_pass.cpp
@@ -105,7 +105,7 @@ Pass::Status InlineOpaquePass::ProcessImpl() {
status = CombineStatus(status, InlineOpaque(fp));
return false;
};
- context()->ProcessEntryPointCallTree(pfn);
+ context()->ProcessReachableCallTree(pfn);
return status;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.cpp
index 2cc31258e3c..e14516f7564 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.cpp
@@ -508,6 +508,37 @@ void InlinePass::MoveLoopMergeInstToFirstBlock(
delete &*loop_merge_itr;
}
+void InlinePass::UpdateSingleBlockLoopContinueTarget(
+ uint32_t new_id, std::vector<std::unique_ptr<BasicBlock>>* new_blocks) {
+ auto& header = new_blocks->front();
+ auto* merge_inst = header->GetLoopMergeInst();
+
+ // The back-edge block is split at the branch to create a new back-edge
+ // block. The old block is modified to branch to the new block. The loop
+ // merge instruction is updated to declare the new block as the continue
+ // target. This has the effect of changing the loop from being a large
+ // continue construct and an empty loop construct to being a loop with a loop
+ // construct and a trivial continue construct. This change is made to satisfy
+ // structural dominance.
+
+ // Add the new basic block.
+ std::unique_ptr<BasicBlock> new_block =
+ MakeUnique<BasicBlock>(NewLabel(new_id));
+ auto& old_backedge = new_blocks->back();
+ auto old_branch = old_backedge->tail();
+
+ // Move the old back edge into the new block.
+ std::unique_ptr<Instruction> br(&*old_branch);
+ new_block->AddInstruction(std::move(br));
+
+ // Add a branch to the new block from the old back-edge block.
+ AddBranch(new_id, &old_backedge);
+ new_blocks->push_back(std::move(new_block));
+
+ // Update the loop's continue target to the new block.
+ merge_inst->SetInOperand(1u, {new_id});
+}
+
bool InlinePass::GenInlineCode(
std::vector<std::unique_ptr<BasicBlock>>* new_blocks,
std::vector<std::unique_ptr<Instruction>>* new_vars,
@@ -639,9 +670,19 @@ bool InlinePass::GenInlineCode(
// Finalize inline code.
new_blocks->push_back(std::move(new_blk_ptr));
- if (caller_is_loop_header && (new_blocks->size() > 1))
+ if (caller_is_loop_header && (new_blocks->size() > 1)) {
MoveLoopMergeInstToFirstBlock(new_blocks);
+ // If the loop was a single basic block previously, update it's structure.
+ auto& header = new_blocks->front();
+ auto* merge_inst = header->GetLoopMergeInst();
+ if (merge_inst->GetSingleWordInOperand(1u) == header->id()) {
+ auto new_id = context()->TakeNextId();
+ if (new_id == 0) return false;
+ UpdateSingleBlockLoopContinueTarget(new_id, new_blocks);
+ }
+ }
+
// Update block map given replacement blocks.
for (auto& blk : *new_blocks) {
id2block_[blk->id()] = &*blk;
@@ -753,22 +794,25 @@ bool InlinePass::IsInlinableFunction(Function* func) {
return false;
}
- // Do not inline functions with an OpKill if they are called from a continue
- // construct. If it is inlined into a continue construct it will generate
- // invalid code.
+ // Do not inline functions with an abort instruction if they are called from a
+ // continue construct. If it is inlined into a continue construct the backedge
+ // will no longer post-dominate the continue target, which is invalid. An
+ // `OpUnreachable` is acceptable because it will not change post-dominance if
+ // it is statically unreachable.
bool func_is_called_from_continue =
funcs_called_from_continue_.count(func->result_id()) != 0;
- if (func_is_called_from_continue && ContainsKillOrTerminateInvocation(func)) {
+ if (func_is_called_from_continue && ContainsAbortOtherThanUnreachable(func)) {
return false;
}
return true;
}
-bool InlinePass::ContainsKillOrTerminateInvocation(Function* func) const {
+bool InlinePass::ContainsAbortOtherThanUnreachable(Function* func) const {
return !func->WhileEachInst([](Instruction* inst) {
- return !spvOpcodeTerminatesExecution(inst->opcode());
+ return inst->opcode() == SpvOpUnreachable ||
+ !spvOpcodeIsAbort(inst->opcode());
});
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.h
index 9a5429bac38..d29c1e074bb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inline_pass.h
@@ -139,9 +139,9 @@ class InlinePass : public Pass {
// Return true if |func| is a function that can be inlined.
bool IsInlinableFunction(Function* func);
- // Returns true if |func| contains an OpKill or OpTerminateInvocation
- // instruction.
- bool ContainsKillOrTerminateInvocation(Function* func) const;
+ // Returns true if |func| contains an abort instruction that is not an
+ // `OpUnreachable` instruction.
+ bool ContainsAbortOtherThanUnreachable(Function* func) const;
// Update phis in succeeding blocks to point to new last block
void UpdateSucceedingPhis(
@@ -235,6 +235,12 @@ class InlinePass : public Pass {
// Move the OpLoopMerge from the last block back to the first.
void MoveLoopMergeInstToFirstBlock(
std::vector<std::unique_ptr<BasicBlock>>* new_blocks);
+
+ // Update the structure of single block loops so that the inlined code ends
+ // up in the loop construct and a new continue target is added to satisfy
+ // structural dominance.
+ void UpdateSingleBlockLoopContinueTarget(
+ uint32_t new_id, std::vector<std::unique_ptr<BasicBlock>>* new_blocks);
};
} // namespace opt
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp
index 5607239aaf3..c2c5d6cb449 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.cpp
@@ -39,13 +39,6 @@ static const int kSpvTypeImageMS = 4;
static const int kSpvTypeImageSampled = 5;
} // anonymous namespace
-// Avoid unused variable warning/error on Linux
-#ifndef NDEBUG
-#define USE_ASSERT(x) assert(x)
-#else
-#define USE_ASSERT(x) ((void)(x))
-#endif
-
namespace spvtools {
namespace opt {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.h
index cd9618059f7..e6e6ef4f98a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_bindless_check_pass.h
@@ -147,11 +147,11 @@ class InstBindlessCheckPass : public InstrumentPass {
uint32_t GenLastByteIdx(RefAnalysis* ref, InstructionBuilder* builder);
// Clone original image computation starting at |image_id| into |builder|.
- // This may generate more than one instruction if neccessary.
+ // This may generate more than one instruction if necessary.
uint32_t CloneOriginalImage(uint32_t image_id, InstructionBuilder* builder);
// Clone original original reference encapsulated by |ref| into |builder|.
- // This may generate more than one instruction if neccessary.
+ // This may generate more than one instruction if necessary.
uint32_t CloneOriginalReference(RefAnalysis* ref,
InstructionBuilder* builder);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp
index e2336d3601d..3318f88f29b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.cpp
@@ -393,6 +393,8 @@ uint32_t InstBuffAddrCheckPass::GetSearchAndTestFuncId() {
get_def_use_mgr()->AnalyzeInstDefUse(&*func_end_inst);
input_func->SetFunctionEnd(std::move(func_end_inst));
context()->AddFunction(std::move(input_func));
+ context()->AddDebug2Inst(
+ NewGlobalName(search_test_func_id_, "search_and_test"));
}
return search_test_func_id_;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.h
index a82322395a6..fb43c397a54 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_buff_addr_check_pass.h
@@ -39,7 +39,7 @@ class InstBuffAddrCheckPass : public InstrumentPass {
// See optimizer.hpp for pass user documentation.
Status Process() override;
- const char* name() const override { return "inst-bindless-check-pass"; }
+ const char* name() const override { return "inst-buff-addr-check-pass"; }
private:
// Return byte alignment of type |type_id|. Must be int, float, vector,
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp
index c0e6bc3f049..4218138f977 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/inst_debug_printf_pass.cpp
@@ -16,6 +16,7 @@
#include "inst_debug_printf_pass.h"
+#include "source/util/string_utils.h"
#include "spirv/unified1/NonSemanticDebugPrintf.h"
namespace spvtools {
@@ -231,10 +232,8 @@ Pass::Status InstDebugPrintfPass::ProcessImpl() {
bool non_sem_set_seen = false;
for (auto c_itr = context()->module()->ext_inst_import_begin();
c_itr != context()->module()->ext_inst_import_end(); ++c_itr) {
- const char* set_name =
- reinterpret_cast<const char*>(&c_itr->GetInOperand(0).words[0]);
- const char* non_sem_str = "NonSemantic.";
- if (!strncmp(set_name, non_sem_str, strlen(non_sem_str))) {
+ const std::string set_name = c_itr->GetInOperand(0).AsString();
+ if (spvtools::utils::starts_with(set_name, "NonSemantic.")) {
non_sem_set_seen = true;
break;
}
@@ -242,9 +241,8 @@ Pass::Status InstDebugPrintfPass::ProcessImpl() {
if (!non_sem_set_seen) {
for (auto c_itr = context()->module()->extension_begin();
c_itr != context()->module()->extension_end(); ++c_itr) {
- const char* ext_name =
- reinterpret_cast<const char*>(&c_itr->GetInOperand(0).words[0]);
- if (!strcmp(ext_name, "SPV_KHR_non_semantic_info")) {
+ const std::string ext_name = c_itr->GetInOperand(0).AsString();
+ if (ext_name == "SPV_KHR_non_semantic_info") {
context()->KillInst(&*c_itr);
break;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.cpp
index 665b72f0024..e775a99260a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.cpp
@@ -30,6 +30,7 @@ namespace {
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;
// Constants for OpenCL.DebugInfo.100 / NonSemantic.Shader.DebugInfo.100
@@ -75,10 +76,9 @@ Instruction::Instruction(IRContext* c, const spv_parsed_instruction_t& inst,
dbg_scope_(kNoDebugScope, kNoInlinedAt) {
for (uint32_t i = 0; i < inst.num_operands; ++i) {
const auto& current_payload = inst.operands[i];
- std::vector<uint32_t> words(
- inst.words + current_payload.offset,
+ operands_.emplace_back(
+ current_payload.type, inst.words + current_payload.offset,
inst.words + current_payload.offset + current_payload.num_words);
- operands_.emplace_back(current_payload.type, std::move(words));
}
assert((!IsLineInst() || dbg_line.empty()) &&
"Op(No)Line attaching to Op(No)Line found");
@@ -95,10 +95,9 @@ Instruction::Instruction(IRContext* c, const spv_parsed_instruction_t& inst,
dbg_scope_(dbg_scope) {
for (uint32_t i = 0; i < inst.num_operands; ++i) {
const auto& current_payload = inst.operands[i];
- std::vector<uint32_t> words(
- inst.words + current_payload.offset,
+ operands_.emplace_back(
+ current_payload.type, inst.words + current_payload.offset,
inst.words + current_payload.offset + current_payload.num_words);
- operands_.emplace_back(current_payload.type, std::move(words));
}
}
@@ -403,6 +402,21 @@ bool Instruction::IsVulkanStorageBuffer() const {
return false;
}
+bool Instruction::IsVulkanStorageBufferVariable() const {
+ if (opcode() != SpvOpVariable) {
+ return false;
+ }
+
+ uint32_t storage_class = GetSingleWordInOperand(kVariableStorageClassIndex);
+ if (storage_class == SpvStorageClassStorageBuffer ||
+ storage_class == SpvStorageClassUniform) {
+ Instruction* var_type = context()->get_def_use_mgr()->GetDef(type_id());
+ return var_type != nullptr && var_type->IsVulkanStorageBuffer();
+ }
+
+ return false;
+}
+
bool Instruction::IsVulkanUniformBuffer() const {
if (opcode() != SpvOpTypePointer) {
return false;
@@ -490,26 +504,6 @@ bool Instruction::IsReadOnlyPointerKernel() const {
return storage_class == SpvStorageClassUniformConstant;
}
-uint32_t Instruction::GetTypeComponent(uint32_t element) const {
- uint32_t subtype = 0;
- switch (opcode()) {
- case SpvOpTypeStruct:
- subtype = GetSingleWordInOperand(element);
- break;
- case SpvOpTypeArray:
- case SpvOpTypeRuntimeArray:
- case SpvOpTypeVector:
- case SpvOpTypeMatrix:
- // These types all have uniform subtypes.
- subtype = GetSingleWordInOperand(0u);
- break;
- default:
- break;
- }
-
- return subtype;
-}
-
void Instruction::UpdateLexicalScope(uint32_t scope) {
dbg_scope_.SetLexicalScope(scope);
for (auto& i : dbg_line_insts_) {
@@ -679,8 +673,12 @@ NonSemanticShaderDebugInfo100Instructions Instruction::GetShader100DebugOpcode()
return NonSemanticShaderDebugInfo100InstructionsMax;
}
- return NonSemanticShaderDebugInfo100Instructions(
- GetSingleWordInOperand(kExtInstInstructionInIdx));
+ uint32_t opcode = GetSingleWordInOperand(kExtInstInstructionInIdx);
+ if (opcode >= NonSemanticShaderDebugInfo100InstructionsMax) {
+ return NonSemanticShaderDebugInfo100InstructionsMax;
+ }
+
+ return NonSemanticShaderDebugInfo100Instructions(opcode);
}
CommonDebugInfoInstructions Instruction::GetCommonDebugOpcode() const {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.h
index c962e509a37..e79c6289b82 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instruction.h
@@ -24,6 +24,7 @@
#include "NonSemanticShaderDebugInfo100.h"
#include "OpenCLDebugInfo100.h"
+#include "source/binary.h"
#include "source/common_debug_info.h"
#include "source/latest_version_glsl_std_450_header.h"
#include "source/latest_version_spirv_header.h"
@@ -32,6 +33,7 @@
#include "source/opt/reflect.h"
#include "source/util/ilist_node.h"
#include "source/util/small_vector.h"
+#include "source/util/string_utils.h"
#include "spirv-tools/libspirv.h"
const uint32_t kNoDebugScope = 0;
@@ -82,21 +84,32 @@ struct Operand {
Operand(spv_operand_type_t t, const OperandData& w) : type(t), words(w) {}
+ template <class InputIt>
+ Operand(spv_operand_type_t t, InputIt firstOperandData,
+ InputIt lastOperandData)
+ : type(t), words(firstOperandData, lastOperandData) {}
+
spv_operand_type_t type; // Type of this logical operand.
OperandData words; // Binary segments of this logical operand.
- // Returns a string operand as a C-style string.
- const char* AsCString() const {
- assert(type == SPV_OPERAND_TYPE_LITERAL_STRING);
- return reinterpret_cast<const char*>(words.data());
+ uint32_t AsId() const {
+ assert(spvIsIdType(type));
+ assert(words.size() == 1);
+ return words[0];
}
// Returns a string operand as a std::string.
- std::string AsString() const { return AsCString(); }
+ std::string AsString() const {
+ assert(type == SPV_OPERAND_TYPE_LITERAL_STRING);
+ return spvtools::utils::MakeString(words);
+ }
// Returns a literal integer operand as a uint64_t
uint64_t AsLiteralUint64() const {
- assert(type == SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER);
+ assert(type == SPV_OPERAND_TYPE_LITERAL_INTEGER ||
+ type == SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER ||
+ type == SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER ||
+ type == SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER);
assert(1 <= words.size());
assert(words.size() <= 2);
uint64_t result = 0;
@@ -123,7 +136,7 @@ inline bool operator!=(const Operand& o1, const Operand& o2) {
}
// This structure is used to represent a DebugScope instruction from
-// the OpenCL.100.DebugInfo extened instruction set. Note that we can
+// the OpenCL.100.DebugInfo extended instruction set. Note that we can
// ignore the result id of DebugScope instruction because it is not
// used for anything. We do not keep it to reduce the size of
// structure.
@@ -295,6 +308,7 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> {
inline void SetInOperands(OperandList&& new_operands);
// Sets the result type id.
inline void SetResultType(uint32_t ty_id);
+ inline bool HasResultType() const { return has_type_id_; }
// Sets the result id
inline void SetResultId(uint32_t res_id);
inline bool HasResultId() const { return has_result_id_; }
@@ -464,6 +478,10 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> {
// storage buffer.
bool IsVulkanStorageBuffer() const;
+ // Returns true if the instruction defines a variable in StorageBuffer or
+ // Uniform storage class with a pointer type that points to a storage buffer.
+ bool IsVulkanStorageBufferVariable() const;
+
// Returns true if the instruction defines a pointer type that points to a
// uniform buffer.
bool IsVulkanUniformBuffer() const;
@@ -486,10 +504,6 @@ class Instruction : public utils::IntrusiveNodeBase<Instruction> {
// Returns true if this instruction exits this function or aborts execution.
bool IsReturnOrAbort() const { return spvOpcodeIsReturnOrAbort(opcode()); }
- // Returns the id for the |element|'th subtype. If the |this| is not a
- // composite type, this function returns 0.
- uint32_t GetTypeComponent(uint32_t element) const;
-
// Returns true if this instruction is a basic block terminator.
bool IsBlockTerminator() const {
return spvOpcodeIsBlockTerminator(opcode());
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.cpp
index ed34fb0254c..d143d5959fe 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.cpp
@@ -88,6 +88,51 @@ std::unique_ptr<Instruction> InstrumentPass::NewLabel(uint32_t label_id) {
return newLabel;
}
+std::unique_ptr<Instruction> InstrumentPass::NewName(
+ uint32_t id, const std::string& name_str) {
+ std::unique_ptr<Instruction> new_name(new Instruction(
+ context(), SpvOpName, 0, 0,
+ std::initializer_list<Operand>{
+ {SPV_OPERAND_TYPE_ID, {id}},
+ {SPV_OPERAND_TYPE_LITERAL_STRING, utils::MakeVector(name_str)}}));
+
+ return new_name;
+}
+
+std::unique_ptr<Instruction> InstrumentPass::NewGlobalName(
+ uint32_t id, const std::string& name_str) {
+ std::string prefixed_name;
+ switch (validation_id_) {
+ case kInstValidationIdBindless:
+ prefixed_name = "inst_bindless_";
+ break;
+ case kInstValidationIdBuffAddr:
+ prefixed_name = "inst_buff_addr_";
+ break;
+ case kInstValidationIdDebugPrintf:
+ prefixed_name = "inst_printf_";
+ break;
+ default:
+ assert(false); // add new instrumentation pass here
+ prefixed_name = "inst_pass_";
+ break;
+ }
+ prefixed_name += name_str;
+ return NewName(id, prefixed_name);
+}
+
+std::unique_ptr<Instruction> InstrumentPass::NewMemberName(
+ uint32_t id, uint32_t member_index, const std::string& name_str) {
+ std::unique_ptr<Instruction> new_name(new Instruction(
+ context(), SpvOpMemberName, 0, 0,
+ std::initializer_list<Operand>{
+ {SPV_OPERAND_TYPE_ID, {id}},
+ {SPV_OPERAND_TYPE_LITERAL_INTEGER, {member_index}},
+ {SPV_OPERAND_TYPE_LITERAL_STRING, utils::MakeVector(name_str)}}));
+
+ return new_name;
+}
+
uint32_t InstrumentPass::Gen32BitCvtCode(uint32_t val_id,
InstructionBuilder* builder) {
// Convert integer value to 32-bit if necessary
@@ -200,7 +245,9 @@ void InstrumentPass::GenStageStreamWriteCode(uint32_t stage_idx,
} break;
case SpvExecutionModelGLCompute:
case SpvExecutionModelTaskNV:
- case SpvExecutionModelMeshNV: {
+ case SpvExecutionModelMeshNV:
+ case SpvExecutionModelTaskEXT:
+ case SpvExecutionModelMeshEXT: {
// Load and store GlobalInvocationId.
uint32_t load_id = GenVarLoad(
context()->GetBuiltinInputVarId(SpvBuiltInGlobalInvocationId),
@@ -525,6 +572,10 @@ uint32_t InstrumentPass::GetOutputBufferId() {
{{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER,
{SpvStorageClassStorageBuffer}}}));
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(NewGlobalName(output_buffer_id_, "output_buffer"));
deco_mgr->AddDecorationVal(output_buffer_id_, SpvDecorationDescriptorSet,
desc_set_);
deco_mgr->AddDecorationVal(output_buffer_id_, SpvDecorationBinding,
@@ -569,6 +620,9 @@ uint32_t InstrumentPass::GetInputBufferId() {
{{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER,
{SpvStorageClassStorageBuffer}}}));
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,
@@ -783,6 +837,12 @@ uint32_t InstrumentPass::GetStreamWriteFunctionId(uint32_t stage_idx,
get_def_use_mgr()->AnalyzeInstDefUse(&*func_end_inst);
output_func->SetFunctionEnd(std::move(func_end_inst));
context()->AddFunction(std::move(output_func));
+
+ std::string name("stream_write_");
+ name += std::to_string(param_cnt);
+
+ context()->AddDebug2Inst(
+ NewGlobalName(param2output_func_id_[param_cnt], name));
}
return param2output_func_id_[param_cnt];
}
@@ -863,6 +923,11 @@ uint32_t InstrumentPass::GetDirectReadFunctionId(uint32_t param_cnt) {
get_def_use_mgr()->AnalyzeInstDefUse(&*func_end_inst);
input_func->SetFunctionEnd(std::move(func_end_inst));
context()->AddFunction(std::move(input_func));
+
+ std::string name("direct_read_");
+ name += std::to_string(param_cnt);
+ context()->AddDebug2Inst(NewGlobalName(func_id, name));
+
param2input_func_id_[param_cnt] = func_id;
return func_id;
}
@@ -1001,7 +1066,8 @@ bool InstrumentPass::InstProcessEntryPointCallTree(InstProcessFunction& pfn) {
stage != SpvExecutionModelAnyHitNV &&
stage != SpvExecutionModelClosestHitNV &&
stage != SpvExecutionModelMissNV &&
- stage != SpvExecutionModelCallableNV) {
+ stage != SpvExecutionModelCallableNV &&
+ stage != SpvExecutionModelTaskEXT && stage != SpvExecutionModelMeshEXT) {
if (consumer()) {
std::string message = "Stage not supported by instrumentation";
consumer()(SPV_MSG_ERROR, 0, {0, 0, 0}, message.c_str());
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.h
index 12b939d4dc1..215b02635d3 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/instrument_pass.h
@@ -50,7 +50,7 @@
// A validation pass may read or write multiple buffers. All such buffers
// are located in a single debug descriptor set whose index is passed at the
// creation of the instrumentation pass. The bindings of the buffers used by
-// a validation pass are permanantly assigned and fixed and documented by
+// a validation pass are permanently assigned and fixed and documented by
// the kDebugOutput* static consts.
namespace spvtools {
@@ -179,8 +179,8 @@ class InstrumentPass : public Pass {
// the error. Every stage will write a fixed number of words. Vertex shaders
// will write the Vertex and Instance ID. Fragment shaders will write
// FragCoord.xy. Compute shaders will write the GlobalInvocation ID.
- // The tesselation eval shader will write the Primitive ID and TessCoords.uv.
- // The tesselation control shader and geometry shader will write the
+ // The tessellation eval shader will write the Primitive ID and TessCoords.uv.
+ // The tessellation control shader and geometry shader will write the
// Primitive ID and Invocation ID.
//
// The Validation Error Code specifies the exact error which has occurred.
@@ -224,6 +224,19 @@ class InstrumentPass : public Pass {
// Return new label.
std::unique_ptr<Instruction> NewLabel(uint32_t label_id);
+ // Set the name function parameter or local variable
+ std::unique_ptr<Instruction> NewName(uint32_t id,
+ const std::string& name_str);
+
+ // Set the name for a function or global variable, names will be
+ // prefixed to identify which instrumentation pass generated them.
+ std::unique_ptr<Instruction> NewGlobalName(uint32_t id,
+ const std::string& name_str);
+
+ // Set the name for a structure member
+ std::unique_ptr<Instruction> NewMemberName(uint32_t id, uint32_t member_index,
+ const std::string& name_str);
+
// Return id for 32-bit unsigned type
uint32_t GetUintId();
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interface_var_sroa.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interface_var_sroa.cpp
new file mode 100644
index 00000000000..1b2cb3636aa
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interface_var_sroa.cpp
@@ -0,0 +1,968 @@
+// Copyright (c) 2022 Google LLC
+//
+// 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/interface_var_sroa.h"
+
+#include <iostream>
+
+#include "source/opt/decoration_manager.h"
+#include "source/opt/def_use_manager.h"
+#include "source/opt/function.h"
+#include "source/opt/log.h"
+#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 {
+
+// Get the length of the OpTypeArray |array_type|.
+uint32_t GetArrayLength(analysis::DefUseManager* def_use_mgr,
+ Instruction* array_type) {
+ assert(array_type->opcode() == SpvOpTypeArray);
+ 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);
+ return array_length_inst->GetSingleWordInOperand(
+ kOpConstantValueInOperandIndex);
+}
+
+// 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);
+ uint32_t elem_type_id =
+ array_type->GetSingleWordInOperand(kOpTypeArrayElemTypeInOperandIndex);
+ return def_use_mgr->GetDef(elem_type_id);
+}
+
+// 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);
+ uint32_t column_type_id =
+ matrix_type->GetSingleWordInOperand(kOpTypeMatrixColTypeInOperandIndex);
+ return def_use_mgr->GetDef(column_type_id);
+}
+
+// Traverses the component type of OpTypeArray or OpTypeMatrix. Repeats it
+// |depth_to_component| times recursively and returns the component type.
+// |type_id| is the result id of the OpTypeArray or OpTypeMatrix instruction.
+uint32_t GetComponentTypeOfArrayMatrix(analysis::DefUseManager* def_use_mgr,
+ uint32_t type_id,
+ uint32_t depth_to_component) {
+ if (depth_to_component == 0) return type_id;
+
+ Instruction* type_inst = def_use_mgr->GetDef(type_id);
+ if (type_inst->opcode() == SpvOpTypeArray) {
+ 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);
+ uint32_t column_type_id =
+ type_inst->GetSingleWordInOperand(kOpTypeMatrixColTypeInOperandIndex);
+ return GetComponentTypeOfArrayMatrix(def_use_mgr, column_type_id,
+ depth_to_component - 1);
+}
+
+// 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 literal) {
+ std::vector<Operand> operands({
+ {spv_operand_type_t::SPV_OPERAND_TYPE_ID, {var_id}},
+ {spv_operand_type_t::SPV_OPERAND_TYPE_DECORATION,
+ {static_cast<uint32_t>(decoration)}},
+ {spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {literal}},
+ });
+ decoration_mgr->AddDecoration(SpvOpDecorate, std::move(operands));
+}
+
+// Replaces load instructions with composite construct instructions in all the
+// users of the loads. |loads_to_composites| is the mapping from each load to
+// its corresponding OpCompositeConstruct.
+void ReplaceLoadWithCompositeConstruct(
+ IRContext* context,
+ const std::unordered_map<Instruction*, Instruction*>& loads_to_composites) {
+ for (const auto& load_and_composite : loads_to_composites) {
+ Instruction* load = load_and_composite.first;
+ Instruction* composite_construct = load_and_composite.second;
+
+ std::vector<Instruction*> users;
+ context->get_def_use_mgr()->ForEachUse(
+ load, [&users, composite_construct](Instruction* user, uint32_t index) {
+ user->GetOperand(index).words[0] = composite_construct->result_id();
+ users.push_back(user);
+ });
+
+ for (Instruction* user : users)
+ context->get_def_use_mgr()->AnalyzeInstUse(user);
+ }
+}
+
+// Returns the storage class of the instruction |var|.
+SpvStorageClass GetStorageClass(Instruction* var) {
+ return static_cast<SpvStorageClass>(
+ var->GetSingleWordInOperand(kOpVariableStorageClassInOperandIndex));
+}
+
+} // namespace
+
+bool InterfaceVariableScalarReplacement::HasExtraArrayness(
+ Instruction& entry_point, Instruction* var) {
+ SpvExecutionModel execution_model =
+ static_cast<SpvExecutionModel>(entry_point.GetSingleWordInOperand(0));
+ if (execution_model != SpvExecutionModelTessellationEvaluation &&
+ execution_model != SpvExecutionModelTessellationControl) {
+ return false;
+ }
+ if (!context()->get_decoration_mgr()->HasDecoration(var->result_id(),
+ SpvDecorationPatch)) {
+ if (execution_model == SpvExecutionModelTessellationControl) return true;
+ return GetStorageClass(var) != SpvStorageClassOutput;
+ }
+ return false;
+}
+
+bool InterfaceVariableScalarReplacement::
+ CheckExtraArraynessConflictBetweenEntries(Instruction* interface_var,
+ bool has_extra_arrayness) {
+ if (has_extra_arrayness) {
+ return !ReportErrorIfHasNoExtraArraynessForOtherEntry(interface_var);
+ }
+ return !ReportErrorIfHasExtraArraynessForOtherEntry(interface_var);
+}
+
+bool InterfaceVariableScalarReplacement::GetVariableLocation(
+ Instruction* var, uint32_t* location) {
+ return !context()->get_decoration_mgr()->WhileEachDecoration(
+ var->result_id(), SpvDecorationLocation,
+ [location](const Instruction& inst) {
+ *location =
+ inst.GetSingleWordInOperand(kOpDecorateLiteralInOperandIndex);
+ return false;
+ });
+}
+
+bool InterfaceVariableScalarReplacement::GetVariableComponent(
+ Instruction* var, uint32_t* component) {
+ return !context()->get_decoration_mgr()->WhileEachDecoration(
+ var->result_id(), SpvDecorationComponent,
+ [component](const Instruction& inst) {
+ *component =
+ inst.GetSingleWordInOperand(kOpDecorateLiteralInOperandIndex);
+ return false;
+ });
+}
+
+std::vector<Instruction*>
+InterfaceVariableScalarReplacement::CollectInterfaceVariables(
+ Instruction& entry_point) {
+ std::vector<Instruction*> interface_vars;
+ for (uint32_t i = kOpEntryPointInOperandInterface;
+ i < entry_point.NumInOperands(); ++i) {
+ Instruction* interface_var = context()->get_def_use_mgr()->GetDef(
+ entry_point.GetSingleWordInOperand(i));
+ assert(interface_var->opcode() == SpvOpVariable);
+
+ SpvStorageClass storage_class = GetStorageClass(interface_var);
+ if (storage_class != SpvStorageClassInput &&
+ storage_class != SpvStorageClassOutput) {
+ continue;
+ }
+
+ interface_vars.push_back(interface_var);
+ }
+ return interface_vars;
+}
+
+void InterfaceVariableScalarReplacement::KillInstructionAndUsers(
+ Instruction* inst) {
+ if (inst->opcode() == SpvOpEntryPoint) {
+ return;
+ }
+ if (inst->opcode() != SpvOpAccessChain) {
+ context()->KillInst(inst);
+ return;
+ }
+ std::vector<Instruction*> users;
+ context()->get_def_use_mgr()->ForEachUser(
+ inst, [&users](Instruction* user) { users.push_back(user); });
+ for (auto user : users) {
+ context()->KillInst(user);
+ }
+ context()->KillInst(inst);
+}
+
+void InterfaceVariableScalarReplacement::KillInstructionsAndUsers(
+ const std::vector<Instruction*>& insts) {
+ for (Instruction* inst : insts) {
+ KillInstructionAndUsers(inst);
+ }
+}
+
+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;
+ });
+}
+
+bool InterfaceVariableScalarReplacement::ReplaceInterfaceVariableWithScalars(
+ Instruction* interface_var, Instruction* interface_var_type,
+ uint32_t location, uint32_t component, uint32_t extra_array_length) {
+ NestedCompositeComponents scalar_interface_vars =
+ CreateScalarInterfaceVarsForReplacement(interface_var_type,
+ GetStorageClass(interface_var),
+ extra_array_length);
+
+ AddLocationAndComponentDecorations(scalar_interface_vars, &location,
+ component);
+ KillLocationAndComponentDecorations(interface_var->result_id());
+
+ if (!ReplaceInterfaceVarWith(interface_var, extra_array_length,
+ scalar_interface_vars)) {
+ return false;
+ }
+
+ context()->KillInst(interface_var);
+ return true;
+}
+
+bool InterfaceVariableScalarReplacement::ReplaceInterfaceVarWith(
+ Instruction* interface_var, uint32_t extra_array_length,
+ const NestedCompositeComponents& scalar_interface_vars) {
+ std::vector<Instruction*> users;
+ context()->get_def_use_mgr()->ForEachUser(
+ interface_var, [&users](Instruction* user) { users.push_back(user); });
+
+ std::vector<uint32_t> interface_var_component_indices;
+ std::unordered_map<Instruction*, Instruction*> loads_to_composites;
+ std::unordered_map<Instruction*, Instruction*>
+ loads_for_access_chain_to_composites;
+ if (extra_array_length != 0) {
+ // Note that the extra arrayness is the first dimension of the array
+ // interface variable.
+ for (uint32_t index = 0; index < extra_array_length; ++index) {
+ std::unordered_map<Instruction*, Instruction*> loads_to_component_values;
+ if (!ReplaceComponentsOfInterfaceVarWith(
+ interface_var, users, scalar_interface_vars,
+ interface_var_component_indices, &index,
+ &loads_to_component_values,
+ &loads_for_access_chain_to_composites)) {
+ return false;
+ }
+ AddComponentsToCompositesForLoads(loads_to_component_values,
+ &loads_to_composites, 0);
+ }
+ } else if (!ReplaceComponentsOfInterfaceVarWith(
+ interface_var, users, scalar_interface_vars,
+ interface_var_component_indices, nullptr, &loads_to_composites,
+ &loads_for_access_chain_to_composites)) {
+ return false;
+ }
+
+ ReplaceLoadWithCompositeConstruct(context(), loads_to_composites);
+ ReplaceLoadWithCompositeConstruct(context(),
+ loads_for_access_chain_to_composites);
+
+ KillInstructionsAndUsers(users);
+ return true;
+}
+
+void InterfaceVariableScalarReplacement::AddLocationAndComponentDecorations(
+ const NestedCompositeComponents& vars, uint32_t* location,
+ uint32_t component) {
+ if (!vars.HasMultipleComponents()) {
+ uint32_t var_id = vars.GetComponentVariable()->result_id();
+ CreateDecoration(context()->get_decoration_mgr(), var_id,
+ SpvDecorationLocation, *location);
+ CreateDecoration(context()->get_decoration_mgr(), var_id,
+ SpvDecorationComponent, component);
+ ++(*location);
+ return;
+ }
+ for (const auto& var : vars.GetComponents()) {
+ AddLocationAndComponentDecorations(var, location, component);
+ }
+}
+
+bool InterfaceVariableScalarReplacement::ReplaceComponentsOfInterfaceVarWith(
+ Instruction* interface_var,
+ const std::vector<Instruction*>& interface_var_users,
+ const NestedCompositeComponents& scalar_interface_vars,
+ std::vector<uint32_t>& interface_var_component_indices,
+ const uint32_t* extra_array_index,
+ std::unordered_map<Instruction*, Instruction*>* loads_to_composites,
+ std::unordered_map<Instruction*, Instruction*>*
+ loads_for_access_chain_to_composites) {
+ if (!scalar_interface_vars.HasMultipleComponents()) {
+ for (Instruction* interface_var_user : interface_var_users) {
+ if (!ReplaceComponentOfInterfaceVarWith(
+ interface_var, interface_var_user,
+ scalar_interface_vars.GetComponentVariable(),
+ interface_var_component_indices, extra_array_index,
+ loads_to_composites, loads_for_access_chain_to_composites)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ return ReplaceMultipleComponentsOfInterfaceVarWith(
+ interface_var, interface_var_users, scalar_interface_vars.GetComponents(),
+ interface_var_component_indices, extra_array_index, loads_to_composites,
+ loads_for_access_chain_to_composites);
+}
+
+bool InterfaceVariableScalarReplacement::
+ ReplaceMultipleComponentsOfInterfaceVarWith(
+ Instruction* interface_var,
+ const std::vector<Instruction*>& interface_var_users,
+ const std::vector<NestedCompositeComponents>& components,
+ std::vector<uint32_t>& interface_var_component_indices,
+ const uint32_t* extra_array_index,
+ std::unordered_map<Instruction*, Instruction*>* loads_to_composites,
+ std::unordered_map<Instruction*, Instruction*>*
+ loads_for_access_chain_to_composites) {
+ for (uint32_t i = 0; i < components.size(); ++i) {
+ interface_var_component_indices.push_back(i);
+ std::unordered_map<Instruction*, Instruction*> loads_to_component_values;
+ std::unordered_map<Instruction*, Instruction*>
+ loads_for_access_chain_to_component_values;
+ if (!ReplaceComponentsOfInterfaceVarWith(
+ interface_var, interface_var_users, components[i],
+ interface_var_component_indices, extra_array_index,
+ &loads_to_component_values,
+ &loads_for_access_chain_to_component_values)) {
+ return false;
+ }
+ interface_var_component_indices.pop_back();
+
+ uint32_t depth_to_component =
+ static_cast<uint32_t>(interface_var_component_indices.size());
+ AddComponentsToCompositesForLoads(
+ loads_for_access_chain_to_component_values,
+ loads_for_access_chain_to_composites, depth_to_component);
+ if (extra_array_index) ++depth_to_component;
+ AddComponentsToCompositesForLoads(loads_to_component_values,
+ loads_to_composites, depth_to_component);
+ }
+ return true;
+}
+
+bool InterfaceVariableScalarReplacement::ReplaceComponentOfInterfaceVarWith(
+ Instruction* interface_var, Instruction* interface_var_user,
+ Instruction* scalar_var,
+ const std::vector<uint32_t>& interface_var_component_indices,
+ const uint32_t* extra_array_index,
+ std::unordered_map<Instruction*, Instruction*>* loads_to_component_values,
+ std::unordered_map<Instruction*, Instruction*>*
+ loads_for_access_chain_to_component_values) {
+ SpvOp opcode = interface_var_user->opcode();
+ if (opcode == SpvOpStore) {
+ 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) {
+ Instruction* scalar_load =
+ LoadScalarVar(scalar_var, extra_array_index, interface_var_user);
+ loads_to_component_values->insert({interface_var_user, scalar_load});
+ return true;
+ }
+
+ // Copy OpName and annotation instructions only once. Therefore, we create
+ // 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) {
+ CloneAnnotationForVariable(interface_var_user, scalar_var->result_id());
+ return true;
+ }
+
+ if (opcode == SpvOpName) {
+ std::unique_ptr<Instruction> 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) {
+ return ReplaceInterfaceVarInEntryPoint(interface_var, interface_var_user,
+ scalar_var->result_id());
+ }
+
+ if (opcode == SpvOpAccessChain) {
+ ReplaceAccessChainWith(interface_var_user, interface_var_component_indices,
+ scalar_var,
+ loads_for_access_chain_to_component_values);
+ return true;
+ }
+
+ std::string message("Unhandled instruction");
+ message += "\n " + interface_var_user->PrettyPrint(
+ SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+ message +=
+ "\nfor interface variable scalar replacement\n " +
+ interface_var->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+ context()->consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str());
+ return false;
+}
+
+void InterfaceVariableScalarReplacement::UseBaseAccessChainForAccessChain(
+ Instruction* access_chain, Instruction* base_access_chain) {
+ assert(base_access_chain->opcode() == SpvOpAccessChain &&
+ access_chain->opcode() == SpvOpAccessChain &&
+ access_chain->GetSingleWordInOperand(0) ==
+ base_access_chain->result_id());
+ Instruction::OperandList new_operands;
+ for (uint32_t i = 0; i < base_access_chain->NumInOperands(); ++i) {
+ new_operands.emplace_back(base_access_chain->GetInOperand(i));
+ }
+ for (uint32_t i = 1; i < access_chain->NumInOperands(); ++i) {
+ new_operands.emplace_back(access_chain->GetInOperand(i));
+ }
+ access_chain->SetInOperands(std::move(new_operands));
+}
+
+Instruction* InterfaceVariableScalarReplacement::CreateAccessChainToVar(
+ uint32_t var_type_id, Instruction* var,
+ const std::vector<uint32_t>& index_ids, Instruction* insert_before,
+ uint32_t* component_type_id) {
+ analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+ *component_type_id = GetComponentTypeOfArrayMatrix(
+ def_use_mgr, var_type_id, static_cast<uint32_t>(index_ids.size()));
+
+ uint32_t ptr_type_id =
+ GetPointerType(*component_type_id, GetStorageClass(var));
+
+ std::unique_ptr<Instruction> new_access_chain(
+ new Instruction(context(), SpvOpAccessChain, ptr_type_id, TakeNextId(),
+ std::initializer_list<Operand>{
+ {SPV_OPERAND_TYPE_ID, {var->result_id()}}}));
+ for (uint32_t index_id : index_ids) {
+ new_access_chain->AddOperand({SPV_OPERAND_TYPE_ID, {index_id}});
+ }
+
+ Instruction* inst = new_access_chain.get();
+ def_use_mgr->AnalyzeInstDefUse(inst);
+ insert_before->InsertBefore(std::move(new_access_chain));
+ return inst;
+}
+
+Instruction* InterfaceVariableScalarReplacement::CreateAccessChainWithIndex(
+ uint32_t component_type_id, Instruction* var, uint32_t index,
+ 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<Instruction> new_access_chain(
+ new Instruction(context(), SpvOpAccessChain, ptr_type_id, TakeNextId(),
+ std::initializer_list<Operand>{
+ {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));
+ return inst;
+}
+
+void InterfaceVariableScalarReplacement::ReplaceAccessChainWith(
+ Instruction* access_chain,
+ const std::vector<uint32_t>& interface_var_component_indices,
+ Instruction* scalar_var,
+ std::unordered_map<Instruction*, Instruction*>* loads_to_component_values) {
+ std::vector<uint32_t> indexes;
+ for (uint32_t i = 1; i < access_chain->NumInOperands(); ++i) {
+ indexes.push_back(access_chain->GetSingleWordInOperand(i));
+ }
+
+ // Note that we have a strong assumption that |access_chain| has only a single
+ // index that is for the extra arrayness.
+ context()->get_def_use_mgr()->ForEachUser(
+ access_chain,
+ [this, access_chain, &indexes, &interface_var_component_indices,
+ scalar_var, loads_to_component_values](Instruction* user) {
+ switch (user->opcode()) {
+ case SpvOpAccessChain: {
+ UseBaseAccessChainForAccessChain(user, access_chain);
+ ReplaceAccessChainWith(user, interface_var_component_indices,
+ scalar_var, loads_to_component_values);
+ return;
+ }
+ case SpvOpStore: {
+ uint32_t value_id = user->GetSingleWordInOperand(1);
+ StoreComponentOfValueToAccessChainToScalarVar(
+ value_id, interface_var_component_indices, scalar_var, indexes,
+ user);
+ return;
+ }
+ case SpvOpLoad: {
+ Instruction* value =
+ LoadAccessChainToVar(scalar_var, indexes, user);
+ loads_to_component_values->insert({user, value});
+ return;
+ }
+ default:
+ break;
+ }
+ });
+}
+
+void InterfaceVariableScalarReplacement::CloneAnnotationForVariable(
+ Instruction* annotation_inst, uint32_t var_id) {
+ assert(annotation_inst->opcode() == SpvOpDecorate ||
+ annotation_inst->opcode() == SpvOpDecorateId ||
+ annotation_inst->opcode() == SpvOpDecorateString);
+ std::unique_ptr<Instruction> new_inst(annotation_inst->Clone(context()));
+ new_inst->SetInOperand(0, {var_id});
+ context()->AddAnnotationInst(std::move(new_inst));
+}
+
+bool InterfaceVariableScalarReplacement::ReplaceInterfaceVarInEntryPoint(
+ Instruction* interface_var, Instruction* entry_point,
+ uint32_t scalar_var_id) {
+ analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+ uint32_t interface_var_id = interface_var->result_id();
+ if (interface_vars_removed_from_entry_point_operands_.find(
+ interface_var_id) !=
+ interface_vars_removed_from_entry_point_operands_.end()) {
+ entry_point->AddOperand({SPV_OPERAND_TYPE_ID, {scalar_var_id}});
+ def_use_mgr->AnalyzeInstUse(entry_point);
+ return true;
+ }
+
+ bool success = !entry_point->WhileEachInId(
+ [&interface_var_id, &scalar_var_id](uint32_t* id) {
+ if (*id == interface_var_id) {
+ *id = scalar_var_id;
+ return false;
+ }
+ return true;
+ });
+ if (!success) {
+ std::string message(
+ "interface variable is not an operand of the entry point");
+ message += "\n " + interface_var->PrettyPrint(
+ SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+ message += "\n " + entry_point->PrettyPrint(
+ SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+ context()->consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str());
+ return false;
+ }
+
+ def_use_mgr->AnalyzeInstUse(entry_point);
+ interface_vars_removed_from_entry_point_operands_.insert(interface_var_id);
+ return true;
+}
+
+uint32_t InterfaceVariableScalarReplacement::GetPointeeTypeIdOfVar(
+ Instruction* var) {
+ assert(var->opcode() == SpvOpVariable);
+
+ 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 &&
+ "Variable must have a pointer type.");
+ return ptr_type_inst->GetSingleWordInOperand(kOpTypePtrTypeInOperandIndex);
+}
+
+void InterfaceVariableScalarReplacement::StoreComponentOfValueToScalarVar(
+ uint32_t value_id, const std::vector<uint32_t>& component_indices,
+ Instruction* scalar_var, const uint32_t* extra_array_index,
+ Instruction* insert_before) {
+ uint32_t component_type_id = GetPointeeTypeIdOfVar(scalar_var);
+ Instruction* ptr = scalar_var;
+ if (extra_array_index) {
+ auto* ty_mgr = context()->get_type_mgr();
+ analysis::Array* array_type = ty_mgr->GetType(component_type_id)->AsArray();
+ assert(array_type != nullptr);
+ component_type_id = ty_mgr->GetTypeInstruction(array_type->element_type());
+ ptr = CreateAccessChainWithIndex(component_type_id, scalar_var,
+ *extra_array_index, insert_before);
+ }
+
+ StoreComponentOfValueTo(component_type_id, value_id, component_indices, ptr,
+ extra_array_index, insert_before);
+}
+
+Instruction* InterfaceVariableScalarReplacement::LoadScalarVar(
+ Instruction* scalar_var, const uint32_t* extra_array_index,
+ Instruction* insert_before) {
+ uint32_t component_type_id = GetPointeeTypeIdOfVar(scalar_var);
+ Instruction* ptr = scalar_var;
+ if (extra_array_index) {
+ auto* ty_mgr = context()->get_type_mgr();
+ analysis::Array* array_type = ty_mgr->GetType(component_type_id)->AsArray();
+ assert(array_type != nullptr);
+ component_type_id = ty_mgr->GetTypeInstruction(array_type->element_type());
+ ptr = CreateAccessChainWithIndex(component_type_id, scalar_var,
+ *extra_array_index, insert_before);
+ }
+
+ return CreateLoad(component_type_id, ptr, insert_before);
+}
+
+Instruction* InterfaceVariableScalarReplacement::CreateLoad(
+ uint32_t type_id, Instruction* ptr, Instruction* insert_before) {
+ std::unique_ptr<Instruction> load(
+ new Instruction(context(), SpvOpLoad, type_id, TakeNextId(),
+ std::initializer_list<Operand>{
+ {SPV_OPERAND_TYPE_ID, {ptr->result_id()}}}));
+ Instruction* load_inst = load.get();
+ context()->get_def_use_mgr()->AnalyzeInstDefUse(load_inst);
+ insert_before->InsertBefore(std::move(load));
+ return load_inst;
+}
+
+void InterfaceVariableScalarReplacement::StoreComponentOfValueTo(
+ uint32_t component_type_id, uint32_t value_id,
+ const std::vector<uint32_t>& component_indices, Instruction* ptr,
+ const uint32_t* extra_array_index, Instruction* insert_before) {
+ std::unique_ptr<Instruction> composite_extract(CreateCompositeExtract(
+ component_type_id, value_id, component_indices, extra_array_index));
+
+ std::unique_ptr<Instruction> new_store(
+ new Instruction(context(), SpvOpStore));
+ new_store->AddOperand({SPV_OPERAND_TYPE_ID, {ptr->result_id()}});
+ new_store->AddOperand(
+ {SPV_OPERAND_TYPE_ID, {composite_extract->result_id()}});
+
+ analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+ def_use_mgr->AnalyzeInstDefUse(composite_extract.get());
+ def_use_mgr->AnalyzeInstDefUse(new_store.get());
+
+ insert_before->InsertBefore(std::move(composite_extract));
+ insert_before->InsertBefore(std::move(new_store));
+}
+
+Instruction* InterfaceVariableScalarReplacement::CreateCompositeExtract(
+ uint32_t type_id, uint32_t composite_id,
+ const std::vector<uint32_t>& indexes, const uint32_t* extra_first_index) {
+ uint32_t component_id = TakeNextId();
+ Instruction* composite_extract = new Instruction(
+ context(), SpvOpCompositeExtract, type_id, component_id,
+ std::initializer_list<Operand>{{SPV_OPERAND_TYPE_ID, {composite_id}}});
+ if (extra_first_index) {
+ composite_extract->AddOperand(
+ {SPV_OPERAND_TYPE_LITERAL_INTEGER, {*extra_first_index}});
+ }
+ for (uint32_t index : indexes) {
+ composite_extract->AddOperand({SPV_OPERAND_TYPE_LITERAL_INTEGER, {index}});
+ }
+ return composite_extract;
+}
+
+void InterfaceVariableScalarReplacement::
+ StoreComponentOfValueToAccessChainToScalarVar(
+ uint32_t value_id, const std::vector<uint32_t>& component_indices,
+ Instruction* scalar_var,
+ const std::vector<uint32_t>& access_chain_indices,
+ Instruction* insert_before) {
+ uint32_t component_type_id = GetPointeeTypeIdOfVar(scalar_var);
+ Instruction* ptr = scalar_var;
+ if (!access_chain_indices.empty()) {
+ ptr = CreateAccessChainToVar(component_type_id, scalar_var,
+ access_chain_indices, insert_before,
+ &component_type_id);
+ }
+
+ StoreComponentOfValueTo(component_type_id, value_id, component_indices, ptr,
+ nullptr, insert_before);
+}
+
+Instruction* InterfaceVariableScalarReplacement::LoadAccessChainToVar(
+ Instruction* var, const std::vector<uint32_t>& indexes,
+ Instruction* insert_before) {
+ uint32_t component_type_id = GetPointeeTypeIdOfVar(var);
+ Instruction* ptr = var;
+ if (!indexes.empty()) {
+ ptr = CreateAccessChainToVar(component_type_id, var, indexes, insert_before,
+ &component_type_id);
+ }
+
+ return CreateLoad(component_type_id, ptr, insert_before);
+}
+
+Instruction*
+InterfaceVariableScalarReplacement::CreateCompositeConstructForComponentOfLoad(
+ Instruction* load, uint32_t depth_to_component) {
+ analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+ uint32_t type_id = load->type_id();
+ if (depth_to_component != 0) {
+ type_id = GetComponentTypeOfArrayMatrix(def_use_mgr, load->type_id(),
+ depth_to_component);
+ }
+ uint32_t new_id = context()->TakeNextId();
+ std::unique_ptr<Instruction> new_composite_construct(
+ new Instruction(context(), SpvOpCompositeConstruct, type_id, new_id, {}));
+ Instruction* composite_construct = new_composite_construct.get();
+ def_use_mgr->AnalyzeInstDefUse(composite_construct);
+
+ // Insert |new_composite_construct| after |load|. When there are multiple
+ // recursive composite construct instructions for a load, we have to place the
+ // composite construct with a lower depth later because it constructs the
+ // composite that contains other composites with lower depths.
+ auto* insert_before = load->NextNode();
+ while (true) {
+ auto itr =
+ composite_ids_to_component_depths.find(insert_before->result_id());
+ if (itr == composite_ids_to_component_depths.end()) break;
+ if (itr->second <= depth_to_component) break;
+ insert_before = insert_before->NextNode();
+ }
+ insert_before->InsertBefore(std::move(new_composite_construct));
+ composite_ids_to_component_depths.insert({new_id, depth_to_component});
+ return composite_construct;
+}
+
+void InterfaceVariableScalarReplacement::AddComponentsToCompositesForLoads(
+ const std::unordered_map<Instruction*, Instruction*>&
+ loads_to_component_values,
+ std::unordered_map<Instruction*, Instruction*>* loads_to_composites,
+ uint32_t depth_to_component) {
+ analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+ for (auto& load_and_component_vale : loads_to_component_values) {
+ Instruction* load = load_and_component_vale.first;
+ Instruction* component_value = load_and_component_vale.second;
+ Instruction* composite_construct = nullptr;
+ auto itr = loads_to_composites->find(load);
+ if (itr == loads_to_composites->end()) {
+ composite_construct =
+ CreateCompositeConstructForComponentOfLoad(load, depth_to_component);
+ loads_to_composites->insert({load, composite_construct});
+ } else {
+ composite_construct = itr->second;
+ }
+ composite_construct->AddOperand(
+ {SPV_OPERAND_TYPE_ID, {component_value->result_id()}});
+ def_use_mgr->AnalyzeInstDefUse(composite_construct);
+ }
+}
+
+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);
+ analysis::Array array_type(
+ elem_type,
+ analysis::Array::LengthInfo{array_length_id, {0, array_length}});
+ return context()->get_type_mgr()->GetTypeInstruction(&array_type);
+}
+
+uint32_t InterfaceVariableScalarReplacement::GetPointerType(
+ uint32_t type_id, SpvStorageClass 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);
+}
+
+InterfaceVariableScalarReplacement::NestedCompositeComponents
+InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForArray(
+ Instruction* interface_var_type, SpvStorageClass storage_class,
+ uint32_t extra_array_length) {
+ assert(interface_var_type->opcode() == SpvOpTypeArray);
+
+ analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+ uint32_t array_length = GetArrayLength(def_use_mgr, interface_var_type);
+ Instruction* elem_type = GetArrayElementType(def_use_mgr, interface_var_type);
+
+ NestedCompositeComponents scalar_vars;
+ while (array_length > 0) {
+ NestedCompositeComponents scalar_vars_for_element =
+ CreateScalarInterfaceVarsForReplacement(elem_type, storage_class,
+ extra_array_length);
+ scalar_vars.AddComponent(scalar_vars_for_element);
+ --array_length;
+ }
+ return scalar_vars;
+}
+
+InterfaceVariableScalarReplacement::NestedCompositeComponents
+InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForMatrix(
+ Instruction* interface_var_type, SpvStorageClass storage_class,
+ uint32_t extra_array_length) {
+ assert(interface_var_type->opcode() == SpvOpTypeMatrix);
+
+ analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+ uint32_t column_count = interface_var_type->GetSingleWordInOperand(
+ kOpTypeMatrixColCountInOperandIndex);
+ Instruction* column_type =
+ GetMatrixColumnType(def_use_mgr, interface_var_type);
+
+ NestedCompositeComponents scalar_vars;
+ while (column_count > 0) {
+ NestedCompositeComponents scalar_vars_for_column =
+ CreateScalarInterfaceVarsForReplacement(column_type, storage_class,
+ extra_array_length);
+ scalar_vars.AddComponent(scalar_vars_for_column);
+ --column_count;
+ }
+ return scalar_vars;
+}
+
+InterfaceVariableScalarReplacement::NestedCompositeComponents
+InterfaceVariableScalarReplacement::CreateScalarInterfaceVarsForReplacement(
+ Instruction* interface_var_type, SpvStorageClass storage_class,
+ uint32_t extra_array_length) {
+ // Handle array case.
+ if (interface_var_type->opcode() == SpvOpTypeArray) {
+ return CreateScalarInterfaceVarsForArray(interface_var_type, storage_class,
+ extra_array_length);
+ }
+
+ // Handle matrix case.
+ if (interface_var_type->opcode() == SpvOpTypeMatrix) {
+ return CreateScalarInterfaceVarsForMatrix(interface_var_type, storage_class,
+ extra_array_length);
+ }
+
+ // Handle scalar or vector case.
+ NestedCompositeComponents scalar_var;
+ uint32_t type_id = interface_var_type->result_id();
+ if (extra_array_length != 0) {
+ type_id = GetArrayType(type_id, extra_array_length);
+ }
+ uint32_t ptr_type_id =
+ context()->get_type_mgr()->FindPointerToType(type_id, storage_class);
+ uint32_t id = TakeNextId();
+ std::unique_ptr<Instruction> variable(
+ new Instruction(context(), SpvOpVariable, ptr_type_id, id,
+ std::initializer_list<Operand>{
+ {SPV_OPERAND_TYPE_STORAGE_CLASS,
+ {static_cast<uint32_t>(storage_class)}}}));
+ scalar_var.SetSingleComponentVariable(variable.get());
+ context()->AddGlobalValue(std::move(variable));
+ return scalar_var;
+}
+
+Instruction* InterfaceVariableScalarReplacement::GetTypeOfVariable(
+ Instruction* var) {
+ uint32_t pointee_type_id = GetPointeeTypeIdOfVar(var);
+ analysis::DefUseManager* def_use_mgr = context()->get_def_use_mgr();
+ return def_use_mgr->GetDef(pointee_type_id);
+}
+
+Pass::Status InterfaceVariableScalarReplacement::Process() {
+ Pass::Status status = Status::SuccessWithoutChange;
+ for (Instruction& entry_point : get_module()->entry_points()) {
+ status =
+ CombineStatus(status, ReplaceInterfaceVarsWithScalars(entry_point));
+ }
+ return status;
+}
+
+bool InterfaceVariableScalarReplacement::
+ ReportErrorIfHasExtraArraynessForOtherEntry(Instruction* var) {
+ if (vars_with_extra_arrayness.find(var) == vars_with_extra_arrayness.end())
+ return false;
+
+ std::string message(
+ "A variable is arrayed for an entry point but it is not "
+ "arrayed for another entry point");
+ message +=
+ "\n " + var->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+ context()->consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str());
+ return true;
+}
+
+bool InterfaceVariableScalarReplacement::
+ ReportErrorIfHasNoExtraArraynessForOtherEntry(Instruction* var) {
+ if (vars_without_extra_arrayness.find(var) ==
+ vars_without_extra_arrayness.end())
+ return false;
+
+ std::string message(
+ "A variable is not arrayed for an entry point but it is "
+ "arrayed for another entry point");
+ message +=
+ "\n " + var->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
+ context()->consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str());
+ return true;
+}
+
+Pass::Status
+InterfaceVariableScalarReplacement::ReplaceInterfaceVarsWithScalars(
+ Instruction& entry_point) {
+ std::vector<Instruction*> interface_vars =
+ CollectInterfaceVariables(entry_point);
+
+ Pass::Status status = Status::SuccessWithoutChange;
+ for (Instruction* interface_var : interface_vars) {
+ uint32_t location, component;
+ if (!GetVariableLocation(interface_var, &location)) continue;
+ if (!GetVariableComponent(interface_var, &component)) component = 0;
+
+ Instruction* interface_var_type = GetTypeOfVariable(interface_var);
+ uint32_t extra_array_length = 0;
+ if (HasExtraArrayness(entry_point, interface_var)) {
+ extra_array_length =
+ GetArrayLength(context()->get_def_use_mgr(), interface_var_type);
+ interface_var_type =
+ GetArrayElementType(context()->get_def_use_mgr(), interface_var_type);
+ vars_with_extra_arrayness.insert(interface_var);
+ } else {
+ vars_without_extra_arrayness.insert(interface_var);
+ }
+
+ if (!CheckExtraArraynessConflictBetweenEntries(interface_var,
+ extra_array_length != 0)) {
+ return Pass::Status::Failure;
+ }
+
+ if (interface_var_type->opcode() != SpvOpTypeArray &&
+ interface_var_type->opcode() != SpvOpTypeMatrix) {
+ continue;
+ }
+
+ if (!ReplaceInterfaceVariableWithScalars(interface_var, interface_var_type,
+ location, component,
+ extra_array_length)) {
+ return Pass::Status::Failure;
+ }
+ status = Pass::Status::SuccessWithChange;
+ }
+
+ return status;
+}
+
+} // namespace opt
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interface_var_sroa.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interface_var_sroa.h
new file mode 100644
index 00000000000..23baad0ad38
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interface_var_sroa.h
@@ -0,0 +1,401 @@
+// Copyright (c) 2022 Google LLC
+//
+// 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_INTERFACE_VAR_SROA_H_
+#define SOURCE_OPT_INTERFACE_VAR_SROA_H_
+
+#include <unordered_set>
+
+#include "source/opt/pass.h"
+
+namespace spvtools {
+namespace opt {
+
+// See optimizer.hpp for documentation.
+//
+// Note that the current implementation of this pass covers only store, load,
+// access chain instructions for the interface variables. Supporting other types
+// of instructions is a future work.
+class InterfaceVariableScalarReplacement : public Pass {
+ public:
+ InterfaceVariableScalarReplacement() {}
+
+ const char* name() const override {
+ return "interface-variable-scalar-replacement";
+ }
+ Status Process() override;
+
+ IRContext::Analysis GetPreservedAnalyses() override {
+ return IRContext::kAnalysisDecorations | IRContext::kAnalysisDefUse |
+ IRContext::kAnalysisConstants | IRContext::kAnalysisTypes;
+ }
+
+ private:
+ // A struct containing components of a composite variable. If the composite
+ // consists of multiple or recursive components, |component_variable| is
+ // nullptr and |nested_composite_components| keeps the components. If it has a
+ // single component, |nested_composite_components| is empty and
+ // |component_variable| is the component. Note that each element of
+ // |nested_composite_components| has the NestedCompositeComponents struct as
+ // its type that can recursively keep the components.
+ struct NestedCompositeComponents {
+ NestedCompositeComponents() : component_variable(nullptr) {}
+
+ bool HasMultipleComponents() const {
+ return !nested_composite_components.empty();
+ }
+
+ const std::vector<NestedCompositeComponents>& GetComponents() const {
+ return nested_composite_components;
+ }
+
+ void AddComponent(const NestedCompositeComponents& component) {
+ nested_composite_components.push_back(component);
+ }
+
+ Instruction* GetComponentVariable() const { return component_variable; }
+
+ void SetSingleComponentVariable(Instruction* var) {
+ component_variable = var;
+ }
+
+ private:
+ std::vector<NestedCompositeComponents> nested_composite_components;
+ Instruction* component_variable;
+ };
+
+ // Collects all interface variables used by the |entry_point|.
+ std::vector<Instruction*> CollectInterfaceVariables(Instruction& entry_point);
+
+ // Returns whether |var| has the extra arrayness for the entry point
+ // |entry_point| or not.
+ bool HasExtraArrayness(Instruction& entry_point, Instruction* var);
+
+ // Finds a Location BuiltIn decoration of |var| and returns it via
+ // |location|. Returns true whether the location exists or not.
+ bool GetVariableLocation(Instruction* var, uint32_t* location);
+
+ // Finds a Component BuiltIn decoration of |var| and returns it via
+ // |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);
+
+ // Replaces an interface variable |interface_var| whose type is
+ // |interface_var_type| with scalars and returns whether it succeeds or not.
+ // |location| is the value of Location Decoration for |interface_var|.
+ // |component| is the value of Component Decoration for |interface_var|.
+ // If |extra_array_length| is 0, it means |interface_var| has a Patch
+ // decoration. Otherwise, |extra_array_length| denotes the length of the extra
+ // array of |interface_var|.
+ bool ReplaceInterfaceVariableWithScalars(Instruction* interface_var,
+ Instruction* interface_var_type,
+ uint32_t location,
+ uint32_t component,
+ uint32_t extra_array_length);
+
+ // Creates scalar variables with the storage classe |storage_class| to replace
+ // an interface variable whose type is |interface_var_type|. If
+ // |extra_array_length| is not zero, adds the extra arrayness to the created
+ // scalar variables.
+ NestedCompositeComponents CreateScalarInterfaceVarsForReplacement(
+ Instruction* interface_var_type, SpvStorageClass storage_class,
+ uint32_t extra_array_length);
+
+ // Creates scalar variables with the storage classe |storage_class| to replace
+ // the interface variable whose type is OpTypeArray |interface_var_type| with.
+ // 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,
+ uint32_t extra_array_length);
+
+ // Creates scalar variables with the storage classe |storage_class| to replace
+ // the interface variable whose type is OpTypeMatrix |interface_var_type|
+ // 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,
+ uint32_t extra_array_length);
+
+ // Recursively adds Location and Component decorations to variables in
+ // |vars| with |location| and |component|. Increases |location| by one after
+ // it actually adds Location and Component decorations for a variable.
+ void AddLocationAndComponentDecorations(const NestedCompositeComponents& vars,
+ uint32_t* location,
+ uint32_t component);
+
+ // Replaces the interface variable |interface_var| with
+ // |scalar_interface_vars| and returns whether it succeeds or not.
+ // |extra_arrayness| is the extra arrayness of the interface variable.
+ // |scalar_interface_vars| contains the nested variables to replace the
+ // interface variable with.
+ bool ReplaceInterfaceVarWith(
+ Instruction* interface_var, uint32_t extra_arrayness,
+ const NestedCompositeComponents& scalar_interface_vars);
+
+ // Replaces |interface_var| in the operands of instructions
+ // |interface_var_users| with |scalar_interface_vars|. This is a recursive
+ // method and |interface_var_component_indices| is used to specify which
+ // recursive component of |interface_var| is replaced. Returns composite
+ // construct instructions to be replaced with load instructions of
+ // |interface_var_users| via |loads_to_composites|. Returns composite
+ // construct instructions to be replaced with load instructions of access
+ // chain instructions in |interface_var_users| via
+ // |loads_for_access_chain_to_composites|.
+ bool ReplaceComponentsOfInterfaceVarWith(
+ Instruction* interface_var,
+ const std::vector<Instruction*>& interface_var_users,
+ const NestedCompositeComponents& scalar_interface_vars,
+ std::vector<uint32_t>& interface_var_component_indices,
+ const uint32_t* extra_array_index,
+ std::unordered_map<Instruction*, Instruction*>* loads_to_composites,
+ std::unordered_map<Instruction*, Instruction*>*
+ loads_for_access_chain_to_composites);
+
+ // Replaces |interface_var| in the operands of instructions
+ // |interface_var_users| with |components| that is a vector of components for
+ // the interface variable |interface_var|. This is a recursive method and
+ // |interface_var_component_indices| is used to specify which recursive
+ // component of |interface_var| is replaced. Returns composite construct
+ // instructions to be replaced with load instructions of |interface_var_users|
+ // via |loads_to_composites|. Returns composite construct instructions to be
+ // replaced with load instructions of access chain instructions in
+ // |interface_var_users| via |loads_for_access_chain_to_composites|.
+ bool ReplaceMultipleComponentsOfInterfaceVarWith(
+ Instruction* interface_var,
+ const std::vector<Instruction*>& interface_var_users,
+ const std::vector<NestedCompositeComponents>& components,
+ std::vector<uint32_t>& interface_var_component_indices,
+ const uint32_t* extra_array_index,
+ std::unordered_map<Instruction*, Instruction*>* loads_to_composites,
+ std::unordered_map<Instruction*, Instruction*>*
+ loads_for_access_chain_to_composites);
+
+ // Replaces a component of |interface_var| that is used as an operand of
+ // instruction |interface_var_user| with |scalar_var|.
+ // |interface_var_component_indices| is a vector of recursive indices for
+ // which recursive component of |interface_var| is replaced. If
+ // |interface_var_user| is a load, returns the component value via
+ // |loads_to_component_values|. If |interface_var_user| is an access chain,
+ // returns the component value for loads of |interface_var_user| via
+ // |loads_for_access_chain_to_component_values|.
+ bool ReplaceComponentOfInterfaceVarWith(
+ Instruction* interface_var, Instruction* interface_var_user,
+ Instruction* scalar_var,
+ const std::vector<uint32_t>& interface_var_component_indices,
+ const uint32_t* extra_array_index,
+ std::unordered_map<Instruction*, Instruction*>* loads_to_component_values,
+ std::unordered_map<Instruction*, Instruction*>*
+ loads_for_access_chain_to_component_values);
+
+ // Creates instructions to load |scalar_var| and inserts them before
+ // |insert_before|. If |extra_array_index| is not null, they load
+ // |extra_array_index| th component of |scalar_var| instead of |scalar_var|
+ // itself.
+ Instruction* LoadScalarVar(Instruction* scalar_var,
+ const uint32_t* extra_array_index,
+ Instruction* insert_before);
+
+ // Creates instructions to load an access chain to |var| and inserts them
+ // before |insert_before|. |Indexes| will be Indexes operand of the access
+ // chain.
+ Instruction* LoadAccessChainToVar(Instruction* var,
+ const std::vector<uint32_t>& indexes,
+ Instruction* insert_before);
+
+ // Creates instructions to store a component of an aggregate whose id is
+ // |value_id| to an access chain to |scalar_var| and inserts the created
+ // instructions before |insert_before|. To get the component, recursively
+ // traverses the aggregate with |component_indices| as indexes.
+ // Numbers in |access_chain_indices| are the Indexes operand of the access
+ // chain to |scalar_var|
+ void StoreComponentOfValueToAccessChainToScalarVar(
+ uint32_t value_id, const std::vector<uint32_t>& component_indices,
+ Instruction* scalar_var,
+ const std::vector<uint32_t>& access_chain_indices,
+ Instruction* insert_before);
+
+ // Creates instructions to store a component of an aggregate whose id is
+ // |value_id| to |scalar_var| and inserts the created instructions before
+ // |insert_before|. To get the component, recursively traverses the aggregate
+ // using |extra_array_index| and |component_indices| as indexes.
+ void StoreComponentOfValueToScalarVar(
+ uint32_t value_id, const std::vector<uint32_t>& component_indices,
+ Instruction* scalar_var, const uint32_t* extra_array_index,
+ Instruction* insert_before);
+
+ // Creates instructions to store a component of an aggregate whose id is
+ // |value_id| to |ptr| and inserts the created instructions before
+ // |insert_before|. To get the component, recursively traverses the aggregate
+ // using |extra_array_index| and |component_indices| as indexes.
+ // |component_type_id| is the id of the type instruction of the component.
+ void StoreComponentOfValueTo(uint32_t component_type_id, uint32_t value_id,
+ const std::vector<uint32_t>& component_indices,
+ Instruction* ptr,
+ const uint32_t* extra_array_index,
+ Instruction* insert_before);
+
+ // Creates new OpCompositeExtract with |type_id| for Result Type,
+ // |composite_id| for Composite operand, and |indexes| for Indexes operands.
+ // If |extra_first_index| is not nullptr, uses it as the first Indexes
+ // operand.
+ Instruction* CreateCompositeExtract(uint32_t type_id, uint32_t composite_id,
+ const std::vector<uint32_t>& indexes,
+ const uint32_t* extra_first_index);
+
+ // Creates a new OpLoad whose Result Type is |type_id| and Pointer operand is
+ // |ptr|. Inserts the new instruction before |insert_before|.
+ Instruction* CreateLoad(uint32_t type_id, Instruction* ptr,
+ Instruction* insert_before);
+
+ // Clones an annotation instruction |annotation_inst| and sets the target
+ // operand of the new annotation instruction as |var_id|.
+ void CloneAnnotationForVariable(Instruction* annotation_inst,
+ uint32_t var_id);
+
+ // Replaces the interface variable |interface_var| in the operands of the
+ // entry point |entry_point| with |scalar_var_id|. If it cannot find
+ // |interface_var| from the operands of the entry point |entry_point|, adds
+ // |scalar_var_id| as an operand of the entry point |entry_point|.
+ bool ReplaceInterfaceVarInEntryPoint(Instruction* interface_var,
+ Instruction* entry_point,
+ uint32_t scalar_var_id);
+
+ // Creates an access chain instruction whose Base operand is |var| and Indexes
+ // operand is |index|. |component_type_id| is the id of the type instruction
+ // that is the type of component. Inserts the new access chain before
+ // |insert_before|.
+ Instruction* CreateAccessChainWithIndex(uint32_t component_type_id,
+ Instruction* var, uint32_t index,
+ Instruction* insert_before);
+
+ // Returns the pointee type of the type of variable |var|.
+ uint32_t GetPointeeTypeIdOfVar(Instruction* var);
+
+ // Replaces the access chain |access_chain| and its users with a new access
+ // chain that points |scalar_var| as the Base operand having
+ // |interface_var_component_indices| as Indexes operands and users of the new
+ // access chain. When some of the users are load instructions, returns the
+ // original load instruction to the new instruction that loads a component of
+ // the original load value via |loads_to_component_values|.
+ void ReplaceAccessChainWith(
+ Instruction* access_chain,
+ const std::vector<uint32_t>& interface_var_component_indices,
+ Instruction* scalar_var,
+ std::unordered_map<Instruction*, Instruction*>*
+ loads_to_component_values);
+
+ // Assuming that |access_chain| is an access chain instruction whose Base
+ // operand is |base_access_chain|, replaces the operands of |access_chain|
+ // with operands of |base_access_chain| and Indexes operands of
+ // |access_chain|.
+ void UseBaseAccessChainForAccessChain(Instruction* access_chain,
+ Instruction* base_access_chain);
+
+ // Creates composite construct instructions for load instructions that are the
+ // keys of |loads_to_component_values| if no such composite construct
+ // instructions exist. Adds a component of the composite as an operand of the
+ // created composite construct instruction. Each value of
+ // |loads_to_component_values| is the component. Returns the created composite
+ // construct instructions using |loads_to_composites|. |depth_to_component| is
+ // the number of recursive access steps to get the component from the
+ // composite.
+ void AddComponentsToCompositesForLoads(
+ const std::unordered_map<Instruction*, Instruction*>&
+ loads_to_component_values,
+ std::unordered_map<Instruction*, Instruction*>* loads_to_composites,
+ uint32_t depth_to_component);
+
+ // Creates a composite construct instruction for a component of the value of
+ // instruction |load| in |depth_to_component| th recursive depth and inserts
+ // it after |load|.
+ Instruction* CreateCompositeConstructForComponentOfLoad(
+ Instruction* load, uint32_t depth_to_component);
+
+ // Creates a new access chain instruction that points to variable |var| whose
+ // type is the instruction with |var_type_id| and inserts it before
+ // |insert_before|. The new access chain will have |index_ids| for Indexes
+ // operands. Returns the type id of the component that is pointed by the new
+ // access chain via |component_type_id|.
+ Instruction* CreateAccessChainToVar(uint32_t var_type_id, Instruction* var,
+ const std::vector<uint32_t>& index_ids,
+ Instruction* insert_before,
+ uint32_t* component_type_id);
+
+ // Returns the result id of OpTypeArray instrunction whose Element Type
+ // operand is |elem_type_id| and Length operand is |array_length|.
+ uint32_t GetArrayType(uint32_t elem_type_id, uint32_t array_length);
+
+ // 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);
+
+ // Kills an instrunction |inst| and its users.
+ void KillInstructionAndUsers(Instruction* inst);
+
+ // Kills a vector of instrunctions |insts| and their users.
+ void KillInstructionsAndUsers(const std::vector<Instruction*>& insts);
+
+ // Kills all OpDecorate instructions for Location and Component of the
+ // variable whose id is |var_id|.
+ void KillLocationAndComponentDecorations(uint32_t var_id);
+
+ // If |var| has the extra arrayness for an entry point, reports an error and
+ // returns true. Otherwise, returns false.
+ bool ReportErrorIfHasExtraArraynessForOtherEntry(Instruction* var);
+
+ // If |var| does not have the extra arrayness for an entry point, reports an
+ // error and returns true. Otherwise, returns false.
+ bool ReportErrorIfHasNoExtraArraynessForOtherEntry(Instruction* var);
+
+ // If |interface_var| has the extra arrayness for an entry point but it does
+ // not have one for another entry point, reports an error and returns false.
+ // Otherwise, returns true. |has_extra_arrayness| denotes whether it has an
+ // extra arrayness for an entry point or not.
+ bool CheckExtraArraynessConflictBetweenEntries(Instruction* interface_var,
+ bool has_extra_arrayness);
+
+ // Conducts the scalar replacement for the interface variables used by the
+ // |entry_point|.
+ Pass::Status ReplaceInterfaceVarsWithScalars(Instruction& entry_point);
+
+ // A set of interface variable ids that were already removed from operands of
+ // the entry point.
+ std::unordered_set<uint32_t>
+ interface_vars_removed_from_entry_point_operands_;
+
+ // A mapping from ids of new composite construct instructions that load
+ // instructions are replaced with to the recursive depth of the component of
+ // load that the new component construct instruction is used for.
+ std::unordered_map<uint32_t, uint32_t> composite_ids_to_component_depths;
+
+ // A set of interface variables with the extra arrayness for any of the entry
+ // points.
+ std::unordered_set<Instruction*> vars_with_extra_arrayness;
+
+ // A set of interface variables without the extra arrayness for any of the
+ // entry points.
+ std::unordered_set<Instruction*> vars_without_extra_arrayness;
+};
+
+} // namespace opt
+} // namespace spvtools
+
+#endif // SOURCE_OPT_INTERFACE_VAR_SROA_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interp_fixup_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interp_fixup_pass.cpp
index ad29e6a7207..e8cdd99f1c1 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interp_fixup_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/interp_fixup_pass.cpp
@@ -31,13 +31,6 @@ namespace {
// Input Operand Indices
static const int kSpvVariableStorageClassInIdx = 0;
-// Avoid unused variable warning/error on Linux
-#ifndef NDEBUG
-#define USE_ASSERT(x) assert(x)
-#else
-#define USE_ASSERT(x) ((void)(x))
-#endif
-
// Folding rule function which attempts to replace |op(OpLoad(a),...)|
// by |op(a,...)|, where |op| is one of the GLSLstd450 InterpolateAt*
// instructions. Returns true if replaced, false otherwise.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_builder.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_builder.h
index fe5feff569d..9d4fa8fe3d8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_builder.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_builder.h
@@ -359,8 +359,9 @@ class InstructionBuilder {
return AddInstruction(std::move(select));
}
- // Adds a signed int32 constant to the binary.
- // The |value| parameter is the constant value to be added.
+ // Returns a pointer to the definition of a signed 32-bit integer constant
+ // with the given value. Returns |nullptr| if the constant does not exist and
+ // cannot be created.
Instruction* GetSintConstant(int32_t value) {
return GetIntConstant<int32_t>(value, true);
}
@@ -381,21 +382,24 @@ class InstructionBuilder {
GetContext()->TakeNextId(), ops));
return AddInstruction(std::move(construct));
}
- // Adds an unsigned int32 constant to the binary.
- // The |value| parameter is the constant value to be added.
+
+ // Returns a pointer to the definition of an unsigned 32-bit integer constant
+ // with the given value. Returns |nullptr| if the constant does not exist and
+ // cannot be created.
Instruction* GetUintConstant(uint32_t value) {
return GetIntConstant<uint32_t>(value, false);
}
uint32_t GetUintConstantId(uint32_t value) {
Instruction* uint_inst = GetUintConstant(value);
- return uint_inst->result_id();
+ return (uint_inst != nullptr ? uint_inst->result_id() : 0);
}
// Adds either a signed or unsigned 32 bit integer constant to the binary
- // depedning on the |sign|. If |sign| is true then the value is added as a
+ // depending on the |sign|. If |sign| is true then the value is added as a
// signed constant otherwise as an unsigned constant. If |sign| is false the
- // value must not be a negative number.
+ // value must not be a negative number. Returns false if the constant does
+ // not exists and could be be created.
template <typename T>
Instruction* GetIntConstant(T value, bool sign) {
// Assert that we are not trying to store a negative number in an unsigned
@@ -411,6 +415,10 @@ class InstructionBuilder {
uint32_t type_id =
GetContext()->get_type_mgr()->GetTypeInstruction(&int_type);
+ if (type_id == 0) {
+ return nullptr;
+ }
+
// Get the memory managed type so that it is safe to be stored by
// GetConstant.
analysis::Type* rebuilt_type =
@@ -479,6 +487,15 @@ class InstructionBuilder {
return AddInstruction(std::move(new_inst));
}
+ Instruction* AddVariable(uint32_t type_id, uint32_t storage_class) {
+ std::vector<Operand> operands;
+ operands.push_back({SPV_OPERAND_TYPE_ID, {storage_class}});
+ std::unique_ptr<Instruction> new_inst(
+ new Instruction(GetContext(), SpvOpVariable, type_id,
+ GetContext()->TakeNextId(), operands));
+ return AddInstruction(std::move(new_inst));
+ }
+
Instruction* AddStore(uint32_t ptr_id, uint32_t obj_id) {
std::vector<Operand> operands;
operands.push_back({SPV_OPERAND_TYPE_ID, {ptr_id}});
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp
index 612a831add6..c9c3f1b5dc2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.cpp
@@ -41,6 +41,8 @@ namespace spvtools {
namespace opt {
void IRContext::BuildInvalidAnalyses(IRContext::Analysis set) {
+ set = Analysis(set & ~valid_analyses_);
+
if (set & kAnalysisDefUse) {
BuildDefUseManager();
}
@@ -106,7 +108,7 @@ void IRContext::InvalidateAnalyses(IRContext::Analysis analyses_to_invalidate) {
analyses_to_invalidate |= kAnalysisDebugInfo;
}
- // The dominator analysis hold the psuedo entry and exit nodes from the CFG.
+ // The dominator analysis hold the pseudo entry and exit nodes from the CFG.
// Also if the CFG change the dominators many changed as well, so the
// dominator analysis should be invalidated as well.
if (analyses_to_invalidate & kAnalysisCFG) {
@@ -317,7 +319,7 @@ bool IRContext::IsConsistent() {
#else
if (AreAnalysesValid(kAnalysisDefUse)) {
analysis::DefUseManager new_def_use(module());
- if (*get_def_use_mgr() != new_def_use) {
+ if (!CompareAndPrintDifferences(*get_def_use_mgr(), new_def_use)) {
return false;
}
}
@@ -623,9 +625,8 @@ void IRContext::AddCombinatorsForCapability(uint32_t capability) {
void IRContext::AddCombinatorsForExtension(Instruction* extension) {
assert(extension->opcode() == SpvOpExtInstImport &&
"Expecting an import of an extension's instruction set.");
- const char* extension_name =
- reinterpret_cast<const char*>(&extension->GetInOperand(0).words[0]);
- if (!strcmp(extension_name, "GLSL.std.450")) {
+ const std::string extension_name = extension->GetInOperand(0).AsString();
+ if (extension_name == "GLSL.std.450") {
combinator_ops_[extension->result_id()] = {GLSLstd450Round,
GLSLstd450RoundEven,
GLSLstd450Trunc,
@@ -925,6 +926,19 @@ bool IRContext::ProcessCallTreeFromRoots(ProcessFunction& pfn,
return modified;
}
+void IRContext::CollectCallTreeFromRoots(unsigned entryId,
+ std::unordered_set<uint32_t>* funcs) {
+ std::queue<uint32_t> roots;
+ roots.push(entryId);
+ while (!roots.empty()) {
+ const uint32_t fi = roots.front();
+ roots.pop();
+ funcs->insert(fi);
+ Function* fn = GetFunction(fi);
+ AddCalls(fn, &roots);
+ }
+}
+
void IRContext::EmitErrorMessage(std::string message, Instruction* inst) {
if (!consumer()) {
return;
@@ -944,11 +958,11 @@ void IRContext::EmitErrorMessage(std::string message, Instruction* inst) {
uint32_t line_number = 0;
uint32_t col_number = 0;
- char* source = nullptr;
+ std::string source;
if (line_inst != nullptr) {
Instruction* file_name =
get_def_use_mgr()->GetDef(line_inst->GetSingleWordInOperand(0));
- source = reinterpret_cast<char*>(&file_name->GetInOperand(0).words[0]);
+ source = file_name->GetInOperand(0).AsString();
// Get the line number and column number.
line_number = line_inst->GetSingleWordInOperand(1);
@@ -957,7 +971,7 @@ void IRContext::EmitErrorMessage(std::string message, Instruction* inst) {
message +=
"\n " + inst->PrettyPrint(SPV_BINARY_TO_TEXT_OPTION_FRIENDLY_NAMES);
- consumer()(SPV_MSG_ERROR, source, {line_number, col_number, 0},
+ consumer()(SPV_MSG_ERROR, source.c_str(), {line_number, col_number, 0},
message.c_str());
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.h
index 658534760d3..2f27942b4cf 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_context.h
@@ -43,6 +43,7 @@
#include "source/opt/type_manager.h"
#include "source/opt/value_number_table.h"
#include "source/util/make_unique.h"
+#include "source/util/string_utils.h"
namespace spvtools {
namespace opt {
@@ -301,7 +302,7 @@ class IRContext {
}
}
- // Returns a pointer the decoration manager. If the decoration manger is
+ // Returns a pointer the decoration manager. If the decoration manager is
// invalid, it is rebuilt first.
analysis::DecorationManager* get_decoration_mgr() {
if (!AreAnalysesValid(kAnalysisDecorations)) {
@@ -384,7 +385,7 @@ class IRContext {
// Deletes the instruction defining the given |id|. Returns true on
// success, false if the given |id| is not defined at all. This method also
- // erases the name, decorations, and defintion of |id|.
+ // erases the name, decorations, and definition of |id|.
//
// Pointers and iterators pointing to the deleted instructions become invalid.
// However other pointers and iterators are still valid.
@@ -410,6 +411,10 @@ class IRContext {
void CollectNonSemanticTree(Instruction* inst,
std::unordered_set<Instruction*>* to_kill);
+ // Collect function reachable from |entryId|, returns |funcs|
+ void CollectCallTreeFromRoots(unsigned entryId,
+ std::unordered_set<uint32_t>* funcs);
+
// Returns true if all of the given analyses are valid.
bool AreAnalysesValid(Analysis set) { return (set & valid_analyses_) == set; }
@@ -518,6 +523,18 @@ class IRContext {
std::string message = "ID overflow. Try running compact-ids.";
consumer()(SPV_MSG_ERROR, "", {0, 0, 0}, message.c_str());
}
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+ // If TakeNextId returns 0, it is very likely that execution will
+ // subsequently fail. Such failures are false alarms from a fuzzing point
+ // of view: they are due to the fact that too many ids were used, rather
+ // than being due to an actual bug. Thus, during a fuzzing build, it is
+ // preferable to bail out when ID overflow occurs.
+ //
+ // A zero exit code is returned here because a non-zero code would cause
+ // ClusterFuzz/OSS-Fuzz to regard the termination as a crash, and spurious
+ // crash reports is what this guard aims to avoid.
+ exit(0);
+#endif
}
return next_id;
}
@@ -789,7 +806,7 @@ class IRContext {
// iterators to traverse instructions.
std::unordered_map<uint32_t, Function*> id_to_func_;
- // A bitset indicating which analyes are currently valid.
+ // A bitset indicating which analyzes are currently valid.
Analysis valid_analyses_;
// Opcodes of shader capability core executable instructions
@@ -854,8 +871,7 @@ inline IRContext::Analysis operator|(IRContext::Analysis lhs,
inline IRContext::Analysis& operator|=(IRContext::Analysis& lhs,
IRContext::Analysis rhs) {
- lhs = static_cast<IRContext::Analysis>(static_cast<int>(lhs) |
- static_cast<int>(rhs));
+ lhs = lhs | rhs;
return lhs;
}
@@ -1020,11 +1036,7 @@ void IRContext::AddCapability(std::unique_ptr<Instruction>&& c) {
}
void IRContext::AddExtension(const std::string& ext_name) {
- const auto num_chars = ext_name.size();
- // Compute num words, accommodate the terminating null character.
- const auto num_words = (num_chars + 1 + 3) / 4;
- std::vector<uint32_t> ext_words(num_words, 0u);
- std::memcpy(ext_words.data(), ext_name.data(), num_chars);
+ std::vector<uint32_t> ext_words = spvtools::utils::MakeVector(ext_name);
AddExtension(std::unique_ptr<Instruction>(
new Instruction(this, SpvOpExtension, 0u, 0u,
{{SPV_OPERAND_TYPE_LITERAL_STRING, ext_words}})));
@@ -1041,11 +1053,7 @@ void IRContext::AddExtension(std::unique_ptr<Instruction>&& e) {
}
void IRContext::AddExtInstImport(const std::string& name) {
- const auto num_chars = name.size();
- // Compute num words, accommodate the terminating null character.
- const auto num_words = (num_chars + 1 + 3) / 4;
- std::vector<uint32_t> ext_words(num_words, 0u);
- std::memcpy(ext_words.data(), name.data(), num_chars);
+ std::vector<uint32_t> ext_words = spvtools::utils::MakeVector(name);
AddExtInstImport(std::unique_ptr<Instruction>(
new Instruction(this, SpvOpExtInstImport, 0u, TakeNextId(),
{{SPV_OPERAND_TYPE_LITERAL_STRING, ext_words}})));
@@ -1086,6 +1094,9 @@ void IRContext::AddDebug2Inst(std::unique_ptr<Instruction>&& d) {
id_to_name_->insert({d->GetSingleWordInOperand(0), d.get()});
}
}
+ if (AreAnalysesValid(kAnalysisDefUse)) {
+ get_def_use_mgr()->AnalyzeInstDefUse(d.get());
+ }
module()->AddDebug2Inst(std::move(d));
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_loader.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_loader.cpp
index a82b530e6c0..734ad554b8f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_loader.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ir_loader.cpp
@@ -187,9 +187,12 @@ bool IrLoader::AddInstruction(const spv_parsed_instruction_t* inst) {
module_->AddExtInstImport(std::move(spv_inst));
} else if (opcode == SpvOpMemoryModel) {
module_->SetMemoryModel(std::move(spv_inst));
+ } else if (opcode == SpvOpSamplerImageAddressingModeNV) {
+ module_->SetSampledImageAddressMode(std::move(spv_inst));
} else if (opcode == SpvOpEntryPoint) {
module_->AddEntryPoint(std::move(spv_inst));
- } else if (opcode == SpvOpExecutionMode) {
+ } else if (opcode == SpvOpExecutionMode ||
+ opcode == SpvOpExecutionModeId) {
module_->AddExecutionMode(std::move(spv_inst));
} else if (IsDebug1Inst(opcode)) {
module_->AddDebug1Inst(std::move(spv_inst));
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/iterator.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/iterator.h
index 2280582dfe4..847e1bbd52a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/iterator.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/iterator.h
@@ -142,7 +142,7 @@ inline IteratorRange<IteratorType> make_range(const IteratorType& begin,
template <typename IteratorType>
inline IteratorRange<IteratorType> make_range(IteratorType&& begin,
IteratorType&& end) {
- return {std::move(begin), std::move(end)};
+ return {std::forward<IteratorType>(begin), std::forward<IteratorType>(end)};
}
// Returns a (begin, end) iterator pair for the given container.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp
index da9ba8cc01e..d11682f34af 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.cpp
@@ -19,6 +19,7 @@
#include "ir_builder.h"
#include "ir_context.h"
#include "iterator.h"
+#include "source/util/string_utils.h"
namespace spvtools {
namespace opt {
@@ -27,8 +28,6 @@ namespace {
const uint32_t kStoreValIdInIdx = 1;
const uint32_t kAccessChainPtrIdInIdx = 0;
-const uint32_t kConstantValueInIdx = 0;
-const uint32_t kTypeIntWidthInIdx = 0;
} // anonymous namespace
@@ -66,7 +65,19 @@ void LocalAccessChainConvertPass::AppendConstantOperands(
ptrInst->ForEachInId([&iidIdx, &in_opnds, this](const uint32_t* iid) {
if (iidIdx > 0) {
const Instruction* cInst = get_def_use_mgr()->GetDef(*iid);
- uint32_t val = cInst->GetSingleWordInOperand(kConstantValueInIdx);
+ const auto* constant_value =
+ context()->get_constant_mgr()->GetConstantFromInst(cInst);
+ assert(constant_value != nullptr &&
+ "Expecting the index to be a constant.");
+
+ // We take the sign extended value because OpAccessChain interprets the
+ // index as signed.
+ int64_t long_value = constant_value->GetSignExtendedValue();
+ assert(long_value <= UINT32_MAX && long_value >= 0 &&
+ "The index value is too large for a composite insert or extract "
+ "instruction.");
+
+ uint32_t val = static_cast<uint32_t>(long_value);
in_opnds->push_back(
{spv_operand_type_t::SPV_OPERAND_TYPE_LITERAL_INTEGER, {val}});
}
@@ -168,13 +179,18 @@ bool LocalAccessChainConvertPass::GenAccessChainStoreReplacement(
return true;
}
-bool LocalAccessChainConvertPass::IsConstantIndexAccessChain(
+bool LocalAccessChainConvertPass::Is32BitConstantIndexAccessChain(
const Instruction* acp) const {
uint32_t inIdx = 0;
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;
+ const auto* index =
+ context()->get_constant_mgr()->GetConstantFromInst(opInst);
+ int64_t index_value = index->GetSignExtendedValue();
+ if (index_value > UINT32_MAX) return false;
+ if (index_value < 0) return false;
}
++inIdx;
return true;
@@ -223,14 +239,21 @@ void LocalAccessChainConvertPass::FindTargetVars(Function* func) {
}
// Rule out variables with nested access chains
// TODO(): Convert nested access chains
- if (IsNonPtrAccessChain(op) && ptrInst->GetSingleWordInOperand(
+ bool is_non_ptr_access_chain = IsNonPtrAccessChain(op);
+ if (is_non_ptr_access_chain && ptrInst->GetSingleWordInOperand(
kAccessChainPtrIdInIdx) != varId) {
seen_non_target_vars_.insert(varId);
seen_target_vars_.erase(varId);
break;
}
// Rule out variables accessed with non-constant indices
- if (!IsConstantIndexAccessChain(ptrInst)) {
+ if (!Is32BitConstantIndexAccessChain(ptrInst)) {
+ seen_non_target_vars_.insert(varId);
+ seen_target_vars_.erase(varId);
+ break;
+ }
+
+ if (is_non_ptr_access_chain && AnyIndexIsOutOfBounds(ptrInst)) {
seen_non_target_vars_.insert(varId);
seen_target_vars_.erase(varId);
break;
@@ -328,8 +351,7 @@ bool LocalAccessChainConvertPass::AllExtensionsSupported() const {
return false;
// If any extension not in allowlist, return false
for (auto& ei : get_module()->extensions()) {
- const char* extName =
- reinterpret_cast<const char*>(&ei.GetInOperand(0).words[0]);
+ const std::string extName = ei.GetInOperand(0).AsString();
if (extensions_allowlist_.find(extName) == extensions_allowlist_.end())
return false;
}
@@ -339,11 +361,9 @@ bool LocalAccessChainConvertPass::AllExtensionsSupported() const {
for (auto& inst : context()->module()->ext_inst_imports()) {
assert(inst.opcode() == SpvOpExtInstImport &&
"Expecting an import of an extension's instruction set.");
- const char* extension_name =
- reinterpret_cast<const char*>(&inst.GetInOperand(0).words[0]);
- if (0 == std::strncmp(extension_name, "NonSemantic.", 12) &&
- 0 != std::strncmp(extension_name, "NonSemantic.Shader.DebugInfo.100",
- 32)) {
+ const std::string extension_name = inst.GetInOperand(0).AsString();
+ if (spvtools::utils::starts_with(extension_name, "NonSemantic.") &&
+ extension_name != "NonSemantic.Shader.DebugInfo.100") {
return false;
}
}
@@ -351,12 +371,6 @@ bool LocalAccessChainConvertPass::AllExtensionsSupported() const {
}
Pass::Status LocalAccessChainConvertPass::ProcessImpl() {
- // If non-32-bit integer type in module, terminate processing
- // TODO(): Handle non-32-bit integer constants in access chains
- for (const Instruction& inst : get_module()->types_values())
- if (inst.opcode() == SpvOpTypeInt &&
- inst.GetSingleWordInOperand(kTypeIntWidthInIdx) != 32)
- return Status::SuccessWithoutChange;
// Do not process if module contains OpGroupDecorate. Additional
// support required in KillNamesAndDecorates().
// TODO(greg-lunarg): Add support for OpGroupDecorate
@@ -436,8 +450,47 @@ void LocalAccessChainConvertPass::InitExtensions() {
"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",
});
}
+bool LocalAccessChainConvertPass::AnyIndexIsOutOfBounds(
+ const Instruction* access_chain_inst) {
+ assert(IsNonPtrAccessChain(access_chain_inst->opcode()));
+
+ analysis::TypeManager* type_mgr = context()->get_type_mgr();
+ analysis::ConstantManager* const_mgr = context()->get_constant_mgr();
+ auto constants = const_mgr->GetOperandConstants(access_chain_inst);
+ uint32_t base_pointer_id = access_chain_inst->GetSingleWordInOperand(0);
+ Instruction* base_pointer = get_def_use_mgr()->GetDef(base_pointer_id);
+ const analysis::Pointer* base_pointer_type =
+ type_mgr->GetType(base_pointer->type_id())->AsPointer();
+ assert(base_pointer_type != nullptr &&
+ "The base of the access chain is not a pointer.");
+ const analysis::Type* current_type = base_pointer_type->pointee_type();
+ for (uint32_t i = 1; i < access_chain_inst->NumInOperands(); ++i) {
+ if (IsIndexOutOfBounds(constants[i], current_type)) {
+ return true;
+ }
+
+ uint32_t index =
+ (constants[i]
+ ? static_cast<uint32_t>(constants[i]->GetZeroExtendedValue())
+ : 0);
+ current_type = type_mgr->GetMemberType(current_type, {index});
+ }
+
+ return false;
+}
+
+bool LocalAccessChainConvertPass::IsIndexOutOfBounds(
+ const analysis::Constant* index, const analysis::Type* type) const {
+ if (index == nullptr) {
+ return false;
+ }
+ return index->GetZeroExtendedValue() >= type->NumberOfComponents();
+}
+
} // namespace opt
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.h
index 552062e52f4..c3731b1c922 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_access_chain_convert_pass.h
@@ -81,7 +81,7 @@ class LocalAccessChainConvertPass : public MemPass {
std::vector<Operand>* in_opnds);
// Create a load/insert/store equivalent to a store of
- // |valId| through (constant index) access chaing |ptrInst|.
+ // |valId| through (constant index) access chain |ptrInst|.
// Append to |newInsts|. Returns true if successful.
bool GenAccessChainStoreReplacement(
const Instruction* ptrInst, uint32_t valId,
@@ -94,8 +94,9 @@ class LocalAccessChainConvertPass : public MemPass {
bool ReplaceAccessChainLoad(const Instruction* address_inst,
Instruction* original_load);
- // Return true if all indices of access chain |acp| are OpConstant integers
- bool IsConstantIndexAccessChain(const Instruction* acp) const;
+ // Return true if all indices of the access chain |acp| are OpConstant
+ // integers whose signed values can be represented as unsigned 32-bit values.
+ bool Is32BitConstantIndexAccessChain(const Instruction* acp) const;
// Identify all function scope variables of target type which are
// accessed only with loads, stores and access chains with constant
@@ -110,6 +111,17 @@ class LocalAccessChainConvertPass : public MemPass {
// Returns a status to indicate success or failure, and change or no change.
Status ConvertLocalAccessChains(Function* func);
+ // Returns true one of the indexes in the |access_chain_inst| is definitly out
+ // of bounds. If the size of the type or the value of the index is unknown,
+ // then it will be considered in-bounds.
+ bool AnyIndexIsOutOfBounds(const Instruction* access_chain_inst);
+
+ // Returns true if getting element |index| from |type| would be out-of-bounds.
+ // If |index| is nullptr or the size of the type are unknown, then it will be
+ // considered in-bounds.
+ bool IsIndexOutOfBounds(const analysis::Constant* index,
+ const analysis::Type* type) const;
+
// Initialize extensions allowlist
void InitExtensions();
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp
index 80b081dca9f..a58e8e4cc70 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_block_elim_pass.cpp
@@ -19,6 +19,7 @@
#include <vector>
#include "source/opt/iterator.h"
+#include "source/util/string_utils.h"
namespace spvtools {
namespace opt {
@@ -183,8 +184,7 @@ void LocalSingleBlockLoadStoreElimPass::Initialize() {
bool LocalSingleBlockLoadStoreElimPass::AllExtensionsSupported() const {
// If any extension not in allowlist, return false
for (auto& ei : get_module()->extensions()) {
- const char* extName =
- reinterpret_cast<const char*>(&ei.GetInOperand(0).words[0]);
+ const std::string extName = ei.GetInOperand(0).AsString();
if (extensions_allowlist_.find(extName) == extensions_allowlist_.end())
return false;
}
@@ -194,11 +194,9 @@ bool LocalSingleBlockLoadStoreElimPass::AllExtensionsSupported() const {
for (auto& inst : context()->module()->ext_inst_imports()) {
assert(inst.opcode() == SpvOpExtInstImport &&
"Expecting an import of an extension's instruction set.");
- const char* extension_name =
- reinterpret_cast<const char*>(&inst.GetInOperand(0).words[0]);
- if (0 == std::strncmp(extension_name, "NonSemantic.", 12) &&
- 0 != std::strncmp(extension_name, "NonSemantic.Shader.DebugInfo.100",
- 32)) {
+ const std::string extension_name = inst.GetInOperand(0).AsString();
+ if (spvtools::utils::starts_with(extension_name, "NonSemantic.") &&
+ extension_name != "NonSemantic.Shader.DebugInfo.100") {
return false;
}
}
@@ -223,7 +221,7 @@ Pass::Status LocalSingleBlockLoadStoreElimPass::ProcessImpl() {
return LocalSingleBlockLoadStoreElim(fp);
};
- bool modified = context()->ProcessEntryPointCallTree(pfn);
+ bool modified = context()->ProcessReachableCallTree(pfn);
return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange;
}
@@ -288,6 +286,8 @@ void LocalSingleBlockLoadStoreElimPass::InitExtensions() {
"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",
});
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp
index a32db3b7606..81648c7ba1f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/local_single_store_elim_pass.cpp
@@ -19,6 +19,7 @@
#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 {
namespace opt {
@@ -48,8 +49,7 @@ bool LocalSingleStoreElimPass::LocalSingleStoreElim(Function* func) {
bool LocalSingleStoreElimPass::AllExtensionsSupported() const {
// If any extension not in allowlist, return false
for (auto& ei : get_module()->extensions()) {
- const char* extName =
- reinterpret_cast<const char*>(&ei.GetInOperand(0).words[0]);
+ const std::string extName = ei.GetInOperand(0).AsString();
if (extensions_allowlist_.find(extName) == extensions_allowlist_.end())
return false;
}
@@ -59,11 +59,9 @@ bool LocalSingleStoreElimPass::AllExtensionsSupported() const {
for (auto& inst : context()->module()->ext_inst_imports()) {
assert(inst.opcode() == SpvOpExtInstImport &&
"Expecting an import of an extension's instruction set.");
- const char* extension_name =
- reinterpret_cast<const char*>(&inst.GetInOperand(0).words[0]);
- if (0 == std::strncmp(extension_name, "NonSemantic.", 12) &&
- 0 != std::strncmp(extension_name, "NonSemantic.Shader.DebugInfo.100",
- 32)) {
+ const std::string extension_name = inst.GetInOperand(0).AsString();
+ if (spvtools::utils::starts_with(extension_name, "NonSemantic.") &&
+ extension_name != "NonSemantic.Shader.DebugInfo.100") {
return false;
}
}
@@ -81,7 +79,7 @@ Pass::Status LocalSingleStoreElimPass::ProcessImpl() {
ProcessFunction pfn = [this](Function* fp) {
return LocalSingleStoreElim(fp);
};
- bool modified = context()->ProcessEntryPointCallTree(pfn);
+ bool modified = context()->ProcessReachableCallTree(pfn);
return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange;
}
@@ -141,6 +139,8 @@ void LocalSingleStoreElimPass::InitExtensionAllowList() {
"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",
});
}
bool LocalSingleStoreElimPass::ProcessVariable(Instruction* var_inst) {
@@ -175,29 +175,9 @@ bool LocalSingleStoreElimPass::ProcessVariable(Instruction* var_inst) {
bool LocalSingleStoreElimPass::RewriteDebugDeclares(Instruction* store_inst,
uint32_t var_id) {
- std::unordered_set<Instruction*> invisible_decls;
uint32_t value_id = store_inst->GetSingleWordInOperand(1);
- bool modified =
- context()->get_debug_info_mgr()->AddDebugValueIfVarDeclIsVisible(
- store_inst, var_id, value_id, store_inst, &invisible_decls);
-
- // For cases like the argument passing for an inlined function, the value
- // assignment is out of DebugDeclare's scope, but we have to preserve the
- // value assignment information using DebugValue. Generally, we need
- // ssa-rewrite analysis to decide a proper value assignment but at this point
- // we confirm that |var_id| has a single store. We can safely add DebugValue.
- if (!invisible_decls.empty()) {
- BasicBlock* store_block = context()->get_instr_block(store_inst);
- DominatorAnalysis* dominator_analysis =
- context()->GetDominatorAnalysis(store_block->GetParent());
- for (auto* decl : invisible_decls) {
- if (dominator_analysis->Dominates(store_inst, decl)) {
- context()->get_debug_info_mgr()->AddDebugValueForDecl(decl, value_id,
- decl, store_inst);
- modified = true;
- }
- }
- }
+ bool modified = context()->get_debug_info_mgr()->AddDebugValueForVariable(
+ store_inst, var_id, value_id, store_inst);
modified |= context()->get_debug_info_mgr()->KillDebugDeclares(var_id);
return modified;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp
index b5b56309847..13982d1819c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_descriptor.cpp
@@ -497,7 +497,8 @@ void Loop::ComputeLoopStructuredOrder(
// continue blocks that must be copied to retain the structured order.
// The structured order will include these.
std::list<BasicBlock*> order;
- cfg.ComputeStructuredOrder(loop_header_->GetParent(), loop_header_, &order);
+ cfg.ComputeStructuredOrder(loop_header_->GetParent(), loop_header_,
+ loop_merge_, &order);
for (BasicBlock* bb : order) {
if (bb == GetMergeBlock()) {
break;
@@ -719,7 +720,7 @@ bool Loop::FindNumberOfIterations(const Instruction* induction,
step_value = -step_value;
}
- // Find the inital value of the loop and make sure it is a constant integer.
+ // Find the initial value of the loop and make sure it is a constant integer.
int64_t init_value = 0;
if (!GetInductionInitValue(induction, &init_value)) return false;
@@ -751,9 +752,13 @@ bool Loop::FindNumberOfIterations(const Instruction* induction,
// We retrieve the number of iterations using the following formula, diff /
// |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 divisable then we add one to the sum.
+// |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 init_value, int64_t step_value) const {
+ if (step_value == 0) {
+ return 0;
+ }
+
int64_t diff = 0;
switch (condition) {
@@ -795,7 +800,7 @@ int64_t Loop::GetIterations(SpvOp condition, int64_t condition_value,
// If the condition is not met to begin with the loop will never iterate.
if (!(init_value >= condition_value)) return 0;
- // We subract one to make it the same as SpvOpGreaterThan as it is
+ // We subtract one to make it the same as SpvOpGreaterThan as it is
// functionally equivalent.
diff = init_value - (condition_value - 1);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_descriptor.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_descriptor.h
index 4b4f8bc75d8..df012274c09 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_descriptor.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_descriptor.h
@@ -395,10 +395,11 @@ class Loop {
// Sets |merge| as the loop merge block. No checks are performed here.
inline void SetMergeBlockImpl(BasicBlock* merge) { loop_merge_ = merge; }
- // Each differnt loop |condition| affects how we calculate the number of
+ // Each different loop |condition| affects how we calculate the number of
// iterations using the |condition_value|, |init_value|, and |step_values| of
// the induction variable. This method will return the number of iterations in
- // a loop with those values for a given |condition|.
+ // 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 init_value, int64_t step_value) const;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fission.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fission.cpp
index 0678113c47c..b4df8c62164 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fission.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fission.cpp
@@ -29,7 +29,7 @@
// 2 - For each loop in the list, group each instruction into a set of related
// instructions by traversing each instructions users and operands recursively.
// We stop if we encounter an instruction we have seen before or an instruction
-// which we don't consider relevent (i.e OpLoopMerge). We then group these
+// which we don't consider relevant (i.e OpLoopMerge). We then group these
// groups into two different sets, one for the first loop and one for the
// second.
//
@@ -453,7 +453,7 @@ Pass::Status LoopFissionPass::Process() {
for (Function& f : *context()->module()) {
// We collect all the inner most loops in the function and run the loop
// splitting util on each. The reason we do this is to allow us to iterate
- // over each, as creating new loops will invalidate the the loop iterator.
+ // over each, as creating new loops will invalidate the loop iterator.
std::vector<Loop*> inner_most_loops{};
LoopDescriptor& loop_descriptor = *context()->GetLoopDescriptor(&f);
for (Loop& loop : loop_descriptor) {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fission.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fission.h
index e7a59c18586..9bc12c0fdba 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fission.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fission.h
@@ -33,7 +33,7 @@ namespace opt {
class LoopFissionPass : public Pass {
public:
- // Fuction used to determine if a given loop should be split. Takes register
+ // Function used to determine if a given loop should be split. Takes register
// pressure region for that loop as a parameter and returns true if the loop
// should be split.
using FissionCriteriaFunction =
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion.cpp
index 07d171a0afc..f3aab2837f6 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion.cpp
@@ -165,7 +165,7 @@ bool LoopFusion::AreCompatible() {
// Check adjacency, |loop_0_| should come just before |loop_1_|.
// There is always at least one block between loops, even if it's empty.
- // We'll check at most 2 preceeding blocks.
+ // We'll check at most 2 preceding blocks.
auto pre_header_1 = loop_1_->GetPreHeaderBlock();
@@ -712,7 +712,7 @@ void LoopFusion::Fuse() {
ld->RemoveLoop(loop_1_);
- // Kill unnessecary instructions and remove all empty blocks.
+ // Kill unnecessary instructions and remove all empty blocks.
for (auto inst : instr_to_delete) {
context_->KillInst(inst);
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion.h
index d61d6783c86..769da5f1afe 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion.h
@@ -40,7 +40,7 @@ class LoopFusion {
// That means:
// * they both have one induction variable
// * they have the same upper and lower bounds
- // - same inital value
+ // - same initial value
// - same condition
// * they have the same update step
// * they are adjacent, with |loop_0| appearing before |loop_1|
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion_pass.h
index 3a0be60004d..9d5b7ccdae0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_fusion_pass.h
@@ -33,7 +33,7 @@ class LoopFusionPass : public Pass {
// Processes the given |module|. Returns Status::Failure if errors occur when
// processing. Returns the corresponding Status::Success if processing is
- // succesful to indicate whether changes have been made to the modue.
+ // successful to indicate whether changes have been made to the module.
Status Process() override;
private:
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_peeling.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_peeling.h
index 413f896f251..2a55fe44dad 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_peeling.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_peeling.h
@@ -261,7 +261,7 @@ class LoopPeelingPass : public Pass {
// Processes the given |module|. Returns Status::Failure if errors occur when
// processing. Returns the corresponding Status::Success if processing is
- // succesful to indicate whether changes have been made to the modue.
+ // successful to indicate whether changes have been made to the module.
Pass::Status Process() override;
private:
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unroller.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unroller.cpp
index bf622500cb2..6f4e6f4136b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unroller.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unroller.cpp
@@ -163,7 +163,7 @@ struct LoopUnrollState {
};
// This class implements the actual unrolling. It uses a LoopUnrollState to
-// maintain the state of the unrolling inbetween steps.
+// maintain the state of the unrolling in between steps.
class LoopUnrollerUtilsImpl {
public:
using BasicBlockListTy = std::vector<std::unique_ptr<BasicBlock>>;
@@ -209,7 +209,7 @@ class LoopUnrollerUtilsImpl {
// Add all blocks_to_add_ to function_ at the |insert_point|.
void AddBlocksToFunction(const BasicBlock* insert_point);
- // Duplicates the |old_loop|, cloning each body and remaping the ids without
+ // Duplicates the |old_loop|, cloning each body and remapping the ids without
// removing instructions or changing relative structure. Result will be stored
// in |new_loop|.
void DuplicateLoop(Loop* old_loop, Loop* new_loop);
@@ -241,7 +241,7 @@ class LoopUnrollerUtilsImpl {
// Remap all the in |basic_block| to new IDs and keep the mapping of new ids
// to old
// ids. |loop| is used to identify special loop blocks (header, continue,
- // ect).
+ // etc).
void AssignNewResultIds(BasicBlock* basic_block);
// Using the map built by AssignNewResultIds, replace the uses in |inst|
@@ -320,7 +320,7 @@ class LoopUnrollerUtilsImpl {
// and then be remapped at the end.
std::vector<Instruction*> loop_phi_instructions_;
- // The number of loop iterations that the loop would preform pre-unroll.
+ // The number of loop iterations that the loop would perform pre-unroll.
size_t number_of_loop_iterations_;
// The amount that the loop steps each iteration.
@@ -384,6 +384,7 @@ void LoopUnrollerUtilsImpl::PartiallyUnrollResidualFactor(Loop* loop,
std::unique_ptr<Instruction> new_label{new Instruction(
context_, SpvOp::SpvOpLabel, 0, context_->TakeNextId(), {})};
std::unique_ptr<BasicBlock> new_exit_bb{new BasicBlock(std::move(new_label))};
+ new_exit_bb->SetParent(&function_);
// Save the id of the block before we move it.
uint32_t new_merge_id = new_exit_bb->id();
@@ -839,7 +840,7 @@ void LoopUnrollerUtilsImpl::DuplicateLoop(Loop* old_loop, Loop* new_loop) {
new_loop->SetMergeBlock(new_merge);
}
-// Whenever the utility copies a block it stores it in a tempory buffer, this
+// Whenever the utility copies a block it stores it in a temporary buffer, this
// function adds the buffer into the Function. The blocks will be inserted
// after the block |insert_point|.
void LoopUnrollerUtilsImpl::AddBlocksToFunction(
@@ -996,6 +997,20 @@ bool LoopUtils::CanPerformUnroll() {
if (!loop_->FindNumberOfIterations(induction, &*condition->ctail(), nullptr))
return false;
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+ // ClusterFuzz/OSS-Fuzz is likely to yield examples with very high loop
+ // 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;
+ size_t num_iterations;
+ loop_->FindNumberOfIterations(induction, &*condition->ctail(),
+ &num_iterations);
+ if (num_iterations > kFuzzerIterationLimit) {
+ return false;
+ }
+#endif
+
// Make sure the latch block is a unconditional branch to the header
// block.
const Instruction& branch = *loop_->GetLatchBlock()->ctail();
@@ -1102,6 +1117,10 @@ void LoopUtils::Finalize() {
Pass::Status LoopUnroller::Process() {
bool changed = false;
for (Function& f : *context()->module()) {
+ if (f.IsDeclaration()) {
+ continue;
+ }
+
LoopDescriptor* LD = context()->GetLoopDescriptor(&f);
for (Loop& loop : *LD) {
LoopUtils loop_utils{context(), &loop};
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp
index d805ecf3cc5..1ee7e5e227c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.cpp
@@ -118,7 +118,7 @@ class LoopUnswitch {
// Find a value that can be used to select the default path.
// If none are possible, then it will just use 0. The value does not matter
- // because this path will never be taken becaues the new switch outside of
+ // because this path will never be taken because the new switch outside of
// the loop cannot select this path either.
std::vector<uint32_t> existing_values;
for (uint32_t i = 2; i < switch_inst->NumInOperands(); i += 2) {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.h
index 3ecdd611625..4f7295d437d 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_unswitch_pass.h
@@ -30,7 +30,7 @@ class LoopUnswitchPass : public Pass {
// Processes the given |module|. Returns Status::Failure if errors occur when
// processing. Returns the corresponding Status::Success if processing is
- // succesful to indicate whether changes have been made to the modue.
+ // successful to indicate whether changes have been made to the module.
Pass::Status Process() override;
private:
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_utils.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_utils.h
index a4e61900bc7..70060fc4f00 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_utils.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/loop_utils.h
@@ -123,7 +123,7 @@ class LoopUtils {
// Clone the |loop_| and make the new loop branch to the second loop on exit.
Loop* CloneAndAttachLoopToHeader(LoopCloningResult* cloning_result);
- // Perfom a partial unroll of |loop| by given |factor|. This will copy the
+ // Perform a partial unroll of |loop| by given |factor|. This will copy the
// body of the loop |factor| times. So a |factor| of one would give a new loop
// with the original body plus one unrolled copy body.
bool PartiallyUnroll(size_t factor);
@@ -139,7 +139,7 @@ class LoopUtils {
// 1. That the loop is in structured order.
// 2. That the continue block is a branch to the header.
// 3. That the only phi used in the loop is the induction variable.
- // TODO(stephen@codeplay.com): This is a temporary mesure, after the loop is
+ // TODO(stephen@codeplay.com): This is a temporary measure, after the loop is
// converted into LCSAA form and has a single entry and exit we can rewrite
// the other phis.
// 4. That this is an inner most loop, or that loops contained within this
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/mem_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/mem_pass.cpp
index 72442a994bb..ca4889b7ccd 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/mem_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/mem_pass.cpp
@@ -86,8 +86,8 @@ bool MemPass::IsPtr(uint32_t ptrId) {
}
const SpvOp op = ptrInst->opcode();
if (op == SpvOpVariable || IsNonPtrAccessChain(op)) return true;
- if (op != SpvOpFunctionParameter) return false;
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;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/merge_return_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/merge_return_pass.cpp
index f1601049e90..7710deae2a4 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/merge_return_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/merge_return_pass.cpp
@@ -111,7 +111,9 @@ bool MergeReturnPass::ProcessStructured(
}
RecordImmediateDominators(function);
- AddSingleCaseSwitchAroundFunction();
+ if (!AddSingleCaseSwitchAroundFunction()) {
+ return false;
+ }
std::list<BasicBlock*> order;
cfg()->ComputeStructuredOrder(function, &*function->begin(), &order);
@@ -429,6 +431,7 @@ bool MergeReturnPass::BreakFromConstruct(
std::list<BasicBlock*>* order, Instruction* break_merge_inst) {
// Make sure the CFG is build here. If we don't then it becomes very hard
// to know which new blocks need to be updated.
+ context()->InvalidateAnalyses(IRContext::kAnalysisCFG);
context()->BuildInvalidAnalyses(IRContext::kAnalysisCFG);
// When predicating, be aware of whether this block is a header block, a
@@ -770,7 +773,7 @@ void MergeReturnPass::InsertAfterElement(BasicBlock* element,
list->insert(pos, new_element);
}
-void MergeReturnPass::AddSingleCaseSwitchAroundFunction() {
+bool MergeReturnPass::AddSingleCaseSwitchAroundFunction() {
CreateReturnBlock();
CreateReturn(final_return_block_);
@@ -778,7 +781,10 @@ void MergeReturnPass::AddSingleCaseSwitchAroundFunction() {
cfg()->RegisterBlock(final_return_block_);
}
- CreateSingleCaseSwitch(final_return_block_);
+ if (!CreateSingleCaseSwitch(final_return_block_)) {
+ return false;
+ }
+ return true;
}
BasicBlock* MergeReturnPass::CreateContinueTarget(uint32_t header_label_id) {
@@ -813,7 +819,7 @@ BasicBlock* MergeReturnPass::CreateContinueTarget(uint32_t header_label_id) {
return new_block;
}
-void MergeReturnPass::CreateSingleCaseSwitch(BasicBlock* merge_target) {
+bool MergeReturnPass::CreateSingleCaseSwitch(BasicBlock* merge_target) {
// Insert the switch before any code is run. We have to split the entry
// block to make sure the OpVariable instructions remain in the entry block.
BasicBlock* start_block = &*function_->begin();
@@ -830,13 +836,17 @@ void MergeReturnPass::CreateSingleCaseSwitch(BasicBlock* merge_target) {
context(), start_block,
IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping);
- builder.AddSwitch(builder.GetUintConstantId(0u), old_block->id(), {},
- merge_target->id());
+ uint32_t const_zero_id = builder.GetUintConstantId(0u);
+ if (const_zero_id == 0) {
+ return false;
+ }
+ builder.AddSwitch(const_zero_id, old_block->id(), {}, merge_target->id());
if (context()->AreAnalysesValid(IRContext::kAnalysisCFG)) {
cfg()->RegisterBlock(old_block);
cfg()->AddEdges(start_block);
}
+ return true;
}
bool MergeReturnPass::HasNontrivialUnreachableBlocks(Function* function) {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/merge_return_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/merge_return_pass.h
index 06a3e7b5502..d15db2f671d 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/merge_return_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/merge_return_pass.h
@@ -118,8 +118,6 @@ class MergeReturnPass : public MemPass {
StructuredControlState(Instruction* break_merge, Instruction* merge)
: break_merge_(break_merge), current_merge_(merge) {}
- StructuredControlState(const StructuredControlState&) = default;
-
bool InBreakable() const { return break_merge_; }
bool InStructuredFlow() const { return CurrentMergeId() != 0; }
@@ -247,7 +245,7 @@ class MergeReturnPass : public MemPass {
// Add new phi nodes for any id that no longer dominate all of it uses. A phi
// node is added to a block |bb| for an id if the id is defined between the
- // original immediate dominator of |bb| and its new immidiate dominator. It
+ // original immediate dominator of |bb| and its new immediate dominator. It
// is assumed that at this point there are no unreachable blocks in the
// control flow graph.
void AddNewPhiNodes();
@@ -273,11 +271,11 @@ class MergeReturnPass : public MemPass {
void InsertAfterElement(BasicBlock* element, BasicBlock* new_element,
std::list<BasicBlock*>* list);
- // Creates a single case switch around all of the exectuable code of the
+ // Creates a single case switch around all of the executable code of the
// current function where the switch and case value are both zero and the
// default is the merge block. Returns after the switch is executed. Sets
// |final_return_block_|.
- void AddSingleCaseSwitchAroundFunction();
+ bool AddSingleCaseSwitchAroundFunction();
// Creates a new basic block that branches to |header_label_id|. Returns the
// new basic block. The block will be the second last basic block in the
@@ -286,7 +284,7 @@ class MergeReturnPass : public MemPass {
// Creates a one case switch around the executable code of the function with
// |merge_target| as the merge node.
- void CreateSingleCaseSwitch(BasicBlock* merge_target);
+ bool CreateSingleCaseSwitch(BasicBlock* merge_target);
// Returns true if |function| has an unreachable block that is not a continue
// target that simply branches back to the header, or a merge block containing
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/module.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/module.cpp
index f97defbd6f9..c98af8f51d7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/module.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/module.cpp
@@ -90,6 +90,8 @@ void Module::ForEachInst(const std::function<void(Instruction*)>& f,
DELEGATE(extensions_);
DELEGATE(ext_inst_imports_);
if (memory_model_) memory_model_->ForEachInst(f, run_on_debug_line_insts);
+ if (sampled_image_address_mode_)
+ sampled_image_address_mode_->ForEachInst(f, run_on_debug_line_insts);
DELEGATE(entry_points_);
DELEGATE(execution_modes_);
DELEGATE(debugs1_);
@@ -114,6 +116,9 @@ void Module::ForEachInst(const std::function<void(const Instruction*)>& f,
if (memory_model_)
static_cast<const Instruction*>(memory_model_.get())
->ForEachInst(f, run_on_debug_line_insts);
+ if (sampled_image_address_mode_)
+ static_cast<const Instruction*>(sampled_image_address_mode_.get())
+ ->ForEachInst(f, run_on_debug_line_insts);
for (auto& i : entry_points_) DELEGATE(i);
for (auto& i : execution_modes_) DELEGATE(i);
for (auto& i : debugs1_) DELEGATE(i);
@@ -139,7 +144,7 @@ void Module::ToBinary(std::vector<uint32_t>* binary, bool skip_nop) const {
// TODO(antiagainst): should we change the generator number?
binary->push_back(header_.generator);
binary->push_back(header_.bound);
- binary->push_back(header_.reserved);
+ binary->push_back(header_.schema);
size_t bound_idx = binary->size() - 2;
DebugScope last_scope(kNoDebugScope, kNoInlinedAt);
@@ -260,9 +265,7 @@ bool Module::HasExplicitCapability(uint32_t cap) {
uint32_t Module::GetExtInstImportId(const char* extstr) {
for (auto& ei : ext_inst_imports_)
- if (!strcmp(extstr,
- reinterpret_cast<const char*>(&(ei.GetInOperand(0).words[0]))))
- return ei.result_id();
+ if (!ei.GetInOperand(0).AsString().compare(extstr)) return ei.result_id();
return 0;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/module.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/module.h
index 0360b7d5b40..7a6be460edb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/module.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/module.h
@@ -36,7 +36,7 @@ struct ModuleHeader {
uint32_t version;
uint32_t generator;
uint32_t bound;
- uint32_t reserved;
+ uint32_t schema;
};
// A SPIR-V module. It contains all the information for a SPIR-V module and
@@ -61,7 +61,7 @@ class Module {
}
// Returns the Id bound.
- uint32_t IdBound() { return header_.bound; }
+ uint32_t IdBound() const { return header_.bound; }
// Returns the current Id bound and increases it to the next available value.
// If the id bound has already reached its maximum value, then 0 is returned.
@@ -83,6 +83,9 @@ class Module {
// Set the memory model for this module.
inline void SetMemoryModel(std::unique_ptr<Instruction> m);
+ // Set the sampled image addressing mode for this module.
+ inline void SetSampledImageAddressMode(std::unique_ptr<Instruction> m);
+
// Appends an entry point instruction to this module.
inline void AddEntryPoint(std::unique_ptr<Instruction> e);
@@ -141,6 +144,8 @@ class Module {
inline uint32_t id_bound() const { return header_.bound; }
inline uint32_t version() const { return header_.version; }
+ inline uint32_t generator() const { return header_.generator; }
+ inline uint32_t schema() const { return header_.schema; }
inline void set_version(uint32_t v) { header_.version = v; }
@@ -156,12 +161,20 @@ class Module {
inline IteratorRange<inst_iterator> ext_inst_imports();
inline IteratorRange<const_inst_iterator> ext_inst_imports() const;
- // Return the memory model instruction contained inthis module.
+ // Return the memory model instruction contained in this module.
inline Instruction* GetMemoryModel() { return memory_model_.get(); }
inline const Instruction* GetMemoryModel() const {
return memory_model_.get();
}
+ // Return the sampled image address mode instruction contained in this module.
+ inline Instruction* GetSampledImageAddressMode() {
+ return sampled_image_address_mode_.get();
+ }
+ inline const Instruction* GetSampledImageAddressMode() const {
+ return sampled_image_address_mode_.get();
+ }
+
// There are several kinds of debug instructions, according to where they can
// appear in the logical layout of a module:
// - Section 7a: OpString, OpSourceExtension, OpSource, OpSourceContinued
@@ -286,6 +299,8 @@ class Module {
InstructionList ext_inst_imports_;
// A module only has one memory model instruction.
std::unique_ptr<Instruction> memory_model_;
+ // A module can only have one optional sampled image addressing mode
+ std::unique_ptr<Instruction> sampled_image_address_mode_;
InstructionList entry_points_;
InstructionList execution_modes_;
InstructionList debugs1_;
@@ -324,6 +339,10 @@ inline void Module::SetMemoryModel(std::unique_ptr<Instruction> m) {
memory_model_ = std::move(m);
}
+inline void Module::SetSampledImageAddressMode(std::unique_ptr<Instruction> m) {
+ sampled_image_address_mode_ = std::move(m);
+}
+
inline void Module::AddEntryPoint(std::unique_ptr<Instruction> e) {
entry_points_.push_back(std::move(e));
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp
index 990be2e4360..381589b53d0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/optimizer.cpp
@@ -288,6 +288,8 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) {
RegisterPass(CreateStripDebugInfoPass());
} else if (pass_name == "strip-reflect") {
RegisterPass(CreateStripReflectInfoPass());
+ } else if (pass_name == "strip-nonsemantic") {
+ RegisterPass(CreateStripNonSemanticInfoPass());
} else if (pass_name == "set-spec-const-default-value") {
if (pass_args.size() > 0) {
auto spec_ids_vals =
@@ -320,6 +322,10 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) {
RegisterPass(CreateCombineAccessChainsPass());
} else if (pass_name == "convert-local-access-chains") {
RegisterPass(CreateLocalAccessChainConvertPass());
+ } else if (pass_name == "replace-desc-array-access-using-var-index") {
+ RegisterPass(CreateReplaceDescArrayAccessUsingVarIndexPass());
+ } else if (pass_name == "spread-volatile-semantics") {
+ RegisterPass(CreateSpreadVolatileSemanticsPass());
} else if (pass_name == "descriptor-scalar-replacement") {
RegisterPass(CreateDescriptorScalarReplacementPass());
} else if (pass_name == "eliminate-dead-code-aggressive") {
@@ -515,6 +521,12 @@ bool Optimizer::RegisterPassFromFlag(const std::string& flag) {
RegisterPass(CreateAmdExtToKhrPass());
} else if (pass_name == "interpolate-fixup") {
RegisterPass(CreateInterpolateFixupPass());
+ } else if (pass_name == "remove-dont-inline") {
+ RegisterPass(CreateRemoveDontInlinePass());
+ } else if (pass_name == "eliminate-dead-input-components") {
+ RegisterPass(CreateEliminateDeadInputComponentsPass());
+ } else if (pass_name == "fix-func-call-param") {
+ RegisterPass(CreateFixFuncCallArgumentsPass());
} else if (pass_name == "convert-to-sampled-image") {
if (pass_args.size() > 0) {
auto descriptor_set_binding_pairs =
@@ -611,10 +623,16 @@ bool Optimizer::Run(const uint32_t* original_binary,
assert(optimized_binary_with_nop.size() == original_binary_size &&
"Binary size unexpectedly changed despite the optimizer saying "
"there was no change");
- assert(memcmp(optimized_binary_with_nop.data(), original_binary,
- original_binary_size) == 0 &&
- "Binary content unexpectedly changed despite the optimizer saying "
- "there was no change");
+
+ // Compare the magic number to make sure the binaries were encoded in the
+ // endianness. If not, the contents of the binaries will be different, so
+ // do not check the contents.
+ if (optimized_binary_with_nop[0] == original_binary[0]) {
+ assert(memcmp(optimized_binary_with_nop.data(), original_binary,
+ original_binary_size) == 0 &&
+ "Binary content unexpectedly changed despite the optimizer saying "
+ "there was no change");
+ }
}
#endif // !NDEBUG
@@ -651,8 +669,12 @@ Optimizer::PassToken CreateStripDebugInfoPass() {
}
Optimizer::PassToken CreateStripReflectInfoPass() {
+ return CreateStripNonSemanticInfoPass();
+}
+
+Optimizer::PassToken CreateStripNonSemanticInfoPass() {
return MakeUnique<Optimizer::PassToken::Impl>(
- MakeUnique<opt::StripReflectInfoPass>());
+ MakeUnique<opt::StripNonSemanticInfoPass>());
}
Optimizer::PassToken CreateEliminateDeadFunctionsPass() {
@@ -762,6 +784,11 @@ Optimizer::PassToken CreateLocalMultiStoreElimPass() {
MakeUnique<opt::SSARewritePass>());
}
+Optimizer::PassToken CreateAggressiveDCEPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::AggressiveDCEPass>(false));
+}
+
Optimizer::PassToken CreateAggressiveDCEPass(bool preserve_interface) {
return MakeUnique<Optimizer::PassToken::Impl>(
MakeUnique<opt::AggressiveDCEPass>(preserve_interface));
@@ -958,6 +985,16 @@ Optimizer::PassToken CreateGraphicsRobustAccessPass() {
MakeUnique<opt::GraphicsRobustAccessPass>());
}
+Optimizer::PassToken CreateReplaceDescArrayAccessUsingVarIndexPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::ReplaceDescArrayAccessUsingVarIndex>());
+}
+
+Optimizer::PassToken CreateSpreadVolatileSemanticsPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::SpreadVolatileSemantics>());
+}
+
Optimizer::PassToken CreateDescriptorScalarReplacementPass() {
return MakeUnique<Optimizer::PassToken::Impl>(
MakeUnique<opt::DescriptorScalarReplacement>());
@@ -977,6 +1014,11 @@ Optimizer::PassToken CreateInterpolateFixupPass() {
MakeUnique<opt::InterpFixupPass>());
}
+Optimizer::PassToken CreateEliminateDeadInputComponentsPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::EliminateDeadInputComponentsPass>());
+}
+
Optimizer::PassToken CreateConvertToSampledImagePass(
const std::vector<opt::DescriptorSetAndBinding>&
descriptor_set_binding_pairs) {
@@ -984,4 +1026,18 @@ Optimizer::PassToken CreateConvertToSampledImagePass(
MakeUnique<opt::ConvertToSampledImagePass>(descriptor_set_binding_pairs));
}
+Optimizer::PassToken CreateInterfaceVariableScalarReplacementPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::InterfaceVariableScalarReplacement>());
+}
+
+Optimizer::PassToken CreateRemoveDontInlinePass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::RemoveDontInline>());
+}
+
+Optimizer::PassToken CreateFixFuncCallArgumentsPass() {
+ return MakeUnique<Optimizer::PassToken::Impl>(
+ MakeUnique<opt::FixFuncCallArgumentsPass>());
+}
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass.h
index a8c9c4b43c1..b2303e2316c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass.h
@@ -28,6 +28,13 @@
#include "spirv-tools/libspirv.hpp"
#include "types.h"
+// Avoid unused variable warning/error on Linux
+#ifndef NDEBUG
+#define USE_ASSERT(x) assert(x)
+#else
+#define USE_ASSERT(x) ((void)(x))
+#endif
+
namespace spvtools {
namespace opt {
@@ -129,7 +136,7 @@ class Pass {
// Processes the given |module|. Returns Status::Failure if errors occur when
// processing. Returns the corresponding Status::Success if processing is
- // succesful to indicate whether changes are made to the module.
+ // successful to indicate whether changes are made to the module.
virtual Status Process() = 0;
// Return the next available SSA id and increment it.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass_manager.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass_manager.cpp
index be53d3440e5..d3c47e7f309 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass_manager.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass_manager.cpp
@@ -35,10 +35,18 @@ Pass::Status PassManager::Run(IRContext* context) {
if (print_all_stream_) {
std::vector<uint32_t> binary;
context->module()->ToBinary(&binary, false);
- SpirvTools t(SPV_ENV_UNIVERSAL_1_2);
+ SpirvTools t(target_env_);
+ t.SetMessageConsumer(consumer());
std::string disassembly;
- t.Disassemble(binary, &disassembly, 0);
- *print_all_stream_ << preamble << (pass ? pass->name() : "") << "\n"
+ std::string pass_name = (pass ? pass->name() : "");
+ if (!t.Disassemble(binary, &disassembly)) {
+ std::string msg = "Disassembly failed before pass ";
+ msg += pass_name + "\n";
+ spv_position_t null_pos{0, 0, 0};
+ consumer()(SPV_MSG_WARNING, "", null_pos, msg.c_str());
+ return;
+ }
+ *print_all_stream_ << preamble << pass_name << "\n"
<< disassembly << std::endl;
}
};
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass_manager.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass_manager.h
index 9686dddc269..11961a3305d 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass_manager.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/pass_manager.h
@@ -54,7 +54,7 @@ class PassManager {
// Adds an externally constructed pass.
void AddPass(std::unique_ptr<Pass> pass);
// Uses the argument |args| to construct a pass instance of type |T|, and adds
- // the pass instance to this pass manger. The pass added will use this pass
+ // the pass instance to this pass manager. The pass added will use this pass
// manager's message consumer.
template <typename T, typename... Args>
void AddPass(Args&&... args);
@@ -70,7 +70,7 @@ class PassManager {
// Runs all passes on the given |module|. Returns Status::Failure if errors
// occur when processing using one of the registered passes. All passes
// registered after the error-reporting pass will be skipped. Returns the
- // corresponding Status::Success if processing is succesful to indicate
+ // corresponding Status::Success if processing is successful to indicate
// whether changes are made to the module.
//
// After running all the passes, they are removed from the list.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/passes.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/passes.h
index da837f2ab84..21354c77b1f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/passes.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/passes.h
@@ -34,8 +34,10 @@
#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_members_pass.h"
#include "source/opt/empty_pass.h"
+#include "source/opt/fix_func_call_arguments.h"
#include "source/opt/fix_storage_class.h"
#include "source/opt/flatten_decoration_pass.h"
#include "source/opt/fold_spec_constant_op_and_composite_pass.h"
@@ -47,6 +49,7 @@
#include "source/opt/inst_bindless_check_pass.h"
#include "source/opt/inst_buff_addr_check_pass.h"
#include "source/opt/inst_debug_printf_pass.h"
+#include "source/opt/interface_var_sroa.h"
#include "source/opt/interp_fixup_pass.h"
#include "source/opt/licm_pass.h"
#include "source/opt/local_access_chain_convert_pass.h"
@@ -64,16 +67,19 @@
#include "source/opt/reduce_load_size.h"
#include "source/opt/redundancy_elimination.h"
#include "source/opt/relax_float_ops_pass.h"
+#include "source/opt/remove_dontinline_pass.h"
#include "source/opt/remove_duplicates_pass.h"
#include "source/opt/remove_unused_interface_variables_pass.h"
+#include "source/opt/replace_desc_array_access_using_var_index.h"
#include "source/opt/replace_invalid_opc.h"
#include "source/opt/scalar_replacement_pass.h"
#include "source/opt/set_spec_constant_default_value_pass.h"
#include "source/opt/simplification_pass.h"
+#include "source/opt/spread_volatile_semantics.h"
#include "source/opt/ssa_rewrite_pass.h"
#include "source/opt/strength_reduction_pass.h"
#include "source/opt/strip_debug_info_pass.h"
-#include "source/opt/strip_reflect_info_pass.h"
+#include "source/opt/strip_nonsemantic_info_pass.h"
#include "source/opt/unify_const_pass.h"
#include "source/opt/upgrade_memory_model.h"
#include "source/opt/vector_dce.h"
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/private_to_local_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/private_to_local_pass.cpp
index 12a226d5f1e..80fb4c535d2 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/private_to_local_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/private_to_local_pass.cpp
@@ -135,7 +135,7 @@ bool PrivateToLocalPass::MoveVariable(Instruction* variable,
// Place the variable at the start of the first basic block.
context()->AnalyzeUses(variable);
context()->set_instr_block(variable, &*function->begin());
- function->begin()->begin()->InsertBefore(move(var));
+ function->begin()->begin()->InsertBefore(std::move(var));
// Update uses where the type may have changed.
return UpdateUses(variable);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/private_to_local_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/private_to_local_pass.h
index c6127d67f9b..e96a965e910 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/private_to_local_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/private_to_local_pass.h
@@ -44,7 +44,7 @@ class PrivateToLocalPass : public Pass {
// class of |function|. Returns false if the variable could not be moved.
bool MoveVariable(Instruction* variable, Function* function);
- // |inst| is an instruction declaring a varible. If that variable is
+ // |inst| is an instruction declaring a variable. If that variable is
// referenced in a single function and all of uses are valid as defined by
// |IsValidUse|, then that function is returned. Otherwise, the return
// value is |nullptr|.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/reduce_load_size.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/reduce_load_size.cpp
index e9b8087489c..56491b2f2cb 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/reduce_load_size.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/reduce_load_size.cpp
@@ -161,8 +161,15 @@ bool ReduceLoadSize::ShouldReplaceExtract(Instruction* inst) {
case analysis::Type::kArray: {
const analysis::Constant* size_const =
const_mgr->FindDeclaredConstant(load_type->AsArray()->LengthId());
- assert(size_const->AsIntConstant());
- total_size = size_const->GetU32();
+
+ if (size_const) {
+ assert(size_const->AsIntConstant());
+ total_size = size_const->GetU32();
+ } else {
+ // The size is spec constant, so it is unknown at this time. Assume
+ // it is very large.
+ total_size = UINT32_MAX;
+ }
} break;
case analysis::Type::kStruct:
total_size = static_cast<uint32_t>(
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/redundancy_elimination.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/redundancy_elimination.cpp
index 362e54dc6b9..398225bb5d1 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/redundancy_elimination.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/redundancy_elimination.cpp
@@ -24,6 +24,10 @@ Pass::Status RedundancyEliminationPass::Process() {
ValueNumberTable vnTable(context());
for (auto& func : *get_module()) {
+ if (func.IsDeclaration()) {
+ continue;
+ }
+
// Build the dominator tree for this function. It is how the code is
// traversed.
DominatorTree& dom_tree =
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/redundancy_elimination.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/redundancy_elimination.h
index 91809b5d574..40451f40e21 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/redundancy_elimination.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/redundancy_elimination.h
@@ -41,7 +41,7 @@ class RedundancyEliminationPass : public LocalRedundancyEliminationPass {
// in the function containing |bb|.
//
// |value_to_ids| is a map from value number to ids. If {vn, id} is in
- // |value_to_ids| then vn is the value number of id, and the defintion of id
+ // |value_to_ids| then vn is the value number of id, and the definition of id
// dominates |bb|.
//
// Returns true if at least one instruction is deleted.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/reflect.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/reflect.h
index d300fe5dbef..c2ffb0beb4e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/reflect.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/reflect.h
@@ -51,7 +51,8 @@ inline bool IsTypeInst(SpvOp opcode) {
opcode == SpvOpTypeCooperativeMatrixNV;
}
inline bool IsConstantInst(SpvOp opcode) {
- return opcode >= SpvOpConstantTrue && opcode <= SpvOpSpecConstantOp;
+ return (opcode >= SpvOpConstantTrue && opcode <= SpvOpSpecConstantOp) ||
+ opcode == SpvOpConstantFunctionPointerINTEL;
}
inline bool IsCompileTimeConstantInst(SpvOp opcode) {
return opcode >= SpvOpConstantTrue && opcode <= SpvOpConstantNull;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/register_pressure.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/register_pressure.cpp
index 5750c6d4091..1ad337387b0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/register_pressure.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/register_pressure.cpp
@@ -378,7 +378,7 @@ void RegisterLiveness::SimulateFusion(
// The loop fusion is injecting the l1 before the l2, the latch of l1 will be
// connected to the header of l2.
// To compute the register usage, we inject the loop live-in (union of l1 and
- // l2 live-in header blocks) into the the live in/out of each basic block of
+ // l2 live-in header blocks) into the live in/out of each basic block of
// l1 to get the peak register usage. We then repeat the operation to for l2
// basic blocks but in this case we inject the live-out of the latch of l1.
auto live_loop = MakeFilterIteratorRange(
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/relax_float_ops_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/relax_float_ops_pass.cpp
index 73f16ddf3ff..3fcf8795574 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/relax_float_ops_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/relax_float_ops_pass.cpp
@@ -76,7 +76,7 @@ Pass::Status RelaxFloatOpsPass::ProcessImpl() {
Pass::ProcessFunction pfn = [this](Function* fp) {
return ProcessFunction(fp);
};
- bool modified = context()->ProcessEntryPointCallTree(pfn);
+ bool modified = context()->ProcessReachableCallTree(pfn);
return modified ? Status::SuccessWithChange : Status::SuccessWithoutChange;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.cpp
new file mode 100644
index 00000000000..4dd1cd4f24d
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.cpp
@@ -0,0 +1,49 @@
+// Copyright (c) 2022 Google LLC
+//
+// 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/remove_dontinline_pass.h"
+
+namespace spvtools {
+namespace opt {
+
+Pass::Status RemoveDontInline::Process() {
+ bool modified = false;
+ modified = ClearDontInlineFunctionControl();
+ return (modified ? Status::SuccessWithChange : Status::SuccessWithoutChange);
+}
+
+bool RemoveDontInline::ClearDontInlineFunctionControl() {
+ bool modified = false;
+ for (auto& func : *get_module()) {
+ ClearDontInlineFunctionControl(&func);
+ }
+ return modified;
+}
+
+bool RemoveDontInline::ClearDontInlineFunctionControl(Function* function) {
+ constexpr uint32_t kFunctionControlInOperandIdx = 0;
+ Instruction* function_inst = &function->DefInst();
+ uint32_t function_control =
+ function_inst->GetSingleWordInOperand(kFunctionControlInOperandIdx);
+
+ if ((function_control & SpvFunctionControlDontInlineMask) == 0) {
+ return false;
+ }
+ function_control &= ~SpvFunctionControlDontInlineMask;
+ function_inst->SetInOperand(kFunctionControlInOperandIdx, {function_control});
+ return true;
+}
+
+} // namespace opt
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.h
new file mode 100644
index 00000000000..162431991b6
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_dontinline_pass.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2022 Google LLC
+//
+// 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_REMOVE_DONTINLINE_PASS_H_
+#define SOURCE_OPT_REMOVE_DONTINLINE_PASS_H_
+
+#include "source/opt/pass.h"
+
+namespace spvtools {
+namespace opt {
+
+// See optimizer.hpp for documentation.
+class RemoveDontInline : public Pass {
+ public:
+ const char* name() const override { return "remove-dont-inline"; }
+ Status Process() override;
+
+ private:
+ // Clears the DontInline function control from every function in the module.
+ // Returns true of a change was made.
+ bool ClearDontInlineFunctionControl();
+
+ // Clears the DontInline function control from |function|.
+ // Returns true of a change was made.
+ bool ClearDontInlineFunctionControl(Function* function);
+};
+
+} // namespace opt
+} // namespace spvtools
+
+#endif // SOURCE_OPT_REMOVE_DONTINLINE_PASS_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_duplicates_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_duplicates_pass.cpp
index 0e65cc8d146..1ed8e2a046e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_duplicates_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/remove_duplicates_pass.cpp
@@ -72,9 +72,8 @@ bool RemoveDuplicatesPass::RemoveDuplicatesExtInstImports() const {
std::unordered_map<std::string, SpvId> ext_inst_imports;
for (auto* i = &*context()->ext_inst_import_begin(); i;) {
- auto res = ext_inst_imports.emplace(
- reinterpret_cast<const char*>(i->GetInOperand(0u).words.data()),
- i->result_id());
+ auto res = ext_inst_imports.emplace(i->GetInOperand(0u).AsString(),
+ i->result_id());
if (res.second) {
// Never seen before, keep it.
i = i->NextNode();
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.cpp
new file mode 100644
index 00000000000..e97593ef35c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.cpp
@@ -0,0 +1,429 @@
+// Copyright (c) 2021 Google LLC
+//
+// 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/replace_desc_array_access_using_var_index.h"
+
+#include "source/opt/desc_sroa_util.h"
+#include "source/opt/ir_builder.h"
+#include "source/util/string_utils.h"
+
+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;
+IRContext::Analysis kAnalysisDefUseAndInstrToBlockMapping =
+ IRContext::kAnalysisDefUse | IRContext::kAnalysisInstrToBlockMapping;
+
+uint32_t GetValueWithKeyExistenceCheck(
+ uint32_t key, const std::unordered_map<uint32_t, uint32_t>& map) {
+ auto itr = map.find(key);
+ assert(itr != map.end() && "Key does not exist");
+ return itr->second;
+}
+
+} // namespace
+
+Pass::Status ReplaceDescArrayAccessUsingVarIndex::Process() {
+ Status status = Status::SuccessWithoutChange;
+ for (Instruction& var : context()->types_values()) {
+ if (descsroautil::IsDescriptorArray(context(), &var)) {
+ if (ReplaceVariableAccessesWithConstantElements(&var))
+ status = Status::SuccessWithChange;
+ }
+ }
+ return status;
+}
+
+bool ReplaceDescArrayAccessUsingVarIndex::
+ ReplaceVariableAccessesWithConstantElements(Instruction* var) const {
+ std::vector<Instruction*> work_list;
+ get_def_use_mgr()->ForEachUser(var, [&work_list](Instruction* use) {
+ switch (use->opcode()) {
+ case SpvOpAccessChain:
+ case SpvOpInBoundsAccessChain:
+ work_list.push_back(use);
+ break;
+ default:
+ break;
+ }
+ });
+
+ bool updated = false;
+ for (Instruction* access_chain : work_list) {
+ if (descsroautil::GetAccessChainIndexAsConst(context(), access_chain) ==
+ nullptr) {
+ ReplaceAccessChain(var, access_chain);
+ updated = true;
+ }
+ }
+ // Note that we do not consider OpLoad and OpCompositeExtract because
+ // OpCompositeExtract always has constant literals for indices.
+ return updated;
+}
+
+void ReplaceDescArrayAccessUsingVarIndex::ReplaceAccessChain(
+ Instruction* var, Instruction* access_chain) const {
+ uint32_t number_of_elements =
+ descsroautil::GetNumberOfElementsForArrayOrStruct(context(), var);
+ assert(number_of_elements != 0 && "Number of element is 0");
+ if (number_of_elements == 1) {
+ UseConstIndexForAccessChain(access_chain, 0);
+ get_def_use_mgr()->AnalyzeInstUse(access_chain);
+ return;
+ }
+ ReplaceUsersOfAccessChain(access_chain, number_of_elements);
+}
+
+void ReplaceDescArrayAccessUsingVarIndex::ReplaceUsersOfAccessChain(
+ Instruction* access_chain, uint32_t number_of_elements) const {
+ std::vector<Instruction*> final_users;
+ CollectRecursiveUsersWithConcreteType(access_chain, &final_users);
+ for (auto* inst : final_users) {
+ std::deque<Instruction*> insts_to_be_cloned =
+ CollectRequiredImageAndAccessInsts(inst);
+ ReplaceNonUniformAccessWithSwitchCase(
+ inst, access_chain, number_of_elements, insts_to_be_cloned);
+ }
+}
+
+void ReplaceDescArrayAccessUsingVarIndex::CollectRecursiveUsersWithConcreteType(
+ Instruction* access_chain, std::vector<Instruction*>* final_users) const {
+ std::queue<Instruction*> work_list;
+ work_list.push(access_chain);
+ while (!work_list.empty()) {
+ auto* inst_from_work_list = work_list.front();
+ work_list.pop();
+ get_def_use_mgr()->ForEachUser(
+ inst_from_work_list, [this, final_users, &work_list](Instruction* use) {
+ // TODO: Support Boolean type as well.
+ if (!use->HasResultId() || IsConcreteType(use->type_id())) {
+ final_users->push_back(use);
+ } else {
+ work_list.push(use);
+ }
+ });
+ }
+}
+
+std::deque<Instruction*>
+ReplaceDescArrayAccessUsingVarIndex::CollectRequiredImageAndAccessInsts(
+ Instruction* user) const {
+ std::unordered_set<uint32_t> seen_inst_ids;
+ std::queue<Instruction*> work_list;
+
+ auto decision_to_include_operand = [this, &seen_inst_ids,
+ &work_list](uint32_t* idp) {
+ if (!seen_inst_ids.insert(*idp).second) return;
+ Instruction* operand = get_def_use_mgr()->GetDef(*idp);
+ if (context()->get_instr_block(operand) != nullptr &&
+ (HasImageOrImagePtrType(operand) ||
+ operand->opcode() == SpvOpAccessChain ||
+ operand->opcode() == SpvOpInBoundsAccessChain)) {
+ work_list.push(operand);
+ }
+ };
+
+ std::deque<Instruction*> required_insts;
+ required_insts.push_front(user);
+ user->ForEachInId(decision_to_include_operand);
+ while (!work_list.empty()) {
+ auto* inst_from_work_list = work_list.front();
+ work_list.pop();
+ required_insts.push_front(inst_from_work_list);
+ inst_from_work_list->ForEachInId(decision_to_include_operand);
+ }
+ return required_insts;
+}
+
+bool ReplaceDescArrayAccessUsingVarIndex::HasImageOrImagePtrType(
+ const Instruction* inst) const {
+ assert(inst != nullptr && inst->type_id() != 0 && "Invalid instruction");
+ return IsImageOrImagePtrType(get_def_use_mgr()->GetDef(inst->type_id()));
+}
+
+bool ReplaceDescArrayAccessUsingVarIndex::IsImageOrImagePtrType(
+ const Instruction* type_inst) const {
+ if (type_inst->opcode() == SpvOpTypeImage ||
+ type_inst->opcode() == SpvOpTypeSampler ||
+ type_inst->opcode() == SpvOpTypeSampledImage) {
+ return true;
+ }
+ if (type_inst->opcode() == SpvOpTypePointer) {
+ Instruction* pointee_type_inst = get_def_use_mgr()->GetDef(
+ type_inst->GetSingleWordInOperand(kOpTypePointerInOperandType));
+ return IsImageOrImagePtrType(pointee_type_inst);
+ }
+ if (type_inst->opcode() == SpvOpTypeArray) {
+ 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;
+ 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(
+ type_inst->GetSingleWordInOperand(kOpTypeStructInOperandMember));
+ if (IsImageOrImagePtrType(member_type_inst)) return true;
+ }
+ return false;
+}
+
+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) {
+ return true;
+ }
+ if (type_inst->opcode() == SpvOpTypeVector ||
+ type_inst->opcode() == SpvOpTypeMatrix ||
+ type_inst->opcode() == SpvOpTypeArray) {
+ return IsConcreteType(type_inst->GetSingleWordInOperand(0));
+ }
+ if (type_inst->opcode() == SpvOpTypeStruct) {
+ for (uint32_t i = 0; i < type_inst->NumInOperands(); ++i) {
+ if (!IsConcreteType(type_inst->GetSingleWordInOperand(i))) return false;
+ }
+ return true;
+ }
+ return false;
+}
+
+BasicBlock* ReplaceDescArrayAccessUsingVarIndex::CreateCaseBlock(
+ Instruction* access_chain, uint32_t element_index,
+ const std::deque<Instruction*>& insts_to_be_cloned,
+ uint32_t branch_target_id,
+ std::unordered_map<uint32_t, uint32_t>* old_ids_to_new_ids) const {
+ auto* case_block = CreateNewBlock();
+ AddConstElementAccessToCaseBlock(case_block, access_chain, element_index,
+ old_ids_to_new_ids);
+ CloneInstsToBlock(case_block, access_chain, insts_to_be_cloned,
+ old_ids_to_new_ids);
+ AddBranchToBlock(case_block, branch_target_id);
+ UseNewIdsInBlock(case_block, *old_ids_to_new_ids);
+ return case_block;
+}
+
+void ReplaceDescArrayAccessUsingVarIndex::CloneInstsToBlock(
+ BasicBlock* block, Instruction* inst_to_skip_cloning,
+ const std::deque<Instruction*>& insts_to_be_cloned,
+ std::unordered_map<uint32_t, uint32_t>* old_ids_to_new_ids) const {
+ for (auto* inst_to_be_cloned : insts_to_be_cloned) {
+ if (inst_to_be_cloned == inst_to_skip_cloning) continue;
+ std::unique_ptr<Instruction> clone(inst_to_be_cloned->Clone(context()));
+ if (inst_to_be_cloned->HasResultId()) {
+ uint32_t new_id = context()->TakeNextId();
+ clone->SetResultId(new_id);
+ (*old_ids_to_new_ids)[inst_to_be_cloned->result_id()] = new_id;
+ }
+ get_def_use_mgr()->AnalyzeInstDefUse(clone.get());
+ context()->set_instr_block(clone.get(), block);
+ block->AddInstruction(std::move(clone));
+ }
+}
+
+void ReplaceDescArrayAccessUsingVarIndex::UseNewIdsInBlock(
+ BasicBlock* block,
+ const std::unordered_map<uint32_t, uint32_t>& old_ids_to_new_ids) const {
+ for (auto block_itr = block->begin(); block_itr != block->end();
+ ++block_itr) {
+ (&*block_itr)->ForEachInId([&old_ids_to_new_ids](uint32_t* idp) {
+ auto old_ids_to_new_ids_itr = old_ids_to_new_ids.find(*idp);
+ if (old_ids_to_new_ids_itr == old_ids_to_new_ids.end()) return;
+ *idp = old_ids_to_new_ids_itr->second;
+ });
+ get_def_use_mgr()->AnalyzeInstUse(&*block_itr);
+ }
+}
+
+void ReplaceDescArrayAccessUsingVarIndex::ReplaceNonUniformAccessWithSwitchCase(
+ Instruction* access_chain_final_user, Instruction* access_chain,
+ uint32_t number_of_elements,
+ const std::deque<Instruction*>& insts_to_be_cloned) const {
+ auto* block = context()->get_instr_block(access_chain_final_user);
+ // If the instruction does not belong to a block (i.e. in the case of
+ // OpDecorate), no replacement is needed.
+ if (!block) return;
+
+ // Create merge block and add terminator
+ auto* merge_block = SeparateInstructionsIntoNewBlock(
+ block, access_chain_final_user->NextNode());
+
+ auto* function = block->GetParent();
+
+ // Add case blocks
+ std::vector<uint32_t> phi_operands;
+ std::vector<uint32_t> case_block_ids;
+ for (uint32_t idx = 0; idx < number_of_elements; ++idx) {
+ std::unordered_map<uint32_t, uint32_t> old_ids_to_new_ids_for_cloned_insts;
+ std::unique_ptr<BasicBlock> case_block(CreateCaseBlock(
+ access_chain, idx, insts_to_be_cloned, merge_block->id(),
+ &old_ids_to_new_ids_for_cloned_insts));
+ case_block_ids.push_back(case_block->id());
+ function->InsertBasicBlockBefore(std::move(case_block), merge_block);
+
+ // Keep the operand for OpPhi
+ if (!access_chain_final_user->HasResultId()) continue;
+ uint32_t phi_operand =
+ GetValueWithKeyExistenceCheck(access_chain_final_user->result_id(),
+ old_ids_to_new_ids_for_cloned_insts);
+ phi_operands.push_back(phi_operand);
+ }
+
+ // Create default block
+ std::unique_ptr<BasicBlock> default_block(
+ CreateDefaultBlock(access_chain_final_user->HasResultId(), &phi_operands,
+ merge_block->id()));
+ uint32_t default_block_id = default_block->id();
+ function->InsertBasicBlockBefore(std::move(default_block), merge_block);
+
+ // Create OpSwitch
+ uint32_t access_chain_index_var_id =
+ descsroautil::GetFirstIndexOfAccessChain(access_chain);
+ AddSwitchForAccessChain(block, access_chain_index_var_id, default_block_id,
+ merge_block->id(), case_block_ids);
+
+ // Create phi instructions
+ if (!phi_operands.empty()) {
+ uint32_t phi_id = CreatePhiInstruction(merge_block, phi_operands,
+ case_block_ids, default_block_id);
+ context()->ReplaceAllUsesWith(access_chain_final_user->result_id(), phi_id);
+ }
+
+ // Replace OpPhi incoming block operand that uses |block| with |merge_block|
+ ReplacePhiIncomingBlock(block->id(), merge_block->id());
+}
+
+BasicBlock*
+ReplaceDescArrayAccessUsingVarIndex::SeparateInstructionsIntoNewBlock(
+ BasicBlock* block, Instruction* separation_begin_inst) const {
+ auto separation_begin = block->begin();
+ while (separation_begin != block->end() &&
+ &*separation_begin != separation_begin_inst) {
+ ++separation_begin;
+ }
+ return block->SplitBasicBlock(context(), context()->TakeNextId(),
+ separation_begin);
+}
+
+BasicBlock* ReplaceDescArrayAccessUsingVarIndex::CreateNewBlock() const {
+ auto* new_block = new BasicBlock(std::unique_ptr<Instruction>(
+ new Instruction(context(), SpvOpLabel, 0, context()->TakeNextId(), {})));
+ get_def_use_mgr()->AnalyzeInstDefUse(new_block->GetLabelInst());
+ context()->set_instr_block(new_block->GetLabelInst(), new_block);
+ return new_block;
+}
+
+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);
+ access_chain->SetInOperand(kOpAccessChainInOperandIndexes,
+ {const_element_idx_id});
+}
+
+void ReplaceDescArrayAccessUsingVarIndex::AddConstElementAccessToCaseBlock(
+ BasicBlock* case_block, Instruction* access_chain,
+ uint32_t const_element_idx,
+ std::unordered_map<uint32_t, uint32_t>* old_ids_to_new_ids) const {
+ std::unique_ptr<Instruction> access_clone(access_chain->Clone(context()));
+ UseConstIndexForAccessChain(access_clone.get(), const_element_idx);
+
+ uint32_t new_access_id = context()->TakeNextId();
+ (*old_ids_to_new_ids)[access_clone->result_id()] = new_access_id;
+ access_clone->SetResultId(new_access_id);
+ get_def_use_mgr()->AnalyzeInstDefUse(access_clone.get());
+
+ context()->set_instr_block(access_clone.get(), case_block);
+ case_block->AddInstruction(std::move(access_clone));
+}
+
+void ReplaceDescArrayAccessUsingVarIndex::AddBranchToBlock(
+ BasicBlock* parent_block, uint32_t branch_destination) const {
+ InstructionBuilder builder{context(), parent_block,
+ kAnalysisDefUseAndInstrToBlockMapping};
+ builder.AddBranch(branch_destination);
+}
+
+BasicBlock* ReplaceDescArrayAccessUsingVarIndex::CreateDefaultBlock(
+ bool null_const_for_phi_is_needed, std::vector<uint32_t>* phi_operands,
+ uint32_t merge_block_id) const {
+ auto* default_block = CreateNewBlock();
+ AddBranchToBlock(default_block, merge_block_id);
+ if (!null_const_for_phi_is_needed) return default_block;
+
+ // Create null value for OpPhi
+ Instruction* inst = context()->get_def_use_mgr()->GetDef((*phi_operands)[0]);
+ auto* null_const_inst = GetConstNull(inst->type_id());
+ phi_operands->push_back(null_const_inst->result_id());
+ return default_block;
+}
+
+Instruction* ReplaceDescArrayAccessUsingVarIndex::GetConstNull(
+ uint32_t type_id) const {
+ assert(type_id != 0 && "Result type is expected");
+ auto* type = context()->get_type_mgr()->GetType(type_id);
+ auto* null_const = context()->get_constant_mgr()->GetConstant(type, {});
+ return context()->get_constant_mgr()->GetDefiningInstruction(null_const);
+}
+
+void ReplaceDescArrayAccessUsingVarIndex::AddSwitchForAccessChain(
+ BasicBlock* parent_block, uint32_t access_chain_index_var_id,
+ uint32_t default_id, uint32_t merge_id,
+ const std::vector<uint32_t>& case_block_ids) const {
+ InstructionBuilder builder{context(), parent_block,
+ kAnalysisDefUseAndInstrToBlockMapping};
+ std::vector<std::pair<Operand::OperandData, uint32_t>> cases;
+ for (uint32_t i = 0; i < static_cast<uint32_t>(case_block_ids.size()); ++i) {
+ cases.emplace_back(Operand::OperandData{i}, case_block_ids[i]);
+ }
+ builder.AddSwitch(access_chain_index_var_id, default_id, cases, merge_id);
+}
+
+uint32_t ReplaceDescArrayAccessUsingVarIndex::CreatePhiInstruction(
+ BasicBlock* parent_block, const std::vector<uint32_t>& phi_operands,
+ const std::vector<uint32_t>& case_block_ids,
+ uint32_t default_block_id) const {
+ std::vector<uint32_t> incomings;
+ assert(case_block_ids.size() + 1 == phi_operands.size() &&
+ "Number of Phi operands must be exactly 1 bigger than the one of case "
+ "blocks");
+ for (size_t i = 0; i < case_block_ids.size(); ++i) {
+ incomings.push_back(phi_operands[i]);
+ incomings.push_back(case_block_ids[i]);
+ }
+ incomings.push_back(phi_operands.back());
+ incomings.push_back(default_block_id);
+
+ InstructionBuilder builder{context(), &*parent_block->begin(),
+ kAnalysisDefUseAndInstrToBlockMapping};
+ uint32_t phi_result_type_id =
+ context()->get_def_use_mgr()->GetDef(phi_operands[0])->type_id();
+ auto* phi = builder.AddPhi(phi_result_type_id, incomings);
+ return phi->result_id();
+}
+
+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; });
+}
+
+} // namespace opt
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.h
new file mode 100644
index 00000000000..51817c15f77
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_desc_array_access_using_var_index.h
@@ -0,0 +1,205 @@
+// Copyright (c) 2021 Google LLC
+//
+// 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_REPLACE_DESC_VAR_INDEX_ACCESS_H_
+#define SOURCE_OPT_REPLACE_DESC_VAR_INDEX_ACCESS_H_
+
+#include <cstdio>
+#include <memory>
+#include <queue>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+
+#include "source/opt/function.h"
+#include "source/opt/pass.h"
+#include "source/opt/type_manager.h"
+
+namespace spvtools {
+namespace opt {
+
+// See optimizer.hpp for documentation.
+class ReplaceDescArrayAccessUsingVarIndex : public Pass {
+ public:
+ ReplaceDescArrayAccessUsingVarIndex() {}
+
+ const char* name() const override {
+ return "replace-desc-array-access-using-var-index";
+ }
+
+ Status Process() override;
+
+ IRContext::Analysis GetPreservedAnalyses() override {
+ return IRContext::kAnalysisDefUse |
+ IRContext::kAnalysisInstrToBlockMapping |
+ IRContext::kAnalysisConstants | IRContext::kAnalysisTypes;
+ }
+
+ private:
+ // Replaces all accesses to |var| using variable indices with constant
+ // elements of the array |var|. Creates switch-case statements to determine
+ // the value of the variable index for all the possible cases. Returns
+ // whether replacement is done or not.
+ bool ReplaceVariableAccessesWithConstantElements(Instruction* var) const;
+
+ // Replaces the OpAccessChain or OpInBoundsAccessChain instruction |use| that
+ // uses the descriptor variable |var| with the OpAccessChain or
+ // OpInBoundsAccessChain instruction with a constant Indexes operand.
+ void ReplaceAccessChain(Instruction* var, Instruction* use) const;
+
+ // Updates the first Indexes operand of the OpAccessChain or
+ // OpInBoundsAccessChain instruction |access_chain| to let it use a constant
+ // index |const_element_idx|.
+ void UseConstIndexForAccessChain(Instruction* access_chain,
+ uint32_t const_element_idx) const;
+
+ // Replaces users of the OpAccessChain or OpInBoundsAccessChain instruction
+ // |access_chain| that accesses an array descriptor variable using variable
+ // indices with constant elements. |number_of_elements| is the number
+ // of array elements.
+ void ReplaceUsersOfAccessChain(Instruction* access_chain,
+ uint32_t number_of_elements) const;
+
+ // Puts all the recursive users of |access_chain| with concrete result types
+ // or the ones without result it in |final_users|.
+ void CollectRecursiveUsersWithConcreteType(
+ Instruction* access_chain, std::vector<Instruction*>* final_users) const;
+
+ // Recursively collects the operands of |user| (and operands of the operands)
+ // whose result types are images/samplers (or pointers/arrays/ structs of
+ // them) and access chains instructions and returns them. The returned
+ // collection includes |user|.
+ std::deque<Instruction*> CollectRequiredImageAndAccessInsts(
+ Instruction* user) const;
+
+ // Returns whether result type of |inst| is an image/sampler/pointer of image
+ // or sampler or not.
+ bool HasImageOrImagePtrType(const Instruction* inst) const;
+
+ // Returns whether |type_inst| is an image/sampler or pointer/array/struct of
+ // image or sampler or not.
+ bool IsImageOrImagePtrType(const Instruction* type_inst) const;
+
+ // Returns whether the type with |type_id| is a concrete type or not.
+ bool IsConcreteType(uint32_t type_id) const;
+
+ // Replaces the non-uniform access to a descriptor variable
+ // |access_chain_final_user| with OpSwitch instruction and case blocks. Each
+ // case block will contain a clone of |access_chain| and clones of
+ // |non_uniform_accesses_to_clone| that are recursively used by
+ // |access_chain_final_user|. The clone of |access_chain| (or
+ // OpInBoundsAccessChain) will have a constant index for its first index. The
+ // OpSwitch instruction will have the cases for the variable index of
+ // |access_chain| from 0 to |number_of_elements| - 1.
+ void ReplaceNonUniformAccessWithSwitchCase(
+ Instruction* access_chain_final_user, Instruction* access_chain,
+ uint32_t number_of_elements,
+ const std::deque<Instruction*>& non_uniform_accesses_to_clone) const;
+
+ // Creates and returns a new basic block that contains all instructions of
+ // |block| after |separation_begin_inst|. The new basic block is added to the
+ // function in this method.
+ BasicBlock* SeparateInstructionsIntoNewBlock(
+ BasicBlock* block, Instruction* separation_begin_inst) const;
+
+ // Creates and returns a new block.
+ BasicBlock* CreateNewBlock() const;
+
+ // Returns the first operand id of the OpAccessChain or OpInBoundsAccessChain
+ // instruction |access_chain|.
+ uint32_t GetFirstIndexOfAccessChain(Instruction* access_chain) const;
+
+ // Adds a clone of the OpAccessChain or OpInBoundsAccessChain instruction
+ // |access_chain| to |case_block|. The clone of |access_chain| will use
+ // |const_element_idx| for its first index. |old_ids_to_new_ids| keeps the
+ // mapping from the result id of |access_chain| to the result of its clone.
+ void AddConstElementAccessToCaseBlock(
+ BasicBlock* case_block, Instruction* access_chain,
+ uint32_t const_element_idx,
+ std::unordered_map<uint32_t, uint32_t>* old_ids_to_new_ids) const;
+
+ // Clones all instructions in |insts_to_be_cloned| and put them to |block|.
+ // |old_ids_to_new_ids| keeps the mapping from the result id of each
+ // instruction of |insts_to_be_cloned| to the result of their clones.
+ void CloneInstsToBlock(
+ BasicBlock* block, Instruction* inst_to_skip_cloning,
+ const std::deque<Instruction*>& insts_to_be_cloned,
+ std::unordered_map<uint32_t, uint32_t>* old_ids_to_new_ids) const;
+
+ // Adds OpBranch to |branch_destination| at the end of |parent_block|.
+ void AddBranchToBlock(BasicBlock* parent_block,
+ uint32_t branch_destination) const;
+
+ // Replaces in-operands of all instructions in the basic block |block| using
+ // |old_ids_to_new_ids|. It conducts the replacement only if the in-operand
+ // id is a key of |old_ids_to_new_ids|.
+ void UseNewIdsInBlock(
+ BasicBlock* block,
+ const std::unordered_map<uint32_t, uint32_t>& old_ids_to_new_ids) const;
+
+ // Creates a case block for |element_index| case. It adds clones of
+ // |insts_to_be_cloned| and a clone of |access_chain| with |element_index| as
+ // its first index. The termination instruction of the created case block will
+ // be a branch to |branch_target_id|. Puts old ids to new ids map for the
+ // cloned instructions in |old_ids_to_new_ids|.
+ BasicBlock* CreateCaseBlock(
+ Instruction* access_chain, uint32_t element_index,
+ const std::deque<Instruction*>& insts_to_be_cloned,
+ uint32_t branch_target_id,
+ std::unordered_map<uint32_t, uint32_t>* old_ids_to_new_ids) const;
+
+ // Creates a default block for switch-case statement that has only a single
+ // instruction OpBranch whose target is a basic block with |merge_block_id|.
+ // If |null_const_for_phi_is_needed| is true, gets or creates a default null
+ // constant value for a phi instruction whose operands are |phi_operands| and
+ // puts it in |phi_operands|.
+ BasicBlock* CreateDefaultBlock(bool null_const_for_phi_is_needed,
+ std::vector<uint32_t>* phi_operands,
+ uint32_t merge_block_id) const;
+
+ // Creates and adds an OpSwitch used for the selection of OpAccessChain whose
+ // first Indexes operand is |access_chain_index_var_id|. The OpSwitch will be
+ // added at the end of |parent_block|. It will jump to |default_id| for the
+ // default case and jumps to one of case blocks whose ids are |case_block_ids|
+ // if |access_chain_index_var_id| matches the case number. |merge_id| is the
+ // merge block id.
+ void AddSwitchForAccessChain(
+ BasicBlock* parent_block, uint32_t access_chain_index_var_id,
+ uint32_t default_id, uint32_t merge_id,
+ const std::vector<uint32_t>& case_block_ids) const;
+
+ // Creates a phi instruction with |phi_operands| as values and
+ // |case_block_ids| and |default_block_id| as incoming blocks. The size of
+ // |phi_operands| must be exactly 1 larger than the size of |case_block_ids|.
+ // The last element of |phi_operands| will be used for |default_block_id|. It
+ // adds the phi instruction to the beginning of |parent_block|.
+ uint32_t CreatePhiInstruction(BasicBlock* parent_block,
+ const std::vector<uint32_t>& phi_operands,
+ const std::vector<uint32_t>& case_block_ids,
+ uint32_t default_block_id) const;
+
+ // Replaces the incoming block operand of OpPhi instructions with
+ // |new_incoming_block_id| if the incoming block operand is
+ // |old_incoming_block_id|.
+ void ReplacePhiIncomingBlock(uint32_t old_incoming_block_id,
+ uint32_t new_incoming_block_id) const;
+
+ // Create an OpConstantNull instruction whose result type id is |type_id|.
+ Instruction* GetConstNull(uint32_t type_id) const;
+};
+
+} // namespace opt
+} // namespace spvtools
+
+#endif // SOURCE_OPT_REPLACE_DESC_VAR_INDEX_ACCESS_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_invalid_opc.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_invalid_opc.cpp
index e3b9d3e4034..1dcd06f591b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_invalid_opc.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/replace_invalid_opc.cpp
@@ -112,8 +112,7 @@ bool ReplaceInvalidOpcodePass::RewriteFunction(Function* function,
}
Instruction* file_name =
context()->get_def_use_mgr()->GetDef(file_name_id);
- const char* source = reinterpret_cast<const char*>(
- &file_name->GetInOperand(0).words[0]);
+ const std::string source = file_name->GetInOperand(0).AsString();
// Get the line number and column number.
uint32_t line_number =
@@ -121,7 +120,7 @@ bool ReplaceInvalidOpcodePass::RewriteFunction(Function* function,
uint32_t col_number = last_line_dbg_inst->GetSingleWordInOperand(2);
// Replace the instruction.
- ReplaceInstruction(inst, source, line_number, col_number);
+ ReplaceInstruction(inst, source.c_str(), line_number, col_number);
}
}
},
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis.cpp
index 38555e649e4..2b0a824cf0a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis.cpp
@@ -581,7 +581,7 @@ static void PushToString(T id, std::u32string* str) {
// Implements the hashing of SENodes.
size_t SENodeHash::operator()(const SENode* node) const {
- // Concatinate the terms into a string which we can hash.
+ // Concatenate the terms into a string which we can hash.
std::u32string hash_string{};
// Hashing the type as a string is safer than hashing the enum as the enum is
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis_nodes.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis_nodes.h
index b0e3fefd6f2..91ce446f3d1 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis_nodes.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis_nodes.h
@@ -167,7 +167,7 @@ class SENode {
const ChildContainerType& GetChildren() const { return children_; }
ChildContainerType& GetChildren() { return children_; }
- // Return true if this node is a cant compute node.
+ // Return true if this node is a can't compute node.
bool IsCantCompute() const { return GetType() == CanNotCompute; }
// Implements a casting method for each type.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis_simplification.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis_simplification.cpp
index 52f2d6ad90a..3c1ecc082a6 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis_simplification.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_analysis_simplification.cpp
@@ -88,7 +88,7 @@ class SENodeSimplifyImpl {
private:
// Recursively descend through the graph to build up the accumulator objects
- // which are used to flatten the graph. |child| is the node currenty being
+ // which are used to flatten the graph. |child| is the node currently being
// traversed and the |negation| flag is used to signify that this operation
// was preceded by a unary negative operation and as such the result should be
// negated.
@@ -134,7 +134,7 @@ class SENodeSimplifyImpl {
// offset.
SENode* EliminateZeroCoefficientRecurrents(SENode* node);
- // A reference the the analysis which requested the simplification.
+ // A reference the analysis which requested the simplification.
ScalarEvolutionAnalysis& analysis_;
// The node being simplified.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp
index 8bc04991e1d..e27c828b06c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.cpp
@@ -24,6 +24,7 @@
#include "source/opt/reflect.h"
#include "source/opt/types.h"
#include "source/util/make_unique.h"
+#include "types.h"
static const uint32_t kDebugValueOperandValueIndex = 5;
static const uint32_t kDebugValueOperandExpressionIndex = 6;
@@ -35,6 +36,10 @@ namespace opt {
Pass::Status ScalarReplacementPass::Process() {
Status status = Status::SuccessWithoutChange;
for (auto& f : *get_module()) {
+ if (f.IsDeclaration()) {
+ continue;
+ }
+
Status functionStatus = ProcessFunction(&f);
if (functionStatus == Status::Failure)
return functionStatus;
@@ -391,7 +396,7 @@ bool ScalarReplacementPass::CreateReplacementVariables(
if (!components_used || components_used->count(elem)) {
CreateVariable(*id, inst, elem, replacements);
} else {
- replacements->push_back(CreateNullConstant(*id));
+ replacements->push_back(GetUndef(*id));
}
elem++;
});
@@ -402,8 +407,8 @@ bool ScalarReplacementPass::CreateReplacementVariables(
CreateVariable(type->GetSingleWordInOperand(0u), inst, i,
replacements);
} else {
- replacements->push_back(
- CreateNullConstant(type->GetSingleWordInOperand(0u)));
+ uint32_t element_type_id = type->GetSingleWordInOperand(0);
+ replacements->push_back(GetUndef(element_type_id));
}
}
break;
@@ -425,6 +430,10 @@ bool ScalarReplacementPass::CreateReplacementVariables(
replacements->end();
}
+Instruction* ScalarReplacementPass::GetUndef(uint32_t type_id) {
+ return get_def_use_mgr()->GetDef(Type2Undef(type_id));
+}
+
void ScalarReplacementPass::TransferAnnotations(
const Instruction* source, std::vector<Instruction*>* replacements) {
// Only transfer invariant and restrict decorations on the variable. There are
@@ -977,20 +986,6 @@ ScalarReplacementPass::GetUsedComponents(Instruction* inst) {
return result;
}
-Instruction* ScalarReplacementPass::CreateNullConstant(uint32_t type_id) {
- 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);
- const analysis::Constant* null_const = const_mgr->GetConstant(type, {});
- Instruction* null_inst =
- const_mgr->GetDefiningInstruction(null_const, type_id);
- if (null_inst != nullptr) {
- context()->UpdateDefUse(null_inst);
- }
- return null_inst;
-}
-
uint64_t ScalarReplacementPass::GetMaxLegalIndex(
const Instruction* var_inst) const {
assert(var_inst->opcode() == SpvOpVariable &&
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.h
index 0928830c07a..6a66dfb80c1 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/scalar_replacement_pass.h
@@ -15,6 +15,7 @@
#ifndef SOURCE_OPT_SCALAR_REPLACEMENT_PASS_H_
#define SOURCE_OPT_SCALAR_REPLACEMENT_PASS_H_
+#include <cassert>
#include <cstdio>
#include <memory>
#include <queue>
@@ -23,23 +24,34 @@
#include <vector>
#include "source/opt/function.h"
-#include "source/opt/pass.h"
+#include "source/opt/mem_pass.h"
#include "source/opt/type_manager.h"
namespace spvtools {
namespace opt {
// Documented in optimizer.hpp
-class ScalarReplacementPass : public Pass {
+class ScalarReplacementPass : public MemPass {
private:
static const uint32_t kDefaultLimit = 100;
public:
ScalarReplacementPass(uint32_t limit = kDefaultLimit)
: max_num_elements_(limit) {
- name_[0] = '\0';
- strcat(name_, "scalar-replacement=");
- sprintf(&name_[strlen(name_)], "%d", max_num_elements_);
+ const auto num_to_write = snprintf(
+ name_, sizeof(name_), "scalar-replacement=%u", max_num_elements_);
+ assert(size_t(num_to_write) < sizeof(name_));
+ (void)num_to_write; // Mark as unused
+
+#ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION
+ // ClusterFuzz/OSS-Fuzz is likely to yield examples with very large arrays.
+ // This can cause timeouts and memouts during fuzzing that
+ // are not classed as bugs. To avoid this noise, we set the
+ // max_num_elements_ to a smaller value for fuzzing.
+ max_num_elements_ =
+ (max_num_elements_ > 0 && max_num_elements_ < 100 ? max_num_elements_
+ : 100);
+#endif
}
const char* name() const override { return name_; }
@@ -234,10 +246,8 @@ class ScalarReplacementPass : public Pass {
std::unique_ptr<std::unordered_set<int64_t>> GetUsedComponents(
Instruction* inst);
- // Returns an instruction defining a null constant with type |type_id|. If
- // one already exists, it is returned. Otherwise a new one is created.
- // Returns |nullptr| if the new constant could not be created.
- Instruction* CreateNullConstant(uint32_t type_id);
+ // Returns an instruction defining an undefined value type |type_id|.
+ Instruction* GetUndef(uint32_t type_id);
// Maps storage type to a pointer type enclosing that type.
std::unordered_map<uint32_t, uint32_t> pointee_to_pointer_;
@@ -255,7 +265,10 @@ class ScalarReplacementPass : public Pass {
// Limit on the number of members in an object that will be replaced.
// 0 means there is no limit.
uint32_t max_num_elements_;
- char name_[55];
+ // 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.
+ char name_[30];
};
} // namespace opt
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp
index 4c8d116f763..4def2b09a97 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/set_spec_constant_default_value_pass.cpp
@@ -85,6 +85,10 @@ std::vector<uint32_t> ParseDefaultValueStr(const char* text,
// with 0x1, which represents a 'true'.
// If all words in the bit pattern are zero, returns a bit pattern with 0x0,
// which represents a 'false'.
+// For integer and floating point types narrower than 32 bits, the upper bits
+// in the input bit pattern are ignored. Instead the upper bits are set
+// according to SPIR-V literal requirements: sign extend a signed integer, and
+// otherwise set the upper bits to zero.
std::vector<uint32_t> ParseDefaultValueBitPattern(
const std::vector<uint32_t>& input_bit_pattern,
const analysis::Type* type) {
@@ -98,12 +102,33 @@ std::vector<uint32_t> ParseDefaultValueBitPattern(
}
return result;
} else if (const auto* IT = type->AsInteger()) {
- if (IT->width() == input_bit_pattern.size() * sizeof(uint32_t) * 8) {
- return std::vector<uint32_t>(input_bit_pattern);
+ const auto width = IT->width();
+ assert(width > 0);
+ const auto adjusted_width = std::max(32u, width);
+ if (adjusted_width == input_bit_pattern.size() * sizeof(uint32_t) * 8) {
+ result = std::vector<uint32_t>(input_bit_pattern);
+ if (width < 32) {
+ const uint32_t high_active_bit = (1u << width) >> 1;
+ if (IT->IsSigned() && (high_active_bit & result[0])) {
+ // Sign extend. This overwrites the sign bit again, but that's ok.
+ result[0] = result[0] | ~(high_active_bit - 1);
+ } else {
+ // Upper bits must be zero.
+ result[0] = result[0] & ((1u << width) - 1);
+ }
+ }
+ return result;
}
} else if (const auto* FT = type->AsFloat()) {
- if (FT->width() == input_bit_pattern.size() * sizeof(uint32_t) * 8) {
- return std::vector<uint32_t>(input_bit_pattern);
+ const auto width = FT->width();
+ const auto adjusted_width = std::max(32u, width);
+ if (adjusted_width == input_bit_pattern.size() * sizeof(uint32_t) * 8) {
+ result = std::vector<uint32_t>(input_bit_pattern);
+ if (width < 32) {
+ // Upper bits must be zero.
+ result[0] = result[0] & ((1u << width) - 1);
+ }
+ return result;
}
}
result.clear();
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.cpp
index 319ceecfd45..43ec15f805f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/simplification_pass.cpp
@@ -45,6 +45,10 @@ void SimplificationPass::AddNewOperands(
}
bool SimplificationPass::SimplifyFunction(Function* function) {
+ if (function->IsDeclaration()) {
+ return false;
+ }
+
bool modified = false;
// Phase 1: Traverse all instructions in dominance order.
// The second phase will only be on the instructions whose inputs have changed
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.cpp
new file mode 100644
index 00000000000..b61fd0f4c14
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.cpp
@@ -0,0 +1,298 @@
+// Copyright (c) 2022 Google LLC
+//
+// 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/spread_volatile_semantics.h"
+
+#include "source/opt/decoration_manager.h"
+#include "source/opt/ir_builder.h"
+#include "source/spirv_constant.h"
+
+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;
+
+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) {
+ return built_in == inst.GetSingleWordInOperand(
+ kOpDecorateInOperandBuiltinDecoration);
+ });
+}
+
+bool IsBuiltInForRayTracingVolatileSemantics(uint32_t built_in) {
+ switch (built_in) {
+ case SpvBuiltInSMIDNV:
+ case SpvBuiltInWarpIDNV:
+ case SpvBuiltInSubgroupSize:
+ case SpvBuiltInSubgroupLocalInvocationId:
+ case SpvBuiltInSubgroupEqMask:
+ case SpvBuiltInSubgroupGeMask:
+ case SpvBuiltInSubgroupGtMask:
+ case SpvBuiltInSubgroupLeMask:
+ case SpvBuiltInSubgroupLtMask:
+ return true;
+ default:
+ return false;
+ }
+}
+
+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);
+ return IsBuiltInForRayTracingVolatileSemantics(built_in);
+ });
+}
+
+bool HasVolatileDecoration(analysis::DecorationManager* decoration_manager,
+ uint32_t var_id) {
+ return decoration_manager->HasDecoration(var_id, SpvDecorationVolatile);
+}
+
+} // namespace
+
+Pass::Status SpreadVolatileSemantics::Process() {
+ if (HasNoExecutionModel()) {
+ return Status::SuccessWithoutChange;
+ }
+ const bool is_vk_memory_model_enabled =
+ context()->get_feature_mgr()->HasCapability(
+ SpvCapabilityVulkanMemoryModel);
+ CollectTargetsForVolatileSemantics(is_vk_memory_model_enabled);
+
+ // If VulkanMemoryModel capability is not enabled, we have to set Volatile
+ // decoration for interface variables instead of setting Volatile for load
+ // instructions. If an interface (or pointers to it) is used by two load
+ // instructions in two entry points and one must be volatile while another
+ // is not, we have to report an error for the conflict.
+ if (!is_vk_memory_model_enabled &&
+ HasInterfaceInConflictOfVolatileSemantics()) {
+ return Status::Failure;
+ }
+
+ return SpreadVolatileSemanticsToVariables(is_vk_memory_model_enabled);
+}
+
+Pass::Status SpreadVolatileSemantics::SpreadVolatileSemanticsToVariables(
+ const bool is_vk_memory_model_enabled) {
+ Status status = Status::SuccessWithoutChange;
+ for (Instruction& var : context()->types_values()) {
+ auto entry_function_ids =
+ EntryFunctionsToSpreadVolatileSemanticsForVar(var.result_id());
+ if (entry_function_ids.empty()) {
+ continue;
+ }
+
+ if (is_vk_memory_model_enabled) {
+ SetVolatileForLoadsInEntries(&var, entry_function_ids);
+ } else {
+ DecorateVarWithVolatile(&var);
+ }
+ status = Status::SuccessWithChange;
+ }
+ return status;
+}
+
+bool SpreadVolatileSemantics::IsTargetUsedByNonVolatileLoadInEntryPoint(
+ uint32_t var_id, Instruction* entry_point) {
+ uint32_t entry_function_id =
+ entry_point->GetSingleWordInOperand(kOpEntryPointInOperandEntryPoint);
+ std::unordered_set<uint32_t> funcs;
+ context()->CollectCallTreeFromRoots(entry_function_id, &funcs);
+ return !VisitLoadsOfPointersToVariableInEntries(
+ var_id,
+ [](Instruction* load) {
+ // If it has a load without volatile memory operand, finish traversal
+ // and return false.
+ if (load->NumInOperands() <= kOpLoadInOperandMemoryOperands) {
+ return false;
+ }
+ uint32_t memory_operands =
+ load->GetSingleWordInOperand(kOpLoadInOperandMemoryOperands);
+ return (memory_operands & SpvMemoryAccessVolatileMask) != 0;
+ },
+ funcs);
+}
+
+bool SpreadVolatileSemantics::HasInterfaceInConflictOfVolatileSemantics() {
+ for (Instruction& entry_point : get_module()->entry_points()) {
+ SpvExecutionModel execution_model =
+ static_cast<SpvExecutionModel>(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);
+ if (!EntryFunctionsToSpreadVolatileSemanticsForVar(var_id).empty() &&
+ !IsTargetForVolatileSemantics(var_id, execution_model) &&
+ IsTargetUsedByNonVolatileLoadInEntryPoint(var_id, &entry_point)) {
+ Instruction* inst = context()->get_def_use_mgr()->GetDef(var_id);
+ context()->EmitErrorMessage(
+ "Variable is a target for Volatile semantics for an entry point, "
+ "but it is not for another entry point",
+ inst);
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
+void SpreadVolatileSemantics::MarkVolatileSemanticsForVariable(
+ uint32_t var_id, Instruction* entry_point) {
+ uint32_t entry_function_id =
+ entry_point->GetSingleWordInOperand(kOpEntryPointInOperandEntryPoint);
+ auto itr = var_ids_to_entry_fn_for_volatile_semantics_.find(var_id);
+ if (itr == var_ids_to_entry_fn_for_volatile_semantics_.end()) {
+ var_ids_to_entry_fn_for_volatile_semantics_[var_id] = {entry_function_id};
+ return;
+ }
+ itr->second.insert(entry_function_id);
+}
+
+void SpreadVolatileSemantics::CollectTargetsForVolatileSemantics(
+ const bool is_vk_memory_model_enabled) {
+ for (Instruction& entry_point : get_module()->entry_points()) {
+ SpvExecutionModel execution_model =
+ static_cast<SpvExecutionModel>(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);
+ if (!IsTargetForVolatileSemantics(var_id, execution_model)) {
+ continue;
+ }
+ if (is_vk_memory_model_enabled ||
+ IsTargetUsedByNonVolatileLoadInEntryPoint(var_id, &entry_point)) {
+ MarkVolatileSemanticsForVariable(var_id, &entry_point);
+ }
+ }
+ }
+}
+
+void SpreadVolatileSemantics::DecorateVarWithVolatile(Instruction* var) {
+ analysis::DecorationManager* decoration_manager =
+ context()->get_decoration_mgr();
+ uint32_t var_id = var->result_id();
+ if (HasVolatileDecoration(decoration_manager, var_id)) {
+ 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}}});
+}
+
+bool SpreadVolatileSemantics::VisitLoadsOfPointersToVariableInEntries(
+ uint32_t var_id, const std::function<bool(Instruction*)>& handle_load,
+ const std::unordered_set<uint32_t>& function_ids) {
+ std::vector<uint32_t> worklist({var_id});
+ auto* def_use_mgr = context()->get_def_use_mgr();
+ while (!worklist.empty()) {
+ uint32_t ptr_id = worklist.back();
+ worklist.pop_back();
+ bool finish_traversal = !def_use_mgr->WhileEachUser(
+ ptr_id, [this, &worklist, &ptr_id, handle_load,
+ &function_ids](Instruction* user) {
+ BasicBlock* block = context()->get_instr_block(user);
+ if (block == nullptr ||
+ function_ids.find(block->GetParent()->result_id()) ==
+ function_ids.end()) {
+ return true;
+ }
+
+ if (user->opcode() == SpvOpAccessChain ||
+ user->opcode() == SpvOpInBoundsAccessChain ||
+ user->opcode() == SpvOpPtrAccessChain ||
+ user->opcode() == SpvOpInBoundsPtrAccessChain ||
+ user->opcode() == SpvOpCopyObject) {
+ if (ptr_id == user->GetSingleWordInOperand(0))
+ worklist.push_back(user->result_id());
+ return true;
+ }
+
+ if (user->opcode() != SpvOpLoad) {
+ return true;
+ }
+
+ return handle_load(user);
+ });
+ if (finish_traversal) return false;
+ }
+ return true;
+}
+
+void SpreadVolatileSemantics::SetVolatileForLoadsInEntries(
+ Instruction* var, const std::unordered_set<uint32_t>& entry_function_ids) {
+ // Set Volatile memory operand for all load instructions if they do not have
+ // it.
+ for (auto entry_id : entry_function_ids) {
+ std::unordered_set<uint32_t> funcs;
+ context()->CollectCallTreeFromRoots(entry_id, &funcs);
+ VisitLoadsOfPointersToVariableInEntries(
+ var->result_id(),
+ [](Instruction* load) {
+ if (load->NumInOperands() <= kOpLoadInOperandMemoryOperands) {
+ load->AddOperand({SPV_OPERAND_TYPE_MEMORY_ACCESS,
+ {SpvMemoryAccessVolatileMask}});
+ return true;
+ }
+ uint32_t memory_operands =
+ load->GetSingleWordInOperand(kOpLoadInOperandMemoryOperands);
+ memory_operands |= SpvMemoryAccessVolatileMask;
+ load->SetInOperand(kOpLoadInOperandMemoryOperands, {memory_operands});
+ return true;
+ },
+ funcs);
+ }
+}
+
+bool SpreadVolatileSemantics::IsTargetForVolatileSemantics(
+ uint32_t var_id, SpvExecutionModel execution_model) {
+ analysis::DecorationManager* decoration_manager =
+ context()->get_decoration_mgr();
+ if (execution_model == SpvExecutionModelFragment) {
+ return get_module()->version() >= SPV_SPIRV_VERSION_WORD(1, 6) &&
+ HasBuiltinDecoration(decoration_manager, var_id,
+ SpvBuiltInHelperInvocation);
+ }
+
+ if (execution_model == SpvExecutionModelIntersectionKHR ||
+ execution_model == SpvExecutionModelIntersectionNV) {
+ if (HasBuiltinDecoration(decoration_manager, var_id,
+ SpvBuiltInRayTmaxKHR)) {
+ return true;
+ }
+ }
+
+ switch (execution_model) {
+ case SpvExecutionModelRayGenerationKHR:
+ case SpvExecutionModelClosestHitKHR:
+ case SpvExecutionModelMissKHR:
+ case SpvExecutionModelCallableKHR:
+ case SpvExecutionModelIntersectionKHR:
+ return HasBuiltinForRayTracingVolatileSemantics(decoration_manager,
+ var_id);
+ default:
+ return false;
+ }
+}
+
+} // namespace opt
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.h
new file mode 100644
index 00000000000..014858d3f3c
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/spread_volatile_semantics.h
@@ -0,0 +1,116 @@
+// Copyright (c) 2022 Google LLC
+//
+// 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_SPREAD_VOLATILE_SEMANTICS_H_
+#define SOURCE_OPT_SPREAD_VOLATILE_SEMANTICS_H_
+
+#include "source/opt/pass.h"
+
+namespace spvtools {
+namespace opt {
+
+// See optimizer.hpp for documentation.
+class SpreadVolatileSemantics : public Pass {
+ public:
+ SpreadVolatileSemantics() {}
+
+ const char* name() const override { return "spread-volatile-semantics"; }
+
+ Status Process() override;
+
+ IRContext::Analysis GetPreservedAnalyses() override {
+ return IRContext::kAnalysisDefUse | IRContext::kAnalysisDecorations |
+ IRContext::kAnalysisInstrToBlockMapping;
+ }
+
+ private:
+ // Returns true if it does not have an execution model. Linkage shaders do not
+ // have an execution model.
+ bool HasNoExecutionModel() {
+ return get_module()->entry_points().empty() &&
+ context()->get_feature_mgr()->HasCapability(SpvCapabilityLinkage);
+ }
+
+ // Iterates interface variables and spreads the Volatile semantics if it has
+ // load instructions for the Volatile semantics.
+ Pass::Status SpreadVolatileSemanticsToVariables(
+ const bool is_vk_memory_model_enabled);
+
+ // Returns whether |var_id| is the result id of a target builtin variable for
+ // the volatile semantics for |execution_model| based on the Vulkan spec
+ // VUID-StandaloneSpirv-VulkanMemoryModel-04678 or
+ // VUID-StandaloneSpirv-VulkanMemoryModel-04679.
+ bool IsTargetForVolatileSemantics(uint32_t var_id,
+ SpvExecutionModel execution_model);
+
+ // Collects interface variables that need the volatile semantics.
+ // |is_vk_memory_model_enabled| is true if VulkanMemoryModel capability is
+ // enabled.
+ void CollectTargetsForVolatileSemantics(
+ const bool is_vk_memory_model_enabled);
+
+ // Reports an error if an interface variable is used by two entry points and
+ // it needs the Volatile decoration for one but not for another. Returns true
+ // if the error must be reported.
+ bool HasInterfaceInConflictOfVolatileSemantics();
+
+ // Returns whether the variable whose result is |var_id| is used by a
+ // non-volatile load or a pointer to it is used by a non-volatile load in
+ // |entry_point| or not.
+ bool IsTargetUsedByNonVolatileLoadInEntryPoint(uint32_t var_id,
+ Instruction* entry_point);
+
+ // Visits load instructions of pointers to variable whose result id is
+ // |var_id| if the load instructions are in reachable functions from entry
+ // points. |handle_load| is a function to do some actions for the load
+ // instructions. Finishes the traversal and returns false if |handle_load|
+ // returns false for a load instruction. Otherwise, returns true after running
+ // |handle_load| for all the load instructions.
+ bool VisitLoadsOfPointersToVariableInEntries(
+ uint32_t var_id, const std::function<bool(Instruction*)>& handle_load,
+ const std::unordered_set<uint32_t>& function_ids);
+
+ // Sets Memory Operands of OpLoad instructions that load |var| or pointers
+ // of |var| as Volatile if the function id of the OpLoad instruction is
+ // included in |entry_function_ids|.
+ void SetVolatileForLoadsInEntries(
+ Instruction* var, const std::unordered_set<uint32_t>& entry_function_ids);
+
+ // Adds OpDecorate Volatile for |var| if it does not exist.
+ void DecorateVarWithVolatile(Instruction* var);
+
+ // Returns a set of entry function ids to spread the volatile semantics for
+ // the variable with the result id |var_id|.
+ std::unordered_set<uint32_t> EntryFunctionsToSpreadVolatileSemanticsForVar(
+ uint32_t var_id) {
+ auto itr = var_ids_to_entry_fn_for_volatile_semantics_.find(var_id);
+ if (itr == var_ids_to_entry_fn_for_volatile_semantics_.end()) return {};
+ return itr->second;
+ }
+
+ // Specifies that we have to spread the volatile semantics for the
+ // variable with the result id |var_id| for the entry point |entry_point|.
+ void MarkVolatileSemanticsForVariable(uint32_t var_id,
+ Instruction* entry_point);
+
+ // Result ids of variables to entry function ids for the volatile semantics
+ // spread.
+ std::unordered_map<uint32_t, std::unordered_set<uint32_t>>
+ var_ids_to_entry_fn_for_volatile_semantics_;
+};
+
+} // namespace opt
+} // namespace spvtools
+
+#endif // SOURCE_OPT_SPREAD_VOLATILE_SEMANTICS_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.cpp
index 81770d779f2..22d81104471 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.cpp
@@ -67,7 +67,6 @@ namespace opt {
namespace {
const uint32_t kStoreValIdInIdx = 1;
const uint32_t kVariableInitIdInIdx = 1;
-const uint32_t kDebugDeclareOperandVariableIdx = 5;
} // namespace
std::string SSARewriter::PhiCandidate::PrettyPrint(const CFG* cfg) const {
@@ -315,8 +314,8 @@ void SSARewriter::ProcessStore(Instruction* inst, BasicBlock* bb) {
}
if (pass_->IsTargetVar(var_id)) {
WriteVariable(var_id, bb, val_id);
- pass_->context()->get_debug_info_mgr()->AddDebugValueIfVarDeclIsVisible(
- inst, var_id, val_id, inst, &decls_invisible_to_value_assignment_);
+ pass_->context()->get_debug_info_mgr()->AddDebugValueForVariable(
+ inst, var_id, val_id, inst);
#if SSA_REWRITE_DEBUGGING_LEVEL > 1
std::cerr << "\tFound store '%" << var_id << " = %" << val_id << "': "
@@ -559,9 +558,9 @@ bool SSARewriter::ApplyReplacements() {
// Add DebugValue for the new OpPhi instruction.
insert_it->SetDebugScope(local_var->GetDebugScope());
- pass_->context()->get_debug_info_mgr()->AddDebugValueIfVarDeclIsVisible(
+ pass_->context()->get_debug_info_mgr()->AddDebugValueForVariable(
&*insert_it, phi_candidate->var_id(), phi_candidate->result_id(),
- &*insert_it, &decls_invisible_to_value_assignment_);
+ &*insert_it);
modified = true;
}
@@ -650,62 +649,6 @@ void SSARewriter::FinalizePhiCandidates() {
}
}
-Pass::Status SSARewriter::AddDebugValuesForInvisibleDebugDecls(Function* fp) {
- // For the cases the value assignment is invisible to DebugDeclare e.g.,
- // the argument passing for an inlined function.
- //
- // Before inlining foo(int x):
- // a = 3;
- // foo(3);
- // After inlining:
- // a = 3;
- // foo and x disappeared but we want to specify "DebugValue: %x = %int_3".
- //
- // We want to specify the value for the variable using |defs_at_block_[bb]|,
- // where |bb| is the basic block contains the decl.
- DominatorAnalysis* dom_tree = pass_->context()->GetDominatorAnalysis(fp);
- Pass::Status status = Pass::Status::SuccessWithoutChange;
- for (auto* decl : decls_invisible_to_value_assignment_) {
- uint32_t var_id =
- decl->GetSingleWordOperand(kDebugDeclareOperandVariableIdx);
- auto* var = pass_->get_def_use_mgr()->GetDef(var_id);
- if (var->opcode() == SpvOpFunctionParameter) continue;
-
- auto* bb = pass_->context()->get_instr_block(decl);
- uint32_t value_id = GetValueAtBlock(var_id, bb);
- Instruction* value = nullptr;
- if (value_id) value = pass_->get_def_use_mgr()->GetDef(value_id);
-
- // If |value| is defined before the function body, it dominates |decl|.
- // If |value| dominates |decl|, we can set it as DebugValue.
- if (value && (pass_->context()->get_instr_block(value) == nullptr ||
- dom_tree->Dominates(value, decl))) {
- if (pass_->context()->get_debug_info_mgr()->AddDebugValueForDecl(
- decl, value->result_id(), decl, value) == nullptr) {
- return Pass::Status::Failure;
- }
- } else {
- // If |value| in the same basic block does not dominate |decl|, we can
- // assign the value in the immediate dominator.
- value_id = GetValueAtBlock(var_id, dom_tree->ImmediateDominator(bb));
- if (value_id) value = pass_->get_def_use_mgr()->GetDef(value_id);
- if (value_id &&
- pass_->context()->get_debug_info_mgr()->AddDebugValueForDecl(
- decl, value_id, decl, value) == nullptr) {
- return Pass::Status::Failure;
- }
- }
-
- // DebugDeclares of target variables will be removed by
- // SSARewritePass::Process().
- if (!pass_->IsTargetVar(var_id)) {
- pass_->context()->get_debug_info_mgr()->KillDebugDeclares(var_id);
- }
- status = Pass::Status::SuccessWithChange;
- }
- return status;
-}
-
Pass::Status SSARewriter::RewriteFunctionIntoSSA(Function* fp) {
#if SSA_REWRITE_DEBUGGING_LEVEL > 0
std::cerr << "Function before SSA rewrite:\n"
@@ -735,12 +678,6 @@ Pass::Status SSARewriter::RewriteFunctionIntoSSA(Function* fp) {
// Finally, apply all the replacements in the IR.
bool modified = ApplyReplacements();
- auto status = AddDebugValuesForInvisibleDebugDecls(fp);
- if (status == Pass::Status::SuccessWithChange ||
- status == Pass::Status::Failure) {
- return status;
- }
-
#if SSA_REWRITE_DEBUGGING_LEVEL > 0
std::cerr << "\n\n\nFunction after SSA rewrite:\n"
<< fp->PrettyPrint(0) << "\n";
@@ -753,6 +690,9 @@ Pass::Status SSARewriter::RewriteFunctionIntoSSA(Function* fp) {
Pass::Status SSARewritePass::Process() {
Status status = Status::SuccessWithoutChange;
for (auto& fn : *get_module()) {
+ if (fn.IsDeclaration()) {
+ continue;
+ }
status =
CombineStatus(status, SSARewriter(this).RewriteFunctionIntoSSA(&fn));
// Kill DebugDeclares for target variables.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.h
index 1f4cd24cab4..2470f85f6bc 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/ssa_rewrite_pass.h
@@ -253,11 +253,6 @@ class SSARewriter {
// candidates.
void FinalizePhiCandidates();
- // Adds DebugValues for DebugDeclares in
- // |decls_invisible_to_value_assignment_|. Returns whether the function was
- // modified or not, and whether or not the conversion was successful.
- Pass::Status AddDebugValuesForInvisibleDebugDecls(Function* fp);
-
// Prints the table of Phi candidates to std::cerr.
void PrintPhiCandidates() const;
@@ -295,10 +290,6 @@ class SSARewriter {
// Memory pass requesting the SSA rewriter.
MemPass* pass_;
-
- // Set of DebugDeclare instructions that are not added as DebugValue because
- // they are invisible to the store or phi instructions.
- std::unordered_set<Instruction*> decls_invisible_to_value_assignment_;
};
class SSARewritePass : public MemPass {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strength_reduction_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strength_reduction_pass.h
index 8dfeb307bff..1cbbbcc6d0a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strength_reduction_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strength_reduction_pass.h
@@ -34,7 +34,7 @@ class StrengthReductionPass : public Pass {
// Returns true if something changed.
bool ReplaceMultiplyByPowerOf2(BasicBlock::iterator*);
- // Scan the types and constants in the module looking for the the integer
+ // Scan the types and constants in the module looking for the integer
// types that we are
// interested in. The shift operation needs a small unsigned integer. We
// need to find
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_debug_info_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_debug_info_pass.cpp
index c86ce578280..6a0ebf2482c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_debug_info_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_debug_info_pass.cpp
@@ -14,6 +14,7 @@
#include "source/opt/strip_debug_info_pass.h"
#include "source/opt/ir_context.h"
+#include "source/util/string_utils.h"
namespace spvtools {
namespace opt {
@@ -21,9 +22,8 @@ namespace opt {
Pass::Status StripDebugInfoPass::Process() {
bool uses_non_semantic_info = false;
for (auto& inst : context()->module()->extensions()) {
- const char* ext_name =
- reinterpret_cast<const char*>(&inst.GetInOperand(0).words[0]);
- if (0 == std::strcmp(ext_name, "SPV_KHR_non_semantic_info")) {
+ const std::string ext_name = inst.GetInOperand(0).AsString();
+ if (ext_name == "SPV_KHR_non_semantic_info") {
uses_non_semantic_info = true;
}
}
@@ -46,9 +46,10 @@ Pass::Status StripDebugInfoPass::Process() {
if (use->opcode() == SpvOpExtInst) {
auto ext_inst_set =
def_use->GetDef(use->GetSingleWordInOperand(0u));
- const char* extension_name = reinterpret_cast<const char*>(
- &ext_inst_set->GetInOperand(0).words[0]);
- if (0 == std::strncmp(extension_name, "NonSemantic.", 12)) {
+ const std::string extension_name =
+ ext_inst_set->GetInOperand(0).AsString();
+ if (spvtools::utils::starts_with(extension_name,
+ "NonSemantic.")) {
// found a non-semantic use, return false as we cannot
// remove this OpString
return false;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_reflect_info_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp
index 8b0f2db7ff6..cd1fbb632f3 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_reflect_info_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.cpp
@@ -12,18 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#include "source/opt/strip_reflect_info_pass.h"
+#include "source/opt/strip_nonsemantic_info_pass.h"
#include <cstring>
#include <vector>
#include "source/opt/instruction.h"
#include "source/opt/ir_context.h"
+#include "source/util/string_utils.h"
namespace spvtools {
namespace opt {
-Pass::Status StripReflectInfoPass::Process() {
+Pass::Status StripNonSemanticInfoPass::Process() {
bool modified = false;
std::vector<Instruction*> to_remove;
@@ -32,7 +33,8 @@ Pass::Status StripReflectInfoPass::Process() {
for (auto& inst : context()->module()->annotations()) {
switch (inst.opcode()) {
case SpvOpDecorateStringGOOGLE:
- if (inst.GetSingleWordInOperand(1) == SpvDecorationHlslSemanticGOOGLE) {
+ if (inst.GetSingleWordInOperand(1) == SpvDecorationHlslSemanticGOOGLE ||
+ inst.GetSingleWordInOperand(1) == SpvDecorationUserTypeGOOGLE) {
to_remove.push_back(&inst);
} else {
other_uses_for_decorate_string = true;
@@ -40,7 +42,8 @@ Pass::Status StripReflectInfoPass::Process() {
break;
case SpvOpMemberDecorateStringGOOGLE:
- if (inst.GetSingleWordInOperand(2) == SpvDecorationHlslSemanticGOOGLE) {
+ if (inst.GetSingleWordInOperand(2) == SpvDecorationHlslSemanticGOOGLE ||
+ inst.GetSingleWordInOperand(2) == SpvDecorationUserTypeGOOGLE) {
to_remove.push_back(&inst);
} else {
other_uses_for_decorate_string = true;
@@ -60,33 +63,26 @@ Pass::Status StripReflectInfoPass::Process() {
}
for (auto& inst : context()->module()->extensions()) {
- const char* ext_name =
- reinterpret_cast<const char*>(&inst.GetInOperand(0).words[0]);
- if (0 == std::strcmp(ext_name, "SPV_GOOGLE_hlsl_functionality1")) {
+ const std::string ext_name = inst.GetInOperand(0).AsString();
+ if (ext_name == "SPV_GOOGLE_hlsl_functionality1") {
+ to_remove.push_back(&inst);
+ } else if (ext_name == "SPV_GOOGLE_user_type") {
to_remove.push_back(&inst);
} else if (!other_uses_for_decorate_string &&
- 0 == std::strcmp(ext_name, "SPV_GOOGLE_decorate_string")) {
+ ext_name == "SPV_GOOGLE_decorate_string") {
to_remove.push_back(&inst);
- } else if (0 == std::strcmp(ext_name, "SPV_KHR_non_semantic_info")) {
+ } else if (ext_name == "SPV_KHR_non_semantic_info") {
to_remove.push_back(&inst);
}
}
- // clear all debug data now if it hasn't been cleared already, to remove any
- // remaining OpString that may have been referenced by non-semantic extinsts
- for (auto& dbg : context()->debugs1()) to_remove.push_back(&dbg);
- for (auto& dbg : context()->debugs2()) to_remove.push_back(&dbg);
- for (auto& dbg : context()->debugs3()) to_remove.push_back(&dbg);
- for (auto& dbg : context()->ext_inst_debuginfo()) to_remove.push_back(&dbg);
-
// remove any extended inst imports that are non semantic
std::unordered_set<uint32_t> non_semantic_sets;
for (auto& inst : context()->module()->ext_inst_imports()) {
assert(inst.opcode() == SpvOpExtInstImport &&
"Expecting an import of an extension's instruction set.");
- const char* extension_name =
- reinterpret_cast<const char*>(&inst.GetInOperand(0).words[0]);
- if (0 == std::strncmp(extension_name, "NonSemantic.", 12)) {
+ const std::string extension_name = inst.GetInOperand(0).AsString();
+ if (spvtools::utils::starts_with(extension_name, "NonSemantic.")) {
non_semantic_sets.insert(inst.result_id());
to_remove.push_back(&inst);
}
@@ -103,19 +99,10 @@ Pass::Status StripReflectInfoPass::Process() {
to_remove.push_back(inst);
}
}
- });
+ },
+ true);
}
- // OpName must come first, since they may refer to other debug instructions.
- // If they are after the instructions that refer to, then they will be killed
- // when that instruction is killed, which will lead to a double kill.
- std::sort(to_remove.begin(), to_remove.end(),
- [](Instruction* lhs, Instruction* rhs) -> bool {
- if (lhs->opcode() == SpvOpName && rhs->opcode() != SpvOpName)
- return true;
- return false;
- });
-
for (auto* inst : to_remove) {
modified = true;
context()->KillInst(inst);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_reflect_info_pass.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.h
index 4e1999ed366..ff4e2e1ddfa 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_reflect_info_pass.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/strip_nonsemantic_info_pass.h
@@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-#ifndef SOURCE_OPT_STRIP_REFLECT_INFO_PASS_H_
-#define SOURCE_OPT_STRIP_REFLECT_INFO_PASS_H_
+#ifndef SOURCE_OPT_STRIP_NONSEMANTIC_INFO_PASS_H_
+#define SOURCE_OPT_STRIP_NONSEMANTIC_INFO_PASS_H_
#include "source/opt/ir_context.h"
#include "source/opt/module.h"
@@ -23,9 +23,9 @@ namespace spvtools {
namespace opt {
// See optimizer.hpp for documentation.
-class StripReflectInfoPass : public Pass {
+class StripNonSemanticInfoPass : public Pass {
public:
- const char* name() const override { return "strip-reflect"; }
+ const char* name() const override { return "strip-nonsemantic"; }
Status Process() override;
// Return the mask of preserved Analyses.
@@ -41,4 +41,4 @@ class StripReflectInfoPass : public Pass {
} // namespace opt
} // namespace spvtools
-#endif // SOURCE_OPT_STRIP_REFLECT_INFO_PASS_H_
+#endif // SOURCE_OPT_STRIP_NONSEMANTIC_INFO_PASS_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp
index 7935ad33138..a0006f55860 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.cpp
@@ -23,6 +23,7 @@
#include "source/opt/log.h"
#include "source/opt/reflect.h"
#include "source/util/make_unique.h"
+#include "source/util/string_utils.h"
namespace spvtools {
namespace opt {
@@ -234,6 +235,7 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) {
DefineParameterlessCase(PipeStorage);
DefineParameterlessCase(NamedBarrier);
DefineParameterlessCase(AccelerationStructureNV);
+ DefineParameterlessCase(RayQueryKHR);
#undef DefineParameterlessCase
case Type::kInteger:
typeInst = MakeUnique<Instruction>(
@@ -349,11 +351,8 @@ uint32_t TypeManager::GetTypeInstruction(const Type* type) {
}
case Type::kOpaque: {
const Opaque* opaque = type->AsOpaque();
- size_t size = opaque->name().size();
// Convert to null-terminated packed UTF-8 string.
- std::vector<uint32_t> words(size / 4 + 1, 0);
- char* dst = reinterpret_cast<char*>(words.data());
- strncpy(dst, opaque->name().c_str(), size);
+ std::vector<uint32_t> words = spvtools::utils::MakeVector(opaque->name());
typeInst = MakeUnique<Instruction>(
context(), SpvOpTypeOpaque, 0, id,
std::initializer_list<Operand>{
@@ -529,6 +528,7 @@ Type* TypeManager::RebuildType(const Type& type) {
DefineNoSubtypeCase(PipeStorage);
DefineNoSubtypeCase(NamedBarrier);
DefineNoSubtypeCase(AccelerationStructureNV);
+ DefineNoSubtypeCase(RayQueryKHR);
#undef DefineNoSubtypeCase
case Type::kVector: {
const Vector* vec_ty = type.AsVector();
@@ -781,8 +781,7 @@ Type* TypeManager::RecordIfTypeDefinition(const Instruction& inst) {
}
} break;
case SpvOpTypeOpaque: {
- const uint32_t* data = inst.GetInOperand(0).words.data();
- type = new Opaque(reinterpret_cast<const char*>(data));
+ type = new Opaque(inst.GetInOperand(0).AsString());
} break;
case SpvOpTypePointer: {
uint32_t pointee_type_id = inst.GetSingleWordInOperand(1);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.h
index ce9d83d410c..72e37f4870b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/type_manager.h
@@ -160,6 +160,13 @@ class TypeManager {
uint32_t GetFloatTypeId() { return GetTypeInstruction(GetFloatType()); }
+ Type* GetDoubleType() {
+ Float float_type(64);
+ return GetRegisteredType(&float_type);
+ }
+
+ uint32_t GetDoubleTypeId() { return GetTypeInstruction(GetDoubleType()); }
+
Type* GetUIntVectorType(uint32_t size) {
Vector vec_type(GetUIntType(), size);
return GetRegisteredType(&vec_type);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.cpp
index b1eb3a50847..056acebb620 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.cpp
@@ -16,11 +16,13 @@
#include <algorithm>
#include <cassert>
+#include <climits>
#include <cstdint>
#include <sstream>
#include <string>
#include <unordered_set>
+#include "source/util/hash_combine.h"
#include "source/util/make_unique.h"
#include "spirv/unified1/spirv.h"
@@ -28,6 +30,7 @@ namespace spvtools {
namespace opt {
namespace analysis {
+using spvtools::utils::hash_combine;
using U32VecVec = std::vector<std::vector<uint32_t>>;
namespace {
@@ -182,23 +185,26 @@ bool Type::operator==(const Type& other) const {
}
}
-void Type::GetHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* seen) const {
- if (!seen->insert(this).second) {
- return;
+size_t Type::ComputeHashValue(size_t hash, SeenTypes* seen) const {
+ // Linear search through a dense, cache coherent vector is faster than O(log
+ // n) search in a complex data structure (eg std::set) for the generally small
+ // number of nodes. It also skips the overhead of an new/delete per Type
+ // (when inserting/removing from a set).
+ if (std::find(seen->begin(), seen->end(), this) != seen->end()) {
+ return hash;
}
- words->push_back(kind_);
+ seen->push_back(this);
+
+ hash = hash_combine(hash, uint32_t(kind_));
for (const auto& d : decorations_) {
- for (auto w : d) {
- words->push_back(w);
- }
+ hash = hash_combine(hash, d);
}
switch (kind_) {
-#define DeclareKindCase(type) \
- case k##type: \
- As##type()->GetExtraHashWords(words, seen); \
+#define DeclareKindCase(type) \
+ case k##type: \
+ hash = As##type()->ComputeExtraStateHash(hash, seen); \
break
DeclareKindCase(Void);
DeclareKindCase(Bool);
@@ -232,18 +238,42 @@ void Type::GetHashWords(std::vector<uint32_t>* words,
break;
}
- seen->erase(this);
+ seen->pop_back();
+ return hash;
}
size_t Type::HashValue() const {
- std::u32string h;
- std::vector<uint32_t> words;
- GetHashWords(&words);
- for (auto w : words) {
- h.push_back(w);
+ SeenTypes seen;
+ return ComputeHashValue(0, &seen);
+}
+
+uint64_t Type::NumberOfComponents() const {
+ switch (kind()) {
+ case kVector:
+ return AsVector()->element_count();
+ case kMatrix:
+ return AsMatrix()->element_count();
+ case kArray: {
+ Array::LengthInfo length_info = AsArray()->length_info();
+ if (length_info.words[0] != Array::LengthInfo::kConstant) {
+ return UINT64_MAX;
+ }
+ assert(length_info.words.size() <= 3 &&
+ "The size of the array could not fit size_t.");
+ uint64_t length = 0;
+ length |= length_info.words[1];
+ if (length_info.words.size() > 2) {
+ length |= static_cast<uint64_t>(length_info.words[2]) << 32;
+ }
+ return length;
+ }
+ case kRuntimeArray:
+ return UINT64_MAX;
+ case kStruct:
+ return AsStruct()->element_types().size();
+ default:
+ return 0;
}
-
- return std::hash<std::u32string>()(h);
}
bool Integer::IsSameImpl(const Type* that, IsSameCache*) const {
@@ -258,10 +288,8 @@ std::string Integer::str() const {
return oss.str();
}
-void Integer::GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>*) const {
- words->push_back(width_);
- words->push_back(signed_);
+size_t Integer::ComputeExtraStateHash(size_t hash, SeenTypes*) const {
+ return hash_combine(hash, width_, signed_);
}
bool Float::IsSameImpl(const Type* that, IsSameCache*) const {
@@ -275,9 +303,8 @@ std::string Float::str() const {
return oss.str();
}
-void Float::GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>*) const {
- words->push_back(width_);
+size_t Float::ComputeExtraStateHash(size_t hash, SeenTypes*) const {
+ return hash_combine(hash, width_);
}
Vector::Vector(const Type* type, uint32_t count)
@@ -299,10 +326,11 @@ std::string Vector::str() const {
return oss.str();
}
-void Vector::GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* seen) const {
- element_type_->GetHashWords(words, seen);
- words->push_back(count_);
+size_t Vector::ComputeExtraStateHash(size_t hash, SeenTypes* seen) const {
+ // prefer form that doesn't require push/pop from stack: add state and
+ // make tail call.
+ hash = hash_combine(hash, count_);
+ return element_type_->ComputeHashValue(hash, seen);
}
Matrix::Matrix(const Type* type, uint32_t count)
@@ -324,10 +352,9 @@ std::string Matrix::str() const {
return oss.str();
}
-void Matrix::GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* seen) const {
- element_type_->GetHashWords(words, seen);
- words->push_back(count_);
+size_t Matrix::ComputeExtraStateHash(size_t hash, SeenTypes* seen) const {
+ hash = hash_combine(hash, count_);
+ return element_type_->ComputeHashValue(hash, seen);
}
Image::Image(Type* type, SpvDim dimen, uint32_t d, bool array, bool multisample,
@@ -362,16 +389,10 @@ std::string Image::str() const {
return oss.str();
}
-void Image::GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* seen) const {
- sampled_type_->GetHashWords(words, seen);
- words->push_back(dim_);
- words->push_back(depth_);
- words->push_back(arrayed_);
- words->push_back(ms_);
- words->push_back(sampled_);
- words->push_back(format_);
- words->push_back(access_qualifier_);
+size_t Image::ComputeExtraStateHash(size_t hash, SeenTypes* seen) const {
+ hash = hash_combine(hash, uint32_t(dim_), depth_, arrayed_, ms_, sampled_,
+ uint32_t(format_), uint32_t(access_qualifier_));
+ return sampled_type_->ComputeHashValue(hash, seen);
}
bool SampledImage::IsSameImpl(const Type* that, IsSameCache* seen) const {
@@ -387,9 +408,8 @@ std::string SampledImage::str() const {
return oss.str();
}
-void SampledImage::GetExtraHashWords(
- std::vector<uint32_t>* words, std::unordered_set<const Type*>* seen) const {
- image_type_->GetHashWords(words, seen);
+size_t SampledImage::ComputeExtraStateHash(size_t hash, SeenTypes* seen) const {
+ return image_type_->ComputeHashValue(hash, seen);
}
Array::Array(const Type* type, const Array::LengthInfo& length_info_arg)
@@ -422,16 +442,19 @@ std::string Array::str() const {
return oss.str();
}
-void Array::GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* seen) const {
- element_type_->GetHashWords(words, seen);
- // This should mirror the logic in IsSameImpl
- words->insert(words->end(), length_info_.words.begin(),
- length_info_.words.end());
+size_t Array::ComputeExtraStateHash(size_t hash, SeenTypes* seen) const {
+ hash = hash_combine(hash, length_info_.words);
+ return element_type_->ComputeHashValue(hash, seen);
}
void Array::ReplaceElementType(const Type* type) { element_type_ = type; }
+Array::LengthInfo Array::GetConstantLengthInfo(uint32_t const_id,
+ uint32_t length) const {
+ std::vector<uint32_t> extra_words{LengthInfo::Case::kConstant, length};
+ return {const_id, extra_words};
+}
+
RuntimeArray::RuntimeArray(const Type* type)
: Type(kRuntimeArray), element_type_(type) {
assert(!type->AsVoid());
@@ -450,9 +473,8 @@ std::string RuntimeArray::str() const {
return oss.str();
}
-void RuntimeArray::GetExtraHashWords(
- std::vector<uint32_t>* words, std::unordered_set<const Type*>* seen) const {
- element_type_->GetHashWords(words, seen);
+size_t RuntimeArray::ComputeExtraStateHash(size_t hash, SeenTypes* seen) const {
+ return element_type_->ComputeHashValue(hash, seen);
}
void RuntimeArray::ReplaceElementType(const Type* type) {
@@ -509,19 +531,14 @@ std::string Struct::str() const {
return oss.str();
}
-void Struct::GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* seen) const {
+size_t Struct::ComputeExtraStateHash(size_t hash, SeenTypes* seen) const {
for (auto* t : element_types_) {
- t->GetHashWords(words, seen);
+ hash = t->ComputeHashValue(hash, seen);
}
for (const auto& pair : element_decorations_) {
- words->push_back(pair.first);
- for (const auto& d : pair.second) {
- for (auto w : d) {
- words->push_back(w);
- }
- }
+ hash = hash_combine(hash, pair.first, pair.second);
}
+ return hash;
}
bool Opaque::IsSameImpl(const Type* that, IsSameCache*) const {
@@ -536,11 +553,8 @@ std::string Opaque::str() const {
return oss.str();
}
-void Opaque::GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>*) const {
- for (auto c : name_) {
- words->push_back(static_cast<char32_t>(c));
- }
+size_t Opaque::ComputeExtraStateHash(size_t hash, SeenTypes*) const {
+ return hash_combine(hash, name_);
}
Pointer::Pointer(const Type* type, SpvStorageClass sc)
@@ -569,10 +583,9 @@ std::string Pointer::str() const {
return os.str();
}
-void Pointer::GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* seen) const {
- pointee_type_->GetHashWords(words, seen);
- words->push_back(storage_class_);
+size_t Pointer::ComputeExtraStateHash(size_t hash, SeenTypes* seen) const {
+ hash = hash_combine(hash, uint32_t(storage_class_));
+ return pointee_type_->ComputeHashValue(hash, seen);
}
void Pointer::SetPointeeType(const Type* type) { pointee_type_ = type; }
@@ -606,12 +619,11 @@ std::string Function::str() const {
return oss.str();
}
-void Function::GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* seen) const {
- return_type_->GetHashWords(words, seen);
+size_t Function::ComputeExtraStateHash(size_t hash, SeenTypes* seen) const {
for (const auto* t : param_types_) {
- t->GetHashWords(words, seen);
+ hash = t->ComputeHashValue(hash, seen);
}
+ return return_type_->ComputeHashValue(hash, seen);
}
void Function::SetReturnType(const Type* type) { return_type_ = type; }
@@ -628,9 +640,8 @@ std::string Pipe::str() const {
return oss.str();
}
-void Pipe::GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>*) const {
- words->push_back(access_qualifier_);
+size_t Pipe::ComputeExtraStateHash(size_t hash, SeenTypes*) const {
+ return hash_combine(hash, uint32_t(access_qualifier_));
}
bool ForwardPointer::IsSameImpl(const Type* that, IsSameCache*) const {
@@ -653,11 +664,11 @@ std::string ForwardPointer::str() const {
return oss.str();
}
-void ForwardPointer::GetExtraHashWords(
- std::vector<uint32_t>* words, std::unordered_set<const Type*>* seen) const {
- words->push_back(target_id_);
- words->push_back(storage_class_);
- if (pointer_) pointer_->GetHashWords(words, seen);
+size_t ForwardPointer::ComputeExtraStateHash(size_t hash,
+ SeenTypes* seen) const {
+ hash = hash_combine(hash, target_id_, uint32_t(storage_class_));
+ if (pointer_) hash = pointer_->ComputeHashValue(hash, seen);
+ return hash;
}
CooperativeMatrixNV::CooperativeMatrixNV(const Type* type, const uint32_t scope,
@@ -681,12 +692,10 @@ std::string CooperativeMatrixNV::str() const {
return oss.str();
}
-void CooperativeMatrixNV::GetExtraHashWords(
- std::vector<uint32_t>* words, std::unordered_set<const Type*>* pSet) const {
- component_type_->GetHashWords(words, pSet);
- words->push_back(scope_id_);
- words->push_back(rows_id_);
- words->push_back(columns_id_);
+size_t CooperativeMatrixNV::ComputeExtraStateHash(size_t hash,
+ SeenTypes* seen) const {
+ hash = hash_combine(hash, scope_id_, rows_id_, columns_id_);
+ return component_type_->ComputeHashValue(hash, seen);
}
bool CooperativeMatrixNV::IsSameImpl(const Type* that,
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.h
index 9ecd41a6b02..a92669e9fef 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/types.h
@@ -28,6 +28,7 @@
#include "source/latest_version_spirv_header.h"
#include "source/opt/instruction.h"
+#include "source/util/small_vector.h"
#include "spirv-tools/libspirv.h"
namespace spvtools {
@@ -67,6 +68,8 @@ class Type {
public:
typedef std::set<std::pair<const Pointer*, const Pointer*>> IsSameCache;
+ using SeenTypes = spvtools::utils::SmallVector<const Type*, 8>;
+
// Available subtypes.
//
// When adding a new derived class of Type, please add an entry to the enum.
@@ -96,7 +99,8 @@ class Type {
kNamedBarrier,
kAccelerationStructureNV,
kCooperativeMatrixNV,
- kRayQueryKHR
+ kRayQueryKHR,
+ kLast
};
Type(Kind k) : kind_(k) {}
@@ -154,21 +158,11 @@ class Type {
// Returns the hash value of this type.
size_t HashValue() const;
- // Adds the necessary words to compute a hash value of this type to |words|.
- void GetHashWords(std::vector<uint32_t>* words) const {
- std::unordered_set<const Type*> seen;
- GetHashWords(words, &seen);
- }
-
- // Adds the necessary words to compute a hash value of this type to |words|.
- void GetHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* seen) const;
+ size_t ComputeHashValue(size_t hash, SeenTypes* seen) const;
- // Adds necessary extra words for a subtype to calculate a hash value into
- // |words|.
- virtual void GetExtraHashWords(
- std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const = 0;
+ // Returns the number of components in a composite type. Returns 0 for a
+ // non-composite type.
+ uint64_t NumberOfComponents() const;
// A bunch of methods for casting this type to a given type. Returns this if the
// cast can be done, nullptr otherwise.
@@ -204,6 +198,10 @@ class Type {
DeclareCastMethod(RayQueryKHR)
#undef DeclareCastMethod
+protected:
+ // Add any type-specific state to |hash| and returns new hash.
+ virtual size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const = 0;
+
protected:
// Decorations attached to this type. Each decoration is encoded as a vector
// of uint32_t numbers. The first uint32_t number is the decoration value,
@@ -232,8 +230,7 @@ class Integer : public Type {
uint32_t width() const { return width_; }
bool IsSigned() const { return signed_; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
private:
bool IsSameImpl(const Type* that, IsSameCache*) const override;
@@ -253,8 +250,7 @@ class Float : public Type {
const Float* AsFloat() const override { return this; }
uint32_t width() const { return width_; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
private:
bool IsSameImpl(const Type* that, IsSameCache*) const override;
@@ -274,8 +270,7 @@ class Vector : public Type {
Vector* AsVector() override { return this; }
const Vector* AsVector() const override { return this; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
private:
bool IsSameImpl(const Type* that, IsSameCache*) const override;
@@ -296,8 +291,7 @@ class Matrix : public Type {
Matrix* AsMatrix() override { return this; }
const Matrix* AsMatrix() const override { return this; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
private:
bool IsSameImpl(const Type* that, IsSameCache*) const override;
@@ -327,8 +321,7 @@ class Image : public Type {
SpvImageFormat format() const { return format_; }
SpvAccessQualifier access_qualifier() const { return access_qualifier_; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
private:
bool IsSameImpl(const Type* that, IsSameCache*) const override;
@@ -355,8 +348,7 @@ class SampledImage : public Type {
const Type* image_type() const { return image_type_; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
private:
bool IsSameImpl(const Type* that, IsSameCache*) const override;
@@ -399,10 +391,10 @@ class Array : public Type {
Array* AsArray() override { return this; }
const Array* AsArray() const override { return this; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
void ReplaceElementType(const Type* element_type);
+ LengthInfo GetConstantLengthInfo(uint32_t const_id, uint32_t length) const;
private:
bool IsSameImpl(const Type* that, IsSameCache*) const override;
@@ -422,8 +414,7 @@ class RuntimeArray : public Type {
RuntimeArray* AsRuntimeArray() override { return this; }
const RuntimeArray* AsRuntimeArray() const override { return this; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
void ReplaceElementType(const Type* element_type);
@@ -459,8 +450,7 @@ class Struct : public Type {
Struct* AsStruct() override { return this; }
const Struct* AsStruct() const override { return this; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
private:
bool IsSameImpl(const Type* that, IsSameCache*) const override;
@@ -491,8 +481,7 @@ class Opaque : public Type {
const std::string& name() const { return name_; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
private:
bool IsSameImpl(const Type* that, IsSameCache*) const override;
@@ -512,8 +501,7 @@ class Pointer : public Type {
Pointer* AsPointer() override { return this; }
const Pointer* AsPointer() const override { return this; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
void SetPointeeType(const Type* type);
@@ -539,8 +527,7 @@ class Function : public Type {
const std::vector<const Type*>& param_types() const { return param_types_; }
std::vector<const Type*>& param_types() { return param_types_; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>*) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
void SetReturnType(const Type* type);
@@ -564,8 +551,7 @@ class Pipe : public Type {
SpvAccessQualifier access_qualifier() const { return access_qualifier_; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
private:
bool IsSameImpl(const Type* that, IsSameCache*) const override;
@@ -592,8 +578,7 @@ class ForwardPointer : public Type {
ForwardPointer* AsForwardPointer() override { return this; }
const ForwardPointer* AsForwardPointer() const override { return this; }
- void GetExtraHashWords(std::vector<uint32_t>* words,
- std::unordered_set<const Type*>* pSet) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
private:
bool IsSameImpl(const Type* that, IsSameCache*) const override;
@@ -616,8 +601,7 @@ class CooperativeMatrixNV : public Type {
return this;
}
- void GetExtraHashWords(std::vector<uint32_t>*,
- std::unordered_set<const Type*>*) const override;
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes* seen) const override;
const Type* component_type() const { return component_type_; }
uint32_t scope_id() const { return scope_id_; }
@@ -633,24 +617,25 @@ class CooperativeMatrixNV : public Type {
const uint32_t columns_id_;
};
-#define DefineParameterlessType(type, name) \
- class type : public Type { \
- public: \
- type() : Type(k##type) {} \
- type(const type&) = default; \
- \
- std::string str() const override { return #name; } \
- \
- type* As##type() override { return this; } \
- const type* As##type() const override { return this; } \
- \
- void GetExtraHashWords(std::vector<uint32_t>*, \
- std::unordered_set<const Type*>*) const override {} \
- \
- private: \
- bool IsSameImpl(const Type* that, IsSameCache*) const override { \
- return that->As##type() && HasSameDecorations(that); \
- } \
+#define DefineParameterlessType(type, name) \
+ class type : public Type { \
+ public: \
+ type() : Type(k##type) {} \
+ type(const type&) = default; \
+ \
+ std::string str() const override { return #name; } \
+ \
+ type* As##type() override { return this; } \
+ const type* As##type() const override { return this; } \
+ \
+ size_t ComputeExtraStateHash(size_t hash, SeenTypes*) const override { \
+ return hash; \
+ } \
+ \
+ private: \
+ bool IsSameImpl(const Type* that, IsSameCache*) const override { \
+ return that->As##type() && HasSameDecorations(that); \
+ } \
}
DefineParameterlessType(Void, void);
DefineParameterlessType(Bool, bool);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/unify_const_pass.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/unify_const_pass.cpp
index 227fd61da2b..6bfa11a5bd1 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/unify_const_pass.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/unify_const_pass.cpp
@@ -151,7 +151,7 @@ Pass::Status UnifyConstantPass::Process() {
// 'SpecId' decoration and all of them should be treated as unique.
// 'SpecId' is not applicable to SpecConstants defined with
// OpSpecConstant{Op|Composite}, their values are not necessary to be
- // unique. When all the operands/compoents are the same between two
+ // 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:
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/upgrade_memory_model.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/upgrade_memory_model.cpp
index ab252059fac..9d6a5bceb42 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/upgrade_memory_model.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/upgrade_memory_model.cpp
@@ -20,6 +20,7 @@
#include "source/opt/ir_context.h"
#include "source/spirv_constant.h"
#include "source/util/make_unique.h"
+#include "source/util/string_utils.h"
namespace spvtools {
namespace opt {
@@ -58,9 +59,7 @@ void UpgradeMemoryModel::UpgradeMemoryModelInstruction() {
std::initializer_list<Operand>{
{SPV_OPERAND_TYPE_CAPABILITY, {SpvCapabilityVulkanMemoryModelKHR}}}));
const std::string extension = "SPV_KHR_vulkan_memory_model";
- std::vector<uint32_t> words(extension.size() / 4 + 1, 0);
- char* dst = reinterpret_cast<char*>(words.data());
- strncpy(dst, extension.c_str(), extension.size());
+ std::vector<uint32_t> words = spvtools::utils::MakeVector(extension);
context()->AddExtension(
MakeUnique<Instruction>(context(), SpvOpExtension, 0, 0,
std::initializer_list<Operand>{
@@ -85,8 +84,7 @@ void UpgradeMemoryModel::UpgradeInstructions() {
if (ext_inst == GLSLstd450Modf || ext_inst == GLSLstd450Frexp) {
auto import =
get_def_use_mgr()->GetDef(inst->GetSingleWordInOperand(0u));
- if (reinterpret_cast<char*>(import->GetInOperand(0u).words.data()) ==
- std::string("GLSL.std.450")) {
+ if (import->GetInOperand(0u).AsString() == "GLSL.std.450") {
UpgradeExtInst(inst);
}
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/vector_dce.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/vector_dce.h
index 4d30b926b8f..a55bda692c6 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/vector_dce.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/opt/vector_dce.h
@@ -73,7 +73,7 @@ class VectorDCE : public MemPass {
bool RewriteInstructions(Function* function,
const LiveComponentMap& live_components);
- // Makrs all DebugValue instructions that use |composite| for their values as
+ // Makes all DebugValue instructions that use |composite| for their values as
// dead instructions by putting them into |dead_dbg_value|.
void MarkDebugValueUsesAsDead(Instruction* composite,
std::vector<Instruction*>* dead_dbg_value);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/parsed_operand.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/parsed_operand.cpp
index 7ad369cdb22..5f8e94db847 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/parsed_operand.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/parsed_operand.cpp
@@ -24,7 +24,9 @@ namespace spvtools {
void EmitNumericLiteral(std::ostream* out, const spv_parsed_instruction_t& inst,
const spv_parsed_operand_t& operand) {
if (operand.type != SPV_OPERAND_TYPE_LITERAL_INTEGER &&
- operand.type != SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER)
+ operand.type != SPV_OPERAND_TYPE_TYPED_LITERAL_NUMBER &&
+ operand.type != SPV_OPERAND_TYPE_OPTIONAL_LITERAL_INTEGER &&
+ operand.type != SPV_OPERAND_TYPE_OPTIONAL_TYPED_LITERAL_INTEGER)
return;
if (operand.num_words < 1) return;
// TODO(dneto): Support more than 64-bits at a time.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/print.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/print.cpp
index 2418c5bc918..6c94e2b7fc8 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/print.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/print.cpp
@@ -16,7 +16,8 @@
#if defined(SPIRV_ANDROID) || defined(SPIRV_LINUX) || defined(SPIRV_MAC) || \
defined(SPIRV_IOS) || defined(SPIRV_TVOS) || defined(SPIRV_FREEBSD) || \
- defined(SPIRV_EMSCRIPTEN) || defined(SPIRV_FUCHSIA)
+ defined(SPIRV_OPENBSD) || defined(SPIRV_EMSCRIPTEN) || \
+ defined(SPIRV_FUCHSIA) || defined(SPIRV_GNU)
namespace spvtools {
clr::reset::operator const char*() { return "\x1b[0m"; }
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_struct_member_reduction_opportunity.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_struct_member_reduction_opportunity.cpp
index da096e1ebe8..e72ed3514c5 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_struct_member_reduction_opportunity.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_struct_member_reduction_opportunity.cpp
@@ -153,7 +153,7 @@ void RemoveStructMemberReductionOpportunity::AdjustAccessedIndices(
next_type = type_inst->GetSingleWordInOperand(0);
break;
case SpvOpTypeStruct: {
- // Struct types are special becuase (a) we may need to adjust the index
+ // 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
// is dependent on the value of the index.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unused_struct_member_reduction_opportunity_finder.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unused_struct_member_reduction_opportunity_finder.cpp
index e72be625e22..cd0c4e4d7b3 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unused_struct_member_reduction_opportunity_finder.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/remove_unused_struct_member_reduction_opportunity_finder.cpp
@@ -136,9 +136,9 @@ RemoveUnusedStructMemberReductionOpportunityFinder::GetAvailableOpportunities(
}
}
- // We now know those struct indices that are unsed, and we make a reduction
+ // We now know those struct indices that are unused, and we make a reduction
// opportunity for each of them. By mapping each relevant member index to the
- // structs in which it is unsed, we will group all opportunities to remove
+ // structs in which it is unused, we will group all opportunities to remove
// member k of a struct (for some k) together. This reduces the likelihood
// that opportunities to remove members from the same struct will be adjacent,
// which is good because such opportunities mutually disable one another.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp
index dc20f689bce..29fbe551ad4 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/reduce/structured_construct_to_block_reduction_opportunity_finder.cpp
@@ -96,7 +96,7 @@ StructuredConstructToBlockReductionOpportunityFinder::GetAvailableOpportunities(
// This also means that we don't add a region.
continue;
}
- // We have a reachable header block with a rechable merge that
+ // We have a reachable header block with a reachable merge that
// postdominates the header: this means we have a new region.
regions.emplace(&block, std::unordered_set<opt::BasicBlock*>());
}
@@ -128,7 +128,7 @@ bool StructuredConstructToBlockReductionOpportunityFinder::
if (!block->WhileEachInst(
[context, &header, &region](opt::Instruction* inst) -> bool {
if (inst->result_id() == 0) {
- // The instruction does not genreate a result id, thus it cannot
+ // The instruction does not generate a result id, thus it cannot
// be referred to outside the region - this is fine.
return true;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_constant.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_constant.h
index 39771ccb262..8636806c547 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_constant.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_constant.h
@@ -84,6 +84,7 @@ typedef enum spv_generator_t {
SPV_GENERATOR_KHRONOS_LLVM_TRANSLATOR = 6,
SPV_GENERATOR_KHRONOS_ASSEMBLER = 7,
SPV_GENERATOR_KHRONOS_GLSLANG = 8,
+ SPV_GENERATOR_KHRONOS_LINKER = 17,
SPV_GENERATOR_NUM_ENTRIES,
SPV_FORCE_16_BIT_ENUM(spv_generator_t)
} spv_generator_t;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_definition.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_definition.h
index 63a4ef0db29..5dbd6ab2056 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_definition.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_definition.h
@@ -27,7 +27,7 @@ typedef struct spv_header_t {
uint32_t generator;
uint32_t bound;
uint32_t schema; // NOTE: Reserved
- const uint32_t* instructions; // NOTE: Unfixed pointer to instruciton stream
+ const uint32_t* instructions; // NOTE: Unfixed pointer to instruction stream
} spv_header_t;
#endif // SOURCE_SPIRV_DEFINITION_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_endian.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_endian.h
index c2540bec925..b4927f318d4 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_endian.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_endian.h
@@ -31,7 +31,7 @@ uint64_t spvFixDoubleWord(const uint32_t low, const uint32_t high,
spv_result_t spvBinaryEndianness(const spv_const_binary binary,
spv_endianness_t* endian);
-// Returns true if the given endianness matches the host's native endiannes.
+// Returns true if the given endianness matches the host's native endianness.
bool spvIsHostEndian(spv_endianness_t endian);
#endif // SOURCE_SPIRV_ENDIAN_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_target_env.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_target_env.cpp
index f20ebb4fb5d..9a038174261 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_target_env.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_target_env.cpp
@@ -62,7 +62,7 @@ const char* spvTargetEnvDescription(spv_target_env env) {
case SPV_ENV_VULKAN_1_1:
return "SPIR-V 1.3 (under Vulkan 1.1 semantics)";
case SPV_ENV_WEBGPU_0:
- assert(false);
+ assert(false && "Deprecated target environment value.");
break;
case SPV_ENV_UNIVERSAL_1_4:
return "SPIR-V 1.4";
@@ -72,6 +72,13 @@ const char* spvTargetEnvDescription(spv_target_env env) {
return "SPIR-V 1.5";
case SPV_ENV_VULKAN_1_2:
return "SPIR-V 1.5 (under Vulkan 1.2 semantics)";
+ case SPV_ENV_UNIVERSAL_1_6:
+ return "SPIR-V 1.6";
+ case SPV_ENV_VULKAN_1_3:
+ return "SPIR-V 1.6 (under Vulkan 1.3 semantics)";
+ case SPV_ENV_MAX:
+ assert(false && "Invalid target environment value.");
+ break;
}
return "";
}
@@ -102,7 +109,7 @@ uint32_t spvVersionForTargetEnv(spv_target_env env) {
case SPV_ENV_VULKAN_1_1:
return SPV_SPIRV_VERSION_WORD(1, 3);
case SPV_ENV_WEBGPU_0:
- assert(false);
+ assert(false && "Deprecated target environment value.");
break;
case SPV_ENV_UNIVERSAL_1_4:
case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
@@ -110,6 +117,12 @@ uint32_t spvVersionForTargetEnv(spv_target_env env) {
case SPV_ENV_UNIVERSAL_1_5:
case SPV_ENV_VULKAN_1_2:
return SPV_SPIRV_VERSION_WORD(1, 5);
+ case SPV_ENV_UNIVERSAL_1_6:
+ case SPV_ENV_VULKAN_1_3:
+ return SPV_SPIRV_VERSION_WORD(1, 6);
+ case SPV_ENV_MAX:
+ assert(false && "Invalid target environment value.");
+ break;
}
return SPV_SPIRV_VERSION_WORD(0, 0);
}
@@ -119,12 +132,14 @@ static const std::pair<const char*, spv_target_env> spvTargetEnvNameMap[] = {
{"vulkan1.0", SPV_ENV_VULKAN_1_0},
{"vulkan1.1", SPV_ENV_VULKAN_1_1},
{"vulkan1.2", SPV_ENV_VULKAN_1_2},
+ {"vulkan1.3", SPV_ENV_VULKAN_1_3},
{"spv1.0", SPV_ENV_UNIVERSAL_1_0},
{"spv1.1", SPV_ENV_UNIVERSAL_1_1},
{"spv1.2", SPV_ENV_UNIVERSAL_1_2},
{"spv1.3", SPV_ENV_UNIVERSAL_1_3},
{"spv1.4", SPV_ENV_UNIVERSAL_1_4},
{"spv1.5", SPV_ENV_UNIVERSAL_1_5},
+ {"spv1.6", SPV_ENV_UNIVERSAL_1_6},
{"opencl1.2embedded", SPV_ENV_OPENCL_EMBEDDED_1_2},
{"opencl1.2", SPV_ENV_OPENCL_1_2},
{"opencl2.0embedded", SPV_ENV_OPENCL_EMBEDDED_2_0},
@@ -171,7 +186,8 @@ static const VulkanEnv ordered_vulkan_envs[] = {
{SPV_ENV_VULKAN_1_0, VULKAN_VER(1, 0), SPIRV_VER(1, 0)},
{SPV_ENV_VULKAN_1_1, VULKAN_VER(1, 1), SPIRV_VER(1, 3)},
{SPV_ENV_VULKAN_1_1_SPIRV_1_4, VULKAN_VER(1, 1), SPIRV_VER(1, 4)},
- {SPV_ENV_VULKAN_1_2, VULKAN_VER(1, 2), SPIRV_VER(1, 5)}};
+ {SPV_ENV_VULKAN_1_2, VULKAN_VER(1, 2), SPIRV_VER(1, 5)},
+ {SPV_ENV_VULKAN_1_3, VULKAN_VER(1, 3), SPIRV_VER(1, 6)}};
bool spvParseVulkanEnv(uint32_t vulkan_ver, uint32_t spirv_ver,
spv_target_env* env) {
@@ -205,14 +221,19 @@ bool spvIsVulkanEnv(spv_target_env env) {
case SPV_ENV_UNIVERSAL_1_3:
case SPV_ENV_UNIVERSAL_1_4:
case SPV_ENV_UNIVERSAL_1_5:
+ case SPV_ENV_UNIVERSAL_1_6:
return false;
case SPV_ENV_VULKAN_1_0:
case SPV_ENV_VULKAN_1_1:
case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
case SPV_ENV_VULKAN_1_2:
+ case SPV_ENV_VULKAN_1_3:
return true;
case SPV_ENV_WEBGPU_0:
- assert(false);
+ assert(false && "Deprecated target environment value.");
+ break;
+ case SPV_ENV_MAX:
+ assert(false && "Invalid target environment value.");
break;
}
return false;
@@ -235,6 +256,8 @@ bool spvIsOpenCLEnv(spv_target_env env) {
case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
case SPV_ENV_UNIVERSAL_1_5:
case SPV_ENV_VULKAN_1_2:
+ case SPV_ENV_UNIVERSAL_1_6:
+ case SPV_ENV_VULKAN_1_3:
return false;
case SPV_ENV_OPENCL_1_2:
case SPV_ENV_OPENCL_EMBEDDED_1_2:
@@ -246,7 +269,10 @@ bool spvIsOpenCLEnv(spv_target_env env) {
case SPV_ENV_OPENCL_2_2:
return true;
case SPV_ENV_WEBGPU_0:
- assert(false);
+ assert(false && "Deprecated target environment value.");
+ break;
+ case SPV_ENV_MAX:
+ assert(false && "Invalid target environment value.");
break;
}
return false;
@@ -272,6 +298,8 @@ bool spvIsOpenGLEnv(spv_target_env env) {
case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
case SPV_ENV_UNIVERSAL_1_5:
case SPV_ENV_VULKAN_1_2:
+ case SPV_ENV_UNIVERSAL_1_6:
+ case SPV_ENV_VULKAN_1_3:
return false;
case SPV_ENV_OPENGL_4_0:
case SPV_ENV_OPENGL_4_1:
@@ -280,7 +308,45 @@ bool spvIsOpenGLEnv(spv_target_env env) {
case SPV_ENV_OPENGL_4_5:
return true;
case SPV_ENV_WEBGPU_0:
- assert(false);
+ assert(false && "Deprecated target environment value.");
+ break;
+ case SPV_ENV_MAX:
+ assert(false && "Invalid target environment value.");
+ break;
+ }
+ return false;
+}
+
+bool spvIsValidEnv(spv_target_env env) {
+ switch (env) {
+ case SPV_ENV_UNIVERSAL_1_0:
+ case SPV_ENV_VULKAN_1_0:
+ case SPV_ENV_UNIVERSAL_1_1:
+ case SPV_ENV_UNIVERSAL_1_2:
+ case SPV_ENV_UNIVERSAL_1_3:
+ case SPV_ENV_VULKAN_1_1:
+ case SPV_ENV_OPENCL_1_2:
+ case SPV_ENV_OPENCL_EMBEDDED_1_2:
+ case SPV_ENV_OPENCL_2_0:
+ case SPV_ENV_OPENCL_EMBEDDED_2_0:
+ case SPV_ENV_OPENCL_EMBEDDED_2_1:
+ case SPV_ENV_OPENCL_EMBEDDED_2_2:
+ case SPV_ENV_OPENCL_2_1:
+ case SPV_ENV_OPENCL_2_2:
+ case SPV_ENV_UNIVERSAL_1_4:
+ case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
+ case SPV_ENV_UNIVERSAL_1_5:
+ case SPV_ENV_VULKAN_1_2:
+ case SPV_ENV_UNIVERSAL_1_6:
+ case SPV_ENV_VULKAN_1_3:
+ case SPV_ENV_OPENGL_4_0:
+ case SPV_ENV_OPENGL_4_1:
+ case SPV_ENV_OPENGL_4_2:
+ case SPV_ENV_OPENGL_4_3:
+ case SPV_ENV_OPENGL_4_5:
+ return true;
+ case SPV_ENV_WEBGPU_0:
+ case SPV_ENV_MAX:
break;
}
return false;
@@ -307,20 +373,25 @@ std::string spvLogStringForEnv(spv_target_env env) {
}
case SPV_ENV_VULKAN_1_0:
case SPV_ENV_VULKAN_1_1:
- case SPV_ENV_VULKAN_1_1_SPIRV_1_4: {
- case SPV_ENV_VULKAN_1_2:
- return "Vulkan";
+ case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
+ case SPV_ENV_VULKAN_1_2:
+ case SPV_ENV_VULKAN_1_3: {
+ return "Vulkan";
}
case SPV_ENV_UNIVERSAL_1_0:
case SPV_ENV_UNIVERSAL_1_1:
case SPV_ENV_UNIVERSAL_1_2:
case SPV_ENV_UNIVERSAL_1_3:
case SPV_ENV_UNIVERSAL_1_4:
- case SPV_ENV_UNIVERSAL_1_5: {
+ case SPV_ENV_UNIVERSAL_1_5:
+ case SPV_ENV_UNIVERSAL_1_6: {
return "Universal";
}
case SPV_ENV_WEBGPU_0:
- assert(false);
+ assert(false && "Deprecated target environment value.");
+ break;
+ case SPV_ENV_MAX:
+ assert(false && "Invalid target environment value.");
break;
}
return "Unknown";
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_target_env.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_target_env.h
index a804d615c57..f3b0c2f6f2a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_target_env.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_target_env.h
@@ -28,6 +28,9 @@ bool spvIsOpenCLEnv(spv_target_env env);
// Returns true if |env| is an OPENGL environment, false otherwise.
bool spvIsOpenGLEnv(spv_target_env env);
+// Returns true if |env| is an implemented/valid environment, false otherwise.
+bool spvIsValidEnv(spv_target_env env);
+
// Returns the version number for the given SPIR-V target environment.
uint32_t spvVersionForTargetEnv(spv_target_env env);
@@ -37,7 +40,7 @@ std::string spvLogStringForEnv(spv_target_env env);
// Returns a formatted list of all SPIR-V target environment names that
// can be parsed by spvParseTargetEnv.
-// |pad| is the number of space characters that the begining of each line
+// |pad| is the number of space characters that the beginning of each line
// except the first one will be padded with.
// |wrap| is the max length of lines the user desires. Word-wrapping will
// occur to satisfy this limit.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_validator_options.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_validator_options.cpp
index e5b1eece0dd..b72a64460dc 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_validator_options.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_validator_options.cpp
@@ -125,3 +125,8 @@ void spvValidatorOptionsSetAllowLocalSizeId(spv_validator_options options,
bool val) {
options->allow_localsizeid = val;
}
+
+void spvValidatorOptionsSetFriendlyNames(spv_validator_options options,
+ bool val) {
+ options->use_friendly_names = val;
+}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_validator_options.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_validator_options.h
index a357c031b54..01450480c91 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_validator_options.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/spirv_validator_options.h
@@ -48,7 +48,8 @@ struct spv_validator_options_t {
workgroup_scalar_block_layout(false),
skip_block_layout(false),
allow_localsizeid(false),
- before_hlsl_legalization(false) {}
+ before_hlsl_legalization(false),
+ use_friendly_names(true) {}
validator_universal_limits_t universal_limits_;
bool relax_struct_store;
@@ -60,6 +61,7 @@ struct spv_validator_options_t {
bool skip_block_layout;
bool allow_localsizeid;
bool before_hlsl_legalization;
+ bool use_friendly_names;
};
#endif // SOURCE_SPIRV_VALIDATOR_OPTIONS_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/table.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/table.cpp
index d4a2d7e967b..822cefebd7b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/table.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/table.cpp
@@ -41,6 +41,8 @@ spv_context spvContextCreate(spv_target_env env) {
case SPV_ENV_UNIVERSAL_1_4:
case SPV_ENV_UNIVERSAL_1_5:
case SPV_ENV_VULKAN_1_2:
+ case SPV_ENV_UNIVERSAL_1_6:
+ case SPV_ENV_VULKAN_1_3:
break;
default:
return nullptr;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/text.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/text.cpp
index 88a8e8ffadc..90f69c52550 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/text.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/text.cpp
@@ -403,9 +403,10 @@ spv_result_t spvTextEncodeOperand(const spvtools::AssemblyGrammar& grammar,
case SPV_OPERAND_TYPE_DEBUG_INFO_FLAGS:
case SPV_OPERAND_TYPE_CLDEBUG100_DEBUG_INFO_FLAGS: {
uint32_t value;
- if (grammar.parseMaskOperand(type, textValue, &value)) {
- return context->diagnostic() << "Invalid " << spvOperandTypeStr(type)
- << " operand '" << textValue << "'.";
+ if (auto error = grammar.parseMaskOperand(type, textValue, &value)) {
+ return context->diagnostic(error)
+ << "Invalid " << spvOperandTypeStr(type) << " operand '"
+ << textValue << "'.";
}
if (auto error = context->binaryEncodeU32(value, pInst)) return error;
// Prepare to parse the operands for this logical operand.
@@ -622,7 +623,8 @@ spv_result_t spvTextEncodeOpcode(const spvtools::AssemblyGrammar& grammar,
break;
} else {
return context->diagnostic()
- << "Expected operand, found end of stream.";
+ << "Expected operand for " << opcodeName
+ << " instruction, but found the end of the stream.";
}
}
assert(error == SPV_SUCCESS && "Somebody added another way to fail");
@@ -632,7 +634,8 @@ spv_result_t spvTextEncodeOpcode(const spvtools::AssemblyGrammar& grammar,
break;
} else {
return context->diagnostic()
- << "Expected operand, found next instruction instead.";
+ << "Expected operand for " << opcodeName
+ << " instruction, but found the next instruction instead.";
}
}
@@ -666,7 +669,7 @@ spv_result_t spvTextEncodeOpcode(const spvtools::AssemblyGrammar& grammar,
if (pInst->words.size() > SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX) {
return context->diagnostic()
- << "Instruction too long: " << pInst->words.size()
+ << opcodeName << " Instruction too long: " << pInst->words.size()
<< " words, but the limit is "
<< SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX;
}
@@ -715,6 +718,12 @@ spv_result_t GetNumericIds(const spvtools::AssemblyGrammar& grammar,
while (context.hasText()) {
spv_instruction_t inst;
+ // Operand parsing sometimes involves knowing the opcode of the instruction
+ // 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;
+
if (spvTextEncodeOpcode(grammar, &context, &inst)) {
return SPV_ERROR_INVALID_TEXT;
}
@@ -763,8 +772,8 @@ spv_result_t spvTextToBinaryInternal(const spvtools::AssemblyGrammar& grammar,
instructions.push_back({});
spv_instruction_t& inst = instructions.back();
- if (spvTextEncodeOpcode(grammar, &context, &inst)) {
- return SPV_ERROR_INVALID_TEXT;
+ if (auto error = spvTextEncodeOpcode(grammar, &context, &inst)) {
+ return error;
}
if (context.advance()) break;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/text_handler.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/text_handler.cpp
index c31f34a6bf6..15c1741f67b 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/text_handler.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/text_handler.cpp
@@ -29,6 +29,7 @@
#include "source/util/bitutils.h"
#include "source/util/hex_float.h"
#include "source/util/parse_number.h"
+#include "source/util/string_utils.h"
namespace spvtools {
namespace {
@@ -61,28 +62,29 @@ spv_result_t advanceLine(spv_text text, spv_position position) {
// parameters, its the users responsibility to ensure these are non null.
spv_result_t advance(spv_text text, spv_position position) {
// NOTE: Consume white space, otherwise don't advance.
- if (position->index >= text->length) return SPV_END_OF_STREAM;
- switch (text->str[position->index]) {
- case '\0':
- return SPV_END_OF_STREAM;
- case ';':
- if (spv_result_t error = advanceLine(text, position)) return error;
- return advance(text, position);
- case ' ':
- case '\t':
- case '\r':
- position->column++;
- position->index++;
- return advance(text, position);
- case '\n':
- position->column = 0;
- position->line++;
- position->index++;
- return advance(text, position);
- default:
- break;
+ while (true) {
+ if (position->index >= text->length) return SPV_END_OF_STREAM;
+ switch (text->str[position->index]) {
+ case '\0':
+ return SPV_END_OF_STREAM;
+ case ';':
+ if (spv_result_t error = advanceLine(text, position)) return error;
+ continue;
+ case ' ':
+ case '\t':
+ case '\r':
+ position->column++;
+ position->index++;
+ continue;
+ case '\n':
+ position->column = 0;
+ position->line++;
+ position->index++;
+ continue;
+ default:
+ return SPV_SUCCESS;
+ }
}
- return SPV_SUCCESS;
}
// Fetches the next word from the given text stream starting from the given
@@ -120,7 +122,8 @@ spv_result_t getWord(spv_text text, spv_position position, std::string* word) {
case '\n':
case '\r':
if (escaping || quoting) break;
- // Fall through.
+ word->assign(text->str + start_index, text->str + position->index);
+ return SPV_SUCCESS;
case '\0': { // NOTE: End of word found!
word->assign(text->str + start_index, text->str + position->index);
return SPV_SUCCESS;
@@ -306,14 +309,8 @@ spv_result_t AssemblyContext::binaryEncodeString(const char* value,
<< SPV_LIMIT_INSTRUCTION_WORD_COUNT_MAX << " words.";
}
- pInst->words.resize(newWordCount);
-
- // Make sure all the bytes in the last word are 0, in case we only
- // write a partial word at the end.
- pInst->words.back() = 0;
-
- char* dest = (char*)&pInst->words[oldWordCount];
- strncpy(dest, value, length + 1);
+ pInst->words.reserve(newWordCount);
+ spvtools::utils::AppendToVector(value, &pInst->words);
return SPV_SUCCESS;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/bit_vector.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/bit_vector.h
index 3e189cb10d2..826d62f0236 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/bit_vector.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/bit_vector.h
@@ -32,7 +32,7 @@ class BitVector {
enum { kInitialNumBits = 1024 };
public:
- // Creates a bit vector contianing 0s.
+ // Creates a bit vector containing 0s.
BitVector(uint32_t reserved_size = kInitialNumBits)
: bits_((reserved_size - 1) / kBitContainerSize + 1, 0) {}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/hash_combine.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/hash_combine.h
new file mode 100644
index 00000000000..1a2dbc332a3
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/hash_combine.h
@@ -0,0 +1,53 @@
+// 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.
+
+#ifndef SOURCE_UTIL_HASH_COMBINE_H_
+#define SOURCE_UTIL_HASH_COMBINE_H_
+
+#include <cstddef>
+#include <functional>
+#include <vector>
+
+namespace spvtools {
+namespace utils {
+
+// Helpers for incrementally computing hashes.
+// For reference, see
+// http://open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3876.pdf
+
+template <typename T>
+inline size_t hash_combine(std::size_t seed, const T& val) {
+ return seed ^ (std::hash<T>()(val) + 0x9e3779b9 + (seed << 6) + (seed >> 2));
+}
+
+template <typename T>
+inline size_t hash_combine(std::size_t hash, const std::vector<T>& vals) {
+ for (const T& val : vals) {
+ hash = hash_combine(hash, val);
+ }
+ return hash;
+}
+
+inline size_t hash_combine(std::size_t hash) { return hash; }
+
+template <typename T, typename... Types>
+inline size_t hash_combine(std::size_t hash, const T& val,
+ const Types&... args) {
+ return hash_combine(hash_combine(hash, val), args...);
+}
+
+} // namespace utils
+} // namespace spvtools
+
+#endif // SOURCE_UTIL_HASH_COMBINE_H_
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/hex_float.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/hex_float.h
index be28eae3ae3..06e3c57572c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/hex_float.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/hex_float.h
@@ -199,7 +199,7 @@ bool operator==(const FloatProxy<T>& first, const FloatProxy<T>& second) {
// Reads a FloatProxy value as a normal float from a stream.
template <typename T>
std::istream& operator>>(std::istream& is, FloatProxy<T>& value) {
- T float_val;
+ T float_val = static_cast<T>(0.0);
is >> float_val;
value = FloatProxy<T>(float_val);
return is;
@@ -209,9 +209,10 @@ std::istream& operator>>(std::istream& is, FloatProxy<T>& value) {
// be the default for any non-specialized type.
template <typename T>
struct HexFloatTraits {
- // Integer type that can store this hex-float.
+ // Integer type that can store the bit representation of this hex-float.
using uint_type = void;
- // Signed integer type that can store this hex-float.
+ // Signed integer type that can store the bit representation of this
+ // hex-float.
using int_type = void;
// The numerical type that this HexFloat represents.
using underlying_type = void;
@@ -958,9 +959,15 @@ std::istream& operator>>(std::istream& is, HexFloat<T, Traits>& value) {
// This "looks" like a hex-float so treat it as one.
bool seen_p = false;
bool seen_dot = false;
- uint_type fraction_index = 0;
+ // The mantissa bits, without the most significant 1 bit, and with the
+ // the most recently read bits in the least significant positions.
uint_type fraction = 0;
+ // The number of mantissa bits that have been read, including the leading 1
+ // bit that is not written into 'fraction'.
+ uint_type fraction_index = 0;
+
+ // TODO(dneto): handle overflow and underflow
int_type exponent = HF::exponent_bias;
// Strip off leading zeros so we don't have to special-case them later.
@@ -968,11 +975,13 @@ std::istream& operator>>(std::istream& is, HexFloat<T, Traits>& value) {
is.get();
}
- bool is_denorm =
- true; // Assume denorm "representation" until we hear otherwise.
- // NB: This does not mean the value is actually denorm,
- // it just means that it was written 0.
+ // Does the mantissa, as written, have non-zero digits to the left of
+ // the decimal point. Assume no until proven otherwise.
+ bool has_integer_part = false;
bool bits_written = false; // Stays false until we write a bit.
+
+ // Scan the mantissa hex digits until we see a '.' or the 'p' that
+ // starts the exponent.
while (!seen_p && !seen_dot) {
// Handle characters that are left of the fractional part.
if (next_char == '.') {
@@ -980,9 +989,8 @@ std::istream& operator>>(std::istream& is, HexFloat<T, Traits>& value) {
} else if (next_char == 'p') {
seen_p = true;
} else if (::isxdigit(next_char)) {
- // We know this is not denormalized since we have stripped all leading
- // zeroes and we are not a ".".
- is_denorm = false;
+ // We have stripped all leading zeroes and we have not yet seen a ".".
+ has_integer_part = true;
int number = get_nibble_from_character(next_char);
for (int i = 0; i < 4; ++i, number <<= 1) {
uint_type write_bit = (number & 0x8) ? 0x1 : 0x0;
@@ -993,8 +1001,12 @@ std::istream& operator>>(std::istream& is, HexFloat<T, Traits>& value) {
fraction |
static_cast<uint_type>(
write_bit << (HF::top_bit_left_shift - fraction_index++)));
+ // TODO(dneto): Avoid overflow. Testing would require
+ // parameterization.
exponent = static_cast<int_type>(exponent + 1);
}
+ // Since this updated after setting fraction bits, this effectively
+ // drops the leading 1 bit.
bits_written |= write_bit != 0;
}
} else {
@@ -1018,10 +1030,12 @@ std::istream& operator>>(std::istream& is, HexFloat<T, Traits>& value) {
for (int i = 0; i < 4; ++i, number <<= 1) {
uint_type write_bit = (number & 0x8) ? 0x01 : 0x00;
bits_written |= write_bit != 0;
- if (is_denorm && !bits_written) {
+ if ((!has_integer_part) && !bits_written) {
// 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<int_type>(exponent - 1);
} else {
fraction = static_cast<uint_type>(
@@ -1043,25 +1057,40 @@ std::istream& operator>>(std::istream& is, HexFloat<T, Traits>& value) {
// Finished reading the part preceding 'p'.
// In hex floats syntax, the binary exponent is required.
- bool seen_sign = false;
+ bool seen_exponent_sign = false;
int8_t exponent_sign = 1;
bool seen_written_exponent_digits = false;
+ // The magnitude of the exponent, as written, or the sentinel value to signal
+ // overflow.
int_type written_exponent = 0;
+ // A sentinel value signalling overflow of the magnitude of the written
+ // exponent. We'll assume that -written_exponent_overflow is valid for the
+ // type. Later we may add 1 or subtract 1 from the adjusted exponent, so leave
+ // room for an extra 1.
+ const int_type written_exponent_overflow =
+ std::numeric_limits<int_type>::max() - 1;
while (true) {
if (!seen_written_exponent_digits &&
(next_char == '-' || next_char == '+')) {
- if (seen_sign) {
+ if (seen_exponent_sign) {
is.setstate(std::ios::failbit);
return is;
}
- seen_sign = true;
+ seen_exponent_sign = true;
exponent_sign = (next_char == '-') ? -1 : 1;
} else if (::isdigit(next_char)) {
seen_written_exponent_digits = true;
// Hex-floats express their exponent as decimal.
- written_exponent = static_cast<int_type>(written_exponent * 10);
- written_exponent =
- static_cast<int_type>(written_exponent + (next_char - '0'));
+ int_type digit =
+ static_cast<int_type>(static_cast<int_type>(next_char) - '0');
+ if (written_exponent >= (written_exponent_overflow - digit) / 10) {
+ // The exponent is very big. Saturate rather than overflow the exponent.
+ // signed integer, which would be undefined behaviour.
+ written_exponent = written_exponent_overflow;
+ } else {
+ written_exponent = static_cast<int_type>(
+ static_cast<int_type>(written_exponent * 10) + digit);
+ }
} else {
break;
}
@@ -1075,10 +1104,29 @@ std::istream& operator>>(std::istream& is, HexFloat<T, Traits>& value) {
}
written_exponent = static_cast<int_type>(written_exponent * exponent_sign);
- exponent = static_cast<int_type>(exponent + written_exponent);
+ // Now fold in the exponent bias into the written exponent, updating exponent.
+ // But avoid undefined behaviour that would result from overflowing int_type.
+ if (written_exponent >= 0 && exponent >= 0) {
+ // Saturate up to written_exponent_overflow.
+ if (written_exponent_overflow - exponent > written_exponent) {
+ exponent = static_cast<int_type>(written_exponent + exponent);
+ } else {
+ exponent = written_exponent_overflow;
+ }
+ } else if (written_exponent < 0 && exponent < 0) {
+ // Saturate down to -written_exponent_overflow.
+ if (written_exponent_overflow + exponent > -written_exponent) {
+ exponent = static_cast<int_type>(written_exponent + exponent);
+ } else {
+ exponent = static_cast<int_type>(-written_exponent_overflow);
+ }
+ } else {
+ // They're of opposing sign, so it's safe to add.
+ exponent = static_cast<int_type>(written_exponent + exponent);
+ }
- bool is_zero = is_denorm && (fraction == 0);
- if (is_denorm && !is_zero) {
+ bool is_zero = (!has_integer_part) && (fraction == 0);
+ if ((!has_integer_part) && !is_zero) {
fraction = static_cast<uint_type>(fraction << 1);
exponent = static_cast<int_type>(exponent - 1);
} else if (is_zero) {
@@ -1095,7 +1143,7 @@ std::istream& operator>>(std::istream& is, HexFloat<T, Traits>& value) {
const int_type max_exponent =
SetBits<uint_type, 0, HF::num_exponent_bits>::get;
- // Handle actual denorm numbers
+ // Handle denorm numbers
while (exponent < 0 && !is_zero) {
fraction = static_cast<uint_type>(fraction >> 1);
exponent = static_cast<int_type>(exponent + 1);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/ilist.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/ilist.h
index 9837b09b32b..42d5e62b912 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/ilist.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/ilist.h
@@ -59,7 +59,7 @@ class IntrusiveList {
// Moves the contents of the given list to the list being constructed.
IntrusiveList(IntrusiveList&&);
- // Destorys the list. Note that the elements of the list will not be deleted,
+ // Destroys the list. Note that the elements of the list will not be deleted,
// but they will be removed from the list.
virtual ~IntrusiveList();
@@ -348,6 +348,7 @@ void IntrusiveList<NodeType>::Check(NodeType* start) {
p = p->next_node_;
} while (p != start);
assert(sentinel_count == 1 && "List should have exactly 1 sentinel node.");
+ (void)sentinel_count;
p = start;
do {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/parse_number.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/parse_number.h
index 729aac54bf9..d0f2a09a364 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/parse_number.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/parse_number.h
@@ -220,7 +220,7 @@ EncodeNumberStatus ParseAndEncodeIntegerNumber(
std::function<void(uint32_t)> emit, std::string* error_msg);
// Parses a floating point value of a given |type| from the given |text| and
-// encodes the number by the given |emit| funciton. On success, returns
+// encodes the number by the given |emit| function. On success, returns
// EncodeNumberStatus::kSuccess and the parsed number will be consumed by the
// given |emit| function word by word (least significant word first). On
// failure, this function returns the error code of the encoding status and
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/small_vector.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/small_vector.h
index f2c1147bede..648a34824f5 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/small_vector.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/small_vector.h
@@ -64,6 +64,11 @@ class SmallVector {
}
}
+ template <class InputIt>
+ SmallVector(InputIt first, InputIt last) : SmallVector() {
+ insert(end(), first, last);
+ }
+
SmallVector(std::vector<T>&& vec) : SmallVector() {
if (vec.size() > small_size) {
large_data_ = MakeUnique<std::vector<T>>(std::move(vec));
@@ -175,9 +180,12 @@ class SmallVector {
return true;
}
+// Avoid infinite recursion from rewritten operators in C++20
+#if __cplusplus <= 201703L
friend bool operator==(const std::vector<T>& lhs, const SmallVector& rhs) {
return rhs == lhs;
}
+#endif
friend bool operator!=(const SmallVector& lhs, const std::vector<T>& rhs) {
return !(lhs == rhs);
@@ -325,6 +333,15 @@ class SmallVector {
++size_;
}
+ void pop_back() {
+ if (large_data_) {
+ large_data_->pop_back();
+ } else {
+ --size_;
+ small_data_[size_].~T();
+ }
+ }
+
template <class InputIt>
iterator insert(iterator pos, InputIt first, InputIt last) {
size_t element_idx = (pos - begin());
@@ -363,7 +380,7 @@ class SmallVector {
}
}
- // Upate the size.
+ // Update the size.
size_ += num_of_new_elements;
return pos;
}
@@ -449,7 +466,7 @@ class SmallVector {
T* small_data_;
// The actual data used to store the array elements. It must never be used
- // directly, but must only be accesed through |small_data_|.
+ // directly, but must only be accessed through |small_data_|.
typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type
buffer[small_size];
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/string_utils.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/string_utils.h
index 4282aa94963..03e20b3d637 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/string_utils.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/string_utils.h
@@ -16,6 +16,8 @@
#define SOURCE_UTIL_STRING_UTILS_H_
#include <assert.h>
+
+#include <cstring>
#include <sstream>
#include <string>
#include <vector>
@@ -44,9 +46,10 @@ std::string CardinalToOrdinal(size_t cardinal);
// string will be empty.
std::pair<std::string, std::string> SplitFlagArgs(const std::string& flag);
-// Encodes a string as a sequence of words, using the SPIR-V encoding.
-inline std::vector<uint32_t> MakeVector(std::string input) {
- std::vector<uint32_t> result;
+// Encodes a string as a sequence of words, using the SPIR-V encoding, appending
+// to an existing vector.
+inline void AppendToVector(const std::string& input,
+ std::vector<uint32_t>* result) {
uint32_t word = 0;
size_t num_bytes = input.size();
// SPIR-V strings are null-terminated. The byte_index == num_bytes
@@ -56,24 +59,36 @@ inline std::vector<uint32_t> MakeVector(std::string input) {
(byte_index < num_bytes ? uint8_t(input[byte_index]) : uint8_t(0));
word |= (new_byte << (8 * (byte_index % sizeof(uint32_t))));
if (3 == (byte_index % sizeof(uint32_t))) {
- result.push_back(word);
+ result->push_back(word);
word = 0;
}
}
// Emit a trailing partial word.
if ((num_bytes + 1) % sizeof(uint32_t)) {
- result.push_back(word);
+ result->push_back(word);
}
+}
+
+// Encodes a string as a sequence of words, using the SPIR-V encoding.
+inline std::vector<uint32_t> MakeVector(const std::string& input) {
+ std::vector<uint32_t> result;
+ AppendToVector(input, &result);
return result;
}
-// Decode a string from a sequence of words, using the SPIR-V encoding.
-template <class VectorType>
-inline std::string MakeString(const VectorType& words) {
+// Decode a string from a sequence of words between first and last, using the
+// SPIR-V encoding. Assert that a terminating 0-byte was found (unless
+// assert_found_terminating_null is passed as false).
+template <class InputIt>
+inline std::string MakeString(InputIt first, InputIt last,
+ bool assert_found_terminating_null = true) {
std::string result;
+ constexpr size_t kCharsPerWord = sizeof(*first);
+ static_assert(kCharsPerWord == 4, "expect 4-byte word");
- for (uint32_t word : words) {
- for (int byte_index = 0; byte_index < 4; byte_index++) {
+ for (InputIt pos = first; pos != last; ++pos) {
+ uint32_t word = *pos;
+ for (size_t byte_index = 0; byte_index < kCharsPerWord; byte_index++) {
uint32_t extracted_word = (word >> (8 * byte_index)) & 0xFF;
char c = static_cast<char>(extracted_word);
if (c == 0) {
@@ -82,9 +97,33 @@ inline std::string MakeString(const VectorType& words) {
result += c;
}
}
- assert(false && "Did not find terminating null for the string.");
+ assert(!assert_found_terminating_null &&
+ "Did not find terminating null for the string.");
+ (void)assert_found_terminating_null; /* No unused parameters in release
+ builds. */
return result;
-} // namespace utils
+}
+
+// Decode a string from a sequence of words in a vector, using the SPIR-V
+// encoding.
+template <class VectorType>
+inline std::string MakeString(const VectorType& words,
+ bool assert_found_terminating_null = true) {
+ return MakeString(words.cbegin(), words.cend(),
+ assert_found_terminating_null);
+}
+
+// Decode a string from array words, consuming up to count words, using the
+// SPIR-V encoding.
+inline std::string MakeString(const uint32_t* words, size_t num_words,
+ bool assert_found_terminating_null = true) {
+ return MakeString(words, words + num_words, assert_found_terminating_null);
+}
+
+// Check if str starts with prefix (only included since C++20)
+inline bool starts_with(const std::string& str, const char* prefix) {
+ return 0 == str.compare(0, std::strlen(prefix), prefix);
+}
} // namespace utils
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/timer.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/timer.h
index fc4b747b987..080831196f5 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/util/timer.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/util/timer.h
@@ -206,16 +206,16 @@ class Timer {
// Variable to save the result of clock_gettime(CLOCK_PROCESS_CPUTIME_ID) when
// Timer::Stop() is called. It is used as the last status of CPU time. The
- // resouce usage is measured by subtracting |cpu_before_| from it.
+ // resource usage is measured by subtracting |cpu_before_| from it.
timespec cpu_after_;
// Variable to save the result of clock_gettime(CLOCK_MONOTONIC) when
// Timer::Stop() is called. It is used as the last status of WALL time. The
- // resouce usage is measured by subtracting |wall_before_| from it.
+ // resource usage is measured by subtracting |wall_before_| from it.
timespec wall_after_;
// Variable to save the result of getrusage() when Timer::Stop() is called. It
- // is used as the last status of USR time, SYS time, and RSS. Those resouce
+ // is used as the last status of USR time, SYS time, and RSS. Those resource
// usages are measured by subtracting |usage_before_| from it.
rusage usage_after_;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/basic_block.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/basic_block.cpp
index b2a8793d285..da05db3a812 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/basic_block.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/basic_block.cpp
@@ -24,11 +24,13 @@ namespace val {
BasicBlock::BasicBlock(uint32_t label_id)
: id_(label_id),
immediate_dominator_(nullptr),
- immediate_post_dominator_(nullptr),
+ immediate_structural_dominator_(nullptr),
+ immediate_structural_post_dominator_(nullptr),
predecessors_(),
successors_(),
type_(0),
reachable_(false),
+ structurally_reachable_(false),
label_(nullptr),
terminator_(nullptr) {}
@@ -36,21 +38,32 @@ void BasicBlock::SetImmediateDominator(BasicBlock* dom_block) {
immediate_dominator_ = dom_block;
}
-void BasicBlock::SetImmediatePostDominator(BasicBlock* pdom_block) {
- immediate_post_dominator_ = pdom_block;
+void BasicBlock::SetImmediateStructuralDominator(BasicBlock* dom_block) {
+ immediate_structural_dominator_ = dom_block;
+}
+
+void BasicBlock::SetImmediateStructuralPostDominator(BasicBlock* pdom_block) {
+ immediate_structural_post_dominator_ = pdom_block;
}
const BasicBlock* BasicBlock::immediate_dominator() const {
return immediate_dominator_;
}
-const BasicBlock* BasicBlock::immediate_post_dominator() const {
- return immediate_post_dominator_;
+const BasicBlock* BasicBlock::immediate_structural_dominator() const {
+ return immediate_structural_dominator_;
+}
+
+const BasicBlock* BasicBlock::immediate_structural_post_dominator() const {
+ return immediate_structural_post_dominator_;
}
BasicBlock* BasicBlock::immediate_dominator() { return immediate_dominator_; }
-BasicBlock* BasicBlock::immediate_post_dominator() {
- return immediate_post_dominator_;
+BasicBlock* BasicBlock::immediate_structural_dominator() {
+ return immediate_structural_dominator_;
+}
+BasicBlock* BasicBlock::immediate_structural_post_dominator() {
+ return immediate_structural_post_dominator_;
}
void BasicBlock::RegisterSuccessors(
@@ -58,6 +71,10 @@ void BasicBlock::RegisterSuccessors(
for (auto& block : next_blocks) {
block->predecessors_.push_back(this);
successors_.push_back(block);
+
+ // Register structural successors/predecessors too.
+ block->structural_predecessors_.push_back(this);
+ structural_successors_.push_back(block);
}
}
@@ -67,10 +84,16 @@ bool BasicBlock::dominates(const BasicBlock& other) const {
std::find(other.dom_begin(), other.dom_end(), this));
}
-bool BasicBlock::postdominates(const BasicBlock& other) const {
- return (this == &other) ||
- !(other.pdom_end() ==
- std::find(other.pdom_begin(), other.pdom_end(), this));
+bool BasicBlock::structurally_dominates(const BasicBlock& other) const {
+ return (this == &other) || !(other.structural_dom_end() ==
+ std::find(other.structural_dom_begin(),
+ other.structural_dom_end(), this));
+}
+
+bool BasicBlock::structurally_postdominates(const BasicBlock& other) const {
+ return (this == &other) || !(other.structural_pdom_end() ==
+ std::find(other.structural_pdom_begin(),
+ other.structural_pdom_end(), this));
}
BasicBlock::DominatorIterator::DominatorIterator() : current_(nullptr) {}
@@ -107,21 +130,43 @@ BasicBlock::DominatorIterator BasicBlock::dom_end() {
return DominatorIterator();
}
-const BasicBlock::DominatorIterator BasicBlock::pdom_begin() const {
- return DominatorIterator(
- this, [](const BasicBlock* b) { return b->immediate_post_dominator(); });
+const BasicBlock::DominatorIterator BasicBlock::structural_dom_begin() const {
+ return DominatorIterator(this, [](const BasicBlock* b) {
+ return b->immediate_structural_dominator();
+ });
}
-BasicBlock::DominatorIterator BasicBlock::pdom_begin() {
- return DominatorIterator(
- this, [](const BasicBlock* b) { return b->immediate_post_dominator(); });
+BasicBlock::DominatorIterator BasicBlock::structural_dom_begin() {
+ return DominatorIterator(this, [](const BasicBlock* b) {
+ return b->immediate_structural_dominator();
+ });
+}
+
+const BasicBlock::DominatorIterator BasicBlock::structural_dom_end() const {
+ return DominatorIterator();
+}
+
+BasicBlock::DominatorIterator BasicBlock::structural_dom_end() {
+ return DominatorIterator();
+}
+
+const BasicBlock::DominatorIterator BasicBlock::structural_pdom_begin() const {
+ return DominatorIterator(this, [](const BasicBlock* b) {
+ return b->immediate_structural_post_dominator();
+ });
+}
+
+BasicBlock::DominatorIterator BasicBlock::structural_pdom_begin() {
+ return DominatorIterator(this, [](const BasicBlock* b) {
+ return b->immediate_structural_post_dominator();
+ });
}
-const BasicBlock::DominatorIterator BasicBlock::pdom_end() const {
+const BasicBlock::DominatorIterator BasicBlock::structural_pdom_end() const {
return DominatorIterator();
}
-BasicBlock::DominatorIterator BasicBlock::pdom_end() {
+BasicBlock::DominatorIterator BasicBlock::structural_pdom_end() {
return DominatorIterator();
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/basic_block.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/basic_block.h
index 5af4b9e4d27..be5657ea55d 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/basic_block.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/basic_block.h
@@ -64,9 +64,32 @@ class BasicBlock {
/// Returns the successors of the BasicBlock
std::vector<BasicBlock*>* successors() { return &successors_; }
- /// Returns true if the block is reachable in the CFG
+ /// Returns the structural successors of the BasicBlock
+ std::vector<BasicBlock*>* structural_predecessors() {
+ return &structural_predecessors_;
+ }
+
+ /// Returns the structural predecessors of the BasicBlock
+ const std::vector<BasicBlock*>* structural_predecessors() const {
+ return &structural_predecessors_;
+ }
+
+ /// Returns the structural successors of the BasicBlock
+ std::vector<BasicBlock*>* structural_successors() {
+ return &structural_successors_;
+ }
+
+ /// Returns the structural predecessors of the BasicBlock
+ const std::vector<BasicBlock*>* structural_successors() const {
+ return &structural_successors_;
+ }
+
+ /// Returns true if the block is reachable in the CFG.
bool reachable() const { return reachable_; }
+ /// Returns true if the block is structurally reachable in the CFG.
+ bool structurally_reachable() const { return structurally_reachable_; }
+
/// Returns true if BasicBlock is of the given type
bool is_type(BlockType type) const {
if (type == kBlockTypeUndefined) return type_.none();
@@ -76,6 +99,11 @@ class BasicBlock {
/// Sets the reachability of the basic block in the CFG
void set_reachable(bool reachability) { reachable_ = reachability; }
+ /// Sets the structural reachability of the basic block in the CFG
+ void set_structurally_reachable(bool reachability) {
+ structurally_reachable_ = reachability;
+ }
+
/// Sets the type of the BasicBlock
void set_type(BlockType type) {
if (type == kBlockTypeUndefined)
@@ -84,27 +112,38 @@ class BasicBlock {
type_.set(type);
}
- /// Sets the immedate dominator of this basic block
+ /// Sets the immediate dominator of this basic block
///
/// @param[in] dom_block The dominator block
void SetImmediateDominator(BasicBlock* dom_block);
- /// Sets the immedate post dominator of this basic block
+ /// Sets the immediate dominator of this basic block
+ ///
+ /// @param[in] dom_block The dominator block
+ void SetImmediateStructuralDominator(BasicBlock* dom_block);
+
+ /// Sets the immediate post dominator of this basic block
///
/// @param[in] pdom_block The post dominator block
- void SetImmediatePostDominator(BasicBlock* pdom_block);
+ void SetImmediateStructuralPostDominator(BasicBlock* pdom_block);
- /// Returns the immedate dominator of this basic block
+ /// Returns the immediate dominator of this basic block
BasicBlock* immediate_dominator();
- /// Returns the immedate dominator of this basic block
+ /// Returns the immediate dominator of this basic block
const BasicBlock* immediate_dominator() const;
- /// Returns the immedate post dominator of this basic block
- BasicBlock* immediate_post_dominator();
+ /// Returns the immediate dominator of this basic block
+ BasicBlock* immediate_structural_dominator();
+
+ /// Returns the immediate dominator of this basic block
+ const BasicBlock* immediate_structural_dominator() const;
- /// Returns the immedate post dominator of this basic block
- const BasicBlock* immediate_post_dominator() const;
+ /// Returns the immediate post dominator of this basic block
+ BasicBlock* immediate_structural_post_dominator();
+
+ /// Returns the immediate post dominator of this basic block
+ const BasicBlock* immediate_structural_post_dominator() const;
/// Returns the label instruction for the block, or nullptr if not set.
const Instruction* label() const { return label_; }
@@ -132,9 +171,18 @@ class BasicBlock {
/// Assumes dominators have been computed.
bool dominates(const BasicBlock& other) const;
- /// Returns true if this block postdominates the other block.
- /// Assumes dominators have been computed.
- bool postdominates(const BasicBlock& other) const;
+ /// Returns true if this block structurally dominates the other block.
+ /// Assumes structural dominators have been computed.
+ bool structurally_dominates(const BasicBlock& other) const;
+
+ /// Returns true if this block structurally postdominates the other block.
+ /// Assumes structural dominators have been computed.
+ bool structurally_postdominates(const BasicBlock& other) const;
+
+ void RegisterStructuralSuccessor(BasicBlock* block) {
+ block->structural_predecessors_.push_back(this);
+ structural_successors_.push_back(block);
+ }
/// @brief A BasicBlock dominator iterator class
///
@@ -191,18 +239,32 @@ class BasicBlock {
/// block
DominatorIterator dom_end();
+ /// Returns a dominator iterator which points to the current block
+ const DominatorIterator structural_dom_begin() const;
+
+ /// Returns a dominator iterator which points to the current block
+ DominatorIterator structural_dom_begin();
+
+ /// Returns a dominator iterator which points to one element past the first
+ /// block
+ const DominatorIterator structural_dom_end() const;
+
+ /// Returns a dominator iterator which points to one element past the first
+ /// block
+ DominatorIterator structural_dom_end();
+
/// Returns a post dominator iterator which points to the current block
- const DominatorIterator pdom_begin() const;
+ const DominatorIterator structural_pdom_begin() const;
/// Returns a post dominator iterator which points to the current block
- DominatorIterator pdom_begin();
+ DominatorIterator structural_pdom_begin();
/// Returns a post dominator iterator which points to one element past the
/// last block
- const DominatorIterator pdom_end() const;
+ const DominatorIterator structural_pdom_end() const;
/// Returns a post dominator iterator which points to one element past the
/// last block
- DominatorIterator pdom_end();
+ DominatorIterator structural_pdom_end();
private:
/// Id of the BasicBlock
@@ -211,8 +273,11 @@ class BasicBlock {
/// Pointer to the immediate dominator of the BasicBlock
BasicBlock* immediate_dominator_;
- /// Pointer to the immediate dominator of the BasicBlock
- BasicBlock* immediate_post_dominator_;
+ /// Pointer to the immediate structural dominator of the BasicBlock
+ BasicBlock* immediate_structural_dominator_;
+
+ /// Pointer to the immediate structural post dominator of the BasicBlock
+ BasicBlock* immediate_structural_post_dominator_;
/// The set of predecessors of the BasicBlock
std::vector<BasicBlock*> predecessors_;
@@ -226,11 +291,17 @@ class BasicBlock {
/// True if the block is reachable in the CFG
bool reachable_;
+ /// True if the block is structurally reachable in the CFG
+ bool structurally_reachable_;
+
/// label of this block, if any.
const Instruction* label_;
/// Terminator of this block.
const Instruction* terminator_;
+
+ std::vector<BasicBlock*> structural_predecessors_;
+ std::vector<BasicBlock*> structural_successors_;
};
/// @brief Returns true if the iterators point to the same element or if both
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/construct.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/construct.cpp
index 251e2bbaee7..52e61d55587 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/construct.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/construct.cpp
@@ -70,60 +70,45 @@ BasicBlock* Construct::exit_block() { return exit_block_; }
void Construct::set_exit(BasicBlock* block) { exit_block_ = block; }
-Construct::ConstructBlockSet Construct::blocks(Function* function) const {
- auto header = entry_block();
- auto merge = exit_block();
- assert(header);
- int header_depth = function->GetBlockDepth(const_cast<BasicBlock*>(header));
- ConstructBlockSet construct_blocks;
- std::unordered_set<BasicBlock*> corresponding_headers;
- for (auto& other : corresponding_constructs()) {
- // The corresponding header can be the same block as this construct's
- // header for loops with no loop construct. In those cases, don't add the
- // loop header as it prevents finding any blocks in the construct.
- if (type() != ConstructType::kContinue || other->entry_block() != header) {
- corresponding_headers.insert(other->entry_block());
- }
+Construct::ConstructBlockSet Construct::blocks(Function* /*function*/) const {
+ const auto header = entry_block();
+ const auto exit = exit_block();
+ const bool is_continue = type() == ConstructType::kContinue;
+ const bool is_loop = type() == ConstructType::kLoop;
+ const BasicBlock* continue_header = nullptr;
+ if (is_loop) {
+ // The only corresponding construct for a loop is the continue.
+ continue_header = (*corresponding_constructs().begin())->entry_block();
}
std::vector<BasicBlock*> stack;
stack.push_back(const_cast<BasicBlock*>(header));
+ ConstructBlockSet construct_blocks;
while (!stack.empty()) {
- BasicBlock* block = stack.back();
+ auto* block = stack.back();
stack.pop_back();
- if (merge == block && ExitBlockIsMergeBlock()) {
- // Merge block is not part of the construct.
- continue;
- }
-
- if (corresponding_headers.count(block)) {
- // Entered a corresponding construct.
- continue;
- }
-
- int block_depth = function->GetBlockDepth(block);
- if (block_depth < header_depth) {
- // Broke to outer construct.
- continue;
- }
-
- // In a loop, the continue target is at a depth of the loop construct + 1.
- // A selection construct nested directly within the loop construct is also
- // at the same depth. It is valid, however, to branch directly to the
- // continue target from within the selection construct.
- if (block != header && block_depth == header_depth &&
- type() == ConstructType::kSelection &&
- block->is_type(kBlockTypeContinue)) {
- // Continued to outer construct.
- continue;
- }
-
- if (!construct_blocks.insert(block).second) continue;
+ if (header->structurally_dominates(*block)) {
+ bool include = false;
+ if (is_continue && exit->structurally_postdominates(*block)) {
+ // Continue construct include blocks dominated by the continue target
+ // and post-dominated by the back-edge block.
+ include = true;
+ } else if (!exit->structurally_dominates(*block)) {
+ // Selection and loop constructs include blocks dominated by the header
+ // and not dominated by the merge.
+ include = true;
+ if (is_loop && continue_header->structurally_dominates(*block)) {
+ // Loop constructs have an additional constraint that they do not
+ // include blocks dominated by the continue construct. Since all
+ // blocks in the continue construct are dominated by the continue
+ // target, we just test for dominance by continue target.
+ include = false;
+ }
+ }
+ if (include) {
+ if (!construct_blocks.insert(block).second) continue;
- if (merge != block) {
- for (auto succ : *block->successors()) {
- // All blocks in the construct must be dominated by the header.
- if (header->dominates(*succ)) {
+ for (auto succ : *block->structural_successors()) {
stack.push_back(succ);
}
}
@@ -181,11 +166,12 @@ bool Construct::IsStructuredExit(ValidationState_t& _, BasicBlock* dest) const {
for (auto& use : block->label()->uses()) {
if ((use.first->opcode() == SpvOpLoopMerge ||
use.first->opcode() == SpvOpSelectionMerge) &&
- use.second == 1 && use.first->block()->dominates(*block)) {
+ use.second == 1 &&
+ use.first->block()->structurally_dominates(*block)) {
return use.first->block();
}
}
- return block->immediate_dominator();
+ return block->immediate_structural_dominator();
};
bool seen_switch = false;
@@ -201,7 +187,7 @@ bool Construct::IsStructuredExit(ValidationState_t& _, BasicBlock* dest) const {
terminator->opcode() == SpvOpSwitch)) {
auto merge_target = merge_inst->GetOperandAs<uint32_t>(0u);
auto merge_block = merge_inst->function()->GetBlock(merge_target).first;
- if (merge_block->dominates(*header)) {
+ if (merge_block->structurally_dominates(*header)) {
block = NextBlock(block);
continue;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/decoration.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/decoration.h
index ed3320f87ab..4f53f207584 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/decoration.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/decoration.h
@@ -69,6 +69,15 @@ class Decoration {
std::vector<uint32_t>& params() { return params_; }
const std::vector<uint32_t>& params() const { return params_; }
+ inline bool operator<(const Decoration& rhs) const {
+ // Note: Sort by struct_member_index_ first, then type, so look up can be
+ // efficient using lower_bound() and upper_bound().
+ if (struct_member_index_ < rhs.struct_member_index_) return true;
+ if (rhs.struct_member_index_ < struct_member_index_) return false;
+ if (dec_type_ < rhs.dec_type_) return true;
+ if (rhs.dec_type_ < dec_type_) return false;
+ return params_ < rhs.params_;
+ }
inline bool operator==(const Decoration& rhs) const {
return (dec_type_ == rhs.dec_type_ && params_ == rhs.params_ &&
struct_member_index_ == rhs.struct_member_index_);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/function.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/function.cpp
index 9ad68e86727..fc7ccd062c0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/function.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/function.cpp
@@ -57,7 +57,7 @@ spv_result_t Function::RegisterFunctionParameter(uint32_t parameter_id,
uint32_t type_id) {
assert(current_block_ == nullptr &&
"RegisterFunctionParameter can only be called when parsing the binary "
- "ouside of a block");
+ "outside of a block");
// TODO(umar): Validate function parameter type order and count
// TODO(umar): Use these variables to validate parameter type
(void)parameter_id;
@@ -73,6 +73,8 @@ spv_result_t Function::RegisterLoopMerge(uint32_t merge_id,
BasicBlock& continue_target_block = blocks_.at(continue_id);
assert(current_block_ &&
"RegisterLoopMerge must be called when called within a block");
+ current_block_->RegisterStructuralSuccessor(&merge_block);
+ current_block_->RegisterStructuralSuccessor(&continue_target_block);
current_block_->set_type(kBlockTypeLoop);
merge_block.set_type(kBlockTypeMerge);
@@ -101,6 +103,7 @@ spv_result_t Function::RegisterSelectionMerge(uint32_t merge_id) {
current_block_->set_type(kBlockTypeSelection);
merge_block.set_type(kBlockTypeMerge);
merge_block_header_[&merge_block] = current_block_;
+ current_block_->RegisterStructuralSuccessor(&merge_block);
AddConstruct({ConstructType::kSelection, current_block(), &merge_block});
@@ -130,7 +133,7 @@ spv_result_t Function::RegisterBlock(uint32_t block_id, bool is_definition) {
undefined_blocks_.erase(block_id);
current_block_ = &inserted_block->second;
ordered_blocks_.push_back(current_block_);
- } else if (success) { // Block doesn't exsist but this is not a definition
+ } else if (success) { // Block doesn't exist but this is not a definition
undefined_blocks_.insert(block_id);
}
@@ -251,29 +254,43 @@ Function::GetBlocksFunction Function::AugmentedCFGSuccessorsFunction() const {
};
}
-Function::GetBlocksFunction
-Function::AugmentedCFGSuccessorsFunctionIncludingHeaderToContinueEdge() const {
+Function::GetBlocksFunction Function::AugmentedCFGPredecessorsFunction() const {
+ return [this](const BasicBlock* block) {
+ auto where = augmented_predecessors_map_.find(block);
+ return where == augmented_predecessors_map_.end() ? block->predecessors()
+ : &(*where).second;
+ };
+}
+
+Function::GetBlocksFunction Function::AugmentedStructuralCFGSuccessorsFunction()
+ const {
return [this](const BasicBlock* block) {
- auto where = loop_header_successors_plus_continue_target_map_.find(block);
- return where == loop_header_successors_plus_continue_target_map_.end()
- ? AugmentedCFGSuccessorsFunction()(block)
+ auto where = augmented_successors_map_.find(block);
+ return where == augmented_successors_map_.end()
+ ? block->structural_successors()
: &(*where).second;
};
}
-Function::GetBlocksFunction Function::AugmentedCFGPredecessorsFunction() const {
+Function::GetBlocksFunction
+Function::AugmentedStructuralCFGPredecessorsFunction() const {
return [this](const BasicBlock* block) {
auto where = augmented_predecessors_map_.find(block);
- return where == augmented_predecessors_map_.end() ? block->predecessors()
- : &(*where).second;
+ return where == augmented_predecessors_map_.end()
+ ? block->structural_predecessors()
+ : &(*where).second;
};
}
void Function::ComputeAugmentedCFG() {
// Compute the successors of the pseudo-entry block, and
// the predecessors of the pseudo exit block.
- auto succ_func = [](const BasicBlock* b) { return b->successors(); };
- auto pred_func = [](const BasicBlock* b) { return b->predecessors(); };
+ auto succ_func = [](const BasicBlock* b) {
+ return b->structural_successors();
+ };
+ auto pred_func = [](const BasicBlock* b) {
+ return b->structural_predecessors();
+ };
CFA<BasicBlock>::ComputeAugmentedCFG(
ordered_blocks_, &pseudo_entry_block_, &pseudo_exit_block_,
&augmented_successors_map_, &augmented_predecessors_map_, succ_func,
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/function.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/function.h
index 400bb6348db..126b1dc7788 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/function.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/function.h
@@ -73,8 +73,8 @@ class Function {
/// Registers a variable in the current block
///
- /// @param[in] type_id The type ID of the varaible
- /// @param[in] id The ID of the varaible
+ /// @param[in] type_id The type ID of the variable
+ /// @param[in] id The ID of the variable
/// @param[in] storage The storage of the variable
/// @param[in] init_id The initializer ID of the variable
///
@@ -184,12 +184,12 @@ class Function {
std::function<const std::vector<BasicBlock*>*(const BasicBlock*)>;
/// Returns the block successors function for the augmented CFG.
GetBlocksFunction AugmentedCFGSuccessorsFunction() const;
- /// Like AugmentedCFGSuccessorsFunction, but also includes a forward edge from
- /// a loop header block to its continue target, if they are different blocks.
- GetBlocksFunction
- AugmentedCFGSuccessorsFunctionIncludingHeaderToContinueEdge() const;
/// Returns the block predecessors function for the augmented CFG.
GetBlocksFunction AugmentedCFGPredecessorsFunction() const;
+ /// Returns the block structural successors function for the augmented CFG.
+ GetBlocksFunction AugmentedStructuralCFGSuccessorsFunction() const;
+ /// Returns the block structural predecessors function for the augmented CFG.
+ GetBlocksFunction AugmentedStructuralCFGPredecessorsFunction() const;
/// Returns the control flow nesting depth of the given basic block.
/// This function only works when you have structured control flow.
@@ -197,10 +197,10 @@ class Function {
/// been identified and dominators have been computed.
int GetBlockDepth(BasicBlock* bb);
- /// Prints a GraphViz digraph of the CFG of the current funciton
+ /// Prints a GraphViz digraph of the CFG of the current function
void PrintDotGraph() const;
- /// Prints a directed graph of the CFG of the current funciton
+ /// Prints a directed graph of the CFG of the current function
void PrintBlocks() const;
/// Registers execution model limitation such as "Feature X is only available
@@ -285,7 +285,7 @@ class Function {
/// The type of the return value
uint32_t result_type_id_;
- /// The control fo the funciton
+ /// The control fo the function
SpvFunctionControlMask function_control_;
/// The type of declaration of each function
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/instruction.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/instruction.cpp
index b9155898ac8..f16fcd7300a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/instruction.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/instruction.cpp
@@ -16,6 +16,9 @@
#include <utility>
+#include "source/binary.h"
+#include "source/util/string_utils.h"
+
namespace spvtools {
namespace val {
@@ -41,5 +44,12 @@ bool operator==(const Instruction& lhs, uint32_t rhs) {
return lhs.id() == rhs;
}
+template <>
+std::string Instruction::GetOperandAs<std::string>(size_t index) const {
+ const spv_parsed_operand_t& o = operands_.at(index);
+ assert(o.offset + o.num_words <= inst_.num_words);
+ return spvtools::utils::MakeString(words_.data() + o.offset, o.num_words);
+}
+
} // namespace val
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/instruction.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/instruction.h
index 617cb0660dd..6d1f9f4f127 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/instruction.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/instruction.h
@@ -133,6 +133,9 @@ bool operator<(const Instruction& lhs, uint32_t rhs);
bool operator==(const Instruction& lhs, const Instruction& rhs);
bool operator==(const Instruction& lhs, uint32_t rhs);
+template <>
+std::string Instruction::GetOperandAs<std::string>(size_t index) const;
+
} // namespace val
} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate.cpp
index 45b6a463e62..efb9225e6b7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate.cpp
@@ -202,13 +202,15 @@ spv_result_t ValidateBinaryUsingContextAndValidationState(
/* diagnostic = */ nullptr);
// Parse the module and perform inline validation checks. These checks do
- // not require the the knowledge of the whole module.
+ // not require the knowledge of the whole module.
if (auto error = spvBinaryParse(&context, vstate, words, num_words,
/*parsed_header =*/nullptr,
ProcessInstruction, pDiagnostic)) {
return error;
}
+ bool has_mask_task_nv = false;
+ bool has_mask_task_ext = false;
std::vector<Instruction*> visited_entry_points;
for (auto& instruction : vstate->ordered_instructions()) {
{
@@ -219,9 +221,7 @@ spv_result_t ValidateBinaryUsingContextAndValidationState(
if (inst->opcode() == SpvOpEntryPoint) {
const auto entry_point = inst->GetOperandAs<uint32_t>(1);
const auto execution_model = inst->GetOperandAs<SpvExecutionModel>(0);
- const char* str = reinterpret_cast<const char*>(
- inst->words().data() + inst->operand(2).offset);
- const std::string desc_name(str);
+ const std::string desc_name = inst->GetOperandAs<std::string>(2);
ValidationState_t::EntryPointDescription desc;
desc.name = desc_name;
@@ -237,9 +237,8 @@ spv_result_t ValidateBinaryUsingContextAndValidationState(
for (const Instruction* check_inst : visited_entry_points) {
const auto check_execution_model =
check_inst->GetOperandAs<SpvExecutionModel>(0);
- const char* check_str = reinterpret_cast<const char*>(
- check_inst->words().data() + inst->operand(2).offset);
- const std::string check_name(check_str);
+ const std::string check_name =
+ check_inst->GetOperandAs<std::string>(2);
if (desc_name == check_name &&
execution_model == check_execution_model) {
@@ -250,6 +249,11 @@ 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);
}
if (inst->opcode() == SpvOpFunctionCall) {
if (!vstate->in_function_body()) {
@@ -296,6 +300,17 @@ spv_result_t ValidateBinaryUsingContextAndValidationState(
return vstate->diag(SPV_ERROR_INVALID_LAYOUT, nullptr)
<< "Missing OpFunctionEnd at end of module.";
+ if (vstate->HasCapability(SpvCapabilityBindlessTextureNV) &&
+ !vstate->has_samplerimage_variable_address_mode_specified())
+ return vstate->diag(SPV_ERROR_INVALID_LAYOUT, nullptr)
+ << "Missing required OpSamplerImageAddressingModeNV instruction.";
+
+ if (has_mask_task_ext && has_mask_task_nv)
+ return vstate->diag(SPV_ERROR_INVALID_LAYOUT, nullptr)
+ << vstate->VkErrorID(7102)
+ << "Module can't mix MeshEXT/TaskEXT with MeshNV/TaskNV Execution "
+ "Model.";
+
// Catch undefined forward references before performing further checks.
if (auto error = ValidateForwardDecls(*vstate)) return error;
@@ -348,10 +363,13 @@ spv_result_t ValidateBinaryUsingContextAndValidationState(
if (auto error = NonUniformPass(*vstate, &instruction)) return error;
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 = MeshShadingPass(*vstate, &instruction)) return error;
}
// Validate the preconditions involving adjacent instructions. e.g. SpvOpPhi
- // must only be preceeded by SpvOpLabel, SpvOpPhi, or SpvOpLine.
+ // must only be preceded by SpvOpLabel, SpvOpPhi, or SpvOpLine.
if (auto error = ValidateAdjacency(*vstate)) return error;
if (auto error = ValidateEntryPoints(*vstate)) return error;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate.h
index 3fc183de88e..4b953ba3126 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate.h
@@ -70,7 +70,7 @@ spv_result_t CheckIdDefinitionDominateUse(ValidationState_t& _);
///
/// This function will iterate over all instructions and check for any required
/// predecessor and/or successor instructions. e.g. SpvOpPhi must only be
-/// preceeded by SpvOpLabel, SpvOpPhi, or SpvOpLine.
+/// preceded by SpvOpLabel, SpvOpPhi, or SpvOpLine.
///
/// @param[in] _ the validation state of the module
///
@@ -197,6 +197,15 @@ spv_result_t FunctionPass(ValidationState_t& _, const Instruction* inst);
/// Validates correctness of miscellaneous instructions.
spv_result_t MiscPass(ValidationState_t& _, const Instruction* inst);
+/// Validates correctness of ray query instructions.
+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 mesh shading instructions.
+spv_result_t MeshShadingPass(ValidationState_t& _, const Instruction* inst);
+
/// Calculates the reachability of basic blocks.
void ReachabilityPass(ValidationState_t& _);
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_annotation.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_annotation.cpp
index 85d2b7515ab..21f999b0983 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_annotation.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_annotation.cpp
@@ -22,164 +22,236 @@ namespace spvtools {
namespace val {
namespace {
-std::string LogStringForDecoration(uint32_t decoration) {
- switch (decoration) {
- case SpvDecorationRelaxedPrecision:
- return "RelaxedPrecision";
+// Returns true if the decoration takes ID parameters.
+// TODO(dneto): This can be generated from the grammar.
+bool DecorationTakesIdParameters(SpvDecoration type) {
+ switch (type) {
+ case SpvDecorationUniformId:
+ case SpvDecorationAlignmentId:
+ case SpvDecorationMaxByteOffsetId:
+ case SpvDecorationHlslCounterBufferGOOGLE:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+bool IsMemberDecorationOnly(SpvDecoration dec) {
+ switch (dec) {
+ case SpvDecorationRowMajor:
+ case SpvDecorationColMajor:
+ case SpvDecorationMatrixStride:
+ // SPIR-V spec bug? Offset is generated on variables when dealing with
+ // transform feedback.
+ // case SpvDecorationOffset:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
+bool IsNotMemberDecoration(SpvDecoration dec) {
+ switch (dec) {
case SpvDecorationSpecId:
- return "SpecId";
case SpvDecorationBlock:
- return "Block";
case SpvDecorationBufferBlock:
- return "BufferBlock";
- case SpvDecorationRowMajor:
- return "RowMajor";
- case SpvDecorationColMajor:
- return "ColMajor";
case SpvDecorationArrayStride:
- return "ArrayStride";
- case SpvDecorationMatrixStride:
- return "MatrixStride";
case SpvDecorationGLSLShared:
- return "GLSLShared";
case SpvDecorationGLSLPacked:
- return "GLSLPacked";
case SpvDecorationCPacked:
- return "CPacked";
- case SpvDecorationBuiltIn:
- return "BuiltIn";
- case SpvDecorationNoPerspective:
- return "NoPerspective";
- case SpvDecorationFlat:
- return "Flat";
- case SpvDecorationPatch:
- return "Patch";
- case SpvDecorationCentroid:
- return "Centroid";
- case SpvDecorationSample:
- return "Sample";
- case SpvDecorationInvariant:
- return "Invariant";
- case SpvDecorationRestrict:
- return "Restrict";
+ // TODO: https://github.com/KhronosGroup/glslang/issues/703:
+ // glslang applies Restrict to structure members.
+ // case SpvDecorationRestrict:
case SpvDecorationAliased:
- return "Aliased";
- case SpvDecorationVolatile:
- return "Volatile";
case SpvDecorationConstant:
- return "Constant";
- case SpvDecorationCoherent:
- return "Coherent";
- case SpvDecorationNonWritable:
- return "NonWritable";
- case SpvDecorationNonReadable:
- return "NonReadable";
case SpvDecorationUniform:
- return "Uniform";
+ case SpvDecorationUniformId:
case SpvDecorationSaturatedConversion:
- return "SaturatedConversion";
- case SpvDecorationStream:
- return "Stream";
- case SpvDecorationLocation:
- return "Location";
- case SpvDecorationComponent:
- return "Component";
case SpvDecorationIndex:
- return "Index";
case SpvDecorationBinding:
- return "Binding";
case SpvDecorationDescriptorSet:
- return "DescriptorSet";
- case SpvDecorationOffset:
- return "Offset";
- case SpvDecorationXfbBuffer:
- return "XfbBuffer";
- case SpvDecorationXfbStride:
- return "XfbStride";
case SpvDecorationFuncParamAttr:
- return "FuncParamAttr";
case SpvDecorationFPRoundingMode:
- return "FPRoundingMode";
case SpvDecorationFPFastMathMode:
- return "FPFastMathMode";
case SpvDecorationLinkageAttributes:
- return "LinkageAttributes";
case SpvDecorationNoContraction:
- return "NoContraction";
case SpvDecorationInputAttachmentIndex:
- return "InputAttachmentIndex";
case SpvDecorationAlignment:
- return "Alignment";
case SpvDecorationMaxByteOffset:
- return "MaxByteOffset";
case SpvDecorationAlignmentId:
- return "AlignmentId";
case SpvDecorationMaxByteOffsetId:
- return "MaxByteOffsetId";
case SpvDecorationNoSignedWrap:
- return "NoSignedWrap";
case SpvDecorationNoUnsignedWrap:
- return "NoUnsignedWrap";
- case SpvDecorationExplicitInterpAMD:
- return "ExplicitInterpAMD";
- case SpvDecorationOverrideCoverageNV:
- return "OverrideCoverageNV";
- case SpvDecorationPassthroughNV:
- return "PassthroughNV";
- case SpvDecorationViewportRelativeNV:
- return "ViewportRelativeNV";
- case SpvDecorationSecondaryViewportRelativeNV:
- return "SecondaryViewportRelativeNV";
- case SpvDecorationPerPrimitiveNV:
- return "PerPrimitiveNV";
- case SpvDecorationPerViewNV:
- return "PerViewNV";
- case SpvDecorationPerTaskNV:
- return "PerTaskNV";
- case SpvDecorationPerVertexNV:
- return "PerVertexNV";
- case SpvDecorationNonUniformEXT:
- return "NonUniformEXT";
- case SpvDecorationRestrictPointerEXT:
- return "RestrictPointerEXT";
- case SpvDecorationAliasedPointerEXT:
- return "AliasedPointerEXT";
- case SpvDecorationHlslCounterBufferGOOGLE:
- return "HlslCounterBufferGOOGLE";
- case SpvDecorationHlslSemanticGOOGLE:
- return "HlslSemanticGOOGLE";
+ case SpvDecorationNonUniform:
+ case SpvDecorationRestrictPointer:
+ case SpvDecorationAliasedPointer:
+ case SpvDecorationCounterBuffer:
+ return true;
default:
break;
}
- return "Unknown";
+ return false;
}
-// Returns true if the decoration takes ID parameters.
-// TODO(dneto): This can be generated from the grammar.
-bool DecorationTakesIdParameters(uint32_t type) {
- switch (static_cast<SpvDecoration>(type)) {
- case SpvDecorationUniformId:
- case SpvDecorationAlignmentId:
- case SpvDecorationMaxByteOffsetId:
- case SpvDecorationHlslCounterBufferGOOGLE:
- return true;
+spv_result_t ValidateDecorationTarget(ValidationState_t& _, SpvDecoration dec,
+ const Instruction* inst,
+ const Instruction* target) {
+ auto fail = [&_, dec, inst, target](uint32_t vuid) -> DiagnosticStream {
+ DiagnosticStream ds = std::move(
+ _.diag(SPV_ERROR_INVALID_ID, inst)
+ << _.VkErrorID(vuid) << _.SpvDecorationString(dec)
+ << " decoration on target <id> " << _.getIdName(target->id()) << " ");
+ return ds;
+ };
+ switch (dec) {
+ case SpvDecorationSpecId:
+ 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) {
+ return fail(0) << "must be a structure type";
+ }
+ break;
+ case SpvDecorationArrayStride:
+ if (target->opcode() != SpvOpTypeArray &&
+ target->opcode() != SpvOpTypeRuntimeArray &&
+ target->opcode() != SpvOpTypePointer) {
+ return fail(0) << "must be an array or pointer type";
+ }
+ break;
+ case SpvDecorationBuiltIn:
+ if (target->opcode() != SpvOpVariable &&
+ !spvOpcodeIsConstant(target->opcode())) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "BuiltIns can only target variables, structure members or "
+ "constants";
+ }
+ if (_.HasCapability(SpvCapabilityShader) &&
+ inst->GetOperandAs<SpvBuiltIn>(2) == SpvBuiltInWorkgroupSize) {
+ if (!spvOpcodeIsConstant(target->opcode())) {
+ return fail(0) << "must be a constant for WorkgroupSize";
+ }
+ } else if (target->opcode() != SpvOpVariable) {
+ 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) {
+ return fail(0) << "must be a memory object declaration";
+ }
+ if (_.GetIdOpcode(target->type_id()) != SpvOpTypePointer) {
+ 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) {
+ return fail(0) << "must be a variable";
+ }
+ break;
default:
break;
}
- return false;
+
+ if (spvIsVulkanEnv(_.context()->target_env)) {
+ // The following were all checked as pointer types above.
+ SpvStorageClass sc = SpvStorageClassUniform;
+ const auto type = _.FindDef(target->type_id());
+ if (type && type->operands().size() > 2) {
+ sc = type->GetOperandAs<SpvStorageClass>(1);
+ }
+ switch (dec) {
+ case SpvDecorationLocation:
+ case SpvDecorationComponent:
+ // 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) {
+ return _.diag(SPV_ERROR_INVALID_ID, target)
+ << _.VkErrorID(6672) << _.SpvDecorationString(dec)
+ << " decoration must not be applied to this storage class";
+ }
+ break;
+ case SpvDecorationIndex:
+ // Langauge from SPIR-V definition of Index
+ if (sc != SpvStorageClassOutput) {
+ return fail(0) << "must be in the Output storage class";
+ }
+ break;
+ case SpvDecorationBinding:
+ case SpvDecorationDescriptorSet:
+ if (sc != SpvStorageClassStorageBuffer &&
+ sc != SpvStorageClassUniform &&
+ sc != SpvStorageClassUniformConstant) {
+ return fail(6491) << "must be in the StorageBuffer, Uniform, or "
+ "UniformConstant storage class";
+ }
+ break;
+ case SpvDecorationInputAttachmentIndex:
+ if (sc != SpvStorageClassUniformConstant) {
+ return fail(6678) << "must be in the UniformConstant storage class";
+ }
+ break;
+ case SpvDecorationFlat:
+ case SpvDecorationNoPerspective:
+ case SpvDecorationCentroid:
+ case SpvDecorationSample:
+ if (sc != SpvStorageClassInput && sc != SpvStorageClassOutput) {
+ return fail(4670) << "storage class must be Input or Output";
+ }
+ break;
+ case SpvDecorationPerVertexKHR:
+ if (sc != SpvStorageClassInput) {
+ return fail(6777) << "storage class must be Input";
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ return SPV_SUCCESS;
}
spv_result_t ValidateDecorate(ValidationState_t& _, const Instruction* inst) {
- const auto decoration = inst->GetOperandAs<uint32_t>(1);
- if (decoration == SpvDecorationSpecId) {
- const auto target_id = inst->GetOperandAs<uint32_t>(0);
- const auto target = _.FindDef(target_id);
- if (!target || !spvOpcodeIsScalarSpecConstant(target->opcode())) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpDecorate SpecId decoration target <id> '"
- << _.getIdName(target_id)
- << "' is not a scalar specialization constant.";
- }
+ const auto decoration = inst->GetOperandAs<SpvDecoration>(1);
+ const auto target_id = inst->GetOperandAs<uint32_t>(0);
+ const auto target = _.FindDef(target_id);
+ if (!target) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst) << "target is not defined";
}
if (spvIsVulkanEnv(_.context()->target_env)) {
@@ -187,7 +259,7 @@ spv_result_t ValidateDecorate(ValidationState_t& _, const Instruction* inst) {
(decoration == SpvDecorationGLSLPacked)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< _.VkErrorID(4669) << "OpDecorate decoration '"
- << LogStringForDecoration(decoration)
+ << _.SpvDecorationString(decoration)
<< "' is not valid for the Vulkan execution environment.";
}
}
@@ -197,17 +269,34 @@ spv_result_t ValidateDecorate(ValidationState_t& _, const Instruction* inst) {
<< "Decorations taking ID parameters may not be used with "
"OpDecorateId";
}
+
+ if (target->opcode() != SpvOpDecorationGroup) {
+ if (IsMemberDecorationOnly(decoration)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << _.SpvDecorationString(decoration)
+ << " can only be applied to structure members";
+ }
+
+ if (auto error = ValidateDecorationTarget(_, decoration, inst, target)) {
+ return error;
+ }
+ }
+
// TODO: Add validations for all decorations.
return SPV_SUCCESS;
}
spv_result_t ValidateDecorateId(ValidationState_t& _, const Instruction* inst) {
- const auto decoration = inst->GetOperandAs<uint32_t>(1);
+ const auto decoration = inst->GetOperandAs<SpvDecoration>(1);
if (!DecorationTakesIdParameters(decoration)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Decorations that don't take ID parameters may not be used with "
"OpDecorateId";
}
+
+ // No member decorations take id parameters, so we don't bother checking if
+ // we are using a member only decoration here.
+
// TODO: Add validations for these decorations.
// UniformId is covered elsewhere.
return SPV_SUCCESS;
@@ -219,8 +308,8 @@ spv_result_t ValidateMemberDecorate(ValidationState_t& _,
const auto struct_type = _.FindDef(struct_type_id);
if (!struct_type || SpvOpTypeStruct != struct_type->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpMemberDecorate Structure type <id> '"
- << _.getIdName(struct_type_id) << "' is not a struct type.";
+ << "OpMemberDecorate Structure type <id> "
+ << _.getIdName(struct_type_id) << " is not a struct type.";
}
const auto member = inst->GetOperandAs<uint32_t>(1);
const auto member_count =
@@ -234,6 +323,13 @@ spv_result_t ValidateMemberDecorate(ValidationState_t& _,
<< " members. Largest valid index is " << member_count - 1 << ".";
}
+ const auto decoration = inst->GetOperandAs<SpvDecoration>(2);
+ if (IsNotMemberDecoration(decoration)) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << _.SpvDecorationString(decoration)
+ << " cannot be applied to structure members";
+ }
+
return SPV_SUCCESS;
}
@@ -262,17 +358,16 @@ spv_result_t ValidateGroupDecorate(ValidationState_t& _,
auto decoration_group = _.FindDef(decoration_group_id);
if (!decoration_group || SpvOpDecorationGroup != decoration_group->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpGroupDecorate Decoration group <id> '"
- << _.getIdName(decoration_group_id)
- << "' is not a decoration group.";
+ << "OpGroupDecorate Decoration group <id> "
+ << _.getIdName(decoration_group_id) << " is not a decoration group.";
}
for (unsigned i = 1; i < inst->operands().size(); ++i) {
auto target_id = inst->GetOperandAs<uint32_t>(i);
auto target = _.FindDef(target_id);
if (!target || target->opcode() == SpvOpDecorationGroup) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpGroupDecorate may not target OpDecorationGroup <id> '"
- << _.getIdName(target_id) << "'";
+ << "OpGroupDecorate may not target OpDecorationGroup <id> "
+ << _.getIdName(target_id);
}
}
return SPV_SUCCESS;
@@ -284,9 +379,8 @@ spv_result_t ValidateGroupMemberDecorate(ValidationState_t& _,
const auto decoration_group = _.FindDef(decoration_group_id);
if (!decoration_group || SpvOpDecorationGroup != decoration_group->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpGroupMemberDecorate Decoration group <id> '"
- << _.getIdName(decoration_group_id)
- << "' is not a decoration group.";
+ << "OpGroupMemberDecorate Decoration group <id> "
+ << _.getIdName(decoration_group_id) << " is not a decoration group.";
}
// Grammar checks ensures that the number of arguments to this instruction
// is an odd number: 1 decoration group + (id,literal) pairs.
@@ -296,8 +390,8 @@ spv_result_t ValidateGroupMemberDecorate(ValidationState_t& _,
auto struct_instr = _.FindDef(struct_id);
if (!struct_instr || SpvOpTypeStruct != struct_instr->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpGroupMemberDecorate Structure type <id> '"
- << _.getIdName(struct_id) << "' is not a struct type.";
+ << "OpGroupMemberDecorate Structure type <id> "
+ << _.getIdName(struct_id) << " is not a struct type.";
}
const uint32_t num_struct_members =
static_cast<uint32_t>(struct_instr->words().size() - 2);
@@ -353,7 +447,7 @@ spv_result_t RegisterDecorations(ValidationState_t& _,
// Word 1 is the group <id>. All subsequent words are target <id>s that
// are going to be decorated with the decorations.
const uint32_t decoration_group_id = inst->word(1);
- std::vector<Decoration>& group_decorations =
+ std::set<Decoration>& group_decorations =
_.id_decorations(decoration_group_id);
for (size_t i = 2; i < inst->words().size(); ++i) {
const uint32_t target_id = inst->word(i);
@@ -367,7 +461,7 @@ spv_result_t RegisterDecorations(ValidationState_t& _,
// pairs. All decorations of the group should be applied to all the struct
// members that are specified in the instructions.
const uint32_t decoration_group_id = inst->word(1);
- std::vector<Decoration>& group_decorations =
+ std::set<Decoration>& group_decorations =
_.id_decorations(decoration_group_id);
// Grammar checks ensures that the number of arguments to this instruction
// is an odd number: 1 decoration group + (id,literal) pairs.
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_arithmetics.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_arithmetics.cpp
index 433330d7437..bae9b5dcace 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_arithmetics.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_arithmetics.cpp
@@ -155,7 +155,7 @@ spv_result_t ArithmeticsPass(ValidationState_t& _, const Instruction* inst) {
first_vector_num_components = num_components;
} else if (num_components != first_vector_num_components) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected operands to have the same number of componenets: "
+ << "Expected operands to have the same number of components: "
<< spvOpcodeString(opcode);
}
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_atomics.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_atomics.cpp
index cfa15d9f729..bf565c310fe 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_atomics.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_atomics.cpp
@@ -39,7 +39,8 @@ bool IsStorageClassAllowedByUniversalRules(uint32_t storage_class) {
case SpvStorageClassAtomicCounter:
case SpvStorageClassImage:
case SpvStorageClassFunction:
- case SpvStorageClassPhysicalStorageBufferEXT:
+ case SpvStorageClassPhysicalStorageBuffer:
+ case SpvStorageClassTaskPayloadWorkgroupEXT:
return true;
break;
default:
@@ -206,12 +207,13 @@ spv_result_t AtomicsPass(ValidationState_t& _, const Instruction* inst) {
(storage_class != SpvStorageClassStorageBuffer) &&
(storage_class != SpvStorageClassWorkgroup) &&
(storage_class != SpvStorageClassImage) &&
- (storage_class != SpvStorageClassPhysicalStorageBuffer)) {
+ (storage_class != SpvStorageClassPhysicalStorageBuffer) &&
+ (storage_class != SpvStorageClassTaskPayloadWorkgroupEXT)) {
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, or "
- "PhysicalStorageBuffer.";
+ "be: Uniform, Workgroup, Image, StorageBuffer, "
+ "PhysicalStorageBuffer or TaskPayloadWorkgroupEXT.";
}
} else if (storage_class == SpvStorageClassFunction) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_barriers.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_barriers.cpp
index 3a9e3e7c56a..03225d86a82 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_barriers.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_barriers.cpp
@@ -50,7 +50,8 @@ spv_result_t BarriersPass(ValidationState_t& _, const Instruction* inst) {
*message =
"OpControlBarrier requires one of the following "
"Execution "
- "Models: TessellationControl, GLCompute or Kernel";
+ "Models: TessellationControl, GLCompute, Kernel, "
+ "MeshNV or TaskNV";
}
return false;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_bitwise.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_bitwise.cpp
index d46b3fcabb3..e6e97c4a5ad 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_bitwise.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_bitwise.cpp
@@ -14,16 +14,48 @@
// Validates correctness of bitwise 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 {
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();
+
+ if (!_.IsIntScalarType(base_type) && !_.IsIntVectorType(base_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << _.VkErrorID(4781)
+ << "Expected int scalar or vector type for Base operand: "
+ << spvOpcodeString(opcode);
+ }
+
+ // Vulkan has a restriction to 32 bit for base
+ if (spvIsVulkanEnv(_.context()->target_env)) {
+ if (_.GetBitWidth(base_type) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << _.VkErrorID(4781)
+ << "Expected 32-bit int type for Base operand: "
+ << spvOpcodeString(opcode);
+ }
+ }
+
+ // OpBitCount just needs same number of components
+ if (base_type != inst->type_id() && opcode != SpvOpBitCount) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Base Type to be equal to Result Type: "
+ << spvOpcodeString(opcode);
+ }
+
+ return SPV_SUCCESS;
+}
+
// Validates correctness of bitwise instructions.
spv_result_t BitwisePass(ValidationState_t& _, const Instruction* inst) {
const SpvOp opcode = inst->opcode();
@@ -109,20 +141,14 @@ spv_result_t BitwisePass(ValidationState_t& _, const Instruction* inst) {
}
case SpvOpBitFieldInsert: {
- if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type))
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected int scalar or vector type as Result Type: "
- << spvOpcodeString(opcode);
-
const uint32_t base_type = _.GetOperandTypeId(inst, 2);
const uint32_t insert_type = _.GetOperandTypeId(inst, 3);
const uint32_t offset_type = _.GetOperandTypeId(inst, 4);
const uint32_t count_type = _.GetOperandTypeId(inst, 5);
- if (base_type != result_type)
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Base Type to be equal to Result Type: "
- << spvOpcodeString(opcode);
+ if (spv_result_t error = ValidateBaseType(_, inst, base_type)) {
+ return error;
+ }
if (insert_type != result_type)
return _.diag(SPV_ERROR_INVALID_DATA, inst)
@@ -143,19 +169,13 @@ spv_result_t BitwisePass(ValidationState_t& _, const Instruction* inst) {
case SpvOpBitFieldSExtract:
case SpvOpBitFieldUExtract: {
- if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type))
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected int scalar or vector type as Result Type: "
- << spvOpcodeString(opcode);
-
const uint32_t base_type = _.GetOperandTypeId(inst, 2);
const uint32_t offset_type = _.GetOperandTypeId(inst, 3);
const uint32_t count_type = _.GetOperandTypeId(inst, 4);
- if (base_type != result_type)
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Base Type to be equal to Result Type: "
- << spvOpcodeString(opcode);
+ if (spv_result_t error = ValidateBaseType(_, inst, base_type)) {
+ return error;
+ }
if (!offset_type || !_.IsIntScalarType(offset_type))
return _.diag(SPV_ERROR_INVALID_DATA, inst)
@@ -170,17 +190,12 @@ spv_result_t BitwisePass(ValidationState_t& _, const Instruction* inst) {
}
case SpvOpBitReverse: {
- if (!_.IsIntScalarType(result_type) && !_.IsIntVectorType(result_type))
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected int scalar or vector type as Result Type: "
- << spvOpcodeString(opcode);
-
const uint32_t base_type = _.GetOperandTypeId(inst, 2);
- if (base_type != result_type)
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Base Type to be equal to Result Type: "
- << spvOpcodeString(opcode);
+ if (spv_result_t error = ValidateBaseType(_, inst, base_type)) {
+ return error;
+ }
+
break;
}
@@ -191,15 +206,13 @@ spv_result_t BitwisePass(ValidationState_t& _, const Instruction* inst) {
<< spvOpcodeString(opcode);
const uint32_t base_type = _.GetOperandTypeId(inst, 2);
- if (!base_type ||
- (!_.IsIntScalarType(base_type) && !_.IsIntVectorType(base_type)))
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Base Type to be int scalar or vector: "
- << spvOpcodeString(opcode);
-
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;
+ }
+
if (base_dimension != result_dimension)
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Expected Base dimension to be equal to Result Type "
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_builtins.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_builtins.cpp
index a6e624f7484..6f4b0f9c33a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_builtins.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_builtins.cpp
@@ -120,7 +120,7 @@ typedef enum VUIDError_ {
VUIDErrorMax,
} VUIDError;
-const static uint32_t NumVUIDBuiltins = 33;
+const static uint32_t NumVUIDBuiltins = 36;
typedef struct {
SpvBuiltIn builtIn;
@@ -162,6 +162,9 @@ std::array<BuiltinVUIDMapping, NumVUIDBuiltins> builtinVUIDInfo = {{
{SpvBuiltInFragSizeEXT, {4220, 4221, 4222}},
{SpvBuiltInFragStencilRefEXT, {4223, 4224, 4225}},
{SpvBuiltInFullyCoveredEXT, {4232, 4233, 4234}},
+ {SpvBuiltInCullMaskKHR, {6735, 6736, 6737}},
+ {SpvBuiltInBaryCoordKHR, {4154, 4155, 4156}},
+ {SpvBuiltInBaryCoordNoPerspKHR, {4160, 4161, 4162}},
// clang-format off
} };
@@ -208,6 +211,7 @@ bool IsExecutionModelValidForRtBuiltIn(SpvBuiltIn builtin,
case SpvBuiltInRayTmaxKHR:
case SpvBuiltInWorldRayDirectionKHR:
case SpvBuiltInWorldRayOriginKHR:
+ case SpvBuiltInCullMaskKHR:
switch (stage) {
case SpvExecutionModelIntersectionKHR:
case SpvExecutionModelAnyHitKHR:
@@ -329,9 +333,11 @@ class BuiltInsValidator {
// Used for GlobalInvocationId, LocalInvocationId, NumWorkgroups, WorkgroupId.
spv_result_t ValidateComputeShaderI32Vec3InputAtDefinition(
const Decoration& decoration, const Instruction& inst);
- spv_result_t ValidateSMBuiltinsAtDefinition(const Decoration& decoration,
+ spv_result_t ValidateNVSMOrARMCoreBuiltinsAtDefinition(const Decoration& decoration,
const Instruction& inst);
-
+ // Used for BaryCoord, BaryCoordNoPersp.
+ spv_result_t ValidateFragmentShaderF32Vec3InputAtDefinition(
+ const Decoration& decoration, const Instruction& inst);
// Used for SubgroupEqMask, SubgroupGeMask, SubgroupGtMask, SubgroupLtMask,
// SubgroupLeMask.
spv_result_t ValidateI32Vec4InputAtDefinition(const Decoration& decoration,
@@ -509,13 +515,20 @@ class BuiltInsValidator {
const Decoration& decoration, const Instruction& built_in_inst,
const Instruction& referenced_inst,
const Instruction& referenced_from_inst);
+
+ // Used for BaryCoord, BaryCoordNoPersp.
+ spv_result_t ValidateFragmentShaderF32Vec3InputAtReference(
+ const Decoration& decoration, const Instruction& built_in_inst,
+ const Instruction& referenced_inst,
+ const Instruction& referenced_from_inst);
+
// Used for SubgroupId and NumSubgroups.
spv_result_t ValidateComputeI32InputAtReference(
const Decoration& decoration, const Instruction& built_in_inst,
const Instruction& referenced_inst,
const Instruction& referenced_from_inst);
- spv_result_t ValidateSMBuiltinsAtReference(
+ spv_result_t ValidateNVSMOrARMCoreBuiltinsAtReference(
const Decoration& decoration, const Instruction& built_in_inst,
const Instruction& referenced_inst,
const Instruction& referenced_from_inst);
@@ -1166,9 +1179,16 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference(
&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.",
+ "MeshNV.",
SpvExecutionModelMeshNV, 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,
+ referenced_from_inst, std::placeholders::_1));
}
if (storage_class == SpvStorageClassOutput) {
@@ -1211,7 +1231,8 @@ spv_result_t BuiltInsValidator::ValidateClipOrCullDistanceAtReference(
case SpvExecutionModelTessellationControl:
case SpvExecutionModelTessellationEvaluation:
case SpvExecutionModelGeometry:
- case SpvExecutionModelMeshNV: {
+ case SpvExecutionModelMeshNV:
+ case SpvExecutionModelMeshEXT: {
if (decoration.struct_member_index() != Decoration::kInvalidMember) {
// The outer level of array is applied on the variable.
if (spv_result_t error = ValidateF32Arr(
@@ -1843,7 +1864,8 @@ spv_result_t BuiltInsValidator::ValidatePointSizeAtReference(
case SpvExecutionModelTessellationControl:
case SpvExecutionModelTessellationEvaluation:
case SpvExecutionModelGeometry:
- case SpvExecutionModelMeshNV: {
+ case SpvExecutionModelMeshNV:
+ case SpvExecutionModelMeshEXT: {
// 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.
@@ -1944,6 +1966,13 @@ spv_result_t BuiltInsValidator::ValidatePositionAtReference(
"with Input storage class if execution model is MeshNV.",
SpvExecutionModelMeshNV, 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,
+ referenced_from_inst, std::placeholders::_1));
}
for (const SpvExecutionModel execution_model : execution_models_) {
@@ -1967,7 +1996,8 @@ spv_result_t BuiltInsValidator::ValidatePositionAtReference(
case SpvExecutionModelGeometry:
case SpvExecutionModelTessellationControl:
case SpvExecutionModelTessellationEvaluation:
- case SpvExecutionModelMeshNV: {
+ case SpvExecutionModelMeshNV:
+ case SpvExecutionModelMeshEXT: {
// 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
@@ -2138,6 +2168,7 @@ spv_result_t BuiltInsValidator::ValidatePrimitiveIdAtReference(
case SpvExecutionModelTessellationEvaluation:
case SpvExecutionModelGeometry:
case SpvExecutionModelMeshNV:
+ case SpvExecutionModelMeshEXT:
case SpvExecutionModelIntersectionKHR:
case SpvExecutionModelAnyHitKHR:
case SpvExecutionModelClosestHitKHR: {
@@ -2150,9 +2181,8 @@ spv_result_t BuiltInsValidator::ValidatePrimitiveIdAtReference(
<< _.VkErrorID(4330)
<< "Vulkan spec allows BuiltIn PrimitiveId to be used only "
"with Fragment, TessellationControl, "
- "TessellationEvaluation, Geometry, MeshNV, "
- "IntersectionKHR, "
- "AnyHitKHR, and ClosestHitKHR execution models. "
+ "TessellationEvaluation, Geometry, MeshNV, MeshEXT, "
+ "IntersectionKHR, AnyHitKHR, and ClosestHitKHR execution models. "
<< GetReferenceDesc(decoration, built_in_inst, referenced_inst,
referenced_from_inst, execution_model);
}
@@ -2700,7 +2730,8 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference(
assert(function_id_ == 0);
for (const auto em :
{SpvExecutionModelVertex, SpvExecutionModelTessellationEvaluation,
- SpvExecutionModelGeometry, SpvExecutionModelMeshNV}) {
+ SpvExecutionModelGeometry, SpvExecutionModelMeshNV,
+ SpvExecutionModelMeshEXT}) {
id_to_at_reference_checks_[referenced_from_inst.id()].push_back(
std::bind(&BuiltInsValidator::ValidateNotCalledWithExecutionModel,
this, ((operand == SpvBuiltInLayer) ? 4274 : 4406),
@@ -2708,7 +2739,7 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference(
"ViewportIndex to be "
"used for variables with Input storage class if "
"execution model is Vertex, TessellationEvaluation, "
- "Geometry, or MeshNV.",
+ "Geometry, MeshNV or MeshEXT.",
em, decoration, built_in_inst, referenced_from_inst,
std::placeholders::_1));
}
@@ -2733,6 +2764,7 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference(
case SpvExecutionModelGeometry:
case SpvExecutionModelFragment:
case SpvExecutionModelMeshNV:
+ case SpvExecutionModelMeshEXT:
// Ok.
break;
case SpvExecutionModelVertex:
@@ -2788,6 +2820,80 @@ spv_result_t BuiltInsValidator::ValidateLayerOrViewportIndexAtReference(
return SPV_SUCCESS;
}
+spv_result_t BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtDefinition(
+ const Decoration& decoration, const Instruction& inst) {
+ if (spvIsVulkanEnv(_.context()->target_env)) {
+ const SpvBuiltIn builtin = SpvBuiltIn(decoration.params()[0]);
+ if (spv_result_t error = ValidateF32Vec(
+ decoration, inst, 3,
+ [this, &inst, builtin](const std::string& message) -> spv_result_t {
+ uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorType);
+ return _.diag(SPV_ERROR_INVALID_DATA, &inst)
+ << _.VkErrorID(vuid) << "According to the "
+ << spvLogStringForEnv(_.context()->target_env)
+ << " spec BuiltIn "
+ << _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
+ builtin)
+ << " variable needs to be a 3-component 32-bit float "
+ "vector. "
+ << message;
+ })) {
+ return error;
+ }
+ }
+
+ // Seed at reference checks with this built-in.
+ return ValidateFragmentShaderF32Vec3InputAtReference(decoration, inst, inst,
+ inst);
+}
+
+spv_result_t BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtReference(
+ const Decoration& decoration, const Instruction& built_in_inst,
+ 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) {
+ 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)
+ << " 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) {
+ 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)
+ << " to be used only with Fragment execution model. "
+ << GetReferenceDesc(decoration, built_in_inst, referenced_inst,
+ referenced_from_inst, execution_model);
+ }
+ }
+ }
+
+ if (function_id_ == 0) {
+ // Propagate this rule to all dependant ids in the global scope.
+ id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
+ &BuiltInsValidator::ValidateFragmentShaderF32Vec3InputAtReference, this,
+ decoration, built_in_inst, referenced_from_inst,
+ std::placeholders::_1));
+ }
+
+ return SPV_SUCCESS;
+}
+
spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtDefinition(
const Decoration& decoration, const Instruction& inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
@@ -2838,7 +2944,10 @@ spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtReference(
for (const SpvExecutionModel execution_model : execution_models_) {
bool has_vulkan_model = execution_model == SpvExecutionModelGLCompute ||
execution_model == SpvExecutionModelTaskNV ||
- execution_model == SpvExecutionModelMeshNV;
+ execution_model == SpvExecutionModelMeshNV ||
+ execution_model == SpvExecutionModelTaskEXT ||
+ execution_model == SpvExecutionModelMeshEXT;
+
if (spvIsVulkanEnv(_.context()->target_env) && !has_vulkan_model) {
uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorExecutionModel);
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
@@ -2846,7 +2955,8 @@ spv_result_t BuiltInsValidator::ValidateComputeShaderI32Vec3InputAtReference(
<< spvLogStringForEnv(_.context()->target_env)
<< " spec allows BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin)
- << " to be used only with GLCompute, MeshNV, or TaskNV execution model. "
+ << " to be used only with GLCompute, MeshNV, TaskNV, MeshEXT or"
+ << " TaskEXT execution model. "
<< GetReferenceDesc(decoration, built_in_inst, referenced_inst,
referenced_from_inst, execution_model);
}
@@ -2920,7 +3030,9 @@ spv_result_t BuiltInsValidator::ValidateComputeI32InputAtReference(
for (const SpvExecutionModel execution_model : execution_models_) {
bool has_vulkan_model = execution_model == SpvExecutionModelGLCompute ||
execution_model == SpvExecutionModelTaskNV ||
- execution_model == SpvExecutionModelMeshNV;
+ execution_model == SpvExecutionModelMeshNV ||
+ execution_model == SpvExecutionModelTaskEXT ||
+ execution_model == SpvExecutionModelMeshEXT;
if (spvIsVulkanEnv(_.context()->target_env) && !has_vulkan_model) {
uint32_t vuid = GetVUIDForBuiltin(builtin, VUIDErrorExecutionModel);
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
@@ -2928,7 +3040,8 @@ spv_result_t BuiltInsValidator::ValidateComputeI32InputAtReference(
<< spvLogStringForEnv(_.context()->target_env)
<< " spec allows BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN, builtin)
- << " to be used only with GLCompute, MeshNV, or TaskNV execution model. "
+ << " to be used only with GLCompute, MeshNV, TaskNV, MeshEXT or "
+ << "TaskEXT execution model. "
<< GetReferenceDesc(decoration, built_in_inst, referenced_inst,
referenced_from_inst, execution_model);
}
@@ -3072,14 +3185,17 @@ spv_result_t BuiltInsValidator::ValidateWorkgroupSizeAtReference(
for (const SpvExecutionModel execution_model : execution_models_) {
if (execution_model != SpvExecutionModelGLCompute &&
execution_model != SpvExecutionModelTaskNV &&
- execution_model != SpvExecutionModelMeshNV) {
+ execution_model != SpvExecutionModelMeshNV &&
+ execution_model != SpvExecutionModelTaskEXT &&
+ execution_model != SpvExecutionModelMeshEXT) {
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
<< _.VkErrorID(4425)
<< spvLogStringForEnv(_.context()->target_env)
<< " spec allows BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
decoration.params()[0])
- << " to be used only with GLCompute, MeshNV, or TaskNV execution model. "
+ << " to be used only with GLCompute, MeshNV, TaskNV, MeshEXT or "
+ << "TaskEXT execution model. "
<< GetReferenceDesc(decoration, built_in_inst, referenced_inst,
referenced_from_inst, execution_model);
}
@@ -3210,12 +3326,15 @@ spv_result_t BuiltInsValidator::ValidateDrawIndexAtReference(
for (const SpvExecutionModel execution_model : execution_models_) {
if (execution_model != SpvExecutionModelVertex &&
execution_model != SpvExecutionModelMeshNV &&
- execution_model != SpvExecutionModelTaskNV) {
+ execution_model != SpvExecutionModelTaskNV &&
+ execution_model != SpvExecutionModelMeshEXT &&
+ execution_model != SpvExecutionModelTaskEXT) {
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
<< _.VkErrorID(4207) << "Vulkan spec allows BuiltIn "
<< _.grammar().lookupOperandName(SPV_OPERAND_TYPE_BUILT_IN,
operand)
- << " to be used only with Vertex, MeshNV, or TaskNV execution "
+ << " to be used only with Vertex, MeshNV, TaskNV , MeshEXT or"
+ << " TaskEXT execution "
"model. "
<< GetReferenceDesc(decoration, built_in_inst, referenced_inst,
referenced_from_inst, execution_model);
@@ -3630,7 +3749,7 @@ spv_result_t BuiltInsValidator::ValidateFullyCoveredAtReference(
return SPV_SUCCESS;
}
-spv_result_t BuiltInsValidator::ValidateSMBuiltinsAtDefinition(
+spv_result_t BuiltInsValidator::ValidateNVSMOrARMCoreBuiltinsAtDefinition(
const Decoration& decoration, const Instruction& inst) {
if (spvIsVulkanEnv(_.context()->target_env)) {
if (spv_result_t error = ValidateI32(
@@ -3651,10 +3770,10 @@ spv_result_t BuiltInsValidator::ValidateSMBuiltinsAtDefinition(
}
// Seed at reference checks with this built-in.
- return ValidateSMBuiltinsAtReference(decoration, inst, inst, inst);
+ return ValidateNVSMOrARMCoreBuiltinsAtReference(decoration, inst, inst, inst);
}
-spv_result_t BuiltInsValidator::ValidateSMBuiltinsAtReference(
+spv_result_t BuiltInsValidator::ValidateNVSMOrARMCoreBuiltinsAtReference(
const Decoration& decoration, const Instruction& built_in_inst,
const Instruction& referenced_inst,
const Instruction& referenced_from_inst) {
@@ -3678,7 +3797,7 @@ spv_result_t BuiltInsValidator::ValidateSMBuiltinsAtReference(
if (function_id_ == 0) {
// Propagate this rule to all dependant ids in the global scope.
id_to_at_reference_checks_[referenced_from_inst.id()].push_back(std::bind(
- &BuiltInsValidator::ValidateSMBuiltinsAtReference, this, decoration,
+ &BuiltInsValidator::ValidateNVSMOrARMCoreBuiltinsAtReference, this, decoration,
built_in_inst, referenced_from_inst, std::placeholders::_1));
}
@@ -3731,6 +3850,7 @@ spv_result_t BuiltInsValidator::ValidatePrimitiveShadingRateAtReference(
case SpvExecutionModelVertex:
case SpvExecutionModelGeometry:
case SpvExecutionModelMeshNV:
+ case SpvExecutionModelMeshEXT:
break;
default: {
return _.diag(SPV_ERROR_INVALID_DATA, &referenced_from_inst)
@@ -3851,6 +3971,7 @@ spv_result_t BuiltInsValidator::ValidateRayTracingBuiltinsAtDefinition(
case SpvBuiltInInstanceId:
case SpvBuiltInRayGeometryIndexKHR:
case SpvBuiltInIncomingRayFlagsKHR:
+ case SpvBuiltInCullMaskKHR:
// i32 scalar
if (spv_result_t error = ValidateI32(
decoration, inst,
@@ -3993,14 +4114,6 @@ spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition(
const Decoration& decoration, const Instruction& inst) {
const SpvBuiltIn label = SpvBuiltIn(decoration.params()[0]);
- // Builtins can only be applied to variables, structures or constants.
- auto target_opcode = inst.opcode();
- if (target_opcode != SpvOpTypeStruct && target_opcode != SpvOpVariable &&
- !spvOpcodeIsConstant(target_opcode)) {
- return _.diag(SPV_ERROR_INVALID_DATA, &inst)
- << "BuiltIns can only target variables, structs or constants";
- }
-
if (!spvIsVulkanEnv(_.context()->target_env)) {
// Early return. All currently implemented rules are based on Vulkan spec.
//
@@ -4035,6 +4148,10 @@ spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition(
case SpvBuiltInWorkgroupId: {
return ValidateComputeShaderI32Vec3InputAtDefinition(decoration, inst);
}
+ case SpvBuiltInBaryCoordKHR:
+ case SpvBuiltInBaryCoordNoPerspKHR: {
+ return ValidateFragmentShaderF32Vec3InputAtDefinition(decoration, inst);
+ }
case SpvBuiltInHelperInvocation: {
return ValidateHelperInvocationAtDefinition(decoration, inst);
}
@@ -4108,11 +4225,16 @@ spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition(
case SpvBuiltInLocalInvocationIndex: {
return ValidateLocalInvocationIndexAtDefinition(decoration, inst);
}
+ case SpvBuiltInCoreIDARM:
+ case SpvBuiltInCoreCountARM:
+ case SpvBuiltInCoreMaxIDARM:
+ case SpvBuiltInWarpIDARM:
+ case SpvBuiltInWarpMaxIDARM:
case SpvBuiltInWarpsPerSMNV:
case SpvBuiltInSMCountNV:
case SpvBuiltInWarpIDNV:
case SpvBuiltInSMIDNV: {
- return ValidateSMBuiltinsAtDefinition(decoration, inst);
+ return ValidateNVSMOrARMCoreBuiltinsAtDefinition(decoration, inst);
}
case SpvBuiltInBaseInstance:
case SpvBuiltInBaseVertex: {
@@ -4159,49 +4281,19 @@ spv_result_t BuiltInsValidator::ValidateSingleBuiltInAtDefinition(
case SpvBuiltInObjectToWorldKHR: // alias SpvBuiltInObjectToWorldNV
case SpvBuiltInWorldToObjectKHR: // alias SpvBuiltInWorldToObjectNV
case SpvBuiltInIncomingRayFlagsKHR: // alias SpvBuiltInIncomingRayFlagsNV
- case SpvBuiltInRayGeometryIndexKHR: { // NOT present in NV
+ case SpvBuiltInRayGeometryIndexKHR: // NOT present in NV
+ case SpvBuiltInCullMaskKHR: {
return ValidateRayTracingBuiltinsAtDefinition(decoration, inst);
}
- case SpvBuiltInWorkDim:
- case SpvBuiltInGlobalSize:
- case SpvBuiltInEnqueuedWorkgroupSize:
- case SpvBuiltInGlobalOffset:
- case SpvBuiltInGlobalLinearId:
- case SpvBuiltInSubgroupMaxSize:
- case SpvBuiltInNumEnqueuedSubgroups:
- case SpvBuiltInBaryCoordNoPerspAMD:
- case SpvBuiltInBaryCoordNoPerspCentroidAMD:
- case SpvBuiltInBaryCoordNoPerspSampleAMD:
- case SpvBuiltInBaryCoordSmoothAMD:
- case SpvBuiltInBaryCoordSmoothCentroidAMD:
- case SpvBuiltInBaryCoordSmoothSampleAMD:
- case SpvBuiltInBaryCoordPullModelAMD:
- case SpvBuiltInViewportMaskNV:
- case SpvBuiltInSecondaryPositionNV:
- case SpvBuiltInSecondaryViewportMaskNV:
- case SpvBuiltInPositionPerViewNV:
- case SpvBuiltInViewportMaskPerViewNV:
- case SpvBuiltInMax:
- case SpvBuiltInTaskCountNV:
- case SpvBuiltInPrimitiveCountNV:
- case SpvBuiltInPrimitiveIndicesNV:
- case SpvBuiltInClipDistancePerViewNV:
- case SpvBuiltInCullDistancePerViewNV:
- case SpvBuiltInLayerPerViewNV:
- case SpvBuiltInMeshViewCountNV:
- case SpvBuiltInMeshViewIndicesNV:
- case SpvBuiltInBaryCoordNV:
- case SpvBuiltInBaryCoordNoPerspNV:
- case SpvBuiltInCurrentRayTimeNV:
- // No validation rules (for the moment).
- break;
-
case SpvBuiltInPrimitiveShadingRateKHR: {
return ValidatePrimitiveShadingRateAtDefinition(decoration, inst);
}
case SpvBuiltInShadingRateKHR: {
return ValidateShadingRateAtDefinition(decoration, inst);
}
+ default:
+ // No validation rules (for the moment).
+ break;
}
return SPV_SUCCESS;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp
index f08ab19f53e..cc0b999f263 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_cfg.cpp
@@ -27,6 +27,7 @@
#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"
@@ -54,8 +55,7 @@ spv_result_t ValidatePhi(ValidationState_t& _, const Instruction* inst) {
}
if (_.IsPointerType(inst->type_id()) &&
_.addressing_model() == SpvAddressingModelLogical) {
- if (!_.features().variable_pointers &&
- !_.features().variable_pointers_storage_buffer) {
+ if (!_.features().variable_pointers) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Using pointers with OpPhi requires capability "
<< "VariablePointers or VariablePointersStorageBuffer";
@@ -66,7 +66,8 @@ spv_result_t ValidatePhi(ValidationState_t& _, const Instruction* inst) {
assert(type_inst);
const SpvOp type_opcode = type_inst->opcode();
- if (!_.options()->before_hlsl_legalization) {
+ if (!_.options()->before_hlsl_legalization &&
+ !_.HasCapability(SpvCapabilityBindlessTextureNV)) {
if (type_opcode == SpvOpTypeSampledImage ||
(_.HasCapability(SpvCapabilityShader) &&
(type_opcode == SpvOpTypeImage || type_opcode == SpvOpTypeSampler))) {
@@ -191,6 +192,12 @@ spv_result_t ValidateBranchConditional(ValidationState_t& _,
"ID of an OpLabel instruction";
}
+ if (_.version() >= SPV_SPIRV_VERSION_WORD(1, 6) && true_id == false_id) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "In SPIR-V 1.6 or later, True Label and False Label must be "
+ "different labels";
+ }
+
return SPV_SUCCESS;
}
@@ -232,27 +239,23 @@ spv_result_t ValidateReturnValue(ValidationState_t& _,
const auto value = _.FindDef(value_id);
if (!value || !value->type_id()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpReturnValue Value <id> '" << _.getIdName(value_id)
- << "' does not represent a value.";
+ << "OpReturnValue Value <id> " << _.getIdName(value_id)
+ << " does not represent a value.";
}
auto value_type = _.FindDef(value->type_id());
if (!value_type || SpvOpTypeVoid == value_type->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpReturnValue value's type <id> '"
- << _.getIdName(value->type_id()) << "' is missing or void.";
+ << "OpReturnValue value's type <id> "
+ << _.getIdName(value->type_id()) << " is missing or void.";
}
- const bool uses_variable_pointer =
- _.features().variable_pointers ||
- _.features().variable_pointers_storage_buffer;
-
if (_.addressing_model() == SpvAddressingModelLogical &&
- SpvOpTypePointer == value_type->opcode() && !uses_variable_pointer &&
- !_.options()->relax_logical_pointer) {
+ SpvOpTypePointer == value_type->opcode() &&
+ !_.features().variable_pointers && !_.options()->relax_logical_pointer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpReturnValue value's type <id> '"
+ << "OpReturnValue value's type <id> "
<< _.getIdName(value->type_id())
- << "' is a pointer, which is invalid in the Logical addressing "
+ << " is a pointer, which is invalid in the Logical addressing "
"model.";
}
@@ -260,8 +263,8 @@ spv_result_t ValidateReturnValue(ValidationState_t& _,
const auto return_type = _.FindDef(function->GetResultTypeId());
if (!return_type || return_type->id() != value_type->id()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpReturnValue Value <id> '" << _.getIdName(value_id)
- << "'s type does not match OpFunction's return type.";
+ << "OpReturnValue Value <id> " << _.getIdName(value_id)
+ << "s type does not match OpFunction's return type.";
}
return SPV_SUCCESS;
@@ -464,7 +467,7 @@ spv_result_t FindCaseFallThrough(
std::vector<BasicBlock*> stack;
stack.push_back(target_block);
std::unordered_set<const BasicBlock*> visited;
- bool target_reachable = target_block->reachable();
+ bool target_reachable = target_block->structurally_reachable();
int target_depth = function->GetBlockDepth(target_block);
while (!stack.empty()) {
auto block = stack.back();
@@ -474,8 +477,8 @@ spv_result_t FindCaseFallThrough(
if (!visited.insert(block).second) continue;
- if (target_reachable && block->reachable() &&
- target_block->dominates(*block)) {
+ if (target_reachable && block->structurally_reachable() &&
+ target_block->structurally_dominates(*block)) {
// Still in the case construct.
for (auto successor : *block->successors()) {
stack.push_back(successor);
@@ -547,11 +550,12 @@ spv_result_t StructuredSwitchChecks(ValidationState_t& _, Function* function,
if (seen_iter == seen_to_fall_through.end()) {
const auto target_block = function->GetBlock(target).first;
// OpSwitch must dominate all its case constructs.
- if (header->reachable() && target_block->reachable() &&
- !header->dominates(*target_block)) {
+ if (header->structurally_reachable() &&
+ target_block->structurally_reachable() &&
+ !header->structurally_dominates(*target_block)) {
return _.diag(SPV_ERROR_INVALID_CFG, header->label())
<< "Selection header " << _.getIdName(header->id())
- << " does not dominate its case construct "
+ << " does not structurally dominate its case construct "
<< _.getIdName(target);
}
@@ -651,7 +655,7 @@ spv_result_t ValidateStructuredSelections(
}
// Skip unreachable blocks.
- if (!block->reachable()) continue;
+ if (!block->structurally_reachable()) continue;
if (terminator->opcode() == SpvOpBranchConditional) {
const auto true_label = terminator->GetOperandAs<uint32_t>(1);
@@ -659,16 +663,16 @@ spv_result_t ValidateStructuredSelections(
// Mark the upcoming blocks as seen now, but only error out if this block
// was missing a merge instruction and both labels hadn't been seen
// previously.
- const bool both_unseen =
- seen.insert(true_label).second && seen.insert(false_label).second;
- if (!merge && both_unseen) {
+ 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) {
return _.diag(SPV_ERROR_INVALID_CFG, terminator)
<< "Selection must be structured";
}
} else if (terminator->opcode() == SpvOpSwitch) {
if (!merge) {
return _.diag(SPV_ERROR_INVALID_CFG, terminator)
- << "OpSwitch must be preceeded by an OpSelectionMerge "
+ << "OpSwitch must be preceded by an OpSelectionMerge "
"instruction";
}
// Mark the targets as seen.
@@ -706,7 +710,7 @@ spv_result_t StructuredControlFlowChecks(
// Check the loop headers have exactly one back-edge branching to it
for (BasicBlock* loop_header : function->ordered_blocks()) {
- if (!loop_header->reachable()) continue;
+ if (!loop_header->structurally_reachable()) continue;
if (!loop_header->is_type(kBlockTypeLoop)) continue;
auto loop_header_id = loop_header->id();
auto num_latch_blocks = loop_latch_blocks[loop_header_id].size();
@@ -721,9 +725,10 @@ spv_result_t StructuredControlFlowChecks(
// Check construct rules
for (const Construct& construct : function->constructs()) {
auto header = construct.entry_block();
+ if (!header->structurally_reachable()) continue;
auto merge = construct.exit_block();
- if (header->reachable() && !merge) {
+ if (!merge) {
std::string construct_name, header_name, exit_name;
std::tie(construct_name, header_name, exit_name) =
ConstructNames(construct.type());
@@ -733,32 +738,31 @@ spv_result_t StructuredControlFlowChecks(
exit_name + ". This may be a bug in the validator.";
}
- // If the exit block is reachable then it's dominated by the
- // header.
- if (merge && merge->reachable()) {
- if (!header->dominates(*merge)) {
- return _.diag(SPV_ERROR_INVALID_CFG, _.FindDef(merge->id()))
- << ConstructErrorString(construct, _.getIdName(header->id()),
- _.getIdName(merge->id()),
- "does not dominate");
- }
- // If it's really a merge block for a selection or loop, then it must be
- // *strictly* dominated by the header.
- if (construct.ExitBlockIsMergeBlock() && (header == merge)) {
- return _.diag(SPV_ERROR_INVALID_CFG, _.FindDef(merge->id()))
- << ConstructErrorString(construct, _.getIdName(header->id()),
- _.getIdName(merge->id()),
- "does not strictly dominate");
- }
+ // If the header is reachable, the merge is guaranteed to be structurally
+ // reachable.
+ if (!header->structurally_dominates(*merge)) {
+ return _.diag(SPV_ERROR_INVALID_CFG, _.FindDef(merge->id()))
+ << ConstructErrorString(construct, _.getIdName(header->id()),
+ _.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)) {
+ return _.diag(SPV_ERROR_INVALID_CFG, _.FindDef(merge->id()))
+ << ConstructErrorString(construct, _.getIdName(header->id()),
+ _.getIdName(merge->id()),
+ "does not strictly structurally dominate");
+ }
+
// Check post-dominance for continue constructs. But dominance and
// post-dominance only make sense when the construct is reachable.
- if (header->reachable() && construct.type() == ConstructType::kContinue) {
- if (!merge->postdominates(*header)) {
+ if (construct.type() == ConstructType::kContinue) {
+ if (!merge->structurally_postdominates(*header)) {
return _.diag(SPV_ERROR_INVALID_CFG, _.FindDef(merge->id()))
<< ConstructErrorString(construct, _.getIdName(header->id()),
_.getIdName(merge->id()),
- "is not post dominated by");
+ "is not structurally post dominated by");
}
}
@@ -769,7 +773,7 @@ spv_result_t StructuredControlFlowChecks(
for (auto block : construct_blocks) {
// Check that all exits from the construct are via structured exits.
for (auto succ : *block->successors()) {
- if (block->reachable() && !construct_blocks.count(succ) &&
+ if (!construct_blocks.count(succ) &&
!construct.IsStructuredExit(_, succ)) {
return _.diag(SPV_ERROR_INVALID_CFG, _.FindDef(block->id()))
<< "block <ID> " << _.getIdName(block->id()) << " exits the "
@@ -782,7 +786,7 @@ spv_result_t StructuredControlFlowChecks(
// Check that for all non-header blocks, all predecessors are within this
// construct.
for (auto pred : *block->predecessors()) {
- if (pred->reachable() && !construct_blocks.count(pred)) {
+ if (pred->structurally_reachable() && !construct_blocks.count(pred)) {
return _.diag(SPV_ERROR_INVALID_CFG, _.FindDef(pred->id()))
<< "block <ID> " << pred->id() << " branches to the "
<< construct_name << " construct, but not to the "
@@ -798,7 +802,7 @@ spv_result_t StructuredControlFlowChecks(
merge_inst.opcode() == SpvOpLoopMerge) {
uint32_t merge_id = merge_inst.GetOperandAs<uint32_t>(0);
auto merge_block = function->GetBlock(merge_id).first;
- if (merge_block->reachable() &&
+ if (merge_block->structurally_reachable() &&
!construct_blocks.count(merge_block)) {
return _.diag(SPV_ERROR_INVALID_CFG, _.FindDef(block->id()))
<< "Header block " << _.getIdName(block->id())
@@ -811,6 +815,43 @@ spv_result_t StructuredControlFlowChecks(
}
}
+ if (construct.type() == ConstructType::kLoop) {
+ // If the continue target differs from the loop header, then check that
+ // all edges into the continue construct come from within the loop.
+ const auto index = header->terminator() - &_.ordered_instructions()[0];
+ const auto& merge_inst = _.ordered_instructions()[index - 1];
+ const auto continue_id = merge_inst.GetOperandAs<uint32_t>(1);
+ const auto* continue_inst = _.FindDef(continue_id);
+ // OpLabel instructions aren't stored as part of the basic block for
+ // legacy reaasons. Grab the next instruction and use it's block pointer
+ // instead.
+ const auto next_index =
+ (continue_inst - &_.ordered_instructions()[0]) + 1;
+ const auto& next_inst = _.ordered_instructions()[next_index];
+ const auto* continue_target = next_inst.block();
+ if (header->id() != continue_id) {
+ for (auto pred : *continue_target->predecessors()) {
+ // Ignore back-edges from within the continue construct.
+ bool is_back_edge = false;
+ for (auto back_edge : back_edges) {
+ uint32_t back_edge_block;
+ uint32_t header_block;
+ std::tie(back_edge_block, header_block) = back_edge;
+ if (header_block == continue_id && back_edge_block == pred->id())
+ is_back_edge = true;
+ }
+ if (!construct_blocks.count(pred) && !is_back_edge) {
+ return _.diag(SPV_ERROR_INVALID_CFG, pred->terminator())
+ << "Block " << _.getIdName(pred->id())
+ << " branches to the loop continue target "
+ << _.getIdName(continue_id)
+ << ", but is not contained in the associated loop construct "
+ << _.getIdName(header->id());
+ }
+ }
+ }
+ }
+
// Checks rules for case constructs.
if (construct.type() == ConstructType::kSelection &&
header->terminator()->opcode() == SpvOpSwitch) {
@@ -848,52 +889,27 @@ spv_result_t PerformCfgChecks(ValidationState_t& _) {
<< _.getIdName(function.id());
}
- // Set each block's immediate dominator and immediate postdominator,
- // and find all back-edges.
+ // Set each block's immediate dominator.
//
// We want to analyze all the blocks in the function, even in degenerate
// control flow cases including unreachable blocks. So use the augmented
// CFG to ensure we cover all the blocks.
std::vector<const BasicBlock*> postorder;
- std::vector<const BasicBlock*> postdom_postorder;
- std::vector<std::pair<uint32_t, uint32_t>> back_edges;
auto ignore_block = [](const BasicBlock*) {};
- auto ignore_edge = [](const BasicBlock*, const BasicBlock*) {};
+ auto no_terminal_blocks = [](const BasicBlock*) { return false; };
if (!function.ordered_blocks().empty()) {
/// calculate dominators
CFA<BasicBlock>::DepthFirstTraversal(
function.first_block(), function.AugmentedCFGSuccessorsFunction(),
ignore_block, [&](const BasicBlock* b) { postorder.push_back(b); },
- ignore_edge);
+ no_terminal_blocks);
auto edges = CFA<BasicBlock>::CalculateDominators(
postorder, function.AugmentedCFGPredecessorsFunction());
for (auto edge : edges) {
if (edge.first != edge.second)
edge.first->SetImmediateDominator(edge.second);
}
-
- /// calculate post dominators
- CFA<BasicBlock>::DepthFirstTraversal(
- function.pseudo_exit_block(),
- function.AugmentedCFGPredecessorsFunction(), ignore_block,
- [&](const BasicBlock* b) { postdom_postorder.push_back(b); },
- ignore_edge);
- auto postdom_edges = CFA<BasicBlock>::CalculateDominators(
- postdom_postorder, function.AugmentedCFGSuccessorsFunction());
- for (auto edge : postdom_edges) {
- edge.first->SetImmediatePostDominator(edge.second);
- }
- /// calculate back edges.
- CFA<BasicBlock>::DepthFirstTraversal(
- function.pseudo_entry_block(),
- function
- .AugmentedCFGSuccessorsFunctionIncludingHeaderToContinueEdge(),
- ignore_block, ignore_block,
- [&](const BasicBlock* from, const BasicBlock* to) {
- back_edges.emplace_back(from->id(), to->id());
- });
}
- UpdateContinueConstructExitBlocks(function, back_edges);
auto& blocks = function.ordered_blocks();
if (!blocks.empty()) {
@@ -910,7 +926,7 @@ spv_result_t PerformCfgChecks(ValidationState_t& _) {
}
}
}
- // If we have structed control flow, check that no block has a control
+ // If we have structured control flow, check that no block has a control
// flow nesting depth larger than the limit.
if (_.HasCapability(SpvCapabilityShader)) {
const int control_flow_nesting_depth_limit =
@@ -927,6 +943,52 @@ spv_result_t PerformCfgChecks(ValidationState_t& _) {
/// Structured control flow checks are only required for shader capabilities
if (_.HasCapability(SpvCapabilityShader)) {
+ // Calculate structural dominance.
+ postorder.clear();
+ std::vector<const BasicBlock*> postdom_postorder;
+ std::vector<std::pair<uint32_t, uint32_t>> back_edges;
+ if (!function.ordered_blocks().empty()) {
+ /// calculate dominators
+ CFA<BasicBlock>::DepthFirstTraversal(
+ function.first_block(),
+ function.AugmentedStructuralCFGSuccessorsFunction(), ignore_block,
+ [&](const BasicBlock* b) { postorder.push_back(b); },
+ no_terminal_blocks);
+ auto edges = CFA<BasicBlock>::CalculateDominators(
+ postorder, function.AugmentedStructuralCFGPredecessorsFunction());
+ for (auto edge : edges) {
+ if (edge.first != edge.second)
+ edge.first->SetImmediateStructuralDominator(edge.second);
+ }
+
+ /// calculate post dominators
+ CFA<BasicBlock>::DepthFirstTraversal(
+ function.pseudo_exit_block(),
+ function.AugmentedStructuralCFGPredecessorsFunction(), ignore_block,
+ [&](const BasicBlock* b) { postdom_postorder.push_back(b); },
+ no_terminal_blocks);
+ auto postdom_edges = CFA<BasicBlock>::CalculateDominators(
+ postdom_postorder,
+ function.AugmentedStructuralCFGSuccessorsFunction());
+ for (auto edge : postdom_edges) {
+ edge.first->SetImmediateStructuralPostDominator(edge.second);
+ }
+ /// calculate back edges.
+ CFA<BasicBlock>::DepthFirstTraversal(
+ function.pseudo_entry_block(),
+ function.AugmentedStructuralCFGSuccessorsFunction(), ignore_block,
+ ignore_block,
+ [&](const BasicBlock* from, const BasicBlock* to) {
+ // A back edge must be a real edge. Since the augmented successors
+ // contain structural edges, filter those from consideration.
+ for (const auto* succ : *(from->successors())) {
+ if (succ == to) back_edges.emplace_back(from->id(), to->id());
+ }
+ },
+ no_terminal_blocks);
+ }
+ UpdateContinueConstructExitBlocks(function, back_edges);
+
if (auto error =
StructuredControlFlowChecks(_, &function, back_edges, postorder))
return error;
@@ -1004,7 +1066,9 @@ spv_result_t CfgPass(ValidationState_t& _, const Instruction* inst) {
case SpvOpTerminateInvocation:
case SpvOpIgnoreIntersectionKHR:
case SpvOpTerminateRayKHR:
+ case SpvOpEmitMeshTasksEXT:
_.current_function().RegisterBlockEnd(std::vector<uint32_t>());
+ // Ops with dedicated passes check for the Execution Model there
if (opcode == SpvOpKill) {
_.current_function().RegisterExecutionModelLimitation(
SpvExecutionModelFragment,
@@ -1018,12 +1082,12 @@ spv_result_t CfgPass(ValidationState_t& _, const Instruction* inst) {
if (opcode == SpvOpIgnoreIntersectionKHR) {
_.current_function().RegisterExecutionModelLimitation(
SpvExecutionModelAnyHitKHR,
- "OpIgnoreIntersectionKHR requires AnyHit execution model");
+ "OpIgnoreIntersectionKHR requires AnyHitKHR execution model");
}
if (opcode == SpvOpTerminateRayKHR) {
_.current_function().RegisterExecutionModelLimitation(
SpvExecutionModelAnyHitKHR,
- "OpTerminateRayKHR requires AnyHit execution model");
+ "OpTerminateRayKHR requires AnyHitKHR execution model");
}
break;
@@ -1052,6 +1116,26 @@ void ReachabilityPass(ValidationState_t& _) {
}
}
}
+
+ // Repeat for structural reachability.
+ for (auto& f : _.functions()) {
+ std::vector<BasicBlock*> stack;
+ auto entry = f.first_block();
+ // Skip function declarations.
+ if (entry) stack.push_back(entry);
+
+ while (!stack.empty()) {
+ auto block = stack.back();
+ stack.pop_back();
+
+ if (block->structurally_reachable()) continue;
+
+ block->set_structurally_reachable(true);
+ for (auto succ : *block->structural_successors()) {
+ stack.push_back(succ);
+ }
+ }
+ }
}
spv_result_t ControlFlowPass(ValidationState_t& _, const Instruction* inst) {
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp
index 5d6c5e37705..c3d948dc7f0 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_composites.cpp
@@ -505,8 +505,8 @@ spv_result_t ValidateVectorShuffle(ValidationState_t& _,
if (componentCount != resultVectorDimension) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpVectorShuffle component literals count does not match "
- "Result Type <id> '"
- << _.getIdName(resultType->id()) << "'s vector component count.";
+ "Result Type <id> "
+ << _.getIdName(resultType->id()) << "s vector component count.";
}
// Vector 1 and Vector 2 must both have vector types, with the same Component
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_constants.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_constants.cpp
index dea95c8a2e6..fdfaea5f7f6 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_constants.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_constants.cpp
@@ -26,8 +26,8 @@ spv_result_t ValidateConstantBool(ValidationState_t& _,
auto type = _.FindDef(inst->type_id());
if (!type || type->opcode() != SpvOpTypeBool) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Op" << spvOpcodeString(inst->opcode()) << " Result Type <id> '"
- << _.getIdName(inst->type_id()) << "' is not a boolean type.";
+ << "Op" << spvOpcodeString(inst->opcode()) << " Result Type <id> "
+ << _.getIdName(inst->type_id()) << " is not a boolean type.";
}
return SPV_SUCCESS;
@@ -40,8 +40,8 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _,
const auto result_type = _.FindDef(inst->type_id());
if (!result_type || !spvOpcodeIsComposite(result_type->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Result Type <id> '"
- << _.getIdName(inst->type_id()) << "' is not a composite type.";
+ << opcode_name << " Result Type <id> "
+ << _.getIdName(inst->type_id()) << " is not a composite type.";
}
const auto constituent_count = inst->words().size() - 3;
@@ -53,9 +53,8 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _,
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< opcode_name
<< " Constituent <id> count does not match "
- "Result Type <id> '"
- << _.getIdName(result_type->id())
- << "'s vector component count.";
+ "Result Type <id> "
+ << _.getIdName(result_type->id()) << "s vector component count.";
}
const auto component_type =
_.FindDef(result_type->GetOperandAs<uint32_t>(1));
@@ -71,18 +70,18 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _,
if (!constituent ||
!spvOpcodeIsConstantOrUndef(constituent->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
+ << opcode_name << " Constituent <id> "
<< _.getIdName(constituent_id)
- << "' is not a constant or undef.";
+ << " is not a constant or undef.";
}
const auto constituent_result_type = _.FindDef(constituent->type_id());
if (!constituent_result_type ||
component_type->opcode() != constituent_result_type->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
+ << opcode_name << " Constituent <id> "
<< _.getIdName(constituent_id)
- << "'s type does not match Result Type <id> '"
- << _.getIdName(result_type->id()) << "'s vector element type.";
+ << "s type does not match Result Type <id> "
+ << _.getIdName(result_type->id()) << "s vector element type.";
}
}
} break;
@@ -93,8 +92,8 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _,
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< opcode_name
<< " Constituent <id> count does not match "
- "Result Type <id> '"
- << _.getIdName(result_type->id()) << "'s matrix column count.";
+ "Result Type <id> "
+ << _.getIdName(result_type->id()) << "s matrix column count.";
}
const auto column_type = _.FindDef(result_type->words()[2]);
@@ -120,9 +119,9 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _,
// The message says "... or undef" because the spec does not say
// undef is a constant.
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
+ << opcode_name << " Constituent <id> "
<< _.getIdName(constituent_id)
- << "' is not a constant or undef.";
+ << " is not a constant or undef.";
}
const auto vector = _.FindDef(constituent->type_id());
if (!vector) {
@@ -131,28 +130,28 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _,
}
if (column_type->opcode() != vector->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
+ << opcode_name << " Constituent <id> "
<< _.getIdName(constituent_id)
- << "' type does not match Result Type <id> '"
- << _.getIdName(result_type->id()) << "'s matrix column type.";
+ << " type does not match Result Type <id> "
+ << _.getIdName(result_type->id()) << "s matrix column type.";
}
const auto vector_component_type =
_.FindDef(vector->GetOperandAs<uint32_t>(1));
if (component_type->id() != vector_component_type->id()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
+ << opcode_name << " Constituent <id> "
<< _.getIdName(constituent_id)
- << "' component type does not match Result Type <id> '"
+ << " component type does not match Result Type <id> "
<< _.getIdName(result_type->id())
- << "'s matrix column component type.";
+ << "s matrix column component type.";
}
if (component_count != vector->words()[3]) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
+ << opcode_name << " Constituent <id> "
<< _.getIdName(constituent_id)
- << "' vector component count does not match Result Type <id> '"
+ << " vector component count does not match Result Type <id> "
<< _.getIdName(result_type->id())
- << "'s vector component count.";
+ << "s vector component count.";
}
}
} break;
@@ -175,8 +174,8 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _,
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< opcode_name
<< " Constituent count does not match "
- "Result Type <id> '"
- << _.getIdName(result_type->id()) << "'s array length.";
+ "Result Type <id> "
+ << _.getIdName(result_type->id()) << "s array length.";
}
for (size_t constituent_index = 2;
constituent_index < inst->operands().size(); constituent_index++) {
@@ -186,9 +185,9 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _,
if (!constituent ||
!spvOpcodeIsConstantOrUndef(constituent->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
+ << opcode_name << " Constituent <id> "
<< _.getIdName(constituent_id)
- << "' is not a constant or undef.";
+ << " is not a constant or undef.";
}
const auto constituent_type = _.FindDef(constituent->type_id());
if (!constituent_type) {
@@ -197,10 +196,10 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _,
}
if (element_type->id() != constituent_type->id()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
+ << opcode_name << " Constituent <id> "
<< _.getIdName(constituent_id)
- << "'s type does not match Result Type <id> '"
- << _.getIdName(result_type->id()) << "'s array element type.";
+ << "s type does not match Result Type <id> "
+ << _.getIdName(result_type->id()) << "s array element type.";
}
}
} break;
@@ -208,10 +207,10 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _,
const auto member_count = result_type->words().size() - 2;
if (member_count != constituent_count) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
+ << opcode_name << " Constituent <id> "
<< _.getIdName(inst->type_id())
- << "' count does not match Result Type <id> '"
- << _.getIdName(result_type->id()) << "'s struct member count.";
+ << " count does not match Result Type <id> "
+ << _.getIdName(result_type->id()) << "s struct member count.";
}
for (uint32_t constituent_index = 2, member_index = 1;
constituent_index < inst->operands().size();
@@ -222,9 +221,9 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _,
if (!constituent ||
!spvOpcodeIsConstantOrUndef(constituent->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
+ << opcode_name << " Constituent <id> "
<< _.getIdName(constituent_id)
- << "' is not a constant or undef.";
+ << " is not a constant or undef.";
}
const auto constituent_type = _.FindDef(constituent->type_id());
if (!constituent_type) {
@@ -237,26 +236,25 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _,
const auto member_type = _.FindDef(member_type_id);
if (!member_type || member_type->id() != constituent_type->id()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
+ << opcode_name << " Constituent <id> "
<< _.getIdName(constituent_id)
- << "' type does not match the Result Type <id> '"
- << _.getIdName(result_type->id()) << "'s member type.";
+ << " type does not match the Result Type <id> "
+ << _.getIdName(result_type->id()) << "s member type.";
}
}
} break;
case SpvOpTypeCooperativeMatrixNV: {
if (1 != constituent_count) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
- << _.getIdName(inst->type_id()) << "' count must be one.";
+ << opcode_name << " Constituent <id> "
+ << _.getIdName(inst->type_id()) << " count must be one.";
}
const auto constituent_id = inst->GetOperandAs<uint32_t>(2);
const auto constituent = _.FindDef(constituent_id);
if (!constituent || !spvOpcodeIsConstantOrUndef(constituent->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
- << _.getIdName(constituent_id)
- << "' is not a constant or undef.";
+ << opcode_name << " Constituent <id> "
+ << _.getIdName(constituent_id) << " is not a constant or undef.";
}
const auto constituent_type = _.FindDef(constituent->type_id());
if (!constituent_type) {
@@ -268,10 +266,10 @@ spv_result_t ValidateConstantComposite(ValidationState_t& _,
const auto component_type = _.FindDef(component_type_id);
if (!component_type || component_type->id() != constituent_type->id()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opcode_name << " Constituent <id> '"
+ << opcode_name << " Constituent <id> "
<< _.getIdName(constituent_id)
- << "' type does not match the Result Type <id> '"
- << _.getIdName(result_type->id()) << "'s component type.";
+ << " type does not match the Result Type <id> "
+ << _.getIdName(result_type->id()) << "s component type.";
}
} break;
default:
@@ -285,8 +283,8 @@ spv_result_t ValidateConstantSampler(ValidationState_t& _,
const auto result_type = _.FindDef(inst->type_id());
if (!result_type || result_type->opcode() != SpvOpTypeSampler) {
return _.diag(SPV_ERROR_INVALID_ID, result_type)
- << "OpConstantSampler Result Type <id> '"
- << _.getIdName(inst->type_id()) << "' is not a sampler type.";
+ << "OpConstantSampler Result Type <id> "
+ << _.getIdName(inst->type_id()) << " is not a sampler type.";
}
return SPV_SUCCESS;
@@ -339,8 +337,8 @@ spv_result_t ValidateConstantNull(ValidationState_t& _,
const auto result_type = _.FindDef(inst->type_id());
if (!result_type || !IsTypeNullable(result_type->words(), _)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpConstantNull Result Type <id> '"
- << _.getIdName(inst->type_id()) << "' cannot have a null value.";
+ << "OpConstantNull Result Type <id> " << _.getIdName(inst->type_id())
+ << " cannot have a null value.";
}
return SPV_SUCCESS;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_conversion.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_conversion.cpp
index b4e39cfe451..dc6b15172af 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_conversion.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_conversion.cpp
@@ -534,6 +534,24 @@ spv_result_t ConversionPass(ValidationState_t& _, const Instruction* inst) {
break;
}
+ case SpvOpConvertUToAccelerationStructureKHR: {
+ if (!_.IsAccelerationStructureType(result_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Result Type to be a Acceleration Structure: "
+ << spvOpcodeString(opcode);
+ }
+
+ const uint32_t input_type = _.GetOperandTypeId(inst, 2);
+ if (!input_type || !_.IsUnsigned64BitHandle(input_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected 64-bit uint scalar or 2-component 32-bit uint "
+ "vector as input: "
+ << spvOpcodeString(opcode);
+ }
+
+ break;
+ }
+
default:
break;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_debug.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_debug.cpp
index 0a25d8ab7ee..7ab597a11a1 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_debug.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_debug.cpp
@@ -28,16 +28,16 @@ spv_result_t ValidateMemberName(ValidationState_t& _, const Instruction* inst) {
const auto type = _.FindDef(type_id);
if (!type || SpvOpTypeStruct != type->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpMemberName Type <id> '" << _.getIdName(type_id)
- << "' is not a struct type.";
+ << "OpMemberName Type <id> " << _.getIdName(type_id)
+ << " is not a struct type.";
}
const auto member_id = inst->GetOperandAs<uint32_t>(1);
const auto member_count = (uint32_t)(type->words().size() - 2);
if (member_count <= member_id) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpMemberName Member <id> '" << _.getIdName(member_id)
- << "' index is larger than Type <id> '" << _.getIdName(type->id())
- << "'s member count.";
+ << "OpMemberName Member <id> " << _.getIdName(member_id)
+ << " index is larger than Type <id> " << _.getIdName(type->id())
+ << "s member count.";
}
return SPV_SUCCESS;
}
@@ -47,8 +47,8 @@ spv_result_t ValidateLine(ValidationState_t& _, const Instruction* inst) {
const auto file = _.FindDef(file_id);
if (!file || SpvOpString != file->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpLine Target <id> '" << _.getIdName(file_id)
- << "' is not an OpString.";
+ << "OpLine Target <id> " << _.getIdName(file_id)
+ << " is not an OpString.";
}
return SPV_SUCCESS;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_decorations.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_decorations.cpp
index 8e4c42e4119..cd0ff209b88 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_decorations.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_decorations.cpp
@@ -21,11 +21,13 @@
#include <utility>
#include <vector>
+#include "source/binary.h"
#include "source/diagnostic.h"
#include "source/opcode.h"
#include "source/spirv_constant.h"
#include "source/spirv_target_env.h"
#include "source/spirv_validator_options.h"
+#include "source/util/string_utils.h"
#include "source/val/validate_scopes.h"
#include "source/val/validation_state.h"
@@ -96,6 +98,14 @@ 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(); });
+}
+
// 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);
@@ -140,6 +150,8 @@ bool isMissingOffsetInStruct(uint32_t struct_id, ValidationState_t& vstate) {
for (auto& decoration : vstate.id_decorations(struct_id)) {
if (SpvDecorationOffset == 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;
}
}
@@ -167,8 +179,9 @@ uint32_t align(uint32_t x, uint32_t alignment) {
}
// Returns base alignment of struct member. If |roundUp| is true, also
-// ensure that structs and arrays are aligned at least to a multiple of 16
-// bytes.
+// ensure that structs, arrays, and matrices are aligned at least to a
+// multiple of 16 bytes. (That is, when roundUp is true, this function
+// returns the *extended* alignment as it's called by the Vulkan spec.)
uint32_t getBaseAlignment(uint32_t member_id, bool roundUp,
const LayoutConstraints& inherited,
MemberConstraints& constraints,
@@ -178,6 +191,13 @@ 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))
+ return baseAlignment = vstate.samplerimage_variable_address_mode() / 8;
+ assert(0);
+ return 0;
case SpvOpTypeInt:
case SpvOpTypeFloat:
baseAlignment = words[2] / 8;
@@ -207,6 +227,7 @@ uint32_t getBaseAlignment(uint32_t member_id, bool roundUp,
baseAlignment =
componentAlignment * (num_columns == 3 ? 4 : num_columns);
}
+ if (roundUp) baseAlignment = align(baseAlignment, 16u);
} break;
case SpvOpTypeArray:
case SpvOpTypeRuntimeArray:
@@ -244,6 +265,13 @@ 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))
+ return vstate.samplerimage_variable_address_mode() / 8;
+ assert(0);
+ return 0;
case SpvOpTypeInt:
case SpvOpTypeFloat:
return words[2] / 8;
@@ -284,6 +312,13 @@ 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))
+ return vstate.samplerimage_variable_address_mode() / 8;
+ assert(0);
+ return 0;
case SpvOpTypeInt:
case SpvOpTypeFloat:
return words[2] / 8;
@@ -334,10 +369,13 @@ uint32_t getSize(uint32_t member_id, const LayoutConstraints& inherited,
const auto& lastMember = members.back();
uint32_t offset = 0xffffffff;
// Find the offset of the last element and add the size.
- for (auto& decoration : vstate.id_decorations(member_id)) {
- if (SpvDecorationOffset == decoration.dec_type() &&
- decoration.struct_member_index() == (int)lastIdx) {
- offset = decoration.params()[0];
+ auto member_decorations =
+ vstate.id_member_decorations(member_id, lastIdx);
+ for (auto decoration = member_decorations.begin;
+ decoration != member_decorations.end; ++decoration) {
+ assert(decoration->struct_member_index() == (int)lastIdx);
+ if (SpvDecorationOffset == decoration->dec_type()) {
+ offset = decoration->params()[0];
}
}
// This check depends on the fact that all members have offsets. This
@@ -433,15 +471,17 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str,
for (uint32_t memberIdx = 0, numMembers = uint32_t(members.size());
memberIdx < numMembers; memberIdx++) {
uint32_t offset = 0xffffffff;
- for (auto& decoration : vstate.id_decorations(struct_id)) {
- if (decoration.struct_member_index() == (int)memberIdx) {
- switch (decoration.dec_type()) {
- case SpvDecorationOffset:
- offset = decoration.params()[0];
- break;
- default:
- break;
- }
+ auto member_decorations =
+ vstate.id_member_decorations(struct_id, memberIdx);
+ for (auto decoration = member_decorations.begin;
+ decoration != member_decorations.end; ++decoration) {
+ assert(decoration->struct_member_index() == (int)memberIdx);
+ switch (decoration->dec_type()) {
+ case SpvDecorationOffset:
+ offset = decoration->params()[0];
+ break;
+ default:
+ break;
}
}
member_offsets.push_back(
@@ -453,7 +493,7 @@ spv_result_t checkLayout(uint32_t struct_id, const char* storage_class_str,
return lhs.offset < rhs.offset;
});
- // Now scan from lowest offest to highest offset.
+ // Now scan from lowest offset to highest offset.
uint32_t nextValidOffset = 0;
for (size_t ordered_member_idx = 0;
ordered_member_idx < member_offsets.size(); ordered_member_idx++) {
@@ -621,7 +661,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, SpvDecoration decoration,
+bool checkForRequiredDecoration(uint32_t struct_id,
+ std::function<bool(SpvDecoration)> checker,
SpvOp type, ValidationState_t& vstate) {
const auto& members = getStructMembers(struct_id, vstate);
for (size_t memberIdx = 0; memberIdx < members.size(); memberIdx++) {
@@ -629,10 +670,10 @@ bool checkForRequiredDecoration(uint32_t struct_id, SpvDecoration decoration,
if (type != vstate.FindDef(id)->opcode()) continue;
bool found = false;
for (auto& dec : vstate.id_decorations(id)) {
- if (decoration == dec.dec_type()) found = true;
+ if (checker(dec.dec_type())) found = true;
}
for (auto& dec : vstate.id_decorations(struct_id)) {
- if (decoration == dec.dec_type() &&
+ if (checker(dec.dec_type()) &&
(int)memberIdx == dec.struct_member_index()) {
found = true;
}
@@ -642,7 +683,7 @@ bool checkForRequiredDecoration(uint32_t struct_id, SpvDecoration decoration,
}
}
for (auto id : getStructMembers(struct_id, SpvOpTypeStruct, vstate)) {
- if (!checkForRequiredDecoration(id, decoration, type, vstate)) {
+ if (!checkForRequiredDecoration(id, checker, type, vstate)) {
return false;
}
}
@@ -700,7 +741,7 @@ spv_result_t CheckBuiltInVariable(uint32_t var_id, ValidationState_t& vstate) {
if (d.dec_type() == SpvDecorationLocation ||
d.dec_type() == SpvDecorationComponent) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
- << "A BuiltIn variable (id " << var_id
+ << vstate.VkErrorID(4915) << "A BuiltIn variable (id " << var_id
<< ") cannot have any Location or Component decorations";
}
}
@@ -708,12 +749,12 @@ spv_result_t CheckBuiltInVariable(uint32_t var_id, ValidationState_t& vstate) {
return SPV_SUCCESS;
}
-// Checks whether proper decorations have been appied to the entry points.
+// Checks whether proper decorations have been applied to the entry points.
spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) {
for (uint32_t entry_point : vstate.entry_points()) {
const auto& descs = vstate.entry_point_descriptions(entry_point);
- int num_builtin_inputs = 0;
- int num_builtin_outputs = 0;
+ int num_builtin_block_inputs = 0;
+ int num_builtin_block_outputs = 0;
int num_workgroup_variables = 0;
int num_workgroup_variables_with_block = 0;
int num_workgroup_variables_with_aliased = 0;
@@ -764,9 +805,20 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) {
Instruction* type_instr = vstate.FindDef(type_id);
if (type_instr && SpvOpTypeStruct == type_instr->opcode() &&
isBuiltInStruct(type_id, vstate)) {
- if (storage_class == SpvStorageClassInput) ++num_builtin_inputs;
- if (storage_class == SpvStorageClassOutput) ++num_builtin_outputs;
- if (num_builtin_inputs > 1 || num_builtin_outputs > 1) break;
+ if (!isBlock(type_id, vstate)) {
+ return vstate.diag(SPV_ERROR_INVALID_DATA, vstate.FindDef(type_id))
+ << vstate.VkErrorID(4919)
+ << "Interface struct has no Block decoration but has "
+ "BuiltIn members. "
+ "Location decorations must be used on each member of "
+ "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)
+ ++num_builtin_block_outputs;
+ if (num_builtin_block_inputs > 1 || num_builtin_block_outputs > 1)
+ break;
if (auto error = CheckBuiltInVariable(interface, vstate))
return error;
} else if (isBuiltInVar(interface, vstate)) {
@@ -783,8 +835,59 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) {
++num_workgroup_variables_with_aliased;
}
}
+
+ if (spvIsVulkanEnv(vstate.context()->target_env)) {
+ const auto* models = vstate.GetExecutionModels(entry_point);
+ const bool has_frag =
+ models->find(SpvExecutionModelFragment) != models->end();
+ const bool has_vert =
+ models->find(SpvExecutionModelVertex) != models->end();
+ for (const auto& decoration :
+ vstate.id_decorations(var_instr->id())) {
+ if (decoration == SpvDecorationFlat ||
+ decoration == SpvDecorationNoPerspective ||
+ decoration == SpvDecorationSample ||
+ decoration == SpvDecorationCentroid) {
+ // VUID 04670 already validates these decorations are input/output
+ if (storage_class == SpvStorageClassInput &&
+ (models->size() > 1 || has_vert)) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, var_instr)
+ << vstate.VkErrorID(6202)
+ << vstate.SpvDecorationString(decoration.dec_type())
+ << " decorated variable must not be used in vertex "
+ "execution model as an Input storage class for Entry "
+ "Point id "
+ << entry_point << ".";
+ } else if (storage_class == SpvStorageClassOutput &&
+ (models->size() > 1 || has_frag)) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, var_instr)
+ << vstate.VkErrorID(6201)
+ << vstate.SpvDecorationString(decoration.dec_type())
+ << " decorated variable must not be used in fragment "
+ "execution model as an Output storage class for "
+ "Entry Point id "
+ << entry_point << ".";
+ }
+ }
+ }
+
+ const bool has_flat =
+ hasDecoration(var_instr->id(), SpvDecorationFlat, vstate);
+ if (has_frag && storage_class == SpvStorageClassInput && !has_flat &&
+ ((vstate.IsFloatScalarType(type_id) &&
+ vstate.GetBitWidth(type_id) == 64) ||
+ vstate.IsIntScalarOrVectorType(type_id))) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, var_instr)
+ << vstate.VkErrorID(4744)
+ << "Fragment OpEntryPoint operand "
+ << interface << " with Input interfaces with integer or "
+ "float type must have a Flat decoration "
+ "for Entry Point id "
+ << entry_point << ".";
+ }
+ }
}
- if (num_builtin_inputs > 1 || num_builtin_outputs > 1) {
+ if (num_builtin_block_inputs > 1 || num_builtin_block_outputs > 1) {
return vstate.diag(SPV_ERROR_INVALID_BINARY,
vstate.FindDef(entry_point))
<< "There must be at most one object per Storage Class that can "
@@ -796,8 +899,8 @@ spv_result_t CheckDecorationsOfEntryPoints(ValidationState_t& vstate) {
// targeted by an OpEntryPoint instruction
for (auto& decoration : vstate.id_decorations(entry_point)) {
if (SpvDecorationLinkageAttributes == decoration.dec_type()) {
- const char* linkage_name =
- reinterpret_cast<const char*>(&decoration.params()[0]);
+ const std::string linkage_name =
+ spvtools::utils::MakeString(decoration.params());
return vstate.diag(SPV_ERROR_INVALID_BINARY,
vstate.FindDef(entry_point))
<< "The LinkageAttributes Decoration (Linkage name: "
@@ -855,21 +958,23 @@ void ComputeMemberConstraintsForStruct(MemberConstraints* constraints,
LayoutConstraints& constraint =
(*constraints)[std::make_pair(struct_id, memberIdx)];
constraint = inherited;
- for (auto& decoration : vstate.id_decorations(struct_id)) {
- if (decoration.struct_member_index() == (int)memberIdx) {
- switch (decoration.dec_type()) {
- case SpvDecorationRowMajor:
- constraint.majorness = kRowMajor;
- break;
- case SpvDecorationColMajor:
- constraint.majorness = kColumnMajor;
- break;
- case SpvDecorationMatrixStride:
- constraint.matrix_stride = decoration.params()[0];
- break;
- default:
- break;
- }
+ auto member_decorations =
+ vstate.id_member_decorations(struct_id, memberIdx);
+ for (auto decoration = member_decorations.begin;
+ decoration != member_decorations.end; ++decoration) {
+ assert(decoration->struct_member_index() == (int)memberIdx);
+ switch (decoration->dec_type()) {
+ case SpvDecorationRowMajor:
+ constraint.majorness = kRowMajor;
+ break;
+ case SpvDecorationColMajor:
+ constraint.majorness = kColumnMajor;
+ break;
+ case SpvDecorationMatrixStride:
+ constraint.matrix_stride = decoration->params()[0];
+ break;
+ default:
+ break;
}
}
@@ -933,41 +1038,41 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) {
const bool storage_buffer = storageClass == SpvStorageClassStorageBuffer;
if (spvIsVulkanEnv(vstate.context()->target_env)) {
- // Vulkan 14.5.1: There must be no more than one PushConstant block
- // per entry point.
+ // Vulkan: There must be no more than one PushConstant block per entry
+ // point.
if (push_constant) {
auto entry_points = vstate.EntryPointReferences(var_id);
for (auto ep_id : entry_points) {
const bool already_used = !uses_push_constant.insert(ep_id).second;
if (already_used) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
- << "Entry point id '" << ep_id
+ << vstate.VkErrorID(6674) << "Entry point id '" << ep_id
<< "' uses more than one PushConstant interface.\n"
- << "From Vulkan spec, section 14.5.1:\n"
+ << "From Vulkan spec:\n"
<< "There must be no more than one push constant block "
<< "statically used per shader entry point.";
}
}
}
- // Vulkan 14.5.2: Check DescriptorSet and Binding decoration for
+ // Vulkan: Check DescriptorSet and Binding decoration for
// UniformConstant which cannot be a struct.
if (uniform_constant) {
auto entry_points = vstate.EntryPointReferences(var_id);
if (!entry_points.empty() &&
!hasDecoration(var_id, SpvDecorationDescriptorSet, vstate)) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
- << "UniformConstant id '" << var_id
+ << vstate.VkErrorID(6677) << "UniformConstant id '" << var_id
<< "' is missing DescriptorSet decoration.\n"
- << "From Vulkan spec, section 14.5.2:\n"
+ << "From Vulkan spec:\n"
<< "These variables must have DescriptorSet and Binding "
"decorations specified";
}
if (!entry_points.empty() &&
!hasDecoration(var_id, SpvDecorationBinding, vstate)) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
- << "UniformConstant id '" << var_id
+ << vstate.VkErrorID(6677) << "UniformConstant id '" << var_id
<< "' is missing Binding decoration.\n"
- << "From Vulkan spec, section 14.5.2:\n"
+ << "From Vulkan spec:\n"
<< "These variables must have DescriptorSet and Binding "
"decorations specified";
}
@@ -994,8 +1099,10 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) {
}
const bool phys_storage_buffer =
- storageClass == SpvStorageClassPhysicalStorageBufferEXT;
- const bool workgroup = storageClass == SpvStorageClassWorkgroup;
+ storageClass == SpvStorageClassPhysicalStorageBuffer;
+ const bool workgroup =
+ storageClass == SpvStorageClassWorkgroup &&
+ vstate.HasCapability(SpvCapabilityWorkgroupMemoryExplicitLayoutKHR);
if (uniform || push_constant || storage_buffer || phys_storage_buffer ||
workgroup) {
const auto ptrInst = vstate.FindDef(words[1]);
@@ -1026,55 +1133,55 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) {
hasDecoration(id, SpvDecorationBufferBlock, vstate);
if (storage_buffer && buffer_block) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
- << "Storage buffer id '" << var_id
+ << vstate.VkErrorID(6675) << "Storage buffer id '" << var_id
<< " In Vulkan, BufferBlock is disallowed on variables in "
"the StorageBuffer storage class";
}
- // Vulkan 14.5.1/2: Check Block decoration for PushConstant, Uniform
+ // Vulkan: Check Block decoration for PushConstant, Uniform
// and StorageBuffer variables. Uniform can also use BufferBlock.
if (push_constant && !block) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
- << "PushConstant id '" << id
+ << vstate.VkErrorID(6675) << "PushConstant id '" << id
<< "' is missing Block decoration.\n"
- << "From Vulkan spec, section 14.5.1:\n"
+ << "From Vulkan spec:\n"
<< "Such variables must be identified with a Block "
"decoration";
}
if (storage_buffer && !block) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
- << "StorageBuffer id '" << id
+ << vstate.VkErrorID(6675) << "StorageBuffer id '" << id
<< "' is missing Block decoration.\n"
- << "From Vulkan spec, section 14.5.2:\n"
+ << "From Vulkan spec:\n"
<< "Such variables must be identified with a Block "
"decoration";
}
if (uniform && !block && !buffer_block) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
- << "Uniform id '" << id
+ << vstate.VkErrorID(6676) << "Uniform id '" << id
<< "' is missing Block or BufferBlock decoration.\n"
- << "From Vulkan spec, section 14.5.2:\n"
+ << "From Vulkan spec:\n"
<< "Such variables must be identified with a Block or "
"BufferBlock decoration";
}
- // Vulkan 14.5.2: Check DescriptorSet and Binding decoration for
+ // Vulkan: Check DescriptorSet and Binding decoration for
// Uniform and StorageBuffer variables.
if (uniform || storage_buffer) {
auto entry_points = vstate.EntryPointReferences(var_id);
if (!entry_points.empty() &&
!hasDecoration(var_id, SpvDecorationDescriptorSet, vstate)) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
- << sc_str << " id '" << var_id
+ << vstate.VkErrorID(6677) << sc_str << " id '" << var_id
<< "' is missing DescriptorSet decoration.\n"
- << "From Vulkan spec, section 14.5.2:\n"
+ << "From Vulkan spec:\n"
<< "These variables must have DescriptorSet and Binding "
"decorations specified";
}
if (!entry_points.empty() &&
!hasDecoration(var_id, SpvDecorationBinding, vstate)) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(var_id))
- << sc_str << " id '" << var_id
+ << vstate.VkErrorID(6677) << sc_str << " id '" << var_id
<< "' is missing Binding decoration.\n"
- << "From Vulkan spec, section 14.5.2:\n"
+ << "From Vulkan spec:\n"
<< "These variables must have DescriptorSet and Binding "
"decorations specified";
}
@@ -1111,39 +1218,58 @@ spv_result_t CheckDecorationsOfBuffers(ValidationState_t& vstate) {
<< "Structure id " << id << " decorated as " << deco_str
<< " must be explicitly laid out with Offset "
"decorations.";
- } else if (hasDecoration(id, SpvDecorationGLSLShared, vstate)) {
- return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
- << "Structure id " << id << " decorated as " << deco_str
- << " must not use GLSLShared decoration.";
- } else if (hasDecoration(id, SpvDecorationGLSLPacked, vstate)) {
- return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
- << "Structure id " << id << " decorated as " << deco_str
- << " must not use GLSLPacked decoration.";
- } else if (!checkForRequiredDecoration(id, SpvDecorationArrayStride,
- SpvOpTypeArray, vstate)) {
+ }
+
+ if (!checkForRequiredDecoration(id,
+ [](SpvDecoration d) {
+ return d ==
+ SpvDecorationArrayStride;
+ },
+ SpvOpTypeArray, 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.";
- } else if (!checkForRequiredDecoration(id,
- SpvDecorationMatrixStride,
- SpvOpTypeMatrix, vstate)) {
+ }
+
+ if (!checkForRequiredDecoration(id,
+ [](SpvDecoration d) {
+ return d ==
+ SpvDecorationMatrixStride;
+ },
+ SpvOpTypeMatrix, 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 "
"decorations.";
- } else if (blockRules &&
- (SPV_SUCCESS != (recursive_status = checkLayout(
- id, sc_str, deco_str, true,
- scalar_block_layout, 0,
- constraints, vstate)))) {
- return recursive_status;
- } else if (bufferRules &&
- (SPV_SUCCESS != (recursive_status = checkLayout(
- id, sc_str, deco_str, false,
- scalar_block_layout, 0,
- constraints, vstate)))) {
- return recursive_status;
+ }
+
+ if (!checkForRequiredDecoration(
+ id,
+ [](SpvDecoration d) {
+ return d == SpvDecorationRowMajor ||
+ d == SpvDecorationColMajor;
+ },
+ SpvOpTypeMatrix, 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 "
+ "ColMajor decorations.";
+ }
+
+ if (spvIsVulkanEnv(vstate.context()->target_env)) {
+ if (blockRules && (SPV_SUCCESS != (recursive_status = checkLayout(
+ id, sc_str, deco_str, true,
+ scalar_block_layout, 0,
+ constraints, vstate)))) {
+ return recursive_status;
+ } else if (bufferRules &&
+ (SPV_SUCCESS !=
+ (recursive_status = checkLayout(
+ id, sc_str, deco_str, false, scalar_block_layout,
+ 0, constraints, vstate)))) {
+ return recursive_status;
+ }
}
}
}
@@ -1172,32 +1298,6 @@ bool AtMostOncePerMember(SpvDecoration decoration) {
}
}
-// Returns the string name for |decoration|.
-const char* GetDecorationName(SpvDecoration decoration) {
- switch (decoration) {
- case SpvDecorationAliased:
- return "Aliased";
- case SpvDecorationRestrict:
- return "Restrict";
- case SpvDecorationArrayStride:
- return "ArrayStride";
- case SpvDecorationOffset:
- return "Offset";
- case SpvDecorationMatrixStride:
- return "MatrixStride";
- case SpvDecorationRowMajor:
- return "RowMajor";
- case SpvDecorationColMajor:
- return "ColMajor";
- case SpvDecorationBlock:
- return "Block";
- case SpvDecorationBufferBlock:
- return "BufferBlock";
- default:
- return "";
- }
-}
-
spv_result_t CheckDecorationsCompatibility(ValidationState_t& vstate) {
using PerIDKey = std::tuple<SpvDecoration, uint32_t>;
using PerMemberKey = std::tuple<SpvDecoration, uint32_t, uint32_t>;
@@ -1230,7 +1330,7 @@ spv_result_t CheckDecorationsCompatibility(ValidationState_t& vstate) {
if (already_used && AtMostOncePerId(dec_type)) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
<< "ID '" << id << "' decorated with "
- << GetDecorationName(dec_type)
+ << vstate.SpvDecorationString(dec_type)
<< " multiple times is not allowed.";
}
// Verify certain mutually exclusive decorations are not both applied on
@@ -1250,8 +1350,9 @@ spv_result_t CheckDecorationsCompatibility(ValidationState_t& vstate) {
if (seen_per_id.find(excl_k) != seen_per_id.end()) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
<< "ID '" << id << "' decorated with both "
- << GetDecorationName(dec_type) << " and "
- << GetDecorationName(excl_dec_type) << " is not allowed.";
+ << vstate.SpvDecorationString(dec_type) << " and "
+ << vstate.SpvDecorationString(excl_dec_type)
+ << " is not allowed.";
}
}
} else if (SpvOpMemberDecorate == inst.opcode()) {
@@ -1263,7 +1364,7 @@ spv_result_t CheckDecorationsCompatibility(ValidationState_t& vstate) {
if (already_used && AtMostOncePerMember(dec_type)) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
<< "ID '" << id << "', member '" << member_id
- << "' decorated with " << GetDecorationName(dec_type)
+ << "' decorated with " << vstate.SpvDecorationString(dec_type)
<< " multiple times is not allowed.";
}
// Verify certain mutually exclusive decorations are not both applied on
@@ -1283,8 +1384,9 @@ spv_result_t CheckDecorationsCompatibility(ValidationState_t& vstate) {
if (seen_per_member.find(excl_k) != seen_per_member.end()) {
return vstate.diag(SPV_ERROR_INVALID_ID, vstate.FindDef(id))
<< "ID '" << id << "', member '" << member_id
- << "' decorated with both " << GetDecorationName(dec_type)
- << " and " << GetDecorationName(excl_dec_type)
+ << "' decorated with both "
+ << vstate.SpvDecorationString(dec_type) << " and "
+ << vstate.SpvDecorationString(excl_dec_type)
<< " is not allowed.";
}
}
@@ -1382,11 +1484,11 @@ spv_result_t CheckFPRoundingModeForShaders(ValidationState_t& vstate,
storage != SpvStorageClassUniform &&
storage != SpvStorageClassPushConstant &&
storage != SpvStorageClassInput && storage != SpvStorageClassOutput &&
- storage != SpvStorageClassPhysicalStorageBufferEXT) {
+ storage != SpvStorageClassPhysicalStorageBuffer) {
return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
<< "FPRoundingMode decoration can be applied only to the "
"Object operand of an OpStore in the StorageBuffer, "
- "PhysicalStorageBufferEXT, Uniform, PushConstant, Input, or "
+ "PhysicalStorageBuffer, Uniform, PushConstant, Input, or "
"Output Storage Classes.";
}
}
@@ -1525,6 +1627,8 @@ spv_result_t CheckComponentDecoration(ValidationState_t& vstate,
const Instruction& inst,
const Decoration& decoration) {
assert(inst.id() && "Parser ensures the target of the decoration has an ID");
+ assert(decoration.params().size() == 1 &&
+ "Grammar ensures Component has one parameter");
uint32_t type_id;
if (decoration.struct_member_index() == Decoration::kInvalidMember) {
@@ -1573,23 +1677,48 @@ spv_result_t CheckComponentDecoration(ValidationState_t& vstate,
if (!vstate.IsIntScalarOrVectorType(type_id) &&
!vstate.IsFloatScalarOrVectorType(type_id)) {
return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
+ << vstate.VkErrorID(4924)
<< "Component decoration specified for type "
<< vstate.getIdName(type_id) << " that is not a scalar or vector";
}
- // For 16-, and 32-bit types, it is invalid if this sequence of components
- // gets larger than 3.
+ const auto component = decoration.params()[0];
+ if (component > 3) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
+ << vstate.VkErrorID(4920)
+ << "Component decoration value must not be greater than 3";
+ }
+
+ const auto dimension = vstate.GetDimension(type_id);
const auto bit_width = vstate.GetBitWidth(type_id);
if (bit_width == 16 || bit_width == 32) {
- assert(decoration.params().size() == 1 &&
- "Grammar ensures Component has one parameter");
-
- const auto component = decoration.params()[0];
- const auto last_component = component + vstate.GetDimension(type_id) - 1;
- if (last_component > 3) {
+ const auto sum_component = component + dimension;
+ if (sum_component > 4) {
return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
+ << vstate.VkErrorID(4921)
<< "Sequence of components starting with " << component
- << " and ending with " << last_component
+ << " and ending with " << (sum_component - 1)
+ << " gets larger than 3";
+ }
+ } else if (bit_width == 64) {
+ if (dimension > 2) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
+ << "Component decoration only allowed on 64-bit scalar and "
+ "2-component vector";
+ }
+ if (component == 1 || component == 3) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
+ << vstate.VkErrorID(4923)
+ << "Component decoration value must not be 1 or 3 for 64-bit "
+ "data types";
+ }
+ // 64-bit is double per component dimension
+ const auto sum_component = component + (2 * dimension);
+ if (sum_component > 4) {
+ return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
+ << vstate.VkErrorID(4922)
+ << "Sequence of components starting with " << component
+ << " and ending with " << (sum_component - 1)
<< " gets larger than 3";
}
}
@@ -1629,6 +1758,24 @@ spv_result_t CheckLocationDecoration(ValidationState_t& vstate,
"of a structure type";
}
+spv_result_t CheckRelaxPrecisionDecoration(ValidationState_t& vstate,
+ const Instruction& inst,
+ const Decoration& decoration) {
+ // This is not the most precise check, but the rules for RelaxPrecision are
+ // very general, and it will be difficult to implement precisely. For now,
+ // I will only check for the cases that cause problems for the optimizer.
+ if (!spvOpcodeGeneratesType(inst.opcode())) {
+ return SPV_SUCCESS;
+ }
+
+ if (decoration.struct_member_index() != Decoration::kInvalidMember &&
+ inst.opcode() == SpvOpTypeStruct) {
+ return SPV_SUCCESS;
+ }
+ return vstate.diag(SPV_ERROR_INVALID_ID, &inst)
+ << "RelaxPrecision decoration cannot be applied to a type";
+}
+
#define PASS_OR_BAIL_AT_LINE(X, LINE) \
{ \
spv_result_t e##LINE = (X); \
@@ -1683,6 +1830,10 @@ spv_result_t CheckDecorationsFromDecoration(ValidationState_t& vstate) {
case SpvDecorationLocation:
PASS_OR_BAIL(CheckLocationDecoration(vstate, *inst, decoration));
break;
+ case SpvDecorationRelaxedPrecision:
+ PASS_OR_BAIL(
+ CheckRelaxPrecisionDecoration(vstate, *inst, decoration));
+ break;
default:
break;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp
index 067cc964ce2..25b941abaf5 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_derivatives.cpp
@@ -79,11 +79,13 @@ spv_result_t DerivativesPass(ValidationState_t& _, const Instruction* inst) {
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) ==
- modes->end() &&
- modes->find(SpvExecutionModeDerivativeGroupQuadsNV) ==
- modes->end()) {
+ if (models &&
+ models->find(SpvExecutionModelGLCompute) != models->end() &&
+ (!modes ||
+ (modes->find(SpvExecutionModeDerivativeGroupLinearNV) ==
+ modes->end() &&
+ modes->find(SpvExecutionModeDerivativeGroupQuadsNV) ==
+ modes->end()))) {
if (message) {
*message = std::string(
"Derivative instructions require "
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_execution_limitations.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_execution_limitations.cpp
index aac1c4987ac..e1f4d7b042a 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_execution_limitations.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_execution_limitations.cpp
@@ -44,8 +44,8 @@ spv_result_t ValidateExecutionLimitations(ValidationState_t& _,
std::string reason;
if (!func->IsCompatibleWithExecutionModel(model, &reason)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpEntryPoint Entry Point <id> '" << _.getIdName(entry_id)
- << "'s callgraph contains function <id> "
+ << "OpEntryPoint Entry Point <id> " << _.getIdName(entry_id)
+ << "s callgraph contains function <id> "
<< _.getIdName(inst->id())
<< ", which cannot be used with the current execution "
"model:\n"
@@ -57,9 +57,8 @@ spv_result_t ValidateExecutionLimitations(ValidationState_t& _,
std::string reason;
if (!func->CheckLimitations(_, _.function(entry_id), &reason)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpEntryPoint Entry Point <id> '" << _.getIdName(entry_id)
- << "'s callgraph contains function <id> "
- << _.getIdName(inst->id())
+ << "OpEntryPoint Entry Point <id> " << _.getIdName(entry_id)
+ << "s callgraph contains function <id> " << _.getIdName(inst->id())
<< ", which cannot be used with the current execution "
"modes:\n"
<< reason;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_extensions.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_extensions.cpp
index dccbe14908d..1e69cb37f88 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_extensions.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_extensions.cpp
@@ -129,7 +129,7 @@ spv_result_t ValidateUint32ConstantOperandForDebugInfo(
}
// True if the operand of a debug info instruction |inst| at |word_index|
-// satisifies |expectation| that is given as a function. Otherwise,
+// satisfies |expectation| that is given as a function. Otherwise,
// returns false.
bool DoesDebugInfoOperandMatchExpectation(
const ValidationState_t& _,
@@ -147,6 +147,24 @@ bool DoesDebugInfoOperandMatchExpectation(
return true;
}
+// Overload for NonSemanticShaderDebugInfo100Instructions.
+bool DoesDebugInfoOperandMatchExpectation(
+ const ValidationState_t& _,
+ const std::function<bool(NonSemanticShaderDebugInfo100Instructions)>&
+ expectation,
+ 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 ||
+ (debug_inst->ext_inst_type() !=
+ SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100) ||
+ !expectation(
+ NonSemanticShaderDebugInfo100Instructions(debug_inst->word(4)))) {
+ return false;
+ }
+ return true;
+}
+
// Check that the operand of a debug info instruction |inst| at |word_index|
// is a result id of an debug info instruction whose debug instruction type
// is |expected_debug_inst|.
@@ -223,6 +241,18 @@ spv_result_t ValidateOperandDebugType(
const Instruction* inst, uint32_t word_index,
const std::function<std::string()>& ext_inst_name,
bool allow_template_param) {
+ // Check for NonSemanticShaderDebugInfo100 specific types.
+ if (inst->ext_inst_type() ==
+ SPV_EXT_INST_TYPE_NONSEMANTIC_SHADER_DEBUGINFO_100) {
+ std::function<bool(NonSemanticShaderDebugInfo100Instructions)> expectation =
+ [](NonSemanticShaderDebugInfo100Instructions dbg_inst) {
+ return dbg_inst == NonSemanticShaderDebugInfo100DebugTypeMatrix;
+ };
+ if (DoesDebugInfoOperandMatchExpectation(_, expectation, inst, word_index))
+ return SPV_SUCCESS;
+ }
+
+ // Check for common types.
std::function<bool(CommonDebugInfoInstructions)> expectation =
[&allow_template_param](CommonDebugInfoInstructions dbg_inst) {
if (allow_template_param &&
@@ -280,8 +310,7 @@ spv_result_t ValidateClspvReflectionKernel(ValidationState_t& _,
return _.diag(SPV_ERROR_INVALID_ID, inst) << "Name must be an OpString";
}
- const std::string name_str = reinterpret_cast<const char*>(
- name->words().data() + name->operands()[1].offset);
+ const std::string name_str = name->GetOperandAs<std::string>(1);
bool found = false;
for (auto& desc : _.entry_point_descriptions(kernel_id)) {
if (name_str == desc.name) {
@@ -727,10 +756,10 @@ spv_result_t ValidateExtension(ValidationState_t& _, const Instruction* inst) {
if (_.version() < SPV_SPIRV_VERSION_WORD(1, 4)) {
std::string extension = GetExtensionString(&(inst->c_inst()));
if (extension ==
- ExtensionToString(kSPV_KHR_workgroup_memory_explicit_layout)) {
+ ExtensionToString(kSPV_KHR_workgroup_memory_explicit_layout) ||
+ extension == ExtensionToString(kSPV_EXT_mesh_shader)) {
return _.diag(SPV_ERROR_WRONG_VERSION, inst)
- << "SPV_KHR_workgroup_memory_explicit_layout extension "
- "requires SPIR-V version 1.4 or later.";
+ << extension << " extension requires SPIR-V version 1.4 or later.";
}
}
@@ -740,9 +769,9 @@ spv_result_t ValidateExtension(ValidationState_t& _, const Instruction* inst) {
spv_result_t ValidateExtInstImport(ValidationState_t& _,
const Instruction* inst) {
const auto name_id = 1;
- if (!_.HasExtension(kSPV_KHR_non_semantic_info)) {
- const std::string name(reinterpret_cast<const char*>(
- inst->words().data() + inst->operands()[name_id].offset));
+ if (_.version() <= SPV_SPIRV_VERSION_WORD(1, 5) &&
+ !_.HasExtension(kSPV_KHR_non_semantic_info)) {
+ const std::string name = inst->GetOperandAs<std::string>(name_id);
if (name.find("NonSemantic.") == 0) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "NonSemantic extended instruction sets cannot be declared "
@@ -774,7 +803,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) {
assert(import_inst);
std::ostringstream ss;
- ss << reinterpret_cast<const char*>(import_inst->words().data() + 2);
+ ss << import_inst->GetOperandAs<std::string>(1);
ss << " ";
ss << desc->name;
@@ -2720,6 +2749,86 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) {
auto num_words = inst->words().size();
+ // Handle any non-common NonSemanticShaderDebugInfo instructions.
+ if (vulkanDebugInfo) {
+ const NonSemanticShaderDebugInfo100Instructions ext_inst_key =
+ NonSemanticShaderDebugInfo100Instructions(ext_inst_index);
+ switch (ext_inst_key) {
+ // The following block of instructions will be handled by the common
+ // validation.
+ case NonSemanticShaderDebugInfo100DebugInfoNone:
+ case NonSemanticShaderDebugInfo100DebugCompilationUnit:
+ case NonSemanticShaderDebugInfo100DebugTypeBasic:
+ case NonSemanticShaderDebugInfo100DebugTypePointer:
+ case NonSemanticShaderDebugInfo100DebugTypeQualifier:
+ case NonSemanticShaderDebugInfo100DebugTypeArray:
+ case NonSemanticShaderDebugInfo100DebugTypeVector:
+ case NonSemanticShaderDebugInfo100DebugTypedef:
+ case NonSemanticShaderDebugInfo100DebugTypeFunction:
+ case NonSemanticShaderDebugInfo100DebugTypeEnum:
+ case NonSemanticShaderDebugInfo100DebugTypeComposite:
+ case NonSemanticShaderDebugInfo100DebugTypeMember:
+ case NonSemanticShaderDebugInfo100DebugTypeInheritance:
+ case NonSemanticShaderDebugInfo100DebugTypePtrToMember:
+ case NonSemanticShaderDebugInfo100DebugTypeTemplate:
+ case NonSemanticShaderDebugInfo100DebugTypeTemplateParameter:
+ case NonSemanticShaderDebugInfo100DebugTypeTemplateTemplateParameter:
+ case NonSemanticShaderDebugInfo100DebugTypeTemplateParameterPack:
+ case NonSemanticShaderDebugInfo100DebugGlobalVariable:
+ case NonSemanticShaderDebugInfo100DebugFunctionDeclaration:
+ case NonSemanticShaderDebugInfo100DebugFunction:
+ case NonSemanticShaderDebugInfo100DebugLexicalBlock:
+ case NonSemanticShaderDebugInfo100DebugLexicalBlockDiscriminator:
+ case NonSemanticShaderDebugInfo100DebugScope:
+ case NonSemanticShaderDebugInfo100DebugNoScope:
+ case NonSemanticShaderDebugInfo100DebugInlinedAt:
+ case NonSemanticShaderDebugInfo100DebugLocalVariable:
+ case NonSemanticShaderDebugInfo100DebugInlinedVariable:
+ case NonSemanticShaderDebugInfo100DebugDeclare:
+ case NonSemanticShaderDebugInfo100DebugValue:
+ case NonSemanticShaderDebugInfo100DebugOperation:
+ case NonSemanticShaderDebugInfo100DebugExpression:
+ case NonSemanticShaderDebugInfo100DebugMacroDef:
+ case NonSemanticShaderDebugInfo100DebugMacroUndef:
+ case NonSemanticShaderDebugInfo100DebugImportedEntity:
+ case NonSemanticShaderDebugInfo100DebugSource:
+ break;
+ case NonSemanticShaderDebugInfo100DebugTypeMatrix: {
+ CHECK_DEBUG_OPERAND("Vector Type", CommonDebugInfoDebugTypeVector, 5);
+
+ CHECK_CONST_UINT_OPERAND("Vector Count", 6);
+
+ uint32_t vector_count = inst->word(6);
+ uint64_t const_val;
+ if (!_.GetConstantValUint64(vector_count, &const_val)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << ext_inst_name()
+ << ": Vector Count must be 32-bit integer OpConstant";
+ }
+
+ vector_count = const_val & 0xffffffff;
+ if (!vector_count || vector_count > 4) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << ext_inst_name() << ": Vector Count must be positive "
+ << "integer less than or equal to 4";
+ }
+ break;
+ }
+ // TODO: Add validation rules for remaining cases as well.
+ case NonSemanticShaderDebugInfo100DebugFunctionDefinition:
+ case NonSemanticShaderDebugInfo100DebugSourceContinued:
+ case NonSemanticShaderDebugInfo100DebugLine:
+ case NonSemanticShaderDebugInfo100DebugNoLine:
+ case NonSemanticShaderDebugInfo100DebugBuildIdentifier:
+ case NonSemanticShaderDebugInfo100DebugStoragePath:
+ case NonSemanticShaderDebugInfo100DebugEntryPoint:
+ break;
+ case NonSemanticShaderDebugInfo100InstructionsMax:
+ assert(0);
+ break;
+ }
+ }
+
// Handle any non-common OpenCL insts, then common
if (ext_inst_type != SPV_EXT_INST_TYPE_OPENCL_DEBUGINFO_100 ||
OpenCLDebugInfo100Instructions(ext_inst_index) !=
@@ -2805,8 +2914,9 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) {
bool invalid = false;
auto* component_count = _.FindDef(inst->word(i));
if (IsConstIntScalarTypeWith32Or64Bits(_, component_count)) {
- // TODO: We need a spec discussion for the bindless array.
- if (!component_count->word(3)) {
+ // TODO: We need a spec discussion for the runtime array for
+ // OpenCL.
+ if (!vulkanDebugInfo && !component_count->word(3)) {
invalid = true;
}
} else if (component_count->words().size() > 6 &&
@@ -3264,8 +3374,7 @@ spv_result_t ValidateExtInst(ValidationState_t& _, const Instruction* inst) {
}
} else if (ext_inst_type == SPV_EXT_INST_TYPE_NONSEMANTIC_CLSPVREFLECTION) {
auto import_inst = _.FindDef(inst->GetOperandAs<uint32_t>(2));
- const std::string name(reinterpret_cast<const char*>(
- import_inst->words().data() + import_inst->operands()[1].offset));
+ const std::string name = import_inst->GetOperandAs<std::string>(1);
const std::string reflection = "NonSemantic.ClspvReflection.";
char* end_ptr;
auto version_string = name.substr(reflection.size());
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_function.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_function.cpp
index 596186bbe6a..0ccf5a9ea3e 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_function.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_function.cpp
@@ -58,16 +58,16 @@ spv_result_t ValidateFunction(ValidationState_t& _, const Instruction* inst) {
const auto function_type = _.FindDef(function_type_id);
if (!function_type || SpvOpTypeFunction != function_type->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpFunction Function Type <id> '" << _.getIdName(function_type_id)
- << "' is not a function type.";
+ << "OpFunction Function Type <id> " << _.getIdName(function_type_id)
+ << " is not a function type.";
}
const auto return_id = function_type->GetOperandAs<uint32_t>(1);
if (return_id != inst->type_id()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpFunction Result Type <id> '" << _.getIdName(inst->type_id())
- << "' does not match the Function Type's return type <id> '"
- << _.getIdName(return_id) << "'.";
+ << "OpFunction Result Type <id> " << _.getIdName(inst->type_id())
+ << " does not match the Function Type's return type <id> "
+ << _.getIdName(return_id) << ".";
}
const std::vector<SpvOp> acceptable = {
@@ -141,14 +141,14 @@ spv_result_t ValidateFunctionParameter(ValidationState_t& _,
_.FindDef(function_type->GetOperandAs<uint32_t>(param_index + 2));
if (!param_type || inst->type_id() != param_type->id()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpFunctionParameter Result Type <id> '"
+ << "OpFunctionParameter Result Type <id> "
<< _.getIdName(inst->type_id())
- << "' does not match the OpTypeFunction parameter "
+ << " does not match the OpTypeFunction parameter "
"type of the same index.";
}
- // Validate that PhysicalStorageBufferEXT have one of Restrict, Aliased,
- // RestrictPointerEXT, or AliasedPointerEXT.
+ // 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) {
param_nonarray_type_id =
@@ -157,7 +157,7 @@ spv_result_t ValidateFunctionParameter(ValidationState_t& _,
if (_.GetIdOpcode(param_nonarray_type_id) == SpvOpTypePointer) {
auto param_nonarray_type = _.FindDef(param_nonarray_type_id);
if (param_nonarray_type->GetOperandAs<uint32_t>(1u) ==
- SpvStorageClassPhysicalStorageBufferEXT) {
+ SpvStorageClassPhysicalStorageBuffer) {
// check for Aliased or Restrict
const auto& decorations = _.id_decorations(inst->id());
@@ -174,14 +174,14 @@ spv_result_t ValidateFunctionParameter(ValidationState_t& _,
if (!foundAliased && !foundRestrict) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpFunctionParameter " << inst->id()
- << ": expected Aliased or Restrict for PhysicalStorageBufferEXT "
+ << ": expected Aliased or Restrict for PhysicalStorageBuffer "
"pointer.";
}
if (foundAliased && foundRestrict) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpFunctionParameter " << inst->id()
<< ": can't specify both Aliased and Restrict for "
- "PhysicalStorageBufferEXT pointer.";
+ "PhysicalStorageBuffer pointer.";
}
} else {
const auto pointee_type_id =
@@ -189,31 +189,31 @@ spv_result_t ValidateFunctionParameter(ValidationState_t& _,
const auto pointee_type = _.FindDef(pointee_type_id);
if (SpvOpTypePointer == pointee_type->opcode() &&
pointee_type->GetOperandAs<uint32_t>(1u) ==
- SpvStorageClassPhysicalStorageBufferEXT) {
- // check for AliasedPointerEXT/RestrictPointerEXT
+ SpvStorageClassPhysicalStorageBuffer) {
+ // check for AliasedPointer/RestrictPointer
const auto& decorations = _.id_decorations(inst->id());
bool foundAliased = std::any_of(
decorations.begin(), decorations.end(), [](const Decoration& d) {
- return SpvDecorationAliasedPointerEXT == d.dec_type();
+ return SpvDecorationAliasedPointer == d.dec_type();
});
bool foundRestrict = std::any_of(
decorations.begin(), decorations.end(), [](const Decoration& d) {
- return SpvDecorationRestrictPointerEXT == d.dec_type();
+ return SpvDecorationRestrictPointer == d.dec_type();
});
if (!foundAliased && !foundRestrict) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpFunctionParameter " << inst->id()
- << ": expected AliasedPointerEXT or RestrictPointerEXT for "
- "PhysicalStorageBufferEXT pointer.";
+ << ": expected AliasedPointer or RestrictPointer for "
+ "PhysicalStorageBuffer pointer.";
}
if (foundAliased && foundRestrict) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpFunctionParameter " << inst->id()
- << ": can't specify both AliasedPointerEXT and "
- "RestrictPointerEXT for PhysicalStorageBufferEXT pointer.";
+ << ": can't specify both AliasedPointer and "
+ "RestrictPointer for PhysicalStorageBuffer pointer.";
}
}
}
@@ -228,17 +228,16 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _,
const auto function = _.FindDef(function_id);
if (!function || SpvOpFunction != function->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpFunctionCall Function <id> '" << _.getIdName(function_id)
- << "' is not a function.";
+ << "OpFunctionCall Function <id> " << _.getIdName(function_id)
+ << " is not a function.";
}
auto return_type = _.FindDef(function->type_id());
if (!return_type || return_type->id() != inst->type_id()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpFunctionCall Result Type <id> '"
- << _.getIdName(inst->type_id())
- << "'s type does not match Function <id> '"
- << _.getIdName(return_type->id()) << "'s return type.";
+ << "OpFunctionCall Result Type <id> " << _.getIdName(inst->type_id())
+ << "s type does not match Function <id> "
+ << _.getIdName(return_type->id()) << "s return type.";
}
const auto function_type_id = function->GetOperandAs<uint32_t>(3);
@@ -280,9 +279,9 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _,
if (!_.options()->before_hlsl_legalization ||
!DoPointeesLogicallyMatch(argument_type, parameter_type, _)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpFunctionCall Argument <id> '" << _.getIdName(argument_id)
- << "'s type does not match Function <id> '"
- << _.getIdName(parameter_type_id) << "'s parameter type.";
+ << "OpFunctionCall Argument <id> " << _.getIdName(argument_id)
+ << "s type does not match Function <id> "
+ << _.getIdName(parameter_type_id) << "s parameter type.";
}
}
@@ -300,7 +299,7 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _,
// These are always allowed.
break;
case SpvStorageClassStorageBuffer:
- if (!_.features().variable_pointers_storage_buffer) {
+ if (!_.features().variable_pointers) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "StorageBuffer pointer operand "
<< _.getIdName(argument_id)
@@ -316,11 +315,10 @@ spv_result_t ValidateFunctionCall(ValidationState_t& _,
// Validate memory object declaration requirements.
if (argument->opcode() != SpvOpVariable &&
argument->opcode() != SpvOpFunctionParameter) {
- const bool ssbo_vptr =
- _.features().variable_pointers_storage_buffer &&
- sc == SpvStorageClassStorageBuffer;
- const bool wg_vptr =
- _.features().variable_pointers && sc == SpvStorageClassWorkgroup;
+ const bool ssbo_vptr = _.features().variable_pointers &&
+ sc == SpvStorageClassStorageBuffer;
+ const bool wg_vptr = _.HasCapability(SpvCapabilityVariablePointers) &&
+ sc == SpvStorageClassWorkgroup;
const bool uc_ptr = sc == SpvStorageClassUniformConstant;
if (!ssbo_vptr && !wg_vptr && !uc_ptr) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_image.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_image.cpp
index e5968d06e7d..9c7c8c1c123 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_image.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_image.cpp
@@ -1,4 +1,4 @@
-// Copyright (c) 2017 Google Inc.
+// Copyright (c) 2017 Google Inc.
// Modifications Copyright (C) 2020 Advanced Micro Devices, Inc. All rights
// reserved.
//
@@ -20,6 +20,7 @@
#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"
@@ -66,6 +67,12 @@ bool CheckAllImageOperandsHandled() {
case SpvImageOperandsVolatileTexelKHRMask:
case SpvImageOperandsSignExtendMask:
case SpvImageOperandsZeroExtendMask:
+ // 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:
return true;
}
return false;
@@ -253,7 +260,8 @@ spv_result_t ValidateImageOperands(ValidationState_t& _,
mask & ~uint32_t(SpvImageOperandsNonPrivateTexelKHRMask |
SpvImageOperandsVolatileTexelKHRMask |
SpvImageOperandsSignExtendMask |
- SpvImageOperandsZeroExtendMask);
+ SpvImageOperandsZeroExtendMask |
+ SpvImageOperandsNontemporalMask);
size_t expected_num_image_operand_words =
spvtools::utils::CountSetBits(mask_bits_having_operands);
if (mask & SpvImageOperandsGradMask) {
@@ -281,13 +289,14 @@ 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)) > 1) {
+ if (spvtools::utils::CountSetBits(mask & (SpvImageOperandsOffsetMask |
+ SpvImageOperandsConstOffsetMask |
+ SpvImageOperandsConstOffsetsMask |
+ SpvImageOperandsOffsetsMask)) > 1) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< _.VkErrorID(4662)
- << "Image Operands Offset, ConstOffset, ConstOffsets cannot be used "
- << "together";
+ << "Image Operands Offset, ConstOffset, ConstOffsets, Offsets "
+ "cannot be used together";
}
const bool is_implicit_lod = IsImplicitLod(opcode);
@@ -494,7 +503,7 @@ spv_result_t ValidateImageOperands(ValidationState_t& _,
if (!_.IsIntVectorType(component_type) ||
_.GetDimension(component_type) != 2) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Image Operand ConstOffsets array componenets to be "
+ << "Expected Image Operand ConstOffsets array components to be "
"int vectors of size 2";
}
@@ -620,68 +629,75 @@ spv_result_t ValidateImageOperands(ValidationState_t& _,
// setup.
}
+ if (mask & SpvImageOperandsOffsetsMask) {
+ // TODO: add validation
+ }
+
+ if (mask & SpvImageOperandsNontemporalMask) {
+ // Checked elsewhere: SPIR-V 1.6 version or later.
+ }
+
return SPV_SUCCESS;
}
-// Checks some of the validation rules which are common to multiple opcodes.
-spv_result_t ValidateImageCommon(ValidationState_t& _, const Instruction* inst,
- const ImageTypeInfo& info) {
- const SpvOp opcode = inst->opcode();
- if (IsProj(opcode)) {
- if (info.dim != SpvDim1D && info.dim != SpvDim2D && info.dim != SpvDim3D &&
- info.dim != SpvDimRect) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Image 'Dim' parameter to be 1D, 2D, 3D or Rect";
- }
+// 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) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Image 'Dim' parameter to be 1D, 2D, 3D or Rect";
+ }
- if (info.multisampled != 0) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Image 'MS' parameter to be 0";
- }
+ if (info.multisampled != 0) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Image 'MS' parameter to be 0";
+ }
- if (info.arrayed != 0) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Image 'arrayed' parameter to be 0";
- }
+ if (info.arrayed != 0) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Image 'arrayed' parameter to be 0";
}
- if (opcode == SpvOpImageRead || opcode == SpvOpImageSparseRead ||
- opcode == SpvOpImageWrite) {
- if (info.sampled == 0) {
- } else if (info.sampled == 2) {
- if (info.dim == SpvDim1D && !_.HasCapability(SpvCapabilityImage1D)) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Capability Image1D is required to access storage image";
- } else if (info.dim == SpvDimRect &&
- !_.HasCapability(SpvCapabilityImageRect)) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Capability ImageRect is required to access storage image";
- } else if (info.dim == SpvDimBuffer &&
- !_.HasCapability(SpvCapabilityImageBuffer)) {
- 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)) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Capability ImageCubeArray is required to access "
- << "storage image";
- }
+ return SPV_SUCCESS;
+}
- if (info.multisampled == 1 &&
- !_.HasCapability(SpvCapabilityImageMSArray)) {
+// Validate OpImage*Read and OpImage*Write instructions
+spv_result_t ValidateImageReadWrite(ValidationState_t& _,
+ const Instruction* inst,
+ const ImageTypeInfo& info) {
+ if (info.sampled == 2) {
+ if (info.dim == SpvDim1D && !_.HasCapability(SpvCapabilityImage1D)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Capability Image1D is required to access storage image";
+ } else if (info.dim == SpvDimRect &&
+ !_.HasCapability(SpvCapabilityImageRect)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Capability ImageRect is required to access storage image";
+ } else if (info.dim == SpvDimBuffer &&
+ !_.HasCapability(SpvCapabilityImageBuffer)) {
+ 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)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Capability ImageCubeArray is required to access "
+ << "storage image";
+ }
+
+ if (info.multisampled == 1 && !_.HasCapability(SpvCapabilityImageMSArray)) {
#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
- // and reenable.
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Capability ImageMSArray is required to access storage "
- << "image";
-#endif
- }
- } else {
+ // TODO(atgoo@github.com) The description of this rule in the spec
+ // is unclear and Glslang doesn't declare ImageMSArray. Need to clarify
+ // and reenable.
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Image 'Sampled' parameter to be 0 or 2";
+ << "Capability ImageMSArray is required to access storage "
+ << "image";
+#endif
}
+ } else if (info.sampled != 0) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Image 'Sampled' parameter to be 0 or 2";
}
return SPV_SUCCESS;
@@ -796,7 +812,8 @@ spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) {
}
}
- // Dim is checked elsewhere.
+ // Universal checks on image type operands
+ // Dim and Format and Access Qualifier are checked elsewhere.
if (info.depth > 2) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
@@ -808,62 +825,53 @@ spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) {
<< "Invalid Arrayed " << info.arrayed << " (must be 0 or 1)";
}
- if (spvIsOpenCLEnv(target_env)) {
- if ((info.arrayed == 1) && (info.dim != SpvDim1D) &&
- (info.dim != SpvDim2D)) {
- 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.";
- }
- }
-
if (info.multisampled > 1) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Invalid MS " << info.multisampled << " (must be 0 or 1)";
}
- if (spvIsOpenCLEnv(target_env)) {
- if (info.multisampled != 0) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "MS must be 0 in the OpenCL environment.";
- }
- }
-
if (info.sampled > 2) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Invalid Sampled " << info.sampled << " (must be 0, 1 or 2)";
}
- if (spvIsVulkanEnv(target_env)) {
- if (info.sampled == 0) {
+ if (info.dim == SpvDimSubpassData) {
+ if (info.sampled != 2) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << _.VkErrorID(4657)
- << "Sampled must be 1 or 2 in the Vulkan environment.";
+ << _.VkErrorID(6214) << "Dim SubpassData requires Sampled to be 2";
}
- }
- if (spvIsOpenCLEnv(_.context()->target_env)) {
- if (info.sampled != 0) {
+ if (info.format != SpvImageFormatUnknown) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Sampled must be 0 in the OpenCL environment.";
+ << "Dim SubpassData requires format Unknown";
+ }
+ } else {
+ if (info.multisampled && (info.sampled == 2) &&
+ !_.HasCapability(SpvCapabilityStorageImageMultisample)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Capability StorageImageMultisample is required when using "
+ "multisampled storage image";
}
}
- if (info.dim == SpvDimSubpassData) {
- if (info.sampled != 2) {
+ if (spvIsOpenCLEnv(target_env)) {
+ if ((info.arrayed == 1) && (info.dim != SpvDim1D) &&
+ (info.dim != SpvDim2D)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Dim SubpassData requires Sampled to be 2";
+ << "In the OpenCL environment, Arrayed may only be set to 1 "
+ << "when Dim is either 1D or 2D.";
}
- if (info.format != SpvImageFormatUnknown) {
+ if (info.multisampled != 0) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Dim SubpassData requires format Unknown";
+ << "MS must be 0 in the OpenCL environment.";
}
- }
- // Format and Access Qualifier are also checked elsewhere.
+ if (info.sampled != 0) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Sampled must be 0 in the OpenCL environment.";
+ }
- if (spvIsOpenCLEnv(_.context()->target_env)) {
if (info.access_qualifier == SpvAccessQualifierMax) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "In the OpenCL environment, the optional Access Qualifier"
@@ -871,12 +879,16 @@ spv_result_t ValidateTypeImage(ValidationState_t& _, const Instruction* inst) {
}
}
- if (info.multisampled && (info.sampled == 2) &&
- (info.dim != SpvDimSubpassData)) {
- if (!_.HasCapability(SpvCapabilityStorageImageMultisample)) {
+ if (spvIsVulkanEnv(target_env)) {
+ if (info.sampled == 0) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Capability StorageImageMultisample is required when using "
- "multisampled storage image";
+ << _.VkErrorID(4657)
+ << "Sampled must be 1 or 2 in the Vulkan environment.";
+ }
+
+ if (info.dim == SpvDimSubpassData && info.arrayed != 0) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << _.VkErrorID(6214) << "Dim SubpassData requires Arrayed to be 0";
}
}
@@ -905,10 +917,17 @@ spv_result_t ValidateTypeSampledImage(ValidationState_t& _,
"operand set to 0 or 1";
}
+ // This covers both OpTypeSampledImage and OpSampledImage.
+ if (_.version() >= SPV_SPIRV_VERSION_WORD(1, 6) && info.dim == SpvDimBuffer) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "In SPIR-V 1.6 or later, sampled image dimension must not be "
+ "Buffer";
+ }
+
return SPV_SUCCESS;
}
-bool IsAllowedSampledImageOperand(SpvOp opcode) {
+bool IsAllowedSampledImageOperand(SpvOp opcode, ValidationState_t& _) {
switch (opcode) {
case SpvOpSampledImage:
case SpvOpImageSampleImplicitLod:
@@ -931,6 +950,9 @@ bool IsAllowedSampledImageOperand(SpvOp opcode) {
case SpvOpImageSparseDrefGather:
case SpvOpCopyObject:
return true;
+ case SpvOpStore:
+ if (_.HasCapability(SpvCapabilityBindlessTextureNV)) return true;
+ return false;
default:
return false;
}
@@ -961,8 +983,9 @@ spv_result_t ValidateSampledImage(ValidationState_t& _,
if (spvIsVulkanEnv(_.context()->target_env)) {
if (info.sampled != 1) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Image 'Sampled' parameter to be 1 "
- << "for Vulkan environment.";
+ << _.VkErrorID(6671)
+ << "Expected Image 'Sampled' parameter to be 1 for Vulkan "
+ "environment.";
}
} else {
if (info.sampled != 0 && info.sampled != 1) {
@@ -997,11 +1020,11 @@ spv_result_t ValidateSampledImage(ValidationState_t& _,
<< "All OpSampledImage instructions must be in the same block "
"in "
"which their Result <id> are consumed. OpSampledImage Result "
- "Type <id> '"
+ "Type <id> "
<< _.getIdName(inst->id())
- << "' has a consumer in a different basic "
- "block. The consumer instruction <id> is '"
- << _.getIdName(consumer_instr->id()) << "'.";
+ << " has a consumer in a different basic "
+ "block. The consumer instruction <id> is "
+ << _.getIdName(consumer_instr->id()) << ".";
}
if (consumer_opcode == SpvOpPhi || consumer_opcode == SpvOpSelect) {
@@ -1010,21 +1033,21 @@ spv_result_t ValidateSampledImage(ValidationState_t& _,
"as "
"operands of Op"
<< spvOpcodeString(static_cast<SpvOp>(consumer_opcode)) << "."
- << " Found result <id> '" << _.getIdName(inst->id())
- << "' as an operand of <id> '"
- << _.getIdName(consumer_instr->id()) << "'.";
+ << " Found result <id> " << _.getIdName(inst->id())
+ << " as an operand of <id> " << _.getIdName(consumer_instr->id())
+ << ".";
}
- if (!IsAllowedSampledImageOperand(consumer_opcode)) {
+ if (!IsAllowedSampledImageOperand(consumer_opcode, _)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Result <id> from OpSampledImage instruction must not appear "
"as operand for Op"
<< spvOpcodeString(static_cast<SpvOp>(consumer_opcode))
- << ", since it is not specificed as taking an "
+ << ", since it is not specified as taking an "
<< "OpTypeSampledImage."
- << " Found result <id> '" << _.getIdName(inst->id())
- << "' as an operand of <id> '"
- << _.getIdName(consumer_instr->id()) << "'.";
+ << " Found result <id> " << _.getIdName(inst->id())
+ << " as an operand of <id> " << _.getIdName(consumer_instr->id())
+ << ".";
}
}
}
@@ -1181,7 +1204,9 @@ spv_result_t ValidateImageLod(ValidationState_t& _, const Instruction* inst) {
<< "Corrupt image type definition";
}
- if (spv_result_t result = ValidateImageCommon(_, inst, info)) return result;
+ if (IsProj(opcode)) {
+ if (spv_result_t result = ValidateImageProj(_, inst, info)) return result;
+ }
if (info.multisampled) {
// When using image operands, the Sample image operand is required if and
@@ -1244,6 +1269,27 @@ spv_result_t ValidateImageLod(ValidationState_t& _, const Instruction* inst) {
return SPV_SUCCESS;
}
+// Validates anything OpImage*Dref* instruction
+spv_result_t ValidateImageDref(ValidationState_t& _, const Instruction* inst,
+ const ImageTypeInfo& info) {
+ const uint32_t dref_type = _.GetOperandTypeId(inst, 4);
+ if (!_.IsFloatScalarType(dref_type) || _.GetBitWidth(dref_type) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Dref to be of 32-bit float type";
+ }
+
+ if (spvIsVulkanEnv(_.context()->target_env)) {
+ if (info.dim == SpvDim3D) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << _.VkErrorID(4777)
+ << "In Vulkan, OpImage*Dref* instructions must not use images "
+ "with a 3D Dim";
+ }
+ }
+
+ return SPV_SUCCESS;
+}
+
spv_result_t ValidateImageDrefLod(ValidationState_t& _,
const Instruction* inst) {
const SpvOp opcode = inst->opcode();
@@ -1271,7 +1317,9 @@ spv_result_t ValidateImageDrefLod(ValidationState_t& _,
<< "Corrupt image type definition";
}
- if (spv_result_t result = ValidateImageCommon(_, inst, info)) return result;
+ if (IsProj(opcode)) {
+ if (spv_result_t result = ValidateImageProj(_, inst, info)) return result;
+ }
if (info.multisampled) {
// When using image operands, the Sample image operand is required if and
@@ -1301,11 +1349,7 @@ spv_result_t ValidateImageDrefLod(ValidationState_t& _,
<< " components, but given only " << actual_coord_size;
}
- const uint32_t dref_type = _.GetOperandTypeId(inst, 4);
- if (!_.IsFloatScalarType(dref_type) || _.GetBitWidth(dref_type) != 32) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Dref to be of 32-bit float type";
- }
+ if (spv_result_t result = ValidateImageDref(_, inst, info)) return result;
if (spv_result_t result =
ValidateImageOperands(_, inst, info, /* word_index = */ 7))
@@ -1440,7 +1484,8 @@ spv_result_t ValidateImageGather(ValidationState_t& _,
if (info.dim != SpvDim2D && info.dim != SpvDimCube &&
info.dim != SpvDimRect) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Image 'Dim' cannot be Cube";
+ << _.VkErrorID(4777)
+ << "Expected Image 'Dim' to be 2D, Cube, or Rect";
}
const uint32_t coord_type = _.GetOperandTypeId(inst, 3);
@@ -1476,11 +1521,7 @@ spv_result_t ValidateImageGather(ValidationState_t& _,
} else {
assert(opcode == SpvOpImageDrefGather ||
opcode == SpvOpImageSparseDrefGather);
- const uint32_t dref_type = _.GetOperandTypeId(inst, 4);
- if (!_.IsFloatScalarType(dref_type) || _.GetBitWidth(dref_type) != 32) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Dref to be of 32-bit float type";
- }
+ if (spv_result_t result = ValidateImageDref(_, inst, info)) return result;
}
if (spv_result_t result =
@@ -1548,6 +1589,13 @@ spv_result_t ValidateImageRead(ValidationState_t& _, const Instruction* inst) {
<< " to have 4 components";
}
}
+
+ const uint32_t mask = inst->words().size() <= 5 ? 0 : inst->word(5);
+ if (mask & SpvImageOperandsConstOffsetMask) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "ConstOffset image operand not allowed "
+ << "in the OpenCL environment.";
+ }
}
if (info.dim == SpvDimSubpassData) {
@@ -1573,7 +1621,8 @@ spv_result_t ValidateImageRead(ValidationState_t& _, const Instruction* inst) {
}
}
- if (spv_result_t result = ValidateImageCommon(_, inst, info)) return result;
+ if (spv_result_t result = ValidateImageReadWrite(_, inst, info))
+ return result;
const uint32_t coord_type = _.GetOperandTypeId(inst, 3);
if (!_.IsIntScalarOrVectorType(coord_type)) {
@@ -1598,16 +1647,6 @@ 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 (spvIsOpenCLEnv(_.context()->target_env)) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "ConstOffset image operand not allowed "
- << "in the OpenCL environment.";
- }
- }
-
if (spv_result_t result =
ValidateImageOperands(_, inst, info, /* word_index = */ 6))
return result;
@@ -1633,7 +1672,8 @@ spv_result_t ValidateImageWrite(ValidationState_t& _, const Instruction* inst) {
<< "Image 'Dim' cannot be SubpassData";
}
- if (spv_result_t result = ValidateImageCommon(_, inst, info)) return result;
+ if (spv_result_t result = ValidateImageReadWrite(_, inst, info))
+ return result;
const uint32_t coord_type = _.GetOperandTypeId(inst, 1);
if (!_.IsIntScalarOrVectorType(coord_type)) {
@@ -1649,8 +1689,7 @@ spv_result_t ValidateImageWrite(ValidationState_t& _, const Instruction* inst) {
<< " components, but given only " << actual_coord_size;
}
- // TODO(atgoo@github.com) The spec doesn't explicitely say what the type
- // of texel should be.
+ // because it needs to match with 'Sampled Type' the Texel can't be a boolean
const uint32_t texel_type = _.GetOperandTypeId(inst, 2);
if (!_.IsIntScalarOrVectorType(texel_type) &&
!_.IsFloatScalarOrVectorType(texel_type)) {
@@ -1658,14 +1697,6 @@ spv_result_t ValidateImageWrite(ValidationState_t& _, const Instruction* inst) {
<< "Expected Texel to be int or float vector or scalar";
}
-#if 0
- // TODO: See above.
- if (_.GetDimension(texel_type) != 4) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Expected Texel to have 4 components";
- }
-#endif
-
if (_.GetIdOpcode(info.sampled_type) != SpvOpTypeVoid) {
const uint32_t texel_component_type = _.GetComponentType(texel_type);
if (texel_component_type != info.sampled_type) {
@@ -2058,11 +2089,13 @@ spv_result_t ImagePass(ValidationState_t& _, const Instruction* inst) {
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) ==
- modes->end() &&
- modes->find(SpvExecutionModeDerivativeGroupQuadsNV) ==
- modes->end()) {
+ if (models &&
+ models->find(SpvExecutionModelGLCompute) != models->end() &&
+ (!modes ||
+ (modes->find(SpvExecutionModeDerivativeGroupLinearNV) ==
+ modes->end() &&
+ modes->find(SpvExecutionModeDerivativeGroupQuadsNV) ==
+ modes->end()))) {
if (message) {
*message =
std::string(
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_instruction.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_instruction.cpp
index 9d395fb46be..767c0cee10f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_instruction.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_instruction.cpp
@@ -297,7 +297,7 @@ spv_result_t VersionCheck(ValidationState_t& _, const Instruction* inst) {
}
// OpTerminateInvocation is special because it is enabled by Shader
- // capability, but also requries a extension and/or version check.
+ // capability, but also requires an extension and/or version check.
const bool capability_check_is_sufficient =
inst->opcode() != SpvOpTerminateInvocation;
@@ -318,10 +318,9 @@ spv_result_t VersionCheck(ValidationState_t& _, const Instruction* inst) {
if (module_version < min_version) {
return _.diag(SPV_ERROR_WRONG_VERSION, inst)
- << spvOpcodeString(opcode) << " requires "
- << spvTargetEnvDescription(
- static_cast<spv_target_env>(min_version))
- << " at minimum.";
+ << spvOpcodeString(opcode) << " requires SPIR-V version "
+ << SPV_SPIRV_VERSION_MAJOR_PART(min_version) << "."
+ << SPV_SPIRV_VERSION_MINOR_PART(min_version) << " at minimum.";
}
} else if (!_.HasAnyOfExtensions(exts)) {
// Otherwise, we only error out when no enabling extensions are
@@ -407,7 +406,7 @@ spv_result_t LimitCheckSwitch(ValidationState_t& _, const Instruction* inst) {
// The instruction syntax is as follows:
// OpSwitch <selector ID> <Default ID> literal label literal label ...
// literal,label pairs come after the first 2 operands.
- // It is guaranteed at this point that num_operands is an even numner.
+ // It is guaranteed at this point that num_operands is an even number.
size_t num_pairs = (inst->operands().size() - 2) / 2;
const unsigned int num_pairs_limit =
_.options()->universal_limits_.max_switch_branches;
@@ -484,6 +483,22 @@ spv_result_t InstructionPass(ValidationState_t& _, const Instruction* inst) {
if (auto error = LimitCheckNumVars(_, inst->id(), storage_class)) {
return error;
}
+ } else if (opcode == SpvOpSamplerImageAddressingModeNV) {
+ if (!_.HasCapability(SpvCapabilityBindlessTextureNV)) {
+ return _.diag(SPV_ERROR_MISSING_EXTENSION, inst)
+ << "OpSamplerImageAddressingModeNV supported only with extension "
+ "SPV_NV_bindless_texture";
+ }
+ uint32_t bitwidth = inst->GetOperandAs<uint32_t>(0);
+ if (_.samplerimage_variable_address_mode() != 0) {
+ return _.diag(SPV_ERROR_INVALID_LAYOUT, inst)
+ << "OpSamplerImageAddressingModeNV should only be provided once";
+ }
+ if (bitwidth != 32 && bitwidth != 64) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "OpSamplerImageAddressingModeNV bitwidth should be 64 or 32";
+ }
+ _.set_samplerimage_variable_address_mode(bitwidth);
}
if (auto error = ReservedCheck(_, inst)) return error;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_interfaces.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_interfaces.cpp
index d3ef5386c82..7f2d6488c48 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_interfaces.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_interfaces.cpp
@@ -154,7 +154,7 @@ spv_result_t NumConsumedLocations(ValidationState_t& _, const Instruction* type,
// Members cannot have location decorations at this point.
if (_.HasDecoration(type->id(), SpvDecorationLocation)) {
return _.diag(SPV_ERROR_INVALID_DATA, type)
- << "Members cannot be assigned a location";
+ << _.VkErrorID(4918) << "Members cannot be assigned a location";
}
// Structs consume locations equal to the sum of the locations consumed
@@ -199,6 +199,10 @@ uint32_t NumConsumedComponents(ValidationState_t& _, const Instruction* type) {
NumConsumedComponents(_, _.FindDef(type->GetOperandAs<uint32_t>(1)));
num_components *= type->GetOperandAs<uint32_t>(2);
break;
+ case SpvOpTypeArray:
+ // Skip the array.
+ return NumConsumedComponents(_,
+ _.FindDef(type->GetOperandAs<uint32_t>(1)));
default:
// This is an error that is validated elsewhere.
break;
@@ -234,7 +238,7 @@ spv_result_t GetLocationsForVariable(
uint32_t index = 0;
bool has_patch = false;
bool has_per_task_nv = false;
- bool has_per_vertex_nv = false;
+ bool has_per_vertex_khr = false;
for (auto& dec : _.id_decorations(variable->id())) {
if (dec.dec_type() == SpvDecorationLocation) {
if (has_location && dec.params()[0] != location) {
@@ -268,8 +272,20 @@ spv_result_t GetLocationsForVariable(
has_patch = true;
} else if (dec.dec_type() == SpvDecorationPerTaskNV) {
has_per_task_nv = true;
- } else if (dec.dec_type() == SpvDecorationPerVertexNV) {
- has_per_vertex_nv = true;
+ } else if (dec.dec_type() == SpvDecorationPerVertexKHR) {
+ 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) {
+ return _.diag(SPV_ERROR_INVALID_DATA, variable)
+ << _.VkErrorID(6778)
+ << "PerVertexKHR must be declared as arrays";
+ }
+ has_per_vertex_khr = true;
}
}
@@ -294,7 +310,7 @@ spv_result_t GetLocationsForVariable(
}
break;
case SpvExecutionModelFragment:
- if (!is_output && has_per_vertex_nv) {
+ if (!is_output && has_per_vertex_khr) {
is_arrayed = true;
}
break;
@@ -322,8 +338,9 @@ spv_result_t GetLocationsForVariable(
// Only block-decorated structs don't need a location on the variable.
const bool is_block = _.HasDecoration(type_id, SpvDecorationBlock);
if (!has_location && !is_block) {
+ const auto vuid = (type->opcode() == SpvOpTypeStruct) ? 4917 : 4916;
return _.diag(SPV_ERROR_INVALID_DATA, variable)
- << "Variable must be decorated with a location";
+ << _.VkErrorID(vuid) << "Variable must be decorated with a location";
}
const std::string storage_class = is_output ? "output" : "input";
@@ -407,7 +424,7 @@ spv_result_t GetLocationsForVariable(
auto where = member_locations.find(i - 1);
if (where == member_locations.end()) {
return _.diag(SPV_ERROR_INVALID_DATA, type)
- << "Member index " << i - 1
+ << _.VkErrorID(4919) << "Member index " << i - 1
<< " is missing a location assignment";
}
@@ -430,17 +447,36 @@ spv_result_t GetLocationsForVariable(
continue;
}
- uint32_t end = (location + num_locations) * 4;
- if (num_components != 0) {
- start += component;
- end = location * 4 + component + num_components;
- }
- for (uint32_t l = start; l < end; ++l) {
- if (!locations->insert(l).second) {
- return _.diag(SPV_ERROR_INVALID_DATA, entry_point)
- << "Entry-point has conflicting " << storage_class
- << " location assignment at location " << l / 4
- << ", component " << l % 4;
+ if (member->opcode() == SpvOpTypeArray && 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.
+ for (uint32_t l = location; l < num_locations + location; ++l) {
+ for (uint32_t c = component; c < component + num_components; ++c) {
+ uint32_t check = 4 * l + c;
+ if (!locations->insert(check).second) {
+ return _.diag(SPV_ERROR_INVALID_DATA, entry_point)
+ << "Entry-point has conflicting " << storage_class
+ << " location assignment at location " << l
+ << ", component " << c;
+ }
+ }
+ }
+ } else {
+ // TODO: There is a hole here is the member is an array of 3- or
+ // 4-element vectors of 64-bit types.
+ uint32_t end = (location + num_locations) * 4;
+ if (num_components != 0) {
+ start += component;
+ end = location * 4 + component + num_components;
+ }
+ for (uint32_t l = start; l < end; ++l) {
+ if (!locations->insert(l).second) {
+ return _.diag(SPV_ERROR_INVALID_DATA, entry_point)
+ << "Entry-point has conflicting " << storage_class
+ << " location assignment at location " << l / 4
+ << ", component " << l % 4;
+ }
}
}
}
@@ -453,6 +489,9 @@ spv_result_t ValidateLocations(ValidationState_t& _,
const Instruction* entry_point) {
// According to Vulkan 14.1 only the following execution models have
// locations assigned.
+ // 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<SpvExecutionModel>(0)) {
case SpvExecutionModelVertex:
case SpvExecutionModelTessellationControl:
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_layout.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_layout.cpp
index d5823219d93..6f9513523ef 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_layout.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_layout.cpp
@@ -363,6 +363,7 @@ spv_result_t ModuleLayoutPass(ValidationState_t& _, const Instruction* inst) {
case kLayoutExtensions:
case kLayoutExtInstImport:
case kLayoutMemoryModel:
+ case kLayoutSamplerImageAddressMode:
case kLayoutEntryPoint:
case kLayoutExecutionMode:
case kLayoutDebug1:
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_logicals.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_logicals.cpp
index bb35f558ec4..ec1e207be1f 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_logicals.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_logicals.cpp
@@ -163,14 +163,23 @@ spv_result_t LogicalsPass(ValidationState_t& _, const Instruction* inst) {
switch (type_opcode) {
case SpvOpTypePointer: {
if (_.addressing_model() == SpvAddressingModelLogical &&
- !_.features().variable_pointers &&
- !_.features().variable_pointers_storage_buffer)
+ !_.features().variable_pointers)
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Using pointers with OpSelect requires capability "
<< "VariablePointers or VariablePointersStorageBuffer";
break;
}
+ case SpvOpTypeSampledImage:
+ case SpvOpTypeImage:
+ case SpvOpTypeSampler: {
+ if (!_.HasCapability(SpvCapabilityBindlessTextureNV))
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Using image/sampler with OpSelect requires capability "
+ << "BindlessTextureNV";
+ break;
+ }
+
case SpvOpTypeVector: {
dimension = type_inst->word(3);
break;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_memory.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_memory.cpp
index a7b0f82d5d1..09fd2b643e7 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_memory.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_memory.cpp
@@ -35,8 +35,8 @@ bool HaveLayoutCompatibleMembers(ValidationState_t&, const Instruction*,
const Instruction*);
bool HaveSameLayoutDecorations(ValidationState_t&, const Instruction*,
const Instruction*);
-bool HasConflictingMemberOffsets(const std::vector<Decoration>&,
- const std::vector<Decoration>&);
+bool HasConflictingMemberOffsets(const std::set<Decoration>&,
+ const std::set<Decoration>&);
bool IsAllowedTypeOrArrayOfSame(ValidationState_t& _, const Instruction* type,
std::initializer_list<uint32_t> allowed) {
@@ -105,10 +105,8 @@ bool HaveSameLayoutDecorations(ValidationState_t& _, const Instruction* type1,
"type1 must be an OpTypeStruct instruction.");
assert(type2->opcode() == SpvOpTypeStruct &&
"type2 must be an OpTypeStruct instruction.");
- const std::vector<Decoration>& type1_decorations =
- _.id_decorations(type1->id());
- const std::vector<Decoration>& type2_decorations =
- _.id_decorations(type2->id());
+ const std::set<Decoration>& type1_decorations = _.id_decorations(type1->id());
+ const std::set<Decoration>& type2_decorations = _.id_decorations(type2->id());
// TODO: Will have to add other check for arrays an matricies if we want to
// handle them.
@@ -120,8 +118,8 @@ bool HaveSameLayoutDecorations(ValidationState_t& _, const Instruction* type1,
}
bool HasConflictingMemberOffsets(
- const std::vector<Decoration>& type1_decorations,
- const std::vector<Decoration>& type2_decorations) {
+ const std::set<Decoration>& type1_decorations,
+ const std::set<Decoration>& type2_decorations) {
{
// We are interested in conflicting decoration. If a decoration is in one
// list but not the other, then we will assume the code is correct. We are
@@ -315,11 +313,12 @@ spv_result_t CheckMemoryAccess(ValidationState_t& _, const Instruction* inst,
SpvStorageClass dst_sc, src_sc;
std::tie(dst_sc, src_sc) = GetStorageClass(_, inst);
if (inst->operands().size() <= index) {
- if (src_sc == SpvStorageClassPhysicalStorageBufferEXT ||
- dst_sc == SpvStorageClassPhysicalStorageBufferEXT) {
+ // Cases where lack of some operand is invalid
+ if (src_sc == SpvStorageClassPhysicalStorageBuffer ||
+ dst_sc == SpvStorageClassPhysicalStorageBuffer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Memory accesses with PhysicalStorageBufferEXT must use "
- "Aligned.";
+ << _.VkErrorID(4708)
+ << "Memory accesses with PhysicalStorageBuffer must use Aligned.";
}
return SPV_SUCCESS;
}
@@ -368,7 +367,7 @@ spv_result_t CheckMemoryAccess(ValidationState_t& _, const Instruction* inst,
dst_sc != SpvStorageClassCrossWorkgroup &&
dst_sc != SpvStorageClassGeneric && dst_sc != SpvStorageClassImage &&
dst_sc != SpvStorageClassStorageBuffer &&
- dst_sc != SpvStorageClassPhysicalStorageBufferEXT) {
+ dst_sc != SpvStorageClassPhysicalStorageBuffer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "NonPrivatePointerKHR requires a pointer in Uniform, "
<< "Workgroup, CrossWorkgroup, Generic, Image or StorageBuffer "
@@ -379,7 +378,7 @@ spv_result_t CheckMemoryAccess(ValidationState_t& _, const Instruction* inst,
src_sc != SpvStorageClassCrossWorkgroup &&
src_sc != SpvStorageClassGeneric && src_sc != SpvStorageClassImage &&
src_sc != SpvStorageClassStorageBuffer &&
- src_sc != SpvStorageClassPhysicalStorageBufferEXT) {
+ src_sc != SpvStorageClassPhysicalStorageBuffer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "NonPrivatePointerKHR requires a pointer in Uniform, "
<< "Workgroup, CrossWorkgroup, Generic, Image or StorageBuffer "
@@ -388,11 +387,11 @@ spv_result_t CheckMemoryAccess(ValidationState_t& _, const Instruction* inst,
}
if (!(mask & SpvMemoryAccessAlignedMask)) {
- if (src_sc == SpvStorageClassPhysicalStorageBufferEXT ||
- dst_sc == SpvStorageClassPhysicalStorageBufferEXT) {
+ if (src_sc == SpvStorageClassPhysicalStorageBuffer ||
+ dst_sc == SpvStorageClassPhysicalStorageBuffer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Memory accesses with PhysicalStorageBufferEXT must use "
- "Aligned.";
+ << _.VkErrorID(4708)
+ << "Memory accesses with PhysicalStorageBuffer must use Aligned.";
}
}
@@ -403,8 +402,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
auto result_type = _.FindDef(inst->type_id());
if (!result_type || result_type->opcode() != SpvOpTypePointer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpVariable Result Type <id> '" << _.getIdName(inst->type_id())
- << "' is not a pointer type.";
+ << "OpVariable Result Type <id> " << _.getIdName(inst->type_id())
+ << " is not a pointer type.";
}
const auto type_index = 2;
@@ -424,8 +423,8 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
initializer && spvOpcodeIsConstant(initializer->opcode());
if (!initializer || !(is_constant || is_module_scope_var)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpVariable Initializer <id> '" << _.getIdName(initializer_id)
- << "' is not a constant or module-scope variable.";
+ << "OpVariable Initializer <id> " << _.getIdName(initializer_id)
+ << " is not a constant or module-scope variable.";
}
if (initializer->type_id() != value_id) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
@@ -439,11 +438,12 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
storage_class != SpvStorageClassCrossWorkgroup &&
storage_class != SpvStorageClassPrivate &&
storage_class != SpvStorageClassFunction &&
- storage_class != SpvStorageClassRayPayloadNV &&
- storage_class != SpvStorageClassIncomingRayPayloadNV &&
- storage_class != SpvStorageClassHitAttributeNV &&
- storage_class != SpvStorageClassCallableDataNV &&
- storage_class != SpvStorageClassIncomingCallableDataNV) {
+ 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;
bool builtin = false;
@@ -455,12 +455,24 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
}
}
}
- if (!(storage_input_or_output && builtin) &&
+ if (!builtin &&
ContainsInvalidBool(_, value_type, storage_input_or_output)) {
- return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "If OpTypeBool is stored in conjunction with OpVariable, it "
- << "can only be used with non-externally visible shader Storage "
- << "Classes: Workgroup, CrossWorkgroup, Private, and Function";
+ if (storage_input_or_output) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << _.VkErrorID(7290)
+ << "If OpTypeBool is stored in conjunction with OpVariable "
+ "using Input or Output Storage Classes it requires a BuiltIn "
+ "decoration";
+
+ } else {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "If OpTypeBool is stored in conjunction with OpVariable, it "
+ "can only be used with non-externally visible shader Storage "
+ "Classes: Workgroup, CrossWorkgroup, Private, Function, "
+ "Input, Output, RayPayloadKHR, IncomingRayPayloadKHR, "
+ "HitAttributeKHR, CallableDataKHR, or "
+ "IncomingCallableDataKHR";
+ }
}
}
@@ -519,28 +531,29 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
}
}
- // Vulkan 14.5.1: Check type of PushConstant variables.
- // Vulkan 14.5.2: Check type of UniformConstant and Uniform variables.
if (spvIsVulkanEnv(_.context()->target_env)) {
+ // Vulkan Push Constant Interface section: Check type of PushConstant
+ // variables.
if (storage_class == SpvStorageClassPushConstant) {
- if (!IsAllowedTypeOrArrayOfSame(_, pointee, {SpvOpTypeStruct})) {
+ if (pointee->opcode() != SpvOpTypeStruct) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "PushConstant OpVariable <id> '" << _.getIdName(inst->id())
- << "' has illegal type.\n"
- << "From Vulkan spec, section 14.5.1:\n"
- << "Such variables must be typed as OpTypeStruct, "
- << "or an array of this type";
+ << _.VkErrorID(6808) << "PushConstant OpVariable <id> "
+ << _.getIdName(inst->id()) << " has illegal type.\n"
+ << "From Vulkan spec, Push Constant Interface section:\n"
+ << "Such variables must be typed as OpTypeStruct";
}
}
+ // Vulkan Descriptor Set Interface: Check type of UniformConstant and
+ // Uniform variables.
if (storage_class == SpvStorageClassUniformConstant) {
if (!IsAllowedTypeOrArrayOfSame(
_, pointee,
{SpvOpTypeImage, SpvOpTypeSampler, SpvOpTypeSampledImage,
SpvOpTypeAccelerationStructureKHR})) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << _.VkErrorID(4655) << "UniformConstant OpVariable <id> '"
- << _.getIdName(inst->id()) << "' has illegal type.\n"
+ << _.VkErrorID(4655) << "UniformConstant OpVariable <id> "
+ << _.getIdName(inst->id()) << " has illegal type.\n"
<< "Variables identified with the UniformConstant storage class "
<< "are used only as handles to refer to opaque resources. Such "
<< "variables must be typed as OpTypeImage, OpTypeSampler, "
@@ -552,9 +565,9 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
if (storage_class == SpvStorageClassUniform) {
if (!IsAllowedTypeOrArrayOfSame(_, pointee, {SpvOpTypeStruct})) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Uniform OpVariable <id> '" << _.getIdName(inst->id())
- << "' has illegal type.\n"
- << "From Vulkan spec, section 14.5.2:\n"
+ << _.VkErrorID(6807) << "Uniform OpVariable <id> "
+ << _.getIdName(inst->id()) << " has illegal type.\n"
+ << "From Vulkan spec:\n"
<< "Variables identified with the Uniform storage class are "
<< "used to access transparent buffer backed resources. Such "
<< "variables must be typed as OpTypeStruct, or an array of "
@@ -565,9 +578,9 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
if (storage_class == SpvStorageClassStorageBuffer) {
if (!IsAllowedTypeOrArrayOfSame(_, pointee, {SpvOpTypeStruct})) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "StorageBuffer OpVariable <id> '" << _.getIdName(inst->id())
- << "' has illegal type.\n"
- << "From Vulkan spec, section 14.5.2:\n"
+ << _.VkErrorID(6807) << "StorageBuffer OpVariable <id> "
+ << _.getIdName(inst->id()) << " has illegal type.\n"
+ << "From Vulkan spec:\n"
<< "Variables identified with the StorageBuffer storage class "
"are used to access transparent buffer backed resources. "
"Such variables must be typed as OpTypeStruct, or an array "
@@ -596,27 +609,27 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
}
}
}
- }
- // Vulkan Appendix A: Check that if contains initializer, then
- // storage class is Output, Private, or Function.
- if (inst->operands().size() > 3 && storage_class != SpvStorageClassOutput &&
- storage_class != SpvStorageClassPrivate &&
- storage_class != SpvStorageClassFunction) {
- if (spvIsVulkanEnv(_.context()->target_env)) {
+ // Initializers in Vulkan are only allowed in some storage clases
+ if (inst->operands().size() > 3) {
if (storage_class == SpvStorageClassWorkgroup) {
auto init_id = inst->GetOperandAs<uint32_t>(3);
auto init = _.FindDef(init_id);
if (init->opcode() != SpvOpConstantNull) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Variable initializers in Workgroup storage class are "
- "limited to OpConstantNull";
+ << _.VkErrorID(4734) << "OpVariable, <id> "
+ << _.getIdName(inst->id())
+ << ", initializers are limited to OpConstantNull in "
+ "Workgroup "
+ "storage class";
}
- } else {
+ } else if (storage_class != SpvStorageClassOutput &&
+ storage_class != SpvStorageClassPrivate &&
+ storage_class != SpvStorageClassFunction) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << _.VkErrorID(4651) << "OpVariable, <id> '"
+ << _.VkErrorID(4651) << "OpVariable, <id> "
<< _.getIdName(inst->id())
- << "', has a disallowed initializer & storage class "
+ << ", has a disallowed initializer & storage class "
<< "combination.\n"
<< "From " << spvLogStringForEnv(_.context()->target_env)
<< " spec:\n"
@@ -627,9 +640,22 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
}
}
- if (storage_class == SpvStorageClassPhysicalStorageBufferEXT) {
+ if (inst->operands().size() > 3) {
+ if (storage_class == SpvStorageClassTaskPayloadWorkgroupEXT) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpVariable, <id> " << _.getIdName(inst->id())
+ << ", initializer are not allowed for TaskPayloadWorkgroupEXT";
+ }
+ if (storage_class == SpvStorageClassInput) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "OpVariable, <id> " << _.getIdName(inst->id())
+ << ", initializer are not allowed for Input";
+ }
+ }
+
+ if (storage_class == SpvStorageClassPhysicalStorageBuffer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "PhysicalStorageBufferEXT must not be used with OpVariable.";
+ << "PhysicalStorageBuffer must not be used with OpVariable.";
}
auto pointee_base = pointee;
@@ -638,23 +664,23 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
}
if (pointee_base->opcode() == SpvOpTypePointer) {
if (pointee_base->GetOperandAs<uint32_t>(1u) ==
- SpvStorageClassPhysicalStorageBufferEXT) {
- // check for AliasedPointerEXT/RestrictPointerEXT
+ SpvStorageClassPhysicalStorageBuffer) {
+ // check for AliasedPointer/RestrictPointer
bool foundAliased =
- _.HasDecoration(inst->id(), SpvDecorationAliasedPointerEXT);
+ _.HasDecoration(inst->id(), SpvDecorationAliasedPointer);
bool foundRestrict =
- _.HasDecoration(inst->id(), SpvDecorationRestrictPointerEXT);
+ _.HasDecoration(inst->id(), SpvDecorationRestrictPointer);
if (!foundAliased && !foundRestrict) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpVariable " << inst->id()
- << ": expected AliasedPointerEXT or RestrictPointerEXT for "
- << "PhysicalStorageBufferEXT pointer.";
+ << ": expected AliasedPointer or RestrictPointer for "
+ << "PhysicalStorageBuffer pointer.";
}
if (foundAliased && foundRestrict) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpVariable " << inst->id()
- << ": can't specify both AliasedPointerEXT and "
- << "RestrictPointerEXT for PhysicalStorageBufferEXT pointer.";
+ << ": can't specify both AliasedPointer and "
+ << "RestrictPointer for PhysicalStorageBuffer pointer.";
}
}
}
@@ -667,8 +693,9 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
if (value_type && value_type->opcode() == SpvOpTypeRuntimeArray) {
if (!_.HasCapability(SpvCapabilityRuntimeDescriptorArrayEXT)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpVariable, <id> '" << _.getIdName(inst->id())
- << "', is attempting to create memory for an illegal type, "
+ << _.VkErrorID(4680) << "OpVariable, <id> "
+ << _.getIdName(inst->id())
+ << ", is attempting to create memory for an illegal type, "
<< "OpTypeRuntimeArray.\nFor Vulkan OpTypeRuntimeArray can only "
<< "appear as the final member of an OpTypeStruct, thus cannot "
<< "be instantiated via OpVariable";
@@ -679,6 +706,7 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
storage_class != SpvStorageClassUniform &&
storage_class != SpvStorageClassUniformConstant) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << _.VkErrorID(4680)
<< "For Vulkan with RuntimeDescriptorArrayEXT, a variable "
<< "containing OpTypeRuntimeArray must have storage class of "
<< "StorageBuffer, Uniform, or UniformConstant.";
@@ -692,25 +720,30 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
// as BufferBlock.
if (value_type && value_type->opcode() == SpvOpTypeStruct) {
if (DoesStructContainRTA(_, value_type)) {
- if (storage_class == SpvStorageClassStorageBuffer) {
+ if (storage_class == SpvStorageClassStorageBuffer ||
+ storage_class == SpvStorageClassPhysicalStorageBuffer) {
if (!_.HasDecoration(value_id, SpvDecorationBlock)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << _.VkErrorID(4680)
<< "For Vulkan, an OpTypeStruct variable containing an "
<< "OpTypeRuntimeArray must be decorated with Block if it "
- << "has storage class StorageBuffer.";
+ << "has storage class StorageBuffer or "
+ "PhysicalStorageBuffer.";
}
} else if (storage_class == SpvStorageClassUniform) {
if (!_.HasDecoration(value_id, SpvDecorationBufferBlock)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << _.VkErrorID(4680)
<< "For Vulkan, an OpTypeStruct variable containing an "
<< "OpTypeRuntimeArray must be decorated with BufferBlock "
<< "if it has storage class Uniform.";
}
} else {
return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << _.VkErrorID(4680)
<< "For Vulkan, OpTypeStruct variables containing "
<< "OpTypeRuntimeArray must have storage class of "
- << "StorageBuffer or Uniform.";
+ << "StorageBuffer, PhysicalStorageBuffer, or Uniform.";
}
}
}
@@ -745,7 +778,7 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
SPV_OPERAND_TYPE_STORAGE_CLASS, storage_class);
switch (storage_class) {
case SpvStorageClassStorageBuffer:
- case SpvStorageClassPhysicalStorageBufferEXT:
+ case SpvStorageClassPhysicalStorageBuffer:
if (!_.HasCapability(SpvCapabilityStorageBuffer16BitAccess)) {
storage_class_ok = false;
}
@@ -807,7 +840,7 @@ spv_result_t ValidateVariable(ValidationState_t& _, const Instruction* inst) {
SPV_OPERAND_TYPE_STORAGE_CLASS, storage_class);
switch (storage_class) {
case SpvStorageClassStorageBuffer:
- case SpvStorageClassPhysicalStorageBufferEXT:
+ case SpvStorageClassPhysicalStorageBuffer:
if (!_.HasCapability(SpvCapabilityStorageBuffer8BitAccess)) {
storage_class_ok = false;
}
@@ -857,40 +890,40 @@ spv_result_t ValidateLoad(ValidationState_t& _, const Instruction* inst) {
const auto result_type = _.FindDef(inst->type_id());
if (!result_type) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpLoad Result Type <id> '" << _.getIdName(inst->type_id())
- << "' is not defined.";
+ << "OpLoad Result Type <id> " << _.getIdName(inst->type_id())
+ << " is not defined.";
}
- const bool uses_variable_pointers =
- _.features().variable_pointers ||
- _.features().variable_pointers_storage_buffer;
const auto pointer_index = 2;
const auto pointer_id = inst->GetOperandAs<uint32_t>(pointer_index);
const auto pointer = _.FindDef(pointer_id);
if (!pointer ||
((_.addressing_model() == SpvAddressingModelLogical) &&
- ((!uses_variable_pointers &&
+ ((!_.features().variable_pointers &&
!spvOpcodeReturnsLogicalPointer(pointer->opcode())) ||
- (uses_variable_pointers &&
+ (_.features().variable_pointers &&
!spvOpcodeReturnsLogicalVariablePointer(pointer->opcode()))))) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpLoad Pointer <id> '" << _.getIdName(pointer_id)
- << "' is not a logical pointer.";
+ << "OpLoad Pointer <id> " << _.getIdName(pointer_id)
+ << " is not a logical pointer.";
}
const auto pointer_type = _.FindDef(pointer->type_id());
if (!pointer_type || pointer_type->opcode() != SpvOpTypePointer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpLoad type for pointer <id> '" << _.getIdName(pointer_id)
- << "' is not a pointer type.";
+ << "OpLoad type for pointer <id> " << _.getIdName(pointer_id)
+ << " is not a pointer type.";
}
- const auto pointee_type = _.FindDef(pointer_type->GetOperandAs<uint32_t>(2));
- if (!pointee_type || result_type->id() != pointee_type->id()) {
+ uint32_t pointee_data_type;
+ uint32_t storage_class;
+ if (!_.GetPointerTypeInfo(pointer_type->id(), &pointee_data_type,
+ &storage_class) ||
+ result_type->id() != pointee_data_type) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpLoad Result Type <id> '" << _.getIdName(inst->type_id())
- << "' does not match Pointer <id> '" << _.getIdName(pointer->id())
- << "'s type.";
+ << "OpLoad Result Type <id> " << _.getIdName(inst->type_id())
+ << " does not match Pointer <id> " << _.getIdName(pointer->id())
+ << "s type.";
}
if (!_.options()->before_hlsl_legalization &&
@@ -917,34 +950,31 @@ spv_result_t ValidateLoad(ValidationState_t& _, const Instruction* inst) {
}
spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) {
- const bool uses_variable_pointer =
- _.features().variable_pointers ||
- _.features().variable_pointers_storage_buffer;
const auto pointer_index = 0;
const auto pointer_id = inst->GetOperandAs<uint32_t>(pointer_index);
const auto pointer = _.FindDef(pointer_id);
if (!pointer ||
(_.addressing_model() == SpvAddressingModelLogical &&
- ((!uses_variable_pointer &&
+ ((!_.features().variable_pointers &&
!spvOpcodeReturnsLogicalPointer(pointer->opcode())) ||
- (uses_variable_pointer &&
+ (_.features().variable_pointers &&
!spvOpcodeReturnsLogicalVariablePointer(pointer->opcode()))))) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpStore Pointer <id> '" << _.getIdName(pointer_id)
- << "' is not a logical pointer.";
+ << "OpStore Pointer <id> " << _.getIdName(pointer_id)
+ << " is not a logical pointer.";
}
const auto pointer_type = _.FindDef(pointer->type_id());
if (!pointer_type || pointer_type->opcode() != SpvOpTypePointer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpStore type for pointer <id> '" << _.getIdName(pointer_id)
- << "' is not a pointer type.";
+ << "OpStore type for pointer <id> " << _.getIdName(pointer_id)
+ << " is not a pointer type.";
}
const auto type_id = pointer_type->GetOperandAs<uint32_t>(2);
const auto type = _.FindDef(type_id);
if (!type || SpvOpTypeVoid == type->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpStore Pointer <id> '" << _.getIdName(pointer_id)
- << "'s type is void.";
+ << "OpStore Pointer <id> " << _.getIdName(pointer_id)
+ << "s type is void.";
}
// validate storage class
@@ -953,16 +983,36 @@ spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) {
uint32_t storage_class;
if (!_.GetPointerTypeInfo(pointer_type->id(), &data_type, &storage_class)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpStore Pointer <id> '" << _.getIdName(pointer_id)
- << "' is not pointer type";
+ << "OpStore Pointer <id> " << _.getIdName(pointer_id)
+ << " is not pointer type";
}
if (storage_class == SpvStorageClassUniformConstant ||
storage_class == SpvStorageClassInput ||
storage_class == SpvStorageClassPushConstant) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpStore Pointer <id> '" << _.getIdName(pointer_id)
- << "' storage class is read-only";
+ << "OpStore Pointer <id> " << _.getIdName(pointer_id)
+ << " storage class is read-only";
+ } else if (storage_class == SpvStorageClassShaderRecordBufferKHR) {
+ return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << "ShaderRecordBufferKHR Storage Class variables are read only";
+ } else if (storage_class == SpvStorageClassHitAttributeKHR) {
+ std::string errorVUID = _.VkErrorID(4703);
+ _.function(inst->function()->id())
+ ->RegisterExecutionModelLimitation(
+ [errorVUID](SpvExecutionModel model, std::string* message) {
+ if (model == SpvExecutionModelAnyHitKHR ||
+ model == SpvExecutionModelClosestHitKHR) {
+ if (message) {
+ *message =
+ errorVUID +
+ "HitAttributeKHR Storage Class variables are read only "
+ "with AnyHitKHR and ClosestHitKHR";
+ }
+ return false;
+ }
+ return true;
+ });
}
if (spvIsVulkanEnv(_.context()->target_env) &&
@@ -979,6 +1029,7 @@ spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) {
}
if (_.HasDecoration(base_type->id(), SpvDecorationBlock)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
+ << _.VkErrorID(6925)
<< "In the Vulkan environment, cannot store to Uniform Blocks";
}
}
@@ -990,31 +1041,31 @@ spv_result_t ValidateStore(ValidationState_t& _, const Instruction* inst) {
const auto object = _.FindDef(object_id);
if (!object || !object->type_id()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpStore Object <id> '" << _.getIdName(object_id)
- << "' is not an object.";
+ << "OpStore Object <id> " << _.getIdName(object_id)
+ << " is not an object.";
}
const auto object_type = _.FindDef(object->type_id());
if (!object_type || SpvOpTypeVoid == object_type->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpStore Object <id> '" << _.getIdName(object_id)
- << "'s type is void.";
+ << "OpStore Object <id> " << _.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) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpStore Pointer <id> '" << _.getIdName(pointer_id)
- << "'s type does not match Object <id> '"
- << _.getIdName(object->id()) << "'s type.";
+ << "OpStore Pointer <id> " << _.getIdName(pointer_id)
+ << "s type does not match Object <id> "
+ << _.getIdName(object->id()) << "s type.";
}
// TODO: Check for layout compatible matricies and arrays as well.
if (!AreLayoutCompatibleStructs(_, type, object_type)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpStore Pointer <id> '" << _.getIdName(pointer_id)
- << "'s layout does not match Object <id> '"
- << _.getIdName(object->id()) << "'s layout.";
+ << "OpStore Pointer <id> " << _.getIdName(pointer_id)
+ << "s layout does not match Object <id> "
+ << _.getIdName(object->id()) << "s layout.";
}
}
@@ -1086,8 +1137,8 @@ spv_result_t ValidateCopyMemory(ValidationState_t& _, const Instruction* inst) {
const auto target = _.FindDef(target_id);
if (!target) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Target operand <id> '" << _.getIdName(target_id)
- << "' is not defined.";
+ << "Target operand <id> " << _.getIdName(target_id)
+ << " is not defined.";
}
const auto source_index = 1;
@@ -1095,24 +1146,24 @@ spv_result_t ValidateCopyMemory(ValidationState_t& _, const Instruction* inst) {
const auto source = _.FindDef(source_id);
if (!source) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Source operand <id> '" << _.getIdName(source_id)
- << "' is not defined.";
+ << "Source operand <id> " << _.getIdName(source_id)
+ << " is not defined.";
}
const auto target_pointer_type = _.FindDef(target->type_id());
if (!target_pointer_type ||
target_pointer_type->opcode() != SpvOpTypePointer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Target operand <id> '" << _.getIdName(target_id)
- << "' is not a pointer.";
+ << "Target operand <id> " << _.getIdName(target_id)
+ << " is not a pointer.";
}
const auto source_pointer_type = _.FindDef(source->type_id());
if (!source_pointer_type ||
source_pointer_type->opcode() != SpvOpTypePointer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Source operand <id> '" << _.getIdName(source_id)
- << "' is not a pointer.";
+ << "Source operand <id> " << _.getIdName(source_id)
+ << " is not a pointer.";
}
if (inst->opcode() == SpvOpCopyMemory) {
@@ -1120,70 +1171,66 @@ spv_result_t ValidateCopyMemory(ValidationState_t& _, const Instruction* inst) {
_.FindDef(target_pointer_type->GetOperandAs<uint32_t>(2));
if (!target_type || target_type->opcode() == SpvOpTypeVoid) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Target operand <id> '" << _.getIdName(target_id)
- << "' cannot be a void pointer.";
+ << "Target operand <id> " << _.getIdName(target_id)
+ << " cannot be a void pointer.";
}
const auto source_type =
_.FindDef(source_pointer_type->GetOperandAs<uint32_t>(2));
if (!source_type || source_type->opcode() == SpvOpTypeVoid) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Source operand <id> '" << _.getIdName(source_id)
- << "' cannot be a void pointer.";
+ << "Source operand <id> " << _.getIdName(source_id)
+ << " cannot be a void pointer.";
}
if (target_type->id() != source_type->id()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Target <id> '" << _.getIdName(source_id)
- << "'s type does not match Source <id> '"
- << _.getIdName(source_type->id()) << "'s type.";
+ << "Target <id> " << _.getIdName(source_id)
+ << "s type does not match Source <id> "
+ << _.getIdName(source_type->id()) << "s type.";
}
-
- if (auto error = CheckMemoryAccess(_, inst, 2)) return error;
} else {
const auto size_id = inst->GetOperandAs<uint32_t>(2);
const auto size = _.FindDef(size_id);
if (!size) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Size operand <id> '" << _.getIdName(size_id)
- << "' is not defined.";
+ << "Size operand <id> " << _.getIdName(size_id)
+ << " is not defined.";
}
const auto size_type = _.FindDef(size->type_id());
if (!_.IsIntScalarType(size_type->id())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Size operand <id> '" << _.getIdName(size_id)
- << "' must be a scalar integer type.";
+ << "Size operand <id> " << _.getIdName(size_id)
+ << " must be a scalar integer type.";
}
bool is_zero = true;
switch (size->opcode()) {
case SpvOpConstantNull:
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Size operand <id> '" << _.getIdName(size_id)
- << "' cannot be a constant zero.";
+ << "Size operand <id> " << _.getIdName(size_id)
+ << " cannot be a constant zero.";
case SpvOpConstant:
if (size_type->word(3) == 1 &&
size->word(size->words().size() - 1) & 0x80000000) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Size operand <id> '" << _.getIdName(size_id)
- << "' cannot have the sign bit set to 1.";
+ << "Size operand <id> " << _.getIdName(size_id)
+ << " cannot have the sign bit set to 1.";
}
for (size_t i = 3; is_zero && i < size->words().size(); ++i) {
is_zero &= (size->word(i) == 0);
}
if (is_zero) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Size operand <id> '" << _.getIdName(size_id)
- << "' cannot be a constant zero.";
+ << "Size operand <id> " << _.getIdName(size_id)
+ << " cannot be a constant zero.";
}
break;
default:
// Cannot infer any other opcodes.
break;
}
-
- if (auto error = CheckMemoryAccess(_, inst, 3)) return error;
}
if (auto error = ValidateCopyMemoryMemoryAccess(_, inst)) return error;
@@ -1210,8 +1257,8 @@ spv_result_t ValidateAccessChain(ValidationState_t& _,
auto result_type = _.FindDef(inst->type_id());
if (SpvOpTypePointer != result_type->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "The Result Type of " << instr_name << " <id> '"
- << _.getIdName(inst->id()) << "' must be OpTypePointer. Found Op"
+ << "The Result Type of " << instr_name << " <id> "
+ << _.getIdName(inst->id()) << " must be OpTypePointer. Found Op"
<< spvOpcodeString(static_cast<SpvOp>(result_type->opcode())) << ".";
}
@@ -1227,7 +1274,7 @@ spv_result_t ValidateAccessChain(ValidationState_t& _,
const auto base_type = _.FindDef(base->type_id());
if (!base_type || SpvOpTypePointer != base_type->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "The Base <id> '" << _.getIdName(base_id) << "' in " << instr_name
+ << "The Base <id> " << _.getIdName(base_id) << " in " << instr_name
<< " instruction must be a pointer.";
}
@@ -1319,8 +1366,8 @@ spv_result_t ValidateAccessChain(ValidationState_t& _,
return _.diag(SPV_ERROR_INVALID_ID, cur_word_instr)
<< "Index is out of bounds: " << instr_name
<< " can not find index " << cur_index
- << " into the structure <id> '"
- << _.getIdName(type_pointee->id()) << "'. This structure has "
+ << " into the structure <id> "
+ << _.getIdName(type_pointee->id()) << ". This structure has "
<< num_struct_members << " members. Largest valid index is "
<< num_struct_members - 1 << ".";
}
@@ -1357,14 +1404,60 @@ spv_result_t ValidateAccessChain(ValidationState_t& _,
spv_result_t ValidatePtrAccessChain(ValidationState_t& _,
const Instruction* inst) {
if (_.addressing_model() == SpvAddressingModelLogical) {
- if (!_.features().variable_pointers &&
- !_.features().variable_pointers_storage_buffer) {
+ if (!_.features().variable_pointers) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Generating variable pointers requires capability "
<< "VariablePointers or VariablePointersStorageBuffer";
}
}
- return ValidateAccessChain(_, inst);
+
+ // Need to call first, will make sure Base is a valid ID
+ if (auto error = ValidateAccessChain(_, inst)) return error;
+
+ const auto base_id = inst->GetOperandAs<uint32_t>(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);
+
+ 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)) {
+ 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)) {
+ 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) {
+ if (!_.features().variable_pointers) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << _.VkErrorID(7652)
+ << "OpPtrAccessChain Base operand pointing to StorageBuffer "
+ "storage class must use VariablePointers or "
+ "VariablePointersStorageBuffer capability";
+ }
+ } else if (base_type_storage_class !=
+ SpvStorageClassPhysicalStorageBuffer) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << _.VkErrorID(7650)
+ << "OpPtrAccessChain Base operand must point to Workgroup, "
+ "StorageBuffer, or PhysicalStorageBuffer storage class";
+ }
+ }
+
+ return SPV_SUCCESS;
}
spv_result_t ValidateArrayLength(ValidationState_t& state,
@@ -1378,9 +1471,9 @@ spv_result_t ValidateArrayLength(ValidationState_t& state,
result_type->GetOperandAs<uint32_t>(1) != 32 ||
result_type->GetOperandAs<uint32_t>(2) != 0) {
return state.diag(SPV_ERROR_INVALID_ID, inst)
- << "The Result Type of " << instr_name << " <id> '"
+ << "The Result Type of " << instr_name << " <id> "
<< state.getIdName(inst->id())
- << "' must be OpTypeInt with width 32 and signedness 0.";
+ << " must be OpTypeInt with width 32 and signedness 0.";
}
// The structure that is passed in must be an pointer to a structure, whose
@@ -1389,17 +1482,17 @@ spv_result_t ValidateArrayLength(ValidationState_t& state,
auto pointer_type = state.FindDef(pointer->type_id());
if (pointer_type->opcode() != SpvOpTypePointer) {
return state.diag(SPV_ERROR_INVALID_ID, inst)
- << "The Struture's type in " << instr_name << " <id> '"
+ << "The Structure's type in " << instr_name << " <id> "
<< state.getIdName(inst->id())
- << "' must be a pointer to an OpTypeStruct.";
+ << " must be a pointer to an OpTypeStruct.";
}
auto structure_type = state.FindDef(pointer_type->GetOperandAs<uint32_t>(2));
if (structure_type->opcode() != SpvOpTypeStruct) {
return state.diag(SPV_ERROR_INVALID_ID, inst)
- << "The Struture's type in " << instr_name << " <id> '"
+ << "The Structure's type in " << instr_name << " <id> "
<< state.getIdName(inst->id())
- << "' must be a pointer to an OpTypeStruct.";
+ << " must be a pointer to an OpTypeStruct.";
}
auto num_of_members = structure_type->operands().size() - 1;
@@ -1407,17 +1500,17 @@ spv_result_t ValidateArrayLength(ValidationState_t& state,
state.FindDef(structure_type->GetOperandAs<uint32_t>(num_of_members));
if (last_member->opcode() != SpvOpTypeRuntimeArray) {
return state.diag(SPV_ERROR_INVALID_ID, inst)
- << "The Struture's last member in " << instr_name << " <id> '"
- << state.getIdName(inst->id()) << "' must be an OpTypeRuntimeArray.";
+ << "The Structure's last member in " << instr_name << " <id> "
+ << state.getIdName(inst->id()) << " must be an OpTypeRuntimeArray.";
}
- // The array member must the the index of the last element (the run time
+ // The array member must the index of the last element (the run time
// array).
if (inst->GetOperandAs<uint32_t>(3) != num_of_members - 1) {
return state.diag(SPV_ERROR_INVALID_ID, inst)
- << "The array member in " << instr_name << " <id> '"
+ << "The array member in " << instr_name << " <id> "
<< state.getIdName(inst->id())
- << "' must be an the last member of the struct.";
+ << " must be an the last member of the struct.";
}
return SPV_SUCCESS;
}
@@ -1433,18 +1526,17 @@ spv_result_t ValidateCooperativeMatrixLengthNV(ValidationState_t& state,
result_type->GetOperandAs<uint32_t>(1) != 32 ||
result_type->GetOperandAs<uint32_t>(2) != 0) {
return state.diag(SPV_ERROR_INVALID_ID, inst)
- << "The Result Type of " << instr_name << " <id> '"
+ << "The Result Type of " << instr_name << " <id> "
<< state.getIdName(inst->id())
- << "' must be OpTypeInt with width 32 and signedness 0.";
+ << " must be OpTypeInt with width 32 and signedness 0.";
}
auto type_id = inst->GetOperandAs<uint32_t>(2);
auto type = state.FindDef(type_id);
if (type->opcode() != SpvOpTypeCooperativeMatrixNV) {
return state.diag(SPV_ERROR_INVALID_ID, inst)
- << "The type in " << instr_name << " <id> '"
- << state.getIdName(type_id)
- << "' must be OpTypeCooperativeMatrixNV.";
+ << "The type in " << instr_name << " <id> "
+ << state.getIdName(type_id) << " must be OpTypeCooperativeMatrixNV.";
}
return SPV_SUCCESS;
}
@@ -1467,39 +1559,36 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _,
if (matrix_type->opcode() != SpvOpTypeCooperativeMatrixNV) {
if (inst->opcode() == SpvOpCooperativeMatrixLoadNV) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "SpvOpCooperativeMatrixLoadNV Result Type <id> '"
- << _.getIdName(type_id) << "' is not a cooperative matrix type.";
+ << "SpvOpCooperativeMatrixLoadNV Result Type <id> "
+ << _.getIdName(type_id) << " is not a cooperative matrix type.";
} else {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "SpvOpCooperativeMatrixStoreNV Object type <id> '"
- << _.getIdName(type_id) << "' is not a cooperative matrix type.";
+ << "SpvOpCooperativeMatrixStoreNV Object type <id> "
+ << _.getIdName(type_id) << " is not a cooperative matrix type.";
}
}
- const bool uses_variable_pointers =
- _.features().variable_pointers ||
- _.features().variable_pointers_storage_buffer;
const auto pointer_index =
(inst->opcode() == SpvOpCooperativeMatrixLoadNV) ? 2u : 0u;
const auto pointer_id = inst->GetOperandAs<uint32_t>(pointer_index);
const auto pointer = _.FindDef(pointer_id);
if (!pointer ||
((_.addressing_model() == SpvAddressingModelLogical) &&
- ((!uses_variable_pointers &&
+ ((!_.features().variable_pointers &&
!spvOpcodeReturnsLogicalPointer(pointer->opcode())) ||
- (uses_variable_pointers &&
+ (_.features().variable_pointers &&
!spvOpcodeReturnsLogicalVariablePointer(pointer->opcode()))))) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opname << " Pointer <id> '" << _.getIdName(pointer_id)
- << "' is not a logical pointer.";
+ << opname << " Pointer <id> " << _.getIdName(pointer_id)
+ << " is not a logical pointer.";
}
const auto pointer_type_id = pointer->type_id();
const auto pointer_type = _.FindDef(pointer_type_id);
if (!pointer_type || pointer_type->opcode() != SpvOpTypePointer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opname << " type for pointer <id> '" << _.getIdName(pointer_id)
- << "' is not a pointer type.";
+ << opname << " type for pointer <id> " << _.getIdName(pointer_id)
+ << " is not a pointer type.";
}
const auto storage_class_index = 1u;
@@ -1508,11 +1597,11 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _,
if (storage_class != SpvStorageClassWorkgroup &&
storage_class != SpvStorageClassStorageBuffer &&
- storage_class != SpvStorageClassPhysicalStorageBufferEXT) {
+ storage_class != SpvStorageClassPhysicalStorageBuffer) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opname << " storage class for pointer type <id> '"
+ << opname << " storage class for pointer type <id> "
<< _.getIdName(pointer_type_id)
- << "' is not Workgroup or StorageBuffer.";
+ << " is not Workgroup or StorageBuffer.";
}
const auto pointee_id = pointer_type->GetOperandAs<uint32_t>(2);
@@ -1520,8 +1609,8 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _,
if (!pointee_type || !(_.IsIntScalarOrVectorType(pointee_id) ||
_.IsFloatScalarOrVectorType(pointee_id))) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << opname << " Pointer <id> '" << _.getIdName(pointer->id())
- << "'s Type must be a scalar or vector type.";
+ << opname << " Pointer <id> " << _.getIdName(pointer->id())
+ << "s Type must be a scalar or vector type.";
}
const auto stride_index =
@@ -1530,8 +1619,8 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _,
const auto stride = _.FindDef(stride_id);
if (!stride || !_.IsIntScalarType(stride->type_id())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Stride operand <id> '" << _.getIdName(stride_id)
- << "' must be a scalar integer type.";
+ << "Stride operand <id> " << _.getIdName(stride_id)
+ << " must be a scalar integer type.";
}
const auto colmajor_index =
@@ -1542,8 +1631,8 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _,
!(spvOpcodeIsConstant(colmajor->opcode()) ||
spvOpcodeIsSpecConstant(colmajor->opcode()))) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Column Major operand <id> '" << _.getIdName(colmajor_id)
- << "' must be a boolean constant instruction.";
+ << "Column Major operand <id> " << _.getIdName(colmajor_id)
+ << " must be a boolean constant instruction.";
}
const auto memory_access_index =
@@ -1559,10 +1648,10 @@ spv_result_t ValidateCooperativeMatrixLoadStoreNV(ValidationState_t& _,
spv_result_t ValidatePtrComparison(ValidationState_t& _,
const Instruction* inst) {
if (_.addressing_model() == SpvAddressingModelLogical &&
- !_.features().variable_pointers_storage_buffer) {
+ !_.features().variable_pointers) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "Instruction cannot be used without a variable pointers "
- "capability";
+ << "Instruction cannot for logical addressing model be used without "
+ "a variable pointers capability";
}
const auto result_type = _.FindDef(inst->type_id());
@@ -1597,7 +1686,8 @@ spv_result_t ValidatePtrComparison(ValidationState_t& _,
<< "Invalid pointer storage class";
}
- if (sc == SpvStorageClassWorkgroup && !_.features().variable_pointers) {
+ if (sc == SpvStorageClassWorkgroup &&
+ !_.HasCapability(SpvCapabilityVariablePointers)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "Workgroup storage class pointer requires VariablePointers "
"capability to be specified";
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_mesh_shading.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_mesh_shading.cpp
new file mode 100644
index 00000000000..a7f07267223
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_mesh_shading.cpp
@@ -0,0 +1,123 @@
+// 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 query instructions from SPV_KHR_ray_query
+
+#include "source/opcode.h"
+#include "source/val/instruction.h"
+#include "source/val/validate.h"
+#include "source/val/validation_state.h"
+
+namespace spvtools {
+namespace val {
+
+spv_result_t MeshShadingPass(ValidationState_t& _, const Instruction* inst) {
+ const SpvOp opcode = inst->opcode();
+ switch (opcode) {
+ case SpvOpEmitMeshTasksEXT: {
+ _.function(inst->function()->id())
+ ->RegisterExecutionModelLimitation(
+ [](SpvExecutionModel model, std::string* message) {
+ if (model != SpvExecutionModelTaskEXT) {
+ if (message) {
+ *message =
+ "OpEmitMeshTasksEXT requires TaskEXT execution model";
+ }
+ return false;
+ }
+ return true;
+ });
+
+ const uint32_t group_count_x = _.GetOperandTypeId(inst, 0);
+ if (!_.IsUnsignedIntScalarType(group_count_x) ||
+ _.GetBitWidth(group_count_x) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Group Count X must be a 32-bit unsigned int scalar";
+ }
+
+ const uint32_t group_count_y = _.GetOperandTypeId(inst, 1);
+ if (!_.IsUnsignedIntScalarType(group_count_y) ||
+ _.GetBitWidth(group_count_y) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Group Count Y must be a 32-bit unsigned int scalar";
+ }
+
+ const uint32_t group_count_z = _.GetOperandTypeId(inst, 2);
+ if (!_.IsUnsignedIntScalarType(group_count_z) ||
+ _.GetBitWidth(group_count_z) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Group Count Z must be a 32-bit unsigned int scalar";
+ }
+
+ if (inst->operands().size() == 4) {
+ const auto payload = _.FindDef(inst->GetOperandAs<uint32_t>(3));
+ if (payload->opcode() != SpvOpVariable) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Payload must be the result of a OpVariable";
+ }
+ if (SpvStorageClass(payload->GetOperandAs<uint32_t>(2)) !=
+ SpvStorageClassTaskPayloadWorkgroupEXT) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Payload OpVariable must have a storage class of "
+ "TaskPayloadWorkgroupEXT";
+ }
+ }
+ break;
+ }
+
+ case SpvOpSetMeshOutputsEXT: {
+ _.function(inst->function()->id())
+ ->RegisterExecutionModelLimitation(
+ [](SpvExecutionModel model, std::string* message) {
+ if (model != SpvExecutionModelMeshEXT) {
+ if (message) {
+ *message =
+ "OpSetMeshOutputsEXT requires MeshEXT execution model";
+ }
+ return false;
+ }
+ return true;
+ });
+
+ const uint32_t vertex_count = _.GetOperandTypeId(inst, 0);
+ if (!_.IsUnsignedIntScalarType(vertex_count) ||
+ _.GetBitWidth(vertex_count) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Vertex Count must be a 32-bit unsigned int scalar";
+ }
+
+ const uint32_t primitive_count = _.GetOperandTypeId(inst, 1);
+ if (!_.IsUnsignedIntScalarType(primitive_count) ||
+ _.GetBitWidth(primitive_count) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Primitive Count must be a 32-bit unsigned int scalar";
+ }
+
+ break;
+ }
+
+ case SpvOpWritePackedPrimitiveIndices4x8NV: {
+ // No validation rules (for the moment).
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ return SPV_SUCCESS;
+}
+
+} // namespace val
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp
index 3bc15ca04b7..5acc21eaa1d 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_misc.cpp
@@ -59,10 +59,7 @@ spv_result_t ValidateShaderClock(ValidationState_t& _,
// a vector of two - components of 32 -
// bit unsigned integer type
const uint32_t result_type = inst->type_id();
- if (!(_.IsUnsignedIntScalarType(result_type) &&
- _.GetBitWidth(result_type) == 64) &&
- !(_.IsUnsignedIntVectorType(result_type) &&
- _.GetDimension(result_type) == 2 && _.GetBitWidth(result_type) == 32)) {
+ if (!_.IsUnsigned64BitHandle(result_type)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst) << "Expected Value to be a "
"vector of two components"
" of unsigned integer"
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp
index 4fb6d9b9686..672192b9c60 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_mode_setting.cpp
@@ -12,13 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-#include "source/val/validate.h"
-
#include <algorithm>
#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 {
@@ -30,8 +29,8 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) {
auto entry_point = _.FindDef(entry_point_id);
if (!entry_point || SpvOpFunction != entry_point->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpEntryPoint Entry Point <id> '" << _.getIdName(entry_point_id)
- << "' is not a function.";
+ << "OpEntryPoint Entry Point <id> " << _.getIdName(entry_point_id)
+ << " is not a function.";
}
// Only check the shader execution models
@@ -42,18 +41,18 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) {
const auto entry_point_type = _.FindDef(entry_point_type_id);
if (!entry_point_type || 3 != entry_point_type->words().size()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << _.VkErrorID(4633) << "OpEntryPoint Entry Point <id> '"
+ << _.VkErrorID(4633) << "OpEntryPoint Entry Point <id> "
<< _.getIdName(entry_point_id)
- << "'s function parameter count is not zero.";
+ << "s function parameter count is not zero.";
}
}
auto return_type = _.FindDef(entry_point->type_id());
if (!return_type || SpvOpTypeVoid != return_type->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << _.VkErrorID(4633) << "OpEntryPoint Entry Point <id> '"
+ << _.VkErrorID(4633) << "OpEntryPoint Entry Point <id> "
<< _.getIdName(entry_point_id)
- << "'s function return type is not void.";
+ << "s function return type is not void.";
}
const auto* execution_modes = _.GetExecutionModes(entry_point_id);
@@ -112,6 +111,44 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) {
<< "Fragment execution model entry points can specify at most "
"one fragment shader interlock execution mode.";
}
+ if (execution_modes &&
+ 1 < std::count_if(
+ execution_modes->begin(), execution_modes->end(),
+ [](const SpvExecutionMode& mode) {
+ switch (mode) {
+ case SpvExecutionModeStencilRefUnchangedFrontAMD:
+ case SpvExecutionModeStencilRefLessFrontAMD:
+ case SpvExecutionModeStencilRefGreaterFrontAMD:
+ return true;
+ default:
+ return false;
+ }
+ })) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Fragment execution model entry points can specify at most "
+ "one of StencilRefUnchangedFrontAMD, "
+ "StencilRefLessFrontAMD or StencilRefGreaterFrontAMD "
+ "execution modes.";
+ }
+ if (execution_modes &&
+ 1 < std::count_if(
+ execution_modes->begin(), execution_modes->end(),
+ [](const SpvExecutionMode& mode) {
+ switch (mode) {
+ case SpvExecutionModeStencilRefUnchangedBackAMD:
+ case SpvExecutionModeStencilRefLessBackAMD:
+ case SpvExecutionModeStencilRefGreaterBackAMD:
+ return true;
+ default:
+ return false;
+ }
+ })) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Fragment execution model entry points can specify at most "
+ "one of StencilRefUnchangedBackAMD, "
+ "StencilRefLessBackAMD or StencilRefGreaterBackAMD "
+ "execution modes.";
+ }
break;
case SpvExecutionModelTessellationControl:
case SpvExecutionModelTessellationEvaluation:
@@ -204,6 +241,39 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) {
"OutputTriangleStrip execution modes.";
}
break;
+ case SpvExecutionModelMeshEXT:
+ if (!execution_modes ||
+ 1 != std::count_if(execution_modes->begin(), execution_modes->end(),
+ [](const SpvExecutionMode& mode) {
+ switch (mode) {
+ case SpvExecutionModeOutputPoints:
+ case SpvExecutionModeOutputLinesEXT:
+ case SpvExecutionModeOutputTrianglesEXT:
+ return true;
+ default:
+ return false;
+ }
+ })) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "MeshEXT execution model entry points must specify exactly "
+ "one of OutputPoints, OutputLinesEXT, or "
+ "OutputTrianglesEXT Execution Modes.";
+ } else if (2 != std::count_if(
+ execution_modes->begin(), execution_modes->end(),
+ [](const SpvExecutionMode& mode) {
+ switch (mode) {
+ case SpvExecutionModeOutputPrimitivesEXT:
+ case SpvExecutionModeOutputVertices:
+ return true;
+ default:
+ return false;
+ }
+ })) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "MeshEXT execution model entry points must specify both "
+ "OutputPrimitivesEXT and OutputVertices Execution Modes.";
+ }
+ break;
default:
break;
}
@@ -235,11 +305,11 @@ spv_result_t ValidateEntryPoint(ValidationState_t& _, const Instruction* inst) {
}
if (!ok) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << _.VkErrorID(4683)
+ << _.VkErrorID(6426)
<< "In the Vulkan environment, GLCompute execution model "
- "entry points require either the LocalSize execution "
- "mode or an object decorated with WorkgroupSize must be "
- "specified.";
+ "entry points require either the LocalSize or "
+ "LocalSizeId execution mode or an object decorated with "
+ "WorkgroupSize must be specified.";
}
}
break;
@@ -258,9 +328,8 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _,
_.entry_points().cend(), entry_point_id);
if (found == _.entry_points().cend()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpExecutionMode Entry Point <id> '"
- << _.getIdName(entry_point_id)
- << "' is not the Entry Point "
+ << "OpExecutionMode Entry Point <id> " << _.getIdName(entry_point_id)
+ << " is not the Entry Point "
"operand of an OpEntryPoint.";
}
@@ -321,14 +390,18 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _,
return true;
case SpvExecutionModelMeshNV:
return _.HasCapability(SpvCapabilityMeshShadingNV);
+ case SpvExecutionModelMeshEXT:
+ return _.HasCapability(
+ SpvCapabilityMeshShadingEXT);
default:
return false;
}
})) {
- if (_.HasCapability(SpvCapabilityMeshShadingNV)) {
+ if (_.HasCapability(SpvCapabilityMeshShadingNV) ||
+ _.HasCapability(SpvCapabilityMeshShadingEXT)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << "Execution mode can only be used with the Geometry or "
- "MeshNV execution model.";
+ << "Execution mode can only be used with the Geometry "
+ "MeshNV or MeshEXT execution model.";
} else {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Execution mode can only be used with the Geometry "
@@ -383,14 +456,18 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _,
return true;
case SpvExecutionModelMeshNV:
return _.HasCapability(SpvCapabilityMeshShadingNV);
+ case SpvExecutionModelMeshEXT:
+ return _.HasCapability(
+ SpvCapabilityMeshShadingEXT);
default:
return false;
}
})) {
- if (_.HasCapability(SpvCapabilityMeshShadingNV)) {
+ if (_.HasCapability(SpvCapabilityMeshShadingNV) ||
+ _.HasCapability(SpvCapabilityMeshShadingEXT)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Execution mode can only be used with a Geometry, "
- "tessellation or MeshNV execution model.";
+ "tessellation, MeshNV or MeshEXT execution model.";
} else {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Execution mode can only be used with a Geometry or "
@@ -398,6 +475,20 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _,
}
}
break;
+ case SpvExecutionModeOutputLinesEXT:
+ case SpvExecutionModeOutputTrianglesEXT:
+ case SpvExecutionModeOutputPrimitivesEXT:
+ if (!std::all_of(models->begin(), models->end(),
+ [](const SpvExecutionModel& model) {
+ return (model == SpvExecutionModelMeshEXT ||
+ model == SpvExecutionModelMeshNV);
+ })) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Execution mode can only be used with the MeshEXT or MeshNV "
+ "execution "
+ "model.";
+ }
+ break;
case SpvExecutionModePixelCenterInteger:
case SpvExecutionModeOriginUpperLeft:
case SpvExecutionModeOriginLowerLeft:
@@ -412,6 +503,13 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _,
case SpvExecutionModeSampleInterlockUnorderedEXT:
case SpvExecutionModeShadingRateInterlockOrderedEXT:
case SpvExecutionModeShadingRateInterlockUnorderedEXT:
+ case SpvExecutionModeEarlyAndLateFragmentTestsAMD:
+ case SpvExecutionModeStencilRefUnchangedFrontAMD:
+ case SpvExecutionModeStencilRefGreaterFrontAMD:
+ case SpvExecutionModeStencilRefLessFrontAMD:
+ case SpvExecutionModeStencilRefUnchangedBackAMD:
+ case SpvExecutionModeStencilRefGreaterBackAMD:
+ case SpvExecutionModeStencilRefLessBackAMD:
if (!std::all_of(models->begin(), models->end(),
[](const SpvExecutionModel& model) {
return model == SpvExecutionModelFragment;
@@ -449,14 +547,19 @@ spv_result_t ValidateExecutionMode(ValidationState_t& _,
case SpvExecutionModelTaskNV:
case SpvExecutionModelMeshNV:
return _.HasCapability(SpvCapabilityMeshShadingNV);
+ case SpvExecutionModelTaskEXT:
+ case SpvExecutionModelMeshEXT:
+ return _.HasCapability(
+ SpvCapabilityMeshShadingEXT);
default:
return false;
}
})) {
- if (_.HasCapability(SpvCapabilityMeshShadingNV)) {
+ if (_.HasCapability(SpvCapabilityMeshShadingNV) ||
+ _.HasCapability(SpvCapabilityMeshShadingEXT)) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Execution mode can only be used with a Kernel, GLCompute, "
- "MeshNV, or TaskNV execution model.";
+ "MeshNV, MeshEXT, TaskNV or TaskEXT execution model.";
} else {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< "Execution mode can only be used with a Kernel or "
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp
index 2b6eb8b5bff..6d4f8a2840c 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_non_uniform.cpp
@@ -63,6 +63,59 @@ spv_result_t ValidateGroupNonUniformBallotBitCount(ValidationState_t& _,
return SPV_SUCCESS;
}
+spv_result_t ValidateGroupNonUniformRotateKHR(ValidationState_t& _,
+ const Instruction* inst) {
+ // Scope is already checked by ValidateExecutionScope() above.
+ const uint32_t result_type = inst->type_id();
+ if (!_.IsIntScalarOrVectorType(result_type) &&
+ !_.IsFloatScalarOrVectorType(result_type) &&
+ !_.IsBoolScalarOrVectorType(result_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Result Type to be a scalar or vector of "
+ "floating-point, integer or boolean type.";
+ }
+
+ const uint32_t value_type = _.GetTypeId(inst->GetOperandAs<uint32_t>(3));
+ if (value_type != result_type) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Result Type must be the same as the type of Value.";
+ }
+
+ const uint32_t delta_type = _.GetTypeId(inst->GetOperandAs<uint32_t>(4));
+ if (!_.IsUnsignedIntScalarType(delta_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Delta must be a scalar of integer type, whose Signedness "
+ "operand is 0.";
+ }
+
+ if (inst->words().size() > 6) {
+ const uint32_t cluster_size_op_id = inst->GetOperandAs<uint32_t>(5);
+ const uint32_t cluster_size_type = _.GetTypeId(cluster_size_op_id);
+ if (!_.IsUnsignedIntScalarType(cluster_size_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "ClusterSize must be a scalar of integer type, whose "
+ "Signedness operand is 0.";
+ }
+
+ uint64_t cluster_size;
+ if (!_.GetConstantValUint64(cluster_size_op_id, &cluster_size)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "ClusterSize must come from a constant instruction.";
+ }
+
+ if ((cluster_size == 0) || ((cluster_size & (cluster_size - 1)) != 0)) {
+ return _.diag(SPV_WARNING, inst)
+ << "Behavior is undefined unless ClusterSize is at least 1 and a "
+ "power of 2.";
+ }
+
+ // TODO(kpet) Warn about undefined behavior when ClusterSize is greater than
+ // the declared SubGroupSize
+ }
+
+ return SPV_SUCCESS;
+}
+
} // namespace
// Validates correctness of non-uniform group instructions.
@@ -79,6 +132,8 @@ spv_result_t NonUniformPass(ValidationState_t& _, const Instruction* inst) {
switch (opcode) {
case SpvOpGroupNonUniformBallotBitCount:
return ValidateGroupNonUniformBallotBitCount(_, inst);
+ case SpvOpGroupNonUniformRotateKHR:
+ return ValidateGroupNonUniformRotateKHR(_, inst);
default:
break;
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_ray_query.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_ray_query.cpp
new file mode 100644
index 00000000000..b553449d0b4
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_ray_query.cpp
@@ -0,0 +1,273 @@
+// 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 query instructions from SPV_KHR_ray_query
+
+#include "source/opcode.h"
+#include "source/val/instruction.h"
+#include "source/val/validate.h"
+#include "source/val/validation_state.h"
+
+namespace spvtools {
+namespace val {
+namespace {
+
+spv_result_t ValidateRayQueryPointer(ValidationState_t& _,
+ const Instruction* inst,
+ uint32_t ray_query_index) {
+ const uint32_t ray_query_id = inst->GetOperandAs<uint32_t>(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)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Ray Query must be a memory object declaration";
+ }
+ auto pointer = _.FindDef(variable->GetOperandAs<uint32_t>(0));
+ if (!pointer || pointer->opcode() != SpvOpTypePointer) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Ray Query must be a pointer";
+ }
+ auto type = _.FindDef(pointer->GetOperandAs<uint32_t>(2));
+ if (!type || type->opcode() != SpvOpTypeRayQueryKHR) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Ray Query must be a pointer to OpTypeRayQueryKHR";
+ }
+ return SPV_SUCCESS;
+}
+
+spv_result_t ValidateIntersectionId(ValidationState_t& _,
+ const Instruction* inst,
+ uint32_t intersection_index) {
+ const uint32_t intersection_id =
+ inst->GetOperandAs<uint32_t>(intersection_index);
+ const uint32_t intersection_type = _.GetTypeId(intersection_id);
+ const SpvOp intersection_opcode = _.GetIdOpcode(intersection_id);
+ if (!_.IsIntScalarType(intersection_type) ||
+ _.GetBitWidth(intersection_type) != 32 ||
+ !spvOpcodeIsConstant(intersection_opcode)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "expected Intersection ID to be a constant 32-bit int scalar";
+ }
+
+ return SPV_SUCCESS;
+}
+
+} // namespace
+
+spv_result_t RayQueryPass(ValidationState_t& _, const Instruction* inst) {
+ const SpvOp opcode = inst->opcode();
+ const uint32_t result_type = inst->type_id();
+
+ switch (opcode) {
+ case SpvOpRayQueryInitializeKHR: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 0)) return error;
+
+ if (_.GetIdOpcode(_.GetOperandTypeId(inst, 1)) !=
+ SpvOpTypeAccelerationStructureKHR) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Acceleration Structure to be of type "
+ "OpTypeAccelerationStructureKHR";
+ }
+
+ const uint32_t ray_flags = _.GetOperandTypeId(inst, 2);
+ if (!_.IsIntScalarType(ray_flags) || _.GetBitWidth(ray_flags) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Ray Flags must be a 32-bit int scalar";
+ }
+
+ const uint32_t cull_mask = _.GetOperandTypeId(inst, 3);
+ if (!_.IsIntScalarType(cull_mask) || _.GetBitWidth(cull_mask) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Cull Mask must be a 32-bit int scalar";
+ }
+
+ const uint32_t ray_origin = _.GetOperandTypeId(inst, 4);
+ 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, 5);
+ 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, 6);
+ 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, 7);
+ 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 SpvOpRayQueryTerminateKHR:
+ case SpvOpRayQueryConfirmIntersectionKHR: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 0)) return error;
+ break;
+ }
+
+ case SpvOpRayQueryGenerateIntersectionKHR: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 0)) return error;
+
+ const uint32_t hit_t_id = _.GetOperandTypeId(inst, 1);
+ if (!_.IsFloatScalarType(hit_t_id) || _.GetBitWidth(hit_t_id) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Hit T must be a 32-bit float scalar";
+ }
+
+ break;
+ }
+
+ case SpvOpRayQueryGetIntersectionFrontFaceKHR:
+ case SpvOpRayQueryProceedKHR:
+ case SpvOpRayQueryGetIntersectionCandidateAABBOpaqueKHR: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error;
+
+ if (!_.IsBoolScalarType(result_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "expected Result Type to be bool scalar type";
+ }
+
+ if (opcode == SpvOpRayQueryGetIntersectionFrontFaceKHR) {
+ if (auto error = ValidateIntersectionId(_, inst, 3)) return error;
+ }
+
+ break;
+ }
+
+ case SpvOpRayQueryGetIntersectionTKHR:
+ case SpvOpRayQueryGetRayTMinKHR: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error;
+
+ if (!_.IsFloatScalarType(result_type) ||
+ _.GetBitWidth(result_type) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "expected Result Type to be 32-bit float scalar type";
+ }
+
+ if (opcode == SpvOpRayQueryGetIntersectionTKHR) {
+ if (auto error = ValidateIntersectionId(_, inst, 3)) return error;
+ }
+
+ break;
+ }
+
+ case SpvOpRayQueryGetIntersectionTypeKHR:
+ case SpvOpRayQueryGetIntersectionInstanceCustomIndexKHR:
+ case SpvOpRayQueryGetIntersectionInstanceIdKHR:
+ case SpvOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR:
+ case SpvOpRayQueryGetIntersectionGeometryIndexKHR:
+ case SpvOpRayQueryGetIntersectionPrimitiveIndexKHR:
+ case SpvOpRayQueryGetRayFlagsKHR: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error;
+
+ if (!_.IsIntScalarType(result_type) || _.GetBitWidth(result_type) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "expected Result Type to be 32-bit int scalar type";
+ }
+
+ if (opcode != SpvOpRayQueryGetRayFlagsKHR) {
+ if (auto error = ValidateIntersectionId(_, inst, 3)) return error;
+ }
+
+ break;
+ }
+
+ case SpvOpRayQueryGetIntersectionObjectRayDirectionKHR:
+ case SpvOpRayQueryGetIntersectionObjectRayOriginKHR:
+ case SpvOpRayQueryGetWorldRayDirectionKHR:
+ case SpvOpRayQueryGetWorldRayOriginKHR: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error;
+
+ if (!_.IsFloatVectorType(result_type) ||
+ _.GetDimension(result_type) != 3 ||
+ _.GetBitWidth(result_type) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "expected Result Type to be 32-bit float 3-component "
+ "vector type";
+ }
+
+ if (opcode == SpvOpRayQueryGetIntersectionObjectRayDirectionKHR ||
+ opcode == SpvOpRayQueryGetIntersectionObjectRayOriginKHR) {
+ if (auto error = ValidateIntersectionId(_, inst, 3)) return error;
+ }
+
+ break;
+ }
+
+ case SpvOpRayQueryGetIntersectionBarycentricsKHR: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error;
+ if (auto error = ValidateIntersectionId(_, inst, 3)) return error;
+
+ if (!_.IsFloatVectorType(result_type) ||
+ _.GetDimension(result_type) != 2 ||
+ _.GetBitWidth(result_type) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "expected Result Type to be 32-bit float 2-component "
+ "vector type";
+ }
+
+ break;
+ }
+
+ case SpvOpRayQueryGetIntersectionObjectToWorldKHR:
+ case SpvOpRayQueryGetIntersectionWorldToObjectKHR: {
+ if (auto error = ValidateRayQueryPointer(_, inst, 2)) return error;
+ if (auto error = ValidateIntersectionId(_, inst, 3)) 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";
+ }
+
+ if (num_cols != 4) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "expected Result Type matrix to have a Column Count of 4";
+ }
+
+ 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";
+ }
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ return SPV_SUCCESS;
+}
+
+} // namespace val
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_ray_tracing.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_ray_tracing.cpp
new file mode 100644
index 00000000000..5b5c8da1e57
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_ray_tracing.cpp
@@ -0,0 +1,209 @@
+// 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_KHR_ray_tracing
+
+#include "source/opcode.h"
+#include "source/val/instruction.h"
+#include "source/val/validate.h"
+#include "source/val/validation_state.h"
+
+namespace spvtools {
+namespace val {
+
+spv_result_t RayTracingPass(ValidationState_t& _, const Instruction* inst) {
+ const SpvOp opcode = inst->opcode();
+ const uint32_t result_type = inst->type_id();
+
+ switch (opcode) {
+ case SpvOpTraceRayKHR: {
+ _.function(inst->function()->id())
+ ->RegisterExecutionModelLimitation(
+ [](SpvExecutionModel model, std::string* message) {
+ if (model != SpvExecutionModelRayGenerationKHR &&
+ model != SpvExecutionModelClosestHitKHR &&
+ model != SpvExecutionModelMissKHR) {
+ if (message) {
+ *message =
+ "OpTraceRayKHR requires RayGenerationKHR, "
+ "ClosestHitKHR and MissKHR execution models";
+ }
+ return false;
+ }
+ return true;
+ });
+
+ if (_.GetIdOpcode(_.GetOperandTypeId(inst, 0)) !=
+ SpvOpTypeAccelerationStructureKHR) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Expected Acceleration Structure to be of type "
+ "OpTypeAccelerationStructureKHR";
+ }
+
+ const uint32_t ray_flags = _.GetOperandTypeId(inst, 1);
+ if (!_.IsIntScalarType(ray_flags) || _.GetBitWidth(ray_flags) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Ray Flags must be a 32-bit int scalar";
+ }
+
+ const uint32_t cull_mask = _.GetOperandTypeId(inst, 2);
+ if (!_.IsIntScalarType(cull_mask) || _.GetBitWidth(cull_mask) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Cull Mask must be a 32-bit int scalar";
+ }
+
+ const uint32_t sbt_offset = _.GetOperandTypeId(inst, 3);
+ if (!_.IsIntScalarType(sbt_offset) || _.GetBitWidth(sbt_offset) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "SBT Offset must be a 32-bit int scalar";
+ }
+
+ const uint32_t sbt_stride = _.GetOperandTypeId(inst, 4);
+ if (!_.IsIntScalarType(sbt_stride) || _.GetBitWidth(sbt_stride) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "SBT Stride must be a 32-bit int scalar";
+ }
+
+ const uint32_t miss_index = _.GetOperandTypeId(inst, 5);
+ if (!_.IsIntScalarType(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, 6);
+ 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, 7);
+ 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, 8);
+ 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, 9);
+ if (!_.IsFloatScalarType(ray_tmax) || _.GetBitWidth(ray_tmax) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Ray TMax must be a 32-bit float scalar";
+ }
+
+ const Instruction* payload = _.FindDef(inst->GetOperandAs<uint32_t>(10));
+ if (payload->opcode() != SpvOpVariable) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Payload must be the result of a OpVariable";
+ } else if (payload->GetOperandAs<uint32_t>(2) !=
+ SpvStorageClassRayPayloadKHR &&
+ payload->GetOperandAs<uint32_t>(2) !=
+ SpvStorageClassIncomingRayPayloadKHR) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Payload must have storage class RayPayloadKHR or "
+ "IncomingRayPayloadKHR";
+ }
+ break;
+ }
+
+ case SpvOpReportIntersectionKHR: {
+ _.function(inst->function()->id())
+ ->RegisterExecutionModelLimitation(
+ [](SpvExecutionModel model, std::string* message) {
+ if (model != SpvExecutionModelIntersectionKHR) {
+ if (message) {
+ *message =
+ "OpReportIntersectionKHR requires IntersectionKHR "
+ "execution model";
+ }
+ return false;
+ }
+ return true;
+ });
+
+ if (!_.IsBoolScalarType(result_type)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "expected Result Type to be bool scalar type";
+ }
+
+ const uint32_t hit = _.GetOperandTypeId(inst, 2);
+ if (!_.IsFloatScalarType(hit) || _.GetBitWidth(hit) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Hit must be a 32-bit int scalar";
+ }
+
+ const uint32_t hit_kind = _.GetOperandTypeId(inst, 3);
+ if (!_.IsUnsignedIntScalarType(hit_kind) ||
+ _.GetBitWidth(hit_kind) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Hit Kind must be a 32-bit unsigned int scalar";
+ }
+ break;
+ }
+
+ case SpvOpExecuteCallableKHR: {
+ _.function(inst->function()->id())
+ ->RegisterExecutionModelLimitation([](SpvExecutionModel model,
+ std::string* message) {
+ if (model != SpvExecutionModelRayGenerationKHR &&
+ model != SpvExecutionModelClosestHitKHR &&
+ model != SpvExecutionModelMissKHR &&
+ model != SpvExecutionModelCallableKHR) {
+ if (message) {
+ *message =
+ "OpExecuteCallableKHR requires RayGenerationKHR, "
+ "ClosestHitKHR, MissKHR and CallableKHR execution models";
+ }
+ return false;
+ }
+ return true;
+ });
+
+ const uint32_t sbt_index = _.GetOperandTypeId(inst, 0);
+ if (!_.IsUnsignedIntScalarType(sbt_index) ||
+ _.GetBitWidth(sbt_index) != 32) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "SBT Index must be a 32-bit unsigned int scalar";
+ }
+
+ const auto callable_data = _.FindDef(inst->GetOperandAs<uint32_t>(1));
+ if (callable_data->opcode() != SpvOpVariable) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Callable Data must be the result of a OpVariable";
+ } else if (callable_data->GetOperandAs<uint32_t>(2) !=
+ SpvStorageClassCallableDataKHR &&
+ callable_data->GetOperandAs<uint32_t>(2) !=
+ SpvStorageClassIncomingCallableDataKHR) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << "Callable Data must have storage class CallableDataKHR or "
+ "IncomingCallableDataKHR";
+ }
+
+ break;
+ }
+
+ default:
+ break;
+ }
+
+ return SPV_SUCCESS;
+}
+} // namespace val
+} // namespace spvtools
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_scopes.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_scopes.cpp
index 29ba583173b..e9781802c46 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_scopes.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_scopes.cpp
@@ -144,14 +144,16 @@ spv_result_t ValidateExecutionScope(ValidationState_t& _,
[errorVUID](SpvExecutionModel model, std::string* message) {
if (model != SpvExecutionModelTaskNV &&
model != SpvExecutionModelMeshNV &&
+ model != SpvExecutionModelTaskEXT &&
+ model != SpvExecutionModelMeshEXT &&
model != SpvExecutionModelTessellationControl &&
model != SpvExecutionModelGLCompute) {
if (message) {
*message =
errorVUID +
"in Vulkan environment, Workgroup execution scope is "
- "only for TaskNV, MeshNV, TessellationControl, and "
- "GLCompute execution models";
+ "only for TaskNV, MeshNV, TaskEXT, MeshEXT, "
+ "TessellationControl, and GLCompute execution models";
}
return false;
}
@@ -220,30 +222,23 @@ spv_result_t ValidateMemoryScope(ValidationState_t& _, const Instruction* inst,
// Vulkan Specific rules
if (spvIsVulkanEnv(_.context()->target_env)) {
- if (value == SpvScopeCrossDevice) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << _.VkErrorID(4638) << spvOpcodeString(opcode)
- << ": in Vulkan environment, Memory Scope cannot be CrossDevice";
- }
- // Vulkan 1.0 specifc rules
- if (_.context()->target_env == SPV_ENV_VULKAN_1_0 &&
- value != SpvScopeDevice && value != SpvScopeWorkgroup &&
- value != SpvScopeInvocation) {
- return _.diag(SPV_ERROR_INVALID_DATA, inst)
- << _.VkErrorID(4638) << spvOpcodeString(opcode)
- << ": in Vulkan 1.0 environment Memory Scope is limited to "
- << "Device, Workgroup and Invocation";
- }
- // Vulkan 1.1 specifc rules
- if ((_.context()->target_env == SPV_ENV_VULKAN_1_1 ||
- _.context()->target_env == SPV_ENV_VULKAN_1_2) &&
- value != SpvScopeDevice && value != SpvScopeWorkgroup &&
+ if (value != SpvScopeDevice && value != SpvScopeWorkgroup &&
value != SpvScopeSubgroup && value != SpvScopeInvocation &&
- value != SpvScopeShaderCallKHR) {
+ value != SpvScopeShaderCallKHR && value != SpvScopeQueueFamily) {
return _.diag(SPV_ERROR_INVALID_DATA, inst)
<< _.VkErrorID(4638) << spvOpcodeString(opcode)
- << ": in Vulkan 1.1 and 1.2 environment Memory Scope is limited "
- << "to Device, Workgroup, Invocation, and ShaderCall";
+ << ": 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)) {
+ return _.diag(SPV_ERROR_INVALID_DATA, inst)
+ << _.VkErrorID(6997) << spvOpcodeString(opcode)
+ << ": in Vulkan 1.0 environment Memory Scope is can not be "
+ "Subgroup without SubgroupBallotKHR or SubgroupVoteKHR "
+ "declared";
}
if (value == SpvScopeShaderCallKHR) {
@@ -270,22 +265,44 @@ spv_result_t ValidateMemoryScope(ValidationState_t& _, const Instruction* inst,
}
if (value == SpvScopeWorkgroup) {
- std::string errorVUID = _.VkErrorID(4639);
+ 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 != SpvExecutionModelMeshNV &&
+ model != SpvExecutionModelTaskEXT &&
+ model != SpvExecutionModelMeshEXT) {
if (message) {
*message = errorVUID +
"Workgroup Memory Scope is limited to MeshNV, "
- "TaskNV, and GLCompute execution model";
+ "TaskNV, MeshEXT, TaskEXT, TessellationControl, "
+ "and GLCompute execution model";
}
return false;
}
return true;
});
+
+ if (_.memory_model() == SpvMemoryModelGLSL450) {
+ errorVUID = _.VkErrorID(7320);
+ _.function(inst->function()->id())
+ ->RegisterExecutionModelLimitation(
+ [errorVUID](SpvExecutionModel model, std::string* message) {
+ if (model == SpvExecutionModelTessellationControl) {
+ if (message) {
+ *message =
+ errorVUID +
+ "Workgroup Memory Scope can't be used with "
+ "TessellationControl using GLSL450 Memory Model";
+ }
+ return false;
+ }
+ return true;
+ });
+ }
}
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_type.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_type.cpp
index 4376b52c6d4..6b0881cf807 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_type.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validate_type.cpp
@@ -152,8 +152,8 @@ spv_result_t ValidateTypeVector(ValidationState_t& _, const Instruction* inst) {
const auto component_type = _.FindDef(component_id);
if (!component_type || !spvOpcodeIsScalarType(component_type->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeVector Component Type <id> '" << _.getIdName(component_id)
- << "' is not a scalar type.";
+ << "OpTypeVector Component Type <id> " << _.getIdName(component_id)
+ << " is not a scalar type.";
}
// Validates that the number of components in the vector is valid.
@@ -215,21 +215,21 @@ spv_result_t ValidateTypeArray(ValidationState_t& _, const Instruction* inst) {
const auto element_type = _.FindDef(element_type_id);
if (!element_type || !spvOpcodeGeneratesType(element_type->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeArray Element Type <id> '" << _.getIdName(element_type_id)
- << "' is not a type.";
+ << "OpTypeArray Element Type <id> " << _.getIdName(element_type_id)
+ << " is not a type.";
}
if (element_type->opcode() == SpvOpTypeVoid) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeArray Element Type <id> '" << _.getIdName(element_type_id)
- << "' is a void type.";
+ << "OpTypeArray Element Type <id> " << _.getIdName(element_type_id)
+ << " is a void type.";
}
if (spvIsVulkanEnv(_.context()->target_env) &&
element_type->opcode() == SpvOpTypeRuntimeArray) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeArray Element Type <id> '" << _.getIdName(element_type_id)
- << "' is not valid in "
+ << _.VkErrorID(4680) << "OpTypeArray Element Type <id> "
+ << _.getIdName(element_type_id) << " is not valid in "
<< spvLogStringForEnv(_.context()->target_env) << " environments.";
}
@@ -238,8 +238,8 @@ spv_result_t ValidateTypeArray(ValidationState_t& _, const Instruction* inst) {
const auto length = _.FindDef(length_id);
if (!length || !spvOpcodeIsConstant(length->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeArray Length <id> '" << _.getIdName(length_id)
- << "' is not a scalar constant type.";
+ << "OpTypeArray Length <id> " << _.getIdName(length_id)
+ << " is not a scalar constant type.";
}
// NOTE: Check the initialiser value of the constant
@@ -248,8 +248,8 @@ spv_result_t ValidateTypeArray(ValidationState_t& _, const Instruction* inst) {
const auto const_result_type = _.FindDef(const_inst[const_result_type_index]);
if (!const_result_type || SpvOpTypeInt != const_result_type->opcode()) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeArray Length <id> '" << _.getIdName(length_id)
- << "' is not a constant integer type.";
+ << "OpTypeArray Length <id> " << _.getIdName(length_id)
+ << " is not a constant integer type.";
}
switch (length->opcode()) {
@@ -261,14 +261,14 @@ spv_result_t ValidateTypeArray(ValidationState_t& _, const Instruction* inst) {
const int64_t ivalue = ConstantLiteralAsInt64(width, length->words());
if (ivalue == 0 || (ivalue < 0 && is_signed)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeArray Length <id> '" << _.getIdName(length_id)
- << "' default value must be at least 1: found " << ivalue;
+ << "OpTypeArray Length <id> " << _.getIdName(length_id)
+ << " default value must be at least 1: found " << ivalue;
}
} break;
case SpvOpConstantNull:
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeArray Length <id> '" << _.getIdName(length_id)
- << "' default value must be at least 1.";
+ << "OpTypeArray Length <id> " << _.getIdName(length_id)
+ << " default value must be at least 1.";
case SpvOpSpecConstantOp:
// Assume it's OK, rather than try to evaluate the operation.
break;
@@ -285,56 +285,27 @@ spv_result_t ValidateTypeRuntimeArray(ValidationState_t& _,
const auto element_type = _.FindDef(element_id);
if (!element_type || !spvOpcodeGeneratesType(element_type->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeRuntimeArray Element Type <id> '"
- << _.getIdName(element_id) << "' is not a type.";
+ << "OpTypeRuntimeArray Element Type <id> " << _.getIdName(element_id)
+ << " is not a type.";
}
if (element_type->opcode() == SpvOpTypeVoid) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeRuntimeArray Element Type <id> '"
- << _.getIdName(element_id) << "' is a void type.";
+ << "OpTypeRuntimeArray Element Type <id> " << _.getIdName(element_id)
+ << " is a void type.";
}
if (spvIsVulkanEnv(_.context()->target_env) &&
element_type->opcode() == SpvOpTypeRuntimeArray) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeRuntimeArray Element Type <id> '"
- << _.getIdName(element_id) << "' is not valid in "
+ << _.VkErrorID(4680) << "OpTypeRuntimeArray Element Type <id> "
+ << _.getIdName(element_id) << " is not valid in "
<< spvLogStringForEnv(_.context()->target_env) << " environments.";
}
return SPV_SUCCESS;
}
-bool ContainsOpaqueType(ValidationState_t& _, const Instruction* str) {
- const size_t elem_type_index = 1;
- uint32_t elem_type_id;
- Instruction* elem_type;
-
- if (spvOpcodeIsBaseOpaqueType(str->opcode())) {
- return true;
- }
-
- switch (str->opcode()) {
- case SpvOpTypeArray:
- case SpvOpTypeRuntimeArray:
- elem_type_id = str->GetOperandAs<uint32_t>(elem_type_index);
- elem_type = _.FindDef(elem_type_id);
- return ContainsOpaqueType(_, elem_type);
- case SpvOpTypeStruct:
- for (size_t member_type_index = 1;
- member_type_index < str->operands().size(); ++member_type_index) {
- auto member_type_id = str->GetOperandAs<uint32_t>(member_type_index);
- auto member_type = _.FindDef(member_type_id);
- if (ContainsOpaqueType(_, member_type)) return true;
- }
- break;
- default:
- break;
- }
- return false;
-}
-
spv_result_t ValidateTypeStruct(ValidationState_t& _, const Instruction* inst) {
const uint32_t struct_id = inst->GetOperandAs<uint32_t>(0);
for (size_t member_type_index = 1;
@@ -348,8 +319,8 @@ spv_result_t ValidateTypeStruct(ValidationState_t& _, const Instruction* inst) {
auto member_type = _.FindDef(member_type_id);
if (!member_type || !spvOpcodeGeneratesType(member_type->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeStruct Member Type <id> '" << _.getIdName(member_type_id)
- << "' is not a type.";
+ << "OpTypeStruct Member Type <id> " << _.getIdName(member_type_id)
+ << " is not a type.";
}
if (member_type->opcode() == SpvOpTypeVoid) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
@@ -373,7 +344,8 @@ spv_result_t ValidateTypeStruct(ValidationState_t& _, const Instruction* inst) {
member_type_index == inst->operands().size() - 1;
if (!is_last_member) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "In " << spvLogStringForEnv(_.context()->target_env)
+ << _.VkErrorID(4680) << "In "
+ << spvLogStringForEnv(_.context()->target_env)
<< ", OpTypeRuntimeArray must only be used for the last member "
"of an OpTypeStruct";
}
@@ -424,8 +396,21 @@ spv_result_t ValidateTypeStruct(ValidationState_t& _, const Instruction* inst) {
_.RegisterStructTypeWithBuiltInMember(struct_id);
}
+ const auto isOpaqueType = [&_](const Instruction* opaque_inst) {
+ auto opcode = opaque_inst->opcode();
+ if (_.HasCapability(SpvCapabilityBindlessTextureNV) &&
+ (opcode == SpvOpTypeImage || opcode == SpvOpTypeSampler ||
+ opcode == SpvOpTypeSampledImage)) {
+ return false;
+ } else if (spvOpcodeIsBaseOpaqueType(opcode)) {
+ return true;
+ }
+ return false;
+ };
+
if (spvIsVulkanEnv(_.context()->target_env) &&
- !_.options()->before_hlsl_legalization && ContainsOpaqueType(_, inst)) {
+ !_.options()->before_hlsl_legalization &&
+ _.ContainsType(inst->id(), isOpaqueType)) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< _.VkErrorID(4667) << "In "
<< spvLogStringForEnv(_.context()->target_env)
@@ -441,8 +426,8 @@ spv_result_t ValidateTypePointer(ValidationState_t& _,
auto type = _.FindDef(type_id);
if (!type || !spvOpcodeGeneratesType(type->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypePointer Type <id> '" << _.getIdName(type_id)
- << "' is not a type.";
+ << "OpTypePointer Type <id> " << _.getIdName(type_id)
+ << " is not a type.";
}
// See if this points to a storage image.
const auto storage_class = inst->GetOperandAs<SpvStorageClass>(1);
@@ -476,8 +461,8 @@ spv_result_t ValidateTypeFunction(ValidationState_t& _,
const auto return_type = _.FindDef(return_type_id);
if (!return_type || !spvOpcodeGeneratesType(return_type->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeFunction Return Type <id> '" << _.getIdName(return_type_id)
- << "' is not a type.";
+ << "OpTypeFunction Return Type <id> " << _.getIdName(return_type_id)
+ << " is not a type.";
}
size_t num_args = 0;
for (size_t param_type_index = 2; param_type_index < inst->operands().size();
@@ -486,14 +471,14 @@ spv_result_t ValidateTypeFunction(ValidationState_t& _,
const auto param_type = _.FindDef(param_id);
if (!param_type || !spvOpcodeGeneratesType(param_type->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeFunction Parameter Type <id> '" << _.getIdName(param_id)
- << "' is not a type.";
+ << "OpTypeFunction Parameter Type <id> " << _.getIdName(param_id)
+ << " is not a type.";
}
if (param_type->opcode() == SpvOpTypeVoid) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeFunction Parameter Type <id> '" << _.getIdName(param_id)
- << "' cannot be OpTypeVoid.";
+ << "OpTypeFunction Parameter Type <id> " << _.getIdName(param_id)
+ << " cannot be OpTypeVoid.";
}
}
const uint32_t num_function_args_limit =
@@ -501,8 +486,8 @@ spv_result_t ValidateTypeFunction(ValidationState_t& _,
if (num_args > num_function_args_limit) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
<< "OpTypeFunction may not take more than "
- << num_function_args_limit << " arguments. OpTypeFunction <id> '"
- << _.getIdName(inst->GetOperandAs<uint32_t>(0)) << "' has "
+ << num_function_args_limit << " arguments. OpTypeFunction <id> "
+ << _.getIdName(inst->GetOperandAs<uint32_t>(0)) << " has "
<< num_args << " arguments.";
}
@@ -565,9 +550,9 @@ spv_result_t ValidateTypeCooperativeMatrixNV(ValidationState_t& _,
if (!component_type || (SpvOpTypeFloat != component_type->opcode() &&
SpvOpTypeInt != component_type->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeCooperativeMatrixNV Component Type <id> '"
+ << "OpTypeCooperativeMatrixNV Component Type <id> "
<< _.getIdName(component_type_id)
- << "' is not a scalar numerical type.";
+ << " is not a scalar numerical type.";
}
const auto scope_index = 2;
@@ -576,8 +561,8 @@ spv_result_t ValidateTypeCooperativeMatrixNV(ValidationState_t& _,
if (!scope || !_.IsIntScalarType(scope->type_id()) ||
!spvOpcodeIsConstant(scope->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeCooperativeMatrixNV Scope <id> '" << _.getIdName(scope_id)
- << "' is not a constant instruction with scalar integer type.";
+ << "OpTypeCooperativeMatrixNV Scope <id> " << _.getIdName(scope_id)
+ << " is not a constant instruction with scalar integer type.";
}
const auto rows_index = 3;
@@ -586,8 +571,8 @@ spv_result_t ValidateTypeCooperativeMatrixNV(ValidationState_t& _,
if (!rows || !_.IsIntScalarType(rows->type_id()) ||
!spvOpcodeIsConstant(rows->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeCooperativeMatrixNV Rows <id> '" << _.getIdName(rows_id)
- << "' is not a constant instruction with scalar integer type.";
+ << "OpTypeCooperativeMatrixNV Rows <id> " << _.getIdName(rows_id)
+ << " is not a constant instruction with scalar integer type.";
}
const auto cols_index = 4;
@@ -596,8 +581,8 @@ spv_result_t ValidateTypeCooperativeMatrixNV(ValidationState_t& _,
if (!cols || !_.IsIntScalarType(cols->type_id()) ||
!spvOpcodeIsConstant(cols->opcode())) {
return _.diag(SPV_ERROR_INVALID_ID, inst)
- << "OpTypeCooperativeMatrixNV Cols <id> '" << _.getIdName(cols_id)
- << "' is not a constant instruction with scalar integer type.";
+ << "OpTypeCooperativeMatrixNV Cols <id> " << _.getIdName(cols_id)
+ << " is not a constant instruction with scalar integer type.";
}
return SPV_SUCCESS;
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validation_state.cpp b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validation_state.cpp
index 10ebd68ceb9..64a0a1a3794 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validation_state.cpp
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validation_state.cpp
@@ -90,6 +90,8 @@ ModuleLayoutSection InstructionLayoutSection(
if (current_section == kLayoutFunctionDeclarations)
return kLayoutFunctionDeclarations;
return kLayoutFunctionDefinitions;
+ case SpvOpSamplerImageAddressingModeNV:
+ return kLayoutSamplerImageAddressMode;
default:
break;
}
@@ -161,6 +163,7 @@ ValidationState_t::ValidationState_t(const spv_const_context ctx,
addressing_model_(SpvAddressingModelMax),
memory_model_(SpvMemoryModelMax),
pointer_size_and_alignment_(0),
+ sampler_image_addressing_mode_(0),
in_function_(false),
num_of_warnings_(0),
max_num_of_warnings_(max_warnings) {
@@ -175,8 +178,18 @@ ValidationState_t::ValidationState_t(const spv_const_context ctx,
}
}
- // LocalSizeId is always allowed in non-Vulkan environments.
- features_.env_allow_localsizeid = !spvIsVulkanEnv(env);
+ // LocalSizeId is only disallowed prior to Vulkan 1.3 without maintenance4.
+ switch (env) {
+ case SPV_ENV_VULKAN_1_0:
+ case SPV_ENV_VULKAN_1_1:
+ case SPV_ENV_VULKAN_1_1_SPIRV_1_4:
+ case SPV_ENV_VULKAN_1_2:
+ features_.env_allow_localsizeid = false;
+ break;
+ default:
+ features_.env_allow_localsizeid = true;
+ break;
+ }
// Only attempt to count if we have words, otherwise let the other validation
// fail and generate an error.
@@ -195,9 +208,12 @@ ValidationState_t::ValidationState_t(const spv_const_context ctx,
}
UpdateFeaturesBasedOnSpirvVersion(&features_, version_);
- friendly_mapper_ = spvtools::MakeUnique<spvtools::FriendlyNameMapper>(
- context_, words_, num_words_);
- name_mapper_ = friendly_mapper_->GetNameMapper();
+ name_mapper_ = spvtools::GetTrivialNameMapper();
+ if (options_->use_friendly_names) {
+ friendly_mapper_ = spvtools::MakeUnique<spvtools::FriendlyNameMapper>(
+ context_, words_, num_words_);
+ name_mapper_ = friendly_mapper_->GetNameMapper();
+ }
}
void ValidationState_t::preallocateStorage() {
@@ -232,7 +248,7 @@ std::string ValidationState_t::getIdName(uint32_t id) const {
const std::string id_name = name_mapper_(id);
std::stringstream out;
- out << id << "[%" << id_name << "]";
+ out << "'" << id << "[%" << id_name << "]'";
return out.str();
}
@@ -382,13 +398,19 @@ void ValidationState_t::RegisterCapability(SpvCapability cap) {
features_.free_fp_rounding_mode = true;
break;
case SpvCapabilityVariablePointers:
- features_.variable_pointers = true;
- features_.variable_pointers_storage_buffer = true;
- break;
case SpvCapabilityVariablePointersStorageBuffer:
- features_.variable_pointers_storage_buffer = true;
+ 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
+ // 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.
+ // The final SPV_KHR_ray_tracing uses a different capability token
+ // number, so it doesn't fall into this case.
break;
}
}
@@ -441,7 +463,7 @@ void ValidationState_t::set_addressing_model(SpvAddressingModel am) {
default:
// fall through
case SpvAddressingModelPhysical64:
- case SpvAddressingModelPhysicalStorageBuffer64EXT:
+ case SpvAddressingModelPhysicalStorageBuffer64:
pointer_size_and_alignment_ = 8;
break;
}
@@ -457,6 +479,15 @@ void ValidationState_t::set_memory_model(SpvMemoryModel mm) {
SpvMemoryModel ValidationState_t::memory_model() const { return memory_model_; }
+void ValidationState_t::set_samplerimage_variable_address_mode(
+ uint32_t bit_width) {
+ sampler_image_addressing_mode_ = bit_width;
+}
+
+uint32_t ValidationState_t::samplerimage_variable_address_mode() const {
+ return sampler_image_addressing_mode_;
+}
+
spv_result_t ValidationState_t::RegisterFunction(
uint32_t id, uint32_t ret_type_id, SpvFunctionControlMask function_control,
uint32_t function_type_id) {
@@ -479,7 +510,7 @@ spv_result_t ValidationState_t::RegisterFunctionEnd() {
"inside of another function");
assert(in_block() == false &&
"RegisterFunctionParameter can only be called when parsing the binary "
- "ouside of a block");
+ "outside of a block");
current_function().RegisterFunctionEnd();
in_function_ = false;
return SPV_SUCCESS;
@@ -497,15 +528,13 @@ void ValidationState_t::RegisterDebugInstruction(const Instruction* inst) {
switch (inst->opcode()) {
case SpvOpName: {
const auto target = inst->GetOperandAs<uint32_t>(0);
- const auto* str = reinterpret_cast<const char*>(inst->words().data() +
- inst->operand(1).offset);
+ const std::string str = inst->GetOperandAs<std::string>(1);
AssignNameToId(target, str);
break;
}
case SpvOpMemberName: {
const auto target = inst->GetOperandAs<uint32_t>(0);
- const auto* str = reinterpret_cast<const char*>(inst->words().data() +
- inst->operand(2).offset);
+ const std::string str = inst->GetOperandAs<std::string>(2);
AssignNameToId(target, str);
break;
}
@@ -524,7 +553,7 @@ void ValidationState_t::RegisterInstruction(Instruction* inst) {
if (inst->id()) all_definitions_.insert(std::make_pair(inst->id(), inst));
// Some validation checks are easier by getting all the consumers
- for (uint16_t i = 0; i < inst->operands().size(); ++i) {
+ for (size_t i = 0; i < inst->operands().size(); ++i) {
const spv_parsed_operand_t& operand = inst->operand(i);
if ((SPV_OPERAND_TYPE_ID == operand.type) ||
(SPV_OPERAND_TYPE_TYPE_ID == operand.type)) {
@@ -582,7 +611,8 @@ void ValidationState_t::RegisterStorageClassConsumer(
std::string errorVUID = VkErrorID(4644);
function(consumer->function()->id())
->RegisterExecutionModelLimitation([errorVUID](
- SpvExecutionModel model, std::string* message) {
+ SpvExecutionModel model,
+ std::string* message) {
if (model == SpvExecutionModelGLCompute ||
model == SpvExecutionModelRayGenerationKHR ||
model == SpvExecutionModelIntersectionKHR ||
@@ -593,7 +623,7 @@ void ValidationState_t::RegisterStorageClassConsumer(
if (message) {
*message =
errorVUID +
- "in Vulkan evironment, Output Storage Class must not be "
+ "in Vulkan environment, Output Storage Class must not be "
"used in GLCompute, RayGenerationKHR, IntersectionKHR, "
"AnyHitKHR, ClosestHitKHR, MissKHR, or CallableKHR "
"execution models";
@@ -608,14 +638,17 @@ void ValidationState_t::RegisterStorageClassConsumer(
std::string errorVUID = VkErrorID(4645);
function(consumer->function()->id())
->RegisterExecutionModelLimitation([errorVUID](
- SpvExecutionModel model, std::string* message) {
+ SpvExecutionModel model,
+ std::string* message) {
if (model != SpvExecutionModelGLCompute &&
model != SpvExecutionModelTaskNV &&
- model != SpvExecutionModelMeshNV) {
+ model != SpvExecutionModelMeshNV &&
+ model != SpvExecutionModelTaskEXT &&
+ model != SpvExecutionModelMeshEXT) {
if (message) {
*message =
errorVUID +
- "in Vulkan evironment, Workgroup Storage Class is limited "
+ "in Vulkan environment, Workgroup Storage Class is limited "
"to MeshNV, TaskNV, and GLCompute execution model";
}
return false;
@@ -624,6 +657,133 @@ void ValidationState_t::RegisterStorageClassConsumer(
});
}
}
+
+ if (storage_class == SpvStorageClassCallableDataKHR) {
+ 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) {
+ if (message) {
+ *message = errorVUID +
+ "CallableDataKHR Storage Class is limited to "
+ "RayGenerationKHR, ClosestHitKHR, CallableKHR, and "
+ "MissKHR execution model";
+ }
+ return false;
+ }
+ return true;
+ });
+ } else if (storage_class == SpvStorageClassIncomingCallableDataKHR) {
+ std::string errorVUID = VkErrorID(4705);
+ function(consumer->function()->id())
+ ->RegisterExecutionModelLimitation([errorVUID](SpvExecutionModel model,
+ std::string* message) {
+ if (model != SpvExecutionModelCallableKHR) {
+ if (message) {
+ *message = errorVUID +
+ "IncomingCallableDataKHR Storage Class is limited to "
+ "CallableKHR execution model";
+ }
+ return false;
+ }
+ return true;
+ });
+ } else if (storage_class == SpvStorageClassRayPayloadKHR) {
+ std::string errorVUID = VkErrorID(4698);
+ function(consumer->function()->id())
+ ->RegisterExecutionModelLimitation([errorVUID](SpvExecutionModel model,
+ std::string* message) {
+ if (model != SpvExecutionModelRayGenerationKHR &&
+ model != SpvExecutionModelClosestHitKHR &&
+ model != SpvExecutionModelMissKHR) {
+ if (message) {
+ *message =
+ errorVUID +
+ "RayPayloadKHR Storage Class is limited to RayGenerationKHR, "
+ "ClosestHitKHR, and MissKHR execution model";
+ }
+ return false;
+ }
+ return true;
+ });
+ } else if (storage_class == SpvStorageClassHitAttributeKHR) {
+ std::string errorVUID = VkErrorID(4701);
+ function(consumer->function()->id())
+ ->RegisterExecutionModelLimitation(
+ [errorVUID](SpvExecutionModel model, std::string* message) {
+ if (model != SpvExecutionModelIntersectionKHR &&
+ model != SpvExecutionModelAnyHitKHR &&
+ model != SpvExecutionModelClosestHitKHR) {
+ if (message) {
+ *message = errorVUID +
+ "HitAttributeKHR Storage Class is limited to "
+ "IntersectionKHR, AnyHitKHR, sand ClosestHitKHR "
+ "execution model";
+ }
+ return false;
+ }
+ return true;
+ });
+ } else if (storage_class == SpvStorageClassIncomingRayPayloadKHR) {
+ std::string errorVUID = VkErrorID(4699);
+ function(consumer->function()->id())
+ ->RegisterExecutionModelLimitation(
+ [errorVUID](SpvExecutionModel model, std::string* message) {
+ if (model != SpvExecutionModelAnyHitKHR &&
+ model != SpvExecutionModelClosestHitKHR &&
+ model != SpvExecutionModelMissKHR) {
+ if (message) {
+ *message =
+ errorVUID +
+ "IncomingRayPayloadKHR Storage Class is limited to "
+ "AnyHitKHR, ClosestHitKHR, and MissKHR execution model";
+ }
+ return false;
+ }
+ return true;
+ });
+ } else if (storage_class == SpvStorageClassShaderRecordBufferKHR) {
+ 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) {
+ if (message) {
+ *message =
+ errorVUID +
+ "ShaderRecordBufferKHR Storage Class is limited to "
+ "RayGenerationKHR, IntersectionKHR, AnyHitKHR, "
+ "ClosestHitKHR, CallableKHR, and MissKHR execution model";
+ }
+ return false;
+ }
+ return true;
+ });
+ } else if (storage_class == SpvStorageClassTaskPayloadWorkgroupEXT) {
+ function(consumer->function()->id())
+ ->RegisterExecutionModelLimitation(
+ [](SpvExecutionModel model, std::string* message) {
+ if (model != SpvExecutionModelTaskEXT &&
+ model != SpvExecutionModelMeshEXT) {
+ if (message) {
+ *message =
+ "TaskPayloadWorkgroupEXT Storage Class is limited to "
+ "TaskEXT and MeshKHR execution model";
+ }
+ return false;
+ }
+ return true;
+ });
+ }
}
uint32_t ValidationState_t::getIdBound() const { return id_bound_; }
@@ -951,6 +1111,11 @@ bool ValidationState_t::GetPointerTypeInfo(uint32_t id, uint32_t* data_type,
return true;
}
+bool ValidationState_t::IsAccelerationStructureType(uint32_t id) const {
+ const Instruction* inst = FindDef(id);
+ return inst && inst->opcode() == SpvOpTypeAccelerationStructureKHR;
+}
+
bool ValidationState_t::IsCooperativeMatrixType(uint32_t id) const {
const Instruction* inst = FindDef(id);
return inst && inst->opcode() == SpvOpTypeCooperativeMatrixNV;
@@ -971,6 +1136,13 @@ bool ValidationState_t::IsUnsignedIntCooperativeMatrixType(uint32_t id) const {
return IsUnsignedIntScalarType(FindDef(id)->word(2));
}
+// Either a 32 bit 2-component uint vector or a 64 bit uint scalar
+bool ValidationState_t::IsUnsigned64BitHandle(uint32_t id) const {
+ return ((IsUnsignedIntScalarType(id) && GetBitWidth(id) == 64) ||
+ (IsUnsignedIntVectorType(id) && GetDimension(id) == 2 &&
+ GetBitWidth(id) == 32));
+}
+
spv_result_t ValidationState_t::CooperativeMatrixShapesMatch(
const Instruction* inst, uint32_t m1, uint32_t m2) {
const auto m1_type = FindDef(m1);
@@ -1372,6 +1544,7 @@ bool ValidationState_t::IsValidStorageClass(
case SpvStorageClassCallableDataKHR:
case SpvStorageClassIncomingCallableDataKHR:
case SpvStorageClassShaderRecordBufferKHR:
+ case SpvStorageClassTaskPayloadWorkgroupEXT:
return true;
default:
return false;
@@ -1390,13 +1563,25 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
return "";
}
- // This large switch case is only searched when an error has occured.
+ // This large switch case is only searched when an error has occurred.
// If an id is changed, the old case must be modified or removed. Each string
// here is interpreted as being "implemented"
// Clang format adds spaces between hyphens
// clang-format off
switch (id) {
+ case 4154:
+ return VUID_WRAP(VUID-BaryCoordKHR-BaryCoordKHR-04154);
+ case 4155:
+ return VUID_WRAP(VUID-BaryCoordKHR-BaryCoordKHR-04155);
+ case 4156:
+ return VUID_WRAP(VUID-BaryCoordKHR-BaryCoordKHR-04156);
+ case 4160:
+ return VUID_WRAP(VUID-BaryCoordNoPerspKHR-BaryCoordNoPerspKHR-04160);
+ case 4161:
+ return VUID_WRAP(VUID-BaryCoordNoPerspKHR-BaryCoordNoPerspKHR-04161);
+ case 4162:
+ return VUID_WRAP(VUID-BaryCoordNoPerspKHR-BaryCoordNoPerspKHR-04162);
case 4181:
return VUID_WRAP(VUID-BaseInstance-BaseInstance-04181);
case 4182:
@@ -1429,6 +1614,12 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
return VUID_WRAP(VUID-CullDistance-CullDistance-04199);
case 4200:
return VUID_WRAP(VUID-CullDistance-CullDistance-04200);
+ case 6735:
+ return VUID_WRAP(VUID-CullMaskKHR-CullMaskKHR-06735); // Execution Model
+ case 6736:
+ return VUID_WRAP(VUID-CullMaskKHR-CullMaskKHR-06736); // input storage
+ case 6737:
+ return VUID_WRAP(VUID-CullMaskKHR-CullMaskKHR-06737); // 32 int scalar
case 4205:
return VUID_WRAP(VUID-DeviceIndex-DeviceIndex-04205);
case 4206:
@@ -1797,8 +1988,8 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
return VUID_WRAP(VUID-StandaloneSpirv-None-04637);
case 4638:
return VUID_WRAP(VUID-StandaloneSpirv-None-04638);
- case 4639:
- return VUID_WRAP(VUID-StandaloneSpirv-None-04639);
+ case 7321:
+ return VUID_WRAP(VUID-StandaloneSpirv-None-07321);
case 4640:
return VUID_WRAP(VUID-StandaloneSpirv-None-04640);
case 4641:
@@ -1839,18 +2030,38 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
return VUID_WRAP(VUID-StandaloneSpirv-None-04667);
case 4669:
return VUID_WRAP(VUID-StandaloneSpirv-GLSLShared-04669);
+ case 4670:
+ return VUID_WRAP(VUID-StandaloneSpirv-Flat-04670);
case 4675:
return VUID_WRAP(VUID-StandaloneSpirv-FPRoundingMode-04675);
case 4677:
return VUID_WRAP(VUID-StandaloneSpirv-Invariant-04677);
+ case 4680:
+ return VUID_WRAP(VUID-StandaloneSpirv-OpTypeRuntimeArray-04680);
case 4682:
return VUID_WRAP(VUID-StandaloneSpirv-OpControlBarrier-04682);
- case 4683:
- return VUID_WRAP(VUID-StandaloneSpirv-LocalSize-04683);
+ case 6426:
+ return VUID_WRAP(VUID-StandaloneSpirv-LocalSize-06426); // formally 04683
case 4685:
return VUID_WRAP(VUID-StandaloneSpirv-OpGroupNonUniformBallotBitCount-04685);
case 4686:
return VUID_WRAP(VUID-StandaloneSpirv-None-04686);
+ case 4698:
+ return VUID_WRAP(VUID-StandaloneSpirv-RayPayloadKHR-04698);
+ case 4699:
+ return VUID_WRAP(VUID-StandaloneSpirv-IncomingRayPayloadKHR-04699);
+ case 4701:
+ return VUID_WRAP(VUID-StandaloneSpirv-HitAttributeKHR-04701);
+ case 4703:
+ return VUID_WRAP(VUID-StandaloneSpirv-HitAttributeKHR-04703);
+ case 4704:
+ return VUID_WRAP(VUID-StandaloneSpirv-CallableDataKHR-04704);
+ case 4705:
+ return VUID_WRAP(VUID-StandaloneSpirv-IncomingCallableDataKHR-04705);
+ case 7119:
+ return VUID_WRAP(VUID-StandaloneSpirv-ShaderRecordBufferKHR-07119);
+ case 4708:
+ return VUID_WRAP(VUID-StandaloneSpirv-PhysicalStorageBuffer64-04708);
case 4710:
return VUID_WRAP(VUID-StandaloneSpirv-PhysicalStorageBuffer64-04710);
case 4711:
@@ -1863,8 +2074,82 @@ std::string ValidationState_t::VkErrorID(uint32_t id,
return VUID_WRAP(VUID-StandaloneSpirv-OpMemoryBarrier-04732);
case 4733:
return VUID_WRAP(VUID-StandaloneSpirv-OpMemoryBarrier-04733);
+ case 4734:
+ return VUID_WRAP(VUID-StandaloneSpirv-OpVariable-04734);
+ case 4744:
+ return VUID_WRAP(VUID-StandaloneSpirv-Flat-04744);
+ case 4777:
+ return VUID_WRAP(VUID-StandaloneSpirv-OpImage-04777);
case 4780:
return VUID_WRAP(VUID-StandaloneSpirv-Result-04780);
+ case 4781:
+ return VUID_WRAP(VUID-StandaloneSpirv-Base-04781);
+ case 4915:
+ return VUID_WRAP(VUID-StandaloneSpirv-Location-04915);
+ case 4916:
+ return VUID_WRAP(VUID-StandaloneSpirv-Location-04916);
+ case 4917:
+ return VUID_WRAP(VUID-StandaloneSpirv-Location-04917);
+ case 4918:
+ return VUID_WRAP(VUID-StandaloneSpirv-Location-04918);
+ case 4919:
+ return VUID_WRAP(VUID-StandaloneSpirv-Location-04919);
+ case 4920:
+ return VUID_WRAP(VUID-StandaloneSpirv-Component-04920);
+ case 4921:
+ return VUID_WRAP(VUID-StandaloneSpirv-Component-04921);
+ case 4922:
+ return VUID_WRAP(VUID-StandaloneSpirv-Component-04922);
+ case 4923:
+ return VUID_WRAP(VUID-StandaloneSpirv-Component-04923);
+ case 4924:
+ return VUID_WRAP(VUID-StandaloneSpirv-Component-04924);
+ case 6201:
+ return VUID_WRAP(VUID-StandaloneSpirv-Flat-06201);
+ case 6202:
+ return VUID_WRAP(VUID-StandaloneSpirv-Flat-06202);
+ case 6214:
+ return VUID_WRAP(VUID-StandaloneSpirv-OpTypeImage-06214);
+ case 6491:
+ return VUID_WRAP(VUID-StandaloneSpirv-DescriptorSet-06491);
+ case 6671:
+ return VUID_WRAP(VUID-StandaloneSpirv-OpTypeSampledImage-06671);
+ case 6672:
+ return VUID_WRAP(VUID-StandaloneSpirv-Location-06672);
+ case 6674:
+ return VUID_WRAP(VUID-StandaloneSpirv-OpEntryPoint-06674);
+ case 6675:
+ return VUID_WRAP(VUID-StandaloneSpirv-PushConstant-06675);
+ case 6676:
+ return VUID_WRAP(VUID-StandaloneSpirv-Uniform-06676);
+ case 6677:
+ return VUID_WRAP(VUID-StandaloneSpirv-UniformConstant-06677);
+ case 6678:
+ return VUID_WRAP(VUID-StandaloneSpirv-InputAttachmentIndex-06678);
+ case 6777:
+ return VUID_WRAP(VUID-StandaloneSpirv-PerVertexKHR-06777);
+ case 6778:
+ return VUID_WRAP(VUID-StandaloneSpirv-Input-06778);
+ case 6807:
+ return VUID_WRAP(VUID-StandaloneSpirv-Uniform-06807);
+ case 6808:
+ 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:
+ return VUID_WRAP(VUID-StandaloneSpirv-ExecutionModel-07320);
+ case 7290:
+ return VUID_WRAP(VUID-StandaloneSpirv-Input-07290);
+ case 7650:
+ return VUID_WRAP(VUID-StandaloneSpirv-Base-07650);
+ case 7651:
+ return VUID_WRAP(VUID-StandaloneSpirv-Base-07651);
+ case 7652:
+ return VUID_WRAP(VUID-StandaloneSpirv-Base-07652);
default:
return ""; // unknown id
}
diff --git a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validation_state.h b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validation_state.h
index 2ddfa4a9383..1b599ff35e1 100644
--- a/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validation_state.h
+++ b/3rdparty/bgfx/3rdparty/spirv-tools/source/val/validation_state.h
@@ -44,19 +44,20 @@ namespace val {
/// of the SPIRV spec for additional details of the order. The enumerant values
/// are in the same order as the vector returned by GetModuleOrder
enum ModuleLayoutSection {
- kLayoutCapabilities, /// < Section 2.4 #1
- kLayoutExtensions, /// < Section 2.4 #2
- kLayoutExtInstImport, /// < Section 2.4 #3
- kLayoutMemoryModel, /// < Section 2.4 #4
- kLayoutEntryPoint, /// < Section 2.4 #5
- kLayoutExecutionMode, /// < Section 2.4 #6
- kLayoutDebug1, /// < Section 2.4 #7 > 1
- kLayoutDebug2, /// < Section 2.4 #7 > 2
- kLayoutDebug3, /// < Section 2.4 #7 > 3
- kLayoutAnnotations, /// < Section 2.4 #8
- kLayoutTypes, /// < Section 2.4 #9
- kLayoutFunctionDeclarations, /// < Section 2.4 #10
- kLayoutFunctionDefinitions /// < Section 2.4 #11
+ kLayoutCapabilities, /// < Section 2.4 #1
+ kLayoutExtensions, /// < Section 2.4 #2
+ kLayoutExtInstImport, /// < Section 2.4 #3
+ kLayoutMemoryModel, /// < Section 2.4 #4
+ kLayoutSamplerImageAddressMode, /// < Section 2.4 #5
+ kLayoutEntryPoint, /// < Section 2.4 #6
+ kLayoutExecutionMode, /// < Section 2.4 #7
+ kLayoutDebug1, /// < Section 2.4 #8 > 1
+ kLayoutDebug2, /// < Section 2.4 #8 > 2
+ kLayoutDebug3, /// < Section 2.4 #8 > 3
+ kLayoutAnnotations, /// < Section 2.4 #9
+ kLayoutTypes, /// < Section 2.4 #10
+ kLayoutFunctionDeclarations, /// < Section 2.4 #11
+ kLayoutFunctionDefinitions /// < Section 2.4 #12
};
/// This class manages the state of the SPIR-V validation as it is being parsed.
@@ -67,14 +68,12 @@ class ValidationState_t {
bool declare_int16_type = false; // Allow OpTypeInt with 16 bit width?
bool declare_float16_type = false; // Allow OpTypeFloat with 16 bit width?
bool free_fp_rounding_mode = false; // Allow the FPRoundingMode decoration
- // and its vaules to be used without
+ // and its values to be used without
// requiring any capability
- // Allow functionalities enabled by VariablePointers capability.
+ // Allow functionalities enabled by VariablePointers or
+ // VariablePointersStorageBuffer capability.
bool variable_pointers = false;
- // Allow functionalities enabled by VariablePointersStorageBuffer
- // capability.
- bool variable_pointers_storage_buffer = false;
// Permit group oerations Reduce, InclusiveScan, ExclusiveScan
bool group_ops_reduce_and_scans = false;
@@ -362,6 +361,20 @@ class ValidationState_t {
/// Returns the memory model of this module, or Simple if uninitialized.
SpvMemoryModel memory_model() const;
+ /// Sets the bit width for sampler/image type variables. If not set, they are
+ /// considered opaque
+ void set_samplerimage_variable_address_mode(uint32_t bit_width);
+
+ /// Get the addressing mode currently set. If 0, it means addressing mode is
+ /// invalid Sampler/Image type variables must be considered opaque This mode
+ /// is only valid after the instruction has been read
+ uint32_t samplerimage_variable_address_mode() const;
+
+ /// Returns true if the OpSamplerImageAddressingModeNV was found.
+ bool has_samplerimage_variable_address_mode_specified() const {
+ return sampler_image_addressing_mode_ != 0;
+ }
+
const AssemblyGrammar& grammar() const { return grammar_; }
/// Inserts the instruction into the list of ordered instructions in the file.
@@ -377,17 +390,14 @@ class ValidationState_t {
/// Registers the decoration for the given <id>
void RegisterDecorationForId(uint32_t id, const Decoration& dec) {
auto& dec_list = id_decorations_[id];
- auto lb = std::find(dec_list.begin(), dec_list.end(), dec);
- if (lb == dec_list.end()) {
- dec_list.push_back(dec);
- }
+ dec_list.insert(dec);
}
/// Registers the list of decorations for the given <id>
template <class InputIt>
void RegisterDecorationsForId(uint32_t id, InputIt begin, InputIt end) {
- std::vector<Decoration>& cur_decs = id_decorations_[id];
- cur_decs.insert(cur_decs.end(), begin, end);
+ std::set<Decoration>& cur_decs = id_decorations_[id];
+ cur_decs.insert(begin, end);
}
/// Registers the list of decorations for the given member of the given
@@ -396,21 +406,44 @@ class ValidationState_t {
void RegisterDecorationsForStructMember(uint32_t struct_id,
uint32_t member_index, InputIt begin,
InputIt end) {
- RegisterDecorationsForId(struct_id, begin, end);
- for (auto& decoration : id_decorations_[struct_id]) {
- decoration.set_struct_member_index(member_index);
+ std::set<Decoration>& cur_decs = id_decorations_[struct_id];
+ for (InputIt iter = begin; iter != end; ++iter) {
+ Decoration dec = *iter;
+ dec.set_struct_member_index(member_index);
+ cur_decs.insert(dec);
}
}
/// Returns all the decorations for the given <id>. If no decorations exist
- /// for the <id>, it registers an empty vector for it in the map and
- /// returns the empty vector.
- std::vector<Decoration>& id_decorations(uint32_t id) {
+ /// for the <id>, it registers an empty set for it in the map and
+ /// returns the empty set.
+ std::set<Decoration>& id_decorations(uint32_t id) {
return id_decorations_[id];
}
+ /// Returns the range of decorations for the given field of the given <id>.
+ struct FieldDecorationsIter {
+ std::set<Decoration>::const_iterator begin;
+ std::set<Decoration>::const_iterator end;
+ };
+ FieldDecorationsIter id_member_decorations(uint32_t id,
+ uint32_t member_index) {
+ const auto& decorations = id_decorations_[id];
+
+ // 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);
+
+ FieldDecorationsIter result;
+ result.begin = decorations.lower_bound(min_decoration);
+ result.end = decorations.upper_bound(max_decoration);
+
+ return result;
+ }
+
// Returns const pointer to the internal decoration container.
- const std::map<uint32_t, std::vector<Decoration>>& id_decorations() const {
+ const std::map<uint32_t, std::set<Decoration>>& id_decorations() const {
return id_decorations_;
}
@@ -574,10 +607,12 @@ class ValidationState_t {
bool IsBoolVectorType(uint32_t id) const;
bool IsBoolScalarOrVectorType(uint32_t id) const;
bool IsPointerType(uint32_t id) const;
+ bool IsAccelerationStructureType(uint32_t id) const;
bool IsCooperativeMatrixType(uint32_t id) const;
bool IsFloatCooperativeMatrixType(uint32_t id) const;
bool IsIntCooperativeMatrixType(uint32_t id) const;
bool IsUnsignedIntCooperativeMatrixType(uint32_t id) const;
+ bool IsUnsigned64BitHandle(uint32_t id) const;
// Returns true if |id| is a type id that contains |type| (or integer or
// floating point type) of |width| bits.
@@ -688,6 +723,16 @@ class ValidationState_t {
// Returns the disassembly string for the given instruction.
std::string Disassemble(const uint32_t* words, uint16_t num_words) const;
+ // Returns the string name for |decoration|.
+ std::string SpvDecorationString(uint32_t decoration) {
+ spv_operand_desc desc = nullptr;
+ if (grammar_.lookupOperand(SPV_OPERAND_TYPE_DECORATION, decoration,
+ &desc) != SPV_SUCCESS) {
+ return std::string("Unknown");
+ }
+ return std::string(desc->name);
+ }
+
// Returns whether type m1 and type m2 are cooperative matrices with
// the same "shape" (matching scope, rows, cols). If any are specialization
// constants, we assume they can match because we can't prove they don't.
@@ -797,7 +842,7 @@ class ValidationState_t {
/// IDs that are entry points, ie, arguments to OpEntryPoint.
std::vector<uint32_t> entry_points_;
- /// Maps an entry point id to its desciptions.
+ /// Maps an entry point id to its descriptions.
std::unordered_map<uint32_t, std::vector<EntryPointDescription>>
entry_point_descriptions_;
@@ -828,7 +873,7 @@ class ValidationState_t {
struct_has_nested_blockorbufferblock_struct_;
/// Stores the list of decorations for a given <id>
- std::map<uint32_t, std::vector<Decoration>> id_decorations_;
+ std::map<uint32_t, std::set<Decoration>> id_decorations_;
/// Stores type declarations which need to be unique (i.e. non-aggregates),
/// in the form [opcode, operand words], result_id is not stored.
@@ -844,6 +889,9 @@ class ValidationState_t {
// have the same pointer size (for physical pointer types).
uint32_t pointer_size_and_alignment_;
+ /// bit width of sampler/image type variables. Valid values are 32 and 64
+ uint32_t sampler_image_addressing_mode_;
+
/// NOTE: See correspoding getter functions
bool in_function_;
diff --git a/3rdparty/bgfx/3rdparty/stb/LICENSE b/3rdparty/bgfx/3rdparty/stb/LICENSE
new file mode 100644
index 00000000000..a77ae91f3ec
--- /dev/null
+++ b/3rdparty/bgfx/3rdparty/stb/LICENSE
@@ -0,0 +1,37 @@
+This software is available under 2 licenses -- choose whichever you prefer.
+------------------------------------------------------------------------------
+ALTERNATIVE A - MIT License
+Copyright (c) 2017 Sean Barrett
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is 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 Software.
+THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+------------------------------------------------------------------------------
+ALTERNATIVE B - Public Domain (www.unlicense.org)
+This is free and unencumbered software released into the public domain.
+Anyone is free to copy, modify, publish, use, compile, sell, or distribute this
+software, either in source code form or as a compiled binary, for any purpose,
+commercial or non-commercial, and by any means.
+In jurisdictions that recognize copyright laws, the author or authors of this
+software dedicate any and all copyright interest in the software to the public
+domain. We make this dedication for the benefit of the public at large and to
+the detriment of our heirs and successors. We intend this dedication to be an
+overt act of relinquishment in perpetuity of all present and future rights to
+this software under copyright law.
+THE SOFTWARE IS 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 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/3rdparty/bgfx/3rdparty/stb/stb_rect_pack.h b/3rdparty/bgfx/3rdparty/stb/stb_rect_pack.h
index 5c848de0e74..f6917e7a6e5 100644
--- a/3rdparty/bgfx/3rdparty/stb/stb_rect_pack.h
+++ b/3rdparty/bgfx/3rdparty/stb/stb_rect_pack.h
@@ -1,9 +1,19 @@
-// stb_rect_pack.h - v1.00 - public domain - rectangle packing
+// [DEAR IMGUI]
+// This is a slightly modified version of stb_rect_pack.h 1.01.
+// Grep for [DEAR IMGUI] to find the changes.
+//
+// stb_rect_pack.h - v1.01 - public domain - rectangle packing
// Sean Barrett 2014
//
// Useful for e.g. packing rectangular textures into an atlas.
// Does not do rotation.
//
+// Before #including,
+//
+// #define STB_RECT_PACK_IMPLEMENTATION
+//
+// in the file that you want to have the implementation.
+//
// Not necessarily the awesomest packing method, but better than
// the totally naive one in stb_truetype (which is primarily what
// this is meant to replace).
@@ -35,6 +45,7 @@
//
// Version history:
//
+// 1.01 (2021-07-11) always use large rect mode, expose STBRP__MAXVAL in public section
// 1.00 (2019-02-25) avoid small space waste; gracefully fail too-wide rectangles
// 0.99 (2019-02-07) warning fixes
// 0.11 (2017-03-03) return packing success/fail result
@@ -75,11 +86,10 @@ typedef struct stbrp_context stbrp_context;
typedef struct stbrp_node stbrp_node;
typedef struct stbrp_rect stbrp_rect;
-#ifdef STBRP_LARGE_RECTS
typedef int stbrp_coord;
-#else
-typedef unsigned short stbrp_coord;
-#endif
+
+#define STBRP__MAXVAL 0x7fffffff
+// Mostly for internal use, but this is the maximum supported coordinate value.
STBRP_DEF int stbrp_pack_rects (stbrp_context *context, stbrp_rect *rects, int num_rects);
// Assign packed locations to rectangles. The rectangles are of type
@@ -209,8 +219,10 @@ struct stbrp_context
#ifdef _MSC_VER
#define STBRP__NOTUSED(v) (void)(v)
+#define STBRP__CDECL __cdecl
#else
#define STBRP__NOTUSED(v) (void)sizeof(v)
+#define STBRP__CDECL
#endif
enum
@@ -253,9 +265,6 @@ STBRP_DEF void stbrp_setup_allow_out_of_mem(stbrp_context *context, int allow_ou
STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height, stbrp_node *nodes, int num_nodes)
{
int i;
-#ifndef STBRP_LARGE_RECTS
- STBRP_ASSERT(width <= 0xffff && height <= 0xffff);
-#endif
for (i=0; i < num_nodes-1; ++i)
nodes[i].next = &nodes[i+1];
@@ -274,11 +283,7 @@ STBRP_DEF void stbrp_init_target(stbrp_context *context, int width, int height,
context->extra[0].y = 0;
context->extra[0].next = &context->extra[1];
context->extra[1].x = (stbrp_coord) width;
-#ifdef STBRP_LARGE_RECTS
context->extra[1].y = (1<<30);
-#else
- context->extra[1].y = 65535;
-#endif
context->extra[1].next = NULL;
}
@@ -424,7 +429,7 @@ static stbrp__findresult stbrp__skyline_find_best_pos(stbrp_context *c, int widt
if (y <= best_y) {
if (y < best_y || waste < best_waste || (waste==best_waste && xpos < best_x)) {
best_x = xpos;
- STBRP_ASSERT(y <= best_y);
+ //STBRP_ASSERT(y <= best_y); [DEAR IMGUI]
best_y = y;
best_waste = waste;
best = prev;
@@ -520,7 +525,7 @@ static stbrp__findresult stbrp__skyline_pack_rectangle(stbrp_context *context, i
return res;
}
-static int rect_height_compare(const void *a, const void *b)
+static int STBRP__CDECL rect_height_compare(const void *a, const void *b)
{
const stbrp_rect *p = (const stbrp_rect *) a;
const stbrp_rect *q = (const stbrp_rect *) b;
@@ -531,19 +536,13 @@ static int rect_height_compare(const void *a, const void *b)
return (p->w > q->w) ? -1 : (p->w < q->w);
}
-static int rect_original_order(const void *a, const void *b)
+static int STBRP__CDECL rect_original_order(const void *a, const void *b)
{
const stbrp_rect *p = (const stbrp_rect *) a;
const stbrp_rect *q = (const stbrp_rect *) b;
return (p->was_packed < q->was_packed) ? -1 : (p->was_packed > q->was_packed);
}
-#ifdef STBRP_LARGE_RECTS
-#define STBRP__MAXVAL 0xffffffff
-#else
-#define STBRP__MAXVAL 0xffff
-#endif
-
STBRP_DEF int stbrp_pack_rects(stbrp_context *context, stbrp_rect *rects, int num_rects)
{
int i, all_rects_packed = 1;
diff --git a/3rdparty/bgfx/LICENSE b/3rdparty/bgfx/LICENSE
index 9fbd22dcba1..e21e5d5f338 100644
--- a/3rdparty/bgfx/LICENSE
+++ b/3rdparty/bgfx/LICENSE
@@ -1,4 +1,4 @@
-Copyright 2010-2021 Branimir Karadzic
+Copyright 2010-2022 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/3rdparty/bgfx/README.md b/3rdparty/bgfx/README.md
index 9acdf367b30..e11cb4dbc95 100644
--- a/3rdparty/bgfx/README.md
+++ b/3rdparty/bgfx/README.md
@@ -16,13 +16,13 @@
<a href="#license-bsd-2-clause">License</a>
</p>
-[![Build status](https://ci.appveyor.com/api/projects/status/ipa3ojgeaet1oko5?svg=true)](https://ci.appveyor.com/project/bkaradzic/bgfx)
+[![GitHub Actions](https://github.com/bkaradzic/bgfx/actions/workflows/main.yml/badge.svg)](https://github.com/bkaradzic/bgfx/actions)
[![License](https://img.shields.io/badge/license-BSD--2%20clause-blue.svg)](https://bkaradzic.github.io/bgfx/license.html)
[![Join the chat at https://discord.gg/9eMbv7J](https://img.shields.io/discord/712512073522872352?color=%237289DA&label=bgfx&logo=discord&logoColor=white)](https://discord.gg/9eMbv7J)
* [GitHub Discussions](https://github.com/bkaradzic/bgfx/discussions)
* [Discord Chat](https://discord.gg/9eMbv7J)
- * [AppVeyor CI](https://ci.appveyor.com/project/bkaradzic/bgfx)
+ * [GitHub Actions](https://github.com/bkaradzic/bgfx/actions)
[What is it?](https://bkaradzic.github.io/bgfx/overview.html)
-------------------------------------------------------------
@@ -49,7 +49,6 @@ Supported rendering backends:
Supported platforms:
* Android (14+, ARM, x86, MIPS)
- * asm.js/Emscripten (1.25.0)
* FreeBSD
* iOS (iPhone, iPad, AppleTV)
* Linux
@@ -57,8 +56,9 @@ Supported platforms:
* OSX (10.12+)
* PlayStation 4
* RaspberryPi
- * Windows (XP, Vista, 7, 8, 10)
* UWP (Universal Windows, Xbox One)
+ * Wasm/Emscripten
+ * Windows (XP, Vista, 7, 8, 10)
Supported compilers:
@@ -71,7 +71,6 @@ Languages:
* [C/C++ API documentation](https://bkaradzic.github.io/bgfx/bgfx.html)
* [Beef API bindings](https://github.com/bkaradzic/bgfx/tree/master/bindings/bf)
* [C# language API bindings #1](https://github.com/bkaradzic/bgfx/tree/master/bindings/cs)
- * [C#/VB/F# language API bindings #2](https://github.com/MikePopoloski/SharpBgfx)
* [D language API bindings](https://github.com/GoaLitiuM/bindbc-bgfx)
* [Go language API bindings](https://github.com/james4k/go-bgfx)
* [Haskell language API bindings](https://github.com/haskell-game/bgfx)
@@ -81,12 +80,12 @@ Languages:
* [Pascal language API bindings](https://github.com/Akira13641/PasBGFX)
* [Python language API bindings #1](https://github.com/fbertola/bgfx-python#-----bgfx-python--)
* [Python language API bindings #2](https://github.com/jnadro/pybgfx#pybgfx)
- * [Rust language API bindings (obsolete)](https://github.com/rhoot/bgfx-rs)
* [Rust language API bindings (new)](https://github.com/emoon/bgfx-rs)
* [Swift language API bindings](https://github.com/stuartcarnie/SwiftBGFX)
+ * [Zig language API bindings](https://github.com/bkaradzic/bgfx/tree/master/bindings/zig)
-Who is using it? [#madewithbgfx](https://twitter.com/search?q=%23madewithbgfx&f=live)
--------------------------------------------------------------------------------------
+Who is using it? [#madewithbgfx](https://twitter.com/search?q=%23madewithbgfx&src=typed_query&f=live)
+-----------------------------------------------------------------------------------------------------
## Airmech
@@ -366,9 +365,9 @@ width="640" height="480" border="0" /></a>
An open source reimplementation of the game Black & White (2001).
-[OpenBlack](https://github.com/openblack/openblack#openblack)
+[openblack](https://github.com/openblack/openblack#openblack)
-![openblack](https://user-images.githubusercontent.com/1388267/67631321-93c85380-f88c-11e9-9103-804807844af2.png)
+![openblack](https://user-images.githubusercontent.com/32263167/184559293-56cfc6a7-a7da-4876-8fce-434ba8827eae.png)
## Cluster
@@ -488,6 +487,49 @@ https://www.guildwars2.com/
![Guild-Wars-2-wallpaper](https://d3b4yo2b5lbfy.cloudfront.net/wp-content/uploads/wallpapers/GuildWars2-01-800x600.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
+
+<a href="http://www.youtube.com/watch?feature=player_embedded&v=ufl14_Ne5Lg"
+target="_blank"><img src="http://img.youtube.com/vi/ufl14_Ne5Lg/0.jpg"
+alt="Griftlands"
+width="640" height="480" border="0" /></a>
+
+## 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.
+
+![HARFANG-STUDIO](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.
+
+<a href="http://www.youtube.com/watch?feature=player_embedded&v=Ma1-UBa3f2E"
+target="_blank"><img src="http://img.youtube.com/vi/Ma1-UBa3f2E/0.jpg"
+alt="Marine Melodies"
+width="640" height="480" border="0" /></a>
+
+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!
+
+![Activeworlds-wallpaper](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.
+
+![Equilibrium Engine](https://raw.githubusercontent.com/clibequilibrium/EquilibriumEngine/master/docs/city.png)
+
[License (BSD 2-clause)](https://bkaradzic.github.io/bgfx/license.html)
-----------------------------------------------------------------------
@@ -495,7 +537,7 @@ https://www.guildwars2.com/
<img align="right" src="http://opensource.org/trademarks/opensource/OSI-Approved-License-100x137.png">
</a>
- Copyright 2010-2021 Branimir Karadzic
+ Copyright 2010-2022 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/3rdparty/bgfx/bindings/bf/bgfx.bf b/3rdparty/bgfx/bindings/bf/bgfx.bf
index 89dfa303b4a..71d5e2556d9 100644
--- a/3rdparty/bgfx/bindings/bf/bgfx.bf
+++ b/3rdparty/bgfx/bindings/bf/bgfx.bf
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
@@ -604,7 +604,7 @@ public static class bgfx
Text = 0x00000008,
/// <summary>
- /// Enable profiler.
+ /// Enable profiler. This causes per-view statistics to be collected, available through `bgfx::Stats::ViewStats`. This is unrelated to the profiler functions in `bgfx::CallbackI`.
/// </summary>
Profiler = 0x00000010,
}
@@ -997,6 +997,11 @@ public static class bgfx
/// Suspend rendering.
/// </summary>
Suspend = 0x00080000,
+
+ /// <summary>
+ /// Transparent backbuffer. Availability depends on: `BGFX_CAPS_TRANSPARENT_BACKBUFFER`.
+ /// </summary>
+ TransparentBackbuffer = 0x00100000,
FullscreenShift = 0,
FullscreenMask = 0x00000001,
ReservedShift = 31,
@@ -1100,52 +1105,62 @@ public static class bgfx
/// Texture blit is supported.
/// </summary>
TextureBlit = 0x0000000000040000,
- TextureCompareReserved = 0x0000000000080000,
+
+ /// <summary>
+ /// Transparent back buffer supported.
+ /// </summary>
+ TransparentBackbuffer = 0x0000000000080000,
+ TextureCompareReserved = 0x0000000000100000,
/// <summary>
/// Texture compare less equal mode is supported.
/// </summary>
- TextureCompareLequal = 0x0000000000100000,
+ TextureCompareLequal = 0x0000000000200000,
/// <summary>
/// Cubemap texture array is supported.
/// </summary>
- TextureCubeArray = 0x0000000000200000,
+ TextureCubeArray = 0x0000000000400000,
/// <summary>
/// CPU direct access to GPU texture memory.
/// </summary>
- TextureDirectAccess = 0x0000000000400000,
+ TextureDirectAccess = 0x0000000000800000,
/// <summary>
/// Read-back texture is supported.
/// </summary>
- TextureReadBack = 0x0000000000800000,
+ TextureReadBack = 0x0000000001000000,
/// <summary>
/// Vertex attribute half-float is supported.
/// </summary>
- VertexAttribHalf = 0x0000000001000000,
+ VertexAttribHalf = 0x0000000002000000,
/// <summary>
/// Vertex attribute 10_10_10_2 is supported.
/// </summary>
- VertexAttribUint10 = 0x0000000002000000,
+ VertexAttribUint10 = 0x0000000004000000,
/// <summary>
/// Rendering with VertexID only is supported.
/// </summary>
- VertexId = 0x0000000004000000,
+ VertexId = 0x0000000008000000,
/// <summary>
/// Viewport layer is available in vertex shader.
/// </summary>
- ViewportLayerArray = 0x0000000008000000,
+ ViewportLayerArray = 0x0000000010000000,
+
+ /// <summary>
+ /// Draw indirect with indirect count is supported.
+ /// </summary>
+ DrawIndirectCount = 0x0000000020000000,
/// <summary>
/// All texture compare modes are supported.
/// </summary>
- TextureCompareAll = 0x0000000000180000,
+ TextureCompareAll = 0x0000000000300000,
}
[AllowDuplicates]
@@ -1270,6 +1285,11 @@ public static class bgfx
Amd = 0x1002,
/// <summary>
+ /// Apple adapter.
+ /// </summary>
+ Apple = 0x106b,
+
+ /// <summary>
/// Intel adapter.
/// </summary>
Intel = 0x8086,
@@ -1278,6 +1298,16 @@ public static class bgfx
/// nVidia adapter.
/// </summary>
Nvidia = 0x10de,
+
+ /// <summary>
+ /// Microsoft adapter.
+ /// </summary>
+ Microsoft = 0x1414,
+
+ /// <summary>
+ /// ARM adapter.
+ /// </summary>
+ Arm = 0x13b5,
}
[AllowDuplicates]
@@ -1649,11 +1679,21 @@ public static class bgfx
ASTC4x4,
/// <summary>
+ /// ASTC 5x4 6.40 BPP
+ /// </summary>
+ ASTC5x4,
+
+ /// <summary>
/// ASTC 5x5 5.12 BPP
/// </summary>
ASTC5x5,
/// <summary>
+ /// ASTC 6x5 4.27 BPP
+ /// </summary>
+ ASTC6x5,
+
+ /// <summary>
/// ASTC 6x6 3.56 BPP
/// </summary>
ASTC6x6,
@@ -1669,11 +1709,41 @@ public static class bgfx
ASTC8x6,
/// <summary>
+ /// ASTC 8x8 2.00 BPP
+ /// </summary>
+ ASTC8x8,
+
+ /// <summary>
/// ASTC 10x5 2.56 BPP
/// </summary>
ASTC10x5,
/// <summary>
+ /// ASTC 10x6 2.13 BPP
+ /// </summary>
+ ASTC10x6,
+
+ /// <summary>
+ /// ASTC 10x8 1.60 BPP
+ /// </summary>
+ ASTC10x8,
+
+ /// <summary>
+ /// ASTC 10x10 1.28 BPP
+ /// </summary>
+ ASTC10x10,
+
+ /// <summary>
+ /// ASTC 12x10 1.07 BPP
+ /// </summary>
+ ASTC12x10,
+
+ /// <summary>
+ /// ASTC 12x12 0.89 BPP
+ /// </summary>
+ ASTC12x12,
+
+ /// <summary>
/// Compressed formats above.
/// </summary>
Unknown,
@@ -1721,8 +1791,11 @@ public static class bgfx
RGBA32I,
RGBA32U,
RGBA32F,
+ B5G6R5,
R5G6B5,
+ BGRA4,
RGBA4,
+ BGR5A1,
RGB5A1,
RGB10A2,
RG11B10F,
@@ -2012,7 +2085,7 @@ public static class bgfx
public uint8 numGPUs;
public GPU[4] gpu;
public Limits limits;
- public uint16[85] formats;
+ public uint16[96] formats;
}
[CRepr]
@@ -2156,6 +2229,7 @@ public static class bgfx
public int64 cpuTimeEnd;
public int64 gpuTimeBegin;
public int64 gpuTimeEnd;
+ public uint32 gpuFrameNum;
}
[CRepr]
@@ -2181,6 +2255,7 @@ public static class bgfx
public uint32 numCompute;
public uint32 numBlit;
public uint32 maxGpuLatency;
+ public uint32 gpuFrameNum;
public uint16 numDynamicIndexBuffers;
public uint16 numDynamicVertexBuffers;
public uint16 numFrameBuffers;
@@ -2480,7 +2555,7 @@ public static class bgfx
public static extern void init_ctor(Init* _init);
/// <summary>
- /// Initialize bgfx library.
+ /// Initialize the bgfx library.
/// </summary>
///
/// <param name="_init">Initialization parameters. See: `bgfx::Init` for more info.</param>
@@ -2497,13 +2572,13 @@ public static class bgfx
/// <summary>
/// Reset graphic settings and back-buffer size.
- /// @attention This call doesn't actually change window size, it just
- /// resizes back-buffer. Windowing code has to change window size.
+ /// @attention This call doesn’t change the window size, it just resizes
+ /// the back-buffer. Your windowing code controls the window size.
/// </summary>
///
/// <param name="_width">Back-buffer width.</param>
/// <param name="_height">Back-buffer height.</param>
- /// <param name="_flags">See: `BGFX_RESET_*` for more info. - `BGFX_RESET_NONE` - No reset flags. - `BGFX_RESET_FULLSCREEN` - Not supported yet. - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA. - `BGFX_RESET_VSYNC` - Enable V-Sync. - `BGFX_RESET_MAXANISOTROPY` - Turn on/off max anisotropy. - `BGFX_RESET_CAPTURE` - Begin screen capture. - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU. - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip occurs. Default behaviour is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`. - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB backbuffer.</param>
+ /// <param name="_flags">See: `BGFX_RESET_*` for more info. - `BGFX_RESET_NONE` - No reset flags. - `BGFX_RESET_FULLSCREEN` - Not supported yet. - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA. - `BGFX_RESET_VSYNC` - Enable V-Sync. - `BGFX_RESET_MAXANISOTROPY` - Turn on/off max anisotropy. - `BGFX_RESET_CAPTURE` - Begin screen capture. - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU. - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip occurs. Default behaviour is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`. - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB back-buffer.</param>
/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
///
[LinkName("bgfx_reset")]
@@ -2747,7 +2822,7 @@ public static class bgfx
public static extern DynamicIndexBufferHandle create_dynamic_index_buffer(uint32 _num, uint16 _flags);
/// <summary>
- /// Create dynamic index buffer and initialized it.
+ /// Create a dynamic index buffer and initialize it.
/// </summary>
///
/// <param name="_mem">Index buffer data.</param>
@@ -2852,7 +2927,7 @@ public static class bgfx
/// Allocate transient index buffer.
/// </summary>
///
- /// <param name="_tib">TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
+ /// <param name="_tib">TransientIndexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
/// <param name="_num">Number of indices to allocate.</param>
/// <param name="_index32">Set to `true` if input indices will be 32-bit.</param>
///
@@ -2863,7 +2938,7 @@ public static class bgfx
/// Allocate transient vertex buffer.
/// </summary>
///
- /// <param name="_tvb">TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
+ /// <param name="_tvb">TransientVertexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
/// <param name="_num">Number of vertices to allocate.</param>
/// <param name="_layout">Vertex layout.</param>
///
@@ -2876,10 +2951,10 @@ public static class bgfx
/// true.
/// </summary>
///
- /// <param name="_tvb">TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
+ /// <param name="_tvb">TransientVertexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
/// <param name="_layout">Vertex layout.</param>
/// <param name="_numVertices">Number of vertices to allocate.</param>
- /// <param name="_tib">TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
+ /// <param name="_tib">TransientIndexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
/// <param name="_numIndices">Number of indices to allocate.</param>
/// <param name="_index32">Set to `true` if input indices will be 32-bit.</param>
///
@@ -2890,7 +2965,7 @@ public static class bgfx
/// Allocate instance data buffer.
/// </summary>
///
- /// <param name="_idb">InstanceDataBuffer structure is filled and is valid for duration of frame, and it can be reused for multiple draw calls.</param>
+ /// <param name="_idb">InstanceDataBuffer structure will be filled, and will be valid for duration of frame, and can be reused for multiple draw calls.</param>
/// <param name="_num">Number of instances.</param>
/// <param name="_stride">Instance stride. Must be multiple of 16.</param>
///
@@ -3056,7 +3131,7 @@ public static class bgfx
public static extern TextureHandle create_texture_2d(uint16 _width, uint16 _height, bool _hasMips, uint16 _numLayers, TextureFormat _format, uint64 _flags, Memory* _mem);
/// <summary>
- /// Create texture with size based on backbuffer ratio. Texture will maintain ratio
+ /// Create texture with size based on back-buffer ratio. Texture will maintain ratio
/// if back buffer resolution changes.
/// </summary>
///
@@ -3210,7 +3285,7 @@ public static class bgfx
public static extern FrameBufferHandle create_frame_buffer(uint16 _width, uint16 _height, TextureFormat _format, uint64 _textureFlags);
/// <summary>
- /// Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
+ /// Create frame buffer with size based on back-buffer ratio. Frame buffer will maintain ratio
/// if back buffer resolution changes.
/// </summary>
///
@@ -3458,8 +3533,8 @@ public static class bgfx
/// <summary>
/// Set view clear flags with different clear color for each
- /// frame buffer texture. Must use `bgfx::setPaletteColor` to setup clear color
- /// palette.
+ /// frame buffer texture. `bgfx::setPaletteColor` must be used to set up a
+ /// clear color palette.
/// </summary>
///
/// <param name="_id">View id.</param>
@@ -3503,8 +3578,8 @@ public static class bgfx
public static extern void set_view_frame_buffer(ViewId _id, FrameBufferHandle _handle);
/// <summary>
- /// Set view view and projection matrices, all draw primitives in this
- /// view will use these matrices.
+ /// Set view's view matrix and projection matrix,
+ /// all draw primitives in this view will use these two matrices.
/// </summary>
///
/// <param name="_id">View id.</param>
@@ -3563,7 +3638,7 @@ public static class bgfx
/// <summary>
/// Set render states for draw primitive.
/// @remarks
- /// 1. To setup more complex states use:
+ /// 1. To set up more complex states use:
/// `BGFX_STATE_ALPHA_REF(_ref)`,
/// `BGFX_STATE_POINT_SIZE(_size)`,
/// `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -3648,7 +3723,7 @@ public static class bgfx
/// <summary>
/// Reserve matrices in internal matrix cache.
- /// @attention Pointer returned can be modifed until `bgfx::frame` is called.
+ /// @attention Pointer returned can be modified until `bgfx::frame` is called.
/// </summary>
///
/// <param name="_transform">Pointer to `Transform` structure.</param>
@@ -3767,7 +3842,7 @@ public static class bgfx
public static extern void encoder_set_transient_vertex_buffer_with_layout(Encoder* _this, uint8 _stream, TransientVertexBuffer* _tvb, uint32 _startVertex, uint32 _numVertices, VertexLayoutHandle _layoutHandle);
/// <summary>
- /// Set number of vertices for auto generated vertices use in conjuction
+ /// Set number of vertices for auto generated vertices use in conjunction
/// with gl_VertexID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
/// </summary>
@@ -3811,7 +3886,7 @@ public static class bgfx
public static extern void encoder_set_instance_data_from_dynamic_vertex_buffer(Encoder* _this, DynamicVertexBufferHandle _handle, uint32 _startVertex, uint32 _num);
/// <summary>
- /// Set number of instances for auto generated instances use in conjuction
+ /// Set number of instances for auto generated instances use in conjunction
/// with gl_InstanceID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
/// </summary>
@@ -3873,13 +3948,14 @@ public static class bgfx
/// <summary>
/// Submit primitive for rendering with index and instance data info from
/// indirect buffer.
+ /// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
/// </summary>
///
/// <param name="_id">View id.</param>
/// <param name="_program">Program.</param>
/// <param name="_indirectHandle">Indirect buffer.</param>
/// <param name="_start">First element in indirect buffer.</param>
- /// <param name="_num">Number of dispatches.</param>
+ /// <param name="_num">Number of draws.</param>
/// <param name="_depth">Depth for sorting.</param>
/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
///
@@ -3887,6 +3963,25 @@ public static class bgfx
public static extern void encoder_submit_indirect(Encoder* _this, ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16 _start, uint16 _num, uint32 _depth, uint8 _flags);
/// <summary>
+ /// Submit primitive for rendering with index and instance data info and
+ /// draw count from indirect buffers.
+ /// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+ /// </summary>
+ ///
+ /// <param name="_id">View id.</param>
+ /// <param name="_program">Program.</param>
+ /// <param name="_indirectHandle">Indirect buffer.</param>
+ /// <param name="_start">First element in indirect buffer.</param>
+ /// <param name="_numHandle">Buffer for number of draws. Must be created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.</param>
+ /// <param name="_numIndex">Element in number buffer.</param>
+ /// <param name="_numMax">Max number of draws.</param>
+ /// <param name="_depth">Depth for sorting.</param>
+ /// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+ ///
+ [LinkName("bgfx_encoder_submit_indirect_count")]
+ public static extern void encoder_submit_indirect_count(Encoder* _this, ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16 _start, IndexBufferHandle _numHandle, uint32 _numIndex, uint16 _numMax, uint32 _depth, uint8 _flags);
+
+ /// <summary>
/// Set compute index buffer.
/// </summary>
///
@@ -4111,7 +4206,7 @@ public static class bgfx
/// <summary>
/// Set render states for draw primitive.
/// @remarks
- /// 1. To setup more complex states use:
+ /// 1. To set up more complex states use:
/// `BGFX_STATE_ALPHA_REF(_ref)`,
/// `BGFX_STATE_POINT_SIZE(_size)`,
/// `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -4196,7 +4291,7 @@ public static class bgfx
/// <summary>
/// Reserve matrices in internal matrix cache.
- /// @attention Pointer returned can be modifed until `bgfx::frame` is called.
+ /// @attention Pointer returned can be modified until `bgfx::frame` is called.
/// </summary>
///
/// <param name="_transform">Pointer to `Transform` structure.</param>
@@ -4325,7 +4420,7 @@ public static class bgfx
public static extern void set_transient_vertex_buffer_with_layout(uint8 _stream, TransientVertexBuffer* _tvb, uint32 _startVertex, uint32 _numVertices, VertexLayoutHandle _layoutHandle);
/// <summary>
- /// Set number of vertices for auto generated vertices use in conjuction
+ /// Set number of vertices for auto generated vertices use in conjunction
/// with gl_VertexID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
/// </summary>
@@ -4369,7 +4464,7 @@ public static class bgfx
public static extern void set_instance_data_from_dynamic_vertex_buffer(DynamicVertexBufferHandle _handle, uint32 _startVertex, uint32 _num);
/// <summary>
- /// Set number of instances for auto generated instances use in conjuction
+ /// Set number of instances for auto generated instances use in conjunction
/// with gl_InstanceID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
/// </summary>
@@ -4429,13 +4524,14 @@ public static class bgfx
/// <summary>
/// Submit primitive for rendering with index and instance data info from
/// indirect buffer.
+ /// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
/// </summary>
///
/// <param name="_id">View id.</param>
/// <param name="_program">Program.</param>
/// <param name="_indirectHandle">Indirect buffer.</param>
/// <param name="_start">First element in indirect buffer.</param>
- /// <param name="_num">Number of dispatches.</param>
+ /// <param name="_num">Number of draws.</param>
/// <param name="_depth">Depth for sorting.</param>
/// <param name="_flags">Which states to discard for next draw. See `BGFX_DISCARD_*`.</param>
///
@@ -4443,6 +4539,25 @@ public static class bgfx
public static extern void submit_indirect(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16 _start, uint16 _num, uint32 _depth, uint8 _flags);
/// <summary>
+ /// Submit primitive for rendering with index and instance data info and
+ /// draw count from indirect buffers.
+ /// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+ /// </summary>
+ ///
+ /// <param name="_id">View id.</param>
+ /// <param name="_program">Program.</param>
+ /// <param name="_indirectHandle">Indirect buffer.</param>
+ /// <param name="_start">First element in indirect buffer.</param>
+ /// <param name="_numHandle">Buffer for number of draws. Must be created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.</param>
+ /// <param name="_numIndex">Element in number buffer.</param>
+ /// <param name="_numMax">Max number of draws.</param>
+ /// <param name="_depth">Depth for sorting.</param>
+ /// <param name="_flags">Which states to discard for next draw. See `BGFX_DISCARD_*`.</param>
+ ///
+ [LinkName("bgfx_submit_indirect_count")]
+ public static extern void submit_indirect_count(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16 _start, IndexBufferHandle _numHandle, uint32 _numIndex, uint16 _numMax, uint32 _depth, uint8 _flags);
+
+ /// <summary>
/// Set compute index buffer.
/// </summary>
///
diff --git a/3rdparty/bgfx/bindings/cs/bgfx.cs b/3rdparty/bgfx/bindings/cs/bgfx.cs
index c445bece423..24a2a17e118 100644
--- a/3rdparty/bgfx/bindings/cs/bgfx.cs
+++ b/3rdparty/bgfx/bindings/cs/bgfx.cs
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
@@ -603,7 +603,7 @@ public static partial class bgfx
Text = 0x00000008,
/// <summary>
- /// Enable profiler.
+ /// Enable profiler. This causes per-view statistics to be collected, available through `bgfx::Stats::ViewStats`. This is unrelated to the profiler functions in `bgfx::CallbackI`.
/// </summary>
Profiler = 0x00000010,
}
@@ -996,6 +996,11 @@ public static partial class bgfx
/// Suspend rendering.
/// </summary>
Suspend = 0x00080000,
+
+ /// <summary>
+ /// Transparent backbuffer. Availability depends on: `BGFX_CAPS_TRANSPARENT_BACKBUFFER`.
+ /// </summary>
+ TransparentBackbuffer = 0x00100000,
FullscreenShift = 0,
FullscreenMask = 0x00000001,
ReservedShift = 31,
@@ -1099,52 +1104,62 @@ public static partial class bgfx
/// Texture blit is supported.
/// </summary>
TextureBlit = 0x0000000000040000,
- TextureCompareReserved = 0x0000000000080000,
+
+ /// <summary>
+ /// Transparent back buffer supported.
+ /// </summary>
+ TransparentBackbuffer = 0x0000000000080000,
+ TextureCompareReserved = 0x0000000000100000,
/// <summary>
/// Texture compare less equal mode is supported.
/// </summary>
- TextureCompareLequal = 0x0000000000100000,
+ TextureCompareLequal = 0x0000000000200000,
/// <summary>
/// Cubemap texture array is supported.
/// </summary>
- TextureCubeArray = 0x0000000000200000,
+ TextureCubeArray = 0x0000000000400000,
/// <summary>
/// CPU direct access to GPU texture memory.
/// </summary>
- TextureDirectAccess = 0x0000000000400000,
+ TextureDirectAccess = 0x0000000000800000,
/// <summary>
/// Read-back texture is supported.
/// </summary>
- TextureReadBack = 0x0000000000800000,
+ TextureReadBack = 0x0000000001000000,
/// <summary>
/// Vertex attribute half-float is supported.
/// </summary>
- VertexAttribHalf = 0x0000000001000000,
+ VertexAttribHalf = 0x0000000002000000,
/// <summary>
/// Vertex attribute 10_10_10_2 is supported.
/// </summary>
- VertexAttribUint10 = 0x0000000002000000,
+ VertexAttribUint10 = 0x0000000004000000,
/// <summary>
/// Rendering with VertexID only is supported.
/// </summary>
- VertexId = 0x0000000004000000,
+ VertexId = 0x0000000008000000,
/// <summary>
/// Viewport layer is available in vertex shader.
/// </summary>
- ViewportLayerArray = 0x0000000008000000,
+ ViewportLayerArray = 0x0000000010000000,
+
+ /// <summary>
+ /// Draw indirect with indirect count is supported.
+ /// </summary>
+ DrawIndirectCount = 0x0000000020000000,
/// <summary>
/// All texture compare modes are supported.
/// </summary>
- TextureCompareAll = 0x0000000000180000,
+ TextureCompareAll = 0x0000000000300000,
}
[Flags]
@@ -1269,6 +1284,11 @@ public static partial class bgfx
Amd = 0x1002,
/// <summary>
+ /// Apple adapter.
+ /// </summary>
+ Apple = 0x106b,
+
+ /// <summary>
/// Intel adapter.
/// </summary>
Intel = 0x8086,
@@ -1277,6 +1297,16 @@ public static partial class bgfx
/// nVidia adapter.
/// </summary>
Nvidia = 0x10de,
+
+ /// <summary>
+ /// Microsoft adapter.
+ /// </summary>
+ Microsoft = 0x1414,
+
+ /// <summary>
+ /// ARM adapter.
+ /// </summary>
+ Arm = 0x13b5,
}
[Flags]
@@ -1642,11 +1672,21 @@ public static partial class bgfx
ASTC4x4,
/// <summary>
+ /// ASTC 5x4 6.40 BPP
+ /// </summary>
+ ASTC5x4,
+
+ /// <summary>
/// ASTC 5x5 5.12 BPP
/// </summary>
ASTC5x5,
/// <summary>
+ /// ASTC 6x5 4.27 BPP
+ /// </summary>
+ ASTC6x5,
+
+ /// <summary>
/// ASTC 6x6 3.56 BPP
/// </summary>
ASTC6x6,
@@ -1662,11 +1702,41 @@ public static partial class bgfx
ASTC8x6,
/// <summary>
+ /// ASTC 8x8 2.00 BPP
+ /// </summary>
+ ASTC8x8,
+
+ /// <summary>
/// ASTC 10x5 2.56 BPP
/// </summary>
ASTC10x5,
/// <summary>
+ /// ASTC 10x6 2.13 BPP
+ /// </summary>
+ ASTC10x6,
+
+ /// <summary>
+ /// ASTC 10x8 1.60 BPP
+ /// </summary>
+ ASTC10x8,
+
+ /// <summary>
+ /// ASTC 10x10 1.28 BPP
+ /// </summary>
+ ASTC10x10,
+
+ /// <summary>
+ /// ASTC 12x10 1.07 BPP
+ /// </summary>
+ ASTC12x10,
+
+ /// <summary>
+ /// ASTC 12x12 0.89 BPP
+ /// </summary>
+ ASTC12x12,
+
+ /// <summary>
/// Compressed formats above.
/// </summary>
Unknown,
@@ -1714,8 +1784,11 @@ public static partial class bgfx
RGBA32I,
RGBA32U,
RGBA32F,
+ B5G6R5,
R5G6B5,
+ BGRA4,
RGBA4,
+ BGR5A1,
RGB5A1,
RGB10A2,
RG11B10F,
@@ -1994,7 +2067,7 @@ public static partial class bgfx
public byte numGPUs;
public fixed uint gpu[4];
public Limits limits;
- public fixed ushort formats[85];
+ public fixed ushort formats[96];
}
public unsafe struct InternalData
@@ -2124,6 +2197,7 @@ public static partial class bgfx
public long cpuTimeEnd;
public long gpuTimeBegin;
public long gpuTimeEnd;
+ public uint gpuFrameNum;
}
public unsafe struct EncoderStats
@@ -2147,6 +2221,7 @@ public static partial class bgfx
public uint numCompute;
public uint numBlit;
public uint maxGpuLatency;
+ public uint gpuFrameNum;
public ushort numDynamicIndexBuffers;
public ushort numDynamicVertexBuffers;
public ushort numFrameBuffers;
@@ -2433,7 +2508,7 @@ public static partial class bgfx
public static extern unsafe void init_ctor(Init* _init);
/// <summary>
- /// Initialize bgfx library.
+ /// Initialize the bgfx library.
/// </summary>
///
/// <param name="_init">Initialization parameters. See: `bgfx::Init` for more info.</param>
@@ -2451,13 +2526,13 @@ public static partial class bgfx
/// <summary>
/// Reset graphic settings and back-buffer size.
- /// @attention This call doesn't actually change window size, it just
- /// resizes back-buffer. Windowing code has to change window size.
+ /// @attention This call doesn’t change the window size, it just resizes
+ /// the back-buffer. Your windowing code controls the window size.
/// </summary>
///
/// <param name="_width">Back-buffer width.</param>
/// <param name="_height">Back-buffer height.</param>
- /// <param name="_flags">See: `BGFX_RESET_*` for more info. - `BGFX_RESET_NONE` - No reset flags. - `BGFX_RESET_FULLSCREEN` - Not supported yet. - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA. - `BGFX_RESET_VSYNC` - Enable V-Sync. - `BGFX_RESET_MAXANISOTROPY` - Turn on/off max anisotropy. - `BGFX_RESET_CAPTURE` - Begin screen capture. - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU. - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip occurs. Default behaviour is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`. - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB backbuffer.</param>
+ /// <param name="_flags">See: `BGFX_RESET_*` for more info. - `BGFX_RESET_NONE` - No reset flags. - `BGFX_RESET_FULLSCREEN` - Not supported yet. - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA. - `BGFX_RESET_VSYNC` - Enable V-Sync. - `BGFX_RESET_MAXANISOTROPY` - Turn on/off max anisotropy. - `BGFX_RESET_CAPTURE` - Begin screen capture. - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU. - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip occurs. Default behaviour is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`. - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB back-buffer.</param>
/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
///
[DllImport(DllName, EntryPoint="bgfx_reset", CallingConvention = CallingConvention.Cdecl)]
@@ -2701,7 +2776,7 @@ public static partial class bgfx
public static extern unsafe DynamicIndexBufferHandle create_dynamic_index_buffer(uint _num, ushort _flags);
/// <summary>
- /// Create dynamic index buffer and initialized it.
+ /// Create a dynamic index buffer and initialize it.
/// </summary>
///
/// <param name="_mem">Index buffer data.</param>
@@ -2806,7 +2881,7 @@ public static partial class bgfx
/// Allocate transient index buffer.
/// </summary>
///
- /// <param name="_tib">TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
+ /// <param name="_tib">TransientIndexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
/// <param name="_num">Number of indices to allocate.</param>
/// <param name="_index32">Set to `true` if input indices will be 32-bit.</param>
///
@@ -2817,7 +2892,7 @@ public static partial class bgfx
/// Allocate transient vertex buffer.
/// </summary>
///
- /// <param name="_tvb">TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
+ /// <param name="_tvb">TransientVertexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
/// <param name="_num">Number of vertices to allocate.</param>
/// <param name="_layout">Vertex layout.</param>
///
@@ -2830,10 +2905,10 @@ public static partial class bgfx
/// true.
/// </summary>
///
- /// <param name="_tvb">TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
+ /// <param name="_tvb">TransientVertexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
/// <param name="_layout">Vertex layout.</param>
/// <param name="_numVertices">Number of vertices to allocate.</param>
- /// <param name="_tib">TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
+ /// <param name="_tib">TransientIndexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
/// <param name="_numIndices">Number of indices to allocate.</param>
/// <param name="_index32">Set to `true` if input indices will be 32-bit.</param>
///
@@ -2845,7 +2920,7 @@ public static partial class bgfx
/// Allocate instance data buffer.
/// </summary>
///
- /// <param name="_idb">InstanceDataBuffer structure is filled and is valid for duration of frame, and it can be reused for multiple draw calls.</param>
+ /// <param name="_idb">InstanceDataBuffer structure will be filled, and will be valid for duration of frame, and can be reused for multiple draw calls.</param>
/// <param name="_num">Number of instances.</param>
/// <param name="_stride">Instance stride. Must be multiple of 16.</param>
///
@@ -3013,7 +3088,7 @@ public static partial class bgfx
public static extern unsafe TextureHandle create_texture_2d(ushort _width, ushort _height, bool _hasMips, ushort _numLayers, TextureFormat _format, ulong _flags, Memory* _mem);
/// <summary>
- /// Create texture with size based on backbuffer ratio. Texture will maintain ratio
+ /// Create texture with size based on back-buffer ratio. Texture will maintain ratio
/// if back buffer resolution changes.
/// </summary>
///
@@ -3167,7 +3242,7 @@ public static partial class bgfx
public static extern unsafe FrameBufferHandle create_frame_buffer(ushort _width, ushort _height, TextureFormat _format, ulong _textureFlags);
/// <summary>
- /// Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
+ /// Create frame buffer with size based on back-buffer ratio. Frame buffer will maintain ratio
/// if back buffer resolution changes.
/// </summary>
///
@@ -3415,8 +3490,8 @@ public static partial class bgfx
/// <summary>
/// Set view clear flags with different clear color for each
- /// frame buffer texture. Must use `bgfx::setPaletteColor` to setup clear color
- /// palette.
+ /// frame buffer texture. `bgfx::setPaletteColor` must be used to set up a
+ /// clear color palette.
/// </summary>
///
/// <param name="_id">View id.</param>
@@ -3460,8 +3535,8 @@ public static partial class bgfx
public static extern unsafe void set_view_frame_buffer(ushort _id, FrameBufferHandle _handle);
/// <summary>
- /// Set view view and projection matrices, all draw primitives in this
- /// view will use these matrices.
+ /// Set view's view matrix and projection matrix,
+ /// all draw primitives in this view will use these two matrices.
/// </summary>
///
/// <param name="_id">View id.</param>
@@ -3520,7 +3595,7 @@ public static partial class bgfx
/// <summary>
/// Set render states for draw primitive.
/// @remarks
- /// 1. To setup more complex states use:
+ /// 1. To set up more complex states use:
/// `BGFX_STATE_ALPHA_REF(_ref)`,
/// `BGFX_STATE_POINT_SIZE(_size)`,
/// `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -3605,7 +3680,7 @@ public static partial class bgfx
/// <summary>
/// Reserve matrices in internal matrix cache.
- /// @attention Pointer returned can be modifed until `bgfx::frame` is called.
+ /// @attention Pointer returned can be modified until `bgfx::frame` is called.
/// </summary>
///
/// <param name="_transform">Pointer to `Transform` structure.</param>
@@ -3724,7 +3799,7 @@ public static partial class bgfx
public static extern unsafe void encoder_set_transient_vertex_buffer_with_layout(Encoder* _this, byte _stream, TransientVertexBuffer* _tvb, uint _startVertex, uint _numVertices, VertexLayoutHandle _layoutHandle);
/// <summary>
- /// Set number of vertices for auto generated vertices use in conjuction
+ /// Set number of vertices for auto generated vertices use in conjunction
/// with gl_VertexID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
/// </summary>
@@ -3768,7 +3843,7 @@ public static partial class bgfx
public static extern unsafe void encoder_set_instance_data_from_dynamic_vertex_buffer(Encoder* _this, DynamicVertexBufferHandle _handle, uint _startVertex, uint _num);
/// <summary>
- /// Set number of instances for auto generated instances use in conjuction
+ /// Set number of instances for auto generated instances use in conjunction
/// with gl_InstanceID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
/// </summary>
@@ -3830,13 +3905,14 @@ public static partial class bgfx
/// <summary>
/// Submit primitive for rendering with index and instance data info from
/// indirect buffer.
+ /// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
/// </summary>
///
/// <param name="_id">View id.</param>
/// <param name="_program">Program.</param>
/// <param name="_indirectHandle">Indirect buffer.</param>
/// <param name="_start">First element in indirect buffer.</param>
- /// <param name="_num">Number of dispatches.</param>
+ /// <param name="_num">Number of draws.</param>
/// <param name="_depth">Depth for sorting.</param>
/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
///
@@ -3844,6 +3920,25 @@ public static partial class bgfx
public static extern unsafe void encoder_submit_indirect(Encoder* _this, ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags);
/// <summary>
+ /// Submit primitive for rendering with index and instance data info and
+ /// draw count from indirect buffers.
+ /// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+ /// </summary>
+ ///
+ /// <param name="_id">View id.</param>
+ /// <param name="_program">Program.</param>
+ /// <param name="_indirectHandle">Indirect buffer.</param>
+ /// <param name="_start">First element in indirect buffer.</param>
+ /// <param name="_numHandle">Buffer for number of draws. Must be created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.</param>
+ /// <param name="_numIndex">Element in number buffer.</param>
+ /// <param name="_numMax">Max number of draws.</param>
+ /// <param name="_depth">Depth for sorting.</param>
+ /// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+ ///
+ [DllImport(DllName, EntryPoint="bgfx_encoder_submit_indirect_count", CallingConvention = CallingConvention.Cdecl)]
+ public static extern unsafe void encoder_submit_indirect_count(Encoder* _this, ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, IndexBufferHandle _numHandle, uint _numIndex, ushort _numMax, uint _depth, byte _flags);
+
+ /// <summary>
/// Set compute index buffer.
/// </summary>
///
@@ -4068,7 +4163,7 @@ public static partial class bgfx
/// <summary>
/// Set render states for draw primitive.
/// @remarks
- /// 1. To setup more complex states use:
+ /// 1. To set up more complex states use:
/// `BGFX_STATE_ALPHA_REF(_ref)`,
/// `BGFX_STATE_POINT_SIZE(_size)`,
/// `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -4153,7 +4248,7 @@ public static partial class bgfx
/// <summary>
/// Reserve matrices in internal matrix cache.
- /// @attention Pointer returned can be modifed until `bgfx::frame` is called.
+ /// @attention Pointer returned can be modified until `bgfx::frame` is called.
/// </summary>
///
/// <param name="_transform">Pointer to `Transform` structure.</param>
@@ -4282,7 +4377,7 @@ public static partial class bgfx
public static extern unsafe void set_transient_vertex_buffer_with_layout(byte _stream, TransientVertexBuffer* _tvb, uint _startVertex, uint _numVertices, VertexLayoutHandle _layoutHandle);
/// <summary>
- /// Set number of vertices for auto generated vertices use in conjuction
+ /// Set number of vertices for auto generated vertices use in conjunction
/// with gl_VertexID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
/// </summary>
@@ -4326,7 +4421,7 @@ public static partial class bgfx
public static extern unsafe void set_instance_data_from_dynamic_vertex_buffer(DynamicVertexBufferHandle _handle, uint _startVertex, uint _num);
/// <summary>
- /// Set number of instances for auto generated instances use in conjuction
+ /// Set number of instances for auto generated instances use in conjunction
/// with gl_InstanceID.
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
/// </summary>
@@ -4386,13 +4481,14 @@ public static partial class bgfx
/// <summary>
/// Submit primitive for rendering with index and instance data info from
/// indirect buffer.
+ /// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
/// </summary>
///
/// <param name="_id">View id.</param>
/// <param name="_program">Program.</param>
/// <param name="_indirectHandle">Indirect buffer.</param>
/// <param name="_start">First element in indirect buffer.</param>
- /// <param name="_num">Number of dispatches.</param>
+ /// <param name="_num">Number of draws.</param>
/// <param name="_depth">Depth for sorting.</param>
/// <param name="_flags">Which states to discard for next draw. See `BGFX_DISCARD_*`.</param>
///
@@ -4400,6 +4496,25 @@ public static partial class bgfx
public static extern unsafe void submit_indirect(ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags);
/// <summary>
+ /// Submit primitive for rendering with index and instance data info and
+ /// draw count from indirect buffers.
+ /// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+ /// </summary>
+ ///
+ /// <param name="_id">View id.</param>
+ /// <param name="_program">Program.</param>
+ /// <param name="_indirectHandle">Indirect buffer.</param>
+ /// <param name="_start">First element in indirect buffer.</param>
+ /// <param name="_numHandle">Buffer for number of draws. Must be created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.</param>
+ /// <param name="_numIndex">Element in number buffer.</param>
+ /// <param name="_numMax">Max number of draws.</param>
+ /// <param name="_depth">Depth for sorting.</param>
+ /// <param name="_flags">Which states to discard for next draw. See `BGFX_DISCARD_*`.</param>
+ ///
+ [DllImport(DllName, EntryPoint="bgfx_submit_indirect_count", CallingConvention = CallingConvention.Cdecl)]
+ public static extern unsafe void submit_indirect_count(ushort _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, ushort _start, IndexBufferHandle _numHandle, uint _numIndex, ushort _numMax, uint _depth, byte _flags);
+
+ /// <summary>
/// Set compute index buffer.
/// </summary>
///
diff --git a/3rdparty/bgfx/bindings/cs/bgfx_dllname.cs b/3rdparty/bgfx/bindings/cs/bgfx_dllname.cs
index 96eea8b3787..54bb7cecaab 100644
--- a/3rdparty/bgfx/bindings/cs/bgfx_dllname.cs
+++ b/3rdparty/bgfx/bindings/cs/bgfx_dllname.cs
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
diff --git a/3rdparty/bgfx/bindings/d/funcs.d b/3rdparty/bgfx/bindings/d/funcs.d
index 33aeb356ab3..561556ba591 100644
--- a/3rdparty/bgfx/bindings/d/funcs.d
+++ b/3rdparty/bgfx/bindings/d/funcs.d
@@ -22,7 +22,7 @@ version(BindBgfx_Static)
* _mip = Mip level.
* _resolve = Resolve flags. See: `BGFX_RESOLVE_*`
*/
- void bgfx_attachment_init(bgfx_attachment_t* _this, bgfx_texture_handle_t _handle, bgfx_access_t _access, ushort _layer, ushort _numLayers, ushort _mip, byte _resolve);
+ void bgfx_attachment_init(bgfx_attachment_t* _this, bgfx_texture_handle_t _handle, bgfx_access_t _access, ushort _layer, ushort _numLayers, ushort _mip, ubyte _resolve);
/**
* Start VertexLayout.
@@ -46,7 +46,7 @@ version(BindBgfx_Static)
* vertexConvert for AttribType::Uint8 and AttribType::Int16.
* Unpacking code must be implemented inside vertex shader.
*/
- bgfx_vertex_layout_t* bgfx_vertex_layout_add(bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, byte _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
+ bgfx_vertex_layout_t* bgfx_vertex_layout_add(bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, ubyte _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
/**
* Decode attribute.
@@ -57,7 +57,7 @@ version(BindBgfx_Static)
* _normalized = Attribute is normalized.
* _asInt = Attribute is packed as int.
*/
- void bgfx_vertex_layout_decode(const(bgfx_vertex_layout_t)* _this, bgfx_attrib_t _attrib, byte* _num, bgfx_attrib_type_t* _type, bool* _normalized, bool* _asInt);
+ void bgfx_vertex_layout_decode(const(bgfx_vertex_layout_t)* _this, bgfx_attrib_t _attrib, ubyte* _num, bgfx_attrib_type_t* _type, bool* _normalized, bool* _asInt);
/**
* Returns `true` if VertexLayout contains attribute.
@@ -71,7 +71,7 @@ version(BindBgfx_Static)
* Params:
* _num = Number of bytes to skip.
*/
- bgfx_vertex_layout_t* bgfx_vertex_layout_skip(bgfx_vertex_layout_t* _this, byte _num);
+ bgfx_vertex_layout_t* bgfx_vertex_layout_skip(bgfx_vertex_layout_t* _this, ubyte _num);
/**
* End VertexLayout.
@@ -166,7 +166,7 @@ version(BindBgfx_Static)
* _max = Maximum number of elements in _enum array.
* _enum = Array where supported renderers will be written.
*/
- byte bgfx_get_supported_renderers(byte _max, bgfx_renderer_type_t* _enum);
+ ubyte bgfx_get_supported_renderers(ubyte _max, bgfx_renderer_type_t* _enum);
/**
* Returns name of renderer.
@@ -178,7 +178,7 @@ version(BindBgfx_Static)
void bgfx_init_ctor(bgfx_init_t* _init);
/**
- * Initialize bgfx library.
+ * Initialize the bgfx library.
* Params:
* _init = Initialization parameters. See: `bgfx::Init` for more info.
*/
@@ -191,8 +191,8 @@ version(BindBgfx_Static)
/**
* Reset graphic settings and back-buffer size.
- * Attention: This call doesn't actually change window size, it just
- * resizes back-buffer. Windowing code has to change window size.
+ * Attention: This call doesn’t change the window size, it just resizes
+ * the back-buffer. Your windowing code controls the window size.
* Params:
* _width = Back-buffer width.
* _height = Back-buffer height.
@@ -207,7 +207,7 @@ version(BindBgfx_Static)
* - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip
* occurs. Default behaviour is that flip occurs before rendering new
* frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
- * - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB backbuffer.
+ * - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB back-buffer.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
void bgfx_reset(uint _width, uint _height, uint _flags, bgfx_texture_format_t _format);
@@ -307,7 +307,7 @@ version(BindBgfx_Static)
* _attr = Background color.
* _small = Default 8x16 or 8x8 font.
*/
- void bgfx_dbg_text_clear(byte _attr, bool _small);
+ void bgfx_dbg_text_clear(ubyte _attr, bool _small);
/**
* Print formatted data to internal debug text character-buffer (VGA-compatible text mode).
@@ -318,7 +318,7 @@ version(BindBgfx_Static)
* 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
* _format = `printf` style format.
*/
- void bgfx_dbg_text_printf(ushort _x, ushort _y, byte _attr, const(char)* _format, ... );
+ void bgfx_dbg_text_printf(ushort _x, ushort _y, ubyte _attr, const(char)* _format, ... );
/**
* Print formatted data from variable argument list to internal debug text character-buffer (VGA-compatible text mode).
@@ -330,7 +330,7 @@ version(BindBgfx_Static)
* _format = `printf` style format.
* _argList = Variable arguments list for format string.
*/
- void bgfx_dbg_text_vprintf(ushort _x, ushort _y, byte _attr, const(char)* _format, va_list _argList);
+ void bgfx_dbg_text_vprintf(ushort _x, ushort _y, ubyte _attr, const(char)* _format, va_list _argList);
/**
* Draw image into internal debug text buffer.
@@ -449,7 +449,7 @@ version(BindBgfx_Static)
bgfx_dynamic_index_buffer_handle_t bgfx_create_dynamic_index_buffer(uint _num, ushort _flags);
/**
- * Create dynamic index buffer and initialized it.
+ * Create a dynamic index buffer and initialize it.
* Params:
* _mem = Index buffer data.
* _flags = Buffer creation flags.
@@ -566,8 +566,8 @@ version(BindBgfx_Static)
/**
* Allocate transient index buffer.
* Params:
- * _tib = TransientIndexBuffer structure is filled and is valid
- * for the duration of frame, and it can be reused for multiple draw
+ * _tib = TransientIndexBuffer structure will be filled, and will be valid
+ * for the duration of frame, and can be reused for multiple draw
* calls.
* _num = Number of indices to allocate.
* _index32 = Set to `true` if input indices will be 32-bit.
@@ -577,8 +577,8 @@ version(BindBgfx_Static)
/**
* Allocate transient vertex buffer.
* Params:
- * _tvb = TransientVertexBuffer structure is filled and is valid
- * for the duration of frame, and it can be reused for multiple draw
+ * _tvb = TransientVertexBuffer structure will be filled, and will be valid
+ * for the duration of frame, and can be reused for multiple draw
* calls.
* _num = Number of vertices to allocate.
* _layout = Vertex layout.
@@ -590,13 +590,13 @@ version(BindBgfx_Static)
* buffers. If both space requirements are satisfied function returns
* true.
* Params:
- * _tvb = TransientVertexBuffer structure is filled and is valid
- * for the duration of frame, and it can be reused for multiple draw
+ * _tvb = TransientVertexBuffer structure will be filled, and will be valid
+ * for the duration of frame, and can be reused for multiple draw
* calls.
* _layout = Vertex layout.
* _numVertices = Number of vertices to allocate.
- * _tib = TransientIndexBuffer structure is filled and is valid
- * for the duration of frame, and it can be reused for multiple draw
+ * _tib = TransientIndexBuffer structure will be filled, and will be valid
+ * for the duration of frame, and can be reused for multiple draw
* calls.
* _numIndices = Number of indices to allocate.
* _index32 = Set to `true` if input indices will be 32-bit.
@@ -606,8 +606,8 @@ version(BindBgfx_Static)
/**
* Allocate instance data buffer.
* Params:
- * _idb = InstanceDataBuffer structure is filled and is valid
- * for duration of frame, and it can be reused for multiple draw
+ * _idb = InstanceDataBuffer structure will be filled, and will be valid
+ * for duration of frame, and can be reused for multiple draw
* calls.
* _num = Number of instances.
* _stride = Instance stride. Must be multiple of 16.
@@ -706,7 +706,7 @@ version(BindBgfx_Static)
* _num = Number of attachments.
* _attachment = Attachment texture info. See: `bgfx::Attachment`.
*/
- bool bgfx_is_frame_buffer_valid(byte _num, const(bgfx_attachment_t)* _attachment);
+ bool bgfx_is_frame_buffer_valid(ubyte _num, const(bgfx_attachment_t)* _attachment);
/**
* Calculate amount of memory required for texture.
@@ -735,7 +735,7 @@ version(BindBgfx_Static)
* _skip = Skip top level mips when parsing texture.
* _info = When non-`NULL` is specified it returns parsed texture information.
*/
- bgfx_texture_handle_t bgfx_create_texture(const(bgfx_memory_t)* _mem, ulong _flags, byte _skip, bgfx_texture_info_t* _info);
+ bgfx_texture_handle_t bgfx_create_texture(const(bgfx_memory_t)* _mem, ulong _flags, ubyte _skip, bgfx_texture_info_t* _info);
/**
* Create 2D texture.
@@ -759,7 +759,7 @@ version(BindBgfx_Static)
bgfx_texture_handle_t bgfx_create_texture_2d(ushort _width, ushort _height, bool _hasMips, ushort _numLayers, bgfx_texture_format_t _format, ulong _flags, const(bgfx_memory_t)* _mem);
/**
- * Create texture with size based on backbuffer ratio. Texture will maintain ratio
+ * Create texture with size based on back-buffer ratio. Texture will maintain ratio
* if back buffer resolution changes.
* Params:
* _ratio = Texture size in respect to back-buffer size. See: `BackbufferRatio::Enum`.
@@ -831,7 +831,7 @@ version(BindBgfx_Static)
* _pitch = Pitch of input image (bytes). When _pitch is set to
* UINT16_MAX, it will be calculated internally based on _width.
*/
- void bgfx_update_texture_2d(bgfx_texture_handle_t _handle, ushort _layer, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
+ void bgfx_update_texture_2d(bgfx_texture_handle_t _handle, ushort _layer, ubyte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
/**
* Update 3D texture.
@@ -847,7 +847,7 @@ version(BindBgfx_Static)
* _depth = Depth of texture block.
* _mem = Texture update data.
*/
- void bgfx_update_texture_3d(bgfx_texture_handle_t _handle, byte _mip, ushort _x, ushort _y, ushort _z, ushort _width, ushort _height, ushort _depth, const(bgfx_memory_t)* _mem);
+ void bgfx_update_texture_3d(bgfx_texture_handle_t _handle, ubyte _mip, ushort _x, ushort _y, ushort _z, ushort _width, ushort _height, ushort _depth, const(bgfx_memory_t)* _mem);
/**
* Update Cube texture.
@@ -882,7 +882,7 @@ version(BindBgfx_Static)
* _pitch = Pitch of input image (bytes). When _pitch is set to
* UINT16_MAX, it will be calculated internally based on _width.
*/
- void bgfx_update_texture_cube(bgfx_texture_handle_t _handle, ushort _layer, byte _side, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
+ void bgfx_update_texture_cube(bgfx_texture_handle_t _handle, ushort _layer, ubyte _side, ubyte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
/**
* Read back texture content.
@@ -893,7 +893,7 @@ version(BindBgfx_Static)
* _data = Destination buffer.
* _mip = Mip level.
*/
- uint bgfx_read_texture(bgfx_texture_handle_t _handle, void* _data, byte _mip);
+ uint bgfx_read_texture(bgfx_texture_handle_t _handle, void* _data, ubyte _mip);
/**
* Set texture debug name.
@@ -937,7 +937,7 @@ version(BindBgfx_Static)
bgfx_frame_buffer_handle_t bgfx_create_frame_buffer(ushort _width, ushort _height, bgfx_texture_format_t _format, ulong _textureFlags);
/**
- * Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
+ * Create frame buffer with size based on back-buffer ratio. Frame buffer will maintain ratio
* if back buffer resolution changes.
* Params:
* _ratio = Frame buffer size in respect to back-buffer size. See:
@@ -960,7 +960,7 @@ version(BindBgfx_Static)
* _destroyTexture = If true, textures will be destroyed when
* frame buffer is destroyed.
*/
- bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_handles(byte _num, const(bgfx_texture_handle_t)* _handles, bool _destroyTexture);
+ bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_handles(ubyte _num, const(bgfx_texture_handle_t)* _handles, bool _destroyTexture);
/**
* Create MRT frame buffer from texture handles with specific layer and
@@ -971,7 +971,7 @@ version(BindBgfx_Static)
* _destroyTexture = If true, textures will be destroyed when
* frame buffer is destroyed.
*/
- bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_attachment(byte _num, const(bgfx_attachment_t)* _attachment, bool _destroyTexture);
+ bgfx_frame_buffer_handle_t bgfx_create_frame_buffer_from_attachment(ubyte _num, const(bgfx_attachment_t)* _attachment, bool _destroyTexture);
/**
* Create frame buffer for multiple window rendering.
@@ -1002,7 +1002,7 @@ version(BindBgfx_Static)
* Params:
* _handle = Frame buffer handle.
*/
- bgfx_texture_handle_t bgfx_get_texture(bgfx_frame_buffer_handle_t _handle, byte _attachment);
+ bgfx_texture_handle_t bgfx_get_texture(bgfx_frame_buffer_handle_t _handle, ubyte _attachment);
/**
* Destroy frame buffer.
@@ -1084,7 +1084,7 @@ version(BindBgfx_Static)
* _index = Index into palette.
* _rgba = RGBA floating point values.
*/
- void bgfx_set_palette_color(byte _index, const float[4] _rgba);
+ void bgfx_set_palette_color(ubyte _index, const float[4] _rgba);
/**
* Set palette color value.
@@ -1092,7 +1092,7 @@ version(BindBgfx_Static)
* _index = Index into palette.
* _rgba = Packed 32-bit RGBA value.
*/
- void bgfx_set_palette_color_rgba8(byte _index, uint _rgba);
+ void bgfx_set_palette_color_rgba8(ubyte _index, uint _rgba);
/**
* Set view name.
@@ -1153,12 +1153,12 @@ version(BindBgfx_Static)
* _depth = Depth clear value.
* _stencil = Stencil clear value.
*/
- void bgfx_set_view_clear(bgfx_view_id_t _id, ushort _flags, uint _rgba, float _depth, byte _stencil);
+ void bgfx_set_view_clear(bgfx_view_id_t _id, ushort _flags, uint _rgba, float _depth, ubyte _stencil);
/**
* Set view clear flags with different clear color for each
- * frame buffer texture. Must use `bgfx::setPaletteColor` to setup clear color
- * palette.
+ * frame buffer texture. `bgfx::setPaletteColor` must be used to set up a
+ * clear color palette.
* Params:
* _id = View id.
* _flags = Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
@@ -1174,7 +1174,7 @@ version(BindBgfx_Static)
* _c6 = Palette index for frame buffer attachment 6.
* _c7 = Palette index for frame buffer attachment 7.
*/
- void bgfx_set_view_clear_mrt(bgfx_view_id_t _id, ushort _flags, float _depth, byte _stencil, byte _c0, byte _c1, byte _c2, byte _c3, byte _c4, byte _c5, byte _c6, byte _c7);
+ void bgfx_set_view_clear_mrt(bgfx_view_id_t _id, ushort _flags, float _depth, ubyte _stencil, ubyte _c0, ubyte _c1, ubyte _c2, ubyte _c3, ubyte _c4, ubyte _c5, ubyte _c6, ubyte _c7);
/**
* Set view sorting mode.
@@ -1199,8 +1199,8 @@ version(BindBgfx_Static)
void bgfx_set_view_frame_buffer(bgfx_view_id_t _id, bgfx_frame_buffer_handle_t _handle);
/**
- * Set view view and projection matrices, all draw primitives in this
- * view will use these matrices.
+ * Set view's view matrix and projection matrix,
+ * all draw primitives in this view will use these two matrices.
* Params:
* _id = View id.
* _view = View matrix.
@@ -1248,7 +1248,7 @@ version(BindBgfx_Static)
/**
* Set render states for draw primitive.
* Remarks:
- * 1. To setup more complex states use:
+ * 1. To set up more complex states use:
* `BGFX_STATE_ALPHA_REF(_ref)`,
* `BGFX_STATE_POINT_SIZE(_size)`,
* `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -1329,7 +1329,7 @@ version(BindBgfx_Static)
/**
* Reserve matrices in internal matrix cache.
- * Attention: Pointer returned can be modifed until `bgfx::frame` is called.
+ * Attention: Pointer returned can be modified until `bgfx::frame` is called.
* Params:
* _transform = Pointer to `Transform` structure.
* _num = Number of matrices.
@@ -1381,7 +1381,7 @@ version(BindBgfx_Static)
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
- void bgfx_encoder_set_vertex_buffer(bgfx_encoder_t* _this, byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
+ void bgfx_encoder_set_vertex_buffer(bgfx_encoder_t* _this, ubyte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
/**
* Set vertex buffer for draw primitive.
@@ -1394,7 +1394,7 @@ version(BindBgfx_Static)
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
- void bgfx_encoder_set_vertex_buffer_with_layout(bgfx_encoder_t* _this, byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ void bgfx_encoder_set_vertex_buffer_with_layout(bgfx_encoder_t* _this, ubyte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
/**
* Set vertex buffer for draw primitive.
@@ -1404,9 +1404,9 @@ version(BindBgfx_Static)
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
- void bgfx_encoder_set_dynamic_vertex_buffer(bgfx_encoder_t* _this, byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
+ void bgfx_encoder_set_dynamic_vertex_buffer(bgfx_encoder_t* _this, ubyte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
- void bgfx_encoder_set_dynamic_vertex_buffer_with_layout(bgfx_encoder_t* _this, byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ void bgfx_encoder_set_dynamic_vertex_buffer_with_layout(bgfx_encoder_t* _this, ubyte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
/**
* Set vertex buffer for draw primitive.
@@ -1416,7 +1416,7 @@ version(BindBgfx_Static)
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
- void bgfx_encoder_set_transient_vertex_buffer(bgfx_encoder_t* _this, byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices);
+ void bgfx_encoder_set_transient_vertex_buffer(bgfx_encoder_t* _this, ubyte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices);
/**
* Set vertex buffer for draw primitive.
@@ -1429,10 +1429,10 @@ version(BindBgfx_Static)
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
- void bgfx_encoder_set_transient_vertex_buffer_with_layout(bgfx_encoder_t* _this, byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ void bgfx_encoder_set_transient_vertex_buffer_with_layout(bgfx_encoder_t* _this, ubyte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
/**
- * Set number of vertices for auto generated vertices use in conjuction
+ * Set number of vertices for auto generated vertices use in conjunction
* with gl_VertexID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
* Params:
@@ -1469,7 +1469,7 @@ version(BindBgfx_Static)
void bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer(bgfx_encoder_t* _this, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
/**
- * Set number of instances for auto generated instances use in conjuction
+ * Set number of instances for auto generated instances use in conjunction
* with gl_InstanceID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
*/
@@ -1488,7 +1488,7 @@ version(BindBgfx_Static)
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
- void bgfx_encoder_set_texture(bgfx_encoder_t* _this, byte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
+ void bgfx_encoder_set_texture(bgfx_encoder_t* _this, ubyte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
/**
* Submit an empty primitive for rendering. Uniforms and draw state
@@ -1510,7 +1510,7 @@ version(BindBgfx_Static)
* _depth = Depth for sorting.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- void bgfx_encoder_submit(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, byte _flags);
+ void bgfx_encoder_submit(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, ubyte _flags);
/**
* Submit primitive with occlusion query for rendering.
@@ -1521,21 +1521,40 @@ version(BindBgfx_Static)
* _depth = Depth for sorting.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- void bgfx_encoder_submit_occlusion_query(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, byte _flags);
+ void bgfx_encoder_submit_occlusion_query(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, ubyte _flags);
/**
* Submit primitive for rendering with index and instance data info from
* indirect buffer.
+ * Attention: Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
* Params:
* _id = View id.
* _program = Program.
* _indirectHandle = Indirect buffer.
* _start = First element in indirect buffer.
- * _num = Number of dispatches.
+ * _num = Number of draws.
+ * _depth = Depth for sorting.
+ * _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
+ */
+ void bgfx_encoder_submit_indirect(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, ubyte _flags);
+
+ /**
+ * Submit primitive for rendering with index and instance data info and
+ * draw count from indirect buffers.
+ * Attention: Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _indirectHandle = Indirect buffer.
+ * _start = First element in indirect buffer.
+ * _numHandle = Buffer for number of draws. Must be
+ * created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
+ * _numIndex = Element in number buffer.
+ * _numMax = Max number of draws.
* _depth = Depth for sorting.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- void bgfx_encoder_submit_indirect(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags);
+ void bgfx_encoder_submit_indirect_count(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, bgfx_index_buffer_handle_t _numHandle, uint _numIndex, ushort _numMax, uint _depth, ubyte _flags);
/**
* Set compute index buffer.
@@ -1544,7 +1563,7 @@ version(BindBgfx_Static)
* _handle = Index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- void bgfx_encoder_set_compute_index_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
+ void bgfx_encoder_set_compute_index_buffer(bgfx_encoder_t* _this, ubyte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute vertex buffer.
@@ -1553,7 +1572,7 @@ version(BindBgfx_Static)
* _handle = Vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- void bgfx_encoder_set_compute_vertex_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+ void bgfx_encoder_set_compute_vertex_buffer(bgfx_encoder_t* _this, ubyte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute dynamic index buffer.
@@ -1562,7 +1581,7 @@ version(BindBgfx_Static)
* _handle = Dynamic index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- void bgfx_encoder_set_compute_dynamic_index_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
+ void bgfx_encoder_set_compute_dynamic_index_buffer(bgfx_encoder_t* _this, ubyte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute dynamic vertex buffer.
@@ -1571,7 +1590,7 @@ version(BindBgfx_Static)
* _handle = Dynamic vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- void bgfx_encoder_set_compute_dynamic_vertex_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+ void bgfx_encoder_set_compute_dynamic_vertex_buffer(bgfx_encoder_t* _this, ubyte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute indirect buffer.
@@ -1580,7 +1599,7 @@ version(BindBgfx_Static)
* _handle = Indirect buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- void bgfx_encoder_set_compute_indirect_buffer(bgfx_encoder_t* _this, byte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
+ void bgfx_encoder_set_compute_indirect_buffer(bgfx_encoder_t* _this, ubyte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute image from texture.
@@ -1591,7 +1610,7 @@ version(BindBgfx_Static)
* _access = Image access. See `Access::Enum`.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
- void bgfx_encoder_set_image(bgfx_encoder_t* _this, byte _stage, bgfx_texture_handle_t _handle, byte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
+ void bgfx_encoder_set_image(bgfx_encoder_t* _this, ubyte _stage, bgfx_texture_handle_t _handle, ubyte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
/**
* Dispatch compute.
@@ -1603,7 +1622,7 @@ version(BindBgfx_Static)
* _numZ = Number of groups Z.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- void bgfx_encoder_dispatch(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ, byte _flags);
+ void bgfx_encoder_dispatch(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ, ubyte _flags);
/**
* Dispatch compute indirect.
@@ -1615,14 +1634,14 @@ version(BindBgfx_Static)
* _num = Number of dispatches.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- void bgfx_encoder_dispatch_indirect(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, byte _flags);
+ void bgfx_encoder_dispatch_indirect(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, ubyte _flags);
/**
* Discard previously set state for draw or compute call.
* Params:
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- void bgfx_encoder_discard(bgfx_encoder_t* _this, byte _flags);
+ void bgfx_encoder_discard(bgfx_encoder_t* _this, ubyte _flags);
/**
* Blit 2D texture region between two 2D textures.
@@ -1649,7 +1668,7 @@ version(BindBgfx_Static)
* _depth = If texture is 3D this argument represents depth of region, otherwise it's
* unused.
*/
- void bgfx_encoder_blit(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_texture_handle_t _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
+ void bgfx_encoder_blit(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_texture_handle_t _dst, ubyte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, ubyte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
/**
* Request screen shot of window back buffer.
@@ -1726,7 +1745,7 @@ version(BindBgfx_Static)
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
- ulong bgfx_override_internal_texture(bgfx_texture_handle_t _handle, ushort _width, ushort _height, byte _numMips, bgfx_texture_format_t _format, ulong _flags);
+ ulong bgfx_override_internal_texture(bgfx_texture_handle_t _handle, ushort _width, ushort _height, ubyte _numMips, bgfx_texture_format_t _format, ulong _flags);
/**
* Sets a debug marker. This allows you to group graphics calls together for easy browsing in
@@ -1739,7 +1758,7 @@ version(BindBgfx_Static)
/**
* Set render states for draw primitive.
* Remarks:
- * 1. To setup more complex states use:
+ * 1. To set up more complex states use:
* `BGFX_STATE_ALPHA_REF(_ref)`,
* `BGFX_STATE_POINT_SIZE(_size)`,
* `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -1820,7 +1839,7 @@ version(BindBgfx_Static)
/**
* Reserve matrices in internal matrix cache.
- * Attention: Pointer returned can be modifed until `bgfx::frame` is called.
+ * Attention: Pointer returned can be modified until `bgfx::frame` is called.
* Params:
* _transform = Pointer to `Transform` structure.
* _num = Number of matrices.
@@ -1872,7 +1891,7 @@ version(BindBgfx_Static)
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
- void bgfx_set_vertex_buffer(byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
+ void bgfx_set_vertex_buffer(ubyte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
/**
* Set vertex buffer for draw primitive.
@@ -1885,7 +1904,7 @@ version(BindBgfx_Static)
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
- void bgfx_set_vertex_buffer_with_layout(byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ void bgfx_set_vertex_buffer_with_layout(ubyte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
/**
* Set vertex buffer for draw primitive.
@@ -1895,7 +1914,7 @@ version(BindBgfx_Static)
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
- void bgfx_set_dynamic_vertex_buffer(byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
+ void bgfx_set_dynamic_vertex_buffer(ubyte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
/**
* Set vertex buffer for draw primitive.
@@ -1908,7 +1927,7 @@ version(BindBgfx_Static)
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
- void bgfx_set_dynamic_vertex_buffer_with_layout(byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ void bgfx_set_dynamic_vertex_buffer_with_layout(ubyte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
/**
* Set vertex buffer for draw primitive.
@@ -1918,7 +1937,7 @@ version(BindBgfx_Static)
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
- void bgfx_set_transient_vertex_buffer(byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices);
+ void bgfx_set_transient_vertex_buffer(ubyte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices);
/**
* Set vertex buffer for draw primitive.
@@ -1931,10 +1950,10 @@ version(BindBgfx_Static)
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
- void bgfx_set_transient_vertex_buffer_with_layout(byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ void bgfx_set_transient_vertex_buffer_with_layout(ubyte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
/**
- * Set number of vertices for auto generated vertices use in conjuction
+ * Set number of vertices for auto generated vertices use in conjunction
* with gl_VertexID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
* Params:
@@ -1971,7 +1990,7 @@ version(BindBgfx_Static)
void bgfx_set_instance_data_from_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _num);
/**
- * Set number of instances for auto generated instances use in conjuction
+ * Set number of instances for auto generated instances use in conjunction
* with gl_InstanceID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
*/
@@ -1990,7 +2009,7 @@ version(BindBgfx_Static)
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
- void bgfx_set_texture(byte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
+ void bgfx_set_texture(ubyte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
/**
* Submit an empty primitive for rendering. Uniforms and draw state
@@ -2010,7 +2029,7 @@ version(BindBgfx_Static)
* _depth = Depth for sorting.
* _flags = Which states to discard for next draw. See `BGFX_DISCARD_*`.
*/
- void bgfx_submit(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, byte _flags);
+ void bgfx_submit(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, ubyte _flags);
/**
* Submit primitive with occlusion query for rendering.
@@ -2021,21 +2040,40 @@ version(BindBgfx_Static)
* _depth = Depth for sorting.
* _flags = Which states to discard for next draw. See `BGFX_DISCARD_*`.
*/
- void bgfx_submit_occlusion_query(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, byte _flags);
+ void bgfx_submit_occlusion_query(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, ubyte _flags);
/**
* Submit primitive for rendering with index and instance data info from
* indirect buffer.
+ * Attention: Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
* Params:
* _id = View id.
* _program = Program.
* _indirectHandle = Indirect buffer.
* _start = First element in indirect buffer.
- * _num = Number of dispatches.
+ * _num = Number of draws.
+ * _depth = Depth for sorting.
+ * _flags = Which states to discard for next draw. See `BGFX_DISCARD_*`.
+ */
+ void bgfx_submit_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, ubyte _flags);
+
+ /**
+ * Submit primitive for rendering with index and instance data info and
+ * draw count from indirect buffers.
+ * Attention: Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _indirectHandle = Indirect buffer.
+ * _start = First element in indirect buffer.
+ * _numHandle = Buffer for number of draws. Must be
+ * created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
+ * _numIndex = Element in number buffer.
+ * _numMax = Max number of draws.
* _depth = Depth for sorting.
* _flags = Which states to discard for next draw. See `BGFX_DISCARD_*`.
*/
- void bgfx_submit_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags);
+ void bgfx_submit_indirect_count(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, bgfx_index_buffer_handle_t _numHandle, uint _numIndex, ushort _numMax, uint _depth, ubyte _flags);
/**
* Set compute index buffer.
@@ -2044,7 +2082,7 @@ version(BindBgfx_Static)
* _handle = Index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- void bgfx_set_compute_index_buffer(byte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
+ void bgfx_set_compute_index_buffer(ubyte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute vertex buffer.
@@ -2053,7 +2091,7 @@ version(BindBgfx_Static)
* _handle = Vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- void bgfx_set_compute_vertex_buffer(byte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+ void bgfx_set_compute_vertex_buffer(ubyte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute dynamic index buffer.
@@ -2062,7 +2100,7 @@ version(BindBgfx_Static)
* _handle = Dynamic index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- void bgfx_set_compute_dynamic_index_buffer(byte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
+ void bgfx_set_compute_dynamic_index_buffer(ubyte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute dynamic vertex buffer.
@@ -2071,7 +2109,7 @@ version(BindBgfx_Static)
* _handle = Dynamic vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- void bgfx_set_compute_dynamic_vertex_buffer(byte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+ void bgfx_set_compute_dynamic_vertex_buffer(ubyte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute indirect buffer.
@@ -2080,7 +2118,7 @@ version(BindBgfx_Static)
* _handle = Indirect buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- void bgfx_set_compute_indirect_buffer(byte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
+ void bgfx_set_compute_indirect_buffer(ubyte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
/**
* Set compute image from texture.
@@ -2091,7 +2129,7 @@ version(BindBgfx_Static)
* _access = Image access. See `Access::Enum`.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
- void bgfx_set_image(byte _stage, bgfx_texture_handle_t _handle, byte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
+ void bgfx_set_image(ubyte _stage, bgfx_texture_handle_t _handle, ubyte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
/**
* Dispatch compute.
@@ -2103,7 +2141,7 @@ version(BindBgfx_Static)
* _numZ = Number of groups Z.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- void bgfx_dispatch(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ, byte _flags);
+ void bgfx_dispatch(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ, ubyte _flags);
/**
* Dispatch compute indirect.
@@ -2115,14 +2153,14 @@ version(BindBgfx_Static)
* _num = Number of dispatches.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- void bgfx_dispatch_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, byte _flags);
+ void bgfx_dispatch_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, ubyte _flags);
/**
* Discard previously set state for draw or compute call.
* Params:
* _flags = Draw/compute states to discard.
*/
- void bgfx_discard(byte _flags);
+ void bgfx_discard(ubyte _flags);
/**
* Blit 2D texture region between two 2D textures.
@@ -2149,7 +2187,7 @@ version(BindBgfx_Static)
* _depth = If texture is 3D this argument represents depth of region, otherwise it's
* unused.
*/
- void bgfx_blit(bgfx_view_id_t _id, bgfx_texture_handle_t _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
+ void bgfx_blit(bgfx_view_id_t _id, bgfx_texture_handle_t _dst, ubyte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, ubyte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
}
else
@@ -2166,7 +2204,7 @@ else
* _mip = Mip level.
* _resolve = Resolve flags. See: `BGFX_RESOLVE_*`
*/
- alias da_bgfx_attachment_init = void function(bgfx_attachment_t* _this, bgfx_texture_handle_t _handle, bgfx_access_t _access, ushort _layer, ushort _numLayers, ushort _mip, byte _resolve);
+ alias da_bgfx_attachment_init = void function(bgfx_attachment_t* _this, bgfx_texture_handle_t _handle, bgfx_access_t _access, ushort _layer, ushort _numLayers, ushort _mip, ubyte _resolve);
da_bgfx_attachment_init bgfx_attachment_init;
/**
@@ -2192,7 +2230,7 @@ else
* vertexConvert for AttribType::Uint8 and AttribType::Int16.
* Unpacking code must be implemented inside vertex shader.
*/
- alias da_bgfx_vertex_layout_add = bgfx_vertex_layout_t* function(bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, byte _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
+ alias da_bgfx_vertex_layout_add = bgfx_vertex_layout_t* function(bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, ubyte _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
da_bgfx_vertex_layout_add bgfx_vertex_layout_add;
/**
@@ -2204,7 +2242,7 @@ else
* _normalized = Attribute is normalized.
* _asInt = Attribute is packed as int.
*/
- alias da_bgfx_vertex_layout_decode = void function(const(bgfx_vertex_layout_t)* _this, bgfx_attrib_t _attrib, byte* _num, bgfx_attrib_type_t* _type, bool* _normalized, bool* _asInt);
+ alias da_bgfx_vertex_layout_decode = void function(const(bgfx_vertex_layout_t)* _this, bgfx_attrib_t _attrib, ubyte* _num, bgfx_attrib_type_t* _type, bool* _normalized, bool* _asInt);
da_bgfx_vertex_layout_decode bgfx_vertex_layout_decode;
/**
@@ -2220,7 +2258,7 @@ else
* Params:
* _num = Number of bytes to skip.
*/
- alias da_bgfx_vertex_layout_skip = bgfx_vertex_layout_t* function(bgfx_vertex_layout_t* _this, byte _num);
+ alias da_bgfx_vertex_layout_skip = bgfx_vertex_layout_t* function(bgfx_vertex_layout_t* _this, ubyte _num);
da_bgfx_vertex_layout_skip bgfx_vertex_layout_skip;
/**
@@ -2323,7 +2361,7 @@ else
* _max = Maximum number of elements in _enum array.
* _enum = Array where supported renderers will be written.
*/
- alias da_bgfx_get_supported_renderers = byte function(byte _max, bgfx_renderer_type_t* _enum);
+ alias da_bgfx_get_supported_renderers = ubyte function(ubyte _max, bgfx_renderer_type_t* _enum);
da_bgfx_get_supported_renderers bgfx_get_supported_renderers;
/**
@@ -2338,7 +2376,7 @@ else
da_bgfx_init_ctor bgfx_init_ctor;
/**
- * Initialize bgfx library.
+ * Initialize the bgfx library.
* Params:
* _init = Initialization parameters. See: `bgfx::Init` for more info.
*/
@@ -2353,8 +2391,8 @@ else
/**
* Reset graphic settings and back-buffer size.
- * Attention: This call doesn't actually change window size, it just
- * resizes back-buffer. Windowing code has to change window size.
+ * Attention: This call doesn’t change the window size, it just resizes
+ * the back-buffer. Your windowing code controls the window size.
* Params:
* _width = Back-buffer width.
* _height = Back-buffer height.
@@ -2369,7 +2407,7 @@ else
* - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip
* occurs. Default behaviour is that flip occurs before rendering new
* frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
- * - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB backbuffer.
+ * - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB back-buffer.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
alias da_bgfx_reset = void function(uint _width, uint _height, uint _flags, bgfx_texture_format_t _format);
@@ -2479,7 +2517,7 @@ else
* _attr = Background color.
* _small = Default 8x16 or 8x8 font.
*/
- alias da_bgfx_dbg_text_clear = void function(byte _attr, bool _small);
+ alias da_bgfx_dbg_text_clear = void function(ubyte _attr, bool _small);
da_bgfx_dbg_text_clear bgfx_dbg_text_clear;
/**
@@ -2491,7 +2529,7 @@ else
* 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
* _format = `printf` style format.
*/
- alias da_bgfx_dbg_text_printf = void function(ushort _x, ushort _y, byte _attr, const(char)* _format, ... );
+ alias da_bgfx_dbg_text_printf = void function(ushort _x, ushort _y, ubyte _attr, const(char)* _format, ... );
da_bgfx_dbg_text_printf bgfx_dbg_text_printf;
/**
@@ -2504,7 +2542,7 @@ else
* _format = `printf` style format.
* _argList = Variable arguments list for format string.
*/
- alias da_bgfx_dbg_text_vprintf = void function(ushort _x, ushort _y, byte _attr, const(char)* _format, va_list _argList);
+ alias da_bgfx_dbg_text_vprintf = void function(ushort _x, ushort _y, ubyte _attr, const(char)* _format, va_list _argList);
da_bgfx_dbg_text_vprintf bgfx_dbg_text_vprintf;
/**
@@ -2634,7 +2672,7 @@ else
da_bgfx_create_dynamic_index_buffer bgfx_create_dynamic_index_buffer;
/**
- * Create dynamic index buffer and initialized it.
+ * Create a dynamic index buffer and initialize it.
* Params:
* _mem = Index buffer data.
* _flags = Buffer creation flags.
@@ -2761,8 +2799,8 @@ else
/**
* Allocate transient index buffer.
* Params:
- * _tib = TransientIndexBuffer structure is filled and is valid
- * for the duration of frame, and it can be reused for multiple draw
+ * _tib = TransientIndexBuffer structure will be filled, and will be valid
+ * for the duration of frame, and can be reused for multiple draw
* calls.
* _num = Number of indices to allocate.
* _index32 = Set to `true` if input indices will be 32-bit.
@@ -2773,8 +2811,8 @@ else
/**
* Allocate transient vertex buffer.
* Params:
- * _tvb = TransientVertexBuffer structure is filled and is valid
- * for the duration of frame, and it can be reused for multiple draw
+ * _tvb = TransientVertexBuffer structure will be filled, and will be valid
+ * for the duration of frame, and can be reused for multiple draw
* calls.
* _num = Number of vertices to allocate.
* _layout = Vertex layout.
@@ -2787,13 +2825,13 @@ else
* buffers. If both space requirements are satisfied function returns
* true.
* Params:
- * _tvb = TransientVertexBuffer structure is filled and is valid
- * for the duration of frame, and it can be reused for multiple draw
+ * _tvb = TransientVertexBuffer structure will be filled, and will be valid
+ * for the duration of frame, and can be reused for multiple draw
* calls.
* _layout = Vertex layout.
* _numVertices = Number of vertices to allocate.
- * _tib = TransientIndexBuffer structure is filled and is valid
- * for the duration of frame, and it can be reused for multiple draw
+ * _tib = TransientIndexBuffer structure will be filled, and will be valid
+ * for the duration of frame, and can be reused for multiple draw
* calls.
* _numIndices = Number of indices to allocate.
* _index32 = Set to `true` if input indices will be 32-bit.
@@ -2804,8 +2842,8 @@ else
/**
* Allocate instance data buffer.
* Params:
- * _idb = InstanceDataBuffer structure is filled and is valid
- * for duration of frame, and it can be reused for multiple draw
+ * _idb = InstanceDataBuffer structure will be filled, and will be valid
+ * for duration of frame, and can be reused for multiple draw
* calls.
* _num = Number of instances.
* _stride = Instance stride. Must be multiple of 16.
@@ -2915,7 +2953,7 @@ else
* _num = Number of attachments.
* _attachment = Attachment texture info. See: `bgfx::Attachment`.
*/
- alias da_bgfx_is_frame_buffer_valid = bool function(byte _num, const(bgfx_attachment_t)* _attachment);
+ alias da_bgfx_is_frame_buffer_valid = bool function(ubyte _num, const(bgfx_attachment_t)* _attachment);
da_bgfx_is_frame_buffer_valid bgfx_is_frame_buffer_valid;
/**
@@ -2946,7 +2984,7 @@ else
* _skip = Skip top level mips when parsing texture.
* _info = When non-`NULL` is specified it returns parsed texture information.
*/
- alias da_bgfx_create_texture = bgfx_texture_handle_t function(const(bgfx_memory_t)* _mem, ulong _flags, byte _skip, bgfx_texture_info_t* _info);
+ alias da_bgfx_create_texture = bgfx_texture_handle_t function(const(bgfx_memory_t)* _mem, ulong _flags, ubyte _skip, bgfx_texture_info_t* _info);
da_bgfx_create_texture bgfx_create_texture;
/**
@@ -2972,7 +3010,7 @@ else
da_bgfx_create_texture_2d bgfx_create_texture_2d;
/**
- * Create texture with size based on backbuffer ratio. Texture will maintain ratio
+ * Create texture with size based on back-buffer ratio. Texture will maintain ratio
* if back buffer resolution changes.
* Params:
* _ratio = Texture size in respect to back-buffer size. See: `BackbufferRatio::Enum`.
@@ -3047,7 +3085,7 @@ else
* _pitch = Pitch of input image (bytes). When _pitch is set to
* UINT16_MAX, it will be calculated internally based on _width.
*/
- alias da_bgfx_update_texture_2d = void function(bgfx_texture_handle_t _handle, ushort _layer, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
+ alias da_bgfx_update_texture_2d = void function(bgfx_texture_handle_t _handle, ushort _layer, ubyte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
da_bgfx_update_texture_2d bgfx_update_texture_2d;
/**
@@ -3064,7 +3102,7 @@ else
* _depth = Depth of texture block.
* _mem = Texture update data.
*/
- alias da_bgfx_update_texture_3d = void function(bgfx_texture_handle_t _handle, byte _mip, ushort _x, ushort _y, ushort _z, ushort _width, ushort _height, ushort _depth, const(bgfx_memory_t)* _mem);
+ alias da_bgfx_update_texture_3d = void function(bgfx_texture_handle_t _handle, ubyte _mip, ushort _x, ushort _y, ushort _z, ushort _width, ushort _height, ushort _depth, const(bgfx_memory_t)* _mem);
da_bgfx_update_texture_3d bgfx_update_texture_3d;
/**
@@ -3100,7 +3138,7 @@ else
* _pitch = Pitch of input image (bytes). When _pitch is set to
* UINT16_MAX, it will be calculated internally based on _width.
*/
- alias da_bgfx_update_texture_cube = void function(bgfx_texture_handle_t _handle, ushort _layer, byte _side, byte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
+ alias da_bgfx_update_texture_cube = void function(bgfx_texture_handle_t _handle, ushort _layer, ubyte _side, ubyte _mip, ushort _x, ushort _y, ushort _width, ushort _height, const(bgfx_memory_t)* _mem, ushort _pitch);
da_bgfx_update_texture_cube bgfx_update_texture_cube;
/**
@@ -3112,7 +3150,7 @@ else
* _data = Destination buffer.
* _mip = Mip level.
*/
- alias da_bgfx_read_texture = uint function(bgfx_texture_handle_t _handle, void* _data, byte _mip);
+ alias da_bgfx_read_texture = uint function(bgfx_texture_handle_t _handle, void* _data, ubyte _mip);
da_bgfx_read_texture bgfx_read_texture;
/**
@@ -3161,7 +3199,7 @@ else
da_bgfx_create_frame_buffer bgfx_create_frame_buffer;
/**
- * Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
+ * Create frame buffer with size based on back-buffer ratio. Frame buffer will maintain ratio
* if back buffer resolution changes.
* Params:
* _ratio = Frame buffer size in respect to back-buffer size. See:
@@ -3185,7 +3223,7 @@ else
* _destroyTexture = If true, textures will be destroyed when
* frame buffer is destroyed.
*/
- alias da_bgfx_create_frame_buffer_from_handles = bgfx_frame_buffer_handle_t function(byte _num, const(bgfx_texture_handle_t)* _handles, bool _destroyTexture);
+ alias da_bgfx_create_frame_buffer_from_handles = bgfx_frame_buffer_handle_t function(ubyte _num, const(bgfx_texture_handle_t)* _handles, bool _destroyTexture);
da_bgfx_create_frame_buffer_from_handles bgfx_create_frame_buffer_from_handles;
/**
@@ -3197,7 +3235,7 @@ else
* _destroyTexture = If true, textures will be destroyed when
* frame buffer is destroyed.
*/
- alias da_bgfx_create_frame_buffer_from_attachment = bgfx_frame_buffer_handle_t function(byte _num, const(bgfx_attachment_t)* _attachment, bool _destroyTexture);
+ alias da_bgfx_create_frame_buffer_from_attachment = bgfx_frame_buffer_handle_t function(ubyte _num, const(bgfx_attachment_t)* _attachment, bool _destroyTexture);
da_bgfx_create_frame_buffer_from_attachment bgfx_create_frame_buffer_from_attachment;
/**
@@ -3231,7 +3269,7 @@ else
* Params:
* _handle = Frame buffer handle.
*/
- alias da_bgfx_get_texture = bgfx_texture_handle_t function(bgfx_frame_buffer_handle_t _handle, byte _attachment);
+ alias da_bgfx_get_texture = bgfx_texture_handle_t function(bgfx_frame_buffer_handle_t _handle, ubyte _attachment);
da_bgfx_get_texture bgfx_get_texture;
/**
@@ -3321,7 +3359,7 @@ else
* _index = Index into palette.
* _rgba = RGBA floating point values.
*/
- alias da_bgfx_set_palette_color = void function(byte _index, const float[4] _rgba);
+ alias da_bgfx_set_palette_color = void function(ubyte _index, const float[4] _rgba);
da_bgfx_set_palette_color bgfx_set_palette_color;
/**
@@ -3330,7 +3368,7 @@ else
* _index = Index into palette.
* _rgba = Packed 32-bit RGBA value.
*/
- alias da_bgfx_set_palette_color_rgba8 = void function(byte _index, uint _rgba);
+ alias da_bgfx_set_palette_color_rgba8 = void function(ubyte _index, uint _rgba);
da_bgfx_set_palette_color_rgba8 bgfx_set_palette_color_rgba8;
/**
@@ -3396,13 +3434,13 @@ else
* _depth = Depth clear value.
* _stencil = Stencil clear value.
*/
- alias da_bgfx_set_view_clear = void function(bgfx_view_id_t _id, ushort _flags, uint _rgba, float _depth, byte _stencil);
+ alias da_bgfx_set_view_clear = void function(bgfx_view_id_t _id, ushort _flags, uint _rgba, float _depth, ubyte _stencil);
da_bgfx_set_view_clear bgfx_set_view_clear;
/**
* Set view clear flags with different clear color for each
- * frame buffer texture. Must use `bgfx::setPaletteColor` to setup clear color
- * palette.
+ * frame buffer texture. `bgfx::setPaletteColor` must be used to set up a
+ * clear color palette.
* Params:
* _id = View id.
* _flags = Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
@@ -3418,7 +3456,7 @@ else
* _c6 = Palette index for frame buffer attachment 6.
* _c7 = Palette index for frame buffer attachment 7.
*/
- alias da_bgfx_set_view_clear_mrt = void function(bgfx_view_id_t _id, ushort _flags, float _depth, byte _stencil, byte _c0, byte _c1, byte _c2, byte _c3, byte _c4, byte _c5, byte _c6, byte _c7);
+ alias da_bgfx_set_view_clear_mrt = void function(bgfx_view_id_t _id, ushort _flags, float _depth, ubyte _stencil, ubyte _c0, ubyte _c1, ubyte _c2, ubyte _c3, ubyte _c4, ubyte _c5, ubyte _c6, ubyte _c7);
da_bgfx_set_view_clear_mrt bgfx_set_view_clear_mrt;
/**
@@ -3446,8 +3484,8 @@ else
da_bgfx_set_view_frame_buffer bgfx_set_view_frame_buffer;
/**
- * Set view view and projection matrices, all draw primitives in this
- * view will use these matrices.
+ * Set view's view matrix and projection matrix,
+ * all draw primitives in this view will use these two matrices.
* Params:
* _id = View id.
* _view = View matrix.
@@ -3501,7 +3539,7 @@ else
/**
* Set render states for draw primitive.
* Remarks:
- * 1. To setup more complex states use:
+ * 1. To set up more complex states use:
* `BGFX_STATE_ALPHA_REF(_ref)`,
* `BGFX_STATE_POINT_SIZE(_size)`,
* `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -3589,7 +3627,7 @@ else
/**
* Reserve matrices in internal matrix cache.
- * Attention: Pointer returned can be modifed until `bgfx::frame` is called.
+ * Attention: Pointer returned can be modified until `bgfx::frame` is called.
* Params:
* _transform = Pointer to `Transform` structure.
* _num = Number of matrices.
@@ -3646,7 +3684,7 @@ else
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
- alias da_bgfx_encoder_set_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
+ alias da_bgfx_encoder_set_vertex_buffer = void function(bgfx_encoder_t* _this, ubyte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
da_bgfx_encoder_set_vertex_buffer bgfx_encoder_set_vertex_buffer;
/**
@@ -3660,7 +3698,7 @@ else
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
- alias da_bgfx_encoder_set_vertex_buffer_with_layout = void function(bgfx_encoder_t* _this, byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ alias da_bgfx_encoder_set_vertex_buffer_with_layout = void function(bgfx_encoder_t* _this, ubyte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
da_bgfx_encoder_set_vertex_buffer_with_layout bgfx_encoder_set_vertex_buffer_with_layout;
/**
@@ -3671,10 +3709,10 @@ else
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
- alias da_bgfx_encoder_set_dynamic_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
+ alias da_bgfx_encoder_set_dynamic_vertex_buffer = void function(bgfx_encoder_t* _this, ubyte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
da_bgfx_encoder_set_dynamic_vertex_buffer bgfx_encoder_set_dynamic_vertex_buffer;
- alias da_bgfx_encoder_set_dynamic_vertex_buffer_with_layout = void function(bgfx_encoder_t* _this, byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ alias da_bgfx_encoder_set_dynamic_vertex_buffer_with_layout = void function(bgfx_encoder_t* _this, ubyte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
da_bgfx_encoder_set_dynamic_vertex_buffer_with_layout bgfx_encoder_set_dynamic_vertex_buffer_with_layout;
/**
@@ -3685,7 +3723,7 @@ else
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
- alias da_bgfx_encoder_set_transient_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices);
+ alias da_bgfx_encoder_set_transient_vertex_buffer = void function(bgfx_encoder_t* _this, ubyte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices);
da_bgfx_encoder_set_transient_vertex_buffer bgfx_encoder_set_transient_vertex_buffer;
/**
@@ -3699,11 +3737,11 @@ else
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
- alias da_bgfx_encoder_set_transient_vertex_buffer_with_layout = void function(bgfx_encoder_t* _this, byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ alias da_bgfx_encoder_set_transient_vertex_buffer_with_layout = void function(bgfx_encoder_t* _this, ubyte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
da_bgfx_encoder_set_transient_vertex_buffer_with_layout bgfx_encoder_set_transient_vertex_buffer_with_layout;
/**
- * Set number of vertices for auto generated vertices use in conjuction
+ * Set number of vertices for auto generated vertices use in conjunction
* with gl_VertexID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
* Params:
@@ -3744,7 +3782,7 @@ else
da_bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer;
/**
- * Set number of instances for auto generated instances use in conjuction
+ * Set number of instances for auto generated instances use in conjunction
* with gl_InstanceID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
*/
@@ -3764,7 +3802,7 @@ else
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
- alias da_bgfx_encoder_set_texture = void function(bgfx_encoder_t* _this, byte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
+ alias da_bgfx_encoder_set_texture = void function(bgfx_encoder_t* _this, ubyte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
da_bgfx_encoder_set_texture bgfx_encoder_set_texture;
/**
@@ -3788,7 +3826,7 @@ else
* _depth = Depth for sorting.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- alias da_bgfx_encoder_submit = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, byte _flags);
+ alias da_bgfx_encoder_submit = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, ubyte _flags);
da_bgfx_encoder_submit bgfx_encoder_submit;
/**
@@ -3800,32 +3838,52 @@ else
* _depth = Depth for sorting.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- alias da_bgfx_encoder_submit_occlusion_query = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, byte _flags);
+ alias da_bgfx_encoder_submit_occlusion_query = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, ubyte _flags);
da_bgfx_encoder_submit_occlusion_query bgfx_encoder_submit_occlusion_query;
/**
* Submit primitive for rendering with index and instance data info from
* indirect buffer.
+ * Attention: Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
* Params:
* _id = View id.
* _program = Program.
* _indirectHandle = Indirect buffer.
* _start = First element in indirect buffer.
- * _num = Number of dispatches.
+ * _num = Number of draws.
* _depth = Depth for sorting.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- alias da_bgfx_encoder_submit_indirect = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags);
+ alias da_bgfx_encoder_submit_indirect = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, ubyte _flags);
da_bgfx_encoder_submit_indirect bgfx_encoder_submit_indirect;
/**
+ * Submit primitive for rendering with index and instance data info and
+ * draw count from indirect buffers.
+ * Attention: Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _indirectHandle = Indirect buffer.
+ * _start = First element in indirect buffer.
+ * _numHandle = Buffer for number of draws. Must be
+ * created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
+ * _numIndex = Element in number buffer.
+ * _numMax = Max number of draws.
+ * _depth = Depth for sorting.
+ * _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
+ */
+ alias da_bgfx_encoder_submit_indirect_count = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, bgfx_index_buffer_handle_t _numHandle, uint _numIndex, ushort _numMax, uint _depth, ubyte _flags);
+ da_bgfx_encoder_submit_indirect_count bgfx_encoder_submit_indirect_count;
+
+ /**
* Set compute index buffer.
* Params:
* _stage = Compute stage.
* _handle = Index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- alias da_bgfx_encoder_set_compute_index_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
+ alias da_bgfx_encoder_set_compute_index_buffer = void function(bgfx_encoder_t* _this, ubyte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_encoder_set_compute_index_buffer bgfx_encoder_set_compute_index_buffer;
/**
@@ -3835,7 +3893,7 @@ else
* _handle = Vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- alias da_bgfx_encoder_set_compute_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+ alias da_bgfx_encoder_set_compute_vertex_buffer = void function(bgfx_encoder_t* _this, ubyte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_encoder_set_compute_vertex_buffer bgfx_encoder_set_compute_vertex_buffer;
/**
@@ -3845,7 +3903,7 @@ else
* _handle = Dynamic index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- alias da_bgfx_encoder_set_compute_dynamic_index_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
+ alias da_bgfx_encoder_set_compute_dynamic_index_buffer = void function(bgfx_encoder_t* _this, ubyte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_encoder_set_compute_dynamic_index_buffer bgfx_encoder_set_compute_dynamic_index_buffer;
/**
@@ -3855,7 +3913,7 @@ else
* _handle = Dynamic vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- alias da_bgfx_encoder_set_compute_dynamic_vertex_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+ alias da_bgfx_encoder_set_compute_dynamic_vertex_buffer = void function(bgfx_encoder_t* _this, ubyte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_encoder_set_compute_dynamic_vertex_buffer bgfx_encoder_set_compute_dynamic_vertex_buffer;
/**
@@ -3865,7 +3923,7 @@ else
* _handle = Indirect buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- alias da_bgfx_encoder_set_compute_indirect_buffer = void function(bgfx_encoder_t* _this, byte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
+ alias da_bgfx_encoder_set_compute_indirect_buffer = void function(bgfx_encoder_t* _this, ubyte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_encoder_set_compute_indirect_buffer bgfx_encoder_set_compute_indirect_buffer;
/**
@@ -3877,7 +3935,7 @@ else
* _access = Image access. See `Access::Enum`.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
- alias da_bgfx_encoder_set_image = void function(bgfx_encoder_t* _this, byte _stage, bgfx_texture_handle_t _handle, byte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
+ alias da_bgfx_encoder_set_image = void function(bgfx_encoder_t* _this, ubyte _stage, bgfx_texture_handle_t _handle, ubyte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
da_bgfx_encoder_set_image bgfx_encoder_set_image;
/**
@@ -3890,7 +3948,7 @@ else
* _numZ = Number of groups Z.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- alias da_bgfx_encoder_dispatch = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ, byte _flags);
+ alias da_bgfx_encoder_dispatch = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ, ubyte _flags);
da_bgfx_encoder_dispatch bgfx_encoder_dispatch;
/**
@@ -3903,7 +3961,7 @@ else
* _num = Number of dispatches.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- alias da_bgfx_encoder_dispatch_indirect = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, byte _flags);
+ alias da_bgfx_encoder_dispatch_indirect = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, ubyte _flags);
da_bgfx_encoder_dispatch_indirect bgfx_encoder_dispatch_indirect;
/**
@@ -3911,7 +3969,7 @@ else
* Params:
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- alias da_bgfx_encoder_discard = void function(bgfx_encoder_t* _this, byte _flags);
+ alias da_bgfx_encoder_discard = void function(bgfx_encoder_t* _this, ubyte _flags);
da_bgfx_encoder_discard bgfx_encoder_discard;
/**
@@ -3939,7 +3997,7 @@ else
* _depth = If texture is 3D this argument represents depth of region, otherwise it's
* unused.
*/
- alias da_bgfx_encoder_blit = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_texture_handle_t _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
+ alias da_bgfx_encoder_blit = void function(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_texture_handle_t _dst, ubyte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, ubyte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
da_bgfx_encoder_blit bgfx_encoder_blit;
/**
@@ -4022,7 +4080,7 @@ else
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
- alias da_bgfx_override_internal_texture = ulong function(bgfx_texture_handle_t _handle, ushort _width, ushort _height, byte _numMips, bgfx_texture_format_t _format, ulong _flags);
+ alias da_bgfx_override_internal_texture = ulong function(bgfx_texture_handle_t _handle, ushort _width, ushort _height, ubyte _numMips, bgfx_texture_format_t _format, ulong _flags);
da_bgfx_override_internal_texture bgfx_override_internal_texture;
/**
@@ -4037,7 +4095,7 @@ else
/**
* Set render states for draw primitive.
* Remarks:
- * 1. To setup more complex states use:
+ * 1. To set up more complex states use:
* `BGFX_STATE_ALPHA_REF(_ref)`,
* `BGFX_STATE_POINT_SIZE(_size)`,
* `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -4125,7 +4183,7 @@ else
/**
* Reserve matrices in internal matrix cache.
- * Attention: Pointer returned can be modifed until `bgfx::frame` is called.
+ * Attention: Pointer returned can be modified until `bgfx::frame` is called.
* Params:
* _transform = Pointer to `Transform` structure.
* _num = Number of matrices.
@@ -4182,7 +4240,7 @@ else
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
- alias da_bgfx_set_vertex_buffer = void function(byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
+ alias da_bgfx_set_vertex_buffer = void function(ubyte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
da_bgfx_set_vertex_buffer bgfx_set_vertex_buffer;
/**
@@ -4196,7 +4254,7 @@ else
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
- alias da_bgfx_set_vertex_buffer_with_layout = void function(byte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ alias da_bgfx_set_vertex_buffer_with_layout = void function(ubyte _stream, bgfx_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
da_bgfx_set_vertex_buffer_with_layout bgfx_set_vertex_buffer_with_layout;
/**
@@ -4207,7 +4265,7 @@ else
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
- alias da_bgfx_set_dynamic_vertex_buffer = void function(byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
+ alias da_bgfx_set_dynamic_vertex_buffer = void function(ubyte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices);
da_bgfx_set_dynamic_vertex_buffer bgfx_set_dynamic_vertex_buffer;
/**
@@ -4221,7 +4279,7 @@ else
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
- alias da_bgfx_set_dynamic_vertex_buffer_with_layout = void function(byte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ alias da_bgfx_set_dynamic_vertex_buffer_with_layout = void function(ubyte _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
da_bgfx_set_dynamic_vertex_buffer_with_layout bgfx_set_dynamic_vertex_buffer_with_layout;
/**
@@ -4232,7 +4290,7 @@ else
* _startVertex = First vertex to render.
* _numVertices = Number of vertices to render.
*/
- alias da_bgfx_set_transient_vertex_buffer = void function(byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices);
+ alias da_bgfx_set_transient_vertex_buffer = void function(ubyte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices);
da_bgfx_set_transient_vertex_buffer bgfx_set_transient_vertex_buffer;
/**
@@ -4246,11 +4304,11 @@ else
* handle is used, vertex layout used for creation
* of vertex buffer will be used.
*/
- alias da_bgfx_set_transient_vertex_buffer_with_layout = void function(byte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
+ alias da_bgfx_set_transient_vertex_buffer_with_layout = void function(ubyte _stream, const(bgfx_transient_vertex_buffer_t)* _tvb, uint _startVertex, uint _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
da_bgfx_set_transient_vertex_buffer_with_layout bgfx_set_transient_vertex_buffer_with_layout;
/**
- * Set number of vertices for auto generated vertices use in conjuction
+ * Set number of vertices for auto generated vertices use in conjunction
* with gl_VertexID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
* Params:
@@ -4291,7 +4349,7 @@ else
da_bgfx_set_instance_data_from_dynamic_vertex_buffer bgfx_set_instance_data_from_dynamic_vertex_buffer;
/**
- * Set number of instances for auto generated instances use in conjuction
+ * Set number of instances for auto generated instances use in conjunction
* with gl_InstanceID.
* Attention: Availability depends on: `BGFX_CAPS_VERTEX_ID`.
*/
@@ -4311,7 +4369,7 @@ else
* - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
* sampling.
*/
- alias da_bgfx_set_texture = void function(byte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
+ alias da_bgfx_set_texture = void function(ubyte _stage, bgfx_uniform_handle_t _sampler, bgfx_texture_handle_t _handle, uint _flags);
da_bgfx_set_texture bgfx_set_texture;
/**
@@ -4333,7 +4391,7 @@ else
* _depth = Depth for sorting.
* _flags = Which states to discard for next draw. See `BGFX_DISCARD_*`.
*/
- alias da_bgfx_submit = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, byte _flags);
+ alias da_bgfx_submit = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _depth, ubyte _flags);
da_bgfx_submit bgfx_submit;
/**
@@ -4345,32 +4403,52 @@ else
* _depth = Depth for sorting.
* _flags = Which states to discard for next draw. See `BGFX_DISCARD_*`.
*/
- alias da_bgfx_submit_occlusion_query = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, byte _flags);
+ alias da_bgfx_submit_occlusion_query = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint _depth, ubyte _flags);
da_bgfx_submit_occlusion_query bgfx_submit_occlusion_query;
/**
* Submit primitive for rendering with index and instance data info from
* indirect buffer.
+ * Attention: Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
* Params:
* _id = View id.
* _program = Program.
* _indirectHandle = Indirect buffer.
* _start = First element in indirect buffer.
- * _num = Number of dispatches.
+ * _num = Number of draws.
* _depth = Depth for sorting.
* _flags = Which states to discard for next draw. See `BGFX_DISCARD_*`.
*/
- alias da_bgfx_submit_indirect = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, byte _flags);
+ alias da_bgfx_submit_indirect = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, uint _depth, ubyte _flags);
da_bgfx_submit_indirect bgfx_submit_indirect;
/**
+ * Submit primitive for rendering with index and instance data info and
+ * draw count from indirect buffers.
+ * Attention: Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+ * Params:
+ * _id = View id.
+ * _program = Program.
+ * _indirectHandle = Indirect buffer.
+ * _start = First element in indirect buffer.
+ * _numHandle = Buffer for number of draws. Must be
+ * created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
+ * _numIndex = Element in number buffer.
+ * _numMax = Max number of draws.
+ * _depth = Depth for sorting.
+ * _flags = Which states to discard for next draw. See `BGFX_DISCARD_*`.
+ */
+ alias da_bgfx_submit_indirect_count = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, bgfx_index_buffer_handle_t _numHandle, uint _numIndex, ushort _numMax, uint _depth, ubyte _flags);
+ da_bgfx_submit_indirect_count bgfx_submit_indirect_count;
+
+ /**
* Set compute index buffer.
* Params:
* _stage = Compute stage.
* _handle = Index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- alias da_bgfx_set_compute_index_buffer = void function(byte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
+ alias da_bgfx_set_compute_index_buffer = void function(ubyte _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_set_compute_index_buffer bgfx_set_compute_index_buffer;
/**
@@ -4380,7 +4458,7 @@ else
* _handle = Vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- alias da_bgfx_set_compute_vertex_buffer = void function(byte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+ alias da_bgfx_set_compute_vertex_buffer = void function(ubyte _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_set_compute_vertex_buffer bgfx_set_compute_vertex_buffer;
/**
@@ -4390,7 +4468,7 @@ else
* _handle = Dynamic index buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- alias da_bgfx_set_compute_dynamic_index_buffer = void function(byte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
+ alias da_bgfx_set_compute_dynamic_index_buffer = void function(ubyte _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_set_compute_dynamic_index_buffer bgfx_set_compute_dynamic_index_buffer;
/**
@@ -4400,7 +4478,7 @@ else
* _handle = Dynamic vertex buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- alias da_bgfx_set_compute_dynamic_vertex_buffer = void function(byte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
+ alias da_bgfx_set_compute_dynamic_vertex_buffer = void function(ubyte _stage, bgfx_dynamic_vertex_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_set_compute_dynamic_vertex_buffer bgfx_set_compute_dynamic_vertex_buffer;
/**
@@ -4410,7 +4488,7 @@ else
* _handle = Indirect buffer handle.
* _access = Buffer access. See `Access::Enum`.
*/
- alias da_bgfx_set_compute_indirect_buffer = void function(byte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
+ alias da_bgfx_set_compute_indirect_buffer = void function(ubyte _stage, bgfx_indirect_buffer_handle_t _handle, bgfx_access_t _access);
da_bgfx_set_compute_indirect_buffer bgfx_set_compute_indirect_buffer;
/**
@@ -4422,7 +4500,7 @@ else
* _access = Image access. See `Access::Enum`.
* _format = Texture format. See: `TextureFormat::Enum`.
*/
- alias da_bgfx_set_image = void function(byte _stage, bgfx_texture_handle_t _handle, byte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
+ alias da_bgfx_set_image = void function(ubyte _stage, bgfx_texture_handle_t _handle, ubyte _mip, bgfx_access_t _access, bgfx_texture_format_t _format);
da_bgfx_set_image bgfx_set_image;
/**
@@ -4435,7 +4513,7 @@ else
* _numZ = Number of groups Z.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- alias da_bgfx_dispatch = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ, byte _flags);
+ alias da_bgfx_dispatch = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint _numX, uint _numY, uint _numZ, ubyte _flags);
da_bgfx_dispatch bgfx_dispatch;
/**
@@ -4448,7 +4526,7 @@ else
* _num = Number of dispatches.
* _flags = Discard or preserve states. See `BGFX_DISCARD_*`.
*/
- alias da_bgfx_dispatch_indirect = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, byte _flags);
+ alias da_bgfx_dispatch_indirect = void function(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, ushort _start, ushort _num, ubyte _flags);
da_bgfx_dispatch_indirect bgfx_dispatch_indirect;
/**
@@ -4456,7 +4534,7 @@ else
* Params:
* _flags = Draw/compute states to discard.
*/
- alias da_bgfx_discard = void function(byte _flags);
+ alias da_bgfx_discard = void function(ubyte _flags);
da_bgfx_discard bgfx_discard;
/**
@@ -4484,7 +4562,7 @@ else
* _depth = If texture is 3D this argument represents depth of region, otherwise it's
* unused.
*/
- alias da_bgfx_blit = void function(bgfx_view_id_t _id, bgfx_texture_handle_t _dst, byte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, byte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
+ alias da_bgfx_blit = void function(bgfx_view_id_t _id, bgfx_texture_handle_t _dst, ubyte _dstMip, ushort _dstX, ushort _dstY, ushort _dstZ, bgfx_texture_handle_t _src, ubyte _srcMip, ushort _srcX, ushort _srcY, ushort _srcZ, ushort _width, ushort _height, ushort _depth);
da_bgfx_blit bgfx_blit;
}
diff --git a/3rdparty/bgfx/bindings/d/types.d b/3rdparty/bgfx/bindings/d/types.d
index c3c92790e0a..ae44638f4cd 100644
--- a/3rdparty/bgfx/bindings/d/types.d
+++ b/3rdparty/bgfx/bindings/d/types.d
@@ -8,12 +8,45 @@ module bindbc.bgfx.types;
public import core.stdc.stdarg : va_list;
+enum expandEnum(EnumType, string fqnEnumType = EnumType.stringof) = (){
+ string expandEnum;
+ foreach(m; __traits(allMembers, EnumType)){
+ expandEnum ~= "alias " ~ m ~ " = " ~ fqnEnumType ~ "." ~ m ~ ";";
+ }
+ return expandEnum;
+}();
+
extern(C) @nogc nothrow:
-enum uint BGFX_API_VERSION = 115;
+enum uint BGFX_API_VERSION = 118;
alias bgfx_view_id_t = ushort;
+//NOTE: TEMPORARY fix to some missing preprocessor function-macros...
+static BGFX_STATE_BLEND_FUNC_SEPARATE(ulong _srcRGB, ulong _dstRGB, ulong _srcA, ulong _dstA){
+ return (0UL
+ | ( ( cast(ulong)_srcRGB | ( cast(ulong)_dstRGB<<4) ) )
+ | ( ( cast(ulong)_srcA | ( cast(ulong)_dstA <<4) )<<8)
+ );
+}
+
+/// Blend equation separate.
+static BGFX_STATE_BLEND_EQUATION_SEPARATE(ulong _equationRGB, ulong _equationA){ return ( cast(ulong)_equationRGB | (cast(ulong)_equationA<<3) ); }
+
+/// Blend function.
+static BGFX_STATE_BLEND_FUNC(ulong _src, ulong _dst){ return BGFX_STATE_BLEND_FUNC_SEPARATE(_src, _dst, _src, _dst); }
+
+/// Blend equation.
+static BGFX_STATE_BLEND_EQUATION(ulong _equation){ return BGFX_STATE_BLEND_EQUATION_SEPARATE(_equation, _equation); }
+
+/// Utility predefined blend modes.
+
+/// Additive blending.
+static BGFX_STATE_BLEND_ADD(){ return (0 | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)); }
+
+/// Alpha blend.
+static BGFX_STATE_BLEND_ALPHA(){ return (0 | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)); }
+
/// Memory release callback.
/// Color RGB/alpha/depth write. When it's not specified write will be disabled.
@@ -211,7 +244,7 @@ enum uint BGFX_DEBUG_WIREFRAME = 0x00000001; /// Enable wireframe for all primit
enum uint BGFX_DEBUG_IFH = 0x00000002;
enum uint BGFX_DEBUG_STATS = 0x00000004; /// Enable statistics display.
enum uint BGFX_DEBUG_TEXT = 0x00000008; /// Enable debug text display.
-enum uint BGFX_DEBUG_PROFILER = 0x00000010; /// Enable profiler.
+enum uint BGFX_DEBUG_PROFILER = 0x00000010; /// Enable profiler. This causes per-view statistics to be collected, available through `bgfx::Stats::ViewStats`. This is unrelated to the profiler functions in `bgfx::CallbackI`.
enum ushort BGFX_BUFFER_COMPUTE_FORMAT_8X1 = 0x0001; /// 1 8-bit value
enum ushort BGFX_BUFFER_COMPUTE_FORMAT_8X2 = 0x0002; /// 2 8-bit values
@@ -340,6 +373,7 @@ enum uint BGFX_RESET_HDR10 = 0x00010000; /// Enable HDR10 rendering.
enum uint BGFX_RESET_HIDPI = 0x00020000; /// Enable HiDPI rendering.
enum uint BGFX_RESET_DEPTH_CLAMP = 0x00040000; /// Enable depth clamp.
enum uint BGFX_RESET_SUSPEND = 0x00080000; /// Suspend rendering.
+enum uint BGFX_RESET_TRANSPARENT_BACKBUFFER = 0x00100000; /// Transparent backbuffer. Availability depends on: `BGFX_CAPS_TRANSPARENT_BACKBUFFER`.
enum uint BGFX_RESET_FULLSCREEN_SHIFT = 0;
enum uint BGFX_RESET_FULLSCREEN_MASK = 0x00000001;
@@ -366,16 +400,18 @@ enum ulong BGFX_CAPS_SWAP_CHAIN = 0x0000000000008000; /// Multiple windows are s
enum ulong BGFX_CAPS_TEXTURE_2D_ARRAY = 0x0000000000010000; /// 2D texture array is supported.
enum ulong BGFX_CAPS_TEXTURE_3D = 0x0000000000020000; /// 3D textures are supported.
enum ulong BGFX_CAPS_TEXTURE_BLIT = 0x0000000000040000; /// Texture blit is supported.
-enum ulong BGFX_CAPS_TEXTURE_COMPARE_RESERVED = 0x0000000000080000;
-enum ulong BGFX_CAPS_TEXTURE_COMPARE_LEQUAL = 0x0000000000100000; /// Texture compare less equal mode is supported.
-enum ulong BGFX_CAPS_TEXTURE_CUBE_ARRAY = 0x0000000000200000; /// Cubemap texture array is supported.
-enum ulong BGFX_CAPS_TEXTURE_DIRECT_ACCESS = 0x0000000000400000; /// CPU direct access to GPU texture memory.
-enum ulong BGFX_CAPS_TEXTURE_READ_BACK = 0x0000000000800000; /// Read-back texture is supported.
-enum ulong BGFX_CAPS_VERTEX_ATTRIB_HALF = 0x0000000001000000; /// Vertex attribute half-float is supported.
-enum ulong BGFX_CAPS_VERTEX_ATTRIB_UINT10 = 0x0000000002000000; /// Vertex attribute 10_10_10_2 is supported.
-enum ulong BGFX_CAPS_VERTEX_ID = 0x0000000004000000; /// Rendering with VertexID only is supported.
-enum ulong BGFX_CAPS_VIEWPORT_LAYER_ARRAY = 0x0000000008000000; /// Viewport layer is available in vertex shader.
-enum ulong BGFX_CAPS_TEXTURE_COMPARE_ALL = 0x0000000000180000; /// All texture compare modes are supported.
+enum ulong BGFX_CAPS_TRANSPARENT_BACKBUFFER = 0x0000000000080000; /// Transparent back buffer supported.
+enum ulong BGFX_CAPS_TEXTURE_COMPARE_RESERVED = 0x0000000000100000;
+enum ulong BGFX_CAPS_TEXTURE_COMPARE_LEQUAL = 0x0000000000200000; /// Texture compare less equal mode is supported.
+enum ulong BGFX_CAPS_TEXTURE_CUBE_ARRAY = 0x0000000000400000; /// Cubemap texture array is supported.
+enum ulong BGFX_CAPS_TEXTURE_DIRECT_ACCESS = 0x0000000000800000; /// CPU direct access to GPU texture memory.
+enum ulong BGFX_CAPS_TEXTURE_READ_BACK = 0x0000000001000000; /// Read-back texture is supported.
+enum ulong BGFX_CAPS_VERTEX_ATTRIB_HALF = 0x0000000002000000; /// Vertex attribute half-float is supported.
+enum ulong BGFX_CAPS_VERTEX_ATTRIB_UINT10 = 0x0000000004000000; /// Vertex attribute 10_10_10_2 is supported.
+enum ulong BGFX_CAPS_VERTEX_ID = 0x0000000008000000; /// Rendering with VertexID only is supported.
+enum ulong BGFX_CAPS_VIEWPORT_LAYER_ARRAY = 0x0000000010000000; /// Viewport layer is available in vertex shader.
+enum ulong BGFX_CAPS_DRAW_INDIRECT_COUNT = 0x0000000020000000; /// Draw indirect with indirect count is supported.
+enum ulong BGFX_CAPS_TEXTURE_COMPARE_ALL = 0x0000000000300000; /// All texture compare modes are supported.
enum uint BGFX_CAPS_FORMAT_TEXTURE_NONE = 0x00000000; /// Texture format is not supported.
enum uint BGFX_CAPS_FORMAT_TEXTURE_2D = 0x00000001; /// Texture format is supported.
@@ -401,8 +437,11 @@ enum ubyte BGFX_RESOLVE_AUTO_GEN_MIPS = 0x01; /// Auto-generate mip maps on reso
enum ushort BGFX_PCI_ID_NONE = 0x0000; /// Autoselect adapter.
enum ushort BGFX_PCI_ID_SOFTWARE_RASTERIZER = 0x0001; /// Software rasterizer.
enum ushort BGFX_PCI_ID_AMD = 0x1002; /// AMD adapter.
+enum ushort BGFX_PCI_ID_APPLE = 0x106b; /// Apple adapter.
enum ushort BGFX_PCI_ID_INTEL = 0x8086; /// Intel adapter.
enum ushort BGFX_PCI_ID_NVIDIA = 0x10de; /// nVidia adapter.
+enum ushort BGFX_PCI_ID_MICROSOFT = 0x1414; /// Microsoft adapter.
+enum ushort BGFX_PCI_ID_ARM = 0x13b5; /// ARM adapter.
enum ubyte BGFX_CUBE_MAP_POSITIVE_X = 0x00; /// Cubemap +x.
enum ubyte BGFX_CUBE_MAP_NEGATIVE_X = 0x01; /// Cubemap -x.
@@ -422,6 +461,7 @@ enum bgfx_fatal_t
BGFX_FATAL_COUNT
}
+mixin(expandEnum!bgfx_fatal_t);
/// Renderer backend type enum.
enum bgfx_renderer_type_t
@@ -441,6 +481,7 @@ enum bgfx_renderer_type_t
BGFX_RENDERER_TYPE_COUNT
}
+mixin(expandEnum!bgfx_renderer_type_t);
/// Access mode enum.
enum bgfx_access_t
@@ -451,6 +492,7 @@ enum bgfx_access_t
BGFX_ACCESS_COUNT
}
+mixin(expandEnum!bgfx_access_t);
/// Vertex attribute enum.
enum bgfx_attrib_t
@@ -476,6 +518,7 @@ enum bgfx_attrib_t
BGFX_ATTRIB_COUNT
}
+mixin(expandEnum!bgfx_attrib_t);
/// Vertex attribute type enum.
enum bgfx_attrib_type_t
@@ -488,6 +531,7 @@ enum bgfx_attrib_type_t
BGFX_ATTRIB_TYPE_COUNT
}
+mixin(expandEnum!bgfx_attrib_type_t);
/**
* Texture format enum.
@@ -526,11 +570,19 @@ enum bgfx_texture_format_t
BGFX_TEXTURE_FORMAT_ATCE, /// ATCE RGBA 8 BPP explicit alpha
BGFX_TEXTURE_FORMAT_ATCI, /// ATCI RGBA 8 BPP interpolated alpha
BGFX_TEXTURE_FORMAT_ASTC4X4, /// ASTC 4x4 8.0 BPP
+ BGFX_TEXTURE_FORMAT_ASTC5X4, /// ASTC 5x4 6.40 BPP
BGFX_TEXTURE_FORMAT_ASTC5X5, /// ASTC 5x5 5.12 BPP
+ BGFX_TEXTURE_FORMAT_ASTC6X5, /// ASTC 6x5 4.27 BPP
BGFX_TEXTURE_FORMAT_ASTC6X6, /// ASTC 6x6 3.56 BPP
BGFX_TEXTURE_FORMAT_ASTC8X5, /// ASTC 8x5 3.20 BPP
BGFX_TEXTURE_FORMAT_ASTC8X6, /// ASTC 8x6 2.67 BPP
+ BGFX_TEXTURE_FORMAT_ASTC8X8, /// ASTC 8x8 2.00 BPP
BGFX_TEXTURE_FORMAT_ASTC10X5, /// ASTC 10x5 2.56 BPP
+ BGFX_TEXTURE_FORMAT_ASTC10X6, /// ASTC 10x6 2.13 BPP
+ BGFX_TEXTURE_FORMAT_ASTC10X8, /// ASTC 10x8 1.60 BPP
+ BGFX_TEXTURE_FORMAT_ASTC10X10, /// ASTC 10x10 1.28 BPP
+ BGFX_TEXTURE_FORMAT_ASTC12X10, /// ASTC 12x10 1.07 BPP
+ BGFX_TEXTURE_FORMAT_ASTC12X12, /// ASTC 12x12 0.89 BPP
BGFX_TEXTURE_FORMAT_UNKNOWN, /// Compressed formats above.
BGFX_TEXTURE_FORMAT_R1,
BGFX_TEXTURE_FORMAT_A8,
@@ -576,8 +628,11 @@ enum bgfx_texture_format_t
BGFX_TEXTURE_FORMAT_RGBA32I,
BGFX_TEXTURE_FORMAT_RGBA32U,
BGFX_TEXTURE_FORMAT_RGBA32F,
+ BGFX_TEXTURE_FORMAT_B5G6R5,
BGFX_TEXTURE_FORMAT_R5G6B5,
+ BGFX_TEXTURE_FORMAT_BGRA4,
BGFX_TEXTURE_FORMAT_RGBA4,
+ BGFX_TEXTURE_FORMAT_BGR5A1,
BGFX_TEXTURE_FORMAT_RGB5A1,
BGFX_TEXTURE_FORMAT_RGB10A2,
BGFX_TEXTURE_FORMAT_RG11B10F,
@@ -593,6 +648,7 @@ enum bgfx_texture_format_t
BGFX_TEXTURE_FORMAT_COUNT
}
+mixin(expandEnum!bgfx_texture_format_t);
/// Uniform type enum.
enum bgfx_uniform_type_t
@@ -605,6 +661,7 @@ enum bgfx_uniform_type_t
BGFX_UNIFORM_TYPE_COUNT
}
+mixin(expandEnum!bgfx_uniform_type_t);
/// Backbuffer ratio enum.
enum bgfx_backbuffer_ratio_t
@@ -618,6 +675,7 @@ enum bgfx_backbuffer_ratio_t
BGFX_BACKBUFFER_RATIO_COUNT
}
+mixin(expandEnum!bgfx_backbuffer_ratio_t);
/// Occlusion query result.
enum bgfx_occlusion_query_result_t
@@ -628,6 +686,7 @@ enum bgfx_occlusion_query_result_t
BGFX_OCCLUSION_QUERY_RESULT_COUNT
}
+mixin(expandEnum!bgfx_occlusion_query_result_t);
/// Primitive topology.
enum bgfx_topology_t
@@ -640,6 +699,7 @@ enum bgfx_topology_t
BGFX_TOPOLOGY_COUNT
}
+mixin(expandEnum!bgfx_topology_t);
/// Topology conversion function.
enum bgfx_topology_convert_t
@@ -652,6 +712,7 @@ enum bgfx_topology_convert_t
BGFX_TOPOLOGY_CONVERT_COUNT
}
+mixin(expandEnum!bgfx_topology_convert_t);
/// Topology sort order.
enum bgfx_topology_sort_t
@@ -671,6 +732,7 @@ enum bgfx_topology_sort_t
BGFX_TOPOLOGY_SORT_COUNT
}
+mixin(expandEnum!bgfx_topology_sort_t);
/// View mode sets draw call sort order.
enum bgfx_view_mode_t
@@ -682,6 +744,7 @@ enum bgfx_view_mode_t
BGFX_VIEW_MODE_COUNT
}
+mixin(expandEnum!bgfx_view_mode_t);
/// Render frame enum.
enum bgfx_render_frame_t
@@ -693,6 +756,7 @@ enum bgfx_render_frame_t
BGFX_RENDER_FRAME_COUNT
}
+mixin(expandEnum!bgfx_render_frame_t);
/// GPU info.
struct bgfx_caps_gpu_t
@@ -744,7 +808,7 @@ struct bgfx_caps_t
ushort deviceId; /// Selected GPU device id.
bool homogeneousDepth; /// True when NDC depth is in [-1, 1] range, otherwise its [0, 1].
bool originBottomLeft; /// True when NDC origin is at bottom left.
- byte numGPUs; /// Number of enumerated GPUs.
+ ubyte numGPUs; /// Number of enumerated GPUs.
bgfx_caps_gpu_t[4] gpu; /// Enumerated GPUs.
bgfx_caps_limits_t limits; /// Renderer runtime limits.
@@ -789,11 +853,16 @@ struct bgfx_platform_data_t
void* ndt; /// Native display type (*nix specific).
/**
- * Native window handle. If `NULL` bgfx will create headless
- * context/device if renderer API supports it.
+ * Native window handle. If `NULL`, bgfx will create a headless
+ * context/device, provided the rendering API supports it.
*/
void* nwh;
- void* context; /// GL context, or D3D device. If `NULL`, bgfx will create context/device.
+
+ /**
+ * GL context, D3D device, or Vulkan device. If `NULL`, bgfx
+ * will create context/device.
+ */
+ void* context;
/**
* GL back-buffer, or D3D render target view. If `NULL` bgfx will
@@ -802,7 +871,7 @@ struct bgfx_platform_data_t
void* backBuffer;
/**
- * Backbuffer depth/stencil. If `NULL` bgfx will create back-buffer
+ * Backbuffer depth/stencil. If `NULL`, bgfx will create a back-buffer
* depth/stencil surface.
*/
void* backBufferDS;
@@ -815,8 +884,8 @@ struct bgfx_resolution_t
uint width; /// Backbuffer width.
uint height; /// Backbuffer height.
uint reset; /// Reset parameters.
- byte numBackBuffers; /// Number of back buffers.
- byte maxFrameLatency; /// Maximum frame latency.
+ ubyte numBackBuffers; /// Number of back buffers.
+ ubyte maxFrameLatency; /// Maximum frame latency.
}
/// Configurable runtime limits parameters.
@@ -840,23 +909,25 @@ struct bgfx_init_t
bgfx_renderer_type_t type;
/**
- * Vendor PCI id. If set to `BGFX_PCI_ID_NONE` it will select the first
- * device.
+ * Vendor PCI ID. If set to `BGFX_PCI_ID_NONE`, discrete and integrated
+ * GPUs will be prioritised.
* - `BGFX_PCI_ID_NONE` - Autoselect adapter.
* - `BGFX_PCI_ID_SOFTWARE_RASTERIZER` - Software rasterizer.
* - `BGFX_PCI_ID_AMD` - AMD adapter.
+ * - `BGFX_PCI_ID_APPLE` - Apple adapter.
* - `BGFX_PCI_ID_INTEL` - Intel adapter.
- * - `BGFX_PCI_ID_NVIDIA` - nVidia adapter.
+ * - `BGFX_PCI_ID_NVIDIA` - NVIDIA adapter.
+ * - `BGFX_PCI_ID_MICROSOFT` - Microsoft adapter.
*/
ushort vendorId;
/**
- * Device id. If set to 0 it will select first device, or device with
- * matching id.
+ * Device ID. If set to 0 it will select first device, or device with
+ * matching ID.
*/
ushort deviceId;
ulong capabilities; /// Capabilities initialization mask (default: UINT64_MAX).
- bool debug_; /// Enable device for debuging.
+ bool debug_; /// Enable device for debugging.
bool profile; /// Enable device for profiling.
bgfx_platform_data_t platformData; /// Platform data.
bgfx_resolution_t resolution; /// Backbuffer resolution and reset parameters. See: `bgfx::Resolution`.
@@ -882,14 +953,14 @@ struct bgfx_init_t
*/
struct bgfx_memory_t
{
- byte* data; /// Pointer to data.
+ ubyte* data; /// Pointer to data.
uint size; /// Data size.
}
/// Transient index buffer.
struct bgfx_transient_index_buffer_t
{
- byte* data; /// Pointer to data.
+ ubyte* data; /// Pointer to data.
uint size; /// Data size.
uint startIndex; /// First index.
bgfx_index_buffer_handle_t handle; /// Index buffer handle.
@@ -899,7 +970,7 @@ struct bgfx_transient_index_buffer_t
/// Transient vertex buffer.
struct bgfx_transient_vertex_buffer_t
{
- byte* data; /// Pointer to data.
+ ubyte* data; /// Pointer to data.
uint size; /// Data size.
uint startVertex; /// First vertex.
ushort stride; /// Vertex stride.
@@ -910,7 +981,7 @@ struct bgfx_transient_vertex_buffer_t
/// Instance data buffer info.
struct bgfx_instance_data_buffer_t
{
- byte* data; /// Pointer to data.
+ ubyte* data; /// Pointer to data.
uint size; /// Data size.
uint offset; /// Offset in vertex buffer.
uint num; /// Number of instances.
@@ -927,8 +998,8 @@ struct bgfx_texture_info_t
ushort height; /// Texture height.
ushort depth; /// Texture depth.
ushort numLayers; /// Number of layers in texture array.
- byte numMips; /// Number of MIP maps.
- byte bitsPerPixel; /// Format bits per pixel.
+ ubyte numMips; /// Number of MIP maps.
+ ubyte bitsPerPixel; /// Format bits per pixel.
bool cubeMap; /// Texture is cubemap.
}
@@ -948,7 +1019,7 @@ struct bgfx_attachment_t
ushort mip; /// Mip level.
ushort layer; /// Cubemap side or depth layer/slice to use.
ushort numLayers; /// Number of texture layer/slice(s) in array to use.
- byte resolve; /// Resolve flags. See: `BGFX_RESOLVE_*`
+ ubyte resolve; /// Resolve flags. See: `BGFX_RESOLVE_*`
}
/// Transform data.
@@ -967,6 +1038,7 @@ struct bgfx_view_stats_t
long cpuTimeEnd; /// CPU (submit) end time.
long gpuTimeBegin; /// GPU begin time.
long gpuTimeEnd; /// GPU end time.
+ uint gpuFrameNum; /// Frame which generated gpuTimeBegin, gpuTimeEnd.
}
/// Encoder stats.
@@ -996,6 +1068,7 @@ struct bgfx_stats_t
uint numCompute; /// Number of compute calls submitted.
uint numBlit; /// Number of blit calls submitted.
uint maxGpuLatency; /// GPU driver latency.
+ uint gpuFrameNum; /// Frame which generated gpuTimeBegin, gpuTimeEnd.
ushort numDynamicIndexBuffers; /// Number of used dynamic index buffers.
ushort numDynamicVertexBuffers; /// Number of used dynamic vertex buffers.
ushort numFrameBuffers; /// Number of used frame buffers.
@@ -1020,7 +1093,7 @@ struct bgfx_stats_t
ushort textHeight; /// Debug text height in characters.
ushort numViews; /// Number of view stats.
bgfx_view_stats_t* viewStats; /// Array of View stats.
- byte numEncoders; /// Number of encoders used during frame.
+ ubyte numEncoders; /// Number of encoders used during frame.
bgfx_encoder_stats_t* encoderStats; /// Array of encoder stats.
}
diff --git a/3rdparty/bgfx/bindings/zig/bgfx.zig b/3rdparty/bgfx/bindings/zig/bgfx.zig
new file mode 100644
index 00000000000..612647d7785
--- /dev/null
+++ b/3rdparty/bgfx/bindings/zig/bgfx.zig
@@ -0,0 +1,3705 @@
+// Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+// License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+
+
+//
+// AUTO GENERATED! DO NOT EDIT!
+//
+
+
+const std = @import("std");
+
+pub const ViewId = u16;
+
+pub const StateFlags = u64;
+/// Enable R write.
+pub const StateFlags_WriteR: StateFlags = 0x0000000000000001;
+
+/// Enable G write.
+pub const StateFlags_WriteG: StateFlags = 0x0000000000000002;
+
+/// Enable B write.
+pub const StateFlags_WriteB: StateFlags = 0x0000000000000004;
+
+/// Enable alpha write.
+pub const StateFlags_WriteA: StateFlags = 0x0000000000000008;
+
+/// Enable depth write.
+pub const StateFlags_WriteZ: StateFlags = 0x0000004000000000;
+
+/// Enable RGB write.
+pub const StateFlags_WriteRgb: StateFlags = 0x0000000000000007;
+
+/// Write all channels mask.
+pub const StateFlags_WriteMask: StateFlags = 0x000000400000000f;
+
+/// Enable depth test, less.
+pub const StateFlags_DepthTestLess: StateFlags = 0x0000000000000010;
+
+/// Enable depth test, less or equal.
+pub const StateFlags_DepthTestLequal: StateFlags = 0x0000000000000020;
+
+/// Enable depth test, equal.
+pub const StateFlags_DepthTestEqual: StateFlags = 0x0000000000000030;
+
+/// Enable depth test, greater or equal.
+pub const StateFlags_DepthTestGequal: StateFlags = 0x0000000000000040;
+
+/// Enable depth test, greater.
+pub const StateFlags_DepthTestGreater: StateFlags = 0x0000000000000050;
+
+/// Enable depth test, not equal.
+pub const StateFlags_DepthTestNotequal: StateFlags = 0x0000000000000060;
+
+/// Enable depth test, never.
+pub const StateFlags_DepthTestNever: StateFlags = 0x0000000000000070;
+
+/// Enable depth test, always.
+pub const StateFlags_DepthTestAlways: StateFlags = 0x0000000000000080;
+pub const StateFlags_DepthTestShift: StateFlags = 4;
+pub const StateFlags_DepthTestMask: StateFlags = 0x00000000000000f0;
+
+/// 0, 0, 0, 0
+pub const StateFlags_BlendZero: StateFlags = 0x0000000000001000;
+
+/// 1, 1, 1, 1
+pub const StateFlags_BlendOne: StateFlags = 0x0000000000002000;
+
+/// Rs, Gs, Bs, As
+pub const StateFlags_BlendSrcColor: StateFlags = 0x0000000000003000;
+
+/// 1-Rs, 1-Gs, 1-Bs, 1-As
+pub const StateFlags_BlendInvSrcColor: StateFlags = 0x0000000000004000;
+
+/// As, As, As, As
+pub const StateFlags_BlendSrcAlpha: StateFlags = 0x0000000000005000;
+
+/// 1-As, 1-As, 1-As, 1-As
+pub const StateFlags_BlendInvSrcAlpha: StateFlags = 0x0000000000006000;
+
+/// Ad, Ad, Ad, Ad
+pub const StateFlags_BlendDstAlpha: StateFlags = 0x0000000000007000;
+
+/// 1-Ad, 1-Ad, 1-Ad ,1-Ad
+pub const StateFlags_BlendInvDstAlpha: StateFlags = 0x0000000000008000;
+
+/// Rd, Gd, Bd, Ad
+pub const StateFlags_BlendDstColor: StateFlags = 0x0000000000009000;
+
+/// 1-Rd, 1-Gd, 1-Bd, 1-Ad
+pub const StateFlags_BlendInvDstColor: StateFlags = 0x000000000000a000;
+
+/// f, f, f, 1; f = min(As, 1-Ad)
+pub const StateFlags_BlendSrcAlphaSat: StateFlags = 0x000000000000b000;
+
+/// Blend factor
+pub const StateFlags_BlendFactor: StateFlags = 0x000000000000c000;
+
+/// 1-Blend factor
+pub const StateFlags_BlendInvFactor: StateFlags = 0x000000000000d000;
+pub const StateFlags_BlendShift: StateFlags = 12;
+pub const StateFlags_BlendMask: StateFlags = 0x000000000ffff000;
+
+/// Blend add: src + dst.
+pub const StateFlags_BlendEquationAdd: StateFlags = 0x0000000000000000;
+
+/// Blend subtract: src - dst.
+pub const StateFlags_BlendEquationSub: StateFlags = 0x0000000010000000;
+
+/// Blend reverse subtract: dst - src.
+pub const StateFlags_BlendEquationRevsub: StateFlags = 0x0000000020000000;
+
+/// Blend min: min(src, dst).
+pub const StateFlags_BlendEquationMin: StateFlags = 0x0000000030000000;
+
+/// Blend max: max(src, dst).
+pub const StateFlags_BlendEquationMax: StateFlags = 0x0000000040000000;
+pub const StateFlags_BlendEquationShift: StateFlags = 28;
+pub const StateFlags_BlendEquationMask: StateFlags = 0x00000003f0000000;
+
+/// Cull clockwise triangles.
+pub const StateFlags_CullCw: StateFlags = 0x0000001000000000;
+
+/// Cull counter-clockwise triangles.
+pub const StateFlags_CullCcw: StateFlags = 0x0000002000000000;
+pub const StateFlags_CullShift: StateFlags = 36;
+pub const StateFlags_CullMask: StateFlags = 0x0000003000000000;
+pub const StateFlags_AlphaRefShift: StateFlags = 40;
+pub const StateFlags_AlphaRefMask: StateFlags = 0x0000ff0000000000;
+
+/// Tristrip.
+pub const StateFlags_PtTristrip: StateFlags = 0x0001000000000000;
+
+/// Lines.
+pub const StateFlags_PtLines: StateFlags = 0x0002000000000000;
+
+/// Line strip.
+pub const StateFlags_PtLinestrip: StateFlags = 0x0003000000000000;
+
+/// Points.
+pub const StateFlags_PtPoints: StateFlags = 0x0004000000000000;
+pub const StateFlags_PtShift: StateFlags = 48;
+pub const StateFlags_PtMask: StateFlags = 0x0007000000000000;
+pub const StateFlags_PointSizeShift: StateFlags = 52;
+pub const StateFlags_PointSizeMask: StateFlags = 0x00f0000000000000;
+
+/// Enable MSAA rasterization.
+pub const StateFlags_Msaa: StateFlags = 0x0100000000000000;
+
+/// Enable line AA rasterization.
+pub const StateFlags_Lineaa: StateFlags = 0x0200000000000000;
+
+/// Enable conservative rasterization.
+pub const StateFlags_ConservativeRaster: StateFlags = 0x0400000000000000;
+
+/// No state.
+pub const StateFlags_None: StateFlags = 0x0000000000000000;
+
+/// Front counter-clockwise (default is clockwise).
+pub const StateFlags_FrontCcw: StateFlags = 0x0000008000000000;
+
+/// Enable blend independent.
+pub const StateFlags_BlendIndependent: StateFlags = 0x0000000400000000;
+
+/// Enable alpha to coverage.
+pub const StateFlags_BlendAlphaToCoverage: StateFlags = 0x0000000800000000;
+
+/// Default state is write to RGB, alpha, and depth with depth test less enabled, with clockwise
+/// culling and MSAA (when writing into MSAA frame buffer, otherwise this flag is ignored).
+pub const StateFlags_Default: StateFlags = 0x010000500000001f;
+pub const StateFlags_Mask: StateFlags = 0xffffffffffffffff;
+pub const StateFlags_ReservedShift: StateFlags = 61;
+pub const StateFlags_ReservedMask: StateFlags = 0xe000000000000000;
+
+pub const StencilFlags = u32;
+pub const StencilFlags_FuncRefShift: StencilFlags = 0;
+pub const StencilFlags_FuncRefMask: StencilFlags = 0x000000ff;
+pub const StencilFlags_FuncRmaskShift: StencilFlags = 8;
+pub const StencilFlags_FuncRmaskMask: StencilFlags = 0x0000ff00;
+pub const StencilFlags_None: StencilFlags = 0x00000000;
+pub const StencilFlags_Mask: StencilFlags = 0xffffffff;
+pub const StencilFlags_Default: StencilFlags = 0x00000000;
+
+/// Enable stencil test, less.
+pub const StencilFlags_TestLess: StencilFlags = 0x00010000;
+
+/// Enable stencil test, less or equal.
+pub const StencilFlags_TestLequal: StencilFlags = 0x00020000;
+
+/// Enable stencil test, equal.
+pub const StencilFlags_TestEqual: StencilFlags = 0x00030000;
+
+/// Enable stencil test, greater or equal.
+pub const StencilFlags_TestGequal: StencilFlags = 0x00040000;
+
+/// Enable stencil test, greater.
+pub const StencilFlags_TestGreater: StencilFlags = 0x00050000;
+
+/// Enable stencil test, not equal.
+pub const StencilFlags_TestNotequal: StencilFlags = 0x00060000;
+
+/// Enable stencil test, never.
+pub const StencilFlags_TestNever: StencilFlags = 0x00070000;
+
+/// Enable stencil test, always.
+pub const StencilFlags_TestAlways: StencilFlags = 0x00080000;
+pub const StencilFlags_TestShift: StencilFlags = 16;
+pub const StencilFlags_TestMask: StencilFlags = 0x000f0000;
+
+/// Zero.
+pub const StencilFlags_OpFailSZero: StencilFlags = 0x00000000;
+
+/// Keep.
+pub const StencilFlags_OpFailSKeep: StencilFlags = 0x00100000;
+
+/// Replace.
+pub const StencilFlags_OpFailSReplace: StencilFlags = 0x00200000;
+
+/// Increment and wrap.
+pub const StencilFlags_OpFailSIncr: StencilFlags = 0x00300000;
+
+/// Increment and clamp.
+pub const StencilFlags_OpFailSIncrsat: StencilFlags = 0x00400000;
+
+/// Decrement and wrap.
+pub const StencilFlags_OpFailSDecr: StencilFlags = 0x00500000;
+
+/// Decrement and clamp.
+pub const StencilFlags_OpFailSDecrsat: StencilFlags = 0x00600000;
+
+/// Invert.
+pub const StencilFlags_OpFailSInvert: StencilFlags = 0x00700000;
+pub const StencilFlags_OpFailSShift: StencilFlags = 20;
+pub const StencilFlags_OpFailSMask: StencilFlags = 0x00f00000;
+
+/// Zero.
+pub const StencilFlags_OpFailZZero: StencilFlags = 0x00000000;
+
+/// Keep.
+pub const StencilFlags_OpFailZKeep: StencilFlags = 0x01000000;
+
+/// Replace.
+pub const StencilFlags_OpFailZReplace: StencilFlags = 0x02000000;
+
+/// Increment and wrap.
+pub const StencilFlags_OpFailZIncr: StencilFlags = 0x03000000;
+
+/// Increment and clamp.
+pub const StencilFlags_OpFailZIncrsat: StencilFlags = 0x04000000;
+
+/// Decrement and wrap.
+pub const StencilFlags_OpFailZDecr: StencilFlags = 0x05000000;
+
+/// Decrement and clamp.
+pub const StencilFlags_OpFailZDecrsat: StencilFlags = 0x06000000;
+
+/// Invert.
+pub const StencilFlags_OpFailZInvert: StencilFlags = 0x07000000;
+pub const StencilFlags_OpFailZShift: StencilFlags = 24;
+pub const StencilFlags_OpFailZMask: StencilFlags = 0x0f000000;
+
+/// Zero.
+pub const StencilFlags_OpPassZZero: StencilFlags = 0x00000000;
+
+/// Keep.
+pub const StencilFlags_OpPassZKeep: StencilFlags = 0x10000000;
+
+/// Replace.
+pub const StencilFlags_OpPassZReplace: StencilFlags = 0x20000000;
+
+/// Increment and wrap.
+pub const StencilFlags_OpPassZIncr: StencilFlags = 0x30000000;
+
+/// Increment and clamp.
+pub const StencilFlags_OpPassZIncrsat: StencilFlags = 0x40000000;
+
+/// Decrement and wrap.
+pub const StencilFlags_OpPassZDecr: StencilFlags = 0x50000000;
+
+/// Decrement and clamp.
+pub const StencilFlags_OpPassZDecrsat: StencilFlags = 0x60000000;
+
+/// Invert.
+pub const StencilFlags_OpPassZInvert: StencilFlags = 0x70000000;
+pub const StencilFlags_OpPassZShift: StencilFlags = 28;
+pub const StencilFlags_OpPassZMask: StencilFlags = 0xf0000000;
+
+pub const ClearFlags = u16;
+/// No clear flags.
+pub const ClearFlags_None: ClearFlags = 0x0000;
+
+/// Clear color.
+pub const ClearFlags_Color: ClearFlags = 0x0001;
+
+/// Clear depth.
+pub const ClearFlags_Depth: ClearFlags = 0x0002;
+
+/// Clear stencil.
+pub const ClearFlags_Stencil: ClearFlags = 0x0004;
+
+/// Discard frame buffer attachment 0.
+pub const ClearFlags_DiscardColor0: ClearFlags = 0x0008;
+
+/// Discard frame buffer attachment 1.
+pub const ClearFlags_DiscardColor1: ClearFlags = 0x0010;
+
+/// Discard frame buffer attachment 2.
+pub const ClearFlags_DiscardColor2: ClearFlags = 0x0020;
+
+/// Discard frame buffer attachment 3.
+pub const ClearFlags_DiscardColor3: ClearFlags = 0x0040;
+
+/// Discard frame buffer attachment 4.
+pub const ClearFlags_DiscardColor4: ClearFlags = 0x0080;
+
+/// Discard frame buffer attachment 5.
+pub const ClearFlags_DiscardColor5: ClearFlags = 0x0100;
+
+/// Discard frame buffer attachment 6.
+pub const ClearFlags_DiscardColor6: ClearFlags = 0x0200;
+
+/// Discard frame buffer attachment 7.
+pub const ClearFlags_DiscardColor7: ClearFlags = 0x0400;
+
+/// Discard frame buffer depth attachment.
+pub const ClearFlags_DiscardDepth: ClearFlags = 0x0800;
+
+/// Discard frame buffer stencil attachment.
+pub const ClearFlags_DiscardStencil: ClearFlags = 0x1000;
+pub const ClearFlags_DiscardColorMask: ClearFlags = 0x07f8;
+pub const ClearFlags_DiscardMask: ClearFlags = 0x1ff8;
+
+pub const DiscardFlags = u32;
+/// Preserve everything.
+pub const DiscardFlags_None: DiscardFlags = 0x00000000;
+
+/// Discard texture sampler and buffer bindings.
+pub const DiscardFlags_Bindings: DiscardFlags = 0x00000001;
+
+/// Discard index buffer.
+pub const DiscardFlags_IndexBuffer: DiscardFlags = 0x00000002;
+
+/// Discard instance data.
+pub const DiscardFlags_InstanceData: DiscardFlags = 0x00000004;
+
+/// Discard state and uniform bindings.
+pub const DiscardFlags_State: DiscardFlags = 0x00000008;
+
+/// Discard transform.
+pub const DiscardFlags_Transform: DiscardFlags = 0x00000010;
+
+/// Discard vertex streams.
+pub const DiscardFlags_VertexStreams: DiscardFlags = 0x00000020;
+
+/// Discard all states.
+pub const DiscardFlags_All: DiscardFlags = 0x000000ff;
+
+pub const DebugFlags = u32;
+/// No debug.
+pub const DebugFlags_None: DebugFlags = 0x00000000;
+
+/// Enable wireframe for all primitives.
+pub const DebugFlags_Wireframe: DebugFlags = 0x00000001;
+
+/// Enable infinitely fast hardware test. No draw calls will be submitted to driver.
+/// It's useful when profiling to quickly assess bottleneck between CPU and GPU.
+pub const DebugFlags_Ifh: DebugFlags = 0x00000002;
+
+/// Enable statistics display.
+pub const DebugFlags_Stats: DebugFlags = 0x00000004;
+
+/// Enable debug text display.
+pub const DebugFlags_Text: DebugFlags = 0x00000008;
+
+/// Enable profiler. This causes per-view statistics to be collected, available through `bgfx::Stats::ViewStats`. This is unrelated to the profiler functions in `bgfx::CallbackI`.
+pub const DebugFlags_Profiler: DebugFlags = 0x00000010;
+
+pub const BufferFlags = u16;
+/// 1 8-bit value
+pub const BufferFlags_ComputeFormat8x1: BufferFlags = 0x0001;
+
+/// 2 8-bit values
+pub const BufferFlags_ComputeFormat8x2: BufferFlags = 0x0002;
+
+/// 4 8-bit values
+pub const BufferFlags_ComputeFormat8x4: BufferFlags = 0x0003;
+
+/// 1 16-bit value
+pub const BufferFlags_ComputeFormat16x1: BufferFlags = 0x0004;
+
+/// 2 16-bit values
+pub const BufferFlags_ComputeFormat16x2: BufferFlags = 0x0005;
+
+/// 4 16-bit values
+pub const BufferFlags_ComputeFormat16x4: BufferFlags = 0x0006;
+
+/// 1 32-bit value
+pub const BufferFlags_ComputeFormat32x1: BufferFlags = 0x0007;
+
+/// 2 32-bit values
+pub const BufferFlags_ComputeFormat32x2: BufferFlags = 0x0008;
+
+/// 4 32-bit values
+pub const BufferFlags_ComputeFormat32x4: BufferFlags = 0x0009;
+pub const BufferFlags_ComputeFormatShift: BufferFlags = 0;
+pub const BufferFlags_ComputeFormatMask: BufferFlags = 0x000f;
+
+/// Type `int`.
+pub const BufferFlags_ComputeTypeInt: BufferFlags = 0x0010;
+
+/// Type `uint`.
+pub const BufferFlags_ComputeTypeUint: BufferFlags = 0x0020;
+
+/// Type `float`.
+pub const BufferFlags_ComputeTypeFloat: BufferFlags = 0x0030;
+pub const BufferFlags_ComputeTypeShift: BufferFlags = 4;
+pub const BufferFlags_ComputeTypeMask: BufferFlags = 0x0030;
+pub const BufferFlags_None: BufferFlags = 0x0000;
+
+/// Buffer will be read by shader.
+pub const BufferFlags_ComputeRead: BufferFlags = 0x0100;
+
+/// Buffer will be used for writing.
+pub const BufferFlags_ComputeWrite: BufferFlags = 0x0200;
+
+/// Buffer will be used for storing draw indirect commands.
+pub const BufferFlags_DrawIndirect: BufferFlags = 0x0400;
+
+/// Allow dynamic index/vertex buffer resize during update.
+pub const BufferFlags_AllowResize: BufferFlags = 0x0800;
+
+/// Index buffer contains 32-bit indices.
+pub const BufferFlags_Index32: BufferFlags = 0x1000;
+pub const BufferFlags_ComputeReadWrite: BufferFlags = 0x0300;
+
+pub const TextureFlags = u64;
+pub const TextureFlags_None: TextureFlags = 0x0000000000000000;
+
+/// Texture will be used for MSAA sampling.
+pub const TextureFlags_MsaaSample: TextureFlags = 0x0000000800000000;
+
+/// Render target no MSAA.
+pub const TextureFlags_Rt: TextureFlags = 0x0000001000000000;
+
+/// Texture will be used for compute write.
+pub const TextureFlags_ComputeWrite: TextureFlags = 0x0000100000000000;
+
+/// Sample texture as sRGB.
+pub const TextureFlags_Srgb: TextureFlags = 0x0000200000000000;
+
+/// Texture will be used as blit destination.
+pub const TextureFlags_BlitDst: TextureFlags = 0x0000400000000000;
+
+/// Texture will be used for read back from GPU.
+pub const TextureFlags_ReadBack: TextureFlags = 0x0000800000000000;
+
+/// Render target MSAAx2 mode.
+pub const TextureFlags_RtMsaaX2: TextureFlags = 0x0000002000000000;
+
+/// Render target MSAAx4 mode.
+pub const TextureFlags_RtMsaaX4: TextureFlags = 0x0000003000000000;
+
+/// Render target MSAAx8 mode.
+pub const TextureFlags_RtMsaaX8: TextureFlags = 0x0000004000000000;
+
+/// Render target MSAAx16 mode.
+pub const TextureFlags_RtMsaaX16: TextureFlags = 0x0000005000000000;
+pub const TextureFlags_RtMsaaShift: TextureFlags = 36;
+pub const TextureFlags_RtMsaaMask: TextureFlags = 0x0000007000000000;
+
+/// Render target will be used for writing
+pub const TextureFlags_RtWriteOnly: TextureFlags = 0x0000008000000000;
+pub const TextureFlags_RtShift: TextureFlags = 36;
+pub const TextureFlags_RtMask: TextureFlags = 0x000000f000000000;
+
+pub const SamplerFlags = u32;
+/// Wrap U mode: Mirror
+pub const SamplerFlags_UMirror: SamplerFlags = 0x00000001;
+
+/// Wrap U mode: Clamp
+pub const SamplerFlags_UClamp: SamplerFlags = 0x00000002;
+
+/// Wrap U mode: Border
+pub const SamplerFlags_UBorder: SamplerFlags = 0x00000003;
+pub const SamplerFlags_UShift: SamplerFlags = 0;
+pub const SamplerFlags_UMask: SamplerFlags = 0x00000003;
+
+/// Wrap V mode: Mirror
+pub const SamplerFlags_VMirror: SamplerFlags = 0x00000004;
+
+/// Wrap V mode: Clamp
+pub const SamplerFlags_VClamp: SamplerFlags = 0x00000008;
+
+/// Wrap V mode: Border
+pub const SamplerFlags_VBorder: SamplerFlags = 0x0000000c;
+pub const SamplerFlags_VShift: SamplerFlags = 2;
+pub const SamplerFlags_VMask: SamplerFlags = 0x0000000c;
+
+/// Wrap W mode: Mirror
+pub const SamplerFlags_WMirror: SamplerFlags = 0x00000010;
+
+/// Wrap W mode: Clamp
+pub const SamplerFlags_WClamp: SamplerFlags = 0x00000020;
+
+/// Wrap W mode: Border
+pub const SamplerFlags_WBorder: SamplerFlags = 0x00000030;
+pub const SamplerFlags_WShift: SamplerFlags = 4;
+pub const SamplerFlags_WMask: SamplerFlags = 0x00000030;
+
+/// Min sampling mode: Point
+pub const SamplerFlags_MinPoint: SamplerFlags = 0x00000040;
+
+/// Min sampling mode: Anisotropic
+pub const SamplerFlags_MinAnisotropic: SamplerFlags = 0x00000080;
+pub const SamplerFlags_MinShift: SamplerFlags = 6;
+pub const SamplerFlags_MinMask: SamplerFlags = 0x000000c0;
+
+/// Mag sampling mode: Point
+pub const SamplerFlags_MagPoint: SamplerFlags = 0x00000100;
+
+/// Mag sampling mode: Anisotropic
+pub const SamplerFlags_MagAnisotropic: SamplerFlags = 0x00000200;
+pub const SamplerFlags_MagShift: SamplerFlags = 8;
+pub const SamplerFlags_MagMask: SamplerFlags = 0x00000300;
+
+/// Mip sampling mode: Point
+pub const SamplerFlags_MipPoint: SamplerFlags = 0x00000400;
+pub const SamplerFlags_MipShift: SamplerFlags = 10;
+pub const SamplerFlags_MipMask: SamplerFlags = 0x00000400;
+
+/// Compare when sampling depth texture: less.
+pub const SamplerFlags_CompareLess: SamplerFlags = 0x00010000;
+
+/// Compare when sampling depth texture: less or equal.
+pub const SamplerFlags_CompareLequal: SamplerFlags = 0x00020000;
+
+/// Compare when sampling depth texture: equal.
+pub const SamplerFlags_CompareEqual: SamplerFlags = 0x00030000;
+
+/// Compare when sampling depth texture: greater or equal.
+pub const SamplerFlags_CompareGequal: SamplerFlags = 0x00040000;
+
+/// Compare when sampling depth texture: greater.
+pub const SamplerFlags_CompareGreater: SamplerFlags = 0x00050000;
+
+/// Compare when sampling depth texture: not equal.
+pub const SamplerFlags_CompareNotequal: SamplerFlags = 0x00060000;
+
+/// Compare when sampling depth texture: never.
+pub const SamplerFlags_CompareNever: SamplerFlags = 0x00070000;
+
+/// Compare when sampling depth texture: always.
+pub const SamplerFlags_CompareAlways: SamplerFlags = 0x00080000;
+pub const SamplerFlags_CompareShift: SamplerFlags = 16;
+pub const SamplerFlags_CompareMask: SamplerFlags = 0x000f0000;
+pub const SamplerFlags_BorderColorShift: SamplerFlags = 24;
+pub const SamplerFlags_BorderColorMask: SamplerFlags = 0x0f000000;
+pub const SamplerFlags_ReservedShift: SamplerFlags = 28;
+pub const SamplerFlags_ReservedMask: SamplerFlags = 0xf0000000;
+pub const SamplerFlags_None: SamplerFlags = 0x00000000;
+
+/// Sample stencil instead of depth.
+pub const SamplerFlags_SampleStencil: SamplerFlags = 0x00100000;
+pub const SamplerFlags_Point: SamplerFlags = 0x00000540;
+pub const SamplerFlags_UvwMirror: SamplerFlags = 0x00000015;
+pub const SamplerFlags_UvwClamp: SamplerFlags = 0x0000002a;
+pub const SamplerFlags_UvwBorder: SamplerFlags = 0x0000003f;
+pub const SamplerFlags_BitsMask: SamplerFlags = 0x000f07ff;
+
+pub const ResetFlags = u32;
+/// Enable 2x MSAA.
+pub const ResetFlags_MsaaX2: ResetFlags = 0x00000010;
+
+/// Enable 4x MSAA.
+pub const ResetFlags_MsaaX4: ResetFlags = 0x00000020;
+
+/// Enable 8x MSAA.
+pub const ResetFlags_MsaaX8: ResetFlags = 0x00000030;
+
+/// Enable 16x MSAA.
+pub const ResetFlags_MsaaX16: ResetFlags = 0x00000040;
+pub const ResetFlags_MsaaShift: ResetFlags = 4;
+pub const ResetFlags_MsaaMask: ResetFlags = 0x00000070;
+
+/// No reset flags.
+pub const ResetFlags_None: ResetFlags = 0x00000000;
+
+/// Not supported yet.
+pub const ResetFlags_Fullscreen: ResetFlags = 0x00000001;
+
+/// Enable V-Sync.
+pub const ResetFlags_Vsync: ResetFlags = 0x00000080;
+
+/// Turn on/off max anisotropy.
+pub const ResetFlags_Maxanisotropy: ResetFlags = 0x00000100;
+
+/// Begin screen capture.
+pub const ResetFlags_Capture: ResetFlags = 0x00000200;
+
+/// Flush rendering after submitting to GPU.
+pub const ResetFlags_FlushAfterRender: ResetFlags = 0x00002000;
+
+/// This flag specifies where flip occurs. Default behaviour is that flip occurs
+/// before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
+pub const ResetFlags_FlipAfterRender: ResetFlags = 0x00004000;
+
+/// Enable sRGB backbuffer.
+pub const ResetFlags_SrgbBackbuffer: ResetFlags = 0x00008000;
+
+/// Enable HDR10 rendering.
+pub const ResetFlags_Hdr10: ResetFlags = 0x00010000;
+
+/// Enable HiDPI rendering.
+pub const ResetFlags_Hidpi: ResetFlags = 0x00020000;
+
+/// Enable depth clamp.
+pub const ResetFlags_DepthClamp: ResetFlags = 0x00040000;
+
+/// Suspend rendering.
+pub const ResetFlags_Suspend: ResetFlags = 0x00080000;
+
+/// Transparent backbuffer. Availability depends on: `BGFX_CAPS_TRANSPARENT_BACKBUFFER`.
+pub const ResetFlags_TransparentBackbuffer: ResetFlags = 0x00100000;
+pub const ResetFlags_FullscreenShift: ResetFlags = 0;
+pub const ResetFlags_FullscreenMask: ResetFlags = 0x00000001;
+pub const ResetFlags_ReservedShift: ResetFlags = 31;
+pub const ResetFlags_ReservedMask: ResetFlags = 0x80000000;
+
+pub const CapsFlags = u64;
+/// Alpha to coverage is supported.
+pub const CapsFlags_AlphaToCoverage: CapsFlags = 0x0000000000000001;
+
+/// Blend independent is supported.
+pub const CapsFlags_BlendIndependent: CapsFlags = 0x0000000000000002;
+
+/// Compute shaders are supported.
+pub const CapsFlags_Compute: CapsFlags = 0x0000000000000004;
+
+/// Conservative rasterization is supported.
+pub const CapsFlags_ConservativeRaster: CapsFlags = 0x0000000000000008;
+
+/// Draw indirect is supported.
+pub const CapsFlags_DrawIndirect: CapsFlags = 0x0000000000000010;
+
+/// Fragment depth is available in fragment shader.
+pub const CapsFlags_FragmentDepth: CapsFlags = 0x0000000000000020;
+
+/// Fragment ordering is available in fragment shader.
+pub const CapsFlags_FragmentOrdering: CapsFlags = 0x0000000000000040;
+
+/// Graphics debugger is present.
+pub const CapsFlags_GraphicsDebugger: CapsFlags = 0x0000000000000080;
+
+/// HDR10 rendering is supported.
+pub const CapsFlags_Hdr10: CapsFlags = 0x0000000000000100;
+
+/// HiDPI rendering is supported.
+pub const CapsFlags_Hidpi: CapsFlags = 0x0000000000000200;
+
+/// Image Read/Write is supported.
+pub const CapsFlags_ImageRw: CapsFlags = 0x0000000000000400;
+
+/// 32-bit indices are supported.
+pub const CapsFlags_Index32: CapsFlags = 0x0000000000000800;
+
+/// Instancing is supported.
+pub const CapsFlags_Instancing: CapsFlags = 0x0000000000001000;
+
+/// Occlusion query is supported.
+pub const CapsFlags_OcclusionQuery: CapsFlags = 0x0000000000002000;
+
+/// Renderer is on separate thread.
+pub const CapsFlags_RendererMultithreaded: CapsFlags = 0x0000000000004000;
+
+/// Multiple windows are supported.
+pub const CapsFlags_SwapChain: CapsFlags = 0x0000000000008000;
+
+/// 2D texture array is supported.
+pub const CapsFlags_Texture2DArray: CapsFlags = 0x0000000000010000;
+
+/// 3D textures are supported.
+pub const CapsFlags_Texture3D: CapsFlags = 0x0000000000020000;
+
+/// Texture blit is supported.
+pub const CapsFlags_TextureBlit: CapsFlags = 0x0000000000040000;
+
+/// Transparent back buffer supported.
+pub const CapsFlags_TransparentBackbuffer: CapsFlags = 0x0000000000080000;
+pub const CapsFlags_TextureCompareReserved: CapsFlags = 0x0000000000100000;
+
+/// Texture compare less equal mode is supported.
+pub const CapsFlags_TextureCompareLequal: CapsFlags = 0x0000000000200000;
+
+/// Cubemap texture array is supported.
+pub const CapsFlags_TextureCubeArray: CapsFlags = 0x0000000000400000;
+
+/// CPU direct access to GPU texture memory.
+pub const CapsFlags_TextureDirectAccess: CapsFlags = 0x0000000000800000;
+
+/// Read-back texture is supported.
+pub const CapsFlags_TextureReadBack: CapsFlags = 0x0000000001000000;
+
+/// Vertex attribute half-float is supported.
+pub const CapsFlags_VertexAttribHalf: CapsFlags = 0x0000000002000000;
+
+/// Vertex attribute 10_10_10_2 is supported.
+pub const CapsFlags_VertexAttribUint10: CapsFlags = 0x0000000004000000;
+
+/// Rendering with VertexID only is supported.
+pub const CapsFlags_VertexId: CapsFlags = 0x0000000008000000;
+
+/// Viewport layer is available in vertex shader.
+pub const CapsFlags_ViewportLayerArray: CapsFlags = 0x0000000010000000;
+
+/// Draw indirect with indirect count is supported.
+pub const CapsFlags_DrawIndirectCount: CapsFlags = 0x0000000020000000;
+
+/// All texture compare modes are supported.
+pub const CapsFlags_TextureCompareAll: CapsFlags = 0x0000000000300000;
+
+pub const CapsFormatFlags = u32;
+/// Texture format is not supported.
+pub const CapsFormatFlags_TextureNone: CapsFormatFlags = 0x00000000;
+
+/// Texture format is supported.
+pub const CapsFormatFlags_Texture2D: CapsFormatFlags = 0x00000001;
+
+/// Texture as sRGB format is supported.
+pub const CapsFormatFlags_Texture2DSrgb: CapsFormatFlags = 0x00000002;
+
+/// Texture format is emulated.
+pub const CapsFormatFlags_Texture2DEmulated: CapsFormatFlags = 0x00000004;
+
+/// Texture format is supported.
+pub const CapsFormatFlags_Texture3D: CapsFormatFlags = 0x00000008;
+
+/// Texture as sRGB format is supported.
+pub const CapsFormatFlags_Texture3DSrgb: CapsFormatFlags = 0x00000010;
+
+/// Texture format is emulated.
+pub const CapsFormatFlags_Texture3DEmulated: CapsFormatFlags = 0x00000020;
+
+/// Texture format is supported.
+pub const CapsFormatFlags_TextureCube: CapsFormatFlags = 0x00000040;
+
+/// Texture as sRGB format is supported.
+pub const CapsFormatFlags_TextureCubeSrgb: CapsFormatFlags = 0x00000080;
+
+/// Texture format is emulated.
+pub const CapsFormatFlags_TextureCubeEmulated: CapsFormatFlags = 0x00000100;
+
+/// Texture format can be used from vertex shader.
+pub const CapsFormatFlags_TextureVertex: CapsFormatFlags = 0x00000200;
+
+/// Texture format can be used as image and read from.
+pub const CapsFormatFlags_TextureImageRead: CapsFormatFlags = 0x00000400;
+
+/// Texture format can be used as image and written to.
+pub const CapsFormatFlags_TextureImageWrite: CapsFormatFlags = 0x00000800;
+
+/// Texture format can be used as frame buffer.
+pub const CapsFormatFlags_TextureFramebuffer: CapsFormatFlags = 0x00001000;
+
+/// Texture format can be used as MSAA frame buffer.
+pub const CapsFormatFlags_TextureFramebufferMsaa: CapsFormatFlags = 0x00002000;
+
+/// Texture can be sampled as MSAA.
+pub const CapsFormatFlags_TextureMsaa: CapsFormatFlags = 0x00004000;
+
+/// Texture format supports auto-generated mips.
+pub const CapsFormatFlags_TextureMipAutogen: CapsFormatFlags = 0x00008000;
+
+pub const ResolveFlags = u32;
+/// No resolve flags.
+pub const ResolveFlags_None: ResolveFlags = 0x00000000;
+
+/// Auto-generate mip maps on resolve.
+pub const ResolveFlags_AutoGenMips: ResolveFlags = 0x00000001;
+
+pub const PciIdFlags = u16;
+/// Autoselect adapter.
+pub const PciIdFlags_None: PciIdFlags = 0x0000;
+
+/// Software rasterizer.
+pub const PciIdFlags_SoftwareRasterizer: PciIdFlags = 0x0001;
+
+/// AMD adapter.
+pub const PciIdFlags_Amd: PciIdFlags = 0x1002;
+
+/// Apple adapter.
+pub const PciIdFlags_Apple: PciIdFlags = 0x106b;
+
+/// Intel adapter.
+pub const PciIdFlags_Intel: PciIdFlags = 0x8086;
+
+/// nVidia adapter.
+pub const PciIdFlags_Nvidia: PciIdFlags = 0x10de;
+
+/// Microsoft adapter.
+pub const PciIdFlags_Microsoft: PciIdFlags = 0x1414;
+
+/// ARM adapter.
+pub const PciIdFlags_Arm: PciIdFlags = 0x13b5;
+
+pub const CubeMapFlags = u32;
+/// Cubemap +x.
+pub const CubeMapFlags_PositiveX: CubeMapFlags = 0x00000000;
+
+/// Cubemap -x.
+pub const CubeMapFlags_NegativeX: CubeMapFlags = 0x00000001;
+
+/// Cubemap +y.
+pub const CubeMapFlags_PositiveY: CubeMapFlags = 0x00000002;
+
+/// Cubemap -y.
+pub const CubeMapFlags_NegativeY: CubeMapFlags = 0x00000003;
+
+/// Cubemap +z.
+pub const CubeMapFlags_PositiveZ: CubeMapFlags = 0x00000004;
+
+/// Cubemap -z.
+pub const CubeMapFlags_NegativeZ: CubeMapFlags = 0x00000005;
+
+pub const Fatal = enum(c_int) {
+ DebugCheck,
+ InvalidShader,
+ UnableToInitialize,
+ UnableToCreateTexture,
+ DeviceLost,
+
+ Count
+};
+
+pub const RendererType = enum(c_int) {
+ /// No rendering.
+ Noop,
+
+ /// AGC
+ Agc,
+
+ /// Direct3D 9.0
+ Direct3D9,
+
+ /// Direct3D 11.0
+ Direct3D11,
+
+ /// Direct3D 12.0
+ Direct3D12,
+
+ /// GNM
+ Gnm,
+
+ /// Metal
+ Metal,
+
+ /// NVN
+ Nvn,
+
+ /// OpenGL ES 2.0+
+ OpenGLES,
+
+ /// OpenGL 2.1+
+ OpenGL,
+
+ /// Vulkan
+ Vulkan,
+
+ /// WebGPU
+ WebGPU,
+
+ Count
+};
+
+pub const Access = enum(c_int) {
+ /// Read.
+ Read,
+
+ /// Write.
+ Write,
+
+ /// Read and write.
+ ReadWrite,
+
+ Count
+};
+
+pub const Attrib = enum(c_int) {
+ /// a_position
+ Position,
+
+ /// a_normal
+ Normal,
+
+ /// a_tangent
+ Tangent,
+
+ /// a_bitangent
+ Bitangent,
+
+ /// a_color0
+ Color0,
+
+ /// a_color1
+ Color1,
+
+ /// a_color2
+ Color2,
+
+ /// a_color3
+ Color3,
+
+ /// a_indices
+ Indices,
+
+ /// a_weight
+ Weight,
+
+ /// a_texcoord0
+ TexCoord0,
+
+ /// a_texcoord1
+ TexCoord1,
+
+ /// a_texcoord2
+ TexCoord2,
+
+ /// a_texcoord3
+ TexCoord3,
+
+ /// a_texcoord4
+ TexCoord4,
+
+ /// a_texcoord5
+ TexCoord5,
+
+ /// a_texcoord6
+ TexCoord6,
+
+ /// a_texcoord7
+ TexCoord7,
+
+ Count
+};
+
+pub const AttribType = enum(c_int) {
+ /// Uint8
+ Uint8,
+
+ /// Uint10, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_UINT10`.
+ Uint10,
+
+ /// Int16
+ Int16,
+
+ /// Half, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_HALF`.
+ Half,
+
+ /// Float
+ Float,
+
+ Count
+};
+
+pub const TextureFormat = enum(c_int) {
+ /// DXT1 R5G6B5A1
+ BC1,
+
+ /// DXT3 R5G6B5A4
+ BC2,
+
+ /// DXT5 R5G6B5A8
+ BC3,
+
+ /// LATC1/ATI1 R8
+ BC4,
+
+ /// LATC2/ATI2 RG8
+ BC5,
+
+ /// BC6H RGB16F
+ BC6H,
+
+ /// BC7 RGB 4-7 bits per color channel, 0-8 bits alpha
+ BC7,
+
+ /// ETC1 RGB8
+ ETC1,
+
+ /// ETC2 RGB8
+ ETC2,
+
+ /// ETC2 RGBA8
+ ETC2A,
+
+ /// ETC2 RGB8A1
+ ETC2A1,
+
+ /// PVRTC1 RGB 2BPP
+ PTC12,
+
+ /// PVRTC1 RGB 4BPP
+ PTC14,
+
+ /// PVRTC1 RGBA 2BPP
+ PTC12A,
+
+ /// PVRTC1 RGBA 4BPP
+ PTC14A,
+
+ /// PVRTC2 RGBA 2BPP
+ PTC22,
+
+ /// PVRTC2 RGBA 4BPP
+ PTC24,
+
+ /// ATC RGB 4BPP
+ ATC,
+
+ /// ATCE RGBA 8 BPP explicit alpha
+ ATCE,
+
+ /// ATCI RGBA 8 BPP interpolated alpha
+ ATCI,
+
+ /// ASTC 4x4 8.0 BPP
+ ASTC4x4,
+
+ /// ASTC 5x4 6.40 BPP
+ ASTC5x4,
+
+ /// ASTC 5x5 5.12 BPP
+ ASTC5x5,
+
+ /// ASTC 6x5 4.27 BPP
+ ASTC6x5,
+
+ /// ASTC 6x6 3.56 BPP
+ ASTC6x6,
+
+ /// ASTC 8x5 3.20 BPP
+ ASTC8x5,
+
+ /// ASTC 8x6 2.67 BPP
+ ASTC8x6,
+
+ /// ASTC 8x8 2.00 BPP
+ ASTC8x8,
+
+ /// ASTC 10x5 2.56 BPP
+ ASTC10x5,
+
+ /// ASTC 10x6 2.13 BPP
+ ASTC10x6,
+
+ /// ASTC 10x8 1.60 BPP
+ ASTC10x8,
+
+ /// ASTC 10x10 1.28 BPP
+ ASTC10x10,
+
+ /// ASTC 12x10 1.07 BPP
+ ASTC12x10,
+
+ /// ASTC 12x12 0.89 BPP
+ ASTC12x12,
+
+ /// Compressed formats above.
+ Unknown,
+ R1,
+ A8,
+ R8,
+ R8I,
+ R8U,
+ R8S,
+ R16,
+ R16I,
+ R16U,
+ R16F,
+ R16S,
+ R32I,
+ R32U,
+ R32F,
+ RG8,
+ RG8I,
+ RG8U,
+ RG8S,
+ RG16,
+ RG16I,
+ RG16U,
+ RG16F,
+ RG16S,
+ RG32I,
+ RG32U,
+ RG32F,
+ RGB8,
+ RGB8I,
+ RGB8U,
+ RGB8S,
+ RGB9E5F,
+ BGRA8,
+ RGBA8,
+ RGBA8I,
+ RGBA8U,
+ RGBA8S,
+ RGBA16,
+ RGBA16I,
+ RGBA16U,
+ RGBA16F,
+ RGBA16S,
+ RGBA32I,
+ RGBA32U,
+ RGBA32F,
+ B5G6R5,
+ R5G6B5,
+ BGRA4,
+ RGBA4,
+ BGR5A1,
+ RGB5A1,
+ RGB10A2,
+ RG11B10F,
+
+ /// Depth formats below.
+ UnknownDepth,
+ D16,
+ D24,
+ D24S8,
+ D32,
+ D16F,
+ D24F,
+ D32F,
+ D0S8,
+
+ Count
+};
+
+pub const UniformType = enum(c_int) {
+ /// Sampler.
+ Sampler,
+
+ /// Reserved, do not use.
+ End,
+
+ /// 4 floats vector.
+ Vec4,
+
+ /// 3x3 matrix.
+ Mat3,
+
+ /// 4x4 matrix.
+ Mat4,
+
+ Count
+};
+
+pub const BackbufferRatio = enum(c_int) {
+ /// Equal to backbuffer.
+ Equal,
+
+ /// One half size of backbuffer.
+ Half,
+
+ /// One quarter size of backbuffer.
+ Quarter,
+
+ /// One eighth size of backbuffer.
+ Eighth,
+
+ /// One sixteenth size of backbuffer.
+ Sixteenth,
+
+ /// Double size of backbuffer.
+ Double,
+
+ Count
+};
+
+pub const OcclusionQueryResult = enum(c_int) {
+ /// Query failed test.
+ Invisible,
+
+ /// Query passed test.
+ Visible,
+
+ /// Query result is not available yet.
+ NoResult,
+
+ Count
+};
+
+pub const Topology = enum(c_int) {
+ /// Triangle list.
+ TriList,
+
+ /// Triangle strip.
+ TriStrip,
+
+ /// Line list.
+ LineList,
+
+ /// Line strip.
+ LineStrip,
+
+ /// Point list.
+ PointList,
+
+ Count
+};
+
+pub const TopologyConvert = enum(c_int) {
+ /// Flip winding order of triangle list.
+ TriListFlipWinding,
+
+ /// Flip winding order of triangle strip.
+ TriStripFlipWinding,
+
+ /// Convert triangle list to line list.
+ TriListToLineList,
+
+ /// Convert triangle strip to triangle list.
+ TriStripToTriList,
+
+ /// Convert line strip to line list.
+ LineStripToLineList,
+
+ Count
+};
+
+pub const TopologySort = enum(c_int) {
+ DirectionFrontToBackMin,
+ DirectionFrontToBackAvg,
+ DirectionFrontToBackMax,
+ DirectionBackToFrontMin,
+ DirectionBackToFrontAvg,
+ DirectionBackToFrontMax,
+ DistanceFrontToBackMin,
+ DistanceFrontToBackAvg,
+ DistanceFrontToBackMax,
+ DistanceBackToFrontMin,
+ DistanceBackToFrontAvg,
+ DistanceBackToFrontMax,
+
+ Count
+};
+
+pub const ViewMode = enum(c_int) {
+ /// Default sort order.
+ Default,
+
+ /// Sort in the same order in which submit calls were called.
+ Sequential,
+
+ /// Sort draw call depth in ascending order.
+ DepthAscending,
+
+ /// Sort draw call depth in descending order.
+ DepthDescending,
+
+ Count
+};
+
+pub const RenderFrame = enum(c_int) {
+ /// Renderer context is not created yet.
+ NoContext,
+
+ /// Renderer context is created and rendering.
+ Render,
+
+ /// Renderer context wait for main thread signal timed out without rendering.
+ Timeout,
+
+ /// Renderer context is getting destroyed.
+ Exiting,
+
+ Count
+};
+
+pub const Caps = extern struct {
+ pub const GPU = extern struct {
+ vendorId: u16,
+ deviceId: u16,
+ };
+
+ pub const Limits = extern struct {
+ maxDrawCalls: u32,
+ maxBlits: u32,
+ maxTextureSize: u32,
+ maxTextureLayers: u32,
+ maxViews: u32,
+ maxFrameBuffers: u32,
+ maxFBAttachments: u32,
+ maxPrograms: u32,
+ maxShaders: u32,
+ maxTextures: u32,
+ maxTextureSamplers: u32,
+ maxComputeBindings: u32,
+ maxVertexLayouts: u32,
+ maxVertexStreams: u32,
+ maxIndexBuffers: u32,
+ maxVertexBuffers: u32,
+ maxDynamicIndexBuffers: u32,
+ maxDynamicVertexBuffers: u32,
+ maxUniforms: u32,
+ maxOcclusionQueries: u32,
+ maxEncoders: u32,
+ minResourceCbSize: u32,
+ transientVbSize: u32,
+ transientIbSize: u32,
+ };
+
+ rendererType: RendererType,
+ supported: u64,
+ vendorId: u16,
+ deviceId: u16,
+ homogeneousDepth: bool,
+ originBottomLeft: bool,
+ numGPUs: u8,
+ gpu: [4]GPU,
+ limits: Limits,
+ formats: [96]u16,
+ };
+
+ pub const InternalData = extern struct {
+ caps: [*c]const Caps,
+ context: ?*anyopaque,
+ };
+
+ pub const PlatformData = extern struct {
+ ndt: ?*anyopaque,
+ nwh: ?*anyopaque,
+ context: ?*anyopaque,
+ backBuffer: ?*anyopaque,
+ backBufferDS: ?*anyopaque,
+ };
+
+ pub const Resolution = extern struct {
+ format: TextureFormat,
+ width: u32,
+ height: u32,
+ reset: u32,
+ numBackBuffers: u8,
+ maxFrameLatency: u8,
+ };
+
+pub const Init = extern struct {
+ pub const Limits = extern struct {
+ maxEncoders: u16,
+ minResourceCbSize: u32,
+ transientVbSize: u32,
+ transientIbSize: u32,
+ };
+
+ type: RendererType,
+ vendorId: u16,
+ deviceId: u16,
+ capabilities: u64,
+ debug: bool,
+ profile: bool,
+ platformData: PlatformData,
+ resolution: Resolution,
+ limits: Limits,
+ callback: ?*anyopaque,
+ allocator: ?*anyopaque,
+ };
+
+ pub const Memory = extern struct {
+ data: [*c]u8,
+ size: u32,
+ };
+
+ pub const TransientIndexBuffer = extern struct {
+ data: [*c]u8,
+ size: u32,
+ startIndex: u32,
+ handle: IndexBufferHandle,
+ isIndex16: bool,
+ };
+
+ pub const TransientVertexBuffer = extern struct {
+ data: [*c]u8,
+ size: u32,
+ startVertex: u32,
+ stride: u16,
+ handle: VertexBufferHandle,
+ layoutHandle: VertexLayoutHandle,
+ };
+
+ pub const InstanceDataBuffer = extern struct {
+ data: [*c]u8,
+ size: u32,
+ offset: u32,
+ num: u32,
+ stride: u16,
+ handle: VertexBufferHandle,
+ };
+
+ pub const TextureInfo = extern struct {
+ format: TextureFormat,
+ storageSize: u32,
+ width: u16,
+ height: u16,
+ depth: u16,
+ numLayers: u16,
+ numMips: u8,
+ bitsPerPixel: u8,
+ cubeMap: bool,
+ };
+
+ pub const UniformInfo = extern struct {
+ name: [256]u8,
+ type: UniformType,
+ num: u16,
+ };
+
+ pub const Attachment = extern struct {
+ access: Access,
+ handle: TextureHandle,
+ mip: u16,
+ layer: u16,
+ numLayers: u16,
+ resolve: u8,
+ /// Init attachment.
+ /// <param name="_handle">Render target texture handle.</param>
+ /// <param name="_access">Access. See `Access::Enum`.</param>
+ /// <param name="_layer">Cubemap side or depth layer/slice to use.</param>
+ /// <param name="_numLayers">Number of texture layer/slice(s) in array to use.</param>
+ /// <param name="_mip">Mip level.</param>
+ /// <param name="_resolve">Resolve flags. See: `BGFX_RESOLVE_*`</param>
+ pub inline fn init(self: *Attachment, _handle: TextureHandle, _access: Access, _layer: u16, _numLayers: u16, _mip: u16, _resolve: u8) void {
+ return bgfx_attachment_init(self, _handle, _access, _layer, _numLayers, _mip, _resolve);
+ }
+ };
+
+ pub const Transform = extern struct {
+ data: [*c]f32,
+ num: u16,
+ };
+
+ pub const ViewStats = extern struct {
+ name: [256]u8,
+ view: ViewId,
+ cpuTimeBegin: i64,
+ cpuTimeEnd: i64,
+ gpuTimeBegin: i64,
+ gpuTimeEnd: i64,
+ gpuFrameNum: u32,
+ };
+
+ pub const EncoderStats = extern struct {
+ cpuTimeBegin: i64,
+ cpuTimeEnd: i64,
+ };
+
+ pub const Stats = extern struct {
+ cpuTimeFrame: i64,
+ cpuTimeBegin: i64,
+ cpuTimeEnd: i64,
+ cpuTimerFreq: i64,
+ gpuTimeBegin: i64,
+ gpuTimeEnd: i64,
+ gpuTimerFreq: i64,
+ waitRender: i64,
+ waitSubmit: i64,
+ numDraw: u32,
+ numCompute: u32,
+ numBlit: u32,
+ maxGpuLatency: u32,
+ gpuFrameNum: u32,
+ numDynamicIndexBuffers: u16,
+ numDynamicVertexBuffers: u16,
+ numFrameBuffers: u16,
+ numIndexBuffers: u16,
+ numOcclusionQueries: u16,
+ numPrograms: u16,
+ numShaders: u16,
+ numTextures: u16,
+ numUniforms: u16,
+ numVertexBuffers: u16,
+ numVertexLayouts: u16,
+ textureMemoryUsed: i64,
+ rtMemoryUsed: i64,
+ transientVbUsed: i32,
+ transientIbUsed: i32,
+ numPrims: [5]u32,
+ gpuMemoryMax: i64,
+ gpuMemoryUsed: i64,
+ width: u16,
+ height: u16,
+ textWidth: u16,
+ textHeight: u16,
+ numViews: u16,
+ viewStats: [*c]ViewStats,
+ numEncoders: u8,
+ encoderStats: [*c]EncoderStats,
+ };
+
+ pub const VertexLayout = extern struct {
+ hash: u32,
+ stride: u16,
+ offset: [18]u16,
+ attributes: [18]u16,
+ /// Start VertexLayout.
+ /// <param name="_rendererType">Renderer backend type. See: `bgfx::RendererType`</param>
+ pub inline fn begin(self: *VertexLayout, _rendererType: RendererType) *VertexLayout {
+ return bgfx_vertex_layout_begin(self, _rendererType);
+ }
+ /// Add attribute to VertexLayout.
+ /// @remarks Must be called between begin/end.
+ /// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
+ /// <param name="_num">Number of elements 1, 2, 3 or 4.</param>
+ /// <param name="_type">Element type.</param>
+ /// <param name="_normalized">When using fixed point AttribType (f.e. Uint8) value will be normalized for vertex shader usage. When normalized is set to true, AttribType::Uint8 value in range 0-255 will be in range 0.0-1.0 in vertex shader.</param>
+ /// <param name="_asInt">Packaging rule for vertexPack, vertexUnpack, and vertexConvert for AttribType::Uint8 and AttribType::Int16. Unpacking code must be implemented inside vertex shader.</param>
+ pub inline fn add(self: *VertexLayout, _attrib: Attrib, _num: u8, _type: AttribType, _normalized: bool, _asInt: bool) *VertexLayout {
+ return bgfx_vertex_layout_add(self, _attrib, _num, _type, _normalized, _asInt);
+ }
+ /// Decode attribute.
+ /// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
+ /// <param name="_num">Number of elements.</param>
+ /// <param name="_type">Element type.</param>
+ /// <param name="_normalized">Attribute is normalized.</param>
+ /// <param name="_asInt">Attribute is packed as int.</param>
+ pub inline fn decode(self: *const VertexLayout, _attrib: Attrib, _num: [*c]u8 , _type: [*c]AttribType, _normalized: [*c]bool, _asInt: [*c]bool) void {
+ return bgfx_vertex_layout_decode(self, _attrib, _num, _type, _normalized, _asInt);
+ }
+ /// Returns `true` if VertexLayout contains attribute.
+ /// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
+ pub inline fn has(self: *const VertexLayout, _attrib: Attrib) bool {
+ return bgfx_vertex_layout_has(self, _attrib);
+ }
+ /// Skip `_num` bytes in vertex stream.
+ /// <param name="_num">Number of bytes to skip.</param>
+ pub inline fn skip(self: *VertexLayout, _num: u8) *VertexLayout {
+ return bgfx_vertex_layout_skip(self, _num);
+ }
+ /// End VertexLayout.
+ pub inline fn end(self: *VertexLayout) void {
+ return bgfx_vertex_layout_end(self);
+ }
+ };
+
+ pub const Encoder = opaque {
+ /// Sets a debug marker. This allows you to group graphics calls together for easy browsing in
+ /// graphics debugging tools.
+ /// <param name="_marker">Marker string.</param>
+ pub inline fn setMarker(self: ?*Encoder, _marker: [*c]const u8) void {
+ return bgfx_encoder_set_marker(self, _marker);
+ }
+ /// Set render states for draw primitive.
+ /// @remarks
+ /// 1. To set up more complex states use:
+ /// `BGFX_STATE_ALPHA_REF(_ref)`,
+ /// `BGFX_STATE_POINT_SIZE(_size)`,
+ /// `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
+ /// `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
+ /// `BGFX_STATE_BLEND_EQUATION(_equation)`,
+ /// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
+ /// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
+ /// equation is specified.
+ /// <param name="_state">State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.</param>
+ /// <param name="_rgba">Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes.</param>
+ pub inline fn setState(self: ?*Encoder, _state: u64, _rgba: u32) void {
+ return bgfx_encoder_set_state(self, _state, _rgba);
+ }
+ /// Set condition for rendering.
+ /// <param name="_handle">Occlusion query handle.</param>
+ /// <param name="_visible">Render if occlusion query is visible.</param>
+ pub inline fn setCondition(self: ?*Encoder, _handle: OcclusionQueryHandle, _visible: bool) void {
+ return bgfx_encoder_set_condition(self, _handle, _visible);
+ }
+ /// Set stencil test state.
+ /// <param name="_fstencil">Front stencil state.</param>
+ /// <param name="_bstencil">Back stencil state. If back is set to `BGFX_STENCIL_NONE` _fstencil is applied to both front and back facing primitives.</param>
+ pub inline fn setStencil(self: ?*Encoder, _fstencil: u32, _bstencil: u32) void {
+ return bgfx_encoder_set_stencil(self, _fstencil, _bstencil);
+ }
+ /// Set scissor for draw primitive.
+ /// @remark
+ /// To scissor for all primitives in view see `bgfx::setViewScissor`.
+ /// <param name="_x">Position x from the left corner of the window.</param>
+ /// <param name="_y">Position y from the top corner of the window.</param>
+ /// <param name="_width">Width of view scissor region.</param>
+ /// <param name="_height">Height of view scissor region.</param>
+ pub inline fn setScissor(self: ?*Encoder, _x: u16, _y: u16, _width: u16, _height: u16) u16 {
+ return bgfx_encoder_set_scissor(self, _x, _y, _width, _height);
+ }
+ /// Set scissor from cache for draw primitive.
+ /// @remark
+ /// To scissor for all primitives in view see `bgfx::setViewScissor`.
+ /// <param name="_cache">Index in scissor cache.</param>
+ pub inline fn setScissorCached(self: ?*Encoder, _cache: u16) void {
+ return bgfx_encoder_set_scissor_cached(self, _cache);
+ }
+ /// Set model matrix for draw primitive. If it is not called,
+ /// the model will be rendered with an identity model matrix.
+ /// <param name="_mtx">Pointer to first matrix in array.</param>
+ /// <param name="_num">Number of matrices in array.</param>
+ pub inline fn setTransform(self: ?*Encoder, _mtx: ?*const anyopaque, _num: u16) u32 {
+ return bgfx_encoder_set_transform(self, _mtx, _num);
+ }
+ /// Set model matrix from matrix cache for draw primitive.
+ /// <param name="_cache">Index in matrix cache.</param>
+ /// <param name="_num">Number of matrices from cache.</param>
+ pub inline fn setTransformCached(self: ?*Encoder, _cache: u32, _num: u16) void {
+ return bgfx_encoder_set_transform_cached(self, _cache, _num);
+ }
+ /// Reserve matrices in internal matrix cache.
+ /// @attention Pointer returned can be modified until `bgfx::frame` is called.
+ /// <param name="_transform">Pointer to `Transform` structure.</param>
+ /// <param name="_num">Number of matrices.</param>
+ pub inline fn allocTransform(self: ?*Encoder, _transform: [*c]Transform, _num: u16) u32 {
+ return bgfx_encoder_alloc_transform(self, _transform, _num);
+ }
+ /// Set shader uniform parameter for draw primitive.
+ /// <param name="_handle">Uniform.</param>
+ /// <param name="_value">Pointer to uniform data.</param>
+ /// <param name="_num">Number of elements. Passing `UINT16_MAX` will use the _num passed on uniform creation.</param>
+ pub inline fn setUniform(self: ?*Encoder, _handle: UniformHandle, _value: ?*const anyopaque, _num: u16) void {
+ return bgfx_encoder_set_uniform(self, _handle, _value, _num);
+ }
+ /// Set index buffer for draw primitive.
+ /// <param name="_handle">Index buffer.</param>
+ /// <param name="_firstIndex">First index to render.</param>
+ /// <param name="_numIndices">Number of indices to render.</param>
+ pub inline fn setIndexBuffer(self: ?*Encoder, _handle: IndexBufferHandle, _firstIndex: u32, _numIndices: u32) void {
+ return bgfx_encoder_set_index_buffer(self, _handle, _firstIndex, _numIndices);
+ }
+ /// Set index buffer for draw primitive.
+ /// <param name="_handle">Dynamic index buffer.</param>
+ /// <param name="_firstIndex">First index to render.</param>
+ /// <param name="_numIndices">Number of indices to render.</param>
+ pub inline fn setDynamicIndexBuffer(self: ?*Encoder, _handle: DynamicIndexBufferHandle, _firstIndex: u32, _numIndices: u32) void {
+ return bgfx_encoder_set_dynamic_index_buffer(self, _handle, _firstIndex, _numIndices);
+ }
+ /// Set index buffer for draw primitive.
+ /// <param name="_tib">Transient index buffer.</param>
+ /// <param name="_firstIndex">First index to render.</param>
+ /// <param name="_numIndices">Number of indices to render.</param>
+ pub inline fn setTransientIndexBuffer(self: ?*Encoder, _tib: [*c]const TransientIndexBuffer, _firstIndex: u32, _numIndices: u32) void {
+ return bgfx_encoder_set_transient_index_buffer(self, _tib, _firstIndex, _numIndices);
+ }
+ /// Set vertex buffer for draw primitive.
+ /// <param name="_stream">Vertex stream.</param>
+ /// <param name="_handle">Vertex buffer.</param>
+ /// <param name="_startVertex">First vertex to render.</param>
+ /// <param name="_numVertices">Number of vertices to render.</param>
+ pub inline fn setVertexBuffer(self: ?*Encoder, _stream: u8, _handle: VertexBufferHandle, _startVertex: u32, _numVertices: u32) void {
+ return bgfx_encoder_set_vertex_buffer(self, _stream, _handle, _startVertex, _numVertices);
+ }
+ /// Set vertex buffer for draw primitive.
+ /// <param name="_stream">Vertex stream.</param>
+ /// <param name="_handle">Vertex buffer.</param>
+ /// <param name="_startVertex">First vertex to render.</param>
+ /// <param name="_numVertices">Number of vertices to render.</param>
+ /// <param name="_layoutHandle">Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.</param>
+ pub inline fn setVertexBufferWithLayout(self: ?*Encoder, _stream: u8, _handle: VertexBufferHandle, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void {
+ return bgfx_encoder_set_vertex_buffer_with_layout(self, _stream, _handle, _startVertex, _numVertices, _layoutHandle);
+ }
+ /// Set vertex buffer for draw primitive.
+ /// <param name="_stream">Vertex stream.</param>
+ /// <param name="_handle">Dynamic vertex buffer.</param>
+ /// <param name="_startVertex">First vertex to render.</param>
+ /// <param name="_numVertices">Number of vertices to render.</param>
+ pub inline fn setDynamicVertexBuffer(self: ?*Encoder, _stream: u8, _handle: DynamicVertexBufferHandle, _startVertex: u32, _numVertices: u32) void {
+ return bgfx_encoder_set_dynamic_vertex_buffer(self, _stream, _handle, _startVertex, _numVertices);
+ }
+ pub inline fn setDynamicVertexBufferWithLayout(self: ?*Encoder, _stream: u8, _handle: DynamicVertexBufferHandle, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void {
+ return bgfx_encoder_set_dynamic_vertex_buffer_with_layout(self, _stream, _handle, _startVertex, _numVertices, _layoutHandle);
+ }
+ /// Set vertex buffer for draw primitive.
+ /// <param name="_stream">Vertex stream.</param>
+ /// <param name="_tvb">Transient vertex buffer.</param>
+ /// <param name="_startVertex">First vertex to render.</param>
+ /// <param name="_numVertices">Number of vertices to render.</param>
+ pub inline fn setTransientVertexBuffer(self: ?*Encoder, _stream: u8, _tvb: [*c]const TransientVertexBuffer, _startVertex: u32, _numVertices: u32) void {
+ return bgfx_encoder_set_transient_vertex_buffer(self, _stream, _tvb, _startVertex, _numVertices);
+ }
+ /// Set vertex buffer for draw primitive.
+ /// <param name="_stream">Vertex stream.</param>
+ /// <param name="_tvb">Transient vertex buffer.</param>
+ /// <param name="_startVertex">First vertex to render.</param>
+ /// <param name="_numVertices">Number of vertices to render.</param>
+ /// <param name="_layoutHandle">Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.</param>
+ pub inline fn setTransientVertexBufferWithLayout(self: ?*Encoder, _stream: u8, _tvb: [*c]const TransientVertexBuffer, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void {
+ return bgfx_encoder_set_transient_vertex_buffer_with_layout(self, _stream, _tvb, _startVertex, _numVertices, _layoutHandle);
+ }
+ /// Set number of vertices for auto generated vertices use in conjunction
+ /// with gl_VertexID.
+ /// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+ /// <param name="_numVertices">Number of vertices.</param>
+ pub inline fn setVertexCount(self: ?*Encoder, _numVertices: u32) void {
+ return bgfx_encoder_set_vertex_count(self, _numVertices);
+ }
+ /// Set instance data buffer for draw primitive.
+ /// <param name="_idb">Transient instance data buffer.</param>
+ /// <param name="_start">First instance data.</param>
+ /// <param name="_num">Number of data instances.</param>
+ pub inline fn setInstanceDataBuffer(self: ?*Encoder, _idb: [*c]const InstanceDataBuffer, _start: u32, _num: u32) void {
+ return bgfx_encoder_set_instance_data_buffer(self, _idb, _start, _num);
+ }
+ /// Set instance data buffer for draw primitive.
+ /// <param name="_handle">Vertex buffer.</param>
+ /// <param name="_startVertex">First instance data.</param>
+ /// <param name="_num">Number of data instances. Set instance data buffer for draw primitive.</param>
+ pub inline fn setInstanceDataFromVertexBuffer(self: ?*Encoder, _handle: VertexBufferHandle, _startVertex: u32, _num: u32) void {
+ return bgfx_encoder_set_instance_data_from_vertex_buffer(self, _handle, _startVertex, _num);
+ }
+ /// Set instance data buffer for draw primitive.
+ /// <param name="_handle">Dynamic vertex buffer.</param>
+ /// <param name="_startVertex">First instance data.</param>
+ /// <param name="_num">Number of data instances.</param>
+ pub inline fn setInstanceDataFromDynamicVertexBuffer(self: ?*Encoder, _handle: DynamicVertexBufferHandle, _startVertex: u32, _num: u32) void {
+ return bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer(self, _handle, _startVertex, _num);
+ }
+ /// Set number of instances for auto generated instances use in conjunction
+ /// with gl_InstanceID.
+ /// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+ pub inline fn setInstanceCount(self: ?*Encoder, _numInstances: u32) void {
+ return bgfx_encoder_set_instance_count(self, _numInstances);
+ }
+ /// Set texture stage for draw primitive.
+ /// <param name="_stage">Texture unit.</param>
+ /// <param name="_sampler">Program sampler.</param>
+ /// <param name="_handle">Texture handle.</param>
+ /// <param name="_flags">Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.</param>
+ pub inline fn setTexture(self: ?*Encoder, _stage: u8, _sampler: UniformHandle, _handle: TextureHandle, _flags: u32) void {
+ return bgfx_encoder_set_texture(self, _stage, _sampler, _handle, _flags);
+ }
+ /// Submit an empty primitive for rendering. Uniforms and draw state
+ /// will be applied but no geometry will be submitted. Useful in cases
+ /// when no other draw/compute primitive is submitted to view, but it's
+ /// desired to execute clear view.
+ /// @remark
+ /// These empty draw calls will sort before ordinary draw calls.
+ /// <param name="_id">View id.</param>
+ pub inline fn touch(self: ?*Encoder, _id: ViewId) void {
+ return bgfx_encoder_touch(self, _id);
+ }
+ /// Submit primitive for rendering.
+ /// <param name="_id">View id.</param>
+ /// <param name="_program">Program.</param>
+ /// <param name="_depth">Depth for sorting.</param>
+ /// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+ pub inline fn submit(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _depth: u32, _flags: u8) void {
+ return bgfx_encoder_submit(self, _id, _program, _depth, _flags);
+ }
+ /// Submit primitive with occlusion query for rendering.
+ /// <param name="_id">View id.</param>
+ /// <param name="_program">Program.</param>
+ /// <param name="_occlusionQuery">Occlusion query.</param>
+ /// <param name="_depth">Depth for sorting.</param>
+ /// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+ pub inline fn submitOcclusionQuery(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _occlusionQuery: OcclusionQueryHandle, _depth: u32, _flags: u8) void {
+ return bgfx_encoder_submit_occlusion_query(self, _id, _program, _occlusionQuery, _depth, _flags);
+ }
+ /// Submit primitive for rendering with index and instance data info from
+ /// indirect buffer.
+ /// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
+ /// <param name="_id">View id.</param>
+ /// <param name="_program">Program.</param>
+ /// <param name="_indirectHandle">Indirect buffer.</param>
+ /// <param name="_start">First element in indirect buffer.</param>
+ /// <param name="_num">Number of draws.</param>
+ /// <param name="_depth">Depth for sorting.</param>
+ /// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+ pub inline fn submitIndirect(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _depth: u32, _flags: u8) void {
+ return bgfx_encoder_submit_indirect(self, _id, _program, _indirectHandle, _start, _num, _depth, _flags);
+ }
+ /// Submit primitive for rendering with index and instance data info and
+ /// draw count from indirect buffers.
+ /// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+ /// <param name="_id">View id.</param>
+ /// <param name="_program">Program.</param>
+ /// <param name="_indirectHandle">Indirect buffer.</param>
+ /// <param name="_start">First element in indirect buffer.</param>
+ /// <param name="_numHandle">Buffer for number of draws. Must be created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.</param>
+ /// <param name="_numIndex">Element in number buffer.</param>
+ /// <param name="_numMax">Max number of draws.</param>
+ /// <param name="_depth">Depth for sorting.</param>
+ /// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+ pub inline fn submitIndirectCount(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u16, _depth: u32, _flags: u8) void {
+ return bgfx_encoder_submit_indirect_count(self, _id, _program, _indirectHandle, _start, _numHandle, _numIndex, _numMax, _depth, _flags);
+ }
+ /// Set compute index buffer.
+ /// <param name="_stage">Compute stage.</param>
+ /// <param name="_handle">Index buffer handle.</param>
+ /// <param name="_access">Buffer access. See `Access::Enum`.</param>
+ pub inline fn setComputeIndexBuffer(self: ?*Encoder, _stage: u8, _handle: IndexBufferHandle, _access: Access) void {
+ return bgfx_encoder_set_compute_index_buffer(self, _stage, _handle, _access);
+ }
+ /// Set compute vertex buffer.
+ /// <param name="_stage">Compute stage.</param>
+ /// <param name="_handle">Vertex buffer handle.</param>
+ /// <param name="_access">Buffer access. See `Access::Enum`.</param>
+ pub inline fn setComputeVertexBuffer(self: ?*Encoder, _stage: u8, _handle: VertexBufferHandle, _access: Access) void {
+ return bgfx_encoder_set_compute_vertex_buffer(self, _stage, _handle, _access);
+ }
+ /// Set compute dynamic index buffer.
+ /// <param name="_stage">Compute stage.</param>
+ /// <param name="_handle">Dynamic index buffer handle.</param>
+ /// <param name="_access">Buffer access. See `Access::Enum`.</param>
+ pub inline fn setComputeDynamicIndexBuffer(self: ?*Encoder, _stage: u8, _handle: DynamicIndexBufferHandle, _access: Access) void {
+ return bgfx_encoder_set_compute_dynamic_index_buffer(self, _stage, _handle, _access);
+ }
+ /// Set compute dynamic vertex buffer.
+ /// <param name="_stage">Compute stage.</param>
+ /// <param name="_handle">Dynamic vertex buffer handle.</param>
+ /// <param name="_access">Buffer access. See `Access::Enum`.</param>
+ pub inline fn setComputeDynamicVertexBuffer(self: ?*Encoder, _stage: u8, _handle: DynamicVertexBufferHandle, _access: Access) void {
+ return bgfx_encoder_set_compute_dynamic_vertex_buffer(self, _stage, _handle, _access);
+ }
+ /// Set compute indirect buffer.
+ /// <param name="_stage">Compute stage.</param>
+ /// <param name="_handle">Indirect buffer handle.</param>
+ /// <param name="_access">Buffer access. See `Access::Enum`.</param>
+ pub inline fn setComputeIndirectBuffer(self: ?*Encoder, _stage: u8, _handle: IndirectBufferHandle, _access: Access) void {
+ return bgfx_encoder_set_compute_indirect_buffer(self, _stage, _handle, _access);
+ }
+ /// Set compute image from texture.
+ /// <param name="_stage">Compute stage.</param>
+ /// <param name="_handle">Texture handle.</param>
+ /// <param name="_mip">Mip level.</param>
+ /// <param name="_access">Image access. See `Access::Enum`.</param>
+ /// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
+ pub inline fn setImage(self: ?*Encoder, _stage: u8, _handle: TextureHandle, _mip: u8, _access: Access, _format: TextureFormat) void {
+ return bgfx_encoder_set_image(self, _stage, _handle, _mip, _access, _format);
+ }
+ /// Dispatch compute.
+ /// <param name="_id">View id.</param>
+ /// <param name="_program">Compute program.</param>
+ /// <param name="_numX">Number of groups X.</param>
+ /// <param name="_numY">Number of groups Y.</param>
+ /// <param name="_numZ">Number of groups Z.</param>
+ /// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+ pub inline fn dispatch(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _numX: u32, _numY: u32, _numZ: u32, _flags: u8) void {
+ return bgfx_encoder_dispatch(self, _id, _program, _numX, _numY, _numZ, _flags);
+ }
+ /// Dispatch compute indirect.
+ /// <param name="_id">View id.</param>
+ /// <param name="_program">Compute program.</param>
+ /// <param name="_indirectHandle">Indirect buffer.</param>
+ /// <param name="_start">First element in indirect buffer.</param>
+ /// <param name="_num">Number of dispatches.</param>
+ /// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+ pub inline fn dispatchIndirect(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _flags: u8) void {
+ return bgfx_encoder_dispatch_indirect(self, _id, _program, _indirectHandle, _start, _num, _flags);
+ }
+ /// Discard previously set state for draw or compute call.
+ /// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+ pub inline fn discard(self: ?*Encoder, _flags: u8) void {
+ return bgfx_encoder_discard(self, _flags);
+ }
+ /// Blit 2D texture region between two 2D textures.
+ /// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
+ /// @attention Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
+ /// <param name="_id">View id.</param>
+ /// <param name="_dst">Destination texture handle.</param>
+ /// <param name="_dstMip">Destination texture mip level.</param>
+ /// <param name="_dstX">Destination texture X position.</param>
+ /// <param name="_dstY">Destination texture Y position.</param>
+ /// <param name="_dstZ">If texture is 2D this argument should be 0. If destination texture is cube this argument represents destination texture cube face. For 3D texture this argument represents destination texture Z position.</param>
+ /// <param name="_src">Source texture handle.</param>
+ /// <param name="_srcMip">Source texture mip level.</param>
+ /// <param name="_srcX">Source texture X position.</param>
+ /// <param name="_srcY">Source texture Y position.</param>
+ /// <param name="_srcZ">If texture is 2D this argument should be 0. If source texture is cube this argument represents source texture cube face. For 3D texture this argument represents source texture Z position.</param>
+ /// <param name="_width">Width of region.</param>
+ /// <param name="_height">Height of region.</param>
+ /// <param name="_depth">If texture is 3D this argument represents depth of region, otherwise it's unused.</param>
+ pub inline fn blit(self: ?*Encoder, _id: ViewId, _dst: TextureHandle, _dstMip: u8, _dstX: u16, _dstY: u16, _dstZ: u16, _src: TextureHandle, _srcMip: u8, _srcX: u16, _srcY: u16, _srcZ: u16, _width: u16, _height: u16, _depth: u16) void {
+ return bgfx_encoder_blit(self, _id, _dst, _dstMip, _dstX, _dstY, _dstZ, _src, _srcMip, _srcX, _srcY, _srcZ, _width, _height, _depth);
+ }
+ };
+
+pub const DynamicIndexBufferHandle = extern struct {
+ idx: c_ushort,
+};
+
+pub const DynamicVertexBufferHandle = extern struct {
+ idx: c_ushort,
+};
+
+pub const FrameBufferHandle = extern struct {
+ idx: c_ushort,
+};
+
+pub const IndexBufferHandle = extern struct {
+ idx: c_ushort,
+};
+
+pub const IndirectBufferHandle = extern struct {
+ idx: c_ushort,
+};
+
+pub const OcclusionQueryHandle = extern struct {
+ idx: c_ushort,
+};
+
+pub const ProgramHandle = extern struct {
+ idx: c_ushort,
+};
+
+pub const ShaderHandle = extern struct {
+ idx: c_ushort,
+};
+
+pub const TextureHandle = extern struct {
+ idx: c_ushort,
+};
+
+pub const UniformHandle = extern struct {
+ idx: c_ushort,
+};
+
+pub const VertexBufferHandle = extern struct {
+ idx: c_ushort,
+};
+
+pub const VertexLayoutHandle = extern struct {
+ idx: c_ushort,
+};
+
+
+/// Init attachment.
+/// <param name="_handle">Render target texture handle.</param>
+/// <param name="_access">Access. See `Access::Enum`.</param>
+/// <param name="_layer">Cubemap side or depth layer/slice to use.</param>
+/// <param name="_numLayers">Number of texture layer/slice(s) in array to use.</param>
+/// <param name="_mip">Mip level.</param>
+/// <param name="_resolve">Resolve flags. See: `BGFX_RESOLVE_*`</param>
+extern fn bgfx_attachment_init(self: [*c]Attachment, _handle: TextureHandle, _access: Access, _layer: u16, _numLayers: u16, _mip: u16, _resolve: u8) void;
+
+/// Start VertexLayout.
+/// <param name="_rendererType">Renderer backend type. See: `bgfx::RendererType`</param>
+extern fn bgfx_vertex_layout_begin(self: [*c]VertexLayout, _rendererType: RendererType) [*c]VertexLayout;
+
+/// Add attribute to VertexLayout.
+/// @remarks Must be called between begin/end.
+/// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
+/// <param name="_num">Number of elements 1, 2, 3 or 4.</param>
+/// <param name="_type">Element type.</param>
+/// <param name="_normalized">When using fixed point AttribType (f.e. Uint8) value will be normalized for vertex shader usage. When normalized is set to true, AttribType::Uint8 value in range 0-255 will be in range 0.0-1.0 in vertex shader.</param>
+/// <param name="_asInt">Packaging rule for vertexPack, vertexUnpack, and vertexConvert for AttribType::Uint8 and AttribType::Int16. Unpacking code must be implemented inside vertex shader.</param>
+extern fn bgfx_vertex_layout_add(self: [*c]VertexLayout, _attrib: Attrib, _num: u8, _type: AttribType, _normalized: bool, _asInt: bool) [*c]VertexLayout;
+
+/// Decode attribute.
+/// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
+/// <param name="_num">Number of elements.</param>
+/// <param name="_type">Element type.</param>
+/// <param name="_normalized">Attribute is normalized.</param>
+/// <param name="_asInt">Attribute is packed as int.</param>
+extern fn bgfx_vertex_layout_decode(self: [*c]const VertexLayout, _attrib: Attrib, _num: [*c]u8 , _type: [*c]AttribType, _normalized: [*c]bool, _asInt: [*c]bool) void;
+
+/// Returns `true` if VertexLayout contains attribute.
+/// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
+extern fn bgfx_vertex_layout_has(self: [*c]const VertexLayout, _attrib: Attrib) bool;
+
+/// Skip `_num` bytes in vertex stream.
+/// <param name="_num">Number of bytes to skip.</param>
+extern fn bgfx_vertex_layout_skip(self: [*c]VertexLayout, _num: u8) [*c]VertexLayout;
+
+/// End VertexLayout.
+extern fn bgfx_vertex_layout_end(self: [*c]VertexLayout) void;
+
+/// Pack vertex attribute into vertex stream format.
+/// <param name="_input">Value to be packed into vertex stream.</param>
+/// <param name="_inputNormalized">`true` if input value is already normalized.</param>
+/// <param name="_attr">Attribute to pack.</param>
+/// <param name="_layout">Vertex stream layout.</param>
+/// <param name="_data">Destination vertex stream where data will be packed.</param>
+/// <param name="_index">Vertex index that will be modified.</param>
+pub inline fn vertexPack(_input: [4]f32, _inputNormalized: bool, _attr: Attrib, _layout: [*c]const VertexLayout, _data: ?*anyopaque, _index: u32) void {
+ return bgfx_vertex_pack(_input, _inputNormalized, _attr, _layout, _data, _index);
+}
+extern fn bgfx_vertex_pack(_input: [4]f32, _inputNormalized: bool, _attr: Attrib, _layout: [*c]const VertexLayout, _data: ?*anyopaque, _index: u32) void;
+
+/// Unpack vertex attribute from vertex stream format.
+/// <param name="_output">Result of unpacking.</param>
+/// <param name="_attr">Attribute to unpack.</param>
+/// <param name="_layout">Vertex stream layout.</param>
+/// <param name="_data">Source vertex stream from where data will be unpacked.</param>
+/// <param name="_index">Vertex index that will be unpacked.</param>
+pub inline fn vertexUnpack(_output: [4]f32, _attr: Attrib, _layout: [*c]const VertexLayout, _data: ?*const anyopaque, _index: u32) void {
+ return bgfx_vertex_unpack(_output, _attr, _layout, _data, _index);
+}
+extern fn bgfx_vertex_unpack(_output: [4]f32, _attr: Attrib, _layout: [*c]const VertexLayout, _data: ?*const anyopaque, _index: u32) void;
+
+/// Converts vertex stream data from one vertex stream format to another.
+/// <param name="_dstLayout">Destination vertex stream layout.</param>
+/// <param name="_dstData">Destination vertex stream.</param>
+/// <param name="_srcLayout">Source vertex stream layout.</param>
+/// <param name="_srcData">Source vertex stream data.</param>
+/// <param name="_num">Number of vertices to convert from source to destination.</param>
+pub inline fn vertexConvert(_dstLayout: [*c]const VertexLayout, _dstData: ?*anyopaque, _srcLayout: [*c]const VertexLayout, _srcData: ?*const anyopaque, _num: u32) void {
+ return bgfx_vertex_convert(_dstLayout, _dstData, _srcLayout, _srcData, _num);
+}
+extern fn bgfx_vertex_convert(_dstLayout: [*c]const VertexLayout, _dstData: ?*anyopaque, _srcLayout: [*c]const VertexLayout, _srcData: ?*const anyopaque, _num: u32) void;
+
+/// Weld vertices.
+/// <param name="_output">Welded vertices remapping table. The size of buffer must be the same as number of vertices.</param>
+/// <param name="_layout">Vertex stream layout.</param>
+/// <param name="_data">Vertex stream.</param>
+/// <param name="_num">Number of vertices in vertex stream.</param>
+/// <param name="_index32">Set to `true` if input indices are 32-bit.</param>
+/// <param name="_epsilon">Error tolerance for vertex position comparison.</param>
+pub inline fn weldVertices(_output: ?*anyopaque, _layout: [*c]const VertexLayout, _data: ?*const anyopaque, _num: u32, _index32: bool, _epsilon: f32) u32 {
+ return bgfx_weld_vertices(_output, _layout, _data, _num, _index32, _epsilon);
+}
+extern fn bgfx_weld_vertices(_output: ?*anyopaque, _layout: [*c]const VertexLayout, _data: ?*const anyopaque, _num: u32, _index32: bool, _epsilon: f32) u32;
+
+/// Convert index buffer for use with different primitive topologies.
+/// <param name="_conversion">Conversion type, see `TopologyConvert::Enum`.</param>
+/// <param name="_dst">Destination index buffer. If this argument is NULL function will return number of indices after conversion.</param>
+/// <param name="_dstSize">Destination index buffer in bytes. It must be large enough to contain output indices. If destination size is insufficient index buffer will be truncated.</param>
+/// <param name="_indices">Source indices.</param>
+/// <param name="_numIndices">Number of input indices.</param>
+/// <param name="_index32">Set to `true` if input indices are 32-bit.</param>
+pub inline fn topologyConvert(_conversion: TopologyConvert, _dst: ?*anyopaque, _dstSize: u32, _indices: ?*const anyopaque, _numIndices: u32, _index32: bool) u32 {
+ return bgfx_topology_convert(_conversion, _dst, _dstSize, _indices, _numIndices, _index32);
+}
+extern fn bgfx_topology_convert(_conversion: TopologyConvert, _dst: ?*anyopaque, _dstSize: u32, _indices: ?*const anyopaque, _numIndices: u32, _index32: bool) u32;
+
+/// Sort indices.
+/// <param name="_sort">Sort order, see `TopologySort::Enum`.</param>
+/// <param name="_dst">Destination index buffer.</param>
+/// <param name="_dstSize">Destination index buffer in bytes. It must be large enough to contain output indices. If destination size is insufficient index buffer will be truncated.</param>
+/// <param name="_dir">Direction (vector must be normalized).</param>
+/// <param name="_pos">Position.</param>
+/// <param name="_vertices">Pointer to first vertex represented as float x, y, z. Must contain at least number of vertices referencende by index buffer.</param>
+/// <param name="_stride">Vertex stride.</param>
+/// <param name="_indices">Source indices.</param>
+/// <param name="_numIndices">Number of input indices.</param>
+/// <param name="_index32">Set to `true` if input indices are 32-bit.</param>
+pub inline fn topologySortTriList(_sort: TopologySort, _dst: ?*anyopaque, _dstSize: u32, _dir: [3]f32, _pos: [3]f32, _vertices: ?*const anyopaque, _stride: u32, _indices: ?*const anyopaque, _numIndices: u32, _index32: bool) void {
+ return bgfx_topology_sort_tri_list(_sort, _dst, _dstSize, _dir, _pos, _vertices, _stride, _indices, _numIndices, _index32);
+}
+extern fn bgfx_topology_sort_tri_list(_sort: TopologySort, _dst: ?*anyopaque, _dstSize: u32, _dir: [3]f32, _pos: [3]f32, _vertices: ?*const anyopaque, _stride: u32, _indices: ?*const anyopaque, _numIndices: u32, _index32: bool) void;
+
+/// Returns supported backend API renderers.
+/// <param name="_max">Maximum number of elements in _enum array.</param>
+/// <param name="_enum">Array where supported renderers will be written.</param>
+pub inline fn getSupportedRenderers(_max: u8, _enum: [*c]RendererType) u8 {
+ return bgfx_get_supported_renderers(_max, _enum);
+}
+extern fn bgfx_get_supported_renderers(_max: u8, _enum: [*c]RendererType) u8;
+
+/// Returns name of renderer.
+/// <param name="_type">Renderer backend type. See: `bgfx::RendererType`</param>
+pub inline fn getRendererName(_type: RendererType) [*c]const u8 {
+ return bgfx_get_renderer_name(_type);
+}
+extern fn bgfx_get_renderer_name(_type: RendererType) [*c]const u8;
+
+pub inline fn initCtor(_init: [*c]Init) void {
+ return bgfx_init_ctor(_init);
+}
+extern fn bgfx_init_ctor(_init: [*c]Init) void;
+
+/// Initialize the bgfx library.
+/// <param name="_init">Initialization parameters. See: `bgfx::Init` for more info.</param>
+pub inline fn init(_init: [*c]const Init) bool {
+ return bgfx_init(_init);
+}
+extern fn bgfx_init(_init: [*c]const Init) bool;
+
+/// Shutdown bgfx library.
+pub inline fn shutdown() void {
+ return bgfx_shutdown();
+}
+extern fn bgfx_shutdown() void;
+
+/// Reset graphic settings and back-buffer size.
+/// @attention This call doesn’t change the window size, it just resizes
+/// the back-buffer. Your windowing code controls the window size.
+/// <param name="_width">Back-buffer width.</param>
+/// <param name="_height">Back-buffer height.</param>
+/// <param name="_flags">See: `BGFX_RESET_*` for more info. - `BGFX_RESET_NONE` - No reset flags. - `BGFX_RESET_FULLSCREEN` - Not supported yet. - `BGFX_RESET_MSAA_X[2/4/8/16]` - Enable 2, 4, 8 or 16 x MSAA. - `BGFX_RESET_VSYNC` - Enable V-Sync. - `BGFX_RESET_MAXANISOTROPY` - Turn on/off max anisotropy. - `BGFX_RESET_CAPTURE` - Begin screen capture. - `BGFX_RESET_FLUSH_AFTER_RENDER` - Flush rendering after submitting to GPU. - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip occurs. Default behaviour is that flip occurs before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`. - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB back-buffer.</param>
+/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
+pub inline fn reset(_width: u32, _height: u32, _flags: u32, _format: TextureFormat) void {
+ return bgfx_reset(_width, _height, _flags, _format);
+}
+extern fn bgfx_reset(_width: u32, _height: u32, _flags: u32, _format: TextureFormat) void;
+
+/// Advance to next frame. When using multithreaded renderer, this call
+/// just swaps internal buffers, kicks render thread, and returns. In
+/// singlethreaded renderer this call does frame rendering.
+/// <param name="_capture">Capture frame with graphics debugger.</param>
+pub inline fn frame(_capture: bool) u32 {
+ return bgfx_frame(_capture);
+}
+extern fn bgfx_frame(_capture: bool) u32;
+
+/// Returns current renderer backend API type.
+/// @remarks
+/// Library must be initialized.
+pub inline fn getRendererType() RendererType {
+ return bgfx_get_renderer_type();
+}
+extern fn bgfx_get_renderer_type() RendererType;
+
+/// Returns renderer capabilities.
+/// @remarks
+/// Library must be initialized.
+pub inline fn getCaps() [*c]const Caps {
+ return bgfx_get_caps();
+}
+extern fn bgfx_get_caps() [*c]const Caps;
+
+/// Returns performance counters.
+/// @attention Pointer returned is valid until `bgfx::frame` is called.
+pub inline fn getStats() [*c]const Stats {
+ return bgfx_get_stats();
+}
+extern fn bgfx_get_stats() [*c]const Stats;
+
+/// Allocate buffer to pass to bgfx calls. Data will be freed inside bgfx.
+/// <param name="_size">Size to allocate.</param>
+pub inline fn alloc(_size: u32) [*c]const Memory {
+ return bgfx_alloc(_size);
+}
+extern fn bgfx_alloc(_size: u32) [*c]const Memory;
+
+/// Allocate buffer and copy data into it. Data will be freed inside bgfx.
+/// <param name="_data">Pointer to data to be copied.</param>
+/// <param name="_size">Size of data to be copied.</param>
+pub inline fn copy(_data: ?*const anyopaque, _size: u32) [*c]const Memory {
+ return bgfx_copy(_data, _size);
+}
+extern fn bgfx_copy(_data: ?*const anyopaque, _size: u32) [*c]const Memory;
+
+/// Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
+/// doesn't allocate memory for data. It just copies the _data pointer. You
+/// can pass `ReleaseFn` function pointer to release this memory after it's
+/// consumed, otherwise you must make sure _data is available for at least 2
+/// `bgfx::frame` calls. `ReleaseFn` function must be able to be called
+/// from any thread.
+/// @attention Data passed must be available for at least 2 `bgfx::frame` calls.
+/// <param name="_data">Pointer to data.</param>
+/// <param name="_size">Size of data.</param>
+pub inline fn makeRef(_data: ?*const anyopaque, _size: u32) [*c]const Memory {
+ return bgfx_make_ref(_data, _size);
+}
+extern fn bgfx_make_ref(_data: ?*const anyopaque, _size: u32) [*c]const Memory;
+
+/// Make reference to data to pass to bgfx. Unlike `bgfx::alloc`, this call
+/// doesn't allocate memory for data. It just copies the _data pointer. You
+/// can pass `ReleaseFn` function pointer to release this memory after it's
+/// consumed, otherwise you must make sure _data is available for at least 2
+/// `bgfx::frame` calls. `ReleaseFn` function must be able to be called
+/// from any thread.
+/// @attention Data passed must be available for at least 2 `bgfx::frame` calls.
+/// <param name="_data">Pointer to data.</param>
+/// <param name="_size">Size of data.</param>
+/// <param name="_releaseFn">Callback function to release memory after use.</param>
+/// <param name="_userData">User data to be passed to callback function.</param>
+pub inline fn makeRefRelease(_data: ?*const anyopaque, _size: u32, _releaseFn: ?*anyopaque, _userData: ?*anyopaque) [*c]const Memory {
+ return bgfx_make_ref_release(_data, _size, _releaseFn, _userData);
+}
+extern fn bgfx_make_ref_release(_data: ?*const anyopaque, _size: u32, _releaseFn: ?*anyopaque, _userData: ?*anyopaque) [*c]const Memory;
+
+/// Set debug flags.
+/// <param name="_debug">Available flags: - `BGFX_DEBUG_IFH` - Infinitely fast hardware. When this flag is set all rendering calls will be skipped. This is useful when profiling to quickly assess potential bottlenecks between CPU and GPU. - `BGFX_DEBUG_PROFILER` - Enable profiler. - `BGFX_DEBUG_STATS` - Display internal statistics. - `BGFX_DEBUG_TEXT` - Display debug text. - `BGFX_DEBUG_WIREFRAME` - Wireframe rendering. All rendering primitives will be rendered as lines.</param>
+pub inline fn setDebug(_debug: u32) void {
+ return bgfx_set_debug(_debug);
+}
+extern fn bgfx_set_debug(_debug: u32) void;
+
+/// Clear internal debug text buffer.
+/// <param name="_attr">Background color.</param>
+/// <param name="_small">Default 8x16 or 8x8 font.</param>
+pub inline fn dbgTextClear(_attr: u8, _small: bool) void {
+ return bgfx_dbg_text_clear(_attr, _small);
+}
+extern fn bgfx_dbg_text_clear(_attr: u8, _small: bool) void;
+
+/// Draw image into internal debug text buffer.
+/// <param name="_x">Position x from the left corner of the window.</param>
+/// <param name="_y">Position y from the top corner of the window.</param>
+/// <param name="_width">Image width.</param>
+/// <param name="_height">Image height.</param>
+/// <param name="_data">Raw image data (character/attribute raw encoding).</param>
+/// <param name="_pitch">Image pitch in bytes.</param>
+pub inline fn dbgTextImage(_x: u16, _y: u16, _width: u16, _height: u16, _data: ?*const anyopaque, _pitch: u16) void {
+ return bgfx_dbg_text_image(_x, _y, _width, _height, _data, _pitch);
+}
+extern fn bgfx_dbg_text_image(_x: u16, _y: u16, _width: u16, _height: u16, _data: ?*const anyopaque, _pitch: u16) void;
+
+/// Create static index buffer.
+/// <param name="_mem">Index buffer data.</param>
+/// <param name="_flags">Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.</param>
+pub inline fn createIndexBuffer(_mem: [*c]const Memory, _flags: u16) IndexBufferHandle {
+ return bgfx_create_index_buffer(_mem, _flags);
+}
+extern fn bgfx_create_index_buffer(_mem: [*c]const Memory, _flags: u16) IndexBufferHandle;
+
+/// Set static index buffer debug name.
+/// <param name="_handle">Static index buffer handle.</param>
+/// <param name="_name">Static index buffer name.</param>
+/// <param name="_len">Static index buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string.</param>
+pub inline fn setIndexBufferName(_handle: IndexBufferHandle, _name: [*c]const u8, _len: i32) void {
+ return bgfx_set_index_buffer_name(_handle, _name, _len);
+}
+extern fn bgfx_set_index_buffer_name(_handle: IndexBufferHandle, _name: [*c]const u8, _len: i32) void;
+
+/// Destroy static index buffer.
+/// <param name="_handle">Static index buffer handle.</param>
+pub inline fn destroyIndexBuffer(_handle: IndexBufferHandle) void {
+ return bgfx_destroy_index_buffer(_handle);
+}
+extern fn bgfx_destroy_index_buffer(_handle: IndexBufferHandle) void;
+
+/// Create vertex layout.
+/// <param name="_layout">Vertex layout.</param>
+pub inline fn createVertexLayout(_layout: [*c]const VertexLayout) VertexLayoutHandle {
+ return bgfx_create_vertex_layout(_layout);
+}
+extern fn bgfx_create_vertex_layout(_layout: [*c]const VertexLayout) VertexLayoutHandle;
+
+/// Destroy vertex layout.
+/// <param name="_layoutHandle">Vertex layout handle.</param>
+pub inline fn destroyVertexLayout(_layoutHandle: VertexLayoutHandle) void {
+ return bgfx_destroy_vertex_layout(_layoutHandle);
+}
+extern fn bgfx_destroy_vertex_layout(_layoutHandle: VertexLayoutHandle) void;
+
+/// Create static vertex buffer.
+/// <param name="_mem">Vertex buffer data.</param>
+/// <param name="_layout">Vertex layout.</param>
+/// <param name="_flags">Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.</param>
+pub inline fn createVertexBuffer(_mem: [*c]const Memory, _layout: [*c]const VertexLayout, _flags: u16) VertexBufferHandle {
+ return bgfx_create_vertex_buffer(_mem, _layout, _flags);
+}
+extern fn bgfx_create_vertex_buffer(_mem: [*c]const Memory, _layout: [*c]const VertexLayout, _flags: u16) VertexBufferHandle;
+
+/// Set static vertex buffer debug name.
+/// <param name="_handle">Static vertex buffer handle.</param>
+/// <param name="_name">Static vertex buffer name.</param>
+/// <param name="_len">Static vertex buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string.</param>
+pub inline fn setVertexBufferName(_handle: VertexBufferHandle, _name: [*c]const u8, _len: i32) void {
+ return bgfx_set_vertex_buffer_name(_handle, _name, _len);
+}
+extern fn bgfx_set_vertex_buffer_name(_handle: VertexBufferHandle, _name: [*c]const u8, _len: i32) void;
+
+/// Destroy static vertex buffer.
+/// <param name="_handle">Static vertex buffer handle.</param>
+pub inline fn destroyVertexBuffer(_handle: VertexBufferHandle) void {
+ return bgfx_destroy_vertex_buffer(_handle);
+}
+extern fn bgfx_destroy_vertex_buffer(_handle: VertexBufferHandle) void;
+
+/// Create empty dynamic index buffer.
+/// <param name="_num">Number of indices.</param>
+/// <param name="_flags">Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.</param>
+pub inline fn createDynamicIndexBuffer(_num: u32, _flags: u16) DynamicIndexBufferHandle {
+ return bgfx_create_dynamic_index_buffer(_num, _flags);
+}
+extern fn bgfx_create_dynamic_index_buffer(_num: u32, _flags: u16) DynamicIndexBufferHandle;
+
+/// Create a dynamic index buffer and initialize it.
+/// <param name="_mem">Index buffer data.</param>
+/// <param name="_flags">Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.</param>
+pub inline fn createDynamicIndexBufferMem(_mem: [*c]const Memory, _flags: u16) DynamicIndexBufferHandle {
+ return bgfx_create_dynamic_index_buffer_mem(_mem, _flags);
+}
+extern fn bgfx_create_dynamic_index_buffer_mem(_mem: [*c]const Memory, _flags: u16) DynamicIndexBufferHandle;
+
+/// Update dynamic index buffer.
+/// <param name="_handle">Dynamic index buffer handle.</param>
+/// <param name="_startIndex">Start index.</param>
+/// <param name="_mem">Index buffer data.</param>
+pub inline fn updateDynamicIndexBuffer(_handle: DynamicIndexBufferHandle, _startIndex: u32, _mem: [*c]const Memory) void {
+ return bgfx_update_dynamic_index_buffer(_handle, _startIndex, _mem);
+}
+extern fn bgfx_update_dynamic_index_buffer(_handle: DynamicIndexBufferHandle, _startIndex: u32, _mem: [*c]const Memory) void;
+
+/// Destroy dynamic index buffer.
+/// <param name="_handle">Dynamic index buffer handle.</param>
+pub inline fn destroyDynamicIndexBuffer(_handle: DynamicIndexBufferHandle) void {
+ return bgfx_destroy_dynamic_index_buffer(_handle);
+}
+extern fn bgfx_destroy_dynamic_index_buffer(_handle: DynamicIndexBufferHandle) void;
+
+/// Create empty dynamic vertex buffer.
+/// <param name="_num">Number of vertices.</param>
+/// <param name="_layout">Vertex layout.</param>
+/// <param name="_flags">Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.</param>
+pub inline fn createDynamicVertexBuffer(_num: u32, _layout: [*c]const VertexLayout, _flags: u16) DynamicVertexBufferHandle {
+ return bgfx_create_dynamic_vertex_buffer(_num, _layout, _flags);
+}
+extern fn bgfx_create_dynamic_vertex_buffer(_num: u32, _layout: [*c]const VertexLayout, _flags: u16) DynamicVertexBufferHandle;
+
+/// Create dynamic vertex buffer and initialize it.
+/// <param name="_mem">Vertex buffer data.</param>
+/// <param name="_layout">Vertex layout.</param>
+/// <param name="_flags">Buffer creation flags. - `BGFX_BUFFER_NONE` - No flags. - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader. - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU. - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader. - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of data is passed. If this flag is not specified, and more data is passed on update, the buffer will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers. - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.</param>
+pub inline fn createDynamicVertexBufferMem(_mem: [*c]const Memory, _layout: [*c]const VertexLayout, _flags: u16) DynamicVertexBufferHandle {
+ return bgfx_create_dynamic_vertex_buffer_mem(_mem, _layout, _flags);
+}
+extern fn bgfx_create_dynamic_vertex_buffer_mem(_mem: [*c]const Memory, _layout: [*c]const VertexLayout, _flags: u16) DynamicVertexBufferHandle;
+
+/// Update dynamic vertex buffer.
+/// <param name="_handle">Dynamic vertex buffer handle.</param>
+/// <param name="_startVertex">Start vertex.</param>
+/// <param name="_mem">Vertex buffer data.</param>
+pub inline fn updateDynamicVertexBuffer(_handle: DynamicVertexBufferHandle, _startVertex: u32, _mem: [*c]const Memory) void {
+ return bgfx_update_dynamic_vertex_buffer(_handle, _startVertex, _mem);
+}
+extern fn bgfx_update_dynamic_vertex_buffer(_handle: DynamicVertexBufferHandle, _startVertex: u32, _mem: [*c]const Memory) void;
+
+/// Destroy dynamic vertex buffer.
+/// <param name="_handle">Dynamic vertex buffer handle.</param>
+pub inline fn destroyDynamicVertexBuffer(_handle: DynamicVertexBufferHandle) void {
+ return bgfx_destroy_dynamic_vertex_buffer(_handle);
+}
+extern fn bgfx_destroy_dynamic_vertex_buffer(_handle: DynamicVertexBufferHandle) void;
+
+/// Returns number of requested or maximum available indices.
+/// <param name="_num">Number of required indices.</param>
+/// <param name="_index32">Set to `true` if input indices will be 32-bit.</param>
+pub inline fn getAvailTransientIndexBuffer(_num: u32, _index32: bool) u32 {
+ return bgfx_get_avail_transient_index_buffer(_num, _index32);
+}
+extern fn bgfx_get_avail_transient_index_buffer(_num: u32, _index32: bool) u32;
+
+/// Returns number of requested or maximum available vertices.
+/// <param name="_num">Number of required vertices.</param>
+/// <param name="_layout">Vertex layout.</param>
+pub inline fn getAvailTransientVertexBuffer(_num: u32, _layout: [*c]const VertexLayout) u32 {
+ return bgfx_get_avail_transient_vertex_buffer(_num, _layout);
+}
+extern fn bgfx_get_avail_transient_vertex_buffer(_num: u32, _layout: [*c]const VertexLayout) u32;
+
+/// Returns number of requested or maximum available instance buffer slots.
+/// <param name="_num">Number of required instances.</param>
+/// <param name="_stride">Stride per instance.</param>
+pub inline fn getAvailInstanceDataBuffer(_num: u32, _stride: u16) u32 {
+ return bgfx_get_avail_instance_data_buffer(_num, _stride);
+}
+extern fn bgfx_get_avail_instance_data_buffer(_num: u32, _stride: u16) u32;
+
+/// Allocate transient index buffer.
+/// <param name="_tib">TransientIndexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
+/// <param name="_num">Number of indices to allocate.</param>
+/// <param name="_index32">Set to `true` if input indices will be 32-bit.</param>
+pub inline fn allocTransientIndexBuffer(_tib: [*c]TransientIndexBuffer, _num: u32, _index32: bool) void {
+ return bgfx_alloc_transient_index_buffer(_tib, _num, _index32);
+}
+extern fn bgfx_alloc_transient_index_buffer(_tib: [*c]TransientIndexBuffer, _num: u32, _index32: bool) void;
+
+/// Allocate transient vertex buffer.
+/// <param name="_tvb">TransientVertexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
+/// <param name="_num">Number of vertices to allocate.</param>
+/// <param name="_layout">Vertex layout.</param>
+pub inline fn allocTransientVertexBuffer(_tvb: [*c]TransientVertexBuffer, _num: u32, _layout: [*c]const VertexLayout) void {
+ return bgfx_alloc_transient_vertex_buffer(_tvb, _num, _layout);
+}
+extern fn bgfx_alloc_transient_vertex_buffer(_tvb: [*c]TransientVertexBuffer, _num: u32, _layout: [*c]const VertexLayout) void;
+
+/// Check for required space and allocate transient vertex and index
+/// buffers. If both space requirements are satisfied function returns
+/// true.
+/// <param name="_tvb">TransientVertexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
+/// <param name="_layout">Vertex layout.</param>
+/// <param name="_numVertices">Number of vertices to allocate.</param>
+/// <param name="_tib">TransientIndexBuffer structure will be filled, and will be valid for the duration of frame, and can be reused for multiple draw calls.</param>
+/// <param name="_numIndices">Number of indices to allocate.</param>
+/// <param name="_index32">Set to `true` if input indices will be 32-bit.</param>
+pub inline fn allocTransientBuffers(_tvb: [*c]TransientVertexBuffer, _layout: [*c]const VertexLayout, _numVertices: u32, _tib: [*c]TransientIndexBuffer, _numIndices: u32, _index32: bool) bool {
+ return bgfx_alloc_transient_buffers(_tvb, _layout, _numVertices, _tib, _numIndices, _index32);
+}
+extern fn bgfx_alloc_transient_buffers(_tvb: [*c]TransientVertexBuffer, _layout: [*c]const VertexLayout, _numVertices: u32, _tib: [*c]TransientIndexBuffer, _numIndices: u32, _index32: bool) bool;
+
+/// Allocate instance data buffer.
+/// <param name="_idb">InstanceDataBuffer structure will be filled, and will be valid for duration of frame, and can be reused for multiple draw calls.</param>
+/// <param name="_num">Number of instances.</param>
+/// <param name="_stride">Instance stride. Must be multiple of 16.</param>
+pub inline fn allocInstanceDataBuffer(_idb: [*c]InstanceDataBuffer, _num: u32, _stride: u16) void {
+ return bgfx_alloc_instance_data_buffer(_idb, _num, _stride);
+}
+extern fn bgfx_alloc_instance_data_buffer(_idb: [*c]InstanceDataBuffer, _num: u32, _stride: u16) void;
+
+/// Create draw indirect buffer.
+/// <param name="_num">Number of indirect calls.</param>
+pub inline fn createIndirectBuffer(_num: u32) IndirectBufferHandle {
+ return bgfx_create_indirect_buffer(_num);
+}
+extern fn bgfx_create_indirect_buffer(_num: u32) IndirectBufferHandle;
+
+/// Destroy draw indirect buffer.
+/// <param name="_handle">Indirect buffer handle.</param>
+pub inline fn destroyIndirectBuffer(_handle: IndirectBufferHandle) void {
+ return bgfx_destroy_indirect_buffer(_handle);
+}
+extern fn bgfx_destroy_indirect_buffer(_handle: IndirectBufferHandle) void;
+
+/// Create shader from memory buffer.
+/// <param name="_mem">Shader binary.</param>
+pub inline fn createShader(_mem: [*c]const Memory) ShaderHandle {
+ return bgfx_create_shader(_mem);
+}
+extern fn bgfx_create_shader(_mem: [*c]const Memory) ShaderHandle;
+
+/// Returns the number of uniforms and uniform handles used inside a shader.
+/// @remarks
+/// Only non-predefined uniforms are returned.
+/// <param name="_handle">Shader handle.</param>
+/// <param name="_uniforms">UniformHandle array where data will be stored.</param>
+/// <param name="_max">Maximum capacity of array.</param>
+pub inline fn getShaderUniforms(_handle: ShaderHandle, _uniforms: [*c]UniformHandle, _max: u16) u16 {
+ return bgfx_get_shader_uniforms(_handle, _uniforms, _max);
+}
+extern fn bgfx_get_shader_uniforms(_handle: ShaderHandle, _uniforms: [*c]UniformHandle, _max: u16) u16;
+
+/// Set shader debug name.
+/// <param name="_handle">Shader handle.</param>
+/// <param name="_name">Shader name.</param>
+/// <param name="_len">Shader name length (if length is INT32_MAX, it's expected that _name is zero terminated string).</param>
+pub inline fn setShaderName(_handle: ShaderHandle, _name: [*c]const u8, _len: i32) void {
+ return bgfx_set_shader_name(_handle, _name, _len);
+}
+extern fn bgfx_set_shader_name(_handle: ShaderHandle, _name: [*c]const u8, _len: i32) void;
+
+/// Destroy shader.
+/// @remark Once a shader program is created with _handle,
+/// it is safe to destroy that shader.
+/// <param name="_handle">Shader handle.</param>
+pub inline fn destroyShader(_handle: ShaderHandle) void {
+ return bgfx_destroy_shader(_handle);
+}
+extern fn bgfx_destroy_shader(_handle: ShaderHandle) void;
+
+/// Create program with vertex and fragment shaders.
+/// <param name="_vsh">Vertex shader.</param>
+/// <param name="_fsh">Fragment shader.</param>
+/// <param name="_destroyShaders">If true, shaders will be destroyed when program is destroyed.</param>
+pub inline fn createProgram(_vsh: ShaderHandle, _fsh: ShaderHandle, _destroyShaders: bool) ProgramHandle {
+ return bgfx_create_program(_vsh, _fsh, _destroyShaders);
+}
+extern fn bgfx_create_program(_vsh: ShaderHandle, _fsh: ShaderHandle, _destroyShaders: bool) ProgramHandle;
+
+/// Create program with compute shader.
+/// <param name="_csh">Compute shader.</param>
+/// <param name="_destroyShaders">If true, shaders will be destroyed when program is destroyed.</param>
+pub inline fn createComputeProgram(_csh: ShaderHandle, _destroyShaders: bool) ProgramHandle {
+ return bgfx_create_compute_program(_csh, _destroyShaders);
+}
+extern fn bgfx_create_compute_program(_csh: ShaderHandle, _destroyShaders: bool) ProgramHandle;
+
+/// Destroy program.
+/// <param name="_handle">Program handle.</param>
+pub inline fn destroyProgram(_handle: ProgramHandle) void {
+ return bgfx_destroy_program(_handle);
+}
+extern fn bgfx_destroy_program(_handle: ProgramHandle) void;
+
+/// Validate texture parameters.
+/// <param name="_depth">Depth dimension of volume texture.</param>
+/// <param name="_cubeMap">Indicates that texture contains cubemap.</param>
+/// <param name="_numLayers">Number of layers in texture array.</param>
+/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
+/// <param name="_flags">Texture flags. See `BGFX_TEXTURE_*`.</param>
+pub inline fn isTextureValid(_depth: u16, _cubeMap: bool, _numLayers: u16, _format: TextureFormat, _flags: u64) bool {
+ return bgfx_is_texture_valid(_depth, _cubeMap, _numLayers, _format, _flags);
+}
+extern fn bgfx_is_texture_valid(_depth: u16, _cubeMap: bool, _numLayers: u16, _format: TextureFormat, _flags: u64) bool;
+
+/// Validate frame buffer parameters.
+/// <param name="_num">Number of attachments.</param>
+/// <param name="_attachment">Attachment texture info. See: `bgfx::Attachment`.</param>
+pub inline fn isFrameBufferValid(_num: u8, _attachment: [*c]const Attachment) bool {
+ return bgfx_is_frame_buffer_valid(_num, _attachment);
+}
+extern fn bgfx_is_frame_buffer_valid(_num: u8, _attachment: [*c]const Attachment) bool;
+
+/// Calculate amount of memory required for texture.
+/// <param name="_info">Resulting texture info structure. See: `TextureInfo`.</param>
+/// <param name="_width">Width.</param>
+/// <param name="_height">Height.</param>
+/// <param name="_depth">Depth dimension of volume texture.</param>
+/// <param name="_cubeMap">Indicates that texture contains cubemap.</param>
+/// <param name="_hasMips">Indicates that texture contains full mip-map chain.</param>
+/// <param name="_numLayers">Number of layers in texture array.</param>
+/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
+pub inline fn calcTextureSize(_info: [*c]TextureInfo, _width: u16, _height: u16, _depth: u16, _cubeMap: bool, _hasMips: bool, _numLayers: u16, _format: TextureFormat) void {
+ return bgfx_calc_texture_size(_info, _width, _height, _depth, _cubeMap, _hasMips, _numLayers, _format);
+}
+extern fn bgfx_calc_texture_size(_info: [*c]TextureInfo, _width: u16, _height: u16, _depth: u16, _cubeMap: bool, _hasMips: bool, _numLayers: u16, _format: TextureFormat) void;
+
+/// Create texture from memory buffer.
+/// <param name="_mem">DDS, KTX or PVR texture binary data.</param>
+/// <param name="_flags">Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.</param>
+/// <param name="_skip">Skip top level mips when parsing texture.</param>
+/// <param name="_info">When non-`NULL` is specified it returns parsed texture information.</param>
+pub inline fn createTexture(_mem: [*c]const Memory, _flags: u64, _skip: u8, _info: [*c]TextureInfo) TextureHandle {
+ return bgfx_create_texture(_mem, _flags, _skip, _info);
+}
+extern fn bgfx_create_texture(_mem: [*c]const Memory, _flags: u64, _skip: u8, _info: [*c]TextureInfo) TextureHandle;
+
+/// Create 2D texture.
+/// <param name="_width">Width.</param>
+/// <param name="_height">Height.</param>
+/// <param name="_hasMips">Indicates that texture contains full mip-map chain.</param>
+/// <param name="_numLayers">Number of layers in texture array. Must be 1 if caps `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.</param>
+/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
+/// <param name="_flags">Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.</param>
+/// <param name="_mem">Texture data. If `_mem` is non-NULL, created texture will be immutable. If `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than 1, expected memory layout is texture and all mips together for each array element.</param>
+pub inline fn createTexture2D(_width: u16, _height: u16, _hasMips: bool, _numLayers: u16, _format: TextureFormat, _flags: u64, _mem: [*c]const Memory) TextureHandle {
+ return bgfx_create_texture_2d(_width, _height, _hasMips, _numLayers, _format, _flags, _mem);
+}
+extern fn bgfx_create_texture_2d(_width: u16, _height: u16, _hasMips: bool, _numLayers: u16, _format: TextureFormat, _flags: u64, _mem: [*c]const Memory) TextureHandle;
+
+/// Create texture with size based on back-buffer ratio. Texture will maintain ratio
+/// if back buffer resolution changes.
+/// <param name="_ratio">Texture size in respect to back-buffer size. See: `BackbufferRatio::Enum`.</param>
+/// <param name="_hasMips">Indicates that texture contains full mip-map chain.</param>
+/// <param name="_numLayers">Number of layers in texture array. Must be 1 if caps `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.</param>
+/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
+/// <param name="_flags">Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.</param>
+pub inline fn createTexture2DScaled(_ratio: BackbufferRatio, _hasMips: bool, _numLayers: u16, _format: TextureFormat, _flags: u64) TextureHandle {
+ return bgfx_create_texture_2d_scaled(_ratio, _hasMips, _numLayers, _format, _flags);
+}
+extern fn bgfx_create_texture_2d_scaled(_ratio: BackbufferRatio, _hasMips: bool, _numLayers: u16, _format: TextureFormat, _flags: u64) TextureHandle;
+
+/// Create 3D texture.
+/// <param name="_width">Width.</param>
+/// <param name="_height">Height.</param>
+/// <param name="_depth">Depth.</param>
+/// <param name="_hasMips">Indicates that texture contains full mip-map chain.</param>
+/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
+/// <param name="_flags">Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.</param>
+/// <param name="_mem">Texture data. If `_mem` is non-NULL, created texture will be immutable. If `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than 1, expected memory layout is texture and all mips together for each array element.</param>
+pub inline fn createTexture3D(_width: u16, _height: u16, _depth: u16, _hasMips: bool, _format: TextureFormat, _flags: u64, _mem: [*c]const Memory) TextureHandle {
+ return bgfx_create_texture_3d(_width, _height, _depth, _hasMips, _format, _flags, _mem);
+}
+extern fn bgfx_create_texture_3d(_width: u16, _height: u16, _depth: u16, _hasMips: bool, _format: TextureFormat, _flags: u64, _mem: [*c]const Memory) TextureHandle;
+
+/// Create Cube texture.
+/// <param name="_size">Cube side size.</param>
+/// <param name="_hasMips">Indicates that texture contains full mip-map chain.</param>
+/// <param name="_numLayers">Number of layers in texture array. Must be 1 if caps `BGFX_CAPS_TEXTURE_2D_ARRAY` flag is not set.</param>
+/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
+/// <param name="_flags">Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.</param>
+/// <param name="_mem">Texture data. If `_mem` is non-NULL, created texture will be immutable. If `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than 1, expected memory layout is texture and all mips together for each array element.</param>
+pub inline fn createTextureCube(_size: u16, _hasMips: bool, _numLayers: u16, _format: TextureFormat, _flags: u64, _mem: [*c]const Memory) TextureHandle {
+ return bgfx_create_texture_cube(_size, _hasMips, _numLayers, _format, _flags, _mem);
+}
+extern fn bgfx_create_texture_cube(_size: u16, _hasMips: bool, _numLayers: u16, _format: TextureFormat, _flags: u64, _mem: [*c]const Memory) TextureHandle;
+
+/// Update 2D texture.
+/// @attention It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
+/// <param name="_handle">Texture handle.</param>
+/// <param name="_layer">Layer in texture array.</param>
+/// <param name="_mip">Mip level.</param>
+/// <param name="_x">X offset in texture.</param>
+/// <param name="_y">Y offset in texture.</param>
+/// <param name="_width">Width of texture block.</param>
+/// <param name="_height">Height of texture block.</param>
+/// <param name="_mem">Texture update data.</param>
+/// <param name="_pitch">Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width.</param>
+pub inline fn updateTexture2D(_handle: TextureHandle, _layer: u16, _mip: u8, _x: u16, _y: u16, _width: u16, _height: u16, _mem: [*c]const Memory, _pitch: u16) void {
+ return bgfx_update_texture_2d(_handle, _layer, _mip, _x, _y, _width, _height, _mem, _pitch);
+}
+extern fn bgfx_update_texture_2d(_handle: TextureHandle, _layer: u16, _mip: u8, _x: u16, _y: u16, _width: u16, _height: u16, _mem: [*c]const Memory, _pitch: u16) void;
+
+/// Update 3D texture.
+/// @attention It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
+/// <param name="_handle">Texture handle.</param>
+/// <param name="_mip">Mip level.</param>
+/// <param name="_x">X offset in texture.</param>
+/// <param name="_y">Y offset in texture.</param>
+/// <param name="_z">Z offset in texture.</param>
+/// <param name="_width">Width of texture block.</param>
+/// <param name="_height">Height of texture block.</param>
+/// <param name="_depth">Depth of texture block.</param>
+/// <param name="_mem">Texture update data.</param>
+pub inline fn updateTexture3D(_handle: TextureHandle, _mip: u8, _x: u16, _y: u16, _z: u16, _width: u16, _height: u16, _depth: u16, _mem: [*c]const Memory) void {
+ return bgfx_update_texture_3d(_handle, _mip, _x, _y, _z, _width, _height, _depth, _mem);
+}
+extern fn bgfx_update_texture_3d(_handle: TextureHandle, _mip: u8, _x: u16, _y: u16, _z: u16, _width: u16, _height: u16, _depth: u16, _mem: [*c]const Memory) void;
+
+/// Update Cube texture.
+/// @attention It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
+/// <param name="_handle">Texture handle.</param>
+/// <param name="_layer">Layer in texture array.</param>
+/// <param name="_side">Cubemap side `BGFX_CUBE_MAP_<POSITIVE or NEGATIVE>_<X, Y or Z>`, where 0 is +X, 1 is -X, 2 is +Y, 3 is -Y, 4 is +Z, and 5 is -Z. +----------+ |-z 2| | ^ +y | | | | Unfolded cube: | +---->+x | +----------+----------+----------+----------+ |+y 1|+y 4|+y 0|+y 5| | ^ -x | ^ +z | ^ +x | ^ -z | | | | | | | | | | | +---->+z | +---->+x | +---->-z | +---->-x | +----------+----------+----------+----------+ |+z 3| | ^ -y | | | | | +---->+x | +----------+</param>
+/// <param name="_mip">Mip level.</param>
+/// <param name="_x">X offset in texture.</param>
+/// <param name="_y">Y offset in texture.</param>
+/// <param name="_width">Width of texture block.</param>
+/// <param name="_height">Height of texture block.</param>
+/// <param name="_mem">Texture update data.</param>
+/// <param name="_pitch">Pitch of input image (bytes). When _pitch is set to UINT16_MAX, it will be calculated internally based on _width.</param>
+pub inline fn updateTextureCube(_handle: TextureHandle, _layer: u16, _side: u8, _mip: u8, _x: u16, _y: u16, _width: u16, _height: u16, _mem: [*c]const Memory, _pitch: u16) void {
+ return bgfx_update_texture_cube(_handle, _layer, _side, _mip, _x, _y, _width, _height, _mem, _pitch);
+}
+extern fn bgfx_update_texture_cube(_handle: TextureHandle, _layer: u16, _side: u8, _mip: u8, _x: u16, _y: u16, _width: u16, _height: u16, _mem: [*c]const Memory, _pitch: u16) void;
+
+/// Read back texture content.
+/// @attention Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
+/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
+/// <param name="_handle">Texture handle.</param>
+/// <param name="_data">Destination buffer.</param>
+/// <param name="_mip">Mip level.</param>
+pub inline fn readTexture(_handle: TextureHandle, _data: ?*anyopaque, _mip: u8) u32 {
+ return bgfx_read_texture(_handle, _data, _mip);
+}
+extern fn bgfx_read_texture(_handle: TextureHandle, _data: ?*anyopaque, _mip: u8) u32;
+
+/// Set texture debug name.
+/// <param name="_handle">Texture handle.</param>
+/// <param name="_name">Texture name.</param>
+/// <param name="_len">Texture name length (if length is INT32_MAX, it's expected that _name is zero terminated string.</param>
+pub inline fn setTextureName(_handle: TextureHandle, _name: [*c]const u8, _len: i32) void {
+ return bgfx_set_texture_name(_handle, _name, _len);
+}
+extern fn bgfx_set_texture_name(_handle: TextureHandle, _name: [*c]const u8, _len: i32) void;
+
+/// Returns texture direct access pointer.
+/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_DIRECT_ACCESS`. This feature
+/// is available on GPUs that have unified memory architecture (UMA) support.
+/// <param name="_handle">Texture handle.</param>
+pub inline fn getDirectAccessPtr(_handle: TextureHandle) ?*anyopaque {
+ return bgfx_get_direct_access_ptr(_handle);
+}
+extern fn bgfx_get_direct_access_ptr(_handle: TextureHandle) ?*anyopaque;
+
+/// Destroy texture.
+/// <param name="_handle">Texture handle.</param>
+pub inline fn destroyTexture(_handle: TextureHandle) void {
+ return bgfx_destroy_texture(_handle);
+}
+extern fn bgfx_destroy_texture(_handle: TextureHandle) void;
+
+/// Create frame buffer (simple).
+/// <param name="_width">Texture width.</param>
+/// <param name="_height">Texture height.</param>
+/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
+/// <param name="_textureFlags">Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.</param>
+pub inline fn createFrameBuffer(_width: u16, _height: u16, _format: TextureFormat, _textureFlags: u64) FrameBufferHandle {
+ return bgfx_create_frame_buffer(_width, _height, _format, _textureFlags);
+}
+extern fn bgfx_create_frame_buffer(_width: u16, _height: u16, _format: TextureFormat, _textureFlags: u64) FrameBufferHandle;
+
+/// Create frame buffer with size based on back-buffer ratio. Frame buffer will maintain ratio
+/// if back buffer resolution changes.
+/// <param name="_ratio">Frame buffer size in respect to back-buffer size. See: `BackbufferRatio::Enum`.</param>
+/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
+/// <param name="_textureFlags">Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.</param>
+pub inline fn createFrameBufferScaled(_ratio: BackbufferRatio, _format: TextureFormat, _textureFlags: u64) FrameBufferHandle {
+ return bgfx_create_frame_buffer_scaled(_ratio, _format, _textureFlags);
+}
+extern fn bgfx_create_frame_buffer_scaled(_ratio: BackbufferRatio, _format: TextureFormat, _textureFlags: u64) FrameBufferHandle;
+
+/// Create MRT frame buffer from texture handles (simple).
+/// <param name="_num">Number of texture handles.</param>
+/// <param name="_handles">Texture attachments.</param>
+/// <param name="_destroyTexture">If true, textures will be destroyed when frame buffer is destroyed.</param>
+pub inline fn createFrameBufferFromHandles(_num: u8, _handles: [*c]const TextureHandle, _destroyTexture: bool) FrameBufferHandle {
+ return bgfx_create_frame_buffer_from_handles(_num, _handles, _destroyTexture);
+}
+extern fn bgfx_create_frame_buffer_from_handles(_num: u8, _handles: [*c]const TextureHandle, _destroyTexture: bool) FrameBufferHandle;
+
+/// Create MRT frame buffer from texture handles with specific layer and
+/// mip level.
+/// <param name="_num">Number of attachments.</param>
+/// <param name="_attachment">Attachment texture info. See: `bgfx::Attachment`.</param>
+/// <param name="_destroyTexture">If true, textures will be destroyed when frame buffer is destroyed.</param>
+pub inline fn createFrameBufferFromAttachment(_num: u8, _attachment: [*c]const Attachment, _destroyTexture: bool) FrameBufferHandle {
+ return bgfx_create_frame_buffer_from_attachment(_num, _attachment, _destroyTexture);
+}
+extern fn bgfx_create_frame_buffer_from_attachment(_num: u8, _attachment: [*c]const Attachment, _destroyTexture: bool) FrameBufferHandle;
+
+/// Create frame buffer for multiple window rendering.
+/// @remarks
+/// Frame buffer cannot be used for sampling.
+/// @attention Availability depends on: `BGFX_CAPS_SWAP_CHAIN`.
+/// <param name="_nwh">OS' target native window handle.</param>
+/// <param name="_width">Window back buffer width.</param>
+/// <param name="_height">Window back buffer height.</param>
+/// <param name="_format">Window back buffer color format.</param>
+/// <param name="_depthFormat">Window back buffer depth format.</param>
+pub inline fn createFrameBufferFromNwh(_nwh: ?*anyopaque, _width: u16, _height: u16, _format: TextureFormat, _depthFormat: TextureFormat) FrameBufferHandle {
+ return bgfx_create_frame_buffer_from_nwh(_nwh, _width, _height, _format, _depthFormat);
+}
+extern fn bgfx_create_frame_buffer_from_nwh(_nwh: ?*anyopaque, _width: u16, _height: u16, _format: TextureFormat, _depthFormat: TextureFormat) FrameBufferHandle;
+
+/// Set frame buffer debug name.
+/// <param name="_handle">Frame buffer handle.</param>
+/// <param name="_name">Frame buffer name.</param>
+/// <param name="_len">Frame buffer name length (if length is INT32_MAX, it's expected that _name is zero terminated string.</param>
+pub inline fn setFrameBufferName(_handle: FrameBufferHandle, _name: [*c]const u8, _len: i32) void {
+ return bgfx_set_frame_buffer_name(_handle, _name, _len);
+}
+extern fn bgfx_set_frame_buffer_name(_handle: FrameBufferHandle, _name: [*c]const u8, _len: i32) void;
+
+/// Obtain texture handle of frame buffer attachment.
+/// <param name="_handle">Frame buffer handle.</param>
+pub inline fn getTexture(_handle: FrameBufferHandle, _attachment: u8) TextureHandle {
+ return bgfx_get_texture(_handle, _attachment);
+}
+extern fn bgfx_get_texture(_handle: FrameBufferHandle, _attachment: u8) TextureHandle;
+
+/// Destroy frame buffer.
+/// <param name="_handle">Frame buffer handle.</param>
+pub inline fn destroyFrameBuffer(_handle: FrameBufferHandle) void {
+ return bgfx_destroy_frame_buffer(_handle);
+}
+extern fn bgfx_destroy_frame_buffer(_handle: FrameBufferHandle) void;
+
+/// Create shader uniform parameter.
+/// @remarks
+/// 1. Uniform names are unique. It's valid to call `bgfx::createUniform`
+/// multiple times with the same uniform name. The library will always
+/// return the same handle, but the handle reference count will be
+/// incremented. This means that the same number of `bgfx::destroyUniform`
+/// must be called to properly destroy the uniform.
+/// 2. Predefined uniforms (declared in `bgfx_shader.sh`):
+/// - `u_viewRect vec4(x, y, width, height)` - view rectangle for current
+/// view, in pixels.
+/// - `u_viewTexel vec4(1.0/width, 1.0/height, undef, undef)` - inverse
+/// width and height
+/// - `u_view mat4` - view matrix
+/// - `u_invView mat4` - inverted view matrix
+/// - `u_proj mat4` - projection matrix
+/// - `u_invProj mat4` - inverted projection matrix
+/// - `u_viewProj mat4` - concatenated view projection matrix
+/// - `u_invViewProj mat4` - concatenated inverted view projection matrix
+/// - `u_model mat4[BGFX_CONFIG_MAX_BONES]` - array of model matrices.
+/// - `u_modelView mat4` - concatenated model view matrix, only first
+/// model matrix from array is used.
+/// - `u_modelViewProj mat4` - concatenated model view projection matrix.
+/// - `u_alphaRef float` - alpha reference value for alpha test.
+/// <param name="_name">Uniform name in shader.</param>
+/// <param name="_type">Type of uniform (See: `bgfx::UniformType`).</param>
+/// <param name="_num">Number of elements in array.</param>
+pub inline fn createUniform(_name: [*c]const u8, _type: UniformType, _num: u16) UniformHandle {
+ return bgfx_create_uniform(_name, _type, _num);
+}
+extern fn bgfx_create_uniform(_name: [*c]const u8, _type: UniformType, _num: u16) UniformHandle;
+
+/// Retrieve uniform info.
+/// <param name="_handle">Handle to uniform object.</param>
+/// <param name="_info">Uniform info.</param>
+pub inline fn getUniformInfo(_handle: UniformHandle, _info: [*c]UniformInfo) void {
+ return bgfx_get_uniform_info(_handle, _info);
+}
+extern fn bgfx_get_uniform_info(_handle: UniformHandle, _info: [*c]UniformInfo) void;
+
+/// Destroy shader uniform parameter.
+/// <param name="_handle">Handle to uniform object.</param>
+pub inline fn destroyUniform(_handle: UniformHandle) void {
+ return bgfx_destroy_uniform(_handle);
+}
+extern fn bgfx_destroy_uniform(_handle: UniformHandle) void;
+
+/// Create occlusion query.
+pub inline fn createOcclusionQuery() OcclusionQueryHandle {
+ return bgfx_create_occlusion_query();
+}
+extern fn bgfx_create_occlusion_query() OcclusionQueryHandle;
+
+/// Retrieve occlusion query result from previous frame.
+/// <param name="_handle">Handle to occlusion query object.</param>
+/// <param name="_result">Number of pixels that passed test. This argument can be `NULL` if result of occlusion query is not needed.</param>
+pub inline fn getResult(_handle: OcclusionQueryHandle, _result: [*c]i32) OcclusionQueryResult {
+ return bgfx_get_result(_handle, _result);
+}
+extern fn bgfx_get_result(_handle: OcclusionQueryHandle, _result: [*c]i32) OcclusionQueryResult;
+
+/// Destroy occlusion query.
+/// <param name="_handle">Handle to occlusion query object.</param>
+pub inline fn destroyOcclusionQuery(_handle: OcclusionQueryHandle) void {
+ return bgfx_destroy_occlusion_query(_handle);
+}
+extern fn bgfx_destroy_occlusion_query(_handle: OcclusionQueryHandle) void;
+
+/// Set palette color value.
+/// <param name="_index">Index into palette.</param>
+/// <param name="_rgba">RGBA floating point values.</param>
+pub inline fn setPaletteColor(_index: u8, _rgba: [4]f32) void {
+ return bgfx_set_palette_color(_index, _rgba);
+}
+extern fn bgfx_set_palette_color(_index: u8, _rgba: [4]f32) void;
+
+/// Set palette color value.
+/// <param name="_index">Index into palette.</param>
+/// <param name="_rgba">Packed 32-bit RGBA value.</param>
+pub inline fn setPaletteColorRgba8(_index: u8, _rgba: u32) void {
+ return bgfx_set_palette_color_rgba8(_index, _rgba);
+}
+extern fn bgfx_set_palette_color_rgba8(_index: u8, _rgba: u32) void;
+
+/// Set view name.
+/// @remarks
+/// This is debug only feature.
+/// In graphics debugger view name will appear as:
+/// "nnnc <view name>"
+/// ^ ^ ^
+/// | +--- compute (C)
+/// +------ view id
+/// <param name="_id">View id.</param>
+/// <param name="_name">View name.</param>
+pub inline fn setViewName(_id: ViewId, _name: [*c]const u8) void {
+ return bgfx_set_view_name(_id, _name);
+}
+extern fn bgfx_set_view_name(_id: ViewId, _name: [*c]const u8) void;
+
+/// Set view rectangle. Draw primitive outside view will be clipped.
+/// <param name="_id">View id.</param>
+/// <param name="_x">Position x from the left corner of the window.</param>
+/// <param name="_y">Position y from the top corner of the window.</param>
+/// <param name="_width">Width of view port region.</param>
+/// <param name="_height">Height of view port region.</param>
+pub inline fn setViewRect(_id: ViewId, _x: u16, _y: u16, _width: u16, _height: u16) void {
+ return bgfx_set_view_rect(_id, _x, _y, _width, _height);
+}
+extern fn bgfx_set_view_rect(_id: ViewId, _x: u16, _y: u16, _width: u16, _height: u16) void;
+
+/// Set view rectangle. Draw primitive outside view will be clipped.
+/// <param name="_id">View id.</param>
+/// <param name="_x">Position x from the left corner of the window.</param>
+/// <param name="_y">Position y from the top corner of the window.</param>
+/// <param name="_ratio">Width and height will be set in respect to back-buffer size. See: `BackbufferRatio::Enum`.</param>
+pub inline fn setViewRectRatio(_id: ViewId, _x: u16, _y: u16, _ratio: BackbufferRatio) void {
+ return bgfx_set_view_rect_ratio(_id, _x, _y, _ratio);
+}
+extern fn bgfx_set_view_rect_ratio(_id: ViewId, _x: u16, _y: u16, _ratio: BackbufferRatio) void;
+
+/// Set view scissor. Draw primitive outside view will be clipped. When
+/// _x, _y, _width and _height are set to 0, scissor will be disabled.
+/// <param name="_id">View id.</param>
+/// <param name="_x">Position x from the left corner of the window.</param>
+/// <param name="_y">Position y from the top corner of the window.</param>
+/// <param name="_width">Width of view scissor region.</param>
+/// <param name="_height">Height of view scissor region.</param>
+pub inline fn setViewScissor(_id: ViewId, _x: u16, _y: u16, _width: u16, _height: u16) void {
+ return bgfx_set_view_scissor(_id, _x, _y, _width, _height);
+}
+extern fn bgfx_set_view_scissor(_id: ViewId, _x: u16, _y: u16, _width: u16, _height: u16) void;
+
+/// Set view clear flags.
+/// <param name="_id">View id.</param>
+/// <param name="_flags">Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear operation. See: `BGFX_CLEAR_*`.</param>
+/// <param name="_rgba">Color clear value.</param>
+/// <param name="_depth">Depth clear value.</param>
+/// <param name="_stencil">Stencil clear value.</param>
+pub inline fn setViewClear(_id: ViewId, _flags: u16, _rgba: u32, _depth: f32, _stencil: u8) void {
+ return bgfx_set_view_clear(_id, _flags, _rgba, _depth, _stencil);
+}
+extern fn bgfx_set_view_clear(_id: ViewId, _flags: u16, _rgba: u32, _depth: f32, _stencil: u8) void;
+
+/// Set view clear flags with different clear color for each
+/// frame buffer texture. `bgfx::setPaletteColor` must be used to set up a
+/// clear color palette.
+/// <param name="_id">View id.</param>
+/// <param name="_flags">Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear operation. See: `BGFX_CLEAR_*`.</param>
+/// <param name="_depth">Depth clear value.</param>
+/// <param name="_stencil">Stencil clear value.</param>
+/// <param name="_c0">Palette index for frame buffer attachment 0.</param>
+/// <param name="_c1">Palette index for frame buffer attachment 1.</param>
+/// <param name="_c2">Palette index for frame buffer attachment 2.</param>
+/// <param name="_c3">Palette index for frame buffer attachment 3.</param>
+/// <param name="_c4">Palette index for frame buffer attachment 4.</param>
+/// <param name="_c5">Palette index for frame buffer attachment 5.</param>
+/// <param name="_c6">Palette index for frame buffer attachment 6.</param>
+/// <param name="_c7">Palette index for frame buffer attachment 7.</param>
+pub inline fn setViewClearMrt(_id: ViewId, _flags: u16, _depth: f32, _stencil: u8, _c0: u8, _c1: u8, _c2: u8, _c3: u8, _c4: u8, _c5: u8, _c6: u8, _c7: u8) void {
+ return bgfx_set_view_clear_mrt(_id, _flags, _depth, _stencil, _c0, _c1, _c2, _c3, _c4, _c5, _c6, _c7);
+}
+extern fn bgfx_set_view_clear_mrt(_id: ViewId, _flags: u16, _depth: f32, _stencil: u8, _c0: u8, _c1: u8, _c2: u8, _c3: u8, _c4: u8, _c5: u8, _c6: u8, _c7: u8) void;
+
+/// Set view sorting mode.
+/// @remarks
+/// View mode must be set prior calling `bgfx::submit` for the view.
+/// <param name="_id">View id.</param>
+/// <param name="_mode">View sort mode. See `ViewMode::Enum`.</param>
+pub inline fn setViewMode(_id: ViewId, _mode: ViewMode) void {
+ return bgfx_set_view_mode(_id, _mode);
+}
+extern fn bgfx_set_view_mode(_id: ViewId, _mode: ViewMode) void;
+
+/// Set view frame buffer.
+/// @remarks
+/// Not persistent after `bgfx::reset` call.
+/// <param name="_id">View id.</param>
+/// <param name="_handle">Frame buffer handle. Passing `BGFX_INVALID_HANDLE` as frame buffer handle will draw primitives from this view into default back buffer.</param>
+pub inline fn setViewFrameBuffer(_id: ViewId, _handle: FrameBufferHandle) void {
+ return bgfx_set_view_frame_buffer(_id, _handle);
+}
+extern fn bgfx_set_view_frame_buffer(_id: ViewId, _handle: FrameBufferHandle) void;
+
+/// Set view's view matrix and projection matrix,
+/// all draw primitives in this view will use these two matrices.
+/// <param name="_id">View id.</param>
+/// <param name="_view">View matrix.</param>
+/// <param name="_proj">Projection matrix.</param>
+pub inline fn setViewTransform(_id: ViewId, _view: ?*const anyopaque, _proj: ?*const anyopaque) void {
+ return bgfx_set_view_transform(_id, _view, _proj);
+}
+extern fn bgfx_set_view_transform(_id: ViewId, _view: ?*const anyopaque, _proj: ?*const anyopaque) void;
+
+/// Post submit view reordering.
+/// <param name="_id">First view id.</param>
+/// <param name="_num">Number of views to remap.</param>
+/// <param name="_order">View remap id table. Passing `NULL` will reset view ids to default state.</param>
+pub inline fn setViewOrder(_id: ViewId, _num: u16, _order: [*c]const ViewId) void {
+ return bgfx_set_view_order(_id, _num, _order);
+}
+extern fn bgfx_set_view_order(_id: ViewId, _num: u16, _order: [*c]const ViewId) void;
+
+/// Reset all view settings to default.
+pub inline fn resetView(_id: ViewId) void {
+ return bgfx_reset_view(_id);
+}
+extern fn bgfx_reset_view(_id: ViewId) void;
+
+/// Begin submitting draw calls from thread.
+/// <param name="_forThread">Explicitly request an encoder for a worker thread.</param>
+pub inline fn encoderBegin(_forThread: bool) ?*Encoder {
+ return bgfx_encoder_begin(_forThread);
+}
+extern fn bgfx_encoder_begin(_forThread: bool) ?*Encoder;
+
+/// End submitting draw calls from thread.
+/// <param name="_encoder">Encoder.</param>
+pub inline fn encoderEnd(_encoder: ?*Encoder) void {
+ return bgfx_encoder_end(_encoder);
+}
+extern fn bgfx_encoder_end(_encoder: ?*Encoder) void;
+
+/// Sets a debug marker. This allows you to group graphics calls together for easy browsing in
+/// graphics debugging tools.
+/// <param name="_marker">Marker string.</param>
+extern fn bgfx_encoder_set_marker(self: ?*Encoder, _marker: [*c]const u8) void;
+
+/// Set render states for draw primitive.
+/// @remarks
+/// 1. To set up more complex states use:
+/// `BGFX_STATE_ALPHA_REF(_ref)`,
+/// `BGFX_STATE_POINT_SIZE(_size)`,
+/// `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
+/// `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
+/// `BGFX_STATE_BLEND_EQUATION(_equation)`,
+/// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
+/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
+/// equation is specified.
+/// <param name="_state">State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.</param>
+/// <param name="_rgba">Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes.</param>
+extern fn bgfx_encoder_set_state(self: ?*Encoder, _state: u64, _rgba: u32) void;
+
+/// Set condition for rendering.
+/// <param name="_handle">Occlusion query handle.</param>
+/// <param name="_visible">Render if occlusion query is visible.</param>
+extern fn bgfx_encoder_set_condition(self: ?*Encoder, _handle: OcclusionQueryHandle, _visible: bool) void;
+
+/// Set stencil test state.
+/// <param name="_fstencil">Front stencil state.</param>
+/// <param name="_bstencil">Back stencil state. If back is set to `BGFX_STENCIL_NONE` _fstencil is applied to both front and back facing primitives.</param>
+extern fn bgfx_encoder_set_stencil(self: ?*Encoder, _fstencil: u32, _bstencil: u32) void;
+
+/// Set scissor for draw primitive.
+/// @remark
+/// To scissor for all primitives in view see `bgfx::setViewScissor`.
+/// <param name="_x">Position x from the left corner of the window.</param>
+/// <param name="_y">Position y from the top corner of the window.</param>
+/// <param name="_width">Width of view scissor region.</param>
+/// <param name="_height">Height of view scissor region.</param>
+extern fn bgfx_encoder_set_scissor(self: ?*Encoder, _x: u16, _y: u16, _width: u16, _height: u16) u16;
+
+/// Set scissor from cache for draw primitive.
+/// @remark
+/// To scissor for all primitives in view see `bgfx::setViewScissor`.
+/// <param name="_cache">Index in scissor cache.</param>
+extern fn bgfx_encoder_set_scissor_cached(self: ?*Encoder, _cache: u16) void;
+
+/// Set model matrix for draw primitive. If it is not called,
+/// the model will be rendered with an identity model matrix.
+/// <param name="_mtx">Pointer to first matrix in array.</param>
+/// <param name="_num">Number of matrices in array.</param>
+extern fn bgfx_encoder_set_transform(self: ?*Encoder, _mtx: ?*const anyopaque, _num: u16) u32;
+
+/// Set model matrix from matrix cache for draw primitive.
+/// <param name="_cache">Index in matrix cache.</param>
+/// <param name="_num">Number of matrices from cache.</param>
+extern fn bgfx_encoder_set_transform_cached(self: ?*Encoder, _cache: u32, _num: u16) void;
+
+/// Reserve matrices in internal matrix cache.
+/// @attention Pointer returned can be modified until `bgfx::frame` is called.
+/// <param name="_transform">Pointer to `Transform` structure.</param>
+/// <param name="_num">Number of matrices.</param>
+extern fn bgfx_encoder_alloc_transform(self: ?*Encoder, _transform: [*c]Transform, _num: u16) u32;
+
+/// Set shader uniform parameter for draw primitive.
+/// <param name="_handle">Uniform.</param>
+/// <param name="_value">Pointer to uniform data.</param>
+/// <param name="_num">Number of elements. Passing `UINT16_MAX` will use the _num passed on uniform creation.</param>
+extern fn bgfx_encoder_set_uniform(self: ?*Encoder, _handle: UniformHandle, _value: ?*const anyopaque, _num: u16) void;
+
+/// Set index buffer for draw primitive.
+/// <param name="_handle">Index buffer.</param>
+/// <param name="_firstIndex">First index to render.</param>
+/// <param name="_numIndices">Number of indices to render.</param>
+extern fn bgfx_encoder_set_index_buffer(self: ?*Encoder, _handle: IndexBufferHandle, _firstIndex: u32, _numIndices: u32) void;
+
+/// Set index buffer for draw primitive.
+/// <param name="_handle">Dynamic index buffer.</param>
+/// <param name="_firstIndex">First index to render.</param>
+/// <param name="_numIndices">Number of indices to render.</param>
+extern fn bgfx_encoder_set_dynamic_index_buffer(self: ?*Encoder, _handle: DynamicIndexBufferHandle, _firstIndex: u32, _numIndices: u32) void;
+
+/// Set index buffer for draw primitive.
+/// <param name="_tib">Transient index buffer.</param>
+/// <param name="_firstIndex">First index to render.</param>
+/// <param name="_numIndices">Number of indices to render.</param>
+extern fn bgfx_encoder_set_transient_index_buffer(self: ?*Encoder, _tib: [*c]const TransientIndexBuffer, _firstIndex: u32, _numIndices: u32) void;
+
+/// Set vertex buffer for draw primitive.
+/// <param name="_stream">Vertex stream.</param>
+/// <param name="_handle">Vertex buffer.</param>
+/// <param name="_startVertex">First vertex to render.</param>
+/// <param name="_numVertices">Number of vertices to render.</param>
+extern fn bgfx_encoder_set_vertex_buffer(self: ?*Encoder, _stream: u8, _handle: VertexBufferHandle, _startVertex: u32, _numVertices: u32) void;
+
+/// Set vertex buffer for draw primitive.
+/// <param name="_stream">Vertex stream.</param>
+/// <param name="_handle">Vertex buffer.</param>
+/// <param name="_startVertex">First vertex to render.</param>
+/// <param name="_numVertices">Number of vertices to render.</param>
+/// <param name="_layoutHandle">Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.</param>
+extern fn bgfx_encoder_set_vertex_buffer_with_layout(self: ?*Encoder, _stream: u8, _handle: VertexBufferHandle, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void;
+
+/// Set vertex buffer for draw primitive.
+/// <param name="_stream">Vertex stream.</param>
+/// <param name="_handle">Dynamic vertex buffer.</param>
+/// <param name="_startVertex">First vertex to render.</param>
+/// <param name="_numVertices">Number of vertices to render.</param>
+extern fn bgfx_encoder_set_dynamic_vertex_buffer(self: ?*Encoder, _stream: u8, _handle: DynamicVertexBufferHandle, _startVertex: u32, _numVertices: u32) void;
+
+extern fn bgfx_encoder_set_dynamic_vertex_buffer_with_layout(self: ?*Encoder, _stream: u8, _handle: DynamicVertexBufferHandle, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void;
+
+/// Set vertex buffer for draw primitive.
+/// <param name="_stream">Vertex stream.</param>
+/// <param name="_tvb">Transient vertex buffer.</param>
+/// <param name="_startVertex">First vertex to render.</param>
+/// <param name="_numVertices">Number of vertices to render.</param>
+extern fn bgfx_encoder_set_transient_vertex_buffer(self: ?*Encoder, _stream: u8, _tvb: [*c]const TransientVertexBuffer, _startVertex: u32, _numVertices: u32) void;
+
+/// Set vertex buffer for draw primitive.
+/// <param name="_stream">Vertex stream.</param>
+/// <param name="_tvb">Transient vertex buffer.</param>
+/// <param name="_startVertex">First vertex to render.</param>
+/// <param name="_numVertices">Number of vertices to render.</param>
+/// <param name="_layoutHandle">Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.</param>
+extern fn bgfx_encoder_set_transient_vertex_buffer_with_layout(self: ?*Encoder, _stream: u8, _tvb: [*c]const TransientVertexBuffer, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void;
+
+/// Set number of vertices for auto generated vertices use in conjunction
+/// with gl_VertexID.
+/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+/// <param name="_numVertices">Number of vertices.</param>
+extern fn bgfx_encoder_set_vertex_count(self: ?*Encoder, _numVertices: u32) void;
+
+/// Set instance data buffer for draw primitive.
+/// <param name="_idb">Transient instance data buffer.</param>
+/// <param name="_start">First instance data.</param>
+/// <param name="_num">Number of data instances.</param>
+extern fn bgfx_encoder_set_instance_data_buffer(self: ?*Encoder, _idb: [*c]const InstanceDataBuffer, _start: u32, _num: u32) void;
+
+/// Set instance data buffer for draw primitive.
+/// <param name="_handle">Vertex buffer.</param>
+/// <param name="_startVertex">First instance data.</param>
+/// <param name="_num">Number of data instances. Set instance data buffer for draw primitive.</param>
+extern fn bgfx_encoder_set_instance_data_from_vertex_buffer(self: ?*Encoder, _handle: VertexBufferHandle, _startVertex: u32, _num: u32) void;
+
+/// Set instance data buffer for draw primitive.
+/// <param name="_handle">Dynamic vertex buffer.</param>
+/// <param name="_startVertex">First instance data.</param>
+/// <param name="_num">Number of data instances.</param>
+extern fn bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer(self: ?*Encoder, _handle: DynamicVertexBufferHandle, _startVertex: u32, _num: u32) void;
+
+/// Set number of instances for auto generated instances use in conjunction
+/// with gl_InstanceID.
+/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+extern fn bgfx_encoder_set_instance_count(self: ?*Encoder, _numInstances: u32) void;
+
+/// Set texture stage for draw primitive.
+/// <param name="_stage">Texture unit.</param>
+/// <param name="_sampler">Program sampler.</param>
+/// <param name="_handle">Texture handle.</param>
+/// <param name="_flags">Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.</param>
+extern fn bgfx_encoder_set_texture(self: ?*Encoder, _stage: u8, _sampler: UniformHandle, _handle: TextureHandle, _flags: u32) void;
+
+/// Submit an empty primitive for rendering. Uniforms and draw state
+/// will be applied but no geometry will be submitted. Useful in cases
+/// when no other draw/compute primitive is submitted to view, but it's
+/// desired to execute clear view.
+/// @remark
+/// These empty draw calls will sort before ordinary draw calls.
+/// <param name="_id">View id.</param>
+extern fn bgfx_encoder_touch(self: ?*Encoder, _id: ViewId) void;
+
+/// Submit primitive for rendering.
+/// <param name="_id">View id.</param>
+/// <param name="_program">Program.</param>
+/// <param name="_depth">Depth for sorting.</param>
+/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+extern fn bgfx_encoder_submit(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _depth: u32, _flags: u8) void;
+
+/// Submit primitive with occlusion query for rendering.
+/// <param name="_id">View id.</param>
+/// <param name="_program">Program.</param>
+/// <param name="_occlusionQuery">Occlusion query.</param>
+/// <param name="_depth">Depth for sorting.</param>
+/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+extern fn bgfx_encoder_submit_occlusion_query(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _occlusionQuery: OcclusionQueryHandle, _depth: u32, _flags: u8) void;
+
+/// Submit primitive for rendering with index and instance data info from
+/// indirect buffer.
+/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
+/// <param name="_id">View id.</param>
+/// <param name="_program">Program.</param>
+/// <param name="_indirectHandle">Indirect buffer.</param>
+/// <param name="_start">First element in indirect buffer.</param>
+/// <param name="_num">Number of draws.</param>
+/// <param name="_depth">Depth for sorting.</param>
+/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+extern fn bgfx_encoder_submit_indirect(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _depth: u32, _flags: u8) void;
+
+/// Submit primitive for rendering with index and instance data info and
+/// draw count from indirect buffers.
+/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+/// <param name="_id">View id.</param>
+/// <param name="_program">Program.</param>
+/// <param name="_indirectHandle">Indirect buffer.</param>
+/// <param name="_start">First element in indirect buffer.</param>
+/// <param name="_numHandle">Buffer for number of draws. Must be created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.</param>
+/// <param name="_numIndex">Element in number buffer.</param>
+/// <param name="_numMax">Max number of draws.</param>
+/// <param name="_depth">Depth for sorting.</param>
+/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+extern fn bgfx_encoder_submit_indirect_count(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u16, _depth: u32, _flags: u8) void;
+
+/// Set compute index buffer.
+/// <param name="_stage">Compute stage.</param>
+/// <param name="_handle">Index buffer handle.</param>
+/// <param name="_access">Buffer access. See `Access::Enum`.</param>
+extern fn bgfx_encoder_set_compute_index_buffer(self: ?*Encoder, _stage: u8, _handle: IndexBufferHandle, _access: Access) void;
+
+/// Set compute vertex buffer.
+/// <param name="_stage">Compute stage.</param>
+/// <param name="_handle">Vertex buffer handle.</param>
+/// <param name="_access">Buffer access. See `Access::Enum`.</param>
+extern fn bgfx_encoder_set_compute_vertex_buffer(self: ?*Encoder, _stage: u8, _handle: VertexBufferHandle, _access: Access) void;
+
+/// Set compute dynamic index buffer.
+/// <param name="_stage">Compute stage.</param>
+/// <param name="_handle">Dynamic index buffer handle.</param>
+/// <param name="_access">Buffer access. See `Access::Enum`.</param>
+extern fn bgfx_encoder_set_compute_dynamic_index_buffer(self: ?*Encoder, _stage: u8, _handle: DynamicIndexBufferHandle, _access: Access) void;
+
+/// Set compute dynamic vertex buffer.
+/// <param name="_stage">Compute stage.</param>
+/// <param name="_handle">Dynamic vertex buffer handle.</param>
+/// <param name="_access">Buffer access. See `Access::Enum`.</param>
+extern fn bgfx_encoder_set_compute_dynamic_vertex_buffer(self: ?*Encoder, _stage: u8, _handle: DynamicVertexBufferHandle, _access: Access) void;
+
+/// Set compute indirect buffer.
+/// <param name="_stage">Compute stage.</param>
+/// <param name="_handle">Indirect buffer handle.</param>
+/// <param name="_access">Buffer access. See `Access::Enum`.</param>
+extern fn bgfx_encoder_set_compute_indirect_buffer(self: ?*Encoder, _stage: u8, _handle: IndirectBufferHandle, _access: Access) void;
+
+/// Set compute image from texture.
+/// <param name="_stage">Compute stage.</param>
+/// <param name="_handle">Texture handle.</param>
+/// <param name="_mip">Mip level.</param>
+/// <param name="_access">Image access. See `Access::Enum`.</param>
+/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
+extern fn bgfx_encoder_set_image(self: ?*Encoder, _stage: u8, _handle: TextureHandle, _mip: u8, _access: Access, _format: TextureFormat) void;
+
+/// Dispatch compute.
+/// <param name="_id">View id.</param>
+/// <param name="_program">Compute program.</param>
+/// <param name="_numX">Number of groups X.</param>
+/// <param name="_numY">Number of groups Y.</param>
+/// <param name="_numZ">Number of groups Z.</param>
+/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+extern fn bgfx_encoder_dispatch(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _numX: u32, _numY: u32, _numZ: u32, _flags: u8) void;
+
+/// Dispatch compute indirect.
+/// <param name="_id">View id.</param>
+/// <param name="_program">Compute program.</param>
+/// <param name="_indirectHandle">Indirect buffer.</param>
+/// <param name="_start">First element in indirect buffer.</param>
+/// <param name="_num">Number of dispatches.</param>
+/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+extern fn bgfx_encoder_dispatch_indirect(self: ?*Encoder, _id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _flags: u8) void;
+
+/// Discard previously set state for draw or compute call.
+/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+extern fn bgfx_encoder_discard(self: ?*Encoder, _flags: u8) void;
+
+/// Blit 2D texture region between two 2D textures.
+/// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
+/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
+/// <param name="_id">View id.</param>
+/// <param name="_dst">Destination texture handle.</param>
+/// <param name="_dstMip">Destination texture mip level.</param>
+/// <param name="_dstX">Destination texture X position.</param>
+/// <param name="_dstY">Destination texture Y position.</param>
+/// <param name="_dstZ">If texture is 2D this argument should be 0. If destination texture is cube this argument represents destination texture cube face. For 3D texture this argument represents destination texture Z position.</param>
+/// <param name="_src">Source texture handle.</param>
+/// <param name="_srcMip">Source texture mip level.</param>
+/// <param name="_srcX">Source texture X position.</param>
+/// <param name="_srcY">Source texture Y position.</param>
+/// <param name="_srcZ">If texture is 2D this argument should be 0. If source texture is cube this argument represents source texture cube face. For 3D texture this argument represents source texture Z position.</param>
+/// <param name="_width">Width of region.</param>
+/// <param name="_height">Height of region.</param>
+/// <param name="_depth">If texture is 3D this argument represents depth of region, otherwise it's unused.</param>
+extern fn bgfx_encoder_blit(self: ?*Encoder, _id: ViewId, _dst: TextureHandle, _dstMip: u8, _dstX: u16, _dstY: u16, _dstZ: u16, _src: TextureHandle, _srcMip: u8, _srcX: u16, _srcY: u16, _srcZ: u16, _width: u16, _height: u16, _depth: u16) void;
+
+/// Request screen shot of window back buffer.
+/// @remarks
+/// `bgfx::CallbackI::screenShot` must be implemented.
+/// @attention Frame buffer handle must be created with OS' target native window handle.
+/// <param name="_handle">Frame buffer handle. If handle is `BGFX_INVALID_HANDLE` request will be made for main window back buffer.</param>
+/// <param name="_filePath">Will be passed to `bgfx::CallbackI::screenShot` callback.</param>
+pub inline fn requestScreenShot(_handle: FrameBufferHandle, _filePath: [*c]const u8) void {
+ return bgfx_request_screen_shot(_handle, _filePath);
+}
+extern fn bgfx_request_screen_shot(_handle: FrameBufferHandle, _filePath: [*c]const u8) void;
+
+/// Render frame.
+/// @attention `bgfx::renderFrame` is blocking call. It waits for
+/// `bgfx::frame` to be called from API thread to process frame.
+/// If timeout value is passed call will timeout and return even
+/// if `bgfx::frame` is not called.
+/// @warning This call should be only used on platforms that don't
+/// allow creating separate rendering thread. If it is called before
+/// to bgfx::init, render thread won't be created by bgfx::init call.
+/// <param name="_msecs">Timeout in milliseconds.</param>
+pub inline fn renderFrame(_msecs: i32) RenderFrame {
+ return bgfx_render_frame(_msecs);
+}
+extern fn bgfx_render_frame(_msecs: i32) RenderFrame;
+
+/// Set platform data.
+/// @warning Must be called before `bgfx::init`.
+/// <param name="_data">Platform data.</param>
+pub inline fn setPlatformData(_data: [*c]const PlatformData) void {
+ return bgfx_set_platform_data(_data);
+}
+extern fn bgfx_set_platform_data(_data: [*c]const PlatformData) void;
+
+/// Get internal data for interop.
+/// @attention It's expected you understand some bgfx internals before you
+/// use this call.
+/// @warning Must be called only on render thread.
+pub inline fn getInternalData() [*c]const InternalData {
+ return bgfx_get_internal_data();
+}
+extern fn bgfx_get_internal_data() [*c]const InternalData;
+
+/// Override internal texture with externally created texture. Previously
+/// created internal texture will released.
+/// @attention It's expected you understand some bgfx internals before you
+/// use this call.
+/// @warning Must be called only on render thread.
+/// <param name="_handle">Texture handle.</param>
+/// <param name="_ptr">Native API pointer to texture.</param>
+pub inline fn overrideInternalTexturePtr(_handle: TextureHandle, _ptr: usize) usize {
+ return bgfx_override_internal_texture_ptr(_handle, _ptr);
+}
+extern fn bgfx_override_internal_texture_ptr(_handle: TextureHandle, _ptr: usize) usize;
+
+/// Override internal texture by creating new texture. Previously created
+/// internal texture will released.
+/// @attention It's expected you understand some bgfx internals before you
+/// use this call.
+/// @returns Native API pointer to texture. If result is 0, texture is not created yet from the
+/// main thread.
+/// @warning Must be called only on render thread.
+/// <param name="_handle">Texture handle.</param>
+/// <param name="_width">Width.</param>
+/// <param name="_height">Height.</param>
+/// <param name="_numMips">Number of mip-maps.</param>
+/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
+/// <param name="_flags">Texture creation (see `BGFX_TEXTURE_*`.), and sampler (see `BGFX_SAMPLER_*`) flags. Default texture sampling mode is linear, and wrap mode is repeat. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.</param>
+pub inline fn overrideInternalTexture(_handle: TextureHandle, _width: u16, _height: u16, _numMips: u8, _format: TextureFormat, _flags: u64) usize {
+ return bgfx_override_internal_texture(_handle, _width, _height, _numMips, _format, _flags);
+}
+extern fn bgfx_override_internal_texture(_handle: TextureHandle, _width: u16, _height: u16, _numMips: u8, _format: TextureFormat, _flags: u64) usize;
+
+/// Sets a debug marker. This allows you to group graphics calls together for easy browsing in
+/// graphics debugging tools.
+/// <param name="_marker">Marker string.</param>
+pub inline fn setMarker(_marker: [*c]const u8) void {
+ return bgfx_set_marker(_marker);
+}
+extern fn bgfx_set_marker(_marker: [*c]const u8) void;
+
+/// Set render states for draw primitive.
+/// @remarks
+/// 1. To set up more complex states use:
+/// `BGFX_STATE_ALPHA_REF(_ref)`,
+/// `BGFX_STATE_POINT_SIZE(_size)`,
+/// `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
+/// `BGFX_STATE_BLEND_FUNC_SEPARATE(_srcRGB, _dstRGB, _srcA, _dstA)`,
+/// `BGFX_STATE_BLEND_EQUATION(_equation)`,
+/// `BGFX_STATE_BLEND_EQUATION_SEPARATE(_equationRGB, _equationA)`
+/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
+/// equation is specified.
+/// <param name="_state">State flags. Default state for primitive type is triangles. See: `BGFX_STATE_DEFAULT`. - `BGFX_STATE_DEPTH_TEST_*` - Depth test function. - `BGFX_STATE_BLEND_*` - See remark 1 about BGFX_STATE_BLEND_FUNC. - `BGFX_STATE_BLEND_EQUATION_*` - See remark 2. - `BGFX_STATE_CULL_*` - Backface culling mode. - `BGFX_STATE_WRITE_*` - Enable R, G, B, A or Z write. - `BGFX_STATE_MSAA` - Enable hardware multisample antialiasing. - `BGFX_STATE_PT_[TRISTRIP/LINES/POINTS]` - Primitive type.</param>
+/// <param name="_rgba">Sets blend factor used by `BGFX_STATE_BLEND_FACTOR` and `BGFX_STATE_BLEND_INV_FACTOR` blend modes.</param>
+pub inline fn setState(_state: u64, _rgba: u32) void {
+ return bgfx_set_state(_state, _rgba);
+}
+extern fn bgfx_set_state(_state: u64, _rgba: u32) void;
+
+/// Set condition for rendering.
+/// <param name="_handle">Occlusion query handle.</param>
+/// <param name="_visible">Render if occlusion query is visible.</param>
+pub inline fn setCondition(_handle: OcclusionQueryHandle, _visible: bool) void {
+ return bgfx_set_condition(_handle, _visible);
+}
+extern fn bgfx_set_condition(_handle: OcclusionQueryHandle, _visible: bool) void;
+
+/// Set stencil test state.
+/// <param name="_fstencil">Front stencil state.</param>
+/// <param name="_bstencil">Back stencil state. If back is set to `BGFX_STENCIL_NONE` _fstencil is applied to both front and back facing primitives.</param>
+pub inline fn setStencil(_fstencil: u32, _bstencil: u32) void {
+ return bgfx_set_stencil(_fstencil, _bstencil);
+}
+extern fn bgfx_set_stencil(_fstencil: u32, _bstencil: u32) void;
+
+/// Set scissor for draw primitive.
+/// @remark
+/// To scissor for all primitives in view see `bgfx::setViewScissor`.
+/// <param name="_x">Position x from the left corner of the window.</param>
+/// <param name="_y">Position y from the top corner of the window.</param>
+/// <param name="_width">Width of view scissor region.</param>
+/// <param name="_height">Height of view scissor region.</param>
+pub inline fn setScissor(_x: u16, _y: u16, _width: u16, _height: u16) u16 {
+ return bgfx_set_scissor(_x, _y, _width, _height);
+}
+extern fn bgfx_set_scissor(_x: u16, _y: u16, _width: u16, _height: u16) u16;
+
+/// Set scissor from cache for draw primitive.
+/// @remark
+/// To scissor for all primitives in view see `bgfx::setViewScissor`.
+/// <param name="_cache">Index in scissor cache.</param>
+pub inline fn setScissorCached(_cache: u16) void {
+ return bgfx_set_scissor_cached(_cache);
+}
+extern fn bgfx_set_scissor_cached(_cache: u16) void;
+
+/// Set model matrix for draw primitive. If it is not called,
+/// the model will be rendered with an identity model matrix.
+/// <param name="_mtx">Pointer to first matrix in array.</param>
+/// <param name="_num">Number of matrices in array.</param>
+pub inline fn setTransform(_mtx: ?*const anyopaque, _num: u16) u32 {
+ return bgfx_set_transform(_mtx, _num);
+}
+extern fn bgfx_set_transform(_mtx: ?*const anyopaque, _num: u16) u32;
+
+/// Set model matrix from matrix cache for draw primitive.
+/// <param name="_cache">Index in matrix cache.</param>
+/// <param name="_num">Number of matrices from cache.</param>
+pub inline fn setTransformCached(_cache: u32, _num: u16) void {
+ return bgfx_set_transform_cached(_cache, _num);
+}
+extern fn bgfx_set_transform_cached(_cache: u32, _num: u16) void;
+
+/// Reserve matrices in internal matrix cache.
+/// @attention Pointer returned can be modified until `bgfx::frame` is called.
+/// <param name="_transform">Pointer to `Transform` structure.</param>
+/// <param name="_num">Number of matrices.</param>
+pub inline fn allocTransform(_transform: [*c]Transform, _num: u16) u32 {
+ return bgfx_alloc_transform(_transform, _num);
+}
+extern fn bgfx_alloc_transform(_transform: [*c]Transform, _num: u16) u32;
+
+/// Set shader uniform parameter for draw primitive.
+/// <param name="_handle">Uniform.</param>
+/// <param name="_value">Pointer to uniform data.</param>
+/// <param name="_num">Number of elements. Passing `UINT16_MAX` will use the _num passed on uniform creation.</param>
+pub inline fn setUniform(_handle: UniformHandle, _value: ?*const anyopaque, _num: u16) void {
+ return bgfx_set_uniform(_handle, _value, _num);
+}
+extern fn bgfx_set_uniform(_handle: UniformHandle, _value: ?*const anyopaque, _num: u16) void;
+
+/// Set index buffer for draw primitive.
+/// <param name="_handle">Index buffer.</param>
+/// <param name="_firstIndex">First index to render.</param>
+/// <param name="_numIndices">Number of indices to render.</param>
+pub inline fn setIndexBuffer(_handle: IndexBufferHandle, _firstIndex: u32, _numIndices: u32) void {
+ return bgfx_set_index_buffer(_handle, _firstIndex, _numIndices);
+}
+extern fn bgfx_set_index_buffer(_handle: IndexBufferHandle, _firstIndex: u32, _numIndices: u32) void;
+
+/// Set index buffer for draw primitive.
+/// <param name="_handle">Dynamic index buffer.</param>
+/// <param name="_firstIndex">First index to render.</param>
+/// <param name="_numIndices">Number of indices to render.</param>
+pub inline fn setDynamicIndexBuffer(_handle: DynamicIndexBufferHandle, _firstIndex: u32, _numIndices: u32) void {
+ return bgfx_set_dynamic_index_buffer(_handle, _firstIndex, _numIndices);
+}
+extern fn bgfx_set_dynamic_index_buffer(_handle: DynamicIndexBufferHandle, _firstIndex: u32, _numIndices: u32) void;
+
+/// Set index buffer for draw primitive.
+/// <param name="_tib">Transient index buffer.</param>
+/// <param name="_firstIndex">First index to render.</param>
+/// <param name="_numIndices">Number of indices to render.</param>
+pub inline fn setTransientIndexBuffer(_tib: [*c]const TransientIndexBuffer, _firstIndex: u32, _numIndices: u32) void {
+ return bgfx_set_transient_index_buffer(_tib, _firstIndex, _numIndices);
+}
+extern fn bgfx_set_transient_index_buffer(_tib: [*c]const TransientIndexBuffer, _firstIndex: u32, _numIndices: u32) void;
+
+/// Set vertex buffer for draw primitive.
+/// <param name="_stream">Vertex stream.</param>
+/// <param name="_handle">Vertex buffer.</param>
+/// <param name="_startVertex">First vertex to render.</param>
+/// <param name="_numVertices">Number of vertices to render.</param>
+pub inline fn setVertexBuffer(_stream: u8, _handle: VertexBufferHandle, _startVertex: u32, _numVertices: u32) void {
+ return bgfx_set_vertex_buffer(_stream, _handle, _startVertex, _numVertices);
+}
+extern fn bgfx_set_vertex_buffer(_stream: u8, _handle: VertexBufferHandle, _startVertex: u32, _numVertices: u32) void;
+
+/// Set vertex buffer for draw primitive.
+/// <param name="_stream">Vertex stream.</param>
+/// <param name="_handle">Vertex buffer.</param>
+/// <param name="_startVertex">First vertex to render.</param>
+/// <param name="_numVertices">Number of vertices to render.</param>
+/// <param name="_layoutHandle">Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.</param>
+pub inline fn setVertexBufferWithLayout(_stream: u8, _handle: VertexBufferHandle, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void {
+ return bgfx_set_vertex_buffer_with_layout(_stream, _handle, _startVertex, _numVertices, _layoutHandle);
+}
+extern fn bgfx_set_vertex_buffer_with_layout(_stream: u8, _handle: VertexBufferHandle, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void;
+
+/// Set vertex buffer for draw primitive.
+/// <param name="_stream">Vertex stream.</param>
+/// <param name="_handle">Dynamic vertex buffer.</param>
+/// <param name="_startVertex">First vertex to render.</param>
+/// <param name="_numVertices">Number of vertices to render.</param>
+pub inline fn setDynamicVertexBuffer(_stream: u8, _handle: DynamicVertexBufferHandle, _startVertex: u32, _numVertices: u32) void {
+ return bgfx_set_dynamic_vertex_buffer(_stream, _handle, _startVertex, _numVertices);
+}
+extern fn bgfx_set_dynamic_vertex_buffer(_stream: u8, _handle: DynamicVertexBufferHandle, _startVertex: u32, _numVertices: u32) void;
+
+/// Set vertex buffer for draw primitive.
+/// <param name="_stream">Vertex stream.</param>
+/// <param name="_handle">Dynamic vertex buffer.</param>
+/// <param name="_startVertex">First vertex to render.</param>
+/// <param name="_numVertices">Number of vertices to render.</param>
+/// <param name="_layoutHandle">Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.</param>
+pub inline fn setDynamicVertexBufferWithLayout(_stream: u8, _handle: DynamicVertexBufferHandle, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void {
+ return bgfx_set_dynamic_vertex_buffer_with_layout(_stream, _handle, _startVertex, _numVertices, _layoutHandle);
+}
+extern fn bgfx_set_dynamic_vertex_buffer_with_layout(_stream: u8, _handle: DynamicVertexBufferHandle, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void;
+
+/// Set vertex buffer for draw primitive.
+/// <param name="_stream">Vertex stream.</param>
+/// <param name="_tvb">Transient vertex buffer.</param>
+/// <param name="_startVertex">First vertex to render.</param>
+/// <param name="_numVertices">Number of vertices to render.</param>
+pub inline fn setTransientVertexBuffer(_stream: u8, _tvb: [*c]const TransientVertexBuffer, _startVertex: u32, _numVertices: u32) void {
+ return bgfx_set_transient_vertex_buffer(_stream, _tvb, _startVertex, _numVertices);
+}
+extern fn bgfx_set_transient_vertex_buffer(_stream: u8, _tvb: [*c]const TransientVertexBuffer, _startVertex: u32, _numVertices: u32) void;
+
+/// Set vertex buffer for draw primitive.
+/// <param name="_stream">Vertex stream.</param>
+/// <param name="_tvb">Transient vertex buffer.</param>
+/// <param name="_startVertex">First vertex to render.</param>
+/// <param name="_numVertices">Number of vertices to render.</param>
+/// <param name="_layoutHandle">Vertex layout for aliasing vertex buffer. If invalid handle is used, vertex layout used for creation of vertex buffer will be used.</param>
+pub inline fn setTransientVertexBufferWithLayout(_stream: u8, _tvb: [*c]const TransientVertexBuffer, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void {
+ return bgfx_set_transient_vertex_buffer_with_layout(_stream, _tvb, _startVertex, _numVertices, _layoutHandle);
+}
+extern fn bgfx_set_transient_vertex_buffer_with_layout(_stream: u8, _tvb: [*c]const TransientVertexBuffer, _startVertex: u32, _numVertices: u32, _layoutHandle: VertexLayoutHandle) void;
+
+/// Set number of vertices for auto generated vertices use in conjunction
+/// with gl_VertexID.
+/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+/// <param name="_numVertices">Number of vertices.</param>
+pub inline fn setVertexCount(_numVertices: u32) void {
+ return bgfx_set_vertex_count(_numVertices);
+}
+extern fn bgfx_set_vertex_count(_numVertices: u32) void;
+
+/// Set instance data buffer for draw primitive.
+/// <param name="_idb">Transient instance data buffer.</param>
+/// <param name="_start">First instance data.</param>
+/// <param name="_num">Number of data instances.</param>
+pub inline fn setInstanceDataBuffer(_idb: [*c]const InstanceDataBuffer, _start: u32, _num: u32) void {
+ return bgfx_set_instance_data_buffer(_idb, _start, _num);
+}
+extern fn bgfx_set_instance_data_buffer(_idb: [*c]const InstanceDataBuffer, _start: u32, _num: u32) void;
+
+/// Set instance data buffer for draw primitive.
+/// <param name="_handle">Vertex buffer.</param>
+/// <param name="_startVertex">First instance data.</param>
+/// <param name="_num">Number of data instances. Set instance data buffer for draw primitive.</param>
+pub inline fn setInstanceDataFromVertexBuffer(_handle: VertexBufferHandle, _startVertex: u32, _num: u32) void {
+ return bgfx_set_instance_data_from_vertex_buffer(_handle, _startVertex, _num);
+}
+extern fn bgfx_set_instance_data_from_vertex_buffer(_handle: VertexBufferHandle, _startVertex: u32, _num: u32) void;
+
+/// Set instance data buffer for draw primitive.
+/// <param name="_handle">Dynamic vertex buffer.</param>
+/// <param name="_startVertex">First instance data.</param>
+/// <param name="_num">Number of data instances.</param>
+pub inline fn setInstanceDataFromDynamicVertexBuffer(_handle: DynamicVertexBufferHandle, _startVertex: u32, _num: u32) void {
+ return bgfx_set_instance_data_from_dynamic_vertex_buffer(_handle, _startVertex, _num);
+}
+extern fn bgfx_set_instance_data_from_dynamic_vertex_buffer(_handle: DynamicVertexBufferHandle, _startVertex: u32, _num: u32) void;
+
+/// Set number of instances for auto generated instances use in conjunction
+/// with gl_InstanceID.
+/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
+pub inline fn setInstanceCount(_numInstances: u32) void {
+ return bgfx_set_instance_count(_numInstances);
+}
+extern fn bgfx_set_instance_count(_numInstances: u32) void;
+
+/// Set texture stage for draw primitive.
+/// <param name="_stage">Texture unit.</param>
+/// <param name="_sampler">Program sampler.</param>
+/// <param name="_handle">Texture handle.</param>
+/// <param name="_flags">Texture sampling mode. Default value UINT32_MAX uses texture sampling settings from the texture. - `BGFX_SAMPLER_[U/V/W]_[MIRROR/CLAMP]` - Mirror or clamp to edge wrap mode. - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic sampling.</param>
+pub inline fn setTexture(_stage: u8, _sampler: UniformHandle, _handle: TextureHandle, _flags: u32) void {
+ return bgfx_set_texture(_stage, _sampler, _handle, _flags);
+}
+extern fn bgfx_set_texture(_stage: u8, _sampler: UniformHandle, _handle: TextureHandle, _flags: u32) void;
+
+/// Submit an empty primitive for rendering. Uniforms and draw state
+/// will be applied but no geometry will be submitted.
+/// @remark
+/// These empty draw calls will sort before ordinary draw calls.
+/// <param name="_id">View id.</param>
+pub inline fn touch(_id: ViewId) void {
+ return bgfx_touch(_id);
+}
+extern fn bgfx_touch(_id: ViewId) void;
+
+/// Submit primitive for rendering.
+/// <param name="_id">View id.</param>
+/// <param name="_program">Program.</param>
+/// <param name="_depth">Depth for sorting.</param>
+/// <param name="_flags">Which states to discard for next draw. See `BGFX_DISCARD_*`.</param>
+pub inline fn submit(_id: ViewId, _program: ProgramHandle, _depth: u32, _flags: u8) void {
+ return bgfx_submit(_id, _program, _depth, _flags);
+}
+extern fn bgfx_submit(_id: ViewId, _program: ProgramHandle, _depth: u32, _flags: u8) void;
+
+/// Submit primitive with occlusion query for rendering.
+/// <param name="_id">View id.</param>
+/// <param name="_program">Program.</param>
+/// <param name="_occlusionQuery">Occlusion query.</param>
+/// <param name="_depth">Depth for sorting.</param>
+/// <param name="_flags">Which states to discard for next draw. See `BGFX_DISCARD_*`.</param>
+pub inline fn submitOcclusionQuery(_id: ViewId, _program: ProgramHandle, _occlusionQuery: OcclusionQueryHandle, _depth: u32, _flags: u8) void {
+ return bgfx_submit_occlusion_query(_id, _program, _occlusionQuery, _depth, _flags);
+}
+extern fn bgfx_submit_occlusion_query(_id: ViewId, _program: ProgramHandle, _occlusionQuery: OcclusionQueryHandle, _depth: u32, _flags: u8) void;
+
+/// Submit primitive for rendering with index and instance data info from
+/// indirect buffer.
+/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
+/// <param name="_id">View id.</param>
+/// <param name="_program">Program.</param>
+/// <param name="_indirectHandle">Indirect buffer.</param>
+/// <param name="_start">First element in indirect buffer.</param>
+/// <param name="_num">Number of draws.</param>
+/// <param name="_depth">Depth for sorting.</param>
+/// <param name="_flags">Which states to discard for next draw. See `BGFX_DISCARD_*`.</param>
+pub inline fn submitIndirect(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _depth: u32, _flags: u8) void {
+ return bgfx_submit_indirect(_id, _program, _indirectHandle, _start, _num, _depth, _flags);
+}
+extern fn bgfx_submit_indirect(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _depth: u32, _flags: u8) void;
+
+/// Submit primitive for rendering with index and instance data info and
+/// draw count from indirect buffers.
+/// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+/// <param name="_id">View id.</param>
+/// <param name="_program">Program.</param>
+/// <param name="_indirectHandle">Indirect buffer.</param>
+/// <param name="_start">First element in indirect buffer.</param>
+/// <param name="_numHandle">Buffer for number of draws. Must be created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.</param>
+/// <param name="_numIndex">Element in number buffer.</param>
+/// <param name="_numMax">Max number of draws.</param>
+/// <param name="_depth">Depth for sorting.</param>
+/// <param name="_flags">Which states to discard for next draw. See `BGFX_DISCARD_*`.</param>
+pub inline fn submitIndirectCount(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u16, _depth: u32, _flags: u8) void {
+ return bgfx_submit_indirect_count(_id, _program, _indirectHandle, _start, _numHandle, _numIndex, _numMax, _depth, _flags);
+}
+extern fn bgfx_submit_indirect_count(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _numHandle: IndexBufferHandle, _numIndex: u32, _numMax: u16, _depth: u32, _flags: u8) void;
+
+/// Set compute index buffer.
+/// <param name="_stage">Compute stage.</param>
+/// <param name="_handle">Index buffer handle.</param>
+/// <param name="_access">Buffer access. See `Access::Enum`.</param>
+pub inline fn setComputeIndexBuffer(_stage: u8, _handle: IndexBufferHandle, _access: Access) void {
+ return bgfx_set_compute_index_buffer(_stage, _handle, _access);
+}
+extern fn bgfx_set_compute_index_buffer(_stage: u8, _handle: IndexBufferHandle, _access: Access) void;
+
+/// Set compute vertex buffer.
+/// <param name="_stage">Compute stage.</param>
+/// <param name="_handle">Vertex buffer handle.</param>
+/// <param name="_access">Buffer access. See `Access::Enum`.</param>
+pub inline fn setComputeVertexBuffer(_stage: u8, _handle: VertexBufferHandle, _access: Access) void {
+ return bgfx_set_compute_vertex_buffer(_stage, _handle, _access);
+}
+extern fn bgfx_set_compute_vertex_buffer(_stage: u8, _handle: VertexBufferHandle, _access: Access) void;
+
+/// Set compute dynamic index buffer.
+/// <param name="_stage">Compute stage.</param>
+/// <param name="_handle">Dynamic index buffer handle.</param>
+/// <param name="_access">Buffer access. See `Access::Enum`.</param>
+pub inline fn setComputeDynamicIndexBuffer(_stage: u8, _handle: DynamicIndexBufferHandle, _access: Access) void {
+ return bgfx_set_compute_dynamic_index_buffer(_stage, _handle, _access);
+}
+extern fn bgfx_set_compute_dynamic_index_buffer(_stage: u8, _handle: DynamicIndexBufferHandle, _access: Access) void;
+
+/// Set compute dynamic vertex buffer.
+/// <param name="_stage">Compute stage.</param>
+/// <param name="_handle">Dynamic vertex buffer handle.</param>
+/// <param name="_access">Buffer access. See `Access::Enum`.</param>
+pub inline fn setComputeDynamicVertexBuffer(_stage: u8, _handle: DynamicVertexBufferHandle, _access: Access) void {
+ return bgfx_set_compute_dynamic_vertex_buffer(_stage, _handle, _access);
+}
+extern fn bgfx_set_compute_dynamic_vertex_buffer(_stage: u8, _handle: DynamicVertexBufferHandle, _access: Access) void;
+
+/// Set compute indirect buffer.
+/// <param name="_stage">Compute stage.</param>
+/// <param name="_handle">Indirect buffer handle.</param>
+/// <param name="_access">Buffer access. See `Access::Enum`.</param>
+pub inline fn setComputeIndirectBuffer(_stage: u8, _handle: IndirectBufferHandle, _access: Access) void {
+ return bgfx_set_compute_indirect_buffer(_stage, _handle, _access);
+}
+extern fn bgfx_set_compute_indirect_buffer(_stage: u8, _handle: IndirectBufferHandle, _access: Access) void;
+
+/// Set compute image from texture.
+/// <param name="_stage">Compute stage.</param>
+/// <param name="_handle">Texture handle.</param>
+/// <param name="_mip">Mip level.</param>
+/// <param name="_access">Image access. See `Access::Enum`.</param>
+/// <param name="_format">Texture format. See: `TextureFormat::Enum`.</param>
+pub inline fn setImage(_stage: u8, _handle: TextureHandle, _mip: u8, _access: Access, _format: TextureFormat) void {
+ return bgfx_set_image(_stage, _handle, _mip, _access, _format);
+}
+extern fn bgfx_set_image(_stage: u8, _handle: TextureHandle, _mip: u8, _access: Access, _format: TextureFormat) void;
+
+/// Dispatch compute.
+/// <param name="_id">View id.</param>
+/// <param name="_program">Compute program.</param>
+/// <param name="_numX">Number of groups X.</param>
+/// <param name="_numY">Number of groups Y.</param>
+/// <param name="_numZ">Number of groups Z.</param>
+/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+pub inline fn dispatch(_id: ViewId, _program: ProgramHandle, _numX: u32, _numY: u32, _numZ: u32, _flags: u8) void {
+ return bgfx_dispatch(_id, _program, _numX, _numY, _numZ, _flags);
+}
+extern fn bgfx_dispatch(_id: ViewId, _program: ProgramHandle, _numX: u32, _numY: u32, _numZ: u32, _flags: u8) void;
+
+/// Dispatch compute indirect.
+/// <param name="_id">View id.</param>
+/// <param name="_program">Compute program.</param>
+/// <param name="_indirectHandle">Indirect buffer.</param>
+/// <param name="_start">First element in indirect buffer.</param>
+/// <param name="_num">Number of dispatches.</param>
+/// <param name="_flags">Discard or preserve states. See `BGFX_DISCARD_*`.</param>
+pub inline fn dispatchIndirect(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _flags: u8) void {
+ return bgfx_dispatch_indirect(_id, _program, _indirectHandle, _start, _num, _flags);
+}
+extern fn bgfx_dispatch_indirect(_id: ViewId, _program: ProgramHandle, _indirectHandle: IndirectBufferHandle, _start: u16, _num: u16, _flags: u8) void;
+
+/// Discard previously set state for draw or compute call.
+/// <param name="_flags">Draw/compute states to discard.</param>
+pub inline fn discard(_flags: u8) void {
+ return bgfx_discard(_flags);
+}
+extern fn bgfx_discard(_flags: u8) void;
+
+/// Blit 2D texture region between two 2D textures.
+/// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
+/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
+/// <param name="_id">View id.</param>
+/// <param name="_dst">Destination texture handle.</param>
+/// <param name="_dstMip">Destination texture mip level.</param>
+/// <param name="_dstX">Destination texture X position.</param>
+/// <param name="_dstY">Destination texture Y position.</param>
+/// <param name="_dstZ">If texture is 2D this argument should be 0. If destination texture is cube this argument represents destination texture cube face. For 3D texture this argument represents destination texture Z position.</param>
+/// <param name="_src">Source texture handle.</param>
+/// <param name="_srcMip">Source texture mip level.</param>
+/// <param name="_srcX">Source texture X position.</param>
+/// <param name="_srcY">Source texture Y position.</param>
+/// <param name="_srcZ">If texture is 2D this argument should be 0. If source texture is cube this argument represents source texture cube face. For 3D texture this argument represents source texture Z position.</param>
+/// <param name="_width">Width of region.</param>
+/// <param name="_height">Height of region.</param>
+/// <param name="_depth">If texture is 3D this argument represents depth of region, otherwise it's unused.</param>
+pub inline fn blit(_id: ViewId, _dst: TextureHandle, _dstMip: u8, _dstX: u16, _dstY: u16, _dstZ: u16, _src: TextureHandle, _srcMip: u8, _srcX: u16, _srcY: u16, _srcZ: u16, _width: u16, _height: u16, _depth: u16) void {
+ return bgfx_blit(_id, _dst, _dstMip, _dstX, _dstY, _dstZ, _src, _srcMip, _srcX, _srcY, _srcZ, _width, _height, _depth);
+}
+extern fn bgfx_blit(_id: ViewId, _dst: TextureHandle, _dstMip: u8, _dstX: u16, _dstY: u16, _dstZ: u16, _src: TextureHandle, _srcMip: u8, _srcX: u16, _srcY: u16, _srcZ: u16, _width: u16, _height: u16, _depth: u16) void;
+
+
diff --git a/3rdparty/bgfx/docs/bgfx.rst b/3rdparty/bgfx/docs/bgfx.rst
new file mode 100644
index 00000000000..911a7fb6f79
--- /dev/null
+++ b/3rdparty/bgfx/docs/bgfx.rst
@@ -0,0 +1,605 @@
+API Reference
+=============
+
+
+.. note::
+
+ If you're just getting started with bgfx, you might get more out of these simple walkthroughs for how to use bgfx's API:
+
+ - `Hello, bgfx! <https://dev.to/pperon/hello-bgfx-4dka>`_
+ - `bgfx-minimal-example <https://github.com/jpcy/bgfx-minimal-example#bgfx-minimal-example>`_
+ - `Using the bgfx library with C++ on Ubuntu <https://www.sandeepnambiar.com/getting-started-with-bgfx/>`_
+
+General
+-------
+
+Initialization and Shutdown
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. doxygenstruct:: bgfx::Init
+ :members:
+
+.. doxygenstruct:: bgfx::Resolution
+ :members:
+
+.. doxygenfunction:: bgfx::init
+
+.. doxygendefine:: BGFX_PCI_ID_NONE
+.. doxygendefine:: BGFX_PCI_ID_SOFTWARE_RASTERIZER
+.. doxygendefine:: BGFX_PCI_ID_AMD
+.. doxygendefine:: BGFX_PCI_ID_APPLE
+.. doxygendefine:: BGFX_PCI_ID_INTEL
+.. doxygendefine:: BGFX_PCI_ID_NVIDIA
+.. doxygendefine:: BGFX_PCI_ID_MICROSOFT
+
+.. doxygenstruct:: bgfx::CallbackI
+ :members:
+
+.. doxygenfunction:: bgfx::shutdown
+
+Updating
+~~~~~~~~
+
+Reset
+*****
+
+.. doxygenfunction:: bgfx::reset
+
+.. doxygendefine:: BGFX_RESET_NONE
+.. doxygendefine:: BGFX_RESET_FULLSCREEN
+.. doxygendefine:: BGFX_RESET_MSAA_X2
+.. doxygendefine:: BGFX_RESET_MSAA_X4
+.. doxygendefine:: BGFX_RESET_MSAA_X8
+.. doxygendefine:: BGFX_RESET_MSAA_X16
+.. doxygendefine:: BGFX_RESET_VSYNC
+.. doxygendefine:: BGFX_RESET_MAXANISOTROPY
+.. doxygendefine:: BGFX_RESET_CAPTURE
+.. doxygendefine:: BGFX_RESET_FLUSH_AFTER_RENDER
+.. doxygendefine:: BGFX_RESET_FLIP_AFTER_RENDER
+.. doxygendefine:: BGFX_RESET_SRGB_BACKBUFFER
+.. doxygendefine:: BGFX_RESET_HDR10
+.. doxygendefine:: BGFX_RESET_HIDPI
+.. doxygendefine:: BGFX_RESET_DEPTH_CLAMP
+
+Frame
+*****
+
+.. doxygenfunction:: bgfx::frame
+
+Debug
+~~~~~
+
+Debug Features
+**************
+
+.. doxygenfunction:: bgfx::setDebug
+
+Debug Flags
+***********
+
+.. doxygendefine:: BGFX_DEBUG_NONE
+.. doxygendefine:: BGFX_DEBUG_WIREFRAME
+.. doxygendefine:: BGFX_DEBUG_IFH
+.. doxygendefine:: BGFX_DEBUG_STATS
+.. doxygendefine:: BGFX_DEBUG_TEXT
+.. doxygendefine:: BGFX_DEBUG_PROFILER
+
+Debug Text Display
+******************
+
+.. doxygenfunction:: bgfx::dbgTextClear
+.. doxygenfunction:: bgfx::dbgTextPrintf
+.. doxygenfunction:: bgfx::dbgTextPrintfVargs
+.. doxygenfunction:: bgfx::dbgTextImage
+
+Querying information
+~~~~~~~~~~~~~~~~~~~~
+
+Renderer
+********
+
+.. doxygenfunction:: bgfx::getSupportedRenderers
+
+.. doxygenfunction:: bgfx::getRendererType
+
+.. doxygenstruct:: bgfx::RendererType
+ :members:
+
+Capabilities
+************
+
+.. doxygenfunction:: bgfx::getCaps
+
+.. doxygenstruct:: bgfx::Caps
+ :members:
+
+Available Caps
+""""""""""""""
+
+.. doxygendefine:: BGFX_CAPS_ALPHA_TO_COVERAGE
+.. doxygendefine:: BGFX_CAPS_BLEND_INDEPENDENT
+.. doxygendefine:: BGFX_CAPS_COMPUTE
+.. doxygendefine:: BGFX_CAPS_CONSERVATIVE_RASTER
+.. doxygendefine:: BGFX_CAPS_DRAW_INDIRECT
+.. doxygendefine:: BGFX_CAPS_DRAW_INDIRECT_COUNT
+.. doxygendefine:: BGFX_CAPS_FRAGMENT_DEPTH
+.. doxygendefine:: BGFX_CAPS_FRAGMENT_ORDERING
+.. doxygendefine:: BGFX_CAPS_GRAPHICS_DEBUGGER
+.. doxygendefine:: BGFX_CAPS_HDR10
+.. doxygendefine:: BGFX_CAPS_HIDPI
+.. doxygendefine:: BGFX_CAPS_IMAGE_RW
+.. doxygendefine:: BGFX_CAPS_INDEX32
+.. doxygendefine:: BGFX_CAPS_INSTANCING
+.. doxygendefine:: BGFX_CAPS_OCCLUSION_QUERY
+.. doxygendefine:: BGFX_CAPS_RENDERER_MULTITHREADED
+.. doxygendefine:: BGFX_CAPS_SWAP_CHAIN
+.. doxygendefine:: BGFX_CAPS_TEXTURE_2D_ARRAY
+.. doxygendefine:: BGFX_CAPS_TEXTURE_3D
+.. doxygendefine:: BGFX_CAPS_TEXTURE_BLIT
+.. doxygendefine:: BGFX_CAPS_TEXTURE_COMPARE_ALL
+.. doxygendefine:: BGFX_CAPS_TEXTURE_COMPARE_LEQUAL
+.. doxygendefine:: BGFX_CAPS_TEXTURE_CUBE_ARRAY
+.. doxygendefine:: BGFX_CAPS_TEXTURE_DIRECT_ACCESS
+.. doxygendefine:: BGFX_CAPS_TEXTURE_READ_BACK
+.. doxygendefine:: BGFX_CAPS_VERTEX_ATTRIB_HALF
+.. doxygendefine:: BGFX_CAPS_VERTEX_ATTRIB_UINT10
+.. doxygendefine:: BGFX_CAPS_VERTEX_ID
+
+Statistics
+**********
+
+.. doxygenfunction:: bgfx::getStats
+
+.. doxygenstruct:: bgfx::Stats
+ :members:
+
+.. doxygenstruct:: bgfx::ViewStats
+ :members:
+
+.. doxygenstruct:: bgfx::EncoderStats
+ :members:
+
+Platform specific
+~~~~~~~~~~~~~~~~~
+
+These are platform specific APIs.
+It is only necessary to use these APIs in conjunction with creating windows.
+
+.. doxygenfunction:: bgfx::renderFrame
+
+.. doxygenstruct:: bgfx::RenderFrame
+ :members:
+
+.. doxygenfunction:: bgfx::setPlatformData
+
+.. doxygenstruct:: bgfx::PlatformData
+ :members:
+
+.. doxygenfunction:: bgfx::getInternalData
+
+.. doxygenstruct:: bgfx::InternalData
+ :members:
+
+.. doxygenfunction:: bgfx::overrideInternal(TextureHandle _handle, uintptr_t _ptr)
+.. doxygenfunction:: bgfx::overrideInternal(TextureHandle _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, TextureFormat::Enum _format, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE)
+
+Miscellaneous
+~~~~~~~~~~~~~
+
+.. doxygenfunction:: bgfx::vertexPack
+.. doxygenfunction:: bgfx::vertexUnpack
+.. doxygenfunction:: bgfx::vertexConvert
+.. doxygenfunction:: bgfx::weldVertices
+
+.. doxygenstruct:: bgfx::TopologyConvert
+ :members:
+
+.. doxygenfunction:: bgfx::topologyConvert
+
+.. doxygenstruct:: bgfx::TopologySort
+ :members:
+
+.. doxygenfunction:: bgfx::topologySortTriList
+.. doxygenfunction:: bgfx::discard
+.. doxygenfunction:: bgfx::touch
+.. doxygenfunction:: bgfx::setPaletteColor(uint8_t _index, uint32_t _rgba)
+.. doxygenfunction:: bgfx::setPaletteColor(uint8_t _index, const float _rgba[4])
+.. doxygenfunction:: bgfx::setPaletteColor(uint8_t _index, float _r, float _g, float _b, float _a)
+.. doxygenfunction:: bgfx::requestScreenShot
+
+Views
+-----
+
+Views are the primary sorting mechanism in bgfx.
+They represent buckets of draw and compute calls, or what are often known as 'passes'.
+
+When compute calls and draw calls occupy the same bucket, the compute calls will be sorted to execute first.
+Compute calls are always executed in order of submission, while draw calls are sorted by internal state if
+the View is not in sequential mode.
+In most cases where the z-buffer is used, this change in order does not affect the desired output.
+When draw call order needs to be preserved (e.g. when rendering GUIs), Views can be set to use sequential mode with `bgfx::setViewMode`.
+Sequential order is less efficient, because it doesn't allow state change optimization, and should be avoided when possible.
+
+By default, Views are sorted by their View ID, in ascending order.
+For dynamic renderers where the right order might not be known until the last moment,
+View IDs can be changed to use arbitrary ordering with `bgfx::setViewOrder`.
+
+A View's state is preserved between frames.
+
+.. doxygenfunction:: bgfx::setViewName
+.. doxygenfunction:: bgfx::setViewRect(ViewId _id, uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)
+.. doxygenfunction:: bgfx::setViewRect(ViewId _id, uint16_t _x, uint16_t _y, BackbufferRatio::Enum _ratio)
+.. doxygenfunction:: bgfx::setViewScissor
+.. doxygenfunction:: bgfx::setViewClear(ViewId _id, uint16_t _flags, uint32_t _rgba = 0x000000ff, float _depth = 1.0f, uint8_t _stencil = 0)
+.. doxygenfunction:: bgfx::setViewClear(ViewId _id, uint16_t _flags, float _depth, uint8_t _stencil, uint8_t _0 = UINT8_MAX, uint8_t _1 = UINT8_MAX, uint8_t _2 = UINT8_MAX, uint8_t _3 = UINT8_MAX, uint8_t _4 = UINT8_MAX, uint8_t _5 = UINT8_MAX, uint8_t _6 = UINT8_MAX, uint8_t _7 = UINT8_MAX)
+
+.. doxygenstruct:: bgfx::ViewMode
+ :members:
+
+.. doxygenfunction:: bgfx::setViewMode
+.. doxygenfunction:: bgfx::setViewFrameBuffer
+.. doxygenfunction:: bgfx::setViewTransform
+.. doxygenfunction:: bgfx::setViewOrder
+.. doxygenfunction:: bgfx::resetView
+
+Encoder
+-------
+
+Encoder
+~~~~~~~
+
+API for multi-threaded submission.
+
+.. doxygenfunction:: bgfx::begin
+.. doxygenfunction:: bgfx::end
+
+.. doxygenstruct:: bgfx::Encoder
+ :members:
+
+Draw
+~~~~
+
+Draw state is not preserved between two draw calls.
+All state is cleared after calling `bgfx::submit`.
+
+State
+*****
+
+Debug
+*****
+
+.. doxygenfunction:: bgfx::setMarker
+.. doxygenfunction:: bgfx::setName(ShaderHandle _handle, const char *_name, int32_t _len = INT32_MAX)
+.. doxygenfunction:: bgfx::setName(TextureHandle _handle, const char *_name, int32_t _len = INT32_MAX)
+
+State
+*****
+
+.. doxygenfunction:: bgfx::setState
+
+State Flags
+***********
+
+**Write**
+
+.. doxygendefine:: BGFX_STATE_WRITE_R
+.. doxygendefine:: BGFX_STATE_WRITE_G
+.. doxygendefine:: BGFX_STATE_WRITE_B
+.. doxygendefine:: BGFX_STATE_WRITE_RGB
+.. doxygendefine:: BGFX_STATE_WRITE_A
+.. doxygendefine:: BGFX_STATE_WRITE_Z
+
+**Depth Test**
+
+.. doxygendefine:: BGFX_STATE_DEPTH_TEST_LESS
+.. doxygendefine:: BGFX_STATE_DEPTH_TEST_LEQUAL
+.. doxygendefine:: BGFX_STATE_DEPTH_TEST_EQUAL
+.. doxygendefine:: BGFX_STATE_DEPTH_TEST_GEQUAL
+.. doxygendefine:: BGFX_STATE_DEPTH_TEST_GREATER
+.. doxygendefine:: BGFX_STATE_DEPTH_TEST_NOTEQUAL
+.. doxygendefine:: BGFX_STATE_DEPTH_TEST_NEVER
+.. doxygendefine:: BGFX_STATE_DEPTH_TEST_ALWAYS
+
+**Blend Mode**
+
+.. doxygendefine:: BGFX_STATE_BLEND_ZERO
+.. doxygendefine:: BGFX_STATE_BLEND_ONE
+.. doxygendefine:: BGFX_STATE_BLEND_SRC_COLOR
+.. doxygendefine:: BGFX_STATE_BLEND_INV_SRC_COLOR
+.. doxygendefine:: BGFX_STATE_BLEND_SRC_ALPHA
+.. doxygendefine:: BGFX_STATE_BLEND_INV_SRC_ALPHA
+.. doxygendefine:: BGFX_STATE_BLEND_DST_ALPHA
+.. doxygendefine:: BGFX_STATE_BLEND_INV_DST_ALPHA
+.. doxygendefine:: BGFX_STATE_BLEND_DST_COLOR
+.. doxygendefine:: BGFX_STATE_BLEND_INV_DST_COLOR
+.. doxygendefine:: BGFX_STATE_BLEND_SRC_ALPHA_SAT
+.. doxygendefine:: BGFX_STATE_BLEND_FACTOR
+.. doxygendefine:: BGFX_STATE_BLEND_INV_FACTOR
+
+**Blend Equaation**
+
+.. doxygendefine:: BGFX_STATE_BLEND_EQUATION_ADD
+.. doxygendefine:: BGFX_STATE_BLEND_EQUATION_SUB
+.. doxygendefine:: BGFX_STATE_BLEND_EQUATION_REVSUB
+.. doxygendefine:: BGFX_STATE_BLEND_EQUATION_MIN
+.. doxygendefine:: BGFX_STATE_BLEND_EQUATION_MAX
+
+**Primitive Culling**
+
+.. doxygendefine:: BGFX_STATE_CULL_CW
+.. doxygendefine:: BGFX_STATE_CULL_CCW
+
+**Primitive Type**
+
+.. doxygendefine:: BGFX_STATE_PT_TRISTRIP
+.. doxygendefine:: BGFX_STATE_PT_LINES
+.. doxygendefine:: BGFX_STATE_PT_LINESTRIP
+.. doxygendefine:: BGFX_STATE_PT_POINTS
+
+**Misc**
+
+.. doxygendefine:: BGFX_STATE_BLEND_INDEPENDENT
+.. doxygendefine:: BGFX_STATE_BLEND_ALPHA_TO_COVERAGE
+
+.. doxygendefine:: BGFX_STATE_MSAA
+.. doxygendefine:: BGFX_STATE_LINEAA
+
+Stencil
+*******
+
+.. doxygenfunction:: bgfx::setStencil
+
+Stencil Flags
+*************
+
+.. doxygendefine:: BGFX_STENCIL_TEST_LESS
+
+Scissor
+*******
+
+If the Scissor rectangle needs to be changed for
+every draw call in a View, use `bgfx::setScissor`.
+Otherwise, use `bgfx::setViewScissor`.
+
+.. doxygenfunction:: bgfx::setScissor(uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)
+.. doxygenfunction:: bgfx::setScissor(uint16_t _cache = UINT16_MAX)
+
+Transform
+*********
+
+.. doxygenfunction:: bgfx::allocTransform
+.. doxygenfunction:: bgfx::setTransform(const void *_mtx, uint16_t _num = 1)
+.. doxygenfunction:: bgfx::setTransform(uint32_t _cache, uint16_t _num = 1)
+
+Conditional Rendering
+*********************
+
+.. doxygenfunction:: bgfx::setCondition
+
+
+Buffers
+*******
+
+.. doxygenfunction:: bgfx::setIndexBuffer(IndexBufferHandle _handle)
+.. doxygenfunction:: bgfx::setIndexBuffer(IndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
+.. doxygenfunction:: bgfx::setIndexBuffer(DynamicIndexBufferHandle _handle)
+.. doxygenfunction:: bgfx::setIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
+
+.. doxygenstruct:: bgfx::TransientIndexBuffer
+ :members:
+
+.. doxygenfunction:: bgfx::setIndexBuffer(const TransientIndexBuffer *_tib)
+.. doxygenfunction:: bgfx::setIndexBuffer(const TransientIndexBuffer *_tib, uint32_t _firstIndex, uint32_t _numIndices)
+
+.. doxygenfunction:: bgfx::setVertexBuffer(uint8_t _stream, VertexBufferHandle _handle)
+.. doxygenfunction:: bgfx::setVertexBuffer(uint8_t _stream, VertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)
+.. doxygenfunction:: bgfx::setVertexBuffer(uint8_t _stream, DynamicVertexBufferHandle _handle)
+.. doxygenfunction:: bgfx::setVertexBuffer(uint8_t _stream, DynamicVertexBufferHandle _handle, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)
+
+.. doxygenstruct:: bgfx::TransientVertexBuffer
+ :members:
+
+.. doxygenfunction:: bgfx::setVertexBuffer(uint8_t _stream, const TransientVertexBuffer *_tvb)
+.. doxygenfunction:: bgfx::setVertexBuffer(uint8_t _stream, const TransientVertexBuffer *_tvb, uint32_t _startVertex, uint32_t _numVertices, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE)
+.. doxygenfunction:: bgfx::setVertexCount
+
+.. doxygenstruct:: bgfx::InstanceDataBuffer
+ :members:
+
+.. doxygenfunction:: bgfx::setInstanceDataBuffer(const InstanceDataBuffer *_idb)
+.. doxygenfunction:: bgfx::setInstanceDataBuffer(const InstanceDataBuffer *_idb, uint32_t _start, uint32_t _num)
+.. doxygenfunction:: bgfx::setInstanceDataBuffer(VertexBufferHandle _handle, uint32_t _start, uint32_t _num)
+.. doxygenfunction:: bgfx::setInstanceDataBuffer(DynamicVertexBufferHandle _handle, uint32_t _start, uint32_t _num)
+.. doxygenfunction:: bgfx::setInstanceCount
+
+Textures
+********
+
+.. doxygenfunction:: bgfx::setTexture(uint8_t, UniformHandle, TextureHandle, uint32_t)
+
+Submit
+******
+
+In Views, all draw commands are executed **after** blit and compute commands.
+
+.. doxygenfunction:: bgfx::submit(ViewId _id, ProgramHandle _program, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)
+.. doxygenfunction:: bgfx::submit(ViewId _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)
+.. doxygenfunction:: bgfx::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)
+.. doxygenfunction:: bgfx::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex = 0, uint16_t _numMax = UINT16_MAX, uint32_t _depth = 0, uint8_t _flags = BGFX_DISCARD_ALL)
+
+
+Compute
+~~~~~~~
+
+Compute state is not preserved between compute dispatches; all state is cleared after calling `bgfx::dispatch`.
+
+Buffers
+*******
+
+.. doxygenstruct:: bgfx::Access
+ :members:
+
+.. doxygenfunction:: bgfx::setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access)
+.. doxygenfunction:: bgfx::setBuffer(uint8_t _stage, VertexBufferHandle _handle, Access::Enum _access)
+.. doxygenfunction:: bgfx::setBuffer(uint8_t _stage, DynamicIndexBufferHandle _handle, Access::Enum _access)
+.. doxygenfunction:: bgfx::setBuffer(uint8_t _stage, DynamicVertexBufferHandle _handle, Access::Enum _access)
+.. doxygenfunction:: bgfx::setBuffer(uint8_t _stage, IndirectBufferHandle _handle, Access::Enum _access)
+
+Images
+******
+
+.. doxygenfunction:: bgfx::setImage(uint8_t, TextureHandle, uint8_t, Access::Enum, TextureFormat::Enum)
+
+Dispatch
+********
+
+In Views, all draw commands are executed **after** blit and compute commands.
+
+.. doxygenfunction:: bgfx::dispatch(ViewId _id, ProgramHandle _handle, uint32_t _numX = 1, uint32_t _numY = 1, uint32_t _numZ = 1, uint8_t _flags = BGFX_DISCARD_ALL)
+.. doxygenfunction:: bgfx::dispatch(ViewId _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start = 0, uint16_t _num = 1, uint8_t _flags = BGFX_DISCARD_ALL)
+
+Blit
+~~~~
+
+In Views, all draw commands are executed **after** blit and compute commands.
+
+.. doxygenfunction:: bgfx::blit(ViewId _id, TextureHandle _dst, uint16_t _dstX, uint16_t _dstY, TextureHandle _src, uint16_t _srcX = 0, uint16_t _srcY = 0, uint16_t _width = UINT16_MAX, uint16_t _height = UINT16_MAX)
+.. doxygenfunction:: bgfx::blit(ViewId _id, TextureHandle _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, TextureHandle _src, uint8_t _srcMip = 0, uint16_t _srcX = 0, uint16_t _srcY = 0, uint16_t _srcZ = 0, uint16_t _width = UINT16_MAX, uint16_t _height = UINT16_MAX, uint16_t _depth = UINT16_MAX)
+
+Resources
+---------
+
+.. doxygenstruct:: bgfx::Memory
+ :members:
+
+.. doxygenfunction:: bgfx::alloc
+.. doxygenfunction:: bgfx::copy
+.. doxygenfunction:: bgfx::makeRef
+
+Shaders and Programs
+~~~~~~~~~~~~~~~~~~~~
+
+.. doxygenfunction:: bgfx::createShader
+.. doxygenfunction:: bgfx::getShaderUniforms
+.. doxygenfunction:: bgfx::destroy(ShaderHandle _handle)
+.. doxygenfunction:: bgfx::createProgram(ShaderHandle _vsh, ShaderHandle _fsh, bool _destroyShaders = false)
+.. doxygenfunction:: bgfx::createProgram(ShaderHandle _csh, bool _destroyShader = false)
+.. doxygenfunction:: bgfx::destroy(ProgramHandle _handle)
+
+Uniforms
+~~~~~~~~
+
+.. doxygenfunction:: bgfx::createUniform
+.. doxygenfunction:: bgfx::getUniformInfo
+.. doxygenfunction:: bgfx::destroy(UniformHandle _handle)
+
+.. doxygenstruct:: bgfx::UniformType
+ :members:
+
+.. doxygenstruct:: bgfx::UniformInfo
+ :members:
+
+Vertex Buffers
+~~~~~~~~~~~~~~
+
+.. doxygenfunction:: bgfx::createVertexLayout
+.. doxygenfunction:: bgfx::destroy(VertexLayoutHandle _handle)
+
+.. doxygenfunction:: bgfx::createVertexBuffer
+.. doxygenfunction:: bgfx::setName(VertexBufferHandle _handle, const char *_name, int32_t _len = INT32_MAX)
+.. doxygenfunction:: bgfx::destroy(VertexBufferHandle _handle)
+
+.. doxygenstruct:: bgfx::VertexLayout
+ :members:
+
+.. doxygenstruct:: bgfx::Attrib
+ :members:
+
+.. doxygenstruct:: bgfx::AttribType
+ :members:
+
+.. doxygenfunction:: bgfx::createDynamicVertexBuffer(uint32_t _num, const VertexLayout &_layout, uint16_t _flags = BGFX_BUFFER_NONE)
+.. doxygenfunction:: bgfx::createDynamicVertexBuffer(const Memory *_mem, const VertexLayout &_layout, uint16_t _flags = BGFX_BUFFER_NONE)
+.. doxygenfunction:: bgfx::update(DynamicVertexBufferHandle _handle, uint32_t _startVertex, const Memory *_mem)
+.. doxygenfunction:: bgfx::destroy(DynamicVertexBufferHandle _handle)
+.. doxygenfunction:: bgfx::getAvailTransientVertexBuffer
+.. doxygenfunction:: bgfx::allocTransientVertexBuffer
+
+Index Buffers
+~~~~~~~~~~~~~
+
+.. doxygenfunction:: bgfx::createIndexBuffer
+.. doxygenfunction:: bgfx::setName(IndexBufferHandle _handle, const char *_name, int32_t _len = INT32_MAX)
+.. doxygenfunction:: bgfx::destroy(IndexBufferHandle _handle)
+.. doxygenfunction:: bgfx::createDynamicIndexBuffer(uint32_t _num, uint16_t _flags = BGFX_BUFFER_NONE)
+.. doxygenfunction:: bgfx::createDynamicIndexBuffer(const Memory *_mem, uint16_t _flags = BGFX_BUFFER_NONE)
+.. doxygenfunction:: bgfx::update(DynamicIndexBufferHandle _handle, uint32_t _startIndex, const Memory *_mem)
+.. doxygenfunction:: bgfx::destroy(DynamicIndexBufferHandle _handle)
+.. doxygenfunction:: bgfx::getAvailTransientIndexBuffer
+.. doxygenfunction:: bgfx::allocTransientIndexBuffer
+
+Textures
+~~~~~~~~
+
+.. doxygenstruct:: bgfx::TextureFormat
+ :members:
+
+.. doxygenfunction:: bgfx::isTextureValid
+
+.. doxygenstruct:: bgfx::TextureInfo
+ :members:
+
+.. doxygenfunction:: bgfx::calcTextureSize
+.. doxygenfunction:: bgfx::createTexture
+
+.. doxygenfunction:: bgfx::createTexture2D(uint16_t _width, uint16_t _height, bool _hasMips, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE, const Memory *_mem = NULL)
+.. doxygenfunction:: bgfx::createTexture2D(BackbufferRatio::Enum _ratio, bool _hasMips, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags = BGFX_TEXTURE_NONE | BGFX_SAMPLER_NONE)
+.. doxygenfunction:: bgfx::updateTexture2D
+.. doxygenfunction:: bgfx::createTexture3D
+.. doxygenfunction:: bgfx::updateTexture3D
+.. doxygenfunction:: bgfx::createTextureCube
+.. doxygenfunction:: bgfx::updateTextureCube
+.. doxygenfunction:: bgfx::readTexture(TextureHandle, void *, uint8_t)
+.. doxygenfunction:: bgfx::getDirectAccessPtr
+.. doxygenfunction:: bgfx::destroy(TextureHandle _handle)
+
+Frame Buffers
+~~~~~~~~~~~~~
+
+.. doxygenstruct:: bgfx::Attachment
+ :members:
+
+.. doxygenfunction:: bgfx::isFrameBufferValid
+
+.. doxygenfunction:: bgfx::createFrameBuffer(uint16_t _width, uint16_t _height, TextureFormat::Enum _format, uint64_t _textureFlags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP)
+.. doxygenfunction:: bgfx::createFrameBuffer(BackbufferRatio::Enum _ratio, TextureFormat::Enum _format, uint64_t _textureFlags = BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP)
+.. doxygenfunction:: bgfx::createFrameBuffer(uint8_t _num, const TextureHandle *_handles, bool _destroyTextures = false)
+.. doxygenfunction:: bgfx::createFrameBuffer(void *_nwh, uint16_t _width, uint16_t _height, TextureFormat::Enum _format = TextureFormat::Count, TextureFormat::Enum _depthFormat = TextureFormat::Count)
+
+.. doxygenfunction:: bgfx::createFrameBuffer(uint8_t _num, const Attachment *_attachment, bool _destroyTextures = false)
+.. doxygenfunction:: bgfx::getTexture
+.. doxygenfunction:: bgfx::setName(FrameBufferHandle _handle, const char *_name, int32_t _len = INT32_MAX)
+.. doxygenfunction:: bgfx::destroy(FrameBufferHandle _handle)
+
+Instance Buffer
+~~~~~~~~~~~~~~~
+
+.. doxygenfunction:: bgfx::getAvailInstanceDataBuffer
+.. doxygenfunction:: bgfx::allocInstanceDataBuffer
+
+Indirect Buffer
+~~~~~~~~~~~~~~~
+
+.. doxygenfunction:: bgfx::createIndirectBuffer
+.. doxygenfunction:: bgfx::destroy(IndirectBufferHandle _handle)
+
+Occlusion Query
+~~~~~~~~~~~~~~~
+
+.. doxygenfunction:: bgfx::createOcclusionQuery
+
+.. doxygenstruct:: bgfx::OcclusionQueryResult
+ :members:
+
+.. doxygenfunction:: bgfx::getResult
+.. doxygenfunction:: bgfx::destroy(OcclusionQueryHandle _handle)
diff --git a/3rdparty/bgfx/docs/build.rst b/3rdparty/bgfx/docs/build.rst
new file mode 100644
index 00000000000..9f3324a78c4
--- /dev/null
+++ b/3rdparty/bgfx/docs/build.rst
@@ -0,0 +1,215 @@
+Building
+========
+
+Dependencies
+------------
+
+https://github.com/bkaradzic/bx
+
+https://github.com/bkaradzic/bimg
+
+Getting Source
+--------------
+
+::
+
+ git clone https://github.com/bkaradzic/bx.git
+ git clone https://github.com/bkaradzic/bimg.git
+ git clone https://github.com/bkaradzic/bgfx.git
+
+Quick Start
+-----------
+
+These are step for users who use Windows with Visual Studio.
+
+Enter bgfx directory:
+
+::
+
+ cd bgfx
+
+Generate Visual Studio 2017 project files:
+
+::
+
+ ..\bx\tools\bin\windows\genie --with-examples vs2017
+
+Open bgfx solution in Visual Studio 2017:
+
+::
+
+ start .build\projects\vs2017\bgfx.sln
+
+.. note:: For more detailed prerequisites and build steps on other platforms see below.
+
+Prerequisites
+-------------
+
+Android
+~~~~~~~
+
+Download Android NDK (r23 or newer):
+
+ - https://developer.android.com/tools/sdk/ndk/index.html
+
+Set following environment variables:
+
+::
+
+ setx ANDROID_NDK_ROOT <path to AndroidNDK directory>
+
+
+Linux
+~~~~~
+
+::
+
+ sudo apt-get install libgl1-mesa-dev x11proto-core-dev libx11-dev
+
+Windows
+~~~~~~~
+
+Windows users download GnuWin32 utilities:
+
+ - http://gnuwin32.sourceforge.net/packages/make.htm
+ - http://gnuwin32.sourceforge.net/packages/coreutils.htm
+ - http://gnuwin32.sourceforge.net/packages/libiconv.htm
+ - http://gnuwin32.sourceforge.net/packages/libintl.htm
+
+.. note:: **MSYS**, **Cygwin**, etc. shells are not supported!
+ You must use use **cmd.exe** with provided makefiles.
+
+Build
+-----
+
+bgfx uses `GENie - Project generator tool <https://github.com/bkaradzic/genie#genie---project-generator-tool>`__
+to generate project files for various platform. Binaries for Linux, OSX, and Windows are included in
+bx repository.
+
+General
+~~~~~~~
+
+::
+
+ cd bgfx
+ make
+
+After calling ``make``, .build/projects/\* directory will be generated.
+All intermediate files generated by compiler will be inside .build
+directory structure. Deleting .build directory at any time is safe.
+
+::
+
+ make <configuration>
+
+Configuration is ``<platform>-<debug/release>[32/64]``. For example:
+
+::
+
+ linux-release64, wasm-debug, wasm-release, osx-debug, osx-release, android-arm64-release, etc.
+
+Windows
+~~~~~~~
+
+Visual Studio 2017 command line:
+
+::
+
+ make vs2017-release64
+
+Visual Studio 2017 IDE:
+
+::
+
+ start .build/projects/vs2017/bgfx.sln
+
+Xcode
+~~~~~
+
+Xcode command line:
+
+::
+
+ make osx-release
+ cd examples/runtime
+ ../../.build/osx64_clang/bin/examples.app/Contents/MacOS/examplesRelease
+
+Xcode IDE:
+
+::
+
+ ../bx/tools/bin/darwin/genie --with-combined-examples --xcode=osx xcode9
+ open .build/projects/xcode9-osx/bgfx.xcworkspace
+
+Due to `inability <https://github.com/bkaradzic/genie/blob/master/docs/scripting-reference.md#debugdirpath>`__
+to set working directory for an Xcode project from `GENie <https://github.com/bkaradzic/genie#genie---project-generator-tool>`__
+configuration file, it has to be set manually for each example project:
+
+1. Open *"Edit scheme..."* dialog for a given project.
+2. Select *"Run"* settings.
+3. Check *"Use custom working directory"* and enter following path:
+ ``${PROJECT_DIR}/../../../examples/runtime``.
+
+Linux
+~~~~~
+
+::
+
+ make linux-release64
+
+WinRT / UWP
+~~~~~~~~~~~
+
+::
+
+ ..\bx\tools\bin\windows\genie --vs=winstore100 vs2017
+
+Build the resulting solution and deploy to device.
+
+.. note:: Shaders will need to be compiled with the appropriate target profile for your platform.
+
+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 <https://github.com/bkaradzic/bgfx/blob/master/src/amalgamated.cpp>`__
+(for OSX/iOS use
+`src/amalgamated.mm <https://github.com/bkaradzic/bgfx/blob/master/src/amalgamated.mm>`__
+instead) inside different build system.
+
+Tools
+-----
+
+To build bgfx project files for tools, use ``--with-tools`` option:
+
+::
+
+ ..\bx\tools\bin\windows\genie --with-tools vs2017
+
+
+Alternative build systems
+-------------------------
+
+**CMake**
+
+ - https://github.com/bkaradzic/bgfx.cmake
+ - https://github.com/JoshuaBrookover/bgfx.cmake#bgfxcmake
+ - https://github.com/pr0g/sdl-bgfx-imgui-starter#sdl-bgfx-imgui-starter
+ - https://github.com/yuki-koyama/hello-bgfx
+ - https://github.com/ataulien/bgfx-cmake
+
+**fips** is a highlevel build system wrapper written in Python for C/C++ projects.
+https://github.com/floooh/fips#fips
+
+**Conan** package
+https://github.com/firefalcom/bgfx-conan
+
+Minimal example without bgfx's example harness
+----------------------------------------------
+
+This project demonstrates minimal amount of code needed to integrate bgfx with GLFW, but without
+any of existing bgfx example harness. It also demonstrates how to build bgfx with alternative build
+system.
+
+https://github.com/jpcy/bgfx-minimal-example
diff --git a/3rdparty/bgfx/docs/examples.rst b/3rdparty/bgfx/docs/examples.rst
new file mode 100644
index 00000000000..036f2087e64
--- /dev/null
+++ b/3rdparty/bgfx/docs/examples.rst
@@ -0,0 +1,706 @@
+Examples
+========
+
+Most of the examples require shader/texture/mesh data to be loaded. When
+running examples your current directory should be examples/runtime.
+
+::
+
+ <bgfx_path>/examples/runtime $ ../../.build/<config>/bin/example-00-helloworldDebug
+
+`00-helloworld <https://github.com/bkaradzic/bgfx/blob/master/examples/00-helloworld>`__
+----------------------------------------------------------------------------------------
+
+Initialization and debug text.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/00-helloworld/screenshot.png
+ :alt: example-00-helloworld
+
+`01-cubes <https://github.com/bkaradzic/bgfx/blob/master/examples/01-cubes/cubes.cpp>`__
+----------------------------------------------------------------------------------------
+
+Rendering simple static mesh.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/01-cubes/screenshot.png
+ :alt: example-01-cubes
+
+`02-metaballs <https://github.com/bkaradzic/bgfx/blob/master/examples/02-metaballs>`__
+--------------------------------------------------------------------------------------
+
+Rendering with transient buffers and embedding shaders.
+
+.. raw:: html
+
+ <div class="emscripten">
+ <progress value="0" max="100" id="progress" hidden=1></progress>
+ </div>
+
+ <div class="spinner" id='spinner'></div>
+ <div class="emscripten" id="status">Downloading...</div>
+ <div class="emscripten_border">
+ <canvas class="emscripten" id="canvas" oncontextmenu="event.preventDefault()"></canvas>
+ </div>
+
+ <script type='text/javascript'>
+ var statusElement = document.getElementById('status');
+ var progressElement = document.getElementById('progress');
+ var spinnerElement = document.getElementById('spinner');
+
+ var Module = {
+ preRun: [],
+ postRun: [],
+ print: (function() {
+ var element = document.getElementById('output');
+ if (element) element.value = ''; // clear browser cache
+ return function(text) {
+ if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
+ // These replacements are necessary if you render to raw HTML
+ //text = text.replace(/&/g, "&amp;");
+ //text = text.replace(/</g, "&lt;");
+ //text = text.replace(/>/g, "&gt;");
+ //text = text.replace('\n', '<br>', 'g');
+ console.log(text);
+ if (element) {
+ element.value += text + "\n";
+ element.scrollTop = element.scrollHeight; // focus on bottom
+ }
+ };
+ })(),
+ printErr: function(text) {
+ if (arguments.length > 1) text = Array.prototype.slice.call(arguments).join(' ');
+ if (0) { // XXX disabled for safety typeof dump == 'function') {
+ dump(text + '\n'); // fast, straight to the real console
+ } else {
+ console.error(text);
+ }
+ },
+ canvas: (function() {
+ var canvas = document.getElementById('canvas');
+
+ // As a default initial behavior, pop up an alert when webgl context is lost. To make your
+ // application robust, you may want to override this behavior before shipping!
+ // See http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.15.2
+ canvas.addEventListener("webglcontextlost", function(e) { alert('WebGL context lost. You will need to reload the page.'); e.preventDefault(); }, false);
+
+ return canvas;
+ })(),
+ setStatus: function(text) {
+ if (!Module.setStatus.last) Module.setStatus.last = { time: Date.now(), text: '' };
+ if (text === Module.setStatus.text) return;
+ var m = text.match(/([^(]+)\((\d+(\.\d+)?)\/(\d+)\)/);
+ var now = Date.now();
+ if (m && now - Date.now() < 30) return; // if this is a progress update, skip it if too soon
+ if (m) {
+ text = m[1];
+ progressElement.value = parseInt(m[2])*100;
+ progressElement.max = parseInt(m[4])*100;
+ progressElement.hidden = false;
+ spinnerElement.hidden = false;
+ } else {
+ progressElement.value = null;
+ progressElement.max = null;
+ progressElement.hidden = true;
+ if (!text) spinnerElement.style.display = 'none';
+ }
+ statusElement.innerHTML = text;
+ },
+ totalDependencies: 0,
+ monitorRunDependencies: function(left) {
+ this.totalDependencies = Math.max(this.totalDependencies, left);
+ Module.setStatus(left ? 'Preparing... (' + (this.totalDependencies-left) + '/' + this.totalDependencies + ')' : 'All downloads complete.');
+ }
+ };
+ Module.setStatus('Downloading...');
+ window.onerror = function(event) {
+ // TODO: do not warn on ok events like simulating an infinite loop or exitStatus
+ Module.setStatus('Exception thrown, see JavaScript console');
+ spinnerElement.style.display = 'none';
+ Module.setStatus = function(text) {
+ if (text) Module.printErr('[post-exception status] ' + text);
+ };
+ };
+ </script>
+ <script async type="text/javascript" src="example-02-metaballsRelease.bc.js"></script>
+
+`03-raymarch <https://github.com/bkaradzic/bgfx/blob/master/examples/03-raymarch>`__
+------------------------------------------------------------------------------------
+
+Updating shader uniforms.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/03-raymarch/screenshot.png
+ :alt: example-03-raymarch
+
+`04-mesh <https://github.com/bkaradzic/bgfx/blob/master/examples/04-mesh>`__
+----------------------------------------------------------------------------
+
+Loading meshes.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/04-mesh/screenshot.png
+ :alt: example-04-mesh
+
+`05-instancing <https://github.com/bkaradzic/bgfx/blob/master/examples/05-instancing>`__
+----------------------------------------------------------------------------------------
+
+Geometry instancing.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/05-instancing/screenshot.png
+ :alt: example-05-instancing
+
+`06-bump <https://github.com/bkaradzic/bgfx/blob/master/examples/06-bump>`__
+----------------------------------------------------------------------------
+
+Loading textures.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/06-bump/screenshot.png
+ :alt: example-06-bump
+
+`07-callback <https://github.com/bkaradzic/bgfx/blob/master/examples/07-callback>`__
+------------------------------------------------------------------------------------
+
+Implementing application specific callbacks for taking screen shots,
+caching OpenGL binary shaders, and video capture.
+
+`08-update <https://github.com/bkaradzic/bgfx/blob/master/examples/08-update>`__
+--------------------------------------------------------------------------------
+
+Updating textures.
+
+`09-hdr <https://github.com/bkaradzic/bgfx/tree/master/examples/09-hdr>`__
+--------------------------------------------------------------------------
+
+Using multiple views with frame buffers, and view order remapping.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/09-hdr/screenshot.png
+ :alt: example-09-hdr
+
+`10-font <https://github.com/bkaradzic/bgfx/tree/master/examples/10-font>`__
+----------------------------------------------------------------------------
+
+Use the font system to display text and styled text.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/10-font/screenshot.png
+ :alt: example-10-font
+
+`11-fontsdf <https://github.com/bkaradzic/bgfx/tree/master/examples/11-fontsdf>`__
+----------------------------------------------------------------------------------
+
+Use a single distance field font to render text of various size.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/11-fontsdf/screenshot.png
+ :alt: example-11-fontsdf
+
+`12-lod <https://github.com/bkaradzic/bgfx/tree/master/examples/12-lod>`__
+--------------------------------------------------------------------------
+
+Mesh LOD transitions.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/12-lod/screenshot.png
+ :alt: example-12-lod
+
+`13-stencil <https://github.com/bkaradzic/bgfx/tree/master/examples/13-stencil>`__
+----------------------------------------------------------------------------------
+
+Stencil reflections and shadows.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/13-stencil/screenshot.png
+ :alt: example-13-stencil
+
+`14-shadowvolumes <https://github.com/bkaradzic/bgfx/tree/master/examples/14-shadowvolumes>`__
+----------------------------------------------------------------------------------------------
+
+Shadow volumes.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/14-shadowvolumes/screenshot.png
+ :alt: example-14-shadowvolumes
+
+`15-shadowmaps-simple <https://github.com/bkaradzic/bgfx/tree/master/examples/15-shadowmaps-simple>`__
+------------------------------------------------------------------------------------------------------
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/15-shadowmaps-simple/screenshot.png
+ :alt: example-15-shadowmaps-simple
+
+`16-shadowmaps <https://github.com/bkaradzic/bgfx/tree/master/examples/16-shadowmaps>`__
+----------------------------------------------------------------------------------------
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/16-shadowmaps/screenshot.png
+ :alt: example-16-shadowmaps
+
+`17-drawstress <https://github.com/bkaradzic/bgfx/blob/master/examples/17-drawstress>`__
+----------------------------------------------------------------------------------------
+
+60Hz
+^^^^
+
+Draw stress is CPU stress test to show what is the maximum number of
+draw calls while maintaining 60Hz frame rate. bgfx currently has default
+limit of 64K draw calls per frame. You can increase this limit by
+changing ``BGFX_CONFIG_MAX_DRAW_CALLS``.
+
++-----------------+----------------+--------------+------------------------+-------+----------+
+| CPU | Renderer | GPU | Arch/Compiler/OS | Dim | Calls |
++=================+================+==============+========================+=======+==========+
+| i7-4770K 4.2 | GL2.1 | 2xGTX780 | x64/VS2013/Win 8.1 | 51 | 132651 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-4770K 4.2 | DX11 | 2xGTX780 | x64/VS2013/Win 8.1 | 50 | 125000 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-4790K 4.0 | GL2.1 | GTX970 | x64/VS2015/Win 10 | 47 | 103823 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-4790K 4.0 | DX11 | GTX970 | x64/VS2015/Win 10 | 45 | 91125 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-4790K 4.0 | DX9 | GTX970 | x64/VS2013/Win 10 | 40 | 64000 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i5-3570 3.8 | NV 331.49 | GTX560Ti | x64/GCC/Linux | 40 | 64000+ |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | GL2.1 | GTX650Ti | x64/VS2008/Win 7 | 38 | 54872 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | GL2.1 | GTX650Ti | x86/VS2008/Win 7 | 38 | 54872 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-6700K 4.0 | GL2.1 | Skylake GT2 | x64/GCC/Win 10 | 38 | 54872 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-4790K 4.0 | DX11 | R7 240 | x64/VS2015/Win 10 | 36 | 46656 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | NV 331.113 | GTX650Ti | x64/GCC/Linux | 34 | 39304 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-6700K 4.0 | DX11 | Skylake GT2 | x64/GCC/Win 10 | 34 | 39304 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-4790K 4.0 | DX9 | R7 240 | x64/VS2015/Win 10 | 32 | 32768 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | DX9 | GTX650Ti | x64/GCC/Win 7 | 32 | 32768 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | DX9 | GTX650Ti | x64/VS2008/Win 7 | 32 | 32768 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | DX9 | GTX650Ti | x86/GCC/Win 7 | 30 | 27000 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | DX9 | GTX650Ti | x86/VS2008/Win 7 | 30 | 27000 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i5-6200U 2.3 | DX11 | Intel 520 | x64/GCC/Win 10 | 30 | 27000 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i5-4250U 1.3 | GL2.1 | HD5000 | x64/Clang/OSX 10.9 | 28 | 21852 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| Q8200 2.33 | NV 319.32 | GTX260 | x64/GCC/Linux | 27 | 19683 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-6700K 4.0 | GL2.1 | Skylake GT2 | x64/GCC/Linux | 27 | 19683 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-2600K 3.4 | DX9 | AMD6800 | x64/VS2012/Win 7 | 27 | 19683 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-2600K 3.4 | GL2.1 | AMD6800 | x64/VS2012/Win 7 | 26 | 17576 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-4770R 3.2 | Mesa 10.5.9 | HD5200 | x64/GCC/Linux | 26 | 17576 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i5-6200U 2.3 | GL | Intel 520 | x64/GCC/Win 10 | 26 | 17576 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | DX9-Wine | GTX650Ti | x64/GCC/Linux | 24 | 13824 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i5-6200U 2.3 | Mesa 10.5.9 | Intel 520 | x64/GCC/Linux | 23 | 12167 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-4750HQ 2.0 | Mesa 10.0.1 | HD5200 | x64/GCC/Linux | 22 | 10648 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-4750HQ 2.0 | Mesa 10.1.3 | HD5200 | x64/GCC/Linux | 21 | 9261 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | ES2-ANGLE | GTX650Ti | x86/VS2008/Win 7 | 21 | 9261 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| Q8200 2.33 | Gallium 0.4 | AMD5770 | x64/GCC/Linux | 21 | 9261 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i5-4250U 1.3 | ES2 | HD5000 | JIT/Clang/PNaCl 31 | 21 | 9261 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i5-4250U 1.3 | ES2 | HD5000 | x86/GCC/NaCl 31 | 20 | 8000 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| Q8200 2.33 | Gallium 0.4 | GTX260 | x64/GCC/Linux | 19 | 6859 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i5-2450M 2.5 | Mesa 10.2.0 | HD3000 | x64/GCC/Linux | 19 | 6859 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | ES2-PowerVR | GTX650Ti | x86/VS2008/Win 7 | 18 | 5832 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | FF27-GL | GTX650Ti | JIT/Clang/W7-asm.js | 17 | 4913 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-6700K 4.0 | DX9 | Skylake GT2 | x64/GCC/Win 10 | 16 | 4096 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-4750HQ 2.0 | Mesa 8.0.5 | LLVMPIPE | x64/GCC/Linux | 16 | 4096 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i5-6200U 2.3 | DX9 | Intel 520 | x64/GCC/Win 10 | 16 | 4096 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | ES2-Qualcomm | GTX650Ti | x86/VS2008/Win 7 | 15 | 3375 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | ES2 | GTX650Ti | x64/GCC/NaCl 31 | 15 | 3375 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | ES2 | GTX650Ti | JIT/Clang/PNaCl 31 | 15 | 3375 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| Q8200 2.33 | NV 319.32 | GTX260 | x64/GCC/NaCl 31 | 15 | 3375 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| Q8200 2.33 | NV 319.32 | GTX260 | x64/GCC/PNaCl 31 | 15 | 3375 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| '12 Nexus 7 | ES2 | Tegra3 | ARM/GCC/Android | 15 | 3375 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i5-4250U 1.3 | ES2-FF27 | HD5000 | JIT/Clang/OSX-asm.js | 15 | 3375 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i5-4250U 1.3 | Chrome33 | HD5000 | JIT/Clang/OSX-asm.js | 15 | 3375 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| iPad mini 2 | ES2 | PVR G6430 | ARM64/Clang/iOS7 | 15 | 3375 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | Chrome33 | GTX650Ti | JIT/Clang/W7-asm.js | 14 | 2744 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | FF27-ANGLE | GTX650Ti | JIT/Clang/W7-asm.js | 14 | 2744 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| '13 Nexus 10 | ES2 | Mali T604 | ARM/GCC/Android | 13 | 2197 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| iPhone 5 | ES2 | PVR SGX543 | ARM/Clang/iOS7 | 13 | 2197 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| '13 Nexus 7 | ES2 | S4 Pro | ARM/GCC/Android | 12 | 1728 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| iPad 2 | ES2 | PVR SGX543 | ARM/Clang/iOS6 | 12 | 1728 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| AMD A4-5000 | Gallium 0.4 | HD8330/Kabini| x64/GCC/Linux | 12 | 1728 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| Xperia Z | ES2 | Adreno320 | ARM/GCC/Android | 11 | 1331 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| iPod 4 | ES2 | PVR SGX535 | ARM/Clang/iOS6 | 7 | 343 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i7-920 2.66 | ES2-Mali | GTX650Ti | x86/VS2008/Windows7 | 6 | 216 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| Creator CI20 | ES2 | PVR SGX540 | MIPS/GCC/Debian8 | 7 | 343 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| i5-6200U 2.3 | ES2 | SwiftShader | x64/GCC/Linux | 6 | 216 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+| RaspberryPi | ES2 | VC IV | ARM/GCC/Raspbian | 6 | 216 |
++-----------------+----------------+--------------+------------------------+-------+----------+
+
+To test browsers in 60Hz mode following changes were made:
+
+- Firefox 27 about:config adjustments: ``webgl.prefer-native-gl true``
+ (on Windows), and ``layout.frame_rate 500``.
+- Chrome 33 command line option: ``--disable-gpu-vsync``.
+
+30Hz (test for browsers)
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+By default browsers are using vsync, and don't have option to turn it
+off programmatically.
+
++----------------+------------+------------+--------------------------+-------+----------+
+| CPU | Renderer | GPU | Arch/Compiler/OS | Dim | Calls |
++================+============+============+==========================+=======+==========+
+| i7-920 2.66 | GL2.1 | GTX650Ti | x64/VS2008/Win7 | 38 | 64000+ |
++----------------+------------+------------+--------------------------+-------+----------+
+| i5-4250U 1.3 | GL2.1 | HD5000 | x64/Clang/OSX 10.9 | 36 | 46656 |
++----------------+------------+------------+--------------------------+-------+----------+
+| i5-4250U 1.3 | Chrome34 | HD5000 | JIT/Clang/OSX-PNaCl 31 | 28 | 21952 |
++----------------+------------+------------+--------------------------+-------+----------+
+| i5-4250U 1.3 | Chrome33 | HD5000 | JIT/Clang/OSX-PNaCl 31 | 27 | 19683 |
++----------------+------------+------------+--------------------------+-------+----------+
+| i5-4250U 1.3 | FF28 | HD5000 | JIT/Clang/OSX-asm.js | 25 | 15625 |
++----------------+------------+------------+--------------------------+-------+----------+
+| i5-4250U 1.3 | FF36 | HD5000 | JIT/Clang/OSX-asm.js | 25 | 15625 |
++----------------+------------+------------+--------------------------+-------+----------+
+| i5-4250U 1.3 | Chrome41 | HD5000 | x64/GCC/OSX-NaCl 41 | 24 | 13824 |
++----------------+------------+------------+--------------------------+-------+----------+
+| i5-4250U 1.3 | FF37 | HD5000 | JIT/Clang/OSX-asm.js | 23 | 12167 |
++----------------+------------+------------+--------------------------+-------+----------+
+| i5-4250U 1.3 | FF27 | HD5000 | JIT/Clang/OSX-asm.js | 20 | 8000 |
++----------------+------------+------------+--------------------------+-------+----------+
+| i7-920 2.66 | Chrome33 | GTX650Ti | JIT/Clang/W7-PNaCl 31 | 20 | 8000 |
++----------------+------------+------------+--------------------------+-------+----------+
+| i7-920 2.66 | Chrome34 | GTX650Ti | JIT/Clang/W7-asm.js | 18 | 5832 |
++----------------+------------+------------+--------------------------+-------+----------+
+| i7-920 2.66 | Chrome33 | GTX650Ti | JIT/Clang/W7-asm.js | 18 | 5832 |
++----------------+------------+------------+--------------------------+-------+----------+
+| i7-920 2.66 | FF28 | GTX650Ti | JIT/Clang/W7-asm.js | 18 | 5832 |
++----------------+------------+------------+--------------------------+-------+----------+
+| i7-920 2.66 | FF27 | GTX650Ti | JIT/Clang/W7-asm.js | 18 | 5832 |
++----------------+------------+------------+--------------------------+-------+----------+
+| i5-4250U 1.3 | Safari7 | HD5000 | JIT/Clang/OSX-asm.js | 15 | 3375 |
++----------------+------------+------------+--------------------------+-------+----------+
+
+`18-ibl <https://github.com/bkaradzic/bgfx/tree/master/examples/18-ibl>`__
+--------------------------------------------------------------------------
+
+Image-based lighting.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/18-ibl/screenshot.png
+ :alt: example-18-ibl
+
+`19-oit <https://github.com/bkaradzic/bgfx/tree/master/examples/19-oit>`__
+--------------------------------------------------------------------------
+
+Weighted, Blended Order-Independent Transparency
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/19-oit/screenshot.png
+ :alt: example-19-oit
+
+`20-nanovg <https://github.com/bkaradzic/bgfx/tree/master/examples/20-nanovg>`__
+--------------------------------------------------------------------------------
+
+NanoVG is small antialiased vector graphics rendering library.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/20-nanovg/screenshot.png
+ :alt: example-20-nanovg
+
+`21-deferred <https://github.com/bkaradzic/bgfx/tree/master/examples/21-deferred>`__
+------------------------------------------------------------------------------------
+
+MRT rendering and deferred shading.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/21-deferred/screenshot.png
+ :alt: example-21-deferred
+
+`22-windows <https://github.com/bkaradzic/bgfx/tree/master/examples/22-windows>`__
+----------------------------------------------------------------------------------
+
+Rendering into multiple windows.
+
+`23-vectordisplay <https://github.com/bkaradzic/bgfx/tree/master/examples/23-vectordisplay>`__
+----------------------------------------------------------------------------------------------
+
+Rendering lines as oldschool vectors.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/23-vectordisplay/screenshot.png
+ :alt: example-23-vectordisplay
+
+`24-nbody <https://github.com/bkaradzic/bgfx/tree/master/examples/24-nbody>`__
+------------------------------------------------------------------------------
+
+N-body simulation with compute shaders using buffers.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/24-nbody/screenshot.png
+ :alt: example-24-nbody
+
+`25-c99 <https://github.com/bkaradzic/bgfx/tree/master/examples/25-c99>`__
+--------------------------------------------------------------------------
+
+Initialization and debug text with C99 API.
+
+`26-occlusion <https://github.com/bkaradzic/bgfx/tree/master/examples/26-occlusion>`__
+--------------------------------------------------------------------------------------
+
+Using occlusion query for conditional rendering.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/26-occlusion/screenshot.png
+ :alt: example-26-occlusion
+
+`27-terrain <https://github.com/bkaradzic/bgfx/tree/master/examples/27-terrain>`__
+----------------------------------------------------------------------------------
+
+Terrain painting example.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/27-terrain/screenshot.png
+ :alt: example-27-terrain
+
+`28-wireframe <https://github.com/bkaradzic/bgfx/tree/master/examples/28-wireframe>`__
+--------------------------------------------------------------------------------------
+
+Drawing wireframe mesh.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/28-wireframe/screenshot.png
+ :alt: example-28-wireframe
+
+`29-debugdraw <https://github.com/bkaradzic/bgfx/tree/master/examples/29-debugdraw>`__
+--------------------------------------------------------------------------------------
+
+Debug draw.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/29-debugdraw/screenshot.png
+ :alt: example-29-debugdraw
+
+`30-picking <https://github.com/bkaradzic/bgfx/tree/master/examples/30-picking>`__
+--------------------------------------------------------------------------------------
+
+Mouse picking via GPU readback.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/30-picking/screenshot.png
+ :alt: example-30-picking
+
+`31-rsm <https://github.com/bkaradzic/bgfx/tree/master/examples/31-rsm>`__
+--------------------------------------------------------------------------------------
+
+Global Illumination with Reflective Shadow Map.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/31-rsm/screenshot.png
+ :alt: example-31-rsm
+
+`32-particles <https://github.com/bkaradzic/bgfx/tree/master/examples/32-particles>`__
+--------------------------------------------------------------------------------------
+
+Particles.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/32-particles/screenshot.png
+ :alt: example-32-particles
+
+`33-pom <https://github.com/bkaradzic/bgfx/tree/master/examples/33-pom>`__
+--------------------------------------------------------------------------
+
+Parallax occlusion mapping.
+
+Reference(s):
+ - `Exploring bump mapping with WebGL <http://apoorvaj.io/exploring-bump-mapping-with-webgl.html>`__
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/33-pom/screenshot.png
+ :alt: example-33-pom
+
+`34-mvs <https://github.com/bkaradzic/bgfx/tree/master/examples/34-mvs>`__
+--------------------------------------------------------------------------
+
+Multiple vertex streams.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/34-mvs/screenshot.png
+ :alt: example-34-mvs
+
+`35-dynamic <https://github.com/bkaradzic/bgfx/tree/master/examples/35-dynamic>`__
+----------------------------------------------------------------------------------
+
+Dynamic buffers update.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/35-dynamic/screenshot.png
+ :alt: example-35-dynamic
+
+`36-sky <https://github.com/bkaradzic/bgfx/tree/master/examples/36-sky>`__
+--------------------------------------------------------------------------
+
+Perez dynamic sky model.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/36-sky/screenshot.png
+ :alt: example-36-sky
+
+`37-gpudrivenrendering <https://github.com/bkaradzic/bgfx/tree/master/examples/37-gpudrivenrendering>`__
+--------------------------------------------------------------------------------------------------------
+
+GPU-Driven Rendering.
+
+Reference(s):
+ - `Experiments in GPU-based occlusion culling <https://interplayoflight.wordpress.com/2017/11/15/experiments-in-gpu-based-occlusion-culling/>`__,
+ - `Experiments in GPU-based occlusion culling part 2: MultiDrawIndirect and mesh lodding <https://interplayoflight.wordpress.com/2018/01/15/experiments-in-gpu-based-occlusion-culling-part-2-multidrawindirect-and-mesh-lodding/>`__,
+ - `Porting GPU driven occlusion culling to bgfx <https://interplayoflight.wordpress.com/2018/03/05/porting-gpu-driven-occlusion-culling-to-bgfx/>`__.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/37-gpudrivenrendering/screenshot.png
+ :alt: example-37-gpudrivenrendering
+
+`38-bloom <https://github.com/bkaradzic/bgfx/tree/master/examples/38-bloom>`__
+------------------------------------------------------------------------------
+
+Bloom.
+
+Reference(s):
+ - `Next Generation Post Processing in Call of Duty: Advanced Warfare <http://www.iryoku.com/next-generation-post-processing-in-call-of-duty-advanced-warfare>`__.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/38-bloom/screenshot.png
+ :alt: example-38-bloom
+
+`39-assao <https://github.com/bkaradzic/bgfx/tree/master/examples/39-assao>`__
+------------------------------------------------------------------------------
+
+Adaptive Screen Space Ambient Occlusion.
+
+Reference(s):
+ - `Adaptive Screen Space Ambient Occlusion <https://software.intel.com/en-us/articles/adaptive-screen-space-ambient-occlusion>`__.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/39-assao/screenshot.png
+ :alt: example-39-assao
+
+`40-svt <https://github.com/bkaradzic/bgfx/tree/master/examples/40-svt>`__
+--------------------------------------------------------------------------
+
+Sparse Virtual Textures.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/40-svt/screenshot.png
+ :alt: example-40-svt
+
+`41-tess <https://github.com/bkaradzic/bgfx/tree/master/examples/41-tess>`__
+----------------------------------------------------------------------------
+
+Adaptive GPU Tessellation with Compute Shaders
+
+Reference(s):
+ - `Adaptive GPU Tessellation with Compute Shaders by Jad Khoury, Jonathan Dupuy, and Christophe Riccio <http://onrendering.com/data/papers/isubd/isubd.pdf>`__.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/41-tess/screenshot.png
+ :alt: example-41-tess
+
+`42-bunnylod <https://github.com/bkaradzic/bgfx/tree/master/examples/42-bunnylod>`__
+------------------------------------------------------------------------------------
+
+Simple Polygon Reduction
+
+Reference(s):
+ - `Simple Polygon Reduction <https://web.archive.org/web/20020114194131/http://www.melax.com/polychop/>`__.
+ - `A Simple, Fast,and Effective Polygon Reduction Algorithm <https://web.archive.org/web/20031204035320/http://www.melax.com/polychop/gdmag.pdf>`__.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/42-bunnylod/screenshot.png
+ :alt: example-42-bunnylod
+
+`43-denoise <https://github.com/bkaradzic/bgfx/tree/master/examples/43-denoise>`__
+----------------------------------------------------------------------------------
+
+Denoise
+
+Reference(s):
+ - `Spatiotemporal Variance-Guided Filtering: Real-Time Reconstruction for Path-Traced Global Illumination. <https://web.archive.org/web/20170720213354/https://research.nvidia.com/sites/default/files/pubs/2017-07_Spatiotemporal-Variance-Guided-Filtering%3A/svgf_preprint.pdf>`__.
+ - `Streaming G-Buffer Compression for Multi-Sample Anti-Aliasing <https://web.archive.org/web/20200807211002/https://software.intel.com/content/www/us/en/develop/articles/streaming-g-buffer-compression-for-multi-sample-anti-aliasing.html>`__.
+ - `Edge-Avoiding À-Trous Wavelet Transform for fast Global Illumination Filtering <https://web.archive.org/web/20130412085423/https://www.uni-ulm.de/fileadmin/website_uni_ulm/iui.inst.100/institut/Papers/atrousGIfilter.pdf>`__.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/43-denoise/screenshot.png
+ :alt: example-43-denoise
+
+`44-sss <https://github.com/bkaradzic/bgfx/tree/master/examples/44-sss>`__
+--------------------------------------------------------------------------
+
+Screen-Space Shadows
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/44-sss/screenshot.png
+ :alt: example-44-sss
+
+`45-bokeh <https://github.com/bkaradzic/bgfx/tree/master/examples/45-bokeh>`__
+------------------------------------------------------------------------------
+
+Bokeh Depth of Field
+
+Reference(s):
+ - `Bokeh depth of field in a single pass <https://web.archive.org/web/20201215123940/https://blog.tuxedolabs.com/2018/05/04/bokeh-depth-of-field-in-single-pass.html>`__.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/45-bokeh/screenshot.png
+ :alt: example-45-bokeh
+
+`46-fsr <https://github.com/bkaradzic/bgfx/tree/master/examples/46-fsr>`__
+--------------------------------------------------------------------------
+
+AMD FidelityFX Super Resolution - high-quality solution for producing high resolution frames
+from lower resolution inputs.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/46-fsr/screenshot.png
+ :alt: example-46-fsr
+
+`47-pixelformats <https://github.com/bkaradzic/bgfx/tree/master/examples/47-pixelformats>`__
+--------------------------------------------------------------------------------------------
+
+Pixel Formats
+
+View and test texture formats
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/47-pixelformats/screenshot.png
+ :alt: example-47-pixelformats
+
+`48-drawindirect <https://github.com/bkaradzic/bgfx/tree/master/examples/48-drawindirect>`__
+---------------------------------------------------------------------------------------------
+
+Draw Indirect
+
+Simple example of indirect rendering + an implementation of multidraw indirect
+
+Reference(s):
+ - `OpenGL MultiDrawIndirect with per-instance textures <https://web.archive.org/web/20201109155619/https://litasa.github.io/blog/2017/09/04/OpenGL-MultiDrawIndirect-with-Individual-Textures>`__.
+ - `Indirect Rendering - A way to a million draw calls <https://web.archive.org/web/20210926073337/https://cpp-rendering.io/indirect-rendering>`__.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/48-drawindirect/screenshot.png
+ :alt: example-48-drawindirect
+
+
+`49-hextile <https://github.com/bkaradzic/bgfx/tree/master/examples/49-hextile>`__
+---------------------------------------------------------------------------------------------
+
+Realtime Hex-Tiling
+
+Simple example of how to use Hex-tiling in real time, ported from https://github.com/mmikk/hextile-demo
+
+Reference(s):
+ - `Hex-Tiling demo <https://github.com/mmikk/hextile-demo>`__.
+ - `Paper explaining concepts - <https://github.com/mmikk/mmikk.github.io/blob/master/papers3d/mm_hex_compressed.pdf>`__.
+
+.. figure:: https://github.com/bkaradzic/bgfx/raw/master/examples/49-hextile/screenshot.png
+ :alt: example-49-hextile
diff --git a/3rdparty/bgfx/docs/index.rst b/3rdparty/bgfx/docs/index.rst
new file mode 100644
index 00000000000..8a096171758
--- /dev/null
+++ b/3rdparty/bgfx/docs/index.rst
@@ -0,0 +1,22 @@
+Documentation
+=============
+
+Cross-platform, graphics API agnostic, “Bring Your Own Engine/Framework” style rendering library,
+licensed under permissive BSD-2 clause open source license.
+
+Source at GitHub:
+ - https://github.com/bkaradzic/bgfx
+
+Contents
+--------
+
+.. toctree::
+ :maxdepth: 3
+
+ overview
+ build
+ examples
+ bgfx
+ tools
+ internals
+ license
diff --git a/3rdparty/bgfx/docs/internals.rst b/3rdparty/bgfx/docs/internals.rst
new file mode 100644
index 00000000000..8e71d76eb3e
--- /dev/null
+++ b/3rdparty/bgfx/docs/internals.rst
@@ -0,0 +1,50 @@
+Internals
+=========
+
+Sort based draw call bucketing
+------------------------------
+
+bgfx is using sort-based draw call bucketing. This means that submission order doesn't necessarily match the rendering order, but on the low-level they will be sorted and ordered correctly. On the high level bgfx uses **declarative API** and internal sorting allows more optimal way of submitting draw calls for all passes at one place, and on the low-level this allows better optimization of rendering order. This sometimes creates undesired results usually for GUI rendering, where draw order should usually match submit order. bgfx provides way to enable sequential rendering for these cases (see ``bgfx::setViewMode``).
+
+ - More detailed description of sort-based draw call bucketing can be found at: `Order your graphics draw calls around! <http://realtimecollisiondetection.net/blog/?p=86>`__
+
+API and render thread
+---------------------
+
+API thread is thread from which ``bgfx::init`` is called. Once ``bgfx::init`` is called on thread, internally bgfx assumes that all API calls will be called from the same thread with exception of Resource, View, and Encoder API.
+
+Render thread from where internal rendering ``bgfx::renderFrame`` is called. On most of OS' it's required that this call be called on thread that OS created when executing process (some refer to this thread as "main" thread, or thread where ``main`` function is called).
+
+When bgfx is compiled with option ``BGFX_CONFIG_MULTITHREADED=1`` (default is on) ``bgfx::renderFrame`` can be called by user. It's required to be called before ``bgfx::init`` from thread that will be used as render thread. If both ``bgfx::renderFrame`` and ``bgfx::init`` are called from the same thread, bgfx will switch to execute in single threaded mode, and calling ``bgfx::renderFrame`` is not required, since it will be called automatically during ``bgfx::frame`` call.
+
+Resource API
+------------
+
+Any API call starting with ``bgfx::create*``, ``bgfx::destroy*``, ``bgfx::update*``, ``bgfx::alloc*`` is considered part of resource API. Internally resource API calls are guarded by mutex. There is no limit of number of threads that can call resource API simultaneously. Calling any resource API is infrequent, and functions are cheap since most of work with resource is done at later point on render thread.
+
+View API
+--------
+
+Any API call starting with ``bgfx::setView*`` is considered part of view API. View API is not designed to be thread safe at all since all views are independentent from each other. Calling any view API for different views from different threads is safe. What's not safe is to update the same view from multiple threads. This will lead to undefined behavior. Only view API that has to be set before any draw calls are issued is view mode ``bgfx::setViewMode``. Internal encoder requires view mode to select sort key encoding and if user changes view mode after submit it will cause incorrect sort behavior within the view.
+
+Encoder API
+-----------
+
+Encoder API can be obtained by calling ``bgfx::begin``. bgfx by default allows 8 simultaneous threads to use encoders. This can be configured by changing ``Limits.maxEncoders`` init option of ``bgfx::Init`` structure.
+
+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 <http://www.g-truc.net/post-0457.html>`__
+
+If you're targeting specific mobile hardware, you can find GLES support in their official SDKs: `Adreno
+SDK <http://developer.qualcomm.com/mobile-development/mobile-technologies/gaming-graphics-optimization-adreno/tools-and-resources>`__, `Mali SDK <http://www.malideveloper.com/>`__, `PowerVR SDK <http://www.imgtec.com/powervr/insider/sdkdownloads/>`__.
+
+All configuration settings are located inside `src/config.h <https://github.com/bkaradzic/bgfx/blob/master/src/config.h>`__.
+
+Every ``BGFX_CONFIG_*`` setting can be changed by passing defines thru compiler switches. For example setting preprocessor define ``BGFX_CONFIG_RENDERER_OPENGL=1`` will change backend renderer to OpenGL 2.1. on Windows. Since rendering APIs are platform specific, this obviously won't work nor make sense in all cases.
+
+Options
+~~~~~~~
+
+``BGFX_CONFIG_MULTITHREADED`` is used to enable/disable threading support inside bgfx. By default set to 1 on all platforms that support threading.
diff --git a/3rdparty/bgfx/docs/license.rst b/3rdparty/bgfx/docs/license.rst
new file mode 100644
index 00000000000..130b994d2ba
--- /dev/null
+++ b/3rdparty/bgfx/docs/license.rst
@@ -0,0 +1,132 @@
+License
+=======
+
+`License (BSD 2-clause) <https://github.com/bkaradzic/bgfx/blob/master/LICENSE>`__
+----------------------------------------------------------------------------------
+
+::
+
+ Copyright 2010-2022 Branimir Karadzic
+
+ Redistribution and use in source and binary forms, with or without modification,
+ are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+ 2. 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.
+
+ 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 HOLDER 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.
+
+3rd Party Libraries
+-------------------
+
+All required 3rd party libraries are included in bgfx repository in
+`3rdparty/ <https://github.com/bkaradzic/bgfx/tree/master/3rdparty>`__
+directory.
+
+ - cgltf (`MIT <https://github.com/bkaradzic/bgfx/blob/master/3rdparty/cgltf/LICENSE>`__)
+ - Dear ImGui (`MIT <https://github.com/bkaradzic/bgfx/blob/master/3rdparty/dear-imgui/LICENSE.txt>`__)
+ - Blendish (`MIT <https://github.com/bkaradzic/bgfx/blob/67b2f1e2bfcf6015db6d8b5c2d6fcfd5cee7e167/examples/20-nanovg/blendish.h#L2-L22>`__)
+ - fcpp (`BSD <https://github.com/bkaradzic/bgfx/blob/master/3rdparty/fcpp/COPYING>`__)
+ - glsl-optimizer (`MIT <https://github.com/bkaradzic/bgfx/blob/master/3rdparty/glsl-optimizer/license.txt>`__)
+ - glslang (`Apache 2.0 <https://github.com/bkaradzic/bgfx/blob/master/3rdparty/glslang/LICENSE.txt>`__)
+ - IconFontCppHeaders (`MIT <https://github.com/bkaradzic/bgfx/blob/master/3rdparty/iconfontheaders/LICENSE>`__)
+ - meshoptimizer (`MIT <https://github.com/bkaradzic/bgfx/blob/master/3rdparty/meshoptimizer/LICENSE.md>`__)
+ - NanoVG (`ZLIB <https://github.com/bkaradzic/bgfx/blob/67b2f1e2bfcf6015db6d8b5c2d6fcfd5cee7e167/examples/common/nanovg/nanovg.cpp#L2-L16>`__)
+ - SDF (`MIT <https://github.com/bkaradzic/bgfx/blob/master/3rdparty/sdf/LICENSE.txt>`__)
+ - spirv-cross (`Apache 2.0 <https://github.com/bkaradzic/bgfx/blob/master/3rdparty/spirv-cross/LICENSE>`__)
+ - spirv-headers (`Khronos/MIT <https://github.com/bkaradzic/bgfx/blob/master/3rdparty/spirv-headers/LICENSE>`__)
+ - spirv-tools (`Apache 2.0 <https://github.com/bkaradzic/bgfx/blob/master/3rdparty/spirv-tools/LICENSE>`__)
+ - stb (`Public Domain <https://github.com/bkaradzic/bgfx/blob/master/3rdparty/stb/LICENSE>`__)
+
+Assets
+------
+
+Bunny
+
+ - `Stanford University Computer Graphics Laboratory <http://www-graphics.stanford.edu/data/3Dscanrep/>`__
+
+Uffizi
+
+ - `Light Probe Image Gallery <http://www.pauldebevec.com/Probes/>`__
+
+Wells
+
+ - `Bernhard Vogl Light probes <http://dativ.at/lightprobes/>`__
+
+Pisa, Ennis, Grace
+
+ - `High-Resolution Light Probe Image Gallery <http://gl.ict.usc.edu/Data/HighResProbes/>`__
+
+Droid Sans Font
+
+ - http://www.fontsquirrel.com/license/Droid-Sans
+
+Bleeding Cowboys Font
+
+ - http://www.dafont.com/bleeding-cowboys.font
+
+Cheap Fire Font
+
+ - http://www.dafont.com/cheap-fire.font
+
+Five Minutes Font
+
+ - http://www.fonts2u.com/fiveminutes.font
+
+Mias Scribblings Font
+
+ - http://www.dafont.com/mias-scribblings.font
+
+Ruritania Font
+
+ - http://www.dafont.com/ruritania.font
+
+Signika Font
+
+ - http://fontfabric.com/signika-font/
+
+Visitor Font
+
+ - http://www.dafont.com/visitor.font
+
+Special-Elite Font
+
+ - http://www.fontspace.com/astigmatic-one-eye-typographic-institute/special-elite
+
+FontAwesome Font
+
+ - http://fontawesome.io/
+
+Sherlock Holmes text
+
+ - http://www.gutenberg.org/ebooks/1661
+
+Tree Pack 1
+
+ - http://www.turbosquid.com/3d-models/free-obj-mode-tree-pack/506851
+
+Light Transport Equation Orb
+
+ - https://github.com/lighttransport/lighttransportequation-orb
+
+Normal map texture (GFDL License)
+
+ - `Julian Herzog <https://julianherzog.com/>`__
+ - https://commons.wikimedia.org/wiki/File:Normal_map_example_with_scene_and_result.png
+
+Hextile example-49 texture (CC0 License)
+
+ - https://polyhaven.com/a/aerial_rocks_04
diff --git a/3rdparty/bgfx/docs/overview.rst b/3rdparty/bgfx/docs/overview.rst
new file mode 100644
index 00000000000..ab119e79d69
--- /dev/null
+++ b/3rdparty/bgfx/docs/overview.rst
@@ -0,0 +1,300 @@
+Overview
+========
+
+What is it?
+-----------
+
+Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library,
+licensed under permissive BSD-2 clause open source license.
+
+.. raw:: html
+
+ <p>
+ <iframe src="https://ghbtns.com/github-btn.html?user=bkaradzic&repo=bgfx&type=star&count=true&size=large" frameborder="0" scrolling="0" width="160px" height="30px"></iframe>
+ <iframe src="https://ghbtns.com/github-btn.html?user=bkaradzic&repo=bgfx&type=fork&count=true&size=large" frameborder="0" scrolling="0" width="158px" height="30px"></iframe>
+ </p>
+
+Supported rendering backends
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- Direct3D 9
+- Direct3D 11
+- Direct3D 12
+- GNM (only for licensed PS4 developers, search DevNet forums for source)
+- Metal
+- OpenGL 2.1
+- OpenGL 3.1+
+- OpenGL ES 2
+- OpenGL ES 3.1
+- Vulkan
+- WebGL 1.0
+- WebGL 2.0
+- WebGPU/Dawn (experimental)
+
+Supported Platforms
+~~~~~~~~~~~~~~~~~~~
+
+- Android (14+, ARM, x86, MIPS)
+- FreeBSD
+- iOS (iPhone, iPad, AppleTV)
+- Linux
+- MIPS Creator CI20
+- OSX (10.12+)
+- PlayStation 4
+- RaspberryPi
+- UWP (Universal Windows, Xbox One)
+- Wasm/Emscripten
+- Windows (XP, Vista, 7, 8, 10)
+
+Supported Compilers
+~~~~~~~~~~~~~~~~~~~
+
+- Clang 3.3 and above
+- GCC 5 and above
+- vs2017 and above
+
+Supported Languages
+~~~~~~~~~~~~~~~~~~~
+
+- `C/C++ API documentation <https://bkaradzic.github.io/bgfx/bgfx.html>`__
+- `Beef API bindings <https://github.com/bkaradzic/bgfx/tree/master/bindings/bf>`__
+- `C# language API bindings #1 <https://github.com/bkaradzic/bgfx/tree/master/bindings/cs>`__
+- `D language API bindings <https://github.com/GoaLitiuM/bindbc-bgfx>`__
+- `Go language API bindings <https://github.com/james4k/go-bgfx>`__
+- `Haskell language API bindings <https://github.com/haskell-game/bgfx>`__
+- `Lightweight Java Game Library 3 bindings <https://github.com/LWJGL/lwjgl3#lwjgl---lightweight-java-game-library-3>`__
+- `Lua language API bindings <https://github.com/cloudwu/lua-bgfx>`__
+- `Nim language API bindings <https://github.com/Halsys/nim-bgfx>`__
+- `Pascal language API bindings <https://github.com/Akira13641/PasBGFX>`__
+- `Python language API bindings #1 <https://github.com/fbertola/bgfx-python#-----bgfx-python-->`__
+- `Python language API bindings #2 <https://github.com/jnadro/pybgfx#pybgfx>`__
+- `Rust language API bindings <https://github.com/rhoot/bgfx-rs#bgfx-rs>`__
+- `Swift language API bindings <https://github.com/stuartcarnie/SwiftBGFX>`__
+- `Zig language API bindings <https://github.com/bkaradzic/bgfx/tree/master/bindings/zig>`__
+
+
+Project Page
+~~~~~~~~~~~~
+
+- https://github.com/bkaradzic/bgfx
+
+Contact
+~~~~~~~
+
+ - `GitHub Discussions <https://github.com/bkaradzic/bgfx/discussions>`__
+ - `Discord Chat <https://discord.gg/9eMbv7J>`__
+ - GitHub `@bkaradzic <https://github.com/bkaradzic>`__
+ - Twitter `@bkaradzic <https://twitter.com/bkaradzic>`__
+
+Debugging and Profiling
+-----------------------
+
+RenderDoc
+~~~~~~~~~
+
+Loading of RenderDoc is integrated in bgfx when using DX11 or OpenGL
+renderer. You can drop in ``renderdoc.dll`` from RenderDoc distribution
+into working directory, and it will be automatically loaded during bgfx
+initialization. This allows frame capture at any time by pressing
+**F11**.
+
+Download: `RenderDoc <https://renderdoc.org/builds>`__
+
+RenderDoc `How do I ...? <https://renderdoc.org/docs/how/index.html>`__ documentation.
+
+`Shader debugging <https://software.intel.com/en-us/articles/shader-debugging-for-bgfx-rendering-engine>`__
+with RenderDoc and MSVC.
+
+IntelGPA
+~~~~~~~~
+
+Right click **Intel GPA Monitor** tray icon, choose preferences, check
+"Auto-detect launched applications" option. Find ``InjectionList.txt``
+in GPA directory and add ``examples-*`` to the list.
+
+Download:
+`IntelGPA <https://software.intel.com/en-us/vcsource/tools/intel-gpa>`__
+
+Other Debuggers and Profilers
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. |x| unicode:: U+2713 .. CHECK MARK
+
++-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
+| Name | OS | DX9 | DX11 | DX12 | Metal | GL | GLES | Vulkan| Source |
++=============+=================+=======+========+======+=======+======+======+=======+========+
+| APITrace | Linux/OSX/Win | |x| | |x| | | | |x| | |x| | | |x| |
++-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
+| CodeXL | Linux/Win | | | | | |x| | | | |
++-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
+| Dissector | Win | |x| | | | | | | | |x| |
++-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
+| IntelGPA | Linux/OSX/Win | |x| | |x| | | | | |x| | | |
++-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
+| Nsight | Win | |x| | |x| | | | |x| | | | |
++-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
+| PerfHUD | Win | |x| | |x| | | | | | | |
++-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
+| PerfStudio | Win | | |x| | |x| | | |x| | |x| | | |
++-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
+| PIX | Win | | | |x| | | | | | |
++-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
+| RGP | Win | | | |x| | | | | |x| | |
++-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
+| RenderDoc | Win/Linux | | |x| | | | |x| | | |x| | |x| |
++-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
+| vogl | Linux | | | | | |x| | | | |x| |
++-------------+-----------------+-------+--------+------+-------+------+------+-------+--------+
+
+Download:
+
+- `APITrace <https://apitrace.github.io/>`__
+- `CodeXL <http://developer.amd.com/tools-and-sdks/opencl-zone/codexl/>`__
+- `Dissector <https://github.com/imccown/Dissector>`__
+- `GPU PerfStudio <http://developer.amd.com/tools-and-sdks/graphics-development/gpu-perfstudio/>`__
+- `Linux Graphics Debugger <https://developer.nvidia.com/linux-graphics-debugger>`__
+- `Nsight <https://developer.nvidia.com/nsight-graphics>`__
+- `PIX <https://blogs.msdn.microsoft.com/pix/>`__
+- `PerfHUD <https://developer.nvidia.com/nvidia-perfhud>`__
+- `RGP (Radeon GPU Profiler) <https://github.com/GPUOpen-Tools/Radeon-GPUProfiler/releases>`__
+- `vogl <https://github.com/ValveSoftware/vogl>`__
+
+SDL, GLFW, etc.
+---------------
+
+It is possible to use bgfx with SDL, GLFW and similar cross platform
+windowing libraries. The main requirement is that windowing library
+provides access to native window handle that's used to create Direct3D
+device or OpenGL context.
+
+For more info see: :doc:`bgfx`.
+
+.. note:: You can use ``--with-sdl`` when running GENie to enable SDL2 integration with examples:
+ ``genie --with-sdl vs2012``
+
+.. note:: ``--with-glfw`` is also available, but it's just simple stub to be used to test GLFW
+ integration API.
+
+.. note:: Special care is necessary to make custom windowing to work with multithreaded renderer.
+ Each platform has rules about where renderer can be and how multithreading interacts
+ with context/device. To disable multithreaded render use ``BGFX_CONFIG_MULTITHREADED=0``
+ preprocessor define.
+
+Getting Involved
+----------------
+
+Everyone is welcome to contribute to bgfx by submitting bug reports, testing on different
+platforms, writing examples (see `ideas <https://github.com/bkaradzic/bgfx/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+needed%22>`__),
+improving documentation, profiling and optimizing, etc.
+
+.. note:: **When contributing to the bgfx project you must agree to the BSD 2-clause
+ licensing terms.**
+
+Contributors
+~~~~~~~~~~~~
+
+Chronological order:
+
+ - Branimir Karadžić (`@bkaradzic <https://github.com/bkaradzic>`__)
+ - Garett Bass (`@garettbass <https://github.com/garettbass>`__) - OSX port.
+ - Jeremie Roy (`@jeremieroy <https://github.com/jeremieroy>`__) -
+ `10-font <examples.html#font>`__,
+ and `11-fontsdf <examples.html#fontsdf>`__ examples.
+ - Miloš Tošić (`@milostosic <https://github.com/milostosic>`__) -
+ `12-lod <examples.html#lod>`__ example.
+ - Dario Manesku (`@dariomanesku <https://github.com/dariomanesku>`__) -
+ `13-stencil <examples.html#stencil>`__,
+ `14-shadowvolumes <examples.html#shadowvolumes>`__,
+ `15-shadowmaps-simple <examples.html#shadowmaps-simple>`__,
+ `16-shadowmaps <examples.html#shadowmaps>`__,
+ `18-ibl <examples.html#ibl>`__,
+ and `28-wireframe <examples.html#wireframe>`__ example.
+ - James Gray (`@james4k <https://github.com/james4k>`__) - Go language API bindings.
+ - Guillaume Piolat (`@p0nce <https://github.com/p0nce>`__) - D language API bindings.
+ - Mike Popoloski (`@MikePopoloski <https://github.com/MikePopoloski>`__) - C#/VB/F# language API
+ bindings, WinRT/WinPhone support.
+ - Kai Jourdan (`@questor <https://github.com/questor>`__) -
+ `23-vectordisplay <examples.html#vectordisplay>`__ example.
+ - Stanlo Slasinski (`@stanlo <https://github.com/stanlo>`__) -
+ `24-nbody <examples.html#nbody>`__ example.
+ - Daniel Collin (`@emoon <https://github.com/emoon>`__) - Port of Ocornut's ImGui to bgfx.
+ - Andre Weissflog (`@floooh <https://github.com/floooh>`__) - Alternative build system fips.
+ - Andrew Johnson (`@ajohnson23 <https://github.com/ajohnson23>`__) - TeamCity build.
+ - Tony McCrary (`@enleeten <https://github.com/enleeten>`__) - Java language API bindings.
+ - Attila Kocsis (`@attilaz <https://github.com/attilaz>`__) - Metal rendering backend, various OSX
+ and iOS improvements and bug fixes, `39-assao <examples.html#assao>`__ example.
+ - Richard Gale (`@RichardGale <https://github.com/RichardGale>`__) - Emscripten entry input
+ handling.
+ - Andrew Mac (`@andr3wmac <https://github.com/andr3wmac>`__) -
+ `27-terrain <examples.html#terrain>`__ example.
+ - Oliver Charles (`@ocharles <https://github.com/ocharles>`__) - Haskel language API bindings.
+ - Johan Sköld (`@rhoot <https://github.com/rhoot>`__) - Rust language API bindings.
+ - Jean-François Verdon (`@Nodrev <https://github.com/Nodrev>`__) - Alternative deployment for
+ Android.
+ - Jason Nadro (`@jnadro <https://github.com/jnadro>`__) - Python language API bindings.
+ - Krzysztof Kondrak (`@kondrak <https://github.com/kondrak>`__) - OculusVR integration.
+ - Colby Klein (`@excessive <https://github.com/excessive>`__) - Lua language API bindings.
+ - Stuart Carnie (`@stuartcarnie <https://github.com/stuartcarnie>`__) - Swift language API
+ bindings.
+ - Joseph Cherlin (`@jcherlin <https://github.com/jcherlin>`__) -
+ `30-picking <examples.html#picking>`__,
+ and `31-rsm <examples.html#rsm>`__ example.
+ - Olli Wang (`@olliwang <https://github.com/olliwang>`__) - Various NanoVG integration improvements.
+ - Cory Golden (`@Halsys <https://github.com/Halsys>`__) - Nim language API bindings.
+ - Camilla Berglund (`@elmindreda <https://github.com/elmindreda>`__) - GLFW support.
+ - Daniel Ludwig (`@code-disaster <https://github.com/code-disaster>`__) - Lightweight Java Game
+ Library 3 bindings.
+ - Benoit Jacquier (`@benoitjacquier <https://github.com/benoitjacquier>`__) - Added support for
+ cubemap as texture 2D array in a compute shader.
+ - Apoorva Joshi (`@ApoorvaJ <https://github.com/ApoorvaJ>`__) -
+ `33-pom <examples.html#pom>`__ example.
+ - Stanislav Pidhorsky (`@podgorskiy <https://github.com/podgorskiy>`__) -
+ `36-sky <examples.html#sky>`__ example.
+ - 云风 (`@cloudwu <https://github.com/cloudwu>`__) - Alternative Lua bindings, bgfx IDL scripts,
+ `42-bunnylod <examples.html#bunnylod>`__ example.
+ - Kostas Anagnostou (`@KostasAAA <https://github.com/KostasAAA>`__) -
+ `37-gpudrivenrendering <examples.html#gpudrivenrendering>`__ example.
+ - Andrew Willmott (`@andrewwillmott <https://github.com/andrewwillmott>`__) - ATC and ASTC support.
+ - Aleš Mlakar (`@jazzbre <https://github.com/jazzbre>`__) -
+ `40-svt <examples.html#svt>`__ example.
+ - Matt Chiasson (`@mchiasson <https://github.com/mchiasson>`__) - Various fixes and improvements.
+ - Phil Peron (`@pperon <https://github.com/pperon>`__) - Tutorial how to use bgfx API.
+ - Vincent Cruz (`@BlockoS <https://github.com/BlockoS>`__) - Wayland support.
+ - Jonathan Young (`@jpcy <https://github.com/jpcy>`__) - Renderer for ioquake3 that uses bgfx,
+ minimal bgfx example.
+ - Nick Waanders (`@NickWaanders <https://github.com/NickWaanders>`__) - shaderc: Metal fixes.
+ - Vladimir Vukićević (`@vvuk <https://github.com/vvuk>`__) - HTML5 context.
+ - Daniel Gavin (`@DanielGavin <https://github.com/DanielGavin>`__) - `41-tess <examples.html#tess>`__ example.
+ - Ji-yong Kwon (`@rinthel <https://github.com/rinthel>`__) - Vulkan rendering backend.
+ - Leandro Freire (`@leandrolfre <https://github.com/leandrolfre>`__).
+ - Ari Vuollet (`@GoaLitiuM <https://github.com/GoaLitiuM>`__) IDL generator for D language
+ bindings.
+ - Sebastian Marketsmueller (`@sebastianmunity3d <https://github.com/sebastianmunity3d>`__).
+ - Cedric Guillemet (`@CedricGuillemet <https://github.com/CedricGuillemet>`__).
+ - Pablo Escobar (`@pezcode <https://github.com/pezcode>`__) - Various Vulkan fixes.
+ - Paul Gruenbacher (`@pgruenbacher <https://github.com/pgruenbacher>`__) - Various bug fixes.
+ - Jukka Jylänki (`@juj <https://github.com/juj>`__) - Various WebGL optimizations and fixes.
+ - Hugo Amnov (`@hugoam <https://github.com/hugoam>`__) - WebGPU/Dawn rendering backend.
+ - Christophe Dehais (`@goodartistscopy <https://github.com/goodartistscopy>`__) - Various bug fixes.
+ - elvencache (`@elvencache <https://github.com/elvencache>`__) -
+ `43-denoise <examples.html#denoise>`__,
+ `44-sss <examples.html#sss>`__,
+ and `45-bokeh <examples.html#bokeh>`__ example.
+ - Richard Schubert (`@Hemofektik <https://github.com/Hemofektik>`__) - `46-fsr <examples.html#fsr>`__ example.
+ - Sandy Carter (`@bwrsandman <https://github.com/bwrsandman>`__) - `47-pixelformats
+ <examples.html#pixelformats>`__ example, and various fixes and improvements.
+ - Liam Twigger (`@SnapperTT <https://github.com/SnapperTT>`__) - `48-drawindirect <examples.html#drawindirect>`__ example.
+ - Preetish Kakkar (`@blackhole <https://github.com/preetishkakkar>`__) - `49-hextile <examples.html#49-hextile>`__ example.
+ - Biswapriyo Nath (`@Biswa96 <https://github.com/Biswa96>`__) - GitHub Actions CI.
+ - Raziel Alphadios (`@RazielXYZ <https://github.com/RazielXYZ>`__) - Various fixes and improvements.
+
+and `others <https://github.com/bkaradzic/bgfx/graphs/contributors>`__...
+
+Repository visualization
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+.. raw:: html
+
+ <p>
+ <iframe width="694" height="390" src="https://www.youtube.com/embed/5ZeN_d_-BHo" frameborder="0" allowfullscreen></iframe>
+ </p>
diff --git a/3rdparty/bgfx/docs/tools.rst b/3rdparty/bgfx/docs/tools.rst
new file mode 100644
index 00000000000..9dc667a872a
--- /dev/null
+++ b/3rdparty/bgfx/docs/tools.rst
@@ -0,0 +1,243 @@
+Tools
+=====
+
+Geometry Compiler (geometryc)
+-----------------------------
+
+Converts Wavefront .obj, or glTF 2.0 mesh files to a format which is optimized for use with bgfx.
+
+Usage::
+
+ geometryc -f <in> -o <out>
+
+Supported input file formats:
+
+ ====== ============================
+ Format Description
+ ====== ============================
+ .obj Wavefront
+ .gltf glTF 2.0
+ .glb glTF 2.0
+ ====== ============================
+
+Options:
+
+ -h, --help Display this help and exit.
+ -v, --version Output version information and exit.
+ -f <file path> Input's file path.
+ -o <file path> Output's file path.
+ -s, --scale <num> Scale factor.
+
+ --ccw Front face is counter-clockwise winding order.
+
+ --flipv Flip texture coordinate V.
+
+ --obb <num> | Number of steps for calculating oriented bounding box.
+ | Defaults to 17.
+ | Less steps = less precise OBB.
+ | More steps = slower calculation.
+
+ --packnormal <num> | Normal packing.
+ | 0 - unpacked 12 bytes. (default)
+ | 1 - packed 4 bytes.
+
+ --packuv <num> | Texture coordinate packing.
+ | 0 - unpacked 8 bytes. (default)
+ | 1 - packed 4 bytes.
+
+ --tangent Calculate tangent vectors. (packing mode is the same as normal)
+
+ --barycentric Adds barycentric vertex attribute. (Packed in bgfx::Attrib::Color1)
+
+ -c, --compress Compress indices.
+
+ --[l/r]h-up+[y/z] Coordinate system. Defaults to '--lh-up+y' — Left-Handed +Y is up.
+
+Geometry Viewer (geometryv)
+---------------------------
+
+A geometry viewer.
+
+Shader Compiler (shaderc)
+-------------------------
+
+Shader Compiler is used to compile bgfx's cross-platform shader language, which based on GLSL.
+It uses an ANSI C pre-processor to transform the GLSL-like language into HLSL.
+This method has certain drawbacks,
+but overall it's simple and allows for quick authoring of cross-platform shaders.
+
+Some differences between bgfx's shaderc flavor of GLSL and vanilla GLSL:
+
+- ``bool/int`` uniforms are not allowed; all uniforms must be ``float``.
+- Attributes and varyings can only be accessed from ``main()``.
+- ``SAMPLER2D/3D/CUBE/etc.`` macros replace the ``sampler2D/3D/Cube/etc.`` tokens.
+- ``vec2/3/4_splat(<value>)`` replaces the ``vec2/3/4(<value>)`` constructor.
+ ``vec2/3/4`` constructors with multiple values are still valid.
+- ``mtxFromCols/mtxFromRows`` must be used for constructing matrices.
+- ``mul(x, y)`` must be used when multiplying vectors with matrices.
+- A ``varying.def.sc`` file must be used to define input/output semantics and types,
+ instead of using ``attribute/in`` and ``varying/in/out``.
+ This file cannot include comments, and typically only one is necessary.
+- ``$input/$output`` tokens corresponding to inputs and outputs defined in
+ ``varying.def.sc`` must be used at the beginning of shader.
+
+Defines
+~~~~~~~
+
+Shader Compiler also has the following default defines (default value is set to 0):
+
+ =============================== ======================= ========================================
+ Define symbol Description Option
+ =============================== ======================= ========================================
+ ``BX_PLATFORM_ANDROID`` Android platform ``--platform android``
+ ``BX_PLATFORM_EMSCRIPTEN`` Emscripten platform ``--platform asm.js``
+ ``BX_PLATFORM_IOS`` iOS platform ``--platform ios``
+ ``BX_PLATFORM_LINUX`` Linux platform ``--platform linux``
+ ``BX_PLATFORM_OSX`` macOS platform ``--platform osx``
+ ``BX_PLATFORM_PS4`` PlayStation 4 platform ``--platform orbis``
+ ``BX_PLATFORM_WINDOWS`` Windows platform ``--platform windows``
+ ``BX_PLATFORM_XBOXONE`` *Not implemented*
+ ------------------------------- ----------------------- ----------------------------------------
+ ``BGFX_SHADER_LANGUAGE_GLSL`` GLSL profile ``-p NNN`` and ``-p NNN_es``
+ ``BGFX_SHADER_LANGUAGE_HLSL`` HLSL profile ``-p s_N_N``
+ ``BGFX_SHADER_LANGUAGE_METAL`` Metal profile ``-p metal``
+ ``BGFX_SHADER_LANGUAGE_PSSL`` PSSL profile ``-p pssl``
+ ``BGFX_SHADER_LANGUAGE_SPIRV`` SPIR-V profile ``-p spirv`` and ``-p spirvNN-NN``
+ ------------------------------- ----------------------- ----------------------------------------
+ ``BGFX_SHADER_TYPE_COMPUTE`` Compute shader ``--type compute`` or ``--type c``
+ ``BGFX_SHADER_TYPE_FRAGMENT`` Fragment shader ``--type fragment`` or ``--type f``
+ ``BGFX_SHADER_TYPE_VERTEX`` Vertex shader ``--type vertex`` or ``--type v``
+ =============================== ======================= ========================================
+
+Predefined Uniforms
+~~~~~~~~~~~~~~~~~~~
+
+ ======= =================== ====================================================================
+ Type Name Description
+ ======= =================== ====================================================================
+ vec4 u_viewRect | View rectangle.
+ | ``u_viewRect.xy`` - xy offset in screen space.
+ | ``u_viewRect.zw`` - width/height size in screen space.
+ vec4 u_viewTexel | Screen-to-texel space conversion.
+ | ``u_viewTexel.xy = 1.0/u_viewRect.zw;``
+ mat4 u_view Transform world-to-view space.
+ mat4 u_invView Transform view-to-world space.
+ mat4 u_proj Transform view-to-clip space.
+ mat4 u_invProj Transform clip-to-view space.
+ mat4 u_viewProj Transform world-to-clip space.
+ mat4 u_invViewProj Transform clip-to-world space.
+ mat4[N] u_model Transform local-to-world space array.
+ mat4 u_modelView Transform local-to-view space.
+ mat4 u_modelViewProj Transform local-to-clip space.
+ float u_alphaRef | The reference value to which incoming alpha
+ | values are compared.
+ ======= =================== ====================================================================
+
+For more info, see the `shader helper macros
+<https://github.com/bkaradzic/bgfx/blob/master/src/bgfx_shader.sh>`__.
+
+Options:
+
+ -h, --help Display this help and exit.
+ -v, --version Output version information and exit.
+ -f <file path> Input's file path.
+ -i <include path> Include path. (for multiple paths use -i multiple times)
+ -o <file path> Output's file path.
+ --bin2c <array name> Generate C header file. If array name is not specified base file name will be used as name.
+ --depends Generate makefile style depends file.
+ --platform <platform> Target platform.
+ -p, --profile <profile> Shader model.
+ Defaults to GLSL.
+ --preprocess Only pre-process.
+ --define <defines> Add defines to preprocessor. (semicolon separated)
+ --raw Do not process shader. No preprocessor, and no glsl-optimizer. (GLSL only)
+ --type <type> Shader type.
+ Can be 'vertex', 'fragment, or 'compute'.
+ --varyingdef <file path> A varying.def.sc's file path.
+ --verbose Be verbose.
+
+(DX9 and DX11 only):
+
+ --debug Debug information.
+ --disasm Disassemble a compiled shader.
+ -O <level> Set optimization level.
+ Can be 0–3.
+ --Werror Treat warnings as errors.
+
+Building shaders
+~~~~~~~~~~~~~~~~
+
+Shaders can be compiled for all renderers by using the ``shaderc`` tool.
+A Makefile to simplify building shaders is provided in the `bgfx examples
+<https://github.com/bkaradzic/bgfx/tree/master/examples>`__.
+D3D shaders can be only compiled on Windows.
+
+Texture Compiler (texturec)
+---------------------------
+
+Convert PNG, TGA, DDS, KTX, and PVR textures into bgfx-supported texture formats.
+
+Usage::
+
+ texturec -f <in> -o <out> [-t <texture format>]
+
+Supported file formats:
+
+ ====== ================ ============================
+ Format In/Out Description
+ ====== ================ ============================
+ .bmp (input) Windows Bitmap.
+ .dds (input, output) Direct Draw Surface.
+ .exr (input, output) OpenEXR.
+ .gif (input) Graphics Interchange Format.
+ .jpg (input) JPEG Interchange Format.
+ .hdr (input, output) Radiance RGBE.
+ .ktx (input, output) Khronos Texture.
+ .png (input, output) Portable Network Graphics.
+ .psd (input) Photoshop Document.
+ .pvr (input) PowerVR.
+ .tga (input) Truevision TGA.
+ ====== ================ ============================
+
+Options:
+
+Options:
+ -h, --help Help.
+ -v, --version Version information only.
+ -f <file path> Input file path.
+ -o <file path> Output file path.
+ -t <format> Output format type (BC1/2/3/4/5, ETC1, PVR14, etc.).
+ -q <quality> Encoding quality (default, fastest, highest).
+ -m, --mips Generate mip-maps.
+ --mipskip <N> Skip <N> number of mips.
+ -n, --normalmap Input texture is normal map. (Implies --linear)
+
+ --equirect Input texture is equirectangular projection of cubemap.
+
+ --strip Input texture is horizontal or vertical strip of cubemap.
+
+ --sdf Compute SDF texture.
+
+ --ref <alpha> Alpha reference value.
+
+ --iqa Image Quality Assessment
+
+ --pma Premultiply alpha into RGB channel.
+
+ --linear Input and output texture is linear color space (gamma correction won't be applied).
+
+ --max <max size> Maximum width/height (image will be scaled down and
+ aspect ratio will be preserved)
+
+ --radiance <model> Radiance cubemap filter. (Lighting model: Phong, PhongBrdf, Blinn, BlinnBrdf, GGX)
+
+ --as <extension> Save as.
+
+ --formats List all supported formats.
+
+ --validate **DEBUG** Validate that output image produced matches after loading.
+
+Texture Viewer (texturev)
+-------------------------
+
+A texture viewer.
diff --git a/3rdparty/bgfx/examples/00-helloworld/helloworld.cpp b/3rdparty/bgfx/examples/00-helloworld/helloworld.cpp
index 7ecee4aca36..97a79463357 100644
--- a/3rdparty/bgfx/examples/00-helloworld/helloworld.cpp
+++ b/3rdparty/bgfx/examples/00-helloworld/helloworld.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bx/uint32_t.h>
@@ -32,6 +32,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/01-cubes/cubes.cpp b/3rdparty/bgfx/examples/01-cubes/cubes.cpp
index b0fb63019fe..de4566739aa 100644
--- a/3rdparty/bgfx/examples/01-cubes/cubes.cpp
+++ b/3rdparty/bgfx/examples/01-cubes/cubes.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -147,6 +147,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -265,7 +267,7 @@ public:
ImGui::Checkbox("Write A", &m_a);
ImGui::Text("Primitive topology:");
- ImGui::Combo("", (int*)&m_pt, s_ptNames, BX_COUNTOF(s_ptNames) );
+ ImGui::Combo("##topology", (int*)&m_pt, s_ptNames, BX_COUNTOF(s_ptNames) );
ImGui::End();
diff --git a/3rdparty/bgfx/examples/01-cubes/fs_cubes.sc b/3rdparty/bgfx/examples/01-cubes/fs_cubes.sc
index d792944781b..8ea959c83db 100644
--- a/3rdparty/bgfx/examples/01-cubes/fs_cubes.sc
+++ b/3rdparty/bgfx/examples/01-cubes/fs_cubes.sc
@@ -1,8 +1,8 @@
$input v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/01-cubes/makefile b/3rdparty/bgfx/examples/01-cubes/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/01-cubes/makefile
+++ b/3rdparty/bgfx/examples/01-cubes/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/01-cubes/vs_cubes.sc b/3rdparty/bgfx/examples/01-cubes/vs_cubes.sc
index 49a73940fbc..d80005d4652 100644
--- a/3rdparty/bgfx/examples/01-cubes/vs_cubes.sc
+++ b/3rdparty/bgfx/examples/01-cubes/vs_cubes.sc
@@ -2,8 +2,8 @@ $input a_position, a_color0
$output v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.sc b/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.sc
index e2988521e75..9173da91fcf 100644
--- a/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.sc
+++ b/3rdparty/bgfx/examples/02-metaballs/fs_metaballs.sc
@@ -1,8 +1,8 @@
$input v_normal, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/02-metaballs/makefile b/3rdparty/bgfx/examples/02-metaballs/makefile
index bfec49616fc..efdae05bf56 100644
--- a/3rdparty/bgfx/examples/02-metaballs/makefile
+++ b/3rdparty/bgfx/examples/02-metaballs/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
include ../../scripts/shader-embeded.mk
diff --git a/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp b/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp
index 913704ed14e..305bf53b329 100644
--- a/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp
+++ b/3rdparty/bgfx/examples/02-metaballs/metaballs.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -506,6 +506,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/02-metaballs/vs_metaballs.sc b/3rdparty/bgfx/examples/02-metaballs/vs_metaballs.sc
index 29d3580d3fc..1470977f1d9 100644
--- a/3rdparty/bgfx/examples/02-metaballs/vs_metaballs.sc
+++ b/3rdparty/bgfx/examples/02-metaballs/vs_metaballs.sc
@@ -2,8 +2,8 @@ $input a_position, a_normal, a_color0
$output v_normal, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/03-raymarch/fs_raymarching.sc b/3rdparty/bgfx/examples/03-raymarch/fs_raymarching.sc
index 1559671b140..39a0972feb8 100644
--- a/3rdparty/bgfx/examples/03-raymarch/fs_raymarching.sc
+++ b/3rdparty/bgfx/examples/03-raymarch/fs_raymarching.sc
@@ -1,8 +1,8 @@
$input v_color0, v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
// References:
diff --git a/3rdparty/bgfx/examples/03-raymarch/makefile b/3rdparty/bgfx/examples/03-raymarch/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/03-raymarch/makefile
+++ b/3rdparty/bgfx/examples/03-raymarch/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/03-raymarch/raymarch.cpp b/3rdparty/bgfx/examples/03-raymarch/raymarch.cpp
index fcb581e14cd..6fb30b91a88 100644
--- a/3rdparty/bgfx/examples/03-raymarch/raymarch.cpp
+++ b/3rdparty/bgfx/examples/03-raymarch/raymarch.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -119,6 +119,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/03-raymarch/vs_raymarching.sc b/3rdparty/bgfx/examples/03-raymarch/vs_raymarching.sc
index b79593a438e..ab32d2a2f49 100644
--- a/3rdparty/bgfx/examples/03-raymarch/vs_raymarching.sc
+++ b/3rdparty/bgfx/examples/03-raymarch/vs_raymarching.sc
@@ -2,8 +2,8 @@ $input a_position, a_color0, a_texcoord0
$output v_color0, v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/04-mesh/fs_mesh.sc b/3rdparty/bgfx/examples/04-mesh/fs_mesh.sc
index 4fd35e112ac..93991561e14 100644
--- a/3rdparty/bgfx/examples/04-mesh/fs_mesh.sc
+++ b/3rdparty/bgfx/examples/04-mesh/fs_mesh.sc
@@ -1,8 +1,8 @@
$input v_pos, v_view, v_normal, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/04-mesh/makefile b/3rdparty/bgfx/examples/04-mesh/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/04-mesh/makefile
+++ b/3rdparty/bgfx/examples/04-mesh/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/04-mesh/mesh.cpp b/3rdparty/bgfx/examples/04-mesh/mesh.cpp
index 4f032a3e7a4..59c6c070618 100644
--- a/3rdparty/bgfx/examples/04-mesh/mesh.cpp
+++ b/3rdparty/bgfx/examples/04-mesh/mesh.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -30,6 +30,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/04-mesh/vs_mesh.sc b/3rdparty/bgfx/examples/04-mesh/vs_mesh.sc
index cc505ee97b6..8ca8dbf559c 100644
--- a/3rdparty/bgfx/examples/04-mesh/vs_mesh.sc
+++ b/3rdparty/bgfx/examples/04-mesh/vs_mesh.sc
@@ -2,8 +2,8 @@ $input a_position, a_normal
$output v_pos, v_view, v_normal, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/05-instancing/fs_instancing.sc b/3rdparty/bgfx/examples/05-instancing/fs_instancing.sc
index d792944781b..8ea959c83db 100644
--- a/3rdparty/bgfx/examples/05-instancing/fs_instancing.sc
+++ b/3rdparty/bgfx/examples/05-instancing/fs_instancing.sc
@@ -1,8 +1,8 @@
$input v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/05-instancing/instancing.cpp b/3rdparty/bgfx/examples/05-instancing/instancing.cpp
index ae80d11b304..6b066c16d9f 100644
--- a/3rdparty/bgfx/examples/05-instancing/instancing.cpp
+++ b/3rdparty/bgfx/examples/05-instancing/instancing.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -82,6 +82,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -180,7 +182,7 @@ public:
ImGui::PopEnabled();
ImGui::Text("Grid Side Size:");
- ImGui::SliderInt("", (int*)&m_sideSize, 1, 512);
+ ImGui::SliderInt("##size", (int*)&m_sideSize, 1, 512);
if (m_lastFrameMissing > 0)
{
diff --git a/3rdparty/bgfx/examples/05-instancing/makefile b/3rdparty/bgfx/examples/05-instancing/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/05-instancing/makefile
+++ b/3rdparty/bgfx/examples/05-instancing/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/05-instancing/vs_instancing.sc b/3rdparty/bgfx/examples/05-instancing/vs_instancing.sc
index 767aa03bf9b..5d952e65c98 100644
--- a/3rdparty/bgfx/examples/05-instancing/vs_instancing.sc
+++ b/3rdparty/bgfx/examples/05-instancing/vs_instancing.sc
@@ -2,8 +2,8 @@ $input a_position, a_color0, i_data0, i_data1, i_data2, i_data3, i_data4
$output v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/06-bump/bump.cpp b/3rdparty/bgfx/examples/06-bump/bump.cpp
index 31afa720017..bbfe793fea9 100644
--- a/3rdparty/bgfx/examples/06-bump/bump.cpp
+++ b/3rdparty/bgfx/examples/06-bump/bump.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -102,6 +102,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/06-bump/fs_bump.sc b/3rdparty/bgfx/examples/06-bump/fs_bump.sc
index a68b38a5a76..7d56dbd0fb9 100644
--- a/3rdparty/bgfx/examples/06-bump/fs_bump.sc
+++ b/3rdparty/bgfx/examples/06-bump/fs_bump.sc
@@ -1,8 +1,8 @@
$input v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0// in...
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/06-bump/makefile b/3rdparty/bgfx/examples/06-bump/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/06-bump/makefile
+++ b/3rdparty/bgfx/examples/06-bump/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/06-bump/vs_bump.sc b/3rdparty/bgfx/examples/06-bump/vs_bump.sc
index 8818c5d658e..325c987102c 100644
--- a/3rdparty/bgfx/examples/06-bump/vs_bump.sc
+++ b/3rdparty/bgfx/examples/06-bump/vs_bump.sc
@@ -2,8 +2,8 @@ $input a_position, a_normal, a_tangent, a_texcoord0
$output v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/06-bump/vs_bump_instanced.sc b/3rdparty/bgfx/examples/06-bump/vs_bump_instanced.sc
index edec77554e4..7e45b313ab0 100644
--- a/3rdparty/bgfx/examples/06-bump/vs_bump_instanced.sc
+++ b/3rdparty/bgfx/examples/06-bump/vs_bump_instanced.sc
@@ -2,8 +2,8 @@ $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-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/07-callback/callback.cpp b/3rdparty/bgfx/examples/07-callback/callback.cpp
index 54c24ff2d45..418b2a96eae 100644
--- a/3rdparty/bgfx/examples/07-callback/callback.cpp
+++ b/3rdparty/bgfx/examples/07-callback/callback.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -279,8 +279,9 @@ public:
if (kNaturalAlignment >= _align)
{
+ intptr_t _ptrOld = intptr_t(_ptr);
void* ptr = ::realloc(_ptr, _size);
- bx::debugPrintf("%s(%d): REALLOC %p (old %p) of %d byte(s)\n", _file, _line, ptr, _ptr, _size);
+ bx::debugPrintf("%s(%d): REALLOC %p (old %p) of %d byte(s)\n", _file, _line, ptr, _ptrOld, _size);
if (NULL == _ptr)
{
@@ -328,6 +329,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/07-callback/fs_callback.sc b/3rdparty/bgfx/examples/07-callback/fs_callback.sc
index 64aba2d8ae9..3e8f850e34a 100644
--- a/3rdparty/bgfx/examples/07-callback/fs_callback.sc
+++ b/3rdparty/bgfx/examples/07-callback/fs_callback.sc
@@ -1,8 +1,8 @@
$input v_world, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/07-callback/makefile b/3rdparty/bgfx/examples/07-callback/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/07-callback/makefile
+++ b/3rdparty/bgfx/examples/07-callback/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/07-callback/vs_callback.sc b/3rdparty/bgfx/examples/07-callback/vs_callback.sc
index f897c686d32..aba775fd4eb 100644
--- a/3rdparty/bgfx/examples/07-callback/vs_callback.sc
+++ b/3rdparty/bgfx/examples/07-callback/vs_callback.sc
@@ -2,8 +2,8 @@ $input a_position, a_color0
$output v_world, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/08-update/cs_update.sc b/3rdparty/bgfx/examples/08-update/cs_update.sc
index f31283741ae..54566d8344b 100644
--- a/3rdparty/bgfx/examples/08-update/cs_update.sc
+++ b/3rdparty/bgfx/examples/08-update/cs_update.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2014 Stanlo Slasinski. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/08-update/fs_update.sc b/3rdparty/bgfx/examples/08-update/fs_update.sc
index 461b24116d5..41e24ed1fe2 100644
--- a/3rdparty/bgfx/examples/08-update/fs_update.sc
+++ b/3rdparty/bgfx/examples/08-update/fs_update.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/08-update/fs_update_3d.sc b/3rdparty/bgfx/examples/08-update/fs_update_3d.sc
index 58771d4fa78..8986846d5f1 100644
--- a/3rdparty/bgfx/examples/08-update/fs_update_3d.sc
+++ b/3rdparty/bgfx/examples/08-update/fs_update_3d.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/08-update/fs_update_cmp.sc b/3rdparty/bgfx/examples/08-update/fs_update_cmp.sc
index 2778ebf6535..076d8965e6f 100644
--- a/3rdparty/bgfx/examples/08-update/fs_update_cmp.sc
+++ b/3rdparty/bgfx/examples/08-update/fs_update_cmp.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/08-update/makefile b/3rdparty/bgfx/examples/08-update/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/08-update/makefile
+++ b/3rdparty/bgfx/examples/08-update/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/08-update/update.cpp b/3rdparty/bgfx/examples/08-update/update.cpp
index 1c43476c973..9e9f63fcb3d 100644
--- a/3rdparty/bgfx/examples/08-update/update.cpp
+++ b/3rdparty/bgfx/examples/08-update/update.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -173,18 +173,17 @@ bgfx::TextureHandle loadTextureWithUpdate(const char* _filePath, uint64_t _flags
, NULL
);
- uint32_t width = imageContainer->m_width;
+ const bimg::ImageBlockInfo& blockInfo = getBlockInfo(imageContainer->m_format);
+ const uint32_t blockWidth = blockInfo.blockWidth;
+ const uint32_t blockHeight = blockInfo.blockHeight;
+
+ uint32_t width = imageContainer->m_width;
uint32_t height = imageContainer->m_height;
for (uint8_t lod = 0, num = imageContainer->m_numMips; lod < num; ++lod)
{
- if (width < 4 || height < 4)
- {
- break;
- }
-
- width = bx::max(1u, width);
- height = bx::max(1u, height);
+ width = bx::max(blockWidth, width);
+ height = bx::max(blockHeight, height);
bimg::ImageMip mip;
@@ -246,6 +245,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -424,6 +425,16 @@ public:
m_texture2dData = (uint8_t*)malloc(kTexture2dSize*kTexture2dSize*4);
+ if (m_blitSupported)
+ {
+ m_blitTestA = bgfx::createTexture2D(16, 16, false, 1, bgfx::TextureFormat::Enum::RGBA8, BGFX_TEXTURE_BLIT_DST);
+ m_blitTestB = bgfx::createTexture2D(16, 16, false, 1, bgfx::TextureFormat::Enum::RGBA8, BGFX_TEXTURE_BLIT_DST);
+ m_blitTestC = bgfx::createTexture2D(16, 16, false, 1, bgfx::TextureFormat::Enum::RGBA8, BGFX_TEXTURE_BLIT_DST);
+ bgfx::setName(m_blitTestA, "Blit A");
+ bgfx::setName(m_blitTestB, "Blit B");
+ bgfx::setName(m_blitTestC, "Blit C");
+ }
+
m_rr = m_rng.gen()%255;
m_gg = m_rng.gen()%255;
m_bb = m_rng.gen()%255;
@@ -449,6 +460,13 @@ public:
// Cleanup.
free(m_texture2dData);
+ if (m_blitSupported)
+ {
+ bgfx::destroy(m_blitTestA);
+ bgfx::destroy(m_blitTestB);
+ bgfx::destroy(m_blitTestC);
+ }
+
for (uint32_t ii = 0; ii < BX_COUNTOF(m_textures); ++ii)
{
bgfx::destroy(m_textures[ii]);
@@ -461,7 +479,7 @@ public:
bgfx::destroy(m_texture2d);
- for (uint32_t ii = 0; ii<BX_COUNTOF(m_textureCube); ++ii)
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_textureCube); ++ii)
{
if (bgfx::isValid(m_textureCube[ii]))
{
@@ -469,7 +487,7 @@ public:
}
}
- for (uint32_t ii = 0; ii<BX_COUNTOF(m_textureCubeFaceFb); ++ii)
+ for (uint32_t ii = 0; ii < BX_COUNTOF(m_textureCubeFaceFb); ++ii)
{
if (bgfx::isValid(m_textureCubeFaceFb[ii]))
{
@@ -479,15 +497,19 @@ public:
bgfx::destroy(m_ibh);
bgfx::destroy(m_vbh);
+
if (bgfx::isValid(m_program3d) )
{
bgfx::destroy(m_program3d);
}
+
bgfx::destroy(m_programCmp);
+
if (bgfx::isValid(m_programCompute) )
{
bgfx::destroy(m_programCompute);
}
+
bgfx::destroy(m_program);
bgfx::destroy(u_time);
bgfx::destroy(s_texColor);
@@ -909,6 +931,21 @@ public:
ImGuiDescription(mtx[12], mtx[13], mtx[14], worldToScreen, descSampler[ii]);
}
+ if (m_blitSupported)
+ {
+ bgfx::blit(1, m_blitTestA, 0, 0, m_blitTestB, 0, 0);
+ bgfx::blit(1, m_blitTestC, 0, 0, m_blitTestA, 0, 0);
+
+ bgfx::blit(1, m_blitTestA, 0, 0, m_blitTestB, 0, 0);
+ bgfx::blit(1, m_blitTestB, 0, 0, m_blitTestC, 0, 0);
+
+ bgfx::blit(1, m_blitTestA, 0, 0, m_blitTestB, 0, 0);
+ bgfx::blit(1, m_blitTestB, 0, 0, m_blitTestA, 0, 0);
+
+ bgfx::blit(1, m_blitTestB, 0, 0, m_blitTestA, 0, 0);
+ bgfx::blit(1, m_blitTestC, 0, 0, m_blitTestB, 0, 0);
+ }
+
imguiEndFrame();
// Advance to next frame. Rendering thread will be kicked to
@@ -952,6 +989,9 @@ public:
bgfx::TextureHandle m_textures3d[3];
bgfx::TextureHandle m_texture2d;
bgfx::TextureHandle m_textureCube[4];
+ bgfx::TextureHandle m_blitTestA;
+ bgfx::TextureHandle m_blitTestB;
+ bgfx::TextureHandle m_blitTestC;
bgfx::FrameBufferHandle m_textureCubeFaceFb[6];
bgfx::IndexBufferHandle m_ibh;
bgfx::VertexBufferHandle m_vbh;
diff --git a/3rdparty/bgfx/examples/08-update/vs_update.sc b/3rdparty/bgfx/examples/08-update/vs_update.sc
index 946194572b7..545369275d5 100644
--- a/3rdparty/bgfx/examples/08-update/vs_update.sc
+++ b/3rdparty/bgfx/examples/08-update/vs_update.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/common.sh b/3rdparty/bgfx/examples/09-hdr/common.sh
index 5b3663f394c..056d9d60830 100644
--- a/3rdparty/bgfx/examples/09-hdr/common.sh
+++ b/3rdparty/bgfx/examples/09-hdr/common.sh
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc
index 85737cbe789..d6130d77da7 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_blur.sc
@@ -1,8 +1,8 @@
$input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc
index ca97b26fb8a..321fac73aef 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_bright.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
@@ -29,10 +29,10 @@ void main()
float middleGray = u_tonemap.x;
float whiteSqr = u_tonemap.y;
- float treshold = u_tonemap.z;
+ float threshold = u_tonemap.z;
float offset = u_tonemap.w;
- rgb = max(vec3_splat(0.0), rgb - treshold) * middleGray / (lum + 0.0001);
+ rgb = max(vec3_splat(0.0), rgb - threshold) * middleGray / (lum + 0.0001);
rgb = reinhard2(rgb, whiteSqr);
gl_FragColor = toGamma(vec4(rgb, 1.0) );
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc
index b859aa20dd3..392ab748316 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_lum.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc
index 80047c922b7..4c682a98c4b 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_lumavg.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc
index e42fec0c54f..760a0928d15 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_mesh.sc
@@ -1,8 +1,8 @@
$input v_pos, v_view, v_normal
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc
index ba37a542d32..c2880f57c74 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_skybox.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc b/3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc
index 40fd4d17fa1..44f3df9b429 100644
--- a/3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc
+++ b/3rdparty/bgfx/examples/09-hdr/fs_hdr_tonemap.sc
@@ -1,8 +1,8 @@
$input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
@@ -20,7 +20,7 @@ void main()
float middleGray = u_tonemap.x;
float whiteSqr = u_tonemap.y;
- float treshold = u_tonemap.z;
+ float threshold = u_tonemap.z;
float offset = u_tonemap.w;
float lp = Yxy.x * middleGray / (lum + 0.0001);
diff --git a/3rdparty/bgfx/examples/09-hdr/hdr.cpp b/3rdparty/bgfx/examples/09-hdr/hdr.cpp
index 6611b5587f9..6184611b4c0 100644
--- a/3rdparty/bgfx/examples/09-hdr/hdr.cpp
+++ b/3rdparty/bgfx/examples/09-hdr/hdr.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -157,6 +157,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -207,7 +209,7 @@ public:
m_lumBgra8 = 0;
if ( (BGFX_CAPS_TEXTURE_BLIT|BGFX_CAPS_TEXTURE_READ_BACK) == (bgfx::getCaps()->supported & (BGFX_CAPS_TEXTURE_BLIT|BGFX_CAPS_TEXTURE_READ_BACK) ) )
{
- m_rb = bgfx::createTexture2D(1, 1, false, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_READ_BACK);
+ m_rb = bgfx::createTexture2D(1, 1, false, 1, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_BLIT_DST|BGFX_TEXTURE_READ_BACK);
}
else
{
diff --git a/3rdparty/bgfx/examples/09-hdr/makefile b/3rdparty/bgfx/examples/09-hdr/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/09-hdr/makefile
+++ b/3rdparty/bgfx/examples/09-hdr/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_blur.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_blur.sc
index 48002a18609..e4dad0170c4 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_blur.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_blur.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_bright.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_bright.sc
index 946194572b7..545369275d5 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_bright.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_bright.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_lum.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_lum.sc
index 946194572b7..545369275d5 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_lum.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_lum.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_lumavg.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_lumavg.sc
index 946194572b7..545369275d5 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_lumavg.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_lumavg.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc
index 0a60d07252d..a10d55992c7 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_mesh.sc
@@ -2,8 +2,8 @@ $input a_position, a_normal
$output v_pos, v_view, v_normal
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_skybox.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_skybox.sc
index 946194572b7..545369275d5 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_skybox.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_skybox.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/09-hdr/vs_hdr_tonemap.sc b/3rdparty/bgfx/examples/09-hdr/vs_hdr_tonemap.sc
index 12dd52ba9b0..e7fea0c3e8c 100644
--- a/3rdparty/bgfx/examples/09-hdr/vs_hdr_tonemap.sc
+++ b/3rdparty/bgfx/examples/09-hdr/vs_hdr_tonemap.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/10-font/font.cpp b/3rdparty/bgfx/examples/10-font/font.cpp
index 72013513033..34daca64e41 100644
--- a/3rdparty/bgfx/examples/10-font/font.cpp
+++ b/3rdparty/bgfx/examples/10-font/font.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Jeremie Roy. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -71,6 +71,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -266,7 +268,10 @@ public:
float view[16];
bx::mtxLookAt(view, eye, at);
- const float centering = 0.5f;
+ float centering = 0.0f;
+ if (bgfx::getRendererType() == bgfx::RendererType::Direct3D9) {
+ centering = -0.5f;
+ }
// Setup a top-left ortho matrix for screen space drawing.
const bgfx::Caps* caps = bgfx::getCaps();
diff --git a/3rdparty/bgfx/examples/11-fontsdf/fontsdf.cpp b/3rdparty/bgfx/examples/11-fontsdf/fontsdf.cpp
index 4687a5d80f4..a7e7362a577 100644
--- a/3rdparty/bgfx/examples/11-fontsdf/fontsdf.cpp
+++ b/3rdparty/bgfx/examples/11-fontsdf/fontsdf.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Jeremie Roy. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -54,6 +54,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -253,7 +255,10 @@ public:
float view[16];
bx::mtxLookAt(view, eye, at);
- const float centering = 0.5f;
+ float centering = 0.0f;
+ if (bgfx::getRendererType() == bgfx::RendererType::Direct3D9) {
+ centering = -0.5f;
+ }
// Setup a top-left ortho matrix for screen space drawing.
const bgfx::Caps* caps = bgfx::getCaps();
diff --git a/3rdparty/bgfx/examples/12-lod/fs_tree.sc b/3rdparty/bgfx/examples/12-lod/fs_tree.sc
index 72649c5f664..b9392d2df8d 100644
--- a/3rdparty/bgfx/examples/12-lod/fs_tree.sc
+++ b/3rdparty/bgfx/examples/12-lod/fs_tree.sc
@@ -2,7 +2,7 @@ $input v_pos, v_view, v_normal, v_texcoord0
/*
* Copyright 2013 Milos Tosic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/12-lod/lod.cpp b/3rdparty/bgfx/examples/12-lod/lod.cpp
index 37bd4dd6c50..b717c961e01 100644
--- a/3rdparty/bgfx/examples/12-lod/lod.cpp
+++ b/3rdparty/bgfx/examples/12-lod/lod.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Milos Tosic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -46,6 +46,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/12-lod/makefile b/3rdparty/bgfx/examples/12-lod/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/12-lod/makefile
+++ b/3rdparty/bgfx/examples/12-lod/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/12-lod/vs_tree.sc b/3rdparty/bgfx/examples/12-lod/vs_tree.sc
index 3ec3f6680dd..9cd06412cd0 100644
--- a/3rdparty/bgfx/examples/12-lod/vs_tree.sc
+++ b/3rdparty/bgfx/examples/12-lod/vs_tree.sc
@@ -3,7 +3,7 @@ $output v_pos, v_view, v_normal, v_texcoord0
/*
* Copyright 2013 Milos Tosic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_black.sc b/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_black.sc
index 975df704e73..d754dccfd53 100644
--- a/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_black.sc
+++ b/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_black.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_lighting.sc b/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_lighting.sc
index ae11cd4ca6e..d28d92c1607 100644
--- a/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_lighting.sc
+++ b/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_lighting.sc
@@ -2,7 +2,7 @@ $input v_normal, v_view
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_texture.sc b/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_texture.sc
index 1971de51ae0..3fa64965bc9 100644
--- a/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_texture.sc
+++ b/3rdparty/bgfx/examples/13-stencil/fs_stencil_color_texture.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture.sc b/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture.sc
index 098fa5b9df1..054a7d93d61 100644
--- a/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture.sc
+++ b/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture_lighting.sc b/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture_lighting.sc
index e0dbcbd147d..31462044229 100644
--- a/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture_lighting.sc
+++ b/3rdparty/bgfx/examples/13-stencil/fs_stencil_texture_lighting.sc
@@ -2,7 +2,7 @@ $input v_normal, v_view, v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/13-stencil/makefile b/3rdparty/bgfx/examples/13-stencil/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/13-stencil/makefile
+++ b/3rdparty/bgfx/examples/13-stencil/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/13-stencil/stencil.cpp b/3rdparty/bgfx/examples/13-stencil/stencil.cpp
index 3e01b5e8bdd..3acd5d5019b 100644
--- a/3rdparty/bgfx/examples/13-stencil/stencil.cpp
+++ b/3rdparty/bgfx/examples/13-stencil/stencil.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <string>
@@ -15,7 +15,7 @@
namespace bgfx
{
- int32_t read(bx::ReaderI* _reader, bgfx::VertexLayout& _layout, bx::Error* _err = NULL);
+ int32_t read(bx::ReaderI* _reader, bgfx::VertexLayout& _layout, bx::Error* _err);
}
namespace
@@ -609,6 +609,9 @@ struct Group
{
m_vbh.idx = bgfx::kInvalidHandle;
m_ibh.idx = bgfx::kInvalidHandle;
+ m_sphere={};
+ m_aabb={};
+ m_obb={};
m_prims.clear();
}
@@ -650,24 +653,26 @@ struct Mesh
Group group;
+ bx::Error err;
+
uint32_t chunk;
- while (4 == bx::read(reader, chunk) )
+ while (4 == bx::read(reader, chunk, &err) )
{
switch (chunk)
{
case BGFX_CHUNK_MAGIC_VB:
{
- bx::read(reader, group.m_sphere);
- bx::read(reader, group.m_aabb);
- bx::read(reader, group.m_obb);
+ bx::read(reader, group.m_sphere, &err);
+ bx::read(reader, group.m_aabb, &err);
+ bx::read(reader, group.m_obb, &err);
- bgfx::read(reader, m_layout);
+ bgfx::read(reader, m_layout, &err);
uint16_t stride = m_layout.getStride();
uint16_t numVertices;
- bx::read(reader, numVertices);
+ bx::read(reader, numVertices, &err);
const bgfx::Memory* mem = bgfx::alloc(numVertices*stride);
- bx::read(reader, mem->data, mem->size);
+ bx::read(reader, mem->data, mem->size, &err);
group.m_vbh = bgfx::createVertexBuffer(mem, m_layout);
}
@@ -676,9 +681,9 @@ struct Mesh
case BGFX_CHUNK_MAGIC_IB:
{
uint32_t numIndices;
- bx::read(reader, numIndices);
+ bx::read(reader, numIndices, &err);
const bgfx::Memory* mem = bgfx::alloc(numIndices*2);
- bx::read(reader, mem->data, mem->size);
+ bx::read(reader, mem->data, mem->size, &err);
group.m_ibh = bgfx::createIndexBuffer(mem);
}
break;
@@ -686,31 +691,31 @@ struct Mesh
case BGFX_CHUNK_MAGIC_PRI:
{
uint16_t len;
- bx::read(reader, len);
+ bx::read(reader, len, &err);
std::string material;
material.resize(len);
- bx::read(reader, const_cast<char*>(material.c_str() ), len);
+ bx::read(reader, const_cast<char*>(material.c_str() ), len, &err);
uint16_t num;
- bx::read(reader, num);
+ bx::read(reader, num, &err);
for (uint32_t ii = 0; ii < num; ++ii)
{
- bx::read(reader, len);
+ bx::read(reader, len, &err);
std::string name;
name.resize(len);
- bx::read(reader, const_cast<char*>(name.c_str() ), len);
+ bx::read(reader, const_cast<char*>(name.c_str() ), len, &err);
Primitive prim;
- bx::read(reader, prim.m_startIndex);
- bx::read(reader, prim.m_numIndices);
- bx::read(reader, prim.m_startVertex);
- bx::read(reader, prim.m_numVertices);
- bx::read(reader, prim.m_sphere);
- bx::read(reader, prim.m_aabb);
- bx::read(reader, prim.m_obb);
+ bx::read(reader, prim.m_startIndex, &err);
+ bx::read(reader, prim.m_numIndices, &err);
+ bx::read(reader, prim.m_startVertex, &err);
+ bx::read(reader, prim.m_numVertices, &err);
+ bx::read(reader, prim.m_sphere, &err);
+ bx::read(reader, prim.m_aabb, &err);
+ bx::read(reader, prim.m_obb, &err);
group.m_prims.push_back(prim);
}
@@ -775,7 +780,7 @@ struct Mesh
// Submit
bgfx::submit(_id, _program);
- // Keep track of submited view ids
+ // Keep track of submitted view ids
s_viewMask |= 1 << _id;
}
}
@@ -807,6 +812,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_viewState.m_width;
init.resolution.height = m_viewState.m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/13-stencil/vs_stencil_color.sc b/3rdparty/bgfx/examples/13-stencil/vs_stencil_color.sc
index f67ee538ad0..16a73acbd57 100644
--- a/3rdparty/bgfx/examples/13-stencil/vs_stencil_color.sc
+++ b/3rdparty/bgfx/examples/13-stencil/vs_stencil_color.sc
@@ -2,7 +2,7 @@ $input a_position
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/13-stencil/vs_stencil_color_lighting.sc b/3rdparty/bgfx/examples/13-stencil/vs_stencil_color_lighting.sc
index 90fdb80724b..b065317823a 100644
--- a/3rdparty/bgfx/examples/13-stencil/vs_stencil_color_lighting.sc
+++ b/3rdparty/bgfx/examples/13-stencil/vs_stencil_color_lighting.sc
@@ -3,7 +3,7 @@ $output v_normal, v_view
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/13-stencil/vs_stencil_color_texture.sc b/3rdparty/bgfx/examples/13-stencil/vs_stencil_color_texture.sc
index a1a66624461..3b9d1a0615f 100644
--- a/3rdparty/bgfx/examples/13-stencil/vs_stencil_color_texture.sc
+++ b/3rdparty/bgfx/examples/13-stencil/vs_stencil_color_texture.sc
@@ -3,7 +3,7 @@ $output v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/13-stencil/vs_stencil_texture.sc b/3rdparty/bgfx/examples/13-stencil/vs_stencil_texture.sc
index a1a66624461..3b9d1a0615f 100644
--- a/3rdparty/bgfx/examples/13-stencil/vs_stencil_texture.sc
+++ b/3rdparty/bgfx/examples/13-stencil/vs_stencil_texture.sc
@@ -3,7 +3,7 @@ $output v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/13-stencil/vs_stencil_texture_lighting.sc b/3rdparty/bgfx/examples/13-stencil/vs_stencil_texture_lighting.sc
index 67c4aa19dee..34aa4e1f182 100644
--- a/3rdparty/bgfx/examples/13-stencil/vs_stencil_texture_lighting.sc
+++ b/3rdparty/bgfx/examples/13-stencil/vs_stencil_texture_lighting.sc
@@ -3,7 +3,7 @@ $output v_normal, v_view, v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_lighting.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_lighting.sc
index f99fd3d1b9f..9022fc6a3cc 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_lighting.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_lighting.sc
@@ -2,7 +2,7 @@ $input v_normal, v_view
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_texture.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_texture.sc
index 59ac7d32f65..a2fc3a34bd7 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_texture.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_color_texture.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbackblank.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbackblank.sc
index 900a815eddf..0953b9117f9 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbackblank.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbackblank.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbackcolor.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbackcolor.sc
index f63a607c42a..25042bd6996 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbackcolor.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbackcolor.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex1.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex1.sc
index a9aa7df6204..949cc128e2a 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex1.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex1.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex2.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex2.sc
index 26d51bf5196..4721ee0dbda 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex2.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svbacktex2.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontblank.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontblank.sc
index 9e751e05939..24992bce78a 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontblank.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontblank.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontcolor.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontcolor.sc
index 2a953a219f3..b26ca27fe09 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontcolor.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfrontcolor.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex1.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex1.sc
index 8440c401608..bd681b72676 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex1.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex1.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex2.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex2.sc
index fff06ef1587..d6b436c22b7 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex2.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svfronttex2.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svside.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svside.sc
index fa82df3afe7..699b30c6976 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svside.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svside.sc
@@ -2,7 +2,7 @@ $input v_k
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsideblank.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsideblank.sc
index 6026aad53dd..4d3eb758102 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsideblank.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsideblank.sc
@@ -2,7 +2,7 @@ $input v_k
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsidecolor.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsidecolor.sc
index 1832106e4df..705be6336fc 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsidecolor.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsidecolor.sc
@@ -2,7 +2,7 @@ $input v_k
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsidetex.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsidetex.sc
index ddc639dc3a1..6b881decaf0 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsidetex.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_svsidetex.sc
@@ -2,7 +2,7 @@ $input v_k
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture.sc
index 098fa5b9df1..054a7d93d61 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lighting.sc b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lighting.sc
index 839386e7151..1800d2ff13c 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lighting.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/fs_shadowvolume_texture_lighting.sc
@@ -2,7 +2,7 @@ $input v_normal, v_view, v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/makefile b/3rdparty/bgfx/examples/14-shadowvolumes/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/makefile
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
index 865b058dc5e..2df07dec053 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/shadowvolumes.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <string>
@@ -548,7 +548,7 @@ void submit(bgfx::ViewId _id, bgfx::ProgramHandle _handle, int32_t _depth = 0)
{
bgfx::submit(_id, _handle, _depth);
- // Keep track of submited view ids.
+ // Keep track of submitted view ids.
s_viewMask |= 1 << _id;
}
@@ -764,6 +764,10 @@ struct Group
m_numEdges = 0;
m_edges = NULL;
m_edgePlanesUnalignedPtr = NULL;
+ m_edgePlanes = NULL;
+ m_aabb={};
+ m_sphere={};
+ m_obb={};
m_prims.clear();
}
@@ -919,9 +923,9 @@ struct Group
uint8_t* m_vertices;
uint32_t m_numIndices;
uint16_t* m_indices;
- Sphere m_sphere;
- Aabb m_aabb;
- Obb m_obb;
+ bx::Sphere m_sphere;
+ bx::Aabb m_aabb;
+ bx::Obb m_obb;
PrimitiveArray m_prims;
uint32_t m_numEdges;
Edge* m_edges;
@@ -990,9 +994,9 @@ struct Mesh
group.m_ibh = bgfx::createIndexBuffer(mem);
group.m_sphere = it->m_sphere;
- group.m_aabb = it->m_aabb;
- group.m_obb = it->m_obb;
- group.m_prims = it->m_prims;
+ group.m_aabb = it->m_aabb;
+ group.m_obb = it->m_obb;
+ group.m_prims = it->m_prims;
m_groups.push_back(group);
}
@@ -1067,7 +1071,6 @@ struct Model
::setRenderState(_renderState);
// Submit
- BX_ASSERT(bgfx::kInvalidHandle != m_program, "Error, program is not set.");
::submit(_viewId, m_program);
}
}
@@ -1686,7 +1689,7 @@ bool clipTest(const float* _planes, uint8_t _planeNum, const Mesh& _mesh, const
{
const Group& group = *it;
- Sphere sphere = group.m_sphere;
+ bx::Sphere sphere = group.m_sphere;
sphere.center.x = sphere.center.x * scale + _translate[0];
sphere.center.y = sphere.center.y * scale + _translate[1];
sphere.center.z = sphere.center.z * scale + _translate[2];
@@ -1781,6 +1784,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_viewState.m_width;
init.resolution.height = m_viewState.m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_lighting.sc b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_lighting.sc
index a3d9e13fb54..f316b451522 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_lighting.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_lighting.sc
@@ -3,7 +3,7 @@ $output v_normal, v_view
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_texture.sc b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_texture.sc
index 8eff5b40da6..8c7389354f2 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_texture.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_color_texture.sc
@@ -3,7 +3,7 @@ $output v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svback.sc b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svback.sc
index 4c14bf02c48..7e8ee9a7f52 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svback.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svback.sc
@@ -2,7 +2,7 @@ $input a_position
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svfront.sc b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svfront.sc
index b7e0d2a17c3..973453d20d8 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svfront.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svfront.sc
@@ -2,7 +2,7 @@ $input a_position
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svside.sc b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svside.sc
index 8c20a9e71a3..d892ec92213 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svside.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_svside.sc
@@ -3,7 +3,7 @@ $output v_k
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture.sc b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture.sc
index 77034144062..6f2477d4ee4 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture.sc
@@ -3,7 +3,7 @@ $output v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture_lighting.sc b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture_lighting.sc
index f7538d40e40..acb1ede17d5 100644
--- a/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture_lighting.sc
+++ b/3rdparty/bgfx/examples/14-shadowvolumes/vs_shadowvolume_texture_lighting.sc
@@ -3,7 +3,7 @@ $output v_normal, v_view, v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_mesh.sc b/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_mesh.sc
index 9b95176bb1a..0dde6025423 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_mesh.sc
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_mesh.sc
@@ -2,7 +2,7 @@ $input v_view, v_normal, v_shadowcoord
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_mesh_pd.sc b/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_mesh_pd.sc
index 67729e52514..bf570e2c37c 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_mesh_pd.sc
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_mesh_pd.sc
@@ -2,7 +2,7 @@ $input v_view, v_normal, v_shadowcoord
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sc b/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sc
index 3cdf1973f2e..ad2ccf5ec37 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sc
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sh b/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sh
index 979ff7c1e74..24e5c37011b 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sh
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow_pd.sc b/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow_pd.sc
index 2a046f7317c..3e8c635c12f 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow_pd.sc
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/fs_sms_shadow_pd.sc
@@ -2,7 +2,7 @@ $input v_position
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/makefile b/3rdparty/bgfx/examples/15-shadowmaps-simple/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/makefile
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp b/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp
index c470fe03914..236b859e0ea 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/shadowmaps_simple.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <string>
@@ -78,6 +78,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -134,8 +136,8 @@ public:
m_useShadowSampler = m_shadowSamplerSupported;
m_shadowMapFB = BGFX_INVALID_HANDLE;
- m_progShadow = BGFX_INVALID_HANDLE;
- m_progMesh = BGFX_INVALID_HANDLE;
+ m_progShadow = BGFX_INVALID_HANDLE;
+ m_progMesh = BGFX_INVALID_HANDLE;
m_state[0] = meshStateCreate();
m_state[0]->m_state = 0;
@@ -251,23 +253,31 @@ public:
const double freq = double(bx::getHPFrequency() );
float time = float( (now-m_timeOffset)/freq);
- if (!bgfx::isValid(m_shadowMapFB) || shadowSamplerModeChanged)
+ if (!bgfx::isValid(m_shadowMapFB)
+ || shadowSamplerModeChanged)
{
- bgfx::TextureHandle shadowMapTexture;
+ bgfx::TextureHandle shadowMapTexture = BGFX_INVALID_HANDLE;
- if (bgfx::isValid(m_progShadow))
+ if (bgfx::isValid(m_progShadow) )
+ {
bgfx::destroy(m_progShadow);
- if (bgfx::isValid(m_progMesh))
+ }
+
+ if (bgfx::isValid(m_progMesh) )
+ {
bgfx::destroy(m_progMesh);
+ }
- if (bgfx::isValid(m_shadowMapFB))
+ if (bgfx::isValid(m_shadowMapFB) )
+ {
bgfx::destroy(m_shadowMapFB);
+ }
if (m_useShadowSampler)
{
// Depth textures and shadow samplers are supported.
m_progShadow = loadProgram("vs_sms_shadow", "fs_sms_shadow");
- m_progMesh = loadProgram("vs_sms_mesh", "fs_sms_mesh");
+ m_progMesh = loadProgram("vs_sms_mesh", "fs_sms_mesh");
bgfx::TextureHandle fbtextures[] =
{
@@ -280,6 +290,7 @@ public:
, BGFX_TEXTURE_RT | BGFX_SAMPLER_COMPARE_LEQUAL
),
};
+
shadowMapTexture = fbtextures[0];
m_shadowMapFB = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
}
@@ -288,7 +299,7 @@ public:
// Depth textures and shadow samplers are not supported. Use float
// depth packing into color buffer instead.
m_progShadow = loadProgram("vs_sms_shadow_pd", "fs_sms_shadow_pd");
- m_progMesh = loadProgram("vs_sms_mesh", "fs_sms_mesh_pd");
+ m_progMesh = loadProgram("vs_sms_mesh", "fs_sms_mesh_pd");
bgfx::TextureHandle fbtextures[] =
{
@@ -309,6 +320,7 @@ public:
, BGFX_TEXTURE_RT_WRITE_ONLY
),
};
+
shadowMapTexture = fbtextures[0];
m_shadowMapFB = bgfx::createFrameBuffer(BX_COUNTOF(fbtextures), fbtextures, true);
}
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_mesh.sc b/3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_mesh.sc
index 0f28baa3023..5b78f844080 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_mesh.sc
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_mesh.sc
@@ -3,7 +3,7 @@ $output v_view, v_normal, v_shadowcoord
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_shadow.sc b/3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_shadow.sc
index a606797f019..a303feb1370 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_shadow.sc
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_shadow.sc
@@ -2,7 +2,7 @@ $input a_position
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_shadow_pd.sc b/3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_shadow_pd.sc
index 8d55a99f223..fa041ba1ffc 100644
--- a/3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_shadow_pd.sc
+++ b/3rdparty/bgfx/examples/15-shadowmaps-simple/vs_sms_shadow_pd.sc
@@ -3,7 +3,7 @@ $output v_position
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/common.sh b/3rdparty/bgfx/examples/16-shadowmaps/common.sh
index b10ae6b235d..50244a711a2 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/common.sh
+++ b/3rdparty/bgfx/examples/16-shadowmaps/common.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_black.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_black.sc
index 975df704e73..d754dccfd53 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_black.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_black.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting.sh b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting.sh
index c3518048463..b0da55ba864 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting.sh
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm.sc
index ef77eb9e92a..df310cabca3 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm.sc
@@ -2,7 +2,7 @@ $input v_normal, v_view, v_shadowcoord
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_ESM 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_csm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_csm.sc
index 8e76e954703..c80fa2043af 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_csm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_csm.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_ESM 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear.sc
index fb2aa8a1bb4..c01989d7a17 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear.sc
@@ -2,7 +2,7 @@ $input v_normal, v_view, v_shadowcoord
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_ESM 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_csm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_csm.sc
index 151df7e9256..5e7fa74c324 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_csm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_csm.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_ESM 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_omni.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_omni.sc
index 5783899b250..af9b9602952 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_omni.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_linear_omni.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_ESM 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_omni.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_omni.sc
index 290073ca9af..5481bb62d1f 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_omni.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_esm_omni.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_ESM 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard.sc
index 24416afebf4..0c9151fff54 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard.sc
@@ -2,7 +2,7 @@ $input v_normal, v_view, v_shadowcoord
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_HARD 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_csm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_csm.sc
index e0f9a42f012..1746772a78e 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_csm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_csm.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_HARD 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear.sc
index a10a029e9b4..f575157e09a 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear.sc
@@ -2,7 +2,7 @@ $input v_normal, v_view, v_shadowcoord
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_HARD 1
#define SM_LINEAR 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_csm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_csm.sc
index 8953a846705..97e0b48039e 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_csm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_csm.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_HARD 1
#define SM_LINEAR 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_omni.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_omni.sc
index bc0bf100be7..5998a67e7e3 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_omni.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_linear_omni.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_HARD 1
#define SM_LINEAR 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_omni.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_omni.sc
index ecd61676072..9aa6991072f 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_omni.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_hard_omni.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_HARD 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf.sc
index 0321b878e3a..1bea3bfc80e 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf.sc
@@ -2,7 +2,7 @@ $input v_normal, v_view, v_shadowcoord
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_PCF 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_csm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_csm.sc
index 4a55291719e..4b58b0ced89 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_csm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_csm.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_PCF 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear.sc
index c56dc7c191b..f78d7e0a5c5 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear.sc
@@ -2,7 +2,7 @@ $input v_normal, v_view, v_shadowcoord
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_PCF 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_csm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_csm.sc
index 55b52aca40c..85448d13981 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_csm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_csm.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_PCF 1
#define SM_LINEAR 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_omni.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_omni.sc
index f3ac095fe26..e9b38f2ddf1 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_omni.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_linear_omni.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_PCF 1
#define SM_LINEAR 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_omni.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_omni.sc
index 533b36c7e89..21db24a7980 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_omni.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_pcf_omni.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_PCF 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm.sc
index 5a6237bf85f..611cd3cf252 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm.sc
@@ -2,7 +2,7 @@ $input v_normal, v_view, v_shadowcoord
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_VSM 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_csm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_csm.sc
index 7b0ff7744c6..dce977badb4 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_csm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_csm.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_VSM 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear.sc
index a20ba6011a0..0b430b61583 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear.sc
@@ -2,7 +2,7 @@ $input v_normal, v_view, v_shadowcoord
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_VSM 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_csm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_csm.sc
index 3bfd00e7e64..3e98273aa60 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_csm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_csm.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_VSM 1
#define SM_LINEAR 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_omni.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_omni.sc
index d416655b18e..15eff7b81e5 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_omni.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_linear_omni.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_VSM 1
#define SM_LINEAR 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_omni.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_omni.sc
index db60831e78d..fcb7f4ad71f 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_omni.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_lighting_vsm_omni.sc
@@ -2,7 +2,7 @@ $input v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_te
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define SM_VSM 1
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_texture.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_texture.sc
index c53591a8fab..b05d59d2552 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_texture.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_color_texture.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_hblur.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_hblur.sc
index 7b40dd2faf3..82495a7a0e1 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_hblur.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_hblur.sc
@@ -2,7 +2,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_hblur_vsm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_hblur_vsm.sc
index e06c17dd0ef..aa10a96c06f 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_hblur_vsm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_hblur_vsm.sc
@@ -2,7 +2,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth.sc
index 04d5896c81d..daab62b23b0 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth.sc
@@ -2,7 +2,7 @@ $input v_position
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_linear.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_linear.sc
index f049736d090..19b63b1b9d9 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_linear.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_linear.sc
@@ -2,7 +2,7 @@ $input v_depth
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_vsm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_vsm.sc
index 2b0906c6582..975bbfbed28 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_vsm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_vsm.sc
@@ -2,7 +2,7 @@ $input v_position
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_vsm_linear.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_vsm_linear.sc
index 9a25941e369..375dbefc81d 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_vsm_linear.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_packdepth_vsm_linear.sc
@@ -2,7 +2,7 @@ $input v_depth
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_texture.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_texture.sc
index 098fa5b9df1..054a7d93d61 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_texture.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_texture.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_unpackdepth.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_unpackdepth.sc
index de62bdf3618..5c9ca592b7a 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_unpackdepth.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_unpackdepth.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_unpackdepth_vsm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_unpackdepth_vsm.sc
index 8c2051012ea..03addc40a23 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_unpackdepth_vsm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_unpackdepth_vsm.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_vblur.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_vblur.sc
index 7b40dd2faf3..82495a7a0e1 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_vblur.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_vblur.sc
@@ -2,7 +2,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_vblur_vsm.sc b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_vblur_vsm.sc
index e06c17dd0ef..aa10a96c06f 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_vblur_vsm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/fs_shadowmaps_vblur_vsm.sc
@@ -2,7 +2,7 @@ $input v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/makefile b/3rdparty/bgfx/examples/16-shadowmaps/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/makefile
+++ b/3rdparty/bgfx/examples/16-shadowmaps/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
index 11c648c78fa..4ab7b7e60dd 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
+++ b/3rdparty/bgfx/examples/16-shadowmaps/shadowmaps.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <string>
@@ -1157,6 +1157,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_viewState.m_width;
init.resolution.height = m_viewState.m_height;
init.resolution.reset = m_reset;
@@ -2326,7 +2328,7 @@ public:
// Compute split distances.
const uint8_t maxNumSplits = 4;
- BX_ASSERT(maxNumSplits >= settings.m_numSplits, "Error! Max num splits.");
+ BX_ASSERT(maxNumSplits >= m_settings.m_numSplits, "Error! Max num splits.");
float splitSlices[maxNumSplits*2];
splitFrustum(splitSlices
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color.sc
index a606797f019..a303feb1370 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color.sc
@@ -2,7 +2,7 @@ $input a_position
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting.sc
index b92e665a6b7..92dcd85c4ad 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting.sc
@@ -3,7 +3,7 @@ $output v_normal, v_view, v_shadowcoord
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_csm.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_csm.sc
index 680447b33fa..ab1c6784bb3 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_csm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_csm.sc
@@ -3,7 +3,7 @@ $output v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_t
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear.sc
index 9906dbf6da0..e9a7cbb352e 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear.sc
@@ -3,7 +3,7 @@ $output v_normal, v_view, v_shadowcoord
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear_csm.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear_csm.sc
index 2e228f6dcd6..6cdfb6009e8 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear_csm.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear_csm.sc
@@ -3,7 +3,7 @@ $output v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_t
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear_omni.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear_omni.sc
index 5048181d765..765c1a5feaf 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear_omni.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_linear_omni.sc
@@ -3,7 +3,7 @@ $output v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_t
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_omni.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_omni.sc
index 45800caf72d..a0557584224 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_omni.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_lighting_omni.sc
@@ -3,7 +3,7 @@ $output v_position, v_normal, v_view, v_texcoord1, v_texcoord2, v_texcoord3, v_t
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_texture.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_texture.sc
index 239f4185c08..d2585e1a85e 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_texture.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_color_texture.sc
@@ -3,7 +3,7 @@ $output v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_depth.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_depth.sc
index b7e0d2a17c3..973453d20d8 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_depth.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_depth.sc
@@ -2,7 +2,7 @@ $input a_position
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_hblur.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_hblur.sc
index d2494ac8a95..99ddaf2c5fb 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_hblur.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_hblur.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_packdepth.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_packdepth.sc
index 8d55a99f223..fa041ba1ffc 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_packdepth.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_packdepth.sc
@@ -3,7 +3,7 @@ $output v_position
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_packdepth_linear.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_packdepth_linear.sc
index 20e2359159e..ae8e9810684 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_packdepth_linear.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_packdepth_linear.sc
@@ -3,7 +3,7 @@ $output v_depth
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_texture.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_texture.sc
index 239f4185c08..d2585e1a85e 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_texture.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_texture.sc
@@ -3,7 +3,7 @@ $output v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_texture_lighting.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_texture_lighting.sc
index da82704225f..4d1f63346b9 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_texture_lighting.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_texture_lighting.sc
@@ -3,7 +3,7 @@ $output v_normal, v_view, v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_unpackdepth.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_unpackdepth.sc
index 239f4185c08..d2585e1a85e 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_unpackdepth.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_unpackdepth.sc
@@ -3,7 +3,7 @@ $output v_texcoord0
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_vblur.sc b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_vblur.sc
index e9cd5c62e99..8527d54c3a2 100644
--- a/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_vblur.sc
+++ b/3rdparty/bgfx/examples/16-shadowmaps/vs_shadowmaps_vblur.sc
@@ -3,7 +3,7 @@ $output v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3, v_texcoord4
/*
* Copyright 2013-2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/17-drawstress/drawstress.cpp b/3rdparty/bgfx/examples/17-drawstress/drawstress.cpp
index 3559c235c96..5dd17370c1f 100644
--- a/3rdparty/bgfx/examples/17-drawstress/drawstress.cpp
+++ b/3rdparty/bgfx/examples/17-drawstress/drawstress.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -129,6 +129,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/17-drawstress/fs_drawstress.sc b/3rdparty/bgfx/examples/17-drawstress/fs_drawstress.sc
index d792944781b..8ea959c83db 100644
--- a/3rdparty/bgfx/examples/17-drawstress/fs_drawstress.sc
+++ b/3rdparty/bgfx/examples/17-drawstress/fs_drawstress.sc
@@ -1,8 +1,8 @@
$input v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/17-drawstress/makefile b/3rdparty/bgfx/examples/17-drawstress/makefile
index bfec49616fc..efdae05bf56 100644
--- a/3rdparty/bgfx/examples/17-drawstress/makefile
+++ b/3rdparty/bgfx/examples/17-drawstress/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
include ../../scripts/shader-embeded.mk
diff --git a/3rdparty/bgfx/examples/17-drawstress/vs_drawstress.sc b/3rdparty/bgfx/examples/17-drawstress/vs_drawstress.sc
index 49a73940fbc..d80005d4652 100644
--- a/3rdparty/bgfx/examples/17-drawstress/vs_drawstress.sc
+++ b/3rdparty/bgfx/examples/17-drawstress/vs_drawstress.sc
@@ -2,8 +2,8 @@ $input a_position, a_color0
$output v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc b/3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc
index 836400b9ed0..07f8e9a9a22 100644
--- a/3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc
+++ b/3rdparty/bgfx/examples/18-ibl/fs_ibl_mesh.sc
@@ -2,7 +2,7 @@ $input v_view, v_normal
/*
* Copyright 2014-2016 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc b/3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc
index d895037b26a..9800dc812d1 100644
--- a/3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc
+++ b/3rdparty/bgfx/examples/18-ibl/fs_ibl_skybox.sc
@@ -2,7 +2,7 @@ $input v_dir
/*
* Copyright 2014-2016 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/18-ibl/ibl.cpp b/3rdparty/bgfx/examples/18-ibl/ibl.cpp
index 3e2ab6a907b..a2d15492e6d 100644
--- a/3rdparty/bgfx/examples/18-ibl/ibl.cpp
+++ b/3rdparty/bgfx/examples/18-ibl/ibl.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2014-2016 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <vector>
@@ -213,7 +213,7 @@ struct Camera
const bx::Vec3 toTarget = bx::sub(m_target.dest, m_pos.dest);
const float toTargetLen = bx::length(toTarget);
- const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatMin);
+ const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatSmallest);
const bx::Vec3 toTargetNorm = bx::mul(toTarget, invToTargetLen);
float delta = toTargetLen * _dz;
@@ -235,7 +235,7 @@ struct Camera
const bx::Vec3 toPos = bx::sub(m_pos.curr, m_target.curr);
const float toPosLen = bx::length(toPos);
- const float invToPosLen = 1.0f / (toPosLen + bx::kFloatMin);
+ const float invToPosLen = 1.0f / (toPosLen + bx::kFloatSmallest);
const bx::Vec3 toPosNorm = bx::mul(toPos, invToPosLen);
float ll[2];
@@ -265,7 +265,7 @@ struct Camera
{
const bx::Vec3 toTarget = bx::sub(m_target.curr, m_pos.curr);
const float toTargetLen = bx::length(toTarget);
- const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatMin);
+ const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatSmallest);
const bx::Vec3 toTargetNorm = bx::mul(toTarget, invToTargetLen);
const bx::Vec3 right = bx::normalize(bx::cross({ 0.0f, 1.0f, 0.0f }, toTargetNorm) );
@@ -418,6 +418,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/18-ibl/makefile b/3rdparty/bgfx/examples/18-ibl/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/18-ibl/makefile
+++ b/3rdparty/bgfx/examples/18-ibl/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/18-ibl/uniforms.sh b/3rdparty/bgfx/examples/18-ibl/uniforms.sh
index 61354fc87cb..8cb0d5e3e89 100644
--- a/3rdparty/bgfx/examples/18-ibl/uniforms.sh
+++ b/3rdparty/bgfx/examples/18-ibl/uniforms.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2016 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
uniform vec4 u_params[12];
diff --git a/3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc b/3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc
index ad88136285c..2d8b07e5e91 100644
--- a/3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc
+++ b/3rdparty/bgfx/examples/18-ibl/vs_ibl_mesh.sc
@@ -3,7 +3,7 @@ $output v_view, v_normal
/*
* Copyright 2014-2016 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/18-ibl/vs_ibl_skybox.sc b/3rdparty/bgfx/examples/18-ibl/vs_ibl_skybox.sc
index f3a15e0c73f..845f21404d3 100644
--- a/3rdparty/bgfx/examples/18-ibl/vs_ibl_skybox.sc
+++ b/3rdparty/bgfx/examples/18-ibl/vs_ibl_skybox.sc
@@ -3,7 +3,7 @@ $output v_dir
/*
* Copyright 2014-2016 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/19-oit/fs_oit.sc b/3rdparty/bgfx/examples/19-oit/fs_oit.sc
index 065a6602d4e..a087e5f3aaf 100644
--- a/3rdparty/bgfx/examples/19-oit/fs_oit.sc
+++ b/3rdparty/bgfx/examples/19-oit/fs_oit.sc
@@ -1,8 +1,8 @@
$input v_pos
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/19-oit/fs_oit_wb.sc b/3rdparty/bgfx/examples/19-oit/fs_oit_wb.sc
index 6b41f7eefe9..9cb69a52ee2 100644
--- a/3rdparty/bgfx/examples/19-oit/fs_oit_wb.sc
+++ b/3rdparty/bgfx/examples/19-oit/fs_oit_wb.sc
@@ -1,8 +1,8 @@
$input v_pos
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/19-oit/fs_oit_wb_blit.sc b/3rdparty/bgfx/examples/19-oit/fs_oit_wb_blit.sc
index 5998d80aae2..f6f45c820a2 100644
--- a/3rdparty/bgfx/examples/19-oit/fs_oit_wb_blit.sc
+++ b/3rdparty/bgfx/examples/19-oit/fs_oit_wb_blit.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/19-oit/fs_oit_wb_separate.sc b/3rdparty/bgfx/examples/19-oit/fs_oit_wb_separate.sc
index f2d0b09ee0e..3e4c6d8ce6a 100644
--- a/3rdparty/bgfx/examples/19-oit/fs_oit_wb_separate.sc
+++ b/3rdparty/bgfx/examples/19-oit/fs_oit_wb_separate.sc
@@ -1,8 +1,8 @@
$input v_pos
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/19-oit/fs_oit_wb_separate_blit.sc b/3rdparty/bgfx/examples/19-oit/fs_oit_wb_separate_blit.sc
index 3a7cdedcf85..58c888aaae3 100644
--- a/3rdparty/bgfx/examples/19-oit/fs_oit_wb_separate_blit.sc
+++ b/3rdparty/bgfx/examples/19-oit/fs_oit_wb_separate_blit.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/19-oit/makefile b/3rdparty/bgfx/examples/19-oit/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/19-oit/makefile
+++ b/3rdparty/bgfx/examples/19-oit/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/19-oit/oit.cpp b/3rdparty/bgfx/examples/19-oit/oit.cpp
index cd5cf926016..576cd091f89 100644
--- a/3rdparty/bgfx/examples/19-oit/oit.cpp
+++ b/3rdparty/bgfx/examples/19-oit/oit.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -169,6 +169,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/19-oit/vs_oit.sc b/3rdparty/bgfx/examples/19-oit/vs_oit.sc
index d274360fcaa..b38d28fda49 100644
--- a/3rdparty/bgfx/examples/19-oit/vs_oit.sc
+++ b/3rdparty/bgfx/examples/19-oit/vs_oit.sc
@@ -2,8 +2,8 @@ $input a_position
$output v_pos
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/19-oit/vs_oit_blit.sc b/3rdparty/bgfx/examples/19-oit/vs_oit_blit.sc
index 946194572b7..545369275d5 100644
--- a/3rdparty/bgfx/examples/19-oit/vs_oit_blit.sc
+++ b/3rdparty/bgfx/examples/19-oit/vs_oit_blit.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/20-nanovg/blendish.h b/3rdparty/bgfx/examples/20-nanovg/blendish.h
index 15c2f3f0268..8322c459f4a 100644
--- a/3rdparty/bgfx/examples/20-nanovg/blendish.h
+++ b/3rdparty/bgfx/examples/20-nanovg/blendish.h
@@ -1739,13 +1739,13 @@ void bndNodeBackground(NVGcontext *ctx, float x, float y, float w, float h,
BND_NODE_RADIUS,BND_NODE_RADIUS,0,0,
bndTransparent(bndOffsetColor(titleColor, BND_BEVEL_SHADE)),
bndTransparent(titleColor));
- bndInnerBox(ctx,x,y+BND_NODE_TITLE_HEIGHT-1,w,h+2-BND_NODE_TITLE_HEIGHT,
+ bndInnerBox(ctx,x,y+float(BND_NODE_TITLE_HEIGHT-1),w,h+2-float(BND_NODE_TITLE_HEIGHT),
0,0,BND_NODE_RADIUS,BND_NODE_RADIUS,
bndTransparent(bnd_theme.nodeTheme.nodeBackdropColor),
bndTransparent(bnd_theme.nodeTheme.nodeBackdropColor));
bndNodeIconLabel(ctx,
- x+BND_NODE_ARROW_AREA_WIDTH,y,
- w-BND_NODE_ARROW_AREA_WIDTH-BND_NODE_MARGIN_SIDE,BND_NODE_TITLE_HEIGHT,
+ x+float(BND_NODE_ARROW_AREA_WIDTH),y,
+ w-float(BND_NODE_ARROW_AREA_WIDTH)-float(BND_NODE_MARGIN_SIDE),BND_NODE_TITLE_HEIGHT,
iconid, bnd_theme.regularTheme.textColor,
bndOffsetColor(titleColor, BND_BEVEL_SHADE),
BND_LEFT, BND_LABEL_FONT_SIZE, label);
@@ -2164,7 +2164,7 @@ void bndIconLabelValue(NVGcontext *ctx, float x, float y, float w, float h,
nvgTextAlign(ctx,
(align==BND_LEFT)?(NVG_ALIGN_LEFT|NVG_ALIGN_BASELINE):
(NVG_ALIGN_CENTER|NVG_ALIGN_BASELINE));
- nvgTextBox(ctx,x+pleft,y+BND_WIDGET_HEIGHT-BND_TEXT_PAD_DOWN,
+ nvgTextBox(ctx,x+pleft,y+float(BND_WIDGET_HEIGHT)-BND_TEXT_PAD_DOWN,
w-BND_PAD_RIGHT-pleft,label, NULL);
}
} else if (iconid >= 0) {
diff --git a/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp b/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp
index e71dcca3070..144d21b8b9f 100644
--- a/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp
+++ b/3rdparty/bgfx/examples/20-nanovg/nanovg.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
//
@@ -848,7 +848,7 @@ void drawBlendish(struct NVGcontext* _vg, float _x, float _y, float _w, float _h
y += 25.0f;
bndLabel(_vg, x, y, 120.0f, BND_WIDGET_HEIGHT, -1, "Label:");
- y += BND_WIDGET_HEIGHT;
+ y += float(BND_WIDGET_HEIGHT);
bndChoiceButton(_vg, x, y, 80.0f, BND_WIDGET_HEIGHT, BND_CORNER_NONE, BND_DEFAULT, -1, "Default");
y += 25.0f;
bndChoiceButton(_vg, x, y, 80.0f, BND_WIDGET_HEIGHT, BND_CORNER_NONE, BND_HOVER, -1, "Hovered");
@@ -869,9 +869,9 @@ void drawBlendish(struct NVGcontext* _vg, float _x, float _y, float _w, float _h
y += 40.0f;
bndNumberField(_vg, x, y, 120.0f, BND_WIDGET_HEIGHT, BND_CORNER_DOWN, BND_DEFAULT, "Top", "100");
- y += BND_WIDGET_HEIGHT - 2.0f;
+ y += float(BND_WIDGET_HEIGHT) - 2.0f;
bndNumberField(_vg, x, y, 120.0f, BND_WIDGET_HEIGHT, BND_CORNER_ALL, BND_DEFAULT, "Center", "100");
- y += BND_WIDGET_HEIGHT - 2.0f;
+ y += float(BND_WIDGET_HEIGHT) - 2.0f;
bndNumberField(_vg, x, y, 120.0f, BND_WIDGET_HEIGHT, BND_CORNER_TOP, BND_DEFAULT, "Bottom", "100");
float mx = x - 30.0f;
@@ -879,11 +879,11 @@ void drawBlendish(struct NVGcontext* _vg, float _x, float _y, float _w, float _h
float mw = 120.0f;
bndMenuBackground(_vg, mx, my, mw, 120.0f, BND_CORNER_TOP);
bndMenuLabel(_vg, mx, my, mw, BND_WIDGET_HEIGHT, -1, "Menu Title");
- my += BND_WIDGET_HEIGHT - 2.0f;
+ my += float(BND_WIDGET_HEIGHT) - 2.0f;
bndMenuItem(_vg, mx, my, mw, BND_WIDGET_HEIGHT, BND_DEFAULT, BND_ICONID(17, 3), "Default");
- my += BND_WIDGET_HEIGHT - 2.0f;
+ my += float(BND_WIDGET_HEIGHT) - 2.0f;
bndMenuItem(_vg, mx, my, mw, BND_WIDGET_HEIGHT, BND_HOVER, BND_ICONID(18, 3), "Hovered");
- my += BND_WIDGET_HEIGHT - 2.0f;
+ my += float(BND_WIDGET_HEIGHT) - 2.0f;
bndMenuItem(_vg, mx, my, mw, BND_WIDGET_HEIGHT, BND_ACTIVE, BND_ICONID(19, 3), "Active");
y = _y;
@@ -1402,6 +1402,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/21-deferred/common.sh b/3rdparty/bgfx/examples/21-deferred/common.sh
index 5889912a12c..14dd727bb57 100644
--- a/3rdparty/bgfx/examples/21-deferred/common.sh
+++ b/3rdparty/bgfx/examples/21-deferred/common.sh
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/21-deferred/deferred.cpp b/3rdparty/bgfx/examples/21-deferred/deferred.cpp
index 375edbab9fc..6c379fd3fe1 100644
--- a/3rdparty/bgfx/examples/21-deferred/deferred.cpp
+++ b/3rdparty/bgfx/examples/21-deferred/deferred.cpp
@@ -1,13 +1,13 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
+#include <bx/bounds.h>
#include "common.h"
#include "bgfx_utils.h"
#include "imgui/imgui.h"
#include "camera.h"
-#include "bounds.h"
namespace
{
@@ -211,6 +211,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -275,6 +277,7 @@ public:
u_mtx = bgfx::createUniform("u_mtx", bgfx::UniformType::Mat4);
u_lightPosRadius = bgfx::createUniform("u_lightPosRadius", bgfx::UniformType::Vec4);
u_lightRgbInnerR = bgfx::createUniform("u_lightRgbInnerR", bgfx::UniformType::Vec4);
+ u_layer = bgfx::createUniform("u_layer", bgfx::UniformType::Vec4);
// Create program from shaders.
m_geomProgram = loadProgram("vs_deferred_geom", "fs_deferred_geom");
@@ -288,11 +291,15 @@ public:
if (0 != (BGFX_CAPS_TEXTURE_2D_ARRAY & bgfx::getCaps()->supported) )
{
- m_lightTaProgram = loadProgram("vs_deferred_light", "fs_deferred_light_ta");
+ m_lightTaProgram = loadProgram("vs_deferred_light", "fs_deferred_light_ta");
+ m_combineTaProgram = loadProgram("vs_deferred_combine", "fs_deferred_combine_ta");
+ m_debugTaProgram = loadProgram("vs_deferred_debug", "fs_deferred_debug_ta");
}
else
{
- m_lightTaProgram = BGFX_INVALID_HANDLE;
+ m_lightTaProgram = BGFX_INVALID_HANDLE;
+ m_combineTaProgram = BGFX_INVALID_HANDLE;
+ m_debugTaProgram = BGFX_INVALID_HANDLE;
}
if (0 != (BGFX_CAPS_IMAGE_RW & bgfx::getCaps()->supported)
@@ -388,7 +395,19 @@ public:
}
bgfx::destroy(m_combineProgram);
+
+ if (bgfx::isValid(m_combineTaProgram) )
+ {
+ bgfx::destroy(m_combineTaProgram);
+ }
+
bgfx::destroy(m_debugProgram);
+
+ if (bgfx::isValid(m_debugTaProgram) )
+ {
+ bgfx::destroy(m_debugTaProgram);
+ }
+
bgfx::destroy(m_lineProgram);
bgfx::destroy(m_textureColor);
@@ -401,6 +420,7 @@ public:
bgfx::destroy(s_depth);
bgfx::destroy(s_light);
+ bgfx::destroy(u_layer);
bgfx::destroy(u_lightPosRadius);
bgfx::destroy(u_lightRgbInnerR);
bgfx::destroy(u_mtx);
@@ -679,7 +699,7 @@ public:
// Draw lights into light buffer.
for (int32_t light = 0; light < m_numLights; ++light)
{
- Sphere lightPosRadius;
+ bx::Sphere lightPosRadius;
float lightTime = time * m_lightAnimationSpeed * (bx::sin(light/float(m_numLights) * bx::kPiHalf ) * 0.5f + 0.5f);
lightPosRadius.center.x = bx::sin( ( (lightTime + light*0.47f) + bx::kPiHalf*1.37f ) )*offset;
@@ -687,7 +707,7 @@ public:
lightPosRadius.center.z = bx::sin( ( (lightTime + light*0.37f) + bx::kPiHalf*1.57f ) )*2.0f;
lightPosRadius.radius = 2.0f;
- Aabb aabb;
+ bx::Aabb aabb;
toAabb(aabb, lightPosRadius);
const bx::Vec3 box[8] =
@@ -819,21 +839,30 @@ public:
}
// Combine color and light buffers.
- bgfx::setTexture(0, s_albedo, m_gbufferTex[0]);
+ bgfx::setTexture(0, s_albedo, bgfx::getTexture(m_gbuffer, 0) );
bgfx::setTexture(1, s_light, m_lightBufferTex);
bgfx::setState(0
| BGFX_STATE_WRITE_RGB
| BGFX_STATE_WRITE_A
);
screenSpaceQuad( (float)m_width, (float)m_height, s_texelHalf, m_caps->originBottomLeft);
- bgfx::submit(kRenderPassCombine, m_combineProgram);
+
+ if (bgfx::isValid(m_lightTaProgram)
+ && m_useTArray)
+ {
+ bgfx::submit(kRenderPassCombine, m_combineTaProgram);
+ }
+ else
+ {
+ bgfx::submit(kRenderPassCombine, m_combineProgram);
+ }
if (m_showGBuffer)
{
const float aspectRatio = float(m_width)/float(m_height);
// Draw m_debug m_gbuffer.
- for (uint32_t ii = 0; ii < BX_COUNTOF(m_gbufferTex); ++ii)
+ for (uint8_t ii = 0; ii < BX_COUNTOF(m_gbufferTex); ++ii)
{
float mtx[16];
bx::mtxSRT(mtx
@@ -845,9 +874,21 @@ public:
bgfx::setTransform(mtx);
bgfx::setVertexBuffer(0, m_vbh);
bgfx::setIndexBuffer(m_ibh, 0, 6);
- bgfx::setTexture(0, s_texColor, m_gbufferTex[ii]);
+ bgfx::setTexture(0, s_texColor, bgfx::getTexture(m_gbuffer, ii) );
bgfx::setState(BGFX_STATE_WRITE_RGB);
- bgfx::submit(kRenderPassDebugGBuffer, m_debugProgram);
+
+ if (ii != BX_COUNTOF(m_gbufferTex) - 1
+ && bgfx::isValid(m_lightTaProgram)
+ && m_useTArray)
+ {
+ const float layer[4] = { float(ii) };
+ bgfx::setUniform(u_layer, layer);
+ bgfx::submit(kRenderPassDebugGBuffer, m_debugTaProgram);
+ }
+ else
+ {
+ bgfx::submit(kRenderPassDebugGBuffer, m_debugProgram);
+ }
}
}
}
@@ -877,6 +918,7 @@ public:
bgfx::UniformHandle u_mtx;
bgfx::UniformHandle u_lightPosRadius;
bgfx::UniformHandle u_lightRgbInnerR;
+ bgfx::UniformHandle u_layer;
bgfx::ProgramHandle m_geomProgram;
bgfx::ProgramHandle m_lightProgram;
@@ -884,7 +926,9 @@ public:
bgfx::ProgramHandle m_lightUavProgram;
bgfx::ProgramHandle m_clearUavProgram;
bgfx::ProgramHandle m_combineProgram;
+ bgfx::ProgramHandle m_combineTaProgram;
bgfx::ProgramHandle m_debugProgram;
+ bgfx::ProgramHandle m_debugTaProgram;
bgfx::ProgramHandle m_lineProgram;
bgfx::TextureHandle m_textureColor;
bgfx::TextureHandle m_textureNormal;
diff --git a/3rdparty/bgfx/examples/21-deferred/fs_deferred_clear_uav.sc b/3rdparty/bgfx/examples/21-deferred/fs_deferred_clear_uav.sc
index 5ab85fcff96..bf355703e77 100644
--- a/3rdparty/bgfx/examples/21-deferred/fs_deferred_clear_uav.sc
+++ b/3rdparty/bgfx/examples/21-deferred/fs_deferred_clear_uav.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_compute.sh>
@@ -12,5 +12,5 @@ IMAGE2D_RW(i_light, rgba8, 2);
void main()
{
ivec2 coord = ivec2(gl_FragCoord.xy);
- imageStore(i_light, coord, vec4(0.0, 0.0, 0.0, 0.0));
+ imageStore(i_light, coord, vec4(0.0, 0.0, 0.0, 0.0) );
}
diff --git a/3rdparty/bgfx/examples/21-deferred/fs_deferred_combine.sc b/3rdparty/bgfx/examples/21-deferred/fs_deferred_combine.sc
index f9ce5ea6b5e..31318e33171 100644
--- a/3rdparty/bgfx/examples/21-deferred/fs_deferred_combine.sc
+++ b/3rdparty/bgfx/examples/21-deferred/fs_deferred_combine.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/21-deferred/fs_deferred_combine_ta.sc b/3rdparty/bgfx/examples/21-deferred/fs_deferred_combine_ta.sc
new file mode 100644
index 00000000000..ce18dcc1e1c
--- /dev/null
+++ b/3rdparty/bgfx/examples/21-deferred/fs_deferred_combine_ta.sc
@@ -0,0 +1,18 @@
+$input v_texcoord0
+
+/*
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ */
+
+#include "../common/common.sh"
+
+SAMPLER2DARRAY(s_albedo, 0);
+SAMPLER2D(s_light, 1);
+
+void main()
+{
+ vec4 albedo = toLinear(texture2DArray(s_albedo, vec3(v_texcoord0, 0.0) ) );
+ vec4 light = toLinear(texture2D(s_light, v_texcoord0) );
+ gl_FragColor = toGamma(albedo*light);
+}
diff --git a/3rdparty/bgfx/examples/21-deferred/fs_deferred_debug.sc b/3rdparty/bgfx/examples/21-deferred/fs_deferred_debug.sc
index 62a7d88c80c..1d3b0951a5a 100644
--- a/3rdparty/bgfx/examples/21-deferred/fs_deferred_debug.sc
+++ b/3rdparty/bgfx/examples/21-deferred/fs_deferred_debug.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/21-deferred/fs_deferred_debug_line.sc b/3rdparty/bgfx/examples/21-deferred/fs_deferred_debug_line.sc
index d792944781b..8ea959c83db 100644
--- a/3rdparty/bgfx/examples/21-deferred/fs_deferred_debug_line.sc
+++ b/3rdparty/bgfx/examples/21-deferred/fs_deferred_debug_line.sc
@@ -1,8 +1,8 @@
$input v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/21-deferred/fs_deferred_debug_ta.sc b/3rdparty/bgfx/examples/21-deferred/fs_deferred_debug_ta.sc
new file mode 100644
index 00000000000..e69f2fcdab4
--- /dev/null
+++ b/3rdparty/bgfx/examples/21-deferred/fs_deferred_debug_ta.sc
@@ -0,0 +1,17 @@
+$input v_texcoord0
+
+/*
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ */
+
+#include "../common/common.sh"
+
+SAMPLER2DARRAY(s_texColor, 0);
+
+uniform vec4 u_layer;
+
+void main()
+{
+ gl_FragColor = texture2DArray(s_texColor, vec3(v_texcoord0, u_layer.x) );
+}
diff --git a/3rdparty/bgfx/examples/21-deferred/fs_deferred_geom.sc b/3rdparty/bgfx/examples/21-deferred/fs_deferred_geom.sc
index 88214cde5b1..0466d720a7a 100644
--- a/3rdparty/bgfx/examples/21-deferred/fs_deferred_geom.sc
+++ b/3rdparty/bgfx/examples/21-deferred/fs_deferred_geom.sc
@@ -1,8 +1,8 @@
$input v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/21-deferred/fs_deferred_light.sc b/3rdparty/bgfx/examples/21-deferred/fs_deferred_light.sc
index c0b6e42fc71..680b5a8e0fc 100644
--- a/3rdparty/bgfx/examples/21-deferred/fs_deferred_light.sc
+++ b/3rdparty/bgfx/examples/21-deferred/fs_deferred_light.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/21-deferred/fs_deferred_light_ta.sc b/3rdparty/bgfx/examples/21-deferred/fs_deferred_light_ta.sc
index ec9d330701f..19102eff09d 100644
--- a/3rdparty/bgfx/examples/21-deferred/fs_deferred_light_ta.sc
+++ b/3rdparty/bgfx/examples/21-deferred/fs_deferred_light_ta.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/21-deferred/fs_deferred_light_uav.sc b/3rdparty/bgfx/examples/21-deferred/fs_deferred_light_uav.sc
index dd395a83158..08442333868 100644
--- a/3rdparty/bgfx/examples/21-deferred/fs_deferred_light_uav.sc
+++ b/3rdparty/bgfx/examples/21-deferred/fs_deferred_light_uav.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/examples/21-deferred/makefile b/3rdparty/bgfx/examples/21-deferred/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/21-deferred/makefile
+++ b/3rdparty/bgfx/examples/21-deferred/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/21-deferred/vs_deferred_combine.sc b/3rdparty/bgfx/examples/21-deferred/vs_deferred_combine.sc
index 946194572b7..545369275d5 100644
--- a/3rdparty/bgfx/examples/21-deferred/vs_deferred_combine.sc
+++ b/3rdparty/bgfx/examples/21-deferred/vs_deferred_combine.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/21-deferred/vs_deferred_debug.sc b/3rdparty/bgfx/examples/21-deferred/vs_deferred_debug.sc
index 946194572b7..545369275d5 100644
--- a/3rdparty/bgfx/examples/21-deferred/vs_deferred_debug.sc
+++ b/3rdparty/bgfx/examples/21-deferred/vs_deferred_debug.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/21-deferred/vs_deferred_debug_line.sc b/3rdparty/bgfx/examples/21-deferred/vs_deferred_debug_line.sc
index 49a73940fbc..d80005d4652 100644
--- a/3rdparty/bgfx/examples/21-deferred/vs_deferred_debug_line.sc
+++ b/3rdparty/bgfx/examples/21-deferred/vs_deferred_debug_line.sc
@@ -2,8 +2,8 @@ $input a_position, a_color0
$output v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/21-deferred/vs_deferred_geom.sc b/3rdparty/bgfx/examples/21-deferred/vs_deferred_geom.sc
index 877860d2831..5c4e5bf3fed 100644
--- a/3rdparty/bgfx/examples/21-deferred/vs_deferred_geom.sc
+++ b/3rdparty/bgfx/examples/21-deferred/vs_deferred_geom.sc
@@ -2,8 +2,8 @@ $input a_position, a_normal, a_tangent, a_texcoord0
$output v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/21-deferred/vs_deferred_light.sc b/3rdparty/bgfx/examples/21-deferred/vs_deferred_light.sc
index 946194572b7..545369275d5 100644
--- a/3rdparty/bgfx/examples/21-deferred/vs_deferred_light.sc
+++ b/3rdparty/bgfx/examples/21-deferred/vs_deferred_light.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/22-windows/windows.cpp b/3rdparty/bgfx/examples/22-windows/windows.cpp
index 2f944fd1219..03a5259e90b 100644
--- a/3rdparty/bgfx/examples/22-windows/windows.cpp
+++ b/3rdparty/bgfx/examples/22-windows/windows.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -86,6 +86,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/main.cpp b/3rdparty/bgfx/examples/23-vectordisplay/main.cpp
index cb72564d19f..213f917b617 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/main.cpp
+++ b/3rdparty/bgfx/examples/23-vectordisplay/main.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2014 Kai Jourdan. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*
*/
@@ -53,6 +53,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/makefile b/3rdparty/bgfx/examples/23-vectordisplay/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/makefile
+++ b/3rdparty/bgfx/examples/23-vectordisplay/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
index aae6ac0dfdd..719556a8996 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
+++ b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2014 Kai Jourdan. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
// Reference(s):
diff --git a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h
index 3b208b01978..3cfc57fa525 100644
--- a/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h
+++ b/3rdparty/bgfx/examples/23-vectordisplay/vectordisplay.h
@@ -1,6 +1,6 @@
/*
* Copyright 2014 Kai Jourdan. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef __VECTORDISPLAY_H__
@@ -64,10 +64,10 @@ public:
// Set the number of frames of decay/fade to apply to the scene.
bool setDecaySteps(int _steps);
- // Set the brightness multipler applied on each decay frame after the first.
+ // Set the brightness multiplier applied on each decay frame after the first.
bool setDecay(float _decay);
- // Set the brightness multipler applied on the first decay frame.
+ // Set the brightness multiplier applied on the first decay frame.
bool setInitialDecay(float _initialDecay);
// Set a 2d transformation for the display.
diff --git a/3rdparty/bgfx/examples/24-nbody/cs_indirect.sc b/3rdparty/bgfx/examples/24-nbody/cs_indirect.sc
index 87b6b1859cf..e06802f4f05 100644
--- a/3rdparty/bgfx/examples/24-nbody/cs_indirect.sc
+++ b/3rdparty/bgfx/examples/24-nbody/cs_indirect.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2014 Stanlo Slasinski. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/24-nbody/cs_init_instances.sc b/3rdparty/bgfx/examples/24-nbody/cs_init_instances.sc
index cc824b19332..0844979d17b 100644
--- a/3rdparty/bgfx/examples/24-nbody/cs_init_instances.sc
+++ b/3rdparty/bgfx/examples/24-nbody/cs_init_instances.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2014 Stanlo Slasinski. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/24-nbody/cs_update_instances.sc b/3rdparty/bgfx/examples/24-nbody/cs_update_instances.sc
index 612a7b95376..7031cb5729f 100644
--- a/3rdparty/bgfx/examples/24-nbody/cs_update_instances.sc
+++ b/3rdparty/bgfx/examples/24-nbody/cs_update_instances.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2014 Stanlo Slasinski. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/24-nbody/fs_particle.sc b/3rdparty/bgfx/examples/24-nbody/fs_particle.sc
index 6dfca6d3889..2f4bb4f81f9 100644
--- a/3rdparty/bgfx/examples/24-nbody/fs_particle.sc
+++ b/3rdparty/bgfx/examples/24-nbody/fs_particle.sc
@@ -2,7 +2,7 @@ $input v_texCoord
/*
* Copyright 2014 Stanlo Slasinski. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/24-nbody/makefile b/3rdparty/bgfx/examples/24-nbody/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/24-nbody/makefile
+++ b/3rdparty/bgfx/examples/24-nbody/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/24-nbody/nbody.cpp b/3rdparty/bgfx/examples/24-nbody/nbody.cpp
index c271074ee8b..6204705421e 100644
--- a/3rdparty/bgfx/examples/24-nbody/nbody.cpp
+++ b/3rdparty/bgfx/examples/24-nbody/nbody.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2014 Stanlo Slasinski. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -130,6 +130,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/24-nbody/uniforms.sh b/3rdparty/bgfx/examples/24-nbody/uniforms.sh
index a27545fbae0..cdecc49d68d 100644
--- a/3rdparty/bgfx/examples/24-nbody/uniforms.sh
+++ b/3rdparty/bgfx/examples/24-nbody/uniforms.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2014 Stanlo Slasinski. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
uniform vec4 u_params[3];
diff --git a/3rdparty/bgfx/examples/24-nbody/vs_particle.sc b/3rdparty/bgfx/examples/24-nbody/vs_particle.sc
index f6bf524a4c1..2d3a2e8aa9b 100644
--- a/3rdparty/bgfx/examples/24-nbody/vs_particle.sc
+++ b/3rdparty/bgfx/examples/24-nbody/vs_particle.sc
@@ -3,7 +3,7 @@ $output v_texCoord
/*
* Copyright 2014 Stanlo Slasinski. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/25-c99/helloworld.c b/3rdparty/bgfx/examples/25-c99/helloworld.c
index 1e3e79c9942..29b1a65d027 100644
--- a/3rdparty/bgfx/examples/25-c99/helloworld.c
+++ b/3rdparty/bgfx/examples/25-c99/helloworld.c
@@ -7,6 +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();
uint16_t uint16_max(uint16_t _a, uint16_t _b)
{
@@ -25,6 +27,9 @@ int32_t _main_(int32_t _argc, char** _argv)
bgfx_init_t init;
bgfx_init_ctor(&init);
+ init.platformData.nwh = entry_get_default_native_window_handle();
+ init.platformData.ndt = entry_get_native_display_handle();
+
bgfx_init(&init);
bgfx_reset(width, height, reset, init.resolution.format);
diff --git a/3rdparty/bgfx/examples/26-occlusion/occlusion.cpp b/3rdparty/bgfx/examples/26-occlusion/occlusion.cpp
index c1aea5b2381..d0149838d36 100644
--- a/3rdparty/bgfx/examples/26-occlusion/occlusion.cpp
+++ b/3rdparty/bgfx/examples/26-occlusion/occlusion.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -82,6 +82,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/27-terrain/fs_terrain.sc b/3rdparty/bgfx/examples/27-terrain/fs_terrain.sc
index 0b5aa82555d..aff04bea065 100644
--- a/3rdparty/bgfx/examples/27-terrain/fs_terrain.sc
+++ b/3rdparty/bgfx/examples/27-terrain/fs_terrain.sc
@@ -2,7 +2,7 @@ $input v_position, v_texcoord0
/*
* Copyright 2015 Andrew Mac. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/27-terrain/makefile b/3rdparty/bgfx/examples/27-terrain/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/27-terrain/makefile
+++ b/3rdparty/bgfx/examples/27-terrain/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/27-terrain/terrain.cpp b/3rdparty/bgfx/examples/27-terrain/terrain.cpp
index bcdaf16d702..3b493304a4c 100644
--- a/3rdparty/bgfx/examples/27-terrain/terrain.cpp
+++ b/3rdparty/bgfx/examples/27-terrain/terrain.cpp
@@ -1,16 +1,15 @@
/*
* Copyright 2015 Andrew Mac. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
+#include <bx/allocator.h>
+#include <bx/debug.h>
+#include <bx/math.h>
#include "common.h"
#include "bgfx_utils.h"
#include "imgui/imgui.h"
#include "camera.h"
-#include "bounds.h"
-#include <bx/allocator.h>
-#include <bx/debug.h>
-#include <bx/math.h>
namespace
{
@@ -79,6 +78,8 @@ ExampleTerrain(const char* _name, const char* _description, const char* _url)
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/27-terrain/vs_terrain.sc b/3rdparty/bgfx/examples/27-terrain/vs_terrain.sc
index 4cea23e2d30..6fde83db33f 100644
--- a/3rdparty/bgfx/examples/27-terrain/vs_terrain.sc
+++ b/3rdparty/bgfx/examples/27-terrain/vs_terrain.sc
@@ -3,7 +3,7 @@ $output v_position, v_texcoord0
/*
* Copyright 2015 Andrew Mac. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/27-terrain/vs_terrain_height_texture.sc b/3rdparty/bgfx/examples/27-terrain/vs_terrain_height_texture.sc
index f3451aa0328..c15a357766b 100644
--- a/3rdparty/bgfx/examples/27-terrain/vs_terrain_height_texture.sc
+++ b/3rdparty/bgfx/examples/27-terrain/vs_terrain_height_texture.sc
@@ -3,7 +3,7 @@ $output v_position, v_texcoord0
/*
* Copyright 2015 Andrew Mac. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/28-wireframe/fs_wf_mesh.sc b/3rdparty/bgfx/examples/28-wireframe/fs_wf_mesh.sc
index 4a68b1472e1..c5f8e458715 100644
--- a/3rdparty/bgfx/examples/28-wireframe/fs_wf_mesh.sc
+++ b/3rdparty/bgfx/examples/28-wireframe/fs_wf_mesh.sc
@@ -2,7 +2,7 @@ $input v_view, v_bc, v_normal
/*
* Copyright 2016 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/28-wireframe/fs_wf_wireframe.sc b/3rdparty/bgfx/examples/28-wireframe/fs_wf_wireframe.sc
index e2ff1420011..c60b7246da8 100644
--- a/3rdparty/bgfx/examples/28-wireframe/fs_wf_wireframe.sc
+++ b/3rdparty/bgfx/examples/28-wireframe/fs_wf_wireframe.sc
@@ -2,7 +2,7 @@ $input v_view, v_bc
/*
* Copyright 2016 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/28-wireframe/makefile b/3rdparty/bgfx/examples/28-wireframe/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/28-wireframe/makefile
+++ b/3rdparty/bgfx/examples/28-wireframe/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/28-wireframe/uniforms.sh b/3rdparty/bgfx/examples/28-wireframe/uniforms.sh
index 330555ee50d..934c41c6a12 100644
--- a/3rdparty/bgfx/examples/28-wireframe/uniforms.sh
+++ b/3rdparty/bgfx/examples/28-wireframe/uniforms.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2016 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
uniform vec4 u_params[3];
diff --git a/3rdparty/bgfx/examples/28-wireframe/vs_wf_mesh.sc b/3rdparty/bgfx/examples/28-wireframe/vs_wf_mesh.sc
index 3f51abc59ad..77d4f60be00 100644
--- a/3rdparty/bgfx/examples/28-wireframe/vs_wf_mesh.sc
+++ b/3rdparty/bgfx/examples/28-wireframe/vs_wf_mesh.sc
@@ -3,7 +3,7 @@ $output v_view, v_bc, v_normal
/*
* Copyright 2016 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/28-wireframe/vs_wf_wireframe.sc b/3rdparty/bgfx/examples/28-wireframe/vs_wf_wireframe.sc
index 1956b0d64ef..2a63a30a3e7 100644
--- a/3rdparty/bgfx/examples/28-wireframe/vs_wf_wireframe.sc
+++ b/3rdparty/bgfx/examples/28-wireframe/vs_wf_wireframe.sc
@@ -3,7 +3,7 @@ $output v_view, v_bc
/*
* Copyright 2016 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/28-wireframe/wireframe.cpp b/3rdparty/bgfx/examples/28-wireframe/wireframe.cpp
index 5529b2c2434..905ab2c6a41 100644
--- a/3rdparty/bgfx/examples/28-wireframe/wireframe.cpp
+++ b/3rdparty/bgfx/examples/28-wireframe/wireframe.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2016 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -57,7 +57,7 @@ struct Camera
const bx::Vec3 toTarget = bx::sub(m_target.dest, m_pos.dest);
const float toTargetLen = bx::length(toTarget);
- const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatMin);
+ const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatSmallest);
const bx::Vec3 toTargetNorm = bx::mul(toTarget, invToTargetLen);
float delta = toTargetLen * _dz;
@@ -79,7 +79,7 @@ struct Camera
const bx::Vec3 toPos = bx::sub(m_pos.curr, m_target.curr);
const float toPosLen = bx::length(toPos);
- const float invToPosLen = 1.0f / (toPosLen + bx::kFloatMin);
+ const float invToPosLen = 1.0f / (toPosLen + bx::kFloatSmallest);
const bx::Vec3 toPosNorm = bx::mul(toPos, invToPosLen);
float ll[2];
@@ -109,7 +109,7 @@ struct Camera
{
const bx::Vec3 toTarget = bx::sub(m_target.curr, m_pos.curr);
const float toTargetLen = bx::length(toTarget);
- const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatMin);
+ const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatSmallest);
const bx::Vec3 toTargetNorm = bx::mul(toTarget, invToTargetLen);
const bx::Vec3 right = bx::normalize(bx::cross({ 0.0f, 1.0f, 0.0f }, toTargetNorm) );
@@ -291,6 +291,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/29-debugdraw/debugdraw.cpp b/3rdparty/bgfx/examples/29-debugdraw/debugdraw.cpp
index f7828b8925b..fb13bb7e3c8 100644
--- a/3rdparty/bgfx/examples/29-debugdraw/debugdraw.cpp
+++ b/3rdparty/bgfx/examples/29-debugdraw/debugdraw.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -485,15 +485,15 @@ struct Shape
};
Shape() : type(uint8_t(Type::Count) ) {}
- Shape(const Aabb & _a) : type(uint8_t(Type::Aabb ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
- Shape(const Capsule & _a) : type(uint8_t(Type::Capsule ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
- Shape(const Cone & _a) : type(uint8_t(Type::Cone ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
- Shape(const Cylinder & _a) : type(uint8_t(Type::Cylinder) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
- Shape(const Disk & _a) : type(uint8_t(Type::Disk ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
- Shape(const Obb & _a) : type(uint8_t(Type::Obb ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
- Shape(const bx::Plane& _a) : type(uint8_t(Type::Plane ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
- Shape(const Sphere & _a) : type(uint8_t(Type::Sphere ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
- Shape(const Triangle & _a) : type(uint8_t(Type::Triangle) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
+ Shape(const bx::Aabb & _a) : type(uint8_t(Type::Aabb ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
+ Shape(const bx::Capsule & _a) : type(uint8_t(Type::Capsule ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
+ Shape(const bx::Cone & _a) : type(uint8_t(Type::Cone ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
+ Shape(const bx::Cylinder & _a) : type(uint8_t(Type::Cylinder) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
+ Shape(const bx::Disk & _a) : type(uint8_t(Type::Disk ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
+ Shape(const bx::Obb & _a) : type(uint8_t(Type::Obb ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
+ Shape(const bx::Plane & _a) : type(uint8_t(Type::Plane ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
+ Shape(const bx::Sphere & _a) : type(uint8_t(Type::Sphere ) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
+ Shape(const bx::Triangle & _a) : type(uint8_t(Type::Triangle) ) { bx::memCopy(data, &_a, sizeof(_a) ); }
uint8_t data[64];
uint8_t type;
@@ -504,28 +504,28 @@ struct Shape
{ \
switch (_shapeB.type) \
{ \
- case Shape::Type::Aabb: return ::overlap(_shapeA, *reinterpret_cast<const Aabb *>(_shapeB.data) ); \
- case Shape::Type::Capsule: return ::overlap(_shapeA, *reinterpret_cast<const Capsule *>(_shapeB.data) ); \
- case Shape::Type::Cone: return ::overlap(_shapeA, *reinterpret_cast<const Cone *>(_shapeB.data) ); \
- case Shape::Type::Cylinder: return ::overlap(_shapeA, *reinterpret_cast<const Cylinder *>(_shapeB.data) ); \
- case Shape::Type::Disk: return ::overlap(_shapeA, *reinterpret_cast<const Disk *>(_shapeB.data) ); \
- case Shape::Type::Obb: return ::overlap(_shapeA, *reinterpret_cast<const Obb *>(_shapeB.data) ); \
- case Shape::Type::Plane: return ::overlap(_shapeA, *reinterpret_cast<const bx::Plane*>(_shapeB.data) ); \
- case Shape::Type::Sphere: return ::overlap(_shapeA, *reinterpret_cast<const Sphere *>(_shapeB.data) ); \
- case Shape::Type::Triangle: return ::overlap(_shapeA, *reinterpret_cast<const Triangle *>(_shapeB.data) ); \
+ case Shape::Type::Aabb: return bx::overlap(_shapeA, *reinterpret_cast<const bx::Aabb *>(_shapeB.data) ); \
+ case Shape::Type::Capsule: return bx::overlap(_shapeA, *reinterpret_cast<const bx::Capsule *>(_shapeB.data) ); \
+ case Shape::Type::Cone: return bx::overlap(_shapeA, *reinterpret_cast<const bx::Cone *>(_shapeB.data) ); \
+ case Shape::Type::Cylinder: return bx::overlap(_shapeA, *reinterpret_cast<const bx::Cylinder *>(_shapeB.data) ); \
+ case Shape::Type::Disk: return bx::overlap(_shapeA, *reinterpret_cast<const bx::Disk *>(_shapeB.data) ); \
+ case Shape::Type::Obb: return bx::overlap(_shapeA, *reinterpret_cast<const bx::Obb *>(_shapeB.data) ); \
+ case Shape::Type::Plane: return bx::overlap(_shapeA, *reinterpret_cast<const bx::Plane *>(_shapeB.data) ); \
+ case Shape::Type::Sphere: return bx::overlap(_shapeA, *reinterpret_cast<const bx::Sphere *>(_shapeB.data) ); \
+ case Shape::Type::Triangle: return bx::overlap(_shapeA, *reinterpret_cast<const bx::Triangle *>(_shapeB.data) ); \
} \
return false; \
}
-OVERLAP(Aabb);
-OVERLAP(Capsule);
-OVERLAP(Cone);
-OVERLAP(Cylinder);
-OVERLAP(Disk);
-OVERLAP(Obb);
+OVERLAP(bx::Aabb);
+OVERLAP(bx::Capsule);
+OVERLAP(bx::Cone);
+OVERLAP(bx::Cylinder);
+OVERLAP(bx::Disk);
+OVERLAP(bx::Obb);
OVERLAP(bx::Plane);
-OVERLAP(Sphere);
-OVERLAP(Triangle);
+OVERLAP(bx::Sphere);
+OVERLAP(bx::Triangle);
#undef OVERLAP
@@ -535,14 +535,14 @@ void initA(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos)
{
case Shape::Type::Aabb:
{
- Aabb aabb;
+ bx::Aabb aabb;
toAabb(aabb, _pos, { 0.5f, 0.5f, 0.5f });
_outShape = Shape(aabb);
}
break;
case Shape::Type::Capsule:
- _outShape = Shape(Capsule
+ _outShape = Shape(bx::Capsule
{
{ bx::add(_pos, {0.0f, -1.0f, 0.0f}) },
{ bx::add(_pos, {0.0f, 1.0f, 0.0f}) },
@@ -551,7 +551,7 @@ void initA(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos)
break;
case Shape::Type::Cone:
- _outShape = Shape(Cone
+ _outShape = Shape(bx::Cone
{
{ bx::add(_pos, {0.0f, -1.0f, 0.0f}) },
{ bx::add(_pos, {0.0f, 1.0f, 0.0f}) },
@@ -560,7 +560,7 @@ void initA(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos)
break;
case Shape::Type::Cylinder:
- _outShape = Shape(Cylinder
+ _outShape = Shape(bx::Cylinder
{
{ bx::add(_pos, {0.0f, -1.0f, 0.0f}) },
{ bx::add(_pos, {0.0f, 1.0f, 0.0f}) },
@@ -569,7 +569,7 @@ void initA(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos)
break;
case Shape::Type::Disk:
- _outShape = Shape(Disk
+ _outShape = Shape(bx::Disk
{
_pos,
bx::normalize(bx::Vec3{0.0f, 1.0f, 1.0f}),
@@ -579,7 +579,7 @@ void initA(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos)
case Shape::Type::Obb:
{
- Obb obb;
+ bx::Obb obb;
bx::mtxSRT(obb.mtx
, 0.25f
, 1.0f
@@ -596,7 +596,7 @@ void initA(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos)
break;
case Shape::Type::Sphere:
- _outShape = Shape(Sphere{_pos, 0.5f});
+ _outShape = Shape(bx::Sphere{_pos, 0.5f});
break;
case Shape::Type::Plane:
@@ -608,7 +608,7 @@ void initA(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos)
break;
case Shape::Type::Triangle:
- _outShape = Shape(Triangle
+ _outShape = Shape(bx::Triangle
{
{ bx::add(_pos, {-0.4f, 0.0f, -0.4f}) },
{ bx::add(_pos, { 0.0f, -0.3f, 0.5f}) },
@@ -626,14 +626,14 @@ void initB(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos)
{
case Shape::Type::Aabb:
{
- Aabb aabb;
+ bx::Aabb aabb;
toAabb(aabb, _pos, { 0.5f, 0.5f, 0.5f });
_outShape = Shape(aabb);
}
break;
case Shape::Type::Capsule:
- _outShape = Shape(Capsule
+ _outShape = Shape(bx::Capsule
{
{ bx::add(_pos, {0.0f, -1.0f, 0.1f}) },
{ bx::add(_pos, {0.0f, 1.0f, 0.0f}) },
@@ -642,7 +642,7 @@ void initB(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos)
break;
case Shape::Type::Cone:
- _outShape = Shape(Cone
+ _outShape = Shape(bx::Cone
{
{ bx::add(_pos, {0.0f, -1.0f, 0.1f}) },
{ bx::add(_pos, {0.0f, 1.0f, 0.0f}) },
@@ -651,7 +651,7 @@ void initB(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos)
break;
case Shape::Type::Cylinder:
- _outShape = Shape(Cylinder
+ _outShape = Shape(bx::Cylinder
{
{ bx::add(_pos, {0.0f, -1.0f, 0.1f}) },
{ bx::add(_pos, {0.0f, 1.0f, 0.0f}) },
@@ -660,7 +660,7 @@ void initB(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos)
break;
case Shape::Type::Disk:
- _outShape = Shape(Disk
+ _outShape = Shape(bx::Disk
{
_pos,
bx::normalize(bx::Vec3{1.0f, 1.0f, 0.0f}),
@@ -670,7 +670,7 @@ void initB(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos)
case Shape::Type::Obb:
{
- Obb obb;
+ bx::Obb obb;
bx::mtxSRT(obb.mtx
, 1.0f
, 0.25f
@@ -695,11 +695,11 @@ void initB(Shape& _outShape, Shape::Type::Enum _type, bx::Vec3 _pos)
break;
case Shape::Type::Sphere:
- _outShape = Shape(Sphere{_pos, 0.5f});
+ _outShape = Shape(bx::Sphere{_pos, 0.5f});
break;
case Shape::Type::Triangle:
- _outShape = Shape(Triangle
+ _outShape = Shape(bx::Triangle
{
{ bx::add(_pos, {-0.4f, 0.0f, -0.4f}) },
{ bx::add(_pos, {-0.5f, -0.3f, 0.0f}) },
@@ -715,15 +715,15 @@ int32_t overlap(const Shape& _shapeA, const Shape& _shapeB)
{
switch (_shapeA.type)
{
- case Shape::Type::Aabb: return overlap(*reinterpret_cast<const Aabb *>(_shapeA.data), _shapeB);
- case Shape::Type::Capsule: return overlap(*reinterpret_cast<const Capsule *>(_shapeA.data), _shapeB);
- case Shape::Type::Cone: return overlap(*reinterpret_cast<const Cone *>(_shapeA.data), _shapeB);
- case Shape::Type::Cylinder: return overlap(*reinterpret_cast<const Cylinder *>(_shapeA.data), _shapeB);
- case Shape::Type::Disk: return overlap(*reinterpret_cast<const Disk *>(_shapeA.data), _shapeB);
- case Shape::Type::Obb: return overlap(*reinterpret_cast<const Obb *>(_shapeA.data), _shapeB);
- case Shape::Type::Plane: return overlap(*reinterpret_cast<const bx::Plane*>(_shapeA.data), _shapeB);
- case Shape::Type::Sphere: return overlap(*reinterpret_cast<const Sphere *>(_shapeA.data), _shapeB);
- case Shape::Type::Triangle: return overlap(*reinterpret_cast<const Triangle *>(_shapeA.data), _shapeB);
+ case Shape::Type::Aabb: return ::overlap(*reinterpret_cast<const bx::Aabb *>(_shapeA.data), _shapeB);
+ case Shape::Type::Capsule: return ::overlap(*reinterpret_cast<const bx::Capsule *>(_shapeA.data), _shapeB);
+ case Shape::Type::Cone: return ::overlap(*reinterpret_cast<const bx::Cone *>(_shapeA.data), _shapeB);
+ case Shape::Type::Cylinder: return ::overlap(*reinterpret_cast<const bx::Cylinder *>(_shapeA.data), _shapeB);
+ case Shape::Type::Disk: return ::overlap(*reinterpret_cast<const bx::Disk *>(_shapeA.data), _shapeB);
+ case Shape::Type::Obb: return ::overlap(*reinterpret_cast<const bx::Obb *>(_shapeA.data), _shapeB);
+ case Shape::Type::Plane: return ::overlap(*reinterpret_cast<const bx::Plane *>(_shapeA.data), _shapeB);
+ case Shape::Type::Sphere: return ::overlap(*reinterpret_cast<const bx::Sphere *>(_shapeA.data), _shapeB);
+ case Shape::Type::Triangle: return ::overlap(*reinterpret_cast<const bx::Triangle *>(_shapeA.data), _shapeB);
}
return 2;
@@ -733,15 +733,15 @@ void draw(DebugDrawEncoder& _dde, const Shape& _shape, const bx::Vec3 _pos)
{
switch (_shape.type)
{
- case Shape::Type::Aabb: _dde.draw (*reinterpret_cast<const Aabb *>(_shape.data) ); break;
- case Shape::Type::Capsule: _dde.draw (*reinterpret_cast<const Capsule *>(_shape.data) ); break;
- case Shape::Type::Cone: _dde.draw (*reinterpret_cast<const Cone *>(_shape.data) ); break;
- case Shape::Type::Cylinder: _dde.draw (*reinterpret_cast<const Cylinder *>(_shape.data) ); break;
- case Shape::Type::Disk: _dde.draw (*reinterpret_cast<const Disk *>(_shape.data) ); break;
- case Shape::Type::Obb: _dde.draw (*reinterpret_cast<const Obb *>(_shape.data) ); break;
- case Shape::Type::Plane: { _dde.drawGrid( reinterpret_cast<const bx::Plane*>(_shape.data)->normal, _pos, 9, 0.3f); } break;
- case Shape::Type::Sphere: _dde.draw (*reinterpret_cast<const Sphere *>(_shape.data) ); break;
- case Shape::Type::Triangle: _dde.draw (*reinterpret_cast<const Triangle *>(_shape.data) ); break;
+ case Shape::Type::Aabb: _dde.draw (*reinterpret_cast<const bx::Aabb *>(_shape.data) ); break;
+ case Shape::Type::Capsule: _dde.draw (*reinterpret_cast<const bx::Capsule *>(_shape.data) ); break;
+ case Shape::Type::Cone: _dde.draw (*reinterpret_cast<const bx::Cone *>(_shape.data) ); break;
+ case Shape::Type::Cylinder: _dde.draw (*reinterpret_cast<const bx::Cylinder *>(_shape.data) ); break;
+ case Shape::Type::Disk: _dde.draw (*reinterpret_cast<const bx::Disk *>(_shape.data) ); break;
+ case Shape::Type::Obb: _dde.draw (*reinterpret_cast<const bx::Obb *>(_shape.data) ); break;
+ case Shape::Type::Plane: { _dde.drawGrid( reinterpret_cast<const bx::Plane *>(_shape.data)->normal, _pos, 9, 0.3f); } break;
+ case Shape::Type::Sphere: _dde.draw (*reinterpret_cast<const bx::Sphere *>(_shape.data) ); break;
+ case Shape::Type::Triangle: _dde.draw (*reinterpret_cast<const bx::Triangle *>(_shape.data) ); break;
}
}
@@ -778,6 +778,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -835,10 +837,10 @@ public:
}
template<typename Ty>
- bool intersect(DebugDrawEncoder* _dde, const Ray& _ray, const Ty& _shape)
+ bool intersect(DebugDrawEncoder* _dde, const bx::Ray& _ray, const Ty& _shape)
{
- Hit hit;
- if (::intersect(_ray, _shape, &hit) )
+ bx::Hit hit;
+ if (bx::intersect(_ray, _shape, &hit) )
{
_dde->push();
@@ -931,7 +933,7 @@ public:
bx::mtxProj(proj, 45.0f, float(m_width)/float(m_height), 1.0f, 15.0f, bgfx::getCaps()->homogeneousDepth);
bx::mtxMul(mtxVp, view, proj);
- Ray ray = makeRay(
+ bx::Ray ray = bx::makeRay(
(float(m_mouseState.m_mx)/float(m_width) * 2.0f - 1.0f)
, -(float(m_mouseState.m_my)/float(m_height) * 2.0f - 1.0f)
, mtxInvVp
@@ -947,7 +949,7 @@ public:
dde.drawAxis(0.0f, 0.0f, 0.0f);
dde.push();
- Aabb aabb =
+ bx::Aabb aabb =
{
{ 5.0f, 1.0f, 1.0f },
{ 10.0f, 5.0f, 5.0f },
@@ -960,7 +962,7 @@ public:
static float time = 0.0f;
time += deltaTime*timeScale;
- Obb obb;
+ bx::Obb obb;
bx::mtxRotateX(obb.mtx, time);
dde.setWireframe(true);
dde.setColor(intersect(&dde, ray, obb) ? kSelected : 0xffffffff);
@@ -969,7 +971,7 @@ public:
bx::mtxSRT(obb.mtx, 1.0f, 1.0f, 1.0f, time*0.23f, time, 0.0f, 3.0f, 0.0f, 0.0f);
dde.push();
- toAabb(aabb, obb);
+ bx::toAabb(aabb, obb);
dde.setWireframe(true);
dde.setColor(0xff0000ff);
dde.draw(aabb);
@@ -1014,7 +1016,7 @@ public:
dde.drawFrustum(mtxVp);
dde.push();
- Sphere sphere = { { 0.0f, 5.0f, 0.0f }, 1.0f };
+ bx::Sphere sphere = { { 0.0f, 5.0f, 0.0f }, 1.0f };
dde.setColor(intersect(&dde, ray, sphere) ? kSelected : 0xfff0c0ff);
dde.setWireframe(true);
dde.setLod(3);
@@ -1065,14 +1067,14 @@ public:
dde.push();
dde.setSpin(time*0.3f);
{
- Cone cone =
+ bx::Cone cone =
{
{ -11.0f, 4.0f, 0.0f },
{ -13.0f, 6.0f, 1.0f },
1.0f
};
- Cylinder cylinder =
+ bx::Cylinder cylinder =
{
{ -9.0f, 2.0f, -1.0f },
{ -11.0f, 4.0f, 0.0f },
@@ -1093,7 +1095,7 @@ public:
{
dde.setLod(0);
- Capsule capsule =
+ bx::Capsule capsule =
{
{ 0.0f, 7.0f, 0.0f },
{ -6.0f, 7.0f, 0.0f },
@@ -1113,7 +1115,7 @@ public:
, -10.0f, 1.0f, 10.0f
);
- Cylinder cylinder =
+ bx::Cylinder cylinder =
{
{ -10.0f, 1.0f, 10.0f },
{ 0.0f, 0.0f, 0.0f },
diff --git a/3rdparty/bgfx/examples/30-picking/fs_picking_id.sc b/3rdparty/bgfx/examples/30-picking/fs_picking_id.sc
index 0531be95be0..8a229310078 100644
--- a/3rdparty/bgfx/examples/30-picking/fs_picking_id.sc
+++ b/3rdparty/bgfx/examples/30-picking/fs_picking_id.sc
@@ -1,8 +1,8 @@
$input v_pos, v_view, v_normal, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/30-picking/fs_picking_shaded.sc b/3rdparty/bgfx/examples/30-picking/fs_picking_shaded.sc
index 8298be71238..05c873e9676 100644
--- a/3rdparty/bgfx/examples/30-picking/fs_picking_shaded.sc
+++ b/3rdparty/bgfx/examples/30-picking/fs_picking_shaded.sc
@@ -1,8 +1,8 @@
$input v_pos, v_view, v_normal, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/30-picking/makefile b/3rdparty/bgfx/examples/30-picking/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/30-picking/makefile
+++ b/3rdparty/bgfx/examples/30-picking/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/30-picking/picking.cpp b/3rdparty/bgfx/examples/30-picking/picking.cpp
index 52a51a3c4b1..a77395e8d71 100644
--- a/3rdparty/bgfx/examples/30-picking/picking.cpp
+++ b/3rdparty/bgfx/examples/30-picking/picking.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2016 Joseph Cherlin. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -38,6 +38,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -54,7 +56,7 @@ public:
, 0
);
- // ID buffer clears to black, which represnts clicking on nothing (background)
+ // ID buffer clears to black, which represents clicking on nothing (background)
bgfx::setViewClear(RENDER_PASS_ID
, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
, 0x000000ff
diff --git a/3rdparty/bgfx/examples/30-picking/vs_picking_shaded.sc b/3rdparty/bgfx/examples/30-picking/vs_picking_shaded.sc
index a31c9e55daf..f4ba4f35f3b 100644
--- a/3rdparty/bgfx/examples/30-picking/vs_picking_shaded.sc
+++ b/3rdparty/bgfx/examples/30-picking/vs_picking_shaded.sc
@@ -2,8 +2,8 @@ $input a_position, a_normal
$output v_pos, v_view, v_normal, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/31-rsm/fs_rsm_combine.sc b/3rdparty/bgfx/examples/31-rsm/fs_rsm_combine.sc
index ac3fd2805c8..6640c0945f8 100644
--- a/3rdparty/bgfx/examples/31-rsm/fs_rsm_combine.sc
+++ b/3rdparty/bgfx/examples/31-rsm/fs_rsm_combine.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2016 Joseph Cherlin. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/31-rsm/fs_rsm_gbuffer.sc b/3rdparty/bgfx/examples/31-rsm/fs_rsm_gbuffer.sc
index a220ecf9dc3..c17b87615fb 100644
--- a/3rdparty/bgfx/examples/31-rsm/fs_rsm_gbuffer.sc
+++ b/3rdparty/bgfx/examples/31-rsm/fs_rsm_gbuffer.sc
@@ -2,7 +2,7 @@ $input v_normal
/*
* Copyright 2016 Joseph Cherlin. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/31-rsm/fs_rsm_lbuffer.sc b/3rdparty/bgfx/examples/31-rsm/fs_rsm_lbuffer.sc
index 7db4734b140..cef4c4861cd 100644
--- a/3rdparty/bgfx/examples/31-rsm/fs_rsm_lbuffer.sc
+++ b/3rdparty/bgfx/examples/31-rsm/fs_rsm_lbuffer.sc
@@ -2,7 +2,7 @@ $input v_lightCenterScale, v_color0
/*
* Copyright 2016 Joseph Cherlin. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/31-rsm/fs_rsm_shadow.sc b/3rdparty/bgfx/examples/31-rsm/fs_rsm_shadow.sc
index 44298411d5a..a63655b9359 100644
--- a/3rdparty/bgfx/examples/31-rsm/fs_rsm_shadow.sc
+++ b/3rdparty/bgfx/examples/31-rsm/fs_rsm_shadow.sc
@@ -2,7 +2,7 @@ $input v_normal
/*
* Copyright 2016 Joseph Cherlin. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/31-rsm/makefile b/3rdparty/bgfx/examples/31-rsm/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/31-rsm/makefile
+++ b/3rdparty/bgfx/examples/31-rsm/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/31-rsm/reflectiveshadowmap.cpp b/3rdparty/bgfx/examples/31-rsm/reflectiveshadowmap.cpp
index 113cb59bf3a..358893f9bb8 100644
--- a/3rdparty/bgfx/examples/31-rsm/reflectiveshadowmap.cpp
+++ b/3rdparty/bgfx/examples/31-rsm/reflectiveshadowmap.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2016 Joseph Cherlin. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <common.h>
@@ -211,6 +211,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -353,8 +355,8 @@ public:
, BGFX_TEXTURE_RT /* | BGFX_SAMPLER_COMPARE_LEQUAL*/
); // Note I'm not setting BGFX_SAMPLER_COMPARE_LEQUAL. Why?
// Normally a PCF shadow map such as this requires a compare. However, this sample also
- // reads from this texture in the lighting pass, and only uses the PCF capabilites in the
- // combine pass, so the flag is disabled by default.
+ // reads from this texture in the lighting pass, and only uses the PCF capabilities in
+ // the combine pass, so the flag is disabled by default.
m_shadowBuffer = bgfx::createFrameBuffer(BX_COUNTOF(m_shadowBufferTex), m_shadowBufferTex, true);
diff --git a/3rdparty/bgfx/examples/31-rsm/vs_rsm_combine.sc b/3rdparty/bgfx/examples/31-rsm/vs_rsm_combine.sc
index be7032c2be5..9df8597805d 100644
--- a/3rdparty/bgfx/examples/31-rsm/vs_rsm_combine.sc
+++ b/3rdparty/bgfx/examples/31-rsm/vs_rsm_combine.sc
@@ -3,7 +3,7 @@ $output v_texcoord0
/*
* Copyright 2016 Joseph Cherlin. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/31-rsm/vs_rsm_gbuffer.sc b/3rdparty/bgfx/examples/31-rsm/vs_rsm_gbuffer.sc
index 123e4fbf4af..a7ac4108a11 100644
--- a/3rdparty/bgfx/examples/31-rsm/vs_rsm_gbuffer.sc
+++ b/3rdparty/bgfx/examples/31-rsm/vs_rsm_gbuffer.sc
@@ -3,7 +3,7 @@ $output v_normal
/*
* Copyright 2016 Joseph Cherlin. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
diff --git a/3rdparty/bgfx/examples/31-rsm/vs_rsm_lbuffer.sc b/3rdparty/bgfx/examples/31-rsm/vs_rsm_lbuffer.sc
index 2dd65c0374b..7cdea3c3421 100644
--- a/3rdparty/bgfx/examples/31-rsm/vs_rsm_lbuffer.sc
+++ b/3rdparty/bgfx/examples/31-rsm/vs_rsm_lbuffer.sc
@@ -3,7 +3,7 @@ $output v_lightCenterScale, v_color0
/*
* Copyright 2016 Joseph Cherlin. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/31-rsm/vs_rsm_shadow.sc b/3rdparty/bgfx/examples/31-rsm/vs_rsm_shadow.sc
index 41bf8ab118d..942e1c3e3a6 100644
--- a/3rdparty/bgfx/examples/31-rsm/vs_rsm_shadow.sc
+++ b/3rdparty/bgfx/examples/31-rsm/vs_rsm_shadow.sc
@@ -3,7 +3,7 @@ $output v_normal // RSM shadow
/*
* Copyright 2016 Joseph Cherlin. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/32-particles/particles.cpp b/3rdparty/bgfx/examples/32-particles/particles.cpp
index 7a504eb69e5..d5642b4b8d2 100644
--- a/3rdparty/bgfx/examples/32-particles/particles.cpp
+++ b/3rdparty/bgfx/examples/32-particles/particles.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -246,6 +246,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -417,7 +419,7 @@ public:
if (showBounds)
{
- Aabb aabb;
+ bx::Aabb aabb;
psGetAabb(m_emitter[currentEmitter].m_handle, aabb);
dde.push();
dde.setWireframe(true);
diff --git a/3rdparty/bgfx/examples/33-pom/makefile b/3rdparty/bgfx/examples/33-pom/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/33-pom/makefile
+++ b/3rdparty/bgfx/examples/33-pom/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/33-pom/pom.cpp b/3rdparty/bgfx/examples/33-pom/pom.cpp
index a4fa0649ab7..71e7e1d85ea 100644
--- a/3rdparty/bgfx/examples/33-pom/pom.cpp
+++ b/3rdparty/bgfx/examples/33-pom/pom.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -128,6 +128,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/34-mvs/mvs.cpp b/3rdparty/bgfx/examples/34-mvs/mvs.cpp
index 8f0732f1903..bbe469b9533 100644
--- a/3rdparty/bgfx/examples/34-mvs/mvs.cpp
+++ b/3rdparty/bgfx/examples/34-mvs/mvs.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -124,6 +124,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/35-dynamic/dynamic.cpp b/3rdparty/bgfx/examples/35-dynamic/dynamic.cpp
index d26e4031a08..76544852ffa 100644
--- a/3rdparty/bgfx/examples/35-dynamic/dynamic.cpp
+++ b/3rdparty/bgfx/examples/35-dynamic/dynamic.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -102,6 +102,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/36-sky/fs_sky.sc b/3rdparty/bgfx/examples/36-sky/fs_sky.sc
index 7c53d5018c7..1b3481838a6 100644
--- a/3rdparty/bgfx/examples/36-sky/fs_sky.sc
+++ b/3rdparty/bgfx/examples/36-sky/fs_sky.sc
@@ -2,7 +2,7 @@ $input v_skyColor, v_screenPos, v_viewDir
/*
* Copyright 2017 Stanislav Pidhorskyi. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
uniform vec4 u_parameters; // x - sun size, y - sun bloom, z - exposition, w - time
diff --git a/3rdparty/bgfx/examples/36-sky/fs_sky_color_banding_fix.sc b/3rdparty/bgfx/examples/36-sky/fs_sky_color_banding_fix.sc
index 6782e03e310..de96f218043 100644
--- a/3rdparty/bgfx/examples/36-sky/fs_sky_color_banding_fix.sc
+++ b/3rdparty/bgfx/examples/36-sky/fs_sky_color_banding_fix.sc
@@ -2,7 +2,7 @@ $input v_skyColor, v_screenPos, v_viewDir
/*
* Copyright 2017 Stanislav Pidhorskyi. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
diff --git a/3rdparty/bgfx/examples/36-sky/fs_sky_landscape.sc b/3rdparty/bgfx/examples/36-sky/fs_sky_landscape.sc
index 088b03c70a5..0ce045e577e 100644
--- a/3rdparty/bgfx/examples/36-sky/fs_sky_landscape.sc
+++ b/3rdparty/bgfx/examples/36-sky/fs_sky_landscape.sc
@@ -2,7 +2,7 @@ $input v_normal, v_texcoord0
/*
* Copyright 2017 Stanislav Pidhorskyi. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/36-sky/makefile b/3rdparty/bgfx/examples/36-sky/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/36-sky/makefile
+++ b/3rdparty/bgfx/examples/36-sky/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/36-sky/sky.cpp b/3rdparty/bgfx/examples/36-sky/sky.cpp
index 7c2d3bb98b4..3648881c627 100644
--- a/3rdparty/bgfx/examples/36-sky/sky.cpp
+++ b/3rdparty/bgfx/examples/36-sky/sky.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2017 Stanislav Pidhorskyi. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -52,611 +52,612 @@
#include "bgfx_utils.h"
#include "imgui/imgui.h"
#include "camera.h"
-#include "bounds.h"
#include <map>
namespace
{
- // Represents color. Color-space depends on context.
- // In the code below, used to represent color in XYZ, and RGB color-space
- typedef bx::Vec3 Color;
+// Represents color. Color-space depends on context.
+// In the code below, used to represent color in XYZ, and RGB color-space
+typedef bx::Vec3 Color;
- // HDTV rec. 709 matrix.
- static constexpr float M_XYZ2RGB[] =
- {
- 3.240479f, -0.969256f, 0.055648f,
- -1.53715f, 1.875991f, -0.204043f,
- -0.49853f, 0.041556f, 1.057311f,
- };
+// HDTV rec. 709 matrix.
+static constexpr float M_XYZ2RGB[] =
+{
+ 3.240479f, -0.969256f, 0.055648f,
+ -1.53715f, 1.875991f, -0.204043f,
+ -0.49853f, 0.041556f, 1.057311f,
+};
- // Converts color repesentation from CIE XYZ to RGB color-space.
- Color xyzToRgb(const Color& xyz)
- {
- Color rgb(bx::init::None);
- 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;
- return rgb;
- };
+// Converts color representation from CIE XYZ to RGB color-space.
+Color xyzToRgb(const Color& xyz)
+{
+ Color rgb(bx::init::None);
+ 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;
+ return rgb;
+};
+
+// Precomputed luminance of sunlight in XYZ colorspace.
+// Computed using code from Game Engine Gems, Volume One, chapter 15. Implementation based on Dr. Richard Bird model.
+// This table is used for piecewise linear interpolation. Transitions from and to 0.0 at sunset and sunrise are highly inaccurate
+static std::map<float, Color> sunLuminanceXYZTable =
+{
+ { 5.0f, { 0.000000f, 0.000000f, 0.000000f } },
+ { 7.0f, { 12.703322f, 12.989393f, 9.100411f } },
+ { 8.0f, { 13.202644f, 13.597814f, 11.524929f } },
+ { 9.0f, { 13.192974f, 13.597458f, 12.264488f } },
+ { 10.0f, { 13.132943f, 13.535914f, 12.560032f } },
+ { 11.0f, { 13.088722f, 13.489535f, 12.692996f } },
+ { 12.0f, { 13.067827f, 13.467483f, 12.745179f } },
+ { 13.0f, { 13.069653f, 13.469413f, 12.740822f } },
+ { 14.0f, { 13.094319f, 13.495428f, 12.678066f } },
+ { 15.0f, { 13.142133f, 13.545483f, 12.526785f } },
+ { 16.0f, { 13.201734f, 13.606017f, 12.188001f } },
+ { 17.0f, { 13.182774f, 13.572725f, 11.311157f } },
+ { 18.0f, { 12.448635f, 12.672520f, 8.267771f } },
+ { 20.0f, { 0.000000f, 0.000000f, 0.000000f } },
+};
+
+
+// Precomputed luminance of sky in the zenith point in XYZ colorspace.
+// Computed using code from Game Engine Gems, Volume One, chapter 15. Implementation based on Dr. Richard Bird model.
+// This table is used for piecewise linear interpolation. Day/night transitions are highly inaccurate.
+// The scale of luminance change in Day/night transitions is not preserved.
+// Luminance at night was increased to eliminate need the of HDR render.
+static std::map<float, Color> skyLuminanceXYZTable =
+{
+ { 0.0f, { 0.308f, 0.308f, 0.411f } },
+ { 1.0f, { 0.308f, 0.308f, 0.410f } },
+ { 2.0f, { 0.301f, 0.301f, 0.402f } },
+ { 3.0f, { 0.287f, 0.287f, 0.382f } },
+ { 4.0f, { 0.258f, 0.258f, 0.344f } },
+ { 5.0f, { 0.258f, 0.258f, 0.344f } },
+ { 7.0f, { 0.962851f, 1.000000f, 1.747835f } },
+ { 8.0f, { 0.967787f, 1.000000f, 1.776762f } },
+ { 9.0f, { 0.970173f, 1.000000f, 1.788413f } },
+ { 10.0f, { 0.971431f, 1.000000f, 1.794102f } },
+ { 11.0f, { 0.972099f, 1.000000f, 1.797096f } },
+ { 12.0f, { 0.972385f, 1.000000f, 1.798389f } },
+ { 13.0f, { 0.972361f, 1.000000f, 1.798278f } },
+ { 14.0f, { 0.972020f, 1.000000f, 1.796740f } },
+ { 15.0f, { 0.971275f, 1.000000f, 1.793407f } },
+ { 16.0f, { 0.969885f, 1.000000f, 1.787078f } },
+ { 17.0f, { 0.967216f, 1.000000f, 1.773758f } },
+ { 18.0f, { 0.961668f, 1.000000f, 1.739891f } },
+ { 20.0f, { 0.264f, 0.264f, 0.352f } },
+ { 21.0f, { 0.264f, 0.264f, 0.352f } },
+ { 22.0f, { 0.290f, 0.290f, 0.386f } },
+ { 23.0f, { 0.303f, 0.303f, 0.404f } },
+};
+
+
+// Turbidity tables. Taken from:
+// A. J. Preetham, P. Shirley, and B. Smits. A Practical Analytic Model for Daylight. SIGGRAPH '99
+// Coefficients correspond to xyY colorspace.
+static constexpr Color ABCDE[] =
+{
+ { -0.2592f, -0.2608f, -1.4630f },
+ { 0.0008f, 0.0092f, 0.4275f },
+ { 0.2125f, 0.2102f, 5.3251f },
+ { -0.8989f, -1.6537f, -2.5771f },
+ { 0.0452f, 0.0529f, 0.3703f },
+};
+
+static constexpr Color ABCDE_t[] =
+{
+ { -0.0193f, -0.0167f, 0.1787f },
+ { -0.0665f, -0.0950f, -0.3554f },
+ { -0.0004f, -0.0079f, -0.0227f },
+ { -0.0641f, -0.0441f, 0.1206f },
+ { -0.0033f, -0.0109f, -0.0670f },
+};
- // Precomputed luminance of sunlight in XYZ colorspace.
- // Computed using code from Game Engine Gems, Volume One, chapter 15. Implementation based on Dr. Richard Bird model.
- // This table is used for piecewise linear interpolation. Transitions from and to 0.0 at sunset and sunrise are highly inaccurate
- static std::map<float, Color> sunLuminanceXYZTable =
- {
- { 5.0f, { 0.000000f, 0.000000f, 0.000000f } },
- { 7.0f, { 12.703322f, 12.989393f, 9.100411f } },
- { 8.0f, { 13.202644f, 13.597814f, 11.524929f } },
- { 9.0f, { 13.192974f, 13.597458f, 12.264488f } },
- { 10.0f, { 13.132943f, 13.535914f, 12.560032f } },
- { 11.0f, { 13.088722f, 13.489535f, 12.692996f } },
- { 12.0f, { 13.067827f, 13.467483f, 12.745179f } },
- { 13.0f, { 13.069653f, 13.469413f, 12.740822f } },
- { 14.0f, { 13.094319f, 13.495428f, 12.678066f } },
- { 15.0f, { 13.142133f, 13.545483f, 12.526785f } },
- { 16.0f, { 13.201734f, 13.606017f, 12.188001f } },
- { 17.0f, { 13.182774f, 13.572725f, 11.311157f } },
- { 18.0f, { 12.448635f, 12.672520f, 8.267771f } },
- { 20.0f, { 0.000000f, 0.000000f, 0.000000f } },
- };
+// Performs piecewise linear interpolation of a Color parameter.
+class DynamicValueController
+{
+ typedef Color ValueType;
+ typedef std::map<float, ValueType> KeyMap;
- // Precomputed luminance of sky in the zenith point in XYZ colorspace.
- // Computed using code from Game Engine Gems, Volume One, chapter 15. Implementation based on Dr. Richard Bird model.
- // This table is used for piecewise linear interpolation. Day/night transitions are highly inaccurate.
- // The scale of luminance change in Day/night transitions is not preserved.
- // Luminance at night was increased to eliminate need the of HDR render.
- static std::map<float, Color> skyLuminanceXYZTable =
+public:
+ DynamicValueController()
{
- { 0.0f, { 0.308f, 0.308f, 0.411f } },
- { 1.0f, { 0.308f, 0.308f, 0.410f } },
- { 2.0f, { 0.301f, 0.301f, 0.402f } },
- { 3.0f, { 0.287f, 0.287f, 0.382f } },
- { 4.0f, { 0.258f, 0.258f, 0.344f } },
- { 5.0f, { 0.258f, 0.258f, 0.344f } },
- { 7.0f, { 0.962851f, 1.000000f, 1.747835f } },
- { 8.0f, { 0.967787f, 1.000000f, 1.776762f } },
- { 9.0f, { 0.970173f, 1.000000f, 1.788413f } },
- { 10.0f, { 0.971431f, 1.000000f, 1.794102f } },
- { 11.0f, { 0.972099f, 1.000000f, 1.797096f } },
- { 12.0f, { 0.972385f, 1.000000f, 1.798389f } },
- { 13.0f, { 0.972361f, 1.000000f, 1.798278f } },
- { 14.0f, { 0.972020f, 1.000000f, 1.796740f } },
- { 15.0f, { 0.971275f, 1.000000f, 1.793407f } },
- { 16.0f, { 0.969885f, 1.000000f, 1.787078f } },
- { 17.0f, { 0.967216f, 1.000000f, 1.773758f } },
- { 18.0f, { 0.961668f, 1.000000f, 1.739891f } },
- { 20.0f, { 0.264f, 0.264f, 0.352f } },
- { 21.0f, { 0.264f, 0.264f, 0.352f } },
- { 22.0f, { 0.290f, 0.290f, 0.386f } },
- { 23.0f, { 0.303f, 0.303f, 0.404f } },
- };
-
+ }
- // Turbidity tables. Taken from:
- // A. J. Preetham, P. Shirley, and B. Smits. A Practical Analytic Model for Daylight. SIGGRAPH '99
- // Coefficients correspond to xyY colorspace.
- static constexpr Color ABCDE[] =
+ ~DynamicValueController()
{
- { -0.2592f, -0.2608f, -1.4630f },
- { 0.0008f, 0.0092f, 0.4275f },
- { 0.2125f, 0.2102f, 5.3251f },
- { -0.8989f, -1.6537f, -2.5771f },
- { 0.0452f, 0.0529f, 0.3703f },
- };
+ }
- static constexpr Color ABCDE_t[] =
+ void SetMap(const KeyMap& keymap)
{
- { -0.0193f, -0.0167f, 0.1787f },
- { -0.0665f, -0.0950f, -0.3554f },
- { -0.0004f, -0.0079f, -0.0227f },
- { -0.0641f, -0.0441f, 0.1206f },
- { -0.0033f, -0.0109f, -0.0670f },
- };
+ m_keyMap = keymap;
+ }
-
- // Performs piecewise linear interpolation of a Color parameter.
- class DynamicValueController
+ ValueType GetValue(float time) const
{
- typedef Color ValueType;
- typedef std::map<float, ValueType> KeyMap;
+ typename KeyMap::const_iterator itUpper = m_keyMap.upper_bound(time + 1e-6f);
+ typename KeyMap::const_iterator itLower = itUpper;
+ --itLower;
- public:
- DynamicValueController()
+ if (itLower == m_keyMap.end())
{
+ return itUpper->second;
}
- ~DynamicValueController()
+ if (itUpper == m_keyMap.end())
{
+ return itLower->second;
}
- void SetMap(const KeyMap& keymap)
- {
- m_keyMap = keymap;
- }
+ float lowerTime = itLower->first;
+ const ValueType& lowerVal = itLower->second;
+ float upperTime = itUpper->first;
+ const ValueType& upperVal = itUpper->second;
- ValueType GetValue(float time) const
+ if (lowerTime == upperTime)
{
- typename KeyMap::const_iterator itUpper = m_keyMap.upper_bound(time + 1e-6f);
- typename KeyMap::const_iterator itLower = itUpper;
- --itLower;
-
- if (itLower == m_keyMap.end())
- {
- return itUpper->second;
- }
-
- if (itUpper == m_keyMap.end())
- {
- return itLower->second;
- }
-
- float lowerTime = itLower->first;
- const ValueType& lowerVal = itLower->second;
- float upperTime = itUpper->first;
- const ValueType& upperVal = itUpper->second;
+ return lowerVal;
+ }
- if (lowerTime == upperTime)
- {
- return lowerVal;
- }
+ return interpolate(lowerTime, lowerVal, upperTime, upperVal, time);
+ };
- return interpolate(lowerTime, lowerVal, upperTime, upperVal, time);
- };
+ void Clear()
+ {
+ m_keyMap.clear();
+ };
- void Clear()
- {
- m_keyMap.clear();
- };
+private:
+ ValueType interpolate(float lowerTime, const ValueType& lowerVal, float upperTime, const ValueType& upperVal, float time) const
+ {
+ const float tt = (time - lowerTime) / (upperTime - lowerTime);
+ const ValueType result = bx::lerp(lowerVal, upperVal, tt);
+ return result;
+ };
- private:
- ValueType interpolate(float lowerTime, const ValueType& lowerVal, float upperTime, const ValueType& upperVal, float time) const
- {
- const float tt = (time - lowerTime) / (upperTime - lowerTime);
- const ValueType result = bx::lerp(lowerVal, upperVal, tt);
- return result;
- };
+ KeyMap m_keyMap;
+};
- KeyMap m_keyMap;
+// Controls sun position according to time, month, and observer's latitude.
+// Sun position computation based on Earth's orbital elements: https://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html
+class SunController
+{
+public:
+ enum Month : int
+ {
+ January = 0,
+ February,
+ March,
+ April,
+ May,
+ June,
+ July,
+ August,
+ September,
+ October,
+ November,
+ December
};
- // Controls sun position according to time, month, and observer's latitude.
- // Sun position computation based on Earth's orbital elements: https://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html
- class SunController
+ SunController()
+ : m_northDir(1.0f, 0.0f, 0.0f)
+ , m_sunDir(0.0f, -1.0f, 0.0f)
+ , m_upDir(0.0f, 1.0f, 0.0f)
+ , m_latitude(50.0f)
+ , m_month(June)
+ , m_eclipticObliquity(bx::toRad(23.4f) )
+ , m_delta(0.0f)
{
- public:
- enum Month : int
- {
- January = 0,
- February,
- March,
- April,
- May,
- June,
- July,
- August,
- September,
- October,
- November,
- December
- };
+ }
- SunController()
- : m_northDir(1.0f, 0.0f, 0.0f)
- , m_sunDir(0.0f, -1.0f, 0.0f)
- , m_upDir(0.0f, 1.0f, 0.0f)
- , m_latitude(50.0f)
- , m_month(June)
- , m_eclipticObliquity(bx::toRad(23.4f) )
- , m_delta(0.0f)
- {
- }
+ void Update(float _time)
+ {
+ CalculateSunOrbit();
+ UpdateSunPosition(_time - 12.0f);
+ }
+
+ bx::Vec3 m_northDir;
+ bx::Vec3 m_sunDir;
+ bx::Vec3 m_upDir;
+ float m_latitude;
+ Month m_month;
+
+private:
+ void CalculateSunOrbit()
+ {
+ const float day = 30.0f * float(m_month) + 15.0f;
+ float lambda = 280.46f + 0.9856474f * day;
+ lambda = bx::toRad(lambda);
+ m_delta = bx::asin(bx::sin(m_eclipticObliquity) * bx::sin(lambda) );
+ }
- void Update(float _time)
- {
- CalculateSunOrbit();
- UpdateSunPosition(_time - 12.0f);
- }
+ void UpdateSunPosition(float _hour)
+ {
+ const float latitude = bx::toRad(m_latitude);
+ const float hh = _hour * bx::kPi / 12.0f;
+ const float azimuth = bx::atan2(
+ bx::sin(hh)
+ , bx::cos(hh) * bx::sin(latitude) - bx::tan(m_delta) * bx::cos(latitude)
+ );
+
+ const float altitude = bx::asin(
+ bx::sin(latitude) * bx::sin(m_delta) + bx::cos(latitude) * bx::cos(m_delta) * bx::cos(hh)
+ );
+
+ const bx::Quaternion rot0 = bx::fromAxisAngle(m_upDir, -azimuth);
+ const bx::Vec3 dir = bx::mul(m_northDir, rot0);
+ const bx::Vec3 uxd = bx::cross(m_upDir, dir);
+
+ const bx::Quaternion rot1 = bx::fromAxisAngle(uxd, altitude);
+ m_sunDir = bx::mul(dir, rot1);
+ }
+
+ float m_eclipticObliquity;
+ float m_delta;
+};
+
+struct ScreenPosVertex
+{
+ float m_x;
+ float m_y;
- bx::Vec3 m_northDir;
- bx::Vec3 m_sunDir;
- bx::Vec3 m_upDir;
- float m_latitude;
- Month m_month;
+ static void init()
+ {
+ ms_layout
+ .begin()
+ .add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float)
+ .end();
+ }
- private:
- void CalculateSunOrbit()
- {
- float day = 30.0f * m_month + 15.0f;
- float lambda = 280.46f + 0.9856474f * day;
- lambda = bx::toRad(lambda);
- m_delta = bx::asin(bx::sin(m_eclipticObliquity) * bx::sin(lambda) );
- }
+ static bgfx::VertexLayout ms_layout;
+};
- void UpdateSunPosition(float _hour)
- {
- const float latitude = bx::toRad(m_latitude);
- const float hh = _hour * bx::kPi / 12.0f;
- const float azimuth = bx::atan2(
- bx::sin(hh)
- , bx::cos(hh) * bx::sin(latitude) - bx::tan(m_delta) * bx::cos(latitude)
- );
+bgfx::VertexLayout ScreenPosVertex::ms_layout;
- const float altitude = bx::asin(
- bx::sin(latitude) * bx::sin(m_delta) + bx::cos(latitude) * bx::cos(m_delta) * bx::cos(hh)
- );
+// Renders a screen-space grid of triangles.
+// Because of performance reasons, and because sky color is smooth, sky color is computed in vertex shader.
+// 32x32 is a reasonable size for the grid to have smooth enough colors.
+struct ProceduralSky
+{
+ void init(int verticalCount, int horizontalCount)
+ {
+ // Create vertex stream declaration.
+ ScreenPosVertex::init();
- const bx::Quaternion rot0 = bx::rotateAxis(m_upDir, -azimuth);
- const bx::Vec3 dir = bx::mul(m_northDir, rot0);
- const bx::Vec3 uxd = bx::cross(m_upDir, dir);
+ m_skyProgram = loadProgram("vs_sky", "fs_sky");
+ m_skyProgram_colorBandingFix = loadProgram("vs_sky", "fs_sky_color_banding_fix");
- const bx::Quaternion rot1 = bx::rotateAxis(uxd, altitude);
- m_sunDir = bx::mul(dir, rot1);
- }
+ m_preventBanding = true;
- float m_eclipticObliquity;
- float m_delta;
- };
+ bx::AllocatorI* allocator = entry::getAllocator();
- struct ScreenPosVertex
- {
- float m_x;
- float m_y;
+ ScreenPosVertex* vertices = (ScreenPosVertex*)BX_ALLOC(allocator
+ , verticalCount * horizontalCount * sizeof(ScreenPosVertex)
+ );
- static void init()
+ for (int i = 0; i < verticalCount; i++)
{
- ms_layout
- .begin()
- .add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float)
- .end();
+ for (int j = 0; j < horizontalCount; j++)
+ {
+ ScreenPosVertex& v = vertices[i * verticalCount + j];
+ v.m_x = float(j) / (horizontalCount - 1) * 2.0f - 1.0f;
+ v.m_y = float(i) / (verticalCount - 1) * 2.0f - 1.0f;
+ }
}
- static bgfx::VertexLayout ms_layout;
- };
-
- bgfx::VertexLayout ScreenPosVertex::ms_layout;
+ uint16_t* indices = (uint16_t*)BX_ALLOC(allocator
+ , (verticalCount - 1) * (horizontalCount - 1) * 6 * sizeof(uint16_t)
+ );
- // Renders a screen-space grid of triangles.
- // Because of performance reasons, and because sky color is smooth, sky color is computed in vertex shader.
- // 32x32 is a reasonable size for the grid to have smooth enough colors.
- struct ProceduralSky
- {
- void init(int verticalCount, int horizontalCount)
+ int k = 0;
+ for (int i = 0; i < verticalCount - 1; i++)
{
- // Create vertex stream declaration.
- ScreenPosVertex::init();
-
- m_skyProgram = loadProgram("vs_sky", "fs_sky");
- m_skyProgram_colorBandingFix = loadProgram("vs_sky", "fs_sky_color_banding_fix");
+ for (int j = 0; j < horizontalCount - 1; j++)
+ {
+ indices[k++] = (uint16_t)(j + 0 + horizontalCount * (i + 0));
+ indices[k++] = (uint16_t)(j + 1 + horizontalCount * (i + 0));
+ indices[k++] = (uint16_t)(j + 0 + horizontalCount * (i + 1));
- m_preventBanding = true;
+ indices[k++] = (uint16_t)(j + 1 + horizontalCount * (i + 0));
+ indices[k++] = (uint16_t)(j + 1 + horizontalCount * (i + 1));
+ indices[k++] = (uint16_t)(j + 0 + horizontalCount * (i + 1));
+ }
+ }
- bx::AllocatorI* allocator = entry::getAllocator();
+ 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));
- ScreenPosVertex* vertices = (ScreenPosVertex*)BX_ALLOC(allocator
- , verticalCount * horizontalCount * sizeof(ScreenPosVertex)
- );
+ BX_FREE(allocator, indices);
+ BX_FREE(allocator, vertices);
+ }
- for (int i = 0; i < verticalCount; i++)
- {
- for (int j = 0; j < horizontalCount; j++)
- {
- ScreenPosVertex& v = vertices[i * verticalCount + j];
- v.m_x = float(j) / (horizontalCount - 1) * 2.0f - 1.0f;
- v.m_y = float(i) / (verticalCount - 1) * 2.0f - 1.0f;
- }
- }
-
- uint16_t* indices = (uint16_t*)BX_ALLOC(allocator
- , (verticalCount - 1) * (horizontalCount - 1) * 6 * sizeof(uint16_t)
- );
+ void shutdown()
+ {
+ bgfx::destroy(m_ibh);
+ bgfx::destroy(m_vbh);
+ bgfx::destroy(m_skyProgram);
+ bgfx::destroy(m_skyProgram_colorBandingFix);
+ }
- int k = 0;
- for (int i = 0; i < verticalCount - 1; i++)
- {
- for (int j = 0; j < horizontalCount - 1; j++)
- {
- indices[k++] = (uint16_t)(j + 0 + horizontalCount * (i + 0));
- indices[k++] = (uint16_t)(j + 1 + horizontalCount * (i + 0));
- indices[k++] = (uint16_t)(j + 0 + horizontalCount * (i + 1));
-
- indices[k++] = (uint16_t)(j + 1 + horizontalCount * (i + 0));
- indices[k++] = (uint16_t)(j + 1 + horizontalCount * (i + 1));
- indices[k++] = (uint16_t)(j + 0 + horizontalCount * (i + 1));
- }
- }
+ void draw()
+ {
+ bgfx::setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_DEPTH_TEST_EQUAL);
+ bgfx::setIndexBuffer(m_ibh);
+ bgfx::setVertexBuffer(0, m_vbh);
+ bgfx::submit(0, m_preventBanding ? m_skyProgram_colorBandingFix : m_skyProgram);
+ }
- 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));
+ bgfx::VertexBufferHandle m_vbh;
+ bgfx::IndexBufferHandle m_ibh;
- BX_FREE(allocator, indices);
- BX_FREE(allocator, vertices);
- }
+ bgfx::ProgramHandle m_skyProgram;
+ bgfx::ProgramHandle m_skyProgram_colorBandingFix;
- void shutdown()
- {
- bgfx::destroy(m_ibh);
- bgfx::destroy(m_vbh);
- bgfx::destroy(m_skyProgram);
- bgfx::destroy(m_skyProgram_colorBandingFix);
- }
+ bool m_preventBanding;
+};
- void draw()
- {
- bgfx::setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_DEPTH_TEST_EQUAL);
- bgfx::setIndexBuffer(m_ibh);
- bgfx::setVertexBuffer(0, m_vbh);
- bgfx::submit(0, m_preventBanding ? m_skyProgram_colorBandingFix : m_skyProgram);
- }
+class ExampleProceduralSky : public entry::AppI
+{
+public:
+ ExampleProceduralSky(const char* _name, const char* _description, const char* _url)
+ : entry::AppI(_name, _description, _url)
+ {
+ }
- bgfx::VertexBufferHandle m_vbh;
- bgfx::IndexBufferHandle m_ibh;
+ void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) override
+ {
+ Args args(_argc, _argv);
- bgfx::ProgramHandle m_skyProgram;
- bgfx::ProgramHandle m_skyProgram_colorBandingFix;
+ m_width = _width;
+ m_height = _height;
+ m_debug = BGFX_DEBUG_NONE;
+ m_reset = BGFX_RESET_VSYNC;
- bool m_preventBanding;
- };
+ bgfx::Init init;
+ init.type = args.m_type;
+ init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
+ init.resolution.width = m_width;
+ init.resolution.height = m_height;
+ init.resolution.reset = m_reset;
+ bgfx::init(init);
- class ExampleProceduralSky : public entry::AppI
- {
- public:
- ExampleProceduralSky(const char* _name, const char* _description, const char* _url)
- : entry::AppI(_name, _description, _url)
- {
- }
+ // Enable m_debug text.
+ bgfx::setDebug(m_debug);
- void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) override
- {
- Args args(_argc, _argv);
-
- m_width = _width;
- m_height = _height;
- m_debug = BGFX_DEBUG_NONE;
- m_reset = BGFX_RESET_VSYNC;
-
- bgfx::Init init;
- init.type = args.m_type;
- init.vendorId = args.m_pciId;
- init.resolution.width = m_width;
- init.resolution.height = m_height;
- init.resolution.reset = m_reset;
- bgfx::init(init);
-
- // Enable m_debug text.
- bgfx::setDebug(m_debug);
-
- // Set view 0 clear state.
- bgfx::setViewClear(0
- , BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
- , 0x000000ff
- , 1.0f
- , 0
- );
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
+ , 0x000000ff
+ , 1.0f
+ , 0
+ );
- m_sunLuminanceXYZ.SetMap(sunLuminanceXYZTable);
- m_skyLuminanceXYZ.SetMap(skyLuminanceXYZTable);
+ m_sunLuminanceXYZ.SetMap(sunLuminanceXYZTable);
+ m_skyLuminanceXYZ.SetMap(skyLuminanceXYZTable);
- m_mesh = meshLoad("meshes/test_scene.bin");
+ m_mesh = meshLoad("meshes/test_scene.bin");
- m_lightmapTexture = loadTexture("textures/lightmap.ktx");
+ m_lightmapTexture = loadTexture("textures/lightmap.ktx");
- // Imgui.
- imguiCreate();
+ // Imgui.
+ imguiCreate();
- m_timeOffset = bx::getHPCounter();
- m_time = 0.0f;
- m_timeScale = 1.0f;
+ m_timeOffset = bx::getHPCounter();
+ m_time = 0.0f;
+ m_timeScale = 1.0f;
- s_texLightmap = bgfx::createUniform("s_texLightmap", bgfx::UniformType::Sampler);
- u_sunLuminance = bgfx::createUniform("u_sunLuminance", bgfx::UniformType::Vec4);
- u_skyLuminanceXYZ = bgfx::createUniform("u_skyLuminanceXYZ", bgfx::UniformType::Vec4);
- u_skyLuminance = bgfx::createUniform("u_skyLuminance", bgfx::UniformType::Vec4);
- u_sunDirection = bgfx::createUniform("u_sunDirection", bgfx::UniformType::Vec4);
- u_parameters = bgfx::createUniform("u_parameters", bgfx::UniformType::Vec4);
- u_perezCoeff = bgfx::createUniform("u_perezCoeff", bgfx::UniformType::Vec4, 5);
+ s_texLightmap = bgfx::createUniform("s_texLightmap", bgfx::UniformType::Sampler);
+ u_sunLuminance = bgfx::createUniform("u_sunLuminance", bgfx::UniformType::Vec4);
+ u_skyLuminanceXYZ = bgfx::createUniform("u_skyLuminanceXYZ", bgfx::UniformType::Vec4);
+ u_skyLuminance = bgfx::createUniform("u_skyLuminance", bgfx::UniformType::Vec4);
+ u_sunDirection = bgfx::createUniform("u_sunDirection", bgfx::UniformType::Vec4);
+ u_parameters = bgfx::createUniform("u_parameters", bgfx::UniformType::Vec4);
+ u_perezCoeff = bgfx::createUniform("u_perezCoeff", bgfx::UniformType::Vec4, 5);
- m_landscapeProgram = loadProgram("vs_sky_landscape", "fs_sky_landscape");
+ m_landscapeProgram = loadProgram("vs_sky_landscape", "fs_sky_landscape");
- m_sky.init(32, 32);
+ m_sky.init(32, 32);
- m_sun.Update(0);
+ m_sun.Update(0);
- cameraCreate();
+ cameraCreate();
- cameraSetPosition({ 5.0f, 3.0, 0.0f });
- cameraSetVerticalAngle(bx::kPi / 8.0f);
- cameraSetHorizontalAngle(-bx::kPi / 3.0f);
+ cameraSetPosition({ 5.0f, 3.0, 0.0f });
+ cameraSetVerticalAngle(bx::kPi / 8.0f);
+ cameraSetHorizontalAngle(-bx::kPi / 3.0f);
- m_turbidity = 2.15f;
- }
+ m_turbidity = 2.15f;
+ }
- virtual int shutdown() override
- {
- // Cleanup.
- cameraDestroy();
- imguiDestroy();
+ virtual int shutdown() override
+ {
+ // Cleanup.
+ cameraDestroy();
+ imguiDestroy();
- meshUnload(m_mesh);
+ meshUnload(m_mesh);
- m_sky.shutdown();
+ m_sky.shutdown();
- bgfx::destroy(s_texLightmap);
- bgfx::destroy(u_sunLuminance);
- bgfx::destroy(u_skyLuminanceXYZ);
- bgfx::destroy(u_skyLuminance);
- bgfx::destroy(u_sunDirection);
- bgfx::destroy(u_parameters);
- bgfx::destroy(u_perezCoeff);
+ bgfx::destroy(s_texLightmap);
+ bgfx::destroy(u_sunLuminance);
+ bgfx::destroy(u_skyLuminanceXYZ);
+ bgfx::destroy(u_skyLuminance);
+ bgfx::destroy(u_sunDirection);
+ bgfx::destroy(u_parameters);
+ bgfx::destroy(u_perezCoeff);
- bgfx::destroy(m_lightmapTexture);
- bgfx::destroy(m_landscapeProgram);
+ bgfx::destroy(m_lightmapTexture);
+ bgfx::destroy(m_landscapeProgram);
- bgfx::frame();
+ bgfx::frame();
- // Shutdown bgfx.
- bgfx::shutdown();
+ // Shutdown bgfx.
+ bgfx::shutdown();
- return 0;
- }
+ return 0;
+ }
- void imgui(float _width)
+ void imgui(float _width)
+ {
+ ImGui::Begin("ProceduralSky");
+ ImGui::SetWindowSize(ImVec2(_width, 200.0f) );
+ ImGui::SliderFloat("Time scale", &m_timeScale, 0.0f, 1.0f);
+ ImGui::SliderFloat("Time", &m_time, 0.0f, 24.0f);
+ ImGui::SliderFloat("Latitude", &m_sun.m_latitude, -90.0f, 90.0f);
+ ImGui::SliderFloat("Turbidity", &m_turbidity, 1.9f, 10.0f);
+ ImGui::Checkbox("Prevent color banding", &m_sky.m_preventBanding);
+
+ const char* items[] =
{
- ImGui::Begin("ProceduralSky");
- ImGui::SetWindowSize(ImVec2(_width, 200.0f) );
- ImGui::SliderFloat("Time scale", &m_timeScale, 0.0f, 1.0f);
- ImGui::SliderFloat("Time", &m_time, 0.0f, 24.0f);
- ImGui::SliderFloat("Latitude", &m_sun.m_latitude, -90.0f, 90.0f);
- ImGui::SliderFloat("Turbidity", &m_turbidity, 1.9f, 10.0f);
- ImGui::Checkbox("Prevent color banding", &m_sky.m_preventBanding);
-
- const char* items[] =
- {
- "January",
- "February",
- "March",
- "April",
- "May",
- "June",
- "July",
- "August",
- "September",
- "October",
- "November",
- "December"
- };
-
- ImGui::Combo("Month", (int*)&m_sun.m_month, items, 12);
-
- ImGui::End();
- }
+ "January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December"
+ };
- bool update() override
- {
- if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState))
- {
- int64_t now = bx::getHPCounter();
- static int64_t last = now;
- const int64_t frameTime = now - last;
- last = now;
- const double freq = double(bx::getHPFrequency());
- const float deltaTime = float(frameTime / freq);
- m_time += m_timeScale * deltaTime;
- m_time = bx::mod(m_time, 24.0f);
- m_sun.Update(m_time);
+ ImGui::Combo("Month", (int*)&m_sun.m_month, items, 12);
- imguiBeginFrame(m_mouseState.m_mx
- , m_mouseState.m_my
- , (m_mouseState.m_buttons[entry::MouseButton::Left] ? IMGUI_MBUT_LEFT : 0)
- | (m_mouseState.m_buttons[entry::MouseButton::Right] ? IMGUI_MBUT_RIGHT : 0)
- | (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
- , m_mouseState.m_mz
- , uint16_t(m_width)
- , uint16_t(m_height)
- );
+ ImGui::End();
+ }
- showExampleDialog(this);
+ bool update() override
+ {
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState))
+ {
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency());
+ const float deltaTime = float(frameTime / freq);
+ m_time += m_timeScale * deltaTime;
+ m_time = bx::mod(m_time, 24.0f);
+ m_sun.Update(m_time);
+
+ imguiBeginFrame(m_mouseState.m_mx
+ , m_mouseState.m_my
+ , (m_mouseState.m_buttons[entry::MouseButton::Left] ? IMGUI_MBUT_LEFT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Right] ? IMGUI_MBUT_RIGHT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , m_mouseState.m_mz
+ , uint16_t(m_width)
+ , uint16_t(m_height)
+ );
- ImGui::SetNextWindowPos(
- ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
- , ImGuiCond_FirstUseEver
- );
+ showExampleDialog(this);
- imgui(m_width / 5.0f - 10.0f);
+ ImGui::SetNextWindowPos(
+ ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
+ , ImGuiCond_FirstUseEver
+ );
- imguiEndFrame();
+ imgui(m_width / 5.0f - 10.0f);
- // Update camera.
- cameraUpdate(deltaTime, m_mouseState, ImGui::MouseOverArea() );
+ imguiEndFrame();
- // Set view 0 default viewport.
- bgfx::setViewRect(0, 0, 0, uint16_t(m_width), uint16_t(m_height));
+ // Update camera.
+ cameraUpdate(deltaTime, m_mouseState, ImGui::MouseOverArea() );
- float view[16];
- cameraGetViewMtx(view);
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, uint16_t(m_width), uint16_t(m_height));
- float proj[16];
- bx::mtxProj(proj, 60.0f, float(m_width) / float(m_height), 0.1f, 2000.0f, bgfx::getCaps()->homogeneousDepth);
+ float view[16];
+ cameraGetViewMtx(view);
- bgfx::setViewTransform(0, view, proj);
+ float proj[16];
+ bx::mtxProj(proj, 60.0f, float(m_width) / float(m_height), 0.1f, 2000.0f, bgfx::getCaps()->homogeneousDepth);
- Color sunLuminanceXYZ = m_sunLuminanceXYZ.GetValue(m_time);
- Color sunLuminanceRGB = xyzToRgb(sunLuminanceXYZ);
+ bgfx::setViewTransform(0, view, proj);
- Color skyLuminanceXYZ = m_skyLuminanceXYZ.GetValue(m_time);
- Color skyLuminanceRGB = xyzToRgb(skyLuminanceXYZ);
+ Color sunLuminanceXYZ = m_sunLuminanceXYZ.GetValue(m_time);
+ Color sunLuminanceRGB = xyzToRgb(sunLuminanceXYZ);
- bgfx::setUniform(u_sunLuminance, &sunLuminanceRGB.x);
- bgfx::setUniform(u_skyLuminanceXYZ, &skyLuminanceXYZ.x);
- bgfx::setUniform(u_skyLuminance, &skyLuminanceRGB.x);
+ Color skyLuminanceXYZ = m_skyLuminanceXYZ.GetValue(m_time);
+ Color skyLuminanceRGB = xyzToRgb(skyLuminanceXYZ);
- bgfx::setUniform(u_sunDirection, &m_sun.m_sunDir.x);
+ bgfx::setUniform(u_sunLuminance, &sunLuminanceRGB.x);
+ bgfx::setUniform(u_skyLuminanceXYZ, &skyLuminanceXYZ.x);
+ bgfx::setUniform(u_skyLuminance, &skyLuminanceRGB.x);
- float exposition[4] = { 0.02f, 3.0f, 0.1f, m_time };
- bgfx::setUniform(u_parameters, exposition);
+ bgfx::setUniform(u_sunDirection, &m_sun.m_sunDir.x);
- float perezCoeff[4 * 5];
- computePerezCoeff(m_turbidity, perezCoeff);
- bgfx::setUniform(u_perezCoeff, perezCoeff, 5);
+ float exposition[4] = { 0.02f, 3.0f, 0.1f, m_time };
+ bgfx::setUniform(u_parameters, exposition);
- bgfx::setTexture(0, s_texLightmap, m_lightmapTexture);
- meshSubmit(m_mesh, 0, m_landscapeProgram, NULL);
+ float perezCoeff[4 * 5];
+ computePerezCoeff(m_turbidity, perezCoeff);
+ bgfx::setUniform(u_perezCoeff, perezCoeff, 5);
- m_sky.draw();
+ bgfx::setTexture(0, s_texLightmap, m_lightmapTexture);
+ meshSubmit(m_mesh, 0, m_landscapeProgram, NULL);
- bgfx::frame();
+ m_sky.draw();
- return true;
- }
+ bgfx::frame();
- return false;
+ return true;
}
- void computePerezCoeff(float _turbidity, float* _outPerezCoeff)
+ return false;
+ }
+
+ void computePerezCoeff(float _turbidity, float* _outPerezCoeff)
+ {
+ const bx::Vec3 turbidity = { _turbidity, _turbidity, _turbidity };
+ for (uint32_t ii = 0; ii < 5; ++ii)
{
- const bx::Vec3 turbidity = { _turbidity, _turbidity, _turbidity };
- for (uint32_t ii = 0; ii < 5; ++ii)
- {
- const bx::Vec3 tmp = bx::mad(ABCDE_t[ii], turbidity, ABCDE[ii]);
- float* out = _outPerezCoeff + 4 * ii;
- bx::store(out, tmp);
- out[3] = 0.0f;
- }
+ const bx::Vec3 tmp = bx::mad(ABCDE_t[ii], turbidity, ABCDE[ii]);
+ float* out = _outPerezCoeff + 4 * ii;
+ bx::store(out, tmp);
+ out[3] = 0.0f;
}
+ }
- bgfx::ProgramHandle m_landscapeProgram;
- bgfx::UniformHandle s_texLightmap;
- bgfx::TextureHandle m_lightmapTexture;
+ bgfx::ProgramHandle m_landscapeProgram;
+ bgfx::UniformHandle s_texLightmap;
+ bgfx::TextureHandle m_lightmapTexture;
- bgfx::UniformHandle u_sunLuminance;
- bgfx::UniformHandle u_skyLuminanceXYZ;
- bgfx::UniformHandle u_skyLuminance;
- bgfx::UniformHandle u_sunDirection;
- bgfx::UniformHandle u_parameters;
- bgfx::UniformHandle u_perezCoeff;
+ bgfx::UniformHandle u_sunLuminance;
+ bgfx::UniformHandle u_skyLuminanceXYZ;
+ bgfx::UniformHandle u_skyLuminance;
+ bgfx::UniformHandle u_sunDirection;
+ bgfx::UniformHandle u_parameters;
+ bgfx::UniformHandle u_perezCoeff;
- ProceduralSky m_sky;
- SunController m_sun;
+ ProceduralSky m_sky;
+ SunController m_sun;
- DynamicValueController m_sunLuminanceXYZ;
- DynamicValueController m_skyLuminanceXYZ;
+ DynamicValueController m_sunLuminanceXYZ;
+ DynamicValueController m_skyLuminanceXYZ;
- uint32_t m_width;
- uint32_t m_height;
- uint32_t m_debug;
- uint32_t m_reset;
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
- Mesh* m_mesh;
+ Mesh* m_mesh;
- entry::MouseState m_mouseState;
+ entry::MouseState m_mouseState;
- float m_time;
- float m_timeScale;
- int64_t m_timeOffset;
+ float m_time;
+ float m_timeScale;
+ int64_t m_timeOffset;
- float m_turbidity;
- };
+ float m_turbidity;
+};
} // namespace
diff --git a/3rdparty/bgfx/examples/36-sky/vs_sky.sc b/3rdparty/bgfx/examples/36-sky/vs_sky.sc
index 10751bd1f5e..919b92dbfbb 100644
--- a/3rdparty/bgfx/examples/36-sky/vs_sky.sc
+++ b/3rdparty/bgfx/examples/36-sky/vs_sky.sc
@@ -3,7 +3,7 @@ $output v_skyColor, v_screenPos, v_viewDir
/*
* Copyright 2017 Stanislav Pidhorskyi. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
diff --git a/3rdparty/bgfx/examples/36-sky/vs_sky_landscape.sc b/3rdparty/bgfx/examples/36-sky/vs_sky_landscape.sc
index a42072db861..8a22e90e060 100644
--- a/3rdparty/bgfx/examples/36-sky/vs_sky_landscape.sc
+++ b/3rdparty/bgfx/examples/36-sky/vs_sky_landscape.sc
@@ -2,8 +2,8 @@ $input a_position, a_normal, a_texcoord0
$output v_normal, v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_copy_z.sc b/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_copy_z.sc
index b6365bdc614..c5732156b49 100644
--- a/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_copy_z.sc
+++ b/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_copy_z.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Kostas Anagnostou. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_downscale_hi_z.sc b/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_downscale_hi_z.sc
index 9b03498f96b..cb3941638d5 100644
--- a/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_downscale_hi_z.sc
+++ b/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_downscale_hi_z.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Kostas Anagnostou. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc b/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc
index 2648eb4d075..fd4ae946ffd 100644
--- a/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc
+++ b/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_occlude_props.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Kostas Anagnostou. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_stream_compaction.sc b/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_stream_compaction.sc
index b96bb5f9bf5..058d1eafb92 100644
--- a/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_stream_compaction.sc
+++ b/3rdparty/bgfx/examples/37-gpudrivenrendering/cs_gdr_stream_compaction.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Kostas Anagnostou. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/37-gpudrivenrendering/fs_gdr_instanced_indirect_rendering.sc b/3rdparty/bgfx/examples/37-gpudrivenrendering/fs_gdr_instanced_indirect_rendering.sc
index 14f48499180..a6e410406dc 100644
--- a/3rdparty/bgfx/examples/37-gpudrivenrendering/fs_gdr_instanced_indirect_rendering.sc
+++ b/3rdparty/bgfx/examples/37-gpudrivenrendering/fs_gdr_instanced_indirect_rendering.sc
@@ -2,7 +2,7 @@ $input v_materialID
/*
* Copyright 2018 Kostas Anagnostou. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/37-gpudrivenrendering/gpudrivenrendering.cpp b/3rdparty/bgfx/examples/37-gpudrivenrendering/gpudrivenrendering.cpp
index 9efbac4fa08..312ef4898b2 100644
--- a/3rdparty/bgfx/examples/37-gpudrivenrendering/gpudrivenrendering.cpp
+++ b/3rdparty/bgfx/examples/37-gpudrivenrendering/gpudrivenrendering.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Kostas Anagnostou. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -61,7 +61,7 @@ struct Camera
const bx::Vec3 toTarget = bx::sub(m_target.dest, m_pos.dest);
const float toTargetLen = bx::length(toTarget);
- const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatMin);
+ const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatSmallest);
const bx::Vec3 toTargetNorm = bx::mul(toTarget, invToTargetLen);
float delta = toTargetLen * _dz;
@@ -83,7 +83,7 @@ struct Camera
const bx::Vec3 toPos = bx::sub(m_pos.curr, m_target.curr);
const float toPosLen = bx::length(toPos);
- const float invToPosLen = 1.0f / (toPosLen + bx::kFloatMin);
+ const float invToPosLen = 1.0f / (toPosLen + bx::kFloatSmallest);
const bx::Vec3 toPosNorm = bx::mul(toPos, invToPosLen);
float ll[2];
@@ -113,7 +113,7 @@ struct Camera
{
const bx::Vec3 toTarget = bx::sub(m_target.curr, m_pos.curr);
const float toTargetLen = bx::length(toTarget);
- const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatMin);
+ const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatSmallest);
const bx::Vec3 toTargetNorm = bx::mul(toTarget, invToTargetLen);
const bx::Vec3 right = bx::normalize(bx::cross({ 0.0f, 1.0f, 0.0f }, toTargetNorm) );
@@ -328,6 +328,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/37-gpudrivenrendering/makefile b/3rdparty/bgfx/examples/37-gpudrivenrendering/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/37-gpudrivenrendering/makefile
+++ b/3rdparty/bgfx/examples/37-gpudrivenrendering/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/37-gpudrivenrendering/vs_gdr_instanced_indirect_rendering.sc b/3rdparty/bgfx/examples/37-gpudrivenrendering/vs_gdr_instanced_indirect_rendering.sc
index da5174d9f69..56e249dc8c0 100644
--- a/3rdparty/bgfx/examples/37-gpudrivenrendering/vs_gdr_instanced_indirect_rendering.sc
+++ b/3rdparty/bgfx/examples/37-gpudrivenrendering/vs_gdr_instanced_indirect_rendering.sc
@@ -3,7 +3,7 @@ $output v_materialID
/*
* Copyright 2018 Kostas Anagnostou. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/37-gpudrivenrendering/vs_gdr_render_occlusion.sc b/3rdparty/bgfx/examples/37-gpudrivenrendering/vs_gdr_render_occlusion.sc
index dcfe4b60635..496994d7a33 100644
--- a/3rdparty/bgfx/examples/37-gpudrivenrendering/vs_gdr_render_occlusion.sc
+++ b/3rdparty/bgfx/examples/37-gpudrivenrendering/vs_gdr_render_occlusion.sc
@@ -2,7 +2,7 @@ $input a_position, i_data0, i_data1, i_data2, i_data3, i_data4
/*
* Copyright 2018 Kostas Anagnostou. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/38-bloom/bloom.cpp b/3rdparty/bgfx/examples/38-bloom/bloom.cpp
index 36a0724d5d7..312eef0e72a 100644
--- a/3rdparty/bgfx/examples/38-bloom/bloom.cpp
+++ b/3rdparty/bgfx/examples/38-bloom/bloom.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Eric Arnebäck. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -13,7 +13,6 @@
#include "bgfx_utils.h"
#include "imgui/imgui.h"
#include "camera.h"
-#include "bounds.h"
namespace
{
@@ -179,10 +178,10 @@ void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf
}
}
-class ExampleDeferred : public entry::AppI
+class ExampleBloom : public entry::AppI
{
public:
- ExampleDeferred(const char* _name, const char* _description, const char* _url)
+ ExampleBloom(const char* _name, const char* _description, const char* _url)
: entry::AppI(_name, _description, _url)
{
}
@@ -197,9 +196,10 @@ public:
m_reset = BGFX_RESET_VSYNC;
bgfx::Init init;
-
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -397,11 +397,9 @@ public:
bgfx::destroy(m_texChainFb[ii]);
}
- const float dim = float(1 << ii);
-
m_texChainFb[ii] = bgfx::createFrameBuffer(
- (uint16_t)(m_width / dim)
- , (uint16_t)(m_height / dim)
+ (uint16_t)(m_width >> ii)
+ , (uint16_t)(m_height >> ii)
, bgfx::TextureFormat::RGBA32F
, tsFlags
);
@@ -447,21 +445,19 @@ public:
for (uint16_t ii = 0; ii < TEX_CHAIN_LEN-1; ++ii)
{
- const float dim = float(1 << (ii + 1) );
-
+ const uint16_t shift = ii + 1;
bgfx::setViewRect(RENDER_PASS_DOWNSAMPLE0_ID + ii, 0, 0
- , uint16_t(m_width / dim)
- , uint16_t(m_height / dim)
+ , uint16_t(m_width >> shift)
+ , uint16_t(m_height >> shift)
);
}
for (uint16_t ii = 0; ii < TEX_CHAIN_LEN-1; ++ii)
{
- const float dim = float(1 << (TEX_CHAIN_LEN - ii - 2) );
-
+ const uint16_t shift = TEX_CHAIN_LEN - ii - 2;
bgfx::setViewRect(RENDER_PASS_UPSAMPLE0_ID + ii, 0, 0
- , uint16_t(m_width / dim)
- , uint16_t(m_height / dim)
+ , uint16_t(m_width >> shift)
+ , uint16_t(m_height >> shift)
);
}
@@ -540,11 +536,11 @@ public:
// Now downsample.
for (uint16_t ii = 0; ii < TEX_CHAIN_LEN-1; ++ii)
{
- const float dim = float(1 << (ii + 1) );
+ const uint16_t shift = ii + 1;
const float pixelSize[4] =
{
- 1.0f / (m_width / dim),
- 1.0f / (m_height / dim),
+ 1.0f / (float)(m_width >> shift),
+ 1.0f / (float)(m_height >> shift),
0.0f,
0.0f,
};
@@ -564,12 +560,11 @@ public:
// Now upsample.
for (uint16_t ii = 0; ii < TEX_CHAIN_LEN - 1; ++ii)
{
- const float dim = float(1 << (TEX_CHAIN_LEN - 2 - ii) );
-
+ const uint16_t shift = TEX_CHAIN_LEN - 2 - ii;
const float pixelSize[4] =
{
- 1.0f / (float)(m_width / dim),
- 1.0f / (float)(m_height / dim),
+ 1.0f / (float)(m_width >> shift),
+ 1.0f / (float)(m_height >> shift),
0.0f,
0.0f,
};
@@ -659,7 +654,7 @@ public:
} // namespace
ENTRY_IMPLEMENT_MAIN(
- ExampleDeferred
+ ExampleBloom
, "38-bloom"
, "Bloom."
, "https://bkaradzic.github.io/bgfx/examples.html#bloom"
diff --git a/3rdparty/bgfx/examples/38-bloom/fs_albedo_output.sc b/3rdparty/bgfx/examples/38-bloom/fs_albedo_output.sc
index b445c1ef06a..2167d6399c5 100644
--- a/3rdparty/bgfx/examples/38-bloom/fs_albedo_output.sc
+++ b/3rdparty/bgfx/examples/38-bloom/fs_albedo_output.sc
@@ -2,7 +2,7 @@ $input v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0
/*
* Copyright 2018 Eric Arnebäck. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/38-bloom/fs_bloom_combine.sc b/3rdparty/bgfx/examples/38-bloom/fs_bloom_combine.sc
index bdf6386e71e..6b9073b8f88 100644
--- a/3rdparty/bgfx/examples/38-bloom/fs_bloom_combine.sc
+++ b/3rdparty/bgfx/examples/38-bloom/fs_bloom_combine.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/38-bloom/fs_downsample.sc b/3rdparty/bgfx/examples/38-bloom/fs_downsample.sc
index f9ec13a2913..0b1f5ba91c3 100644
--- a/3rdparty/bgfx/examples/38-bloom/fs_downsample.sc
+++ b/3rdparty/bgfx/examples/38-bloom/fs_downsample.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2018 Eric Arnebäck. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/38-bloom/fs_upsample.sc b/3rdparty/bgfx/examples/38-bloom/fs_upsample.sc
index 54ac70a6191..725426c01f9 100644
--- a/3rdparty/bgfx/examples/38-bloom/fs_upsample.sc
+++ b/3rdparty/bgfx/examples/38-bloom/fs_upsample.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2018 Eric Arnebäck. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/38-bloom/makefile b/3rdparty/bgfx/examples/38-bloom/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/38-bloom/makefile
+++ b/3rdparty/bgfx/examples/38-bloom/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/38-bloom/vs_albedo_output.sc b/3rdparty/bgfx/examples/38-bloom/vs_albedo_output.sc
index d526a026187..7b40bde966c 100644
--- a/3rdparty/bgfx/examples/38-bloom/vs_albedo_output.sc
+++ b/3rdparty/bgfx/examples/38-bloom/vs_albedo_output.sc
@@ -3,7 +3,7 @@ $output v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0
/*
* Copyright 2018 Eric Arnebäck. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/38-bloom/vs_deferred_combine.sc b/3rdparty/bgfx/examples/38-bloom/vs_deferred_combine.sc
index 946194572b7..545369275d5 100644
--- a/3rdparty/bgfx/examples/38-bloom/vs_deferred_combine.sc
+++ b/3rdparty/bgfx/examples/38-bloom/vs_deferred_combine.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/38-bloom/vs_fullscreen.sc b/3rdparty/bgfx/examples/38-bloom/vs_fullscreen.sc
index 0e6a23be15d..e036fbe9def 100644
--- a/3rdparty/bgfx/examples/38-bloom/vs_fullscreen.sc
+++ b/3rdparty/bgfx/examples/38-bloom/vs_fullscreen.sc
@@ -3,7 +3,7 @@ $output v_texcoord0
/*
* Copyright 2018 Eric Arnebäck. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/assao.cpp b/3rdparty/bgfx/examples/39-assao/assao.cpp
index eaf13043b87..45d1e92b7b4 100644
--- a/3rdparty/bgfx/examples/39-assao/assao.cpp
+++ b/3rdparty/bgfx/examples/39-assao/assao.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -267,12 +267,13 @@ namespace
m_reset = BGFX_RESET_VSYNC;
bgfx::Init init;
- init.type = args.m_type;
-
+ init.type = args.m_type;
init.vendorId = args.m_pciId;
- init.resolution.width = m_width;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
+ init.resolution.width = m_width;
init.resolution.height = m_height;
- init.resolution.reset = m_reset;
+ init.resolution.reset = m_reset;
bgfx::init(init);
// Enable debug text.
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_apply.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_apply.sc
index efa8b4ebf2d..d6148fb3bd7 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_apply.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_apply.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_importance_map.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_importance_map.sc
index 5e681d620c6..7905c8196ef 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_importance_map.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_importance_map.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q.sh b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q.sh
index f8d131afab3..5b4726e69e8 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q.sh
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q0.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q0.sc
index 51794d2f61a..1652499278c 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q0.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q0.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define ASSAO_QUALITY 0
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q1.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q1.sc
index 7f336f12f6c..942a482853b 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q1.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q1.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define ASSAO_QUALITY 1
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q2.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q2.sc
index d2fef48755b..2e62c45d29d 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q2.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q2.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define ASSAO_QUALITY 2
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q3.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q3.sc
index 4e46b2db375..b53352e348c 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q3.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q3.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define ASSAO_QUALITY 3
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q3base.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q3base.sc
index a7164edb0a4..0b5c4f98eaf 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q3base.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_generate_q3base.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#define ASSAO_QUALITY 3
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_load_counter_clear.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_load_counter_clear.sc
index c3323f2235a..ef7c1bfac80 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_load_counter_clear.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_load_counter_clear.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_apply.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_apply.sc
index 0f5da92ce42..af55615dcec 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_apply.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_apply.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_blur.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_blur.sc
index ecedc1571d8..6c41d5d70cc 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_blur.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_blur.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_half_apply.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_half_apply.sc
index c9c2d3e8edc..5026b489651 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_half_apply.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_non_smart_half_apply.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_a.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_a.sc
index 31504094e2a..c11eb99cac9 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_a.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_a.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_b.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_b.sc
index caf7695a376..8696292d1f3 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_b.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_postprocess_importance_map_b.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depth_mip.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depth_mip.sc
index acb642da72d..c033bc799f5 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depth_mip.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depth_mip.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths.sc
index d75fe4c3d0c..0b43c0e11ca 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals.sc
index 5a64f3aa370..836a05439ac 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals_half.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals_half.sc
index 222230d61cf..279de7191bf 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals_half.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_and_normals_half.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_half.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_half.sc
index d6e72f47806..83b913afc0a 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_half.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_prepare_depths_half.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_smart_blur.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_smart_blur.sc
index 15d13ff2c85..5ddf435fb71 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_smart_blur.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_smart_blur.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/cs_assao_smart_blur_wide.sc b/3rdparty/bgfx/examples/39-assao/cs_assao_smart_blur_wide.sc
index 7c030d677f9..e6752700bcc 100644
--- a/3rdparty/bgfx/examples/39-assao/cs_assao_smart_blur_wide.sc
+++ b/3rdparty/bgfx/examples/39-assao/cs_assao_smart_blur_wide.sc
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_compute.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/fs_assao_deferred_combine.sc b/3rdparty/bgfx/examples/39-assao/fs_assao_deferred_combine.sc
index 6ca001eac0b..e12d58ee412 100644
--- a/3rdparty/bgfx/examples/39-assao/fs_assao_deferred_combine.sc
+++ b/3rdparty/bgfx/examples/39-assao/fs_assao_deferred_combine.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/fs_assao_gbuffer.sc b/3rdparty/bgfx/examples/39-assao/fs_assao_gbuffer.sc
index 941b9063a99..13610f75e64 100644
--- a/3rdparty/bgfx/examples/39-assao/fs_assao_gbuffer.sc
+++ b/3rdparty/bgfx/examples/39-assao/fs_assao_gbuffer.sc
@@ -2,7 +2,7 @@ $input v_normal, v_texcoord0
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/makefile b/3rdparty/bgfx/examples/39-assao/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/39-assao/makefile
+++ b/3rdparty/bgfx/examples/39-assao/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/39-assao/vs_assao.sc b/3rdparty/bgfx/examples/39-assao/vs_assao.sc
index 1d82c282ef6..a4eb7999cf0 100644
--- a/3rdparty/bgfx/examples/39-assao/vs_assao.sc
+++ b/3rdparty/bgfx/examples/39-assao/vs_assao.sc
@@ -3,7 +3,7 @@ $output v_texcoord0
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/39-assao/vs_assao_gbuffer.sc b/3rdparty/bgfx/examples/39-assao/vs_assao_gbuffer.sc
index 2335a8101a3..e9662e614f8 100644
--- a/3rdparty/bgfx/examples/39-assao/vs_assao_gbuffer.sc
+++ b/3rdparty/bgfx/examples/39-assao/vs_assao_gbuffer.sc
@@ -3,7 +3,7 @@ $output v_normal, v_texcoord0
/*
* Copyright 2018 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
diff --git a/3rdparty/bgfx/examples/40-svt/fs_vt_mip.sc b/3rdparty/bgfx/examples/40-svt/fs_vt_mip.sc
index 1dcf7abd3ef..31f0b2b6fd2 100644
--- a/3rdparty/bgfx/examples/40-svt/fs_vt_mip.sc
+++ b/3rdparty/bgfx/examples/40-svt/fs_vt_mip.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
diff --git a/3rdparty/bgfx/examples/40-svt/fs_vt_unlit.sc b/3rdparty/bgfx/examples/40-svt/fs_vt_unlit.sc
index 634ef13481a..a079bc11d5e 100644
--- a/3rdparty/bgfx/examples/40-svt/fs_vt_unlit.sc
+++ b/3rdparty/bgfx/examples/40-svt/fs_vt_unlit.sc
@@ -1,8 +1,8 @@
$input v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
diff --git a/3rdparty/bgfx/examples/40-svt/makefile b/3rdparty/bgfx/examples/40-svt/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/40-svt/makefile
+++ b/3rdparty/bgfx/examples/40-svt/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/40-svt/svt.cpp b/3rdparty/bgfx/examples/40-svt/svt.cpp
index 63be6ed74b7..caab49c3416 100644
--- a/3rdparty/bgfx/examples/40-svt/svt.cpp
+++ b/3rdparty/bgfx/examples/40-svt/svt.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Ales Mlakar. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -17,7 +17,6 @@
#include "bgfx_utils.h"
#include "imgui/imgui.h"
#include "camera.h"
-#include "bounds.h"
#include "vt.h"
namespace
@@ -79,12 +78,13 @@ public:
m_reset = BGFX_RESET_VSYNC;
bgfx::Init init;
-
- init.type = args.m_type;
+ init.type = args.m_type;
init.vendorId = args.m_pciId;
- init.resolution.width = m_width;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
+ init.resolution.width = m_width;
init.resolution.height = m_height;
- init.resolution.reset = m_reset;
+ init.resolution.reset = m_reset;
bgfx::init(init);
// Enable m_debug text.
diff --git a/3rdparty/bgfx/examples/40-svt/virtualtexture.sh b/3rdparty/bgfx/examples/40-svt/virtualtexture.sh
index 55cfb0cafbc..32a3381c6eb 100644
--- a/3rdparty/bgfx/examples/40-svt/virtualtexture.sh
+++ b/3rdparty/bgfx/examples/40-svt/virtualtexture.sh
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
diff --git a/3rdparty/bgfx/examples/40-svt/vs_vt_generic.sc b/3rdparty/bgfx/examples/40-svt/vs_vt_generic.sc
index d605451e8c9..1f39a87383b 100644
--- a/3rdparty/bgfx/examples/40-svt/vs_vt_generic.sc
+++ b/3rdparty/bgfx/examples/40-svt/vs_vt_generic.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0
$output v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/40-svt/vt.cpp b/3rdparty/bgfx/examples/40-svt/vt.cpp
index 039c0479659..64f479ea589 100644
--- a/3rdparty/bgfx/examples/40-svt/vt.cpp
+++ b/3rdparty/bgfx/examples/40-svt/vt.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Ales Mlakar. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -440,7 +440,7 @@ PageTable::PageTable(PageCache* _cache, VirtualTextureInfo* _info, PageIndexer*
{
auto size = m_info->GetPageTableSize();
m_quadtree = BX_NEW(VirtualTexture::getAllocator(), Quadtree)({ 0, 0, size, size }, (int)bx::log2((float)size));
- m_texture = bgfx::createTexture2D((uint16_t)size, (uint16_t)size, true, 1, bgfx::TextureFormat::BGRA8, BGFX_SAMPLER_UVW_CLAMP | BGFX_SAMPLER_POINT);
+ m_texture = bgfx::createTexture2D((uint16_t)size, (uint16_t)size, true, 1, bgfx::TextureFormat::BGRA8, BGFX_SAMPLER_UVW_CLAMP | BGFX_SAMPLER_POINT | BGFX_TEXTURE_BLIT_DST);
_cache->added = [=](Page page, Point pt) { m_quadtreeDirty = true; m_quadtree->add(page, pt); };
_cache->removed = [=](Page page, Point pt) { m_quadtreeDirty = true; m_quadtree->remove(page); BX_UNUSED(pt); };
@@ -712,7 +712,7 @@ TextureAtlas::TextureAtlas(VirtualTextureInfo* _info, int _count, int _uploadspe
, false
, 1
, bgfx::TextureFormat::BGRA8
- , BGFX_SAMPLER_UVW_CLAMP
+ , BGFX_SAMPLER_UVW_CLAMP | BGFX_TEXTURE_BLIT_DST
);
}
diff --git a/3rdparty/bgfx/examples/40-svt/vt.h b/3rdparty/bgfx/examples/40-svt/vt.h
index 6bab939e28e..211cf153dd8 100644
--- a/3rdparty/bgfx/examples/40-svt/vt.h
+++ b/3rdparty/bgfx/examples/40-svt/vt.h
@@ -1,6 +1,6 @@
/*
* Copyright 2018 Ales Mlakar. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
diff --git a/3rdparty/bgfx/examples/41-tess/makefile b/3rdparty/bgfx/examples/41-tess/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/41-tess/makefile
+++ b/3rdparty/bgfx/examples/41-tess/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/41-tess/tess.cpp b/3rdparty/bgfx/examples/41-tess/tess.cpp
index ab764a5c0ec..45566ddcd5f 100644
--- a/3rdparty/bgfx/examples/41-tess/tess.cpp
+++ b/3rdparty/bgfx/examples/41-tess/tess.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2019 Daniel Gavin. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -17,908 +17,908 @@
#include <bx/math.h>
#include "bgfx_utils.h"
-#include "bounds.h"
#include "camera.h"
#include "common.h"
#include "imgui/imgui.h"
namespace
{
- static const char* s_shaderOptions[] =
- {
- "Normal",
- "Diffuse"
- };
+static const char* s_shaderOptions[] =
+{
+ "Normal",
+ "Diffuse"
+};
- static const float s_verticesL0[] =
- {
- 0.0f, 0.0f,
- 1.0f, 0.0f,
- 0.0f, 1.0f,
- };
+static const float s_verticesL0[] =
+{
+ 0.0f, 0.0f,
+ 1.0f, 0.0f,
+ 0.0f, 1.0f,
+};
- static const uint32_t s_indexesL0[] = { 0u, 1u, 2u };
+static const uint32_t s_indexesL0[] = { 0u, 1u, 2u };
- static const float s_verticesL1[] =
- {
- 0.0f, 1.0f,
- 0.5f, 0.5f,
- 0.0f, 0.5f,
- 0.0f, 0.0f,
- 0.5f, 0.0f,
- 1.0f, 0.0f,
- };
+static const float s_verticesL1[] =
+{
+ 0.0f, 1.0f,
+ 0.5f, 0.5f,
+ 0.0f, 0.5f,
+ 0.0f, 0.0f,
+ 0.5f, 0.0f,
+ 1.0f, 0.0f,
+};
+
+static const uint32_t s_indexesL1[] =
+{
+ 1u, 0u, 2u,
+ 1u, 2u, 3u,
+ 1u, 3u, 4u,
+ 1u, 4u, 5u,
+};
- static const uint32_t s_indexesL1[] =
- {
- 1u, 0u, 2u,
- 1u, 2u, 3u,
- 1u, 3u, 4u,
- 1u, 4u, 5u,
- };
+static const float s_verticesL2[] =
+{
+ 0.25f, 0.75f,
+ 0.0f, 1.0f,
+ 0.0f, 0.75f,
+ 0.0f, 0.5f,
+ 0.25f, 0.5f,
+ 0.5f, 0.5f,
+
+ 0.25f, 0.25f,
+ 0.0f, 0.25f,
+ 0.0f, 0.0f,
+ 0.25f, 0.0f,
+ 0.5f, 0.0f,
+ 0.5f, 0.25f,
+ 0.75f, 0.25f,
+ 0.75f, 0.0f,
+ 1.0f, 0.0f,
+};
+
+static const uint32_t s_indexesL2[] =
+{
+ 0u, 1u, 2u,
+ 0u, 2u, 3u,
+ 0u, 3u, 4u,
+ 0u, 4u, 5u,
+
+ 6u, 5u, 4u,
+ 6u, 4u, 3u,
+ 6u, 3u, 7u,
+ 6u, 7u, 8u,
+
+ 6u, 8u, 9u,
+ 6u, 9u, 10u,
+ 6u, 10u, 11u,
+ 6u, 11u, 5u,
+
+ 12u, 5u, 11u,
+ 12u, 11u, 10u,
+ 12u, 10u, 13u,
+ 12u, 13u, 14u,
+};
+
+static const float s_verticesL3[] =
+{
+ 0.25f*0.5f, 0.75f*0.5f + 0.5f,
+ 0.0f*0.5f, 1.0f*0.5f + 0.5f,
+ 0.0f*0.5f, 0.75f*0.5f + 0.5f,
+ 0.0f*0.5f , 0.5f*0.5f + 0.5f,
+ 0.25f*0.5f, 0.5f*0.5f + 0.5f,
+ 0.5f*0.5f, 0.5f*0.5f + 0.5f,
+ 0.25f*0.5f, 0.25f*0.5f + 0.5f,
+ 0.0f*0.5f, 0.25f*0.5f + 0.5f,
+ 0.0f*0.5f, 0.0f*0.5f + 0.5f,
+ 0.25f*0.5f, 0.0f*0.5f + 0.5f,
+ 0.5f*0.5f, 0.0f*0.5f + 0.5f,
+ 0.5f*0.5f, 0.25f*0.5f + 0.5f,
+ 0.75f*0.5f, 0.25f*0.5f + 0.5f,
+ 0.75f*0.5f, 0.0f*0.5f + 0.5f,
+ 1.0f*0.5f, 0.0f*0.5f + 0.5f, //14
+
+ 0.375f, 0.375f,
+ 0.25f, 0.375f,
+ 0.25f, 0.25f,
+ 0.375f, 0.25f,
+ 0.5f, 0.25f,
+ 0.5f, 0.375f, //20
+
+ 0.125f, 0.375f,
+ 0.0f, 0.375f,
+ 0.0f, 0.25f,
+ 0.125f, 0.25f, //24
+
+ 0.125f, 0.125f,
+ 0.0f, 0.125f,
+ 0.0f, 0.0f,
+ 0.125f, 0.0f,
+ 0.25f, 0.0f,
+ 0.25f, 0.125f, //30
+
+ 0.375f, 0.125f,
+ 0.375f, 0.0f,
+ 0.5f, 0.0f,
+ 0.5f, 0.125f, //34
+
+ 0.625f, 0.375f,
+ 0.625f, 0.25f,
+ 0.75f, 0.25f, //37
+
+ 0.625f, 0.125f,
+ 0.625f, 0.0f,
+ 0.75f, 0.0f,
+ 0.75f, 0.125f, //41
+
+ 0.875f, 0.125f,
+ 0.875f, 0.0f,
+ 1.0f, 0.0f, //44
+};
+
+static const uint32_t s_indexesL3[] =
+{
+ 0u, 1u, 2u,
+ 0u, 2u, 3u,
+ 0u, 3u, 4u,
+ 0u, 4u, 5u,
+
+ 6u, 5u, 4u,
+ 6u, 4u, 3u,
+ 6u, 3u, 7u,
+ 6u, 7u, 8u,
+
+ 6u, 8u, 9u,
+ 6u, 9u, 10u,
+ 6u, 10u, 11u,
+ 6u, 11u, 5u,
+
+ 12u, 5u, 11u,
+ 12u, 11u, 10u,
+ 12u, 10u, 13u,
+ 12u, 13u, 14u, //End fo first big triangle
+
+ 15u, 14u, 13u,
+ 15u, 13u, 10u,
+ 15u, 10u, 16u,
+ 15u, 16u, 17u,
+ 15u, 17u, 18u,
+ 15u, 18u, 19u,
+ 15u, 19u, 20u,
+ 15u, 20u, 14u,
+
+ 21u, 10u, 9u,
+ 21u, 9u, 8u,
+ 21u, 8u, 22u,
+ 21u, 22u, 23u,
+ 21u, 23u, 24u,
+ 21u, 24u, 17u,
+ 21u, 17u, 16u,
+ 21u, 16u, 10u,
+
+ 25u, 17u, 24u,
+ 25u, 24u, 23u,
+ 25u, 23u, 26u,
+ 25u, 26u, 27u,
+ 25u, 27u, 28u,
+ 25u, 28u, 29u,
+ 25u, 29u, 30u,
+ 25u, 30u, 17u,
+
+ 31u, 19u, 18u,
+ 31u, 18u, 17u,
+ 31u, 17u, 30u,
+ 31u, 30u, 29u,
+ 31u, 29u, 32u,
+ 31u, 32u, 33u,
+ 31u, 33u, 34u,
+ 31u, 34u, 19u,
+
+ 35u, 14u, 20u,
+ 35u, 20u, 19u,
+ 35u, 19u, 36u,
+ 35u, 36u, 37u,
+
+ 38u, 37u, 36u,
+ 38u, 36u, 19u,
+ 38u, 19u, 34u,
+ 38u, 34u, 33u,
+ 38u, 33u, 39u,
+ 38u, 39u, 40u,
+ 38u, 40u, 41u,
+ 38u, 41u, 37u,
+
+ 42u, 37u, 41u,
+ 42u, 41u, 40u,
+ 42u, 40u, 43u,
+ 42u, 43u, 44u,
+};
+
+enum
+{
+ PROGRAM_TERRAIN_NORMAL,
+ PROGRAM_TERRAIN,
- static const float s_verticesL2[] =
- {
- 0.25f, 0.75f,
- 0.0f, 1.0f,
- 0.0f, 0.75f,
- 0.0f, 0.5f,
- 0.25f, 0.5f,
- 0.5f, 0.5f,
-
- 0.25f, 0.25f,
- 0.0f, 0.25f,
- 0.0f, 0.0f,
- 0.25f, 0.0f,
- 0.5f, 0.0f,
- 0.5f, 0.25f,
- 0.75f, 0.25f,
- 0.75f, 0.0f,
- 1.0f, 0.0f,
- };
+ SHADING_COUNT
+};
- static const uint32_t s_indexesL2[] =
- {
- 0u, 1u, 2u,
- 0u, 2u, 3u,
- 0u, 3u, 4u,
- 0u, 4u, 5u,
-
- 6u, 5u, 4u,
- 6u, 4u, 3u,
- 6u, 3u, 7u,
- 6u, 7u, 8u,
-
- 6u, 8u, 9u,
- 6u, 9u, 10u,
- 6u, 10u, 11u,
- 6u, 11u, 5u,
-
- 12u, 5u, 11u,
- 12u, 11u, 10u,
- 12u, 10u, 13u,
- 12u, 13u, 14u,
- };
+enum
+{
+ BUFFER_SUBD
+};
- static const float s_verticesL3[] =
- {
- 0.25f*0.5f, 0.75f*0.5f + 0.5f,
- 0.0f*0.5f, 1.0f*0.5f + 0.5f,
- 0.0f*0.5f, 0.75f*0.5f + 0.5f,
- 0.0f*0.5f , 0.5f*0.5f + 0.5f,
- 0.25f*0.5f, 0.5f*0.5f + 0.5f,
- 0.5f*0.5f, 0.5f*0.5f + 0.5f,
- 0.25f*0.5f, 0.25f*0.5f + 0.5f,
- 0.0f*0.5f, 0.25f*0.5f + 0.5f,
- 0.0f*0.5f, 0.0f*0.5f + 0.5f,
- 0.25f*0.5f, 0.0f*0.5f + 0.5f,
- 0.5f*0.5f, 0.0f*0.5f + 0.5f,
- 0.5f*0.5f, 0.25f*0.5f + 0.5f,
- 0.75f*0.5f, 0.25f*0.5f + 0.5f,
- 0.75f*0.5f, 0.0f*0.5f + 0.5f,
- 1.0f*0.5f, 0.0f*0.5f + 0.5f, //14
-
- 0.375f, 0.375f,
- 0.25f, 0.375f,
- 0.25f, 0.25f,
- 0.375f, 0.25f,
- 0.5f, 0.25f,
- 0.5f, 0.375f, //20
-
- 0.125f, 0.375f,
- 0.0f, 0.375f,
- 0.0f, 0.25f,
- 0.125f, 0.25f, //24
-
- 0.125f, 0.125f,
- 0.0f, 0.125f,
- 0.0f, 0.0f,
- 0.125f, 0.0f,
- 0.25f, 0.0f,
- 0.25f, 0.125f, //30
-
- 0.375f, 0.125f,
- 0.375f, 0.0f,
- 0.5f, 0.0f,
- 0.5f, 0.125f, //34
-
- 0.625f, 0.375f,
- 0.625f, 0.25f,
- 0.75f, 0.25f, //37
-
- 0.625f, 0.125f,
- 0.625f, 0.0f,
- 0.75f, 0.0f,
- 0.75f, 0.125f, //41
-
- 0.875f, 0.125f,
- 0.875f, 0.0f,
- 1.0f, 0.0f, //44
- };
+enum
+{
+ PROGRAM_SUBD_CS_LOD,
+ PROGRAM_UPDATE_INDIRECT,
+ PROGRAM_INIT_INDIRECT,
+ PROGRAM_UPDATE_DRAW,
- static const uint32_t s_indexesL3[] =
- {
- 0u, 1u, 2u,
- 0u, 2u, 3u,
- 0u, 3u, 4u,
- 0u, 4u, 5u,
-
- 6u, 5u, 4u,
- 6u, 4u, 3u,
- 6u, 3u, 7u,
- 6u, 7u, 8u,
-
- 6u, 8u, 9u,
- 6u, 9u, 10u,
- 6u, 10u, 11u,
- 6u, 11u, 5u,
-
- 12u, 5u, 11u,
- 12u, 11u, 10u,
- 12u, 10u, 13u,
- 12u, 13u, 14u, //End fo first big triangle
-
- 15u, 14u, 13u,
- 15u, 13u, 10u,
- 15u, 10u, 16u,
- 15u, 16u, 17u,
- 15u, 17u, 18u,
- 15u, 18u, 19u,
- 15u, 19u, 20u,
- 15u, 20u, 14u,
-
- 21u, 10u, 9u,
- 21u, 9u, 8u,
- 21u, 8u, 22u,
- 21u, 22u, 23u,
- 21u, 23u, 24u,
- 21u, 24u, 17u,
- 21u, 17u, 16u,
- 21u, 16u, 10u,
-
- 25u, 17u, 24u,
- 25u, 24u, 23u,
- 25u, 23u, 26u,
- 25u, 26u, 27u,
- 25u, 27u, 28u,
- 25u, 28u, 29u,
- 25u, 29u, 30u,
- 25u, 30u, 17u,
-
- 31u, 19u, 18u,
- 31u, 18u, 17u,
- 31u, 17u, 30u,
- 31u, 30u, 29u,
- 31u, 29u, 32u,
- 31u, 32u, 33u,
- 31u, 33u, 34u,
- 31u, 34u, 19u,
-
- 35u, 14u, 20u,
- 35u, 20u, 19u,
- 35u, 19u, 36u,
- 35u, 36u, 37u,
-
- 38u, 37u, 36u,
- 38u, 36u, 19u,
- 38u, 19u, 34u,
- 38u, 34u, 33u,
- 38u, 33u, 39u,
- 38u, 39u, 40u,
- 38u, 40u, 41u,
- 38u, 41u, 37u,
-
- 42u, 37u, 41u,
- 42u, 41u, 40u,
- 42u, 40u, 43u,
- 42u, 43u, 44u,
- };
+ PROGRAM_COUNT
+};
- enum
- {
- PROGRAM_TERRAIN_NORMAL,
- PROGRAM_TERRAIN,
+enum
+{
+ TERRAIN_DMAP_SAMPLER,
+ TERRAIN_SMAP_SAMPLER,
- SHADING_COUNT
- };
+ SAMPLER_COUNT
+};
- enum
- {
- BUFFER_SUBD
- };
+enum
+{
+ TEXTURE_DMAP,
+ TEXTURE_SMAP,
- enum
- {
- PROGRAM_SUBD_CS_LOD,
- PROGRAM_UPDATE_INDIRECT,
- PROGRAM_INIT_INDIRECT,
- PROGRAM_UPDATE_DRAW,
+ TEXTURE_COUNT
+};
- PROGRAM_COUNT
- };
+constexpr int32_t kNumVec4 = 2;
- enum
+struct Uniforms
+{
+ void init()
{
- TERRAIN_DMAP_SAMPLER,
- TERRAIN_SMAP_SAMPLER,
+ u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4, kNumVec4);
- SAMPLER_COUNT
- };
+ cull = 1;
+ freeze = 0;
+ gpuSubd = 3;
- enum
- {
- TEXTURE_DMAP,
- TEXTURE_SMAP,
+ }
- TEXTURE_COUNT
- };
+ void submit()
+ {
+ bgfx::setUniform(u_params, params, kNumVec4);
+ }
- constexpr int32_t kNumVec4 = 2;
+ void destroy()
+ {
+ bgfx::destroy(u_params);
+ }
- struct Uniforms
+ union
{
- void init()
+ struct
{
- u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4, kNumVec4);
+ float dmapFactor;
+ float lodFactor;
+ float cull;
+ float freeze;
+
+ float gpuSubd;
+ float padding0;
+ float padding1;
+ float padding2;
+ };
- cull = 1;
- freeze = 0;
- gpuSubd = 3;
+ float params[kNumVec4 * 4];
+ };
- }
+ bgfx::UniformHandle u_params;
+};
- void submit()
- {
- bgfx::setUniform(u_params, params, kNumVec4);
- }
+class ExampleTessellation : public entry::AppI
+{
+public:
+ ExampleTessellation(const char* _name, const char* _description, const char* _url)
+ : entry::AppI(_name, _description, _url)
+ {
+ }
- void destroy()
+ void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) override
+ {
+ Args args(_argc, _argv);
+
+ m_width = _width;
+ m_height = _height;
+ m_debug = BGFX_DEBUG_NONE;
+ m_reset = BGFX_RESET_NONE;
+
+ bgfx::Init init;
+ init.type = args.m_type;
+ init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
+ init.resolution.width = m_width;
+ init.resolution.height = m_height;
+ init.resolution.reset = m_reset;
+ bgfx::init(init);
+
+ m_dmap = { "textures/dmap.png", 0.45f };
+ m_computeThreadCount = 5;
+ m_shading = PROGRAM_TERRAIN;
+ m_primitivePixelLengthTarget = 7.0f;
+ m_fovy = 60.0f;
+ m_pingPong = 0;
+ m_restart = true;
+
+ // Enable m_debug text.
+ bgfx::setDebug(m_debug);
+
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
+
+ bgfx::setViewClear(1
+ , BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
+
+ // Imgui.
+ imguiCreate();
+
+ m_timeOffset = bx::getHPCounter();
+
+ m_oldWidth = 0;
+ m_oldHeight = 0;
+ m_oldReset = m_reset;
+
+ cameraCreate();
+ cameraSetPosition({ 0.0f, 0.5f, 0.0f });
+ cameraSetVerticalAngle(0);
+
+ m_wireframe = false;
+ m_freeze = false;
+ m_cull = true;
+
+ loadPrograms();
+ loadBuffers();
+ loadTextures();
+
+ createAtomicCounters();
+
+ m_dispatchIndirect = bgfx::createIndirectBuffer(2);
+ }
+
+ virtual int shutdown() override
+ {
+ // Cleanup.
+ cameraDestroy();
+ imguiDestroy();
+
+ m_uniforms.destroy();
+
+ bgfx::destroy(m_bufferCounter);
+ bgfx::destroy(m_bufferCulledSubd);
+ bgfx::destroy(m_bufferSubd[0]);
+ bgfx::destroy(m_bufferSubd[1]);
+ bgfx::destroy(m_dispatchIndirect);
+ bgfx::destroy(m_geometryIndices);
+ bgfx::destroy(m_geometryVertices);
+ bgfx::destroy(m_instancedGeometryIndices);
+ bgfx::destroy(m_instancedGeometryVertices);
+
+ for (uint32_t i = 0; i < PROGRAM_COUNT; ++i)
{
- bgfx::destroy(u_params);
+ bgfx::destroy(m_programsCompute[i]);
}
- union
+ for (uint32_t i = 0; i < SHADING_COUNT; ++i)
{
- struct
- {
- float dmapFactor;
- float lodFactor;
- float cull;
- float freeze;
-
- float gpuSubd;
- float padding0;
- float padding1;
- float padding2;
- };
-
- float params[kNumVec4 * 4];
- };
+ bgfx::destroy(m_programsDraw[i]);
+ }
- bgfx::UniformHandle u_params;
- };
- class ExampleTessellation : public entry::AppI
- {
- public:
- ExampleTessellation(const char* _name, const char* _description, const char* _url)
- : entry::AppI(_name, _description, _url)
+ for (uint32_t i = 0; i < SAMPLER_COUNT; ++i)
{
+ bgfx::destroy(m_samplers[i]);
}
- void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) override
+ for (uint32_t i = 0; i < TEXTURE_COUNT; ++i)
{
- Args args(_argc, _argv);
-
- m_width = _width;
- m_height = _height;
- m_debug = BGFX_DEBUG_NONE;
- m_reset = BGFX_RESET_NONE;
-
- bgfx::Init init;
- init.type = args.m_type;
- init.vendorId = args.m_pciId;
- init.resolution.width = m_width;
- init.resolution.height = m_height;
- init.resolution.reset = m_reset;
- bgfx::init(init);
-
- m_dmap = { "textures/dmap.png", 0.45f };
- m_computeThreadCount = 5;
- m_shading = PROGRAM_TERRAIN;
- m_primitivePixelLengthTarget = 7.0f;
- m_fovy = 60.0f;
- m_pingPong = 0;
- m_restart = true;
-
- // Enable m_debug text.
- bgfx::setDebug(m_debug);
-
- // Set view 0 clear state.
- bgfx::setViewClear(0
- , BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
- , 0x303030ff
- , 1.0f
- , 0
- );
-
- bgfx::setViewClear(1
- , BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
- , 0x303030ff
- , 1.0f
- , 0
- );
-
- // Imgui.
- imguiCreate();
-
- m_timeOffset = bx::getHPCounter();
-
- m_oldWidth = 0;
- m_oldHeight = 0;
- m_oldReset = m_reset;
-
- cameraCreate();
- cameraSetPosition({ 0.0f, 0.5f, 0.0f });
- cameraSetVerticalAngle(0);
+ bgfx::destroy(m_textures[i]);
+ }
- m_wireframe = false;
- m_freeze = false;
- m_cull = true;
+ // Shutdown bgfx.
+ bgfx::shutdown();
- loadPrograms();
- loadBuffers();
- loadTextures();
+ return 0;
+ }
- createAtomicCounters();
+ bool update() override
+ {
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState) )
+ {
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency() );
+ const float deltaTime = float(frameTime / freq);
+
+ imguiBeginFrame(
+ m_mouseState.m_mx
+ , m_mouseState.m_my
+ , (m_mouseState.m_buttons[entry::MouseButton::Left] ? IMGUI_MBUT_LEFT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Right] ? IMGUI_MBUT_RIGHT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , m_mouseState.m_mz
+ , uint16_t(m_width)
+ , uint16_t(m_height)
+ );
- m_dispatchIndirect = bgfx::createIndirectBuffer(2);
- }
+ showExampleDialog(this);
- virtual int shutdown() override
- {
- // Cleanup.
- cameraDestroy();
- imguiDestroy();
-
- m_uniforms.destroy();
-
- bgfx::destroy(m_bufferCounter);
- bgfx::destroy(m_bufferCulledSubd);
- bgfx::destroy(m_bufferSubd[0]);
- bgfx::destroy(m_bufferSubd[1]);
- bgfx::destroy(m_dispatchIndirect);
- bgfx::destroy(m_geometryIndices);
- bgfx::destroy(m_geometryVertices);
- bgfx::destroy(m_instancedGeometryIndices);
- bgfx::destroy(m_instancedGeometryVertices);
-
- for (uint32_t i = 0; i < PROGRAM_COUNT; ++i)
- {
- bgfx::destroy(m_programsCompute[i]);
- }
+ ImGui::SetNextWindowPos(
+ ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
+ , ImGuiCond_FirstUseEver
+ );
+ ImGui::SetNextWindowSize(
+ ImVec2(m_width / 5.0f, m_height / 3.0f)
+ , ImGuiCond_FirstUseEver
+ );
+ ImGui::Begin("Settings", NULL, 0);
- for (uint32_t i = 0; i < SHADING_COUNT; ++i)
+ if (ImGui::Checkbox("Debug wireframe", &m_wireframe) )
{
- bgfx::destroy(m_programsDraw[i]);
+ bgfx::setDebug(m_wireframe
+ ? BGFX_DEBUG_WIREFRAME
+ : BGFX_DEBUG_NONE
+ );
}
- for (uint32_t i = 0; i < SAMPLER_COUNT; ++i)
- {
- bgfx::destroy(m_samplers[i]);
- }
+ ImGui::SameLine();
- for (uint32_t i = 0; i < TEXTURE_COUNT; ++i)
+ if (ImGui::Checkbox("Cull", &m_cull) )
{
- bgfx::destroy(m_textures[i]);
+ m_uniforms.cull = m_cull ? 1.0f : 0.0f;
}
- // Shutdown bgfx.
- bgfx::shutdown();
+ ImGui::SameLine();
- return 0;
- }
-
- bool update() override
- {
- if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState) )
+ if (ImGui::Checkbox("Freeze subdividing", &m_freeze) )
{
- int64_t now = bx::getHPCounter();
- static int64_t last = now;
- const int64_t frameTime = now - last;
- last = now;
- const double freq = double(bx::getHPFrequency() );
- const float deltaTime = float(frameTime / freq);
-
- imguiBeginFrame(
- m_mouseState.m_mx
- , m_mouseState.m_my
- , (m_mouseState.m_buttons[entry::MouseButton::Left] ? IMGUI_MBUT_LEFT : 0)
- | (m_mouseState.m_buttons[entry::MouseButton::Right] ? IMGUI_MBUT_RIGHT : 0)
- | (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
- , m_mouseState.m_mz
- , uint16_t(m_width)
- , uint16_t(m_height)
- );
-
- showExampleDialog(this);
-
- ImGui::SetNextWindowPos(
- ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
- , ImGuiCond_FirstUseEver
- );
- ImGui::SetNextWindowSize(
- ImVec2(m_width / 5.0f, m_height / 3.0f)
- , ImGuiCond_FirstUseEver
- );
- ImGui::Begin("Settings", NULL, 0);
-
- if (ImGui::Checkbox("Debug wireframe", &m_wireframe) )
- {
- bgfx::setDebug(m_wireframe
- ? BGFX_DEBUG_WIREFRAME
- : BGFX_DEBUG_NONE
- );
- }
-
- ImGui::SameLine();
-
- if (ImGui::Checkbox("Cull", &m_cull) )
- {
- m_uniforms.cull = m_cull ? 1.0f : 0.0f;
- }
-
- ImGui::SameLine();
-
- if (ImGui::Checkbox("Freeze subdividing", &m_freeze) )
- {
- m_uniforms.freeze = m_freeze ? 1.0f : 0.0f;
- }
-
-
- ImGui::SliderFloat("Pixels per edge", &m_primitivePixelLengthTarget, 1, 20);
-
- int gpuSlider = (int)m_uniforms.gpuSubd;
+ m_uniforms.freeze = m_freeze ? 1.0f : 0.0f;
+ }
- if (ImGui::SliderInt("Triangle Patch level", &gpuSlider, 0, 3) )
- {
- m_restart = true;
- m_uniforms.gpuSubd = float(gpuSlider);
- }
- ImGui::Combo("Shading", &m_shading, s_shaderOptions, 2);
+ ImGui::SliderFloat("Pixels per edge", &m_primitivePixelLengthTarget, 1, 20);
- ImGui::Text("Some variables require rebuilding the subdivide buffers and causes a stutter.");
+ int gpuSlider = (int)m_uniforms.gpuSubd;
- ImGui::End();
+ if (ImGui::SliderInt("Triangle Patch level", &gpuSlider, 0, 3) )
+ {
+ m_restart = true;
+ m_uniforms.gpuSubd = float(gpuSlider);
+ }
- // Update camera.
- cameraUpdate(deltaTime*0.01f, m_mouseState, ImGui::MouseOverArea() );
+ ImGui::Combo("Shading", &m_shading, s_shaderOptions, 2);
- bgfx::touch(0);
- bgfx::touch(1);
+ ImGui::Text("Some variables require rebuilding the subdivide buffers and causes a stutter.");
- configureUniforms();
+ ImGui::End();
- cameraGetViewMtx(m_viewMtx);
+ // Update camera.
+ cameraUpdate(deltaTime*0.01f, m_mouseState, ImGui::MouseOverArea() );
- float model[16];
+ bgfx::touch(0);
+ bgfx::touch(1);
- bx::mtxRotateX(model, bx::toRad(90) );
+ configureUniforms();
- bx::mtxProj(m_projMtx, m_fovy, float(m_width) / float(m_height), 0.0001f, 2000.0f, bgfx::getCaps()->homogeneousDepth);
+ cameraGetViewMtx(m_viewMtx);
- // Set view 0
- bgfx::setViewTransform(0, m_viewMtx, m_projMtx);
+ float model[16];
- // Set view 1
- bgfx::setViewRect(1, 0, 0, uint16_t(m_width), uint16_t(m_height) );
- bgfx::setViewTransform(1, m_viewMtx, m_projMtx);
+ bx::mtxRotateX(model, bx::toRad(90) );
- m_uniforms.submit();
+ bx::mtxProj(m_projMtx, m_fovy, float(m_width) / float(m_height), 0.0001f, 2000.0f, bgfx::getCaps()->homogeneousDepth);
- // update the subd buffers
- if (m_restart)
- {
- m_pingPong = 1;
+ // Set view 0
+ bgfx::setViewTransform(0, m_viewMtx, m_projMtx);
- bgfx::destroy(m_instancedGeometryVertices);
- bgfx::destroy(m_instancedGeometryIndices);
+ // Set view 1
+ bgfx::setViewRect(1, 0, 0, uint16_t(m_width), uint16_t(m_height) );
+ bgfx::setViewTransform(1, m_viewMtx, m_projMtx);
- bgfx::destroy(m_bufferSubd[BUFFER_SUBD]);
- bgfx::destroy(m_bufferSubd[BUFFER_SUBD + 1]);
- bgfx::destroy(m_bufferCulledSubd);
+ m_uniforms.submit();
- loadInstancedGeometryBuffers();
- loadSubdivisionBuffers();
+ // update the subd buffers
+ if (m_restart)
+ {
+ m_pingPong = 1;
- //init indirect
- bgfx::setBuffer(1, m_bufferSubd[m_pingPong], bgfx::Access::ReadWrite);
- bgfx::setBuffer(2, m_bufferCulledSubd, bgfx::Access::ReadWrite);
- bgfx::setBuffer(3, m_dispatchIndirect, bgfx::Access::ReadWrite);
- bgfx::setBuffer(4, m_bufferCounter, bgfx::Access::ReadWrite);
- bgfx::setBuffer(8, m_bufferSubd[1 - m_pingPong], bgfx::Access::ReadWrite);
- bgfx::dispatch(0, m_programsCompute[PROGRAM_INIT_INDIRECT], 1, 1, 1);
+ bgfx::destroy(m_instancedGeometryVertices);
+ bgfx::destroy(m_instancedGeometryIndices);
+ bgfx::destroy(m_bufferSubd[BUFFER_SUBD]);
+ bgfx::destroy(m_bufferSubd[BUFFER_SUBD + 1]);
+ bgfx::destroy(m_bufferCulledSubd);
- m_restart = false;
- }
- else
- {
- // update batch
- bgfx::setBuffer(3, m_dispatchIndirect, bgfx::Access::ReadWrite);
- bgfx::setBuffer(4, m_bufferCounter, bgfx::Access::ReadWrite);
- bgfx::dispatch(0, m_programsCompute[PROGRAM_UPDATE_INDIRECT], 1, 1, 1);
- }
+ loadInstancedGeometryBuffers();
+ loadSubdivisionBuffers();
+ //init indirect
bgfx::setBuffer(1, m_bufferSubd[m_pingPong], bgfx::Access::ReadWrite);
bgfx::setBuffer(2, m_bufferCulledSubd, bgfx::Access::ReadWrite);
+ bgfx::setBuffer(3, m_dispatchIndirect, bgfx::Access::ReadWrite);
bgfx::setBuffer(4, m_bufferCounter, bgfx::Access::ReadWrite);
- bgfx::setBuffer(6, m_geometryVertices, bgfx::Access::Read);
- bgfx::setBuffer(7, m_geometryIndices, bgfx::Access::Read);
- bgfx::setBuffer(8, m_bufferSubd[1 - m_pingPong], bgfx::Access::Read);
- bgfx::setTransform(model);
-
- bgfx::setTexture(0, m_samplers[TERRAIN_DMAP_SAMPLER], m_textures[TEXTURE_DMAP], BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP);
-
- m_uniforms.submit();
+ bgfx::setBuffer(8, m_bufferSubd[1 - m_pingPong], bgfx::Access::ReadWrite);
+ bgfx::dispatch(0, m_programsCompute[PROGRAM_INIT_INDIRECT], 1, 1, 1);
- // update the subd buffer
- bgfx::dispatch(0, m_programsCompute[PROGRAM_SUBD_CS_LOD], m_dispatchIndirect, 1);
- // update draw
+ m_restart = false;
+ }
+ else
+ {
+ // update batch
bgfx::setBuffer(3, m_dispatchIndirect, bgfx::Access::ReadWrite);
bgfx::setBuffer(4, m_bufferCounter, bgfx::Access::ReadWrite);
+ bgfx::dispatch(0, m_programsCompute[PROGRAM_UPDATE_INDIRECT], 1, 1, 1);
+ }
- m_uniforms.submit();
+ bgfx::setBuffer(1, m_bufferSubd[m_pingPong], bgfx::Access::ReadWrite);
+ bgfx::setBuffer(2, m_bufferCulledSubd, bgfx::Access::ReadWrite);
+ bgfx::setBuffer(4, m_bufferCounter, bgfx::Access::ReadWrite);
+ bgfx::setBuffer(6, m_geometryVertices, bgfx::Access::Read);
+ bgfx::setBuffer(7, m_geometryIndices, bgfx::Access::Read);
+ bgfx::setBuffer(8, m_bufferSubd[1 - m_pingPong], bgfx::Access::Read);
+ bgfx::setTransform(model);
- bgfx::dispatch(1, m_programsCompute[PROGRAM_UPDATE_DRAW], 1, 1, 1);
+ bgfx::setTexture(0, m_samplers[TERRAIN_DMAP_SAMPLER], m_textures[TEXTURE_DMAP], BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP);
- // render the terrain
- bgfx::setTexture(0, m_samplers[TERRAIN_DMAP_SAMPLER], m_textures[TEXTURE_DMAP], BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP);
- bgfx::setTexture(1, m_samplers[TERRAIN_SMAP_SAMPLER], m_textures[TEXTURE_SMAP], BGFX_SAMPLER_MIN_ANISOTROPIC | BGFX_SAMPLER_MAG_ANISOTROPIC);
+ m_uniforms.submit();
- bgfx::setTransform(model);
- bgfx::setVertexBuffer(0, m_instancedGeometryVertices);
- bgfx::setIndexBuffer(m_instancedGeometryIndices);
- bgfx::setBuffer(2, m_bufferCulledSubd, bgfx::Access::Read);
- bgfx::setBuffer(3, m_geometryVertices, bgfx::Access::Read);
- bgfx::setBuffer(4, m_geometryIndices, bgfx::Access::Read);
- bgfx::setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_Z | BGFX_STATE_DEPTH_TEST_LESS);
+ // update the subd buffer
+ bgfx::dispatch(0, m_programsCompute[PROGRAM_SUBD_CS_LOD], m_dispatchIndirect, 1);
- m_uniforms.submit();
+ // update draw
+ bgfx::setBuffer(3, m_dispatchIndirect, bgfx::Access::ReadWrite);
+ bgfx::setBuffer(4, m_bufferCounter, bgfx::Access::ReadWrite);
- bgfx::submit(1, m_programsDraw[m_shading], m_dispatchIndirect);
+ m_uniforms.submit();
- m_pingPong = 1 - m_pingPong;
+ bgfx::dispatch(1, m_programsCompute[PROGRAM_UPDATE_DRAW], 1, 1, 1);
- imguiEndFrame();
+ // render the terrain
+ bgfx::setTexture(0, m_samplers[TERRAIN_DMAP_SAMPLER], m_textures[TEXTURE_DMAP], BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP);
+ bgfx::setTexture(1, m_samplers[TERRAIN_SMAP_SAMPLER], m_textures[TEXTURE_SMAP], BGFX_SAMPLER_MIN_ANISOTROPIC | BGFX_SAMPLER_MAG_ANISOTROPIC);
- // Advance to next frame. Rendering thread will be kicked to
- // process submitted rendering primitives.
- bgfx::frame(false);
+ bgfx::setTransform(model);
+ bgfx::setVertexBuffer(0, m_instancedGeometryVertices);
+ bgfx::setIndexBuffer(m_instancedGeometryIndices);
+ bgfx::setBuffer(2, m_bufferCulledSubd, bgfx::Access::Read);
+ bgfx::setBuffer(3, m_geometryVertices, bgfx::Access::Read);
+ bgfx::setBuffer(4, m_geometryIndices, bgfx::Access::Read);
+ bgfx::setState(BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_Z | BGFX_STATE_DEPTH_TEST_LESS);
- return true;
- }
+ m_uniforms.submit();
- return false;
- }
-
- void createAtomicCounters()
- {
- m_bufferCounter = bgfx::createDynamicIndexBuffer(3, BGFX_BUFFER_INDEX32 | BGFX_BUFFER_COMPUTE_READ_WRITE);
- }
+ bgfx::submit(1, m_programsDraw[m_shading], m_dispatchIndirect);
- void configureUniforms()
- {
- float lodFactor = 2.0f * bx::tan(bx::toRad(m_fovy) / 2.0f)
- / m_width * (1 << (int)m_uniforms.gpuSubd)
- * m_primitivePixelLengthTarget;
+ m_pingPong = 1 - m_pingPong;
- m_uniforms.lodFactor = lodFactor;
- m_uniforms.dmapFactor = m_dmap.scale;
- }
+ imguiEndFrame();
- /**
- * Load the Terrain Program
- *
- * This program renders an adaptive terrain using the implicit subdivision
- * technique discribed in GPU Zen 2.
- **/
- void loadPrograms()
- {
- m_samplers[TERRAIN_DMAP_SAMPLER] = bgfx::createUniform("u_DmapSampler", bgfx::UniformType::Sampler);
- m_samplers[TERRAIN_SMAP_SAMPLER] = bgfx::createUniform("u_SmapSampler", bgfx::UniformType::Sampler);
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame(false);
- m_uniforms.init();
+ return true;
+ }
- m_programsDraw[PROGRAM_TERRAIN] = loadProgram("vs_terrain_render", "fs_terrain_render");
- m_programsDraw[PROGRAM_TERRAIN_NORMAL] = loadProgram("vs_terrain_render", "fs_terrain_render_normal");
+ return false;
+ }
- m_programsCompute[PROGRAM_SUBD_CS_LOD] = bgfx::createProgram(loadShader("cs_terrain_lod"), true);
- m_programsCompute[PROGRAM_UPDATE_INDIRECT] = bgfx::createProgram(loadShader("cs_terrain_update_indirect"), true);
- m_programsCompute[PROGRAM_UPDATE_DRAW] = bgfx::createProgram(loadShader("cs_terrain_update_draw"), true);
- m_programsCompute[PROGRAM_INIT_INDIRECT] = bgfx::createProgram(loadShader("cs_terrain_init"), true);
- }
+ void createAtomicCounters()
+ {
+ m_bufferCounter = bgfx::createDynamicIndexBuffer(3, BGFX_BUFFER_INDEX32 | BGFX_BUFFER_COMPUTE_READ_WRITE);
+ }
- void loadSmapTexture()
- {
- int w = dmap->m_width;
- int h = dmap->m_height;
+ void configureUniforms()
+ {
+ float lodFactor = 2.0f * bx::tan(bx::toRad(m_fovy) / 2.0f)
+ / m_width * (1 << (int)m_uniforms.gpuSubd)
+ * m_primitivePixelLengthTarget
+ ;
+
+ m_uniforms.lodFactor = lodFactor;
+ m_uniforms.dmapFactor = m_dmap.scale;
+ }
+
+ /**
+ * Load the Terrain Program
+ *
+ * This program renders an adaptive terrain using the implicit subdivision
+ * technique described in GPU Zen 2.
+ **/
+ void loadPrograms()
+ {
+ m_samplers[TERRAIN_DMAP_SAMPLER] = bgfx::createUniform("u_DmapSampler", bgfx::UniformType::Sampler);
+ m_samplers[TERRAIN_SMAP_SAMPLER] = bgfx::createUniform("u_SmapSampler", bgfx::UniformType::Sampler);
- const uint16_t *texels = (const uint16_t *)dmap->m_data;
+ m_uniforms.init();
- int mipcnt = dmap->m_numMips;
+ m_programsDraw[PROGRAM_TERRAIN] = loadProgram("vs_terrain_render", "fs_terrain_render");
+ m_programsDraw[PROGRAM_TERRAIN_NORMAL] = loadProgram("vs_terrain_render", "fs_terrain_render_normal");
- const bgfx::Memory* mem = bgfx::alloc(w * h * 2 * sizeof(float) );
- float* smap = (float*)mem->data;
+ m_programsCompute[PROGRAM_SUBD_CS_LOD] = bgfx::createProgram(loadShader("cs_terrain_lod"), true);
+ m_programsCompute[PROGRAM_UPDATE_INDIRECT] = bgfx::createProgram(loadShader("cs_terrain_update_indirect"), true);
+ m_programsCompute[PROGRAM_UPDATE_DRAW] = bgfx::createProgram(loadShader("cs_terrain_update_draw"), true);
+ m_programsCompute[PROGRAM_INIT_INDIRECT] = bgfx::createProgram(loadShader("cs_terrain_init"), true);
+ }
- for (int j = 0; j < h; ++j)
- {
- for (int i = 0; i < w; ++i)
- {
- int i1 = bx::max(0, i - 1);
- int i2 = bx::min(w - 1, i + 1);
- int j1 = bx::max(0, j - 1);
- int j2 = bx::min(h - 1, j + 1);
- uint16_t px_l = texels[i1 + w * j]; // in [0,2^16-1]
- uint16_t px_r = texels[i2 + w * j]; // in [0,2^16-1]
- uint16_t px_b = texels[i + w * j1]; // in [0,2^16-1]
- uint16_t px_t = texels[i + w * j2]; // in [0,2^16-1]
- float z_l = (float)px_l / 65535.0f; // in [0, 1]
- float z_r = (float)px_r / 65535.0f; // in [0, 1]
- float z_b = (float)px_b / 65535.0f; // in [0, 1]
- float z_t = (float)px_t / 65535.0f; // in [0, 1]
- float slope_x = (float)w * 0.5f * (z_r - z_l);
- float slope_y = (float)h * 0.5f * (z_t - z_b);
-
- smap[2 * (i + w * j)] = slope_x;
- smap[1 + 2 * (i + w * j)] = slope_y;
- }
- }
+ void loadSmapTexture()
+ {
+ int w = dmap->m_width;
+ int h = dmap->m_height;
- m_textures[TEXTURE_SMAP] = bgfx::createTexture2D(
- (uint16_t)w
- , (uint16_t)h
- , mipcnt > 1
- , 1
- , bgfx::TextureFormat::RG32F
- , BGFX_TEXTURE_NONE
- , mem
- );
- }
+ const uint16_t *texels = (const uint16_t *)dmap->m_data;
- /**
- * Load the Displacement Texture
- *
- * This loads an R16 texture used as a displacement map
- */
- void loadDmapTexture()
- {
- dmap = imageLoad(m_dmap.pathToFile.getCPtr(), bgfx::TextureFormat::R16);
-
- m_textures[TEXTURE_DMAP] = bgfx::createTexture2D(
- (uint16_t)dmap->m_width
- , (uint16_t)dmap->m_height
- , false
- , 1
- , bgfx::TextureFormat::R16
- , BGFX_TEXTURE_NONE
- , bgfx::makeRef(dmap->m_data, dmap->m_size)
- );
- }
+ int mipcnt = dmap->m_numMips;
- /**
- * Load All Textures
- */
- void loadTextures()
- {
- loadDmapTexture();
- loadSmapTexture();
- }
+ const bgfx::Memory* mem = bgfx::alloc(w * h * 2 * sizeof(float) );
+ float* smap = (float*)mem->data;
- /**
- * Load the Geometry Buffer
- *
- * This procedure loads the scene geometry into an index and
- * vertex buffer. Here, we only load 2 triangles to define the
- * terrain.
- **/
- void loadGeometryBuffers()
+ for (int j = 0; j < h; ++j)
{
- const float vertices[] =
+ for (int i = 0; i < w; ++i)
{
- -1.0f, -1.0f, 0.0f, 1.0f,
- +1.0f, -1.0f, 0.0f, 1.0f,
- +1.0f, +1.0f, 0.0f, 1.0f,
- -1.0f, +1.0f, 0.0f, 1.0f,
- };
-
- const uint32_t indices[] = { 0, 1, 3, 2, 3, 1 };
-
- m_geometryLayout.begin().add(bgfx::Attrib::Position, 4, bgfx::AttribType::Float).end();
-
- m_geometryVertices = bgfx::createVertexBuffer(
- bgfx::copy(vertices, sizeof(vertices) )
- , m_geometryLayout
- , BGFX_BUFFER_COMPUTE_READ
- );
- m_geometryIndices = bgfx::createIndexBuffer(
- bgfx::copy(indices, sizeof(indices) )
- , BGFX_BUFFER_COMPUTE_READ | BGFX_BUFFER_INDEX32
- );
+ int i1 = bx::max(0, i - 1);
+ int i2 = bx::min(w - 1, i + 1);
+ int j1 = bx::max(0, j - 1);
+ int j2 = bx::min(h - 1, j + 1);
+ uint16_t px_l = texels[i1 + w * j]; // in [0,2^16-1]
+ uint16_t px_r = texels[i2 + w * j]; // in [0,2^16-1]
+ uint16_t px_b = texels[i + w * j1]; // in [0,2^16-1]
+ uint16_t px_t = texels[i + w * j2]; // in [0,2^16-1]
+ float z_l = (float)px_l / 65535.0f; // in [0, 1]
+ float z_r = (float)px_r / 65535.0f; // in [0, 1]
+ float z_b = (float)px_b / 65535.0f; // in [0, 1]
+ float z_t = (float)px_t / 65535.0f; // in [0, 1]
+ float slope_x = (float)w * 0.5f * (z_r - z_l);
+ float slope_y = (float)h * 0.5f * (z_t - z_b);
+
+ smap[2 * (i + w * j)] = slope_x;
+ smap[1 + 2 * (i + w * j)] = slope_y;
+ }
}
- void loadSubdivisionBuffers()
+ m_textures[TEXTURE_SMAP] = bgfx::createTexture2D(
+ (uint16_t)w
+ , (uint16_t)h
+ , mipcnt > 1
+ , 1
+ , bgfx::TextureFormat::RG32F
+ , BGFX_TEXTURE_NONE
+ , mem
+ );
+ }
+
+ /**
+ * Load the Displacement Texture
+ *
+ * This loads an R16 texture used as a displacement map
+ */
+ void loadDmapTexture()
+ {
+ dmap = imageLoad(m_dmap.pathToFile.getCPtr(), bgfx::TextureFormat::R16);
+
+ m_textures[TEXTURE_DMAP] = bgfx::createTexture2D(
+ (uint16_t)dmap->m_width
+ , (uint16_t)dmap->m_height
+ , false
+ , 1
+ , bgfx::TextureFormat::R16
+ , BGFX_TEXTURE_NONE
+ , bgfx::makeRef(dmap->m_data, dmap->m_size)
+ );
+ }
+
+ void loadTextures()
+ {
+ loadDmapTexture();
+ loadSmapTexture();
+ }
+
+ /**
+ * Load the Geometry Buffer
+ *
+ * This procedure loads the scene geometry into an index and
+ * vertex buffer. Here, we only load 2 triangles to define the
+ * terrain.
+ **/
+ void loadGeometryBuffers()
+ {
+ const float vertices[] =
{
- const uint32_t bufferCapacity = 1 << 27;
+ -1.0f, -1.0f, 0.0f, 1.0f,
+ +1.0f, -1.0f, 0.0f, 1.0f,
+ +1.0f, +1.0f, 0.0f, 1.0f,
+ -1.0f, +1.0f, 0.0f, 1.0f,
+ };
- m_bufferSubd[BUFFER_SUBD] = bgfx::createDynamicIndexBuffer(
- bufferCapacity
- , BGFX_BUFFER_COMPUTE_READ_WRITE | BGFX_BUFFER_INDEX32
- );
+ const uint32_t indices[] = { 0, 1, 3, 2, 3, 1 };
- m_bufferSubd[BUFFER_SUBD + 1] = bgfx::createDynamicIndexBuffer(
- bufferCapacity
- , BGFX_BUFFER_COMPUTE_READ_WRITE | BGFX_BUFFER_INDEX32
- );
-
- m_bufferCulledSubd = bgfx::createDynamicIndexBuffer(
- bufferCapacity
- , BGFX_BUFFER_COMPUTE_READ_WRITE | BGFX_BUFFER_INDEX32
- );
- }
+ m_geometryLayout.begin().add(bgfx::Attrib::Position, 4, bgfx::AttribType::Float).end();
- /**
- * Load All Buffers
- *
- */
- void loadBuffers()
- {
- loadSubdivisionBuffers();
- loadGeometryBuffers();
- loadInstancedGeometryBuffers();
- }
+ m_geometryVertices = bgfx::createVertexBuffer(
+ bgfx::copy(vertices, sizeof(vertices) )
+ , m_geometryLayout
+ , BGFX_BUFFER_COMPUTE_READ
+ );
+ m_geometryIndices = bgfx::createIndexBuffer(
+ bgfx::copy(indices, sizeof(indices) )
+ , BGFX_BUFFER_COMPUTE_READ | BGFX_BUFFER_INDEX32
+ );
+ }
- /**
- * This will be used to instantiate a triangle grid for each subdivision
- * key present in the subd buffer.
+ void loadSubdivisionBuffers()
+ {
+ const uint32_t bufferCapacity = 1 << 27;
+
+ m_bufferSubd[BUFFER_SUBD] = bgfx::createDynamicIndexBuffer(
+ bufferCapacity
+ , BGFX_BUFFER_COMPUTE_READ_WRITE | BGFX_BUFFER_INDEX32
+ );
+
+ m_bufferSubd[BUFFER_SUBD + 1] = bgfx::createDynamicIndexBuffer(
+ bufferCapacity
+ , BGFX_BUFFER_COMPUTE_READ_WRITE | BGFX_BUFFER_INDEX32
+ );
+
+ m_bufferCulledSubd = bgfx::createDynamicIndexBuffer(
+ bufferCapacity
+ , BGFX_BUFFER_COMPUTE_READ_WRITE | BGFX_BUFFER_INDEX32
+ );
+ }
+
+ /**
+ * Load All Buffers
+ *
*/
- void loadInstancedGeometryBuffers()
- {
- const float* vertices;
- const uint32_t* indexes;
+ void loadBuffers()
+ {
+ loadSubdivisionBuffers();
+ loadGeometryBuffers();
+ loadInstancedGeometryBuffers();
+ }
+
+ /**
+ * This will be used to instantiate a triangle grid for each subdivision
+ * key present in the subd buffer.
+ */
+ void loadInstancedGeometryBuffers()
+ {
+ const float* vertices;
+ const uint32_t* indexes;
- switch (int32_t(m_uniforms.gpuSubd) )
- {
- case 0:
- m_instancedMeshVertexCount = 3;
- m_instancedMeshPrimitiveCount = 1;
- vertices = s_verticesL0;
- indexes = s_indexesL0;
- break;
-
- case 1:
- m_instancedMeshVertexCount = 6;
- m_instancedMeshPrimitiveCount = 4;
- vertices = s_verticesL1;
- indexes = s_indexesL1;
- break;
-
- case 2:
- m_instancedMeshVertexCount = 15;
- m_instancedMeshPrimitiveCount = 16;
- vertices = s_verticesL2;
- indexes = s_indexesL2;
- break;
-
- default:
- m_instancedMeshVertexCount = 45;
- m_instancedMeshPrimitiveCount = 64;
- vertices = s_verticesL3;
- indexes = s_indexesL3;
- break;
- }
+ switch (int32_t(m_uniforms.gpuSubd) )
+ {
+ case 0:
+ m_instancedMeshVertexCount = 3;
+ m_instancedMeshPrimitiveCount = 1;
+ vertices = s_verticesL0;
+ indexes = s_indexesL0;
+ break;
+
+ case 1:
+ m_instancedMeshVertexCount = 6;
+ m_instancedMeshPrimitiveCount = 4;
+ vertices = s_verticesL1;
+ indexes = s_indexesL1;
+ break;
+
+ case 2:
+ m_instancedMeshVertexCount = 15;
+ m_instancedMeshPrimitiveCount = 16;
+ vertices = s_verticesL2;
+ indexes = s_indexesL2;
+ break;
+
+ default:
+ m_instancedMeshVertexCount = 45;
+ m_instancedMeshPrimitiveCount = 64;
+ vertices = s_verticesL3;
+ indexes = s_indexesL3;
+ break;
+ }
- m_instancedGeometryLayout
- .begin()
- .add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)
- .end();
+ m_instancedGeometryLayout
+ .begin()
+ .add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)
+ .end();
- m_instancedGeometryVertices = bgfx::createVertexBuffer(
- bgfx::makeRef(vertices, sizeof(float) * 2 * m_instancedMeshVertexCount)
- , m_instancedGeometryLayout
- );
+ m_instancedGeometryVertices = bgfx::createVertexBuffer(
+ bgfx::makeRef(vertices, sizeof(float) * 2 * m_instancedMeshVertexCount)
+ , m_instancedGeometryLayout
+ );
- m_instancedGeometryIndices = bgfx::createIndexBuffer(
- bgfx::makeRef(indexes, sizeof(uint32_t) * m_instancedMeshPrimitiveCount * 3)
- , BGFX_BUFFER_INDEX32
- );
- }
+ m_instancedGeometryIndices = bgfx::createIndexBuffer(
+ bgfx::makeRef(indexes, sizeof(uint32_t) * m_instancedMeshPrimitiveCount * 3)
+ , BGFX_BUFFER_INDEX32
+ );
+ }
- Uniforms m_uniforms;
+ Uniforms m_uniforms;
- bgfx::ProgramHandle m_programsCompute[PROGRAM_COUNT];
- bgfx::ProgramHandle m_programsDraw[SHADING_COUNT];
- bgfx::TextureHandle m_textures[TEXTURE_COUNT];
- bgfx::UniformHandle m_samplers[SAMPLER_COUNT];
+ bgfx::ProgramHandle m_programsCompute[PROGRAM_COUNT];
+ bgfx::ProgramHandle m_programsDraw[SHADING_COUNT];
+ bgfx::TextureHandle m_textures[TEXTURE_COUNT];
+ bgfx::UniformHandle m_samplers[SAMPLER_COUNT];
- bgfx::DynamicIndexBufferHandle m_bufferSubd[2];
- bgfx::DynamicIndexBufferHandle m_bufferCulledSubd;
+ bgfx::DynamicIndexBufferHandle m_bufferSubd[2];
+ bgfx::DynamicIndexBufferHandle m_bufferCulledSubd;
- bgfx::DynamicIndexBufferHandle m_bufferCounter;
+ bgfx::DynamicIndexBufferHandle m_bufferCounter;
- bgfx::IndexBufferHandle m_geometryIndices;
- bgfx::VertexBufferHandle m_geometryVertices;
- bgfx::VertexLayout m_geometryLayout;
+ bgfx::IndexBufferHandle m_geometryIndices;
+ bgfx::VertexBufferHandle m_geometryVertices;
+ bgfx::VertexLayout m_geometryLayout;
- bgfx::IndexBufferHandle m_instancedGeometryIndices;
- bgfx::VertexBufferHandle m_instancedGeometryVertices;
- bgfx::VertexLayout m_instancedGeometryLayout;
+ bgfx::IndexBufferHandle m_instancedGeometryIndices;
+ bgfx::VertexBufferHandle m_instancedGeometryVertices;
+ bgfx::VertexLayout m_instancedGeometryLayout;
- bgfx::IndirectBufferHandle m_dispatchIndirect;
+ bgfx::IndirectBufferHandle m_dispatchIndirect;
- bimg::ImageContainer* dmap;
+ bimg::ImageContainer* dmap;
- float m_viewMtx[16];
- float m_projMtx[16];
+ float m_viewMtx[16];
+ float m_projMtx[16];
- uint32_t m_width;
- uint32_t m_height;
- uint32_t m_debug;
- uint32_t m_reset;
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
- uint32_t m_oldWidth;
- uint32_t m_oldHeight;
- uint32_t m_oldReset;
+ uint32_t m_oldWidth;
+ uint32_t m_oldHeight;
+ uint32_t m_oldReset;
- uint32_t m_instancedMeshVertexCount;
- uint32_t m_instancedMeshPrimitiveCount;
+ uint32_t m_instancedMeshVertexCount;
+ uint32_t m_instancedMeshPrimitiveCount;
- entry::MouseState m_mouseState;
+ entry::MouseState m_mouseState;
- int64_t m_timeOffset;
+ int64_t m_timeOffset;
- struct DMap
- {
- bx::FilePath pathToFile;
- float scale;
- };
+ struct DMap
+ {
+ bx::FilePath pathToFile;
+ float scale;
+ };
- DMap m_dmap;
+ DMap m_dmap;
- int m_computeThreadCount;
- int m_shading;
- int m_gpuSubd;
- int m_pingPong;
+ int m_computeThreadCount;
+ int m_shading;
+ int m_gpuSubd;
+ int m_pingPong;
- float m_primitivePixelLengthTarget;
- float m_fovy;
+ float m_primitivePixelLengthTarget;
+ float m_fovy;
- bool m_restart;
- bool m_wireframe;
- bool m_cull;
- bool m_freeze;
- };
+ bool m_restart;
+ bool m_wireframe;
+ bool m_cull;
+ bool m_freeze;
+};
} // namespace
diff --git a/3rdparty/bgfx/examples/42-bunnylod/bunnylod.cpp b/3rdparty/bgfx/examples/42-bunnylod/bunnylod.cpp
index a3738095c43..bd44b1f8e82 100644
--- a/3rdparty/bgfx/examples/42-bunnylod/bunnylod.cpp
+++ b/3rdparty/bgfx/examples/42-bunnylod/bunnylod.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bx/easing.h>
@@ -65,19 +65,27 @@ public:
}
}
+ static void remapIndices(uint32_t* _indices, uint32_t _num)
+ {
+ uint32_t target = 0;
+ for (uint32_t i = 0; i < _num; i++) {
+ uint32_t map = _indices[i];
+ if (i != map) {
+ _indices[i] = _indices[map];
+ } else {
+ _indices[i] = target;
+ ++target;
+ }
+ }
+ }
+
static const bgfx::Memory* mergeVertices(const uint8_t* _vb, uint16_t _stride, const uint32_t* _indices, uint32_t _num, uint32_t _numMerged)
{
const bgfx::Memory* mem = bgfx::alloc(_stride * _numMerged);
- uint32_t target = 0;
-
for (uint32_t ii = 0; ii < _num; ++ii)
{
- if (_indices[ii] == target)
- {
- bx::memCopy(mem->data + target*_stride, _vb + ii*_stride, _stride);
- ++target;
- }
+ bx::memCopy(mem->data + _indices[ii]*_stride, _vb + ii*_stride, _stride);
}
return mem;
@@ -143,6 +151,7 @@ public:
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);
}
const bgfx::Memory* vb = mergeVertices(
@@ -188,21 +197,25 @@ public:
m_cachePermutation = NULL;
m_originalVertices = 0;
+ bx::Error err;
+
bx::FileReader reader;
if (bx::open(&reader, kCacheFilePath) )
{
- bx::read(&reader, m_originalVertices);
- bx::read(&reader, m_totalVertices);
+ 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) );
- bx::read(&reader, m_cacheWeld, 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) );
- bx::read(&reader, m_cachePermutation, 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) );
- if (bx::read(&reader, m_map, m_totalVertices * sizeof(uint32_t) ) != int32_t(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);
@@ -225,11 +238,14 @@ public:
if (bx::open(&writer, kCacheFilePath) )
{
- bx::write(&writer, m_originalVertices);
- bx::write(&writer, m_totalVertices);
- bx::write(&writer, m_cacheWeld, m_originalVertices * sizeof(uint32_t) );
- bx::write(&writer, m_cachePermutation, m_totalVertices * sizeof(uint32_t) );
- bx::write(&writer, m_map, m_totalVertices * sizeof(uint32_t) );
+ bx::Error err;
+
+ bx::write(&writer, m_originalVertices, &err);
+ bx::write(&writer, m_totalVertices, &err);
+ bx::write(&writer, m_cacheWeld, m_originalVertices * sizeof(uint32_t), &err);
+ bx::write(&writer, m_cachePermutation, m_totalVertices * sizeof(uint32_t), &err);
+ bx::write(&writer, m_map, m_totalVertices * sizeof(uint32_t), &err);
+
bx::close(&writer);
}
}
@@ -246,6 +262,8 @@ public:
bgfx::Init init;
init.type = args.m_type;
init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
diff --git a/3rdparty/bgfx/examples/42-bunnylod/fs_bunnylod.sc b/3rdparty/bgfx/examples/42-bunnylod/fs_bunnylod.sc
index 64aba2d8ae9..3e8f850e34a 100644
--- a/3rdparty/bgfx/examples/42-bunnylod/fs_bunnylod.sc
+++ b/3rdparty/bgfx/examples/42-bunnylod/fs_bunnylod.sc
@@ -1,8 +1,8 @@
$input v_world, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/42-bunnylod/makefile b/3rdparty/bgfx/examples/42-bunnylod/makefile
index a88986ef6d2..19c81e43692 100644
--- a/3rdparty/bgfx/examples/42-bunnylod/makefile
+++ b/3rdparty/bgfx/examples/42-bunnylod/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/42-bunnylod/progmesh.c b/3rdparty/bgfx/examples/42-bunnylod/progmesh.c
index 9eeb9496aae..2738c0999c6 100644
--- a/3rdparty/bgfx/examples/42-bunnylod/progmesh.c
+++ b/3rdparty/bgfx/examples/42-bunnylod/progmesh.c
@@ -138,7 +138,8 @@ static void
array_push(struct array *a, int v) {
if (a->n >= a->cap) {
int *old = a->buffer;
- a->buffer = (int *)malloc(a->cap * 2 * sizeof(int));
+ a->cap *= 2;
+ a->buffer = (int *)malloc(a->cap * sizeof(int));
int i;
for (i=0;i<a->n;i++) {
a->buffer[i] = old[i];
@@ -495,7 +496,7 @@ Collapse(struct mesh *M, int uid, int vid) {
static struct vertex *
MinimumCostEdge(struct mesh *M) {
// Find the edge that when collapsed will affect model the least.
- // This funtion actually returns a Vertex, the second vertex
+ // This function actually returns a Vertex, the second vertex
// of the edge (collapse candidate) is stored in the vertex data.
// Serious optimization opportunity here: this function currently
// does a sequential search through an unsorted Array :-(
diff --git a/3rdparty/bgfx/examples/42-bunnylod/vs_bunnylod.sc b/3rdparty/bgfx/examples/42-bunnylod/vs_bunnylod.sc
index 1279d3ee370..74209e35239 100644
--- a/3rdparty/bgfx/examples/42-bunnylod/vs_bunnylod.sc
+++ b/3rdparty/bgfx/examples/42-bunnylod/vs_bunnylod.sc
@@ -2,8 +2,8 @@ $input a_position, a_normal
$output v_world, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/43-denoise/denoise.cpp b/3rdparty/bgfx/examples/43-denoise/denoise.cpp
index 6c8f0bda09c..3c9c2ef299b 100644
--- a/3rdparty/bgfx/examples/43-denoise/denoise.cpp
+++ b/3rdparty/bgfx/examples/43-denoise/denoise.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2021 elven cache. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -249,9 +249,10 @@ public:
m_reset = BGFX_RESET_VSYNC;
bgfx::Init init;
- init.type = args.m_type;
-
- init.vendorId = args.m_pciId;
+ init.type = args.m_type;
+ init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = m_width;
init.resolution.height = m_height;
init.resolution.reset = m_reset;
@@ -823,7 +824,7 @@ public:
ImGui::Combo("spatial sample extent", &m_spatialSampleType, "three\0five\0\0");
if (ImGui::IsItemHovered() )
{
- ImGui::SetTooltip("select 3x3 or 5x5 filter kernal");
+ ImGui::SetTooltip("select 3x3 or 5x5 filter kernel");
}
ImGui::SliderFloat("sigma z", &m_sigmaDepth, 0.0f, 0.1f, "%.5f");
@@ -1061,7 +1062,7 @@ public:
// Shader uniforms
Uniforms m_uniforms;
- // Uniforms to indentify texture samplers
+ // Uniforms to identify texture samplers
bgfx::UniformHandle s_albedo;
bgfx::UniformHandle s_color;
bgfx::UniformHandle s_normal;
diff --git a/3rdparty/bgfx/examples/43-denoise/fs_denoise_apply_lighting.sc b/3rdparty/bgfx/examples/43-denoise/fs_denoise_apply_lighting.sc
index 3b0b4427a0e..118b4273f63 100644
--- a/3rdparty/bgfx/examples/43-denoise/fs_denoise_apply_lighting.sc
+++ b/3rdparty/bgfx/examples/43-denoise/fs_denoise_apply_lighting.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/43-denoise/fs_denoise_copy.sc b/3rdparty/bgfx/examples/43-denoise/fs_denoise_copy.sc
index 5cba19feae0..aa835a07a3f 100644
--- a/3rdparty/bgfx/examples/43-denoise/fs_denoise_copy.sc
+++ b/3rdparty/bgfx/examples/43-denoise/fs_denoise_copy.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/43-denoise/fs_denoise_deferred_combine.sc b/3rdparty/bgfx/examples/43-denoise/fs_denoise_deferred_combine.sc
index 51a39978dcc..3aeeaa4da78 100644
--- a/3rdparty/bgfx/examples/43-denoise/fs_denoise_deferred_combine.sc
+++ b/3rdparty/bgfx/examples/43-denoise/fs_denoise_deferred_combine.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_3x3.sc b/3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_3x3.sc
index 1cf0075fed3..fc89ece5063 100644
--- a/3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_3x3.sc
+++ b/3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_3x3.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
// don't use 5x5 sample pattern for spatial denoise, use 3x3 instead
diff --git a/3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_5x5.sc b/3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_5x5.sc
index f9d36eb0a9f..3656f7ee2b5 100644
--- a/3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_5x5.sc
+++ b/3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_5x5.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
// use 5x5 sample pattern for spatial denoise
diff --git a/3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_implementation.sh b/3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_implementation.sh
index 8cfde98d9b9..e04a91bb9a5 100644
--- a/3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_implementation.sh
+++ b/3rdparty/bgfx/examples/43-denoise/fs_denoise_spatial_implementation.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef FS_DENOISE_SPATIAL_IMPLEMENTATION_SH
diff --git a/3rdparty/bgfx/examples/43-denoise/fs_denoise_temporal.sc b/3rdparty/bgfx/examples/43-denoise/fs_denoise_temporal.sc
index dcd513bdf03..63f2f22acdc 100644
--- a/3rdparty/bgfx/examples/43-denoise/fs_denoise_temporal.sc
+++ b/3rdparty/bgfx/examples/43-denoise/fs_denoise_temporal.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/43-denoise/fs_denoise_txaa.sc b/3rdparty/bgfx/examples/43-denoise/fs_denoise_txaa.sc
index 025f055435d..d4cdc82ec30 100644
--- a/3rdparty/bgfx/examples/43-denoise/fs_denoise_txaa.sc
+++ b/3rdparty/bgfx/examples/43-denoise/fs_denoise_txaa.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/43-denoise/makefile b/3rdparty/bgfx/examples/43-denoise/makefile
index ef9203197d7..f9e23de2e08 100644
--- a/3rdparty/bgfx/examples/43-denoise/makefile
+++ b/3rdparty/bgfx/examples/43-denoise/makefile
@@ -1,6 +1,6 @@
#
# Copyright 2011-2019 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/43-denoise/normal_encoding.sh b/3rdparty/bgfx/examples/43-denoise/normal_encoding.sh
index 98ff30f8bbc..231cdae01b4 100644
--- a/3rdparty/bgfx/examples/43-denoise/normal_encoding.sh
+++ b/3rdparty/bgfx/examples/43-denoise/normal_encoding.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef NORMAL_ENCODING_SH
diff --git a/3rdparty/bgfx/examples/43-denoise/parameters.sh b/3rdparty/bgfx/examples/43-denoise/parameters.sh
index be248e744f4..11e5a44bcf9 100644
--- a/3rdparty/bgfx/examples/43-denoise/parameters.sh
+++ b/3rdparty/bgfx/examples/43-denoise/parameters.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef PARAMETERS_SH
diff --git a/3rdparty/bgfx/examples/43-denoise/shared_functions.sh b/3rdparty/bgfx/examples/43-denoise/shared_functions.sh
index 5fd817856be..21793ae3678 100644
--- a/3rdparty/bgfx/examples/43-denoise/shared_functions.sh
+++ b/3rdparty/bgfx/examples/43-denoise/shared_functions.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef SHARED_FUNCTIONS_SH
diff --git a/3rdparty/bgfx/examples/43-denoise/vs_denoise_gbuffer.sc b/3rdparty/bgfx/examples/43-denoise/vs_denoise_gbuffer.sc
index f7bd254279d..bed6c25ca75 100644
--- a/3rdparty/bgfx/examples/43-denoise/vs_denoise_gbuffer.sc
+++ b/3rdparty/bgfx/examples/43-denoise/vs_denoise_gbuffer.sc
@@ -3,7 +3,7 @@ $output v_normal, v_texcoord0, v_texcoord1, v_texcoord2, v_texcoord3
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/44-sss/fs_screen_space_shadows.sc b/3rdparty/bgfx/examples/44-sss/fs_screen_space_shadows.sc
index 746006736ef..cf2a898342f 100644
--- a/3rdparty/bgfx/examples/44-sss/fs_screen_space_shadows.sc
+++ b/3rdparty/bgfx/examples/44-sss/fs_screen_space_shadows.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/44-sss/fs_sss_deferred_combine.sc b/3rdparty/bgfx/examples/44-sss/fs_sss_deferred_combine.sc
index a4df5a23abd..fb724819c1d 100644
--- a/3rdparty/bgfx/examples/44-sss/fs_sss_deferred_combine.sc
+++ b/3rdparty/bgfx/examples/44-sss/fs_sss_deferred_combine.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/44-sss/fs_sss_linear_depth.sc b/3rdparty/bgfx/examples/44-sss/fs_sss_linear_depth.sc
index c7ae391c8f2..08a31ccdc85 100644
--- a/3rdparty/bgfx/examples/44-sss/fs_sss_linear_depth.sc
+++ b/3rdparty/bgfx/examples/44-sss/fs_sss_linear_depth.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/44-sss/makefile b/3rdparty/bgfx/examples/44-sss/makefile
index ef9203197d7..f9e23de2e08 100644
--- a/3rdparty/bgfx/examples/44-sss/makefile
+++ b/3rdparty/bgfx/examples/44-sss/makefile
@@ -1,6 +1,6 @@
#
# Copyright 2011-2019 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/44-sss/normal_encoding.sh b/3rdparty/bgfx/examples/44-sss/normal_encoding.sh
index 63ade43f84f..c83b95753da 100644
--- a/3rdparty/bgfx/examples/44-sss/normal_encoding.sh
+++ b/3rdparty/bgfx/examples/44-sss/normal_encoding.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef NORMAL_ENCODING_SH
diff --git a/3rdparty/bgfx/examples/44-sss/parameters.sh b/3rdparty/bgfx/examples/44-sss/parameters.sh
index f35fd11f857..47540490217 100644
--- a/3rdparty/bgfx/examples/44-sss/parameters.sh
+++ b/3rdparty/bgfx/examples/44-sss/parameters.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef PARAMETERS_SH
diff --git a/3rdparty/bgfx/examples/44-sss/screen_space_shadows.cpp b/3rdparty/bgfx/examples/44-sss/screen_space_shadows.cpp
index 24bcbc5ad2f..7a142baa373 100644
--- a/3rdparty/bgfx/examples/44-sss/screen_space_shadows.cpp
+++ b/3rdparty/bgfx/examples/44-sss/screen_space_shadows.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -261,12 +261,13 @@ public:
m_reset = BGFX_RESET_VSYNC;
bgfx::Init init;
- init.type = args.m_type;
-
+ init.type = args.m_type;
init.vendorId = args.m_pciId;
- init.resolution.width = m_width;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
+ init.resolution.width = m_width;
init.resolution.height = m_height;
- init.resolution.reset = m_reset;
+ init.resolution.reset = m_reset;
bgfx::init(init);
// Enable debug text.
@@ -276,10 +277,10 @@ public:
m_uniforms.init();
// Create texture sampler uniforms (used when we bind textures)
- s_albedo = bgfx::createUniform("s_albedo", bgfx::UniformType::Sampler); // Model's source albedo
- s_color = bgfx::createUniform("s_color", bgfx::UniformType::Sampler); // Color (albedo) gbuffer, default color input
- s_normal = bgfx::createUniform("s_normal", bgfx::UniformType::Sampler); // Normal gbuffer, Model's source normal
- s_depth = bgfx::createUniform("s_depth", bgfx::UniformType::Sampler); // Depth gbuffer
+ s_albedo = bgfx::createUniform("s_albedo", bgfx::UniformType::Sampler); // Model's source albedo
+ s_color = bgfx::createUniform("s_color", bgfx::UniformType::Sampler); // Color (albedo) gbuffer, default color input
+ s_normal = bgfx::createUniform("s_normal", bgfx::UniformType::Sampler); // Normal gbuffer, Model's source normal
+ s_depth = bgfx::createUniform("s_depth", bgfx::UniformType::Sampler); // Depth gbuffer
s_shadows = bgfx::createUniform("s_shadows", bgfx::UniformType::Sampler);
// Create program from shaders.
@@ -382,7 +383,8 @@ public:
if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState))
{
// skip processing when minimized, otherwise crashing
- if (0 == m_width || 0 == m_height)
+ if (0 == m_width
+ || 0 == m_height)
{
return true;
}
@@ -787,7 +789,7 @@ public:
// Shader uniforms
Uniforms m_uniforms;
- // Uniforms to indentify texture samplers
+ // Uniforms to identify texture samplers
bgfx::UniformHandle s_albedo;
bgfx::UniformHandle s_color;
bgfx::UniformHandle s_normal;
diff --git a/3rdparty/bgfx/examples/44-sss/vs_sss_gbuffer.sc b/3rdparty/bgfx/examples/44-sss/vs_sss_gbuffer.sc
index 3cd3efef1c5..f42d1b78c12 100644
--- a/3rdparty/bgfx/examples/44-sss/vs_sss_gbuffer.sc
+++ b/3rdparty/bgfx/examples/44-sss/vs_sss_gbuffer.sc
@@ -3,7 +3,7 @@ $output v_normal, v_texcoord0, v_texcoord1
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/45-bokeh/bokeh.cpp b/3rdparty/bgfx/examples/45-bokeh/bokeh.cpp
index 7a53d359b25..b1ed78f4240 100644
--- a/3rdparty/bgfx/examples/45-bokeh/bokeh.cpp
+++ b/3rdparty/bgfx/examples/45-bokeh/bokeh.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -243,12 +243,13 @@ public:
m_reset = BGFX_RESET_VSYNC;
bgfx::Init init;
- init.type = args.m_type;
-
+ init.type = args.m_type;
init.vendorId = args.m_pciId;
- init.resolution.width = m_width;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
+ init.resolution.width = m_width;
init.resolution.height = m_height;
- init.resolution.reset = m_reset;
+ init.resolution.reset = m_reset;
bgfx::init(init);
// Enable debug text.
@@ -904,9 +905,9 @@ public:
{
bgfx::destroy(m_bokehTexture);
}
- BX_ASSERT(0 < _lobeCount);
+ BX_ASSERT(0 < _lobeCount, "");
- const uint32_t bokehSize = 128;
+ const int32_t bokehSize = 128;
const bgfx::Memory* mem = bgfx::alloc(bokehSize*bokehSize*4);
bx::memSet(mem->data, 0x00, bokehSize*bokehSize*4);
@@ -926,8 +927,7 @@ public:
// apply shape to circular distribution
const float shapeScale = bokehShapeFromAngle(_lobeCount, _lobeRadiusMin, radiusDelta2x, _lobeRotation, theta);
- BX_ASSERT(_lobeRadiusMin <= shapeScale);
- BX_ASSERT(shapeScale <= _maxRadius);
+ BX_ASSERT(_lobeRadiusMin <= shapeScale, "");
float spiralCoordX = bx::cos(theta) * (radius * shapeScale);
float spiralCoordY = bx::sin(theta) * (radius * shapeScale);
@@ -941,10 +941,10 @@ public:
int32_t pixelCoordX = int32_t(bx::floor(spiralCoordX * float(bokehSize-1) + 0.5f));
int32_t pixelCoordY = int32_t(bx::floor(spiralCoordY * float(bokehSize-1) + 0.5f));
- BX_ASSERT(0 <= pixelCoordX);
- BX_ASSERT(0 <= pixelCoordY);
- BX_ASSERT(pixelCoordX < bokehSize);
- BX_ASSERT(pixelCoordY < bokehSize);
+ BX_ASSERT(0 <= pixelCoordX, "");
+ BX_ASSERT(0 <= pixelCoordY, "");
+ BX_ASSERT(pixelCoordX < bokehSize, "");
+ BX_ASSERT(pixelCoordY < bokehSize, "");
// plot sample position, track for total samples
uint32_t offset = (pixelCoordY * bokehSize + pixelCoordX) * 4;
@@ -994,7 +994,7 @@ public:
PassUniforms m_uniforms;
ModelUniforms m_modelUniforms;
- // Uniforms to indentify texture samplers
+ // Uniforms to identify texture samplers
bgfx::UniformHandle s_albedo;
bgfx::UniformHandle s_color;
bgfx::UniformHandle s_normal;
diff --git a/3rdparty/bgfx/examples/45-bokeh/bokeh_dof.sh b/3rdparty/bgfx/examples/45-bokeh/bokeh_dof.sh
index 68d04749b06..43c4885d1d3 100644
--- a/3rdparty/bgfx/examples/45-bokeh/bokeh_dof.sh
+++ b/3rdparty/bgfx/examples/45-bokeh/bokeh_dof.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BOKEH_DOF_SH
diff --git a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_copy.sc b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_copy.sc
index 5cba19feae0..aa835a07a3f 100644
--- a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_copy.sc
+++ b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_copy.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_copy_linear_to_gamma.sc b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_copy_linear_to_gamma.sc
index b9442278570..aacc360d795 100644
--- a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_copy_linear_to_gamma.sc
+++ b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_copy_linear_to_gamma.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_combine.sc b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_combine.sc
index 28405613e6a..b60f7572502 100644
--- a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_combine.sc
+++ b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_combine.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_debug.sc b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_debug.sc
index 717f127a4c0..6a85b359fda 100644
--- a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_debug.sc
+++ b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_debug.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_downsample.sc b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_downsample.sc
index e48bfe896e9..8df24c24e11 100644
--- a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_downsample.sc
+++ b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_downsample.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_second_pass.sc b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_second_pass.sc
index 630ab260383..43797b0571a 100644
--- a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_second_pass.sc
+++ b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_second_pass.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_single_pass.sc b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_single_pass.sc
index eed18fa2082..b74940db464 100644
--- a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_single_pass.sc
+++ b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_dof_single_pass.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_forward.sc b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_forward.sc
index 3e90a632ab7..2ad870f481a 100644
--- a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_forward.sc
+++ b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_forward.sc
@@ -2,7 +2,7 @@ $input v_normal, v_texcoord0, v_texcoord1, v_texcoord2
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_forward_grid.sc b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_forward_grid.sc
index 77d167f81da..db5fd56f9c7 100644
--- a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_forward_grid.sc
+++ b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_forward_grid.sc
@@ -2,7 +2,7 @@ $input v_normal, v_texcoord0, v_texcoord1, v_texcoord2
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_linear_depth.sc b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_linear_depth.sc
index c7ae391c8f2..08a31ccdc85 100644
--- a/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_linear_depth.sc
+++ b/3rdparty/bgfx/examples/45-bokeh/fs_bokeh_linear_depth.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/45-bokeh/makefile b/3rdparty/bgfx/examples/45-bokeh/makefile
index ef9203197d7..f9e23de2e08 100644
--- a/3rdparty/bgfx/examples/45-bokeh/makefile
+++ b/3rdparty/bgfx/examples/45-bokeh/makefile
@@ -1,6 +1,6 @@
#
# Copyright 2011-2019 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
BGFX_DIR=../..
diff --git a/3rdparty/bgfx/examples/45-bokeh/parameters.sh b/3rdparty/bgfx/examples/45-bokeh/parameters.sh
index ebeac710146..f8d72acedb8 100644
--- a/3rdparty/bgfx/examples/45-bokeh/parameters.sh
+++ b/3rdparty/bgfx/examples/45-bokeh/parameters.sh
@@ -1,6 +1,6 @@
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef PARAMETERS_SH
diff --git a/3rdparty/bgfx/examples/45-bokeh/vs_bokeh_forward.sc b/3rdparty/bgfx/examples/45-bokeh/vs_bokeh_forward.sc
index 11e4bf6ad06..d7a48221041 100644
--- a/3rdparty/bgfx/examples/45-bokeh/vs_bokeh_forward.sc
+++ b/3rdparty/bgfx/examples/45-bokeh/vs_bokeh_forward.sc
@@ -3,7 +3,7 @@ $output v_normal, v_texcoord0, v_texcoord1, v_texcoord2
/*
* Copyright 2021 elven cache. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common/common.sh"
diff --git a/3rdparty/bgfx/examples/46-fsr/app.cpp b/3rdparty/bgfx/examples/46-fsr/app.cpp
new file mode 100644
index 00000000000..4049d3e1e7e
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/app.cpp
@@ -0,0 +1,858 @@
+/*
+ * Copyright 2021 Richard Schubert. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ *
+ * AMD FidelityFX Super Resolution 1.0 (FSR)
+ * Based on https://github.com/GPUOpen-Effects/FidelityFX-FSR/blob/master/sample/
+ */
+
+#include <common.h>
+#include <camera.h>
+#include <bgfx_utils.h>
+#include <imgui/imgui.h>
+#include <bx/rng.h>
+#include <bx/os.h>
+
+#include "fsr.h"
+
+namespace
+{
+
+#define FRAMEBUFFER_RT_COLOR 0
+#define FRAMEBUFFER_RT_DEPTH 1
+#define FRAMEBUFFER_RENDER_TARGETS 2
+
+enum Meshes
+{
+ MeshCube = 0,
+ MeshHollowCube,
+};
+
+static const char *s_meshPaths[] =
+{
+ "meshes/cube.bin",
+ "meshes/hollowcube.bin",
+};
+
+static const float s_meshScale[] =
+{
+ 0.45f,
+ 0.30f,
+};
+
+// Vertex decl for our screen space quad (used in deferred rendering)
+struct PosTexCoord0Vertex
+{
+ float m_x;
+ float m_y;
+ float m_z;
+ float m_u;
+ float m_v;
+
+ static void init()
+ {
+ ms_layout
+ .begin()
+ .add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)
+ .add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)
+ .end();
+ }
+
+ static bgfx::VertexLayout ms_layout;
+};
+
+bgfx::VertexLayout PosTexCoord0Vertex::ms_layout;
+
+void screenSpaceTriangle(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f, float _offsetX = 0.0f, float _offsetY = 0.0f)
+{
+ if (3 == bgfx::getAvailTransientVertexBuffer(3, PosTexCoord0Vertex::ms_layout) )
+ {
+ bgfx::TransientVertexBuffer vb;
+ bgfx::allocTransientVertexBuffer(&vb, 3, PosTexCoord0Vertex::ms_layout);
+ PosTexCoord0Vertex *vertex = (PosTexCoord0Vertex *)vb.data;
+
+ const float minx = -_width - _offsetX;
+ const float maxx = _width - _offsetX;
+ const float miny = 0.0f - _offsetY;
+ const float maxy = _height * 2.0f - _offsetY;
+
+ const float texelHalfW = _texelHalf / _textureWidth;
+ const float texelHalfH = _texelHalf / _textureHeight;
+ const float minu = -1.0f + texelHalfW;
+ const float maxu = 1.0f + texelHalfW;
+
+ const float zz = 0.0f;
+
+ float minv = texelHalfH;
+ float maxv = 2.0f + texelHalfH;
+
+ if (_originBottomLeft)
+ {
+ float temp = minv;
+ minv = maxv;
+ maxv = temp;
+
+ minv -= 1.0f;
+ maxv -= 1.0f;
+ }
+
+ vertex[0].m_x = minx;
+ vertex[0].m_y = miny;
+ vertex[0].m_z = zz;
+ vertex[0].m_u = minu;
+ vertex[0].m_v = minv;
+
+ vertex[1].m_x = maxx;
+ vertex[1].m_y = miny;
+ vertex[1].m_z = zz;
+ vertex[1].m_u = maxu;
+ vertex[1].m_v = minv;
+
+ vertex[2].m_x = maxx;
+ vertex[2].m_y = maxy;
+ vertex[2].m_z = zz;
+ vertex[2].m_u = maxu;
+ vertex[2].m_v = maxv;
+
+ bgfx::setVertexBuffer(0, &vb);
+ }
+}
+
+struct ModelUniforms
+{
+ enum
+ {
+ NumVec4 = 2
+ };
+
+ void init()
+ {
+ u_params = bgfx::createUniform("u_modelParams", bgfx::UniformType::Vec4, NumVec4);
+ };
+
+ void submit() const
+ {
+ bgfx::setUniform(u_params, m_params, NumVec4);
+ };
+
+ void destroy()
+ {
+ bgfx::destroy(u_params);
+ }
+
+ union
+ {
+ struct
+ {
+ /* 0 */ struct
+ {
+ float m_color[3];
+ float m_unused0;
+ };
+ /* 1 */ struct
+ {
+ float m_lightPosition[3];
+ float m_unused1;
+ };
+ };
+
+ float m_params[NumVec4 * 4];
+ };
+
+ bgfx::UniformHandle u_params;
+};
+
+struct AppState
+{
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
+
+ entry::MouseState m_mouseState;
+
+ // Resource handles
+ bgfx::ProgramHandle m_forwardProgram;
+ bgfx::ProgramHandle m_gridProgram;
+ bgfx::ProgramHandle m_copyLinearToGammaProgram;
+
+ // Shader uniforms
+ ModelUniforms m_modelUniforms;
+
+ // Uniforms to identify texture samplers
+ bgfx::UniformHandle s_albedo;
+ bgfx::UniformHandle s_color;
+ bgfx::UniformHandle s_normal;
+
+ bgfx::FrameBufferHandle m_frameBuffer;
+ bgfx::TextureHandle m_frameBufferTex[FRAMEBUFFER_RENDER_TARGETS];
+
+ Mesh *m_meshes[BX_COUNTOF(s_meshPaths)];
+ bgfx::TextureHandle m_groundTexture;
+ bgfx::TextureHandle m_normalTexture;
+
+ uint32_t m_currFrame{UINT32_MAX};
+ float m_lightRotation = 0.0f;
+ float m_texelHalf = 0.0f;
+ float m_fovY = 60.0f;
+ float m_animationTime = 0.0f;
+
+ float m_view[16];
+ float m_proj[16];
+ int32_t m_size[2];
+
+ // UI parameters
+ bool m_renderNativeResolution = false;
+ bool m_animateScene = false;
+ int32_t m_antiAliasingSetting = 2;
+
+ Fsr m_fsr;
+};
+
+struct RenderTarget
+{
+ void init(uint32_t _width, uint32_t _height, bgfx::TextureFormat::Enum _format, uint64_t _flags)
+ {
+ m_width = _width;
+ m_height = _height;
+ m_texture = bgfx::createTexture2D(uint16_t(_width), uint16_t(_height), false, 1, _format, _flags);
+ m_buffer = bgfx::createFrameBuffer(1, &m_texture, true);
+ }
+
+ void destroy()
+ {
+ // also responsible for destroying texture
+ bgfx::destroy(m_buffer);
+ }
+
+ uint32_t m_width;
+ uint32_t m_height;
+ bgfx::TextureHandle m_texture;
+ bgfx::FrameBufferHandle m_buffer;
+};
+
+struct MagnifierWidget
+{
+ void init(uint32_t _width, uint32_t _height)
+ {
+ m_content.init(_width, _height, bgfx::TextureFormat::BGRA8, BGFX_TEXTURE_RT | BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT);
+ createWidgetTexture(_width + 6, _height + 6);
+ }
+
+ void destroy()
+ {
+ bgfx::destroy(m_widgetTexture);
+ m_content.destroy();
+ }
+
+ void setPosition(float x, float y)
+ {
+ m_position.x = x;
+ m_position.y = y;
+ }
+
+ void drawToScreen(bgfx::ViewId &view, AppState const &state)
+ {
+ float invScreenScaleX = 1.0f / float(state.m_width);
+ float invScreenScaleY = 1.0f / float(state.m_height);
+ float scaleX = m_widgetWidth * invScreenScaleX;
+ float scaleY = m_widgetHeight * invScreenScaleY;
+ float offsetX = -bx::min(bx::max(m_position.x - m_widgetWidth * 0.5f, -3.0f), float(state.m_width - m_widgetWidth + 3) ) * invScreenScaleX;
+ float offsetY = -bx::min(bx::max(m_position.y - m_widgetHeight * 0.5f, -3.0f), float(state.m_height - m_widgetHeight + 3) ) * invScreenScaleY;
+
+ bgfx::setState(0 | BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A | BGFX_STATE_DEPTH_TEST_ALWAYS | BGFX_STATE_BLEND_ALPHA);
+ bgfx::setTexture(0, state.s_color, m_widgetTexture);
+ screenSpaceTriangle(float(m_widgetWidth), float(m_widgetHeight), state.m_texelHalf, false, scaleX, scaleY, offsetX, offsetY);
+ bgfx::submit(view, state.m_copyLinearToGammaProgram);
+ }
+
+ void updateContent(bgfx::ViewId &view, AppState const &state, const bgfx::Caps *caps, bgfx::TextureHandle srcTexture)
+ {
+ float orthoProj[16];
+ bx::mtxOrtho(orthoProj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, caps->homogeneousDepth);
+ {
+ // clear out transform stack
+ float identity[16];
+ bx::mtxIdentity(identity);
+ bgfx::setTransform(identity);
+ }
+
+ const float verticalPos = caps->originBottomLeft ? state.m_height - m_position.y : m_position.y;
+ const float invMagScaleX = 1.0f / float(m_content.m_width);
+ const float invMagScaleY = 1.0f / float(m_content.m_height);
+ const float scaleX = state.m_width * invMagScaleX;
+ const float scaleY = state.m_height * invMagScaleY;
+ const float offsetX = bx::min(bx::max(m_position.x - m_content.m_width * 0.5f, 0.0f), float(state.m_width - m_content.m_width) ) * scaleX / state.m_width;
+ const float offsetY = bx::min(bx::max(verticalPos - m_content.m_height * 0.5f, 0.0f), float(state.m_height - m_content.m_height) ) * scaleY / state.m_height;
+
+ bgfx::setViewName(view, "magnifier");
+ bgfx::setViewRect(view, 0, 0, uint16_t(m_content.m_width), uint16_t(m_content.m_height) );
+ bgfx::setViewTransform(view, NULL, orthoProj);
+ bgfx::setViewFrameBuffer(view, m_content.m_buffer);
+ bgfx::setState(0 | BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A);
+ bgfx::setTexture(0, state.s_color, srcTexture, BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP);
+ screenSpaceTriangle(float(state.m_width), float(state.m_height), state.m_texelHalf, false, scaleX, scaleY, offsetX, offsetY);
+ bgfx::submit(view, state.m_copyLinearToGammaProgram);
+ ++view;
+ }
+
+ uint32_t m_widgetWidth{0};
+ uint32_t m_widgetHeight{0};
+ bgfx::TextureHandle m_widgetTexture;
+ RenderTarget m_content;
+ ImVec2 m_position;
+
+private:
+ void createWidgetTexture(uint32_t _width, uint32_t _height)
+ {
+ const bgfx::Memory *mem = bgfx::alloc(_width * _height * sizeof(uint32_t) );
+
+ uint32_t *pixels = (uint32_t*)mem->data;
+ bx::memSet(pixels, 0, mem->size);
+
+ const uint32_t white = 0xFFFFFFFF;
+ const uint32_t black = 0xFF000000;
+
+ const uint32_t y0 = 1;
+ const uint32_t y1 = _height - 3;
+
+ for (uint32_t x = 0; x < _width - 4; x++)
+ {
+ pixels[(y0 + 0) * _width + x + 1] = white;
+ pixels[(y0 + 1) * _width + x + 2] = black;
+ pixels[(y1 + 0) * _width + x + 1] = white;
+ pixels[(y1 + 1) * _width + x + 2] = black;
+ }
+
+ const uint32_t x0 = 1;
+ const uint32_t x1 = _width - 3;
+
+ for (uint32_t y = 0; y < _height - 3; y++)
+ {
+ pixels[(y + 1) * _width + x0 + 0] = white;
+ pixels[(y + 2) * _width + x0 + 1] = black;
+ pixels[(y + 1) * _width + x1 + 0] = white;
+ pixels[(y + 2) * _width + x1 + 1] = black;
+ }
+
+ pixels[(y1 + 0) * _width + 2] = white;
+
+ m_widgetWidth = _width;
+ m_widgetHeight = _height;
+ m_widgetTexture = bgfx::createTexture2D(
+ uint16_t(_width)
+ , uint16_t(_height)
+ , false
+ , 1
+ , bgfx::TextureFormat::BGRA8
+ , BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP
+ , mem
+ );
+ }
+};
+
+class ExampleFsr : public entry::AppI
+{
+public:
+ ExampleFsr(const char *_name, const char *_description)
+ : entry::AppI(_name, _description)
+ {
+ }
+
+ void init(int32_t _argc, const char *const *_argv, uint32_t _width, uint32_t _height) override
+ {
+ Args args(_argc, _argv);
+
+ m_state.m_width = _width;
+ m_state.m_height = _height;
+ m_state.m_debug = BGFX_DEBUG_NONE;
+ m_state.m_reset = 0
+ | BGFX_RESET_VSYNC
+ | BGFX_RESET_MAXANISOTROPY
+ ;
+
+ bgfx::Init init;
+ init.type = args.m_type;
+ init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
+ init.resolution.width = m_state.m_width;
+ init.resolution.height = m_state.m_height;
+ init.resolution.reset = m_state.m_reset;
+ bgfx::init(init);
+
+ // Enable debug text.
+ bgfx::setDebug(m_state.m_debug);
+
+ // Create uniforms for screen passes and models
+ m_state.m_modelUniforms.init();
+
+ // Create texture sampler uniforms (used when we bind textures)
+ m_state.s_albedo = bgfx::createUniform("s_albedo", bgfx::UniformType::Sampler);
+ m_state.s_color = bgfx::createUniform("s_color", bgfx::UniformType::Sampler);
+ m_state.s_normal = bgfx::createUniform("s_normal", bgfx::UniformType::Sampler);
+
+ // Create program from shaders.
+ m_state.m_forwardProgram = loadProgram("vs_fsr_forward", "fs_fsr_forward");
+ m_state.m_gridProgram = loadProgram("vs_fsr_forward", "fs_fsr_forward_grid");
+ m_state.m_copyLinearToGammaProgram = loadProgram("vs_fsr_screenquad", "fs_fsr_copy_linear_to_gamma");
+
+ // Load some meshes
+ for (uint32_t ii = 0; ii < BX_COUNTOF(s_meshPaths); ++ii)
+ {
+ m_state.m_meshes[ii] = meshLoad(s_meshPaths[ii]);
+ }
+
+ m_state.m_groundTexture = loadTexture("textures/fieldstone-rgba.dds");
+ m_state.m_normalTexture = loadTexture("textures/fieldstone-n.dds");
+
+ createFramebuffers();
+
+ // Vertex decl
+ PosTexCoord0Vertex::init();
+
+ // Init camera
+ cameraCreate();
+ cameraSetPosition({-10.0f, 2.5f, -0.0f});
+ cameraSetVerticalAngle(-0.2f);
+ cameraSetHorizontalAngle(0.8f);
+
+ // Init "prev" matrices, will be same for first frame
+ cameraGetViewMtx(m_state.m_view);
+ bx::mtxProj(m_state.m_proj, m_state.m_fovY, float(m_state.m_size[0]) / float(m_state.m_size[1]), 0.01f, 100.0f, bgfx::getCaps()->homogeneousDepth);
+
+ // Get renderer capabilities info.
+ const bgfx::RendererType::Enum renderer = bgfx::getRendererType();
+ m_state.m_texelHalf = bgfx::RendererType::Direct3D9 == renderer ? 0.5f : 0.0f;
+
+ const uint32_t magnifierSize = 32;
+ m_magnifierWidget.init(magnifierSize, magnifierSize);
+ m_magnifierWidget.setPosition(m_state.m_width * 0.5f, m_state.m_height * 0.5f);
+
+ imguiCreate();
+
+ m_state.m_fsr.init(_width, _height);
+ }
+
+ int32_t shutdown() override
+ {
+ m_state.m_fsr.destroy();
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(s_meshPaths); ++ii)
+ {
+ meshUnload(m_state.m_meshes[ii]);
+ }
+
+ bgfx::destroy(m_state.m_normalTexture);
+ bgfx::destroy(m_state.m_groundTexture);
+
+ bgfx::destroy(m_state.m_forwardProgram);
+ bgfx::destroy(m_state.m_gridProgram);
+ bgfx::destroy(m_state.m_copyLinearToGammaProgram);
+
+ m_state.m_modelUniforms.destroy();
+
+ m_magnifierWidget.destroy();
+
+ bgfx::destroy(m_state.s_albedo);
+ bgfx::destroy(m_state.s_color);
+ bgfx::destroy(m_state.s_normal);
+
+ destroyFramebuffers();
+
+ cameraDestroy();
+
+ imguiDestroy();
+
+ bgfx::shutdown();
+
+ return 0;
+ }
+
+ bool update() override
+ {
+ if (!entry::processEvents(m_state.m_width, m_state.m_height, m_state.m_debug, m_state.m_reset, &m_state.m_mouseState) )
+ {
+ // skip processing when minimized, otherwise crashing
+ if (0 == m_state.m_width
+ || 0 == m_state.m_height)
+ {
+ return true;
+ }
+
+ if (m_state.m_mouseState.m_buttons[entry::MouseButton::Left]
+ && !ImGui::MouseOverArea() )
+ {
+ m_magnifierWidget.setPosition(
+ float(m_state.m_mouseState.m_mx)
+ , float(m_state.m_mouseState.m_my)
+ );
+ }
+
+ // Update frame timer
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency() );
+ const float deltaTime = float(frameTime / freq);
+ const bgfx::Caps* caps = bgfx::getCaps();
+
+ if (m_state.m_size[0] != (int32_t)m_state.m_width || m_state.m_size[1] != (int32_t)m_state.m_height)
+ {
+ resize();
+ }
+
+ // update animation time
+ const float rotationSpeed = 0.25f;
+ if (m_state.m_animateScene)
+ {
+ m_state.m_animationTime += deltaTime * rotationSpeed;
+ if (bx::kPi2 < m_state.m_animationTime)
+ {
+ m_state.m_animationTime -= bx::kPi2;
+ }
+ }
+
+ // Update camera
+ cameraUpdate(deltaTime * 0.15f, m_state.m_mouseState, ImGui::MouseOverArea() );
+
+ cameraGetViewMtx(m_state.m_view);
+
+ updateUniforms();
+
+ bx::mtxProj(
+ m_state.m_proj
+ , m_state.m_fovY
+ , float(m_state.m_size[0]) / float(m_state.m_size[1])
+ , 0.01f
+ , 100.0f
+ , caps->homogeneousDepth
+ );
+
+ bgfx::ViewId view = 0;
+
+ // Clear full frame buffer to avoid sampling into garbage during FSR pass
+ if (!m_state.m_renderNativeResolution)
+ {
+ bgfx::setViewRect(view, 0, 0, (uint16_t)m_state.m_width, (uint16_t)m_state.m_height);
+ bgfx::setViewClear(view, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x00000000, 1.0f, 0);
+ bgfx::setViewFrameBuffer(view, m_state.m_frameBuffer);
+ bgfx::touch(view);
+
+ ++view;
+ }
+
+ // Draw models into scene
+ {
+ bgfx::setViewName(view, "forward scene");
+ bgfx::setViewClear(view, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x7fb8ffff, 1.0f, 0);
+
+ const float viewScale = m_state.m_renderNativeResolution
+ ? 1.0f
+ : 1.0f / m_state.m_fsr.m_config.m_superSamplingFactor
+ ;
+ const uint16_t viewRectWidth = uint16_t(bx::ceil(m_state.m_size[0] * viewScale) );
+ const uint16_t viewRectHeight = uint16_t(bx::ceil(m_state.m_size[1] * viewScale) );
+ const uint16_t viewRectY = uint16_t(caps->originBottomLeft ? m_state.m_size[1] - viewRectHeight : 0);
+
+ bgfx::setViewRect(view, 0, viewRectY, viewRectWidth, viewRectHeight);
+ bgfx::setViewTransform(view, m_state.m_view, m_state.m_proj);
+ bgfx::setViewFrameBuffer(view, m_state.m_frameBuffer);
+
+ bgfx::setState(0
+ | BGFX_STATE_WRITE_RGB
+ | BGFX_STATE_WRITE_A
+ | BGFX_STATE_WRITE_Z
+ | BGFX_STATE_DEPTH_TEST_LESS
+ );
+
+ drawAllModels(view, m_state.m_forwardProgram, m_state.m_modelUniforms);
+
+ ++view;
+ }
+
+ // optionally run FSR
+ if (!m_state.m_renderNativeResolution)
+ {
+ view = m_state.m_fsr.computeFsr(view, m_state.m_frameBufferTex[FRAMEBUFFER_RT_COLOR]);
+ }
+
+ // render result to screen
+ {
+ bgfx::TextureHandle srcTexture = m_state.m_frameBufferTex[FRAMEBUFFER_RT_COLOR];
+
+ if (!m_state.m_renderNativeResolution)
+ {
+ srcTexture = m_state.m_fsr.getResultTexture();
+ }
+
+ m_magnifierWidget.updateContent(view, m_state, caps, srcTexture);
+
+ float orthoProj[16];
+ bx::mtxOrtho(orthoProj, 0.0f, 1.0f, 1.0f, 0.0f, 0.0f, 1.0f, 0.0f, caps->homogeneousDepth);
+
+ bgfx::setViewName(view, "display");
+ bgfx::setViewClear(view, BGFX_CLEAR_NONE, 0, 1.0f, 0);
+
+ bgfx::setViewRect(view, 0, 0, uint16_t(m_state.m_width), uint16_t(m_state.m_height) );
+ bgfx::setViewTransform(view, NULL, orthoProj);
+ bgfx::setViewFrameBuffer(view, BGFX_INVALID_HANDLE);
+ bgfx::setState(0 | BGFX_STATE_WRITE_RGB | BGFX_STATE_WRITE_A);
+ bgfx::setTexture(0, m_state.s_color, srcTexture, BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP);
+ screenSpaceTriangle(float(m_state.m_width), float(m_state.m_height), m_state.m_texelHalf, caps->originBottomLeft);
+ bgfx::submit(view, m_state.m_copyLinearToGammaProgram);
+ }
+
+ m_magnifierWidget.drawToScreen(view, m_state);
+
+ ++view;
+
+ // Draw UI
+ imguiBeginFrame(m_state.m_mouseState.m_mx, m_state.m_mouseState.m_my, (m_state.m_mouseState.m_buttons[entry::MouseButton::Left] ? IMGUI_MBUT_LEFT : 0) | (m_state.m_mouseState.m_buttons[entry::MouseButton::Right] ? IMGUI_MBUT_RIGHT : 0) | (m_state.m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0), m_state.m_mouseState.m_mz, uint16_t(m_state.m_width), uint16_t(m_state.m_height) );
+
+ showExampleDialog(this);
+
+ ImGui::SetNextWindowPos(ImVec2(m_state.m_width - m_state.m_width / 4.0f - 10.0f, 10.0f), ImGuiCond_FirstUseEver);
+ ImGui::SetNextWindowSize(ImVec2(m_state.m_width / 4.0f, m_state.m_height / 1.2f), ImGuiCond_FirstUseEver);
+ ImGui::Begin("Settings", NULL, 0);
+ ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.5f);
+
+ const ImVec2 itemSize = ImGui::GetItemRectSize();
+
+ {
+ ImGui::Checkbox("Animate scene", &m_state.m_animateScene);
+
+ if (ImGui::Combo("Antialiasing", &m_state.m_antiAliasingSetting, "none\0""4x\0""16x\0""\0") )
+ {
+ resize();
+ }
+
+ ImGui::Checkbox("Render native resolution", &m_state.m_renderNativeResolution);
+
+ if (ImGui::IsItemHovered() )
+ {
+ ImGui::SetTooltip("Disable super sampling and FSR.");
+ }
+
+ ImGui::Image(m_magnifierWidget.m_content.m_texture, ImVec2(itemSize.x * 0.94f, itemSize.x * 0.94f) );
+
+ if (!m_state.m_renderNativeResolution)
+ {
+ ImGui::SliderFloat("Super sampling", &m_state.m_fsr.m_config.m_superSamplingFactor, 1.0f, 2.0f);
+
+ if (ImGui::IsItemHovered() )
+ {
+ ImGui::BeginTooltip();
+ ImGui::Text("2.0 means the scene is rendered at half window resolution.");
+ ImGui::Text("1.0 means the scene is rendered at native window resolution.");
+ ImGui::EndTooltip();
+ }
+
+ ImGui::Separator();
+
+ if (m_state.m_fsr.supports16BitPrecision() )
+ {
+ ImGui::Checkbox("Use 16 Bit", &m_state.m_fsr.m_config.m_fsr16Bit);
+
+ if (ImGui::IsItemHovered() )
+ {
+ ImGui::BeginTooltip();
+ ImGui::Text("For better performance and less memory consumption use 16 Bit precision.");
+ ImGui::Text("If disabled use 32 Bit per channel precision for FSR which works better on older hardware.");
+ ImGui::Text("FSR in 16 Bit precision is also prone to be broken in Direct3D11, Direct3D12 works though.");
+ ImGui::EndTooltip();
+ }
+ }
+
+ ImGui::Checkbox("Apply FSR", &m_state.m_fsr.m_config.m_applyFsr);
+
+ if (ImGui::IsItemHovered() )
+ {
+ ImGui::SetTooltip("Compare between FSR and bilinear interpolation of source image.");
+ }
+
+ if (m_state.m_fsr.m_config.m_applyFsr)
+ {
+ ImGui::Checkbox("Apply FSR sharpening", &m_state.m_fsr.m_config.m_applyFsrRcas);
+
+ if (ImGui::IsItemHovered() )
+ {
+ ImGui::SetTooltip("Apply the FSR RCAS sharpening pass.");
+ }
+
+ if (m_state.m_fsr.m_config.m_applyFsrRcas)
+ {
+ ImGui::SliderFloat("Sharpening attenuation", &m_state.m_fsr.m_config.m_rcasAttenuation, 0.01f, 2.0f);
+
+ if (ImGui::IsItemHovered() )
+ {
+ ImGui::SetTooltip("Lower value means sharper.");
+ }
+ }
+ }
+ }
+ }
+
+ ImGui::End();
+
+ imguiEndFrame();
+
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ m_state.m_currFrame = bgfx::frame();
+
+ return true;
+ }
+
+ return false;
+ }
+
+ void drawAllModels(bgfx::ViewId _pass, bgfx::ProgramHandle _program, ModelUniforms &_uniforms)
+ {
+ const int32_t width = 6;
+ const int32_t length = 20;
+
+ float c0[] = { 235.0f / 255.0f, 126.0f / 255.0f, 30.0f / 255.0f}; // orange
+ float c1[] = { 235.0f / 255.0f, 146.0f / 255.0f, 251.0f / 255.0f}; // purple
+ float c2[] = { 199.0f / 255.0f, 0.0f / 255.0f, 57.0f / 255.0f}; // pink
+
+ for (int32_t zz = 0; zz < length; ++zz)
+ {
+ // make a color gradient, nothing special about this for example
+ float *ca = c0;
+ float *cb = c1;
+ float lerpVal = float(zz) / float(length);
+
+ if (0.5f <= lerpVal)
+ {
+ ca = c1;
+ cb = c2;
+ }
+ lerpVal = bx::fract(2.0f * lerpVal);
+
+ float r = bx::lerp(ca[0], cb[0], lerpVal);
+ float g = bx::lerp(ca[1], cb[1], lerpVal);
+ float b = bx::lerp(ca[2], cb[2], lerpVal);
+
+ for (int32_t xx = 0; xx < width; ++xx)
+ {
+ const float angle = m_state.m_animationTime + float(zz) * (bx::kPi2 / length) + float(xx) * (bx::kPiHalf / width);
+
+ const float posX = 2.0f * xx - width + 1.0f;
+ const float posY = bx::sin(angle);
+ const float posZ = 2.0f * zz - length + 1.0f;
+
+ const float scale = s_meshScale[MeshHollowCube];
+ float mtx[16];
+ bx::mtxSRT(mtx, scale, scale, scale, 0.0f, 0.0f, 0.0f, posX, posY, posZ);
+
+ bgfx::setTexture(0, m_state.s_albedo, m_state.m_groundTexture);
+ bgfx::setTexture(1, m_state.s_normal, m_state.m_normalTexture);
+ _uniforms.m_color[0] = r;
+ _uniforms.m_color[1] = g;
+ _uniforms.m_color[2] = b;
+ _uniforms.submit();
+
+ meshSubmit(m_state.m_meshes[MeshHollowCube], _pass, _program, mtx);
+ }
+ }
+
+ // draw box as ground plane
+ {
+ const float posY = -2.0f;
+ const float scale = length;
+ float mtx[16];
+ bx::mtxSRT(mtx, scale, scale, scale, 0.0f, 0.0f, 0.0f, 0.0f, -scale + posY, 0.0f);
+
+ _uniforms.m_color[0] = 0.5f;
+ _uniforms.m_color[1] = 0.5f;
+ _uniforms.m_color[2] = 0.5f;
+ _uniforms.submit();
+
+ meshSubmit(m_state.m_meshes[MeshCube], _pass, m_state.m_gridProgram, mtx);
+ }
+ }
+
+ void resize()
+ {
+ destroyFramebuffers();
+ createFramebuffers();
+ m_state.m_fsr.resize(m_state.m_width, m_state.m_height);
+ }
+
+ void createFramebuffers()
+ {
+ m_state.m_size[0] = m_state.m_width;
+ m_state.m_size[1] = m_state.m_height;
+
+ constexpr uint64_t msaaFlags[] =
+ {
+ BGFX_TEXTURE_NONE,
+ BGFX_TEXTURE_RT_MSAA_X4,
+ BGFX_TEXTURE_RT_MSAA_X16,
+ };
+
+ const uint64_t msaa = msaaFlags[m_state.m_antiAliasingSetting];
+ const uint64_t colorFlags = 0
+ | BGFX_TEXTURE_RT
+ | BGFX_SAMPLER_U_CLAMP
+ | BGFX_SAMPLER_V_CLAMP
+ | msaa
+ ;
+ const uint64_t depthFlags = 0
+ | BGFX_TEXTURE_RT_WRITE_ONLY
+ | msaa
+ ;
+
+ m_state.m_frameBufferTex[FRAMEBUFFER_RT_COLOR] = bgfx::createTexture2D(
+ uint16_t(m_state.m_size[0])
+ , uint16_t(m_state.m_size[1])
+ , false
+ , 1
+ , bgfx::TextureFormat::RGBA16F
+ , colorFlags
+ );
+
+ m_state.m_frameBufferTex[FRAMEBUFFER_RT_DEPTH] = bgfx::createTexture2D(
+ uint16_t(m_state.m_size[0])
+ , uint16_t(m_state.m_size[1])
+ , false
+ , 1
+ , bgfx::TextureFormat::D32F
+ , depthFlags
+ );
+
+ m_state.m_frameBuffer = bgfx::createFrameBuffer(
+ BX_COUNTOF(m_state.m_frameBufferTex)
+ , m_state.m_frameBufferTex
+ , true
+ );
+ }
+
+ // all buffers set to destroy their textures
+ void destroyFramebuffers()
+ {
+ bgfx::destroy(m_state.m_frameBuffer);
+ }
+
+ void updateUniforms()
+ {
+ m_state.m_modelUniforms.m_lightPosition[0] = 0.0f;
+ m_state.m_modelUniforms.m_lightPosition[1] = 6.0f;
+ m_state.m_modelUniforms.m_lightPosition[2] = 10.0f;
+ }
+
+ AppState m_state;
+ MagnifierWidget m_magnifierWidget;
+};
+
+} // namespace
+
+ENTRY_IMPLEMENT_MAIN(
+ ExampleFsr
+ , "46-fsr"
+ , "AMD FidelityFX Super Resolution (FSR)\n"
+ "\n"
+ "For an optimal FSR result high quality antialiasing for the low resolution source image and negative texture LOD bias is recommended."
+ );
diff --git a/3rdparty/bgfx/examples/46-fsr/cs_fsr.h b/3rdparty/bgfx/examples/46-fsr/cs_fsr.h
new file mode 100644
index 00000000000..928ec47ed09
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/cs_fsr.h
@@ -0,0 +1,127 @@
+/*
+* Copyright 2021 Richard Schubert. All rights reserved.
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+*
+* AMD FidelityFX Super Resolution 1.0 (FSR)
+* Port from https://github.com/GPUOpen-Effects/FidelityFX-FSR/blob/master/sample/src/VK/FSR_Pass.glsl
+*/
+
+#include "bgfx_compute.sh"
+
+uniform vec4 u_params[3];
+
+#define ViewportSizeRcasAttenuation u_params[0]
+#define SrcSize u_params[1]
+#define DstSize u_params[2]
+
+#define A_GPU 1
+
+#if BGFX_SHADER_LANGUAGE_GLSL
+#define A_GLSL 1
+#define A_SKIP_EXT 1
+#else
+#define A_HLSL 1
+#endif // BGFX_SHADER_LANGUAGE_GLSL
+
+#if SAMPLE_SLOW_FALLBACK
+ #include "ffx_a.h"
+ SAMPLER2D(InputTexture, 0);
+ IMAGE2D_WR(OutputTexture, rgba32f, 1);
+ #if SAMPLE_EASU
+ #define FSR_EASU_F 1
+ AF4 FsrEasuRF(AF2 p) { AF4 res = textureGather(InputTexture, p, 0); return res; }
+ AF4 FsrEasuGF(AF2 p) { AF4 res = textureGather(InputTexture, p, 1); return res; }
+ AF4 FsrEasuBF(AF2 p) { AF4 res = textureGather(InputTexture, p, 2); return res; }
+ #endif
+ #if SAMPLE_RCAS
+ #define FSR_RCAS_F
+ AF4 FsrRcasLoadF(ASU2 p) { return texelFetch(InputTexture, ASU2(p), 0); }
+ void FsrRcasInputF(inout AF1 r, inout AF1 g, inout AF1 b) {}
+ #endif
+#else
+ #define A_HALF
+ #include "ffx_a.h"
+ SAMPLER2D(InputTexture, 0);
+ IMAGE2D_WR(OutputTexture, rgba16f, 1);
+ #if SAMPLE_EASU
+ #define FSR_EASU_H 1
+ AH4 FsrEasuRH(AF2 p) { AH4 res = AH4(textureGather(InputTexture, p, 0)); return res; }
+ AH4 FsrEasuGH(AF2 p) { AH4 res = AH4(textureGather(InputTexture, p, 1)); return res; }
+ AH4 FsrEasuBH(AF2 p) { AH4 res = AH4(textureGather(InputTexture, p, 2)); return res; }
+ #endif
+ #if SAMPLE_RCAS
+ #define FSR_RCAS_H
+ AH4 FsrRcasLoadH(ASW2 p) { return AH4(texelFetch(InputTexture, ASU2(p), 0)); }
+ void FsrRcasInputH(inout AH1 r,inout AH1 g,inout AH1 b){}
+ #endif
+#endif
+
+#include "ffx_fsr1.h"
+
+void CurrFilter(AU2 pos, AU4 Const0, AU4 Const1, AU4 Const2, AU4 Const3, AU4 Sample)
+{
+#if SAMPLE_BILINEAR
+ AF2 pp = (AF2(pos) * AF2_AU2(Const0.xy) + AF2_AU2(Const0.zw)) * AF2_AU2(Const1.xy) + AF2(0.5, -0.5) * AF2_AU2(Const1.zw);
+ imageStore(OutputTexture, ASU2(pos), texture2DLod(InputTexture, pp, 0.0));
+#endif
+#if SAMPLE_EASU
+ #if SAMPLE_SLOW_FALLBACK
+ AF3 c;
+ FsrEasuF(c, pos, Const0, Const1, Const2, Const3);
+ if( Sample.x == 1 )
+ c *= c;
+ imageStore(OutputTexture, ASU2(pos), AF4(c, 1));
+ #else
+ AH3 c;
+ FsrEasuH(c, pos, Const0, Const1, Const2, Const3);
+ if( Sample.x == 1 )
+ c *= c;
+ imageStore(OutputTexture, ASU2(pos), AH4(c, 1));
+ #endif
+#endif
+#if SAMPLE_RCAS
+ #if SAMPLE_SLOW_FALLBACK
+ AF3 c;
+ FsrRcasF(c.r, c.g, c.b, pos, Const0);
+ if( Sample.x == 1 )
+ c *= c;
+ imageStore(OutputTexture, ASU2(pos), AF4(c, 1));
+ #else
+ AH3 c;
+ FsrRcasH(c.r, c.g, c.b, pos, Const0);
+ if( Sample.x == 1 )
+ c *= c;
+ imageStore(OutputTexture, ASU2(pos), AH4(c, 1));
+ #endif
+#endif
+}
+
+NUM_THREADS(64, 1, 1)
+void main()
+{
+ AU4 Const0, Const1, Const2, Const3, Sample;
+
+ // We compute these constants on GPU because bgfx does not support uniform type uint.
+#if SAMPLE_EASU || SAMPLE_BILINEAR
+ FsrEasuCon(Const0, Const1, Const2, Const3,
+ ViewportSizeRcasAttenuation.x, ViewportSizeRcasAttenuation.y, // Viewport size (top left aligned) in the input image which is to be scaled.
+ SrcSize.x, SrcSize.y, // The size of the input image.
+ DstSize.x, DstSize.y); // The output resolution.
+ Sample.x = 0; // no HDR output
+#endif
+#if SAMPLE_RCAS
+ FsrRcasCon(Const0, ViewportSizeRcasAttenuation.z);
+ Sample.x = 0; // no HDR output
+#endif
+
+ // Do remapping of local xy in workgroup for a more PS-like swizzle pattern.
+ AU2 gxy = ARmp8x8(gl_LocalInvocationID.x) + AU2(gl_WorkGroupID.x << 4u, gl_WorkGroupID.y << 4u);
+ CurrFilter(gxy, Const0, Const1, Const2, Const3, Sample);
+ gxy.x += 8u;
+ CurrFilter(gxy, Const0, Const1, Const2, Const3, Sample);
+ gxy.y += 8u;
+ CurrFilter(gxy, Const0, Const1, Const2, Const3, Sample);
+ gxy.x -= 8u;
+ CurrFilter(gxy, Const0, Const1, Const2, Const3, Sample);
+}
+
diff --git a/3rdparty/bgfx/examples/46-fsr/cs_fsr_bilinear_16.sc b/3rdparty/bgfx/examples/46-fsr/cs_fsr_bilinear_16.sc
new file mode 100644
index 00000000000..c6ca756cf5d
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/cs_fsr_bilinear_16.sc
@@ -0,0 +1,3 @@
+#define SAMPLE_BILINEAR 1
+
+#include "cs_fsr.h"
diff --git a/3rdparty/bgfx/examples/46-fsr/cs_fsr_bilinear_32.sc b/3rdparty/bgfx/examples/46-fsr/cs_fsr_bilinear_32.sc
new file mode 100644
index 00000000000..c803a9ff985
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/cs_fsr_bilinear_32.sc
@@ -0,0 +1,4 @@
+#define SAMPLE_BILINEAR 1
+#define SAMPLE_SLOW_FALLBACK 1
+
+#include "cs_fsr.h"
diff --git a/3rdparty/bgfx/examples/46-fsr/cs_fsr_easu_16.sc b/3rdparty/bgfx/examples/46-fsr/cs_fsr_easu_16.sc
new file mode 100644
index 00000000000..8dc730f7f1b
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/cs_fsr_easu_16.sc
@@ -0,0 +1,3 @@
+#define SAMPLE_EASU 1
+
+#include "cs_fsr.h"
diff --git a/3rdparty/bgfx/examples/46-fsr/cs_fsr_easu_32.sc b/3rdparty/bgfx/examples/46-fsr/cs_fsr_easu_32.sc
new file mode 100644
index 00000000000..bb6c763076a
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/cs_fsr_easu_32.sc
@@ -0,0 +1,4 @@
+#define SAMPLE_SLOW_FALLBACK 1
+#define SAMPLE_EASU 1
+
+#include "cs_fsr.h"
diff --git a/3rdparty/bgfx/examples/46-fsr/cs_fsr_rcas_16.sc b/3rdparty/bgfx/examples/46-fsr/cs_fsr_rcas_16.sc
new file mode 100644
index 00000000000..c54645aaafe
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/cs_fsr_rcas_16.sc
@@ -0,0 +1,3 @@
+#define SAMPLE_RCAS 1
+
+#include "cs_fsr.h"
diff --git a/3rdparty/bgfx/examples/46-fsr/cs_fsr_rcas_32.sc b/3rdparty/bgfx/examples/46-fsr/cs_fsr_rcas_32.sc
new file mode 100644
index 00000000000..52d4693f7de
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/cs_fsr_rcas_32.sc
@@ -0,0 +1,4 @@
+#define SAMPLE_SLOW_FALLBACK 1
+#define SAMPLE_RCAS 1
+
+#include "cs_fsr.h"
diff --git a/3rdparty/bgfx/examples/46-fsr/ffx_a.h b/3rdparty/bgfx/examples/46-fsr/ffx_a.h
new file mode 100644
index 00000000000..0efcc8d8109
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/ffx_a.h
@@ -0,0 +1,2637 @@
+//==============================================================================================================================
+//
+// [A] SHADER PORTABILITY 1.20210629
+//
+//==============================================================================================================================
+// FidelityFX Super Resolution Sample
+//
+// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files(the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
+// copies of the Software, and to permit persons to whom the Software is
+// 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 Software.
+// THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//------------------------------------------------------------------------------------------------------------------------------
+// MIT LICENSE
+// ===========
+// Copyright (c) 2014 Michal Drobot (for concepts used in "FLOAT APPROXIMATIONS").
+// -----------
+// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation
+// files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy,
+// modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the
+// Software is 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
+// Software.
+// -----------
+// THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//------------------------------------------------------------------------------------------------------------------------------
+// ABOUT
+// =====
+// Common central point for high-level shading language and C portability for various shader headers.
+//------------------------------------------------------------------------------------------------------------------------------
+// DEFINES
+// =======
+// A_CPU ..... Include the CPU related code.
+// A_GPU ..... Include the GPU related code.
+// A_GLSL .... Using GLSL.
+// A_HLSL .... Using HLSL.
+// A_HLSL_6_2 Using HLSL 6.2 with new 'uint16_t' and related types (requires '-enable-16bit-types').
+// A_NO_16_BIT_CAST Don't use instructions that are not available in SPIR-V (needed for running A_HLSL_6_2 on Vulkan)
+// A_GCC ..... Using a GCC compatible compiler (else assume MSVC compatible compiler by default).
+// =======
+// A_BYTE .... Support 8-bit integer.
+// A_HALF .... Support 16-bit integer and floating point.
+// A_LONG .... Support 64-bit integer.
+// A_DUBL .... Support 64-bit floating point.
+// =======
+// A_WAVE .... Support wave-wide operations.
+//------------------------------------------------------------------------------------------------------------------------------
+// To get #include "ffx_a.h" working in GLSL use '#extension GL_GOOGLE_include_directive:require'.
+//------------------------------------------------------------------------------------------------------------------------------
+// SIMPLIFIED TYPE SYSTEM
+// ======================
+// - All ints will be unsigned with exception of when signed is required.
+// - Type naming simplified and shortened "A<type><#components>",
+// - H = 16-bit float (half)
+// - F = 32-bit float (float)
+// - D = 64-bit float (double)
+// - P = 1-bit integer (predicate, not using bool because 'B' is used for byte)
+// - B = 8-bit integer (byte)
+// - W = 16-bit integer (word)
+// - U = 32-bit integer (unsigned)
+// - L = 64-bit integer (long)
+// - Using "AS<type><#components>" for signed when required.
+//------------------------------------------------------------------------------------------------------------------------------
+// TODO
+// ====
+// - Make sure 'ALerp*(a,b,m)' does 'b*m+(-a*m+a)' (2 ops).
+//------------------------------------------------------------------------------------------------------------------------------
+// CHANGE LOG
+// ==========
+// 20200914 - Expanded wave ops and prx code.
+// 20200713 - Added [ZOL] section, fixed serious bugs in sRGB and Rec.709 color conversion code, etc.
+//==============================================================================================================================
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// COMMON
+//==============================================================================================================================
+#define A_2PI 6.28318530718
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+//
+//
+// CPU
+//
+//
+//==============================================================================================================================
+#ifdef A_CPU
+ // Supporting user defined overrides.
+ #ifndef A_RESTRICT
+ #define A_RESTRICT __restrict
+ #endif
+//------------------------------------------------------------------------------------------------------------------------------
+ #ifndef A_STATIC
+ #define A_STATIC static
+ #endif
+//------------------------------------------------------------------------------------------------------------------------------
+ // Same types across CPU and GPU.
+ // Predicate uses 32-bit integer (C friendly bool).
+ typedef uint32_t AP1;
+ typedef float AF1;
+ typedef double AD1;
+ typedef uint8_t AB1;
+ typedef uint16_t AW1;
+ typedef uint32_t AU1;
+ typedef uint64_t AL1;
+ typedef int8_t ASB1;
+ typedef int16_t ASW1;
+ typedef int32_t ASU1;
+ typedef int64_t ASL1;
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AD1_(a) ((AD1)(a))
+ #define AF1_(a) ((AF1)(a))
+ #define AL1_(a) ((AL1)(a))
+ #define AU1_(a) ((AU1)(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ASL1_(a) ((ASL1)(a))
+ #define ASU1_(a) ((ASU1)(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC AU1 AU1_AF1(AF1 a){union{AF1 f;AU1 u;}bits;bits.f=a;return bits.u;}
+//------------------------------------------------------------------------------------------------------------------------------
+ #define A_TRUE 1
+ #define A_FALSE 0
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+//
+// CPU/GPU PORTING
+//
+//------------------------------------------------------------------------------------------------------------------------------
+// Get CPU and GPU to share all setup code, without duplicate code paths.
+// This uses a lower-case prefix for special vector constructs.
+// - In C restrict pointers are used.
+// - In the shading language, in/inout/out arguments are used.
+// This depends on the ability to access a vector value in both languages via array syntax (aka color[2]).
+//==============================================================================================================================
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// VECTOR ARGUMENT/RETURN/INITIALIZATION PORTABILITY
+//==============================================================================================================================
+ #define retAD2 AD1 *A_RESTRICT
+ #define retAD3 AD1 *A_RESTRICT
+ #define retAD4 AD1 *A_RESTRICT
+ #define retAF2 AF1 *A_RESTRICT
+ #define retAF3 AF1 *A_RESTRICT
+ #define retAF4 AF1 *A_RESTRICT
+ #define retAL2 AL1 *A_RESTRICT
+ #define retAL3 AL1 *A_RESTRICT
+ #define retAL4 AL1 *A_RESTRICT
+ #define retAU2 AU1 *A_RESTRICT
+ #define retAU3 AU1 *A_RESTRICT
+ #define retAU4 AU1 *A_RESTRICT
+//------------------------------------------------------------------------------------------------------------------------------
+ #define inAD2 AD1 *A_RESTRICT
+ #define inAD3 AD1 *A_RESTRICT
+ #define inAD4 AD1 *A_RESTRICT
+ #define inAF2 AF1 *A_RESTRICT
+ #define inAF3 AF1 *A_RESTRICT
+ #define inAF4 AF1 *A_RESTRICT
+ #define inAL2 AL1 *A_RESTRICT
+ #define inAL3 AL1 *A_RESTRICT
+ #define inAL4 AL1 *A_RESTRICT
+ #define inAU2 AU1 *A_RESTRICT
+ #define inAU3 AU1 *A_RESTRICT
+ #define inAU4 AU1 *A_RESTRICT
+//------------------------------------------------------------------------------------------------------------------------------
+ #define inoutAD2 AD1 *A_RESTRICT
+ #define inoutAD3 AD1 *A_RESTRICT
+ #define inoutAD4 AD1 *A_RESTRICT
+ #define inoutAF2 AF1 *A_RESTRICT
+ #define inoutAF3 AF1 *A_RESTRICT
+ #define inoutAF4 AF1 *A_RESTRICT
+ #define inoutAL2 AL1 *A_RESTRICT
+ #define inoutAL3 AL1 *A_RESTRICT
+ #define inoutAL4 AL1 *A_RESTRICT
+ #define inoutAU2 AU1 *A_RESTRICT
+ #define inoutAU3 AU1 *A_RESTRICT
+ #define inoutAU4 AU1 *A_RESTRICT
+//------------------------------------------------------------------------------------------------------------------------------
+ #define outAD2 AD1 *A_RESTRICT
+ #define outAD3 AD1 *A_RESTRICT
+ #define outAD4 AD1 *A_RESTRICT
+ #define outAF2 AF1 *A_RESTRICT
+ #define outAF3 AF1 *A_RESTRICT
+ #define outAF4 AF1 *A_RESTRICT
+ #define outAL2 AL1 *A_RESTRICT
+ #define outAL3 AL1 *A_RESTRICT
+ #define outAL4 AL1 *A_RESTRICT
+ #define outAU2 AU1 *A_RESTRICT
+ #define outAU3 AU1 *A_RESTRICT
+ #define outAU4 AU1 *A_RESTRICT
+//------------------------------------------------------------------------------------------------------------------------------
+ #define varAD2(x) AD1 x[2]
+ #define varAD3(x) AD1 x[3]
+ #define varAD4(x) AD1 x[4]
+ #define varAF2(x) AF1 x[2]
+ #define varAF3(x) AF1 x[3]
+ #define varAF4(x) AF1 x[4]
+ #define varAL2(x) AL1 x[2]
+ #define varAL3(x) AL1 x[3]
+ #define varAL4(x) AL1 x[4]
+ #define varAU2(x) AU1 x[2]
+ #define varAU3(x) AU1 x[3]
+ #define varAU4(x) AU1 x[4]
+//------------------------------------------------------------------------------------------------------------------------------
+ #define initAD2(x,y) {x,y}
+ #define initAD3(x,y,z) {x,y,z}
+ #define initAD4(x,y,z,w) {x,y,z,w}
+ #define initAF2(x,y) {x,y}
+ #define initAF3(x,y,z) {x,y,z}
+ #define initAF4(x,y,z,w) {x,y,z,w}
+ #define initAL2(x,y) {x,y}
+ #define initAL3(x,y,z) {x,y,z}
+ #define initAL4(x,y,z,w) {x,y,z,w}
+ #define initAU2(x,y) {x,y}
+ #define initAU3(x,y,z) {x,y,z}
+ #define initAU4(x,y,z,w) {x,y,z,w}
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// SCALAR RETURN OPS
+//------------------------------------------------------------------------------------------------------------------------------
+// TODO
+// ====
+// - Replace transcendentals with manual versions.
+//==============================================================================================================================
+ #ifdef A_GCC
+ A_STATIC AD1 AAbsD1(AD1 a){return __builtin_fabs(a);}
+ A_STATIC AF1 AAbsF1(AF1 a){return __builtin_fabsf(a);}
+ A_STATIC AU1 AAbsSU1(AU1 a){return AU1_(__builtin_abs(ASU1_(a)));}
+ A_STATIC AL1 AAbsSL1(AL1 a){return AL1_(__builtin_llabs(ASL1_(a)));}
+ #else
+ A_STATIC AD1 AAbsD1(AD1 a){return fabs(a);}
+ A_STATIC AF1 AAbsF1(AF1 a){return fabsf(a);}
+ A_STATIC AU1 AAbsSU1(AU1 a){return AU1_(abs(ASU1_(a)));}
+ A_STATIC AL1 AAbsSL1(AL1 a){return AL1_(labs((long)ASL1_(a)));}
+ #endif
+//------------------------------------------------------------------------------------------------------------------------------
+ #ifdef A_GCC
+ A_STATIC AD1 ACosD1(AD1 a){return __builtin_cos(a);}
+ A_STATIC AF1 ACosF1(AF1 a){return __builtin_cosf(a);}
+ #else
+ A_STATIC AD1 ACosD1(AD1 a){return cos(a);}
+ A_STATIC AF1 ACosF1(AF1 a){return cosf(a);}
+ #endif
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC AD1 ADotD2(inAD2 a,inAD2 b){return a[0]*b[0]+a[1]*b[1];}
+ A_STATIC AD1 ADotD3(inAD3 a,inAD3 b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2];}
+ A_STATIC AD1 ADotD4(inAD4 a,inAD4 b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3];}
+ A_STATIC AF1 ADotF2(inAF2 a,inAF2 b){return a[0]*b[0]+a[1]*b[1];}
+ A_STATIC AF1 ADotF3(inAF3 a,inAF3 b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2];}
+ A_STATIC AF1 ADotF4(inAF4 a,inAF4 b){return a[0]*b[0]+a[1]*b[1]+a[2]*b[2]+a[3]*b[3];}
+//------------------------------------------------------------------------------------------------------------------------------
+ #ifdef A_GCC
+ A_STATIC AD1 AExp2D1(AD1 a){return __builtin_exp2(a);}
+ A_STATIC AF1 AExp2F1(AF1 a){return __builtin_exp2f(a);}
+ #else
+ A_STATIC AD1 AExp2D1(AD1 a){return exp2(a);}
+ A_STATIC AF1 AExp2F1(AF1 a){return exp2f(a);}
+ #endif
+//------------------------------------------------------------------------------------------------------------------------------
+ #ifdef A_GCC
+ A_STATIC AD1 AFloorD1(AD1 a){return __builtin_floor(a);}
+ A_STATIC AF1 AFloorF1(AF1 a){return __builtin_floorf(a);}
+ #else
+ A_STATIC AD1 AFloorD1(AD1 a){return floor(a);}
+ A_STATIC AF1 AFloorF1(AF1 a){return floorf(a);}
+ #endif
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC AD1 ALerpD1(AD1 a,AD1 b,AD1 c){return b*c+(-a*c+a);}
+ A_STATIC AF1 ALerpF1(AF1 a,AF1 b,AF1 c){return b*c+(-a*c+a);}
+//------------------------------------------------------------------------------------------------------------------------------
+ #ifdef A_GCC
+ A_STATIC AD1 ALog2D1(AD1 a){return __builtin_log2(a);}
+ A_STATIC AF1 ALog2F1(AF1 a){return __builtin_log2f(a);}
+ #else
+ A_STATIC AD1 ALog2D1(AD1 a){return log2(a);}
+ A_STATIC AF1 ALog2F1(AF1 a){return log2f(a);}
+ #endif
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC AD1 AMaxD1(AD1 a,AD1 b){return a>b?a:b;}
+ A_STATIC AF1 AMaxF1(AF1 a,AF1 b){return a>b?a:b;}
+ A_STATIC AL1 AMaxL1(AL1 a,AL1 b){return a>b?a:b;}
+ A_STATIC AU1 AMaxU1(AU1 a,AU1 b){return a>b?a:b;}
+//------------------------------------------------------------------------------------------------------------------------------
+ // These follow the convention that A integer types don't have signage, until they are operated on.
+ A_STATIC AL1 AMaxSL1(AL1 a,AL1 b){return (ASL1_(a)>ASL1_(b))?a:b;}
+ A_STATIC AU1 AMaxSU1(AU1 a,AU1 b){return (ASU1_(a)>ASU1_(b))?a:b;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC AD1 AMinD1(AD1 a,AD1 b){return a<b?a:b;}
+ A_STATIC AF1 AMinF1(AF1 a,AF1 b){return a<b?a:b;}
+ A_STATIC AL1 AMinL1(AL1 a,AL1 b){return a<b?a:b;}
+ A_STATIC AU1 AMinU1(AU1 a,AU1 b){return a<b?a:b;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC AL1 AMinSL1(AL1 a,AL1 b){return (ASL1_(a)<ASL1_(b))?a:b;}
+ A_STATIC AU1 AMinSU1(AU1 a,AU1 b){return (ASU1_(a)<ASU1_(b))?a:b;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC AD1 ARcpD1(AD1 a){return 1.0/a;}
+ A_STATIC AF1 ARcpF1(AF1 a){return 1.0f/a;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC AL1 AShrSL1(AL1 a,AL1 b){return AL1_(ASL1_(a)>>ASL1_(b));}
+ A_STATIC AU1 AShrSU1(AU1 a,AU1 b){return AU1_(ASU1_(a)>>ASU1_(b));}
+//------------------------------------------------------------------------------------------------------------------------------
+ #ifdef A_GCC
+ A_STATIC AD1 ASinD1(AD1 a){return __builtin_sin(a);}
+ A_STATIC AF1 ASinF1(AF1 a){return __builtin_sinf(a);}
+ #else
+ A_STATIC AD1 ASinD1(AD1 a){return sin(a);}
+ A_STATIC AF1 ASinF1(AF1 a){return sinf(a);}
+ #endif
+//------------------------------------------------------------------------------------------------------------------------------
+ #ifdef A_GCC
+ A_STATIC AD1 ASqrtD1(AD1 a){return __builtin_sqrt(a);}
+ A_STATIC AF1 ASqrtF1(AF1 a){return __builtin_sqrtf(a);}
+ #else
+ A_STATIC AD1 ASqrtD1(AD1 a){return sqrt(a);}
+ A_STATIC AF1 ASqrtF1(AF1 a){return sqrtf(a);}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// SCALAR RETURN OPS - DEPENDENT
+//==============================================================================================================================
+ A_STATIC AD1 AClampD1(AD1 x,AD1 n,AD1 m){return AMaxD1(n,AMinD1(x,m));}
+ A_STATIC AF1 AClampF1(AF1 x,AF1 n,AF1 m){return AMaxF1(n,AMinF1(x,m));}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC AD1 AFractD1(AD1 a){return a-AFloorD1(a);}
+ A_STATIC AF1 AFractF1(AF1 a){return a-AFloorF1(a);}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC AD1 APowD1(AD1 a,AD1 b){return AExp2D1(b*ALog2D1(a));}
+ A_STATIC AF1 APowF1(AF1 a,AF1 b){return AExp2F1(b*ALog2F1(a));}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC AD1 ARsqD1(AD1 a){return ARcpD1(ASqrtD1(a));}
+ A_STATIC AF1 ARsqF1(AF1 a){return ARcpF1(ASqrtF1(a));}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC AD1 ASatD1(AD1 a){return AMinD1(1.0,AMaxD1(0.0,a));}
+ A_STATIC AF1 ASatF1(AF1 a){return AMinF1(1.0f,AMaxF1(0.0f,a));}
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// VECTOR OPS
+//------------------------------------------------------------------------------------------------------------------------------
+// These are added as needed for production or prototyping, so not necessarily a complete set.
+// They follow a convention of taking in a destination and also returning the destination value to increase utility.
+//==============================================================================================================================
+ A_STATIC retAD2 opAAbsD2(outAD2 d,inAD2 a){d[0]=AAbsD1(a[0]);d[1]=AAbsD1(a[1]);return d;}
+ A_STATIC retAD3 opAAbsD3(outAD3 d,inAD3 a){d[0]=AAbsD1(a[0]);d[1]=AAbsD1(a[1]);d[2]=AAbsD1(a[2]);return d;}
+ A_STATIC retAD4 opAAbsD4(outAD4 d,inAD4 a){d[0]=AAbsD1(a[0]);d[1]=AAbsD1(a[1]);d[2]=AAbsD1(a[2]);d[3]=AAbsD1(a[3]);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC retAF2 opAAbsF2(outAF2 d,inAF2 a){d[0]=AAbsF1(a[0]);d[1]=AAbsF1(a[1]);return d;}
+ A_STATIC retAF3 opAAbsF3(outAF3 d,inAF3 a){d[0]=AAbsF1(a[0]);d[1]=AAbsF1(a[1]);d[2]=AAbsF1(a[2]);return d;}
+ A_STATIC retAF4 opAAbsF4(outAF4 d,inAF4 a){d[0]=AAbsF1(a[0]);d[1]=AAbsF1(a[1]);d[2]=AAbsF1(a[2]);d[3]=AAbsF1(a[3]);return d;}
+//==============================================================================================================================
+ A_STATIC retAD2 opAAddD2(outAD2 d,inAD2 a,inAD2 b){d[0]=a[0]+b[0];d[1]=a[1]+b[1];return d;}
+ A_STATIC retAD3 opAAddD3(outAD3 d,inAD3 a,inAD3 b){d[0]=a[0]+b[0];d[1]=a[1]+b[1];d[2]=a[2]+b[2];return d;}
+ A_STATIC retAD4 opAAddD4(outAD4 d,inAD4 a,inAD4 b){d[0]=a[0]+b[0];d[1]=a[1]+b[1];d[2]=a[2]+b[2];d[3]=a[3]+b[3];return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC retAF2 opAAddF2(outAF2 d,inAF2 a,inAF2 b){d[0]=a[0]+b[0];d[1]=a[1]+b[1];return d;}
+ A_STATIC retAF3 opAAddF3(outAF3 d,inAF3 a,inAF3 b){d[0]=a[0]+b[0];d[1]=a[1]+b[1];d[2]=a[2]+b[2];return d;}
+ A_STATIC retAF4 opAAddF4(outAF4 d,inAF4 a,inAF4 b){d[0]=a[0]+b[0];d[1]=a[1]+b[1];d[2]=a[2]+b[2];d[3]=a[3]+b[3];return d;}
+//==============================================================================================================================
+ A_STATIC retAD2 opAAddOneD2(outAD2 d,inAD2 a,AD1 b){d[0]=a[0]+b;d[1]=a[1]+b;return d;}
+ A_STATIC retAD3 opAAddOneD3(outAD3 d,inAD3 a,AD1 b){d[0]=a[0]+b;d[1]=a[1]+b;d[2]=a[2]+b;return d;}
+ A_STATIC retAD4 opAAddOneD4(outAD4 d,inAD4 a,AD1 b){d[0]=a[0]+b;d[1]=a[1]+b;d[2]=a[2]+b;d[3]=a[3]+b;return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC retAF2 opAAddOneF2(outAF2 d,inAF2 a,AF1 b){d[0]=a[0]+b;d[1]=a[1]+b;return d;}
+ A_STATIC retAF3 opAAddOneF3(outAF3 d,inAF3 a,AF1 b){d[0]=a[0]+b;d[1]=a[1]+b;d[2]=a[2]+b;return d;}
+ A_STATIC retAF4 opAAddOneF4(outAF4 d,inAF4 a,AF1 b){d[0]=a[0]+b;d[1]=a[1]+b;d[2]=a[2]+b;d[3]=a[3]+b;return d;}
+//==============================================================================================================================
+ A_STATIC retAD2 opACpyD2(outAD2 d,inAD2 a){d[0]=a[0];d[1]=a[1];return d;}
+ A_STATIC retAD3 opACpyD3(outAD3 d,inAD3 a){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d;}
+ A_STATIC retAD4 opACpyD4(outAD4 d,inAD4 a){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC retAF2 opACpyF2(outAF2 d,inAF2 a){d[0]=a[0];d[1]=a[1];return d;}
+ A_STATIC retAF3 opACpyF3(outAF3 d,inAF3 a){d[0]=a[0];d[1]=a[1];d[2]=a[2];return d;}
+ A_STATIC retAF4 opACpyF4(outAF4 d,inAF4 a){d[0]=a[0];d[1]=a[1];d[2]=a[2];d[3]=a[3];return d;}
+//==============================================================================================================================
+ A_STATIC retAD2 opALerpD2(outAD2 d,inAD2 a,inAD2 b,inAD2 c){d[0]=ALerpD1(a[0],b[0],c[0]);d[1]=ALerpD1(a[1],b[1],c[1]);return d;}
+ A_STATIC retAD3 opALerpD3(outAD3 d,inAD3 a,inAD3 b,inAD3 c){d[0]=ALerpD1(a[0],b[0],c[0]);d[1]=ALerpD1(a[1],b[1],c[1]);d[2]=ALerpD1(a[2],b[2],c[2]);return d;}
+ A_STATIC retAD4 opALerpD4(outAD4 d,inAD4 a,inAD4 b,inAD4 c){d[0]=ALerpD1(a[0],b[0],c[0]);d[1]=ALerpD1(a[1],b[1],c[1]);d[2]=ALerpD1(a[2],b[2],c[2]);d[3]=ALerpD1(a[3],b[3],c[3]);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC retAF2 opALerpF2(outAF2 d,inAF2 a,inAF2 b,inAF2 c){d[0]=ALerpF1(a[0],b[0],c[0]);d[1]=ALerpF1(a[1],b[1],c[1]);return d;}
+ A_STATIC retAF3 opALerpF3(outAF3 d,inAF3 a,inAF3 b,inAF3 c){d[0]=ALerpF1(a[0],b[0],c[0]);d[1]=ALerpF1(a[1],b[1],c[1]);d[2]=ALerpF1(a[2],b[2],c[2]);return d;}
+ A_STATIC retAF4 opALerpF4(outAF4 d,inAF4 a,inAF4 b,inAF4 c){d[0]=ALerpF1(a[0],b[0],c[0]);d[1]=ALerpF1(a[1],b[1],c[1]);d[2]=ALerpF1(a[2],b[2],c[2]);d[3]=ALerpF1(a[3],b[3],c[3]);return d;}
+//==============================================================================================================================
+ A_STATIC retAD2 opALerpOneD2(outAD2 d,inAD2 a,inAD2 b,AD1 c){d[0]=ALerpD1(a[0],b[0],c);d[1]=ALerpD1(a[1],b[1],c);return d;}
+ A_STATIC retAD3 opALerpOneD3(outAD3 d,inAD3 a,inAD3 b,AD1 c){d[0]=ALerpD1(a[0],b[0],c);d[1]=ALerpD1(a[1],b[1],c);d[2]=ALerpD1(a[2],b[2],c);return d;}
+ A_STATIC retAD4 opALerpOneD4(outAD4 d,inAD4 a,inAD4 b,AD1 c){d[0]=ALerpD1(a[0],b[0],c);d[1]=ALerpD1(a[1],b[1],c);d[2]=ALerpD1(a[2],b[2],c);d[3]=ALerpD1(a[3],b[3],c);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC retAF2 opALerpOneF2(outAF2 d,inAF2 a,inAF2 b,AF1 c){d[0]=ALerpF1(a[0],b[0],c);d[1]=ALerpF1(a[1],b[1],c);return d;}
+ A_STATIC retAF3 opALerpOneF3(outAF3 d,inAF3 a,inAF3 b,AF1 c){d[0]=ALerpF1(a[0],b[0],c);d[1]=ALerpF1(a[1],b[1],c);d[2]=ALerpF1(a[2],b[2],c);return d;}
+ A_STATIC retAF4 opALerpOneF4(outAF4 d,inAF4 a,inAF4 b,AF1 c){d[0]=ALerpF1(a[0],b[0],c);d[1]=ALerpF1(a[1],b[1],c);d[2]=ALerpF1(a[2],b[2],c);d[3]=ALerpF1(a[3],b[3],c);return d;}
+//==============================================================================================================================
+ A_STATIC retAD2 opAMaxD2(outAD2 d,inAD2 a,inAD2 b){d[0]=AMaxD1(a[0],b[0]);d[1]=AMaxD1(a[1],b[1]);return d;}
+ A_STATIC retAD3 opAMaxD3(outAD3 d,inAD3 a,inAD3 b){d[0]=AMaxD1(a[0],b[0]);d[1]=AMaxD1(a[1],b[1]);d[2]=AMaxD1(a[2],b[2]);return d;}
+ A_STATIC retAD4 opAMaxD4(outAD4 d,inAD4 a,inAD4 b){d[0]=AMaxD1(a[0],b[0]);d[1]=AMaxD1(a[1],b[1]);d[2]=AMaxD1(a[2],b[2]);d[3]=AMaxD1(a[3],b[3]);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC retAF2 opAMaxF2(outAF2 d,inAF2 a,inAF2 b){d[0]=AMaxF1(a[0],b[0]);d[1]=AMaxF1(a[1],b[1]);return d;}
+ A_STATIC retAF3 opAMaxF3(outAF3 d,inAF3 a,inAF3 b){d[0]=AMaxF1(a[0],b[0]);d[1]=AMaxF1(a[1],b[1]);d[2]=AMaxF1(a[2],b[2]);return d;}
+ A_STATIC retAF4 opAMaxF4(outAF4 d,inAF4 a,inAF4 b){d[0]=AMaxF1(a[0],b[0]);d[1]=AMaxF1(a[1],b[1]);d[2]=AMaxF1(a[2],b[2]);d[3]=AMaxF1(a[3],b[3]);return d;}
+//==============================================================================================================================
+ A_STATIC retAD2 opAMinD2(outAD2 d,inAD2 a,inAD2 b){d[0]=AMinD1(a[0],b[0]);d[1]=AMinD1(a[1],b[1]);return d;}
+ A_STATIC retAD3 opAMinD3(outAD3 d,inAD3 a,inAD3 b){d[0]=AMinD1(a[0],b[0]);d[1]=AMinD1(a[1],b[1]);d[2]=AMinD1(a[2],b[2]);return d;}
+ A_STATIC retAD4 opAMinD4(outAD4 d,inAD4 a,inAD4 b){d[0]=AMinD1(a[0],b[0]);d[1]=AMinD1(a[1],b[1]);d[2]=AMinD1(a[2],b[2]);d[3]=AMinD1(a[3],b[3]);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC retAF2 opAMinF2(outAF2 d,inAF2 a,inAF2 b){d[0]=AMinF1(a[0],b[0]);d[1]=AMinF1(a[1],b[1]);return d;}
+ A_STATIC retAF3 opAMinF3(outAF3 d,inAF3 a,inAF3 b){d[0]=AMinF1(a[0],b[0]);d[1]=AMinF1(a[1],b[1]);d[2]=AMinF1(a[2],b[2]);return d;}
+ A_STATIC retAF4 opAMinF4(outAF4 d,inAF4 a,inAF4 b){d[0]=AMinF1(a[0],b[0]);d[1]=AMinF1(a[1],b[1]);d[2]=AMinF1(a[2],b[2]);d[3]=AMinF1(a[3],b[3]);return d;}
+//==============================================================================================================================
+ A_STATIC retAD2 opAMulD2(outAD2 d,inAD2 a,inAD2 b){d[0]=a[0]*b[0];d[1]=a[1]*b[1];return d;}
+ A_STATIC retAD3 opAMulD3(outAD3 d,inAD3 a,inAD3 b){d[0]=a[0]*b[0];d[1]=a[1]*b[1];d[2]=a[2]*b[2];return d;}
+ A_STATIC retAD4 opAMulD4(outAD4 d,inAD4 a,inAD4 b){d[0]=a[0]*b[0];d[1]=a[1]*b[1];d[2]=a[2]*b[2];d[3]=a[3]*b[3];return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC retAF2 opAMulF2(outAF2 d,inAF2 a,inAF2 b){d[0]=a[0]*b[0];d[1]=a[1]*b[1];return d;}
+ A_STATIC retAF3 opAMulF3(outAF3 d,inAF3 a,inAF3 b){d[0]=a[0]*b[0];d[1]=a[1]*b[1];d[2]=a[2]*b[2];return d;}
+ A_STATIC retAF4 opAMulF4(outAF4 d,inAF4 a,inAF4 b){d[0]=a[0]*b[0];d[1]=a[1]*b[1];d[2]=a[2]*b[2];d[3]=a[3]*b[3];return d;}
+//==============================================================================================================================
+ A_STATIC retAD2 opAMulOneD2(outAD2 d,inAD2 a,AD1 b){d[0]=a[0]*b;d[1]=a[1]*b;return d;}
+ A_STATIC retAD3 opAMulOneD3(outAD3 d,inAD3 a,AD1 b){d[0]=a[0]*b;d[1]=a[1]*b;d[2]=a[2]*b;return d;}
+ A_STATIC retAD4 opAMulOneD4(outAD4 d,inAD4 a,AD1 b){d[0]=a[0]*b;d[1]=a[1]*b;d[2]=a[2]*b;d[3]=a[3]*b;return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC retAF2 opAMulOneF2(outAF2 d,inAF2 a,AF1 b){d[0]=a[0]*b;d[1]=a[1]*b;return d;}
+ A_STATIC retAF3 opAMulOneF3(outAF3 d,inAF3 a,AF1 b){d[0]=a[0]*b;d[1]=a[1]*b;d[2]=a[2]*b;return d;}
+ A_STATIC retAF4 opAMulOneF4(outAF4 d,inAF4 a,AF1 b){d[0]=a[0]*b;d[1]=a[1]*b;d[2]=a[2]*b;d[3]=a[3]*b;return d;}
+//==============================================================================================================================
+ A_STATIC retAD2 opANegD2(outAD2 d,inAD2 a){d[0]=-a[0];d[1]=-a[1];return d;}
+ A_STATIC retAD3 opANegD3(outAD3 d,inAD3 a){d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d;}
+ A_STATIC retAD4 opANegD4(outAD4 d,inAD4 a){d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=-a[3];return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC retAF2 opANegF2(outAF2 d,inAF2 a){d[0]=-a[0];d[1]=-a[1];return d;}
+ A_STATIC retAF3 opANegF3(outAF3 d,inAF3 a){d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];return d;}
+ A_STATIC retAF4 opANegF4(outAF4 d,inAF4 a){d[0]=-a[0];d[1]=-a[1];d[2]=-a[2];d[3]=-a[3];return d;}
+//==============================================================================================================================
+ A_STATIC retAD2 opARcpD2(outAD2 d,inAD2 a){d[0]=ARcpD1(a[0]);d[1]=ARcpD1(a[1]);return d;}
+ A_STATIC retAD3 opARcpD3(outAD3 d,inAD3 a){d[0]=ARcpD1(a[0]);d[1]=ARcpD1(a[1]);d[2]=ARcpD1(a[2]);return d;}
+ A_STATIC retAD4 opARcpD4(outAD4 d,inAD4 a){d[0]=ARcpD1(a[0]);d[1]=ARcpD1(a[1]);d[2]=ARcpD1(a[2]);d[3]=ARcpD1(a[3]);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ A_STATIC retAF2 opARcpF2(outAF2 d,inAF2 a){d[0]=ARcpF1(a[0]);d[1]=ARcpF1(a[1]);return d;}
+ A_STATIC retAF3 opARcpF3(outAF3 d,inAF3 a){d[0]=ARcpF1(a[0]);d[1]=ARcpF1(a[1]);d[2]=ARcpF1(a[2]);return d;}
+ A_STATIC retAF4 opARcpF4(outAF4 d,inAF4 a){d[0]=ARcpF1(a[0]);d[1]=ARcpF1(a[1]);d[2]=ARcpF1(a[2]);d[3]=ARcpF1(a[3]);return d;}
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// HALF FLOAT PACKING
+//==============================================================================================================================
+ // Convert float to half (in lower 16-bits of output).
+ // Same fast technique as documented here: ftp://ftp.fox-toolkit.org/pub/fasthalffloatconversion.pdf
+ // Supports denormals.
+ // Conversion rules are to make computations possibly "safer" on the GPU,
+ // -INF & -NaN -> -65504
+ // +INF & +NaN -> +65504
+ A_STATIC AU1 AU1_AH1_AF1(AF1 f){
+ static AW1 base[512]={
+ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
+ 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,
+ 0x0200,0x0400,0x0800,0x0c00,0x1000,0x1400,0x1800,0x1c00,0x2000,0x2400,0x2800,0x2c00,0x3000,0x3400,0x3800,0x3c00,
+ 0x4000,0x4400,0x4800,0x4c00,0x5000,0x5400,0x5800,0x5c00,0x6000,0x6400,0x6800,0x6c00,0x7000,0x7400,0x7800,0x7bff,
+ 0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,
+ 0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,
+ 0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,
+ 0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,
+ 0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,
+ 0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,
+ 0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,0x7bff,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,
+ 0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8000,0x8001,0x8002,0x8004,0x8008,0x8010,0x8020,0x8040,0x8080,0x8100,
+ 0x8200,0x8400,0x8800,0x8c00,0x9000,0x9400,0x9800,0x9c00,0xa000,0xa400,0xa800,0xac00,0xb000,0xb400,0xb800,0xbc00,
+ 0xc000,0xc400,0xc800,0xcc00,0xd000,0xd400,0xd800,0xdc00,0xe000,0xe400,0xe800,0xec00,0xf000,0xf400,0xf800,0xfbff,
+ 0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,
+ 0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,
+ 0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,
+ 0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,
+ 0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,
+ 0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,
+ 0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff,0xfbff};
+ static AB1 shift[512]={
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x17,0x16,0x15,0x14,0x13,0x12,0x11,0x10,0x0f,
+ 0x0e,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,
+ 0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x17,0x16,0x15,0x14,0x13,0x12,0x11,0x10,0x0f,
+ 0x0e,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,
+ 0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x0d,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,
+ 0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18,0x18};
+ union{AF1 f;AU1 u;}bits;bits.f=f;AU1 u=bits.u;AU1 i=u>>23;return (AU1)(base[i])+((u&0x7fffff)>>shift[i]);}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Used to output packed constant.
+ A_STATIC AU1 AU1_AH2_AF2(inAF2 a){return AU1_AH1_AF1(a[0])+(AU1_AH1_AF1(a[1])<<16);}
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+//
+//
+// GLSL
+//
+//
+//==============================================================================================================================
+#if defined(A_GLSL) && defined(A_GPU)
+ #define AP1 bool
+ #define AP2 bvec2
+ #define AP3 bvec3
+ #define AP4 bvec4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AF1 float
+ #define AF2 vec2
+ #define AF3 vec3
+ #define AF4 vec4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AU1 uint
+ #define AU2 uvec2
+ #define AU3 uvec3
+ #define AU4 uvec4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ASU1 int
+ #define ASU2 ivec2
+ #define ASU3 ivec3
+ #define ASU4 ivec4
+//==============================================================================================================================
+ #define AF1_AU1(x) uintBitsToFloat(AU1(x))
+ #define AF2_AU2(x) uintBitsToFloat(AU2(x))
+ #define AF3_AU3(x) uintBitsToFloat(AU3(x))
+ #define AF4_AU4(x) uintBitsToFloat(AU4(x))
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AU1_AF1(x) floatBitsToUint(AF1(x))
+ #define AU2_AF2(x) floatBitsToUint(AF2(x))
+ #define AU3_AF3(x) floatBitsToUint(AF3(x))
+ #define AU4_AF4(x) floatBitsToUint(AF4(x))
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AU1_AH1_AF1_x(AF1 a){return packHalf2x16(AF2(a,0.0));}
+ #define AU1_AH1_AF1(a) AU1_AH1_AF1_x(AF1(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AU1_AH2_AF2 packHalf2x16
+ #define AU1_AW2Unorm_AF2 packUnorm2x16
+ #define AU1_AB4Unorm_AF4 packUnorm4x8
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AF2_AH2_AU1 unpackHalf2x16
+ #define AF2_AW2Unorm_AU1 unpackUnorm2x16
+ #define AF4_AB4Unorm_AU1 unpackUnorm4x8
+//==============================================================================================================================
+ AF1 AF1_x(AF1 a){return AF1(a);}
+ AF2 AF2_x(AF1 a){return AF2(a,a);}
+ AF3 AF3_x(AF1 a){return AF3(a,a,a);}
+ AF4 AF4_x(AF1 a){return AF4(a,a,a,a);}
+ #define AF1_(a) AF1_x(AF1(a))
+ #define AF2_(a) AF2_x(AF1(a))
+ #define AF3_(a) AF3_x(AF1(a))
+ #define AF4_(a) AF4_x(AF1(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AU1_x(AU1 a){return AU1(a);}
+ AU2 AU2_x(AU1 a){return AU2(a,a);}
+ AU3 AU3_x(AU1 a){return AU3(a,a,a);}
+ AU4 AU4_x(AU1 a){return AU4(a,a,a,a);}
+ #define AU1_(a) AU1_x(AU1(a))
+ #define AU2_(a) AU2_x(AU1(a))
+ #define AU3_(a) AU3_x(AU1(a))
+ #define AU4_(a) AU4_x(AU1(a))
+//==============================================================================================================================
+ AU1 AAbsSU1(AU1 a){return AU1(abs(ASU1(a)));}
+ AU2 AAbsSU2(AU2 a){return AU2(abs(ASU2(a)));}
+ AU3 AAbsSU3(AU3 a){return AU3(abs(ASU3(a)));}
+ AU4 AAbsSU4(AU4 a){return AU4(abs(ASU4(a)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 ABfe(AU1 src,AU1 off,AU1 bits){return bitfieldExtract(src,ASU1(off),ASU1(bits));}
+ AU1 ABfi(AU1 src,AU1 ins,AU1 mask){return (ins&mask)|(src&(~mask));}
+ // Proxy for V_BFI_B32 where the 'mask' is set as 'bits', 'mask=(1<<bits)-1', and 'bits' needs to be an immediate.
+ AU1 ABfiM(AU1 src,AU1 ins,AU1 bits){return bitfieldInsert(src,ins,0,ASU1(bits));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // V_MED3_F32.
+ AF1 AClampF1(AF1 x,AF1 n,AF1 m){return clamp(x,n,m);}
+ AF2 AClampF2(AF2 x,AF2 n,AF2 m){return clamp(x,n,m);}
+ AF3 AClampF3(AF3 x,AF3 n,AF3 m){return clamp(x,n,m);}
+ AF4 AClampF4(AF4 x,AF4 n,AF4 m){return clamp(x,n,m);}
+//------------------------------------------------------------------------------------------------------------------------------
+ // V_FRACT_F32 (note DX frac() is different).
+ AF1 AFractF1(AF1 x){return fract(x);}
+ AF2 AFractF2(AF2 x){return fract(x);}
+ AF3 AFractF3(AF3 x){return fract(x);}
+ AF4 AFractF4(AF4 x){return fract(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 ALerpF1(AF1 x,AF1 y,AF1 a){return mix(x,y,a);}
+ AF2 ALerpF2(AF2 x,AF2 y,AF2 a){return mix(x,y,a);}
+ AF3 ALerpF3(AF3 x,AF3 y,AF3 a){return mix(x,y,a);}
+ AF4 ALerpF4(AF4 x,AF4 y,AF4 a){return mix(x,y,a);}
+//------------------------------------------------------------------------------------------------------------------------------
+ // V_MAX3_F32.
+ AF1 AMax3F1(AF1 x,AF1 y,AF1 z){return max(x,max(y,z));}
+ AF2 AMax3F2(AF2 x,AF2 y,AF2 z){return max(x,max(y,z));}
+ AF3 AMax3F3(AF3 x,AF3 y,AF3 z){return max(x,max(y,z));}
+ AF4 AMax3F4(AF4 x,AF4 y,AF4 z){return max(x,max(y,z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AMax3SU1(AU1 x,AU1 y,AU1 z){return AU1(max(ASU1(x),max(ASU1(y),ASU1(z))));}
+ AU2 AMax3SU2(AU2 x,AU2 y,AU2 z){return AU2(max(ASU2(x),max(ASU2(y),ASU2(z))));}
+ AU3 AMax3SU3(AU3 x,AU3 y,AU3 z){return AU3(max(ASU3(x),max(ASU3(y),ASU3(z))));}
+ AU4 AMax3SU4(AU4 x,AU4 y,AU4 z){return AU4(max(ASU4(x),max(ASU4(y),ASU4(z))));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AMax3U1(AU1 x,AU1 y,AU1 z){return max(x,max(y,z));}
+ AU2 AMax3U2(AU2 x,AU2 y,AU2 z){return max(x,max(y,z));}
+ AU3 AMax3U3(AU3 x,AU3 y,AU3 z){return max(x,max(y,z));}
+ AU4 AMax3U4(AU4 x,AU4 y,AU4 z){return max(x,max(y,z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AMaxSU1(AU1 a,AU1 b){return AU1(max(ASU1(a),ASU1(b)));}
+ AU2 AMaxSU2(AU2 a,AU2 b){return AU2(max(ASU2(a),ASU2(b)));}
+ AU3 AMaxSU3(AU3 a,AU3 b){return AU3(max(ASU3(a),ASU3(b)));}
+ AU4 AMaxSU4(AU4 a,AU4 b){return AU4(max(ASU4(a),ASU4(b)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Clamp has an easier pattern match for med3 when some ordering is known.
+ // V_MED3_F32.
+ AF1 AMed3F1(AF1 x,AF1 y,AF1 z){return max(min(x,y),min(max(x,y),z));}
+ AF2 AMed3F2(AF2 x,AF2 y,AF2 z){return max(min(x,y),min(max(x,y),z));}
+ AF3 AMed3F3(AF3 x,AF3 y,AF3 z){return max(min(x,y),min(max(x,y),z));}
+ AF4 AMed3F4(AF4 x,AF4 y,AF4 z){return max(min(x,y),min(max(x,y),z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // V_MIN3_F32.
+ AF1 AMin3F1(AF1 x,AF1 y,AF1 z){return min(x,min(y,z));}
+ AF2 AMin3F2(AF2 x,AF2 y,AF2 z){return min(x,min(y,z));}
+ AF3 AMin3F3(AF3 x,AF3 y,AF3 z){return min(x,min(y,z));}
+ AF4 AMin3F4(AF4 x,AF4 y,AF4 z){return min(x,min(y,z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AMin3SU1(AU1 x,AU1 y,AU1 z){return AU1(min(ASU1(x),min(ASU1(y),ASU1(z))));}
+ AU2 AMin3SU2(AU2 x,AU2 y,AU2 z){return AU2(min(ASU2(x),min(ASU2(y),ASU2(z))));}
+ AU3 AMin3SU3(AU3 x,AU3 y,AU3 z){return AU3(min(ASU3(x),min(ASU3(y),ASU3(z))));}
+ AU4 AMin3SU4(AU4 x,AU4 y,AU4 z){return AU4(min(ASU4(x),min(ASU4(y),ASU4(z))));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AMin3U1(AU1 x,AU1 y,AU1 z){return min(x,min(y,z));}
+ AU2 AMin3U2(AU2 x,AU2 y,AU2 z){return min(x,min(y,z));}
+ AU3 AMin3U3(AU3 x,AU3 y,AU3 z){return min(x,min(y,z));}
+ AU4 AMin3U4(AU4 x,AU4 y,AU4 z){return min(x,min(y,z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AMinSU1(AU1 a,AU1 b){return AU1(min(ASU1(a),ASU1(b)));}
+ AU2 AMinSU2(AU2 a,AU2 b){return AU2(min(ASU2(a),ASU2(b)));}
+ AU3 AMinSU3(AU3 a,AU3 b){return AU3(min(ASU3(a),ASU3(b)));}
+ AU4 AMinSU4(AU4 a,AU4 b){return AU4(min(ASU4(a),ASU4(b)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Normalized trig. Valid input domain is {-256 to +256}. No GLSL compiler intrinsic exists to map to this currently.
+ // V_COS_F32.
+ AF1 ANCosF1(AF1 x){return cos(x*AF1_(A_2PI));}
+ AF2 ANCosF2(AF2 x){return cos(x*AF2_(A_2PI));}
+ AF3 ANCosF3(AF3 x){return cos(x*AF3_(A_2PI));}
+ AF4 ANCosF4(AF4 x){return cos(x*AF4_(A_2PI));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Normalized trig. Valid input domain is {-256 to +256}. No GLSL compiler intrinsic exists to map to this currently.
+ // V_SIN_F32.
+ AF1 ANSinF1(AF1 x){return sin(x*AF1_(A_2PI));}
+ AF2 ANSinF2(AF2 x){return sin(x*AF2_(A_2PI));}
+ AF3 ANSinF3(AF3 x){return sin(x*AF3_(A_2PI));}
+ AF4 ANSinF4(AF4 x){return sin(x*AF4_(A_2PI));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 ARcpF1(AF1 x){return AF1_(1.0)/x;}
+ AF2 ARcpF2(AF2 x){return AF2_(1.0)/x;}
+ AF3 ARcpF3(AF3 x){return AF3_(1.0)/x;}
+ AF4 ARcpF4(AF4 x){return AF4_(1.0)/x;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 ARsqF1(AF1 x){return AF1_(1.0)/sqrt(x);}
+ AF2 ARsqF2(AF2 x){return AF2_(1.0)/sqrt(x);}
+ AF3 ARsqF3(AF3 x){return AF3_(1.0)/sqrt(x);}
+ AF4 ARsqF4(AF4 x){return AF4_(1.0)/sqrt(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 ASatF1(AF1 x){return clamp(x,AF1_(0.0),AF1_(1.0));}
+ AF2 ASatF2(AF2 x){return clamp(x,AF2_(0.0),AF2_(1.0));}
+ AF3 ASatF3(AF3 x){return clamp(x,AF3_(0.0),AF3_(1.0));}
+ AF4 ASatF4(AF4 x){return clamp(x,AF4_(0.0),AF4_(1.0));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AShrSU1(AU1 a,AU1 b){return AU1(ASU1(a)>>ASU1(b));}
+ AU2 AShrSU2(AU2 a,AU2 b){return AU2(ASU2(a)>>ASU2(b));}
+ AU3 AShrSU3(AU3 a,AU3 b){return AU3(ASU3(a)>>ASU3(b));}
+ AU4 AShrSU4(AU4 a,AU4 b){return AU4(ASU4(a)>>ASU4(b));}
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// GLSL BYTE
+//==============================================================================================================================
+ #ifdef A_BYTE
+ #define AB1 uint8_t
+ #define AB2 u8vec2
+ #define AB3 u8vec3
+ #define AB4 u8vec4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ASB1 int8_t
+ #define ASB2 i8vec2
+ #define ASB3 i8vec3
+ #define ASB4 i8vec4
+//------------------------------------------------------------------------------------------------------------------------------
+ AB1 AB1_x(AB1 a){return AB1(a);}
+ AB2 AB2_x(AB1 a){return AB2(a,a);}
+ AB3 AB3_x(AB1 a){return AB3(a,a,a);}
+ AB4 AB4_x(AB1 a){return AB4(a,a,a,a);}
+ #define AB1_(a) AB1_x(AB1(a))
+ #define AB2_(a) AB2_x(AB1(a))
+ #define AB3_(a) AB3_x(AB1(a))
+ #define AB4_(a) AB4_x(AB1(a))
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// GLSL HALF
+//==============================================================================================================================
+ #ifdef A_HALF
+ #define AH1 float16_t
+ #define AH2 f16vec2
+ #define AH3 f16vec3
+ #define AH4 f16vec4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AW1 uint16_t
+ #define AW2 u16vec2
+ #define AW3 u16vec3
+ #define AW4 u16vec4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ASW1 int16_t
+ #define ASW2 i16vec2
+ #define ASW3 i16vec3
+ #define ASW4 i16vec4
+//==============================================================================================================================
+ #define AH2_AU1(x) unpackFloat2x16(AU1(x))
+ AH4 AH4_AU2_x(AU2 x){return AH4(unpackFloat2x16(x.x),unpackFloat2x16(x.y));}
+ #define AH4_AU2(x) AH4_AU2_x(AU2(x))
+ #define AW2_AU1(x) unpackUint2x16(AU1(x))
+ #define AW4_AU2(x) unpackUint4x16(pack64(AU2(x)))
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AU1_AH2(x) packFloat2x16(AH2(x))
+ AU2 AU2_AH4_x(AH4 x){return AU2(packFloat2x16(x.xy),packFloat2x16(x.zw));}
+ #define AU2_AH4(x) AU2_AH4_x(AH4(x))
+ #define AU1_AW2(x) packUint2x16(AW2(x))
+ #define AU2_AW4(x) unpack32(packUint4x16(AW4(x)))
+//==============================================================================================================================
+ #define AW1_AH1(x) halfBitsToUint16(AH1(x))
+ #define AW2_AH2(x) halfBitsToUint16(AH2(x))
+ #define AW3_AH3(x) halfBitsToUint16(AH3(x))
+ #define AW4_AH4(x) halfBitsToUint16(AH4(x))
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AH1_AW1(x) uint16BitsToHalf(AW1(x))
+ #define AH2_AW2(x) uint16BitsToHalf(AW2(x))
+ #define AH3_AW3(x) uint16BitsToHalf(AW3(x))
+ #define AH4_AW4(x) uint16BitsToHalf(AW4(x))
+//==============================================================================================================================
+ AH1 AH1_x(AH1 a){return AH1(a);}
+ AH2 AH2_x(AH1 a){return AH2(a,a);}
+ AH3 AH3_x(AH1 a){return AH3(a,a,a);}
+ AH4 AH4_x(AH1 a){return AH4(a,a,a,a);}
+ #define AH1_(a) AH1_x(AH1(a))
+ #define AH2_(a) AH2_x(AH1(a))
+ #define AH3_(a) AH3_x(AH1(a))
+ #define AH4_(a) AH4_x(AH1(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ AW1 AW1_x(AW1 a){return AW1(a);}
+ AW2 AW2_x(AW1 a){return AW2(a,a);}
+ AW3 AW3_x(AW1 a){return AW3(a,a,a);}
+ AW4 AW4_x(AW1 a){return AW4(a,a,a,a);}
+ #define AW1_(a) AW1_x(AW1(a))
+ #define AW2_(a) AW2_x(AW1(a))
+ #define AW3_(a) AW3_x(AW1(a))
+ #define AW4_(a) AW4_x(AW1(a))
+//==============================================================================================================================
+ AW1 AAbsSW1(AW1 a){return AW1(abs(ASW1(a)));}
+ AW2 AAbsSW2(AW2 a){return AW2(abs(ASW2(a)));}
+ AW3 AAbsSW3(AW3 a){return AW3(abs(ASW3(a)));}
+ AW4 AAbsSW4(AW4 a){return AW4(abs(ASW4(a)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AClampH1(AH1 x,AH1 n,AH1 m){return clamp(x,n,m);}
+ AH2 AClampH2(AH2 x,AH2 n,AH2 m){return clamp(x,n,m);}
+ AH3 AClampH3(AH3 x,AH3 n,AH3 m){return clamp(x,n,m);}
+ AH4 AClampH4(AH4 x,AH4 n,AH4 m){return clamp(x,n,m);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AFractH1(AH1 x){return fract(x);}
+ AH2 AFractH2(AH2 x){return fract(x);}
+ AH3 AFractH3(AH3 x){return fract(x);}
+ AH4 AFractH4(AH4 x){return fract(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 ALerpH1(AH1 x,AH1 y,AH1 a){return mix(x,y,a);}
+ AH2 ALerpH2(AH2 x,AH2 y,AH2 a){return mix(x,y,a);}
+ AH3 ALerpH3(AH3 x,AH3 y,AH3 a){return mix(x,y,a);}
+ AH4 ALerpH4(AH4 x,AH4 y,AH4 a){return mix(x,y,a);}
+//------------------------------------------------------------------------------------------------------------------------------
+ // No packed version of max3.
+ AH1 AMax3H1(AH1 x,AH1 y,AH1 z){return max(x,max(y,z));}
+ AH2 AMax3H2(AH2 x,AH2 y,AH2 z){return max(x,max(y,z));}
+ AH3 AMax3H3(AH3 x,AH3 y,AH3 z){return max(x,max(y,z));}
+ AH4 AMax3H4(AH4 x,AH4 y,AH4 z){return max(x,max(y,z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AW1 AMaxSW1(AW1 a,AW1 b){return AW1(max(ASU1(a),ASU1(b)));}
+ AW2 AMaxSW2(AW2 a,AW2 b){return AW2(max(ASU2(a),ASU2(b)));}
+ AW3 AMaxSW3(AW3 a,AW3 b){return AW3(max(ASU3(a),ASU3(b)));}
+ AW4 AMaxSW4(AW4 a,AW4 b){return AW4(max(ASU4(a),ASU4(b)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // No packed version of min3.
+ AH1 AMin3H1(AH1 x,AH1 y,AH1 z){return min(x,min(y,z));}
+ AH2 AMin3H2(AH2 x,AH2 y,AH2 z){return min(x,min(y,z));}
+ AH3 AMin3H3(AH3 x,AH3 y,AH3 z){return min(x,min(y,z));}
+ AH4 AMin3H4(AH4 x,AH4 y,AH4 z){return min(x,min(y,z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AW1 AMinSW1(AW1 a,AW1 b){return AW1(min(ASU1(a),ASU1(b)));}
+ AW2 AMinSW2(AW2 a,AW2 b){return AW2(min(ASU2(a),ASU2(b)));}
+ AW3 AMinSW3(AW3 a,AW3 b){return AW3(min(ASU3(a),ASU3(b)));}
+ AW4 AMinSW4(AW4 a,AW4 b){return AW4(min(ASU4(a),ASU4(b)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 ARcpH1(AH1 x){return AH1_(1.0)/x;}
+ AH2 ARcpH2(AH2 x){return AH2_(1.0)/x;}
+ AH3 ARcpH3(AH3 x){return AH3_(1.0)/x;}
+ AH4 ARcpH4(AH4 x){return AH4_(1.0)/x;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 ARsqH1(AH1 x){return AH1_(1.0)/sqrt(x);}
+ AH2 ARsqH2(AH2 x){return AH2_(1.0)/sqrt(x);}
+ AH3 ARsqH3(AH3 x){return AH3_(1.0)/sqrt(x);}
+ AH4 ARsqH4(AH4 x){return AH4_(1.0)/sqrt(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 ASatH1(AH1 x){return clamp(x,AH1_(0.0),AH1_(1.0));}
+ AH2 ASatH2(AH2 x){return clamp(x,AH2_(0.0),AH2_(1.0));}
+ AH3 ASatH3(AH3 x){return clamp(x,AH3_(0.0),AH3_(1.0));}
+ AH4 ASatH4(AH4 x){return clamp(x,AH4_(0.0),AH4_(1.0));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AW1 AShrSW1(AW1 a,AW1 b){return AW1(ASW1(a)>>ASW1(b));}
+ AW2 AShrSW2(AW2 a,AW2 b){return AW2(ASW2(a)>>ASW2(b));}
+ AW3 AShrSW3(AW3 a,AW3 b){return AW3(ASW3(a)>>ASW3(b));}
+ AW4 AShrSW4(AW4 a,AW4 b){return AW4(ASW4(a)>>ASW4(b));}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// GLSL DOUBLE
+//==============================================================================================================================
+ #ifdef A_DUBL
+ #define AD1 double
+ #define AD2 dvec2
+ #define AD3 dvec3
+ #define AD4 dvec4
+//------------------------------------------------------------------------------------------------------------------------------
+ AD1 AD1_x(AD1 a){return AD1(a);}
+ AD2 AD2_x(AD1 a){return AD2(a,a);}
+ AD3 AD3_x(AD1 a){return AD3(a,a,a);}
+ AD4 AD4_x(AD1 a){return AD4(a,a,a,a);}
+ #define AD1_(a) AD1_x(AD1(a))
+ #define AD2_(a) AD2_x(AD1(a))
+ #define AD3_(a) AD3_x(AD1(a))
+ #define AD4_(a) AD4_x(AD1(a))
+//==============================================================================================================================
+ AD1 AFractD1(AD1 x){return fract(x);}
+ AD2 AFractD2(AD2 x){return fract(x);}
+ AD3 AFractD3(AD3 x){return fract(x);}
+ AD4 AFractD4(AD4 x){return fract(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD1 ALerpD1(AD1 x,AD1 y,AD1 a){return mix(x,y,a);}
+ AD2 ALerpD2(AD2 x,AD2 y,AD2 a){return mix(x,y,a);}
+ AD3 ALerpD3(AD3 x,AD3 y,AD3 a){return mix(x,y,a);}
+ AD4 ALerpD4(AD4 x,AD4 y,AD4 a){return mix(x,y,a);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD1 ARcpD1(AD1 x){return AD1_(1.0)/x;}
+ AD2 ARcpD2(AD2 x){return AD2_(1.0)/x;}
+ AD3 ARcpD3(AD3 x){return AD3_(1.0)/x;}
+ AD4 ARcpD4(AD4 x){return AD4_(1.0)/x;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD1 ARsqD1(AD1 x){return AD1_(1.0)/sqrt(x);}
+ AD2 ARsqD2(AD2 x){return AD2_(1.0)/sqrt(x);}
+ AD3 ARsqD3(AD3 x){return AD3_(1.0)/sqrt(x);}
+ AD4 ARsqD4(AD4 x){return AD4_(1.0)/sqrt(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD1 ASatD1(AD1 x){return clamp(x,AD1_(0.0),AD1_(1.0));}
+ AD2 ASatD2(AD2 x){return clamp(x,AD2_(0.0),AD2_(1.0));}
+ AD3 ASatD3(AD3 x){return clamp(x,AD3_(0.0),AD3_(1.0));}
+ AD4 ASatD4(AD4 x){return clamp(x,AD4_(0.0),AD4_(1.0));}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// GLSL LONG
+//==============================================================================================================================
+ #ifdef A_LONG
+ #define AL1 uint64_t
+ #define AL2 u64vec2
+ #define AL3 u64vec3
+ #define AL4 u64vec4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ASL1 int64_t
+ #define ASL2 i64vec2
+ #define ASL3 i64vec3
+ #define ASL4 i64vec4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AL1_AU2(x) packUint2x32(AU2(x))
+ #define AU2_AL1(x) unpackUint2x32(AL1(x))
+//------------------------------------------------------------------------------------------------------------------------------
+ AL1 AL1_x(AL1 a){return AL1(a);}
+ AL2 AL2_x(AL1 a){return AL2(a,a);}
+ AL3 AL3_x(AL1 a){return AL3(a,a,a);}
+ AL4 AL4_x(AL1 a){return AL4(a,a,a,a);}
+ #define AL1_(a) AL1_x(AL1(a))
+ #define AL2_(a) AL2_x(AL1(a))
+ #define AL3_(a) AL3_x(AL1(a))
+ #define AL4_(a) AL4_x(AL1(a))
+//==============================================================================================================================
+ AL1 AAbsSL1(AL1 a){return AL1(abs(ASL1(a)));}
+ AL2 AAbsSL2(AL2 a){return AL2(abs(ASL2(a)));}
+ AL3 AAbsSL3(AL3 a){return AL3(abs(ASL3(a)));}
+ AL4 AAbsSL4(AL4 a){return AL4(abs(ASL4(a)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AL1 AMaxSL1(AL1 a,AL1 b){return AL1(max(ASU1(a),ASU1(b)));}
+ AL2 AMaxSL2(AL2 a,AL2 b){return AL2(max(ASU2(a),ASU2(b)));}
+ AL3 AMaxSL3(AL3 a,AL3 b){return AL3(max(ASU3(a),ASU3(b)));}
+ AL4 AMaxSL4(AL4 a,AL4 b){return AL4(max(ASU4(a),ASU4(b)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AL1 AMinSL1(AL1 a,AL1 b){return AL1(min(ASU1(a),ASU1(b)));}
+ AL2 AMinSL2(AL2 a,AL2 b){return AL2(min(ASU2(a),ASU2(b)));}
+ AL3 AMinSL3(AL3 a,AL3 b){return AL3(min(ASU3(a),ASU3(b)));}
+ AL4 AMinSL4(AL4 a,AL4 b){return AL4(min(ASU4(a),ASU4(b)));}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// WAVE OPERATIONS
+//==============================================================================================================================
+ #ifdef A_WAVE
+ // Where 'x' must be a compile time literal.
+ AF1 AWaveXorF1(AF1 v,AU1 x){return subgroupShuffleXor(v,x);}
+ AF2 AWaveXorF2(AF2 v,AU1 x){return subgroupShuffleXor(v,x);}
+ AF3 AWaveXorF3(AF3 v,AU1 x){return subgroupShuffleXor(v,x);}
+ AF4 AWaveXorF4(AF4 v,AU1 x){return subgroupShuffleXor(v,x);}
+ AU1 AWaveXorU1(AU1 v,AU1 x){return subgroupShuffleXor(v,x);}
+ AU2 AWaveXorU2(AU2 v,AU1 x){return subgroupShuffleXor(v,x);}
+ AU3 AWaveXorU3(AU3 v,AU1 x){return subgroupShuffleXor(v,x);}
+ AU4 AWaveXorU4(AU4 v,AU1 x){return subgroupShuffleXor(v,x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ #ifdef A_HALF
+ AH2 AWaveXorH2(AH2 v,AU1 x){return AH2_AU1(subgroupShuffleXor(AU1_AH2(v),x));}
+ AH4 AWaveXorH4(AH4 v,AU1 x){return AH4_AU2(subgroupShuffleXor(AU2_AH4(v),x));}
+ AW2 AWaveXorW2(AW2 v,AU1 x){return AW2_AU1(subgroupShuffleXor(AU1_AW2(v),x));}
+ AW4 AWaveXorW4(AW4 v,AU1 x){return AW4_AU2(subgroupShuffleXor(AU2_AW4(v),x));}
+ #endif
+ #endif
+//==============================================================================================================================
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+//
+//
+// HLSL
+//
+//
+//==============================================================================================================================
+#if defined(A_HLSL) && defined(A_GPU)
+ #ifdef A_HLSL_6_2
+ #define AP1 bool
+ #define AP2 bool2
+ #define AP3 bool3
+ #define AP4 bool4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AF1 float32_t
+ #define AF2 float32_t2
+ #define AF3 float32_t3
+ #define AF4 float32_t4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AU1 uint32_t
+ #define AU2 uint32_t2
+ #define AU3 uint32_t3
+ #define AU4 uint32_t4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ASU1 int32_t
+ #define ASU2 int32_t2
+ #define ASU3 int32_t3
+ #define ASU4 int32_t4
+ #else
+ #define AP1 bool
+ #define AP2 bool2
+ #define AP3 bool3
+ #define AP4 bool4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AF1 float
+ #define AF2 float2
+ #define AF3 float3
+ #define AF4 float4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AU1 uint
+ #define AU2 uint2
+ #define AU3 uint3
+ #define AU4 uint4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ASU1 int
+ #define ASU2 int2
+ #define ASU3 int3
+ #define ASU4 int4
+ #endif
+//==============================================================================================================================
+ #define AF1_AU1(x) asfloat(AU1(x))
+ #define AF2_AU2(x) asfloat(AU2(x))
+ #define AF3_AU3(x) asfloat(AU3(x))
+ #define AF4_AU4(x) asfloat(AU4(x))
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AU1_AF1(x) asuint(AF1(x))
+ #define AU2_AF2(x) asuint(AF2(x))
+ #define AU3_AF3(x) asuint(AF3(x))
+ #define AU4_AF4(x) asuint(AF4(x))
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AU1_AH1_AF1_x(AF1 a){return f32tof16(a);}
+ #define AU1_AH1_AF1(a) AU1_AH1_AF1_x(AF1(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AU1_AH2_AF2_x(AF2 a){return f32tof16(a.x)|(f32tof16(a.y)<<16);}
+ #define AU1_AH2_AF2(a) AU1_AH2_AF2_x(AF2(a))
+ #define AU1_AB4Unorm_AF4(x) D3DCOLORtoUBYTE4(AF4(x))
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 AF2_AH2_AU1_x(AU1 x){return AF2(f16tof32(x&0xFFFF),f16tof32(x>>16));}
+ #define AF2_AH2_AU1(x) AF2_AH2_AU1_x(AU1(x))
+//==============================================================================================================================
+ AF1 AF1_x(AF1 a){return AF1(a);}
+ AF2 AF2_x(AF1 a){return AF2(a,a);}
+ AF3 AF3_x(AF1 a){return AF3(a,a,a);}
+ AF4 AF4_x(AF1 a){return AF4(a,a,a,a);}
+ #define AF1_(a) AF1_x(AF1(a))
+ #define AF2_(a) AF2_x(AF1(a))
+ #define AF3_(a) AF3_x(AF1(a))
+ #define AF4_(a) AF4_x(AF1(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AU1_x(AU1 a){return AU1(a);}
+ AU2 AU2_x(AU1 a){return AU2(a,a);}
+ AU3 AU3_x(AU1 a){return AU3(a,a,a);}
+ AU4 AU4_x(AU1 a){return AU4(a,a,a,a);}
+ #define AU1_(a) AU1_x(AU1(a))
+ #define AU2_(a) AU2_x(AU1(a))
+ #define AU3_(a) AU3_x(AU1(a))
+ #define AU4_(a) AU4_x(AU1(a))
+//==============================================================================================================================
+ AU1 AAbsSU1(AU1 a){return AU1(abs(ASU1(a)));}
+ AU2 AAbsSU2(AU2 a){return AU2(abs(ASU2(a)));}
+ AU3 AAbsSU3(AU3 a){return AU3(abs(ASU3(a)));}
+ AU4 AAbsSU4(AU4 a){return AU4(abs(ASU4(a)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 ABfe(AU1 src,AU1 off,AU1 bits){AU1 mask=(1u<<bits)-1;return (src>>off)&mask;}
+ AU1 ABfi(AU1 src,AU1 ins,AU1 mask){return (ins&mask)|(src&(~mask));}
+ AU1 ABfiM(AU1 src,AU1 ins,AU1 bits){AU1 mask=(1u<<bits)-1;return (ins&mask)|(src&(~mask));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AClampF1(AF1 x,AF1 n,AF1 m){return max(n,min(x,m));}
+ AF2 AClampF2(AF2 x,AF2 n,AF2 m){return max(n,min(x,m));}
+ AF3 AClampF3(AF3 x,AF3 n,AF3 m){return max(n,min(x,m));}
+ AF4 AClampF4(AF4 x,AF4 n,AF4 m){return max(n,min(x,m));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AFractF1(AF1 x){return x-floor(x);}
+ AF2 AFractF2(AF2 x){return x-floor(x);}
+ AF3 AFractF3(AF3 x){return x-floor(x);}
+ AF4 AFractF4(AF4 x){return x-floor(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 ALerpF1(AF1 x,AF1 y,AF1 a){return lerp(x,y,a);}
+ AF2 ALerpF2(AF2 x,AF2 y,AF2 a){return lerp(x,y,a);}
+ AF3 ALerpF3(AF3 x,AF3 y,AF3 a){return lerp(x,y,a);}
+ AF4 ALerpF4(AF4 x,AF4 y,AF4 a){return lerp(x,y,a);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AMax3F1(AF1 x,AF1 y,AF1 z){return max(x,max(y,z));}
+ AF2 AMax3F2(AF2 x,AF2 y,AF2 z){return max(x,max(y,z));}
+ AF3 AMax3F3(AF3 x,AF3 y,AF3 z){return max(x,max(y,z));}
+ AF4 AMax3F4(AF4 x,AF4 y,AF4 z){return max(x,max(y,z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AMax3SU1(AU1 x,AU1 y,AU1 z){return AU1(max(ASU1(x),max(ASU1(y),ASU1(z))));}
+ AU2 AMax3SU2(AU2 x,AU2 y,AU2 z){return AU2(max(ASU2(x),max(ASU2(y),ASU2(z))));}
+ AU3 AMax3SU3(AU3 x,AU3 y,AU3 z){return AU3(max(ASU3(x),max(ASU3(y),ASU3(z))));}
+ AU4 AMax3SU4(AU4 x,AU4 y,AU4 z){return AU4(max(ASU4(x),max(ASU4(y),ASU4(z))));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AMax3U1(AU1 x,AU1 y,AU1 z){return max(x,max(y,z));}
+ AU2 AMax3U2(AU2 x,AU2 y,AU2 z){return max(x,max(y,z));}
+ AU3 AMax3U3(AU3 x,AU3 y,AU3 z){return max(x,max(y,z));}
+ AU4 AMax3U4(AU4 x,AU4 y,AU4 z){return max(x,max(y,z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AMaxSU1(AU1 a,AU1 b){return AU1(max(ASU1(a),ASU1(b)));}
+ AU2 AMaxSU2(AU2 a,AU2 b){return AU2(max(ASU2(a),ASU2(b)));}
+ AU3 AMaxSU3(AU3 a,AU3 b){return AU3(max(ASU3(a),ASU3(b)));}
+ AU4 AMaxSU4(AU4 a,AU4 b){return AU4(max(ASU4(a),ASU4(b)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AMed3F1(AF1 x,AF1 y,AF1 z){return max(min(x,y),min(max(x,y),z));}
+ AF2 AMed3F2(AF2 x,AF2 y,AF2 z){return max(min(x,y),min(max(x,y),z));}
+ AF3 AMed3F3(AF3 x,AF3 y,AF3 z){return max(min(x,y),min(max(x,y),z));}
+ AF4 AMed3F4(AF4 x,AF4 y,AF4 z){return max(min(x,y),min(max(x,y),z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AMin3F1(AF1 x,AF1 y,AF1 z){return min(x,min(y,z));}
+ AF2 AMin3F2(AF2 x,AF2 y,AF2 z){return min(x,min(y,z));}
+ AF3 AMin3F3(AF3 x,AF3 y,AF3 z){return min(x,min(y,z));}
+ AF4 AMin3F4(AF4 x,AF4 y,AF4 z){return min(x,min(y,z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AMin3SU1(AU1 x,AU1 y,AU1 z){return AU1(min(ASU1(x),min(ASU1(y),ASU1(z))));}
+ AU2 AMin3SU2(AU2 x,AU2 y,AU2 z){return AU2(min(ASU2(x),min(ASU2(y),ASU2(z))));}
+ AU3 AMin3SU3(AU3 x,AU3 y,AU3 z){return AU3(min(ASU3(x),min(ASU3(y),ASU3(z))));}
+ AU4 AMin3SU4(AU4 x,AU4 y,AU4 z){return AU4(min(ASU4(x),min(ASU4(y),ASU4(z))));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AMin3U1(AU1 x,AU1 y,AU1 z){return min(x,min(y,z));}
+ AU2 AMin3U2(AU2 x,AU2 y,AU2 z){return min(x,min(y,z));}
+ AU3 AMin3U3(AU3 x,AU3 y,AU3 z){return min(x,min(y,z));}
+ AU4 AMin3U4(AU4 x,AU4 y,AU4 z){return min(x,min(y,z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AMinSU1(AU1 a,AU1 b){return AU1(min(ASU1(a),ASU1(b)));}
+ AU2 AMinSU2(AU2 a,AU2 b){return AU2(min(ASU2(a),ASU2(b)));}
+ AU3 AMinSU3(AU3 a,AU3 b){return AU3(min(ASU3(a),ASU3(b)));}
+ AU4 AMinSU4(AU4 a,AU4 b){return AU4(min(ASU4(a),ASU4(b)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 ANCosF1(AF1 x){return cos(x*AF1_(A_2PI));}
+ AF2 ANCosF2(AF2 x){return cos(x*AF2_(A_2PI));}
+ AF3 ANCosF3(AF3 x){return cos(x*AF3_(A_2PI));}
+ AF4 ANCosF4(AF4 x){return cos(x*AF4_(A_2PI));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 ANSinF1(AF1 x){return sin(x*AF1_(A_2PI));}
+ AF2 ANSinF2(AF2 x){return sin(x*AF2_(A_2PI));}
+ AF3 ANSinF3(AF3 x){return sin(x*AF3_(A_2PI));}
+ AF4 ANSinF4(AF4 x){return sin(x*AF4_(A_2PI));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 ARcpF1(AF1 x){return rcp(x);}
+ AF2 ARcpF2(AF2 x){return rcp(x);}
+ AF3 ARcpF3(AF3 x){return rcp(x);}
+ AF4 ARcpF4(AF4 x){return rcp(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 ARsqF1(AF1 x){return rsqrt(x);}
+ AF2 ARsqF2(AF2 x){return rsqrt(x);}
+ AF3 ARsqF3(AF3 x){return rsqrt(x);}
+ AF4 ARsqF4(AF4 x){return rsqrt(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 ASatF1(AF1 x){return saturate(x);}
+ AF2 ASatF2(AF2 x){return saturate(x);}
+ AF3 ASatF3(AF3 x){return saturate(x);}
+ AF4 ASatF4(AF4 x){return saturate(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AShrSU1(AU1 a,AU1 b){return AU1(ASU1(a)>>ASU1(b));}
+ AU2 AShrSU2(AU2 a,AU2 b){return AU2(ASU2(a)>>ASU2(b));}
+ AU3 AShrSU3(AU3 a,AU3 b){return AU3(ASU3(a)>>ASU3(b));}
+ AU4 AShrSU4(AU4 a,AU4 b){return AU4(ASU4(a)>>ASU4(b));}
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// HLSL BYTE
+//==============================================================================================================================
+ #ifdef A_BYTE
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// HLSL HALF
+//==============================================================================================================================
+ #ifdef A_HALF
+ #ifdef A_HLSL_6_2
+ #define AH1 float16_t
+ #define AH2 float16_t2
+ #define AH3 float16_t3
+ #define AH4 float16_t4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AW1 uint16_t
+ #define AW2 uint16_t2
+ #define AW3 uint16_t3
+ #define AW4 uint16_t4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ASW1 int16_t
+ #define ASW2 int16_t2
+ #define ASW3 int16_t3
+ #define ASW4 int16_t4
+ #else
+ #define AH1 min16float
+ #define AH2 min16float2
+ #define AH3 min16float3
+ #define AH4 min16float4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AW1 min16uint
+ #define AW2 min16uint2
+ #define AW3 min16uint3
+ #define AW4 min16uint4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ASW1 min16int
+ #define ASW2 min16int2
+ #define ASW3 min16int3
+ #define ASW4 min16int4
+ #endif
+//==============================================================================================================================
+ // Need to use manual unpack to get optimal execution (don't use packed types in buffers directly).
+ // Unpack requires this pattern: https://gpuopen.com/first-steps-implementing-fp16/
+ AH2 AH2_AU1_x(AU1 x){AF2 t=f16tof32(AU2(x&0xFFFF,x>>16));return AH2(t);}
+ AH4 AH4_AU2_x(AU2 x){return AH4(AH2_AU1_x(x.x),AH2_AU1_x(x.y));}
+ AW2 AW2_AU1_x(AU1 x){AU2 t=AU2(x&0xFFFF,x>>16);return AW2(t);}
+ AW4 AW4_AU2_x(AU2 x){return AW4(AW2_AU1_x(x.x),AW2_AU1_x(x.y));}
+ #define AH2_AU1(x) AH2_AU1_x(AU1(x))
+ #define AH4_AU2(x) AH4_AU2_x(AU2(x))
+ #define AW2_AU1(x) AW2_AU1_x(AU1(x))
+ #define AW4_AU2(x) AW4_AU2_x(AU2(x))
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AU1_AH2_x(AH2 x){return f32tof16(x.x)+(f32tof16(x.y)<<16);}
+ AU2 AU2_AH4_x(AH4 x){return AU2(AU1_AH2_x(x.xy),AU1_AH2_x(x.zw));}
+ AU1 AU1_AW2_x(AW2 x){return AU1(x.x)+(AU1(x.y)<<16);}
+ AU2 AU2_AW4_x(AW4 x){return AU2(AU1_AW2_x(x.xy),AU1_AW2_x(x.zw));}
+ #define AU1_AH2(x) AU1_AH2_x(AH2(x))
+ #define AU2_AH4(x) AU2_AH4_x(AH4(x))
+ #define AU1_AW2(x) AU1_AW2_x(AW2(x))
+ #define AU2_AW4(x) AU2_AW4_x(AW4(x))
+//==============================================================================================================================
+ #if defined(A_HLSL_6_2) && !defined(A_NO_16_BIT_CAST)
+ #define AW1_AH1(x) asuint16(x)
+ #define AW2_AH2(x) asuint16(x)
+ #define AW3_AH3(x) asuint16(x)
+ #define AW4_AH4(x) asuint16(x)
+ #else
+ #define AW1_AH1(a) AW1(f32tof16(AF1(a)))
+ #define AW2_AH2(a) AW2(AW1_AH1((a).x),AW1_AH1((a).y))
+ #define AW3_AH3(a) AW3(AW1_AH1((a).x),AW1_AH1((a).y),AW1_AH1((a).z))
+ #define AW4_AH4(a) AW4(AW1_AH1((a).x),AW1_AH1((a).y),AW1_AH1((a).z),AW1_AH1((a).w))
+ #endif
+//------------------------------------------------------------------------------------------------------------------------------
+ #if defined(A_HLSL_6_2) && !defined(A_NO_16_BIT_CAST)
+ #define AH1_AW1(x) asfloat16(x)
+ #define AH2_AW2(x) asfloat16(x)
+ #define AH3_AW3(x) asfloat16(x)
+ #define AH4_AW4(x) asfloat16(x)
+ #else
+ #define AH1_AW1(a) AH1(f16tof32(AU1(a)))
+ #define AH2_AW2(a) AH2(AH1_AW1((a).x),AH1_AW1((a).y))
+ #define AH3_AW3(a) AH3(AH1_AW1((a).x),AH1_AW1((a).y),AH1_AW1((a).z))
+ #define AH4_AW4(a) AH4(AH1_AW1((a).x),AH1_AW1((a).y),AH1_AW1((a).z),AH1_AW1((a).w))
+ #endif
+//==============================================================================================================================
+ AH1 AH1_x(AH1 a){return AH1(a);}
+ AH2 AH2_x(AH1 a){return AH2(a,a);}
+ AH3 AH3_x(AH1 a){return AH3(a,a,a);}
+ AH4 AH4_x(AH1 a){return AH4(a,a,a,a);}
+ #define AH1_(a) AH1_x(AH1(a))
+ #define AH2_(a) AH2_x(AH1(a))
+ #define AH3_(a) AH3_x(AH1(a))
+ #define AH4_(a) AH4_x(AH1(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ AW1 AW1_x(AW1 a){return AW1(a);}
+ AW2 AW2_x(AW1 a){return AW2(a,a);}
+ AW3 AW3_x(AW1 a){return AW3(a,a,a);}
+ AW4 AW4_x(AW1 a){return AW4(a,a,a,a);}
+ #define AW1_(a) AW1_x(AW1(a))
+ #define AW2_(a) AW2_x(AW1(a))
+ #define AW3_(a) AW3_x(AW1(a))
+ #define AW4_(a) AW4_x(AW1(a))
+//==============================================================================================================================
+ AW1 AAbsSW1(AW1 a){return AW1(abs(ASW1(a)));}
+ AW2 AAbsSW2(AW2 a){return AW2(abs(ASW2(a)));}
+ AW3 AAbsSW3(AW3 a){return AW3(abs(ASW3(a)));}
+ AW4 AAbsSW4(AW4 a){return AW4(abs(ASW4(a)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AClampH1(AH1 x,AH1 n,AH1 m){return max(n,min(x,m));}
+ AH2 AClampH2(AH2 x,AH2 n,AH2 m){return max(n,min(x,m));}
+ AH3 AClampH3(AH3 x,AH3 n,AH3 m){return max(n,min(x,m));}
+ AH4 AClampH4(AH4 x,AH4 n,AH4 m){return max(n,min(x,m));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // V_FRACT_F16 (note DX frac() is different).
+ AH1 AFractH1(AH1 x){return x-floor(x);}
+ AH2 AFractH2(AH2 x){return x-floor(x);}
+ AH3 AFractH3(AH3 x){return x-floor(x);}
+ AH4 AFractH4(AH4 x){return x-floor(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 ALerpH1(AH1 x,AH1 y,AH1 a){return lerp(x,y,a);}
+ AH2 ALerpH2(AH2 x,AH2 y,AH2 a){return lerp(x,y,a);}
+ AH3 ALerpH3(AH3 x,AH3 y,AH3 a){return lerp(x,y,a);}
+ AH4 ALerpH4(AH4 x,AH4 y,AH4 a){return lerp(x,y,a);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AMax3H1(AH1 x,AH1 y,AH1 z){return max(x,max(y,z));}
+ AH2 AMax3H2(AH2 x,AH2 y,AH2 z){return max(x,max(y,z));}
+ AH3 AMax3H3(AH3 x,AH3 y,AH3 z){return max(x,max(y,z));}
+ AH4 AMax3H4(AH4 x,AH4 y,AH4 z){return max(x,max(y,z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AW1 AMaxSW1(AW1 a,AW1 b){return AW1(max(ASU1(a),ASU1(b)));}
+ AW2 AMaxSW2(AW2 a,AW2 b){return AW2(max(ASU2(a),ASU2(b)));}
+ AW3 AMaxSW3(AW3 a,AW3 b){return AW3(max(ASU3(a),ASU3(b)));}
+ AW4 AMaxSW4(AW4 a,AW4 b){return AW4(max(ASU4(a),ASU4(b)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AMin3H1(AH1 x,AH1 y,AH1 z){return min(x,min(y,z));}
+ AH2 AMin3H2(AH2 x,AH2 y,AH2 z){return min(x,min(y,z));}
+ AH3 AMin3H3(AH3 x,AH3 y,AH3 z){return min(x,min(y,z));}
+ AH4 AMin3H4(AH4 x,AH4 y,AH4 z){return min(x,min(y,z));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AW1 AMinSW1(AW1 a,AW1 b){return AW1(min(ASU1(a),ASU1(b)));}
+ AW2 AMinSW2(AW2 a,AW2 b){return AW2(min(ASU2(a),ASU2(b)));}
+ AW3 AMinSW3(AW3 a,AW3 b){return AW3(min(ASU3(a),ASU3(b)));}
+ AW4 AMinSW4(AW4 a,AW4 b){return AW4(min(ASU4(a),ASU4(b)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 ARcpH1(AH1 x){return rcp(x);}
+ AH2 ARcpH2(AH2 x){return rcp(x);}
+ AH3 ARcpH3(AH3 x){return rcp(x);}
+ AH4 ARcpH4(AH4 x){return rcp(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 ARsqH1(AH1 x){return rsqrt(x);}
+ AH2 ARsqH2(AH2 x){return rsqrt(x);}
+ AH3 ARsqH3(AH3 x){return rsqrt(x);}
+ AH4 ARsqH4(AH4 x){return rsqrt(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 ASatH1(AH1 x){return saturate(x);}
+ AH2 ASatH2(AH2 x){return saturate(x);}
+ AH3 ASatH3(AH3 x){return saturate(x);}
+ AH4 ASatH4(AH4 x){return saturate(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AW1 AShrSW1(AW1 a,AW1 b){return AW1(ASW1(a)>>ASW1(b));}
+ AW2 AShrSW2(AW2 a,AW2 b){return AW2(ASW2(a)>>ASW2(b));}
+ AW3 AShrSW3(AW3 a,AW3 b){return AW3(ASW3(a)>>ASW3(b));}
+ AW4 AShrSW4(AW4 a,AW4 b){return AW4(ASW4(a)>>ASW4(b));}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// HLSL DOUBLE
+//==============================================================================================================================
+ #ifdef A_DUBL
+ #ifdef A_HLSL_6_2
+ #define AD1 float64_t
+ #define AD2 float64_t2
+ #define AD3 float64_t3
+ #define AD4 float64_t4
+ #else
+ #define AD1 double
+ #define AD2 double2
+ #define AD3 double3
+ #define AD4 double4
+ #endif
+//------------------------------------------------------------------------------------------------------------------------------
+ AD1 AD1_x(AD1 a){return AD1(a);}
+ AD2 AD2_x(AD1 a){return AD2(a,a);}
+ AD3 AD3_x(AD1 a){return AD3(a,a,a);}
+ AD4 AD4_x(AD1 a){return AD4(a,a,a,a);}
+ #define AD1_(a) AD1_x(AD1(a))
+ #define AD2_(a) AD2_x(AD1(a))
+ #define AD3_(a) AD3_x(AD1(a))
+ #define AD4_(a) AD4_x(AD1(a))
+//==============================================================================================================================
+ AD1 AFractD1(AD1 a){return a-floor(a);}
+ AD2 AFractD2(AD2 a){return a-floor(a);}
+ AD3 AFractD3(AD3 a){return a-floor(a);}
+ AD4 AFractD4(AD4 a){return a-floor(a);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD1 ALerpD1(AD1 x,AD1 y,AD1 a){return lerp(x,y,a);}
+ AD2 ALerpD2(AD2 x,AD2 y,AD2 a){return lerp(x,y,a);}
+ AD3 ALerpD3(AD3 x,AD3 y,AD3 a){return lerp(x,y,a);}
+ AD4 ALerpD4(AD4 x,AD4 y,AD4 a){return lerp(x,y,a);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD1 ARcpD1(AD1 x){return rcp(x);}
+ AD2 ARcpD2(AD2 x){return rcp(x);}
+ AD3 ARcpD3(AD3 x){return rcp(x);}
+ AD4 ARcpD4(AD4 x){return rcp(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD1 ARsqD1(AD1 x){return rsqrt(x);}
+ AD2 ARsqD2(AD2 x){return rsqrt(x);}
+ AD3 ARsqD3(AD3 x){return rsqrt(x);}
+ AD4 ARsqD4(AD4 x){return rsqrt(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD1 ASatD1(AD1 x){return saturate(x);}
+ AD2 ASatD2(AD2 x){return saturate(x);}
+ AD3 ASatD3(AD3 x){return saturate(x);}
+ AD4 ASatD4(AD4 x){return saturate(x);}
+ #endif
+//==============================================================================================================================
+// HLSL WAVE
+//==============================================================================================================================
+ #ifdef A_WAVE
+ // Where 'x' must be a compile time literal.
+ AF1 AWaveXorF1(AF1 v,AU1 x){return WaveReadLaneAt(v,WaveGetLaneIndex()^x);}
+ AF2 AWaveXorF2(AF2 v,AU1 x){return WaveReadLaneAt(v,WaveGetLaneIndex()^x);}
+ AF3 AWaveXorF3(AF3 v,AU1 x){return WaveReadLaneAt(v,WaveGetLaneIndex()^x);}
+ AF4 AWaveXorF4(AF4 v,AU1 x){return WaveReadLaneAt(v,WaveGetLaneIndex()^x);}
+ AU1 AWaveXorU1(AU1 v,AU1 x){return WaveReadLaneAt(v,WaveGetLaneIndex()^x);}
+ AU2 AWaveXorU1(AU2 v,AU1 x){return WaveReadLaneAt(v,WaveGetLaneIndex()^x);}
+ AU3 AWaveXorU1(AU3 v,AU1 x){return WaveReadLaneAt(v,WaveGetLaneIndex()^x);}
+ AU4 AWaveXorU1(AU4 v,AU1 x){return WaveReadLaneAt(v,WaveGetLaneIndex()^x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ #ifdef A_HALF
+ AH2 AWaveXorH2(AH2 v,AU1 x){return AH2_AU1(WaveReadLaneAt(AU1_AH2(v),WaveGetLaneIndex()^x));}
+ AH4 AWaveXorH4(AH4 v,AU1 x){return AH4_AU2(WaveReadLaneAt(AU2_AH4(v),WaveGetLaneIndex()^x));}
+ AW2 AWaveXorW2(AW2 v,AU1 x){return AW2_AU1(WaveReadLaneAt(AU1_AW2(v),WaveGetLaneIndex()^x));}
+ AW4 AWaveXorW4(AW4 v,AU1 x){return AW4_AU1(WaveReadLaneAt(AU1_AW4(v),WaveGetLaneIndex()^x));}
+ #endif
+ #endif
+//==============================================================================================================================
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+//
+//
+// GPU COMMON
+//
+//
+//==============================================================================================================================
+#ifdef A_GPU
+ // Negative and positive infinity.
+ #define A_INFP_F AF1_AU1(0x7f800000u)
+ #define A_INFN_F AF1_AU1(0xff800000u)
+//------------------------------------------------------------------------------------------------------------------------------
+ // Copy sign from 's' to positive 'd'.
+ AF1 ACpySgnF1(AF1 d,AF1 s){return AF1_AU1(AU1_AF1(d)|(AU1_AF1(s)&AU1_(0x80000000u)));}
+ AF2 ACpySgnF2(AF2 d,AF2 s){return AF2_AU2(AU2_AF2(d)|(AU2_AF2(s)&AU2_(0x80000000u)));}
+ AF3 ACpySgnF3(AF3 d,AF3 s){return AF3_AU3(AU3_AF3(d)|(AU3_AF3(s)&AU3_(0x80000000u)));}
+ AF4 ACpySgnF4(AF4 d,AF4 s){return AF4_AU4(AU4_AF4(d)|(AU4_AF4(s)&AU4_(0x80000000u)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Single operation to return (useful to create a mask to use in lerp for branch free logic),
+ // m=NaN := 0
+ // m>=0 := 0
+ // m<0 := 1
+ // Uses the following useful floating point logic,
+ // saturate(+a*(-INF)==-INF) := 0
+ // saturate( 0*(-INF)== NaN) := 0
+ // saturate(-a*(-INF)==+INF) := 1
+ AF1 ASignedF1(AF1 m){return ASatF1(m*AF1_(A_INFN_F));}
+ AF2 ASignedF2(AF2 m){return ASatF2(m*AF2_(A_INFN_F));}
+ AF3 ASignedF3(AF3 m){return ASatF3(m*AF3_(A_INFN_F));}
+ AF4 ASignedF4(AF4 m){return ASatF4(m*AF4_(A_INFN_F));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AGtZeroF1(AF1 m){return ASatF1(m*AF1_(A_INFP_F));}
+ AF2 AGtZeroF2(AF2 m){return ASatF2(m*AF2_(A_INFP_F));}
+ AF3 AGtZeroF3(AF3 m){return ASatF3(m*AF3_(A_INFP_F));}
+ AF4 AGtZeroF4(AF4 m){return ASatF4(m*AF4_(A_INFP_F));}
+//==============================================================================================================================
+ #ifdef A_HALF
+ #ifdef A_HLSL_6_2
+ #define A_INFP_H AH1_AW1((uint16_t)0x7c00u)
+ #define A_INFN_H AH1_AW1((uint16_t)0xfc00u)
+ #else
+ #define A_INFP_H AH1_AW1(0x7c00u)
+ #define A_INFN_H AH1_AW1(0xfc00u)
+ #endif
+
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 ACpySgnH1(AH1 d,AH1 s){return AH1_AW1(AW1_AH1(d)|(AW1_AH1(s)&AW1_(0x8000u)));}
+ AH2 ACpySgnH2(AH2 d,AH2 s){return AH2_AW2(AW2_AH2(d)|(AW2_AH2(s)&AW2_(0x8000u)));}
+ AH3 ACpySgnH3(AH3 d,AH3 s){return AH3_AW3(AW3_AH3(d)|(AW3_AH3(s)&AW3_(0x8000u)));}
+ AH4 ACpySgnH4(AH4 d,AH4 s){return AH4_AW4(AW4_AH4(d)|(AW4_AH4(s)&AW4_(0x8000u)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 ASignedH1(AH1 m){return ASatH1(m*AH1_(A_INFN_H));}
+ AH2 ASignedH2(AH2 m){return ASatH2(m*AH2_(A_INFN_H));}
+ AH3 ASignedH3(AH3 m){return ASatH3(m*AH3_(A_INFN_H));}
+ AH4 ASignedH4(AH4 m){return ASatH4(m*AH4_(A_INFN_H));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AGtZeroH1(AH1 m){return ASatH1(m*AH1_(A_INFP_H));}
+ AH2 AGtZeroH2(AH2 m){return ASatH2(m*AH2_(A_INFP_H));}
+ AH3 AGtZeroH3(AH3 m){return ASatH3(m*AH3_(A_INFP_H));}
+ AH4 AGtZeroH4(AH4 m){return ASatH4(m*AH4_(A_INFP_H));}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// [FIS] FLOAT INTEGER SORTABLE
+//------------------------------------------------------------------------------------------------------------------------------
+// Float to integer sortable.
+// - If sign bit=0, flip the sign bit (positives).
+// - If sign bit=1, flip all bits (negatives).
+// Integer sortable to float.
+// - If sign bit=1, flip the sign bit (positives).
+// - If sign bit=0, flip all bits (negatives).
+// Has nice side effects.
+// - Larger integers are more positive values.
+// - Float zero is mapped to center of integers (so clear to integer zero is a nice default for atomic max usage).
+// Burns 3 ops for conversion {shift,or,xor}.
+//==============================================================================================================================
+ AU1 AFisToU1(AU1 x){return x^(( AShrSU1(x,AU1_(31)))|AU1_(0x80000000));}
+ AU1 AFisFromU1(AU1 x){return x^((~AShrSU1(x,AU1_(31)))|AU1_(0x80000000));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Just adjust high 16-bit value (useful when upper part of 32-bit word is a 16-bit float value).
+ AU1 AFisToHiU1(AU1 x){return x^(( AShrSU1(x,AU1_(15)))|AU1_(0x80000000));}
+ AU1 AFisFromHiU1(AU1 x){return x^((~AShrSU1(x,AU1_(15)))|AU1_(0x80000000));}
+//------------------------------------------------------------------------------------------------------------------------------
+ #ifdef A_HALF
+ AW1 AFisToW1(AW1 x){return x^(( AShrSW1(x,AW1_(15)))|AW1_(0x8000));}
+ AW1 AFisFromW1(AW1 x){return x^((~AShrSW1(x,AW1_(15)))|AW1_(0x8000));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AW2 AFisToW2(AW2 x){return x^(( AShrSW2(x,AW2_(15)))|AW2_(0x8000));}
+ AW2 AFisFromW2(AW2 x){return x^((~AShrSW2(x,AW2_(15)))|AW2_(0x8000));}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// [PERM] V_PERM_B32
+//------------------------------------------------------------------------------------------------------------------------------
+// Support for V_PERM_B32 started in the 3rd generation of GCN.
+//------------------------------------------------------------------------------------------------------------------------------
+// yyyyxxxx - The 'i' input.
+// 76543210
+// ========
+// HGFEDCBA - Naming on permutation.
+//------------------------------------------------------------------------------------------------------------------------------
+// TODO
+// ====
+// - Make sure compiler optimizes this.
+//==============================================================================================================================
+ #ifdef A_HALF
+ AU1 APerm0E0A(AU2 i){return((i.x )&0xffu)|((i.y<<16)&0xff0000u);}
+ AU1 APerm0F0B(AU2 i){return((i.x>> 8)&0xffu)|((i.y<< 8)&0xff0000u);}
+ AU1 APerm0G0C(AU2 i){return((i.x>>16)&0xffu)|((i.y )&0xff0000u);}
+ AU1 APerm0H0D(AU2 i){return((i.x>>24)&0xffu)|((i.y>> 8)&0xff0000u);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 APermHGFA(AU2 i){return((i.x )&0x000000ffu)|(i.y&0xffffff00u);}
+ AU1 APermHGFC(AU2 i){return((i.x>>16)&0x000000ffu)|(i.y&0xffffff00u);}
+ AU1 APermHGAE(AU2 i){return((i.x<< 8)&0x0000ff00u)|(i.y&0xffff00ffu);}
+ AU1 APermHGCE(AU2 i){return((i.x>> 8)&0x0000ff00u)|(i.y&0xffff00ffu);}
+ AU1 APermHAFE(AU2 i){return((i.x<<16)&0x00ff0000u)|(i.y&0xff00ffffu);}
+ AU1 APermHCFE(AU2 i){return((i.x )&0x00ff0000u)|(i.y&0xff00ffffu);}
+ AU1 APermAGFE(AU2 i){return((i.x<<24)&0xff000000u)|(i.y&0x00ffffffu);}
+ AU1 APermCGFE(AU2 i){return((i.x<< 8)&0xff000000u)|(i.y&0x00ffffffu);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 APermGCEA(AU2 i){return((i.x)&0x00ff00ffu)|((i.y<<8)&0xff00ff00u);}
+ AU1 APermGECA(AU2 i){return(((i.x)&0xffu)|((i.x>>8)&0xff00u)|((i.y<<16)&0xff0000u)|((i.y<<8)&0xff000000u));}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// [BUC] BYTE UNSIGNED CONVERSION
+//------------------------------------------------------------------------------------------------------------------------------
+// Designed to use the optimal conversion, enables the scaling to possibly be factored into other computation.
+// Works on a range of {0 to A_BUC_<32,16>}, for <32-bit, and 16-bit> respectively.
+//------------------------------------------------------------------------------------------------------------------------------
+// OPCODE NOTES
+// ============
+// GCN does not do UNORM or SNORM for bytes in opcodes.
+// - V_CVT_F32_UBYTE{0,1,2,3} - Unsigned byte to float.
+// - V_CVT_PKACC_U8_F32 - Float to unsigned byte (does bit-field insert into 32-bit integer).
+// V_PERM_B32 does byte packing with ability to zero fill bytes as well.
+// - Can pull out byte values from two sources, and zero fill upper 8-bits of packed hi and lo.
+//------------------------------------------------------------------------------------------------------------------------------
+// BYTE : FLOAT - ABuc{0,1,2,3}{To,From}U1() - Designed for V_CVT_F32_UBYTE* and V_CVT_PKACCUM_U8_F32 ops.
+// ==== =====
+// 0 : 0
+// 1 : 1
+// ...
+// 255 : 255
+// : 256 (just outside the encoding range)
+//------------------------------------------------------------------------------------------------------------------------------
+// BYTE : FLOAT - ABuc{0,1,2,3}{To,From}U2() - Designed for 16-bit denormal tricks and V_PERM_B32.
+// ==== =====
+// 0 : 0
+// 1 : 1/512
+// 2 : 1/256
+// ...
+// 64 : 1/8
+// 128 : 1/4
+// 255 : 255/512
+// : 1/2 (just outside the encoding range)
+//------------------------------------------------------------------------------------------------------------------------------
+// OPTIMAL IMPLEMENTATIONS ON AMD ARCHITECTURES
+// ============================================
+// r=ABuc0FromU1(i)
+// V_CVT_F32_UBYTE0 r,i
+// --------------------------------------------
+// r=ABuc0ToU1(d,i)
+// V_CVT_PKACCUM_U8_F32 r,i,0,d
+// --------------------------------------------
+// d=ABuc0FromU2(i)
+// Where 'k0' is an SGPR with 0x0E0A
+// Where 'k1' is an SGPR with {32768.0} packed into the lower 16-bits
+// V_PERM_B32 d,i.x,i.y,k0
+// V_PK_FMA_F16 d,d,k1.x,0
+// --------------------------------------------
+// r=ABuc0ToU2(d,i)
+// Where 'k0' is an SGPR with {1.0/32768.0} packed into the lower 16-bits
+// Where 'k1' is an SGPR with 0x????
+// Where 'k2' is an SGPR with 0x????
+// V_PK_FMA_F16 i,i,k0.x,0
+// V_PERM_B32 r.x,i,i,k1
+// V_PERM_B32 r.y,i,i,k2
+//==============================================================================================================================
+ // Peak range for 32-bit and 16-bit operations.
+ #define A_BUC_32 (255.0)
+ #define A_BUC_16 (255.0/512.0)
+//==============================================================================================================================
+ #if 1
+ // Designed to be one V_CVT_PKACCUM_U8_F32.
+ // The extra min is required to pattern match to V_CVT_PKACCUM_U8_F32.
+ AU1 ABuc0ToU1(AU1 d,AF1 i){return (d&0xffffff00u)|((min(AU1(i),255u) )&(0x000000ffu));}
+ AU1 ABuc1ToU1(AU1 d,AF1 i){return (d&0xffff00ffu)|((min(AU1(i),255u)<< 8)&(0x0000ff00u));}
+ AU1 ABuc2ToU1(AU1 d,AF1 i){return (d&0xff00ffffu)|((min(AU1(i),255u)<<16)&(0x00ff0000u));}
+ AU1 ABuc3ToU1(AU1 d,AF1 i){return (d&0x00ffffffu)|((min(AU1(i),255u)<<24)&(0xff000000u));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Designed to be one V_CVT_F32_UBYTE*.
+ AF1 ABuc0FromU1(AU1 i){return AF1((i )&255u);}
+ AF1 ABuc1FromU1(AU1 i){return AF1((i>> 8)&255u);}
+ AF1 ABuc2FromU1(AU1 i){return AF1((i>>16)&255u);}
+ AF1 ABuc3FromU1(AU1 i){return AF1((i>>24)&255u);}
+ #endif
+//==============================================================================================================================
+ #ifdef A_HALF
+ // Takes {x0,x1} and {y0,y1} and builds {{x0,y0},{x1,y1}}.
+ AW2 ABuc01ToW2(AH2 x,AH2 y){x*=AH2_(1.0/32768.0);y*=AH2_(1.0/32768.0);
+ return AW2_AU1(APermGCEA(AU2(AU1_AW2(AW2_AH2(x)),AU1_AW2(AW2_AH2(y)))));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Designed for 3 ops to do SOA to AOS and conversion.
+ AU2 ABuc0ToU2(AU2 d,AH2 i){AU1 b=AU1_AW2(AW2_AH2(i*AH2_(1.0/32768.0)));
+ return AU2(APermHGFA(AU2(d.x,b)),APermHGFC(AU2(d.y,b)));}
+ AU2 ABuc1ToU2(AU2 d,AH2 i){AU1 b=AU1_AW2(AW2_AH2(i*AH2_(1.0/32768.0)));
+ return AU2(APermHGAE(AU2(d.x,b)),APermHGCE(AU2(d.y,b)));}
+ AU2 ABuc2ToU2(AU2 d,AH2 i){AU1 b=AU1_AW2(AW2_AH2(i*AH2_(1.0/32768.0)));
+ return AU2(APermHAFE(AU2(d.x,b)),APermHCFE(AU2(d.y,b)));}
+ AU2 ABuc3ToU2(AU2 d,AH2 i){AU1 b=AU1_AW2(AW2_AH2(i*AH2_(1.0/32768.0)));
+ return AU2(APermAGFE(AU2(d.x,b)),APermCGFE(AU2(d.y,b)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Designed for 2 ops to do both AOS to SOA, and conversion.
+ AH2 ABuc0FromU2(AU2 i){return AH2_AW2(AW2_AU1(APerm0E0A(i)))*AH2_(32768.0);}
+ AH2 ABuc1FromU2(AU2 i){return AH2_AW2(AW2_AU1(APerm0F0B(i)))*AH2_(32768.0);}
+ AH2 ABuc2FromU2(AU2 i){return AH2_AW2(AW2_AU1(APerm0G0C(i)))*AH2_(32768.0);}
+ AH2 ABuc3FromU2(AU2 i){return AH2_AW2(AW2_AU1(APerm0H0D(i)))*AH2_(32768.0);}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// [BSC] BYTE SIGNED CONVERSION
+//------------------------------------------------------------------------------------------------------------------------------
+// Similar to [BUC].
+// Works on a range of {-/+ A_BSC_<32,16>}, for <32-bit, and 16-bit> respectively.
+//------------------------------------------------------------------------------------------------------------------------------
+// ENCODING (without zero-based encoding)
+// ========
+// 0 = unused (can be used to mean something else)
+// 1 = lowest value
+// 128 = exact zero center (zero based encoding
+// 255 = highest value
+//------------------------------------------------------------------------------------------------------------------------------
+// Zero-based [Zb] flips the MSB bit of the byte (making 128 "exact zero" actually zero).
+// This is useful if there is a desire for cleared values to decode as zero.
+//------------------------------------------------------------------------------------------------------------------------------
+// BYTE : FLOAT - ABsc{0,1,2,3}{To,From}U2() - Designed for 16-bit denormal tricks and V_PERM_B32.
+// ==== =====
+// 0 : -127/512 (unused)
+// 1 : -126/512
+// 2 : -125/512
+// ...
+// 128 : 0
+// ...
+// 255 : 127/512
+// : 1/4 (just outside the encoding range)
+//==============================================================================================================================
+ // Peak range for 32-bit and 16-bit operations.
+ #define A_BSC_32 (127.0)
+ #define A_BSC_16 (127.0/512.0)
+//==============================================================================================================================
+ #if 1
+ AU1 ABsc0ToU1(AU1 d,AF1 i){return (d&0xffffff00u)|((min(AU1(i+128.0),255u) )&(0x000000ffu));}
+ AU1 ABsc1ToU1(AU1 d,AF1 i){return (d&0xffff00ffu)|((min(AU1(i+128.0),255u)<< 8)&(0x0000ff00u));}
+ AU1 ABsc2ToU1(AU1 d,AF1 i){return (d&0xff00ffffu)|((min(AU1(i+128.0),255u)<<16)&(0x00ff0000u));}
+ AU1 ABsc3ToU1(AU1 d,AF1 i){return (d&0x00ffffffu)|((min(AU1(i+128.0),255u)<<24)&(0xff000000u));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 ABsc0ToZbU1(AU1 d,AF1 i){return ((d&0xffffff00u)|((min(AU1(trunc(i)+128.0),255u) )&(0x000000ffu)))^0x00000080u;}
+ AU1 ABsc1ToZbU1(AU1 d,AF1 i){return ((d&0xffff00ffu)|((min(AU1(trunc(i)+128.0),255u)<< 8)&(0x0000ff00u)))^0x00008000u;}
+ AU1 ABsc2ToZbU1(AU1 d,AF1 i){return ((d&0xff00ffffu)|((min(AU1(trunc(i)+128.0),255u)<<16)&(0x00ff0000u)))^0x00800000u;}
+ AU1 ABsc3ToZbU1(AU1 d,AF1 i){return ((d&0x00ffffffu)|((min(AU1(trunc(i)+128.0),255u)<<24)&(0xff000000u)))^0x80000000u;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 ABsc0FromU1(AU1 i){return AF1((i )&255u)-128.0;}
+ AF1 ABsc1FromU1(AU1 i){return AF1((i>> 8)&255u)-128.0;}
+ AF1 ABsc2FromU1(AU1 i){return AF1((i>>16)&255u)-128.0;}
+ AF1 ABsc3FromU1(AU1 i){return AF1((i>>24)&255u)-128.0;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 ABsc0FromZbU1(AU1 i){return AF1(((i )&255u)^0x80u)-128.0;}
+ AF1 ABsc1FromZbU1(AU1 i){return AF1(((i>> 8)&255u)^0x80u)-128.0;}
+ AF1 ABsc2FromZbU1(AU1 i){return AF1(((i>>16)&255u)^0x80u)-128.0;}
+ AF1 ABsc3FromZbU1(AU1 i){return AF1(((i>>24)&255u)^0x80u)-128.0;}
+ #endif
+//==============================================================================================================================
+ #ifdef A_HALF
+ // Takes {x0,x1} and {y0,y1} and builds {{x0,y0},{x1,y1}}.
+ AW2 ABsc01ToW2(AH2 x,AH2 y){x=x*AH2_(1.0/32768.0)+AH2_(0.25/32768.0);y=y*AH2_(1.0/32768.0)+AH2_(0.25/32768.0);
+ return AW2_AU1(APermGCEA(AU2(AU1_AW2(AW2_AH2(x)),AU1_AW2(AW2_AH2(y)))));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU2 ABsc0ToU2(AU2 d,AH2 i){AU1 b=AU1_AW2(AW2_AH2(i*AH2_(1.0/32768.0)+AH2_(0.25/32768.0)));
+ return AU2(APermHGFA(AU2(d.x,b)),APermHGFC(AU2(d.y,b)));}
+ AU2 ABsc1ToU2(AU2 d,AH2 i){AU1 b=AU1_AW2(AW2_AH2(i*AH2_(1.0/32768.0)+AH2_(0.25/32768.0)));
+ return AU2(APermHGAE(AU2(d.x,b)),APermHGCE(AU2(d.y,b)));}
+ AU2 ABsc2ToU2(AU2 d,AH2 i){AU1 b=AU1_AW2(AW2_AH2(i*AH2_(1.0/32768.0)+AH2_(0.25/32768.0)));
+ return AU2(APermHAFE(AU2(d.x,b)),APermHCFE(AU2(d.y,b)));}
+ AU2 ABsc3ToU2(AU2 d,AH2 i){AU1 b=AU1_AW2(AW2_AH2(i*AH2_(1.0/32768.0)+AH2_(0.25/32768.0)));
+ return AU2(APermAGFE(AU2(d.x,b)),APermCGFE(AU2(d.y,b)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU2 ABsc0ToZbU2(AU2 d,AH2 i){AU1 b=AU1_AW2(AW2_AH2(i*AH2_(1.0/32768.0)+AH2_(0.25/32768.0)))^0x00800080u;
+ return AU2(APermHGFA(AU2(d.x,b)),APermHGFC(AU2(d.y,b)));}
+ AU2 ABsc1ToZbU2(AU2 d,AH2 i){AU1 b=AU1_AW2(AW2_AH2(i*AH2_(1.0/32768.0)+AH2_(0.25/32768.0)))^0x00800080u;
+ return AU2(APermHGAE(AU2(d.x,b)),APermHGCE(AU2(d.y,b)));}
+ AU2 ABsc2ToZbU2(AU2 d,AH2 i){AU1 b=AU1_AW2(AW2_AH2(i*AH2_(1.0/32768.0)+AH2_(0.25/32768.0)))^0x00800080u;
+ return AU2(APermHAFE(AU2(d.x,b)),APermHCFE(AU2(d.y,b)));}
+ AU2 ABsc3ToZbU2(AU2 d,AH2 i){AU1 b=AU1_AW2(AW2_AH2(i*AH2_(1.0/32768.0)+AH2_(0.25/32768.0)))^0x00800080u;
+ return AU2(APermAGFE(AU2(d.x,b)),APermCGFE(AU2(d.y,b)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH2 ABsc0FromU2(AU2 i){return AH2_AW2(AW2_AU1(APerm0E0A(i)))*AH2_(32768.0)-AH2_(0.25);}
+ AH2 ABsc1FromU2(AU2 i){return AH2_AW2(AW2_AU1(APerm0F0B(i)))*AH2_(32768.0)-AH2_(0.25);}
+ AH2 ABsc2FromU2(AU2 i){return AH2_AW2(AW2_AU1(APerm0G0C(i)))*AH2_(32768.0)-AH2_(0.25);}
+ AH2 ABsc3FromU2(AU2 i){return AH2_AW2(AW2_AU1(APerm0H0D(i)))*AH2_(32768.0)-AH2_(0.25);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH2 ABsc0FromZbU2(AU2 i){return AH2_AW2(AW2_AU1(APerm0E0A(i)^0x00800080u))*AH2_(32768.0)-AH2_(0.25);}
+ AH2 ABsc1FromZbU2(AU2 i){return AH2_AW2(AW2_AU1(APerm0F0B(i)^0x00800080u))*AH2_(32768.0)-AH2_(0.25);}
+ AH2 ABsc2FromZbU2(AU2 i){return AH2_AW2(AW2_AU1(APerm0G0C(i)^0x00800080u))*AH2_(32768.0)-AH2_(0.25);}
+ AH2 ABsc3FromZbU2(AU2 i){return AH2_AW2(AW2_AU1(APerm0H0D(i)^0x00800080u))*AH2_(32768.0)-AH2_(0.25);}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// HALF APPROXIMATIONS
+//------------------------------------------------------------------------------------------------------------------------------
+// These support only positive inputs.
+// Did not see value yet in specialization for range.
+// Using quick testing, ended up mostly getting the same "best" approximation for various ranges.
+// With hardware that can co-execute transcendentals, the value in approximations could be less than expected.
+// However from a latency perspective, if execution of a transcendental is 4 clk, with no packed support, -> 8 clk total.
+// And co-execution would require a compiler interleaving a lot of independent work for packed usage.
+//------------------------------------------------------------------------------------------------------------------------------
+// The one Newton Raphson iteration form of rsq() was skipped (requires 6 ops total).
+// Same with sqrt(), as this could be x*rsq() (7 ops).
+//==============================================================================================================================
+ #ifdef A_HALF
+ // Minimize squared error across full positive range, 2 ops.
+ // The 0x1de2 based approximation maps {0 to 1} input maps to < 1 output.
+ AH1 APrxLoSqrtH1(AH1 a){return AH1_AW1((AW1_AH1(a)>>AW1_(1))+AW1_(0x1de2));}
+ AH2 APrxLoSqrtH2(AH2 a){return AH2_AW2((AW2_AH2(a)>>AW2_(1))+AW2_(0x1de2));}
+ AH3 APrxLoSqrtH3(AH3 a){return AH3_AW3((AW3_AH3(a)>>AW3_(1))+AW3_(0x1de2));}
+ AH4 APrxLoSqrtH4(AH4 a){return AH4_AW4((AW4_AH4(a)>>AW4_(1))+AW4_(0x1de2));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Lower precision estimation, 1 op.
+ // Minimize squared error across {smallest normal to 16384.0}.
+ AH1 APrxLoRcpH1(AH1 a){return AH1_AW1(AW1_(0x7784)-AW1_AH1(a));}
+ AH2 APrxLoRcpH2(AH2 a){return AH2_AW2(AW2_(0x7784)-AW2_AH2(a));}
+ AH3 APrxLoRcpH3(AH3 a){return AH3_AW3(AW3_(0x7784)-AW3_AH3(a));}
+ AH4 APrxLoRcpH4(AH4 a){return AH4_AW4(AW4_(0x7784)-AW4_AH4(a));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Medium precision estimation, one Newton Raphson iteration, 3 ops.
+ AH1 APrxMedRcpH1(AH1 a){AH1 b=AH1_AW1(AW1_(0x778d)-AW1_AH1(a));return b*(-b*a+AH1_(2.0));}
+ AH2 APrxMedRcpH2(AH2 a){AH2 b=AH2_AW2(AW2_(0x778d)-AW2_AH2(a));return b*(-b*a+AH2_(2.0));}
+ AH3 APrxMedRcpH3(AH3 a){AH3 b=AH3_AW3(AW3_(0x778d)-AW3_AH3(a));return b*(-b*a+AH3_(2.0));}
+ AH4 APrxMedRcpH4(AH4 a){AH4 b=AH4_AW4(AW4_(0x778d)-AW4_AH4(a));return b*(-b*a+AH4_(2.0));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Minimize squared error across {smallest normal to 16384.0}, 2 ops.
+ AH1 APrxLoRsqH1(AH1 a){return AH1_AW1(AW1_(0x59a3)-(AW1_AH1(a)>>AW1_(1)));}
+ AH2 APrxLoRsqH2(AH2 a){return AH2_AW2(AW2_(0x59a3)-(AW2_AH2(a)>>AW2_(1)));}
+ AH3 APrxLoRsqH3(AH3 a){return AH3_AW3(AW3_(0x59a3)-(AW3_AH3(a)>>AW3_(1)));}
+ AH4 APrxLoRsqH4(AH4 a){return AH4_AW4(AW4_(0x59a3)-(AW4_AH4(a)>>AW4_(1)));}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// FLOAT APPROXIMATIONS
+//------------------------------------------------------------------------------------------------------------------------------
+// Michal Drobot has an excellent presentation on these: "Low Level Optimizations For GCN",
+// - Idea dates back to SGI, then to Quake 3, etc.
+// - https://michaldrobot.files.wordpress.com/2014/05/gcn_alu_opt_digitaldragons2014.pdf
+// - sqrt(x)=rsqrt(x)*x
+// - rcp(x)=rsqrt(x)*rsqrt(x) for positive x
+// - https://github.com/michaldrobot/ShaderFastLibs/blob/master/ShaderFastMathLib.h
+//------------------------------------------------------------------------------------------------------------------------------
+// These below are from perhaps less complete searching for optimal.
+// Used FP16 normal range for testing with +4096 32-bit step size for sampling error.
+// So these match up well with the half approximations.
+//==============================================================================================================================
+ AF1 APrxLoSqrtF1(AF1 a){return AF1_AU1((AU1_AF1(a)>>AU1_(1))+AU1_(0x1fbc4639));}
+ AF1 APrxLoRcpF1(AF1 a){return AF1_AU1(AU1_(0x7ef07ebb)-AU1_AF1(a));}
+ AF1 APrxMedRcpF1(AF1 a){AF1 b=AF1_AU1(AU1_(0x7ef19fff)-AU1_AF1(a));return b*(-b*a+AF1_(2.0));}
+ AF1 APrxLoRsqF1(AF1 a){return AF1_AU1(AU1_(0x5f347d74)-(AU1_AF1(a)>>AU1_(1)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 APrxLoSqrtF2(AF2 a){return AF2_AU2((AU2_AF2(a)>>AU2_(1))+AU2_(0x1fbc4639));}
+ AF2 APrxLoRcpF2(AF2 a){return AF2_AU2(AU2_(0x7ef07ebb)-AU2_AF2(a));}
+ AF2 APrxMedRcpF2(AF2 a){AF2 b=AF2_AU2(AU2_(0x7ef19fff)-AU2_AF2(a));return b*(-b*a+AF2_(2.0));}
+ AF2 APrxLoRsqF2(AF2 a){return AF2_AU2(AU2_(0x5f347d74)-(AU2_AF2(a)>>AU2_(1)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF3 APrxLoSqrtF3(AF3 a){return AF3_AU3((AU3_AF3(a)>>AU3_(1))+AU3_(0x1fbc4639));}
+ AF3 APrxLoRcpF3(AF3 a){return AF3_AU3(AU3_(0x7ef07ebb)-AU3_AF3(a));}
+ AF3 APrxMedRcpF3(AF3 a){AF3 b=AF3_AU3(AU3_(0x7ef19fff)-AU3_AF3(a));return b*(-b*a+AF3_(2.0));}
+ AF3 APrxLoRsqF3(AF3 a){return AF3_AU3(AU3_(0x5f347d74)-(AU3_AF3(a)>>AU3_(1)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF4 APrxLoSqrtF4(AF4 a){return AF4_AU4((AU4_AF4(a)>>AU4_(1))+AU4_(0x1fbc4639));}
+ AF4 APrxLoRcpF4(AF4 a){return AF4_AU4(AU4_(0x7ef07ebb)-AU4_AF4(a));}
+ AF4 APrxMedRcpF4(AF4 a){AF4 b=AF4_AU4(AU4_(0x7ef19fff)-AU4_AF4(a));return b*(-b*a+AF4_(2.0));}
+ AF4 APrxLoRsqF4(AF4 a){return AF4_AU4(AU4_(0x5f347d74)-(AU4_AF4(a)>>AU4_(1)));}
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// PQ APPROXIMATIONS
+//------------------------------------------------------------------------------------------------------------------------------
+// PQ is very close to x^(1/8). The functions below Use the fast float approximation method to do
+// PQ<~>Gamma2 (4th power and fast 4th root) and PQ<~>Linear (8th power and fast 8th root). Maximum error is ~0.2%.
+//==============================================================================================================================
+// Helpers
+ AF1 Quart(AF1 a) { a = a * a; return a * a;}
+ AF1 Oct(AF1 a) { a = a * a; a = a * a; return a * a; }
+ AF2 Quart(AF2 a) { a = a * a; return a * a; }
+ AF2 Oct(AF2 a) { a = a * a; a = a * a; return a * a; }
+ AF3 Quart(AF3 a) { a = a * a; return a * a; }
+ AF3 Oct(AF3 a) { a = a * a; a = a * a; return a * a; }
+ AF4 Quart(AF4 a) { a = a * a; return a * a; }
+ AF4 Oct(AF4 a) { a = a * a; a = a * a; return a * a; }
+ //------------------------------------------------------------------------------------------------------------------------------
+ AF1 APrxPQToGamma2(AF1 a) { return Quart(a); }
+ AF1 APrxPQToLinear(AF1 a) { return Oct(a); }
+ AF1 APrxLoGamma2ToPQ(AF1 a) { return AF1_AU1((AU1_AF1(a) >> AU1_(2)) + AU1_(0x2F9A4E46)); }
+ AF1 APrxMedGamma2ToPQ(AF1 a) { AF1 b = AF1_AU1((AU1_AF1(a) >> AU1_(2)) + AU1_(0x2F9A4E46)); AF1 b4 = Quart(b); return b - b * (b4 - a) / (AF1_(4.0) * b4); }
+ AF1 APrxHighGamma2ToPQ(AF1 a) { return sqrt(sqrt(a)); }
+ AF1 APrxLoLinearToPQ(AF1 a) { return AF1_AU1((AU1_AF1(a) >> AU1_(3)) + AU1_(0x378D8723)); }
+ AF1 APrxMedLinearToPQ(AF1 a) { AF1 b = AF1_AU1((AU1_AF1(a) >> AU1_(3)) + AU1_(0x378D8723)); AF1 b8 = Oct(b); return b - b * (b8 - a) / (AF1_(8.0) * b8); }
+ AF1 APrxHighLinearToPQ(AF1 a) { return sqrt(sqrt(sqrt(a))); }
+ //------------------------------------------------------------------------------------------------------------------------------
+ AF2 APrxPQToGamma2(AF2 a) { return Quart(a); }
+ AF2 APrxPQToLinear(AF2 a) { return Oct(a); }
+ AF2 APrxLoGamma2ToPQ(AF2 a) { return AF2_AU2((AU2_AF2(a) >> AU2_(2)) + AU2_(0x2F9A4E46)); }
+ AF2 APrxMedGamma2ToPQ(AF2 a) { AF2 b = AF2_AU2((AU2_AF2(a) >> AU2_(2)) + AU2_(0x2F9A4E46)); AF2 b4 = Quart(b); return b - b * (b4 - a) / (AF1_(4.0) * b4); }
+ AF2 APrxHighGamma2ToPQ(AF2 a) { return sqrt(sqrt(a)); }
+ AF2 APrxLoLinearToPQ(AF2 a) { return AF2_AU2((AU2_AF2(a) >> AU2_(3)) + AU2_(0x378D8723)); }
+ AF2 APrxMedLinearToPQ(AF2 a) { AF2 b = AF2_AU2((AU2_AF2(a) >> AU2_(3)) + AU2_(0x378D8723)); AF2 b8 = Oct(b); return b - b * (b8 - a) / (AF1_(8.0) * b8); }
+ AF2 APrxHighLinearToPQ(AF2 a) { return sqrt(sqrt(sqrt(a))); }
+ //------------------------------------------------------------------------------------------------------------------------------
+ AF3 APrxPQToGamma2(AF3 a) { return Quart(a); }
+ AF3 APrxPQToLinear(AF3 a) { return Oct(a); }
+ AF3 APrxLoGamma2ToPQ(AF3 a) { return AF3_AU3((AU3_AF3(a) >> AU3_(2)) + AU3_(0x2F9A4E46)); }
+ AF3 APrxMedGamma2ToPQ(AF3 a) { AF3 b = AF3_AU3((AU3_AF3(a) >> AU3_(2)) + AU3_(0x2F9A4E46)); AF3 b4 = Quart(b); return b - b * (b4 - a) / (AF1_(4.0) * b4); }
+ AF3 APrxHighGamma2ToPQ(AF3 a) { return sqrt(sqrt(a)); }
+ AF3 APrxLoLinearToPQ(AF3 a) { return AF3_AU3((AU3_AF3(a) >> AU3_(3)) + AU3_(0x378D8723)); }
+ AF3 APrxMedLinearToPQ(AF3 a) { AF3 b = AF3_AU3((AU3_AF3(a) >> AU3_(3)) + AU3_(0x378D8723)); AF3 b8 = Oct(b); return b - b * (b8 - a) / (AF1_(8.0) * b8); }
+ AF3 APrxHighLinearToPQ(AF3 a) { return sqrt(sqrt(sqrt(a))); }
+ //------------------------------------------------------------------------------------------------------------------------------
+ AF4 APrxPQToGamma2(AF4 a) { return Quart(a); }
+ AF4 APrxPQToLinear(AF4 a) { return Oct(a); }
+ AF4 APrxLoGamma2ToPQ(AF4 a) { return AF4_AU4((AU4_AF4(a) >> AU4_(2)) + AU4_(0x2F9A4E46)); }
+ AF4 APrxMedGamma2ToPQ(AF4 a) { AF4 b = AF4_AU4((AU4_AF4(a) >> AU4_(2)) + AU4_(0x2F9A4E46)); AF4 b4 = Quart(b); return b - b * (b4 - a) / (AF1_(4.0) * b4); }
+ AF4 APrxHighGamma2ToPQ(AF4 a) { return sqrt(sqrt(a)); }
+ AF4 APrxLoLinearToPQ(AF4 a) { return AF4_AU4((AU4_AF4(a) >> AU4_(3)) + AU4_(0x378D8723)); }
+ AF4 APrxMedLinearToPQ(AF4 a) { AF4 b = AF4_AU4((AU4_AF4(a) >> AU4_(3)) + AU4_(0x378D8723)); AF4 b8 = Oct(b); return b - b * (b8 - a) / (AF1_(8.0) * b8); }
+ AF4 APrxHighLinearToPQ(AF4 a) { return sqrt(sqrt(sqrt(a))); }
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// PARABOLIC SIN & COS
+//------------------------------------------------------------------------------------------------------------------------------
+// Approximate answers to transcendental questions.
+//------------------------------------------------------------------------------------------------------------------------------
+//==============================================================================================================================
+ #if 1
+ // Valid input range is {-1 to 1} representing {0 to 2 pi}.
+ // Output range is {-1/4 to 1/4} representing {-1 to 1}.
+ AF1 APSinF1(AF1 x){return x*abs(x)-x;} // MAD.
+ AF2 APSinF2(AF2 x){return x*abs(x)-x;}
+ AF1 APCosF1(AF1 x){x=AFractF1(x*AF1_(0.5)+AF1_(0.75));x=x*AF1_(2.0)-AF1_(1.0);return APSinF1(x);} // 3x MAD, FRACT
+ AF2 APCosF2(AF2 x){x=AFractF2(x*AF2_(0.5)+AF2_(0.75));x=x*AF2_(2.0)-AF2_(1.0);return APSinF2(x);}
+ AF2 APSinCosF1(AF1 x){AF1 y=AFractF1(x*AF1_(0.5)+AF1_(0.75));y=y*AF1_(2.0)-AF1_(1.0);return APSinF2(AF2(x,y));}
+ #endif
+//------------------------------------------------------------------------------------------------------------------------------
+ #ifdef A_HALF
+ // For a packed {sin,cos} pair,
+ // - Native takes 16 clocks and 4 issue slots (no packed transcendentals).
+ // - Parabolic takes 8 clocks and 8 issue slots (only fract is non-packed).
+ AH1 APSinH1(AH1 x){return x*abs(x)-x;}
+ AH2 APSinH2(AH2 x){return x*abs(x)-x;} // AND,FMA
+ AH1 APCosH1(AH1 x){x=AFractH1(x*AH1_(0.5)+AH1_(0.75));x=x*AH1_(2.0)-AH1_(1.0);return APSinH1(x);}
+ AH2 APCosH2(AH2 x){x=AFractH2(x*AH2_(0.5)+AH2_(0.75));x=x*AH2_(2.0)-AH2_(1.0);return APSinH2(x);} // 3x FMA, 2xFRACT, AND
+ AH2 APSinCosH1(AH1 x){AH1 y=AFractH1(x*AH1_(0.5)+AH1_(0.75));y=y*AH1_(2.0)-AH1_(1.0);return APSinH2(AH2(x,y));}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// [ZOL] ZERO ONE LOGIC
+//------------------------------------------------------------------------------------------------------------------------------
+// Conditional free logic designed for easy 16-bit packing, and backwards porting to 32-bit.
+//------------------------------------------------------------------------------------------------------------------------------
+// 0 := false
+// 1 := true
+//------------------------------------------------------------------------------------------------------------------------------
+// AndNot(x,y) -> !(x&y) .... One op.
+// AndOr(x,y,z) -> (x&y)|z ... One op.
+// GtZero(x) -> x>0.0 ..... One op.
+// Sel(x,y,z) -> x?y:z ..... Two ops, has no precision loss.
+// Signed(x) -> x<0.0 ..... One op.
+// ZeroPass(x,y) -> x?0:y ..... Two ops, 'y' is a pass through safe for aliasing as integer.
+//------------------------------------------------------------------------------------------------------------------------------
+// OPTIMIZATION NOTES
+// ==================
+// - On Vega to use 2 constants in a packed op, pass in as one AW2 or one AH2 'k.xy' and use as 'k.xx' and 'k.yy'.
+// For example 'a.xy*k.xx+k.yy'.
+//==============================================================================================================================
+ #if 1
+ AU1 AZolAndU1(AU1 x,AU1 y){return min(x,y);}
+ AU2 AZolAndU2(AU2 x,AU2 y){return min(x,y);}
+ AU3 AZolAndU3(AU3 x,AU3 y){return min(x,y);}
+ AU4 AZolAndU4(AU4 x,AU4 y){return min(x,y);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AZolNotU1(AU1 x){return x^AU1_(1);}
+ AU2 AZolNotU2(AU2 x){return x^AU2_(1);}
+ AU3 AZolNotU3(AU3 x){return x^AU3_(1);}
+ AU4 AZolNotU4(AU4 x){return x^AU4_(1);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AU1 AZolOrU1(AU1 x,AU1 y){return max(x,y);}
+ AU2 AZolOrU2(AU2 x,AU2 y){return max(x,y);}
+ AU3 AZolOrU3(AU3 x,AU3 y){return max(x,y);}
+ AU4 AZolOrU4(AU4 x,AU4 y){return max(x,y);}
+//==============================================================================================================================
+ AU1 AZolF1ToU1(AF1 x){return AU1(x);}
+ AU2 AZolF2ToU2(AF2 x){return AU2(x);}
+ AU3 AZolF3ToU3(AF3 x){return AU3(x);}
+ AU4 AZolF4ToU4(AF4 x){return AU4(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ // 2 ops, denormals don't work in 32-bit on PC (and if they are enabled, OMOD is disabled).
+ AU1 AZolNotF1ToU1(AF1 x){return AU1(AF1_(1.0)-x);}
+ AU2 AZolNotF2ToU2(AF2 x){return AU2(AF2_(1.0)-x);}
+ AU3 AZolNotF3ToU3(AF3 x){return AU3(AF3_(1.0)-x);}
+ AU4 AZolNotF4ToU4(AF4 x){return AU4(AF4_(1.0)-x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AZolU1ToF1(AU1 x){return AF1(x);}
+ AF2 AZolU2ToF2(AU2 x){return AF2(x);}
+ AF3 AZolU3ToF3(AU3 x){return AF3(x);}
+ AF4 AZolU4ToF4(AU4 x){return AF4(x);}
+//==============================================================================================================================
+ AF1 AZolAndF1(AF1 x,AF1 y){return min(x,y);}
+ AF2 AZolAndF2(AF2 x,AF2 y){return min(x,y);}
+ AF3 AZolAndF3(AF3 x,AF3 y){return min(x,y);}
+ AF4 AZolAndF4(AF4 x,AF4 y){return min(x,y);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 ASolAndNotF1(AF1 x,AF1 y){return (-x)*y+AF1_(1.0);}
+ AF2 ASolAndNotF2(AF2 x,AF2 y){return (-x)*y+AF2_(1.0);}
+ AF3 ASolAndNotF3(AF3 x,AF3 y){return (-x)*y+AF3_(1.0);}
+ AF4 ASolAndNotF4(AF4 x,AF4 y){return (-x)*y+AF4_(1.0);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AZolAndOrF1(AF1 x,AF1 y,AF1 z){return ASatF1(x*y+z);}
+ AF2 AZolAndOrF2(AF2 x,AF2 y,AF2 z){return ASatF2(x*y+z);}
+ AF3 AZolAndOrF3(AF3 x,AF3 y,AF3 z){return ASatF3(x*y+z);}
+ AF4 AZolAndOrF4(AF4 x,AF4 y,AF4 z){return ASatF4(x*y+z);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AZolGtZeroF1(AF1 x){return ASatF1(x*AF1_(A_INFP_F));}
+ AF2 AZolGtZeroF2(AF2 x){return ASatF2(x*AF2_(A_INFP_F));}
+ AF3 AZolGtZeroF3(AF3 x){return ASatF3(x*AF3_(A_INFP_F));}
+ AF4 AZolGtZeroF4(AF4 x){return ASatF4(x*AF4_(A_INFP_F));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AZolNotF1(AF1 x){return AF1_(1.0)-x;}
+ AF2 AZolNotF2(AF2 x){return AF2_(1.0)-x;}
+ AF3 AZolNotF3(AF3 x){return AF3_(1.0)-x;}
+ AF4 AZolNotF4(AF4 x){return AF4_(1.0)-x;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AZolOrF1(AF1 x,AF1 y){return max(x,y);}
+ AF2 AZolOrF2(AF2 x,AF2 y){return max(x,y);}
+ AF3 AZolOrF3(AF3 x,AF3 y){return max(x,y);}
+ AF4 AZolOrF4(AF4 x,AF4 y){return max(x,y);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AZolSelF1(AF1 x,AF1 y,AF1 z){AF1 r=(-x)*z+z;return x*y+r;}
+ AF2 AZolSelF2(AF2 x,AF2 y,AF2 z){AF2 r=(-x)*z+z;return x*y+r;}
+ AF3 AZolSelF3(AF3 x,AF3 y,AF3 z){AF3 r=(-x)*z+z;return x*y+r;}
+ AF4 AZolSelF4(AF4 x,AF4 y,AF4 z){AF4 r=(-x)*z+z;return x*y+r;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AZolSignedF1(AF1 x){return ASatF1(x*AF1_(A_INFN_F));}
+ AF2 AZolSignedF2(AF2 x){return ASatF2(x*AF2_(A_INFN_F));}
+ AF3 AZolSignedF3(AF3 x){return ASatF3(x*AF3_(A_INFN_F));}
+ AF4 AZolSignedF4(AF4 x){return ASatF4(x*AF4_(A_INFN_F));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AZolZeroPassF1(AF1 x,AF1 y){return AF1_AU1((AU1_AF1(x)!=AU1_(0))?AU1_(0):AU1_AF1(y));}
+ AF2 AZolZeroPassF2(AF2 x,AF2 y){return AF2_AU2((AU2_AF2(x)!=AU2_(0))?AU2_(0):AU2_AF2(y));}
+ AF3 AZolZeroPassF3(AF3 x,AF3 y){return AF3_AU3((AU3_AF3(x)!=AU3_(0))?AU3_(0):AU3_AF3(y));}
+ AF4 AZolZeroPassF4(AF4 x,AF4 y){return AF4_AU4((AU4_AF4(x)!=AU4_(0))?AU4_(0):AU4_AF4(y));}
+ #endif
+//==============================================================================================================================
+ #ifdef A_HALF
+ AW1 AZolAndW1(AW1 x,AW1 y){return min(x,y);}
+ AW2 AZolAndW2(AW2 x,AW2 y){return min(x,y);}
+ AW3 AZolAndW3(AW3 x,AW3 y){return min(x,y);}
+ AW4 AZolAndW4(AW4 x,AW4 y){return min(x,y);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AW1 AZolNotW1(AW1 x){return x^AW1_(1);}
+ AW2 AZolNotW2(AW2 x){return x^AW2_(1);}
+ AW3 AZolNotW3(AW3 x){return x^AW3_(1);}
+ AW4 AZolNotW4(AW4 x){return x^AW4_(1);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AW1 AZolOrW1(AW1 x,AW1 y){return max(x,y);}
+ AW2 AZolOrW2(AW2 x,AW2 y){return max(x,y);}
+ AW3 AZolOrW3(AW3 x,AW3 y){return max(x,y);}
+ AW4 AZolOrW4(AW4 x,AW4 y){return max(x,y);}
+//==============================================================================================================================
+ // Uses denormal trick.
+ AW1 AZolH1ToW1(AH1 x){return AW1_AH1(x*AH1_AW1(AW1_(1)));}
+ AW2 AZolH2ToW2(AH2 x){return AW2_AH2(x*AH2_AW2(AW2_(1)));}
+ AW3 AZolH3ToW3(AH3 x){return AW3_AH3(x*AH3_AW3(AW3_(1)));}
+ AW4 AZolH4ToW4(AH4 x){return AW4_AH4(x*AH4_AW4(AW4_(1)));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // AMD arch lacks a packed conversion opcode.
+ AH1 AZolW1ToH1(AW1 x){return AH1_AW1(x*AW1_AH1(AH1_(1.0)));}
+ AH2 AZolW2ToH2(AW2 x){return AH2_AW2(x*AW2_AH2(AH2_(1.0)));}
+ AH3 AZolW1ToH3(AW3 x){return AH3_AW3(x*AW3_AH3(AH3_(1.0)));}
+ AH4 AZolW2ToH4(AW4 x){return AH4_AW4(x*AW4_AH4(AH4_(1.0)));}
+//==============================================================================================================================
+ AH1 AZolAndH1(AH1 x,AH1 y){return min(x,y);}
+ AH2 AZolAndH2(AH2 x,AH2 y){return min(x,y);}
+ AH3 AZolAndH3(AH3 x,AH3 y){return min(x,y);}
+ AH4 AZolAndH4(AH4 x,AH4 y){return min(x,y);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 ASolAndNotH1(AH1 x,AH1 y){return (-x)*y+AH1_(1.0);}
+ AH2 ASolAndNotH2(AH2 x,AH2 y){return (-x)*y+AH2_(1.0);}
+ AH3 ASolAndNotH3(AH3 x,AH3 y){return (-x)*y+AH3_(1.0);}
+ AH4 ASolAndNotH4(AH4 x,AH4 y){return (-x)*y+AH4_(1.0);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AZolAndOrH1(AH1 x,AH1 y,AH1 z){return ASatH1(x*y+z);}
+ AH2 AZolAndOrH2(AH2 x,AH2 y,AH2 z){return ASatH2(x*y+z);}
+ AH3 AZolAndOrH3(AH3 x,AH3 y,AH3 z){return ASatH3(x*y+z);}
+ AH4 AZolAndOrH4(AH4 x,AH4 y,AH4 z){return ASatH4(x*y+z);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AZolGtZeroH1(AH1 x){return ASatH1(x*AH1_(A_INFP_H));}
+ AH2 AZolGtZeroH2(AH2 x){return ASatH2(x*AH2_(A_INFP_H));}
+ AH3 AZolGtZeroH3(AH3 x){return ASatH3(x*AH3_(A_INFP_H));}
+ AH4 AZolGtZeroH4(AH4 x){return ASatH4(x*AH4_(A_INFP_H));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AZolNotH1(AH1 x){return AH1_(1.0)-x;}
+ AH2 AZolNotH2(AH2 x){return AH2_(1.0)-x;}
+ AH3 AZolNotH3(AH3 x){return AH3_(1.0)-x;}
+ AH4 AZolNotH4(AH4 x){return AH4_(1.0)-x;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AZolOrH1(AH1 x,AH1 y){return max(x,y);}
+ AH2 AZolOrH2(AH2 x,AH2 y){return max(x,y);}
+ AH3 AZolOrH3(AH3 x,AH3 y){return max(x,y);}
+ AH4 AZolOrH4(AH4 x,AH4 y){return max(x,y);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AZolSelH1(AH1 x,AH1 y,AH1 z){AH1 r=(-x)*z+z;return x*y+r;}
+ AH2 AZolSelH2(AH2 x,AH2 y,AH2 z){AH2 r=(-x)*z+z;return x*y+r;}
+ AH3 AZolSelH3(AH3 x,AH3 y,AH3 z){AH3 r=(-x)*z+z;return x*y+r;}
+ AH4 AZolSelH4(AH4 x,AH4 y,AH4 z){AH4 r=(-x)*z+z;return x*y+r;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AZolSignedH1(AH1 x){return ASatH1(x*AH1_(A_INFN_H));}
+ AH2 AZolSignedH2(AH2 x){return ASatH2(x*AH2_(A_INFN_H));}
+ AH3 AZolSignedH3(AH3 x){return ASatH3(x*AH3_(A_INFN_H));}
+ AH4 AZolSignedH4(AH4 x){return ASatH4(x*AH4_(A_INFN_H));}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// COLOR CONVERSIONS
+//------------------------------------------------------------------------------------------------------------------------------
+// These are all linear to/from some other space (where 'linear' has been shortened out of the function name).
+// So 'ToGamma' is 'LinearToGamma', and 'FromGamma' is 'LinearFromGamma'.
+// These are branch free implementations.
+// The AToSrgbF1() function is useful for stores for compute shaders for GPUs without hardware linear->sRGB store conversion.
+//------------------------------------------------------------------------------------------------------------------------------
+// TRANSFER FUNCTIONS
+// ==================
+// 709 ..... Rec709 used for some HDTVs
+// Gamma ... Typically 2.2 for some PC displays, or 2.4-2.5 for CRTs, or 2.2 FreeSync2 native
+// Pq ...... PQ native for HDR10
+// Srgb .... The sRGB output, typical of PC displays, useful for 10-bit output, or storing to 8-bit UNORM without SRGB type
+// Two ..... Gamma 2.0, fastest conversion (useful for intermediate pass approximations)
+// Three ... Gamma 3.0, less fast, but good for HDR.
+//------------------------------------------------------------------------------------------------------------------------------
+// KEEPING TO SPEC
+// ===============
+// Both Rec.709 and sRGB have a linear segment which as spec'ed would intersect the curved segment 2 times.
+// (a.) For 8-bit sRGB, steps {0 to 10.3} are in the linear region (4% of the encoding range).
+// (b.) For 8-bit 709, steps {0 to 20.7} are in the linear region (8% of the encoding range).
+// Also there is a slight step in the transition regions.
+// Precision of the coefficients in the spec being the likely cause.
+// Main usage case of the sRGB code is to do the linear->sRGB conversion in a compute shader before store.
+// This is to work around lack of hardware (typically only ROP does the conversion for free).
+// To "correct" the linear segment, would be to introduce error, because hardware decode of sRGB->linear is fixed (and free).
+// So this header keeps with the spec.
+// For linear->sRGB transforms, the linear segment in some respects reduces error, because rounding in that region is linear.
+// Rounding in the curved region in hardware (and fast software code) introduces error due to rounding in non-linear.
+//------------------------------------------------------------------------------------------------------------------------------
+// FOR PQ
+// ======
+// Both input and output is {0.0-1.0}, and where output 1.0 represents 10000.0 cd/m^2.
+// All constants are only specified to FP32 precision.
+// External PQ source reference,
+// - https://github.com/ampas/aces-dev/blob/master/transforms/ctl/utilities/ACESlib.Utilities_Color.a1.0.1.ctl
+//------------------------------------------------------------------------------------------------------------------------------
+// PACKED VERSIONS
+// ===============
+// These are the A*H2() functions.
+// There is no PQ functions as FP16 seemed to not have enough precision for the conversion.
+// The remaining functions are "good enough" for 8-bit, and maybe 10-bit if not concerned about a few 1-bit errors.
+// Precision is lowest in the 709 conversion, higher in sRGB, higher still in Two and Gamma (when using 2.2 at least).
+//------------------------------------------------------------------------------------------------------------------------------
+// NOTES
+// =====
+// Could be faster for PQ conversions to be in ALU or a texture lookup depending on usage case.
+//==============================================================================================================================
+ #if 1
+ AF1 ATo709F1(AF1 c){AF3 j=AF3(0.018*4.5,4.5,0.45);AF2 k=AF2(1.099,-0.099);
+ return clamp(j.x ,c*j.y ,pow(c,j.z )*k.x +k.y );}
+ AF2 ATo709F2(AF2 c){AF3 j=AF3(0.018*4.5,4.5,0.45);AF2 k=AF2(1.099,-0.099);
+ return clamp(j.xx ,c*j.yy ,pow(c,j.zz )*k.xx +k.yy );}
+ AF3 ATo709F3(AF3 c){AF3 j=AF3(0.018*4.5,4.5,0.45);AF2 k=AF2(1.099,-0.099);
+ return clamp(j.xxx,c*j.yyy,pow(c,j.zzz)*k.xxx+k.yyy);}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Note 'rcpX' is '1/x', where the 'x' is what would be used in AFromGamma().
+ AF1 AToGammaF1(AF1 c,AF1 rcpX){return pow(c,AF1_(rcpX));}
+ AF2 AToGammaF2(AF2 c,AF1 rcpX){return pow(c,AF2_(rcpX));}
+ AF3 AToGammaF3(AF3 c,AF1 rcpX){return pow(c,AF3_(rcpX));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AToPqF1(AF1 x){AF1 p=pow(x,AF1_(0.159302));
+ return pow((AF1_(0.835938)+AF1_(18.8516)*p)/(AF1_(1.0)+AF1_(18.6875)*p),AF1_(78.8438));}
+ AF2 AToPqF1(AF2 x){AF2 p=pow(x,AF2_(0.159302));
+ return pow((AF2_(0.835938)+AF2_(18.8516)*p)/(AF2_(1.0)+AF2_(18.6875)*p),AF2_(78.8438));}
+ AF3 AToPqF1(AF3 x){AF3 p=pow(x,AF3_(0.159302));
+ return pow((AF3_(0.835938)+AF3_(18.8516)*p)/(AF3_(1.0)+AF3_(18.6875)*p),AF3_(78.8438));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AToSrgbF1(AF1 c){AF3 j=AF3(0.0031308*12.92,12.92,1.0/2.4);AF2 k=AF2(1.055,-0.055);
+ return clamp(j.x ,c*j.y ,pow(c,j.z )*k.x +k.y );}
+ AF2 AToSrgbF2(AF2 c){AF3 j=AF3(0.0031308*12.92,12.92,1.0/2.4);AF2 k=AF2(1.055,-0.055);
+ return clamp(j.xx ,c*j.yy ,pow(c,j.zz )*k.xx +k.yy );}
+ AF3 AToSrgbF3(AF3 c){AF3 j=AF3(0.0031308*12.92,12.92,1.0/2.4);AF2 k=AF2(1.055,-0.055);
+ return clamp(j.xxx,c*j.yyy,pow(c,j.zzz)*k.xxx+k.yyy);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AToTwoF1(AF1 c){return sqrt(c);}
+ AF2 AToTwoF2(AF2 c){return sqrt(c);}
+ AF3 AToTwoF3(AF3 c){return sqrt(c);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AToThreeF1(AF1 c){return pow(c,AF1_(1.0/3.0));}
+ AF2 AToThreeF2(AF2 c){return pow(c,AF2_(1.0/3.0));}
+ AF3 AToThreeF3(AF3 c){return pow(c,AF3_(1.0/3.0));}
+ #endif
+//==============================================================================================================================
+ #if 1
+ // Unfortunately median won't work here.
+ AF1 AFrom709F1(AF1 c){AF3 j=AF3(0.081/4.5,1.0/4.5,1.0/0.45);AF2 k=AF2(1.0/1.099,0.099/1.099);
+ return AZolSelF1(AZolSignedF1(c-j.x ),c*j.y ,pow(c*k.x +k.y ,j.z ));}
+ AF2 AFrom709F2(AF2 c){AF3 j=AF3(0.081/4.5,1.0/4.5,1.0/0.45);AF2 k=AF2(1.0/1.099,0.099/1.099);
+ return AZolSelF2(AZolSignedF2(c-j.xx ),c*j.yy ,pow(c*k.xx +k.yy ,j.zz ));}
+ AF3 AFrom709F3(AF3 c){AF3 j=AF3(0.081/4.5,1.0/4.5,1.0/0.45);AF2 k=AF2(1.0/1.099,0.099/1.099);
+ return AZolSelF3(AZolSignedF3(c-j.xxx),c*j.yyy,pow(c*k.xxx+k.yyy,j.zzz));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AFromGammaF1(AF1 c,AF1 x){return pow(c,AF1_(x));}
+ AF2 AFromGammaF2(AF2 c,AF1 x){return pow(c,AF2_(x));}
+ AF3 AFromGammaF3(AF3 c,AF1 x){return pow(c,AF3_(x));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AFromPqF1(AF1 x){AF1 p=pow(x,AF1_(0.0126833));
+ return pow(ASatF1(p-AF1_(0.835938))/(AF1_(18.8516)-AF1_(18.6875)*p),AF1_(6.27739));}
+ AF2 AFromPqF1(AF2 x){AF2 p=pow(x,AF2_(0.0126833));
+ return pow(ASatF2(p-AF2_(0.835938))/(AF2_(18.8516)-AF2_(18.6875)*p),AF2_(6.27739));}
+ AF3 AFromPqF1(AF3 x){AF3 p=pow(x,AF3_(0.0126833));
+ return pow(ASatF3(p-AF3_(0.835938))/(AF3_(18.8516)-AF3_(18.6875)*p),AF3_(6.27739));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Unfortunately median won't work here.
+ AF1 AFromSrgbF1(AF1 c){AF3 j=AF3(0.04045/12.92,1.0/12.92,2.4);AF2 k=AF2(1.0/1.055,0.055/1.055);
+ return AZolSelF1(AZolSignedF1(c-j.x ),c*j.y ,pow(c*k.x +k.y ,j.z ));}
+ AF2 AFromSrgbF2(AF2 c){AF3 j=AF3(0.04045/12.92,1.0/12.92,2.4);AF2 k=AF2(1.0/1.055,0.055/1.055);
+ return AZolSelF2(AZolSignedF2(c-j.xx ),c*j.yy ,pow(c*k.xx +k.yy ,j.zz ));}
+ AF3 AFromSrgbF3(AF3 c){AF3 j=AF3(0.04045/12.92,1.0/12.92,2.4);AF2 k=AF2(1.0/1.055,0.055/1.055);
+ return AZolSelF3(AZolSignedF3(c-j.xxx),c*j.yyy,pow(c*k.xxx+k.yyy,j.zzz));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AFromTwoF1(AF1 c){return c*c;}
+ AF2 AFromTwoF2(AF2 c){return c*c;}
+ AF3 AFromTwoF3(AF3 c){return c*c;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF1 AFromThreeF1(AF1 c){return c*c*c;}
+ AF2 AFromThreeF2(AF2 c){return c*c*c;}
+ AF3 AFromThreeF3(AF3 c){return c*c*c;}
+ #endif
+//==============================================================================================================================
+ #ifdef A_HALF
+ AH1 ATo709H1(AH1 c){AH3 j=AH3(0.018*4.5,4.5,0.45);AH2 k=AH2(1.099,-0.099);
+ return clamp(j.x ,c*j.y ,pow(c,j.z )*k.x +k.y );}
+ AH2 ATo709H2(AH2 c){AH3 j=AH3(0.018*4.5,4.5,0.45);AH2 k=AH2(1.099,-0.099);
+ return clamp(j.xx ,c*j.yy ,pow(c,j.zz )*k.xx +k.yy );}
+ AH3 ATo709H3(AH3 c){AH3 j=AH3(0.018*4.5,4.5,0.45);AH2 k=AH2(1.099,-0.099);
+ return clamp(j.xxx,c*j.yyy,pow(c,j.zzz)*k.xxx+k.yyy);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AToGammaH1(AH1 c,AH1 rcpX){return pow(c,AH1_(rcpX));}
+ AH2 AToGammaH2(AH2 c,AH1 rcpX){return pow(c,AH2_(rcpX));}
+ AH3 AToGammaH3(AH3 c,AH1 rcpX){return pow(c,AH3_(rcpX));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AToSrgbH1(AH1 c){AH3 j=AH3(0.0031308*12.92,12.92,1.0/2.4);AH2 k=AH2(1.055,-0.055);
+ return clamp(j.x ,c*j.y ,pow(c,j.z )*k.x +k.y );}
+ AH2 AToSrgbH2(AH2 c){AH3 j=AH3(0.0031308*12.92,12.92,1.0/2.4);AH2 k=AH2(1.055,-0.055);
+ return clamp(j.xx ,c*j.yy ,pow(c,j.zz )*k.xx +k.yy );}
+ AH3 AToSrgbH3(AH3 c){AH3 j=AH3(0.0031308*12.92,12.92,1.0/2.4);AH2 k=AH2(1.055,-0.055);
+ return clamp(j.xxx,c*j.yyy,pow(c,j.zzz)*k.xxx+k.yyy);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AToTwoH1(AH1 c){return sqrt(c);}
+ AH2 AToTwoH2(AH2 c){return sqrt(c);}
+ AH3 AToTwoH3(AH3 c){return sqrt(c);}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AToThreeH1(AH1 c){return pow(c,AH1_(1.0/3.0));}
+ AH2 AToThreeH2(AH2 c){return pow(c,AH2_(1.0/3.0));}
+ AH3 AToThreeH3(AH3 c){return pow(c,AH3_(1.0/3.0));}
+ #endif
+//==============================================================================================================================
+ #ifdef A_HALF
+ AH1 AFrom709H1(AH1 c){AH3 j=AH3(0.081/4.5,1.0/4.5,1.0/0.45);AH2 k=AH2(1.0/1.099,0.099/1.099);
+ return AZolSelH1(AZolSignedH1(c-j.x ),c*j.y ,pow(c*k.x +k.y ,j.z ));}
+ AH2 AFrom709H2(AH2 c){AH3 j=AH3(0.081/4.5,1.0/4.5,1.0/0.45);AH2 k=AH2(1.0/1.099,0.099/1.099);
+ return AZolSelH2(AZolSignedH2(c-j.xx ),c*j.yy ,pow(c*k.xx +k.yy ,j.zz ));}
+ AH3 AFrom709H3(AH3 c){AH3 j=AH3(0.081/4.5,1.0/4.5,1.0/0.45);AH2 k=AH2(1.0/1.099,0.099/1.099);
+ return AZolSelH3(AZolSignedH3(c-j.xxx),c*j.yyy,pow(c*k.xxx+k.yyy,j.zzz));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AFromGammaH1(AH1 c,AH1 x){return pow(c,AH1_(x));}
+ AH2 AFromGammaH2(AH2 c,AH1 x){return pow(c,AH2_(x));}
+ AH3 AFromGammaH3(AH3 c,AH1 x){return pow(c,AH3_(x));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AHromSrgbF1(AH1 c){AH3 j=AH3(0.04045/12.92,1.0/12.92,2.4);AH2 k=AH2(1.0/1.055,0.055/1.055);
+ return AZolSelH1(AZolSignedH1(c-j.x ),c*j.y ,pow(c*k.x +k.y ,j.z ));}
+ AH2 AHromSrgbF2(AH2 c){AH3 j=AH3(0.04045/12.92,1.0/12.92,2.4);AH2 k=AH2(1.0/1.055,0.055/1.055);
+ return AZolSelH2(AZolSignedH2(c-j.xx ),c*j.yy ,pow(c*k.xx +k.yy ,j.zz ));}
+ AH3 AHromSrgbF3(AH3 c){AH3 j=AH3(0.04045/12.92,1.0/12.92,2.4);AH2 k=AH2(1.0/1.055,0.055/1.055);
+ return AZolSelH3(AZolSignedH3(c-j.xxx),c*j.yyy,pow(c*k.xxx+k.yyy,j.zzz));}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AFromTwoH1(AH1 c){return c*c;}
+ AH2 AFromTwoH2(AH2 c){return c*c;}
+ AH3 AFromTwoH3(AH3 c){return c*c;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AH1 AFromThreeH1(AH1 c){return c*c*c;}
+ AH2 AFromThreeH2(AH2 c){return c*c*c;}
+ AH3 AFromThreeH3(AH3 c){return c*c*c;}
+ #endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// CS REMAP
+//==============================================================================================================================
+ // Simple remap 64x1 to 8x8 with rotated 2x2 pixel quads in quad linear.
+ // 543210
+ // ======
+ // ..xxx.
+ // yy...y
+ AU2 ARmp8x8(AU1 a){return AU2(ABfe(a,1u,3u),ABfiM(ABfe(a,3u,3u),a,1u));}
+//==============================================================================================================================
+ // More complex remap 64x1 to 8x8 which is necessary for 2D wave reductions.
+ // 543210
+ // ======
+ // .xx..x
+ // y..yy.
+ // Details,
+ // LANE TO 8x8 MAPPING
+ // ===================
+ // 00 01 08 09 10 11 18 19
+ // 02 03 0a 0b 12 13 1a 1b
+ // 04 05 0c 0d 14 15 1c 1d
+ // 06 07 0e 0f 16 17 1e 1f
+ // 20 21 28 29 30 31 38 39
+ // 22 23 2a 2b 32 33 3a 3b
+ // 24 25 2c 2d 34 35 3c 3d
+ // 26 27 2e 2f 36 37 3e 3f
+ AU2 ARmpRed8x8(AU1 a){return AU2(ABfiM(ABfe(a,2u,3u),a,1u),ABfiM(ABfe(a,3u,3u),ABfe(a,1u,2u),2u));}
+//==============================================================================================================================
+ #ifdef A_HALF
+ AW2 ARmp8x8H(AU1 a){return AW2(ABfe(a,1u,3u),ABfiM(ABfe(a,3u,3u),a,1u));}
+ AW2 ARmpRed8x8H(AU1 a){return AW2(ABfiM(ABfe(a,2u,3u),a,1u),ABfiM(ABfe(a,3u,3u),ABfe(a,1u,2u),2u));}
+ #endif
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+//
+// REFERENCE
+//
+//------------------------------------------------------------------------------------------------------------------------------
+// IEEE FLOAT RULES
+// ================
+// - saturate(NaN)=0, saturate(-INF)=0, saturate(+INF)=1
+// - {+/-}0 * {+/-}INF = NaN
+// - -INF + (+INF) = NaN
+// - {+/-}0 / {+/-}0 = NaN
+// - {+/-}INF / {+/-}INF = NaN
+// - a<(-0) := sqrt(a) = NaN (a=-0.0 won't NaN)
+// - 0 == -0
+// - 4/0 = +INF
+// - 4/-0 = -INF
+// - 4+INF = +INF
+// - 4-INF = -INF
+// - 4*(+INF) = +INF
+// - 4*(-INF) = -INF
+// - -4*(+INF) = -INF
+// - sqrt(+INF) = +INF
+//------------------------------------------------------------------------------------------------------------------------------
+// FP16 ENCODING
+// =============
+// fedcba9876543210
+// ----------------
+// ......mmmmmmmmmm 10-bit mantissa (encodes 11-bit 0.5 to 1.0 except for denormals)
+// .eeeee.......... 5-bit exponent
+// .00000.......... denormals
+// .00001.......... -14 exponent
+// .11110.......... 15 exponent
+// .111110000000000 infinity
+// .11111nnnnnnnnnn NaN with n!=0
+// s............... sign
+//------------------------------------------------------------------------------------------------------------------------------
+// FP16/INT16 ALIASING DENORMAL
+// ============================
+// 11-bit unsigned integers alias with half float denormal/normal values,
+// 1 = 2^(-24) = 1/16777216 ....................... first denormal value
+// 2 = 2^(-23)
+// ...
+// 1023 = 2^(-14)*(1-2^(-10)) = 2^(-14)*(1-1/1024) ... last denormal value
+// 1024 = 2^(-14) = 1/16384 .......................... first normal value that still maps to integers
+// 2047 .............................................. last normal value that still maps to integers
+// Scaling limits,
+// 2^15 = 32768 ...................................... largest power of 2 scaling
+// Largest pow2 conversion mapping is at *32768,
+// 1 : 2^(-9) = 1/512
+// 2 : 1/256
+// 4 : 1/128
+// 8 : 1/64
+// 16 : 1/32
+// 32 : 1/16
+// 64 : 1/8
+// 128 : 1/4
+// 256 : 1/2
+// 512 : 1
+// 1024 : 2
+// 2047 : a little less than 4
+//==============================================================================================================================
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+//
+//
+// GPU/CPU PORTABILITY
+//
+//
+//------------------------------------------------------------------------------------------------------------------------------
+// This is the GPU implementation.
+// See the CPU implementation for docs.
+//==============================================================================================================================
+#ifdef A_GPU
+ #define A_TRUE true
+ #define A_FALSE false
+ #define A_STATIC
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// VECTOR ARGUMENT/RETURN/INITIALIZATION PORTABILITY
+//==============================================================================================================================
+ #define retAD2 AD2
+ #define retAD3 AD3
+ #define retAD4 AD4
+ #define retAF2 AF2
+ #define retAF3 AF3
+ #define retAF4 AF4
+ #define retAL2 AL2
+ #define retAL3 AL3
+ #define retAL4 AL4
+ #define retAU2 AU2
+ #define retAU3 AU3
+ #define retAU4 AU4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define inAD2 in AD2
+ #define inAD3 in AD3
+ #define inAD4 in AD4
+ #define inAF2 in AF2
+ #define inAF3 in AF3
+ #define inAF4 in AF4
+ #define inAL2 in AL2
+ #define inAL3 in AL3
+ #define inAL4 in AL4
+ #define inAU2 in AU2
+ #define inAU3 in AU3
+ #define inAU4 in AU4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define inoutAD2 inout AD2
+ #define inoutAD3 inout AD3
+ #define inoutAD4 inout AD4
+ #define inoutAF2 inout AF2
+ #define inoutAF3 inout AF3
+ #define inoutAF4 inout AF4
+ #define inoutAL2 inout AL2
+ #define inoutAL3 inout AL3
+ #define inoutAL4 inout AL4
+ #define inoutAU2 inout AU2
+ #define inoutAU3 inout AU3
+ #define inoutAU4 inout AU4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define outAD2 out AD2
+ #define outAD3 out AD3
+ #define outAD4 out AD4
+ #define outAF2 out AF2
+ #define outAF3 out AF3
+ #define outAF4 out AF4
+ #define outAL2 out AL2
+ #define outAL3 out AL3
+ #define outAL4 out AL4
+ #define outAU2 out AU2
+ #define outAU3 out AU3
+ #define outAU4 out AU4
+//------------------------------------------------------------------------------------------------------------------------------
+ #define varAD2(x) AD2 x
+ #define varAD3(x) AD3 x
+ #define varAD4(x) AD4 x
+ #define varAF2(x) AF2 x
+ #define varAF3(x) AF3 x
+ #define varAF4(x) AF4 x
+ #define varAL2(x) AL2 x
+ #define varAL3(x) AL3 x
+ #define varAL4(x) AL4 x
+ #define varAU2(x) AU2 x
+ #define varAU3(x) AU3 x
+ #define varAU4(x) AU4 x
+//------------------------------------------------------------------------------------------------------------------------------
+ #define initAD2(x,y) AD2(x,y)
+ #define initAD3(x,y,z) AD3(x,y,z)
+ #define initAD4(x,y,z,w) AD4(x,y,z,w)
+ #define initAF2(x,y) AF2(x,y)
+ #define initAF3(x,y,z) AF3(x,y,z)
+ #define initAF4(x,y,z,w) AF4(x,y,z,w)
+ #define initAL2(x,y) AL2(x,y)
+ #define initAL3(x,y,z) AL3(x,y,z)
+ #define initAL4(x,y,z,w) AL4(x,y,z,w)
+ #define initAU2(x,y) AU2(x,y)
+ #define initAU3(x,y,z) AU3(x,y,z)
+ #define initAU4(x,y,z,w) AU4(x,y,z,w)
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// SCALAR RETURN OPS
+//==============================================================================================================================
+ #define AAbsD1(a) abs(AD1(a))
+ #define AAbsF1(a) abs(AF1(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ACosD1(a) cos(AD1(a))
+ #define ACosF1(a) cos(AF1(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ADotD2(a,b) dot(AD2(a),AD2(b))
+ #define ADotD3(a,b) dot(AD3(a),AD3(b))
+ #define ADotD4(a,b) dot(AD4(a),AD4(b))
+ #define ADotF2(a,b) dot(AF2(a),AF2(b))
+ #define ADotF3(a,b) dot(AF3(a),AF3(b))
+ #define ADotF4(a,b) dot(AF4(a),AF4(b))
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AExp2D1(a) exp2(AD1(a))
+ #define AExp2F1(a) exp2(AF1(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AFloorD1(a) floor(AD1(a))
+ #define AFloorF1(a) floor(AF1(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ALog2D1(a) log2(AD1(a))
+ #define ALog2F1(a) log2(AF1(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AMaxD1(a,b) max(a,b)
+ #define AMaxF1(a,b) max(a,b)
+ #define AMaxL1(a,b) max(a,b)
+ #define AMaxU1(a,b) max(a,b)
+//------------------------------------------------------------------------------------------------------------------------------
+ #define AMinD1(a,b) min(a,b)
+ #define AMinF1(a,b) min(a,b)
+ #define AMinL1(a,b) min(a,b)
+ #define AMinU1(a,b) min(a,b)
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ASinD1(a) sin(AD1(a))
+ #define ASinF1(a) sin(AF1(a))
+//------------------------------------------------------------------------------------------------------------------------------
+ #define ASqrtD1(a) sqrt(AD1(a))
+ #define ASqrtF1(a) sqrt(AF1(a))
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// SCALAR RETURN OPS - DEPENDENT
+//==============================================================================================================================
+ #define APowD1(a,b) pow(AD1(a),AF1(b))
+ #define APowF1(a,b) pow(AF1(a),AF1(b))
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// VECTOR OPS
+//------------------------------------------------------------------------------------------------------------------------------
+// These are added as needed for production or prototyping, so not necessarily a complete set.
+// They follow a convention of taking in a destination and also returning the destination value to increase utility.
+//==============================================================================================================================
+ #ifdef A_DUBL
+ AD2 opAAbsD2(outAD2 d,inAD2 a){d=abs(a);return d;}
+ AD3 opAAbsD3(outAD3 d,inAD3 a){d=abs(a);return d;}
+ AD4 opAAbsD4(outAD4 d,inAD4 a){d=abs(a);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD2 opAAddD2(outAD2 d,inAD2 a,inAD2 b){d=a+b;return d;}
+ AD3 opAAddD3(outAD3 d,inAD3 a,inAD3 b){d=a+b;return d;}
+ AD4 opAAddD4(outAD4 d,inAD4 a,inAD4 b){d=a+b;return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD2 opAAddOneD2(outAD2 d,inAD2 a,AD1 b){d=a+AD2_(b);return d;}
+ AD3 opAAddOneD3(outAD3 d,inAD3 a,AD1 b){d=a+AD3_(b);return d;}
+ AD4 opAAddOneD4(outAD4 d,inAD4 a,AD1 b){d=a+AD4_(b);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD2 opACpyD2(outAD2 d,inAD2 a){d=a;return d;}
+ AD3 opACpyD3(outAD3 d,inAD3 a){d=a;return d;}
+ AD4 opACpyD4(outAD4 d,inAD4 a){d=a;return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD2 opALerpD2(outAD2 d,inAD2 a,inAD2 b,inAD2 c){d=ALerpD2(a,b,c);return d;}
+ AD3 opALerpD3(outAD3 d,inAD3 a,inAD3 b,inAD3 c){d=ALerpD3(a,b,c);return d;}
+ AD4 opALerpD4(outAD4 d,inAD4 a,inAD4 b,inAD4 c){d=ALerpD4(a,b,c);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD2 opALerpOneD2(outAD2 d,inAD2 a,inAD2 b,AD1 c){d=ALerpD2(a,b,AD2_(c));return d;}
+ AD3 opALerpOneD3(outAD3 d,inAD3 a,inAD3 b,AD1 c){d=ALerpD3(a,b,AD3_(c));return d;}
+ AD4 opALerpOneD4(outAD4 d,inAD4 a,inAD4 b,AD1 c){d=ALerpD4(a,b,AD4_(c));return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD2 opAMaxD2(outAD2 d,inAD2 a,inAD2 b){d=max(a,b);return d;}
+ AD3 opAMaxD3(outAD3 d,inAD3 a,inAD3 b){d=max(a,b);return d;}
+ AD4 opAMaxD4(outAD4 d,inAD4 a,inAD4 b){d=max(a,b);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD2 opAMinD2(outAD2 d,inAD2 a,inAD2 b){d=min(a,b);return d;}
+ AD3 opAMinD3(outAD3 d,inAD3 a,inAD3 b){d=min(a,b);return d;}
+ AD4 opAMinD4(outAD4 d,inAD4 a,inAD4 b){d=min(a,b);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD2 opAMulD2(outAD2 d,inAD2 a,inAD2 b){d=a*b;return d;}
+ AD3 opAMulD3(outAD3 d,inAD3 a,inAD3 b){d=a*b;return d;}
+ AD4 opAMulD4(outAD4 d,inAD4 a,inAD4 b){d=a*b;return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD2 opAMulOneD2(outAD2 d,inAD2 a,AD1 b){d=a*AD2_(b);return d;}
+ AD3 opAMulOneD3(outAD3 d,inAD3 a,AD1 b){d=a*AD3_(b);return d;}
+ AD4 opAMulOneD4(outAD4 d,inAD4 a,AD1 b){d=a*AD4_(b);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD2 opANegD2(outAD2 d,inAD2 a){d=-a;return d;}
+ AD3 opANegD3(outAD3 d,inAD3 a){d=-a;return d;}
+ AD4 opANegD4(outAD4 d,inAD4 a){d=-a;return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AD2 opARcpD2(outAD2 d,inAD2 a){d=ARcpD2(a);return d;}
+ AD3 opARcpD3(outAD3 d,inAD3 a){d=ARcpD3(a);return d;}
+ AD4 opARcpD4(outAD4 d,inAD4 a){d=ARcpD4(a);return d;}
+ #endif
+//==============================================================================================================================
+ AF2 opAAbsF2(outAF2 d,inAF2 a){d=abs(a);return d;}
+ AF3 opAAbsF3(outAF3 d,inAF3 a){d=abs(a);return d;}
+ AF4 opAAbsF4(outAF4 d,inAF4 a){d=abs(a);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 opAAddF2(outAF2 d,inAF2 a,inAF2 b){d=a+b;return d;}
+ AF3 opAAddF3(outAF3 d,inAF3 a,inAF3 b){d=a+b;return d;}
+ AF4 opAAddF4(outAF4 d,inAF4 a,inAF4 b){d=a+b;return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 opAAddOneF2(outAF2 d,inAF2 a,AF1 b){d=a+AF2_(b);return d;}
+ AF3 opAAddOneF3(outAF3 d,inAF3 a,AF1 b){d=a+AF3_(b);return d;}
+ AF4 opAAddOneF4(outAF4 d,inAF4 a,AF1 b){d=a+AF4_(b);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 opACpyF2(outAF2 d,inAF2 a){d=a;return d;}
+ AF3 opACpyF3(outAF3 d,inAF3 a){d=a;return d;}
+ AF4 opACpyF4(outAF4 d,inAF4 a){d=a;return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 opALerpF2(outAF2 d,inAF2 a,inAF2 b,inAF2 c){d=ALerpF2(a,b,c);return d;}
+ AF3 opALerpF3(outAF3 d,inAF3 a,inAF3 b,inAF3 c){d=ALerpF3(a,b,c);return d;}
+ AF4 opALerpF4(outAF4 d,inAF4 a,inAF4 b,inAF4 c){d=ALerpF4(a,b,c);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 opALerpOneF2(outAF2 d,inAF2 a,inAF2 b,AF1 c){d=ALerpF2(a,b,AF2_(c));return d;}
+ AF3 opALerpOneF3(outAF3 d,inAF3 a,inAF3 b,AF1 c){d=ALerpF3(a,b,AF3_(c));return d;}
+ AF4 opALerpOneF4(outAF4 d,inAF4 a,inAF4 b,AF1 c){d=ALerpF4(a,b,AF4_(c));return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 opAMaxF2(outAF2 d,inAF2 a,inAF2 b){d=max(a,b);return d;}
+ AF3 opAMaxF3(outAF3 d,inAF3 a,inAF3 b){d=max(a,b);return d;}
+ AF4 opAMaxF4(outAF4 d,inAF4 a,inAF4 b){d=max(a,b);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 opAMinF2(outAF2 d,inAF2 a,inAF2 b){d=min(a,b);return d;}
+ AF3 opAMinF3(outAF3 d,inAF3 a,inAF3 b){d=min(a,b);return d;}
+ AF4 opAMinF4(outAF4 d,inAF4 a,inAF4 b){d=min(a,b);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 opAMulF2(outAF2 d,inAF2 a,inAF2 b){d=a*b;return d;}
+ AF3 opAMulF3(outAF3 d,inAF3 a,inAF3 b){d=a*b;return d;}
+ AF4 opAMulF4(outAF4 d,inAF4 a,inAF4 b){d=a*b;return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 opAMulOneF2(outAF2 d,inAF2 a,AF1 b){d=a*AF2_(b);return d;}
+ AF3 opAMulOneF3(outAF3 d,inAF3 a,AF1 b){d=a*AF3_(b);return d;}
+ AF4 opAMulOneF4(outAF4 d,inAF4 a,AF1 b){d=a*AF4_(b);return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 opANegF2(outAF2 d,inAF2 a){d=-a;return d;}
+ AF3 opANegF3(outAF3 d,inAF3 a){d=-a;return d;}
+ AF4 opANegF4(outAF4 d,inAF4 a){d=-a;return d;}
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 opARcpF2(outAF2 d,inAF2 a){d=ARcpF2(a);return d;}
+ AF3 opARcpF3(outAF3 d,inAF3 a){d=ARcpF3(a);return d;}
+ AF4 opARcpF4(outAF4 d,inAF4 a){d=ARcpF4(a);return d;}
+#endif
diff --git a/3rdparty/bgfx/examples/46-fsr/ffx_fsr1.h b/3rdparty/bgfx/examples/46-fsr/ffx_fsr1.h
new file mode 100644
index 00000000000..bd872845481
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/ffx_fsr1.h
@@ -0,0 +1,1199 @@
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+//
+//
+// AMD FidelityFX SUPER RESOLUTION [FSR 1] ::: SPATIAL SCALING & EXTRAS - v1.20210629
+//
+//
+//------------------------------------------------------------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//------------------------------------------------------------------------------------------------------------------------------
+// FidelityFX Super Resolution Sample
+//
+// Copyright (c) 2021 Advanced Micro Devices, Inc. All rights reserved.
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files(the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell
+// copies of the Software, and to permit persons to whom the Software is
+// 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 Software.
+// THE SOFTWARE IS 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 SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+//------------------------------------------------------------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//------------------------------------------------------------------------------------------------------------------------------
+// ABOUT
+// =====
+// FSR is a collection of algorithms relating to generating a higher resolution image.
+// This specific header focuses on single-image non-temporal image scaling, and related tools.
+//
+// The core functions are EASU and RCAS:
+// [EASU] Edge Adaptive Spatial Upsampling ....... 1x to 4x area range spatial scaling, clamped adaptive elliptical filter.
+// [RCAS] Robust Contrast Adaptive Sharpening .... A non-scaling variation on CAS.
+// RCAS needs to be applied after EASU as a separate pass.
+//
+// Optional utility functions are:
+// [LFGA] Linear Film Grain Applicator ........... Tool to apply film grain after scaling.
+// [SRTM] Simple Reversible Tone-Mapper .......... Linear HDR {0 to FP16_MAX} to {0 to 1} and back.
+// [TEPD] Temporal Energy Preserving Dither ...... Temporally energy preserving dithered {0 to 1} linear to gamma 2.0 conversion.
+// See each individual sub-section for inline documentation.
+//------------------------------------------------------------------------------------------------------------------------------
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//------------------------------------------------------------------------------------------------------------------------------
+// FUNCTION PERMUTATIONS
+// =====================
+// *F() ..... Single item computation with 32-bit.
+// *H() ..... Single item computation with 16-bit, with packing (aka two 16-bit ops in parallel) when possible.
+// *Hx2() ... Processing two items in parallel with 16-bit, easier packing.
+// Not all interfaces in this file have a *Hx2() form.
+//==============================================================================================================================
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+//
+// FSR - [EASU] EDGE ADAPTIVE SPATIAL UPSAMPLING
+//
+//------------------------------------------------------------------------------------------------------------------------------
+// EASU provides a high quality spatial-only scaling at relatively low cost.
+// Meaning EASU is appropriate for laptops and other low-end GPUs.
+// Quality from 1x to 4x area scaling is good.
+//------------------------------------------------------------------------------------------------------------------------------
+// The scalar uses a modified fast approximation to the standard lanczos(size=2) kernel.
+// EASU runs in a single pass, so it applies a directionally and anisotropically adaptive radial lanczos.
+// This is also kept as simple as possible to have minimum runtime.
+//------------------------------------------------------------------------------------------------------------------------------
+// The lanzcos filter has negative lobes, so by itself it will introduce ringing.
+// To remove all ringing, the algorithm uses the nearest 2x2 input texels as a neighborhood,
+// and limits output to the minimum and maximum of that neighborhood.
+//------------------------------------------------------------------------------------------------------------------------------
+// Input image requirements:
+//
+// Color needs to be encoded as 3 channel[red, green, blue](e.g.XYZ not supported)
+// Each channel needs to be in the range[0, 1]
+// Any color primaries are supported
+// Display / tonemapping curve needs to be as if presenting to sRGB display or similar(e.g.Gamma 2.0)
+// There should be no banding in the input
+// There should be no high amplitude noise in the input
+// There should be no noise in the input that is not at input pixel granularity
+// For performance purposes, use 32bpp formats
+//------------------------------------------------------------------------------------------------------------------------------
+// Best to apply EASU at the end of the frame after tonemapping
+// but before film grain or composite of the UI.
+//------------------------------------------------------------------------------------------------------------------------------
+// Example of including this header for D3D HLSL :
+//
+// #define A_GPU 1
+// #define A_HLSL 1
+// #define A_HALF 1
+// #include "ffx_a.h"
+// #define FSR_EASU_H 1
+// #define FSR_RCAS_H 1
+// //declare input callbacks
+// #include "ffx_fsr1.h"
+//
+// Example of including this header for Vulkan GLSL :
+//
+// #define A_GPU 1
+// #define A_GLSL 1
+// #define A_HALF 1
+// #include "ffx_a.h"
+// #define FSR_EASU_H 1
+// #define FSR_RCAS_H 1
+// //declare input callbacks
+// #include "ffx_fsr1.h"
+//
+// Example of including this header for Vulkan HLSL :
+//
+// #define A_GPU 1
+// #define A_HLSL 1
+// #define A_HLSL_6_2 1
+// #define A_NO_16_BIT_CAST 1
+// #define A_HALF 1
+// #include "ffx_a.h"
+// #define FSR_EASU_H 1
+// #define FSR_RCAS_H 1
+// //declare input callbacks
+// #include "ffx_fsr1.h"
+//
+// Example of declaring the required input callbacks for GLSL :
+// The callbacks need to gather4 for each color channel using the specified texture coordinate 'p'.
+// EASU uses gather4 to reduce position computation logic and for free Arrays of Structures to Structures of Arrays conversion.
+//
+// AH4 FsrEasuRH(AF2 p){return AH4(textureGather(sampler2D(tex,sam),p,0));}
+// AH4 FsrEasuGH(AF2 p){return AH4(textureGather(sampler2D(tex,sam),p,1));}
+// AH4 FsrEasuBH(AF2 p){return AH4(textureGather(sampler2D(tex,sam),p,2));}
+// ...
+// The FsrEasuCon function needs to be called from the CPU or GPU to set up constants.
+// The difference in viewport and input image size is there to support Dynamic Resolution Scaling.
+// To use FsrEasuCon() on the CPU, define A_CPU before including ffx_a and ffx_fsr1.
+// Including a GPU example here, the 'con0' through 'con3' values would be stored out to a constant buffer.
+// AU4 con0,con1,con2,con3;
+// FsrEasuCon(con0,con1,con2,con3,
+// 1920.0,1080.0, // Viewport size (top left aligned) in the input image which is to be scaled.
+// 3840.0,2160.0, // The size of the input image.
+// 2560.0,1440.0); // The output resolution.
+//==============================================================================================================================
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// CONSTANT SETUP
+//==============================================================================================================================
+// Call to setup required constant values (works on CPU or GPU).
+A_STATIC void FsrEasuCon(
+outAU4 con0,
+outAU4 con1,
+outAU4 con2,
+outAU4 con3,
+// This the rendered image resolution being upscaled
+AF1 inputViewportInPixelsX,
+AF1 inputViewportInPixelsY,
+// This is the resolution of the resource containing the input image (useful for dynamic resolution)
+AF1 inputSizeInPixelsX,
+AF1 inputSizeInPixelsY,
+// This is the display resolution which the input image gets upscaled to
+AF1 outputSizeInPixelsX,
+AF1 outputSizeInPixelsY){
+ // Output integer position to a pixel position in viewport.
+ con0[0]=AU1_AF1(inputViewportInPixelsX*ARcpF1(outputSizeInPixelsX));
+ con0[1]=AU1_AF1(inputViewportInPixelsY*ARcpF1(outputSizeInPixelsY));
+ con0[2]=AU1_AF1(AF1_(0.5)*inputViewportInPixelsX*ARcpF1(outputSizeInPixelsX)-AF1_(0.5));
+ con0[3]=AU1_AF1(AF1_(0.5)*inputViewportInPixelsY*ARcpF1(outputSizeInPixelsY)-AF1_(0.5));
+ // Viewport pixel position to normalized image space.
+ // This is used to get upper-left of 'F' tap.
+ con1[0]=AU1_AF1(ARcpF1(inputSizeInPixelsX));
+ con1[1]=AU1_AF1(ARcpF1(inputSizeInPixelsY));
+ // Centers of gather4, first offset from upper-left of 'F'.
+ // +---+---+
+ // | | |
+ // +--(0)--+
+ // | b | c |
+ // +---F---+---+---+
+ // | e | f | g | h |
+ // +--(1)--+--(2)--+
+ // | i | j | k | l |
+ // +---+---+---+---+
+ // | n | o |
+ // +--(3)--+
+ // | | |
+ // +---+---+
+ con1[2]=AU1_AF1(AF1_( 1.0)*ARcpF1(inputSizeInPixelsX));
+ con1[3]=AU1_AF1(AF1_(-1.0)*ARcpF1(inputSizeInPixelsY));
+ // These are from (0) instead of 'F'.
+ con2[0]=AU1_AF1(AF1_(-1.0)*ARcpF1(inputSizeInPixelsX));
+ con2[1]=AU1_AF1(AF1_( 2.0)*ARcpF1(inputSizeInPixelsY));
+ con2[2]=AU1_AF1(AF1_( 1.0)*ARcpF1(inputSizeInPixelsX));
+ con2[3]=AU1_AF1(AF1_( 2.0)*ARcpF1(inputSizeInPixelsY));
+ con3[0]=AU1_AF1(AF1_( 0.0)*ARcpF1(inputSizeInPixelsX));
+ con3[1]=AU1_AF1(AF1_( 4.0)*ARcpF1(inputSizeInPixelsY));
+ con3[2]=con3[3]=0;}
+
+//If the an offset into the input image resource
+A_STATIC void FsrEasuConOffset(
+ outAU4 con0,
+ outAU4 con1,
+ outAU4 con2,
+ outAU4 con3,
+ // This the rendered image resolution being upscaled
+ AF1 inputViewportInPixelsX,
+ AF1 inputViewportInPixelsY,
+ // This is the resolution of the resource containing the input image (useful for dynamic resolution)
+ AF1 inputSizeInPixelsX,
+ AF1 inputSizeInPixelsY,
+ // This is the display resolution which the input image gets upscaled to
+ AF1 outputSizeInPixelsX,
+ AF1 outputSizeInPixelsY,
+ // This is the input image offset into the resource containing it (useful for dynamic resolution)
+ AF1 inputOffsetInPixelsX,
+ AF1 inputOffsetInPixelsY) {
+ FsrEasuCon(con0, con1, con2, con3, inputViewportInPixelsX, inputViewportInPixelsY, inputSizeInPixelsX, inputSizeInPixelsY, outputSizeInPixelsX, outputSizeInPixelsY);
+ con0[2] = AU1_AF1(AF1_(0.5) * inputViewportInPixelsX * ARcpF1(outputSizeInPixelsX) - AF1_(0.5) + inputOffsetInPixelsX);
+ con0[3] = AU1_AF1(AF1_(0.5) * inputViewportInPixelsY * ARcpF1(outputSizeInPixelsY) - AF1_(0.5) + inputOffsetInPixelsY);
+}
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// NON-PACKED 32-BIT VERSION
+//==============================================================================================================================
+#if defined(A_GPU)&&defined(FSR_EASU_F)
+ // Input callback prototypes, need to be implemented by calling shader
+ AF4 FsrEasuRF(AF2 p);
+ AF4 FsrEasuGF(AF2 p);
+ AF4 FsrEasuBF(AF2 p);
+//------------------------------------------------------------------------------------------------------------------------------
+ // Filtering for a given tap for the scalar.
+ void FsrEasuTapF(
+ inout AF3 aC, // Accumulated color, with negative lobe.
+ inout AF1 aW, // Accumulated weight.
+ AF2 off, // Pixel offset from resolve position to tap.
+ AF2 dir, // Gradient direction.
+ AF2 len, // Length.
+ AF1 lob, // Negative lobe strength.
+ AF1 clp, // Clipping point.
+ AF3 c){ // Tap color.
+ // Rotate offset by direction.
+ AF2 v;
+ v.x=(off.x*( dir.x))+(off.y*dir.y);
+ v.y=(off.x*(-dir.y))+(off.y*dir.x);
+ // Anisotropy.
+ v*=len;
+ // Compute distance^2.
+ AF1 d2=v.x*v.x+v.y*v.y;
+ // Limit to the window as at corner, 2 taps can easily be outside.
+ d2=min(d2,clp);
+ // Approximation of lancos2 without sin() or rcp(), or sqrt() to get x.
+ // (25/16 * (2/5 * x^2 - 1)^2 - (25/16 - 1)) * (1/4 * x^2 - 1)^2
+ // |_______________________________________| |_______________|
+ // base window
+ // The general form of the 'base' is,
+ // (a*(b*x^2-1)^2-(a-1))
+ // Where 'a=1/(2*b-b^2)' and 'b' moves around the negative lobe.
+ AF1 wB=AF1_(2.0/5.0)*d2+AF1_(-1.0);
+ AF1 wA=lob*d2+AF1_(-1.0);
+ wB*=wB;
+ wA*=wA;
+ wB=AF1_(25.0/16.0)*wB+AF1_(-(25.0/16.0-1.0));
+ AF1 w=wB*wA;
+ // Do weighted average.
+ aC+=c*w;aW+=w;}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Accumulate direction and length.
+ void FsrEasuSetF(
+ inout AF2 dir,
+ inout AF1 len,
+ AF2 pp,
+ AP1 biS,AP1 biT,AP1 biU,AP1 biV,
+ AF1 lA,AF1 lB,AF1 lC,AF1 lD,AF1 lE){
+ // Compute bilinear weight, branches factor out as predicates are compiler time immediates.
+ // s t
+ // u v
+ AF1 w = AF1_(0.0);
+ if(biS)w=(AF1_(1.0)-pp.x)*(AF1_(1.0)-pp.y);
+ if(biT)w= pp.x *(AF1_(1.0)-pp.y);
+ if(biU)w=(AF1_(1.0)-pp.x)* pp.y ;
+ if(biV)w= pp.x * pp.y ;
+ // Direction is the '+' diff.
+ // a
+ // b c d
+ // e
+ // Then takes magnitude from abs average of both sides of 'c'.
+ // Length converts gradient reversal to 0, smoothly to non-reversal at 1, shaped, then adding horz and vert terms.
+ AF1 dc=lD-lC;
+ AF1 cb=lC-lB;
+ AF1 lenX=max(abs(dc),abs(cb));
+ lenX=APrxLoRcpF1(lenX);
+ AF1 dirX=lD-lB;
+ dir.x+=dirX*w;
+ lenX=ASatF1(abs(dirX)*lenX);
+ lenX*=lenX;
+ len+=lenX*w;
+ // Repeat for the y axis.
+ AF1 ec=lE-lC;
+ AF1 ca=lC-lA;
+ AF1 lenY=max(abs(ec),abs(ca));
+ lenY=APrxLoRcpF1(lenY);
+ AF1 dirY=lE-lA;
+ dir.y+=dirY*w;
+ lenY=ASatF1(abs(dirY)*lenY);
+ lenY*=lenY;
+ len+=lenY*w;}
+//------------------------------------------------------------------------------------------------------------------------------
+ void FsrEasuF(
+ out AF3 pix,
+ AU2 ip, // Integer pixel position in output.
+ AU4 con0, // Constants generated by FsrEasuCon().
+ AU4 con1,
+ AU4 con2,
+ AU4 con3){
+//------------------------------------------------------------------------------------------------------------------------------
+ // Get position of 'f'.
+ AF2 pp=AF2(ip)*AF2_AU2(con0.xy)+AF2_AU2(con0.zw);
+ AF2 fp=floor(pp);
+ pp-=fp;
+//------------------------------------------------------------------------------------------------------------------------------
+ // 12-tap kernel.
+ // b c
+ // e f g h
+ // i j k l
+ // n o
+ // Gather 4 ordering.
+ // a b
+ // r g
+ // For packed FP16, need either {rg} or {ab} so using the following setup for gather in all versions,
+ // a b <- unused (z)
+ // r g
+ // a b a b
+ // r g r g
+ // a b
+ // r g <- unused (z)
+ // Allowing dead-code removal to remove the 'z's.
+ AF2 p0=fp*AF2_AU2(con1.xy)+AF2_AU2(con1.zw);
+ // These are from p0 to avoid pulling two constants on pre-Navi hardware.
+ AF2 p1=p0+AF2_AU2(con2.xy);
+ AF2 p2=p0+AF2_AU2(con2.zw);
+ AF2 p3=p0+AF2_AU2(con3.xy);
+ AF4 bczzR=FsrEasuRF(p0);
+ AF4 bczzG=FsrEasuGF(p0);
+ AF4 bczzB=FsrEasuBF(p0);
+ AF4 ijfeR=FsrEasuRF(p1);
+ AF4 ijfeG=FsrEasuGF(p1);
+ AF4 ijfeB=FsrEasuBF(p1);
+ AF4 klhgR=FsrEasuRF(p2);
+ AF4 klhgG=FsrEasuGF(p2);
+ AF4 klhgB=FsrEasuBF(p2);
+ AF4 zzonR=FsrEasuRF(p3);
+ AF4 zzonG=FsrEasuGF(p3);
+ AF4 zzonB=FsrEasuBF(p3);
+//------------------------------------------------------------------------------------------------------------------------------
+ // Simplest multi-channel approximate luma possible (luma times 2, in 2 FMA/MAD).
+ AF4 bczzL=bczzB*AF4_(0.5)+(bczzR*AF4_(0.5)+bczzG);
+ AF4 ijfeL=ijfeB*AF4_(0.5)+(ijfeR*AF4_(0.5)+ijfeG);
+ AF4 klhgL=klhgB*AF4_(0.5)+(klhgR*AF4_(0.5)+klhgG);
+ AF4 zzonL=zzonB*AF4_(0.5)+(zzonR*AF4_(0.5)+zzonG);
+ // Rename.
+ AF1 bL=bczzL.x;
+ AF1 cL=bczzL.y;
+ AF1 iL=ijfeL.x;
+ AF1 jL=ijfeL.y;
+ AF1 fL=ijfeL.z;
+ AF1 eL=ijfeL.w;
+ AF1 kL=klhgL.x;
+ AF1 lL=klhgL.y;
+ AF1 hL=klhgL.z;
+ AF1 gL=klhgL.w;
+ AF1 oL=zzonL.z;
+ AF1 nL=zzonL.w;
+ // Accumulate for bilinear interpolation.
+ AF2 dir=AF2_(0.0);
+ AF1 len=AF1_(0.0);
+ FsrEasuSetF(dir,len,pp,true, false,false,false,bL,eL,fL,gL,jL);
+ FsrEasuSetF(dir,len,pp,false,true ,false,false,cL,fL,gL,hL,kL);
+ FsrEasuSetF(dir,len,pp,false,false,true ,false,fL,iL,jL,kL,nL);
+ FsrEasuSetF(dir,len,pp,false,false,false,true ,gL,jL,kL,lL,oL);
+//------------------------------------------------------------------------------------------------------------------------------
+ // Normalize with approximation, and cleanup close to zero.
+ AF2 dir2=dir*dir;
+ AF1 dirR=dir2.x+dir2.y;
+ AP1 zro=dirR<AF1_(1.0/32768.0);
+ dirR=APrxLoRsqF1(dirR);
+ dirR=zro?AF1_(1.0):dirR;
+ dir.x=zro?AF1_(1.0):dir.x;
+ dir*=AF2_(dirR);
+ // Transform from {0 to 2} to {0 to 1} range, and shape with square.
+ len=len*AF1_(0.5);
+ len*=len;
+ // Stretch kernel {1.0 vert|horz, to sqrt(2.0) on diagonal}.
+ AF1 stretch=(dir.x*dir.x+dir.y*dir.y)*APrxLoRcpF1(max(abs(dir.x),abs(dir.y)));
+ // Anisotropic length after rotation,
+ // x := 1.0 lerp to 'stretch' on edges
+ // y := 1.0 lerp to 2x on edges
+ AF2 len2=AF2(AF1_(1.0)+(stretch-AF1_(1.0))*len,AF1_(1.0)+AF1_(-0.5)*len);
+ // Based on the amount of 'edge',
+ // the window shifts from +/-{sqrt(2.0) to slightly beyond 2.0}.
+ AF1 lob=AF1_(0.5)+AF1_((1.0/4.0-0.04)-0.5)*len;
+ // Set distance^2 clipping point to the end of the adjustable window.
+ AF1 clp=APrxLoRcpF1(lob);
+//------------------------------------------------------------------------------------------------------------------------------
+ // Accumulation mixed with min/max of 4 nearest.
+ // b c
+ // e f g h
+ // i j k l
+ // n o
+ AF3 min4=min(AMin3F3(AF3(ijfeR.z,ijfeG.z,ijfeB.z),AF3(klhgR.w,klhgG.w,klhgB.w),AF3(ijfeR.y,ijfeG.y,ijfeB.y)),
+ AF3(klhgR.x,klhgG.x,klhgB.x));
+ AF3 max4=max(AMax3F3(AF3(ijfeR.z,ijfeG.z,ijfeB.z),AF3(klhgR.w,klhgG.w,klhgB.w),AF3(ijfeR.y,ijfeG.y,ijfeB.y)),
+ AF3(klhgR.x,klhgG.x,klhgB.x));
+ // Accumulation.
+ AF3 aC=AF3_(0.0);
+ AF1 aW=AF1_(0.0);
+ FsrEasuTapF(aC,aW,AF2( 0.0,-1.0)-pp,dir,len2,lob,clp,AF3(bczzR.x,bczzG.x,bczzB.x)); // b
+ FsrEasuTapF(aC,aW,AF2( 1.0,-1.0)-pp,dir,len2,lob,clp,AF3(bczzR.y,bczzG.y,bczzB.y)); // c
+ FsrEasuTapF(aC,aW,AF2(-1.0, 1.0)-pp,dir,len2,lob,clp,AF3(ijfeR.x,ijfeG.x,ijfeB.x)); // i
+ FsrEasuTapF(aC,aW,AF2( 0.0, 1.0)-pp,dir,len2,lob,clp,AF3(ijfeR.y,ijfeG.y,ijfeB.y)); // j
+ FsrEasuTapF(aC,aW,AF2( 0.0, 0.0)-pp,dir,len2,lob,clp,AF3(ijfeR.z,ijfeG.z,ijfeB.z)); // f
+ FsrEasuTapF(aC,aW,AF2(-1.0, 0.0)-pp,dir,len2,lob,clp,AF3(ijfeR.w,ijfeG.w,ijfeB.w)); // e
+ FsrEasuTapF(aC,aW,AF2( 1.0, 1.0)-pp,dir,len2,lob,clp,AF3(klhgR.x,klhgG.x,klhgB.x)); // k
+ FsrEasuTapF(aC,aW,AF2( 2.0, 1.0)-pp,dir,len2,lob,clp,AF3(klhgR.y,klhgG.y,klhgB.y)); // l
+ FsrEasuTapF(aC,aW,AF2( 2.0, 0.0)-pp,dir,len2,lob,clp,AF3(klhgR.z,klhgG.z,klhgB.z)); // h
+ FsrEasuTapF(aC,aW,AF2( 1.0, 0.0)-pp,dir,len2,lob,clp,AF3(klhgR.w,klhgG.w,klhgB.w)); // g
+ FsrEasuTapF(aC,aW,AF2( 1.0, 2.0)-pp,dir,len2,lob,clp,AF3(zzonR.z,zzonG.z,zzonB.z)); // o
+ FsrEasuTapF(aC,aW,AF2( 0.0, 2.0)-pp,dir,len2,lob,clp,AF3(zzonR.w,zzonG.w,zzonB.w)); // n
+//------------------------------------------------------------------------------------------------------------------------------
+ // Normalize and dering.
+ pix=min(max4,max(min4,aC*AF3_(ARcpF1(aW))));}
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// PACKED 16-BIT VERSION
+//==============================================================================================================================
+#if defined(A_GPU)&&defined(A_HALF)&&defined(FSR_EASU_H)
+// Input callback prototypes, need to be implemented by calling shader
+ AH4 FsrEasuRH(AF2 p);
+ AH4 FsrEasuGH(AF2 p);
+ AH4 FsrEasuBH(AF2 p);
+//------------------------------------------------------------------------------------------------------------------------------
+ // This runs 2 taps in parallel.
+ void FsrEasuTapH(
+ inout AH2 aCR,inout AH2 aCG,inout AH2 aCB,
+ inout AH2 aW,
+ AH2 offX,AH2 offY,
+ AH2 dir,
+ AH2 len,
+ AH1 lob,
+ AH1 clp,
+ AH2 cR,AH2 cG,AH2 cB){
+ AH2 vX,vY;
+ vX=offX* dir.xx +offY*dir.yy;
+ vY=offX*(-dir.yy)+offY*dir.xx;
+ vX*=len.x;vY*=len.y;
+ AH2 d2=vX*vX+vY*vY;
+ d2=min(d2,AH2_(clp));
+ AH2 wB=AH2_(2.0/5.0)*d2+AH2_(-1.0);
+ AH2 wA=AH2_(lob)*d2+AH2_(-1.0);
+ wB*=wB;
+ wA*=wA;
+ wB=AH2_(25.0/16.0)*wB+AH2_(-(25.0/16.0-1.0));
+ AH2 w=wB*wA;
+ aCR+=cR*w;aCG+=cG*w;aCB+=cB*w;aW+=w;}
+//------------------------------------------------------------------------------------------------------------------------------
+ // This runs 2 taps in parallel.
+ void FsrEasuSetH(
+ inout AH2 dirPX,inout AH2 dirPY,
+ inout AH2 lenP,
+ AH2 pp,
+ AP1 biST,AP1 biUV,
+ AH2 lA,AH2 lB,AH2 lC,AH2 lD,AH2 lE){
+ AH2 w = AH2_(0.0);
+ if(biST)w=(AH2(1.0,0.0)+AH2(-pp.x,pp.x))*AH2_(AH1_(1.0)-pp.y);
+ if(biUV)w=(AH2(1.0,0.0)+AH2(-pp.x,pp.x))*AH2_( pp.y);
+ // ABS is not free in the packed FP16 path.
+ AH2 dc=lD-lC;
+ AH2 cb=lC-lB;
+ AH2 lenX=max(abs(dc),abs(cb));
+ lenX=ARcpH2(lenX);
+ AH2 dirX=lD-lB;
+ dirPX+=dirX*w;
+ lenX=ASatH2(abs(dirX)*lenX);
+ lenX*=lenX;
+ lenP+=lenX*w;
+ AH2 ec=lE-lC;
+ AH2 ca=lC-lA;
+ AH2 lenY=max(abs(ec),abs(ca));
+ lenY=ARcpH2(lenY);
+ AH2 dirY=lE-lA;
+ dirPY+=dirY*w;
+ lenY=ASatH2(abs(dirY)*lenY);
+ lenY*=lenY;
+ lenP+=lenY*w;}
+//------------------------------------------------------------------------------------------------------------------------------
+ void FsrEasuH(
+ out AH3 pix,
+ AU2 ip,
+ AU4 con0,
+ AU4 con1,
+ AU4 con2,
+ AU4 con3){
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 pp=AF2(ip)*AF2_AU2(con0.xy)+AF2_AU2(con0.zw);
+ AF2 fp=floor(pp);
+ pp-=fp;
+ AH2 ppp=AH2(pp);
+//------------------------------------------------------------------------------------------------------------------------------
+ AF2 p0=fp*AF2_AU2(con1.xy)+AF2_AU2(con1.zw);
+ AF2 p1=p0+AF2_AU2(con2.xy);
+ AF2 p2=p0+AF2_AU2(con2.zw);
+ AF2 p3=p0+AF2_AU2(con3.xy);
+ AH4 bczzR=FsrEasuRH(p0);
+ AH4 bczzG=FsrEasuGH(p0);
+ AH4 bczzB=FsrEasuBH(p0);
+ AH4 ijfeR=FsrEasuRH(p1);
+ AH4 ijfeG=FsrEasuGH(p1);
+ AH4 ijfeB=FsrEasuBH(p1);
+ AH4 klhgR=FsrEasuRH(p2);
+ AH4 klhgG=FsrEasuGH(p2);
+ AH4 klhgB=FsrEasuBH(p2);
+ AH4 zzonR=FsrEasuRH(p3);
+ AH4 zzonG=FsrEasuGH(p3);
+ AH4 zzonB=FsrEasuBH(p3);
+//------------------------------------------------------------------------------------------------------------------------------
+ AH4 bczzL=bczzB*AH4_(0.5)+(bczzR*AH4_(0.5)+bczzG);
+ AH4 ijfeL=ijfeB*AH4_(0.5)+(ijfeR*AH4_(0.5)+ijfeG);
+ AH4 klhgL=klhgB*AH4_(0.5)+(klhgR*AH4_(0.5)+klhgG);
+ AH4 zzonL=zzonB*AH4_(0.5)+(zzonR*AH4_(0.5)+zzonG);
+ AH1 bL=bczzL.x;
+ AH1 cL=bczzL.y;
+ AH1 iL=ijfeL.x;
+ AH1 jL=ijfeL.y;
+ AH1 fL=ijfeL.z;
+ AH1 eL=ijfeL.w;
+ AH1 kL=klhgL.x;
+ AH1 lL=klhgL.y;
+ AH1 hL=klhgL.z;
+ AH1 gL=klhgL.w;
+ AH1 oL=zzonL.z;
+ AH1 nL=zzonL.w;
+ // This part is different, accumulating 2 taps in parallel.
+ AH2 dirPX=AH2_(0.0);
+ AH2 dirPY=AH2_(0.0);
+ AH2 lenP=AH2_(0.0);
+ FsrEasuSetH(dirPX,dirPY,lenP,ppp,true, false,AH2(bL,cL),AH2(eL,fL),AH2(fL,gL),AH2(gL,hL),AH2(jL,kL));
+ FsrEasuSetH(dirPX,dirPY,lenP,ppp,false,true ,AH2(fL,gL),AH2(iL,jL),AH2(jL,kL),AH2(kL,lL),AH2(nL,oL));
+ AH2 dir=AH2(dirPX.r+dirPX.g,dirPY.r+dirPY.g);
+ AH1 len=lenP.r+lenP.g;
+//------------------------------------------------------------------------------------------------------------------------------
+ AH2 dir2=dir*dir;
+ AH1 dirR=dir2.x+dir2.y;
+ AP1 zro=dirR<AH1_(1.0/32768.0);
+ dirR=APrxLoRsqH1(dirR);
+ dirR=zro?AH1_(1.0):dirR;
+ dir.x=zro?AH1_(1.0):dir.x;
+ dir*=AH2_(dirR);
+ len=len*AH1_(0.5);
+ len*=len;
+ AH1 stretch=(dir.x*dir.x+dir.y*dir.y)*APrxLoRcpH1(max(abs(dir.x),abs(dir.y)));
+ AH2 len2=AH2(AH1_(1.0)+(stretch-AH1_(1.0))*len,AH1_(1.0)+AH1_(-0.5)*len);
+ AH1 lob=AH1_(0.5)+AH1_((1.0/4.0-0.04)-0.5)*len;
+ AH1 clp=APrxLoRcpH1(lob);
+//------------------------------------------------------------------------------------------------------------------------------
+ // FP16 is different, using packed trick to do min and max in same operation.
+ AH2 bothR=max(max(AH2(-ijfeR.z,ijfeR.z),AH2(-klhgR.w,klhgR.w)),max(AH2(-ijfeR.y,ijfeR.y),AH2(-klhgR.x,klhgR.x)));
+ AH2 bothG=max(max(AH2(-ijfeG.z,ijfeG.z),AH2(-klhgG.w,klhgG.w)),max(AH2(-ijfeG.y,ijfeG.y),AH2(-klhgG.x,klhgG.x)));
+ AH2 bothB=max(max(AH2(-ijfeB.z,ijfeB.z),AH2(-klhgB.w,klhgB.w)),max(AH2(-ijfeB.y,ijfeB.y),AH2(-klhgB.x,klhgB.x)));
+ // This part is different for FP16, working pairs of taps at a time.
+ AH2 pR=AH2_(0.0);
+ AH2 pG=AH2_(0.0);
+ AH2 pB=AH2_(0.0);
+ AH2 pW=AH2_(0.0);
+ FsrEasuTapH(pR,pG,pB,pW,AH2( 0.0, 1.0)-ppp.xx,AH2(-1.0,-1.0)-ppp.yy,dir,len2,lob,clp,bczzR.xy,bczzG.xy,bczzB.xy);
+ FsrEasuTapH(pR,pG,pB,pW,AH2(-1.0, 0.0)-ppp.xx,AH2( 1.0, 1.0)-ppp.yy,dir,len2,lob,clp,ijfeR.xy,ijfeG.xy,ijfeB.xy);
+ FsrEasuTapH(pR,pG,pB,pW,AH2( 0.0,-1.0)-ppp.xx,AH2( 0.0, 0.0)-ppp.yy,dir,len2,lob,clp,ijfeR.zw,ijfeG.zw,ijfeB.zw);
+ FsrEasuTapH(pR,pG,pB,pW,AH2( 1.0, 2.0)-ppp.xx,AH2( 1.0, 1.0)-ppp.yy,dir,len2,lob,clp,klhgR.xy,klhgG.xy,klhgB.xy);
+ FsrEasuTapH(pR,pG,pB,pW,AH2( 2.0, 1.0)-ppp.xx,AH2( 0.0, 0.0)-ppp.yy,dir,len2,lob,clp,klhgR.zw,klhgG.zw,klhgB.zw);
+ FsrEasuTapH(pR,pG,pB,pW,AH2( 1.0, 0.0)-ppp.xx,AH2( 2.0, 2.0)-ppp.yy,dir,len2,lob,clp,zzonR.zw,zzonG.zw,zzonB.zw);
+ AH3 aC=AH3(pR.x+pR.y,pG.x+pG.y,pB.x+pB.y);
+ AH1 aW=pW.x+pW.y;
+//------------------------------------------------------------------------------------------------------------------------------
+ // Slightly different for FP16 version due to combined min and max.
+ pix=min(AH3(bothR.y,bothG.y,bothB.y),max(-AH3(bothR.x,bothG.x,bothB.x),aC*AH3_(ARcpH1(aW))));}
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+//
+// FSR - [RCAS] ROBUST CONTRAST ADAPTIVE SHARPENING
+//
+//------------------------------------------------------------------------------------------------------------------------------
+// CAS uses a simplified mechanism to convert local contrast into a variable amount of sharpness.
+// RCAS uses a more exact mechanism, solving for the maximum local sharpness possible before clipping.
+// RCAS also has a built in process to limit sharpening of what it detects as possible noise.
+// RCAS sharper does not support scaling, as it should be applied after EASU scaling.
+// Pass EASU output straight into RCAS, no color conversions necessary.
+//------------------------------------------------------------------------------------------------------------------------------
+// RCAS is based on the following logic.
+// RCAS uses a 5 tap filter in a cross pattern (same as CAS),
+// w n
+// w 1 w for taps w m e
+// w s
+// Where 'w' is the negative lobe weight.
+// output = (w*(n+e+w+s)+m)/(4*w+1)
+// RCAS solves for 'w' by seeing where the signal might clip out of the {0 to 1} input range,
+// 0 == (w*(n+e+w+s)+m)/(4*w+1) -> w = -m/(n+e+w+s)
+// 1 == (w*(n+e+w+s)+m)/(4*w+1) -> w = (1-m)/(n+e+w+s-4*1)
+// Then chooses the 'w' which results in no clipping, limits 'w', and multiplies by the 'sharp' amount.
+// This solution above has issues with MSAA input as the steps along the gradient cause edge detection issues.
+// So RCAS uses 4x the maximum and 4x the minimum (depending on equation)in place of the individual taps.
+// As well as switching from 'm' to either the minimum or maximum (depending on side), to help in energy conservation.
+// This stabilizes RCAS.
+// RCAS does a simple highpass which is normalized against the local contrast then shaped,
+// 0.25
+// 0.25 -1 0.25
+// 0.25
+// This is used as a noise detection filter, to reduce the effect of RCAS on grain, and focus on real edges.
+//
+// GLSL example for the required callbacks :
+//
+// AH4 FsrRcasLoadH(ASW2 p){return AH4(imageLoad(imgSrc,ASU2(p)));}
+// void FsrRcasInputH(inout AH1 r,inout AH1 g,inout AH1 b)
+// {
+// //do any simple input color conversions here or leave empty if none needed
+// }
+//
+// FsrRcasCon need to be called from the CPU or GPU to set up constants.
+// Including a GPU example here, the 'con' value would be stored out to a constant buffer.
+//
+// AU4 con;
+// FsrRcasCon(con,
+// 0.0); // The scale is {0.0 := maximum sharpness, to N>0, where N is the number of stops (halving) of the reduction of sharpness}.
+// ---------------
+// RCAS sharpening supports a CAS-like pass-through alpha via,
+// #define FSR_RCAS_PASSTHROUGH_ALPHA 1
+// RCAS also supports a define to enable a more expensive path to avoid some sharpening of noise.
+// Would suggest it is better to apply film grain after RCAS sharpening (and after scaling) instead of using this define,
+// #define FSR_RCAS_DENOISE 1
+//==============================================================================================================================
+// This is set at the limit of providing unnatural results for sharpening.
+#define FSR_RCAS_LIMIT (0.25-(1.0/16.0))
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// CONSTANT SETUP
+//==============================================================================================================================
+// Call to setup required constant values (works on CPU or GPU).
+A_STATIC void FsrRcasCon(
+outAU4 con,
+// The scale is {0.0 := maximum, to N>0, where N is the number of stops (halving) of the reduction of sharpness}.
+AF1 sharpness){
+ // Transform from stops to linear value.
+ sharpness=AExp2F1(-sharpness);
+ varAF2(hSharp)=initAF2(sharpness,sharpness);
+ con[0]=AU1_AF1(sharpness);
+ con[1]=AU1_AH2_AF2(hSharp);
+ con[2]=0;
+ con[3]=0;}
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// NON-PACKED 32-BIT VERSION
+//==============================================================================================================================
+#if defined(A_GPU)&&defined(FSR_RCAS_F)
+ // Input callback prototypes that need to be implemented by calling shader
+ AF4 FsrRcasLoadF(ASU2 p);
+ void FsrRcasInputF(inout AF1 r,inout AF1 g,inout AF1 b);
+//------------------------------------------------------------------------------------------------------------------------------
+ void FsrRcasF(
+ out AF1 pixR, // Output values, non-vector so port between RcasFilter() and RcasFilterH() is easy.
+ out AF1 pixG,
+ out AF1 pixB,
+ #ifdef FSR_RCAS_PASSTHROUGH_ALPHA
+ out AF1 pixA,
+ #endif
+ AU2 ip, // Integer pixel position in output.
+ AU4 con){ // Constant generated by RcasSetup().
+ // Algorithm uses minimal 3x3 pixel neighborhood.
+ // b
+ // d e f
+ // h
+ ASU2 sp=ASU2(ip);
+ AF3 b=FsrRcasLoadF(sp+ASU2( 0,-1)).rgb;
+ AF3 d=FsrRcasLoadF(sp+ASU2(-1, 0)).rgb;
+ #ifdef FSR_RCAS_PASSTHROUGH_ALPHA
+ AF4 ee=FsrRcasLoadF(sp);
+ AF3 e=ee.rgb;pixA=ee.a;
+ #else
+ AF3 e=FsrRcasLoadF(sp).rgb;
+ #endif
+ AF3 f=FsrRcasLoadF(sp+ASU2( 1, 0)).rgb;
+ AF3 h=FsrRcasLoadF(sp+ASU2( 0, 1)).rgb;
+ // Rename (32-bit) or regroup (16-bit).
+ AF1 bR=b.r;
+ AF1 bG=b.g;
+ AF1 bB=b.b;
+ AF1 dR=d.r;
+ AF1 dG=d.g;
+ AF1 dB=d.b;
+ AF1 eR=e.r;
+ AF1 eG=e.g;
+ AF1 eB=e.b;
+ AF1 fR=f.r;
+ AF1 fG=f.g;
+ AF1 fB=f.b;
+ AF1 hR=h.r;
+ AF1 hG=h.g;
+ AF1 hB=h.b;
+ // Run optional input transform.
+ FsrRcasInputF(bR,bG,bB);
+ FsrRcasInputF(dR,dG,dB);
+ FsrRcasInputF(eR,eG,eB);
+ FsrRcasInputF(fR,fG,fB);
+ FsrRcasInputF(hR,hG,hB);
+ // Luma times 2.
+ AF1 bL=bB*AF1_(0.5)+(bR*AF1_(0.5)+bG);
+ AF1 dL=dB*AF1_(0.5)+(dR*AF1_(0.5)+dG);
+ AF1 eL=eB*AF1_(0.5)+(eR*AF1_(0.5)+eG);
+ AF1 fL=fB*AF1_(0.5)+(fR*AF1_(0.5)+fG);
+ AF1 hL=hB*AF1_(0.5)+(hR*AF1_(0.5)+hG);
+ // Noise detection.
+ AF1 nz=AF1_(0.25)*bL+AF1_(0.25)*dL+AF1_(0.25)*fL+AF1_(0.25)*hL-eL;
+ nz=ASatF1(abs(nz)*APrxMedRcpF1(AMax3F1(AMax3F1(bL,dL,eL),fL,hL)-AMin3F1(AMin3F1(bL,dL,eL),fL,hL)));
+ nz=AF1_(-0.5)*nz+AF1_(1.0);
+ // Min and max of ring.
+ AF1 mn4R=min(AMin3F1(bR,dR,fR),hR);
+ AF1 mn4G=min(AMin3F1(bG,dG,fG),hG);
+ AF1 mn4B=min(AMin3F1(bB,dB,fB),hB);
+ AF1 mx4R=max(AMax3F1(bR,dR,fR),hR);
+ AF1 mx4G=max(AMax3F1(bG,dG,fG),hG);
+ AF1 mx4B=max(AMax3F1(bB,dB,fB),hB);
+ // Immediate constants for peak range.
+ AF2 peakC=AF2(1.0,-1.0*4.0);
+ // Limiters, these need to be high precision RCPs.
+ AF1 hitMinR=mn4R*ARcpF1(AF1_(4.0)*mx4R);
+ AF1 hitMinG=mn4G*ARcpF1(AF1_(4.0)*mx4G);
+ AF1 hitMinB=mn4B*ARcpF1(AF1_(4.0)*mx4B);
+ AF1 hitMaxR=(peakC.x-mx4R)*ARcpF1(AF1_(4.0)*mn4R+peakC.y);
+ AF1 hitMaxG=(peakC.x-mx4G)*ARcpF1(AF1_(4.0)*mn4G+peakC.y);
+ AF1 hitMaxB=(peakC.x-mx4B)*ARcpF1(AF1_(4.0)*mn4B+peakC.y);
+ AF1 lobeR=max(-hitMinR,hitMaxR);
+ AF1 lobeG=max(-hitMinG,hitMaxG);
+ AF1 lobeB=max(-hitMinB,hitMaxB);
+ AF1 lobe=max(AF1_(-FSR_RCAS_LIMIT),min(AMax3F1(lobeR,lobeG,lobeB),AF1_(0.0)))*AF1_AU1(con.x);
+ // Apply noise removal.
+ #ifdef FSR_RCAS_DENOISE
+ lobe*=nz;
+ #endif
+ // Resolve, which needs the medium precision rcp approximation to avoid visible tonality changes.
+ AF1 rcpL=APrxMedRcpF1(AF1_(4.0)*lobe+AF1_(1.0));
+ pixR=(lobe*bR+lobe*dR+lobe*hR+lobe*fR+eR)*rcpL;
+ pixG=(lobe*bG+lobe*dG+lobe*hG+lobe*fG+eG)*rcpL;
+ pixB=(lobe*bB+lobe*dB+lobe*hB+lobe*fB+eB)*rcpL;
+ return;}
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// NON-PACKED 16-BIT VERSION
+//==============================================================================================================================
+#if defined(A_GPU)&&defined(A_HALF)&&defined(FSR_RCAS_H)
+ // Input callback prototypes that need to be implemented by calling shader
+ AH4 FsrRcasLoadH(ASW2 p);
+ void FsrRcasInputH(inout AH1 r,inout AH1 g,inout AH1 b);
+//------------------------------------------------------------------------------------------------------------------------------
+ void FsrRcasH(
+ out AH1 pixR, // Output values, non-vector so port between RcasFilter() and RcasFilterH() is easy.
+ out AH1 pixG,
+ out AH1 pixB,
+ #ifdef FSR_RCAS_PASSTHROUGH_ALPHA
+ out AH1 pixA,
+ #endif
+ AU2 ip, // Integer pixel position in output.
+ AU4 con){ // Constant generated by RcasSetup().
+ // Sharpening algorithm uses minimal 3x3 pixel neighborhood.
+ // b
+ // d e f
+ // h
+ ASW2 sp=ASW2(ip);
+ AH3 b=FsrRcasLoadH(sp+ASW2( 0,-1)).rgb;
+ AH3 d=FsrRcasLoadH(sp+ASW2(-1, 0)).rgb;
+ #ifdef FSR_RCAS_PASSTHROUGH_ALPHA
+ AH4 ee=FsrRcasLoadH(sp);
+ AH3 e=ee.rgb;pixA=ee.a;
+ #else
+ AH3 e=FsrRcasLoadH(sp).rgb;
+ #endif
+ AH3 f=FsrRcasLoadH(sp+ASW2( 1, 0)).rgb;
+ AH3 h=FsrRcasLoadH(sp+ASW2( 0, 1)).rgb;
+ // Rename (32-bit) or regroup (16-bit).
+ AH1 bR=b.r;
+ AH1 bG=b.g;
+ AH1 bB=b.b;
+ AH1 dR=d.r;
+ AH1 dG=d.g;
+ AH1 dB=d.b;
+ AH1 eR=e.r;
+ AH1 eG=e.g;
+ AH1 eB=e.b;
+ AH1 fR=f.r;
+ AH1 fG=f.g;
+ AH1 fB=f.b;
+ AH1 hR=h.r;
+ AH1 hG=h.g;
+ AH1 hB=h.b;
+ // Run optional input transform.
+ FsrRcasInputH(bR,bG,bB);
+ FsrRcasInputH(dR,dG,dB);
+ FsrRcasInputH(eR,eG,eB);
+ FsrRcasInputH(fR,fG,fB);
+ FsrRcasInputH(hR,hG,hB);
+ // Luma times 2.
+ AH1 bL=bB*AH1_(0.5)+(bR*AH1_(0.5)+bG);
+ AH1 dL=dB*AH1_(0.5)+(dR*AH1_(0.5)+dG);
+ AH1 eL=eB*AH1_(0.5)+(eR*AH1_(0.5)+eG);
+ AH1 fL=fB*AH1_(0.5)+(fR*AH1_(0.5)+fG);
+ AH1 hL=hB*AH1_(0.5)+(hR*AH1_(0.5)+hG);
+ // Noise detection.
+ AH1 nz=AH1_(0.25)*bL+AH1_(0.25)*dL+AH1_(0.25)*fL+AH1_(0.25)*hL-eL;
+ nz=ASatH1(abs(nz)*APrxMedRcpH1(AMax3H1(AMax3H1(bL,dL,eL),fL,hL)-AMin3H1(AMin3H1(bL,dL,eL),fL,hL)));
+ nz=AH1_(-0.5)*nz+AH1_(1.0);
+ // Min and max of ring.
+ AH1 mn4R=min(AMin3H1(bR,dR,fR),hR);
+ AH1 mn4G=min(AMin3H1(bG,dG,fG),hG);
+ AH1 mn4B=min(AMin3H1(bB,dB,fB),hB);
+ AH1 mx4R=max(AMax3H1(bR,dR,fR),hR);
+ AH1 mx4G=max(AMax3H1(bG,dG,fG),hG);
+ AH1 mx4B=max(AMax3H1(bB,dB,fB),hB);
+ // Immediate constants for peak range.
+ AH2 peakC=AH2(1.0,-1.0*4.0);
+ // Limiters, these need to be high precision RCPs.
+ AH1 hitMinR=mn4R*ARcpH1(AH1_(4.0)*mx4R);
+ AH1 hitMinG=mn4G*ARcpH1(AH1_(4.0)*mx4G);
+ AH1 hitMinB=mn4B*ARcpH1(AH1_(4.0)*mx4B);
+ AH1 hitMaxR=(peakC.x-mx4R)*ARcpH1(AH1_(4.0)*mn4R+peakC.y);
+ AH1 hitMaxG=(peakC.x-mx4G)*ARcpH1(AH1_(4.0)*mn4G+peakC.y);
+ AH1 hitMaxB=(peakC.x-mx4B)*ARcpH1(AH1_(4.0)*mn4B+peakC.y);
+ AH1 lobeR=max(-hitMinR,hitMaxR);
+ AH1 lobeG=max(-hitMinG,hitMaxG);
+ AH1 lobeB=max(-hitMinB,hitMaxB);
+ AH1 lobe=max(AH1_(-FSR_RCAS_LIMIT),min(AMax3H1(lobeR,lobeG,lobeB),AH1_(0.0)))*AH2_AU1(con.y).x;
+ // Apply noise removal.
+ #ifdef FSR_RCAS_DENOISE
+ lobe*=nz;
+ #endif
+ // Resolve, which needs the medium precision rcp approximation to avoid visible tonality changes.
+ AH1 rcpL=APrxMedRcpH1(AH1_(4.0)*lobe+AH1_(1.0));
+ pixR=(lobe*bR+lobe*dR+lobe*hR+lobe*fR+eR)*rcpL;
+ pixG=(lobe*bG+lobe*dG+lobe*hG+lobe*fG+eG)*rcpL;
+ pixB=(lobe*bB+lobe*dB+lobe*hB+lobe*fB+eB)*rcpL;}
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+// PACKED 16-BIT VERSION
+//==============================================================================================================================
+#if defined(A_GPU)&&defined(A_HALF)&&defined(FSR_RCAS_HX2)
+ // Input callback prototypes that need to be implemented by the calling shader
+ AH4 FsrRcasLoadHx2(ASW2 p);
+ void FsrRcasInputHx2(inout AH2 r,inout AH2 g,inout AH2 b);
+//------------------------------------------------------------------------------------------------------------------------------
+ // Can be used to convert from packed Structures of Arrays to Arrays of Structures for store.
+ void FsrRcasDepackHx2(out AH4 pix0,out AH4 pix1,AH2 pixR,AH2 pixG,AH2 pixB){
+ #ifdef A_HLSL
+ // Invoke a slower path for DX only, since it won't allow uninitialized values.
+ pix0.a=pix1.a=0.0;
+ #endif
+ pix0.rgb=AH3(pixR.x,pixG.x,pixB.x);
+ pix1.rgb=AH3(pixR.y,pixG.y,pixB.y);}
+//------------------------------------------------------------------------------------------------------------------------------
+ void FsrRcasHx2(
+ // Output values are for 2 8x8 tiles in a 16x8 region.
+ // pix<R,G,B>.x = left 8x8 tile
+ // pix<R,G,B>.y = right 8x8 tile
+ // This enables later processing to easily be packed as well.
+ out AH2 pixR,
+ out AH2 pixG,
+ out AH2 pixB,
+ #ifdef FSR_RCAS_PASSTHROUGH_ALPHA
+ out AH2 pixA,
+ #endif
+ AU2 ip, // Integer pixel position in output.
+ AU4 con){ // Constant generated by RcasSetup().
+ // No scaling algorithm uses minimal 3x3 pixel neighborhood.
+ ASW2 sp0=ASW2(ip);
+ AH3 b0=FsrRcasLoadHx2(sp0+ASW2( 0,-1)).rgb;
+ AH3 d0=FsrRcasLoadHx2(sp0+ASW2(-1, 0)).rgb;
+ #ifdef FSR_RCAS_PASSTHROUGH_ALPHA
+ AH4 ee0=FsrRcasLoadHx2(sp0);
+ AH3 e0=ee0.rgb;pixA.r=ee0.a;
+ #else
+ AH3 e0=FsrRcasLoadHx2(sp0).rgb;
+ #endif
+ AH3 f0=FsrRcasLoadHx2(sp0+ASW2( 1, 0)).rgb;
+ AH3 h0=FsrRcasLoadHx2(sp0+ASW2( 0, 1)).rgb;
+ ASW2 sp1=sp0+ASW2(8,0);
+ AH3 b1=FsrRcasLoadHx2(sp1+ASW2( 0,-1)).rgb;
+ AH3 d1=FsrRcasLoadHx2(sp1+ASW2(-1, 0)).rgb;
+ #ifdef FSR_RCAS_PASSTHROUGH_ALPHA
+ AH4 ee1=FsrRcasLoadHx2(sp1);
+ AH3 e1=ee1.rgb;pixA.g=ee1.a;
+ #else
+ AH3 e1=FsrRcasLoadHx2(sp1).rgb;
+ #endif
+ AH3 f1=FsrRcasLoadHx2(sp1+ASW2( 1, 0)).rgb;
+ AH3 h1=FsrRcasLoadHx2(sp1+ASW2( 0, 1)).rgb;
+ // Arrays of Structures to Structures of Arrays conversion.
+ AH2 bR=AH2(b0.r,b1.r);
+ AH2 bG=AH2(b0.g,b1.g);
+ AH2 bB=AH2(b0.b,b1.b);
+ AH2 dR=AH2(d0.r,d1.r);
+ AH2 dG=AH2(d0.g,d1.g);
+ AH2 dB=AH2(d0.b,d1.b);
+ AH2 eR=AH2(e0.r,e1.r);
+ AH2 eG=AH2(e0.g,e1.g);
+ AH2 eB=AH2(e0.b,e1.b);
+ AH2 fR=AH2(f0.r,f1.r);
+ AH2 fG=AH2(f0.g,f1.g);
+ AH2 fB=AH2(f0.b,f1.b);
+ AH2 hR=AH2(h0.r,h1.r);
+ AH2 hG=AH2(h0.g,h1.g);
+ AH2 hB=AH2(h0.b,h1.b);
+ // Run optional input transform.
+ FsrRcasInputHx2(bR,bG,bB);
+ FsrRcasInputHx2(dR,dG,dB);
+ FsrRcasInputHx2(eR,eG,eB);
+ FsrRcasInputHx2(fR,fG,fB);
+ FsrRcasInputHx2(hR,hG,hB);
+ // Luma times 2.
+ AH2 bL=bB*AH2_(0.5)+(bR*AH2_(0.5)+bG);
+ AH2 dL=dB*AH2_(0.5)+(dR*AH2_(0.5)+dG);
+ AH2 eL=eB*AH2_(0.5)+(eR*AH2_(0.5)+eG);
+ AH2 fL=fB*AH2_(0.5)+(fR*AH2_(0.5)+fG);
+ AH2 hL=hB*AH2_(0.5)+(hR*AH2_(0.5)+hG);
+ // Noise detection.
+ AH2 nz=AH2_(0.25)*bL+AH2_(0.25)*dL+AH2_(0.25)*fL+AH2_(0.25)*hL-eL;
+ nz=ASatH2(abs(nz)*APrxMedRcpH2(AMax3H2(AMax3H2(bL,dL,eL),fL,hL)-AMin3H2(AMin3H2(bL,dL,eL),fL,hL)));
+ nz=AH2_(-0.5)*nz+AH2_(1.0);
+ // Min and max of ring.
+ AH2 mn4R=min(AMin3H2(bR,dR,fR),hR);
+ AH2 mn4G=min(AMin3H2(bG,dG,fG),hG);
+ AH2 mn4B=min(AMin3H2(bB,dB,fB),hB);
+ AH2 mx4R=max(AMax3H2(bR,dR,fR),hR);
+ AH2 mx4G=max(AMax3H2(bG,dG,fG),hG);
+ AH2 mx4B=max(AMax3H2(bB,dB,fB),hB);
+ // Immediate constants for peak range.
+ AH2 peakC=AH2(1.0,-1.0*4.0);
+ // Limiters, these need to be high precision RCPs.
+ AH2 hitMinR=mn4R*ARcpH2(AH2_(4.0)*mx4R);
+ AH2 hitMinG=mn4G*ARcpH2(AH2_(4.0)*mx4G);
+ AH2 hitMinB=mn4B*ARcpH2(AH2_(4.0)*mx4B);
+ AH2 hitMaxR=(peakC.x-mx4R)*ARcpH2(AH2_(4.0)*mn4R+peakC.y);
+ AH2 hitMaxG=(peakC.x-mx4G)*ARcpH2(AH2_(4.0)*mn4G+peakC.y);
+ AH2 hitMaxB=(peakC.x-mx4B)*ARcpH2(AH2_(4.0)*mn4B+peakC.y);
+ AH2 lobeR=max(-hitMinR,hitMaxR);
+ AH2 lobeG=max(-hitMinG,hitMaxG);
+ AH2 lobeB=max(-hitMinB,hitMaxB);
+ AH2 lobe=max(AH2_(-FSR_RCAS_LIMIT),min(AMax3H2(lobeR,lobeG,lobeB),AH2_(0.0)))*AH2_(AH2_AU1(con.y).x);
+ // Apply noise removal.
+ #ifdef FSR_RCAS_DENOISE
+ lobe*=nz;
+ #endif
+ // Resolve, which needs the medium precision rcp approximation to avoid visible tonality changes.
+ AH2 rcpL=APrxMedRcpH2(AH2_(4.0)*lobe+AH2_(1.0));
+ pixR=(lobe*bR+lobe*dR+lobe*hR+lobe*fR+eR)*rcpL;
+ pixG=(lobe*bG+lobe*dG+lobe*hG+lobe*fG+eG)*rcpL;
+ pixB=(lobe*bB+lobe*dB+lobe*hB+lobe*fB+eB)*rcpL;}
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+//
+// FSR - [LFGA] LINEAR FILM GRAIN APPLICATOR
+//
+//------------------------------------------------------------------------------------------------------------------------------
+// Adding output-resolution film grain after scaling is a good way to mask both rendering and scaling artifacts.
+// Suggest using tiled blue noise as film grain input, with peak noise frequency set for a specific look and feel.
+// The 'Lfga*()' functions provide a convenient way to introduce grain.
+// These functions limit grain based on distance to signal limits.
+// This is done so that the grain is temporally energy preserving, and thus won't modify image tonality.
+// Grain application should be done in a linear colorspace.
+// The grain should be temporally changing, but have a temporal sum per pixel that adds to zero (non-biased).
+//------------------------------------------------------------------------------------------------------------------------------
+// Usage,
+// FsrLfga*(
+// color, // In/out linear colorspace color {0 to 1} ranged.
+// grain, // Per pixel grain texture value {-0.5 to 0.5} ranged, input is 3-channel to support colored grain.
+// amount); // Amount of grain (0 to 1} ranged.
+//------------------------------------------------------------------------------------------------------------------------------
+// Example if grain texture is monochrome: 'FsrLfgaF(color,AF3_(grain),amount)'
+//==============================================================================================================================
+#if defined(A_GPU)
+ // Maximum grain is the minimum distance to the signal limit.
+ void FsrLfgaF(inout AF3 c,AF3 t,AF1 a){c+=(t*AF3_(a))*min(AF3_(1.0)-c,c);}
+#endif
+//==============================================================================================================================
+#if defined(A_GPU)&&defined(A_HALF)
+ // Half precision version (slower).
+ void FsrLfgaH(inout AH3 c,AH3 t,AH1 a){c+=(t*AH3_(a))*min(AH3_(1.0)-c,c);}
+//------------------------------------------------------------------------------------------------------------------------------
+ // Packed half precision version (faster).
+ void FsrLfgaHx2(inout AH2 cR,inout AH2 cG,inout AH2 cB,AH2 tR,AH2 tG,AH2 tB,AH1 a){
+ cR+=(tR*AH2_(a))*min(AH2_(1.0)-cR,cR);cG+=(tG*AH2_(a))*min(AH2_(1.0)-cG,cG);cB+=(tB*AH2_(a))*min(AH2_(1.0)-cB,cB);}
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+//
+// FSR - [SRTM] SIMPLE REVERSIBLE TONE-MAPPER
+//
+//------------------------------------------------------------------------------------------------------------------------------
+// This provides a way to take linear HDR color {0 to FP16_MAX} and convert it into a temporary {0 to 1} ranged post-tonemapped linear.
+// The tonemapper preserves RGB ratio, which helps maintain HDR color bleed during filtering.
+//------------------------------------------------------------------------------------------------------------------------------
+// Reversible tonemapper usage,
+// FsrSrtm*(color); // {0 to FP16_MAX} converted to {0 to 1}.
+// FsrSrtmInv*(color); // {0 to 1} converted into {0 to 32768, output peak safe for FP16}.
+//==============================================================================================================================
+#if defined(A_GPU)
+ void FsrSrtmF(inout AF3 c){c*=AF3_(ARcpF1(AMax3F1(c.r,c.g,c.b)+AF1_(1.0)));}
+ // The extra max solves the c=1.0 case (which is a /0).
+ void FsrSrtmInvF(inout AF3 c){c*=AF3_(ARcpF1(max(AF1_(1.0/32768.0),AF1_(1.0)-AMax3F1(c.r,c.g,c.b))));}
+#endif
+//==============================================================================================================================
+#if defined(A_GPU)&&defined(A_HALF)
+ void FsrSrtmH(inout AH3 c){c*=AH3_(ARcpH1(AMax3H1(c.r,c.g,c.b)+AH1_(1.0)));}
+ void FsrSrtmInvH(inout AH3 c){c*=AH3_(ARcpH1(max(AH1_(1.0/32768.0),AH1_(1.0)-AMax3H1(c.r,c.g,c.b))));}
+//------------------------------------------------------------------------------------------------------------------------------
+ void FsrSrtmHx2(inout AH2 cR,inout AH2 cG,inout AH2 cB){
+ AH2 rcp=ARcpH2(AMax3H2(cR,cG,cB)+AH2_(1.0));cR*=rcp;cG*=rcp;cB*=rcp;}
+ void FsrSrtmInvHx2(inout AH2 cR,inout AH2 cG,inout AH2 cB){
+ AH2 rcp=ARcpH2(max(AH2_(1.0/32768.0),AH2_(1.0)-AMax3H2(cR,cG,cB)));cR*=rcp;cG*=rcp;cB*=rcp;}
+#endif
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+//_____________________________________________________________/\_______________________________________________________________
+//==============================================================================================================================
+//
+// FSR - [TEPD] TEMPORAL ENERGY PRESERVING DITHER
+//
+//------------------------------------------------------------------------------------------------------------------------------
+// Temporally energy preserving dithered {0 to 1} linear to gamma 2.0 conversion.
+// Gamma 2.0 is used so that the conversion back to linear is just to square the color.
+// The conversion comes in 8-bit and 10-bit modes, designed for output to 8-bit UNORM or 10:10:10:2 respectively.
+// Given good non-biased temporal blue noise as dither input,
+// the output dither will temporally conserve energy.
+// This is done by choosing the linear nearest step point instead of perceptual nearest.
+// See code below for details.
+//------------------------------------------------------------------------------------------------------------------------------
+// DX SPEC RULES FOR FLOAT->UNORM 8-BIT CONVERSION
+// ===============================================
+// - Output is 'uint(floor(saturate(n)*255.0+0.5))'.
+// - Thus rounding is to nearest.
+// - NaN gets converted to zero.
+// - INF is clamped to {0.0 to 1.0}.
+//==============================================================================================================================
+#if defined(A_GPU)
+ // Hand tuned integer position to dither value, with more values than simple checkerboard.
+ // Only 32-bit has enough precision for this compddation.
+ // Output is {0 to <1}.
+ AF1 FsrTepdDitF(AU2 p,AU1 f){
+ AF1 x=AF1_(p.x+f);
+ AF1 y=AF1_(p.y);
+ // The 1.61803 golden ratio.
+ AF1 a=AF1_((1.0+sqrt(5.0))/2.0);
+ // Number designed to provide a good visual pattern.
+ AF1 b=AF1_(1.0/3.69);
+ x=x*a+(y*b);
+ return AFractF1(x);}
+//------------------------------------------------------------------------------------------------------------------------------
+ // This version is 8-bit gamma 2.0.
+ // The 'c' input is {0 to 1}.
+ // Output is {0 to 1} ready for image store.
+ void FsrTepdC8F(inout AF3 c,AF1 dit){
+ AF3 n=sqrt(c);
+ n=floor(n*AF3_(255.0))*AF3_(1.0/255.0);
+ AF3 a=n*n;
+ AF3 b=n+AF3_(1.0/255.0);b=b*b;
+ // Ratio of 'a' to 'b' required to produce 'c'.
+ // APrxLoRcpF1() won't work here (at least for very high dynamic ranges).
+ // APrxMedRcpF1() is an IADD,FMA,MUL.
+ AF3 r=(c-b)*APrxMedRcpF3(a-b);
+ // Use the ratio as a cutoff to choose 'a' or 'b'.
+ // AGtZeroF1() is a MUL.
+ c=ASatF3(n+AGtZeroF3(AF3_(dit)-r)*AF3_(1.0/255.0));}
+//------------------------------------------------------------------------------------------------------------------------------
+ // This version is 10-bit gamma 2.0.
+ // The 'c' input is {0 to 1}.
+ // Output is {0 to 1} ready for image store.
+ void FsrTepdC10F(inout AF3 c,AF1 dit){
+ AF3 n=sqrt(c);
+ n=floor(n*AF3_(1023.0))*AF3_(1.0/1023.0);
+ AF3 a=n*n;
+ AF3 b=n+AF3_(1.0/1023.0);b=b*b;
+ AF3 r=(c-b)*APrxMedRcpF3(a-b);
+ c=ASatF3(n+AGtZeroF3(AF3_(dit)-r)*AF3_(1.0/1023.0));}
+#endif
+//==============================================================================================================================
+#if defined(A_GPU)&&defined(A_HALF)
+ AH1 FsrTepdDitH(AU2 p,AU1 f){
+ AF1 x=AF1_(p.x+f);
+ AF1 y=AF1_(p.y);
+ AF1 a=AF1_((1.0+sqrt(5.0))/2.0);
+ AF1 b=AF1_(1.0/3.69);
+ x=x*a+(y*b);
+ return AH1(AFractF1(x));}
+//------------------------------------------------------------------------------------------------------------------------------
+ void FsrTepdC8H(inout AH3 c,AH1 dit){
+ AH3 n=sqrt(c);
+ n=floor(n*AH3_(255.0))*AH3_(1.0/255.0);
+ AH3 a=n*n;
+ AH3 b=n+AH3_(1.0/255.0);b=b*b;
+ AH3 r=(c-b)*APrxMedRcpH3(a-b);
+ c=ASatH3(n+AGtZeroH3(AH3_(dit)-r)*AH3_(1.0/255.0));}
+//------------------------------------------------------------------------------------------------------------------------------
+ void FsrTepdC10H(inout AH3 c,AH1 dit){
+ AH3 n=sqrt(c);
+ n=floor(n*AH3_(1023.0))*AH3_(1.0/1023.0);
+ AH3 a=n*n;
+ AH3 b=n+AH3_(1.0/1023.0);b=b*b;
+ AH3 r=(c-b)*APrxMedRcpH3(a-b);
+ c=ASatH3(n+AGtZeroH3(AH3_(dit)-r)*AH3_(1.0/1023.0));}
+//==============================================================================================================================
+ // This computes dither for positions 'p' and 'p+{8,0}'.
+ AH2 FsrTepdDitHx2(AU2 p,AU1 f){
+ AF2 x;
+ x.x=AF1_(p.x+f);
+ x.y=x.x+AF1_(8.0);
+ AF1 y=AF1_(p.y);
+ AF1 a=AF1_((1.0+sqrt(5.0))/2.0);
+ AF1 b=AF1_(1.0/3.69);
+ x=x*AF2_(a)+AF2_(y*b);
+ return AH2(AFractF2(x));}
+//------------------------------------------------------------------------------------------------------------------------------
+ void FsrTepdC8Hx2(inout AH2 cR,inout AH2 cG,inout AH2 cB,AH2 dit){
+ AH2 nR=sqrt(cR);
+ AH2 nG=sqrt(cG);
+ AH2 nB=sqrt(cB);
+ nR=floor(nR*AH2_(255.0))*AH2_(1.0/255.0);
+ nG=floor(nG*AH2_(255.0))*AH2_(1.0/255.0);
+ nB=floor(nB*AH2_(255.0))*AH2_(1.0/255.0);
+ AH2 aR=nR*nR;
+ AH2 aG=nG*nG;
+ AH2 aB=nB*nB;
+ AH2 bR=nR+AH2_(1.0/255.0);bR=bR*bR;
+ AH2 bG=nG+AH2_(1.0/255.0);bG=bG*bG;
+ AH2 bB=nB+AH2_(1.0/255.0);bB=bB*bB;
+ AH2 rR=(cR-bR)*APrxMedRcpH2(aR-bR);
+ AH2 rG=(cG-bG)*APrxMedRcpH2(aG-bG);
+ AH2 rB=(cB-bB)*APrxMedRcpH2(aB-bB);
+ cR=ASatH2(nR+AGtZeroH2(dit-rR)*AH2_(1.0/255.0));
+ cG=ASatH2(nG+AGtZeroH2(dit-rG)*AH2_(1.0/255.0));
+ cB=ASatH2(nB+AGtZeroH2(dit-rB)*AH2_(1.0/255.0));}
+//------------------------------------------------------------------------------------------------------------------------------
+ void FsrTepdC10Hx2(inout AH2 cR,inout AH2 cG,inout AH2 cB,AH2 dit){
+ AH2 nR=sqrt(cR);
+ AH2 nG=sqrt(cG);
+ AH2 nB=sqrt(cB);
+ nR=floor(nR*AH2_(1023.0))*AH2_(1.0/1023.0);
+ nG=floor(nG*AH2_(1023.0))*AH2_(1.0/1023.0);
+ nB=floor(nB*AH2_(1023.0))*AH2_(1.0/1023.0);
+ AH2 aR=nR*nR;
+ AH2 aG=nG*nG;
+ AH2 aB=nB*nB;
+ AH2 bR=nR+AH2_(1.0/1023.0);bR=bR*bR;
+ AH2 bG=nG+AH2_(1.0/1023.0);bG=bG*bG;
+ AH2 bB=nB+AH2_(1.0/1023.0);bB=bB*bB;
+ AH2 rR=(cR-bR)*APrxMedRcpH2(aR-bR);
+ AH2 rG=(cG-bG)*APrxMedRcpH2(aG-bG);
+ AH2 rB=(cB-bB)*APrxMedRcpH2(aB-bB);
+ cR=ASatH2(nR+AGtZeroH2(dit-rR)*AH2_(1.0/1023.0));
+ cG=ASatH2(nG+AGtZeroH2(dit-rG)*AH2_(1.0/1023.0));
+ cB=ASatH2(nB+AGtZeroH2(dit-rB)*AH2_(1.0/1023.0));}
+#endif
diff --git a/3rdparty/bgfx/examples/46-fsr/fs_fsr_copy_linear_to_gamma.sc b/3rdparty/bgfx/examples/46-fsr/fs_fsr_copy_linear_to_gamma.sc
new file mode 100644
index 00000000000..2c9205e5749
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/fs_fsr_copy_linear_to_gamma.sc
@@ -0,0 +1,21 @@
+$input v_texcoord0
+
+/*
+* Copyright 2021 elven cache. All rights reserved.
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+*/
+
+#include "../common/common.sh"
+
+SAMPLER2D(s_color, 0);
+
+void main()
+{
+ vec2 texCoord = v_texcoord0;
+ vec4 linearColor = texture2D(s_color, texCoord);
+
+ // this pass is writing directly out to backbuffer, convert from linear to gamma
+ vec4 color = vec4(toGamma(linearColor.xyz), linearColor.w);
+
+ gl_FragColor = color;
+}
diff --git a/3rdparty/bgfx/examples/46-fsr/fs_fsr_forward.sc b/3rdparty/bgfx/examples/46-fsr/fs_fsr_forward.sc
new file mode 100644
index 00000000000..d60110d89f8
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/fs_fsr_forward.sc
@@ -0,0 +1,79 @@
+$input v_normal, v_texcoord0, v_texcoord1, v_texcoord2
+
+/*
+* Copyright 2021 elven cache. All rights reserved.
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+*/
+
+#include "../common/common.sh"
+
+SAMPLER2D(s_albedo, 0);
+SAMPLER2D(s_normal, 1);
+
+// struct ModelUniforms
+uniform vec4 u_modelParams[2];
+
+#define u_color (u_modelParams[0].xyz)
+#define u_lightPosition (u_modelParams[1].xyz)
+
+// http://www.thetenthplanet.de/archives/1180
+// "followup: normal mapping without precomputed tangents"
+mat3 cotangentFrame(vec3 N, vec3 p, vec2 uv)
+{
+ // get edge vectors of the pixel triangle
+ vec3 dp1 = dFdx(p);
+ vec3 dp2 = dFdy(p);
+ vec2 duv1 = dFdx(uv);
+ vec2 duv2 = dFdy(uv);
+
+ // solve the linear system
+ vec3 dp2perp = cross(dp2, N);
+ vec3 dp1perp = cross(N, dp1);
+ vec3 T = dp2perp * duv1.x + dp1perp * duv2.x;
+ vec3 B = dp2perp * duv1.y + dp1perp * duv2.y;
+
+ // construct a scale-invariant frame
+ float invMax = inversesqrt(max(dot(T,T), dot(B,B)));
+ return mat3(T*invMax, B*invMax, N);
+}
+
+void main()
+{
+ vec3 albedo = toLinear(texture2D(s_albedo, v_texcoord0).xyz);
+
+ // get vertex normal
+ vec3 normal = normalize(v_normal);
+
+ // get normal map normal, unpack, and calculate z
+ vec3 normalMap;
+ normalMap.xy = texture2D(s_normal, v_texcoord0).xy;
+ normalMap.xy = normalMap.xy * 2.0 - 1.0;
+ normalMap.z = sqrt(1.0 - dot(normalMap.xy, normalMap.xy));
+
+ // swap x and y, because the brick texture looks flipped, don't copy this...
+ normalMap.xy = -normalMap.yx;
+
+ // perturb geometry normal by normal map
+ vec3 pos = v_texcoord1.xyz; // contains world space pos
+ mat3 TBN = cotangentFrame(normal, pos, v_texcoord0);
+ vec3 bumpedNormal = normalize(instMul(TBN, normalMap));
+
+ vec3 light = (u_lightPosition - pos);
+ light = normalize(light);
+
+ float NdotL = saturate(dot(bumpedNormal, light));
+ float diffuse = NdotL * 1.0;
+
+ vec3 V = v_texcoord2.xyz; // contains view vector
+ vec3 H = normalize(V+light);
+ float NdotH = saturate(dot(bumpedNormal, H));
+ float specular = 5.0 * pow(NdotH, 256);
+ float ambient = 0.1;
+
+ float lightAmount = ambient + diffuse;
+ vec3 color = u_color * albedo * lightAmount + specular;
+
+ // leave color in linear space for better dof filter result
+
+ gl_FragColor = vec4(color, 1.0);
+}
diff --git a/3rdparty/bgfx/examples/46-fsr/fs_fsr_forward_grid.sc b/3rdparty/bgfx/examples/46-fsr/fs_fsr_forward_grid.sc
new file mode 100644
index 00000000000..db5fd56f9c7
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/fs_fsr_forward_grid.sc
@@ -0,0 +1,58 @@
+$input v_normal, v_texcoord0, v_texcoord1, v_texcoord2
+
+/*
+* Copyright 2021 elven cache. All rights reserved.
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+*/
+
+#include "../common/common.sh"
+
+// struct ModelUniforms
+uniform vec4 u_modelParams[2];
+
+#define u_color (u_modelParams[0].xyz)
+#define u_lightPosition (u_modelParams[1].xyz)
+
+
+int ModHelper (float a, float b)
+{
+ return int( a - (b*floor(a/b)));
+}
+
+vec3 GetGridColor (vec2 position, float width, vec3 color)
+{
+ position = abs(floor( position + vec2(-width, -width) ));
+ int posXMod = ModHelper(position.x, 2.0);
+ int posYMod = ModHelper(position.y, 2.0);
+ float gridColorScale = (posXMod == posYMod) ? 0.75 : 1.25;
+ return toLinear(color) * gridColorScale;
+}
+
+void main()
+{
+ vec3 worldSpacePosition = v_texcoord1.xyz; // contains ws pos
+ vec2 gridCoord = worldSpacePosition.xz; // assuming y is up
+ vec3 gridColor = GetGridColor(gridCoord.xy, 0.002, u_color);
+
+ // get vertex normal
+ vec3 normal = normalize(v_normal);
+
+ vec3 light = (u_lightPosition - worldSpacePosition);
+ light = normalize(light);
+
+ float NdotL = saturate(dot(normal, light));
+ float diffuse = NdotL * 1.0;
+
+ vec3 V = v_texcoord2.xyz; // contains view vector
+ vec3 H = normalize(V+light);
+ float NdotH = saturate(dot(normal, H));
+ float specular = 5.0 * pow(NdotH, 256);
+ float ambient = 0.1;
+
+ float lightAmount = ambient + diffuse;
+ vec3 color = gridColor * lightAmount + specular;
+
+ // leave color in linear space for better dof filter result
+
+ gl_FragColor = vec4(color, 1.0);
+}
diff --git a/3rdparty/bgfx/examples/46-fsr/fsr.cpp b/3rdparty/bgfx/examples/46-fsr/fsr.cpp
new file mode 100644
index 00000000000..39d9eff2ef8
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/fsr.cpp
@@ -0,0 +1,346 @@
+/*
+* Copyright 2021 Richard Schubert. All rights reserved.
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+*
+* AMD FidelityFX Super Resolution 1.0 (FSR)
+* Based on https://github.com/GPUOpen-Effects/FidelityFX-FSR/blob/master/sample/
+*/
+
+#include "fsr.h"
+
+#include <bgfx_utils.h>
+
+struct FsrResources
+{
+ void init(uint32_t _width, uint32_t _height)
+ {
+ resize(_width, _height);
+
+ // Create uniforms for screen passes and models
+ m_uniforms.init();
+
+ // Create texture sampler uniforms (used when we bind textures)
+ s_inputTexture = bgfx::createUniform("InputTexture", bgfx::UniformType::Sampler);
+
+ // Create program from shaders.
+ m_bilinear32Program = bgfx::createProgram(loadShader("cs_fsr_bilinear_32"), true);
+ m_easu32Program = bgfx::createProgram(loadShader("cs_fsr_easu_32"), true);
+ m_rcas32Program = bgfx::createProgram(loadShader("cs_fsr_rcas_32"), true);
+
+ m_support16BitPrecision = (bgfx::getRendererType() != bgfx::RendererType::OpenGL);
+
+ if (m_support16BitPrecision)
+ {
+ m_bilinear16Program = bgfx::createProgram(loadShader("cs_fsr_bilinear_16"), true);
+ m_easu16Program = bgfx::createProgram(loadShader("cs_fsr_easu_16"), true);
+ m_rcas16Program = bgfx::createProgram(loadShader("cs_fsr_rcas_16"), true);
+ }
+ }
+
+ void destroy()
+ {
+ if (m_support16BitPrecision)
+ {
+ bgfx::destroy(m_bilinear16Program);
+ m_bilinear16Program = BGFX_INVALID_HANDLE;
+
+ bgfx::destroy(m_easu16Program);
+ m_easu16Program = BGFX_INVALID_HANDLE;
+
+ bgfx::destroy(m_rcas16Program);
+ m_rcas16Program = BGFX_INVALID_HANDLE;
+ }
+
+ bgfx::destroy(m_bilinear32Program);
+ m_bilinear32Program = BGFX_INVALID_HANDLE;
+
+ bgfx::destroy(m_easu32Program);
+ m_easu32Program = BGFX_INVALID_HANDLE;
+
+ bgfx::destroy(m_rcas32Program);
+ m_rcas32Program = BGFX_INVALID_HANDLE;
+
+ m_uniforms.destroy();
+
+ bgfx::destroy(s_inputTexture);
+ s_inputTexture = BGFX_INVALID_HANDLE;
+
+ if (bgfx::isValid(m_easuTexture16F) )
+ {
+ bgfx::destroy(m_easuTexture16F);
+ m_easuTexture16F = BGFX_INVALID_HANDLE;
+
+ bgfx::destroy(m_rcasTexture16F);
+ m_rcasTexture16F = BGFX_INVALID_HANDLE;
+ }
+
+ if (bgfx::isValid(m_easuTexture32F) )
+ {
+ bgfx::destroy(m_easuTexture32F);
+ m_easuTexture32F = BGFX_INVALID_HANDLE;
+
+ bgfx::destroy(m_rcasTexture32F);
+ m_rcasTexture32F = BGFX_INVALID_HANDLE;
+ }
+ }
+
+ void resize(uint32_t _width, uint32_t _height)
+ {
+ m_width = _width;
+ m_height = _height;
+
+ if (bgfx::isValid(m_easuTexture16F) )
+ {
+ bgfx::destroy(m_easuTexture16F);
+ m_easuTexture16F = BGFX_INVALID_HANDLE;
+
+ bgfx::destroy(m_rcasTexture16F);
+ m_rcasTexture16F = BGFX_INVALID_HANDLE;
+ }
+
+ if (bgfx::isValid(m_easuTexture32F) )
+ {
+ bgfx::destroy(m_easuTexture32F);
+ bgfx::destroy(m_rcasTexture32F);
+ }
+
+ if (m_support16BitPrecision)
+ {
+ m_easuTexture16F = bgfx::createTexture2D(
+ uint16_t(m_width)
+ , uint16_t(m_height)
+ , false
+ , 1
+ , bgfx::TextureFormat::RGBA16F
+ , BGFX_TEXTURE_COMPUTE_WRITE | BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP
+ );
+ bgfx::setName(m_easuTexture16F, "easuTexture16F");
+
+ m_rcasTexture16F = bgfx::createTexture2D(
+ uint16_t(m_width)
+ , uint16_t(m_height)
+ , false
+ , 1
+ , bgfx::TextureFormat::RGBA16F
+ , BGFX_TEXTURE_COMPUTE_WRITE | BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP
+ );
+ bgfx::setName(m_rcasTexture16F, "rcasTexture16F");
+ }
+
+ m_easuTexture32F = bgfx::createTexture2D(
+ uint16_t(m_width)
+ , uint16_t(m_height)
+ , false
+ , 1
+ , bgfx::TextureFormat::RGBA32F
+ , BGFX_TEXTURE_COMPUTE_WRITE | BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP
+ );
+ bgfx::setName(m_easuTexture32F, "easuTexture32F");
+
+ m_rcasTexture32F = bgfx::createTexture2D(
+ uint16_t(m_width)
+ , uint16_t(m_height)
+ , false
+ , 1
+ , bgfx::TextureFormat::RGBA32F
+ , BGFX_TEXTURE_COMPUTE_WRITE | BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT | BGFX_SAMPLER_U_CLAMP | BGFX_SAMPLER_V_CLAMP
+ );
+ bgfx::setName(m_rcasTexture32F, "rcasTexture32F");
+ }
+
+ struct Uniforms
+ {
+ struct Vec4
+ {
+ float x;
+ float y;
+ float z;
+ float w;
+ };
+
+ enum
+ {
+ NumVec4 = 3
+ };
+
+ void init()
+ {
+ u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4, NumVec4);
+ };
+
+ void submit() const
+ {
+ bgfx::setUniform(u_params, m_params, NumVec4);
+ }
+
+ void destroy()
+ {
+ bgfx::destroy(u_params);
+ }
+
+ union
+ {
+ struct
+ {
+ Vec4 ViewportSizeRcasAttenuation;
+ Vec4 SrcSize;
+ Vec4 DstSize;
+ };
+
+ uint32_t m_params[NumVec4 * 4];
+ };
+
+ bgfx::UniformHandle u_params = BGFX_INVALID_HANDLE;
+ };
+
+ uint32_t m_width = 0;
+ uint32_t m_height = 0;
+ bool m_support16BitPrecision = false;
+
+ // Resource handles
+ bgfx::ProgramHandle m_bilinear16Program = BGFX_INVALID_HANDLE;
+ bgfx::ProgramHandle m_easu16Program = BGFX_INVALID_HANDLE;
+ bgfx::ProgramHandle m_rcas16Program = BGFX_INVALID_HANDLE;
+ bgfx::TextureHandle m_easuTexture16F = BGFX_INVALID_HANDLE;
+ bgfx::TextureHandle m_rcasTexture16F = BGFX_INVALID_HANDLE;
+
+ bgfx::ProgramHandle m_bilinear32Program = BGFX_INVALID_HANDLE;
+ bgfx::ProgramHandle m_easu32Program = BGFX_INVALID_HANDLE;
+ bgfx::ProgramHandle m_rcas32Program = BGFX_INVALID_HANDLE;
+ bgfx::TextureHandle m_easuTexture32F = BGFX_INVALID_HANDLE;
+ bgfx::TextureHandle m_rcasTexture32F = BGFX_INVALID_HANDLE;
+
+ // Shader uniforms
+ Uniforms m_uniforms;
+
+ // Uniforms to identify texture samplers
+ bgfx::UniformHandle s_inputTexture = BGFX_INVALID_HANDLE;
+
+};
+
+Fsr::Fsr()
+{
+ m_resources = new FsrResources();
+}
+
+Fsr::~Fsr()
+{
+ delete m_resources;
+}
+
+void Fsr::init(uint32_t _width, uint32_t _height)
+{
+ m_resources->init(_width, _height);
+}
+
+void Fsr::destroy()
+{
+ m_resources->destroy();
+}
+
+void Fsr::resize(uint32_t _width, uint32_t _height)
+{
+ m_resources->resize(_width, _height);
+}
+
+bgfx::ViewId Fsr::computeFsr(bgfx::ViewId _pass, bgfx::TextureHandle _colorTexture)
+{
+ updateUniforms();
+
+ bgfx::ViewId view = _pass;
+
+ // This value is the image region dimension that each thread group of the FSR shader operates on
+ constexpr int threadGroupWorkRegionDim = 16;
+
+ const int32_t dispatchX = (m_resources->m_width + (threadGroupWorkRegionDim - 1) ) / threadGroupWorkRegionDim;
+ const int32_t dispatchY = (m_resources->m_height + (threadGroupWorkRegionDim - 1) ) / threadGroupWorkRegionDim;
+
+ bgfx::TextureFormat::Enum const format = m_config.m_fsr16Bit
+ ? bgfx::TextureFormat::RGBA16F
+ : bgfx::TextureFormat::RGBA32F
+ ;
+
+ bgfx::TextureHandle fsrEasuTexture = m_config.m_fsr16Bit
+ ? m_resources->m_easuTexture16F
+ : m_resources->m_easuTexture32F
+ ;
+
+ // EASU pass (upscale)
+ {
+ bgfx::ProgramHandle program = m_config.m_fsr16Bit
+ ? m_resources->m_easu16Program
+ : m_resources->m_easu32Program
+ ;
+
+ if (!m_config.m_applyFsr)
+ {
+ program = m_resources->m_bilinear32Program;
+ }
+
+ bgfx::setViewName(view, "fsr easu");
+ m_resources->m_uniforms.submit();
+ bgfx::setTexture(0, m_resources->s_inputTexture, _colorTexture);
+ bgfx::setImage(1, fsrEasuTexture, 0, bgfx::Access::Write, format);
+ bgfx::dispatch(view, program, dispatchX, dispatchY, 1);
+ ++view;
+ }
+
+ // RCAS pass (sharpening)
+ if (m_config.m_applyFsrRcas)
+ {
+ bgfx::ProgramHandle program = m_config.m_fsr16Bit
+ ? m_resources->m_rcas16Program
+ : m_resources->m_rcas32Program
+ ;
+
+ bgfx::setViewName(view, "fsr rcas");
+ m_resources->m_uniforms.submit();
+ bgfx::setTexture(0, m_resources->s_inputTexture, fsrEasuTexture);
+ bgfx::setImage(
+ 1
+ , m_config.m_fsr16Bit? m_resources->m_rcasTexture16F: m_resources->m_rcasTexture32F
+ , 0
+ , bgfx::Access::Write
+ , format
+ );
+ bgfx::dispatch(view, program, dispatchX, dispatchY, 1);
+ ++view;
+ }
+
+ return view;
+}
+
+bgfx::TextureHandle Fsr::getResultTexture() const
+{
+ if (m_config.m_applyFsr && m_config.m_applyFsrRcas)
+ {
+ return m_config.m_fsr16Bit
+ ? m_resources->m_rcasTexture16F
+ : m_resources->m_rcasTexture32F
+ ;
+ }
+
+ return m_config.m_fsr16Bit
+ ? m_resources->m_easuTexture16F
+ : m_resources->m_easuTexture32F
+ ;
+}
+
+bool Fsr::supports16BitPrecision() const
+{
+ return m_resources->m_support16BitPrecision;
+}
+
+void Fsr::updateUniforms()
+{
+ const float srcWidth = float(m_resources->m_width) / m_config.m_superSamplingFactor;
+ const float srcHeight = float(m_resources->m_height) / m_config.m_superSamplingFactor;
+
+ m_resources->m_uniforms.ViewportSizeRcasAttenuation.x = srcWidth;
+ m_resources->m_uniforms.ViewportSizeRcasAttenuation.y = srcHeight;
+ m_resources->m_uniforms.ViewportSizeRcasAttenuation.z = m_config.m_rcasAttenuation;
+ m_resources->m_uniforms.SrcSize.x = float(m_resources->m_width);
+ m_resources->m_uniforms.SrcSize.y = float(m_resources->m_height);
+ m_resources->m_uniforms.DstSize.x = float(m_resources->m_width);
+ m_resources->m_uniforms.DstSize.y = float(m_resources->m_height);
+}
diff --git a/3rdparty/bgfx/examples/46-fsr/fsr.h b/3rdparty/bgfx/examples/46-fsr/fsr.h
new file mode 100644
index 00000000000..63dd3c3fbc7
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/fsr.h
@@ -0,0 +1,46 @@
+/*
+ * Copyright 2021 Richard Schubert. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ *
+ * AMD FidelityFX Super Resolution 1.0 (FSR)
+ * Based on https://github.com/GPUOpen-Effects/FidelityFX-FSR/blob/master/sample/
+ */
+
+#ifndef __FSR_H__
+#define __FSR_H__
+
+#include <bgfx/bgfx.h>
+
+class Fsr
+{
+public:
+
+ struct Config
+ {
+ float m_superSamplingFactor = 2.0f;
+ float m_rcasAttenuation = 0.2f;
+ bool m_applyFsr = true;
+ bool m_applyFsrRcas = true;
+ bool m_fsr16Bit = false;
+ };
+
+ Config m_config;
+
+ Fsr();
+ ~Fsr();
+
+ void init(uint32_t _width, uint32_t _height);
+ void destroy();
+ void resize(uint32_t _width, uint32_t _height);
+
+ bgfx::ViewId computeFsr(bgfx::ViewId _pass, bgfx::TextureHandle _colorTexture);
+ bgfx::TextureHandle getResultTexture() const;
+ bool supports16BitPrecision() const;
+
+private:
+ void updateUniforms();
+
+ struct FsrResources *m_resources;
+};
+
+#endif // __FSR_H__
diff --git a/3rdparty/bgfx/examples/46-fsr/makefile b/3rdparty/bgfx/examples/46-fsr/makefile
new file mode 100644
index 00000000000..19c81e43692
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/makefile
@@ -0,0 +1,10 @@
+#
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+#
+
+BGFX_DIR=../..
+RUNTIME_DIR=$(BGFX_DIR)/examples/runtime
+BUILD_DIR=../../.build
+
+include $(BGFX_DIR)/scripts/shader.mk
diff --git a/3rdparty/bgfx/examples/46-fsr/screenshot.png b/3rdparty/bgfx/examples/46-fsr/screenshot.png
new file mode 100644
index 00000000000..4dd18cab214
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/screenshot.png
Binary files differ
diff --git a/3rdparty/bgfx/examples/46-fsr/varying.def.sc b/3rdparty/bgfx/examples/46-fsr/varying.def.sc
new file mode 100644
index 00000000000..4c827e4af32
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/varying.def.sc
@@ -0,0 +1,9 @@
+vec4 a_position : POSITION;
+vec2 a_texcoord0 : TEXCOORD0;
+vec3 a_normal : NORMAL;
+
+vec2 v_texcoord0 : TEXCOORD0;
+vec4 v_texcoord1 : TEXCOORD1;
+vec4 v_texcoord2 : TEXCOORD2;
+vec4 v_texcoord3 : TEXCOORD3;
+vec3 v_normal : NORMAL = vec3(0.0, 0.0, 1.0);
diff --git a/3rdparty/bgfx/examples/46-fsr/vs_fsr_forward.sc b/3rdparty/bgfx/examples/46-fsr/vs_fsr_forward.sc
new file mode 100644
index 00000000000..fa221b01e52
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/vs_fsr_forward.sc
@@ -0,0 +1,34 @@
+$input a_position, a_normal
+$output v_normal, v_texcoord0, v_texcoord1, v_texcoord2
+
+/*
+* Copyright 2021 elven cache. All rights reserved.
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+*/
+
+#include "../common/common.sh"
+
+void main()
+{
+ // Calculate vertex position
+ vec3 pos = a_position.xyz;
+ gl_Position = mul(u_modelViewProj, vec4(pos, 1.0));
+
+ vec3 wsPos = mul(u_model[0], vec4(pos, 1.0)).xyz;
+
+ // Calculate normal, unpack
+ vec3 osNormal = a_normal.xyz * 2.0 - 1.0;
+
+ // Transform normal into world space
+ vec3 wsNormal = mul(u_model[0], vec4(osNormal, 0.0)).xyz;
+
+ v_normal.xyz = normalize(wsNormal);
+ v_texcoord0 = a_position.xy * vec2_splat(0.5); // the used mesh does not provide texture coordinates
+
+ // Store world space view vector in extra texCoord attribute
+ vec3 wsCamPos = mul(u_invView, vec4(0.0, 0.0, 0.0, 1.0)).xyz;
+ vec3 view = normalize(wsCamPos - wsPos);
+
+ v_texcoord1 = vec4(wsPos, 1.0);
+ v_texcoord2 = vec4(view, 1.0);
+}
diff --git a/3rdparty/bgfx/examples/46-fsr/vs_fsr_screenquad.sc b/3rdparty/bgfx/examples/46-fsr/vs_fsr_screenquad.sc
new file mode 100644
index 00000000000..5b137dc5c3b
--- /dev/null
+++ b/3rdparty/bgfx/examples/46-fsr/vs_fsr_screenquad.sc
@@ -0,0 +1,10 @@
+$input a_position, a_texcoord0
+$output v_texcoord0
+
+#include "../common/common.sh"
+
+void main()
+{
+ gl_Position = mul(u_modelViewProj, vec4(a_position.xyz, 1.0));
+ v_texcoord0 = a_texcoord0;
+}
diff --git a/3rdparty/bgfx/examples/47-pixelformats/makefile b/3rdparty/bgfx/examples/47-pixelformats/makefile
new file mode 100644
index 00000000000..19c81e43692
--- /dev/null
+++ b/3rdparty/bgfx/examples/47-pixelformats/makefile
@@ -0,0 +1,10 @@
+#
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+#
+
+BGFX_DIR=../..
+RUNTIME_DIR=$(BGFX_DIR)/examples/runtime
+BUILD_DIR=../../.build
+
+include $(BGFX_DIR)/scripts/shader.mk
diff --git a/3rdparty/bgfx/examples/47-pixelformats/pixelformats.cpp b/3rdparty/bgfx/examples/47-pixelformats/pixelformats.cpp
new file mode 100644
index 00000000000..7a78f36723d
--- /dev/null
+++ b/3rdparty/bgfx/examples/47-pixelformats/pixelformats.cpp
@@ -0,0 +1,827 @@
+/*
+ * Copyright 2022-2022 Sandy Carter. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ */
+
+#include "common.h"
+#include "bgfx_utils.h"
+#include "imgui/imgui.h"
+
+#include <bx/allocator.h>
+#include <bx/math.h>
+
+#include <bimg/decode.h>
+
+#include <tinystl/string.h>
+#include <tinystl/vector.h>
+namespace stl = tinystl;
+
+namespace
+{
+
+constexpr int32_t kCheckerboardSize = 128;
+constexpr int32_t kFirstUncompressedFormatIndex = bgfx::TextureFormat::Unknown + 1;
+constexpr int32_t kNumCompressedFormats = bgfx::TextureFormat::Unknown;
+constexpr int32_t kNumUncompressedFormats = bgfx::TextureFormat::UnknownDepth - kFirstUncompressedFormatIndex;
+constexpr int32_t kNumFormats = kNumCompressedFormats + kNumUncompressedFormats;
+const int32_t kNumFormatsInRow = (int32_t)bx::ceil(1.2f * bx::sqrt(kNumFormats) );
+
+inline int32_t formatToIndex(bimg::TextureFormat::Enum format)
+{
+ int32_t index = format;
+ if (index >= kFirstUncompressedFormatIndex)
+ {
+ --index;
+ }
+ return index;
+}
+
+inline bimg::TextureFormat::Enum indexToFormat(int32_t index)
+{
+ if (index < kNumCompressedFormats)
+ {
+ return bimg::TextureFormat::Enum(index);
+ }
+ else if (index >= kNumCompressedFormats && index < kNumFormats)
+ {
+ return bimg::TextureFormat::Enum(index + 1);
+ }
+ else
+ {
+ return bimg::TextureFormat::Unknown;
+ }
+}
+
+struct TextureStatus
+{
+ enum Enum
+ {
+ Ok,
+ NotInitialized,
+ FormatNotSupported,
+ ConversionNotSupported,
+ FormatIgnored
+ };
+
+ inline static const char* getDescription(Enum value)
+ {
+ switch (value)
+ {
+ case Ok: return "Ok";
+ case NotInitialized: return "Texture was not initialized";
+ case FormatNotSupported: return "Format not supported by GPU/backend";
+ case ConversionNotSupported: return "Conversion from RGBA8 not supported";
+ case FormatIgnored: return "Format is ignored by this example";
+ }
+
+ return "Unknown";
+ }
+
+ inline static bool isError(Enum value)
+ {
+ return value == FormatNotSupported
+ || value == ConversionNotSupported
+ ;
+ }
+};
+
+struct Texture
+{
+ uint16_t m_width = 0;
+ uint16_t m_height = 0;
+ TextureStatus::Enum m_status = TextureStatus::NotInitialized;
+ bgfx::TextureHandle m_texture = BGFX_INVALID_HANDLE;
+};
+
+struct TextureSet
+{
+ stl::string m_name;
+ uint16_t m_maxWidth = 0;
+ uint16_t m_maxHeight = 0;
+ bool m_hasCompressedTextures = false;
+ Texture m_textures[kNumFormats];
+};
+
+static bimg::ImageContainer* generateHueWheelImage()
+{
+ constexpr int32_t kTextureSize = 256;
+ constexpr int32_t kHalfTextureSize = kTextureSize / 2;
+
+ bimg::ImageContainer* image = bimg::imageAlloc(
+ entry::getAllocator(),
+ bimg::TextureFormat::RGBA32F,
+ kTextureSize,
+ kTextureSize,
+ 1,
+ 1,
+ false,
+ false,
+ NULL
+ );
+ if (NULL == image)
+ {
+ return NULL;
+ }
+
+ float* rgbaf32Pixels = (float*)image->m_data;
+
+ for (int32_t y = 0 ; y < kTextureSize; ++y)
+ {
+ for (int32_t x = 0; x < kTextureSize; ++x)
+ {
+ float relX = (x - kHalfTextureSize) / (float) kHalfTextureSize;
+ float relY = (y - kHalfTextureSize) / (float) kHalfTextureSize;
+ float distance = bx::min(1.0f, bx::sqrt(relX * relX + relY * relY) );
+ float angle = bx::atan2(relY, relX);
+ float* pixel = &rgbaf32Pixels[(x + y * kTextureSize) * 4];
+ float hsv[3] = {angle / (2.0f * bx::kPi), 1.0f, 1.0f - distance};
+ bx::hsvToRgb(pixel, hsv);
+ pixel[3] = 1.0f - distance;
+ }
+ }
+
+ for (int32_t y = 0; y < 16; ++y)
+ {
+ for (int32_t x = 0; x < 16; ++x)
+ {
+ float* r = &rgbaf32Pixels[(x + (kTextureSize - 36 + y) * kTextureSize) * 4];
+ r[0] = 1.0f;
+ r[1] = 0.0f;
+ r[2] = 0.0f;
+ r[3] = 1.0f;
+
+ float* g = &rgbaf32Pixels[(x + 16 + (kTextureSize - 36 + y) * kTextureSize) * 4];
+ g[0] = 0.0f;
+ g[1] = 1.0f;
+ g[2] = 0.0f;
+ g[3] = 1.0f;
+
+ float* b = &rgbaf32Pixels[(x + 32 + (kTextureSize - 36 + y) * kTextureSize) * 4];
+ b[0] = 0.0f;
+ b[1] = 0.0f;
+ b[2] = 1.0f;
+ b[3] = 1.0f;
+ }
+ }
+
+ for (int32_t y = 0; y < 16; ++y)
+ {
+ for (int32_t x = 0; x < 48; ++x)
+ {
+ float* a = &rgbaf32Pixels[(x + (kTextureSize - 20 + y) * kTextureSize) * 4];
+ a[0] = 1.0f;
+ a[1] = 1.0f;
+ a[2] = 1.0f;
+ a[3] = 1.0f - (float)x / 48.0f;
+ }
+ }
+
+ return image;
+}
+
+static void textureSetPopulateCompressedFormat(TextureSet& textureSet, bimg::ImageContainer* source, bool freeImage = true)
+{
+ if (NULL == source)
+ {
+ return;
+ }
+
+ uint32_t textureIndex = indexToFormat(source->m_format);
+ Texture& texture = textureSet.m_textures[textureIndex];
+
+ if (bgfx::isValid(texture.m_texture) || texture.m_status == TextureStatus::FormatNotSupported)
+ {
+ if (freeImage)
+ {
+ bimg::imageFree(source);
+ }
+
+ return;
+ }
+
+ bimg::ImageMip mip0;
+ bimg::imageGetRawData(
+ *source
+ , 0
+ , 0
+ , source->m_data
+ , source->m_size
+ , mip0
+ );
+
+ texture.m_width = uint16_t(mip0.m_width);
+ texture.m_height = uint16_t(mip0.m_height);
+ texture.m_status = TextureStatus::Ok;
+ texture.m_texture = bgfx::createTexture2D(
+ uint16_t(mip0.m_width)
+ , uint16_t(mip0.m_height)
+ , false
+ , 1
+ , bgfx::TextureFormat::Enum(mip0.m_format)
+ , BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT
+ , bgfx::copy(mip0.m_data, mip0.m_size)
+ );
+
+ bgfx::setName(texture.m_texture, bimg::getName(source->m_format) );
+
+ if (freeImage)
+ {
+ bimg::imageFree(source);
+ }
+
+ textureSet.m_maxWidth = bx::max(textureSet.m_maxWidth, texture.m_width);
+ textureSet.m_maxHeight = bx::max(textureSet.m_maxHeight, texture.m_height);
+}
+
+static void textureSetPopulateUncompressedFormats(TextureSet& textureSet, bimg::ImageContainer* source, bool freeImage = true)
+{
+ if (NULL == source)
+ {
+ return;
+ }
+
+ const uint32_t flags = 0
+ | BGFX_SAMPLER_MIN_POINT
+ | BGFX_SAMPLER_MAG_POINT
+ ;
+
+ for (int32_t i = 0; i < kNumUncompressedFormats; ++i)
+ {
+ int32_t textureIndex = kNumCompressedFormats + i;
+
+ Texture& texture = textureSet.m_textures[textureIndex];
+
+ if (bgfx::isValid(texture.m_texture) || texture.m_status == TextureStatus::FormatNotSupported)
+ {
+ continue;
+ }
+
+ bimg::TextureFormat::Enum format = indexToFormat(textureIndex);
+ const char* formatName = bimg::getName(format);
+ int32_t formatNameLen = bx::strLen(formatName);
+
+ if (!bimg::imageConvert(format, source->m_format) )
+ {
+ texture.m_status = TextureStatus::ConversionNotSupported;
+ continue;
+ }
+
+ if ( formatName[formatNameLen - 1] == 'I'
+ || formatName[formatNameLen - 1] == 'U')
+ {
+ texture.m_status = TextureStatus::FormatIgnored;
+ continue;
+ }
+
+ bimg::TextureInfo info;
+ bimg::imageGetSize(
+ &info
+ , uint16_t(source->m_width)
+ , uint16_t(source->m_height)
+ , 1
+ , false
+ , false
+ , 1
+ , format
+ );
+
+ const bgfx::Memory* mem = bgfx::alloc(info.storageSize);
+ bimg::imageConvert(
+ entry::getAllocator()
+ , mem->data
+ , info.format
+ , source->m_data
+ , source->m_format
+ , source->m_width
+ , source->m_height
+ , 1
+ );
+
+ texture.m_width = info.width;
+ texture.m_height = info.height;
+ texture.m_status = TextureStatus::Ok;
+ texture.m_texture = bgfx::createTexture2D(
+ info.width
+ , info.height
+ , info.numMips > 1
+ , info.numLayers
+ , bgfx::TextureFormat::Enum(info.format)
+ , flags
+ , mem
+ );
+
+ bgfx::setName(texture.m_texture, formatName);
+
+ textureSet.m_maxWidth = bx::max(textureSet.m_maxWidth, texture.m_width);
+ textureSet.m_maxHeight = bx::max(textureSet.m_maxHeight, texture.m_height);
+ }
+
+ if (freeImage)
+ {
+ bimg::imageFree(source);
+ }
+}
+
+static TextureSet makeEmptyTextureSet(const char* name)
+{
+ TextureSet textureSet;
+ textureSet.m_name = name;
+
+ for (int32_t i = 0; i < kNumFormats; ++i)
+ {
+ bimg::TextureFormat::Enum format = indexToFormat(i);
+
+ if (!bgfx::isTextureValid(
+ 1
+ , false
+ , 1
+ , bgfx::TextureFormat::Enum(format)
+ , BGFX_TEXTURE_NONE
+ ) )
+ {
+ textureSet.m_textures[i].m_status = TextureStatus::FormatNotSupported;
+ }
+ }
+
+ return textureSet;
+}
+
+static TextureSet generateTextureSetFromImage(const char* name, bimg::ImageContainer* source, bool freeImage = true)
+{
+ TextureSet textureSet = makeEmptyTextureSet(name);
+
+ if (NULL == source)
+ {
+ return textureSet;
+ }
+
+ textureSetPopulateUncompressedFormats(textureSet, source, freeImage);
+
+ return textureSet;
+}
+
+static TextureSet generateTextureSetFromFileSet(const char* name, const char* filePaths[])
+{
+ TextureSet textureSet = makeEmptyTextureSet(name);
+
+ while (NULL != *filePaths)
+ {
+ const char* filePath = *filePaths++;
+
+ uint32_t size;
+ void* data = load(filePath, &size);
+ if (NULL == data)
+ {
+ continue;
+ }
+
+ bimg::ImageContainer* image = bimg::imageParse(entry::getAllocator(), data, size);
+ if (NULL == image)
+ {
+ unload(data);
+ continue;
+ }
+
+ if (bimg::isCompressed(image->m_format) )
+ {
+ textureSet.m_hasCompressedTextures = true;
+
+ textureSetPopulateCompressedFormat(textureSet, image);
+ }
+ else
+ {
+ textureSetPopulateUncompressedFormats(textureSet, image);
+ }
+ }
+
+ return textureSet;
+}
+
+static TextureSet generateTextureSetFromFile(const char* filePath)
+{
+ const char* filePaths[] =
+ {
+ filePath,
+ nullptr
+ };
+
+ return generateTextureSetFromFileSet(bx::FilePath(filePath).getFileName().getPtr(), filePaths);
+}
+
+class ExamplePixelFormats : public entry::AppI
+{
+public:
+ ExamplePixelFormats(const char* _name, const char* _description, const char* _url)
+ : entry::AppI(_name, _description, _url)
+ {
+ }
+
+ void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) override
+ {
+ Args args(_argc, _argv);
+
+ m_width = _width;
+ m_height = _height;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_VSYNC;
+
+ bgfx::Init init;
+ init.type = args.m_type;
+ init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
+ init.resolution.width = m_width;
+ init.resolution.height = m_height;
+ init.resolution.reset = m_reset;
+ bgfx::init(init);
+
+ // Enable debug text.
+ bgfx::setDebug(m_debug);
+
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
+
+ const bgfx::Memory* checkerboardImageMemory = bgfx::alloc(kCheckerboardSize * kCheckerboardSize * 4);
+ bimg::imageCheckerboard(
+ checkerboardImageMemory->data
+ , kCheckerboardSize
+ , kCheckerboardSize
+ , 16
+ , 0xFF909090
+ , 0xFF707070
+ );
+ m_checkerboard = bgfx::createTexture2D(
+ kCheckerboardSize
+ , kCheckerboardSize
+ , false
+ , 1
+ , bgfx::TextureFormat::RGBA8
+ , BGFX_SAMPLER_MIN_POINT | BGFX_SAMPLER_MAG_POINT
+ , checkerboardImageMemory
+ );
+
+ m_textureSets.push_back(generateTextureSetFromImage("Hue Wheel", generateHueWheelImage() ) );
+ m_textureSets.push_back(generateTextureSetFromFile("textures/pf_alpha_test.dds") );
+ m_textureSets.push_back(generateTextureSetFromFile("textures/pf_uv_filtering_test.dds") );
+ const char* textureCompressionSetFiles[] =
+ {
+ "textures/texture_compression_astc_4x4.dds",
+ "textures/texture_compression_astc_5x4.dds",
+ "textures/texture_compression_astc_5x5.dds",
+ "textures/texture_compression_astc_6x5.dds",
+ "textures/texture_compression_astc_6x6.dds",
+ "textures/texture_compression_astc_8x5.dds",
+ "textures/texture_compression_astc_8x6.dds",
+ "textures/texture_compression_astc_8x8.dds",
+ "textures/texture_compression_astc_10x5.dds",
+ "textures/texture_compression_astc_10x6.dds",
+ "textures/texture_compression_astc_10x8.dds",
+ "textures/texture_compression_astc_10x10.dds",
+ "textures/texture_compression_astc_12x10.dds",
+ "textures/texture_compression_astc_12x12.dds",
+ "textures/texture_compression_atc.dds",
+ "textures/texture_compression_atce.dds",
+ "textures/texture_compression_atci.dds",
+ "textures/texture_compression_bc1.ktx",
+ "textures/texture_compression_bc2.ktx",
+ "textures/texture_compression_bc3.ktx",
+ "textures/texture_compression_bc7.ktx",
+ "textures/texture_compression_etc1.ktx",
+ "textures/texture_compression_etc2.ktx",
+ "textures/texture_compression_ptc12.pvr",
+ "textures/texture_compression_ptc14.pvr",
+ "textures/texture_compression_ptc22.pvr",
+ "textures/texture_compression_ptc24.pvr",
+ "textures/texture_compression_rgba8.dds",
+ nullptr
+ };
+ m_textureSets.push_back(generateTextureSetFromFileSet("texture_compression_* set", textureCompressionSetFiles));
+
+ m_currentTextureSet = &m_textureSets[0];
+
+ for (auto& textureSet : m_textureSets)
+ {
+ m_largestTextureSize = bx::max(m_largestTextureSize, float(bx::max(textureSet.m_maxWidth, textureSet.m_maxHeight)));
+ }
+
+ imguiCreate();
+ }
+
+ int32_t shutdown() override
+ {
+ imguiDestroy();
+
+ for (auto& textureSet : m_textureSets)
+ {
+ for (auto texture : textureSet.m_textures)
+ {
+ if (bgfx::isValid(texture.m_texture) )
+ {
+ bgfx::destroy(texture.m_texture);
+ }
+ }
+ }
+
+ if (bgfx::isValid(m_checkerboard) )
+ {
+ bgfx::destroy(m_checkerboard);
+ }
+
+ // Shutdown bgfx.
+ bgfx::shutdown();
+
+ return 0;
+ }
+
+ void imguiTextBoxUnformatted(const ImVec2& size, const char* text) const
+ {
+ ImVec2 textSize = ImGui::CalcTextSize(text);
+ ImVec2 textOffset = ImVec2(
+ size.x >= 0.0f ? bx::max( (size.x - textSize.x) / 2, 0.0f) : 0.0f
+ , size.y >= 0.0f ? bx::max( (size.y - textSize.y) / 2, 0.0f) : 0.0f
+ );
+ ImGui::SetCursorPos(ImVec2(
+ ImGui::GetCursorPosX() + textOffset.x
+ , ImGui::GetCursorPosY() + textOffset.y
+ ) );
+ ImGui::TextUnformatted(text);
+ };
+
+ void imguiStrikethroughItem()
+ {
+ ImVec2 itemSize = ImGui::GetItemRectSize();
+ if (itemSize.x <= 0.0f || itemSize.y <= 0.0f)
+ return;
+
+ ImVec2 p0 = ImGui::GetItemRectMin();
+ ImVec2 p1 = ImGui::GetItemRectMax();
+ p0.y = p1.y = p0.y + itemSize.y * 0.5f;
+
+ ImGui::GetWindowDrawList()->AddLine(p0, p1, ImGui::GetColorU32(ImGuiCol_Text) );
+ }
+
+ void imguiTexturePreview(const ImVec2& size, bgfx::TextureHandle texture, const ImVec2& previewSizeHint = ImVec2(-1.0f, -1.0f) ) const
+ {
+ ImVec2 origin = ImGui::GetCursorScreenPos();
+
+ ImVec2 previewSize = ImVec2(
+ previewSizeHint.x >= 0.0f ? previewSizeHint.x : size.x
+ , previewSizeHint.y >= 0.0f ? previewSizeHint.y : size.y
+ );
+
+ ImVec2 previewPos = ImVec2(
+ origin.x + bx::max(0.0f, (size.x - previewSize.x) / 2)
+ , origin.y + bx::max(0.0f, (size.y - previewSize.y) / 2)
+ );
+
+ if (bgfx::isValid(texture) )
+ {
+ if (bgfx::isValid(m_checkerboard) )
+ {
+ static int64_t timeOffset = bx::getHPCounter();
+ const float time = float( (bx::getHPCounter()-timeOffset)/double(bx::getHPFrequency() ) );
+ const float animate = float(m_animate)*0.5f;
+ const float xx = bx::sin(time * 0.37f) * animate;
+ const float yy = bx::cos(time * 0.43f) * animate;
+
+ const float uTile = bx::max(1.0f, previewSize.x / kCheckerboardSize);
+ const float vTile = bx::max(1.0f, previewSize.y / kCheckerboardSize);
+
+ ImGui::SetCursorScreenPos(previewPos);
+ ImGui::Image(m_checkerboard, previewSize, ImVec2(xx, yy), ImVec2(xx+uTile, yy+vTile) );
+ }
+
+ ImGui::SetCursorScreenPos(previewPos);
+ ImGui::Image(texture, m_useAlpha ? IMGUI_FLAGS_ALPHA_BLEND : IMGUI_FLAGS_NONE, 0, previewSize);
+ }
+ else
+ {
+ ImU32 color = ImGui::GetColorU32(ImGuiCol_Text, 0.25f);
+
+ ImDrawList* drawList = ImGui::GetWindowDrawList();
+ ImVec2 p0 = previewPos;
+ ImVec2 p1 = ImVec2(p0.x + previewSize.x, p0.y + previewSize.y);
+ drawList->AddRect(p0, p1, color);
+ drawList->AddLine(p0, p1, color);
+ }
+
+ ImGui::SetCursorScreenPos(origin);
+ ImGui::Dummy(size);
+ };
+
+ bool update() override
+ {
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState) )
+ {
+ imguiBeginFrame(m_mouseState.m_mx
+ , m_mouseState.m_my
+ , (m_mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , m_mouseState.m_mz
+ , uint16_t(m_width)
+ , uint16_t(m_height)
+ );
+
+ showExampleDialog(this);
+
+ ImGui::SetNextWindowPos(ImVec2(360.0f, 40.0f), ImGuiCond_FirstUseEver);
+ ImGui::Begin("Formats", NULL, ImGuiWindowFlags_AlwaysAutoResize);
+
+ ImVec2 previewSize = ImVec2(m_previewSize, m_previewSize);
+ if (m_currentTextureSet->m_maxWidth > m_currentTextureSet->m_maxHeight)
+ previewSize.y /= float(m_currentTextureSet->m_maxWidth) / m_currentTextureSet->m_maxHeight;
+ else if (m_currentTextureSet->m_maxWidth < m_currentTextureSet->m_maxHeight)
+ previewSize.x *= float(m_currentTextureSet->m_maxWidth) / m_currentTextureSet->m_maxHeight;
+
+ float cellWidth = previewSize.x;
+ for (int32_t i = 0; i < kNumFormats; ++i)
+ {
+ int32_t format = indexToFormat(i);
+ ImVec2 textSize = ImGui::CalcTextSize(bimg::getName(bimg::TextureFormat::Enum(format) ) );
+ cellWidth = bx::max(cellWidth, textSize.x);
+ }
+
+ ImDrawList* drawList = ImGui::GetWindowDrawList();
+
+ if (ImGui::BeginCombo("Sample", m_currentTextureSet ? m_currentTextureSet->m_name.c_str() : nullptr))
+ {
+ for (auto& textureSet : m_textureSets)
+ {
+ bool isSelected = (&textureSet == m_currentTextureSet);
+ if (ImGui::Selectable(textureSet.m_name.c_str(), &isSelected))
+ {
+ m_currentTextureSet = &textureSet;
+ if (!m_currentTextureSet->m_hasCompressedTextures && formatToIndex(m_selectedFormat) < kNumCompressedFormats)
+ m_selectedFormat = bimg::TextureFormat::RGBA8;
+ }
+ }
+ ImGui::EndCombo();
+ }
+ ImGui::DragFloat("Preview Size", &m_previewSize, 1.0f, 10.0f, m_largestTextureSize, "%.0f px");
+ ImGui::SameLine();
+ ImGui::Checkbox("Alpha", &m_useAlpha);
+ ImGui::SameLine();
+ ImGui::Checkbox("Animate", &m_animate);
+ ImGui::BeginTable("Formats", kNumFormatsInRow, ImGuiTableFlags_Borders | ImGuiTableFlags_SizingFixedFit);
+
+ for (int32_t i = m_currentTextureSet->m_hasCompressedTextures ? 0 : kNumCompressedFormats; i < kNumFormats; ++i)
+ {
+ ImGui::TableNextColumn();
+
+ bimg::TextureFormat::Enum format = indexToFormat(i);
+ const Texture& texture = m_currentTextureSet->m_textures[i];
+
+ bool isSelected = (m_selectedFormat == format);
+ bool isFormatSupported = texture.m_status == TextureStatus::Ok;
+ bool isError = TextureStatus::isError(texture.m_status);
+ ImU32 labelColor = isError ? IM_COL32(255, 96, 96, 255) : ImGui::GetColorU32(isFormatSupported ? ImGuiCol_Text : ImGuiCol_TextDisabled);
+
+ ImDrawListSplitter splitter;
+ splitter.Split(drawList, 2);
+ splitter.SetCurrentChannel(drawList, 1);
+
+ ImGui::BeginGroup();
+ ImGuiTextBuffer label;
+ label.append(bimg::getName(bimg::TextureFormat::Enum(format) ) );
+ ImGui::PushStyleColor(ImGuiCol_Text, labelColor);
+ imguiTextBoxUnformatted(ImVec2(cellWidth, 0.0f), label.c_str() );
+ if (TextureStatus::isError(texture.m_status) )
+ {
+ imguiStrikethroughItem();
+ }
+ imguiTexturePreview(ImVec2(cellWidth, previewSize.y), m_currentTextureSet->m_textures[i].m_texture, previewSize );
+ ImGui::PopStyleColor();
+ ImGui::EndGroup();
+ if (!isFormatSupported && ImGui::IsItemHovered() )
+ {
+ ImGui::SetTooltip("%s", TextureStatus::getDescription(texture.m_status) );
+ }
+
+ splitter.SetCurrentChannel(drawList, 0);
+ ImGui::SetCursorScreenPos(ImGui::GetItemRectMin() );
+
+ ImGui::PushID(i);
+
+ if (ImGui::Selectable(
+ "##selectable"
+ , &isSelected
+ , ImGuiSelectableFlags_AllowItemOverlap
+ , ImGui::GetItemRectSize()
+ ) )
+ {
+ m_selectedFormat = format;
+ }
+
+ ImGui::PopID();
+
+ splitter.Merge(drawList);
+ }
+
+ ImGui::EndTable();
+ ImGui::End();
+
+ {
+ int32_t selectedTextureIndex = formatToIndex(m_selectedFormat);
+ const Texture& texture = m_currentTextureSet->m_textures[selectedTextureIndex];
+
+ ImGui::SetNextWindowPos(ImVec2(10.0f, 280.0f), ImGuiCond_FirstUseEver);
+ ImGui::Begin("Selected Format", NULL, ImGuiWindowFlags_AlwaysAutoResize);
+ ImGui::Text("Format: %s", bimg::getName(m_selectedFormat) );
+ ImGui::Text("Status: %s", TextureStatus::getDescription(texture.m_status) );
+
+ const bgfx::Caps* caps = bgfx::getCaps();
+
+ const uint32_t formatFlags = caps->formats[m_selectedFormat];
+
+ {
+ bool emulated = 0 != (formatFlags & (0
+ | BGFX_CAPS_FORMAT_TEXTURE_2D_EMULATED
+ | BGFX_CAPS_FORMAT_TEXTURE_3D_EMULATED
+ | BGFX_CAPS_FORMAT_TEXTURE_CUBE_EMULATED
+ ) );
+ ImGui::PushEnabled(false);
+ ImGui::Checkbox("Emu", &emulated);
+ ImGui::PopEnabled();
+ if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled))
+ {
+ ImGui::SetTooltip("Texture format is%s emulated.", emulated ? "" : " not");
+ }
+ ImGui::SameLine();
+
+ bool framebuffer = 0 != (formatFlags & BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER);
+ ImGui::PushEnabled(false);
+ ImGui::Checkbox("FB", &framebuffer);
+ ImGui::PopEnabled();
+ if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled))
+ {
+ ImGui::SetTooltip("Texture format can%s be used as frame buffer.", framebuffer ? "" : "not");
+ }
+ ImGui::SameLine();
+
+ bool msaa = 0 != (formatFlags & BGFX_CAPS_FORMAT_TEXTURE_MSAA);
+ ImGui::PushEnabled(false);
+ ImGui::Checkbox("MSAA", &msaa);
+ ImGui::PopEnabled();
+ if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled))
+ {
+ ImGui::SetTooltip("Texture can%s be sampled as MSAA.", msaa ? "" : "not");
+ }
+ }
+
+ ImVec2 size = ImVec2(float(m_currentTextureSet->m_maxWidth), float(m_currentTextureSet->m_maxHeight) );
+ ImVec2 selectedPreviewSize = bgfx::isValid(texture.m_texture) ? ImVec2(float(texture.m_width), float(texture.m_height) ) : size;
+
+ imguiTexturePreview(size, texture.m_texture, selectedPreviewSize);
+ ImGui::End();
+ }
+
+ imguiEndFrame();
+
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, uint16_t(m_width), uint16_t(m_height) );
+
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to viewZ 0.
+ bgfx::touch(0);
+
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
+
+ return true;
+ }
+
+ return false;
+ }
+
+ entry::MouseState m_mouseState;
+
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
+ float m_largestTextureSize = 256.0f;
+ float m_previewSize = 50.0f;
+ bool m_useAlpha = true;
+ bool m_animate = true;
+ bimg::TextureFormat::Enum m_selectedFormat = bimg::TextureFormat::RGBA8;
+
+ bgfx::TextureHandle m_checkerboard = BGFX_INVALID_HANDLE;
+ stl::vector<TextureSet> m_textureSets;
+ TextureSet* m_currentTextureSet = NULL;
+};
+
+} // namespace
+
+ENTRY_IMPLEMENT_MAIN(
+ ExamplePixelFormats
+ , "47-pixelformats"
+ , "Texture formats."
+ , "https://bkaradzic.github.io/bgfx/examples.html#pixelformats"
+ );
diff --git a/3rdparty/bgfx/examples/47-pixelformats/screenshot.png b/3rdparty/bgfx/examples/47-pixelformats/screenshot.png
new file mode 100644
index 00000000000..6341f0ade3f
--- /dev/null
+++ b/3rdparty/bgfx/examples/47-pixelformats/screenshot.png
Binary files differ
diff --git a/3rdparty/bgfx/examples/48-drawindirect/cs_drawindirect.sc b/3rdparty/bgfx/examples/48-drawindirect/cs_drawindirect.sc
new file mode 100644
index 00000000000..0e37a38ecef
--- /dev/null
+++ b/3rdparty/bgfx/examples/48-drawindirect/cs_drawindirect.sc
@@ -0,0 +1,93 @@
+/*
+ * Copyright 2022 Liam Twigger. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ */
+
+#include "bgfx_compute.sh"
+
+//instance data for all instances (pre culling)
+BUFFER_RO(instanceDataIn, vec4, 0);
+
+// Output
+BUFFER_WR(indirectBuffer, uvec4, 1);
+BUFFER_WR(instanceBufferOut, vec4, 2);
+#ifdef INDIRECT_COUNT
+BUFFER_WR(indirectCountBuffer, int, 3);
+#endif
+
+uniform vec4 u_drawParams;
+
+// Use 64*1*1 local threads
+NUM_THREADS(64, 1, 1)
+
+void main()
+{
+ int tId = int(gl_GlobalInvocationID.x);
+ int numDrawItems = int(u_drawParams.x);
+ int sideSize = int(u_drawParams.y);
+ float time = u_drawParams.z;
+
+ // Work out the amount of work we're going to do here
+ int maxToDraw = min(sideSize*sideSize, numDrawItems);
+
+ int numToDrawPerThread = maxToDraw/64 + 1;
+
+ int idxStart = tId*numToDrawPerThread;
+ int idxMax = min(maxToDraw, (tId+1)*numToDrawPerThread);
+
+ // Prepare draw mtx
+ for (int k = idxStart; k < idxMax; k++) {
+ int yy = k / sideSize;
+ int xx = k % sideSize;
+
+ float _ax = time + xx * 0.21f;
+ float _ay = time + yy * 0.37f;
+ float sx = sin(_ax);
+ float cx = cos(_ax);
+ float sy = sin(_ay);
+ float cy = cos(_ay);
+
+ vec4 a = vec4( cy, 0, sy, 0);
+ vec4 b = vec4( sx*sy, cx, -sx*cy, 0);
+ vec4 c = vec4(-cx*sy, sx, cx*cy, 0);
+
+ vec4 d = vec4(-15.0f - (sideSize-11)*1.2f + float(xx) * 3.0f, -15.0f - (sideSize-11)*1.4f + float(yy) * 3.0f, max(0.0f, (sideSize-11.0f)*3.0f), 1.0f);
+
+ vec4 color;
+ color.x = sin(time + float(xx) / 11.0f) * 0.5f + 0.5f;
+ color.y = cos(time + float(yy) / 11.0f) * 0.5f + 0.5f;
+ color.z = sin(time * 3.0f) * 0.5f + 0.5f;
+ color.w = 1.0f;
+
+ instanceBufferOut[k*5+0] = a;
+ instanceBufferOut[k*5+1] = b;
+ instanceBufferOut[k*5+2] = c;
+ instanceBufferOut[k*5+3] = d;
+ instanceBufferOut[k*5+4] = color;
+ }
+
+ // Fill indirect buffer
+
+ for (int k = idxStart; k < idxMax; k++) {
+ drawIndexedIndirect(
+ // Target location params:
+ indirectBuffer, // target buffer
+ k, // index in buffer
+ // Draw call params:
+ instanceDataIn[k].w, // number of indices for this draw call
+ 1u, // number of instances for this draw call. You can disable this draw call by setting to zero
+ instanceDataIn[k].z, // offset in the index buffer
+ instanceDataIn[k].x, // offset in the vertex buffer. Note that you can use this to "reindex" submeshses - all indicies in this draw will be decremented by this amount
+ k // offset in the instance buffer. If you are drawing more than 1 instance per call see gpudrivenrendering for how to handle
+ );
+ }
+
+ #ifdef INDIRECT_COUNT
+ if (tId == 0)
+ {
+ // If BGFX_CAPS_DRAW_INDIRECT_COUNT is supported, you can limit the
+ // number of draw calls dynamically without a CPU round trip
+ indirectCountBuffer[0] = maxToDraw;
+ }
+ #endif
+}
diff --git a/3rdparty/bgfx/examples/48-drawindirect/cs_drawindirect_count.sc b/3rdparty/bgfx/examples/48-drawindirect/cs_drawindirect_count.sc
new file mode 100644
index 00000000000..9a1f954153f
--- /dev/null
+++ b/3rdparty/bgfx/examples/48-drawindirect/cs_drawindirect_count.sc
@@ -0,0 +1,2 @@
+#define INDIRECT_COUNT
+#include "cs_drawindirect.sc"
diff --git a/3rdparty/bgfx/examples/48-drawindirect/drawindirect.cpp b/3rdparty/bgfx/examples/48-drawindirect/drawindirect.cpp
new file mode 100644
index 00000000000..d8b4d6d58cf
--- /dev/null
+++ b/3rdparty/bgfx/examples/48-drawindirect/drawindirect.cpp
@@ -0,0 +1,468 @@
+/*
+ * Copyright 2022-2022 Liam Twigger. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ */
+
+// Draw Indirect
+// Render multiple different objects with one draw command. This example shows a minimal implementation of indirect drawing
+// Reading References:
+// https://litasa.github.io/blog/2017/09/04/OpenGL-MultiDrawIndirect-with-Individual-Textures
+// https://cpp-rendering.io/indirect-rendering/
+
+#include "common.h"
+#include "bgfx_utils.h"
+#include "imgui/imgui.h"
+
+namespace
+{
+
+struct PosColorVertex
+{
+ float m_x;
+ float m_y;
+ float m_z;
+ uint32_t m_abgr;
+
+ static void init()
+ {
+ ms_layout
+ .begin()
+ .add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)
+ .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Uint8, true)
+ .end();
+ };
+
+ static bgfx::VertexLayout ms_layout;
+};
+
+bgfx::VertexLayout PosColorVertex::ms_layout;
+
+struct ObjectInstance {
+ float m_vertexOffset;
+ float m_vertexCount;
+ float m_indexOffset;
+ float m_indexCount;
+
+ static void init()
+ {
+ ms_layout
+ .begin()
+ .add(bgfx::Attrib::TexCoord0, 4, bgfx::AttribType::Float)
+ .end();
+ };
+
+ static bgfx::VertexLayout ms_layout;
+ };
+
+bgfx::VertexLayout ObjectInstance::ms_layout;
+
+struct RenderInstance {
+ float m_mtx[16];
+ float m_color[4];
+
+ static void init()
+ {
+ ms_layout
+ .begin()
+ .add(bgfx::Attrib::TexCoord0, 4, bgfx::AttribType::Float)
+ .add(bgfx::Attrib::TexCoord1, 4, bgfx::AttribType::Float)
+ .add(bgfx::Attrib::TexCoord2, 4, bgfx::AttribType::Float)
+ .add(bgfx::Attrib::TexCoord3, 4, bgfx::AttribType::Float)
+ .add(bgfx::Attrib::Color0, 4, bgfx::AttribType::Float)
+ .end();
+ };
+
+ static bgfx::VertexLayout ms_layout;
+ };
+
+bgfx::VertexLayout RenderInstance::ms_layout;
+
+static PosColorVertex s_multiMeshVertices[12] =
+{
+ // Cube Model
+ {-1.0f, 1.0f, 1.0f, 0xff000000 },
+ { 1.0f, 1.0f, 1.0f, 0xff0000ff },
+ {-1.0f, -1.0f, 1.0f, 0xff00ff00 },
+ { 1.0f, -1.0f, 1.0f, 0xff00ffff },
+ {-1.0f, 1.0f, -1.0f, 0xffff0000 },
+ { 1.0f, 1.0f, -1.0f, 0xffff00ff },
+ {-1.0f, -1.0f, -1.0f, 0xffffff00 },
+ { 1.0f, -1.0f, -1.0f, 0xffffffff },
+
+ // Tetrahedron Model (offset = 8)
+ { 1.0f, 1.0f, 1.0f, 0xff0000ff },
+ { 1.0f, -1.0f, -1.0f, 0xff000000 },
+ {-1.0f, 1.0f, -1.0f, 0xff00ff00 },
+ {-1.0f, -1.0f, 1.0f, 0xff00ffff },
+};
+
+static const uint16_t s_multiMeshIndices[48] =
+{
+ // Cube Indicies
+ 0, 1, 2, // 0
+ 1, 3, 2,
+ 4, 6, 5, // 2
+ 5, 6, 7,
+ 0, 2, 4, // 4
+ 4, 2, 6,
+ 1, 5, 3, // 6
+ 5, 7, 3,
+ 0, 4, 1, // 8
+ 4, 5, 1,
+ 2, 3, 6, // 10
+ 6, 3, 7,
+
+ // Tetrahedron Indices (offset = 36)
+ 0, 2, 1,
+ 1, 2, 3,
+ 0, 3, 2,
+ 1, 3, 0,
+};
+
+static const uint32_t s_maxSideSize = 81;
+
+class DrawIndirect : public entry::AppI
+{
+public:
+ DrawIndirect(const char* _name, const char* _description, const char* _url)
+ : entry::AppI(_name, _description, _url)
+ {
+ }
+
+ void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) override
+ {
+ Args args(_argc, _argv);
+
+ m_width = _width;
+ m_height = _height;
+ m_debug = BGFX_DEBUG_TEXT;
+ m_reset = BGFX_RESET_VSYNC;
+ m_sideSize = 11;
+ m_nDrawElements = s_maxSideSize*s_maxSideSize;
+ m_useIndirectCount = false;
+
+ bgfx::Init init;
+ init.type = args.m_type;
+ init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
+ init.resolution.width = m_width;
+ init.resolution.height = m_height;
+ init.resolution.reset = m_reset;
+ bgfx::init(init);
+
+ // Enable debug text.
+ bgfx::setDebug(m_debug);
+
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR|BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
+
+ // Create vertex stream declaration.
+ PosColorVertex::init();
+ ObjectInstance::init();
+ RenderInstance::init();
+
+ // Create static vertex buffer.
+ m_vbh = bgfx::createVertexBuffer(
+ bgfx::makeRef(s_multiMeshVertices, sizeof(s_multiMeshVertices) )
+ , PosColorVertex::ms_layout
+ );
+
+ // Create static index buffer.
+ m_ibh = bgfx::createIndexBuffer(
+ bgfx::makeRef(s_multiMeshIndices, sizeof(s_multiMeshIndices) )
+ );
+
+ // Create program from shaders.
+ m_program = loadProgram("vs_instancing", "fs_instancing"); // These are reused from 05-instancing
+
+ m_indirect_program = BGFX_INVALID_HANDLE;
+ m_indirect_count_program = BGFX_INVALID_HANDLE;
+ m_indirect_buffer_handle = BGFX_INVALID_HANDLE;
+ m_indirect_count_buffer_handle = BGFX_INVALID_HANDLE;
+ m_object_list_buffer = BGFX_INVALID_HANDLE;
+
+ u_drawParams = bgfx::createUniform("u_drawParams", bgfx::UniformType::Vec4);
+
+ const bool computeSupported = !!(BGFX_CAPS_COMPUTE & bgfx::getCaps()->supported);
+ const bool indirectSupported = !!(BGFX_CAPS_DRAW_INDIRECT & bgfx::getCaps()->supported);
+ const bool instancingSupported = !!(BGFX_CAPS_INSTANCING & bgfx::getCaps()->supported);
+
+ if (computeSupported && indirectSupported && instancingSupported)
+ {
+ // Set up indirect program
+ // This is a barebones program that populates the indirect buffer handle with draw requests
+ m_indirect_program = bgfx::createProgram(loadShader("cs_drawindirect"), true);
+ m_indirect_buffer_handle = bgfx::createIndirectBuffer(m_nDrawElements);
+
+ const bool indirectCountSupported = !!(BGFX_CAPS_DRAW_INDIRECT_COUNT & bgfx::getCaps()->supported);
+ if (indirectCountSupported)
+ {
+ m_useIndirectCount = true;
+ m_indirect_count_program = bgfx::createProgram(loadShader("cs_drawindirect_count"), true);
+
+ const bgfx::Memory * mem = bgfx::alloc(sizeof(uint32_t));
+ *(uint32_t *)mem->data = 0;
+ m_indirect_count_buffer_handle = bgfx::createIndexBuffer(mem, BGFX_BUFFER_INDEX32 | BGFX_BUFFER_COMPUTE_WRITE | BGFX_BUFFER_DRAW_INDIRECT);
+ }
+
+ const bgfx::Memory * mem = bgfx::alloc(sizeof(ObjectInstance) * m_nDrawElements);
+ ObjectInstance* objs = (ObjectInstance*) mem->data;
+
+ for (uint32_t ii = 0; ii < m_nDrawElements; ++ii)
+ {
+ if (ii % 2)
+ {
+ // Tetrahedron
+ objs[ii].m_vertexOffset = 8;
+ objs[ii].m_vertexCount = 4; // m_vertexCount is unused in compute shader, its only here for completeness
+ objs[ii].m_indexOffset = 36;
+ objs[ii].m_indexCount = 12;
+ }
+ else
+ {
+ // Cube
+ objs[ii].m_vertexOffset = 0;
+ objs[ii].m_vertexCount = 8;
+ objs[ii].m_indexOffset = 0;
+ objs[ii].m_indexCount = 36;
+ }
+ }
+
+ // This is a list of objects to be rendered via the indirect program
+ m_object_list_buffer = bgfx::createVertexBuffer(mem, ObjectInstance::ms_layout, BGFX_BUFFER_COMPUTE_READ);
+
+ // This is the instance buffer used for rendering.
+ // You could instead use a dynamic instance buffer when rendering (use bgfx::allocInstanceDataBuffer in draw loop)
+ m_instance_buffer = bgfx::createDynamicVertexBuffer(m_nDrawElements, RenderInstance::ms_layout, BGFX_BUFFER_COMPUTE_WRITE);
+ }
+
+ m_timeOffset = bx::getHPCounter();
+
+ imguiCreate();
+ }
+
+ int shutdown() override
+ {
+ imguiDestroy();
+
+ // Cleanup.
+ bgfx::destroy(m_ibh);
+ bgfx::destroy(m_vbh);
+ bgfx::destroy(m_program);
+
+ if (bgfx::isValid(m_indirect_program))
+ {
+ bgfx::destroy(m_indirect_program);
+ }
+ if (bgfx::isValid(m_indirect_count_program))
+ {
+ bgfx::destroy(m_indirect_count_program);
+ }
+ if (bgfx::isValid(m_indirect_buffer_handle))
+ {
+ bgfx::destroy(m_indirect_buffer_handle);
+ }
+ if (bgfx::isValid(m_indirect_count_buffer_handle))
+ {
+ bgfx::destroy(m_indirect_count_buffer_handle);
+ }
+ if (bgfx::isValid(m_object_list_buffer))
+ {
+ bgfx::destroy(m_object_list_buffer);
+ }
+ if (bgfx::isValid(m_instance_buffer))
+ {
+ bgfx::destroy(m_instance_buffer);
+ }
+ bgfx::destroy(u_drawParams);
+
+ // Shutdown bgfx.
+ bgfx::shutdown();
+
+ return 0;
+ }
+
+ bool update() override
+ {
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState) )
+ {
+ // Get renderer capabilities info.
+ const bool computeSupported = !!(BGFX_CAPS_COMPUTE & bgfx::getCaps()->supported);
+ const bool indirectSupported = !!(BGFX_CAPS_DRAW_INDIRECT & bgfx::getCaps()->supported);
+ const bool indirectCountSupported = !!(BGFX_CAPS_DRAW_INDIRECT_COUNT & bgfx::getCaps()->supported);
+ const bool instancingSupported = !!(BGFX_CAPS_INSTANCING & bgfx::getCaps()->supported);
+
+ imguiBeginFrame(m_mouseState.m_mx
+ , m_mouseState.m_my
+ , (m_mouseState.m_buttons[entry::MouseButton::Left ] ? IMGUI_MBUT_LEFT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Right ] ? IMGUI_MBUT_RIGHT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , m_mouseState.m_mz
+ , uint16_t(m_width)
+ , uint16_t(m_height)
+ );
+
+ showExampleDialog(this);
+
+ ImGui::SetNextWindowPos(
+ ImVec2(m_width - m_width / 5.0f - 10.0f, 10.0f)
+ , ImGuiCond_FirstUseEver
+ );
+ ImGui::SetNextWindowSize(
+ ImVec2(m_width / 5.0f, m_height / 2.0f)
+ , ImGuiCond_FirstUseEver
+ );
+ ImGui::Begin("Settings"
+ , NULL
+ , 0
+ );
+
+ ImGui::Text("%d draw calls", bgfx::getStats()->numDraw);
+ ImGui::Text("%d objects drawn", m_sideSize*m_sideSize);
+
+ ImGui::Text("Grid Side Size:");
+ ImGui::SliderInt("##size", (int*)&m_sideSize, 1, s_maxSideSize);
+
+ ImGui::BeginDisabled(!indirectCountSupported);
+ ImGui::Checkbox("Indirect Count", &m_useIndirectCount);
+ ImGui::EndDisabled();
+ if (!indirectCountSupported && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) )
+ {
+ ImGui::SetTooltip("Indirect Count is not supported by GPU.");
+ }
+
+ ImGui::End();
+
+ imguiEndFrame();
+
+
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, uint16_t(m_width), uint16_t(m_height) );
+
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to view 0.
+ bgfx::touch(0);
+
+ const bx::Vec3 at = { 0.0f, 0.0f, 0.0f };
+ const bx::Vec3 eye = { 0.0f, 0.0f, -35.0f };
+
+ // Set view and projection matrix for view 0.
+ {
+ float view[16];
+ bx::mtxLookAt(view, eye, at);
+
+ float proj[16];
+ bx::mtxProj(proj, 60.0f, float(m_width)/float(m_height), 0.1f, 500.0f, bgfx::getCaps()->homogeneousDepth);
+ bgfx::setViewTransform(0, view, proj);
+
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, uint16_t(m_width), uint16_t(m_height) );
+ }
+
+ float time = (float)( (bx::getHPCounter() - m_timeOffset)/double(bx::getHPFrequency() ) );
+
+ if (computeSupported && indirectSupported && instancingSupported)
+ {
+ // Build indirect buffer & prepare instance buffer
+ // NOTE: IF you are rendering static data then
+ // this could be done once on startup and results stored
+ // This is done here for demonstration purposes
+
+ // The model matrix for each instance is also set on compute
+ // you could modify this to, eg, do frustrum culling on the GPU
+ float ud[4] = { float(m_nDrawElements), float(m_sideSize), float(time), 0 };
+ uint32_t numToDraw = (m_sideSize*m_sideSize);
+
+ bgfx::setUniform(u_drawParams, ud);
+
+ bgfx::setBuffer(0, m_object_list_buffer, bgfx::Access::Read);
+ bgfx::setBuffer(1, m_indirect_buffer_handle, bgfx::Access::Write);
+ bgfx::setBuffer(2, m_instance_buffer, bgfx::Access::Write);
+
+ // Dispatch the call. We are using 64 local threads on the GPU to process the object list
+ // So lets dispatch ceil(numToDraw/64) workgroups of 64 local threads
+ if (m_useIndirectCount)
+ {
+ bgfx::setBuffer(3, m_indirect_count_buffer_handle, bgfx::Access::Write);
+ bgfx::dispatch(0, m_indirect_count_program, uint32_t(numToDraw/64 + 1), 1, 1);
+ }
+ else
+ {
+ bgfx::dispatch(0, m_indirect_program, uint32_t(numToDraw/64 + 1), 1, 1);
+ }
+
+ // Submit our 1 draw call
+ // Set vertex and index buffer.
+ bgfx::setIndexBuffer(m_ibh);
+ bgfx::setVertexBuffer(0, m_vbh);
+ bgfx::setInstanceDataBuffer(m_instance_buffer, 0, numToDraw);
+
+ // Set render states.
+ bgfx::setState(BGFX_STATE_DEFAULT);
+
+ // Submit primitive for rendering to view 0.
+ if (m_useIndirectCount)
+ {
+ // With indirect count, the number of draws is read from a buffer
+ bgfx::submit(0, m_program, m_indirect_buffer_handle, 0, m_indirect_count_buffer_handle);
+ }
+ else
+ {
+ bgfx::submit(0, m_program, m_indirect_buffer_handle, 0, uint16_t(numToDraw));
+ }
+ }
+ else
+ {
+ // Compute/Indirect/Instancing is not supported
+ bool blink = uint32_t(time*3.0f)&1;
+ bgfx::dbgTextPrintf(0, 0, blink ? 0x4f : 0x04, " Compute/Indirect/Instancing is not supported by GPU. ");
+ }
+
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
+
+ return true;
+ }
+
+ return false;
+ }
+
+ entry::MouseState m_mouseState;
+
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
+ uint32_t m_sideSize;
+ uint32_t m_nDrawElements;
+ bool m_useIndirectCount;
+
+ bgfx::VertexBufferHandle m_vbh;
+ bgfx::IndexBufferHandle m_ibh;
+ bgfx::ProgramHandle m_program;
+ bgfx::IndirectBufferHandle m_indirect_buffer_handle;
+ bgfx::IndexBufferHandle m_indirect_count_buffer_handle;
+ bgfx::ProgramHandle m_indirect_program;
+ bgfx::ProgramHandle m_indirect_count_program;
+ bgfx::VertexBufferHandle m_object_list_buffer;
+ bgfx::DynamicVertexBufferHandle m_instance_buffer;
+ bgfx::UniformHandle u_drawParams;
+
+ int64_t m_timeOffset;
+};
+
+} // namespace
+
+ENTRY_IMPLEMENT_MAIN(
+ DrawIndirect
+ , "48-drawindirect"
+ , "Simple example of indirect rendering to render multiple different meshes with 1 draw call"
+ , "https://bkaradzic.github.io/bgfx/examples.html#drawindirect"
+ );
diff --git a/3rdparty/bgfx/examples/48-drawindirect/makefile b/3rdparty/bgfx/examples/48-drawindirect/makefile
new file mode 100644
index 00000000000..19c81e43692
--- /dev/null
+++ b/3rdparty/bgfx/examples/48-drawindirect/makefile
@@ -0,0 +1,10 @@
+#
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+#
+
+BGFX_DIR=../..
+RUNTIME_DIR=$(BGFX_DIR)/examples/runtime
+BUILD_DIR=../../.build
+
+include $(BGFX_DIR)/scripts/shader.mk
diff --git a/3rdparty/bgfx/examples/48-drawindirect/screenshot.png b/3rdparty/bgfx/examples/48-drawindirect/screenshot.png
new file mode 100644
index 00000000000..da13f2725db
--- /dev/null
+++ b/3rdparty/bgfx/examples/48-drawindirect/screenshot.png
Binary files differ
diff --git a/3rdparty/bgfx/examples/49-hextile/fs_hextile.bin b/3rdparty/bgfx/examples/49-hextile/fs_hextile.bin
new file mode 100644
index 00000000000..30c4e7f669d
--- /dev/null
+++ b/3rdparty/bgfx/examples/49-hextile/fs_hextile.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/49-hextile/fs_hextile.sc b/3rdparty/bgfx/examples/49-hextile/fs_hextile.sc
new file mode 100644
index 00000000000..65c888205f4
--- /dev/null
+++ b/3rdparty/bgfx/examples/49-hextile/fs_hextile.sc
@@ -0,0 +1,226 @@
+$input v_position, v_texcoord0
+
+/*
+ * Copyright 2022 Preetish Kakkar. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ */
+
+ /*
+
+ Most of the code is inspired/ported from https://github.com/mmikk/hextile-demo/blob/main/hextile-demo/shader_lighting.hlsl
+
+ The basic idea behind the algorithm is to use tiling & blending schema but instead of regular linear blending, the algorithm uses blending operator that prevents visual artifacts caused by linear blending
+
+ We partition the uv-space on a triangle grid and compute the local triangle and the barycentric coordinates inside the triangle. We use a hash function to associate a random offset with each vertex of the triangle
+ grid and use this random offset to fetch the example texture.
+
+ Finally, we blend the result using the barycentric coordinates as blending weights.
+
+ */
+
+#include "../common/common.sh"
+
+#define M_PI 3.1415926535897932384626433832795
+
+SAMPLER2D(s_trx_d, 0);
+
+uniform vec4 u_params;
+
+#ifndef fmod
+#define fmod(x, y) (x - y * trunc(x / y))
+#endif
+
+#define moduleOper(a, b) a - (float(b) * floor(a/float(b)))
+
+#define u_showWeights u_params.x
+#define u_tileRate u_params.y
+#define u_tileRotStrength u_params.z
+#define u_useRegularTiling u_params.w
+
+vec3 Gain3(vec3 x, float r)
+{
+ // increase contrast when r>0.5 and
+ // reduce contrast if less
+ float k = log(1.0 - r) / log(0.5);
+
+ vec3 s = 2.0 * step(0.5, x);
+ vec3 m = 2.0 * (1.0 - s);
+
+ vec3 res = 0.5 * s + 0.25 * m * pow(max(vec3_splat(0.0), s + x * m), vec3_splat(k));
+
+ return res.xyz / (res.x + res.y + res.z);
+}
+
+mat2 LoadRot2x2(vec2 idx, float rotStrength)
+{
+ float angle = abs(idx.x * idx.y) + abs(idx.x + idx.y) + M_PI;
+
+ // remap to +/-pi
+ //angle = fmod(angle, 2.0*M_PI);
+ if (angle < 0.0) angle += 2.0 * M_PI;
+ if (angle > M_PI) angle -= 2.0 * M_PI;
+
+ angle *= rotStrength;
+
+ float cs = cos(angle);
+ float si = sin(angle);
+
+ return mat2(cs, -si, si, cs);
+}
+
+vec2 MakeCenST(vec2 Vertex)
+{
+ mat2 invSkewMat = mat2(1.0, 0.5, 0.0, 1.0 / 1.15470054);
+
+ return mul(invSkewMat, Vertex) / (2.0 * sqrt(3.0));
+}
+
+
+vec3 ProduceHexWeights(vec3 W, vec2 vertex1, vec2 vertex2, vec2 vertex3)
+{
+ vec3 res = vec3_splat(0.0);
+
+ float v1 = moduleOper(((vertex1.x - vertex1.y)), 3.0);
+ if (v1 < 0.0) v1 += 3.0;
+
+ float vh = v1 < 2.0 ? (v1 + 1.0) : 0.0;
+ float vl = v1 > 0.0 ? (v1 - 1.0) : 2.0;
+ float v2 = vertex1.x < vertex3.x ? vl : vh;
+ float v3 = vertex1.x < vertex3.x ? vh : vl;
+
+ res.x = v3 == 0.0 ? W.z : (v2 == 0.0 ? W.y : W.x);
+ res.y = v3 == 1.0 ? W.z : (v2 == 1.0 ? W.y : W.x);
+ res.z = v3 == 2.0 ? W.z : (v2 == 2.0 ? W.y : W.x);
+
+ return res;
+}
+
+vec2 hash(vec2 p)
+{
+ vec2 r = mul(mat2(127.1, 311.7, 269.5, 183.3), p);
+
+ return fract(sin(r) * 43758.5453);
+}
+
+// Given a point in UV, compute local triangle barycentric coordinates and vertex IDs
+void TriangleGrid(out float w1, out float w2, out float w3,
+ out vec2 vertex1, out vec2 vertex2, out vec2 vertex3,
+ vec2 uv)
+{
+ // Scaling of the input
+ uv *= 2.0 * sqrt(3.0); // controls the size of the input with respect to the size of the tiles.
+
+ // Skew input space into simplex triangle grid
+ const mat2 gridToSkewedGrid =
+ mat2(1.0, -0.57735027, 0.0, 1.15470054);
+ vec2 skewedCoord = mul(gridToSkewedGrid, uv);
+
+ vec2 baseId = floor(skewedCoord);
+ vec3 temp = vec3(fract(skewedCoord), 0.0);
+ temp.z = 1.0 - temp.x - temp.y;
+
+ float s = step(0.0, -temp.z);
+ float s2 = 2.0 * s - 1.0;
+
+ w1 = -temp.z * s2;
+ w2 = s - temp.y * s2;
+ w3 = s - temp.x * s2;
+
+ vertex1 = baseId + vec2(s, s);
+ vertex2 = baseId + vec2(s, 1.0 - s);
+ vertex3 = baseId + vec2(1.0 - s, s);
+}
+
+void hex2colTex(out vec4 color, out vec3 weights, vec2 uv,
+ float rotStrength, float r)
+{
+ // compute uv derivatives
+ vec2 dSTdx = dFdx(uv), dSTdy = dFdy(uv);
+
+ // Get triangle info
+ float w1, w2, w3;
+ vec2 vertex1, vertex2, vertex3;
+ TriangleGrid(w1, w2, w3, vertex1, vertex2, vertex3, uv);
+
+ mat2 rot1 = LoadRot2x2(vertex1, rotStrength);
+ mat2 rot2 = LoadRot2x2(vertex2, rotStrength);
+ mat2 rot3 = LoadRot2x2(vertex3, rotStrength);
+
+ vec2 cen1 = MakeCenST(vertex1);
+ vec2 cen2 = MakeCenST(vertex2);
+ vec2 cen3 = MakeCenST(vertex3);
+
+ // assign random offset to each triangle vertex
+ // this is used later to fetch from texture
+ vec2 uv1 = mul(uv - cen1, rot1) + cen1 + hash(vertex1);
+ vec2 uv2 = mul(uv - cen2, rot2) + cen2 + hash(vertex2);
+ vec2 uv3 = mul(uv - cen3, rot3) + cen3 + hash(vertex3);
+
+ // Fetch input
+ // We could simply use texture2D function, however, the sreen space derivatives could be broken
+ // since we are using random offsets, we use texture2DGrad to make sure that we pass correct derivatives explicitly.
+ vec4 c1 = texture2DGrad(s_trx_d, uv1,
+ mul(dSTdx, rot1), mul(dSTdy, rot1));
+ vec4 c2 = texture2DGrad(s_trx_d, uv2,
+ mul(dSTdx, rot2), mul(dSTdy, rot2));
+ vec4 c3 = texture2DGrad(s_trx_d, uv3,
+ mul(dSTdx, rot3), mul(dSTdy, rot3));
+
+ // use luminance as weight
+ vec3 Lw = vec3(0.299, 0.587, 0.114);
+ vec3 Dw = vec3(dot(c1.xyz, Lw), dot(c2.xyz, Lw), dot(c3.xyz, Lw));
+
+ Dw = mix(vec3_splat(1.0), Dw, 0.6); // 0.6 is fall off constant
+ vec3 W = Dw * pow(vec3(w1, w2, w3), vec3_splat(7.0)); // 7 is g_exp
+ W /= (W.x + W.y + W.z);
+ if (r != 0.5) W = Gain3(W, r);
+
+ // blend weights with color linearly
+ // histogram preserving blending will be better but requires precompution step to create histogram texture
+ color = W.x * c1 + W.y * c2 + W.z * c3;
+ weights = ProduceHexWeights(W.xyz, vertex1, vertex2, vertex3);
+}
+
+
+float GetTileRate()
+{
+ return 0.05 * u_tileRate;
+}
+
+void FetchColorAndWeight(out vec3 color, out vec3 weights, vec2 uv)
+{
+ vec4 col4;
+ hex2colTex(col4, weights, uv, u_tileRotStrength, 0.7);
+ color = col4.xyz;
+}
+
+void main()
+{
+ // actual world space position
+ vec3 surfPosInWorld = v_position.xyz;
+
+ vec3 sp = GetTileRate() * surfPosInWorld;
+
+ vec2 uv0 = vec2(sp.x, sp.z);
+
+ if(u_useRegularTiling > 0.0)
+ {
+ gl_FragColor = vec4(texture2D(s_trx_d, uv0.xy));
+ }
+ else
+ {
+ vec3 color, weights;
+ FetchColorAndWeight(color, weights, uv0);
+
+ if (u_showWeights > 0.0)
+ {
+ gl_FragColor = vec4(weights, 1.0);
+ }
+ else
+ {
+ gl_FragColor = vec4(color, 1.0);
+ }
+ }
+
+
+}
diff --git a/3rdparty/bgfx/examples/49-hextile/hextile.cpp b/3rdparty/bgfx/examples/49-hextile/hextile.cpp
new file mode 100644
index 00000000000..ecef40bf261
--- /dev/null
+++ b/3rdparty/bgfx/examples/49-hextile/hextile.cpp
@@ -0,0 +1,327 @@
+/*
+ * Copyright 2022-2022 Preetish Kakkar. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ */
+
+#include <bx/allocator.h>
+#include <bx/debug.h>
+#include <bx/math.h>
+#include "common.h"
+#include "bgfx_utils.h"
+#include "imgui/imgui.h"
+
+namespace
+{
+ struct PosTextCoord0Vertex
+ {
+ float m_x;
+ float m_y;
+ float m_z;
+ float m_u;
+ float m_v;
+
+ static void init()
+ {
+ ms_layout
+ .begin()
+ .add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float)
+ .add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)
+ .end();
+ }
+
+ static bgfx::VertexLayout ms_layout;
+ };
+
+ bgfx::VertexLayout PosTextCoord0Vertex::ms_layout;
+
+
+ static PosTextCoord0Vertex s_screenSpaceQuadVertices[] =
+ {
+ {-1.0f, 0.0f, -1.0f, 0.0, 0.0 },
+ {-1.0f, 0.0f, 1.0f, 0.0, 1.0 },
+ { 1.0f, 0.0f, -1.0f, 1.0, 0.0 },
+ { 1.0f, 0.0f, 1.0f, 1.0, 1.0 },
+ };
+
+ static const uint16_t s_screenSpaceQuadIndices[] =
+ {
+ 2, 3, 1,
+ 0, 2, 1,
+ };
+
+
+ struct HextileData
+ {
+ bool m_showWeights = false;
+ int m_tileRate = 10;
+ float m_tileRotationStrength = 0.0f;
+ bool m_useRegularTiling = false;
+ bool m_pauseAnimation;
+ };
+
+ class ExampleHextile : public entry::AppI
+ {
+ public:
+ ExampleHextile(const char* _name, const char* _description, const char* _url)
+ : entry::AppI(_name, _description, _url)
+ , m_width(0)
+ , m_height(0)
+ , m_debug(BGFX_DEBUG_NONE)
+ , m_reset()
+ {
+ }
+
+ void init(int32_t _argc, const char* const* _argv, uint32_t _width, uint32_t _height) override
+ {
+ Args args(_argc, _argv);
+
+ m_width = _width;
+ m_height = _height;
+ m_debug = BGFX_DEBUG_NONE;
+ m_reset = BGFX_RESET_VSYNC;
+
+ bgfx::Init init;
+ init.type = args.m_type;
+ init.vendorId = args.m_pciId;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
+ init.resolution.width = m_width;
+ init.resolution.height = m_height;
+ init.resolution.reset = m_reset;
+ bgfx::init(init);
+
+ // Enable m_debug text.
+ bgfx::setDebug(m_debug);
+
+ // Set view 0 clear state.
+ bgfx::setViewClear(0
+ , BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH
+ , 0x303030ff
+ , 1.0f
+ , 0
+ );
+
+ m_hexTileData.m_showWeights = false;
+ m_hexTileData.m_pauseAnimation = false;
+
+ // Create vertex stream declaration.
+ PosTextCoord0Vertex::init();
+
+ // Create static vertex buffer.
+ m_vbh = bgfx::createVertexBuffer(
+ // Static data can be passed with bgfx::makeRef
+ bgfx::makeRef(s_screenSpaceQuadVertices, sizeof(s_screenSpaceQuadVertices))
+ , PosTextCoord0Vertex::ms_layout
+ );
+
+ // Create static index buffer
+ m_ibh = bgfx::createIndexBuffer(
+ // Static data can be passed with bgfx::makeRef
+ bgfx::makeRef(s_screenSpaceQuadIndices, sizeof(s_screenSpaceQuadIndices))
+ );
+
+ // Create program from shaders.
+ m_hextileProgram = loadProgram("vs_hextile", "fs_hextile");
+
+ // load texture to hextile
+ m_tileTexture = loadTexture("textures/aerial_rocks_04_diff_2k.ktx");
+
+ // Imgui.
+ imguiCreate();
+
+ m_timeOffset = bx::getHPCounter();
+
+ s_tileSampler = bgfx::createUniform("s_trx_d", bgfx::UniformType::Sampler);
+
+ u_params = bgfx::createUniform("u_params", bgfx::UniformType::Vec4, 3);
+ }
+
+ virtual int shutdown() override
+ {
+ // Cleanup.
+ imguiDestroy();
+
+ if (bgfx::isValid(m_ibh))
+ {
+ bgfx::destroy(m_ibh);
+ }
+
+ if (bgfx::isValid(m_vbh))
+ {
+ bgfx::destroy(m_vbh);
+ }
+
+ if (bgfx::isValid(m_tileTexture))
+ {
+ bgfx::destroy(m_tileTexture);
+ }
+
+ if (bgfx::isValid(s_tileSampler))
+ {
+ bgfx::destroy(s_tileSampler);
+ }
+
+ if (bgfx::isValid(u_params))
+ {
+ bgfx::destroy(u_params);
+ }
+
+ bgfx::destroy(m_hextileProgram);
+
+ /// When data is passed to bgfx via makeRef we need to make
+ /// sure library is done with it before freeing memory blocks.
+ bgfx::frame();
+
+
+ // Shutdown bgfx.
+ bgfx::shutdown();
+
+ return 0;
+ }
+
+ bool update() override
+ {
+ if (!entry::processEvents(m_width, m_height, m_debug, m_reset, &m_mouseState))
+ {
+ int64_t now = bx::getHPCounter();
+ static int64_t last = now;
+ const int64_t frameTime = now - last;
+ last = now;
+ const double freq = double(bx::getHPFrequency());
+ const float deltaTime = float(frameTime / freq);
+
+ imguiBeginFrame(m_mouseState.m_mx
+ , m_mouseState.m_my
+ , (m_mouseState.m_buttons[entry::MouseButton::Left] ? IMGUI_MBUT_LEFT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Right] ? IMGUI_MBUT_RIGHT : 0)
+ | (m_mouseState.m_buttons[entry::MouseButton::Middle] ? IMGUI_MBUT_MIDDLE : 0)
+ , m_mouseState.m_mz
+ , uint16_t(m_width)
+ , uint16_t(m_height)
+ );
+
+ showExampleDialog(this);
+
+ ImGui::SetNextWindowPos(
+ ImVec2(m_width - m_width / 4.5f - 5.0f, 10.0f)
+ , ImGuiCond_FirstUseEver
+ );
+ ImGui::SetNextWindowSize(
+ ImVec2(m_width / 4.5f, m_height / 4.0f)
+ , ImGuiCond_FirstUseEver
+ );
+ ImGui::Begin("Settings"
+ , NULL
+ , 0
+ );
+
+ ImGui::Separator();
+
+ ImGui::Checkbox("Use Regular Tiling", &m_hexTileData.m_useRegularTiling);
+ ImGui::Checkbox("Show Weights", &m_hexTileData.m_showWeights);
+ ImGui::Checkbox("Pause Animation", &m_hexTileData.m_pauseAnimation);
+
+ ImGui::SliderInt("Tile Rate", &m_hexTileData.m_tileRate, 2, 25);
+
+ ImGui::SliderFloat("Tile Rotation", &m_hexTileData.m_tileRotationStrength, 0.0f, 20.0f);
+
+ ImGui::Separator();
+
+ ImGui::End();
+ imguiEndFrame();
+
+ // This dummy draw call is here to make sure that view 0 is cleared
+ // if no other draw calls are submitted to view 0.
+ bgfx::touch(0);
+
+ const bx::Vec3 at = { 0.0f, 0.0f, 0.0f };
+
+ if (!m_hexTileData.m_pauseAnimation)
+ {
+ m_eye.z = bx::abs(m_eye.z) + (deltaTime / 4.0f);
+
+ if (m_eye.z < 10.0f)
+ {
+ m_eye.z *= -1;
+ }
+ else
+ {
+ m_eye.z = -0.01f;
+ }
+ }
+
+ float viewMtx[16];
+ bx::mtxLookAt(viewMtx, m_eye, at);
+
+ float projMtx[16];
+ bx::mtxProj(projMtx, 30.0f, float(m_width) / float(m_height), 0.1f, 1000.0f, bgfx::getCaps()->homogeneousDepth);
+
+ bgfx::setViewTransform(0, viewMtx, projMtx);
+
+ // Set view 0 default viewport.
+ bgfx::setViewRect(0, 0, 0, uint16_t(m_width), uint16_t(m_height));
+
+ float modelTransform[16];
+ bx::mtxSRT(modelTransform, 30.0f, 30.0f, 30.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f);
+ bgfx::setTransform(modelTransform);
+
+ bgfx::setVertexBuffer(0, m_vbh);
+ bgfx::setIndexBuffer(m_ibh);
+
+ bgfx::setTexture(0, s_tileSampler, m_tileTexture);
+
+ const float data[4] = { float(m_hexTileData.m_showWeights), float(m_hexTileData.m_tileRate),
+ float(m_hexTileData.m_tileRotationStrength), float(m_hexTileData.m_useRegularTiling) };
+ bgfx::setUniform(u_params, data);
+
+ bgfx::setState(0
+ | BGFX_STATE_WRITE_RGB
+ | BGFX_STATE_WRITE_A
+ | BGFX_STATE_WRITE_Z
+ | BGFX_STATE_DEPTH_TEST_LESS
+ | BGFX_STATE_MSAA
+ );
+
+ bgfx::submit(0, m_hextileProgram);
+
+ // Advance to next frame. Rendering thread will be kicked to
+ // process submitted rendering primitives.
+ bgfx::frame();
+
+ return true;
+ }
+
+ return false;
+ }
+
+ bgfx::VertexBufferHandle m_vbh;
+ bgfx::IndexBufferHandle m_ibh;
+
+ bgfx::ProgramHandle m_hextileProgram;
+ bgfx::UniformHandle s_tileSampler;
+ bgfx::TextureHandle m_tileTexture;
+
+ uint32_t m_width;
+ uint32_t m_height;
+ uint32_t m_debug;
+ uint32_t m_reset;
+
+ HextileData m_hexTileData;
+
+ entry::MouseState m_mouseState;
+
+ bgfx::UniformHandle u_params;
+
+ int64_t m_timeOffset;
+
+ bx::Vec3 m_eye = { 0.0f, 2.0f, -0.01f };
+ };
+
+} // namespace
+
+ENTRY_IMPLEMENT_MAIN(
+ ExampleHextile
+ , "49-hextile"
+ , "Hextile example."
+ , "https://bkaradzic.github.io/bgfx/examples.html#hextile"
+);
diff --git a/3rdparty/bgfx/examples/49-hextile/makefile b/3rdparty/bgfx/examples/49-hextile/makefile
new file mode 100644
index 00000000000..19c81e43692
--- /dev/null
+++ b/3rdparty/bgfx/examples/49-hextile/makefile
@@ -0,0 +1,10 @@
+#
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+#
+
+BGFX_DIR=../..
+RUNTIME_DIR=$(BGFX_DIR)/examples/runtime
+BUILD_DIR=../../.build
+
+include $(BGFX_DIR)/scripts/shader.mk
diff --git a/3rdparty/bgfx/examples/49-hextile/screenshot.png b/3rdparty/bgfx/examples/49-hextile/screenshot.png
new file mode 100644
index 00000000000..51b372ff329
--- /dev/null
+++ b/3rdparty/bgfx/examples/49-hextile/screenshot.png
Binary files differ
diff --git a/3rdparty/bgfx/examples/49-hextile/varying.def.sc b/3rdparty/bgfx/examples/49-hextile/varying.def.sc
new file mode 100644
index 00000000000..741df32452c
--- /dev/null
+++ b/3rdparty/bgfx/examples/49-hextile/varying.def.sc
@@ -0,0 +1,13 @@
+vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
+vec3 v_position : TEXCOORD1 = vec3(0.0, 0.0, 0.0);
+vec3 v_view : TEXCOORD2 = vec3(0.0, 0.0, 0.0);
+vec3 v_normal : NORMAL = vec3(0.0, 0.0, 1.0);
+vec3 v_tangent : TANGENT = vec3(1.0, 0.0, 0.0);
+vec3 v_bitangent : BINORMAL = vec3(0.0, 1.0, 0.0);
+vec4 v_color0 : COLOR = vec4(1.0, 0.0, 0.0, 1.0);
+
+vec3 a_position : POSITION;
+vec4 a_normal : NORMAL;
+vec4 a_tangent : TANGENT;
+vec2 a_texcoord0 : TEXCOORD0;
+vec4 a_color0 : COLOR0;
diff --git a/3rdparty/bgfx/examples/49-hextile/vs_hextile.sc b/3rdparty/bgfx/examples/49-hextile/vs_hextile.sc
new file mode 100644
index 00000000000..50bf8754bea
--- /dev/null
+++ b/3rdparty/bgfx/examples/49-hextile/vs_hextile.sc
@@ -0,0 +1,18 @@
+$input a_position, a_texcoord0
+$output v_position, v_texcoord0
+
+/*
+ * Copyright 2015 Andrew Mac. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ */
+
+#include "../common/common.sh"
+
+void main()
+{
+ vec3 vp = mul(u_model[0], vec4(a_position.xyz, 1.0)).xyz;
+ v_position = vp;
+ v_texcoord0 = mul(u_model[0], vec4(a_texcoord0.xy, 1.0, 1.0)).xy;
+
+ gl_Position = mul(u_viewProj, vec4(vp.xyz, 1.0));
+}
diff --git a/3rdparty/bgfx/examples/assets/textures/aerial_rocks_04_diff_2k.jpg b/3rdparty/bgfx/examples/assets/textures/aerial_rocks_04_diff_2k.jpg
new file mode 100644
index 00000000000..768143d37fb
--- /dev/null
+++ b/3rdparty/bgfx/examples/assets/textures/aerial_rocks_04_diff_2k.jpg
Binary files differ
diff --git a/3rdparty/bgfx/examples/assets/textures/textures.ninja b/3rdparty/bgfx/examples/assets/textures/textures.ninja
index 6d9ecb7b2bb..22fd3e32ba0 100644
--- a/3rdparty/bgfx/examples/assets/textures/textures.ninja
+++ b/3rdparty/bgfx/examples/assets/textures/textures.ninja
@@ -1,14 +1,34 @@
textures = $pwd/../../runtime/textures
-build $textures/texture_compression_bc1.ktx: texturec_bc1 $pwd/texture-compression-test.png
-build $textures/texture_compression_bc2.ktx: texturec_bc2 $pwd/texture-compression-test.png
-build $textures/texture_compression_bc3.ktx: texturec_bc3 $pwd/texture-compression-test.png
-build $textures/texture_compression_bc7.ktx: texturec_bc7 $pwd/texture-compression-test.png
-build $textures/texture_compression_etc1.ktx: texturec_etc1 $pwd/texture-compression-test.png
-build $textures/texture_compression_etc2.ktx: texturec_etc2 $pwd/texture-compression-test.png
+build $textures/texture_compression_bc1.ktx: texturec_bc1 $pwd/texture-compression-test.png
+build $textures/texture_compression_bc2.ktx: texturec_bc2 $pwd/texture-compression-test.png
+build $textures/texture_compression_bc3.ktx: texturec_bc3 $pwd/texture-compression-test.png
+build $textures/texture_compression_bc7.ktx: texturec_bc7 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_4x4.dds: texturec_astc4x4 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_5x4.dds: texturec_astc5x4 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_5x5.dds: texturec_astc5x5 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_6x5.dds: texturec_astc6x5 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_6x6.dds: texturec_astc6x6 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_8x5.dds: texturec_astc8x5 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_8x6.dds: texturec_astc8x6 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_8x8.dds: texturec_astc8x8 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_10x5.dds: texturec_astc10x5 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_10x6.dds: texturec_astc10x6 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_10x8.dds: texturec_astc10x8 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_10x10.dds: texturec_astc10x10 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_12x10.dds: texturec_astc12x10 $pwd/texture-compression-test.png
+build $textures/texture_compression_astc_12x12.dds: texturec_astc12x12 $pwd/texture-compression-test.png
+build $textures/texture_compression_etc1.ktx: texturec_etc1 $pwd/texture-compression-test.png
+build $textures/texture_compression_etc2.ktx: texturec_etc2 $pwd/texture-compression-test.png
build $textures/parallax-d.ktx: texturec_diffuse $pwd/parallax-d.png
build $textures/parallax-n.ktx: texturec_normal $pwd/parallax-n.png
build $textures/parallax-h.ktx: texturec_height $pwd/parallax-h.png
build $textures/lightmap.ktx: texturec_height $pwd/../sky/lightmap.png
build $textures/uffizi.ktx: texturec_equirect $pwd/uffizi-large.exr
+
+build $textures/texture_compression_rgba8.dds: texturec_rgba8 $pwd/texture-compression-test.png
+build $textures/pf_alpha_test.dds: texturec_rgba8 $pwd/texture-alpha-test.png
+build $textures/pf_uv_filtering_test.dds: texturec_rgba8 $pwd/texture-uv-filtering-test.png
+
+build $textures/aerial_rocks_04_diff_2k.ktx: texturec_bc7 $pwd/aerial_rocks_04_diff_2k.jpg
diff --git a/3rdparty/bgfx/examples/common/aviwriter.h b/3rdparty/bgfx/examples/common/aviwriter.h
index 34d3fbf2151..32eb49f692e 100644
--- a/3rdparty/bgfx/examples/common/aviwriter.h
+++ b/3rdparty/bgfx/examples/common/aviwriter.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef AVIWRITER_H_HEADER_GUARD
@@ -41,93 +41,95 @@ struct AviWriter
// is 0, 0. DIB expect OpenGL style coordinates, so this is inverted logic for AVI writer.
m_yflip = !_yflip;
+ bx::Error err;
+
bx::StaticMemoryBlockWriter mem(m_frame, 8);
// Stream Data (LIST 'movi' Chunk) http://msdn.microsoft.com/en-us/library/ms899496.aspx
- bx::write(&mem, BX_MAKEFOURCC('0', '0', 'd', 'b') );
- bx::write(&mem, m_frameSize);
+ bx::write(&mem, BX_MAKEFOURCC('0', '0', 'd', 'b'), &err);
+ bx::write(&mem, m_frameSize, &err);
- bx::write(m_writer, BX_MAKEFOURCC('R', 'I', 'F', 'F') );
+ bx::write(m_writer, BX_MAKEFOURCC('R', 'I', 'F', 'F'), &err);
m_riffSizeOffset = m_writer->seek();
- bx::write(m_writer, UINT32_C(0) );
+ bx::write(m_writer, uint32_t(0), &err);
- bx::write(m_writer, BX_MAKEFOURCC('A', 'V', 'I', ' ') );
+ bx::write(m_writer, BX_MAKEFOURCC('A', 'V', 'I', ' '), &err);
// AVI RIFF Form http://msdn.microsoft.com/en-us/library/ms899422.aspx
- bx::write(m_writer, BX_MAKEFOURCC('L', 'I', 'S', 'T') );
- bx::write(m_writer, UINT32_C(192) );
- bx::write(m_writer, BX_MAKEFOURCC('h', 'd', 'r', 'l') );
+ bx::write(m_writer, BX_MAKEFOURCC('L', 'I', 'S', 'T'), &err);
+ bx::write(m_writer, uint32_t(192), &err);
+ bx::write(m_writer, BX_MAKEFOURCC('h', 'd', 'r', 'l'), &err);
// AVI Main Header http://msdn.microsoft.com/en-us/library/ms779632.aspx
- bx::write(m_writer, BX_MAKEFOURCC('a', 'v', 'i', 'h') );
- bx::write(m_writer, UINT32_C(56) );
- bx::write(m_writer, UINT32_C(0) ); // dwMicroSecPerFrame
- bx::write(m_writer, UINT32_C(0) ); // dwMaxBytesPerSec
- bx::write(m_writer, UINT32_C(0) ); // dwPaddingGranularity
- bx::write(m_writer, UINT32_C(0x110) ); // dwFlags
+ bx::write(m_writer, BX_MAKEFOURCC('a', 'v', 'i', 'h'), &err);
+ bx::write(m_writer, uint32_t(56), &err);
+ bx::write(m_writer, uint32_t(0), &err); // dwMicroSecPerFrame
+ bx::write(m_writer, uint32_t(0), &err); // dwMaxBytesPerSec
+ bx::write(m_writer, uint32_t(0), &err); // dwPaddingGranularity
+ bx::write(m_writer, uint32_t(0x110), &err); // dwFlags
m_totalFramesOffset = m_writer->seek();
- bx::write(m_writer, UINT32_C(0) ); // dwTotalFrames
-
- bx::write(m_writer, UINT32_C(0) ); // dwInitialFrames
- bx::write(m_writer, UINT32_C(1) ); // dwStreams
- bx::write(m_writer, UINT32_C(0) ); // dwSuggestedBufferSize
- bx::write(m_writer, _width); // dwWidth
- bx::write(m_writer, _height); // dwHeight
- bx::write(m_writer, UINT32_C(0) ); // dwReserved0
- bx::write(m_writer, UINT32_C(0) ); // dwReserved1
- bx::write(m_writer, UINT32_C(0) ); // dwReserved2
- bx::write(m_writer, UINT32_C(0) ); // dwReserved3
-
- bx::write(m_writer, BX_MAKEFOURCC('L', 'I', 'S', 'T') );
- bx::write(m_writer, UINT32_C(116) );
- bx::write(m_writer, BX_MAKEFOURCC('s', 't', 'r', 'l') );
+ bx::write(m_writer, uint32_t(0), &err); // dwTotalFrames
+
+ bx::write(m_writer, uint32_t(0), &err); // dwInitialFrames
+ bx::write(m_writer, uint32_t(1), &err); // dwStreams
+ bx::write(m_writer, uint32_t(0), &err); // dwSuggestedBufferSize
+ bx::write(m_writer, _width, &err); // dwWidth
+ bx::write(m_writer, _height, &err); // dwHeight
+ bx::write(m_writer, uint32_t(0), &err); // dwReserved0
+ bx::write(m_writer, uint32_t(0), &err); // dwReserved1
+ bx::write(m_writer, uint32_t(0), &err); // dwReserved2
+ bx::write(m_writer, uint32_t(0), &err); // dwReserved3
+
+ bx::write(m_writer, BX_MAKEFOURCC('L', 'I', 'S', 'T'), &err);
+ bx::write(m_writer, uint32_t(116), &err);
+ bx::write(m_writer, BX_MAKEFOURCC('s', 't', 'r', 'l'), &err);
// AVISTREAMHEADER Structure http://msdn.microsoft.com/en-us/library/ms779638.aspx
- bx::write(m_writer, BX_MAKEFOURCC('s', 't', 'r', 'h') );
- bx::write(m_writer, UINT32_C(56) );
+ bx::write(m_writer, BX_MAKEFOURCC('s', 't', 'r', 'h'), &err);
+ bx::write(m_writer, uint32_t(56), &err);
// AVI Stream Headers http://msdn.microsoft.com/en-us/library/ms899423.aspx
- bx::write(m_writer, BX_MAKEFOURCC('v', 'i', 'd', 's') ); // fccType
- bx::write(m_writer, BX_MAKEFOURCC('D', 'I', 'B', ' ') ); // fccHandler
- bx::write(m_writer, UINT32_C(0) ); // dwFlags
- bx::write(m_writer, uint16_t(0) ); // wPriority
- bx::write(m_writer, uint16_t(0) ); // wLanguage
- bx::write(m_writer, UINT32_C(0) ); // dwInitialFrames
- bx::write(m_writer, UINT32_C(1) ); // dwScale
- bx::write(m_writer, _fps); // dwRate
- bx::write(m_writer, UINT32_C(0) ); // dwStart
+ bx::write(m_writer, BX_MAKEFOURCC('v', 'i', 'd', 's'), &err); // fccType
+ bx::write(m_writer, BX_MAKEFOURCC('D', 'I', 'B', ' '), &err); // fccHandler
+ bx::write(m_writer, uint32_t(0), &err); // dwFlags
+ bx::write(m_writer, uint16_t(0), &err); // wPriority
+ bx::write(m_writer, uint16_t(0), &err); // wLanguage
+ bx::write(m_writer, uint32_t(0), &err); // dwInitialFrames
+ bx::write(m_writer, uint32_t(1), &err); // dwScale
+ bx::write(m_writer, _fps, &err); // dwRate
+ bx::write(m_writer, uint32_t(0), &err); // dwStart
m_lengthOffset = m_writer->seek();
- bx::write(m_writer, UINT32_C(0) ); // dwLength
+ bx::write(m_writer, uint32_t(0), &err); // dwLength
- bx::write(m_writer, m_frameSize); // dwSuggestedBufferSize
- bx::write(m_writer, UINT32_MAX); // dwQuality
- bx::write(m_writer, UINT32_C(0) ); // dwSampleSize
- bx::write(m_writer, int16_t(0) ); // rcFrame.left
- bx::write(m_writer, int16_t(0) ); // rcFrame.top
- bx::write(m_writer, uint16_t(_width) ); // rcFrame.right
- bx::write(m_writer, uint16_t(_height) );// rcFrame.bottom
+ bx::write(m_writer, m_frameSize, &err); // dwSuggestedBufferSize
+ bx::write(m_writer, UINT32_MAX, &err); // dwQuality
+ bx::write(m_writer, uint32_t(0), &err); // dwSampleSize
+ bx::write(m_writer, int16_t(0), &err); // rcFrame.left
+ bx::write(m_writer, int16_t(0), &err); // rcFrame.top
+ bx::write(m_writer, uint16_t(_width), &err); // rcFrame.right
+ bx::write(m_writer, uint16_t(_height), &err);// rcFrame.bottom
- bx::write(m_writer, BX_MAKEFOURCC('s', 't', 'r', 'f') );
- bx::write(m_writer, UINT32_C(40) );
+ bx::write(m_writer, BX_MAKEFOURCC('s', 't', 'r', 'f'), &err);
+ bx::write(m_writer, uint32_t(40), &err);
// BITMAPINFOHEADER structure http://msdn.microsoft.com/en-us/library/windows/desktop/dd318229%28v=vs.85%29.aspx
- bx::write(m_writer, UINT32_C(40) ); // biSize
- bx::write(m_writer, _width); // biWidth
- bx::write(m_writer, _height); // biHeight
- bx::write(m_writer, uint16_t(1) ); // biPlanes
- bx::write(m_writer, uint16_t(24) ); // biBitCount
- bx::write(m_writer, UINT32_C(0) ); // biCompression
- bx::write(m_writer, m_frameSize); // biSizeImage
- bx::write(m_writer, UINT32_C(0) ); // biXPelsPerMeter
- bx::write(m_writer, UINT32_C(0) ); // biYPelsPerMeter
- bx::write(m_writer, UINT32_C(0) ); // biClrUsed
- bx::write(m_writer, UINT32_C(0) ); // biClrImportant
-
- bx::write(m_writer, BX_MAKEFOURCC('L', 'I', 'S', 'T') );
+ bx::write(m_writer, uint32_t(40), &err); // biSize
+ bx::write(m_writer, _width, &err); // biWidth
+ bx::write(m_writer, _height, &err); // biHeight
+ bx::write(m_writer, uint16_t(1), &err); // biPlanes
+ bx::write(m_writer, uint16_t(24), &err); // biBitCount
+ bx::write(m_writer, uint32_t(0), &err); // biCompression
+ bx::write(m_writer, m_frameSize, &err); // biSizeImage
+ bx::write(m_writer, uint32_t(0), &err); // biXPelsPerMeter
+ bx::write(m_writer, uint32_t(0), &err); // biYPelsPerMeter
+ bx::write(m_writer, uint32_t(0), &err); // biClrUsed
+ bx::write(m_writer, uint32_t(0), &err); // biClrImportant
+
+ bx::write(m_writer, BX_MAKEFOURCC('L', 'I', 'S', 'T'), &err);
m_moviListOffset = m_writer->seek();
- bx::write(m_writer, UINT32_C(0) );
- bx::write(m_writer, BX_MAKEFOURCC('m', 'o', 'v', 'i') );
+ bx::write(m_writer, uint32_t(0), &err);
+ bx::write(m_writer, BX_MAKEFOURCC('m', 'o', 'v', 'i'), &err);
return true;
}
@@ -136,32 +138,34 @@ struct AviWriter
{
if (NULL != m_frame)
{
+ bx::Error err;
+
int64_t pos = m_writer->seek();
m_writer->seek(m_moviListOffset, bx::Whence::Begin);
- bx::write(m_writer, uint32_t(pos-m_moviListOffset-4) );
+ bx::write(m_writer, uint32_t(pos-m_moviListOffset-4), &err);
m_writer->seek(pos, bx::Whence::Begin);
- bx::write(m_writer, BX_MAKEFOURCC('i', 'd', 'x', '1') );
- bx::write(m_writer, m_numFrames*16);
+ bx::write(m_writer, BX_MAKEFOURCC('i', 'd', 'x', '1'), &err);
+ bx::write(m_writer, m_numFrames*16, &err);
for (uint32_t ii = 0, offset = 4; ii < m_numFrames; ++ii)
{
- bx::write(m_writer, BX_MAKEFOURCC('0', '0', 'd', 'b') );
- bx::write(m_writer, UINT32_C(16) );
- bx::write(m_writer, offset);
- bx::write(m_writer, m_frameSize);
+ bx::write(m_writer, BX_MAKEFOURCC('0', '0', 'd', 'b'), &err);
+ bx::write(m_writer, uint32_t(16), &err);
+ bx::write(m_writer, offset, &err);
+ bx::write(m_writer, m_frameSize, &err);
offset += m_frameSize + 8;
}
pos = m_writer->seek();
m_writer->seek(m_riffSizeOffset, bx::Whence::Begin);
- bx::write(m_writer, uint32_t(pos-m_riffSizeOffset-4) );
+ bx::write(m_writer, uint32_t(pos-m_riffSizeOffset-4), &err);
m_writer->seek(m_totalFramesOffset, bx::Whence::Begin);
- bx::write(m_writer, m_numFrames);
+ bx::write(m_writer, m_numFrames, &err);
m_writer->seek(m_lengthOffset, bx::Whence::Begin);
- bx::write(m_writer, m_numFrames);
+ bx::write(m_writer, m_numFrames, &err);
bx::close(m_writer);
@@ -210,7 +214,8 @@ struct AviWriter
}
}
- bx::write(m_writer, m_frame, m_frameSize+8);
+ bx::Error err;
+ bx::write(m_writer, m_frame, m_frameSize+8, &err);
}
}
diff --git a/3rdparty/bgfx/examples/common/bgfx_utils.cpp b/3rdparty/bgfx/examples/common/bgfx_utils.cpp
index 6573b882858..209e3ea7fe1 100644
--- a/3rdparty/bgfx/examples/common/bgfx_utils.cpp
+++ b/3rdparty/bgfx/examples/common/bgfx_utils.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -29,7 +29,7 @@ void* load(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const char* _fi
{
uint32_t size = (uint32_t)bx::getSize(_reader);
void* data = BX_ALLOC(_allocator, size);
- bx::read(_reader, data, size);
+ bx::read(_reader, data, size, bx::ErrorAssert{});
bx::close(_reader);
if (NULL != _size)
{
@@ -66,7 +66,7 @@ static const bgfx::Memory* loadMem(bx::FileReaderI* _reader, const char* _filePa
{
uint32_t size = (uint32_t)bx::getSize(_reader);
const bgfx::Memory* mem = bgfx::alloc(size+1);
- bx::read(_reader, mem->data, size);
+ bx::read(_reader, mem->data, size, bx::ErrorAssert{});
bx::close(_reader);
mem->data[mem->size-1] = '\0';
return mem;
@@ -82,7 +82,7 @@ static void* loadMem(bx::FileReaderI* _reader, bx::AllocatorI* _allocator, const
{
uint32_t size = (uint32_t)bx::getSize(_reader);
void* data = BX_ALLOC(_allocator, size);
- bx::read(_reader, data, size);
+ bx::read(_reader, data, size, bx::ErrorAssert{});
bx::close(_reader);
if (NULL != _size)
@@ -375,7 +375,7 @@ void Group::reset()
namespace bgfx
{
- int32_t read(bx::ReaderI* _reader, bgfx::VertexLayout& _layout, bx::Error* _err = NULL);
+ int32_t read(bx::ReaderI* _reader, bgfx::VertexLayout& _layout, bx::Error* _err);
}
void Mesh::load(bx::ReaderSeekerI* _reader, bool _ramcopy)
@@ -402,17 +402,17 @@ void Mesh::load(bx::ReaderSeekerI* _reader, bool _ramcopy)
{
case kChunkVertexBuffer:
{
- read(_reader, group.m_sphere);
- read(_reader, group.m_aabb);
- read(_reader, group.m_obb);
+ read(_reader, group.m_sphere, &err);
+ read(_reader, group.m_aabb, &err);
+ read(_reader, group.m_obb, &err);
- read(_reader, m_layout);
+ read(_reader, m_layout, &err);
uint16_t stride = m_layout.getStride();
- read(_reader, group.m_numVertices);
+ read(_reader, group.m_numVertices, &err);
const bgfx::Memory* mem = bgfx::alloc(group.m_numVertices*stride);
- read(_reader, mem->data, mem->size);
+ read(_reader, mem->data, mem->size, &err);
if (_ramcopy)
{
@@ -426,23 +426,23 @@ void Mesh::load(bx::ReaderSeekerI* _reader, bool _ramcopy)
case kChunkVertexBufferCompressed:
{
- read(_reader, group.m_sphere);
- read(_reader, group.m_aabb);
- read(_reader, group.m_obb);
+ read(_reader, group.m_sphere, &err);
+ read(_reader, group.m_aabb, &err);
+ read(_reader, group.m_obb, &err);
- read(_reader, m_layout);
+ read(_reader, m_layout, &err);
uint16_t stride = m_layout.getStride();
- read(_reader, group.m_numVertices);
+ read(_reader, group.m_numVertices, &err);
const bgfx::Memory* mem = bgfx::alloc(group.m_numVertices*stride);
uint32_t compressedSize;
- bx::read(_reader, compressedSize);
+ bx::read(_reader, compressedSize, &err);
void* compressedVertices = BX_ALLOC(allocator, compressedSize);
- bx::read(_reader, compressedVertices, compressedSize);
+ bx::read(_reader, compressedVertices, compressedSize, &err);
meshopt_decodeVertexBuffer(mem->data, group.m_numVertices, stride, (uint8_t*)compressedVertices, compressedSize);
@@ -460,9 +460,10 @@ void Mesh::load(bx::ReaderSeekerI* _reader, bool _ramcopy)
case kChunkIndexBuffer:
{
- read(_reader, group.m_numIndices);
+ read(_reader, group.m_numIndices, &err);
+
const bgfx::Memory* mem = bgfx::alloc(group.m_numIndices*2);
- read(_reader, mem->data, mem->size);
+ read(_reader, mem->data, mem->size, &err);
if (_ramcopy)
{
@@ -476,16 +477,16 @@ void Mesh::load(bx::ReaderSeekerI* _reader, bool _ramcopy)
case kChunkIndexBufferCompressed:
{
- bx::read(_reader, group.m_numIndices);
+ bx::read(_reader, group.m_numIndices, &err);
const bgfx::Memory* mem = bgfx::alloc(group.m_numIndices*2);
uint32_t compressedSize;
- bx::read(_reader, compressedSize);
+ bx::read(_reader, compressedSize, &err);
void* compressedIndices = BX_ALLOC(allocator, compressedSize);
- bx::read(_reader, compressedIndices, compressedSize);
+ bx::read(_reader, compressedIndices, compressedSize, &err);
meshopt_decodeIndexBuffer(mem->data, group.m_numIndices, 2, (uint8_t*)compressedIndices, compressedSize);
@@ -504,31 +505,31 @@ void Mesh::load(bx::ReaderSeekerI* _reader, bool _ramcopy)
case kChunkPrimitive:
{
uint16_t len;
- read(_reader, len);
+ read(_reader, len, &err);
stl::string material;
material.resize(len);
- read(_reader, const_cast<char*>(material.c_str() ), len);
+ read(_reader, const_cast<char*>(material.c_str() ), len, &err);
uint16_t num;
- read(_reader, num);
+ read(_reader, num, &err);
for (uint32_t ii = 0; ii < num; ++ii)
{
- read(_reader, len);
+ read(_reader, len, &err);
stl::string name;
name.resize(len);
- read(_reader, const_cast<char*>(name.c_str() ), len);
+ read(_reader, const_cast<char*>(name.c_str() ), len, &err);
Primitive prim;
- read(_reader, prim.m_startIndex);
- read(_reader, prim.m_numIndices);
- read(_reader, prim.m_startVertex);
- read(_reader, prim.m_numVertices);
- read(_reader, prim.m_sphere);
- read(_reader, prim.m_aabb);
- read(_reader, prim.m_obb);
+ read(_reader, prim.m_startIndex, &err);
+ read(_reader, prim.m_numIndices, &err);
+ read(_reader, prim.m_startVertex, &err);
+ read(_reader, prim.m_numVertices, &err);
+ read(_reader, prim.m_sphere, &err);
+ read(_reader, prim.m_aabb, &err);
+ read(_reader, prim.m_obb, &err);
group.m_prims.push_back(prim);
}
@@ -595,8 +596,16 @@ void Mesh::submit(bgfx::ViewId _id, bgfx::ProgramHandle _program, const float* _
bgfx::setIndexBuffer(group.m_ibh);
bgfx::setVertexBuffer(0, group.m_vbh);
- bgfx::submit(_id, _program, 0, (it == itEnd-1) ? (BGFX_DISCARD_INDEX_BUFFER | BGFX_DISCARD_VERTEX_STREAMS | BGFX_DISCARD_STATE) : BGFX_DISCARD_NONE);
+ bgfx::submit(
+ _id
+ , _program
+ , 0
+ , BGFX_DISCARD_INDEX_BUFFER
+ | BGFX_DISCARD_VERTEX_STREAMS
+ );
}
+
+ bgfx::discard();
}
void Mesh::submit(const MeshState*const* _state, uint8_t _numPasses, const float* _mtx, uint16_t _numMatrices) const
@@ -631,10 +640,19 @@ void Mesh::submit(const MeshState*const* _state, uint8_t _numPasses, const float
state.m_viewId
, state.m_program
, 0
- , (it == itEnd - 1) ? (BGFX_DISCARD_INDEX_BUFFER | BGFX_DISCARD_VERTEX_STREAMS | BGFX_DISCARD_STATE) : BGFX_DISCARD_NONE
+ , BGFX_DISCARD_INDEX_BUFFER
+ | BGFX_DISCARD_VERTEX_STREAMS
);
}
+
+ bgfx::discard(0
+ | BGFX_DISCARD_BINDINGS
+ | BGFX_DISCARD_STATE
+ | BGFX_DISCARD_TRANSFORM
+ );
}
+
+ bgfx::discard();
}
Mesh* meshLoad(bx::ReaderSeekerI* _reader, bool _ramcopy)
@@ -749,20 +767,17 @@ Args::Args(int _argc, const char* const* _argv)
{
m_type = bgfx::RendererType::Noop;
}
- else if (BX_ENABLED(BX_PLATFORM_WINDOWS|BX_PLATFORM_WINRT|BX_PLATFORM_XBOXONE) )
+ if (cmdLine.hasArg("d3d9") )
{
- if (cmdLine.hasArg("d3d9") )
- {
- m_type = bgfx::RendererType::Direct3D9;
- }
- else if (cmdLine.hasArg("d3d11") )
- {
- m_type = bgfx::RendererType::Direct3D11;
- }
- else if (cmdLine.hasArg("d3d12") )
- {
- m_type = bgfx::RendererType::Direct3D12;
- }
+ m_type = bgfx::RendererType::Direct3D9;
+ }
+ else if (cmdLine.hasArg("d3d11") )
+ {
+ m_type = bgfx::RendererType::Direct3D11;
+ }
+ else if (cmdLine.hasArg("d3d12") )
+ {
+ m_type = bgfx::RendererType::Direct3D12;
}
else if (BX_ENABLED(BX_PLATFORM_OSX) )
{
diff --git a/3rdparty/bgfx/examples/common/bgfx_utils.h b/3rdparty/bgfx/examples/common/bgfx_utils.h
index 37d11c41191..7146293f38c 100644
--- a/3rdparty/bgfx/examples/common/bgfx_utils.h
+++ b/3rdparty/bgfx/examples/common/bgfx_utils.h
@@ -1,16 +1,16 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_UTILS_H_HEADER_GUARD
#define BGFX_UTILS_H_HEADER_GUARD
+#include <bx/bounds.h>
#include <bx/pixelformat.h>
#include <bx/string.h>
#include <bgfx/bgfx.h>
#include <bimg/bimg.h>
-#include "bounds.h"
#include <tinystl/allocator.h>
#include <tinystl/vector.h>
@@ -92,9 +92,9 @@ struct Primitive
uint32_t m_startVertex;
uint32_t m_numVertices;
- Sphere m_sphere;
- Aabb m_aabb;
- Obb m_obb;
+ bx::Sphere m_sphere;
+ bx::Aabb m_aabb;
+ bx::Obb m_obb;
};
typedef stl::vector<Primitive> PrimitiveArray;
@@ -110,9 +110,9 @@ struct Group
uint8_t* m_vertices;
uint32_t m_numIndices;
uint16_t* m_indices;
- Sphere m_sphere;
- Aabb m_aabb;
- Obb m_obb;
+ bx::Sphere m_sphere;
+ bx::Aabb m_aabb;
+ bx::Obb m_obb;
PrimitiveArray m_prims;
};
typedef stl::vector<Group> GroupArray;
diff --git a/3rdparty/bgfx/examples/common/bounds.cpp b/3rdparty/bgfx/examples/common/bounds.cpp
deleted file mode 100644
index 7c92cb3da9f..00000000000
--- a/3rdparty/bgfx/examples/common/bounds.cpp
+++ /dev/null
@@ -1,2104 +0,0 @@
-/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#include <bx/rng.h>
-#include <bx/math.h>
-#include "bounds.h"
-
-using namespace bx;
-
-Vec3 getCenter(const Aabb& _aabb)
-{
- return mul(add(_aabb.min, _aabb.max), 0.5f);
-}
-
-Vec3 getExtents(const Aabb& _aabb)
-{
- return mul(sub(_aabb.max, _aabb.min), 0.5f);
-}
-
-Vec3 getCenter(const Triangle& _triangle)
-{
- return mul(add(add(_triangle.v0, _triangle.v1), _triangle.v2), 1.0f/3.0f);
-}
-
-void toAabb(Aabb& _outAabb, const Vec3& _extents)
-{
- _outAabb.min = neg(_extents);
- _outAabb.max = _extents;
-}
-
-void toAabb(Aabb& _outAabb, const Vec3& _center, const Vec3& _extents)
-{
- _outAabb.min = sub(_center, _extents);
- _outAabb.max = add(_center, _extents);
-}
-
-void toAabb(Aabb& _outAabb, const Cylinder& _cylinder)
-{
- // Reference(s):
- // - https://web.archive.org/web/20181113055756/http://iquilezles.org/www/articles/diskbbox/diskbbox.htm
- //
- const Vec3 axis = sub(_cylinder.end, _cylinder.pos);
- const Vec3 asq = mul(axis, axis);
- const Vec3 nsq = mul(asq, 1.0f/dot(axis, axis) );
- const Vec3 tmp = sub(Vec3(1.0f), nsq);
-
- const float inv = 1.0f/(tmp.x*tmp.y*tmp.z);
-
- const Vec3 extent =
- {
- _cylinder.radius * tmp.x * bx::sqrt( (nsq.x + nsq.y * nsq.z) * inv),
- _cylinder.radius * tmp.y * bx::sqrt( (nsq.y + nsq.z * nsq.x) * inv),
- _cylinder.radius * tmp.z * bx::sqrt( (nsq.z + nsq.x * nsq.y) * inv),
- };
-
- const Vec3 minP = sub(_cylinder.pos, extent);
- const Vec3 minE = sub(_cylinder.end, extent);
- const Vec3 maxP = add(_cylinder.pos, extent);
- const Vec3 maxE = add(_cylinder.end, extent);
-
- _outAabb.min = min(minP, minE);
- _outAabb.max = max(maxP, maxE);
-}
-
-void toAabb(Aabb& _outAabb, const Disk& _disk)
-{
- // Reference(s):
- // - https://web.archive.org/web/20181113055756/http://iquilezles.org/www/articles/diskbbox/diskbbox.htm
- //
- const Vec3 nsq = mul(_disk.normal, _disk.normal);
- const Vec3 one = { 1.0f, 1.0f, 1.0f };
- const Vec3 tmp = sub(one, nsq);
- const float inv = 1.0f / (tmp.x*tmp.y*tmp.z);
-
- const Vec3 extent =
- {
- _disk.radius * tmp.x * bx::sqrt( (nsq.x + nsq.y * nsq.z) * inv),
- _disk.radius * tmp.y * bx::sqrt( (nsq.y + nsq.z * nsq.x) * inv),
- _disk.radius * tmp.z * bx::sqrt( (nsq.z + nsq.x * nsq.y) * inv),
- };
-
- _outAabb.min = sub(_disk.center, extent);
- _outAabb.max = add(_disk.center, extent);
-}
-
-void toAabb(Aabb& _outAabb, const Obb& _obb)
-{
- Vec3 xyz = { 1.0f, 1.0f, 1.0f };
- Vec3 tmp = mul(xyz, _obb.mtx);
-
- _outAabb.min = tmp;
- _outAabb.max = tmp;
-
- for (uint32_t ii = 1; ii < 8; ++ii)
- {
- xyz.x = ii & 1 ? -1.0f : 1.0f;
- xyz.y = ii & 2 ? -1.0f : 1.0f;
- xyz.z = ii & 4 ? -1.0f : 1.0f;
- tmp = mul(xyz, _obb.mtx);
-
- _outAabb.min = min(_outAabb.min, tmp);
- _outAabb.max = max(_outAabb.max, tmp);
- }
-}
-
-void toAabb(Aabb& _outAabb, const Sphere& _sphere)
-{
- const float radius = _sphere.radius;
- _outAabb.min = sub(_sphere.center, radius);
- _outAabb.max = add(_sphere.center, radius);
-}
-
-void toAabb(Aabb& _outAabb, const Triangle& _triangle)
-{
- _outAabb.min = min(_triangle.v0, _triangle.v1, _triangle.v2);
- _outAabb.max = max(_triangle.v0, _triangle.v1, _triangle.v2);
-}
-
-void aabbTransformToObb(Obb& _obb, const Aabb& _aabb, const float* _mtx)
-{
- toObb(_obb, _aabb);
- float result[16];
- mtxMul(result, _obb.mtx, _mtx);
- memCopy(_obb.mtx, result, sizeof(result) );
-}
-
-void toAabb(Aabb& _outAabb, const void* _vertices, uint32_t _numVertices, uint32_t _stride)
-{
- Vec3 mn(init::None);
- Vec3 mx(init::None);
- uint8_t* vertex = (uint8_t*)_vertices;
-
- mn = mx = load<Vec3>(vertex);
- vertex += _stride;
-
- for (uint32_t ii = 1; ii < _numVertices; ++ii)
- {
- const Vec3 pos = load<Vec3>(vertex);
- vertex += _stride;
-
- mn = min(pos, mn);
- mx = max(pos, mx);
- }
-
- _outAabb.min = mn;
- _outAabb.max = mx;
-}
-
-void toAabb(Aabb& _outAabb, const float* _mtx, const void* _vertices, uint32_t _numVertices, uint32_t _stride)
-{
- Vec3 mn(init::None);
- Vec3 mx(init::None);
- uint8_t* vertex = (uint8_t*)_vertices;
- mn = mx = mul(load<Vec3>(vertex), _mtx);
-
- vertex += _stride;
-
- for (uint32_t ii = 1; ii < _numVertices; ++ii)
- {
- Vec3 pos = mul(load<Vec3>(vertex), _mtx);
- vertex += _stride;
-
- mn = min(pos, mn);
- mx = max(pos, mx);
- }
-
- _outAabb.min = mn;
- _outAabb.max = mx;
-}
-
-float calcAreaAabb(const Aabb& _aabb)
-{
- const float ww = _aabb.max.x - _aabb.min.x;
- const float hh = _aabb.max.y - _aabb.min.y;
- const float dd = _aabb.max.z - _aabb.min.z;
- return 2.0f * (ww*hh + ww*dd + hh*dd);
-}
-
-void aabbExpand(Aabb& _outAabb, float _factor)
-{
- _outAabb.min.x -= _factor;
- _outAabb.min.y -= _factor;
- _outAabb.min.z -= _factor;
- _outAabb.max.x += _factor;
- _outAabb.max.y += _factor;
- _outAabb.max.z += _factor;
-}
-
-void aabbExpand(Aabb& _outAabb, const Vec3& _pos)
-{
- _outAabb.min = min(_outAabb.min, _pos);
- _outAabb.max = max(_outAabb.max, _pos);
-}
-
-void toObb(Obb& _outObb, const Aabb& _aabb)
-{
- memSet(_outObb.mtx, 0, sizeof(_outObb.mtx) );
- _outObb.mtx[ 0] = (_aabb.max.x - _aabb.min.x) * 0.5f;
- _outObb.mtx[ 5] = (_aabb.max.y - _aabb.min.y) * 0.5f;
- _outObb.mtx[10] = (_aabb.max.z - _aabb.min.z) * 0.5f;
- _outObb.mtx[12] = (_aabb.min.x + _aabb.max.x) * 0.5f;
- _outObb.mtx[13] = (_aabb.min.y + _aabb.max.y) * 0.5f;
- _outObb.mtx[14] = (_aabb.min.z + _aabb.max.z) * 0.5f;
- _outObb.mtx[15] = 1.0f;
-}
-
-void calcObb(Obb& _outObb, const void* _vertices, uint32_t _numVertices, uint32_t _stride, uint32_t _steps)
-{
- Aabb aabb;
- toAabb(aabb, _vertices, _numVertices, _stride);
- float minArea = calcAreaAabb(aabb);
-
- Obb best;
- toObb(best, aabb);
-
- float angleStep = float(kPiHalf/_steps);
- float ax = 0.0f;
- float mtx[16];
-
- for (uint32_t ii = 0; ii < _steps; ++ii)
- {
- float ay = 0.0f;
-
- for (uint32_t jj = 0; jj < _steps; ++jj)
- {
- float az = 0.0f;
-
- for (uint32_t kk = 0; kk < _steps; ++kk)
- {
- mtxRotateXYZ(mtx, ax, ay, az);
-
- float mtxT[16];
- mtxTranspose(mtxT, mtx);
- toAabb(aabb, mtxT, _vertices, _numVertices, _stride);
-
- float area = calcAreaAabb(aabb);
- if (area < minArea)
- {
- minArea = area;
- aabbTransformToObb(best, aabb, mtx);
- }
-
- az += angleStep;
- }
-
- ay += angleStep;
- }
-
- ax += angleStep;
- }
-
- memCopy(&_outObb, &best, sizeof(Obb) );
-}
-
-void calcMaxBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _numVertices, uint32_t _stride)
-{
- Aabb aabb;
- toAabb(aabb, _vertices, _numVertices, _stride);
-
- Vec3 center = getCenter(aabb);
-
- float maxDistSq = 0.0f;
- uint8_t* vertex = (uint8_t*)_vertices;
-
- for (uint32_t ii = 0; ii < _numVertices; ++ii)
- {
- const Vec3& pos = load<Vec3>(vertex);
- vertex += _stride;
-
- const Vec3 tmp = sub(pos, center);
- const float distSq = dot(tmp, tmp);
- maxDistSq = max(distSq, maxDistSq);
- }
-
- _sphere.center = center;
- _sphere.radius = bx::sqrt(maxDistSq);
-}
-
-void calcMinBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _numVertices, uint32_t _stride, float _step)
-{
- RngMwc rng;
-
- uint8_t* vertex = (uint8_t*)_vertices;
-
- Vec3 center(init::None);
- float* position = (float*)&vertex[0];
- center.x = position[0];
- center.y = position[1];
- center.z = position[2];
-
- position = (float*)&vertex[1*_stride];
- center.x += position[0];
- center.y += position[1];
- center.z += position[2];
-
- center.x *= 0.5f;
- center.y *= 0.5f;
- center.z *= 0.5f;
-
- float xx = position[0] - center.x;
- float yy = position[1] - center.y;
- float zz = position[2] - center.z;
- float maxDistSq = xx*xx + yy*yy + zz*zz;
-
- float radiusStep = _step * 0.37f;
-
- bool done;
- do
- {
- done = true;
- for (uint32_t ii = 0, index = rng.gen()%_numVertices; ii < _numVertices; ++ii, index = (index + 1)%_numVertices)
- {
- position = (float*)&vertex[index*_stride];
-
- xx = position[0] - center.x;
- yy = position[1] - center.y;
- zz = position[2] - center.z;
- float distSq = xx*xx + yy*yy + zz*zz;
-
- if (distSq > maxDistSq)
- {
- done = false;
-
- center.x += xx * radiusStep;
- center.y += yy * radiusStep;
- center.z += zz * radiusStep;
- maxDistSq = lerp(maxDistSq, distSq, _step);
-
- break;
- }
- }
-
- } while (!done);
-
- _sphere.center = center;
- _sphere.radius = bx::sqrt(maxDistSq);
-}
-
-void buildFrustumPlanes(Plane* _result, const float* _viewProj)
-{
- const float xw = _viewProj[ 3];
- const float yw = _viewProj[ 7];
- const float zw = _viewProj[11];
- const float ww = _viewProj[15];
-
- const float xz = _viewProj[ 2];
- const float yz = _viewProj[ 6];
- const float zz = _viewProj[10];
- const float wz = _viewProj[14];
-
- Plane& near = _result[0];
- Plane& far = _result[1];
- Plane& left = _result[2];
- Plane& right = _result[3];
- Plane& top = _result[4];
- Plane& bottom = _result[5];
-
- near.normal.x = xw - xz;
- near.normal.y = yw - yz;
- near.normal.z = zw - zz;
- near.dist = ww - wz;
-
- far.normal.x = xw + xz;
- far.normal.y = yw + yz;
- far.normal.z = zw + zz;
- far.dist = ww + wz;
-
- const float xx = _viewProj[ 0];
- const float yx = _viewProj[ 4];
- const float zx = _viewProj[ 8];
- const float wx = _viewProj[12];
-
- left.normal.x = xw - xx;
- left.normal.y = yw - yx;
- left.normal.z = zw - zx;
- left.dist = ww - wx;
-
- right.normal.x = xw + xx;
- right.normal.y = yw + yx;
- right.normal.z = zw + zx;
- right.dist = ww + wx;
-
- const float xy = _viewProj[ 1];
- const float yy = _viewProj[ 5];
- const float zy = _viewProj[ 9];
- const float wy = _viewProj[13];
-
- top.normal.x = xw + xy;
- top.normal.y = yw + yy;
- top.normal.z = zw + zy;
- top.dist = ww + wy;
-
- bottom.normal.x = xw - xy;
- bottom.normal.y = yw - yy;
- bottom.normal.z = zw - zy;
- bottom.dist = ww - wy;
-
- Plane* plane = _result;
- for (uint32_t ii = 0; ii < 6; ++ii)
- {
- const float invLen = 1.0f/length(plane->normal);
- plane->normal = normalize(plane->normal);
- plane->dist *= invLen;
- ++plane;
- }
-}
-
-Ray makeRay(float _x, float _y, const float* _invVp)
-{
- Ray ray;
-
- const Vec3 near = { _x, _y, 0.0f };
- ray.pos = mulH(near, _invVp);
-
- const Vec3 far = { _x, _y, 1.0f };
- Vec3 tmp = mulH(far, _invVp);
-
- const Vec3 dir = sub(tmp, ray.pos);
- ray.dir = normalize(dir);
-
- return ray;
-}
-
-inline Vec3 getPointAt(const Ray& _ray, float _t)
-{
- return mad(_ray.dir, _t, _ray.pos);
-}
-
-bool intersect(const Ray& _ray, const Aabb& _aabb, Hit* _hit)
-{
- const Vec3 invDir = rcp(_ray.dir);
- const Vec3 tmp0 = sub(_aabb.min, _ray.pos);
- const Vec3 t0 = mul(tmp0, invDir);
- const Vec3 tmp1 = sub(_aabb.max, _ray.pos);
- const Vec3 t1 = mul(tmp1, invDir);
-
- const Vec3 mn = min(t0, t1);
- const Vec3 mx = max(t0, t1);
-
- const float tmin = max(mn.x, mn.y, mn.z);
- const float tmax = min(mx.x, mx.y, mx.z);
-
- if (0.0f > tmax
- || tmin > tmax)
- {
- return false;
- }
-
- if (NULL != _hit)
- {
- _hit->plane.normal.x = float( (t1.x == tmin) - (t0.x == tmin) );
- _hit->plane.normal.y = float( (t1.y == tmin) - (t0.y == tmin) );
- _hit->plane.normal.z = float( (t1.z == tmin) - (t0.z == tmin) );
-
- _hit->plane.dist = tmin;
- _hit->pos = getPointAt(_ray, tmin);
- }
-
- return true;
-}
-
-static constexpr Aabb kUnitAabb =
-{
- { -1.0f, -1.0f, -1.0f },
- { 1.0f, 1.0f, 1.0f },
-};
-
-bool intersect(const Ray& _ray, const Obb& _obb, Hit* _hit)
-{
- Aabb aabb;
- toAabb(aabb, _obb);
-
- if (!intersect(_ray, aabb) )
- {
- return false;
- }
-
- float mtxInv[16];
- mtxInverse(mtxInv, _obb.mtx);
-
- Ray obbRay;
- obbRay.pos = mul(_ray.pos, mtxInv);
- obbRay.dir = mulXyz0(_ray.dir, mtxInv);
-
- if (intersect(obbRay, kUnitAabb, _hit) )
- {
- if (NULL != _hit)
- {
- _hit->pos = mul(_hit->pos, _obb.mtx);
-
- const Vec3 tmp = mulXyz0(_hit->plane.normal, _obb.mtx);
- _hit->plane.normal = normalize(tmp);
- }
-
- return true;
- }
-
- return false;
-}
-
-bool intersect(const Ray& _ray, const Disk& _disk, Hit* _hit)
-{
- Plane plane(_disk.normal, -dot(_disk.center, _disk.normal) );
-
- Hit tmpHit;
- _hit = NULL != _hit ? _hit : &tmpHit;
-
- if (intersect(_ray, plane, _hit) )
- {
- const Vec3 tmp = sub(_disk.center, _hit->pos);
- return dot(tmp, tmp) <= square(_disk.radius);
- }
-
- return false;
-}
-
-static bool intersect(const Ray& _ray, const Cylinder& _cylinder, bool _capsule, Hit* _hit)
-{
- Vec3 axis = sub(_cylinder.end, _cylinder.pos);
- const Vec3 rc = sub(_ray.pos, _cylinder.pos);
- const Vec3 dxa = cross(_ray.dir, axis);
-
- const float len = length(dxa);
- const Vec3 normal = normalize(dxa);
- const float dist = bx::abs(dot(rc, normal) );
-
- if (dist > _cylinder.radius)
- {
- return false;
- }
-
- Vec3 vo = cross(rc, axis);
- const float t0 = -dot(vo, normal) / len;
-
- vo = normalize(cross(normal, axis) );
-
- const float rsq = square(_cylinder.radius);
- const float ddoto = dot(_ray.dir, vo);
- const float ss = t0 - bx::abs(bx::sqrt(rsq - square(dist) ) / ddoto);
-
- if (0.0f > ss)
- {
- return false;
- }
-
- const Vec3 point = getPointAt(_ray, ss);
-
- const float axisLen = length(axis);
- axis = normalize(axis);
- const float pdota = dot(_cylinder.pos, axis);
- const float height = dot(point, axis) - pdota;
-
- if (0.0f < height
- && axisLen > height)
- {
- if (NULL != _hit)
- {
- const float t1 = height / axisLen;
- const Vec3 pointOnAxis = lerp(_cylinder.pos, _cylinder.end, t1);
-
- _hit->pos = point;
-
- const Vec3 tmp = sub(point, pointOnAxis);
- _hit->plane.normal = normalize(tmp);
-
- _hit->plane.dist = ss;
- }
-
- return true;
- }
-
- if (_capsule)
- {
- const float rdota = dot(_ray.pos, axis);
- const float pp = rdota - pdota;
- const float t1 = pp / axisLen;
-
- const Vec3 pointOnAxis = lerp(_cylinder.pos, _cylinder.end, t1);
- const Vec3 axisToRay = sub(_ray.pos, pointOnAxis);
-
- if (_cylinder.radius < length(axisToRay)
- && 0.0f > ss)
- {
- return false;
- }
-
- Sphere sphere;
- sphere.radius = _cylinder.radius;
-
- sphere.center = 0.0f >= height
- ? _cylinder.pos
- : _cylinder.end
- ;
-
- return intersect(_ray, sphere, _hit);
- }
-
- Plane plane(init::None);
- Vec3 pos(init::None);
-
- if (0.0f >= height)
- {
- plane.normal = neg(axis);
- pos = _cylinder.pos;
- }
- else
- {
- plane.normal = axis;
- pos = _cylinder.end;
- }
-
- plane.dist = -dot(pos, plane.normal);
-
- Hit tmpHit;
- _hit = NULL != _hit ? _hit : &tmpHit;
-
- if (intersect(_ray, plane, _hit) )
- {
- const Vec3 tmp = sub(pos, _hit->pos);
- return dot(tmp, tmp) <= rsq;
- }
-
- return false;
-}
-
-bool intersect(const Ray& _ray, const Cylinder& _cylinder, Hit* _hit)
-{
- return intersect(_ray, _cylinder, false, _hit);
-}
-
-bool intersect(const Ray& _ray, const Capsule& _capsule, Hit* _hit)
-{
- BX_STATIC_ASSERT(sizeof(Capsule) == sizeof(Cylinder) );
- return intersect(_ray, *( (const Cylinder*)&_capsule), true, _hit);
-}
-
-bool intersect(const Ray& _ray, const Cone& _cone, Hit* _hit)
-{
- const Vec3 axis = sub(_cone.pos, _cone.end);
-
- const float len = length(axis);
- const Vec3 normal = normalize(axis);
-
- Disk disk;
- disk.center = _cone.pos;
- disk.normal = normal;
- disk.radius = _cone.radius;
-
- Hit tmpInt;
- Hit* out = NULL != _hit ? _hit : &tmpInt;
- bool hit = intersect(_ray, disk, out);
-
- const Vec3 ro = sub(_ray.pos, _cone.end);
-
- const float hyp = bx::sqrt(square(_cone.radius) + square(len) );
- const float cosaSq = square(len/hyp);
- const float ndoto = dot(normal, ro);
- const float ndotd = dot(normal, _ray.dir);
-
- const float aa = square(ndotd) - cosaSq;
- const float bb = 2.0f * (ndotd*ndoto - dot(_ray.dir, ro)*cosaSq);
- const float cc = square(ndoto) - dot(ro, ro)*cosaSq;
-
- float det = bb*bb - 4.0f*aa*cc;
-
- if (0.0f > det)
- {
- return hit;
- }
-
- det = bx::sqrt(det);
- const float invA2 = 1.0f / (2.0f*aa);
- const float t1 = (-bb - det) * invA2;
- const float t2 = (-bb + det) * invA2;
-
- float tt = t1;
- if (0.0f > t1
- || (0.0f < t2 && t2 < t1) )
- {
- tt = t2;
- }
-
- if (0.0f > tt)
- {
- return hit;
- }
-
- const Vec3 hitPos = getPointAt(_ray, tt);
- const Vec3 point = sub(hitPos, _cone.end);
-
- const float hh = dot(normal, point);
-
- if (0.0f > hh
- || len < hh)
- {
- return hit;
- }
-
- if (NULL != _hit)
- {
- if (!hit
- || tt < _hit->plane.dist)
- {
- _hit->plane.dist = tt;
- _hit->pos = hitPos;
-
- const float scale = hh / dot(point, point);
- const Vec3 pointScaled = mul(point, scale);
-
- const Vec3 tmp = sub(pointScaled, normal);
- _hit->plane.normal = normalize(tmp);
- }
- }
-
- return true;
-}
-
-bool intersect(const Ray& _ray, const Plane& _plane, Hit* _hit)
-{
- const float dist = distance(_plane, _ray.pos);
- if (0.0f > dist)
- {
- return false;
- }
-
- const float ndotd = dot(_ray.dir, _plane.normal);
- if (0.0f < ndotd)
- {
- return false;
- }
-
- if (NULL != _hit)
- {
- _hit->plane.normal = _plane.normal;
-
- float tt = -dist/ndotd;
- _hit->plane.dist = tt;
- _hit->pos = getPointAt(_ray, tt);
- }
-
- return true;
-}
-
-bool intersect(const Ray& _ray, const Sphere& _sphere, Hit* _hit)
-{
- const Vec3 rs = sub(_ray.pos, _sphere.center);
-
- const float bb = dot(rs, _ray.dir);
- if (0.0f < bb)
- {
- return false;
- }
-
- const float aa = dot(_ray.dir, _ray.dir);
- const float cc = dot(rs, rs) - square(_sphere.radius);
-
- const float discriminant = bb*bb - aa*cc;
-
- if (0.0f >= discriminant)
- {
- return false;
- }
-
- const float sqrtDiscriminant = bx::sqrt(discriminant);
- const float invA = 1.0f / aa;
- const float tt = -(bb + sqrtDiscriminant)*invA;
-
- if (0.0f >= tt)
- {
- return false;
- }
-
- if (NULL != _hit)
- {
- _hit->plane.dist = tt;
-
- const Vec3 point = getPointAt(_ray, tt);
- _hit->pos = point;
-
- const Vec3 tmp = sub(point, _sphere.center);
- _hit->plane.normal = normalize(tmp);
- }
-
- return true;
-}
-
-bool intersect(const Ray& _ray, const Triangle& _triangle, Hit* _hit)
-{
- const Vec3 edge10 = sub(_triangle.v1, _triangle.v0);
- const Vec3 edge02 = sub(_triangle.v0, _triangle.v2);
- const Vec3 normal = cross(edge02, edge10);
- const Vec3 vo = sub(_triangle.v0, _ray.pos);
- const Vec3 dxo = cross(_ray.dir, vo);
- const float det = dot(normal, _ray.dir);
-
- if (0.0f < det)
- {
- return false;
- }
-
- const float invDet = 1.0f/det;
- const float bz = dot(dxo, edge02) * invDet;
- const float by = dot(dxo, edge10) * invDet;
- const float bx = 1.0f - by - bz;
-
- if (0.0f > bx
- || 0.0f > by
- || 0.0f > bz)
- {
- return false;
- }
-
- if (NULL != _hit)
- {
- _hit->plane.normal = normalize(normal);
-
- const float tt = dot(normal, vo) * invDet;
- _hit->plane.dist = tt;
- _hit->pos = getPointAt(_ray, tt);
- }
-
- return true;
-}
-
-Vec3 barycentric(const Triangle& _triangle, const Vec3& _pos)
-{
- const Vec3 v0 = sub(_triangle.v1, _triangle.v0);
- const Vec3 v1 = sub(_triangle.v2, _triangle.v0);
- const Vec3 v2 = sub(_pos, _triangle.v0);
-
- const float dot00 = dot(v0, v0);
- const float dot01 = dot(v0, v1);
- const float dot02 = dot(v0, v2);
- const float dot11 = dot(v1, v1);
- const float dot12 = dot(v1, v2);
-
- const float invDenom = 1.0f/(dot00*dot11 - square(dot01) );
-
- const float vv = (dot11*dot02 - dot01*dot12)*invDenom;
- const float ww = (dot00*dot12 - dot01*dot02)*invDenom;
- const float uu = 1.0f - vv - ww;
-
- return { uu, vv, ww };
-}
-
-Vec3 cartesian(const Triangle& _triangle, const Vec3& _uvw)
-{
- const Vec3 b0 = mul(_triangle.v0, _uvw.x);
- const Vec3 b1 = mul(_triangle.v1, _uvw.y);
- const Vec3 b2 = mul(_triangle.v2, _uvw.z);
-
- return add(add(b0, b1), b2);
-}
-
-void calcPlane(Plane& _outPlane, const Disk& _disk)
-{
- calcPlane(_outPlane, _disk.normal, _disk.center);
-}
-
-void calcPlane(Plane& _outPlane, const Triangle& _triangle)
-{
- calcPlane(_outPlane, _triangle.v0, _triangle.v1, _triangle.v2);
-}
-
-struct Interval
-{
- Interval(float _val)
- : start(_val)
- , end(_val)
- {
- }
-
- Interval(float _start, float _end)
- : start(_start)
- , end(_end)
- {
- }
-
- void set(float _val)
- {
- start = _val;
- end = _val;
- }
-
- void expand(float _val)
- {
- start = min(_val, start);
- end = max(_val, end);
- }
-
- float start;
- float end;
-};
-
-bool overlap(const Interval& _a, const Interval& _b)
-{
- return _a.end > _b.start
- && _b.end > _a.start
- ;
-}
-
-float projectToAxis(const Vec3& _axis, const Vec3& _point)
-{
- return dot(_axis, _point);
-}
-
-Interval projectToAxis(const Vec3& _axis, const Vec3* _points, uint32_t _num)
-{
- Interval interval(projectToAxis(_axis, _points[0]) );
-
- for (uint32_t ii = 1; ii < _num; ++ii)
- {
- interval.expand(projectToAxis(_axis, _points[ii]) );
- }
-
- return interval;
-}
-
-Interval projectToAxis(const Vec3& _axis, const Aabb& _aabb)
-{
- const float extent = bx::abs(projectToAxis(abs(_axis), getExtents(_aabb) ) );
- const float center = projectToAxis( _axis , getCenter (_aabb) );
- return
- {
- center - extent,
- center + extent,
- };
-}
-
-Interval projectToAxis(const Vec3& _axis, const Triangle& _triangle)
-{
- const float a0 = projectToAxis(_axis, _triangle.v0);
- const float a1 = projectToAxis(_axis, _triangle.v1);
- const float a2 = projectToAxis(_axis, _triangle.v2);
- return
- {
- min(a0, a1, a2),
- max(a0, a1, a2),
- };
-}
-
-struct Srt
-{
- Quaternion rotation = init::Identity;
- Vec3 translation = init::Zero;
- Vec3 scale = init::Zero;
-};
-
-Srt toSrt(const Aabb& _aabb)
-{
- return { init::Identity, getCenter(_aabb), getExtents(_aabb) };
-}
-
-Srt toSrt(const void* _mtx)
-{
- Srt result;
-
- const float* mtx = (const float*)_mtx;
-
- result.translation = { mtx[12], mtx[13], mtx[14] };
-
- float xx = mtx[ 0];
- float xy = mtx[ 1];
- float xz = mtx[ 2];
- float yx = mtx[ 4];
- float yy = mtx[ 5];
- float yz = mtx[ 6];
- float zx = mtx[ 8];
- float zy = mtx[ 9];
- float zz = mtx[10];
-
- result.scale =
- {
- bx::sqrt(xx*xx + xy*xy + xz*xz),
- bx::sqrt(yx*yx + yy*yy + yz*yz),
- bx::sqrt(zx*zx + zy*zy + zz*zz),
- };
-
- const Vec3 invScale = rcp(result.scale);
-
- xx *= invScale.x;
- xy *= invScale.x;
- xz *= invScale.x;
- yx *= invScale.y;
- yy *= invScale.y;
- yz *= invScale.y;
- zx *= invScale.z;
- zy *= invScale.z;
- zz *= invScale.z;
-
- const float trace = xx + yy + zz;
-
- if (0.0f < trace)
- {
- const float invS = 0.5f * rsqrt(trace + 1.0f);
- result.rotation =
- {
- (yz - zy) * invS,
- (zx - xz) * invS,
- (xy - yx) * invS,
- 0.25f / invS,
- };
- }
- else
- {
- if (xx > yy
- && xx > zz)
- {
- const float invS = 0.5f * bx::sqrt(max(1.0f + xx - yy - zz, 1e-8f) );
- result.rotation =
- {
- 0.25f / invS,
- (xy + yx) * invS,
- (xz + zx) * invS,
- (yz - zy) * invS,
- };
- }
- else if (yy > zz)
- {
- const float invS = 0.5f * bx::sqrt(max(1.0f + yy - xx - zz, 1e-8f) );
- result.rotation =
- {
- (xy + yx) * invS,
- 0.25f / invS,
- (yz + zy) * invS,
- (zx - xz) * invS,
- };
- }
- else
- {
- const float invS = 0.5f * bx::sqrt(max(1.0f + zz - xx - yy, 1e-8f) );
- result.rotation =
- {
- (xz + zx) * invS,
- (yz + zy) * invS,
- 0.25f / invS,
- (xy - yx) * invS,
- };
- }
- }
-
- return result;
-}
-
-void mtxFromSrt(float* _outMtx, const Srt& _srt)
-{
- mtxQuat(_outMtx, _srt.rotation);
-
- store<Vec3>(&_outMtx[0], mul(load<Vec3>(&_outMtx[0]), _srt.scale.x) );
- store<Vec3>(&_outMtx[4], mul(load<Vec3>(&_outMtx[4]), _srt.scale.y) );
- store<Vec3>(&_outMtx[8], mul(load<Vec3>(&_outMtx[8]), _srt.scale.z) );
-
- store<Vec3>(&_outMtx[12], _srt.translation);
-}
-
-bool isNearZero(float _v)
-{
- return equal(_v, 0.0f, 0.00001f);
-}
-
-bool isNearZero(const Vec3& _v)
-{
- return isNearZero(dot(_v, _v) );
-}
-
-struct Line
-{
- Vec3 pos = init::None;
- Vec3 dir = init::None;
-};
-
-inline Vec3 getPointAt(const Line& _line, float _t)
-{
- return mad(_line.dir, _t, _line.pos);
-}
-
-bool intersect(Line& _outLine, const Plane& _planeA, const Plane& _planeB)
-{
- const Vec3 axb = cross(_planeA.normal, _planeB.normal);
- const float denom = dot(axb, axb);
-
- if (isNearZero(denom) )
- {
- return false;
- }
-
- const Vec3 bxaxb = cross(_planeB.normal, axb);
- const Vec3 axbxa = cross(axb, _planeA.normal);
- const Vec3 tmp0 = mul(bxaxb, _planeA.dist);
- const Vec3 tmp1 = mul(axbxa, _planeB.dist);
- const Vec3 tmp2 = add(tmp0, tmp1);
-
- _outLine.pos = mul(tmp2, -1.0f/denom);
- _outLine.dir = normalize(axb);
-
- return true;
-}
-
-Vec3 intersectPlanes(const Plane& _pa, const Plane& _pb, const Plane& _pc)
-{
- const Vec3 axb = cross(_pa.normal, _pb.normal);
- const Vec3 bxc = cross(_pb.normal, _pc.normal);
- const Vec3 cxa = cross(_pc.normal, _pa.normal);
- const Vec3 tmp0 = mul(bxc, _pa.dist);
- const Vec3 tmp1 = mul(cxa, _pb.dist);
- const Vec3 tmp2 = mul(axb, _pc.dist);
- const Vec3 tmp3 = add(tmp0, tmp1);
- const Vec3 tmp4 = add(tmp3, tmp2);
-
- const float denom = dot(_pa.normal, bxc);
- const Vec3 result = mul(tmp4, -1.0f/denom);
-
- return result;
-}
-
-struct LineSegment
-{
- Vec3 pos;
- Vec3 end;
-};
-
-inline Vec3 getPointAt(const LineSegment& _line, float _t)
-{
- return lerp(_line.pos, _line.end, _t);
-}
-
-bool intersect(float& _outTa, float& _outTb, const LineSegment& _a, const LineSegment& _b)
-{
- // Reference(s):
- //
- // - The shortest line between two lines in 3D
- // https://web.archive.org/web/20120309093234/http://paulbourke.net/geometry/lineline3d/
-
- const Vec3 bd = sub(_b.end, _b.pos);
- if (isNearZero(bd) )
- {
- return false;
- }
-
- const Vec3 ad = sub(_a.end, _a.pos);
- if (isNearZero(ad) )
- {
- return false;
- }
-
- const Vec3 ab = sub(_a.pos, _b.pos);
-
- const float d0 = projectToAxis(ab, bd);
- const float d1 = projectToAxis(ad, bd);
- const float d2 = projectToAxis(ab, ad);
- const float d3 = projectToAxis(bd, bd);
- const float d4 = projectToAxis(ad, ad);
-
- const float denom = d4*d3 - square(d1);
-
- float ta = 0.0f;
-
- if (!isNearZero(denom) )
- {
- ta = (d0*d1 - d2*d3)/denom;
- }
-
- _outTa = ta;
- _outTb = (d0+d1*ta)/d3;
-
- return true;
-}
-
-bool intersect(const LineSegment& _a, const LineSegment& _b)
-{
- float ta, tb;
- if (!intersect(ta, tb, _a, _b) )
- {
- return false;
- }
-
- return 0.0f >= ta
- && 1.0f <= ta
- && 0.0f >= tb
- && 1.0f <= tb
- ;
-}
-
-bool intersect(const LineSegment& _line, const Plane& _plane, Hit* _hit)
-{
- const float dist = distance(_plane, _line.pos);
- const float flip = sign(dist);
- const Vec3 dir = normalize(sub(_line.end, _line.pos) );
- const float ndotd = dot(dir, _plane.normal);
- const float tt = -dist/ndotd;
- const float len = length(sub(_line.end, _line.pos) );
-
- if (tt < 0.0f || tt > len)
- {
- return false;
- }
-
- if (NULL != _hit)
- {
- _hit->pos = mad(dir, tt, _line.pos);
-
- _hit->plane.normal = mul(_plane.normal, flip);
- _hit->plane.dist = -dot(_hit->plane.normal, _hit->pos);
- }
-
- return true;
-}
-
-float distance(const Plane& _plane, const LineSegment& _line)
-{
- const float pd = distance(_plane, _line.pos);
- const float ed = distance(_plane, _line.end);
- return min(max(pd*ed, 0.0f), bx::abs(pd), bx::abs(ed) );
-}
-
-Vec3 closestPoint(const Line& _line, const Vec3& _point)
-{
- const float tt = projectToAxis(_line.dir, sub(_point, _line.pos) );
- return getPointAt(_line, tt);
-}
-
-Vec3 closestPoint(const LineSegment& _line, const Vec3& _point, float& _outT)
-{
- const Vec3 axis = sub(_line.end, _line.pos);
- const float lengthSq = dot(axis, axis);
- const float tt = clamp(projectToAxis(axis, sub(_point, _line.pos) ) / lengthSq, 0.0f, 1.0f);
- _outT = tt;
- return mad(axis, tt, _line.pos);
-}
-
-Vec3 closestPoint(const LineSegment& _line, const Vec3& _point)
-{
- float ignored;
- return closestPoint(_line, _point, ignored);
-}
-
-Vec3 closestPoint(const Plane& _plane, const Vec3& _point)
-{
- const float dist = distance(_plane, _point);
- return sub(_point, mul(_plane.normal, dist) );
-}
-
-Vec3 closestPoint(const Aabb& _aabb, const Vec3& _point)
-{
- return clamp(_point, _aabb.min, _aabb.max);
-}
-
-Vec3 closestPoint(const Obb& _obb, const Vec3& _point)
-{
- const Srt srt = toSrt(_obb.mtx);
-
- Aabb aabb;
- toAabb(aabb, srt.scale);
-
- const Quaternion invRotation = invert(srt.rotation);
- const Vec3 obbSpacePos = mul(sub(_point, srt.translation), srt.rotation);
- const Vec3 pos = closestPoint(aabb, obbSpacePos);
-
- return add(mul(pos, invRotation), srt.translation);
-}
-
-Vec3 closestPoint(const Triangle& _triangle, const Vec3& _point)
-{
- Plane plane(init::None);
- calcPlane(plane, _triangle);
-
- const Vec3 pos = closestPoint(plane, _point);
- const Vec3 uvw = barycentric(_triangle, pos);
-
- return cartesian(_triangle, clamp<Vec3>(uvw, Vec3(0.0f), Vec3(1.0f) ) );
-}
-
-bool overlap(const Aabb& _aabb, const Vec3& _pos)
-{
- const Vec3 ac = getCenter(_aabb);
- const Vec3 ae = getExtents(_aabb);
- const Vec3 abc = bx::abs(sub(ac, _pos) );
-
- return abc.x <= ae.x
- && abc.y <= ae.y
- && abc.z <= ae.z
- ;
-}
-
-bool overlap(const Aabb& _aabbA, const Aabb& _aabbB)
-{
- return true
- && overlap(Interval{_aabbA.min.x, _aabbA.max.x}, Interval{_aabbB.min.x, _aabbB.max.x})
- && overlap(Interval{_aabbA.min.y, _aabbA.max.y}, Interval{_aabbB.min.y, _aabbB.max.y})
- && overlap(Interval{_aabbA.min.z, _aabbA.max.z}, Interval{_aabbB.min.z, _aabbB.max.z})
- ;
-}
-
-bool overlap(const Aabb& _aabb, const Plane& _plane)
-{
- const Vec3 center = getCenter(_aabb);
- const float dist = distance(_plane, center);
-
- const Vec3 extents = getExtents(_aabb);
- const Vec3 normal = bx::abs(_plane.normal);
- const float radius = dot(extents, normal);
-
- return bx::abs(dist) <= radius;
-}
-
-static constexpr Vec3 kAxis[] =
-{
- { 1.0f, 0.0f, 0.0f },
- { 0.0f, 1.0f, 0.0f },
- { 0.0f, 0.0f, 1.0f },
-};
-
-bool overlap(const Aabb& _aabb, const Triangle& _triangle)
-{
- Aabb triAabb;
- toAabb(triAabb, _triangle);
-
- if (!overlap(_aabb, triAabb) )
- {
- return false;
- }
-
- Plane plane(init::None);
- calcPlane(plane, _triangle);
-
- if (!overlap(_aabb, plane) )
- {
- return false;
- }
-
- const Vec3 center = getCenter(_aabb);
- const Vec3 v0 = sub(_triangle.v0, center);
- const Vec3 v1 = sub(_triangle.v1, center);
- const Vec3 v2 = sub(_triangle.v2, center);
-
- const Vec3 edge[] =
- {
- sub(v1, v0),
- sub(v2, v1),
- sub(v0, v2),
- };
-
- for (uint32_t ii = 0; ii < 3; ++ii)
- {
- for (uint32_t jj = 0; jj < 3; ++jj)
- {
- const Vec3 axis = cross(kAxis[ii], edge[jj]);
-
- const Interval aabbR = projectToAxis(axis, _aabb);
- const Interval triR = projectToAxis(axis, _triangle);
-
- if (!overlap(aabbR, triR) )
- {
- return false;
- }
- }
- }
-
- return true;
-}
-
-bool overlap(const Aabb& _aabb, const Capsule& _capsule)
-{
- const Vec3 pos = closestPoint(LineSegment{_capsule.pos, _capsule.end}, getCenter(_aabb) );
- return overlap(_aabb, Sphere{pos, _capsule.radius});
-}
-
-bool overlap(const Aabb& _aabb, const Cone& _cone)
-{
- float tt;
- const Vec3 pos = closestPoint(LineSegment{_cone.pos, _cone.end}, getCenter(_aabb), tt);
- return overlap(_aabb, Sphere{pos, lerp(_cone.radius, 0.0f, tt)});
-}
-
-bool overlap(const Aabb& _aabb, const Disk& _disk)
-{
- if (!overlap(_aabb, Sphere{_disk.center, _disk.radius}) )
- {
- return false;
- }
-
- Plane plane(init::None);
- calcPlane(plane, _disk.normal, _disk.center);
-
- return overlap(_aabb, plane);
-}
-
-static void calcObbVertices(
- bx::Vec3* _outVertices
- , const bx::Vec3& _axisX
- , const bx::Vec3& _axisY
- , const bx::Vec3& _axisZ
- , const bx::Vec3& _pos
- , const bx::Vec3& _scale
- )
-{
- const Vec3 ax = mul(_axisX, _scale.x);
- const Vec3 ay = mul(_axisY, _scale.y);
- const Vec3 az = mul(_axisZ, _scale.z);
-
- const Vec3 ppx = add(_pos, ax);
- const Vec3 pmx = sub(_pos, ax);
- const Vec3 ypz = add(ay, az);
- const Vec3 ymz = sub(ay, az);
-
- _outVertices[0] = sub(pmx, ymz);
- _outVertices[1] = sub(ppx, ymz);
- _outVertices[2] = add(ppx, ymz);
- _outVertices[3] = add(pmx, ymz);
- _outVertices[4] = sub(pmx, ypz);
- _outVertices[5] = sub(ppx, ypz);
- _outVertices[6] = add(ppx, ypz);
- _outVertices[7] = add(pmx, ypz);
-}
-
-static bool overlaps(const Vec3& _axis, const Vec3* _vertsA, const Vec3* _vertsB)
-{
- Interval ia = projectToAxis(_axis, _vertsA, 8);
- Interval ib = projectToAxis(_axis, _vertsB, 8);
-
- return overlap(ia, ib);
-}
-
-static bool overlap(const Srt& _srtA, const Srt& _srtB)
-{
- const Vec3 ax = toXAxis(_srtA.rotation);
- const Vec3 ay = toYAxis(_srtA.rotation);
- const Vec3 az = toZAxis(_srtA.rotation);
-
- const Vec3 bx = toXAxis(_srtB.rotation);
- const Vec3 by = toYAxis(_srtB.rotation);
- const Vec3 bz = toZAxis(_srtB.rotation);
-
- Vec3 vertsA[8] = { init::None, init::None, init::None, init::None, init::None, init::None, init::None, init::None };
- calcObbVertices(vertsA, ax, ay, az, init::Zero, _srtA.scale);
-
- Vec3 vertsB[8] = { init::None, init::None, init::None, init::None, init::None, init::None, init::None, init::None };
- calcObbVertices(vertsB, bx, by, bz, sub(_srtB.translation, _srtA.translation), _srtB.scale);
-
- return overlaps(ax, vertsA, vertsB)
- && overlaps(ay, vertsA, vertsB)
- && overlaps(az, vertsA, vertsB)
- && overlaps(bx, vertsA, vertsB)
- && overlaps(by, vertsA, vertsB)
- && overlaps(bz, vertsA, vertsB)
- && overlaps(cross(ax, bx), vertsA, vertsB)
- && overlaps(cross(ax, by), vertsA, vertsB)
- && overlaps(cross(ax, bz), vertsA, vertsB)
- && overlaps(cross(ay, bx), vertsA, vertsB)
- && overlaps(cross(ay, by), vertsA, vertsB)
- && overlaps(cross(ay, bz), vertsA, vertsB)
- && overlaps(cross(az, bx), vertsA, vertsB)
- && overlaps(cross(az, by), vertsA, vertsB)
- && overlaps(cross(az, bz), vertsA, vertsB)
- ;
-}
-
-bool overlap(const Aabb& _aabb, const Obb& _obb)
-{
- const Srt srtA = toSrt(_aabb);
- const Srt srtB = toSrt(_obb.mtx);
-
- return overlap(srtA, srtB);
-}
-
-bool overlap(const Capsule& _capsule, const Vec3& _pos)
-{
- const Vec3 pos = closestPoint(LineSegment{_capsule.pos, _capsule.end}, _pos);
- return overlap(Sphere{pos, _capsule.radius}, _pos);
-}
-
-bool overlap(const Capsule& _capsule, const Plane& _plane)
-{
- return distance(_plane, LineSegment{_capsule.pos, _capsule.end}) <= _capsule.radius;
-}
-
-bool overlap(const Capsule& _capsuleA, const Capsule& _capsuleB)
-{
- float ta, tb;
- if (!intersect(ta, tb, {_capsuleA.pos, _capsuleA.end}, {_capsuleB.pos, _capsuleB.end}) )
- {
- return false;
- }
-
- if (0.0f <= ta
- && 1.0f >= ta
- && 0.0f <= tb
- && 1.0f >= tb)
- {
- const Vec3 ad = sub(_capsuleA.end, _capsuleA.pos);
- const Vec3 bd = sub(_capsuleB.end, _capsuleB.pos);
-
- return overlap(
- Sphere{mad(ad, ta, _capsuleA.pos), _capsuleA.radius}
- , Sphere{mad(bd, tb, _capsuleB.pos), _capsuleB.radius}
- );
- }
-
- if (0.0f <= ta
- && 1.0f >= ta)
- {
- return overlap(_capsuleA, Sphere{0.0f >= tb ? _capsuleB.pos : _capsuleB.end, _capsuleB.radius});
- }
-
- if (0.0f <= tb
- && 1.0f >= tb)
- {
- return overlap(_capsuleB, Sphere{0.0f >= ta ? _capsuleA.pos : _capsuleA.end, _capsuleA.radius});
- }
-
- const Vec3 pa = 0.0f > ta ? _capsuleA.pos : _capsuleA.end;
- const Vec3 pb = 0.0f > tb ? _capsuleB.pos : _capsuleB.end;
- const Vec3 closestA = closestPoint(LineSegment{_capsuleA.pos, _capsuleA.end}, pb);
- const Vec3 closestB = closestPoint(LineSegment{_capsuleB.pos, _capsuleB.end}, pa);
-
- if (dot(closestA, pb) <= dot(closestB, pa) )
- {
- return overlap(_capsuleA, Sphere{closestB, _capsuleB.radius});
- }
-
- return overlap(_capsuleB, Sphere{closestA, _capsuleA.radius});
-}
-
-bool overlap(const Cone& _cone, const Vec3& _pos)
-{
- float tt;
- const Vec3 pos = closestPoint(LineSegment{_cone.pos, _cone.end}, _pos, tt);
- return overlap(Disk{pos, normalize(sub(_cone.end, _cone.pos) ), lerp(_cone.radius, 0.0f, tt)}, _pos);
-}
-
-bool overlap(const Cone& _cone, const Cylinder& _cylinder)
-{
- BX_UNUSED(_cone, _cylinder);
- return false;
-}
-
-bool overlap(const Cone& _cone, const Capsule& _capsule)
-{
- BX_UNUSED(_cone, _capsule);
- return false;
-}
-
-bool overlap(const Cone& _coneA, const Cone& _coneB)
-{
- BX_UNUSED(_coneA, _coneB);
- return false;
-}
-
-bool overlap(const Cone& _cone, const Disk& _disk)
-{
- BX_UNUSED(_cone, _disk);
- return false;
-}
-
-bool overlap(const Cone& _cone, const Obb& _obb)
-{
- BX_UNUSED(_cone, _obb);
- return false;
-}
-
-bool overlap(const Cylinder& _cylinder, const Vec3& _pos)
-{
- const Vec3 pos = closestPoint(LineSegment{_cylinder.pos, _cylinder.end}, _pos);
- return overlap(Disk{pos, normalize(sub(_cylinder.end, _cylinder.pos) ), _cylinder.radius}, _pos);
-}
-
-bool overlap(const Cylinder& _cylinder, const Sphere& _sphere)
-{
- const Vec3 pos = closestPoint(LineSegment{_cylinder.pos, _cylinder.end}, _sphere.center);
- return overlap(Disk{pos, normalize(sub(_cylinder.end, _cylinder.pos) ), _cylinder.radius}, _sphere);
-}
-
-bool overlap(const Cylinder& _cylinder, const Aabb& _aabb)
-{
- const Vec3 pos = closestPoint(LineSegment{_cylinder.pos, _cylinder.end}, getCenter(_aabb) );
- return overlap(Disk{pos, normalize(sub(_cylinder.end, _cylinder.pos) ), _cylinder.radius}, _aabb);
-}
-
-bool overlap(const Cylinder& _cylinder, const Plane& _plane)
-{
- BX_UNUSED(_cylinder, _plane);
- return false;
-}
-
-bool overlap(const Cylinder& _cylinderA, const Cylinder& _cylinderB)
-{
- BX_UNUSED(_cylinderA, _cylinderB);
- return false;
-}
-
-bool overlap(const Cylinder& _cylinder, const Capsule& _capsule)
-{
- BX_UNUSED(_cylinder, _capsule);
- return false;
-}
-
-bool overlap(const Cylinder& _cylinder, const Disk& _disk)
-{
- BX_UNUSED(_cylinder, _disk);
- return false;
-}
-
-bool overlap(const Cylinder& _cylinder, const Obb& _obb)
-{
- BX_UNUSED(_cylinder, _obb);
- return false;
-}
-
-bool overlap(const Disk& _disk, const Vec3& _pos)
-{
- Plane plane(init::None);
- calcPlane(plane, _disk.normal, _disk.center);
-
- if (!isNearZero(distance(plane, _pos) ) )
- {
- return false;
- }
-
- return distanceSq(_disk.center, _pos) <= square(_disk.radius);
-}
-
-bool overlap(const Disk& _disk, const Plane& _plane)
-{
- Plane plane(init::None);
- calcPlane(plane, _disk.normal, _disk.center);
-
- if (!overlap(plane, _plane) )
- {
- return false;
- }
-
- return overlap(_plane, Sphere{_disk.center, _disk.radius});
-}
-
-bool overlap(const Disk& _disk, const Capsule& _capsule)
-{
- if (!overlap(_capsule, Sphere{_disk.center, _disk.radius}) )
- {
- return false;
- }
-
- Plane plane(init::None);
- calcPlane(plane, _disk.normal, _disk.center);
-
- return overlap(_capsule, plane);
-}
-
-bool overlap(const Disk& _diskA, const Disk& _diskB)
-{
- Plane planeA(init::None);
- calcPlane(planeA, _diskA.normal, _diskA.center);
-
- Plane planeB(init::None);
- calcPlane(planeB, _diskB);
-
- Line line;
-
- if (!intersect(line, planeA, planeB) )
- {
- return false;
- }
-
- const Vec3 pa = closestPoint(line, _diskA.center);
- const Vec3 pb = closestPoint(line, _diskB.center);
-
- const float lenA = distance(pa, _diskA.center);
- const float lenB = distance(pb, _diskB.center);
-
- return bx::sqrt(square(_diskA.radius) - square(lenA) )
- + bx::sqrt(square(_diskB.radius) - square(lenB) )
- >= distance(pa, pb)
- ;
-}
-
-bool overlap(const Disk& _disk, const Obb& _obb)
-{
- if (!overlap(_obb, Sphere{_disk.center, _disk.radius}) )
- {
- return false;
- }
-
- Plane plane(init::None);
- calcPlane(plane, _disk.normal, _disk.center);
-
- return overlap(_obb, plane);
-}
-
-bool overlap(const Obb& _obb, const Vec3& _pos)
-{
- const Srt srt = toSrt(_obb.mtx);
-
- Aabb aabb;
- toAabb(aabb, srt.scale);
-
- const Quaternion invRotation = invert(srt.rotation);
- const Vec3 pos = mul(sub(_pos, srt.translation), invRotation);
-
- return overlap(aabb, pos);
-}
-
-bool overlap(const Obb& _obb, const Plane& _plane)
-{
- const Srt srt = toSrt(_obb.mtx);
-
- const Quaternion invRotation = invert(srt.rotation);
- const Vec3 axis =
- {
- projectToAxis(_plane.normal, mul(Vec3{1.0f, 0.0f, 0.0f}, invRotation) ),
- projectToAxis(_plane.normal, mul(Vec3{0.0f, 1.0f, 0.0f}, invRotation) ),
- projectToAxis(_plane.normal, mul(Vec3{0.0f, 0.0f, 1.0f}, invRotation) ),
- };
-
- const float dist = bx::abs(distance(_plane, srt.translation) );
- const float radius = dot(srt.scale, bx::abs(axis) );
-
- return dist <= radius;
-}
-
-bool overlap(const Obb& _obb, const Capsule& _capsule)
-{
- const Srt srt = toSrt(_obb.mtx);
-
- Aabb aabb;
- toAabb(aabb, srt.scale);
-
- const Quaternion invRotation = invert(srt.rotation);
-
- const Capsule capsule =
- {
- mul(sub(_capsule.pos, srt.translation), invRotation),
- mul(sub(_capsule.end, srt.translation), invRotation),
- _capsule.radius,
- };
-
- return overlap(aabb, capsule);
-}
-
-bool overlap(const Obb& _obbA, const Obb& _obbB)
-{
- const Srt srtA = toSrt(_obbA.mtx);
- const Srt srtB = toSrt(_obbB.mtx);
-
- return overlap(srtA, srtB);
-}
-
-bool overlap(const Plane& _plane, const LineSegment& _line)
-{
- return isNearZero(distance(_plane, _line) );
-}
-
-bool overlap(const Plane& _plane, const Vec3& _pos)
-{
- return isNearZero(distance(_plane, _pos) );
-}
-
-bool overlap(const Plane& _planeA, const Plane& _planeB)
-{
- const Vec3 dir = cross(_planeA.normal, _planeB.normal);
- const float len = length(dir);
-
- return !isNearZero(len);
-}
-
-bool overlap(const Plane& _plane, const Cone& _cone)
-{
- const Vec3 axis = sub(_cone.pos, _cone.end);
- const float len = length(axis);
- const Vec3 dir = normalize(axis);
-
- const Vec3 v1 = cross(_plane.normal, dir);
- const Vec3 v2 = cross(v1, dir);
-
- const float bb = len;
- const float aa = _cone.radius;
- const float cc = bx::sqrt(square(aa) + square(bb) );
-
- const Vec3 pos = add(add(_cone.end
- , mul(dir, len * bb/cc) )
- , mul(v2, len * aa/cc)
- );
-
- return overlap(_plane, LineSegment{pos, _cone.end});
-}
-
-bool overlap(const Sphere& _sphere, const Vec3& _pos)
-{
- const float distSq = distanceSq(_sphere.center, _pos);
- const float radiusSq = square(_sphere.radius);
- return distSq <= radiusSq;
-}
-
-bool overlap(const Sphere& _sphereA, const Sphere& _sphereB)
-{
- const float distSq = distanceSq(_sphereA.center, _sphereB.center);
- const float radiusSq = square(_sphereA.radius + _sphereB.radius);
- return distSq <= radiusSq;
-}
-
-bool overlap(const Sphere& _sphere, const Aabb& _aabb)
-{
- const Vec3 pos = closestPoint(_aabb, _sphere.center);
- return overlap(_sphere, pos);
-}
-
-bool overlap(const Sphere& _sphere, const Plane& _plane)
-{
- return bx::abs(distance(_plane, _sphere.center) ) <= _sphere.radius;
-}
-
-bool overlap(const Sphere& _sphere, const Triangle& _triangle)
-{
- Plane plane(init::None);
- calcPlane(plane, _triangle);
-
- if (!overlap(_sphere, plane) )
- {
- return false;
- }
-
- const Vec3 pos = closestPoint(plane, _sphere.center);
- const Vec3 uvw = barycentric(_triangle, pos);
- const float nr = -_sphere.radius;
-
- return uvw.x >= nr
- && uvw.y >= nr
- && uvw.z >= nr
- ;
-}
-
-bool overlap(const Sphere& _sphere, const Capsule& _capsule)
-{
- const Vec3 pos = closestPoint(LineSegment{_capsule.pos, _capsule.end}, _sphere.center);
- return overlap(_sphere, Sphere{pos, _capsule.radius});
-}
-
-bool overlap(const Sphere& _sphere, const Cone& _cone)
-{
- float tt;
- const Vec3 pos = closestPoint(LineSegment{_cone.pos, _cone.end}, _sphere.center, tt);
- return overlap(_sphere, Sphere{pos, lerp(_cone.radius, 0.0f, tt)});
-}
-
-bool overlap(const Sphere& _sphere, const Disk& _disk)
-{
- if (!overlap(_sphere, Sphere{_disk.center, _disk.radius}) )
- {
- return false;
- }
-
- Plane plane(init::None);
- calcPlane(plane, _disk.normal, _disk.center);
-
- return overlap(_sphere, plane);
-}
-
-bool overlap(const Sphere& _sphere, const Obb& _obb)
-{
- const Vec3 pos = closestPoint(_obb, _sphere.center);
- return overlap(_sphere, pos);
-}
-
-bool overlap(const Triangle& _triangle, const Vec3& _pos)
-{
- const Vec3 uvw = barycentric(_triangle, _pos);
-
- return uvw.x >= 0.0f
- && uvw.y >= 0.0f
- && uvw.z >= 0.0f
- ;
-}
-
-bool overlap(const Triangle& _triangle, const Plane& _plane)
-{
- const float dist0 = distance(_plane, _triangle.v0);
- const float dist1 = distance(_plane, _triangle.v1);
- const float dist2 = distance(_plane, _triangle.v2);
-
- const float minDist = min(dist0, dist1, dist2);
- const float maxDist = max(dist0, dist1, dist2);
-
- return 0.0f > minDist
- && 0.0f < maxDist
- ;
-}
-
-inline bool overlap(const Triangle& _triangleA, const Triangle& _triangleB, const Vec3& _axis)
-{
- const Interval ia = projectToAxis(_axis, _triangleA);
- const Interval ib = projectToAxis(_axis, _triangleB);
- return overlap(ia, ib);
-}
-
-bool overlap(const Triangle& _triangleA, const Triangle& _triangleB)
-{
- const Vec3 baA = sub(_triangleA.v1, _triangleA.v0);
- const Vec3 cbA = sub(_triangleA.v2, _triangleA.v1);
- const Vec3 acA = sub(_triangleA.v0, _triangleA.v2);
-
- const Vec3 baB = sub(_triangleB.v1, _triangleB.v0);
- const Vec3 cbB = sub(_triangleB.v2, _triangleB.v1);
- const Vec3 acB = sub(_triangleB.v0, _triangleB.v2);
-
- return overlap(_triangleA, _triangleB, cross(baA, cbA) )
- && overlap(_triangleA, _triangleB, cross(baB, cbB) )
- && overlap(_triangleA, _triangleB, cross(baB, baA) )
- && overlap(_triangleA, _triangleB, cross(baB, cbA) )
- && overlap(_triangleA, _triangleB, cross(baB, acA) )
- && overlap(_triangleA, _triangleB, cross(cbB, baA) )
- && overlap(_triangleA, _triangleB, cross(cbB, cbA) )
- && overlap(_triangleA, _triangleB, cross(cbB, acA) )
- && overlap(_triangleA, _triangleB, cross(acB, baA) )
- && overlap(_triangleA, _triangleB, cross(acB, cbA) )
- && overlap(_triangleA, _triangleB, cross(acB, acA) )
- ;
-}
-
-template<typename Ty>
-bool overlap(const Triangle& _triangle, const Ty& _ty)
-{
- Plane plane(init::None);
- calcPlane(plane, _triangle);
-
- plane.normal = neg(plane.normal);
- plane.dist = -plane.dist;
-
- const LineSegment line =
- {
- _ty.pos,
- _ty.end,
- };
-
- Hit hit;
- if (intersect(line, plane, &hit) )
- {
- return true;
- }
-
- const Vec3 pos = closestPoint(plane, hit.pos);
- const Vec3 uvw = barycentric(_triangle, pos);
-
- const float nr = -_ty.radius;
-
- if (uvw.x >= nr
- && uvw.y >= nr
- && uvw.z >= nr)
- {
- return true;
- }
-
- const LineSegment ab = LineSegment{_triangle.v0, _triangle.v1};
- const LineSegment bc = LineSegment{_triangle.v1, _triangle.v2};
- const LineSegment ca = LineSegment{_triangle.v2, _triangle.v0};
-
- float ta0 = 0.0f, tb0 = 0.0f;
- const bool i0 = intersect(ta0, tb0, ab, line);
-
- float ta1, tb1;
- const bool i1 = intersect(ta1, tb1, bc, line);
-
- float ta2, tb2;
- const bool i2 = intersect(ta2, tb2, ca, line);
-
- if (!i0
- || !i1
- || !i2)
- {
- return false;
- }
-
- ta0 = clamp(ta0, 0.0f, 1.0f);
- ta1 = clamp(ta1, 0.0f, 1.0f);
- ta2 = clamp(ta2, 0.0f, 1.0f);
- tb0 = clamp(tb0, 0.0f, 1.0f);
- tb1 = clamp(tb1, 0.0f, 1.0f);
- tb2 = clamp(tb2, 0.0f, 1.0f);
-
- const Vec3 pa0 = getPointAt(ab, ta0);
- const Vec3 pa1 = getPointAt(bc, ta1);
- const Vec3 pa2 = getPointAt(ca, ta2);
-
- const Vec3 pb0 = getPointAt(line, tb0);
- const Vec3 pb1 = getPointAt(line, tb1);
- const Vec3 pb2 = getPointAt(line, tb2);
-
- const float d0 = distanceSq(pa0, pb0);
- const float d1 = distanceSq(pa1, pb1);
- const float d2 = distanceSq(pa2, pb2);
-
- if (d0 <= d1
- && d0 <= d2)
- {
- return overlap(_ty, pa0);
- }
- else if (d1 <= d2)
- {
- return overlap(_ty, pa1);
- }
-
- return overlap(_ty, pa2);
-}
-
-bool overlap(const Triangle& _triangle, const Cylinder& _cylinder)
-{
- return overlap<Cylinder>(_triangle, _cylinder);
-}
-
-bool overlap(const Triangle& _triangle, const Capsule& _capsule)
-{
- return overlap<Capsule>(_triangle, _capsule);
-}
-
-bool overlap(const Triangle& _triangle, const Cone& _cone)
-{
- const LineSegment ab = LineSegment{_triangle.v0, _triangle.v1};
- const LineSegment bc = LineSegment{_triangle.v1, _triangle.v2};
- const LineSegment ca = LineSegment{_triangle.v2, _triangle.v0};
-
- const LineSegment line =
- {
- _cone.pos,
- _cone.end,
- };
-
- float ta0 = 0.0f, tb0 = 0.0f;
- const bool i0 = intersect(ta0, tb0, ab, line);
-
- float ta1, tb1;
- const bool i1 = intersect(ta1, tb1, bc, line);
-
- float ta2, tb2;
- const bool i2 = intersect(ta2, tb2, ca, line);
-
- if (!i0
- || !i1
- || !i2)
- {
- return false;
- }
-
- ta0 = clamp(ta0, 0.0f, 1.0f);
- ta1 = clamp(ta1, 0.0f, 1.0f);
- ta2 = clamp(ta2, 0.0f, 1.0f);
- tb0 = clamp(tb0, 0.0f, 1.0f);
- tb1 = clamp(tb1, 0.0f, 1.0f);
- tb2 = clamp(tb2, 0.0f, 1.0f);
-
- const Vec3 pa0 = getPointAt(ab, ta0);
- const Vec3 pa1 = getPointAt(bc, ta1);
- const Vec3 pa2 = getPointAt(ca, ta2);
-
- const Vec3 pb0 = getPointAt(line, tb0);
- const Vec3 pb1 = getPointAt(line, tb1);
- const Vec3 pb2 = getPointAt(line, tb2);
-
- const float d0 = distanceSq(pa0, pb0);
- const float d1 = distanceSq(pa1, pb1);
- const float d2 = distanceSq(pa2, pb2);
-
- if (d0 <= d1
- && d0 <= d2)
- {
- return overlap(_cone, pa0);
- }
- else if (d1 <= d2)
- {
- return overlap(_cone, pa1);
- }
-
- return overlap(_cone, pa2);
-}
-
-bool overlap(const Triangle& _triangle, const Disk& _disk)
-{
- if (!overlap(_triangle, Sphere{_disk.center, _disk.radius}) )
- {
- return false;
- }
-
- Plane plane(init::None);
- calcPlane(plane, _disk.normal, _disk.center);
-
- return overlap(_triangle, plane);
-}
-
-bool overlap(const Triangle& _triangle, const Obb& _obb)
-{
- const Srt srt = toSrt(_obb.mtx);
-
- Aabb aabb;
- toAabb(aabb, srt.scale);
-
- const Quaternion invRotation = invert(srt.rotation);
-
- const Triangle triangle =
- {
- mul(sub(_triangle.v0, srt.translation), invRotation),
- mul(sub(_triangle.v1, srt.translation), invRotation),
- mul(sub(_triangle.v2, srt.translation), invRotation),
- };
-
- return overlap(triangle, aabb);
-}
diff --git a/3rdparty/bgfx/examples/common/bounds.h b/3rdparty/bgfx/examples/common/bounds.h
deleted file mode 100644
index 936a244d5d6..00000000000
--- a/3rdparty/bgfx/examples/common/bounds.h
+++ /dev/null
@@ -1,450 +0,0 @@
-/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#ifndef BOUNDS_H_HEADER_GUARD
-#define BOUNDS_H_HEADER_GUARD
-
-#include <bx/math.h>
-
-///
-struct Aabb
-{
- bx::Vec3 min = bx::init::None;
- bx::Vec3 max = bx::init::None;
-};
-
-///
-struct Capsule
-{
- bx::Vec3 pos = bx::init::None;
- bx::Vec3 end = bx::init::None;
- float radius;
-};
-
-///
-struct Cone
-{
- bx::Vec3 pos = bx::init::None;
- bx::Vec3 end = bx::init::None;
- float radius;
-};
-
-///
-struct Cylinder
-{
- bx::Vec3 pos = bx::init::None;
- bx::Vec3 end = bx::init::None;
- float radius;
-};
-
-///
-struct Disk
-{
- bx::Vec3 center = bx::init::None;
- bx::Vec3 normal = bx::init::None;
- float radius;
-};
-
-///
-struct Obb
-{
- float mtx[16];
-};
-
-///
-struct Sphere
-{
- bx::Vec3 center = bx::init::None;
- float radius;
-};
-
-///
-struct Triangle
-{
- bx::Vec3 v0 = bx::init::None;
- bx::Vec3 v1 = bx::init::None;
- bx::Vec3 v2 = bx::init::None;
-};
-
-///
-struct Ray
-{
- bx::Vec3 pos = bx::init::None;
- bx::Vec3 dir = bx::init::None;
-};
-
-///
-struct Hit
-{
- bx::Vec3 pos = bx::init::None;
- bx::Plane plane = bx::init::None;
-};
-
-///
-bx::Vec3 getCenter(const Aabb& _aabb);
-
-///
-bx::Vec3 getExtents(const Aabb& _aabb);
-
-///
-bx::Vec3 getCenter(const Triangle& _triangle);
-
-///
-void toAabb(Aabb& _outAabb, const bx::Vec3& _extents);
-
-///
-void toAabb(Aabb& _outAabb, const bx::Vec3& _center, const bx::Vec3& _extents);
-
-/// Convert cylinder to axis aligned bounding box.
-void toAabb(Aabb& _outAabb, const Cylinder& _cylinder);
-
-/// Convert disk to axis aligned bounding box.
-void toAabb(Aabb& _outAabb, const Disk& _disk);
-
-/// Convert oriented bounding box to axis aligned bounding box.
-void toAabb(Aabb& _outAabb, const Obb& _obb);
-
-/// Convert sphere to axis aligned bounding box.
-void toAabb(Aabb& _outAabb, const Sphere& _sphere);
-
-/// Convert triangle to axis aligned bounding box.
-void toAabb(Aabb& _outAabb, const Triangle& _triangle);
-
-/// Calculate axis aligned bounding box.
-void toAabb(Aabb& _outAabb, const void* _vertices, uint32_t _numVertices, uint32_t _stride);
-
-/// Transform vertices and calculate axis aligned bounding box.
-void toAabb(Aabb& _outAabb, const float* _mtx, const void* _vertices, uint32_t _numVertices, uint32_t _stride);
-
-/// Expand AABB.
-void aabbExpand(Aabb& _outAabb, float _factor);
-
-/// Expand AABB with xyz.
-void aabbExpand(Aabb& _outAabb, const bx::Vec3& _pos);
-
-/// Calculate surface area of axis aligned bounding box.
-float calcAreaAabb(const Aabb& _aabb);
-
-/// Convert axis aligned bounding box to oriented bounding box.
-void toObb(Obb& _outObb, const Aabb& _aabb);
-
-/// Calculate oriented bounding box.
-void calcObb(Obb& _outObb, const void* _vertices, uint32_t _numVertices, uint32_t _stride, uint32_t _steps = 17);
-
-/// Calculate maximum bounding sphere.
-void calcMaxBoundingSphere(Sphere& _outSphere, const void* _vertices, uint32_t _numVertices, uint32_t _stride);
-
-/// Calculate minimum bounding sphere.
-void calcMinBoundingSphere(Sphere& _outSphere, const void* _vertices, uint32_t _numVertices, uint32_t _stride, float _step = 0.01f);
-
-/// Returns 6 (near, far, left, right, top, bottom) planes representing frustum planes.
-void buildFrustumPlanes(bx::Plane* _outPlanes, const float* _viewProj);
-
-/// Returns point from 3 intersecting planes.
-bx::Vec3 intersectPlanes(const bx::Plane& _pa, const bx::Plane& _pb, const bx::Plane& _pc);
-
-/// Make screen space ray from x, y coordinate and inverse view-projection matrix.
-Ray makeRay(float _x, float _y, const float* _invVp);
-
-/// Intersect ray / AABB.
-bool intersect(const Ray& _ray, const Aabb& _aabb, Hit* _hit = NULL);
-
-/// Intersect ray / OBB.
-bool intersect(const Ray& _ray, const Obb& _obb, Hit* _hit = NULL);
-
-/// Intersect ray / cylinder.
-bool intersect(const Ray& _ray, const Cylinder& _cylinder, Hit* _hit = NULL);
-
-/// Intersect ray / capsule.
-bool intersect(const Ray& _ray, const Capsule& _capsule, Hit* _hit = NULL);
-
-/// Intersect ray / cone.
-bool intersect(const Ray& _ray, const Cone& _cone, Hit* _hit = NULL);
-
-/// Intersect ray / disk.
-bool intersect(const Ray& _ray, const Disk& _disk, Hit* _hit = NULL);
-
-/// Intersect ray / plane.
-bool intersect(const Ray& _ray, const bx::Plane& _plane, Hit* _hit = NULL);
-
-/// Intersect ray / sphere.
-bool intersect(const Ray& _ray, const Sphere& _sphere, Hit* _hit = NULL);
-
-/// Intersect ray / triangle.
-bool intersect(const Ray& _ray, const Triangle& _triangle, Hit* _hit = NULL);
-
-///
-bool overlap(const Aabb& _aabb, const bx::Vec3& _pos);
-
-///
-bool overlap(const Aabb& _aabb, const Sphere& _sphere);
-
-///
-bool overlap(const Aabb& _aabbA, const Aabb& _aabbB);
-
-///
-bool overlap(const Aabb& _aabb, const bx::Plane& _plane);
-
-///
-bool overlap(const Aabb& _aabb, const Triangle& _triangle);
-
-///
-bool overlap(const Aabb& _aabb, const Cylinder& _cylinder);
-
-///
-bool overlap(const Aabb& _aabb, const Capsule& _capsule);
-
-///
-bool overlap(const Aabb& _aabb, const Cone& _cone);
-
-///
-bool overlap(const Aabb& _aabb, const Disk& _disk);
-
-///
-bool overlap(const Aabb& _aabb, const Obb& _obb);
-
-///
-bool overlap(const Capsule& _capsule, const bx::Vec3& _pos);
-
-///
-bool overlap(const Capsule& _capsule, const Sphere& _sphere);
-
-///
-bool overlap(const Capsule& _capsule, const Aabb& _aabb);
-
-///
-bool overlap(const Capsule& _capsule, const bx::Plane& _plane);
-
-///
-bool overlap(const Capsule& _capsule, const Triangle& _triangle);
-
-///
-bool overlap(const Capsule& _capsule, const Cylinder& _cylinder);
-
-///
-bool overlap(const Capsule& _capsuleA, const Capsule& _capsuleB);
-
-///
-bool overlap(const Capsule& _capsule, const Cone& _cone);
-
-///
-bool overlap(const Capsule& _capsule, const Disk& _disk);
-
-///
-bool overlap(const Capsule& _capsule, const Obb& _obb);
-
-///
-bool overlap(const Cone& _cone, const bx::Vec3& _pos);
-
-///
-bool overlap(const Cone& _cone, const Sphere& _sphere);
-
-///
-bool overlap(const Cone& _cone, const Aabb& _aabb);
-
-///
-bool overlap(const Cone& _cone, const bx::Plane& _plane);
-
-///
-bool overlap(const Cone& _cone, const Triangle& _triangle);
-
-///
-bool overlap(const Cone& _cone, const Cylinder& _cylinder);
-
-///
-bool overlap(const Cone& _cone, const Capsule& _capsule);
-
-///
-bool overlap(const Cone& _coneA, const Cone& _coneB);
-
-///
-bool overlap(const Cone& _cone, const Disk& _disk);
-
-///
-bool overlap(const Cone& _cone, const Obb& _obb);
-
-///
-bool overlap(const Cylinder& _cylinder, const bx::Vec3& _pos);
-
-///
-bool overlap(const Cylinder& _cylinder, const Sphere& _sphere);
-
-///
-bool overlap(const Cylinder& _cylinder, const Aabb& _aabb);
-
-///
-bool overlap(const Cylinder& _cylinder, const bx::Plane& _plane);
-
-///
-bool overlap(const Cylinder& _cylinder, const Triangle& _triangle);
-
-///
-bool overlap(const Cylinder& _cylinderA, const Cylinder& _cylinderB);
-
-///
-bool overlap(const Cylinder& _cylinder, const Capsule& _capsule);
-
-///
-bool overlap(const Cylinder& _cylinder, const Cone& _cone);
-
-///
-bool overlap(const Cylinder& _cylinder, const Disk& _disk);
-
-///
-bool overlap(const Cylinder& _cylinder, const Obb& _obb);
-
-///
-bool overlap(const Disk& _disk, const bx::Vec3& _pos);
-
-///
-bool overlap(const Disk& _disk, const Sphere& _sphere);
-
-///
-bool overlap(const Disk& _disk, const Aabb& _aabb);
-
-///
-bool overlap(const Disk& _disk, const bx::Plane& _plane);
-
-///
-bool overlap(const Disk& _disk, const Triangle& _triangle);
-
-///
-bool overlap(const Disk& _disk, const Cylinder& _cylinder);
-
-///
-bool overlap(const Disk& _disk, const Capsule& _capsule);
-
-///
-bool overlap(const Disk& _disk, const Cone& _cone);
-
-///
-bool overlap(const Disk& _diskA, const Disk& _diskB);
-
-///
-bool overlap(const Disk& _disk, const Obb& _obb);
-
-///
-bool overlap(const Obb& _obb, const bx::Vec3& _pos);
-
-///
-bool overlap(const Obb& _obb, const Sphere& _sphere);
-
-///
-bool overlap(const Obb& _obb, const Aabb& _aabb);
-
-///
-bool overlap(const Obb& _obb, const bx::Plane& _plane);
-
-///
-bool overlap(const Obb& _obb, const Triangle& _triangle);
-
-///
-bool overlap(const Obb& _obb, const Cylinder& _cylinder);
-
-///
-bool overlap(const Obb& _obb, const Capsule& _capsule);
-
-///
-bool overlap(const Obb& _obb, const Cone& _cone);
-
-///
-bool overlap(const Obb& _obb, const Disk& _disk);
-
-///
-bool overlap(const Obb& _obbA, const Obb& _obbB);
-
-///
-bool overlap(const bx::Plane& _plane, const bx::Vec3& _pos);
-
-///
-bool overlap(const bx::Plane& _plane, const Sphere& _sphere);
-
-///
-bool overlap(const bx::Plane& _plane, const Aabb& _aabb);
-
-///
-bool overlap(const bx::Plane& _planeA, const bx::Plane& _planeB);
-
-///
-bool overlap(const bx::Plane& _plane, const Triangle& _triangle);
-
-///
-bool overlap(const bx::Plane& _plane, const Cylinder& _cylinder);
-
-///
-bool overlap(const bx::Plane& _plane, const Capsule& _capsule);
-
-///
-bool overlap(const bx::Plane& _plane, const Cone& _cone);
-
-///
-bool overlap(const bx::Plane& _plane, const Disk& _disk);
-
-///
-bool overlap(const bx::Plane& _plane, const Obb& _obb);
-
-///
-bool overlap(const Sphere& _sphere, const bx::Vec3& _pos);
-
-///
-bool overlap(const Sphere& _sphereA, const Sphere& _sphereB);
-
-///
-bool overlap(const Sphere& _sphere, const Aabb& _aabb);
-
-///
-bool overlap(const Sphere& _sphere, const bx::Plane& _plane);
-
-///
-bool overlap(const Sphere& _sphere, const Triangle& _triangle);
-
-///
-bool overlap(const Sphere& _sphere, const Cylinder& _cylinder);
-
-///
-bool overlap(const Sphere& _sphere, const Capsule& _capsule);
-
-///
-bool overlap(const Sphere& _sphere, const Cone& _cone);
-
-///
-bool overlap(const Sphere& _sphere, const Disk& _disk);
-
-///
-bool overlap(const Sphere& _sphere, const Obb& _obb);
-
-///
-bool overlap(const Triangle& _triangle, const bx::Vec3& _pos);
-
-///
-bool overlap(const Triangle& _triangle, const Sphere& _sphere);
-
-///
-bool overlap(const Triangle& _triangle, const Aabb& _aabb);
-
-///
-bool overlap(const Triangle& _triangle, const bx::Plane& _plane);
-
-///
-bool overlap(const Triangle& _triangleA, const Triangle& _triangleB);
-
-///
-bool overlap(const Triangle& _triangle, const Cylinder& _cylinder);
-
-///
-bool overlap(const Triangle& _triangle, const Capsule& _capsule);
-
-///
-bool overlap(const Triangle& _triangle, const Cone& _cone);
-
-///
-bool overlap(const Triangle& _triangle, const Disk& _disk);
-
-///
-bool overlap(const Triangle& _triangle, const Obb& _obb);
-
-#include "bounds.inl"
-
-#endif // BOUNDS_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/bounds.inl b/3rdparty/bgfx/examples/common/bounds.inl
deleted file mode 100644
index ee915d47c5e..00000000000
--- a/3rdparty/bgfx/examples/common/bounds.inl
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#ifndef BOUNDS_H_HEADER_GUARD
-# error "Must be included from bounds.h!"
-#endif // BOUNDS_H_HEADER_GUARD
-
-inline bool overlap(const Aabb& _aabb, const Sphere& _sphere)
-{
- return overlap(_sphere, _aabb);
-}
-
-inline bool overlap(const Aabb& _aabb, const Cylinder& _cylinder)
-{
- return overlap(_cylinder, _aabb);
-}
-
-inline bool overlap(const Capsule& _capsule, const Sphere& _sphere)
-{
- return overlap(_sphere, _capsule);
-}
-
-inline bool overlap(const Capsule& _capsule, const Aabb& _aabb)
-{
- return overlap(_aabb, _capsule);
-}
-
-inline bool overlap(const Capsule& _capsule, const Triangle& _triangle)
-{
- return overlap(_triangle, _capsule);
-}
-
-inline bool overlap(const Capsule& _capsule, const Cone& _cone)
-{
- return overlap(_cone, _capsule);
-}
-
-inline bool overlap(const Capsule& _capsule, const Cylinder& _cylinder)
-{
- return overlap(_cylinder, _capsule);
-}
-
-inline bool overlap(const Capsule& _capsule, const Disk& _disk)
-{
- return overlap(_disk, _capsule);
-}
-
-inline bool overlap(const Capsule& _capsule, const Obb& _obb)
-{
- return overlap(_obb, _capsule);
-}
-
-inline bool overlap(const Cone& _cone, const Sphere& _sphere)
-{
- return overlap(_sphere, _cone);
-}
-
-inline bool overlap(const Cone& _cone, const Aabb& _aabb)
-{
- return overlap(_aabb, _cone);
-}
-
-inline bool overlap(const Cone& _cone, const bx::Plane& _plane)
-{
- return overlap(_plane, _cone);
-}
-
-inline bool overlap(const Cone& _cone, const Triangle& _triangle)
-{
- return overlap(_triangle, _cone);
-}
-
-inline bool overlap(const Cylinder& _cylinder, const Triangle& _triangle)
-{
- return overlap(_triangle, _cylinder);
-}
-
-inline bool overlap(const Cylinder& _cylinder, const Cone& _cone)
-{
- return overlap(_cone, _cylinder);
-}
-
-inline bool overlap(const Disk& _disk, const Sphere& _sphere)
-{
- return overlap(_sphere, _disk);
-}
-
-inline bool overlap(const Disk& _disk, const Aabb& _aabb)
-{
- return overlap(_aabb, _disk);
-}
-
-inline bool overlap(const Disk& _disk, const Triangle& _triangle)
-{
- return overlap(_triangle, _disk);
-}
-
-inline bool overlap(const Disk& _disk, const Cylinder& _cylinder)
-{
- return overlap(_cylinder, _disk);
-}
-
-inline bool overlap(const Disk& _disk, const Cone& _cone)
-{
- return overlap(_cone, _disk);
-}
-
-inline bool overlap(const Obb& _obb, const Sphere& _sphere)
-{
- return overlap(_sphere, _obb);
-}
-
-inline bool overlap(const Obb& _obb, const Aabb& _aabb)
-{
- return overlap(_aabb, _obb);
-}
-
-inline bool overlap(const Obb& _obb, const Triangle& _triangle)
-{
- return overlap(_triangle, _obb);
-}
-
-inline bool overlap(const Obb& _obb, const Cylinder& _cylinder)
-{
- return overlap(_cylinder, _obb);
-}
-
-inline bool overlap(const Obb& _obb, const Cone& _cone)
-{
- return overlap(_cone, _obb);
-}
-
-inline bool overlap(const Obb& _obb, const Disk& _disk)
-{
- return overlap(_disk, _obb);
-}
-
-inline bool overlap(const bx::Plane& _plane, const Sphere& _sphere)
-{
- return overlap(_sphere, _plane);
-}
-
-inline bool overlap(const bx::Plane& _plane, const Aabb& _aabb)
-{
- return overlap(_aabb, _plane);
-}
-
-inline bool overlap(const bx::Plane& _plane, const Triangle& _triangle)
-{
- return overlap(_triangle, _plane);
-}
-
-inline bool overlap(const bx::Plane& _plane, const Cylinder& _cylinder)
-{
- return overlap(_cylinder, _plane);
-}
-
-inline bool overlap(const bx::Plane& _plane, const Capsule& _capsule)
-{
- return overlap(_capsule, _plane);
-}
-
-inline bool overlap(const bx::Plane& _plane, const Disk& _disk)
-{
- return overlap(_disk, _plane);
-}
-
-inline bool overlap(const bx::Plane& _plane, const Obb& _obb)
-{
- return overlap(_obb, _plane);
-}
-
-inline bool overlap(const Sphere& _sphere, const Cylinder& _cylinder)
-{
- return overlap(_cylinder, _sphere);
-}
-
-inline bool overlap(const Triangle& _triangle, const Sphere& _sphere)
-{
- return overlap(_sphere, _triangle);
-}
-
-inline bool overlap(const Triangle& _triangle, const Aabb& _aabb)
-{
- return overlap(_aabb, _triangle);
-}
diff --git a/3rdparty/bgfx/examples/common/camera.cpp b/3rdparty/bgfx/examples/common/camera.cpp
index eb5ed59e82f..2578d327726 100644
--- a/3rdparty/bgfx/examples/common/camera.cpp
+++ b/3rdparty/bgfx/examples/common/camera.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bx/timer.h>
@@ -94,6 +94,7 @@ struct Camera
~Camera()
{
+ cmdRemove("move");
inputRemoveBindings("camBindings");
}
diff --git a/3rdparty/bgfx/examples/common/camera.h b/3rdparty/bgfx/examples/common/camera.h
index 5aa92326b76..80a77d7fb97 100644
--- a/3rdparty/bgfx/examples/common/camera.h
+++ b/3rdparty/bgfx/examples/common/camera.h
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef CAMERA_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/common.h b/3rdparty/bgfx/examples/common/common.h
index 6a80b6235c2..c15209bbc94 100644
--- a/3rdparty/bgfx/examples/common/common.h
+++ b/3rdparty/bgfx/examples/common/common.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef COMMON_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/common.sh b/3rdparty/bgfx/examples/common/common.sh
index 0371245634f..fab6caf1749 100644
--- a/3rdparty/bgfx/examples/common/common.sh
+++ b/3rdparty/bgfx/examples/common/common.sh
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/cube_atlas.cpp b/3rdparty/bgfx/examples/common/cube_atlas.cpp
index 610c5f01107..a5689e83531 100644
--- a/3rdparty/bgfx/examples/common/cube_atlas.cpp
+++ b/3rdparty/bgfx/examples/common/cube_atlas.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Jeremie Roy. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -259,7 +259,7 @@ Atlas::Atlas(uint16_t _textureSize, uint16_t _maxRegionsCount)
BX_ASSERT(_textureSize >= 64 && _textureSize <= 4096, "Invalid _textureSize %d.", _textureSize);
BX_ASSERT(_maxRegionsCount >= 64 && _maxRegionsCount <= 32000, "Invalid _maxRegionsCount %d.", _maxRegionsCount);
- init();
+ m_texelSize = float(UINT16_MAX) / float(m_textureSize);
m_layers = new PackedLayer[6];
for (int ii = 0; ii < 6; ++ii)
@@ -287,7 +287,7 @@ Atlas::Atlas(uint16_t _textureSize, const uint8_t* _textureBuffer, uint16_t _reg
{
BX_ASSERT(_regionCount <= 64 && _maxRegionsCount <= 4096, "_regionCount %d, _maxRegionsCount %d", _regionCount, _maxRegionsCount);
- init();
+ m_texelSize = float(UINT16_MAX) / float(m_textureSize);
m_regions = new AtlasRegion[_regionCount];
m_textureBuffer = new uint8_t[getTextureBufferSize()];
@@ -313,30 +313,6 @@ Atlas::~Atlas()
delete [] m_textureBuffer;
}
-void Atlas::init()
-{
- m_texelSize = float(UINT16_MAX) / float(m_textureSize);
- float texelHalf = m_texelSize/2.0f;
- switch (bgfx::getRendererType() )
- {
- case bgfx::RendererType::Direct3D9:
- m_texelOffset[0] = 0.0f;
- m_texelOffset[1] = 0.0f;
- break;
-
- case bgfx::RendererType::Direct3D11:
- case bgfx::RendererType::Direct3D12:
- m_texelOffset[0] = texelHalf;
- m_texelOffset[1] = texelHalf;
- break;
-
- default:
- m_texelOffset[0] = texelHalf;
- m_texelOffset[1] = -texelHalf;
- break;
- }
-}
-
uint16_t Atlas::addRegion(uint16_t _width, uint16_t _height, const uint8_t* _bitmapBuffer, AtlasRegion::Type _type, uint16_t outline)
{
if (m_regionCount >= m_maxRegionCount)
@@ -469,10 +445,10 @@ static void writeUV(uint8_t* _vertexBuffer, int16_t _x, int16_t _y, int16_t _z,
void Atlas::packUV(const AtlasRegion& _region, uint8_t* _vertexBuffer, uint32_t _offset, uint32_t _stride) const
{
- int16_t x0 = (int16_t)( ( (float)_region.x * m_texelSize + m_texelOffset[0]) - float(INT16_MAX) );
- int16_t y0 = (int16_t)( ( (float)_region.y * m_texelSize + m_texelOffset[1]) - float(INT16_MAX) );
- int16_t x1 = (int16_t)( ( ( (float)_region.x + _region.width) * m_texelSize + m_texelOffset[0]) - float(INT16_MAX) );
- int16_t y1 = (int16_t)( ( ( (float)_region.y + _region.height) * m_texelSize + m_texelOffset[1]) - float(INT16_MAX) );
+ int16_t x0 = (int16_t)( ( (float)_region.x * m_texelSize) - float(INT16_MAX) );
+ int16_t y0 = (int16_t)( ( (float)_region.y * m_texelSize) - float(INT16_MAX) );
+ int16_t x1 = (int16_t)( ( ( (float)_region.x + _region.width) * m_texelSize) - float(INT16_MAX) );
+ int16_t y1 = (int16_t)( ( ( (float)_region.y + _region.height) * m_texelSize) - float(INT16_MAX) );
int16_t ww = (int16_t)( (float(INT16_MAX) / 4.0f) * (float)_region.getComponentIndex() );
_vertexBuffer += _offset;
diff --git a/3rdparty/bgfx/examples/common/cube_atlas.h b/3rdparty/bgfx/examples/common/cube_atlas.h
index 9a33a7611a6..d823e63f7c8 100644
--- a/3rdparty/bgfx/examples/common/cube_atlas.h
+++ b/3rdparty/bgfx/examples/common/cube_atlas.h
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Jeremie Roy. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef CUBE_ATLAS_H_HEADER_GUARD
@@ -135,8 +135,6 @@ public:
}
private:
- void init();
-
struct PackedLayer;
PackedLayer* m_layers;
AtlasRegion* m_regions;
@@ -148,7 +146,6 @@ private:
bgfx::TextureHandle m_textureHandle;
uint16_t m_textureSize;
float m_texelSize;
- float m_texelOffset[2];
uint16_t m_regionCount;
uint16_t m_maxRegionCount;
diff --git a/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp
index 782e3ddeba5..eee5aef0816 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp
+++ b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx/bgfx.h>
@@ -9,6 +9,7 @@
#include "../bgfx_utils.h"
#include "../packrect.h"
+#include <bx/debug.h>
#include <bx/mutex.h>
#include <bx/math.h>
#include <bx/sort.h>
@@ -1026,6 +1027,7 @@ struct DebugDrawEncoderImpl
void init(bgfx::Encoder* _encoder)
{
m_defaultEncoder = _encoder;
+ m_state = State::Count;
}
void shutdown()
@@ -1034,7 +1036,7 @@ struct DebugDrawEncoderImpl
void begin(bgfx::ViewId _viewId, bool _depthTestLess, bgfx::Encoder* _encoder)
{
- BX_ASSERT(State::Count == m_state);
+ BX_ASSERT(State::Count == m_state, "");
m_viewId = _viewId;
m_encoder = _encoder == NULL ? m_defaultEncoder : _encoder;
@@ -1079,14 +1081,14 @@ struct DebugDrawEncoderImpl
void push()
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
++m_stack;
m_attrib[m_stack] = m_attrib[m_stack-1];
}
void pop()
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
const Attrib& curr = m_attrib[m_stack];
const Attrib& prev = m_attrib[m_stack-1];
if (curr.m_stipple != prev.m_stipple
@@ -1099,7 +1101,7 @@ struct DebugDrawEncoderImpl
void setDepthTestLess(bool _depthTestLess)
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
if (m_depthTestLess != _depthTestLess)
{
m_depthTestLess = _depthTestLess;
@@ -1115,7 +1117,7 @@ struct DebugDrawEncoderImpl
void setTransform(const void* _mtx, uint16_t _num = 1, bool _flush = true)
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
if (_flush)
{
flush();
@@ -1151,7 +1153,7 @@ struct DebugDrawEncoderImpl
void pushTransform(const void* _mtx, uint16_t _num, bool _flush = true)
{
BX_ASSERT(m_mtxStackCurrent < BX_COUNTOF(m_mtxStack), "Out of matrix stack!");
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
if (_flush)
{
flush();
@@ -1181,7 +1183,7 @@ struct DebugDrawEncoderImpl
void popTransform(bool _flush = true)
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
if (_flush)
{
flush();
@@ -1241,25 +1243,25 @@ struct DebugDrawEncoderImpl
void setColor(uint32_t _abgr)
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
m_attrib[m_stack].m_abgr = _abgr;
}
void setLod(uint8_t _lod)
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
m_attrib[m_stack].m_lod = _lod;
}
void setWireframe(bool _wireframe)
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
m_attrib[m_stack].m_wireframe = _wireframe;
}
void setStipple(bool _stipple, float _scale = 1.0f, float _offset = 0.0f)
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
Attrib& attrib = m_attrib[m_stack];
@@ -1281,7 +1283,7 @@ struct DebugDrawEncoderImpl
void moveTo(float _x, float _y, float _z = 0.0f)
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
softFlush();
@@ -1301,7 +1303,7 @@ struct DebugDrawEncoderImpl
void moveTo(const bx::Vec3& _pos)
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
moveTo(_pos.x, _pos.y, _pos.z);
}
@@ -1312,7 +1314,7 @@ struct DebugDrawEncoderImpl
void lineTo(float _x, float _y, float _z = 0.0f)
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
if (State::None == m_state)
{
moveTo(_x, _y, _z);
@@ -1365,7 +1367,7 @@ struct DebugDrawEncoderImpl
void lineTo(const bx::Vec3& _pos)
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
lineTo(_pos.x, _pos.y, _pos.z);
}
@@ -1376,14 +1378,14 @@ struct DebugDrawEncoderImpl
void close()
{
- BX_ASSERT(State::Count != m_state);
+ BX_ASSERT(State::Count != m_state, "");
DebugVertex& vertex = m_cache[m_vertexPos];
lineTo(vertex.m_x, vertex.m_y, vertex.m_z);
m_state = State::None;
}
- void draw(const Aabb& _aabb)
+ void draw(const bx::Aabb& _aabb)
{
const Attrib& attrib = m_attrib[m_stack];
if (attrib.m_wireframe)
@@ -1414,23 +1416,23 @@ struct DebugDrawEncoderImpl
}
else
{
- Obb obb;
+ bx::Obb obb;
toObb(obb, _aabb);
draw(DebugMesh::Cube, obb.mtx, 1, false);
}
}
- void draw(const Cylinder& _cylinder, bool _capsule)
+ void draw(const bx::Cylinder& _cylinder, bool _capsule)
{
drawCylinder(_cylinder.pos, _cylinder.end, _cylinder.radius, _capsule);
}
- void draw(const Disk& _disk)
+ void draw(const bx::Disk& _disk)
{
drawCircle(_disk.normal, _disk.center, _disk.radius, 0.0f);
}
- void draw(const Obb& _obb)
+ void draw(const bx::Obb& _obb)
{
const Attrib& attrib = m_attrib[m_stack];
if (attrib.m_wireframe)
@@ -1469,7 +1471,7 @@ struct DebugDrawEncoderImpl
}
}
- void draw(const Sphere& _sphere)
+ void draw(const bx::Sphere& _sphere)
{
const Attrib& attrib = m_attrib[m_stack];
float mtx[16];
@@ -1491,7 +1493,7 @@ struct DebugDrawEncoderImpl
draw(DebugMesh::Enum(DebugMesh::Sphere0 + lod), mtx, 1, attrib.m_wireframe);
}
- void draw(const Triangle& _triangle)
+ void draw(const bx::Triangle& _triangle)
{
Attrib& attrib = m_attrib[m_stack];
if (attrib.m_wireframe)
@@ -1955,7 +1957,7 @@ struct DebugDrawEncoderImpl
;
draw(DebugMesh::Enum(DebugMesh::Capsule0 + lod), mtx[0], 2, attrib.m_wireframe);
- Sphere sphere;
+ bx::Sphere sphere;
sphere.center = _from;
sphere.radius = _radius;
draw(sphere);
@@ -2425,42 +2427,42 @@ void DebugDrawEncoder::close()
DEBUG_DRAW_ENCODER(close() );
}
-void DebugDrawEncoder::draw(const Aabb& _aabb)
+void DebugDrawEncoder::draw(const bx::Aabb& _aabb)
{
DEBUG_DRAW_ENCODER(draw(_aabb) );
}
-void DebugDrawEncoder::draw(const Cylinder& _cylinder)
+void DebugDrawEncoder::draw(const bx::Cylinder& _cylinder)
{
DEBUG_DRAW_ENCODER(draw(_cylinder, false) );
}
-void DebugDrawEncoder::draw(const Capsule& _capsule)
+void DebugDrawEncoder::draw(const bx::Capsule& _capsule)
{
- DEBUG_DRAW_ENCODER(draw(*( (const Cylinder*)&_capsule), true) );
+ DEBUG_DRAW_ENCODER(draw(*( (const bx::Cylinder*)&_capsule), true) );
}
-void DebugDrawEncoder::draw(const Disk& _disk)
+void DebugDrawEncoder::draw(const bx::Disk& _disk)
{
DEBUG_DRAW_ENCODER(draw(_disk) );
}
-void DebugDrawEncoder::draw(const Obb& _obb)
+void DebugDrawEncoder::draw(const bx::Obb& _obb)
{
DEBUG_DRAW_ENCODER(draw(_obb) );
}
-void DebugDrawEncoder::draw(const Sphere& _sphere)
+void DebugDrawEncoder::draw(const bx::Sphere& _sphere)
{
DEBUG_DRAW_ENCODER(draw(_sphere) );
}
-void DebugDrawEncoder::draw(const Triangle& _triangle)
+void DebugDrawEncoder::draw(const bx::Triangle& _triangle)
{
DEBUG_DRAW_ENCODER(draw(_triangle) );
}
-void DebugDrawEncoder::draw(const Cone& _cone)
+void DebugDrawEncoder::draw(const bx::Cone& _cone)
{
DEBUG_DRAW_ENCODER(drawCone(_cone.pos, _cone.end, _cone.radius) );
}
diff --git a/3rdparty/bgfx/examples/common/debugdraw/debugdraw.h b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.h
index d6af8708004..7770ed15e51 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/debugdraw.h
+++ b/3rdparty/bgfx/examples/common/debugdraw/debugdraw.h
@@ -1,14 +1,14 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef DEBUGDRAW_H_HEADER_GUARD
#define DEBUGDRAW_H_HEADER_GUARD
#include <bx/allocator.h>
+#include <bx/bounds.h>
#include <bgfx/bgfx.h>
-#include "../bounds.h"
struct Axis
{
@@ -121,28 +121,28 @@ struct DebugDrawEncoder
void close();
///
- void draw(const Aabb& _aabb);
+ void draw(const bx::Aabb& _aabb);
///
- void draw(const Cylinder& _cylinder);
+ void draw(const bx::Cylinder& _cylinder);
///
- void draw(const Capsule& _capsule);
+ void draw(const bx::Capsule& _capsule);
///
- void draw(const Disk& _disk);
+ void draw(const bx::Disk& _disk);
///
- void draw(const Obb& _obb);
+ void draw(const bx::Obb& _obb);
///
- void draw(const Sphere& _sphere);
+ void draw(const bx::Sphere& _sphere);
///
- void draw(const Triangle& _triangle);
+ void draw(const bx::Triangle& _triangle);
///
- void draw(const Cone& _cone);
+ void draw(const bx::Cone& _cone);
///
void draw(GeometryHandle _handle);
diff --git a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc
index 158240a8da6..85f9bc7d09f 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc
+++ b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc
index 5014ba4f5bf..0ed3fa609e1 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc
+++ b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc
@@ -1,8 +1,8 @@
$input v_view, v_world
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.sc b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.sc
index ff4db9d6b28..67adb209f2d 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.sc
+++ b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.sc
@@ -1,8 +1,8 @@
$input v_texcoord0, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc
index 5685de7a062..1e1a402026f 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc
+++ b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc
@@ -1,8 +1,8 @@
$input v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc
index be0527f264b..e4881721409 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc
+++ b/3rdparty/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc
@@ -1,8 +1,8 @@
$input v_color0, v_stipple
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/debugdraw/makefile b/3rdparty/bgfx/examples/common/debugdraw/makefile
index 88ff40d2821..554063e5829 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/makefile
+++ b/3rdparty/bgfx/examples/common/debugdraw/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
include ../../../scripts/shader-embeded.mk
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc
index 479b529c50d..db5c3498f68 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc
@@ -1,8 +1,8 @@
$input a_position, a_indices
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc
index d9c0b2c47a5..0964f5929e8 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc
@@ -2,8 +2,8 @@ $input a_position, a_indices
$output v_view, v_world
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc
index dbd016dd425..7083351a3ef 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc
@@ -2,8 +2,8 @@ $input a_position
$output v_view, v_world
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc
index a76a4d0c7af..44901d090f9 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc
@@ -1,8 +1,8 @@
$input a_position
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.sc b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.sc
index 53139ae3811..073c7de47ef 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.sc
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0, a_color0
$output v_texcoord0, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc
index 1f50d349502..50143cf9106 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc
@@ -2,8 +2,8 @@ $input a_position, a_color0
$output v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc
index b18b929b04e..121d7120a9a 100644
--- a/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc
+++ b/3rdparty/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc
@@ -2,8 +2,8 @@ $input a_position, a_color0, a_texcoord0
$output v_color0, v_stipple
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/entry/cmd.cpp b/3rdparty/bgfx/examples/common/entry/cmd.cpp
index 1e86df2a4dd..51742b8eb89 100644
--- a/3rdparty/bgfx/examples/common/entry/cmd.cpp
+++ b/3rdparty/bgfx/examples/common/entry/cmd.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bx/allocator.h>
@@ -29,12 +29,24 @@ struct CmdContext
void add(const char* _name, ConsoleFn _fn, void* _userData)
{
- uint32_t cmd = bx::hash<bx::HashMurmur2A>(_name, (uint32_t)bx::strLen(_name) );
+ const uint32_t cmd = bx::hash<bx::HashMurmur2A>(_name, (uint32_t)bx::strLen(_name) );
BX_ASSERT(m_lookup.end() == m_lookup.find(cmd), "Command \"%s\" already exist.", _name);
+
Func fn = { _fn, _userData };
m_lookup.insert(stl::make_pair(cmd, fn) );
}
+ void remove(const char* _name)
+ {
+ const uint32_t cmd = bx::hash<bx::HashMurmur2A>(_name, (uint32_t)bx::strLen(_name) );
+
+ CmdLookup::iterator it = m_lookup.find(cmd);
+ if (it != m_lookup.end() )
+ {
+ m_lookup.erase(it);
+ }
+ }
+
void exec(const char* _cmd)
{
for (bx::StringView next(_cmd); !next.isEmpty(); _cmd = next.getPtr() )
@@ -105,6 +117,11 @@ void cmdAdd(const char* _name, ConsoleFn _fn, void* _userData)
s_cmdContext->add(_name, _fn, _userData);
}
+void cmdRemove(const char* _name)
+{
+ s_cmdContext->remove(_name);
+}
+
void cmdExec(const char* _format, ...)
{
char tmp[2048];
diff --git a/3rdparty/bgfx/examples/common/entry/cmd.h b/3rdparty/bgfx/examples/common/entry/cmd.h
index 254ba20c180..fe219424edd 100644
--- a/3rdparty/bgfx/examples/common/entry/cmd.h
+++ b/3rdparty/bgfx/examples/common/entry/cmd.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef CMD_H_HEADER_GUARD
@@ -19,6 +19,9 @@ void cmdShutdown();
void cmdAdd(const char* _name, ConsoleFn _fn, void* _userData = NULL);
///
+void cmdRemove(const char* _name);
+
+///
void cmdExec(const char* _format, ...);
#endif // CMD_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/entry/dbg.h b/3rdparty/bgfx/examples/common/entry/dbg.h
index a5a1ea627b8..bafe4a51447 100644
--- a/3rdparty/bgfx/examples/common/entry/dbg.h
+++ b/3rdparty/bgfx/examples/common/entry/dbg.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef DBG_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/entry/dialog.cpp b/3rdparty/bgfx/examples/common/entry/dialog.cpp
index 4041e23d17a..8c1bf9731e7 100644
--- a/3rdparty/bgfx/examples/common/entry/dialog.cpp
+++ b/3rdparty/bgfx/examples/common/entry/dialog.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bx/allocator.h>
@@ -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;
diff --git a/3rdparty/bgfx/examples/common/entry/dialog.h b/3rdparty/bgfx/examples/common/entry/dialog.h
index f639a7c0492..8c13d2be636 100644
--- a/3rdparty/bgfx/examples/common/entry/dialog.h
+++ b/3rdparty/bgfx/examples/common/entry/dialog.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef DIALOG_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/entry/dialog_darwin.mm b/3rdparty/bgfx/examples/common/entry/dialog_darwin.mm
index a1c2599ce5e..c80a7a91d11 100644
--- a/3rdparty/bgfx/examples/common/entry/dialog_darwin.mm
+++ b/3rdparty/bgfx/examples/common/entry/dialog_darwin.mm
@@ -1,6 +1,6 @@
/*
* Copyright 2019-2019 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "entry_p.h"
diff --git a/3rdparty/bgfx/examples/common/entry/entry.cpp b/3rdparty/bgfx/examples/common/entry/entry.cpp
index 852abe91623..58a671e6a70 100644
--- a/3rdparty/bgfx/examples/common/entry/entry.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bx/bx.h>
@@ -443,12 +443,27 @@ BX_PRAGMA_DIAGNOSTIC_POP();
return bx::kExitFailure;
}
+ struct AppInternal
+ {
+ AppI* m_next;
+ const char* m_name;
+ const char* m_description;
+ const char* m_url;
+ };
+
+ static ptrdiff_t s_offset = 0;
+
AppI::AppI(const char* _name, const char* _description, const char* _url)
{
- m_name = _name;
- m_description = _description;
- m_url = _url;
- m_next = s_apps;
+ BX_STATIC_ASSERT(sizeof(AppInternal) <= sizeof(m_internal) );
+ s_offset = BX_OFFSETOF(AppI, m_internal);
+
+ AppInternal* ai = (AppInternal*)m_internal;
+
+ ai->m_name = _name;
+ ai->m_description = _description;
+ ai->m_url = _url;
+ ai->m_next = s_apps;
s_apps = this;
s_numApps++;
@@ -464,7 +479,8 @@ BX_PRAGMA_DIAGNOSTIC_POP();
{
if (NULL != prev)
{
- prev->m_next = next;
+ AppInternal* ai = bx::addressOf<AppInternal>(prev, s_offset);
+ ai->m_next = next;
}
else
{
@@ -480,22 +496,26 @@ BX_PRAGMA_DIAGNOSTIC_POP();
const char* AppI::getName() const
{
- return m_name;
+ AppInternal* ai = (AppInternal*)m_internal;
+ return ai->m_name;
}
const char* AppI::getDescription() const
{
- return m_description;
+ AppInternal* ai = (AppInternal*)m_internal;
+ return ai->m_description;
}
const char* AppI::getUrl() const
{
- return m_url;
+ AppInternal* ai = (AppInternal*)m_internal;
+ return ai->m_url;
}
AppI* AppI::getNext()
{
- return m_next;
+ AppInternal* ai = (AppInternal*)m_internal;
+ return ai->m_next;
}
AppI* getFirstApp()
@@ -513,8 +533,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
_app->init(_argc, _argv, s_width, s_height);
bgfx::frame();
- WindowHandle defaultWindow = { 0 };
- setWindowSize(defaultWindow, s_width, s_height);
+ setWindowSize(kDefaultWindowHandle, s_width, s_height);
#if BX_PLATFORM_EMSCRIPTEN
s_app = _app;
@@ -560,9 +579,15 @@ BX_PRAGMA_DIAGNOSTIC_POP();
for (ii = 1; ii < s_numApps; ++ii)
{
AppI* app = apps[ii-1];
- app->m_next = apps[ii];
+
+ AppInternal* ai = bx::addressOf<AppInternal>(app, s_offset);
+ ai->m_next = apps[ii];
+ }
+
+ {
+ AppInternal* ai = bx::addressOf<AppInternal>(apps[s_numApps-1], s_offset);
+ ai->m_next = NULL;
}
- apps[s_numApps-1]->m_next = NULL;
BX_FREE(g_allocator, apps);
}
@@ -583,14 +608,12 @@ BX_PRAGMA_DIAGNOSTIC_POP();
inputInit();
inputAddBindings("bindings", s_bindings);
- entry::WindowHandle defaultWindow = { 0 };
-
bx::FilePath fp(_argv[0]);
char title[bx::kMaxFilePath];
bx::strCopy(title, BX_COUNTOF(title), fp.getBaseName() );
- entry::setWindowTitle(defaultWindow, title);
- setWindowSize(defaultWindow, ENTRY_DEFAULT_WIDTH, ENTRY_DEFAULT_HEIGHT);
+ entry::setWindowTitle(kDefaultWindowHandle, title);
+ setWindowSize(kDefaultWindowHandle, ENTRY_DEFAULT_WIDTH, ENTRY_DEFAULT_HEIGHT);
sortApps();
@@ -1004,3 +1027,13 @@ extern "C" bool entry_process_events(uint32_t* _width, uint32_t* _height, uint32
{
return entry::processEvents(*_width, *_height, *_debug, *_reset, NULL);
}
+
+extern "C" void* entry_get_default_native_window_handle()
+{
+ return entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+}
+
+extern "C" void* entry_get_native_display_handle()
+{
+ return entry::getNativeDisplayHandle();
+}
diff --git a/3rdparty/bgfx/examples/common/entry/entry.h b/3rdparty/bgfx/examples/common/entry/entry.h
index 0f0b5133883..2dc7acc7b56 100644
--- a/3rdparty/bgfx/examples/common/entry/entry.h
+++ b/3rdparty/bgfx/examples/common/entry/entry.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef ENTRY_H_HEADER_GUARD
@@ -35,14 +35,20 @@ extern "C" int _main_(int _argc, char** _argv);
_app s_ ## _app ## App(__VA_ARGS__)
#endif // ENTRY_CONFIG_IMPLEMENT_MAIN
+///
+#define ENTRY_HANDLE(_name) \
+ struct _name { uint16_t idx; }; \
+ inline bool isValid(_name _handle) { return UINT16_MAX != _handle.idx; }
+
namespace entry
{
- struct WindowHandle { uint16_t idx; };
- inline bool isValid(WindowHandle _handle) { return UINT16_MAX != _handle.idx; }
+ ENTRY_HANDLE(WindowHandle);
+ ENTRY_HANDLE(GamepadHandle);
- struct GamepadHandle { uint16_t idx; };
- inline bool isValid(GamepadHandle _handle) { return UINT16_MAX != _handle.idx; }
+ ///
+ constexpr WindowHandle kDefaultWindowHandle = { 0 };
+ ///
struct MouseButton
{
enum Enum
@@ -56,6 +62,7 @@ namespace entry
};
};
+ ///
struct GamepadAxis
{
enum Enum
@@ -71,6 +78,7 @@ namespace entry
};
};
+ ///
struct Modifier
{
enum Enum
@@ -87,6 +95,7 @@ namespace entry
};
};
+ ///
struct Key
{
enum Enum
@@ -198,6 +207,7 @@ namespace entry
};
};
+ ///
struct Suspend
{
enum Enum
@@ -211,8 +221,10 @@ namespace entry
};
};
+ ///
const char* getName(Key::Enum _key);
+ ///
struct MouseState
{
MouseState()
@@ -232,6 +244,7 @@ namespace entry
uint8_t m_buttons[entry::MouseButton::Count];
};
+ ///
struct GamepadState
{
GamepadState()
@@ -242,22 +255,52 @@ namespace entry
int32_t m_axis[entry::GamepadAxis::Count];
};
+ ///
bool processEvents(uint32_t& _width, uint32_t& _height, uint32_t& _debug, uint32_t& _reset, MouseState* _mouse = NULL);
+ ///
bx::FileReaderI* getFileReader();
+
+ ///
bx::FileWriterI* getFileWriter();
+
+ ///
bx::AllocatorI* getAllocator();
+ ///
WindowHandle createWindow(int32_t _x, int32_t _y, uint32_t _width, uint32_t _height, uint32_t _flags = ENTRY_WINDOW_FLAG_NONE, const char* _title = "");
+
+ ///
void destroyWindow(WindowHandle _handle);
+
+ ///
void setWindowPos(WindowHandle _handle, int32_t _x, int32_t _y);
+
+ ///
void setWindowSize(WindowHandle _handle, uint32_t _width, uint32_t _height);
+
+ ///
void setWindowTitle(WindowHandle _handle, const char* _title);
+
+ ///
void setWindowFlags(WindowHandle _handle, uint32_t _flags, bool _enabled);
+
+ ///
void toggleFullscreen(WindowHandle _handle);
+
+ ///
void setMouseLock(WindowHandle _handle, bool _lock);
+
+ ///
+ void* getNativeWindowHandle(WindowHandle _handle);
+
+ ///
+ void* getNativeDisplayHandle();
+
+ ///
void setCurrentDir(const char* _dir);
+ ///
struct WindowState
{
WindowState()
@@ -276,8 +319,10 @@ namespace entry
bx::FilePath m_dropFile;
};
+ ///
bool processWindowEvents(WindowState& _state, uint32_t& _debug, uint32_t& _reset);
+ ///
class BX_NO_VTABLE AppI
{
public:
@@ -308,12 +353,8 @@ namespace entry
///
AppI* getNext();
- AppI* m_next;
-
private:
- const char* m_name;
- const char* m_description;
- const char* m_url;
+ BX_ALIGN_DECL(16, uintptr_t) m_internal[4];
};
///
diff --git a/3rdparty/bgfx/examples/common/entry/entry_android.cpp b/3rdparty/bgfx/examples/common/entry/entry_android.cpp
index cd2baf9044f..3a6ac8561d3 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_android.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_android.cpp
@@ -1,14 +1,12 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "entry_p.h"
#if ENTRY_CONFIG_USE_NATIVE && BX_PLATFORM_ANDROID
-#include <bgfx/platform.h>
-
#include <bx/thread.h>
#include <bx/file.h>
@@ -29,18 +27,6 @@ extern "C"
namespace entry
{
- ///
- inline void androidSetWindow(::ANativeWindow* _window)
- {
- bgfx::PlatformData pd;
- pd.ndt = NULL;
- pd.nwh = _window;
- pd.context = NULL;
- pd.backBuffer = NULL;
- pd.backBufferDS = NULL;
- bgfx::setPlatformData(pd);
- }
-
struct GamepadRemap
{
uint16_t m_keyCode;
@@ -233,7 +219,6 @@ namespace entry
if (m_window != m_app->window)
{
m_window = m_app->window;
- androidSetWindow(m_window);
int32_t width = ANativeWindow_getWidth(m_window);
int32_t height = ANativeWindow_getHeight(m_window);
@@ -550,6 +535,21 @@ namespace entry
BX_UNUSED(_handle, _lock);
}
+ void* getNativeWindowHandle(WindowHandle _handle)
+ {
+ if (kDefaultWindowHandle.idx == _handle.idx)
+ {
+ return s_ctx.m_window;
+ }
+
+ return NULL;
+ }
+
+ void* getNativeDisplayHandle()
+ {
+ return NULL;
+ }
+
int32_t MainThreadEntry::threadFunc(bx::Thread* _thread, void* _userData)
{
BX_UNUSED(_thread);
diff --git a/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp b/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp
index 78cc9a7997b..da15502409c 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_glfw.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "entry_p.h"
@@ -85,27 +85,6 @@ namespace entry
glfwDestroyWindow(_window);
}
- static void glfwSetWindow(GLFWwindow* _window)
- {
- bgfx::PlatformData pd;
-# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- pd.ndt = glfwGetWaylandDisplay();
-# else
- pd.ndt = glfwGetX11Display();
- #endif
-# elif BX_PLATFORM_OSX
- pd.ndt = NULL;
-# elif BX_PLATFORM_WINDOWS
- pd.ndt = NULL;
-# endif // BX_PLATFORM_WINDOWS
- pd.nwh = glfwNativeWindowHandle(_window);
- pd.context = NULL;
- pd.backBuffer = NULL;
- pd.backBufferDS = NULL;
- bgfx::setPlatformData(pd);
- }
-
static uint8_t translateKeyModifiers(int _glfw)
{
uint8_t modifiers = 0;
@@ -453,29 +432,28 @@ namespace entry
glfwWindowHint(GLFW_CLIENT_API, GLFW_NO_API);
WindowHandle handle = { m_windowAlloc.alloc() };
- m_windows[0] = glfwCreateWindow(ENTRY_DEFAULT_WIDTH
+ m_window[0] = glfwCreateWindow(ENTRY_DEFAULT_WIDTH
, ENTRY_DEFAULT_HEIGHT
, "bgfx"
, NULL
, NULL
);
- if (!m_windows[0])
+ if (!m_window[0])
{
DBG("glfwCreateWindow failed!");
glfwTerminate();
return bx::kExitFailure;
}
- glfwSetKeyCallback(m_windows[0], keyCb);
- glfwSetCharCallback(m_windows[0], charCb);
- glfwSetScrollCallback(m_windows[0], scrollCb);
- glfwSetCursorPosCallback(m_windows[0], cursorPosCb);
- glfwSetMouseButtonCallback(m_windows[0], mouseButtonCb);
- glfwSetWindowSizeCallback(m_windows[0], windowSizeCb);
- glfwSetDropCallback(m_windows[0], dropFileCb);
+ glfwSetKeyCallback(m_window[0], keyCb);
+ glfwSetCharCallback(m_window[0], charCb);
+ glfwSetScrollCallback(m_window[0], scrollCb);
+ glfwSetCursorPosCallback(m_window[0], cursorPosCb);
+ glfwSetMouseButtonCallback(m_window[0], mouseButtonCb);
+ glfwSetWindowSizeCallback(m_window[0], windowSizeCb);
+ glfwSetDropCallback(m_window[0], dropFileCb);
- glfwSetWindow(m_windows[0]);
m_eventQueue.postSizeEvent(handle, ENTRY_DEFAULT_WIDTH, ENTRY_DEFAULT_HEIGHT);
for (uint32_t ii = 0; ii < ENTRY_CONFIG_MAX_GAMEPADS; ++ii)
@@ -492,8 +470,8 @@ namespace entry
m_thread.init(MainThreadEntry::threadFunc, &m_mte);
- while (NULL != m_windows[0]
- && !glfwWindowShouldClose(m_windows[0]))
+ while (NULL != m_window[0]
+ && !glfwWindowShouldClose(m_window[0]))
{
glfwWaitEventsTimeout(0.016);
@@ -535,7 +513,7 @@ namespace entry
glfwSetWindowSizeCallback(window, windowSizeCb);
glfwSetDropCallback(window, dropFileCb);
- m_windows[msg->m_handle.idx] = window;
+ m_window[msg->m_handle.idx] = window;
m_eventQueue.postSizeEvent(msg->m_handle, msg->m_width, msg->m_height);
m_eventQueue.postWindowEvent(msg->m_handle, glfwNativeWindowHandle(window));
}
@@ -545,31 +523,31 @@ namespace entry
{
if (isValid(msg->m_handle) )
{
- GLFWwindow* window = m_windows[msg->m_handle.idx];
+ GLFWwindow* window = m_window[msg->m_handle.idx];
m_eventQueue.postWindowEvent(msg->m_handle);
glfwDestroyWindowImpl(window);
- m_windows[msg->m_handle.idx] = NULL;
+ m_window[msg->m_handle.idx] = NULL;
}
}
break;
case GLFW_WINDOW_SET_TITLE:
{
- GLFWwindow* window = m_windows[msg->m_handle.idx];
+ GLFWwindow* window = m_window[msg->m_handle.idx];
glfwSetWindowTitle(window, msg->m_title.c_str());
}
break;
case GLFW_WINDOW_SET_POS:
{
- GLFWwindow* window = m_windows[msg->m_handle.idx];
+ GLFWwindow* window = m_window[msg->m_handle.idx];
glfwSetWindowPos(window, msg->m_x, msg->m_y);
}
break;
case GLFW_WINDOW_SET_SIZE:
{
- GLFWwindow* window = m_windows[msg->m_handle.idx];
+ GLFWwindow* window = m_window[msg->m_handle.idx];
glfwSetWindowSize(window, msg->m_width, msg->m_height);
}
break;
@@ -582,7 +560,7 @@ namespace entry
case GLFW_WINDOW_TOGGLE_FULL_SCREEN:
{
- GLFWwindow* window = m_windows[msg->m_handle.idx];
+ GLFWwindow* window = m_window[msg->m_handle.idx];
if (glfwGetWindowMonitor(window) )
{
glfwSetWindowMonitor(window
@@ -619,7 +597,7 @@ namespace entry
case GLFW_WINDOW_MOUSE_LOCK:
{
- GLFWwindow* window = m_windows[msg->m_handle.idx];
+ GLFWwindow* window = m_window[msg->m_handle.idx];
if (msg->m_value)
{
glfwSetInputMode(window, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
@@ -639,7 +617,7 @@ namespace entry
m_eventQueue.postExitEvent();
m_thread.shutdown();
- glfwDestroyWindowImpl(m_windows[0]);
+ glfwDestroyWindowImpl(m_window[0]);
glfwTerminate();
return m_thread.getExitCode();
@@ -651,7 +629,7 @@ namespace entry
for (uint32_t ii = 0, num = m_windowAlloc.getNumHandles(); ii < num; ++ii)
{
uint16_t idx = m_windowAlloc.getHandleAt(ii);
- if (_window == m_windows[idx])
+ if (_window == m_window[idx])
{
WindowHandle handle = { idx };
return handle;
@@ -676,7 +654,7 @@ namespace entry
EventQueue m_eventQueue;
bx::Mutex m_lock;
- GLFWwindow* m_windows[ENTRY_CONFIG_MAX_WINDOWS];
+ GLFWwindow* m_window[ENTRY_CONFIG_MAX_WINDOWS];
bx::HandleAllocT<ENTRY_CONFIG_MAX_WINDOWS> m_windowAlloc;
GamepadGLFW m_gamepad[ENTRY_CONFIG_MAX_GAMEPADS];
@@ -879,6 +857,24 @@ namespace entry
s_ctx.m_msgs.push(msg);
}
+ void* getNativeWindowHandle(WindowHandle _handle)
+ {
+ return glfwNativeWindowHandle(s_ctx.m_window[_handle.idx]);
+ }
+
+ void* getNativeDisplayHandle()
+ {
+# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
+# if ENTRY_CONFIG_USE_WAYLAND
+ return glfwGetWaylandDisplay();
+# else
+ return glfwGetX11Display();
+# endif // ENTRY_CONFIG_USE_WAYLAND
+# else
+ return NULL;
+# endif // BX_PLATFORM_*
+ }
+
int32_t MainThreadEntry::threadFunc(bx::Thread* _thread, void* _userData)
{
BX_UNUSED(_thread);
diff --git a/3rdparty/bgfx/examples/common/entry/entry_html5.cpp b/3rdparty/bgfx/examples/common/entry/entry_html5.cpp
index 6482942ff51..884a563b783 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_html5.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_html5.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "entry_p.h"
@@ -28,8 +28,6 @@ extern "C" void entry_emscripten_yield()
namespace entry
{
- static WindowHandle s_defaultWindow = { 0 };
-
static uint8_t s_translateKey[256];
struct Context
@@ -102,8 +100,6 @@ namespace entry
static const char* canvas = "#canvas";
EMSCRIPTEN_CHECK(emscripten_set_mousedown_callback(canvas, this, true, mouseCb) );
-
- EMSCRIPTEN_CHECK(emscripten_set_mousedown_callback(canvas, this, true, mouseCb) );
EMSCRIPTEN_CHECK(emscripten_set_mouseup_callback(canvas, this, true, mouseCb) );
EMSCRIPTEN_CHECK(emscripten_set_mousemove_callback(canvas, this, true, mouseCb) );
@@ -128,11 +124,6 @@ namespace entry
EMSCRIPTEN_CHECK(emscripten_set_focusin_callback(EMSCRIPTEN_EVENT_TARGET_DOCUMENT, this, true, focusCb) );
EMSCRIPTEN_CHECK(emscripten_set_focusout_callback(EMSCRIPTEN_EVENT_TARGET_DOCUMENT, this, true, focusCb) );
- bgfx::PlatformData pd;
- bx::memSet(&pd, 0, sizeof(pd) );
- pd.nwh = (void*)canvas;
- bgfx::setPlatformData(pd);
-
int32_t result = main(_argc, _argv);
return result;
}
@@ -165,7 +156,7 @@ namespace entry
case EMSCRIPTEN_EVENT_MOUSEMOVE:
s_ctx.m_mx = _event->targetX;
s_ctx.m_my = _event->targetY;
- s_ctx.m_eventQueue.postMouseEvent(s_defaultWindow, s_ctx.m_mx, s_ctx.m_my, s_ctx.m_scroll);
+ s_ctx.m_eventQueue.postMouseEvent(kDefaultWindowHandle, s_ctx.m_mx, s_ctx.m_my, s_ctx.m_scroll);
return true;
case EMSCRIPTEN_EVENT_MOUSEDOWN:
@@ -178,7 +169,7 @@ namespace entry
? MouseButton::Middle : MouseButton::Left)
;
s_ctx.m_eventQueue.postMouseEvent(
- s_defaultWindow
+ kDefaultWindowHandle
, s_ctx.m_mx
, s_ctx.m_my
, s_ctx.m_scroll
@@ -205,7 +196,7 @@ namespace entry
s_ctx.m_scrollf += _event->deltaY;
s_ctx.m_scroll = (int32_t)s_ctx.m_scrollf;
- s_ctx.m_eventQueue.postMouseEvent(s_defaultWindow, s_ctx.m_mx, s_ctx.m_my, s_ctx.m_scroll);
+ s_ctx.m_eventQueue.postMouseEvent(kDefaultWindowHandle, s_ctx.m_mx, s_ctx.m_my, s_ctx.m_scroll);
return true;
}
}
@@ -305,14 +296,14 @@ namespace entry
else
{
enum { ShiftMask = Modifier::LeftShift|Modifier::RightShift };
- s_ctx.m_eventQueue.postCharEvent(s_defaultWindow, 1, pressedChar);
- s_ctx.m_eventQueue.postKeyEvent(s_defaultWindow, key, modifiers, true);
+ s_ctx.m_eventQueue.postCharEvent(kDefaultWindowHandle, 1, pressedChar);
+ s_ctx.m_eventQueue.postKeyEvent(kDefaultWindowHandle, key, modifiers, true);
return true;
}
break;
case EMSCRIPTEN_EVENT_KEYUP:
- s_ctx.m_eventQueue.postKeyEvent(s_defaultWindow, key, modifiers, false);
+ s_ctx.m_eventQueue.postKeyEvent(kDefaultWindowHandle, key, modifiers, false);
return true;
}
}
@@ -342,19 +333,19 @@ namespace entry
switch (_eventType)
{
case EMSCRIPTEN_EVENT_BLUR:
- s_ctx.m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::DidSuspend);
+ s_ctx.m_eventQueue.postSuspendEvent(kDefaultWindowHandle, Suspend::DidSuspend);
return true;
case EMSCRIPTEN_EVENT_FOCUS:
- s_ctx.m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::DidResume);
+ s_ctx.m_eventQueue.postSuspendEvent(kDefaultWindowHandle, Suspend::DidResume);
return true;
case EMSCRIPTEN_EVENT_FOCUSIN:
- s_ctx.m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::WillResume);
+ s_ctx.m_eventQueue.postSuspendEvent(kDefaultWindowHandle, Suspend::WillResume);
return true;
case EMSCRIPTEN_EVENT_FOCUSOUT:
- s_ctx.m_eventQueue.postSuspendEvent(s_defaultWindow, Suspend::WillSuspend);
+ s_ctx.m_eventQueue.postSuspendEvent(kDefaultWindowHandle, Suspend::WillSuspend);
return true;
}
}
@@ -421,6 +412,21 @@ namespace entry
{
BX_UNUSED(_handle, _lock);
}
+
+ void* getNativeWindowHandle(WindowHandle _handle)
+ {
+ if (kDefaultWindowHandle.idx == _handle.idx)
+ {
+ return (void*)"#canvas";
+ }
+
+ return NULL;
+ }
+
+ void* getNativeDisplayHandle()
+ {
+ return NULL;
+ }
}
int main(int _argc, const char* const* _argv)
diff --git a/3rdparty/bgfx/examples/common/entry/entry_ios.mm b/3rdparty/bgfx/examples/common/entry/entry_ios.mm
index e0102facdea..f123b6684ea 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_ios.mm
+++ b/3rdparty/bgfx/examples/common/entry/entry_ios.mm
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "entry_p.h"
@@ -57,6 +57,7 @@ namespace entry
MainThreadEntry m_mte;
bx::Thread m_thread;
+ void* m_window;
EventQueue m_eventQueue;
};
@@ -145,16 +146,25 @@ namespace entry
BX_UNUSED(_handle, _lock);
}
+ void* getNativeWindowHandle(WindowHandle _handle)
+ {
+ if (kDefaultWindowHandle.idx == _handle.idx)
+ {
+ return s_ctx.m_window;
+ }
+
+ return NULL;
+ }
+
+ void* getNativeDisplayHandle()
+ {
+ return NULL;
+ }
+
} // namespace entry
using namespace entry;
-#ifdef HAS_METAL_SDK
-static id<MTLDevice> m_device = NULL;
-#else
-static void* m_device = NULL;
-#endif
-
@interface ViewController : UIViewController
@end
@implementation ViewController
@@ -177,13 +187,14 @@ static void* m_device = NULL;
+ (Class)layerClass
{
#ifdef HAS_METAL_SDK
+ static id<MTLDevice> device = NULL;
Class metalClass = NSClassFromString(@"CAMetalLayer"); //is metal runtime sdk available
if ( metalClass != nil)
{
- m_device = MTLCreateSystemDefaultDevice(); // is metal supported on this device (is there a better way to do this - without creating device ?)
- if (m_device)
+ device = MTLCreateSystemDefaultDevice(); // is metal supported on this device (is there a better way to do this - without creating device ?)
+ if (NULL != device)
{
- [m_device retain];
+ [device retain];
return metalClass;
}
}
@@ -201,13 +212,7 @@ static void* m_device = NULL;
return nil;
}
- bgfx::PlatformData pd;
- pd.ndt = NULL;
- pd.nwh = self.layer;
- pd.context = m_device;
- pd.backBuffer = NULL;
- pd.backBufferDS = NULL;
- bgfx::setPlatformData(pd);
+ s_ctx->m_window = self.layer;
return self;
}
@@ -226,7 +231,7 @@ static void* m_device = NULL;
m_displayLink = [self.window.screen displayLinkWithTarget:self selector:@selector(renderFrame)];
//[m_displayLink setFrameInterval:1];
//[m_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
- // [m_displayLink addToRunLoop:[NSRunLoop currentRunLoop]];
+ //[m_displayLink addToRunLoop:[NSRunLoop currentRunLoop]];
[m_displayLink addToRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
}
}
diff --git a/3rdparty/bgfx/examples/common/entry/entry_noop.cpp b/3rdparty/bgfx/examples/common/entry/entry_noop.cpp
index e47ba966328..22d160f592c 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_noop.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_noop.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "entry_p.h"
@@ -67,6 +67,17 @@ namespace entry
BX_UNUSED(_handle, _lock);
}
+ void* getNativeWindowHandle(WindowHandle _handle)
+ {
+ BX_UNUSED(_handle);
+ return NULL;
+ }
+
+ void* getNativeDisplayHandle()
+ {
+ return NULL;
+ }
+
} // namespace entry
int main(int _argc, const char* const* _argv)
diff --git a/3rdparty/bgfx/examples/common/entry/entry_osx.mm b/3rdparty/bgfx/examples/common/entry/entry_osx.mm
index 8ff3d220b64..948483ca93e 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_osx.mm
+++ b/3rdparty/bgfx/examples/common/entry/entry_osx.mm
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "entry_p.h"
@@ -45,18 +45,6 @@
namespace entry
{
- ///
- inline void osxSetNSWindow(void* _window, void* _nsgl = NULL)
- {
- bgfx::PlatformData pd;
- pd.ndt = NULL;
- pd.nwh = _window;
- pd.context = _nsgl;
- pd.backBuffer = NULL;
- pd.backBufferDS = NULL;
- bgfx::setPlatformData(pd);
- }
-
static uint8_t s_translateKey[256];
struct MainThreadEntry
@@ -507,8 +495,6 @@ namespace entry
m_windowFrame = [m_window[0] frame];
- osxSetNSWindow(m_window[0]);
-
MainThreadEntry mte;
mte.m_argc = _argc;
mte.m_argv = _argv;
@@ -729,6 +715,16 @@ namespace entry
});
}
+ void* getNativeWindowHandle(WindowHandle _handle)
+ {
+ return s_ctx.m_window[_handle.idx];
+ }
+
+ void* getNativeDisplayHandle()
+ {
+ return NULL;
+ }
+
} // namespace entry
@implementation AppDelegate
diff --git a/3rdparty/bgfx/examples/common/entry/entry_p.h b/3rdparty/bgfx/examples/common/entry/entry_p.h
index 1c66045bdcc..59307c2f040 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_p.h
+++ b/3rdparty/bgfx/examples/common/entry/entry_p.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef ENTRY_PRIVATE_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
index 360d1df0add..8744b98e763 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_sdl.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "entry_p.h"
@@ -74,35 +74,6 @@ namespace entry
# endif // BX_PLATFORM_
}
- inline bool sdlSetWindow(SDL_Window* _window)
- {
- SDL_SysWMinfo wmi;
- SDL_VERSION(&wmi.version);
- if (!SDL_GetWindowWMInfo(_window, &wmi) )
- {
- return false;
- }
-
- bgfx::PlatformData pd;
-# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
-# if ENTRY_CONFIG_USE_WAYLAND
- pd.ndt = wmi.info.wl.display;
-# else
- pd.ndt = wmi.info.x11.display;
-# endif
-# else
- pd.ndt = NULL;
-# endif // BX_PLATFORM_
- pd.nwh = sdlNativeWindowHandle(_window);
-
- pd.context = NULL;
- pd.backBuffer = NULL;
- pd.backBufferDS = NULL;
- bgfx::setPlatformData(pd);
-
- return true;
- }
-
static void sdlDestroyWindow(SDL_Window* _window)
{
if(!_window)
@@ -513,7 +484,6 @@ namespace entry
s_userEventStart = SDL_RegisterEvents(7);
- sdlSetWindow(m_window[0]);
bgfx::renderFrame();
m_thread.init(MainThreadEntry::threadFunc, &m_mte);
@@ -536,7 +506,7 @@ namespace entry
bx::AllocatorI* allocator = getAllocator();
uint32_t size = (uint32_t)bx::getSize(reader);
void* data = BX_ALLOC(allocator, size + 1);
- bx::read(reader, data, size);
+ bx::read(reader, data, size, bx::ErrorAssert{});
bx::close(reader);
((char*)data)[size] = '\0';
@@ -1162,6 +1132,31 @@ namespace entry
sdlPostEvent(SDL_USER_WINDOW_MOUSE_LOCK, _handle, NULL, _lock);
}
+ void* getNativeWindowHandle(WindowHandle _handle)
+ {
+ return sdlNativeWindowHandle(s_ctx.m_window[_handle.idx]);
+ }
+
+ void* getNativeDisplayHandle()
+ {
+ SDL_SysWMinfo wmi;
+ SDL_VERSION(&wmi.version);
+ if (!SDL_GetWindowWMInfo(s_ctx.m_window[0], &wmi) )
+ {
+ return NULL;
+ }
+
+# if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
+# if ENTRY_CONFIG_USE_WAYLAND
+ return wmi.info.wl.display;
+# else
+ return wmi.info.x11.display;
+# endif // ENTRY_CONFIG_USE_WAYLAND
+# else
+ return NULL;
+# endif // BX_PLATFORM_*
+ }
+
int32_t MainThreadEntry::threadFunc(bx::Thread* _thread, void* _userData)
{
BX_UNUSED(_thread);
diff --git a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
index 076bd03b2da..5d60573d08e 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_windows.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "entry_p.h"
@@ -45,15 +45,6 @@ namespace entry
return utf16;
}
- ///
- inline void winSetHwnd(::HWND _window)
- {
- bgfx::PlatformData pd;
- bx::memSet(&pd, 0, sizeof(pd) );
- pd.nwh = _window;
- bgfx::setPlatformData(pd);
- }
-
typedef DWORD (WINAPI* PFN_XINPUT_GET_STATE)(DWORD dwUserIndex, XINPUT_STATE* pState);
typedef void (WINAPI* PFN_XINPUT_ENABLE)(BOOL enable); // 1.4+
@@ -502,8 +493,6 @@ namespace entry
| ENTRY_WINDOW_FLAG_FRAME
;
- winSetHwnd(m_hwnd[0]);
-
adjust(m_hwnd[0], ENTRY_DEFAULT_WIDTH, ENTRY_DEFAULT_HEIGHT, true);
clear(m_hwnd[0]);
@@ -938,6 +927,7 @@ namespace entry
SelectObject(hdc, brush);
FillRect(hdc, &rect, brush);
ReleaseDC(_hwnd, hdc);
+ DeleteObject(brush);
}
void adjust(HWND _hwnd, uint32_t _width, uint32_t _height, bool _windowFrame)
@@ -1169,6 +1159,16 @@ namespace entry
PostMessage(s_ctx.m_hwnd[0], WM_USER_WINDOW_MOUSE_LOCK, _handle.idx, _lock);
}
+ void* getNativeWindowHandle(WindowHandle _handle)
+ {
+ return s_ctx.m_hwnd[_handle.idx];
+ }
+
+ void* getNativeDisplayHandle()
+ {
+ return NULL;
+ }
+
int32_t MainThreadEntry::threadFunc(bx::Thread* /*_thread*/, void* _userData)
{
MainThreadEntry* self = (MainThreadEntry*)_userData;
diff --git a/3rdparty/bgfx/examples/common/entry/entry_winrt.cx b/3rdparty/bgfx/examples/common/entry/entry_winrt.cx
deleted file mode 100644
index 25ddb3b0b12..00000000000
--- a/3rdparty/bgfx/examples/common/entry/entry_winrt.cx
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- * Copyright 2011-2016 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
- */
-
-#include "entry_p.h"
-
-#if BX_PLATFORM_WINRT || BX_PLATFORM_XBOXONE
-
-#include <bgfx/platform.h>
-#include <bx/thread.h>
-#include <bx/math.h>
-#include <Unknwn.h>
-#include <cmath>
-
-using namespace Windows::ApplicationModel;
-using namespace Windows::ApplicationModel::Core;
-using namespace Windows::ApplicationModel::Activation;
-using namespace Windows::UI::Core;
-using namespace Windows::UI::Input;
-using namespace Windows::System;
-using namespace Windows::Foundation;
-#if BX_PLATFORM_WINRT
-using namespace Windows::Graphics::Display;
-#endif // BX_PLATFORM_WINRT
-using namespace Platform;
-
-static const char* const g_emptyArgs[] = { "app.exe", "", "" };
-static entry::WindowHandle g_defaultWindow = { 0 };
-static entry::EventQueue g_eventQueue;
-
-///
-inline void winrtSetWindow(::IUnknown* _window)
-{
- bgfx::PlatformData pd;
- pd.ndt = NULL;
- pd.nwh = _window;
- pd.context = NULL;
- pd.backBuffer = NULL;
- pd.backBufferDS = NULL;
- bgfx::setPlatformData(pd);
-}
-
-ref class App sealed : public IFrameworkView
-{
-public:
- App()
- : m_windowVisible(true)
- , m_windowClosed(false)
- {
- }
-
- // IFrameworkView Methods.
- virtual void Initialize(CoreApplicationView^ applicationView)
- {
- applicationView->Activated += ref new
- TypedEventHandler<CoreApplicationView^, IActivatedEventArgs^>(this, &App::OnActivated);
-
- CoreApplication::Suspending += ref new
- EventHandler<SuspendingEventArgs^>(this, &App::OnSuspending);
-
- CoreApplication::Resuming += ref new
- EventHandler<Platform::Object^>(this, &App::OnResuming);
- }
-
- virtual void SetWindow(CoreWindow^ window)
- {
- window->VisibilityChanged += ref new
- TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &App::OnVisibilityChanged);
-
- window->Closed += ref new
- TypedEventHandler<CoreWindow^, CoreWindowEventArgs^>(this, &App::OnWindowClosed);
-
- winrtSetWindow(reinterpret_cast<IUnknown*>(window) );
- }
-
- virtual void Load(String^ entryPoint)
- {
- }
-
- virtual void Run()
- {
- bgfx::renderFrame();
-
- bx::Thread thread;
- thread.init(MainThreadFunc, nullptr);
-
- CoreWindow^ window = CoreWindow::GetForCurrentThread();
- auto bounds = window->Bounds;
-
-#if BX_PLATFORM_WINRT
- auto dpi = DisplayInformation::GetForCurrentView()->LogicalDpi;
- static const float dipsPerInch = 96.0f;
- g_eventQueue.postSizeEvent(g_defaultWindow
- , std::lround(bx::floor(bounds.Width * dpi / dipsPerInch + 0.5f) )
- , std::lround(bx::floor(bounds.Height * dpi / dipsPerInch + 0.5f) )
- );
-#endif // BX_PLATFORM_WINRT
-
- while (!m_windowClosed)
- {
- if (m_windowVisible)
- {
- window->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessAllIfPresent);
- }
- else
- {
- window->Dispatcher->ProcessEvents(CoreProcessEventsOption::ProcessOneAndAllPending);
- }
-
- bgfx::renderFrame();
- }
-
- g_eventQueue.postExitEvent();
-
- while (bgfx::RenderFrame::NoContext != bgfx::renderFrame() ) {};
-
- thread.shutdown();
- }
-
- virtual void Uninitialize()
- {
- }
-
-private:
- bool m_windowVisible;
- bool m_windowClosed;
-
- void OnActivated(CoreApplicationView^ applicationView, IActivatedEventArgs^ args)
- {
- CoreWindow::GetForCurrentThread()->Activate();
- }
-
- void OnVisibilityChanged(CoreWindow^ sender, VisibilityChangedEventArgs^ args)
- {
- m_windowVisible = args->Visible;
- }
-
- void OnSuspending(Platform::Object^ sender, SuspendingEventArgs^ args)
- {
- SuspendingDeferral^ deferral = args->SuspendingOperation->GetDeferral();
- BX_UNUSED(deferral);
- }
-
- void OnResuming(Platform::Object^ sender, Platform::Object^ args)
- {
- }
-
- void OnWindowClosed(CoreWindow^ sender, CoreWindowEventArgs^ args)
- {
- m_windowClosed = true;
- }
-
- static int32_t MainThreadFunc(bx::Thread*, void*)
- {
- return entry::main(BX_COUNTOF(g_emptyArgs), g_emptyArgs);
- }
-};
-
-ref class AppSource sealed : IFrameworkViewSource
-{
-public:
- virtual IFrameworkView^ CreateView()
- {
- return ref new App();
- }
-};
-
-namespace entry
-{
- const Event* poll()
- {
- return g_eventQueue.poll();
- }
-
- const Event* poll(WindowHandle _handle)
- {
- return g_eventQueue.poll(_handle);
- }
-
- void release(const Event* _event)
- {
- g_eventQueue.release(_event);
- }
-
- WindowHandle createWindow(int32_t _x, int32_t _y, uint32_t _width, uint32_t _height, uint32_t _flags, const char* _title)
- {
- BX_UNUSED(_x, _y, _width, _height, _flags, _title);
- WindowHandle handle = { UINT16_MAX };
- return handle;
- }
-
- void destroyWindow(WindowHandle _handle)
- {
- BX_UNUSED(_handle);
- }
-
- void setWindowPos(WindowHandle _handle, int32_t _x, int32_t _y)
- {
- BX_UNUSED(_handle, _x, _y);
- }
-
- void setWindowSize(WindowHandle _handle, uint32_t _width, uint32_t _height)
- {
- BX_UNUSED(_handle, _width, _height);
- }
-
- void setWindowTitle(WindowHandle _handle, const char* _title)
- {
- BX_UNUSED(_handle, _title);
- }
-
- void setWindowFlags(WindowHandle _handle, uint32_t _flags, bool _enabled)
- {
- BX_UNUSED(_handle, _flags, _enabled);
- }
-
- void toggleFullscreen(WindowHandle _handle)
- {
- BX_UNUSED(_handle);
- }
-
- void setMouseLock(WindowHandle _handle, bool _lock)
- {
- BX_UNUSED(_handle, _lock);
- }
-}
-
-[MTAThread]
-int main(Array<String^>^)
-{
- auto appSource = ref new AppSource();
- CoreApplication::Run(appSource);
- return 0;
-}
-
-#endif // BX_PLATFORM_WINRT || BX_PLATFORM_XBOXONE
diff --git a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
index 7f1520b95c6..a5f4b3fa6da 100644
--- a/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
+++ b/3rdparty/bgfx/examples/common/entry/entry_x11.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "entry_p.h"
@@ -12,8 +12,6 @@
#include <X11/keysymdef.h>
#include <X11/Xlib.h> // will include X11 which #defines None... Don't mess with order of includes.
#include <X11/Xutil.h>
-#include <bgfx/platform.h>
-
#include <unistd.h> // syscall
#undef None
@@ -31,18 +29,6 @@ namespace entry
static const char* s_applicationName = "BGFX";
static const char* s_applicationClass = "bgfx";
- ///
- inline void x11SetDisplayWindow(void* _display, uint32_t _window, void* _glx = NULL)
- {
- bgfx::PlatformData pd;
- pd.ndt = _display;
- pd.nwh = (void*)(uintptr_t)_window;
- pd.context = _glx;
- pd.backBuffer = NULL;
- pd.backBufferDS = NULL;
- bgfx::setPlatformData(pd);
- }
-
#define JS_EVENT_BUTTON 0x01 /* button pressed/released */
#define JS_EVENT_AXIS 0x02 /* joystick moved */
#define JS_EVENT_INIT 0x80 /* initial state of device */
@@ -346,7 +332,13 @@ namespace entry
int32_t run(int _argc, const char* const* _argv)
{
XInitThreads();
+
m_display = XOpenDisplay(NULL);
+ if (NULL == m_display)
+ {
+ bx::printf("XOpenDisplay failed: DISPLAY environment variable must be set.\n\n");
+ return bx::kExitFailure;
+ }
int32_t screen = DefaultScreen(m_display);
m_depth = DefaultDepth(m_display, screen);
@@ -355,29 +347,29 @@ namespace entry
bx::memSet(&m_windowAttrs, 0, sizeof(m_windowAttrs) );
m_windowAttrs.background_pixel = 0;
- m_windowAttrs.border_pixel = 0;
+ m_windowAttrs.border_pixel = 0;
m_windowAttrs.bit_gravity = StaticGravity;
- m_windowAttrs.event_mask = 0
- | ButtonPressMask
- | ButtonReleaseMask
- | ExposureMask
- | KeyPressMask
- | KeyReleaseMask
- | PointerMotionMask
- | StructureNotifyMask
- ;
+ m_windowAttrs.event_mask = 0
+ | ButtonPressMask
+ | ButtonReleaseMask
+ | ExposureMask
+ | KeyPressMask
+ | KeyReleaseMask
+ | PointerMotionMask
+ | StructureNotifyMask
+ ;
m_windowAlloc.alloc();
- m_window[0] = XCreateWindow(m_display
- , m_root
- , 0, 0
- , 1, 1, 0
- , m_depth
- , InputOutput
- , m_visual
- , CWBorderPixel|CWEventMask|CWBackPixel|CWBitGravity
- , &m_windowAttrs
- );
+ m_window[0] = XCreateWindow(
+ m_display
+ , m_root
+ , 0, 0, 1, 1, 0
+ , m_depth
+ , InputOutput
+ , m_visual
+ , CWBorderPixel|CWEventMask|CWBackPixel|CWBitGravity
+ , &m_windowAttrs
+ );
const char* wmDeleteWindowName = "WM_DELETE_WINDOW";
Atom wmDeleteWindow;
@@ -397,18 +389,16 @@ namespace entry
im = XOpenIM(m_display, NULL, NULL, NULL);
XIC ic;
- ic = XCreateIC(im
- , XNInputStyle
- , 0
- | XIMPreeditNothing
- | XIMStatusNothing
- , XNClientWindow
- , m_window[0]
- , NULL
- );
-
- //
- x11SetDisplayWindow(m_display, m_window[0]);
+ ic = XCreateIC(
+ im
+ , XNInputStyle
+ , 0
+ | XIMPreeditNothing
+ | XIMStatusNothing
+ , XNClientWindow
+ , m_window[0]
+ , NULL
+ );
MainThreadEntry mte;
mte.m_argc = _argc;
@@ -574,6 +564,9 @@ namespace entry
XUnmapWindow(m_display, m_window[0]);
XDestroyWindow(m_display, m_window[0]);
+ XCloseDisplay(m_display);
+ m_display = NULL;
+
return thread.getExitCode();
}
@@ -585,19 +578,20 @@ namespace entry
void createWindow(WindowHandle _handle, Msg* msg)
{
- Window window = XCreateWindow(m_display
- , m_root
- , msg->m_x
- , msg->m_y
- , msg->m_width
- , msg->m_height
- , 0
- , m_depth
- , InputOutput
- , m_visual
- , CWBorderPixel|CWEventMask|CWBackPixel|CWBitGravity
- , &m_windowAttrs
- );
+ Window window = XCreateWindow(
+ m_display
+ , m_root
+ , msg->m_x
+ , msg->m_y
+ , msg->m_width
+ , msg->m_height
+ , 0
+ , m_depth
+ , InputOutput
+ , m_visual
+ , CWBorderPixel|CWEventMask|CWBackPixel|CWBitGravity
+ , &m_windowAttrs
+ );
m_window[_handle.idx] = window;
const char* wmDeleteWindowName = "WM_DELETE_WINDOW";
@@ -767,6 +761,16 @@ namespace entry
BX_UNUSED(_handle, _lock);
}
+ void* getNativeWindowHandle(WindowHandle _handle)
+ {
+ return (void*)(uintptr_t)s_ctx.m_window[_handle.idx];
+ }
+
+ void* getNativeDisplayHandle()
+ {
+ return s_ctx.m_display;
+ }
+
} // namespace entry
int main(int _argc, const char* const* _argv)
diff --git a/3rdparty/bgfx/examples/common/entry/input.cpp b/3rdparty/bgfx/examples/common/entry/input.cpp
index d4045326346..770922d6fd4 100644
--- a/3rdparty/bgfx/examples/common/entry/input.cpp
+++ b/3rdparty/bgfx/examples/common/entry/input.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <memory.h>
@@ -375,8 +375,8 @@ void inputSetMouseLock(bool _lock)
if (s_input->m_mouse.m_lock != _lock)
{
s_input->m_mouse.m_lock = _lock;
- entry::WindowHandle defaultWindow = { 0 };
- entry::setMouseLock(defaultWindow, _lock);
+
+ entry::setMouseLock(entry::kDefaultWindowHandle, _lock);
if (_lock)
{
s_input->m_mouse.m_norm[0] = 0.0f;
diff --git a/3rdparty/bgfx/examples/common/entry/input.h b/3rdparty/bgfx/examples/common/entry/input.h
index f8f8340bcb0..d51a7f338f5 100644
--- a/3rdparty/bgfx/examples/common/entry/input.h
+++ b/3rdparty/bgfx/examples/common/entry/input.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef INPUT_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/example-glue.cpp b/3rdparty/bgfx/examples/common/example-glue.cpp
index c4b309c3607..74ff3719f18 100644
--- a/3rdparty/bgfx/examples/common/example-glue.cpp
+++ b/3rdparty/bgfx/examples/common/example-glue.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "imgui/imgui.h"
@@ -35,9 +35,9 @@ struct SampleData
m_values[m_offset] = value;
m_offset = (m_offset+1) % kNumSamples;
- float min = bx::kFloatMax;
- float max = -bx::kFloatMax;
- float avg = 0.0f;
+ float min = bx::max<float>();
+ float max = bx::min<float>();
+ float avg = 0.0f;
for (uint32_t ii = 0; ii < kNumSamples; ++ii)
{
@@ -81,11 +81,11 @@ static bool bar(float _width, float _maxWidth, float _height, const ImVec4& _col
bool itemHovered = false;
- ImGui::Button("", ImVec2(_width, _height) );
+ ImGui::Button("##", ImVec2(_width, _height) );
itemHovered |= ImGui::IsItemHovered();
ImGui::SameLine();
- ImGui::InvisibleButton("", ImVec2(bx::max(1.0f, _maxWidth-_width), _height) );
+ ImGui::InvisibleButton("##", ImVec2(bx::max(1.0f, _maxWidth-_width), _height) );
itemHovered |= ImGui::IsItemHovered();
ImGui::PopStyleVar(2);
diff --git a/3rdparty/bgfx/examples/common/font/font_manager.cpp b/3rdparty/bgfx/examples/common/font/font_manager.cpp
index 71c298ce7d6..5416fc55798 100644
--- a/3rdparty/bgfx/examples/common/font/font_manager.cpp
+++ b/3rdparty/bgfx/examples/common/font/font_manager.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Jeremie Roy. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bx/bx.h>
@@ -71,9 +71,8 @@ TrueTypeFont::~TrueTypeFont()
bool TrueTypeFont::init(const uint8_t* _buffer, uint32_t _bufferSize, int32_t _fontIndex, uint32_t _pixelHeight, int16_t _widthPadding, int16_t _heightPadding)
{
- BX_ASSERT(m_font == NULL, "TrueTypeFont already initialized");
- BX_ASSERT( (_bufferSize > 256 && _bufferSize < 100000000), "TrueType buffer size is suspicious");
- BX_ASSERT( (_pixelHeight > 4 && _pixelHeight < 128), "TrueType buffer size is suspicious");
+ BX_WARN( (_bufferSize > 256 && _bufferSize < 100000000), "(FontIndex %d) TrueType buffer size is suspicious (%d)", _fontIndex, _bufferSize);
+ BX_WARN( (_pixelHeight > 4 && _pixelHeight < 128), "(FontIndex %d) TrueType pixel height is suspicious (%d)", _fontIndex, _pixelHeight);
BX_UNUSED(_bufferSize);
int offset = stbtt_GetFontOffsetForIndex(_buffer, _fontIndex);
@@ -89,8 +88,6 @@ bool TrueTypeFont::init(const uint8_t* _buffer, uint32_t _bufferSize, int32_t _f
FontInfo TrueTypeFont::getFontInfo()
{
- BX_ASSERT(m_font != NULL, "TrueTypeFont not initialized");
-
int ascent;
int descent;
int lineGap;
@@ -115,8 +112,6 @@ FontInfo TrueTypeFont::getFontInfo()
bool TrueTypeFont::bakeGlyphAlpha(CodePoint _codePoint, GlyphInfo& _glyphInfo, uint8_t* _outBuffer)
{
- BX_ASSERT(m_font != NULL, "TrueTypeFont not initialized");
-
int32_t ascent, descent, lineGap;
stbtt_GetFontVMetrics(&m_font, &ascent, &descent, &lineGap);
@@ -147,8 +142,6 @@ bool TrueTypeFont::bakeGlyphAlpha(CodePoint _codePoint, GlyphInfo& _glyphInfo, u
bool TrueTypeFont::bakeGlyphDistance(CodePoint _codePoint, GlyphInfo& _glyphInfo, uint8_t* _outBuffer)
{
- BX_ASSERT(m_font != NULL, "TrueTypeFont not initialized");
-
int32_t ascent, descent, lineGap;
stbtt_GetFontVMetrics(&m_font, &ascent, &descent, &lineGap);
@@ -290,8 +283,8 @@ TrueTypeHandle FontManager::createTtf(const uint8_t* _buffer, uint32_t _size)
void FontManager::destroyTtf(TrueTypeHandle _handle)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
- delete m_cachedFiles[_handle.idx].buffer;
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
+ delete[] m_cachedFiles[_handle.idx].buffer;
m_cachedFiles[_handle.idx].bufferSize = 0;
m_cachedFiles[_handle.idx].buffer = NULL;
m_filesHandles.free(_handle.idx);
@@ -300,7 +293,7 @@ void FontManager::destroyTtf(TrueTypeHandle _handle)
FontHandle FontManager::createFontByPixelSize(TrueTypeHandle _ttfHandle, uint32_t _typefaceIndex, uint32_t _pixelSize, uint32_t _fontType,
uint16_t _glyphWidthPadding, uint16_t _glyphHeightPadding)
{
- BX_ASSERT(bgfx::isValid(_ttfHandle), "Invalid handle used");
+ BX_ASSERT(isValid(_ttfHandle), "Invalid handle used");
TrueTypeFont* ttf = new TrueTypeFont();
if (!ttf->init(m_cachedFiles[_ttfHandle.idx].buffer, m_cachedFiles[_ttfHandle.idx].bufferSize, _typefaceIndex, _pixelSize, _glyphWidthPadding, _glyphHeightPadding) )
@@ -327,7 +320,7 @@ FontHandle FontManager::createFontByPixelSize(TrueTypeHandle _ttfHandle, uint32_
FontHandle FontManager::createScaledFontToPixelSize(FontHandle _baseFontHandle, uint32_t _pixelSize)
{
- BX_ASSERT(bgfx::isValid(_baseFontHandle), "Invalid handle used");
+ BX_ASSERT(isValid(_baseFontHandle), "Invalid handle used");
CachedFont& baseFont = m_cachedFonts[_baseFontHandle.idx];
FontInfo& fontInfo = baseFont.fontInfo;
@@ -356,7 +349,7 @@ FontHandle FontManager::createScaledFontToPixelSize(FontHandle _baseFontHandle,
void FontManager::destroyFont(FontHandle _handle)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
CachedFont& font = m_cachedFonts[_handle.idx];
@@ -372,7 +365,7 @@ void FontManager::destroyFont(FontHandle _handle)
bool FontManager::preloadGlyph(FontHandle _handle, const wchar_t* _string)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
CachedFont& font = m_cachedFonts[_handle.idx];
if (NULL == font.trueTypeFont)
@@ -394,7 +387,7 @@ bool FontManager::preloadGlyph(FontHandle _handle, const wchar_t* _string)
bool FontManager::preloadGlyph(FontHandle _handle, CodePoint _codePoint)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
CachedFont& font = m_cachedFonts[_handle.idx];
FontInfo& fontInfo = font.fontInfo;
@@ -472,7 +465,7 @@ bool FontManager::preloadGlyph(FontHandle _handle, CodePoint _codePoint)
bool FontManager::addGlyphBitmap(FontHandle _handle, CodePoint _codePoint, uint16_t _width, uint16_t _height, uint16_t _pitch, float extraScale, const uint8_t* _bitmapBuffer, float glyphOffsetX, float glyphOffsetY)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
CachedFont& font = m_cachedFonts[_handle.idx];
GlyphHashMap::iterator iter = font.cachedGlyphs.find(_codePoint);
@@ -519,7 +512,7 @@ bool FontManager::addGlyphBitmap(FontHandle _handle, CodePoint _codePoint, uint1
const FontInfo& FontManager::getFontInfo(FontHandle _handle) const
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
return m_cachedFonts[_handle.idx].fontInfo;
}
diff --git a/3rdparty/bgfx/examples/common/font/font_manager.h b/3rdparty/bgfx/examples/common/font/font_manager.h
index 4173304143b..a8ea3e51cec 100644
--- a/3rdparty/bgfx/examples/common/font/font_manager.h
+++ b/3rdparty/bgfx/examples/common/font/font_manager.h
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Jeremie Roy. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef FONT_MANAGER_H_HEADER_GUARD
@@ -181,7 +181,7 @@ public:
/// @remark the handle is required to be valid
const FontInfo& getFontInfo(FontHandle _handle) const;
- /// Return the rendering informations about the glyph region. Load the
+ /// Return the rendering information about the glyph region. Load the
/// glyph from a TrueType font if possible
///
const GlyphInfo* getGlyphInfo(FontHandle _handle, CodePoint _codePoint);
diff --git a/3rdparty/bgfx/examples/common/font/makefile b/3rdparty/bgfx/examples/common/font/makefile
index 88ff40d2821..554063e5829 100644
--- a/3rdparty/bgfx/examples/common/font/makefile
+++ b/3rdparty/bgfx/examples/common/font/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
include ../../../scripts/shader-embeded.mk
diff --git a/3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp b/3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp
index 131fecf3ae7..77498cbf9c6 100644
--- a/3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp
+++ b/3rdparty/bgfx/examples/common/font/text_buffer_manager.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Jeremie Roy. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "../common.h"
@@ -363,7 +363,7 @@ void TextBuffer::appendText(FontHandle _fontHandle, const char* _string, const c
{
_end = _string + bx::strLen(_string);
}
- BX_ASSERT(_end >= _string);
+ BX_ASSERT(_end >= _string, "");
const FontInfo& font = m_fontManager->getFontInfo(_fontHandle);
if (font.fontType & FONT_TYPE_MASK_DISTANCE_DROP_SHADOW)
@@ -416,7 +416,7 @@ void TextBuffer::appendText(FontHandle _fontHandle, const wchar_t* _string, cons
{
_end = _string + wcslen(_string);
}
- BX_ASSERT(_end >= _string);
+ BX_ASSERT(_end >= _string, "");
const FontInfo& font = m_fontManager->getFontInfo(_fontHandle);
if (font.fontType & FONT_TYPE_MASK_DISTANCE_DROP_SHADOW)
@@ -892,7 +892,10 @@ TextBufferManager::TextBufferManager(FontManager* _fontManager)
TextBufferManager::~TextBufferManager()
{
- BX_ASSERT(m_textBufferHandles.getNumHandles() == 0, "All the text buffers must be destroyed before destroying the manager");
+ BX_ASSERT(
+ m_textBufferHandles.getNumHandles() == 0
+ , "All the text buffers must be destroyed before destroying the manager"
+ );
delete [] m_textBuffers;
bgfx::destroy(u_params);
@@ -927,7 +930,7 @@ TextBufferHandle TextBufferManager::createTextBuffer(uint32_t _type, BufferType:
void TextBufferManager::destroyTextBuffer(TextBufferHandle _handle)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
m_textBufferHandles.free(_handle.idx);
@@ -970,7 +973,7 @@ void TextBufferManager::destroyTextBuffer(TextBufferHandle _handle)
void TextBufferManager::submitTextBuffer(TextBufferHandle _handle, bgfx::ViewId _id, int32_t _depth)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
@@ -1189,119 +1192,119 @@ void TextBufferManager::submitTextBuffer(TextBufferHandle _handle, bgfx::ViewId
void TextBufferManager::setStyle(TextBufferHandle _handle, uint32_t _flags)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->setStyle(_flags);
}
void TextBufferManager::setTextColor(TextBufferHandle _handle, uint32_t _rgba)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->setTextColor(_rgba);
}
void TextBufferManager::setBackgroundColor(TextBufferHandle _handle, uint32_t _rgba)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->setBackgroundColor(_rgba);
}
void TextBufferManager::setOverlineColor(TextBufferHandle _handle, uint32_t _rgba)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->setOverlineColor(_rgba);
}
void TextBufferManager::setUnderlineColor(TextBufferHandle _handle, uint32_t _rgba)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->setUnderlineColor(_rgba);
}
void TextBufferManager::setStrikeThroughColor(TextBufferHandle _handle, uint32_t _rgba)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->setStrikeThroughColor(_rgba);
}
void TextBufferManager::setOutlineColor(TextBufferHandle _handle, uint32_t _rgba)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->setOutlineColor(_rgba);
}
void TextBufferManager::setOutlineWidth(TextBufferHandle _handle, float _outlineWidth)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->setOutlineWidth(_outlineWidth);
}
void TextBufferManager::setDropShadowColor(TextBufferHandle _handle, uint32_t _rgba)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->setDropShadowColor(_rgba);
}
void TextBufferManager::setDropShadowOffset(TextBufferHandle _handle, float _u, float _v)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->setDropShadowOffset(_u, _v);
}
void TextBufferManager::setDropShadowSoftener(TextBufferHandle _handle, float smoother)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->setDropShadowSoftener(smoother);
}
void TextBufferManager::setPenPosition(TextBufferHandle _handle, float _x, float _y)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->setPenPosition(_x, _y);
}
void TextBufferManager::appendText(TextBufferHandle _handle, FontHandle _fontHandle, const char* _string, const char* _end)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->appendText(_fontHandle, _string, _end);
}
void TextBufferManager::appendText(TextBufferHandle _handle, FontHandle _fontHandle, const wchar_t* _string, const wchar_t* _end)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->appendText(_fontHandle, _string, _end);
}
void TextBufferManager::appendAtlasFace(TextBufferHandle _handle, uint16_t _faceIndex)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->appendAtlasFace(_faceIndex);
}
void TextBufferManager::clearTextBuffer(TextBufferHandle _handle)
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
bc.textBuffer->clearTextBuffer();
}
TextRectangle TextBufferManager::getRectangle(TextBufferHandle _handle) const
{
- BX_ASSERT(bgfx::isValid(_handle), "Invalid handle used");
+ BX_ASSERT(isValid(_handle), "Invalid handle used");
BufferCache& bc = m_textBuffers[_handle.idx];
return bc.textBuffer->getRectangle();
}
diff --git a/3rdparty/bgfx/examples/common/font/text_buffer_manager.h b/3rdparty/bgfx/examples/common/font/text_buffer_manager.h
index 8448fe4cc8a..6e20080e3cd 100644
--- a/3rdparty/bgfx/examples/common/font/text_buffer_manager.h
+++ b/3rdparty/bgfx/examples/common/font/text_buffer_manager.h
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Jeremie Roy. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef TEXT_BUFFER_MANAGER_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/font/text_metrics.cpp b/3rdparty/bgfx/examples/common/font/text_metrics.cpp
index f8be80004ea..ac71b79d5b0 100644
--- a/3rdparty/bgfx/examples/common/font/text_metrics.cpp
+++ b/3rdparty/bgfx/examples/common/font/text_metrics.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Jeremie Roy. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "text_metrics.h"
diff --git a/3rdparty/bgfx/examples/common/font/text_metrics.h b/3rdparty/bgfx/examples/common/font/text_metrics.h
index e6a14543b16..40203646b67 100644
--- a/3rdparty/bgfx/examples/common/font/text_metrics.h
+++ b/3rdparty/bgfx/examples/common/font/text_metrics.h
@@ -1,6 +1,6 @@
/*
* Copyright 2013 Jeremie Roy. All rights reserved.
-* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef TEXT_METRICS_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.sc b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.sc
index c7ee13d956d..0355e104827 100644
--- a/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.sc
+++ b/3rdparty/bgfx/examples/common/imgui/fs_imgui_image.sc
@@ -2,7 +2,7 @@ $input v_texcoord0
/*
* Copyright 2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.cpp b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
index 4cf1c4f104f..951c118ed76 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.cpp
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2014-2015 Daniel Collin. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx/bgfx.h>
@@ -117,7 +117,6 @@ struct OcornutImguiContext
bgfx::Encoder* encoder = bgfx::begin();
- uint32_t offset = 0;
for (const ImDrawCmd* cmd = drawList->CmdBuffer.begin(), *cmdEnd = drawList->CmdBuffer.end(); cmd != cmdEnd; ++cmd)
{
if (cmd->UserCallback)
@@ -176,13 +175,11 @@ struct OcornutImguiContext
encoder->setState(state);
encoder->setTexture(0, s_tex, th);
- encoder->setVertexBuffer(0, &tvb, 0, numVertices);
- encoder->setIndexBuffer(&tib, offset, cmd->ElemCount);
+ encoder->setVertexBuffer(0, &tvb, cmd->VtxOffset, numVertices);
+ encoder->setIndexBuffer(&tib, cmd->IdxOffset, cmd->ElemCount);
encoder->submit(m_viewId, program);
}
}
-
- offset += cmd->ElemCount;
}
bgfx::end(encoder);
@@ -215,50 +212,119 @@ struct OcornutImguiContext
setupStyle(true);
+ io.BackendFlags |= ImGuiBackendFlags_RendererHasVtxOffset;
+
#if USE_ENTRY
- io.KeyMap[ImGuiKey_Tab] = (int)entry::Key::Tab;
- io.KeyMap[ImGuiKey_LeftArrow] = (int)entry::Key::Left;
- io.KeyMap[ImGuiKey_RightArrow] = (int)entry::Key::Right;
- io.KeyMap[ImGuiKey_UpArrow] = (int)entry::Key::Up;
- io.KeyMap[ImGuiKey_DownArrow] = (int)entry::Key::Down;
- io.KeyMap[ImGuiKey_PageUp] = (int)entry::Key::PageUp;
- io.KeyMap[ImGuiKey_PageDown] = (int)entry::Key::PageDown;
- io.KeyMap[ImGuiKey_Home] = (int)entry::Key::Home;
- io.KeyMap[ImGuiKey_End] = (int)entry::Key::End;
- io.KeyMap[ImGuiKey_Insert] = (int)entry::Key::Insert;
- io.KeyMap[ImGuiKey_Delete] = (int)entry::Key::Delete;
- io.KeyMap[ImGuiKey_Backspace] = (int)entry::Key::Backspace;
- io.KeyMap[ImGuiKey_Space] = (int)entry::Key::Space;
- io.KeyMap[ImGuiKey_Enter] = (int)entry::Key::Return;
- io.KeyMap[ImGuiKey_Escape] = (int)entry::Key::Esc;
- io.KeyMap[ImGuiKey_A] = (int)entry::Key::KeyA;
- io.KeyMap[ImGuiKey_C] = (int)entry::Key::KeyC;
- io.KeyMap[ImGuiKey_V] = (int)entry::Key::KeyV;
- io.KeyMap[ImGuiKey_X] = (int)entry::Key::KeyX;
- io.KeyMap[ImGuiKey_Y] = (int)entry::Key::KeyY;
- io.KeyMap[ImGuiKey_Z] = (int)entry::Key::KeyZ;
+ for (int32_t ii = 0; ii < (int32_t)entry::Key::Count; ++ii)
+ {
+ m_keyMap[ii] = ImGuiKey_None;
+ }
+
+ m_keyMap[entry::Key::Esc] = ImGuiKey_Escape;
+ m_keyMap[entry::Key::Return] = ImGuiKey_Enter;
+ m_keyMap[entry::Key::Tab] = ImGuiKey_Tab;
+ m_keyMap[entry::Key::Space] = ImGuiKey_Space;
+ m_keyMap[entry::Key::Backspace] = ImGuiKey_Backspace;
+ m_keyMap[entry::Key::Up] = ImGuiKey_UpArrow;
+ m_keyMap[entry::Key::Down] = ImGuiKey_DownArrow;
+ m_keyMap[entry::Key::Left] = ImGuiKey_LeftArrow;
+ m_keyMap[entry::Key::Right] = ImGuiKey_RightArrow;
+ m_keyMap[entry::Key::Insert] = ImGuiKey_Insert;
+ m_keyMap[entry::Key::Delete] = ImGuiKey_Delete;
+ m_keyMap[entry::Key::Home] = ImGuiKey_Home;
+ m_keyMap[entry::Key::End] = ImGuiKey_End;
+ m_keyMap[entry::Key::PageUp] = ImGuiKey_PageUp;
+ m_keyMap[entry::Key::PageDown] = ImGuiKey_PageDown;
+ m_keyMap[entry::Key::Print] = ImGuiKey_PrintScreen;
+ m_keyMap[entry::Key::Plus] = ImGuiKey_Equal;
+ m_keyMap[entry::Key::Minus] = ImGuiKey_Minus;
+ m_keyMap[entry::Key::LeftBracket] = ImGuiKey_LeftBracket;
+ m_keyMap[entry::Key::RightBracket] = ImGuiKey_RightBracket;
+ m_keyMap[entry::Key::Semicolon] = ImGuiKey_Semicolon;
+ m_keyMap[entry::Key::Quote] = ImGuiKey_Apostrophe;
+ m_keyMap[entry::Key::Comma] = ImGuiKey_Comma;
+ m_keyMap[entry::Key::Period] = ImGuiKey_Period;
+ m_keyMap[entry::Key::Slash] = ImGuiKey_Slash;
+ m_keyMap[entry::Key::Backslash] = ImGuiKey_Backslash;
+ m_keyMap[entry::Key::Tilde] = ImGuiKey_GraveAccent;
+ m_keyMap[entry::Key::F1] = ImGuiKey_F1;
+ m_keyMap[entry::Key::F2] = ImGuiKey_F2;
+ m_keyMap[entry::Key::F3] = ImGuiKey_F3;
+ m_keyMap[entry::Key::F4] = ImGuiKey_F4;
+ m_keyMap[entry::Key::F5] = ImGuiKey_F5;
+ m_keyMap[entry::Key::F6] = ImGuiKey_F6;
+ m_keyMap[entry::Key::F7] = ImGuiKey_F7;
+ m_keyMap[entry::Key::F8] = ImGuiKey_F8;
+ m_keyMap[entry::Key::F9] = ImGuiKey_F9;
+ m_keyMap[entry::Key::F10] = ImGuiKey_F10;
+ m_keyMap[entry::Key::F11] = ImGuiKey_F11;
+ m_keyMap[entry::Key::F12] = ImGuiKey_F12;
+ m_keyMap[entry::Key::NumPad0] = ImGuiKey_Keypad0;
+ m_keyMap[entry::Key::NumPad1] = ImGuiKey_Keypad1;
+ m_keyMap[entry::Key::NumPad2] = ImGuiKey_Keypad2;
+ m_keyMap[entry::Key::NumPad3] = ImGuiKey_Keypad3;
+ m_keyMap[entry::Key::NumPad4] = ImGuiKey_Keypad4;
+ m_keyMap[entry::Key::NumPad5] = ImGuiKey_Keypad5;
+ m_keyMap[entry::Key::NumPad6] = ImGuiKey_Keypad6;
+ m_keyMap[entry::Key::NumPad7] = ImGuiKey_Keypad7;
+ m_keyMap[entry::Key::NumPad8] = ImGuiKey_Keypad8;
+ m_keyMap[entry::Key::NumPad9] = ImGuiKey_Keypad9;
+ m_keyMap[entry::Key::Key0] = ImGuiKey_0;
+ m_keyMap[entry::Key::Key1] = ImGuiKey_1;
+ m_keyMap[entry::Key::Key2] = ImGuiKey_2;
+ m_keyMap[entry::Key::Key3] = ImGuiKey_3;
+ m_keyMap[entry::Key::Key4] = ImGuiKey_4;
+ m_keyMap[entry::Key::Key5] = ImGuiKey_5;
+ m_keyMap[entry::Key::Key6] = ImGuiKey_6;
+ m_keyMap[entry::Key::Key7] = ImGuiKey_7;
+ m_keyMap[entry::Key::Key8] = ImGuiKey_8;
+ m_keyMap[entry::Key::Key9] = ImGuiKey_9;
+ m_keyMap[entry::Key::KeyA] = ImGuiKey_A;
+ m_keyMap[entry::Key::KeyB] = ImGuiKey_B;
+ m_keyMap[entry::Key::KeyC] = ImGuiKey_C;
+ m_keyMap[entry::Key::KeyD] = ImGuiKey_D;
+ m_keyMap[entry::Key::KeyE] = ImGuiKey_E;
+ m_keyMap[entry::Key::KeyF] = ImGuiKey_F;
+ m_keyMap[entry::Key::KeyG] = ImGuiKey_G;
+ m_keyMap[entry::Key::KeyH] = ImGuiKey_H;
+ m_keyMap[entry::Key::KeyI] = ImGuiKey_I;
+ m_keyMap[entry::Key::KeyJ] = ImGuiKey_J;
+ m_keyMap[entry::Key::KeyK] = ImGuiKey_K;
+ m_keyMap[entry::Key::KeyL] = ImGuiKey_L;
+ m_keyMap[entry::Key::KeyM] = ImGuiKey_M;
+ m_keyMap[entry::Key::KeyN] = ImGuiKey_N;
+ m_keyMap[entry::Key::KeyO] = ImGuiKey_O;
+ m_keyMap[entry::Key::KeyP] = ImGuiKey_P;
+ m_keyMap[entry::Key::KeyQ] = ImGuiKey_Q;
+ m_keyMap[entry::Key::KeyR] = ImGuiKey_R;
+ m_keyMap[entry::Key::KeyS] = ImGuiKey_S;
+ m_keyMap[entry::Key::KeyT] = ImGuiKey_T;
+ m_keyMap[entry::Key::KeyU] = ImGuiKey_U;
+ m_keyMap[entry::Key::KeyV] = ImGuiKey_V;
+ m_keyMap[entry::Key::KeyW] = ImGuiKey_W;
+ m_keyMap[entry::Key::KeyX] = ImGuiKey_X;
+ m_keyMap[entry::Key::KeyY] = ImGuiKey_Y;
+ m_keyMap[entry::Key::KeyZ] = ImGuiKey_Z;
io.ConfigFlags |= 0
| ImGuiConfigFlags_NavEnableGamepad
| ImGuiConfigFlags_NavEnableKeyboard
;
- io.NavInputs[ImGuiNavInput_Activate] = (int)entry::Key::GamepadA;
- io.NavInputs[ImGuiNavInput_Cancel] = (int)entry::Key::GamepadB;
-// io.NavInputs[ImGuiNavInput_Input] = (int)entry::Key::;
-// io.NavInputs[ImGuiNavInput_Menu] = (int)entry::Key::;
- io.NavInputs[ImGuiNavInput_DpadLeft] = (int)entry::Key::GamepadLeft;
- io.NavInputs[ImGuiNavInput_DpadRight] = (int)entry::Key::GamepadRight;
- io.NavInputs[ImGuiNavInput_DpadUp] = (int)entry::Key::GamepadUp;
- io.NavInputs[ImGuiNavInput_DpadDown] = (int)entry::Key::GamepadDown;
-// io.NavInputs[ImGuiNavInput_LStickLeft] = (int)entry::Key::;
-// io.NavInputs[ImGuiNavInput_LStickRight] = (int)entry::Key::;
-// io.NavInputs[ImGuiNavInput_LStickUp] = (int)entry::Key::;
-// io.NavInputs[ImGuiNavInput_LStickDown] = (int)entry::Key::;
-// io.NavInputs[ImGuiNavInput_FocusPrev] = (int)entry::Key::;
-// io.NavInputs[ImGuiNavInput_FocusNext] = (int)entry::Key::;
-// io.NavInputs[ImGuiNavInput_TweakSlow] = (int)entry::Key::;
-// io.NavInputs[ImGuiNavInput_TweakFast] = (int)entry::Key::;
+ m_keyMap[entry::Key::GamepadStart] = ImGuiKey_GamepadStart;
+ m_keyMap[entry::Key::GamepadBack] = ImGuiKey_GamepadBack;
+ m_keyMap[entry::Key::GamepadY] = ImGuiKey_GamepadFaceUp;
+ m_keyMap[entry::Key::GamepadA] = ImGuiKey_GamepadFaceDown;
+ m_keyMap[entry::Key::GamepadX] = ImGuiKey_GamepadFaceLeft;
+ m_keyMap[entry::Key::GamepadB] = ImGuiKey_GamepadFaceRight;
+ m_keyMap[entry::Key::GamepadUp] = ImGuiKey_GamepadDpadUp;
+ m_keyMap[entry::Key::GamepadDown] = ImGuiKey_GamepadDpadDown;
+ m_keyMap[entry::Key::GamepadLeft] = ImGuiKey_GamepadDpadLeft;
+ m_keyMap[entry::Key::GamepadRight] = ImGuiKey_GamepadDpadRight;
+ m_keyMap[entry::Key::GamepadShoulderL] = ImGuiKey_GamepadL1;
+ m_keyMap[entry::Key::GamepadShoulderR] = ImGuiKey_GamepadR1;
+ m_keyMap[entry::Key::GamepadThumbL] = ImGuiKey_GamepadL3;
+ m_keyMap[entry::Key::GamepadThumbR] = ImGuiKey_GamepadR3;
#endif // USE_ENTRY
bgfx::RendererType::Enum type = bgfx::getRendererType();
@@ -388,21 +454,23 @@ struct OcornutImguiContext
const double freq = double(bx::getHPFrequency() );
io.DeltaTime = float(frameTime/freq);
- io.MousePos = ImVec2( (float)_mx, (float)_my);
- io.MouseDown[0] = 0 != (_button & IMGUI_MBUT_LEFT);
- io.MouseDown[1] = 0 != (_button & IMGUI_MBUT_RIGHT);
- io.MouseDown[2] = 0 != (_button & IMGUI_MBUT_MIDDLE);
- io.MouseWheel = (float)(_scroll - m_lastScroll);
+ io.AddMousePosEvent( (float)_mx, (float)_my);
+ io.AddMouseButtonEvent(ImGuiMouseButton_Left, 0 != (_button & IMGUI_MBUT_LEFT ) );
+ io.AddMouseButtonEvent(ImGuiMouseButton_Right, 0 != (_button & IMGUI_MBUT_RIGHT ) );
+ io.AddMouseButtonEvent(ImGuiMouseButton_Middle, 0 != (_button & IMGUI_MBUT_MIDDLE) );
+ io.AddMouseWheelEvent(0.0f, (float)(_scroll - m_lastScroll) );
m_lastScroll = _scroll;
#if USE_ENTRY
uint8_t modifiers = inputGetModifiersState();
- io.KeyShift = 0 != (modifiers & (entry::Modifier::LeftShift | entry::Modifier::RightShift) );
- io.KeyCtrl = 0 != (modifiers & (entry::Modifier::LeftCtrl | entry::Modifier::RightCtrl ) );
- io.KeyAlt = 0 != (modifiers & (entry::Modifier::LeftAlt | entry::Modifier::RightAlt ) );
+ io.AddKeyEvent(ImGuiKey_ModShift, 0 != (modifiers & (entry::Modifier::LeftShift | entry::Modifier::RightShift) ) );
+ io.AddKeyEvent(ImGuiKey_ModCtrl, 0 != (modifiers & (entry::Modifier::LeftCtrl | entry::Modifier::RightCtrl ) ) );
+ io.AddKeyEvent(ImGuiKey_ModAlt, 0 != (modifiers & (entry::Modifier::LeftAlt | entry::Modifier::RightAlt ) ) );
+ io.AddKeyEvent(ImGuiKey_ModSuper, 0 != (modifiers & (entry::Modifier::LeftMeta | entry::Modifier::RightMeta ) ) );
for (int32_t ii = 0; ii < (int32_t)entry::Key::Count; ++ii)
{
- io.KeysDown[ii] = inputGetKeyState(entry::Key::Enum(ii) );
+ io.AddKeyEvent(m_keyMap[ii], inputGetKeyState(entry::Key::Enum(ii) ) );
+ io.SetKeyEventNativeData(m_keyMap[ii], 0, 0, ii);
}
#endif // USE_ENTRY
@@ -429,6 +497,9 @@ struct OcornutImguiContext
int64_t m_last;
int32_t m_lastScroll;
bgfx::ViewId m_viewId;
+#if USE_ENTRY
+ ImGuiKey m_keyMap[(int)entry::Key::Count];
+#endif // USE_ENTRY
};
static OcornutImguiContext s_ctx;
diff --git a/3rdparty/bgfx/examples/common/imgui/imgui.h b/3rdparty/bgfx/examples/common/imgui/imgui.h
index c79d39f13d2..98072777530 100644
--- a/3rdparty/bgfx/examples/common/imgui/imgui.h
+++ b/3rdparty/bgfx/examples/common/imgui/imgui.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef IMGUI_H_HEADER_GUARD
@@ -84,12 +84,11 @@ namespace ImGui
, const ImVec2& _size
, const ImVec2& _uv0 = ImVec2(0.0f, 0.0f)
, const ImVec2& _uv1 = ImVec2(1.0f, 1.0f)
- , int _framePadding = -1
, const ImVec4& _bgCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
, const ImVec4& _tintCol = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)
)
{
- return ImageButton(toId(_handle, _flags, _mip), _size, _uv0, _uv1, _framePadding, _bgCol, _tintCol);
+ return ImageButton("image", toId(_handle, _flags, _mip), _size, _uv0, _uv1, _bgCol, _tintCol);
}
// Helper function for passing bgfx::TextureHandle to ImGui::ImageButton.
@@ -97,12 +96,11 @@ namespace ImGui
, const ImVec2& _size
, const ImVec2& _uv0 = ImVec2(0.0f, 0.0f)
, const ImVec2& _uv1 = ImVec2(1.0f, 1.0f)
- , int _framePadding = -1
, const ImVec4& _bgCol = ImVec4(0.0f, 0.0f, 0.0f, 0.0f)
, const ImVec4& _tintCol = ImVec4(1.0f, 1.0f, 1.0f, 1.0f)
)
{
- return ImageButton(_handle, IMGUI_FLAGS_ALPHA_BLEND, 0, _size, _uv0, _uv1, _framePadding, _bgCol, _tintCol);
+ return ImageButton(_handle, IMGUI_FLAGS_ALPHA_BLEND, 0, _size, _uv0, _uv1, _bgCol, _tintCol);
}
///
diff --git a/3rdparty/bgfx/examples/common/imgui/makefile b/3rdparty/bgfx/examples/common/imgui/makefile
index feac23d652b..1979d957d9e 100644
--- a/3rdparty/bgfx/examples/common/imgui/makefile
+++ b/3rdparty/bgfx/examples/common/imgui/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
include ../../../scripts/shader-embeded.mk
diff --git a/3rdparty/bgfx/examples/common/imgui/varying.def.sc b/3rdparty/bgfx/examples/common/imgui/varying.def.sc
index 4bbd2c8d6f7..5f4c47ac243 100644
--- a/3rdparty/bgfx/examples/common/imgui/varying.def.sc
+++ b/3rdparty/bgfx/examples/common/imgui/varying.def.sc
@@ -1,8 +1,6 @@
vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
-vec3 v_normal : NORMAL = vec3(0.0, 0.0, 1.0);
vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0);
vec2 a_position : POSITION;
-vec4 a_normal : NORMAL;
vec4 a_color0 : COLOR0;
vec2 a_texcoord0 : TEXCOORD0;
diff --git a/3rdparty/bgfx/examples/common/imgui/vs_imgui_image.sc b/3rdparty/bgfx/examples/common/imgui/vs_imgui_image.sc
index f1ae37c107d..0c658027ffd 100644
--- a/3rdparty/bgfx/examples/common/imgui/vs_imgui_image.sc
+++ b/3rdparty/bgfx/examples/common/imgui/vs_imgui_image.sc
@@ -3,7 +3,7 @@ $output v_texcoord0
/*
* Copyright 2014 Dario Manesku. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/nanovg/makefile b/3rdparty/bgfx/examples/common/nanovg/makefile
index 88ff40d2821..554063e5829 100644
--- a/3rdparty/bgfx/examples/common/nanovg/makefile
+++ b/3rdparty/bgfx/examples/common/nanovg/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
include ../../../scripts/shader-embeded.mk
diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg.h b/3rdparty/bgfx/examples/common/nanovg/nanovg.h
index a559e8e0837..bf4574b7b52 100644
--- a/3rdparty/bgfx/examples/common/nanovg/nanovg.h
+++ b/3rdparty/bgfx/examples/common/nanovg/nanovg.h
@@ -408,7 +408,7 @@ NVGpaint nvgBoxGradient(NVGcontext* ctx, float x, float y, float w, float h,
NVGpaint nvgRadialGradient(NVGcontext* ctx, float cx, float cy, float inr, float outr,
NVGcolor icol, NVGcolor ocol);
-// Creates and returns an image patter. Parameters (ox,oy) specify the left-top location of the image pattern,
+// Creates and returns an image pattern. Parameters (ox,oy) specify the left-top location of the image pattern,
// (ex,ey) the size of one image, angle rotation around the top-left corner, image is handle to the image to render.
// The gradient is transformed by the current transform when it is passed to nvgFillPaint() or nvgStrokePaint().
NVGpaint nvgImagePattern(NVGcontext* ctx, float ox, float oy, float ex, float ey,
diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
index c938695841f..fccee88db6e 100644
--- a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
+++ b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
//
@@ -762,12 +762,24 @@ namespace
if (gl->ncalls > 0)
{
+ int avail = bgfx::getAvailTransientVertexBuffer(gl->nverts, s_nvgLayout);
+ if (avail < gl->nverts)
+ {
+ gl->nverts = avail;
+ BX_WARN(true, "Vertex number truncated due to transient vertex buffer overflow");
+ if (gl->nverts < 2)
+ {
+ goto _cleanup;
+ }
+ }
+
bgfx::allocTransientVertexBuffer(&gl->tvb, gl->nverts, s_nvgLayout);
int allocated = gl->tvb.size/gl->tvb.stride;
if (allocated < gl->nverts)
{
+ // this branch should never be taken as we've already checked the transient vertex buffer size
gl->nverts = allocated;
BX_WARN(true, "Vertex number truncated due to transient vertex buffer overflow");
}
@@ -805,6 +817,7 @@ namespace
}
}
+_cleanup:
// Reset calls
gl->nverts = 0;
gl->npaths = 0;
diff --git a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.h b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.h
index 945c228569d..ca7a4f20264 100644
--- a/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.h
+++ b/3rdparty/bgfx/examples/common/nanovg/nanovg_bgfx.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef NANOVG_BGFX_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/packrect.h b/3rdparty/bgfx/examples/common/packrect.h
index 26c61011127..bdc4c1f83ba 100644
--- a/3rdparty/bgfx/examples/common/packrect.h
+++ b/3rdparty/bgfx/examples/common/packrect.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef RECTPACK_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/examples/common/ps/fs_particle.sc b/3rdparty/bgfx/examples/common/ps/fs_particle.sc
index a36e3ed3271..f8fc5f27736 100644
--- a/3rdparty/bgfx/examples/common/ps/fs_particle.sc
+++ b/3rdparty/bgfx/examples/common/ps/fs_particle.sc
@@ -1,8 +1,8 @@
$input v_color0, v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/ps/makefile b/3rdparty/bgfx/examples/common/ps/makefile
index 88ff40d2821..554063e5829 100644
--- a/3rdparty/bgfx/examples/common/ps/makefile
+++ b/3rdparty/bgfx/examples/common/ps/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
include ../../../scripts/shader-embeded.mk
diff --git a/3rdparty/bgfx/examples/common/ps/particle_system.cpp b/3rdparty/bgfx/examples/common/ps/particle_system.cpp
index cbcf2b874b0..721779f1123 100644
--- a/3rdparty/bgfx/examples/common/ps/particle_system.cpp
+++ b/3rdparty/bgfx/examples/common/ps/particle_system.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx/bgfx.h>
@@ -190,7 +190,7 @@ namespace ps
m_dt = 0.0f;
m_uniforms.reset();
m_num = 0;
- bx::memSet(&m_aabb, 0, sizeof(Aabb) );
+ bx::memSet(&m_aabb, 0, sizeof(bx::Aabb) );
m_rng.reset();
}
@@ -329,7 +329,7 @@ namespace ps
bx::EaseFn easeBlend = bx::getEaseFunc(m_uniforms.m_easeBlend);
bx::EaseFn easeScale = bx::getEaseFunc(m_uniforms.m_easeScale);
- Aabb aabb =
+ bx::Aabb aabb =
{
{ bx::kInfinity, bx::kInfinity, bx::kInfinity },
{ -bx::kInfinity, -bx::kInfinity, -bx::kInfinity },
@@ -425,7 +425,7 @@ namespace ps
bx::RngMwc m_rng;
EmitterUniforms m_uniforms;
- Aabb m_aabb;
+ bx::Aabb m_aabb;
Particle* m_particles;
uint32_t m_num;
@@ -626,7 +626,7 @@ namespace ps
void updateEmitter(EmitterHandle _handle, const EmitterUniforms* _uniforms)
{
- BX_ASSERT(m_emitterAlloc.isValid(_handle.idx)
+ BX_ASSERT(isValid(_handle)
, "destroyEmitter handle %d is not valid."
, _handle.idx
);
@@ -643,9 +643,9 @@ namespace ps
}
}
- void getAabb(EmitterHandle _handle, Aabb& _outAabb)
+ void getAabb(EmitterHandle _handle, bx::Aabb& _outAabb)
{
- BX_ASSERT(m_emitterAlloc.isValid(_handle.idx)
+ BX_ASSERT(isValid(_handle)
, "getAabb handle %d is not valid."
, _handle.idx
);
@@ -654,7 +654,7 @@ namespace ps
void destroyEmitter(EmitterHandle _handle)
{
- BX_ASSERT(m_emitterAlloc.isValid(_handle.idx)
+ BX_ASSERT(isValid(_handle)
, "destroyEmitter handle %d is not valid."
, _handle.idx
);
@@ -730,7 +730,7 @@ void psUpdateEmitter(EmitterHandle _handle, const EmitterUniforms* _uniforms)
s_ctx.updateEmitter(_handle, _uniforms);
}
-void psGetAabb(EmitterHandle _handle, Aabb& _outAabb)
+void psGetAabb(EmitterHandle _handle, bx::Aabb& _outAabb)
{
s_ctx.getAabb(_handle, _outAabb);
}
diff --git a/3rdparty/bgfx/examples/common/ps/particle_system.h b/3rdparty/bgfx/examples/common/ps/particle_system.h
index 1dc76cd598a..38c124ed975 100644
--- a/3rdparty/bgfx/examples/common/ps/particle_system.h
+++ b/3rdparty/bgfx/examples/common/ps/particle_system.h
@@ -1,17 +1,16 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef PARTICLE_SYSTEM_H_HEADER_GUARD
#define PARTICLE_SYSTEM_H_HEADER_GUARD
#include <bx/allocator.h>
+#include <bx/bounds.h>
#include <bx/easing.h>
#include <bx/rng.h>
-#include "../bounds.h"
-
struct EmitterHandle { uint16_t idx; };
struct EmitterSpriteHandle { uint16_t idx; };
@@ -92,7 +91,7 @@ EmitterHandle psCreateEmitter(EmitterShape::Enum _shape, EmitterDirection::Enum
void psUpdateEmitter(EmitterHandle _handle, const EmitterUniforms* _uniforms = NULL);
///
-void psGetAabb(EmitterHandle _handle, Aabb& _outAabb);
+void psGetAabb(EmitterHandle _handle, bx::Aabb& _outAabb);
///
void psDestroyEmitter(EmitterHandle _handle);
diff --git a/3rdparty/bgfx/examples/common/ps/vs_particle.sc b/3rdparty/bgfx/examples/common/ps/vs_particle.sc
index 07006b89042..446ac1d97b9 100644
--- a/3rdparty/bgfx/examples/common/ps/vs_particle.sc
+++ b/3rdparty/bgfx/examples/common/ps/vs_particle.sc
@@ -2,8 +2,8 @@ $input a_position, a_color0, a_texcoord0
$output v_color0, v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/examples/common/shaderlib.sh b/3rdparty/bgfx/examples/common/shaderlib.sh
index baa5aed9b61..d4953d04403 100644
--- a/3rdparty/bgfx/examples/common/shaderlib.sh
+++ b/3rdparty/bgfx/examples/common/shaderlib.sh
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef __SHADERLIB_SH__
diff --git a/3rdparty/bgfx/examples/makefile b/3rdparty/bgfx/examples/makefile
index 0a88c5e2352..225ee641b31 100644
--- a/3rdparty/bgfx/examples/makefile
+++ b/3rdparty/bgfx/examples/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
all:
@@ -49,6 +49,10 @@ all:
@make -s --no-print-directory build -C 43-denoise
@make -s --no-print-directory build -C 44-sss
@make -s --no-print-directory build -C 45-bokeh
+ @make -s --no-print-directory build -C 46-fsr
+ @make -s --no-print-directory build -C 47-pixelformats
+ @make -s --no-print-directory build -C 48-drawindirect
+ @make -s --no-print-directory build -C 49-hextile
rebuild:
@make -s --no-print-directory rebuild -C 01-cubes
@@ -96,6 +100,10 @@ rebuild:
@make -s --no-print-directory rebuild -C 43-denoise
@make -s --no-print-directory rebuild -C 44-sss
@make -s --no-print-directory rebuild -C 45-bokeh
+ @make -s --no-print-directory rebuild -C 46-fsr
+ @make -s --no-print-directory rebuild -C 47-pixelformats
+ @make -s --no-print-directory rebuild -C 48-drawindirect
+ @make -s --no-print-directory rebuild -C 49-hextile
rebuild-embedded:
@make -s --no-print-directory rebuild -C 02-metaballs
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_drawindirect.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_drawindirect.bin
new file mode 100755
index 00000000000..5df326d7050
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_drawindirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_drawindirect_count.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_drawindirect_count.bin
new file mode 100644
index 00000000000..33deac00875
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_drawindirect_count.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_bilinear_16.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_bilinear_16.bin
new file mode 100644
index 00000000000..b6844ecdfcb
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_bilinear_16.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_bilinear_32.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_bilinear_32.bin
new file mode 100644
index 00000000000..b6844ecdfcb
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_bilinear_32.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_easu_16.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_easu_16.bin
new file mode 100644
index 00000000000..7631fd15125
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_easu_16.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_easu_32.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_easu_32.bin
new file mode 100644
index 00000000000..3a2124a102a
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_easu_32.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_rcas_16.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_rcas_16.bin
new file mode 100644
index 00000000000..bc1eea9158e
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_rcas_16.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_rcas_32.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_rcas_32.bin
new file mode 100644
index 00000000000..46c1ba6ce05
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_fsr_rcas_32.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_copy_z.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_copy_z.bin
index a695a1db19b..a46deb31ce7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_copy_z.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_copy_z.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_downscale_hi_z.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_downscale_hi_z.bin
index a235eb79496..242f5666fe6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_downscale_hi_z.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_downscale_hi_z.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_occlude_props.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_occlude_props.bin
index 148f8d239a6..4573b98ac92 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_occlude_props.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_occlude_props.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_stream_compaction.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_stream_compaction.bin
index 8bc81b79f90..4fa810c525a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_stream_compaction.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/cs_gdr_stream_compaction.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_clear_uav.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_clear_uav.bin
index da6f66ca63e..d2465220fa6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_clear_uav.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_clear_uav.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine.bin
index 35b5a0d7fdc..731d23df3fc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine_ta.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine_ta.bin
new file mode 100644
index 00000000000..e4b07cd2294
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_combine_ta.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug.bin
index 9c86c1dbf12..69ea57862f5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_line.bin
index 470ed651b7d..ad8da66e3c8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_ta.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_ta.bin
new file mode 100644
index 00000000000..5d2dc6f4aaa
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_debug_ta.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_geom.bin
index 9127e9e5105..04270173c45 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light.bin
index a48007d66c8..7548c331102 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light_ta.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light_ta.bin
index 4a30349e38d..1d177b1f1f1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light_ta.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light_ta.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light_uav.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light_uav.bin
index 8d6c44c7321..7459536cbcd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light_uav.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_deferred_light_uav.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_copy_linear_to_gamma.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_copy_linear_to_gamma.bin
new file mode 100644
index 00000000000..025286af41c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_copy_linear_to_gamma.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_forward.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_forward.bin
new file mode 100644
index 00000000000..3112051930b
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_forward.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_forward_grid.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_forward_grid.bin
new file mode 100644
index 00000000000..6e6038619aa
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_fsr_forward_grid.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_gdr_instanced_indirect_rendering.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_gdr_instanced_indirect_rendering.bin
index 578141855af..4496ade1634 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_gdr_instanced_indirect_rendering.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_gdr_instanced_indirect_rendering.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hextile.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hextile.bin
new file mode 100644
index 00000000000..30c4e7f669d
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/fs_hextile.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_combine.bin
index 13b8211d69b..22a962034a6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug.bin
index 13b8211d69b..22a962034a6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug_line.bin
index 5cb0c42fd1c..762007cc965 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_geom.bin
index afddebd6c8e..76e7c73836c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_light.bin
index 13b8211d69b..22a962034a6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_fsr_forward.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_fsr_forward.bin
new file mode 100644
index 00000000000..8433b677c0e
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_fsr_forward.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_fsr_screenquad.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_fsr_screenquad.bin
new file mode 100644
index 00000000000..87db9fceadc
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_fsr_screenquad.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_gdr_instanced_indirect_rendering.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_gdr_instanced_indirect_rendering.bin
index 169b2007460..16630195508 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_gdr_instanced_indirect_rendering.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_gdr_instanced_indirect_rendering.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_gdr_render_occlusion.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_gdr_render_occlusion.bin
index acda188281d..f03f55930f3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_gdr_render_occlusion.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_gdr_render_occlusion.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hextile.bin b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hextile.bin
new file mode 100644
index 00000000000..7702cea0ec3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/dx11/vs_hextile.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/essl/cs_drawindirect.bin b/3rdparty/bgfx/examples/runtime/shaders/essl/cs_drawindirect.bin
new file mode 100755
index 00000000000..42deaaa491f
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/essl/cs_drawindirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/essl/fs_hextile.bin b/3rdparty/bgfx/examples/runtime/shaders/essl/fs_hextile.bin
new file mode 100644
index 00000000000..4ababa30b25
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/essl/fs_hextile.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/essl/vs_hextile.bin b/3rdparty/bgfx/examples/runtime/shaders/essl/vs_hextile.bin
new file mode 100644
index 00000000000..1dbade22d53
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/essl/vs_hextile.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_drawindirect.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_drawindirect.bin
new file mode 100755
index 00000000000..1e6d9975376
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_drawindirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_drawindirect_count.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_drawindirect_count.bin
new file mode 100644
index 00000000000..fcf2a6f477c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_drawindirect_count.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_bilinear_16.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_bilinear_16.bin
new file mode 100644
index 00000000000..0af6dd4ab1c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_bilinear_16.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_bilinear_32.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_bilinear_32.bin
new file mode 100644
index 00000000000..f13f2ded345
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_bilinear_32.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_easu_16.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_easu_16.bin
new file mode 100644
index 00000000000..93aafc0cb91
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_easu_16.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_easu_32.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_easu_32.bin
new file mode 100644
index 00000000000..c4d86bea97c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_easu_32.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_rcas_16.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_rcas_16.bin
new file mode 100644
index 00000000000..20b774bfd81
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_rcas_16.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_rcas_32.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_rcas_32.bin
new file mode 100644
index 00000000000..39c6a60056c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_fsr_rcas_32.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_copy_z.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_copy_z.bin
index 3bce0c7443c..8fd2bbe3c61 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_copy_z.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_copy_z.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_downscale_hi_z.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_downscale_hi_z.bin
index 63515117b66..5ac4393e5a7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_downscale_hi_z.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_downscale_hi_z.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_occlude_props.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_occlude_props.bin
index e9194dbd4a4..70f96403eae 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_occlude_props.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_occlude_props.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_stream_compaction.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_stream_compaction.bin
index 710f9a88d82..883808b1834 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_stream_compaction.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_gdr_stream_compaction.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_init.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_init.bin
index f3455a78dfc..ba428bbc48d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_init.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_init.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_lod.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_lod.bin
index 36091c2e5c6..cdf57fb06cb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_lod.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_lod.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_update_draw.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_update_draw.bin
index 4c98da5a505..4656f601d28 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_update_draw.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_update_draw.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_update_indirect.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_update_indirect.bin
index 72bf2286f83..02b9da15a8c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_update_indirect.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/cs_terrain_update_indirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_clear_uav.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_clear_uav.bin
index 1c7ea5c190d..68d9da319a2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_clear_uav.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_clear_uav.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.bin
index b49c97e1c33..048bb822346 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine_ta.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine_ta.bin
new file mode 100644
index 00000000000..7b191811d5d
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_combine_ta.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug.bin
index 4e7d4bfbb7f..d66b26aed85 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_line.bin
index ee3d27b2276..db3e5077874 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_ta.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_ta.bin
new file mode 100644
index 00000000000..6263077c3ac
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_debug_ta.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_geom.bin
index 3477a5d4220..076c1813e31 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.bin
index c82c79d8336..83a88bdc972 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_ta.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_ta.bin
index f7262e0ed09..c476ee7111c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_ta.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_ta.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_uav.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_uav.bin
index 637b610bf10..6167149f30d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_uav.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_deferred_light_uav.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_copy_linear_to_gamma.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_copy_linear_to_gamma.bin
new file mode 100644
index 00000000000..a924c762d03
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_copy_linear_to_gamma.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_forward.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_forward.bin
new file mode 100644
index 00000000000..1e506c3ad8c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_forward.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_forward_grid.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_forward_grid.bin
new file mode 100644
index 00000000000..e306061d437
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_fsr_forward_grid.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_gdr_instanced_indirect_rendering.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_gdr_instanced_indirect_rendering.bin
index 875a12326d5..499e7578379 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_gdr_instanced_indirect_rendering.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_gdr_instanced_indirect_rendering.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hextile.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hextile.bin
new file mode 100644
index 00000000000..ee1b998d415
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_hextile.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_terrain_render.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_terrain_render.bin
index fcabeb138b2..d3c066a7105 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_terrain_render.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_terrain_render.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_terrain_render_normal.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_terrain_render_normal.bin
index 1d81b9442fb..c267a0f7d12 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_terrain_render_normal.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/fs_terrain_render_normal.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_combine.bin
index c5ec00134c8..75be5b30d32 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug.bin
index c5ec00134c8..75be5b30d32 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug_line.bin
index c18cdcac70f..35e349f2a00 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_geom.bin
index c2b1ba1bd26..7f4c6bfb76d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_light.bin
index c5ec00134c8..75be5b30d32 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_fsr_forward.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_fsr_forward.bin
new file mode 100644
index 00000000000..03cd3f4a8cb
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_fsr_forward.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_fsr_screenquad.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_fsr_screenquad.bin
new file mode 100644
index 00000000000..046aa26aea0
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_fsr_screenquad.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_gdr_instanced_indirect_rendering.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_gdr_instanced_indirect_rendering.bin
index d1133ab0a1e..a0e34057c30 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_gdr_instanced_indirect_rendering.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_gdr_instanced_indirect_rendering.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_gdr_render_occlusion.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_gdr_render_occlusion.bin
index b7ee58ac639..88fdb8c9ddf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_gdr_render_occlusion.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_gdr_render_occlusion.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hextile.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hextile.bin
new file mode 100644
index 00000000000..2144166fe4f
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_hextile.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_terrain_render.bin b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_terrain_render.bin
index 78f961e4d46..099ea940b0a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_terrain_render.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/glsl/vs_terrain_render.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_drawindirect.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_drawindirect.bin
new file mode 100755
index 00000000000..c871d30b2d7
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_drawindirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_drawindirect_count.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_drawindirect_count.bin
new file mode 100644
index 00000000000..32ca0a98820
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_drawindirect_count.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_16.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_16.bin
new file mode 100644
index 00000000000..472fa9e2ca3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_16.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_32.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_32.bin
new file mode 100644
index 00000000000..cd4acba5ca4
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_bilinear_32.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_16.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_16.bin
new file mode 100644
index 00000000000..1c4c1da28e5
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_16.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_32.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_32.bin
new file mode 100644
index 00000000000..acc3bf85cba
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_easu_32.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_16.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_16.bin
new file mode 100644
index 00000000000..d3635feaf95
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_16.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_32.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_32.bin
new file mode 100644
index 00000000000..976d0caaae5
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_fsr_rcas_32.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_copy_z.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_copy_z.bin
index 43bd1789789..bc3ac311792 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_copy_z.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_copy_z.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_downscale_hi_z.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_downscale_hi_z.bin
index f8e33f684ba..2d4a64ff6cd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_downscale_hi_z.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_downscale_hi_z.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_occlude_props.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_occlude_props.bin
index 962dff84c85..ebe79b5b09d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_occlude_props.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_occlude_props.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_stream_compaction.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_stream_compaction.bin
index 558659668bc..e255e899dcd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_stream_compaction.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_gdr_stream_compaction.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_indirect.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_indirect.bin
index e0a9ac8f802..39b31206568 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_indirect.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_indirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_init_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_init_instances.bin
index 862a4bc2480..3b054765f63 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_init_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_init_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_init.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_init.bin
index b24ccaee5a6..2b79451f917 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_init.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_init.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_lod.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_lod.bin
index c88eebbafb0..a9d23c26041 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_lod.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_lod.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_update_draw.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_update_draw.bin
index 49fd7e36bfd..efea6da29e1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_update_draw.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_update_draw.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_update_indirect.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_update_indirect.bin
index 5e199fb5ddb..60ee0f97dfd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_update_indirect.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_terrain_update_indirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_update.bin
index 8199b988c2f..59a57eafed7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_update_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_update_instances.bin
index e758f8db9f5..441f279922b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/cs_update_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/cs_update_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_albedo_output.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_albedo_output.bin
index 51b97bd1266..e902d7b9774 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_albedo_output.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_albedo_output.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bloom_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bloom_combine.bin
index 23cbd415fb6..f12faa8fc33 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bloom_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bloom_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy.bin
index 45a5c98ec5f..9b8d90c0a46 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy_linear_to_gamma.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy_linear_to_gamma.bin
index bf24edf8752..e4d20f97043 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy_linear_to_gamma.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_copy_linear_to_gamma.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_combine.bin
index c82181f98ab..a408380f2f5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_debug.bin
index 589225551a7..ffbc8191c6e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_downsample.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_downsample.bin
index b0276da2fc5..7db48915a03 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_downsample.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_downsample.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_second_pass.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_second_pass.bin
index fa1a187c454..e2a5b4ecb03 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_second_pass.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_second_pass.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_single_pass.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_single_pass.bin
index 87421a24f67..7e845b40efb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_single_pass.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_dof_single_pass.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward.bin
index 67e3f1e101d..e989ae449c8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward_grid.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward_grid.bin
index 47a671d1267..e42ca1c791b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward_grid.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_forward_grid.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_linear_depth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_linear_depth.bin
index 535b4849e30..a1a1fa01226 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_linear_depth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bokeh_linear_depth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bump.bin
index e8a9fddb73c..5a16cdd8a39 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bunnylod.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bunnylod.bin
index eb1f4085408..d3c173ef0d4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bunnylod.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_bunnylod.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_callback.bin
index eb1f4085408..d3c173ef0d4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_cubes.bin
index 02bbc413e0c..3c5b198456e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_clear_uav.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_clear_uav.bin
index 42a4f3440db..ea4fa38563b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_clear_uav.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_clear_uav.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine.bin
index b64bc0c1a89..db8adfc4f8c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine_ta.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine_ta.bin
new file mode 100644
index 00000000000..625f7a773a7
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_combine_ta.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug.bin
index 720ddaf650b..039a60d7a7a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_line.bin
index 02bbc413e0c..3c5b198456e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_ta.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_ta.bin
new file mode 100644
index 00000000000..f5d786e14cc
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_debug_ta.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_geom.bin
index 066b3202ffc..a922dac5adc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light.bin
index da39d5035a8..8c85a648a90 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light_ta.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light_ta.bin
index b86983dacfc..0b84b89d6ff 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light_ta.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light_ta.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light_uav.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light_uav.bin
index 321fff65340..05f6ab1e6e7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light_uav.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_deferred_light_uav.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_apply_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_apply_lighting.bin
index d007881c510..c96d3a1e700 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_apply_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_apply_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_copy.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_copy.bin
index 45a5c98ec5f..9b8d90c0a46 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_copy.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_copy.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_deferred_combine.bin
index ec9a74449bf..c9821e26fde 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_gbuffer.bin
index bc7d7c2d76c..8cb48c1bb8a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_3x3.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_3x3.bin
index ff03bc48fc7..9bebb9ad845 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_3x3.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_3x3.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_5x5.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_5x5.bin
index a97049585a6..8b902685183 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_5x5.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_spatial_5x5.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_temporal.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_temporal.bin
index 1cd17e653a5..49d2736edad 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_temporal.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_temporal.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_txaa.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_txaa.bin
index 49aa21240ef..124374d2630 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_txaa.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_denoise_txaa.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_downsample.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_downsample.bin
index 8f7b798b817..5bdcbc857a7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_downsample.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_downsample.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_copy_linear_to_gamma.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_copy_linear_to_gamma.bin
new file mode 100644
index 00000000000..cea87573397
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_copy_linear_to_gamma.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_forward.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_forward.bin
new file mode 100644
index 00000000000..e989ae449c8
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_forward.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_forward_grid.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_forward_grid.bin
new file mode 100644
index 00000000000..e42ca1c791b
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_fsr_forward_grid.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_gdr_instanced_indirect_rendering.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_gdr_instanced_indirect_rendering.bin
index 5acb0647272..de6b3ea0e74 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_gdr_instanced_indirect_rendering.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_gdr_instanced_indirect_rendering.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_blur.bin
index 55dc9e2bb29..69d3fbf6a14 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_bright.bin
index 79a891cf851..1cd4958cae7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lum.bin
index 7657f045a18..bf6ffbeab3d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lumavg.bin
index f4eea2bb502..ab499f188c7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_mesh.bin
index 764353efccc..cb59715419f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_skybox.bin
index d2390c8cf2b..e4b5ab96c4c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_tonemap.bin
index b52097d0e80..9b6539626ad 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hextile.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hextile.bin
new file mode 100644
index 00000000000..8aca708a9ec
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_hextile.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin
index 7455ee66c05..1c3f2442ae1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin
index 539e1ee87db..9d6ee1ad2e5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_mesh.bin
index c9ffefdf8e5..ddc1c74fd30 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit.bin
index 07c02d889d5..a2770216d7a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin
index 8f0e503f108..2df948cf565 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin
index 85161d6b7cf..be4d580e5d7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin
index 10795125e1f..fe19ccc11c7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin
index d52b1b1a81d..16cfa000952 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_oit_wb_separate_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_particle.bin
index 88e0349494d..de282dc3a58 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_picking_id.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_picking_id.bin
index fb56b0a63eb..baf8d528f74 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_picking_id.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_picking_id.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_picking_shaded.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_picking_shaded.bin
index d1adef9c419..a63a5900039 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_picking_shaded.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_picking_shaded.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_pom.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_pom.bin
index a4155d0fa75..e88822e9fd1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_pom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_pom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_raymarching.bin
index 8dd95198db3..24493299f17 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_combine.bin
index e402dbbf4dc..3c2f162d2a9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_gbuffer.bin
index 985d8fb1c53..a496c772b0a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_lbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_lbuffer.bin
index 8fedc820811..d81099b0eae 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_lbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_lbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_shadow.bin
index 6b9fa586eeb..5cd495188ff 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_rsm_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_screen_space_shadows.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_screen_space_shadows.bin
index 1e50cb8ebc6..22b08628a16 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_screen_space_shadows.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_screen_space_shadows.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_black.bin
index 9e66720e02b..6f4a04c5654 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.bin
index ddb9d119537..39768c3de98 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.bin
index 3eff64f5c2d..12718c07c56 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.bin
index e0d929eabfd..7c0fdb6622e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.bin
index 1e62afab73e..a8998f6257d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.bin
index ee2489f8174..2ba674e7baf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.bin
index 5ff308ab798..60a9997c432 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_esm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.bin
index 71d9736bdd0..bd51c83232e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.bin
index 11cd37e8adc..19c82e96baa 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.bin
index 5d0542a1b1d..a9915e6bc0c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.bin
index cd0054d6397..a5dee4ee1ae 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.bin
index 6b72a474012..94f84bcd36c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.bin
index 29d1785b89d..38d4f13f681 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_hard_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.bin
index 457ae2d5148..adecc61d6b7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.bin
index 53fdeeb019a..6e74001a56c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.bin
index 3bbe6a35dc5..d6f85b93274 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
index 13dd8b42bf7..ed6ce55f27c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
index 457bbf0150d..67d3d6c6b4a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.bin
index 4959f85b642..ed45658541a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_pcf_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.bin
index 53537a0b31e..395727c541f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.bin
index 37a333adc9f..c687f1fde43 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.bin
index 468344e38a3..ac4ae8a771c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
index d32c9966074..e1feaa515bf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
index f22c513ccff..541214e8847 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.bin
index 159f34f7194..58ffb2e7e97 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_lighting_vsm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin
index 97bb1571cd2..8535afb5464 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin
index 12cc81d001e..2df871e798e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin
index 01a7b400b4b..db044bd1950 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_hblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin
index 9249fced84f..a43166ee614 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin
index 1e0a63e12b9..ad36ee45926 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm.bin
index 5bd7e242a4f..faaafd78cf0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm_linear.bin
index 042199e3061..e4ab6de7056 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_packdepth_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.bin
index 720ddaf650b..039a60d7a7a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin
index 4fba6e91a01..acf8e51a832 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin
index 440bfef1a7d..a14b811d02d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_unpackdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin
index 12cc81d001e..2df871e798e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin
index 01a7b400b4b..db044bd1950 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowmaps_vblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_lighting.bin
index cad8d9bfc0f..d03d0e164a7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_texture.bin
index 97bb1571cd2..8535afb5464 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.bin
index 4139adf5dc0..31325ebffe1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackcolor.bin
index 796360452b4..f9cef1dcfd7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbackcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex1.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex1.bin
index f81871f4b22..a223eea71f0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex2.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex2.bin
index 89ad1db217c..f943776bf52 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svbacktex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.bin
index 75ad6e1486f..99a4148c9a3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontcolor.bin
index 796360452b4..f9cef1dcfd7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfrontcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex1.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex1.bin
index b628f2b2b20..4700728a1ea 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex2.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex2.bin
index b7987ecd5a1..c702d2dc1e3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svfronttex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svside.bin
index 4fa50d8a1fd..466c6c75843 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsideblank.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsideblank.bin
index 34c2f38496a..2dae8c4729f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsideblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsideblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidecolor.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidecolor.bin
index b65cb00b06c..739e0adc477 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidecolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidecolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidetex.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidetex.bin
index 21e36e8c2d9..74e302e7833 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidetex.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_svsidetex.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture.bin
index 720ddaf650b..039a60d7a7a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture_lighting.bin
index 5b7ed363aa8..eb7469e0c11 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_shadowvolume_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky.bin
index c0f2ec1d70b..b6c9327a2fb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky_color_banding_fix.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky_color_banding_fix.bin
index 08e09571806..e1486e62145 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky_color_banding_fix.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky_color_banding_fix.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky_landscape.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky_landscape.bin
index 62586968c67..05cdc843c8f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky_landscape.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sky_landscape.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin
index 5eb15856d97..38f098af962 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin
index e2634706397..59813b887e7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_mesh_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.bin
index 9e66720e02b..6f4a04c5654 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin
index eab78ad71ec..f3ff6246c75 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_deferred_combine.bin
index f724fb1261b..822281f62d5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_gbuffer.bin
index 3ebe2a7b389..bcf7fb1ba55 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_linear_depth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_linear_depth.bin
index 62cb443697a..757abadfebf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_linear_depth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_linear_depth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_unlit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_unlit.bin
index 51cac23eb5e..34e421c8b00 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_unlit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_sss_unlit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_black.bin
index 9e66720e02b..6f4a04c5654 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.bin
index 7a9701562b6..6b83db7d26f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_texture.bin
index 97bb1571cd2..8535afb5464 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture.bin
index 720ddaf650b..039a60d7a7a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.bin
index 880efeef09a..b180c3c079f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_stencil_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain.bin
index 6e872a026f2..7092e84b1f6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain_render.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain_render.bin
index dd10a1f07b3..0e112258300 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain_render.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain_render.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain_render_normal.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain_render_normal.bin
index d1f8472bb9d..583499a946c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain_render_normal.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_terrain_render_normal.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.bin
index abf65e52ae3..1472bb8331c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update.bin
index 4dfddfce33a..5b028ca4ee4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin
index d93e64bf4b2..9698ebb9c20 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_3d.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_cmp.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_cmp.bin
index f7d12a93f1c..84e16847bd9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_cmp.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_update_cmp.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_upsample.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_upsample.bin
index 12c26c769f7..ae7df384e86 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_upsample.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_upsample.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blit.bin
index 2ec75786f67..d4fe38d2096 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blur.bin
index e62dddf425d..e89758b77d7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_fb.bin
index a28d9552c2f..3da7455a4b6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vt_mip.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vt_mip.bin
index 09a7707d63d..d42339c5c09 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vt_mip.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vt_mip.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vt_unlit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vt_unlit.bin
index 8e3a3247e56..3d00906f7bf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vt_unlit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_vt_unlit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_mesh.bin
index 3baa3995ec7..27641e60de3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_wireframe.bin
index c80919c81e8..20a83a0e9c3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_wireframe.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/fs_wf_wireframe.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_albedo_output.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_albedo_output.bin
index 7f075201c08..83f7eaf7d96 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_albedo_output.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_albedo_output.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bokeh_forward.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bokeh_forward.bin
index 56b9fe3b3a9..e99b6d1c82b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bokeh_forward.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bokeh_forward.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bokeh_screenquad.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bokeh_screenquad.bin
index c739d7e5915..8cb8483ea2b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bokeh_screenquad.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bokeh_screenquad.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump.bin
index 7db2ab2f9ac..f66bb152eea 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump_instanced.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump_instanced.bin
index b0a9bd6106e..8b7efc2481b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump_instanced.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bump_instanced.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bunnylod.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bunnylod.bin
index 728540954f6..08623032129 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bunnylod.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_bunnylod.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_callback.bin
index fd143ac6a38..26d952d76b1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_cubes.bin
index 6a6b549698c..25ca9acd3bb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_combine.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug_line.bin
index 6a6b549698c..25ca9acd3bb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_geom.bin
index 0ff00304c61..68bf21ec0fa 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_light.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_denoise_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_denoise_gbuffer.bin
index b9149950701..83000ea2e98 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_denoise_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_denoise_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_denoise_screenquad.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_denoise_screenquad.bin
index c739d7e5915..8cb8483ea2b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_denoise_screenquad.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_denoise_screenquad.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_fsr_forward.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_fsr_forward.bin
new file mode 100644
index 00000000000..9d5930e78bd
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_fsr_forward.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_fsr_screenquad.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_fsr_screenquad.bin
new file mode 100644
index 00000000000..8cb8483ea2b
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_fsr_screenquad.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_fullscreen.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_fullscreen.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_fullscreen.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_fullscreen.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_gdr_instanced_indirect_rendering.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_gdr_instanced_indirect_rendering.bin
index 145563def33..1c838c907ab 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_gdr_instanced_indirect_rendering.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_gdr_instanced_indirect_rendering.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_gdr_render_occlusion.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_gdr_render_occlusion.bin
index 12027c383ce..fa720ecc909 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_gdr_render_occlusion.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_gdr_render_occlusion.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_blur.bin
index 2bb17045b44..baf06fa5577 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_bright.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lum.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lumavg.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_mesh.bin
index 418b5578222..f42ce4b416a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_skybox.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_tonemap.bin
index 718f8fc6b42..b94d6dfa492 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hextile.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hextile.bin
new file mode 100644
index 00000000000..a1348181aeb
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_hextile.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.bin
index 17dc61cf6ce..f7a54c3f094 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.bin
index 42e17de0aff..8bafd7acd49 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_mesh.bin
index abef1f51e39..59a2df057e6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit.bin
index cbff38a5d4e..3c21a1c4dd4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit_blit.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_oit_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_particle.bin
index 977364569cd..e6e9d33dd44 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_picking_shaded.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_picking_shaded.bin
index fb14931368c..af7e68ca5d7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_picking_shaded.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_picking_shaded.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_pom.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_pom.bin
index 30a5a846306..aca34b930be 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_pom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_pom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_raymarching.bin
index 909e1df7e5b..60037f46832 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_combine.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_gbuffer.bin
index 30735db16d9..724fefdfc11 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_lbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_lbuffer.bin
index f28b9f73c98..396b069fbc7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_lbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_lbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_shadow.bin
index 100f65ecc27..2141af3660e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_rsm_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color.bin
index a6c23c675ea..2f8e28d7171 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting.bin
index dd4d87a2d5c..d6c04f1715c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_csm.bin
index 70771e9a87b..d2afd4846a5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear.bin
index ded0faf6619..8b8973cc963 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear_csm.bin
index ee551deef28..63714772395 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear_omni.bin
index 85be1054bd7..9741c8e499e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_omni.bin
index 784c5edc16c..0aa5e844ac7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_lighting_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_texture.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_depth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_depth.bin
index a6c23c675ea..2f8e28d7171 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_depth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_depth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_hblur.bin
index c387c873570..51548a15c93 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth.bin
index 9ac528a5ff2..012fce2f008 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.bin
index 6b8b6b2b03b..01d0f5c98f1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture_lighting.bin
index 24d405d9e59..0faa79e4f75 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_unpackdepth.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_vblur.bin
index a6f80a8a4d7..8124dc15999 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_lighting.bin
index 851af6aaec2..8c67f4be4f7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_texture.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svback.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svback.bin
index 703577d0cf5..0a722b9570e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svfront.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svfront.bin
index a6c23c675ea..2f8e28d7171 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svfront.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svfront.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svside.bin
index 34163533974..4de8c6dcab0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture_lighting.bin
index 24d405d9e59..0faa79e4f75 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_shadowvolume_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sky.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sky.bin
index ab521486dff..8c0d0be1be4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sky.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sky.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sky_landscape.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sky_landscape.bin
index ae92f79d6a7..28a54011dc9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sky_landscape.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sky_landscape.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_mesh.bin
index 58bc3a1a846..ba23b791da2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow.bin
index a6c23c675ea..2f8e28d7171 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow_pd.bin
index 9ac528a5ff2..012fce2f008 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sss_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sss_gbuffer.bin
index e4e708a2607..2a683784c16 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sss_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sss_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sss_screenquad.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sss_screenquad.bin
index c739d7e5915..8cb8483ea2b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sss_screenquad.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_sss_screenquad.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color.bin
index a6c23c675ea..2f8e28d7171 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_lighting.bin
index 4e1c9de0780..27bd999fca7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_texture.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture.bin
index a7dbeb38c4d..b1a3b159855 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture_lighting.bin
index 24d405d9e59..0faa79e4f75 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_stencil_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain.bin
index 75a5b1bd473..33415306ca2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_height_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_height_texture.bin
index dcbcbd81b1f..a04bee74102 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_height_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_height_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_render.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_render.bin
index 6443c4bb5f7..ab94c09f435 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_render.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_terrain_render.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_tree.bin
index 41a5bd8edda..ab40b01d945 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_update.bin
index 69ccda058d9..1d46f924186 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_vectordisplay_fb.bin
index 909e1df7e5b..60037f46832 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_vt_generic.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_vt_generic.bin
index 888b5d581d5..be9fa8b7ade 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_vt_generic.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_vt_generic.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_mesh.bin
index f0b06e43ff6..e1284f20983 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_wireframe.bin
index 37be2723731..199b8aa86b2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_wireframe.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/metal/vs_wf_wireframe.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_apply.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_apply.bin
index 05186c04f4b..b6fe1e42212 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_apply.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_apply.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_importance_map.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_importance_map.bin
index 107a1ad83b7..363172c7c06 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_importance_map.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_importance_map.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q0.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q0.bin
index 51744a98d23..0a43948c93c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q0.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q0.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q1.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q1.bin
index 98faeb43475..c9533188c92 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q2.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q2.bin
index 682732539aa..ad633ed753d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3.bin
index c18c256cbcd..280bbc2220b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3base.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3base.bin
index 0af15de573b..0271690db8f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3base.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_generate_q3base.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_load_counter_clear.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_load_counter_clear.bin
index 1ecdb365497..0e4f4c278dc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_load_counter_clear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_load_counter_clear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_apply.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_apply.bin
index 8406a0cc838..bcf4bcc4e8b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_apply.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_apply.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_blur.bin
index 56d83339be7..278c846d280 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_half_apply.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_half_apply.bin
index 9b340c279c9..05d75691d9a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_half_apply.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_non_smart_half_apply.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_a.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_a.bin
index 3606aa0f0e1..27ab1d9e0d7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_a.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_a.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_b.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_b.bin
index f0447f36173..3b662984867 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_b.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_postprocess_importance_map_b.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depth_mip.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depth_mip.bin
index a2a5a46f1df..cee85033184 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depth_mip.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depth_mip.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths.bin
index e4f2199b227..9e068684a88 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals.bin
index a8764726e38..b24c491d9c2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals_half.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals_half.bin
index be6a6e2984e..91df55a4a4c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals_half.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_and_normals_half.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_half.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_half.bin
index e36d89e61f9..86ea34cb422 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_half.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_prepare_depths_half.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur.bin
index c3a3a702f49..a2d785ae90c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur_wide.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur_wide.bin
index 2223551c34f..f0b1e8f6eeb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur_wide.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_assao_smart_blur_wide.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_drawindirect.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_drawindirect.bin
new file mode 100755
index 00000000000..cfec922acfe
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_drawindirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_drawindirect_count.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_drawindirect_count.bin
new file mode 100644
index 00000000000..9b672b584c2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_drawindirect_count.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_16.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_16.bin
new file mode 100644
index 00000000000..8769d916fd3
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_16.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_32.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_32.bin
new file mode 100644
index 00000000000..f342749d506
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_bilinear_32.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_16.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_16.bin
new file mode 100644
index 00000000000..9857ef319b2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_16.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_32.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_32.bin
new file mode 100644
index 00000000000..d7478886c8c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_easu_32.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_16.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_16.bin
new file mode 100644
index 00000000000..7802bec591e
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_16.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_32.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_32.bin
new file mode 100644
index 00000000000..814e45b6b27
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_fsr_rcas_32.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_copy_z.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_copy_z.bin
index 843fb9f8ba2..ba08db54612 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_copy_z.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_copy_z.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_downscale_hi_z.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_downscale_hi_z.bin
index 9f483c8e4a5..46700209058 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_downscale_hi_z.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_downscale_hi_z.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_occlude_props.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_occlude_props.bin
index d1854ff6049..cb2f4c86cc6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_occlude_props.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_occlude_props.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_stream_compaction.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_stream_compaction.bin
index 5b1a057adec..e83539f2482 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_stream_compaction.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_gdr_stream_compaction.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_indirect.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_indirect.bin
index 09257a23fe9..5d7c5143be2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_indirect.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_indirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_init_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_init_instances.bin
index 94a7850a263..d44b5ba9f44 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_init_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_init_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_init.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_init.bin
index d09f238b533..c89104922f3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_init.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_init.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_lod.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_lod.bin
index 613cf076ba8..e5a1773ace1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_lod.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_lod.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_draw.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_draw.bin
index 3291e353b17..3106f019f37 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_draw.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_draw.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_indirect.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_indirect.bin
index 30da76675e7..fb4131aa2f8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_indirect.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_terrain_update_indirect.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_update.bin
index 79c792c22e2..a6619986050 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_update_instances.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_update_instances.bin
index c1a43fa6b50..ff8ac0287f5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_update_instances.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/cs_update_instances.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_albedo_output.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_albedo_output.bin
index f3ace5bdc32..3b94290a91d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_albedo_output.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_albedo_output.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_assao_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_assao_deferred_combine.bin
index 948c0ba66ae..99523a1947c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_assao_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_assao_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_assao_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_assao_gbuffer.bin
index 0fa935d2ac8..565eeec3b14 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_assao_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_assao_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bloom_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bloom_combine.bin
index 45e132b603d..25d3dbb041c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bloom_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bloom_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy.bin
index 8e0fb66dc05..925ddad3ad8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy_linear_to_gamma.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy_linear_to_gamma.bin
index 0e7a35b2270..c1f2bf2f4fd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy_linear_to_gamma.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_copy_linear_to_gamma.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_combine.bin
index 46549c57df7..dfe30963a5e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_debug.bin
index 66b80517729..58f5768f6b8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_downsample.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_downsample.bin
index 98b8adfcf5d..05b1a60d084 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_downsample.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_downsample.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_second_pass.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_second_pass.bin
index 3d8542fb046..c2b6e971b67 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_second_pass.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_second_pass.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_single_pass.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_single_pass.bin
index e3960fa9678..3247acbf31d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_single_pass.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_dof_single_pass.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward.bin
index 369f3d24c56..f89df664ef4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward_grid.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward_grid.bin
index 20275856c72..218ac86a2bf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward_grid.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_forward_grid.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_linear_depth.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_linear_depth.bin
index 6bdc868a947..dcfb81f9bb3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_linear_depth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bokeh_linear_depth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bump.bin
index 79338679a32..3e19a62ef77 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bunnylod.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bunnylod.bin
index 161669f073b..f41369ec80d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bunnylod.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_bunnylod.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_callback.bin
index 161669f073b..f41369ec80d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_cubes.bin
index 1f7118854c8..d863400ac58 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_clear_uav.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_clear_uav.bin
index 7f080dc044f..a38366487d1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_clear_uav.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_clear_uav.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine.bin
index c1ed035aad0..dfee6471572 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine_ta.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine_ta.bin
new file mode 100644
index 00000000000..b288cbe5dc2
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_combine_ta.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug.bin
index 8de184c67b8..49479d627be 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_line.bin
index 1f7118854c8..d863400ac58 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_ta.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_ta.bin
new file mode 100644
index 00000000000..8018c88f83a
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_debug_ta.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_geom.bin
index 3eda63f78d5..34a906112f2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light.bin
index e1661ea4535..2cff13e05e4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_ta.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_ta.bin
index fdbb979a947..c6b2a6943f1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_ta.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_ta.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_uav.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_uav.bin
index 5546fd5fa5b..ee1b8a330f0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_uav.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_deferred_light_uav.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_apply_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_apply_lighting.bin
index aef3cfcde3a..eeabafb0728 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_apply_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_apply_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_copy.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_copy.bin
index 8e0fb66dc05..925ddad3ad8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_copy.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_copy.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_deferred_combine.bin
index fa6ea8b9b33..7c5e8eb95ef 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_gbuffer.bin
index d8ff3db9977..4dc6443302d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_3x3.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_3x3.bin
index 6ab12ddecbf..33d36a3bbd5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_3x3.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_3x3.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_5x5.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_5x5.bin
index ae95970d731..0ae48231b81 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_5x5.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_spatial_5x5.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_temporal.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_temporal.bin
index ebc781c34e5..86837123f45 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_temporal.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_temporal.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_txaa.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_txaa.bin
index 8011ab5cc25..cda8b5cbdfd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_txaa.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_denoise_txaa.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_downsample.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_downsample.bin
index c938b18745c..a5789075402 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_downsample.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_downsample.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_copy_linear_to_gamma.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_copy_linear_to_gamma.bin
new file mode 100644
index 00000000000..f8a0bfa75ff
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_copy_linear_to_gamma.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward.bin
new file mode 100644
index 00000000000..f89df664ef4
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward_grid.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward_grid.bin
new file mode 100644
index 00000000000..218ac86a2bf
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_fsr_forward_grid.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_gdr_instanced_indirect_rendering.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_gdr_instanced_indirect_rendering.bin
index 52678330ec3..37a3ad1bb67 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_gdr_instanced_indirect_rendering.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_gdr_instanced_indirect_rendering.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_blur.bin
index f01d3b57a5c..8726fc35470 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_bright.bin
index c4bfb871fc6..590c90c7bcd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_lum.bin
index 5dc972bdaf3..f95afb3f57f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_lumavg.bin
index 32841175d8c..62706f8258e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_mesh.bin
index 9c0c12f652e..9ce802355e5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_skybox.bin
index cc9f5a31904..a651277dbdf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_tonemap.bin
index 720054072d6..5fe4b247fc9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hextile.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hextile.bin
new file mode 100644
index 00000000000..45e39e53438
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_hextile.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_ibl_mesh.bin
index 59d83f989db..6bee5583ca6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_ibl_skybox.bin
index c311a002fc4..12d383c6b1c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_instancing.bin
index 9811c2d18b0..d863400ac58 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_instancing.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_mesh.bin
index c781bb599db..f58222af5ac 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit.bin
index 1e894f83e13..d65bcb6d747 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb.bin
index aeb4010edcb..fadb68cb65e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_blit.bin
index adc0c028392..0a6158ccba2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate.bin
index b907d57ce12..4ec8c9399f8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate_blit.bin
index a7f7d8ca18d..f02a5c449a6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_oit_wb_separate_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_particle.bin
index 4eaf4052408..fbb067b8ee2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_picking_id.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_picking_id.bin
index 741d6c7ff6c..638bcfebce9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_picking_id.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_picking_id.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_picking_shaded.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_picking_shaded.bin
index 4a947e9dee6..fae9b5a0cb9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_picking_shaded.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_picking_shaded.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_pom.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_pom.bin
index 383be96937f..b900f054e16 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_pom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_pom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_raymarching.bin
index 3952d50db18..14b41e2634b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_combine.bin
index a1e9178da97..0decfa13df7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_gbuffer.bin
index c0d53cb3851..24c4540f5bb 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_lbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_lbuffer.bin
index a62a70fd0f4..1fe52db514d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_lbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_lbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_shadow.bin
index 0bfcd86bd6b..448318292f3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_rsm_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_screen_space_shadows.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_screen_space_shadows.bin
index 4836a5ca911..93d9a7dc6c8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_screen_space_shadows.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_screen_space_shadows.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_black.bin
index 3459d5b207e..070497da1f1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm.bin
index 56cabf0c762..1a51a7c48b0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_csm.bin
index 384f6fe9002..9e11d13ddb5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear.bin
index 0b40a85fd41..9fefc49a590 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_csm.bin
index 85989337ec6..535ebf3210f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_omni.bin
index 1c8c39964e8..0ab0bd89bbe 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_omni.bin
index 1fed636c090..16315782687 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_esm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard.bin
index 6d52ae0fbb7..ee548ee4f34 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_csm.bin
index 96172026c2b..5e955f9811d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear.bin
index 3c7b76508e3..f9018728bca 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_csm.bin
index ddada70e17c..c37c9916226 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_omni.bin
index dfea5362766..0e134c373ec 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_omni.bin
index 2eea1d3cf9c..b63adea48c8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_hard_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf.bin
index 5c8b24457aa..0b0a75b0ab2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_csm.bin
index 02788003e2c..7edd111316d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear.bin
index aff7e1d5606..bb03cf38b3c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
index 972b99b05e1..dd657c868d6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
index 55ea1bb6db7..2fa4e4bc5b1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_omni.bin
index f44719bda7d..a5256e84074 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_pcf_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm.bin
index a5af71626d3..32e360b7902 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_csm.bin
index dafc8b40459..42f08b75a6f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear.bin
index c7c88f54439..50b1348949c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
index 69f54133e06..565ef78ffdc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
index 0329dfeca70..4c73341a7be 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_omni.bin
index 7e72c16baaa..0f04daef0d2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_lighting_vsm_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_texture.bin
index 8b5420b306d..8d6ce8fd053 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur.bin
index 212e4645169..353cec8ed63 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur_vsm.bin
index d5805bb4c2e..d08787b2595 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_hblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth.bin
index 991f74b4a1f..8e00753d7a7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_linear.bin
index 5bc91061ccd..ebf99a0c995 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm.bin
index 9140ddd5462..191ad6952dd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm_linear.bin
index ad4618c9027..5ad5465e3ed 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_packdepth_vsm_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_texture.bin
index 8de184c67b8..49479d627be 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth.bin
index b9f5925b89b..e505288046f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth_vsm.bin
index d23a7e60dab..339f4ae45a2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_unpackdepth_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur.bin
index 212e4645169..353cec8ed63 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur_vsm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur_vsm.bin
index d5805bb4c2e..d08787b2595 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur_vsm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowmaps_vblur_vsm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_lighting.bin
index f4b0a841af3..64fe767c5cd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_texture.bin
index 8b5420b306d..8d6ce8fd053 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackblank.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackblank.bin
index 5a955cb78dd..8b566a8dd8e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackcolor.bin
index 0410d1c0f55..5fb1843c3ee 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbackcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex1.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex1.bin
index 11e1f87584c..86cb8874e11 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex2.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex2.bin
index dce5fdf6b54..45cd4f787d5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svbacktex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontblank.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontblank.bin
index e2394a63bb2..6d3830d3f43 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontcolor.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontcolor.bin
index 0410d1c0f55..5fb1843c3ee 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontcolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfrontcolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex1.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex1.bin
index c3ee513f33e..b07adfca9e5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex1.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex1.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex2.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex2.bin
index 03f4b6f3356..798468ad91e 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex2.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svfronttex2.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svside.bin
index 7da9165f2c5..b0b4d3f7bee 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsideblank.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsideblank.bin
index 8cf503cbca4..7800541319c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsideblank.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsideblank.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidecolor.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidecolor.bin
index 0e78b90227a..557d6602d50 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidecolor.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidecolor.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidetex.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidetex.bin
index 017b8d44fda..b24b7226867 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidetex.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_svsidetex.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture.bin
index 8de184c67b8..49479d627be 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture_lighting.bin
index b12a0aeffb9..a90f552fe40 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_shadowvolume_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky.bin
index c826266b4c8..99ef5c23325 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky_color_banding_fix.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky_color_banding_fix.bin
index b3a168ce7bf..48440d1ae95 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky_color_banding_fix.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky_color_banding_fix.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky_landscape.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky_landscape.bin
index 4c2954cfd22..d9bef5abb59 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky_landscape.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sky_landscape.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh.bin
index 6da7df09e1d..662128b208c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh_pd.bin
index 50312d1566a..4677bff6531 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_mesh_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow.bin
index 1491d0b055e..2b0dc189ce3 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow_pd.bin
index ee7bc348971..74321b99e6d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_deferred_combine.bin
index 336d2c52274..295aa8b3991 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_gbuffer.bin
index ef0f877f396..1114f3eeff8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_linear_depth.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_linear_depth.bin
index 46e74c19b02..a336eccd5ea 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_linear_depth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_linear_depth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_unlit.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_unlit.bin
index ef8dd9c63bc..a80bd52f597 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_unlit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_sss_unlit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_black.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_black.bin
index 3459d5b207e..070497da1f1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_black.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_black.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_lighting.bin
index 9135a6e17db..d56f5a8236c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_texture.bin
index 8b5420b306d..8d6ce8fd053 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture.bin
index 8de184c67b8..49479d627be 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture_lighting.bin
index 5cfb6c7c3d6..e09fe0ff574 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_stencil_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain.bin
index 046f999d0aa..dfd3eb670a2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain_render.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain_render.bin
index bb92fa69c30..6d7c4bf19db 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain_render.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain_render.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain_render_normal.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain_render_normal.bin
index 405dfa6c4d0..ec73b1a2653 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain_render_normal.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_terrain_render_normal.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_tree.bin
index 4a0eae0229d..0b45e637907 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update.bin
index b24a896cba1..1d512777303 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update_3d.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update_3d.bin
index 9a17dfa5de8..8ef332abb94 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update_3d.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update_3d.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update_cmp.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update_cmp.bin
index e4145ac55cb..52418f79296 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update_cmp.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_update_cmp.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_upsample.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_upsample.bin
index ea2e0404cb8..b0e6ffa5ab6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_upsample.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_upsample.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blit.bin
index 69a625e3e97..32c9e1db0e5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blur.bin
index 8b10bd5b6f2..b7bbe828c12 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_fb.bin
index cc5bb7de021..9666230b8da 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vt_mip.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vt_mip.bin
index 69fc5821862..9f1bb9437e8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vt_mip.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vt_mip.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vt_unlit.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vt_unlit.bin
index 6eae70e5be2..bfedf4948b5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vt_unlit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_vt_unlit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_wf_mesh.bin
index d811bebdf73..6ac6f40c177 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_wf_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_wf_wireframe.bin
index 33d9f065119..3ac95e9bd2d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_wf_wireframe.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/fs_wf_wireframe.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_albedo_output.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_albedo_output.bin
index b52693f4fd8..14c8e76d0d0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_albedo_output.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_albedo_output.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_assao.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_assao.bin
index 24c156a595f..d4e0ffc74b1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_assao.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_assao.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_assao_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_assao_gbuffer.bin
index c36f7cb6cdb..9599818569b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_assao_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_assao_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bokeh_forward.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bokeh_forward.bin
index ce50d9f9e17..7863f8a9453 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bokeh_forward.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bokeh_forward.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bokeh_screenquad.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bokeh_screenquad.bin
index da03129e904..435bc278ab9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bokeh_screenquad.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bokeh_screenquad.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bump.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bump.bin
index 04a97187cc8..5ddd164c7b1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bump.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bump.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bump_instanced.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bump_instanced.bin
index 0ddda19f467..55cdbdfe47a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bump_instanced.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bump_instanced.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bunnylod.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bunnylod.bin
index cdf766b5822..af67ce37b26 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bunnylod.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_bunnylod.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_callback.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_callback.bin
index b8764a06c8f..d66216aed1c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_callback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_callback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_cubes.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_cubes.bin
index 08477d220c3..867b9f218cc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_cubes.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_cubes.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_combine.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug_line.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug_line.bin
index 08477d220c3..867b9f218cc 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug_line.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_debug_line.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_geom.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_geom.bin
index a98899afa82..783869003be 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_geom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_geom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_light.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_light.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_light.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_deferred_light.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_denoise_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_denoise_gbuffer.bin
index 436c6db4371..e7456b5acf6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_denoise_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_denoise_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_denoise_screenquad.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_denoise_screenquad.bin
index da03129e904..435bc278ab9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_denoise_screenquad.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_denoise_screenquad.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fsr_forward.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fsr_forward.bin
new file mode 100644
index 00000000000..4b7946f012b
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fsr_forward.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fsr_screenquad.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fsr_screenquad.bin
new file mode 100644
index 00000000000..435bc278ab9
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fsr_screenquad.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fullscreen.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fullscreen.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fullscreen.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_fullscreen.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_gdr_instanced_indirect_rendering.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_gdr_instanced_indirect_rendering.bin
index 25085ac19a4..38e8fc2e670 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_gdr_instanced_indirect_rendering.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_gdr_instanced_indirect_rendering.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_gdr_render_occlusion.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_gdr_render_occlusion.bin
index 9243220d0a5..18f8bbd5fd7 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_gdr_render_occlusion.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_gdr_render_occlusion.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_blur.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_blur.bin
index d360083a910..b99dc7cf1c2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_blur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_blur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_bright.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_bright.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_bright.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_bright.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_lum.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_lum.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_lum.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_lum.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_lumavg.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_lumavg.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_lumavg.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_lumavg.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_mesh.bin
index 28e3b944f71..7bcf673b7a5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_skybox.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_tonemap.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_tonemap.bin
index 0535fb9b580..2d893db1c8a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_tonemap.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hdr_tonemap.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hextile.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hextile.bin
new file mode 100644
index 00000000000..4d092b12040
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_hextile.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_ibl_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_ibl_mesh.bin
index 62e58345786..bfb2aa6b5ef 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_ibl_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_ibl_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_ibl_skybox.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_ibl_skybox.bin
index 38b90e23653..71c331d69b8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_ibl_skybox.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_ibl_skybox.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_instancing.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_instancing.bin
index cd6ae49fee9..7f77bebbeec 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_instancing.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_instancing.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_mesh.bin
index 8ae1b11946a..30c017be16d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_oit.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_oit.bin
index 84abc9783c1..acdd38849f8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_oit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_oit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_oit_blit.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_oit_blit.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_oit_blit.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_oit_blit.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_particle.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_particle.bin
index b299680f825..2094ece50e5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_particle.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_particle.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_picking_shaded.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_picking_shaded.bin
index 1014fbee854..9e01d140d4d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_picking_shaded.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_picking_shaded.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_pom.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_pom.bin
index 186192de227..b22897c2ffd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_pom.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_pom.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_raymarching.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_raymarching.bin
index 17c529acef4..f8976720b7d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_raymarching.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_raymarching.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_combine.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_combine.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_combine.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_combine.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_gbuffer.bin
index ff12cc55fb3..bb6eb79e188 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_lbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_lbuffer.bin
index 43cf0b44b73..6350504fcc9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_lbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_lbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_shadow.bin
index 27bb5602476..3dd392de853 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_rsm_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color.bin
index 5f22417a2f6..804eef5b55b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting.bin
index ff218317bf8..b3a65ed05c2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_csm.bin
index b94d1f5fe68..e91d86bff59 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear.bin
index e392bc00be9..15e26f1fff1 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_csm.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_csm.bin
index e41efefd651..2ff7bab00d2 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_csm.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_csm.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_omni.bin
index 02fd1f36464..80641ff271c 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_linear_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_omni.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_omni.bin
index bbbc4ab2687..f4cdf6d8251 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_omni.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_lighting_omni.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_texture.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_depth.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_depth.bin
index 5f22417a2f6..804eef5b55b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_depth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_depth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_hblur.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_hblur.bin
index 215ad8a8a04..a1ef46a01ba 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_hblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_hblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth.bin
index d7b91b9d0b2..e737c89c5f4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth_linear.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth_linear.bin
index 8b0eeb99531..dc0be9daa92 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth_linear.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_packdepth_linear.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture_lighting.bin
index 0bf9485dba0..4c83efacbd6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_unpackdepth.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_unpackdepth.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_unpackdepth.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_unpackdepth.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_vblur.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_vblur.bin
index 052c9a450ea..3befeee4c4f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_vblur.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowmaps_vblur.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_lighting.bin
index 2874b5a68a3..e5da7554a91 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_texture.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svback.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svback.bin
index d64820a86f8..61d8891229a 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svback.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svback.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svfront.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svfront.bin
index 5f22417a2f6..804eef5b55b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svfront.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svfront.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svside.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svside.bin
index 48efc4c6450..38782c90a78 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svside.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_svside.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture_lighting.bin
index 0bf9485dba0..4c83efacbd6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_shadowvolume_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sky.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sky.bin
index 6401b5428a5..ac7f7350fd6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sky.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sky.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sky_landscape.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sky_landscape.bin
index 0243cdaa345..9c453bd2319 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sky_landscape.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sky_landscape.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_mesh.bin
index 9d0b9f547b1..82fefe7e9db 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow.bin
index 5f22417a2f6..804eef5b55b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow_pd.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow_pd.bin
index d7b91b9d0b2..e737c89c5f4 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow_pd.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sms_shadow_pd.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sss_gbuffer.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sss_gbuffer.bin
index 4fcac55ce6c..54bf6b4a30f 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sss_gbuffer.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sss_gbuffer.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sss_screenquad.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sss_screenquad.bin
index da03129e904..435bc278ab9 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sss_screenquad.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_sss_screenquad.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color.bin
index 5f22417a2f6..804eef5b55b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_lighting.bin
index 37b33848471..3d53a4e91bf 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_texture.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_color_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture.bin
index 37dadca7105..66e24d49803 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture_lighting.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture_lighting.bin
index 0bf9485dba0..4c83efacbd6 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture_lighting.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_stencil_texture_lighting.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain.bin
index 75e5e32dfd1..2748e5749f8 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain_height_texture.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain_height_texture.bin
index 3500dfcd493..240883a1509 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain_height_texture.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain_height_texture.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain_render.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain_render.bin
index 216e2065ba7..2ebc27b6ad0 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain_render.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_terrain_render.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_tree.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_tree.bin
index 3ff06fff452..65d983a1473 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_tree.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_tree.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_update.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_update.bin
index b6920e5e030..17fbd59aebd 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_update.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_update.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_vectordisplay_fb.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_vectordisplay_fb.bin
index 17c529acef4..f8976720b7d 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_vectordisplay_fb.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_vectordisplay_fb.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_vt_generic.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_vt_generic.bin
index aa0770cd996..28cafdcd1a5 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_vt_generic.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_vt_generic.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_wf_mesh.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_wf_mesh.bin
index dd094ad9306..7e2b2a9e9aa 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_wf_mesh.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_wf_mesh.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_wf_wireframe.bin b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_wf_wireframe.bin
index 35a966fc11c..20f73ad3d1b 100644
--- a/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_wf_wireframe.bin
+++ b/3rdparty/bgfx/examples/runtime/shaders/spirv/vs_wf_wireframe.bin
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/aerial_rocks_04_diff_2k.ktx b/3rdparty/bgfx/examples/runtime/textures/aerial_rocks_04_diff_2k.ktx
new file mode 100644
index 00000000000..9d2a7dbf30e
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/aerial_rocks_04_diff_2k.ktx
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/pf_alpha_test.dds b/3rdparty/bgfx/examples/runtime/textures/pf_alpha_test.dds
new file mode 100644
index 00000000000..32042d4c38d
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/pf_alpha_test.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/pf_uv_filtering_test.dds b/3rdparty/bgfx/examples/runtime/textures/pf_uv_filtering_test.dds
new file mode 100644
index 00000000000..1326f4fccbf
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/pf_uv_filtering_test.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x10.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x10.dds
new file mode 100644
index 00000000000..8ac934e5e93
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x10.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x5.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x5.dds
index 5d839395484..b392a0b3156 100644
--- a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x5.dds
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x5.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x6.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x6.dds
new file mode 100644
index 00000000000..92edd56d6cf
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x6.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x8.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x8.dds
new file mode 100644
index 00000000000..9eb093ae35f
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_10x8.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_12x10.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_12x10.dds
new file mode 100644
index 00000000000..23a6470853c
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_12x10.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_12x12.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_12x12.dds
new file mode 100644
index 00000000000..9c75905e563
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_12x12.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_4x4.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_4x4.dds
index ada6b45d92f..60d17bde3d9 100644
--- a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_4x4.dds
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_4x4.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_5x4.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_5x4.dds
new file mode 100644
index 00000000000..e47f966cf40
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_5x4.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_5x5.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_5x5.dds
index bfce304225c..1a7619030be 100644
--- a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_5x5.dds
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_5x5.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_6x5.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_6x5.dds
new file mode 100644
index 00000000000..0b716ab819b
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_6x5.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_6x6.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_6x6.dds
index a1215b7f95d..d4d829e44ec 100644
--- a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_6x6.dds
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_6x6.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x5.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x5.dds
index 55d1754fb93..e1a0dc6fd90 100644
--- a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x5.dds
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x5.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x6.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x6.dds
index e205b999ce5..24a66a6fef6 100644
--- a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x6.dds
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x6.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x8.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x8.dds
new file mode 100644
index 00000000000..d5bad8c423b
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_astc_8x8.dds
Binary files differ
diff --git a/3rdparty/bgfx/examples/runtime/textures/texture_compression_rgba8.dds b/3rdparty/bgfx/examples/runtime/textures/texture_compression_rgba8.dds
new file mode 100644
index 00000000000..0e2b3b2cd3a
--- /dev/null
+++ b/3rdparty/bgfx/examples/runtime/textures/texture_compression_rgba8.dds
Binary files differ
diff --git a/3rdparty/bgfx/include/bgfx/bgfx.h b/3rdparty/bgfx/include/bgfx/bgfx.h
index f1db8ba4ae6..844337d8f77 100644
--- a/3rdparty/bgfx/include/bgfx/bgfx.h
+++ b/3rdparty/bgfx/include/bgfx/bgfx.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
@@ -26,7 +26,7 @@ namespace bgfx
{
/// Fatal error enum.
///
- /// @attention C99 equivalent is `bgfx_fatal_t`.
+ /// @attention C99's equivalent binding is `bgfx_fatal_t`.
///
struct Fatal
{
@@ -44,7 +44,7 @@ namespace bgfx
/// Renderer backend type enum.
///
- /// @attention C99 equivalent is `bgfx_renderer_type_t`.
+ /// @attention C99's equivalent binding is `bgfx_renderer_type_t`.
///
struct RendererType
{
@@ -70,7 +70,7 @@ namespace bgfx
/// Access mode enum.
///
- /// @attention C99 equivalent is `bgfx_access_t`.
+ /// @attention C99's equivalent binding is `bgfx_access_t`.
///
struct Access
{
@@ -87,7 +87,7 @@ namespace bgfx
/// Vertex attribute enum.
///
- /// @attention C99 equivalent is `bgfx_attrib_t`.
+ /// @attention C99's equivalent binding is `bgfx_attrib_t`.
///
struct Attrib
{
@@ -119,7 +119,7 @@ namespace bgfx
/// Vertex attribute type enum.
///
- /// @attention C99 equivalent is `bgfx_attrib_type_t`.
+ /// @attention C99's equivalent binding is `bgfx_attrib_type_t`.
///
struct AttribType
{
@@ -152,7 +152,7 @@ namespace bgfx
///
/// @attention Availability depends on Caps (see: formats).
///
- /// @attention C99 equivalent is `bgfx_texture_format_t`.
+ /// @attention C99's equivalent binding is `bgfx_texture_format_t`.
///
struct TextureFormat
{
@@ -180,11 +180,19 @@ namespace bgfx
ATCE, //!< ATCE RGBA 8 BPP explicit alpha
ATCI, //!< ATCI RGBA 8 BPP interpolated alpha
ASTC4x4, //!< ASTC 4x4 8.0 BPP
+ ASTC5x4, //!< ASTC 5x4 6.40 BPP
ASTC5x5, //!< ASTC 5x5 5.12 BPP
+ ASTC6x5, //!< ASTC 6x5 4.27 BPP
ASTC6x6, //!< ASTC 6x6 3.56 BPP
ASTC8x5, //!< ASTC 8x5 3.20 BPP
ASTC8x6, //!< ASTC 8x6 2.67 BPP
+ ASTC8x8, //!< ASTC 8x8 2.00 BPP
ASTC10x5, //!< ASTC 10x5 2.56 BPP
+ ASTC10x6, //!< ASTC 10x6 2.13 BPP
+ ASTC10x8, //!< ASTC 10x8 1.60 BPP
+ ASTC10x10, //!< ASTC 10x10 1.28 BPP
+ ASTC12x10, //!< ASTC 12x10 1.07 BPP
+ ASTC12x12, //!< ASTC 12x12 0.89 BPP
Unknown, // Compressed formats above.
@@ -232,8 +240,11 @@ namespace bgfx
RGBA32I,
RGBA32U,
RGBA32F,
+ B5G6R5,
R5G6B5,
+ BGRA4,
RGBA4,
+ BGR5A1,
RGB5A1,
RGB10A2,
RG11B10F,
@@ -255,7 +266,7 @@ namespace bgfx
/// Uniform type enum.
///
- /// @attention C99 equivalent is `bgfx_uniform_type_t`.
+ /// @attention C99's equivalent binding is `bgfx_uniform_type_t`.
///
struct UniformType
{
@@ -275,7 +286,7 @@ namespace bgfx
/// Backbuffer ratio enum.
///
- /// @attention C99 equivalent is `bgfx_backbuffer_ratio_t`.
+ /// @attention C99's equivalent binding is `bgfx_backbuffer_ratio_t`.
///
struct BackbufferRatio
{
@@ -295,7 +306,7 @@ namespace bgfx
/// Occlusion query result.
///
- /// @attention C99 equivalent is `bgfx_occlusion_query_result_t`.
+ /// @attention C99's equivalent binding is `bgfx_occlusion_query_result_t`.
///
struct OcclusionQueryResult
{
@@ -312,7 +323,7 @@ namespace bgfx
/// Primitive topology.
///
- /// @attention C99 equivalent is `bgfx_topology_t`.
+ /// @attention C99's equivalent binding is `bgfx_topology_t`.
///
struct Topology
{
@@ -331,7 +342,7 @@ namespace bgfx
/// Topology conversion function.
///
- /// @attention C99 equivalent is `bgfx_topology_convert_t`.
+ /// @attention C99's equivalent binding is `bgfx_topology_convert_t`.
///
struct TopologyConvert
{
@@ -350,7 +361,7 @@ namespace bgfx
/// Topology sort order.
///
- /// @attention C99 equivalent is `bgfx_topology_sort_t`.
+ /// @attention C99's equivalent binding is `bgfx_topology_sort_t`.
///
struct TopologySort
{
@@ -376,7 +387,7 @@ namespace bgfx
/// View mode sets draw call sort order.
///
- /// @attention C99 equivalent is `bgfx_view_mode_t`.
+ /// @attention C99's equivalent binding is `bgfx_view_mode_t`.
///
struct ViewMode
{
@@ -415,14 +426,14 @@ namespace bgfx
/// 'fatal' and 'trace' callbacks can be called from any thread. Other
/// callbacks are called from the render thread.
///
- /// @attention C99 equivalent is `bgfx_callback_interface_t`.
+ /// @attention C99's equivalent binding is `bgfx_callback_interface_t`.
///
struct CallbackI
{
virtual ~CallbackI() = 0;
/// This callback is called on unrecoverable errors.
- /// It's not safe to continue (Exluding _code `Fatal::DebugCheck`),
+ /// It's not safe to continue (Excluding _code `Fatal::DebugCheck`),
/// inform the user and terminate the application.
///
/// @param[in] _filePath File path where fatal message was generated.
@@ -433,7 +444,7 @@ namespace bgfx
/// @remarks
/// Not thread safe and it can be called from any thread.
///
- /// @attention C99 equivalent is `bgfx_callback_vtbl.fatal`.
+ /// @attention C99's equivalent binding is `bgfx_callback_vtbl.fatal`.
///
virtual void fatal(
const char* _filePath
@@ -453,7 +464,7 @@ namespace bgfx
/// @remarks
/// Not thread safe and it can be called from any thread.
///
- /// @attention C99 equivalent is `bgfx_callback_vtbl.trace_vargs`.
+ /// @attention C99's equivalent binding is `bgfx_callback_vtbl.trace_vargs`.
///
virtual void traceVargs(
const char* _filePath
@@ -472,7 +483,7 @@ namespace bgfx
/// @remarks
/// Not thread safe and it can be called from any thread.
///
- /// @attention C99 equivalent is `bgfx_callback_vtbl.profiler_begin`.
+ /// @attention C99's equivalent binding is `bgfx_callback_vtbl.profiler_begin`.
///
virtual void profilerBegin(
const char* _name
@@ -491,7 +502,7 @@ namespace bgfx
/// @remarks
/// Not thread safe and it can be called from any thread.
///
- /// @attention C99 equivalent is `bgfx_callback_vtbl.profiler_begin_literal`.
+ /// @attention C99's equivalent binding is `bgfx_callback_vtbl.profiler_begin_literal`.
///
virtual void profilerBeginLiteral(
const char* _name
@@ -505,7 +516,7 @@ namespace bgfx
/// @remarks
/// Not thread safe and it can be called from any thread.
///
- /// @attention C99 equivalent is `bgfx_callback_vtbl.profiler_end`.
+ /// @attention C99's equivalent binding is `bgfx_callback_vtbl.profiler_end`.
///
virtual void profilerEnd() = 0;
@@ -515,7 +526,7 @@ namespace bgfx
/// @param[in] _id Cache id.
/// @returns Number of bytes to read.
///
- /// @attention C99 equivalent is `bgfx_callback_vtbl.cache_read_size`.
+ /// @attention C99's equivalent binding is `bgfx_callback_vtbl.cache_read_size`.
///
virtual uint32_t cacheReadSize(uint64_t _id) = 0;
@@ -527,7 +538,7 @@ namespace bgfx
///
/// @returns True if data is read.
///
- /// @attention C99 equivalent is `bgfx_callback_vtbl.cache_read`.
+ /// @attention C99's equivalent binding is `bgfx_callback_vtbl.cache_read`.
///
virtual bool cacheRead(uint64_t _id, void* _data, uint32_t _size) = 0;
@@ -537,7 +548,7 @@ namespace bgfx
/// @param[in] _data Data to write.
/// @param[in] _size Size of data to write.
///
- /// @attention C99 equivalent is `bgfx_callback_vtbl.cache_write`.
+ /// @attention C99's equivalent binding is `bgfx_callback_vtbl.cache_write`.
///
virtual void cacheWrite(uint64_t _id, const void* _data, uint32_t _size) = 0;
@@ -552,7 +563,7 @@ namespace bgfx
/// @param[in] _size Image size.
/// @param[in] _yflip If true, image origin is bottom left.
///
- /// @attention C99 equivalent is `bgfx_callback_vtbl.screen_shot`.
+ /// @attention C99's equivalent binding is `bgfx_callback_vtbl.screen_shot`.
///
virtual void screenShot(
const char* _filePath
@@ -573,7 +584,7 @@ namespace bgfx
/// @param[in] _format Texture format. See: `TextureFormat::Enum`.
/// @param[in] _yflip If true, image origin is bottom left.
///
- /// @attention C99 equivalent is `bgfx_callback_vtbl.capture_begin`.
+ /// @attention C99's equivalent binding is `bgfx_callback_vtbl.capture_begin`.
///
virtual void captureBegin(
uint32_t _width
@@ -585,7 +596,7 @@ namespace bgfx
/// Called when a video capture ends.
///
- /// @attention C99 equivalent is `bgfx_callback_vtbl.capture_end`.
+ /// @attention C99's equivalent binding is `bgfx_callback_vtbl.capture_end`.
///
virtual void captureEnd() = 0;
@@ -594,7 +605,7 @@ namespace bgfx
/// @param[in] _data Image data.
/// @param[in] _size Image size.
///
- /// @attention C99 equivalent is `bgfx_callback_vtbl.capture_frame`.
+ /// @attention C99's equivalent binding is `bgfx_callback_vtbl.capture_frame`.
///
virtual void captureFrame(const void* _data, uint32_t _size) = 0;
};
@@ -605,25 +616,26 @@ namespace bgfx
/// Platform data.
///
- /// @attention C99 equivalent is `bgfx_platform_data_t`.
+ /// @attention C99's equivalent binding is `bgfx_platform_data_t`.
///
struct PlatformData
{
PlatformData();
void* ndt; //!< Native display type (*nix specific).
- void* nwh; //!< Native window handle. If `NULL` bgfx will create headless
- /// context/device if renderer API supports it.
- void* context; //!< GL context, or D3D device. If `NULL`, bgfx will create context/device.
+ void* nwh; //!< Native window handle. If `NULL`, bgfx will create a headless
+ /// context/device, provided the rendering API supports it.
+ void* context; //!< GL context, D3D device, or Vulkan device. If `NULL`, bgfx
+ /// will create context/device.
void* backBuffer; //!< GL back-buffer, or D3D render target view. If `NULL` bgfx will
/// create back-buffer color surface.
- void* backBufferDS; //!< Backbuffer depth/stencil. If `NULL` bgfx will create back-buffer
+ void* backBufferDS; //!< Backbuffer depth/stencil. If `NULL`, bgfx will create a back-buffer
/// depth/stencil surface.
};
/// Backbuffer resolution and reset parameters.
///
- /// @attention C99 equivalent is `bgfx_resolution_t`.
+ /// @attention C99's equivalent binding is `bgfx_resolution_t`.
///
struct Resolution
{
@@ -632,14 +644,14 @@ namespace bgfx
TextureFormat::Enum format; //!< Backbuffer format.
uint32_t width; //!< Backbuffer width.
uint32_t height; //!< Backbuffer height.
- uint32_t reset; //!< Reset parameters.
+ uint32_t reset; //!< Reset parameters.
uint8_t numBackBuffers; //!< Number of back buffers.
uint8_t maxFrameLatency; //!< Maximum frame latency.
};
/// Initialization parameters used by `bgfx::init`.
///
- /// @attention C99 equivalent is `bgfx_init_t`.
+ /// @attention C99's equivalent binding is `bgfx_init_t`.
///
struct Init
{
@@ -650,22 +662,24 @@ namespace bgfx
/// See: `bgfx::RendererType`
RendererType::Enum type;
- /// Vendor PCI id. If set to `BGFX_PCI_ID_NONE` it will select the first
- /// device.
- /// - `BGFX_PCI_ID_NONE` - Autoselect adapter.
+ /// Vendor PCI ID. If set to `BGFX_PCI_ID_NONE`, discrete and integrated
+ /// GPUs will be prioritised.
+ /// - `BGFX_PCI_ID_NONE` - Auto-select adapter.
/// - `BGFX_PCI_ID_SOFTWARE_RASTERIZER` - Software rasterizer.
/// - `BGFX_PCI_ID_AMD` - AMD adapter.
+ /// - `BGFX_PCI_ID_APPLE` - Apple adapter.
/// - `BGFX_PCI_ID_INTEL` - Intel adapter.
- /// - `BGFX_PCI_ID_NVIDIA` - nVidia adapter.
+ /// - `BGFX_PCI_ID_NVIDIA` - NVIDIA adapter.
+ /// - `BGFX_PCI_ID_MICROSOFT` - Microsoft adapter.
uint16_t vendorId;
- /// Device id. If set to 0 it will select first device, or device with
- /// matching id.
+ /// Device ID. If set to 0 it will select first device, or device with
+ /// matching ID.
uint16_t deviceId;
uint64_t capabilities; //!< Capabilities initialization mask (default: UINT64_MAX).
- bool debug; //!< Enable device for debuging.
+ bool debug; //!< Enable device for debugging.
bool profile; //!< Enable device for profiling.
/// Platform data.
@@ -676,7 +690,7 @@ namespace bgfx
/// Configurable runtime limits parameters.
///
- /// @attention C99 equivalent is `bgfx_init_limits_t`.
+ /// @attention C99's equivalent binding is `bgfx_init_limits_t`.
///
struct Limits
{
@@ -705,7 +719,7 @@ namespace bgfx
/// param[in] _ptr Pointer to allocated data.
/// param[in] _userData User defined data if needed.
///
- /// @attention C99 equivalent is `bgfx_release_fn_t`.
+ /// @attention C99's equivalent binding is `bgfx_release_fn_t`.
///
typedef void (*ReleaseFn)(void* _ptr, void* _userData);
@@ -713,7 +727,7 @@ namespace bgfx
///
/// @attention It is illegal to create this structure on stack and pass it to any bgfx API.
///
- /// @attention C99 equivalent is `bgfx_memory_t`.
+ /// @attention C99's equivalent binding is `bgfx_memory_t`.
///
struct Memory
{
@@ -725,7 +739,7 @@ namespace bgfx
/// Renderer capabilities.
///
- /// @attention C99 equivalent is `bgfx_caps_t`.
+ /// @attention C99's equivalent binding is `bgfx_caps_t`.
///
struct Caps
{
@@ -746,7 +760,7 @@ namespace bgfx
/// GPU info.
///
- /// @attention C99 equivalent is `bgfx_caps_gpu_t`.
+ /// @attention C99's equivalent binding is `bgfx_caps_gpu_t`.
///
struct GPU
{
@@ -758,7 +772,7 @@ namespace bgfx
/// Renderer runtime limits.
///
- /// @attention C99 equivalent is `bgfx_caps_limits_t`.
+ /// @attention C99's equivalent binding is `bgfx_caps_limits_t`.
///
struct Limits
{
@@ -818,7 +832,7 @@ namespace bgfx
/// Transient index buffer.
///
- /// @attention C99 equivalent is `bgfx_transient_index_buffer_t`.
+ /// @attention C99's equivalent binding is `bgfx_transient_index_buffer_t`.
///
struct TransientIndexBuffer
{
@@ -831,7 +845,7 @@ namespace bgfx
/// Transient vertex buffer.
///
- /// @attention C99 equivalent is `bgfx_transient_vertex_buffer_t`.
+ /// @attention C99's equivalent binding is `bgfx_transient_vertex_buffer_t`.
///
struct TransientVertexBuffer
{
@@ -845,7 +859,7 @@ namespace bgfx
/// Instance data buffer info.
///
- /// @attention C99 equivalent is `bgfx_instance_data_buffer_t`.
+ /// @attention C99's equivalent binding is `bgfx_instance_data_buffer_t`.
///
struct InstanceDataBuffer
{
@@ -859,7 +873,7 @@ namespace bgfx
/// Texture info.
///
- /// @attention C99 equivalent is `bgfx_texture_info_t`.
+ /// @attention C99's equivalent binding is `bgfx_texture_info_t`.
///
struct TextureInfo
{
@@ -876,7 +890,7 @@ namespace bgfx
/// Uniform info.
///
- /// @attention C99 equivalent is `bgfx_uniform_info_t`.
+ /// @attention C99's equivalent binding is `bgfx_uniform_info_t`.
///
struct UniformInfo
{
@@ -887,7 +901,7 @@ namespace bgfx
/// Frame buffer texture attachment info.
///
- /// @attention C99 equivalent is `bgfx_attachment_t`.
+ /// @attention C99's equivalent binding is `bgfx_attachment_t`.
///
struct Attachment
{
@@ -919,7 +933,7 @@ namespace bgfx
/// Transform data.
///
- /// @attention C99 equivalent is `bgfx_transform_t`.
+ /// @attention C99's equivalent binding is `bgfx_transform_t`.
///
struct Transform
{
@@ -932,21 +946,22 @@ namespace bgfx
/// View stats.
///
- /// @attention C99 equivalent is `bgfx_view_stats_t`.
+ /// @attention C99's equivalent binding is `bgfx_view_stats_t`.
///
struct ViewStats
{
- char name[256]; //!< View name.
- ViewId view; //!< View id.
- int64_t cpuTimeBegin; //!< CPU (submit) begin time.
- int64_t cpuTimeEnd; //!< CPU (submit) end time.
- int64_t gpuTimeBegin; //!< GPU begin time.
- int64_t gpuTimeEnd; //!< GPU end time.
+ char name[256]; //!< View name.
+ ViewId view; //!< View id.
+ int64_t cpuTimeBegin; //!< CPU (submit) begin time.
+ int64_t cpuTimeEnd; //!< CPU (submit) end time.
+ int64_t gpuTimeBegin; //!< GPU begin time.
+ int64_t gpuTimeEnd; //!< GPU end time.
+ uint32_t gpuFrameNum; //!< Frame which generated gpuTimeBegin, gpuTimeEnd.
};
/// Encoder stats.
///
- /// @attention C99 equivalent is `bgfx_encoder_stats_t`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_stats_t`.
///
struct EncoderStats
{
@@ -956,7 +971,7 @@ namespace bgfx
/// Renderer statistics data.
///
- /// @attention C99 equivalent is `bgfx_stats_t`.
+ /// @attention C99's equivalent binding is `bgfx_stats_t`.
///
/// @remarks All time values are high-resolution timestamps, while
/// time frequencies define timestamps-per-second for that hardware.
@@ -979,6 +994,7 @@ namespace bgfx
uint32_t numCompute; //!< Number of compute calls submitted.
uint32_t numBlit; //!< Number of blit calls submitted.
uint32_t maxGpuLatency; //!< GPU driver latency.
+ uint32_t gpuFrameNum; //<! Frame which generated gpuTimeBegin, gpuTimeEnd.
uint16_t numDynamicIndexBuffers; //!< Number of used dynamic index buffers.
uint16_t numDynamicVertexBuffers; //!< Number of used dynamic vertex buffers.
@@ -1017,7 +1033,7 @@ namespace bgfx
/// Encoders are used for submitting draw calls from multiple threads. Only one encoder
/// per thread should be used. Use `bgfx::begin()` to obtain an encoder for a thread.
///
- /// @attention C99 equivalent is `bgfx_encoder`.
+ /// @attention C99's equivalent binding is `bgfx_encoder`.
///
struct Encoder
{
@@ -1025,7 +1041,7 @@ namespace bgfx
/// graphics calls together for easy browsing in
/// graphics debugging tools.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_marker`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_marker`.
///
void setMarker(const char* _marker);
@@ -1045,7 +1061,7 @@ namespace bgfx
/// `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
///
/// @remarks
- /// 1. To setup more complex states use:
+ /// 1. To set up more complex states use:
/// `BGFX_STATE_ALPHA_REF(_ref)`,
/// `BGFX_STATE_POINT_SIZE(_size)`,
/// `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -1055,7 +1071,7 @@ namespace bgfx
/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
/// equation is specified.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_state`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_state`.
///
void setState(
uint64_t _state
@@ -1067,7 +1083,7 @@ namespace bgfx
/// @param[in] _handle Occlusion query handle.
/// @param[in] _visible Render if occlusion query is visible.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_condition`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_condition`.
///
void setCondition(
OcclusionQueryHandle _handle
@@ -1080,7 +1096,7 @@ namespace bgfx
/// @param[in] _bstencil Back stencil state. If back is set to `BGFX_STENCIL_NONE`
/// _fstencil is applied to both front and back facing primitives.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_stencil`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_stencil`.
///
void setStencil(
uint32_t _fstencil
@@ -1096,7 +1112,7 @@ namespace bgfx
/// @param[in] _height Height of scissor region.
/// @returns Scissor cache index.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_scissor`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_scissor`.
///
uint16_t setScissor(
uint16_t _x
@@ -1110,7 +1126,7 @@ namespace bgfx
/// @param[in] _cache Index in scissor cache.
/// Pass UINT16_MAX to have primitive use view scissor instead.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_scissor_cached`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_scissor_cached`.
///
void setScissor(uint16_t _cache = UINT16_MAX);
@@ -1122,7 +1138,7 @@ namespace bgfx
/// @returns Index into matrix cache in case the same model matrix has
/// to be used for other draw primitive call.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_transform`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_transform`.
///
uint32_t setTransform(
const void* _mtx
@@ -1135,8 +1151,8 @@ namespace bgfx
/// @param[in] _num Number of matrices.
/// @returns Index into matrix cache.
///
- /// @attention Pointer returned can be modifed until `bgfx::frame` is called.
- /// @attention C99 equivalent is `bgfx_encoder_alloc_transform`.
+ /// @attention Pointer returned can be modified until `bgfx::frame` is called.
+ /// @attention C99's equivalent binding is `bgfx_encoder_alloc_transform`.
///
uint32_t allocTransform(
Transform* _transform
@@ -1148,7 +1164,7 @@ namespace bgfx
/// @param[in] _cache Index in matrix cache.
/// @param[in] _num Number of matrices from cache.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_transform_cached`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_transform_cached`.
///
void setTransform(
uint32_t _cache
@@ -1162,7 +1178,7 @@ namespace bgfx
/// @param[in] _num Number of elements. Passing `UINT16_MAX` will
/// use the _num passed on uniform creation.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_uniform`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_uniform`.
///
void setUniform(
UniformHandle _handle
@@ -1174,7 +1190,7 @@ namespace bgfx
///
/// @param[in] _handle Index buffer.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_index_buffer`.
///
void setIndexBuffer(IndexBufferHandle _handle);
@@ -1184,7 +1200,7 @@ namespace bgfx
/// @param[in] _firstIndex First index to render.
/// @param[in] _numIndices Number of indices to render.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_index_buffer`.
///
void setIndexBuffer(
IndexBufferHandle _handle
@@ -1196,7 +1212,7 @@ namespace bgfx
///
/// @param[in] _handle Dynamic index buffer.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_dynamic_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_dynamic_index_buffer`.
///
void setIndexBuffer(DynamicIndexBufferHandle _handle);
@@ -1206,7 +1222,7 @@ namespace bgfx
/// @param[in] _firstIndex First index to render.
/// @param[in] _numIndices Number of indices to render.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_dynamic_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_dynamic_index_buffer`.
///
void setIndexBuffer(
DynamicIndexBufferHandle _handle
@@ -1218,7 +1234,7 @@ namespace bgfx
///
/// @param[in] _tib Transient index buffer.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_transient_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_transient_index_buffer`.
///
void setIndexBuffer(const TransientIndexBuffer* _tib);
@@ -1228,7 +1244,7 @@ namespace bgfx
/// @param[in] _firstIndex First index to render.
/// @param[in] _numIndices Number of indices to render.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_transient_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_transient_index_buffer`.
///
void setIndexBuffer(
const TransientIndexBuffer* _tib
@@ -1241,7 +1257,7 @@ namespace bgfx
/// @param[in] _stream Vertex stream.
/// @param[in] _handle Vertex buffer.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_vertex_buffer`.
///
void setVertexBuffer(
uint8_t _stream
@@ -1257,7 +1273,7 @@ namespace bgfx
/// @param[in] _layoutHandle Vertex layout for aliasing vertex buffer. If invalid handle is
/// used, vertex layout used for creation of vertex buffer will be used.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_vertex_buffer`.
///
void setVertexBuffer(
uint8_t _stream
@@ -1272,7 +1288,7 @@ namespace bgfx
/// @param[in] _stream Vertex stream.
/// @param[in] _handle Dynamic vertex buffer.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_dynamic_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_dynamic_vertex_buffer`.
///
void setVertexBuffer(
uint8_t _stream
@@ -1288,7 +1304,7 @@ namespace bgfx
/// @param[in] _layoutHandle Vertex layout for aliasing vertex buffer. If invalid handle is
/// used, vertex layout used for creation of vertex buffer will be used.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_dynamic_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_dynamic_vertex_buffer`.
///
void setVertexBuffer(
uint8_t _stream
@@ -1303,7 +1319,7 @@ namespace bgfx
/// @param[in] _stream Vertex stream.
/// @param[in] _tvb Transient vertex buffer.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_transient_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_transient_vertex_buffer`.
///
void setVertexBuffer(
uint8_t _stream
@@ -1319,7 +1335,7 @@ namespace bgfx
/// @param[in] _layoutHandle Vertex layout for aliasing vertex buffer. If invalid handle is
/// used, vertex layout used for creation of vertex buffer will be used.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_transient_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_transient_vertex_buffer`.
///
void setVertexBuffer(
uint8_t _stream
@@ -1329,13 +1345,13 @@ namespace bgfx
, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE
);
- /// Set number of vertices for auto generated vertices use in conjuction
+ /// Set number of vertices for auto generated vertices use in conjunction
/// with gl_VertexID.
///
/// @param[in] _numVertices Number of vertices.
///
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
- /// @attention C99 equivalent is `bgfx_encoder_set_vertex_count`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_vertex_count`.
///
void setVertexCount(uint32_t _numVertices);
@@ -1343,7 +1359,7 @@ namespace bgfx
///
/// @param[in] _idb Transient instance data buffer.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_instance_data_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_instance_data_buffer`.
///
void setInstanceDataBuffer(const InstanceDataBuffer* _idb);
@@ -1353,7 +1369,7 @@ namespace bgfx
/// @param[in] _start First instance data.
/// @param[in] _num Number of data instances.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_instance_data_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_instance_data_buffer`.
///
void setInstanceDataBuffer(
const InstanceDataBuffer* _idb
@@ -1367,7 +1383,7 @@ namespace bgfx
/// @param[in] _start First instance data.
/// @param[in] _num Number of data instances.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_instance_data_from_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_instance_data_from_vertex_buffer`.
///
void setInstanceDataBuffer(
VertexBufferHandle _handle
@@ -1381,7 +1397,7 @@ namespace bgfx
/// @param[in] _start First instance data.
/// @param[in] _num Number of data instances.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer`.
///
void setInstanceDataBuffer(
DynamicVertexBufferHandle _handle
@@ -1389,13 +1405,13 @@ namespace bgfx
, uint32_t _num
);
- /// Set number of instances for auto generated instances use in conjuction
+ /// Set number of instances for auto generated instances use in conjunction
/// with gl_InstanceID.
///
/// @param[in] _numInstances Number of instances.
///
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
- /// @attention C99 equivalent is `bgfx_encoder_set_instance_count`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_instance_count`.
///
void setInstanceCount(uint32_t _numInstances);
@@ -1411,7 +1427,7 @@ namespace bgfx
/// - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
/// sampling.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_texture`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_texture`.
///
void setTexture(
uint8_t _stage
@@ -1429,7 +1445,7 @@ namespace bgfx
///
/// @param[in] _id View id.
///
- /// @attention C99 equivalent is `bgfx_encoder_touch`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_touch`.
///
void touch(ViewId _id);
@@ -1440,7 +1456,7 @@ namespace bgfx
/// @param[in] _depth Depth for sorting.
/// @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
///
- /// @attention C99 equivalent is `bgfx_encoder_submit`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_submit`.
///
void submit(
ViewId _id
@@ -1457,7 +1473,7 @@ namespace bgfx
/// @param[in] _depth Depth for sorting.
/// @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
///
- /// @attention C99 equivalent is `bgfx_encoder_submit_occlusion_query`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_submit_occlusion_query`.
///
void submit(
ViewId _id
@@ -1474,11 +1490,12 @@ namespace bgfx
/// @param[in] _program Program.
/// @param[in] _indirectHandle Indirect buffer.
/// @param[in] _start First element in indirect buffer.
- /// @param[in] _num Number of dispatches.
+ /// @param[in] _num Number of draws.
/// @param[in] _depth Depth for sorting.
/// @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
///
- /// @attention C99 equivalent is `bgfx_encoder_submit_indirect`.
+ /// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_submit_indirect`.
///
void submit(
ViewId _id
@@ -1490,13 +1507,42 @@ namespace bgfx
, uint8_t _flags = BGFX_DISCARD_ALL
);
+ /// Submit primitive for rendering with index and instance data info and
+ /// draw count from indirect buffers.
+ ///
+ /// @param[in] _id View id.
+ /// @param[in] _program Program.
+ /// @param[in] _indirectHandle Indirect buffer.
+ /// @param[in] _start First element in indirect buffer.
+ /// @param[in] _numHandle Buffer for number of draws. Must be created
+ /// with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
+ /// @param[in] _numIndex Element in number buffer.
+ /// @param[in] _numMax Max number of draws.
+ /// @param[in] _depth Depth for sorting.
+ /// @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
+ ///
+ /// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_submit_indirect_count`.
+ ///
+ void submit(
+ ViewId _id
+ , ProgramHandle _program
+ , IndirectBufferHandle _indirectHandle
+ , uint16_t _start
+ , IndexBufferHandle _numHandle
+ , uint32_t _numIndex = 0
+ , uint16_t _numMax = UINT16_MAX
+ , uint32_t _depth = 0
+ , uint8_t _flags = BGFX_DISCARD_ALL
+ );
+
/// Set compute index buffer.
///
/// @param[in] _stage Compute stage.
/// @param[in] _handle Index buffer handle.
/// @param[in] _access Buffer access. See `Access::Enum`.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_compute_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_compute_index_buffer`.
///
void setBuffer(
uint8_t _stage
@@ -1510,7 +1556,7 @@ namespace bgfx
/// @param[in] _handle Vertex buffer handle.
/// @param[in] _access Buffer access. See `Access::Enum`.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_compute_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_compute_vertex_buffer`.
///
void setBuffer(
uint8_t _stage
@@ -1524,7 +1570,7 @@ namespace bgfx
/// @param[in] _handle Dynamic index buffer handle.
/// @param[in] _access Buffer access. See `Access::Enum`.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_compute_dynamic_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_compute_dynamic_index_buffer`.
///
void setBuffer(
uint8_t _stage
@@ -1538,7 +1584,7 @@ namespace bgfx
/// @param[in] _handle Dynamic vertex buffer handle.
/// @param[in] _access Buffer access. See `Access::Enum`.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_compute_dynamic_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_compute_dynamic_vertex_buffer`.
///
void setBuffer(
uint8_t _stage
@@ -1552,7 +1598,7 @@ namespace bgfx
/// @param[in] _handle Indirect buffer handle.
/// @param[in] _access Buffer access. See `Access::Enum`.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_compute_indirect_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_compute_indirect_buffer`.
///
void setBuffer(
uint8_t _stage
@@ -1568,7 +1614,7 @@ namespace bgfx
/// @param[in] _access Texture access. See `Access::Enum`.
/// @param[in] _format Texture format. See: `TextureFormat::Enum`.
///
- /// @attention C99 equivalent is `bgfx_encoder_set_image`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_set_image`.
///
void setImage(
uint8_t _stage
@@ -1587,7 +1633,7 @@ namespace bgfx
/// @param[in] _numZ Number of groups Z.
/// @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
///
- /// @attention C99 equivalent is `bgfx_encoder_dispatch`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_dispatch`.
///
void dispatch(
ViewId _id
@@ -1607,7 +1653,7 @@ namespace bgfx
/// @param[in] _num Number of dispatches.
/// @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
///
- /// @attention C99 equivalent is `bgfx_encoder_dispatch_indirect`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_dispatch_indirect`.
///
void dispatch(
ViewId _id
@@ -1622,7 +1668,7 @@ namespace bgfx
///
/// @param[in] _flags Draw/compute states to discard.
///
- /// @attention C99 equivalent is `bgfx_encoder_discard`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_discard`.
///
void discard(uint8_t _flags = BGFX_DISCARD_ALL);
@@ -1640,7 +1686,7 @@ namespace bgfx
///
/// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
- /// @attention C99 equivalent is `bgfx_encoder_blit`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_blit`.
///
void blit(
ViewId _id
@@ -1678,7 +1724,7 @@ namespace bgfx
///
/// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
- /// @attention C99 equivalent is `bgfx_encoder_blit`.
+ /// @attention C99's equivalent binding is `bgfx_encoder_blit`.
///
void blit(
ViewId _id
@@ -1700,7 +1746,7 @@ namespace bgfx
/// Vertex layout.
///
- /// @attention C99 equivalent is `bgfx_vertex_layout_t`.
+ /// @attention C99's equivalent binding is `bgfx_vertex_layout_t`.
///
struct VertexLayout
{
@@ -1711,13 +1757,13 @@ namespace bgfx
/// @param[in] _renderer Renderer backend type. See: `bgfx::RendererType`
/// @returns Returns itself.
///
- /// @attention C99 equivalent is `bgfx_vertex_layout_begin`.
+ /// @attention C99's equivalent binding is `bgfx_vertex_layout_begin`.
///
VertexLayout& begin(RendererType::Enum _renderer = RendererType::Noop);
/// End VertexLayout.
///
- /// @attention C99 equivalent is `bgfx_vertex_layout_end`.
+ /// @attention C99's equivalent binding is `bgfx_vertex_layout_end`.
///
void end();
@@ -1738,7 +1784,7 @@ namespace bgfx
/// @remarks
/// Must be called between begin/end.
///
- /// @attention C99 equivalent is `bgfx_vertex_layout_add`.
+ /// @attention C99's equivalent binding is `bgfx_vertex_layout_add`.
///
VertexLayout& add(
Attrib::Enum _attrib
@@ -1752,13 +1798,13 @@ namespace bgfx
///
/// @returns Returns itself.
///
- /// @attention C99 equivalent is `bgfx_vertex_layout_skip`.
+ /// @attention C99's equivalent binding is `bgfx_vertex_layout_skip`.
///
VertexLayout& skip(uint8_t _num);
/// Decode attribute.
///
- /// @attention C99 equivalent is `bgfx_vertex_layout_decode`.
+ /// @attention C99's equivalent binding is `bgfx_vertex_layout_decode`.
///
void decode(
Attrib::Enum _attrib
@@ -1773,7 +1819,7 @@ namespace bgfx
/// @param[in] _attrib Attribute semantics. See: `bgfx::Attrib`
/// @returns True if VertexLayout contains attribute.
///
- /// @attention C99 equivalent is `bgfx_vertex_layout_has`.
+ /// @attention C99's equivalent binding is `bgfx_vertex_layout_has`.
///
bool has(Attrib::Enum _attrib) const { return UINT16_MAX != m_attributes[_attrib]; }
@@ -1812,7 +1858,7 @@ namespace bgfx
/// @param[in] _data Destination vertex stream where data will be packed.
/// @param[in] _index Vertex index that will be modified.
///
- /// @attention C99 equivalent is `bgfx_vertex_pack`.
+ /// @attention C99's equivalent binding is `bgfx_vertex_pack`.
///
void vertexPack(
const float _input[4]
@@ -1831,7 +1877,7 @@ namespace bgfx
/// @param[in] _data Source vertex stream from where data will be unpacked.
/// @param[in] _index Vertex index that will be unpacked.
///
- /// @attention C99 equivalent is `bgfx_vertex_unpack`.
+ /// @attention C99's equivalent binding is `bgfx_vertex_unpack`.
///
void vertexUnpack(
float _output[4]
@@ -1849,7 +1895,7 @@ namespace bgfx
/// @param[in] _srcData Source vertex stream data.
/// @param[in] _num Number of vertices to convert from source to destination.
///
- /// @attention C99 equivalent is `bgfx_vertex_convert`.
+ /// @attention C99's equivalent binding is `bgfx_vertex_convert`.
///
void vertexConvert(
const VertexLayout& _destLayout
@@ -1870,7 +1916,7 @@ namespace bgfx
/// @param[in] _epsilon Error tolerance for vertex position comparison.
/// @returns Number of unique vertices after vertex welding.
///
- /// @attention C99 equivalent is `bgfx_weld_vertices`.
+ /// @attention C99's equivalent binding is `bgfx_weld_vertices`.
///
uint32_t weldVertices(
void* _output
@@ -1895,7 +1941,7 @@ namespace bgfx
///
/// @returns Number of output indices after conversion.
///
- /// @attention C99 equivalent is `bgfx_topology_convert`.
+ /// @attention C99's equivalent binding is `bgfx_topology_convert`.
///
uint32_t topologyConvert(
TopologyConvert::Enum _conversion
@@ -1923,7 +1969,7 @@ namespace bgfx
/// @param[in] _numIndices Number of input indices.
/// @param[in] _index32 Set to `true` if input indices are 32-bit.
///
- /// @attention C99 equivalent is `bgfx_topology_sort_tri_list`.
+ /// @attention C99's equivalent binding is `bgfx_topology_sort_tri_list`.
///
void topologySortTriList(
TopologySort::Enum _sort
@@ -1945,7 +1991,7 @@ namespace bgfx
///
/// @returns Number of supported renderers.
///
- /// @attention C99 equivalent is `bgfx_get_supported_renderers`.
+ /// @attention C99's equivalent binding is `bgfx_get_supported_renderers`.
///
uint8_t getSupportedRenderers(
uint8_t _max = 0
@@ -1954,23 +2000,23 @@ namespace bgfx
/// Returns name of renderer.
///
- /// @attention C99 equivalent is `bgfx_get_renderer_name`.
+ /// @attention C99's equivalent binding is `bgfx_get_renderer_name`.
///
const char* getRendererName(RendererType::Enum _type);
- /// Initialize bgfx library.
+ /// Initialize the bgfx library.
///
/// @param[in] _init Initialization parameters. See: `bgfx::Init` for more info.
///
/// @returns `true` if initialization was successful.
///
- /// @attention C99 equivalent is `bgfx_init`.
+ /// @attention C99's equivalent binding is `bgfx_init`.
///
bool init(const Init& _init = {});
/// Shutdown bgfx library.
///
- /// @attention C99 equivalent is `bgfx_shutdown`.
+ /// @attention C99's equivalent binding is `bgfx_shutdown`.
///
void shutdown();
@@ -1989,13 +2035,13 @@ namespace bgfx
/// - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip
/// occurs. Default behavior is that flip occurs before rendering new
/// frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
- /// - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB backbuffer.
+ /// - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB back-buffer.
/// @param[in] _format Texture format. See: `TextureFormat::Enum`.
///
- /// @attention This call doesn't actually change window size, it just
- /// resizes back-buffer. Windowing code has to change window size.
+ /// @attention This call doesn’t change the window size, it just resizes
+ /// the back-buffer. Your windowing code controls the window size.
///
- /// @attention C99 equivalent is `bgfx_reset`.
+ /// @attention C99's equivalent binding is `bgfx_reset`.
///
void reset(
uint32_t _width
@@ -2024,7 +2070,7 @@ namespace bgfx
/// double/multi buffering data outside the library and passing it to
/// library via `bgfx::makeRef` calls.
///
- /// @attention C99 equivalent is `bgfx_frame`.
+ /// @attention C99's equivalent binding is `bgfx_frame`.
///
uint32_t frame(bool _capture = false);
@@ -2033,7 +2079,7 @@ namespace bgfx
/// @remarks
/// Library must be initialized.
///
- /// @attention C99 equivalent is `bgfx_get_renderer_type`.
+ /// @attention C99's equivalent binding is `bgfx_get_renderer_type`.
///
RendererType::Enum getRendererType();
@@ -2044,14 +2090,14 @@ namespace bgfx
/// @remarks
/// Library must be initialized.
///
- /// @attention C99 equivalent is `bgfx_get_caps`.
+ /// @attention C99's equivalent binding is `bgfx_get_caps`.
///
const Caps* getCaps();
/// Returns performance counters.
///
/// @attention Pointer returned is valid until `bgfx::frame` is called.
- /// @attention C99 equivalent is `bgfx_get_stats`.
+ /// @attention C99's equivalent binding is `bgfx_get_stats`.
///
const Stats* getStats();
@@ -2059,7 +2105,7 @@ namespace bgfx
///
/// @param[in] _size Size to allocate.
///
- /// @attention C99 equivalent is `bgfx_alloc`.
+ /// @attention C99's equivalent binding is `bgfx_alloc`.
///
const Memory* alloc(uint32_t _size);
@@ -2068,7 +2114,7 @@ namespace bgfx
/// @param[in] _data Pointer to data to be copied.
/// @param[in] _size Size of data to be copied.
///
- /// @attention C99 equivalent is `bgfx_copy`.
+ /// @attention C99's equivalent binding is `bgfx_copy`.
///
const Memory* copy(
const void* _data
@@ -2088,7 +2134,7 @@ namespace bgfx
/// @param[in] _userData User data to be passed to callback function.
///
/// @attention Data passed must be available for at least 2 `bgfx::frame` calls.
- /// @attention C99 equivalent are `bgfx_make_ref`, `bgfx_make_ref_release`.
+ /// @attention C99's equivalent bindings are `bgfx_make_ref`, `bgfx_make_ref_release`.
///
const Memory* makeRef(
const void* _data
@@ -2109,7 +2155,7 @@ namespace bgfx
/// - `BGFX_DEBUG_WIREFRAME` - Wireframe rendering. All rendering
/// primitives will be rendered as lines.
///
- /// @attention C99 equivalent is `bgfx_set_debug`.
+ /// @attention C99's equivalent binding is `bgfx_set_debug`.
///
void setDebug(uint32_t _debug);
@@ -2118,7 +2164,7 @@ namespace bgfx
/// @param[in] _attr Background color.
/// @param[in] _small Default 8x16 or 8x8 font.
///
- /// @attention C99 equivalent is `bgfx_dbg_text_clear`.
+ /// @attention C99's equivalent binding is `bgfx_dbg_text_clear`.
///
void dbgTextClear(
uint8_t _attr = 0
@@ -2132,7 +2178,7 @@ namespace bgfx
/// 4-bits represent foreground color from standard VGA text palette (ANSI escape codes).
/// @param[in] _format `printf` style format.
///
- /// @attention C99 equivalent is `bgfx_dbg_text_printf`.
+ /// @attention C99's equivalent binding is `bgfx_dbg_text_printf`.
///
void dbgTextPrintf(
uint16_t _x
@@ -2150,7 +2196,7 @@ namespace bgfx
/// @param[in] _format `printf` style format.
/// @param[in] _argList additional arguments for format string
///
- /// @attention C99 equivalent is `bgfx_dbg_text_vprintf`.
+ /// @attention C99's equivalent binding is `bgfx_dbg_text_vprintf`.
///
void dbgTextPrintfVargs(
uint16_t _x
@@ -2167,7 +2213,7 @@ namespace bgfx
/// @param[in] _data Raw image data (character/attribute raw encoding).
/// @param[in] _pitch Image pitch in bytes.
///
- /// @attention C99 equivalent is `bgfx_dbg_text_image`.
+ /// @attention C99's equivalent binding is `bgfx_dbg_text_image`.
///
void dbgTextImage(
uint16_t _x
@@ -2194,7 +2240,7 @@ namespace bgfx
/// - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
/// index buffers.
///
- /// @attention C99 equivalent is `bgfx_create_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_create_index_buffer`.
///
IndexBufferHandle createIndexBuffer(
const Memory* _mem
@@ -2208,7 +2254,7 @@ namespace bgfx
/// @param[in] _len Static index buffer name length (if length is INT32_MAX, it's expected
/// that _name is zero terminated string.
///
- /// @attention C99 equivalent is `bgfx_set_index_buffer_name`.
+ /// @attention C99's equivalent binding is `bgfx_set_index_buffer_name`.
///
void setName(
IndexBufferHandle _handle
@@ -2220,19 +2266,19 @@ namespace bgfx
///
/// @param[in] _handle Static index buffer handle.
///
- /// @attention C99 equivalent is `bgfx_destroy_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_destroy_index_buffer`.
///
void destroy(IndexBufferHandle _handle);
/// Create vertex layout.
///
- /// @attention C99 equivalent is `bgfx_create_vertex_layout`.
+ /// @attention C99's equivalent binding is `bgfx_create_vertex_layout`.
///
VertexLayoutHandle createVertexLayout(const VertexLayout& _layout);
/// Destroy vertex layout.
///
- /// @attention C99 equivalent is `bgfx_destroy_vertex_layout`.
+ /// @attention C99's equivalent binding is `bgfx_destroy_vertex_layout`.
///
void destroy(VertexLayoutHandle _handle);
@@ -2254,7 +2300,7 @@ namespace bgfx
/// index buffers.
/// @returns Static vertex buffer handle.
///
- /// @attention C99 equivalent is `bgfx_create_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_create_vertex_buffer`.
///
VertexBufferHandle createVertexBuffer(
const Memory* _mem
@@ -2269,7 +2315,7 @@ namespace bgfx
/// @param[in] _len Static vertex buffer name length (if length is INT32_MAX, it's expected
/// that _name is zero terminated string.
///
- /// @attention C99 equivalent is `bgfx_set_vertex_buffer_name`.
+ /// @attention C99's equivalent binding is `bgfx_set_vertex_buffer_name`.
///
void setName(
VertexBufferHandle _handle
@@ -2281,7 +2327,7 @@ namespace bgfx
///
/// @param[in] _handle Static vertex buffer handle.
///
- /// @attention C99 equivalent is `bgfx_destroy_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_destroy_vertex_buffer`.
///
void destroy(VertexBufferHandle _handle);
@@ -2302,14 +2348,14 @@ namespace bgfx
/// index buffers.
/// @returns Dynamic index buffer handle.
///
- /// @attention C99 equivalent is `bgfx_create_dynamic_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_create_dynamic_index_buffer`.
///
DynamicIndexBufferHandle createDynamicIndexBuffer(
uint32_t _num
, uint16_t _flags = BGFX_BUFFER_NONE
);
- /// Create dynamic index buffer and initialized it.
+ /// Create a dynamic index buffer and initialize it.
///
/// @param[in] _mem Index buffer data.
/// @param[in] _flags Buffer creation flags.
@@ -2326,7 +2372,7 @@ namespace bgfx
/// index buffers.
/// @returns Dynamic index buffer handle.
///
- /// @attention C99 equivalent is `bgfx_create_dynamic_index_buffer_mem`.
+ /// @attention C99's equivalent binding is `bgfx_create_dynamic_index_buffer_mem`.
///
DynamicIndexBufferHandle createDynamicIndexBuffer(
const Memory* _mem
@@ -2339,7 +2385,7 @@ namespace bgfx
/// @param[in] _startIndex Start index.
/// @param[in] _mem Index buffer data.
///
- /// @attention C99 equivalent is `bgfx_update_dynamic_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_update_dynamic_index_buffer`.
///
void update(
DynamicIndexBufferHandle _handle
@@ -2351,7 +2397,7 @@ namespace bgfx
///
/// @param[in] _handle Dynamic index buffer handle.
///
- /// @attention C99 equivalent is `bgfx_destroy_dynamic_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_destroy_dynamic_index_buffer`.
///
void destroy(DynamicIndexBufferHandle _handle);
@@ -2373,7 +2419,7 @@ namespace bgfx
/// index buffers.
/// @returns Dynamic vertex buffer handle.
///
- /// @attention C99 equivalent is `bgfx_create_dynamic_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_create_dynamic_vertex_buffer`.
///
DynamicVertexBufferHandle createDynamicVertexBuffer(
uint32_t _num
@@ -2399,7 +2445,7 @@ namespace bgfx
/// index buffers.
/// @returns Dynamic vertex buffer handle.
///
- /// @attention C99 equivalent is `bgfx_create_dynamic_vertex_buffer_mem`.
+ /// @attention C99's equivalent binding is `bgfx_create_dynamic_vertex_buffer_mem`.
///
DynamicVertexBufferHandle createDynamicVertexBuffer(
const Memory* _mem
@@ -2413,7 +2459,7 @@ namespace bgfx
/// @param[in] _startVertex Start vertex.
/// @param[in] _mem Vertex buffer data.
///
- /// @attention C99 equivalent is `bgfx_update_dynamic_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_update_dynamic_vertex_buffer`.
///
void update(
DynamicVertexBufferHandle _handle
@@ -2425,7 +2471,7 @@ namespace bgfx
///
/// @param[in] _handle Dynamic vertex buffer handle.
///
- /// @attention C99 equivalent is `bgfx_destroy_dynamic_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_destroy_dynamic_vertex_buffer`.
///
void destroy(DynamicVertexBufferHandle _handle);
@@ -2434,7 +2480,7 @@ namespace bgfx
/// @param[in] _num Number of required indices.
/// @param[in] _index32 Set to `true` if input indices will be 32-bit.
///
- /// @attention C99 equivalent is `bgfx_get_avail_transient_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_get_avail_transient_index_buffer`.
///
uint32_t getAvailTransientIndexBuffer(
uint32_t _num
@@ -2446,7 +2492,7 @@ namespace bgfx
/// @param[in] _num Number of required vertices.
/// @param[in] _layout Vertex layout.
///
- /// @attention C99 equivalent is `bgfx_get_avail_transient_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_get_avail_transient_vertex_buffer`.
///
uint32_t getAvailTransientVertexBuffer(
uint32_t _num
@@ -2458,7 +2504,7 @@ namespace bgfx
/// @param[in] _num Number of required instances.
/// @param[in] _stride Stride per instance.
///
- /// @attention C99 equivalent is `bgfx_get_avail_instance_data_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_get_avail_instance_data_buffer`.
///
uint32_t getAvailInstanceDataBuffer(
uint32_t _num
@@ -2467,13 +2513,12 @@ namespace bgfx
/// Allocate transient index buffer.
///
- /// @param[out] _tib TransientIndexBuffer structure is filled and is valid
- /// for the duration of frame, and it can be reused for multiple draw
- /// calls.
+ /// @param[out] _tib TransientIndexBuffer structure will be filled, and will be valid
+ /// for the duration of frame, and can be reused for multiple draw calls.
/// @param[in] _num Number of indices to allocate.
/// @param[in] _index32 Set to `true` if input indices will be 32-bit.
///
- /// @attention C99 equivalent is `bgfx_alloc_transient_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_alloc_transient_index_buffer`.
///
void allocTransientIndexBuffer(
TransientIndexBuffer* _tib
@@ -2483,13 +2528,12 @@ namespace bgfx
/// Allocate transient vertex buffer.
///
- /// @param[out] _tvb TransientVertexBuffer structure is filled and is valid
- /// for the duration of frame, and it can be reused for multiple draw
- /// calls.
+ /// @param[out] _tvb TransientVertexBuffer structure will be filled, and will be valid
+ /// for the duration of frame, and can be reused for multiple draw calls.
/// @param[in] _num Number of vertices to allocate.
/// @param[in] _layout Vertex layout.
///
- /// @attention C99 equivalent is `bgfx_alloc_transient_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_alloc_transient_vertex_buffer`.
///
void allocTransientVertexBuffer(
TransientVertexBuffer* _tvb
@@ -2501,18 +2545,16 @@ namespace bgfx
/// buffers. If both space requirements are satisfied function returns
/// true.
///
- /// @param[out] _tvb TransientVertexBuffer structure is filled and is valid
- /// for the duration of frame, and it can be reused for multiple draw
- /// calls.
+ /// @param[out] _tvb TransientVertexBuffer structure will be filled, and will be valid
+ /// for the duration of frame, and can be reused for multiple draw calls.
/// @param[in] _layout Vertex layout.
/// @param[in] _numVertices Number of vertices to allocate.
- /// @param[out] _tib TransientIndexBuffer structure is filled and is valid
- /// for the duration of frame, and it can be reused for multiple draw
- /// calls.
+ /// @param[out] _tib TransientIndexBuffer structure will be filled, and will be valid
+ /// for the duration of frame, and can be reused for multiple draw calls.
/// @param[in] _numIndices Number of indices to allocate.
/// @param[in] _index32 Set to `true` if input indices will be 32-bit.
///
- /// @attention C99 equivalent is `bgfx_alloc_transient_buffers`.
+ /// @attention C99's equivalent binding is `bgfx_alloc_transient_buffers`.
///
bool allocTransientBuffers(
TransientVertexBuffer* _tvb
@@ -2525,13 +2567,12 @@ namespace bgfx
/// Allocate instance data buffer.
///
- /// @param[out] _idb InstanceDataBuffer structure is filled and is valid
- /// for duration of frame, and it can be reused for multiple draw
- /// calls.
+ /// @param[out] _idb InstanceDataBuffer structure will be filled, and will be valid
+ /// for the duration of frame, and can be reused for multiple draw calls.
/// @param[in] _num Number of instances.
/// @param[in] _stride Instance stride. Must be multiple of 16.
///
- /// @attention C99 equivalent is `bgfx_alloc_instance_data_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_alloc_instance_data_buffer`.
///
void allocInstanceDataBuffer(
InstanceDataBuffer* _idb
@@ -2544,7 +2585,7 @@ namespace bgfx
/// @param[in] _num Number of indirect calls.
/// @returns Indirect buffer handle.
///
- /// @attention C99 equivalent is `bgfx_create_indirect_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_create_indirect_buffer`.
///
IndirectBufferHandle createIndirectBuffer(uint32_t _num);
@@ -2552,7 +2593,7 @@ namespace bgfx
///
/// @param[in] _handle Indirect buffer handle.
///
- /// @attention C99 equivalent is `bgfx_destroy_indirect_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_destroy_indirect_buffer`.
///
void destroy(IndirectBufferHandle _handle);
@@ -2560,7 +2601,7 @@ namespace bgfx
///
/// @returns Shader handle.
///
- /// @attention C99 equivalent is `bgfx_create_shader`.
+ /// @attention C99's equivalent binding is `bgfx_create_shader`.
///
ShaderHandle createShader(const Memory* _mem);
@@ -2574,7 +2615,7 @@ namespace bgfx
/// @remarks
/// Only non-predefined uniforms are returned.
///
- /// @attention C99 equivalent is `bgfx_get_shader_uniforms`.
+ /// @attention C99's equivalent binding is `bgfx_get_shader_uniforms`.
///
uint16_t getShaderUniforms(
ShaderHandle _handle
@@ -2589,7 +2630,7 @@ namespace bgfx
/// @param[in] _len Shader name length (if length is INT32_MAX, it's expected
/// that _name is zero terminated string.
///
- /// @attention C99 equivalent is `bgfx_set_shader_name`.
+ /// @attention C99's equivalent binding is `bgfx_set_shader_name`.
///
void setName(
ShaderHandle _handle
@@ -2602,7 +2643,7 @@ namespace bgfx
///
/// @param[in] _handle Shader handle.
///
- /// @attention C99 equivalent is `bgfx_destroy_shader`.
+ /// @attention C99's equivalent binding is `bgfx_destroy_shader`.
///
void destroy(ShaderHandle _handle);
@@ -2615,7 +2656,7 @@ namespace bgfx
/// @returns Program handle if vertex shader output and fragment shader
/// input are matching, otherwise returns invalid program handle.
///
- /// @attention C99 equivalent is `bgfx_create_program`.
+ /// @attention C99's equivalent binding is `bgfx_create_program`.
///
ProgramHandle createProgram(
ShaderHandle _vsh
@@ -2630,7 +2671,7 @@ namespace bgfx
/// program is destroyed.
/// @returns Program handle.
///
- /// @attention C99 equivalent is `bgfx_create_compute_program`.
+ /// @attention C99's equivalent binding is `bgfx_create_compute_program`.
///
ProgramHandle createProgram(
ShaderHandle _csh
@@ -2641,7 +2682,7 @@ namespace bgfx
///
/// @param[in] _handle Program handle.
///
- /// @attention C99 equivalent is `bgfx_destroy_program`.
+ /// @attention C99's equivalent binding is `bgfx_destroy_program`.
///
void destroy(ProgramHandle _handle);
@@ -2652,9 +2693,9 @@ namespace bgfx
/// @param[in] _numLayers Number of layers in texture array.
/// @param[in] _format Texture format. See: `TextureFormat::Enum`.
/// @param[in] _flags Texture flags. See `BGFX_TEXTURE_*`.
- /// @returns True if texture can be successfully created.
+ /// @returns True if a texture with the same parameters can be created.
///
- /// @attention C99 equivalent is `bgfx_is_texture_valid`.
+ /// @attention C99's equivalent binding is `bgfx_is_texture_valid`.
///
bool isTextureValid(
uint16_t _depth
@@ -2669,7 +2710,7 @@ namespace bgfx
/// @param[in] _num Number of attachments.
/// @param[in] _attachment Attachment texture info. See: `bgfx::Attachment`.
///
- /// @returns True if frame buffer can be successfully created.
+ /// @returns True if a frame buffer with the same parameters can be created.
///
bool isFrameBufferValid(
uint8_t _num
@@ -2687,7 +2728,7 @@ namespace bgfx
/// @param[in] _numLayers Number of layers in texture array.
/// @param[in] _format Texture format. See: `TextureFormat::Enum`.
///
- /// @attention C99 equivalent is `bgfx_calc_texture_size`.
+ /// @attention C99's equivalent binding is `bgfx_calc_texture_size`.
///
void calcTextureSize(
TextureInfo& _info
@@ -2714,7 +2755,7 @@ namespace bgfx
/// @param[out] _info When non-`NULL` is specified it returns parsed texture information.
/// @returns Texture handle.
///
- /// @attention C99 equivalent is `bgfx_create_texture`.
+ /// @attention C99's equivalent binding is `bgfx_create_texture`.
///
TextureHandle createTexture(
const Memory* _mem
@@ -2742,7 +2783,7 @@ namespace bgfx
/// `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
/// 1, expected memory layout is texture and all mips together for each array element.
///
- /// @attention C99 equivalent is `bgfx_create_texture_2d`.
+ /// @attention C99's equivalent binding is `bgfx_create_texture_2d`.
///
TextureHandle createTexture2D(
uint16_t _width
@@ -2754,7 +2795,7 @@ namespace bgfx
, const Memory* _mem = NULL
);
- /// Create texture with size based on backbuffer ratio. Texture will maintain ratio
+ /// Create texture with size based on back-buffer ratio. Texture will maintain ratio
/// if back buffer resolution changes.
///
/// @param[in] _ratio Frame buffer size in respect to back-buffer size. See:
@@ -2770,7 +2811,7 @@ namespace bgfx
/// - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
/// sampling.
///
- /// @attention C99 equivalent is `bgfx_create_texture_2d_scaled`.
+ /// @attention C99's equivalent binding is `bgfx_create_texture_2d_scaled`.
///
TextureHandle createTexture2D(
BackbufferRatio::Enum _ratio
@@ -2797,7 +2838,7 @@ namespace bgfx
/// @param[in] _mem Texture data. If `_mem` is non-NULL, created texture will be immutable. If
/// `_mem` is NULL content of the texture is uninitialized.
///
- /// @attention C99 equivalent is `bgfx_create_texture_3d`.
+ /// @attention C99's equivalent binding is `bgfx_create_texture_3d`.
///
TextureHandle createTexture3D(
uint16_t _width
@@ -2827,7 +2868,7 @@ namespace bgfx
/// `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
/// 1, expected memory layout is texture and all mips together for each array element.
///
- /// @attention C99 equivalent is `bgfx_create_texture_cube`.
+ /// @attention C99's equivalent binding is `bgfx_create_texture_cube`.
///
TextureHandle createTextureCube(
uint16_t _size
@@ -2853,7 +2894,7 @@ namespace bgfx
///
/// @attention It's valid to update only mutable texture. See `bgfx::createTexture2D` for more info.
///
- /// @attention C99 equivalent is `bgfx_update_texture_2d`.
+ /// @attention C99's equivalent binding is `bgfx_update_texture_2d`.
///
void updateTexture2D(
TextureHandle _handle
@@ -2881,7 +2922,7 @@ namespace bgfx
///
/// @attention It's valid to update only mutable texture. See `bgfx::createTexture3D` for more info.
///
- /// @attention C99 equivalent is `bgfx_update_texture_3d`.
+ /// @attention C99's equivalent binding is `bgfx_update_texture_3d`.
///
void updateTexture3D(
TextureHandle _handle
@@ -2930,7 +2971,7 @@ namespace bgfx
///
/// @attention It's valid to update only mutable texture. See `bgfx::createTextureCube` for more info.
///
- /// @attention C99 equivalent is `bgfx_update_texture_cube`.
+ /// @attention C99's equivalent binding is `bgfx_update_texture_cube`.
///
void updateTextureCube(
TextureHandle _handle
@@ -2955,7 +2996,7 @@ namespace bgfx
///
/// @attention Texture must be created with `BGFX_TEXTURE_READ_BACK` flag.
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_READ_BACK`.
- /// @attention C99 equivalent is `bgfx_read_texture`.
+ /// @attention C99's equivalent binding is `bgfx_read_texture`.
///
uint32_t readTexture(
TextureHandle _handle
@@ -2970,7 +3011,7 @@ namespace bgfx
/// @param[in] _len Texture name length (if length is INT32_MAX, it's expected
/// that _name is zero terminated string.
///
- /// @attention C99 equivalent is `bgfx_set_texture_name`.
+ /// @attention C99's equivalent binding is `bgfx_set_texture_name`.
///
void setName(
TextureHandle _handle
@@ -2990,7 +3031,7 @@ namespace bgfx
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_DIRECT_ACCESS`. This feature
/// is available on GPUs that have unified memory architecture (UMA) support.
///
- /// @attention C99 equivalent is `bgfx_get_direct_access_ptr`.
+ /// @attention C99's equivalent binding is `bgfx_get_direct_access_ptr`.
///
void* getDirectAccessPtr(TextureHandle _handle);
@@ -2998,7 +3039,7 @@ namespace bgfx
///
/// @param[in] _handle Texture handle.
///
- /// @attention C99 equivalent is `bgfx_destroy_texture`.
+ /// @attention C99's equivalent binding is `bgfx_destroy_texture`.
///
void destroy(TextureHandle _handle);
@@ -3016,7 +3057,7 @@ namespace bgfx
///
/// @returns Handle to frame buffer object.
///
- /// @attention C99 equivalent is `bgfx_create_frame_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_create_frame_buffer`.
///
FrameBufferHandle createFrameBuffer(
uint16_t _width
@@ -3025,7 +3066,7 @@ namespace bgfx
, uint64_t _textureFlags = BGFX_SAMPLER_U_CLAMP|BGFX_SAMPLER_V_CLAMP
);
- /// Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
+ /// Create frame buffer with size based on back-buffer ratio. Frame buffer will maintain ratio
/// if back buffer resolution changes.
///
/// @param[in] _ratio Frame buffer size in respect to back-buffer size. See:
@@ -3040,7 +3081,7 @@ namespace bgfx
///
/// @returns Handle to frame buffer object.
///
- /// @attention C99 equivalent is `bgfx_create_frame_buffer_scaled`.
+ /// @attention C99's equivalent binding is `bgfx_create_frame_buffer_scaled`.
///
FrameBufferHandle createFrameBuffer(
BackbufferRatio::Enum _ratio
@@ -3057,7 +3098,7 @@ namespace bgfx
///
/// @returns Handle to frame buffer object.
///
- /// @attention C99 equivalent is `bgfx_create_frame_buffer_from_handles`.
+ /// @attention C99's equivalent binding is `bgfx_create_frame_buffer_from_handles`.
///
FrameBufferHandle createFrameBuffer(
uint8_t _num
@@ -3075,7 +3116,7 @@ namespace bgfx
///
/// @returns Handle to frame buffer object.
///
- /// @attention C99 equivalent is `bgfx_create_frame_buffer_from_attachment`.
+ /// @attention C99's equivalent binding is `bgfx_create_frame_buffer_from_attachment`.
///
FrameBufferHandle createFrameBuffer(
uint8_t _num
@@ -3096,7 +3137,7 @@ namespace bgfx
/// @remarks
/// Frame buffer cannot be used for sampling.
///
- /// @attention C99 equivalent is `bgfx_create_frame_buffer_from_nwh`.
+ /// @attention C99's equivalent binding is `bgfx_create_frame_buffer_from_nwh`.
///
FrameBufferHandle createFrameBuffer(
void* _nwh
@@ -3113,7 +3154,7 @@ namespace bgfx
/// @param[in] _len frame buffer name length (if length is INT32_MAX, it's expected
/// that _name is zero terminated string.
///
- /// @attention C99 equivalent is `bgfx_set_frame_buffer_name`.
+ /// @attention C99's equivalent binding is `bgfx_set_frame_buffer_name`.
///
void setName(
FrameBufferHandle _handle
@@ -3129,7 +3170,7 @@ namespace bgfx
/// @returns Returns invalid texture handle if attachment index is not
/// correct, or frame buffer is created with native window handle.
///
- /// @attention C99 equivalent is `bgfx_get_texture`.
+ /// @attention C99's equivalent binding is `bgfx_get_texture`.
///
TextureHandle getTexture(
FrameBufferHandle _handle
@@ -3140,7 +3181,7 @@ namespace bgfx
///
/// @param[in] _handle Frame buffer handle.
///
- /// @attention C99 equivalent is `bgfx_destroy_frame_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_destroy_frame_buffer`.
///
void destroy(FrameBufferHandle _handle);
@@ -3176,7 +3217,7 @@ namespace bgfx
/// - `u_modelViewProj mat4` - concatenated model view projection matrix.
/// - `u_alphaRef float` - alpha reference value for alpha test.
///
- /// @attention C99 equivalent is `bgfx_create_uniform`.
+ /// @attention C99's equivalent binding is `bgfx_create_uniform`.
///
UniformHandle createUniform(
const char* _name
@@ -3189,7 +3230,7 @@ namespace bgfx
/// @param[in] _handle Handle to uniform object.
/// @param[out] _info Uniform info.
///
- /// @attention C99 equivalent is `bgfx_get_uniform_info`.
+ /// @attention C99's equivalent binding is `bgfx_get_uniform_info`.
///
void getUniformInfo(
UniformHandle _handle
@@ -3200,7 +3241,7 @@ namespace bgfx
///
/// @param[in] _handle Handle to uniform object.
///
- /// @attention C99 equivalent is `bgfx_destroy_uniform`.
+ /// @attention C99's equivalent binding is `bgfx_destroy_uniform`.
///
void destroy(UniformHandle _handle);
@@ -3208,7 +3249,7 @@ namespace bgfx
///
/// @returns Handle to occlusion query object.
///
- /// @attention C99 equivalent is `bgfx_create_occlusion_query`.
+ /// @attention C99's equivalent binding is `bgfx_create_occlusion_query`.
///
OcclusionQueryHandle createOcclusionQuery();
@@ -3219,7 +3260,7 @@ namespace bgfx
/// can be `NULL` if result of occlusion query is not needed.
/// @returns Occlusion query result.
///
- /// @attention C99 equivalent is `bgfx_get_result`.
+ /// @attention C99's equivalent binding is `bgfx_get_result`.
///
OcclusionQueryResult::Enum getResult(
OcclusionQueryHandle _handle
@@ -3230,7 +3271,7 @@ namespace bgfx
///
/// @param[in] _handle Handle to occlusion query object.
///
- /// @attention C99 equivalent is `bgfx_destroy_occlusion_query`.
+ /// @attention C99's equivalent binding is `bgfx_destroy_occlusion_query`.
///
void destroy(OcclusionQueryHandle _handle);
@@ -3239,7 +3280,7 @@ namespace bgfx
/// @param[in] _index Index into palette.
/// @param[in] _rgba Packed 32-bit RGBA value.
///
- /// @attention C99 equivalent is `bgfx_set_palette_color`.
+ /// @attention C99's equivalent binding is `bgfx_set_palette_color`.
///
void setPaletteColor(
uint8_t _index
@@ -3251,7 +3292,7 @@ namespace bgfx
/// @param[in] _index Index into palette.
/// @param[in] _r, _g, _b, _a RGBA floating point values.
///
- /// @attention C99 equivalent is `bgfx_set_palette_color`.
+ /// @attention C99's equivalent binding is `bgfx_set_palette_color`.
///
void setPaletteColor(
uint8_t _index
@@ -3266,7 +3307,7 @@ namespace bgfx
/// @param[in] _index Index into palette.
/// @param[in] _rgba RGBA floating point value.
///
- /// @attention C99 equivalent is `bgfx_set_palette_color`.
+ /// @attention C99's equivalent binding is `bgfx_set_palette_color`.
///
void setPaletteColor(
uint8_t _index
@@ -3289,7 +3330,7 @@ namespace bgfx
/// | +--- compute (C)
/// +------ view id
///
- /// @attention C99 equivalent is `bgfx_set_view_name`.
+ /// @attention C99's equivalent binding is `bgfx_set_view_name`.
///
void setViewName(
ViewId _id
@@ -3304,7 +3345,7 @@ namespace bgfx
/// @param[in] _width Width of view port region.
/// @param[in] _height Height of view port region.
///
- /// @attention C99 equivalent is `bgfx_set_view_rect`.
+ /// @attention C99's equivalent binding is `bgfx_set_view_rect`.
///
void setViewRect(
ViewId _id
@@ -3322,7 +3363,7 @@ namespace bgfx
/// @param[in] _ratio Width and height will be set in respect to back-buffer size. See:
/// `BackbufferRatio::Enum`.
///
- /// @attention C99 equivalent is `bgfx_set_view_rect_ratio`.
+ /// @attention C99's equivalent binding is `bgfx_set_view_rect_ratio`.
///
void setViewRect(
ViewId _id
@@ -3340,7 +3381,7 @@ namespace bgfx
/// @param[in] _width Width of scissor region.
/// @param[in] _height Height of scissor region.
///
- /// @attention C99 equivalent is `bgfx_set_view_scissor`.
+ /// @attention C99's equivalent binding is `bgfx_set_view_scissor`.
///
void setViewScissor(
ViewId _id
@@ -3359,7 +3400,7 @@ namespace bgfx
/// @param[in] _depth Depth clear value.
/// @param[in] _stencil Stencil clear value.
///
- /// @attention C99 equivalent is `bgfx_set_view_clear`.
+ /// @attention C99's equivalent binding is `bgfx_set_view_clear`.
///
void setViewClear(
ViewId _id
@@ -3370,8 +3411,8 @@ namespace bgfx
);
/// Set view clear flags with different clear color for each
- /// frame buffer texture. Must use `bgfx::setPaletteColor` to setup clear color
- /// palette.
+ /// frame buffer texture. `bgfx::setPaletteColor` must be used to set up a
+ /// clear color palette.
///
/// @param[in] _id View id.
/// @param[in] _flags Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
@@ -3387,7 +3428,7 @@ namespace bgfx
/// @param[in] _6 Palette index for frame buffer attachment 6.
/// @param[in] _7 Palette index for frame buffer attachment 7.
///
- /// @attention C99 equivalent is `bgfx_set_view_clear_mrt`.
+ /// @attention C99's equivalent binding is `bgfx_set_view_clear_mrt`.
///
void setViewClear(
ViewId _id
@@ -3412,7 +3453,7 @@ namespace bgfx
/// @remarks
/// View mode must be set prior calling `bgfx::submit` for the view.
///
- /// @attention C99 equivalent is `bgfx_set_view_mode`.
+ /// @attention C99's equivalent binding is `bgfx_set_view_mode`.
///
void setViewMode(
ViewId _id
@@ -3429,21 +3470,21 @@ namespace bgfx
/// @remarks
/// Not persistent after `bgfx::reset` call.
///
- /// @attention C99 equivalent is `bgfx_set_view_frame_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_view_frame_buffer`.
///
void setViewFrameBuffer(
ViewId _id
, FrameBufferHandle _handle
);
- /// Set view view and projection matrices, all draw primitives in this
- /// view will use these matrices.
+ /// Set view's view matrix and projection matrix,
+ /// all draw primitives in this view will use these two matrices.
///
/// @param[in] _id View id.
/// @param[in] _view View matrix.
/// @param[in] _proj Projection matrix.
///
- /// @attention C99 equivalent is `bgfx_set_view_transform`.
+ /// @attention C99's equivalent binding is `bgfx_set_view_transform`.
///
void setViewTransform(
ViewId _id
@@ -3458,7 +3499,7 @@ namespace bgfx
/// @param[in] _remap View remap id table. Passing `NULL` will reset view ids
/// to default state.
///
- /// @attention C99 equivalent is `bgfx_set_view_order`.
+ /// @attention C99's equivalent binding is `bgfx_set_view_order`.
///
void setViewOrder(
ViewId _id = 0
@@ -3470,13 +3511,13 @@ namespace bgfx
///
/// @param[in] _id View id.
///
- /// @attention C99 equivalent is `bgfx_reset_view`.
+ /// @attention C99's equivalent binding is `bgfx_reset_view`.
///
void resetView(ViewId _id);
/// Sets debug marker.
///
- /// @attention C99 equivalent is `bgfx_set_marker`.
+ /// @attention C99's equivalent binding is `bgfx_set_marker`.
///
void setMarker(const char* _marker);
@@ -3496,7 +3537,7 @@ namespace bgfx
/// `BGFX_STATE_BLEND_INV_FACTOR` blend modes.
///
/// @remarks
- /// 1. To setup more complex states use:
+ /// 1. To set up more complex states use:
/// `BGFX_STATE_ALPHA_REF(_ref)`,
/// `BGFX_STATE_POINT_SIZE(_size)`,
/// `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -3506,7 +3547,7 @@ namespace bgfx
/// 2. `BGFX_STATE_BLEND_EQUATION_ADD` is set when no other blend
/// equation is specified.
///
- /// @attention C99 equivalent is `bgfx_set_state`.
+ /// @attention C99's equivalent binding is `bgfx_set_state`.
///
void setState(
uint64_t _state
@@ -3518,7 +3559,7 @@ namespace bgfx
/// @param[in] _handle Occlusion query handle.
/// @param[in] _visible Render if occlusion query is visible.
///
- /// @attention C99 equivalent is `bgfx_set_condition`.
+ /// @attention C99's equivalent binding is `bgfx_set_condition`.
///
void setCondition(
OcclusionQueryHandle _handle
@@ -3531,7 +3572,7 @@ namespace bgfx
/// @param[in] _bstencil Back stencil state. If back is set to `BGFX_STENCIL_NONE`
/// _fstencil is applied to both front and back facing primitives.
///
- /// @attention C99 equivalent is `bgfx_set_stencil`.
+ /// @attention C99's equivalent binding is `bgfx_set_stencil`.
///
void setStencil(
uint32_t _fstencil
@@ -3547,7 +3588,7 @@ namespace bgfx
/// @param[in] _height Height of scissor region.
/// @returns Scissor cache index.
///
- /// @attention C99 equivalent is `bgfx_set_scissor`.
+ /// @attention C99's equivalent binding is `bgfx_set_scissor`.
///
uint16_t setScissor(
uint16_t _x
@@ -3561,7 +3602,7 @@ namespace bgfx
/// @param[in] _cache Index in scissor cache. Passing UINT16_MAX unset primitive
/// scissor and primitive will use view scissor instead.
///
- /// @attention C99 equivalent is `bgfx_set_scissor_cached`.
+ /// @attention C99's equivalent binding is `bgfx_set_scissor_cached`.
///
void setScissor(uint16_t _cache = UINT16_MAX);
@@ -3573,7 +3614,7 @@ namespace bgfx
/// @returns index into matrix cache in case the same model matrix has
/// to be used for other draw primitive call.
///
- /// @attention C99 equivalent is `bgfx_set_transform`.
+ /// @attention C99's equivalent binding is `bgfx_set_transform`.
///
uint32_t setTransform(
const void* _mtx
@@ -3586,8 +3627,8 @@ namespace bgfx
/// @param[in] _num Number of matrices.
/// @returns index into matrix cache.
///
- /// @attention Pointer returned can be modifed until `bgfx::frame` is called.
- /// @attention C99 equivalent is `bgfx_alloc_transform`.
+ /// @attention Pointer returned can be modified until `bgfx::frame` is called.
+ /// @attention C99's equivalent binding is `bgfx_alloc_transform`.
///
uint32_t allocTransform(
Transform* _transform
@@ -3599,7 +3640,7 @@ namespace bgfx
/// @param[in] _cache Index in matrix cache.
/// @param[in] _num Number of matrices from cache.
///
- /// @attention C99 equivalent is `bgfx_set_transform_cached`.
+ /// @attention C99's equivalent binding is `bgfx_set_transform_cached`.
///
void setTransform(
uint32_t _cache
@@ -3613,7 +3654,7 @@ namespace bgfx
/// @param[in] _num Number of elements. Passing `UINT16_MAX` will
/// use the _num passed on uniform creation.
///
- /// @attention C99 equivalent is `bgfx_set_uniform`.
+ /// @attention C99's equivalent binding is `bgfx_set_uniform`.
///
void setUniform(
UniformHandle _handle
@@ -3625,7 +3666,7 @@ namespace bgfx
///
/// @param[in] _handle Index buffer.
///
- /// @attention C99 equivalent is `bgfx_set_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_index_buffer`.
///
void setIndexBuffer(IndexBufferHandle _handle);
@@ -3635,7 +3676,7 @@ namespace bgfx
/// @param[in] _firstIndex First index to render.
/// @param[in] _numIndices Number of indices to render.
///
- /// @attention C99 equivalent is `bgfx_set_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_index_buffer`.
///
void setIndexBuffer(
IndexBufferHandle _handle
@@ -3647,7 +3688,7 @@ namespace bgfx
///
/// @param[in] _handle Dynamic index buffer.
///
- /// @attention C99 equivalent is `bgfx_set_dynamic_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_dynamic_index_buffer`.
///
void setIndexBuffer(DynamicIndexBufferHandle _handle);
@@ -3657,7 +3698,7 @@ namespace bgfx
/// @param[in] _firstIndex First index to render.
/// @param[in] _numIndices Number of indices to render.
///
- /// @attention C99 equivalent is `bgfx_set_dynamic_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_dynamic_index_buffer`.
///
void setIndexBuffer(
DynamicIndexBufferHandle _handle
@@ -3669,7 +3710,7 @@ namespace bgfx
///
/// @param[in] _tib Transient index buffer.
///
- /// @attention C99 equivalent is `bgfx_set_transient_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_transient_index_buffer`.
///
void setIndexBuffer(const TransientIndexBuffer* _tib);
@@ -3679,7 +3720,7 @@ namespace bgfx
/// @param[in] _firstIndex First index to render.
/// @param[in] _numIndices Number of indices to render.
///
- /// @attention C99 equivalent is `bgfx_set_transient_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_transient_index_buffer`.
///
void setIndexBuffer(
const TransientIndexBuffer* _tib
@@ -3692,7 +3733,7 @@ namespace bgfx
/// @param[in] _stream Vertex stream.
/// @param[in] _handle Vertex buffer.
///
- /// @attention C99 equivalent is `bgfx_set_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_vertex_buffer`.
///
void setVertexBuffer(
uint8_t _stream
@@ -3708,7 +3749,7 @@ namespace bgfx
/// @param[in] _layoutHandle Vertex layout for aliasing vertex buffer. If invalid handle is
/// used, vertex layout used for creation of vertex buffer will be used.
///
- /// @attention C99 equivalent is `bgfx_set_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_vertex_buffer`.
///
void setVertexBuffer(
uint8_t _stream
@@ -3723,7 +3764,7 @@ namespace bgfx
/// @param[in] _stream Vertex stream.
/// @param[in] _handle Dynamic vertex buffer.
///
- /// @attention C99 equivalent is `bgfx_set_dynamic_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_dynamic_vertex_buffer`.
///
void setVertexBuffer(
uint8_t _stream
@@ -3739,7 +3780,7 @@ namespace bgfx
/// @param[in] _layoutHandle Vertex layout for aliasing vertex buffer. If invalid handle is
/// used, vertex layout used for creation of vertex buffer will be used.
///
- /// @attention C99 equivalent is `bgfx_set_dynamic_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_dynamic_vertex_buffer`.
///
void setVertexBuffer(
uint8_t _stream
@@ -3754,7 +3795,7 @@ namespace bgfx
/// @param[in] _stream Vertex stream.
/// @param[in] _tvb Transient vertex buffer.
///
- /// @attention C99 equivalent is `bgfx_set_transient_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_transient_vertex_buffer`.
///
void setVertexBuffer(
uint8_t _stream
@@ -3770,7 +3811,7 @@ namespace bgfx
/// @param[in] _layoutHandle Vertex layout for aliasing vertex buffer. If invalid handle is
/// used, vertex layout used for creation of vertex buffer will be used.
///
- /// @attention C99 equivalent is `bgfx_set_transient_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_transient_vertex_buffer`.
///
void setVertexBuffer(
uint8_t _stream
@@ -3780,13 +3821,13 @@ namespace bgfx
, VertexLayoutHandle _layoutHandle = BGFX_INVALID_HANDLE
);
- /// Set number of vertices for auto generated vertices use in conjuction
+ /// Set number of vertices for auto generated vertices use in conjunction
/// with gl_VertexID.
///
/// @param[in] _numVertices Number of vertices.
///
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
- /// @attention C99 equivalent is `bgfx_set_vertex_count`.
+ /// @attention C99's equivalent binding is `bgfx_set_vertex_count`.
///
void setVertexCount(uint32_t _numVertices);
@@ -3794,7 +3835,7 @@ namespace bgfx
///
/// @param[in] _idb Transient instance data buffer.
///
- /// @attention C99 equivalent is `bgfx_set_instance_data_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_instance_data_buffer`.
///
void setInstanceDataBuffer(const InstanceDataBuffer* _idb);
@@ -3804,7 +3845,7 @@ namespace bgfx
/// @param[in] _start First instance data.
/// @param[in] _num Number of data instances.
///
- /// @attention C99 equivalent is `bgfx_set_instance_data_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_instance_data_buffer`.
///
void setInstanceDataBuffer(
const InstanceDataBuffer* _idb
@@ -3818,7 +3859,7 @@ namespace bgfx
/// @param[in] _start First instance data.
/// @param[in] _num Number of data instances.
///
- /// @attention C99 equivalent is `bgfx_set_instance_data_from_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_instance_data_from_vertex_buffer`.
///
void setInstanceDataBuffer(
VertexBufferHandle _handle
@@ -3832,7 +3873,7 @@ namespace bgfx
/// @param[in] _start First instance data.
/// @param[in] _num Number of data instances.
///
- /// @attention C99 equivalent is `bgfx_set_instance_data_from_dynamic_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_instance_data_from_dynamic_vertex_buffer`.
///
void setInstanceDataBuffer(
DynamicVertexBufferHandle _handle
@@ -3840,13 +3881,13 @@ namespace bgfx
, uint32_t _num
);
- /// Set number of instances for auto generated instances use in conjuction
+ /// Set number of instances for auto generated instances use in conjunction
/// with gl_InstanceID.
///
/// @param[in] _numInstances Number of instances.
///
/// @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
- /// @attention C99 equivalent is `bgfx_set_instance_count`.
+ /// @attention C99's equivalent binding is `bgfx_set_instance_count`.
///
void setInstanceCount(uint32_t _numInstances);
@@ -3862,7 +3903,7 @@ namespace bgfx
/// - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
/// sampling.
///
- /// @attention C99 equivalent is `bgfx_set_texture`.
+ /// @attention C99's equivalent binding is `bgfx_set_texture`.
///
void setTexture(
uint8_t _stage
@@ -3878,7 +3919,7 @@ namespace bgfx
///
/// @param[in] _id View id.
///
- /// @attention C99 equivalent is `bgfx_touch`.
+ /// @attention C99's equivalent binding is `bgfx_touch`.
///
void touch(ViewId _id);
@@ -3889,7 +3930,7 @@ namespace bgfx
/// @param[in] _depth Depth for sorting.
/// @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
///
- /// @attention C99 equivalent is `bgfx_submit`.
+ /// @attention C99's equivalent binding is `bgfx_submit`.
///
void submit(
ViewId _id
@@ -3906,7 +3947,7 @@ namespace bgfx
/// @param[in] _depth Depth for sorting.
/// @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
///
- /// @attention C99 equivalent is `bgfx_submit_occlusion_query`.
+ /// @attention C99's equivalent binding is `bgfx_submit_occlusion_query`.
///
void submit(
ViewId _id
@@ -3923,11 +3964,12 @@ namespace bgfx
/// @param[in] _program Program.
/// @param[in] _indirectHandle Indirect buffer.
/// @param[in] _start First element in indirect buffer.
- /// @param[in] _num Number of dispatches.
+ /// @param[in] _num Number of draws.
/// @param[in] _depth Depth for sorting.
/// @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
///
- /// @attention C99 equivalent is `bgfx_submit_indirect`.
+ /// @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
+ /// @attention C99's equivalent binding is `bgfx_submit_indirect`.
///
void submit(
ViewId _id
@@ -3939,13 +3981,42 @@ namespace bgfx
, uint8_t _flags = BGFX_DISCARD_ALL
);
+ /// Submit primitive for rendering with index and instance data info and
+ /// draw count from indirect buffers.
+ ///
+ /// @param[in] _id View id.
+ /// @param[in] _program Program.
+ /// @param[in] _indirectHandle Indirect buffer.
+ /// @param[in] _start First element in indirect buffer.
+ /// @param[in] _numHandle Buffer for number of draws. Must be created
+ /// with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
+ /// @param[in] _numIndex Element in number buffer.
+ /// @param[in] _numMax Max number of draws.
+ /// @param[in] _depth Depth for sorting.
+ /// @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
+ ///
+ /// @attention Availability depends on:`BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+ /// @attention C99's equivalent binding is `bgfx_submit_indirect_count`.
+ ///
+ void submit(
+ ViewId _id
+ , ProgramHandle _program
+ , IndirectBufferHandle _indirectHandle
+ , uint16_t _start
+ , IndexBufferHandle _numHandle
+ , uint32_t _numIndex = 0
+ , uint16_t _numMax = UINT16_MAX
+ , uint32_t _depth = 0
+ , uint8_t _flags = BGFX_DISCARD_ALL
+ );
+
/// Set compute index buffer.
///
/// @param[in] _stage Compute stage.
/// @param[in] _handle Index buffer handle.
/// @param[in] _access Buffer access. See `Access::Enum`.
///
- /// @attention C99 equivalent is `bgfx_set_compute_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_compute_index_buffer`.
///
void setBuffer(
uint8_t _stage
@@ -3959,7 +4030,7 @@ namespace bgfx
/// @param[in] _handle Vertex buffer handle.
/// @param[in] _access Buffer access. See `Access::Enum`.
///
- /// @attention C99 equivalent is `bgfx_set_compute_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_compute_vertex_buffer`.
///
void setBuffer(
uint8_t _stage
@@ -3973,7 +4044,7 @@ namespace bgfx
/// @param[in] _handle Dynamic index buffer handle.
/// @param[in] _access Buffer access. See `Access::Enum`.
///
- /// @attention C99 equivalent is `bgfx_set_compute_dynamic_index_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_compute_dynamic_index_buffer`.
///
void setBuffer(
uint8_t _stage
@@ -3987,7 +4058,7 @@ namespace bgfx
/// @param[in] _handle Dynamic vertex buffer handle.
/// @param[in] _access Buffer access. See `Access::Enum`.
///
- /// @attention C99 equivalent is `bgfx_set_compute_dynamic_vertex_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_compute_dynamic_vertex_buffer`.
///
void setBuffer(
uint8_t _stage
@@ -4001,7 +4072,7 @@ namespace bgfx
/// @param[in] _handle Indirect buffer handle.
/// @param[in] _access Buffer access. See `Access::Enum`.
///
- /// @attention C99 equivalent is `bgfx_set_compute_indirect_buffer`.
+ /// @attention C99's equivalent binding is `bgfx_set_compute_indirect_buffer`.
///
void setBuffer(
uint8_t _stage
@@ -4017,7 +4088,7 @@ namespace bgfx
/// @param[in] _access Texture access. See `Access::Enum`.
/// @param[in] _format Texture format. See: `TextureFormat::Enum`.
///
- /// @attention C99 equivalent is `bgfx_set_image`.
+ /// @attention C99's equivalent binding is `bgfx_set_image`.
///
void setImage(
uint8_t _stage
@@ -4036,7 +4107,7 @@ namespace bgfx
/// @param[in] _numZ Number of groups Z.
/// @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
///
- /// @attention C99 equivalent is `bgfx_dispatch`.
+ /// @attention C99's equivalent binding is `bgfx_dispatch`.
///
void dispatch(
ViewId _id
@@ -4056,7 +4127,7 @@ namespace bgfx
/// @param[in] _num Number of dispatches.
/// @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
///
- /// @attention C99 equivalent is `bgfx_dispatch_indirect`.
+ /// @attention C99's equivalent binding is `bgfx_dispatch_indirect`.
///
void dispatch(
ViewId _id
@@ -4071,7 +4142,7 @@ namespace bgfx
///
/// @param[in] _flags Draw/compute states to discard.
///
- /// @attention C99 equivalent is `bgfx_discard`.
+ /// @attention C99's equivalent binding is `bgfx_discard`.
///
void discard(uint8_t _flags = BGFX_DISCARD_ALL);
@@ -4089,7 +4160,7 @@ namespace bgfx
///
/// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
- /// @attention C99 equivalent is `bgfx_blit`.
+ /// @attention C99's equivalent binding is `bgfx_blit`.
///
void blit(
ViewId _id
@@ -4127,7 +4198,7 @@ namespace bgfx
///
/// @attention Destination texture must be created with `BGFX_TEXTURE_BLIT_DST` flag.
/// @attention Availability depends on: `BGFX_CAPS_TEXTURE_BLIT`.
- /// @attention C99 equivalent is `bgfx_blit`.
+ /// @attention C99's equivalent binding is `bgfx_blit`.
///
void blit(
ViewId _id
@@ -4156,7 +4227,7 @@ namespace bgfx
/// `bgfx::CallbackI::screenShot` must be implemented.
///
/// @attention Frame buffer handle must be created with OS' target native window handle.
- /// @attention C99 equivalent is `bgfx_request_screen_shot`.
+ /// @attention C99's equivalent binding is `bgfx_request_screen_shot`.
///
void requestScreenShot(
FrameBufferHandle _handle
diff --git a/3rdparty/bgfx/include/bgfx/c99/bgfx.h b/3rdparty/bgfx/include/bgfx/c99/bgfx.h
index cc03336b2fa..04d9bcebee7 100644
--- a/3rdparty/bgfx/include/bgfx/c99/bgfx.h
+++ b/3rdparty/bgfx/include/bgfx/c99/bgfx.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -194,70 +194,81 @@ typedef enum bgfx_texture_format
BGFX_TEXTURE_FORMAT_ATCE, /** (18) ATCE RGBA 8 BPP explicit alpha */
BGFX_TEXTURE_FORMAT_ATCI, /** (19) ATCI RGBA 8 BPP interpolated alpha */
BGFX_TEXTURE_FORMAT_ASTC4X4, /** (20) ASTC 4x4 8.0 BPP */
- BGFX_TEXTURE_FORMAT_ASTC5X5, /** (21) ASTC 5x5 5.12 BPP */
- BGFX_TEXTURE_FORMAT_ASTC6X6, /** (22) ASTC 6x6 3.56 BPP */
- BGFX_TEXTURE_FORMAT_ASTC8X5, /** (23) ASTC 8x5 3.20 BPP */
- BGFX_TEXTURE_FORMAT_ASTC8X6, /** (24) ASTC 8x6 2.67 BPP */
- BGFX_TEXTURE_FORMAT_ASTC10X5, /** (25) ASTC 10x5 2.56 BPP */
- BGFX_TEXTURE_FORMAT_UNKNOWN, /** (26) Compressed formats above. */
- BGFX_TEXTURE_FORMAT_R1, /** (27) */
- BGFX_TEXTURE_FORMAT_A8, /** (28) */
- BGFX_TEXTURE_FORMAT_R8, /** (29) */
- BGFX_TEXTURE_FORMAT_R8I, /** (30) */
- BGFX_TEXTURE_FORMAT_R8U, /** (31) */
- BGFX_TEXTURE_FORMAT_R8S, /** (32) */
- BGFX_TEXTURE_FORMAT_R16, /** (33) */
- BGFX_TEXTURE_FORMAT_R16I, /** (34) */
- BGFX_TEXTURE_FORMAT_R16U, /** (35) */
- BGFX_TEXTURE_FORMAT_R16F, /** (36) */
- BGFX_TEXTURE_FORMAT_R16S, /** (37) */
- BGFX_TEXTURE_FORMAT_R32I, /** (38) */
- BGFX_TEXTURE_FORMAT_R32U, /** (39) */
- BGFX_TEXTURE_FORMAT_R32F, /** (40) */
- BGFX_TEXTURE_FORMAT_RG8, /** (41) */
- BGFX_TEXTURE_FORMAT_RG8I, /** (42) */
- BGFX_TEXTURE_FORMAT_RG8U, /** (43) */
- BGFX_TEXTURE_FORMAT_RG8S, /** (44) */
- BGFX_TEXTURE_FORMAT_RG16, /** (45) */
- BGFX_TEXTURE_FORMAT_RG16I, /** (46) */
- BGFX_TEXTURE_FORMAT_RG16U, /** (47) */
- BGFX_TEXTURE_FORMAT_RG16F, /** (48) */
- BGFX_TEXTURE_FORMAT_RG16S, /** (49) */
- BGFX_TEXTURE_FORMAT_RG32I, /** (50) */
- BGFX_TEXTURE_FORMAT_RG32U, /** (51) */
- BGFX_TEXTURE_FORMAT_RG32F, /** (52) */
- BGFX_TEXTURE_FORMAT_RGB8, /** (53) */
- BGFX_TEXTURE_FORMAT_RGB8I, /** (54) */
- BGFX_TEXTURE_FORMAT_RGB8U, /** (55) */
- BGFX_TEXTURE_FORMAT_RGB8S, /** (56) */
- BGFX_TEXTURE_FORMAT_RGB9E5F, /** (57) */
- BGFX_TEXTURE_FORMAT_BGRA8, /** (58) */
- BGFX_TEXTURE_FORMAT_RGBA8, /** (59) */
- BGFX_TEXTURE_FORMAT_RGBA8I, /** (60) */
- BGFX_TEXTURE_FORMAT_RGBA8U, /** (61) */
- BGFX_TEXTURE_FORMAT_RGBA8S, /** (62) */
- BGFX_TEXTURE_FORMAT_RGBA16, /** (63) */
- BGFX_TEXTURE_FORMAT_RGBA16I, /** (64) */
- BGFX_TEXTURE_FORMAT_RGBA16U, /** (65) */
- BGFX_TEXTURE_FORMAT_RGBA16F, /** (66) */
- BGFX_TEXTURE_FORMAT_RGBA16S, /** (67) */
- BGFX_TEXTURE_FORMAT_RGBA32I, /** (68) */
- BGFX_TEXTURE_FORMAT_RGBA32U, /** (69) */
- BGFX_TEXTURE_FORMAT_RGBA32F, /** (70) */
- BGFX_TEXTURE_FORMAT_R5G6B5, /** (71) */
- BGFX_TEXTURE_FORMAT_RGBA4, /** (72) */
- BGFX_TEXTURE_FORMAT_RGB5A1, /** (73) */
- BGFX_TEXTURE_FORMAT_RGB10A2, /** (74) */
- BGFX_TEXTURE_FORMAT_RG11B10F, /** (75) */
- BGFX_TEXTURE_FORMAT_UNKNOWNDEPTH, /** (76) Depth formats below. */
- BGFX_TEXTURE_FORMAT_D16, /** (77) */
- BGFX_TEXTURE_FORMAT_D24, /** (78) */
- BGFX_TEXTURE_FORMAT_D24S8, /** (79) */
- BGFX_TEXTURE_FORMAT_D32, /** (80) */
- BGFX_TEXTURE_FORMAT_D16F, /** (81) */
- BGFX_TEXTURE_FORMAT_D24F, /** (82) */
- BGFX_TEXTURE_FORMAT_D32F, /** (83) */
- BGFX_TEXTURE_FORMAT_D0S8, /** (84) */
+ BGFX_TEXTURE_FORMAT_ASTC5X4, /** (21) ASTC 5x4 6.40 BPP */
+ BGFX_TEXTURE_FORMAT_ASTC5X5, /** (22) ASTC 5x5 5.12 BPP */
+ BGFX_TEXTURE_FORMAT_ASTC6X5, /** (23) ASTC 6x5 4.27 BPP */
+ BGFX_TEXTURE_FORMAT_ASTC6X6, /** (24) ASTC 6x6 3.56 BPP */
+ BGFX_TEXTURE_FORMAT_ASTC8X5, /** (25) ASTC 8x5 3.20 BPP */
+ BGFX_TEXTURE_FORMAT_ASTC8X6, /** (26) ASTC 8x6 2.67 BPP */
+ BGFX_TEXTURE_FORMAT_ASTC8X8, /** (27) ASTC 8x8 2.00 BPP */
+ BGFX_TEXTURE_FORMAT_ASTC10X5, /** (28) ASTC 10x5 2.56 BPP */
+ BGFX_TEXTURE_FORMAT_ASTC10X6, /** (29) ASTC 10x6 2.13 BPP */
+ BGFX_TEXTURE_FORMAT_ASTC10X8, /** (30) ASTC 10x8 1.60 BPP */
+ BGFX_TEXTURE_FORMAT_ASTC10X10, /** (31) ASTC 10x10 1.28 BPP */
+ BGFX_TEXTURE_FORMAT_ASTC12X10, /** (32) ASTC 12x10 1.07 BPP */
+ BGFX_TEXTURE_FORMAT_ASTC12X12, /** (33) ASTC 12x12 0.89 BPP */
+ BGFX_TEXTURE_FORMAT_UNKNOWN, /** (34) Compressed formats above. */
+ BGFX_TEXTURE_FORMAT_R1, /** (35) */
+ BGFX_TEXTURE_FORMAT_A8, /** (36) */
+ BGFX_TEXTURE_FORMAT_R8, /** (37) */
+ BGFX_TEXTURE_FORMAT_R8I, /** (38) */
+ BGFX_TEXTURE_FORMAT_R8U, /** (39) */
+ BGFX_TEXTURE_FORMAT_R8S, /** (40) */
+ BGFX_TEXTURE_FORMAT_R16, /** (41) */
+ BGFX_TEXTURE_FORMAT_R16I, /** (42) */
+ BGFX_TEXTURE_FORMAT_R16U, /** (43) */
+ BGFX_TEXTURE_FORMAT_R16F, /** (44) */
+ BGFX_TEXTURE_FORMAT_R16S, /** (45) */
+ BGFX_TEXTURE_FORMAT_R32I, /** (46) */
+ BGFX_TEXTURE_FORMAT_R32U, /** (47) */
+ BGFX_TEXTURE_FORMAT_R32F, /** (48) */
+ BGFX_TEXTURE_FORMAT_RG8, /** (49) */
+ BGFX_TEXTURE_FORMAT_RG8I, /** (50) */
+ BGFX_TEXTURE_FORMAT_RG8U, /** (51) */
+ BGFX_TEXTURE_FORMAT_RG8S, /** (52) */
+ BGFX_TEXTURE_FORMAT_RG16, /** (53) */
+ BGFX_TEXTURE_FORMAT_RG16I, /** (54) */
+ BGFX_TEXTURE_FORMAT_RG16U, /** (55) */
+ BGFX_TEXTURE_FORMAT_RG16F, /** (56) */
+ BGFX_TEXTURE_FORMAT_RG16S, /** (57) */
+ BGFX_TEXTURE_FORMAT_RG32I, /** (58) */
+ BGFX_TEXTURE_FORMAT_RG32U, /** (59) */
+ BGFX_TEXTURE_FORMAT_RG32F, /** (60) */
+ BGFX_TEXTURE_FORMAT_RGB8, /** (61) */
+ BGFX_TEXTURE_FORMAT_RGB8I, /** (62) */
+ BGFX_TEXTURE_FORMAT_RGB8U, /** (63) */
+ BGFX_TEXTURE_FORMAT_RGB8S, /** (64) */
+ BGFX_TEXTURE_FORMAT_RGB9E5F, /** (65) */
+ BGFX_TEXTURE_FORMAT_BGRA8, /** (66) */
+ BGFX_TEXTURE_FORMAT_RGBA8, /** (67) */
+ BGFX_TEXTURE_FORMAT_RGBA8I, /** (68) */
+ BGFX_TEXTURE_FORMAT_RGBA8U, /** (69) */
+ BGFX_TEXTURE_FORMAT_RGBA8S, /** (70) */
+ BGFX_TEXTURE_FORMAT_RGBA16, /** (71) */
+ BGFX_TEXTURE_FORMAT_RGBA16I, /** (72) */
+ BGFX_TEXTURE_FORMAT_RGBA16U, /** (73) */
+ BGFX_TEXTURE_FORMAT_RGBA16F, /** (74) */
+ BGFX_TEXTURE_FORMAT_RGBA16S, /** (75) */
+ BGFX_TEXTURE_FORMAT_RGBA32I, /** (76) */
+ BGFX_TEXTURE_FORMAT_RGBA32U, /** (77) */
+ BGFX_TEXTURE_FORMAT_RGBA32F, /** (78) */
+ BGFX_TEXTURE_FORMAT_B5G6R5, /** (79) */
+ BGFX_TEXTURE_FORMAT_R5G6B5, /** (80) */
+ BGFX_TEXTURE_FORMAT_BGRA4, /** (81) */
+ BGFX_TEXTURE_FORMAT_RGBA4, /** (82) */
+ BGFX_TEXTURE_FORMAT_BGR5A1, /** (83) */
+ BGFX_TEXTURE_FORMAT_RGB5A1, /** (84) */
+ BGFX_TEXTURE_FORMAT_RGB10A2, /** (85) */
+ BGFX_TEXTURE_FORMAT_RG11B10F, /** (86) */
+ BGFX_TEXTURE_FORMAT_UNKNOWNDEPTH, /** (87) Depth formats below. */
+ BGFX_TEXTURE_FORMAT_D16, /** (88) */
+ BGFX_TEXTURE_FORMAT_D24, /** (89) */
+ BGFX_TEXTURE_FORMAT_D24S8, /** (90) */
+ BGFX_TEXTURE_FORMAT_D32, /** (91) */
+ BGFX_TEXTURE_FORMAT_D16F, /** (92) */
+ BGFX_TEXTURE_FORMAT_D24F, /** (93) */
+ BGFX_TEXTURE_FORMAT_D32F, /** (94) */
+ BGFX_TEXTURE_FORMAT_D0S8, /** (95) */
BGFX_TEXTURE_FORMAT_COUNT
@@ -591,11 +602,16 @@ typedef struct bgfx_platform_data_s
void* ndt; /** Native display type (*nix specific). */
/**
- * Native window handle. If `NULL` bgfx will create headless
- * context/device if renderer API supports it.
+ * Native window handle. If `NULL`, bgfx will create a headless
+ * context/device, provided the rendering API supports it.
*/
void* nwh;
- void* context; /** GL context, or D3D device. If `NULL`, bgfx will create context/device. */
+
+ /**
+ * GL context, D3D device, or Vulkan device. If `NULL`, bgfx
+ * will create context/device.
+ */
+ void* context;
/**
* GL back-buffer, or D3D render target view. If `NULL` bgfx will
@@ -604,7 +620,7 @@ typedef struct bgfx_platform_data_s
void* backBuffer;
/**
- * Backbuffer depth/stencil. If `NULL` bgfx will create back-buffer
+ * Backbuffer depth/stencil. If `NULL`, bgfx will create a back-buffer
* depth/stencil surface.
*/
void* backBufferDS;
@@ -654,23 +670,25 @@ typedef struct bgfx_init_s
bgfx_renderer_type_t type;
/**
- * Vendor PCI id. If set to `BGFX_PCI_ID_NONE` it will select the first
- * device.
+ * Vendor PCI ID. If set to `BGFX_PCI_ID_NONE`, discrete and integrated
+ * GPUs will be prioritised.
* - `BGFX_PCI_ID_NONE` - Autoselect adapter.
* - `BGFX_PCI_ID_SOFTWARE_RASTERIZER` - Software rasterizer.
* - `BGFX_PCI_ID_AMD` - AMD adapter.
+ * - `BGFX_PCI_ID_APPLE` - Apple adapter.
* - `BGFX_PCI_ID_INTEL` - Intel adapter.
- * - `BGFX_PCI_ID_NVIDIA` - nVidia adapter.
+ * - `BGFX_PCI_ID_NVIDIA` - NVIDIA adapter.
+ * - `BGFX_PCI_ID_MICROSOFT` - Microsoft adapter.
*/
uint16_t vendorId;
/**
- * Device id. If set to 0 it will select first device, or device with
- * matching id.
+ * Device ID. If set to 0 it will select first device, or device with
+ * matching ID.
*/
uint16_t deviceId;
uint64_t capabilities; /** Capabilities initialization mask (default: UINT64_MAX). */
- bool debug; /** Enable device for debuging. */
+ bool debug; /** Enable device for debugging. */
bool profile; /** Enable device for profiling. */
bgfx_platform_data_t platformData; /** Platform data. */
bgfx_resolution_t resolution; /** Backbuffer resolution and reset parameters. See: `bgfx::Resolution`. */
@@ -815,6 +833,7 @@ typedef struct bgfx_view_stats_s
int64_t cpuTimeEnd; /** CPU (submit) end time. */
int64_t gpuTimeBegin; /** GPU begin time. */
int64_t gpuTimeEnd; /** GPU end time. */
+ uint32_t gpuFrameNum; /** Frame which generated gpuTimeBegin, gpuTimeEnd. */
} bgfx_view_stats_t;
@@ -850,6 +869,7 @@ typedef struct bgfx_stats_s
uint32_t numCompute; /** Number of compute calls submitted. */
uint32_t numBlit; /** Number of blit calls submitted. */
uint32_t maxGpuLatency; /** GPU driver latency. */
+ uint32_t gpuFrameNum; /** Frame which generated gpuTimeBegin, gpuTimeEnd. */
uint16_t numDynamicIndexBuffers; /** Number of used dynamic index buffers. */
uint16_t numDynamicVertexBuffers; /** Number of used dynamic vertex buffers. */
uint16_t numFrameBuffers; /** Number of used frame buffers. */
@@ -1098,7 +1118,7 @@ BGFX_C_API const char* bgfx_get_renderer_name(bgfx_renderer_type_t _type);
BGFX_C_API void bgfx_init_ctor(bgfx_init_t* _init);
/**
- * Initialize bgfx library.
+ * Initialize the bgfx library.
*
* @param[in] _init Initialization parameters. See: `bgfx::Init` for more info.
*
@@ -1115,8 +1135,8 @@ BGFX_C_API void bgfx_shutdown(void);
/**
* Reset graphic settings and back-buffer size.
- * @attention This call doesn't actually change window size, it just
- * resizes back-buffer. Windowing code has to change window size.
+ * @attention This call doesn’t change the window size, it just resizes
+ * the back-buffer. Your windowing code controls the window size.
*
* @param[in] _width Back-buffer width.
* @param[in] _height Back-buffer height.
@@ -1131,7 +1151,7 @@ BGFX_C_API void bgfx_shutdown(void);
* - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip
* occurs. Default behaviour is that flip occurs before rendering new
* frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
- * - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB backbuffer.
+ * - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB back-buffer.
* @param[in] _format Texture format. See: `TextureFormat::Enum`.
*
*/
@@ -1413,7 +1433,7 @@ BGFX_C_API void bgfx_destroy_vertex_buffer(bgfx_vertex_buffer_handle_t _handle);
BGFX_C_API bgfx_dynamic_index_buffer_handle_t bgfx_create_dynamic_index_buffer(uint32_t _num, uint16_t _flags);
/**
- * Create dynamic index buffer and initialized it.
+ * Create a dynamic index buffer and initialize it.
*
* @param[in] _mem Index buffer data.
* @param[in] _flags Buffer creation flags.
@@ -1552,8 +1572,8 @@ BGFX_C_API uint32_t bgfx_get_avail_instance_data_buffer(uint32_t _num, uint16_t
/**
* Allocate transient index buffer.
*
- * @param[out] _tib TransientIndexBuffer structure is filled and is valid
- * for the duration of frame, and it can be reused for multiple draw
+ * @param[out] _tib TransientIndexBuffer structure will be filled, and will be valid
+ * for the duration of frame, and can be reused for multiple draw
* calls.
* @param[in] _num Number of indices to allocate.
* @param[in] _index32 Set to `true` if input indices will be 32-bit.
@@ -1564,8 +1584,8 @@ BGFX_C_API void bgfx_alloc_transient_index_buffer(bgfx_transient_index_buffer_t*
/**
* Allocate transient vertex buffer.
*
- * @param[out] _tvb TransientVertexBuffer structure is filled and is valid
- * for the duration of frame, and it can be reused for multiple draw
+ * @param[out] _tvb TransientVertexBuffer structure will be filled, and will be valid
+ * for the duration of frame, and can be reused for multiple draw
* calls.
* @param[in] _num Number of vertices to allocate.
* @param[in] _layout Vertex layout.
@@ -1578,13 +1598,13 @@ BGFX_C_API void bgfx_alloc_transient_vertex_buffer(bgfx_transient_vertex_buffer_
* buffers. If both space requirements are satisfied function returns
* true.
*
- * @param[out] _tvb TransientVertexBuffer structure is filled and is valid
- * for the duration of frame, and it can be reused for multiple draw
+ * @param[out] _tvb TransientVertexBuffer structure will be filled, and will be valid
+ * for the duration of frame, and can be reused for multiple draw
* calls.
* @param[in] _layout Vertex layout.
* @param[in] _numVertices Number of vertices to allocate.
- * @param[out] _tib TransientIndexBuffer structure is filled and is valid
- * for the duration of frame, and it can be reused for multiple draw
+ * @param[out] _tib TransientIndexBuffer structure will be filled, and will be valid
+ * for the duration of frame, and can be reused for multiple draw
* calls.
* @param[in] _numIndices Number of indices to allocate.
* @param[in] _index32 Set to `true` if input indices will be 32-bit.
@@ -1595,8 +1615,8 @@ BGFX_C_API bool bgfx_alloc_transient_buffers(bgfx_transient_vertex_buffer_t* _tv
/**
* Allocate instance data buffer.
*
- * @param[out] _idb InstanceDataBuffer structure is filled and is valid
- * for duration of frame, and it can be reused for multiple draw
+ * @param[out] _idb InstanceDataBuffer structure will be filled, and will be valid
+ * for duration of frame, and can be reused for multiple draw
* calls.
* @param[in] _num Number of instances.
* @param[in] _stride Instance stride. Must be multiple of 16.
@@ -1708,7 +1728,7 @@ BGFX_C_API void bgfx_destroy_program(bgfx_program_handle_t _handle);
* @param[in] _format Texture format. See: `TextureFormat::Enum`.
* @param[in] _flags Texture flags. See `BGFX_TEXTURE_*`.
*
- * @returns True if texture can be successfully created.
+ * @returns True if a texture with the same parameters can be created.
*
*/
BGFX_C_API bool bgfx_is_texture_valid(uint16_t _depth, bool _cubeMap, uint16_t _numLayers, bgfx_texture_format_t _format, uint64_t _flags);
@@ -1719,7 +1739,7 @@ BGFX_C_API bool bgfx_is_texture_valid(uint16_t _depth, bool _cubeMap, uint16_t _
* @param[in] _num Number of attachments.
* @param[in] _attachment Attachment texture info. See: `bgfx::Attachment`.
*
- * @returns True if frame buffer can be successfully created.
+ * @returns True if a frame buffer with the same parameters can be created.
*
*/
BGFX_C_API bool bgfx_is_frame_buffer_valid(uint8_t _num, const bgfx_attachment_t* _attachment);
@@ -1782,7 +1802,7 @@ BGFX_C_API bgfx_texture_handle_t bgfx_create_texture(const bgfx_memory_t* _mem,
BGFX_C_API bgfx_texture_handle_t bgfx_create_texture_2d(uint16_t _width, uint16_t _height, bool _hasMips, uint16_t _numLayers, bgfx_texture_format_t _format, uint64_t _flags, const bgfx_memory_t* _mem);
/**
- * Create texture with size based on backbuffer ratio. Texture will maintain ratio
+ * Create texture with size based on back-buffer ratio. Texture will maintain ratio
* if back buffer resolution changes.
*
* @param[in] _ratio Texture size in respect to back-buffer size. See: `BackbufferRatio::Enum`.
@@ -1986,7 +2006,7 @@ BGFX_C_API void bgfx_destroy_texture(bgfx_texture_handle_t _handle);
BGFX_C_API bgfx_frame_buffer_handle_t bgfx_create_frame_buffer(uint16_t _width, uint16_t _height, bgfx_texture_format_t _format, uint64_t _textureFlags);
/**
- * Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
+ * Create frame buffer with size based on back-buffer ratio. Frame buffer will maintain ratio
* if back buffer resolution changes.
*
* @param[in] _ratio Frame buffer size in respect to back-buffer size. See:
@@ -2239,8 +2259,8 @@ BGFX_C_API void bgfx_set_view_clear(bgfx_view_id_t _id, uint16_t _flags, uint32_
/**
* Set view clear flags with different clear color for each
- * frame buffer texture. Must use `bgfx::setPaletteColor` to setup clear color
- * palette.
+ * frame buffer texture. `bgfx::setPaletteColor` must be used to set up a
+ * clear color palette.
*
* @param[in] _id View id.
* @param[in] _flags Clear flags. Use `BGFX_CLEAR_NONE` to remove any clear
@@ -2284,8 +2304,8 @@ BGFX_C_API void bgfx_set_view_mode(bgfx_view_id_t _id, bgfx_view_mode_t _mode);
BGFX_C_API void bgfx_set_view_frame_buffer(bgfx_view_id_t _id, bgfx_frame_buffer_handle_t _handle);
/**
- * Set view view and projection matrices, all draw primitives in this
- * view will use these matrices.
+ * Set view's view matrix and projection matrix,
+ * all draw primitives in this view will use these two matrices.
*
* @param[in] _id View id.
* @param[in] _view View matrix.
@@ -2343,7 +2363,7 @@ BGFX_C_API void bgfx_encoder_set_marker(bgfx_encoder_t* _this, const char* _mark
/**
* Set render states for draw primitive.
* @remarks
- * 1. To setup more complex states use:
+ * 1. To set up more complex states use:
* `BGFX_STATE_ALPHA_REF(_ref)`,
* `BGFX_STATE_POINT_SIZE(_size)`,
* `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -2436,7 +2456,7 @@ BGFX_C_API void bgfx_encoder_set_transform_cached(bgfx_encoder_t* _this, uint32_
/**
* Reserve matrices in internal matrix cache.
- * @attention Pointer returned can be modifed until `bgfx::frame` is called.
+ * @attention Pointer returned can be modified until `bgfx::frame` is called.
*
* @param[out] _transform Pointer to `Transform` structure.
* @param[in] _num Number of matrices.
@@ -2550,7 +2570,7 @@ BGFX_C_API void bgfx_encoder_set_transient_vertex_buffer(bgfx_encoder_t* _this,
BGFX_C_API void bgfx_encoder_set_transient_vertex_buffer_with_layout(bgfx_encoder_t* _this, uint8_t _stream, const bgfx_transient_vertex_buffer_t* _tvb, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
/**
- * Set number of vertices for auto generated vertices use in conjuction
+ * Set number of vertices for auto generated vertices use in conjunction
* with gl_VertexID.
* @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
*
@@ -2591,7 +2611,7 @@ BGFX_C_API void bgfx_encoder_set_instance_data_from_vertex_buffer(bgfx_encoder_t
BGFX_C_API void bgfx_encoder_set_instance_data_from_dynamic_vertex_buffer(bgfx_encoder_t* _this, bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _num);
/**
- * Set number of instances for auto generated instances use in conjuction
+ * Set number of instances for auto generated instances use in conjunction
* with gl_InstanceID.
* @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
*
@@ -2655,12 +2675,13 @@ BGFX_C_API void bgfx_encoder_submit_occlusion_query(bgfx_encoder_t* _this, bgfx_
/**
* Submit primitive for rendering with index and instance data info from
* indirect buffer.
+ * @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
*
* @param[in] _id View id.
* @param[in] _program Program.
* @param[in] _indirectHandle Indirect buffer.
* @param[in] _start First element in indirect buffer.
- * @param[in] _num Number of dispatches.
+ * @param[in] _num Number of draws.
* @param[in] _depth Depth for sorting.
* @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
*
@@ -2668,6 +2689,25 @@ BGFX_C_API void bgfx_encoder_submit_occlusion_query(bgfx_encoder_t* _this, bgfx_
BGFX_C_API void bgfx_encoder_submit_indirect(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, uint32_t _depth, uint8_t _flags);
/**
+ * Submit primitive for rendering with index and instance data info and
+ * draw count from indirect buffers.
+ * @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+ *
+ * @param[in] _id View id.
+ * @param[in] _program Program.
+ * @param[in] _indirectHandle Indirect buffer.
+ * @param[in] _start First element in indirect buffer.
+ * @param[in] _numHandle Buffer for number of draws. Must be
+ * created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
+ * @param[in] _numIndex Element in number buffer.
+ * @param[in] _numMax Max number of draws.
+ * @param[in] _depth Depth for sorting.
+ * @param[in] _flags Discard or preserve states. See `BGFX_DISCARD_*`.
+ *
+ */
+BGFX_C_API void bgfx_encoder_submit_indirect_count(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags);
+
+/**
* Set compute index buffer.
*
* @param[in] _stage Compute stage.
@@ -2894,7 +2934,7 @@ BGFX_C_API void bgfx_set_marker(const char* _marker);
/**
* Set render states for draw primitive.
* @remarks
- * 1. To setup more complex states use:
+ * 1. To set up more complex states use:
* `BGFX_STATE_ALPHA_REF(_ref)`,
* `BGFX_STATE_POINT_SIZE(_size)`,
* `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -2987,7 +3027,7 @@ BGFX_C_API void bgfx_set_transform_cached(uint32_t _cache, uint16_t _num);
/**
* Reserve matrices in internal matrix cache.
- * @attention Pointer returned can be modifed until `bgfx::frame` is called.
+ * @attention Pointer returned can be modified until `bgfx::frame` is called.
*
* @param[out] _transform Pointer to `Transform` structure.
* @param[in] _num Number of matrices.
@@ -3114,7 +3154,7 @@ BGFX_C_API void bgfx_set_transient_vertex_buffer(uint8_t _stream, const bgfx_tra
BGFX_C_API void bgfx_set_transient_vertex_buffer_with_layout(uint8_t _stream, const bgfx_transient_vertex_buffer_t* _tvb, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_layout_handle_t _layoutHandle);
/**
- * Set number of vertices for auto generated vertices use in conjuction
+ * Set number of vertices for auto generated vertices use in conjunction
* with gl_VertexID.
* @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
*
@@ -3155,7 +3195,7 @@ BGFX_C_API void bgfx_set_instance_data_from_vertex_buffer(bgfx_vertex_buffer_han
BGFX_C_API void bgfx_set_instance_data_from_dynamic_vertex_buffer(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _num);
/**
- * Set number of instances for auto generated instances use in conjuction
+ * Set number of instances for auto generated instances use in conjunction
* with gl_InstanceID.
* @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
*
@@ -3217,12 +3257,13 @@ BGFX_C_API void bgfx_submit_occlusion_query(bgfx_view_id_t _id, bgfx_program_han
/**
* Submit primitive for rendering with index and instance data info from
* indirect buffer.
+ * @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
*
* @param[in] _id View id.
* @param[in] _program Program.
* @param[in] _indirectHandle Indirect buffer.
* @param[in] _start First element in indirect buffer.
- * @param[in] _num Number of dispatches.
+ * @param[in] _num Number of draws.
* @param[in] _depth Depth for sorting.
* @param[in] _flags Which states to discard for next draw. See `BGFX_DISCARD_*`.
*
@@ -3230,6 +3271,25 @@ BGFX_C_API void bgfx_submit_occlusion_query(bgfx_view_id_t _id, bgfx_program_han
BGFX_C_API void bgfx_submit_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, uint32_t _depth, uint8_t _flags);
/**
+ * Submit primitive for rendering with index and instance data info and
+ * draw count from indirect buffers.
+ * @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+ *
+ * @param[in] _id View id.
+ * @param[in] _program Program.
+ * @param[in] _indirectHandle Indirect buffer.
+ * @param[in] _start First element in indirect buffer.
+ * @param[in] _numHandle Buffer for number of draws. Must be
+ * created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
+ * @param[in] _numIndex Element in number buffer.
+ * @param[in] _numMax Max number of draws.
+ * @param[in] _depth Depth for sorting.
+ * @param[in] _flags Which states to discard for next draw. See `BGFX_DISCARD_*`.
+ *
+ */
+BGFX_C_API void bgfx_submit_indirect_count(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags);
+
+/**
* Set compute index buffer.
*
* @param[in] _stage Compute stage.
@@ -3493,6 +3553,7 @@ typedef enum bgfx_function_id
BGFX_FUNCTION_ID_ENCODER_SUBMIT,
BGFX_FUNCTION_ID_ENCODER_SUBMIT_OCCLUSION_QUERY,
BGFX_FUNCTION_ID_ENCODER_SUBMIT_INDIRECT,
+ BGFX_FUNCTION_ID_ENCODER_SUBMIT_INDIRECT_COUNT,
BGFX_FUNCTION_ID_ENCODER_SET_COMPUTE_INDEX_BUFFER,
BGFX_FUNCTION_ID_ENCODER_SET_COMPUTE_VERTEX_BUFFER,
BGFX_FUNCTION_ID_ENCODER_SET_COMPUTE_DYNAMIC_INDEX_BUFFER,
@@ -3538,6 +3599,7 @@ typedef enum bgfx_function_id
BGFX_FUNCTION_ID_SUBMIT,
BGFX_FUNCTION_ID_SUBMIT_OCCLUSION_QUERY,
BGFX_FUNCTION_ID_SUBMIT_INDIRECT,
+ BGFX_FUNCTION_ID_SUBMIT_INDIRECT_COUNT,
BGFX_FUNCTION_ID_SET_COMPUTE_INDEX_BUFFER,
BGFX_FUNCTION_ID_SET_COMPUTE_VERTEX_BUFFER,
BGFX_FUNCTION_ID_SET_COMPUTE_DYNAMIC_INDEX_BUFFER,
@@ -3693,6 +3755,7 @@ struct bgfx_interface_vtbl
void (*encoder_submit)(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, uint32_t _depth, uint8_t _flags);
void (*encoder_submit_occlusion_query)(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint32_t _depth, uint8_t _flags);
void (*encoder_submit_indirect)(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, uint32_t _depth, uint8_t _flags);
+ void (*encoder_submit_indirect_count)(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags);
void (*encoder_set_compute_index_buffer)(bgfx_encoder_t* _this, uint8_t _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
void (*encoder_set_compute_vertex_buffer)(bgfx_encoder_t* _this, uint8_t _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
void (*encoder_set_compute_dynamic_index_buffer)(bgfx_encoder_t* _this, uint8_t _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
@@ -3738,6 +3801,7 @@ struct bgfx_interface_vtbl
void (*submit)(bgfx_view_id_t _id, bgfx_program_handle_t _program, uint32_t _depth, uint8_t _flags);
void (*submit_occlusion_query)(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_occlusion_query_handle_t _occlusionQuery, uint32_t _depth, uint8_t _flags);
void (*submit_indirect)(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, uint16_t _num, uint32_t _depth, uint8_t _flags);
+ void (*submit_indirect_count)(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags);
void (*set_compute_index_buffer)(uint8_t _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access);
void (*set_compute_vertex_buffer)(uint8_t _stage, bgfx_vertex_buffer_handle_t _handle, bgfx_access_t _access);
void (*set_compute_dynamic_index_buffer)(uint8_t _stage, bgfx_dynamic_index_buffer_handle_t _handle, bgfx_access_t _access);
diff --git a/3rdparty/bgfx/include/bgfx/defines.h b/3rdparty/bgfx/include/bgfx/defines.h
index 45a9c61de4c..c5f136b4e09 100644
--- a/3rdparty/bgfx/include/bgfx/defines.h
+++ b/3rdparty/bgfx/include/bgfx/defines.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -15,7 +15,7 @@
#ifndef BGFX_DEFINES_H_HEADER_GUARD
#define BGFX_DEFINES_H_HEADER_GUARD
-#define BGFX_API_VERSION UINT32_C(115)
+#define BGFX_API_VERSION UINT32_C(118)
/**
* Color RGB/alpha/depth write. When it's not specified write will be disabled.
@@ -275,7 +275,7 @@
#define BGFX_DEBUG_IFH UINT32_C(0x00000002)
#define BGFX_DEBUG_STATS UINT32_C(0x00000004) //!< Enable statistics display.
#define BGFX_DEBUG_TEXT UINT32_C(0x00000008) //!< Enable debug text display.
-#define BGFX_DEBUG_PROFILER UINT32_C(0x00000010) //!< Enable profiler.
+#define BGFX_DEBUG_PROFILER UINT32_C(0x00000010) //!< Enable profiler. This causes per-view statistics to be collected, available through `bgfx::Stats::ViewStats`. This is unrelated to the profiler functions in `bgfx::CallbackI`.
#define BGFX_BUFFER_COMPUTE_FORMAT_8X1 UINT16_C(0x0001) //!< 1 8-bit value
#define BGFX_BUFFER_COMPUTE_FORMAT_8X2 UINT16_C(0x0002) //!< 2 8-bit values
@@ -453,6 +453,7 @@
#define BGFX_RESET_HIDPI UINT32_C(0x00020000) //!< Enable HiDPI rendering.
#define BGFX_RESET_DEPTH_CLAMP UINT32_C(0x00040000) //!< Enable depth clamp.
#define BGFX_RESET_SUSPEND UINT32_C(0x00080000) //!< Suspend rendering.
+#define BGFX_RESET_TRANSPARENT_BACKBUFFER UINT32_C(0x00100000) //!< Transparent backbuffer. Availability depends on: `BGFX_CAPS_TRANSPARENT_BACKBUFFER`.
#define BGFX_RESET_FULLSCREEN_SHIFT 0
@@ -480,15 +481,17 @@
#define BGFX_CAPS_TEXTURE_2D_ARRAY UINT64_C(0x0000000000010000) //!< 2D texture array is supported.
#define BGFX_CAPS_TEXTURE_3D UINT64_C(0x0000000000020000) //!< 3D textures are supported.
#define BGFX_CAPS_TEXTURE_BLIT UINT64_C(0x0000000000040000) //!< Texture blit is supported.
-#define BGFX_CAPS_TEXTURE_COMPARE_RESERVED UINT64_C(0x0000000000080000)
-#define BGFX_CAPS_TEXTURE_COMPARE_LEQUAL UINT64_C(0x0000000000100000) //!< Texture compare less equal mode is supported.
-#define BGFX_CAPS_TEXTURE_CUBE_ARRAY UINT64_C(0x0000000000200000) //!< Cubemap texture array is supported.
-#define BGFX_CAPS_TEXTURE_DIRECT_ACCESS UINT64_C(0x0000000000400000) //!< CPU direct access to GPU texture memory.
-#define BGFX_CAPS_TEXTURE_READ_BACK UINT64_C(0x0000000000800000) //!< Read-back texture is supported.
-#define BGFX_CAPS_VERTEX_ATTRIB_HALF UINT64_C(0x0000000001000000) //!< Vertex attribute half-float is supported.
-#define BGFX_CAPS_VERTEX_ATTRIB_UINT10 UINT64_C(0x0000000002000000) //!< Vertex attribute 10_10_10_2 is supported.
-#define BGFX_CAPS_VERTEX_ID UINT64_C(0x0000000004000000) //!< Rendering with VertexID only is supported.
-#define BGFX_CAPS_VIEWPORT_LAYER_ARRAY UINT64_C(0x0000000008000000) //!< Viewport layer is available in vertex shader.
+#define BGFX_CAPS_TRANSPARENT_BACKBUFFER UINT64_C(0x0000000000080000) //!< Transparent back buffer supported.
+#define BGFX_CAPS_TEXTURE_COMPARE_RESERVED UINT64_C(0x0000000000100000)
+#define BGFX_CAPS_TEXTURE_COMPARE_LEQUAL UINT64_C(0x0000000000200000) //!< Texture compare less equal mode is supported.
+#define BGFX_CAPS_TEXTURE_CUBE_ARRAY UINT64_C(0x0000000000400000) //!< Cubemap texture array is supported.
+#define BGFX_CAPS_TEXTURE_DIRECT_ACCESS UINT64_C(0x0000000000800000) //!< CPU direct access to GPU texture memory.
+#define BGFX_CAPS_TEXTURE_READ_BACK UINT64_C(0x0000000001000000) //!< Read-back texture is supported.
+#define BGFX_CAPS_VERTEX_ATTRIB_HALF UINT64_C(0x0000000002000000) //!< Vertex attribute half-float is supported.
+#define BGFX_CAPS_VERTEX_ATTRIB_UINT10 UINT64_C(0x0000000004000000) //!< Vertex attribute 10_10_10_2 is supported.
+#define BGFX_CAPS_VERTEX_ID UINT64_C(0x0000000008000000) //!< Rendering with VertexID only is supported.
+#define BGFX_CAPS_VIEWPORT_LAYER_ARRAY UINT64_C(0x0000000010000000) //!< Viewport layer is available in vertex shader.
+#define BGFX_CAPS_DRAW_INDIRECT_COUNT UINT64_C(0x0000000020000000) //!< Draw indirect with indirect count is supported.
/// All texture compare modes are supported.
#define BGFX_CAPS_TEXTURE_COMPARE_ALL (0 \
| BGFX_CAPS_TEXTURE_COMPARE_RESERVED \
@@ -520,8 +523,11 @@
#define BGFX_PCI_ID_NONE UINT16_C(0x0000) //!< Autoselect adapter.
#define BGFX_PCI_ID_SOFTWARE_RASTERIZER UINT16_C(0x0001) //!< Software rasterizer.
#define BGFX_PCI_ID_AMD UINT16_C(0x1002) //!< AMD adapter.
+#define BGFX_PCI_ID_APPLE UINT16_C(0x106b) //!< Apple adapter.
#define BGFX_PCI_ID_INTEL UINT16_C(0x8086) //!< Intel adapter.
#define BGFX_PCI_ID_NVIDIA UINT16_C(0x10de) //!< nVidia adapter.
+#define BGFX_PCI_ID_MICROSOFT UINT16_C(0x1414) //!< Microsoft adapter.
+#define BGFX_PCI_ID_ARM UINT16_C(0x13b5) //!< ARM adapter.
#define BGFX_CUBE_MAP_POSITIVE_X UINT8_C(0x00) //!< Cubemap +x.
#define BGFX_CUBE_MAP_NEGATIVE_X UINT8_C(0x01) //!< Cubemap -x.
diff --git a/3rdparty/bgfx/include/bgfx/embedded_shader.h b/3rdparty/bgfx/include/bgfx/embedded_shader.h
index fa5bc20749a..c4ddca0c3b4 100644
--- a/3rdparty/bgfx/include/bgfx/embedded_shader.h
+++ b/3rdparty/bgfx/include/bgfx/embedded_shader.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
@@ -19,9 +19,11 @@
#define BGFX_EMBEDDED_SHADER_SPIRV(...)
#define BGFX_PLATFORM_SUPPORTS_DX9BC (0 \
+ || BX_PLATFORM_LINUX \
|| BX_PLATFORM_WINDOWS \
)
#define BGFX_PLATFORM_SUPPORTS_DXBC (0 \
+ || BX_PLATFORM_LINUX \
|| BX_PLATFORM_WINDOWS \
|| BX_PLATFORM_WINRT \
|| BX_PLATFORM_XBOXONE \
diff --git a/3rdparty/bgfx/include/bgfx/platform.h b/3rdparty/bgfx/include/bgfx/platform.h
index b6b6b44b85c..dfce6c94311 100644
--- a/3rdparty/bgfx/include/bgfx/platform.h
+++ b/3rdparty/bgfx/include/bgfx/platform.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
@@ -10,14 +10,13 @@
// This header file contains platform specific interfaces. It is only
// necessary to use this header in conjunction with creating windows.
-#include <bx/platform.h>
#include "bgfx.h"
namespace bgfx
{
/// Render frame enum.
///
- /// @attention C99 equivalent is `bgfx_render_frame_t`.
+ /// @attention C99's equivalent binding is `bgfx_render_frame_t`.
///
struct RenderFrame
{
@@ -47,7 +46,7 @@ namespace bgfx
/// allow creating separate rendering thread. If it is called before
/// to bgfx::init, render thread won't be created by bgfx::init call.
///
- /// @attention C99 equivalent is `bgfx_render_frame`.
+ /// @attention C99's equivalent binding is `bgfx_render_frame`.
///
RenderFrame::Enum renderFrame(int32_t _msecs = -1);
@@ -55,13 +54,13 @@ namespace bgfx
///
/// @warning Must be called before `bgfx::init`.
///
- /// @attention C99 equivalent is `bgfx_set_platform_data`.
+ /// @attention C99's equivalent binding is `bgfx_set_platform_data`.
///
void setPlatformData(const PlatformData& _data);
/// Internal data.
///
- /// @attention C99 equivalent is `bgfx_internal_data_t`.
+ /// @attention C99's equivalent binding is `bgfx_internal_data_t`.
///
struct InternalData
{
@@ -76,7 +75,7 @@ namespace bgfx
///
/// @warning Must be called only on render thread.
///
- /// @attention C99 equivalent is `bgfx_get_internal_data`.
+ /// @attention C99's equivalent binding is `bgfx_get_internal_data`.
///
const InternalData* getInternalData();
@@ -94,7 +93,7 @@ namespace bgfx
///
/// @warning Must be called only on render thread.
///
- /// @attention C99 equivalent is `bgfx_override_internal_texture_ptr`.
+ /// @attention C99's equivalent binding is `bgfx_override_internal_texture_ptr`.
///
uintptr_t overrideInternal(TextureHandle _handle, uintptr_t _ptr);
@@ -121,7 +120,7 @@ namespace bgfx
///
/// @warning Must be called only on render thread.
///
- /// @attention C99 equivalent is `bgfx_override_internal_texture`.
+ /// @attention C99's equivalent binding is `bgfx_override_internal_texture`.
///
uintptr_t overrideInternal(
TextureHandle _handle
diff --git a/3rdparty/bgfx/makefile b/3rdparty/bgfx/makefile
index 667852910c2..d95106b1eb4 100644
--- a/3rdparty/bgfx/makefile
+++ b/3rdparty/bgfx/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
UNAME := $(shell uname)
@@ -49,9 +49,10 @@ projgen: ## Generate project files for all configurations.
$(GENIE) --with-tools --with-combined-examples --with-shared-lib --xcode=osx xcode9
$(GENIE) --with-tools --with-combined-examples --with-shared-lib --xcode=ios xcode9
$(GENIE) --with-combined-examples --with-shared-lib --gcc=freebsd gmake
- $(GENIE) --with-combined-examples --gcc=android-arm gmake
- $(GENIE) --with-combined-examples --gcc=android-arm64 gmake
- $(GENIE) --with-combined-examples --gcc=android-x86 gmake
+ $(GENIE) --with-combined-examples --with-shared-lib --gcc=android-arm gmake
+ $(GENIE) --with-combined-examples --with-shared-lib --gcc=android-arm64 gmake
+ $(GENIE) --with-combined-examples --with-shared-lib --gcc=android-x86 gmake
+ $(GENIE) --with-combined-examples --with-shared-lib --gcc=android-x86_64 gmake
$(GENIE) --with-examples --gcc=wasm2js gmake
$(GENIE) --with-combined-examples --gcc=ios-arm gmake
$(GENIE) --with-combined-examples --gcc=ios-arm64 gmake
@@ -64,7 +65,7 @@ idl: ## Generate code from IDL.
cd scripts && ../$(GENIE) idl
.build/projects/gmake-android-arm:
- $(GENIE) --gcc=android-arm gmake
+ $(GENIE) --gcc=android-arm --with-combined-examples --with-shared-lib gmake
android-arm-debug: .build/projects/gmake-android-arm ## Build - Android ARM Debug
$(MAKE) -R -C .build/projects/gmake-android-arm config=debug
android-arm-release: .build/projects/gmake-android-arm ## Build - Android ARM Release
@@ -72,7 +73,7 @@ android-arm-release: .build/projects/gmake-android-arm ## Build - Android ARM Re
android-arm: android-arm-debug android-arm-release ## Build - Android ARM Debug and Release
.build/projects/gmake-android-arm64:
- $(GENIE) --gcc=android-arm64 gmake
+ $(GENIE) --gcc=android-arm64 --with-combined-examples --with-shared-lib gmake
android-arm64-debug: .build/projects/gmake-android-arm64 ## Build - Android ARM64 Debug
$(MAKE) -R -C .build/projects/gmake-android-arm64 config=debug
android-arm64-release: .build/projects/gmake-android-arm64 ## Build - Android ARM64 Release
@@ -80,13 +81,21 @@ android-arm64-release: .build/projects/gmake-android-arm64 ## Build - Android AR
android-arm64: android-arm64-debug android-arm64-release ## Build - Android ARM64 Debug and Release
.build/projects/gmake-android-x86:
- $(GENIE) --gcc=android-x86 gmake
+ $(GENIE) --gcc=android-x86 --with-combined-examples --with-shared-lib gmake
android-x86-debug: .build/projects/gmake-android-x86 ## Build - Android x86 Debug and Release
$(MAKE) -R -C .build/projects/gmake-android-x86 config=debug
android-x86-release: .build/projects/gmake-android-x86 ## Build - Android x86 Debug and Release
$(MAKE) -R -C .build/projects/gmake-android-x86 config=release
android-x86: android-x86-debug android-x86-release ## Build - Android x86 Debug and Release
+.build/projects/gmake-android-x86_64:
+ $(GENIE) --gcc=android-x86_64 --with-combined-examples --with-shared-lib gmake
+android-x86_64-debug: .build/projects/gmake-android-x86_64 ## Build - Android x86_64 Debug and Release
+ $(MAKE) -R -C .build/projects/gmake-android-x86_64 config=debug
+android-x86_64-release: .build/projects/gmake-android-x86_64 ## Build - Android x86_64 Debug and Release
+ $(MAKE) -R -C .build/projects/gmake-android-x86_64 config=release
+android-x86_64: android-x86_64-debug android-x86_64-release ## Build - Android x86_64 Debug and Release
+
.build/projects/gmake-wasm2js: # Wasm2JS: The JavaScript fallback for web builds when Wasm is not supported by browser
$(GENIE) --gcc=wasm2js --with-combined-examples gmake
wasm2js-debug: .build/projects/gmake-wasm2js ## Build - Emscripten Debug
@@ -136,7 +145,7 @@ mingw-gcc-release64: .build/projects/gmake-mingw-gcc ## Build - MinGW GCC x64 Re
mingw-gcc: mingw-gcc-debug32 mingw-gcc-release32 mingw-gcc-debug64 mingw-gcc-release64 ## Build - MinGW GCC x86/x64 Debug and Release
.build/projects/gmake-mingw-clang:
- $(GENIE) --gcc=mingw-clang gmake
+ $(GENIE) --with-tools --with-combined-examples --with-shared-lib --os=windows --gcc=mingw-clang gmake
mingw-clang-debug32: .build/projects/gmake-mingw-clang ## Build - MinGW Clang x86 Debug
$(MAKE) -R -C .build/projects/gmake-mingw-clang config=debug32
mingw-clang-release32: .build/projects/gmake-mingw-clang ## Build - MinGW Clang x86 Release
@@ -190,7 +199,7 @@ osx-arm64-debug: .build/projects/gmake-osx-arm64 ## Build - macOS ARM Debug
$(MAKE) -C .build/projects/gmake-osx-arm64 config=debug
osx-arm64-release: .build/projects/gmake-osx-arm64 ## Build - macOS ARM Release
$(MAKE) -C .build/projects/gmake-osx-arm64 config=release
-osx-arm: osx-arm64-debug osx-arm64-release ## Build - macOS ARM Debug and Release
+osx-arm64: osx-arm64-debug osx-arm64-release ## Build - macOS ARM Debug and Release
.build/projects/gmake-ios-arm:
$(GENIE) --gcc=ios-arm gmake
diff --git a/3rdparty/bgfx/scripts/bgfx.idl b/3rdparty/bgfx/scripts/bgfx.idl
index 54647f6a66e..a0d9428c6c2 100644
--- a/3rdparty/bgfx/scripts/bgfx.idl
+++ b/3rdparty/bgfx/scripts/bgfx.idl
@@ -1,7 +1,7 @@
-- vim: syntax=lua
-- bgfx interface
-version(115)
+version(118)
typedef "bool"
typedef "char"
@@ -219,7 +219,7 @@ flag.Debug { bits = 32 }
--- It's useful when profiling to quickly assess bottleneck between CPU and GPU.
.Stats --- Enable statistics display.
.Text --- Enable debug text display.
- .Profiler --- Enable profiler.
+ .Profiler --- Enable profiler. This causes per-view statistics to be collected, available through `bgfx::Stats::ViewStats`. This is unrelated to the profiler functions in `bgfx::CallbackI`.
()
flag.BufferComputeFormat { bits = 16, shift = 0, range = 4, base = 1 }
@@ -343,19 +343,20 @@ flag.ResetMsaa { bits = 32, shift = 4, range = 3, base = 1 }
()
flag.Reset { bits = 32 }
- .None ( 0) --- No reset flags.
- .Fullscreen ( 1) --- Not supported yet.
- .Vsync ( 8) --- Enable V-Sync.
- .Maxanisotropy ( 9) --- Turn on/off max anisotropy.
- .Capture (10) --- Begin screen capture.
- .FlushAfterRender (14) --- Flush rendering after submitting to GPU.
- .FlipAfterRender (15) --- This flag specifies where flip occurs. Default behaviour is that flip occurs
- --- before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
- .SrgbBackbuffer (16) --- Enable sRGB backbuffer.
- .Hdr10 (17) --- Enable HDR10 rendering.
- .Hidpi (18) --- Enable HiDPI rendering.
- .DepthClamp (19) --- Enable depth clamp.
- .Suspend (20) --- Suspend rendering.
+ .None ( 0) --- No reset flags.
+ .Fullscreen ( 1) --- Not supported yet.
+ .Vsync ( 8) --- Enable V-Sync.
+ .Maxanisotropy ( 9) --- Turn on/off max anisotropy.
+ .Capture (10) --- Begin screen capture.
+ .FlushAfterRender (14) --- Flush rendering after submitting to GPU.
+ .FlipAfterRender (15) --- This flag specifies where flip occurs. Default behaviour is that flip occurs
+ --- before rendering new frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
+ .SrgbBackbuffer (16) --- Enable sRGB backbuffer.
+ .Hdr10 (17) --- Enable HDR10 rendering.
+ .Hidpi (18) --- Enable HiDPI rendering.
+ .DepthClamp (19) --- Enable depth clamp.
+ .Suspend (20) --- Suspend rendering.
+ .TransparentBackbuffer (21) --- Transparent backbuffer. Availability depends on: `BGFX_CAPS_TRANSPARENT_BACKBUFFER`.
()
flag.ResetFullscreen { bits = 32, shift = 0, range = 1, base = 1 }
@@ -383,6 +384,7 @@ flag.Caps { bits = 64, base = 1, name = "Caps" }
.Texture_2dArray --- 2D texture array is supported.
.Texture_3d --- 3D textures are supported.
.TextureBlit --- Texture blit is supported.
+ .TransparentBackbuffer --- Transparent back buffer supported.
.TextureCompareReserved
.TextureCompareLequal --- Texture compare less equal mode is supported.
.TextureCubeArray --- Cubemap texture array is supported.
@@ -392,6 +394,7 @@ flag.Caps { bits = 64, base = 1, name = "Caps" }
.VertexAttribUint10 --- Vertex attribute 10_10_10_2 is supported.
.VertexId --- Rendering with VertexID only is supported.
.ViewportLayerArray --- Viewport layer is available in vertex shader.
+ .DrawIndirectCount --- Draw indirect with indirect count is supported.
.TextureCompareAll --- All texture compare modes are supported.
{ "TextureCompareReserved", "TextureCompareLequal" }
()
@@ -425,8 +428,11 @@ flag.PciId { bits = 16 , const }
.None (0x0000) --- Autoselect adapter.
.SoftwareRasterizer (0x0001) --- Software rasterizer.
.Amd (0x1002) --- AMD adapter.
+ .Apple (0x106b) --- Apple adapter.
.Intel (0x8086) --- Intel adapter.
.Nvidia (0x10de) --- nVidia adapter.
+ .Microsoft (0x1414) --- Microsoft adapter.
+ .Arm (0x13b5) --- ARM adapter.
()
flag.CubeMap { bits = 8, const }
@@ -517,33 +523,41 @@ enum.AttribType { comment = "Attribute types:" }
---
--- @attention Availability depends on Caps (see: formats).
enum.TextureFormat { comment = "Texture formats:" }
- .BC1 --- DXT1 R5G6B5A1
- .BC2 --- DXT3 R5G6B5A4
- .BC3 --- DXT5 R5G6B5A8
- .BC4 --- LATC1/ATI1 R8
- .BC5 --- LATC2/ATI2 RG8
- .BC6H --- BC6H RGB16F
- .BC7 --- BC7 RGB 4-7 bits per color channel, 0-8 bits alpha
- .ETC1 --- ETC1 RGB8
- .ETC2 --- ETC2 RGB8
- .ETC2A --- ETC2 RGBA8
- .ETC2A1 --- ETC2 RGB8A1
- .PTC12 --- PVRTC1 RGB 2BPP
- .PTC14 --- PVRTC1 RGB 4BPP
- .PTC12A --- PVRTC1 RGBA 2BPP
- .PTC14A --- PVRTC1 RGBA 4BPP
- .PTC22 --- PVRTC2 RGBA 2BPP
- .PTC24 --- PVRTC2 RGBA 4BPP
- .ATC --- ATC RGB 4BPP
- .ATCE --- ATCE RGBA 8 BPP explicit alpha
- .ATCI --- ATCI RGBA 8 BPP interpolated alpha
- .ASTC4x4 --- ASTC 4x4 8.0 BPP
- .ASTC5x5 --- ASTC 5x5 5.12 BPP
- .ASTC6x6 --- ASTC 6x6 3.56 BPP
- .ASTC8x5 --- ASTC 8x5 3.20 BPP
- .ASTC8x6 --- ASTC 8x6 2.67 BPP
- .ASTC10x5 --- ASTC 10x5 2.56 BPP
- .Unknown --- Compressed formats above.
+ .BC1 --- DXT1 R5G6B5A1
+ .BC2 --- DXT3 R5G6B5A4
+ .BC3 --- DXT5 R5G6B5A8
+ .BC4 --- LATC1/ATI1 R8
+ .BC5 --- LATC2/ATI2 RG8
+ .BC6H --- BC6H RGB16F
+ .BC7 --- BC7 RGB 4-7 bits per color channel, 0-8 bits alpha
+ .ETC1 --- ETC1 RGB8
+ .ETC2 --- ETC2 RGB8
+ .ETC2A --- ETC2 RGBA8
+ .ETC2A1 --- ETC2 RGB8A1
+ .PTC12 --- PVRTC1 RGB 2BPP
+ .PTC14 --- PVRTC1 RGB 4BPP
+ .PTC12A --- PVRTC1 RGBA 2BPP
+ .PTC14A --- PVRTC1 RGBA 4BPP
+ .PTC22 --- PVRTC2 RGBA 2BPP
+ .PTC24 --- PVRTC2 RGBA 4BPP
+ .ATC --- ATC RGB 4BPP
+ .ATCE --- ATCE RGBA 8 BPP explicit alpha
+ .ATCI --- ATCI RGBA 8 BPP interpolated alpha
+ .ASTC4x4 --- ASTC 4x4 8.0 BPP
+ .ASTC5x4 --- ASTC 5x4 6.40 BPP
+ .ASTC5x5 --- ASTC 5x5 5.12 BPP
+ .ASTC6x5 --- ASTC 6x5 4.27 BPP
+ .ASTC6x6 --- ASTC 6x6 3.56 BPP
+ .ASTC8x5 --- ASTC 8x5 3.20 BPP
+ .ASTC8x6 --- ASTC 8x6 2.67 BPP
+ .ASTC8x8 --- ASTC 8x8 2.00 BPP
+ .ASTC10x5 --- ASTC 10x5 2.56 BPP
+ .ASTC10x6 --- ASTC 10x6 2.13 BPP
+ .ASTC10x8 --- ASTC 10x8 1.60 BPP
+ .ASTC10x10 --- ASTC 10x10 1.28 BPP
+ .ASTC12x10 --- ASTC 12x10 1.07 BPP
+ .ASTC12x12 --- ASTC 12x12 0.89 BPP
+ .Unknown --- Compressed formats above.
.R1
.A8
.R8
@@ -588,8 +602,11 @@ enum.TextureFormat { comment = "Texture formats:" }
.RGBA32I
.RGBA32U
.RGBA32F
+ .B5G6R5
.R5G6B5
+ .BGRA4
.RGBA4
+ .BGR5A1
.RGB5A1
.RGB10A2
.RG11B10F
@@ -757,12 +774,13 @@ struct.InternalData
--- Platform data.
struct.PlatformData { ctor }
.ndt "void*" --- Native display type (*nix specific).
- .nwh "void*" --- Native window handle. If `NULL` bgfx will create headless
- --- context/device if renderer API supports it.
- .context "void*" --- GL context, or D3D device. If `NULL`, bgfx will create context/device.
+ .nwh "void*" --- Native window handle. If `NULL`, bgfx will create a headless
+ --- context/device, provided the rendering API supports it.
+ .context "void*" --- GL context, D3D device, or Vulkan device. If `NULL`, bgfx
+ --- will create context/device.
.backBuffer "void*" --- GL back-buffer, or D3D render target view. If `NULL` bgfx will
--- create back-buffer color surface.
- .backBufferDS "void*" --- Backbuffer depth/stencil. If `NULL` bgfx will create back-buffer
+ .backBufferDS "void*" --- Backbuffer depth/stencil. If `NULL`, bgfx will create a back-buffer
--- depth/stencil surface.
--- Backbuffer resolution and reset parameters.
@@ -787,18 +805,20 @@ struct.Init { ctor }
--- a default rendering backend will be selected appropriate to the platform.
--- See: `bgfx::RendererType`
- .vendorId "uint16_t" --- Vendor PCI id. If set to `BGFX_PCI_ID_NONE` it will select the first
- --- device.
+ .vendorId "uint16_t" --- Vendor PCI ID. If set to `BGFX_PCI_ID_NONE`, discrete and integrated
+ --- GPUs will be prioritised.
--- - `BGFX_PCI_ID_NONE` - Autoselect adapter.
--- - `BGFX_PCI_ID_SOFTWARE_RASTERIZER` - Software rasterizer.
--- - `BGFX_PCI_ID_AMD` - AMD adapter.
+ --- - `BGFX_PCI_ID_APPLE` - Apple adapter.
--- - `BGFX_PCI_ID_INTEL` - Intel adapter.
- --- - `BGFX_PCI_ID_NVIDIA` - nVidia adapter.
+ --- - `BGFX_PCI_ID_NVIDIA` - NVIDIA adapter.
+ --- - `BGFX_PCI_ID_MICROSOFT` - Microsoft adapter.
- .deviceId "uint16_t" --- Device id. If set to 0 it will select first device, or device with
- --- matching id.
+ .deviceId "uint16_t" --- Device ID. If set to 0 it will select first device, or device with
+ --- matching ID.
.capabilities "uint64_t" --- Capabilities initialization mask (default: UINT64_MAX).
- .debug "bool" --- Enable device for debuging.
+ .debug "bool" --- Enable device for debugging.
.profile "bool" --- Enable device for profiling.
.platformData "PlatformData" --- Platform data.
.resolution "Resolution" --- Backbuffer resolution and reset parameters. See: `bgfx::Resolution`.
@@ -898,6 +918,7 @@ struct.ViewStats
.cpuTimeEnd "int64_t" --- CPU (submit) end time.
.gpuTimeBegin "int64_t" --- GPU begin time.
.gpuTimeEnd "int64_t" --- GPU end time.
+ .gpuFrameNum "uint32_t" --- Frame which generated gpuTimeBegin, gpuTimeEnd.
--- Encoder stats.
struct.EncoderStats
@@ -925,6 +946,7 @@ struct.Stats
.numCompute "uint32_t" --- Number of compute calls submitted.
.numBlit "uint32_t" --- Number of blit calls submitted.
.maxGpuLatency "uint32_t" --- GPU driver latency.
+ .gpuFrameNum "uint32_t" --- Frame which generated gpuTimeBegin, gpuTimeEnd.
.numDynamicIndexBuffers "uint16_t" --- Number of used dynamic index buffers.
.numDynamicVertexBuffers "uint16_t" --- Number of used dynamic vertex buffers.
@@ -1135,7 +1157,7 @@ func.initCtor { cfunc }
"void"
.init "Init*"
---- Initialize bgfx library.
+--- Initialize the bgfx library.
func.init { cfunc }
"bool" --- `true` if initialization was successful.
.init "const Init &" --- Initialization parameters. See: `bgfx::Init` for more info.
@@ -1146,8 +1168,8 @@ func.shutdown
--- Reset graphic settings and back-buffer size.
---
---- @attention This call doesn't actually change window size, it just
---- resizes back-buffer. Windowing code has to change window size.
+--- @attention This call doesn’t change the window size, it just resizes
+--- the back-buffer. Your windowing code controls the window size.
---
func.reset
"void"
@@ -1164,7 +1186,7 @@ func.reset
--- - `BGFX_RESET_FLIP_AFTER_RENDER` - This flag specifies where flip
--- occurs. Default behaviour is that flip occurs before rendering new
--- frame. This flag only has effect when `BGFX_CONFIG_MULTITHREADED=0`.
- --- - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB backbuffer.
+ --- - `BGFX_RESET_SRGB_BACKBUFFER` - Enable sRGB back-buffer.
.format "TextureFormat::Enum" --- Texture format. See: `TextureFormat::Enum`.
{ default = "TextureFormat::Count" }
@@ -1380,7 +1402,7 @@ func.createDynamicIndexBuffer
--- - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on
--- index buffers.
---- Create dynamic index buffer and initialized it.
+--- Create a dynamic index buffer and initialize it.
func.createDynamicIndexBuffer { cname = "create_dynamic_index_buffer_mem" }
"DynamicIndexBufferHandle" --- Dynamic index buffer handle.
.mem "const Memory*" --- Index buffer data.
@@ -1480,8 +1502,8 @@ func.getAvailInstanceDataBuffer
---
func.allocTransientIndexBuffer
"void"
- .tib "TransientIndexBuffer*" { out } --- TransientIndexBuffer structure is filled and is valid
- --- for the duration of frame, and it can be reused for multiple draw
+ .tib "TransientIndexBuffer*" { out } --- TransientIndexBuffer structure will be filled, and will be valid
+ --- for the duration of frame, and can be reused for multiple draw
--- calls.
.num "uint32_t" --- Number of indices to allocate.
.index32 "bool" --- Set to `true` if input indices will be 32-bit.
@@ -1490,8 +1512,8 @@ func.allocTransientIndexBuffer
--- Allocate transient vertex buffer.
func.allocTransientVertexBuffer
"void"
- .tvb "TransientVertexBuffer*" { out } --- TransientVertexBuffer structure is filled and is valid
- --- for the duration of frame, and it can be reused for multiple draw
+ .tvb "TransientVertexBuffer*" { out } --- TransientVertexBuffer structure will be filled, and will be valid
+ --- for the duration of frame, and can be reused for multiple draw
--- calls.
.num "uint32_t" --- Number of vertices to allocate.
.layout "const VertexLayout &" --- Vertex layout.
@@ -1502,13 +1524,13 @@ func.allocTransientVertexBuffer
---
func.allocTransientBuffers
"bool"
- .tvb "TransientVertexBuffer*" { out } --- TransientVertexBuffer structure is filled and is valid
- --- for the duration of frame, and it can be reused for multiple draw
+ .tvb "TransientVertexBuffer*" { out } --- TransientVertexBuffer structure will be filled, and will be valid
+ --- for the duration of frame, and can be reused for multiple draw
--- calls.
.layout "const VertexLayout &" --- Vertex layout.
.numVertices "uint32_t" --- Number of vertices to allocate.
- .tib "TransientIndexBuffer*" { out } --- TransientIndexBuffer structure is filled and is valid
- --- for the duration of frame, and it can be reused for multiple draw
+ .tib "TransientIndexBuffer*" { out } --- TransientIndexBuffer structure will be filled, and will be valid
+ --- for the duration of frame, and can be reused for multiple draw
--- calls.
.numIndices "uint32_t" --- Number of indices to allocate.
.index32 "bool" --- Set to `true` if input indices will be 32-bit.
@@ -1517,8 +1539,8 @@ func.allocTransientBuffers
--- Allocate instance data buffer.
func.allocInstanceDataBuffer
"void"
- .idb "InstanceDataBuffer*" { out } --- InstanceDataBuffer structure is filled and is valid
- --- for duration of frame, and it can be reused for multiple draw
+ .idb "InstanceDataBuffer*" { out } --- InstanceDataBuffer structure will be filled, and will be valid
+ --- for duration of frame, and can be reused for multiple draw
--- calls.
.num "uint32_t" --- Number of instances.
.stride "uint16_t" --- Instance stride. Must be multiple of 16.
@@ -1591,7 +1613,7 @@ func.destroy { cname = "destroy_program" }
--- Validate texture parameters.
func.isTextureValid
- "bool" --- True if texture can be successfully created.
+ "bool" --- True if a texture with the same parameters can be created.
.depth "uint16_t" --- Depth dimension of volume texture.
.cubeMap "bool" --- Indicates that texture contains cubemap.
.numLayers "uint16_t" --- Number of layers in texture array.
@@ -1600,7 +1622,7 @@ func.isTextureValid
--- Validate frame buffer parameters.
func.isFrameBufferValid
- "bool" --- True if frame buffer can be successfully created.
+ "bool" --- True if a frame buffer with the same parameters can be created.
.num "uint8_t" --- Number of attachments.
.attachment "const Attachment*" --- Attachment texture info. See: `bgfx::Attachment`.
@@ -1650,7 +1672,7 @@ func.createTexture2D
{ default = NULL } --- `_mem` is NULL content of the texture is uninitialized. When `_numLayers` is more than
--- 1, expected memory layout is texture and all mips together for each array element.
---- Create texture with size based on backbuffer ratio. Texture will maintain ratio
+--- Create texture with size based on back-buffer ratio. Texture will maintain ratio
--- if back buffer resolution changes.
func.createTexture2D { cname = "create_texture_2d_scaled" }
"TextureHandle" --- Texture handle.
@@ -1827,7 +1849,7 @@ func.createFrameBuffer
--- - `BGFX_SAMPLER_[MIN/MAG/MIP]_[POINT/ANISOTROPIC]` - Point or anisotropic
--- sampling.
---- Create frame buffer with size based on backbuffer ratio. Frame buffer will maintain ratio
+--- Create frame buffer with size based on back-buffer ratio. Frame buffer will maintain ratio
--- if back buffer resolution changes.
func.createFrameBuffer { cname = "create_frame_buffer_scaled" }
"FrameBufferHandle" --- Frame buffer handle.
@@ -2032,8 +2054,8 @@ func.setViewClear
{ default = 0 }
--- Set view clear flags with different clear color for each
---- frame buffer texture. Must use `bgfx::setPaletteColor` to setup clear color
---- palette.
+--- frame buffer texture. `bgfx::setPaletteColor` must be used to set up a
+--- clear color palette.
func.setViewClear { cname = "set_view_clear_mrt" }
"void"
.id "ViewId" --- View id.
@@ -2081,8 +2103,8 @@ func.setViewFrameBuffer
--- frame buffer handle will draw primitives from this view into
--- default back buffer.
---- Set view view and projection matrices, all draw primitives in this
---- view will use these matrices.
+--- Set view's view matrix and projection matrix,
+--- all draw primitives in this view will use these two matrices.
func.setViewTransform
"void"
.id "ViewId" --- View id.
@@ -2124,7 +2146,7 @@ func.Encoder.setMarker
--- Set render states for draw primitive.
---
--- @remarks
---- 1. To setup more complex states use:
+--- 1. To set up more complex states use:
--- `BGFX_STATE_ALPHA_REF(_ref)`,
--- `BGFX_STATE_POINT_SIZE(_size)`,
--- `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -2202,7 +2224,7 @@ func.Encoder.setTransform { cname = "set_transform_cached" }
--- Reserve matrices in internal matrix cache.
---
---- @attention Pointer returned can be modifed until `bgfx::frame` is called.
+--- @attention Pointer returned can be modified until `bgfx::frame` is called.
---
func.Encoder.allocTransform
"uint32_t" --- Index in matrix cache.
@@ -2331,7 +2353,7 @@ func.Encoder.setVertexBuffer { cname = "set_transient_vertex_buffer_with_layout"
--- of vertex buffer will be used.
{ default = "BGFX_INVALID_HANDLE" }
---- Set number of vertices for auto generated vertices use in conjuction
+--- Set number of vertices for auto generated vertices use in conjunction
--- with gl_VertexID.
---
--- @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
@@ -2376,7 +2398,7 @@ func.Encoder.setInstanceDataBuffer { cname = "set_instance_data_from_dynamic_ver
.startVertex "uint32_t" --- First instance data.
.num "uint32_t" --- Number of data instances.
---- Set number of instances for auto generated instances use in conjuction
+--- Set number of instances for auto generated instances use in conjunction
--- with gl_InstanceID.
---
--- @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
@@ -2433,6 +2455,9 @@ func.Encoder.submit { cname = "submit_occlusion_query" }
--- Submit primitive for rendering with index and instance data info from
--- indirect buffer.
+---
+--- @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
+---
func.Encoder.submit { cname = "submit_indirect" }
"void"
.id "ViewId" --- View id.
@@ -2440,13 +2465,35 @@ func.Encoder.submit { cname = "submit_indirect" }
.indirectHandle "IndirectBufferHandle" --- Indirect buffer.
.start "uint16_t" --- First element in indirect buffer.
{ default = 0 }
- .num "uint16_t" --- Number of dispatches.
+ .num "uint16_t" --- Number of draws.
{ default = 1 }
.depth "uint32_t" --- Depth for sorting.
{ default = 0 }
.flags "uint8_t" --- Discard or preserve states. See `BGFX_DISCARD_*`.
{ default = "BGFX_DISCARD_ALL" }
+--- Submit primitive for rendering with index and instance data info and
+--- draw count from indirect buffers.
+---
+--- @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+---
+func.Encoder.submit { cname = "submit_indirect_count" }
+ "void"
+ .id "ViewId" --- View id.
+ .program "ProgramHandle" --- Program.
+ .indirectHandle "IndirectBufferHandle" --- Indirect buffer.
+ .start "uint16_t" --- First element in indirect buffer.
+ .numHandle "IndexBufferHandle" --- Buffer for number of draws. Must be
+ --- created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
+ .numIndex "uint32_t" --- Element in number buffer.
+ { default = 0 }
+ .numMax "uint16_t" --- Max number of draws.
+ { default = UINT16_MAX }
+ .depth "uint32_t" --- Depth for sorting.
+ { default = 0 }
+ .flags "uint8_t" --- Discard or preserve states. See `BGFX_DISCARD_*`.
+ { default = "BGFX_DISCARD_ALL" }
+
--- Set compute index buffer.
func.Encoder.setBuffer { cname = "set_compute_index_buffer" }
"void"
@@ -2677,7 +2724,7 @@ func.setMarker
--- Set render states for draw primitive.
---
--- @remarks
---- 1. To setup more complex states use:
+--- 1. To set up more complex states use:
--- `BGFX_STATE_ALPHA_REF(_ref)`,
--- `BGFX_STATE_POINT_SIZE(_size)`,
--- `BGFX_STATE_BLEND_FUNC(_src, _dst)`,
@@ -2755,7 +2802,7 @@ func.setTransform { cname = "set_transform_cached" }
--- Reserve matrices in internal matrix cache.
---
---- @attention Pointer returned can be modifed until `bgfx::frame` is called.
+--- @attention Pointer returned can be modified until `bgfx::frame` is called.
---
func.allocTransform
"uint32_t" --- Index in matrix cache.
@@ -2886,7 +2933,7 @@ func.setVertexBuffer { cname = "set_transient_vertex_buffer_with_layout" }
--- of vertex buffer will be used.
{ default = "BGFX_INVALID_HANDLE" }
---- Set number of vertices for auto generated vertices use in conjuction
+--- Set number of vertices for auto generated vertices use in conjunction
--- with gl_VertexID.
---
--- @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
@@ -2931,7 +2978,7 @@ func.setInstanceDataBuffer { cname = "set_instance_data_from_dynamic_vertex_buff
.startVertex "uint32_t" --- First instance data.
.num "uint32_t" --- Number of data instances.
---- Set number of instances for auto generated instances use in conjuction
+--- Set number of instances for auto generated instances use in conjunction
--- with gl_InstanceID.
---
--- @attention Availability depends on: `BGFX_CAPS_VERTEX_ID`.
@@ -2986,6 +3033,9 @@ func.submit { cname = "submit_occlusion_query" }
--- Submit primitive for rendering with index and instance data info from
--- indirect buffer.
+---
+--- @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT`.
+---
func.submit { cname = "submit_indirect" }
"void"
.id "ViewId" --- View id.
@@ -2993,11 +3043,33 @@ func.submit { cname = "submit_indirect" }
.indirectHandle "IndirectBufferHandle" --- Indirect buffer.
.start "uint16_t" --- First element in indirect buffer.
{ default = 0 }
- .num "uint16_t" --- Number of dispatches.
+ .num "uint16_t" --- Number of draws.
{ default = 1 }
.depth "uint32_t" --- Depth for sorting.
{ default = 0 }
- .flags "uint8_t" --- Which states to discard for next draw. See `BGFX_DISCARD_*`.
+ .flags "uint8_t" --- Which states to discard for next draw. See `BGFX_DISCARD_*`.
+ { default = "BGFX_DISCARD_ALL" }
+
+--- Submit primitive for rendering with index and instance data info and
+--- draw count from indirect buffers.
+---
+--- @attention Availability depends on: `BGFX_CAPS_DRAW_INDIRECT_COUNT`.
+---
+func.submit { cname = "submit_indirect_count" }
+ "void"
+ .id "ViewId" --- View id.
+ .program "ProgramHandle" --- Program.
+ .indirectHandle "IndirectBufferHandle" --- Indirect buffer.
+ .start "uint16_t" --- First element in indirect buffer.
+ .numHandle "IndexBufferHandle" --- Buffer for number of draws. Must be
+ --- created with `BGFX_BUFFER_INDEX32` and `BGFX_BUFFER_DRAW_INDIRECT`.
+ .numIndex "uint32_t" --- Element in number buffer.
+ { default = 0 }
+ .numMax "uint16_t" --- Max number of draws.
+ { default = UINT16_MAX }
+ .depth "uint32_t" --- Depth for sorting.
+ { default = 0 }
+ .flags "uint8_t" --- Which states to discard for next draw. See `BGFX_DISCARD_*`.
{ default = "BGFX_DISCARD_ALL" }
--- Set compute index buffer.
diff --git a/3rdparty/bgfx/scripts/bgfx.lua b/3rdparty/bgfx/scripts/bgfx.lua
index 7f176a2e24a..e9fecc97d21 100644
--- a/3rdparty/bgfx/scripts/bgfx.lua
+++ b/3rdparty/bgfx/scripts/bgfx.lua
@@ -1,6 +1,6 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
--
function filesexist(_srcPath, _dstPath, _files)
@@ -46,7 +46,6 @@ function bgfxProjectBase(_kind, _defines)
links {
"bimg",
- "bx",
}
configuration { "vs20* or mingw*" }
@@ -95,15 +94,12 @@ function bgfxProjectBase(_kind, _defines)
includedirs {
path.join(BGFX_DIR, "3rdparty"),
- path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
}
defines (_defines)
- links {
- "bx",
- }
+ using_bx()
if _OPTIONS["with-glfw"] then
defines {
@@ -111,14 +107,16 @@ function bgfxProjectBase(_kind, _defines)
}
end
- configuration { "Debug" }
- defines {
- "BGFX_CONFIG_DEBUG=1",
+ configuration { "linux-*" }
+ includedirs {
+ path.join(BGFX_DIR, "3rdparty/directx-headers/include/directx"),
+ path.join(BGFX_DIR, "3rdparty/directx-headers/include"),
+ path.join(BGFX_DIR, "3rdparty/directx-headers/include/wsl/stubs"),
}
configuration { "vs* or mingw*", "not durango" }
includedirs {
- path.join(BGFX_DIR, "3rdparty/dxsdk/include"),
+ path.join(BGFX_DIR, "3rdparty/directx-headers/include/directx"),
}
configuration { "android*" }
@@ -142,8 +140,9 @@ function bgfxProjectBase(_kind, _defines)
buildoptions { "-x objective-c++" } -- additional build option for osx
linkoptions {
"-framework Cocoa",
- "-framework QuartzCore",
+ "-framework IOKit",
"-framework OpenGL",
+ "-framework QuartzCore",
"-weak_framework Metal",
"-weak_framework MetalKit",
}
diff --git a/3rdparty/bgfx/scripts/bindings-bf.lua b/3rdparty/bgfx/scripts/bindings-bf.lua
index ef0df58d70d..393242d9680 100644
--- a/3rdparty/bgfx/scripts/bindings-bf.lua
+++ b/3rdparty/bgfx/scripts/bindings-bf.lua
@@ -3,7 +3,7 @@ local idl = codegen.idl "bgfx.idl"
local beef_template = [[
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
diff --git a/3rdparty/bgfx/scripts/bindings-cs.lua b/3rdparty/bgfx/scripts/bindings-cs.lua
index a859ef6da90..93ca57bc00f 100644
--- a/3rdparty/bgfx/scripts/bindings-cs.lua
+++ b/3rdparty/bgfx/scripts/bindings-cs.lua
@@ -3,7 +3,7 @@ local idl = codegen.idl "bgfx.idl"
local csharp_template = [[
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2022 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-2021 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
diff --git a/3rdparty/bgfx/scripts/bindings-d.lua b/3rdparty/bgfx/scripts/bindings-d.lua
index 9858e4974bb..21c81faa876 100644
--- a/3rdparty/bgfx/scripts/bindings-d.lua
+++ b/3rdparty/bgfx/scripts/bindings-d.lua
@@ -12,12 +12,45 @@ module bindbc.bgfx.types;
public import core.stdc.stdarg : va_list;
+enum expandEnum(EnumType, string fqnEnumType = EnumType.stringof) = (){
+ string expandEnum;
+ foreach(m; __traits(allMembers, EnumType)){
+ expandEnum ~= "alias " ~ m ~ " = " ~ fqnEnumType ~ "." ~ m ~ ";";
+ }
+ return expandEnum;
+}();
+
extern(C) @nogc nothrow:
$version
alias bgfx_view_id_t = ushort;
+//NOTE: TEMPORARY fix to some missing preprocessor function-macros...
+static BGFX_STATE_BLEND_FUNC_SEPARATE(ulong _srcRGB, ulong _dstRGB, ulong _srcA, ulong _dstA){
+ return (0UL
+ | ( ( cast(ulong)_srcRGB | ( cast(ulong)_dstRGB<<4) ) )
+ | ( ( cast(ulong)_srcA | ( cast(ulong)_dstA <<4) )<<8)
+ );
+}
+
+/// Blend equation separate.
+static BGFX_STATE_BLEND_EQUATION_SEPARATE(ulong _equationRGB, ulong _equationA){ return ( cast(ulong)_equationRGB | (cast(ulong)_equationA<<3) ); }
+
+/// Blend function.
+static BGFX_STATE_BLEND_FUNC(ulong _src, ulong _dst){ return BGFX_STATE_BLEND_FUNC_SEPARATE(_src, _dst, _src, _dst); }
+
+/// Blend equation.
+static BGFX_STATE_BLEND_EQUATION(ulong _equation){ return BGFX_STATE_BLEND_EQUATION_SEPARATE(_equation, _equation); }
+
+/// Utility predefined blend modes.
+
+/// Additive blending.
+static BGFX_STATE_BLEND_ADD(){ return (0 | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_ONE, BGFX_STATE_BLEND_ONE)); }
+
+/// Alpha blend.
+static BGFX_STATE_BLEND_ALPHA(){ return (0 | BGFX_STATE_BLEND_FUNC(BGFX_STATE_BLEND_SRC_ALPHA, BGFX_STATE_BLEND_INV_SRC_ALPHA)); }
+
$types
]]
@@ -90,7 +123,7 @@ local function convert_type(arg)
elseif hasPrefix(ctype, "uint16_t") then
ctype = ctype:gsub("uint16_t", "ushort")
elseif hasPrefix(ctype, "uint8_t") then
- ctype = ctype:gsub("uint8_t", "byte")
+ ctype = ctype:gsub("uint8_t", "ubyte")
elseif hasPrefix(ctype, "uintptr_t") then
ctype = ctype:gsub("uintptr_t", "ulong")
elseif hasPrefix(ctype, "const ") and hasSuffix(ctype, "*") then
@@ -231,6 +264,7 @@ function converter.types(typ)
--yield("\t" .. prefix .. "_COUNT = " .. #typ.enum)
yield("\t" .. prefix .. "_COUNT")
yield("}")
+ yield("mixin(expandEnum!" .. typ.cname .. ");")
elseif typ.bits ~= nil then
local prefix = "BGFX_" .. to_underscorecase(typ.name):upper()
diff --git a/3rdparty/bgfx/scripts/bindings-zig.lua b/3rdparty/bgfx/scripts/bindings-zig.lua
new file mode 100644
index 00000000000..ad385ecd3a3
--- /dev/null
+++ b/3rdparty/bgfx/scripts/bindings-zig.lua
@@ -0,0 +1,491 @@
+local codegen = require "codegen"
+local idl = codegen.idl "bgfx.idl"
+
+local zig_template = [[
+// Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+// License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+
+
+//
+// AUTO GENERATED! DO NOT EDIT!
+//
+
+
+const std = @import("std");
+
+pub const ViewId = u16;
+
+$types
+
+$funcs
+
+]]
+
+local function isempty(s)
+ return s == nil or s == ''
+end
+
+local function hasPrefix(str, prefix)
+ return prefix == "" or str:sub(1, #prefix) == prefix
+end
+
+local function hasSuffix(str, suffix)
+ return suffix == "" or str:sub(- #suffix) == suffix
+end
+
+local enum = {}
+
+local function convert_array(member)
+ if string.find(member.array, "::") then
+ return string.format("[%s]", enum[member.array])
+ else
+ return member.array
+ end
+end
+
+local function gisub(s, pat, repl, n)
+ pat = string.gsub(pat, '(%a)', function(v)
+ return '[' .. string.upper(v) .. string.lower(v) .. ']'
+ end)
+ if n then
+ return string.gsub(s, pat, repl, n)
+ else
+ return string.gsub(s, pat, repl)
+ end
+end
+
+local function convert_type_0(arg)
+ if hasPrefix(arg.ctype, "uint64_t") then
+ return arg.ctype:gsub("uint64_t", "u64")
+ elseif hasPrefix(arg.ctype, "int64_t") then
+ return arg.ctype:gsub("int64_t", "i64")
+ elseif hasPrefix(arg.ctype, "uint32_t") then
+ return arg.ctype:gsub("uint32_t", "u32")
+ elseif hasPrefix(arg.ctype, "int32_t") then
+ return arg.ctype:gsub("int32_t", "i32")
+ elseif hasPrefix(arg.ctype, "uint16_t") then
+ return arg.ctype:gsub("uint16_t", "u16")
+ elseif hasPrefix(arg.ctype, "uint8_t") then
+ return arg.ctype:gsub("uint8_t", "u8")
+ elseif hasPrefix(arg.ctype, "uintptr_t") then
+ return arg.ctype:gsub("uintptr_t", "usize")
+ elseif hasPrefix(arg.ctype, "float") then
+ return arg.ctype:gsub("float", "f32")
+ elseif arg.ctype == "const char*" then
+ return "[*c]const u8"
+ elseif hasPrefix(arg.ctype, "char") then
+ return arg.ctype:gsub("char", "u8")
+ elseif hasSuffix(arg.fulltype, "Handle") then
+ return arg.fulltype
+ elseif arg.ctype == "..." then
+ return "..."
+ elseif arg.ctype == "va_list" or arg.fulltype == "bx::AllocatorI*" or arg.fulltype == "CallbackI*" or arg.fulltype ==
+ "ReleaseFn" then
+ return "?*anyopaque"
+ end
+
+ return arg.fulltype
+end
+
+local function convert_type(arg)
+ local ctype = convert_type_0(arg)
+ ctype = ctype:gsub("::Enum", "")
+ ctype = ctype:gsub(" &", "*")
+ ctype = ctype:gsub("&", "*")
+ ctype = ctype:gsub("char", "u8")
+ ctype = ctype:gsub("float", "f32")
+ ctype = ctype:gsub("const void%*", "?*const anyopaque")
+ ctype = ctype:gsub("Encoder%*", "?*Encoder")
+
+ if hasSuffix(ctype, "void*") then
+ ctype = ctype:gsub("void%*", "?*anyopaque");
+ elseif hasSuffix(ctype, "*") then
+ ctype = "[*c]" .. ctype:gsub("*", "")
+ end
+
+ if arg.array ~= nil then
+ ctype = ctype:gsub("const ", "")
+ ctype = convert_array(arg) .. ctype
+ end
+
+ return ctype
+end
+
+local function convert_struct_type(arg)
+ return convert_type(arg)
+end
+
+local function convert_ret_type(arg)
+ return convert_type(arg)
+end
+
+local function wrap_simple_func(func, args, argNames)
+ local zigFunc = {}
+ local zigFuncTemplate = [[pub inline fn $func($params) $ret {
+ return $cfunc($args);
+}]]
+
+ -- transform name to camelCase from snake_case
+ zigFunc.func = func.cname:gsub("_(.)", func.cname.upper)
+ -- make 2d/3d upper case 2D/3D
+ zigFunc.func = zigFunc.func:gsub("%dd", zigFunc.func.upper);
+ zigFunc.params = table.concat(args, ", ")
+ zigFunc.ret = convert_ret_type(func.ret)
+ zigFunc.cfunc = "bgfx_" .. func.cname
+ zigFunc.args = table.concat(argNames, ", ")
+ return zigFuncTemplate:gsub("$(%l+)", zigFunc)
+end
+
+local function wrap_method(func, type, args, argNames, indent)
+ local zigFunc = {}
+ local zigFuncTemplate = [[%spub inline fn $func($params) $ret {
+ %sreturn $cfunc($args);
+%s}]]
+
+ zigFuncTemplate = string.format(zigFuncTemplate, indent, indent, indent);
+
+ -- transform name to camelCase from snake_case
+ zigFunc.func = func.cname:gsub("_(.)", func.cname.upper)
+ -- remove type from name
+ zigFunc.func = gisub(zigFunc.func, type, "");
+ -- make first letter lowercase
+ zigFunc.func = zigFunc.func:gsub("^%L", string.lower)
+ -- make 2d/3d upper case 2D/3D
+ zigFunc.func = zigFunc.func:gsub("%dd", zigFunc.func.upper);
+ zigFunc.params = table.concat(args, ", ")
+ zigFunc.ret = convert_ret_type(func.ret)
+ -- remove C API pointer [*c] for fluent interfaces
+ if zigFunc.ret == ("[*c]" .. type) then
+ zigFunc.ret = zigFunc.ret:gsub("%[%*c%]", "*")
+ end
+ zigFunc.cfunc = "bgfx_" .. func.cname
+ zigFunc.args = table.concat(argNames, ", ")
+ return zigFuncTemplate:gsub("$(%l+)", zigFunc)
+end
+
+local converter = {}
+local yield = coroutine.yield
+local gen = {}
+
+local indent = ""
+
+function gen.gen()
+ -- find the functions that have `this` first argument
+ -- these belong to a type (struct) and we need to add them when converting structures
+ local methods = {}
+ for _, func in ipairs(idl["funcs"]) do
+ if func.this ~= nil then
+ if methods[func.this_type.type] == nil then
+ methods[func.this_type.type] = {}
+ end
+ table.insert(methods[func.this_type.type], func)
+ end
+ end
+
+ local r = zig_template:gsub("$(%l+)", function(what)
+ local tmp = {}
+ for _, object in ipairs(idl[what]) do
+ local co = coroutine.create(converter[what])
+ local any
+ -- we're pretty confident there are no types that have the same name with a func
+ local funcs = methods[object.name]
+ while true do
+ local ok, v = coroutine.resume(co, {
+ obj = object,
+ funcs = funcs
+ })
+ assert(ok, debug.traceback(co, v))
+ if not v then
+ break
+ end
+ table.insert(tmp, v)
+ any = true
+ end
+ if any and tmp[#tmp] ~= "" then
+ table.insert(tmp, "")
+ end
+ end
+ return table.concat(tmp, "\n")
+ end)
+ return r
+end
+
+local combined = { "State", "Stencil", "Buffer", "Texture", "Sampler", "Reset" }
+
+for _, v in ipairs(combined) do
+ combined[v] = {}
+end
+
+local lastCombinedFlag
+local function FlagBlock(typ)
+ local format = "0x%08x"
+ local enumType = "u32"
+ if typ.bits == 64 then
+ format = "0x%016x"
+ enumType = "u64"
+ elseif typ.bits == 16 then
+ format = "0x%04x"
+ enumType = "u16"
+ end
+
+ local name = typ.name .. "Flags"
+ yield("pub const " .. name .. " = " .. enumType .. ";")
+
+ for idx, flag in ipairs(typ.flag) do
+ if flag.comment ~= nil then
+ if idx ~= 1 then
+ yield("")
+ end
+
+ for _, comment in ipairs(flag.comment) do
+ yield("/// " .. comment)
+ end
+ end
+
+ local flagName = flag.name:gsub("_", "")
+ -- make 2d/3d upper case 2D/3D
+ flagName = flagName:gsub("%dd", flagName.upper);
+ yield("pub const " .. name .. "_" .. flagName .. ": " .. name .. string.rep(" ", 22 - #(flagName)) .. " = " ..
+ string.format(flag.format or format, flag.value) .. ";")
+ end
+
+ if typ.shift then
+ yield(" " .. "Shift" .. string.rep(" ", 22 - #("Shift")) .. " = " .. flag.shift)
+ end
+
+ -- generate Mask
+ if typ.mask then
+ yield(" " .. "Mask" .. string.rep(" ", 22 - #("Mask")) .. " = " .. string.format(format, flag.mask))
+ end
+end
+
+local function lastCombinedFlagBlock()
+ if lastCombinedFlag then
+ local typ = combined[lastCombinedFlag]
+ if typ then
+ FlagBlock(combined[lastCombinedFlag])
+ yield("")
+ end
+ lastCombinedFlag = nil
+ end
+end
+
+local function convert_struct_member(member)
+ return member.name .. ": " .. convert_struct_type(member)
+end
+
+local namespace = ""
+
+function converter.types(params)
+ local typ = params.obj
+ local funcs = params.funcs
+ if typ.handle then
+ lastCombinedFlagBlock()
+
+ yield("pub const " .. typ.name .. " = extern struct {")
+ yield(" idx: c_ushort,")
+ yield("};")
+ elseif hasSuffix(typ.name, "::Enum") then
+ lastCombinedFlagBlock()
+
+ yield("pub const " .. typ.typename .. " = enum(c_int) {")
+ for idx, enum in ipairs(typ.enum) do
+
+ if enum.comment ~= nil then
+ if idx ~= 1 then
+ yield("")
+ end
+
+ for _, comment in ipairs(enum.comment) do
+ yield(" /// " .. comment)
+ end
+ end
+
+ yield(" " .. enum.name .. ",")
+ end
+ yield("");
+ yield(" Count")
+ yield("};")
+
+ enum["[" .. typ.typename .. "::Count]"] = #typ.enum
+
+ elseif typ.bits ~= nil then
+ local prefix, name = typ.name:match "(%u%l+)(.*)"
+ if prefix ~= lastCombinedFlag then
+ lastCombinedFlagBlock()
+ lastCombinedFlag = prefix
+ end
+ local combinedFlag = combined[prefix]
+ if combinedFlag then
+ combinedFlag.bits = typ.bits
+ combinedFlag.name = prefix
+ local flags = combinedFlag.flag or {}
+ combinedFlag.flag = flags
+ local lookup = combinedFlag.lookup or {}
+ combinedFlag.lookup = lookup
+ for _, flag in ipairs(typ.flag) do
+ local flagName = name .. flag.name:gsub("_", "")
+ local value = flag.value
+ if value == nil then
+ -- It's a combined flag
+ value = 0
+ for _, v in ipairs(flag) do
+ value = value | assert(lookup[name .. v], v .. " is not defined for " .. flagName)
+ end
+ end
+ lookup[flagName] = value
+ table.insert(flags, {
+ name = flagName,
+ value = value,
+ comment = flag.comment
+ })
+ end
+
+ if typ.shift then
+ table.insert(flags, {
+ name = name .. "Shift",
+ value = typ.shift,
+ format = "%d",
+ comment = typ.comment
+ })
+ end
+
+ if typ.mask then
+ -- generate Mask
+ table.insert(flags, {
+ name = name .. "Mask",
+ value = typ.mask,
+ comment = typ.comment
+ })
+ lookup[name .. "Mask"] = typ.mask
+ end
+ else
+ FlagBlock(typ)
+ end
+ elseif typ.struct ~= nil then
+ local skip = false
+
+ if typ.namespace ~= nil then
+ if namespace ~= typ.namespace then
+ yield("pub const " .. typ.namespace .. " = extern struct {")
+ namespace = typ.namespace
+ indent = " "
+ end
+ elseif namespace ~= "" then
+ indent = " "
+ namespace = ""
+ skip = true
+ end
+
+ if not skip then
+ if typ.name ~= "Encoder" then
+ yield(indent .. "pub const " .. typ.name .. " = extern struct {")
+ else
+ yield(indent .. "pub const " .. typ.name .. " = opaque {")
+ end
+ end
+
+ for _, member in ipairs(typ.struct) do
+ yield(indent .. indent .. convert_struct_member(member) .. ",")
+ end
+ if funcs ~= nil then
+ for _, func in ipairs(funcs) do
+ converter.funcs({
+ obj = func,
+ asMethod = true
+ })
+ end
+ end
+
+ yield(indent .. "};")
+ end
+end
+
+function converter.funcs(params)
+ local func = params.obj
+ if func.cpponly then
+ return
+ end
+
+ -- skip for now, don't know how to handle variadic functions
+ if func.cname == "dbg_text_printf" or func.cname == "dbg_text_vprintf" then
+ return
+ end
+
+ local func_indent = (params.asMethod == true and indent .. indent or "")
+
+ if func.comments ~= nil then
+ for _, line in ipairs(func.comments) do
+ yield(func_indent .. "/// " .. line)
+ end
+
+ local hasParams = false
+
+ for _, arg in ipairs(func.args) do
+ if arg.comment ~= nil then
+ local comment = table.concat(arg.comment, " ")
+
+ yield(func_indent .. "/// <param name=\"" .. arg.name .. "\">" .. comment .. "</param>")
+
+ hasParams = true
+ end
+ end
+ end
+
+ local args = {}
+ local argNames = {}
+
+ if func.this ~= nil then
+ local ptr = "[*c]"
+ if params.asMethod == true then
+ ptr = "*"
+ end
+ -- print("Function " .. func.name .. " has this: " .. func.this_type.type)
+ if func.const ~= nil then
+ ptr = ptr .. "const "
+ end
+
+ if func.this_type.type == "Encoder" then
+ ptr = "?*"
+ end
+ args[1] = "self: " .. ptr .. func.this_type.type
+ argNames[1] = "self"
+ end
+ for _, arg in ipairs(func.args) do
+ local argName = arg.name
+ -- local argName = arg.name:gsub("_", "")
+ -- argName = argName:gsub("enum", "enumeration")
+ -- argName = argName:gsub("type_", '@"type"')
+ if not isempty(argName) then
+ table.insert(argNames, argName)
+ table.insert(args, argName .. ": " .. convert_type(arg))
+ else
+ table.insert(args, convert_type(arg))
+ end
+ end
+
+ if (params.asMethod == true) then
+ yield(wrap_method(func, func.this_type.type, args, argNames, func_indent))
+ else
+ if func.this == nil then
+ yield(wrap_simple_func(func, args, argNames))
+ end
+ yield(
+ "extern fn bgfx_" .. func.cname .. "(" .. table.concat(args, ", ") .. ") " .. convert_ret_type(func.ret) ..
+ ";")
+ end
+end
+
+function gen.write(codes, outputfile)
+ local out = assert(io.open(outputfile, "wb"))
+ out:write(codes)
+ out:close()
+ print("Generating: " .. outputfile)
+end
+
+if (...) == nil then
+ -- run `lua bindings-zig.lua` in command line
+ print(gen.gen())
+end
+
+return gen
diff --git a/3rdparty/bgfx/scripts/build.ninja b/3rdparty/bgfx/scripts/build.ninja
index 1f023986921..94ac877c420 100644
--- a/3rdparty/bgfx/scripts/build.ninja
+++ b/3rdparty/bgfx/scripts/build.ninja
@@ -30,6 +30,48 @@ rule texturec_bc5
rule texturec_bc7
command = texturec -f $in -o $out -t bc7 -m
+rule texturec_astc4x4
+ command = texturec -f $in -o $out -t astc4x4 -m
+
+rule texturec_astc5x4
+ command = texturec -f $in -o $out -t astc5x4 -m
+
+rule texturec_astc5x5
+ command = texturec -f $in -o $out -t astc5x5 -m
+
+rule texturec_astc6x5
+ command = texturec -f $in -o $out -t astc6x5 -m
+
+rule texturec_astc6x6
+ command = texturec -f $in -o $out -t astc6x6 -m
+
+rule texturec_astc8x5
+ command = texturec -f $in -o $out -t astc8x5 -m
+
+rule texturec_astc8x6
+ command = texturec -f $in -o $out -t astc8x6 -m
+
+rule texturec_astc10x5
+ command = texturec -f $in -o $out -t astc10x5 -m
+
+rule texturec_astc10x6
+ command = texturec -f $in -o $out -t astc10x6 -m
+
+rule texturec_astc8x8
+ command = texturec -f $in -o $out -t astc8x8 -m
+
+rule texturec_astc10x8
+ command = texturec -f $in -o $out -t astc10x8 -m
+
+rule texturec_astc10x10
+ command = texturec -f $in -o $out -t astc10x10 -m
+
+rule texturec_astc12x10
+ command = texturec -f $in -o $out -t astc12x10 -m
+
+rule texturec_astc12x12
+ command = texturec -f $in -o $out -t astc12x12 -m
+
rule texturec_etc1
command = texturec -f $in -o $out -t etc1 -m
@@ -48,6 +90,9 @@ rule texturec_height
rule texturec_equirect
command = texturec -f $in -o $out --max 512 -t rgba16f --equirect
+rule texturec_rgba8
+ command = texturec -f $in -o $out -t rgba8
+
pwd = ../examples/assets/meshes
subninja ../examples/assets/meshes/meshes.ninja
diff --git a/3rdparty/bgfx/scripts/codegen.lua b/3rdparty/bgfx/scripts/codegen.lua
index e5e0003e433..4aa4eef0524 100644
--- a/3rdparty/bgfx/scripts/codegen.lua
+++ b/3rdparty/bgfx/scripts/codegen.lua
@@ -624,13 +624,13 @@ function codegen.doxygen_type(doxygen, func, cname)
if cname then
result[#result+1] = "///"
if type(cname) == "string" then
- result[#result+1] = string.format("/// @attention C99 equivalent is `%s`.", cname)
+ result[#result+1] = string.format("/// @attention C99's equivalent binding is `%s`.", cname)
else
local names = {}
for _, v in ipairs(cname) do
names[#names+1] = "`" .. v .. "`"
end
- result[#result+1] = string.format("/// @attention C99 equivalent are %s.", table.concat(names, ","))
+ result[#result+1] = string.format("/// @attention C99's equivalent bindings are %s.", table.concat(names, ","))
end
end
result[#result+1] = "///"
diff --git a/3rdparty/bgfx/scripts/example-common.lua b/3rdparty/bgfx/scripts/example-common.lua
index 6a1101a3edd..c6ddb81fd6c 100644
--- a/3rdparty/bgfx/scripts/example-common.lua
+++ b/3rdparty/bgfx/scripts/example-common.lua
@@ -1,13 +1,12 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
--
project ("example-glue")
kind "StaticLib"
includedirs {
- path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
path.join(BGFX_DIR, "include"),
path.join(BGFX_DIR, "3rdparty"),
@@ -17,11 +16,14 @@ project ("example-glue")
path.join(BGFX_DIR, "examples/common/example-glue.cpp"),
}
+ using_bx()
+
+ configuration {}
+
project ("example-common")
kind "StaticLib"
includedirs {
- path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
path.join(BGFX_DIR, "include"),
path.join(BGFX_DIR, "3rdparty"),
@@ -36,6 +38,8 @@ project ("example-common")
path.join(BGFX_DIR, "examples/common/**.h"),
}
+ using_bx()
+
if filesexist(BGFX_DIR, path.join(BGFX_DIR, "../bgfx-gnm"),
{ path.join(BGFX_DIR, "../bgfx-gnm/examples/common/entry/entry_orbis.cpp") }) then
@@ -77,6 +81,11 @@ project ("example-common")
}
end
+ configuration { "android-*" }
+ includedirs {
+ path.join(BGFX_DIR, "3rdparty/native_app_glue")
+ }
+
configuration { "osx* or ios* or tvos*" }
files {
path.join(BGFX_DIR, "examples/common/**.mm"),
@@ -90,3 +99,5 @@ project ("example-common")
"/ignore:4264" -- LNK4264: archiving object file compiled with /ZW into a static library; note that when authoring Windows Runtime types it is not recommended to link with a static library that contains Windows Runtime metadata
}
premake.vstudio.splashpath = "../../../examples/runtime/images/SplashScreen.png"
+
+ configuration {}
diff --git a/3rdparty/bgfx/scripts/genie.lua b/3rdparty/bgfx/scripts/genie.lua
index cf5b4ff98de..645ed3a21be 100644
--- a/3rdparty/bgfx/scripts/genie.lua
+++ b/3rdparty/bgfx/scripts/genie.lua
@@ -1,6 +1,6 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
--
MODULE_DIR = path.getabsolute("../")
@@ -84,6 +84,9 @@ newaction {
local csgen = require "bindings-bf"
csgen.write(csgen.gen(), "../bindings/bf/bgfx.bf")
+
+ local ziggen = require "bindings-zig"
+ ziggen.write(ziggen.gen(), "../bindings/zig/bgfx.zig")
end
os.exit()
@@ -97,14 +100,19 @@ newaction {
local f = io.popen("git rev-list --count HEAD")
local rev = string.match(f:read("*a"), ".*%S")
+
+ local codegen = require "codegen"
+ local idl = codegen.idl "bgfx.idl"
+ print("1." .. idl._version .. "." .. rev)
+
f:close()
f = io.popen("git log --format=format:%H -1")
local sha1 = f:read("*a")
f:close()
io.output(path.join(MODULE_DIR, "src/version.h"))
io.write("/*\n")
- io.write(" * Copyright 2011-2021 Branimir Karadzic. All rights reserved.\n")
- io.write(" * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n")
+ io.write(" * Copyright 2011-2022 Branimir Karadzic. All rights reserved.\n")
+ io.write(" * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n")
io.write(" */\n")
io.write("\n")
io.write("/*\n")
@@ -203,7 +211,7 @@ end
if _OPTIONS["with-sdl"] then
if os.is("windows") then
if not os.getenv("SDL2_DIR") then
- print("Set SDL2_DIR enviroment variable.")
+ print("Set SDL2_DIR environment variable.")
end
end
end
@@ -220,7 +228,6 @@ function exampleProjectDefaults()
debugdir (path.join(BGFX_DIR, "examples/runtime"))
includedirs {
- path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
path.join(BGFX_DIR, "include"),
path.join(BGFX_DIR, "3rdparty"),
@@ -237,9 +244,10 @@ function exampleProjectDefaults()
"bgfx",
"bimg_decode",
"bimg",
- "bx",
}
+ using_bx()
+
if _OPTIONS["with-webgpu"] then
usesWebGPU()
end
@@ -283,7 +291,6 @@ function exampleProjectDefaults()
configuration { "osx*" }
linkoptions {
"-framework CoreVideo",
- "-framework IOKit",
}
configuration {}
@@ -306,6 +313,7 @@ function exampleProjectDefaults()
configuration { "mingw*" }
targetextension ".exe"
links {
+ "comdlg32",
"gdi32",
"psapi",
}
@@ -404,8 +412,9 @@ function exampleProjectDefaults()
configuration { "osx*" }
linkoptions {
"-framework Cocoa",
- "-framework QuartzCore",
+ "-framework IOKit",
"-framework OpenGL",
+ "-framework QuartzCore",
"-weak_framework Metal",
}
@@ -414,9 +423,10 @@ function exampleProjectDefaults()
linkoptions {
"-framework CoreFoundation",
"-framework Foundation",
+ "-framework IOKit",
"-framework OpenGLES",
- "-framework UIKit",
"-framework QuartzCore",
+ "-framework UIKit",
"-weak_framework Metal",
}
@@ -432,14 +442,6 @@ function exampleProjectDefaults()
path.join(BGFX_DIR, "examples/runtime/tvOS-Info.plist"),
}
-
- configuration { "qnx*" }
- targetextension ""
- links {
- "EGL",
- "GLESv2",
- }
-
configuration {}
strip()
@@ -500,9 +502,11 @@ function exampleProject(_combined, ...)
end
-dofile "bgfx.lua"
-
group "libs"
+dofile(path.join(BX_DIR, "scripts/bx.lua"))
+dofile(path.join(BIMG_DIR, "scripts/bimg.lua"))
+dofile(path.join(BIMG_DIR, "scripts/bimg_decode.lua"))
+dofile "bgfx.lua"
local function userdefines()
local defines = {}
@@ -520,11 +524,13 @@ BGFX_CONFIG = userdefines()
bgfxProject("", "StaticLib", BGFX_CONFIG)
-dofile(path.join(BX_DIR, "scripts/bx.lua"))
-dofile(path.join(BIMG_DIR, "scripts/bimg.lua"))
-dofile(path.join(BIMG_DIR, "scripts/bimg_decode.lua"))
+if _OPTIONS["with-shared-lib"] then
+ group "libs"
+ bgfxProject("-shared-lib", "SharedLib", BGFX_CONFIG)
+end
if _OPTIONS["with-tools"] then
+ group "libs"
dofile(path.join(BIMG_DIR, "scripts/bimg_encode.lua"))
end
@@ -584,12 +590,16 @@ or _OPTIONS["with-combined-examples"] then
, "43-denoise"
, "44-sss"
, "45-bokeh"
+ , "46-fsr"
+ , "47-pixelformats"
+ , "48-drawindirect"
+ , "49-hextile"
)
-- 17-drawstress requires multithreading, does not compile for singlethreaded wasm
--- if platform is not single-threaded then
+ if premake.gcc.namestyle == nil or not premake.gcc.namestyle == "Emscripten" then
exampleProject(false, "17-drawstress")
--- end
+ end
-- C99 source doesn't compile under WinRT settings
if not premake.vstudio.iswinrt() then
@@ -597,11 +607,6 @@ or _OPTIONS["with-combined-examples"] then
end
end
-if _OPTIONS["with-shared-lib"] then
- group "libs"
- bgfxProject("-shared-lib", "SharedLib", BGFX_CONFIG)
-end
-
if _OPTIONS["with-tools"] then
group "tools"
dofile "shaderc.lua"
diff --git a/3rdparty/bgfx/scripts/geometryc.lua b/3rdparty/bgfx/scripts/geometryc.lua
index d17b8326845..84b646705f4 100644
--- a/3rdparty/bgfx/scripts/geometryc.lua
+++ b/3rdparty/bgfx/scripts/geometryc.lua
@@ -1,6 +1,6 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
--
project "geometryc"
@@ -23,9 +23,7 @@ project "geometryc"
path.join(BGFX_DIR, "examples/common/bounds.**"),
}
- links {
- "bx",
- }
+ using_bx();
configuration { "mingw-*" }
targetextension ".exe"
diff --git a/3rdparty/bgfx/scripts/geometryv.lua b/3rdparty/bgfx/scripts/geometryv.lua
index 9707ee7a496..e403d582179 100644
--- a/3rdparty/bgfx/scripts/geometryv.lua
+++ b/3rdparty/bgfx/scripts/geometryv.lua
@@ -5,7 +5,6 @@ project ("geometryv")
configuration {}
includedirs {
- path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
path.join(BGFX_DIR, "include"),
path.join(BGFX_DIR, "3rdparty"),
@@ -23,9 +22,10 @@ project ("geometryv")
"bimg_decode",
"bimg",
"bgfx",
- "bx",
}
+ using_bx()
+
if _OPTIONS["with-sdl"] then
defines { "ENTRY_CONFIG_USE_SDL=1" }
links { "SDL2" }
@@ -62,7 +62,6 @@ project ("geometryv")
configuration { "osx*" }
linkoptions {
"-framework CoreVideo",
- "-framework IOKit",
}
configuration {}
@@ -148,9 +147,10 @@ project ("geometryv")
configuration { "osx*" }
linkoptions {
"-framework Cocoa",
+ "-framework IOKit",
"-framework Metal",
- "-framework QuartzCore",
"-framework OpenGL",
+ "-framework QuartzCore",
}
configuration { "ios*" }
@@ -158,9 +158,10 @@ project ("geometryv")
linkoptions {
"-framework CoreFoundation",
"-framework Foundation",
+ "-framework IOKit",
"-framework OpenGLES",
- "-framework UIKit",
"-framework QuartzCore",
+ "-framework UIKit",
}
configuration { "xcode4", "ios" }
diff --git a/3rdparty/bgfx/scripts/shader-embeded.mk b/3rdparty/bgfx/scripts/shader-embeded.mk
index b9a01305d1e..5fe1fcd0759 100644
--- a/3rdparty/bgfx/scripts/shader-embeded.mk
+++ b/3rdparty/bgfx/scripts/shader-embeded.mk
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
THISDIR:=$(dir $(lastword $(MAKEFILE_LIST)))
@@ -27,7 +27,7 @@ vs_%.bin.h : vs_%.sc
$(SILENT) $(SHADERC) $(VS_FLAGS) --platform linux -p 120 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_glsl
@cat "$(SHADER_TMP)" > $(@)
-$(SILENT) $(SHADERC) $(VS_FLAGS) --platform android -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_essl
- -@cat "$(SHADER_TMP)" >> $(@)
+ -@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
@@ -44,7 +44,7 @@ fs_%.bin.h : fs_%.sc
$(SILENT) $(SHADERC) $(FS_FLAGS) --platform linux -p 120 -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_glsl
@cat "$(SHADER_TMP)" > $(@)
-$(SILENT) $(SHADERC) $(FS_FLAGS) --platform android -f $(<) -o "$(SHADER_TMP)" --bin2c $(basename $(<))_essl
- -@cat "$(SHADER_TMP)" >> $(@)
+ -@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
@@ -61,9 +61,9 @@ cs_%.bin.h : cs_%.sc
$(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)" >> $(@)
+ -@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
-@cat "$(SHADER_TMP)" >> $(@)
-@printf "extern const uint8_t* $(basename $(<))_pssl;\n" | tr -d '\015' >> $(@)
diff --git a/3rdparty/bgfx/scripts/shader.mk b/3rdparty/bgfx/scripts/shader.mk
index 4de9ba26892..d1ddbf2b077 100644
--- a/3rdparty/bgfx/scripts/shader.mk
+++ b/3rdparty/bgfx/scripts/shader.mk
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
THISDIR:=$(dir $(lastword $(MAKEFILE_LIST)))
@@ -127,7 +127,7 @@ VS_BIN = $(addprefix $(BUILD_INTERMEDIATE_DIR)/, $(addsuffix .bin, $(basename $(
FS_BIN = $(addprefix $(BUILD_INTERMEDIATE_DIR)/, $(addsuffix .bin, $(basename $(notdir $(FS_SOURCES)))))
CS_BIN = $(addprefix $(BUILD_INTERMEDIATE_DIR)/, $(addsuffix .bin, $(basename $(notdir $(CS_SOURCES)))))
-BIN = $(VS_BIN) $(FS_BIN)
+BIN = $(VS_BIN) $(FS_BIN) $(CS_BIN)
ASM = $(VS_ASM) $(FS_ASM)
ifeq ($(TARGET), $(filter $(TARGET),1 3 4 5 6 7))
diff --git a/3rdparty/bgfx/scripts/shaderc.lua b/3rdparty/bgfx/scripts/shaderc.lua
index 3900dc0f4db..00fff67401c 100644
--- a/3rdparty/bgfx/scripts/shaderc.lua
+++ b/3rdparty/bgfx/scripts/shaderc.lua
@@ -1,6 +1,6 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
--
group "tools/shaderc"
@@ -123,10 +123,13 @@ project "spirv-opt"
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_scopes.cpp"),
path.join(SPIRV_TOOLS, "source/val/validate_small_type_uses.cpp"),
path.join(SPIRV_TOOLS, "source/val/validate_type.cpp"),
@@ -233,11 +236,6 @@ project "glslang"
path.join(GLSLANG, "OGLCompilersDLL/**.h"),
}
- removefiles {
- path.join(GLSLANG, "glslang/OSDependent/Unix/main.cpp"),
- path.join(GLSLANG, "glslang/OSDependent/Windows/main.cpp"),
- }
-
configuration { "windows" }
removefiles {
path.join(GLSLANG, "glslang/OSDependent/Unix/**.cpp"),
@@ -268,7 +266,7 @@ project "glslang"
"/wd4838", -- warning C4838: conversion from 'spv::GroupOperation' to 'unsigned int' requires a narrowing conversion
}
- configuration { "mingw* or linux*" }
+ configuration { "mingw-gcc or linux-gcc" }
buildoptions {
"-Wno-logical-op",
"-Wno-maybe-uninitialized",
@@ -601,7 +599,6 @@ project "shaderc"
kind "ConsoleApp"
includedirs {
- path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
path.join(BGFX_DIR, "include"),
@@ -623,7 +620,6 @@ project "shaderc"
}
links {
- "bx",
"fcpp",
"glslang",
"glsl-optimizer",
@@ -631,6 +627,8 @@ project "shaderc"
"spirv-cross",
}
+ using_bx()
+
files {
path.join(BGFX_DIR, "tools/shaderc/**.cpp"),
path.join(BGFX_DIR, "tools/shaderc/**.h"),
diff --git a/3rdparty/bgfx/scripts/temp.bgfx.h b/3rdparty/bgfx/scripts/temp.bgfx.h
index c7dff3f8eeb..47161c771c5 100644
--- a/3rdparty/bgfx/scripts/temp.bgfx.h
+++ b/3rdparty/bgfx/scripts/temp.bgfx.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
diff --git a/3rdparty/bgfx/scripts/temp.bgfx.idl.inl b/3rdparty/bgfx/scripts/temp.bgfx.idl.inl
index 02dc48b33af..66e62cb0a7c 100644
--- a/3rdparty/bgfx/scripts/temp.bgfx.idl.inl
+++ b/3rdparty/bgfx/scripts/temp.bgfx.idl.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
diff --git a/3rdparty/bgfx/scripts/temp.defines.h b/3rdparty/bgfx/scripts/temp.defines.h
index 9f8ffe49e6a..6d462d645d2 100644
--- a/3rdparty/bgfx/scripts/temp.defines.h
+++ b/3rdparty/bgfx/scripts/temp.defines.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
diff --git a/3rdparty/bgfx/scripts/texturec.lua b/3rdparty/bgfx/scripts/texturec.lua
index 304ab7e7c6a..e0b240755cc 100644
--- a/3rdparty/bgfx/scripts/texturec.lua
+++ b/3rdparty/bgfx/scripts/texturec.lua
@@ -1,6 +1,6 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
--
project "texturec"
@@ -8,7 +8,6 @@ project "texturec"
kind "ConsoleApp"
includedirs {
- path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
path.join(BGFX_DIR, "include"),
path.join(BIMG_DIR, "3rdparty/iqa/include"),
@@ -22,9 +21,10 @@ project "texturec"
"bimg_decode",
"bimg_encode",
"bimg",
- "bx",
}
+ using_bx()
+
configuration { "mingw-*" }
targetextension ".exe"
links {
diff --git a/3rdparty/bgfx/scripts/texturev.lua b/3rdparty/bgfx/scripts/texturev.lua
index bbbdd9ca426..d5bb9e2f08a 100644
--- a/3rdparty/bgfx/scripts/texturev.lua
+++ b/3rdparty/bgfx/scripts/texturev.lua
@@ -5,7 +5,6 @@ project ("texturev")
configuration {}
includedirs {
- path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
path.join(BGFX_DIR, "include"),
path.join(BGFX_DIR, "3rdparty"),
@@ -23,9 +22,10 @@ project ("texturev")
"bimg_decode",
"bimg",
"bgfx",
- "bx",
}
+ using_bx()
+
if _OPTIONS["with-sdl"] then
defines { "ENTRY_CONFIG_USE_SDL=1" }
links { "SDL2" }
@@ -62,7 +62,6 @@ project ("texturev")
configuration { "osx*" }
linkoptions {
"-framework CoreVideo",
- "-framework IOKit",
}
configuration {}
@@ -148,9 +147,10 @@ project ("texturev")
configuration { "osx*" }
linkoptions {
"-framework Cocoa",
+ "-framework IOKit",
"-framework Metal",
- "-framework QuartzCore",
"-framework OpenGL",
+ "-framework QuartzCore",
}
configuration { "ios*" }
@@ -158,9 +158,10 @@ project ("texturev")
linkoptions {
"-framework CoreFoundation",
"-framework Foundation",
+ "-framework IOKit",
"-framework OpenGLES",
- "-framework UIKit",
"-framework QuartzCore",
+ "-framework UIKit",
}
configuration { "xcode*", "ios" }
diff --git a/3rdparty/bgfx/scripts/tools.mk b/3rdparty/bgfx/scripts/tools.mk
index cd9f325d3f8..e0dd882e202 100644
--- a/3rdparty/bgfx/scripts/tools.mk
+++ b/3rdparty/bgfx/scripts/tools.mk
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
SILENT?=@
diff --git a/3rdparty/bgfx/src/amalgamated.cpp b/3rdparty/bgfx/src/amalgamated.cpp
index 60c8b1f21cd..aa88b1c4898 100644
--- a/3rdparty/bgfx/src/amalgamated.cpp
+++ b/3rdparty/bgfx/src/amalgamated.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx.cpp"
diff --git a/3rdparty/bgfx/src/amalgamated.mm b/3rdparty/bgfx/src/amalgamated.mm
index 6b68f2e2470..e3746e68dfc 100644
--- a/3rdparty/bgfx/src/amalgamated.mm
+++ b/3rdparty/bgfx/src/amalgamated.mm
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "amalgamated.cpp"
diff --git a/3rdparty/bgfx/src/bgfx.cpp b/3rdparty/bgfx/src/bgfx.cpp
index a2d52b6b83d..f9ef0a6e207 100644
--- a/3rdparty/bgfx/src/bgfx.cpp
+++ b/3rdparty/bgfx/src/bgfx.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bx/platform.h>
@@ -14,6 +14,11 @@
#if BX_PLATFORM_OSX || BX_PLATFORM_IOS
# include <objc/message.h>
+#elif BX_PLATFORM_WINDOWS
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif // WIN32_LEAN_AND_MEAN
+# include <windows.h>
#endif // BX_PLATFORM_OSX
BX_ERROR_RESULT(BGFX_ERROR_TEXTURE_VALIDATION, BX_MAKEFOURCC('b', 'g', 0, 1) );
@@ -69,7 +74,7 @@ namespace bgfx
virtual void fatal(const char* _filePath, uint16_t _line, Fatal::Enum _code, const char* _str) override
{
- bgfx::trace(_filePath, _line, "BGFX 0x%08x: %s\n", _code, _str);
+ bgfx::trace(_filePath, _line, "BGFX FATAL 0x%08x: %s\n", _code, _str);
if (Fatal::DebugCheck == _code)
{
@@ -258,8 +263,8 @@ namespace bgfx
class ThreadData
{
BX_CLASS(ThreadData
+ , NO_DEFAULT_CTOR
, NO_COPY
- , NO_ASSIGNMENT
);
public:
@@ -306,19 +311,28 @@ namespace bgfx
PlatformData g_platformData;
bool g_platformDataChangedSinceReset = false;
- const char* getTypeName(Handle _handle)
- {
- switch (_handle.type)
- {
- case Handle::IndexBuffer: return "IB";
- case Handle::Shader: return "S";
- case Handle::Texture: return "T";
- case Handle::VertexBuffer: return "VB";
- default: break;
- }
+ static Handle::TypeName s_typeName[] =
+ {
+ { "DIB", "DynamicIndexBuffer" },
+ { "DVB", "DynamicVertexBuffer" },
+ { "FB", "FrameBuffer" },
+ { "IB", "IndexBuffer" },
+ { "IndB", "IndirectBuffer" },
+ { "OQ", "OcclusionQuery" },
+ { "P", "Program" },
+ { "S", "Shader" },
+ { "T", "Texture" },
+ { "U", "Uniform" },
+ { "VB", "VertexBuffer" },
+ { "VL", "VertexLayout" },
+ { "?", "?" },
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_typeName) == Handle::Count+1, "");
- BX_ASSERT(false, "You should not be here.");
- return "?";
+ const Handle::TypeName& Handle::getTypeName(Handle::Enum _enum)
+ {
+ BX_ASSERT(_enum < Handle::Count, "Invalid Handle::Enum %d!", _enum);
+ return s_typeName[bx::min(_enum, Handle::Count)];
}
void AllocatorStub::checkLeaks()
@@ -388,7 +402,7 @@ namespace bgfx
bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
- bx::write(&writer, magic);
+ bx::write(&writer, magic, bx::ErrorAssert{});
TextureCreate tc;
tc.m_width = _width;
@@ -399,7 +413,7 @@ namespace bgfx
tc.m_format = _format;
tc.m_cubeMap = false;
tc.m_mem = NULL;
- bx::write(&writer, tc);
+ bx::write(&writer, tc, bx::ErrorAssert{});
rci->destroyTexture(_handle);
rci->createTexture(_handle, mem, _flags, 0);
@@ -437,7 +451,7 @@ namespace bgfx
if (BX_UNLIKELY(NULL == g_callback) )
{
- bx::debugPrintf("%s(%d): BGFX 0x%08x: %s", _filePath, _line, _code, out);
+ bx::debugPrintf("%s(%d): BGFX FATAL 0x%08x: %s", _filePath, _line, _code, out);
abort();
}
else
@@ -678,13 +692,13 @@ namespace bgfx
charsetFillTexture(vga8x8, rgba, 8, pitch, bpp);
charsetFillTexture(vga8x16, &rgba[8*pitch], 16, pitch, bpp);
m_texture = createTexture2D(width, height, false, 1, TextureFormat::R8
- , BGFX_SAMPLER_MIN_POINT
- | BGFX_SAMPLER_MAG_POINT
- | BGFX_SAMPLER_MIP_POINT
- | BGFX_SAMPLER_U_CLAMP
- | BGFX_SAMPLER_V_CLAMP
- , mem
- );
+ , BGFX_SAMPLER_MIN_POINT
+ | BGFX_SAMPLER_MAG_POINT
+ | BGFX_SAMPLER_MIP_POINT
+ | BGFX_SAMPLER_U_CLAMP
+ | BGFX_SAMPLER_V_CLAMP
+ , mem
+ );
ShaderHandle vsh = createEmbeddedShader(s_embeddedShaders, g_caps.rendererType, "vs_debugfont");
ShaderHandle fsh = createEmbeddedShader(s_embeddedShaders, g_caps.rendererType, "fs_debugfont");
@@ -711,7 +725,7 @@ namespace bgfx
s_ctx->destroyTransientIndexBuffer(m_ib);
}
- static const uint32_t paletteSrgb[] =
+ static const uint32_t s_paletteSrgb[] =
{
0x0, // Black
0xffa46534, // Blue
@@ -730,9 +744,9 @@ namespace bgfx
0xff4fe9fc, // Yellow
0xffeceeee, // White
};
- BX_STATIC_ASSERT(BX_COUNTOF(paletteSrgb) == 16);
+ BX_STATIC_ASSERT(BX_COUNTOF(s_paletteSrgb) == 16);
- static const uint32_t paletteLinear[] =
+ static const uint32_t s_paletteLinear[] =
{
0x0, // Black
0xff5e2108, // Blue
@@ -751,7 +765,7 @@ namespace bgfx
0xff13cff8, // Yellow
0xffd5dada // White
};
- BX_STATIC_ASSERT(BX_COUNTOF(paletteLinear) == 16);
+ BX_STATIC_ASSERT(BX_COUNTOF(s_paletteLinear) == 16);
void blit(RendererContextI* _renderCtx, TextVideoMemBlitter& _blitter, const TextVideoMem& _mem)
{
@@ -780,8 +794,8 @@ namespace bgfx
_renderCtx->blitSetup(_blitter);
const uint32_t* palette = 0 != (s_ctx->m_init.resolution.reset & BGFX_RESET_SRGB_BACKBUFFER)
- ? paletteLinear
- : paletteSrgb
+ ? s_paletteLinear
+ : s_paletteSrgb
;
for (;yy < _mem.m_height;)
@@ -1258,13 +1272,13 @@ namespace bgfx
m_key.m_view = _id;
- SortKey::Enum type = SortKey::SortProgram;
+ SortKey::Enum type;
switch (s_ctx->m_view[_id].m_mode)
{
case ViewMode::Sequential: m_key.m_seq = s_ctx->getSeqIncr(_id); type = SortKey::SortSequence; break;
case ViewMode::DepthAscending: m_key.m_depth = _depth; type = SortKey::SortDepth; break;
case ViewMode::DepthDescending: m_key.m_depth = UINT32_MAX-_depth; type = SortKey::SortDepth; break;
- default: break;
+ default: m_key.m_depth = _depth; type = SortKey::SortProgram; break;
}
uint64_t key = m_key.encodeDraw(type);
@@ -1548,6 +1562,7 @@ namespace bgfx
CAPS_FLAGS(BGFX_CAPS_TEXTURE_2D_ARRAY),
CAPS_FLAGS(BGFX_CAPS_TEXTURE_3D),
CAPS_FLAGS(BGFX_CAPS_TEXTURE_BLIT),
+ CAPS_FLAGS(BGFX_CAPS_TRANSPARENT_BACKBUFFER),
CAPS_FLAGS(BGFX_CAPS_TEXTURE_COMPARE_ALL),
CAPS_FLAGS(BGFX_CAPS_TEXTURE_COMPARE_LEQUAL),
CAPS_FLAGS(BGFX_CAPS_TEXTURE_CUBE_ARRAY),
@@ -1585,6 +1600,9 @@ namespace bgfx
BX_TRACE("");
}
+ BX_TRACE("GPU device, Device ID: %04x, Vendor ID: %04x", g_caps.deviceId, g_caps.vendorId);
+ BX_TRACE("");
+
RendererType::Enum renderers[RendererType::Count];
uint8_t num = getSupportedRenderers(BX_COUNTOF(renderers), renderers);
@@ -1731,18 +1749,20 @@ namespace bgfx
, _resolution.numBackBuffers
, _resolution.maxFrameLatency
);
- BX_TRACE("\t[%c] MSAAx%d", 0 != msaa ? 'x' : ' ', 1<<msaa);
- BX_TRACE("\t[%c] Fullscreen", 0 != (reset & BGFX_RESET_FULLSCREEN) ? 'x' : ' ');
- BX_TRACE("\t[%c] V-sync", 0 != (reset & BGFX_RESET_VSYNC) ? 'x' : ' ');
- BX_TRACE("\t[%c] Max Anisotropy", 0 != (reset & BGFX_RESET_MAXANISOTROPY) ? 'x' : ' ');
- BX_TRACE("\t[%c] Capture", 0 != (reset & BGFX_RESET_CAPTURE) ? 'x' : ' ');
- BX_TRACE("\t[%c] Flush After Render", 0 != (reset & BGFX_RESET_FLUSH_AFTER_RENDER) ? 'x' : ' ');
- BX_TRACE("\t[%c] Flip After Render", 0 != (reset & BGFX_RESET_FLIP_AFTER_RENDER) ? 'x' : ' ');
- BX_TRACE("\t[%c] sRGB Back Buffer", 0 != (reset & BGFX_RESET_SRGB_BACKBUFFER) ? 'x' : ' ');
- BX_TRACE("\t[%c] HDR10", 0 != (reset & BGFX_RESET_HDR10) ? 'x' : ' ');
- BX_TRACE("\t[%c] Hi-DPI", 0 != (reset & BGFX_RESET_HIDPI) ? 'x' : ' ');
- BX_TRACE("\t[%c] Depth Clamp", 0 != (reset & BGFX_RESET_DEPTH_CLAMP) ? 'x' : ' ');
- BX_TRACE("\t[%c] Suspend", 0 != (reset & BGFX_RESET_SUSPEND) ? 'x' : ' ');
+
+ BX_TRACE("\t[%c] MSAAx%d", 0 != msaa ? 'x' : ' ', 1<<msaa);
+ BX_TRACE("\t[%c] Fullscreen", 0 != (reset & BGFX_RESET_FULLSCREEN) ? 'x' : ' ');
+ BX_TRACE("\t[%c] V-sync", 0 != (reset & BGFX_RESET_VSYNC) ? 'x' : ' ');
+ BX_TRACE("\t[%c] Max Anisotropy", 0 != (reset & BGFX_RESET_MAXANISOTROPY) ? 'x' : ' ');
+ BX_TRACE("\t[%c] Capture", 0 != (reset & BGFX_RESET_CAPTURE) ? 'x' : ' ');
+ BX_TRACE("\t[%c] Flush After Render", 0 != (reset & BGFX_RESET_FLUSH_AFTER_RENDER) ? 'x' : ' ');
+ BX_TRACE("\t[%c] Flip After Render", 0 != (reset & BGFX_RESET_FLIP_AFTER_RENDER) ? 'x' : ' ');
+ BX_TRACE("\t[%c] sRGB Back Buffer", 0 != (reset & BGFX_RESET_SRGB_BACKBUFFER) ? 'x' : ' ');
+ BX_TRACE("\t[%c] Transparent Back Buffer", 0 != (reset & BGFX_RESET_TRANSPARENT_BACKBUFFER) ? 'x' : ' ');
+ BX_TRACE("\t[%c] HDR10", 0 != (reset & BGFX_RESET_HDR10) ? 'x' : ' ');
+ BX_TRACE("\t[%c] Hi-DPI", 0 != (reset & BGFX_RESET_HIDPI) ? 'x' : ' ');
+ BX_TRACE("\t[%c] Depth Clamp", 0 != (reset & BGFX_RESET_DEPTH_CLAMP) ? 'x' : ' ');
+ BX_TRACE("\t[%c] Suspend", 0 != (reset & BGFX_RESET_SUSPEND) ? 'x' : ' ');
}
TextureFormat::Enum getViableTextureFormat(const bimg::ImageContainer& _imageContainer)
@@ -1848,11 +1868,19 @@ namespace bgfx
TextureFormat::ATCE,
TextureFormat::ATCI,
TextureFormat::ASTC4x4,
+ TextureFormat::ASTC5x4,
TextureFormat::ASTC5x5,
+ TextureFormat::ASTC6x5,
TextureFormat::ASTC6x6,
TextureFormat::ASTC8x5,
TextureFormat::ASTC8x6,
+ TextureFormat::ASTC8x8,
TextureFormat::ASTC10x5,
+ TextureFormat::ASTC10x6,
+ TextureFormat::ASTC10x8,
+ TextureFormat::ASTC10x10,
+ TextureFormat::ASTC12x10,
+ TextureFormat::ASTC12x12,
TextureFormat::BGRA8, // GL doesn't support BGRA8 without extensions.
TextureFormat::RGBA8, // D3D9 doesn't support RGBA8
};
@@ -1867,21 +1895,7 @@ namespace bgfx
m_init.resolution.maxFrameLatency = bx::min<uint8_t>(_init.resolution.maxFrameLatency, BGFX_CONFIG_MAX_FRAME_LATENCY);
dump(m_init.resolution);
- if (g_platformData.ndt == NULL
- && g_platformData.nwh == NULL
- && g_platformData.context == NULL
- && g_platformData.backBuffer == NULL
- && g_platformData.backBufferDS == NULL)
- {
- bx::memCopy(&g_platformData, &m_init.platformData, sizeof(PlatformData) );
- }
- else
- {
- bx::memCopy(&m_init.platformData, &g_platformData, sizeof(PlatformData) );
- }
-
if (true
- && !BX_ENABLED(BX_PLATFORM_EMSCRIPTEN || BX_PLATFORM_PS4)
&& RendererType::Noop != m_init.type
&& NULL == m_init.platformData.ndt
&& NULL == m_init.platformData.nwh
@@ -1893,9 +1907,10 @@ namespace bgfx
BX_TRACE("bgfx platform data like window handle or backbuffer is not set, creating headless device.");
}
+ bx::memCopy(&g_platformData, &m_init.platformData, sizeof(PlatformData) );
+
m_exit = false;
m_flipped = true;
- m_frames = 0;
m_debug = BGFX_DEBUG_NONE;
m_frameTimeLast = bx::getHPCounter();
@@ -2297,6 +2312,8 @@ namespace bgfx
m_submit->m_capture = _capture;
+ uint32_t frameNum = m_submit->m_frameNum;
+
BGFX_PROFILER_SCOPE("bgfx/API thread frame", 0xff2040ff);
// wait for render thread to finish
renderSemWait();
@@ -2304,7 +2321,7 @@ namespace bgfx
m_encoder[0].begin(m_submit, 0);
- return m_frames;
+ return frameNum;
}
void Context::frameNoRenderWait()
@@ -2347,8 +2364,8 @@ namespace bgfx
renderFrame();
}
- m_frames++;
- m_submit->start();
+ uint32_t nextFrameNum = m_render->m_frameNum + 1;
+ m_submit->start(nextFrameNum);
bx::memSet(m_seq, 0, sizeof(m_seq) );
@@ -2655,11 +2672,6 @@ namespace bgfx
#endif // BX_PLATFORM_WINDOWS
}
- static int32_t compareDescending(const void* _lhs, const void* _rhs)
- {
- return *(const int32_t*)_rhs - *(const int32_t*)_lhs;
- }
-
RendererContextI* rendererCreate(const Init& _init)
{
int32_t scores[RendererType::Count];
@@ -2698,9 +2710,12 @@ namespace bgfx
}
else if (BX_ENABLED(BX_PLATFORM_LINUX) )
{
- score += RendererType::Vulkan == renderer ? 30 : 0;
- score += RendererType::OpenGL == renderer ? 20 : 0;
- score += RendererType::OpenGLES == renderer ? 10 : 0;
+ score += RendererType::Vulkan == renderer ? 50 : 0;
+ score += RendererType::OpenGL == renderer ? 40 : 0;
+ score += RendererType::OpenGLES == renderer ? 30 : 0;
+ score += RendererType::Direct3D12 == renderer ? 20 : 0;
+ score += RendererType::Direct3D11 == renderer ? 10 : 0;
+ score += RendererType::Direct3D9 == renderer ? 5 : 0;
}
else if (BX_ENABLED(BX_PLATFORM_OSX) )
{
@@ -2737,7 +2752,7 @@ namespace bgfx
}
}
- bx::quickSort(scores, numScores, sizeof(int32_t), compareDescending);
+ bx::quickSort(scores, numScores, bx::compareDescending<int32_t>);
RendererContextI* renderCtx = NULL;
for (uint32_t ii = 0; ii < numScores; ++ii)
@@ -3106,14 +3121,15 @@ namespace bgfx
}
bx::MemoryReader reader(mem->data, mem->size);
+ bx::Error err;
uint32_t magic;
- bx::read(&reader, magic);
+ bx::read(&reader, magic, &err);
if (BGFX_CHUNK_MAGIC_TEX == magic)
{
TextureCreate tc;
- bx::read(&reader, tc);
+ bx::read(&reader, tc, &err);
if (NULL != tc.m_mem)
{
@@ -3817,13 +3833,23 @@ namespace bgfx
BGFX_CHECK_HANDLE("setTexture/UniformHandle", s_ctx->m_uniformHandle, _sampler);
BGFX_CHECK_HANDLE_INVALID_OK("setTexture/TextureHandle", s_ctx->m_textureHandle, _handle);
BX_ASSERT(_stage < g_caps.limits.maxTextureSamplers, "Invalid stage %d (max %d).", _stage, g_caps.limits.maxTextureSamplers);
+
+ if (isValid(_handle) )
+ {
+ const TextureRef& ref = s_ctx->m_textureRef[_handle.idx];
+ BX_ASSERT(!ref.isReadBack()
+ , "Can't sample from texture which was created with BGFX_TEXTURE_READ_BACK. This is CPU only texture."
+ );
+ BX_UNUSED(ref);
+ }
+
BGFX_ENCODER(setTexture(_stage, _sampler, _handle, _flags) );
}
void Encoder::touch(ViewId _id)
{
- ProgramHandle handle = BGFX_INVALID_HANDLE;
- submit(_id, handle);
+ discard();
+ submit(_id, BGFX_INVALID_HANDLE);
}
void Encoder::submit(ViewId _id, ProgramHandle _program, uint32_t _depth, uint8_t _flags)
@@ -3852,6 +3878,16 @@ namespace bgfx
BGFX_ENCODER(submit(_id, _program, _indirectHandle, _start, _num, _depth, _flags) );
}
+ void Encoder::submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags)
+ {
+ BGFX_CHECK_HANDLE_INVALID_OK("submit", s_ctx->m_programHandle, _program);
+ BGFX_CHECK_HANDLE("submit", s_ctx->m_vertexBufferHandle, _indirectHandle);
+ BGFX_CHECK_HANDLE("submit", s_ctx->m_indexBufferHandle, _numHandle);
+ BGFX_CHECK_CAPS(BGFX_CAPS_DRAW_INDIRECT, "Draw indirect is not supported!");
+ BGFX_CHECK_CAPS(BGFX_CAPS_DRAW_INDIRECT_COUNT, "Draw indirect count is not supported!");
+ BGFX_ENCODER(submit(_id, _program, _indirectHandle, _start, _numHandle, _numIndex, _numMax, _depth, _flags) );
+ }
+
void Encoder::setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access)
{
BX_ASSERT(_stage < g_caps.limits.maxComputeBindings, "Invalid stage %d (max %d).", _stage, g_caps.limits.maxComputeBindings);
@@ -3901,6 +3937,18 @@ namespace bgfx
BX_ASSERT(_format != TextureFormat::BGRA8
, "Can't use TextureFormat::BGRA8 with compute, use TextureFormat::RGBA8 instead."
);
+
+ if (isValid(_handle) )
+ {
+ const TextureRef& ref = s_ctx->m_textureRef[_handle.idx];
+ BX_ASSERT(!ref.isReadBack()
+ , "Can't texture (handle %d, '%S') which was created with BGFX_TEXTURE_READ_BACK with compute. This is CPU only texture."
+ , _handle.idx
+ , &ref.m_name
+ );
+ BX_UNUSED(ref);
+ }
+
BGFX_ENCODER(setImage(_stage, _handle, _mip, _access, _format) );
}
@@ -3939,6 +3987,12 @@ namespace bgfx
const TextureRef& src = s_ctx->m_textureRef[_src.idx];
const TextureRef& dst = s_ctx->m_textureRef[_dst.idx];
+ BX_ASSERT(dst.isBlitDst()
+ , "Blit destination texture (handle %d, '%S') is not created with `BGFX_TEXTURE_BLIT_DST` flag."
+ , _dst.idx
+ , &dst.m_name
+ );
+
BX_ASSERT(src.m_format == dst.m_format
, "Texture format must match (src %s, dst %s)."
, bimg::getName(bimg::TextureFormat::Enum(src.m_format) )
@@ -4362,7 +4416,7 @@ namespace bgfx
{
const Attachment& at = _attachment[ii];
const TextureHandle texHandle = at.handle;
- const TextureRef& tr = s_ctx->m_textureRef[texHandle.idx];
+ const TextureRef& tr = s_ctx->m_textureRef[texHandle.idx];
BGFX_ERROR_CHECK(true
&& isValid(texHandle)
@@ -4375,14 +4429,15 @@ namespace bgfx
, texHandle.idx
);
- BGFX_ERROR_CHECK(
- at.mip < tr.m_numMips
+ BGFX_ERROR_CHECK(true
+ && at.mip < tr.m_numMips
, _err
, BGFX_ERROR_FRAME_BUFFER_VALIDATION
, "Invalid texture mip level."
- , "Attachment %d, Mip %d, texture number of mips %d."
+ , "Attachment %d, Mip %d, texture (handle %d) number of mips %d."
, ii
, at.mip
+ , texHandle.idx
, tr.m_numMips
);
@@ -4392,8 +4447,8 @@ namespace bgfx
: tr.m_numLayers * (tr.isCubeMap() ? 6 : 1)
;
- BGFX_ERROR_CHECK(
- (at.layer + at.numLayers) <= numLayers
+ BGFX_ERROR_CHECK(true
+ && (at.layer + at.numLayers) <= numLayers
, _err
, BGFX_ERROR_FRAME_BUFFER_VALIDATION
, "Invalid texture layer range."
@@ -4405,8 +4460,8 @@ namespace bgfx
);
}
- BGFX_ERROR_CHECK(
- _attachment[0].numLayers == at.numLayers
+ BGFX_ERROR_CHECK(true
+ && _attachment[0].numLayers == at.numLayers
, _err
, BGFX_ERROR_FRAME_BUFFER_VALIDATION
, "Mismatch in attachment layer count."
@@ -4416,8 +4471,8 @@ namespace bgfx
, _attachment[0].numLayers
);
- BGFX_ERROR_CHECK(
- firstTexture.m_bbRatio == tr.m_bbRatio
+ BGFX_ERROR_CHECK(true
+ && firstTexture.m_bbRatio == tr.m_bbRatio
, _err
, BGFX_ERROR_FRAME_BUFFER_VALIDATION
, "Mismatch in texture back-buffer ratio."
@@ -4427,8 +4482,8 @@ namespace bgfx
, firstTexture.m_bbRatio
);
- BGFX_ERROR_CHECK(
- firstTexture.m_numSamples == tr.m_numSamples
+ BGFX_ERROR_CHECK(true
+ && firstTexture.m_numSamples == tr.m_numSamples
, _err
, BGFX_ERROR_FRAME_BUFFER_VALIDATION
, "Mismatch in texture sample count."
@@ -4461,14 +4516,27 @@ namespace bgfx
if (bimg::isDepth(bimg::TextureFormat::Enum(tr.m_format) ) )
{
++depth;
+
+ BGFX_ERROR_CHECK(
+ // if BGFX_TEXTURE_RT_MSAA_X2 or greater than BGFX_TEXTURE_RT_WRITE_ONLY is required
+ // if BGFX_TEXTURE_RT with no MSSA then WRITE_ONLY is not required.
+ (1 == ((tr.m_flags & BGFX_TEXTURE_RT_MSAA_MASK) >> BGFX_TEXTURE_RT_MSAA_SHIFT))
+ || (0 != (tr.m_flags & BGFX_TEXTURE_RT_WRITE_ONLY))
+ , _err
+ , BGFX_ERROR_FRAME_BUFFER_VALIDATION
+ , "Frame buffer depth MSAA texture cannot be resolved. It must be created with `BGFX_TEXTURE_RT_WRITE_ONLY` flag."
+ , "Attachment %d, texture flags 0x%016" PRIx64 "."
+ , ii
+ , tr.m_flags
+ );
}
else
{
++color;
}
- BGFX_ERROR_CHECK(
- 0 == (tr.m_flags & BGFX_TEXTURE_READ_BACK)
+ BGFX_ERROR_CHECK(true
+ && 0 == (tr.m_flags & BGFX_TEXTURE_READ_BACK)
, _err
, BGFX_ERROR_FRAME_BUFFER_VALIDATION
, "Frame buffer texture cannot be created with `BGFX_TEXTURE_READ_BACK`."
@@ -4477,8 +4545,8 @@ namespace bgfx
, tr.m_flags
);
- BGFX_ERROR_CHECK(
- 0 != (tr.m_flags & BGFX_TEXTURE_RT_MASK)
+ BGFX_ERROR_CHECK(true
+ && 0 != (tr.m_flags & BGFX_TEXTURE_RT_MASK)
, _err
, BGFX_ERROR_FRAME_BUFFER_VALIDATION
, "Frame buffer texture is not created with one of `BGFX_TEXTURE_RT*` flags."
@@ -4488,8 +4556,8 @@ namespace bgfx
);
}
- BGFX_ERROR_CHECK(
- color <= g_caps.limits.maxFBAttachments
+ BGFX_ERROR_CHECK(true
+ && color <= g_caps.limits.maxFBAttachments
, _err
, BGFX_ERROR_FRAME_BUFFER_VALIDATION
, "Too many frame buffer color attachments."
@@ -4498,8 +4566,8 @@ namespace bgfx
, g_caps.limits.maxFBAttachments
);
- BGFX_ERROR_CHECK(
- depth <= 1
+ BGFX_ERROR_CHECK(true
+ && depth <= 1
, _err
, BGFX_ERROR_FRAME_BUFFER_VALIDATION
, "There can be only one depth texture attachment."
@@ -4516,7 +4584,7 @@ namespace bgfx
return err.isOk();
}
- static void isTextureValid(uint16_t _depth, bool _cubeMap, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags, bx::Error* _err)
+ static void isTextureValid(uint16_t _width, uint16_t _height, uint16_t _depth, bool _cubeMap, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags, bx::Error* _err)
{
BX_ERROR_SCOPE(_err, "Texture validation");
@@ -4542,6 +4610,18 @@ namespace bgfx
);
BGFX_ERROR_CHECK(false
+ || _width <= g_caps.limits.maxTextureSize
+ || _height <= g_caps.limits.maxTextureSize
+ , _err
+ , BGFX_ERROR_TEXTURE_VALIDATION
+ , "Requested texture width/height is above the `maxTextureSize` limit."
+ , "Texture width x height requested %d x %d (Max: %d)."
+ , _width
+ , _height
+ , g_caps.limits.maxTextureSize
+ );
+
+ BGFX_ERROR_CHECK(false
|| 0 == (_flags & BGFX_TEXTURE_RT_MASK)
|| 0 == (_flags & BGFX_TEXTURE_READ_BACK)
, _err
@@ -4551,6 +4631,15 @@ namespace bgfx
);
BGFX_ERROR_CHECK(false
+ || 0 == (_flags & BGFX_TEXTURE_COMPUTE_WRITE)
+ || 0 == (_flags & BGFX_TEXTURE_READ_BACK)
+ , _err
+ , BGFX_ERROR_TEXTURE_VALIDATION
+ , "Can't create compute texture with `BGFX_TEXTURE_READ_BACK` flag."
+ , ""
+ );
+
+ BGFX_ERROR_CHECK(false
|| 1 >= _numLayers
|| 0 != (g_caps.supported & BGFX_CAPS_TEXTURE_2D_ARRAY)
, _err
@@ -4560,6 +4649,16 @@ namespace bgfx
, ""
);
+ BGFX_ERROR_CHECK(false
+ || _numLayers <= g_caps.limits.maxTextureLayers
+ , _err
+ , BGFX_ERROR_TEXTURE_VALIDATION
+ , "Requested number of texture array layers is above the `maxTextureLayers` limit."
+ , "Number of texture array layers requested %d (Max: %d)."
+ , _numLayers
+ , g_caps.limits.maxTextureLayers
+ );
+
bool formatSupported;
if (0 != (_flags & (BGFX_TEXTURE_RT | BGFX_TEXTURE_RT_WRITE_ONLY)) )
{
@@ -4607,7 +4706,7 @@ namespace bgfx
formatSupported
, _err
, BGFX_ERROR_TEXTURE_VALIDATION
- , "Texture format is not supported!"
+ , "Texture format is not supported! "
"Use bgfx::isTextureValid to check support for texture format before creating it."
, "Texture format: %s."
, getName(_format)
@@ -4641,7 +4740,7 @@ namespace bgfx
bool isTextureValid(uint16_t _depth, bool _cubeMap, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags)
{
bx::Error err;
- isTextureValid(_depth, _cubeMap, _numLayers, _format, _flags, &err);
+ isTextureValid(0, 0, _depth, _cubeMap, _numLayers, _format, _flags, &err);
return err.isOk();
}
@@ -4725,15 +4824,6 @@ namespace bgfx
static TextureHandle createTexture2D(BackbufferRatio::Enum _ratio, uint16_t _width, uint16_t _height, bool _hasMips, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags, const Memory* _mem)
{
- bx::Error err;
- isTextureValid(0, false, _numLayers, _format, _flags, &err);
- BGFX_ERROR_ASSERT(&err);
-
- if (!err.isOk() )
- {
- return BGFX_INVALID_HANDLE;
- }
-
if (BackbufferRatio::Count != _ratio)
{
_width = uint16_t(s_ctx->m_init.resolution.width);
@@ -4741,6 +4831,14 @@ namespace bgfx
getTextureSizeFromRatio(_ratio, _width, _height);
}
+ bx::ErrorAssert err;
+ isTextureValid(_width, _height, 0, false, _numLayers, _format, _flags, &err);
+
+ if (!err.isOk() )
+ {
+ return BGFX_INVALID_HANDLE;
+ }
+
const uint8_t numMips = calcNumMips(_hasMips, _width, _height);
_numLayers = bx::max<uint16_t>(_numLayers, 1);
@@ -4761,7 +4859,7 @@ namespace bgfx
bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
- bx::write(&writer, magic);
+ bx::write(&writer, magic, bx::ErrorAssert{});
TextureCreate tc;
tc.m_width = _width;
@@ -4772,7 +4870,7 @@ namespace bgfx
tc.m_format = _format;
tc.m_cubeMap = false;
tc.m_mem = _mem;
- bx::write(&writer, tc);
+ bx::write(&writer, tc, bx::ErrorAssert{});
return s_ctx->createTexture(mem, _flags, 0, NULL, _ratio, NULL != _mem);
}
@@ -4791,9 +4889,8 @@ namespace bgfx
TextureHandle createTexture3D(uint16_t _width, uint16_t _height, uint16_t _depth, bool _hasMips, TextureFormat::Enum _format, uint64_t _flags, const Memory* _mem)
{
- bx::Error err;
- isTextureValid(_depth, false, 1, _format, _flags, &err);
- BGFX_ERROR_ASSERT(&err);
+ bx::ErrorAssert err;
+ isTextureValid(_width, _height, _depth, false, 1, _format, _flags, &err);
if (!err.isOk() )
{
@@ -4819,7 +4916,7 @@ namespace bgfx
bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
- bx::write(&writer, magic);
+ bx::write(&writer, magic, bx::ErrorAssert{});
TextureCreate tc;
tc.m_width = _width;
@@ -4830,16 +4927,15 @@ namespace bgfx
tc.m_format = _format;
tc.m_cubeMap = false;
tc.m_mem = _mem;
- bx::write(&writer, tc);
+ bx::write(&writer, tc, bx::ErrorAssert{});
return s_ctx->createTexture(mem, _flags, 0, NULL, BackbufferRatio::Count, NULL != _mem);
}
TextureHandle createTextureCube(uint16_t _size, bool _hasMips, uint16_t _numLayers, TextureFormat::Enum _format, uint64_t _flags, const Memory* _mem)
{
- bx::Error err;
- isTextureValid(0, true, _numLayers, _format, _flags, &err);
- BGFX_ERROR_ASSERT(&err);
+ bx::ErrorAssert err;
+ isTextureValid(_size, _size, 0, true, _numLayers, _format, _flags, &err);
if (!err.isOk() )
{
@@ -4866,7 +4962,7 @@ namespace bgfx
bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
- bx::write(&writer, magic);
+ bx::write(&writer, magic, bx::ErrorAssert{});
TextureCreate tc;
tc.m_width = _size;
@@ -4877,7 +4973,7 @@ namespace bgfx
tc.m_format = _format;
tc.m_cubeMap = true;
tc.m_mem = _mem;
- bx::write(&writer, tc);
+ bx::write(&writer, tc, bx::ErrorAssert{});
return s_ctx->createTexture(mem, _flags, 0, NULL, BackbufferRatio::Count, NULL != _mem);
}
@@ -5234,7 +5330,8 @@ namespace bgfx
void setIndexBuffer(IndexBufferHandle _handle)
{
- setIndexBuffer(_handle, 0, UINT32_MAX);
+ BGFX_CHECK_ENCODER0();
+ s_ctx->m_encoder0->setIndexBuffer(_handle);
}
void setIndexBuffer(IndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
@@ -5245,7 +5342,8 @@ namespace bgfx
void setIndexBuffer(DynamicIndexBufferHandle _handle)
{
- setIndexBuffer(_handle, 0, UINT32_MAX);
+ BGFX_CHECK_ENCODER0();
+ s_ctx->m_encoder0->setIndexBuffer(_handle);
}
void setIndexBuffer(DynamicIndexBufferHandle _handle, uint32_t _firstIndex, uint32_t _numIndices)
@@ -5256,7 +5354,8 @@ namespace bgfx
void setIndexBuffer(const TransientIndexBuffer* _tib)
{
- setIndexBuffer(_tib, 0, UINT32_MAX);
+ BGFX_CHECK_ENCODER0();
+ s_ctx->m_encoder0->setIndexBuffer(_tib);
}
void setIndexBuffer(const TransientIndexBuffer* _tib, uint32_t _firstIndex, uint32_t _numIndices)
@@ -5279,7 +5378,8 @@ namespace bgfx
void setVertexBuffer(uint8_t _stream, VertexBufferHandle _handle)
{
- setVertexBuffer(_stream, _handle, 0, UINT32_MAX);
+ BGFX_CHECK_ENCODER0();
+ s_ctx->m_encoder0->setVertexBuffer(_stream, _handle);
}
void setVertexBuffer(
@@ -5296,7 +5396,8 @@ namespace bgfx
void setVertexBuffer(uint8_t _stream, DynamicVertexBufferHandle _handle)
{
- setVertexBuffer(_stream, _handle, 0, UINT32_MAX);
+ BGFX_CHECK_ENCODER0();
+ s_ctx->m_encoder0->setVertexBuffer(_stream, _handle);
}
void setVertexBuffer(
@@ -5313,7 +5414,8 @@ namespace bgfx
void setVertexBuffer(uint8_t _stream, const TransientVertexBuffer* _tvb)
{
- setVertexBuffer(_stream, _tvb, 0, UINT32_MAX);
+ BGFX_CHECK_ENCODER0();
+ s_ctx->m_encoder0->setVertexBuffer(_stream, _tvb);
}
void setVertexCount(uint32_t _numVertices)
@@ -5360,14 +5462,14 @@ namespace bgfx
void touch(ViewId _id)
{
- ProgramHandle handle = BGFX_INVALID_HANDLE;
- submit(_id, handle);
+ BGFX_CHECK_ENCODER0();
+ s_ctx->m_encoder0->touch(_id);
}
void submit(ViewId _id, ProgramHandle _program, uint32_t _depth, uint8_t _flags)
{
- OcclusionQueryHandle handle = BGFX_INVALID_HANDLE;
- submit(_id, _program, handle, _depth, _flags);
+ BGFX_CHECK_ENCODER0();
+ s_ctx->m_encoder0->submit(_id, _program, _depth, _flags);
}
void submit(ViewId _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint32_t _depth, uint8_t _flags)
@@ -5382,6 +5484,12 @@ namespace bgfx
s_ctx->m_encoder0->submit(_id, _program, _indirectHandle, _start, _num, _depth, _flags);
}
+ void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags)
+ {
+ BGFX_CHECK_ENCODER0();
+ s_ctx->m_encoder0->submit(_id, _program, _indirectHandle, _start, _numHandle, _numIndex, _numMax, _depth, _flags);
+ }
+
void setBuffer(uint8_t _stage, IndexBufferHandle _handle, Access::Enum _access)
{
BGFX_CHECK_ENCODER0();
@@ -5438,7 +5546,8 @@ namespace bgfx
void blit(ViewId _id, TextureHandle _dst, uint16_t _dstX, uint16_t _dstY, TextureHandle _src, uint16_t _srcX, uint16_t _srcY, uint16_t _width, uint16_t _height)
{
- blit(_id, _dst, 0, _dstX, _dstY, 0, _src, 0, _srcX, _srcY, 0, _width, _height, 0);
+ BGFX_CHECK_ENCODER0();
+ s_ctx->m_encoder0->blit(_id, _dst, _dstX, _dstY, _src, _srcX, _srcY, _width, _height);
}
void blit(ViewId _id, TextureHandle _dst, uint8_t _dstMip, uint16_t _dstX, uint16_t _dstY, uint16_t _dstZ, TextureHandle _src, uint8_t _srcMip, uint16_t _srcX, uint16_t _srcY, uint16_t _srcZ, uint16_t _width, uint16_t _height, uint16_t _depth)
@@ -5499,11 +5608,19 @@ BGFX_TEXTURE_FORMAT_BIMG(ATC);
BGFX_TEXTURE_FORMAT_BIMG(ATCE);
BGFX_TEXTURE_FORMAT_BIMG(ATCI);
BGFX_TEXTURE_FORMAT_BIMG(ASTC4x4);
+BGFX_TEXTURE_FORMAT_BIMG(ASTC5x4);
BGFX_TEXTURE_FORMAT_BIMG(ASTC5x5);
+BGFX_TEXTURE_FORMAT_BIMG(ASTC6x5);
BGFX_TEXTURE_FORMAT_BIMG(ASTC6x6);
BGFX_TEXTURE_FORMAT_BIMG(ASTC8x5);
BGFX_TEXTURE_FORMAT_BIMG(ASTC8x6);
+BGFX_TEXTURE_FORMAT_BIMG(ASTC8x8);
BGFX_TEXTURE_FORMAT_BIMG(ASTC10x5);
+BGFX_TEXTURE_FORMAT_BIMG(ASTC10x6);
+BGFX_TEXTURE_FORMAT_BIMG(ASTC10x8);
+BGFX_TEXTURE_FORMAT_BIMG(ASTC10x10);
+BGFX_TEXTURE_FORMAT_BIMG(ASTC12x10);
+BGFX_TEXTURE_FORMAT_BIMG(ASTC12x12);
BGFX_TEXTURE_FORMAT_BIMG(Unknown);
BGFX_TEXTURE_FORMAT_BIMG(R1);
BGFX_TEXTURE_FORMAT_BIMG(A8);
@@ -5549,8 +5666,11 @@ BGFX_TEXTURE_FORMAT_BIMG(RGBA16S);
BGFX_TEXTURE_FORMAT_BIMG(RGBA32I);
BGFX_TEXTURE_FORMAT_BIMG(RGBA32U);
BGFX_TEXTURE_FORMAT_BIMG(RGBA32F);
+BGFX_TEXTURE_FORMAT_BIMG(B5G6R5);
BGFX_TEXTURE_FORMAT_BIMG(R5G6B5);
+BGFX_TEXTURE_FORMAT_BIMG(BGRA4);
BGFX_TEXTURE_FORMAT_BIMG(RGBA4);
+BGFX_TEXTURE_FORMAT_BIMG(BGR5A1);
BGFX_TEXTURE_FORMAT_BIMG(RGB5A1);
BGFX_TEXTURE_FORMAT_BIMG(RGB10A2);
BGFX_TEXTURE_FORMAT_BIMG(RG11B10F);
@@ -5654,6 +5774,8 @@ BX_STATIC_ASSERT( (0
| BGFX_CAPS_VERTEX_ATTRIB_HALF
| BGFX_CAPS_VERTEX_ATTRIB_UINT10
| BGFX_CAPS_VERTEX_ID
+ | BGFX_CAPS_VIEWPORT_LAYER_ARRAY
+ | BGFX_CAPS_DRAW_INDIRECT_COUNT
) == (0
^ BGFX_CAPS_ALPHA_TO_COVERAGE
^ BGFX_CAPS_BLEND_INDEPENDENT
@@ -5679,6 +5801,8 @@ BX_STATIC_ASSERT( (0
^ BGFX_CAPS_VERTEX_ATTRIB_HALF
^ BGFX_CAPS_VERTEX_ATTRIB_UINT10
^ BGFX_CAPS_VERTEX_ID
+ ^ BGFX_CAPS_VIEWPORT_LAYER_ARRAY
+ ^ BGFX_CAPS_DRAW_INDIRECT_COUNT
) );
#undef FLAGS_MASK_TEST
diff --git a/3rdparty/bgfx/src/bgfx.idl.inl b/3rdparty/bgfx/src/bgfx.idl.inl
index 572f8febace..2c3b16fe469 100644
--- a/3rdparty/bgfx/src/bgfx.idl.inl
+++ b/3rdparty/bgfx/src/bgfx.idl.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -885,6 +885,15 @@ BGFX_C_API void bgfx_encoder_submit_indirect(bgfx_encoder_t* _this, bgfx_view_id
This->submit((bgfx::ViewId)_id, program.cpp, indirectHandle.cpp, _start, _num, _depth, _flags);
}
+BGFX_C_API void bgfx_encoder_submit_indirect_count(bgfx_encoder_t* _this, bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags)
+{
+ bgfx::Encoder* This = (bgfx::Encoder*)_this;
+ union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } program = { _program };
+ union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } indirectHandle = { _indirectHandle };
+ union { bgfx_index_buffer_handle_t c; bgfx::IndexBufferHandle cpp; } numHandle = { _numHandle };
+ This->submit((bgfx::ViewId)_id, program.cpp, indirectHandle.cpp, _start, numHandle.cpp, _numIndex, _numMax, _depth, _flags);
+}
+
BGFX_C_API void bgfx_encoder_set_compute_index_buffer(bgfx_encoder_t* _this, uint8_t _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access)
{
bgfx::Encoder* This = (bgfx::Encoder*)_this;
@@ -1155,6 +1164,14 @@ BGFX_C_API void bgfx_submit_indirect(bgfx_view_id_t _id, bgfx_program_handle_t _
bgfx::submit((bgfx::ViewId)_id, program.cpp, indirectHandle.cpp, _start, _num, _depth, _flags);
}
+BGFX_C_API void bgfx_submit_indirect_count(bgfx_view_id_t _id, bgfx_program_handle_t _program, bgfx_indirect_buffer_handle_t _indirectHandle, uint16_t _start, bgfx_index_buffer_handle_t _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags)
+{
+ union { bgfx_program_handle_t c; bgfx::ProgramHandle cpp; } program = { _program };
+ union { bgfx_indirect_buffer_handle_t c; bgfx::IndirectBufferHandle cpp; } indirectHandle = { _indirectHandle };
+ union { bgfx_index_buffer_handle_t c; bgfx::IndexBufferHandle cpp; } numHandle = { _numHandle };
+ bgfx::submit((bgfx::ViewId)_id, program.cpp, indirectHandle.cpp, _start, numHandle.cpp, _numIndex, _numMax, _depth, _flags);
+}
+
BGFX_C_API void bgfx_set_compute_index_buffer(uint8_t _stage, bgfx_index_buffer_handle_t _handle, bgfx_access_t _access)
{
union { bgfx_index_buffer_handle_t c; bgfx::IndexBufferHandle cpp; } handle = { _handle };
@@ -1393,6 +1410,7 @@ BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version)
bgfx_encoder_submit,
bgfx_encoder_submit_occlusion_query,
bgfx_encoder_submit_indirect,
+ bgfx_encoder_submit_indirect_count,
bgfx_encoder_set_compute_index_buffer,
bgfx_encoder_set_compute_vertex_buffer,
bgfx_encoder_set_compute_dynamic_index_buffer,
@@ -1438,6 +1456,7 @@ BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version)
bgfx_submit,
bgfx_submit_occlusion_query,
bgfx_submit_indirect,
+ bgfx_submit_indirect_count,
bgfx_set_compute_index_buffer,
bgfx_set_compute_vertex_buffer,
bgfx_set_compute_dynamic_index_buffer,
diff --git a/3rdparty/bgfx/src/bgfx_compute.sh b/3rdparty/bgfx/src/bgfx_compute.sh
index d05b23280a3..59dda85e067 100644
--- a/3rdparty/bgfx/src/bgfx_compute.sh
+++ b/3rdparty/bgfx/src/bgfx_compute.sh
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_COMPUTE_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/src/bgfx_p.h b/3rdparty/bgfx/src/bgfx_p.h
index e75d07a3a37..31ede49d044 100644
--- a/3rdparty/bgfx/src/bgfx_p.h
+++ b/3rdparty/bgfx/src/bgfx_p.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_P_H_HEADER_GUARD
@@ -8,16 +8,17 @@
#include <bx/platform.h>
-#ifndef BGFX_CONFIG_DEBUG
-# define BGFX_CONFIG_DEBUG 0
-#endif // BGFX_CONFIG_DEBUG
+#ifndef BX_CONFIG_DEBUG
+# error "BX_CONFIG_DEBUG must be defined in build script!"
+#endif // BX_CONFIG_DEBUG
-#if BGFX_CONFIG_DEBUG || BX_COMPILER_CLANG_ANALYZER
-# define BX_TRACE _BX_TRACE
-# define BX_WARN _BX_WARN
-# define BX_ASSERT _BX_ASSERT
-# define BX_CONFIG_ALLOCATOR_DEBUG 1
-#endif // BGFX_CONFIG_DEBUG
+#define BGFX_CONFIG_DEBUG BX_CONFIG_DEBUG
+
+#if BX_CONFIG_DEBUG
+# define BX_TRACE _BGFX_TRACE
+# define BX_WARN _BGFX_WARN
+# define BX_ASSERT _BGFX_ASSERT
+#endif // BX_CONFIG_DEBUG
#include <bgfx/bgfx.h>
#include "config.h"
@@ -78,12 +79,12 @@ namespace bgfx
inline bool operator==(const UniformHandle& _lhs, const UniformHandle& _rhs) { return _lhs.idx == _rhs.idx; }
}
-#define _BX_TRACE(_format, ...) \
+#define _BGFX_TRACE(_format, ...) \
BX_MACRO_BLOCK_BEGIN \
bgfx::trace(__FILE__, uint16_t(__LINE__), "BGFX " _format "\n", ##__VA_ARGS__); \
BX_MACRO_BLOCK_END
-#define _BX_WARN(_condition, _format, ...) \
+#define _BGFX_WARN(_condition, _format, ...) \
BX_MACRO_BLOCK_BEGIN \
if (!BX_IGNORE_C4127(_condition) ) \
{ \
@@ -91,11 +92,11 @@ namespace bgfx
} \
BX_MACRO_BLOCK_END
-#define _BX_ASSERT(_condition, _format, ...) \
+#define _BGFX_ASSERT(_condition, _format, ...) \
BX_MACRO_BLOCK_BEGIN \
if (!BX_IGNORE_C4127(_condition) ) \
{ \
- BX_TRACE("CHECK " _format, ##__VA_ARGS__); \
+ BX_TRACE("ASSERT " _format, ##__VA_ARGS__); \
bgfx::fatal(__FILE__, uint16_t(__LINE__), bgfx::Fatal::DebugCheck, _format, ##__VA_ARGS__); \
} \
BX_MACRO_BLOCK_END
@@ -112,25 +113,15 @@ namespace bgfx
if (!BX_IGNORE_C4127(_condition) ) \
{ \
BX_ERROR_SET(_err, _result, _msg); \
- BX_TRACE("%.*s: 0x%08x '%.*s' - " _format \
- , bxErrorScope.getName().getLength() \
- , bxErrorScope.getName().getPtr() \
+ BX_TRACE("%S: 0x%08x '%S' - " _format \
+ , &bxErrorScope.getName() \
, _err->get().code \
- , _err->getMessage().getLength() \
- , _err->getMessage().getPtr() \
+ , &_err->getMessage() \
, ##__VA_ARGS__ \
); \
return; \
}
-#define BGFX_ERROR_ASSERT(_err) \
- BX_ASSERT((_err)->isOk() \
- , "ERROR: 0x%08x '%.*s'." \
- , (_err)->get().code \
- , (_err)->getMessage().getLength() \
- , (_err)->getMessage().getPtr() \
- );
-
#include <bx/allocator.h>
#include <bx/bx.h>
#include <bx/cpu.h>
@@ -226,8 +217,6 @@ namespace stl = std;
#if BX_PLATFORM_ANDROID
# include <android/native_window.h>
-#elif BX_PLATFORM_WINDOWS
-# include <windows.h>
#endif // BX_PLATFORM_*
#define BGFX_MAX_COMPUTE_BINDINGS BGFX_CONFIG_MAX_TEXTURE_SAMPLERS
@@ -312,37 +301,119 @@ namespace bgfx
typedef uint32_t RenderItemCount;
#endif // BGFX_CONFIG_MAX_DRAW_CALLS < (64<<10)
+ ///
struct Handle
{
+ ///
+ struct TypeName
+ {
+ const char* abrvName;
+ const char* fullName;
+ };
+
+ ///
enum Enum
{
+ DynamicIndexBuffer,
+ DynamicVertexBuffer,
+ FrameBuffer,
IndexBuffer,
+ IndirectBuffer,
+ OcclusionQuery,
+ Program,
Shader,
Texture,
+ Uniform,
VertexBuffer,
+ VertexLayout,
Count
};
- uint16_t type;
- uint16_t idx;
- };
+ template<typename Ty>
+ static constexpr Enum toEnum();
-#define CONVERT_HANDLE(_name) \
- inline Handle convert(_name##Handle _handle) \
- { \
- Handle handle = { Handle::_name, _handle.idx }; \
- return handle; \
- }
+ constexpr Handle()
+ : idx(kInvalidHandle)
+ , type(Count)
+ {
+ }
+
+ template<typename Ty>
+ constexpr Handle(Ty _handle)
+ : idx(_handle.idx)
+ , type(uint16_t(toEnum<Ty>() ) )
+ {
+ }
+
+ template<typename Ty>
+ constexpr Ty to() const
+ {
+ if (type == toEnum<Ty>() )
+ {
+ return Ty{ idx };
+ }
+
+ BX_ASSERT(type == toEnum<Ty>(), "Handle type %s, cannot be converted to %s."
+ , getTypeName().fullName
+ , getTypeName(toEnum<Ty>() ).fullName
+ );
+ return { kInvalidHandle };
+ }
+
+ Enum getType() const
+ {
+ return Enum(type);
+ }
- CONVERT_HANDLE(IndexBuffer);
- CONVERT_HANDLE(Shader);
- CONVERT_HANDLE(Texture);
- CONVERT_HANDLE(VertexBuffer);
+ static const TypeName& getTypeName(Handle::Enum _enum);
-#undef CONVERT_HANDLE
+ const TypeName& getTypeName() const
+ {
+ return getTypeName(getType() );
+ }
+
+ bool isBuffer() const
+ {
+ return false
+ || type == DynamicIndexBuffer
+ || type == DynamicVertexBuffer
+ || type == IndexBuffer
+ || type == IndirectBuffer
+ || type == VertexBuffer
+ ;
+ }
+
+ bool isTexture() const
+ {
+ return type == Texture;
+ }
+
+ uint16_t idx;
+ uint16_t type;
+ };
- const char* getTypeName(Handle _handle);
+#define IMPLEMENT_HANDLE(_name) \
+ template<> \
+ inline constexpr Handle::Enum Handle::toEnum<_name##Handle>() \
+ { \
+ return Handle::_name; \
+ } \
+
+ IMPLEMENT_HANDLE(DynamicIndexBuffer);
+ IMPLEMENT_HANDLE(DynamicVertexBuffer);
+ IMPLEMENT_HANDLE(FrameBuffer);
+ IMPLEMENT_HANDLE(IndexBuffer);
+ IMPLEMENT_HANDLE(IndirectBuffer);
+ IMPLEMENT_HANDLE(OcclusionQuery);
+ IMPLEMENT_HANDLE(Program);
+ IMPLEMENT_HANDLE(Shader);
+ IMPLEMENT_HANDLE(Texture);
+ IMPLEMENT_HANDLE(Uniform);
+ IMPLEMENT_HANDLE(VertexBuffer);
+ IMPLEMENT_HANDLE(VertexLayout);
+
+#undef IMPLEMENT_HANDLE
inline bool isValid(const VertexLayout& _layout)
{
@@ -799,7 +870,6 @@ namespace bgfx
{
BX_CLASS(CommandBuffer
, NO_COPY
- , NO_ASSIGNMENT
);
public:
@@ -964,7 +1034,7 @@ namespace bgfx
};
//
- constexpr uint8_t kSortKeyViewNumBits = 10;
+ constexpr uint8_t kSortKeyViewNumBits = uint8_t(31 - bx::uint32_cntlz(BGFX_CONFIG_MAX_VIEWS) );
constexpr uint8_t kSortKeyViewBitShift = 64-kSortKeyViewNumBits;
constexpr uint64_t kSortKeyViewMask = uint64_t(BGFX_CONFIG_MAX_VIEWS-1)<<kSortKeyViewBitShift;
@@ -1087,21 +1157,21 @@ namespace bgfx
// | +-draw |
// |----------------------------------------------------------------| Draw Key 0 - Sort by program
// | |kkttpppppppppdddddddddddddddddddddddddddddddd |
- // | | ^ ^ ^ |
- // | | | | | |
- // | | +-blend +-program depth-+ |
- // | | |
+ // | | ^ ^ ^ ^ |
+ // | | | | | | |
+ // | | | +-blend +-program depth-+ |
+ // | | +-key type |
// |----------------------------------------------------------------| Draw Key 1 - Sort by depth
// | |kkddddddddddddddddddddddddddddddddttppppppppp |
- // | | ^^ ^ ^ |
- // | | || +-trans | |
- // | | depth-+ program-+ |
+ // | | ^ ^ ^ ^ |
+ // | | | | +-blend | |
+ // | | +-key type depth-+ program-+ |
// | | |
// |----------------------------------------------------------------| Draw Key 2 - Sequential
// | |kkssssssssssssssssssssttppppppppp |
- // | | ^ ^ ^ |
- // | | | | | |
- // | | seq-+ +-trans +-program |
+ // | | ^ ^ ^ ^ |
+ // | | | | | | |
+ // | | +-key type seq-+ +-blend +-program |
// | | |
// |----------------------------------------------------------------| Compute Key
// | |ssssssssssssssssssssppppppppp |
@@ -1243,27 +1313,33 @@ namespace bgfx
};
#undef SORT_KEY_RENDER_DRAW
+ constexpr uint8_t kBlitKeyViewShift = 32-kSortKeyViewNumBits;
+ constexpr uint32_t kBlitKeyViewMask = uint32_t(BGFX_CONFIG_MAX_VIEWS-1)<<kBlitKeyViewShift;
+ constexpr uint8_t kBlitKeyItemShift = 0;
+ constexpr uint32_t kBlitKeyItemMask = UINT16_MAX;
+
struct BlitKey
{
uint32_t encode()
{
- return 0
- | (uint32_t(m_view) << 24)
- | uint32_t(m_item)
- ;
+ const uint32_t view = (uint32_t(m_view) << kBlitKeyViewShift) & kBlitKeyViewMask;
+ const uint32_t item = (uint32_t(m_item) << kBlitKeyItemShift) & kBlitKeyItemMask;
+ const uint32_t key = view|item;
+
+ return key;
}
void decode(uint32_t _key)
{
- m_item = uint16_t(_key & UINT16_MAX);
- m_view = ViewId(_key >> 24);
+ m_item = uint16_t( (_key & kBlitKeyItemMask) >> kBlitKeyItemShift);
+ m_view = ViewId( (_key & kBlitKeyViewMask) >> kBlitKeyViewShift);
}
static uint32_t remapView(uint32_t _key, ViewId _viewRemap[BGFX_CONFIG_MAX_VIEWS])
{
- const ViewId oldView = ViewId(_key >> 24);
- const uint32_t view = uint32_t(_viewRemap[oldView]) << 24;
- const uint32_t key = (_key & ~UINT32_C(0xff000000) ) | view;
+ const ViewId oldView = ViewId( (_key & kBlitKeyViewMask) >> kBlitKeyViewShift);
+ const uint32_t view = uint32_t( (_viewRemap[oldView] << kBlitKeyViewShift) & kBlitKeyViewMask);
+ const uint32_t key = (_key & ~kBlitKeyViewMask) | view;
return key;
}
@@ -1681,8 +1757,10 @@ namespace bgfx
}
m_startIndirect = 0;
- m_numIndirect = UINT16_MAX;
+ m_numIndirect = UINT16_MAX;
+ m_numIndirectIndex = 0;
m_indirectBuffer.idx = kInvalidHandle;
+ m_numIndirectBuffer.idx = kInvalidHandle;
m_occlusionQuery.idx = kInvalidHandle;
}
@@ -1715,6 +1793,7 @@ namespace bgfx
uint16_t m_instanceDataStride;
uint16_t m_startIndirect;
uint16_t m_numIndirect;
+ uint32_t m_numIndirectIndex;
uint16_t m_numMatrices;
uint16_t m_scissor;
uint8_t m_submitFlags;
@@ -1724,6 +1803,7 @@ namespace bgfx
IndexBufferHandle m_indexBuffer;
VertexBufferHandle m_instanceDataBuffer;
IndirectBufferHandle m_indirectBuffer;
+ IndexBufferHandle m_numIndirectBuffer;
OcclusionQueryHandle m_occlusionQuery;
};
@@ -1787,8 +1867,8 @@ namespace bgfx
uint16_t m_depth;
uint8_t m_srcMip;
uint8_t m_dstMip;
- TextureHandle m_src;
- TextureHandle m_dst;
+ Handle m_src;
+ Handle m_dst;
};
struct IndexBuffer
@@ -1807,6 +1887,15 @@ namespace bgfx
struct DynamicIndexBuffer
{
+ void reset()
+ {
+ m_handle = BGFX_INVALID_HANDLE;
+ m_offset = 0;
+ m_size = 0;
+ m_startIndex = 0;
+ m_flags = 0;
+ }
+
IndexBufferHandle m_handle;
uint32_t m_offset;
uint32_t m_size;
@@ -1816,6 +1905,18 @@ namespace bgfx
struct DynamicVertexBuffer
{
+ void reset()
+ {
+ m_handle = BGFX_INVALID_HANDLE;
+ m_offset = 0;
+ m_size = 0;
+ m_startVertex = 0;
+ m_numVertices = 0;
+ m_stride = 0;
+ m_layoutHandle = BGFX_INVALID_HANDLE;
+ m_flags = 0;
+ }
+
VertexBufferHandle m_handle;
uint32_t m_offset;
uint32_t m_size;
@@ -1892,7 +1993,12 @@ namespace bgfx
bool isReadBack() const
{
- return 0 != (m_flags&BGFX_TEXTURE_READ_BACK);
+ return 0 != (m_flags & BGFX_TEXTURE_READ_BACK);
+ }
+
+ bool isBlitDst() const
+ {
+ return 0 != (m_flags & BGFX_TEXTURE_BLIT_DST);
}
bool isCubeMap() const
@@ -2051,6 +2157,7 @@ namespace bgfx
Frame()
: m_waitSubmit(0)
, m_waitRender(0)
+ , m_frameNum(0)
, m_capture(false)
{
SortKey term;
@@ -2084,7 +2191,7 @@ namespace bgfx
}
reset();
- start();
+ start(0);
m_textVideoMem = BX_NEW(g_allocator, TextVideoMem);
}
@@ -2101,12 +2208,12 @@ namespace bgfx
void reset()
{
- start();
+ start(0);
finish();
resetFreeHandles();
}
- void start()
+ void start(uint32_t frameNum)
{
m_perfStats.transientVbUsed = m_vboffset;
m_perfStats.transientIbUsed = m_iboffset;
@@ -2120,6 +2227,7 @@ namespace bgfx
m_cmdPost.start();
m_capture = false;
m_numScreenShots = 0;
+ m_frameNum = frameNum;
}
void finish()
@@ -2328,6 +2436,8 @@ namespace bgfx
int64_t m_waitSubmit;
int64_t m_waitRender;
+ uint32_t m_frameNum;
+
bool m_capture;
};
@@ -2378,6 +2488,7 @@ namespace bgfx
void setMarker(const char* _name)
{
+ UniformBuffer::update(&m_frame->m_uniformBuffer[m_uniformIdx]);
UniformBuffer* uniformBuffer = m_frame->m_uniformBuffer[m_uniformIdx];
uniformBuffer->writeMarker(_name);
}
@@ -2401,12 +2512,30 @@ namespace bgfx
void setState(uint64_t _state, uint32_t _rgba)
{
- uint8_t blend = ( (_state&BGFX_STATE_BLEND_MASK)>>BGFX_STATE_BLEND_SHIFT)&0xff;
- uint8_t alphaRef = ( (_state&BGFX_STATE_ALPHA_REF_MASK)>>BGFX_STATE_ALPHA_REF_SHIFT)&0xff;
- // transparency sort order table
+ const uint8_t blend = ( (_state&BGFX_STATE_BLEND_MASK )>>BGFX_STATE_BLEND_SHIFT )&0xff;
+ const uint8_t alphaRef = ( (_state&BGFX_STATE_ALPHA_REF_MASK)>>BGFX_STATE_ALPHA_REF_SHIFT)&0xff;
+
+ // Transparency sort order table:
+ //
+ // +----------------------------------------- BGFX_STATE_BLEND_ZERO
+ // | +-------------------------------------- BGFX_STATE_BLEND_ONE
+ // | | +----------------------------------- BGFX_STATE_BLEND_SRC_COLOR
+ // | | | +-------------------------------- BGFX_STATE_BLEND_INV_SRC_COLOR
+ // | | | | +----------------------------- BGFX_STATE_BLEND_SRC_ALPHA
+ // | | | | | +-------------------------- BGFX_STATE_BLEND_INV_SRC_ALPHA
+ // | | | | | | +----------------------- BGFX_STATE_BLEND_DST_ALPHA
+ // | | | | | | | +-------------------- BGFX_STATE_BLEND_INV_DST_ALPHA
+ // | | | | | | | | +----------------- BGFX_STATE_BLEND_DST_COLOR
+ // | | | | | | | | | +-------------- BGFX_STATE_BLEND_INV_DST_COLOR
+ // | | | | | | | | | | +----------- BGFX_STATE_BLEND_SRC_ALPHA_SAT
+ // | | | | | | | | | | | +-------- BGFX_STATE_BLEND_FACTOR
+ // | | | | | | | | | | | | +----- BGFX_STATE_BLEND_INV_FACTOR
+ // | | | | | | | | | | | | |
+ // x | | | | | | | | | | | | | x x x x x
m_key.m_blend = "\x0\x2\x2\x3\x3\x2\x3\x2\x3\x2\x2\x2\x2\x2\x2\x2\x2\x2\x2"[( (blend)&0xf) + (!!blend)] + !!alphaRef;
+
m_draw.m_stateFlags = _state;
- m_draw.m_rgba = _rgba;
+ m_draw.m_rgba = _rgba;
}
void setCondition(OcclusionQueryHandle _handle, bool _visible)
@@ -2658,6 +2787,13 @@ namespace bgfx
submit(_id, _program, handle, _depth, _flags);
}
+ void submit(ViewId _id, ProgramHandle _program, IndirectBufferHandle _indirectHandle, uint16_t _start, IndexBufferHandle _numHandle, uint32_t _numIndex, uint16_t _numMax, uint32_t _depth, uint8_t _flags)
+ {
+ m_draw.m_numIndirectIndex = _numIndex;
+ m_draw.m_numIndirectBuffer = _numHandle;
+ submit(_id, _program, _indirectHandle, _start, _numMax, _depth, _flags);
+ }
+
void dispatch(ViewId _id, ProgramHandle _handle, uint32_t _ngx, uint32_t _ngy, uint32_t _ngz, uint8_t _flags);
void dispatch(ViewId _id, ProgramHandle _handle, IndirectBufferHandle _indirectHandle, uint16_t _start, uint16_t _num, uint8_t _flags)
@@ -3041,6 +3177,25 @@ namespace bgfx
return;
}
+ const uint32_t maskFlags = ~(0
+ | (0 != (g_caps.supported & BGFX_CAPS_TRANSPARENT_BACKBUFFER) ? 0 : BGFX_RESET_TRANSPARENT_BACKBUFFER)
+ | (0 != (g_caps.supported & BGFX_CAPS_HDR10) ? 0 : BGFX_RESET_HDR10)
+ | (0 != (g_caps.supported & BGFX_CAPS_HIDPI) ? 0 : BGFX_RESET_HIDPI)
+ );
+ const uint32_t oldFlags = _flags;
+ _flags &= maskFlags;
+
+#define WARN_RESET_CAPS_FLAGS(_name) \
+ BX_WARN( (oldFlags&(BGFX_RESET_##_name) ) == (_flags&(BGFX_RESET_##_name) ) \
+ , "Reset flag `BGFX_RESET_" #_name "` will be ignored, because `BGFX_CAPS_" #_name "` is not supported." \
+ )
+ WARN_RESET_CAPS_FLAGS(TRANSPARENT_BACKBUFFER);
+ WARN_RESET_CAPS_FLAGS(HDR10);
+ WARN_RESET_CAPS_FLAGS(HIDPI);
+
+#undef WARN_RESET_CAPS_FLAGS
+ BX_UNUSED(oldFlags);
+
BX_WARN(g_caps.limits.maxTextureSize >= _width
&& g_caps.limits.maxTextureSize >= _height
, "Frame buffer resolution width or height can't be larger than limits.maxTextureSize %d (width %d, height %d)."
@@ -3159,7 +3314,7 @@ namespace bgfx
cmdbuf.write(_mem);
cmdbuf.write(_flags);
- setDebugName(convert(handle) );
+ setDebugNameForHandle(handle);
}
else
{
@@ -3178,7 +3333,7 @@ namespace bgfx
IndexBuffer& ref = m_indexBuffers[_handle.idx];
ref.m_name.set(_name);
- setName(convert(_handle), _name);
+ setNameForHandle(_handle, _name);
}
BGFX_API_FUNC(void destroyIndexBuffer(IndexBufferHandle _handle) )
@@ -3276,7 +3431,7 @@ namespace bgfx
cmdbuf.write(layoutHandle);
cmdbuf.write(_flags);
- setDebugName(convert(handle) );
+ setDebugNameForHandle(handle);
return handle;
}
@@ -3296,7 +3451,7 @@ namespace bgfx
VertexBuffer& ref = m_vertexBuffers[_handle.idx];
ref.m_name.set(_name);
- setName(convert(_handle), _name);
+ setNameForHandle(_handle, _name);
}
BGFX_API_FUNC(void destroyVertexBuffer(VertexBufferHandle _handle) )
@@ -3339,7 +3494,7 @@ namespace bgfx
return NonLocalAllocator::kInvalidBlock;
}
- const uint32_t allocSize = bx::max<uint32_t>(BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE, _size);
+ const uint32_t allocSize = bx::max<uint32_t>(BGFX_CONFIG_DYNAMIC_INDEX_BUFFER_SIZE, bx::alignUp(_size, 1<<20) );
IndexBuffer& ib = m_indexBuffers[indexBufferHandle.idx];
ib.m_size = allocSize;
@@ -3373,7 +3528,7 @@ namespace bgfx
cmdbuf.write(_size);
cmdbuf.write(_flags);
- setDebugName(convert(indexBufferHandle), "Dynamic Index Buffer");
+ setDebugNameForHandle(indexBufferHandle, "Dynamic Index Buffer");
return uint64_t(indexBufferHandle.idx) << 32;
}
@@ -3445,8 +3600,7 @@ namespace bgfx
if (dib.m_size < _mem->size
&& 0 != (dib.m_flags & BGFX_BUFFER_ALLOW_RESIZE) )
{
- m_dynIndexBufferAllocator.free(uint64_t(dib.m_handle.idx)<<32 | dib.m_offset);
- m_dynIndexBufferAllocator.compact();
+ destroy(dib);
const uint64_t ptr = (0 != (dib.m_flags & BGFX_BUFFER_COMPUTE_READ) )
? allocIndexBuffer(_mem->size, dib.m_flags)
@@ -3484,27 +3638,31 @@ namespace bgfx
m_freeDynamicIndexBufferHandle[m_numFreeDynamicIndexBufferHandles++] = _handle;
}
- void destroyDynamicIndexBufferInternal(DynamicIndexBufferHandle _handle)
+ void destroy(const DynamicIndexBuffer& _dib)
{
- DynamicIndexBuffer& dib = m_dynamicIndexBuffers[_handle.idx];
-
- if (0 != (dib.m_flags & BGFX_BUFFER_COMPUTE_READ_WRITE) )
+ if (0 != (_dib.m_flags & BGFX_BUFFER_COMPUTE_READ_WRITE))
{
- destroyIndexBuffer(dib.m_handle);
+ destroyIndexBuffer(_dib.m_handle);
}
else
{
- m_dynIndexBufferAllocator.free(uint64_t(dib.m_handle.idx)<<32 | dib.m_offset);
- if (m_dynIndexBufferAllocator.compact() )
+ m_dynIndexBufferAllocator.free(uint64_t(_dib.m_handle.idx) << 32 | _dib.m_offset);
+ 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) };
+ IndexBufferHandle handle = { uint16_t(ptr >> 32) };
destroyIndexBuffer(handle);
}
}
}
+ }
+ void destroyDynamicIndexBufferInternal(DynamicIndexBufferHandle _handle)
+ {
+ DynamicIndexBuffer& dib = m_dynamicIndexBuffers[_handle.idx];
+ destroy(dib);
+ dib.reset();
m_dynamicIndexBufferHandle.free(_handle.idx);
}
@@ -3520,7 +3678,7 @@ namespace bgfx
return NonLocalAllocator::kInvalidBlock;
}
- const uint32_t allocSize = bx::max<uint32_t>(BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE, _size);
+ const uint32_t allocSize = bx::max<uint32_t>(BGFX_CONFIG_DYNAMIC_VERTEX_BUFFER_SIZE, bx::alignUp(_size, 1<<20) );
VertexBuffer& vb = m_vertexBuffers[vertexBufferHandle.idx];
vb.m_size = allocSize;
@@ -3557,7 +3715,7 @@ namespace bgfx
cmdbuf.write(_size);
cmdbuf.write(_flags);
- setDebugName(convert(vertexBufferHandle), "Dynamic Vertex Buffer");
+ setDebugNameForHandle(vertexBufferHandle, "Dynamic Vertex Buffer");
return uint64_t(vertexBufferHandle.idx)<<32;
}
@@ -3637,8 +3795,7 @@ namespace bgfx
if (dvb.m_size < _mem->size
&& 0 != (dvb.m_flags & BGFX_BUFFER_ALLOW_RESIZE) )
{
- m_dynVertexBufferAllocator.free(uint64_t(dvb.m_handle.idx)<<32 | dvb.m_offset);
- m_dynVertexBufferAllocator.compact();
+ destroy(dvb);
const uint32_t size = bx::strideAlign<16>(_mem->size, dvb.m_stride)+dvb.m_stride;
@@ -3680,6 +3837,26 @@ namespace bgfx
m_freeDynamicVertexBufferHandle[m_numFreeDynamicVertexBufferHandles++] = _handle;
}
+ void destroy(const DynamicVertexBuffer& _dvb)
+ {
+ 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())
+ {
+ for (uint64_t ptr = m_dynVertexBufferAllocator.remove(); 0 != ptr; ptr = m_dynVertexBufferAllocator.remove())
+ {
+ VertexBufferHandle handle = { uint16_t(ptr >> 32) };
+ destroyVertexBuffer(handle);
+ }
+ }
+ }
+ }
+
void destroyDynamicVertexBufferInternal(DynamicVertexBufferHandle _handle)
{
VertexLayoutHandle layoutHandle = m_vertexLayoutRef.release(_handle);
@@ -3693,24 +3870,8 @@ namespace bgfx
}
DynamicVertexBuffer& dvb = m_dynamicVertexBuffers[_handle.idx];
-
- 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() )
- {
- for (uint64_t ptr = m_dynVertexBufferAllocator.remove(); 0 != ptr; ptr = m_dynVertexBufferAllocator.remove() )
- {
- VertexBufferHandle handle = { uint16_t(ptr>>32) };
- destroyVertexBuffer(handle);
- }
- }
- }
-
+ destroy(dvb);
+ dvb.reset();
m_dynamicVertexBufferHandle.free(_handle.idx);
}
@@ -3753,7 +3914,7 @@ namespace bgfx
tib->size = _size;
tib->handle = handle;
- setDebugName(convert(handle), "Transient Index Buffer");
+ setDebugNameForHandle(handle, "Transient Index Buffer");
}
return tib;
@@ -3823,7 +3984,7 @@ namespace bgfx
tvb->handle = handle;
tvb->layoutHandle = layoutHandle;
- setDebugName(convert(handle), "Transient Vertex Buffer");
+ setDebugNameForHandle(handle, "Transient Vertex Buffer");
}
return tvb;
@@ -4026,19 +4187,19 @@ namespace bgfx
if (!isShaderVerLess(magic, 8) )
{
uint16_t texInfo;
- bx::read(&reader, texInfo);
+ bx::read(&reader, texInfo, &err);
}
if (!isShaderVerLess(magic, 10) )
{
uint16_t texFormat = 0;
- bx::read(&reader, texFormat);
+ bx::read(&reader, texFormat, &err);
}
PredefinedUniform::Enum predefined = nameToPredefinedUniformEnum(name);
if (PredefinedUniform::Count == predefined && UniformType::End != UniformType::Enum(type) )
{
- uniforms[sr.m_num] = createUniform(name, UniformType::Enum(type), regCount);
+ uniforms[sr.m_num] = createUniform(name, UniformType::Enum(type), num);
sr.m_num++;
}
}
@@ -4054,7 +4215,7 @@ namespace bgfx
cmdbuf.write(handle);
cmdbuf.write(_mem);
- setDebugName(convert(handle) );
+ setDebugNameForHandle(handle);
return handle;
}
@@ -4078,10 +4239,15 @@ namespace bgfx
return sr.m_num;
}
- void setName(Handle _handle, const bx::StringView& _name)
+ void setNameForHandle(Handle _handle, const bx::StringView& _name)
{
char tmp[1024];
- uint16_t len = 1+(uint16_t)bx::snprintf(tmp, BX_COUNTOF(tmp), "%sH %d: %.*s", getTypeName(_handle), _handle.idx, _name.getLength(), _name.getPtr() );
+ uint16_t len = 1+(uint16_t)bx::snprintf(tmp, BX_COUNTOF(tmp)
+ , "%sH %d: %S"
+ , _handle.getTypeName().abrvName
+ , _handle.idx
+ , &_name
+ );
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::SetName);
cmdbuf.write(_handle);
@@ -4089,11 +4255,11 @@ namespace bgfx
cmdbuf.write(tmp, len);
}
- void setDebugName(Handle _handle, const bx::StringView& _name = "")
+ void setDebugNameForHandle(Handle _handle, const bx::StringView& _name = "")
{
if (BX_ENABLED(BGFX_CONFIG_DEBUG) )
{
- setName(_handle, _name);
+ setNameForHandle(_handle, _name);
}
}
@@ -4106,7 +4272,7 @@ namespace bgfx
ShaderRef& sr = m_shaderRef[_handle.idx];
sr.m_name.set(_name);
- setName(convert(_handle), _name);
+ setNameForHandle(_handle, _name);
}
BGFX_API_FUNC(void destroyShader(ShaderHandle _handle) )
@@ -4381,7 +4547,7 @@ namespace bgfx
cmdbuf.write(_flags);
cmdbuf.write(_skip);
- setDebugName(convert(handle) );
+ setDebugNameForHandle(handle);
return handle;
}
@@ -4394,7 +4560,7 @@ namespace bgfx
TextureRef& ref = m_textureRef[_handle.idx];
ref.m_name.set(_name);
- setName(convert(_handle), _name);
+ setNameForHandle(_handle, _name);
}
void setDirectAccessPtr(TextureHandle _handle, void* _ptr)
@@ -4442,7 +4608,7 @@ namespace bgfx
cmdbuf.write(_handle);
cmdbuf.write(_data);
cmdbuf.write(_mip);
- return m_frames + 2;
+ return m_submit->m_frameNum + 2;
}
void resizeTexture(TextureHandle _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, uint16_t _numLayers)
@@ -4553,9 +4719,8 @@ namespace bgfx
{
BGFX_MUTEX_SCOPE(m_resourceApiLock);
- bx::Error err;
+ bx::ErrorAssert err;
isFrameBufferValid(_num, _attachment, &err);
- BGFX_ERROR_ASSERT(&err);
if (!err.isOk() )
{
@@ -4643,7 +4808,7 @@ namespace bgfx
FrameBufferRef& fbr = m_frameBufferRef[_handle.idx];
fbr.m_name.set(_name);
-// setName(convert(_handle), _name);
+// setNameForHandle(_handle, _name);
}
BGFX_API_FUNC(TextureHandle getTexture(FrameBufferHandle _handle, uint8_t _attachment) )
@@ -4694,9 +4859,8 @@ namespace bgfx
BGFX_MUTEX_SCOPE(m_resourceApiLock);
{
- bx::Error err;
+ bx::ErrorAssert err;
isIdentifierValid(_name, &err);
- BGFX_ERROR_ASSERT(&err);
if (!err.isOk() )
{
@@ -4704,7 +4868,7 @@ namespace bgfx
}
}
- _num = bx::max<uint16_t>(1, _num);
+ _num = bx::max<uint16_t>(1, _num);
uint16_t idx = m_uniformHashMap.find(bx::hash<bx::HashMurmur2A>(_name) );
if (kInvalidHandle != idx)
@@ -4726,6 +4890,8 @@ namespace bgfx
uniform.m_type = oldsize < newsize ? _type : uniform.m_type;
uniform.m_num = bx::max<uint16_t>(uniform.m_num, _num);
+ BX_TRACE(" Resize uniform (handle %3d) `%s`, num %d", handle.idx, _name, _num);
+
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateUniform);
cmdbuf.write(handle);
cmdbuf.write(uniform.m_type);
@@ -4747,7 +4913,7 @@ namespace bgfx
return BGFX_INVALID_HANDLE;
}
- BX_TRACE("Creating uniform (handle %3d) %s", handle.idx, _name);
+ BX_TRACE("Creating uniform (handle %3d) `%s`, num %d", handle.idx, _name, _num);
UniformRef& uniform = m_uniformRef[handle.idx];
uniform.m_name.set(_name);
@@ -4922,7 +5088,7 @@ namespace bgfx
BGFX_API_FUNC(void setViewClear(ViewId _id, uint16_t _flags, uint32_t _rgba, float _depth, uint8_t _stencil) )
{
- BX_ASSERT(bx::equal(_depth, bx::clamp(_depth, 0.0f, 1.0f), 0.0001f)
+ BX_ASSERT(bx::isEqual(_depth, bx::clamp(_depth, 0.0f, 1.0f), 0.0001f)
, "Clear depth value must be between 0.0 and 1.0 (_depth %f)."
, _depth
);
@@ -4932,7 +5098,7 @@ namespace bgfx
BGFX_API_FUNC(void setViewClear(ViewId _id, uint16_t _flags, float _depth, uint8_t _stencil, uint8_t _0, uint8_t _1, uint8_t _2, uint8_t _3, uint8_t _4, uint8_t _5, uint8_t _6, uint8_t _7) )
{
- BX_ASSERT(bx::equal(_depth, bx::clamp(_depth, 0.0f, 1.0f), 0.0001f)
+ BX_ASSERT(bx::isEqual(_depth, bx::clamp(_depth, 0.0f, 1.0f), 0.0001f)
, "Clear depth value must be between 0.0 and 1.0 (_depth %f)."
, _depth
);
diff --git a/3rdparty/bgfx/src/bgfx_shader.sh b/3rdparty/bgfx/src/bgfx_shader.sh
index 45c59775bc6..dde910ab728 100644
--- a/3rdparty/bgfx/src/bgfx_shader.sh
+++ b/3rdparty/bgfx/src/bgfx_shader.sh
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_SHADER_H_HEADER_GUARD
@@ -22,7 +22,7 @@
# define UNROLL
#endif // BGFX_SHADER_LANGUAGE_HLSL > 300
-#if BGFX_SHADER_LANGUAGE_HLSL > 300 && BGFX_SHADER_TYPE_FRAGMENT
+#if (BGFX_SHADER_LANGUAGE_HLSL > 300 || BGFX_SHADER_LANGUAGE_METAL || BGFX_SHADER_LANGUAGE_SPIRV) && BGFX_SHADER_TYPE_FRAGMENT
# define EARLY_DEPTH_STENCIL [earlydepthstencil]
#else
# define EARLY_DEPTH_STENCIL
@@ -52,7 +52,7 @@
// To be able to patch the uav registers on the DXBC SPDB Chunk (D3D11 renderer) the whitespaces around
// '_type[_reg]' are necessary. This only affects shaders with debug info (i.e., those that have the SPDB Chunk).
-# if BGFX_SHADER_LANGUAGE_HLSL > 400
+# if BGFX_SHADER_LANGUAGE_HLSL > 400 || BGFX_SHADER_LANGUAGE_PSSL || BGFX_SHADER_LANGUAGE_SPIRV || BGFX_SHADER_LANGUAGE_METAL
# define REGISTER(_type, _reg) register( _type[_reg] )
# else
# define REGISTER(_type, _reg) register(_type ## _reg)
@@ -601,15 +601,18 @@ vec4 mod(vec4 _a, vec4 _b) { return _a - _b * floor(_a / _b); }
# define ISAMPLER3D(_name, _reg) uniform isampler3D _name
# define USAMPLER3D(_name, _reg) uniform usampler3D _name
-# define texture2DBias(_sampler, _coord, _bias) texture2D(_sampler, _coord, _bias)
-# define textureCubeBias(_sampler, _coord, _bias) textureCube(_sampler, _coord, _bias)
-
# if BGFX_SHADER_LANGUAGE_GLSL >= 130
# define texture2D(_sampler, _coord) texture(_sampler, _coord)
# define texture2DArray(_sampler, _coord) texture(_sampler, _coord)
# define texture3D(_sampler, _coord) texture(_sampler, _coord)
+# define textureCube(_sampler, _coord) texture(_sampler, _coord)
# define texture2DLod(_sampler, _coord, _lod) textureLod(_sampler, _coord, _lod)
# define texture2DLodOffset(_sampler, _coord, _lod, _offset) textureLodOffset(_sampler, _coord, _lod, _offset)
+# define texture2DBias(_sampler, _coord, _bias) texture(_sampler, _coord, _bias)
+# define textureCubeBias(_sampler, _coord, _bias) texture(_sampler, _coord, _bias)
+# else
+# define texture2DBias(_sampler, _coord, _bias) texture2D(_sampler, _coord, _bias)
+# define textureCubeBias(_sampler, _coord, _bias) textureCube(_sampler, _coord, _bias)
# endif // BGFX_SHADER_LANGUAGE_GLSL >= 130
vec3 instMul(vec3 _vec, mat3 _mtx) { return mul(_vec, _mtx); }
diff --git a/3rdparty/bgfx/src/charset.h b/3rdparty/bgfx/src/charset.h
index 6316b0c2f79..b76f23d1582 100644
--- a/3rdparty/bgfx/src/charset.h
+++ b/3rdparty/bgfx/src/charset.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
static const uint8_t vga8x8[256*8] =
diff --git a/3rdparty/bgfx/src/config.h b/3rdparty/bgfx/src/config.h
index 1566b321c1b..a492f0006c0 100644
--- a/3rdparty/bgfx/src/config.h
+++ b/3rdparty/bgfx/src/config.h
@@ -1,12 +1,12 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_CONFIG_H_HEADER_GUARD
#define BGFX_CONFIG_H_HEADER_GUARD
-#include <bx/bx.h>
+#include <bx/bx.h> // bx::isPowerOf2
// # Configuration options for bgfx.
//
@@ -15,9 +15,9 @@
//
// When selecting rendering backends select all backends you want to include in the build.
-#ifndef BGFX_CONFIG_DEBUG
-# define BGFX_CONFIG_DEBUG 0
-#endif // BGFX_CONFIG_DEBUG
+#ifndef BX_CONFIG_DEBUG
+# error "BX_CONFIG_DEBUG must be defined in build script!"
+#endif // BX_CONFIG_DEBUG
#if !defined(BGFX_CONFIG_RENDERER_AGC) \
&& !defined(BGFX_CONFIG_RENDERER_DIRECT3D9) \
@@ -39,12 +39,14 @@
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D9
# define BGFX_CONFIG_RENDERER_DIRECT3D9 (0 \
+ || BX_PLATFORM_LINUX \
|| BX_PLATFORM_WINDOWS \
? 1 : 0)
# endif // BGFX_CONFIG_RENDERER_DIRECT3D9
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D11
# define BGFX_CONFIG_RENDERER_DIRECT3D11 (0 \
+ || BX_PLATFORM_LINUX \
|| BX_PLATFORM_WINDOWS \
|| BX_PLATFORM_WINRT \
|| BX_PLATFORM_XBOXONE \
@@ -53,6 +55,7 @@
# ifndef BGFX_CONFIG_RENDERER_DIRECT3D12
# define BGFX_CONFIG_RENDERER_DIRECT3D12 (0 \
+ || BX_PLATFORM_LINUX \
|| BX_PLATFORM_WINDOWS \
|| BX_PLATFORM_WINRT \
|| BX_PLATFORM_XBOXONE \
diff --git a/3rdparty/bgfx/src/debug_renderdoc.cpp b/3rdparty/bgfx/src/debug_renderdoc.cpp
index 053df044375..1671014ff7a 100644
--- a/3rdparty/bgfx/src/debug_renderdoc.cpp
+++ b/3rdparty/bgfx/src/debug_renderdoc.cpp
@@ -1,12 +1,16 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
#if BX_PLATFORM_WINDOWS || BX_PLATFORM_LINUX
# if BX_PLATFORM_WINDOWS
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif // WIN32_LEAN_AND_MEAN
+# include <windows.h>
# include <psapi.h>
# endif // BX_PLATFORM_WINDOWS
# include <renderdoc/renderdoc_app.h>
diff --git a/3rdparty/bgfx/src/debug_renderdoc.h b/3rdparty/bgfx/src/debug_renderdoc.h
index 20ee198ec86..0ec59309fe9 100644
--- a/3rdparty/bgfx/src/debug_renderdoc.h
+++ b/3rdparty/bgfx/src/debug_renderdoc.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_RENDERDOC_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/src/dxgi.cpp b/3rdparty/bgfx/src/dxgi.cpp
index 34c3e69ce29..649de902190 100644
--- a/3rdparty/bgfx/src/dxgi.cpp
+++ b/3rdparty/bgfx/src/dxgi.cpp
@@ -1,11 +1,11 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
-#if BGFX_CONFIG_RENDERER_DIRECT3D11 || BGFX_CONFIG_RENDERER_DIRECT3D12
+#if BGFX_CONFIG_RENDERER_DIRECT3D11 || (BGFX_CONFIG_RENDERER_DIRECT3D12 && !BX_PLATFORM_LINUX)
#include "dxgi.h"
#include "renderer_d3d.h"
@@ -128,15 +128,26 @@ namespace bgfx
bool Dxgi::init(Caps& _caps)
{
-#if BX_PLATFORM_WINDOWS
- m_dxgiDll = bx::dlopen("dxgi.dll");
+#if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS
+
+ const char* dxgiDllName =
+#if BX_PLATFORM_LINUX
+ "dxgi.so"
+#else
+ "dxgi.dll"
+#endif // BX_PLATFORM_LINUX
+ ;
+ m_dxgiDll = bx::dlopen(dxgiDllName);
+
if (NULL == m_dxgiDll)
{
- BX_TRACE("Init error: Failed to load dxgi.dll.");
+ BX_TRACE("Init error: Failed to load %s.", dxgiDllName);
return false;
}
+# if BX_PLATFORM_WINDOWS
m_dxgiDebugDll = bx::dlopen("dxgidebug.dll");
+
if (NULL != m_dxgiDebugDll)
{
DXGIGetDebugInterface = (PFN_GET_DEBUG_INTERFACE )bx::dlsym(m_dxgiDebugDll, "DXGIGetDebugInterface");
@@ -161,6 +172,7 @@ namespace bgfx
BX_TRACE("Init error: Function CreateDXGIFactory not found.");
return false;
}
+# endif // BX_PLATFORM_WINDOWS
#endif // BX_PLATFORM_WINDOWS
HRESULT hr = S_OK;
@@ -206,10 +218,20 @@ namespace bgfx
, desc.SubSysId
, desc.Revision
);
- BX_TRACE("\tMemory: %" PRIi64 " (video), %" PRIi64 " (system), %" PRIi64 " (shared)"
- , desc.DedicatedVideoMemory
- , desc.DedicatedSystemMemory
- , desc.SharedSystemMemory
+
+ char dedicatedVideo[16];
+ bx::prettify(dedicatedVideo, BX_COUNTOF(dedicatedVideo), desc.DedicatedVideoMemory);
+
+ char dedicatedSystem[16];
+ bx::prettify(dedicatedSystem, BX_COUNTOF(dedicatedSystem), desc.DedicatedSystemMemory);
+
+ char sharedSystem[16];
+ bx::prettify(sharedSystem, BX_COUNTOF(sharedSystem), desc.SharedSystemMemory);
+
+ BX_TRACE("\tMemory: %s (video), %s (system), %s (shared)"
+ , dedicatedVideo
+ , dedicatedSystem
+ , sharedSystem
);
_caps.gpu[ii].vendorId = (uint16_t)desc.VendorId;
@@ -263,7 +285,7 @@ namespace bgfx
BX_TRACE("\t\t AttachedToDesktop: %d", outputDesc.AttachedToDesktop);
BX_TRACE("\t\t Rotation: %d", outputDesc.Rotation);
-#if BX_PLATFORM_WINDOWS
+#if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS
IDXGIOutput6* output6;
hr = output->QueryInterface(IID_IDXGIOutput6, (void**)&output6);
if (SUCCEEDED(hr) )
@@ -298,6 +320,7 @@ namespace bgfx
}
_caps.supported |= hdr10 ? BGFX_CAPS_HDR10 : 0;
+ _caps.supported |= BX_ENABLED(BX_PLATFORM_WINRT) ? BGFX_CAPS_TRANSPARENT_BACKBUFFER : 0;
DX_RELEASE(adapter, adapter == m_adapter ? 1 : 0);
}
@@ -362,15 +385,13 @@ namespace bgfx
DX_RELEASE_I(dxgiDevice);
}
- static const GUID IID_ID3D12CommandQueue = { 0x0ec870a6, 0x5d7e, 0x4c22, { 0x8c, 0xfc, 0x5b, 0xaa, 0xe0, 0x76, 0x16, 0xed } };
-
HRESULT Dxgi::createSwapChain(IUnknown* _device, const SwapChainDesc& _scd, SwapChainI** _swapChain)
{
HRESULT hr = S_OK;
uint32_t scdFlags = _scd.flags;
-#if BX_PLATFORM_WINDOWS
+#if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS
IDXGIFactory5* factory5;
hr = m_factory->QueryInterface(IID_IDXGIFactory5, (void**)&factory5);
@@ -417,17 +438,6 @@ namespace bgfx
, &scd
, reinterpret_cast<IDXGISwapChain**>(_swapChain)
);
-
- if (SUCCEEDED(hr) )
- {
- IDXGIDevice1* dxgiDevice1;
- _device->QueryInterface(IID_IDXGIDevice1, (void**)&dxgiDevice1);
- if (NULL != dxgiDevice1)
- {
- dxgiDevice1->SetMaximumFrameLatency(_scd.maxFrameLatency);
- DX_RELEASE_I(dxgiDevice1);
- }
- }
#else
DXGI_SWAP_CHAIN_DESC1 scd;
scd.Width = _scd.width;
@@ -529,13 +539,29 @@ namespace bgfx
}
#endif // BX_PLATFORM_WINDOWS
+ if (SUCCEEDED(hr) )
+ {
+ IDXGIDevice1* dxgiDevice1;
+ _device->QueryInterface(IID_IDXGIDevice1, (void**)&dxgiDevice1);
+ if (NULL != dxgiDevice1)
+ {
+ hr = dxgiDevice1->SetMaximumFrameLatency(_scd.maxFrameLatency);
+ if (FAILED(hr) )
+ {
+ BX_TRACE("Failed to set maximum frame latency, hr 0x%08x", hr);
+ hr = S_OK;
+ }
+ DX_RELEASE_I(dxgiDevice1);
+ }
+ }
+
if (FAILED(hr) )
{
BX_TRACE("Failed to create swap chain.");
return hr;
}
-#if BX_PLATFORM_WINDOWS
+#if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS
if (SUCCEEDED(hr) )
{
for (uint32_t ii = 0; ii < BX_COUNTOF(s_dxgiSwapChainIIDs); ++ii)
@@ -568,7 +594,7 @@ namespace bgfx
}
}
}
-#endif // BX_PLATFORM_WINDOWS
+#endif // BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS
updateHdr10(*_swapChain, _scd);
@@ -717,7 +743,7 @@ namespace bgfx
uint32_t scdFlags = _scd.flags;
-#if BX_PLATFORM_WINDOWS
+#if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS
IDXGIFactory5* factory5;
hr = m_factory->QueryInterface(IID_IDXGIFactory5, (void**)&factory5);
diff --git a/3rdparty/bgfx/src/dxgi.h b/3rdparty/bgfx/src/dxgi.h
index 43671bf17e2..cd01d6bf945 100644
--- a/3rdparty/bgfx/src/dxgi.h
+++ b/3rdparty/bgfx/src/dxgi.h
@@ -1,11 +1,14 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_DXGI_H_HEADER_GUARD
#define BGFX_DXGI_H_HEADER_GUARD
+#include <sal.h>
+#include <unknwn.h>
+
#if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT
# include <d3dcommon.h>
# include <dxgi1_6.h>
@@ -53,7 +56,7 @@ namespace bgfx
///
struct Dxgi
{
-#if BX_PLATFORM_WINDOWS
+#if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS
typedef ::IDXGIAdapter3 AdapterI;
typedef ::IDXGIFactory5 FactoryI;
typedef ::IDXGISwapChain3 SwapChainI;
diff --git a/3rdparty/bgfx/src/emscripten.h b/3rdparty/bgfx/src/emscripten.h
index 9e037845d1e..1e1e0aea03d 100644
--- a/3rdparty/bgfx/src/emscripten.h
+++ b/3rdparty/bgfx/src/emscripten.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_EMSCRIPTEN_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/src/fs_clear0.sc b/3rdparty/bgfx/src/fs_clear0.sc
index 96b1c2e9042..29bb11271f2 100644
--- a/3rdparty/bgfx/src/fs_clear0.sc
+++ b/3rdparty/bgfx/src/fs_clear0.sc
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_shader.sh"
diff --git a/3rdparty/bgfx/src/fs_clear1.sc b/3rdparty/bgfx/src/fs_clear1.sc
index 1a635dcf619..29b965b3fc0 100644
--- a/3rdparty/bgfx/src/fs_clear1.sc
+++ b/3rdparty/bgfx/src/fs_clear1.sc
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_shader.sh"
diff --git a/3rdparty/bgfx/src/fs_clear2.sc b/3rdparty/bgfx/src/fs_clear2.sc
index e58bba56ce1..cbc9837ee86 100644
--- a/3rdparty/bgfx/src/fs_clear2.sc
+++ b/3rdparty/bgfx/src/fs_clear2.sc
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_shader.sh"
diff --git a/3rdparty/bgfx/src/fs_clear3.sc b/3rdparty/bgfx/src/fs_clear3.sc
index d2e548f20bc..8244802266d 100644
--- a/3rdparty/bgfx/src/fs_clear3.sc
+++ b/3rdparty/bgfx/src/fs_clear3.sc
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_shader.sh"
diff --git a/3rdparty/bgfx/src/fs_clear4.sc b/3rdparty/bgfx/src/fs_clear4.sc
index 54b27a72e15..f8569702d17 100644
--- a/3rdparty/bgfx/src/fs_clear4.sc
+++ b/3rdparty/bgfx/src/fs_clear4.sc
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_shader.sh"
diff --git a/3rdparty/bgfx/src/fs_clear5.sc b/3rdparty/bgfx/src/fs_clear5.sc
index c3a4beb533b..84784fbfb46 100644
--- a/3rdparty/bgfx/src/fs_clear5.sc
+++ b/3rdparty/bgfx/src/fs_clear5.sc
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_shader.sh"
diff --git a/3rdparty/bgfx/src/fs_clear6.sc b/3rdparty/bgfx/src/fs_clear6.sc
index 000eae82ea0..953eb2b768f 100644
--- a/3rdparty/bgfx/src/fs_clear6.sc
+++ b/3rdparty/bgfx/src/fs_clear6.sc
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_shader.sh"
diff --git a/3rdparty/bgfx/src/fs_clear7.sc b/3rdparty/bgfx/src/fs_clear7.sc
index faf2e3fc05f..3fca086f21e 100644
--- a/3rdparty/bgfx/src/fs_clear7.sc
+++ b/3rdparty/bgfx/src/fs_clear7.sc
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_shader.sh"
diff --git a/3rdparty/bgfx/src/fs_debugfont.sc b/3rdparty/bgfx/src/fs_debugfont.sc
index 37c3405db88..d641b90d9b0 100644
--- a/3rdparty/bgfx/src/fs_debugfont.sc
+++ b/3rdparty/bgfx/src/fs_debugfont.sc
@@ -1,8 +1,8 @@
$input v_color0, v_color1, v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_shader.sh"
diff --git a/3rdparty/bgfx/src/glcontext_eagl.h b/3rdparty/bgfx/src/glcontext_eagl.h
index c48a27b2237..7449f8532ec 100644
--- a/3rdparty/bgfx/src/glcontext_eagl.h
+++ b/3rdparty/bgfx/src/glcontext_eagl.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_GLCONTEXT_EAGL_H_HEADER_GUARD
@@ -20,10 +20,11 @@ namespace bgfx { namespace gl
, m_fbo(0)
, m_colorRbo(0)
, m_depthStencilRbo(0)
+ , m_msaaContext(false)
{
}
- void create(uint32_t _width, uint32_t _height);
+ void create(uint32_t _width, uint32_t _height, uint32_t _flags);
void destroy();
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
@@ -51,6 +52,8 @@ namespace bgfx { namespace gl
GLuint m_fbo;
GLuint m_colorRbo;
GLuint m_depthStencilRbo;
+ // true when MSAA is handled by the context instead of using MSAA FBO
+ bool m_msaaContext;
};
} /* namespace gl */ } // namespace bgfx
diff --git a/3rdparty/bgfx/src/glcontext_eagl.mm b/3rdparty/bgfx/src/glcontext_eagl.mm
index 957cd8f1777..86d1df42e72 100644
--- a/3rdparty/bgfx/src/glcontext_eagl.mm
+++ b/3rdparty/bgfx/src/glcontext_eagl.mm
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -159,7 +159,7 @@ namespace bgfx { namespace gl
GLint m_height;
};
- void GlContext::create(uint32_t _width, uint32_t _height)
+ void GlContext::create(uint32_t _width, uint32_t _height, uint32_t /*_flags*/)
{
s_opengles = bx::dlopen("/System/Library/Frameworks/OpenGLES.framework/OpenGLES");
BX_ASSERT(NULL != s_opengles, "OpenGLES dynamic library is not found!");
diff --git a/3rdparty/bgfx/src/glcontext_egl.cpp b/3rdparty/bgfx/src/glcontext_egl.cpp
index 3d1df88baa9..fabddd5c663 100644
--- a/3rdparty/bgfx/src/glcontext_egl.cpp
+++ b/3rdparty/bgfx/src/glcontext_egl.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -155,7 +155,7 @@ EGL_IMPORT
static EGL_DISPMANX_WINDOW_T s_dispmanWindow;
# endif // BX_PLATFORM_RPI
- void GlContext::create(uint32_t _width, uint32_t _height)
+ void GlContext::create(uint32_t _width, uint32_t _height, uint32_t _flags)
{
# if BX_PLATFORM_RPI
bcm_host_init();
@@ -207,6 +207,12 @@ EGL_IMPORT
const uint32_t gles = BGFX_CONFIG_RENDERER_OPENGLES;
+#if BX_PLATFORM_ANDROID
+ uint32_t msaa = (_flags&BGFX_RESET_MSAA_MASK)>>BGFX_RESET_MSAA_SHIFT;
+ uint32_t msaaSamples = msaa == 0 ? 0 : 1<<msaa;
+ m_msaaContext = true;
+#endif // BX_PLATFORM_ANDROID
+
EGLint attrs[] =
{
EGL_RENDERABLE_TYPE, (gles >= 30) ? EGL_OPENGL_ES3_BIT_KHR : EGL_OPENGL_ES2_BIT,
@@ -218,6 +224,7 @@ EGL_IMPORT
# if BX_PLATFORM_ANDROID
EGL_DEPTH_SIZE, 16,
+ EGL_SAMPLES, (EGLint)msaaSamples,
# else
EGL_DEPTH_SIZE, 24,
# endif // BX_PLATFORM_
@@ -284,11 +291,11 @@ EGL_IMPORT
# else
if (hasEglKhrCreateContext)
{
- bx::write(&writer, EGLint(EGL_CONTEXT_MAJOR_VERSION_KHR) );
- bx::write(&writer, EGLint(gles / 10) );
+ bx::write(&writer, EGLint(EGL_CONTEXT_MAJOR_VERSION_KHR), bx::ErrorAssert{} );
+ bx::write(&writer, EGLint(gles / 10), bx::ErrorAssert{} );
- bx::write(&writer, EGLint(EGL_CONTEXT_MINOR_VERSION_KHR) );
- bx::write(&writer, EGLint(gles % 10) );
+ bx::write(&writer, EGLint(EGL_CONTEXT_MINOR_VERSION_KHR), bx::ErrorAssert{} );
+ bx::write(&writer, EGLint(gles % 10), bx::ErrorAssert{} );
flags |= BGFX_CONFIG_DEBUG && hasEglKhrNoError ? 0
| EGL_CONTEXT_FLAG_NO_ERROR_BIT_KHR
@@ -303,18 +310,18 @@ EGL_IMPORT
: 0
;
- bx::write(&writer, EGLint(EGL_CONTEXT_FLAGS_KHR) );
- bx::write(&writer, flags);
+ bx::write(&writer, EGLint(EGL_CONTEXT_FLAGS_KHR), bx::ErrorAssert{} );
+ bx::write(&writer, flags, bx::ErrorAssert{});
}
}
else
# endif // BX_PLATFORM_RPI
{
- bx::write(&writer, EGLint(EGL_CONTEXT_CLIENT_VERSION) );
- bx::write(&writer, EGLint(gles / 10));
+ bx::write(&writer, EGLint(EGL_CONTEXT_CLIENT_VERSION), bx::ErrorAssert{} );
+ bx::write(&writer, EGLint(gles / 10), bx::ErrorAssert{} );
}
- bx::write(&writer, EGLint(EGL_NONE) );
+ bx::write(&writer, EGLint(EGL_NONE), bx::ErrorAssert{} );
m_context = eglCreateContext(m_display, m_config, EGL_NO_CONTEXT, s_contextAttrs);
if (NULL != m_context)
diff --git a/3rdparty/bgfx/src/glcontext_egl.h b/3rdparty/bgfx/src/glcontext_egl.h
index 85c7a987a88..b2edb67ab3d 100644
--- a/3rdparty/bgfx/src/glcontext_egl.h
+++ b/3rdparty/bgfx/src/glcontext_egl.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_GLCONTEXT_EGL_H_HEADER_GUARD
@@ -26,10 +26,11 @@ namespace bgfx { namespace gl
, m_context(NULL)
, m_display(NULL)
, m_surface(NULL)
+ , m_msaaContext(false)
{
}
- void create(uint32_t _width, uint32_t _height);
+ void create(uint32_t _width, uint32_t _height, uint32_t _flags);
void destroy();
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
@@ -52,6 +53,8 @@ namespace bgfx { namespace gl
EGLContext m_context;
EGLDisplay m_display;
EGLSurface m_surface;
+ // true when MSAA is handled by the context instead of using MSAA FBO
+ bool m_msaaContext;
};
} /* namespace gl */ } // namespace bgfx
diff --git a/3rdparty/bgfx/src/glcontext_glx.cpp b/3rdparty/bgfx/src/glcontext_glx.cpp
index c78dd6c7176..4dd21ca013a 100644
--- a/3rdparty/bgfx/src/glcontext_glx.cpp
+++ b/3rdparty/bgfx/src/glcontext_glx.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -12,8 +12,9 @@
# define GLX_GLXEXT_PROTOTYPES
# include <glx/glxext.h>
-// will include X11 which #defines None...
+// glxext will include X11 which #defines None, Status, etc.
#undef None
+#undef Status
namespace bgfx { namespace gl
{
@@ -89,7 +90,7 @@ namespace bgfx { namespace gl
return reinterpret_cast<ProtoT>( (void*)::glXGetProcAddress( (const GLubyte*)_name) );
}
- void GlContext::create(uint32_t _width, uint32_t _height)
+ void GlContext::create(uint32_t _width, uint32_t _height, uint32_t /*_flags*/)
{
BX_UNUSED(_width, _height);
diff --git a/3rdparty/bgfx/src/glcontext_glx.h b/3rdparty/bgfx/src/glcontext_glx.h
index f419073b59d..df87406db01 100644
--- a/3rdparty/bgfx/src/glcontext_glx.h
+++ b/3rdparty/bgfx/src/glcontext_glx.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_GLCONTEXT_GLX_H_HEADER_GUARD
@@ -23,10 +23,11 @@ namespace bgfx { namespace gl
, m_context(0)
, m_visualInfo(NULL)
, m_display(NULL)
+ , m_msaaContext(false)
{
}
- void create(uint32_t _width, uint32_t _height);
+ void create(uint32_t _width, uint32_t _height, uint32_t _flags);
void destroy();
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
@@ -47,6 +48,8 @@ namespace bgfx { namespace gl
GLXContext m_context;
XVisualInfo* m_visualInfo;
::Display* m_display;
+ // true when MSAA is handled by the context instead of using MSAA FBO
+ bool m_msaaContext;
};
} /* namespace gl */ } // namespace bgfx
diff --git a/3rdparty/bgfx/src/glcontext_html5.cpp b/3rdparty/bgfx/src/glcontext_html5.cpp
index a884ab7b35f..016b7c189b3 100644
--- a/3rdparty/bgfx/src/glcontext_html5.cpp
+++ b/3rdparty/bgfx/src/glcontext_html5.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -63,7 +63,7 @@ namespace bgfx { namespace gl
char* m_canvas;
};
- void GlContext::create(uint32_t _width, uint32_t _height)
+ void GlContext::create(uint32_t _width, uint32_t _height, uint32_t /*_flags*/)
{
// assert?
if (m_primary != NULL)
@@ -71,7 +71,23 @@ namespace bgfx { namespace gl
const char* canvas = (const char*) g_platformData.nwh;
- m_primary = createSwapChain((void*)canvas);
+ EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = (EMSCRIPTEN_WEBGL_CONTEXT_HANDLE) g_platformData.context;
+ if (context > 0)
+ {
+ if (emscripten_webgl_get_context_attributes(context, &s_attrs) >= 0)
+ {
+ import(s_attrs.majorVersion);
+ m_primary = BX_NEW(g_allocator, SwapChainGL)(context, canvas);
+ }
+ else
+ {
+ BX_TRACE("Invalid WebGL context. (Canvas handle: '%s', context handle: %d)", canvas, context);
+ }
+ }
+ else
+ {
+ m_primary = createSwapChain((void*)canvas);
+ }
if (0 != _width
&& 0 != _height)
@@ -121,7 +137,7 @@ namespace bgfx { namespace gl
s_attrs.minorVersion = 0;
const char* canvas = (const char*) _nwh;
- int error = 0;
+ int32_t error = 0;
for (int version = 2; version >= 1; --version)
{
@@ -138,10 +154,13 @@ namespace bgfx { namespace gl
return swapChain;
}
- error = (int) context;
+
+ error = (int32_t)context;
}
BX_TRACE("Failed to create WebGL context. (Canvas handle: '%s', last attempt error %d)", canvas, error);
+ BX_UNUSED(error);
+
return NULL;
}
diff --git a/3rdparty/bgfx/src/glcontext_html5.h b/3rdparty/bgfx/src/glcontext_html5.h
index 3b45223e10e..3c3f457d3c6 100644
--- a/3rdparty/bgfx/src/glcontext_html5.h
+++ b/3rdparty/bgfx/src/glcontext_html5.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_GLCONTEXT_HTML5_H_HEADER_GUARD
@@ -17,10 +17,11 @@ namespace bgfx { namespace gl
GlContext()
: m_current(NULL)
, m_primary(NULL)
+ , m_msaaContext(false)
{
}
- void create(uint32_t _width, uint32_t _height);
+ void create(uint32_t _width, uint32_t _height, uint32_t _flags);
void destroy();
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
@@ -39,6 +40,8 @@ namespace bgfx { namespace gl
SwapChainGL* m_current;
SwapChainGL* m_primary;
+ // true when MSAA is handled by the context instead of using MSAA FBO
+ bool m_msaaContext;
};
} /* namespace gl */ } // namespace bgfx
diff --git a/3rdparty/bgfx/src/glcontext_nsgl.h b/3rdparty/bgfx/src/glcontext_nsgl.h
index 99f616b0e5e..560808b0fd5 100644
--- a/3rdparty/bgfx/src/glcontext_nsgl.h
+++ b/3rdparty/bgfx/src/glcontext_nsgl.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_GLCONTEXT_NSGL_H_HEADER_GUARD
@@ -17,10 +17,11 @@ namespace bgfx { namespace gl
GlContext()
: m_context(NULL)
, m_view(NULL)
+ , m_msaaContext(false)
{
}
- void create(uint32_t _width, uint32_t _height);
+ void create(uint32_t _width, uint32_t _height, uint32_t _flags);
void destroy();
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
@@ -39,6 +40,9 @@ namespace bgfx { namespace gl
void* m_context;
void* m_view;
+ // true when MSAA is handled by the context instead of using MSAA FBO
+ bool m_msaaContext;
+
};
} /* namespace gl */ } // namespace bgfx
diff --git a/3rdparty/bgfx/src/glcontext_nsgl.mm b/3rdparty/bgfx/src/glcontext_nsgl.mm
index ea3912582e2..acb1900762c 100644
--- a/3rdparty/bgfx/src/glcontext_nsgl.mm
+++ b/3rdparty/bgfx/src/glcontext_nsgl.mm
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -156,7 +156,7 @@ namespace bgfx { namespace gl
static void* s_opengl = NULL;
- void GlContext::create(uint32_t _width, uint32_t _height)
+ void GlContext::create(uint32_t _width, uint32_t _height, uint32_t /*_flags*/)
{
BX_UNUSED(_width, _height);
@@ -238,11 +238,22 @@ namespace bgfx { namespace gl
GLint interval = 0;
[glContext setValues:&interval forParameter:NSOpenGLCPSwapInterval];
- // When initializing NSOpenGLView programatically (as we are), this sometimes doesn't
+ // When initializing NSOpenGLView programmatically (as we are), this sometimes doesn't
// get hooked up properly (especially when there are existing window elements). This ensures
// we are valid. Otherwise, you'll probably get a GL_INVALID_FRAMEBUFFER_OPERATION when
// trying to glClear() for the first time.
- [glContext setView:glView];
+ void (^set_view)(void) = ^(void) {
+ [glContext setView:glView];
+ };
+
+ if([NSThread isMainThread])
+ {
+ set_view();
+ }
+ else
+ {
+ dispatch_sync(dispatch_get_main_queue(),set_view);
+ }
m_view = glView;
m_context = glContext;
@@ -288,7 +299,19 @@ namespace bgfx { namespace gl
GLint interval = vsync ? 1 : 0;
NSOpenGLContext* glContext = (NSOpenGLContext*)m_context;
[glContext setValues:&interval forParameter:NSOpenGLCPSwapInterval];
- [glContext update];
+
+ void (^update_view)(void) = ^(void) {
+ [glContext update];
+ };
+
+ if([NSThread isMainThread])
+ {
+ update_view();
+ }
+ else
+ {
+ dispatch_sync(dispatch_get_main_queue(),update_view);
+ }
}
uint64_t GlContext::getCaps() const
diff --git a/3rdparty/bgfx/src/glcontext_wgl.cpp b/3rdparty/bgfx/src/glcontext_wgl.cpp
index 6c2d48533df..f09a23d872e 100644
--- a/3rdparty/bgfx/src/glcontext_wgl.cpp
+++ b/3rdparty/bgfx/src/glcontext_wgl.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -108,7 +108,7 @@ namespace bgfx { namespace gl
return context;
}
- void GlContext::create(uint32_t /*_width*/, uint32_t /*_height*/)
+ void GlContext::create(uint32_t /*_width*/, uint32_t /*_height*/, uint32_t /*_flags*/)
{
m_opengl32dll = bx::dlopen("opengl32.dll");
BGFX_FATAL(NULL != m_opengl32dll, Fatal::UnableToInitialize, "Failed to load opengl32.dll.");
@@ -201,7 +201,7 @@ namespace bgfx { namespace gl
WGL_ALPHA_BITS_ARB, 8,
WGL_COLOR_BITS_ARB, 32,
WGL_DEPTH_BITS_ARB, 24,
- WGL_STENCIL_BITS_ARB, 0,
+ WGL_STENCIL_BITS_ARB, 8,
WGL_PIXEL_TYPE_ARB, WGL_TYPE_RGBA_ARB,
WGL_SAMPLES_ARB, 0,
diff --git a/3rdparty/bgfx/src/glcontext_wgl.h b/3rdparty/bgfx/src/glcontext_wgl.h
index 8ac6460315a..7289a123424 100644
--- a/3rdparty/bgfx/src/glcontext_wgl.h
+++ b/3rdparty/bgfx/src/glcontext_wgl.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_GLCONTEXT_WGL_H_HEADER_GUARD
@@ -65,10 +65,11 @@ typedef void (APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum z
, m_opengl32dll(NULL)
, m_context(NULL)
, m_hdc(NULL)
+ , m_msaaContext(false)
{
}
- void create(uint32_t _width, uint32_t _height);
+ void create(uint32_t _width, uint32_t _height, uint32_t _flags);
void destroy();
void resize(uint32_t _width, uint32_t _height, uint32_t _flags);
@@ -92,6 +93,8 @@ typedef void (APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum z
void* m_opengl32dll;
HGLRC m_context;
HDC m_hdc;
+ // true when MSAA is handled by the context instead of using MSAA FBO
+ bool m_msaaContext;
};
} /* namespace gl */ } // namespace bgfx
diff --git a/3rdparty/bgfx/src/glimports.h b/3rdparty/bgfx/src/glimports.h
index ef2a28df9bd..5a687bbf420 100644
--- a/3rdparty/bgfx/src/glimports.h
+++ b/3rdparty/bgfx/src/glimports.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#if !defined(GL_IMPORT) && !defined(GL_EXTENSION)
@@ -30,6 +30,7 @@
#define GL_IMPORT_NV___(_optional, _proto, _func) GL_EXTENSION(_optional, _proto, _func, _func ## NV)
#define GL_IMPORT_OES__(_optional, _proto, _func) GL_EXTENSION(_optional, _proto, _func, _func ## OES)
#define GL_IMPORT_IMG__(_optional, _proto, _func) GL_EXTENSION(_optional, _proto, _func, _func ## IMG)
+#define GL_IMPORT_WEBGL(_optional, _proto, _func) GL_EXTENSION(_optional, _proto, _func, _func ## WEBGL)
#define GL_IMPORT_____x(_optional, _proto, _func) GL_EXTENSION(_optional, _proto, _func, _func ## XXXXX)
#if GL_IMPORT_TYPEDEFS
@@ -163,6 +164,8 @@ typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
typedef void (GL_APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTPROC) (GLenum mode, const void *indirect, GLsizei drawcount, GLsizei stride);
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void *indirect, GLsizei drawcount, GLsizei stride);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC) (GLenum mode, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC) (GLenum mode, GLenum type, const void *indirect, GLintptr drawcount, GLsizei maxdrawcount, GLsizei stride);
typedef void (GL_APIENTRYP PFNGLOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELPROC) (const void *ptr, GLsizei length, const GLchar *label);
typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
@@ -227,6 +230,7 @@ typedef void (GL_APIENTRYP PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC)(GL
typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC)(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
#endif // GL_IMPORT_TYPEDEFS
#if BGFX_USE_GL_DYNAMIC_LIB
@@ -366,6 +370,8 @@ GL_IMPORT______(false, PFNGLLINKPROGRAMPROC, glLinkProgram
GL_IMPORT______(true, PFNGLMEMORYBARRIERPROC, glMemoryBarrier);
GL_IMPORT______(true, PFNGLMULTIDRAWARRAYSINDIRECTPROC, glMultiDrawArraysIndirect);
GL_IMPORT______(true, PFNGLMULTIDRAWELEMENTSINDIRECTPROC, glMultiDrawElementsIndirect);
+GL_IMPORT______(true, PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC, glMultiDrawArraysIndirectCount);
+GL_IMPORT______(true, PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC, glMultiDrawElementsIndirectCount);
GL_IMPORT______(true, PFNGLOBJECTLABELPROC, glObjectLabel);
GL_IMPORT______(true, PFNGLOBJECTPTRLABELPROC, glObjectPtrLabel);
GL_IMPORT______(false, PFNGLPIXELSTOREIPROC, glPixelStorei);
@@ -455,6 +461,8 @@ GL_IMPORT_ARB__(true, PFNGLINVALIDATEFRAMEBUFFERPROC, glInvalidateF
GL_IMPORT_ARB__(true, PFNGLMULTIDRAWARRAYSINDIRECTPROC, glMultiDrawArraysIndirect);
GL_IMPORT_ARB__(true, PFNGLMULTIDRAWELEMENTSINDIRECTPROC, glMultiDrawElementsIndirect);
+GL_IMPORT_ARB__(true, PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC, glMultiDrawArraysIndirectCount);
+GL_IMPORT_ARB__(true, PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC, glMultiDrawElementsIndirectCount);
GL_IMPORT_EXT__(true, PFNGLBINDFRAMEBUFFERPROC, glBindFramebuffer);
GL_IMPORT_EXT__(true, PFNGLGENFRAMEBUFFERSPROC, glGenFramebuffers);
@@ -494,6 +502,7 @@ GL_IMPORT______(true, PFNGLGETINTERNALFORMATI64VPROC, glGetInternal
#endif // BGFX_USE_GL_DYNAMIC_LIB
GL_IMPORT______(true, PFNGLGETTRANSLATEDSHADERSOURCEANGLEPROC, glGetTranslatedShaderSourceANGLE);
+GL_IMPORT______(true, PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC, glFramebufferTexture2DMultisampleEXT);
#if !BGFX_CONFIG_RENDERER_OPENGL
GL_IMPORT______(true, PFNGLPOINTSIZEPROC, glPointSize);
@@ -543,6 +552,8 @@ GL_IMPORT_EXT__(true, PFNGLDRAWARRAYSINDIRECTPROC, glDrawArraysI
GL_IMPORT_EXT__(true, PFNGLDRAWELEMENTSINDIRECTPROC, glDrawElementsIndirect);
GL_IMPORT_EXT__(true, PFNGLMULTIDRAWARRAYSINDIRECTPROC, glMultiDrawArraysIndirect);
GL_IMPORT_EXT__(true, PFNGLMULTIDRAWELEMENTSINDIRECTPROC, glMultiDrawElementsIndirect);
+GL_IMPORT_EXT__(true, PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC, glMultiDrawArraysIndirectCount);
+GL_IMPORT_EXT__(true, PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC, glMultiDrawElementsIndirectCount);
GL_IMPORT_OES__(true, PFNGLGETPROGRAMBINARYPROC, glGetProgramBinary);
GL_IMPORT_OES__(true, PFNGLPROGRAMBINARYPROC, glProgramBinary);
@@ -573,14 +584,14 @@ GL_IMPORT_____x(true, PFNGLBLENDEQUATIONSEPARATEIPROC, glBlendEquati
GL_IMPORT_____x(true, PFNGLBLENDFUNCIPROC, glBlendFunci);
GL_IMPORT_____x(true, PFNGLBLENDFUNCSEPARATEIPROC, glBlendFuncSeparatei);
-GL_IMPORT_____x(true, PFNGLDRAWBUFFERPROC, glDrawBuffer);
-GL_IMPORT_____x(true, PFNGLREADBUFFERPROC, glReadBuffer);
-GL_IMPORT_____x(true, PFNGLGENSAMPLERSPROC, glGenSamplers);
-GL_IMPORT_____x(true, PFNGLDELETESAMPLERSPROC, glDeleteSamplers);
-GL_IMPORT_____x(true, PFNGLBINDSAMPLERPROC, glBindSampler);
-GL_IMPORT_____x(true, PFNGLSAMPLERPARAMETERFPROC, glSamplerParameterf);
-GL_IMPORT_____x(true, PFNGLSAMPLERPARAMETERIPROC, glSamplerParameteri);
-GL_IMPORT_____x(true, PFNGLSAMPLERPARAMETERFVPROC, glSamplerParameterfv);
+GL_IMPORT______(true, PFNGLDRAWBUFFERPROC, glDrawBuffer);
+GL_IMPORT______(true, PFNGLREADBUFFERPROC, glReadBuffer);
+GL_IMPORT______(true, PFNGLGENSAMPLERSPROC, glGenSamplers);
+GL_IMPORT______(true, PFNGLDELETESAMPLERSPROC, glDeleteSamplers);
+GL_IMPORT______(true, PFNGLBINDSAMPLERPROC, glBindSampler);
+GL_IMPORT______(true, PFNGLSAMPLERPARAMETERFPROC, glSamplerParameterf);
+GL_IMPORT______(true, PFNGLSAMPLERPARAMETERIPROC, glSamplerParameteri);
+GL_IMPORT______(true, PFNGLSAMPLERPARAMETERFVPROC, glSamplerParameterfv);
GL_IMPORT_____x(true, PFNGLBINDBUFFERBASEPROC, glBindBufferBase);
GL_IMPORT_____x(true, PFNGLBINDBUFFERRANGEPROC, glBindBufferRange);
@@ -595,7 +606,11 @@ GL_IMPORT_____x(true, PFNGLMEMORYBARRIERPROC, glMemoryBarri
GL_IMPORT_____x(true, PFNGLDISPATCHCOMPUTEPROC, glDispatchCompute);
GL_IMPORT_____x(true, PFNGLDISPATCHCOMPUTEINDIRECTPROC, glDispatchComputeIndirect);
+#if BX_PLATFORM_EMSCRIPTEN
+GL_IMPORT_WEBGL(true, PFNGLDRAWBUFFERSPROC, glDrawBuffers);
+#else
GL_IMPORT_NV___(true, PFNGLDRAWBUFFERSPROC, glDrawBuffers);
+#endif
GL_IMPORT_NV___(true, PFNGLGENQUERIESPROC, glGenQueries);
GL_IMPORT_NV___(true, PFNGLDELETEQUERIESPROC, glDeleteQueries);
GL_IMPORT_NV___(true, PFNGLBEGINQUERYPROC, glBeginQuery);
@@ -671,7 +686,11 @@ GL_IMPORT______(true, PFNGLMEMORYBARRIERPROC, glMemoryBarri
GL_IMPORT______(true, PFNGLDISPATCHCOMPUTEPROC, glDispatchCompute);
GL_IMPORT______(true, PFNGLDISPATCHCOMPUTEINDIRECTPROC, glDispatchComputeIndirect);
+# if BX_PLATFORM_EMSCRIPTEN
+GL_IMPORT_WEBGL(true, PFNGLDRAWBUFFERSPROC, glDrawBuffers);
+# else
GL_IMPORT______(true, PFNGLDRAWBUFFERSPROC, glDrawBuffers);
+# endif
GL_IMPORT______(true, PFNGLGENQUERIESPROC, glGenQueries);
GL_IMPORT______(true, PFNGLDELETEQUERIESPROC, glDeleteQueries);
GL_IMPORT______(true, PFNGLBEGINQUERYPROC, glBeginQuery);
@@ -684,6 +703,8 @@ GL_IMPORT______(true, PFNGLDRAWARRAYSINDIRECTPROC, glDrawArraysI
GL_IMPORT______(true, PFNGLDRAWELEMENTSINDIRECTPROC, glDrawElementsIndirect);
GL_IMPORT______(true, PFNGLMULTIDRAWARRAYSINDIRECTPROC, glMultiDrawArraysIndirect);
GL_IMPORT______(true, PFNGLMULTIDRAWELEMENTSINDIRECTPROC, glMultiDrawElementsIndirect);
+GL_IMPORT______(true, PFNGLMULTIDRAWARRAYSINDIRECTCOUNTPROC, glMultiDrawArraysIndirectCount);
+GL_IMPORT______(true, PFNGLMULTIDRAWELEMENTSINDIRECTCOUNTPROC, glMultiDrawElementsIndirectCount);
GL_IMPORT______(true, PFNGLINVALIDATEFRAMEBUFFERPROC, glInvalidateFramebuffer);
diff --git a/3rdparty/bgfx/src/makefile b/3rdparty/bgfx/src/makefile
index 336ba29fd98..086dfe6379c 100644
--- a/3rdparty/bgfx/src/makefile
+++ b/3rdparty/bgfx/src/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
THISDIR:=$(dir $(lastword $(MAKEFILE_LIST)))
diff --git a/3rdparty/bgfx/src/nvapi.cpp b/3rdparty/bgfx/src/nvapi.cpp
index 4613179d7ee..0103b0c0c30 100644
--- a/3rdparty/bgfx/src/nvapi.cpp
+++ b/3rdparty/bgfx/src/nvapi.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
diff --git a/3rdparty/bgfx/src/nvapi.h b/3rdparty/bgfx/src/nvapi.h
index b3be212dabe..0f03f4aa8d7 100644
--- a/3rdparty/bgfx/src/nvapi.h
+++ b/3rdparty/bgfx/src/nvapi.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_NVAPI_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/src/renderer.h b/3rdparty/bgfx/src/renderer.h
index d31a6b2aa6a..b62c485bc20 100644
--- a/3rdparty/bgfx/src/renderer.h
+++ b/3rdparty/bgfx/src/renderer.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_RENDERER_H_HEADER_GUARD
@@ -501,7 +501,7 @@ namespace bgfx
ViewStats& viewStats = m_frame->m_perfStats.viewStats[m_numViews];
viewStats.cpuTimeBegin = bx::getHPCounter();
- m_queryIdx = m_gpuTimer.begin(_view);
+ m_queryIdx = m_gpuTimer.begin(_view, m_frame->m_frameNum);
viewStats.view = ViewId(_view);
bx::strCopy(viewStats.name
@@ -524,6 +524,7 @@ namespace bgfx
viewStats.cpuTimeEnd = bx::getHPCounter();
viewStats.gpuTimeBegin = result.m_begin;
viewStats.gpuTimeEnd = result.m_end;
+ viewStats.gpuFrameNum = result.m_frameNum;
++m_numViews;
m_queryIdx = UINT32_MAX;
diff --git a/3rdparty/bgfx/src/renderer_agc.cpp b/3rdparty/bgfx/src/renderer_agc.cpp
index f1e41f98e69..f393b3b4400 100644
--- a/3rdparty/bgfx/src/renderer_agc.cpp
+++ b/3rdparty/bgfx/src/renderer_agc.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
diff --git a/3rdparty/bgfx/src/renderer_d3d.h b/3rdparty/bgfx/src/renderer_d3d.h
index c534eb681d1..d0ec4ebdaf9 100644
--- a/3rdparty/bgfx/src/renderer_d3d.h
+++ b/3rdparty/bgfx/src/renderer_d3d.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_RENDERER_D3D_H_HEADER_GUARD
@@ -19,6 +19,10 @@
# define DX_CHECK_EXTRA_ARGS
#endif // BGFX_CONFIG_DEBUG && BGFX_CONFIG_RENDERER_DIRECT3D9
+#ifndef DXGI_ERROR_NOT_CURRENTLY_AVAILABLE
+# define DXGI_ERROR_NOT_CURRENTLY_AVAILABLE HRESULT(0x887A0022)
+#endif // DXGI_ERROR_NOT_CURRENTLY_AVAILABLE
+
#define DXGI_FORMAT_ASTC_4X4_TYPELESS DXGI_FORMAT(133)
#define DXGI_FORMAT_ASTC_4X4_UNORM DXGI_FORMAT(134)
#define DXGI_FORMAT_ASTC_4X4_UNORM_SRGB DXGI_FORMAT(135)
diff --git a/3rdparty/bgfx/src/renderer_d3d11.cpp b/3rdparty/bgfx/src/renderer_d3d11.cpp
index e936d64ae12..b15f0a12886 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d11.cpp
@@ -1,12 +1,13 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
#if BGFX_CONFIG_RENDERER_DIRECT3D11
# include "renderer_d3d11.h"
+# include <bx/pixelformat.h>
namespace bgfx { namespace d3d11
{
@@ -223,11 +224,19 @@ namespace bgfx { namespace d3d11
{ DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ATCE
{ DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ATCI
{ DXGI_FORMAT_ASTC_4X4_UNORM, DXGI_FORMAT_ASTC_4X4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_4X4_UNORM_SRGB }, // ASTC4x4
+ { DXGI_FORMAT_ASTC_5X4_UNORM, DXGI_FORMAT_ASTC_5X4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_5X4_UNORM_SRGB }, // ASTC5x4
{ DXGI_FORMAT_ASTC_5X5_UNORM, DXGI_FORMAT_ASTC_5X5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_5X5_UNORM_SRGB }, // ASTC5x5
+ { DXGI_FORMAT_ASTC_6X5_UNORM, DXGI_FORMAT_ASTC_6X5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_6X5_UNORM_SRGB }, // ASTC6x5
{ DXGI_FORMAT_ASTC_6X6_UNORM, DXGI_FORMAT_ASTC_6X6_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_6X6_UNORM_SRGB }, // ASTC6x6
{ DXGI_FORMAT_ASTC_8X5_UNORM, DXGI_FORMAT_ASTC_8X5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_8X5_UNORM_SRGB }, // ASTC8x5
{ DXGI_FORMAT_ASTC_8X6_UNORM, DXGI_FORMAT_ASTC_8X6_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_8X6_UNORM_SRGB }, // ASTC8x6
+ { DXGI_FORMAT_ASTC_8X8_UNORM, DXGI_FORMAT_ASTC_8X8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_8X8_UNORM_SRGB }, // ASTC8x8
{ DXGI_FORMAT_ASTC_10X5_UNORM, DXGI_FORMAT_ASTC_10X5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_10X5_UNORM_SRGB }, // ASTC10x5
+ { DXGI_FORMAT_ASTC_10X6_UNORM, DXGI_FORMAT_ASTC_10X6_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_10X6_UNORM_SRGB }, // ASTC10x6
+ { DXGI_FORMAT_ASTC_10X8_UNORM, DXGI_FORMAT_ASTC_10X8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_10X8_UNORM_SRGB }, // ASTC10x8
+ { DXGI_FORMAT_ASTC_10X10_UNORM, DXGI_FORMAT_ASTC_10X10_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_10X10_UNORM_SRGB}, // ASTC10x10
+ { DXGI_FORMAT_ASTC_12X10_UNORM, DXGI_FORMAT_ASTC_12X10_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_12X10_UNORM_SRGB}, // ASTC12x10
+ { DXGI_FORMAT_ASTC_12X12_UNORM, DXGI_FORMAT_ASTC_12X12_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_12X12_UNORM_SRGB}, // ASTC12x12
{ DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // Unknown
{ DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R1
{ DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // A8
@@ -273,8 +282,11 @@ namespace bgfx { namespace d3d11
{ DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32I
{ DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32U
{ DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32F
+ { DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // B5G6R5
{ DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R5G6B5
+ { DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BGRA4
{ DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA4
+ { DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BGR5A1
{ DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB5A1
{ DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB10A2
{ DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG11B10F
@@ -540,11 +552,13 @@ namespace bgfx { namespace d3d11
{
uint8_t temp[28];
+ bx::ErrorAssert err;
+
bx::StaticMemoryBlockWriter writer(&temp, sizeof(temp) );
- bx::write(&writer, "INTCEXTNCAPSFUNC", 16);
- bx::write(&writer, kIntelExtensionInterfaceVersion);
- bx::write(&writer, UINT32_C(0) );
- bx::write(&writer, UINT32_C(0) );
+ bx::write(&writer, "INTCEXTNCAPSFUNC", 16, &err);
+ bx::write(&writer, kIntelExtensionInterfaceVersion, &err);
+ bx::write(&writer, uint32_t(0), &err);
+ bx::write(&writer, uint32_t(0), &err);
if (SUCCEEDED(setIntelExtension(_device, temp, sizeof(temp) ) ) )
{
@@ -552,10 +566,10 @@ namespace bgfx { namespace d3d11
bx::skip(&reader, 16);
uint32_t version;
- bx::read(&reader, version);
+ bx::read(&reader, version, &err);
uint32_t driverVersion;
- bx::read(&reader, driverVersion);
+ bx::read(&reader, driverVersion, &err);
return version <= driverVersion;
}
@@ -805,11 +819,19 @@ namespace bgfx { namespace d3d11
m_nvapi.init();
#if USE_D3D11_DYNAMIC_LIB
- m_d3d11Dll = bx::dlopen("d3d11.dll");
+ const char* d3d11DllName =
+#if BX_PLATFORM_LINUX
+ "d3d11.so"
+#else
+ "d3d11.dll"
+#endif // BX_PLATFORM_LINUX
+ ;
+
+ m_d3d11Dll = bx::dlopen(d3d11DllName);
if (NULL == m_d3d11Dll)
{
- BX_TRACE("Init error: Failed to load d3d11.dll.");
+ BX_TRACE("Init error: Failed to load %s.", d3d11DllName);
goto error;
}
@@ -861,7 +883,20 @@ namespace bgfx { namespace d3d11
errorState = ErrorState::LoadedDXGI;
- if (NULL == m_device)
+ if (NULL != m_device)
+ {
+ m_device->AddRef();
+ m_device->GetImmediateContext(&m_deviceCtx);
+
+ if (NULL == m_deviceCtx)
+ {
+ BX_TRACE("Init error: Unable to retrieve Direct3D11 ImmediateContext.");
+ goto error;
+ }
+
+ m_featureLevel = m_device->GetFeatureLevel();
+ }
+ else
{
if (NULL != m_renderDocDll)
{
@@ -942,18 +977,6 @@ namespace bgfx { namespace d3d11
goto error;
}
}
- else
- {
- m_device->GetImmediateContext(&m_deviceCtx);
-
- if (NULL == m_deviceCtx)
- {
- BX_TRACE("Init error: Unable to retrieve Direct3D11 ImmediateContext.");
- goto error;
- }
-
- m_featureLevel = m_device->GetFeatureLevel();
- }
m_dxgi.update(m_device);
@@ -998,11 +1021,11 @@ namespace bgfx { namespace d3d11
HRESULT hr = S_OK;
m_swapEffect =
-#if BX_PLATFORM_WINDOWS
+#if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS
DXGI_SWAP_EFFECT_FLIP_DISCARD
#else
DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL
-#endif // !BX_PLATFORM_WINDOWS
+#endif // BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS
;
m_swapBufferCount = bx::clamp<uint8_t>(_init.resolution.numBackBuffers, 2, BGFX_CONFIG_MAX_BACK_BUFFERS);
@@ -1033,7 +1056,12 @@ namespace bgfx { namespace d3d11
: DXGI_SCALING_STRETCH
;
m_scd.swapEffect = m_swapEffect;
- m_scd.alphaMode = DXGI_ALPHA_MODE_IGNORE;
+
+ m_scd.alphaMode = (_init.resolution.reset & BGFX_RESET_TRANSPARENT_BACKBUFFER)
+ ? DXGI_ALPHA_MODE_PREMULTIPLIED
+ : DXGI_ALPHA_MODE_IGNORE
+ ;
+
m_scd.flags = DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH;
m_scd.maxFrameLatency = bx::min<uint8_t>(_init.resolution.maxFrameLatency, BGFX_CONFIG_MAX_FRAME_LATENCY);
@@ -1337,7 +1365,7 @@ namespace bgfx { namespace d3d11
if (DXGI_FORMAT_UNKNOWN != fmt)
{
- if (BX_ENABLED(BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT) )
+ if (BX_ENABLED(BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT) )
{
D3D11_FEATURE_DATA_FORMAT_SUPPORT data;
data.InFormat = fmt;
@@ -1466,7 +1494,7 @@ namespace bgfx { namespace d3d11
if (DXGI_FORMAT_UNKNOWN != fmtSrgb)
{
- if (BX_ENABLED(BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT) )
+ if (BX_ENABLED(BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT) )
{
struct D3D11_FEATURE_DATA_FORMAT_SUPPORT
{
@@ -1850,7 +1878,7 @@ namespace bgfx { namespace d3d11
bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
- bx::write(&writer, magic);
+ bx::write(&writer, magic, bx::ErrorAssert{});
TextureCreate tc;
tc.m_width = _width;
@@ -1861,7 +1889,7 @@ namespace bgfx { namespace d3d11
tc.m_format = TextureFormat::Enum(texture.m_requestedFormat);
tc.m_cubeMap = false;
tc.m_mem = NULL;
- bx::write(&writer, tc);
+ bx::write(&writer, tc, bx::ErrorAssert{});
texture.destroy();
texture.create(mem, texture.m_flags, 0);
@@ -2439,7 +2467,7 @@ namespace bgfx { namespace d3d11
uint32_t flags = _resolution.reset & (~BGFX_RESET_INTERNAL_FORCE);
bool resize = true
- && !BX_ENABLED(BX_PLATFORM_XBOXONE || BX_PLATFORM_WINRT) // can't use ResizeBuffers on Windows Phone
+ && !BX_ENABLED(BX_PLATFORM_XBOXONE)
&& (m_resolution.reset&BGFX_RESET_MSAA_MASK) == (flags&BGFX_RESET_MSAA_MASK)
;
@@ -2910,10 +2938,10 @@ namespace bgfx { namespace d3d11
{
_state &= 0
| BGFX_STATE_CULL_MASK
+ | BGFX_STATE_FRONT_CCW
| BGFX_STATE_MSAA
| BGFX_STATE_LINEAA
| BGFX_STATE_CONSERVATIVE_RASTER
- | BGFX_STATE_FRONT_CCW
;
_state |= _wireframe ? BGFX_STATE_PT_LINES : BGFX_STATE_NONE;
_state |= _scissor ? BGFX_STATE_RESERVED_MASK : 0;
@@ -3227,22 +3255,10 @@ namespace bgfx { namespace d3d11
break;
case TextureD3D11::TextureCube:
- if (_compute)
- {
- desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2DARRAY;
- desc.Texture2DArray.MostDetailedMip = _mip;
- desc.Texture2DArray.MipLevels = 1;
- desc.Texture2DArray.FirstArraySlice = 0;
- desc.Texture2DArray.ArraySize = 6;
- }
- else
- {
- desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;
- desc.TextureCube.MostDetailedMip = _mip;
- desc.TextureCube.MipLevels = 1;
- }
+ desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURECUBE;
+ desc.TextureCube.MostDetailedMip = _mip;
+ desc.TextureCube.MipLevels = 1;
break;
-
case TextureD3D11::Texture3D:
desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE3D;
desc.Texture3D.MostDetailedMip = _mip;
@@ -4078,13 +4094,15 @@ namespace bgfx { namespace d3d11
{
bx::MemoryReader reader(_mem->data, _mem->size);
+ bx::ErrorAssert err;
+
uint32_t magic;
- bx::read(&reader, magic);
+ bx::read(&reader, magic, &err);
const bool fragment = isShaderType(magic, 'F');
uint32_t hashIn;
- bx::read(&reader, hashIn);
+ bx::read(&reader, hashIn, &err);
uint32_t hashOut;
@@ -4094,11 +4112,11 @@ namespace bgfx { namespace d3d11
}
else
{
- bx::read(&reader, hashOut);
+ bx::read(&reader, hashOut, &err);
}
uint16_t count;
- bx::read(&reader, count);
+ bx::read(&reader, count, &err);
m_numPredefined = 0;
m_numUniforms = count;
@@ -4115,34 +4133,34 @@ namespace bgfx { namespace d3d11
for (uint32_t ii = 0; ii < count; ++ii)
{
uint8_t nameSize = 0;
- bx::read(&reader, nameSize);
+ bx::read(&reader, nameSize, &err);
char name[256] = { '\0' };
- bx::read(&reader, &name, nameSize);
+ bx::read(&reader, &name, nameSize, &err);
name[nameSize] = '\0';
uint8_t type = 0;
- bx::read(&reader, type);
+ bx::read(&reader, type, &err);
uint8_t num = 0;
- bx::read(&reader, num);
+ bx::read(&reader, num, &err);
uint16_t regIndex = 0;
- bx::read(&reader, regIndex);
+ bx::read(&reader, regIndex, &err);
uint16_t regCount = 0;
- bx::read(&reader, regCount);
+ bx::read(&reader, regCount, &err);
if (!isShaderVerLess(magic, 8) )
{
uint16_t texInfo = 0;
- bx::read(&reader, texInfo);
+ bx::read(&reader, texInfo, &err);
}
if (!isShaderVerLess(magic, 10) )
{
uint16_t texFormat = 0;
- bx::read(&reader, texFormat);
+ bx::read(&reader, texFormat, &err);
}
const char* kind = "invalid";
@@ -4195,7 +4213,7 @@ namespace bgfx { namespace d3d11
}
uint32_t shaderSize;
- bx::read(&reader, shaderSize);
+ bx::read(&reader, shaderSize, &err);
const void* code = reader.getDataPtr();
bx::skip(&reader, shaderSize+1);
@@ -4207,8 +4225,7 @@ namespace bgfx { namespace d3d11
bx::MemoryReader rd(code, shaderSize);
DxbcContext dxbc;
- bx::Error err;
- read(&rd, dxbc, &err);
+ read(&rd, dxbc, bx::ErrorAssert{});
bool patchShader = !dxbc.shader.aon9;
if (patchShader)
@@ -4248,14 +4265,14 @@ namespace bgfx { namespace d3d11
}
uint8_t numAttrs = 0;
- bx::read(&reader, numAttrs);
+ bx::read(&reader, numAttrs, bx::ErrorAssert{});
bx::memSet(m_attrMask, 0, sizeof(m_attrMask) );
for (uint32_t ii = 0; ii < numAttrs; ++ii)
{
uint16_t id;
- bx::read(&reader, id);
+ bx::read(&reader, id, bx::ErrorAssert{});
Attrib::Enum attr = idToAttrib(id);
@@ -4266,7 +4283,7 @@ namespace bgfx { namespace d3d11
}
uint16_t size;
- bx::read(&reader, size);
+ bx::read(&reader, size, bx::ErrorAssert{});
if (0 < size)
{
@@ -4419,6 +4436,7 @@ namespace bgfx { namespace d3d11
, swizzle ? " (swizzle BGRA8 -> RGBA8)" : ""
);
+ uint8_t* temp = NULL;
for (uint16_t side = 0; side < numSides; ++side)
{
for (uint8_t lod = 0, num = ti.numMips; lod < num; ++lod)
@@ -4431,7 +4449,7 @@ namespace bgfx { namespace d3d11
if (convert)
{
uint32_t srcpitch = mip.m_width*bpp/8;
- uint8_t* 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;
@@ -4445,6 +4463,25 @@ namespace bgfx { namespace d3d11
else
{
srd[kk].SysMemPitch = mip.m_width*mip.m_bpp/8;
+
+ switch (m_textureFormat)
+ {
+ case TextureFormat::R5G6B5:
+ 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);
+ 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);
+ bimg::imageConvert(temp, 16, bx::packBgr5a1, mip.m_data, bx::unpackRgb5a1, srd[kk].SysMemPitch*mip.m_height);
+ srd[kk].pSysMem = temp;
+ break;
+ }
}
srd[kk].SysMemSlicePitch = mip.m_height*srd[kk].SysMemPitch;
@@ -4669,8 +4706,7 @@ namespace bgfx { namespace d3d11
DX_CHECK(s_renderD3D11->m_device->CreateUnorderedAccessView(m_ptr, NULL, &m_uav) );
}
- if (convert
- && 0 != kk)
+ if (temp != NULL)
{
kk = 0;
for (uint16_t side = 0; side < numSides; ++side)
@@ -4704,8 +4740,10 @@ namespace bgfx { namespace d3d11
void TextureD3D11::overrideInternal(uintptr_t _ptr)
{
D3D11_SHADER_RESOURCE_VIEW_DESC srvDesc{};
+
const bool readable = (m_srv != NULL);
- if (readable) {
+ if (readable)
+ {
m_srv->GetDesc(&srvDesc);
}
@@ -4713,7 +4751,8 @@ namespace bgfx { namespace d3d11
m_flags |= BGFX_SAMPLER_INTERNAL_SHARED;
m_ptr = (ID3D11Resource*)_ptr;
- if (readable) {
+ if (readable)
+ {
s_renderD3D11->m_device->CreateShaderResourceView(m_ptr, &srvDesc, &m_srv);
}
}
@@ -4742,15 +4781,16 @@ namespace bgfx { namespace d3d11
box.back = 1;
}
+ const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(m_textureFormat) );
+ const uint16_t bpp = blockInfo.bitsPerPixel;
const uint32_t subres = _mip + ( (layer + _side) * m_numMips);
const bool depth = bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) );
- const uint32_t bpp = bimg::getBitsPerPixel(bimg::TextureFormat::Enum(m_textureFormat) );
uint32_t rectpitch = _rect.m_width*bpp/8;
- if (bimg::isCompressed(bimg::TextureFormat::Enum(m_textureFormat)))
+ if (bimg::isCompressed(bimg::TextureFormat::Enum(m_textureFormat) ) )
{
- const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(m_textureFormat));
rectpitch = (_rect.m_width / blockInfo.blockWidth)*blockInfo.blockSize;
}
+
const uint32_t srcpitch = UINT16_MAX == _pitch ? rectpitch : _pitch;
const uint32_t slicepitch = rectpitch*_rect.m_height;
@@ -4764,6 +4804,9 @@ namespace bgfx { namespace d3d11
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;
+
+ box.right = bx::max(1u, m_width >> _mip);
+ box.bottom = bx::max(1u, m_height >> _mip);
}
deviceCtx->UpdateSubresource(
@@ -5289,7 +5332,7 @@ namespace bgfx { namespace d3d11
}
}
- uint32_t TimerQueryD3D11::begin(uint32_t _resultIdx)
+ uint32_t TimerQueryD3D11::begin(uint32_t _resultIdx, uint32_t _frameNum)
{
ID3D11DeviceContext* deviceCtx = s_renderD3D11->m_deviceCtx;
@@ -5305,6 +5348,7 @@ namespace bgfx { namespace d3d11
Query& query = m_query[idx];
query.m_resultIdx = _resultIdx;
query.m_ready = false;
+ query.m_frameNum = _frameNum;
deviceCtx->Begin(query.m_disjoint);
deviceCtx->End(query.m_begin);
@@ -5361,6 +5405,7 @@ namespace bgfx { namespace d3d11
Result& result = m_result[query.m_resultIdx];
--result.m_pending;
+ result.m_frameNum = query.m_frameNum;
result.m_frequency = disjoint.Frequency;
result.m_begin = timeBegin;
@@ -5547,7 +5592,7 @@ namespace bgfx { namespace d3d11
if (m_timerQuerySupport)
{
- frameQueryIdx = m_gpuTimer.begin(BGFX_CONFIG_MAX_VIEWS);
+ frameQueryIdx = m_gpuTimer.begin(BGFX_CONFIG_MAX_VIEWS, _render->m_frameNum);
}
if (0 < _render->m_iboffset)
@@ -5971,6 +6016,7 @@ namespace bgfx { namespace d3d11
if ( (0
| BGFX_STATE_CULL_MASK
+ | BGFX_STATE_FRONT_CCW
| BGFX_STATE_ALPHA_REF_MASK
| BGFX_STATE_PT_MASK
| BGFX_STATE_POINT_SIZE_MASK
@@ -5981,6 +6027,7 @@ namespace bgfx { namespace d3d11
{
if ( (0
| BGFX_STATE_CULL_MASK
+ | BGFX_STATE_FRONT_CCW
| BGFX_STATE_MSAA
| BGFX_STATE_LINEAA
| BGFX_STATE_CONSERVATIVE_RASTER
@@ -6466,6 +6513,7 @@ namespace bgfx { namespace d3d11
perfStats.numCompute = statsKeyType[1];
perfStats.numBlit = _render->m_numBlitItems;
perfStats.maxGpuLatency = maxGpuLatency;
+ perfStats.gpuFrameNum = result.m_frameNum;
bx::memCopy(perfStats.numPrims, statsNumPrimsRendered, sizeof(perfStats.numPrims) );
m_nvapi.getMemoryInfo(perfStats.gpuMemoryUsed, perfStats.gpuMemoryMax);
diff --git a/3rdparty/bgfx/src/renderer_d3d11.h b/3rdparty/bgfx/src/renderer_d3d11.h
index 0d75dfeb2cb..3fc0849ac87 100644
--- a/3rdparty/bgfx/src/renderer_d3d11.h
+++ b/3rdparty/bgfx/src/renderer_d3d11.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_RENDERER_D3D11_H_HEADER_GUARD
@@ -18,7 +18,10 @@ BX_PRAGMA_DIAGNOSTIC_PUSH();
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunknown-pragmas" );
BX_PRAGMA_DIAGNOSTIC_IGNORED_GCC("-Wpragmas");
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4005) // warning C4005: '' : macro redefinition
+
#include <sal.h>
+#include <unknwn.h>
+
#define D3D11_NO_HELPERS
#if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS
# include <d3d11_3.h>
@@ -371,7 +374,7 @@ namespace bgfx { namespace d3d11
void postReset();
void preReset();
- uint32_t begin(uint32_t _resultIdx);
+ uint32_t begin(uint32_t _resultIdx, uint32_t _frameNum);
void end(uint32_t _idx);
bool update();
@@ -381,6 +384,7 @@ namespace bgfx { namespace d3d11
ID3D11Query* m_begin;
ID3D11Query* m_end;
uint32_t m_resultIdx;
+ uint32_t m_frameNum;
bool m_ready;
};
@@ -392,12 +396,14 @@ namespace bgfx { namespace d3d11
m_end = 0;
m_frequency = 1;
m_pending = 0;
+ m_frameNum = 0;
}
uint64_t m_begin;
uint64_t m_end;
uint64_t m_frequency;
uint32_t m_pending;
+ uint32_t m_frameNum;
};
Result m_result[BGFX_CONFIG_MAX_VIEWS+1];
diff --git a/3rdparty/bgfx/src/renderer_d3d12.cpp b/3rdparty/bgfx/src/renderer_d3d12.cpp
index ebb072f785c..36d23cb5a91 100644
--- a/3rdparty/bgfx/src/renderer_d3d12.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d12.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -182,95 +182,119 @@ namespace bgfx { namespace d3d12
DXGI_FORMAT m_fmtSrv;
DXGI_FORMAT m_fmtDsv;
DXGI_FORMAT m_fmtSrgb;
+ uint32_t m_mapping;
};
static const TextureFormatInfo s_textureFormat[] =
{
- { DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC1_UNORM_SRGB }, // BC1
- { DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC2_UNORM_SRGB }, // BC2
- { DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC3_UNORM_SRGB }, // BC3
- { DXGI_FORMAT_BC4_UNORM, DXGI_FORMAT_BC4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BC4
- { DXGI_FORMAT_BC5_UNORM, DXGI_FORMAT_BC5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BC5
- { DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // BC6H
- { DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC7_UNORM_SRGB }, // BC7
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC1
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC2
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC2A
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ETC2A1
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC12
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC14
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC12A
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC14A
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC22
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // PTC24
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ATC
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ATCE
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // ATCI
- { DXGI_FORMAT_ASTC_4X4_UNORM, DXGI_FORMAT_ASTC_4X4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_4X4_UNORM_SRGB }, // ASTC4x4
- { DXGI_FORMAT_ASTC_5X5_UNORM, DXGI_FORMAT_ASTC_5X5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_5X5_UNORM_SRGB }, // ASTC5x5
- { DXGI_FORMAT_ASTC_6X6_UNORM, DXGI_FORMAT_ASTC_6X6_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_6X6_UNORM_SRGB }, // ASTC6x6
- { DXGI_FORMAT_ASTC_8X5_UNORM, DXGI_FORMAT_ASTC_8X5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_8X5_UNORM_SRGB }, // ASTC8x5
- { DXGI_FORMAT_ASTC_8X6_UNORM, DXGI_FORMAT_ASTC_8X6_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_8X6_UNORM_SRGB }, // ASTC8x6
- { DXGI_FORMAT_ASTC_10X5_UNORM, DXGI_FORMAT_ASTC_10X5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_10X5_UNORM_SRGB }, // ASTC10x5
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // Unknown
- { DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R1
- { DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // A8
- { DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R8
- { DXGI_FORMAT_R8_SINT, DXGI_FORMAT_R8_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R8I
- { DXGI_FORMAT_R8_UINT, DXGI_FORMAT_R8_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R8U
- { DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R8S
- { DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16
- { DXGI_FORMAT_R16_SINT, DXGI_FORMAT_R16_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16I
- { DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16U
- { DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16F
- { DXGI_FORMAT_R16_SNORM, DXGI_FORMAT_R16_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R16S
- { DXGI_FORMAT_R32_SINT, DXGI_FORMAT_R32_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R32I
- { DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R32U
- { DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R32F
- { DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG8
- { DXGI_FORMAT_R8G8_SINT, DXGI_FORMAT_R8G8_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG8I
- { DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG8U
- { DXGI_FORMAT_R8G8_SNORM, DXGI_FORMAT_R8G8_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG8S
- { DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16
- { DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16I
- { DXGI_FORMAT_R16G16_UINT, DXGI_FORMAT_R16G16_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16U
- { DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16F
- { DXGI_FORMAT_R16G16_SNORM, DXGI_FORMAT_R16G16_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG16S
- { DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG32I
- { DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG32U
- { DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG32F
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB8
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB8I
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB8U
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB8S
- { DXGI_FORMAT_R9G9B9E5_SHAREDEXP, DXGI_FORMAT_R9G9B9E5_SHAREDEXP, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB9E5F
- { DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_B8G8R8A8_UNORM_SRGB }, // BGRA8
- { DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB }, // RGBA8
- { DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB }, // RGBA8I
- { DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB }, // RGBA8U
- { DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA8S
- { DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16
- { DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16I
- { DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16U
- { DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16F
- { DXGI_FORMAT_R16G16B16A16_SNORM, DXGI_FORMAT_R16G16B16A16_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA16S
- { DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32I
- { DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32U
- { DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA32F
- { DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // R5G6B5
- { DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGBA4
- { DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB5A1
- { DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RGB10A2
- { DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // RG11B10F
- { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN }, // UnknownDepth
- { DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_D16_UNORM, DXGI_FORMAT_UNKNOWN }, // D16
- { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D24
- { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D24S8
- { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D32
- { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D16F
- { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D24F
- { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN }, // D32F
- { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN }, // D0S8
+#define $0 D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_0
+#define $1 D3D12_SHADER_COMPONENT_MAPPING_FORCE_VALUE_1
+#define $R D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_0
+#define $G D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_1
+#define $B D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_2
+#define $A D3D12_SHADER_COMPONENT_MAPPING_FROM_MEMORY_COMPONENT_3
+ { DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_BC1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC1_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // BC1
+ { DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC2_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // BC2
+ { DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC3_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // BC3
+ { DXGI_FORMAT_BC4_UNORM, DXGI_FORMAT_BC4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // BC4
+ { DXGI_FORMAT_BC5_UNORM, DXGI_FORMAT_BC5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // BC5
+ { DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_BC6H_SF16, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // BC6H
+ { DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_BC7_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_BC7_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // BC7
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ETC1
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ETC2
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ETC2A
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ETC2A1
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // PTC12
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // PTC14
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // PTC12A
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // PTC14A
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // PTC22
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // PTC24
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ATC
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ATCE
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ATCI
+ { DXGI_FORMAT_ASTC_4X4_UNORM, DXGI_FORMAT_ASTC_4X4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_4X4_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC4x4
+ { DXGI_FORMAT_ASTC_5X4_UNORM, DXGI_FORMAT_ASTC_5X4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_5X4_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC5x4
+ { DXGI_FORMAT_ASTC_5X5_UNORM, DXGI_FORMAT_ASTC_5X5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_5X5_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC5x5
+ { DXGI_FORMAT_ASTC_6X5_UNORM, DXGI_FORMAT_ASTC_6X5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_6X5_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC6x5
+ { DXGI_FORMAT_ASTC_6X6_UNORM, DXGI_FORMAT_ASTC_6X6_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_6X6_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC6x6
+ { DXGI_FORMAT_ASTC_8X5_UNORM, DXGI_FORMAT_ASTC_8X5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_8X5_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC8x5
+ { DXGI_FORMAT_ASTC_8X6_UNORM, DXGI_FORMAT_ASTC_8X6_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_8X6_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC8x6
+ { DXGI_FORMAT_ASTC_8X8_UNORM, DXGI_FORMAT_ASTC_8X8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_8X8_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC8x8
+ { DXGI_FORMAT_ASTC_10X5_UNORM, DXGI_FORMAT_ASTC_10X5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_10X5_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC10x5
+ { DXGI_FORMAT_ASTC_10X6_UNORM, DXGI_FORMAT_ASTC_10X6_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_10X6_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC10x6
+ { DXGI_FORMAT_ASTC_10X8_UNORM, DXGI_FORMAT_ASTC_10X8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_10X8_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC10x8
+ { DXGI_FORMAT_ASTC_10X10_UNORM, DXGI_FORMAT_ASTC_10X10_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_10X10_UNORM_SRGB,D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC10x10
+ { DXGI_FORMAT_ASTC_12X10_UNORM, DXGI_FORMAT_ASTC_12X10_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_12X10_UNORM_SRGB,D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC12x10
+ { DXGI_FORMAT_ASTC_12X12_UNORM, DXGI_FORMAT_ASTC_12X12_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_ASTC_12X12_UNORM_SRGB,D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // ASTC12x12
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // Unknown
+ { DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_R1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // R1
+ { DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // A8
+ { DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_R8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // R8
+ { DXGI_FORMAT_R8_SINT, DXGI_FORMAT_R8_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // R8I
+ { DXGI_FORMAT_R8_UINT, DXGI_FORMAT_R8_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // R8U
+ { DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_R8_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // R8S
+ { DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // R16
+ { DXGI_FORMAT_R16_SINT, DXGI_FORMAT_R16_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // R16I
+ { DXGI_FORMAT_R16_UINT, DXGI_FORMAT_R16_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // R16U
+ { DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_R16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // R16F
+ { DXGI_FORMAT_R16_SNORM, DXGI_FORMAT_R16_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // R16S
+ { DXGI_FORMAT_R32_SINT, DXGI_FORMAT_R32_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // R32I
+ { DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // R32U
+ { DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // R32F
+ { DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_R8G8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RG8
+ { DXGI_FORMAT_R8G8_SINT, DXGI_FORMAT_R8G8_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RG8I
+ { DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_R8G8_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RG8U
+ { DXGI_FORMAT_R8G8_SNORM, DXGI_FORMAT_R8G8_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RG8S
+ { DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_R16G16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RG16
+ { DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_R16G16_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RG16I
+ { DXGI_FORMAT_R16G16_UINT, DXGI_FORMAT_R16G16_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RG16U
+ { DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_R16G16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RG16F
+ { DXGI_FORMAT_R16G16_SNORM, DXGI_FORMAT_R16G16_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RG16S
+ { DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RG32I
+ { DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RG32U
+ { DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_R32G32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RG32F
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGB8
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGB8I
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGB8U
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGB8S
+ { DXGI_FORMAT_R9G9B9E5_SHAREDEXP, DXGI_FORMAT_R9G9B9E5_SHAREDEXP, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGB9E5F
+ { DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_B8G8R8A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_B8G8R8A8_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // BGRA8
+ { DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_R8G8B8A8_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGBA8
+ { DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_R8G8B8A8_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGBA8I
+ { DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGBA8U
+ { DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGBA8S
+ { DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_R16G16B16A16_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGBA16
+ { DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_R16G16B16A16_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGBA16I
+ { DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGBA16U
+ { DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGBA16F
+ { DXGI_FORMAT_R16G16B16A16_SNORM, DXGI_FORMAT_R16G16B16A16_SNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGBA16S
+ { DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGBA32I
+ { DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGBA32U
+ { DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGBA32F
+ { DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // B5G6R5
+ { DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_B5G6R5_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING($B, $G, $R, $1) }, // R5G6B5
+ { DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // BGRA4
+ { DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_B4G4R4A4_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING($B, $G, $R, $A) }, // RGBA4
+ { DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // BGR5A1
+ { DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_B5G5R5A1_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_ENCODE_SHADER_4_COMPONENT_MAPPING($B, $G, $R, $A) }, // RGB5A1
+ { DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_R10G10B10A2_UNORM, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RGB10A2
+ { DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_R11G11B10_FLOAT, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // RG11B10F
+ { DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // UnknownDepth
+ { DXGI_FORMAT_R16_TYPELESS, DXGI_FORMAT_R16_UNORM, DXGI_FORMAT_D16_UNORM, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // D16
+ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // D24
+ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // D24S8
+ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // D32
+ { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // D16F
+ { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // D24F
+ { DXGI_FORMAT_R32_TYPELESS, DXGI_FORMAT_R32_FLOAT, DXGI_FORMAT_D32_FLOAT, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // D32F
+ { DXGI_FORMAT_R24G8_TYPELESS, DXGI_FORMAT_R24_UNORM_X8_TYPELESS, DXGI_FORMAT_D24_UNORM_S8_UINT, DXGI_FORMAT_UNKNOWN, D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING }, // D0S8
+#undef $0
+#undef $1
+#undef $R
+#undef $G
+#undef $B
+#undef $A
};
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
@@ -394,11 +418,14 @@ namespace bgfx { namespace d3d12
static const GUID IID_ID3D12Device3 = { 0x81dadc15, 0x2bad, 0x4392, { 0x93, 0xc5, 0x10, 0x13, 0x45, 0xc4, 0xaa, 0x98 } };
static const GUID IID_ID3D12Device4 = { 0xe865df17, 0xa9ee, 0x46f9, { 0xa4, 0x63, 0x30, 0x98, 0x31, 0x5a, 0xa2, 0xe5 } };
static const GUID IID_ID3D12Device5 = { 0x8b4f173b, 0x2fea, 0x4b80, { 0x8f, 0x58, 0x43, 0x07, 0x19, 0x1a, 0xb9, 0x5d } };
+ static const GUID IID_ID3D12Device6 = { 0xc70b221b, 0x40e4, 0x4a17, { 0x89, 0xaf, 0x02, 0x5a, 0x07, 0x27, 0xa6, 0xdc } };
+ static const GUID IID_ID3D12Device7 = { 0x5c014b53, 0x68a1, 0x4b9b, { 0x8b, 0xd1, 0xdd, 0x60, 0x46, 0xb9, 0x35, 0x8b } };
+ static const GUID IID_ID3D12Device8 = { 0x9218e6bb, 0xf944, 0x4f7e, { 0xa7, 0x5c, 0xb1, 0xb2, 0xc7, 0xb7, 0x01, 0xf3 } };
static const GUID IID_ID3D12Fence = { 0x0a753dcf, 0xc4d8, 0x4b91, { 0xad, 0xf6, 0xbe, 0x5a, 0x60, 0xd9, 0x5a, 0x76 } };
static const GUID IID_ID3D12GraphicsCommandList = { 0x5b160d0f, 0xac1b, 0x4185, { 0x8b, 0xa8, 0xb3, 0xae, 0x42, 0xa5, 0xa4, 0x55 } };
static const GUID IID_ID3D12GraphicsCommandList1 = { 0x553103fb, 0x1fe7, 0x4557, { 0xbb, 0x38, 0x94, 0x6d, 0x7d, 0x0e, 0x7c, 0xa7 } };
- static const GUID IID_ID3D12GraphicsCommandList2 = { 0x38C3E585, 0xFF17, 0x412C, { 0x91, 0x50, 0x4F, 0xC6, 0xF9, 0xD7, 0x2A, 0x28 } };
- static const GUID IID_ID3D12GraphicsCommandList3 = { 0x6FDA83A7, 0xB84C, 0x4E38, { 0x9A, 0xC8, 0xC7, 0xBD, 0x22, 0x01, 0x6B, 0x3D } };
+ static const GUID IID_ID3D12GraphicsCommandList2 = { 0x38c3e585, 0xff17, 0x412c, { 0x91, 0x50, 0x4f, 0xc6, 0xf9, 0xd7, 0x2a, 0x28 } };
+ static const GUID IID_ID3D12GraphicsCommandList3 = { 0x6fda83a7, 0xb84c, 0x4e38, { 0x9a, 0xc8, 0xc7, 0xbd, 0x22, 0x01, 0x6b, 0x3d } };
static const GUID IID_ID3D12GraphicsCommandList4 = { 0x8754318e, 0xd3a9, 0x4541, { 0x98, 0xcf, 0x64, 0x5b, 0x50, 0xdc, 0x48, 0x74 } };
static const GUID IID_ID3D12InfoQueue = { 0x0742a90b, 0xc387, 0x483f, { 0xb9, 0x46, 0x30, 0xa7, 0xe4, 0xe6, 0x14, 0x58 } };
static const GUID IID_ID3D12PipelineState = { 0x765a30f3, 0xf624, 0x4c6f, { 0xa8, 0x28, 0xac, 0xe9, 0x48, 0x62, 0x24, 0x45 } };
@@ -410,6 +437,9 @@ namespace bgfx { namespace d3d12
static const GUID s_d3dDeviceIIDs[] =
{
+ IID_ID3D12Device8,
+ IID_ID3D12Device7,
+ IID_ID3D12Device6,
IID_ID3D12Device5,
IID_ID3D12Device4,
IID_ID3D12Device3,
@@ -442,16 +472,15 @@ namespace bgfx { namespace d3d12
};
BX_STATIC_ASSERT(BX_COUNTOF(s_heapProperties) == HeapProperty::Count);
- static inline D3D12_HEAP_PROPERTIES ID3D12DeviceGetCustomHeapProperties(ID3D12Device *device, UINT nodeMask, D3D12_HEAP_TYPE heapType)
+ static inline D3D12_HEAP_PROPERTIES ID3D12DeviceGetCustomHeapProperties(ID3D12Device *device, uint32_t nodeMask, D3D12_HEAP_TYPE heapType)
{
- // NOTICE: gcc trick for return struct
- union {
- D3D12_HEAP_PROPERTIES (STDMETHODCALLTYPE ID3D12Device::*w)(UINT, D3D12_HEAP_TYPE);
- void (STDMETHODCALLTYPE ID3D12Device::*f)(D3D12_HEAP_PROPERTIES *, UINT, D3D12_HEAP_TYPE);
- } conversion = { &ID3D12Device::GetCustomHeapProperties };
+#if BX_COMPILER_MSVC
+ return device->GetCustomHeapProperties(nodeMask, heapType);
+#else
D3D12_HEAP_PROPERTIES ret;
- (device->*conversion.f)(&ret, nodeMask, heapType);
+ device->GetCustomHeapProperties(&ret, nodeMask, heapType);
return ret;
+#endif // BX_COMPILER_MSVC
}
static void initHeapProperties(ID3D12Device* _device, D3D12_HEAP_PROPERTIES& _properties)
@@ -464,11 +493,13 @@ namespace bgfx { namespace d3d12
static void initHeapProperties(ID3D12Device* _device)
{
-#if BX_PLATFORM_WINDOWS
+#if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS
initHeapProperties(_device, s_heapProperties[HeapProperty::Default ].m_properties);
initHeapProperties(_device, s_heapProperties[HeapProperty::Texture ].m_properties);
initHeapProperties(_device, s_heapProperties[HeapProperty::Upload ].m_properties);
initHeapProperties(_device, s_heapProperties[HeapProperty::ReadBack].m_properties);
+#else
+ BX_UNUSED(_device);
#endif // BX_PLATFORM_WINDOWS
}
@@ -493,7 +524,12 @@ namespace bgfx { namespace d3d12
{
void* ptr;
DX_CHECK(resource->Map(0, NULL, &ptr) );
- D3D12_RESOURCE_ALLOCATION_INFO rai = _device->GetResourceAllocationInfo(1, 1, _resourceDesc);
+ D3D12_RESOURCE_ALLOCATION_INFO rai;
+#if BX_COMPILER_MSVC
+ rai = _device->GetResourceAllocationInfo(1, 1, _resourceDesc);
+#else
+ _device->GetResourceAllocationInfo(&rai, 1, 1, _resourceDesc);
+#endif // BX_COMPILER_MSVC
bx::memSet(ptr, 0, size_t(rai.SizeInBytes) );
resource->Unmap(0, NULL);
}
@@ -582,8 +618,10 @@ namespace bgfx { namespace d3d12
static PFN_D3D12_GET_DEBUG_INTERFACE D3D12GetDebugInterface;
static PFN_D3D12_SERIALIZE_ROOT_SIGNATURE D3D12SerializeRootSignature;
+# if !BX_PLATFORM_LINUX
typedef HANDLE (WINAPI* PFN_CREATE_EVENT_EX_A)(LPSECURITY_ATTRIBUTES _attrs, LPCSTR _name, DWORD _flags, DWORD _access);
static PFN_CREATE_EVENT_EX_A CreateEventExA;
+# endif // !BX_PLATFORM_LINUX
#endif // USE_D3D12_DYNAMIC_LIB
inline D3D12_CPU_DESCRIPTOR_HANDLE getCPUHandleHeapStart(ID3D12DescriptorHeap* _heap)
@@ -592,11 +630,7 @@ namespace bgfx { namespace d3d12
return _heap->GetCPUDescriptorHandleForHeapStart();
#else
D3D12_CPU_DESCRIPTOR_HANDLE handle;
- union {
- D3D12_CPU_DESCRIPTOR_HANDLE (WINAPI ID3D12DescriptorHeap::*w)();
- void (WINAPI ID3D12DescriptorHeap::*f)(D3D12_CPU_DESCRIPTOR_HANDLE *);
- } conversion = { &ID3D12DescriptorHeap::GetCPUDescriptorHandleForHeapStart };
- (_heap->*conversion.f)(&handle);
+ _heap->GetCPUDescriptorHandleForHeapStart(&handle);
return handle;
#endif // BX_COMPILER_MSVC
}
@@ -607,11 +641,7 @@ namespace bgfx { namespace d3d12
return _heap->GetGPUDescriptorHandleForHeapStart();
#else
D3D12_GPU_DESCRIPTOR_HANDLE handle;
- union {
- D3D12_GPU_DESCRIPTOR_HANDLE (WINAPI ID3D12DescriptorHeap::*w)();
- void (WINAPI ID3D12DescriptorHeap::*f)(D3D12_GPU_DESCRIPTOR_HANDLE *);
- } conversion = { &ID3D12DescriptorHeap::GetGPUDescriptorHandleForHeapStart };
- (_heap->*conversion.f)(&handle);
+ _heap->GetGPUDescriptorHandleForHeapStart(&handle);
return handle;
#endif // BX_COMPILER_MSVC
}
@@ -622,11 +652,7 @@ namespace bgfx { namespace d3d12
return _resource->GetDesc();
#else
D3D12_RESOURCE_DESC desc;
- union {
- D3D12_RESOURCE_DESC (STDMETHODCALLTYPE ID3D12Resource::*w)();
- void (STDMETHODCALLTYPE ID3D12Resource::*f)(D3D12_RESOURCE_DESC *);
- } conversion = { &ID3D12Resource::GetDesc };
- (_resource->*conversion.f)(&desc);
+ _resource->GetDesc(&desc);
return desc;
#endif // BX_COMPILER_MSVC
}
@@ -716,6 +742,8 @@ namespace bgfx { namespace d3d12
bx::memSet(&m_resolution, 0, sizeof(m_resolution) );
#if USE_D3D12_DYNAMIC_LIB
+
+# if !BX_PLATFORM_LINUX
m_kernel32Dll = bx::dlopen("kernel32.dll");
if (NULL == m_kernel32Dll)
{
@@ -731,14 +759,26 @@ namespace bgfx { namespace d3d12
}
errorState = ErrorState::LoadedKernel32;
+# endif // !BX_PLATFORM_LINUX
m_nvapi.init();
- m_d3d12Dll = bx::dlopen("d3d12.dll");
- if (NULL == m_d3d12Dll)
{
- BX_TRACE("Init error: Failed to load d3d12.dll.");
- goto error;
+ const char* d3d12DllName =
+#if BX_PLATFORM_LINUX
+ "libd3d12.so"
+#else
+ "d3d12.dll"
+#endif // BX_PLATFORM_LINUX
+ ;
+
+ m_d3d12Dll = bx::dlopen(d3d12DllName);
+
+ if (NULL == m_d3d12Dll)
+ {
+ BX_TRACE("Init error: Failed to load %s.", d3d12DllName);
+ goto error;
+ }
}
errorState = ErrorState::LoadedD3D12;
@@ -764,17 +804,19 @@ namespace bgfx { namespace d3d12
}
#endif // USE_D3D12_DYNAMIC_LIB
+#if !BX_PLATFORM_LINUX
if (!m_dxgi.init(g_caps) )
{
goto error;
}
errorState = ErrorState::LoadedDXGI;
+#endif // !BX_PLATFORM_LINUX
HRESULT hr;
{
-#if BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT
+#if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT
if (_init.debug
|| _init.profile)
{
@@ -814,6 +856,7 @@ namespace bgfx { namespace d3d12
D3D_FEATURE_LEVEL featureLevel[] =
{
+ D3D_FEATURE_LEVEL_12_2,
D3D_FEATURE_LEVEL_12_1,
D3D_FEATURE_LEVEL_12_0,
D3D_FEATURE_LEVEL_11_1,
@@ -823,7 +866,12 @@ namespace bgfx { namespace d3d12
hr = E_FAIL;
for (uint32_t ii = 0; ii < BX_COUNTOF(featureLevel) && FAILED(hr); ++ii)
{
- hr = D3D12CreateDevice(m_dxgi.m_adapter
+ hr = D3D12CreateDevice(
+#if BX_PLATFORM_LINUX
+ NULL
+#else
+ m_dxgi.m_adapter
+#endif // BX_PLATFORM_LINUX
, featureLevel[ii]
, IID_ID3D12Device
, (void**)&m_device
@@ -868,14 +916,12 @@ namespace bgfx { namespace d3d12
if (FAILED(hr) )
{
BX_TRACE("Init error: Unable to create Direct3D12 device.");
- if (BX_ENABLED(BX_PLATFORM_WINRT) )
- {
- BX_TRACE("Hint: Change UWP app to game?");
- }
goto error;
}
+#if !BX_PLATFORM_LINUX
m_dxgi.update(m_device);
+#endif // !BX_PLATFORM_LINUX
{
m_deviceInterfaceVersion = 0;
@@ -892,10 +938,12 @@ namespace bgfx { namespace d3d12
}
}
+#if !BX_PLATFORM_LINUX
if (BGFX_PCI_ID_NVIDIA != m_dxgi.m_adapterDesc.VendorId)
{
m_nvapi.shutdown();
}
+#endif // !BX_PLATFORM_LINUX
{
uint32_t numNodes = m_device->GetNodeCount();
@@ -919,7 +967,7 @@ namespace bgfx { namespace d3d12
}
DX_CHECK(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &m_options, sizeof(m_options) ) );
- BX_TRACE("D3D12 options:")
+ BX_TRACE("D3D12 options:");
BX_TRACE("\tTiledResourcesTier %d", m_options.TiledResourcesTier);
BX_TRACE("\tResourceBindingTier %d", m_options.ResourceBindingTier);
BX_TRACE("\tROVsSupported %d", m_options.ROVsSupported);
@@ -927,6 +975,146 @@ namespace bgfx { namespace d3d12
BX_TRACE("\tCrossNodeSharingTier %d", m_options.CrossNodeSharingTier);
BX_TRACE("\tResourceHeapTier %d", m_options.ResourceHeapTier);
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS1 options1; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS1, &options1, sizeof(options1)));)
+ {
+ BX_TRACE("D3D12 options 1:");
+ BX_TRACE("\tWaveOps %d", options1.WaveOps);
+ BX_TRACE("\tWaveLaneCountMin %d", options1.WaveLaneCountMin);
+ BX_TRACE("\tWaveLaneCountMax %d", options1.WaveLaneCountMax);
+ BX_TRACE("\tTotalLaneCount %d", options1.TotalLaneCount);
+ BX_TRACE("\tExpandedComputeResourceStates %d", options1.ExpandedComputeResourceStates);
+ BX_TRACE("\tInt64ShaderOps %d", options1.Int64ShaderOps);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS2 options2; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS2, &options2, sizeof(options2)));)
+ {
+ BX_TRACE("D3D12 options 2:");
+ BX_TRACE("\tCopyQueueTimestampQueriesSupported %d", options2.DepthBoundsTestSupported);
+ BX_TRACE("\tCastingFullyTypedFormatSupported %d", options2.ProgrammableSamplePositionsTier);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS3 options3; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS3, &options3, sizeof(options3)));)
+ {
+ BX_TRACE("D3D12 options 3:");
+ BX_TRACE("\tCopyQueueTimestampQueriesSupported %d", options3.CopyQueueTimestampQueriesSupported);
+ BX_TRACE("\tCastingFullyTypedFormatSupported %d", options3.CastingFullyTypedFormatSupported);
+ BX_TRACE("\tWriteBufferImmediateSupportFlags %d", options3.WriteBufferImmediateSupportFlags);
+ BX_TRACE("\tViewInstancingTier %d", options3.ViewInstancingTier);
+ BX_TRACE("\tBarycentricsSupported %d", options3.BarycentricsSupported);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS4 options4; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS4, &options4, sizeof(options4)));)
+ {
+ BX_TRACE("D3D12 options 4:");
+ BX_TRACE("\tMSAA64KBAlignedTextureSupported %d", options4.MSAA64KBAlignedTextureSupported);
+ BX_TRACE("\tSharedResourceCompatibilityTier %d", options4.SharedResourceCompatibilityTier);
+ BX_TRACE("\tNative16BitShaderOpsSupported %d", options4.Native16BitShaderOpsSupported);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS5 options5; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS5, &options5, sizeof(options5) ) );)
+ {
+ BX_TRACE("D3D12 options 5:");
+ BX_TRACE("\tSRVOnlyTiledResourceTier3 %d", options5.SRVOnlyTiledResourceTier3);
+ BX_TRACE("\tRenderPassesTier %d", options5.RenderPassesTier);
+ BX_TRACE("\tRaytracingTier %d", options5.RaytracingTier);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS6 options6; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS6, &options6, sizeof(options6)));)
+ {
+ BX_TRACE("D3D12 options 6:");
+ BX_TRACE("\tAdditionalShadingRatesSupported %d", options6.AdditionalShadingRatesSupported);
+ BX_TRACE("\tPerPrimitiveShadingRateSupportedWithViewportIndexing %d", options6.PerPrimitiveShadingRateSupportedWithViewportIndexing);
+ BX_TRACE("\tVariableShadingRateTier %d", options6.VariableShadingRateTier);
+ BX_TRACE("\tShadingRateImageTileSize %d", options6.ShadingRateImageTileSize);
+ BX_TRACE("\tBackgroundProcessingSupported %d", options6.BackgroundProcessingSupported);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS7 options7; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS7, &options7, sizeof(options7)));)
+ {
+ BX_TRACE("D3D12 options 7:");
+ BX_TRACE("\tMeshShaderTier %d", options7.MeshShaderTier);
+ BX_TRACE("\tSamplerFeedbackTier %d", options7.SamplerFeedbackTier);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS8 options8; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS8, &options8, sizeof(options8)));)
+ {
+ BX_TRACE("D3D12 options 8:");
+ BX_TRACE("\tUnalignedBlockTexturesSupported %d", options8.UnalignedBlockTexturesSupported);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS9 options9; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS9, &options9, sizeof(options9)));)
+ {
+ BX_TRACE("D3D12 options 9:");
+ BX_TRACE("\tMeshShaderPipelineStatsSupported %d", options9.MeshShaderPipelineStatsSupported);
+ BX_TRACE("\tMeshShaderSupportsFullRangeRenderTargetArrayIndex %d", options9.MeshShaderSupportsFullRangeRenderTargetArrayIndex);
+ BX_TRACE("\tAtomicInt64OnTypedResourceSupported %d", options9.AtomicInt64OnTypedResourceSupported);
+ BX_TRACE("\tAtomicInt64OnGroupSharedSupported %d", options9.AtomicInt64OnGroupSharedSupported);
+ BX_TRACE("\tDerivativesInMeshAndAmplificationShadersSupported %d", options9.DerivativesInMeshAndAmplificationShadersSupported);
+ BX_TRACE("\tWaveMMATier %d", options9.WaveMMATier);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS10 options10; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS10, &options10, sizeof(options10)));)
+ {
+ BX_TRACE("D3D12 options 10:");
+ BX_TRACE("\tVariableRateShadingSumCombinerSupported %d", options10.VariableRateShadingSumCombinerSupported);
+ BX_TRACE("\tMeshShaderPerPrimitiveShadingRateSupported %d", options10.MeshShaderPerPrimitiveShadingRateSupported);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS11 options11; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS11, &options11, sizeof(options11)));)
+ {
+ BX_TRACE("D3D12 options 11:");
+ BX_TRACE("\tAtomicInt64OnDescriptorHeapResourceSupported %d", options11.AtomicInt64OnDescriptorHeapResourceSupported);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS12 options12; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &options12, sizeof(options12)));)
+ {
+ BX_TRACE("D3D12 options 12:");
+ BX_TRACE("\tMSPrimitivesPipelineStatisticIncludesCulledPrimitives %d", options12.MSPrimitivesPipelineStatisticIncludesCulledPrimitives);
+ BX_TRACE("\tEnhancedBarriersSupported %d", options12.EnhancedBarriersSupported);
+ BX_TRACE("\tRelaxedFormatCastingSupported %d", options12.RelaxedFormatCastingSupported);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS13 options13; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &options13, sizeof(options13)));)
+ {
+ BX_TRACE("D3D12 options 13:");
+ BX_TRACE("\tUnrestrictedBufferTextureCopyPitchSupported %d", options13.UnrestrictedBufferTextureCopyPitchSupported);
+ BX_TRACE("\tUnrestrictedVertexElementAlignmentSupported %d", options13.UnrestrictedVertexElementAlignmentSupported);
+ BX_TRACE("\tInvertedViewportHeightFlipsYSupported %d", options13.InvertedViewportHeightFlipsYSupported);
+ BX_TRACE("\tInvertedViewportDepthFlipsZSupported %d", options13.InvertedViewportDepthFlipsZSupported);
+ BX_TRACE("\tTextureCopyBetweenDimensionsSupported %d", options13.TextureCopyBetweenDimensionsSupported);
+ BX_TRACE("\tAlphaBlendFactorSupported %d", options13.AlphaBlendFactorSupported);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS14 options14; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &options14, sizeof(options14)));)
+ {
+ BX_TRACE("D3D12 options 14:");
+ BX_TRACE("\tAdvancedTextureOpsSupported %d", options14.AdvancedTextureOpsSupported);
+ BX_TRACE("\tWriteableMSAATexturesSupported %d", options14.WriteableMSAATexturesSupported);
+ BX_TRACE("\tIndependentFrontAndBackStencilRefMaskSupported %d", options14.IndependentFrontAndBackStencilRefMaskSupported);
+ break;
+ }
+
+ for (D3D12_FEATURE_DATA_D3D12_OPTIONS15 options15; SUCCEEDED(m_device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS12, &options15, sizeof(options15)));)
+ {
+ BX_TRACE("D3D12 options 15:");
+ BX_TRACE("\tTriangleFanSupported %d", options15.TriangleFanSupported);
+ BX_TRACE("\tDynamicIndexBufferStripCutSupported %d", options15.DynamicIndexBufferStripCutSupported);
+ break;
+ }
+
initHeapProperties(m_device);
m_cmd.init(m_device);
@@ -965,12 +1153,15 @@ namespace bgfx { namespace d3d12
if (NULL != m_scd.nwh)
{
+#if BX_PLATFORM_LINUX
+ hr = E_FAIL;
+#else
hr = m_dxgi.createSwapChain(
getDeviceForSwapChain()
, m_scd
, &m_swapChain
);
-
+#endif // BX_PLATFORM_LINUX
if (FAILED(hr) )
{
@@ -1165,6 +1356,7 @@ namespace bgfx { namespace d3d12
| BGFX_CAPS_TEXTURE_CUBE_ARRAY
| BGFX_CAPS_IMAGE_RW
| BGFX_CAPS_VIEWPORT_LAYER_ARRAY
+ | BGFX_CAPS_DRAW_INDIRECT_COUNT
);
g_caps.limits.maxTextureSize = D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION;
g_caps.limits.maxTextureLayers = D3D12_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION;
@@ -1284,7 +1476,7 @@ namespace bgfx { namespace d3d12
struct D3D11_FEATURE_DATA_FORMAT_SUPPORT
{
DXGI_FORMAT InFormat;
- UINT OutFormatSupport;
+ uint32_t OutFormatSupport;
};
D3D12_FEATURE_DATA_FORMAT_SUPPORT data;
@@ -1331,7 +1523,9 @@ namespace bgfx { namespace d3d12
postReset();
m_batch.create(4<<10);
- m_batch.setIndirectMode(BGFX_PCI_ID_NVIDIA != m_dxgi.m_adapterDesc.VendorId);
+#if !BX_PLATFORM_LINUX
+ m_batch.setIndirectMode(BGFX_PCI_ID_NVIDIA != m_dxgi.m_adapterDesc.VendorId && BGFX_PCI_ID_MICROSOFT != m_dxgi.m_adapterDesc.VendorId);
+#endif // !BX_PLATFORM_LINUX
m_gpuTimer.init();
m_occlusionQuery.init();
@@ -1382,7 +1576,9 @@ namespace bgfx { namespace d3d12
case ErrorState::CreatedDXGIFactory:
DX_RELEASE(m_device, 0);
+#if !BX_PLATFORM_LINUX
m_dxgi.shutdown();
+#endif // !BX_PLATFORM_LINUX
BX_FALLTHROUGH;
#if USE_D3D12_DYNAMIC_LIB
@@ -1470,7 +1666,9 @@ namespace bgfx { namespace d3d12
DX_RELEASE(m_device, 0);
m_nvapi.shutdown();
+#if !BX_PLATFORM_LINUX
m_dxgi.shutdown();
+#endif // !BX_PLATFORM_LINUX
unloadRenderDoc(m_renderDocDll);
@@ -1513,10 +1711,12 @@ namespace bgfx { namespace d3d12
{
presentFlags |= DXGI_PRESENT_RESTART;
}
+#if !BX_PLATFORM_LINUX
else if (m_dxgi.tearingSupported() )
{
presentFlags |= DXGI_PRESENT_ALLOW_TEARING;
}
+#endif // !BX_PLATFORM_LINUX
for (uint32_t ii = 1, num = m_numWindows; ii < num && SUCCEEDED(hr); ++ii)
{
@@ -1718,7 +1918,7 @@ namespace bgfx { namespace d3d12
bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
- bx::write(&writer, magic);
+ bx::write(&writer, magic, bx::ErrorAssert{});
TextureCreate tc;
tc.m_width = _width;
@@ -1729,7 +1929,7 @@ namespace bgfx { namespace d3d12
tc.m_format = TextureFormat::Enum(texture.m_requestedFormat);
tc.m_cubeMap = false;
tc.m_mem = NULL;
- bx::write(&writer, tc);
+ bx::write(&writer, tc, bx::ErrorAssert{});
texture.destroy();
texture.create(mem, texture.m_flags, 0);
@@ -2311,11 +2511,15 @@ namespace bgfx { namespace d3d12
DX_RELEASE(m_swapChain, 0);
HRESULT hr;
+#if BX_PLATFORM_LINUX
+ hr = E_FAIL;
+#else
hr = m_dxgi.createSwapChain(
getDeviceForSwapChain()
, m_scd
, &m_swapChain
);
+#endif // BX_PLATFORM_LINUX
BGFX_FATAL(SUCCEEDED(hr), bgfx::Fatal::UnableToInitialize, "Failed to create swap chain.");
}
@@ -2716,7 +2920,7 @@ namespace bgfx { namespace d3d12
}
bx::memCopy(curr, &inst, sizeof(D3D12_INPUT_ELEMENT_DESC) );
- curr->InputSlot = 1;
+ curr->InputSlot = _numStreams;
curr->SemanticIndex = index;
curr->AlignedByteOffset = ii*16;
}
@@ -3344,7 +3548,10 @@ namespace bgfx { namespace d3d12
m_commandList = _alloc ? m_cmd.alloc() : NULL;
}
+#if !BX_PLATFORM_LINUX
Dxgi m_dxgi;
+#endif // !BX_PLATFORM_LINUX
+
NvApi m_nvapi;
void* m_kernel32Dll;
@@ -3827,7 +4034,11 @@ namespace bgfx { namespace d3d12
ID3D12CommandList* commandLists[] = { commandList.m_commandList };
m_commandQueue->ExecuteCommandLists(BX_COUNTOF(commandLists), commandLists);
+#if BX_PLATFORM_LINUX
+ commandList.m_event = NULL;
+#else
commandList.m_event = CreateEventExA(NULL, NULL, 0, EVENT_ALL_ACCESS);
+#endif // BX_PLATFORM_LINUX
const uint64_t fence = m_currentFence++;
m_commandQueue->Signal(m_fence, fence);
m_fence->SetEventOnCompletion(fence, commandList.m_event);
@@ -3875,6 +4086,9 @@ namespace bgfx { namespace d3d12
bool CommandQueueD3D12::consume(uint32_t _ms)
{
CommandList& commandList = m_commandList[m_control.m_read];
+#if BX_PLATFORM_LINUX
+ BX_UNUSED(commandList, _ms);
+#else
if (WAIT_OBJECT_0 == WaitForSingleObject(commandList.m_event, _ms) )
{
CloseHandle(commandList.m_event);
@@ -3895,6 +4109,7 @@ namespace bgfx { namespace d3d12
return true;
}
+#endif // !BX_PLATFORM_LINUX
return false;
}
@@ -4071,6 +4286,13 @@ namespace bgfx { namespace d3d12
? indirect.m_size/BGFX_CONFIG_DRAW_INDIRECT_STRIDE
: _draw.m_numIndirect
;
+ ID3D12Resource* numIndirect = NULL;
+ uint32_t numOffsetIndirect = 0;
+ if (isValid(_draw.m_numIndirectBuffer) )
+ {
+ numIndirect = s_renderD3D12->m_indexBuffers[_draw.m_numIndirectBuffer.idx].m_ptr;
+ numOffsetIndirect = _draw.m_numIndirectIndex * sizeof(uint32_t);
+ }
uint32_t numIndices = 0;
@@ -4102,8 +4324,8 @@ namespace bgfx { namespace d3d12
, numDrawIndirect
, indirect.m_ptr
, _draw.m_startIndirect * BGFX_CONFIG_DRAW_INDIRECT_STRIDE
- , NULL
- , 0
+ , numIndirect
+ , numOffsetIndirect
);
}
else
@@ -4113,8 +4335,8 @@ namespace bgfx { namespace d3d12
, numDrawIndirect
, indirect.m_ptr
, _draw.m_startIndirect * BGFX_CONFIG_DRAW_INDIRECT_STRIDE
- , NULL
- , 0
+ , numIndirect
+ , numOffsetIndirect
);
}
@@ -4378,8 +4600,8 @@ namespace bgfx { namespace d3d12
#if BX_PLATFORM_XBOXONE
flags |= D3D12XBOX_RESOURCE_FLAG_ALLOW_INDIRECT_BUFFER;
#endif // BX_PLATFORM_XBOXONE
- format = DXGI_FORMAT_R32G32B32A32_UINT;
- stride = 16;
+ format = _vertex ? DXGI_FORMAT_R32G32B32A32_UINT : DXGI_FORMAT_R32_UINT;
+ stride = _vertex ? 16 : 4;
}
else
{
@@ -4501,13 +4723,15 @@ namespace bgfx { namespace d3d12
{
bx::MemoryReader reader(_mem->data, _mem->size);
+ bx::ErrorAssert err;
+
uint32_t magic;
- bx::read(&reader, magic);
+ bx::read(&reader, magic, &err);
const bool fragment = isShaderType(magic, 'F');
uint32_t hashIn;
- bx::read(&reader, hashIn);
+ bx::read(&reader, hashIn, &err);
uint32_t hashOut;
@@ -4517,11 +4741,11 @@ namespace bgfx { namespace d3d12
}
else
{
- bx::read(&reader, hashOut);
+ bx::read(&reader, hashOut, &err);
}
uint16_t count;
- bx::read(&reader, count);
+ bx::read(&reader, count, &err);
m_numPredefined = 0;
m_numUniforms = count;
@@ -4538,34 +4762,34 @@ namespace bgfx { namespace d3d12
for (uint32_t ii = 0; ii < count; ++ii)
{
uint8_t nameSize = 0;
- bx::read(&reader, nameSize);
+ bx::read(&reader, nameSize, &err);
char name[256] = {};
- bx::read(&reader, &name, nameSize);
+ bx::read(&reader, &name, nameSize, &err);
name[nameSize] = '\0';
uint8_t type = 0;
- bx::read(&reader, type);
+ bx::read(&reader, type, &err);
uint8_t num = 0;
- bx::read(&reader, num);
+ bx::read(&reader, num, &err);
uint16_t regIndex = 0;
- bx::read(&reader, regIndex);
+ bx::read(&reader, regIndex, &err);
uint16_t regCount = 0;
- bx::read(&reader, regCount);
+ bx::read(&reader, regCount, &err);
if (!isShaderVerLess(magic, 8) )
{
uint16_t texInfo = 0;
- bx::read(&reader, texInfo);
+ bx::read(&reader, texInfo, &err);
}
if (!isShaderVerLess(magic, 10) )
{
uint16_t texFormat = 0;
- bx::read(&reader, texFormat);
+ bx::read(&reader, texFormat, &err);
}
const char* kind = "invalid";
@@ -4618,7 +4842,7 @@ namespace bgfx { namespace d3d12
}
uint32_t shaderSize;
- bx::read(&reader, shaderSize);
+ bx::read(&reader, shaderSize, &err);
const void* code = reader.getDataPtr();
bx::skip(&reader, shaderSize+1);
@@ -4626,14 +4850,14 @@ namespace bgfx { namespace d3d12
m_code = copy(code, shaderSize);
uint8_t numAttrs = 0;
- bx::read(&reader, numAttrs);
+ bx::read(&reader, numAttrs, &err);
bx::memSet(m_attrMask, 0, sizeof(m_attrMask) );
for (uint32_t ii = 0; ii < numAttrs; ++ii)
{
uint16_t id;
- bx::read(&reader, id);
+ bx::read(&reader, id, &err);
Attrib::Enum attr = idToAttrib(id);
@@ -4652,7 +4876,145 @@ namespace bgfx { namespace d3d12
murmur.add(m_attrMask, numAttrs);
m_hash = murmur.end();
- bx::read(&reader, m_size);
+ bx::read(&reader, m_size, &err);
+ }
+
+ static void memcpySubresource(
+ const D3D12_MEMCPY_DEST* _dst
+ , const D3D12_SUBRESOURCE_DATA* _src
+ , uint64_t _rowSizeInBytes
+ , uint32_t _numRows
+ , uint32_t _numSlices
+ )
+ {
+ for (uint32_t zz = 0; zz < _numSlices; ++zz)
+ {
+ uint8_t* _dstSlice = ( uint8_t*)(_dst->pData) + _dst->SlicePitch * zz;
+ const uint8_t* _srcSlice = (const uint8_t*)(_src->pData) + _src->SlicePitch * zz;
+ for (uint32_t yy = 0; yy < _numRows; ++yy)
+ {
+ bx::memCopy(
+ _dstSlice + _dst->RowPitch * yy
+ , _srcSlice + _src->RowPitch * yy
+ , size_t(_rowSizeInBytes)
+ );
+ }
+ }
+ }
+
+ static uint64_t updateSubresources(
+ ID3D12GraphicsCommandList* _commandList
+ , ID3D12Resource* _dstResource
+ , ID3D12Resource* _intermediate
+ , uint32_t _firstSubresource
+ , uint32_t _numSubresources
+ , uint64_t _requiredSize
+ , const D3D12_PLACED_SUBRESOURCE_FOOTPRINT* _layouts
+ , const uint32_t* _numRows
+ , const uint64_t* _rowSizesInBytes
+ , const D3D12_SUBRESOURCE_DATA* _srcData
+ )
+ {
+ uint8_t* data;
+ DX_CHECK(_intermediate->Map(0, NULL, (void**)&data) );
+
+ for (uint32_t ii = 0; ii < _numSubresources; ++ii)
+ {
+ D3D12_MEMCPY_DEST dstData =
+ {
+ data + _layouts[ii].Offset,
+ _layouts[ii].Footprint.RowPitch,
+ _layouts[ii].Footprint.RowPitch * _numRows[ii],
+ };
+
+ memcpySubresource(
+ &dstData
+ , &_srcData[ii]
+ , _rowSizesInBytes[ii]
+ , _numRows[ii]
+ , _layouts[ii].Footprint.Depth
+ );
+ }
+
+ _intermediate->Unmap(0, NULL);
+
+ D3D12_RESOURCE_DESC dstDesc = getResourceDesc(_dstResource);
+ if (dstDesc.Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
+ {
+ _commandList->CopyBufferRegion(
+ _dstResource
+ , 0
+ , _intermediate
+ , _layouts[0].Offset
+ , _layouts[0].Footprint.Width
+ );
+ }
+ else
+ {
+ for (uint32_t i = 0; i < _numSubresources; ++i)
+ {
+ D3D12_TEXTURE_COPY_LOCATION src;
+ src.pResource = _intermediate;
+ src.Type = D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT;
+ src.PlacedFootprint = _layouts[i];
+
+ D3D12_TEXTURE_COPY_LOCATION dst;
+ dst.pResource = _dstResource;
+ dst.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
+ dst.SubresourceIndex = i + _firstSubresource;
+
+ _commandList->CopyTextureRegion(&dst, 0, 0, 0, &src, NULL);
+ }
+ }
+
+ return _requiredSize;
+ }
+
+ static uint64_t updateSubresources(
+ ID3D12GraphicsCommandList* _commandList
+ , ID3D12Resource* _dstResource
+ , ID3D12Resource* _intermediate
+ , uint64_t _intermediateOffset
+ , uint32_t _firstSubresource
+ , uint32_t _numSubresources
+ , D3D12_SUBRESOURCE_DATA* _srcData
+ )
+ {
+ 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);
+ uint64_t* rowSizesInBytes = (uint64_t*)(layouts + _numSubresources);
+ uint32_t* numRows = (uint32_t*)(rowSizesInBytes + _numSubresources);
+
+ D3D12_RESOURCE_DESC desc = getResourceDesc(_dstResource);
+ s_renderD3D12->m_device->GetCopyableFootprints(
+ &desc
+ , _firstSubresource
+ , _numSubresources
+ , _intermediateOffset
+ , layouts
+ , numRows
+ , rowSizesInBytes
+ , &requiredSize
+ );
+
+ const uint64_t result = updateSubresources(
+ _commandList
+ , _dstResource
+ , _intermediate
+ , _firstSubresource
+ , _numSubresources
+ , requiredSize
+ , layouts
+ , numRows
+ , rowSizesInBytes
+ , _srcData
+ );
+
+ BX_FREE(g_allocator, layouts);
+
+ return result;
}
void* TextureD3D12::create(const Memory* _mem, uint64_t _flags, uint8_t _skip)
@@ -4808,11 +5170,12 @@ namespace bgfx { namespace d3d12
}
}
+ const TextureFormatInfo& tfi = s_textureFormat[m_textureFormat];
bx::memSet(&m_srvd, 0, sizeof(m_srvd) );
- m_srvd.Shader4ComponentMapping = D3D12_DEFAULT_SHADER_4_COMPONENT_MAPPING;
- m_srvd.Format = (m_flags & BGFX_TEXTURE_SRGB) ? s_textureFormat[m_textureFormat].m_fmtSrgb : s_textureFormat[m_textureFormat].m_fmtSrv;
- m_uavd.Format = s_textureFormat[m_textureFormat].m_fmtSrv;
- DXGI_FORMAT format = s_textureFormat[m_textureFormat].m_fmt;
+ m_srvd.Shader4ComponentMapping = tfi.m_mapping;
+ m_srvd.Format = (m_flags & BGFX_TEXTURE_SRGB) ? tfi.m_fmtSrgb : tfi.m_fmtSrv;
+ m_uavd.Format = tfi.m_fmtSrv;
+ DXGI_FORMAT format = tfi.m_fmt;
if (swizzle)
{
format = DXGI_FORMAT_R8G8B8A8_UNORM;
@@ -4838,13 +5201,13 @@ namespace bgfx { namespace d3d12
D3D12_CLEAR_VALUE* clearValue = NULL;
if (bimg::isDepth(bimg::TextureFormat::Enum(m_textureFormat) ) )
{
- resourceDesc.Format = s_textureFormat[m_textureFormat].m_fmt;
+ resourceDesc.Format = tfi.m_fmt;
resourceDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL;
state |= D3D12_RESOURCE_STATE_DEPTH_WRITE;
state &= ~D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE;
clearValue = (D3D12_CLEAR_VALUE*)alloca(sizeof(D3D12_CLEAR_VALUE) );
- clearValue->Format = s_textureFormat[m_textureFormat].m_fmtDsv;
+ clearValue->Format = tfi.m_fmtDsv;
clearValue->DepthStencil.Depth = 1.0f;
clearValue->DepthStencil.Stencil = 0;
}
@@ -4998,7 +5361,7 @@ namespace bgfx { namespace d3d12
setState(commandList, D3D12_RESOURCE_STATE_COPY_DEST);
- uint64_t result = UpdateSubresources(commandList
+ uint64_t result = updateSubresources(commandList
, m_ptr
, staging
, 0
@@ -5103,6 +5466,23 @@ namespace bgfx { namespace d3d12
const bool convert = m_textureFormat != m_requestedFormat;
+ D3D12_BOX box;
+ box.left = 0;
+ box.top = 0;
+ box.right = box.left + _rect.m_width;
+ box.bottom = box.top + _rect.m_height;
+
+ if (TextureD3D12::Texture3D == m_type)
+ {
+ box.front = _z;
+ box.back = box.front + _depth;
+ }
+ else
+ {
+ box.front = 0;
+ box.back = 1;
+ }
+
uint8_t* srcData = _mem->data;
uint8_t* temp = NULL;
@@ -5111,8 +5491,10 @@ namespace bgfx { namespace d3d12
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;
- }
+ box.right = bx::max(1u, m_width >> _mip);
+ box.bottom = bx::max(1u, m_height >> _mip);
+ }
D3D12_RESOURCE_DESC desc = getResourceDesc(m_ptr);
@@ -5153,14 +5535,6 @@ namespace bgfx { namespace d3d12
D3D12_RANGE writeRange = { 0, numRows*rowPitch };
staging->Unmap(0, &writeRange);
- D3D12_BOX box;
- box.left = 0;
- box.top = 0;
- box.right = box.left + _rect.m_width;
- box.bottom = box.top + _rect.m_height;
- box.front = _z;
- box.back = _z+_depth;
-
D3D12_TEXTURE_COPY_LOCATION dst = { m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, { } };
dst.SubresourceIndex = subres;
D3D12_TEXTURE_COPY_LOCATION src = { staging, D3D12_TEXTURE_COPY_TYPE_PLACED_FOOTPRINT, { layout } };
@@ -5188,7 +5562,7 @@ namespace bgfx { namespace d3d12
for (uint32_t ii = _layer; ii < _numLayers; ++ii)
{
- const UINT resource = _mip + (ii * m_numMips);
+ const uint32_t resource = _mip + (ii * m_numMips);
_commandList->ResolveSubresource(m_singleMsaa
, resource
@@ -5235,7 +5609,7 @@ namespace bgfx { namespace d3d12
void FrameBufferD3D12::create(uint16_t _denseIdx, void* _nwh, uint32_t _width, uint32_t _height, TextureFormat::Enum _format, TextureFormat::Enum _depthFormat)
{
- BX_UNUSED(_nwh, _width, _height, _depthFormat);
+ BX_UNUSED(_nwh, _width, _height, _format, _depthFormat);
#if BX_PLATFORM_WINDOWS
SwapChainDesc scd;
@@ -5659,7 +6033,7 @@ namespace bgfx { namespace d3d12
DX_RELEASE(m_readback, 0);
}
- uint32_t TimerQueryD3D12::begin(uint32_t _resultIdx)
+ uint32_t TimerQueryD3D12::begin(uint32_t _resultIdx, uint32_t _frameNum)
{
while (0 == m_control.reserve(1) )
{
@@ -5673,6 +6047,7 @@ namespace bgfx { namespace d3d12
Query& query = m_query[idx];
query.m_resultIdx = _resultIdx;
query.m_ready = false;
+ query.m_frameNum = _frameNum;
ID3D12GraphicsCommandList* commandList = s_renderD3D12->m_commandList;
@@ -5734,6 +6109,7 @@ namespace bgfx { namespace d3d12
Result& result = m_result[query.m_resultIdx];
--result.m_pending;
+ result.m_frameNum = query.m_frameNum;
uint32_t offset = idx * 2;
result.m_begin = m_queryResult[offset+0];
@@ -5840,7 +6216,7 @@ namespace bgfx { namespace d3d12
{
const BlitItem& blit = _bs.advance();
- TextureD3D12& src = m_textures[blit.m_src.idx];
+ TextureD3D12& src = m_textures[blit.m_src.idx];
const TextureD3D12& dst = m_textures[blit.m_dst.idx];
if (currentSrc.idx != blit.m_src.idx)
@@ -5850,14 +6226,16 @@ namespace bgfx { namespace d3d12
m_textures[currentSrc.idx].setState(m_commandList, state);
}
- currentSrc = blit.m_src;
+ currentSrc = blit.m_src.to<TextureHandle>();
if (NULL != src.m_singleMsaa)
+ {
setResourceBarrier(m_commandList
, src.m_singleMsaa
, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE
, D3D12_RESOURCE_STATE_COPY_SOURCE
);
+ }
state = src.setState(m_commandList, D3D12_RESOURCE_STATE_COPY_SOURCE);
}
@@ -5865,17 +6243,23 @@ namespace bgfx { namespace d3d12
if (TextureD3D12::Texture3D == src.m_type)
{
D3D12_BOX box;
- box.left = blit.m_srcX;
- box.top = blit.m_srcY;
- box.front = blit.m_srcZ;
- box.right = blit.m_srcX + blit.m_width;
- box.bottom = blit.m_srcY + blit.m_height;
- box.back = blit.m_srcZ + bx::uint32_imax(1, blit.m_depth);
-
- D3D12_TEXTURE_COPY_LOCATION dstLocation = { dst.m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, { } };
+ box.left = blit.m_srcX;
+ box.top = blit.m_srcY;
+ box.front = blit.m_srcZ;
+ box.right = blit.m_srcX + blit.m_width;
+ box.bottom = blit.m_srcY + blit.m_height;
+ box.back = blit.m_srcZ + bx::uint32_imax(1, blit.m_depth);
+
+ D3D12_TEXTURE_COPY_LOCATION dstLocation;
+ dstLocation.pResource = dst.m_ptr;
+ dstLocation.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
dstLocation.SubresourceIndex = blit.m_dstMip;
- D3D12_TEXTURE_COPY_LOCATION srcLocation = { src.m_ptr, D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX, { } };
+
+ D3D12_TEXTURE_COPY_LOCATION srcLocation;
+ srcLocation.pResource = src.m_ptr;
+ srcLocation.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
srcLocation.SubresourceIndex = blit.m_srcMip;
+
m_commandList->CopyTextureRegion(&dstLocation
, blit.m_dstX
, blit.m_dstY
@@ -5907,13 +6291,16 @@ namespace bgfx { namespace d3d12
dstLocation.pResource = dst.m_ptr;
dstLocation.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
dstLocation.SubresourceIndex = dstZ*dst.m_numMips+blit.m_dstMip;
+
D3D12_TEXTURE_COPY_LOCATION srcLocation;
srcLocation.pResource = NULL != src.m_singleMsaa ? src.m_singleMsaa : src.m_ptr;
srcLocation.Type = D3D12_TEXTURE_COPY_TYPE_SUBRESOURCE_INDEX;
srcLocation.SubresourceIndex = srcZ*src.m_numMips+blit.m_srcMip;
- bool depthStencil = bimg::isDepth(bimg::TextureFormat::Enum(src.m_textureFormat) );
- m_commandList->CopyTextureRegion(&dstLocation
+ const bool depthStencil = bimg::isDepth(bimg::TextureFormat::Enum(src.m_textureFormat) );
+
+ m_commandList->CopyTextureRegion(
+ &dstLocation
, blit.m_dstX
, blit.m_dstY
, 0
@@ -5923,11 +6310,14 @@ namespace bgfx { namespace d3d12
}
if (NULL != src.m_singleMsaa)
- setResourceBarrier(m_commandList
+ {
+ setResourceBarrier(
+ m_commandList
, src.m_singleMsaa
, D3D12_RESOURCE_STATE_COPY_SOURCE
, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE
- );
+ );
+ }
}
if (isValid(currentSrc)
@@ -5955,7 +6345,7 @@ namespace bgfx { namespace d3d12
int64_t timeBegin = bx::getHPCounter();
int64_t captureElapsed = 0;
- uint32_t frameQueryIdx = m_gpuTimer.begin(BGFX_CONFIG_MAX_VIEWS);
+ uint32_t frameQueryIdx = m_gpuTimer.begin(BGFX_CONFIG_MAX_VIEWS, _render->m_frameNum);
if (0 < _render->m_iboffset)
{
@@ -6397,63 +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;
-
- 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)
+ if (0 != draw.m_streamMask)
{
- wasCompute = false;
-
- currentState.clear();
- currentState.m_scissor = !draw.m_scissor;
- changedFlags = BGFX_STATE_MASK;
- changedStencil = packStencil(BGFX_STENCIL_MASK, BGFX_STENCIL_MASK);
+ const uint64_t newFlags = draw.m_stateFlags;
+ uint64_t changedFlags = currentState.m_stateFlags ^ draw.m_stateFlags;
currentState.m_stateFlags = newFlags;
- currentState.m_stencil = newStencil;
- currentBind.clear();
+ if (0 != (BGFX_STATE_PT_MASK & changedFlags) )
+ {
+ primIndex = uint8_t( (newFlags&BGFX_STATE_PT_MASK)>>BGFX_STATE_PT_SHIFT);
+ }
- commandListChanged = true;
- }
+ 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 (commandListChanged)
- {
- commandListChanged = false;
+ 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);
+ 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;
+ 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();
+ currentBind.clear();
- const uint64_t pt = newFlags&BGFX_STATE_PT_MASK;
- primIndex = uint8_t(pt>>BGFX_STATE_PT_SHIFT);
- }
+ 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);
+ 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)
- {
currentState.m_streamMask = draw.m_streamMask;
currentState.m_instanceDataBuffer.idx = draw.m_instanceDataBuffer.idx;
currentState.m_instanceDataOffset = draw.m_instanceDataOffset;
@@ -6496,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<bx::HashMurmur2A>(renderBind.m_bind, sizeof(renderBind.m_bind) );
- uint16_t scissor = draw.m_scissor;
- uint32_t bindHash = bx::hash<bx::HashMurmur2A>(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)
{
@@ -6658,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;
@@ -6829,6 +7211,7 @@ namespace bgfx { namespace d3d12
perfStats.numCompute = statsKeyType[1];
perfStats.numBlit = _render->m_numBlitItems;
perfStats.maxGpuLatency = maxGpuLatency;
+ perfStats.gpuFrameNum = result.m_frameNum;
bx::memCopy(perfStats.numPrims, statsNumPrimsRendered, sizeof(perfStats.numPrims) );
perfStats.gpuMemoryMax = -INT64_MAX;
perfStats.gpuMemoryUsed = -INT64_MAX;
@@ -6874,7 +7257,11 @@ namespace bgfx { namespace d3d12
, BGFX_REV_NUMBER
);
+#if BX_PLATFORM_LINUX
+ const DXGI_ADAPTER_DESC desc = {};
+#else
const DXGI_ADAPTER_DESC& desc = m_dxgi.m_adapterDesc;
+#endif // BX_PLATFORM_LINUX
char description[BX_COUNTOF(desc.Description)];
wcstombs(description, desc.Description, BX_COUNTOF(desc.Description) );
tvm.printf(0, pos++, 0x8f, " Device: %s", description);
diff --git a/3rdparty/bgfx/src/renderer_d3d12.h b/3rdparty/bgfx/src/renderer_d3d12.h
index b9f92c91325..f578f1a385b 100644
--- a/3rdparty/bgfx/src/renderer_d3d12.h
+++ b/3rdparty/bgfx/src/renderer_d3d12.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_RENDERER_D3D12_H_HEADER_GUARD
@@ -9,7 +9,9 @@
#define USE_D3D12_DYNAMIC_LIB (BX_PLATFORM_WINDOWS || BX_PLATFORM_LINUX)
#include <sal.h>
-#if BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT || BX_PLATFORM_LINUX
+#include <unknwn.h>
+
+#if BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT
# include <d3d12.h>
#else
# if !BGFX_CONFIG_DEBUG
@@ -38,19 +40,6 @@ extern "C++" {
}
#endif // defined(__MINGW32__)
-BX_PRAGMA_DIAGNOSTIC_PUSH();
-BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wmissing-field-initializers");
-#if BX_PLATFORM_XBOXONE
-# include <d3dx12_x.h>
-#else
-# include <d3dx12.h>
-#endif // BX_PLATFORM_XBOXONE
-BX_PRAGMA_DIAGNOSTIC_POP();
-
-#ifndef D3D12_TEXTURE_DATA_PITCH_ALIGNMENT
-# define D3D12_TEXTURE_DATA_PITCH_ALIGNMENT 1024
-#endif // D3D12_TEXTURE_DATA_PITCH_ALIGNMENT
-
#include "renderer.h"
#include "renderer_d3d.h"
#include "shader_dxbc.h"
@@ -58,7 +47,7 @@ BX_PRAGMA_DIAGNOSTIC_POP();
#include "nvapi.h"
#include "dxgi.h"
-#if BGFX_CONFIG_DEBUG_ANNOTATION
+#if BGFX_CONFIG_DEBUG_ANNOTATION && !BX_PLATFORM_LINUX
# if BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT
typedef struct PIXEventsThreadInfo* (WINAPI* PFN_PIX_GET_THREAD_INFO)();
typedef uint64_t (WINAPI* PFN_PIX_EVENTS_REPLACE_BLOCK)(bool _getEarliestTime);
@@ -418,7 +407,7 @@ namespace bgfx { namespace d3d12
void finish(uint64_t _waitFence = UINT64_MAX, bool _finishAll = false);
bool tryFinish(uint64_t _waitFence);
void release(ID3D12Resource* _ptr);
- bool consume(uint32_t _ms = INFINITE);
+ bool consume(uint32_t _ms = UINT32_MAX);
struct CommandList
{
@@ -528,29 +517,32 @@ namespace bgfx { namespace d3d12
void init();
void shutdown();
- uint32_t begin(uint32_t _resultIdx);
+ uint32_t begin(uint32_t _resultIdx, uint32_t _frameNum);
void end(uint32_t _idx);
bool update();
struct Query
{
uint32_t m_resultIdx;
- bool m_ready;
+ uint32_t m_frameNum;
uint64_t m_fence;
+ bool m_ready;
};
struct Result
{
void reset()
{
- m_begin = 0;
- m_end = 0;
- m_pending = 0;
+ m_begin = 0;
+ m_end = 0;
+ m_pending = 0;
+ m_frameNum = 0;
}
uint64_t m_begin;
uint64_t m_end;
uint32_t m_pending;
+ uint32_t m_frameNum;
};
uint64_t m_frequency;
diff --git a/3rdparty/bgfx/src/renderer_d3d9.cpp b/3rdparty/bgfx/src/renderer_d3d9.cpp
index 588b7d8dda3..ff1a2cf0aec 100644
--- a/3rdparty/bgfx/src/renderer_d3d9.cpp
+++ b/3rdparty/bgfx/src/renderer_d3d9.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -183,12 +183,20 @@ namespace bgfx { namespace d3d9
{ D3DFMT_UNKNOWN }, // ATC,
{ D3DFMT_UNKNOWN }, // ATCE,
{ D3DFMT_UNKNOWN }, // ATCI,
- { D3DFMT_UNKNOWN }, // ASTC4x4,
- { D3DFMT_UNKNOWN }, // ASTC5x5,
- { D3DFMT_UNKNOWN }, // ASTC6x6,
- { D3DFMT_UNKNOWN }, // ASTC8x5,
- { D3DFMT_UNKNOWN }, // ASTC8x6,
- { D3DFMT_UNKNOWN }, // ASTC10x5,
+ { D3DFMT_UNKNOWN }, // ASTC4x4
+ { D3DFMT_UNKNOWN }, // ASTC5x4
+ { D3DFMT_UNKNOWN }, // ASTC5x5
+ { D3DFMT_UNKNOWN }, // ASTC6x5
+ { D3DFMT_UNKNOWN }, // ASTC6x6
+ { D3DFMT_UNKNOWN }, // ASTC8x5
+ { D3DFMT_UNKNOWN }, // ASTC8x6
+ { D3DFMT_UNKNOWN }, // ASTC8x8
+ { D3DFMT_UNKNOWN }, // ASTC10x5
+ { D3DFMT_UNKNOWN }, // ASTC10x6
+ { D3DFMT_UNKNOWN }, // ASTC10x8
+ { D3DFMT_UNKNOWN }, // ASTC10x10
+ { D3DFMT_UNKNOWN }, // ASTC12x10
+ { D3DFMT_UNKNOWN }, // ASTC12x12
{ D3DFMT_UNKNOWN }, // Unknown
{ D3DFMT_A1 }, // R1
{ D3DFMT_A8 }, // A8
@@ -234,8 +242,11 @@ namespace bgfx { namespace d3d9
{ D3DFMT_UNKNOWN }, // RGBA32I
{ D3DFMT_UNKNOWN }, // RGBA32U
{ D3DFMT_A32B32G32R32F }, // RGBA32F
+ { D3DFMT_R5G6B5 }, // B5G6R5
{ D3DFMT_R5G6B5 }, // R5G6B5
+ { D3DFMT_A4R4G4B4 }, // BGRA4
{ D3DFMT_A4R4G4B4 }, // RGBA4
+ { D3DFMT_A1R5G5B5 }, // BGR5A1
{ D3DFMT_A1R5G5B5 }, // RGB5A1
{ D3DFMT_A2B10G10R10 }, // RGB10A2
{ D3DFMT_UNKNOWN }, // RG11B10F
@@ -452,32 +463,37 @@ namespace bgfx { namespace d3d9
// Reference(s):
// - https://web.archive.org/web/20190207230309/https://docs.microsoft.com/en-us/windows/desktop/direct3d9/d3dpresent-parameters
bx::memSet(&m_params, 0, sizeof(m_params) );
- m_params.BackBufferWidth = _init.resolution.width;
- m_params.BackBufferHeight = _init.resolution.height;
- m_params.BackBufferFormat = adapterFormat;
- m_params.BackBufferCount = bx::clamp<uint8_t>(_init.resolution.numBackBuffers, 2, BGFX_CONFIG_MAX_BACK_BUFFERS);
- m_params.MultiSampleType = D3DMULTISAMPLE_NONE;
- m_params.MultiSampleQuality = 0;
+ m_params.BackBufferWidth = _init.resolution.width;
+ m_params.BackBufferHeight = _init.resolution.height;
+ m_params.BackBufferFormat = adapterFormat;
+ m_params.BackBufferCount = bx::clamp<uint8_t>(_init.resolution.numBackBuffers, 2, BGFX_CONFIG_MAX_BACK_BUFFERS);
+ m_params.MultiSampleType = D3DMULTISAMPLE_NONE;
+ m_params.MultiSampleQuality = 0;
m_params.EnableAutoDepthStencil = TRUE;
m_params.AutoDepthStencilFormat = D3DFMT_D24S8;
- m_params.Flags = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL;
+ m_params.Flags = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL;
m_params.FullScreen_RefreshRateInHz = 0;
- m_params.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
- m_params.SwapEffect = D3DSWAPEFFECT_DISCARD;
- m_params.hDeviceWindow = NULL;
- m_params.Windowed = true;
-
- RECT rect;
- GetWindowRect( (HWND)g_platformData.nwh, &rect);
- m_params.BackBufferWidth = rect.right-rect.left;
- m_params.BackBufferHeight = rect.bottom-rect.top;
+ m_params.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
+ m_params.SwapEffect = D3DSWAPEFFECT_DISCARD;
+ m_params.hDeviceWindow = NULL;
+ m_params.Windowed = true;
+ m_params.BackBufferWidth = _init.resolution.width;
+ m_params.BackBufferHeight = _init.resolution.height;
+
+ const char* d3d9DllName =
+#if BX_PLATFORM_LINUX
+ "d3d9.so"
+#else
+ "d3d9.dll"
+#endif // BX_PLATFORM_LINUX
+ ;
- m_d3d9Dll = bx::dlopen("d3d9.dll");
+ m_d3d9Dll = bx::dlopen(d3d9DllName);
if (NULL == m_d3d9Dll)
{
- BX_TRACE("Init error: Failed to load d3d9.dll.");
+ BX_TRACE("Init error: Failed to load %s.", d3d9DllName);
goto error;
}
@@ -713,6 +729,7 @@ namespace bgfx { namespace d3d9
| ( (m_caps.DevCaps2 & D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES) ? BGFX_CAPS_TEXTURE_BLIT : 0)
| BGFX_CAPS_TEXTURE_READ_BACK
| (m_occlusionQuerySupport ? BGFX_CAPS_OCCLUSION_QUERY : 0)
+ | ((m_caps.MaxVertexIndex > UINT16_MAX) ? BGFX_CAPS_INDEX32 : 0)
);
m_caps.NumSimultaneousRTs = bx::uint32_min(m_caps.NumSimultaneousRTs, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS);
@@ -1134,7 +1151,7 @@ namespace bgfx { namespace d3d9
bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
- bx::write(&writer, magic);
+ bx::write(&writer, magic, bx::ErrorAssert{});
TextureCreate tc;
tc.m_width = _width;
@@ -1145,7 +1162,7 @@ namespace bgfx { namespace d3d9
tc.m_format = TextureFormat::Enum(texture.m_requestedFormat);
tc.m_cubeMap = false;
tc.m_mem = NULL;
- bx::write(&writer, tc);
+ bx::write(&writer, tc, bx::ErrorAssert{});
texture.destroy(true);
texture.create(mem, texture.m_flags, 0);
@@ -1228,6 +1245,7 @@ namespace bgfx { namespace d3d9
void requestScreenShot(FrameBufferHandle _handle, const char* _filePath) override
{
+#if BX_PLATFORM_WINDOWS
IDirect3DSwapChain9* swapChain = isValid(_handle)
? m_frameBuffers[_handle.idx].m_swapChain
: m_swapChain
@@ -1291,6 +1309,10 @@ namespace bgfx { namespace d3d9
DX_CHECK(surface->UnlockRect() );
DX_RELEASE(surface, 0);
+#else
+ BX_TRACE("Screenshot not supported!");
+ BX_UNUSED(_handle, _filePath);
+#endif // BX_PLATFORM_WINDOWS
}
void updateViewName(ViewId _id, const char* _name) override
@@ -1565,11 +1587,6 @@ namespace bgfx { namespace d3d9
{
if (NULL != m_swapChain)
{
- if (NULL != m_deviceEx)
- {
- DX_CHECK(m_deviceEx->WaitForVBlank(0) );
- }
-
for (uint32_t ii = 0, num = m_numWindows; ii < num; ++ii)
{
HRESULT hr = S_OK;
@@ -2397,13 +2414,15 @@ namespace bgfx { namespace d3d9
{
bx::MemoryReader reader(_mem->data, _mem->size);
+ bx::ErrorAssert err;
+
uint32_t magic;
- bx::read(&reader, magic);
+ bx::read(&reader, magic, &err);
const bool fragment = isShaderType(magic, 'F');
uint32_t hashIn;
- bx::read(&reader, hashIn);
+ bx::read(&reader, hashIn, &err);
uint32_t hashOut;
@@ -2413,11 +2432,11 @@ namespace bgfx { namespace d3d9
}
else
{
- bx::read(&reader, hashOut);
+ bx::read(&reader, hashOut, &err);
}
uint16_t count;
- bx::read(&reader, count);
+ bx::read(&reader, count, &err);
m_numPredefined = 0;
@@ -2430,34 +2449,34 @@ namespace bgfx { namespace d3d9
for (uint32_t ii = 0; ii < count; ++ii)
{
uint8_t nameSize = 0;
- bx::read(&reader, nameSize);
+ bx::read(&reader, nameSize, &err);
char name[256] = {};
- bx::read(&reader, &name, nameSize);
+ bx::read(&reader, &name, nameSize, &err);
name[nameSize] = '\0';
uint8_t type = 0;
- bx::read(&reader, type);
+ bx::read(&reader, type, &err);
uint8_t num = 0;
- bx::read(&reader, num);
+ bx::read(&reader, num, &err);
uint16_t regIndex = 0;
- bx::read(&reader, regIndex);
+ bx::read(&reader, regIndex, &err);
uint16_t regCount = 0;
- bx::read(&reader, regCount);
+ bx::read(&reader, regCount, &err);
if (!isShaderVerLess(magic, 8) )
{
uint16_t texInfo = 0;
- bx::read(&reader, texInfo);
+ bx::read(&reader, texInfo, &err);
}
if (!isShaderVerLess(magic, 10) )
{
uint16_t texFormat = 0;
- bx::read(&reader, texFormat);
+ bx::read(&reader, texFormat, &err);
}
const char* kind = "invalid";
@@ -2510,7 +2529,7 @@ namespace bgfx { namespace d3d9
}
uint32_t shaderSize;
- bx::read(&reader, shaderSize);
+ bx::read(&reader, shaderSize, &err);
const DWORD* code = (const DWORD*)reader.getDataPtr();
@@ -3035,10 +3054,18 @@ namespace bgfx { namespace d3d9
uint32_t size = useMipSize ? mip.m_size : mipSize;
switch (m_textureFormat)
{
+ case TextureFormat::R5G6B5:
+ bimg::imageConvert(bits, 16, bx::packB5G6R5, mip.m_data, bx::unpackR5G6B5, size);
+ break;
+
case TextureFormat::RGBA4:
bimg::imageConvert(bits, 16, bx::packBgra4, mip.m_data, bx::unpackRgba4, size);
break;
+ case TextureFormat::RGB5A1:
+ bimg::imageConvert(bits, 16, bx::packBgr5a1, mip.m_data, bx::unpackRgb5a1, size);
+ break;
+
default:
bx::memCopy(bits, mip.m_data, size);
break;
@@ -3096,10 +3123,18 @@ namespace bgfx { namespace d3d9
{
switch (m_textureFormat)
{
+ case TextureFormat::R5G6B5:
+ bimg::imageConvert(dst, 16, bx::packB5G6R5, src, bx::unpackR5G6B5, rectpitch);
+ break;
+
case TextureFormat::RGBA4:
bimg::imageConvert(dst, 16, bx::packBgra4, src, bx::unpackRgba4, rectpitch);
break;
+ case TextureFormat::RGB5A1:
+ bimg::imageConvert(dst, 16, bx::packBgr5a1, src, bx::unpackRgb5a1, rectpitch);
+ break;
+
default:
bx::memCopy(dst, src, rectpitch);
break;
@@ -3516,7 +3551,7 @@ namespace bgfx { namespace d3d9
}
}
- uint32_t TimerQueryD3D9::begin(uint32_t _resultIdx)
+ uint32_t TimerQueryD3D9::begin(uint32_t _resultIdx, uint32_t _frameNum)
{
while (0 == m_control.reserve(1) )
{
@@ -3530,6 +3565,7 @@ namespace bgfx { namespace d3d9
Query& query = m_query[idx];
query.m_resultIdx = _resultIdx;
query.m_ready = false;
+ query.m_frameNum = _frameNum;
query.m_disjoint->Issue(D3DISSUE_BEGIN);
query.m_begin->Issue(D3DISSUE_END);
@@ -3580,6 +3616,7 @@ namespace bgfx { namespace d3d9
Result& result = m_result[query.m_resultIdx];
--result.m_pending;
+ result.m_frameNum = query.m_frameNum;
result.m_frequency = freq;
result.m_begin = timeBegin;
@@ -3730,7 +3767,7 @@ namespace bgfx { namespace d3d9
device->BeginScene();
if (m_timerQuerySupport)
{
- frameQueryIdx = m_gpuTimer.begin(BGFX_CONFIG_MAX_VIEWS);
+ frameQueryIdx = m_gpuTimer.begin(BGFX_CONFIG_MAX_VIEWS, _render->m_frameNum);
}
if (0 < _render->m_iboffset)
@@ -3990,6 +4027,7 @@ namespace bgfx { namespace d3d9
if ( (0
| BGFX_STATE_CULL_MASK
+// | BGFX_STATE_FRONT_CCW
| BGFX_STATE_WRITE_Z
| BGFX_STATE_DEPTH_TEST_MASK
| BGFX_STATE_WRITE_RGB
@@ -4425,6 +4463,7 @@ namespace bgfx { namespace d3d9
perfStats.numCompute = statsKeyType[1];
perfStats.numBlit = _render->m_numBlitItems;
perfStats.maxGpuLatency = maxGpuLatency;
+ perfStats.gpuFrameNum = result.m_frameNum;
bx::memCopy(perfStats.numPrims, statsNumPrimsRendered, sizeof(perfStats.numPrims) );
m_nvapi.getMemoryInfo(perfStats.gpuMemoryUsed, perfStats.gpuMemoryMax);
diff --git a/3rdparty/bgfx/src/renderer_d3d9.h b/3rdparty/bgfx/src/renderer_d3d9.h
index d61634d874c..0080c474eba 100644
--- a/3rdparty/bgfx/src/renderer_d3d9.h
+++ b/3rdparty/bgfx/src/renderer_d3d9.h
@@ -1,17 +1,16 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_RENDERER_D3D9_H_HEADER_GUARD
#define BGFX_RENDERER_D3D9_H_HEADER_GUARD
-#define BGFX_CONFIG_RENDERER_DIRECT3D9EX BX_PLATFORM_WINDOWS
+#define BGFX_CONFIG_RENDERER_DIRECT3D9EX (BX_PLATFORM_LINUX || BX_PLATFORM_WINDOWS)
-#if BX_PLATFORM_WINDOWS
-# include <sal.h>
-# include <d3d9.h>
-#endif // BX_PLATFORM_
+#include <sal.h>
+#include <unknwn.h>
+#include <d3d9.h>
#ifndef D3DSTREAMSOURCE_INDEXEDDATA
# define D3DSTREAMSOURCE_INDEXEDDATA (1<<30)
@@ -446,7 +445,7 @@ namespace bgfx { namespace d3d9
void postReset();
void preReset();
- uint32_t begin(uint32_t _resultIdx);
+ uint32_t begin(uint32_t _resultIdx, uint32_t _frameNum);
void end(uint32_t _idx);
bool update();
@@ -457,6 +456,7 @@ namespace bgfx { namespace d3d9
IDirect3DQuery9* m_end;
IDirect3DQuery9* m_freq;
uint32_t m_resultIdx;
+ uint32_t m_frameNum;
bool m_ready;
};
@@ -468,12 +468,14 @@ namespace bgfx { namespace d3d9
m_end = 0;
m_frequency = 1;
m_pending = 0;
+ m_frameNum = 0;
}
uint64_t m_begin;
uint64_t m_end;
uint64_t m_frequency;
uint32_t m_pending;
+ uint32_t m_frameNum;
};
Result m_result[BGFX_CONFIG_MAX_VIEWS+1];
diff --git a/3rdparty/bgfx/src/renderer_gl.cpp b/3rdparty/bgfx/src/renderer_gl.cpp
index c8088abe1c4..6fdf64225d7 100644
--- a/3rdparty/bgfx/src/renderer_gl.cpp
+++ b/3rdparty/bgfx/src/renderer_gl.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -188,7 +188,8 @@ namespace bgfx { namespace gl
GLenum m_fmt;
GLenum m_fmtSrgb;
GLenum m_type;
- bool m_supported;
+ bool m_supported;
+ GLint m_mapping[4];
};
// In desktop OpenGL 4+ and OpenGL ES 3.0+, specific GL formats GL_x_INTEGER are used for integer textures.
@@ -208,91 +209,116 @@ namespace bgfx { namespace gl
static TextureFormatInfo s_textureFormat[] =
{
- { GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_ZERO, false }, // BC1
- { GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_ZERO, false }, // BC2
- { GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_ZERO, false }, // BC3
- { GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_ZERO, GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_ZERO, false }, // BC4
- { GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_ZERO, GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_ZERO, false }, // BC5
- { GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_ZERO, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_ZERO, false }, // BC6H
- { GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_ZERO, GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_ZERO, false }, // BC7
- { GL_ETC1_RGB8_OES, GL_ZERO, GL_ETC1_RGB8_OES, GL_ETC1_RGB8_OES, GL_ZERO, false }, // ETC1
- { GL_COMPRESSED_RGB8_ETC2, GL_ZERO, GL_COMPRESSED_RGB8_ETC2, GL_COMPRESSED_RGB8_ETC2, GL_ZERO, false }, // ETC2
- { GL_COMPRESSED_RGBA8_ETC2_EAC, GL_COMPRESSED_SRGB8_ETC2, GL_COMPRESSED_RGBA8_ETC2_EAC, GL_COMPRESSED_RGBA8_ETC2_EAC, GL_ZERO, false }, // ETC2A
- { GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_ZERO, false }, // ETC2A1
- { GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT, GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_ZERO, false }, // PTC12
- { GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_ZERO, false }, // PTC14
- { GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT, GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_ZERO, false }, // PTC12A
- { GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_ZERO, false }, // PTC14A
- { GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_ZERO, GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_ZERO, false }, // PTC22
- { GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_ZERO, GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_ZERO, false }, // PTC24
- { GL_ATC_RGB_AMD, GL_ZERO, GL_ATC_RGB_AMD, GL_ATC_RGB_AMD, GL_ZERO, false }, // ATC
- { GL_ATC_RGBA_EXPLICIT_ALPHA_AMD, GL_ZERO, GL_ATC_RGBA_EXPLICIT_ALPHA_AMD, GL_ATC_RGBA_EXPLICIT_ALPHA_AMD, GL_ZERO, false }, // ATCE
- { GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, GL_ZERO, GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, GL_ZERO, false }, // ATCI
- { GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_SRGB8_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_ZERO, false }, // ASTC4x4
- { GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_SRGB8_ASTC_5x5_KHR, GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_ZERO, false }, // ASTC5x5
- { GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_COMPRESSED_SRGB8_ASTC_6x6_KHR, GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_ZERO, false }, // ASTC6x6
- { GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_COMPRESSED_SRGB8_ASTC_8x5_KHR, GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_ZERO, false }, // ASTC8x5
- { GL_COMPRESSED_RGBA_ASTC_8x6_KHR, GL_COMPRESSED_SRGB8_ASTC_8x6_KHR, GL_COMPRESSED_RGBA_ASTC_8x6_KHR, GL_COMPRESSED_RGBA_ASTC_8x6_KHR, GL_ZERO, false }, // ASTC8x6
- { GL_COMPRESSED_RGBA_ASTC_10x5_KHR, GL_COMPRESSED_SRGB8_ASTC_10x5_KHR, GL_COMPRESSED_RGBA_ASTC_10x5_KHR, GL_COMPRESSED_RGBA_ASTC_10x5_KHR, GL_ZERO, false }, // ASTC10x5
- { GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false }, // Unknown
- { GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false }, // R1
- { GL_ALPHA, GL_ZERO, GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, false }, // A8
- { GL_R8, GL_ZERO, GL_RED, GL_RED, GL_UNSIGNED_BYTE, false }, // R8
- { GL_R8I, GL_ZERO, RED_INTEGER, GL_RED_INTEGER, GL_BYTE, false }, // R8I
- { GL_R8UI, GL_ZERO, RED_INTEGER, GL_RED_INTEGER, GL_UNSIGNED_BYTE, false }, // R8U
- { GL_R8_SNORM, GL_ZERO, GL_RED, GL_RED, GL_BYTE, false }, // R8S
- { GL_R16, GL_ZERO, GL_RED, GL_RED, GL_UNSIGNED_SHORT, false }, // R16
- { GL_R16I, GL_ZERO, RED_INTEGER, GL_RED_INTEGER, GL_SHORT, false }, // R16I
- { GL_R16UI, GL_ZERO, RED_INTEGER, GL_RED_INTEGER, GL_UNSIGNED_SHORT, false }, // R16U
- { GL_R16F, GL_ZERO, GL_RED, GL_RED, GL_HALF_FLOAT, false }, // R16F
- { GL_R16_SNORM, GL_ZERO, GL_RED, GL_RED, GL_SHORT, false }, // R16S
- { GL_R32I, GL_ZERO, RED_INTEGER, GL_RED_INTEGER, GL_INT, false }, // R32I
- { GL_R32UI, GL_ZERO, RED_INTEGER, GL_RED_INTEGER, GL_UNSIGNED_INT, false }, // R32U
- { GL_R32F, GL_ZERO, GL_RED, GL_RED, GL_FLOAT, false }, // R32F
- { GL_RG8, GL_ZERO, GL_RG, GL_RG, GL_UNSIGNED_BYTE, false }, // RG8
- { GL_RG8I, GL_ZERO, RG_INTEGER, GL_RG_INTEGER, GL_BYTE, false }, // RG8I
- { GL_RG8UI, GL_ZERO, RG_INTEGER, GL_RG_INTEGER, GL_UNSIGNED_BYTE, false }, // RG8U
- { GL_RG8_SNORM, GL_ZERO, GL_RG, GL_RG, GL_BYTE, false }, // RG8S
- { GL_RG16, GL_ZERO, GL_RG, GL_RG, GL_UNSIGNED_SHORT, false }, // RG16
- { GL_RG16I, GL_ZERO, RG_INTEGER, GL_RG_INTEGER, GL_SHORT, false }, // RG16I
- { GL_RG16UI, GL_ZERO, RG_INTEGER, GL_RG_INTEGER, GL_UNSIGNED_SHORT, false }, // RG16U
- { GL_RG16F, GL_ZERO, GL_RG, GL_RG, GL_HALF_FLOAT, false }, // RG16F
- { GL_RG16_SNORM, GL_ZERO, GL_RG, GL_RG, GL_SHORT, false }, // RG16S
- { GL_RG32I, GL_ZERO, RG_INTEGER, GL_RG_INTEGER, GL_INT, false }, // RG32I
- { GL_RG32UI, GL_ZERO, RG_INTEGER, GL_RG_INTEGER, GL_UNSIGNED_INT, false }, // RG32U
- { GL_RG32F, GL_ZERO, GL_RG, GL_RG, GL_FLOAT, false }, // RG32F
- { GL_RGB8, GL_SRGB8, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, false }, // RGB8
- { GL_RGB8I, GL_ZERO, RGB_INTEGER, GL_RGB_INTEGER, GL_BYTE, false }, // RGB8I
- { GL_RGB8UI, GL_ZERO, RGB_INTEGER, GL_RGB_INTEGER, GL_UNSIGNED_BYTE, false }, // RGB8U
- { GL_RGB8_SNORM, GL_ZERO, GL_RGB, GL_RGB, GL_BYTE, false }, // RGB8S
- { GL_RGB9_E5, GL_ZERO, GL_RGB, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV, false }, // RGB9E5F
- { GL_RGBA8, GL_SRGB8_ALPHA8, GL_BGRA, GL_BGRA, GL_UNSIGNED_BYTE, false }, // BGRA8
- { GL_RGBA8, GL_SRGB8_ALPHA8, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, false }, // RGBA8
- { GL_RGBA8I, GL_ZERO, RGBA_INTEGER, GL_RGBA_INTEGER, GL_BYTE, false }, // RGBA8I
- { GL_RGBA8UI, GL_ZERO, RGBA_INTEGER, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE, false }, // RGBA8U
- { GL_RGBA8_SNORM, GL_ZERO, GL_RGBA, GL_RGBA, GL_BYTE, false }, // RGBA8S
- { GL_RGBA16, GL_ZERO, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT, false }, // RGBA16
- { GL_RGBA16I, GL_ZERO, RGBA_INTEGER, GL_RGBA_INTEGER, GL_SHORT, false }, // RGBA16I
- { GL_RGBA16UI, GL_ZERO, RGBA_INTEGER, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, false }, // RGBA16U
- { GL_RGBA16F, GL_ZERO, GL_RGBA, GL_RGBA, GL_HALF_FLOAT, false }, // RGBA16F
- { GL_RGBA16_SNORM, GL_ZERO, GL_RGBA, GL_RGBA, GL_SHORT, false }, // RGBA16S
- { GL_RGBA32I, GL_ZERO, RGBA_INTEGER, GL_RGBA_INTEGER, GL_INT, false }, // RGBA32I
- { GL_RGBA32UI, GL_ZERO, RGBA_INTEGER, GL_RGBA_INTEGER, GL_UNSIGNED_INT, false }, // RGBA32U
- { GL_RGBA32F, GL_ZERO, GL_RGBA, GL_RGBA, GL_FLOAT, false }, // RGBA32F
- { GL_RGB565, GL_ZERO, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, false }, // R5G6B5
- { GL_RGBA4, GL_ZERO, GL_BGRA, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV, false }, // RGBA4
- { GL_RGB5_A1, GL_ZERO, GL_BGRA, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, false }, // RGB5A1
- { GL_RGB10_A2, GL_ZERO, GL_RGBA, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, false }, // RGB10A2
- { GL_R11F_G11F_B10F, GL_ZERO, GL_RGB, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, false }, // RG11B10F
- { GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false }, // UnknownDepth
- { GL_DEPTH_COMPONENT16, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false }, // D16
- { GL_DEPTH_COMPONENT24, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, false }, // D24
- { GL_DEPTH24_STENCIL8, GL_ZERO, GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, false }, // D24S8
- { GL_DEPTH_COMPONENT32, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, false }, // D32
- { GL_DEPTH_COMPONENT32F, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D16F
- { GL_DEPTH_COMPONENT32F, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D24F
- { GL_DEPTH_COMPONENT32F, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_FLOAT, false }, // D32F
- { GL_STENCIL_INDEX8, GL_ZERO, GL_STENCIL_INDEX, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, false }, // D0S8
+#define $_ -1
+#define $0 GL_ZERO
+#define $1 GL_ONE
+#define $R GL_RED
+#define $G GL_GREEN
+#define $B GL_BLUE
+#define $A GL_ALPHA
+ { GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_COMPRESSED_RGBA_S3TC_DXT1_EXT, GL_ZERO, false, { $_, $_, $_, $_ } }, // BC1
+ { GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_COMPRESSED_RGBA_S3TC_DXT3_EXT, GL_ZERO, false, { $_, $_, $_, $_ } }, // BC2
+ { GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_COMPRESSED_RGBA_S3TC_DXT5_EXT, GL_ZERO, false, { $_, $_, $_, $_ } }, // BC3
+ { GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_ZERO, GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_COMPRESSED_LUMINANCE_LATC1_EXT, GL_ZERO, false, { $_, $_, $_, $_ } }, // BC4
+ { GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_ZERO, GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT, GL_ZERO, false, { $_, $_, $_, $_ } }, // BC5
+ { GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_ZERO, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB, GL_ZERO, false, { $_, $_, $_, $_ } }, // BC6H
+ { GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB, GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_COMPRESSED_RGBA_BPTC_UNORM_ARB, GL_ZERO, false, { $_, $_, $_, $_ } }, // BC7
+ { GL_ETC1_RGB8_OES, GL_ZERO, GL_ETC1_RGB8_OES, GL_ETC1_RGB8_OES, GL_ZERO, false, { $_, $_, $_, $_ } }, // ETC1
+ { GL_COMPRESSED_RGB8_ETC2, GL_ZERO, GL_COMPRESSED_RGB8_ETC2, GL_COMPRESSED_RGB8_ETC2, GL_ZERO, false, { $_, $_, $_, $_ } }, // ETC2
+ { GL_COMPRESSED_RGBA8_ETC2_EAC, GL_COMPRESSED_SRGB8_ETC2, GL_COMPRESSED_RGBA8_ETC2_EAC, GL_COMPRESSED_RGBA8_ETC2_EAC, GL_ZERO, false, { $_, $_, $_, $_ } }, // ETC2A
+ { GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2, GL_ZERO, false, { $_, $_, $_, $_ } }, // ETC2A1
+ { GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_COMPRESSED_SRGB_PVRTC_2BPPV1_EXT, GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG, GL_ZERO, false, { $_, $_, $_, $_ } }, // PTC12
+ { GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_COMPRESSED_SRGB_PVRTC_4BPPV1_EXT, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG, GL_ZERO, false, { $_, $_, $_, $_ } }, // PTC14
+ { GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_COMPRESSED_SRGB_ALPHA_PVRTC_2BPPV1_EXT, GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG, GL_ZERO, false, { $_, $_, $_, $_ } }, // PTC12A
+ { GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_COMPRESSED_SRGB_ALPHA_PVRTC_4BPPV1_EXT, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG, GL_ZERO, false, { $_, $_, $_, $_ } }, // PTC14A
+ { GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_ZERO, GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_COMPRESSED_RGBA_PVRTC_2BPPV2_IMG, GL_ZERO, false, { $_, $_, $_, $_ } }, // PTC22
+ { GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_ZERO, GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_COMPRESSED_RGBA_PVRTC_4BPPV2_IMG, GL_ZERO, false, { $_, $_, $_, $_ } }, // PTC24
+ { GL_ATC_RGB_AMD, GL_ZERO, GL_ATC_RGB_AMD, GL_ATC_RGB_AMD, GL_ZERO, false, { $_, $_, $_, $_ } }, // ATC
+ { GL_ATC_RGBA_EXPLICIT_ALPHA_AMD, GL_ZERO, GL_ATC_RGBA_EXPLICIT_ALPHA_AMD, GL_ATC_RGBA_EXPLICIT_ALPHA_AMD, GL_ZERO, false, { $_, $_, $_, $_ } }, // ATCE
+ { GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, GL_ZERO, GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD, GL_ZERO, false, { $_, $_, $_, $_ } }, // ATCI
+ { GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_SRGB8_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_COMPRESSED_RGBA_ASTC_4x4_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC4x4
+ { GL_COMPRESSED_RGBA_ASTC_5x4_KHR, GL_COMPRESSED_SRGB8_ASTC_5x4_KHR, GL_COMPRESSED_RGBA_ASTC_5x4_KHR, GL_COMPRESSED_RGBA_ASTC_5x4_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC5x4
+ { GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_SRGB8_ASTC_5x5_KHR, GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_COMPRESSED_RGBA_ASTC_5x5_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC5x5
+ { GL_COMPRESSED_RGBA_ASTC_6x5_KHR, GL_COMPRESSED_SRGB8_ASTC_6x5_KHR, GL_COMPRESSED_RGBA_ASTC_6x5_KHR, GL_COMPRESSED_RGBA_ASTC_6x5_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC6x5
+ { GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_COMPRESSED_SRGB8_ASTC_6x6_KHR, GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_COMPRESSED_RGBA_ASTC_6x6_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC6x6
+ { GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_COMPRESSED_SRGB8_ASTC_8x5_KHR, GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_COMPRESSED_RGBA_ASTC_8x5_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC8x5
+ { GL_COMPRESSED_RGBA_ASTC_8x6_KHR, GL_COMPRESSED_SRGB8_ASTC_8x6_KHR, GL_COMPRESSED_RGBA_ASTC_8x6_KHR, GL_COMPRESSED_RGBA_ASTC_8x6_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC8x6
+ { GL_COMPRESSED_RGBA_ASTC_8x8_KHR, GL_COMPRESSED_SRGB8_ASTC_8x8_KHR, GL_COMPRESSED_RGBA_ASTC_8x8_KHR, GL_COMPRESSED_RGBA_ASTC_8x8_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC8x8
+ { GL_COMPRESSED_RGBA_ASTC_10x5_KHR, GL_COMPRESSED_SRGB8_ASTC_10x5_KHR, GL_COMPRESSED_RGBA_ASTC_10x5_KHR, GL_COMPRESSED_RGBA_ASTC_10x5_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC10x5
+ { GL_COMPRESSED_RGBA_ASTC_10x6_KHR, GL_COMPRESSED_SRGB8_ASTC_10x6_KHR, GL_COMPRESSED_RGBA_ASTC_10x6_KHR, GL_COMPRESSED_RGBA_ASTC_10x6_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC10x6
+ { GL_COMPRESSED_RGBA_ASTC_10x8_KHR, GL_COMPRESSED_SRGB8_ASTC_10x8_KHR, GL_COMPRESSED_RGBA_ASTC_10x8_KHR, GL_COMPRESSED_RGBA_ASTC_10x8_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC10x8
+ { GL_COMPRESSED_RGBA_ASTC_10x10_KHR, GL_COMPRESSED_SRGB8_ASTC_10x10_KHR, GL_COMPRESSED_RGBA_ASTC_10x10_KHR, GL_COMPRESSED_RGBA_ASTC_10x10_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC10x10
+ { GL_COMPRESSED_RGBA_ASTC_12x10_KHR, GL_COMPRESSED_SRGB8_ASTC_12x10_KHR, GL_COMPRESSED_RGBA_ASTC_12x10_KHR, GL_COMPRESSED_RGBA_ASTC_12x10_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC12x10
+ { GL_COMPRESSED_RGBA_ASTC_12x12_KHR, GL_COMPRESSED_SRGB8_ASTC_12x12_KHR, GL_COMPRESSED_RGBA_ASTC_12x12_KHR, GL_COMPRESSED_RGBA_ASTC_12x12_KHR, GL_ZERO, false, { $_, $_, $_, $_ } }, // ASTC12x12
+ { GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false, { $_, $_, $_, $_ } }, // Unknown
+ { GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false, { $_, $_, $_, $_ } }, // R1
+ { GL_ALPHA, GL_ZERO, GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, false, { $_, $_, $_, $_ } }, // A8
+ { GL_R8, GL_ZERO, GL_RED, GL_RED, GL_UNSIGNED_BYTE, false, { $_, $_, $_, $_ } }, // R8
+ { GL_R8I, GL_ZERO, RED_INTEGER, GL_RED_INTEGER, GL_BYTE, false, { $_, $_, $_, $_ } }, // R8I
+ { GL_R8UI, GL_ZERO, RED_INTEGER, GL_RED_INTEGER, GL_UNSIGNED_BYTE, false, { $_, $_, $_, $_ } }, // R8U
+ { GL_R8_SNORM, GL_ZERO, GL_RED, GL_RED, GL_BYTE, false, { $_, $_, $_, $_ } }, // R8S
+ { GL_R16, GL_ZERO, GL_RED, GL_RED, GL_UNSIGNED_SHORT, false, { $_, $_, $_, $_ } }, // R16
+ { GL_R16I, GL_ZERO, RED_INTEGER, GL_RED_INTEGER, GL_SHORT, false, { $_, $_, $_, $_ } }, // R16I
+ { GL_R16UI, GL_ZERO, RED_INTEGER, GL_RED_INTEGER, GL_UNSIGNED_SHORT, false, { $_, $_, $_, $_ } }, // R16U
+ { GL_R16F, GL_ZERO, GL_RED, GL_RED, GL_HALF_FLOAT, false, { $_, $_, $_, $_ } }, // R16F
+ { GL_R16_SNORM, GL_ZERO, GL_RED, GL_RED, GL_SHORT, false, { $_, $_, $_, $_ } }, // R16S
+ { GL_R32I, GL_ZERO, RED_INTEGER, GL_RED_INTEGER, GL_INT, false, { $_, $_, $_, $_ } }, // R32I
+ { GL_R32UI, GL_ZERO, RED_INTEGER, GL_RED_INTEGER, GL_UNSIGNED_INT, false, { $_, $_, $_, $_ } }, // R32U
+ { GL_R32F, GL_ZERO, GL_RED, GL_RED, GL_FLOAT, false, { $_, $_, $_, $_ } }, // R32F
+ { GL_RG8, GL_ZERO, GL_RG, GL_RG, GL_UNSIGNED_BYTE, false, { $_, $_, $_, $_ } }, // RG8
+ { GL_RG8I, GL_ZERO, RG_INTEGER, GL_RG_INTEGER, GL_BYTE, false, { $_, $_, $_, $_ } }, // RG8I
+ { GL_RG8UI, GL_ZERO, RG_INTEGER, GL_RG_INTEGER, GL_UNSIGNED_BYTE, false, { $_, $_, $_, $_ } }, // RG8U
+ { GL_RG8_SNORM, GL_ZERO, GL_RG, GL_RG, GL_BYTE, false, { $_, $_, $_, $_ } }, // RG8S
+ { GL_RG16, GL_ZERO, GL_RG, GL_RG, GL_UNSIGNED_SHORT, false, { $_, $_, $_, $_ } }, // RG16
+ { GL_RG16I, GL_ZERO, RG_INTEGER, GL_RG_INTEGER, GL_SHORT, false, { $_, $_, $_, $_ } }, // RG16I
+ { GL_RG16UI, GL_ZERO, RG_INTEGER, GL_RG_INTEGER, GL_UNSIGNED_SHORT, false, { $_, $_, $_, $_ } }, // RG16U
+ { GL_RG16F, GL_ZERO, GL_RG, GL_RG, GL_HALF_FLOAT, false, { $_, $_, $_, $_ } }, // RG16F
+ { GL_RG16_SNORM, GL_ZERO, GL_RG, GL_RG, GL_SHORT, false, { $_, $_, $_, $_ } }, // RG16S
+ { GL_RG32I, GL_ZERO, RG_INTEGER, GL_RG_INTEGER, GL_INT, false, { $_, $_, $_, $_ } }, // RG32I
+ { GL_RG32UI, GL_ZERO, RG_INTEGER, GL_RG_INTEGER, GL_UNSIGNED_INT, false, { $_, $_, $_, $_ } }, // RG32U
+ { GL_RG32F, GL_ZERO, GL_RG, GL_RG, GL_FLOAT, false, { $_, $_, $_, $_ } }, // RG32F
+ { GL_RGB8, GL_SRGB8, GL_RGB, GL_RGB, GL_UNSIGNED_BYTE, false, { $_, $_, $_, $_ } }, // RGB8
+ { GL_RGB8I, GL_ZERO, RGB_INTEGER, GL_RGB_INTEGER, GL_BYTE, false, { $_, $_, $_, $_ } }, // RGB8I
+ { GL_RGB8UI, GL_ZERO, RGB_INTEGER, GL_RGB_INTEGER, GL_UNSIGNED_BYTE, false, { $_, $_, $_, $_ } }, // RGB8U
+ { GL_RGB8_SNORM, GL_ZERO, GL_RGB, GL_RGB, GL_BYTE, false, { $_, $_, $_, $_ } }, // RGB8S
+ { GL_RGB9_E5, GL_ZERO, GL_RGB, GL_RGB, GL_UNSIGNED_INT_5_9_9_9_REV, false, { $_, $_, $_, $_ } }, // RGB9E5F
+ { GL_RGBA8, GL_SRGB8_ALPHA8, GL_BGRA, GL_BGRA, GL_UNSIGNED_BYTE, false, { $_, $_, $_, $_ } }, // BGRA8
+ { GL_RGBA8, GL_SRGB8_ALPHA8, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, false, { $_, $_, $_, $_ } }, // RGBA8
+ { GL_RGBA8I, GL_ZERO, RGBA_INTEGER, GL_RGBA_INTEGER, GL_BYTE, false, { $_, $_, $_, $_ } }, // RGBA8I
+ { GL_RGBA8UI, GL_ZERO, RGBA_INTEGER, GL_RGBA_INTEGER, GL_UNSIGNED_BYTE, false, { $_, $_, $_, $_ } }, // RGBA8U
+ { GL_RGBA8_SNORM, GL_ZERO, GL_RGBA, GL_RGBA, GL_BYTE, false, { $_, $_, $_, $_ } }, // RGBA8S
+ { GL_RGBA16, GL_ZERO, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT, false, { $_, $_, $_, $_ } }, // RGBA16
+ { GL_RGBA16I, GL_ZERO, RGBA_INTEGER, GL_RGBA_INTEGER, GL_SHORT, false, { $_, $_, $_, $_ } }, // RGBA16I
+ { GL_RGBA16UI, GL_ZERO, RGBA_INTEGER, GL_RGBA_INTEGER, GL_UNSIGNED_SHORT, false, { $_, $_, $_, $_ } }, // RGBA16U
+ { GL_RGBA16F, GL_ZERO, GL_RGBA, GL_RGBA, GL_HALF_FLOAT, false, { $_, $_, $_, $_ } }, // RGBA16F
+ { GL_RGBA16_SNORM, GL_ZERO, GL_RGBA, GL_RGBA, GL_SHORT, false, { $_, $_, $_, $_ } }, // RGBA16S
+ { GL_RGBA32I, GL_ZERO, RGBA_INTEGER, GL_RGBA_INTEGER, GL_INT, false, { $_, $_, $_, $_ } }, // RGBA32I
+ { GL_RGBA32UI, GL_ZERO, RGBA_INTEGER, GL_RGBA_INTEGER, GL_UNSIGNED_INT, false, { $_, $_, $_, $_ } }, // RGBA32U
+ { GL_RGBA32F, GL_ZERO, GL_RGBA, GL_RGBA, GL_FLOAT, false, { $_, $_, $_, $_ } }, // RGBA32F
+ { GL_RGB565, GL_ZERO, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, false, { $_, $_, $_, $_ } }, // B5G6R5
+ { GL_RGB565, GL_ZERO, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5, false, { $_, $_, $_, $_ } }, // R5G6B5
+ { GL_RGBA4, GL_ZERO, GL_BGRA, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV, false, { $_, $_, $_, $_ } }, // BGRA4
+ { GL_RGBA4, GL_ZERO, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4_REV, false, { $_, $_, $_, $_ } }, // RGBA4
+ { GL_RGB5_A1, GL_ZERO, GL_BGRA, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, false, { $_, $_, $_, $_ } }, // BGR5A1
+ { GL_RGB5_A1, GL_ZERO, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, false, { $_, $_, $_, $_ } }, // RGB5A1
+ { GL_RGB10_A2, GL_ZERO, GL_RGBA, GL_RGBA, GL_UNSIGNED_INT_2_10_10_10_REV, false, { $_, $_, $_, $_ } }, // RGB10A2
+ { GL_R11F_G11F_B10F, GL_ZERO, GL_RGB, GL_RGB, GL_UNSIGNED_INT_10F_11F_11F_REV, false, { $_, $_, $_, $_ } }, // RG11B10F
+ { GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, GL_ZERO, false, { $_, $_, $_, $_ } }, // UnknownDepth
+ { GL_DEPTH_COMPONENT16, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_SHORT, false, { $_, $_, $_, $_ } }, // D16
+ { GL_DEPTH_COMPONENT24, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, false, { $_, $_, $_, $_ } }, // D24
+ { GL_DEPTH24_STENCIL8, GL_ZERO, GL_DEPTH_STENCIL, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, false, { $_, $_, $_, $_ } }, // D24S8
+ { GL_DEPTH_COMPONENT32, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, false, { $_, $_, $_, $_ } }, // D32
+ { GL_DEPTH_COMPONENT32F, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_FLOAT, false, { $_, $_, $_, $_ } }, // D16F
+ { GL_DEPTH_COMPONENT32F, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_FLOAT, false, { $_, $_, $_, $_ } }, // D24F
+ { GL_DEPTH_COMPONENT32F, GL_ZERO, GL_DEPTH_COMPONENT, GL_DEPTH_COMPONENT, GL_FLOAT, false, { $_, $_, $_, $_ } }, // D32F
+ { GL_STENCIL_INDEX8, GL_ZERO, GL_STENCIL_INDEX, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, false, { $_, $_, $_, $_ } }, // D0S8
+#undef $_
+#undef $0
+#undef $1
+#undef $R
+#undef $G
+#undef $B
+#undef $A
};
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
@@ -321,11 +347,19 @@ namespace bgfx { namespace gl
GL_ZERO, // ATCE
GL_ZERO, // ATCI
GL_ZERO, // ASTC4x4
+ GL_ZERO, // ASTC5x4
GL_ZERO, // ASTC5x5
+ GL_ZERO, // ASTC6x5
GL_ZERO, // ASTC6x6
GL_ZERO, // ASTC8x5
GL_ZERO, // ASTC8x6
+ GL_ZERO, // ASTC8x8
GL_ZERO, // ASTC10x5
+ GL_ZERO, // ASTC10x6
+ GL_ZERO, // ASTC10x8
+ GL_ZERO, // ASTC10x10
+ GL_ZERO, // ASTC12x10
+ GL_ZERO, // ASTC12x12
GL_ZERO, // Unknown
GL_ZERO, // R1
GL_ALPHA, // A8
@@ -371,8 +405,11 @@ namespace bgfx { namespace gl
GL_RGBA32I, // RGBA32I
GL_RGBA32UI, // RGBA32U
GL_RGBA32F, // RGBA32F
+ GL_RGB565, // B5G6R5
GL_RGB565, // R5G6B5
+ GL_RGBA4, // BGRA4
GL_RGBA4, // RGBA4
+ GL_RGB5_A1, // BGR5A1
GL_RGB5_A1, // RGB5A1
GL_RGB10_A2, // RGB10A2
GL_R11F_G11F_B10F, // RG11B10F
@@ -411,11 +448,19 @@ namespace bgfx { namespace gl
GL_ZERO, // ATCE
GL_ZERO, // ATCI
GL_ZERO, // ASTC4x4
+ GL_ZERO, // ASTC5x4
GL_ZERO, // ASTC5x5
+ GL_ZERO, // ASTC6x5
GL_ZERO, // ASTC6x6
GL_ZERO, // ASTC8x5
GL_ZERO, // ASTC8x6
+ GL_ZERO, // ASTC8x8
GL_ZERO, // ASTC10x5
+ GL_ZERO, // ASTC10x6
+ GL_ZERO, // ASTC10x8
+ GL_ZERO, // ASTC10x10
+ GL_ZERO, // ASTC12x10
+ GL_ZERO, // ASTC12x12
GL_ZERO, // Unknown
GL_ZERO, // R1
GL_ALPHA, // A8
@@ -461,8 +506,11 @@ namespace bgfx { namespace gl
GL_RGBA32I, // RGBA32I
GL_RGBA32UI, // RGBA32U
GL_RGBA32F, // RGBA32F
+ GL_RGB565, // B5G6R5
GL_RGB565, // R5G6B5
+ GL_RGBA4, // BGRA4
GL_RGBA4, // RGBA4
+ GL_RGB5_A1, // BGR5A1
GL_RGB5_A1, // RGB5A1
GL_RGB10_A2, // RGB10A2
GL_R11F_G11F_B10F, // RG11B10F
@@ -515,6 +563,7 @@ namespace bgfx { namespace gl
ARB_get_program_binary,
ARB_half_float_pixel,
ARB_half_float_vertex,
+ ARB_indirect_parameters,
ARB_instanced_arrays,
ARB_internalformat_query,
ARB_internalformat_query2,
@@ -732,6 +781,7 @@ namespace bgfx { namespace gl
{ "ARB_get_program_binary", BGFX_CONFIG_RENDERER_OPENGL >= 41, true },
{ "ARB_half_float_pixel", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
{ "ARB_half_float_vertex", BGFX_CONFIG_RENDERER_OPENGL >= 30, true },
+ { "ARB_indirect_parameters", BGFX_CONFIG_RENDERER_OPENGL >= 46, true },
{ "ARB_instanced_arrays", BGFX_CONFIG_RENDERER_OPENGL >= 33, true },
{ "ARB_internalformat_query", BGFX_CONFIG_RENDERER_OPENGL >= 42, true },
{ "ARB_internalformat_query2", BGFX_CONFIG_RENDERER_OPENGL >= 43, true },
@@ -1077,20 +1127,20 @@ namespace bgfx { namespace gl
) );
}
- static void GL_APIENTRY stubMultiDrawArraysIndirect(GLenum _mode, const void* _indirect, GLsizei _drawcount, GLsizei _stride)
+ static void GL_APIENTRY stubMultiDrawArraysIndirect(GLenum _mode, const void* _indirect, GLsizei _drawCount, GLsizei _stride)
{
const uint8_t* args = (const uint8_t*)_indirect;
- for (GLsizei ii = 0; ii < _drawcount; ++ii)
+ for (GLsizei ii = 0; ii < _drawCount; ++ii)
{
GL_CHECK(glDrawArraysIndirect(_mode, (void*)args) );
args += _stride;
}
}
- static void GL_APIENTRY stubMultiDrawElementsIndirect(GLenum _mode, GLenum _type, const void* _indirect, GLsizei _drawcount, GLsizei _stride)
+ static void GL_APIENTRY stubMultiDrawElementsIndirect(GLenum _mode, GLenum _type, const void* _indirect, GLsizei _drawCount, GLsizei _stride)
{
const uint8_t* args = (const uint8_t*)_indirect;
- for (GLsizei ii = 0; ii < _drawcount; ++ii)
+ for (GLsizei ii = 0; ii < _drawCount; ++ii)
{
GL_CHECK(glDrawElementsIndirect(_mode, _type, (void*)args) );
args += _stride;
@@ -1633,8 +1683,11 @@ namespace bgfx { namespace gl
{
case TextureFormat::A8:
case TextureFormat::R8: // Luminance
+ case TextureFormat::B5G6R5:
case TextureFormat::R5G6B5:
+ case TextureFormat::BGRA4:
case TextureFormat::RGBA4:
+ case TextureFormat::BGR5A1:
case TextureFormat::RGB5A1:
// GLES2 formats without sRGB.
return !_srgb;
@@ -1885,8 +1938,11 @@ namespace bgfx { namespace gl
switch(_format)
{
// GLES2 textures
+ case TextureFormat::B5G6R5:
case TextureFormat::R5G6B5:
+ case TextureFormat::BGRA4:
case TextureFormat::RGBA4:
+ case TextureFormat::BGR5A1:
case TextureFormat::RGB5A1:
case TextureFormat::D16:
return !_srgb;
@@ -2143,6 +2199,7 @@ namespace bgfx { namespace gl
{ "Advanced Micro Devices, Inc.", BGFX_PCI_ID_AMD },
{ "Intel", BGFX_PCI_ID_INTEL },
{ "ATI Technologies Inc.", BGFX_PCI_ID_AMD },
+ { "ARM", BGFX_PCI_ID_ARM },
};
struct Workaround
@@ -2185,6 +2242,7 @@ namespace bgfx { namespace gl
, m_hash( (BX_PLATFORM_WINDOWS<<1) | BX_ARCH_64BIT)
, m_backBufferFbo(0)
, m_msaaBackBufferFbo(0)
+ , m_msaaBlitProgram(0)
, m_clearQuadColor(BGFX_INVALID_HANDLE)
, m_clearQuadDepth(BGFX_INVALID_HANDLE)
{
@@ -2217,7 +2275,7 @@ namespace bgfx { namespace gl
bx::memSet(m_uniforms, 0, sizeof(m_uniforms) );
bx::memSet(&m_resolution, 0, sizeof(m_resolution) );
- setRenderContextSize(_init.resolution.width, _init.resolution.height);
+ setRenderContextSize(_init.resolution.width, _init.resolution.height, _init.resolution.reset);
m_vendor = getGLString(GL_VENDOR);
m_renderer = getGLString(GL_RENDERER);
@@ -2225,8 +2283,6 @@ namespace bgfx { namespace gl
m_glslVersion = getGLString(GL_SHADING_LANGUAGE_VERSION);
{
- int32_t glVersion = 0;
-
if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN) )
{
int32_t majorGlVersion = 0;
@@ -2240,15 +2296,16 @@ namespace bgfx { namespace gl
bx::fromString(&majorGlVersion, version);
bx::fromString(&minorGlVersion, version + 2);
- glVersion = majorGlVersion*10 + minorGlVersion;
+ int32_t glVersion = majorGlVersion*10 + minorGlVersion;
BX_TRACE("WebGL context version %d (%d.%d).", glVersion, majorGlVersion, minorGlVersion);
- }
- m_gles3 = false
- || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30)
- || (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES) && glVersion >= 30)
- ;
+ m_gles3 = glVersion >= 30;
+ }
+ else
+ {
+ m_gles3 = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30);
+ }
}
for (uint32_t ii = 0; ii < BX_COUNTOF(s_vendorIds); ++ii)
@@ -2353,7 +2410,7 @@ namespace bgfx { namespace gl
if (NULL != extensions)
{
bx::StringView ext(extensions);
- uint32_t index = 0;
+
while (!ext.isEmpty() )
{
const bx::StringView space = bx::strFind(ext, ' ');
@@ -2361,8 +2418,6 @@ namespace bgfx { namespace gl
updateExtension(token);
ext.set(space.getPtr() + (space.isEmpty() ? 0 : 1), ext.getTerm() );
-
- ++index;
}
}
else if (NULL != glGetStringi)
@@ -2498,8 +2553,11 @@ namespace bgfx { namespace gl
// internalFormat and format must match:
// https://www.khronos.org/opengles/sdk/docs/man/xhtml/glTexImage2D.xml
setTextureFormat(TextureFormat::RGBA8, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE);
+ setTextureFormat(TextureFormat::B5G6R5, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV);
setTextureFormat(TextureFormat::R5G6B5, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV);
+ setTextureFormat(TextureFormat::BGRA4, GL_BGRA, GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4_REV);
setTextureFormat(TextureFormat::RGBA4, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4_REV);
+ setTextureFormat(TextureFormat::BGR5A1, GL_BGRA, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV);
setTextureFormat(TextureFormat::RGB5A1, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV);
if (s_extension[Extension::EXT_sRGB].m_supported)
@@ -2508,6 +2566,12 @@ namespace bgfx { namespace gl
setTextureFormatSrgb(TextureFormat::RGB8, GL_SRGB_EXT, GL_SRGB_EXT);
}
+ if (s_extension[Extension::EXT_texture_swizzle].m_supported)
+ {
+ s_textureFormat[TextureFormat::R5G6B5].m_mapping[0] = GL_BLUE;
+ s_textureFormat[TextureFormat::R5G6B5].m_mapping[2] = GL_RED;
+ }
+
if (s_extension[Extension::OES_texture_half_float].m_supported
|| s_extension[Extension::OES_texture_float ].m_supported)
{
@@ -2550,6 +2614,11 @@ namespace bgfx { namespace gl
setTextureFormat(TextureFormat::D0S8, GL_STENCIL_INDEX8, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE); // Only works as renderbuffer, not as texture
}
}
+ else
+ {
+ setTextureFormat(TextureFormat::R5G6B5, GL_BGR, GL_BGR, GL_UNSIGNED_SHORT_5_6_5);
+ setTextureFormatSrgb(TextureFormat::R5G6B5, GL_ZERO, GL_BGR);
+ }
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
|| m_gles3)
@@ -2602,8 +2671,11 @@ namespace bgfx { namespace gl
if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN) )
{
// OpenGL ES does not have reversed BGRA4 and BGR5A1 support.
+ setTextureFormat(TextureFormat::BGRA4, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4);
setTextureFormat(TextureFormat::RGBA4, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_4_4_4_4);
+ setTextureFormat(TextureFormat::BGR5A1, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1);
setTextureFormat(TextureFormat::RGB5A1, GL_RGBA, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1);
+ setTextureFormat(TextureFormat::B5G6R5, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5);
setTextureFormat(TextureFormat::R5G6B5, GL_RGB, GL_RGB, GL_UNSIGNED_SHORT_5_6_5);
if (!m_gles3)
@@ -2783,6 +2855,11 @@ namespace bgfx { namespace gl
: 0
;
+ g_caps.supported |= s_extension[Extension::ARB_indirect_parameters].m_supported
+ ? BGFX_CAPS_DRAW_INDIRECT_COUNT
+ : 0
+ ;
+
if (BX_ENABLED(BX_PLATFORM_EMSCRIPTEN)
|| NULL == glPolygonMode)
{
@@ -2802,7 +2879,7 @@ namespace bgfx { namespace gl
: 0
;
- g_caps.supported |= (m_readBackSupported || BX_ENABLED(BGFX_GL_CONFIG_TEXTURE_READ_BACK_EMULATION))
+ g_caps.supported |= (m_readBackSupported || BX_ENABLED(BGFX_GL_CONFIG_TEXTURE_READ_BACK_EMULATION) )
? BGFX_CAPS_TEXTURE_READ_BACK
: 0
;
@@ -2830,7 +2907,7 @@ namespace bgfx { namespace gl
;
g_caps.limits.maxTextureSize = uint16_t(glGet(GL_MAX_TEXTURE_SIZE) );
- g_caps.limits.maxTextureLayers = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL >= 31) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 31) || s_extension[Extension::EXT_texture_array].m_supported ? uint16_t(bx::max(glGet(GL_MAX_ARRAY_TEXTURE_LAYERS), 1) ) : 1;
+ g_caps.limits.maxTextureLayers = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL >= 30) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) || s_extension[Extension::EXT_texture_array].m_supported ? uint16_t(bx::max(glGet(GL_MAX_ARRAY_TEXTURE_LAYERS), 1) ) : 1;
g_caps.limits.maxComputeBindings = computeSupport ? BGFX_MAX_COMPUTE_BINDINGS : 0;
g_caps.limits.maxVertexStreams = BGFX_CONFIG_MAX_VERTEX_STREAMS;
@@ -2868,12 +2945,12 @@ namespace bgfx { namespace gl
GL_CHECK(glGenVertexArrays(1, &m_vao) );
}
- m_samplerObjectSupport = !BX_ENABLED(BX_PLATFORM_EMSCRIPTEN)
- && (m_gles3
- || s_extension[Extension::ARB_sampler_objects].m_supported
- );
+ m_samplerObjectSupport = false
+ || m_gles3
+ || s_extension[Extension::ARB_sampler_objects].m_supported
+ ;
- m_shadowSamplersSupport = !!(BGFX_CONFIG_RENDERER_OPENGL || BGFX_CONFIG_RENDERER_OPENGLES >= 30)
+ m_shadowSamplersSupport = !!(BGFX_CONFIG_RENDERER_OPENGL || m_gles3)
|| s_extension[Extension::EXT_shadow_samplers].m_supported
;
@@ -3027,6 +3104,8 @@ namespace bgfx { namespace gl
: 0
;
+ g_caps.supported |= BX_ENABLED(BX_PLATFORM_WINRT) ? BGFX_CAPS_TRANSPARENT_BACKBUFFER : 0;
+
if (s_extension[Extension::ARB_debug_output].m_supported
|| s_extension[Extension::KHR_debug].m_supported)
{
@@ -3329,7 +3408,7 @@ namespace bgfx { namespace gl
GL_CHECK(glBindTexture(texture.m_target, 0) );
}
- else if (BX_ENABLED(BGFX_GL_CONFIG_TEXTURE_READ_BACK_EMULATION))
+ else if (BX_ENABLED(BGFX_GL_CONFIG_TEXTURE_READ_BACK_EMULATION) )
{
const TextureGL& texture = m_textures[_handle.idx];
const bool compressed = bimg::isCompressed(bimg::TextureFormat::Enum(texture.m_textureFormat) );
@@ -3350,8 +3429,7 @@ namespace bgfx { namespace gl
, at[0].mip
) );
- if (!BX_ENABLED(BX_PLATFORM_EMSCRIPTEN)
- && !BX_ENABLED(BX_PLATFORM_IOS) )
+ if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || m_gles3)
{
GL_CHECK(glReadBuffer(GL_COLOR_ATTACHMENT0) );
}
@@ -3383,7 +3461,7 @@ namespace bgfx { namespace gl
bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
- bx::write(&writer, magic);
+ bx::write(&writer, magic, bx::ErrorAssert{});
TextureCreate tc;
tc.m_width = _width;
@@ -3394,7 +3472,7 @@ namespace bgfx { namespace gl
tc.m_format = TextureFormat::Enum(texture.m_requestedFormat);
tc.m_cubeMap = false;
tc.m_mem = NULL;
- bx::write(&writer, tc);
+ bx::write(&writer, tc, bx::ErrorAssert{});
texture.destroy();
texture.create(mem, texture.m_flags, 0);
@@ -3577,7 +3655,6 @@ namespace bgfx { namespace gl
void submitBlit(BlitState& _bs, uint16_t _view);
void submit(Frame* _render, ClearQuad& _clearQuad, TextVideoMemBlitter& _textVideoMemBlitter) override;
-
void blitSetup(TextVideoMemBlitter& _blitter) override
{
if (0 != m_vao)
@@ -3617,13 +3694,9 @@ namespace bgfx { namespace gl
if (!BX_ENABLED(BX_PLATFORM_OSX) )
{
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
- || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) )
+ if (m_samplerObjectSupport)
{
- if (m_samplerObjectSupport)
- {
- GL_CHECK(glBindSampler(0, 0) );
- }
+ GL_CHECK(glBindSampler(0, 0) );
}
}
}
@@ -3803,34 +3876,177 @@ namespace bgfx { namespace gl
void createMsaaFbo(uint32_t _width, uint32_t _height, uint32_t _msaa)
{
if (0 == m_msaaBackBufferFbo // iOS
- && 1 < _msaa)
+ && 1 < _msaa
+ && !m_glctx.m_msaaContext)
{
- GLenum storageFormat = (m_resolution.reset & BGFX_RESET_SRGB_BACKBUFFER)
+ GLenum storageFormat = m_resolution.reset & BGFX_RESET_SRGB_BACKBUFFER
? GL_SRGB8_ALPHA8
: GL_RGBA8
;
- GL_CHECK(glGenFramebuffers(1, &m_msaaBackBufferFbo) );
- GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_msaaBackBufferFbo) );
- GL_CHECK(glGenRenderbuffers(BX_COUNTOF(m_msaaBackBufferRbos), m_msaaBackBufferRbos) );
- GL_CHECK(glBindRenderbuffer(GL_RENDERBUFFER, m_msaaBackBufferRbos[0]) );
- GL_CHECK(glRenderbufferStorageMultisample(GL_RENDERBUFFER, _msaa, storageFormat, _width, _height) );
- GL_CHECK(glBindRenderbuffer(GL_RENDERBUFFER, m_msaaBackBufferRbos[1]) );
- GL_CHECK(glRenderbufferStorageMultisample(GL_RENDERBUFFER, _msaa, GL_DEPTH24_STENCIL8, _width, _height) );
- GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, m_msaaBackBufferRbos[0]) );
-
- GLenum attachment = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30)
+ GLenum attachment = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || m_gles3
? GL_DEPTH_STENCIL_ATTACHMENT
: GL_DEPTH_ATTACHMENT
;
- GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER, attachment, GL_RENDERBUFFER, m_msaaBackBufferRbos[1]) );
-
- BX_ASSERT(GL_FRAMEBUFFER_COMPLETE == glCheckFramebufferStatus(GL_FRAMEBUFFER)
- , "glCheckFramebufferStatus failed 0x%08x"
- , glCheckFramebufferStatus(GL_FRAMEBUFFER)
- );
+ GL_CHECK(glGenFramebuffers(1, &m_msaaBackBufferFbo) );
GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_msaaBackBufferFbo) );
+
+ if (m_gles3)
+ {
+ GL_CHECK(glGenTextures(BX_COUNTOF(m_msaaBackBufferTextures), m_msaaBackBufferTextures) );
+ GL_CHECK(glBindTexture(GL_TEXTURE_2D, m_msaaBackBufferTextures[0]) );
+ GL_CHECK(glTexStorage2D(GL_TEXTURE_2D, 1, storageFormat, _width, _height) );
+ GL_CHECK(glFramebufferTexture2DMultisampleEXT(
+ GL_FRAMEBUFFER
+ , GL_COLOR_ATTACHMENT0
+ , GL_TEXTURE_2D
+ , m_msaaBackBufferTextures[0]
+ , 0
+ , _msaa
+ ) );
+ GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_msaaBackBufferFbo) );
+
+ GL_CHECK(glBindTexture(GL_TEXTURE_2D, m_msaaBackBufferTextures[1]) );
+ GL_CHECK(glTexStorage2D(GL_TEXTURE_2D, 1, GL_DEPTH24_STENCIL8, _width, _height) );
+ GL_CHECK(glFramebufferTexture2DMultisampleEXT(
+ GL_FRAMEBUFFER
+ , attachment
+ , GL_TEXTURE_2D
+ , m_msaaBackBufferTextures[1]
+ , 0
+ , _msaa
+ ) );
+ GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, 0) );
+
+ BX_ASSERT(GL_FRAMEBUFFER_COMPLETE == glCheckFramebufferStatus(GL_FRAMEBUFFER)
+ , "glCheckFramebufferStatus failed 0x%08x"
+ , glCheckFramebufferStatus(GL_FRAMEBUFFER)
+ );
+
+ if (0 == m_msaaBlitProgram)
+ {
+ static const char* msaa_blit_vs =
+ R"(#version 300 es
+ precision highp float;
+ out vec2 UV;
+ void main()
+ {
+ float x = -1.0 + float( (gl_VertexID & 1) << 2);
+ float y = -1.0 + float( (gl_VertexID & 2) << 1);
+ gl_Position = vec4(x, y, 0, 1);
+ UV = vec2(gl_Position.x + 1.0, gl_Position.y + 1.0) * 0.5;
+ }
+ )";
+
+ static const char* msaa_blit_fs =
+ R"(#version 300 es
+ precision mediump float;
+ in vec2 UV;
+ uniform sampler2D msaaTexture;
+ out vec4 oFragColor;
+ void main()
+ {
+ oFragColor = texture(msaaTexture, UV);
+ }
+ )";
+
+ const GLchar *const vs = msaa_blit_vs;
+ const GLchar *const fs = msaa_blit_fs;
+
+ GLuint shader_vs = glCreateShader(GL_VERTEX_SHADER);
+ {
+ BX_WARN(0 != shader_vs, "Failed to create msaa Blit Vertex shader.");
+ GL_CHECK(glShaderSource(shader_vs, 1, &vs, NULL) );
+ GL_CHECK(glCompileShader(shader_vs) );
+
+ GLint compiled = 0;
+ GL_CHECK(glGetShaderiv(shader_vs, GL_COMPILE_STATUS, &compiled) );
+ BX_WARN(0 == shader_vs, "Unable to compile msaa Blit Vertex shader.");
+ }
+
+ GLuint shader_fs = glCreateShader(GL_FRAGMENT_SHADER);
+ {
+ BX_WARN(0 != shader_fs, "Failed to create msaa Blit Fragment shader.");
+ GL_CHECK(glShaderSource(shader_fs, 1, &fs, NULL) );
+ GL_CHECK(glCompileShader(shader_fs) );
+
+ GLint compiled = 0;
+ GL_CHECK(glGetShaderiv(shader_fs, GL_COMPILE_STATUS, &compiled) );
+ BX_WARN(0 == shader_vs, "Unable to compile msaa Blit Fragment shader.");
+ }
+
+ m_msaaBlitProgram = glCreateProgram();
+
+ if (m_msaaBlitProgram)
+ {
+ GL_CHECK(glAttachShader(m_msaaBlitProgram, shader_vs) );
+ GL_CHECK(glAttachShader(m_msaaBlitProgram, shader_fs) );
+ GL_CHECK(glLinkProgram(m_msaaBlitProgram) );
+
+ GLint linked = 0;
+ GL_CHECK(glGetProgramiv(m_msaaBlitProgram, GL_LINK_STATUS, &linked) );
+
+ if (0 == linked)
+ {
+ char log[1024];
+ GL_CHECK(glGetProgramInfoLog(
+ m_msaaBlitProgram
+ , sizeof(log)
+ , NULL
+ , log
+ ) );
+ BX_TRACE("%d: %s", linked, log);
+ }
+
+ GL_CHECK(glDetachShader(m_msaaBlitProgram, shader_vs) );
+ GL_CHECK(glDeleteShader(shader_vs) );
+
+ GL_CHECK(glDetachShader(m_msaaBlitProgram, shader_fs) );
+ GL_CHECK(glDeleteShader(shader_fs) );
+ }
+ }
+ }
+ else
+ {
+ GL_CHECK(glGenRenderbuffers(BX_COUNTOF(m_msaaBackBufferRbos), m_msaaBackBufferRbos) );
+
+ GL_CHECK(glBindRenderbuffer(GL_RENDERBUFFER, m_msaaBackBufferRbos[0]) );
+ GL_CHECK(glRenderbufferStorageMultisample(
+ GL_RENDERBUFFER
+ , _msaa
+ , storageFormat
+ , _width
+ , _height
+ ) );
+
+ GL_CHECK(glBindRenderbuffer(GL_RENDERBUFFER, m_msaaBackBufferRbos[1]) );
+ GL_CHECK(glRenderbufferStorageMultisample(
+ GL_RENDERBUFFER
+ , _msaa
+ , GL_DEPTH24_STENCIL8
+ , _width
+ , _height
+ ) );
+
+ GL_CHECK(glFramebufferRenderbuffer(
+ GL_FRAMEBUFFER
+ , GL_COLOR_ATTACHMENT0
+ , GL_RENDERBUFFER
+ , m_msaaBackBufferRbos[0]
+ ) );
+ GL_CHECK(glFramebufferRenderbuffer(
+ GL_FRAMEBUFFER
+ , attachment
+ , GL_RENDERBUFFER
+ , m_msaaBackBufferRbos[1]
+ ) );
+
+ BX_ASSERT(GL_FRAMEBUFFER_COMPLETE == glCheckFramebufferStatus(GL_FRAMEBUFFER)
+ , "glCheckFramebufferStatus failed 0x%08x"
+ , glCheckFramebufferStatus(GL_FRAMEBUFFER)
+ );
+ }
}
}
@@ -3842,11 +4058,28 @@ namespace bgfx { namespace gl
GL_CHECK(glDeleteFramebuffers(1, &m_msaaBackBufferFbo) );
m_msaaBackBufferFbo = 0;
- if (0 != m_msaaBackBufferRbos[0])
+ if (m_gles3)
+ {
+ if (0 != m_msaaBackBufferTextures[0])
+ {
+ GL_CHECK(glDeleteTextures(BX_COUNTOF(m_msaaBackBufferTextures), m_msaaBackBufferTextures) );
+ m_msaaBackBufferTextures[0] = 0;
+ m_msaaBackBufferTextures[1] = 0;
+ }
+ if (0 != m_msaaBlitProgram)
+ {
+ GL_CHECK(glDeleteProgram(m_msaaBlitProgram) );
+ m_msaaBlitProgram = 0;
+ }
+ }
+ else
{
- GL_CHECK(glDeleteRenderbuffers(BX_COUNTOF(m_msaaBackBufferRbos), m_msaaBackBufferRbos) );
- m_msaaBackBufferRbos[0] = 0;
- m_msaaBackBufferRbos[1] = 0;
+ if (0 != m_msaaBackBufferRbos[0])
+ {
+ GL_CHECK(glDeleteRenderbuffers(BX_COUNTOF(m_msaaBackBufferRbos), m_msaaBackBufferRbos) );
+ m_msaaBackBufferRbos[0] = 0;
+ m_msaaBackBufferRbos[1] = 0;
+ }
}
}
}
@@ -3860,23 +4093,37 @@ namespace bgfx { namespace gl
GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_backBufferFbo) );
GL_CHECK(glBindFramebuffer(GL_READ_FRAMEBUFFER, m_msaaBackBufferFbo) );
GL_CHECK(glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0) );
- uint32_t width = m_resolution.width;
- uint32_t height = m_resolution.height;
- GLenum filter = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES < 30)
+
+ const uint32_t width = m_resolution.width;
+ const uint32_t height = m_resolution.height;
+ const GLenum filter = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || !m_gles3
? GL_NEAREST
: GL_LINEAR
;
- GL_CHECK(glBlitFramebuffer(0
- , 0
- , width
- , height
- , 0
- , 0
- , width
- , height
- , GL_COLOR_BUFFER_BIT
- , filter
- ) );
+
+ if (m_gles3)
+ {
+ GL_CHECK(glUseProgram(m_msaaBlitProgram) );
+ GL_CHECK(glActiveTexture(GL_TEXTURE0) );
+ GL_CHECK(glBindTexture(GL_TEXTURE_2D, m_msaaBackBufferTextures[0]) );
+ GL_CHECK(glDrawArrays(GL_TRIANGLES, 0, 3) );
+ }
+ else
+ {
+ GL_CHECK(glBlitFramebuffer(
+ 0
+ , 0
+ , width
+ , height
+ , 0
+ , 0
+ , width
+ , height
+ , GL_COLOR_BUFFER_BIT
+ , filter
+ ) );
+ }
+
GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_backBufferFbo) );
}
}
@@ -3888,7 +4135,7 @@ namespace bgfx { namespace gl
{
if (!m_glctx.isValid() )
{
- m_glctx.create(_width, _height);
+ m_glctx.create(_width, _height, _flags);
#if BX_PLATFORM_IOS
// iOS: need to figure out how to deal with FBO created by context.
@@ -3913,8 +4160,7 @@ namespace bgfx { namespace gl
void invalidateCache()
{
- if ( (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) )
- && m_samplerObjectSupport)
+ if (m_samplerObjectSupport)
{
m_samplerStateCache.invalidate();
}
@@ -3922,110 +4168,108 @@ namespace bgfx { namespace gl
void setSamplerState(uint32_t _stage, uint32_t _numMips, uint32_t _flags, const float _rgba[4])
{
- if ( (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) )
- && m_samplerObjectSupport)
+ BX_ASSERT(m_samplerObjectSupport, "Cannot use Sampler Objects");
+
+ if (0 == (BGFX_SAMPLER_INTERNAL_DEFAULT & _flags) )
{
- if (0 == (BGFX_SAMPLER_INTERNAL_DEFAULT & _flags) )
- {
- const uint32_t index = (_flags & BGFX_SAMPLER_BORDER_COLOR_MASK) >> BGFX_SAMPLER_BORDER_COLOR_SHIFT;
+ const uint32_t index = (_flags & BGFX_SAMPLER_BORDER_COLOR_MASK) >> BGFX_SAMPLER_BORDER_COLOR_SHIFT;
- _flags &= ~BGFX_SAMPLER_RESERVED_MASK;
- _flags &= BGFX_SAMPLER_BITS_MASK;
- _flags |= _numMips<<BGFX_SAMPLER_RESERVED_SHIFT;
+ _flags &= ~BGFX_SAMPLER_RESERVED_MASK;
+ _flags &= BGFX_SAMPLER_BITS_MASK;
+ _flags |= _numMips<<BGFX_SAMPLER_RESERVED_SHIFT;
- GLuint sampler;
+ GLuint sampler;
- bool hasBorderColor = false;
- bx::HashMurmur2A murmur;
- uint32_t hash;
+ bool hasBorderColor = false;
+ bx::HashMurmur2A murmur;
+ uint32_t hash;
- murmur.begin();
- murmur.add(_flags);
- if (!needBorderColor(_flags) )
- {
- murmur.add(-1);
- hash = murmur.end();
+ murmur.begin();
+ murmur.add(_flags);
+ if (!needBorderColor(_flags) )
+ {
+ murmur.add(-1);
+ hash = murmur.end();
- sampler = m_samplerStateCache.find(hash);
+ sampler = m_samplerStateCache.find(hash);
+ }
+ else
+ {
+ murmur.add(index);
+ hash = murmur.end();
+
+ if (NULL != _rgba)
+ {
+ hasBorderColor = true;
+ sampler = UINT32_MAX;
}
else
{
- murmur.add(index);
- hash = murmur.end();
-
- if (NULL != _rgba)
- {
- hasBorderColor = true;
- sampler = UINT32_MAX;
- }
- else
- {
- sampler = m_samplerStateCache.find(hash);
- }
+ sampler = m_samplerStateCache.find(hash);
}
+ }
- if (UINT32_MAX == sampler)
- {
- sampler = m_samplerStateCache.add(hash);
+ if (UINT32_MAX == sampler)
+ {
+ sampler = m_samplerStateCache.add(hash);
- GL_CHECK(glSamplerParameteri(sampler
- , GL_TEXTURE_WRAP_S
- , s_textureAddress[(_flags&BGFX_SAMPLER_U_MASK)>>BGFX_SAMPLER_U_SHIFT]
- ) );
- GL_CHECK(glSamplerParameteri(sampler
- , GL_TEXTURE_WRAP_T
- , s_textureAddress[(_flags&BGFX_SAMPLER_V_MASK)>>BGFX_SAMPLER_V_SHIFT]
- ) );
- GL_CHECK(glSamplerParameteri(sampler
- , GL_TEXTURE_WRAP_R
- , s_textureAddress[(_flags&BGFX_SAMPLER_W_MASK)>>BGFX_SAMPLER_W_SHIFT]
- ) );
+ GL_CHECK(glSamplerParameteri(sampler
+ , GL_TEXTURE_WRAP_S
+ , s_textureAddress[(_flags&BGFX_SAMPLER_U_MASK)>>BGFX_SAMPLER_U_SHIFT]
+ ) );
+ GL_CHECK(glSamplerParameteri(sampler
+ , GL_TEXTURE_WRAP_T
+ , s_textureAddress[(_flags&BGFX_SAMPLER_V_MASK)>>BGFX_SAMPLER_V_SHIFT]
+ ) );
+ GL_CHECK(glSamplerParameteri(sampler
+ , GL_TEXTURE_WRAP_R
+ , s_textureAddress[(_flags&BGFX_SAMPLER_W_MASK)>>BGFX_SAMPLER_W_SHIFT]
+ ) );
- GLenum minFilter;
- GLenum magFilter;
- getFilters(_flags, 1 < _numMips, magFilter, minFilter);
- GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, magFilter) );
- GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, minFilter) );
+ GLenum minFilter;
+ GLenum magFilter;
+ getFilters(_flags, 1 < _numMips, magFilter, minFilter);
+ GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, magFilter) );
+ GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, minFilter) );
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) )
- {
- GL_CHECK(glSamplerParameterf(sampler, GL_TEXTURE_LOD_BIAS, float(BGFX_CONFIG_MIP_LOD_BIAS) ) );
- }
+ if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) )
+ {
+ GL_CHECK(glSamplerParameterf(sampler, GL_TEXTURE_LOD_BIAS, float(BGFX_CONFIG_MIP_LOD_BIAS) ) );
+ }
- if (m_borderColorSupport
- && hasBorderColor)
- {
- GL_CHECK(glSamplerParameterfv(sampler, GL_TEXTURE_BORDER_COLOR, _rgba) );
- }
+ if (m_borderColorSupport
+ && hasBorderColor)
+ {
+ GL_CHECK(glSamplerParameterfv(sampler, GL_TEXTURE_BORDER_COLOR, _rgba) );
+ }
- if (0 != (_flags & (BGFX_SAMPLER_MIN_ANISOTROPIC|BGFX_SAMPLER_MAG_ANISOTROPIC) )
- && 0.0f < m_maxAnisotropy)
+ if (0 != (_flags & (BGFX_SAMPLER_MIN_ANISOTROPIC|BGFX_SAMPLER_MAG_ANISOTROPIC) )
+ && 0.0f < m_maxAnisotropy)
+ {
+ GL_CHECK(glSamplerParameterf(sampler, GL_TEXTURE_MAX_ANISOTROPY_EXT, m_maxAnisotropy) );
+ }
+
+ if (m_gles3
+ || m_shadowSamplersSupport)
+ {
+ const uint32_t cmpFunc = (_flags&BGFX_SAMPLER_COMPARE_MASK)>>BGFX_SAMPLER_COMPARE_SHIFT;
+ if (0 == cmpFunc)
{
- GL_CHECK(glSamplerParameterf(sampler, GL_TEXTURE_MAX_ANISOTROPY_EXT, m_maxAnisotropy) );
+ GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_COMPARE_MODE, GL_NONE) );
}
-
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30)
- || m_shadowSamplersSupport)
+ else
{
- const uint32_t cmpFunc = (_flags&BGFX_SAMPLER_COMPARE_MASK)>>BGFX_SAMPLER_COMPARE_SHIFT;
- if (0 == cmpFunc)
- {
- GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_COMPARE_MODE, GL_NONE) );
- }
- else
- {
- GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE) );
- GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_COMPARE_FUNC, s_cmpFunc[cmpFunc]) );
- }
+ GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_COMPARE_MODE, GL_COMPARE_REF_TO_TEXTURE) );
+ GL_CHECK(glSamplerParameteri(sampler, GL_TEXTURE_COMPARE_FUNC, s_cmpFunc[cmpFunc]) );
}
}
-
- GL_CHECK(glBindSampler(_stage, sampler) );
- }
- else
- {
- GL_CHECK(glBindSampler(_stage, 0) );
}
+
+ GL_CHECK(glBindSampler(_stage, sampler) );
+ }
+ else
+ {
+ GL_CHECK(glBindSampler(_stage, 0) );
}
}
@@ -4105,10 +4349,11 @@ namespace bgfx { namespace gl
void* data = BX_ALLOC(g_allocator, length);
if (g_callback->cacheRead(_id, data, length) )
{
+ bx::Error err;
bx::MemoryReader reader(data, length);
GLenum format;
- bx::read(&reader, format);
+ bx::read(&reader, format, &err);
GL_CHECK(glProgramBinary(programId, format, reader.getDataPtr(), (GLsizei)reader.remaining() ) );
}
@@ -4197,6 +4442,7 @@ namespace bgfx { namespace gl
setUniform1i(loc, *(int32_t*)data);
}
break;
+
case UniformType::Vec4:
if (num > 1)
{
@@ -4216,7 +4462,8 @@ namespace bgfx { namespace gl
case UniformType::Vec4:
setUniform4fv(loc, num, (float*)data);
break;
-#endif
+#endif // BX_PLATFORM_EMSCRIPTEN
+
case UniformType::Mat3:
setUniformMatrix3fv(loc, num, GL_FALSE, (float*)data);
break;
@@ -4346,14 +4593,18 @@ namespace bgfx { namespace gl
{
const UniformRegInfo* infoClearColor = m_uniformReg.find("bgfx_clear_color");
if (NULL != infoClearColor)
+ {
m_clearQuadColor = infoClearColor->m_handle;
+ }
}
if (m_clearQuadDepth.idx == kInvalidHandle)
{
const UniformRegInfo* infoClearDepth = m_uniformReg.find("bgfx_clear_depth");
if (NULL != infoClearDepth)
+ {
m_clearQuadDepth = infoClearDepth->m_handle;
+ }
}
float mrtClearDepth[4] = { g_caps.homogeneousDepth ? (_clear.m_depth * 2.0f - 1.0f) : _clear.m_depth };
@@ -4542,7 +4793,11 @@ namespace bgfx { namespace gl
GLenum m_readPixelsFmt;
GLuint m_backBufferFbo;
GLuint m_msaaBackBufferFbo;
- GLuint m_msaaBackBufferRbos[2];
+ union {
+ GLuint m_msaaBackBufferRbos[2];
+ GLuint m_msaaBackBufferTextures[2];
+ };
+ GLuint m_msaaBlitProgram;
GlContext m_glctx;
bool m_needPresent;
@@ -5121,13 +5376,16 @@ namespace bgfx { namespace gl
m_usedCount = (uint8_t)used;
used = 0;
- for (uint32_t ii = 0; ii < BX_COUNTOF(s_instanceDataName); ++ii)
+ for (uint32_t ii = 0, baseVertex = 0; ii < BX_COUNTOF(s_instanceDataName); ++ii, baseVertex += 16)
{
GLint loc = glGetAttribLocation(m_id, s_instanceDataName[ii]);
if (-1 != loc)
{
BX_TRACE("instance data %s: %d", s_instanceDataName[ii], loc);
- m_instanceData[used++] = loc;
+ m_instanceData[used] = loc;
+ m_instanceOffset[used] = uint16_t(baseVertex);
+
+ used++;
}
}
BX_ASSERT(used < BX_COUNTOF(m_instanceData)
@@ -5140,7 +5398,7 @@ namespace bgfx { namespace gl
void ProgramGL::bindAttributesBegin()
{
- bx::memCopy(m_unboundUsedAttrib, m_used, sizeof(m_unboundUsedAttrib));
+ bx::memCopy(m_unboundUsedAttrib, m_used, sizeof(m_unboundUsedAttrib) );
}
void ProgramGL::bindAttributes(const VertexLayout& _layout, uint32_t _baseVertex)
@@ -5164,8 +5422,8 @@ namespace bgfx { namespace gl
GL_CHECK(glVertexAttribDivisor(loc, 0) );
uint32_t baseVertex = _baseVertex*_layout.m_stride + _layout.m_offset[attr];
- if ( (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL >= 30) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 31) )
- && (AttribType::Uint8 == type || AttribType::Int16 == type)
+ if ( (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL >= 30) || s_renderGL->m_gles3)
+ && !isFloat(type)
&& !normalized)
{
GL_CHECK(glVertexAttribIPointer(loc
@@ -5194,14 +5452,14 @@ namespace bgfx { namespace gl
void ProgramGL::bindInstanceData(uint32_t _stride, uint32_t _baseVertex) const
{
- uint32_t baseVertex = _baseVertex;
for (uint32_t ii = 0; -1 != m_instanceData[ii]; ++ii)
{
GLint loc = m_instanceData[ii];
lazyEnableVertexAttribArray(loc);
- GL_CHECK(glVertexAttribPointer(loc, 4, GL_FLOAT, GL_FALSE, _stride, (void*)(uintptr_t)baseVertex));
- GL_CHECK(glVertexAttribDivisor(loc, 1));
- baseVertex += 16;
+
+ const uint32_t baseVertex = _baseVertex + m_instanceOffset[ii];
+ GL_CHECK(glVertexAttribPointer(loc, 4, GL_FLOAT, GL_FALSE, _stride, (void*)(uintptr_t)baseVertex) );
+ GL_CHECK(glVertexAttribDivisor(loc, 1) );
}
}
@@ -5382,7 +5640,7 @@ namespace bgfx { namespace gl
, _height
) );
}
- else if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL || BGFX_CONFIG_RENDERER_OPENGLES >= 30) )
+ else if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || s_renderGL->m_gles3)
{
GL_CHECK(glRenderbufferStorageMultisample(GL_RENDERBUFFER
, msaaQuality
@@ -5637,6 +5895,23 @@ namespace bgfx { namespace gl
}
}
+ GLint mapping[4] = {
+ s_textureFormat[m_textureFormat].m_mapping[0],
+ s_textureFormat[m_textureFormat].m_mapping[1],
+ s_textureFormat[m_textureFormat].m_mapping[2],
+ s_textureFormat[m_textureFormat].m_mapping[3],
+ };
+ if (s_renderGL->m_textureSwizzleSupport
+ && (-1 != mapping[0] || -1 != mapping[1] || -1 != mapping[2] || -1 != mapping[3]) )
+ {
+ mapping[0] = -1 == mapping[0] ? GL_RED : mapping[0];
+ mapping[1] = -1 == mapping[1] ? GL_GREEN : mapping[1];
+ mapping[2] = -1 == mapping[2] ? GL_BLUE : mapping[2];
+ mapping[3] = -1 == mapping[3] ? GL_ALPHA : mapping[3];
+
+ GL_CHECK(glTexParameteriv(m_target, GL_TEXTURE_SWIZZLE_RGBA, mapping));
+ }
+
if (NULL != temp)
{
BX_FREE(g_allocator, temp);
@@ -5696,8 +5971,16 @@ namespace bgfx { namespace gl
|| swizzle
;
- const uint32_t width = _rect.m_width;
- const uint32_t height = _rect.m_height;
+ Rect rect;
+ rect.setIntersect(_rect
+ , {
+ 0, 0,
+ uint16_t(bx::max(1u, m_width >> _mip) ),
+ uint16_t(bx::max(1u, m_height >> _mip) ),
+ });
+
+ uint32_t width = rect.m_width;
+ uint32_t height = rect.m_height;
uint8_t* temp = NULL;
if (convert
@@ -5720,17 +6003,17 @@ namespace bgfx { namespace gl
bimg::imageCopy(temp, width, height, 1, bpp, srcpitch, data);
data = temp;
}
- const GLenum internalFmt = (0 != (m_flags & BGFX_TEXTURE_SRGB))
+ const GLenum internalFmt = (0 != (m_flags & BGFX_TEXTURE_SRGB) )
? s_textureFormat[m_textureFormat].m_internalFmtSrgb
: s_textureFormat[m_textureFormat].m_internalFmt
;
GL_CHECK(compressedTexSubImage(target+_side
, _mip
- , _rect.m_x
- , _rect.m_y
+ , rect.m_x
+ , rect.m_y
, _z
- , _rect.m_width
- , _rect.m_height
+ , rect.m_width
+ , rect.m_height
, _depth
, internalFmt
, _mem->size
@@ -5758,11 +6041,11 @@ namespace bgfx { namespace gl
GL_CHECK(texSubImage(target+_side
, _mip
- , _rect.m_x
- , _rect.m_y
+ , rect.m_x
+ , rect.m_y
, _z
- , _rect.m_width
- , _rect.m_height
+ , rect.m_width
+ , rect.m_height
, _depth
, m_fmt
, m_type
@@ -5784,7 +6067,7 @@ namespace bgfx { namespace gl
void TextureGL::setSamplerState(uint32_t _flags, const float _rgba[4])
{
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES < 30)
+ if (!s_renderGL->m_gles3
&& !s_textureFilter[m_textureFormat])
{
// Force point sampling when texture format doesn't support linear sampling.
@@ -5827,7 +6110,7 @@ namespace bgfx { namespace gl
GL_CHECK(glTexParameteri(target, GL_TEXTURE_WRAP_S, s_textureAddress[(flags&BGFX_SAMPLER_U_MASK)>>BGFX_SAMPLER_U_SHIFT]) );
GL_CHECK(glTexParameteri(target, GL_TEXTURE_WRAP_T, s_textureAddress[(flags&BGFX_SAMPLER_V_MASK)>>BGFX_SAMPLER_V_SHIFT]) );
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL || BGFX_CONFIG_RENDERER_OPENGLES >= 30)
+ if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || s_renderGL->m_gles3
|| s_extension[Extension::APPLE_texture_max_level].m_supported)
{
GL_CHECK(glTexParameteri(targetMsaa, GL_TEXTURE_MAX_LEVEL, numMips-1) );
@@ -5861,7 +6144,7 @@ namespace bgfx { namespace gl
GL_CHECK(glTexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, s_renderGL->m_maxAnisotropy) );
}
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30)
+ if (s_renderGL->m_gles3
|| s_renderGL->m_shadowSamplersSupport)
{
const uint32_t cmpFunc = (flags&BGFX_SAMPLER_COMPARE_MASK)>>BGFX_SAMPLER_COMPARE_SHIFT;
@@ -5891,29 +6174,13 @@ namespace bgfx { namespace gl
GL_CHECK(glActiveTexture(GL_TEXTURE0+_stage) );
GL_CHECK(glBindTexture(m_target, m_id) );
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES)
- && BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES < 30) )
+ if (s_renderGL->m_samplerObjectSupport)
{
- // GLES2 doesn't have support for sampler object.
- setSamplerState(flags, _palette[index]);
- }
- else if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
- && BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL < 31) )
- {
- // In case that GL 2.1 sampler object is supported via extension.
- if (s_renderGL->m_samplerObjectSupport)
- {
- s_renderGL->setSamplerState(_stage, m_numMips, flags, _palette[index]);
- }
- else
- {
- setSamplerState(flags, _palette[index]);
- }
+ s_renderGL->setSamplerState(_stage, m_numMips, flags, _palette[index]);
}
else
{
- // Everything else has sampler object.
- s_renderGL->setSamplerState(_stage, m_numMips, flags, _palette[index]);
+ setSamplerState(flags, _palette[index]);
}
}
@@ -5942,8 +6209,10 @@ namespace bgfx { namespace gl
bx::MemoryReader reader(_mem->data, _mem->size);
m_hash = bx::hash<bx::HashMurmur2A>(_mem->data, _mem->size);
+ bx::ErrorAssert err;
+
uint32_t magic;
- bx::read(&reader, magic);
+ bx::read(&reader, magic, &err);
if (isShaderType(magic, 'C') )
{
@@ -5959,7 +6228,7 @@ namespace bgfx { namespace gl
}
uint32_t hashIn;
- bx::read(&reader, hashIn);
+ bx::read(&reader, hashIn, &err);
uint32_t hashOut;
@@ -5969,11 +6238,11 @@ namespace bgfx { namespace gl
}
else
{
- bx::read(&reader, hashOut);
+ bx::read(&reader, hashOut, &err);
}
uint16_t count;
- bx::read(&reader, count);
+ bx::read(&reader, count, &err);
BX_TRACE("%s Shader consts %d"
, getShaderTypeName(magic)
@@ -5983,39 +6252,39 @@ namespace bgfx { namespace gl
for (uint32_t ii = 0; ii < count; ++ii)
{
uint8_t nameSize = 0;
- bx::read(&reader, nameSize);
+ bx::read(&reader, nameSize, &err);
char name[256];
- bx::read(&reader, &name, nameSize);
+ bx::read(&reader, &name, nameSize, &err);
name[nameSize] = '\0';
uint8_t type;
- bx::read(&reader, type);
+ bx::read(&reader, type, &err);
uint8_t num;
- bx::read(&reader, num);
+ bx::read(&reader, num, &err);
uint16_t regIndex;
- bx::read(&reader, regIndex);
+ bx::read(&reader, regIndex, &err);
uint16_t regCount;
- bx::read(&reader, regCount);
+ bx::read(&reader, regCount, &err);
if (!isShaderVerLess(magic, 8) )
{
uint16_t texInfo = 0;
- bx::read(&reader, texInfo);
+ bx::read(&reader, texInfo, &err);
}
if (!isShaderVerLess(magic, 10) )
{
uint16_t texFormat = 0;
- bx::read(&reader, texFormat);
+ bx::read(&reader, texFormat, &err);
}
}
uint32_t shaderSize;
- bx::read(&reader, shaderSize);
+ bx::read(&reader, shaderSize, &err);
m_id = glCreateShader(m_type);
BX_WARN(0 != m_id, "Failed to create shader.");
@@ -6031,8 +6300,6 @@ namespace bgfx { namespace gl
char* temp = (char*)alloca(tempLen);
bx::StaticMemoryBlockWriter writer(temp, tempLen);
- bx::Error err;
-
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES)
&& !s_renderGL->m_gles3)
{
@@ -6041,6 +6308,7 @@ namespace bgfx { namespace gl
"#define flat\n"
"#define noperspective\n"
"#define smooth\n"
+ , &err
);
bool usesDerivatives = s_extension[Extension::OES_standard_derivatives].m_supported
@@ -6060,7 +6328,7 @@ namespace bgfx { namespace gl
if (usesDerivatives)
{
- bx::write(&writer, "#extension GL_OES_standard_derivatives : enable\n");
+ bx::write(&writer, "#extension GL_OES_standard_derivatives : enable\n", &err);
}
if (usesFragData)
@@ -6069,7 +6337,7 @@ namespace bgfx { namespace gl
|| s_extension[Extension::WEBGL_draw_buffers].m_supported
, "EXT_draw_buffers is used but not supported by GLES2 driver."
);
- bx::write(&writer, "#extension GL_EXT_draw_buffers : enable\n");
+ bx::write(&writer, "#extension GL_EXT_draw_buffers : enable\n", &err);
}
bool insertFragDepth = false;
@@ -6081,13 +6349,14 @@ namespace bgfx { namespace gl
bx::write(&writer
, "#extension GL_EXT_frag_depth : enable\n"
"#define bgfx_FragDepth gl_FragDepthEXT\n"
+ , &err
);
char str[128];
bx::snprintf(str, BX_COUNTOF(str), "%s float gl_FragDepthEXT;\n"
, s_extension[Extension::OES_fragment_precision_high].m_supported ? "highp" : "mediump"
);
- bx::write(&writer, str);
+ bx::write(&writer, str, &err);
}
else
{
@@ -6103,6 +6372,7 @@ namespace bgfx { namespace gl
, "#extension GL_EXT_shadow_samplers : enable\n"
"#define shadow2D shadow2DEXT\n"
"#define shadow2DProj shadow2DProjEXT\n"
+ , &err
);
}
else
@@ -6111,13 +6381,14 @@ namespace bgfx { namespace gl
, "#define sampler2DShadow sampler2D\n"
"#define shadow2D(_sampler, _coord) step(_coord.z, texture2D(_sampler, _coord.xy).x)\n"
"#define shadow2DProj(_sampler, _coord) step(_coord.z/_coord.w, texture2DProj(_sampler, _coord).x)\n"
+ , &err
);
}
}
if (usesTexture3D)
{
- bx::write(&writer, "#extension GL_OES_texture_3D : enable\n");
+ bx::write(&writer, "#extension GL_OES_texture_3D : enable\n", &err);
}
if (usesTextureLod)
@@ -6137,6 +6408,7 @@ namespace bgfx { namespace gl
"#define texture2DGrad texture2DGradARB\n"
"#define texture2DProjGrad texture2DProjGradARB\n"
"#define textureCubeGrad textureCubeGradARB\n"
+ , &err
);
}
else
@@ -6148,6 +6420,7 @@ namespace bgfx { namespace gl
"#define texture2DLod texture2DLodEXT\n"
"#define texture2DProjLod texture2DProjLodEXT\n"
"#define textureCubeLod textureCubeLodEXT\n"
+ , &err
);
}
else
@@ -6156,6 +6429,7 @@ namespace bgfx { namespace gl
, "#define texture2DLod(_sampler, _coord, _level) texture2D(_sampler, _coord)\n"
"#define texture2DProjLod(_sampler, _coord, _level) texture2DProj(_sampler, _coord)\n"
"#define textureCubeLod(_sampler, _coord, _level) textureCube(_sampler, _coord)\n"
+ , &err
);
}
}
@@ -6165,11 +6439,11 @@ namespace bgfx { namespace gl
{
if (s_extension[Extension::INTEL_fragment_shader_ordering].m_supported)
{
- bx::write(&writer, "#extension GL_INTEL_fragment_shader_ordering : enable\n");
+ bx::write(&writer, "#extension GL_INTEL_fragment_shader_ordering : enable\n", &err);
}
else
{
- bx::write(&writer, "#define beginFragmentShaderOrdering()\n");
+ bx::write(&writer, "#define beginFragmentShaderOrdering()\n", &err);
}
}
@@ -6177,8 +6451,8 @@ namespace bgfx { namespace gl
, m_type == GL_FRAGMENT_SHADER ? "mediump" : "highp"
);
- bx::write(&writer, code);
- bx::write(&writer, '\0');
+ bx::write(&writer, code, &err);
+ bx::write(&writer, '\0', &err);
if (insertFragDepth)
{
@@ -6279,66 +6553,67 @@ namespace bgfx { namespace gl
"#define texture2DGrad texture2DGradARB\n"
"#define texture2DProjGrad texture2DProjGradARB\n"
"#define textureCubeGrad textureCubeGradARB\n"
+ , &err
);
}
}
if (usesInstanceID)
{
- bx::write(&writer, "#extension GL_ARB_draw_instanced : enable\n");
+ bx::write(&writer, "#extension GL_ARB_draw_instanced : enable\n", &err);
}
if (usesGpuShader4)
{
- bx::write(&writer, "#extension GL_EXT_gpu_shader4 : enable\n");
+ bx::write(&writer, "#extension GL_EXT_gpu_shader4 : enable\n", &err);
}
if (usesGpuShader5)
{
- bx::write(&writer, "#extension GL_ARB_gpu_shader5 : enable\n");
+ bx::write(&writer, "#extension GL_ARB_gpu_shader5 : enable\n", &err);
}
if (usesViewportLayerArray)
{
- bx::write(&writer, "#extension GL_ARB_shader_viewport_layer_array : enable\n");
+ bx::write(&writer, "#extension GL_ARB_shader_viewport_layer_array : enable\n", &err);
}
if (usesPacking)
{
- bx::write(&writer, "#extension GL_ARB_shading_language_packing : enable\n");
+ bx::write(&writer, "#extension GL_ARB_shading_language_packing : enable\n", &err);
}
if (usesTextureMS)
{
- bx::write(&writer, "#extension GL_ARB_texture_multisample : enable\n");
+ bx::write(&writer, "#extension GL_ARB_texture_multisample : enable\n", &err);
}
if (usesTextureArray)
{
- bx::write(&writer, "#extension GL_EXT_texture_array : enable\n");
+ bx::write(&writer, "#extension GL_EXT_texture_array : enable\n", &err);
if (BX_ENABLED(BX_PLATFORM_OSX) )
{
- bx::write(&writer, "#define texture2DArrayLod texture2DArray\n");
+ bx::write(&writer, "#define texture2DArrayLod texture2DArray\n", &err);
}
else
{
- bx::write(&writer, "#define texture2DArrayLodEXT texture2DArrayLod\n");
- bx::write(&writer, "#define textureArray texture\n");
+ bx::write(&writer, "#define texture2DArrayLodEXT texture2DArrayLod\n", &err);
+ bx::write(&writer, "#define textureArray texture\n", &err);
}
}
if (usesTexture3D)
{
- bx::write(&writer, "#define texture3DEXT texture3D\n");
+ bx::write(&writer, "#define texture3DEXT texture3D\n", &err);
if (BX_ENABLED(BX_PLATFORM_OSX) )
{
- bx::write(&writer, "#define texture3DLodEXT texture3D\n");
+ bx::write(&writer, "#define texture3DLodEXT texture3D\n", &err);
}
else
{
- bx::write(&writer, "#define texture3DLodEXT texture3DLod\n");
+ bx::write(&writer, "#define texture3DLodEXT texture3DLod\n", &err);
}
}
@@ -6348,12 +6623,12 @@ namespace bgfx { namespace gl
{
if (m_type == GL_FRAGMENT_SHADER)
{
- bx::write(&writer, "#define varying in\n");
+ bx::write(&writer, "#define varying in\n", &err);
}
else
{
- bx::write(&writer, "#define attribute in\n");
- bx::write(&writer, "#define varying out\n");
+ bx::write(&writer, "#define attribute in\n", &err);
+ bx::write(&writer, "#define varying out\n", &err);
}
}
@@ -6374,56 +6649,63 @@ namespace bgfx { namespace gl
if (0 != fragData)
{
bx::write(&writer, &err, "out vec4 bgfx_FragData[%d];\n", fragData);
- bx::write(&writer, "#define gl_FragData bgfx_FragData\n");
+ bx::write(&writer, "#define gl_FragData bgfx_FragData\n", &err);
}
else if (!bx::findIdentifierMatch(code, "gl_FragColor").isEmpty() )
{
- bx::write(&writer, "out vec4 bgfx_FragColor;\n");
- bx::write(&writer, "#define gl_FragColor bgfx_FragColor\n");
+ bx::write(&writer
+ , "out vec4 bgfx_FragColor;\n"
+ "#define gl_FragColor bgfx_FragColor\n"
+ , &err
+ );
}
}
else
{
if (m_type == GL_FRAGMENT_SHADER)
{
- bx::write(&writer, "#define in varying\n");
+ bx::write(&writer, "#define in varying\n", &err);
}
else
{
bx::write(&writer
, "#define in attribute\n"
"#define out varying\n"
+ , &err
);
}
}
- bx::write(&writer,
- "#define lowp\n"
- "#define mediump\n"
- "#define highp\n"
+ bx::write(&writer
+ , "#define lowp\n"
+ "#define mediump\n"
+ "#define highp\n"
+ , &err
);
if (!usesInterpQ)
{
- bx::write(&writer,
- "#define centroid\n"
- "#define flat\n"
- "#define noperspective\n"
- "#define smooth\n"
+ bx::write(&writer
+ ,
+ "#define centroid\n"
+ "#define flat\n"
+ "#define noperspective\n"
+ "#define smooth\n"
+ , &err
);
}
if (version == 430)
{
int32_t verLen = bx::strLen("#version 430\n");
- bx::write(&writer, code.getPtr()+verLen, code.getLength()-verLen);
+ bx::write(&writer, code.getPtr()+verLen, code.getLength()-verLen, &err);
}
else
{
- bx::write(&writer, code);
+ bx::write(&writer, code, &err);
}
- bx::write(&writer, '\0');
+ bx::write(&writer, '\0', &err);
}
else if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL >= 31)
|| s_renderGL->m_gles3)
@@ -6438,7 +6720,7 @@ namespace bgfx { namespace gl
}
else
{
- bx::write(&writer, "#version 140\n");
+ bx::write(&writer, "#version 140\n", &err);
}
bx::write(&writer
@@ -6448,33 +6730,47 @@ namespace bgfx { namespace gl
"#define texture2DGrad textureGrad\n"
"#define texture3DGrad textureGrad\n"
"#define textureCubeGrad textureGrad\n"
+ , &err
);
if (m_type == GL_FRAGMENT_SHADER)
{
bx::write(&writer
- , "#define varying in\n"
- "#define texture2D texture\n"
- "#define texture2DProj textureProj\n"
+ , "#define varying in\n"
+ "#define texture2D texture\n"
+ "#define texture2DArray texture\n"
+ "#define texture2DProj textureProj\n"
+ , &err
);
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) )
{
- bx::write(&writer, "#define shadow2D(_sampler, _coord) vec2(textureProj(_sampler, vec4(_coord, 1.0) ) )\n");
- bx::write(&writer, "#define shadow2DProj(_sampler, _coord) vec2(textureProj(_sampler, _coord) ) )\n");
+ bx::write(&writer
+ , "#define shadow2D(_sampler, _coord) vec2(textureProj(_sampler, vec4(_coord, 1.0) ) )\n"
+ "#define shadow2DProj(_sampler, _coord) vec2(textureProj(_sampler, _coord) )\n"
+ , &err
+ );
}
else
{
- bx::write(&writer, "#define shadow2D(_sampler, _coord) (textureProj(_sampler, vec4(_coord, 1.0) ) )\n");
- bx::write(&writer, "#define shadow2DProj(_sampler, _coord) (textureProj(_sampler, _coord) ) )\n");
+ bx::write(&writer
+ , "#define shadow2D(_sampler, _coord) (textureProj(_sampler, vec4(_coord, 1.0) ) )\n"
+ "#define shadow2DProj(_sampler, _coord) (textureProj(_sampler, _coord) )\n"
+ , &err
+ );
}
- bx::write(&writer, "#define texture3D texture\n");
- bx::write(&writer, "#define textureCube texture\n");
+ bx::write(&writer
+ , "#define texture3D texture\n"
+ "#define textureCube texture\n"
+ , &err
+ );
uint32_t fragData = 0;
- if (!bx::findIdentifierMatch(code, "gl_FragData").isEmpty() )
+ bool patchedFragData = s_renderGL->m_gles3 && !bx::findIdentifierMatch(code, "bgfx_FragData").isEmpty();
+
+ if (!patchedFragData && !bx::findIdentifierMatch(code, "gl_FragData").isEmpty() )
{
for (uint32_t ii = 0, num = g_caps.limits.maxFBAttachments; ii < num; ++ii)
{
@@ -6490,30 +6786,37 @@ namespace bgfx { namespace gl
{
if (s_extension[Extension::INTEL_fragment_shader_ordering].m_supported)
{
- bx::write(&writer, "#extension GL_INTEL_fragment_shader_ordering : enable\n");
+ bx::write(&writer, "#extension GL_INTEL_fragment_shader_ordering : enable\n", &err);
}
else
{
- bx::write(&writer, "#define beginFragmentShaderOrdering()\n");
+ bx::write(&writer, "#define beginFragmentShaderOrdering()\n", &err);
}
}
if (!bx::findIdentifierMatch(code, s_ARB_texture_multisample).isEmpty() )
{
- bx::write(&writer, "#extension GL_ARB_texture_multisample : enable\n");
+ bx::write(&writer, "#extension GL_ARB_texture_multisample : enable\n", &err);
}
if (0 != fragData)
{
- bx::write(&writer, &err, "out vec4 bgfx_FragData[%d];\n", fragData);
- bx::write(&writer, "#define gl_FragData bgfx_FragData\n");
+ if (!patchedFragData)
+ {
+ bx::write(&writer, &err, "out vec4 bgfx_FragData[%d];\n", fragData);
+ bx::write(&writer, "#define gl_FragData bgfx_FragData\n", &err);
+ }
}
- else
+ else if (!patchedFragData)
{
- bx::write(&writer
- , "out vec4 bgfx_FragColor;\n"
- "#define gl_FragColor bgfx_FragColor\n"
- );
+ if (bx::findIdentifierMatch(code, "bgfx_FragColor").isEmpty() )
+ {
+ bx::write(&writer
+ , "out vec4 bgfx_FragColor;\n"
+ "#define gl_FragColor bgfx_FragColor\n"
+ , &err
+ );
+ }
}
}
else
@@ -6521,20 +6824,22 @@ namespace bgfx { namespace gl
bx::write(&writer
, "#define attribute in\n"
"#define varying out\n"
+ , &err
);
}
- if (!BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) )
+ if (!s_renderGL->m_gles3)
{
bx::write(&writer
, "#define lowp\n"
"#define mediump\n"
"#define highp\n"
+ , &err
);
}
- bx::write(&writer, code.getPtr(), code.getLength() );
- bx::write(&writer, '\0');
+ bx::write(&writer, code.getPtr(), code.getLength(), &err);
+ bx::write(&writer, '\0', &err);
}
code.set(temp);
@@ -6557,11 +6862,12 @@ namespace bgfx { namespace gl
"#define texture2DGrad textureGrad\n"
"#define texture3DGrad textureGrad\n"
"#define textureCubeGrad textureGrad\n"
+ , &err
);
int32_t verLen = bx::strLen("#version 430\n");
- bx::write(&writer, code.getPtr()+verLen, codeLen-verLen);
- bx::write(&writer, '\0');
+ bx::write(&writer, code.getPtr()+verLen, codeLen-verLen, &err);
+ bx::write(&writer, '\0', &err);
code = temp;
}
@@ -6584,7 +6890,7 @@ namespace bgfx { namespace gl
{
bx::StringView str = lineReader.next();
BX_TRACE("%3d %.*s", line, str.getLength(), str.getPtr() );
- BX_UNUSED(str);
+ BX_UNUSED(str, line);
}
GLsizei len;
@@ -6683,8 +6989,8 @@ namespace bgfx { namespace gl
if (0 != texture.m_rbo)
{
-#if !(BGFX_CONFIG_RENDERER_OPENGL >= 30 || BGFX_CONFIG_RENDERER_OPENGLES >= 30)
- if (GL_DEPTH_STENCIL_ATTACHMENT == attachment)
+ if (!(BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL >= 30) || s_renderGL->m_gles3)
+ && GL_DEPTH_STENCIL_ATTACHMENT == attachment)
{
GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER
, GL_DEPTH_ATTACHMENT
@@ -6698,7 +7004,6 @@ namespace bgfx { namespace gl
) );
}
else
-#endif
{
GL_CHECK(glFramebufferRenderbuffer(GL_FRAMEBUFFER
, attachment
@@ -6754,22 +7059,19 @@ namespace bgfx { namespace gl
m_num = uint8_t(colorIdx);
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL || BGFX_CONFIG_RENDERER_OPENGLES >= 31) )
+ if (0 == colorIdx && BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) )
{
- if (0 == colorIdx)
- {
- if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) )
- {
- // When only depth is attached disable draw buffer to avoid
- // GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER.
- GL_CHECK(glDrawBuffer(GL_NONE) );
- }
- }
- else
- {
- GL_CHECK(glDrawBuffers(colorIdx, buffers) );
- }
+ // When only depth is attached disable draw buffer to avoid
+ // GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER.
+ GL_CHECK(glDrawBuffer(GL_NONE) );
+ }
+ else if (g_caps.limits.maxFBAttachments > 0)
+ {
+ GL_CHECK(glDrawBuffers(colorIdx, buffers) );
+ }
+ if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || s_renderGL->m_gles3)
+ {
// Disable read buffer to avoid GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER.
GL_CHECK(glReadBuffer(GL_NONE) );
}
@@ -6850,7 +7152,7 @@ namespace bgfx { namespace gl
uint16_t FrameBufferGL::destroy()
{
- if (0 != m_num)
+ if (0 != m_fbo[0])
{
GL_CHECK(glDeleteFramebuffers(0 == m_fbo[1] ? 1 : 2, m_fbo) );
m_num = 0;
@@ -6889,12 +7191,16 @@ namespace bgfx { namespace gl
if (!bimg::isDepth(format) )
{
- GL_CHECK(glDisable(GL_SCISSOR_TEST));
+ GL_CHECK(glDisable(GL_SCISSOR_TEST) );
+
GL_CHECK(glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo[0]) );
GL_CHECK(glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fbo[1]) );
+
GL_CHECK(glReadBuffer(GL_COLOR_ATTACHMENT0 + colorIdx) );
GL_CHECK(glDrawBuffer(GL_COLOR_ATTACHMENT0 + colorIdx) );
+
colorIdx++;
+
GL_CHECK(glBlitFramebuffer(0
, 0
, m_width
@@ -6906,18 +7212,14 @@ namespace bgfx { namespace gl
, GL_COLOR_BUFFER_BIT
, GL_LINEAR
) );
+ }
+ else if (!writeOnly)
+ {
+ GL_CHECK(glDisable(GL_SCISSOR_TEST) );
- } else if (!writeOnly) {
- GL_CHECK(glDisable(GL_SCISSOR_TEST));
- // blit depth attachment as well if it doesn't have
- // BGFX_TEXTURE_RT_WRITE_ONLY render target flag. In most cases it's
- // not necessary to blit the depth buffer.
GL_CHECK(glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo[0]) );
GL_CHECK(glBindFramebuffer(GL_DRAW_FRAMEBUFFER, m_fbo[1]) );
- // OpenGL complains about missing buffer if set
- // attachment. not sure what I'm missing...
- // GL_CHECK(glReadBuffer(GL_DEPTH_ATTACHMENT) );
- // GL_CHECK(glDrawBuffer(GL_DEPTH_ATTACHMENT) );
+
GL_CHECK(glBlitFramebuffer(0
, 0
, m_width
@@ -6934,7 +7236,12 @@ namespace bgfx { namespace gl
}
GL_CHECK(glBindFramebuffer(GL_READ_FRAMEBUFFER, m_fbo[0]) );
- GL_CHECK(glReadBuffer(GL_NONE) );
+
+ if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL) || s_renderGL->m_gles3)
+ {
+ GL_CHECK(glReadBuffer(GL_NONE) );
+ }
+
GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, s_renderGL->m_msaaBackBufferFbo) );
}
@@ -7103,7 +7410,7 @@ namespace bgfx { namespace gl
const TextureGL& src = m_textures[bi.m_src.idx];
const TextureGL& dst = m_textures[bi.m_dst.idx];
- BX_ASSERT(0 == bi.m_srcZ && 0 == bi.m_dstZ && 0 == bi.m_depth
+ BX_ASSERT(0 == bi.m_srcZ && 0 == bi.m_dstZ && 1 >= bi.m_depth
, "Blitting 3D regions is not supported"
);
@@ -7137,7 +7444,7 @@ namespace bgfx { namespace gl
) );
GL_CHECK(glDeleteFramebuffers(1, &fbo) );
- GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, 0) );
+ GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, m_currentFbo) );
}
}
}
@@ -7181,7 +7488,7 @@ namespace bgfx { namespace gl
if (m_timerQuerySupport
&& !BX_ENABLED(BX_PLATFORM_OSX) )
{
- frameQueryIdx = m_gpuTimer.begin(BGFX_CONFIG_MAX_VIEWS);
+ frameQueryIdx = m_gpuTimer.begin(BGFX_CONFIG_MAX_VIEWS, _render->m_frameNum);
}
if (0 < _render->m_iboffset)
@@ -7605,8 +7912,8 @@ namespace bgfx { namespace gl
| BGFX_STATE_BLEND_MASK
| BGFX_STATE_CONSERVATIVE_RASTER
| BGFX_STATE_CULL_MASK
- | BGFX_STATE_DEPTH_TEST_MASK
| BGFX_STATE_FRONT_CCW
+ | BGFX_STATE_DEPTH_TEST_MASK
| BGFX_STATE_LINEAA
| BGFX_STATE_MSAA
| BGFX_STATE_POINT_SIZE_MASK
@@ -8082,6 +8389,19 @@ namespace bgfx { namespace gl
GL_CHECK(glBindBuffer(GL_DRAW_INDIRECT_BUFFER, vb.m_id) );
}
+ uint32_t numOffsetIndirect = 0;
+ if (isValid(draw.m_numIndirectBuffer) )
+ {
+ if (currentState.m_numIndirectBuffer.idx != draw.m_numIndirectBuffer.idx)
+ {
+ const IndexBufferGL& nb = m_indexBuffers[draw.m_numIndirectBuffer.idx];
+ currentState.m_numIndirectBuffer = draw.m_numIndirectBuffer;
+ GL_CHECK(glBindBuffer(GL_PARAMETER_BUFFER_ARB, nb.m_id) );
+ }
+
+ numOffsetIndirect = draw.m_numIndirectIndex * sizeof(uint32_t);
+ }
+
if (isValid(draw.m_indexBuffer) )
{
const IndexBufferGL& ib = m_indexBuffers[draw.m_indexBuffer.idx];
@@ -8097,11 +8417,24 @@ namespace bgfx { namespace gl
;
uintptr_t args = draw.m_startIndirect * BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
- GL_CHECK(glMultiDrawElementsIndirect(prim.m_type, indexFormat
- , (void*)args
- , numDrawIndirect
- , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
- ) );
+
+ if (isValid(draw.m_numIndirectBuffer) )
+ {
+ GL_CHECK(glMultiDrawElementsIndirectCount(prim.m_type, indexFormat
+ , (void*)args
+ , numOffsetIndirect
+ , numDrawIndirect
+ , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
+ ) );
+ }
+ else
+ {
+ GL_CHECK(glMultiDrawElementsIndirect(prim.m_type, indexFormat
+ , (void*)args
+ , numDrawIndirect
+ , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
+ ) );
+ }
}
else
{
@@ -8111,11 +8444,24 @@ namespace bgfx { namespace gl
;
uintptr_t args = draw.m_startIndirect * BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
- GL_CHECK(glMultiDrawArraysIndirect(prim.m_type
- , (void*)args
- , numDrawIndirect
- , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
- ) );
+
+ if (isValid(draw.m_numIndirectBuffer) )
+ {
+ GL_CHECK(glMultiDrawArraysIndirectCount(prim.m_type
+ , (void*)args
+ , numOffsetIndirect
+ , numDrawIndirect
+ , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
+ ) );
+ }
+ else
+ {
+ GL_CHECK(glMultiDrawArraysIndirect(prim.m_type
+ , (void*)args
+ , numDrawIndirect
+ , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
+ ) );
+ }
}
}
else
@@ -8124,6 +8470,12 @@ namespace bgfx { namespace gl
{
currentState.m_indirectBuffer.idx = kInvalidHandle;
GL_CHECK(glBindBuffer(GL_DRAW_INDIRECT_BUFFER, 0) );
+
+ if (isValid(currentState.m_numIndirectBuffer) )
+ {
+ currentState.m_numIndirectBuffer.idx = kInvalidHandle;
+ GL_CHECK(glBindBuffer(GL_PARAMETER_BUFFER_ARB, 0) );
+ }
}
if (isValid(draw.m_indexBuffer) )
@@ -8270,6 +8622,7 @@ namespace bgfx { namespace gl
perfStats.numCompute = statsKeyType[1];
perfStats.numBlit = _render->m_numBlitItems;
perfStats.maxGpuLatency = maxGpuLatency;
+ perfStats.gpuFrameNum = result.m_frameNum;
bx::memCopy(perfStats.numPrims, statsNumPrimsRendered, sizeof(perfStats.numPrims) );
perfStats.gpuMemoryMax = -INT64_MAX;
perfStats.gpuMemoryUsed = -INT64_MAX;
diff --git a/3rdparty/bgfx/src/renderer_gl.h b/3rdparty/bgfx/src/renderer_gl.h
index d52efc768c6..4c2942a03b8 100644
--- a/3rdparty/bgfx/src/renderer_gl.h
+++ b/3rdparty/bgfx/src/renderer_gl.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_RENDERER_GL_H_HEADER_GUARD
@@ -87,6 +87,12 @@
# undef GL_VERSION_1_4
# undef GL_VERSION_1_5
# undef GL_VERSION_2_0
+# elif BX_PLATFORM_WINDOWS
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif // WIN32_LEAN_AND_MEAN
+# include <windows.h>
+# include <GL/gl.h>
# else
# include <GL/gl.h>
# endif // BX_PLATFORM_
@@ -156,6 +162,10 @@ typedef uint64_t GLuint64;
# define GL_LUMINANCE 0x1909
#endif // GL_LUMINANCE
+#ifndef GL_BGR
+# define GL_BGR 0x80E0
+#endif // GL_BGR
+
#ifndef GL_BGRA
# define GL_BGRA 0x80E1
#endif // GL_BGRA
@@ -498,63 +508,127 @@ typedef uint64_t GLuint64;
#ifndef ATC_RGB_AMD
#define GL_ATC_RGB_AMD 0x8C92
-#endif
+#endif // ATC_RGB_AMD
#ifndef GL_ATC_RGBA_EXPLICIT_ALPHA_AMD
# define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
-#endif
+#endif // GL_ATC_RGBA_EXPLICIT_ALPHA_AMD
#ifndef ATC_RGBA_INTERPOLATED_ALPHA_AMD
# define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
-#endif
+#endif // ATC_RGBA_INTERPOLATED_ALPHA_AMD
#ifndef GL_COMPRESSED_RGBA_ASTC_4x4_KHR
# define GL_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
-#endif
+#endif // GL_COMPRESSED_RGBA_ASTC_4x4_KHR
+
+#ifndef GL_COMPRESSED_RGBA_ASTC_5x4_KHR
+# define GL_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1
+#endif // GL_COMPRESSED_RGBA_ASTC_5x4_KHR
#ifndef GL_COMPRESSED_RGBA_ASTC_5x5_KHR
# define GL_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2
-#endif
+#endif // GL_COMPRESSED_RGBA_ASTC_5x5_KHR
+
+#ifndef GL_COMPRESSED_RGBA_ASTC_6x5_KHR
+# define GL_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3
+#endif // GL_COMPRESSED_RGBA_ASTC_6x5_KHR
#ifndef GL_COMPRESSED_RGBA_ASTC_6x6_KHR
# define GL_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4
-#endif
+#endif // GL_COMPRESSED_RGBA_ASTC_6x6_KHR
#ifndef GL_COMPRESSED_RGBA_ASTC_8x5_KHR
# define GL_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5
-#endif
+#endif // GL_COMPRESSED_RGBA_ASTC_8x5_KHR
#ifndef GL_COMPRESSED_RGBA_ASTC_8x6_KHR
# define GL_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6
-#endif
+#endif // GL_COMPRESSED_RGBA_ASTC_8x6_KHR
+
+#ifndef GL_COMPRESSED_RGBA_ASTC_8x8_KHR
+# define GL_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7
+#endif // GL_COMPRESSED_RGBA_ASTC_8x8_KHR
#ifndef GL_COMPRESSED_RGBA_ASTC_10x5_KHR
# define GL_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8
-#endif
+#endif // GL_COMPRESSED_RGBA_ASTC_10x5_KHR
+
+#ifndef GL_COMPRESSED_RGBA_ASTC_10x6_KHR
+# define GL_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9
+#endif // GL_COMPRESSED_RGBA_ASTC_10x6_KHR
+
+#ifndef GL_COMPRESSED_RGBA_ASTC_10x8_KHR
+# define GL_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA
+#endif // GL_COMPRESSED_RGBA_ASTC_10x8_KHR
+
+#ifndef GL_COMPRESSED_RGBA_ASTC_10x10_KHR
+# define GL_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB
+#endif // GL_COMPRESSED_RGBA_ASTC_10x10_KHR
+
+#ifndef GL_COMPRESSED_RGBA_ASTC_12x10_KHR
+# define GL_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC
+#endif // GL_COMPRESSED_RGBA_ASTC_12x10_KHR
+
+#ifndef GL_COMPRESSED_RGBA_ASTC_12x12_KHR
+# define GL_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD
+#endif // GL_COMPRESSED_RGBA_ASTC_12x12_KHR
#ifndef GL_COMPRESSED_SRGB8_ASTC_4x4_KHR
# define GL_COMPRESSED_SRGB8_ASTC_4x4_KHR 0x93D0
-#endif
+#endif // GL_COMPRESSED_SRGB8_ASTC_4x4_KHR
+
+#ifndef GL_COMPRESSED_SRGB8_ASTC_5x4_KHR
+# define GL_COMPRESSED_SRGB8_ASTC_5x4_KHR 0x93D1
+#endif // GL_COMPRESSED_SRGB8_ASTC_5x4_KHR
#ifndef GL_COMPRESSED_SRGB8_ASTC_5x5_KHR
# define GL_COMPRESSED_SRGB8_ASTC_5x5_KHR 0x93D2
-#endif
+#endif // GL_COMPRESSED_SRGB8_ASTC_5x5_KHR
+
+#ifndef GL_COMPRESSED_SRGB8_ASTC_6x5_KHR
+# define GL_COMPRESSED_SRGB8_ASTC_6x5_KHR 0x93D3
+#endif // GL_COMPRESSED_SRGB8_ASTC_6x5_KHR
#ifndef GL_COMPRESSED_SRGB8_ASTC_6x6_KHR
# define GL_COMPRESSED_SRGB8_ASTC_6x6_KHR 0x93D4
-#endif
+#endif // GL_COMPRESSED_SRGB8_ASTC_6x6_KHR
#ifndef GL_COMPRESSED_SRGB8_ASTC_8x5_KHR
# define GL_COMPRESSED_SRGB8_ASTC_8x5_KHR 0x93D5
-#endif
+#endif // GL_COMPRESSED_SRGB8_ASTC_8x5_KHR
#ifndef GL_COMPRESSED_SRGB8_ASTC_8x6_KHR
# define GL_COMPRESSED_SRGB8_ASTC_8x6_KHR 0x93D6
-#endif
+#endif // GL_COMPRESSED_SRGB8_ASTC_8x6_KHR
+
+#ifndef GL_COMPRESSED_SRGB8_ASTC_8x8_KHR
+# define GL_COMPRESSED_SRGB8_ASTC_8x8_KHR 0x93D7
+#endif // GL_COMPRESSED_SRGB8_ASTC_8x8_KHR
#ifndef GL_COMPRESSED_SRGB8_ASTC_10x5_KHR
# define GL_COMPRESSED_SRGB8_ASTC_10x5_KHR 0x93D8
-#endif
+#endif // GL_COMPRESSED_SRGB8_ASTC_10x5_KHR
+
+#ifndef GL_COMPRESSED_SRGB8_ASTC_10x6_KHR
+# define GL_COMPRESSED_SRGB8_ASTC_10x6_KHR 0x93D9
+#endif // GL_COMPRESSED_SRGB8_ASTC_10x6_KHR
+
+#ifndef GL_COMPRESSED_SRGB8_ASTC_10x8_KHR
+# define GL_COMPRESSED_SRGB8_ASTC_10x8_KHR 0x93DA
+#endif // GL_COMPRESSED_SRGB8_ASTC_10x8_KHR
+
+#ifndef GL_COMPRESSED_SRGB8_ASTC_10x10_KHR
+# define GL_COMPRESSED_SRGB8_ASTC_10x10_KHR 0x93DB
+#endif // GL_COMPRESSED_SRGB8_ASTC_10x10_KHR
+
+#ifndef GL_COMPRESSED_SRGB8_ASTC_12x10_KHR
+# define GL_COMPRESSED_SRGB8_ASTC_12x10_KHR 0x93DC
+#endif // GL_COMPRESSED_SRGB8_ASTC_12x10_KHR
+
+#ifndef GL_COMPRESSED_SRGB8_ASTC_12x12_KHR
+# define GL_COMPRESSED_SRGB8_ASTC_12x12_KHR 0x93DD
+#endif // GL_COMPRESSED_SRGB8_ASTC_12x12_KHR
#ifndef GL_COMPRESSED_RGBA_BPTC_UNORM_ARB
# define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C
@@ -985,6 +1059,10 @@ typedef uint64_t GLuint64;
# define GL_FIRST_VERTEX_CONVENTION 0x8E4D
#endif // GL_FIRST_VERTEX_CONVENTION
+#ifndef GL_PARAMETER_BUFFER_ARB
+# define GL_PARAMETER_BUFFER_ARB 0x80EE
+#endif // GL_PARAMETER_BUFFER_ARB
+
// _KHR or _ARB...
#define GL_DEBUG_OUTPUT_SYNCHRONOUS 0x8242
#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH 0x8243
@@ -1084,9 +1162,7 @@ typedef uint64_t GLuint64;
# define GL_TEXTURE_LOD_BIAS 0x8501
#endif // GL_TEXTURE_LOD_BIAS
-#if BX_PLATFORM_WINDOWS
-# include <windows.h>
-#elif BX_PLATFORM_LINUX || BX_PLATFORM_BSD
+#if BX_PLATFORM_LINUX || BX_PLATFORM_BSD
# include "glcontext_glx.h"
#elif BX_PLATFORM_OSX
# include "glcontext_nsgl.h"
@@ -1497,8 +1573,10 @@ namespace bgfx { namespace gl
uint8_t m_unboundUsedAttrib[Attrib::Count]; // For tracking unbound used attributes between begin()/end().
uint8_t m_usedCount;
uint8_t m_used[Attrib::Count]; // Dense.
- GLint m_attributes[Attrib::Count]; // Sparse.
- GLint m_instanceData[BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT+1];
+ GLint m_attributes[Attrib::Count]; // Sparse.
+
+ GLint m_instanceData[BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT+1];
+ uint16_t m_instanceOffset[BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT];
GLint m_sampler[BGFX_CONFIG_MAX_TEXTURE_SAMPLERS];
uint8_t m_numSamplers;
@@ -1521,6 +1599,7 @@ namespace bgfx { namespace gl
{
Query& query = m_query[ii];
query.m_ready = false;
+ query.m_frameNum = 0;
GL_CHECK(glGenQueries(1, &query.m_begin) );
GL_CHECK(glGenQueries(1, &query.m_end) );
}
@@ -1542,7 +1621,7 @@ namespace bgfx { namespace gl
}
}
- uint32_t begin(uint32_t _resultIdx)
+ uint32_t begin(uint32_t _resultIdx, uint32_t _frameNum)
{
while (0 == m_control.reserve(1) )
{
@@ -1555,6 +1634,7 @@ namespace bgfx { namespace gl
const uint32_t idx = m_control.m_current;
Query& query = m_query[idx];
query.m_resultIdx = _resultIdx;
+ query.m_frameNum = _frameNum;
query.m_ready = false;
GL_CHECK(glQueryCounter(query.m_begin
@@ -1603,6 +1683,7 @@ namespace bgfx { namespace gl
Result& result = m_result[query.m_resultIdx];
--result.m_pending;
+ result.m_frameNum = query.m_frameNum;
GL_CHECK(glGetQueryObjectui64v(query.m_begin
, GL_QUERY_RESULT
@@ -1625,14 +1706,16 @@ namespace bgfx { namespace gl
{
void reset()
{
- m_begin = 0;
- m_end = 0;
- m_pending = 0;
+ m_begin = 0;
+ m_end = 0;
+ m_pending = 0;
+ m_frameNum = 0;
}
uint64_t m_begin;
uint64_t m_end;
uint32_t m_pending;
+ uint32_t m_frameNum;
};
struct Query
@@ -1640,6 +1723,7 @@ namespace bgfx { namespace gl
GLuint m_begin;
GLuint m_end;
uint32_t m_resultIdx;
+ uint32_t m_frameNum;
bool m_ready;
};
diff --git a/3rdparty/bgfx/src/renderer_gnm.cpp b/3rdparty/bgfx/src/renderer_gnm.cpp
index 333bbb4649e..82f76593b11 100644
--- a/3rdparty/bgfx/src/renderer_gnm.cpp
+++ b/3rdparty/bgfx/src/renderer_gnm.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
diff --git a/3rdparty/bgfx/src/renderer_mtl.h b/3rdparty/bgfx/src/renderer_mtl.h
index 4cfd7321742..1ceba862ca3 100644
--- a/3rdparty/bgfx/src/renderer_mtl.h
+++ b/3rdparty/bgfx/src/renderer_mtl.h
@@ -1,6 +1,6 @@
/*
* Copyright 2011-2015 Attila Kocsis, Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_RENDERER_METAL_H_HEADER_GUARD
@@ -125,6 +125,11 @@ namespace bgfx { namespace mtl
destinationSlice:_destinationSlice destinationLevel:_destinationLevel destinationOrigin:_destinationOrigin];
}
+ void generateMipmapsForTexture(id<MTLTexture> _texture)
+ {
+ [m_obj generateMipmapsForTexture:_texture];
+ }
+
#if BX_PLATFORM_OSX
void synchronizeTexture(id<MTLTexture> _texture, NSUInteger _slice, NSUInteger _level)
{
@@ -999,6 +1004,7 @@ namespace bgfx { namespace mtl
, bool _vertex
, bool _fragment
, uint32_t _flags = BGFX_SAMPLER_INTERNAL_DEFAULT
+ , uint8_t _mip = UINT8_MAX
);
Texture getTextureMipLevel(int _mip);
@@ -1074,6 +1080,8 @@ namespace bgfx { namespace mtl
void postReset();
uint16_t destroy();
+ void resolve();
+
SwapChainMtl* m_swapChain;
void* m_nwh;
uint32_t m_width;
@@ -1125,7 +1133,7 @@ namespace bgfx { namespace mtl
void init();
void shutdown();
- uint32_t begin(uint32_t _resultIdx);
+ uint32_t begin(uint32_t _resultIdx, uint32_t _frameNum);
void end(uint32_t _idx);
void addHandlers(CommandBuffer& _commandBuffer);
bool get();
@@ -1134,14 +1142,16 @@ namespace bgfx { namespace mtl
{
void reset()
{
- m_begin = 0;
- m_end = 0;
- m_pending = 0;
+ m_begin = 0;
+ m_end = 0;
+ m_pending = 0;
+ m_frameNum = 0;
}
uint64_t m_begin;
uint64_t m_end;
uint32_t m_pending;
+ uint32_t m_frameNum; // TODO: implement (currently stays 0)
};
uint64_t m_begin;
diff --git a/3rdparty/bgfx/src/renderer_mtl.mm b/3rdparty/bgfx/src/renderer_mtl.mm
index 74af2e5106a..2317c16d6b5 100644
--- a/3rdparty/bgfx/src/renderer_mtl.mm
+++ b/3rdparty/bgfx/src/renderer_mtl.mm
@@ -1,6 +1,6 @@
/*
* Copyright 2011-2016 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -209,106 +209,140 @@ namespace bgfx { namespace mtl
struct TextureFormatInfo
{
- MTLPixelFormat m_fmt;
- MTLPixelFormat m_fmtSrgb;
+ MTLPixelFormat m_fmt;
+ MTLPixelFormat m_fmtSrgb;
+ MTLReadWriteTextureTier m_rwTier;
+ MTLTextureSwizzleChannels m_mapping;
+ bool m_autoGetMipmap;
};
static TextureFormatInfo s_textureFormat[] =
{
- { MTLPixelFormat(130/*BC1_RGBA*/), MTLPixelFormat(131/*BC1_RGBA_sRGB*/) }, // BC1
- { MTLPixelFormat(132/*BC2_RGBA*/), MTLPixelFormat(133/*BC2_RGBA_sRGB*/) }, // BC2
- { MTLPixelFormat(134/*BC3_RGBA*/), MTLPixelFormat(135/*BC3_RGBA_sRGB*/) }, // BC3
- { MTLPixelFormat(140/*BC4_RUnorm*/), MTLPixelFormatInvalid }, // BC4
- { MTLPixelFormat(142/*BC5_RGUnorm*/), MTLPixelFormatInvalid }, // BC5
- { MTLPixelFormat(150/*BC6H_RGBFloat*/), MTLPixelFormatInvalid }, // BC6H
- { MTLPixelFormat(152/*BC7_RGBAUnorm*/), MTLPixelFormat(153/*BC7_RGBAUnorm_sRGB*/) }, // BC7
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // ETC1
- { MTLPixelFormat(180/*ETC2_RGB8*/), MTLPixelFormat(181/*ETC2_RGB8_sRGB*/) }, // ETC2
- { MTLPixelFormat(178/*EAC_RGBA8*/), MTLPixelFormat(179/*EAC_RGBA8_sRGB*/) }, // ETC2A
- { MTLPixelFormat(182/*ETC2_RGB8A1*/), MTLPixelFormat(183/*ETC2_RGB8A1_sRGB*/) }, // ETC2A1
- { MTLPixelFormat(160/*PVRTC_RGB_2BPP*/), MTLPixelFormat(161/*PVRTC_RGB_2BPP_sRGB*/) }, // PTC12
- { MTLPixelFormat(162/*PVRTC_RGB_4BPP*/), MTLPixelFormat(163/*PVRTC_RGB_4BPP_sRGB*/) }, // PTC14
- { MTLPixelFormat(164/*PVRTC_RGBA_2BPP*/), MTLPixelFormat(165/*PVRTC_RGBA_2BPP_sRGB*/) }, // PTC12A
- { MTLPixelFormat(166/*PVRTC_RGBA_4BPP*/), MTLPixelFormat(167/*PVRTC_RGBA_4BPP_sRGB*/) }, // PTC14A
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // PTC22
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // PTC24
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // ATC
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // ATCE
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // ATCI
+#define $0 MTLTextureSwizzleZero
+#define $1 MTLTextureSwizzleOne
+#define $R MTLTextureSwizzleRed
+#define $G MTLTextureSwizzleGreen
+#define $B MTLTextureSwizzleBlue
+#define $A MTLTextureSwizzleAlpha
+ { MTLPixelFormat(130/*BC1_RGBA*/), MTLPixelFormat(131/*BC1_RGBA_sRGB*/), MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // BC1
+ { MTLPixelFormat(132/*BC2_RGBA*/), MTLPixelFormat(133/*BC2_RGBA_sRGB*/), MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // BC2
+ { MTLPixelFormat(134/*BC3_RGBA*/), MTLPixelFormat(135/*BC3_RGBA_sRGB*/), MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // BC3
+ { MTLPixelFormat(140/*BC4_RUnorm*/), MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // BC4
+ { MTLPixelFormat(142/*BC5_RGUnorm*/), MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // BC5
+ { MTLPixelFormat(150/*BC6H_RGBFloat*/), MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // BC6H
+ { MTLPixelFormat(152/*BC7_RGBAUnorm*/), MTLPixelFormat(153/*BC7_RGBAUnorm_sRGB*/), MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // BC7
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ETC1
+ { MTLPixelFormat(180/*ETC2_RGB8*/), MTLPixelFormat(181/*ETC2_RGB8_sRGB*/), MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ETC2
+ { MTLPixelFormat(178/*EAC_RGBA8*/), MTLPixelFormat(179/*EAC_RGBA8_sRGB*/), MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ETC2A
+ { MTLPixelFormat(182/*ETC2_RGB8A1*/), MTLPixelFormat(183/*ETC2_RGB8A1_sRGB*/), MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ETC2A1
+ { MTLPixelFormat(160/*PVRTC_RGB_2BPP*/), MTLPixelFormat(161/*PVRTC_RGB_2BPP_sRGB*/), MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // PTC12
+ { MTLPixelFormat(162/*PVRTC_RGB_4BPP*/), MTLPixelFormat(163/*PVRTC_RGB_4BPP_sRGB*/), MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // PTC14
+ { MTLPixelFormat(164/*PVRTC_RGBA_2BPP*/), MTLPixelFormat(165/*PVRTC_RGBA_2BPP_sRGB*/), MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // PTC12A
+ { MTLPixelFormat(166/*PVRTC_RGBA_4BPP*/), MTLPixelFormat(167/*PVRTC_RGBA_4BPP_sRGB*/), MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // PTC14A
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // PTC22
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // PTC24
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ATC
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ATCE
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ATCI
#if BX_PLATFORM_IOS && !TARGET_OS_MACCATALYST
- { MTLPixelFormatASTC_4x4_LDR, MTLPixelFormatASTC_4x4_sRGB }, // ASTC4x4
- { MTLPixelFormatASTC_5x5_LDR, MTLPixelFormatASTC_5x5_sRGB }, // ASTC5x5
- { MTLPixelFormatASTC_6x6_LDR, MTLPixelFormatASTC_6x6_sRGB }, // ASTC6x6
- { MTLPixelFormatASTC_8x5_LDR, MTLPixelFormatASTC_8x5_sRGB }, // ASTC8x5
- { MTLPixelFormatASTC_8x6_LDR, MTLPixelFormatASTC_8x6_sRGB }, // ASTC8x6
- { MTLPixelFormatASTC_10x5_LDR, MTLPixelFormatASTC_10x5_sRGB }, // ASTC10x5
+ { MTLPixelFormatASTC_4x4_LDR, MTLPixelFormatASTC_4x4_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC4x4
+ { MTLPixelFormatASTC_5x4_LDR, MTLPixelFormatASTC_5x4_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC5x4
+ { MTLPixelFormatASTC_5x5_LDR, MTLPixelFormatASTC_5x5_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC5x5
+ { MTLPixelFormatASTC_6x5_LDR, MTLPixelFormatASTC_6x5_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC6x5
+ { MTLPixelFormatASTC_6x6_LDR, MTLPixelFormatASTC_6x6_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC6x6
+ { MTLPixelFormatASTC_8x5_LDR, MTLPixelFormatASTC_8x5_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC8x5
+ { MTLPixelFormatASTC_8x6_LDR, MTLPixelFormatASTC_8x6_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC8x6
+ { MTLPixelFormatASTC_8x8_LDR, MTLPixelFormatASTC_8x8_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC8x8
+ { MTLPixelFormatASTC_10x5_LDR, MTLPixelFormatASTC_10x5_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC10x5
+ { MTLPixelFormatASTC_10x6_LDR, MTLPixelFormatASTC_10x6_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC10x6
+ { MTLPixelFormatASTC_10x8_LDR, MTLPixelFormatASTC_10x8_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC10x8
+ { MTLPixelFormatASTC_10x10_LDR, MTLPixelFormatASTC_10x10_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC10x10
+ { MTLPixelFormatASTC_12x10_LDR, MTLPixelFormatASTC_12x10_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC12x10
+ { MTLPixelFormatASTC_12x12_LDR, MTLPixelFormatASTC_12x12_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC12x12
#else
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // ASTC4x4
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // ASTC5x5
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // ASTC6x6
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // ASTC8x5
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // ASTC8x6
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // ASTC10x5
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC4x4
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC5x4
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC5x5
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC6x5
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC6x6
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC8x5
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC8x6
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC8x8
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC10x5
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC10x6
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC10x8
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC10x10
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC12x10
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // ASTC12x12
#endif // BX_PLATFORM_IOS && !TARGET_OS_MACCATALYST
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // Unknown
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // R1
- { MTLPixelFormatA8Unorm, MTLPixelFormatInvalid }, // A8
- { MTLPixelFormatR8Unorm, MTLPixelFormat(11/*R8Unorm_sRGB*/) }, // R8
- { MTLPixelFormatR8Sint, MTLPixelFormatInvalid }, // R8I
- { MTLPixelFormatR8Uint, MTLPixelFormatInvalid }, // R8U
- { MTLPixelFormatR8Snorm, MTLPixelFormatInvalid }, // R8S
- { MTLPixelFormatR16Unorm, MTLPixelFormatInvalid }, // R16
- { MTLPixelFormatR16Sint, MTLPixelFormatInvalid }, // R16I
- { MTLPixelFormatR16Uint, MTLPixelFormatInvalid }, // R16U
- { MTLPixelFormatR16Float, MTLPixelFormatInvalid }, // R16F
- { MTLPixelFormatR16Snorm, MTLPixelFormatInvalid }, // R16S
- { MTLPixelFormatR32Sint, MTLPixelFormatInvalid }, // R32I
- { MTLPixelFormatR32Uint, MTLPixelFormatInvalid }, // R32U
- { MTLPixelFormatR32Float, MTLPixelFormatInvalid }, // R32F
- { MTLPixelFormatRG8Unorm, MTLPixelFormat(31/*RG8Unorm_sRGB*/) }, // RG8
- { MTLPixelFormatRG8Sint, MTLPixelFormatInvalid }, // RG8I
- { MTLPixelFormatRG8Uint, MTLPixelFormatInvalid }, // RG8U
- { MTLPixelFormatRG8Snorm, MTLPixelFormatInvalid }, // RG8S
- { MTLPixelFormatRG16Unorm, MTLPixelFormatInvalid }, // RG16
- { MTLPixelFormatRG16Sint, MTLPixelFormatInvalid }, // RG16I
- { MTLPixelFormatRG16Uint, MTLPixelFormatInvalid }, // RG16U
- { MTLPixelFormatRG16Float, MTLPixelFormatInvalid }, // RG16F
- { MTLPixelFormatRG16Snorm, MTLPixelFormatInvalid }, // RG16S
- { MTLPixelFormatRG32Sint, MTLPixelFormatInvalid }, // RG32I
- { MTLPixelFormatRG32Uint, MTLPixelFormatInvalid }, // RG32U
- { MTLPixelFormatRG32Float, MTLPixelFormatInvalid }, // RG32F
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // RGB8
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // RGB8I
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // RGB8U
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // RGB8S
- { MTLPixelFormatRGB9E5Float, MTLPixelFormatInvalid }, // RGB9E5F
- { MTLPixelFormatBGRA8Unorm, MTLPixelFormatBGRA8Unorm_sRGB }, // BGRA8
- { MTLPixelFormatRGBA8Unorm, MTLPixelFormatRGBA8Unorm_sRGB }, // RGBA8
- { MTLPixelFormatRGBA8Sint, MTLPixelFormatInvalid }, // RGBA8I
- { MTLPixelFormatRGBA8Uint, MTLPixelFormatInvalid }, // RGBA8U
- { MTLPixelFormatRGBA8Snorm, MTLPixelFormatInvalid }, // RGBA8S
- { MTLPixelFormatRGBA16Unorm, MTLPixelFormatInvalid }, // RGBA16
- { MTLPixelFormatRGBA16Sint, MTLPixelFormatInvalid }, // RGBA16I
- { MTLPixelFormatRGBA16Uint, MTLPixelFormatInvalid }, // RGBA16U
- { MTLPixelFormatRGBA16Float, MTLPixelFormatInvalid }, // RGBA16F
- { MTLPixelFormatRGBA16Snorm, MTLPixelFormatInvalid }, // RGBA16S
- { MTLPixelFormatRGBA32Sint, MTLPixelFormatInvalid }, // RGBA32I
- { MTLPixelFormatRGBA32Uint, MTLPixelFormatInvalid }, // RGBA32U
- { MTLPixelFormatRGBA32Float, MTLPixelFormatInvalid }, // RGBA32F
- { MTLPixelFormat(40/*B5G6R5Unorm*/), MTLPixelFormatInvalid }, // R5G6B5
- { MTLPixelFormat(42/*ABGR4Unorm*/), MTLPixelFormatInvalid }, // RGBA4
- { MTLPixelFormat(41/*A1BGR5Unorm*/), MTLPixelFormatInvalid }, // RGB5A1
- { MTLPixelFormatRGB10A2Unorm, MTLPixelFormatInvalid }, // RGB10A2
- { MTLPixelFormatRG11B10Float, MTLPixelFormatInvalid }, // RG11B10F
- { MTLPixelFormatInvalid, MTLPixelFormatInvalid }, // UnknownDepth
- { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid }, // D16
- { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid }, // D24
- { MTLPixelFormat(255/*Depth24Unorm_Stencil8*/), MTLPixelFormatInvalid }, // D24S8
- { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid }, // D32
- { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid }, // D16F
- { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid }, // D24F
- { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid }, // D32F
- { MTLPixelFormatStencil8, MTLPixelFormatInvalid }, // D0S8
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // Unknown
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // R1
+ { MTLPixelFormatA8Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // A8
+ { MTLPixelFormatR8Unorm, MTLPixelFormat(11/*R8Unorm_sRGB*/), MTLReadWriteTextureTier2, { $R, $G, $B, $A }, true }, // R8
+ { MTLPixelFormatR8Sint, MTLPixelFormatInvalid, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, false }, // R8I
+ { MTLPixelFormatR8Uint, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // R8U
+ { MTLPixelFormatR8Snorm, MTLPixelFormatInvalid, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, true }, // R8S
+ { MTLPixelFormatR16Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // R16
+ { MTLPixelFormatR16Sint, MTLPixelFormatInvalid, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, false }, // R16I
+ { MTLPixelFormatR16Uint, MTLPixelFormatInvalid, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, false }, // R16U
+ { MTLPixelFormatR16Float, MTLPixelFormatInvalid, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, true }, // R16F
+ { MTLPixelFormatR16Snorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // R16S
+ { MTLPixelFormatR32Sint, MTLPixelFormatInvalid, MTLReadWriteTextureTier1, { $R, $G, $B, $A }, false }, // R32I
+ { MTLPixelFormatR32Uint, MTLPixelFormatInvalid, MTLReadWriteTextureTier1, { $R, $G, $B, $A }, false }, // R32U
+ { MTLPixelFormatR32Float, MTLPixelFormatInvalid, MTLReadWriteTextureTier1, { $R, $G, $B, $A }, false }, // R32F
+ { MTLPixelFormatRG8Unorm, MTLPixelFormat(31/*RG8Unorm_sRGB*/), MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // RG8
+ { MTLPixelFormatRG8Sint, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // RG8I
+ { MTLPixelFormatRG8Uint, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // RG8U
+ { MTLPixelFormatRG8Snorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // RG8S
+ { MTLPixelFormatRG16Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // RG16
+ { MTLPixelFormatRG16Sint, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // RG16I
+ { MTLPixelFormatRG16Uint, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // RG16U
+ { MTLPixelFormatRG16Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // RG16F
+ { MTLPixelFormatRG16Snorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // RG16S
+ { MTLPixelFormatRG32Sint, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // RG32I
+ { MTLPixelFormatRG32Uint, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // RG32U
+ { MTLPixelFormatRG32Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // RG32F
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // RGB8
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // RGB8I
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // RGB8U
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // RGB8S
+ { MTLPixelFormatRGB9E5Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // RGB9E5F
+ { MTLPixelFormatBGRA8Unorm, MTLPixelFormatBGRA8Unorm_sRGB, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // BGRA8
+ { MTLPixelFormatRGBA8Unorm, MTLPixelFormatRGBA8Unorm_sRGB, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, true }, // RGBA8
+ { MTLPixelFormatRGBA8Sint, MTLPixelFormatInvalid, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, false }, // RGBA8I
+ { MTLPixelFormatRGBA8Uint, MTLPixelFormatInvalid, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, false }, // RGBA8U
+ { MTLPixelFormatRGBA8Snorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // RGBA8S
+ { MTLPixelFormatRGBA16Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // RGBA16
+ { MTLPixelFormatRGBA16Sint, MTLPixelFormatInvalid, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, false }, // RGBA16I
+ { MTLPixelFormatRGBA16Uint, MTLPixelFormatInvalid, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, false }, // RGBA16U
+ { MTLPixelFormatRGBA16Float, MTLPixelFormatInvalid, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, true }, // RGBA16F
+ { MTLPixelFormatRGBA16Snorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // RGBA16S
+ { MTLPixelFormatRGBA32Sint, MTLPixelFormatInvalid, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, true }, // RGBA32I
+ { MTLPixelFormatRGBA32Uint, MTLPixelFormatInvalid, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, true }, // RGBA32U
+ { MTLPixelFormatRGBA32Float, MTLPixelFormatInvalid, MTLReadWriteTextureTier2, { $R, $G, $B, $A }, true }, // RGBA32F
+ { MTLPixelFormatB5G6R5Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // B5G6R5
+ { MTLPixelFormatB5G6R5Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $B, $G, $R, $A }, true }, // R5G6B5
+ { MTLPixelFormatABGR4Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $G, $B, $A, $R }, true }, // BGRA4
+ { MTLPixelFormatABGR4Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $A, $B, $G, $R }, true }, // RGBA4
+ { MTLPixelFormatBGR5A1Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // BGR5A1
+ { MTLPixelFormatBGR5A1Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $B, $G, $R, $A }, true }, // RGB5A1
+ { MTLPixelFormatRGB10A2Unorm, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // RGB10A2
+ { MTLPixelFormatRG11B10Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, true }, // RG11B10F
+ { MTLPixelFormatInvalid, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // UnknownDepth
+ { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // D16
+ { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // D24
+ { MTLPixelFormat(255/*Depth24Unorm_Stencil8*/), MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // D24S8
+ { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // D32
+ { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // D16F
+ { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // D24F
+ { MTLPixelFormatDepth32Float, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // D32F
+ { MTLPixelFormatStencil8, MTLPixelFormatInvalid, MTLReadWriteTextureTierNone, { $R, $G, $B, $A }, false }, // D0S8
+#undef $0
+#undef $1
+#undef $R
+#undef $G
+#undef $B
+#undef $A
};
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
@@ -349,13 +383,54 @@ namespace bgfx { namespace mtl
return UniformType::End;
}
+ static uint64_t getRegistryId(id<MTLDevice> _device)
+ {
+ return [_device respondsToSelector: @selector(registryID)] ? _device.registryID : 0;
+ }
+
+#if BX_PLATFORM_OSX
+ static uint32_t getEntryProperty(io_registry_entry_t _entry, CFStringRef _propertyName)
+ {
+ uint32_t result = 0;
+
+ CFTypeRef typeRef = IORegistryEntrySearchCFProperty(
+ _entry
+ , kIOServicePlane
+ , _propertyName
+ , kCFAllocatorDefault
+ , kIORegistryIterateRecursively | kIORegistryIterateParents
+ );
+
+ if (NULL != typeRef)
+ {
+ const uint32_t* value = (const uint32_t*)(CFDataGetBytePtr( (CFDataRef)typeRef) );
+ if (NULL != value)
+ {
+ result = *value;
+ }
+
+ CFRelease(typeRef);
+ }
+
+ return result;
+ }
+#endif // BX_PLATFORM_OSX
+
+
+static const char* s_accessNames[] = {
+ "Access::Read",
+ "Access::Write",
+ "Access::ReadWrite",
+};
+
+BX_STATIC_ASSERT(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames count");
+
#define SHADER_FUNCTION_NAME ("xlatMtlMain")
-#define SHADER_UNIFORM_NAME ("_mtl_u")
+#define SHADER_UNIFORM_NAME ("_mtl_u")
struct RendererContextMtl;
static RendererContextMtl* s_renderMtl;
-
struct RendererContextMtl : public RendererContextI
{
RendererContextMtl()
@@ -473,7 +548,67 @@ namespace bgfx { namespace mtl
m_renderPipelineDescriptor.colorAttachments[0].pixelFormat = m_mainFrameBuffer.m_swapChain->m_metalLayer.pixelFormat;
m_renderPipelineDescriptor.vertexFunction = m_screenshotBlitProgram.m_vsh->m_function;
m_renderPipelineDescriptor.fragmentFunction = m_screenshotBlitProgram.m_fsh->m_function;
- m_screenshotBlitRenderPipelineState = m_device.newRenderPipelineStateWithDescriptor(m_renderPipelineDescriptor);
+ m_screenshotBlitRenderPipelineState = m_device.newRenderPipelineStateWithDescriptor(m_renderPipelineDescriptor);
+
+ {
+ if ([m_device respondsToSelector: @selector(supportsFamily:)])
+ {
+ if ([m_device supportsFamily: MTLGPUFamily(1004) /*MTLGPUFamilyApple4*/])
+ {
+ g_caps.vendorId = BGFX_PCI_ID_APPLE;
+
+ if ([m_device supportsFamily: MTLGPUFamily(1007) /*MTLGPUFamilyApple7*/])
+ {
+ g_caps.deviceId = 1007;
+ }
+ else if ([m_device supportsFamily: MTLGPUFamily(1006) /*MTLGPUFamilyApple6*/])
+ {
+ g_caps.deviceId = 1006;
+ }
+ else if ([m_device supportsFamily: MTLGPUFamily(1005) /*MTLGPUFamilyApple5*/])
+ {
+ g_caps.deviceId = 1005;
+ }
+ else
+ {
+ g_caps.deviceId = 1004;
+ }
+ }
+ }
+
+#if BX_PLATFORM_OSX
+ if (0 == g_caps.vendorId)
+ {
+ io_registry_entry_t entry;
+
+ uint64_t registryId = getRegistryId(m_device);
+
+ if (0 != registryId)
+ {
+ entry = IOServiceGetMatchingService(mach_port_t(NULL), IORegistryEntryIDMatching(registryId) );
+
+ if (0 != entry)
+ {
+ io_registry_entry_t parent;
+
+ if (kIOReturnSuccess == IORegistryEntryGetParentEntry(entry, kIOServicePlane, &parent) )
+ {
+ g_caps.vendorId = getEntryProperty(parent, CFSTR("vendor-id") );
+ g_caps.deviceId = getEntryProperty(parent, CFSTR("device-id") );
+
+ IOObjectRelease(parent);
+ }
+
+ IOObjectRelease(entry);
+ }
+ }
+ }
+#endif // BX_PLATFORM_OSX
+ }
+
+ g_caps.numGPUs = 1;
+ g_caps.gpu[0].vendorId = g_caps.vendorId;
+ g_caps.gpu[0].deviceId = g_caps.deviceId;
g_caps.supported |= (0
| BGFX_CAPS_ALPHA_TO_COVERAGE
@@ -562,6 +697,12 @@ namespace bgfx { namespace mtl
s_textureFormat[TextureFormat::RG8].m_fmtSrgb = MTLPixelFormatInvalid;
}
+ const MTLReadWriteTextureTier rwTier = [m_device readWriteTextureSupport];
+ g_caps.supported |= rwTier != MTLReadWriteTextureTierNone
+ ? BGFX_CAPS_IMAGE_RW
+ : 0
+ ;
+
for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
{
uint16_t support = 0;
@@ -590,6 +731,19 @@ namespace bgfx { namespace mtl
;
}
+ 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
+ ;
+
+ support |= s_textureFormat[ii].m_autoGetMipmap
+ ? BGFX_CAPS_FORMAT_TEXTURE_MIP_AUTOGEN
+ : 0
+ ;
+
g_caps.formats[ii] = support;
}
@@ -628,10 +782,7 @@ namespace bgfx { namespace mtl
g_caps.formats[TextureFormat::PTC12 ] =
g_caps.formats[TextureFormat::PTC14 ] =
g_caps.formats[TextureFormat::PTC12A] =
- g_caps.formats[TextureFormat::PTC14A] =
- g_caps.formats[TextureFormat::R5G6B5] =
- g_caps.formats[TextureFormat::RGBA4 ] =
- g_caps.formats[TextureFormat::RGB5A1] = BGFX_CAPS_FORMAT_TEXTURE_NONE;
+ g_caps.formats[TextureFormat::PTC14A] = BGFX_CAPS_FORMAT_TEXTURE_NONE;
g_caps.formats[TextureFormat::RGB9E5F] &= ~(BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA);
}
@@ -880,7 +1031,7 @@ namespace bgfx { namespace mtl
bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
- bx::write(&writer, magic);
+ bx::write(&writer, magic, bx::ErrorAssert{});
TextureCreate tc;
tc.m_width = _width;
@@ -891,7 +1042,7 @@ namespace bgfx { namespace mtl
tc.m_format = TextureFormat::Enum(texture.m_requestedFormat);
tc.m_cubeMap = false;
tc.m_mem = NULL;
- bx::write(&writer, tc);
+ bx::write(&writer, tc, bx::ErrorAssert{});
texture.destroy();
texture.create(mem, texture.m_flags, 0);
@@ -906,7 +1057,7 @@ namespace bgfx { namespace mtl
uintptr_t getInternal(TextureHandle _handle) override
{
- return uintptr_t(id<MTLTexture>(m_textures[_handle.idx].m_ptr));
+ return uintptr_t(id<MTLTexture>(m_textures[_handle.idx].m_ptr) );
}
void destroyTexture(TextureHandle _handle) override
@@ -1500,21 +1651,6 @@ namespace bgfx { namespace mtl
void clearQuad(ClearQuad& _clearQuad, const Rect& /*_rect*/, const Clear& _clear, const float _palette[][4])
{
- uint32_t width;
- uint32_t height;
-
- if (isValid(m_fbh) )
- {
- const FrameBufferMtl& fb = m_frameBuffers[m_fbh.idx];
- width = fb.m_width;
- height = fb.m_height;
- }
- else
- {
- width = m_resolution.width;
- height = m_resolution.height;
- }
-
uint64_t state = 0;
state |= _clear.m_flags & BGFX_CLEAR_COLOR ? BGFX_STATE_WRITE_RGB|BGFX_STATE_WRITE_A : 0;
state |= _clear.m_flags & BGFX_CLEAR_DEPTH ? BGFX_STATE_DEPTH_TEST_ALWAYS|BGFX_STATE_WRITE_Z : 0;
@@ -1653,6 +1789,12 @@ namespace bgfx { namespace mtl
void setFrameBuffer(RenderPassDescriptor _renderPassDescriptor, FrameBufferHandle _fbh, bool _msaa = true)
{
+ // resolve framebuffer
+ if (isValid(m_fbh) && m_fbh.idx != _fbh.idx)
+ {
+ FrameBufferMtl& frameBuffer = m_frameBuffers[m_fbh.idx];
+ frameBuffer.resolve();
+ }
if (!isValid(_fbh)
|| m_frameBuffers[_fbh.idx].m_swapChain)
{
@@ -1900,33 +2042,45 @@ namespace bgfx { namespace mtl
&& NULL != arg.bufferStructType)
{
const char* name = utf8String(arg.name);
+ BX_UNUSED(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 - 1), BGFX_CONFIG_MAX_TEXTURE_SAMPLERS - 1, name);
+ BX_TRACE(
+ "Binding index is too large %d max is %d. "
+ "User defined uniform '%s' won't be set."
+ , int32_t(arg.index - 1)
+ , BGFX_CONFIG_MAX_TEXTURE_SAMPLERS - 1
+ , name
+ );
}
else
{
- ps->m_bindingTypes[arg.index-1] = fragmentBit ? PipelineStateMtl::BindToFragmentShader : PipelineStateMtl::BindToVertexShader;
- BX_TRACE("buffer %s index:%d", name, uint32_t(arg.index-1) );
+ ps->m_bindingTypes[arg.index-1] = fragmentBit
+ ? PipelineStateMtl::BindToFragmentShader
+ : PipelineStateMtl::BindToVertexShader
+ ;
+ BX_TRACE("Buffer %s index: %d", name, int32_t(arg.index-1) );
}
}
else if (arg.type == MTLArgumentTypeTexture)
{
const char* name = utf8String(arg.name);
- const UniformRegInfo* info = s_renderMtl->m_uniformReg.find(name);
- BX_WARN(NULL != info, "User defined uniform '%s' is not found, it won't be set.", name);
-
- if (NULL != info)
+ if (arg.index >= BGFX_CONFIG_MAX_TEXTURE_SAMPLERS)
{
- 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);
+ }
+ else
+ {
+ ps->m_bindingTypes[arg.index] = fragmentBit ? PipelineStateMtl::BindToFragmentShader : PipelineStateMtl::BindToVertexShader;
+ const UniformRegInfo* info = s_renderMtl->m_uniformReg.find(name);
+ if (info)
{
- 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);
+ BX_TRACE("texture %s %d index:%d", name, info->m_handle, uint32_t(arg.index) );
}
else
{
- ps->m_bindingTypes[arg.index] = fragmentBit ? PipelineStateMtl::BindToFragmentShader : PipelineStateMtl::BindToVertexShader;
- BX_TRACE("texture %s %d index:%d", name, info->m_handle, uint32_t(arg.index) );
+ BX_TRACE("image %s index:%d", name, uint32_t(arg.index) );
}
}
}
@@ -2043,6 +2197,10 @@ namespace bgfx { namespace mtl
{
const TextureMtl& texture = m_textures[frameBuffer.m_depthHandle.idx];
pd.depthAttachmentPixelFormat = texture.m_ptr.m_obj.pixelFormat;
+ pd.sampleCount = NULL != texture.m_ptrMsaa
+ ? texture.m_ptrMsaa.sampleCount()
+ : 1
+ ;
if (NULL != texture.m_ptrStencil)
{
pd.stencilAttachmentPixelFormat = texture.m_ptrStencil.m_obj.pixelFormat;
@@ -2249,7 +2407,6 @@ namespace bgfx { namespace mtl
return program.m_computePS;
}
-
SamplerState getSamplerState(uint32_t _flags)
{
_flags &= BGFX_SAMPLER_BITS_MASK;
@@ -2426,18 +2583,20 @@ namespace bgfx { namespace mtl
void writeString(bx::WriterI* _writer, const char* _str)
{
- bx::write(_writer, _str, (int32_t)bx::strLen(_str) );
+ bx::write(_writer, _str, (int32_t)bx::strLen(_str), bx::ErrorAssert{});
}
void ShaderMtl::create(const Memory* _mem)
{
bx::MemoryReader reader(_mem->data, _mem->size);
+ bx::ErrorAssert err;
+
uint32_t magic;
- bx::read(&reader, magic);
+ bx::read(&reader, magic, &err);
uint32_t hashIn;
- bx::read(&reader, hashIn);
+ bx::read(&reader, hashIn, &err);
uint32_t hashOut;
@@ -2447,11 +2606,11 @@ namespace bgfx { namespace mtl
}
else
{
- bx::read(&reader, hashOut);
+ bx::read(&reader, hashOut, &err);
}
uint16_t count;
- bx::read(&reader, count);
+ bx::read(&reader, count, &err);
BX_TRACE("%s Shader consts %d"
, getShaderTypeName(magic)
@@ -2461,47 +2620,47 @@ namespace bgfx { namespace mtl
for (uint32_t ii = 0; ii < count; ++ii)
{
uint8_t nameSize;
- bx::read(&reader, nameSize);
+ bx::read(&reader, nameSize, &err);
char name[256];
- bx::read(&reader, &name, nameSize);
+ bx::read(&reader, &name, nameSize, &err);
name[nameSize] = '\0';
uint8_t type;
- bx::read(&reader, type);
+ bx::read(&reader, type, &err);
uint8_t num;
- bx::read(&reader, num);
+ bx::read(&reader, num, &err);
uint16_t regIndex;
- bx::read(&reader, regIndex);
+ bx::read(&reader, regIndex, &err);
uint16_t regCount;
- bx::read(&reader, regCount);
+ bx::read(&reader, regCount, &err);
if (!isShaderVerLess(magic, 8) )
{
uint16_t texInfo = 0;
- bx::read(&reader, texInfo);
+ bx::read(&reader, texInfo, &err);
}
if (!isShaderVerLess(magic, 10) )
{
uint16_t texFormat = 0;
- bx::read(&reader, texFormat);
+ bx::read(&reader, texFormat, &err);
}
}
- if (isShaderType(magic, 'C'))
+ if (isShaderType(magic, 'C') )
{
for (uint32_t ii = 0; ii < 3; ++ii)
{
- bx::read(&reader, m_numThreads[ii]);
+ bx::read(&reader, m_numThreads[ii], &err);
}
}
uint32_t shaderSize;
- bx::read(&reader, shaderSize);
+ bx::read(&reader, shaderSize, &err);
const char* code = (const char*)reader.getDataPtr();
bx::skip(&reader, shaderSize+1);
@@ -2733,10 +2892,12 @@ namespace bgfx { namespace mtl
const uint32_t msaaQuality = bx::uint32_satsub( (_flags&BGFX_TEXTURE_RT_MSAA_MASK)>>BGFX_TEXTURE_RT_MSAA_SHIFT, 1);
const int32_t sampleCount = s_msaa[msaaQuality];
+ const TextureFormatInfo& tfi = s_textureFormat[m_textureFormat];
+
MTLPixelFormat format = MTLPixelFormatInvalid;
if (srgb)
{
- format = s_textureFormat[m_textureFormat].m_fmtSrgb;
+ format = tfi.m_fmtSrgb;
BX_WARN(format != MTLPixelFormatInvalid
, "sRGB not supported for texture format %d"
, m_textureFormat
@@ -2746,7 +2907,7 @@ namespace bgfx { namespace mtl
if (format == MTLPixelFormatInvalid)
{
// not swizzled and not sRGB, or sRGB unsupported
- format = s_textureFormat[m_textureFormat].m_fmt;
+ format = tfi.m_fmt;
}
desc.pixelFormat = format;
@@ -2756,6 +2917,7 @@ namespace bgfx { namespace mtl
desc.mipmapLevelCount = ti.numMips;
desc.sampleCount = 1;
desc.arrayLength = ti.numLayers;
+ desc.swizzle = tfi.m_mapping;
if (s_renderMtl->m_iOS9Runtime
|| s_renderMtl->m_macOS11Runtime)
@@ -2812,7 +2974,7 @@ namespace bgfx { namespace mtl
temp = (uint8_t*)BX_ALLOC(g_allocator, ti.width*ti.height*4);
}
- for (uint8_t side = 0; side < numSides; ++side)
+ for (uint16_t side = 0; side < numSides; ++side)
{
uint32_t width = ti.width;
uint32_t height = ti.height;
@@ -2894,7 +3056,7 @@ namespace bgfx { namespace mtl
{
const uint32_t bpp = bimg::getBitsPerPixel(bimg::TextureFormat::Enum(m_textureFormat) );
uint32_t rectpitch = _rect.m_width*bpp/8;
- if (bimg::isCompressed(bimg::TextureFormat::Enum(m_textureFormat)))
+ if (bimg::isCompressed(bimg::TextureFormat::Enum(m_textureFormat) ) )
{
if (m_ptr.pixelFormat() >= 160 /*PVRTC_RGB_2BPP*/
&& m_ptr.pixelFormat() <= 167 /*PVRTC_RGBA_4BPP_sRGB*/)
@@ -2903,7 +3065,7 @@ namespace bgfx { namespace mtl
}
else
{
- const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(m_textureFormat));
+ const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(m_textureFormat) );
rectpitch = (_rect.m_width / blockInfo.blockWidth)*blockInfo.blockSize;
}
}
@@ -2976,7 +3138,7 @@ namespace bgfx { namespace mtl
};
tempTexture.replaceRegion(region, 0, 0, data, srcpitch, srcpitch * _rect.m_height);
bce.copyFromTexture(tempTexture, 0, 0, MTLOriginMake(0,0,0), MTLSizeMake(_rect.m_width, _rect.m_height, _depth),
- m_ptr, slice, _mip, MTLOriginMake(_rect.m_x, _rect.m_y, zz));
+ m_ptr, slice, _mip, MTLOriginMake(_rect.m_x, _rect.m_y, zz) );
release(tempTexture);
}
@@ -2986,11 +3148,12 @@ namespace bgfx { namespace mtl
}
}
- void TextureMtl::commit(uint8_t _stage, bool _vertex, bool _fragment, uint32_t _flags)
+ void TextureMtl::commit(uint8_t _stage, bool _vertex, bool _fragment, uint32_t _flags, uint8_t _mip)
{
if (_vertex)
{
- s_renderMtl->m_renderCommandEncoder.setVertexTexture(m_ptr, _stage);
+ Texture p = _mip != UINT8_MAX ? getTextureMipLevel(_mip) : m_ptr;
+ s_renderMtl->m_renderCommandEncoder.setVertexTexture(p, _stage);
s_renderMtl->m_renderCommandEncoder.setVertexSamplerState(
0 == (BGFX_SAMPLER_INTERNAL_DEFAULT & _flags)
? s_renderMtl->getSamplerState(_flags)
@@ -3001,7 +3164,8 @@ namespace bgfx { namespace mtl
if (_fragment)
{
- s_renderMtl->m_renderCommandEncoder.setFragmentTexture(m_ptr, _stage);
+ Texture p = _mip != UINT8_MAX ? getTextureMipLevel(_mip) : m_ptr;
+ s_renderMtl->m_renderCommandEncoder.setFragmentTexture(p, _stage);
s_renderMtl->m_renderCommandEncoder.setFragmentSamplerState(
0 == (BGFX_SAMPLER_INTERNAL_DEFAULT & _flags)
? s_renderMtl->getSamplerState(_flags)
@@ -3034,7 +3198,7 @@ namespace bgfx { namespace mtl
m_ptr.pixelFormat()
, m_ptr.textureType()
, NSMakeRange(_mip,1)
- , NSMakeRange(0,m_ptr.arrayLength())
+ , NSMakeRange(0,m_ptr.arrayLength() )
);
}
}
@@ -3173,13 +3337,13 @@ namespace bgfx { namespace mtl
#if BX_PLATFORM_OSX
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
- if (@available(macOS 10.13, *))
+ if (@available(macOS 10.13, *) )
{
m_metalLayer.displaySyncEnabled = 0 != (_flags&BGFX_RESET_VSYNC);
}
- if (@available(macOS 10.13.2, *))
+ if (@available(macOS 10.13.2, *) )
{
- m_metalLayer.maximumDrawableCount = bx::clamp<uint32_t>(_maximumDrawableCount, 2, 3);
+ m_metalLayer.maximumDrawableCount = bx::clamp<uint32_t>(_maximumDrawableCount != 0 ? _maximumDrawableCount : BGFX_CONFIG_MAX_FRAME_LATENCY, 2, 3);
}
#endif // __MAC_OS_X_VERSION_MAX_ALLOWED >= 101300
#endif // BX_PLATFORM_OSX
@@ -3256,8 +3420,8 @@ namespace bgfx { namespace mtl
murmur.begin();
murmur.add(1);
murmur.add( (uint32_t)m_metalLayer.pixelFormat);
- murmur.add( (uint32_t)m_backBufferDepth.pixelFormat());
- murmur.add( (uint32_t)m_backBufferStencil.pixelFormat());
+ murmur.add( (uint32_t)m_backBufferDepth.pixelFormat() );
+ murmur.add( (uint32_t)m_backBufferStencil.pixelFormat() );
murmur.add( (uint32_t)sampleCount);
_frameBuffer.m_pixelFormatHash = murmur.end();
}
@@ -3406,6 +3570,28 @@ namespace bgfx { namespace mtl
return denseIdx;
}
+ 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);
+ if (isRenderTarget
+ && fmtSupport
+ && texture.m_numMips > 1)
+ {
+ bce.generateMipmapsForTexture(texture.m_ptr);
+ }
+ }
+ }
+
+ s_renderMtl->endEncoding();
+ }
+
void CommandQueueMtl::init(Device _device)
{
m_commandQueue = _device.newCommandQueue();
@@ -3507,9 +3693,10 @@ namespace bgfx { namespace mtl
{
}
- uint32_t TimerQueryMtl::begin(uint32_t _resultIdx)
+ uint32_t TimerQueryMtl::begin(uint32_t _resultIdx, uint32_t _frameNum)
{
BX_UNUSED(_resultIdx);
+ BX_UNUSED(_frameNum);
return 0;
}
@@ -3883,8 +4070,8 @@ namespace bgfx { namespace mtl
Rect viewRect = viewState.m_rect;
bool clearWithRenderPass = false;
- if ((NULL == m_renderCommandEncoder
- || fbh.idx != _render->m_view[view].m_fbh.idx))
+ if (NULL == m_renderCommandEncoder
+ || fbh.idx != _render->m_view[view].m_fbh.idx)
{
endEncoding();
@@ -4344,14 +4531,17 @@ namespace bgfx { namespace mtl
if ( (0
| BGFX_STATE_CULL_MASK
+ | BGFX_STATE_FRONT_CCW
| BGFX_STATE_ALPHA_REF_MASK
| BGFX_STATE_PT_MASK
- | BGFX_STATE_FRONT_CCW
) & changedFlags)
{
if (BGFX_STATE_FRONT_CCW & changedFlags)
{
- rce.setFrontFacingWinding((newFlags&BGFX_STATE_FRONT_CCW) ? MTLWindingCounterClockwise : MTLWindingClockwise);
+ rce.setFrontFacingWinding( (newFlags&BGFX_STATE_FRONT_CCW)
+ ? MTLWindingCounterClockwise
+ : MTLWindingClockwise
+ );
}
if (BGFX_STATE_CULL_MASK & changedFlags)
@@ -4539,39 +4729,72 @@ namespace bgfx { namespace mtl
const Binding& bind = renderBind.m_bind[stage];
Binding& current = currentBind.m_bind[stage];
if (current.m_idx != bind.m_idx
- || current.m_type != bind.m_type
- || current.m_samplerFlags != bind.m_samplerFlags
- || programChanged)
+ || current.m_type != bind.m_type
+ || current.m_samplerFlags != bind.m_samplerFlags
+ || programChanged)
{
if (kInvalidHandle != bind.m_idx)
{
switch (bind.m_type)
{
- case Binding::Texture:
+ case Binding::Image:
+ {
+ 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");
+ }
+
+ 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)));
+ }
+ TextureMtl& texture = m_textures[bind.m_idx];
+ texture.commit(
+ stage
+ , 0 != (bindingTypes[stage] & PipelineStateMtl::BindToVertexShader)
+ , 0 != (bindingTypes[stage] & PipelineStateMtl::BindToFragmentShader)
+ , bind.m_samplerFlags
+ , bind.m_mip
+ );
+ }
+ break;
+ case Binding::Texture:
{
TextureMtl& texture = m_textures[bind.m_idx];
- texture.commit(stage
- , 0 != (bindingTypes[stage] & PipelineStateMtl::BindToVertexShader)
- , 0 != (bindingTypes[stage] & PipelineStateMtl::BindToFragmentShader)
- , bind.m_samplerFlags
- );
+ texture.commit(
+ stage
+ , 0 != (bindingTypes[stage] & PipelineStateMtl::BindToVertexShader)
+ , 0 != (bindingTypes[stage] & PipelineStateMtl::BindToFragmentShader)
+ , bind.m_samplerFlags
+ );
}
- break;
+ break;
- case Binding::IndexBuffer:
- case Binding::VertexBuffer:
+ case Binding::IndexBuffer:
+ case Binding::VertexBuffer:
{
const BufferMtl& buffer = Binding::IndexBuffer == bind.m_type
- ? m_indexBuffers[bind.m_idx]
- : m_vertexBuffers[bind.m_idx]
- ;
+ ? m_indexBuffers[bind.m_idx]
+ : m_vertexBuffers[bind.m_idx]
+ ;
- if (0 != (bindingTypes[stage] & PipelineStateMtl::BindToVertexShader))
+ if (0 != (bindingTypes[stage] & PipelineStateMtl::BindToVertexShader) )
+ {
rce.setVertexBuffer(buffer.m_ptr, 0, stage + 1);
- if (0 != (bindingTypes[stage] & PipelineStateMtl::BindToFragmentShader))
+ }
+
+ if (0 != (bindingTypes[stage] & PipelineStateMtl::BindToFragmentShader) )
+ {
rce.setFragmentBuffer(buffer.m_ptr, 0, stage + 1);
+ }
}
- break;
+ break;
}
}
}
@@ -4754,6 +4977,7 @@ namespace bgfx { namespace mtl
perfStats.numCompute = statsKeyType[1];
perfStats.numBlit = _render->m_numBlitItems;
perfStats.maxGpuLatency = maxGpuLatency;
+ perfStats.gpuFrameNum = 0; // TODO: take from TimerQueryMtl::Result
bx::memCopy(perfStats.numPrims, statsNumPrimsRendered, sizeof(perfStats.numPrims) );
perfStats.gpuMemoryMax = -INT64_MAX;
perfStats.gpuMemoryUsed = -INT64_MAX;
@@ -4877,7 +5101,15 @@ namespace bgfx { namespace mtl
rce.setRenderPipelineState(m_screenshotBlitRenderPipelineState);
- rce.setFragmentSamplerState(getSamplerState(BGFX_SAMPLER_U_CLAMP|BGFX_SAMPLER_V_CLAMP|BGFX_SAMPLER_MIN_POINT|BGFX_SAMPLER_MAG_POINT|BGFX_SAMPLER_MIP_POINT), 0);
+ const SamplerState samplerState = getSamplerState(0
+ | BGFX_SAMPLER_U_CLAMP
+ | BGFX_SAMPLER_V_CLAMP
+ | BGFX_SAMPLER_MIN_POINT
+ | BGFX_SAMPLER_MAG_POINT
+ | BGFX_SAMPLER_MIP_POINT
+ );
+
+ rce.setFragmentSamplerState(samplerState, 0);
rce.setFragmentTexture(m_screenshotTarget, 0);
rce.drawPrimitives(MTLPrimitiveTypeTriangle, 0, 3, 1);
diff --git a/3rdparty/bgfx/src/renderer_noop.cpp b/3rdparty/bgfx/src/renderer_noop.cpp
index d366adb4816..ee051ee90ce 100644
--- a/3rdparty/bgfx/src/renderer_noop.cpp
+++ b/3rdparty/bgfx/src/renderer_noop.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -252,6 +252,7 @@ namespace bgfx { namespace noop
perfStats.gpuTimeBegin = 0;
perfStats.gpuTimeEnd = 0;
perfStats.gpuTimerFreq = 1000000000;
+ perfStats.gpuFrameNum = 0;
bx::memSet(perfStats.numPrims, 0, sizeof(perfStats.numPrims) );
diff --git a/3rdparty/bgfx/src/renderer_nvn.cpp b/3rdparty/bgfx/src/renderer_nvn.cpp
index 799264a2c35..fedfc6c4e95 100644
--- a/3rdparty/bgfx/src/renderer_nvn.cpp
+++ b/3rdparty/bgfx/src/renderer_nvn.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
diff --git a/3rdparty/bgfx/src/renderer_vk.cpp b/3rdparty/bgfx/src/renderer_vk.cpp
index 6bff243f8b5..30c7b99f1ca 100644
--- a/3rdparty/bgfx/src/renderer_vk.cpp
+++ b/3rdparty/bgfx/src/renderer_vk.cpp
@@ -1,14 +1,14 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
#if BGFX_CONFIG_RENDERER_VULKAN
+# include <bx/pixelformat.h>
# include "renderer_vk.h"
# include "shader_spirv.h"
-# include <bx/pixelformat.h>
#if BX_PLATFORM_OSX
# import <Cocoa/Cocoa.h>
@@ -160,91 +160,116 @@ VK_IMPORT_DEVICE
static const TextureFormatInfo s_textureFormat[] =
{
- { VK_FORMAT_BC1_RGB_UNORM_BLOCK, VK_FORMAT_BC1_RGB_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_BC1_RGB_SRGB_BLOCK, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // BC1
- { VK_FORMAT_BC2_UNORM_BLOCK, VK_FORMAT_BC2_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_BC2_SRGB_BLOCK, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // BC2
- { VK_FORMAT_BC3_UNORM_BLOCK, VK_FORMAT_BC3_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_BC3_SRGB_BLOCK, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // BC3
- { VK_FORMAT_BC4_UNORM_BLOCK, VK_FORMAT_BC4_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // BC4
- { VK_FORMAT_BC5_UNORM_BLOCK, VK_FORMAT_BC5_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // BC5
- { VK_FORMAT_BC6H_SFLOAT_BLOCK, VK_FORMAT_BC6H_SFLOAT_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // BC6H
- { VK_FORMAT_BC7_UNORM_BLOCK, VK_FORMAT_BC7_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_BC7_SRGB_BLOCK, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // BC7
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // ETC1
- { VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // ETC2
- { VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // ETC2A
- { VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // ETC2A1
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // PTC12
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // PTC14
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // PTC12A
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // PTC14A
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // PTC22
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // PTC24
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // ATC
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // ATCE
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // ATCI
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // ASTC4x4
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // ASTC5x5
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // ASTC6x6
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // ASTC8x5
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // ASTC8x6
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // ASTC10x5
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // Unknown
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R1
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // A8
- { VK_FORMAT_R8_UNORM, VK_FORMAT_R8_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_R8_SRGB, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R8
- { VK_FORMAT_R8_SINT, VK_FORMAT_R8_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R8I
- { VK_FORMAT_R8_UINT, VK_FORMAT_R8_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R8U
- { VK_FORMAT_R8_SNORM, VK_FORMAT_R8_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R8S
- { VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R16
- { VK_FORMAT_R16_SINT, VK_FORMAT_R16_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R16I
- { VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R16U
- { VK_FORMAT_R16_SFLOAT, VK_FORMAT_R16_SFLOAT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R16F
- { VK_FORMAT_R16_SNORM, VK_FORMAT_R16_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R16S
- { VK_FORMAT_R32_SINT, VK_FORMAT_R32_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R32I
- { VK_FORMAT_R32_UINT, VK_FORMAT_R32_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R32U
- { VK_FORMAT_R32_SFLOAT, VK_FORMAT_R32_SFLOAT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R32F
- { VK_FORMAT_R8G8_UNORM, VK_FORMAT_R8G8_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8_SRGB, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RG8
- { VK_FORMAT_R8G8_SINT, VK_FORMAT_R8G8_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RG8I
- { VK_FORMAT_R8G8_UINT, VK_FORMAT_R8G8_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RG8U
- { VK_FORMAT_R8G8_SNORM, VK_FORMAT_R8G8_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RG8S
- { VK_FORMAT_R16G16_UNORM, VK_FORMAT_R16G16_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RG16
- { VK_FORMAT_R16G16_SINT, VK_FORMAT_R16G16_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RG16I
- { VK_FORMAT_R16G16_UINT, VK_FORMAT_R16G16_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RG16U
- { VK_FORMAT_R16G16_SFLOAT, VK_FORMAT_R16G16_SFLOAT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RG16F
- { VK_FORMAT_R16G16_SNORM, VK_FORMAT_R16G16_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RG16S
- { VK_FORMAT_R32G32_SINT, VK_FORMAT_R32G32_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RG32I
- { VK_FORMAT_R32G32_UINT, VK_FORMAT_R32G32_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RG32U
- { VK_FORMAT_R32G32_SFLOAT, VK_FORMAT_R32G32_SFLOAT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RG32F
- { VK_FORMAT_R8G8B8_UNORM, VK_FORMAT_R8G8B8_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8B8_SRGB, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGB8
- { VK_FORMAT_R8G8B8_SINT, VK_FORMAT_R8G8B8_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8B8_SRGB, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGB8I
- { VK_FORMAT_R8G8B8_UINT, VK_FORMAT_R8G8B8_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8B8_SRGB, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGB8U
- { VK_FORMAT_R8G8B8_SNORM, VK_FORMAT_R8G8B8_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGB8S
- { VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGB9E5F
- { VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_B8G8R8A8_SRGB, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // BGRA8
- { VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8B8A8_SRGB, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGBA8
- { VK_FORMAT_R8G8B8A8_SINT, VK_FORMAT_R8G8B8A8_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8B8A8_SRGB, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGBA8I
- { VK_FORMAT_R8G8B8A8_UINT, VK_FORMAT_R8G8B8A8_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8B8A8_SRGB, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGBA8U
- { VK_FORMAT_R8G8B8A8_SNORM, VK_FORMAT_R8G8B8A8_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGBA8S
- { VK_FORMAT_R16G16B16A16_UNORM, VK_FORMAT_R16G16B16A16_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGBA16
- { VK_FORMAT_R16G16B16A16_SINT, VK_FORMAT_R16G16B16A16_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGBA16I
- { VK_FORMAT_R16G16B16A16_UINT, VK_FORMAT_R16G16B16A16_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGBA16U
- { VK_FORMAT_R16G16B16A16_SFLOAT, VK_FORMAT_R16G16B16A16_SFLOAT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGBA16F
- { VK_FORMAT_R16G16B16A16_SNORM, VK_FORMAT_R16G16B16A16_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGBA16S
- { VK_FORMAT_R32G32B32A32_SINT, VK_FORMAT_R32G32B32A32_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGBA32I
- { VK_FORMAT_R32G32B32A32_UINT, VK_FORMAT_R32G32B32A32_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGBA32U
- { VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGBA32F
- { VK_FORMAT_B5G6R5_UNORM_PACK16, VK_FORMAT_B5G6R5_UNORM_PACK16, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // R5G6B5
- { VK_FORMAT_B4G4R4A4_UNORM_PACK16, VK_FORMAT_B4G4R4A4_UNORM_PACK16, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_G, VK_COMPONENT_SWIZZLE_R, VK_COMPONENT_SWIZZLE_A, VK_COMPONENT_SWIZZLE_B } }, // RGBA4
- { VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGB5A1
- { VK_FORMAT_A2R10G10B10_UNORM_PACK32, VK_FORMAT_A2R10G10B10_UNORM_PACK32, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RGB10A2
- { VK_FORMAT_B10G11R11_UFLOAT_PACK32, VK_FORMAT_B10G11R11_UFLOAT_PACK32, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // RG11B10F
- { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // UnknownDepth
- { VK_FORMAT_UNDEFINED, VK_FORMAT_R16_UNORM, VK_FORMAT_D16_UNORM, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // D16
- { VK_FORMAT_UNDEFINED, VK_FORMAT_X8_D24_UNORM_PACK32, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // D24
- { VK_FORMAT_UNDEFINED, VK_FORMAT_X8_D24_UNORM_PACK32, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // D24S8
- { VK_FORMAT_UNDEFINED, VK_FORMAT_X8_D24_UNORM_PACK32, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // D32
- { VK_FORMAT_UNDEFINED, VK_FORMAT_R32_SFLOAT, VK_FORMAT_D32_SFLOAT, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // D16F
- { VK_FORMAT_UNDEFINED, VK_FORMAT_R32_SFLOAT, VK_FORMAT_D32_SFLOAT, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // D24F
- { VK_FORMAT_UNDEFINED, VK_FORMAT_R32_SFLOAT, VK_FORMAT_D32_SFLOAT, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // D32F
- { VK_FORMAT_UNDEFINED, VK_FORMAT_X8_D24_UNORM_PACK32, VK_FORMAT_D24_UNORM_S8_UINT, VK_FORMAT_UNDEFINED, { VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY, VK_COMPONENT_SWIZZLE_IDENTITY } }, // D0S8
+#define $_ VK_COMPONENT_SWIZZLE_IDENTITY
+#define $0 VK_COMPONENT_SWIZZLE_ZERO
+#define $1 VK_COMPONENT_SWIZZLE_ONE
+#define $R VK_COMPONENT_SWIZZLE_R
+#define $G VK_COMPONENT_SWIZZLE_G
+#define $B VK_COMPONENT_SWIZZLE_B
+#define $A VK_COMPONENT_SWIZZLE_A
+ { VK_FORMAT_BC1_RGB_UNORM_BLOCK, VK_FORMAT_BC1_RGB_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_BC1_RGB_SRGB_BLOCK, { $_, $_, $_, $_ } }, // BC1
+ { VK_FORMAT_BC2_UNORM_BLOCK, VK_FORMAT_BC2_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_BC2_SRGB_BLOCK, { $_, $_, $_, $_ } }, // BC2
+ { VK_FORMAT_BC3_UNORM_BLOCK, VK_FORMAT_BC3_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_BC3_SRGB_BLOCK, { $_, $_, $_, $_ } }, // BC3
+ { VK_FORMAT_BC4_UNORM_BLOCK, VK_FORMAT_BC4_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // BC4
+ { VK_FORMAT_BC5_UNORM_BLOCK, VK_FORMAT_BC5_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // BC5
+ { VK_FORMAT_BC6H_SFLOAT_BLOCK, VK_FORMAT_BC6H_SFLOAT_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // BC6H
+ { VK_FORMAT_BC7_UNORM_BLOCK, VK_FORMAT_BC7_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_BC7_SRGB_BLOCK, { $_, $_, $_, $_ } }, // BC7
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // ETC1
+ { VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ETC2
+ { VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ETC2A
+ { VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ETC2A1
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // PTC12
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // PTC14
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // PTC12A
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // PTC14A
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // PTC22
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // PTC24
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // ATC
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // ATCE
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // ATCI
+ { VK_FORMAT_ASTC_4x4_UNORM_BLOCK, VK_FORMAT_ASTC_4x4_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_4x4_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC4x4
+ { VK_FORMAT_ASTC_5x4_UNORM_BLOCK, VK_FORMAT_ASTC_5x4_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_5x4_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC5x4
+ { VK_FORMAT_ASTC_5x5_UNORM_BLOCK, VK_FORMAT_ASTC_5x5_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_5x5_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC5x5
+ { VK_FORMAT_ASTC_6x5_UNORM_BLOCK, VK_FORMAT_ASTC_6x5_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_6x5_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC6x5
+ { VK_FORMAT_ASTC_6x6_UNORM_BLOCK, VK_FORMAT_ASTC_6x6_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_6x6_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC6x6
+ { VK_FORMAT_ASTC_8x5_UNORM_BLOCK, VK_FORMAT_ASTC_8x5_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_8x5_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC8x5
+ { VK_FORMAT_ASTC_8x6_UNORM_BLOCK, VK_FORMAT_ASTC_8x6_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_8x6_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC8x6
+ { VK_FORMAT_ASTC_8x8_UNORM_BLOCK, VK_FORMAT_ASTC_8x8_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_8x8_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC8x8
+ { VK_FORMAT_ASTC_10x5_UNORM_BLOCK, VK_FORMAT_ASTC_10x5_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_10x5_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC10x5
+ { VK_FORMAT_ASTC_10x6_UNORM_BLOCK, VK_FORMAT_ASTC_10x6_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_10x6_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC10x6
+ { VK_FORMAT_ASTC_10x8_UNORM_BLOCK, VK_FORMAT_ASTC_10x8_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_10x8_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC10x8
+ { VK_FORMAT_ASTC_10x10_UNORM_BLOCK, VK_FORMAT_ASTC_10x10_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_10x10_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC10x10
+ { VK_FORMAT_ASTC_12x10_UNORM_BLOCK, VK_FORMAT_ASTC_12x10_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_12x10_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC12x10
+ { VK_FORMAT_ASTC_12x12_UNORM_BLOCK, VK_FORMAT_ASTC_12x12_UNORM_BLOCK, VK_FORMAT_UNDEFINED, VK_FORMAT_ASTC_12x12_SRGB_BLOCK, { $_, $_, $_, $_ } }, // ASTC12x12
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // Unknown
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // R1
+ { VK_FORMAT_R8_UNORM, VK_FORMAT_R8_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $0, $0, $0, $R } }, // A8
+ { VK_FORMAT_R8_UNORM, VK_FORMAT_R8_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_R8_SRGB, { $_, $_, $_, $_ } }, // R8
+ { VK_FORMAT_R8_SINT, VK_FORMAT_R8_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // R8I
+ { VK_FORMAT_R8_UINT, VK_FORMAT_R8_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // R8U
+ { VK_FORMAT_R8_SNORM, VK_FORMAT_R8_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // R8S
+ { VK_FORMAT_R16_UNORM, VK_FORMAT_R16_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // R16
+ { VK_FORMAT_R16_SINT, VK_FORMAT_R16_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // R16I
+ { VK_FORMAT_R16_UINT, VK_FORMAT_R16_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // R16U
+ { VK_FORMAT_R16_SFLOAT, VK_FORMAT_R16_SFLOAT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // R16F
+ { VK_FORMAT_R16_SNORM, VK_FORMAT_R16_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // R16S
+ { VK_FORMAT_R32_SINT, VK_FORMAT_R32_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // R32I
+ { VK_FORMAT_R32_UINT, VK_FORMAT_R32_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // R32U
+ { VK_FORMAT_R32_SFLOAT, VK_FORMAT_R32_SFLOAT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // R32F
+ { VK_FORMAT_R8G8_UNORM, VK_FORMAT_R8G8_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8_SRGB, { $_, $_, $_, $_ } }, // RG8
+ { VK_FORMAT_R8G8_SINT, VK_FORMAT_R8G8_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RG8I
+ { VK_FORMAT_R8G8_UINT, VK_FORMAT_R8G8_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RG8U
+ { VK_FORMAT_R8G8_SNORM, VK_FORMAT_R8G8_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RG8S
+ { VK_FORMAT_R16G16_UNORM, VK_FORMAT_R16G16_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RG16
+ { VK_FORMAT_R16G16_SINT, VK_FORMAT_R16G16_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RG16I
+ { VK_FORMAT_R16G16_UINT, VK_FORMAT_R16G16_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RG16U
+ { VK_FORMAT_R16G16_SFLOAT, VK_FORMAT_R16G16_SFLOAT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RG16F
+ { VK_FORMAT_R16G16_SNORM, VK_FORMAT_R16G16_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RG16S
+ { VK_FORMAT_R32G32_SINT, VK_FORMAT_R32G32_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RG32I
+ { VK_FORMAT_R32G32_UINT, VK_FORMAT_R32G32_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RG32U
+ { VK_FORMAT_R32G32_SFLOAT, VK_FORMAT_R32G32_SFLOAT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RG32F
+ { VK_FORMAT_R8G8B8_UNORM, VK_FORMAT_R8G8B8_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8B8_SRGB, { $_, $_, $_, $_ } }, // RGB8
+ { VK_FORMAT_R8G8B8_SINT, VK_FORMAT_R8G8B8_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8B8_SRGB, { $_, $_, $_, $_ } }, // RGB8I
+ { VK_FORMAT_R8G8B8_UINT, VK_FORMAT_R8G8B8_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8B8_SRGB, { $_, $_, $_, $_ } }, // RGB8U
+ { VK_FORMAT_R8G8B8_SNORM, VK_FORMAT_R8G8B8_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RGB8S
+ { VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RGB9E5F
+ { VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_B8G8R8A8_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_B8G8R8A8_SRGB, { $_, $_, $_, $_ } }, // BGRA8
+ { VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_R8G8B8A8_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8B8A8_SRGB, { $_, $_, $_, $_ } }, // RGBA8
+ { VK_FORMAT_R8G8B8A8_SINT, VK_FORMAT_R8G8B8A8_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8B8A8_SRGB, { $_, $_, $_, $_ } }, // RGBA8I
+ { VK_FORMAT_R8G8B8A8_UINT, VK_FORMAT_R8G8B8A8_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_R8G8B8A8_SRGB, { $_, $_, $_, $_ } }, // RGBA8U
+ { VK_FORMAT_R8G8B8A8_SNORM, VK_FORMAT_R8G8B8A8_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RGBA8S
+ { VK_FORMAT_R16G16B16A16_UNORM, VK_FORMAT_R16G16B16A16_UNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RGBA16
+ { VK_FORMAT_R16G16B16A16_SINT, VK_FORMAT_R16G16B16A16_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RGBA16I
+ { VK_FORMAT_R16G16B16A16_UINT, VK_FORMAT_R16G16B16A16_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RGBA16U
+ { VK_FORMAT_R16G16B16A16_SFLOAT, VK_FORMAT_R16G16B16A16_SFLOAT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RGBA16F
+ { VK_FORMAT_R16G16B16A16_SNORM, VK_FORMAT_R16G16B16A16_SNORM, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RGBA16S
+ { VK_FORMAT_R32G32B32A32_SINT, VK_FORMAT_R32G32B32A32_SINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RGBA32I
+ { VK_FORMAT_R32G32B32A32_UINT, VK_FORMAT_R32G32B32A32_UINT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RGBA32U
+ { VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RGBA32F
+ { VK_FORMAT_R5G6B5_UNORM_PACK16, VK_FORMAT_R5G6B5_UNORM_PACK16, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // B5G6R5
+ { VK_FORMAT_B5G6R5_UNORM_PACK16, VK_FORMAT_B5G6R5_UNORM_PACK16, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // R5G6B5
+ { VK_FORMAT_B4G4R4A4_UNORM_PACK16, VK_FORMAT_B4G4R4A4_UNORM_PACK16, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $G, $R, $A, $B } }, // BGRA4
+ { VK_FORMAT_R4G4B4A4_UNORM_PACK16, VK_FORMAT_R4G4B4A4_UNORM_PACK16, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $A, $B, $G, $R } }, // RGBA4
+ { VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // BGR5A1
+ { VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_FORMAT_A1R5G5B5_UNORM_PACK16, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $B, $G, $R, $A } }, // RGB5A1
+ { VK_FORMAT_A2R10G10B10_UNORM_PACK32, VK_FORMAT_A2R10G10B10_UNORM_PACK32, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $B, $G, $R, $A } }, // RGB10A2
+ { VK_FORMAT_B10G11R11_UFLOAT_PACK32, VK_FORMAT_B10G11R11_UFLOAT_PACK32, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // RG11B10F
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // UnknownDepth
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_R16_UNORM, VK_FORMAT_D16_UNORM, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // D16
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_R32_SFLOAT, VK_FORMAT_D32_SFLOAT_S8_UINT, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // D24
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_R32_SFLOAT, VK_FORMAT_D32_SFLOAT_S8_UINT, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // D24S8
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_R32_SFLOAT, VK_FORMAT_D32_SFLOAT_S8_UINT, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // D32
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_R32_SFLOAT, VK_FORMAT_D32_SFLOAT, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // D16F
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_R32_SFLOAT, VK_FORMAT_D32_SFLOAT, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // D24F
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_R32_SFLOAT, VK_FORMAT_D32_SFLOAT, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // D32F
+ { VK_FORMAT_UNDEFINED, VK_FORMAT_R8_UINT, VK_FORMAT_S8_UINT, VK_FORMAT_UNDEFINED, { $_, $_, $_, $_ } }, // D0S8
+#undef $_
+#undef $0
+#undef $1
+#undef $R
+#undef $G
+#undef $B
+#undef $A
};
BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_textureFormat) );
@@ -270,27 +295,31 @@ VK_IMPORT_DEVICE
LayerInfo m_device;
};
-
// Layer registry
//
static Layer s_layer[] =
{
{ "VK_LAYER_LUNARG_standard_validation", 1, { false, false }, { false, false } },
{ "VK_LAYER_KHRONOS_validation", 1, { false, false }, { false, false } },
+ { "", 0, { false, false }, { false, false } },
};
- BX_STATIC_ASSERT(Layer::Count == BX_COUNTOF(s_layer) );
+ BX_STATIC_ASSERT(Layer::Count == BX_COUNTOF(s_layer)-1);
void updateLayer(const char* _name, uint32_t _version, bool _instanceLayer)
{
- bx::StringView lyr(_name);
+ bx::StringView layerName(_name);
for (uint32_t ii = 0; ii < Layer::Count; ++ii)
{
Layer& layer = s_layer[ii];
- LayerInfo& layerInfo = _instanceLayer ? layer.m_instance : layer.m_device;
+ LayerInfo& layerInfo = _instanceLayer
+ ? layer.m_instance
+ : layer.m_device
+ ;
+
if (!layerInfo.m_supported && layerInfo.m_initialize)
{
- if ( 0 == bx::strCmp(lyr, layer.m_name)
+ if ( 0 == bx::strCmp(layerName, layer.m_name)
&& _version >= layer.m_minVersion)
{
layerInfo.m_supported = true;
@@ -312,15 +341,16 @@ VK_IMPORT_DEVICE
EXT_line_rasterization,
EXT_shader_viewport_index_layer,
EXT_custom_border_color,
+ KHR_draw_indirect_count,
Count
};
const char* m_name;
- uint32_t m_minVersion;
- bool m_instanceExt;
- bool m_supported;
- bool m_initialize;
+ uint32_t m_minVersion;
+ bool m_instanceExt;
+ bool m_supported;
+ bool m_initialize;
Layer::Enum m_layer;
};
@@ -336,6 +366,7 @@ VK_IMPORT_DEVICE
{ "VK_EXT_line_rasterization", 1, false, false, true , Layer::Count },
{ "VK_EXT_shader_viewport_index_layer", 1, false, false, true , Layer::Count },
{ "VK_EXT_custom_border_color", 1, false, false, true , Layer::Count },
+ { "VK_KHR_draw_indirect_count", 1, false, false, true , Layer::Count },
};
BX_STATIC_ASSERT(Extension::Count == BX_COUNTOF(s_extension) );
@@ -348,7 +379,7 @@ VK_IMPORT_DEVICE
for (uint32_t ii = 0; ii < Extension::Count; ++ii)
{
Extension& extension = _extensions[ii];
- LayerInfo& layerInfo = _instanceExt
+ const LayerInfo& layerInfo = _instanceExt
? s_layer[extension.m_layer].m_instance
: s_layer[extension.m_layer].m_device
;
@@ -1161,6 +1192,7 @@ VK_IMPORT
s_extension[Extension::EXT_shader_viewport_index_layer].m_initialize = !!(_init.capabilities & BGFX_CAPS_VIEWPORT_LAYER_ARRAY);
s_extension[Extension::EXT_conservative_rasterization ].m_initialize = !!(_init.capabilities & BGFX_CAPS_CONSERVATIVE_RASTER );
+ s_extension[Extension::KHR_draw_indirect_count ].m_initialize = !!(_init.capabilities & BGFX_CAPS_DRAW_INDIRECT_COUNT );
dumpExtensions(VK_NULL_HANDLE, s_extension);
@@ -1188,13 +1220,21 @@ VK_IMPORT
BX_TRACE("\t%s", layer.m_name);
}
}
+#if BX_PLATFORM_OSX
+ uint32_t numEnabledExtensions = headless ? 0 : 3;
+ const char* enabledExtension[Extension::Count + 3] =
+#else
uint32_t numEnabledExtensions = headless ? 0 : 2;
const char* enabledExtension[Extension::Count + 2] =
+#endif
{
VK_KHR_SURFACE_EXTENSION_NAME,
KHR_SURFACE_EXTENSION_NAME,
+#if BX_PLATFORM_OSX
+ VK_KHR_PORTABILITY_ENUMERATION_EXTENSION_NAME,
+#endif
};
for (uint32_t ii = 0; ii < Extension::Count; ++ii)
@@ -1256,7 +1296,11 @@ VK_IMPORT
VkInstanceCreateInfo ici;
ici.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
ici.pNext = NULL;
+#if BX_PLATFORM_OSX
+ ici.flags = 0 | VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
+#else
ici.flags = 0;
+#endif
ici.pApplicationInfo = &appInfo;
ici.enabledLayerCount = numEnabledLayers;
ici.ppEnabledLayerNames = enabledLayer;
@@ -1283,11 +1327,12 @@ VK_IMPORT
m_instanceApiVersion = vulkanApiVersionSelector;
- BX_TRACE("Instance API Version Selected: %d.%d.%d"
- , VK_VERSION_MAJOR(m_instanceApiVersion)
- , VK_VERSION_MINOR(m_instanceApiVersion)
- , VK_VERSION_PATCH(m_instanceApiVersion)
+ BX_TRACE("Instance API version: %d.%d.%d"
+ , VK_API_VERSION_MAJOR(m_instanceApiVersion)
+ , VK_API_VERSION_MINOR(m_instanceApiVersion)
+ , VK_API_VERSION_PATCH(m_instanceApiVersion)
);
+ BX_TRACE("Instance variant: %d", VK_API_VERSION_VARIANT(m_instanceApiVersion) );
}
errorState = ErrorState::InstanceCreated;
@@ -1368,9 +1413,11 @@ VK_IMPORT_INSTANCE
BX_TRACE("Physical device %d:", ii);
BX_TRACE("\t Name: %s", pdp.deviceName);
BX_TRACE("\t API version: %d.%d.%d"
- , VK_VERSION_MAJOR(pdp.apiVersion)
- , VK_VERSION_MINOR(pdp.apiVersion)
- , VK_VERSION_PATCH(pdp.apiVersion) );
+ , VK_API_VERSION_MAJOR(pdp.apiVersion)
+ , VK_API_VERSION_MINOR(pdp.apiVersion)
+ , VK_API_VERSION_PATCH(pdp.apiVersion)
+ );
+ BX_TRACE("\t API variant: %d", VK_API_VERSION_VARIANT(pdp.apiVersion) );
BX_TRACE("\tDriver version: %x", pdp.driverVersion);
BX_TRACE("\t VendorId: %x", pdp.vendorID);
BX_TRACE("\t DeviceId: %x", pdp.deviceID);
@@ -1384,11 +1431,21 @@ VK_IMPORT_INSTANCE
&& (BGFX_PCI_ID_NONE == g_caps.vendorId || pdp.vendorID == g_caps.vendorId)
&& (0 == g_caps.deviceId || pdp.deviceID == g_caps.deviceId) )
{
- if (BX_ENABLED(BGFX_CONFIG_PREFER_DISCRETE_GPU) && (pdp.deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) )
+ if (pdp.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
+ || pdp.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU)
{
fallbackPhysicalDeviceIdx = ii;
}
- else
+
+ physicalDeviceIdx = ii;
+ }
+ else
+ {
+ if (pdp.deviceType == VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU)
+ {
+ fallbackPhysicalDeviceIdx = ii;
+ }
+ else if (pdp.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU)
{
physicalDeviceIdx = ii;
}
@@ -1401,10 +1458,10 @@ VK_IMPORT_INSTANCE
for (uint32_t jj = 0; jj < pdmp.memoryTypeCount; ++jj)
{
BX_TRACE("\t%3d: flags 0x%08x, index %d"
- , jj
- , pdmp.memoryTypes[jj].propertyFlags
- , pdmp.memoryTypes[jj].heapIndex
- );
+ , jj
+ , pdmp.memoryTypes[jj].propertyFlags
+ , pdmp.memoryTypes[jj].heapIndex
+ );
}
BX_TRACE("\tMemory heap count: %d", pdmp.memoryHeapCount);
@@ -1413,10 +1470,10 @@ VK_IMPORT_INSTANCE
char size[16];
bx::prettify(size, BX_COUNTOF(size), pdmp.memoryHeaps[jj].size);
BX_TRACE("\t%3d: flags 0x%08x, size %10s"
- , jj
- , pdmp.memoryHeaps[jj].flags
- , size
- );
+ , jj
+ , pdmp.memoryHeaps[jj].flags
+ , size
+ );
}
bx::memCopy(&physicalDeviceExtensions[ii][0], &s_extension[0], sizeof(s_extension) );
@@ -1477,7 +1534,7 @@ VK_IMPORT_INSTANCE
vkGetPhysicalDeviceFeatures(m_physicalDevice, &supportedFeatures);
}
- memset(&m_deviceFeatures, 0, sizeof(m_deviceFeatures) );
+ bx::memSet(&m_deviceFeatures, 0, sizeof(m_deviceFeatures) );
m_deviceFeatures.fullDrawIndexUint32 = supportedFeatures.fullDrawIndexUint32;
m_deviceFeatures.imageCubeArray = supportedFeatures.imageCubeArray && (_init.capabilities & BGFX_CAPS_TEXTURE_CUBE_ARRAY);
@@ -1540,6 +1597,7 @@ VK_IMPORT_INSTANCE
g_caps.supported |= 0
| (s_extension[Extension::EXT_conservative_rasterization ].m_supported ? BGFX_CAPS_CONSERVATIVE_RASTER : 0)
| (s_extension[Extension::EXT_shader_viewport_index_layer].m_supported ? BGFX_CAPS_VIEWPORT_LAYER_ARRAY : 0)
+ | (s_extension[Extension::KHR_draw_indirect_count ].m_supported && indirectDrawSupport ? BGFX_CAPS_DRAW_INDIRECT_COUNT : 0)
;
const uint32_t maxAttachments = bx::min<uint32_t>(m_deviceProperties.limits.maxFragmentOutputAttachments, m_deviceProperties.limits.maxColorAttachments);
@@ -1721,13 +1779,21 @@ VK_IMPORT_INSTANCE
BX_TRACE("\t%s", layer.m_name);
}
}
+#if BX_PLATFORM_OSX
+ uint32_t numEnabledExtensions = headless ? 1 : 3;
+ const char* enabledExtension[Extension::Count + 3] =
+#else
uint32_t numEnabledExtensions = headless ? 1 : 2;
const char* enabledExtension[Extension::Count + 2] =
+#endif
{
VK_KHR_MAINTENANCE1_EXTENSION_NAME,
- VK_KHR_SWAPCHAIN_EXTENSION_NAME
+ VK_KHR_SWAPCHAIN_EXTENSION_NAME,
+#if BX_PLATFORM_OSX
+ "VK_KHR_portability_subset",
+#endif
};
for (uint32_t ii = 0; ii < Extension::Count; ++ii)
@@ -2267,7 +2333,7 @@ VK_IMPORT_DEVICE
bx::StaticMemoryBlockWriter writer(mem->data, mem->size);
uint32_t magic = BGFX_CHUNK_MAGIC_TEX;
- bx::write(&writer, magic);
+ bx::write(&writer, magic, bx::ErrorAssert{});
TextureCreate tc;
tc.m_width = _width;
@@ -2278,7 +2344,7 @@ VK_IMPORT_DEVICE
tc.m_format = format;
tc.m_cubeMap = false;
tc.m_mem = NULL;
- bx::write(&writer, tc);
+ bx::write(&writer, tc, bx::ErrorAssert{});
destroyTexture(_handle);
createTexture(_handle, mem, flags, 0);
@@ -2320,7 +2386,7 @@ VK_IMPORT_DEVICE
uint16_t denseIdx = m_numWindows++;
m_windows[denseIdx] = _handle;
- m_frameBuffers[_handle.idx].create(denseIdx, _nwh, _width, _height, _format, _depthFormat);
+ VK_CHECK(m_frameBuffers[_handle.idx].create(denseIdx, _nwh, _width, _height, _format, _depthFormat) );
}
void destroyFrameBuffer(FrameBufferHandle _handle) override
@@ -4690,8 +4756,10 @@ VK_DESTROY
{
bx::MemoryReader reader(_mem->data, _mem->size);
+ bx::ErrorAssert err;
+
uint32_t magic;
- bx::read(&reader, magic);
+ bx::read(&reader, magic, &err);
VkShaderStageFlagBits shaderStage = VK_SHADER_STAGE_ALL;
@@ -4711,7 +4779,7 @@ VK_DESTROY
const bool fragment = isShaderType(magic, 'F');
uint32_t hashIn;
- bx::read(&reader, hashIn);
+ bx::read(&reader, hashIn, &err);
uint32_t hashOut;
@@ -4721,15 +4789,15 @@ VK_DESTROY
}
else
{
- bx::read(&reader, hashOut);
+ bx::read(&reader, hashOut, &err);
}
uint16_t count;
- bx::read(&reader, count);
+ bx::read(&reader, count, &err);
m_numPredefined = 0;
- m_numUniforms = count;
- m_numTextures = 0;
+ m_numUniforms = count;
+ m_numTextures = 0;
m_oldBindingModel = isShaderVerLess(magic, 11);
@@ -4754,46 +4822,44 @@ VK_DESTROY
for (uint32_t ii = 0; ii < count; ++ii)
{
uint8_t nameSize = 0;
- bx::read(&reader, nameSize);
+ bx::read(&reader, nameSize, &err);
char name[256];
- bx::read(&reader, &name, nameSize);
+ bx::read(&reader, &name, nameSize, &err);
name[nameSize] = '\0';
uint8_t type = 0;
- bx::read(&reader, type);
+ bx::read(&reader, type, &err);
uint8_t num;
- bx::read(&reader, num);
+ bx::read(&reader, num, &err);
uint16_t regIndex;
- bx::read(&reader, regIndex);
+ bx::read(&reader, regIndex, &err);
uint16_t regCount;
- bx::read(&reader, regCount);
+ bx::read(&reader, regCount, &err);
- const bool hasTexData = !isShaderVerLess(magic, 8);
+ const bool hasTexData = !isShaderVerLess(magic, 8);
const bool hasTexFormat = !isShaderVerLess(magic, 10);
- uint8_t texComponent = 0;
- uint8_t texDimension = 0;
- uint16_t texFormat = 0;
+ uint8_t texComponent = 0;
+ uint8_t texDimension = 0;
+ uint16_t texFormat = 0;
if (hasTexData)
{
- bx::read(&reader, texComponent);
- bx::read(&reader, texDimension);
+ bx::read(&reader, texComponent, &err);
+ bx::read(&reader, texDimension, &err);
}
if (hasTexFormat)
{
- bx::read(&reader, texFormat);
+ bx::read(&reader, texFormat, &err);
}
const char* kind = "invalid";
- BX_UNUSED(num);
- BX_UNUSED(texComponent);
- BX_UNUSED(texFormat);
+ BX_UNUSED(num, texComponent, texFormat);
auto textureDimensionToViewType = [](TextureDimension::Enum dimension)
{
@@ -4923,7 +4989,7 @@ VK_DESTROY
}
uint32_t shaderSize;
- bx::read(&reader, shaderSize);
+ bx::read(&reader, shaderSize, &err);
const void* code = reader.getDataPtr();
bx::skip(&reader, shaderSize+1);
@@ -4950,12 +5016,12 @@ VK_DESTROY
bx::memSet(m_attrMask, 0, sizeof(m_attrMask) );
bx::memSet(m_attrRemap, 0, sizeof(m_attrRemap) );
- bx::read(&reader, m_numAttrs);
+ bx::read(&reader, m_numAttrs, &err);
for (uint8_t ii = 0; ii < m_numAttrs; ++ii)
{
uint16_t id;
- bx::read(&reader, id);
+ bx::read(&reader, id, &err);
Attrib::Enum attr = idToAttrib(id);
@@ -4976,9 +5042,9 @@ VK_DESTROY
murmur.add(m_attrRemap, m_numAttrs);
m_hash = murmur.end();
- bx::read(&reader, m_size);
+ bx::read(&reader, m_size, &err);
- // fill binding description with uniform informations
+ // fill binding description with uniform information
uint16_t bidx = 0;
if (m_size > 0)
{
@@ -5290,7 +5356,7 @@ VK_DESTROY
vkDestroy(m_readbackMemory);
}
- uint32_t TimerQueryVK::begin(uint32_t _resultIdx)
+ uint32_t TimerQueryVK::begin(uint32_t _resultIdx, uint32_t _frameNum)
{
while (0 == m_control.reserve(1) )
{
@@ -5304,6 +5370,7 @@ VK_DESTROY
Query& query = m_query[idx];
query.m_resultIdx = _resultIdx;
query.m_ready = false;
+ query.m_frameNum = _frameNum;
const VkCommandBuffer commandBuffer = s_renderVK->m_commandBuffer;
const uint32_t offset = idx * 2 + 0;
@@ -5366,6 +5433,7 @@ VK_DESTROY
Result& result = m_result[query.m_resultIdx];
--result.m_pending;
+ result.m_frameNum = query.m_frameNum;
uint32_t offset = idx * 2;
result.m_begin = m_queryResult[offset+0];
@@ -6091,38 +6159,45 @@ VK_DESTROY
if (bimg::isCompressed(bimg::TextureFormat::Enum(m_textureFormat) ) )
{
const bimg::ImageBlockInfo& blockInfo = bimg::getBlockInfo(bimg::TextureFormat::Enum(m_textureFormat) );
- rectpitch = (_rect.m_width / blockInfo.blockWidth) * blockInfo.blockSize;
+ rectpitch = (_rect.m_width / blockInfo.blockWidth ) * blockInfo.blockSize;
slicepitch = (_rect.m_height / blockInfo.blockHeight) * rectpitch;
}
const uint32_t srcpitch = UINT16_MAX == _pitch ? rectpitch : _pitch;
const uint32_t size = UINT16_MAX == _pitch ? slicepitch * _depth: _rect.m_height * _pitch * _depth;
const bool convert = m_textureFormat != m_requestedFormat;
+ VkBufferImageCopy region;
+ region.bufferOffset = 0;
+ region.bufferRowLength = (_pitch == UINT16_MAX ? 0 : _pitch * 8 / bpp);
+ region.bufferImageHeight = 0;
+ region.imageSubresource.aspectMask = m_aspectMask;
+ region.imageSubresource.mipLevel = _mip;
+ region.imageSubresource.baseArrayLayer = 0;
+ region.imageSubresource.layerCount = 1;
+ region.imageOffset = { _rect.m_x, _rect.m_y, 0 };
+ region.imageExtent = { _rect.m_width, _rect.m_height, _depth };
+
uint8_t* data = _mem->data;
uint8_t* temp = NULL;
if (convert)
{
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) );
+ bimg::imageDecodeToBgra8(g_allocator, temp, data, _rect.m_width, _rect.m_height, srcpitch, bimg::TextureFormat::Enum(m_requestedFormat));
data = temp;
+
+ region.imageExtent =
+ {
+ bx::max(1u, m_width >> _mip),
+ bx::max(1u, m_height >> _mip),
+ _depth,
+ };
}
VkBuffer stagingBuffer = VK_NULL_HANDLE;
VkDeviceMemory stagingDeviceMem = VK_NULL_HANDLE;
VK_CHECK(s_renderVK->createStagingBuffer(size, &stagingBuffer, &stagingDeviceMem, data) );
- VkBufferImageCopy region;
- region.bufferOffset = 0;
- region.bufferRowLength = (_pitch == UINT16_MAX ? 0 : _pitch * 8 / bpp);
- region.bufferImageHeight = 0;
- region.imageSubresource.aspectMask = m_aspectMask;
- region.imageSubresource.mipLevel = _mip;
- region.imageSubresource.baseArrayLayer = 0;
- region.imageSubresource.layerCount = 1;
- region.imageOffset = { _rect.m_x, _rect.m_y, 0 };
- region.imageExtent = { _rect.m_width, _rect.m_height, _depth };
-
if (VK_IMAGE_VIEW_TYPE_3D == m_type)
{
region.imageOffset.z = _z;
@@ -7890,43 +7965,42 @@ VK_DESTROY
void RendererContextVK::submitBlit(BlitState& _bs, uint16_t _view)
{
- TextureHandle currentSrc = { kInvalidHandle };
- TextureHandle currentDst = { kInvalidHandle };
- VkImageLayout oldSrcLayout = VK_IMAGE_LAYOUT_UNDEFINED;
- VkImageLayout oldDstLayout = VK_IMAGE_LAYOUT_UNDEFINED;
+ VkImageLayout srcLayouts[BGFX_CONFIG_MAX_BLIT_ITEMS];
+ VkImageLayout dstLayouts[BGFX_CONFIG_MAX_BLIT_ITEMS];
- while (_bs.hasItem(_view) )
+ BlitState bs0 = _bs;
+
+ while (bs0.hasItem(_view) )
{
- const BlitItem& blit = _bs.advance();
+ uint16_t item = bs0.m_item;
+
+ const BlitItem& blit = bs0.advance();
TextureVK& src = m_textures[blit.m_src.idx];
TextureVK& dst = m_textures[blit.m_dst.idx];
- if (currentSrc.idx != blit.m_src.idx)
- {
- if (oldSrcLayout != VK_IMAGE_LAYOUT_UNDEFINED)
- {
- TextureVK& texture = m_textures[currentSrc.idx];
- texture.setImageMemoryBarrier(m_commandBuffer, oldSrcLayout, VK_NULL_HANDLE != texture.m_singleMsaaImage);
- }
+ srcLayouts[item] = VK_NULL_HANDLE != src.m_singleMsaaImage ? src.m_currentSingleMsaaImageLayout : src.m_currentImageLayout;
+ dstLayouts[item] = dst.m_currentImageLayout;
+ }
- oldSrcLayout = src.setImageMemoryBarrier(
- m_commandBuffer
- , VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
- , VK_NULL_HANDLE != src.m_singleMsaaImage
- );
- currentSrc = blit.m_src;
- }
+ bs0 = _bs;
- if (currentDst.idx != blit.m_dst.idx)
- {
- if (oldDstLayout != VK_IMAGE_LAYOUT_UNDEFINED)
- {
- m_textures[currentDst.idx].setImageMemoryBarrier(m_commandBuffer, oldDstLayout);
- }
+ while (bs0.hasItem(_view) )
+ {
+ const BlitItem& blit = bs0.advance();
+
+ TextureVK& src = m_textures[blit.m_src.idx];
+ TextureVK& dst = m_textures[blit.m_dst.idx];
+
+ src.setImageMemoryBarrier(
+ m_commandBuffer
+ , blit.m_src.idx == blit.m_dst.idx ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL
+ , VK_NULL_HANDLE != src.m_singleMsaaImage
+ );
- oldDstLayout = dst.setImageMemoryBarrier(m_commandBuffer, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
- currentDst = blit.m_dst;
+ if (blit.m_src.idx != blit.m_dst.idx)
+ {
+ dst.setImageMemoryBarrier(m_commandBuffer, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL);
}
const uint16_t srcSamples = VK_NULL_HANDLE != src.m_singleMsaaImage ? 1 : src.m_sampler.Count;
@@ -7994,15 +8068,17 @@ VK_DESTROY
);
}
- if (oldSrcLayout != VK_IMAGE_LAYOUT_UNDEFINED)
+ while (_bs.hasItem(_view) )
{
- TextureVK& texture = m_textures[currentSrc.idx];
- texture.setImageMemoryBarrier(m_commandBuffer, oldSrcLayout, VK_NULL_HANDLE != texture.m_singleMsaaImage);
- }
+ uint16_t item = _bs.m_item;
- if (oldDstLayout != VK_IMAGE_LAYOUT_UNDEFINED)
- {
- m_textures[currentDst.idx].setImageMemoryBarrier(m_commandBuffer, oldDstLayout);
+ const BlitItem& blit = _bs.advance();
+
+ TextureVK& src = m_textures[blit.m_src.idx];
+ TextureVK& dst = m_textures[blit.m_dst.idx];
+
+ src.setImageMemoryBarrier(m_commandBuffer, srcLayouts[item], VK_NULL_HANDLE != src.m_singleMsaaImage);
+ dst.setImageMemoryBarrier(m_commandBuffer, dstLayouts[item]);
}
}
@@ -8029,7 +8105,7 @@ VK_DESTROY
if (m_timerQuerySupport)
{
- frameQueryIdx = m_gpuTimer.begin(BGFX_CONFIG_MAX_VIEWS);
+ frameQueryIdx = m_gpuTimer.begin(BGFX_CONFIG_MAX_VIEWS, _render->m_frameNum);
}
if (0 < _render->m_iboffset)
@@ -8645,8 +8721,10 @@ VK_DESTROY
}
VkBuffer bufferIndirect = VK_NULL_HANDLE;
+ VkBuffer bufferNumIndirect = VK_NULL_HANDLE;
uint32_t numDrawIndirect = 0;
uint32_t bufferOffsetIndirect = 0;
+ uint32_t bufferNumOffsetIndirect = 0;
if (isValid(draw.m_indirectBuffer) )
{
const VertexBufferVK& vb = m_vertexBuffers[draw.m_indirectBuffer.idx];
@@ -8656,6 +8734,12 @@ VK_DESTROY
: draw.m_numIndirect
;
bufferOffsetIndirect = draw.m_startIndirect * BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
+
+ if (isValid(draw.m_numIndirectBuffer) )
+ {
+ bufferNumIndirect = m_indexBuffers[draw.m_numIndirectBuffer.idx].m_buffer;
+ bufferNumOffsetIndirect = draw.m_numIndirectIndex * sizeof(uint32_t);
+ }
}
if (hasOcclusionQuery)
@@ -8675,13 +8759,28 @@ VK_DESTROY
if (isValid(draw.m_indirectBuffer) )
{
- vkCmdDrawIndirect(
- m_commandBuffer
- , bufferIndirect
- , bufferOffsetIndirect
- , numDrawIndirect
- , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
- );
+ if (isValid(draw.m_numIndirectBuffer) )
+ {
+ vkCmdDrawIndirectCountKHR(
+ m_commandBuffer
+ , bufferIndirect
+ , bufferOffsetIndirect
+ , bufferNumIndirect
+ , bufferNumOffsetIndirect
+ , numDrawIndirect
+ , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
+ );
+ }
+ else
+ {
+ vkCmdDrawIndirect(
+ m_commandBuffer
+ , bufferIndirect
+ , bufferOffsetIndirect
+ , numDrawIndirect
+ , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
+ );
+ }
}
else
{
@@ -8724,13 +8823,28 @@ VK_DESTROY
if (isValid(draw.m_indirectBuffer) )
{
- vkCmdDrawIndexedIndirect(
- m_commandBuffer
- , bufferIndirect
- , bufferOffsetIndirect
- , numDrawIndirect
- , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
- );
+ if (isValid(draw.m_numIndirectBuffer) )
+ {
+ vkCmdDrawIndexedIndirectCountKHR(
+ m_commandBuffer
+ , bufferIndirect
+ , bufferOffsetIndirect
+ , bufferNumIndirect
+ , bufferNumOffsetIndirect
+ , numDrawIndirect
+ , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
+ );
+ }
+ else
+ {
+ vkCmdDrawIndexedIndirect(
+ m_commandBuffer
+ , bufferIndirect
+ , bufferOffsetIndirect
+ , numDrawIndirect
+ , BGFX_CONFIG_DRAW_INDIRECT_STRIDE
+ );
+ }
}
else
{
@@ -8859,6 +8973,7 @@ VK_DESTROY
perfStats.numCompute = statsKeyType[1];
perfStats.numBlit = _render->m_numBlitItems;
perfStats.maxGpuLatency = maxGpuLatency;
+ perfStats.gpuFrameNum = result.m_frameNum;
bx::memCopy(perfStats.numPrims, statsNumPrimsRendered, sizeof(perfStats.numPrims) );
perfStats.gpuMemoryMax = gpuMemoryAvailable;
perfStats.gpuMemoryUsed = gpuMemoryUsed;
diff --git a/3rdparty/bgfx/src/renderer_vk.h b/3rdparty/bgfx/src/renderer_vk.h
index 3e14799035d..f14e60fc755 100644
--- a/3rdparty/bgfx/src/renderer_vk.h
+++ b/3rdparty/bgfx/src/renderer_vk.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_RENDERER_VK_H_HEADER_GUARD
@@ -96,110 +96,113 @@
VK_IMPORT_INSTANCE_FUNC(true, vkDestroyDebugReportCallbackEXT); \
VK_IMPORT_INSTANCE_PLATFORM
-#define VK_IMPORT_DEVICE \
- VK_IMPORT_DEVICE_FUNC(false, vkGetDeviceQueue); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateFence); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyFence); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateSemaphore); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroySemaphore); \
- VK_IMPORT_DEVICE_FUNC(false, vkResetFences); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateCommandPool); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyCommandPool); \
- VK_IMPORT_DEVICE_FUNC(false, vkResetCommandPool); \
- VK_IMPORT_DEVICE_FUNC(false, vkAllocateCommandBuffers); \
- VK_IMPORT_DEVICE_FUNC(false, vkFreeCommandBuffers); \
- VK_IMPORT_DEVICE_FUNC(false, vkGetBufferMemoryRequirements); \
- VK_IMPORT_DEVICE_FUNC(false, vkGetImageMemoryRequirements); \
- VK_IMPORT_DEVICE_FUNC(false, vkGetImageSubresourceLayout); \
- VK_IMPORT_DEVICE_FUNC(false, vkAllocateMemory); \
- VK_IMPORT_DEVICE_FUNC(false, vkFreeMemory); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateImage); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyImage); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateImageView); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyImageView); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateBuffer); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyBuffer); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateFramebuffer); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyFramebuffer); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateRenderPass); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyRenderPass); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateShaderModule); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyShaderModule); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreatePipelineCache); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyPipelineCache); \
- VK_IMPORT_DEVICE_FUNC(false, vkGetPipelineCacheData); \
- VK_IMPORT_DEVICE_FUNC(false, vkMergePipelineCaches); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateGraphicsPipelines); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateComputePipelines); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyPipeline); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreatePipelineLayout); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyPipelineLayout); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateSampler); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroySampler); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateDescriptorSetLayout); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyDescriptorSetLayout); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateDescriptorPool); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyDescriptorPool); \
- VK_IMPORT_DEVICE_FUNC(false, vkResetDescriptorPool); \
- VK_IMPORT_DEVICE_FUNC(false, vkAllocateDescriptorSets); \
- VK_IMPORT_DEVICE_FUNC(false, vkFreeDescriptorSets); \
- VK_IMPORT_DEVICE_FUNC(false, vkUpdateDescriptorSets); \
- VK_IMPORT_DEVICE_FUNC(false, vkCreateQueryPool); \
- VK_IMPORT_DEVICE_FUNC(false, vkDestroyQueryPool); \
- VK_IMPORT_DEVICE_FUNC(false, vkQueueSubmit); \
- VK_IMPORT_DEVICE_FUNC(false, vkQueueWaitIdle); \
- VK_IMPORT_DEVICE_FUNC(false, vkDeviceWaitIdle); \
- VK_IMPORT_DEVICE_FUNC(false, vkWaitForFences); \
- VK_IMPORT_DEVICE_FUNC(false, vkBeginCommandBuffer); \
- VK_IMPORT_DEVICE_FUNC(false, vkEndCommandBuffer); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdPipelineBarrier); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdBeginRenderPass); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdEndRenderPass); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdSetViewport); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdDraw); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdDrawIndexed); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdDrawIndirect); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdDrawIndexedIndirect); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdDispatch); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdDispatchIndirect); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdBindPipeline); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdSetStencilReference); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdSetBlendConstants); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdSetScissor); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdBindDescriptorSets); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdBindIndexBuffer); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdBindVertexBuffers); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdClearColorImage); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdClearDepthStencilImage); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdClearAttachments); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdResolveImage); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdCopyBuffer); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdCopyBufferToImage); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdCopyImage); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdCopyImageToBuffer); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdBlitImage); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdResetQueryPool); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdWriteTimestamp); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdBeginQuery); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdEndQuery); \
- VK_IMPORT_DEVICE_FUNC(false, vkCmdCopyQueryPoolResults); \
- VK_IMPORT_DEVICE_FUNC(false, vkMapMemory); \
- VK_IMPORT_DEVICE_FUNC(false, vkUnmapMemory); \
- VK_IMPORT_DEVICE_FUNC(false, vkFlushMappedMemoryRanges); \
- VK_IMPORT_DEVICE_FUNC(false, vkInvalidateMappedMemoryRanges); \
- VK_IMPORT_DEVICE_FUNC(false, vkBindBufferMemory); \
- VK_IMPORT_DEVICE_FUNC(false, vkBindImageMemory); \
- /* VK_KHR_swapchain */ \
- VK_IMPORT_DEVICE_FUNC(true, vkCreateSwapchainKHR); \
- VK_IMPORT_DEVICE_FUNC(true, vkDestroySwapchainKHR); \
- VK_IMPORT_DEVICE_FUNC(true, vkGetSwapchainImagesKHR); \
- VK_IMPORT_DEVICE_FUNC(true, vkAcquireNextImageKHR); \
- VK_IMPORT_DEVICE_FUNC(true, vkQueuePresentKHR); \
- /* VK_EXT_debug_utils */ \
- VK_IMPORT_DEVICE_FUNC(true, vkSetDebugUtilsObjectNameEXT); \
- VK_IMPORT_DEVICE_FUNC(true, vkCmdBeginDebugUtilsLabelEXT); \
- VK_IMPORT_DEVICE_FUNC(true, vkCmdEndDebugUtilsLabelEXT); \
- VK_IMPORT_DEVICE_FUNC(true, vkCmdInsertDebugUtilsLabelEXT); \
+#define VK_IMPORT_DEVICE \
+ VK_IMPORT_DEVICE_FUNC(false, vkGetDeviceQueue); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateFence); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyFence); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateSemaphore); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroySemaphore); \
+ VK_IMPORT_DEVICE_FUNC(false, vkResetFences); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateCommandPool); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyCommandPool); \
+ VK_IMPORT_DEVICE_FUNC(false, vkResetCommandPool); \
+ VK_IMPORT_DEVICE_FUNC(false, vkAllocateCommandBuffers); \
+ VK_IMPORT_DEVICE_FUNC(false, vkFreeCommandBuffers); \
+ VK_IMPORT_DEVICE_FUNC(false, vkGetBufferMemoryRequirements); \
+ VK_IMPORT_DEVICE_FUNC(false, vkGetImageMemoryRequirements); \
+ VK_IMPORT_DEVICE_FUNC(false, vkGetImageSubresourceLayout); \
+ VK_IMPORT_DEVICE_FUNC(false, vkAllocateMemory); \
+ VK_IMPORT_DEVICE_FUNC(false, vkFreeMemory); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateImage); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyImage); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateImageView); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyImageView); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateBuffer); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyBuffer); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateFramebuffer); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyFramebuffer); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateRenderPass); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyRenderPass); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateShaderModule); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyShaderModule); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreatePipelineCache); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyPipelineCache); \
+ VK_IMPORT_DEVICE_FUNC(false, vkGetPipelineCacheData); \
+ VK_IMPORT_DEVICE_FUNC(false, vkMergePipelineCaches); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateGraphicsPipelines); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateComputePipelines); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyPipeline); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreatePipelineLayout); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyPipelineLayout); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateSampler); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroySampler); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateDescriptorSetLayout); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyDescriptorSetLayout); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateDescriptorPool); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyDescriptorPool); \
+ VK_IMPORT_DEVICE_FUNC(false, vkResetDescriptorPool); \
+ VK_IMPORT_DEVICE_FUNC(false, vkAllocateDescriptorSets); \
+ VK_IMPORT_DEVICE_FUNC(false, vkFreeDescriptorSets); \
+ VK_IMPORT_DEVICE_FUNC(false, vkUpdateDescriptorSets); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCreateQueryPool); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDestroyQueryPool); \
+ VK_IMPORT_DEVICE_FUNC(false, vkQueueSubmit); \
+ VK_IMPORT_DEVICE_FUNC(false, vkQueueWaitIdle); \
+ VK_IMPORT_DEVICE_FUNC(false, vkDeviceWaitIdle); \
+ VK_IMPORT_DEVICE_FUNC(false, vkWaitForFences); \
+ VK_IMPORT_DEVICE_FUNC(false, vkBeginCommandBuffer); \
+ VK_IMPORT_DEVICE_FUNC(false, vkEndCommandBuffer); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdPipelineBarrier); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdBeginRenderPass); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdEndRenderPass); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdSetViewport); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdDraw); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdDrawIndexed); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdDrawIndirect); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdDrawIndexedIndirect); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdDispatch); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdDispatchIndirect); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdBindPipeline); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdSetStencilReference); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdSetBlendConstants); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdSetScissor); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdBindDescriptorSets); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdBindIndexBuffer); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdBindVertexBuffers); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdClearColorImage); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdClearDepthStencilImage); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdClearAttachments); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdResolveImage); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdCopyBuffer); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdCopyBufferToImage); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdCopyImage); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdCopyImageToBuffer); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdBlitImage); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdResetQueryPool); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdWriteTimestamp); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdBeginQuery); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdEndQuery); \
+ VK_IMPORT_DEVICE_FUNC(false, vkCmdCopyQueryPoolResults); \
+ VK_IMPORT_DEVICE_FUNC(false, vkMapMemory); \
+ VK_IMPORT_DEVICE_FUNC(false, vkUnmapMemory); \
+ VK_IMPORT_DEVICE_FUNC(false, vkFlushMappedMemoryRanges); \
+ VK_IMPORT_DEVICE_FUNC(false, vkInvalidateMappedMemoryRanges); \
+ VK_IMPORT_DEVICE_FUNC(false, vkBindBufferMemory); \
+ VK_IMPORT_DEVICE_FUNC(false, vkBindImageMemory); \
+ /* VK_KHR_swapchain */ \
+ VK_IMPORT_DEVICE_FUNC(true, vkCreateSwapchainKHR); \
+ VK_IMPORT_DEVICE_FUNC(true, vkDestroySwapchainKHR); \
+ VK_IMPORT_DEVICE_FUNC(true, vkGetSwapchainImagesKHR); \
+ VK_IMPORT_DEVICE_FUNC(true, vkAcquireNextImageKHR); \
+ VK_IMPORT_DEVICE_FUNC(true, vkQueuePresentKHR); \
+ /* VK_EXT_debug_utils */ \
+ VK_IMPORT_DEVICE_FUNC(true, vkSetDebugUtilsObjectNameEXT); \
+ VK_IMPORT_DEVICE_FUNC(true, vkCmdBeginDebugUtilsLabelEXT); \
+ VK_IMPORT_DEVICE_FUNC(true, vkCmdEndDebugUtilsLabelEXT); \
+ VK_IMPORT_DEVICE_FUNC(true, vkCmdInsertDebugUtilsLabelEXT); \
+ /* VK_KHR_draw_indirect_count */ \
+ VK_IMPORT_DEVICE_FUNC(true, vkCmdDrawIndirectCountKHR); \
+ VK_IMPORT_DEVICE_FUNC(true, vkCmdDrawIndexedIndirectCountKHR); \
#define VK_DESTROY \
VK_DESTROY_FUNC(Buffer); \
@@ -521,7 +524,7 @@ VK_DESTROY_FUNC(DescriptorSet);
VkResult init();
void shutdown();
- uint32_t begin(uint32_t _resultIdx);
+ uint32_t begin(uint32_t _resultIdx, uint32_t _frameNum);
void end(uint32_t _idx);
bool update();
@@ -529,21 +532,24 @@ VK_DESTROY_FUNC(DescriptorSet);
{
void reset()
{
- m_begin = 0;
- m_end = 0;
- m_pending = 0;
+ m_begin = 0;
+ m_end = 0;
+ m_pending = 0;
+ m_frameNum = 0;
}
uint64_t m_begin;
uint64_t m_end;
uint32_t m_pending;
+ uint32_t m_frameNum;
};
struct Query
{
- uint32_t m_resultIdx;
- bool m_ready;
- uint64_t m_completed;
+ uint32_t m_resultIdx;
+ uint32_t m_frameNum;
+ uint64_t m_completed;
+ bool m_ready;
};
uint64_t m_frequency;
diff --git a/3rdparty/bgfx/src/renderer_webgpu.cpp b/3rdparty/bgfx/src/renderer_webgpu.cpp
index 0369a9c26ce..8f747167eee 100644
--- a/3rdparty/bgfx/src/renderer_webgpu.cpp
+++ b/3rdparty/bgfx/src/renderer_webgpu.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2011-2019 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -306,11 +306,19 @@ namespace bgfx { namespace webgpu
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ATCE
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ATCI
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC4x4
+ { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC5x4
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC5x5
+ { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC6x5
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC6x6
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC8x5
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC8x6
+ { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC8x8
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC10x5
+ { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC10x6
+ { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC10x8
+ { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC10x10
+ { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC12x10
+ { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // ASTC12x12
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // Unknown
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // R1
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // A8
@@ -356,8 +364,11 @@ namespace bgfx { namespace webgpu
{ wgpu::TextureFormat::RGBA32Sint, wgpu::TextureFormat::Undefined }, // RGBA32I
{ wgpu::TextureFormat::RGBA32Uint, wgpu::TextureFormat::Undefined }, // RGBA32U
{ wgpu::TextureFormat::RGBA32Float, wgpu::TextureFormat::Undefined }, // RGBA32F
+ { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // B5G6R5
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // R5G6B5
+ { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // BGRA4
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // RGBA4
+ { wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // BGR5A1
{ wgpu::TextureFormat::Undefined, wgpu::TextureFormat::Undefined }, // RGB5A1
{ wgpu::TextureFormat::RGB10A2Unorm, wgpu::TextureFormat::Undefined }, // RGB10A2
{ wgpu::TextureFormat::RG11B10Ufloat, wgpu::TextureFormat::Undefined }, // RG11B10F
@@ -658,8 +669,11 @@ namespace bgfx { namespace webgpu
g_caps.formats[TextureFormat::PTC14 ] =
g_caps.formats[TextureFormat::PTC12A] =
g_caps.formats[TextureFormat::PTC14A] =
+ g_caps.formats[TextureFormat::B5G6R5] =
g_caps.formats[TextureFormat::R5G6B5] =
+ g_caps.formats[TextureFormat::BGRA4 ] =
g_caps.formats[TextureFormat::RGBA4 ] =
+ g_caps.formats[TextureFormat::BGR5A1] =
g_caps.formats[TextureFormat::RGB5A1] = BGFX_CAPS_FORMAT_TEXTURE_NONE;
g_caps.formats[TextureFormat::RGB9E5F] &= ~(BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER | BGFX_CAPS_FORMAT_TEXTURE_FRAMEBUFFER_MSAA);
@@ -2471,8 +2485,10 @@ namespace bgfx { namespace webgpu
bx::MemoryReader reader(_mem->data, _mem->size);
+ bx::ErrorAssert err;
+
uint32_t magic;
- bx::read(&reader, magic);
+ bx::read(&reader, magic, &err);
wgpu::ShaderStage shaderStage;
@@ -2496,7 +2512,7 @@ namespace bgfx { namespace webgpu
m_stage = shaderStage;
uint32_t hashIn;
- bx::read(&reader, hashIn);
+ bx::read(&reader, hashIn, &err);
uint32_t hashOut;
@@ -2506,11 +2522,11 @@ namespace bgfx { namespace webgpu
}
else
{
- bx::read(&reader, hashOut);
+ bx::read(&reader, hashOut, &err);
}
uint16_t count;
- bx::read(&reader, count);
+ bx::read(&reader, count, &err);
m_numPredefined = 0;
m_numUniforms = count;
@@ -2530,32 +2546,32 @@ namespace bgfx { namespace webgpu
for (uint32_t ii = 0; ii < count; ++ii)
{
uint8_t nameSize = 0;
- bx::read(&reader, nameSize);
+ bx::read(&reader, nameSize, &err);
char name[256];
- bx::read(&reader, &name, nameSize);
+ bx::read(&reader, &name, nameSize, &err);
name[nameSize] = '\0';
uint8_t type = 0;
- bx::read(&reader, type);
+ bx::read(&reader, type, &err);
uint8_t num;
- bx::read(&reader, num);
+ bx::read(&reader, num, &err);
uint16_t regIndex;
- bx::read(&reader, regIndex);
+ bx::read(&reader, regIndex, &err);
uint16_t regCount;
- bx::read(&reader, regCount);
+ bx::read(&reader, regCount, &err);
uint8_t texComponent;
- bx::read(&reader, texComponent);
+ bx::read(&reader, texComponent, &err);
uint8_t texDimension;
- bx::read(&reader, texDimension);
+ bx::read(&reader, texDimension, &err);
uint16_t texFormat = 0;
- bx::read(&reader, texFormat);
+ bx::read(&reader, texFormat, &err);
const char* kind = "invalid";
@@ -2654,7 +2670,8 @@ namespace bgfx { namespace webgpu
m_samplers[m_numSamplers].visibility = shaderStage;
m_samplers[m_numSamplers].sampler.type = comparisonSampler
? wgpu::SamplerBindingType::Comparison
- : wgpu::SamplerBindingType::Filtering;
+ : wgpu::SamplerBindingType::Filtering
+ ;
m_numSamplers++;
@@ -2693,7 +2710,7 @@ namespace bgfx { namespace webgpu
}
uint32_t shaderSize;
- bx::read(&reader, shaderSize);
+ bx::read(&reader, shaderSize, &err);
BX_TRACE("Shader body is at %lld size %u remaining %lld", reader.getPos(), shaderSize, reader.remaining());
@@ -2709,7 +2726,7 @@ namespace bgfx { namespace webgpu
BX_TRACE("First word %08" PRIx32, code[0]);
uint8_t numAttrs = 0;
- bx::read(&reader, numAttrs);
+ bx::read(&reader, numAttrs, &err);
m_numAttrs = numAttrs;
@@ -2719,7 +2736,7 @@ namespace bgfx { namespace webgpu
for(uint8_t ii = 0; ii < numAttrs; ++ii)
{
uint16_t id;
- bx::read(&reader, id);
+ bx::read(&reader, id, &err);
auto toString = [](Attrib::Enum attr)
{
@@ -2784,10 +2801,10 @@ namespace bgfx { namespace webgpu
return ((value + multiple - 1) / multiple) * multiple;
};
- bx::read(&reader, m_size);
+ bx::read(&reader, m_size, &err);
const uint32_t align = kMinBufferOffsetAlignment;
- m_gpuSize = (uint16_t) bx::strideAlign(m_size, align);
+ m_gpuSize = uint16_t(bx::strideAlign(m_size, align) );
BX_TRACE("shader size %d (used=%d) (prev=%d)", (int)m_size, (int)m_gpuSize, (int)bx::strideAlign(roundUp(m_size, 4), align));
}
@@ -3978,9 +3995,10 @@ namespace bgfx { namespace webgpu
{
}
- uint32_t TimerQueryWgpu::begin(uint32_t _resultIdx)
+ uint32_t TimerQueryWgpu::begin(uint32_t _resultIdx, uint32_t _frameNum)
{
BX_UNUSED(_resultIdx);
+ BX_UNUSED(_frameNum);
return 0;
}
@@ -4838,6 +4856,7 @@ namespace bgfx { namespace webgpu
perfStats.numCompute = statsKeyType[1];
perfStats.numBlit = _render->m_numBlitItems;
perfStats.maxGpuLatency = maxGpuLatency;
+ perfStats.gpuFrameNum = result.m_frameNum;
bx::memCopy(perfStats.numPrims, statsNumPrimsRendered, sizeof(perfStats.numPrims) );
perfStats.gpuMemoryMax = -INT64_MAX;
perfStats.gpuMemoryUsed = -INT64_MAX;
diff --git a/3rdparty/bgfx/src/renderer_webgpu.h b/3rdparty/bgfx/src/renderer_webgpu.h
index 45590d7b0e9..54c8aff237e 100644
--- a/3rdparty/bgfx/src/renderer_webgpu.h
+++ b/3rdparty/bgfx/src/renderer_webgpu.h
@@ -1,6 +1,6 @@
/*
* Copyright 2011-2019 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_RENDERER_WEBGPU_H_HEADER_GUARD
@@ -509,7 +509,7 @@ namespace bgfx { namespace webgpu
void init();
void shutdown();
- uint32_t begin(uint32_t _resultIdx);
+ uint32_t begin(uint32_t _resultIdx, uint32_t _frameNum);
void end(uint32_t _idx);
void addHandlers(wgpu::CommandBuffer& _commandBuffer);
bool get();
@@ -521,11 +521,13 @@ namespace bgfx { namespace webgpu
m_begin = 0;
m_end = 0;
m_pending = 0;
+ m_frameNum = 0;
}
uint64_t m_begin;
uint64_t m_end;
uint32_t m_pending;
+ uint32_t m_frameNum; // TODO: implement (currently stays 0)
};
uint64_t m_begin;
diff --git a/3rdparty/bgfx/src/shader.cpp b/3rdparty/bgfx/src/shader.cpp
index 8f74737494e..2629569e3e5 100644
--- a/3rdparty/bgfx/src/shader.cpp
+++ b/3rdparty/bgfx/src/shader.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -121,8 +121,10 @@ namespace bgfx
bx::WriterI* writer = reinterpret_cast<bx::WriterI*>(_userData);
char temp[512];
toString(temp, sizeof(temp), _instruction);
- bx::write(writer, temp, (int32_t)bx::strLen(temp) );
- bx::write(writer, '\n');
+
+ bx::Error err;
+ bx::write(writer, temp, (int32_t)bx::strLen(temp), &err);
+ bx::write(writer, '\n', &err);
return true;
}
@@ -132,8 +134,10 @@ namespace bgfx
bx::WriterI* writer = reinterpret_cast<bx::WriterI*>(_userData);
char temp[512];
toString(temp, sizeof(temp), _instruction);
- bx::write(writer, temp, (int32_t)bx::strLen(temp) );
- bx::write(writer, '\n');
+
+ bx::Error err;
+ bx::write(writer, temp, (int32_t)bx::strLen(temp), &err);
+ bx::write(writer, '\n', &err);
return true;
}
@@ -143,15 +147,17 @@ namespace bgfx
bx::WriterI* writer = reinterpret_cast<bx::WriterI*>(_userData);
char temp[512];
toString(temp, sizeof(temp), _instruction);
- bx::write(writer, temp, (int32_t)bx::strLen(temp) );
- bx::write(writer, '\n');
+
+ bx::Error err;
+ bx::write(writer, temp, (int32_t)bx::strLen(temp), &err);
+ bx::write(writer, '\n', &err);
return true;
}
void disassembleByteCode(bx::WriterI* _writer, bx::ReaderSeekerI* _reader, bx::Error* _err)
{
uint32_t magic;
- bx::peek(_reader, magic);
+ bx::peek(_reader, magic, _err);
if (magic == SPV_CHUNK_HEADER)
{
@@ -178,14 +184,14 @@ namespace bgfx
BX_ERROR_SCOPE(_err);
uint32_t magic;
- bx::peek(_reader, magic);
+ bx::peek(_reader, magic, _err);
if (isShaderBin(magic) )
{
- bx::read(_reader, magic);
+ bx::read(_reader, magic, _err);
uint32_t hashIn;
- bx::read(_reader, hashIn);
+ bx::read(_reader, hashIn, _err);
uint32_t hashOut;
@@ -195,7 +201,7 @@ namespace bgfx
}
else
{
- bx::read(_reader, hashOut);
+ bx::read(_reader, hashOut, _err);
}
uint16_t count;
diff --git a/3rdparty/bgfx/src/shader.h b/3rdparty/bgfx/src/shader.h
index c79339c81ac..5ddc1cdbef4 100644
--- a/3rdparty/bgfx/src/shader.h
+++ b/3rdparty/bgfx/src/shader.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_SHADER_H
diff --git a/3rdparty/bgfx/src/shader_dx9bc.cpp b/3rdparty/bgfx/src/shader_dx9bc.cpp
index 1ce0084e241..adf83328345 100644
--- a/3rdparty/bgfx/src/shader_dx9bc.cpp
+++ b/3rdparty/bgfx/src/shader_dx9bc.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
@@ -492,7 +492,7 @@ namespace bgfx
break;
}
- return 0;
+ return size;
}
int32_t toString(char* _out, int32_t _size, const Dx9bcInstruction& _instruction)
diff --git a/3rdparty/bgfx/src/shader_dx9bc.h b/3rdparty/bgfx/src/shader_dx9bc.h
index 639591386ce..dec16858ac8 100644
--- a/3rdparty/bgfx/src/shader_dx9bc.h
+++ b/3rdparty/bgfx/src/shader_dx9bc.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_SHADER_DX9BC_H
diff --git a/3rdparty/bgfx/src/shader_dxbc.cpp b/3rdparty/bgfx/src/shader_dxbc.cpp
index b442257bccb..6f27ff7d2a3 100644
--- a/3rdparty/bgfx/src/shader_dxbc.cpp
+++ b/3rdparty/bgfx/src/shader_dxbc.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
@@ -108,17 +108,17 @@ namespace bgfx
{ 1, 0 }, // DCL_CONSTANT_BUFFER
{ 1, 0 }, // DCL_SAMPLER
{ 1, 1 }, // DCL_INDEX_RANGE
- { 1, 0 }, // DCL_GS_OUTPUT_PRIMITIVE_TOPOLOGY
- { 1, 0 }, // DCL_GS_INPUT_PRIMITIVE
+ { 0, 0 }, // DCL_GS_OUTPUT_PRIMITIVE_TOPOLOGY
+ { 0, 0 }, // DCL_GS_INPUT_PRIMITIVE
{ 0, 1 }, // DCL_MAX_OUTPUT_VERTEX_COUNT
{ 1, 0 }, // DCL_INPUT
{ 1, 1 }, // DCL_INPUT_SGV
- { 1, 0 }, // DCL_INPUT_SIV
+ { 1, 1 }, // DCL_INPUT_SIV
{ 1, 0 }, // DCL_INPUT_PS
{ 1, 1 }, // DCL_INPUT_PS_SGV
{ 1, 1 }, // DCL_INPUT_PS_SIV
{ 1, 0 }, // DCL_OUTPUT
- { 1, 0 }, // DCL_OUTPUT_SGV
+ { 1, 1 }, // DCL_OUTPUT_SGV
{ 1, 1 }, // DCL_OUTPUT_SIV
{ 0, 1 }, // DCL_TEMPS
{ 0, 3 }, // DCL_INDEXABLE_TEMP
@@ -135,8 +135,8 @@ namespace bgfx
{ 0, 0 }, // HS_CONTROL_POINT_PHASE
{ 0, 0 }, // HS_FORK_PHASE
{ 0, 0 }, // HS_JOIN_PHASE
- { 0, 0 }, // EMIT_STREAM
- { 0, 0 }, // CUT_STREAM
+ { 1, 0 }, // EMIT_STREAM
+ { 1, 0 }, // CUT_STREAM
{ 1, 0 }, // EMITTHENCUT_STREAM
{ 1, 0 }, // INTERFACE_CALL
{ 0, 0 }, // BUFINFO
@@ -161,7 +161,7 @@ namespace bgfx
{ 5, 0 }, // BFI
{ 0, 0 }, // BFREV
{ 5, 0 }, // SWAPC
- { 0, 0 }, // DCL_STREAM
+ { 1, 0 }, // DCL_STREAM
{ 1, 0 }, // DCL_FUNCTION_BODY
{ 0, 0 }, // DCL_FUNCTION_TABLE
{ 0, 0 }, // DCL_INTERFACE
@@ -503,6 +503,69 @@ namespace bgfx
};
BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcInterpolationName) == DxbcInterpolation::Count);
+ const char *s_dxbcPrimitiveTopologyName[] =
+ {
+ "",
+ "PointList",
+ "LineList",
+ "LineStrip",
+ "TriangleList",
+ "TriangleStrip",
+ "",
+ "",
+ "",
+ "",
+ "LineListAdj",
+ "LineStripAdj",
+ "TriangleListAdj",
+ "TriangleStripAdj",
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcPrimitiveTopologyName) == DxbcPrimitiveTopology::Count);
+
+ const char *s_dxbcPrimitiveName[] = {
+ "",
+ "Point",
+ "Line",
+ "Triangle",
+ "",
+ "",
+ "LineAdj",
+ "TriangleAdj",
+ "_1ControlPointPatch",
+ "_2ControlPointPatch",
+ "_3ControlPointPatch",
+ "_4ControlPointPatch",
+ "_5ControlPointPatch",
+ "_6ControlPointPatch",
+ "_7ControlPointPatch",
+ "_8ControlPointPatch",
+ "_9ControlPointPatch",
+ "_10ControlPointPatch",
+ "_11ControlPointPatch",
+ "_12ControlPointPatch",
+ "_13ControlPointPatch",
+ "_14ControlPointPatch",
+ "_15ControlPointPatch",
+ "_16ControlPointPatch",
+ "_17ControlPointPatch",
+ "_18ControlPointPatch",
+ "_19ControlPointPatch",
+ "_20ControlPointPatch",
+ "_21ControlPointPatch",
+ "_22ControlPointPatch",
+ "_23ControlPointPatch",
+ "_24ControlPointPatch",
+ "_25ControlPointPatch",
+ "_26ControlPointPatch",
+ "_27ControlPointPatch",
+ "_28ControlPointPatch",
+ "_29ControlPointPatch",
+ "_30ControlPointPatch",
+ "_31ControlPointPatch",
+ "_32ControlPointPatch",
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_dxbcPrimitiveName) == DxbcPrimitive::Count);
+
// mesa/src/gallium/state_trackers/d3d1x/d3d1xshader/defs/shortfiles.txt
static const char* s_dxbcOperandType[] =
{
@@ -1066,7 +1129,7 @@ namespace bgfx
_instruction.opcode = DxbcOpcode::Enum( (token & UINT32_C(0x000007ff) ) );
BX_ASSERT(_instruction.opcode < DxbcOpcode::Enum::Count, "unknown opcode");
-
+
_instruction.length = uint8_t( (token & UINT32_C(0x7f000000) ) >> 24);
bool extended = 0 != (token & UINT32_C(0x80000000) );
@@ -1149,11 +1212,30 @@ namespace bgfx
_instruction.enableShaderExtensions = 0 != (token & UINT32_C(0x00040000) );
break;
- case DxbcOpcode::DCL_INPUT_PS:
+ case DxbcOpcode::DCL_GS_INPUT_PRIMITIVE:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // ........ pppppp...........
+ // ^----------------- Primitive
+
+ _instruction.primitive = DxbcPrimitive::Enum( (token & UINT32_C(0x0001f800) ) >> 11);
+ break;
+
+ case DxbcOpcode::DCL_GS_OUTPUT_PRIMITIVE_TOPOLOGY:
+ // 0 1 2 3
+ // 76543210765432107654321076543210
+ // ........ pppppp...........
+ // ^----------------- Primitive Topology
+
+ _instruction.primitiveTopology = DxbcPrimitiveTopology::Enum( (token & UINT32_C(0x0001f800) ) >> 11);
+ break;
+
+ case DxbcOpcode::DCL_INPUT_PS: BX_FALLTHROUGH;
+ case DxbcOpcode::DCL_INPUT_PS_SIV:
// 0 1 2 3
// 76543210765432107654321076543210
// ........ iiiii...........
- // ^---------------- Interploation
+ // ^---------------- Interpolation
_instruction.interpolation = DxbcInterpolation::Enum( (token & UINT32_C(0x0000f800) ) >> 11);
break;
@@ -1281,7 +1363,7 @@ namespace bgfx
size += read(_reader, tableId, _err);
uint32_t num;
- size += read(_reader, num);
+ size += read(_reader, num, _err);
for (uint32_t ii = 0; ii < num; ++ii)
{
@@ -1358,7 +1440,7 @@ namespace bgfx
token &= UINT32_C(0x000007ff);
token |= _instruction.customDataClass << 11;
- size += bx::write(_writer, token);
+ size += bx::write(_writer, token, _err);
uint32_t len = uint32_t(_instruction.customData.size()*sizeof(uint32_t) );
size += bx::write(_writer, len/4+2, _err);
@@ -1381,7 +1463,16 @@ namespace bgfx
token |= _instruction.enableShaderExtensions ? UINT32_C(0x00040000) : 0;
break;
- case DxbcOpcode::DCL_INPUT_PS:
+ case DxbcOpcode::DCL_GS_INPUT_PRIMITIVE:
+ token |= (_instruction.primitive << 11) & UINT32_C(0x0001f800);
+ break;
+
+ case DxbcOpcode::DCL_GS_OUTPUT_PRIMITIVE_TOPOLOGY:
+ token |= (_instruction.primitiveTopology << 11) & UINT32_C(0x0001f800);
+ break;
+
+ case DxbcOpcode::DCL_INPUT_PS: BX_FALLTHROUGH;
+ case DxbcOpcode::DCL_INPUT_PS_SIV:
token |= (_instruction.interpolation << 11) & UINT32_C(0x0000f800);
break;
@@ -1410,7 +1501,7 @@ namespace bgfx
break;
}
- size += bx::write(_writer, token);
+ size += bx::write(_writer, token, _err);
for (uint32_t ii = 0; _instruction.extended[ii] != DxbcInstruction::ExtendedType::Count; ++ii)
{
@@ -1549,6 +1640,22 @@ namespace bgfx
);
break;
+ case DxbcOpcode::DCL_GS_OUTPUT_PRIMITIVE_TOPOLOGY:
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%s %s"
+ , getName(_instruction.opcode)
+ , s_dxbcPrimitiveTopologyName[_instruction.primitiveTopology]
+ );
+ break;
+
+ case DxbcOpcode::DCL_GS_INPUT_PRIMITIVE:
+ size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
+ , "%s %s"
+ , getName(_instruction.opcode)
+ , s_dxbcPrimitiveName[_instruction.primitive]
+ );
+ break;
+
case DxbcOpcode::IF:
size += bx::snprintf(&_out[size], bx::uint32_imax(0, _size-size)
, "%s%s"
@@ -1734,7 +1841,7 @@ namespace bgfx
DxbcSignature::Element element;
uint32_t nameOffset;
- size += bx::read(_reader, nameOffset);
+ size += bx::read(_reader, nameOffset, _err);
char name[DXBC_MAX_NAME_STRING];
readString(_reader, offset + nameOffset, name, DXBC_MAX_NAME_STRING, _err);
@@ -1784,7 +1891,7 @@ namespace bgfx
}
else
{
- size += bx::write(_writer, it->second);
+ size += bx::write(_writer, it->second, _err);
}
size += bx::write(_writer, element.semanticIndex, _err);
@@ -1979,7 +2086,7 @@ namespace bgfx
}
int64_t dxbcOffset = bx::seek(_writer);
- size += bx::write(_writer, DXBC_CHUNK_HEADER);
+ size += bx::write(_writer, DXBC_CHUNK_HEADER, _err);
size += bx::writeRep(_writer, 0, 16, _err);
diff --git a/3rdparty/bgfx/src/shader_dxbc.h b/3rdparty/bgfx/src/shader_dxbc.h
index 54cf1b0c4a7..ba0e2862a39 100644
--- a/3rdparty/bgfx/src/shader_dxbc.h
+++ b/3rdparty/bgfx/src/shader_dxbc.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
@@ -326,6 +326,72 @@ namespace bgfx
};
};
+ struct DxbcPrimitiveTopology
+ {
+ enum Enum
+ {
+ Unknown,
+ PointList,
+ LineList,
+ LineStrip,
+ TriangleList,
+ TriangleStrip,
+ LineListAdj = 10,
+ LineStripAdj,
+ TriangleListAdj,
+ TriangleStripAdj,
+
+ Count
+ };
+ };
+
+ struct DxbcPrimitive
+ {
+ enum Enum
+ {
+ Unknown,
+ Point,
+ Line,
+ Triangle,
+ LineAdj = 6,
+ TriangleAdj,
+ _1ControlPointPatch,
+ _2ControlPointPatch,
+ _3ControlPointPatch,
+ _4ControlPointPatch,
+ _5ControlPointPatch,
+ _6ControlPointPatch,
+ _7ControlPointPatch,
+ _8ControlPointPatch,
+ _9ControlPointPatch,
+ _10ControlPointPatch,
+ _11ControlPointPatch,
+ _12ControlPointPatch,
+ _13ControlPointPatch,
+ _14ControlPointPatch,
+ _15ControlPointPatch,
+ _16ControlPointPatch,
+ _17ControlPointPatch,
+ _18ControlPointPatch,
+ _19ControlPointPatch,
+ _20ControlPointPatch,
+ _21ControlPointPatch,
+ _22ControlPointPatch,
+ _23ControlPointPatch,
+ _24ControlPointPatch,
+ _25ControlPointPatch,
+ _26ControlPointPatch,
+ _27ControlPointPatch,
+ _28ControlPointPatch,
+ _29ControlPointPatch,
+ _30ControlPointPatch,
+ _31ControlPointPatch,
+ _32ControlPointPatch,
+
+ Count
+ };
+ };
+
struct DxbcResourceReturnType
{
enum Enum
@@ -562,6 +628,12 @@ namespace bgfx
DxbcInterpolation::Enum interpolation;
//
+ DxbcPrimitiveTopology::Enum primitiveTopology;
+
+ //
+ DxbcPrimitive::Enum primitive;
+
+ //
bool shadow;
bool mono;
diff --git a/3rdparty/bgfx/src/shader_spirv.cpp b/3rdparty/bgfx/src/shader_spirv.cpp
index 93edff33437..739256546be 100644
--- a/3rdparty/bgfx/src/shader_spirv.cpp
+++ b/3rdparty/bgfx/src/shader_spirv.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_p.h"
diff --git a/3rdparty/bgfx/src/shader_spirv.h b/3rdparty/bgfx/src/shader_spirv.h
index f823ca0692f..0ab2c4ff33c 100644
--- a/3rdparty/bgfx/src/shader_spirv.h
+++ b/3rdparty/bgfx/src/shader_spirv.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_SHADER_SPIRV_H
diff --git a/3rdparty/bgfx/src/topology.cpp b/3rdparty/bgfx/src/topology.cpp
index c6c45e8de26..0457ab62403 100644
--- a/3rdparty/bgfx/src/topology.cpp
+++ b/3rdparty/bgfx/src/topology.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bx/allocator.h>
diff --git a/3rdparty/bgfx/src/topology.h b/3rdparty/bgfx/src/topology.h
index 4eac8036200..e26f3bb1e9d 100644
--- a/3rdparty/bgfx/src/topology.h
+++ b/3rdparty/bgfx/src/topology.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_TOPOLOGY_H_HEADER_GUARD
diff --git a/3rdparty/bgfx/src/version.h b/3rdparty/bgfx/src/version.h
index 2b7db1dd0ba..84767bc8eaf 100644
--- a/3rdparty/bgfx/src/version.h
+++ b/3rdparty/bgfx/src/version.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
/*
@@ -9,5 +9,5 @@
*
*/
-#define BGFX_REV_NUMBER 7816
-#define BGFX_REV_SHA1 "e642efb03af78e04bec8e81118fe3dec88e0176e"
+#define BGFX_REV_NUMBER 8381
+#define BGFX_REV_SHA1 "988565aa983beb0b329ded834cd09f6a198b41e0"
diff --git a/3rdparty/bgfx/src/vertexlayout.cpp b/3rdparty/bgfx/src/vertexlayout.cpp
index 35bec28c00e..4cebdb4a2b6 100644
--- a/3rdparty/bgfx/src/vertexlayout.cpp
+++ b/3rdparty/bgfx/src/vertexlayout.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bx/debug.h>
@@ -122,6 +122,21 @@ namespace bgfx
_asInt = !!(val&(1<<8) );
}
+ static const bool s_attribTypeIsFloat[] =
+ {
+ false, // Uint8
+ false, // Uint10
+ false, // Int16
+ true, // Half
+ true, // Float
+ };
+ BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeIsFloat) == AttribType::Count);
+
+ bool isFloat(AttribType::Enum _type)
+ {
+ return s_attribTypeIsFloat[_type];
+ }
+
static const char* s_attrName[] =
{
"P", "Attrib::Position",
@@ -631,15 +646,7 @@ namespace bgfx
struct ConvertOp
{
- enum Enum
- {
- Set,
- Copy,
- Convert,
- };
-
Attrib::Enum attr;
- Enum op;
uint32_t src;
uint32_t dest;
uint32_t size;
@@ -648,6 +655,12 @@ namespace bgfx
ConvertOp convertOp[Attrib::Count];
uint32_t numOps = 0;
+ const uint8_t* src = (const uint8_t*)_srcData;
+ uint32_t srcStride = _srcLayout.getStride();
+
+ uint8_t* dest = (uint8_t*)_destData;
+ uint32_t destStride = _destLayout.getStride();
+
for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
{
Attrib::Enum attr = (Attrib::Enum)ii;
@@ -668,25 +681,25 @@ namespace bgfx
if (_srcLayout.has(attr) )
{
cop.src = _srcLayout.getOffset(attr);
- cop.op = _destLayout.m_attributes[attr] == _srcLayout.m_attributes[attr] ? ConvertOp::Copy : ConvertOp::Convert;
+
+ if (_destLayout.m_attributes[attr] == _srcLayout.m_attributes[attr])
+ {
+ bx::memCopy(dest + cop.dest, destStride, src + cop.src, srcStride, cop.size, _num);
+ }
+ else
+ {
+ ++numOps;
+ }
}
else
{
- cop.op = ConvertOp::Set;
+ bx::memSet(dest + cop.dest, destStride, 0, cop.size, _num);
}
-
- ++numOps;
}
}
if (0 < numOps)
{
- const uint8_t* src = (const uint8_t*)_srcData;
- uint32_t srcStride = _srcLayout.getStride();
-
- uint8_t* dest = (uint8_t*)_destData;
- uint32_t destStride = _destLayout.getStride();
-
float unpacked[4];
for (uint32_t ii = 0; ii < _num; ++ii)
@@ -694,25 +707,11 @@ namespace bgfx
for (uint32_t jj = 0; jj < numOps; ++jj)
{
const ConvertOp& cop = convertOp[jj];
-
- switch (cop.op)
- {
- case ConvertOp::Set:
- bx::memSet(dest + cop.dest, 0, cop.size);
- break;
-
- case ConvertOp::Copy:
- bx::memCopy(dest + cop.dest, src + cop.src, cop.size);
- break;
-
- case ConvertOp::Convert:
- vertexUnpack(unpacked, cop.attr, _srcLayout, src);
- vertexPack(unpacked, true, cop.attr, _destLayout, dest);
- break;
- }
+ vertexUnpack(unpacked, cop.attr, _srcLayout, src);
+ vertexPack(unpacked, true, cop.attr, _destLayout, dest);
}
- src += srcStride;
+ src += srcStride;
dest += destStride;
}
}
diff --git a/3rdparty/bgfx/src/vertexlayout.h b/3rdparty/bgfx/src/vertexlayout.h
index 19753aa648c..afb649a0bfd 100644
--- a/3rdparty/bgfx/src/vertexlayout.h
+++ b/3rdparty/bgfx/src/vertexlayout.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef BGFX_VERTEXDECL_H_HEADER_GUARD
@@ -14,6 +14,9 @@ namespace bgfx
///
void initAttribTypeSizeTable(RendererType::Enum _type);
+ ///
+ bool isFloat(AttribType::Enum _type);
+
/// Returns attribute name.
const char* getAttribName(Attrib::Enum _attr);
diff --git a/3rdparty/bgfx/src/vs_clear.sc b/3rdparty/bgfx/src/vs_clear.sc
index 7c2668b272b..809f32be0ef 100644
--- a/3rdparty/bgfx/src/vs_clear.sc
+++ b/3rdparty/bgfx/src/vs_clear.sc
@@ -1,8 +1,8 @@
$input a_position
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_shader.sh"
diff --git a/3rdparty/bgfx/src/vs_debugfont.sc b/3rdparty/bgfx/src/vs_debugfont.sc
index 16eba5c318f..c344b716111 100644
--- a/3rdparty/bgfx/src/vs_debugfont.sc
+++ b/3rdparty/bgfx/src/vs_debugfont.sc
@@ -2,8 +2,8 @@ $input a_position, a_color0, a_color1, a_texcoord0
$output v_color0, v_color1, v_texcoord0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "bgfx_shader.sh"
diff --git a/3rdparty/bgfx/tools/geometryc/geometryc.cpp b/3rdparty/bgfx/tools/geometryc/geometryc.cpp
index d604fd38269..ba0d0274da6 100644
--- a/3rdparty/bgfx/tools/geometryc/geometryc.cpp
+++ b/3rdparty/bgfx/tools/geometryc/geometryc.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <algorithm>
@@ -16,6 +16,7 @@ namespace stl = tinystl;
#include <meshoptimizer/src/meshoptimizer.h>
+#define CGLTF_VALIDATE_ENABLE_ASSERTS BX_CONFIG_DEBUG
#define CGLTF_IMPLEMENTATION
#include <cgltf/cgltf.h>
@@ -47,15 +48,14 @@ namespace stl = tinystl;
#endif // 0
#include <bx/bx.h>
-#include <bx/debug.h>
+#include <bx/bounds.h>
#include <bx/commandline.h>
-#include <bx/timer.h>
+#include <bx/debug.h>
+#include <bx/file.h>
#include <bx/hash.h>
-#include <bx/uint32_t.h>
#include <bx/math.h>
-#include <bx/file.h>
-
-#include "bounds.h"
+#include <bx/timer.h>
+#include <bx/uint32_t.h>
typedef stl::vector<bx::Vec3> Vec3Array;
@@ -120,7 +120,7 @@ static bx::Vec3 s_axisVectors[6] =
struct CoordinateSystem
{
- bx::Handness::Enum m_handness;
+ bx::Handedness::Enum m_handedness;
Axis::Enum m_up;
Axis::Enum m_forward;
};
@@ -133,10 +133,10 @@ struct CoordinateSystemMapping
static const CoordinateSystemMapping s_coordinateSystemMappings[] =
{
- { "lh-up+y", { bx::Handness::Left, Axis::PositiveY, Axis::PositiveZ } },
- { "lh-up+z", { bx::Handness::Left, Axis::PositiveZ, Axis::PositiveY } },
- { "rh-up+y", { bx::Handness::Right, Axis::PositiveY, Axis::PositiveZ } },
- { "rh-up+z", { bx::Handness::Right, Axis::PositiveZ, Axis::PositiveY } },
+ { "lh-up+y", { bx::Handedness::Left, Axis::PositiveY, Axis::PositiveZ } },
+ { "lh-up+z", { bx::Handedness::Left, Axis::PositiveZ, Axis::PositiveY } },
+ { "rh-up+y", { bx::Handedness::Right, Axis::PositiveY, Axis::PositiveZ } },
+ { "rh-up+z", { bx::Handedness::Right, Axis::PositiveZ, Axis::PositiveY } },
};
struct Mesh
@@ -166,7 +166,13 @@ void optimizeVertexCache(uint16_t* _indices, uint32_t _numIndices, uint32_t _num
delete[] newIndexList;
}
-uint32_t optimizeVertexFetch(uint16_t* _indices, uint32_t _numIndices, uint8_t* _vertexData, uint32_t _numVertices, uint16_t _stride)
+uint32_t optimizeVertexFetch(
+ uint16_t* _indices
+ , uint32_t _numIndices
+ , uint8_t* _vertexData
+ , uint32_t _numVertices
+ , uint16_t _stride
+ )
{
unsigned char* newVertices = (unsigned char*)malloc(_numVertices * _stride );
size_t vertexCount = meshopt_optimizeVertexFetch(newVertices, _indices, _numIndices, _vertexData, _numVertices, _stride);
@@ -176,35 +182,53 @@ uint32_t optimizeVertexFetch(uint16_t* _indices, uint32_t _numIndices, uint8_t*
return uint32_t(vertexCount);
}
-void writeCompressedIndices(bx::WriterI* _writer, const uint16_t* _indices, uint32_t _numIndices, uint32_t _numVertices)
+void writeCompressedIndices(
+ bx::WriterI* _writer
+ , const uint16_t* _indices
+ , uint32_t _numIndices
+ , uint32_t _numVertices
+ , bx::Error* _err
+ )
{
size_t maxSize = meshopt_encodeIndexBufferBound(_numIndices, _numVertices);
unsigned char* compressedIndices = (unsigned char*)malloc(maxSize);
+
size_t compressedSize = meshopt_encodeIndexBuffer(compressedIndices, maxSize, _indices, _numIndices);
+
bx::printf("Indices uncompressed: %10d, compressed: %10d, ratio: %0.2f%%\n"
, _numIndices*2
, (uint32_t)compressedSize
, 100.0f - float(compressedSize ) / float(_numIndices*2)*100.0f
);
- bx::write(_writer, (uint32_t)compressedSize);
- bx::write(_writer, compressedIndices, (uint32_t)compressedSize );
+ bx::write(_writer, (uint32_t)compressedSize, _err);
+ bx::write(_writer, compressedIndices, (uint32_t)compressedSize, _err);
+
free(compressedIndices);
}
-void writeCompressedVertices(bx::WriterI* _writer, const uint8_t* _vertices, uint32_t _numVertices, uint16_t _stride)
+void writeCompressedVertices(
+ bx::WriterI* _writer
+ , const uint8_t* _vertices
+ , uint32_t _numVertices
+ , uint16_t _stride
+ , bx::Error* _err
+ )
{
size_t maxSize = meshopt_encodeVertexBufferBound(_numVertices, _stride);
unsigned char* compressedVertices = (unsigned char*)malloc(maxSize);
+
size_t compressedSize = meshopt_encodeVertexBuffer(compressedVertices, maxSize, _vertices, _numVertices, _stride);
+
bx::printf("Vertices uncompressed: %10d, compressed: %10d, ratio: %0.2f%%\n"
, _numVertices * _stride
, (uint32_t)compressedSize
, 100.0f - float(compressedSize) / float(_numVertices * _stride)*100.0f
);
- bx::write(_writer, (uint32_t)compressedSize);
- bx::write(_writer, compressedVertices, (uint32_t)compressedSize );
+ bx::write(_writer, (uint32_t)compressedSize, _err);
+ bx::write(_writer, compressedVertices, (uint32_t)compressedSize, _err);
+
free(compressedVertices);
}
@@ -305,30 +329,36 @@ void calcTangents(void* _vertices, uint16_t _numVertices, bgfx::VertexLayout _la
delete [] tangents;
}
-void write(bx::WriterI* _writer, const void* _vertices, uint32_t _numVertices, uint32_t _stride)
+void write(
+ bx::WriterI* _writer
+ , const void* _vertices
+ , uint32_t _numVertices
+ , uint32_t _stride
+ , bx::Error* _err
+ )
{
- Sphere maxSphere;
- calcMaxBoundingSphere(maxSphere, _vertices, _numVertices, _stride);
+ bx::Sphere maxSphere;
+ bx::calcMaxBoundingSphere(maxSphere, _vertices, _numVertices, _stride);
- Sphere minSphere;
- calcMinBoundingSphere(minSphere, _vertices, _numVertices, _stride);
+ bx::Sphere minSphere;
+ bx::calcMinBoundingSphere(minSphere, _vertices, _numVertices, _stride);
if (minSphere.radius > maxSphere.radius)
{
- bx::write(_writer, maxSphere);
+ bx::write(_writer, maxSphere, _err);
}
else
{
- bx::write(_writer, minSphere);
+ bx::write(_writer, minSphere, _err);
}
- Aabb aabb;
- toAabb(aabb, _vertices, _numVertices, _stride);
- bx::write(_writer, aabb);
+ bx::Aabb aabb;
+ bx::toAabb(aabb, _vertices, _numVertices, _stride);
+ bx::write(_writer, aabb, _err);
- Obb obb;
- calcObb(obb, _vertices, _numVertices, _stride, s_obbSteps);
- bx::write(_writer, obb);
+ bx::Obb obb;
+ bx::calcObb(obb, _vertices, _numVertices, _stride, s_obbSteps);
+ bx::write(_writer, obb, _err);
}
void write(
@@ -341,6 +371,7 @@ void write(
, bool _compress
, const stl::string& _material
, const PrimitiveArray& _primitives
+ , bx::Error* _err
)
{
using namespace bx;
@@ -350,54 +381,58 @@ void write(
if (_compress)
{
- write(_writer, kChunkVertexBufferCompressed);
- write(_writer, _vertices, _numVertices, stride);
+ write(_writer, kChunkVertexBufferCompressed, _err);
+ write(_writer, _vertices, _numVertices, stride, _err);
write(_writer, _layout);
- write(_writer, uint16_t(_numVertices) );
- writeCompressedVertices(_writer, _vertices, _numVertices, uint16_t(stride) );
+ write(_writer, uint16_t(_numVertices), _err);
+ writeCompressedVertices(_writer, _vertices, _numVertices, uint16_t(stride), _err);
}
else
{
- write(_writer, kChunkVertexBuffer);
- write(_writer, _vertices, _numVertices, stride);
+ write(_writer, kChunkVertexBuffer, _err);
+ write(_writer, _vertices, _numVertices, stride, _err);
- write(_writer, _layout);
+ write(_writer, _layout, _err);
- write(_writer, uint16_t(_numVertices) );
- write(_writer, _vertices, _numVertices*stride);
+ write(_writer, uint16_t(_numVertices), _err);
+ write(_writer, _vertices, _numVertices*stride, _err);
}
if (_compress)
{
- write(_writer, kChunkIndexBufferCompressed);
- write(_writer, _numIndices);
- writeCompressedIndices(_writer, _indices, _numIndices, _numVertices);
+ write(_writer, kChunkIndexBufferCompressed, _err);
+ write(_writer, _numIndices, _err);
+
+ writeCompressedIndices(_writer, _indices, _numIndices, _numVertices, _err);
}
else
{
- write(_writer, kChunkIndexBuffer);
- write(_writer, _numIndices);
- write(_writer, _indices, _numIndices*2);
+ write(_writer, kChunkIndexBuffer, _err);
+ write(_writer, _numIndices, _err);
+ write(_writer, _indices, _numIndices*2, _err);
}
- write(_writer, kChunkPrimitive);
+ write(_writer, kChunkPrimitive, _err);
+
uint16_t nameLen = uint16_t(_material.size() );
- write(_writer, nameLen);
- write(_writer, _material.c_str(), nameLen);
- write(_writer, uint16_t(_primitives.size() ) );
+ write(_writer, nameLen, _err);
+
+ write(_writer, _material.c_str(), nameLen, _err);
+ write(_writer, uint16_t(_primitives.size() ), _err);
+
for (PrimitiveArray::const_iterator primIt = _primitives.begin(); primIt != _primitives.end(); ++primIt)
{
const Primitive& prim = *primIt;
nameLen = uint16_t(prim.m_name.size() );
- write(_writer, nameLen);
- write(_writer, prim.m_name.c_str(), nameLen);
- write(_writer, prim.m_startIndex);
- write(_writer, prim.m_numIndices);
- write(_writer, prim.m_startVertex);
- write(_writer, prim.m_numVertices);
- write(_writer, &_vertices[prim.m_startVertex*stride], prim.m_numVertices, stride);
+ write(_writer, nameLen, _err);
+ write(_writer, prim.m_name.c_str(), nameLen, _err);
+ write(_writer, prim.m_startIndex, _err);
+ write(_writer, prim.m_numIndices, _err);
+ write(_writer, prim.m_startVertex, _err);
+ write(_writer, prim.m_numVertices, _err);
+ write(_writer, &_vertices[prim.m_startVertex*stride], prim.m_numVertices, stride, _err);
}
}
@@ -424,7 +459,7 @@ void mtxCoordinateTransform(float* _result, const CoordinateSystem& _cs)
bx::Vec3 forward = s_axisVectors[_cs.m_forward];
bx::Vec3 right = cross(forward,up);
- if (_cs.m_handness == bx::Handness::Left)
+ if (_cs.m_handedness == bx::Handedness::Left)
{
right = bx::mul(right, -1.0f);
}
@@ -470,7 +505,7 @@ void parseObj(char* _data, uint32_t _size, Mesh* _mesh, bool _hasBc)
// https://en.wikipedia.org/wiki/Wavefront_.obj_file
// Coordinate system is right-handed, but up/forward is not defined, but +Y Up, +Z Forward seems to be a common default
- _mesh->m_coordinateSystem.m_handness = bx::Handness::Right;
+ _mesh->m_coordinateSystem.m_handedness = bx::Handedness::Right;
_mesh->m_coordinateSystem.m_up = Axis::PositiveY;
_mesh->m_coordinateSystem.m_forward = Axis::PositiveZ;
@@ -847,7 +882,7 @@ void parseGltf(char* _data, uint32_t _size, Mesh* _mesh, bool _hasBc, const bx::
// - Gltf 2.0 specification
// https://github.com/KhronosGroup/glTF/tree/master/specification/2.0
- _mesh->m_coordinateSystem.m_handness = bx::Handness::Right;
+ _mesh->m_coordinateSystem.m_handedness = bx::Handedness::Right;
_mesh->m_coordinateSystem.m_forward = Axis::PositiveZ;
_mesh->m_coordinateSystem.m_up = Axis::PositiveY;
@@ -896,8 +931,8 @@ void help(const char* _error = NULL)
bx::printf(
"geometryc, bgfx geometry compiler tool, version %d.%d.%d.\n"
- "Copyright 2011-2021 Branimir Karadzic. All rights reserved.\n"
- "License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n\n"
+ "Copyright 2011-2022 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
, BGFX_API_VERSION
@@ -913,26 +948,27 @@ void help(const char* _error = NULL)
"\n"
"Options:\n"
- " -h, --help Help.\n"
- " -v, --version Version information only.\n"
- " -f <file path> Input file path.\n"
- " -o <file path> Output file path.\n"
+ " -h, --help Display this help and exit.\n"
+ " -v, --version Output version information and exit.\n"
+ " -f <file path> Input's file path.\n"
+ " -o <file path> Output's file path.\n"
" -s, --scale <num> Scale factor.\n"
" --ccw Front face is counter-clockwise winding order.\n"
" --flipv Flip texture coordinate V.\n"
" --obb <num> Number of steps for calculating oriented bounding box.\n"
- " Default value is 17. Less steps less precise OBB is.\n"
- " More steps slower calculation.\n"
+ " Defaults to 17.\n"
+ " Less steps = less precise OBB.\n"
+ " More steps = slower calculation.\n"
" --packnormal <num> Normal packing.\n"
- " 0 - unpacked 12 bytes (default).\n"
+ " 0 - unpacked 12 bytes. (default)\n"
" 1 - packed 4 bytes.\n"
" --packuv <num> Texture coordinate packing.\n"
- " 0 - unpacked 8 bytes (default).\n"
+ " 0 - unpacked 8 bytes. (default)\n"
" 1 - packed 4 bytes.\n"
- " --tangent Calculate tangent vectors (packing mode is the same as normal).\n"
- " --barycentric Adds barycentric vertex attribute (packed in bgfx::Attrib::Color1).\n"
+ " --tangent Calculate tangent vectors. (packing mode is the same as normal)\n"
+ " --barycentric Adds barycentric vertex attribute. (Packed in bgfx::Attrib::Color1)\n"
" -c, --compress Compress indices.\n"
- " --[l/r]h-up+[y/z] Coordinate system. Default is '--lh-up+y' Left-Handed +Y is up.\n"
+ " --[l/r]h-up+[y/z] Coordinate system. Defaults to '--lh-up+y' — Left-Handed +Y is up.\n"
"\n"
"For additional information, see https://github.com/bkaradzic/bgfx\n"
@@ -1001,7 +1037,7 @@ int main(int _argc, const char* _argv[])
bool hasBc = cmdLine.hasArg("barycentric");
CoordinateSystem outputCoordinateSystem;
- outputCoordinateSystem.m_handness = bx::Handness::Left;
+ outputCoordinateSystem.m_handedness = bx::Handedness::Left;
outputCoordinateSystem.m_forward = Axis::PositiveZ;
outputCoordinateSystem.m_up = Axis::PositiveY;
for (uint32_t ii = 0; ii < BX_COUNTOF(s_coordinateSystemMappings); ++ii)
@@ -1024,7 +1060,7 @@ int main(int _argc, const char* _argv[])
uint32_t size = (uint32_t)bx::getSize(&fr);
char* data = new char[size+1];
- size = bx::read(&fr, data, size);
+ size = bx::read(&fr, data, size, bx::ErrorAssert{});
data[size] = '\0';
bx::close(&fr);
@@ -1226,18 +1262,22 @@ int main(int _argc, const char* _argv[])
sentinelGroup.m_numTriangles = UINT32_MAX;
mesh.m_groups.push_back(sentinelGroup);
+ bx::Error err;
+
uint32_t ii = 0;
for (GroupArray::const_iterator groupIt = mesh.m_groups.begin(); groupIt != mesh.m_groups.end(); ++groupIt, ++ii)
{
- bool sentinel = groupIt->m_startTriangle == 0 && groupIt->m_numTriangles == UINT32_MAX;
+ const bool sentinel = groupIt->m_startTriangle == 0 && groupIt->m_numTriangles == UINT32_MAX;
+
for (uint32_t tri = groupIt->m_startTriangle, end = tri + groupIt->m_numTriangles; tri < end; ++tri)
{
if (0 != bx::strCmp(material.c_str(), groupIt->m_material.c_str() )
- || sentinel
+ || sentinel
|| 65533 <= numVertices)
{
prim.m_numVertices = numVertices - prim.m_startVertex;
prim.m_numIndices = numIndices - prim.m_startIndex;
+
if (0 < prim.m_numVertices)
{
primitives.push_back(prim);
@@ -1249,27 +1289,31 @@ int main(int _argc, const char* _argv[])
}
triReorderElapsed -= bx::getHPCounter();
+
for (PrimitiveArray::const_iterator primIt = primitives.begin(); primIt != primitives.end(); ++primIt)
{
const Primitive& prim1 = *primIt;
optimizeVertexCache(indexData + prim1.m_startIndex, prim1.m_numIndices, numVertices);
}
+
numVertices = optimizeVertexFetch(indexData, numIndices, vertexData, numVertices, uint16_t(stride) );
triReorderElapsed += bx::getHPCounter();
- if ( numVertices > 0 && numIndices > 0 )
+ if (0 < numVertices
+ && 0 < numIndices)
{
write(&writer
- , vertexData
- , numVertices
- , layout
- , indexData
- , numIndices
- , compress
- , material
- , primitives
- );
+ , vertexData
+ , numVertices
+ , layout
+ , indexData
+ , numIndices
+ , compress
+ , material
+ , primitives
+ , &err
+ );
}
primitives.clear();
@@ -1289,7 +1333,9 @@ int main(int _argc, const char* _argv[])
material = groupIt->m_material;
if (sentinel)
+ {
break;
+ }
}
TriIndices& triangle = mesh.m_triangles[tri];
diff --git a/3rdparty/bgfx/tools/geometryv/fs_mesh.sc b/3rdparty/bgfx/tools/geometryv/fs_mesh.sc
index 67f5d248d11..de56ba5c571 100644
--- a/3rdparty/bgfx/tools/geometryv/fs_mesh.sc
+++ b/3rdparty/bgfx/tools/geometryv/fs_mesh.sc
@@ -2,7 +2,7 @@ $input v_normal
/*
* Copyright 2019 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/tools/geometryv/geometryv.cpp b/3rdparty/bgfx/tools/geometryv/geometryv.cpp
index adf15b2f358..ea3e075faae 100644
--- a/3rdparty/bgfx/tools/geometryv/geometryv.cpp
+++ b/3rdparty/bgfx/tools/geometryv/geometryv.cpp
@@ -1,6 +1,6 @@
/*
* Copyright 2019-2019 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -214,7 +214,7 @@ struct Camera
{
const bx::Vec3 toTarget = bx::sub(m_target.dest, m_pos.dest);
const float toTargetLen = bx::length(toTarget);
- const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatMin);
+ const float invToTargetLen = 1.0f / (toTargetLen + bx::kFloatSmallest);
const bx::Vec3 toTargetNorm = bx::mul(toTarget, invToTargetLen);
float delta = toTargetLen * _dz;
@@ -237,7 +237,7 @@ struct Camera
const bx::Vec3 toPos = bx::sub(m_pos.curr, m_target.curr);
const float toPosLen = bx::length(toPos);
- const float invToPosLen = 1.0f / (toPosLen + bx::kFloatMin);
+ const float invToPosLen = 1.0f / (toPosLen + bx::kFloatSmallest);
const bx::Vec3 toPosNorm = bx::mul(toPos, invToPosLen);
float ll[2];
@@ -430,7 +430,7 @@ struct View
{
m_path = _filePath;
}
- else if (bx::open(&dr, _filePath.getPath() ) )
+ else if (bx::open(&dr, _filePath.getPath()) )
{
m_path = _filePath.getPath();
}
@@ -515,7 +515,7 @@ struct View
bx::FileReader reader;
if (bx::open(&reader, filePath) )
{
- bx::read(&reader, settings);
+ bx::read(&reader, settings, bx::ErrorAssert{});
bx::close(&reader);
if (!bx::fromString(&m_width, settings.get("view/width") ) )
@@ -550,7 +550,7 @@ struct View
bx::FileWriter writer;
if (bx::open(&writer, filePath) )
{
- bx::write(&writer, settings);
+ bx::write(&writer, settings, bx::ErrorAssert{});
bx::close(&writer);
}
}
@@ -659,7 +659,7 @@ void help(const char* _error = NULL)
bx::printf(
"geometryv, bgfx geometry viewer tool, version %d.%d.%d.\n"
"Copyright 2019-2019 Attila Kocsis. All rights reserved.\n"
- "License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n\n"
+ "License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n\n"
, BGFX_GEOMETRYV_VERSION_MAJOR
, BGFX_GEOMETRYV_VERSION_MINOR
, BGFX_API_VERSION
@@ -715,10 +715,12 @@ int _main_(int _argc, char** _argv)
View view;
cmdAdd("view", cmdView, &view);
- entry::setWindowFlags(entry::WindowHandle{0}, ENTRY_WINDOW_FLAG_ASPECT_RATIO, false);
- entry::setWindowSize(entry::WindowHandle{0}, view.m_width, view.m_height);
+ entry::setWindowFlags(entry::kDefaultWindowHandle, ENTRY_WINDOW_FLAG_ASPECT_RATIO, false);
+ entry::setWindowSize(entry::kDefaultWindowHandle, view.m_width, view.m_height);
bgfx::Init init;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = view.m_width;
init.resolution.width = view.m_height;
init.resolution.reset = 0
@@ -1002,20 +1004,40 @@ int _main_(int _argc, char** _argv)
ImGui::Text("Name: %s %s", view.m_fileList[view.m_fileIndex].c_str(), layout);
ImGui::Indent();
- for (GroupArray::const_iterator itGroup = mesh->m_groups.begin(), itGroupEnd = mesh->m_groups.end(); itGroup != itGroupEnd; ++itGroup)
+ for (GroupArray::const_iterator itGroup = mesh->m_groups.begin(), itGroupEnd = mesh->m_groups.end()
+ ; itGroup != itGroupEnd
+ ; ++itGroup
+ )
{
- ImGui::Text("Group v %d i %d c %.2f %.2f %.2f r %.2f", itGroup->m_numVertices, itGroup->m_numIndices,
- itGroup->m_sphere.center.x, itGroup->m_sphere.center.y, itGroup->m_sphere.center.z,
- itGroup->m_sphere.radius);
+ ImGui::Text("Group v %d i %d c %.2f %.2f %.2f r %.2f"
+ , itGroup->m_numVertices
+ , itGroup->m_numIndices
+ , itGroup->m_sphere.center.x
+ , itGroup->m_sphere.center.y
+ , itGroup->m_sphere.center.z
+ , itGroup->m_sphere.radius
+ );
+
ImGui::Indent();
- for (PrimitiveArray::const_iterator itPrim = itGroup->m_prims.begin(), itPrimEnd = itGroup->m_prims.end(); itPrim != itPrimEnd; ++itPrim)
+
+ for (PrimitiveArray::const_iterator itPrim = itGroup->m_prims.begin(), itPrimEnd = itGroup->m_prims.end()
+ ; itPrim != itPrimEnd
+ ; ++itPrim
+ )
{
- ImGui::Text("Primitive v %d i %d c %.2f %.2f %.2f r %.2f", itPrim->m_numVertices, itPrim->m_numIndices,
- itPrim->m_sphere.center.x, itPrim->m_sphere.center.y, itPrim->m_sphere.center.z,
- itPrim->m_sphere.radius);
+ ImGui::Text("Primitive v %d i %d c %.2f %.2f %.2f r %.2f"
+ , itPrim->m_numVertices
+ , itPrim->m_numIndices
+ , itPrim->m_sphere.center.x
+ , itPrim->m_sphere.center.y
+ , itPrim->m_sphere.center.z
+ , itPrim->m_sphere.radius
+ );
}
+
ImGui::Unindent();
}
+
ImGui::Unindent();
ImGui::Separator();
@@ -1055,8 +1077,11 @@ int _main_(int _argc, char** _argv)
{
const int32_t itemCount = int32_t(view.m_fileList.size() );
- int32_t start, end;
- ImGui::CalcListClipping(itemCount, itemHeight, &start, &end);
+ ImGuiListClipper clipper;
+ clipper.Begin(itemCount, itemHeight);
+
+ int32_t start = clipper.DisplayStart;
+ int32_t end = clipper.DisplayEnd;
const int32_t index = int32_t(view.m_fileIndex);
if (index <= start)
@@ -1068,9 +1093,6 @@ int _main_(int _argc, char** _argv)
ImGui::SetScrollY(ImGui::GetScrollY() + (index-end+1)*itemHeight);
}
- ImGuiListClipper clipper;
- clipper.Begin(itemCount, itemHeight);
-
while (clipper.Step() )
{
for (int32_t pos = clipper.DisplayStart; pos < clipper.DisplayEnd; ++pos)
@@ -1107,7 +1129,7 @@ int _main_(int _argc, char** _argv)
ImGui::Text(
"geometryv, bgfx geometry viewer tool " ICON_KI_WRENCH ", version %d.%d.%d.\n"
"Copyright 2019-2019 Attila Kocsis. All rights reserved.\n"
- "License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n"
+ "License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n"
, BGFX_GEOMETRYV_VERSION_MAJOR
, BGFX_GEOMETRYV_VERSION_MINOR
, BGFX_API_VERSION
@@ -1189,7 +1211,7 @@ int _main_(int _argc, char** _argv)
uint32_t numPrimitives = 0;
uint32_t numVertices = 0;
uint32_t numIndices = 0;
- Aabb boundingBox = {};
+ bx::Aabb boundingBox = {};
for (GroupArray::const_iterator it = mesh->m_groups.begin(), itEnd = mesh->m_groups.end(); it != itEnd; ++it)
{
@@ -1218,8 +1240,8 @@ int _main_(int _argc, char** _argv)
, numIndices
);
- view.m_meshCenter = getCenter(boundingBox);
- view.m_meshRadius = bx::length(getExtents(boundingBox));
+ view.m_meshCenter = bx::getCenter(boundingBox);
+ view.m_meshRadius = bx::length(bx::getExtents(boundingBox) );
view.m_camera.init( view.m_meshCenter, view.m_meshRadius * 2.0f, 0.01f, view.m_meshRadius * 10.0f);
}
@@ -1228,8 +1250,7 @@ int _main_(int _argc, char** _argv)
bx::stringPrintf(title, "Failed to load %s!", filePath);
}
- entry::WindowHandle handle = { 0 };
- entry::setWindowTitle(handle, title.c_str() );
+ entry::setWindowTitle(entry::kDefaultWindowHandle, title.c_str() );
}
int64_t now = bx::getHPCounter();
diff --git a/3rdparty/bgfx/tools/geometryv/makefile b/3rdparty/bgfx/tools/geometryv/makefile
index 6eb416e17e1..d1033a73cbb 100644
--- a/3rdparty/bgfx/tools/geometryv/makefile
+++ b/3rdparty/bgfx/tools/geometryv/makefile
@@ -1,6 +1,6 @@
#
# Copyright 2019-2019 Attila Kocsis. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
include ../../scripts/shader-embeded.mk
diff --git a/3rdparty/bgfx/tools/geometryv/vs_mesh.sc b/3rdparty/bgfx/tools/geometryv/vs_mesh.sc
index 6049de7435e..dba9b532129 100644
--- a/3rdparty/bgfx/tools/geometryv/vs_mesh.sc
+++ b/3rdparty/bgfx/tools/geometryv/vs_mesh.sc
@@ -3,7 +3,7 @@ $output v_normal
/*
* Copyright 2019-2019 Attila Kocsis. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc.cpp b/3rdparty/bgfx/tools/shaderc/shaderc.cpp
index 7932dec0204..a8c284c14af 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc.cpp
+++ b/3rdparty/bgfx/tools/shaderc/shaderc.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "shaderc.h"
@@ -309,6 +309,31 @@ namespace bgfx
NULL
};
+ void fatal(const char* _filePath, uint16_t _line, Fatal::Enum _code, const char* _format, ...)
+ {
+ BX_UNUSED(_filePath, _line, _code);
+
+ va_list argList;
+ va_start(argList, _format);
+
+ bx::vprintf(_format, argList);
+
+ va_end(argList);
+
+ abort();
+ }
+
+ void trace(const char* _filePath, uint16_t _line, const char* _format, ...)
+ {
+ BX_UNUSED(_filePath, _line);
+
+ va_list argList;
+ va_start(argList, _format);
+
+ bx::vprintf(_format, argList);
+
+ va_end(argList);
+ }
Options::Options()
: shaderType(' ')
, disasm(false)
@@ -443,7 +468,7 @@ namespace bgfx
len = bx::vsnprintf(out, len, _format, argList);
}
- len = bx::write(_writer, out, len);
+ len = bx::write(_writer, out, len, bx::ErrorAssert{});
va_end(argList);
@@ -538,8 +563,7 @@ namespace bgfx
len = bx::vsnprintf(out, len, _format, argList);
}
- bx::Error err;
- int32_t size = bx::FileWriter::write(out, len, &err);
+ int32_t size = bx::FileWriter::write(out, len, bx::ErrorAssert{});
va_end(argList);
@@ -584,7 +608,7 @@ namespace bgfx
{
m_size = (uint32_t)bx::getSize(&reader);
m_data = new char[m_size+1];
- m_size = (uint32_t)bx::read(&reader, m_data, m_size);
+ m_size = (uint32_t)bx::read(&reader, m_data, m_size, bx::ErrorAssert{});
bx::close(&reader);
if (m_data[0] == '\xef'
@@ -686,7 +710,7 @@ namespace bgfx
bx::FileWriter out;
if (bx::open(&out, _filePath) )
{
- bx::write(&out, _data, _size);
+ bx::write(&out, _data, _size, bx::ErrorAssert{});
bx::close(&out);
}
}
@@ -966,8 +990,8 @@ namespace bgfx
bx::printf(
"shaderc, bgfx shader compiler tool, version %d.%d.%d.\n"
- "Copyright 2011-2021 Branimir Karadzic. All rights reserved.\n"
- "License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n\n"
+ "Copyright 2011-2022 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
, BGFX_API_VERSION
@@ -978,11 +1002,12 @@ namespace bgfx
"\n"
"Options:\n"
- " -h, --help Help.\n"
- " -v, --version Version information only.\n"
- " -f <file path> Input file path.\n"
- " -i <include path> Include path (for multiple paths use -i multiple times).\n"
- " -o <file path> Output file path.\n"
+ " -h, --help Display this help and exit.\n"
+ " -v, --version Output version information and exit.\n"
+ " -f <file path> Input's file path.\n"
+ " -i <include path> Include path. (for multiple paths use -i multiple times)\n"
+ " -o <file path> Output's file path.\n"
+ " --stdout Output to console.\n"
" --bin2c [array name] Generate C header file. If array name is not specified base file name will be used as name.\n"
" --depends Generate makefile style depends file.\n"
" --platform <platform> Target platform.\n"
@@ -993,7 +1018,7 @@ namespace bgfx
" orbis\n"
" osx\n"
" windows\n"
- " -p, --profile <profile> Shader model (default GLSL).\n"
+ " -p, --profile <profile> Shader model. Defaults to GLSL.\n"
);
{
@@ -1016,20 +1041,20 @@ namespace bgfx
}
bx::printf(
- " --preprocess Preprocess only.\n"
- " --define <defines> Add defines to preprocessor (semicolon separated).\n"
- " --raw Do not process shader. No preprocessor, and no glsl-optimizer (GLSL only).\n"
- " --type <type> Shader type (vertex, fragment, compute)\n"
- " --varyingdef <file path> Path to varying.def.sc file.\n"
- " --verbose Verbose.\n"
+ " --preprocess Only pre-process.\n"
+ " --define <defines> Add defines to preprocessor. (Semicolon-separated)\n"
+ " --raw Do not process shader. No preprocessor, and no glsl-optimizer. (GLSL only)\n"
+ " --type <type> Shader type. Can be 'vertex', 'fragment, or 'compute'.\n"
+ " --varyingdef <file path> varying.def.sc's file path.\n"
+ " --verbose Be verbose.\n"
"\n"
- "Options (DX9 and DX11 only):\n"
+ "(DX9 and DX11 only):\n"
"\n"
" --debug Debug information.\n"
" --disasm Disassemble compiled shader.\n"
- " -O <level> Optimization level (0, 1, 2, 3).\n"
+ " -O <level> Set optimization level. Can be 0 to 3.\n"
" --Werror Treat warnings as errors.\n"
"\n"
@@ -1044,7 +1069,7 @@ namespace bgfx
return word;
}
- bool compileShader(const char* _varying, const char* _comment, char* _shader, uint32_t _shaderLen, Options& _options, bx::FileWriter* _writer)
+ bool compileShader(const char* _varying, const char* _comment, char* _shader, uint32_t _shaderLen, Options& _options, bx::WriterI* _writer)
{
uint32_t profile_id = 0;
@@ -1104,7 +1129,6 @@ namespace bgfx
preprocessor.setDefaultDefine("BX_PLATFORM_WINDOWS");
preprocessor.setDefaultDefine("BX_PLATFORM_XBOXONE");
-// preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_ESSL");
preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_GLSL");
preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_HLSL");
preprocessor.setDefaultDefine("BGFX_SHADER_LANGUAGE_METAL");
@@ -1116,10 +1140,14 @@ namespace bgfx
preprocessor.setDefaultDefine("BGFX_SHADER_TYPE_VERTEX");
char glslDefine[128];
- bx::snprintf(glslDefine, BX_COUNTOF(glslDefine)
- , "BGFX_SHADER_LANGUAGE_GLSL=%d"
- , (profile->lang == ShadingLang::ESSL) ? 1 : profile->id
- );
+ if (profile->lang == ShadingLang::GLSL
+ || profile->lang == ShadingLang::ESSL)
+ {
+ bx::snprintf(glslDefine, BX_COUNTOF(glslDefine)
+ , "BGFX_SHADER_LANGUAGE_GLSL=%d"
+ , profile->id
+ );
+ }
char hlslDefine[128];
if (profile->lang == ShadingLang::HLSL)
@@ -1134,12 +1162,19 @@ namespace bgfx
if (0 == bx::strCmpI(platform, "android") )
{
preprocessor.setDefine("BX_PLATFORM_ANDROID=1");
- preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
+ if (profile->lang == ShadingLang::SpirV)
+ {
+ preprocessor.setDefine("BGFX_SHADER_LANGUAGE_SPIRV=1");
+ }
+ else
+ {
+ preprocessor.setDefine(glslDefine);
+ }
}
else if (0 == bx::strCmpI(platform, "asm.js") )
{
preprocessor.setDefine("BX_PLATFORM_EMSCRIPTEN=1");
- preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
+ preprocessor.setDefine(glslDefine);
}
else if (0 == bx::strCmpI(platform, "ios") )
{
@@ -1150,7 +1185,7 @@ namespace bgfx
}
else
{
- preprocessor.setDefine("BGFX_SHADER_LANGUAGE_GLSL=1");
+ preprocessor.setDefine(glslDefine);
}
}
else if (0 == bx::strCmpI(platform, "linux") )
@@ -1352,6 +1387,7 @@ namespace bgfx
InOut shaderOutputs;
uint32_t inputHash = 0;
uint32_t outputHash = 0;
+ bx::ErrorAssert err;
char* data;
char* input;
@@ -1443,31 +1479,31 @@ namespace bgfx
{
if ('f' == _options.shaderType)
{
- bx::write(_writer, BGFX_CHUNK_MAGIC_FSH);
+ bx::write(_writer, BGFX_CHUNK_MAGIC_FSH, &err);
}
else if ('v' == _options.shaderType)
{
- bx::write(_writer, BGFX_CHUNK_MAGIC_VSH);
+ bx::write(_writer, BGFX_CHUNK_MAGIC_VSH, &err);
}
else
{
- bx::write(_writer, BGFX_CHUNK_MAGIC_CSH);
+ bx::write(_writer, BGFX_CHUNK_MAGIC_CSH, &err);
}
- bx::write(_writer, inputHash);
- bx::write(_writer, outputHash);
+ bx::write(_writer, inputHash, &err);
+ bx::write(_writer, outputHash, &err);
}
if (raw)
{
if (profile->lang == ShadingLang::GLSL)
{
- bx::write(_writer, uint16_t(0) );
+ bx::write(_writer, uint16_t(0), &err);
uint32_t shaderSize = (uint32_t)bx::strLen(input);
- bx::write(_writer, shaderSize);
- bx::write(_writer, input, shaderSize);
- bx::write(_writer, uint8_t(0) );
+ bx::write(_writer, shaderSize, &err);
+ bx::write(_writer, input, shaderSize, &err);
+ bx::write(_writer, uint8_t(0), &err);
compiled = true;
}
@@ -1579,7 +1615,12 @@ namespace bgfx
{
if (_options.preprocessOnly)
{
- bx::write(_writer, preprocessor.m_preprocessed.c_str(), (int32_t)preprocessor.m_preprocessed.size() );
+ bx::write(
+ _writer
+ , preprocessor.m_preprocessed.c_str()
+ , (int32_t)preprocessor.m_preprocessed.size()
+ , &err
+ );
return true;
}
@@ -1587,9 +1628,9 @@ namespace bgfx
{
std::string code;
- bx::write(_writer, BGFX_CHUNK_MAGIC_CSH);
- bx::write(_writer, uint32_t(0) );
- bx::write(_writer, outputHash);
+ bx::write(_writer, BGFX_CHUNK_MAGIC_CSH, &err);
+ bx::write(_writer, uint32_t(0), &err);
+ bx::write(_writer, outputHash, &err);
if (profile->lang == ShadingLang::GLSL
|| profile->lang == ShadingLang::ESSL)
@@ -1607,23 +1648,16 @@ namespace bgfx
);
}
-#if 1
code += preprocessor.m_preprocessed;
- bx::write(_writer, uint16_t(0) );
+ bx::write(_writer, uint16_t(0), &err);
uint32_t shaderSize = (uint32_t)code.size();
- bx::write(_writer, shaderSize);
- bx::write(_writer, code.c_str(), shaderSize);
- bx::write(_writer, uint8_t(0) );
+ bx::write(_writer, shaderSize, &err);
+ bx::write(_writer, code.c_str(), shaderSize, &err);
+ bx::write(_writer, uint8_t(0), &err);
compiled = true;
-#else
- code += _comment;
- code += preprocessor.m_preprocessed;
-
- compiled = compileGLSLShader(cmdLine, essl, code, writer);
-#endif // 0
}
else
{
@@ -1705,8 +1739,8 @@ namespace bgfx
}
if (hasFragColor)
{
- preprocessor.writef("#define gl_FragColor bgfx_FragData0\n");
- preprocessor.writef("out mediump vec4 bgfx_FragData0;\n");
+ preprocessor.writef("#define gl_FragColor bgfx_FragColor\n");
+ preprocessor.writef("out mediump vec4 bgfx_FragColor;\n");
}
else if (numFragData)
{
@@ -1923,7 +1957,7 @@ namespace bgfx
}
else
{
- bx::printf("gl_PrimitiveID builtin is not supported by this D3D9 HLSL.\n");
+ bx::printf("gl_PrimitiveID builtin is not supported by D3D9 HLSL.\n");
return false;
}
}
@@ -1998,7 +2032,7 @@ namespace bgfx
}
else
{
- bx::printf("gl_ViewportIndex builtin is not supported by this D3D9 HLSL.\n");
+ bx::printf("gl_ViewportIndex builtin is not supported by D3D9 HLSL.\n");
return false;
}
}
@@ -2014,7 +2048,7 @@ namespace bgfx
}
else
{
- bx::printf("gl_Layer builtin is not supported by this D3D9 HLSL.\n");
+ bx::printf("gl_Layer builtin is not supported by D3D9 HLSL.\n");
return false;
}
}
@@ -2053,7 +2087,7 @@ namespace bgfx
}
else
{
- bx::printf("gl_VertexID builtin is not supported by this D3D9 HLSL.\n");
+ bx::printf("gl_VertexID builtin is not supported by D3D9 HLSL.\n");
return false;
}
}
@@ -2069,7 +2103,7 @@ namespace bgfx
}
else
{
- bx::printf("gl_InstanceID builtin is not supported by this D3D9 HLSL.\n");
+ bx::printf("gl_InstanceID builtin is not supported by D3D9 HLSL.\n");
return false;
}
}
@@ -2108,12 +2142,14 @@ namespace bgfx
if (preprocessor.run(input) )
{
- //BX_TRACE("Input file: %s", filePath);
- //BX_TRACE("Output file: %s", outFilePath);
-
if (_options.preprocessOnly)
{
- bx::write(_writer, preprocessor.m_preprocessed.c_str(), (int32_t)preprocessor.m_preprocessed.size() );
+ bx::write(
+ _writer
+ , preprocessor.m_preprocessed.c_str()
+ , (int32_t)preprocessor.m_preprocessed.size()
+ , &err
+ );
return true;
}
@@ -2123,21 +2159,21 @@ namespace bgfx
if ('f' == _options.shaderType)
{
- bx::write(_writer, BGFX_CHUNK_MAGIC_FSH);
- bx::write(_writer, inputHash);
- bx::write(_writer, uint32_t(0) );
+ bx::write(_writer, BGFX_CHUNK_MAGIC_FSH, &err);
+ bx::write(_writer, inputHash, &err);
+ bx::write(_writer, uint32_t(0), &err);
}
else if ('v' == _options.shaderType)
{
- bx::write(_writer, BGFX_CHUNK_MAGIC_VSH);
- bx::write(_writer, uint32_t(0) );
- bx::write(_writer, outputHash);
+ bx::write(_writer, BGFX_CHUNK_MAGIC_VSH, &err);
+ bx::write(_writer, uint32_t(0), &err);
+ bx::write(_writer, outputHash, &err);
}
else
{
- bx::write(_writer, BGFX_CHUNK_MAGIC_CSH);
- bx::write(_writer, uint32_t(0) );
- bx::write(_writer, outputHash);
+ bx::write(_writer, BGFX_CHUNK_MAGIC_CSH, &err);
+ bx::write(_writer, uint32_t(0), &err);
+ bx::write(_writer, outputHash, &err);
}
if (profile->lang == ShadingLang::GLSL
@@ -2337,6 +2373,11 @@ namespace bgfx
bx::stringPrintf(code, "precision highp int;\n");
}
+ if (glsl_profile >= 300)
+ {
+ bx::stringPrintf(code, "precision highp sampler2DArray;\n");
+ }
+
// Pretend that all extensions are available.
// This will be stripped later.
if (usesTextureLod)
@@ -2448,7 +2489,7 @@ namespace bgfx
" , vec4(v0.w, v1.w, v2.w, v3.w)\n"
" );\n"
"}\n"
- ;
+ ;
}
}
}
@@ -2456,15 +2497,27 @@ namespace bgfx
{
bx::stringPrintf(code, "#version %d\n", glsl_profile);
+ if (120 < glsl_profile)
+ {
+ if (!bx::findIdentifierMatch(input, "gl_FragColor").isEmpty() )
+ {
+ bx::stringPrintf(code
+ , "out vec4 bgfx_FragColor;\n"
+ "#define gl_FragColor bgfx_FragColor\n"
+ );
+ }
+ }
+
bx::stringPrintf(code
- , "#define texture2DLod textureLod\n"
+ , "#define texture2D texture\n"
+ "#define texture2DLod textureLod\n"
"#define texture2DGrad textureGrad\n"
"#define texture2DProjLod textureProjLod\n"
"#define texture2DProjGrad textureProjGrad\n"
"#define textureCubeLod textureLod\n"
"#define textureCubeGrad textureGrad\n"
"#define texture3D texture\n"
- "#define texture2DLofOffset textureLodOffset\n"
+ "#define texture2DLodOffset textureLodOffset\n"
);
bx::stringPrintf(code, "#define attribute in\n");
@@ -2483,12 +2536,12 @@ namespace bgfx
{
code += preprocessor.m_preprocessed;
- bx::write(_writer, uint16_t(0) );
+ bx::write(_writer, uint16_t(0), &err);
uint32_t shaderSize = (uint32_t)code.size();
- bx::write(_writer, shaderSize);
- bx::write(_writer, code.c_str(), shaderSize);
- bx::write(_writer, uint8_t(0) );
+ bx::write(_writer, shaderSize, &err);
+ bx::write(_writer, code.c_str(), shaderSize, &err);
+ bx::write(_writer, uint8_t(0), &err);
compiled = true;
}
@@ -2581,10 +2634,11 @@ namespace bgfx
return bx::kExitFailure;
}
+ bool consoleOut = cmdLine.hasArg("stdout");
const char* outFilePath = cmdLine.findOption('o');
- if (NULL == outFilePath)
+ if (NULL == outFilePath && !consoleOut)
{
- help("Output file name must be specified.");
+ help("Output file name must be specified or use \"--stdout\" to output to stdout.");
return bx::kExitFailure;
}
@@ -2597,7 +2651,7 @@ namespace bgfx
Options options;
options.inputFilePath = filePath;
- options.outputFilePath = outFilePath;
+ options.outputFilePath = consoleOut ? "" : outFilePath;
options.shaderType = bx::toLower(type[0]);
options.disasm = cmdLine.hasArg('\0', "disasm");
@@ -2745,7 +2799,7 @@ namespace bgfx
const size_t padding = 16384;
uint32_t size = (uint32_t)bx::getSize(&reader);
char* data = new char[size+padding+1];
- size = (uint32_t)bx::read(&reader, data, size);
+ size = (uint32_t)bx::read(&reader, data, size, bx::ErrorAssert{});
if (data[0] == '\xef'
&& data[1] == '\xbb'
@@ -2763,25 +2817,31 @@ namespace bgfx
bx::FileWriter* writer = NULL;
- if (!bin2c.isEmpty() )
- {
- writer = new Bin2cWriter(bin2c);
- }
- else
+ if (!consoleOut)
{
- writer = new bx::FileWriter;
- }
+ if (!bin2c.isEmpty())
+ {
+ writer = new Bin2cWriter(bin2c);
+ }
+ else
+ {
+ writer = new bx::FileWriter;
+ }
- if (!bx::open(writer, outFilePath) )
- {
- bx::printf("Unable to open output file '%s'.\n", outFilePath);
- return bx::kExitFailure;
+ if (!bx::open(writer, outFilePath))
+ {
+ bx::printf("Unable to open output file '%s'.\n", outFilePath);
+ return bx::kExitFailure;
+ }
}
- compiled = compileShader(varying, commandLineComment.c_str(), data, size, options, writer);
+ compiled = compileShader(varying, commandLineComment.c_str(), data, size, options, consoleOut ? bx::getStdOut() : writer);
- bx::close(writer);
- delete writer;
+ if (!consoleOut)
+ {
+ bx::close(writer);
+ delete writer;
+ }
}
if (compiled)
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc.h b/3rdparty/bgfx/tools/shaderc/shaderc.h
index 46672548f14..0da24d24bde 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc.h
+++ b/3rdparty/bgfx/tools/shaderc/shaderc.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#ifndef SHADERC_H_HEADER_GUARD
@@ -11,35 +11,6 @@ namespace bgfx
extern bool g_verbose;
}
-#define _BX_TRACE(_format, ...) \
- BX_MACRO_BLOCK_BEGIN \
- if (bgfx::g_verbose) \
- { \
- bx::printf(BX_FILE_LINE_LITERAL "" _format "\n", ##__VA_ARGS__); \
- } \
- BX_MACRO_BLOCK_END
-
-#define _BX_WARN(_condition, _format, ...) \
- BX_MACRO_BLOCK_BEGIN \
- if (!(_condition) ) \
- { \
- BX_TRACE("WARN " _format, ##__VA_ARGS__); \
- } \
- BX_MACRO_BLOCK_END
-
-#define _BX_ASSERT(_condition, _format, ...) \
- BX_MACRO_BLOCK_BEGIN \
- if (!(_condition) ) \
- { \
- BX_TRACE("CHECK " _format, ##__VA_ARGS__); \
- bx::debugBreak(); \
- } \
- BX_MACRO_BLOCK_END
-
-#define BX_TRACE _BX_TRACE
-#define BX_WARN _BX_WARN
-#define BX_ASSERT _BX_ASSERT
-
#ifndef SHADERC_CONFIG_HLSL
# define SHADERC_CONFIG_HLSL BX_PLATFORM_WINDOWS
#endif // SHADERC_CONFIG_HLSL
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp b/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp
index ea27f2345f6..269c58fd07f 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp
+++ b/3rdparty/bgfx/tools/shaderc/shaderc_glsl.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "shaderc.h"
@@ -75,6 +75,9 @@ namespace bgfx { namespace glsl
char* code = const_cast<char*>(optimizedShader);
strReplace(code, "gl_FragDepthEXT", "gl_FragDepth");
+ strReplace(code, "textureLodEXT", "texture2DLod");
+ strReplace(code, "textureGradEXT", "texture2DGrad");
+
strReplace(code, "texture2DLodARB", "texture2DLod");
strReplace(code, "texture2DLodEXT", "texture2DLod");
strReplace(code, "texture2DGradARB", "texture2DGrad");
@@ -204,6 +207,18 @@ namespace bgfx { namespace glsl
un.num = num;
un.regIndex = 0;
un.regCount = num;
+ switch (un.type)
+ {
+ case UniformType::Mat3:
+ un.regCount *= 3;
+ break;
+ case UniformType::Mat4:
+ un.regCount *= 4;
+ break;
+ default:
+ break;
+ }
+
uniforms.push_back(un);
}
@@ -330,23 +345,25 @@ namespace bgfx { namespace glsl
}
}
+ bx::ErrorAssert err;
+
uint16_t count = (uint16_t)uniforms.size();
- bx::write(_writer, count);
+ bx::write(_writer, 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);
- bx::write(_writer, un.name.c_str(), nameSize);
+ bx::write(_writer, nameSize, &err);
+ bx::write(_writer, un.name.c_str(), nameSize, &err);
uint8_t uniformType = uint8_t(un.type);
- bx::write(_writer, uniformType);
- bx::write(_writer, un.num);
- bx::write(_writer, un.regIndex);
- bx::write(_writer, un.regCount);
- bx::write(_writer, un.texComponent);
- bx::write(_writer, un.texDimension);
- bx::write(_writer, un.texFormat);
+ 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_TRACE("%s, %s, %d, %d, %d"
, un.name.c_str()
@@ -358,10 +375,10 @@ namespace bgfx { namespace glsl
}
uint32_t shaderSize = (uint32_t)bx::strLen(optimizedShader);
- bx::write(_writer, shaderSize);
- bx::write(_writer, optimizedShader, shaderSize);
+ bx::write(_writer, shaderSize, &err);
+ bx::write(_writer, optimizedShader, shaderSize, &err);
uint8_t nul = 0;
- bx::write(_writer, nul);
+ bx::write(_writer, nul, &err);
if (_options.disasm )
{
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp b/3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp
index 3edf14dba31..7671c03f38b 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp
+++ b/3rdparty/bgfx/tools/shaderc/shaderc_hlsl.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "shaderc.h"
@@ -329,6 +329,7 @@ namespace bgfx { namespace hlsl
const uint8_t* headerBytePtr = (const uint8_t*)header;
const char* creator = (const char*)(headerBytePtr + header->Creator);
+ BX_UNUSED(creator);
BX_TRACE("Creator: %s 0x%08x", creator, header->Version);
BX_TRACE("Num constants: %d", header->Constants);
@@ -479,7 +480,7 @@ namespace bgfx { namespace hlsl
un.type = uniformType;
un.num = uint8_t(constDesc.Elements);
un.regIndex = uint16_t(varDesc.StartOffset);
- un.regCount = bx::alignUp(varDesc.Size, 16) / 16;
+ un.regCount = uint16_t(bx::alignUp(varDesc.Size, 16) / 16);
_uniforms.push_back(un);
BX_TRACE("\t%s, %d, size %d, flags 0x%08x, %d (used)"
@@ -609,6 +610,8 @@ namespace bgfx { namespace hlsl
writeFile(hlslfp.c_str(), _code.c_str(), (int32_t)_code.size() );
}
+ bx::ErrorAssert err;
+
HRESULT hr = D3DCompile(_code.c_str()
, _code.size()
, hlslfp.c_str()
@@ -731,27 +734,27 @@ namespace bgfx { namespace hlsl
{
uint16_t count = (uint16_t)uniforms.size();
- bx::write(_writer, count);
+ bx::write(_writer, count, &err);
uint32_t fragmentBit = profile[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);
- bx::write(_writer, un.name.c_str(), nameSize);
+ bx::write(_writer, nameSize, &err);
+ bx::write(_writer, un.name.c_str(), nameSize, &err);
uint8_t type = uint8_t(un.type | fragmentBit);
- bx::write(_writer, type);
- bx::write(_writer, un.num);
- bx::write(_writer, un.regIndex);
- bx::write(_writer, un.regCount);
- bx::write(_writer, un.texComponent);
- bx::write(_writer, un.texDimension);
- bx::write(_writer, un.texFormat);
+ 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_TRACE("%s, %s, %d, %d, %d"
, un.name.c_str()
- , getUniformTypeName(un.type)
+ , getUniformTypeName(UniformType::Enum(un.type & ~kUniformMask))
, un.num
, un.regIndex
, un.regCount
@@ -777,18 +780,18 @@ namespace bgfx { namespace hlsl
{
uint32_t shaderSize = uint32_t(code->GetBufferSize() );
- bx::write(_writer, shaderSize);
- bx::write(_writer, code->GetBufferPointer(), shaderSize);
+ bx::write(_writer, shaderSize, &err);
+ bx::write(_writer, code->GetBufferPointer(), shaderSize, &err);
uint8_t nul = 0;
- bx::write(_writer, nul);
+ bx::write(_writer, nul, &err);
}
if (_version >= 400)
{
- bx::write(_writer, numAttrs);
- bx::write(_writer, attrs, numAttrs*sizeof(uint16_t) );
+ bx::write(_writer, numAttrs, &err);
+ bx::write(_writer, attrs, numAttrs*sizeof(uint16_t), &err);
- bx::write(_writer, size);
+ bx::write(_writer, size, &err);
}
if (_options.disasm )
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc_metal.cpp b/3rdparty/bgfx/tools/shaderc/shaderc_metal.cpp
index 120600c0999..edb3e6a5a45 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc_metal.cpp
+++ b/3rdparty/bgfx/tools/shaderc/shaderc_metal.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "shaderc.h"
@@ -138,6 +138,15 @@ namespace bgfx { namespace metal
0, // maxTaskWorkGroupSizeY_NV
0, // maxTaskWorkGroupSizeZ_NV
0, // maxMeshViewCountNV
+ 0, // maxMeshOutputVerticesEXT
+ 0, // maxMeshOutputPrimitivesEXT
+ 0, // maxMeshWorkGroupSizeX_EXT
+ 0, // maxMeshWorkGroupSizeY_EXT
+ 0, // maxMeshWorkGroupSizeZ_EXT
+ 0, // maxTaskWorkGroupSizeX_EXT
+ 0, // maxTaskWorkGroupSizeY_EXT
+ 0, // maxTaskWorkGroupSizeZ_EXT
+ 0, // maxMeshViewCountEXT
0, // maxDualSourceDrawBuffersEXT
{ // limits
@@ -220,8 +229,10 @@ namespace bgfx { namespace metal
{
uint16_t size = 0;
- uint16_t count = static_cast<uint16_t>(uniforms.size() );
- bx::write(_writer, count);
+ bx::ErrorAssert err;
+
+ uint16_t count = uint16_t(uniforms.size());
+ bx::write(_writer, count, &err);
uint32_t fragmentBit = isFragmentShader ? kUniformFragmentBit : 0;
for (uint16_t ii = 0; ii < count; ++ii)
@@ -231,15 +242,15 @@ namespace bgfx { namespace metal
size += un.regCount*16;
uint8_t nameSize = (uint8_t)un.name.size();
- bx::write(_writer, nameSize);
- bx::write(_writer, un.name.c_str(), nameSize);
- bx::write(_writer, uint8_t(un.type | fragmentBit) );
- bx::write(_writer, un.num);
- bx::write(_writer, un.regIndex);
- bx::write(_writer, un.regCount);
- bx::write(_writer, un.texComponent);
- bx::write(_writer, un.texDimension);
- bx::write(_writer, un.texFormat);
+ 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_TRACE("%s, %s, %d, %d, %d"
, un.name.c_str()
@@ -436,6 +447,11 @@ namespace bgfx { namespace metal
Uniform un;
un.name = program->getUniformName(ii);
+ if (bx::hasSuffix(un.name.c_str(), ".@data") )
+ {
+ continue;
+ }
+
un.num = uint8_t(program->getUniformArraySize(ii) );
const uint32_t offset = program->getUniformBufferOffset(ii);
un.regIndex = uint16_t(offset);
@@ -540,6 +556,8 @@ namespace bgfx { namespace metal
}
uint16_t size = writeUniformArray( _writer, uniforms, _options.shaderType == 'f');
+ bx::Error err;
+
if (_version == BX_MAKEFOURCC('M', 'T', 'L', 0) )
{
spirv_cross::CompilerMSL msl(std::move(spirv) );
@@ -624,42 +642,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);
+ bx::write(_writer, dim, &err);
}
}
uint32_t shaderSize = (uint32_t)source.size();
- bx::write(_writer, shaderSize);
- bx::write(_writer, source.c_str(), shaderSize);
+ bx::write(_writer, shaderSize, &err);
+ bx::write(_writer, source.c_str(), shaderSize, &err);
uint8_t nul = 0;
- bx::write(_writer, nul);
+ bx::write(_writer, nul, &err);
}
else
{
uint32_t shaderSize = (uint32_t)spirv.size() * sizeof(uint32_t);
- bx::write(_writer, shaderSize);
- bx::write(_writer, spirv.data(), shaderSize);
+ bx::write(_writer, shaderSize, &err);
+ bx::write(_writer, spirv.data(), shaderSize, &err);
uint8_t nul = 0;
- bx::write(_writer, nul);
+ bx::write(_writer, nul, &err);
}
//
const uint8_t numAttr = (uint8_t)program->getNumLiveAttributes();
- bx::write(_writer, numAttr);
+ bx::write(_writer, 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) );
+ bx::write(_writer, bgfx::attribToId(attr), &err);
}
else
{
- bx::write(_writer, uint16_t(UINT16_MAX) );
+ bx::write(_writer, uint16_t(UINT16_MAX), &err);
}
}
- bx::write(_writer, size);
+ bx::write(_writer, size, &err);
}
}
}
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc_pssl.cpp b/3rdparty/bgfx/tools/shaderc/shaderc_pssl.cpp
index ba307bb19df..20e45bb215e 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc_pssl.cpp
+++ b/3rdparty/bgfx/tools/shaderc/shaderc_pssl.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "shaderc.h"
diff --git a/3rdparty/bgfx/tools/shaderc/shaderc_spirv.cpp b/3rdparty/bgfx/tools/shaderc/shaderc_spirv.cpp
index 1069e1a3cd9..657cb1015cf 100644
--- a/3rdparty/bgfx/tools/shaderc/shaderc_spirv.cpp
+++ b/3rdparty/bgfx/tools/shaderc/shaderc_spirv.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "shaderc.h"
@@ -156,6 +156,15 @@ namespace bgfx { namespace spirv
0, // maxTaskWorkGroupSizeY_NV
0, // maxTaskWorkGroupSizeZ_NV
0, // maxMeshViewCountNV
+ 0, // maxMeshOutputVerticesEXT
+ 0, // maxMeshOutputPrimitivesEXT
+ 0, // maxMeshWorkGroupSizeX_EXT
+ 0, // maxMeshWorkGroupSizeY_EXT
+ 0, // maxMeshWorkGroupSizeZ_EXT
+ 0, // maxTaskWorkGroupSizeX_EXT
+ 0, // maxTaskWorkGroupSizeY_EXT
+ 0, // maxTaskWorkGroupSizeZ_EXT
+ 0, // maxMeshViewCountEXT
0, // maxDualSourceDrawBuffersEXT
{ // limits
@@ -326,8 +335,10 @@ namespace bgfx { namespace spirv
{
uint16_t size = 0;
- uint16_t count = static_cast<uint16_t>(uniforms.size() );
- bx::write(_writer, count);
+ bx::ErrorAssert err;
+
+ uint16_t count = uint16_t(uniforms.size());
+ bx::write(_writer, count, &err);
uint32_t fragmentBit = isFragmentShader ? kUniformFragmentBit : 0;
@@ -341,19 +352,19 @@ namespace bgfx { namespace spirv
}
uint8_t nameSize = (uint8_t)un.name.size();
- bx::write(_writer, nameSize);
- bx::write(_writer, un.name.c_str(), nameSize);
- bx::write(_writer, uint8_t(un.type | fragmentBit) );
- bx::write(_writer, un.num);
- bx::write(_writer, un.regIndex);
- bx::write(_writer, un.regCount);
- bx::write(_writer, un.texComponent);
- bx::write(_writer, un.texDimension);
- bx::write(_writer, un.texFormat);
+ 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_TRACE("%s, %s, %d, %d, %d"
, un.name.c_str()
- , getUniformTypeName(un.type)
+ , getUniformTypeName(UniformType::Enum(un.type & ~kUniformMask))
, un.num
, un.regIndex
, un.regCount
@@ -641,10 +652,10 @@ namespace bgfx { namespace spirv
continue;
}
- un.num = 0;
+ un.num = uint8_t(program->getUniformArraySize(ii) );
const uint32_t offset = program->getUniformBufferOffset(ii);
un.regIndex = uint16_t(offset);
- un.regCount = uint16_t(program->getUniformArraySize(ii));
+ un.regCount = un.num;
switch (program->getUniformType(ii) )
{
@@ -766,7 +777,7 @@ namespace bgfx { namespace spirv
un.texDimension = textureDimensionToId(SpirvDimToTextureViewDimension(imageType.dim, imageType.arrayed) );
un.texFormat = uint16_t(s_textureFormats[imageType.format]);
- un.regIndex = binding_index;
+ un.regIndex = uint16_t(binding_index);
un.regCount = 0; // unused
uniforms.push_back(un);
@@ -795,12 +806,14 @@ namespace bgfx { namespace spirv
un.texDimension = textureDimensionToId(SpirvDimToTextureViewDimension(imageType.dim, imageType.arrayed) );
un.texFormat = uint16_t(s_textureFormats[imageType.format]);
- un.regIndex = binding_index;
+ un.regIndex = uint16_t(binding_index);
un.regCount = descriptorTypeToId(DescriptorType::StorageImage);
uniforms.push_back(un);
}
+ bx::Error err;
+
// Loop through the storage buffer, and extract the uniform names:
for (auto& resource : resourcesrefl.storage_buffers)
{
@@ -817,7 +830,7 @@ namespace bgfx { namespace spirv
un.name = name;
un.type = type;
un.num = 0;
- un.regIndex = binding_index;
+ un.regIndex = uint16_t(binding_index);
un.regCount = descriptorTypeToId(DescriptorType::StorageBuffer);
uniforms.push_back(un);
@@ -826,28 +839,28 @@ namespace bgfx { namespace spirv
uint16_t size = writeUniformArray( _writer, uniforms, _options.shaderType == 'f');
uint32_t shaderSize = (uint32_t)spirv.size() * sizeof(uint32_t);
- bx::write(_writer, shaderSize);
- bx::write(_writer, spirv.data(), shaderSize);
+ bx::write(_writer, shaderSize, &err);
+ bx::write(_writer, spirv.data(), shaderSize, &err);
uint8_t nul = 0;
- bx::write(_writer, nul);
+ bx::write(_writer, nul, &err);
const uint8_t numAttr = (uint8_t)program->getNumLiveAttributes();
- bx::write(_writer, numAttr);
+ bx::write(_writer, 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) );
+ bx::write(_writer, bgfx::attribToId(attr), &err);
}
else
{
- bx::write(_writer, uint16_t(UINT16_MAX) );
+ bx::write(_writer, uint16_t(UINT16_MAX), &err);
}
}
- bx::write(_writer, size);
+ bx::write(_writer, size, &err);
}
}
}
diff --git a/3rdparty/bgfx/tools/texturev/common.sh b/3rdparty/bgfx/tools/texturev/common.sh
index cd8cb9f96f5..7f91a6efdce 100644
--- a/3rdparty/bgfx/tools/texturev/common.sh
+++ b/3rdparty/bgfx/tools/texturev/common.sh
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/tools/texturev/fs_texture.sc b/3rdparty/bgfx/tools/texturev/fs_texture.sc
index f8f3d4c4171..c4211343ff0 100644
--- a/3rdparty/bgfx/tools/texturev/fs_texture.sc
+++ b/3rdparty/bgfx/tools/texturev/fs_texture.sc
@@ -1,8 +1,8 @@
$input v_texcoord0, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/tools/texturev/fs_texture_3d.sc b/3rdparty/bgfx/tools/texturev/fs_texture_3d.sc
index f382c187bfd..ae959c49278 100644
--- a/3rdparty/bgfx/tools/texturev/fs_texture_3d.sc
+++ b/3rdparty/bgfx/tools/texturev/fs_texture_3d.sc
@@ -1,8 +1,8 @@
$input v_texcoord0, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/tools/texturev/fs_texture_array.sc b/3rdparty/bgfx/tools/texturev/fs_texture_array.sc
index ead0039d868..94f2be60fcb 100644
--- a/3rdparty/bgfx/tools/texturev/fs_texture_array.sc
+++ b/3rdparty/bgfx/tools/texturev/fs_texture_array.sc
@@ -1,8 +1,8 @@
$input v_texcoord0, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/tools/texturev/fs_texture_cube.sc b/3rdparty/bgfx/tools/texturev/fs_texture_cube.sc
index f4b08ce423e..8bd4fddbea5 100644
--- a/3rdparty/bgfx/tools/texturev/fs_texture_cube.sc
+++ b/3rdparty/bgfx/tools/texturev/fs_texture_cube.sc
@@ -1,8 +1,8 @@
$input v_texcoord0, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/tools/texturev/fs_texture_cube2.sc b/3rdparty/bgfx/tools/texturev/fs_texture_cube2.sc
index da5633291da..6623595fa28 100644
--- a/3rdparty/bgfx/tools/texturev/fs_texture_cube2.sc
+++ b/3rdparty/bgfx/tools/texturev/fs_texture_cube2.sc
@@ -1,8 +1,8 @@
$input v_texcoord0, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/tools/texturev/fs_texture_msdf.sc b/3rdparty/bgfx/tools/texturev/fs_texture_msdf.sc
index 145834d4dab..4adbe3d1974 100644
--- a/3rdparty/bgfx/tools/texturev/fs_texture_msdf.sc
+++ b/3rdparty/bgfx/tools/texturev/fs_texture_msdf.sc
@@ -1,8 +1,8 @@
$input v_texcoord0, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/tools/texturev/fs_texture_sdf.sc b/3rdparty/bgfx/tools/texturev/fs_texture_sdf.sc
index d8444060b4e..4f5aff3bd4b 100644
--- a/3rdparty/bgfx/tools/texturev/fs_texture_sdf.sc
+++ b/3rdparty/bgfx/tools/texturev/fs_texture_sdf.sc
@@ -1,8 +1,8 @@
$input v_texcoord0, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.sh"
diff --git a/3rdparty/bgfx/tools/texturev/makefile b/3rdparty/bgfx/tools/texturev/makefile
index ee5a9f5a7ca..cf80177eab1 100644
--- a/3rdparty/bgfx/tools/texturev/makefile
+++ b/3rdparty/bgfx/tools/texturev/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
#
include ../../scripts/shader-embeded.mk
diff --git a/3rdparty/bgfx/tools/texturev/texturev.cpp b/3rdparty/bgfx/tools/texturev/texturev.cpp
index 1d7c28064f2..5a26388c8a0 100644
--- a/3rdparty/bgfx/tools/texturev/texturev.cpp
+++ b/3rdparty/bgfx/tools/texturev/texturev.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include "common.h"
@@ -800,7 +800,7 @@ struct View
bx::FileReader reader;
if (bx::open(&reader, filePath) )
{
- bx::read(&reader, settings);
+ bx::read(&reader, settings, bx::ErrorAssert{});
bx::close(&reader);
if (!bx::fromString(&m_transitionTime, settings.get("view/transition") ) )
@@ -849,7 +849,7 @@ struct View
bx::FileWriter writer;
if (bx::open(&writer, filePath) )
{
- bx::write(&writer, settings);
+ bx::write(&writer, settings, bx::ErrorAssert{});
bx::close(&writer);
}
}
@@ -1152,6 +1152,21 @@ void keyBindingHelp(const char* _bindings, const char* _description)
ImGui::Text("%s", _description);
}
+inline std::string replaceAll(const char* _str, const char* _from, const char* _to)
+{
+ std::string str = _str;
+ size_t startPos = 0;
+ const size_t fromLen = bx::strLen(_from);
+ const size_t toLen = bx::strLen(_to);
+ while ( (startPos = str.find(_from, startPos) ) != std::string::npos)
+ {
+ str.replace(startPos, fromLen, _to);
+ startPos += toLen;
+ }
+
+ return str;
+}
+
void associate()
{
#if BX_PLATFORM_WINDOWS
@@ -1160,7 +1175,7 @@ void associate()
char exec[bx::kMaxFilePath];
GetModuleFileNameA(GetModuleHandleA(NULL), exec, sizeof(exec) );
- std::string strExec = bx::replaceAll<std::string>(exec, "\\", "\\\\");
+ std::string strExec = replaceAll(exec, "\\", "\\\\");
std::string value;
bx::stringPrintf(value, "@=\"\\\"%s\\\" \\\"%%1\\\"\"\r\n\r\n", strExec.c_str() );
@@ -1248,8 +1263,8 @@ void help(const char* _error = NULL)
bx::printf(
"texturev, bgfx texture viewer tool, version %d.%d.%d.\n"
- "Copyright 2011-2021 Branimir Karadzic. All rights reserved.\n"
- "License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n\n"
+ "Copyright 2011-2022 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
, BGFX_API_VERSION
@@ -1311,11 +1326,13 @@ int _main_(int _argc, char** _argv)
View view;
cmdAdd("view", cmdView, &view);
- entry::setWindowFlags(entry::WindowHandle{0}, ENTRY_WINDOW_FLAG_ASPECT_RATIO, false);
- entry::setWindowSize(entry::WindowHandle{0}, view.m_width, view.m_height);
+ entry::setWindowFlags(entry::kDefaultWindowHandle, ENTRY_WINDOW_FLAG_ASPECT_RATIO, false);
+ entry::setWindowSize(entry::kDefaultWindowHandle, view.m_width, view.m_height);
bgfx::Init init;
init.type = view.m_rendererType;
+ init.platformData.nwh = entry::getNativeWindowHandle(entry::kDefaultWindowHandle);
+ init.platformData.ndt = entry::getNativeDisplayHandle();
init.resolution.width = view.m_width;
init.resolution.height = view.m_height;
init.resolution.reset = BGFX_RESET_VSYNC;
@@ -1861,8 +1878,11 @@ int _main_(int _argc, char** _argv)
{
const int32_t itemCount = int32_t(view.m_fileList.size() );
- int32_t start, end;
- ImGui::CalcListClipping(itemCount, itemHeight, &start, &end);
+ ImGuiListClipper clipper;
+ clipper.Begin(itemCount, itemHeight);
+
+ int32_t start = clipper.DisplayStart;
+ int32_t end = clipper.DisplayEnd;
const int32_t index = int32_t(view.m_fileIndex);
if (index <= start)
@@ -1874,9 +1894,6 @@ int _main_(int _argc, char** _argv)
ImGui::SetScrollY(ImGui::GetScrollY() + (index-end+1)*itemHeight);
}
- ImGuiListClipper clipper;
- clipper.Begin(itemCount, itemHeight);
-
while (clipper.Step() )
{
for (int32_t pos = clipper.DisplayStart; pos < clipper.DisplayEnd; ++pos)
@@ -1912,8 +1929,8 @@ int _main_(int _argc, char** _argv)
ImGui::Text(
"texturev, bgfx texture viewer tool " ICON_KI_WRENCH ", version %d.%d.%d.\n"
- "Copyright 2011-2021 Branimir Karadzic. All rights reserved.\n"
- "License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause\n"
+ "Copyright 2011-2022 Branimir Karadzic. All rights reserved.\n"
+ "License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE\n"
, BGFX_TEXTUREV_VERSION_MAJOR
, BGFX_TEXTUREV_VERSION_MINOR
, BGFX_API_VERSION
@@ -2064,8 +2081,7 @@ int _main_(int _argc, char** _argv)
bx::stringPrintf(title, "Failed to load %s!", filePath);
}
- entry::WindowHandle handle = { 0 };
- entry::setWindowTitle(handle, title.c_str() );
+ entry::setWindowTitle(entry::kDefaultWindowHandle, title.c_str() );
}
int64_t now = bx::getHPCounter();
diff --git a/3rdparty/bgfx/tools/texturev/vs_texture.sc b/3rdparty/bgfx/tools/texturev/vs_texture.sc
index d0469211953..54267951770 100644
--- a/3rdparty/bgfx/tools/texturev/vs_texture.sc
+++ b/3rdparty/bgfx/tools/texturev/vs_texture.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0, a_color0
$output v_texcoord0, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bgfx/tools/texturev/vs_texture_cube.sc b/3rdparty/bgfx/tools/texturev/vs_texture_cube.sc
index 53139ae3811..073c7de47ef 100644
--- a/3rdparty/bgfx/tools/texturev/vs_texture_cube.sc
+++ b/3rdparty/bgfx/tools/texturev/vs_texture_cube.sc
@@ -2,8 +2,8 @@ $input a_position, a_texcoord0, a_color0
$output v_texcoord0, v_color0
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
*/
#include <bgfx_shader.sh>
diff --git a/3rdparty/bimg/3rdparty/astc-codec/.gitignore b/3rdparty/bimg/3rdparty/astc-codec/.gitignore
deleted file mode 100644
index 9e281007644..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/.gitignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bazel-*
-.bazelrc
-build
-.vs
-.vscode
diff --git a/3rdparty/bimg/3rdparty/astc-codec/BUILD.bazel b/3rdparty/bimg/3rdparty/astc-codec/BUILD.bazel
deleted file mode 100644
index ea5a2c41936..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/BUILD.bazel
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2018 Google LLC
-#
-# 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
-#
-# https://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.
-
-licenses(["notice"])
-
-cc_library(
- name = "api",
- hdrs = ["include/astc-codec/astc-codec.h"],
- visibility = ["//src/decoder:__pkg__"],
-)
-
-cc_library(
- name = "astc_codec",
- hdrs = ["include/astc-codec/astc-codec.h"],
- includes = ["include"],
- visibility = ["//visibility:public"],
- deps = ["//src/decoder:codec"],
-)
diff --git a/3rdparty/bimg/3rdparty/astc-codec/CMakeLists.txt b/3rdparty/bimg/3rdparty/astc-codec/CMakeLists.txt
deleted file mode 100644
index 4ecb921b50c..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/CMakeLists.txt
+++ /dev/null
@@ -1,46 +0,0 @@
-# Copyright 2018 Google LLC
-#
-# 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
-#
-# https://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.
-cmake_minimum_required(VERSION 3.1.0)
-project(astc-codec)
-
-option(OPTION_ASTC_TESTS "Build all the unit tests." ON)
-
-# TODO add support for the fuzzer, it has some additional dependencies we are not
-# yet bringing in.
-option(OPTION_BUILD_FUZZER "Build the fuzzer tests." OFF)
-
-set (CMAKE_CXX_STANDARD 11)
-if(OPTION_ASTC_TESTS)
- enable_testing()
-
- # No need to build gmock if an external project defines it.
- if(NOT TARGET gmock_main)
- # We use the approach suggested by https://crascit.com/2015/07/25/cmake-gtest/ to download gtest.
- include(ExternalProject)
- # Download and unpack googletest at configure time
- configure_file(GoogleTest-CMakeLists.txt.in googletest-download/CMakeLists.txt)
- execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
- WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/googletest-download")
- execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/googletest-download")
-
- # Prevent GoogleTest from overriding our compiler/linker options when building with Visual Studio
- set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
-
- # Add googletest directly to our build. This adds the following targets: gtest, gtest_main, gmock and gmock_main
- add_subdirectory("${CMAKE_BINARY_DIR}/googletest-src" "${CMAKE_BINARY_DIR}/googletest-build")
- endif()
-endif()
-
-add_subdirectory(src/base)
-add_subdirectory(src/decoder)
diff --git a/3rdparty/bimg/3rdparty/astc-codec/CONTRIBUTING.md b/3rdparty/bimg/3rdparty/astc-codec/CONTRIBUTING.md
deleted file mode 100644
index 939e5341e74..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/CONTRIBUTING.md
+++ /dev/null
@@ -1,28 +0,0 @@
-# How to Contribute
-
-We'd love to accept your patches and contributions to this project. There are
-just a few small guidelines you need to follow.
-
-## Contributor License Agreement
-
-Contributions to this project must be accompanied by a Contributor License
-Agreement. You (or your employer) retain the copyright to your contribution;
-this simply gives us permission to use and redistribute your contributions as
-part of the project. Head over to <https://cla.developers.google.com/> to see
-your current agreements on file or to sign a new one.
-
-You generally only need to submit a CLA once, so if you've already submitted one
-(even if it was for a different project), you probably don't need to do it
-again.
-
-## Code reviews
-
-All submissions, including submissions by project members, require review. We
-use GitHub pull requests for this purpose. Consult
-[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
-information on using pull requests.
-
-## Community Guidelines
-
-This project follows [Google's Open Source Community
-Guidelines](https://opensource.google.com/conduct/).
diff --git a/3rdparty/bimg/3rdparty/astc-codec/GoogleTest-CMakeLists.txt.in b/3rdparty/bimg/3rdparty/astc-codec/GoogleTest-CMakeLists.txt.in
deleted file mode 100644
index 4451ecba470..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/GoogleTest-CMakeLists.txt.in
+++ /dev/null
@@ -1,15 +0,0 @@
-cmake_minimum_required(VERSION 2.8.2)
-
-project(googletest-download NONE)
-
-include(ExternalProject)
-ExternalProject_Add(googletest
- GIT_REPOSITORY https://github.com/google/googletest.git
- GIT_TAG "release-1.8.1"
- SOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-src"
- BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/googletest-build"
- CONFIGURE_COMMAND ""
- BUILD_COMMAND ""
- INSTALL_COMMAND ""
- TEST_COMMAND ""
-) \ No newline at end of file
diff --git a/3rdparty/bimg/3rdparty/astc-codec/README.md b/3rdparty/bimg/3rdparty/astc-codec/README.md
deleted file mode 100644
index 398de14bb66..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/README.md
+++ /dev/null
@@ -1,71 +0,0 @@
-# astc-codec
-
-astc-codec is a software ASTC decoder implementation, which supports the ASTC
-LDR profile.
-
-Example usage:
-
-```
-#include <astc-codec/astc-codec.h>
-
-// ...
-
-std::vector<uint8_t> astc = LoadMyASTCData();
-const size_t width = 640;
-const size_t height = 480;
-
-std::vector<uint8_t> result;
-result.resize(width * height * 4);
-
-bool success = astc_codec::ASTCDecompressToRGBA(
- astc.data(), astc.size(), width, height, astc_codec::FootprintType::k4x4,
- result.data(), result.size(), /* stride */ width * 4);
-```
-
-## Building
-
-### With bazel
-
-Install [Bazel](https://bazel.build/), and then run:
-
-```
-bazel build :astc_codec -c opt
-```
-
-astc-codec has been tested on Mac and Linux.
-
-### Run Tests
-
-```
-bazel test //...
-```
-
-### With CMake
-
-Install [CMake](https://cmake.org/), and the run:
-
-```
-mkdir build && cd build && cmake .. && make
-```
-
-Or open the project in your favorite IDE and import CMakeLists.txt.
-
-### Run Tests
-
-In the build directory, execute:
-
-```
-ctest
-```
-
-
-## Contributing
-
-See [CONTRIBUTING.md](CONTRIBUTING.md) for important contributing requirements.
-
-## License
-
-astc-codec project is licensed under the Apache License Version 2.0. You can
-find a copy of it in [LICENSE](LICENSE).
-
-This is not an officially supported Google product.
diff --git a/3rdparty/bimg/3rdparty/astc-codec/WORKSPACE b/3rdparty/bimg/3rdparty/astc-codec/WORKSPACE
deleted file mode 100644
index 83fd282a8c0..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/WORKSPACE
+++ /dev/null
@@ -1,37 +0,0 @@
-# Copyright 2018 Google LLC
-#
-# 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
-#
-# https://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.
-
-load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
-load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
-
-git_repository(
- name = "gtest",
- remote = "https://github.com/google/googletest.git",
- commit = "ba96d0b1161f540656efdaed035b3c062b60e006",
-)
-
-http_archive(
- name = "honggfuzz",
- url = "https://github.com/google/honggfuzz/archive/1.7.zip",
- sha256 = "9d420326979fed4a065fa6176d5e09bd513cd2820fe216ae8b684aa6780d72b2",
- build_file = "//third_party:honggfuzz.BUILD",
- strip_prefix = "honggfuzz-1.7",
-)
-
-http_archive(
- name = "benchmark",
- url = "https://github.com/google/benchmark/archive/v1.4.1.zip",
- sha256 = "61ae07eb5d4a0b02753419eb17a82b7d322786bb36ab62bd3df331a4d47c00a7",
- strip_prefix = "benchmark-1.4.1",
-)
diff --git a/3rdparty/bimg/3rdparty/astc-codec/cmake-format.json b/3rdparty/bimg/3rdparty/astc-codec/cmake-format.json
deleted file mode 100644
index de38ed285bc..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/cmake-format.json
+++ /dev/null
@@ -1,38 +0,0 @@
-{
- "line_width": 120,
- "dangle_parens": false,
- "first_comment_is_literal": true,
- "algorithm_order": [
- 0,
- 1,
- 2,
- 3
- ],
- "command_case": "lower",
- "additional_commands": {
- "foo": {
- "flags": [
- "BAR",
- "BAZ"
- ],
- "kwargs": {
- "HEADERS": "*",
- "DEPENDS": "*",
- "SOURCES": "*"
- }
- }
- },
- "separate_fn_name_with_space": false,
- "always_wrap": [],
- "separate_ctrl_name_with_space": false,
- "max_subargs_per_line": 5,
- "fence_pattern": "^\\s*([`~]{3}[`~]*)(.*)$",
- "enable_markup": true,
- "ruler_pattern": "^\\s*[^\\w\\s]{3}.*[^\\w\\s]{3}$",
- "tab_size": 2,
- "keyword_case": "unchanged",
- "enum_char": ".",
- "literal_comment_pattern": null,
- "bullet_char": "*",
- "line_ending": "unix"
-}
diff --git a/3rdparty/bimg/3rdparty/astc-codec/include/astc-codec/astc-codec.h b/3rdparty/bimg/3rdparty/astc-codec/include/astc-codec/astc-codec.h
deleted file mode 100644
index 1d412181365..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/include/astc-codec/astc-codec.h
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_ASTC_CODEC_H_
-#define ASTC_CODEC_ASTC_CODEC_H_
-
-#include <cstddef>
-#include <cstdint>
-
-namespace astc_codec {
-
-// These are the valid ASTC footprints according to the specification in
-// Section C.2.7.
-enum class FootprintType {
- k4x4,
- k5x4,
- k5x5,
- k6x5,
- k6x6,
- k8x5,
- k8x6,
- k10x5,
- k10x6,
- k8x8,
- k10x8,
- k10x10,
- k12x10,
- k12x12,
-
- kCount
-};
-
-// Decompresses ASTC LDR image data to a RGBA32 buffer.
-//
-// Supports formats defined in the KHR_texture_compression_astc_ldr spec and
-// returns UNORM8 values. sRGB is not supported, and should be implemented
-// by the caller.
-//
-// |astc_data| - Compressed ASTC image buffer, must be at least |astc_data_size|
-// bytes long.
-// |astc_data_size| - The size of |astc_data|, in bytes.
-// |width| - Image width, in pixels.
-// |height| - Image height, in pixels.
-// |footprint| - The ASTC footprint (block size) of the compressed image buffer.
-// |out_buffer| - Pointer to a buffer where the decompressed image will be
-// stored, must be at least |out_buffer_size| bytes long.
-// |out_buffer_size| - The size of |out_buffer|, in bytes, at least
-// height*out_buffer_stride. If this is too small, this
-// function will return false and no data will be
-// decompressed.
-// |out_buffer_stride| - The stride that should be used to store rows of the
-// decoded image, must be at least 4*width bytes.
-//
-// Returns true if the decompression succeeded, or false if decompression
-// failed, or if the astc_data_size was too small for the given width, height,
-// and footprint, or if out_buffer_size is too small.
-bool ASTCDecompressToRGBA(const uint8_t* astc_data, size_t astc_data_size,
- size_t width, size_t height, FootprintType footprint,
- uint8_t* out_buffer, size_t out_buffer_size,
- size_t out_buffer_stride);
-
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_ASTC_CODEC_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/.clang-format b/3rdparty/bimg/3rdparty/astc-codec/src/.clang-format
deleted file mode 100644
index 9a00ee252a5..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/.clang-format
+++ /dev/null
@@ -1,4 +0,0 @@
-BasedOnStyle: Google
-AllowShortCaseLabelsOnASingleLine: true
-AllowShortFunctionsOnASingleLine: Inline
-SpaceAfterTemplateKeyword: false
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/BUILD.bazel b/3rdparty/bimg/3rdparty/astc-codec/src/base/BUILD.bazel
deleted file mode 100644
index 84d213138c9..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/BUILD.bazel
+++ /dev/null
@@ -1,49 +0,0 @@
-# Copyright 2018 Google LLC
-#
-# 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
-#
-# https://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.
-
-licenses(["notice"])
-
-cc_library(
- name = "base",
- hdrs = [
- "bit_stream.h",
- "bottom_n.h",
- "math_utils.h",
- "optional.h",
- "string_utils.h",
- "type_traits.h",
- "uint128.h",
- "utils.h",
- ],
- features = ["-parse_headers"],
- visibility = ["//src/decoder:__pkg__"],
-)
-
-cc_test(
- name = "base_test",
- srcs = [
- "test/bit_stream_test.cpp",
- "test/bottom_n_test.cpp",
- "test/math_utils_test.cpp",
- "test/optional_test.cpp",
- "test/string_utils_test.cpp",
- "test/type_traits_test.cpp",
- "test/uint128_test.cpp",
- ],
- deps = [
- "@gtest//:gtest_main",
- ":base",
- ],
-)
-
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/CMakeLists.txt b/3rdparty/bimg/3rdparty/astc-codec/src/base/CMakeLists.txt
deleted file mode 100644
index 5a45f857c44..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/CMakeLists.txt
+++ /dev/null
@@ -1,27 +0,0 @@
-# Copyright 2018 Google LLC
-#
-# 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
-#
-# https://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.
-add_library(base INTERFACE)
-target_include_directories(base INTERFACE ../..)
-
-if(OPTION_ASTC_TESTS)
- add_executable(base_test
- test/bit_stream_test.cpp
- test/bottom_n_test.cpp
- test/math_utils_test.cpp
- test/optional_test.cpp
- test/string_utils_test.cpp
- test/type_traits_test.cpp
- test/uint128_test.cpp)
- target_link_libraries(base_test base gmock_main)
- add_test(NAME base_test COMMAND base_test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
-endif()
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/bit_stream.h b/3rdparty/bimg/3rdparty/astc-codec/src/base/bit_stream.h
deleted file mode 100644
index 2cda0937c8b..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/bit_stream.h
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_BASE_BIT_STREAM_H_
-#define ASTC_CODEC_BASE_BIT_STREAM_H_
-
-#include <cassert>
-#include <cstdint>
-
-namespace astc_codec {
-namespace base {
-
-// Represents a stream of bits that can be read or written in arbitrary-sized
-// chunks.
-template<typename IntType = uint64_t>
-class BitStream {
- public:
- // Creates an empty BitStream.
- BitStream() = default;
- BitStream(IntType data, uint32_t data_size)
- : data_(data), data_size_(data_size) {
- assert(data_size_ <= sizeof(data_) * 8);
- }
-
- // Return the number of bits in the stream.
- uint32_t Bits() const { return data_size_; }
-
- // Put |size| bits into the stream.
- // Fails if there is not enough space in the buffer to store the bits.
- template<typename ResultType>
- void PutBits(ResultType x, uint32_t size) {
- assert(data_size_ + size <= sizeof(data_) * 8);
-
- data_ |= (IntType(x) & MaskFor(size)) << data_size_;
- data_size_ += size;
- }
-
- // Get |count| bits from the stream.
- // Returns true if |count| bits were successfully retrieved.
- template<typename ResultType>
- bool GetBits(uint32_t count, ResultType* result) {
- if (count <= data_size_) {
- *result = static_cast<ResultType>(data_ & MaskFor(count));
- data_ = data_ >> count;
- data_size_ -= count;
- return true;
- } else {
- *result = ResultType();
- return false;
- }
- }
-
- private:
- IntType MaskFor(uint32_t bits) const {
- return (bits == sizeof(IntType) * 8) ? ~IntType(0)
- : (IntType(1) << bits) - 1;
- }
-
- IntType data_ = IntType();
- uint32_t data_size_ = 0;
-};
-
-} // namespace base
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_BASE_BIT_STREAM_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/bottom_n.h b/3rdparty/bimg/3rdparty/astc-codec/src/base/bottom_n.h
deleted file mode 100644
index 4edc8efb850..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/bottom_n.h
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_BASE_BOTTOM_N_H_
-#define ASTC_CODEC_BASE_BOTTOM_N_H_
-
-#include <algorithm>
-#include <functional>
-#include <vector>
-
-namespace astc_codec {
-namespace base {
-
-// Used to aggregate the lowest N values of data supplied.
-template<typename T, typename CompareFn = std::less<T>>
-class BottomN {
- public:
- typedef std::vector<T> ContainerType;
-
- // Creates an empty BottomN with limit |max_size|.
- BottomN(size_t max_size) : max_size_(max_size) { }
-
- bool Empty() const { return data_.empty(); }
- size_t Size() const { return data_.size(); }
-
- const T& Top() const { return data_.front(); }
-
- void Push(const T& value) {
- if (data_.size() < max_size_ || compare_(value, Top())) {
- data_.push_back(value);
- std::push_heap(data_.begin(), data_.end(), compare_);
-
- if (Size() > max_size_) {
- PopTop();
- }
- }
- }
-
- std::vector<T> Pop() {
- const size_t len = Size();
- std::vector<T> result(len);
-
- for (size_t i = 0; i < len; ++i) {
- result[len - i - 1] = PopTop();
- }
-
- return result;
- }
-
- private:
- T PopTop() {
- std::pop_heap(data_.begin(), data_.end(), compare_);
- T result = data_.back();
- data_.pop_back();
- return result;
- }
-
- ContainerType data_;
- CompareFn compare_;
-
- const size_t max_size_;
-};
-
-} // namespace base
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_BASE_BOTTOM_N_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/math_utils.h b/3rdparty/bimg/3rdparty/astc-codec/src/base/math_utils.h
deleted file mode 100644
index 48f1a24c2e5..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/math_utils.h
+++ /dev/null
@@ -1,80 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_BASE_MATH_UTILS_H_
-#define ASTC_CODEC_BASE_MATH_UTILS_H_
-
-#include "src/base/uint128.h"
-
-#include <cassert>
-#include <cstdint>
-#include <type_traits>
-
-namespace astc_codec {
-namespace base {
-
-inline int Log2Floor(uint32_t n) {
- if (n == 0) {
- return -1;
- }
-
- int log = 0;
- uint32_t value = n;
- for (int i = 4; i >= 0; --i) {
- int shift = (1 << i);
- uint32_t x = value >> shift;
- if (x != 0) {
- value = x;
- log += shift;
- }
- }
- assert(value == 1);
- return log;
-}
-
-inline int CountOnes(uint32_t n) {
- n -= ((n >> 1) & 0x55555555);
- n = ((n >> 2) & 0x33333333) + (n & 0x33333333);
- return static_cast<int>((((n + (n >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24);
-}
-
-template<typename T>
-inline T ReverseBits(T value) {
- uint32_t s = sizeof(value) * 8;
- T mask = ~T(0);
- while ((s >>= 1) > 0) {
- mask ^= (mask << s);
- value = ((value >> s) & mask) | ((value << s) & ~mask);
- }
-
- return value;
-}
-
-template<typename T>
-inline T GetBits(T source, uint32_t offset, uint32_t count) {
- static_assert(std::is_same<T, UInt128>::value || std::is_unsigned<T>::value,
- "T must be unsigned.");
-
- const uint32_t total_bits = sizeof(T) * 8;
- assert(count > 0);
- assert(offset + count <= total_bits);
-
- const T mask = count == total_bits ? ~T(0) : ~T(0) >> (total_bits - count);
- return (source >> offset) & mask;
-}
-
-} // namespace base
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_BASE_MATH_UTILS_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/optional.h b/3rdparty/bimg/3rdparty/astc-codec/src/base/optional.h
deleted file mode 100644
index 5ede4af9ef8..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/optional.h
+++ /dev/null
@@ -1,520 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_BASE_OPTIONAL_H_
-#define ASTC_CODEC_BASE_OPTIONAL_H_
-
-#include "src/base/type_traits.h"
-
-#include <cassert>
-#include <initializer_list>
-#include <type_traits>
-#include <utility>
-
-#include <cstddef>
-
-// Optional<T> - a template class to store an optional value of type T.
-//
-// Usage examples:
-//
-// Initialization and construction:
-// Optional<Foo> foo; // |foo| doesn't contain a value.
-// Optional<Foo> foo(Foo(10)); // |foo| contains a copy-constructed value.
-// Optional<Foo> foo2(foo); // |foo2| contains a copy of |foo|'s value.
-// Optional<Foo> foo3(std::move(foo2)); // Guess what?
-//
-// Assignment:
-// Foo foo_value(0);
-// Optional<Foo> foo; // |foo| is empty.
-// Optional<Foo> foo2; // |foo2| is empty.
-// foo2 = foo; // |foo2| is still empty.
-// foo = foo_value; // set value of |foo| to a copy of |foo_value|
-// foo = std::move(foo_value); // move |foo_value| into |foo|.
-// foo2 = foo; // now |foo2| has a copy of |foo|'s value.
-// foo = kNullopt; // unset |foo|, it has no value.
-//
-// Checking and accessing value:
-// if (foo) {
-// // |foo| has a value.
-// doStuff(*foo); // |*foo| is the value inside |foo|.
-// foo->callMethod(); // Same as (*foo).callMethod().
-// } else {
-// // |foo| is empty.
-// }
-//
-// foo.value() // Same as *foo
-// foo.valueOr(<default>) // Return <default> is |foo| has no value.
-//
-// In-place construction:
-//
-// Optional<Foo> foo; // |foo| is empty.
-// foo.emplace(20); // |foo| now contains a value constructed as Foo(20)
-//
-// Optional<Foo> foo(kInplace, 20); // |foo| is initialized with a value
-// // that is constructed in-place as
-// // Foo(20).
-//
-// return makeOptional<Foo>(20); // Takes Foo constructor arguments
-// // directly.
-//
-// Returning values:
-//
-// Optional<Foo> myFunc(...) {
-// if (someCondition) {
-// return Foo(10); // call Optional<Foo>(Foo&) constructor.
-// } else {
-// return {}; // call Optional<Foo>() constructor, which
-// // builds an empty value.
-// }
-// }
-//
-// Memory layout:
-// Optional<Foo> is equivalent to:
-//
-// struct {
-// bool flag;
-// Foo value;
-// };
-//
-// in terms of memory layout. This means it *doubles* the size of integral
-// types. Also:
-//
-// - Optional<Foo> can be constructed from anything that constructs a Foo.
-//
-// - Same with Optional<Foo>(kInplace, Args...) where Args... matches any
-// arguments that can be passed to a Foo constructor.
-//
-// - Comparison operators are provided. Beware: an empty Optional<Foo>
-// is always smaller than any Foo value.
-
-namespace astc_codec {
-namespace base {
-
-namespace details {
-
-// Base classes to reduce the number of instantiations of the Optional's
-// internal members.
-class OptionalFlagBase {
- public:
- void setConstructed(bool constructed) { mConstructed = constructed; }
- constexpr bool constructed() const { return mConstructed; }
- constexpr operator bool() const { return constructed(); }
- bool hasValue() const { return constructed(); }
-
- constexpr OptionalFlagBase(bool constructed = false)
- : mConstructed(constructed) { }
-
- private:
- bool mConstructed = false;
-};
-
-template<size_t Size, size_t Align>
-class OptionalStorageBase {
- protected:
- using StoreT = typename std::aligned_storage<Size, Align>::type;
- StoreT mStorage = {};
-};
-
-} // namespace details
-
-// A tag type for empty optional construction
-struct NulloptT {
- constexpr explicit NulloptT(int) { }
-};
-
-// A tag type for inplace value construction
-struct InplaceT {
- constexpr explicit InplaceT(int) { }
-};
-
-// Tag values for null optional and inplace construction
-constexpr NulloptT kNullopt{1};
-constexpr InplaceT kInplace{1};
-
-// Forward declaration for an early use
-template<class T>
-class Optional;
-
-// A type trait for checking if a type is an optional instantiation
-// Note: if you want to refer to the template name inside the template,
-// you need to declare this alias outside of it - because the
-// class name inside of the template stands for an instantiated template
-// E.g, for template <T> class Foo if you say 'Foo' inside the class, it
-// actually means Foo<T>;
-template<class U>
-using is_any_optional =
- is_template_instantiation_of<typename std::decay<U>::type, Optional>;
-
-template<class T>
-class Optional
- : private details::OptionalFlagBase,
- private details::OptionalStorageBase<sizeof(T),
- std::alignment_of<T>::value> {
- // make sure all optionals are buddies - this is needed to implement
- // conversion from optionals of other types
- template<class U>
- friend class Optional;
-
- template<class U>
- using self = Optional<U>;
-
- using base_flag = details::OptionalFlagBase;
- using base_storage =
- details::OptionalStorageBase<sizeof(T), std::alignment_of<T>::value>;
-
- public:
- // std::optional will have this, so let's provide it
- using value_type = T;
-
- // make sure we forbid some Optional instantiations where things may get
- // really messy
- static_assert(!std::is_same<typename std::decay<T>::type, NulloptT>::value,
- "Optional of NulloptT is not allowed");
- static_assert(!std::is_same<typename std::decay<T>::type, InplaceT>::value,
- "Optional of InplaceT is not allowed");
- static_assert(!std::is_reference<T>::value,
- "Optional references are not allowed: use a pointer instead");
-
- // constructors
- constexpr Optional() { }
- constexpr Optional(NulloptT) { }
-
- Optional(const Optional& other) : base_flag(other.constructed()) {
- if (this->constructed()) {
- new (&get()) T(other.get());
- }
- }
- Optional(Optional&& other) : base_flag(other.constructed()) {
- if (this->constructed()) {
- new (&get()) T(std::move(other.get()));
- }
- }
-
- // Conversion constructor from optional of similar type
- template<class U, class = enable_if_c<!is_any_optional<U>::value &&
- std::is_constructible<T, U>::value>>
- Optional(const Optional<U>& other) : base_flag(other.constructed()) {
- if (this->constructed()) {
- new (&get()) T(other.get());
- }
- }
-
- // Move-conversion constructor
- template<class U, class = enable_if_c<!is_any_optional<U>::value &&
- std::is_constructible<T, U>::value>>
- Optional(Optional<U>&& other) : base_flag(other.constructed()) {
- if (this->constructed()) {
- new (&get()) T(std::move(other.get()));
- }
- }
-
- // Construction from a raw value
- Optional(const T& value) : base_flag(true) { new (&get()) T(value); }
- // Move construction from a raw value
- Optional(T&& value) : base_flag(true) { new (&get()) T(std::move(value)); }
-
- // Inplace construction from a list of |T|'s ctor arguments
- template<class... Args>
- Optional(InplaceT, Args&&... args) : base_flag(true) {
- new (&get()) T(std::forward<Args>(args)...);
- }
-
- // Inplace construction from an initializer list passed into |T|'s ctor
- template<class U, class = enable_if<
- std::is_constructible<T, std::initializer_list<U>>>>
- Optional(InplaceT, std::initializer_list<U> il) : base_flag(true) {
- new (&get()) T(il);
- }
-
- // direct assignment
- Optional& operator=(const Optional& other) {
- if (&other == this) {
- return *this;
- }
-
- if (this->constructed()) {
- if (other.constructed()) {
- get() = other.get();
- } else {
- destruct();
- this->setConstructed(false);
- }
- } else {
- if (other.constructed()) {
- new (&get()) T(other.get());
- this->setConstructed(true);
- } else {
- ; // we're good
- }
- }
- return *this;
- }
-
- // move assignment
- Optional& operator=(Optional&& other) {
- if (this->constructed()) {
- if (other.constructed()) {
- get() = std::move(other.get());
- } else {
- destruct();
- this->setConstructed(false);
- }
- } else {
- if (other.constructed()) {
- new (&get()) T(std::move(other.get()));
- this->setConstructed(true);
- } else {
- ; // we're good
- }
- }
- return *this;
- }
-
- // conversion assignment
- template<class U,
- class = enable_if_convertible<typename std::decay<U>::type, T>>
- Optional& operator=(const Optional<U>& other) {
- if (this->constructed()) {
- if (other.constructed()) {
- get() = other.get();
- } else {
- destruct();
- this->setConstructed(false);
- }
- } else {
- if (other.constructed()) {
- new (&get()) T(other.get());
- this->setConstructed(true);
- } else {
- ; // we're good
- }
- }
- return *this;
- }
-
- // conversion move assignment
- template<class U,
- class = enable_if_convertible<typename std::decay<U>::type, T>>
- Optional& operator=(Optional<U>&& other) {
- if (this->constructed()) {
- if (other.constructed()) {
- get() = std::move(other.get());
- } else {
- destruct();
- this->setConstructed(false);
- }
- } else {
- if (other.constructed()) {
- new (&get()) T(std::move(other.get()));
- this->setConstructed(true);
- } else {
- ; // we're good
- }
- }
- return *this;
- }
-
- // the most complicated one: forwarding constructor for anything convertible
- // to |T|, excluding the stuff implemented above explicitly
- template<class U,
- class = enable_if_c<
- !is_any_optional<typename std::decay<U>::type>::value &&
- std::is_convertible<typename std::decay<U>::type, T>::value>>
- Optional& operator=(U&& other) {
- if (this->constructed()) {
- get() = std::forward<U>(other);
- } else {
- new (&get()) T(std::forward<U>(other));
- this->setConstructed(true);
- }
- return *this;
- }
-
- // Adopt value checkers from the parent
- using base_flag::operator bool;
- using base_flag::hasValue;
-
- T& value() {
- assert(this->constructed());
- return get();
- }
- constexpr const T& value() const {
- assert(this->constructed());
- return get();
- }
-
- T* ptr() { return this->constructed() ? &get() : nullptr; }
- constexpr const T* ptr() const {
- return this->constructed() ? &get() : nullptr;
- }
-
- // Value getter with fallback
- template<class U = T,
- class = enable_if_convertible<typename std::decay<U>::type, T>>
- constexpr T valueOr(U&& defaultValue) const {
- return this->constructed() ? get() : std::move(defaultValue);
- }
-
- // Pointer-like operators
- T& operator*() {
- assert(this->constructed());
- return get();
- }
- constexpr const T& operator*() const {
- assert(this->constructed());
- return get();
- }
-
- T* operator->() {
- assert(this->constructed());
- return &get();
- }
- constexpr const T* operator->() const {
- assert(this->constructed());
- return &get();
- }
-
- ~Optional() {
- if (this->constructed()) {
- destruct();
- }
- }
-
- void clear() {
- if (this->constructed()) {
- destruct();
- this->setConstructed(false);
- }
- }
-
- template<class U,
- class = enable_if_convertible<typename std::decay<U>::type, T>>
- void reset(U&& u) {
- *this = std::forward<U>(u);
- }
-
- // In-place construction with possible destruction of the old value
- template<class... Args>
- void emplace(Args&&... args) {
- if (this->constructed()) {
- destruct();
- }
- new (&get()) T(std::forward<Args>(args)...);
- this->setConstructed(true);
- }
-
- // In-place construction with possible destruction of the old value
- // initializer-list version
- template<class U, class = enable_if<
- std::is_constructible<T, std::initializer_list<U>>>>
- void emplace(std::initializer_list<U> il) {
- if (this->constructed()) {
- destruct();
- }
- new (&get()) T(il);
- this->setConstructed(true);
- }
-
- private:
- // A helper function to convert the internal raw storage to T&
- constexpr const T& get() const {
- return *reinterpret_cast<const T*>(
- reinterpret_cast<const char*>(&this->mStorage));
- }
-
- // Same thing, mutable
- T& get() { return const_cast<T&>(const_cast<const Optional*>(this)->get()); }
-
- // Shortcut for a destructor call for the stored object
- void destruct() { get().T::~T(); }
-};
-
-template<class T>
-Optional<typename std::decay<T>::type> makeOptional(T&& t) {
- return Optional<typename std::decay<T>::type>(std::forward<T>(t));
-}
-
-template<class T, class... Args>
-Optional<typename std::decay<T>::type> makeOptional(Args&&... args) {
- return Optional<typename std::decay<T>::type>(kInplace,
- std::forward<Args>(args)...);
-}
-
-template<class T>
-bool operator==(const Optional<T>& l, const Optional<T>& r) {
- return l.hasValue() ? r.hasValue() && *l == *r : !r.hasValue();
-}
-template<class T>
-bool operator==(const Optional<T>& l, NulloptT) {
- return !l;
-}
-template<class T>
-bool operator==(NulloptT, const Optional<T>& r) {
- return !r;
-}
-template<class T>
-bool operator==(const Optional<T>& l, const T& r) {
- return bool(l) && *l == r;
-}
-template<class T>
-bool operator==(const T& l, const Optional<T>& r) {
- return bool(r) && l == *r;
-}
-
-template<class T>
-bool operator!=(const Optional<T>& l, const Optional<T>& r) {
- return !(l == r);
-}
-template<class T>
-bool operator!=(const Optional<T>& l, NulloptT) {
- return bool(l);
-}
-template<class T>
-bool operator!=(NulloptT, const Optional<T>& r) {
- return bool(r);
-}
-template<class T>
-bool operator!=(const Optional<T>& l, const T& r) {
- return !l || !(*l == r);
-}
-template<class T>
-bool operator!=(const T& l, const Optional<T>& r) {
- return !r || !(l == *r);
-}
-
-template<class T>
-bool operator<(const Optional<T>& l, const Optional<T>& r) {
- return !r ? false : (!l ? true : *l < *r);
-}
-template<class T>
-bool operator<(const Optional<T>&, NulloptT) {
- return false;
-}
-template<class T>
-bool operator<(NulloptT, const Optional<T>& r) {
- return bool(r);
-}
-template<class T>
-bool operator<(const Optional<T>& l, const T& r) {
- return !l || *l < r;
-}
-template<class T>
-bool operator<(const T& l, const Optional<T>& r) {
- return bool(r) && l < *r;
-}
-
-} // namespace base
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_BASE_OPTIONAL_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/string_utils.h b/3rdparty/bimg/3rdparty/astc-codec/src/base/string_utils.h
deleted file mode 100644
index 20fd6b85739..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/string_utils.h
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_BASE_STRING_UTILS_H_
-#define ASTC_CODEC_BASE_STRING_UTILS_H_
-
-#include <limits>
-#include <string>
-#include <stdlib.h>
-
-namespace astc_codec {
-namespace base {
-
-// Iterates over a string's parts using |splitBy| as a delimiter.
-// |splitBy| must be a nonempty string well, or it's a no-op.
-// Otherwise, |func| is called on each of the splits, excluding the
-// characters that are part of |splitBy|. If two |splitBy|'s occur in a row,
-// |func| will be called on a StringView("") in between. See
-// StringUtils_unittest.cpp for the full story.
-template<class Func>
-void Split(const std::string& str, const std::string& splitBy, Func func) {
- if (splitBy.empty()) {
- return;
- }
-
- size_t splitSize = splitBy.size();
- size_t begin = 0;
- size_t end = str.find(splitBy);
-
- while (true) {
- func(str.substr(begin, end - begin));
- if (end == std::string::npos) {
- return;
- }
-
- begin = end + splitSize;
- end = str.find(splitBy, begin);
- }
-}
-
-static int32_t ParseInt32(const char* str, int32_t deflt) {
- using std::numeric_limits;
-
- char* error = nullptr;
- int64_t value = strtol(str, &error, 0);
- // Limit long values to int32 min/max. Needed for lp64; no-op on 32 bits.
- if (value > std::numeric_limits<int32_t>::max()) {
- value = std::numeric_limits<int32_t>::max();
- } else if (value < std::numeric_limits<int32_t>::min()) {
- value = std::numeric_limits<int32_t>::min();
- }
- return (error == str) ? deflt : static_cast<int32_t>(value);
-}
-
-} // namespace base
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_BASE_STRING_UTILS_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/bit_stream_test.cpp b/3rdparty/bimg/3rdparty/astc-codec/src/base/test/bit_stream_test.cpp
deleted file mode 100644
index 0c4b3c945f8..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/bit_stream_test.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/base/bit_stream.h"
-
-#include <gtest/gtest.h>
-
-namespace astc_codec {
-namespace base {
-
-namespace {
- static constexpr uint64_t kAllBits = 0xFFFFFFFFFFFFFFFF;
- static constexpr uint64_t k40Bits = 0x000000FFFFFFFFFF;
-}
-
-TEST(BitStream, Decode) {
- {
- BitStream<uint64_t> stream(0, 1);
-
- uint64_t bits = kAllBits;
- EXPECT_TRUE(stream.GetBits(1, &bits));
- EXPECT_EQ(bits, 0);
- EXPECT_FALSE(stream.GetBits(1, &bits));
- }
-
- {
- BitStream<uint64_t> stream(0b1010101010101010, 32);
- EXPECT_EQ(stream.Bits(), 32);
-
- uint64_t bits = 0;
- EXPECT_TRUE(stream.GetBits(1, &bits));
- EXPECT_EQ(bits, 0);
-
- EXPECT_TRUE(stream.GetBits(3, &bits));
- EXPECT_EQ(bits, 0b101);
-
- EXPECT_TRUE(stream.GetBits(8, &bits));
- EXPECT_EQ(bits, 0b10101010);
-
- EXPECT_EQ(stream.Bits(), 20);
-
- EXPECT_TRUE(stream.GetBits(20, &bits));
- EXPECT_EQ(bits, 0b1010);
- EXPECT_EQ(stream.Bits(), 0);
- }
-
- {
- BitStream<uint64_t> stream(kAllBits, 64);
- EXPECT_EQ(stream.Bits(), 64);
-
- uint64_t bits = 0;
- EXPECT_TRUE(stream.GetBits(64, &bits));
- EXPECT_EQ(bits, kAllBits);
- EXPECT_EQ(stream.Bits(), 0);
- }
-
- {
- BitStream<uint64_t> stream(kAllBits, 64);
- EXPECT_EQ(stream.Bits(), 64);
-
- uint64_t bits = 0;
- EXPECT_TRUE(stream.GetBits(40, &bits));
- EXPECT_EQ(bits, k40Bits);
- EXPECT_EQ(stream.Bits(), 24);
- }
-
- {
- BitStream<uint64_t> stream(kAllBits, 32);
-
- uint64_t bits = 0;
- EXPECT_TRUE(stream.GetBits(0, &bits));
- EXPECT_EQ(bits, 0);
- EXPECT_TRUE(stream.GetBits(32, &bits));
- EXPECT_EQ(bits, k40Bits & 0xFFFFFFFF);
- EXPECT_TRUE(stream.GetBits(0, &bits));
- EXPECT_EQ(bits, 0);
- EXPECT_EQ(stream.Bits(), 0);
- }
-}
-
-TEST(BitStream, Encode) {
- {
- BitStream<uint64_t> stream;
-
- stream.PutBits(0, 1);
- stream.PutBits(0b11, 2);
- EXPECT_EQ(stream.Bits(), 3);
-
- uint64_t bits = 0;
- EXPECT_TRUE(stream.GetBits(3, &bits));
- EXPECT_EQ(bits, 0b110);
- }
-
- {
- BitStream<uint64_t> stream;
-
- uint64_t bits = 0;
- stream.PutBits(kAllBits, 64);
- EXPECT_EQ(stream.Bits(), 64);
-
- EXPECT_TRUE(stream.GetBits(64, &bits));
- EXPECT_EQ(bits, kAllBits);
- EXPECT_EQ(stream.Bits(), 0);
- }
-
- {
- BitStream<uint64_t> stream;
- stream.PutBits(kAllBits, 40);
-
- uint64_t bits = 0;
- EXPECT_TRUE(stream.GetBits(40, &bits));
- EXPECT_EQ(bits, k40Bits);
- EXPECT_EQ(stream.Bits(), 0);
- }
-
- {
- BitStream<uint64_t> stream;
- stream.PutBits(0, 0);
- stream.PutBits(kAllBits, 32);
- stream.PutBits(0, 0);
-
- uint64_t bits = 0;
- EXPECT_TRUE(stream.GetBits(32, &bits));
- EXPECT_EQ(bits, k40Bits & 0xFFFFFFFF);
- EXPECT_EQ(stream.Bits(), 0);
- }
-}
-
-} // namespace base
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/bottom_n_test.cpp b/3rdparty/bimg/3rdparty/astc-codec/src/base/test/bottom_n_test.cpp
deleted file mode 100644
index 71265d756bf..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/bottom_n_test.cpp
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/base/bottom_n.h"
-
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-namespace astc_codec {
-namespace base {
-
-using ::testing::ElementsAre;
-
-template<typename T, size_t N>
-static void pushAll(BottomN<T>& heap, const T (&arr)[N]) {
- for (auto i : arr) {
- heap.Push(i);
- }
-}
-
-TEST(BottomN, Sort) {
- {
- BottomN<int> heap(10);
- EXPECT_TRUE(heap.Empty());
- int list[] = { 1,2 };
- pushAll(heap, list);
-
- EXPECT_EQ(heap.Size(), 2);
- EXPECT_FALSE(heap.Empty());
- EXPECT_THAT(heap.Pop(), ElementsAre(1, 2));
- }
-
- {
- BottomN<int> heap(6);
- int list[] = {1, 4, 3, 2, 2, 1};
- pushAll(heap, list);
-
- EXPECT_EQ(heap.Size(), 6);
- EXPECT_THAT(heap.Pop(), ElementsAre(1, 1, 2, 2, 3, 4));
- }
-}
-
-TEST(BottomN, Bounds) {
- {
- BottomN<int> heap(4);
- int list[] = { 1, 2, 3, 4 };
- pushAll(heap, list);
- EXPECT_EQ(heap.Size(), 4);
-
- heap.Push(0);
- EXPECT_EQ(heap.Size(), 4);
-
- EXPECT_THAT(heap.Pop(), ElementsAre(0, 1, 2, 3));
- }
-
- {
- BottomN<int> heap(4);
- int list[] = { 4, 3, 2,1 };
- pushAll(heap, list);
- EXPECT_EQ(heap.Size(), 4);
-
- int list2[] = { 4,4,4,4 };
- pushAll(heap, list2);
- EXPECT_EQ(heap.Size(), 4);
-
- EXPECT_THAT(heap.Pop(), ElementsAre(1, 2, 3, 4));
- }
-
- {
- BottomN<int> heap(4);
- int list[] = { 4, 3, 2, 1 };
- pushAll(heap, list);
- EXPECT_EQ(heap.Size(), 4);
-
- int list2[] = { 5, 5, 5, 5 };
- pushAll(heap, list2);
- EXPECT_EQ(heap.Size(), 4);
-
- EXPECT_THAT(heap.Pop(), ElementsAre(1, 2, 3, 4));
- }
-
- {
- BottomN<int> heap(4);
- int list[] = { 4, 3, 2, 1 };
- pushAll(heap, list);
- EXPECT_EQ(heap.Size(), 4);
-
- int list2[] = { 0, 0, 0, 0 };
- pushAll(heap, list2);
- EXPECT_EQ(heap.Size(), 4);
-
- EXPECT_THAT(heap.Pop(), ElementsAre(0, 0, 0, 0));
- }
-}
-
-} // namespace base
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/math_utils_test.cpp b/3rdparty/bimg/3rdparty/astc-codec/src/base/test/math_utils_test.cpp
deleted file mode 100644
index 0371e1184d3..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/math_utils_test.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/base/math_utils.h"
-
-#include <gtest/gtest.h>
-
-namespace astc_codec {
-namespace base {
-
-TEST(MathUtils, Log2Floor) {
- EXPECT_EQ(-1, Log2Floor(0));
-
- for (int i = 0; i < 32; i++) {
- uint32_t n = 1U << i;
- EXPECT_EQ(i, Log2Floor(n));
- if (n > 2) {
- EXPECT_EQ(i - 1, Log2Floor(n - 1));
- EXPECT_EQ(i, Log2Floor(n + 1));
- }
- }
-}
-
-TEST(MathUtils, CountOnes) {
- EXPECT_EQ(0, CountOnes(0));
- EXPECT_EQ(1, CountOnes(1));
- EXPECT_EQ(32, CountOnes(static_cast<uint32_t>(~0U)));
- EXPECT_EQ(1, CountOnes(0x8000000));
-
- for (int i = 0; i < 32; i++) {
- EXPECT_EQ(1, CountOnes(1U << i));
- EXPECT_EQ(31, CountOnes(static_cast<uint32_t>(~0U) ^ (1U << i)));
- }
-}
-
-TEST(MathUtils, ReverseBits) {
- EXPECT_EQ(ReverseBits(0u), 0u);
- EXPECT_EQ(ReverseBits(1u), 1u << 31);
- EXPECT_EQ(ReverseBits(0xffffffff), 0xffffffff);
- EXPECT_EQ(ReverseBits(0x00000001), 0x80000000);
- EXPECT_EQ(ReverseBits(0x80000000), 0x00000001);
- EXPECT_EQ(ReverseBits(0xaaaaaaaa), 0x55555555);
- EXPECT_EQ(ReverseBits(0x55555555), 0xaaaaaaaa);
- EXPECT_EQ(ReverseBits(0x7d5d7f53), 0xcafebabe);
- EXPECT_EQ(ReverseBits(0xcafebabe), 0x7d5d7f53);
-}
-
-TEST(MathUtils, GetBits) {
- EXPECT_EQ(GetBits(0u, 0, 1), 0u);
- EXPECT_EQ(GetBits(0u, 0, 32), 0u);
- EXPECT_EQ(GetBits(0x00000001u, 0, 1), 0x00000001);
- EXPECT_EQ(GetBits(0x00000001u, 0, 32), 0x00000001);
- EXPECT_EQ(GetBits(0x00000001u, 1, 31), 0x00000000);
- EXPECT_EQ(GetBits(0x00000001u, 31, 1), 0x00000000);
-
- EXPECT_DEBUG_DEATH(GetBits(0x00000000u, 1, 32), "");
- EXPECT_DEBUG_DEATH(GetBits(0x00000000u, 32, 0), "");
- EXPECT_DEBUG_DEATH(GetBits(0x00000000u, 32, 1), "");
-
- EXPECT_EQ(GetBits(0XFFFFFFFFu, 0, 4), 0x0000000F);
- EXPECT_EQ(GetBits(0XFFFFFFFFu, 16, 16), 0xFFFF);
- EXPECT_EQ(GetBits(0x80000000u, 31, 1), 1);
- EXPECT_EQ(GetBits(0xCAFEBABEu, 24, 8), 0xCA);
-}
-
-} // namespace base
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/optional_test.cpp b/3rdparty/bimg/3rdparty/astc-codec/src/base/test/optional_test.cpp
deleted file mode 100644
index 1eeefbdf48d..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/optional_test.cpp
+++ /dev/null
@@ -1,481 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/base/optional.h"
-
-#include <gtest/gtest.h>
-
-#include <memory>
-#include <vector>
-
-namespace astc_codec {
-namespace base {
-
-TEST(Optional, TypeProperties) {
- // Making sure optional has the correct alignment and doesn't waste too much
- // space
-
- static_assert(sizeof(Optional<bool>) == 2, "bad Optional<bool> size");
- static_assert(std::alignment_of<Optional<bool>>::value ==
- std::alignment_of<bool>::value,
- "bad Optional<bool> alignment");
-
- static_assert(sizeof(Optional<char>) == 2, "bad Optional<char> size");
- static_assert(std::alignment_of<Optional<char>>::value ==
- std::alignment_of<char>::value,
- "bad Optional<char> alignment");
-
- static_assert(sizeof(Optional<int16_t>) == 4, "bad Optional<int16_t> size");
- static_assert(std::alignment_of<Optional<int16_t>>::value ==
- std::alignment_of<int16_t>::value,
- "bad Optional<int16_t> alignment");
-
- static_assert(sizeof(Optional<int32_t>) == 8, "bad Optional<int32_t> size");
- static_assert(std::alignment_of<Optional<int32_t>>::value ==
- std::alignment_of<int32_t>::value,
- "bad Optional<int32_t> alignment");
-
- static_assert(sizeof(Optional<int64_t>) == 16, "bad Optional<int64_t> size");
- static_assert(std::alignment_of<Optional<int64_t>>::value ==
- std::alignment_of<int64_t>::value,
- "bad Optional<int64_t> alignment");
-
- struct S128 {
- int64_t data[2];
- };
-
- static_assert(sizeof(Optional<S128>) == 3 * sizeof(int64_t),
- "bad Optional<S128> size");
- static_assert(std::alignment_of<Optional<S128>>::value ==
- std::alignment_of<S128>::value,
- "bad Optional<S128> alignment");
-}
-
-TEST(Optional, ConstructFromValue) {
- {
- Optional<int> o;
- EXPECT_FALSE(o);
- }
- {
- Optional<int> o = {};
- EXPECT_FALSE(o);
- }
- {
- Optional<int> o = kNullopt;
- EXPECT_FALSE(o);
- }
- {
- Optional<int> o(1);
- EXPECT_TRUE(o);
- EXPECT_EQ(1, *o);
- }
- {
- // check the std::decay<> constructor
- Optional<int> o = static_cast<const short&>(1);
- EXPECT_TRUE(o);
- EXPECT_EQ(1, *o);
- }
- {
- Optional<int> o = 1;
- EXPECT_TRUE(o);
- EXPECT_EQ(1, *o);
- }
- {
- Optional<int> o{1};
- EXPECT_TRUE(o);
- EXPECT_EQ(1, *o);
- }
- {
- short val = 10;
- Optional<int> o = val;
- EXPECT_TRUE(o);
- EXPECT_EQ(10, *o);
- }
- {
- Optional<std::vector<int>> o(kInplace, 10);
- EXPECT_TRUE(o);
- EXPECT_EQ((std::vector<int>(10)), *o);
- }
- {
- Optional<std::vector<int>> o(kInplace, {1, 2, 3, 4});
- EXPECT_TRUE(o);
- EXPECT_EQ((std::vector<int>{1, 2, 3, 4}), *o);
- }
-}
-
-TEST(Optional, ConstructFromOptional) {
- {
- Optional<int> o = Optional<int>();
- EXPECT_FALSE(o);
- }
- {
- Optional<short> o2;
- Optional<int> o(o2);
- EXPECT_FALSE(o);
- }
- {
- Optional<short> o2 = 42;
- Optional<int> o(o2);
- EXPECT_TRUE(o);
- EXPECT_EQ(42, *o);
- }
- {
- Optional<int> o(Optional<int>(1));
- EXPECT_TRUE(o);
- EXPECT_EQ(1, *o);
- }
- {
- Optional<int> o2 = 2;
- Optional<int> o = o2;
- EXPECT_TRUE(o);
- EXPECT_EQ(2, *o);
- }
- {
- Optional<std::vector<int>> o2 = std::vector<int>{20, 30, 40};
- Optional<std::vector<int>> o = o2;
- EXPECT_TRUE(o);
- EXPECT_EQ((std::vector<int>{20, 30, 40}), *o);
- }
-}
-
-TEST(Optional, Assign) {
- {
- Optional<int> o;
- o = 1;
- EXPECT_TRUE(o);
- EXPECT_EQ(1, *o);
-
- o = 2;
- EXPECT_TRUE(o);
- EXPECT_EQ(2, *o);
-
- o = kNullopt;
- EXPECT_FALSE(o);
-
- o = Optional<int>(10);
- EXPECT_TRUE(o);
- EXPECT_EQ(10, *o);
-
- Optional<int> o2;
- o = o2;
- EXPECT_FALSE(o);
-
- o = 2u;
- EXPECT_TRUE(o);
- EXPECT_EQ(2, *o);
-
- o = Optional<short>();
- EXPECT_FALSE(o);
-
- o = Optional<short>(20);
- EXPECT_TRUE(o);
- EXPECT_EQ(20, *o);
-
- Optional<short> o3(200);
- o = o3;
- EXPECT_TRUE(o);
- EXPECT_EQ(200, *o);
-
- o = {};
- EXPECT_FALSE(o);
-
- // check the std::decay<> assignment
- o = static_cast<const short&>(1);
- EXPECT_TRUE(o);
- EXPECT_EQ(1, *o);
- }
-}
-
-TEST(Optional, MakeOptional) {
- {
- auto o = makeOptional(1);
- static_assert(std::is_same<decltype(o), Optional<int>>::value,
- "Bad type deduction in makeOptional()");
- EXPECT_TRUE(o);
- EXPECT_EQ(1, *o);
- }
- {
- auto o = makeOptional(std::vector<char>{'1', '2'});
- static_assert(std::is_same<decltype(o), Optional<std::vector<char>>>::value,
- "Bad type deduction in makeOptional()");
- EXPECT_TRUE(o);
- EXPECT_EQ((std::vector<char>{'1', '2'}), *o);
- }
- {
- // check std::decay<> in the factory function
- auto o = makeOptional("String");
- static_assert(std::is_same<decltype(o), Optional<const char*>>::value,
- "Bad type deduction in makeOptional()");
- EXPECT_TRUE(o);
- EXPECT_STREQ("String", *o);
- }
- {
- auto o = makeOptional<std::string>("String");
- static_assert(std::is_same<decltype(o), Optional<std::string>>::value,
- "Bad type deduction in makeOptional()");
- EXPECT_TRUE(o);
- EXPECT_STREQ("String", o->c_str());
- }
- {
- auto o = makeOptional<std::string>(5, 'b');
- static_assert(std::is_same<decltype(o), Optional<std::string>>::value,
- "Bad type deduction in makeOptional()");
- EXPECT_TRUE(o);
- EXPECT_STREQ("bbbbb", o->c_str());
- }
- {
- auto o = makeOptional<std::string>();
- static_assert(std::is_same<decltype(o), Optional<std::string>>::value,
- "Bad type deduction in makeOptional()");
- EXPECT_TRUE(o);
- EXPECT_STREQ("", o->c_str());
- }
-}
-
-TEST(Optional, Move) {
- auto o = makeOptional(std::unique_ptr<int>(new int(10)));
- {
- decltype(o) o2 = std::move(o);
- EXPECT_TRUE(o);
- EXPECT_TRUE(o2);
- EXPECT_FALSE(bool(*o));
- EXPECT_TRUE(bool(*o2));
- EXPECT_EQ(10, **o2);
-
- decltype(o) o3;
- o3 = std::move(o2);
- EXPECT_TRUE(o2);
- EXPECT_TRUE(o3);
- EXPECT_FALSE(bool(*o2));
- EXPECT_TRUE(bool(*o3));
- EXPECT_EQ(10, **o3);
-
- o3 = std::move(o2);
- EXPECT_TRUE(o2);
- EXPECT_TRUE(o3);
- EXPECT_FALSE(bool(*o2));
- EXPECT_FALSE(bool(*o3));
- }
-
- {
- decltype(o) o1;
- decltype(o) o2 = std::move(o1);
- EXPECT_FALSE(o1);
- EXPECT_FALSE(o2);
-
- o2 = std::move(o1);
- EXPECT_FALSE(o1);
- EXPECT_FALSE(o2);
-
- decltype(o) o3{kInplace, new int(20)};
- o3 = std::move(o1);
- EXPECT_FALSE(o1);
- EXPECT_FALSE(o3);
- }
-}
-
-TEST(Optional, Value) {
- auto o = makeOptional(1);
- EXPECT_EQ(1, o.value());
- EXPECT_EQ(1, o.valueOr(2));
-
- o = kNullopt;
- EXPECT_EQ(2, o.valueOr(2));
-}
-
-TEST(Optional, Clear) {
- auto o = makeOptional(1);
- o.clear();
- EXPECT_FALSE(o);
-
- o.clear();
- EXPECT_FALSE(o);
-}
-
-TEST(Optional, Emplace) {
- auto o = makeOptional(std::vector<int>{1, 2, 3, 4});
- o.emplace(3, 1);
- EXPECT_TRUE(o);
- EXPECT_EQ((std::vector<int>{1, 1, 1}), *o);
- EXPECT_EQ(3U, o->capacity());
-
- o.clear();
- o.emplace({1, 2});
- EXPECT_TRUE(o);
- EXPECT_EQ((std::vector<int>{1, 2}), *o);
- EXPECT_EQ(2U, o->capacity());
-}
-
-TEST(Optional, Reset) {
- auto o = makeOptional(std::vector<int>{1, 2, 3, 4});
- o.reset(std::vector<int>{4, 3});
- EXPECT_TRUE(o);
- EXPECT_EQ((std::vector<int>{4, 3}), *o);
- EXPECT_EQ(2U, o->capacity());
-
- o.clear();
- o.reset(std::vector<int>{1});
- EXPECT_EQ((std::vector<int>{1}), *o);
- EXPECT_EQ(1U, o->capacity());
-}
-
-TEST(Optional, CompareEqual) {
- EXPECT_TRUE(makeOptional(1) == makeOptional(1));
- EXPECT_TRUE(makeOptional(1) == 1);
- EXPECT_TRUE(1 == makeOptional(1));
- EXPECT_FALSE(makeOptional(1) == makeOptional(2));
- EXPECT_FALSE(makeOptional(2) == 1);
- EXPECT_FALSE(2 == makeOptional(1));
- EXPECT_TRUE(makeOptional(1) != makeOptional(2));
- EXPECT_TRUE(makeOptional(1) != 2);
- EXPECT_TRUE(1 != makeOptional(2));
-
- EXPECT_FALSE(makeOptional(1) == kNullopt);
- EXPECT_FALSE(makeOptional(1) == Optional<int>());
- EXPECT_FALSE(kNullopt == makeOptional(1));
- EXPECT_FALSE(Optional<int>() == makeOptional(1));
- EXPECT_TRUE(makeOptional(1) != kNullopt);
- EXPECT_TRUE(makeOptional(1) != Optional<int>());
- EXPECT_TRUE(kNullopt != makeOptional(1));
- EXPECT_TRUE(Optional<int>() != makeOptional(1));
-
- EXPECT_TRUE(kNullopt == Optional<int>());
- EXPECT_TRUE(kNullopt == Optional<char*>());
- EXPECT_FALSE(kNullopt != Optional<int>());
- EXPECT_FALSE(kNullopt != Optional<char*>());
- EXPECT_TRUE(Optional<int>() == Optional<int>());
- EXPECT_FALSE(Optional<int>() != Optional<int>());
-}
-
-TEST(Optional, CompareLess) {
- EXPECT_TRUE(makeOptional(1) < makeOptional(2));
- EXPECT_TRUE(1 < makeOptional(2));
- EXPECT_TRUE(makeOptional(1) < 2);
-
- EXPECT_FALSE(makeOptional(1) < makeOptional(1));
- EXPECT_FALSE(1 < makeOptional(1));
- EXPECT_FALSE(makeOptional(1) < 1);
- EXPECT_FALSE(makeOptional(2) < makeOptional(1));
- EXPECT_FALSE(2 < makeOptional(1));
- EXPECT_FALSE(makeOptional(2) < 1);
-
- EXPECT_TRUE(kNullopt < makeOptional(2));
- EXPECT_TRUE(Optional<int>() < makeOptional(2));
- EXPECT_TRUE(Optional<int>() < 2);
- EXPECT_FALSE(makeOptional(2) < kNullopt);
- EXPECT_FALSE(makeOptional(2) < Optional<int>());
- EXPECT_FALSE(2 < Optional<int>());
-
- EXPECT_FALSE(kNullopt < Optional<int>());
- EXPECT_FALSE(Optional<int>() < kNullopt);
-}
-
-TEST(Optional, Destruction) {
- // create a reference counting class to check if we delete everything
- // we've created
- struct Track {
- Track(int& val) : mVal(val) { ++mVal.get(); }
- Track(std::initializer_list<int*> vals) : mVal(**vals.begin()) {
- ++mVal.get();
- }
- Track(const Track& other) : mVal(other.mVal) { ++mVal.get(); }
- Track(Track&& other) : mVal(other.mVal) { ++mVal.get(); }
- Track& operator=(const Track& other) {
- --mVal.get();
- mVal = other.mVal;
- ++mVal.get();
- return *this;
- }
- Track& operator=(Track&& other) {
- --mVal.get();
- mVal = other.mVal;
- ++mVal.get();
- return *this;
- }
-
- ~Track() { --mVal.get(); }
-
- std::reference_wrapper<int> mVal;
- };
-
- int counter = 0;
- {
- auto o = makeOptional(Track(counter));
- EXPECT_EQ(1, counter);
- }
- EXPECT_EQ(0, counter);
-
- {
- auto o = makeOptional(Track(counter));
- EXPECT_EQ(1, counter);
- o.clear();
- EXPECT_EQ(0, counter);
- }
- EXPECT_EQ(0, counter);
-
- {
- auto o = makeOptional(Track(counter));
- EXPECT_EQ(1, counter);
- int counter2 = 0;
- o.emplace(counter2);
- EXPECT_EQ(0, counter);
- EXPECT_EQ(1, counter2);
- o = Track(counter);
- EXPECT_EQ(1, counter);
- EXPECT_EQ(0, counter2);
-
- auto o2 = o;
- EXPECT_EQ(2, counter);
- EXPECT_EQ(0, counter2);
- }
- EXPECT_EQ(0, counter);
-
- {
- auto o = makeOptional(Track(counter));
- auto o2 = std::move(o);
- EXPECT_EQ(2, counter);
- o = o2;
- EXPECT_EQ(2, counter);
- }
- EXPECT_EQ(0, counter);
-
- int counter2 = 0;
- {
- Optional<Track> o;
- o.emplace(counter);
- EXPECT_EQ(1, counter);
-
- o.emplace(counter2);
- EXPECT_EQ(0, counter);
- EXPECT_EQ(1, counter2);
- }
- EXPECT_EQ(0, counter);
- EXPECT_EQ(0, counter2);
-
- {
- Optional<Track> o;
- o.emplace({&counter});
- EXPECT_EQ(1, counter);
-
- counter2 = 0;
- o.emplace({&counter2});
- EXPECT_EQ(0, counter);
- EXPECT_EQ(1, counter2);
- }
- EXPECT_EQ(0, counter);
- EXPECT_EQ(0, counter2);
-}
-
-} // namespace base
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/string_utils_test.cpp b/3rdparty/bimg/3rdparty/astc-codec/src/base/test/string_utils_test.cpp
deleted file mode 100644
index 209da54d863..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/string_utils_test.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/base/string_utils.h"
-
-#include <gtest/gtest.h>
-
-#include <list>
-#include <string>
-#include <vector>
-
-namespace astc_codec {
-namespace base {
-
-TEST(StringUtils, Split) {
- std::vector<std::string> results;
-
- auto testFunc = [&results](std::string&& s) {
- results.push_back(std::move(s));
- };
-
- Split("", "abc", testFunc);
- EXPECT_EQ(results.size(), 1);
-
- Split("abc", "", testFunc);
- EXPECT_EQ(results.size(), 1);
-
- results.clear();
- Split("abc", "a", testFunc);
- EXPECT_EQ(results.size(), 2);
- EXPECT_EQ(results[0], "");
- EXPECT_EQ(results[1], "bc");
-
- results.clear();
- Split("aaa", "a", testFunc);
- EXPECT_EQ(4, results.size());
- EXPECT_EQ("", results[0]);
- EXPECT_EQ("", results[1]);
- EXPECT_EQ("", results[2]);
- EXPECT_EQ("", results[3]);
-
- results.clear();
- Split("1a2a3a4", "a", testFunc);
- EXPECT_EQ(4, results.size());
- EXPECT_EQ("1", results[0]);
- EXPECT_EQ("2", results[1]);
- EXPECT_EQ("3", results[2]);
- EXPECT_EQ("4", results[3]);
-
- results.clear();
- Split("1a2aa3a4", "a", testFunc);
- EXPECT_EQ(5, results.size());
- EXPECT_EQ("1", results[0]);
- EXPECT_EQ("2", results[1]);
- EXPECT_EQ("", results[2]);
- EXPECT_EQ("3", results[3]);
- EXPECT_EQ("4", results[4]);
-
- results.clear();
- Split("The quick brown fox jumped over the lazy dog",
- " ", testFunc);
- EXPECT_EQ(9, results.size());
- EXPECT_EQ("The", results[0]);
- EXPECT_EQ("quick", results[1]);
- EXPECT_EQ("brown", results[2]);
- EXPECT_EQ("fox", results[3]);
- EXPECT_EQ("jumped", results[4]);
- EXPECT_EQ("over", results[5]);
- EXPECT_EQ("the", results[6]);
- EXPECT_EQ("lazy", results[7]);
- EXPECT_EQ("dog", results[8]);
-
- results.clear();
- Split("a; b; c; d", "; ", testFunc);
- EXPECT_EQ(4, results.size());
- EXPECT_EQ("a", results[0]);
- EXPECT_EQ("b", results[1]);
- EXPECT_EQ("c", results[2]);
- EXPECT_EQ("d", results[3]);
-}
-
-TEST(StringUtils, ParseInt32) {
- EXPECT_EQ(ParseInt32("0", -1), 0);
- EXPECT_EQ(ParseInt32("100", -1), 100);
- EXPECT_EQ(ParseInt32("-100", -1), -100);
-
- EXPECT_EQ(ParseInt32("", -1), -1);
- EXPECT_EQ(ParseInt32("a", -1), -1);
- EXPECT_EQ(ParseInt32("10x1", -1), 10);
-
- EXPECT_EQ(ParseInt32("2147483647", -1), 2147483647);
- EXPECT_EQ(ParseInt32("2147483648", -1), 2147483647);
-
- EXPECT_EQ(ParseInt32("-2147483648", -1), -2147483648);
- EXPECT_EQ(ParseInt32("-2147483649", -1), -2147483648);
-}
-
-} // namespace base
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/type_traits_test.cpp b/3rdparty/bimg/3rdparty/astc-codec/src/base/test/type_traits_test.cpp
deleted file mode 100644
index c724cbe7d73..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/type_traits_test.cpp
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/base/type_traits.h"
-
-#include <gtest/gtest.h>
-
-#include <array>
-#include <functional>
-#include <list>
-#include <vector>
-
-namespace astc_codec {
-namespace base {
-
-TEST(TypeTraits, IsCallable) {
- class C;
- C* c = nullptr;
-
- auto lambda = [c](bool) -> C* { return nullptr; };
-
- static_assert(is_callable_as<void(), void()>::value, "simple function");
- static_assert(is_callable_as<void (&)(), void()>::value,
- "function reference");
- static_assert(is_callable_as<void (*)(), void()>::value, "function pointer");
- static_assert(is_callable_as<int(C&, C*), int(C&, C*)>::value,
- "function with arguments and return type");
- static_assert(is_callable_as<decltype(lambda), C*(bool)>::value, "lambda");
- static_assert(is_callable_as<std::function<bool(int)>, bool(int)>::value,
- "std::function");
-
- static_assert(!is_callable_as<int, void()>::value,
- "int should not be callable");
- static_assert(!is_callable_as<C, void()>::value, "incomplete type");
- static_assert(!is_callable_as<void(), void(int)>::value,
- "different arguments");
- static_assert(!is_callable_as<int(), void()>::value,
- "different return types");
- static_assert(!is_callable_as<int(), short()>::value,
- "slightly different return types");
- static_assert(!is_callable_as<int(int), int(int, int)>::value,
- "more arguments");
- static_assert(!is_callable_as<int(int, int), int(int)>::value,
- "less arguments");
-
- static_assert(!is_callable_as<int(int), int>::value,
- "bad required signature");
-
- static_assert(is_callable_with_args<void(), void()>::value,
- "simple function");
- static_assert(is_callable_with_args<void (&)(), void()>::value,
- "function reference");
- static_assert(is_callable_with_args<void (*)(), void()>::value,
- "function pointer");
- static_assert(is_callable_with_args<int(C&, C*), int(C&, C*)>::value,
- "function with arguments and return type");
- static_assert(is_callable_with_args<decltype(lambda), C*(bool)>::value,
- "lambda");
- static_assert(
- is_callable_with_args<std::function<bool(int)>, bool(int)>::value,
- "std::function");
-
- static_assert(!is_callable_with_args<int, void()>::value,
- "int should not be callable");
- static_assert(!is_callable_with_args<C, void()>::value, "incomplete type");
- static_assert(!is_callable_with_args<void(), void(int)>::value,
- "different arguments");
- static_assert(is_callable_with_args<int(), void()>::value,
- "different return types are ignored");
- static_assert(is_callable_with_args<int(), short()>::value,
- "slightly different return types are ignored");
- static_assert(!is_callable_with_args<int(int), int(int, int)>::value,
- "more arguments");
- static_assert(!is_callable_with_args<int(int, int), int(int)>::value,
- "less arguments");
-
- static_assert(!is_callable_with_args<int(int), int>::value,
- "bad required signature");
-}
-
-TEST(TypeTraits, IsTemplateInstantiation) {
- static_assert(!is_template_instantiation_of<int, std::vector>::value,
- "int is not an instance of vector");
- static_assert(!is_template_instantiation_of<std::list<std::vector<int>>,
- std::vector>::value,
- "list is not an instance of vector");
-
- static_assert(
- is_template_instantiation_of<std::vector<int>, std::vector>::value,
- "std::vector<int> is an instance of vector");
- static_assert(
- is_template_instantiation_of<std::vector<std::vector<std::vector<int>>>,
- std::vector>::value,
- "nested std::vector<> is an instance of vector");
-}
-
-#ifndef _MSC_VER
-TEST(TypeTraits, IsRange) {
- static_assert(is_range<std::vector<int>>::value,
- "vector<> should be detected as a range");
- static_assert(is_range<const std::list<std::function<void()>>>::value,
- "const list<> should be detected as a range");
- static_assert(is_range<std::array<std::vector<int>, 10>>::value,
- "array<> should be detected as a range");
- char arr[100];
- static_assert(is_range<decltype(arr)>::value,
- "C array should be detected as a range");
- static_assert(is_range<decltype("string")>::value,
- "String literal should be detected as a range");
-
- static_assert(!is_range<int>::value, "int shouldn't be a range");
- static_assert(!is_range<int*>::value, "int* shouldn't be a range");
- static_assert(!is_range<const int*>::value,
- "even const int* shouldn't be a range");
-}
-#endif
-
-} // namespace base
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/uint128_test.cpp b/3rdparty/bimg/3rdparty/astc-codec/src/base/test/uint128_test.cpp
deleted file mode 100644
index 0a52244c851..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/test/uint128_test.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/base/uint128.h"
-
-#include <gtest/gtest.h>
-
-namespace astc_codec {
-namespace base {
-
-TEST(UInt128, Equality) {
- const UInt128 zero(0);
- const UInt128 max64(~0ULL);
-
- EXPECT_EQ(zero, zero);
- EXPECT_NE(zero, max64);
- EXPECT_EQ(zero, UInt128(0));
- EXPECT_NE(zero, UInt128(1));
- EXPECT_EQ(max64, max64);
-}
-
-TEST(UInt128, Shifting) {
- const UInt128 max64(~0ULL);
- const UInt128 upper64(~0ULL, 0);
- EXPECT_EQ(upper64.HighBits(), ~0ULL);
- EXPECT_EQ(upper64.LowBits(), 0);
-
- EXPECT_EQ(upper64 >> 64, max64);
-
- EXPECT_EQ(UInt128(1) << 1, UInt128(2));
- EXPECT_EQ(UInt128(0) << 0, UInt128(0));
- EXPECT_EQ(max64 << 0, max64);
- EXPECT_EQ(max64 >> 0, max64);
- EXPECT_EQ(upper64 << 0, upper64);
- EXPECT_EQ(upper64 >> 0, upper64);
-
- {
- const UInt128 bit63 = UInt128(1ULL << 62) << 1;
- EXPECT_EQ(bit63.LowBits(), 1ULL << 63);
- EXPECT_EQ(bit63.HighBits(), 0);
- }
-
- {
- const UInt128 bit64 = UInt128(1ULL << 63) << 1;
- EXPECT_EQ(bit64.LowBits(), 0);
- EXPECT_EQ(bit64.HighBits(), 1);
- EXPECT_EQ(bit64 >> 1, UInt128(1ULL << 63));
- }
-
- {
- const UInt128 overshift = max64 << 128;
- EXPECT_EQ(overshift.HighBits(), 0);
- EXPECT_EQ(overshift.LowBits(), 0);
- }
-
- {
- const UInt128 overlap = upper64 >> 32;
- EXPECT_EQ(overlap.HighBits(), 0x00000000FFFFFFFF);
- EXPECT_EQ(overlap.LowBits(), 0xFFFFFFFF00000000);
- }
-
- {
- const UInt128 overlap = max64 << 32;
- EXPECT_EQ(overlap.HighBits(), 0x00000000FFFFFFFF);
- EXPECT_EQ(overlap.LowBits(), 0xFFFFFFFF00000000);
- }
-}
-
-TEST(UInt128, LargeShift) {
- const UInt128 base(0xFF);
- EXPECT_EQ(base << 64, UInt128(0xFFULL, 0));
- EXPECT_EQ(base << 72, UInt128(0xFF00ULL, 0));
- EXPECT_EQ(base << 80, UInt128(0xFF0000ULL, 0));
- EXPECT_EQ(base << 88, UInt128(0xFF000000ULL, 0));
- EXPECT_EQ(base << 96, UInt128(0xFF00000000ULL, 0));
- EXPECT_EQ(base << 104, UInt128(0xFF0000000000ULL, 0));
- EXPECT_EQ(base << 112, UInt128(0xFF000000000000ULL, 0));
- EXPECT_EQ(base << 120, UInt128(0xFF00000000000000ULL, 0));
-
- const UInt128 upper(0xFF00000000000000ULL, 0);
- EXPECT_EQ(upper >> 64, UInt128(0, 0xFF00000000000000ULL));
- EXPECT_EQ(upper >> 72, UInt128(0, 0xFF000000000000ULL));
- EXPECT_EQ(upper >> 80, UInt128(0, 0xFF0000000000ULL));
- EXPECT_EQ(upper >> 88, UInt128(0, 0xFF00000000ULL));
- EXPECT_EQ(upper >> 96, UInt128(0, 0xFF000000ULL));
- EXPECT_EQ(upper >> 104, UInt128(0, 0xFF0000ULL));
- EXPECT_EQ(upper >> 112, UInt128(0, 0xFF00ULL));
- EXPECT_EQ(upper >> 120, UInt128(0, 0xFFULL));
-}
-
-TEST(UInt128, BooleanOperators) {
- const UInt128 allOnes(~0ULL, ~0ULL);
- EXPECT_EQ(allOnes.HighBits(), ~0ULL);
- EXPECT_EQ(allOnes.LowBits(), ~0ULL);
-
- EXPECT_EQ(~allOnes, UInt128(0));
- EXPECT_EQ(~UInt128(0), allOnes);
-
- EXPECT_EQ(UInt128(0xFFFF00) & UInt128(0x00FFFF), UInt128(0x00FF00));
- EXPECT_EQ(UInt128(0xFFFF00) | UInt128(0x00FFFF), UInt128(0xFFFFFF));
- EXPECT_EQ(UInt128(0xFFFF00) ^ UInt128(0x00FFFF), UInt128(0xFF00FF));
-}
-
-TEST(UInt128, Addition) {
- const UInt128 bit63(1ULL << 63);
-
- EXPECT_EQ(UInt128(1) + 1, UInt128(2));
- EXPECT_EQ(bit63 + bit63, UInt128(1) << 64);
-
- const UInt128 carryUp = UInt128(~0ULL) + 1;
- EXPECT_EQ(carryUp.HighBits(), 1);
- EXPECT_EQ(carryUp.LowBits(), 0);
-
- const UInt128 allOnes(~0ULL, ~0ULL);
- EXPECT_EQ(allOnes + 1, UInt128(0));
-}
-
-TEST(UInt128, Subtraction) {
- const UInt128 bit64 = UInt128(1) << 64;
- EXPECT_EQ(bit64 - 1, UInt128(~0ULL));
-
- EXPECT_EQ(UInt128(1) - 1, UInt128(0));
-
- const UInt128 allOnes(~0ULL, ~0ULL);
- EXPECT_EQ(UInt128(0) - 1, allOnes);
-}
-
-} // namespace base
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/type_traits.h b/3rdparty/bimg/3rdparty/astc-codec/src/base/type_traits.h
deleted file mode 100644
index 917125d26f1..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/type_traits.h
+++ /dev/null
@@ -1,172 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_BASE_TYPE_TRAITS_H_
-#define ASTC_CODEC_BASE_TYPE_TRAITS_H_
-
-#include <iterator>
-#include <type_traits>
-
-namespace astc_codec {
-namespace base {
-
-namespace details {
-
-// a simple helper class for SFINAE below.
-template<class X = void>
-struct dummy {
- using type = X;
-};
-
-} // namespace details
-
-// add some convenience shortcuts for an overly complex std::enable_if syntax
-
-// Use 'enable_if<Predicate,Type>' instead of
-// 'typename std::enable_if<Predicate::value,Type>::type'
-template<class Predicate, class Type = void*>
-using enable_if = typename std::enable_if<Predicate::value, Type>::type;
-
-// Use 'enable_if_c<BooleanFlag,Type>' instead of
-// 'typename std::enable_if<BooleanFlag,Type>::type'
-template<bool predicate, class Type = void*>
-using enable_if_c = typename std::enable_if<predicate, Type>::type;
-
-// Use 'enable_if_convertible<From,To,Type>' instead of
-// 'typename std::enable_if<std::is_convertible<From,To>::value, Type>::type'
-template<class From, class To, class Type = void*>
-using enable_if_convertible = enable_if<std::is_convertible<From, To>>;
-
-// -----------------------------------------------------------------------------
-// A predicate for checking if some object is callable with a specific
-// signature. Examples:
-//
-// is_callable_as<int, void()>::value == false.
-// is_callable_as<strcmp, void()>::value == false.
-// is_callable_as<strcmp, int(const char*, const char*)>::value == true
-//
-template<class F, class Signature, class X = void>
-struct is_callable_as : std::false_type {};
-
-// This specialization is SFINAE-d out if template arguments can't be combined
-// into a call expression F(), or if the result of that call is not |R|
-template<class F, class R, class... Args>
-struct is_callable_as<F, R(Args...),
- typename std::enable_if<std::is_same<
- typename details::dummy<decltype(std::declval<F>()(
- std::declval<Args>()...))>::type,
- R>::value>::type> : std::true_type {};
-
-//
-// A similar predicate to only check arguments of the function call and ignore
-// the specified return type
-//
-// is_callable_as<strcmp, int(const char*, const char*)>::value == true
-// is_callable_as<strcmp, void(const char*, const char*)>::value == false
-// is_callable_with_args<strcmp, void(const char*, const char*)>::value == true
-//
-template<class F, class Signature, class X = void>
-struct is_callable_with_args : std::false_type {};
-
-template<class F, class R, class... Args>
-struct is_callable_with_args<
- F, R(Args...),
- typename std::enable_if<
- !std::is_same<typename details::dummy<decltype(
- std::declval<F>()(std::declval<Args>()...))>::type,
- F>::value>::type> : std::true_type {};
-
-// -----------------------------------------------------------------------------
-// Check if a type |T| is any instantiation of a template |U|. Examples:
-//
-// is_template_instantiation_of<int, std::vector>::value == false
-// is_template_instantiation_of<
-// std::list<std::vector<int>>, std::vector>::value == false
-// is_template_instantiation_of<std::vector<int>, std::vector>::value == true
-// is_template_instantiation_of<
-// std::vector<std::vector<int>>, std::vector>::value == true
-//
-template<class T, template<class...> class U>
-struct is_template_instantiation_of : std::false_type {};
-
-template<template<class...> class U, class... Args>
-struct is_template_instantiation_of<U<Args...>, U> : std::true_type {};
-// -----------------------------------------------------------------------------
-
-//
-// is_range<T> - check if type |T| is a range-like type.
-//
-// It makes sure that expressions std::begin(t) and std::end(t) are well-formed
-// and those return the same type.
-//
-// Note: with expression SFINAE from C++14 is_range_helper<> could be renamed to
-// is_range<> with no extra code. C++11 needs an extra level of enable_if<>
-// to make it work when the type isn't a range.
-//
-
-namespace details {
-
-template<class T>
-using is_range_helper = std::is_same<
- decltype(std::begin(
- std::declval<typename std::add_lvalue_reference<T>::type>())),
- decltype(
- std::end(std::declval<typename std::add_lvalue_reference<T>::type>()))>;
-
-} // namespace details
-
-template<class T, class = void>
-struct is_range : std::false_type {};
-
-template<class T>
-struct is_range<
- T, typename std::enable_if<details::is_range_helper<T>::value>::type>
- : std::true_type {};
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// A class to incapsulate integer sequence 0, 1, ..., <num_args>
-// Seq<int...>
-// Useful to pass function parameters in an array/tuple to call it later.
-//
-
-template<int...>
-struct Seq {};
-
-// A 'maker' class to construct Seq<int...> given only <num_args>
-// value.
-// MakeSeq<N, S...> works this way, e.g.
-//
-// MakeSeq<2> inherits MakeSeq<2 - 1, 2 - 1> == MakeSeq<1, 1>
-// MakeSeq<1, 1> : MakeSeq<1 - 1, 1 - 1, 1> == MakeSeq<0, 0, 1>
-// MakeSeq<0, 0, 1> == MakeSeq<0, S...> and defines |type| = Seq<0, 1>
-
-template<int N, int... S>
-struct MakeSeq : MakeSeq<N - 1, N - 1, S...> {};
-
-template<int... S>
-struct MakeSeq<0, S...> {
- using type = Seq<S...>;
-};
-
-//
-// MakeSeqT alias to quickly create Seq<...>:
-// MakeSeqT<3> == Seq<0, 1, 2>
-template<int... S>
-using MakeSeqT = typename MakeSeq<S...>::type;
-
-} // namespace base
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_BASE_TYPE_TRAITS_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/uint128.h b/3rdparty/bimg/3rdparty/astc-codec/src/base/uint128.h
deleted file mode 100644
index 481e4eabbd9..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/uint128.h
+++ /dev/null
@@ -1,175 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_BASE_UINT128_H_
-#define ASTC_CODEC_BASE_UINT128_H_
-
-#include <cassert>
-#include <cstdint>
-
-namespace astc_codec {
-namespace base {
-
-class UInt128 {
- public:
- UInt128() = default;
- UInt128(uint64_t low) : low_(low) { }
- UInt128(uint64_t high, uint64_t low) : low_(low), high_(high) { }
- UInt128(const UInt128& other) : low_(other.low_), high_(other.high_) { }
-
- uint64_t LowBits() const { return low_; }
- uint64_t HighBits() const { return high_; }
-
- // Allow explicit casts to uint64_t.
- explicit operator uint64_t() const { return low_; }
-
- // Copy operators.
- UInt128& operator=(const UInt128& other) {
- high_ = other.high_;
- low_ = other.low_;
- return *this;
- }
-
- // Equality operators.
- bool operator==(const UInt128& other) const {
- return high_ == other.high_ && low_ == other.low_;
- }
-
- bool operator!=(const UInt128& other) const {
- return high_ != other.high_ || low_ != other.low_;
- }
-
- // Shifting.
- UInt128& operator<<=(int shift) {
- high_ = shift >= 64 ? (shift >= 128 ? 0 : low_ << (shift - 64))
- : high_ << shift;
-
- if (shift > 0 && shift < 64) {
- const uint64_t overlappingBits = low_ >> (64 - shift);
- high_ |= overlappingBits;
- }
-
- low_ = shift >= 64 ? 0 : low_ << shift;
- return *this;
- }
-
- UInt128 operator<<(int shift) const {
- UInt128 result = *this;
- result <<= shift;
- return result;
- }
-
- UInt128& operator>>=(int shift) {
- low_ = shift >= 64 ? (shift >= 128 ? 0 : high_ >> (shift - 64))
- : low_ >> shift;
-
- if (shift > 0 && shift < 64) {
- const uint64_t overlappingBits = high_ << (64 - shift);
- low_ |= overlappingBits;
- }
-
- high_ = shift >= 64 ? 0 : high_ >> shift;
-
- return *this;
- }
-
- UInt128 operator>>(int shift) const {
- UInt128 result = *this;
- result >>= shift;
- return result;
- }
-
- // Binary operations.
- UInt128& operator|=(const UInt128& other) {
- high_ |= other.high_;
- low_ |= other.low_;
- return *this;
- }
-
- UInt128 operator|(const UInt128& other) const {
- UInt128 result = *this;
- result |= other;
- return result;
- }
-
- UInt128& operator&=(const UInt128& other) {
- high_ &= other.high_;
- low_ &= other.low_;
- return *this;
- }
-
- UInt128 operator&(const UInt128& other) const {
- UInt128 result = *this;
- result &= other;
- return result;
- }
-
- UInt128& operator^=(const UInt128& other) {
- high_ ^= other.high_;
- low_ ^= other.low_;
- return *this;
- }
-
- UInt128 operator^(const UInt128& other) const {
- UInt128 result = *this;
- result ^= other;
- return result;
- }
-
- UInt128 operator~() const {
- UInt128 result = *this;
- result.high_ = ~high_;
- result.low_ = ~low_;
- return result;
- }
-
- // Addition/subtraction.
- UInt128& operator+=(const UInt128& other) {
- const uint64_t carry =
- (((low_ & other.low_) & 1) + (low_ >> 1) + (other.low_ >> 1)) >> 63;
- high_ += other.high_ + carry;
- low_ += other.low_;
- return *this;
- }
-
- UInt128 operator+(const UInt128& other) const {
- UInt128 result = *this;
- result += other;
- return result;
- }
-
- UInt128& operator-=(const UInt128& other) {
- low_ -= other.low_;
- const uint64_t carry =
- (((low_ & other.low_) & 1) + (low_ >> 1) + (other.low_ >> 1)) >> 63;
- high_ -= other.high_ + carry;
- return *this;
- }
-
- UInt128 operator-(const UInt128& other) const {
- UInt128 result = *this;
- result -= other;
- return result;
- }
-
- private:
- // TODO(google): Different order for little endian.
- uint64_t low_ = 0;
- uint64_t high_ = 0;
-};
-
-} // namespace base
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_BASE_UINT128_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/base/utils.h b/3rdparty/bimg/3rdparty/astc-codec/src/base/utils.h
deleted file mode 100644
index 0a4fabdc7a4..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/base/utils.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_BASE_UTILS_H_
-#define ASTC_CODEC_BASE_UTILS_H_
-
-#include <cassert>
-#include <cstdio>
-#include <cstdlib>
-
-#ifdef NDEBUG
-#define UTILS_RELEASE_ASSERT(x) \
- do { \
- const bool result = (x); \
- if (!result) { \
- fprintf(stderr, "Error: UTILS_RELEASE_ASSERT failed: %s\n", #x); \
- abort(); \
- } \
- } while (false)
-#else
-#define UTILS_RELEASE_ASSERT(x) assert(x)
-#endif
-
-#endif // ASTC_CODEC_BASE_UTILS_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/BUILD.bazel b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/BUILD.bazel
deleted file mode 100644
index ccc764eea83..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/BUILD.bazel
+++ /dev/null
@@ -1,246 +0,0 @@
-# Copyright 2018 Google LLC
-#
-# 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
-#
-# https://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.
-
-licenses(["notice"])
-
-cc_library(
- name = "footprint",
- srcs = ["footprint.cc"],
- hdrs = ["footprint.h"],
- deps = [
- "//:api",
- "//src/base",
- ],
-)
-
-cc_library(
- name = "astc_utils",
- srcs = [
- "astc_file.cc",
- "endpoint_codec.cc",
- "integer_sequence_codec.cc",
- "intermediate_astc_block.cc",
- "logical_astc_block.cc",
- "partition.cc",
- "physical_astc_block.cc",
- "quantization.cc",
- "weight_infill.cc",
- ],
- hdrs = [
- "astc_file.h",
- "endpoint_codec.h",
- "integer_sequence_codec.h",
- "intermediate_astc_block.h",
- "logical_astc_block.h",
- "partition.h",
- "physical_astc_block.h",
- "quantization.h",
- "types.h",
- "weight_infill.h",
- ],
- copts = [
- "-Wno-unused-variable",
- "-O3",
- ],
- deps = [
- ":footprint",
- "//src/base",
- ],
-)
-
-cc_library(
- name = "codec",
- srcs = ["codec.cc"],
- hdrs = ["codec.h"],
- visibility = ["//:__pkg__"],
- deps = [
- ":astc_utils",
- ":footprint",
- "//src/base",
- ],
-)
-
-cc_binary(
- name = "astc_inspector_cli",
- srcs = ["tools/astc_inspector_cli.cc"],
- deps = [
- ":astc_utils",
- "//src/base",
- ],
-)
-
-################################################################################
-##
-## Testing
-##
-################################################################################
-
-cc_library(
- name = "test",
- testonly = 1,
- hdrs = ["test/image_utils.h"],
- deps = ["@gtest//:gtest"],
-)
-
-cc_test(
- name = "physical_astc_block_test",
- size = "small",
- srcs = ["test/physical_astc_block_test.cc"],
- deps = [
- ":astc_utils",
- "@gtest//:gtest_main",
- "//src/base",
- ],
-)
-
-cc_test(
- name = "partition_test",
- size = "medium",
- srcs = ["test/partition_test.cc"],
- deps = [
- ":astc_utils",
- "@gtest//:gtest_main",
- ],
-)
-
-cc_test(
- name = "integer_sequence_codec_test",
- size = "small",
- srcs = ["test/integer_sequence_codec_test.cc"],
- deps = [
- ":astc_utils",
- "@gtest//:gtest_main",
- "//src/base",
- ],
-)
-
-cc_test(
- name = "intermediate_astc_block_test",
- size = "small",
- srcs = ["test/intermediate_astc_block_test.cc"],
- data = glob([
- "testdata/checkered_*.astc",
- ]),
- deps = [
- ":astc_utils",
- ":test",
- "@gtest//:gtest_main",
- ],
-)
-
-cc_test(
- name = "quantization_test",
- size = "medium",
- srcs = ["test/quantization_test.cc"],
- deps = [
- ":astc_utils",
- "@gtest//:gtest_main",
- ],
-)
-
-cc_test(
- name = "weight_infill_test",
- size = "small",
- srcs = ["test/weight_infill_test.cc"],
- deps = [
- ":astc_utils",
- ":footprint",
- "@gtest//:gtest_main",
- ],
-)
-
-cc_test(
- name = "endpoint_codec_test",
- size = "small",
- srcs = ["test/endpoint_codec_test.cc"],
- data = [
- ":testdata/checkerboard.astc",
- ],
- deps = [
- ":astc_utils",
- ":test",
- "@gtest//:gtest_main",
- ],
-)
-
-cc_test(
- name = "logical_astc_block_test",
- size = "large",
- srcs = ["test/logical_astc_block_test.cc"],
- data = glob([
- "testdata/atlas_small_*.astc",
- "testdata/atlas_small_*.bmp",
- "testdata/footprint_*.astc",
- "testdata/footprint_*.bmp",
- "testdata/rgb_*.astc",
- "testdata/rgb_*.bmp",
- ]),
- deps = [
- ":astc_utils",
- ":test",
- "@gtest//:gtest_main",
- ],
-)
-
-cc_test(
- name = "codec_test",
- size = "large",
- srcs = ["test/codec_test.cc"],
- data = glob([
- "testdata/atlas_small_*.astc",
- "testdata/atlas_small_*.bmp",
- ]),
- deps = [
- ":codec",
- ":test",
- "@gtest//:gtest_main",
- "//:api",
- ],
-)
-
-cc_test(
- name = "footprint_test",
- size = "small",
- srcs = ["test/footprint_test.cc"],
- deps = [
- ":footprint",
- "@gtest//:gtest_main",
- ],
-)
-
-cc_test(
- name = "astc_fuzzer",
- srcs = ["test/astc_fuzzer.cc"],
- copts = select({
- # Clang-only flags. TODO: Find a better way to detect GCC/clang.
- "@bazel_tools//src/conditions:darwin_x86_64": [
- "-fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp",
- "-fsanitize-coverage=bb",
- ],
- "@bazel_tools//src/conditions:darwin": [
- "-fsanitize-coverage=trace-pc-guard,indirect-calls,trace-cmp",
- "-fsanitize-coverage=bb",
- ],
- # GCC-only flags.
- "//conditions:default": [
- "-finstrument-functions"
- ],
- }),
- deps = [
- ":codec",
- "@honggfuzz//:honggfuzz",
- "@benchmark//:benchmark",
- ],
- linkstatic = 1,
-)
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/CMakeLists.txt b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/CMakeLists.txt
deleted file mode 100644
index e82a692c40e..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/CMakeLists.txt
+++ /dev/null
@@ -1,95 +0,0 @@
-# Copyright 2018 Google LLC
-#
-# 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
-#
-# https://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.
-add_library(footprint footprint.cc)
-target_link_libraries(footprint base)
-
-add_library(astc_utils
- astc_file.cc
- endpoint_codec.cc
- integer_sequence_codec.cc
- intermediate_astc_block.cc
- logical_astc_block.cc
- partition.cc
- physical_astc_block.cc
- quantization.cc
- weight_infill.cc)
-target_link_libraries(astc_utils PRIVATE base footprint)
-target_include_directories(astc_utils PRIVATE ../..)
-
-add_library(astc-codec codec.cc)
-target_link_libraries(astc-codec PRIVATE astc_utils)
-target_include_directories(astc-codec PUBLIC ../../include)
-target_include_directories(astc-codec PRIVATE ../..)
-
-add_executable(astc_inspector_cli tools/astc_inspector_cli.cc)
-target_include_directories(astc_inspector_cli PRIVATE ../..)
-target_link_libraries(astc_inspector_cli PRIVATE astc_utils)
-
-#
-# Testing
-#
-if(OPTION_ASTC_TESTS)
- # Note that we will execute all the tests in the project directory.
- # We do this to ensure the unit tests can pick up the required test data
-
- # Create interface library exposing the root as an include directory
- add_library(codec_test_dependencies INTERFACE)
- target_include_directories(codec_test_dependencies INTERFACE ../..)
-
- add_executable(physical_astc_block_test test/physical_astc_block_test.cc)
- add_test(NAME physical_astc_block_test COMMAND physical_astc_block_test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
- target_link_libraries(physical_astc_block_test astc_utils codec_test_dependencies gmock_main)
-
- add_executable(partition_test test/partition_test.cc)
- add_test(NAME partition_test COMMAND partition_test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
- target_link_libraries(partition_test PRIVATE astc_utils codec_test_dependencies gmock_main)
-
- add_executable(integer_sequence_codec_test test/integer_sequence_codec_test.cc)
- target_link_libraries(integer_sequence_codec_test PRIVATE astc_utils codec_test_dependencies gmock_main)
-
- add_executable(intermediate_astc_block_test test/intermediate_astc_block_test.cc)
- add_test(NAME intermediate_astc_block_test COMMAND intermediate_astc_block_test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
- target_link_libraries(intermediate_astc_block_test PRIVATE astc_utils codec_test_dependencies gmock_main)
-
- add_executable(quantization_test test/quantization_test.cc)
- add_test(NAME quantization_test COMMAND quantization_test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
- target_link_libraries(quantization_test PRIVATE astc_utils codec_test_dependencies gmock_main)
-
- add_executable(weight_infill_test test/weight_infill_test.cc)
- add_test(NAME weight_infill_test COMMAND weight_infill_test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
- target_link_libraries(weight_infill_test PRIVATE astc_utils footprint codec_test_dependencies gmock_main)
-
- add_executable(endpoint_codec_test test/endpoint_codec_test.cc)
- add_test(NAME endpoint_codec_test COMMAND endpoint_codec_test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
- target_link_libraries(endpoint_codec_test PRIVATE astc_utils codec_test_dependencies gmock_main)
-
- add_executable(logical_astc_block_test test/logical_astc_block_test.cc)
- add_test(NAME logical_astc_block_test COMMAND logical_astc_block_test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
- target_link_libraries(logical_astc_block_test PRIVATE astc_utils codec_test_dependencies gmock_main)
-
- add_executable(codec_test test/codec_test.cc)
- add_test(NAME codec_test COMMAND codec_test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
-
- target_link_libraries(codec_test PRIVATE astc-codec codec_test_dependencies gmock_main)
-
- add_executable(footprint_test test/footprint_test.cc)
- add_test(NAME footprint_test COMMAND footprint_test WORKING_DIRECTORY ${PROJECT_SOURCE_DIR})
- target_link_libraries(footprint_test PRIVATE footprint codec_test_dependencies gmock_main)
-
- if(OPTION_BUILD_FUZZER)
- message(FATAL_ERROR "Not yet supported due to missing dependencies")
- add_executable(astc_fuzzer test/astc_fuzzer.cc codec_test_dependencies gmock_main)
- target_link_libraries(astc_fuzzer PRIVATE astc-codec honggfuzz benchmark)
- endif()
-endif()
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/astc_file.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/astc_file.cc
deleted file mode 100644
index 9999ee23ddd..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/astc_file.cc
+++ /dev/null
@@ -1,185 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/astc_file.h"
-
-#include <cstring>
-#include <fstream>
-#include <memory>
-#include <sstream>
-
-namespace astc_codec {
-
-namespace {
-static constexpr size_t kASTCHeaderSize = 16;
-
-// Reads a value of size T from the buffer at the current offset, then
-// increments the offset.
-template<typename T>
-inline T ReadVal(const char* file_data, size_t& offset) {
- T x;
- memcpy(&x, &file_data[offset], sizeof(T));
- offset += sizeof(T);
- return x;
-}
-} // namespace
-
-ASTCFile::ASTCFile(Header&& header, std::string&& blocks)
- : header_(std::move(header)), blocks_(std::move(blocks)) {}
-
-std::unique_ptr<ASTCFile> ASTCFile::LoadFromMemory(const char* data,
- size_t length,
- std::string* error) {
- if (length < kASTCHeaderSize) {
- *error = "Incomplete header.";
- return nullptr;
- }
-
- base::Optional<Header> header_opt = ParseHeader(data);
- if (!header_opt) {
- *error = "Invalid ASTC header.";
- return nullptr;
- }
-
- Header header = header_opt.value();
-
- if (header.block_width_ == 0 || header.block_height_ == 0) {
- *error = "Invalid block size.";
- return nullptr;
- }
-
- std::string blocks(data + kASTCHeaderSize, data + length);
-
- // Check that this file has the expected number of blocks.
- const size_t expected_block_count =
- ((header.width_ + header.block_width_ - 1) / header.block_width_) *
- ((header.height_ + header.block_height_ - 1) / header.block_height_);
-
- if (blocks.size() % PhysicalASTCBlock::kSizeInBytes != 0 ||
- blocks.size() / PhysicalASTCBlock::kSizeInBytes != expected_block_count) {
- std::stringstream ss;
- ss << "Unexpected file length " << blocks.size() << " expected "
- << kASTCHeaderSize +
- expected_block_count * PhysicalASTCBlock::kSizeInBytes
- << " bytes.";
- *error = ss.str();
- return nullptr;
- }
-
- return std::unique_ptr<ASTCFile>(
- new ASTCFile(std::move(header), std::move(blocks)));
-}
-
-std::unique_ptr<ASTCFile> ASTCFile::LoadFile(const std::string& path,
- std::string* error) {
- std::ifstream is(path, std::ios::binary);
- if (!is) {
- *error = "File not found: " + path;
- return nullptr;
- }
-
- char header_data[kASTCHeaderSize] = {};
- if (!is.read(header_data, kASTCHeaderSize)) {
- *error = "Failed to load ASTC header.";
- return nullptr;
- }
-
- base::Optional<Header> header_opt = ParseHeader(header_data);
- if (!header_opt) {
- *error = "Invalid ASTC header.";
- return nullptr;
- }
-
- Header header = header_opt.value();
-
- std::string blocks;
- {
- std::ostringstream ss;
- ss << is.rdbuf();
- blocks = ss.str();
- }
-
- // Check that this file has the expected number of blocks.
- const size_t expected_block_count =
- ((header.width_ + header.block_width_ - 1) / header.block_width_) *
- ((header.height_ + header.block_height_ - 1) / header.block_height_);
-
- if (blocks.size() % PhysicalASTCBlock::kSizeInBytes != 0 ||
- blocks.size() / PhysicalASTCBlock::kSizeInBytes != expected_block_count) {
- std::stringstream ss;
- ss << "Unexpected file length " << blocks.size() << " expected "
- << kASTCHeaderSize +
- expected_block_count * PhysicalASTCBlock::kSizeInBytes
- << " bytes.";
- *error = ss.str();
- return nullptr;
- }
-
- return std::unique_ptr<ASTCFile>(
- new ASTCFile(std::move(header), std::move(blocks)));
-}
-
-base::Optional<Footprint> ASTCFile::GetFootprint() const {
- return Footprint::FromDimensions(int(header_.block_width_), int(header_.block_height_));
-}
-
-std::string ASTCFile::GetFootprintString() const {
- std::stringstream footprint;
- footprint << header_.block_width_ << "x" << header_.block_height_;
- return footprint.str();
-}
-
-const std::string& ASTCFile::GetRawBlockData() const {
- return blocks_;
-}
-
-PhysicalASTCBlock ASTCFile::GetBlock(size_t block_idx) const {
- const size_t sz = PhysicalASTCBlock::kSizeInBytes;
- const size_t offset = PhysicalASTCBlock::kSizeInBytes * block_idx;
- assert(offset <= blocks_.size() - sz);
- return PhysicalASTCBlock(blocks_.substr(offset, sz));
-}
-
-base::Optional<ASTCFile::Header> ASTCFile::ParseHeader(const char* header) {
- size_t offset = 0;
- // TODO(google): Handle endianness.
- const uint32_t magic = ReadVal<uint32_t>(header, offset);
- if (magic != 0x5CA1AB13) {
- return {};
- }
-
- const uint32_t block_width = ReadVal<uint8_t>(header, offset);
- const uint32_t block_height = ReadVal<uint8_t>(header, offset);
- const uint32_t block_depth = ReadVal<uint8_t>(header, offset);
-
- uint32_t width = 0;
- width |= ReadVal<uint8_t>(header, offset);
- width |= ReadVal<uint8_t>(header, offset) << 8;
- width |= ReadVal<uint8_t>(header, offset) << 16;
-
- uint32_t height = 0;
- height |= ReadVal<uint8_t>(header, offset);
- height |= ReadVal<uint8_t>(header, offset) << 8;
- height |= ReadVal<uint8_t>(header, offset) << 16;
-
- uint32_t depth = 0;
- depth |= ReadVal<uint8_t>(header, offset);
- depth |= ReadVal<uint8_t>(header, offset) << 8;
- depth |= ReadVal<uint8_t>(header, offset) << 16;
- assert(offset == kASTCHeaderSize);
-
- return Header(width, height, depth, block_width, block_height, block_depth);
-}
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/astc_file.h b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/astc_file.h
deleted file mode 100644
index c31c2ba7d51..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/astc_file.h
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_DECODER_ASTC_FILE_H_
-#define ASTC_CODEC_DECODER_ASTC_FILE_H_
-
-#include "src/base/optional.h"
-#include "src/decoder/footprint.h"
-#include "src/decoder/physical_astc_block.h"
-
-#include <memory>
-#include <string>
-
-namespace astc_codec {
-
-// A thin wrapper around a .astc file on disk. This class simply reads the ASTC
-// header, and stores the block data in memory.
-class ASTCFile {
- private:
- struct Header {
- Header(size_t width, size_t height, size_t depth, size_t block_width,
- size_t block_height, size_t block_depth)
- : width_(width),
- height_(height),
- depth_(depth),
- block_width_(block_width),
- block_height_(block_height),
- block_depth_(block_depth) {}
-
- size_t width_;
- size_t height_;
- size_t depth_;
-
- size_t block_width_;
- size_t block_height_;
- size_t block_depth_;
- };
-
- ASTCFile(ASTCFile::Header&& header, std::string&& blocks);
-
- public:
- // Load an ASTC file from memory.
- // If loading failed, nullptr is returned and an error string is populated
- // in the error parameter.
- static std::unique_ptr<ASTCFile> LoadFromMemory(const char* data,
- size_t length,
- std::string* error);
-
- // Load an ASTC file from file.
- // If loading failed, nullptr is returned and an error string is populated
- // in the error parameter.
- static std::unique_ptr<ASTCFile> LoadFile(const std::string& path,
- std::string* error);
-
- // Returns the footprint for the file, if it is considered to be a valid
- // footprint.
- base::Optional<Footprint> GetFootprint() const;
-
- // Returns the string of the form "NxM" where N and M are the width and height
- // of the block footprint, respectively.
- std::string GetFootprintString() const;
-
- // Get the raw block data for the astc file.
- const std::string& GetRawBlockData() const;
-
- // Returns the physical block at the associated block index.
- PhysicalASTCBlock GetBlock(size_t block_idx) const;
-
- size_t GetWidth() const { return header_.width_; }
- size_t GetHeight() const { return header_.height_; }
- size_t GetDepth() const { return header_.depth_; }
-
- size_t NumBlocks() const {
- return blocks_.size() / PhysicalASTCBlock::kSizeInBytes;
- }
-
- private:
- static base::Optional<ASTCFile::Header> ParseHeader(const char* header);
-
- const Header header_;
- const std::string blocks_;
-};
-
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_DECODER_ASTC_FILE_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/codec.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/codec.cc
deleted file mode 100644
index baa50b4c762..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/codec.cc
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/codec.h"
-#include "src/base/uint128.h"
-#include "src/decoder/logical_astc_block.h"
-#include "src/decoder/physical_astc_block.h"
-
-#include <cstring>
-
-namespace astc_codec {
-
-namespace {
-static constexpr size_t kBytesPerPixelUNORM8 = 4;
-}
-
-bool DecompressToImage(const uint8_t* astc_data, size_t astc_data_size,
- size_t width, size_t height, Footprint footprint,
- uint8_t* out_buffer, size_t out_buffer_size,
- size_t out_buffer_stride) {
- const size_t block_width = footprint.Width();
- const size_t block_height = footprint.Height();
- assert(block_width != 0);
- assert(block_height != 0);
-
- if (width == 0 || height == 0) {
- return false;
- }
-
- const size_t blocks_wide = (width + block_width - 1) / block_width;
- assert(blocks_wide != 0);
-
- // Check that this buffer has the expected number of blocks.
- const size_t expected_block_count =
- ((width + block_width - 1) / block_width) *
- ((height + block_height - 1) / block_height);
-
- if (astc_data_size % PhysicalASTCBlock::kSizeInBytes != 0 ||
- astc_data_size / PhysicalASTCBlock::kSizeInBytes !=
- expected_block_count) {
- // TODO(google): Expose error?
- return false;
- }
-
- if (kBytesPerPixelUNORM8 * width > out_buffer_stride ||
- out_buffer_stride * height < out_buffer_size) {
- // Output buffer too small.
- return false;
- }
-
- base::UInt128 block;
- static_assert(sizeof(block) == PhysicalASTCBlock::kSizeInBytes,
- "Block size mismatch");
-
- for (size_t i0 = 0; i0 < astc_data_size; i0 += PhysicalASTCBlock::kSizeInBytes) {
- const size_t block_index = i0 / PhysicalASTCBlock::kSizeInBytes;
- const size_t block_x = block_index % blocks_wide;
- const size_t block_y = block_index / blocks_wide;
- block = *(base::UInt128*)(astc_data + i0);
-
- PhysicalASTCBlock physical_block(block);
- auto lb = UnpackLogicalBlock(footprint, physical_block);
- if (!lb) {
- return false;
- }
-
- LogicalASTCBlock logical_block = lb.value();
-
- for (size_t y = 0; y < block_height; ++y) {
- const size_t py = block_height * block_y + y;
- uint8_t* out_row = out_buffer + py * out_buffer_stride;
-
- for (size_t x = 0; x < block_width; ++x) {
- const size_t px = block_width * block_x + x;
-
- // Skip out of bounds.
- if (px >= width || py >= height) {
- continue;
- }
-
- uint8_t* pixel = out_row + px * kBytesPerPixelUNORM8;
- const RgbaColor decoded_color = logical_block.ColorAt(int(x), int(y));
- for (size_t i = 0; i < kBytesPerPixelUNORM8; ++i) {
- pixel[i] = static_cast<uint8_t>(decoded_color[i]);
- }
- }
- }
- }
-
- return true;
-}
-
-bool DecompressToImage(const ASTCFile& file, uint8_t* out_buffer,
- size_t out_buffer_size, size_t out_buffer_stride) {
- base::Optional<Footprint> footprint = file.GetFootprint();
- if (!footprint) {
- return false;
- }
-
- return DecompressToImage(
- reinterpret_cast<const uint8_t*>(file.GetRawBlockData().c_str()),
- file.GetRawBlockData().size(), file.GetWidth(), file.GetHeight(),
- footprint.value(), out_buffer, out_buffer_size, out_buffer_stride);
-}
-
-bool ASTCDecompressToRGBA(const uint8_t* astc_data, size_t astc_data_size,
- size_t width, size_t height, FootprintType footprint,
- uint8_t* out_buffer, size_t out_buffer_size,
- size_t out_buffer_stride) {
- base::Optional<Footprint> footprint_opt =
- Footprint::FromFootprintType(footprint);
- if (!footprint_opt) {
- return false;
- }
-
- return DecompressToImage(astc_data, astc_data_size, width, height,
- footprint_opt.value(), out_buffer, out_buffer_size,
- out_buffer_stride);
-}
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/codec.h b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/codec.h
deleted file mode 100644
index eed601a41b8..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/codec.h
+++ /dev/null
@@ -1,41 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_DECODER_CODEC_H_
-#define ASTC_CODEC_DECODER_CODEC_H_
-
-#include "src/decoder/astc_file.h"
-#include "src/decoder/footprint.h"
-
-#include <string>
-
-namespace astc_codec {
-
-// Decompresses ASTC blocks to an image buffer.
-// Returns true if the decompression succeeded and the out buffer has been
-// filled.
-bool DecompressToImage(const uint8_t* astc_data, size_t astc_data_size,
- size_t width, size_t height, Footprint footprint,
- uint8_t* out_buffer, size_t out_buffer_size,
- size_t out_buffer_stride);
-
-// Decompresses an ASTC file to an image buffer.
-// Returns true if the decompression succeeded and the out buffer has been
-// filled.
-bool DecompressToImage(const ASTCFile& file, uint8_t* out_buffer,
- size_t out_buffer_size, size_t out_buffer_stride);
-
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_DECODER_CODEC_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/endpoint_codec.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/endpoint_codec.cc
deleted file mode 100644
index 10970213a41..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/endpoint_codec.cc
+++ /dev/null
@@ -1,963 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/endpoint_codec.h"
-#include "src/decoder/quantization.h"
-
-#include <algorithm>
-#include <array>
-#include <numeric>
-#include <utility>
-
-namespace astc_codec {
-
-namespace {
-
-template<typename T>
-T Clamp(T value, T min, T max) {
- return value < min ? min : (value > max ? max : value);
-}
-
-// This is the 'blue_contract' function defined in Section C.2.14 of the ASTC
-// specification.
-template<typename ArrayType>
-void BlueContract(ArrayType* const cptr) {
- ArrayType& c = *cptr;
- c[0] = (c[0] + c[2]) >> 1;
- c[1] = (c[1] + c[2]) >> 1;
-}
-
-// Returns the inverse of values in BlueContract, subjected to the constraint
-// that the new values are stored in the range [0, 255].
-template<typename ArrayType>
-ArrayType InvertBlueContract(const ArrayType& c) {
- ArrayType result = c;
- result[0] = Clamp(2 * c[0] - c[2], 0, 255);
- result[1] = Clamp(2 * c[1] - c[2], 0, 255);
- return result;
-}
-
-// This is the 'bit_transfer_signed' function defined in Section C.2.14 of the
-// ASTC specification.
-void BitTransferSigned(int* const a, int* const b) {
- *b >>= 1;
- *b |= *a & 0x80;
- *a >>= 1;
- *a &= 0x3F;
- if ((*a & 0x20) != 0) {
- *a -= 0x40;
- }
-}
-
-// Takes two values, |a| in the range [-32, 31], and |b| in the range [0, 255],
-// and returns the two values in [0, 255] that will reconstruct |a| and |b| when
-// passed to the BitTransferSigned function.
-void InvertBitTransferSigned(int* const a, int* const b) {
- assert(*a >= -32); assert(*a < 32);
- assert(*b >= 0); assert(*b < 256);
-
- if (*a < 0) {
- *a += 0x40;
- }
- *a <<= 1;
- *a |= (*b & 0x80);
- *b <<= 1;
- *b &= 0xff;
-}
-
-template<typename ContainerType>
-void Quantize(ContainerType* const c, size_t max_value) {
- for (auto& x : *c) {
- x = QuantizeCEValueToRange(x, int(max_value));
- }
-}
-
-template<typename ArrayType>
-ArrayType QuantizeColor(const ArrayType& c, size_t max_value) {
- ArrayType result = c;
- Quantize(&result, max_value);
- return result;
-}
-
-template<typename ContainerType>
-void Unquantize(ContainerType* const c, size_t max_value) {
- for (auto& x : *c) {
- x = UnquantizeCEValueFromRange(x, int(max_value));
- }
-}
-
-template<typename ArrayType>
-ArrayType UnquantizeColor(const ArrayType& c, size_t max_value) {
- ArrayType result = c;
- Unquantize(&result, max_value);
- return result;
-}
-
-// Returns the average of the three RGB channels.
-template<typename ContainerType>
-int AverageRGB(const ContainerType& c) {
- // Each channel can be in the range [0, 255], and we need to divide by three.
- // However, we want to round the error properly. Both (x + 1) / 3 and
- // (x + 2) / 3 are relatively imprecise when it comes to rounding, so instead
- // we increase the precision by multiplying our numerator by some arbitrary
- // number. Here, we choose 256 to get 8 additional bits and maintain
- // performance since it turns into a shift rather than a multiply. Our
- // denominator then becomes 3 * 256 = 768.
- return (std::accumulate(c.begin(), c.begin() + 3, 0) * 256 + 384) / 768;
-}
-
-// Returns the sum of squared differences between each element of |a| and |b|,
-// which are assumed to contain the same number of elements.
-template<typename ContainerType>
-const typename ContainerType::value_type SquaredError(
- const ContainerType& a, const ContainerType& b,
- size_t num_channels = std::tuple_size<ContainerType>::value) {
- using ValueTy = typename ContainerType::value_type;
- static_assert(std::is_signed<ValueTy>::value,
- "Value type assumed to be signed to avoid branch below.");
- ValueTy result = ValueTy(0);
- for (size_t i = 0; i < num_channels; ++i) {
- ValueTy error = a[i] - b[i];
- result += error * error;
- }
- return result;
-}
-
-constexpr int MaxValuesForModes(ColorEndpointMode mode_a,
- ColorEndpointMode mode_b) {
- return (NumColorValuesForEndpointMode(mode_a) >
- NumColorValuesForEndpointMode(mode_b))
- ? NumColorValuesForEndpointMode(mode_a)
- : NumColorValuesForEndpointMode(mode_b);
-}
-
-// This function takes the two colors in |endpoint_low| and |endpoint_high| and
-// encodes them into |vals| according to the ASTC spec in section C.2.14. It
-// assumes that the two colors are close enough to grayscale that the encoding
-// should use the ColorEndpointMode kLDRLumaBaseOffset or kLDRLumaDirect. Which
-// one is chosen depends on which produces smaller error for the given
-// quantization value stored in |max_value|
-bool EncodeColorsLuma(const RgbaColor& endpoint_low,
- const RgbaColor& endpoint_high,
- int max_value, ColorEndpointMode* const astc_mode,
- std::vector<int>* const vals) {
- assert(vals->size() ==
- size_t(NumValuesForEncodingMode(EndpointEncodingMode::kDirectLuma)));
- int avg1 = AverageRGB(endpoint_low);
- int avg2 = AverageRGB(endpoint_high);
-
- // For the offset mode, L1 is strictly greater than L2, so if we are using
- // it to encode the color values, we need to swap the weights and
- // endpoints so that the larger of the two is the second endpoint.
- bool needs_weight_swap = false;
- if (avg1 > avg2) {
- needs_weight_swap = true;
- std::swap(avg1, avg2);
- }
- assert(avg1 <= avg2);
-
- // Now, the first endpoint is based on the low-order six bits of the first
- // value, and the high order two bits of the second value. The low order
- // six bits of the second value are used as the (strictly positive) offset
- // from the first value.
- const int offset = std::min(avg2 - avg1, 0x3F);
- const int quant_off_low =
- QuantizeCEValueToRange((avg1 & 0x3F) << 2, max_value);
- const int quant_off_high =
- QuantizeCEValueToRange((avg1 & 0xC0) | offset, max_value);
-
- const int quant_low = QuantizeCEValueToRange(avg1, max_value);
- const int quant_high = QuantizeCEValueToRange(avg2, max_value);
-
- RgbaColor unquant_off_low, unquant_off_high;
- RgbaColor unquant_low, unquant_high;
-
- (*vals)[0] = quant_off_low;
- (*vals)[1] = quant_off_high;
- DecodeColorsForMode(
- *vals, max_value, ColorEndpointMode::kLDRLumaBaseOffset,
- &unquant_off_low, &unquant_off_high);
-
- (*vals)[0] = quant_low;
- (*vals)[1] = quant_high;
- DecodeColorsForMode(*vals, max_value, ColorEndpointMode::kLDRLumaDirect,
- &unquant_low, &unquant_high);
-
- const auto calculate_error =
- [needs_weight_swap, &endpoint_low, &endpoint_high]
- (const RgbaColor& low, const RgbaColor& high) {
- int error = 0;
- if (needs_weight_swap) {
- error += SquaredError(low, endpoint_high);
- error += SquaredError(high, endpoint_low);
- } else {
- error += SquaredError(low, endpoint_low);
- error += SquaredError(high, endpoint_high);
- }
- return error;
- };
-
- const int direct_error = calculate_error(unquant_low, unquant_high);
- const int off_error = calculate_error(unquant_off_low, unquant_off_high);
-
- if (direct_error <= off_error) {
- (*vals)[0] = quant_low;
- (*vals)[1] = quant_high;
- *astc_mode = ColorEndpointMode::kLDRLumaDirect;
- } else {
- (*vals)[0] = quant_off_low;
- (*vals)[1] = quant_off_high;
- *astc_mode = ColorEndpointMode::kLDRLumaBaseOffset;
- }
-
- return needs_weight_swap;
-}
-
-class QuantizedEndpointPair {
- public:
- QuantizedEndpointPair(const RgbaColor& c_low, const RgbaColor& c_high,
- int max_value)
- : orig_low_(c_low),
- orig_high_(c_high),
- quant_low_(QuantizeColor(c_low, max_value)),
- quant_high_(QuantizeColor(c_high, max_value)),
- unquant_low_(UnquantizeColor(quant_low_, max_value)),
- unquant_high_(UnquantizeColor(quant_high_, max_value)) { }
-
- const RgbaColor& QuantizedLow() const { return quant_low_; }
- const RgbaColor& QuantizedHigh() const { return quant_high_; }
-
- const RgbaColor& UnquantizedLow() const { return unquant_low_; }
- const RgbaColor& UnquantizedHigh() const { return unquant_high_; }
-
- const RgbaColor& OriginalLow() const { return orig_low_; }
- const RgbaColor& OriginalHigh() const { return orig_high_; }
-
- private:
- RgbaColor orig_low_;
- RgbaColor orig_high_;
-
- RgbaColor quant_low_;
- RgbaColor quant_high_;
-
- RgbaColor unquant_low_;
- RgbaColor unquant_high_;
-};
-
-class CEEncodingOption {
- public:
- CEEncodingOption() { }
- CEEncodingOption(
- int squared_error, const QuantizedEndpointPair* quantized_endpoints,
- bool swap_endpoints, bool blue_contract, bool use_offset_mode)
- : squared_error_(squared_error),
- quantized_endpoints_(quantized_endpoints),
- swap_endpoints_(swap_endpoints),
- blue_contract_(blue_contract),
- use_offset_mode_(use_offset_mode) { }
-
- // Returns true if able to generate valid |astc_mode| and |vals|. In some
- // instances, such as if the endpoints reprsent a base/offset pair, we may not
- // be able to guarantee blue-contract encoding due to how the base/offset pair
- // are represented and the specifics of the decoding procedure. Similarly,
- // some direct RGBA encodings also may not be able to emit blue-contract modes
- // due to an unlucky combination of channels. In these instances, this
- // function will return false, and all pointers will remain unmodified.
- bool Pack(bool with_alpha, ColorEndpointMode* const astc_mode,
- std::vector<int>* const vals, bool* const needs_weight_swap) const {
- auto unquantized_low = quantized_endpoints_->UnquantizedLow();
- auto unquantized_high = quantized_endpoints_->UnquantizedHigh();
-
- // In offset mode, we do BitTransferSigned before analyzing the values
- // of the endpoints in order to determine whether or not we're going to
- // be using blue-contract mode.
- if (use_offset_mode_) {
- for (size_t i = 0; i < std::tuple_size<RgbaColor>::value; ++i) {
- BitTransferSigned(&unquantized_high[i], &unquantized_low[i]);
- }
- }
-
- // Define variables as outlined in the ASTC spec C.2.14 for the RGB[A]
- // direct and base-offset modes
- int s0 = 0, s1 = 0;
- for (int i = 0; i < 3; ++i) {
- s0 += unquantized_low[i];
- s1 += unquantized_high[i];
- }
-
- // Can we guarantee a blue-contract mode if we want it? In other words,
- // if we swap which endpoint is high and which endpoint is low, can we
- // guarantee that we will hit the corresponding decode path?
- bool swap_vals = false;
- if (use_offset_mode_) {
- if (blue_contract_) {
- swap_vals = s1 >= 0;
- } else {
- swap_vals = s1 < 0;
- }
-
- // In offset mode, we have two different measurements that swap the
- // endpoints prior to encoding, so we don't need to swap them here.
- // If we need to swap them to guarantee a blue-contract mode, then
- // abort and wait until we get the other error measurement.
- if (swap_vals) {
- return false;
- }
- } else {
- if (blue_contract_) {
- // If we want a blue_contract path, but s1 == s0, then swapping the
- // values will have no effect.
- if (s1 == s0) {
- return false;
- }
-
- swap_vals = s1 > s0;
- // If we're encoding blue contract mode directly, then we implicitly
- // swap the endpoints during decode, meaning that we need to take
- // note of that here.
- *needs_weight_swap = !(*needs_weight_swap);
- } else {
- swap_vals = s1 < s0;
- }
- }
-
- const auto* quantized_low = &(quantized_endpoints_->QuantizedLow());
- const auto* quantized_high = &(quantized_endpoints_->QuantizedHigh());
-
- if (swap_vals) {
- assert(!use_offset_mode_);
- std::swap(quantized_low, quantized_high);
- *needs_weight_swap = !(*needs_weight_swap);
- }
-
- (*vals)[0] = quantized_low->at(0);
- (*vals)[1] = quantized_high->at(0);
- (*vals)[2] = quantized_low->at(1);
- (*vals)[3] = quantized_high->at(1);
- (*vals)[4] = quantized_low->at(2);
- (*vals)[5] = quantized_high->at(2);
-
- if (use_offset_mode_) {
- *astc_mode = ColorEndpointMode::kLDRRGBBaseOffset;
- } else {
- *astc_mode = ColorEndpointMode::kLDRRGBDirect;
- }
-
- if (with_alpha) {
- (*vals)[6] = quantized_low->at(3);
- (*vals)[7] = quantized_high->at(3);
-
- if (use_offset_mode_) {
- *astc_mode = ColorEndpointMode::kLDRRGBABaseOffset;
- } else {
- *astc_mode = ColorEndpointMode::kLDRRGBADirect;
- }
- }
-
- // If we swapped them to measure, then they need to be swapped after
- // decoding
- if (swap_endpoints_) {
- *needs_weight_swap = !(*needs_weight_swap);
- }
-
- return true;
- }
-
- bool BlueContract() const { return blue_contract_; }
- int Error() const { return squared_error_; }
-
- private:
- int squared_error_;
- const QuantizedEndpointPair* quantized_endpoints_;
- bool swap_endpoints_;
- bool blue_contract_;
- bool use_offset_mode_;
-};
-
-bool EncodeColorsRGBA(const RgbaColor& endpoint_low_rgba,
- const RgbaColor& endpoint_high_rgba,
- int max_value, bool with_alpha,
- ColorEndpointMode* const astc_mode,
- std::vector<int>* const vals) {
- const size_t num_channels = with_alpha ? std::tuple_size<RgbaColor>::value : 3;
- // The difficulty of encoding into this mode is determining whether or
- // not we'd like to use the 'blue contract' function to reconstruct
- // the endpoints and whether or not we'll be more accurate by using the
- // base/offset color modes instead of quantizing the color channels
- // directly. With that in mind, we:
- // 1. Generate the inverted values for blue-contract and offset modes.
- // 2. Quantize all of the different endpoints.
- // 3. Unquantize each sets and decide which one gives least error
- // 4. Encode the values correspondingly.
-
- // 1. Generate the inverted values for blue-contract and offset modes.
- const auto inv_bc_low = InvertBlueContract(endpoint_low_rgba);
- const auto inv_bc_high = InvertBlueContract(endpoint_high_rgba);
-
- RgbaColor direct_base, direct_offset;
- for (size_t i = 0; i < std::tuple_size<RgbaColor>::value; ++i) {
- direct_base[i] = endpoint_low_rgba[i];
- direct_offset[i] =
- Clamp(endpoint_high_rgba[i] - endpoint_low_rgba[i], -32, 31);
- InvertBitTransferSigned(&direct_offset[i], &direct_base[i]);
- }
-
- RgbaColor inv_bc_base, inv_bc_offset;
- for (size_t i = 0; i < std::tuple_size<RgbaColor>::value; ++i) {
- // Remember, for blue-contract'd offset modes, the base is compared
- // against the second endpoint and not the first.
- inv_bc_base[i] = inv_bc_high[i];
- inv_bc_offset[i] = Clamp(inv_bc_low[i] - inv_bc_high[i], -32, 31);
- InvertBitTransferSigned(&inv_bc_offset[i], &inv_bc_base[i]);
- }
-
- // The order of the endpoints for offset modes may determine how well they
- // approximate the given endpoints. It may be that the quantization value
- // produces more accurate values for the base than the offset or
- // vice/versa. For this reason, we need to generate quantized versions of
- // the endpoints as if they were swapped to see if we get better error
- // out of it.
-
- RgbaColor direct_base_swapped, direct_offset_swapped;
- for (size_t i = 0; i < std::tuple_size<RgbaColor>::value; ++i) {
- direct_base_swapped[i] = endpoint_high_rgba[i];
- direct_offset_swapped[i] =
- Clamp(endpoint_low_rgba[i] - endpoint_high_rgba[i], -32, 31);
- InvertBitTransferSigned(&direct_offset_swapped[i], &direct_base_swapped[i]);
- }
-
- RgbaColor inv_bc_base_swapped, inv_bc_offset_swapped;
- for (size_t i = 0; i < std::tuple_size<RgbaColor>::value; ++i) {
- // Remember, for blue-contract'd offset modes, the base is compared
- // against the second endpoint and not the first. Hence, the swapped
- // version will compare the base against the first endpoint.
- inv_bc_base_swapped[i] = inv_bc_low[i];
- inv_bc_offset_swapped[i] = Clamp(inv_bc_high[i] - inv_bc_low[i], -32, 31);
- InvertBitTransferSigned(&inv_bc_offset_swapped[i], &inv_bc_base_swapped[i]);
- }
-
- // 2. Quantize the endpoints directly.
- const QuantizedEndpointPair direct_quantized(
- endpoint_low_rgba, endpoint_high_rgba, max_value);
- const QuantizedEndpointPair bc_quantized(
- inv_bc_low, inv_bc_high, max_value);
-
- const QuantizedEndpointPair offset_quantized(
- direct_base, direct_offset, max_value);
- const QuantizedEndpointPair bc_offset_quantized(
- inv_bc_base, inv_bc_offset, max_value);
-
- const QuantizedEndpointPair offset_swapped_quantized(
- direct_base_swapped, direct_offset_swapped, max_value);
- const QuantizedEndpointPair bc_offset_swapped_quantized(
- inv_bc_base_swapped, inv_bc_offset_swapped, max_value);
-
- // 3. Unquantize each set and decide which one gives least error.
- std::array<CEEncodingOption, 6> errors;
- auto errors_itr = errors.begin();
-
- // 3.1 regular unquantized error
- {
- const auto rgba_low = direct_quantized.UnquantizedLow();
- const auto rgba_high = direct_quantized.UnquantizedHigh();
-
- const int sq_rgb_error =
- SquaredError(rgba_low, endpoint_low_rgba, num_channels) +
- SquaredError(rgba_high, endpoint_high_rgba, num_channels);
-
- const bool swap_endpoints = false;
- const bool blue_contract = false;
- const bool offset_mode = false;
- *(errors_itr++) = CEEncodingOption(
- sq_rgb_error, &direct_quantized,
- swap_endpoints, blue_contract, offset_mode);
- }
-
- // 3.2 Compute blue-contract'd error.
- {
- auto bc_low = bc_quantized.UnquantizedLow();
- auto bc_high = bc_quantized.UnquantizedHigh();
- BlueContract(&bc_low);
- BlueContract(&bc_high);
-
- const int sq_bc_error =
- SquaredError(bc_low, endpoint_low_rgba, num_channels) +
- SquaredError(bc_high, endpoint_high_rgba, num_channels);
-
- const bool swap_endpoints = false;
- const bool blue_contract = true;
- const bool offset_mode = false;
- *(errors_itr++) = CEEncodingOption(
- sq_bc_error, &bc_quantized,
- swap_endpoints, blue_contract, offset_mode);
- }
-
- // 3.3 Compute base/offset unquantized error.
- const auto compute_base_offset_error =
- [num_channels, &errors_itr, &endpoint_low_rgba, &endpoint_high_rgba]
- (const QuantizedEndpointPair& pair, bool swapped) {
- auto base = pair.UnquantizedLow();
- auto offset = pair.UnquantizedHigh();
-
- for (size_t i = 0; i < num_channels; ++i) {
- BitTransferSigned(&offset[i], &base[i]);
- offset[i] = Clamp(base[i] + offset[i], 0, 255);
- }
-
- int base_offset_error = 0;
- // If we swapped the endpoints going in, then without blue contract
- // we should be comparing the base against the high endpoint.
- if (swapped) {
- base_offset_error =
- SquaredError(base, endpoint_high_rgba, num_channels) +
- SquaredError(offset, endpoint_low_rgba, num_channels);
- } else {
- base_offset_error =
- SquaredError(base, endpoint_low_rgba, num_channels) +
- SquaredError(offset, endpoint_high_rgba, num_channels);
- }
-
- const bool blue_contract = false;
- const bool offset_mode = true;
- *(errors_itr++) = CEEncodingOption(
- base_offset_error, &pair, swapped, blue_contract, offset_mode);
- };
-
- compute_base_offset_error(offset_quantized, false);
-
- // 3.4 Compute base/offset blue-contract error.
- const auto compute_base_offset_blue_contract_error =
- [num_channels, &errors_itr, &endpoint_low_rgba, &endpoint_high_rgba]
- (const QuantizedEndpointPair& pair, bool swapped) {
- auto base = pair.UnquantizedLow();
- auto offset = pair.UnquantizedHigh();
-
- for (size_t i = 0; i < num_channels; ++i) {
- BitTransferSigned(&offset[i], &base[i]);
- offset[i] = Clamp(base[i] + offset[i], 0, 255);
- }
-
- BlueContract(&base);
- BlueContract(&offset);
-
- int sq_bc_error = 0;
- // Remember, for blue-contract'd offset modes, the base is compared
- // against the second endpoint and not the first. So, we compare
- // against the first if we swapped the endpoints going in.
- if (swapped) {
- sq_bc_error =
- SquaredError(base, endpoint_low_rgba, num_channels) +
- SquaredError(offset, endpoint_high_rgba, num_channels);
- } else {
- sq_bc_error =
- SquaredError(base, endpoint_high_rgba, num_channels) +
- SquaredError(offset, endpoint_low_rgba, num_channels);
- }
-
- const bool blue_contract = true;
- const bool offset_mode = true;
- *(errors_itr++) = CEEncodingOption(sq_bc_error, &pair,
- swapped, blue_contract, offset_mode);
- };
-
- compute_base_offset_blue_contract_error(bc_offset_quantized, false);
-
- // 3.5 Compute swapped base/offset error.
- compute_base_offset_error(offset_swapped_quantized, true);
-
- // 3.6 Compute swapped base/offset blue-contract error.
- compute_base_offset_blue_contract_error(
- bc_offset_swapped_quantized, true);
-
- std::sort(errors.begin(), errors.end(),
- [](const CEEncodingOption& a, const CEEncodingOption& b) {
- return a.Error() < b.Error();
- });
-
- // 4. Encode the values correspondingly.
- // For this part, we go through each measurement in order of increasing
- // error. Based on the properties of each measurement, we decide how to
- // best encode the quantized endpoints that produced that error value. If
- // for some reason we cannot encode that metric, then we skip it and move
- // to the next one.
- for (const auto& measurement : errors) {
- bool needs_weight_swap = false;
- if (measurement.Pack(with_alpha, astc_mode, vals, &needs_weight_swap)) {
- // Make sure that if we ask for a blue-contract mode that we get it *and*
- // if we don't ask for it then we don't get it.
- assert(!(measurement.BlueContract() ^
- UsesBlueContract(max_value, *astc_mode, *vals)));
-
- // We encoded what we got.
- return needs_weight_swap;
- }
- }
-
- assert(false && "Shouldn't have reached this point -- some combination of "
- "endpoints should be possible to encode!");
- return false;
-}
-
-} // namespace
-
-////////////////////////////////////////////////////////////////////////////////
-
-bool UsesBlueContract(int max_value, ColorEndpointMode mode,
- const std::vector<int>& vals) {
- assert(vals.size() >= size_t(NumColorValuesForEndpointMode(mode)));
-
- switch (mode) {
- case ColorEndpointMode::kLDRRGBDirect:
- case ColorEndpointMode::kLDRRGBADirect: {
- constexpr int kNumVals = MaxValuesForModes(
- ColorEndpointMode::kLDRRGBDirect, ColorEndpointMode::kLDRRGBADirect);
- std::array<int, kNumVals> v {};
- std::copy(vals.begin(), vals.end(), v.begin());
- Unquantize(&v, max_value);
-
- const int s0 = v[0] + v[2] + v[4];
- const int s1 = v[1] + v[3] + v[5];
-
- return s0 > s1;
- }
-
- case ColorEndpointMode::kLDRRGBBaseOffset:
- case ColorEndpointMode::kLDRRGBABaseOffset: {
- constexpr int kNumVals = MaxValuesForModes(
- ColorEndpointMode::kLDRRGBBaseOffset,
- ColorEndpointMode::kLDRRGBABaseOffset);
- std::array<int, kNumVals> v {};
- std::copy(vals.begin(), vals.end(), v.begin());
- Unquantize(&v, max_value);
-
- BitTransferSigned(&v[1], &v[0]);
- BitTransferSigned(&v[3], &v[2]);
- BitTransferSigned(&v[5], &v[4]);
-
- return v[1] + v[3] + v[5] < 0;
- }
-
- default:
- return false;
- }
-}
-
-bool EncodeColorsForMode(
- const RgbaColor& endpoint_low_rgba, const RgbaColor& endpoint_high_rgba,
- int max_value, EndpointEncodingMode encoding_mode,
- ColorEndpointMode* const astc_mode, std::vector<int>* const vals) {
- bool needs_weight_swap = false;
- vals->resize(NumValuesForEncodingMode(encoding_mode));
-
- switch (encoding_mode) {
- case EndpointEncodingMode::kDirectLuma:
- return EncodeColorsLuma(
- endpoint_low_rgba, endpoint_high_rgba, max_value, astc_mode, vals);
-
- case EndpointEncodingMode::kDirectLumaAlpha: {
- // TODO(google): See if luma-alpha base-offset is better
- const int avg1 = AverageRGB(endpoint_low_rgba);
- const int avg2 = AverageRGB(endpoint_high_rgba);
-
- (*vals)[0] = QuantizeCEValueToRange(avg1, max_value);
- (*vals)[1] = QuantizeCEValueToRange(avg2, max_value);
- (*vals)[2] = QuantizeCEValueToRange(endpoint_low_rgba[3], max_value);
- (*vals)[3] = QuantizeCEValueToRange(endpoint_high_rgba[3], max_value);
- *astc_mode = ColorEndpointMode::kLDRLumaAlphaDirect;
- }
- break;
-
- case EndpointEncodingMode::kBaseScaleRGB:
- case EndpointEncodingMode::kBaseScaleRGBA: {
- RgbaColor base = endpoint_high_rgba;
- RgbaColor scaled = endpoint_low_rgba;
-
- // Similar to luma base-offset, the scaled value is strictly less than
- // the base value here according to the decode procedure. In this case,
- // if the base is larger than the scale then we need to swap.
- int num_channels_ge = 0;
- for (int i = 0; i < 3; ++i) {
- num_channels_ge +=
- static_cast<int>(endpoint_high_rgba[i] >= endpoint_low_rgba[i]);
- }
-
- if (num_channels_ge < 2) {
- needs_weight_swap = true;
- std::swap(base, scaled);
- }
-
- // Since the second endpoint is just a direct copy of the RGB values, we
- // can start by quantizing them.
- const auto q_base = QuantizeColor(base, max_value);
- const auto uq_base = UnquantizeColor(q_base, max_value);
-
- // The first endpoint (scaled) is defined by piecewise multiplying the
- // second endpoint (base) by the scale factor and then dividing by 256.
- // This means that the inverse operation is to first piecewise multiply
- // the first endpoint by 256 and then divide by the unquantized second
- // endpoint. We take the average of each of each of these scale values as
- // our final scale value.
- // TODO(google): Is this the best way to determine the scale factor?
- int num_samples = 0;
- int scale_sum = 0;
- for (int i = 0; i < 3; ++i) {
- int x = uq_base[i];
- if (x != 0) {
- ++num_samples;
- scale_sum += (scaled[i] * 256) / x;
- }
- }
-
- (*vals)[0] = q_base[0];
- (*vals)[1] = q_base[1];
- (*vals)[2] = q_base[2];
- if (num_samples > 0) {
- const int avg_scale = Clamp(scale_sum / num_samples, 0, 255);
- (*vals)[3] = QuantizeCEValueToRange(avg_scale, max_value);
- } else {
- // In this case, all of the base values are zero, so we can use whatever
- // we want as the scale -- it won't affect the outcome.
- (*vals)[3] = max_value;
- }
- *astc_mode = ColorEndpointMode::kLDRRGBBaseScale;
-
- if (encoding_mode == EndpointEncodingMode::kBaseScaleRGBA) {
- (*vals)[4] = QuantizeCEValueToRange(scaled[3], max_value);
- (*vals)[5] = QuantizeCEValueToRange(base[3], max_value);
- *astc_mode = ColorEndpointMode::kLDRRGBBaseScaleTwoA;
- }
- }
- break;
-
- case EndpointEncodingMode::kDirectRGB:
- case EndpointEncodingMode::kDirectRGBA:
- return EncodeColorsRGBA(
- endpoint_low_rgba, endpoint_high_rgba, max_value,
- encoding_mode == EndpointEncodingMode::kDirectRGBA, astc_mode, vals);
-
- default:
- assert(false && "Unimplemented color encoding.");
- }
-
- return needs_weight_swap;
-}
-
-// These decoding procedures follow the code outlined in Section C.2.14 of
-// the ASTC specification.
-void DecodeColorsForMode(const std::vector<int>& vals,
- int max_value, ColorEndpointMode mode,
- RgbaColor* const endpoint_low_rgba,
- RgbaColor* const endpoint_high_rgba) {
- assert(vals.size() >= size_t(NumColorValuesForEndpointMode(mode)));
- switch (mode) {
- case ColorEndpointMode::kLDRLumaDirect: {
- const int l0 = UnquantizeCEValueFromRange(vals[0], max_value);
- const int l1 = UnquantizeCEValueFromRange(vals[1], max_value);
-
- *endpoint_low_rgba = {{ l0, l0, l0, 255 }};
- *endpoint_high_rgba = {{ l1, l1, l1, 255 }};
- }
- break;
-
- case ColorEndpointMode::kLDRLumaBaseOffset: {
- const int v0 = UnquantizeCEValueFromRange(vals[0], max_value);
- const int v1 = UnquantizeCEValueFromRange(vals[1], max_value);
-
- const int l0 = (v0 >> 2) | (v1 & 0xC0);
- const int l1 = std::min(l0 + (v1 & 0x3F), 0xFF);
-
- *endpoint_low_rgba = {{ l0, l0, l0, 255 }};
- *endpoint_high_rgba = {{ l1, l1, l1, 255 }};
- }
- break;
-
- case ColorEndpointMode::kLDRLumaAlphaDirect: {
- constexpr int kNumVals =
- NumColorValuesForEndpointMode(ColorEndpointMode::kLDRLumaAlphaDirect);
-
- std::array<int, kNumVals> v;
- std::copy(vals.begin(), vals.end(), v.begin());
- Unquantize(&v, max_value);
-
- *endpoint_low_rgba = {{ v[0], v[0], v[0], v[2] }};
- *endpoint_high_rgba = {{ v[1], v[1], v[1], v[3] }};
- }
- break;
-
- case ColorEndpointMode::kLDRLumaAlphaBaseOffset: {
- constexpr int kNumVals = NumColorValuesForEndpointMode(
- ColorEndpointMode::kLDRLumaAlphaBaseOffset);
-
- std::array<int, kNumVals> v;
- std::copy(vals.begin(), vals.end(), v.begin());
- Unquantize(&v, max_value);
-
- BitTransferSigned(&v[1], &v[0]);
- BitTransferSigned(&v[3], &v[2]);
-
- *endpoint_low_rgba = {{ v[0], v[0], v[0], v[2] }};
- const int high_luma = v[0] + v[1];
- *endpoint_high_rgba = {{ high_luma, high_luma, high_luma, v[2] + v[3] }};
-
- for (auto& c : *endpoint_low_rgba) { c = Clamp(c, 0, 255); }
- for (auto& c : *endpoint_high_rgba) { c = Clamp(c, 0, 255); }
- }
- break;
-
- case ColorEndpointMode::kLDRRGBBaseScale: {
- constexpr int kNumVals =
- NumColorValuesForEndpointMode(ColorEndpointMode::kLDRRGBBaseScale);
-
- std::array<int, kNumVals> v;
- std::copy(vals.begin(), vals.end(), v.begin());
- Unquantize(&v, max_value);
-
- *endpoint_high_rgba = {{ v[0], v[1], v[2], 255 }};
- for (int i = 0; i < 3; ++i) {
- const int x = endpoint_high_rgba->at(i);
- endpoint_low_rgba->at(i) = (x * v[3]) >> 8;
- }
- endpoint_low_rgba->at(3) = 255;
- }
- break;
-
- case ColorEndpointMode::kLDRRGBDirect: {
- constexpr int kNumVals =
- NumColorValuesForEndpointMode(ColorEndpointMode::kLDRRGBDirect);
-
- std::array<int, kNumVals> v;
- std::copy(vals.begin(), vals.end(), v.begin());
- Unquantize(&v, max_value);
-
- const int s0 = v[0] + v[2] + v[4];
- const int s1 = v[1] + v[3] + v[5];
-
- *endpoint_low_rgba = {{ v[0], v[2], v[4], 255 }};
- *endpoint_high_rgba = {{ v[1], v[3], v[5], 255 }};
-
- if (s1 < s0) {
- std::swap(*endpoint_low_rgba, *endpoint_high_rgba);
- BlueContract(endpoint_low_rgba);
- BlueContract(endpoint_high_rgba);
- }
- }
- break;
-
- case ColorEndpointMode::kLDRRGBBaseOffset: {
- constexpr int kNumVals =
- NumColorValuesForEndpointMode(ColorEndpointMode::kLDRRGBBaseOffset);
-
- std::array<int, kNumVals> v;
- std::copy(vals.begin(), vals.end(), v.begin());
- Unquantize(&v, max_value);
-
- BitTransferSigned(&v[1], &v[0]);
- BitTransferSigned(&v[3], &v[2]);
- BitTransferSigned(&v[5], &v[4]);
-
- *endpoint_low_rgba = {{ v[0], v[2], v[4], 255 }};
- *endpoint_high_rgba = {{ v[0] + v[1], v[2] + v[3], v[4] + v[5], 255 }};
-
- if (v[1] + v[3] + v[5] < 0) {
- std::swap(*endpoint_low_rgba, *endpoint_high_rgba);
- BlueContract(endpoint_low_rgba);
- BlueContract(endpoint_high_rgba);
- }
-
- for (auto& c : *endpoint_low_rgba) { c = Clamp(c, 0, 255); }
- for (auto& c : *endpoint_high_rgba) { c = Clamp(c, 0, 255); }
- }
- break;
-
- case ColorEndpointMode::kLDRRGBBaseScaleTwoA: {
- constexpr int kNumVals = NumColorValuesForEndpointMode(
- ColorEndpointMode::kLDRRGBBaseScaleTwoA);
-
- std::array<int, kNumVals> v;
- std::copy(vals.begin(), vals.end(), v.begin());
- Unquantize(&v, max_value);
-
- // Base
- *endpoint_low_rgba = *endpoint_high_rgba = {{ v[0], v[1], v[2], 255 }};
-
- // Scale
- for (int i = 0; i < 3; ++i) {
- auto& x = endpoint_low_rgba->at(i);
- x = (x * v[3]) >> 8;
- }
-
- // Two A
- endpoint_low_rgba->at(3) = v[4];
- endpoint_high_rgba->at(3) = v[5];
- }
- break;
-
- case ColorEndpointMode::kLDRRGBADirect: {
- constexpr int kNumVals =
- NumColorValuesForEndpointMode(ColorEndpointMode::kLDRRGBADirect);
-
- std::array<int, kNumVals> v;
- std::copy(vals.begin(), vals.end(), v.begin());
- Unquantize(&v, max_value);
-
- const int s0 = v[0] + v[2] + v[4];
- const int s1 = v[1] + v[3] + v[5];
-
- *endpoint_low_rgba = {{ v[0], v[2], v[4], v[6] }};
- *endpoint_high_rgba = {{ v[1], v[3], v[5], v[7] }};
-
- if (s1 < s0) {
- std::swap(*endpoint_low_rgba, *endpoint_high_rgba);
- BlueContract(endpoint_low_rgba);
- BlueContract(endpoint_high_rgba);
- }
- }
- break;
-
- case ColorEndpointMode::kLDRRGBABaseOffset: {
- constexpr int kNumVals =
- NumColorValuesForEndpointMode(ColorEndpointMode::kLDRRGBABaseOffset);
-
- std::array<int, kNumVals> v;
- std::copy(vals.begin(), vals.end(), v.begin());
- Unquantize(&v, max_value);
-
- BitTransferSigned(&v[1], &v[0]);
- BitTransferSigned(&v[3], &v[2]);
- BitTransferSigned(&v[5], &v[4]);
- BitTransferSigned(&v[7], &v[6]);
-
- *endpoint_low_rgba = {{ v[0], v[2], v[4], v[6] }};
- *endpoint_high_rgba = {{
- v[0] + v[1], v[2] + v[3], v[4] + v[5], v[6] + v[7] }};
-
- if (v[1] + v[3] + v[5] < 0) {
- std::swap(*endpoint_low_rgba, *endpoint_high_rgba);
- BlueContract(endpoint_low_rgba);
- BlueContract(endpoint_high_rgba);
- }
-
- for (auto& c : *endpoint_low_rgba) { c = Clamp(c, 0, 255); }
- for (auto& c : *endpoint_high_rgba) { c = Clamp(c, 0, 255); }
- }
- break;
-
- default:
- // Unimplemented color encoding.
- // TODO(google): Is this the correct error handling?
- *endpoint_high_rgba = *endpoint_low_rgba = {{ 0, 0, 0, 0 }};
- }
-}
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/endpoint_codec.h b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/endpoint_codec.h
deleted file mode 100644
index a1232d06ef1..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/endpoint_codec.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_DECODER_ENDPOINT_CODEC_H_
-#define ASTC_CODEC_DECODER_ENDPOINT_CODEC_H_
-
-#include "src/decoder/physical_astc_block.h"
-#include "src/decoder/types.h"
-
-#include <array>
-#include <vector>
-
-namespace astc_codec {
-
-// We use a special distinction for encode modes used to pass to the
-// EncodeColorsForMode function below. The reason is that some of the color
-// modes have sub-modes (like blue-contract) that change whether or not it is
-// useful to encode an endpoint pair using one mode versus another. To avoid
-// this problem, we approach the problem of encoding by specifying some
-// high-level encoding modes. These eventually choose one of the low level
-// ColorEndpointModes from Section C.2.14 when used in EncodeColorsForMode.
-enum class EndpointEncodingMode {
- kDirectLuma,
- kDirectLumaAlpha,
- kBaseScaleRGB,
- kBaseScaleRGBA,
- kDirectRGB,
- kDirectRGBA
-};
-
-// Returns the number of values in the encoded endpoint pair after encoding
-// to a specific high-level encoding mode.
-constexpr int NumValuesForEncodingMode(EndpointEncodingMode mode) {
- return
- mode == EndpointEncodingMode::kDirectLuma ? 2 :
- mode == EndpointEncodingMode::kDirectLumaAlpha ? 4 :
- mode == EndpointEncodingMode::kBaseScaleRGB ? 4 :
- mode == EndpointEncodingMode::kBaseScaleRGBA ? 6 :
- mode == EndpointEncodingMode::kDirectRGB ? 6 : 8;
-}
-
-// Fills |vals| with the quantized endpoint colors values defined in the ASTC
-// specification. The values are quantized to the range [0, max_value]. These
-// quantization limits can be obtained by querying the associated functions in
-// integer_sequence_codec. The returned |astc_mode| will be the ASTC mode used
-// to encode the resulting sequence.
-//
-// The |encoding_mode| is used to determine the way that we encode the values.
-// Each encoding mode is used to determine which ASTC mode best corresponds
-// to the pair of endpoints. It is a necessary hint to the encoding function
-// in order to process the endpoints. Each encoding mode gurantees a certain
-// number of values generated per endpoints.
-//
-// The return value will be true if the endpoints have been switched in order to
-// reap the most benefit from the way the hardware decodes the given mode. In
-// this case, the associated weights that interpolate this color must also be
-// switched. In other words, for each w, it should change to 64 - w.
-bool EncodeColorsForMode(
- const RgbaColor& endpoint_low_rgba, const RgbaColor& endpoint_high_rgba,
- int max_value, EndpointEncodingMode encoding_mode,
- ColorEndpointMode* astc_mode, std::vector<int>* vals);
-
-// Decodes the color values quantized to the range [0, max_value] into RGBA
-// endpoints for the given mode. This function is the inverse of
-// EncodeColorsForMode -- see that function for details. This function should
-// work on all LDR endpoint modes, but no HDR modes.
-void DecodeColorsForMode(const std::vector<int>& vals,
- int max_value, ColorEndpointMode mode,
- RgbaColor* endpoint_low_rgba,
- RgbaColor* endpoint_high_rgba);
-
-// Returns true if the quantized |vals| in the range [0, max_value] use the
-// 'blue_contract' modification during decoding for the given |mode|.
-bool UsesBlueContract(int max_value, ColorEndpointMode mode,
- const std::vector<int>& vals);
-
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_DECODER_ENDPOINT_CODEC_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/footprint.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/footprint.cc
deleted file mode 100644
index e4f076e3ae7..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/footprint.cc
+++ /dev/null
@@ -1,162 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/footprint.h"
-#include "src/base/string_utils.h"
-
-#include <map>
-#include <string>
-#include <utility>
-#include <vector>
-
-namespace astc_codec {
-
-namespace {
-
-// Encodes the width and height into an integer so that we can use a switch
-// statement instead of a costly lookup map.
-constexpr int EncodeDims(int width, int height) {
- return (width << 16) | height;
-}
-
-} // namespace
-
-base::Optional<FootprintType>
-Footprint::GetValidFootprintForDimensions(int width, int height) {
- switch (EncodeDims(width, height)) {
- case EncodeDims(4, 4): return FootprintType::k4x4;
- case EncodeDims(5, 4): return FootprintType::k5x4;
- case EncodeDims(5, 5): return FootprintType::k5x5;
- case EncodeDims(6, 5): return FootprintType::k6x5;
- case EncodeDims(6, 6): return FootprintType::k6x6;
- case EncodeDims(8, 5): return FootprintType::k8x5;
- case EncodeDims(8, 6): return FootprintType::k8x6;
- case EncodeDims(8, 8): return FootprintType::k8x8;
- case EncodeDims(10, 5): return FootprintType::k10x5;
- case EncodeDims(10, 6): return FootprintType::k10x6;
- case EncodeDims(10, 8): return FootprintType::k10x8;
- case EncodeDims(10, 10): return FootprintType::k10x10;
- case EncodeDims(12, 10): return FootprintType::k12x10;
- case EncodeDims(12, 12): return FootprintType::k12x12;
- default: return {};
- }
-}
-
-int Footprint::GetWidthForFootprint(FootprintType footprint) {
- switch (footprint) {
- case FootprintType::k4x4: return 4;
- case FootprintType::k5x4: return 5;
- case FootprintType::k5x5: return 5;
- case FootprintType::k6x5: return 6;
- case FootprintType::k6x6: return 6;
- case FootprintType::k8x5: return 8;
- case FootprintType::k8x6: return 8;
- case FootprintType::k10x5: return 10;
- case FootprintType::k10x6: return 10;
- case FootprintType::k8x8: return 8;
- case FootprintType::k10x8: return 10;
- case FootprintType::k10x10: return 10;
- case FootprintType::k12x10: return 12;
- case FootprintType::k12x12: return 12;
- default:
- assert(false);
- return -1;
- }
-}
-
-int Footprint::GetHeightForFootprint(FootprintType footprint) {
- switch (footprint) {
- case FootprintType::k4x4: return 4;
- case FootprintType::k5x4: return 4;
- case FootprintType::k5x5: return 5;
- case FootprintType::k6x5: return 5;
- case FootprintType::k6x6: return 6;
- case FootprintType::k8x5: return 5;
- case FootprintType::k8x6: return 6;
- case FootprintType::k10x5: return 5;
- case FootprintType::k10x6: return 6;
- case FootprintType::k8x8: return 8;
- case FootprintType::k10x8: return 8;
- case FootprintType::k10x10: return 10;
- case FootprintType::k12x10: return 10;
- case FootprintType::k12x12: return 12;
- default:
- assert(false);
- return -1;
- }
-}
-
-Footprint::Footprint(FootprintType footprint)
- : footprint_(footprint), width_(GetWidthForFootprint(footprint)),
- height_(GetHeightForFootprint(footprint)) { }
-
-////////////////////////////////////////////////////////////////////////////////
-
-base::Optional<Footprint> Footprint::Parse(const char* footprint_string) {
- assert(footprint_string && footprint_string[0] != '\0');
-
- std::vector<std::string> dimension_strings;
- base::Split(footprint_string, "x", [&dimension_strings](std::string&& s) {
- dimension_strings.push_back(std::move(s));
- });
-
- if (dimension_strings.size() != 2) {
- assert(false && "Invalid format for footprint");
- return {};
- }
-
- const int width = base::ParseInt32(dimension_strings[0].c_str(), 0);
- const int height = base::ParseInt32(dimension_strings[1].c_str(), 0);
-
- assert(width > 0 && height > 0 && "Invalid width or height.");
-
- return FromDimensions(width, height);
-}
-
-base::Optional<Footprint> Footprint::FromDimensions(int width, int height) {
- base::Optional<FootprintType> valid_footprint =
- GetValidFootprintForDimensions(width, height);
- if (valid_footprint) {
- return Footprint(valid_footprint.value());
- } else {
- return {};
- }
-}
-
-// Returns a Footprint for the given FootprintType.
-base::Optional<Footprint> Footprint::FromFootprintType(FootprintType type) {
- if (type >= FootprintType::k4x4 && type < FootprintType::kCount) {
- return Footprint(type);
- } else {
- return {};
- }
-}
-
-size_t Footprint::StorageRequirements(int width, int height) const {
- const int blocks_wide = (width + width_ - 1) / width_;
- const int blocks_high = (height + height_ - 1) / height_;
-
- constexpr size_t kASTCBlockSizeInBytes = 16;
- return blocks_wide * blocks_high * kASTCBlockSizeInBytes;
-}
-
-// Returns bits/pixel for a given footprint.
-float Footprint::Bitrate() const {
- const int kASTCBlockBitCount = 128;
- const int footprint_pixel_count = width_ * height_;
- return static_cast<float>(kASTCBlockBitCount) /
- static_cast<float>(footprint_pixel_count);
-}
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/footprint.h b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/footprint.h
deleted file mode 100644
index 47302cc3950..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/footprint.h
+++ /dev/null
@@ -1,106 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_DECODER_FOOTPRINT_H_
-#define ASTC_CODEC_DECODER_FOOTPRINT_H_
-
-#include "include/astc-codec/astc-codec.h"
-#include "src/base/optional.h"
-
-#include <cstddef>
-
-namespace astc_codec {
-
-// An ASTC texture can be encoded with varying choices in block size. A set of
-// predefined block sizes are specified in the ASTC specification. These are
-// referred to in the literature as "footprints" available to an encoder when
-// constructing an ASTC bitstream. This class provides various utility functions
-// for interacting with these footprints.
-class Footprint {
- public:
- Footprint() = delete;
- Footprint(const Footprint& footprint) = default;
-
- // Return the footprint type.
- FootprintType Type() const { return footprint_; }
-
- // Return logical descriptions of the dimensions.
- int Width() const { return width_; }
- int Height() const { return height_; }
-
- // Returns the number of pixels for a block with this footprint.
- int NumPixels() const { return width_ * height_; }
-
- // Returns the number of bytes needed to store an ASTC encoded image with the
- // given width and height.
- size_t StorageRequirements(int width, int height) const;
-
- // Returns the number of bits used per pixel.
- float Bitrate() const;
-
- static constexpr int NumValidFootprints() {
- return static_cast<int>(FootprintType::kCount);
- }
-
- bool operator==(const Footprint& other) const {
- return footprint_ == other.footprint_;
- }
-
- // These are the valid and available ASTC footprints.
- static Footprint Get4x4() { return Footprint(FootprintType::k4x4); }
- static Footprint Get5x4() { return Footprint(FootprintType::k5x4); }
- static Footprint Get5x5() { return Footprint(FootprintType::k5x5); }
- static Footprint Get6x5() { return Footprint(FootprintType::k6x5); }
- static Footprint Get6x6() { return Footprint(FootprintType::k6x6); }
- static Footprint Get8x5() { return Footprint(FootprintType::k8x5); }
- static Footprint Get8x6() { return Footprint(FootprintType::k8x6); }
- static Footprint Get8x8() { return Footprint(FootprintType::k8x8); }
- static Footprint Get10x5() { return Footprint(FootprintType::k10x5); }
- static Footprint Get10x6() { return Footprint(FootprintType::k10x6); }
- static Footprint Get10x8() { return Footprint(FootprintType::k10x8); }
- static Footprint Get10x10() { return Footprint(FootprintType::k10x10); }
- static Footprint Get12x10() { return Footprint(FootprintType::k12x10); }
- static Footprint Get12x12() { return Footprint(FootprintType::k12x12); }
-
- // Constructs a footprint from a string of the form "NxM", or no value if
- // width and height are not a valid footprint.
- static base::Optional<Footprint> Parse(const char* footprint_string);
-
- // Returns a footprint corresponding to a block of the given width and height,
- // or no value if it does not.
- static base::Optional<Footprint> FromDimensions(int width, int height);
-
- // Returns a Footprint for the given FootprintType.
- static base::Optional<Footprint> FromFootprintType(FootprintType type);
-
- private:
- // The only constructor.
- explicit Footprint(FootprintType footprint);
-
- // Returns the valid footprint for the width and height if possible.
- static base::Optional<FootprintType> GetValidFootprintForDimensions(
- int width, int height);
-
- // Returns the associated dimension for the given valid footprint.
- static int GetWidthForFootprint(FootprintType footprint);
- static int GetHeightForFootprint(FootprintType footprint);
-
- FootprintType footprint_;
- int width_;
- int height_;
-};
-
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_DECODER_FOOTPRINT_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/integer_sequence_codec.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/integer_sequence_codec.cc
deleted file mode 100644
index cb17773e155..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/integer_sequence_codec.cc
+++ /dev/null
@@ -1,574 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/integer_sequence_codec.h"
-#include "src/base/math_utils.h"
-#include "src/base/utils.h"
-
-#include <algorithm>
-#include <iostream>
-
-namespace astc_codec {
-
-namespace {
-
-// Tables of trit and quint encodings generated by the implementation in
-// http://cs/aosp-master/external/skia/src/utils/SkTextureCompressor_ASTC.cpp
-//
-// These tables are used to decode the blocks of values encoded using the ASTC
-// integer sequence encoding. The theory is that five trits (values that can
-// take any number in the range [0, 2]) can take on a total of 3^5 = 243 total
-// values, which can be stored in eight bits. These eight bits are used to
-// decode the five trits based on the ASTC specification in Section C.2.12.
-// For simplicity, we have stored a look-up table here so that we don't need
-// to implement the decoding logic. Similarly, seven bits are used to decode
-// three quints (since 5^3 = 125 < 128).
-static const std::array<int, 5> kTritEncodings[256] = {
- {{ 0, 0, 0, 0, 0 }}, {{ 1, 0, 0, 0, 0 }}, {{ 2, 0, 0, 0, 0 }},
- {{ 0, 0, 2, 0, 0 }}, {{ 0, 1, 0, 0, 0 }}, {{ 1, 1, 0, 0, 0 }},
- {{ 2, 1, 0, 0, 0 }}, {{ 1, 0, 2, 0, 0 }}, {{ 0, 2, 0, 0, 0 }},
- {{ 1, 2, 0, 0, 0 }}, {{ 2, 2, 0, 0, 0 }}, {{ 2, 0, 2, 0, 0 }},
- {{ 0, 2, 2, 0, 0 }}, {{ 1, 2, 2, 0, 0 }}, {{ 2, 2, 2, 0, 0 }},
- {{ 2, 0, 2, 0, 0 }}, {{ 0, 0, 1, 0, 0 }}, {{ 1, 0, 1, 0, 0 }},
- {{ 2, 0, 1, 0, 0 }}, {{ 0, 1, 2, 0, 0 }}, {{ 0, 1, 1, 0, 0 }},
- {{ 1, 1, 1, 0, 0 }}, {{ 2, 1, 1, 0, 0 }}, {{ 1, 1, 2, 0, 0 }},
- {{ 0, 2, 1, 0, 0 }}, {{ 1, 2, 1, 0, 0 }}, {{ 2, 2, 1, 0, 0 }},
- {{ 2, 1, 2, 0, 0 }}, {{ 0, 0, 0, 2, 2 }}, {{ 1, 0, 0, 2, 2 }},
- {{ 2, 0, 0, 2, 2 }}, {{ 0, 0, 2, 2, 2 }}, {{ 0, 0, 0, 1, 0 }},
- {{ 1, 0, 0, 1, 0 }}, {{ 2, 0, 0, 1, 0 }}, {{ 0, 0, 2, 1, 0 }},
- {{ 0, 1, 0, 1, 0 }}, {{ 1, 1, 0, 1, 0 }}, {{ 2, 1, 0, 1, 0 }},
- {{ 1, 0, 2, 1, 0 }}, {{ 0, 2, 0, 1, 0 }}, {{ 1, 2, 0, 1, 0 }},
- {{ 2, 2, 0, 1, 0 }}, {{ 2, 0, 2, 1, 0 }}, {{ 0, 2, 2, 1, 0 }},
- {{ 1, 2, 2, 1, 0 }}, {{ 2, 2, 2, 1, 0 }}, {{ 2, 0, 2, 1, 0 }},
- {{ 0, 0, 1, 1, 0 }}, {{ 1, 0, 1, 1, 0 }}, {{ 2, 0, 1, 1, 0 }},
- {{ 0, 1, 2, 1, 0 }}, {{ 0, 1, 1, 1, 0 }}, {{ 1, 1, 1, 1, 0 }},
- {{ 2, 1, 1, 1, 0 }}, {{ 1, 1, 2, 1, 0 }}, {{ 0, 2, 1, 1, 0 }},
- {{ 1, 2, 1, 1, 0 }}, {{ 2, 2, 1, 1, 0 }}, {{ 2, 1, 2, 1, 0 }},
- {{ 0, 1, 0, 2, 2 }}, {{ 1, 1, 0, 2, 2 }}, {{ 2, 1, 0, 2, 2 }},
- {{ 1, 0, 2, 2, 2 }}, {{ 0, 0, 0, 2, 0 }}, {{ 1, 0, 0, 2, 0 }},
- {{ 2, 0, 0, 2, 0 }}, {{ 0, 0, 2, 2, 0 }}, {{ 0, 1, 0, 2, 0 }},
- {{ 1, 1, 0, 2, 0 }}, {{ 2, 1, 0, 2, 0 }}, {{ 1, 0, 2, 2, 0 }},
- {{ 0, 2, 0, 2, 0 }}, {{ 1, 2, 0, 2, 0 }}, {{ 2, 2, 0, 2, 0 }},
- {{ 2, 0, 2, 2, 0 }}, {{ 0, 2, 2, 2, 0 }}, {{ 1, 2, 2, 2, 0 }},
- {{ 2, 2, 2, 2, 0 }}, {{ 2, 0, 2, 2, 0 }}, {{ 0, 0, 1, 2, 0 }},
- {{ 1, 0, 1, 2, 0 }}, {{ 2, 0, 1, 2, 0 }}, {{ 0, 1, 2, 2, 0 }},
- {{ 0, 1, 1, 2, 0 }}, {{ 1, 1, 1, 2, 0 }}, {{ 2, 1, 1, 2, 0 }},
- {{ 1, 1, 2, 2, 0 }}, {{ 0, 2, 1, 2, 0 }}, {{ 1, 2, 1, 2, 0 }},
- {{ 2, 2, 1, 2, 0 }}, {{ 2, 1, 2, 2, 0 }}, {{ 0, 2, 0, 2, 2 }},
- {{ 1, 2, 0, 2, 2 }}, {{ 2, 2, 0, 2, 2 }}, {{ 2, 0, 2, 2, 2 }},
- {{ 0, 0, 0, 0, 2 }}, {{ 1, 0, 0, 0, 2 }}, {{ 2, 0, 0, 0, 2 }},
- {{ 0, 0, 2, 0, 2 }}, {{ 0, 1, 0, 0, 2 }}, {{ 1, 1, 0, 0, 2 }},
- {{ 2, 1, 0, 0, 2 }}, {{ 1, 0, 2, 0, 2 }}, {{ 0, 2, 0, 0, 2 }},
- {{ 1, 2, 0, 0, 2 }}, {{ 2, 2, 0, 0, 2 }}, {{ 2, 0, 2, 0, 2 }},
- {{ 0, 2, 2, 0, 2 }}, {{ 1, 2, 2, 0, 2 }}, {{ 2, 2, 2, 0, 2 }},
- {{ 2, 0, 2, 0, 2 }}, {{ 0, 0, 1, 0, 2 }}, {{ 1, 0, 1, 0, 2 }},
- {{ 2, 0, 1, 0, 2 }}, {{ 0, 1, 2, 0, 2 }}, {{ 0, 1, 1, 0, 2 }},
- {{ 1, 1, 1, 0, 2 }}, {{ 2, 1, 1, 0, 2 }}, {{ 1, 1, 2, 0, 2 }},
- {{ 0, 2, 1, 0, 2 }}, {{ 1, 2, 1, 0, 2 }}, {{ 2, 2, 1, 0, 2 }},
- {{ 2, 1, 2, 0, 2 }}, {{ 0, 2, 2, 2, 2 }}, {{ 1, 2, 2, 2, 2 }},
- {{ 2, 2, 2, 2, 2 }}, {{ 2, 0, 2, 2, 2 }}, {{ 0, 0, 0, 0, 1 }},
- {{ 1, 0, 0, 0, 1 }}, {{ 2, 0, 0, 0, 1 }}, {{ 0, 0, 2, 0, 1 }},
- {{ 0, 1, 0, 0, 1 }}, {{ 1, 1, 0, 0, 1 }}, {{ 2, 1, 0, 0, 1 }},
- {{ 1, 0, 2, 0, 1 }}, {{ 0, 2, 0, 0, 1 }}, {{ 1, 2, 0, 0, 1 }},
- {{ 2, 2, 0, 0, 1 }}, {{ 2, 0, 2, 0, 1 }}, {{ 0, 2, 2, 0, 1 }},
- {{ 1, 2, 2, 0, 1 }}, {{ 2, 2, 2, 0, 1 }}, {{ 2, 0, 2, 0, 1 }},
- {{ 0, 0, 1, 0, 1 }}, {{ 1, 0, 1, 0, 1 }}, {{ 2, 0, 1, 0, 1 }},
- {{ 0, 1, 2, 0, 1 }}, {{ 0, 1, 1, 0, 1 }}, {{ 1, 1, 1, 0, 1 }},
- {{ 2, 1, 1, 0, 1 }}, {{ 1, 1, 2, 0, 1 }}, {{ 0, 2, 1, 0, 1 }},
- {{ 1, 2, 1, 0, 1 }}, {{ 2, 2, 1, 0, 1 }}, {{ 2, 1, 2, 0, 1 }},
- {{ 0, 0, 1, 2, 2 }}, {{ 1, 0, 1, 2, 2 }}, {{ 2, 0, 1, 2, 2 }},
- {{ 0, 1, 2, 2, 2 }}, {{ 0, 0, 0, 1, 1 }}, {{ 1, 0, 0, 1, 1 }},
- {{ 2, 0, 0, 1, 1 }}, {{ 0, 0, 2, 1, 1 }}, {{ 0, 1, 0, 1, 1 }},
- {{ 1, 1, 0, 1, 1 }}, {{ 2, 1, 0, 1, 1 }}, {{ 1, 0, 2, 1, 1 }},
- {{ 0, 2, 0, 1, 1 }}, {{ 1, 2, 0, 1, 1 }}, {{ 2, 2, 0, 1, 1 }},
- {{ 2, 0, 2, 1, 1 }}, {{ 0, 2, 2, 1, 1 }}, {{ 1, 2, 2, 1, 1 }},
- {{ 2, 2, 2, 1, 1 }}, {{ 2, 0, 2, 1, 1 }}, {{ 0, 0, 1, 1, 1 }},
- {{ 1, 0, 1, 1, 1 }}, {{ 2, 0, 1, 1, 1 }}, {{ 0, 1, 2, 1, 1 }},
- {{ 0, 1, 1, 1, 1 }}, {{ 1, 1, 1, 1, 1 }}, {{ 2, 1, 1, 1, 1 }},
- {{ 1, 1, 2, 1, 1 }}, {{ 0, 2, 1, 1, 1 }}, {{ 1, 2, 1, 1, 1 }},
- {{ 2, 2, 1, 1, 1 }}, {{ 2, 1, 2, 1, 1 }}, {{ 0, 1, 1, 2, 2 }},
- {{ 1, 1, 1, 2, 2 }}, {{ 2, 1, 1, 2, 2 }}, {{ 1, 1, 2, 2, 2 }},
- {{ 0, 0, 0, 2, 1 }}, {{ 1, 0, 0, 2, 1 }}, {{ 2, 0, 0, 2, 1 }},
- {{ 0, 0, 2, 2, 1 }}, {{ 0, 1, 0, 2, 1 }}, {{ 1, 1, 0, 2, 1 }},
- {{ 2, 1, 0, 2, 1 }}, {{ 1, 0, 2, 2, 1 }}, {{ 0, 2, 0, 2, 1 }},
- {{ 1, 2, 0, 2, 1 }}, {{ 2, 2, 0, 2, 1 }}, {{ 2, 0, 2, 2, 1 }},
- {{ 0, 2, 2, 2, 1 }}, {{ 1, 2, 2, 2, 1 }}, {{ 2, 2, 2, 2, 1 }},
- {{ 2, 0, 2, 2, 1 }}, {{ 0, 0, 1, 2, 1 }}, {{ 1, 0, 1, 2, 1 }},
- {{ 2, 0, 1, 2, 1 }}, {{ 0, 1, 2, 2, 1 }}, {{ 0, 1, 1, 2, 1 }},
- {{ 1, 1, 1, 2, 1 }}, {{ 2, 1, 1, 2, 1 }}, {{ 1, 1, 2, 2, 1 }},
- {{ 0, 2, 1, 2, 1 }}, {{ 1, 2, 1, 2, 1 }}, {{ 2, 2, 1, 2, 1 }},
- {{ 2, 1, 2, 2, 1 }}, {{ 0, 2, 1, 2, 2 }}, {{ 1, 2, 1, 2, 2 }},
- {{ 2, 2, 1, 2, 2 }}, {{ 2, 1, 2, 2, 2 }}, {{ 0, 0, 0, 1, 2 }},
- {{ 1, 0, 0, 1, 2 }}, {{ 2, 0, 0, 1, 2 }}, {{ 0, 0, 2, 1, 2 }},
- {{ 0, 1, 0, 1, 2 }}, {{ 1, 1, 0, 1, 2 }}, {{ 2, 1, 0, 1, 2 }},
- {{ 1, 0, 2, 1, 2 }}, {{ 0, 2, 0, 1, 2 }}, {{ 1, 2, 0, 1, 2 }},
- {{ 2, 2, 0, 1, 2 }}, {{ 2, 0, 2, 1, 2 }}, {{ 0, 2, 2, 1, 2 }},
- {{ 1, 2, 2, 1, 2 }}, {{ 2, 2, 2, 1, 2 }}, {{ 2, 0, 2, 1, 2 }},
- {{ 0, 0, 1, 1, 2 }}, {{ 1, 0, 1, 1, 2 }}, {{ 2, 0, 1, 1, 2 }},
- {{ 0, 1, 2, 1, 2 }}, {{ 0, 1, 1, 1, 2 }}, {{ 1, 1, 1, 1, 2 }},
- {{ 2, 1, 1, 1, 2 }}, {{ 1, 1, 2, 1, 2 }}, {{ 0, 2, 1, 1, 2 }},
- {{ 1, 2, 1, 1, 2 }}, {{ 2, 2, 1, 1, 2 }}, {{ 2, 1, 2, 1, 2 }},
- {{ 0, 2, 2, 2, 2 }}, {{ 1, 2, 2, 2, 2 }}, {{ 2, 2, 2, 2, 2 }},
- {{ 2, 1, 2, 2, 2 }}
-};
-
-static const std::array<int, 3> kQuintEncodings[128] = {
- {{ 0, 0, 0 }}, {{ 1, 0, 0 }}, {{ 2, 0, 0 }}, {{ 3, 0, 0 }}, {{ 4, 0, 0 }},
- {{ 0, 4, 0 }}, {{ 4, 4, 0 }}, {{ 4, 4, 4 }}, {{ 0, 1, 0 }}, {{ 1, 1, 0 }},
- {{ 2, 1, 0 }}, {{ 3, 1, 0 }}, {{ 4, 1, 0 }}, {{ 1, 4, 0 }}, {{ 4, 4, 1 }},
- {{ 4, 4, 4 }}, {{ 0, 2, 0 }}, {{ 1, 2, 0 }}, {{ 2, 2, 0 }}, {{ 3, 2, 0 }},
- {{ 4, 2, 0 }}, {{ 2, 4, 0 }}, {{ 4, 4, 2 }}, {{ 4, 4, 4 }}, {{ 0, 3, 0 }},
- {{ 1, 3, 0 }}, {{ 2, 3, 0 }}, {{ 3, 3, 0 }}, {{ 4, 3, 0 }}, {{ 3, 4, 0 }},
- {{ 4, 4, 3 }}, {{ 4, 4, 4 }}, {{ 0, 0, 1 }}, {{ 1, 0, 1 }}, {{ 2, 0, 1 }},
- {{ 3, 0, 1 }}, {{ 4, 0, 1 }}, {{ 0, 4, 1 }}, {{ 4, 0, 4 }}, {{ 0, 4, 4 }},
- {{ 0, 1, 1 }}, {{ 1, 1, 1 }}, {{ 2, 1, 1 }}, {{ 3, 1, 1 }}, {{ 4, 1, 1 }},
- {{ 1, 4, 1 }}, {{ 4, 1, 4 }}, {{ 1, 4, 4 }}, {{ 0, 2, 1 }}, {{ 1, 2, 1 }},
- {{ 2, 2, 1 }}, {{ 3, 2, 1 }}, {{ 4, 2, 1 }}, {{ 2, 4, 1 }}, {{ 4, 2, 4 }},
- {{ 2, 4, 4 }}, {{ 0, 3, 1 }}, {{ 1, 3, 1 }}, {{ 2, 3, 1 }}, {{ 3, 3, 1 }},
- {{ 4, 3, 1 }}, {{ 3, 4, 1 }}, {{ 4, 3, 4 }}, {{ 3, 4, 4 }}, {{ 0, 0, 2 }},
- {{ 1, 0, 2 }}, {{ 2, 0, 2 }}, {{ 3, 0, 2 }}, {{ 4, 0, 2 }}, {{ 0, 4, 2 }},
- {{ 2, 0, 4 }}, {{ 3, 0, 4 }}, {{ 0, 1, 2 }}, {{ 1, 1, 2 }}, {{ 2, 1, 2 }},
- {{ 3, 1, 2 }}, {{ 4, 1, 2 }}, {{ 1, 4, 2 }}, {{ 2, 1, 4 }}, {{ 3, 1, 4 }},
- {{ 0, 2, 2 }}, {{ 1, 2, 2 }}, {{ 2, 2, 2 }}, {{ 3, 2, 2 }}, {{ 4, 2, 2 }},
- {{ 2, 4, 2 }}, {{ 2, 2, 4 }}, {{ 3, 2, 4 }}, {{ 0, 3, 2 }}, {{ 1, 3, 2 }},
- {{ 2, 3, 2 }}, {{ 3, 3, 2 }}, {{ 4, 3, 2 }}, {{ 3, 4, 2 }}, {{ 2, 3, 4 }},
- {{ 3, 3, 4 }}, {{ 0, 0, 3 }}, {{ 1, 0, 3 }}, {{ 2, 0, 3 }}, {{ 3, 0, 3 }},
- {{ 4, 0, 3 }}, {{ 0, 4, 3 }}, {{ 0, 0, 4 }}, {{ 1, 0, 4 }}, {{ 0, 1, 3 }},
- {{ 1, 1, 3 }}, {{ 2, 1, 3 }}, {{ 3, 1, 3 }}, {{ 4, 1, 3 }}, {{ 1, 4, 3 }},
- {{ 0, 1, 4 }}, {{ 1, 1, 4 }}, {{ 0, 2, 3 }}, {{ 1, 2, 3 }}, {{ 2, 2, 3 }},
- {{ 3, 2, 3 }}, {{ 4, 2, 3 }}, {{ 2, 4, 3 }}, {{ 0, 2, 4 }}, {{ 1, 2, 4 }},
- {{ 0, 3, 3 }}, {{ 1, 3, 3 }}, {{ 2, 3, 3 }}, {{ 3, 3, 3 }}, {{ 4, 3, 3 }},
- {{ 3, 4, 3 }}, {{ 0, 3, 4 }}, {{ 1, 3, 4 }}
-};
-
-// A cached table containing the max ranges for values encoded using ASTC's
-// Bounded Integer Sequence Encoding. These are the numbers between 1 and 255
-// that can be represented exactly as a number in the ranges
-// [0, 2^k), [0, 3 * 2^k), and [0, 5 * 2^k).
-static const std::array<int, kNumPossibleRanges> kMaxRanges = []() {
- std::array<int, kNumPossibleRanges> ranges;
-
- // Initialize the table that we need for determining value encodings.
- auto next_max_range = ranges.begin();
- auto add_val = [&next_max_range](int val) {
- if (val <= 0 || (1 << kLog2MaxRangeForBits) <= val) {
- return;
- }
-
- *(next_max_range++) = val;
- };
-
- for (int i = 0; i <= kLog2MaxRangeForBits; ++i) {
- add_val(3 * (1 << i) - 1);
- add_val(5 * (1 << i) - 1);
- add_val((1 << i) - 1);
- }
-
- assert(std::distance(next_max_range, ranges.end()) == 0);
- std::sort(ranges.begin(), ranges.end());
- return ranges;
-}();
-
-// Returns true if x == 0 or if x is a power of two. This function is only used
-// in the GetCountsForRange function, where we need to have it return true
-// on zero since we can have single trit/quint ISE encodings according to
-// Table C.2.7.
-template<typename T,
- typename std::enable_if<std::is_integral<T>::value, T>::type = 0>
-inline constexpr bool IsPow2(T x) { return (x & (x - 1)) == 0; }
-
-// For the ISE block encoding, these arrays determine how many bits are
-// used after each value to store the interleaved quint/trit block.
-const int kInterleavedQuintBits[3] = { 3, 2, 2 };
-const int kInterleavedTritBits[5] = { 2, 2, 1, 2, 1 };
-
-// Some template meta programming to get around the fact that MSVC
-// will not allow (ValRange == 5) ? 3 : 5 as a template parameter
-template<int ValRange>
-struct DecodeBlockSize {
- enum { value = (ValRange == 5 ? 3 : 5) };
-};
-
-// Decodes either a trit or quint block using the BISE (Bounded Integer Sequence
-// Encoding) defined in Section C.2.12 of the ASTC specification. ValRange is
-// expected to be either 3 or 5 depending on whether or not we're encoding trits
-// or quints respectively. In other words, it is the remaining factor in whether
-// the passed blocks contain encoded values of the form 3*2^k or 5*2^k.
-template<int ValRange>
-std::array<int, /* kNumVals = */ DecodeBlockSize<ValRange>::value> DecodeISEBlock(
- uint64_t block_bits, int num_bits) {
- static_assert(ValRange == 3 || ValRange == 5,
- "We only know about trits and quints");
-
- // We either have three quints or five trits
- constexpr const int kNumVals = (ValRange == 5) ? 3 : 5;
-
- // Depending on whether or not we're using quints or trits will determine
- // the positions of the interleaved bits in the encoded block.
- constexpr const int* const kInterleavedBits =
- (ValRange == 5) ? kInterleavedQuintBits : kInterleavedTritBits;
-
- // Set up the bits for reading
- base::BitStream<base::UInt128> block_bit_src(block_bits, sizeof(block_bits) * 8);
-
- // Decode the block
- std::array<int, kNumVals> m;
- uint64_t encoded = 0;
- uint32_t encoded_bits_read = 0;
- for (int i = 0; i < kNumVals; ++i) {
- {
- uint64_t bits = 0;
- const bool result = block_bit_src.GetBits(num_bits, &bits);
- assert(result);
- (void)result;
-
- m[i] = static_cast<int>(bits);
- }
-
- uint64_t encoded_bits;
- {
- const bool result = block_bit_src.GetBits(kInterleavedBits[i], &encoded_bits);
- assert(result);
- (void)result;
- }
- encoded |= encoded_bits << encoded_bits_read;
- encoded_bits_read += kInterleavedBits[i];
- }
-
- // Make sure that our encoded trit/quint doesn't exceed its bounds
- assert(ValRange != 3 || encoded < 256);
- assert(ValRange != 5 || encoded < 128);
-
- const int* const kEncodings = (ValRange == 5) ?
- kQuintEncodings[encoded].data() : kTritEncodings[encoded].data();
-
- std::array<int, kNumVals> result;
- for (int i = 0; i < kNumVals; ++i) {
- assert(m[i] < 1 << num_bits);
- result[i] = kEncodings[i] << num_bits | m[i];
- }
- return result;
-}
-
-// Encode a single trit or quint block using the BISE (Bounded Integer Sequence
-// Encoding) defined in Section C.2.12 of the ASTC specification. ValRange is
-// expected to be either 3 or 5 depending on whether or not we're encoding trits
-// or quints respectively. In other words, it is the remaining factor in whether
-// the passed blocks contain encoded values of the form 3*2^k or 5*2^k.
-template <int ValRange>
-void EncodeISEBlock(const std::vector<int>& vals, int bits_per_val,
- base::BitStream<base::UInt128>* bit_sink) {
- static_assert(ValRange == 3 || ValRange == 5,
- "We only know about trits and quints");
-
- // We either have three quints or five trits
- constexpr const int kNumVals = (ValRange == 5) ? 3 : 5;
-
- // Three quints in seven bits or five trits in eight bits
- constexpr const int kNumEncodedBitsPerBlock = (ValRange == 5) ? 7 : 8;
-
- // Depending on whether or not we're using quints or trits will determine
- // the positions of the interleaved bits in the encoding
- constexpr const int* const kInterleavedBits =
- (ValRange == 5) ? kInterleavedQuintBits : kInterleavedTritBits;
-
- // ISE blocks can only have up to a specific number of values...
- assert(vals.size() <= kNumVals);
-
- // Split up into bits and non bits. Non bits are used to find the quint/trit
- // encoding that we need.
- std::array<int, kNumVals> non_bits = {{ 0 }};
- std::array<int, kNumVals> bits = {{ 0 }};
- for (size_t i = 0; i < vals.size(); ++i) {
- bits[i] = vals[i] & ((1 << bits_per_val) - 1);
- non_bits[i] = vals[i] >> bits_per_val;
- assert(non_bits[i] < ValRange);
- }
-
- // We only need to add as many bits as necessary, so let's limit it based
- // on the computation described in Section C.2.22 of the ASTC specification
- const int total_num_bits =
- int(((vals.size() * kNumEncodedBitsPerBlock + kNumVals - 1) / kNumVals)
- + vals.size() * bits_per_val);
- int bits_added = 0;
-
- // The number of bits used for the quint/trit encoding is necessary to know
- // in order to properly select the encoding we need to represent.
- int num_encoded_bits = 0;
- for (int i = 0; i < kNumVals; ++i) {
- bits_added += bits_per_val;
- if (bits_added >= total_num_bits) {
- break;
- }
-
- num_encoded_bits += kInterleavedBits[i];
- bits_added += kInterleavedBits[i];
- if (bits_added >= total_num_bits) {
- break;
- }
- }
- bits_added = 0;
- assert(num_encoded_bits <= kNumEncodedBitsPerBlock);
-
- // TODO(google): The faster way to do this would be to construct trees out
- // of the quint/trit encoding patterns, or just invert the decoding logic.
- // Here we go from the end backwards because it makes our tests are more
- // deterministic.
- int non_bit_encoding = -1;
- for (int j = (1 << num_encoded_bits) - 1; j >= 0; --j) {
- bool matches = true;
-
- // We don't need to match all trits here, just the ones that correspond
- // to the values that we passed in
- for (size_t i = 0; i < kNumVals; ++i) {
- if ((ValRange == 5 && kQuintEncodings[j][i] != non_bits[i]) ||
- (ValRange == 3 && kTritEncodings[j][i] != non_bits[i])) {
- matches = false;
- break;
- }
- }
-
- if (matches) {
- non_bit_encoding = j;
- break;
- }
- }
-
- assert(non_bit_encoding >= 0);
-
- // Now pack the bits into the block
- for (size_t i = 0; i < vals.size(); ++i) {
- // First add the base bits for this value
- if (bits_added + bits_per_val <= total_num_bits) {
- bit_sink->PutBits(bits[i], bits_per_val);
- bits_added += bits_per_val;
- }
-
- // Now add the interleaved bits from the quint/trit
- int num_int_bits = kInterleavedBits[i];
- int int_bits = non_bit_encoding & ((1 << num_int_bits) - 1);
- if (bits_added + num_int_bits <= total_num_bits) {
- bit_sink->PutBits(int_bits, num_int_bits);
- bits_added += num_int_bits;
- non_bit_encoding >>= num_int_bits;
- }
- }
-}
-
-inline void CHECK_COUNTS(int trits, int quints) {
- assert(trits == 0 || quints == 0); // Either trits or quints
- assert(trits == 0 || trits == 1); // At most one trit
- assert(quints == 0 || quints == 1); // At most one quint
- (void)trits; (void)quints;
-}
-
-} // namespace
-
-////////////////////////////////////////////////////////////////////////////////
-
-std::array<int, kNumPossibleRanges>::const_iterator ISERangeBegin() {
- return kMaxRanges.cbegin();
-}
-
-std::array<int, kNumPossibleRanges>::const_iterator ISERangeEnd() {
- return kMaxRanges.cend();
-}
-
-void IntegerSequenceCodec::GetCountsForRange(
- int range, int* const trits, int* const quints, int* const bits) {
- // Make sure the passed pointers are valid
- assert(trits != nullptr);
- assert(quints != nullptr);
- assert(bits != nullptr);
-
- // These are generally errors -- there should never be any ASTC values
- // outside of this range
- UTILS_RELEASE_ASSERT(range > 0);
- UTILS_RELEASE_ASSERT(range < 1 << kLog2MaxRangeForBits);
-
- *bits = 0;
- *trits = 0;
- *quints = 0;
-
- // Search through the numbers of the form 2^n, 3 * 2^n and 5 * 2^n
- const int max_vals_for_range =
- *std::lower_bound(kMaxRanges.begin(), kMaxRanges.end(), range) + 1;
-
- // Make sure we found something
- assert(max_vals_for_range > 1);
-
- // Find out what kind of range it is
- if ((max_vals_for_range % 3 == 0) && IsPow2(max_vals_for_range / 3)) {
- *bits = base::Log2Floor(max_vals_for_range / 3);
- *trits = 1;
- *quints = 0;
- } else if ((max_vals_for_range % 5 == 0) && IsPow2(max_vals_for_range / 5)) {
- *bits = base::Log2Floor(max_vals_for_range / 5);
- *trits = 0;
- *quints = 1;
- } else if (IsPow2(max_vals_for_range)) {
- *bits = base::Log2Floor(max_vals_for_range);
- *trits = 0;
- *quints = 0;
- }
-
- // If we set any of these values then we're done.
- if ((*bits | *trits | *quints) != 0) {
- CHECK_COUNTS(*trits, *quints);
- }
-}
-
-// Returns the overall bit count for a range of val_count values encoded
-// using the specified number of trits, quints and straight bits (respectively)
-int IntegerSequenceCodec::GetBitCount(int num_vals,
- int trits, int quints, int bits) {
- CHECK_COUNTS(trits, quints);
-
- // See section C.2.22 for the formula used here.
- const int trit_bit_count = ((num_vals * 8 * trits) + 4) / 5;
- const int quint_bit_count = ((num_vals * 7 * quints) + 2) / 3;
- const int base_bit_count = num_vals * bits;
- return trit_bit_count + quint_bit_count + base_bit_count;
-}
-
-IntegerSequenceCodec::IntegerSequenceCodec(int range) {
- int trits, quints, bits;
- GetCountsForRange(range, &trits, &quints, &bits);
- InitializeWithCounts(trits, quints, bits);
-}
-
-IntegerSequenceCodec::IntegerSequenceCodec(
- int trits, int quints, int bits) {
- InitializeWithCounts(trits, quints, bits);
-}
-
-void IntegerSequenceCodec::InitializeWithCounts(
- int trits, int quints, int bits) {
- CHECK_COUNTS(trits, quints);
-
- if (trits > 0) {
- encoding_ = EncodingMode::kTritEncoding;
- } else if (quints > 0) {
- encoding_ = EncodingMode::kQuintEncoding;
- } else {
- encoding_ = EncodingMode::kBitEncoding;
- }
-
- bits_ = bits;
-}
-
-int IntegerSequenceCodec::NumValsPerBlock() const {
- const std::array<int, 3> kNumValsByEncoding = {{ 5, 3, 1 }};
- return kNumValsByEncoding[static_cast<int>(encoding_)];
-}
-
-int IntegerSequenceCodec::EncodedBlockSize() const {
- const std::array<int, 3> kExtraBlockSizeByEncoding = {{ 8, 7, 0 }};
- const int num_vals = NumValsPerBlock();
- return kExtraBlockSizeByEncoding[static_cast<int>(encoding_)]
- + num_vals * bits_;
-}
-
-std::vector<int> IntegerSequenceDecoder::Decode(
- int num_vals, base::BitStream<base::UInt128> *bit_src) const {
- int trits = (encoding_ == kTritEncoding)? 1 : 0;
- int quints = (encoding_ == kQuintEncoding)? 1 : 0;
- const int total_num_bits = GetBitCount(num_vals, trits, quints, bits_);
- const int bits_per_block = EncodedBlockSize();
- assert(bits_per_block < 64);
-
- int bits_left = total_num_bits;
- std::vector<int> result;
- while (bits_left > 0) {
- uint64_t block_bits;
- {
- const bool result0 = bit_src->GetBits(std::min(bits_left, bits_per_block), &block_bits);
- assert(result0);
- (void)result0;
- }
-
- switch (encoding_) {
- case kTritEncoding: {
- auto trit_vals = DecodeISEBlock<3>(block_bits, bits_);
- result.insert(result.end(), trit_vals.begin(), trit_vals.end());
- }
- break;
-
- case kQuintEncoding: {
- auto quint_vals = DecodeISEBlock<5>(block_bits, bits_);
- result.insert(result.end(), quint_vals.begin(), quint_vals.end());
- }
- break;
-
- case kBitEncoding:
- result.push_back(static_cast<int>(block_bits));
- break;
- }
-
- bits_left -= bits_per_block;
- }
-
- // Resize result to only contain as many values as requested
- assert(result.size() >= static_cast<size_t>(num_vals));
- result.resize(num_vals);
-
- // Encoded all the values
- return result;
-}
-
-void IntegerSequenceEncoder::Encode(base::BitStream<base::UInt128>* bit_sink) const {
- // Go through all of the values and chop them up into blocks. The properties
- // of the trit and quint encodings mean that if we need to encode fewer values
- // in a block than the number of values encoded in the block then we need to
- // consider the last few values to be zero.
-
- auto next_val = vals_.begin();
- while (next_val != vals_.end()) {
- switch (encoding_) {
- case kTritEncoding: {
- std::vector<int> trit_vals;
- for (int i = 0; i < 5; ++i) {
- if (next_val != vals_.end()) {
- trit_vals.push_back(*next_val);
- ++next_val;
- }
- }
-
- EncodeISEBlock<3>(trit_vals, bits_, bit_sink);
- }
- break;
-
- case kQuintEncoding: {
- std::vector<int> quint_vals;
- for (int i = 0; i < 3; ++i) {
- if (next_val != vals_.end()) {
- quint_vals.push_back(*next_val);
- ++next_val;
- }
- }
-
- EncodeISEBlock<5>(quint_vals, bits_, bit_sink);
- }
- break;
-
- case kBitEncoding: {
- bit_sink->PutBits(*next_val, EncodedBlockSize());
- ++next_val;
- }
- break;
- }
- }
-}
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/integer_sequence_codec.h b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/integer_sequence_codec.h
deleted file mode 100644
index a815e096634..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/integer_sequence_codec.h
+++ /dev/null
@@ -1,169 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_DECODER_INTEGER_SEQUENCE_CODEC_H_
-#define ASTC_CODEC_DECODER_INTEGER_SEQUENCE_CODEC_H_
-
-#include "src/base/bit_stream.h"
-#include "src/base/uint128.h"
-
-#include <array>
-#include <string>
-#include <vector>
-
-namespace astc_codec {
-
-// The maximum number of bits that we would need to encode an ISE value. The
-// ASTC specification does not give a maximum number, however unquantized color
-// values have a maximum range of 255, meaning that we can't feasibly have more
-// than eight bits per value.
-constexpr int kLog2MaxRangeForBits = 8;
-
-// Ranges can take any of the the forms 2^k, 3*2^k, or 5*2^k for k up to
-// kLog2MaxRangeForBits. Hence we have three types of ranges. Since the
-// maximum encoded value is 255, k won't go larger than 8. We don't have quints
-// that accompany [6, 8]-bits, as (5 * 2^6 = 320 > 255) and we don't have trits
-// that accompany [7, 8]-bits, as (3 * 2^7 = 384 > 255). But we do have trits
-// and quints that accompany no bits. Hence we have a total of
-// 3 * kLog2MaxRangeForBits - 3 - 2 + 2 total ranges.
-constexpr int kNumPossibleRanges = 3 * kLog2MaxRangeForBits - 3;
-
-// Returns an iterator through the available ASTC ranges.
-std::array<int, kNumPossibleRanges>::const_iterator ISERangeBegin();
-std::array<int, kNumPossibleRanges>::const_iterator ISERangeEnd();
-
-// Base class for ASTC integer sequence encoders and decoders. These codecs
-// operate on sequences of integers and produce bit patterns that pack the
-// integers based on the encoding scheme specified in the ASTC specification
-// Section C.2.12. The resulting bit pattern is a sequence of encoded blocks.
-// All blocks in a sequence are one of the following encodings:
-//
-// (1 -- bit encoding) one encoded value of the form 2^k
-// (2 -- trit encoding) five encoded values of the form 3*2^k
-// (3 -- quint encoding) three encoded values of the form 5*2^k
-//
-// The layouts of each block are designed such that the blocks can be truncated
-// during encoding in order to support variable length input sequences (i.e. a
-// sequence of values that are encoded using trit encoded blocks does not
-// need to have a multiple-of-five length).
-class IntegerSequenceCodec {
- public:
- // Returns the number of trits, quints, and bits needed to encode values in
- // [0, range]. This is used to determine the layout of ISE encoded bit
- // streams. The returned array holds the number of trits, quints, and bits
- // respectively. range is expected to be within the interval [1, 5242879]
- static void GetCountsForRange(int range, int* trits, int* quints, int* bits);
-
- // Returns the number of bits needed to encode the given number of values with
- // respect to the number of trits, quints, and bits specified in ise_counts
- // (in that order). It is expected that either trits or quints can be
- // nonzero, but not both, and neither can be larger than one. Anything else is
- // undefined.
- static int GetBitCount(int num_vals, int trits, int quints, int bits);
-
- // Convenience function that returns the number of bits needed to encoded
- // num_vals within the range [0, range] (inclusive).
- static inline int GetBitCountForRange(int num_vals, int range) {
- int trits, quints, bits;
- GetCountsForRange(range, &trits, &quints, &bits);
- return GetBitCount(num_vals, trits, quints, bits);
- }
-
- protected:
- explicit IntegerSequenceCodec(int range);
- IntegerSequenceCodec(int trits, int quints, int bits);
-
- // The encoding mode -- since having trits and quints are mutually exclusive,
- // we can store the encoding we decide on in this enum.
- enum EncodingMode {
- kTritEncoding = 0,
- kQuintEncoding,
- kBitEncoding,
- };
-
- EncodingMode encoding_;
- int bits_;
-
- // Returns the number of values stored in a single ISE block. Since quints and
- // trits are packed three/five to a bit pattern (respectively), each sequence
- // is chunked into blocks in order to encode it. For only bit-encodings, the
- // block size is one.
- int NumValsPerBlock() const;
-
- // Returns the size of a single ISE block in bits (see NumValsPerBlock).
- int EncodedBlockSize() const;
-
- private:
- // Determines the encoding mode.
- void InitializeWithCounts(int trits, int quints, int bits);
-};
-
-// The integer sequence decoder. The decoder only remembers the given encoding
-// but each invocation of Decode operates independently on the input bits.
-class IntegerSequenceDecoder : public IntegerSequenceCodec {
- public:
- // Creates a decoder that decodes values within [0, range] (inclusive).
- explicit IntegerSequenceDecoder(int range)
- : IntegerSequenceCodec(range) { }
-
- // Creates a decoder based on the number of trits, quints, and bits expected
- // in the bit stream passed to Decode.
- IntegerSequenceDecoder(int trits, int quints, int bits)
- : IntegerSequenceCodec(trits, quints, bits) { }
-
- // Decodes num_vals from the bit_src. The number of bits read is dependent
- // on the number of bits required to encode num_vals based on the calculation
- // provided in Section C.2.22 of the ASTC specification. The return value
- // always contains exactly num_vals.
- std::vector<int> Decode(int num_vals,
- base::BitStream<base::UInt128>* bit_src) const;
-};
-
-// The integer sequence encoder. The encoder accepts values one by one and
-// places them into a temporary array that it holds. When needed the user
-// may call Encode to produce an encoded bit stream of the associated values.
-class IntegerSequenceEncoder : public IntegerSequenceCodec {
- public:
- // Creates an encoder that encodes values within [0, range] (inclusive).
- explicit IntegerSequenceEncoder(int range)
- : IntegerSequenceCodec(range) { }
-
- // Creates an encoder based on the number of trits, quints, and bits for
- // the bit stream produced by Encode.
- IntegerSequenceEncoder(int trits, int quints, int bits)
- : IntegerSequenceCodec(trits, quints, bits) { }
-
- // Adds a value to the encoding sequence.
- void AddValue(int val) {
- // Make sure it's within bounds
- assert(encoding_ != EncodingMode::kTritEncoding || val < 3 * (1 << bits_));
- assert(encoding_ != EncodingMode::kQuintEncoding || val < 5 * (1 << bits_));
- assert(encoding_ != EncodingMode::kBitEncoding || val < (1 << bits_));
- vals_.push_back(val);
- }
-
- // Writes the encoding for vals_ to the bit_sink. Multiple calls to Encode
- // will produce the same result.
- void Encode(base::BitStream<base::UInt128>* bit_sink) const;
-
- // Removes all of the previously added values to the encoder.
- void Reset() { vals_.clear(); }
-
- private:
- std::vector<int> vals_;
-};
-
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_DECODER_INTEGER_SEQUENCE_CODEC_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/intermediate_astc_block.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/intermediate_astc_block.cc
deleted file mode 100644
index bd67e988559..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/intermediate_astc_block.cc
+++ /dev/null
@@ -1,591 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/intermediate_astc_block.h"
-#include "src/decoder/integer_sequence_codec.h"
-#include "src/base/bit_stream.h"
-#include "src/base/math_utils.h"
-#include "src/base/optional.h"
-#include "src/base/uint128.h"
-
-#include <algorithm>
-#include <numeric>
-#include <sstream>
-
-namespace astc_codec {
-
-namespace {
-
-constexpr int kEndpointRange_ReturnInvalidWeightDims = -1;
-constexpr int kEndpointRange_ReturnNotEnoughColorBits = -2;
-
-base::UInt128 PackVoidExtentBlock(uint16_t r, uint16_t g, uint16_t b,
- uint16_t a, std::array<uint16_t, 4> coords) {
- base::BitStream<base::UInt128> bit_sink;
-
- // Put void extent mode...
- bit_sink.PutBits(0xDFC, 12);
-
- // Each of the coordinates goes in 13 bits at a time.
- for (auto coord : coords) {
- assert(coord < 1 << 13);
- bit_sink.PutBits(coord, 13);
- }
- assert(bit_sink.Bits() == 64);
-
- // Then we add R, G, B, and A in order
- bit_sink.PutBits(r, 16);
- bit_sink.PutBits(g, 16);
- bit_sink.PutBits(b, 16);
- bit_sink.PutBits(a, 16);
-
- assert(bit_sink.Bits() == 128);
-
- base::UInt128 result;
- bit_sink.GetBits(128, &result);
- return result;
-}
-
-base::Optional<std::string> GetEncodedWeightRange(int range,
- std::array<int, 3>* const r) {
- const std::array<std::array<int, 3>, 12> kValidRangeEncodings =
- {{ {{ 0, 1, 0 }}, {{ 1, 1, 0 }}, {{ 0, 0, 1 }},
- {{ 1, 0, 1 }}, {{ 0, 1, 1 }}, {{ 1, 1, 1 }},
- {{ 0, 1, 0 }}, {{ 1, 1, 0 }}, {{ 0, 0, 1 }},
- {{ 1, 0, 1 }}, {{ 0, 1, 1 }}, {{ 1, 1, 1 }} }};
-
- // If our range is larger than all available ranges, this is an error.
- const int smallest_range = kValidWeightRanges.front();
- const int largest_range = kValidWeightRanges.back();
- if (range < smallest_range || largest_range < range) {
- std::stringstream strm;
- strm << "Could not find block mode. Invalid weight range: "
- << range << " not in [" << smallest_range << ", "
- << largest_range << std::endl;
- return strm.str();
- }
-
- // Find the upper bound on the range, otherwise.
- const auto range_iter = std::lower_bound(
- kValidWeightRanges.cbegin(), kValidWeightRanges.cend(), range);
- auto enc_iter = kValidRangeEncodings.cbegin();
- enc_iter += std::distance(kValidWeightRanges.cbegin(), range_iter);
- *r = *enc_iter;
- return {};
-}
-
-struct BlockModeInfo {
- int min_weight_grid_dim_x;
- int max_weight_grid_dim_x;
- int min_weight_grid_dim_y;
- int max_weight_grid_dim_y;
- int r0_bit_pos;
- int r1_bit_pos;
- int r2_bit_pos;
- int weight_grid_x_offset_bit_pos;
- int weight_grid_y_offset_bit_pos;
- bool require_single_plane_low_prec;
-};
-
-constexpr int kNumBlockModes = 10;
-const std::array<BlockModeInfo, kNumBlockModes> kBlockModeInfo {{
- { 4, 7, 2, 5, 4, 0, 1, 7, 5, false }, // B+4 A+2
- { 8, 11, 2, 5, 4, 0, 1, 7, 5, false }, // B+8 A+2
- { 2, 5, 8, 11, 4, 0, 1, 5, 7, false }, // A+2 B+8
- { 2, 5, 6, 7, 4, 0, 1, 5, 7, false }, // A+2 B+6
- { 2, 3, 2, 5, 4, 0, 1, 7, 5, false }, // B+2 A+2
- { 12, 12, 2, 5, 4, 2, 3, -1, 5, false }, // 12 A+2
- { 2, 5, 12, 12, 4, 2, 3, 5, -1, false }, // A+2 12
- { 6, 6, 10, 10, 4, 2, 3, -1, -1, false }, // 6 10
- { 10, 10, 6, 6, 4, 2, 3, -1, -1, false }, // 10 6
- { 6, 9, 6, 9, 4, 2, 3, 5, 9, true } // A+6 B+6
-}};
-
-// These are the bits that must be set for ASTC to recognize a given
-// block mode. They are the 1's set in table C.2.8 of the spec.
-const std::array<int, kNumBlockModes> kBlockModeMask = {{
- 0x0, 0x4, 0x8, 0xC, 0x10C, 0x0, 0x80, 0x180, 0x1A0, 0x100
-}};
-
-static base::Optional<std::string> PackBlockMode(int dim_x, int dim_y, int range,
- bool dual_plane,
- base::BitStream<base::UInt128>* const bit_sink) {
- // We need to set the high precision bit if our range is too high...
- bool high_prec = range > 7;
-
- std::array<int, 3> r = {};
- const auto result = GetEncodedWeightRange(range, &r);
- if (result) {
- return result;
- }
-
- // The high two bits of R must not be zero. If this happens then it's
- // an illegal encoding according to Table C.2.7 that should have gotten
- // caught in GetEncodedWeightRange
- assert((r[1] | r[2]) > 0);
-
- // Just go through the table and see if any of the modes can handle
- // the given dimensions.
- for (int mode = 0; mode < kNumBlockModes; ++mode) {
- const BlockModeInfo& block_mode = kBlockModeInfo[mode];
-
- bool is_valid_mode = true;
- is_valid_mode &= block_mode.min_weight_grid_dim_x <= dim_x;
- is_valid_mode &= dim_x <= block_mode.max_weight_grid_dim_x;
- is_valid_mode &= block_mode.min_weight_grid_dim_y <= dim_y;
- is_valid_mode &= dim_y <= block_mode.max_weight_grid_dim_y;
- is_valid_mode &= !(block_mode.require_single_plane_low_prec && dual_plane);
- is_valid_mode &= !(block_mode.require_single_plane_low_prec && high_prec);
-
- if (!is_valid_mode) {
- continue;
- }
-
- // Initialize to the bits we must set.
- uint32_t encoded_mode = kBlockModeMask[mode];
- auto setBit = [&encoded_mode](const uint32_t value, const uint32_t offset) {
- encoded_mode = (encoded_mode & ~(1 << offset)) | ((value & 1) << offset);
- };
-
- // Set all the bits we need to set
- setBit(r[0], block_mode.r0_bit_pos);
- setBit(r[1], block_mode.r1_bit_pos);
- setBit(r[2], block_mode.r2_bit_pos);
-
- // Find our width and height offset from the base width and height weight
- // grid dimension for the given block mode. These are the 1-2 bits that
- // get encoded in the block mode used to calculate the final weight grid
- // width and height.
- const int offset_x = dim_x - block_mode.min_weight_grid_dim_x;
- const int offset_y = dim_y - block_mode.min_weight_grid_dim_y;
-
- // If we don't have an offset position then our offset better be zero.
- // If this isn't the case, then this isn't a viable block mode and we
- // should have caught this sooner.
- assert(block_mode.weight_grid_x_offset_bit_pos >= 0 || offset_x == 0);
- assert(block_mode.weight_grid_y_offset_bit_pos >= 0 || offset_y == 0);
-
- encoded_mode |= offset_x << block_mode.weight_grid_x_offset_bit_pos;
- encoded_mode |= offset_y << block_mode.weight_grid_y_offset_bit_pos;
-
- if (!block_mode.require_single_plane_low_prec) {
- setBit(high_prec, 9);
- setBit(dual_plane, 10);
- }
-
- // Make sure that the mode is the first thing the bit sink is writing to
- assert(bit_sink->Bits() == 0);
- bit_sink->PutBits(encoded_mode, 11);
-
- return {};
- }
-
- return std::string("Could not find viable block mode");
-}
-
-// Returns true if all endpoint modes are equal.
-bool SharedEndpointModes(const IntermediateBlockData& data) {
- return std::accumulate(
- data.endpoints.begin(), data.endpoints.end(), true,
- [&data](const bool& a, const IntermediateEndpointData& b) {
- return a && b.mode == data.endpoints[0].mode;
- });
-}
-
-// Returns the starting bit (between 0 and 128) where the extra CEM and
-// dual plane info is stored in the ASTC block.
-int ExtraConfigBitPosition(const IntermediateBlockData& data) {
- const bool has_dual_channel = data.dual_plane_channel.hasValue();
- const int num_weights = data.weight_grid_dim_x * data.weight_grid_dim_y *
- (has_dual_channel ? 2 : 1);
- const int num_weight_bits =
- IntegerSequenceCodec::GetBitCountForRange(num_weights, data.weight_range);
-
- int extra_config_bits = 0;
- if (!SharedEndpointModes(data)) {
- const int num_encoded_cem_bits = 2 + int(data.endpoints.size()) * 3;
- extra_config_bits = num_encoded_cem_bits - 6;
- }
-
- if (has_dual_channel) {
- extra_config_bits += 2;
- }
-
- return 128 - num_weight_bits - extra_config_bits;
-}
-
-} // namespace
-
-////////////////////////////////////////////////////////////////////////////////
-
-base::Optional<IntermediateBlockData> UnpackIntermediateBlock(
- const PhysicalASTCBlock& pb) {
- if (pb.IsIllegalEncoding()) {
- return {};
- }
-
- if (pb.IsVoidExtent()) {
- return {};
- }
-
- // Non void extent? Then let's try to decode everything else.
- IntermediateBlockData data;
-
- // All blocks have color values...
- const base::UInt128 color_bits_mask =
- (base::UInt128(1) << pb.NumColorBits().value()) - 1;
- const base::UInt128 color_bits =
- (pb.GetBlockBits() >> pb.ColorStartBit().value()) & color_bits_mask;
- base::BitStream<base::UInt128> bit_src(color_bits, 128);
-
- IntegerSequenceDecoder color_decoder(pb.ColorValuesRange().value());
- const int num_colors_in_block = pb.NumColorValues().value();
- std::vector<int> colors = color_decoder.Decode(num_colors_in_block, &bit_src);
-
- // Decode simple info
- const auto weight_dims = pb.WeightGridDims();
- data.weight_grid_dim_x = weight_dims->at(0);
- data.weight_grid_dim_y = weight_dims->at(1);
- data.weight_range = pb.WeightRange().value();
-
- data.partition_id = pb.PartitionID();
- data.dual_plane_channel = pb.DualPlaneChannel();
-
- auto colors_iter = colors.begin();
- for (int i = 0; i < pb.NumPartitions().value(); ++i) {
- IntermediateEndpointData ep_data;
- ep_data.mode = pb.GetEndpointMode(i).value();
-
- const int num_colors = NumColorValuesForEndpointMode(ep_data.mode);
- ep_data.colors.insert(ep_data.colors.end(), colors_iter,
- colors_iter + num_colors);
- colors_iter += num_colors;
-
- data.endpoints.push_back(ep_data);
- }
- assert(colors_iter == colors.end());
- data.endpoint_range = pb.ColorValuesRange().value();
-
- // Finally decode the weights
- const base::UInt128 weight_bits_mask =
- (base::UInt128(1) << pb.NumWeightBits().value()) - 1;
- const base::UInt128 weight_bits =
- base::ReverseBits(pb.GetBlockBits()) & weight_bits_mask;
- bit_src = base::BitStream<base::UInt128>(weight_bits, 128);
-
- IntegerSequenceDecoder weight_decoder(data.weight_range);
- int num_weights = data.weight_grid_dim_x * data.weight_grid_dim_y;
- num_weights *= pb.IsDualPlane() ? 2 : 1;
- data.weights = weight_decoder.Decode(num_weights, &bit_src);
-
- return data;
-}
-
-int EndpointRangeForBlock(const IntermediateBlockData& data) {
- // First check to see if we exceed the number of bits allotted for weights, as
- // specified in C.2.24. If so, then the endpoint range is meaningless, but not
- // because we had an overzealous color endpoint mode, so return a different
- // error code.
- if (IntegerSequenceCodec::GetBitCountForRange(
- data.weight_grid_dim_x * data.weight_grid_dim_y *
- (data.dual_plane_channel.hasValue() ? 2 : 1),
- data.weight_range) > 96) {
- return kEndpointRange_ReturnInvalidWeightDims;
- }
-
- const int num_partitions = int(data.endpoints.size());
-
- // Calculate the number of bits that we would write prior to getting to the
- // color endpoint data
- const int bits_written =
- 11 // Block mode
- + 2 // Num partitions
- + ((num_partitions > 1) ? 10 : 0) // Partition ID
- + ((num_partitions == 1) ? 4 : 6); // Shared CEM bits
-
- // We can determine the range based on how many bits we have between the start
- // of the color endpoint data and the next section, which is the extra config
- // bit position
- const int color_bits_available = ExtraConfigBitPosition(data) - bits_written;
-
- int num_color_values = 0;
- for (const auto& ep_data : data.endpoints) {
- num_color_values += NumColorValuesForEndpointMode(ep_data.mode);
- }
-
- // There's no way any valid ASTC encoding has no room left for any color
- // values. If we hit this then something is wrong in the caller -- abort.
- // According to section C.2.24, the smallest number of bits available is
- // ceil(13*C/5), where C is the number of color endpoint integers needed.
- const int bits_needed = (13 * num_color_values + 4) / 5;
- if (color_bits_available < bits_needed) {
- return kEndpointRange_ReturnNotEnoughColorBits;
- }
-
- int color_value_range = 255;
- for (; color_value_range > 1; --color_value_range) {
- const int bits_for_range = IntegerSequenceCodec::GetBitCountForRange(
- num_color_values, color_value_range);
- if (bits_for_range <= color_bits_available) {
- break;
- }
- }
-
- return color_value_range;
-}
-
-base::Optional<VoidExtentData> UnpackVoidExtent(const PhysicalASTCBlock& pb) {
- if (pb.IsIllegalEncoding()) {
- return {};
- }
-
- if (!pb.IsVoidExtent()) {
- return {};
- }
-
- // All blocks have color values...
- const base::UInt128 color_bits_mask =
- (base::UInt128(1) << pb.NumColorBits().value()) - 1;
- const uint64_t color_bits = (
- (pb.GetBlockBits() >> pb.ColorStartBit().value()) & color_bits_mask).LowBits();
-
- assert(pb.NumColorValues().value() == 4);
- VoidExtentData data;
- data.r = static_cast<uint16_t>((color_bits >> 0) & 0xFFFF);
- data.g = static_cast<uint16_t>((color_bits >> 16) & 0xFFFF);
- data.b = static_cast<uint16_t>((color_bits >> 32) & 0xFFFF);
- data.a = static_cast<uint16_t>((color_bits >> 48) & 0xFFFF);
-
- const auto void_extent_coords = pb.VoidExtentCoords();
- if (void_extent_coords) {
- data.coords[0] = uint16_t(void_extent_coords->at(0));
- data.coords[1] = uint16_t(void_extent_coords->at(1));
- data.coords[2] = uint16_t(void_extent_coords->at(2));
- data.coords[3] = uint16_t(void_extent_coords->at(3));
- } else {
- uint16_t all_ones = (1 << 13) - 1;
- for (auto& coord : data.coords) {
- coord = all_ones;
- }
- }
-
- return data;
-}
-
-// Packs the given intermediate block into a physical block. Returns false if
-// the provided values in the intermediate block emit an illegal ASTC
-// encoding.
-base::Optional<std::string> Pack(const IntermediateBlockData& data,
- base::UInt128* pb) {
- if (data.weights.size() !=
- size_t(data.weight_grid_dim_x * data.weight_grid_dim_y *
- (data.dual_plane_channel.hasValue() ? 2 : 1))) {
- return std::string("Incorrect number of weights!");
- }
-
- // If it's not a void extent block, then it gets a bit more tricky...
- base::BitStream<base::UInt128> bit_sink;
-
- // First we need to encode the block mode.
- const auto error_string = PackBlockMode(
- data.weight_grid_dim_x, data.weight_grid_dim_y, data.weight_range,
- data.dual_plane_channel.hasValue(), &bit_sink);
- if (error_string) {
- return error_string;
- }
-
- // Next, we place the number of partitions minus one.
- const int num_partitions = int(data.endpoints.size());
- bit_sink.PutBits(num_partitions - 1, 2);
-
- // If we have more than one partition, then we also have a partition ID.
- if (num_partitions > 1) {
- const int id = data.partition_id.value();
- assert(id >= 0);
- bit_sink.PutBits(id, 10);
- }
-
- // Take a detour, let's encode the weights so that we know how many bits they
- // consume.
- base::BitStream<base::UInt128> weight_sink;
-
- IntegerSequenceEncoder weight_enc(data.weight_range);
- for (auto weight : data.weights) {
- weight_enc.AddValue(weight);
- }
- weight_enc.Encode(&weight_sink);
-
- const int num_weight_bits = weight_sink.Bits();
- assert(num_weight_bits ==
- IntegerSequenceCodec::GetBitCountForRange(
- int(data.weights.size()), data.weight_range));
-
- // Let's continue... how much after the color data do we need to write?
- int extra_config = 0;
-
- // Determine if all endpoint pairs share the same endpoint mode
- assert(data.endpoints.size() > 0);
- bool shared_endpoint_mode = SharedEndpointModes(data);
-
- // The first part of the endpoint mode (CEM) comes directly after the
- // partition info, if it exists. If there is no partition info, the CEM comes
- // right after the block mode. In the single-partition case, we just write out
- // the entire singular CEM, but in the multi-partition case, if all CEMs are
- // the same then their shared CEM is specified directly here, too. In both
- // cases, shared_endpoint_mode is true (in the singular case,
- // shared_endpoint_mode is trivially true).
- if (shared_endpoint_mode) {
- if (num_partitions > 1) {
- bit_sink.PutBits(0, 2);
- }
- bit_sink.PutBits(static_cast<int>(data.endpoints[0].mode), 4);
- } else {
- // Here, the CEM is not shared across all endpoint pairs, and we need to
- // figure out what to place here, and what to place in the extra config
- // bits before the weight data...
-
- // Non-shared config modes must all be within the same class (out of four)
- // See Section C.2.11
- int min_class = 2; // We start with 2 here instead of three because it's
- // the highest that can be encoded -- even if all modes
- // are class 3.
- int max_class = 0;
- for (const auto& ep_data : data.endpoints) {
- const int ep_mode_class = static_cast<int>(ep_data.mode) >> 2;
- min_class = std::min(min_class, ep_mode_class);
- max_class = std::max(max_class, ep_mode_class);
- }
-
- assert(max_class >= min_class);
-
- if (max_class - min_class > 1) {
- return std::string("Endpoint modes are invalid");
- }
-
- // Construct the CEM mode -- six of its bits will fit here, but otherwise
- // the rest will go in the extra configuration bits.
- base::BitStream<uint32_t> cem_encoder;
-
- // First encode the base class
- assert(min_class >= 0);
- assert(min_class < 3);
- cem_encoder.PutBits(min_class + 1, 2);
-
- // Next, encode the class selector bits -- this is simply the offset
- // from the base class
- for (const auto& ep_data : data.endpoints) {
- const int ep_mode_class = static_cast<int>(ep_data.mode) >> 2;
- const int class_selector_bit = ep_mode_class - min_class;
- assert(class_selector_bit == 0 || class_selector_bit == 1);
- cem_encoder.PutBits(class_selector_bit, 1);
- }
-
- // Finally, we need to choose from each class which actual mode
- // we belong to and encode those.
- for (const auto& ep_data : data.endpoints) {
- const int ep_mode = static_cast<int>(ep_data.mode) & 3;
- assert(ep_mode < 4);
- cem_encoder.PutBits(ep_mode, 2);
- }
- assert(cem_encoder.Bits() == uint32_t(2 + num_partitions * 3));
-
- uint32_t encoded_cem;
- cem_encoder.GetBits(2 + num_partitions * 3, &encoded_cem);
-
- // Since only six bits fit here before the color endpoint data, the rest
- // need to go in the extra config data.
- extra_config = encoded_cem >> 6;
-
- // Write out the six bits we had
- bit_sink.PutBits(encoded_cem, 6);
- }
-
- // If we have a dual-plane channel, we can tack that onto our extra config
- // data
- if (data.dual_plane_channel.hasValue()) {
- const int channel = data.dual_plane_channel.value();
- assert(channel < 4);
- extra_config <<= 2;
- extra_config |= channel;
- }
-
- // Get the range of endpoint values. It can't be -1 because we should have
- // checked for that much earlier.
- const int color_value_range = data.endpoint_range
- ? data.endpoint_range.value()
- : EndpointRangeForBlock(data);
-
- assert(color_value_range != kEndpointRange_ReturnInvalidWeightDims);
- if (color_value_range == kEndpointRange_ReturnNotEnoughColorBits) {
- return { "Intermediate block emits illegal color range" };
- }
-
- IntegerSequenceEncoder color_enc(color_value_range);
- for (const auto& ep_data : data.endpoints) {
- for (int color : ep_data.colors) {
- if (color > color_value_range) {
- return { "Color outside available color range!" };
- }
-
- color_enc.AddValue(color);
- }
- }
- color_enc.Encode(&bit_sink);
-
- // Now we need to skip some bits to get to the extra configuration bits. The
- // number of bits we need to skip depends on where we are in the stream and
- // where we need to get to.
- const int extra_config_bit_position = ExtraConfigBitPosition(data);
- const int extra_config_bits =
- 128 - num_weight_bits - extra_config_bit_position;
- assert(extra_config_bits >= 0);
- assert(extra_config < 1 << extra_config_bits);
-
- // Make sure the color encoder didn't write more than we thought it would.
- int bits_to_skip = extra_config_bit_position - bit_sink.Bits();
- assert(bits_to_skip >= 0);
-
- while (bits_to_skip > 0) {
- const int skipping = std::min(32, bits_to_skip);
- bit_sink.PutBits(0, skipping);
- bits_to_skip -= skipping;
- }
-
- // Finally, write out the rest of the config bits.
- bit_sink.PutBits(extra_config, extra_config_bits);
-
- // We should be right up to the weight bits...
- assert(bit_sink.Bits() == uint32_t(128 - num_weight_bits));
-
- // Flush out our bit writer and write out the weight bits
- base::UInt128 astc_bits;
- bit_sink.GetBits(128 - num_weight_bits, &astc_bits);
-
- base::UInt128 rev_weight_bits;
- weight_sink.GetBits(weight_sink.Bits(), &rev_weight_bits);
-
- astc_bits |= base::ReverseBits(rev_weight_bits);
-
- // And we're done! Whew!
- *pb = astc_bits;
- return PhysicalASTCBlock(*pb).IsIllegalEncoding();
-}
-
-base::Optional<std::string> Pack(const VoidExtentData& data,
- base::UInt128* pb) {
- *pb = PackVoidExtentBlock(data.r, data.g, data.b, data.a, data.coords);
- return PhysicalASTCBlock(*pb).IsIllegalEncoding();
-}
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/intermediate_astc_block.h b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/intermediate_astc_block.h
deleted file mode 100644
index 13eef213a4b..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/intermediate_astc_block.h
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_DECODER_INTERMEDIATE_ASTC_BLOCK_H_
-#define ASTC_CODEC_DECODER_INTERMEDIATE_ASTC_BLOCK_H_
-
-#include "src/base/optional.h"
-#include "src/base/uint128.h"
-#include "src/decoder/physical_astc_block.h"
-
-#include <array>
-#include <vector>
-
-namespace astc_codec {
-
-// From Table C.2.7 -- These are the only valid ranges that weight
-// values can take.
-constexpr std::array<int, 12> kValidWeightRanges =
-{{ 1, 2, 3, 4, 5, 7, 9, 11, 15, 19, 23, 31 }};
-
-// Void extent data are all the ASTC blocks that are labeled for having a
-// constant color. In the ASTC spec, some of these blocks may optionally
-// have "void extent coordinates" that describe how far in texture space
-// the constant color should span. If these coordinates are not valid,
-// then the coordinates are all set to a fully saturated bit mask
-// ((1 << 13) - 1) and the block is treated as a singular constant color.
-// We call both types of these blocks "void extent" to remove confusion
-// in our code.
-struct VoidExtentData {
- uint16_t r;
- uint16_t g;
- uint16_t b;
- uint16_t a;
- std::array<uint16_t, 4> coords;
-};
-
-// Intermediate endpoint data. Really this is just an endpoint mode
-// and a couple of values that represent the data used to decode the
-// RGB values from the color endpoint mode.
-struct IntermediateEndpointData {
- ColorEndpointMode mode;
- std::vector<int> colors;
-};
-
-// This is an unpacked physical ASTC block, but it does not have enough
-// information to be worked with logically. It is simply a container of
-// all of the unpacked ASTC information. It is used as a staging area
-// for the information that is later Pack()'d into a PhysicalASTCBlock.
-struct IntermediateBlockData {
- int weight_grid_dim_x;
- int weight_grid_dim_y;
- int weight_range;
-
- // Quantized, non-interpolated weights
- std::vector<int> weights;
-
- // The 10-bit partition ID if we need one
- base::Optional<int> partition_id;
-
- // The dual-plane channel in [0, 3] if it exists.
- base::Optional<int> dual_plane_channel;
-
- // The quantized/encoded endpoint values for this block. The range of each
- // endpoint value is specified by |endpoint_range|, if it exists. If not, the
- // range can be queried by calling EndpointRangeForBlock
- std::vector<IntermediateEndpointData> endpoints;
-
- // The range [0, endpoint_range] that any one endpoint value can take. Users
- // should not write to this value themselves. If it is empty at the time
- // someone calls Pack(), it will be automatically inferred. Otherwise, it is
- // set by Unpack() based on what the underlying encoding specified.
- base::Optional<int> endpoint_range;
-};
-
-// Returns the maximum value that a given endpoint value can take according to
-// the other settings in the block. Ignores the |endpoint_range| member
-// variable. Returns negative values on error:
-// -1 : Too many bits required to store weight grid
-// -2 : There are too few bits allocated for color endpoint data according to
-// C.2.24 in the ASTC spec
-int EndpointRangeForBlock(const IntermediateBlockData& data);
-inline int EndpointRangeForBlock(const VoidExtentData& data);
-
-// Unpacks the physical ASTC block into the intermediate block. Returns false
-// if the physical block is an error encoded block, or if the physical block
-// is a void extent block. On error the contents of ib are undefined.
-base::Optional<IntermediateBlockData> UnpackIntermediateBlock(
- const PhysicalASTCBlock& pb);
-
-// Unpacks the physical ASTC block into a void extent block. Returns false
-// if the physical block is an error encoded block, or if the physical block
-// is an intermediate block. On error the contents of ib are undefined.
-base::Optional<VoidExtentData> UnpackVoidExtent(const PhysicalASTCBlock& pb);
-
-// Packs the given intermediate block into a physical block. Returns an error
-// string if the provided values in the intermediate block emit an illegal ASTC
-// encoding. In this case the results in the physical block are undefined.
-base::Optional<std::string> Pack(const IntermediateBlockData& data,
- base::UInt128* pb);
-
-// Packs the given void extent block into a physical block. Returns an error
-// string if the provided values in the void extent block emit an illegal ASTC
-// encoding. In this case the results in the physical block are undefined.
-base::Optional<std::string> Pack(const VoidExtentData& data, base::UInt128* pb);
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Impl
-
-inline int EndpointRangeForBlock(const VoidExtentData&) {
- // Void extent blocks use 16-bit ARGB definitions
- return (1 << 16) - 1;
-}
-
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_DECODER_INTERMEDIATE_ASTC_BLOCK_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/logical_astc_block.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/logical_astc_block.cc
deleted file mode 100644
index 4889ce2faa7..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/logical_astc_block.cc
+++ /dev/null
@@ -1,262 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/logical_astc_block.h"
-#include "src/decoder/endpoint_codec.h"
-#include "src/decoder/footprint.h"
-#include "src/decoder/integer_sequence_codec.h"
-#include "src/decoder/quantization.h"
-#include "src/decoder/weight_infill.h"
-
-namespace astc_codec {
-
-namespace {
-
-Partition GenerateSinglePartition(Footprint footprint) {
- return Partition { footprint, /* num_parts = */ 1, /* partition_id = */ 0,
- std::vector<int>(footprint.NumPixels(), 0) };
-}
-
-static std::vector<EndpointPair> DecodeEndpoints(const IntermediateBlockData& block) {
- const int endpoint_range = block.endpoint_range
- ? block.endpoint_range.value()
- : EndpointRangeForBlock(block);
- assert(endpoint_range > 0);
-
- std::vector<EndpointPair> endpoints;
- for (const auto& eps : block.endpoints) {
- RgbaColor decmp_one_rgba, decmp_two_rgba;
- DecodeColorsForMode(eps.colors, endpoint_range, eps.mode,
- &decmp_one_rgba, &decmp_two_rgba);
- endpoints.emplace_back(decmp_one_rgba, decmp_two_rgba);
- }
- return endpoints;
-}
-
-static std::vector<EndpointPair> DecodeEndpoints(const VoidExtentData& block) {
- EndpointPair eps;
- eps.first[0] = eps.second[0] = (block.r * 255) / 65535;
- eps.first[1] = eps.second[1] = (block.g * 255) / 65535;
- eps.first[2] = eps.second[2] = (block.b * 255) / 65535;
- eps.first[3] = eps.second[3] = (block.a * 255) / 65535;
-
- std::vector<EndpointPair> endpoints;
- endpoints.emplace_back(eps);
- return endpoints;
-}
-
-Partition ComputePartition(const Footprint& footprint,
- const IntermediateBlockData& block) {
- if (block.partition_id) {
- const int part_id = block.partition_id.value();
- const int num_parts = int(block.endpoints.size());
- return GetASTCPartition(footprint, num_parts, part_id);
- } else {
- return GenerateSinglePartition(footprint);
- }
-}
-
-Partition ComputePartition(const Footprint& footprint, const VoidExtentData&) {
- return GenerateSinglePartition(footprint);
-}
-
-} // namespace
-
-////////////////////////////////////////////////////////////////////////////////
-
-LogicalASTCBlock::LogicalASTCBlock(const Footprint& footprint)
- : endpoints_(1),
- weights_(footprint.NumPixels(), 0),
- partition_(GenerateSinglePartition(footprint)) { }
-
-LogicalASTCBlock::LogicalASTCBlock(const Footprint& footprint,
- const IntermediateBlockData& block)
- : endpoints_(DecodeEndpoints(block)),
- partition_(ComputePartition(footprint, block)) {
- CalculateWeights(footprint, block);
-}
-
-LogicalASTCBlock::LogicalASTCBlock(const Footprint& footprint,
- const VoidExtentData& block)
- : endpoints_(DecodeEndpoints(block)),
- partition_(ComputePartition(footprint, block)) {
- CalculateWeights(footprint, block);
-}
-
-void LogicalASTCBlock::CalculateWeights(const Footprint& footprint,
- const IntermediateBlockData& block) {
- const int grid_size_x = block.weight_grid_dim_x;
- const int grid_size_y = block.weight_grid_dim_y;
- const int weight_grid_size = grid_size_x * grid_size_y;
-
- // Either we have a dual plane and we have twice as many weights as
- // specified or we don't
- assert(block.dual_plane_channel
- ? block.weights.size() == size_t(weight_grid_size * 2)
- : block.weights.size() == size_t(weight_grid_size));
-
- std::vector<int> unquantized;
- unquantized.reserve(weight_grid_size);
-
- // According to C.2.16, if we have dual-plane weights, then we have two
- // weights per texel -- one adjacent to the other. Hence, we have to skip
- // some when we decode the separate weight values.
- const int weight_frequency = (block.dual_plane_channel) ? 2 : 1;
- const int weight_range = block.weight_range;
-
- for (int i = 0; i < weight_grid_size; ++i) {
- const int weight = block.weights[i * weight_frequency];
- unquantized.push_back(UnquantizeWeightFromRange(weight, weight_range));
- }
- weights_ = InfillWeights(unquantized, footprint, grid_size_x, grid_size_y);
-
- if (block.dual_plane_channel) {
- SetDualPlaneChannel(block.dual_plane_channel.value());
- for (int i = 0; i < weight_grid_size; ++i) {
- const int weight = block.weights[i * weight_frequency + 1];
- unquantized[i] = UnquantizeWeightFromRange(weight, weight_range);
- }
- dual_plane_->weights =
- InfillWeights(unquantized, footprint, grid_size_x, grid_size_y);
- }
-}
-
-void LogicalASTCBlock::CalculateWeights(const Footprint& footprint,
- const VoidExtentData&) {
- weights_ = std::vector<int>(footprint.NumPixels(), 0);
-}
-
-void LogicalASTCBlock::SetWeightAt(int x, int y, int weight) {
- assert(weight >= 0);
- assert(weight <= 64);
- weights_.at(y * GetFootprint().Width() + x) = weight;
-}
-
-int LogicalASTCBlock::WeightAt(int x, int y) const {
- return weights_.at(y * GetFootprint().Width() + x);
-}
-
-void LogicalASTCBlock::SetDualPlaneWeightAt(int channel, int x, int y,
- int weight) {
- assert(weight >= 0);
- assert(weight <= 64);
-
- // If it's not a dual plane, then this has no logical meaning
- assert(IsDualPlane());
-
- // If it is a dual plane and the passed channel matches the query, then we
- // return the specialized weights
- if (dual_plane_->channel == channel) {
- dual_plane_->weights.at(y * GetFootprint().Width() + x) = weight;
- } else {
- // If the channel is not the special channel, then return the general weight
- SetWeightAt(x, y, weight);
- }
-}
-
-int LogicalASTCBlock::DualPlaneWeightAt(int channel, int x, int y) const {
- // If it's not a dual plane, then we just return the weight for all channels
- if (!IsDualPlane()) {
- // TODO(google): Log warning, Requesting dual-plane channel for a non
- // dual-plane block!
- return WeightAt(x, y);
- }
-
- // If it is a dual plane and the passed channel matches the query, then we
- // return the specialized weights
- if (dual_plane_->channel == channel) {
- return dual_plane_->weights.at(y * GetFootprint().Width() + x);
- }
-
- // If the channel is not the special channel, then return the general weight
- return WeightAt(x, y);
-}
-
-void LogicalASTCBlock::SetDualPlaneChannel(int channel) {
- if (channel < 0) {
- dual_plane_.clear();
- } else if (dual_plane_) {
- dual_plane_->channel = channel;
- } else {
- dual_plane_ = DualPlaneData {channel, weights_};
- }
-}
-
-RgbaColor LogicalASTCBlock::ColorAt(int x, int y) const {
- const auto footprint = GetFootprint();
- assert(x >= 0); assert(x < footprint.Width());
- assert(y >= 0); assert(y < footprint.Height());
-
- const int texel_idx = y * footprint.Width() + x;
- const int part = partition_.assignment[texel_idx];
- const auto& endpoints = endpoints_[part];
-
- RgbaColor result;
- for (int channel = 0; channel < 4; ++channel) {
- const int weight = (dual_plane_ && dual_plane_->channel == channel)
- ? dual_plane_->weights[texel_idx]
- : weights_[texel_idx];
- const int p0 = endpoints.first[channel];
- const int p1 = endpoints.second[channel];
-
- assert(p0 >= 0); assert(p0 < 256);
- assert(p1 >= 0); assert(p1 < 256);
-
- // According to C.2.19
- const int c0 = (p0 << 8) | p0;
- const int c1 = (p1 << 8) | p1;
- const int c = (c0 * (64 - weight) + c1 * weight + 32) / 64;
- // TODO(google): Handle conversion to sRGB or FP16 per C.2.19.
- const int quantized = ((c * 255) + 32767) / 65536;
- assert(quantized < 256);
- result[channel] = quantized;
- }
-
- return result;
-}
-
-void LogicalASTCBlock::SetPartition(const Partition& p) {
- assert(p.footprint == partition_.footprint &&
- "New partitions may not be for a different footprint");
- partition_ = p;
- endpoints_.resize(p.num_parts);
-}
-
-void LogicalASTCBlock::SetEndpoints(const EndpointPair& eps, int subset) {
- assert(subset < partition_.num_parts);
- assert(size_t(subset) < endpoints_.size());
-
- endpoints_[subset] = eps;
-}
-
-base::Optional<LogicalASTCBlock> UnpackLogicalBlock(
- const Footprint& footprint, const PhysicalASTCBlock& pb) {
- if (pb.IsVoidExtent()) {
- base::Optional<VoidExtentData> ve = UnpackVoidExtent(pb);
- if (!ve) {
- return {};
- }
-
- return LogicalASTCBlock(footprint, ve.value());
- } else {
- base::Optional<IntermediateBlockData> ib = UnpackIntermediateBlock(pb);
- if (!ib) {
- return {};
- }
-
- return LogicalASTCBlock(footprint, ib.value());
- }
-}
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/logical_astc_block.h b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/logical_astc_block.h
deleted file mode 100644
index 2243eb4e5e4..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/logical_astc_block.h
+++ /dev/null
@@ -1,127 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_DECODER_LOGICAL_ASTC_BLOCK_H_
-#define ASTC_CODEC_DECODER_LOGICAL_ASTC_BLOCK_H_
-
-#include "src/base/optional.h"
-#include "src/decoder/footprint.h"
-#include "src/decoder/intermediate_astc_block.h"
-#include "src/decoder/partition.h"
-#include "src/decoder/physical_astc_block.h"
-
-#include <array>
-#include <utility>
-#include <vector>
-
-namespace astc_codec {
-
-// A logical ASTC block holds the endpoints, indices, and partition information
-// of a compressed block. These values generally do not adhere to any
-// quality-for-bitrate-imposed limits and are solely logical entities for
-// determining the best representation of a given block.
-class LogicalASTCBlock {
- public:
- LogicalASTCBlock(const LogicalASTCBlock&) = default;
- LogicalASTCBlock(LogicalASTCBlock&&) = default;
-
- // Unpack an intermediate block into a logical one.
- LogicalASTCBlock(const Footprint& footprint,
- const IntermediateBlockData& block);
-
- // Unpack a void extent intermediate block into a logical one.
- LogicalASTCBlock(const Footprint& footprint, const VoidExtentData& block);
-
- // Create a new, empty ASTC block
- explicit LogicalASTCBlock(const Footprint& footprint);
-
- // Returns the footprint associated with this block. The footprint is defined
- // via the partition, because the partition definition is dependent on the
- // footprint.
- const Footprint& GetFootprint() const { return partition_.footprint; }
-
- // Returns the unquantized and infilled weight in the range [0, 64] for the
- // given texel location. Assumes that the block is a single-plane block,
- // meaning that weights are used equally across all channels.
- void SetWeightAt(int x, int y, int weight);
- int WeightAt(int x, int y) const;
-
- // Returns the unquantized and infilled weight in the range [0, 64] for the
- // given channel at the given texel location. If the block does not have a
- // dual-plane channel then the reference-returning version will fail, as it
- // cannot return a reference to a value that (potentially) doesn't exist.
- void SetDualPlaneWeightAt(int channel, int x, int y, int weight);
- int DualPlaneWeightAt(int channel, int x, int y) const;
-
- // Returns the color as it would be in the given pixel coordinates of the
- // block. Fails if the coordinates are outside of the range of the block
- // footprint
- RgbaColor ColorAt(int x, int y) const;
-
- // Sets the current partition for the block. |p|'s footprint must match the
- // return value of GetFootprint() or else this call will fail.
- void SetPartition(const Partition& p);
-
- // Sets the endpoints for the given subset.
- void SetEndpoints(const EndpointPair& eps, int subset);
- void SetEndpoints(const Endpoint& ep1, const Endpoint& ep2, int subset) {
- SetEndpoints(std::make_pair(ep1, ep2), subset);
- }
-
- // Sets the dual plane channel for the block. Value must be within the range
- // [0, 3]. If a negative value is passed, then the dual-plane data for the
- // block is removed, and the block is treated as a single-plane block.
- void SetDualPlaneChannel(int channel);
- bool IsDualPlane() const { return dual_plane_.hasValue(); }
-
- private:
- // A block may have up to four endpoint pairs.
- std::vector<EndpointPair> endpoints_;
-
- // Weights are stored as values in the interval [0, 64].
- std::vector<int> weights_;
-
- // The partition information for this block. This determines the
- // appropriate subsets that each pixel should belong to.
- Partition partition_;
-
- // Dual plane data holds both the channel and the weights that describe
- // the dual plane data for the given block. If a block has a dual plane, then
- // we need to know both the channel and the weights associated with it.
- struct DualPlaneData {
- int channel;
- std::vector<int> weights;
- };
-
- // The dual-plane data is optional from a logical representation of the block.
- base::Optional<DualPlaneData> dual_plane_;
-
- // Calculates the unquantized and interpolated weights from the encoded weight
- // values and possibly dual-plane weights specified in the passed ASTC block.
- void CalculateWeights(const Footprint& footprint,
- const IntermediateBlockData& block);
-
- // Calculates the weights for a VoidExtentBlock.
- void CalculateWeights(const Footprint& footprint,
- const VoidExtentData& block);
-};
-
-// Unpacks the physical ASTC block into a logical block. Returns false if the
-// physical block is an error encoded block.
-base::Optional<LogicalASTCBlock> UnpackLogicalBlock(
- const Footprint& footprint, const PhysicalASTCBlock& pb);
-
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_DECODER_LOGICAL_ASTC_BLOCK_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/partition.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/partition.cc
deleted file mode 100644
index 92c3ee0bdc4..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/partition.cc
+++ /dev/null
@@ -1,601 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/partition.h"
-#include "src/base/bottom_n.h"
-#include "src/base/utils.h"
-#include "src/decoder/footprint.h"
-
-#include <algorithm>
-#include <array>
-#include <limits>
-#include <memory>
-#include <numeric>
-#include <queue>
-#include <set>
-#include <unordered_set>
-#include <utility>
-
-namespace astc_codec {
-
-namespace {
-
-// The maximum number of partitions supported by ASTC is four.
-constexpr int kMaxNumSubsets = 4;
-
-// Partition selection function based on the ASTC specification.
-// See section C.2.21
-int SelectASTCPartition(int seed, int x, int y, int z, int partitioncount,
- int num_pixels) {
- if (partitioncount <= 1) {
- return 0;
- }
-
- if (num_pixels < 31) {
- x <<= 1;
- y <<= 1;
- z <<= 1;
- }
-
- seed += (partitioncount - 1) * 1024;
-
- uint32_t rnum = seed;
- rnum ^= rnum >> 15;
- rnum -= rnum << 17;
- rnum += rnum << 7;
- rnum += rnum << 4;
- rnum ^= rnum >> 5;
- rnum += rnum << 16;
- rnum ^= rnum >> 7;
- rnum ^= rnum >> 3;
- rnum ^= rnum << 6;
- rnum ^= rnum >> 17;
-
- uint8_t seed1 = rnum & 0xF;
- uint8_t seed2 = (rnum >> 4) & 0xF;
- uint8_t seed3 = (rnum >> 8) & 0xF;
- uint8_t seed4 = (rnum >> 12) & 0xF;
- uint8_t seed5 = (rnum >> 16) & 0xF;
- uint8_t seed6 = (rnum >> 20) & 0xF;
- uint8_t seed7 = (rnum >> 24) & 0xF;
- uint8_t seed8 = (rnum >> 28) & 0xF;
- uint8_t seed9 = (rnum >> 18) & 0xF;
- uint8_t seed10 = (rnum >> 22) & 0xF;
- uint8_t seed11 = (rnum >> 26) & 0xF;
- uint8_t seed12 = ((rnum >> 30) | (rnum << 2)) & 0xF;
-
- seed1 *= seed1;
- seed2 *= seed2;
- seed3 *= seed3;
- seed4 *= seed4;
- seed5 *= seed5;
- seed6 *= seed6;
- seed7 *= seed7;
- seed8 *= seed8;
- seed9 *= seed9;
- seed10 *= seed10;
- seed11 *= seed11;
- seed12 *= seed12;
-
- int sh1, sh2, sh3;
- if (seed & 1) {
- sh1 = (seed & 2 ? 4 : 5);
- sh2 = (partitioncount == 3 ? 6 : 5);
- } else {
- sh1 = (partitioncount == 3 ? 6 : 5);
- sh2 = (seed & 2 ? 4 : 5);
- }
- sh3 = (seed & 0x10) ? sh1 : sh2;
-
- seed1 >>= sh1;
- seed2 >>= sh2;
- seed3 >>= sh1;
- seed4 >>= sh2;
- seed5 >>= sh1;
- seed6 >>= sh2;
- seed7 >>= sh1;
- seed8 >>= sh2;
-
- seed9 >>= sh3;
- seed10 >>= sh3;
- seed11 >>= sh3;
- seed12 >>= sh3;
-
- int a = seed1 * x + seed2 * y + seed11 * z + (rnum >> 14);
- int b = seed3 * x + seed4 * y + seed12 * z + (rnum >> 10);
- int c = seed5 * x + seed6 * y + seed9 * z + (rnum >> 06);
- int d = seed7 * x + seed8 * y + seed10 * z + (rnum >> 02);
-
- a &= 0x3F;
- b &= 0x3F;
- c &= 0x3F;
- d &= 0x3F;
-
- if (partitioncount <= 3) {
- d = 0;
- }
- if (partitioncount <= 2) {
- c = 0;
- }
-
- if (a >= b && a >= c && a >= d) {
- return 0;
- } else if (b >= c && b >= d) {
- return 1;
- } else if (c >= d) {
- return 2;
- } else {
- return 3;
- }
-}
-
-// A partition hash that we can pass to containers like std::unordered_set
-struct PartitionHasher {
- size_t operator()(const Partition& part) const {
- // The issue here is that if we have two different partitions, A and B, then
- // their hash should be equal if A and B are equal. We define the distance
- // between A and B using PartitionMetric, but internally that finds a 1-1
- // mapping from labels in A to labels in B.
- //
- // With that in mind, when we define a hash for partitions, we need to find
- // a 1-1 mapping to a 'universal' labeling scheme. Here we define that as
- // the heuristic: the first encountered label will be 0, the second will be
- // 1, etc. This creates a unique 1-1 mapping scheme from any partition.
- //
- // Note, we can't use this heuristic for the PartitionMetric, as it will
- // generate very large discrepancies between similar labellings (for example
- // 000...001 vs 011...111). We are just looking for a boolean distinction
- // whether or not two partitions are different and don't care how different
- // they are.
- std::array<int, kMaxNumSubsets> mapping {{ -1, -1, -1, -1 }};
- int next_subset = 0;
- for (int subset : part.assignment) {
- if (mapping[subset] < 0) {
- mapping[subset] = next_subset++;
- }
- }
- assert(next_subset <= kMaxNumSubsets);
-
- // The return value will be the hash of the assignment according to this
- // mapping
- const size_t seed0 = 0;
- return std::accumulate(part.assignment.begin(), part.assignment.end(), seed0,
- [&mapping](size_t seed, const int& subset) {
- std::hash<size_t> hasher;
- const int s = mapping[subset];
- return hasher(seed) ^ hasher(static_cast<size_t>(s));
- });
- }
-};
-
-// Construct a VP-Tree of partitions. Since our PartitionMetric satisfies
-// the triangle inequality, we can use this general higher-dimensional space
-// partitioning tree to organize our partitions.
-//
-// TODO(google): !SPEED! Right now this tree stores an actual linked
-// structure of pointers which is likely very slow during construction and
-// very not cache-coherent during traversal, so it'd probably be good to
-// switch to a flattened binary tree structure if performance becomes an
-// issue.
-class PartitionTree {
- public:
- // Unclear what it means to have an uninitialized tree, so delete default
- // constructors, but allow the tree to be moved
- PartitionTree() = delete;
- PartitionTree(const PartitionTree&) = delete;
- PartitionTree(PartitionTree&& t) = default;
-
- // Generate a PartitionTree from iterators over |Partition|s
- template<typename Itr>
- PartitionTree(Itr begin, Itr end) : parts_(begin, end) {
- std::vector<int> part_indices(parts_.size());
- std::iota(part_indices.begin(), part_indices.end(), 0);
- root_ = std::unique_ptr<PartitionTreeNode>(
- new PartitionTreeNode(parts_, part_indices));
- }
-
- // Search for the k-nearest partitions that are closest to part based on
- // the result of PartitionMetric
- void Search(const Partition& part, int k,
- std::vector<const Partition*>* const results,
- std::vector<int>* const distances) const {
- ResultHeap heap(k);
- SearchNode(root_, part, &heap);
-
- results->clear();
- if (nullptr != distances) {
- distances->clear();
- }
-
- std::vector<ResultNode> search_results = heap.Pop();
- for (const auto& result : search_results) {
- results->push_back(&parts_[result.part_idx]);
- if (nullptr != distances) {
- distances->push_back(result.distance);
- }
- }
-
- assert(results->size() == size_t(k));
- }
-
- private:
- // Heap elements to be stored while searching the tree. The two relevant
- // pieces of information are the partition index and it's distance from the
- // queried partition.
- struct ResultNode {
- int part_idx;
- int distance;
-
- // Heap based on distance from query point.
- bool operator<(const ResultNode& other) const {
- return distance < other.distance;
- }
- };
-
- using ResultHeap = base::BottomN<ResultNode>;
-
- struct PartitionTreeNode {
- int part_idx;
- int split_dist;
-
- std::unique_ptr<PartitionTreeNode> left;
- std::unique_ptr<PartitionTreeNode> right;
-
- PartitionTreeNode(const std::vector<Partition> &parts,
- const std::vector<int> &part_indices)
- : split_dist(-1) {
- assert(part_indices.size() > 0);
-
- right.reset(nullptr);
- left.reset(nullptr);
-
- // Store the first node as our vantage point
- part_idx = part_indices[0];
- const Partition& vantage_point = parts[part_indices[0]];
-
- // Calculate the distances of the remaining nodes against the vantage
- // point.
- std::vector<std::pair<int, int>> part_dists;
- for (size_t i = 1; i < part_indices.size(); ++i) {
- const int idx = part_indices[i];
- const int dist = PartitionMetric(vantage_point, parts[idx]);
- if (dist > 0) {
- part_dists.push_back(std::make_pair(idx, dist));
- }
- }
-
- // If there are no more different parts, then this is a leaf node
- if (part_dists.empty()) {
- return;
- }
-
- struct OrderBySecond {
- typedef std::pair<int, int> PairType;
- bool operator()(const PairType& lhs, const PairType& rhs) {
- return lhs.second < rhs.second;
- }
- };
-
- // We want to partition the set such that the points are ordered
- // based on their distances from the vantage point. We can do this
- // using the partial sort of nth element.
- std::nth_element(
- part_dists.begin(), part_dists.begin() + part_dists.size() / 2,
- part_dists.end(), OrderBySecond());
-
- // Once that's done, our split position is in the middle
- const auto split_iter = part_dists.begin() + part_dists.size() / 2;
- split_dist = split_iter->second;
-
- // Recurse down the right and left sub-trees with the indices of the
- // parts that are farther and closer respectively
- std::vector<int> right_indices;
- for (auto itr = split_iter; itr != part_dists.end(); ++itr) {
- right_indices.push_back(itr->first);
- }
-
- if (!right_indices.empty()) {
- right.reset(new PartitionTreeNode(parts, right_indices));
- }
-
- std::vector<int> left_indices;
- for (auto itr = part_dists.begin(); itr != split_iter; ++itr) {
- left_indices.push_back(itr->first);
- }
-
- if (!left_indices.empty()) {
- left.reset(new PartitionTreeNode(parts, left_indices));
- }
- }
- };
-
- void SearchNode(const std::unique_ptr<PartitionTreeNode>& node,
- const Partition& p, ResultHeap* const heap) const {
- if (nullptr == node) {
- return;
- }
-
- // Calculate distance against current node
- const int dist = PartitionMetric(parts_[node->part_idx], p);
-
- // Push it onto the heap and remove the top-most nodes to maintain
- // closest k indices.
- ResultNode result;
- result.part_idx = node->part_idx;
- result.distance = dist;
- heap->Push(result);
-
- // If the split distance is uninitialized, it means we have no children.
- if (node->split_dist < 0) {
- assert(nullptr == node->left);
- assert(nullptr == node->right);
- return;
- }
-
- // Next we need to check the left and right trees if their distance
- // is closer/farther than the farthest element on the heap
- const int tau = heap->Top().distance;
- if (dist + tau < node->split_dist || dist - tau < node->split_dist) {
- SearchNode(node->left, p, heap);
- }
-
- if (dist + tau > node->split_dist || dist - tau > node->split_dist) {
- SearchNode(node->right, p, heap);
- }
- }
-
- std::vector<Partition> parts_;
- std::unique_ptr<PartitionTreeNode> root_;
-};
-
-// A helper function that generates all of the partitions for each number of
-// subsets in ASTC blocks and stores them in a PartitionTree for fast retrieval.
-const int kNumASTCPartitionIDBits = 10;
-PartitionTree GenerateASTCPartitionTree(Footprint footprint) {
- std::unordered_set<Partition, PartitionHasher> parts;
- for (int num_parts = 2; num_parts <= kMaxNumSubsets; ++num_parts) {
- for (int id = 0; id < (1 << kNumASTCPartitionIDBits); ++id) {
- Partition part = GetASTCPartition(footprint, num_parts, id);
-
- // Make sure we're not using a degenerate partition assignment that wastes
- // an endpoint pair...
- bool valid_part = true;
- for (int i = 0; i < num_parts; ++i) {
- if (std::find(part.assignment.begin(), part.assignment.end(), i) ==
- part.assignment.end()) {
- valid_part = false;
- break;
- }
- }
-
- if (valid_part) {
- parts.insert(std::move(part));
- }
- }
- }
-
- return PartitionTree(parts.begin(), parts.end());
-}
-
-// To avoid needing any fancy boilerplate for mapping from a width, height
-// tuple, we can define a simple encoding for the block mode:
-constexpr int EncodeDims(int width, int height) {
- return (width << 16) | height;
-}
-
-} // namespace
-
-////////////////////////////////////////////////////////////////////////////////
-
-int PartitionMetric(const Partition& a, const Partition& b) {
- // Make sure that one partition is at least a subset of the other...
- UTILS_RELEASE_ASSERT(a.footprint == b.footprint);
-
- // Make sure that the number of parts is within our limits. ASTC has a maximum
- // of four subsets per block according to the specification.
- UTILS_RELEASE_ASSERT(a.num_parts <= kMaxNumSubsets);
- UTILS_RELEASE_ASSERT(b.num_parts <= kMaxNumSubsets);
-
- const int w = a.footprint.Width();
- const int h = b.footprint.Height();
-
- struct PairCount {
- int a;
- int b;
- int count;
-
- // Comparison needed for sort below.
- bool operator>(const PairCount& other) const {
- return count > other.count;
- }
- };
-
- // Since we need to find the smallest mapping from labels in A to labels in B,
- // we need to store each label pair in a structure that can later be sorted.
- // The maximum number of subsets in an ASTC block is four, meaning that
- // between the two partitions, we can have up to sixteen different pairs.
- std::array<PairCount, 16> pair_counts;
- for (int y = 0; y < 4; ++y) {
- for (int x = 0; x < 4; ++x) {
- const int idx = y * 4 + x;
- pair_counts[idx].a = x;
- pair_counts[idx].b = y;
- pair_counts[idx].count = 0;
- }
- }
-
- // Count how many times we see each pair of assigned values (order matters!)
- for (int y = 0; y < h; ++y) {
- for (int x = 0; x < w; ++x) {
- const int idx = y * w + x;
-
- const int a_val = a.assignment[idx];
- const int b_val = b.assignment[idx];
-
- assert(a_val >= 0);
- assert(b_val >= 0);
-
- assert(a_val < 4);
- assert(b_val < 4);
-
- ++(pair_counts[b_val * 4 + a_val].count);
- }
- }
-
- // Sort the pairs in descending order based on their count
- std::sort(pair_counts.begin(), pair_counts.end(), std::greater<PairCount>());
-
- // Now assign pairs one by one until we have no more pairs to assign. Once
- // a value from A is assigned to a value in B, it can no longer be reassigned,
- // so we can keep track of this in a matrix. Similarly, to keep the assignment
- // one-to-one, once a value in B has been assigned to, it cannot be assigned
- // to again.
- std::array<std::array<bool, kMaxNumSubsets>, kMaxNumSubsets> assigned { };
-
- int pixels_matched = 0;
- for (const auto& pair_count : pair_counts) {
- bool is_assigned = false;
- for (int i = 0; i < kMaxNumSubsets; ++i) {
- is_assigned |= assigned.at(pair_count.a).at(i);
- is_assigned |= assigned.at(i).at(pair_count.b);
- }
-
- if (!is_assigned) {
- assigned.at(pair_count.a).at(pair_count.b) = true;
- pixels_matched += pair_count.count;
- }
- }
-
- // The difference is the number of pixels that had an assignment versus the
- // total number of pixels.
- return w * h - pixels_matched;
-}
-
-// Generates the partition assignment for the given block attributes.
-Partition GetASTCPartition(const Footprint& footprint, int num_parts,
- int partition_id) {
- // Partitions must have at least one subset but may have at most four
- assert(num_parts >= 0);
- assert(num_parts <= kMaxNumSubsets);
-
- // Partition ID can be no more than 10 bits.
- assert(partition_id >= 0);
- assert(partition_id < 1 << 10);
-
- Partition part = {footprint, num_parts, partition_id, /* assignment = */ {}};
- part.assignment.reserve(footprint.NumPixels());
-
- // Maintain column-major order so that we match all of the image processing
- // algorithms that depend on this class.
- for (int y = 0; y < footprint.Height(); ++y) {
- for (int x = 0; x < footprint.Width(); ++x) {
- const int p = SelectASTCPartition(partition_id, x, y, 0, num_parts,
- footprint.NumPixels());
- part.assignment.push_back(p);
- }
- }
-
- return part;
-}
-
-const std::vector<const Partition*> FindKClosestASTCPartitions(
- const Partition& candidate, int k) {
- const int encoded_dims = EncodeDims(candidate.footprint.Width(),
- candidate.footprint.Height());
-
- int index = 0;
- switch (encoded_dims) {
- case EncodeDims(4, 4): index = 0; break;
- case EncodeDims(5, 4): index = 1; break;
- case EncodeDims(5, 5): index = 2; break;
- case EncodeDims(6, 5): index = 3; break;
- case EncodeDims(6, 6): index = 4; break;
- case EncodeDims(8, 5): index = 5; break;
- case EncodeDims(8, 6): index = 6; break;
- case EncodeDims(8, 8): index = 7; break;
- case EncodeDims(10, 5): index = 8; break;
- case EncodeDims(10, 6): index = 9; break;
- case EncodeDims(10, 8): index = 10; break;
- case EncodeDims(10, 10): index = 11; break;
- case EncodeDims(12, 10): index = 12; break;
- case EncodeDims(12, 12): index = 13; break;
- default:
- assert(false && "Unknown footprint dimensions. This should have been caught sooner.");
- break;
- }
-
- static const auto* const kASTCPartitionTrees =
- new std::array<PartitionTree, Footprint::NumValidFootprints()> {{
- GenerateASTCPartitionTree(Footprint::Get4x4()),
- GenerateASTCPartitionTree(Footprint::Get5x4()),
- GenerateASTCPartitionTree(Footprint::Get5x5()),
- GenerateASTCPartitionTree(Footprint::Get6x5()),
- GenerateASTCPartitionTree(Footprint::Get6x6()),
- GenerateASTCPartitionTree(Footprint::Get8x5()),
- GenerateASTCPartitionTree(Footprint::Get8x6()),
- GenerateASTCPartitionTree(Footprint::Get8x8()),
- GenerateASTCPartitionTree(Footprint::Get10x5()),
- GenerateASTCPartitionTree(Footprint::Get10x6()),
- GenerateASTCPartitionTree(Footprint::Get10x8()),
- GenerateASTCPartitionTree(Footprint::Get10x10()),
- GenerateASTCPartitionTree(Footprint::Get12x10()),
- GenerateASTCPartitionTree(Footprint::Get12x12()),
- }};
-
- const PartitionTree& parts_vptree = kASTCPartitionTrees->at(index);
- std::vector<const Partition*> results;
- parts_vptree.Search(candidate, k, &results, nullptr);
- return results;
-}
-
-// Returns the valid ASTC partition that is closest to the candidate based on
-// the PartitionMetric defined above.
-const Partition& FindClosestASTCPartition(const Partition& candidate) {
- // Given a candidate, the closest valid partition will likely not be an exact
- // match. Consider all of the texels for which this valid partition differs
- // with the candidate.
- //
- // If the valid partition has more subsets than the candidate, then all of the
- // highest subset will be included in the mismatched texels. Since the number
- // of possible partitions with increasing subsets grows exponentially, the
- // chance that a valid partition with fewer subsets appears within the first
- // few closest partitions is relatively high. Empirically, we can usually find
- // a partition with at most |candidate.num_parts| number of subsets within the
- // first four closest partitions.
- constexpr int kSearchItems = 4;
-
- const std::vector<const Partition*> results =
- FindKClosestASTCPartitions(candidate, kSearchItems);
-
- // Optimistically, look for result with the same number of subsets.
- for (const auto& result : results) {
- if (result->num_parts == candidate.num_parts) {
- return *result;
- }
- }
-
- // If all else fails, then at least find the result with fewer subsets than
- // we asked for.
- for (const auto& result : results) {
- if (result->num_parts < candidate.num_parts) {
- return *result;
- }
- }
-
- assert(false &&
- "Could not find partition with acceptable number of subsets!");
- return *(results[0]);
-}
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/partition.h b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/partition.h
deleted file mode 100644
index 4f64acb8e9f..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/partition.h
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_DECODER_PARTITION_H_
-#define ASTC_CODEC_DECODER_PARTITION_H_
-
-#include "src/base/optional.h"
-#include "src/decoder/footprint.h"
-
-#include <vector>
-
-namespace astc_codec {
-
-struct Partition;
-
-// Determines the "difference" between any two partitions of the same size.
-// This metric attempts to find the best one to one mapping from the labels in
-// partition a against the labels in partition b. Once that mapping is found, it
-// returns the number of pixels that are mismatched between the two. Each
-// partition is expected to start in the upper left corner of the block and
-// proceed in raster-scan order. Two partitions are equal if the mapping is
-// bijective. This metric is a metric in the mathematical sense. In other words
-// it has the following properties:
-//
-// 1) PartitionMetric(a, b) >= 0
-// 2) PartitionMetric(a, b) == PartitionMetric(b, a)
-// 3) PartitionMetric(a, b) == 0 iff a == b
-// 4) PartitionMetric(a, b) + PartitionMetric(b, c) >= PartitionMetric(a, c)
-//
-// Throws an error if one partition's footprint is not equal to the other.
-int PartitionMetric(const Partition& a, const Partition& b);
-
-// A partition is a way to divide up an ASTC block into disjoint subsets such
-// that each subset uses a different set of endpoints. This is used to increase
-// the compression quality of blocks. One way to store such a partition is to
-// assign an ID to use with a predetermined decoding method. Here we store the
-// logical representation of partitions by keeping a per-pixel label. All pixels
-// that share a label belong to the same subset.
-struct Partition {
- // The footprint width and height of this partition. This determines the size
- // of the assignment array.
- Footprint footprint;
-
- // The number of subsets in this partition. The values in the partition
- // assignment fall within the range [0, num_parts). The maximum number of
- // parts supported is four.
- int num_parts;
-
- // The 10-bit partition ID as stored in bits 13-22 of multi-part ASTC blocks.
- // (See Section C.2.9) If there is no guarantee that this partition is a valid
- // ASTC partition, this should be set to absl::nullopt.
- base::Optional<int> partition_id;
-
- // A value in the range [0, num_parts) corresponding to the label for
- // the given texel (x, y) in [0, footprint_width) x [0, footprint_height)
- // using a raster-order layout.
- std::vector<int> assignment;
-
- // Returns true only if their "distance" is zero, i.e. if they have compatible
- // subset assignments.
- bool operator==(const Partition& other) const {
- return PartitionMetric(*this, other) == 0;
- }
-};
-
-// Generates the ASTC partition assignment for the given block attributes.
-Partition GetASTCPartition(const Footprint& footprint, int num_parts,
- int partition_id);
-
-// Returns the |k| valid ASTC partitions that are closest to the candidate based
-// on the PartitionMetric defined above.
-const std::vector<const Partition*> FindKClosestASTCPartitions(
- const Partition& candidate, int k);
-
-// Returns the valid ASTC partition closest to the candidate with at most as
-// many subsets as the |candidate|. Note: this is not a deterministic function,
-// as the underlying valid partitions are sorted using a hash map and a distance
-// function whose range is the natural numbers. The chances that two or more
-// partitions are equally 'closest' is possible, in which case this function
-// makes no guarantees about which one it will return. For more control, use
-// FindKClosestASTCPartitions above.
-const Partition& FindClosestASTCPartition(const Partition& candidate);
-
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_DECODER_PARTITION_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/physical_astc_block.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/physical_astc_block.cc
deleted file mode 100644
index 41369499700..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/physical_astc_block.cc
+++ /dev/null
@@ -1,761 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/physical_astc_block.h"
-#include "src/base/math_utils.h"
-#include "src/base/optional.h"
-#include "src/base/uint128.h"
-#include "src/decoder/integer_sequence_codec.h"
-
-#include <array>
-#include <cmath>
-
-namespace astc_codec {
-
-namespace {
-
-static_assert(static_cast<int>(ColorEndpointMode::kNumColorEndpointModes) == 16,
- "There are only sixteen color endpoint modes defined in the "
- "ASTC specification. If this is false, then the enum may be "
- "incorrect.");
-
-constexpr int kASTCBlockSizeBits = 128;
-//constexpr int kASTCBlockSizeBytes = kASTCBlockSizeBits / 8;
-constexpr uint32_t kVoidExtentMaskBits = 9;
-constexpr uint32_t kVoidExtentMask = 0x1FC;
-constexpr int kWeightGridMinBitLength = 24;
-constexpr int kWeightGridMaxBitLength = 96;
-constexpr int kMaxNumPartitions = 4;
-constexpr int kMaxNumWeights = 64;
-
-// These are the overall block modes defined in table C.2.8. There are 10
-// weight grid encoding schemes + void extent.
-enum class BlockMode {
- kB4_A2,
- kB8_A2,
- kA2_B8,
- kA2_B6,
- kB2_A2,
- k12_A2,
- kA2_12,
- k6_10,
- k10_6,
- kA6_B6,
- kVoidExtent,
-};
-
-struct WeightGridProperties {
- int width;
- int height;
- int range;
-};
-
-// Local function prototypes
-base::Optional<BlockMode> DecodeBlockMode(const base::UInt128 astc_bits);
-base::Optional<WeightGridProperties> DecodeWeightProps(
- const base::UInt128 astc_bits, std::string* error);
-std::array<int, 4> DecodeVoidExtentCoords(const base::UInt128 astc_bits);
-bool DecodeDualPlaneBit(const base::UInt128 astc_bits);
-int DecodeNumPartitions(const base::UInt128 astc_bits);
-int DecodeNumWeightBits(const base::UInt128 astc_bits);
-int DecodeDualPlaneBitStartPos(const base::UInt128 astc_bits);
-ColorEndpointMode DecodeEndpointMode(const base::UInt128 astc_bits,
- int partition);
-int DecodeNumColorValues(const base::UInt128 astc_bits);
-
-// Returns the block mode, if it's valid.
-base::Optional<BlockMode> DecodeBlockMode(const base::UInt128 astc_bits) {
- using Result = base::Optional<BlockMode>;
- const uint64_t low_bits = astc_bits.LowBits();
- if (base::GetBits(low_bits, 0, kVoidExtentMaskBits) == kVoidExtentMask) {
- return Result(BlockMode::kVoidExtent);
- }
-
- if (base::GetBits(low_bits, 0, 2) != 0) {
- const uint64_t mode_bits = base::GetBits(low_bits, 2, 2);
- switch (mode_bits) {
- case 0: return Result(BlockMode::kB4_A2);
- case 1: return Result(BlockMode::kB8_A2);
- case 2: return Result(BlockMode::kA2_B8);
- case 3: return base::GetBits(low_bits, 8, 1) ?
- Result(BlockMode::kB2_A2) : Result(BlockMode::kA2_B6);
- }
- } else {
- const uint64_t mode_bits = base::GetBits(low_bits, 5, 4);
- if ((mode_bits & 0xC) == 0x0) {
- if (base::GetBits(low_bits, 0, 4) == 0) {
- // Reserved.
- return Result();
- } else {
- return Result(BlockMode::k12_A2);
- }
- } else if ((mode_bits & 0xC) == 0x4) {
- return Result(BlockMode::kA2_12);
- } else if (mode_bits == 0xC) {
- return Result(BlockMode::k6_10);
- } else if (mode_bits == 0xD) {
- return Result(BlockMode::k10_6);
- } else if ((mode_bits & 0xC) == 0x8) {
- return Result(BlockMode::kA6_B6);
- }
- }
-
- return Result();
-}
-
-base::Optional<WeightGridProperties> DecodeWeightProps(
- const base::UInt128 astc_bits, std::string* error) {
- auto block_mode = DecodeBlockMode(astc_bits);
- if (!block_mode) {
- *error = "Reserved block mode";
- return {};
- }
-
- // The dimensions of the weight grid and their range
- WeightGridProperties props;
-
- // Determine the weight extents based on the block mode
- const uint32_t low_bits =
- static_cast<uint32_t>(astc_bits.LowBits() & 0xFFFFFFFF);
- switch (block_mode.value()) {
- case BlockMode::kB4_A2: {
- int a = base::GetBits(low_bits, 5, 2);
- int b = base::GetBits(low_bits, 7, 2);
- props.width = b + 4;
- props.height = a + 2;
- }
- break;
-
- case BlockMode::kB8_A2: {
- int a = base::GetBits(low_bits, 5, 2);
- int b = base::GetBits(low_bits, 7, 2);
- props.width = b + 8;
- props.height = a + 2;
- }
- break;
-
- case BlockMode::kA2_B8: {
- int a = base::GetBits(low_bits, 5, 2);
- int b = base::GetBits(low_bits, 7, 2);
- props.width = a + 2;
- props.height = b + 8;
- }
- break;
-
- case BlockMode::kA2_B6: {
- int a = base::GetBits(low_bits, 5, 2);
- int b = base::GetBits(low_bits, 7, 1);
- props.width = a + 2;
- props.height = b + 6;
- }
- break;
-
- case BlockMode::kB2_A2: {
- int a = base::GetBits(low_bits, 5, 2);
- int b = base::GetBits(low_bits, 7, 1);
- props.width = b + 2;
- props.height = a + 2;
- }
- break;
-
- case BlockMode::k12_A2: {
- int a = base::GetBits(low_bits, 5, 2);
- props.width = 12;
- props.height = a + 2;
- }
- break;
-
- case BlockMode::kA2_12: {
- int a = base::GetBits(low_bits, 5, 2);
- props.width = a + 2;
- props.height = 12;
- }
- break;
-
- case BlockMode::k6_10: {
- props.width = 6;
- props.height = 10;
- }
- break;
-
- case BlockMode::k10_6: {
- props.width = 10;
- props.height = 6;
- }
- break;
-
- case BlockMode::kA6_B6: {
- int a = base::GetBits(low_bits, 5, 2);
- int b = base::GetBits(low_bits, 9, 2);
- props.width = a + 6;
- props.height = b + 6;
- }
- break;
-
- // Void extent blocks have no weight grid.
- case BlockMode::kVoidExtent:
- *error = "Void extent block has no weight grid";
- return {};
-
- // We have a valid block mode which isn't a void extent? We
- // should be able to decode the weight grid dimensions.
- default:
- assert(false && "Error decoding weight grid");
- *error = "Internal error";
- return {};
- }
-
- // Determine the weight range based on the block mode
- uint32_t r = base::GetBits(low_bits, 4, 1);
- switch (block_mode.value()) {
- case BlockMode::kB4_A2:
- case BlockMode::kB8_A2:
- case BlockMode::kA2_B8:
- case BlockMode::kA2_B6:
- case BlockMode::kB2_A2: {
- r |= base::GetBits(low_bits, 0, 2) << 1;
- }
- break;
-
- case BlockMode::k12_A2:
- case BlockMode::kA2_12:
- case BlockMode::k6_10:
- case BlockMode::k10_6:
- case BlockMode::kA6_B6: {
- r |= base::GetBits(low_bits, 2, 2) << 1;
- }
- break;
-
- // We have a valid block mode which doesn't have weights? We
- // should have caught this earlier.
- case BlockMode::kVoidExtent:
- default:
- assert(false && "Error decoding weight grid");
- *error = "Internal error";
- return {};
- }
-
- // Decode the range...
- // High bit is in bit 9 unless we're using a particular block mode
- uint32_t h = base::GetBits(low_bits, 9, 1);
- if (block_mode == BlockMode::kA6_B6) {
- h = 0;
- }
-
- // Figure out the range of the weights (Table C.2.7)
- constexpr std::array<int, 16> kWeightRanges = {{
- -1, -1, 1, 2, 3, 4, 5, 7, -1, -1, 9, 11, 15, 19, 23, 31
- }};
-
- assert(((h << 3) | r) < kWeightRanges.size());
-
- props.range = kWeightRanges.at((h << 3) | r);
- if (props.range < 0) {
- *error = "Reserved range for weight bits";
- return {};
- }
-
- // Error checking -- do we have too many weights?
- int num_weights = props.width * props.height;
- if (DecodeDualPlaneBit(astc_bits)) {
- num_weights *= 2;
- }
-
- if (kMaxNumWeights < num_weights) {
- *error = "Too many weights specified";
- return {};
- }
-
- // Do we have too many weight bits?
- const int bit_count =
- IntegerSequenceCodec::GetBitCountForRange(num_weights, props.range);
-
- if (bit_count < kWeightGridMinBitLength) {
- *error = "Too few bits required for weight grid";
- return {};
- }
-
- if (kWeightGridMaxBitLength < bit_count) {
- *error = "Too many bits required for weight grid";
- return {};
- }
-
- return props;
-}
-
-// Returns the four 13-bit integers that define the range of texture
-// coordinates present in a void extent block as defined in Section
-// C.2.23 of the specification. The coordinates returned are of
-// the form (min_s, max_s, min_t, max_t)
-std::array<int, 4> DecodeVoidExtentCoords(const base::UInt128 astc_bits) {
- const uint64_t low_bits = astc_bits.LowBits();
-
- std::array<int, 4> coords;
- for (int i = 0; i < 4; ++i) {
- coords[i] = static_cast<int>(base::GetBits(low_bits, 12 + 13 * i, 13));
- }
-
- return coords;
-}
-
-bool DecodeDualPlaneBit(const base::UInt128 astc_bits) {
- base::Optional<BlockMode> block_mode = DecodeBlockMode(astc_bits);
-
- // Void extent blocks certainly aren't dual-plane.
- if (block_mode == BlockMode::kVoidExtent) {
- return false;
- }
-
- // One special block mode doesn't have any dual plane bit
- if (block_mode == BlockMode::kA6_B6) {
- return false;
- }
-
- // Otherwise, dual plane is determined by the 10th bit.
- constexpr int kDualPlaneBitPosition = 10;
- return base::GetBits(astc_bits, kDualPlaneBitPosition, 1) != 0;
-}
-
-int DecodeNumPartitions(const base::UInt128 astc_bits) {
- constexpr int kNumPartitionsBitPosition = 11;
- constexpr int kNumPartitionsBitLength = 2;
-
- // Non-void extent blocks
- const uint64_t low_bits = astc_bits.LowBits();
- const int num_partitions = 1 + static_cast<int>(
- base::GetBits(low_bits,
- kNumPartitionsBitPosition,
- kNumPartitionsBitLength));
- assert(num_partitions > 0);
- assert(num_partitions <= kMaxNumPartitions);
-
- return num_partitions;
-}
-
-int DecodeNumWeightBits(const base::UInt128 astc_bits) {
- std::string error;
- auto maybe_weight_props = DecodeWeightProps(astc_bits, &error);
- if (!maybe_weight_props.hasValue()) {
- return 0; // No weights? No weight bits...
- }
-
- const auto weight_props = maybe_weight_props.value();
-
- // Figure out the number of weights
- int num_weights = weight_props.width * weight_props.height;
- if (DecodeDualPlaneBit(astc_bits)) {
- num_weights *= 2;
- }
-
- // The number of bits is determined by the number of values
- // that are going to be encoded using the given ise_counts.
- return IntegerSequenceCodec::GetBitCountForRange(
- num_weights, weight_props.range);
-}
-
-// Returns the number of bits after the weight data used to
-// store additional CEM bits.
-int DecodeNumExtraCEMBits(const base::UInt128 astc_bits) {
- const int num_partitions = DecodeNumPartitions(astc_bits);
-
- // Do we only have one partition?
- if (num_partitions == 1) {
- return 0;
- }
-
- // Do we have a shared CEM?
- constexpr int kSharedCEMBitPosition = 23;
- constexpr int kSharedCEMBitLength = 2;
- const base::UInt128 shared_cem =
- base::GetBits(astc_bits, kSharedCEMBitPosition, kSharedCEMBitLength);
- if (shared_cem == 0) {
- return 0;
- }
-
- const std::array<int, 4> extra_cem_bits_for_partition = {{ 0, 2, 5, 8 }};
- return extra_cem_bits_for_partition[num_partitions - 1];
-}
-
-// Returns the starting position of the dual plane channel. This comes
-// before the weight data and extra CEM bits.
-int DecodeDualPlaneBitStartPos(const base::UInt128 astc_bits) {
- const int start_pos = kASTCBlockSizeBits
- - DecodeNumWeightBits(astc_bits)
- - DecodeNumExtraCEMBits(astc_bits);
-
- if (DecodeDualPlaneBit(astc_bits)) {
- return start_pos - 2;
- } else {
- return start_pos;
- }
-}
-
-// Decodes a CEM mode based on the partition number.
-ColorEndpointMode DecodeEndpointMode(const base::UInt128 astc_bits,
- int partition) {
- int num_partitions = DecodeNumPartitions(astc_bits);
- assert(partition >= 0);
- assert(partition < num_partitions);
-
- // Do we only have one partition?
- uint64_t low_bits = astc_bits.LowBits();
- if (num_partitions == 1) {
- uint64_t cem = base::GetBits(low_bits, 13, 4);
- return static_cast<ColorEndpointMode>(cem);
- }
-
- // More than one partition ... do we have a shared CEM?
- if (DecodeNumExtraCEMBits(astc_bits) == 0) {
- const uint64_t shared_cem = base::GetBits(low_bits, 25, 4);
- return static_cast<ColorEndpointMode>(shared_cem);
- }
-
- // More than one partition and no shared CEM...
- uint64_t cem = base::GetBits(low_bits, 23, 6);
- const int base_cem = static_cast<int>(((cem & 0x3) - 1) * 4);
- cem >>= 2; // Skip the base CEM bits
-
- // The number of extra CEM bits at the end of the weight grid is
- // determined by the number of partitions and what the base cem mode is...
- const int num_extra_cem_bits = DecodeNumExtraCEMBits(astc_bits);
- const int extra_cem_start_pos = kASTCBlockSizeBits
- - num_extra_cem_bits
- - DecodeNumWeightBits(astc_bits);
-
- base::UInt128 extra_cem =
- base::GetBits(astc_bits, extra_cem_start_pos, num_extra_cem_bits);
- cem |= extra_cem.LowBits() << 4;
-
- // Decode C and M per Figure C.4
- int c = -1, m = -1;
- for (int i = 0; i < num_partitions; ++i) {
- if (i == partition) {
- c = cem & 0x1;
- }
- cem >>= 1;
- }
-
- for (int i = 0; i < num_partitions; ++i) {
- if (i == partition) {
- m = cem & 0x3;
- }
- cem >>= 2;
- }
-
- assert(c >= 0);
- assert(m >= 0);
-
- // Compute the mode based on C and M
- const int mode = base_cem + 4 * c + m;
- assert(mode < static_cast<int>(ColorEndpointMode::kNumColorEndpointModes));
- return static_cast<ColorEndpointMode>(mode);
-}
-
-int DecodeNumColorValues(const base::UInt128 astc_bits) {
- int num_color_values = 0;
- auto num_partitions = DecodeNumPartitions(astc_bits);
- for (int i = 0; i < num_partitions; ++i) {
- ColorEndpointMode endpoint_mode = DecodeEndpointMode(astc_bits, i);
- num_color_values += NumColorValuesForEndpointMode(endpoint_mode);
- }
-
- return num_color_values;
-}
-
-} // namespace
-
-////////////////////////////////////////////////////////////////////////////////
-
-static_assert(sizeof(PhysicalASTCBlock) == PhysicalASTCBlock::kSizeInBytes,
- "The size of the struct should be the size of the block so that"
- "we can effectively use them contiguously in memory.");
-
-PhysicalASTCBlock::PhysicalASTCBlock(const base::UInt128 astc_block)
- : astc_bits_(astc_block) {}
-
-PhysicalASTCBlock::PhysicalASTCBlock(const std::string& encoded_block)
- : astc_bits_([&encoded_block]() {
- assert(encoded_block.size() == PhysicalASTCBlock::kSizeInBytes);
- base::UInt128 astc_bits = 0;
- int shift = 0;
- for (const unsigned char c : encoded_block) {
- astc_bits |= base::UInt128(static_cast<uint64_t>(c)) << shift;
- shift += 8;
- }
- return astc_bits;
- }())
-{ }
-
-base::Optional<std::string> PhysicalASTCBlock::IsIllegalEncoding() const {
- // If the block is not a void extent block, then it must have
- // weights specified. DecodeWeightProps will return the weight specifications
- // if they exist and are legal according to C.2.24, and will otherwise be
- // empty.
- base::Optional<BlockMode> block_mode = DecodeBlockMode(astc_bits_);
- if (block_mode != BlockMode::kVoidExtent) {
- std::string error;
- auto maybe_weight_props = DecodeWeightProps(astc_bits_, &error);
- if (!maybe_weight_props.hasValue()) {
- return error;
- }
- }
-
- // Check void extent blocks...
- if (block_mode == BlockMode::kVoidExtent) {
- // ... for reserved bits incorrectly set
- if (base::GetBits(astc_bits_, 10, 2) != 0x3) {
- return std::string("Reserved bits set for void extent block");
- }
-
- // ... for incorrectly defined texture coordinates
- std::array<int, 4> coords = DecodeVoidExtentCoords(astc_bits_);
-
- bool coords_all_1s = true;
- for (const auto coord : coords) {
- coords_all_1s &= coord == ((1 << 13) - 1);
- }
-
- if (!coords_all_1s && (coords[0] >= coords[1] || coords[2] >= coords[3])) {
- return std::string("Void extent texture coordinates are invalid");
- }
- }
-
- // If the number of color values exceeds a threshold and it isn't a void
- // extent block then we've run into an error
- if (block_mode != BlockMode::kVoidExtent) {
- int num_color_vals = DecodeNumColorValues(astc_bits_);
- if (num_color_vals > 18) {
- return std::string("Too many color values");
- }
-
- // The maximum number of available color bits is the number of
- // bits between the dual plane bits and the base CEM. This must
- // be larger than a threshold defined in C.2.24.
-
- // Dual plane bit starts after weight bits and CEM
- const int num_partitions = DecodeNumPartitions(astc_bits_);
- const int dual_plane_start_pos = DecodeDualPlaneBitStartPos(astc_bits_);
- const int color_start_bit = (num_partitions == 1) ? 17 : 29;
-
- const int required_color_bits = ((13 * num_color_vals) + 4) / 5;
- const int available_color_bits = dual_plane_start_pos - color_start_bit;
- if (available_color_bits < required_color_bits) {
- return std::string("Not enough color bits");
- }
-
- // If we have four partitions and a dual plane then we have a problem.
- if (num_partitions == 4 && DecodeDualPlaneBit(astc_bits_)) {
- return std::string("Both four partitions and dual plane specified");
- }
- }
-
- // Otherwise we're OK
- return { };
-}
-
-bool PhysicalASTCBlock::IsVoidExtent() const {
- // If it's an error block, it's not a void extent block.
- if (IsIllegalEncoding()) {
- return false;
- }
-
- return DecodeBlockMode(astc_bits_) == BlockMode::kVoidExtent;
-}
-
-base::Optional<std::array<int, 4>> PhysicalASTCBlock::VoidExtentCoords() const {
- if (IsIllegalEncoding() || !IsVoidExtent()) {
- return { };
- }
-
- // If void extent coords are all 1's then these are not valid void extent
- // coords
- const uint64_t ve_mask = 0xFFFFFFFFFFFFFDFFULL;
- const uint64_t const_blk_mode = 0xFFFFFFFFFFFFFDFCULL;
- if ((ve_mask & astc_bits_.LowBits()) == const_blk_mode) {
- return {};
- }
-
- return DecodeVoidExtentCoords(astc_bits_);
-}
-
-bool PhysicalASTCBlock::IsDualPlane() const {
- // If it's an error block, then we aren't a dual plane block
- if (IsIllegalEncoding()) {
- return false;
- }
-
- return DecodeDualPlaneBit(astc_bits_);
-}
-
-// Returns the number of weight bits present in this block
-base::Optional<int> PhysicalASTCBlock::NumWeightBits() const {
- // If it's an error block, then we have no weight bits.
- if (IsIllegalEncoding()) return { };
-
- // If it's a void extent block, we have no weight bits
- if (IsVoidExtent()) return { };
-
- return DecodeNumWeightBits(astc_bits_);
-}
-
-base::Optional<int> PhysicalASTCBlock::WeightStartBit() const {
- if (IsIllegalEncoding()) return { };
- if (IsVoidExtent()) return { };
-
- return kASTCBlockSizeBits - DecodeNumWeightBits(astc_bits_);
-}
-
-base::Optional<std::array<int, 2>> PhysicalASTCBlock::WeightGridDims() const {
- std::string error;
- auto weight_props = DecodeWeightProps(astc_bits_, &error);
-
- if (!weight_props.hasValue()) return { };
- if (IsIllegalEncoding()) return { };
-
- const auto props = weight_props.value();
- return {{{ props.width, props.height }}};
-}
-
-base::Optional<int> PhysicalASTCBlock::WeightRange() const {
- std::string error;
- auto weight_props = DecodeWeightProps(astc_bits_, &error);
-
- if (!weight_props.hasValue()) return { };
- if (IsIllegalEncoding()) return { };
-
- return weight_props.value().range;
-}
-
-base::Optional<int> PhysicalASTCBlock::DualPlaneChannel() const {
- if (!IsDualPlane()) return { };
-
- int dual_plane_start_pos = DecodeDualPlaneBitStartPos(astc_bits_);
- auto plane_bits = base::GetBits(astc_bits_, dual_plane_start_pos, 2);
- return base::Optional<int>(static_cast<int>(plane_bits.LowBits()));
-}
-
-base::Optional<int> PhysicalASTCBlock::ColorStartBit() const {
- if (IsVoidExtent()) {
- return 64;
- }
-
- auto num_partitions = NumPartitions();
- if (!num_partitions) return { };
-
- return (num_partitions == 1) ? 17 : 29;
-}
-
-base::Optional<int> PhysicalASTCBlock::NumColorValues() const {
- // If we have a void extent block, then we have four color values
- if (IsVoidExtent()) {
- return 4;
- }
-
- // If we have an illegal encoding, then we have no color values
- if (IsIllegalEncoding()) return { };
-
- return DecodeNumColorValues(astc_bits_);
-}
-
-void PhysicalASTCBlock::GetColorValuesInfo(int* const color_bits,
- int* const color_range) const {
- // Figure out the range possible for the number of values we have...
- const int dual_plane_start_pos = DecodeDualPlaneBitStartPos(astc_bits_);
- const int max_color_bits = dual_plane_start_pos - ColorStartBit().value();
- const int num_color_values = NumColorValues().value();
- for (int range = 255; range > 0; --range) {
- const int bitcount =
- IntegerSequenceCodec::GetBitCountForRange(num_color_values, range);
- if (bitcount <= max_color_bits) {
- if (color_bits != nullptr) {
- *color_bits = bitcount;
- }
-
- if (color_range != nullptr) {
- *color_range = range;
- }
- return;
- }
- }
-
- assert(false &&
- "This means that even if we have a range of one there aren't "
- "enough bits to store the color values, and our encoding is "
- "illegal.");
-}
-
-base::Optional<int> PhysicalASTCBlock::NumColorBits() const {
- if (IsIllegalEncoding()) return { };
-
- if (IsVoidExtent()) {
- return 64;
- }
-
- int color_bits;
- GetColorValuesInfo(&color_bits, nullptr);
- return color_bits;
-}
-
-base::Optional<int> PhysicalASTCBlock::ColorValuesRange() const {
- if (IsIllegalEncoding()) return { };
-
- if (IsVoidExtent()) {
- return (1 << 16) - 1;
- }
-
- int color_range;
- GetColorValuesInfo(nullptr, &color_range);
- return color_range;
-}
-
-base::Optional<int> PhysicalASTCBlock::NumPartitions() const {
- // Error blocks have no partitions
- if (IsIllegalEncoding()) return { };
-
- // Void extent blocks have no partitions either
- if (DecodeBlockMode(astc_bits_) == BlockMode::kVoidExtent) {
- return { };
- }
-
- // All others have some number of partitions
- return DecodeNumPartitions(astc_bits_);
-}
-
-base::Optional<int> PhysicalASTCBlock::PartitionID() const {
- auto num_partitions = NumPartitions();
- if (!num_partitions || num_partitions == 1) return { };
-
- const uint64_t low_bits = astc_bits_.LowBits();
- return static_cast<int>(base::GetBits(low_bits, 13, 10));
-}
-
-base::Optional<ColorEndpointMode> PhysicalASTCBlock::GetEndpointMode(
- int partition) const {
- // Error block?
- if (IsIllegalEncoding()) return { };
-
- // Void extent blocks have no endpoint modes
- if (DecodeBlockMode(astc_bits_) == BlockMode::kVoidExtent) {
- return { };
- }
-
- // Do we even have a CEM for this partition?
- if (partition < 0 || DecodeNumPartitions(astc_bits_) <= partition) {
- return { };
- }
-
- return DecodeEndpointMode(astc_bits_, partition);
-}
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/physical_astc_block.h b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/physical_astc_block.h
deleted file mode 100644
index 1b04bddad41..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/physical_astc_block.h
+++ /dev/null
@@ -1,128 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_DECODER_PHYSICAL_ASTC_BLOCK_H_
-#define ASTC_CODEC_DECODER_PHYSICAL_ASTC_BLOCK_H_
-
-// The logic in this file is based on the ASTC specification, which can be
-// found here:
-// https://www.opengl.org/registry/specs/KHR/texture_compression_astc_hdr.txt
-
-#include "src/base/optional.h"
-#include "src/base/uint128.h"
-#include "src/decoder/types.h"
-
-#include <string>
-
-namespace astc_codec {
-
-// A PhysicalASTCBlock contains all 128 bits and the logic for decoding the
-// various internals of an ASTC block.
-class PhysicalASTCBlock {
- public:
- // The physical size in bytes of an ASTC block
- static const size_t kSizeInBytes = 16;
-
- // Initializes an ASTC block based on the encoded string.
- explicit PhysicalASTCBlock(const std::string& encoded_block);
- explicit PhysicalASTCBlock(const base::UInt128 astc_block);
-
- // Returns the 128 bits of this ASTC block.
- base::UInt128 GetBlockBits() const { return astc_bits_; }
-
- // Weights are stored in a grid that may not have the same dimensions
- // as the block dimensions. This allows us to see what the physical
- // dimensions are of the grid.
- base::Optional<std::array<int, 2>> WeightGridDims() const;
-
- // The weight range is the maximum value a weight can take in the
- // weight grid.
- base::Optional<int> WeightRange() const;
-
- // Returns true if the block encoding specifies a void-extent block. This
- // kind of block stores a single color to be used for every pixel in the
- // block.
- bool IsVoidExtent() const;
-
- // Returns the values (min_s, max_s, min_t, max_t) as defined in the void
- // extent block as the range of texture coordinates for which this block is
- // defined. (See Section C.2.23)
- base::Optional<std::array<int, 4>> VoidExtentCoords() const;
-
- // Returns true if the block contains two separate weight grids. One used
- // for the channel returned by DualPlaneChannel() and one used by the other
- // channels.
- bool IsDualPlane() const;
-
- // Returns the channel used as the "dual plane". The return value is only
- // meaningful if IsDualPlane() returns true...
- base::Optional<int> DualPlaneChannel() const;
-
- // Returns a reason that the encoding doesn't adhere to the specification.
- // If the encoding is legal, then this returns a nullptr. This allows us to
- // still use code of the form:
- //
- // if (IsIllegalEncoding()) {
- // ... error ...
- // }
- // ... no error ...
- //
- // However, it also helps with debugging since we can find problems with
- // encodings a lot faster.
- base::Optional<std::string> IsIllegalEncoding() const;
-
- // Returns the number of weight bits present in this block.
- base::Optional<int> NumWeightBits() const;
-
- // Returns the starting position within the range [0, 127] of the
- // weight data within the block.
- base::Optional<int> WeightStartBit() const;
-
- // Returns the number of endpoint pairs used in this block.
- base::Optional<int> NumPartitions() const;
-
- // Returns the seed used to determine the partition for a given
- // (x, y) coordinate within the block. Determined using the
- // block size and the function as described in the specification.
- base::Optional<int> PartitionID() const;
-
- // Returns the color endpoint mode for the given partition index.
- base::Optional<ColorEndpointMode> GetEndpointMode(int partition) const;
-
- // Returns the starting position within the range [0, 127] of the
- // color data within the block.
- base::Optional<int> ColorStartBit() const;
-
- // Returns the number of integers used to represent the color endpoints.
- base::Optional<int> NumColorValues() const;
-
- // Returns the number of bits used to represent the color endpoints.
- base::Optional<int> NumColorBits() const;
-
- // Returns the maximum value that each of the encoded integers used to
- // represent the color endpoints can take.
- base::Optional<int> ColorValuesRange() const;
-
- private:
- const base::UInt128 astc_bits_;
-
- // The logic to return the number of color bits and the color values range
- // is very similar, so it's probably best to abstract it away into its own
- // function.
- void GetColorValuesInfo(int* color_bits, int* color_range) const;
-};
-
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_DECODER_PHYSICAL_ASTC_BLOCK_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/quantization.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/quantization.cc
deleted file mode 100644
index 233d13cd230..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/quantization.cc
+++ /dev/null
@@ -1,462 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/quantization.h"
-#include "src/base/math_utils.h"
-
-#include <algorithm>
-#include <array>
-#include <cassert>
-#include <map>
-#include <memory>
-#include <vector>
-
-namespace astc_codec {
-
-namespace {
-
-// Trit unquantization procedure as described in Section C.2.13
-int GetUnquantizedTritValue(int trit, int bits, int range) {
- int a = (bits & 1) ? 0x1FF : 0;
- int b = 0, c = 0;
- switch (range) {
- case 5: {
- b = 0;
- c = 204;
- }
- break;
-
- case 11: {
- int x = (bits >> 1) & 0x1;
- b = (x << 1) | (x << 2) | (x << 4) | (x << 8);
- c = 93;
- }
- break;
-
- case 23: {
- int x = (bits >> 1) & 0x3;
- b = x | (x << 2) | (x << 7);
- c = 44;
- }
- break;
-
- case 47: {
- int x = (bits >> 1) & 0x7;
- b = x | (x << 6);
- c = 22;
- }
- break;
-
- case 95: {
- int x = (bits >> 1) & 0xF;
- b = (x >> 2) | (x << 5);
- c = 11;
- }
- break;
-
- case 191: {
- int x = (bits >> 1) & 0x1F;
- b = (x >> 4) | (x << 4);
- c = 5;
- }
- break;
-
- default:
- assert(false && "Illegal trit encoding");
- break;
- }
-
- int t = trit * c + b;
- t ^= a;
- t = (a & 0x80) | (t >> 2);
- return t;
-}
-
-// Quint unquantization procedure as described in Section C.2.13
-int GetUnquantizedQuintValue(int quint, int bits, int range) {
- int a = (bits & 1) ? 0x1FF : 0;
- int b = 0, c = 0;
- switch (range) {
- case 9: {
- b = 0;
- c = 113;
- }
- break;
-
- case 19: {
- int x = (bits >> 1) & 0x1;
- b = (x << 2) | (x << 3) | (x << 8);
- c = 54;
- }
- break;
-
- case 39: {
- int x = (bits >> 1) & 0x3;
- b = (x >> 1) | (x << 1) | (x << 7);
- c = 26;
- }
- break;
-
- case 79: {
- int x = (bits >> 1) & 0x7;
- b = (x >> 1) | (x << 6);
- c = 13;
- }
- break;
-
- case 159: {
- int x = (bits >> 1) & 0xF;
- b = (x >> 3) | (x << 5);
- c = 6;
- }
- break;
-
- default:
- assert(false && "Illegal quint encoding");
- break;
- }
-
- int t = quint * c + b;
- t ^= a;
- t = (a & 0x80) | (t >> 2);
- return t;
-}
-
-// Trit unquantization procedure as described in Section C.2.17. In the code
-// below, the variables a, b, and c correspond to the columns A, B, and C in
-// the specification.
-int GetUnquantizedTritWeight(int trit, int bits, int range) {
- int a = (bits & 1) ? 0x7F : 0;
- int b = 0, c = 0;
- switch (range) {
- case 2:
- return (std::array<int, 3> {{ 0, 32, 63 }})[trit];
-
- case 5:
- c = 50;
- b = 0;
- break;
-
- case 11: {
- c = 23;
- b = (bits >> 1) & 1;
- b |= (b << 2) | (b << 6);
- }
- break;
-
- case 23: {
- c = 11;
- b = (bits >> 1) & 0x3;
- b |= (b << 5);
- }
- break;
-
- default:
- assert(false && "Illegal trit encoding");
- break;
- }
-
- int t = trit * c + b;
- t ^= a;
- t = (a & 0x20) | (t >> 2);
- return t;
-}
-
-// Quint unquantization procedure as described in Section C.2.17. In the code
-// below, the variables a, b, and c correspond to the columns A, B, and C in
-// the specification.
-int GetUnquantizedQuintWeight(int quint, int bits, int range) {
- int a = (bits & 1) ? 0x7F : 0;
- int b = 0, c = 0;
- switch (range) {
- case 4:
- return (std::array<int, 5> {{ 0, 16, 32, 47, 63 }})[quint];
-
- case 9:
- c = 28;
- b = 0;
- break;
-
- case 19: {
- c = 13;
- b = (bits >> 1) & 0x1;
- b = (b << 1) | (b << 6);
- }
- break;
-
- default:
- assert(false && "Illegal quint encoding");
- break;
- }
-
- int t = quint * c + b;
- t ^= a;
- t = (a & 0x20) | (t >> 2);
- return t;
-}
-
-// A Quantization map allows us to convert to/from values that are quantized
-// according to the ASTC spec.
-class QuantizationMap {
- public:
- int Quantize(size_t x) const {
- return x < quantization_map_.size() ? quantization_map_.at(x) : 0;
- }
-
- int Unquantize(size_t x) const {
- return x < unquantization_map_.size() ? unquantization_map_.at(x) : 0;
- }
-
- protected:
- QuantizationMap() { }
- std::vector<int> quantization_map_;
- std::vector<int> unquantization_map_;
-
- void GenerateQuantizationMap() {
- assert(unquantization_map_.size() > 1);
- quantization_map_.clear();
-
- // TODO(google) For weights, we don't need quantization values all the
- // way up to 256, but it doesn't hurt -- just wastes memory, but the code
- // is much cleaner this way
- for (int i = 0; i < 256; ++i) {
- int best_idx = 0;
- int best_idx_score = 256;
- int idx = 0;
- for (int unquantized_val : unquantization_map_) {
- const int diff = i - unquantized_val;
- const int idx_score = diff * diff;
- if (idx_score < best_idx_score) {
- best_idx = idx;
- best_idx_score = idx_score;
- }
- idx++;
- }
-
- quantization_map_.push_back(best_idx);
- }
- }
-};
-
-template<int (*UnquantizationFunc)(int, int, int)>
-class TritQuantizationMap : public QuantizationMap {
- public:
- explicit TritQuantizationMap(int range) : QuantizationMap() {
- assert((range + 1) % 3 == 0);
- const int num_bits_pow_2 = (range + 1) / 3;
- const int num_bits =
- num_bits_pow_2 == 0 ? 0 : base::Log2Floor(num_bits_pow_2);
-
- for (int trit = 0; trit < 3; ++trit) {
- for (int bits = 0; bits < (1 << num_bits); ++bits) {
- unquantization_map_.push_back(UnquantizationFunc(trit, bits, range));
- }
- }
-
- GenerateQuantizationMap();
- }
-};
-
-template<int (*UnquantizationFunc)(int, int, int)>
-class QuintQuantizationMap : public QuantizationMap {
- public:
- explicit QuintQuantizationMap(int range) : QuantizationMap() {
- assert((range + 1) % 5 == 0);
- const int num_bits_pow_2 = (range + 1) / 5;
- const int num_bits =
- num_bits_pow_2 == 0 ? 0 : base::Log2Floor(num_bits_pow_2);
-
- for (int quint = 0; quint < 5; ++quint) {
- for (int bits = 0; bits < (1 << num_bits); ++bits) {
- unquantization_map_.push_back(UnquantizationFunc(quint, bits, range));
- }
- }
-
- GenerateQuantizationMap();
- }
-};
-
-template<int TotalUnquantizedBits>
-class BitQuantizationMap : public QuantizationMap {
- public:
- explicit BitQuantizationMap<TotalUnquantizedBits>(int range)
- : QuantizationMap() {
- // Make sure that if we're using bits then we have a positive power of two.
- assert(base::CountOnes(range + 1) == 1);
-
- const int num_bits = base::Log2Floor(range + 1);
- for (int bits = 0; bits <= range; ++bits) {
- // Need to replicate bits until we fill up the bits
- size_t unquantized = bits;
- int num_unquantized_bits = num_bits;
- while (num_unquantized_bits < TotalUnquantizedBits) {
- const int num_dst_bits_to_shift_up =
- std::min(num_bits, TotalUnquantizedBits - num_unquantized_bits);
- const int num_src_bits_to_shift_down =
- num_bits - num_dst_bits_to_shift_up;
- unquantized <<= num_dst_bits_to_shift_up;
- unquantized |= bits >> num_src_bits_to_shift_down;
- num_unquantized_bits += num_dst_bits_to_shift_up;
- }
- assert(num_unquantized_bits == TotalUnquantizedBits);
-
- unquantization_map_.push_back(int(unquantized));
-
- // Fill half of the quantization map with the previous value for bits
- // and the other half with the current value for bits
- if (bits > 0) {
- const size_t prev_unquant = unquantization_map_.at(bits - 1);
- while (quantization_map_.size() <= (prev_unquant + unquantized) / 2) {
- quantization_map_.push_back(bits - 1);
- }
- }
- while (quantization_map_.size() <= unquantized) {
- quantization_map_.push_back(bits);
- }
- }
-
- assert(quantization_map_.size() == 1 << TotalUnquantizedBits);
- }
-};
-
-using QMap = std::shared_ptr<QuantizationMap>;
-
-// Returns the quantization map for quantizing color values in [0, 255] with the
-// smallest range that can accommodate |r|
-static const QuantizationMap* GetQuantMapForValueRange(int r) {
- // Endpoint values can be quantized using bits, trits, or quints. Here we
- // store the quantization maps for each of the ranges that are supported by
- // such an encoding. That way we can choose the proper quantization procedure
- // based on the range of values rather than by having complicated switches and
- // logic. We must use a std::map here instead of a std::unordered_map because
- // of the assumption made in std::upper_bound about the iterators being from a
- // poset.
- static const auto* const kASTCEndpointQuantization = new std::map<int, QMap> {
- { 5, QMap(new TritQuantizationMap<GetUnquantizedTritValue>(5)) },
- { 7, QMap(new BitQuantizationMap<8>(7)) },
- { 9, QMap(new QuintQuantizationMap<GetUnquantizedQuintValue>(9)) },
- { 11, QMap(new TritQuantizationMap<GetUnquantizedTritValue>(11)) },
- { 15, QMap(new BitQuantizationMap<8>(15)) },
- { 19, QMap(new QuintQuantizationMap<GetUnquantizedQuintValue>(19)) },
- { 23, QMap(new TritQuantizationMap<GetUnquantizedTritValue>(23)) },
- { 31, QMap(new BitQuantizationMap<8>(31)) },
- { 39, QMap(new QuintQuantizationMap<GetUnquantizedQuintValue>(39)) },
- { 47, QMap(new TritQuantizationMap<GetUnquantizedTritValue>(47)) },
- { 63, QMap(new BitQuantizationMap<8>(63)) },
- { 79, QMap(new QuintQuantizationMap<GetUnquantizedQuintValue>(79)) },
- { 95, QMap(new TritQuantizationMap<GetUnquantizedTritValue>(95)) },
- { 127, QMap(new BitQuantizationMap<8>(127)) },
- { 159, QMap(new QuintQuantizationMap<GetUnquantizedQuintValue>(159)) },
- { 191, QMap(new TritQuantizationMap<GetUnquantizedTritValue>(191)) },
- { 255, QMap(new BitQuantizationMap<8>(255)) },
- };
-
- assert(r < 256);
- auto itr = kASTCEndpointQuantization->upper_bound(r);
- if (itr != kASTCEndpointQuantization->begin()) {
- return (--itr)->second.get();
- }
- return nullptr;
-}
-
-// Returns the quantization map for weight values in [0, 63] with the smallest
-// range that can accommodate |r|
-static const QuantizationMap* GetQuantMapForWeightRange(int r) {
- // Similar to endpoint quantization, weights can also be stored using trits,
- // quints, or bits. Here we store the quantization maps for each of the ranges
- // that are supported by such an encoding.
- static const auto* const kASTCWeightQuantization = new std::map<int, QMap> {
- { 1, QMap(new BitQuantizationMap<6>(1)) },
- { 2, QMap(new TritQuantizationMap<GetUnquantizedTritWeight>(2)) },
- { 3, QMap(new BitQuantizationMap<6>(3)) },
- { 4, QMap(new QuintQuantizationMap<GetUnquantizedQuintWeight>(4)) },
- { 5, QMap(new TritQuantizationMap<GetUnquantizedTritWeight>(5)) },
- { 7, QMap(new BitQuantizationMap<6>(7)) },
- { 9, QMap(new QuintQuantizationMap<GetUnquantizedQuintWeight>(9)) },
- { 11, QMap(new TritQuantizationMap<GetUnquantizedTritWeight>(11)) },
- { 15, QMap(new BitQuantizationMap<6>(15)) },
- { 19, QMap(new QuintQuantizationMap<GetUnquantizedQuintWeight>(19)) },
- { 23, QMap(new TritQuantizationMap<GetUnquantizedTritWeight>(23)) },
- { 31, QMap(new BitQuantizationMap<6>(31)) },
- };
-
- assert(r < 32);
- auto itr = kASTCWeightQuantization->upper_bound(r);
- if (itr != kASTCWeightQuantization->begin()) {
- return (--itr)->second.get();
- }
- return nullptr;
-}
-
-} // namespace
-
-////////////////////////////////////////////////////////////////////////////////
-
-int QuantizeCEValueToRange(int value, int range_max_value) {
- assert(range_max_value >= kEndpointRangeMinValue);
- assert(range_max_value <= 255);
- assert(value >= 0);
- assert(value <= 255);
-
- const QuantizationMap* map = GetQuantMapForValueRange(range_max_value);
- return map ? map->Quantize(value) : 0;
-}
-
-int UnquantizeCEValueFromRange(int value, int range_max_value) {
- assert(range_max_value >= kEndpointRangeMinValue);
- assert(range_max_value <= 255);
- assert(value >= 0);
- assert(value <= range_max_value);
-
- const QuantizationMap* map = GetQuantMapForValueRange(range_max_value);
- return map ? map->Unquantize(value) : 0;
-}
-
-int QuantizeWeightToRange(int weight, int range_max_value) {
- assert(range_max_value >= 1);
- assert(range_max_value <= kWeightRangeMaxValue);
- assert(weight >= 0);
- assert(weight <= 64);
-
- // The quantization maps that define weight unquantization expect values in
- // the range [0, 64), but the specification quantizes them to the range
- // [0, 64] according to C.2.17. This is a slight hack similar to the one in
- // the unquantization procedure to return the passed in unquantized value to
- // [0, 64) prior to running it through the quantization procedure.
- if (weight > 33) {
- weight -= 1;
- }
- const QuantizationMap* map = GetQuantMapForWeightRange(range_max_value);
- return map ? map->Quantize(weight) : 0;
-}
-
-int UnquantizeWeightFromRange(int weight, int range_max_value) {
- assert(range_max_value >= 1);
- assert(range_max_value <= kWeightRangeMaxValue);
- assert(weight >= 0);
- assert(weight <= range_max_value);
- const QuantizationMap* map = GetQuantMapForWeightRange(range_max_value);
- int dq = map ? map->Unquantize(weight) : 0;
-
- // Quantized weights are returned in the range [0, 64), but they should be
- // returned in the range [0, 64], so according to C.2.17 we need to add one
- // to the result.
- assert(dq < 64);
- if (dq > 32) {
- dq += 1;
- }
- return dq;
-}
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/quantization.h b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/quantization.h
deleted file mode 100644
index 5f7239f14b9..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/quantization.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_DECODER_QUANTIZATION_H_
-#define ASTC_CODEC_DECODER_QUANTIZATION_H_
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// ASTC Quantization procedures.
-//
-// The values stored in ASTC blocks tend to be stored in a range much more
-// restricted than the logical range used. For example, sometimes weights are
-// stored in the range from [0, 3] but are used in the range [0, 64]. The
-// process of translating a value to or from this range is known as quantization
-// and dequantization. The ranges to which these values can be (de)quantized
-// are defined by ISERange[Begin|End]() in integer_sequence_codec.h
-
-namespace astc_codec {
-
-// The minimum possible range for a pair of endpoints. If endpoints are
-// quantized to something smaller than this, then it would constitute an
-// illegal ASTC encoding.
-constexpr int kEndpointRangeMinValue = 5;
-
-// The maximum possible range for a weight value. If weights are quantized to
-// something larger than this, then it would constitute an illegal ASTC
-// encoding.
-constexpr int kWeightRangeMaxValue = 31;
-
-// Quantizes a value in the range [0, 255] to [0, |range|]. The quantized values
-// have no correlation to the input values, and there should be no implicit
-// assumptions made about their ordering. Valid values of |range_max_value| are
-// in the interval [5, 255]
-int QuantizeCEValueToRange(int value, int range_max_value);
-
-// Unquantizes a value in the range [0, |range|] to [0, 255]. Performs the
-// inverse procedure of QuantizeValueToRange. Valid values of |range_max_value|
-// are in the interval [5, 255]
-int UnquantizeCEValueFromRange(int value, int range_max_value);
-
-// Quantizes a weight in the range [0, 64] to [0, |range_max_value|]. The
-// quantized values have no correlation to the input values, and there should
-// be no implicit assumptions made about their ordering. Valid values of
-// |range_max_value| are in the interval [1, 31]
-int QuantizeWeightToRange(int weight, int range_max_value);
-
-// Unquantizes a weight in the range [0, |range_max_value|] to [0, 64]. Performs
-// the inverse procedure of QuantizeWeightToRange. Valid values of
-// |range_max_value| are in the interval [1, 31]
-int UnquantizeWeightFromRange(int weight, int range_max_value);
-
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_DECODER_QUANTIZATION_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/astc_fuzzer.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/astc_fuzzer.cc
deleted file mode 100644
index f152675dc4b..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/astc_fuzzer.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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.
-
-// ASTC fuzzing wrapper to help with fuzz testing.
-
-#include "src/decoder/codec.h"
-
-#include <benchmark/benchmark.h>
-
-#include <vector>
-
-extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
- std::string error;
- std::unique_ptr<astc_codec::ASTCFile> file =
- astc_codec::ASTCFile::LoadFromMemory(reinterpret_cast<const char*>(data),
- size, &error);
- if (file) {
- std::vector<uint8_t> out_buffer(file->GetWidth() * file->GetHeight() * 4);
- bool result = astc_codec::DecompressToImage(
- *file, out_buffer.data(), out_buffer.size(), file->GetWidth() * 4);
- benchmark::DoNotOptimize(result);
- }
-
- return 0;
-}
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/codec_test.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/codec_test.cc
deleted file mode 100644
index 936eed3e613..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/codec_test.cc
+++ /dev/null
@@ -1,181 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/codec.h"
-#include "include/astc-codec/astc-codec.h"
-#include "src/decoder/test/image_utils.h"
-
-#include <gtest/gtest.h>
-
-#include <string>
-
-namespace astc_codec {
-
-static void PrintTo(FootprintType footprint, std::ostream* os) {
- switch (footprint) {
- case FootprintType::k4x4: *os << "FootprintType::k4x4"; break;
- case FootprintType::k5x4: *os << "FootprintType::k5x4"; break;
- case FootprintType::k5x5: *os << "FootprintType::k5x5"; break;
- case FootprintType::k6x5: *os << "FootprintType::k6x5"; break;
- case FootprintType::k6x6: *os << "FootprintType::k6x6"; break;
- case FootprintType::k8x5: *os << "FootprintType::k8x5"; break;
- case FootprintType::k8x6: *os << "FootprintType::k8x6"; break;
- case FootprintType::k10x5: *os << "FootprintType::k10x5"; break;
- case FootprintType::k10x6: *os << "FootprintType::k10x6"; break;
- case FootprintType::k8x8: *os << "FootprintType::k8x8"; break;
- case FootprintType::k10x8: *os << "FootprintType::k10x8"; break;
- case FootprintType::k10x10: *os << "FootprintType::k10x10"; break;
- case FootprintType::k12x10: *os << "FootprintType::k12x10"; break;
- case FootprintType::k12x12: *os << "FootprintType::k12x12"; break;
- default:
- *os << "<Unexpected FootprintType "
- << static_cast<uint32_t>(footprint) << ">";
- }
-}
-
-namespace {
-
-using ::testing::TestWithParam;
-using ::testing::ValuesIn;
-
-ImageBuffer LoadGoldenImageWithAlpha(std::string basename) {
- const std::string filename =
- std::string("src/decoder/testdata/") + basename + ".bmp";
- ImageBuffer result;
- LoadGoldenBmp(filename, &result);
- EXPECT_EQ(result.BytesPerPixel(), 4);
- return result;
-}
-
-struct ImageTestParams {
- std::string image_name;
- FootprintType footprint;
- size_t width;
- size_t height;
-};
-
-static void PrintTo(const ImageTestParams& params, std::ostream* os) {
- *os << "ImageTestParams(" << params.image_name << ", " << params.width << "x"
- << params.height << ", ";
- PrintTo(params.footprint, os);
- *os << ")";
-}
-
-TEST(CodecTest, InvalidInput) {
- const size_t valid_width = 16;
- const size_t valid_height = 16;
- const size_t valid_stride = valid_width * 4;
-
- const std::vector<uint8_t> data(256);
- std::vector<uint8_t> output(valid_width * valid_height * 4);
-
- // Invalid footprint.
- EXPECT_FALSE(ASTCDecompressToRGBA(
- data.data(), data.size(), valid_width, valid_height,
- FootprintType::kCount, output.data(), output.size(), valid_stride));
-
- // Fail for 0 width or height.
- EXPECT_FALSE(ASTCDecompressToRGBA(data.data(), data.size(), 0, valid_height,
- FootprintType::k4x4, output.data(),
- output.size(), valid_stride));
- EXPECT_FALSE(ASTCDecompressToRGBA(data.data(), data.size(), valid_width, 0,
- FootprintType::k4x4, output.data(),
- output.size(), valid_stride));
-
- // Fail for data size that's not a multiple of block size.
- EXPECT_FALSE(ASTCDecompressToRGBA(
- data.data(), data.size() - 1, valid_width, valid_height,
- FootprintType::k4x4, output.data(), output.size(), valid_stride));
- // Fail for data size that doesn't match the block count.
- EXPECT_FALSE(ASTCDecompressToRGBA(
- data.data(), data.size() - 16, valid_width, valid_height,
- FootprintType::k4x4, output.data(), output.size(), valid_stride));
-
- // Fail for invalid stride.
- EXPECT_FALSE(ASTCDecompressToRGBA(
- data.data(), data.size(), valid_width, valid_height, FootprintType::k4x4,
- output.data(), output.size(), valid_stride - 1));
-
- // Fail for invalid output size.
- EXPECT_FALSE(ASTCDecompressToRGBA(
- data.data(), data.size(), valid_width, valid_height, FootprintType::k4x4,
- output.data(), output.size() - 1, valid_stride));
-}
-
-class CodecTest : public TestWithParam<ImageTestParams> {};
-
-TEST_P(CodecTest, PublicAPI) {
- const auto& params = GetParam();
- const std::string astc = LoadASTCFile(params.image_name);
-
- ImageBuffer our_decoded_image;
- our_decoded_image.Allocate(params.width, params.height, 4);
- ASSERT_TRUE(ASTCDecompressToRGBA(
- reinterpret_cast<const uint8_t*>(astc.data()), astc.size(), params.width,
- params.height, params.footprint, our_decoded_image.Data().data(),
- our_decoded_image.DataSize(), our_decoded_image.Stride()));
-
- // Check that the decoded image is *very* similar to the library decoding
- // of an ASTC texture. They may not be exact due to differences in how we
- // convert a 16-bit float to an 8-bit integer.
- ImageBuffer decoded_image = LoadGoldenImageWithAlpha(params.image_name);
- CompareSumOfSquaredDifferences(decoded_image, our_decoded_image, 1.0);
-}
-
-TEST_P(CodecTest, DecompressToImage) {
- const auto& params = GetParam();
-
- std::string error;
- std::unique_ptr<ASTCFile> image_file = ASTCFile::LoadFile(
- std::string("src/decoder/testdata/") + params.image_name + ".astc",
- &error);
- ASSERT_TRUE(image_file) << "Failed to load " << params.image_name << ": "
- << error;
-
- ASSERT_TRUE(image_file->GetFootprint());
- EXPECT_EQ(params.footprint, image_file->GetFootprint().value().Type());
-
- ImageBuffer our_decoded_image;
- our_decoded_image.Allocate(image_file->GetWidth(), image_file->GetHeight(),
- 4);
-
- ASSERT_TRUE(DecompressToImage(*image_file, our_decoded_image.Data().data(),
- our_decoded_image.DataSize(),
- our_decoded_image.Stride()));
-
- // Check that the decoded image is *very* similar to the library decoding
- // of an ASTC texture. They may not be exact due to differences in how we
- // convert a 16-bit float to an 8-bit integer.
- ImageBuffer decoded_image = LoadGoldenImageWithAlpha(params.image_name);
- CompareSumOfSquaredDifferences(decoded_image, our_decoded_image, 1.0);
-}
-
-// Test to make sure that reading out color values from blocks in a real-world
-// image isn't terribly wrong, either.
-std::vector<ImageTestParams> GetTransparentImageTestParams() {
- return {
- // image_name astc footprint width height
- { "atlas_small_4x4", FootprintType::k4x4, 256, 256 },
- { "atlas_small_5x5", FootprintType::k5x5, 256, 256 },
- { "atlas_small_6x6", FootprintType::k6x6, 256, 256 },
- { "atlas_small_8x8", FootprintType::k8x8, 256, 256 },
- };
-}
-
-INSTANTIATE_TEST_CASE_P(Transparent, CodecTest,
- ValuesIn(GetTransparentImageTestParams()));
-
-} // namespace
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/endpoint_codec_test.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/endpoint_codec_test.cc
deleted file mode 100644
index de7d9cab483..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/endpoint_codec_test.cc
+++ /dev/null
@@ -1,463 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/endpoint_codec.h"
-#include "src/decoder/intermediate_astc_block.h"
-#include "src/decoder/test/image_utils.h"
-
-#include <random>
-#include <string>
-#include <utility>
-#include <vector>
-
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-
-namespace astc_codec {
-
-namespace {
-
-using ::testing::AllOf;
-using ::testing::AnyOf;
-using ::testing::Each;
-using ::testing::Eq;
-using ::testing::Ge;
-using ::testing::Le;
-using ::testing::Ne;
-using ::testing::Pointwise;
-using ::testing::SizeIs;
-using ::testing::Pair;
-
-constexpr std::array<EndpointEncodingMode, 6> kEndpointEncodingModes = {{
- EndpointEncodingMode::kDirectLuma,
- EndpointEncodingMode::kDirectLumaAlpha,
- EndpointEncodingMode::kBaseScaleRGB,
- EndpointEncodingMode::kBaseScaleRGBA,
- EndpointEncodingMode::kDirectRGB,
- EndpointEncodingMode::kDirectRGBA }};
-
-const std::array<std::pair<RgbaColor, RgbaColor>, 3> kBlueContractPairs = {{
- std::make_pair(RgbaColor{{ 22, 18, 30, 59 }},
- RgbaColor{{ 162, 148, 155, 59 }}),
- std::make_pair(RgbaColor{{ 22, 30, 27, 36 }},
- RgbaColor{{ 228, 221, 207, 36 }}),
- std::make_pair(RgbaColor{{ 54, 60, 55, 255 }},
- RgbaColor{{ 23, 30, 27, 255 }})
- }};
-
-// Used to directly initialize std::pairs of colors with initializer lists
-// e.g. MakeColors({{ r, g, b, a }}, {{ r, g, b, a }});
-std::pair<RgbaColor, RgbaColor> MakeColors(RgbaColor&& a, RgbaColor&& b) {
- return std::make_pair(a, b);
-}
-
-// Returns |high| and |low| as they would be decoded using the quantization
-// factor |quant| for the ColorEndpointMode |mode|.
-std::pair<RgbaColor, RgbaColor> TestColors(
- RgbaColor low, RgbaColor high, int quant, EndpointEncodingMode mode) {
- ColorEndpointMode astc_mode;
- std::vector<int> encoded;
- const bool needs_swap =
- EncodeColorsForMode(low, high, quant, mode, &astc_mode, &encoded);
-
- RgbaColor decoded_low, decoded_high;
- DecodeColorsForMode(encoded, quant, astc_mode, &decoded_low, &decoded_high);
-
- if (needs_swap) {
- return std::make_pair(decoded_high, decoded_low);
- } else {
- return std::make_pair(decoded_low, decoded_high);
- }
-}
-
-// Returns true if the argument tuple entries only differ by at most x.
-MATCHER_P(IsCloseTo, x, "") {
- const auto& a = ::testing::get<0>(arg);
- const auto& b = ::testing::get<1>(arg);
- return (a > b) ? ((a - b) <= x) : ((b - a) <= x);
-}
-
-// Test to make sure that the range of values that we get as they are
-// quantized remains within what we pass as |quant|.
-TEST(EndpointCodecTest, QuantRanges) {
- const RgbaColor low {{ 0, 0, 0, 0 }};
- const RgbaColor high {{ 255, 255, 255, 255 }};
-
- std::vector<int> result;
- for (const auto& mode : kEndpointEncodingModes) {
- for (int i = 5; i < 256; ++i) {
- ColorEndpointMode astc_mode;
- const bool needs_swap =
- EncodeColorsForMode(low, high, i, mode, &astc_mode, &result);
- EXPECT_EQ(result.size(), NumValuesForEncodingMode(mode)) << i;
- EXPECT_EQ(result.size(), NumColorValuesForEndpointMode(astc_mode)) << i;
-
- // ASTC mode shouldn't use base/offset when endpoints are so far apart.
- EXPECT_THAT(astc_mode, Ne(ColorEndpointMode::kLDRRGBBaseOffset));
- EXPECT_THAT(astc_mode, Ne(ColorEndpointMode::kLDRRGBABaseOffset));
-
- EXPECT_THAT(result, Each(AllOf(Ge(0), Le(i))))
- << "Mode: " << static_cast<int>(mode);
- // We don't care if we need to swap the weights in this test
- EXPECT_TRUE(needs_swap || !needs_swap);
- }
- }
-}
-
-// Test to make sure that each mode that directly encodes colors can effectively
-// encode both black and white
-TEST(EndpointCodecTest, ExtremeDirectEncodings) {
- const RgbaColor kWhite {{ 255, 255, 255, 255 }};
- const RgbaColor kBlack {{ 0, 0, 0, 255 }};
-
- std::vector<int> encoded;
- for (const auto& mode : kEndpointEncodingModes) {
- for (int i = 5; i < 256; ++i) {
- const auto expected = std::make_pair(kWhite, kBlack);
- EXPECT_EQ(TestColors(kWhite, kBlack, i, mode), expected)
- << "Range: " << i << ", Mode: " << static_cast<int>(mode);
- }
- }
-}
-
-// According to the spec, this is used for colors close to gray. The values
-// chosen here were according to the spec.
-TEST(EndpointCodecTest, UsesBlueContract) {
- std::vector<int> vals = { 132, 127, 116, 112, 183, 180, 31, 22 };
- EXPECT_TRUE(UsesBlueContract(255, ColorEndpointMode::kLDRRGBDirect, vals));
- EXPECT_TRUE(UsesBlueContract(255, ColorEndpointMode::kLDRRGBADirect, vals));
-
- // For the offset modes the only way to trigger the blue contract mode is if
- // we force the subtraction in the decoding procedure (See section C.2.14 of
- // the spec), so we need to set the 7th bit to 1 for all of the odd-numbered
- // values
- vals[1] &= 0xBF;
- vals[3] &= 0xBF;
- vals[5] &= 0xBF;
- vals[7] &= 0xBF;
-
- EXPECT_FALSE(
- UsesBlueContract(255, ColorEndpointMode::kLDRRGBBaseOffset, vals));
- EXPECT_FALSE(
- UsesBlueContract(255, ColorEndpointMode::kLDRRGBABaseOffset, vals));
-
- vals[1] |= 0x40;
- vals[3] |= 0x40;
- vals[5] |= 0x40;
- vals[7] |= 0x40;
-
- EXPECT_TRUE(
- UsesBlueContract(255, ColorEndpointMode::kLDRRGBBaseOffset, vals));
- EXPECT_TRUE(
- UsesBlueContract(255, ColorEndpointMode::kLDRRGBABaseOffset, vals));
-
- // All other LDR endpoint modes should return no blue contract
- for (int max_val : { 255, 127, 11 }) {
- for (auto mode : { ColorEndpointMode::kLDRLumaDirect,
- ColorEndpointMode::kLDRLumaBaseOffset,
- ColorEndpointMode::kLDRLumaAlphaDirect,
- ColorEndpointMode::kLDRLumaAlphaBaseOffset,
- ColorEndpointMode::kLDRRGBBaseScale,
- ColorEndpointMode::kLDRRGBBaseScaleTwoA }) {
- EXPECT_FALSE(UsesBlueContract(max_val, mode, vals));
- }
- }
-}
-
-// Make sure that encoding and decoding for the direct luminance mode works.
-TEST(EndpointCodecTest, LumaDirect) {
- const auto mode = EndpointEncodingMode::kDirectLuma;
-
- // With a 255 quantizer, all greys should be exact.
- for (int i = 0; i < 255; ++i) {
- for (int j = 0; j < 255; ++j) {
- EXPECT_EQ(TestColors({{ i, i, i, 255 }}, {{ j, j, j, 255 }}, 255, mode),
- MakeColors({{ i, i, i, 255 }}, {{ j, j, j, 255 }}));
- }
- }
-
- // If we have almost grey, then they should encode to grey.
- EXPECT_EQ(TestColors({{ 247, 248, 246, 255 }}, {{ 2, 3, 1, 255 }}, 255, mode),
- MakeColors({{ 247, 247, 247, 255 }}, {{ 2, 2, 2, 255 }}));
-
- EXPECT_EQ(TestColors({{ 80, 80, 50, 255 }}, {{ 99, 255, 6, 255 }}, 255, mode),
- MakeColors({{ 70, 70, 70, 255 }}, {{ 120, 120, 120, 255 }}));
-
- // If we have almost greys and a really small quantizer, it should be white
- // and black (literally).
- EXPECT_EQ(TestColors({{ 247, 248, 246, 255 }}, {{ 2, 3, 1, 255 }}, 15, mode),
- MakeColors({{ 255, 255, 255, 255 }}, {{ 0, 0, 0, 255 }}));
-
- // The average of 64, 127, and 192 is 127.666..., so it should round to
- // 130 instead of 125.
- EXPECT_EQ(TestColors({{ 64, 127, 192, 255 }}, {{ 0, 0, 0, 255 }}, 63, mode),
- MakeColors({{ 130, 130, 130, 255 }}, {{ 0, 0, 0, 255 }}));
-
- // If we have almost grey, then they should encode to grey -- similar to
- // direct encoding since the encoded colors differ by < 63.
- EXPECT_EQ(TestColors({{ 80, 80, 50, 255 }}, {{ 99, 255, 6, 255 }}, 255, mode),
- MakeColors({{ 70, 70, 70, 255 }}, {{ 120, 120, 120, 255 }}));
-
- // Low precision colors should still encode pretty well with base/offset.
- EXPECT_EQ(TestColors({{ 35, 36, 38, 255 }}, {{ 42, 43, 40, 255 }}, 47, mode),
- MakeColors({{ 38, 38, 38, 255 }}, {{ 43, 43, 43, 255 }}));
-
- EXPECT_EQ(TestColors({{ 39, 42, 40, 255 }}, {{ 18, 20, 21, 255 }}, 39, mode),
- MakeColors({{ 39, 39, 39, 255 }}, {{ 19, 19, 19, 255 }}));
-}
-
-// Test encoding and decoding for the base-offset luminance mode.
-TEST(EndpointCodecTest, LumaAlphaDirect) {
- const auto mode = EndpointEncodingMode::kDirectLumaAlpha;
-
- // With a 255 quantizer, all greys should be exact.
- for (int i = 0; i < 255; ++i) {
- for (int j = 0; j < 255; ++j) {
- EXPECT_EQ(TestColors({{ i, i, i, j }}, {{ j, j, j, i }}, 255, mode),
- MakeColors({{ i, i, i, j }}, {{ j, j, j, i }}));
- }
- }
-
- // If we have almost grey, then they should encode to grey.
- EXPECT_EQ(TestColors({{ 247, 248, 246, 250 }}, {{ 2, 3, 1, 172 }}, 255, mode),
- MakeColors({{ 247, 247, 247, 250 }}, {{ 2, 2, 2, 172 }}));
-
- EXPECT_EQ(TestColors({{ 80, 80, 50, 0 }}, {{ 99, 255, 6, 255 }}, 255, mode),
- MakeColors({{ 70, 70, 70, 0 }}, {{ 120, 120, 120, 255 }}));
-
- // If we have almost greys and a really small quantizer, it should be white
- // and black (literally).
- EXPECT_EQ(TestColors({{ 247, 248, 246, 253 }}, {{ 2, 3, 1, 3 }}, 15, mode),
- MakeColors({{ 255, 255, 255, 255 }}, {{ 0, 0, 0, 0 }}));
-
- // The average of 64, 127, and 192 is 127.666..., so it should round to
- // 130 instead of 125. The alpha in this case is independent.
- EXPECT_EQ(TestColors({{ 64, 127, 192, 127 }}, {{ 0, 0, 0, 20 }}, 63, mode),
- MakeColors({{ 130, 130, 130, 125 }}, {{ 0, 0, 0, 20 }}));
-}
-
-// Test encoding for the direct RGB mode.
-TEST(EndpointCodecTest, RGBDirect) {
- const auto mode = EndpointEncodingMode::kDirectRGB;
-
- // Colors should be encoded exactly with a 255 quantizer.
- std::mt19937 random(0xdeadbeef);
- std::uniform_int_distribution<int> byte_distribution(0, 255);
-
- for (int i = 0; i < 100; ++i) {
- RgbaColor low, high;
- for (auto& x : high) { x = byte_distribution(random); }
- for (auto& x : low) { x = byte_distribution(random); }
- high[3] = low[3] = 255; // RGB Direct mode has opaque alpha.
-
- EXPECT_EQ(TestColors(low, high, 255, mode), std::make_pair(low, high))
- << "Random iter: " << i;
- }
-
- // For each of the following tests, order of endpoints shouldn't have any
- // bearing on the quantization properties, so we should be able to switch
- // endpoints as we see fit and have them generate the same flipped encoded
- // pairs.
-
- EXPECT_EQ(TestColors({{ 64, 127, 192, 255 }}, {{ 0, 0, 0, 255 }}, 63, mode),
- MakeColors({{ 65, 125, 190, 255 }}, {{ 0, 0, 0, 255 }}));
-
- EXPECT_EQ(TestColors({{ 0, 0, 0, 255 }}, {{ 64, 127, 192, 255 }}, 63, mode),
- MakeColors({{ 0, 0, 0, 255 }}, {{ 65, 125, 190, 255 }}));
-
- EXPECT_EQ(TestColors({{ 1, 2, 94, 255 }}, {{ 168, 255, 13, 255 }}, 7, mode),
- MakeColors({{ 0, 0, 109, 255 }}, {{ 182, 255, 0, 255 }}));
-
- // Colors close to grey will likely need a blue contract.
- EXPECT_EQ(TestColors(kBlueContractPairs[0].first,
- kBlueContractPairs[0].second, 31, mode),
- MakeColors({{ 24, 20, 33, 255 }}, {{ 160, 148, 156, 255 }}));
-
- EXPECT_EQ(TestColors(kBlueContractPairs[0].second,
- kBlueContractPairs[0].first, 31, mode),
- MakeColors({{ 160, 148, 156, 255 }}, {{ 24, 20, 33, 255 }}));
-
- EXPECT_EQ(TestColors(kBlueContractPairs[1].first,
- kBlueContractPairs[1].second, 7, mode),
- MakeColors({{ 18, 36, 36, 255 }}, {{ 237, 219, 219, 255 }}));
-
- EXPECT_EQ(TestColors(kBlueContractPairs[1].second,
- kBlueContractPairs[1].first, 7, mode),
- MakeColors({{ 237, 219, 219, 255 }}, {{ 18, 36, 36, 255 }}));
-
- // Colors close to grey (and each other) will likely need a blue contract AND
- // use the offset mode for encoding
- EXPECT_EQ(TestColors(kBlueContractPairs[2].first,
- kBlueContractPairs[2].second, 31, mode),
- MakeColors({{ 53, 59, 53, 255 }}, {{ 24, 30, 26, 255 }}));
-
- EXPECT_EQ(TestColors(kBlueContractPairs[2].second,
- kBlueContractPairs[2].first, 31, mode),
- MakeColors({{ 24, 30, 26, 255 }}, {{ 53, 59, 53, 255 }}));
-
- // Colors close to each other, but not to grey will likely only use the offset
- // mode and not the blue-contract modes.
- EXPECT_EQ(TestColors({{ 22, 148, 30, 59 }}, {{ 162, 18, 155, 59 }}, 31, mode),
- MakeColors({{ 24, 148, 33, 255 }}, {{ 165, 16, 156, 255 }}));
-
- EXPECT_EQ(TestColors({{ 162, 18, 155, 59 }}, {{ 22, 148, 30, 59 }}, 31, mode),
- MakeColors({{ 165, 16, 156, 255 }}, {{ 24, 148, 33, 255 }}));
-}
-
-// Make sure that certain endpoint pairs result in the blue-contract path as
-// we'd expect, such that we can make sure that we're hitting all of the encode
-// paths.
-TEST(EndpointCodecTest, RGBDirectMakesBlueContract) {
- constexpr int kEndpointRange = 31;
- for (const auto& endpoint_pair : kBlueContractPairs) {
- ColorEndpointMode astc_mode;
- std::vector<int> vals;
- bool needs_swap = EncodeColorsForMode(
- endpoint_pair.first, endpoint_pair.second,
- kEndpointRange, EndpointEncodingMode::kDirectRGB, &astc_mode, &vals);
- (void)(needs_swap); // Don't really care.
-
- EXPECT_TRUE(UsesBlueContract(kEndpointRange, astc_mode, vals));
- }
-}
-
-// Make sure that encoding and decoding for the RGB base-scale mode works.
-TEST(EndpointCodecTest, RGBBaseScale) {
- const auto mode = EndpointEncodingMode::kBaseScaleRGB;
- const auto close_to = [](RgbaColor c, int x) {
- return Pointwise(IsCloseTo(x), c);
- };
-
- // Identical colors should be encoded with a 255 scale factor. Since ASTC
- // decodes the scaled color by doing (x * s) >> 8, the decoded color will be
- // multiplied by 255/256. This might cause rounding errors sometimes, so we
- // check that every channel only deviates by 1.
- std::mt19937 random(0xdeadbeef);
- std::uniform_int_distribution<int> byte_distribution(0, 255);
-
- for (int i = 0; i < 100; ++i) {
- RgbaColor color{{byte_distribution(random), byte_distribution(random),
- byte_distribution(random), 255}};
- const auto test_result = TestColors(color, color, 255, mode);
- EXPECT_THAT(test_result, Pair(close_to(color, 1), close_to(color, 1)));
- }
-
- // Make sure that if we want to scale by e.g. 1/4 then we can do that exactly:
- const RgbaColor low = {{ 20, 4, 40, 255 }};
- const RgbaColor high = {{ 80, 16, 160, 255 }};
- EXPECT_THAT(TestColors(low, high, 255, mode),
- Pair(close_to(low, 0), close_to(high, 0)));
-
- // And if we quantize it, then we get roughly the same thing. The scale factor
- // should be representable with most quantization levels. The problem is that
- // if we're off on the 'high' color, then we will be off on the 'low' color.
- EXPECT_THAT(TestColors(low, high, 127, mode),
- Pair(close_to(low, 1), close_to(high, 1)));
-
- EXPECT_THAT(TestColors(low, high, 63, mode),
- Pair(close_to(low, 1), close_to(high, 2)));
-
- EXPECT_THAT(TestColors(low, high, 31, mode),
- Pair(close_to(low, 1), close_to(high, 4)));
-
- EXPECT_THAT(TestColors(low, high, 15, mode),
- Pair(close_to(low, 2), close_to(high, 8)));
-}
-
-// Make sure that encoding and decoding for the RGB base-offset mode works.
-// Since we don't have a decoder, this is currently only a test that should work
-// based on reasoning about what's written in the spec.
-// TODO(krajcevski): Write an encoder.
-TEST(EndpointCodecTest, RGBBaseOffset) {
- const auto test_colors = [](const RgbaColor& low, const RgbaColor& high) {
- const RgbaColor diff = {{ high[0] - low[0], high[1] - low[1],
- high[2] - low[2], high[3] - low[3] }};
-
- std::vector<int> vals;
- for (int i = 0; i < 3; ++i) {
- // If the base is "large", then it grabs it's most significant bit from
- // the offset value. Hence, we need to save it here.
- const bool is_large = low[i] >= 128;
- vals.push_back((low[i] * 2) & 0xFF);
- vals.push_back(diff[i] * 2);
-
- // Give the "large" bases their bits back.
- if (is_large) {
- vals.back() |= 0x80;
- }
- }
-
- RgbaColor dec_low, dec_high;
- DecodeColorsForMode(vals, 255, ColorEndpointMode::kLDRRGBBaseOffset,
- &dec_low, &dec_high);
-
- EXPECT_THAT(std::make_pair(dec_low, dec_high), Pair(Eq(low), Eq(high)));
- };
-
- // Test the "direct encoding" path.
- test_colors({{ 80, 16, 112, 255 }}, {{ 87, 18, 132, 255 }});
- test_colors({{ 80, 74, 82, 255 }}, {{ 90, 92, 110, 255 }});
- test_colors({{ 0, 0, 0, 255 }}, {{ 2, 2, 2, 255 }});
-
- // Identical endpoints should always encode exactly, provided they satisfy the
- // requirements for the base encoding.
- std::mt19937 random(0xdeadbeef);
- std::uniform_int_distribution<int> byte_distribution(0, 255);
- for (int i = 0; i < 100; ++i) {
- RgbaColor color{{byte_distribution(random), byte_distribution(random),
- byte_distribution(random), 255}};
- if ((color[0] | color[1] | color[2]) & 1) {
- continue;
- }
- test_colors(color, color);
- }
-
- // TODO(google): Test the "blue contract" path.
-}
-
-// Make sure that we can decode colors that are given to us straight out of the
-// ASTC codec.
-TEST(EndpointCodecTest, DecodeCheckerboard) {
- const RgbaColor kWhite {{ 255, 255, 255, 255 }};
- const RgbaColor kBlack {{ 0, 0, 0, 255 }};
-
- const std::string astc = LoadASTCFile("checkerboard");
- for (int i = 0; i < astc.size(); i += 16) {
- base::UInt128 block;
- memcpy(&block, &astc[i], sizeof(block));
-
- const auto intermediate = UnpackIntermediateBlock(PhysicalASTCBlock(block));
- ASSERT_TRUE(intermediate) << "Block is void extent???";
-
- const auto block_data = &intermediate.value();
- ASSERT_THAT(block_data->endpoints, SizeIs(Eq(1)));
-
- const int color_range = EndpointRangeForBlock(*block_data);
- const auto& endpoints = block_data->endpoints[0];
-
- RgbaColor low, high;
- DecodeColorsForMode(endpoints.colors, color_range, endpoints.mode,
- &low, &high);
-
- // Expect that the endpoints are black and white, but either order.
- EXPECT_THAT(std::make_pair(low, high),
- AnyOf(
- Pair(Eq(kWhite), Eq(kBlack)),
- Pair(Eq(kBlack), Eq(kWhite))));
- }
-}
-
-} // namespace
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/footprint_test.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/footprint_test.cc
deleted file mode 100644
index 6aef98a767b..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/footprint_test.cc
+++ /dev/null
@@ -1,97 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/footprint.h"
-
-#include <array>
-#include <tuple>
-#include <vector>
-
-#include <gtest/gtest.h>
-
-namespace astc_codec {
-
-namespace {
-
-TEST(FootprintTest, ParseAstcFootprintString) {
- using ASTCTestPair = std::pair<std::string, Footprint>;
- const std::array<ASTCTestPair, Footprint::NumValidFootprints()>
- valid_footprints {{
- std::make_pair("4x4", Footprint::Get4x4()),
- std::make_pair("5x4", Footprint::Get5x4()),
- std::make_pair("5x5", Footprint::Get5x5()),
- std::make_pair("6x5", Footprint::Get6x5()),
- std::make_pair("6x6", Footprint::Get6x6()),
- std::make_pair("8x5", Footprint::Get8x5()),
- std::make_pair("8x6", Footprint::Get8x6()),
- std::make_pair("8x8", Footprint::Get8x8()),
- std::make_pair("10x5", Footprint::Get10x5()),
- std::make_pair("10x6", Footprint::Get10x6()),
- std::make_pair("10x8", Footprint::Get10x8()),
- std::make_pair("10x10", Footprint::Get10x10()),
- std::make_pair("12x10", Footprint::Get12x10()),
- std::make_pair("12x12", Footprint::Get12x12())
- }};
-
- for (const auto& test : valid_footprints) {
- base::Optional<Footprint> footprint = Footprint::Parse(test.first.c_str());
- EXPECT_TRUE(footprint);
- EXPECT_EQ(test.second, footprint.value());
- }
-
- EXPECT_DEBUG_DEATH(EXPECT_FALSE(Footprint::Parse("")), "");
- EXPECT_DEBUG_DEATH(EXPECT_FALSE(Footprint::Parse("3")), "");
- EXPECT_DEBUG_DEATH(EXPECT_FALSE(Footprint::Parse("x")), "");
- // Validly formed but out-of-bounds dimensions do not assert, otherwise
- // malformed ASTC files could crash the decoder in debug builds.
- EXPECT_FALSE(Footprint::Parse("9999999999x10"));
- EXPECT_DEBUG_DEATH(EXPECT_FALSE(Footprint::Parse("ax8")), "");
- EXPECT_DEBUG_DEATH(EXPECT_FALSE(Footprint::Parse("2x3x4")), "");
- EXPECT_DEBUG_DEATH(EXPECT_FALSE(Footprint::Parse("-3x4")), "");
- EXPECT_FALSE(Footprint::Parse("10x4"));
-}
-
-TEST(FootprintTest, Bitrates) {
- EXPECT_NEAR(Footprint::Get4x4().Bitrate(), 8.f, 0.01f);
- EXPECT_NEAR(Footprint::Get5x4().Bitrate(), 6.4f, 0.01f);
- EXPECT_NEAR(Footprint::Get5x5().Bitrate(), 5.12f, 0.01f);
- EXPECT_NEAR(Footprint::Get6x5().Bitrate(), 4.27f, 0.01f);
- EXPECT_NEAR(Footprint::Get6x6().Bitrate(), 3.56f, 0.01f);
- EXPECT_NEAR(Footprint::Get8x5().Bitrate(), 3.20f, 0.01f);
- EXPECT_NEAR(Footprint::Get8x6().Bitrate(), 2.67f, 0.01f);
- EXPECT_NEAR(Footprint::Get8x8().Bitrate(), 2.00f, 0.01f);
- EXPECT_NEAR(Footprint::Get10x5().Bitrate(), 2.56f, 0.01f);
- EXPECT_NEAR(Footprint::Get10x6().Bitrate(), 2.13f, 0.01f);
- EXPECT_NEAR(Footprint::Get10x8().Bitrate(), 1.60f, 0.01f);
- EXPECT_NEAR(Footprint::Get10x10().Bitrate(), 1.28f, 0.01f);
- EXPECT_NEAR(Footprint::Get12x10().Bitrate(), 1.07f, 0.01f);
- EXPECT_NEAR(Footprint::Get12x12().Bitrate(), 0.89f, 0.01f);
-}
-
-TEST(FootprintTest, StorageRequirements) {
- auto footprint = Footprint::Get10x8();
- EXPECT_EQ(footprint.Width(), 10);
- EXPECT_EQ(footprint.Height(), 8);
-
- // If we have 8x8 blocks, then we have 64*16 = 1024 bytes.
- EXPECT_EQ(footprint.StorageRequirements(80, 64), 1024);
-
- // If our block is a little smaller this still counts because we need to
- // cover a partial block with a fully encoded one.
- EXPECT_EQ(footprint.StorageRequirements(79, 63), 1024);
-}
-
-} // namespace
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/image_utils.h b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/image_utils.h
deleted file mode 100644
index 1e5000a301c..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/image_utils.h
+++ /dev/null
@@ -1,217 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 <gtest/gtest.h>
-
-#include <fstream>
-#include <vector>
-
-static constexpr size_t kMaxVectorOutput = 128;
-
-class ImageBuffer {
- public:
- static constexpr size_t Align = 4;
-
- void Allocate(size_t width, size_t height, size_t bytes_per_pixel) {
- width_ = width;
- height_ = height;
- bytes_per_pixel_ = bytes_per_pixel;
- stride_ = AlignBytes(width * bytes_per_pixel);
- data_.resize(stride_ * height);
- }
-
- uint8_t* operator()(size_t x, size_t y) {
- assert(x < width_ && y < height_);
- return &data_[y * Stride() + x * bytes_per_pixel_];
- }
-
- size_t Stride() const { return stride_; }
- size_t BytesPerPixel() const { return bytes_per_pixel_; }
-
- std::vector<uint8_t>& Data() { return data_; }
- const std::vector<uint8_t>& Data() const { return data_; }
- size_t DataSize() const { return data_.size(); }
-
- private:
- size_t AlignBytes(size_t bytes) const {
- return (bytes + (Align - 1)) / Align * Align;
- }
-
- size_t width_ = 0;
- size_t height_ = 0;
- size_t stride_ = 0;
- size_t bytes_per_pixel_ = 0;
- std::vector<uint8_t> data_;
-};
-
-namespace std {
-static void PrintTo(const vector<uint8_t>& vec, ostream* os) {
- ios::fmtflags origFlags(os->flags());
-
- *os << '{';
- size_t count = 0;
- for (vector<uint8_t>::const_iterator it = vec.begin(); it != vec.end();
- ++it, ++count) {
- if (count > 0) {
- *os << ", ";
- }
-
- if (count == kMaxVectorOutput) {
- *os << "... ";
- break;
- }
-
- if ((count % 16) == 0) {
- *os << "\n";
- }
-
- if (*it == 0) {
- *os << " ";
- } else {
- *os << "0x" << std::hex << std::uppercase << std::setw(2)
- << std::setfill('0') << int(*it) << std::dec;
- }
- }
-
- *os << '}';
-
- os->flags(origFlags);
-}
-} // namespace std
-
-static inline std::string LoadFile(const std::string& path) {
- std::ifstream is(path, std::ios::binary);
- EXPECT_TRUE(is) << "Failed to load file " << path;
- if (!is) {
- return "";
- }
-
- std::ostringstream ss;
- ss << is.rdbuf();
- return ss.str();
-}
-
-static inline std::string LoadASTCFile(const std::string& basename) {
- const std::string filename =
- std::string("src/decoder/testdata/") + basename + ".astc";
-
- std::string result = LoadFile(filename);
- // Don't parse the header here, we already know what kind of astc encoding it
- // is.
- if (result.size() < 16) {
- return "";
- } else {
- return result.substr(16);
- }
-}
-
-static inline void LoadGoldenBmp(const std::string& path, ImageBuffer* result) {
- constexpr size_t kBmpHeaderSize = 54;
-
- SCOPED_TRACE(testing::Message() << "LoadGoldenBmp " << path);
-
- const std::string data = LoadFile(path);
- ASSERT_FALSE(data.empty()) << "Failed to open golden image: " << path;
-
- ASSERT_GE(data.size(), kBmpHeaderSize);
- ASSERT_EQ('B', data[0]);
- ASSERT_EQ('M', data[1]);
-
- uint32_t dataPos = *reinterpret_cast<const uint32_t*>(&data[0x0A]);
- uint32_t imageSize = *reinterpret_cast<const uint32_t*>(&data[0x22]);
- const uint16_t bitsPerPixel = *reinterpret_cast<const uint16_t*>(&data[0x1C]);
- int width = *reinterpret_cast<const int*>(&data[0x12]);
- int height = *reinterpret_cast<const int*>(&data[0x16]);
-
- SCOPED_TRACE(testing::Message()
- << "dataPos=" << dataPos << ", imageSize=" << imageSize
- << ", bitsPerPixel=" << bitsPerPixel << ", width=" << width
- << ", height=" << height);
-
- if (height < 0) {
- height = -height;
- }
-
- if (imageSize == 0) {
- imageSize = width * height * 3;
- }
-
- if (dataPos < kBmpHeaderSize) {
- dataPos = kBmpHeaderSize;
- }
-
- ASSERT_TRUE(bitsPerPixel == 24 || bitsPerPixel == 32)
- << "BMP bits per pixel mismatch, expected 24 or 32";
-
- result->Allocate(width, height, bitsPerPixel == 24 ? 3 : 4);
- ASSERT_LE(imageSize, result->DataSize());
-
- std::vector<uint8_t>& resultData = result->Data();
- const size_t stride = result->Stride();
-
- // Copy the data row-by-row to make sure that stride is right.
- for (size_t row = 0; row < static_cast<size_t>(height); ++row) {
- memcpy(&resultData[row * stride], &data[dataPos + row * stride],
- width * bitsPerPixel / 8);
- }
-
- if (bitsPerPixel == 32) {
- // Swizzle the data from ABGR to ARGB.
- for (size_t row = 0; row < static_cast<size_t>(height); ++row) {
- uint8_t* rowData = resultData.data() + row * stride;
-
- for (size_t i = 3; i < stride; i += 4) {
- const uint8_t b = rowData[i - 3];
- rowData[i - 3] = rowData[i - 1];
- rowData[i - 1] = b;
- }
- }
- } else {
- // Swizzle the data from BGR to RGB.
- for (size_t row = 0; row < static_cast<size_t>(height); ++row) {
- uint8_t* rowData = resultData.data() + row * stride;
-
- for (size_t i = 2; i < stride; i += 3) {
- const uint8_t tmp = rowData[i - 2];
- rowData[i - 2] = rowData[i];
- rowData[i] = tmp;
- }
- }
- }
-}
-
-static inline void CompareSumOfSquaredDifferences(const ImageBuffer& golden,
- const ImageBuffer& image,
- double threshold) {
- ASSERT_EQ(golden.DataSize(), image.DataSize());
- ASSERT_EQ(golden.Stride(), image.Stride());
- ASSERT_EQ(golden.BytesPerPixel(), image.BytesPerPixel());
-
- const std::vector<uint8_t>& image_data = image.Data();
- const std::vector<uint8_t>& golden_data = golden.Data();
-
- double sum = 0.0;
- for (size_t i = 0; i < image_data.size(); ++i) {
- const double diff = static_cast<double>(image_data[i]) - golden_data[i];
- sum += diff * diff;
- }
-
- EXPECT_LE(sum, threshold * image_data.size())
- << "Per pixel " << (sum / image_data.size())
- << ", expected <= " << threshold;
- if (sum > threshold * image_data.size()) {
- // Fall back to comparison which will dump first chunk of vector.
- EXPECT_EQ(golden_data, image_data);
- }
-}
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/integer_sequence_codec_test.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/integer_sequence_codec_test.cc
deleted file mode 100644
index 120e8b07b73..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/integer_sequence_codec_test.cc
+++ /dev/null
@@ -1,336 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/integer_sequence_codec.h"
-#include "src/base/uint128.h"
-
-#include <random>
-#include <string>
-#include <vector>
-
-#include <gtest/gtest.h>
-
-using astc_codec::base::UInt128;
-using astc_codec::base::BitStream;
-using astc_codec::IntegerSequenceCodec;
-using astc_codec::IntegerSequenceEncoder;
-using astc_codec::IntegerSequenceDecoder;
-
-namespace {
-
-// Make sure that the counts returned for a specific range match what's
-// expected. In particular, make sure that it fits with Table C.2.7
-TEST(ASTCIntegerSequenceCodecTest, TestGetCountsForRange) {
- std::array<int, 3> kExpectedCounts[31] = {
- {{ 0, 0, 1 }}, // 1
- {{ 1, 0, 0 }}, // 2
- {{ 0, 0, 2 }}, // 3
- {{ 0, 1, 0 }}, // 4
- {{ 1, 0, 1 }}, // 5
- {{ 0, 0, 3 }}, // 6
- {{ 0, 0, 3 }}, // 7
- {{ 0, 1, 1 }}, // 8
- {{ 0, 1, 1 }}, // 9
- {{ 1, 0, 2 }}, // 10
- {{ 1, 0, 2 }}, // 11
- {{ 0, 0, 4 }}, // 12
- {{ 0, 0, 4 }}, // 13
- {{ 0, 0, 4 }}, // 14
- {{ 0, 0, 4 }}, // 15
- {{ 0, 1, 2 }}, // 16
- {{ 0, 1, 2 }}, // 17
- {{ 0, 1, 2 }}, // 18
- {{ 0, 1, 2 }}, // 19
- {{ 1, 0, 3 }}, // 20
- {{ 1, 0, 3 }}, // 21
- {{ 1, 0, 3 }}, // 22
- {{ 1, 0, 3 }}, // 23
- {{ 0, 0, 5 }}, // 24
- {{ 0, 0, 5 }}, // 25
- {{ 0, 0, 5 }}, // 26
- {{ 0, 0, 5 }}, // 27
- {{ 0, 0, 5 }}, // 28
- {{ 0, 0, 5 }}, // 29
- {{ 0, 0, 5 }}, // 30
- {{ 0, 0, 5 }}, // 31
- };
-
- int t, q, b;
- for (int i = 1; i < 32; ++i) {
- IntegerSequenceCodec::GetCountsForRange(i, &t, &q, &b);
- EXPECT_EQ(t, kExpectedCounts[i - 1][0]);
- EXPECT_EQ(q, kExpectedCounts[i - 1][1]);
- EXPECT_EQ(b, kExpectedCounts[i - 1][2]);
- }
-
- ASSERT_DEATH(IntegerSequenceCodec::GetCountsForRange(0, &t, &q, &b), "");
- ASSERT_DEATH(IntegerSequenceCodec::GetCountsForRange(256, &t, &q, &b), "");
-
- IntegerSequenceCodec::GetCountsForRange(1, &t, &q, &b);
- EXPECT_EQ(t, 0);
- EXPECT_EQ(q, 0);
- EXPECT_EQ(b, 1);
-}
-
-// Test to make sure that we're calculating the number of bits needed to
-// encode a given number of values based on the range of the values.
-TEST(ASTCIntegerSequenceCodecTest, TestNumBitsForCounts) {
- int trits = 0;
- int quints = 0;
- int bits = 0;
-
- // A range of one should have single bits, so n 1-bit values should be n bits.
- trits = 0;
- quints = 0;
- bits = 1;
- for (int i = 0; i < 64; ++i) {
- EXPECT_EQ(IntegerSequenceCodec::GetBitCount(i, trits, quints, bits), i);
- EXPECT_EQ(IntegerSequenceCodec::GetBitCountForRange(i, 1), i);
- }
-
- // Similarly, N two-bit values should be 2n bits...
- trits = 0;
- quints = 0;
- bits = 2;
- for (int i = 0; i < 64; ++i) {
- int bit_counts = IntegerSequenceCodec::GetBitCount(i, trits, quints, bits);
- EXPECT_EQ(bit_counts, 2 * i);
- EXPECT_EQ(IntegerSequenceCodec::GetBitCountForRange(i, 3), 2 * i);
- }
-
- // Trits are a bit more complicated -- there are five trits in a block, so
- // if we encode 15 values with 3 bits each in trits, we'd get three blocks,
- // each with eight bits of trits.
- trits = 1;
- quints = 0;
- bits = 3;
- EXPECT_EQ(IntegerSequenceCodec::GetBitCount(15, trits, quints, bits),
- 8 * 3 + 15 * 3);
- EXPECT_EQ(IntegerSequenceCodec::GetBitCountForRange(15, 23),
- IntegerSequenceCodec::GetBitCount(15, trits, quints, bits));
-
- // However, if instead we encode 13 values, we don't need to use the remaining
- // two values, so we only need bits as they will be encoded. As it turns out,
- // this means we can avoid three bits in the final block (one for the high
- // order trit encoding and two for one of the values), resulting in 47 bits.
- trits = 1;
- quints = 0;
- bits = 2;
- EXPECT_EQ(IntegerSequenceCodec::GetBitCount(13, trits, quints, bits), 47);
- EXPECT_EQ(IntegerSequenceCodec::GetBitCountForRange(13, 11),
- IntegerSequenceCodec::GetBitCount(13, trits, quints, bits));
-
- // Quints have a similar property -- if we encode six values using a quint and
- // four bits, then we have two quint blocks each with three values and a seven
- // bit encoded quint triplet...
- trits = 0;
- quints = 1;
- bits = 4;
- EXPECT_EQ(IntegerSequenceCodec::GetBitCount(6, trits, quints, bits),
- 7 * 2 + 6 * 4);
- EXPECT_EQ(IntegerSequenceCodec::GetBitCountForRange(6, 79),
- IntegerSequenceCodec::GetBitCount(6, trits, quints, bits));
-
- // If we have fewer values than blocks we can again avoid about 2 + nbits
- // bits...
- trits = 0;
- quints = 1;
- bits = 3;
- EXPECT_EQ(IntegerSequenceCodec::GetBitCount(7, trits, quints, bits),
- /* first two quint blocks */ 7 * 2 +
- /* first two blocks of bits */ 6 * 3 +
- /* last quint block without the high order four bits */ 3 +
- /* last block with one set of three bits */ 3);
-}
-
-// Tests that the encoder knows how to encode values of the form 5*2^k.
-TEST(ASTCIntegerSequenceCodecTest, TestQuintCodec) {
- // In this case, k = 4
-
- // Setup bit src/sink
- BitStream<UInt128> bit_sink;
-
- const int kValueRange = 79;
- IntegerSequenceEncoder enc(kValueRange);
- enc.AddValue(3);
- enc.AddValue(79);
- enc.AddValue(37);
- enc.Encode(&bit_sink);
-
- // quint: 1000101 m0: 0011 m1: 1111 m2: 0101
- // 100 0100 0111 1101 0010
- // interleaved 10m200m1101m0
- // should be 100 1010 0111 1101 0011 = 0x4A7D3
- EXPECT_EQ(bit_sink.Bits(), 19);
-
- uint64_t encoded = 0;
- bit_sink.GetBits(19, &encoded);
- EXPECT_EQ(encoded, 0x4A7D3);
-
- // Now check that decoding it works as well
- BitStream<UInt128> bit_src(encoded, 19);
-
- IntegerSequenceDecoder dec(kValueRange);
- auto decoded_vals = dec.Decode(3, &bit_src);
- ASSERT_EQ(decoded_vals.size(), 3);
- EXPECT_EQ(decoded_vals[0], 3);
- EXPECT_EQ(decoded_vals[1], 79);
- EXPECT_EQ(decoded_vals[2], 37);
-}
-
-// Tests that the encoder knows how to encode values of the form 3*2^k.
-TEST(ASTCIntegerSequenceCodecTest, TestTritCodec) {
- uint64_t encoded = 0;
-
- // Setup bit src/sink
- BitStream<UInt128> bit_sink(encoded, 0);
-
- const int kValueRange = 11;
- IntegerSequenceEncoder enc(kValueRange);
- enc.AddValue(7);
- enc.AddValue(5);
- enc.AddValue(3);
- enc.AddValue(6);
- enc.AddValue(10);
- enc.Encode(&bit_sink);
-
- EXPECT_EQ(bit_sink.Bits(), 18);
-
- bit_sink.GetBits(18, &encoded);
- EXPECT_EQ(encoded, 0x37357);
-
- // Now check that decoding it works as well
- BitStream<UInt128> bit_src(encoded, 19);
-
- IntegerSequenceDecoder dec(kValueRange);
- auto decoded_vals = dec.Decode(5, &bit_src);
- ASSERT_EQ(decoded_vals.size(), 5);
- EXPECT_EQ(decoded_vals[0], 7);
- EXPECT_EQ(decoded_vals[1], 5);
- EXPECT_EQ(decoded_vals[2], 3);
- EXPECT_EQ(decoded_vals[3], 6);
- EXPECT_EQ(decoded_vals[4], 10);
-}
-
-// Test a specific quint encoding/decoding. This test makes sure that the way we
-// encode and decode integer sequences matches what we should expect out of the
-// reference ASTC encoder.
-TEST(ASTCIntegerSequenceCodecTest, TestDecodeThenEncode) {
- std::vector<int> vals = {{ 16, 18, 17, 4, 7, 14, 10, 0 }};
- const uint64_t kValEncoding = 0x2b9c83dc;
-
- BitStream<UInt128> bit_src(kValEncoding, 64);
- IntegerSequenceDecoder dec(19);
- auto decoded_vals = dec.Decode(8, &bit_src);
- ASSERT_EQ(decoded_vals.size(), vals.size());
- for (size_t i = 0; i < decoded_vals.size(); ++i) {
- EXPECT_EQ(decoded_vals[i], vals[i]);
- }
-
- // Setup bit src/sink
- BitStream<UInt128> bit_sink;
- IntegerSequenceEncoder enc(19);
- for (const auto& v : vals) {
- enc.AddValue(v);
- }
- enc.Encode(&bit_sink);
- EXPECT_EQ(bit_sink.Bits(), 35);
-
- uint64_t encoded = 0;
- EXPECT_TRUE(bit_sink.GetBits(35, &encoded));
- EXPECT_EQ(encoded, kValEncoding)
- << std::hex << encoded << " -- " << kValEncoding;
-}
-
-// Same as the previous test, except it uses a trit encoding rather than a
-// quint encoding.
-TEST(ASTCIntegerSequenceCodecTest, TestDecodeThenEncodeTrits) {
- std::vector<int> vals = {{ 6, 0, 0, 2, 0, 0, 0, 0, 8, 0, 0, 0, 0, 8, 8, 0 }};
- const uint64_t kValEncoding = 0x0004c0100001006ULL;
-
- BitStream<UInt128> bit_src(kValEncoding, 64);
- IntegerSequenceDecoder dec(11);
- auto decoded_vals = dec.Decode(vals.size(), &bit_src);
- ASSERT_EQ(decoded_vals.size(), vals.size());
- for (size_t i = 0; i < decoded_vals.size(); ++i) {
- EXPECT_EQ(decoded_vals[i], vals[i]);
- }
-
- // Setup bit src/sink
- BitStream<UInt128> bit_sink;
- IntegerSequenceEncoder enc(11);
- for (const auto& v : vals) {
- enc.AddValue(v);
- }
- enc.Encode(&bit_sink);
- EXPECT_EQ(bit_sink.Bits(), 58);
-
- uint64_t encoded = 0;
- EXPECT_TRUE(bit_sink.GetBits(58, &encoded));
- EXPECT_EQ(encoded, kValEncoding)
- << std::hex << encoded << " -- " << kValEncoding;
-}
-
-// Generate a random sequence of integer codings with different ranges to test
-// the reciprocability of our codec (encoded sequences should be able to
-// decoded)
-TEST(ASTCIntegerSequenceCodecTest, TestRandomReciprocation) {
- std::mt19937 mt(0xbad7357);
- std::uniform_int_distribution<int> rand(0, 255);
-
- for (int test = 0; test < 1600; ++test) {
- // Generate a random number of values and a random range
- int num_vals = 4 + rand(mt) % 44; // Up to 48 weights in a grid
- int range = 1 + rand(mt) % 63;
-
- // If this produces a bit pattern larger than our buffer, then ignore
- // it... we already know what our bounds are for the integer sequences
- int num_bits = IntegerSequenceCodec::GetBitCountForRange(num_vals, range);
- if (num_bits >= 64) {
- continue;
- }
-
- std::vector<int> generated_vals(num_vals);
- for (auto& val : generated_vals) {
- val = rand(mt) % (range + 1);
- }
-
- // Encode the values using the
- BitStream<UInt128> bit_sink;
-
- // Add them to the encoder
- IntegerSequenceEncoder enc(range);
- for (int v : generated_vals) {
- enc.AddValue(v);
- }
- enc.Encode(&bit_sink);
-
- uint64_t encoded = 0;
- bit_sink.GetBits(bit_sink.Bits(), &encoded);
- ASSERT_GE(encoded, 0);
- EXPECT_LT(encoded, 1ULL << num_bits);
-
- BitStream<UInt128> bit_src(encoded, 64);
-
- IntegerSequenceDecoder dec(range);
- auto decoded_vals = dec.Decode(num_vals, &bit_src);
-
- ASSERT_EQ(decoded_vals.size(), generated_vals.size());
- for (size_t i = 0; i < decoded_vals.size(); ++i) {
- EXPECT_EQ(decoded_vals[i], generated_vals[i]);
- }
- }
-}
-
-} // namespace
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/intermediate_astc_block_test.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/intermediate_astc_block_test.cc
deleted file mode 100644
index 41861cb97b7..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/intermediate_astc_block_test.cc
+++ /dev/null
@@ -1,454 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/intermediate_astc_block.h"
-#include "src/decoder/test/image_utils.h"
-
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-#include <string>
-
-namespace astc_codec {
-
-namespace {
-
-using ::testing::ElementsAre;
-using ::testing::Eq;
-using ::testing::HasSubstr;
-using ::testing::SizeIs;
-using ::testing::TestWithParam;
-using ::testing::ValuesIn;
-
-// Test to make sure that unpacking an error block returns false.
-TEST(IntermediateASTCBlockTest, TestUnpackError) {
- const PhysicalASTCBlock kErrorBlock(base::UInt128(0));
- EXPECT_FALSE(UnpackVoidExtent(kErrorBlock));
- EXPECT_FALSE(UnpackIntermediateBlock(kErrorBlock));
-}
-
-// Test to make sure that if we don't populate our weight data in the
-// intermediate block than the resulting color range should error due to the
-// mismatch.
-TEST(IntermediateASTCBlockTest, TestEndpointRangeErrorOnNotSettingWeights) {
- IntermediateBlockData data;
- data.weight_range = 15;
- for (auto& ep : data.endpoints) {
- ep.mode = ColorEndpointMode::kLDRRGBDirect;
- }
- data.weight_grid_dim_x = 6;
- data.weight_grid_dim_y = 6;
- EXPECT_EQ(-1, EndpointRangeForBlock(data));
-
- base::UInt128 dummy;
- auto err_str = Pack(data, &dummy);
- EXPECT_TRUE(err_str.hasValue());
- EXPECT_THAT(err_str.value(), HasSubstr("Incorrect number of weights"));
-}
-
-// Test to make sure that if we run out of bits, then we should say so.
-TEST(IntermediateASTCBlockTest, TestEndpointRangeErrorOnNotEnoughBits) {
- IntermediateBlockData data;
- data.weight_range = 1;
- data.partition_id = 0;
- data.endpoints.resize(3);
- for (auto& ep : data.endpoints) {
- ep.mode = ColorEndpointMode::kLDRRGBDirect;
- }
- data.weight_grid_dim_x = 8;
- data.weight_grid_dim_y = 8;
- EXPECT_EQ(-2, EndpointRangeForBlock(data));
-
- // Resize the weights to get past the error that they do not match the grid
- // dimensions.
- data.weights.resize(64);
-
- base::UInt128 dummy;
- auto err_str = Pack(data, &dummy);
- EXPECT_TRUE(err_str.hasValue());
- EXPECT_THAT(err_str.value(), HasSubstr("illegal color range"));
-}
-
-// Test to make sure that as we increase the number of weights, we decrease the
-// allowable range of colors
-TEST(IntermediateASTCBlockTest, TestEndpointRangeForBlock) {
- IntermediateBlockData data;
- data.weight_range = 2;
- data.endpoints.resize(2);
- data.dual_plane_channel.clear();
- for (auto& ep : data.endpoints) {
- ep.mode = ColorEndpointMode::kLDRRGBDirect;
- }
-
- // Weight params control how many weights are present in a block
- struct WeightParams {
- int width;
- int height;
-
- // We should sort based on number of weights for these params
- int NumWeights() const { return width * height; }
- bool operator<(const WeightParams& other) const {
- return NumWeights() < other.NumWeights();
- }
- };
-
- std::vector<WeightParams> weight_params;
- for (int y = 2; y < 8; ++y) {
- for (int x = 2; x < 8; ++x) {
- weight_params.emplace_back(WeightParams{x, y});
- }
- }
-
- // Sort weights from fewest to largest such that the allowable color range
- // should be monotonically decreasing
- std::sort(weight_params.begin(), weight_params.end());
-
- // Keep track of the largest available color range and measure that it
- // decreases as we add more weights to our block
- int last_color_range = 255;
- for (const auto& params : weight_params) {
- data.weight_grid_dim_x = params.width;
- data.weight_grid_dim_y = params.height;
-
- const int color_range = EndpointRangeForBlock(data);
- EXPECT_LE(color_range, last_color_range);
- last_color_range = std::min(color_range, last_color_range);
- }
-
- // Make sure that we actually changed it at some point.
- EXPECT_LT(last_color_range, 255);
-}
-
-// Test to make sure that unpacking an legitimate ASTC block returns the encoded
-// values that we expect.
-TEST(IntermediateASTCBlockTest, TestUnpackNonVoidExtentBlock) {
- PhysicalASTCBlock blk(0x0000000001FE000173ULL);
- auto b = UnpackIntermediateBlock(blk);
- ASSERT_TRUE(b);
-
- const auto& data = b.value();
- EXPECT_EQ(data.weight_grid_dim_x, 6);
- EXPECT_EQ(data.weight_grid_dim_y, 5);
- EXPECT_EQ(data.weight_range, 7);
-
- EXPECT_FALSE(data.partition_id);
- EXPECT_FALSE(data.dual_plane_channel);
-
- ASSERT_EQ(data.weights.size(), 30);
- for (auto weight : data.weights) {
- EXPECT_EQ(weight, 0);
- }
-
- ASSERT_EQ(data.endpoints.size(), 1);
- for (const auto& ep_data : data.endpoints) {
- EXPECT_EQ(ep_data.mode, ColorEndpointMode::kLDRLumaDirect);
- ASSERT_EQ(ep_data.colors.size(), 2);
- EXPECT_EQ(ep_data.colors[0], 0);
- EXPECT_EQ(ep_data.colors[1], 255);
- }
-}
-
-// Make sure that we can pack blocks that aren't void extent blocks. (In other
-// words, can we actually deal with intermediate ASTC data).
-TEST(IntermediateASTCBlockTest, TestPackNonVoidExtentBlock) {
- IntermediateBlockData data;
-
- data.weight_grid_dim_x = 6;
- data.weight_grid_dim_y = 5;
- data.weight_range = 7;
-
- data.partition_id = {};
- data.dual_plane_channel = {};
-
- data.weights.resize(30);
- for (auto& weight : data.weights) {
- weight = 0;
- }
-
- data.endpoints.resize(1);
- for (auto& ep_data : data.endpoints) {
- ep_data.mode = ColorEndpointMode::kLDRLumaDirect;
- ep_data.colors.resize(2);
- ep_data.colors[0] = 0;
- ep_data.colors[1] = 255;
- }
-
- base::UInt128 packed;
- auto error_str = Pack(data, &packed);
- ASSERT_FALSE(error_str) << (error_str ? error_str.value() : std::string(""));
- EXPECT_EQ(packed, 0x0000000001FE000173ULL);
-}
-
-// Make sure that we can unpack void extent blocks
-TEST(IntermediateASTCBlockTest, TestUnpackVoidExtentBlock) {
- PhysicalASTCBlock void_extent_block(0xFFFFFFFFFFFFFDFCULL);
-
- auto b = UnpackVoidExtent(void_extent_block);
- ASSERT_TRUE(b);
-
- const auto& data = b.value();
- EXPECT_EQ(data.r, 0);
- EXPECT_EQ(data.g, 0);
- EXPECT_EQ(data.b, 0);
- EXPECT_EQ(data.a, 0);
- for (const auto& coord : data.coords) {
- EXPECT_EQ(coord, (1 << 13) - 1);
- }
-
- base::UInt128 more_interesting(0xdeadbeefdeadbeefULL, 0xFFF8003FFE000DFCULL);
- b = UnpackVoidExtent(PhysicalASTCBlock(more_interesting));
- ASSERT_TRUE(b);
-
- const auto& other_data = b.value();
- EXPECT_EQ(other_data.r, 0xbeef);
- EXPECT_EQ(other_data.g, 0xdead);
- EXPECT_EQ(other_data.b, 0xbeef);
- EXPECT_EQ(other_data.a, 0xdead);
- EXPECT_EQ(other_data.coords[0], 0);
- EXPECT_EQ(other_data.coords[1], 8191);
- EXPECT_EQ(other_data.coords[2], 0);
- EXPECT_EQ(other_data.coords[3], 8191);
-}
-
-// Make sure that we can pack void extent blocks and void extent data.
-TEST(IntermediateASTCBlockTest, TestPackVoidExtentBlock) {
- VoidExtentData data;
- data.r = 0;
- data.g = 0;
- data.b = 0;
- data.a = 0;
- for (auto& coord : data.coords) {
- coord = (1 << 13) - 1;
- }
-
- base::UInt128 packed;
- auto error_str = Pack(data, &packed);
- ASSERT_FALSE(error_str) << (error_str ? error_str.value() : std::string(""));
- EXPECT_EQ(packed, 0xFFFFFFFFFFFFFDFCULL);
-
- data.r = 0xbeef;
- data.g = 0xdead;
- data.b = 0xbeef;
- data.a = 0xdead;
- data.coords[0] = 0;
- data.coords[1] = 8191;
- data.coords[2] = 0;
- data.coords[3] = 8191;
-
- error_str = Pack(data, &packed);
- ASSERT_FALSE(error_str) << (error_str ? error_str.value() : std::string(""));
- EXPECT_EQ(packed,
- base::UInt128(0xdeadbeefdeadbeefULL, 0xFFF8003FFE000DFCULL));
-}
-
-// Make sure that the color endpoint mode is properly repacked. This test case
-// was created as a bug during testing.
-TEST(IntermediateASTCBlockTest, TestPackUnpackWithSameCEM) {
- base::UInt128 orig(0xe8e8eaea20000980ULL, 0x20000200cb73f045ULL);
-
- auto b = UnpackIntermediateBlock(PhysicalASTCBlock(orig));
- ASSERT_TRUE(b);
-
- base::UInt128 repacked;
- auto err_str = Pack(b.value(), &repacked);
- ASSERT_FALSE(err_str) << (err_str ? err_str.value() : std::string(""));
-
- EXPECT_EQ(repacked, orig);
-
- // Test case #2
- orig = base::UInt128(0x3300c30700cb01c5ULL, 0x0573907b8c0f6879ULL);
- b = UnpackIntermediateBlock(PhysicalASTCBlock(orig));
- ASSERT_TRUE(b);
-
- err_str = Pack(b.value(), &repacked);
- ASSERT_FALSE(err_str) << (err_str ? err_str.value() : std::string(""));
- EXPECT_EQ(repacked, orig);
-}
-
-// Test that we can encode/decode a block that uses a very large gap
-// between weight and endpoint data.
-TEST(IntermediateASTCBlockTest, TestPackingWithLargeGap) {
- // We can construct this block by doing the following:
- // -- choose a block mode that only gives 24 weight bits
- // -- choose the smallest endpoint mode: grayscale direct
- // -- make sure there are no partitions
- const base::UInt128 orig(0xBEDEAD0000000000ULL, 0x0000000001FE032EULL);
- const auto b = UnpackIntermediateBlock(PhysicalASTCBlock(orig));
- ASSERT_TRUE(b);
-
- const auto& data = b.value();
- EXPECT_EQ(data.weight_grid_dim_x, 2);
- EXPECT_EQ(data.weight_grid_dim_y, 3);
- EXPECT_EQ(data.weight_range, 15);
-
- EXPECT_FALSE(data.partition_id);
- EXPECT_FALSE(data.dual_plane_channel);
-
- ASSERT_EQ(data.endpoints.size(), 1);
- EXPECT_EQ(data.endpoints.at(0).mode, ColorEndpointMode::kLDRLumaDirect);
-
- ASSERT_EQ(data.endpoints.at(0).colors.size(), 2);
- EXPECT_EQ(data.endpoints.at(0).colors.at(0), 255);
- EXPECT_EQ(data.endpoints.at(0).colors.at(1), 0);
-
- // Now encode it again
- base::UInt128 repacked;
- const auto err_str = Pack(b.value(), &repacked);
- EXPECT_EQ(orig, repacked) << (err_str ? err_str.value() : std::string(""));
-}
-
-// Take a block that is encoded using direct luma with full byte values and see
-// if we properly set the endpoint range.
-TEST(IntermediateASTCBlockTest, TestEndpointRange) {
- PhysicalASTCBlock blk(0x0000000001FE000173ULL);
- EXPECT_TRUE(blk.ColorValuesRange().hasValue());
- EXPECT_EQ(blk.ColorValuesRange().valueOr(0), 255);
-
- auto b = UnpackIntermediateBlock(blk);
- ASSERT_TRUE(b);
-
- const auto& data = b.value();
- ASSERT_THAT(data.endpoints, SizeIs(1));
- EXPECT_THAT(data.endpoints[0].mode, Eq(ColorEndpointMode::kLDRLumaDirect));
- EXPECT_THAT(data.endpoints[0].colors, ElementsAre(0, 255));
- EXPECT_TRUE(data.endpoint_range.hasValue());
- EXPECT_EQ(data.endpoint_range.valueOr(0), 255);
-}
-
-struct ImageTestParams {
- std::string image_name;
- int checkered_dim;
-};
-
-static void PrintTo(const ImageTestParams& params, std::ostream* os) {
- *os << "ImageTestParams(" << params.image_name << ")";
-}
-
-class IntermediateASTCBlockTest : public TestWithParam<ImageTestParams> { };
-
-// Test whether or not a real-world ASTC implementation can be unpacked and
-// then repacked into the same implementation. In conjunction with the other
-// tests, we make sure that we can recreate ASTC blocks that we have previously
-// unpacked.
-TEST_P(IntermediateASTCBlockTest, TestPackUnpack) {
- const auto& params = GetParam();
- const int astc_dim = 8;
- const int img_dim = params.checkered_dim * astc_dim;
- const std::string astc = LoadASTCFile(params.image_name);
-
- // Make sure that unpacking and repacking all of the blocks works...
- const int kNumASTCBlocks = (img_dim / astc_dim) * (img_dim / astc_dim);
- for (int i = 0; i < kNumASTCBlocks; ++i) {
- base::UInt128 block_bits;
- memcpy(&block_bits, astc.data() + PhysicalASTCBlock::kSizeInBytes * i,
- PhysicalASTCBlock::kSizeInBytes);
-
- const PhysicalASTCBlock block(block_bits);
-
- base::UInt128 repacked;
- if (block.IsVoidExtent()) {
- auto b = UnpackVoidExtent(block);
- ASSERT_TRUE(b);
-
- auto err_str = Pack(b.value(), &repacked);
- ASSERT_FALSE(err_str) << (err_str ? err_str.value() : std::string(""));
- } else {
- auto b = UnpackIntermediateBlock(block);
- ASSERT_TRUE(b);
-
- // Check to see that we properly set the endpoint range when we decoded
- // the block.
- auto& block_data = b.value();
- EXPECT_EQ(block_data.endpoint_range, block.ColorValuesRange());
-
- // Reset the endpoint range here to see if we correctly reconstruct it
- // below
- block_data.endpoint_range = {};
-
- auto err_str = Pack(b.value(), &repacked);
- ASSERT_FALSE(err_str) << (err_str ? err_str.value() : std::string(""));
- }
-
- // You would expect the following line to be enough:
- // EXPECT_EQ(repacked, block.GetBlockBits())
- // ... except that the ASTC encoder makes some interesting decisions
- // about how to encode the same logical bits. One example is that
- // sometimes if all partitions share an endpoint mode, the encoded
- // block will not use the shared CEM mode, and rather list each
- // partition's mode explicitly. For that reason, we just need to make as
- // close of an approximation as possible that we decode to the same
- // physical values.
-
- PhysicalASTCBlock pb(repacked);
- ASSERT_FALSE(pb.IsIllegalEncoding());
-
- base::UInt128 pb_color_mask =
- (base::UInt128(1) << pb.NumColorBits().value()) - 1;
- base::UInt128 pb_color_bits =
- pb.GetBlockBits() >> pb.ColorStartBit().value();
- pb_color_bits &= pb_color_mask;
-
- base::UInt128 b_color_mask =
- (base::UInt128(1) << pb.NumColorBits().value()) - 1;
- base::UInt128 b_color_bits =
- block.GetBlockBits() >> block.ColorStartBit().value();
- b_color_bits &= b_color_mask;
-
- EXPECT_EQ(pb_color_mask, b_color_mask);
- EXPECT_EQ(pb_color_bits, b_color_bits);
-
- EXPECT_EQ(pb.IsVoidExtent(), block.IsVoidExtent());
- EXPECT_EQ(pb.VoidExtentCoords(), block.VoidExtentCoords());
-
- EXPECT_EQ(pb.WeightGridDims(), block.WeightGridDims());
- EXPECT_EQ(pb.WeightRange(), block.WeightRange());
- EXPECT_EQ(pb.NumWeightBits(), block.NumWeightBits());
- EXPECT_EQ(pb.WeightStartBit(), block.WeightStartBit());
-
- EXPECT_EQ(pb.IsDualPlane(), block.IsDualPlane());
- EXPECT_EQ(pb.DualPlaneChannel(), block.DualPlaneChannel());
-
- EXPECT_EQ(pb.NumPartitions(), block.NumPartitions());
- EXPECT_EQ(pb.PartitionID(), block.PartitionID());
-
- EXPECT_EQ(pb.NumColorValues(), block.NumColorValues());
- EXPECT_EQ(pb.ColorValuesRange(), block.ColorValuesRange());
-
- for (int j = 0; j < pb.NumPartitions().valueOr(0); ++j) {
- EXPECT_EQ(pb.GetEndpointMode(j), block.GetEndpointMode(j));
- }
- }
-}
-
-std::vector<ImageTestParams> GetImageTestParams() {
- return {
- // image_name checkered_dim
- { "checkered_4", 4 },
- { "checkered_5", 5 },
- { "checkered_6", 6 },
- { "checkered_7", 7 },
- { "checkered_8", 8 },
- { "checkered_9", 9 },
- { "checkered_10", 10 },
- { "checkered_11", 11 },
- { "checkered_12", 12 },
- };
-}
-
-INSTANTIATE_TEST_CASE_P(Checkered, IntermediateASTCBlockTest,
- ValuesIn(GetImageTestParams()));
-
-} // namespace
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/logical_astc_block_test.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/logical_astc_block_test.cc
deleted file mode 100644
index ed85f3fdcf9..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/logical_astc_block_test.cc
+++ /dev/null
@@ -1,273 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/logical_astc_block.h"
-#include "src/decoder/test/image_utils.h"
-
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-
-#include <fstream>
-#include <string>
-
-namespace astc_codec {
-
-namespace {
-
-using ::testing::Eq;
-using ::testing::ElementsAre;
-using ::testing::TestWithParam;
-using ::testing::ValuesIn;
-
-ImageBuffer LoadGoldenImageWithAlpha(std::string basename) {
- const std::string filename = std::string("src/decoder/testdata/") + basename + ".bmp";
- ImageBuffer result;
- LoadGoldenBmp(filename, &result);
- EXPECT_EQ(result.BytesPerPixel(), 4);
- return result;
-}
-
-ImageBuffer LoadGoldenImage(std::string basename) {
- const std::string filename = std::string("src/decoder/testdata/") + basename + ".bmp";
- ImageBuffer result;
- LoadGoldenBmp(filename, &result);
- EXPECT_EQ(result.BytesPerPixel(), 3);
- return result;
-}
-
-struct ImageTestParams {
- std::string image_name;
- bool has_alpha;
- Footprint footprint;
- int width;
- int height;
-};
-
-static void PrintTo(const ImageTestParams& params, std::ostream* os) {
- *os << "ImageTestParams(" << params.image_name << ", "
- << params.width << "x" << params.height << ", "
- << (params.has_alpha ? "RGBA" : "RGB") << ", "
- << "footprint " << params.footprint.Width() << "x"
- << params.footprint.Height() << ")";
-}
-
-class LogicalASTCBlockTest : public TestWithParam<ImageTestParams> { };
-
-// Test to make sure that reading out color values from blocks is not
-// terribly wrong. To do so, we compress an image and then decompress it
-// using our logical blocks and the library. The difference between the
-// decoded images should be minimal.
-TEST_P(LogicalASTCBlockTest, ImageWithFootprint) {
- const auto& params = GetParam();
- const std::string astc = LoadASTCFile(params.image_name);
-
- ImageBuffer our_decoded_image;
- our_decoded_image.Allocate(params.width, params.height, params.has_alpha ? 4 : 3);
-
- const int block_width = params.footprint.Width();
- const int block_height = params.footprint.Height();
-
- base::UInt128 block;
- for (int i = 0; i < astc.size(); i += 16) {
- const int block_index = i / 16;
- const int blocks_wide =
- (params.width + block_width - 1) / block_width;
- const int block_x = block_index % blocks_wide;
- const int block_y = block_index / blocks_wide;
- memcpy(&block, astc.data() + i, sizeof(block));
-
- PhysicalASTCBlock physical_block(block);
- if (physical_block.IsVoidExtent()) {
- auto ve = UnpackVoidExtent(physical_block);
- ASSERT_TRUE(ve) << "ASTC encoder produced invalid block!";
- } else {
- auto ib = UnpackIntermediateBlock(physical_block);
- ASSERT_TRUE(ib) << "ASTC encoder produced invalid block!";
- }
-
- // Make sure that the library doesn't produce incorrect ASTC blocks.
- // This is covered in more depth in other tests in
- // intermediate_astc_block_test and physical_astc_block_test
- auto lb = UnpackLogicalBlock(params.footprint, physical_block);
- ASSERT_TRUE(lb) << "ASTC encoder produced invalid block!";
-
- LogicalASTCBlock logical_block = lb.value();
- const size_t color_size = params.has_alpha ? 4 : 3;
-
- for (int y = 0; y < block_height; ++y) {
- for (int x = 0; x < block_width; ++x) {
- const int px = block_width * block_x + x;
- const int py = block_height * block_y + y;
-
- // Skip out of bounds.
- if (px >= params.width || py >= params.height) {
- continue;
- }
-
- uint8_t* pixel = our_decoded_image(px, py);
- const RgbaColor decoded_color = logical_block.ColorAt(x, y);
- ASSERT_LE(color_size, decoded_color.size());
-
- for (int c = 0; c < color_size; ++c) {
- // All of the pixels should also be 8-bit values.
- ASSERT_GE(decoded_color[c], 0);
- ASSERT_LT(decoded_color[c], 256);
- pixel[c] = decoded_color[c];
- }
- }
- }
- }
-
- // Check that the decoded image is *very* similar to the library decoding
- // of an ASTC texture. They may not be exact due to differences in how we
- // convert a 16-bit float to an 8-bit integer.
- ImageBuffer decoded_image = params.has_alpha ? LoadGoldenImageWithAlpha(params.image_name) : LoadGoldenImage(params.image_name);
- CompareSumOfSquaredDifferences(decoded_image, our_decoded_image, 1.0);
-}
-
-// Test to make sure that a simple gradient image can be compressed and decoded
-// by our logical block representation. This should work with every footprint.
-std::vector<ImageTestParams> GetSyntheticImageTestParams() {
- return {
- // image_name alpha astc footprint width height
- { "footprint_4x4", false, Footprint::Get4x4(), 32, 32 },
- { "footprint_5x4", false, Footprint::Get5x4(), 32, 32 },
- { "footprint_5x5", false, Footprint::Get5x5(), 32, 32 },
- { "footprint_6x5", false, Footprint::Get6x5(), 32, 32 },
- { "footprint_6x6", false, Footprint::Get6x6(), 32, 32 },
- { "footprint_8x5", false, Footprint::Get8x5(), 32, 32 },
- { "footprint_8x6", false, Footprint::Get8x6(), 32, 32 },
- { "footprint_10x5", false, Footprint::Get10x5(), 32, 32 },
- { "footprint_10x6", false, Footprint::Get10x6(), 32, 32 },
- { "footprint_8x8", false, Footprint::Get8x8(), 32, 32 },
- { "footprint_10x8", false, Footprint::Get10x8(), 32, 32 },
- { "footprint_10x10", false, Footprint::Get10x10(), 32, 32 },
- { "footprint_12x10", false, Footprint::Get12x10(), 32, 32 },
- { "footprint_12x12", false, Footprint::Get12x12(), 32, 32 },
- };
-}
-
-INSTANTIATE_TEST_CASE_P(Synthetic, LogicalASTCBlockTest,
- ValuesIn(GetSyntheticImageTestParams()));
-
-// Test to make sure that reading out color values from blocks in a real-world
-// image isn't terribly wrong, either.
-std::vector<ImageTestParams> GetRealWorldImageTestParams() {
- return {
- // image_name alpha astc footprint width height
- { "rgb_4x4", false, Footprint::Get4x4(), 224, 288 },
- { "rgb_6x6", false, Footprint::Get6x6(), 224, 288 },
- { "rgb_8x8", false, Footprint::Get8x8(), 224, 288 },
- { "rgb_12x12", false, Footprint::Get12x12(), 224, 288 },
- { "rgb_5x4", false, Footprint::Get5x4(), 224, 288 }
- };
-}
-
-INSTANTIATE_TEST_CASE_P(RealWorld, LogicalASTCBlockTest,
- ValuesIn(GetRealWorldImageTestParams()));
-
-// Test to make sure that reading out color values from blocks in a real-world
-// image isn't terribly wrong, either.
-std::vector<ImageTestParams> GetTransparentImageTestParams() {
- return {
- // image_name alpha astc footprint width height
- { "atlas_small_4x4", true, Footprint::Get4x4(), 256, 256 },
- { "atlas_small_5x5", true, Footprint::Get5x5(), 256, 256 },
- { "atlas_small_6x6", true, Footprint::Get6x6(), 256, 256 },
- { "atlas_small_8x8", true, Footprint::Get8x8(), 256, 256 },
- };
-}
-
-INSTANTIATE_TEST_CASE_P(Transparent, LogicalASTCBlockTest,
- ValuesIn(GetTransparentImageTestParams()));
-
-// Test to make sure that if we set our endpoints then it's reflected in our
-// color selection
-TEST(LogicalASTCBlockTest, SetEndpoints) {
- LogicalASTCBlock logical_block(Footprint::Get8x8());
-
- // Setup a weight checkerboard
- for (int j = 0; j < 8; ++j) {
- for (int i = 0; i < 8; ++i) {
- if (((i ^ j) & 1) == 1) {
- logical_block.SetWeightAt(i, j, 0);
- } else {
- logical_block.SetWeightAt(i, j, 64);
- }
- }
- }
-
- // Now set the colors to something ridiculous
- logical_block.SetEndpoints({{ 123, 45, 67, 89 }}, {{ 101, 121, 31, 41 }}, 0);
-
- // For each pixel, we expect it to mirror the endpoints in a checkerboard
- // pattern
- for (int j = 0; j < 8; ++j) {
- for (int i = 0; i < 8; ++i) {
- if (((i ^ j) & 1) == 1) {
- EXPECT_THAT(logical_block.ColorAt(i, j), ElementsAre(123, 45, 67, 89));
- } else {
- EXPECT_THAT(logical_block.ColorAt(i, j), ElementsAre(101, 121, 31, 41));
- }
- }
- }
-}
-
-// Test whether or not setting weight values under different circumstances is
-// supported and reflected in the query functions.
-TEST(LogicalASTCBlockTest, SetWeightVals) {
- LogicalASTCBlock logical_block(Footprint::Get4x4());
-
- EXPECT_THAT(logical_block.GetFootprint(), Eq(Footprint::Get4x4()));
-
- // Not a dual plane by default
- EXPECT_FALSE(logical_block.IsDualPlane());
- logical_block.SetWeightAt(2, 3, 2);
-
- // Set the dual plane
- logical_block.SetDualPlaneChannel(0);
- EXPECT_TRUE(logical_block.IsDualPlane());
-
- // This shouldn't have reset our weight
- const LogicalASTCBlock other_block = logical_block;
- EXPECT_THAT(other_block.WeightAt(2, 3), Eq(2));
- EXPECT_THAT(other_block.DualPlaneWeightAt(0, 2, 3), Eq(2));
-
- // If we set the dual plane weight, it shouldn't change the original weight
- // value or the other channels
- logical_block.SetDualPlaneWeightAt(0, 2, 3, 1);
- EXPECT_THAT(logical_block.WeightAt(2, 3), Eq(2));
- EXPECT_THAT(logical_block.DualPlaneWeightAt(0, 2, 3), Eq(1));
- for (int i = 1; i < 4; ++i) {
- EXPECT_THAT(logical_block.DualPlaneWeightAt(i, 2, 3), Eq(2));
- }
-
- // Remove the dual plane
- logical_block.SetDualPlaneChannel(-1);
- EXPECT_FALSE(logical_block.IsDualPlane());
-
- // Now the original dual plane weight should be reset back to the others. Note
- // that we have to call DualPlaneWeightAt from a const logical block since
- // returning a reference to a weight that doesn't exist is illegal.
- const LogicalASTCBlock other_block2 = logical_block;
- EXPECT_THAT(logical_block.WeightAt(2, 3), Eq(2));
- for (int i = 0; i < 4; ++i) {
- EXPECT_EQ(logical_block.WeightAt(2, 3),
- other_block2.DualPlaneWeightAt(i, 2, 3));
- }
-}
-
-} // namespace
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/partition_test.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/partition_test.cc
deleted file mode 100644
index 63adfb500ff..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/partition_test.cc
+++ /dev/null
@@ -1,263 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/partition.h"
-
-#include <gmock/gmock.h>
-#include <gtest/gtest.h>
-
-#include <array>
-#include <random>
-#include <string>
-#include <vector>
-
-namespace {
-
-using ::testing::ElementsAreArray;
-using ::testing::Eq;
-using ::testing::Le;
-using ::testing::Not;
-
-using astc_codec::Footprint;
-using astc_codec::Partition;
-using astc_codec::PartitionMetric;
-using astc_codec::GetASTCPartition;
-using astc_codec::FindClosestASTCPartition;
-
-// Test to make sure that a simple difference between two partitions where
-// most of the values are the same returns what we expect.
-TEST(PartitionTest, TestSimplePartitionMetric) {
- Partition a = {Footprint::Get6x6(), /* num_parts = */ 2,
- /* partition_id = */ {}, /* assignment = */ {}};
- Partition b = a;
-
- a.assignment = {
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1,
- };
-
- b.assignment = {
- 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- };
-
- const int dist = PartitionMetric(a, b);
- EXPECT_EQ(dist, 2);
-}
-
-// Test to make sure that if one partition is a subset of another that we still
-// return the proper difference against the subset of the larger one.
-TEST(PartitionDeathTest, TestPartitionMetric) {
- Partition a = {Footprint::Get4x4(), /* num_parts = */ 2,
- /* partition_id = */ {}, /* assignment = */ {}};
- Partition b = {Footprint::Get6x6(), /* num_parts = */ 2,
- /* partition_id = */ {}, /* assignment = */ {}};
-
- a.assignment = {{
- 1, 1, 1, 1,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 1,
- }};
-
- b.assignment = {{
- 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1,
- 0, 0, 0, 0, 0, 0,
- 0, 1, 0, 0, 1, 0,
- 0, 0, 1, 1, 0, 0,
- }};
-
- EXPECT_DEATH(PartitionMetric(a, b), "");
-}
-
-// Test to make sure that even if we have different numbers of subsets for each
-// partition, that the returned value is what we'd expect.
-TEST(PartitionTest, TestDiffPartsPartitionMetric) {
- Partition a = {Footprint::Get4x4(), /* num_parts = */ 2,
- /* partition_id = */ {}, /* assignment = */ {}};
- Partition b = {Footprint::Get4x4(), /* num_parts = */ 3,
- /* partition_id = */ {}, /* assignment = */ {}};
-
- a.assignment = {{
- 2, 2, 2, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 1,
- }};
-
- b.assignment = {{
- 1, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0
- }};
-
- const int dist = PartitionMetric(a, b);
- EXPECT_EQ(dist, 3);
-}
-
-// An additional sanity check test that makes sure that we're not always mapping
-// zero to zero in our tests.
-TEST(PartitionTest, TestDiffMappingPartitionMetric) {
- Partition a = {Footprint::Get4x4(), /* num_parts = */ 2,
- /* partition_id = */ {}, /* assignment = */ {}};
- Partition b = {Footprint::Get4x4(), /* num_parts = */ 3,
- /* partition_id = */ {}, /* assignment = */ {}};
-
- a.assignment = {{
- 0, 1, 2, 2,
- 2, 2, 2, 2,
- 2, 2, 2, 2,
- 2, 2, 2, 2,
- }};
-
- b.assignment = {{
- 1, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- 0, 0, 0, 0,
- }};
-
- const int dist = PartitionMetric(a, b);
- EXPECT_EQ(dist, 1);
-}
-
-// Finally, if we grab an ASTC partition and modify it a tad, the closest
-// partition should still be the same ASTC partition.
-TEST(PartitionTest, TestFindingASTCPartition) {
- const Partition astc = GetASTCPartition(Footprint::Get12x12(), 3, 0x3CB);
- Partition almost_astc = astc;
- almost_astc.assignment[0]++;
-
- const Partition& closest_astc = FindClosestASTCPartition(almost_astc);
- EXPECT_EQ(astc, closest_astc);
-}
-
-// Test a partition that was obtained from the reference ASTC encoder. We should
-// be able to match it exactly
-TEST(PartitionTest, TestSpecificPartition) {
- const Partition astc = GetASTCPartition(Footprint::Get10x6(), 3, 557);
- EXPECT_THAT(astc.assignment, ElementsAreArray(std::array<int, 60> {{
- 0, 0, 0, 0, 1, 1, 1, 2, 2, 2,
- 0, 0, 0, 0, 1, 1, 1, 2, 2, 2,
- 0, 0, 0, 0, 1, 1, 1, 2, 2, 2,
- 0, 0, 0, 0, 1, 1, 1, 2, 2, 2,
- 0, 0, 0, 0, 1, 1, 1, 2, 2, 2,
- 0, 0, 0, 0, 1, 1, 1, 2, 2, 2 }}));
-}
-
-// Make sure that when we match against this specific partition, it'll return a
-// partition with the same number of subsets
-TEST(PartitionTest, EstimatedPartitionSubsets) {
- Partition partition = {
- /* footprint = */ Footprint::Get6x6(),
- /* num_parts = */ 2,
- /* partition_id = */ {},
- /* assignment = */ {
- 0, 0, 1, 1, 1, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1,
- 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1
- }};
-
- const Partition astc = FindClosestASTCPartition(partition);
- EXPECT_THAT(astc.num_parts, Eq(partition.num_parts));
-}
-
-// Make sure that regardless of what partition we match against, it'll return a
-// partition with at most a fewer number of subsets
-TEST(PartitionTest, EstimatedPartitionFewerSubsets) {
- std::mt19937 random(0xdeadbeef);
- auto randUniform = [&random](int max) {
- std::uniform_int_distribution<> dist(0, max - 1);
- return dist(random);
- };
-
- constexpr int kNumFootprints = Footprint::NumValidFootprints();
- const auto kFootprints = std::array<Footprint, kNumFootprints> {{
- Footprint::Get4x4(),
- Footprint::Get5x4(),
- Footprint::Get5x5(),
- Footprint::Get6x5(),
- Footprint::Get6x6(),
- Footprint::Get8x5(),
- Footprint::Get8x6(),
- Footprint::Get8x8(),
- Footprint::Get10x5(),
- Footprint::Get10x6(),
- Footprint::Get10x8(),
- Footprint::Get10x10(),
- Footprint::Get12x10(),
- Footprint::Get12x12()
- }};
-
- constexpr int kNumTests = 200;
- for (int i = 0; i < kNumTests; ++i) {
- const auto& footprint = kFootprints[randUniform(kNumFootprints)];
- const int num_parts = 2 + randUniform(3);
- Partition partition = {
- footprint,
- num_parts,
- /* partition_id = */ {},
- /* assignment = */ std::vector<int>(footprint.NumPixels(), 0)};
-
- for (auto& p : partition.assignment) {
- p = randUniform(num_parts);
- }
-
- const Partition astc = FindClosestASTCPartition(partition);
- EXPECT_THAT(astc.num_parts, Le(partition.num_parts))
- << "Test #" << i << ": "
- << "Selected partition with ID " << astc.partition_id.value();
- }
-}
-
-// Make sure that we generate unique partitions that are close to the
-// candidates.
-TEST(PartitionTest, UniquePartitionResults) {
- Partition partition = {
- /* footprint = */ Footprint::Get6x6(),
- /* num_parts = */ 2,
- /* partition_id = */ {},
- /* assignment = */ {
- 0, 1, 1, 1, 1, 1,
- 0, 1, 1, 1, 1, 1,
- 0, 1, 1, 1, 1, 1,
- 0, 1, 1, 1, 1, 1,
- 0, 1, 1, 1, 1, 1,
- 0, 1, 1, 1, 1, 1
- }};
-
- const auto parts = FindKClosestASTCPartitions(partition, 2);
- EXPECT_THAT(*parts[0], Not(Eq(*parts[1])));
-}
-
-// TODO(google): Verify somehow that the assignment generated from
-// GetASTCPartition actually matches what's in the spec. The selection
-// function was more or less copy/pasted though so it's unclear how to
-// measure that against e.g. the ASTC encoder.
-
-} // namespace
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/physical_astc_block_test.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/physical_astc_block_test.cc
deleted file mode 100644
index 8eafe461296..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/physical_astc_block_test.cc
+++ /dev/null
@@ -1,361 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/physical_astc_block.h"
-#include "src/base/uint128.h"
-
-#include <gtest/gtest.h>
-
-#include <string>
-#include <vector>
-
-using astc_codec::PhysicalASTCBlock;
-using astc_codec::ColorEndpointMode;
-using astc_codec::base::UInt128;
-
-namespace {
-
-static const PhysicalASTCBlock kErrorBlock(UInt128(0));
-
-// Test to make sure that each of the constructors work and that
-// they produce the same block encodings, since the ASTC blocks
-// are little-endian
-TEST(PhysicalASTCBlockTest, TestConstructors) {
- // Little-endian reading of bytes
- PhysicalASTCBlock blk1(0x0000000001FE000173ULL);
- PhysicalASTCBlock blk2(
- std::string("\x73\x01\x00\xFE\x01\x00\x00\x00\x00"
- "\x00\x00\x00\x00\x00\x00\x00\x00\x00", 16));
- EXPECT_EQ(blk1.GetBlockBits(), blk2.GetBlockBits());
-}
-
-// Test to see if we properly decode the maximum value that a weight
-// can take in an ASTC block based on the block mode encoding. We test
-// against a valid case and various error cases
-TEST(PhysicalASTCBlockTest, TestWeightRange) {
- PhysicalASTCBlock blk1(0x0000000001FE000173ULL);
- auto weight_range = blk1.WeightRange();
- ASSERT_TRUE(weight_range);
- EXPECT_EQ(weight_range.value(), 7);
-
- // If we flip the high bit then we should have a range of 31,
- // although then we have too many bits and this should error.
- PhysicalASTCBlock blk2(0x0000000001FE000373ULL);
- EXPECT_FALSE(blk2.WeightRange());
-
- // One bit per weight -- range of 1
- PhysicalASTCBlock non_shared_cem(0x4000000000800D44ULL);
- weight_range = non_shared_cem.WeightRange();
- ASSERT_TRUE(weight_range);
- EXPECT_EQ(weight_range.value(), 1);
-
- // Error blocks have no weight range
- EXPECT_FALSE(kErrorBlock.WeightRange());
-}
-
-// Test to see if we properly decode the weight grid width and height
-// in an ASTC block based on the block mode encoding. We test against
-// a valid case and various error cases
-TEST(PhysicalASTCBlockTest, TestWeightDims) {
- PhysicalASTCBlock blk1(0x0000000001FE000173ULL);
- auto weight_dims = blk1.WeightGridDims();
- EXPECT_TRUE(weight_dims);
- EXPECT_EQ(weight_dims.value()[0], 6);
- EXPECT_EQ(weight_dims.value()[1], 5);
-
- // If we flip the high bit then we should have a range of 31,
- // although then we have too many bits for the weight grid
- // and this should error.
- PhysicalASTCBlock blk2(0x0000000001FE000373ULL);
- EXPECT_FALSE(blk2.WeightGridDims());
- EXPECT_EQ(blk2.IsIllegalEncoding().value(),
- "Too many bits required for weight grid");
-
- // Dual plane block with 3x5 weight dims
- PhysicalASTCBlock blk3(0x0000000001FE0005FFULL);
- weight_dims = blk3.WeightGridDims();
- ASSERT_TRUE(weight_dims);
- EXPECT_EQ(weight_dims->at(0), 3);
- EXPECT_EQ(weight_dims->at(1), 5);
-
- // Error blocks shouldn't have any weight dims
- EXPECT_FALSE(kErrorBlock.WeightGridDims());
-
- PhysicalASTCBlock non_shared_cem(0x4000000000800D44ULL);
- weight_dims = non_shared_cem.WeightGridDims();
- ASSERT_TRUE(weight_dims);
- EXPECT_EQ(weight_dims->at(0), 8);
- EXPECT_EQ(weight_dims->at(1), 8);
-}
-
-// Test to see whether or not the presence of a dual-plane bit
-// is decoded properly. Error encodings are tested to *not* return
-// that they have dual planes.
-TEST(PhysicalASTCBlockTest, TestDualPlane) {
- PhysicalASTCBlock blk1(0x0000000001FE000173ULL);
- EXPECT_FALSE(blk1.IsDualPlane());
- EXPECT_FALSE(kErrorBlock.IsDualPlane());
-
- // If we flip the dual plane bit, we will have too many bits
- // for the weight grid and this should error
- PhysicalASTCBlock blk2(0x0000000001FE000573ULL);
- EXPECT_FALSE(blk2.IsDualPlane());
- EXPECT_FALSE(blk2.WeightGridDims());
- EXPECT_EQ(blk2.IsIllegalEncoding().value(),
- "Too many bits required for weight grid");
-
- // A dual plane with 3x5 weight grid should be supported
- PhysicalASTCBlock blk3(0x0000000001FE0005FFULL);
- EXPECT_TRUE(blk3.IsDualPlane());
-
- // If we use the wrong block mode, then a valid block
- // shouldn't have any dual plane
- PhysicalASTCBlock blk4(0x0000000001FE000108ULL);
- EXPECT_FALSE(blk4.IsDualPlane());
- EXPECT_FALSE(blk4.IsIllegalEncoding());
-}
-
-// Make sure that we properly calculate the number of bits used to encode
-// the weight grid. Given error encodings or void extent blocks, this number
-// should be zero
-TEST(PhysicalASTCBlockTest, TestNumWeightBits) {
- // 6x5 single-plane weight grid with 3-bit weights
- // should have 90 bits for the weights.
- PhysicalASTCBlock blk1(0x0000000001FE000173ULL);
- EXPECT_EQ(90, blk1.NumWeightBits());
-
- // Error block has no weight bits
- EXPECT_FALSE(kErrorBlock.NumWeightBits());
-
- // Void extent blocks have no weight bits
- EXPECT_FALSE(PhysicalASTCBlock(0xFFF8003FFE000DFCULL).NumWeightBits());
-
- // If we flip the dual plane bit, we will have too many bits
- // for the weight grid and this should error and return no bits
- PhysicalASTCBlock blk2(0x0000000001FE000573ULL);
- EXPECT_FALSE(blk2.NumWeightBits());
-
- // 3x5 dual-plane weight grid with 3-bit weights
- // should have 90 bits for the weights.
- PhysicalASTCBlock blk3(0x0000000001FE0005FFULL);
- EXPECT_EQ(90, blk3.NumWeightBits());
-}
-
-// Test to make sure that our weight bits start where we expect them to.
-// In other words, make sure that the calculation based on the block mode for
-// where the weight bits start is accurate.
-TEST(PhysicalASTCBlockTest, TestStartWeightBit) {
- EXPECT_EQ(PhysicalASTCBlock(0x4000000000800D44ULL).WeightStartBit(), 64);
-
- // Error blocks have no weight start bit
- EXPECT_FALSE(kErrorBlock.WeightStartBit());
-
- // Void extent blocks have no weight start bit
- EXPECT_FALSE(PhysicalASTCBlock(0xFFF8003FFE000DFCULL).WeightStartBit());
-}
-
-// Test to make sure that we catch various different reasons for error encoding
-// of ASTC blocks, but also that certain encodings aren't errors.
-TEST(PhysicalASTCBlockTest, TestErrorBlocks) {
- // Various valid block modes
- EXPECT_FALSE(PhysicalASTCBlock(0x0000000001FE000173ULL).IsIllegalEncoding());
- EXPECT_FALSE(PhysicalASTCBlock(0x0000000001FE0005FFULL).IsIllegalEncoding());
- EXPECT_FALSE(PhysicalASTCBlock(0x0000000001FE000108ULL).IsIllegalEncoding());
-
- // This is an error because it uses an invalid block mode
- EXPECT_EQ(kErrorBlock.IsIllegalEncoding().value(), "Reserved block mode");
-
- // This is an error because we have too many weight bits
- PhysicalASTCBlock err_blk(0x0000000001FE000573ULL);
- EXPECT_EQ(err_blk.IsIllegalEncoding().value(),
- "Too many bits required for weight grid");
-
- // This is an error because we have too many weights
- PhysicalASTCBlock err_blk2 = PhysicalASTCBlock(0x0000000001FE0005A8ULL);
- EXPECT_EQ(err_blk2.IsIllegalEncoding().value(), "Too many weights specified");
-
- PhysicalASTCBlock err_blk3 = PhysicalASTCBlock(0x0000000001FE000588ULL);
- EXPECT_EQ(err_blk3.IsIllegalEncoding().value(), "Too many weights specified");
-
- // This is an error because we have too few weights
- PhysicalASTCBlock err_blk4 = PhysicalASTCBlock(0x0000000001FE00002ULL);
- EXPECT_EQ(err_blk4.IsIllegalEncoding().value(),
- "Too few bits required for weight grid");
-
- // Four partitions, dual plane -- should be error
- // 2x2 weight grid, 3 bits per weight
- PhysicalASTCBlock dual_plane_four_parts(0x000000000000001D1FULL);
- EXPECT_FALSE(dual_plane_four_parts.NumPartitions());
- EXPECT_EQ(dual_plane_four_parts.IsIllegalEncoding().value(),
- "Both four partitions and dual plane specified");
-}
-
-// Test to make sure that we properly identify and can manipulate void-extent
-// blocks. These are ASTC blocks that only define a single color for the entire
-// block.
-TEST(PhysicalASTCBlockTest, TestVoidExtentBlocks) {
- // Various valid block modes that aren't void extent blocks
- EXPECT_FALSE(PhysicalASTCBlock(0x0000000001FE000173ULL).IsVoidExtent());
- EXPECT_FALSE(PhysicalASTCBlock(0x0000000001FE0005FFULL).IsVoidExtent());
- EXPECT_FALSE(PhysicalASTCBlock(0x0000000001FE000108ULL).IsVoidExtent());
-
- // Error block is not a void extent block
- EXPECT_FALSE(kErrorBlock.IsVoidExtent());
-
- // Void extent block is void extent block...
- UInt128 void_extent_encoding(0, 0xFFF8003FFE000DFCULL);
- EXPECT_FALSE(PhysicalASTCBlock(void_extent_encoding).IsIllegalEncoding());
- EXPECT_TRUE(PhysicalASTCBlock(void_extent_encoding).IsVoidExtent());
-
- // If we modify the high 64 bits it shouldn't change anything
- void_extent_encoding |= UInt128(0xdeadbeefdeadbeef, 0);
- EXPECT_FALSE(PhysicalASTCBlock(void_extent_encoding).IsIllegalEncoding());
- EXPECT_TRUE(PhysicalASTCBlock(void_extent_encoding).IsVoidExtent());
-}
-
-TEST(PhysicalASTCBlockTest, TestVoidExtentCoordinates) {
- // The void extent block should have texture coordinates from 0-8191
- auto coords = PhysicalASTCBlock(0xFFF8003FFE000DFCULL).VoidExtentCoords();
- EXPECT_EQ(coords->at(0), 0);
- EXPECT_EQ(coords->at(1), 8191);
- EXPECT_EQ(coords->at(2), 0);
- EXPECT_EQ(coords->at(3), 8191);
-
- // If we set the coords to all 1's then it's still a void extent
- // block, but there aren't any void extent coords.
- EXPECT_FALSE(PhysicalASTCBlock(0xFFFFFFFFFFFFFDFCULL).IsIllegalEncoding());
- EXPECT_TRUE(PhysicalASTCBlock(0xFFFFFFFFFFFFFDFCULL).IsVoidExtent());
- EXPECT_FALSE(PhysicalASTCBlock(0xFFFFFFFFFFFFFDFCULL).VoidExtentCoords());
-
- // If we set the void extent coords to something where the coords are
- // >= each other, then the encoding is illegal.
- EXPECT_TRUE(PhysicalASTCBlock(0x0008004002001DFCULL).IsIllegalEncoding());
- EXPECT_TRUE(PhysicalASTCBlock(0x0007FFC001FFFDFCULL).IsIllegalEncoding());
-}
-
-// Test to see if we can properly identify the number of partitions in a block
-// In particular -- we need to make sure we properly identify single and
-// multi-partition blocks, but also that void extent and error blocks don't
-// return valid numbers of partitions
-TEST(PhysicalASTCBlockTest, TestNumPartitions) {
- // Various valid block modes, but all single partition
- EXPECT_EQ(PhysicalASTCBlock(0x0000000001FE000173ULL).NumPartitions(), 1);
- EXPECT_EQ(PhysicalASTCBlock(0x0000000001FE0005FFULL).NumPartitions(), 1);
- EXPECT_EQ(PhysicalASTCBlock(0x0000000001FE000108ULL).NumPartitions(), 1);
-
- // Two to four partitions don't have enough bits for color.
- EXPECT_FALSE(PhysicalASTCBlock(0x000000000000000973ULL).NumPartitions());
- EXPECT_FALSE(PhysicalASTCBlock(0x000000000000001173ULL).NumPartitions());
- EXPECT_FALSE(PhysicalASTCBlock(0x000000000000001973ULL).NumPartitions());
-
- // Test against having more than one partition
- PhysicalASTCBlock non_shared_cem(0x4000000000800D44ULL);
- EXPECT_EQ(non_shared_cem.NumPartitions(), 2);
-}
-
-// Test the color endpoint modes specified for how the endpoints are encoded.
-// In particular, test that shared color endpoint modes work for multi-partition
-// blocks and that non-shared color endpoint modes also work.
-TEST(PhysicalASTCBlockTest, TestColorEndpointModes) {
- // Four partitions -- one shared CEM
- const auto blk1 = PhysicalASTCBlock(0x000000000000001961ULL);
- for (int i = 0; i < 4; ++i) {
- EXPECT_EQ(blk1.GetEndpointMode(i), ColorEndpointMode::kLDRLumaDirect);
- }
-
- // Void extent blocks have no endpoint modes
- EXPECT_FALSE(PhysicalASTCBlock(0xFFF8003FFE000DFCULL).GetEndpointMode(0));
-
- // Test out of range partitions
- EXPECT_FALSE(PhysicalASTCBlock(0x0000000001FE000173ULL).GetEndpointMode(1));
- EXPECT_FALSE(PhysicalASTCBlock(0x0000000001FE000173ULL).GetEndpointMode(-1));
- EXPECT_FALSE(PhysicalASTCBlock(0x0000000001FE000173ULL).GetEndpointMode(100));
-
- // Error blocks have no endpoint modes
- EXPECT_FALSE(kErrorBlock.GetEndpointMode(0));
-
- // Test non-shared CEMs
- PhysicalASTCBlock non_shared_cem(0x4000000000800D44ULL);
- EXPECT_EQ(non_shared_cem.GetEndpointMode(0),
- ColorEndpointMode::kLDRLumaDirect);
- EXPECT_EQ(non_shared_cem.GetEndpointMode(1),
- ColorEndpointMode::kLDRLumaBaseOffset);
-}
-
-// Make sure that if we have more than one partition then we have proper
-// partition IDs (these determine which pixels correspond to which partition)
-TEST(PhysicalASTCBlockTest, TestPartitionID) {
- // Valid partitions
- EXPECT_EQ(PhysicalASTCBlock(0x4000000000FFED44ULL).PartitionID(), 0x3FF);
- EXPECT_EQ(PhysicalASTCBlock(0x4000000000AAAD44ULL).PartitionID(), 0x155);
-
- // Error blocks have no partition IDs
- EXPECT_FALSE(kErrorBlock.PartitionID());
-
- // Void extent blocks have no endpoint modes
- EXPECT_FALSE(PhysicalASTCBlock(0xFFF8003FFE000DFCULL).PartitionID());
-}
-
-// Make sure that we're properly attributing the number of bits associated with
-// the encoded color values.
-TEST(PhysicalASTCBlockTest, TestNumColorBits) {
- // If we're using a direct luma channel, then the number of color bits is 16
- EXPECT_EQ(PhysicalASTCBlock(0x0000000001FE000173ULL).NumColorValues(), 2);
- EXPECT_EQ(PhysicalASTCBlock(0x0000000001FE000173ULL).NumColorBits(), 16);
-
- // Error blocks have nothing
- EXPECT_FALSE(kErrorBlock.NumColorValues());
- EXPECT_FALSE(kErrorBlock.NumColorBits());
-
- // Void extent blocks have four color values and 64 bits of color
- EXPECT_EQ(PhysicalASTCBlock(0xFFF8003FFE000DFCULL).NumColorValues(), 4);
- EXPECT_EQ(PhysicalASTCBlock(0xFFF8003FFE000DFCULL).NumColorBits(), 64);
-}
-
-// Make sure that we're properly decoding the range of values that each of the
-// encoded color values can take
-TEST(PhysicalASTCBlockTest, TestColorValuesRange) {
- // If we're using a direct luma channel, then we use two color values up to
- // a full byte each.
- EXPECT_EQ(PhysicalASTCBlock(0x0000000001FE000173ULL).ColorValuesRange(), 255);
-
- // Error blocks have nothing
- EXPECT_FALSE(kErrorBlock.ColorValuesRange());
-
- // Void extent blocks have four color values and 64 bits of color, so the
- // color range for each is sixteen bits.
- EXPECT_EQ(PhysicalASTCBlock(0xFFF8003FFE000DFCULL).ColorValuesRange(),
- (1 << 16) - 1);
-}
-
-// Test that we know where the color data starts. This is different mostly
-// depending on whether or not the block is single-partition or void extent.
-TEST(PhysicalASTCBlockTest, TestColorStartBits) {
- // Void extent blocks start at bit 64
- EXPECT_EQ(PhysicalASTCBlock(0xFFF8003FFE000DFCULL).ColorStartBit(), 64);
-
- // Error blocks don't start anywhere
- EXPECT_FALSE(kErrorBlock.ColorStartBit());
-
- // Single partition blocks start at bit 17
- EXPECT_EQ(PhysicalASTCBlock(0x0000000001FE000173ULL).ColorStartBit(), 17);
- EXPECT_EQ(PhysicalASTCBlock(0x0000000001FE0005FFULL).ColorStartBit(), 17);
- EXPECT_EQ(PhysicalASTCBlock(0x0000000001FE000108ULL).ColorStartBit(), 17);
-
- // Multi-partition blocks start at bit 29
- EXPECT_EQ(PhysicalASTCBlock(0x4000000000FFED44ULL).ColorStartBit(), 29);
- EXPECT_EQ(PhysicalASTCBlock(0x4000000000AAAD44ULL).ColorStartBit(), 29);
-}
-
-} // namespace
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/quantization_test.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/quantization_test.cc
deleted file mode 100644
index f882876e7cc..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/quantization_test.cc
+++ /dev/null
@@ -1,288 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/quantization.h"
-#include "src/decoder/integer_sequence_codec.h"
-
-#include <gtest/gtest.h>
-
-#include <functional>
-#include <string>
-#include <vector>
-
-namespace astc_codec {
-
-namespace {
-
-// Make sure that we never exceed the maximum range that we pass in.
-TEST(QuantizationTest, TestQuantizeMaxRange) {
- for (int i = kEndpointRangeMinValue; i < 256; ++i) {
- EXPECT_LE(QuantizeCEValueToRange(255, i), i);
- }
-
- for (int i = 1; i < kWeightRangeMaxValue; ++i) {
- EXPECT_LE(QuantizeWeightToRange(64, i), i);
- }
-}
-
-// Make sure that whenever we unquantize and requantize a value we get back
-// what we started with.
-TEST(QuantizationTest, TestReversibility) {
- for (auto itr = ISERangeBegin(); itr != ISERangeEnd(); itr++) {
- const int range = *itr;
- if (range <= kWeightRangeMaxValue) {
- for (int j = 0; j <= range; ++j) {
- const int q = UnquantizeWeightFromRange(j, range);
- EXPECT_EQ(QuantizeWeightToRange(q, range), j);
- }
- }
-
- if (range >= kEndpointRangeMinValue) {
- for (int j = 0; j <= range; ++j) {
- const int q = UnquantizeCEValueFromRange(j, range);
- EXPECT_EQ(QuantizeCEValueToRange(q, range), j);
- }
- }
- }
-}
-
-// Make sure that whenever we quantize a non-maximal value it gets sent to the
-// proper range
-TEST(QuantizationTest, TestQuantizationRange) {
- for (auto itr = ISERangeBegin(); itr != ISERangeEnd(); itr++) {
- const int range = *itr;
- if (range >= kEndpointRangeMinValue) {
- EXPECT_LE(QuantizeCEValueToRange(0, range), range);
- EXPECT_LE(QuantizeCEValueToRange(4, range), range);
- EXPECT_LE(QuantizeCEValueToRange(15, range), range);
- EXPECT_LE(QuantizeCEValueToRange(22, range), range);
- EXPECT_LE(QuantizeCEValueToRange(66, range), range);
- EXPECT_LE(QuantizeCEValueToRange(91, range), range);
- EXPECT_LE(QuantizeCEValueToRange(126, range), range);
- }
-
- if (range <= kWeightRangeMaxValue) {
- EXPECT_LE(QuantizeWeightToRange(0, range), range);
- EXPECT_LE(QuantizeWeightToRange(4, range), range);
- EXPECT_LE(QuantizeWeightToRange(15, range), range);
- EXPECT_LE(QuantizeWeightToRange(22, range), range);
- }
- }
-}
-
-// Make sure that whenever we unquantize a value it remains within [0, 255]
-TEST(QuantizationTest, TestUnquantizationRange) {
- EXPECT_LT(UnquantizeCEValueFromRange(2, 7), 256);
- EXPECT_LT(UnquantizeCEValueFromRange(7, 7), 256);
- EXPECT_LT(UnquantizeCEValueFromRange(39, 63), 256);
- EXPECT_LT(UnquantizeCEValueFromRange(66, 79), 256);
- EXPECT_LT(UnquantizeCEValueFromRange(91, 191), 256);
- EXPECT_LT(UnquantizeCEValueFromRange(126, 255), 256);
- EXPECT_LT(UnquantizeCEValueFromRange(255, 255), 256);
-
- EXPECT_LE(UnquantizeWeightFromRange(0, 1), 64);
- EXPECT_LE(UnquantizeWeightFromRange(2, 7), 64);
- EXPECT_LE(UnquantizeWeightFromRange(7, 7), 64);
- EXPECT_LE(UnquantizeWeightFromRange(29, 31), 64);
-}
-
-// When we quantize a value, it should use the largest quantization range that
-// does not exceed the desired range.
-TEST(QuantizationTest, TestUpperBoundRanges) {
- auto expected_range_itr = ISERangeBegin();
- for (int desired_range = 1; desired_range < 256; ++desired_range) {
- if (desired_range == *(expected_range_itr + 1)) {
- ++expected_range_itr;
- }
- const int expected_range = *expected_range_itr;
- ASSERT_LE(expected_range, desired_range);
-
- if (desired_range >= kEndpointRangeMinValue) {
- EXPECT_EQ(QuantizeCEValueToRange(0, desired_range),
- QuantizeCEValueToRange(0, expected_range));
-
- EXPECT_EQ(QuantizeCEValueToRange(208, desired_range),
- QuantizeCEValueToRange(208, expected_range));
-
- EXPECT_EQ(QuantizeCEValueToRange(173, desired_range),
- QuantizeCEValueToRange(173, expected_range));
-
- EXPECT_EQ(QuantizeCEValueToRange(13, desired_range),
- QuantizeCEValueToRange(13, expected_range));
-
- EXPECT_EQ(QuantizeCEValueToRange(255, desired_range),
- QuantizeCEValueToRange(255, expected_range));
- }
-
- if (desired_range <= kWeightRangeMaxValue) {
- EXPECT_EQ(QuantizeWeightToRange(0, desired_range),
- QuantizeWeightToRange(0, expected_range));
-
- EXPECT_EQ(QuantizeWeightToRange(63, desired_range),
- QuantizeWeightToRange(63, expected_range));
-
- EXPECT_EQ(QuantizeWeightToRange(12, desired_range),
- QuantizeWeightToRange(12, expected_range));
-
- EXPECT_EQ(QuantizeWeightToRange(23, desired_range),
- QuantizeWeightToRange(23, expected_range));
- }
- }
-
- // Make sure that we covered all the possible ranges
- ASSERT_EQ(std::next(expected_range_itr), ISERangeEnd());
-}
-
-// Make sure that quantizing to the largest range is the identity function.
-TEST(QuantizationTest, TestIdentity) {
- for (int i = 0; i < 256; ++i) {
- EXPECT_EQ(QuantizeCEValueToRange(i, 255), i);
- }
-
- // Note: This doesn't apply to weights since there's a weird hack to convert
- // values from [0, 31] to [0, 64].
-}
-
-// Make sure that bit quantization is monotonic with respect to the input,
-// since quantizing and dequantizing bits is a matter of truncation and bit
-// replication
-TEST(QuantizationTest, TestMonotonicBitPacking) {
- for (int num_bits = 3; num_bits < 8; ++num_bits) {
- const int range = (1 << num_bits) - 1;
- int last_quant_val = -1;
- for (int i = 0; i < 256; ++i) {
- const int quant_val = QuantizeCEValueToRange(i, range);
- EXPECT_LE(last_quant_val, quant_val);
- last_quant_val = quant_val;
- }
-
- // Also expect the last quantization val to be equal to the range
- EXPECT_EQ(last_quant_val, range);
-
- if (range <= kWeightRangeMaxValue) {
- last_quant_val = -1;
- for (int i = 0; i <= 64; ++i) {
- const int quant_val = QuantizeWeightToRange(i, range);
- EXPECT_LE(last_quant_val, quant_val);
- last_quant_val = quant_val;
- }
- EXPECT_EQ(last_quant_val, range);
- }
- }
-}
-
-// Make sure that bit quantization reflects that quantized values below the bit
-// replication threshold get mapped to zero
-TEST(QuantizationTest, TestSmallBitPacking) {
- for (int num_bits = 1; num_bits <= 8; ++num_bits) {
- const int range = (1 << num_bits) - 1;
-
- // The largest number that should map to zero is one less than half of the
- // smallest representation w.r.t. range. For example: if we have a range
- // of 7, it means that we have 3 total bits abc for quantized values. If we
- // unquantize to 8 bits, it means that our resulting value will be abcabcab.
- // Hence, we map 000 to 0 and 001 to 0b00100100 = 36. The earliest value
- // that should not map to zero with three bits is therefore 0b00001111 = 15.
- // This ends up being (1 << (8 - 3 - 1)) - 1. We don't use 0b00011111 = 31
- // because this would "round up" to 1 during quantization. This value is not
- // necessarily the largest, but it is the largest that we can *guarantee*
- // should map to zero.
-
- if (range >= kEndpointRangeMinValue) {
- constexpr int cev_bits = 8;
- const int half_max_quant_bits = std::max(0, cev_bits - num_bits - 1);
- const int largest_cev_to_zero = (1 << half_max_quant_bits) - 1;
- EXPECT_EQ(QuantizeCEValueToRange(largest_cev_to_zero, range), 0)
- << " Largest CEV to zero: " << largest_cev_to_zero
- << " Range: " << range;
- }
-
- if (range <= kWeightRangeMaxValue) {
- constexpr int weight_bits = 6;
- const int half_max_quant_bits = std::max(0, weight_bits - num_bits - 1);
- const int largest_weight_to_zero = (1 << half_max_quant_bits) - 1;
- EXPECT_EQ(QuantizeWeightToRange(largest_weight_to_zero, range), 0)
- << " Largest weight to zero: " << largest_weight_to_zero
- << " Range: " << range;
- }
- }
-}
-
-// Test specific quint and trit weight encodings with values that were obtained
-// using the reference ASTC codec.
-TEST(QuantizationTest, TestSpecificQuintTritPackings) {
- std::vector<int> vals = { 4, 6, 4, 6, 7, 5, 7, 5 };
- std::vector<int> quantized;
-
- // Test a quint packing
- std::transform(
- vals.begin(), vals.end(), std::back_inserter(quantized),
- std::bind(UnquantizeWeightFromRange, std::placeholders::_1, 9));
- const std::vector<int> quintExpected = {14, 21, 14, 21, 43, 50, 43, 50 };
- EXPECT_EQ(quantized, quintExpected);
-
- // Test a trit packing
- std::transform(
- vals.begin(), vals.end(), quantized.begin(),
- std::bind(UnquantizeWeightFromRange, std::placeholders::_1, 11));
- const std::vector<int> tritExpected = { 5, 23, 5, 23, 41, 59, 41, 59 };
- EXPECT_EQ(quantized, tritExpected);
-}
-
-// Make sure that we properly die when we pass in values below the minimum
-// allowed ranges for our quantization intervals.
-TEST(QuantizationDeathTest, TestInvalidMinRange) {
- for (int i = 0; i < kEndpointRangeMinValue; ++i) {
- EXPECT_DEBUG_DEATH(QuantizeCEValueToRange(0, i), "");
- EXPECT_DEBUG_DEATH(UnquantizeCEValueFromRange(0, i), "");
- }
-
- EXPECT_DEBUG_DEATH(QuantizeWeightToRange(0, 0), "");
- EXPECT_DEBUG_DEATH(UnquantizeWeightFromRange(0, 0), "");
-}
-
-// Make sure that we properly die when we pass in bogus values.
-TEST(QuantizationDeathTest, TestOutOfRange) {
- EXPECT_DEBUG_DEATH(QuantizeCEValueToRange(-1, 10), "");
- EXPECT_DEBUG_DEATH(QuantizeCEValueToRange(256, 7), "");
- EXPECT_DEBUG_DEATH(QuantizeCEValueToRange(10000, 17), "");
-
- EXPECT_DEBUG_DEATH(UnquantizeCEValueFromRange(-1, 10), "");
- EXPECT_DEBUG_DEATH(UnquantizeCEValueFromRange(8, 7), "");
- EXPECT_DEBUG_DEATH(UnquantizeCEValueFromRange(-1000, 17), "");
-
- EXPECT_DEBUG_DEATH(QuantizeCEValueToRange(0, -7), "");
- EXPECT_DEBUG_DEATH(UnquantizeCEValueFromRange(0, -17), "");
-
- EXPECT_DEBUG_DEATH(QuantizeCEValueToRange(0, 257), "");
- EXPECT_DEBUG_DEATH(UnquantizeCEValueFromRange(0, 256), "");
-
- EXPECT_DEBUG_DEATH(QuantizeWeightToRange(-1, 10), "");
- EXPECT_DEBUG_DEATH(QuantizeWeightToRange(256, 7), "");
- EXPECT_DEBUG_DEATH(QuantizeWeightToRange(10000, 17), "");
-
- EXPECT_DEBUG_DEATH(UnquantizeWeightFromRange(-1, 10), "");
- EXPECT_DEBUG_DEATH(UnquantizeWeightFromRange(8, 7), "");
- EXPECT_DEBUG_DEATH(UnquantizeWeightFromRange(-1000, 17), "");
-
- EXPECT_DEBUG_DEATH(QuantizeWeightToRange(0, -7), "");
- EXPECT_DEBUG_DEATH(UnquantizeWeightFromRange(0, -17), "");
-
- EXPECT_DEBUG_DEATH(QuantizeWeightToRange(0, 32), "");
- EXPECT_DEBUG_DEATH(UnquantizeWeightFromRange(0, 64), "");
-}
-
-} // namespace
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/weight_infill_test.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/weight_infill_test.cc
deleted file mode 100644
index 79c77455441..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/test/weight_infill_test.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/weight_infill.h"
-#include "src/decoder/footprint.h"
-
-#include <gtest/gtest.h>
-
-#include <vector>
-
-namespace astc_codec {
-
-namespace {
-
-// Make sure that the physical size of the bit representations for certain
-// dimensions of weight grids matches our expectations
-TEST(ASTCWeightInfillTest, TestGetBitCount) {
- // Bit encodings
- EXPECT_EQ(32, CountBitsForWeights(4, 4, 3));
- EXPECT_EQ(48, CountBitsForWeights(4, 4, 7));
- EXPECT_EQ(24, CountBitsForWeights(2, 4, 7));
- EXPECT_EQ(8, CountBitsForWeights(2, 4, 1));
-
- // Trit encodings
- EXPECT_EQ(32, CountBitsForWeights(4, 5, 2));
- EXPECT_EQ(26, CountBitsForWeights(4, 4, 2));
- EXPECT_EQ(52, CountBitsForWeights(4, 5, 5));
- EXPECT_EQ(42, CountBitsForWeights(4, 4, 5));
-
- // Quint encodings
- EXPECT_EQ(21, CountBitsForWeights(3, 3, 4));
- EXPECT_EQ(38, CountBitsForWeights(4, 4, 4));
- EXPECT_EQ(49, CountBitsForWeights(3, 7, 4));
- EXPECT_EQ(52, CountBitsForWeights(4, 3, 19));
- EXPECT_EQ(70, CountBitsForWeights(4, 4, 19));
-}
-
-// Make sure that we bilerp our weights properly
-TEST(ASTCWeightInfillTest, TestInfillBilerp) {
- std::vector<int> weights = InfillWeights(
- {{ 1, 3, 5, 3, 5, 7, 5, 7, 9 }}, Footprint::Get5x5(), 3, 3);
-
- std::vector<int> expected_weights = {
- 1, 2, 3, 4, 5,
- 2, 3, 4, 5, 6,
- 3, 4, 5, 6, 7,
- 4, 5, 6, 7, 8,
- 5, 6, 7, 8, 9 };
-
- ASSERT_EQ(weights.size(), expected_weights.size());
- for (int i = 0; i < weights.size(); ++i) {
- EXPECT_EQ(weights[i], expected_weights[i]);
- }
-}
-
-} // namespace
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_4x4.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_4x4.astc
deleted file mode 100644
index 0dd080b12d2..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_4x4.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_4x4.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_4x4.bmp
deleted file mode 100644
index 32412b3e535..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_4x4.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_5x5.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_5x5.astc
deleted file mode 100644
index 2831c90ed51..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_5x5.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_5x5.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_5x5.bmp
deleted file mode 100644
index 95b0186a9d8..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_5x5.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_6x6.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_6x6.astc
deleted file mode 100644
index b2cc9c2d52d..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_6x6.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_6x6.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_6x6.bmp
deleted file mode 100644
index 796812e2f05..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_6x6.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_8x8.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_8x8.astc
deleted file mode 100644
index a8805f28517..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_8x8.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_8x8.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_8x8.bmp
deleted file mode 100644
index 8f92698c01f..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/atlas_small_8x8.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkerboard.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkerboard.astc
deleted file mode 100644
index 79acdca3732..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkerboard.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_10.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_10.astc
deleted file mode 100644
index e3b196578c3..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_10.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_11.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_11.astc
deleted file mode 100644
index c80c6a46018..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_11.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_12.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_12.astc
deleted file mode 100644
index a82583a9ed5..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_12.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_4.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_4.astc
deleted file mode 100644
index ac60716458f..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_4.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_5.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_5.astc
deleted file mode 100644
index 0389c53d54b..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_5.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_6.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_6.astc
deleted file mode 100644
index 210dd340e12..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_6.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_7.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_7.astc
deleted file mode 100644
index 8ea10f84f47..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_7.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_8.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_8.astc
deleted file mode 100644
index 3708882dd52..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_8.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_9.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_9.astc
deleted file mode 100644
index b5c962a14fe..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/checkered_9.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x10.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x10.astc
deleted file mode 100644
index 6799cd08644..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x10.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x10.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x10.bmp
deleted file mode 100644
index 7ded6adf872..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x10.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x5.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x5.astc
deleted file mode 100644
index cbfe4f26448..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x5.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x5.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x5.bmp
deleted file mode 100644
index 68202f8516f..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x5.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x6.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x6.astc
deleted file mode 100644
index 53e37b4a982..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x6.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x6.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x6.bmp
deleted file mode 100644
index 3dffe72e97e..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x6.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x8.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x8.astc
deleted file mode 100644
index b9613e58174..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x8.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x8.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x8.bmp
deleted file mode 100644
index b7d75f7377e..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_10x8.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x10.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x10.astc
deleted file mode 100644
index 54f59193542..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x10.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x10.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x10.bmp
deleted file mode 100644
index 2007a3dc393..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x10.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x12.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x12.astc
deleted file mode 100644
index d94d0a6c053..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x12.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x12.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x12.bmp
deleted file mode 100644
index 57e24a22969..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_12x12.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_4x4.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_4x4.astc
deleted file mode 100644
index fdf3cd6b5f7..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_4x4.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_4x4.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_4x4.bmp
deleted file mode 100644
index fcb4e0775eb..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_4x4.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x4.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x4.astc
deleted file mode 100644
index 0683059469e..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x4.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x4.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x4.bmp
deleted file mode 100644
index 9cae5f9379b..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x4.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x5.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x5.astc
deleted file mode 100644
index 03c3395ab95..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x5.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x5.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x5.bmp
deleted file mode 100644
index c5ddeec4f38..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_5x5.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x5.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x5.astc
deleted file mode 100644
index d0d455d0bfb..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x5.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x5.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x5.bmp
deleted file mode 100644
index 94a005dcee5..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x5.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x6.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x6.astc
deleted file mode 100644
index 47e038efd95..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x6.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x6.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x6.bmp
deleted file mode 100644
index fb1f41c424f..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_6x6.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x5.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x5.astc
deleted file mode 100644
index 4ef49d657dd..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x5.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x5.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x5.bmp
deleted file mode 100644
index 6d4f6093f3d..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x5.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x6.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x6.astc
deleted file mode 100644
index 113550954cc..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x6.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x6.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x6.bmp
deleted file mode 100644
index 35e71219452..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x6.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x8.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x8.astc
deleted file mode 100644
index bdeb9c9b79e..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x8.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x8.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x8.bmp
deleted file mode 100644
index 3b3a1c89641..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/footprint_8x8.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_12x12.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_12x12.astc
deleted file mode 100644
index cc0fc3d3c01..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_12x12.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_12x12.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_12x12.bmp
deleted file mode 100644
index 50538ded11e..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_12x12.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_4x4.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_4x4.astc
deleted file mode 100644
index 84527d3ab76..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_4x4.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_4x4.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_4x4.bmp
deleted file mode 100644
index fae4f9191dc..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_4x4.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_5x4.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_5x4.astc
deleted file mode 100644
index 377938de67e..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_5x4.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_5x4.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_5x4.bmp
deleted file mode 100644
index a0c1fdbb89d..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_5x4.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_6x6.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_6x6.astc
deleted file mode 100644
index 8a70c0fda6f..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_6x6.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_6x6.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_6x6.bmp
deleted file mode 100644
index e1a5dcd8c27..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_6x6.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_8x8.astc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_8x8.astc
deleted file mode 100644
index 1bca381d578..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_8x8.astc
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_8x8.bmp b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_8x8.bmp
deleted file mode 100644
index 12b6eb24be7..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/testdata/rgb_8x8.bmp
+++ /dev/null
Binary files differ
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/tools/astc_inspector_cli.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/tools/astc_inspector_cli.cc
deleted file mode 100644
index 105f57498af..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/tools/astc_inspector_cli.cc
+++ /dev/null
@@ -1,785 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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.
-
-// astc_inspector_cli collects the various statistics of a stream of ASTC data
-// stored in an ASTC file.
-//
-// Example usage:
-// To dump statistics about an ASTC file, use:
-// astc_inspector_cli <filename>
-//
-// To dump statistics on a specific block in an ASTC file, use:
-// astc_inspector_cli <filename> <number>
-
-#include <algorithm>
-#include <array>
-#include <fstream>
-#include <functional>
-#include <iomanip>
-#include <iostream>
-#include <memory>
-#include <numeric>
-#include <sstream>
-#include <string>
-#include <unordered_map>
-#include <unordered_set>
-#include <vector>
-
-#include "src/base/string_utils.h"
-#include "src/decoder/astc_file.h"
-#include "src/decoder/endpoint_codec.h"
-#include "src/decoder/intermediate_astc_block.h"
-#include "src/decoder/partition.h"
-#include "src/decoder/quantization.h"
-#include "src/decoder/weight_infill.h"
-
-using astc_codec::ASTCFile;
-using astc_codec::ColorEndpointMode;
-using astc_codec::IntermediateBlockData;
-using astc_codec::PhysicalASTCBlock;
-using astc_codec::RgbaColor;
-using astc_codec::VoidExtentData;
-using astc_codec::base::Optional;
-
-namespace {
-
-constexpr int kNumEndpointModes =
- static_cast<int>(ColorEndpointMode::kNumColorEndpointModes);
-constexpr std::array<const char*, kNumEndpointModes> kModeStrings {{
- "kLDRLumaDirect", "kLDRLumaBaseOffset", "kHDRLumaLargeRange",
- "kHDRLumaSmallRange", "kLDRLumaAlphaDirect", "kLDRLumaAlphaBaseOffset",
- "kLDRRGBBaseScale", "kHDRRGBBaseScale", "kLDRRGBDirect",
- "kLDRRGBBaseOffset", "kLDRRGBBaseScaleTwoA", "kHDRRGBDirect",
- "kLDRRGBADirect", "kLDRRGBABaseOffset", "kHDRRGBDirectLDRAlpha",
- "kHDRRGBDirectHDRAlpha" }};
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// A generic stat that should be tracked via an instance of ASTCFileStats.
-class Stat {
- public:
- explicit Stat(const std::vector<IntermediateBlockData>* blocks, size_t total)
- : blocks_(blocks), total_(total) { }
- virtual ~Stat() { }
-
- virtual std::ostream& PrintToStream(std::ostream& out) const = 0;
-
- protected:
- // Utility function to iterate over all of the blocks that are not void-extent
- // blocks. FoldFn optionally allows a value to accumulate. It should be of the
- // type:
- // (const IntermediateBlockData&, T x) -> T
- template<typename T, typename FoldFn>
- T IterateBlocks(T initial, FoldFn f) const {
- T result = initial;
- for (const auto& block : *blocks_) {
- result = f(block, std::move(result));
- }
- return result;
- }
-
- size_t NumBlocks() const { return total_; }
-
- private:
- const std::vector<IntermediateBlockData>* const blocks_;
- const size_t total_;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-//
-// Computes the number of void extent blocks.
-class VoidExtentCount : public Stat {
- public:
- VoidExtentCount(const std::vector<IntermediateBlockData>* blocks,
- size_t total, std::string description)
- : Stat(blocks, total), description_(std::move(description)),
- count_(total - blocks->size()) { }
-
- std::ostream& PrintToStream(std::ostream& out) const override {
- return out << description_ << ": " << count_
- << " (" << (count_ * 100 / NumBlocks()) << "%)" << std::endl;
- };
-
- private:
- const std::string description_;
- const size_t count_;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Computes a per-block stat and reports it as an average over all blocks.
-class PerBlockAverage : public Stat {
- public:
- PerBlockAverage(const std::vector<IntermediateBlockData>* blocks,
- size_t total, std::string description,
- const std::function<int(const IntermediateBlockData&)> &fn)
- : Stat(blocks, total),
- description_(std::move(description)) {
- int sum = 0;
- size_t count = 0;
- for (const auto& block : *blocks) {
- sum += fn(block);
- ++count;
- }
- average_ = sum / count;
- }
-
- std::ostream& PrintToStream(std::ostream& out) const override {
- return out << description_ << ": " << average_ << std::endl;
- }
-
- private:
- size_t average_;
- std::string description_;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Computes a per-block true or false value and reports how many blocks return
-// true with a percentage of total blocks.
-class PerBlockPredicate : public Stat {
- public:
- PerBlockPredicate(const std::vector<IntermediateBlockData>* blocks,
- size_t total, std::string description,
- const std::function<bool(const IntermediateBlockData&)> &fn)
- : Stat(blocks, total),
- description_(std::move(description)),
- count_(std::count_if(blocks->begin(), blocks->end(), fn)) { }
-
- std::ostream& PrintToStream(std::ostream& out) const override {
- return out << description_ << ": " << count_
- << " (" << (count_ * 100 / NumBlocks()) << "%)" << std::endl;
- };
-
- private:
- const std::string description_;
- const size_t count_;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Returns a histogram of the number of occurrences of each endpoint mode in
-// the list of blocks. Note, due to multi-subset blocks, the sum of these
-// values will not match the total number of blocks.
-class ModeCountsStat : public Stat {
- public:
- explicit ModeCountsStat(const std::vector<IntermediateBlockData>* blocks,
- size_t total)
- : Stat(blocks, total),
- mode_counts_(IterateBlocks<ModeArray>(
- {}, [](const IntermediateBlockData& data, ModeArray&& m) {
- auto result = m;
- for (const auto& ep : data.endpoints) {
- result[static_cast<int>(ep.mode)]++;
- }
- return result;
- })) { }
-
- std::ostream& PrintToStream(std::ostream& out) const override {
- const size_t total_modes_used =
- std::accumulate(mode_counts_.begin(), mode_counts_.end(), 0);
-
- out << "Endpoint modes used: " << std::endl;
- for (size_t i = 0; i < kNumEndpointModes; ++i) {
- out << " ";
- out << std::setw(30) << std::left << std::setfill('.') << kModeStrings[i];
- out << std::setw(8) << std::right << std::setfill('.') << mode_counts_[i];
-
- std::stringstream pct;
- pct << " (" << (mode_counts_[i] * 100 / total_modes_used) << "%)";
-
- out << std::setw(6) << std::right << std::setfill(' ') << pct.str();
- out << std::endl;
- }
-
- return out;
- }
-
- private:
- using ModeArray = std::array<int, kNumEndpointModes>;
- const ModeArray mode_counts_;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Counts the number of unique endpoints used across all blocks.
-class UniqueEndpointsCount : public Stat {
- public:
- explicit UniqueEndpointsCount(
- const std::vector<IntermediateBlockData>* blocks, size_t total)
- : Stat(blocks, total),
- unique_endpoints_(IterateBlocks<UniqueEndpointSet>(
- UniqueEndpointSet(),
- [](const IntermediateBlockData& data, UniqueEndpointSet&& eps) {
- UniqueEndpointSet result(eps);
- for (const auto& ep : data.endpoints) {
- RgbaColor ep_one, ep_two;
- DecodeColorsForMode(ep.colors, data.endpoint_range.value(),
- ep.mode, &ep_one, &ep_two);
- result.insert(PackEndpoint(ep_one));
- result.insert(PackEndpoint(ep_two));
- }
- return result;
- })) { }
-
- std::ostream& PrintToStream(std::ostream& out) const override {
- out << "Num unique endpoints: " << unique_endpoints_.size() << std::endl;
- return out;
- }
-
- private:
- static uint32_t PackEndpoint(const RgbaColor& color) {
- uint32_t result = 0;
- for (const int& c : color) {
- constexpr int kSaturatedChannelValue = 0xFF;
- assert(c >= 0);
- assert(c <= kSaturatedChannelValue);
- result <<= 8;
- result |= c;
- }
- return result;
- }
-
- using UniqueEndpointSet = std::unordered_set<uint32_t>;
- const UniqueEndpointSet unique_endpoints_;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// Computes a histogram of the number of occurrences of 1-4 subset partitions.
-class PartitionCountStat : public Stat {
- public:
- explicit PartitionCountStat(const std::vector<IntermediateBlockData>* blocks,
- size_t total)
- : Stat(blocks, total)
- , part_counts_(IterateBlocks<PartCount>(
- {}, [](const IntermediateBlockData& data, PartCount&& m) {
- PartCount result = m;
- result[data.endpoints.size() - 1]++;
- return result;
- })) { }
-
- std::ostream& PrintToStream(std::ostream& out) const override {
- out << "Num partitions used: " << std::endl;
- for (size_t i = 0; i < part_counts_.size(); ++i) {
- out << " " << i + 1 << ": " << part_counts_[i] << std::endl;
- }
- return out;
- }
-
- private:
- using PartCount = std::array<int, 4>;
- const PartCount part_counts_;
-};
-
-//////////////////////////////////////////////////////////////////////////////
-//
-// For each block that uses dual-plane mode, computes and stores the dual-plane
-// channels in a vector. Outputs the number of each channel used across all
-// blocks
-class DualChannelStat : public Stat {
- private:
- static constexpr auto kNumDualPlaneChannels =
- std::tuple_size<astc_codec::Endpoint>::value;
- using CountsArray = std::array<int, kNumDualPlaneChannels>;
-
- public:
- explicit DualChannelStat(const std::vector<IntermediateBlockData>* blocks,
- size_t total)
- : Stat(blocks, total),
- dual_channels_(IterateBlocks(
- std::vector<int>(),
- [](const IntermediateBlockData& data, std::vector<int>&& input) {
- auto result = input;
- if (data.dual_plane_channel) {
- result.push_back(data.dual_plane_channel.value());
- }
- return result;
- })) { }
-
- std::ostream& PrintToStream(std::ostream& out) const override {
- // Similar to the number of partitions, the number of dual plane blocks
- // can be determined by parsing the next four fields and summing them.
- const int num_dual_plane_blocks = dual_channels_.size();
- out << "Number of dual-plane blocks: " << num_dual_plane_blocks
- << " (" << (num_dual_plane_blocks * 100) / NumBlocks() << "%)"
- << std::endl;
-
- CountsArray counts = GetCounts();
- assert(counts.size() == kNumDualPlaneChannels);
-
- for (size_t i = 0; i < counts.size(); ++i) {
- out << " " << i << ": " << counts[i] << std::endl;
- }
- return out;
- }
-
- private:
- CountsArray GetCounts() const {
- CountsArray counts;
- for (size_t i = 0; i < kNumDualPlaneChannels; ++i) {
- counts[i] =
- std::count_if(dual_channels_.begin(), dual_channels_.end(),
- [i](int channel) { return i == channel; });
- }
- return counts;
- }
-
- const std::vector<int> dual_channels_;
-};
-
-
-// Stores the intermediate block representations of the blocks associated with
-// an ASTCFile. Also provides various facilities for extracting aggregate data
-// from these blocks.
-class ASTCFileStats {
- public:
- explicit ASTCFileStats(const std::unique_ptr<ASTCFile>& astc_file) {
- const size_t total = astc_file->NumBlocks();
-
- for (size_t block_idx = 0; block_idx < astc_file->NumBlocks(); ++block_idx) {
- const PhysicalASTCBlock pb = astc_file->GetBlock(block_idx);
- assert(!pb.IsIllegalEncoding());
- if (pb.IsIllegalEncoding()) {
- std::cerr << "WARNING: Block " << block_idx << " has illegal encoding." << std::endl;
- continue;
- }
-
- if (!pb.IsVoidExtent()) {
- Optional<IntermediateBlockData> block = UnpackIntermediateBlock(pb);
- if (!block) {
- std::cerr << "WARNING: Block " << block_idx << " failed to unpack." << std::endl;
- continue;
- }
-
- blocks_.push_back(block.value());
- }
- }
-
- stats_.emplace_back(new UniqueEndpointsCount(&blocks_, total));
- stats_.emplace_back(new VoidExtentCount(
- &blocks_, total, "Num void extent blocks"));
-
- stats_.emplace_back(new PerBlockAverage(
- &blocks_, total, "Average weight range",
- [](const IntermediateBlockData& b) { return b.weight_range; }));
-
- stats_.emplace_back(new PerBlockAverage(
- &blocks_, total, "Average number of weights",
- [](const IntermediateBlockData& b) { return b.weights.size(); }));
-
- stats_.emplace_back(new PerBlockPredicate(
- &blocks_, total, "Num blocks that use blue contract mode",
- [](const IntermediateBlockData& block) {
- for (const auto& ep : block.endpoints) {
- if (UsesBlueContract(
- block.endpoint_range.valueOr(255), ep.mode, ep.colors)) {
- return true;
- }
- }
-
- return false;
- }));
-
- stats_.emplace_back(new ModeCountsStat(&blocks_, total));
-
- stats_.emplace_back(new PerBlockPredicate(
- &blocks_, total, "Num multi-part blocks",
- [](const IntermediateBlockData& block) {
- return block.endpoints.size() > 1;
- }));
- stats_.emplace_back(new PartitionCountStat(&blocks_, total));
-
- stats_.emplace_back(new DualChannelStat(&blocks_, total));
- }
-
- // Returns a sorted list of pairs of the form (part_id, count) where the
- // |part_id| is the partition ID used for 2-subset blocks, and |count| is the
- // number of times that particular ID was used.
- std::vector<std::pair<int, int>> ComputePartIDHistogram() const {
- std::vector<int> part_ids(1 << 11, 0);
- std::iota(part_ids.begin(), part_ids.end(), 0);
-
- // The histogram will then pair IDs with counts so that we can sort by
- // the number of instances later on.
- std::vector<std::pair<int, int>> part_id_histogram;
- std::transform(part_ids.begin(), part_ids.end(),
- std::back_inserter(part_id_histogram),
- [](const int& x) { return std::make_pair(x, 0); });
-
- // Actually count the IDs in the list of blocks.
- for (const auto& block : blocks_) {
- if (block.endpoints.size() == 2) {
- const int id = block.partition_id.value();
- assert(part_id_histogram[id].first == id);
- part_id_histogram[id].second++;
- }
- }
-
- struct OrderBySecondGreater {
- typedef std::pair<int, int> PairType;
- bool operator()(const PairType& lhs, const PairType& rhs) {
- return lhs.second > rhs.second;
- }
- };
-
- // Sort by descending numbers of occurrence for each partition ID
- std::sort(part_id_histogram.begin(), part_id_histogram.end(),
- OrderBySecondGreater());
-
- return part_id_histogram;
- }
-
- // Weights range from 2x2 - 12x12. For simplicity define buckets for every
- // pair in [0, 12]^2.
- constexpr static int kResolutionBuckets = 13;
- // Returns a linear array of buckets over all pairs of grid resolutions,
- // x-major in memory.
- std::vector<int> ComputeWeightResolutionHistogram() const {
- // Allocate one bucket for every grid resolution.
- std::vector<int> resolution_histogram(
- kResolutionBuckets * kResolutionBuckets, 0);
-
- // Count the weight resolutions in the list of blocks.
- for (const auto& block : blocks_) {
- const int dim_x = block.weight_grid_dim_x;
- const int dim_y = block.weight_grid_dim_y;
- assert(dim_x > 0);
- assert(dim_x < kResolutionBuckets);
- assert(dim_y > 0);
- assert(dim_y < kResolutionBuckets);
- ++resolution_histogram[dim_x + dim_y * kResolutionBuckets];
- }
-
- return resolution_histogram;
- }
-
- // Runs through each defined statistic and prints it out to stdout. Also
- // prints a histogram of partition ids used for the given blocks.
- void PrintStats() const {
- for (const auto& stat : stats_) {
- stat->PrintToStream(std::cout);
- }
-
- // We also want to find if there are any 2-subset partition IDs that are
- // used disproportionately often. Since partition IDs are 11 bits long, we
- // can have as many as (1 << 11) used IDs in a given sequence of blocks.
- const auto part_id_histogram = ComputePartIDHistogram();
- const int total_part_ids = std::accumulate(
- part_id_histogram.begin(), part_id_histogram.end(), 0,
- [](const int& x, const std::pair<int, int>& hist) {
- return x + hist.second;
- });
-
- if (total_part_ids > 0) {
- // Display numbers until we either:
- // A. Display the top 90% of used partitions
- // B. Reach a point where the remaining partition IDs constitute < 1% of
- // the total number of IDs used.
- const auto prepare_part_entry = []() -> std::ostream& {
- return std::cout << std::setw(6) << std::left << std::setfill('.');
- };
- int part_accum = 0;
- std::cout << "Two subset partition ID histogram: " << std::endl;
- std::cout << " ";
- prepare_part_entry() << "ID" << "Count" << std::endl;
- for (const auto& hist : part_id_histogram) {
- part_accum += hist.second;
- if ((hist.second * 100 / total_part_ids) < 1 ||
- (100 * (total_part_ids - part_accum)) / total_part_ids < 10) {
- const int num_to_display = (total_part_ids - part_accum);
- std::cout << " rest: " << num_to_display
- << " (" << (num_to_display * 100 / total_part_ids)
- << "%)" << std::endl;
- break;
- } else {
- std::cout << " ";
- prepare_part_entry() << hist.first << hist.second
- << " (" << (hist.second * 100 / total_part_ids)
- << "%)" << std::endl;
- }
- }
- }
-
- // Build the 2D histogram of resolutions.
- std::vector<int> weight_histogram = ComputeWeightResolutionHistogram();
- // Labels the weight resolution table.
- std::cout << "Weight resolutions:" << std::endl;
- const auto prepare_weight_entry = []() -> std::ostream& {
- return std::cout << std::setw(6) << std::left << std::setfill(' ');
- };
- prepare_weight_entry() << "H W";
- for (int resolution_x = 2; resolution_x < kResolutionBuckets;
- ++resolution_x) {
- prepare_weight_entry() << resolution_x;
- }
- std::cout << std::endl;
-
- // Displays table; skips rows/cols {0, 1} since they will always be empty.
- for (int resolution_y = 2; resolution_y < kResolutionBuckets;
- ++resolution_y) {
- prepare_weight_entry() << resolution_y;
- for (int resolution_x = 2; resolution_x < kResolutionBuckets;
- ++resolution_x) {
- const int count =
- weight_histogram[resolution_x + resolution_y * kResolutionBuckets];
- prepare_weight_entry();
- if (!count) {
- std::cout << "*";
- } else {
- std::cout << count;
- }
- }
- std::cout << std::endl;
- }
- }
-
- size_t NumBlocks() const { return blocks_.size(); }
-
- private:
- std::vector<std::unique_ptr<Stat>> stats_;
- std::vector<IntermediateBlockData> blocks_;
-};
-
-std::ostream& operator<<(std::ostream& stream, const RgbaColor& color) {
- stream << "{";
- constexpr int kNumChannels = std::tuple_size<RgbaColor>::value;
- for (int i = 0; i < kNumChannels; ++i) {
- stream << color[i];
- if (i < (kNumChannels - 1)) {
- stream << ", ";
- }
- }
- return stream << "}";
-}
-
-void PrintStatsForBlock(const PhysicalASTCBlock& pb,
- astc_codec::Footprint footprint) {
- const auto print_void_extent = [&pb](const VoidExtentData& void_extent_data) {
- std::cout << "Void extent block:" << std::endl;
- std::cout << " 16-bit RGBA: {"
- << void_extent_data.r << ", "
- << void_extent_data.g << ", "
- << void_extent_data.b << ", "
- << void_extent_data.a << "}" << std::endl;
- if (pb.VoidExtentCoords()) {
- std::cout << " Extent (S): {"
- << void_extent_data.coords[0] << ", "
- << void_extent_data.coords[1] << "}" << std::endl;
- std::cout << " Extent (T): {"
- << void_extent_data.coords[2] << ", "
- << void_extent_data.coords[3] << "}" << std::endl;
- } else {
- std::cout << " No valid extent data" << std::endl;
- }
- };
-
- const auto print_endpoint_data =
- [](ColorEndpointMode mode, int endpoint_range,
- const std::vector<int>& encoded_vals) {
- std::cout << " Endpoint mode: "
- << kModeStrings[static_cast<int>(mode)] << std::endl;
- std::cout << " Uses blue-contract mode: "
- << (UsesBlueContract(endpoint_range, mode, encoded_vals)
- ? "true" : "false")
- << std::endl;
-
- RgbaColor endpoint_low, endpoint_high;
- DecodeColorsForMode(encoded_vals, endpoint_range, mode,
- &endpoint_low, &endpoint_high);
-
- std::cout << " Low endpoint: " << endpoint_low << std::endl;
- std::cout << " High endpoint: " << endpoint_high << std::endl;
- };
-
- const auto print_color_data =
- [&print_endpoint_data, &footprint](const IntermediateBlockData& ib_data) {
- const int endpoint_range = ib_data.endpoint_range.value();
- std::cout << "Endpoint range: " << endpoint_range << std::endl;
-
- const int num_parts = ib_data.endpoints.size();
- if (ib_data.partition_id.hasValue()) {
- const int part_id = ib_data.partition_id.value();
- std::cout << "Parititon ID: " << part_id << std::endl;
-
- const auto part = GetASTCPartition(footprint, num_parts, part_id);
- assert(part.assignment.size() == footprint.Height() * footprint.Width());
-
- std::cout << "Assignment:" << std::endl;
- for (int y = 0; y < footprint.Height(); ++y) {
- std::cout << " ";
- for (int x = 0; x < footprint.Width(); ++x) {
- const int texel_index = y * footprint.Width() + x;
- std::cout << " " << part.assignment[texel_index];
- }
- std::cout << std::endl;
- }
- } else {
- std::cout << "Single partition" << std::endl;
- }
-
- int endpoint_index = 0;
- for (const auto& ep_data : ib_data.endpoints) {
- if (num_parts == 1) {
- std::cout << "Endpoints:" << std::endl;
- } else {
- std::cout << "Endpoint " << (endpoint_index++) << ": " << std::endl;
- }
- print_endpoint_data(ep_data.mode, endpoint_range, ep_data.colors);
- }
-
- if (ib_data.dual_plane_channel) {
- std::cout << "Dual plane channel: "
- << ib_data.dual_plane_channel.value() << std::endl;
- } else {
- std::cout << "Single plane" << std::endl;
- }
- };
-
- const auto print_weight_data =
- [&footprint](const IntermediateBlockData& ib_data) {
- std::cout << "Weight grid dimensions: "
- << ib_data.weight_grid_dim_x << "x" << ib_data.weight_grid_dim_y
- << std::endl;
- std::cout << "Weight range: " << ib_data.weight_range << std::endl;
-
- std::cout << "Encoded weight grid: " << std::endl;
- int weight_idx = 0;
- for (int j = 0; j < ib_data.weight_grid_dim_y; ++j) {
- std::cout << " ";
- for (int i = 0; i < ib_data.weight_grid_dim_x; ++i) {
- std::cout << std::setw(3) << std::left << std::setfill(' ')
- << ib_data.weights[weight_idx++];
- }
- std::cout << std::endl;
- }
-
- std::cout << "Actual weight grid: " << std::endl;
- std::vector<int> actual_weights = ib_data.weights;
- for (auto& weight : actual_weights) {
- weight = astc_codec::UnquantizeWeightFromRange(
- weight, ib_data.weight_range);
- }
-
- actual_weights = astc_codec::InfillWeights(
- actual_weights, footprint, ib_data.weight_grid_dim_x,
- ib_data.weight_grid_dim_y);
-
- weight_idx = 0;
- for (int j = 0; j < footprint.Height(); ++j) {
- std::cout << " ";
- for (int i = 0; i < footprint.Width(); ++i) {
- std::cout << std::setw(3) << std::left << std::setfill(' ')
- << actual_weights[weight_idx++];
- }
- std::cout << std::endl;
- }
- };
-
- if (pb.IsVoidExtent()) {
- Optional<VoidExtentData> ve = astc_codec::UnpackVoidExtent(pb);
- if (!ve) {
- std::cerr << "ERROR: Failed to unpack void extent block." << std::endl;
- } else {
- print_void_extent(ve.value());
- }
- } else {
- Optional<IntermediateBlockData> ib =
- astc_codec::UnpackIntermediateBlock(pb);
- if (!ib) {
- std::cerr << "ERROR: Failed to unpack intermediate block." << std::endl;
- } else {
- const auto& ib_data = ib.value();
- print_color_data(ib_data);
- print_weight_data(ib_data);
- }
- }
-}
-
-} // namespace
-
-int main(int argc, char* argv[]) {
- bool error = false;
-
- std::string filename;
- size_t block_index = 0;
- bool has_block_index = false;
-
- if (argc >= 2) {
- filename = argv[1];
-
- if (argc == 3) {
- int32_t param = astc_codec::base::ParseInt32(argv[2], -1);
- if (param < 0) {
- std::cerr << "ERROR: Invalid block index." << std::endl;
- error = true;
- } else {
- block_index = static_cast<size_t>(param);
- has_block_index = true;
- }
- } else if (argc != 2) {
- std::cerr << "ERROR: Too many parameters." << std::endl;
- error = true;
- }
- } else {
- error = true;
- }
-
- if (error) {
- std::cout << ((argc >= 0) ? argv[0] : "astc_inspector_cli")
- << " <filename> [<block index>]" << std::endl
- << std::endl
- << "Collects the various statistics of a stream of ASTC data "
- << "stored in an ASTC file." << std::endl
- << std::endl
- << " filename ASTC file path." << std::endl
- << " block index If specified, show detailed information about a block"
- << std::endl;
- return 1;
- }
-
- std::string error_string;
- std::unique_ptr<ASTCFile> astc_file = ASTCFile::LoadFile(argv[1], &error_string);
- if (!astc_file) {
- std::cerr << "ERROR: " << error_string << std::endl;
- return 2;
- }
-
- if (has_block_index) {
- Optional<astc_codec::Footprint> footprint =
- astc_codec::Footprint::Parse(astc_file->GetFootprintString().c_str());
- if (!footprint) {
- std::cerr << "ERROR: Invalid footprint \"" << astc_file->GetFootprintString() << "\"" << std::endl;
- return 3;
- }
-
- PrintStatsForBlock(astc_file->GetBlock(block_index), footprint.value());
- } else {
- std::cout << "Dimensions: " << astc_file->GetWidth() << "x"
- << astc_file->GetHeight() << ", depth " << astc_file->GetDepth()
- << std::endl;
-
- ASTCFileStats stats(astc_file);
-
- std::cout << std::endl
- << "Total bits used: " << 128 * astc_file->NumBlocks()
- << " (" << astc_file->NumBlocks() << " blocks, "
- << (astc_file->NumBlocks() * 16) << " bytes)"
- << std::endl << std::endl;
-
- stats.PrintStats();
- }
-
- return 0;
-}
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/types.h b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/types.h
deleted file mode 100644
index 728d5adfa1a..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/types.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_DECODER_ASTC_TYPES_H_
-#define ASTC_CODEC_DECODER_ASTC_TYPES_H_
-
-#include <array>
-#include <string>
-#include <utility>
-
-namespace astc_codec {
-
-// The color endpoint mode determines how the values encoded in the ASTC block
-// are interpreted in order to create the RGBA values for the given endpoint
-// pair. The order of this enum is required to match the ASTC specification in
-// Section C.2.14.
-enum class ColorEndpointMode {
- kLDRLumaDirect = 0,
- kLDRLumaBaseOffset,
- kHDRLumaLargeRange,
- kHDRLumaSmallRange,
- kLDRLumaAlphaDirect,
- kLDRLumaAlphaBaseOffset,
- kLDRRGBBaseScale,
- kHDRRGBBaseScale,
- kLDRRGBDirect,
- kLDRRGBBaseOffset,
- kLDRRGBBaseScaleTwoA,
- kHDRRGBDirect,
- kLDRRGBADirect,
- kLDRRGBABaseOffset,
- kHDRRGBDirectLDRAlpha,
- kHDRRGBDirectHDRAlpha,
-
- // The total number of color endpoints defined by the ASTC specification.
- // This isn't a specific endpoint mode and its sole purpose is to be used
- // as a constant number.
- kNumColorEndpointModes
-};
-
-// Returns the class for the given mode as defined in Section C.2.11.
-constexpr int EndpointModeClass(ColorEndpointMode mode) {
- return static_cast<int>(mode) / 4;
-}
-
-// Returns the number of encoded color values for the given endpoint mode. The
-// number of encoded color values and their range determines the size of the
-// color data in a physical ASTC block. This information is taken from
-// Section C.2.17 of the ASTC specification.
-constexpr int NumColorValuesForEndpointMode(ColorEndpointMode mode) {
- return (EndpointModeClass(mode) + 1) * 2;
-}
-
-// We define a number of convenience types here that give more logical meaning
-// throughout the ASTC utilities.
-using RgbColor = std::array<int, 3>;
-using RgbaColor = std::array<int, 4>;
-using Endpoint = RgbaColor;
-using EndpointPair = std::pair<Endpoint, Endpoint>;
-
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_DECODER_ASTC_TYPES_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/weight_infill.cc b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/weight_infill.cc
deleted file mode 100644
index 62909aa6967..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/weight_infill.cc
+++ /dev/null
@@ -1,122 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 "src/decoder/weight_infill.h"
-#include "src/decoder/integer_sequence_codec.h"
-
-#include <array>
-#include <cmath>
-#include <utility>
-
-namespace astc_codec {
-
-namespace {
-
-// The following functions are based on Section C.2.18 of the ASTC specification
-int GetScaleFactorD(int block_dim) {
- return static_cast<int>((1024.f + static_cast<float>(block_dim >> 1)) /
- static_cast<float>(block_dim - 1));
-}
-
-std::pair<int, int> GetGridSpaceCoordinates(
- Footprint footprint, int s, int t, int weight_dim_x, int weight_dim_y) {
- const int ds = GetScaleFactorD(footprint.Width());
- const int dt = GetScaleFactorD(footprint.Height());
-
- const int cs = ds * s;
- const int ct = dt * t;
-
- const int gs = (cs * (weight_dim_x - 1) + 32) >> 6;
- const int gt = (ct * (weight_dim_y - 1) + 32) >> 6;
-
- assert(gt < 1 << 8);
- assert(gs < 1 << 8);
-
- return std::make_pair(gs, gt);
-}
-
-// Returns the weight-grid values that are to be used for bilinearly
-// interpolating the weight to its final value. If the returned value
-// is equal to weight_dim_x * weight_dim_y, it may be ignored.
-std::array<int, 4> BilerpGridPointsForWeight(
- const std::pair<int, int>& grid_space_coords, int weight_dim_x) {
- const int js = grid_space_coords.first >> 4;
- const int jt = grid_space_coords.second >> 4;
-
- std::array<int, 4> result;
- result[0] = js + weight_dim_x * jt;
- result[1] = js + weight_dim_x * jt + 1;
- result[2] = js + weight_dim_x * (jt + 1);
- result[3] = js + weight_dim_x * (jt + 1) + 1;
-
- return result;
-}
-
-std::array<int, 4> BilerpGridPointFactorsForWeight(
- const std::pair<int, int>& grid_space_coords) {
- const int fs = grid_space_coords.first & 0xF;
- const int ft = grid_space_coords.second & 0xF;
-
- std::array<int, 4> result;
- result[3] = (fs * ft + 8) >> 4;
- result[2] = ft - result[3];
- result[1] = fs - result[3];
- result[0] = 16 - fs - ft + result[3];
-
- assert(result[0] <= 16);
- assert(result[1] <= 16);
- assert(result[2] <= 16);
- assert(result[3] <= 16);
-
- return result;
-}
-
-} // namespace
-
-////////////////////////////////////////////////////////////////////////////////
-
-int CountBitsForWeights(int weight_dim_x, int weight_dim_y,
- int target_weight_range) {
- int num_weights = weight_dim_x * weight_dim_y;
- return IntegerSequenceCodec::
- GetBitCountForRange(num_weights, target_weight_range);
-}
-
-std::vector<int> InfillWeights(const std::vector<int>& weights,
- Footprint footprint, int dim_x, int dim_y) {
- std::vector<int> result;
- result.reserve(footprint.NumPixels());
- for (int t = 0; t < footprint.Height(); ++t) {
- for (int s = 0; s < footprint.Width(); ++s) {
- const auto grid_space_coords =
- GetGridSpaceCoordinates(footprint, s, t, dim_x, dim_y);
- const auto grid_pts =
- BilerpGridPointsForWeight(grid_space_coords, dim_x);
- const auto grid_factors =
- BilerpGridPointFactorsForWeight(grid_space_coords);
-
- int weight = 0;
- for (int i = 0; i < 4; ++i) {
- if (grid_pts[i] < dim_x * dim_y) {
- weight += weights.at(grid_pts[i]) * grid_factors[i];
- }
- }
- result.push_back((weight + 8) >> 4);
- }
- }
-
- return result;
-}
-
-} // namespace astc_codec
diff --git a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/weight_infill.h b/3rdparty/bimg/3rdparty/astc-codec/src/decoder/weight_infill.h
deleted file mode 100644
index 4a09d358bc4..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/src/decoder/weight_infill.h
+++ /dev/null
@@ -1,38 +0,0 @@
-// Copyright 2018 Google LLC
-//
-// 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
-//
-// https://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 ASTC_CODEC_DECODER_WEIGHT_INFILL_H_
-#define ASTC_CODEC_DECODER_WEIGHT_INFILL_H_
-
-#include "src/decoder/footprint.h"
-
-#include <vector>
-
-namespace astc_codec {
-
-// Returns the number of bits used to represent the weight grid at the target
-// dimensions and weight range.
-int CountBitsForWeights(int weight_dim_x, int weight_dim_y,
- int target_weight_range);
-
-// Performs weight infill of a grid of weights of size |dim_x * dim_y|. The
-// weights are fit using the algorithm laid out in Section C.2.18 of the ASTC
-// specification. Weights are expected to be passed unquantized and the returned
-// grid will be unquantized as well (i.e. each weight within the range [0, 64]).
-std::vector<int> InfillWeights(const std::vector<int>& weights,
- Footprint footprint, int dim_x, int dim_y);
-
-} // namespace astc_codec
-
-#endif // ASTC_CODEC_DECODER_WEIGHT_INFILL_H_
diff --git a/3rdparty/bimg/3rdparty/astc-codec/third_party/BUILD b/3rdparty/bimg/3rdparty/astc-codec/third_party/BUILD
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/third_party/BUILD
+++ /dev/null
diff --git a/3rdparty/bimg/3rdparty/astc-codec/third_party/honggfuzz.BUILD b/3rdparty/bimg/3rdparty/astc-codec/third_party/honggfuzz.BUILD
deleted file mode 100644
index 07d9042e732..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/third_party/honggfuzz.BUILD
+++ /dev/null
@@ -1,39 +0,0 @@
-config_setting(
- name = "opt",
- values = {"compilation_mode": "opt"}
-)
-
-cc_library(
- name = "honggfuzz",
- srcs = glob([
- "libhfuzz/*.c",
- "libhfcommon/*.c",
- ],
- exclude = ["libhfuzz/linux.c"],
- ) + select({
- "@bazel_tools//src/conditions:darwin_x86_64": [],
- "@bazel_tools//src/conditions:darwin": [],
- "//conditions:default": ["libhfuzz/linux.c"],
- }),
- hdrs = glob([
- "libhfuzz/*.h",
- "libhfcommon/*.h",
- "honggfuzz.h",
- ]),
- copts = [
- "-std=c11",
- ],
- defines = select({
- "@bazel_tools//src/conditions:darwin_x86_64": ["_HF_ARCH_DARWIN"],
- "@bazel_tools//src/conditions:darwin": ["_HF_ARCH_DARWIN"],
- "//conditions:default": ["_HF_ARCH_LINUX"],
- }) + select({
- ":opt": [],
- "//conditions:default": ["DEBUG=DEBUG"],
- }) + [
- "_GNU_SOURCE",
- ],
- includes = ["."],
- visibility = ["//visibility:public"],
- linkstatic = 1
-)
diff --git a/3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/build.sh b/3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/build.sh
deleted file mode 100755
index 9f088061f22..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/build.sh
+++ /dev/null
@@ -1,76 +0,0 @@
-#!/bin/bash
-# Configures builds for our CI environment.
-
-# Print commands and exit on error.
-set -ex
-
-if [ "$KOKORO_BUILD_ID" ]; then
- echo "Running job $KOKORO_JOB_NAME"
- TARGET=`echo "$KOKORO_JOB_NAME" | awk -F "/" '{print $NF}'`
-fi
-
-if [ ! "$TARGET" ]; then
- if [ "$1" ]; then
- TARGET=$1
- else
- TARGET=release
- fi
-fi
-
-echo "Building $TARGET target"
-
-pushd `dirname $0`/../../.. > /dev/null
-
-BUILD_RELEASE=
-BUILD_DEBUG=
-BUILD_CMAKE=
-RUN_TESTS=
-
-if [ "$TARGET" == "presubmit" ]; then
- BUILD_DEBUG=1
- BUILD_RELEASE=1
- BUILD_CMAKE=1
- RUN_TESTS=1
-fi
-
-if [ "$TARGET" == "debug" ]; then
- BUILD_DEBUG=1
-fi
-
-if [ "$TARGET" == "release" ]; then
- BUILD_RELEASE=1
-fi
-
-if [ "$TARGET" == "continuous" ]; then
- BUILD_DEBUG=1
- BUILD_RELEASE=1
- BUILD_CMAKE=1
- RUN_TESTS=1
-fi
-
-if [ "$BUILD_DEBUG" == "1" ]; then
- echo "Starting debug build"
- bazel build -c dbg //...
-
- if [ "$RUN_TESTS" == "1" ]; then
- bazel test -c dbg //...
- fi
-fi
-
-if [ "$BUILD_RELEASE" == "1" ]; then
- echo "Starting release build"
- bazel build -c opt //...
-
- if [ "$RUN_TESTS" == "1" ]; then
- bazel test -c opt //...
- fi
-fi
-
-if [ "$BUILD_CMAKE" == "1" ]; then
- echo "Starting cmake build"
- mkdir build
- pushd build
- cmake ..
- make -j$((`nproc`+1))
- popd
-fi
diff --git a/3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/continuous.cfg b/3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/continuous.cfg
deleted file mode 100644
index cde6840be68..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/continuous.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-# Format: //devtools/kokoro/config/proto/build.proto
-
-build_file: "astc-codec/tools/build-ci/linux/build.sh"
diff --git a/3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/presubmit.cfg b/3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/presubmit.cfg
deleted file mode 100644
index cde6840be68..00000000000
--- a/3rdparty/bimg/3rdparty/astc-codec/tools/build-ci/linux/presubmit.cfg
+++ /dev/null
@@ -1,3 +0,0 @@
-# Format: //devtools/kokoro/config/proto/build.proto
-
-build_file: "astc-codec/tools/build-ci/linux/build.sh"
diff --git a/3rdparty/bimg/3rdparty/astc-codec/LICENSE b/3rdparty/bimg/3rdparty/astc-encoder/LICENSE.txt
index d6456956733..b82735a3103 100644
--- a/3rdparty/bimg/3rdparty/astc-codec/LICENSE
+++ b/3rdparty/bimg/3rdparty/astc-encoder/LICENSE.txt
@@ -3,7 +3,7 @@
Version 2.0, January 2004
http://www.apache.org/licenses/
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
@@ -173,30 +173,3 @@
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- 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.
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/include/astcenc.h b/3rdparty/bimg/3rdparty/astc-encoder/include/astcenc.h
new file mode 100644
index 00000000000..56f1ad8058c
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/include/astcenc.h
@@ -0,0 +1,834 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2020-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief The core astcenc codec library interface.
+ *
+ * This interface is the entry point to the core astcenc codec. It aims to be easy to use for
+ * non-experts, but also to allow experts to have fine control over the compressor heuristics if
+ * needed. The core codec only handles compression and decompression, transferring all inputs and
+ * outputs via memory buffers. To catch obvious input/output buffer sizing issues, which can cause
+ * security and stability problems, all transfer buffers are explicitly sized.
+ *
+ * While the aim is that we keep this interface mostly stable, it should be viewed as a mutable
+ * interface tied to a specific source version. We are not trying to maintain backwards
+ * compatibility across codec versions.
+ *
+ * The API state management is based around an explicit context object, which is the context for all
+ * allocated memory resources needed to compress and decompress a single image. A context can be
+ * used to sequentially compress multiple images using the same configuration, allowing setup
+ * overheads to be amortized over multiple images, which is particularly important when images are
+ * small.
+ *
+ * Multi-threading can be used two ways.
+ *
+ * * An application wishing to process multiple images in parallel can allocate multiple
+ * contexts and assign each context to a thread.
+ * * An application wishing to process a single image in using multiple threads can configure
+ * contexts for multi-threaded use, and invoke astcenc_compress/decompress() once per thread
+ * for faster processing. The caller is responsible for creating the worker threads, and
+ * synchronizing between images.
+ *
+ * Threading
+ * =========
+ *
+ * In pseudo-code, the usage for manual user threading looks like this:
+ *
+ * // Configure the compressor run
+ * astcenc_config my_config;
+ * astcenc_config_init(..., &my_config);
+ *
+ * // Power users can tweak <my_config> settings here ...
+ *
+ * // Allocate working state given config and thread_count
+ * astcenc_context* my_context;
+ * astcenc_context_alloc(&my_config, thread_count, &my_context);
+ *
+ * // Compress each image using these config settings
+ * foreach image:
+ * // For each thread in the thread pool
+ * for i in range(0, thread_count):
+ * astcenc_compress_image(my_context, &my_input, my_output, i);
+ *
+ * astcenc_compress_reset(my_context);
+ *
+ * // Clean up
+ * astcenc_context_free(my_context);
+ *
+ * Images
+ * ======
+ *
+ * The codec supports compressing single images, which can be either 2D images or volumetric 3D
+ * images. Calling code is responsible for any handling of aggregate types, such as mipmap chains,
+ * texture arrays, or sliced 3D textures.
+ *
+ * Images are passed in as an astcenc_image structure. Inputs can be either 8-bit unorm, 16-bit
+ * half-float, or 32-bit float, as indicated by the data_type field.
+ *
+ * Images can be any dimension; there is no requirement to be a multiple of the ASTC block size.
+ *
+ * Data is always passed in as 4 color components, and accessed as an array of 2D image slices. Data
+ * within an image slice is always tightly packed without padding. Addressing looks like this:
+ *
+ * data[z_coord][y_coord * x_dim * 4 + x_coord * 4 ] // Red
+ * data[z_coord][y_coord * x_dim * 4 + x_coord * 4 + 1] // Green
+ * data[z_coord][y_coord * x_dim * 4 + x_coord * 4 + 2] // Blue
+ * data[z_coord][y_coord * x_dim * 4 + x_coord * 4 + 3] // Alpha
+ *
+ * Common compressor usage
+ * =======================
+ *
+ * One of the most important things for coding image quality is to align the input data component
+ * count with the ASTC color endpoint mode. This avoids wasting bits encoding components you don't
+ * actually need in the endpoint colors.
+ *
+ * | Input data | Encoding swizzle | Sampling swizzle |
+ * | ------------ | ---------------- | ---------------- |
+ * | 1 component | RRR1 | .[rgb] |
+ * | 2 components | RRRG | .[rgb]a |
+ * | 3 components | RGB1 | .rgb |
+ * | 4 components | RGBA | .rgba |
+ *
+ * The 1 and 2 component modes recommend sampling from "g" to recover the luminance value as this
+ * provide best compatibility with other texture formats where the green component may be stored at
+ * higher precision than the others, such as RGB565. For ASTC any of the RGB components can be used;
+ * the luminance endpoint component will be returned for all three.
+ *
+ * When using the normal map compression mode ASTC will store normals as a two component X+Y map.
+ * Input images must contain unit-length normalized and should be passed in using a two component
+ * swizzle. The astcenc command line tool defaults to an RRRG swizzle, but some developers prefer
+ * to use GGGR for compatability with BC5n which will work just as well. The Z component can be
+ * recovered programmatically in shader code, using knowledge that the vector is unit length and
+ * that Z must be positive for a tangent-space normal map.
+ *
+ * Decompress-only usage
+ * =====================
+ *
+ * For some use cases it is useful to have a cut-down context and/or library which supports
+ * decompression but not compression.
+ *
+ * A context can be made decompress-only using the ASTCENC_FLG_DECOMPRESS_ONLY flag when the context
+ * is allocated. These contexts have lower dynamic memory footprint than a full context.
+ *
+ * The entire library can be made decompress-only by building the files with the define
+ * ASTCENC_DECOMPRESS_ONLY set. In this build the context will be smaller, and the library will
+ * exclude the functionality which is only needed for compression. This reduces the binary size by
+ * ~180KB. For these builds contexts must be created with the ASTCENC_FLG_DECOMPRESS_ONLY flag.
+ *
+ * Note that context structures returned by a library built as decompress-only are incompatible with
+ * a library built with compression included, and visa versa, as they have different sizes and
+ * memory layout.
+ *
+ * Self-decompress-only usage
+ * ==========================
+ *
+ * ASTC is a complex format with a large search space. The parts of this search space that are
+ * searched is determined by heuristics that are, in part, tied to the quality level used when
+ * creating the context.
+ *
+ * A normal context is capable of decompressing any ASTC texture, including those generated by other
+ * compressors with unknown heuristics. This is the most flexible implementation, but forces the
+ * data tables used by the codec to include entries that are not needed during compression. This
+ * can slow down context creation by a significant amount, especially for the faster compression
+ * modes where few data table entries are actually used. To optimize this use case the context can
+ * be created with the ASTCENC_FLG_SELF_DECOMPRESS_ONLY flag. This tells the compressor that it will
+ * only be asked to decompress images that it compressed itself, allowing the data tables to
+ * exclude entries that are not needed by the current compression configuration. This reduces the
+ * size of the context data tables in memory and improves context creation performance. Note that,
+ * as of the 3.6 release, this flag no longer affects compression performance.
+ *
+ * Using this flag while attempting to decompress an valid image which was created by another
+ * compressor, or even another astcenc compressor version or configuration, may result in blocks
+ * returning as solid magenta or NaN value error blocks.
+ */
+
+#ifndef ASTCENC_INCLUDED
+#define ASTCENC_INCLUDED
+
+#include <cstddef>
+#include <cstdint>
+
+#if defined(ASTCENC_DYNAMIC_LIBRARY)
+ #if defined(_MSC_VER)
+ #define ASTCENC_PUBLIC extern "C" __declspec(dllexport)
+ #else
+ #define ASTCENC_PUBLIC extern "C" __attribute__ ((visibility ("default")))
+ #endif
+#else
+ #define ASTCENC_PUBLIC
+#endif
+
+/* ============================================================================
+ Data declarations
+============================================================================ */
+
+/**
+ * @brief An opaque structure; see astcenc_internal.h for definition.
+ */
+struct astcenc_context;
+
+/**
+ * @brief A codec API error code.
+ */
+enum astcenc_error {
+ /** @brief The call was successful. */
+ ASTCENC_SUCCESS = 0,
+ /** @brief The call failed due to low memory, or undersized I/O buffers. */
+ ASTCENC_ERR_OUT_OF_MEM,
+ /** @brief The call failed due to the build using fast math. */
+ ASTCENC_ERR_BAD_CPU_FLOAT,
+ /** @brief The call failed due to the build using an unsupported ISA. */
+ ASTCENC_ERR_BAD_CPU_ISA,
+ /** @brief The call failed due to an out-of-spec parameter. */
+ ASTCENC_ERR_BAD_PARAM,
+ /** @brief The call failed due to an out-of-spec block size. */
+ ASTCENC_ERR_BAD_BLOCK_SIZE,
+ /** @brief The call failed due to an out-of-spec color profile. */
+ ASTCENC_ERR_BAD_PROFILE,
+ /** @brief The call failed due to an out-of-spec quality value. */
+ ASTCENC_ERR_BAD_QUALITY,
+ /** @brief The call failed due to an out-of-spec component swizzle. */
+ ASTCENC_ERR_BAD_SWIZZLE,
+ /** @brief The call failed due to an out-of-spec flag set. */
+ ASTCENC_ERR_BAD_FLAGS,
+ /** @brief The call failed due to the context not supporting the operation. */
+ ASTCENC_ERR_BAD_CONTEXT,
+ /** @brief The call failed due to unimplemented functionality. */
+ ASTCENC_ERR_NOT_IMPLEMENTED,
+#if defined(ASTCENC_DIAGNOSTICS)
+ /** @brief The call failed due to an issue with diagnostic tracing. */
+ ASTCENC_ERR_DTRACE_FAILURE,
+#endif
+};
+
+/**
+ * @brief A codec color profile.
+ */
+enum astcenc_profile {
+ /** @brief The LDR sRGB color profile. */
+ ASTCENC_PRF_LDR_SRGB = 0,
+ /** @brief The LDR linear color profile. */
+ ASTCENC_PRF_LDR,
+ /** @brief The HDR RGB with LDR alpha color profile. */
+ ASTCENC_PRF_HDR_RGB_LDR_A,
+ /** @brief The HDR RGBA color profile. */
+ ASTCENC_PRF_HDR
+};
+
+/** @brief The fastest, lowest quality, search preset. */
+static const float ASTCENC_PRE_FASTEST = 0.0f;
+
+/** @brief The fast search preset. */
+static const float ASTCENC_PRE_FAST = 10.0f;
+
+/** @brief The medium quality search preset. */
+static const float ASTCENC_PRE_MEDIUM = 60.0f;
+
+/** @brief The thorough quality search preset. */
+static const float ASTCENC_PRE_THOROUGH = 98.0f;
+
+/** @brief The thorough quality search preset. */
+static const float ASTCENC_PRE_VERYTHOROUGH = 99.0f;
+
+/** @brief The exhaustive, highest quality, search preset. */
+static const float ASTCENC_PRE_EXHAUSTIVE = 100.0f;
+
+/**
+ * @brief A codec component swizzle selector.
+ */
+enum astcenc_swz
+{
+ /** @brief Select the red component. */
+ ASTCENC_SWZ_R = 0,
+ /** @brief Select the green component. */
+ ASTCENC_SWZ_G = 1,
+ /** @brief Select the blue component. */
+ ASTCENC_SWZ_B = 2,
+ /** @brief Select the alpha component. */
+ ASTCENC_SWZ_A = 3,
+ /** @brief Use a constant zero component. */
+ ASTCENC_SWZ_0 = 4,
+ /** @brief Use a constant one component. */
+ ASTCENC_SWZ_1 = 5,
+ /** @brief Use a reconstructed normal vector Z component. */
+ ASTCENC_SWZ_Z = 6
+};
+
+/**
+ * @brief A texel component swizzle.
+ */
+struct astcenc_swizzle
+{
+ /** @brief The red component selector. */
+ astcenc_swz r;
+ /** @brief The green component selector. */
+ astcenc_swz g;
+ /** @brief The blue component selector. */
+ astcenc_swz b;
+ /** @brief The alpha component selector. */
+ astcenc_swz a;
+};
+
+/**
+ * @brief A texel component data format.
+ */
+enum astcenc_type
+{
+ /** @brief Unorm 8-bit data per component. */
+ ASTCENC_TYPE_U8 = 0,
+ /** @brief 16-bit float per component. */
+ ASTCENC_TYPE_F16 = 1,
+ /** @brief 32-bit float per component. */
+ ASTCENC_TYPE_F32 = 2
+};
+
+/**
+ * @brief Enable normal map compression.
+ *
+ * Input data will be treated a two component normal map, storing X and Y, and the codec will
+ * optimize for angular error rather than simple linear PSNR. In this mode the input swizzle should
+ * be e.g. rrrg (the default ordering for ASTC normals on the command line) or gggr (the ordering
+ * used by BC5n).
+ */
+static const unsigned int ASTCENC_FLG_MAP_NORMAL = 1 << 0;
+
+/**
+ * @brief Enable mask map compression.
+ *
+ * Input data will be treated a multi-layer mask map, where is is desirable for the color components
+ * to be treated independently for the purposes of error analysis.
+ */
+static const unsigned int ASTCENC_FLG_MAP_MASK = 1 << 1;
+
+/**
+ * @brief Enable alpha weighting.
+ *
+ * The input alpha value is used for transparency, so errors in the RGB components are weighted by
+ * the transparency level. This allows the codec to more accurately encode the alpha value in areas
+ * where the color value is less significant.
+ */
+static const unsigned int ASTCENC_FLG_USE_ALPHA_WEIGHT = 1 << 2;
+
+/**
+ * @brief Enable perceptual error metrics.
+ *
+ * This mode enables perceptual compression mode, which will optimize for perceptual error rather
+ * than best PSNR. Only some input modes support perceptual error metrics.
+ */
+static const unsigned int ASTCENC_FLG_USE_PERCEPTUAL = 1 << 3;
+
+/**
+ * @brief Create a decompression-only context.
+ *
+ * This mode disables support for compression. This enables context allocation to skip some
+ * transient buffer allocation, resulting in lower memory usage.
+ */
+static const unsigned int ASTCENC_FLG_DECOMPRESS_ONLY = 1 << 4;
+
+/**
+ * @brief Create a self-decompression context.
+ *
+ * This mode configures the compressor so that it is only guaranteed to be able to decompress images
+ * that were actually created using the current context. This is the common case for compression use
+ * cases, and setting this flag enables additional optimizations, but does mean that the context
+ * cannot reliably decompress arbitrary ASTC images.
+ */
+static const unsigned int ASTCENC_FLG_SELF_DECOMPRESS_ONLY = 1 << 5;
+
+/**
+ * @brief Enable RGBM map compression.
+ *
+ * Input data will be treated as HDR data that has been stored in an LDR RGBM-encoded wrapper
+ * format. Data must be preprocessed by the user to be in LDR RGBM format before calling the
+ * compression function, this flag is only used to control the use of RGBM-specific heuristics and
+ * error metrics.
+ *
+ * IMPORTANT: The ASTC format is prone to bad failure modes with unconstrained RGBM data; very small
+ * M values can round to zero due to quantization and result in black or white pixels. It is highly
+ * recommended that the minimum value of M used in the encoding is kept above a lower threshold (try
+ * 16 or 32). Applying this threshold reduces the number of very dark colors that can be
+ * represented, but is still higher precision than 8-bit LDR.
+ *
+ * When this flag is set the value of @c rgbm_m_scale in the context must be set to the RGBM scale
+ * factor used during reconstruction. This defaults to 5 when in RGBM mode.
+ *
+ * It is recommended that the value of @c cw_a_weight is set to twice the value of the multiplier
+ * scale, ensuring that the M value is accurately encoded. This defaults to 10 when in RGBM mode,
+ * matching the default scale factor.
+ */
+static const unsigned int ASTCENC_FLG_MAP_RGBM = 1 << 6;
+
+/**
+ * @brief The bit mask of all valid flags.
+ */
+static const unsigned int ASTCENC_ALL_FLAGS =
+ ASTCENC_FLG_MAP_MASK |
+ ASTCENC_FLG_MAP_NORMAL |
+ ASTCENC_FLG_MAP_RGBM |
+ ASTCENC_FLG_USE_ALPHA_WEIGHT |
+ ASTCENC_FLG_USE_PERCEPTUAL |
+ ASTCENC_FLG_DECOMPRESS_ONLY |
+ ASTCENC_FLG_SELF_DECOMPRESS_ONLY;
+
+/**
+ * @brief The config structure.
+ *
+ * This structure will initially be populated by a call to astcenc_config_init, but power users may
+ * modify it before calling astcenc_context_alloc. See astcenccli_toplevel_help.cpp for full user
+ * documentation of the power-user settings.
+ *
+ * Note for any settings which are associated with a specific color component, the value in the
+ * config applies to the component that exists after any compression data swizzle is applied.
+ */
+struct astcenc_config
+{
+ /** @brief The color profile. */
+ astcenc_profile profile;
+
+ /** @brief The set of set flags. */
+ unsigned int flags;
+
+ /** @brief The ASTC block size X dimension. */
+ unsigned int block_x;
+
+ /** @brief The ASTC block size Y dimension. */
+ unsigned int block_y;
+
+ /** @brief The ASTC block size Z dimension. */
+ unsigned int block_z;
+
+ /** @brief The red component weight scale for error weighting (-cw). */
+ float cw_r_weight;
+
+ /** @brief The green component weight scale for error weighting (-cw). */
+ float cw_g_weight;
+
+ /** @brief The blue component weight scale for error weighting (-cw). */
+ float cw_b_weight;
+
+ /** @brief The alpha component weight scale for error weighting (-cw). */
+ float cw_a_weight;
+
+ /**
+ * @brief The radius for any alpha-weight scaling (-a).
+ *
+ * It is recommended that this is set to 1 when using FLG_USE_ALPHA_WEIGHT on a texture that
+ * will be sampled using linear texture filtering to minimize color bleed out of transparent
+ * texels that are adjacent to non-transparent texels.
+ */
+ unsigned int a_scale_radius;
+
+ /** @brief The RGBM scale factor for the shared multiplier (-rgbm). */
+ float rgbm_m_scale;
+
+ /**
+ * @brief The maximum number of partitions searched (-partitioncountlimit).
+ *
+ * Valid values are between 1 and 4.
+ */
+ unsigned int tune_partition_count_limit;
+
+ /**
+ * @brief The maximum number of partitions searched (-2partitionindexlimit).
+ *
+ * Valid values are between 1 and 1024.
+ */
+ unsigned int tune_2partition_index_limit;
+
+ /**
+ * @brief The maximum number of partitions searched (-3partitionindexlimit).
+ *
+ * Valid values are between 1 and 1024.
+ */
+ unsigned int tune_3partition_index_limit;
+
+ /**
+ * @brief The maximum number of partitions searched (-4partitionindexlimit).
+ *
+ * Valid values are between 1 and 1024.
+ */
+ unsigned int tune_4partition_index_limit;
+
+ /**
+ * @brief The maximum centile for block modes searched (-blockmodelimit).
+ *
+ * Valid values are between 1 and 100.
+ */
+ unsigned int tune_block_mode_limit;
+
+ /**
+ * @brief The maximum iterative refinements applied (-refinementlimit).
+ *
+ * Valid values are between 1 and N; there is no technical upper limit
+ * but little benefit is expected after N=4.
+ */
+ unsigned int tune_refinement_limit;
+
+ /**
+ * @brief The number of trial candidates per mode search (-candidatelimit).
+ *
+ * Valid values are between 1 and TUNE_MAX_TRIAL_CANDIDATES (default 4).
+ */
+ unsigned int tune_candidate_limit;
+
+ /**
+ * @brief The number of trial partitionings per search (-2partitioncandidatelimit).
+ *
+ * Valid values are between 1 and TUNE_MAX_PARTITIIONING_CANDIDATES.
+ */
+ unsigned int tune_2partitioning_candidate_limit;
+
+ /**
+ * @brief The number of trial partitionings per search (-3partitioncandidatelimit).
+ *
+ * Valid values are between 1 and TUNE_MAX_PARTITIIONING_CANDIDATES.
+ */
+ unsigned int tune_3partitioning_candidate_limit;
+
+ /**
+ * @brief The number of trial partitionings per search (-4partitioncandidatelimit).
+ *
+ * Valid values are between 1 and TUNE_MAX_PARTITIIONING_CANDIDATES.
+ */
+ unsigned int tune_4partitioning_candidate_limit;
+
+ /**
+ * @brief The dB threshold for stopping block search (-dblimit).
+ *
+ * This option is ineffective for HDR textures.
+ */
+ float tune_db_limit;
+
+ /**
+ * @brief The amount of overshoot needed to early-out mode 0 fast path.
+ *
+ * We have a fast-path for mode 0 (1 partition, 1 plane) which uses only essential block modes
+ * as an initial search. This can short-cut compression for simple blocks, but to avoid
+ * short-cutting too much we force this to overshoot the MSE threshold needed to hit the
+ * block-local db_limit e.g. 1.0 = no overshoot, 2.0 = need half the error to trigger.
+ */
+ float tune_mode0_mse_overshoot;
+
+ /**
+ * @brief The amount of overshoot needed to early-out refinement.
+ *
+ * The codec will refine block candidates iteratively to improve the encoding, based on the
+ * @c tune_refinement_limit count. Earlier implementations will use all refinement iterations,
+ * even if the target threshold is reached. This tuning parameter allows an early out, but with
+ * an overshoot MSE threshold. Setting this to 1.0 will early-out as soon as the target is hit,
+ * but does reduce image quality vs the default behavior of over-refinement.
+ */
+ float tune_refinement_mse_overshoot;
+
+ /**
+ * @brief The threshold for skipping 3.1/4.1 trials (-2partitionlimitfactor).
+ *
+ * This option is further scaled for normal maps, so it skips less often.
+ */
+ float tune_2_partition_early_out_limit_factor;
+
+ /**
+ * @brief The threshold for skipping 4.1 trials (-3partitionlimitfactor).
+ *
+ * This option is further scaled for normal maps, so it skips less often.
+ */
+ float tune_3_partition_early_out_limit_factor;
+
+ /**
+ * @brief The threshold for skipping two weight planes (-2planelimitcorrelation).
+ *
+ * This option is ineffective for normal maps.
+ */
+ float tune_2_plane_early_out_limit_correlation;
+
+#if defined(ASTCENC_DIAGNOSTICS)
+ /**
+ * @brief The path to save the diagnostic trace data to.
+ *
+ * This option is not part of the public API, and requires special builds
+ * of the library.
+ */
+ const char* trace_file_path;
+#endif
+};
+
+/**
+ * @brief An uncompressed 2D or 3D image.
+ *
+ * 3D image are passed in as an array of 2D slices. Each slice has identical
+ * size and color format.
+ */
+struct astcenc_image
+{
+ /** @brief The X dimension of the image, in texels. */
+ unsigned int dim_x;
+
+ /** @brief The Y dimension of the image, in texels. */
+ unsigned int dim_y;
+
+ /** @brief The Z dimension of the image, in texels. */
+ unsigned int dim_z;
+
+ /** @brief The data type per component. */
+ astcenc_type data_type;
+
+ /** @brief The array of 2D slices, of length @c dim_z. */
+ void** data;
+};
+
+/**
+ * @brief A block encoding metadata query result.
+ *
+ * If the block is an error block or a constant color block or an error block all fields other than
+ * the profile, block dimensions, and error/constant indicator will be zero.
+ */
+struct astcenc_block_info
+{
+ /** @brief The block encoding color profile. */
+ astcenc_profile profile;
+
+ /** @brief The number of texels in the X dimension. */
+ unsigned int block_x;
+
+ /** @brief The number of texels in the Y dimension. */
+ unsigned int block_y;
+
+ /** @brief The number of texel in the Z dimension. */
+ unsigned int block_z;
+
+ /** @brief The number of texels in the block. */
+ unsigned int texel_count;
+
+ /** @brief True if this block is an error block. */
+ bool is_error_block;
+
+ /** @brief True if this block is a constant color block. */
+ bool is_constant_block;
+
+ /** @brief True if this block is an HDR block. */
+ bool is_hdr_block;
+
+ /** @brief True if this block uses two weight planes. */
+ bool is_dual_plane_block;
+
+ /** @brief The number of partitions if not constant color. */
+ unsigned int partition_count;
+
+ /** @brief The partition index if 2 - 4 partitions used. */
+ unsigned int partition_index;
+
+ /** @brief The component index of the second plane if dual plane. */
+ unsigned int dual_plane_component;
+
+ /** @brief The color endpoint encoding mode for each partition. */
+ unsigned int color_endpoint_modes[4];
+
+ /** @brief The number of color endpoint quantization levels. */
+ unsigned int color_level_count;
+
+ /** @brief The number of weight quantization levels. */
+ unsigned int weight_level_count;
+
+ /** @brief The number of weights in the X dimension. */
+ unsigned int weight_x;
+
+ /** @brief The number of weights in the Y dimension. */
+ unsigned int weight_y;
+
+ /** @brief The number of weights in the Z dimension. */
+ unsigned int weight_z;
+
+ /** @brief The unpacked color endpoints for each partition. */
+ float color_endpoints[4][2][4];
+
+ /** @brief The per-texel interpolation weights for the block. */
+ float weight_values_plane1[216];
+
+ /** @brief The per-texel interpolation weights for the block. */
+ float weight_values_plane2[216];
+
+ /** @brief The per-texel partition assignments for the block. */
+ uint8_t partition_assignment[216];
+};
+
+/**
+ * Populate a codec config based on default settings.
+ *
+ * Power users can edit the returned config struct to fine tune before allocating the context.
+ *
+ * @param profile Color profile.
+ * @param block_x ASTC block size X dimension.
+ * @param block_y ASTC block size Y dimension.
+ * @param block_z ASTC block size Z dimension.
+ * @param quality Search quality preset / effort level. Either an
+ * @c ASTCENC_PRE_* value, or a effort level between 0
+ * and 100. Performance is not linear between 0 and 100.
+
+ * @param flags A valid set of @c ASTCENC_FLG_* flag bits.
+ * @param[out] config Output config struct to populate.
+ *
+ * @return @c ASTCENC_SUCCESS on success, or an error if the inputs are invalid
+ * either individually, or in combination.
+ */
+ASTCENC_PUBLIC astcenc_error astcenc_config_init(
+ astcenc_profile profile,
+ unsigned int block_x,
+ unsigned int block_y,
+ unsigned int block_z,
+ float quality,
+ unsigned int flags,
+ astcenc_config* config);
+
+/**
+ * @brief Allocate a new codec context based on a config.
+ *
+ * This function allocates all of the memory resources and threads needed by the codec. This can be
+ * slow, so it is recommended that contexts are reused to serially compress or decompress multiple
+ * images to amortize setup cost.
+ *
+ * Contexts can be allocated to support only decompression using the @c ASTCENC_FLG_DECOMPRESS_ONLY
+ * flag when creating the configuration. The compression functions will fail if invoked. For a
+ * decompress-only library build the @c ASTCENC_FLG_DECOMPRESS_ONLY flag must be set when creating
+ * any context.
+ *
+ * @param[in] config Codec config.
+ * @param thread_count Thread count to configure for.
+ * @param[out] context Location to store an opaque context pointer.
+ *
+ * @return @c ASTCENC_SUCCESS on success, or an error if context creation failed.
+ */
+ASTCENC_PUBLIC astcenc_error astcenc_context_alloc(
+ const astcenc_config* config,
+ unsigned int thread_count,
+ astcenc_context** context);
+
+/**
+ * @brief Compress an image.
+ *
+ * A single context can only compress or decompress a single image at a time.
+ *
+ * For a context configured for multi-threading, any set of the N threads can call this function.
+ * Work will be dynamically scheduled across the threads available. Each thread must have a unique
+ * @c thread_index.
+ *
+ * @param context Codec context.
+ * @param[in,out] image An input image, in 2D slices.
+ * @param swizzle Compression data swizzle, applied before compression.
+ * @param[out] data_out Pointer to output data array.
+ * @param data_len Length of the output data array.
+ * @param thread_index Thread index [0..N-1] of calling thread.
+ *
+ * @return @c ASTCENC_SUCCESS on success, or an error if compression failed.
+ */
+ASTCENC_PUBLIC astcenc_error astcenc_compress_image(
+ astcenc_context* context,
+ astcenc_image* image,
+ const astcenc_swizzle* swizzle,
+ uint8_t* data_out,
+ size_t data_len,
+ unsigned int thread_index);
+
+/**
+ * @brief Reset the codec state for a new compression.
+ *
+ * The caller is responsible for synchronizing threads in the worker thread pool. This function must
+ * only be called when all threads have exited the @c astcenc_compress_image() function for image N,
+ * but before any thread enters it for image N + 1.
+ *
+ * Calling this is not required (but won't hurt), if the context is created for single threaded use.
+ *
+ * @param context Codec context.
+ *
+ * @return @c ASTCENC_SUCCESS on success, or an error if reset failed.
+ */
+ASTCENC_PUBLIC astcenc_error astcenc_compress_reset(
+ astcenc_context* context);
+
+/**
+ * @brief Decompress an image.
+ *
+ * @param context Codec context.
+ * @param[in] data Pointer to compressed data.
+ * @param data_len Length of the compressed data, in bytes.
+ * @param[in,out] image_out Output image.
+ * @param swizzle Decompression data swizzle, applied after decompression.
+ * @param thread_index Thread index [0..N-1] of calling thread.
+ *
+ * @return @c ASTCENC_SUCCESS on success, or an error if decompression failed.
+ */
+ASTCENC_PUBLIC astcenc_error astcenc_decompress_image(
+ astcenc_context* context,
+ const uint8_t* data,
+ size_t data_len,
+ astcenc_image* image_out,
+ const astcenc_swizzle* swizzle,
+ unsigned int thread_index);
+
+/**
+ * @brief Reset the codec state for a new decompression.
+ *
+ * The caller is responsible for synchronizing threads in the worker thread pool. This function must
+ * only be called when all threads have exited the @c astcenc_decompress_image() function for image
+ * N, but before any thread enters it for image N + 1.
+ *
+ * Calling this is not required (but won't hurt), if the context is created for single threaded use.
+ *
+ * @param context Codec context.
+ *
+ * @return @c ASTCENC_SUCCESS on success, or an error if reset failed.
+ */
+ASTCENC_PUBLIC astcenc_error astcenc_decompress_reset(
+ astcenc_context* context);
+
+/**
+ * Free the compressor context.
+ *
+ * @param context The codec context.
+ */
+ASTCENC_PUBLIC void astcenc_context_free(
+ astcenc_context* context);
+
+/**
+ * @brief Provide a high level summary of a block's encoding.
+ *
+ * This feature is primarily useful for codec developers but may be useful for developers building
+ * advanced content packaging pipelines.
+ *
+ * @param context Codec context.
+ * @param data One block of compressed ASTC data.
+ * @param info The output info structure to populate.
+ *
+ * @return @c ASTCENC_SUCCESS if the block was decoded, or an error otherwise. Note that this
+ * function will return success even if the block itself was an error block encoding, as the
+ * decode was correctly handled.
+ */
+ASTCENC_PUBLIC astcenc_error astcenc_get_block_info(
+ astcenc_context* context,
+ const uint8_t data[16],
+ astcenc_block_info* info);
+
+/**
+ * @brief Get a printable string for specific status code.
+ *
+ * @param status The status value.
+ *
+ * @return A human readable nul-terminated string.
+ */
+ASTCENC_PUBLIC const char* astcenc_get_error_string(
+ astcenc_error status);
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_averages_and_directions.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_averages_and_directions.cpp
new file mode 100644
index 00000000000..d1f003844a3
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_averages_and_directions.cpp
@@ -0,0 +1,995 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Functions for finding dominant direction of a set of colors.
+ */
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+
+#include "astcenc_internal.h"
+
+#include <cassert>
+
+/**
+ * @brief Compute the average RGB color of each partition.
+ *
+ * The algorithm here uses a vectorized sequential scan and per-partition
+ * color accumulators, using select() to mask texel lanes in other partitions.
+ *
+ * We only accumulate sums for N-1 partitions during the scan; the value for
+ * the last partition can be computed given that we know the block-wide average
+ * already.
+ *
+ * Because of this we could reduce the loop iteration count so it "just" spans
+ * the max texel index needed for the N-1 partitions, which could need fewer
+ * iterations than the full block texel count. However, this makes the loop
+ * count erratic and causes more branch mispredictions so is a net loss.
+ *
+ * @param pi The partitioning to use.
+ * @param blk The block data to process.
+ * @param[out] averages The output averages. Unused partition indices will
+ * not be initialized, and lane<3> will be zero.
+ */
+static void compute_partition_averages_rgb(
+ const partition_info& pi,
+ const image_block& blk,
+ vfloat4 averages[BLOCK_MAX_PARTITIONS]
+) {
+ unsigned int partition_count = pi.partition_count;
+ unsigned int texel_count = blk.texel_count;
+ promise(texel_count > 0);
+
+ // For 1 partition just use the precomputed mean
+ if (partition_count == 1)
+ {
+ averages[0] = blk.data_mean.swz<0, 1, 2>();
+ }
+ // For 2 partitions scan results for partition 0, compute partition 1
+ else if (partition_count == 2)
+ {
+ vfloatacc pp_avg_rgb[3] {};
+
+ vint lane_id = vint::lane_id();
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vint texel_partition(pi.partition_of_texel + i);
+
+ vmask lane_mask = lane_id < vint(texel_count);
+ lane_id += vint(ASTCENC_SIMD_WIDTH);
+
+ vmask p0_mask = lane_mask & (texel_partition == vint(0));
+
+ vfloat data_r = loada(blk.data_r + i);
+ haccumulate(pp_avg_rgb[0], data_r, p0_mask);
+
+ vfloat data_g = loada(blk.data_g + i);
+ haccumulate(pp_avg_rgb[1], data_g, p0_mask);
+
+ vfloat data_b = loada(blk.data_b + i);
+ haccumulate(pp_avg_rgb[2], data_b, p0_mask);
+ }
+
+ vfloat4 block_total = blk.data_mean.swz<0, 1, 2>() * static_cast<float>(blk.texel_count);
+
+ vfloat4 p0_total = vfloat3(hadd_s(pp_avg_rgb[0]),
+ hadd_s(pp_avg_rgb[1]),
+ hadd_s(pp_avg_rgb[2]));
+
+ vfloat4 p1_total = block_total - p0_total;
+
+ averages[0] = p0_total / static_cast<float>(pi.partition_texel_count[0]);
+ averages[1] = p1_total / static_cast<float>(pi.partition_texel_count[1]);
+ }
+ // For 3 partitions scan results for partition 0/1, compute partition 2
+ else if (partition_count == 3)
+ {
+ vfloatacc pp_avg_rgb[2][3] {};
+
+ vint lane_id = vint::lane_id();
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vint texel_partition(pi.partition_of_texel + i);
+
+ vmask lane_mask = lane_id < vint(texel_count);
+ lane_id += vint(ASTCENC_SIMD_WIDTH);
+
+ vmask p0_mask = lane_mask & (texel_partition == vint(0));
+ vmask p1_mask = lane_mask & (texel_partition == vint(1));
+
+ vfloat data_r = loada(blk.data_r + i);
+ haccumulate(pp_avg_rgb[0][0], data_r, p0_mask);
+ haccumulate(pp_avg_rgb[1][0], data_r, p1_mask);
+
+ vfloat data_g = loada(blk.data_g + i);
+ haccumulate(pp_avg_rgb[0][1], data_g, p0_mask);
+ haccumulate(pp_avg_rgb[1][1], data_g, p1_mask);
+
+ vfloat data_b = loada(blk.data_b + i);
+ haccumulate(pp_avg_rgb[0][2], data_b, p0_mask);
+ haccumulate(pp_avg_rgb[1][2], data_b, p1_mask);
+ }
+
+ vfloat4 block_total = blk.data_mean.swz<0, 1, 2>() * static_cast<float>(blk.texel_count);
+
+ vfloat4 p0_total = vfloat3(hadd_s(pp_avg_rgb[0][0]),
+ hadd_s(pp_avg_rgb[0][1]),
+ hadd_s(pp_avg_rgb[0][2]));
+
+ vfloat4 p1_total = vfloat3(hadd_s(pp_avg_rgb[1][0]),
+ hadd_s(pp_avg_rgb[1][1]),
+ hadd_s(pp_avg_rgb[1][2]));
+
+ vfloat4 p2_total = block_total - p0_total - p1_total;
+
+ averages[0] = p0_total / static_cast<float>(pi.partition_texel_count[0]);
+ averages[1] = p1_total / static_cast<float>(pi.partition_texel_count[1]);
+ averages[2] = p2_total / static_cast<float>(pi.partition_texel_count[2]);
+ }
+ else
+ {
+ // For 4 partitions scan results for partition 0/1/2, compute partition 3
+ vfloatacc pp_avg_rgb[3][3] {};
+
+ vint lane_id = vint::lane_id();
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vint texel_partition(pi.partition_of_texel + i);
+
+ vmask lane_mask = lane_id < vint(texel_count);
+ lane_id += vint(ASTCENC_SIMD_WIDTH);
+
+ vmask p0_mask = lane_mask & (texel_partition == vint(0));
+ vmask p1_mask = lane_mask & (texel_partition == vint(1));
+ vmask p2_mask = lane_mask & (texel_partition == vint(2));
+
+ vfloat data_r = loada(blk.data_r + i);
+ haccumulate(pp_avg_rgb[0][0], data_r, p0_mask);
+ haccumulate(pp_avg_rgb[1][0], data_r, p1_mask);
+ haccumulate(pp_avg_rgb[2][0], data_r, p2_mask);
+
+ vfloat data_g = loada(blk.data_g + i);
+ haccumulate(pp_avg_rgb[0][1], data_g, p0_mask);
+ haccumulate(pp_avg_rgb[1][1], data_g, p1_mask);
+ haccumulate(pp_avg_rgb[2][1], data_g, p2_mask);
+
+ vfloat data_b = loada(blk.data_b + i);
+ haccumulate(pp_avg_rgb[0][2], data_b, p0_mask);
+ haccumulate(pp_avg_rgb[1][2], data_b, p1_mask);
+ haccumulate(pp_avg_rgb[2][2], data_b, p2_mask);
+ }
+
+ vfloat4 block_total = blk.data_mean.swz<0, 1, 2>() * static_cast<float>(blk.texel_count);
+
+ vfloat4 p0_total = vfloat3(hadd_s(pp_avg_rgb[0][0]),
+ hadd_s(pp_avg_rgb[0][1]),
+ hadd_s(pp_avg_rgb[0][2]));
+
+ vfloat4 p1_total = vfloat3(hadd_s(pp_avg_rgb[1][0]),
+ hadd_s(pp_avg_rgb[1][1]),
+ hadd_s(pp_avg_rgb[1][2]));
+
+ vfloat4 p2_total = vfloat3(hadd_s(pp_avg_rgb[2][0]),
+ hadd_s(pp_avg_rgb[2][1]),
+ hadd_s(pp_avg_rgb[2][2]));
+
+ vfloat4 p3_total = block_total - p0_total - p1_total- p2_total;
+
+ averages[0] = p0_total / static_cast<float>(pi.partition_texel_count[0]);
+ averages[1] = p1_total / static_cast<float>(pi.partition_texel_count[1]);
+ averages[2] = p2_total / static_cast<float>(pi.partition_texel_count[2]);
+ averages[3] = p3_total / static_cast<float>(pi.partition_texel_count[3]);
+ }
+}
+
+/**
+ * @brief Compute the average RGBA color of each partition.
+ *
+ * The algorithm here uses a vectorized sequential scan and per-partition
+ * color accumulators, using select() to mask texel lanes in other partitions.
+ *
+ * We only accumulate sums for N-1 partitions during the scan; the value for
+ * the last partition can be computed given that we know the block-wide average
+ * already.
+ *
+ * Because of this we could reduce the loop iteration count so it "just" spans
+ * the max texel index needed for the N-1 partitions, which could need fewer
+ * iterations than the full block texel count. However, this makes the loop
+ * count erratic and causes more branch mispredictions so is a net loss.
+ *
+ * @param pi The partitioning to use.
+ * @param blk The block data to process.
+ * @param[out] averages The output averages. Unused partition indices will
+ * not be initialized.
+ */
+static void compute_partition_averages_rgba(
+ const partition_info& pi,
+ const image_block& blk,
+ vfloat4 averages[BLOCK_MAX_PARTITIONS]
+) {
+ unsigned int partition_count = pi.partition_count;
+ unsigned int texel_count = blk.texel_count;
+ promise(texel_count > 0);
+
+ // For 1 partition just use the precomputed mean
+ if (partition_count == 1)
+ {
+ averages[0] = blk.data_mean;
+ }
+ // For 2 partitions scan results for partition 0, compute partition 1
+ else if (partition_count == 2)
+ {
+ vfloat4 pp_avg_rgba[4] {};
+
+ vint lane_id = vint::lane_id();
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vint texel_partition(pi.partition_of_texel + i);
+
+ vmask lane_mask = lane_id < vint(texel_count);
+ lane_id += vint(ASTCENC_SIMD_WIDTH);
+
+ vmask p0_mask = lane_mask & (texel_partition == vint(0));
+
+ vfloat data_r = loada(blk.data_r + i);
+ haccumulate(pp_avg_rgba[0], data_r, p0_mask);
+
+ vfloat data_g = loada(blk.data_g + i);
+ haccumulate(pp_avg_rgba[1], data_g, p0_mask);
+
+ vfloat data_b = loada(blk.data_b + i);
+ haccumulate(pp_avg_rgba[2], data_b, p0_mask);
+
+ vfloat data_a = loada(blk.data_a + i);
+ haccumulate(pp_avg_rgba[3], data_a, p0_mask);
+ }
+
+ vfloat4 block_total = blk.data_mean * static_cast<float>(blk.texel_count);
+
+ vfloat4 p0_total = vfloat4(hadd_s(pp_avg_rgba[0]),
+ hadd_s(pp_avg_rgba[1]),
+ hadd_s(pp_avg_rgba[2]),
+ hadd_s(pp_avg_rgba[3]));
+
+ vfloat4 p1_total = block_total - p0_total;
+
+ averages[0] = p0_total / static_cast<float>(pi.partition_texel_count[0]);
+ averages[1] = p1_total / static_cast<float>(pi.partition_texel_count[1]);
+ }
+ // For 3 partitions scan results for partition 0/1, compute partition 2
+ else if (partition_count == 3)
+ {
+ vfloat4 pp_avg_rgba[2][4] {};
+
+ vint lane_id = vint::lane_id();
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vint texel_partition(pi.partition_of_texel + i);
+
+ vmask lane_mask = lane_id < vint(texel_count);
+ lane_id += vint(ASTCENC_SIMD_WIDTH);
+
+ vmask p0_mask = lane_mask & (texel_partition == vint(0));
+ vmask p1_mask = lane_mask & (texel_partition == vint(1));
+
+ vfloat data_r = loada(blk.data_r + i);
+ haccumulate(pp_avg_rgba[0][0], data_r, p0_mask);
+ haccumulate(pp_avg_rgba[1][0], data_r, p1_mask);
+
+ vfloat data_g = loada(blk.data_g + i);
+ haccumulate(pp_avg_rgba[0][1], data_g, p0_mask);
+ haccumulate(pp_avg_rgba[1][1], data_g, p1_mask);
+
+ vfloat data_b = loada(blk.data_b + i);
+ haccumulate(pp_avg_rgba[0][2], data_b, p0_mask);
+ haccumulate(pp_avg_rgba[1][2], data_b, p1_mask);
+
+ vfloat data_a = loada(blk.data_a + i);
+ haccumulate(pp_avg_rgba[0][3], data_a, p0_mask);
+ haccumulate(pp_avg_rgba[1][3], data_a, p1_mask);
+ }
+
+ vfloat4 block_total = blk.data_mean * static_cast<float>(blk.texel_count);
+
+ vfloat4 p0_total = vfloat4(hadd_s(pp_avg_rgba[0][0]),
+ hadd_s(pp_avg_rgba[0][1]),
+ hadd_s(pp_avg_rgba[0][2]),
+ hadd_s(pp_avg_rgba[0][3]));
+
+ vfloat4 p1_total = vfloat4(hadd_s(pp_avg_rgba[1][0]),
+ hadd_s(pp_avg_rgba[1][1]),
+ hadd_s(pp_avg_rgba[1][2]),
+ hadd_s(pp_avg_rgba[1][3]));
+
+ vfloat4 p2_total = block_total - p0_total - p1_total;
+
+ averages[0] = p0_total / static_cast<float>(pi.partition_texel_count[0]);
+ averages[1] = p1_total / static_cast<float>(pi.partition_texel_count[1]);
+ averages[2] = p2_total / static_cast<float>(pi.partition_texel_count[2]);
+ }
+ else
+ {
+ // For 4 partitions scan results for partition 0/1/2, compute partition 3
+ vfloat4 pp_avg_rgba[3][4] {};
+
+ vint lane_id = vint::lane_id();
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vint texel_partition(pi.partition_of_texel + i);
+
+ vmask lane_mask = lane_id < vint(texel_count);
+ lane_id += vint(ASTCENC_SIMD_WIDTH);
+
+ vmask p0_mask = lane_mask & (texel_partition == vint(0));
+ vmask p1_mask = lane_mask & (texel_partition == vint(1));
+ vmask p2_mask = lane_mask & (texel_partition == vint(2));
+
+ vfloat data_r = loada(blk.data_r + i);
+ haccumulate(pp_avg_rgba[0][0], data_r, p0_mask);
+ haccumulate(pp_avg_rgba[1][0], data_r, p1_mask);
+ haccumulate(pp_avg_rgba[2][0], data_r, p2_mask);
+
+ vfloat data_g = loada(blk.data_g + i);
+ haccumulate(pp_avg_rgba[0][1], data_g, p0_mask);
+ haccumulate(pp_avg_rgba[1][1], data_g, p1_mask);
+ haccumulate(pp_avg_rgba[2][1], data_g, p2_mask);
+
+ vfloat data_b = loada(blk.data_b + i);
+ haccumulate(pp_avg_rgba[0][2], data_b, p0_mask);
+ haccumulate(pp_avg_rgba[1][2], data_b, p1_mask);
+ haccumulate(pp_avg_rgba[2][2], data_b, p2_mask);
+
+ vfloat data_a = loada(blk.data_a + i);
+ haccumulate(pp_avg_rgba[0][3], data_a, p0_mask);
+ haccumulate(pp_avg_rgba[1][3], data_a, p1_mask);
+ haccumulate(pp_avg_rgba[2][3], data_a, p2_mask);
+ }
+
+ vfloat4 block_total = blk.data_mean * static_cast<float>(blk.texel_count);
+
+ vfloat4 p0_total = vfloat4(hadd_s(pp_avg_rgba[0][0]),
+ hadd_s(pp_avg_rgba[0][1]),
+ hadd_s(pp_avg_rgba[0][2]),
+ hadd_s(pp_avg_rgba[0][3]));
+
+ vfloat4 p1_total = vfloat4(hadd_s(pp_avg_rgba[1][0]),
+ hadd_s(pp_avg_rgba[1][1]),
+ hadd_s(pp_avg_rgba[1][2]),
+ hadd_s(pp_avg_rgba[1][3]));
+
+ vfloat4 p2_total = vfloat4(hadd_s(pp_avg_rgba[2][0]),
+ hadd_s(pp_avg_rgba[2][1]),
+ hadd_s(pp_avg_rgba[2][2]),
+ hadd_s(pp_avg_rgba[2][3]));
+
+ vfloat4 p3_total = block_total - p0_total - p1_total- p2_total;
+
+ averages[0] = p0_total / static_cast<float>(pi.partition_texel_count[0]);
+ averages[1] = p1_total / static_cast<float>(pi.partition_texel_count[1]);
+ averages[2] = p2_total / static_cast<float>(pi.partition_texel_count[2]);
+ averages[3] = p3_total / static_cast<float>(pi.partition_texel_count[3]);
+ }
+}
+
+/* See header for documentation. */
+void compute_avgs_and_dirs_4_comp(
+ const partition_info& pi,
+ const image_block& blk,
+ partition_metrics pm[BLOCK_MAX_PARTITIONS]
+) {
+ int partition_count = pi.partition_count;
+ promise(partition_count > 0);
+
+ // Pre-compute partition_averages
+ vfloat4 partition_averages[BLOCK_MAX_PARTITIONS];
+ compute_partition_averages_rgba(pi, blk, partition_averages);
+
+ for (int partition = 0; partition < partition_count; partition++)
+ {
+ const uint8_t *texel_indexes = pi.texels_of_partition[partition];
+ unsigned int texel_count = pi.partition_texel_count[partition];
+ promise(texel_count > 0);
+
+ vfloat4 average = partition_averages[partition];
+ pm[partition].avg = average;
+
+ vfloat4 sum_xp = vfloat4::zero();
+ vfloat4 sum_yp = vfloat4::zero();
+ vfloat4 sum_zp = vfloat4::zero();
+ vfloat4 sum_wp = vfloat4::zero();
+
+ for (unsigned int i = 0; i < texel_count; i++)
+ {
+ unsigned int iwt = texel_indexes[i];
+ vfloat4 texel_datum = blk.texel(iwt);
+ texel_datum = texel_datum - average;
+
+ vfloat4 zero = vfloat4::zero();
+
+ vmask4 tdm0 = texel_datum.swz<0,0,0,0>() > zero;
+ sum_xp += select(zero, texel_datum, tdm0);
+
+ vmask4 tdm1 = texel_datum.swz<1,1,1,1>() > zero;
+ sum_yp += select(zero, texel_datum, tdm1);
+
+ vmask4 tdm2 = texel_datum.swz<2,2,2,2>() > zero;
+ sum_zp += select(zero, texel_datum, tdm2);
+
+ vmask4 tdm3 = texel_datum.swz<3,3,3,3>() > zero;
+ sum_wp += select(zero, texel_datum, tdm3);
+ }
+
+ vfloat4 prod_xp = dot(sum_xp, sum_xp);
+ vfloat4 prod_yp = dot(sum_yp, sum_yp);
+ vfloat4 prod_zp = dot(sum_zp, sum_zp);
+ vfloat4 prod_wp = dot(sum_wp, sum_wp);
+
+ vfloat4 best_vector = sum_xp;
+ vfloat4 best_sum = prod_xp;
+
+ vmask4 mask = prod_yp > best_sum;
+ best_vector = select(best_vector, sum_yp, mask);
+ best_sum = select(best_sum, prod_yp, mask);
+
+ mask = prod_zp > best_sum;
+ best_vector = select(best_vector, sum_zp, mask);
+ best_sum = select(best_sum, prod_zp, mask);
+
+ mask = prod_wp > best_sum;
+ best_vector = select(best_vector, sum_wp, mask);
+
+ pm[partition].dir = best_vector;
+ }
+}
+
+/* See header for documentation. */
+void compute_avgs_and_dirs_3_comp(
+ const partition_info& pi,
+ const image_block& blk,
+ unsigned int omitted_component,
+ partition_metrics pm[BLOCK_MAX_PARTITIONS]
+) {
+ // Pre-compute partition_averages
+ vfloat4 partition_averages[BLOCK_MAX_PARTITIONS];
+ compute_partition_averages_rgba(pi, blk, partition_averages);
+
+ const float* data_vr = blk.data_r;
+ const float* data_vg = blk.data_g;
+ const float* data_vb = blk.data_b;
+
+ // TODO: Data-driven permute would be useful to avoid this ...
+ if (omitted_component == 0)
+ {
+ partition_averages[0] = partition_averages[0].swz<1, 2, 3>();
+ partition_averages[1] = partition_averages[1].swz<1, 2, 3>();
+ partition_averages[2] = partition_averages[2].swz<1, 2, 3>();
+ partition_averages[3] = partition_averages[3].swz<1, 2, 3>();
+
+ data_vr = blk.data_g;
+ data_vg = blk.data_b;
+ data_vb = blk.data_a;
+ }
+ else if (omitted_component == 1)
+ {
+ partition_averages[0] = partition_averages[0].swz<0, 2, 3>();
+ partition_averages[1] = partition_averages[1].swz<0, 2, 3>();
+ partition_averages[2] = partition_averages[2].swz<0, 2, 3>();
+ partition_averages[3] = partition_averages[3].swz<0, 2, 3>();
+
+ data_vg = blk.data_b;
+ data_vb = blk.data_a;
+ }
+ else if (omitted_component == 2)
+ {
+ partition_averages[0] = partition_averages[0].swz<0, 1, 3>();
+ partition_averages[1] = partition_averages[1].swz<0, 1, 3>();
+ partition_averages[2] = partition_averages[2].swz<0, 1, 3>();
+ partition_averages[3] = partition_averages[3].swz<0, 1, 3>();
+
+ data_vb = blk.data_a;
+ }
+ else
+ {
+ partition_averages[0] = partition_averages[0].swz<0, 1, 2>();
+ partition_averages[1] = partition_averages[1].swz<0, 1, 2>();
+ partition_averages[2] = partition_averages[2].swz<0, 1, 2>();
+ partition_averages[3] = partition_averages[3].swz<0, 1, 2>();
+ }
+
+ unsigned int partition_count = pi.partition_count;
+ promise(partition_count > 0);
+
+ for (unsigned int partition = 0; partition < partition_count; partition++)
+ {
+ const uint8_t *texel_indexes = pi.texels_of_partition[partition];
+ unsigned int texel_count = pi.partition_texel_count[partition];
+ promise(texel_count > 0);
+
+ vfloat4 average = partition_averages[partition];
+ pm[partition].avg = average;
+
+ vfloat4 sum_xp = vfloat4::zero();
+ vfloat4 sum_yp = vfloat4::zero();
+ vfloat4 sum_zp = vfloat4::zero();
+
+ for (unsigned int i = 0; i < texel_count; i++)
+ {
+ unsigned int iwt = texel_indexes[i];
+
+ vfloat4 texel_datum = vfloat3(data_vr[iwt],
+ data_vg[iwt],
+ data_vb[iwt]);
+ texel_datum = texel_datum - average;
+
+ vfloat4 zero = vfloat4::zero();
+
+ vmask4 tdm0 = texel_datum.swz<0,0,0,0>() > zero;
+ sum_xp += select(zero, texel_datum, tdm0);
+
+ vmask4 tdm1 = texel_datum.swz<1,1,1,1>() > zero;
+ sum_yp += select(zero, texel_datum, tdm1);
+
+ vmask4 tdm2 = texel_datum.swz<2,2,2,2>() > zero;
+ sum_zp += select(zero, texel_datum, tdm2);
+ }
+
+ vfloat4 prod_xp = dot(sum_xp, sum_xp);
+ vfloat4 prod_yp = dot(sum_yp, sum_yp);
+ vfloat4 prod_zp = dot(sum_zp, sum_zp);
+
+ vfloat4 best_vector = sum_xp;
+ vfloat4 best_sum = prod_xp;
+
+ vmask4 mask = prod_yp > best_sum;
+ best_vector = select(best_vector, sum_yp, mask);
+ best_sum = select(best_sum, prod_yp, mask);
+
+ mask = prod_zp > best_sum;
+ best_vector = select(best_vector, sum_zp, mask);
+
+ pm[partition].dir = best_vector;
+ }
+}
+
+/* See header for documentation. */
+void compute_avgs_and_dirs_3_comp_rgb(
+ const partition_info& pi,
+ const image_block& blk,
+ partition_metrics pm[BLOCK_MAX_PARTITIONS]
+) {
+ unsigned int partition_count = pi.partition_count;
+ promise(partition_count > 0);
+
+ // Pre-compute partition_averages
+ vfloat4 partition_averages[BLOCK_MAX_PARTITIONS];
+ compute_partition_averages_rgb(pi, blk, partition_averages);
+
+ for (unsigned int partition = 0; partition < partition_count; partition++)
+ {
+ const uint8_t *texel_indexes = pi.texels_of_partition[partition];
+ unsigned int texel_count = pi.partition_texel_count[partition];
+ promise(texel_count > 0);
+
+ vfloat4 average = partition_averages[partition];
+ pm[partition].avg = average;
+
+ vfloat4 sum_xp = vfloat4::zero();
+ vfloat4 sum_yp = vfloat4::zero();
+ vfloat4 sum_zp = vfloat4::zero();
+
+ for (unsigned int i = 0; i < texel_count; i++)
+ {
+ unsigned int iwt = texel_indexes[i];
+
+ vfloat4 texel_datum = blk.texel3(iwt);
+ texel_datum = texel_datum - average;
+
+ vfloat4 zero = vfloat4::zero();
+
+ vmask4 tdm0 = texel_datum.swz<0,0,0,0>() > zero;
+ sum_xp += select(zero, texel_datum, tdm0);
+
+ vmask4 tdm1 = texel_datum.swz<1,1,1,1>() > zero;
+ sum_yp += select(zero, texel_datum, tdm1);
+
+ vmask4 tdm2 = texel_datum.swz<2,2,2,2>() > zero;
+ sum_zp += select(zero, texel_datum, tdm2);
+ }
+
+ vfloat4 prod_xp = dot(sum_xp, sum_xp);
+ vfloat4 prod_yp = dot(sum_yp, sum_yp);
+ vfloat4 prod_zp = dot(sum_zp, sum_zp);
+
+ vfloat4 best_vector = sum_xp;
+ vfloat4 best_sum = prod_xp;
+
+ vmask4 mask = prod_yp > best_sum;
+ best_vector = select(best_vector, sum_yp, mask);
+ best_sum = select(best_sum, prod_yp, mask);
+
+ mask = prod_zp > best_sum;
+ best_vector = select(best_vector, sum_zp, mask);
+
+ pm[partition].dir = best_vector;
+ }
+}
+
+/* See header for documentation. */
+void compute_avgs_and_dirs_2_comp(
+ const partition_info& pt,
+ const image_block& blk,
+ unsigned int component1,
+ unsigned int component2,
+ partition_metrics pm[BLOCK_MAX_PARTITIONS]
+) {
+ vfloat4 average;
+
+ const float* data_vr = nullptr;
+ const float* data_vg = nullptr;
+
+ if (component1 == 0 && component2 == 1)
+ {
+ average = blk.data_mean.swz<0, 1>();
+
+ data_vr = blk.data_r;
+ data_vg = blk.data_g;
+ }
+ else if (component1 == 0 && component2 == 2)
+ {
+ average = blk.data_mean.swz<0, 2>();
+
+ data_vr = blk.data_r;
+ data_vg = blk.data_b;
+ }
+ else // (component1 == 1 && component2 == 2)
+ {
+ assert(component1 == 1 && component2 == 2);
+
+ average = blk.data_mean.swz<1, 2>();
+
+ data_vr = blk.data_g;
+ data_vg = blk.data_b;
+ }
+
+ unsigned int partition_count = pt.partition_count;
+ promise(partition_count > 0);
+
+ for (unsigned int partition = 0; partition < partition_count; partition++)
+ {
+ const uint8_t *texel_indexes = pt.texels_of_partition[partition];
+ unsigned int texel_count = pt.partition_texel_count[partition];
+ promise(texel_count > 0);
+
+ // Only compute a partition mean if more than one partition
+ if (partition_count > 1)
+ {
+ average = vfloat4::zero();
+ for (unsigned int i = 0; i < texel_count; i++)
+ {
+ unsigned int iwt = texel_indexes[i];
+ average += vfloat2(data_vr[iwt], data_vg[iwt]);
+ }
+
+ average = average / static_cast<float>(texel_count);
+ }
+
+ pm[partition].avg = average;
+
+ vfloat4 sum_xp = vfloat4::zero();
+ vfloat4 sum_yp = vfloat4::zero();
+
+ for (unsigned int i = 0; i < texel_count; i++)
+ {
+ unsigned int iwt = texel_indexes[i];
+ vfloat4 texel_datum = vfloat2(data_vr[iwt], data_vg[iwt]);
+ texel_datum = texel_datum - average;
+
+ vfloat4 zero = vfloat4::zero();
+
+ vmask4 tdm0 = texel_datum.swz<0,0,0,0>() > zero;
+ sum_xp += select(zero, texel_datum, tdm0);
+
+ vmask4 tdm1 = texel_datum.swz<1,1,1,1>() > zero;
+ sum_yp += select(zero, texel_datum, tdm1);
+ }
+
+ vfloat4 prod_xp = dot(sum_xp, sum_xp);
+ vfloat4 prod_yp = dot(sum_yp, sum_yp);
+
+ vfloat4 best_vector = sum_xp;
+ vfloat4 best_sum = prod_xp;
+
+ vmask4 mask = prod_yp > best_sum;
+ best_vector = select(best_vector, sum_yp, mask);
+
+ pm[partition].dir = best_vector;
+ }
+}
+
+/* See header for documentation. */
+void compute_error_squared_rgba(
+ const partition_info& pi,
+ const image_block& blk,
+ const processed_line4 uncor_plines[BLOCK_MAX_PARTITIONS],
+ const processed_line4 samec_plines[BLOCK_MAX_PARTITIONS],
+ float uncor_lengths[BLOCK_MAX_PARTITIONS],
+ float samec_lengths[BLOCK_MAX_PARTITIONS],
+ float& uncor_error,
+ float& samec_error
+) {
+ unsigned int partition_count = pi.partition_count;
+ promise(partition_count > 0);
+
+ vfloatacc uncor_errorsumv = vfloatacc::zero();
+ vfloatacc samec_errorsumv = vfloatacc::zero();
+
+ for (unsigned int partition = 0; partition < partition_count; partition++)
+ {
+ const uint8_t *texel_indexes = pi.texels_of_partition[partition];
+
+ float uncor_loparam = 1e10f;
+ float uncor_hiparam = -1e10f;
+
+ float samec_loparam = 1e10f;
+ float samec_hiparam = -1e10f;
+
+ processed_line4 l_uncor = uncor_plines[partition];
+ processed_line4 l_samec = samec_plines[partition];
+
+ unsigned int texel_count = pi.partition_texel_count[partition];
+ promise(texel_count > 0);
+
+ // Vectorize some useful scalar inputs
+ vfloat l_uncor_bs0(l_uncor.bs.lane<0>());
+ vfloat l_uncor_bs1(l_uncor.bs.lane<1>());
+ vfloat l_uncor_bs2(l_uncor.bs.lane<2>());
+ vfloat l_uncor_bs3(l_uncor.bs.lane<3>());
+
+ vfloat l_uncor_amod0(l_uncor.amod.lane<0>());
+ vfloat l_uncor_amod1(l_uncor.amod.lane<1>());
+ vfloat l_uncor_amod2(l_uncor.amod.lane<2>());
+ vfloat l_uncor_amod3(l_uncor.amod.lane<3>());
+
+ vfloat l_samec_bs0(l_samec.bs.lane<0>());
+ vfloat l_samec_bs1(l_samec.bs.lane<1>());
+ vfloat l_samec_bs2(l_samec.bs.lane<2>());
+ vfloat l_samec_bs3(l_samec.bs.lane<3>());
+
+ assert(all(l_samec.amod == vfloat4(0.0f)));
+
+ vfloat uncor_loparamv(1e10f);
+ vfloat uncor_hiparamv(-1e10f);
+
+ vfloat samec_loparamv(1e10f);
+ vfloat samec_hiparamv(-1e10f);
+
+ vfloat ew_r(blk.channel_weight.lane<0>());
+ vfloat ew_g(blk.channel_weight.lane<1>());
+ vfloat ew_b(blk.channel_weight.lane<2>());
+ vfloat ew_a(blk.channel_weight.lane<3>());
+
+ // This implementation over-shoots, but this is safe as we initialize the texel_indexes
+ // array to extend the last value. This means min/max are not impacted, but we need to mask
+ // out the dummy values when we compute the line weighting.
+ vint lane_ids = vint::lane_id();
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vmask mask = lane_ids < vint(texel_count);
+ vint texel_idxs(texel_indexes + i);
+
+ vfloat data_r = gatherf(blk.data_r, texel_idxs);
+ vfloat data_g = gatherf(blk.data_g, texel_idxs);
+ vfloat data_b = gatherf(blk.data_b, texel_idxs);
+ vfloat data_a = gatherf(blk.data_a, texel_idxs);
+
+ vfloat uncor_param = (data_r * l_uncor_bs0)
+ + (data_g * l_uncor_bs1)
+ + (data_b * l_uncor_bs2)
+ + (data_a * l_uncor_bs3);
+
+ uncor_loparamv = min(uncor_param, uncor_loparamv);
+ uncor_hiparamv = max(uncor_param, uncor_hiparamv);
+
+ vfloat uncor_dist0 = (l_uncor_amod0 - data_r)
+ + (uncor_param * l_uncor_bs0);
+ vfloat uncor_dist1 = (l_uncor_amod1 - data_g)
+ + (uncor_param * l_uncor_bs1);
+ vfloat uncor_dist2 = (l_uncor_amod2 - data_b)
+ + (uncor_param * l_uncor_bs2);
+ vfloat uncor_dist3 = (l_uncor_amod3 - data_a)
+ + (uncor_param * l_uncor_bs3);
+
+ vfloat uncor_err = (ew_r * uncor_dist0 * uncor_dist0)
+ + (ew_g * uncor_dist1 * uncor_dist1)
+ + (ew_b * uncor_dist2 * uncor_dist2)
+ + (ew_a * uncor_dist3 * uncor_dist3);
+
+ haccumulate(uncor_errorsumv, uncor_err, mask);
+
+ // Process samechroma data
+ vfloat samec_param = (data_r * l_samec_bs0)
+ + (data_g * l_samec_bs1)
+ + (data_b * l_samec_bs2)
+ + (data_a * l_samec_bs3);
+
+ samec_loparamv = min(samec_param, samec_loparamv);
+ samec_hiparamv = max(samec_param, samec_hiparamv);
+
+ vfloat samec_dist0 = samec_param * l_samec_bs0 - data_r;
+ vfloat samec_dist1 = samec_param * l_samec_bs1 - data_g;
+ vfloat samec_dist2 = samec_param * l_samec_bs2 - data_b;
+ vfloat samec_dist3 = samec_param * l_samec_bs3 - data_a;
+
+ vfloat samec_err = (ew_r * samec_dist0 * samec_dist0)
+ + (ew_g * samec_dist1 * samec_dist1)
+ + (ew_b * samec_dist2 * samec_dist2)
+ + (ew_a * samec_dist3 * samec_dist3);
+
+ haccumulate(samec_errorsumv, samec_err, mask);
+
+ lane_ids += vint(ASTCENC_SIMD_WIDTH);
+ }
+
+ uncor_loparam = hmin_s(uncor_loparamv);
+ uncor_hiparam = hmax_s(uncor_hiparamv);
+
+ samec_loparam = hmin_s(samec_loparamv);
+ samec_hiparam = hmax_s(samec_hiparamv);
+
+ float uncor_linelen = uncor_hiparam - uncor_loparam;
+ float samec_linelen = samec_hiparam - samec_loparam;
+
+ // Turn very small numbers and NaNs into a small number
+ uncor_lengths[partition] = astc::max(uncor_linelen, 1e-7f);
+ samec_lengths[partition] = astc::max(samec_linelen, 1e-7f);
+ }
+
+ uncor_error = hadd_s(uncor_errorsumv);
+ samec_error = hadd_s(samec_errorsumv);
+}
+
+/* See header for documentation. */
+void compute_error_squared_rgb(
+ const partition_info& pi,
+ const image_block& blk,
+ partition_lines3 plines[BLOCK_MAX_PARTITIONS],
+ float& uncor_error,
+ float& samec_error
+) {
+ unsigned int partition_count = pi.partition_count;
+ promise(partition_count > 0);
+
+ vfloatacc uncor_errorsumv = vfloatacc::zero();
+ vfloatacc samec_errorsumv = vfloatacc::zero();
+
+ for (unsigned int partition = 0; partition < partition_count; partition++)
+ {
+ partition_lines3& pl = plines[partition];
+ const uint8_t *texel_indexes = pi.texels_of_partition[partition];
+ unsigned int texel_count = pi.partition_texel_count[partition];
+ promise(texel_count > 0);
+
+ float uncor_loparam = 1e10f;
+ float uncor_hiparam = -1e10f;
+
+ float samec_loparam = 1e10f;
+ float samec_hiparam = -1e10f;
+
+ processed_line3 l_uncor = pl.uncor_pline;
+ processed_line3 l_samec = pl.samec_pline;
+
+ // This implementation is an example vectorization of this function.
+ // It works for - the codec is a 2-4% faster than not vectorizing - but
+ // the benefit is limited by the use of gathers and register pressure
+
+ // Vectorize some useful scalar inputs
+ vfloat l_uncor_bs0(l_uncor.bs.lane<0>());
+ vfloat l_uncor_bs1(l_uncor.bs.lane<1>());
+ vfloat l_uncor_bs2(l_uncor.bs.lane<2>());
+
+ vfloat l_uncor_amod0(l_uncor.amod.lane<0>());
+ vfloat l_uncor_amod1(l_uncor.amod.lane<1>());
+ vfloat l_uncor_amod2(l_uncor.amod.lane<2>());
+
+ vfloat l_samec_bs0(l_samec.bs.lane<0>());
+ vfloat l_samec_bs1(l_samec.bs.lane<1>());
+ vfloat l_samec_bs2(l_samec.bs.lane<2>());
+
+ assert(all(l_samec.amod == vfloat4(0.0f)));
+
+ vfloat uncor_loparamv(1e10f);
+ vfloat uncor_hiparamv(-1e10f);
+
+ vfloat samec_loparamv(1e10f);
+ vfloat samec_hiparamv(-1e10f);
+
+ vfloat ew_r(blk.channel_weight.lane<0>());
+ vfloat ew_g(blk.channel_weight.lane<1>());
+ vfloat ew_b(blk.channel_weight.lane<2>());
+
+ // This implementation over-shoots, but this is safe as we initialize the weights array
+ // to extend the last value. This means min/max are not impacted, but we need to mask
+ // out the dummy values when we compute the line weighting.
+ vint lane_ids = vint::lane_id();
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vmask mask = lane_ids < vint(texel_count);
+ vint texel_idxs(texel_indexes + i);
+
+ vfloat data_r = gatherf(blk.data_r, texel_idxs);
+ vfloat data_g = gatherf(blk.data_g, texel_idxs);
+ vfloat data_b = gatherf(blk.data_b, texel_idxs);
+
+ vfloat uncor_param = (data_r * l_uncor_bs0)
+ + (data_g * l_uncor_bs1)
+ + (data_b * l_uncor_bs2);
+
+ uncor_loparamv = min(uncor_param, uncor_loparamv);
+ uncor_hiparamv = max(uncor_param, uncor_hiparamv);
+
+ vfloat uncor_dist0 = (l_uncor_amod0 - data_r)
+ + (uncor_param * l_uncor_bs0);
+ vfloat uncor_dist1 = (l_uncor_amod1 - data_g)
+ + (uncor_param * l_uncor_bs1);
+ vfloat uncor_dist2 = (l_uncor_amod2 - data_b)
+ + (uncor_param * l_uncor_bs2);
+
+ vfloat uncor_err = (ew_r * uncor_dist0 * uncor_dist0)
+ + (ew_g * uncor_dist1 * uncor_dist1)
+ + (ew_b * uncor_dist2 * uncor_dist2);
+
+ haccumulate(uncor_errorsumv, uncor_err, mask);
+
+ // Process samechroma data
+ vfloat samec_param = (data_r * l_samec_bs0)
+ + (data_g * l_samec_bs1)
+ + (data_b * l_samec_bs2);
+
+ samec_loparamv = min(samec_param, samec_loparamv);
+ samec_hiparamv = max(samec_param, samec_hiparamv);
+
+ vfloat samec_dist0 = samec_param * l_samec_bs0 - data_r;
+ vfloat samec_dist1 = samec_param * l_samec_bs1 - data_g;
+ vfloat samec_dist2 = samec_param * l_samec_bs2 - data_b;
+
+ vfloat samec_err = (ew_r * samec_dist0 * samec_dist0)
+ + (ew_g * samec_dist1 * samec_dist1)
+ + (ew_b * samec_dist2 * samec_dist2);
+
+ haccumulate(samec_errorsumv, samec_err, mask);
+
+ lane_ids += vint(ASTCENC_SIMD_WIDTH);
+ }
+
+ uncor_loparam = hmin_s(uncor_loparamv);
+ uncor_hiparam = hmax_s(uncor_hiparamv);
+
+ samec_loparam = hmin_s(samec_loparamv);
+ samec_hiparam = hmax_s(samec_hiparamv);
+
+ float uncor_linelen = uncor_hiparam - uncor_loparam;
+ float samec_linelen = samec_hiparam - samec_loparam;
+
+ // Turn very small numbers and NaNs into a small number
+ pl.uncor_line_len = astc::max(uncor_linelen, 1e-7f);
+ pl.samec_line_len = astc::max(samec_linelen, 1e-7f);
+ }
+
+ uncor_error = hadd_s(uncor_errorsumv);
+ samec_error = hadd_s(samec_errorsumv);
+}
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_block_sizes.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_block_sizes.cpp
new file mode 100644
index 00000000000..b3e2efb9155
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_block_sizes.cpp
@@ -0,0 +1,1210 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Functions to generate block size descriptor and decimation tables.
+ */
+
+#include "astcenc_internal.h"
+
+/**
+ * @brief Decode the properties of an encoded 2D block mode.
+ *
+ * @param block_mode The encoded block mode.
+ * @param[out] x_weights The number of weights in the X dimension.
+ * @param[out] y_weights The number of weights in the Y dimension.
+ * @param[out] is_dual_plane True if this block mode has two weight planes.
+ * @param[out] quant_mode The quantization level for the weights.
+ * @param[out] weight_bits The storage bit count for the weights.
+ *
+ * @return Returns true if a valid mode, false otherwise.
+ */
+static bool decode_block_mode_2d(
+ unsigned int block_mode,
+ unsigned int& x_weights,
+ unsigned int& y_weights,
+ bool& is_dual_plane,
+ unsigned int& quant_mode,
+ unsigned int& weight_bits
+) {
+ unsigned int base_quant_mode = (block_mode >> 4) & 1;
+ unsigned int H = (block_mode >> 9) & 1;
+ unsigned int D = (block_mode >> 10) & 1;
+ unsigned int A = (block_mode >> 5) & 0x3;
+
+ x_weights = 0;
+ y_weights = 0;
+
+ if ((block_mode & 3) != 0)
+ {
+ base_quant_mode |= (block_mode & 3) << 1;
+ unsigned int B = (block_mode >> 7) & 3;
+ switch ((block_mode >> 2) & 3)
+ {
+ case 0:
+ x_weights = B + 4;
+ y_weights = A + 2;
+ break;
+ case 1:
+ x_weights = B + 8;
+ y_weights = A + 2;
+ break;
+ case 2:
+ x_weights = A + 2;
+ y_weights = B + 8;
+ break;
+ case 3:
+ B &= 1;
+ if (block_mode & 0x100)
+ {
+ x_weights = B + 2;
+ y_weights = A + 2;
+ }
+ else
+ {
+ x_weights = A + 2;
+ y_weights = B + 6;
+ }
+ break;
+ }
+ }
+ else
+ {
+ base_quant_mode |= ((block_mode >> 2) & 3) << 1;
+ if (((block_mode >> 2) & 3) == 0)
+ {
+ return false;
+ }
+
+ unsigned int B = (block_mode >> 9) & 3;
+ switch ((block_mode >> 7) & 3)
+ {
+ case 0:
+ x_weights = 12;
+ y_weights = A + 2;
+ break;
+ case 1:
+ x_weights = A + 2;
+ y_weights = 12;
+ break;
+ case 2:
+ x_weights = A + 6;
+ y_weights = B + 6;
+ D = 0;
+ H = 0;
+ break;
+ case 3:
+ switch ((block_mode >> 5) & 3)
+ {
+ case 0:
+ x_weights = 6;
+ y_weights = 10;
+ break;
+ case 1:
+ x_weights = 10;
+ y_weights = 6;
+ break;
+ case 2:
+ case 3:
+ return false;
+ }
+ break;
+ }
+ }
+
+ unsigned int weight_count = x_weights * y_weights * (D + 1);
+ quant_mode = (base_quant_mode - 2) + 6 * H;
+ is_dual_plane = D != 0;
+
+ weight_bits = get_ise_sequence_bitcount(weight_count, static_cast<quant_method>(quant_mode));
+ return (weight_count <= BLOCK_MAX_WEIGHTS &&
+ weight_bits >= BLOCK_MIN_WEIGHT_BITS &&
+ weight_bits <= BLOCK_MAX_WEIGHT_BITS);
+}
+
+/**
+ * @brief Decode the properties of an encoded 3D block mode.
+ *
+ * @param block_mode The encoded block mode.
+ * @param[out] x_weights The number of weights in the X dimension.
+ * @param[out] y_weights The number of weights in the Y dimension.
+ * @param[out] z_weights The number of weights in the Z dimension.
+ * @param[out] is_dual_plane True if this block mode has two weight planes.
+ * @param[out] quant_mode The quantization level for the weights.
+ * @param[out] weight_bits The storage bit count for the weights.
+ *
+ * @return Returns true if a valid mode, false otherwise.
+ */
+static bool decode_block_mode_3d(
+ unsigned int block_mode,
+ unsigned int& x_weights,
+ unsigned int& y_weights,
+ unsigned int& z_weights,
+ bool& is_dual_plane,
+ unsigned int& quant_mode,
+ unsigned int& weight_bits
+) {
+ unsigned int base_quant_mode = (block_mode >> 4) & 1;
+ unsigned int H = (block_mode >> 9) & 1;
+ unsigned int D = (block_mode >> 10) & 1;
+ unsigned int A = (block_mode >> 5) & 0x3;
+
+ x_weights = 0;
+ y_weights = 0;
+ z_weights = 0;
+
+ if ((block_mode & 3) != 0)
+ {
+ base_quant_mode |= (block_mode & 3) << 1;
+ unsigned int B = (block_mode >> 7) & 3;
+ unsigned int C = (block_mode >> 2) & 0x3;
+ x_weights = A + 2;
+ y_weights = B + 2;
+ z_weights = C + 2;
+ }
+ else
+ {
+ base_quant_mode |= ((block_mode >> 2) & 3) << 1;
+ if (((block_mode >> 2) & 3) == 0)
+ {
+ return false;
+ }
+
+ int B = (block_mode >> 9) & 3;
+ if (((block_mode >> 7) & 3) != 3)
+ {
+ D = 0;
+ H = 0;
+ }
+ switch ((block_mode >> 7) & 3)
+ {
+ case 0:
+ x_weights = 6;
+ y_weights = B + 2;
+ z_weights = A + 2;
+ break;
+ case 1:
+ x_weights = A + 2;
+ y_weights = 6;
+ z_weights = B + 2;
+ break;
+ case 2:
+ x_weights = A + 2;
+ y_weights = B + 2;
+ z_weights = 6;
+ break;
+ case 3:
+ x_weights = 2;
+ y_weights = 2;
+ z_weights = 2;
+ switch ((block_mode >> 5) & 3)
+ {
+ case 0:
+ x_weights = 6;
+ break;
+ case 1:
+ y_weights = 6;
+ break;
+ case 2:
+ z_weights = 6;
+ break;
+ case 3:
+ return false;
+ }
+ break;
+ }
+ }
+
+ unsigned int weight_count = x_weights * y_weights * z_weights * (D + 1);
+ quant_mode = (base_quant_mode - 2) + 6 * H;
+ is_dual_plane = D != 0;
+
+ weight_bits = get_ise_sequence_bitcount(weight_count, static_cast<quant_method>(quant_mode));
+ return (weight_count <= BLOCK_MAX_WEIGHTS &&
+ weight_bits >= BLOCK_MIN_WEIGHT_BITS &&
+ weight_bits <= BLOCK_MAX_WEIGHT_BITS);
+}
+
+/**
+ * @brief Create a 2D decimation entry for a block-size and weight-decimation pair.
+ *
+ * @param x_texels The number of texels in the X dimension.
+ * @param y_texels The number of texels in the Y dimension.
+ * @param x_weights The number of weights in the X dimension.
+ * @param y_weights The number of weights in the Y dimension.
+ * @param[out] di The decimation info structure to populate.
+ * @param[out] wb The decimation table init scratch working buffers.
+ */
+static void init_decimation_info_2d(
+ unsigned int x_texels,
+ unsigned int y_texels,
+ unsigned int x_weights,
+ unsigned int y_weights,
+ decimation_info& di,
+ dt_init_working_buffers& wb
+) {
+ unsigned int texels_per_block = x_texels * y_texels;
+ unsigned int weights_per_block = x_weights * y_weights;
+
+ uint8_t max_texel_count_of_weight = 0;
+
+ promise(weights_per_block > 0);
+ promise(texels_per_block > 0);
+ promise(x_texels > 0);
+ promise(y_texels > 0);
+
+ for (unsigned int i = 0; i < weights_per_block; i++)
+ {
+ wb.texel_count_of_weight[i] = 0;
+ }
+
+ for (unsigned int i = 0; i < texels_per_block; i++)
+ {
+ wb.weight_count_of_texel[i] = 0;
+ }
+
+ for (unsigned int y = 0; y < y_texels; y++)
+ {
+ for (unsigned int x = 0; x < x_texels; x++)
+ {
+ unsigned int texel = y * x_texels + x;
+
+ unsigned int x_weight = (((1024 + x_texels / 2) / (x_texels - 1)) * x * (x_weights - 1) + 32) >> 6;
+ unsigned int y_weight = (((1024 + y_texels / 2) / (y_texels - 1)) * y * (y_weights - 1) + 32) >> 6;
+
+ unsigned int x_weight_frac = x_weight & 0xF;
+ unsigned int y_weight_frac = y_weight & 0xF;
+ unsigned int x_weight_int = x_weight >> 4;
+ unsigned int y_weight_int = y_weight >> 4;
+
+ unsigned int qweight[4];
+ qweight[0] = x_weight_int + y_weight_int * x_weights;
+ qweight[1] = qweight[0] + 1;
+ qweight[2] = qweight[0] + x_weights;
+ qweight[3] = qweight[2] + 1;
+
+ // Truncated-precision bilinear interpolation
+ unsigned int prod = x_weight_frac * y_weight_frac;
+
+ unsigned int weight[4];
+ weight[3] = (prod + 8) >> 4;
+ weight[1] = x_weight_frac - weight[3];
+ weight[2] = y_weight_frac - weight[3];
+ weight[0] = 16 - x_weight_frac - y_weight_frac + weight[3];
+
+ for (unsigned int i = 0; i < 4; i++)
+ {
+ if (weight[i] != 0)
+ {
+ wb.grid_weights_of_texel[texel][wb.weight_count_of_texel[texel]] = static_cast<uint8_t>(qweight[i]);
+ wb.weights_of_texel[texel][wb.weight_count_of_texel[texel]] = static_cast<uint8_t>(weight[i]);
+ wb.weight_count_of_texel[texel]++;
+ wb.texels_of_weight[qweight[i]][wb.texel_count_of_weight[qweight[i]]] = static_cast<uint8_t>(texel);
+ wb.texel_weights_of_weight[qweight[i]][wb.texel_count_of_weight[qweight[i]]] = static_cast<uint8_t>(weight[i]);
+ wb.texel_count_of_weight[qweight[i]]++;
+ max_texel_count_of_weight = astc::max(max_texel_count_of_weight, wb.texel_count_of_weight[qweight[i]]);
+ }
+ }
+ }
+ }
+
+ uint8_t max_texel_weight_count = 0;
+ for (unsigned int i = 0; i < texels_per_block; i++)
+ {
+ di.texel_weight_count[i] = wb.weight_count_of_texel[i];
+ max_texel_weight_count = astc::max(max_texel_weight_count, di.texel_weight_count[i]);
+
+ for (unsigned int j = 0; j < wb.weight_count_of_texel[i]; j++)
+ {
+ di.texel_weights_int_4t[j][i] = wb.weights_of_texel[i][j];
+ di.texel_weights_float_4t[j][i] = static_cast<float>(wb.weights_of_texel[i][j]) * (1.0f / WEIGHTS_TEXEL_SUM);
+ di.texel_weights_4t[j][i] = wb.grid_weights_of_texel[i][j];
+ }
+
+ // Init all 4 entries so we can rely on zeros for vectorization
+ for (unsigned int j = wb.weight_count_of_texel[i]; j < 4; j++)
+ {
+ di.texel_weights_int_4t[j][i] = 0;
+ di.texel_weights_float_4t[j][i] = 0.0f;
+ di.texel_weights_4t[j][i] = 0;
+ }
+ }
+
+ di.max_texel_weight_count = max_texel_weight_count;
+
+ for (unsigned int i = 0; i < weights_per_block; i++)
+ {
+ unsigned int texel_count_wt = wb.texel_count_of_weight[i];
+ di.weight_texel_count[i] = static_cast<uint8_t>(texel_count_wt);
+
+ for (unsigned int j = 0; j < texel_count_wt; j++)
+ {
+ uint8_t texel = wb.texels_of_weight[i][j];
+
+ // Create transposed versions of these for better vectorization
+ di.weight_texel[j][i] = texel;
+ di.weights_flt[j][i] = static_cast<float>(wb.texel_weights_of_weight[i][j]);
+
+ // perform a layer of array unrolling. An aspect of this unrolling is that
+ // one of the texel-weight indexes is an identity-mapped index; we will use this
+ // fact to reorder the indexes so that the first one is the identity index.
+ int swap_idx = -1;
+ for (unsigned int k = 0; k < 4; k++)
+ {
+ uint8_t dttw = di.texel_weights_4t[k][texel];
+ float dttwf = di.texel_weights_float_4t[k][texel];
+ if (dttw == i && dttwf != 0.0f)
+ {
+ swap_idx = k;
+ }
+ di.texel_weights_texel[i][j][k] = dttw;
+ di.texel_weights_float_texel[i][j][k] = dttwf;
+ }
+
+ if (swap_idx != 0)
+ {
+ uint8_t vi = di.texel_weights_texel[i][j][0];
+ float vf = di.texel_weights_float_texel[i][j][0];
+ di.texel_weights_texel[i][j][0] = di.texel_weights_texel[i][j][swap_idx];
+ di.texel_weights_float_texel[i][j][0] = di.texel_weights_float_texel[i][j][swap_idx];
+ di.texel_weights_texel[i][j][swap_idx] = vi;
+ di.texel_weights_float_texel[i][j][swap_idx] = vf;
+ }
+ }
+
+ // Initialize array tail so we can over-fetch with SIMD later to avoid loop tails
+ // Match last texel in active lane in SIMD group, for better gathers
+ uint8_t last_texel = di.weight_texel[texel_count_wt - 1][i];
+ for (unsigned int j = texel_count_wt; j < max_texel_count_of_weight; j++)
+ {
+ di.weight_texel[j][i] = last_texel;
+ di.weights_flt[j][i] = 0.0f;
+ }
+ }
+
+ // Initialize array tail so we can over-fetch with SIMD later to avoid loop tails
+ unsigned int texels_per_block_simd = round_up_to_simd_multiple_vla(texels_per_block);
+ for (unsigned int i = texels_per_block; i < texels_per_block_simd; i++)
+ {
+ di.texel_weight_count[i] = 0;
+
+ for (unsigned int j = 0; j < 4; j++)
+ {
+ di.texel_weights_float_4t[j][i] = 0;
+ di.texel_weights_4t[j][i] = 0;
+ di.texel_weights_int_4t[j][i] = 0;
+ }
+ }
+
+ // Initialize array tail so we can over-fetch with SIMD later to avoid loop tails
+ // Match last texel in active lane in SIMD group, for better gathers
+ unsigned int last_texel_count_wt = wb.texel_count_of_weight[weights_per_block - 1];
+ uint8_t last_texel = di.weight_texel[last_texel_count_wt - 1][weights_per_block - 1];
+
+ unsigned int weights_per_block_simd = round_up_to_simd_multiple_vla(weights_per_block);
+ for (unsigned int i = weights_per_block; i < weights_per_block_simd; i++)
+ {
+ di.weight_texel_count[i] = 0;
+
+ for (unsigned int j = 0; j < max_texel_count_of_weight; j++)
+ {
+ di.weight_texel[j][i] = last_texel;
+ di.weights_flt[j][i] = 0.0f;
+ }
+ }
+
+ di.texel_count = static_cast<uint8_t>(texels_per_block);
+ di.weight_count = static_cast<uint8_t>(weights_per_block);
+ di.weight_x = static_cast<uint8_t>(x_weights);
+ di.weight_y = static_cast<uint8_t>(y_weights);
+ di.weight_z = 1;
+}
+
+/**
+ * @brief Create a 3D decimation entry for a block-size and weight-decimation pair.
+ *
+ * @param x_texels The number of texels in the X dimension.
+ * @param y_texels The number of texels in the Y dimension.
+ * @param z_texels The number of texels in the Z dimension.
+ * @param x_weights The number of weights in the X dimension.
+ * @param y_weights The number of weights in the Y dimension.
+ * @param z_weights The number of weights in the Z dimension.
+ * @param[out] di The decimation info structure to populate.
+ @param[out] wb The decimation table init scratch working buffers.
+ */
+static void init_decimation_info_3d(
+ unsigned int x_texels,
+ unsigned int y_texels,
+ unsigned int z_texels,
+ unsigned int x_weights,
+ unsigned int y_weights,
+ unsigned int z_weights,
+ decimation_info& di,
+ dt_init_working_buffers& wb
+) {
+ unsigned int texels_per_block = x_texels * y_texels * z_texels;
+ unsigned int weights_per_block = x_weights * y_weights * z_weights;
+
+ uint8_t max_texel_count_of_weight = 0;
+
+ promise(weights_per_block > 0);
+ promise(texels_per_block > 0);
+
+ for (unsigned int i = 0; i < weights_per_block; i++)
+ {
+ wb.texel_count_of_weight[i] = 0;
+ }
+
+ for (unsigned int i = 0; i < texels_per_block; i++)
+ {
+ wb.weight_count_of_texel[i] = 0;
+ }
+
+ for (unsigned int z = 0; z < z_texels; z++)
+ {
+ for (unsigned int y = 0; y < y_texels; y++)
+ {
+ for (unsigned int x = 0; x < x_texels; x++)
+ {
+ int texel = (z * y_texels + y) * x_texels + x;
+
+ int x_weight = (((1024 + x_texels / 2) / (x_texels - 1)) * x * (x_weights - 1) + 32) >> 6;
+ int y_weight = (((1024 + y_texels / 2) / (y_texels - 1)) * y * (y_weights - 1) + 32) >> 6;
+ int z_weight = (((1024 + z_texels / 2) / (z_texels - 1)) * z * (z_weights - 1) + 32) >> 6;
+
+ int x_weight_frac = x_weight & 0xF;
+ int y_weight_frac = y_weight & 0xF;
+ int z_weight_frac = z_weight & 0xF;
+ int x_weight_int = x_weight >> 4;
+ int y_weight_int = y_weight >> 4;
+ int z_weight_int = z_weight >> 4;
+ int qweight[4];
+ int weight[4];
+ qweight[0] = (z_weight_int * y_weights + y_weight_int) * x_weights + x_weight_int;
+ qweight[3] = ((z_weight_int + 1) * y_weights + (y_weight_int + 1)) * x_weights + (x_weight_int + 1);
+
+ // simplex interpolation
+ int fs = x_weight_frac;
+ int ft = y_weight_frac;
+ int fp = z_weight_frac;
+
+ int cas = ((fs > ft) << 2) + ((ft > fp) << 1) + ((fs > fp));
+ int N = x_weights;
+ int NM = x_weights * y_weights;
+
+ int s1, s2, w0, w1, w2, w3;
+ switch (cas)
+ {
+ case 7:
+ s1 = 1;
+ s2 = N;
+ w0 = 16 - fs;
+ w1 = fs - ft;
+ w2 = ft - fp;
+ w3 = fp;
+ break;
+ case 3:
+ s1 = N;
+ s2 = 1;
+ w0 = 16 - ft;
+ w1 = ft - fs;
+ w2 = fs - fp;
+ w3 = fp;
+ break;
+ case 5:
+ s1 = 1;
+ s2 = NM;
+ w0 = 16 - fs;
+ w1 = fs - fp;
+ w2 = fp - ft;
+ w3 = ft;
+ break;
+ case 4:
+ s1 = NM;
+ s2 = 1;
+ w0 = 16 - fp;
+ w1 = fp - fs;
+ w2 = fs - ft;
+ w3 = ft;
+ break;
+ case 2:
+ s1 = N;
+ s2 = NM;
+ w0 = 16 - ft;
+ w1 = ft - fp;
+ w2 = fp - fs;
+ w3 = fs;
+ break;
+ case 0:
+ s1 = NM;
+ s2 = N;
+ w0 = 16 - fp;
+ w1 = fp - ft;
+ w2 = ft - fs;
+ w3 = fs;
+ break;
+ default:
+ s1 = NM;
+ s2 = N;
+ w0 = 16 - fp;
+ w1 = fp - ft;
+ w2 = ft - fs;
+ w3 = fs;
+ break;
+ }
+
+ qweight[1] = qweight[0] + s1;
+ qweight[2] = qweight[1] + s2;
+ weight[0] = w0;
+ weight[1] = w1;
+ weight[2] = w2;
+ weight[3] = w3;
+
+ for (unsigned int i = 0; i < 4; i++)
+ {
+ if (weight[i] != 0)
+ {
+ wb.grid_weights_of_texel[texel][wb.weight_count_of_texel[texel]] = static_cast<uint8_t>(qweight[i]);
+ wb.weights_of_texel[texel][wb.weight_count_of_texel[texel]] = static_cast<uint8_t>(weight[i]);
+ wb.weight_count_of_texel[texel]++;
+ wb.texels_of_weight[qweight[i]][wb.texel_count_of_weight[qweight[i]]] = static_cast<uint8_t>(texel);
+ wb.texel_weights_of_weight[qweight[i]][wb.texel_count_of_weight[qweight[i]]] = static_cast<uint8_t>(weight[i]);
+ wb.texel_count_of_weight[qweight[i]]++;
+ max_texel_count_of_weight = astc::max(max_texel_count_of_weight, wb.texel_count_of_weight[qweight[i]]);
+ }
+ }
+ }
+ }
+ }
+
+ uint8_t max_texel_weight_count = 0;
+ for (unsigned int i = 0; i < texels_per_block; i++)
+ {
+ di.texel_weight_count[i] = wb.weight_count_of_texel[i];
+ max_texel_weight_count = astc::max(max_texel_weight_count, di.texel_weight_count[i]);
+
+ // Init all 4 entries so we can rely on zeros for vectorization
+ for (unsigned int j = 0; j < 4; j++)
+ {
+ di.texel_weights_int_4t[j][i] = 0;
+ di.texel_weights_float_4t[j][i] = 0.0f;
+ di.texel_weights_4t[j][i] = 0;
+ }
+
+ for (unsigned int j = 0; j < wb.weight_count_of_texel[i]; j++)
+ {
+ di.texel_weights_int_4t[j][i] = wb.weights_of_texel[i][j];
+ di.texel_weights_float_4t[j][i] = static_cast<float>(wb.weights_of_texel[i][j]) * (1.0f / WEIGHTS_TEXEL_SUM);
+ di.texel_weights_4t[j][i] = wb.grid_weights_of_texel[i][j];
+ }
+ }
+
+ di.max_texel_weight_count = max_texel_weight_count;
+
+ for (unsigned int i = 0; i < weights_per_block; i++)
+ {
+ unsigned int texel_count_wt = wb.texel_count_of_weight[i];
+ di.weight_texel_count[i] = static_cast<uint8_t>(texel_count_wt);
+
+ for (unsigned int j = 0; j < texel_count_wt; j++)
+ {
+ unsigned int texel = wb.texels_of_weight[i][j];
+
+ // Create transposed versions of these for better vectorization
+ di.weight_texel[j][i] = static_cast<uint8_t>(texel);
+ di.weights_flt[j][i] = static_cast<float>(wb.texel_weights_of_weight[i][j]);
+
+ // perform a layer of array unrolling. An aspect of this unrolling is that
+ // one of the texel-weight indexes is an identity-mapped index; we will use this
+ // fact to reorder the indexes so that the first one is the identity index.
+ int swap_idx = -1;
+ for (unsigned int k = 0; k < 4; k++)
+ {
+ uint8_t dttw = di.texel_weights_4t[k][texel];
+ float dttwf = di.texel_weights_float_4t[k][texel];
+ if (dttw == i && dttwf != 0.0f)
+ {
+ swap_idx = k;
+ }
+ di.texel_weights_texel[i][j][k] = dttw;
+ di.texel_weights_float_texel[i][j][k] = dttwf;
+ }
+
+ if (swap_idx != 0)
+ {
+ uint8_t vi = di.texel_weights_texel[i][j][0];
+ float vf = di.texel_weights_float_texel[i][j][0];
+ di.texel_weights_texel[i][j][0] = di.texel_weights_texel[i][j][swap_idx];
+ di.texel_weights_float_texel[i][j][0] = di.texel_weights_float_texel[i][j][swap_idx];
+ di.texel_weights_texel[i][j][swap_idx] = vi;
+ di.texel_weights_float_texel[i][j][swap_idx] = vf;
+ }
+ }
+
+ // Initialize array tail so we can over-fetch with SIMD later to avoid loop tails
+ // Match last texel in active lane in SIMD group, for better gathers
+ uint8_t last_texel = di.weight_texel[texel_count_wt - 1][i];
+ for (unsigned int j = texel_count_wt; j < max_texel_count_of_weight; j++)
+ {
+ di.weight_texel[j][i] = last_texel;
+ di.weights_flt[j][i] = 0.0f;
+ }
+ }
+
+ // Initialize array tail so we can over-fetch with SIMD later to avoid loop tails
+ unsigned int texels_per_block_simd = round_up_to_simd_multiple_vla(texels_per_block);
+ for (unsigned int i = texels_per_block; i < texels_per_block_simd; i++)
+ {
+ di.texel_weight_count[i] = 0;
+
+ for (unsigned int j = 0; j < 4; j++)
+ {
+ di.texel_weights_float_4t[j][i] = 0;
+ di.texel_weights_4t[j][i] = 0;
+ di.texel_weights_int_4t[j][i] = 0;
+ }
+ }
+
+ // Initialize array tail so we can over-fetch with SIMD later to avoid loop tails
+ // Match last texel in active lane in SIMD group, for better gathers
+ int last_texel_count_wt = wb.texel_count_of_weight[weights_per_block - 1];
+ uint8_t last_texel = di.weight_texel[last_texel_count_wt - 1][weights_per_block - 1];
+
+ unsigned int weights_per_block_simd = round_up_to_simd_multiple_vla(weights_per_block);
+ for (unsigned int i = weights_per_block; i < weights_per_block_simd; i++)
+ {
+ di.weight_texel_count[i] = 0;
+
+ for (int j = 0; j < max_texel_count_of_weight; j++)
+ {
+ di.weight_texel[j][i] = last_texel;
+ di.weights_flt[j][i] = 0.0f;
+ }
+ }
+
+ di.texel_count = static_cast<uint8_t>(texels_per_block);
+ di.weight_count = static_cast<uint8_t>(weights_per_block);
+ di.weight_x = static_cast<uint8_t>(x_weights);
+ di.weight_y = static_cast<uint8_t>(y_weights);
+ di.weight_z = static_cast<uint8_t>(z_weights);
+}
+
+/**
+ * @brief Assign the texels to use for kmeans clustering.
+ *
+ * The max limit is @c BLOCK_MAX_KMEANS_TEXELS; above this a random selection is used.
+ * The @c bsd.texel_count is an input and must be populated beforehand.
+ *
+ * @param[in,out] bsd The block size descriptor to populate.
+ */
+static void assign_kmeans_texels(
+ block_size_descriptor& bsd
+) {
+ // Use all texels for kmeans on a small block
+ if (bsd.texel_count <= BLOCK_MAX_KMEANS_TEXELS)
+ {
+ for (uint8_t i = 0; i < bsd.texel_count; i++)
+ {
+ bsd.kmeans_texels[i] = i;
+ }
+
+ return;
+ }
+
+ // Select a random subset of BLOCK_MAX_KMEANS_TEXELS for kmeans on a large block
+ uint64_t rng_state[2];
+ astc::rand_init(rng_state);
+
+ // Initialize array used for tracking used indices
+ bool seen[BLOCK_MAX_TEXELS];
+ for (uint8_t i = 0; i < bsd.texel_count; i++)
+ {
+ seen[i] = false;
+ }
+
+ // Assign 64 random indices, retrying if we see repeats
+ unsigned int arr_elements_set = 0;
+ while (arr_elements_set < BLOCK_MAX_KMEANS_TEXELS)
+ {
+ uint8_t texel = static_cast<uint8_t>(astc::rand(rng_state));
+ texel = texel % bsd.texel_count;
+ if (!seen[texel])
+ {
+ bsd.kmeans_texels[arr_elements_set++] = texel;
+ seen[texel] = true;
+ }
+ }
+}
+
+/**
+ * @brief Allocate a single 2D decimation table entry.
+ *
+ * @param x_texels The number of texels in the X dimension.
+ * @param y_texels The number of texels in the Y dimension.
+ * @param x_weights The number of weights in the X dimension.
+ * @param y_weights The number of weights in the Y dimension.
+ * @param bsd The block size descriptor we are populating.
+ * @param wb The decimation table init scratch working buffers.
+ * @param index The packed array index to populate.
+ */
+static void construct_dt_entry_2d(
+ unsigned int x_texels,
+ unsigned int y_texels,
+ unsigned int x_weights,
+ unsigned int y_weights,
+ block_size_descriptor& bsd,
+ dt_init_working_buffers& wb,
+ unsigned int index
+) {
+ unsigned int weight_count = x_weights * y_weights;
+ assert(weight_count <= BLOCK_MAX_WEIGHTS);
+
+ bool try_2planes = (2 * weight_count) <= BLOCK_MAX_WEIGHTS;
+
+ decimation_info& di = bsd.decimation_tables[index];
+ init_decimation_info_2d(x_texels, y_texels, x_weights, y_weights, di, wb);
+
+ int maxprec_1plane = -1;
+ int maxprec_2planes = -1;
+ for (int i = 0; i < 12; i++)
+ {
+ unsigned int bits_1plane = get_ise_sequence_bitcount(weight_count, static_cast<quant_method>(i));
+ if (bits_1plane >= BLOCK_MIN_WEIGHT_BITS && bits_1plane <= BLOCK_MAX_WEIGHT_BITS)
+ {
+ maxprec_1plane = i;
+ }
+
+ if (try_2planes)
+ {
+ unsigned int bits_2planes = get_ise_sequence_bitcount(2 * weight_count, static_cast<quant_method>(i));
+ if (bits_2planes >= BLOCK_MIN_WEIGHT_BITS && bits_2planes <= BLOCK_MAX_WEIGHT_BITS)
+ {
+ maxprec_2planes = i;
+ }
+ }
+ }
+
+ // At least one of the two should be valid ...
+ assert(maxprec_1plane >= 0 || maxprec_2planes >= 0);
+ bsd.decimation_modes[index].maxprec_1plane = static_cast<int8_t>(maxprec_1plane);
+ bsd.decimation_modes[index].maxprec_2planes = static_cast<int8_t>(maxprec_2planes);
+ bsd.decimation_modes[index].refprec_1_plane = 0;
+ bsd.decimation_modes[index].refprec_2_planes = 0;
+}
+
+/**
+ * @brief Allocate block modes and decimation tables for a single 2D block size.
+ *
+ * @param x_texels The number of texels in the X dimension.
+ * @param y_texels The number of texels in the Y dimension.
+ * @param can_omit_modes Can we discard modes that astcenc won't use, even if legal?
+ * @param mode_cutoff Percentile cutoff in range [0,1]. Low values more likely to be used.
+ * @param[out] bsd The block size descriptor to populate.
+ */
+static void construct_block_size_descriptor_2d(
+ unsigned int x_texels,
+ unsigned int y_texels,
+ bool can_omit_modes,
+ float mode_cutoff,
+ block_size_descriptor& bsd
+) {
+ // Store a remap table for storing packed decimation modes.
+ // Indexing uses [Y * 16 + X] and max size for each axis is 12.
+ static const unsigned int MAX_DMI = 12 * 16 + 12;
+ int decimation_mode_index[MAX_DMI];
+
+ dt_init_working_buffers* wb = new dt_init_working_buffers;
+
+ bsd.xdim = static_cast<uint8_t>(x_texels);
+ bsd.ydim = static_cast<uint8_t>(y_texels);
+ bsd.zdim = 1;
+ bsd.texel_count = static_cast<uint8_t>(x_texels * y_texels);
+
+ for (unsigned int i = 0; i < MAX_DMI; i++)
+ {
+ decimation_mode_index[i] = -1;
+ }
+
+ // Gather all the decimation grids that can be used with the current block
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+ const float *percentiles = get_2d_percentile_table(x_texels, y_texels);
+ float always_cutoff = 0.0f;
+#else
+ // Unused in decompress-only builds
+ (void)can_omit_modes;
+ (void)mode_cutoff;
+#endif
+
+ // Construct the list of block formats referencing the decimation tables
+ unsigned int packed_bm_idx = 0;
+ unsigned int packed_dm_idx = 0;
+
+ // Trackers
+ unsigned int bm_counts[4] { 0 };
+ unsigned int dm_counts[4] { 0 };
+
+ // Clear the list to a known-bad value
+ for (unsigned int i = 0; i < WEIGHTS_MAX_BLOCK_MODES; i++)
+ {
+ bsd.block_mode_packed_index[i] = BLOCK_BAD_BLOCK_MODE;
+ }
+
+ // Iterate four times to build a usefully ordered list:
+ // - Pass 0 - keep selected single plane "always" block modes
+ // - Pass 1 - keep selected single plane "non-always" block modes
+ // - Pass 2 - keep select dual plane block modes
+ // - Pass 3 - keep everything else that's legal
+ unsigned int limit = can_omit_modes ? 3 : 4;
+ for (unsigned int j = 0; j < limit; j ++)
+ {
+ for (unsigned int i = 0; i < WEIGHTS_MAX_BLOCK_MODES; i++)
+ {
+ // Skip modes we've already included in a previous pass
+ if (bsd.block_mode_packed_index[i] != BLOCK_BAD_BLOCK_MODE)
+ {
+ continue;
+ }
+
+ // Decode parameters
+ unsigned int x_weights;
+ unsigned int y_weights;
+ bool is_dual_plane;
+ unsigned int quant_mode;
+ unsigned int weight_bits;
+ bool valid = decode_block_mode_2d(i, x_weights, y_weights, is_dual_plane, quant_mode, weight_bits);
+
+ // Always skip invalid encodings for the current block size
+ if (!valid || (x_weights > x_texels) || (y_weights > y_texels))
+ {
+ continue;
+ }
+
+ // Selectively skip dual plane encodings
+ if (((j <= 1) && is_dual_plane) || (j == 2 && !is_dual_plane))
+ {
+ continue;
+ }
+
+ // Always skip encodings we can't physically encode based on
+ // generic encoding bit availability
+ if (is_dual_plane)
+ {
+ // This is the only check we need as only support 1 partition
+ if ((109 - weight_bits) <= 0)
+ {
+ continue;
+ }
+ }
+ else
+ {
+ // This is conservative - fewer bits may be available for > 1 partition
+ if ((111 - weight_bits) <= 0)
+ {
+ continue;
+ }
+ }
+
+ // Selectively skip encodings based on percentile
+ bool percentile_hit = false;
+ #if !defined(ASTCENC_DECOMPRESS_ONLY)
+ if (j == 0)
+ {
+ percentile_hit = percentiles[i] <= always_cutoff;
+ }
+ else
+ {
+ percentile_hit = percentiles[i] <= mode_cutoff;
+ }
+ #endif
+
+ if (j != 3 && !percentile_hit)
+ {
+ continue;
+ }
+
+ // Allocate and initialize the decimation table entry if we've not used it yet
+ int decimation_mode = decimation_mode_index[y_weights * 16 + x_weights];
+ if (decimation_mode < 0)
+ {
+ construct_dt_entry_2d(x_texels, y_texels, x_weights, y_weights, bsd, *wb, packed_dm_idx);
+ decimation_mode_index[y_weights * 16 + x_weights] = packed_dm_idx;
+ decimation_mode = packed_dm_idx;
+
+ dm_counts[j]++;
+ packed_dm_idx++;
+ }
+
+ auto& bm = bsd.block_modes[packed_bm_idx];
+
+ bm.decimation_mode = static_cast<uint8_t>(decimation_mode);
+ bm.quant_mode = static_cast<uint8_t>(quant_mode);
+ bm.is_dual_plane = static_cast<uint8_t>(is_dual_plane);
+ bm.weight_bits = static_cast<uint8_t>(weight_bits);
+ bm.mode_index = static_cast<uint16_t>(i);
+
+ auto& dm = bsd.decimation_modes[decimation_mode];
+
+ if (is_dual_plane)
+ {
+ dm.set_ref_2_plane(bm.get_weight_quant_mode());
+ }
+ else
+ {
+ dm.set_ref_1_plane(bm.get_weight_quant_mode());
+ }
+
+ bsd.block_mode_packed_index[i] = static_cast<uint16_t>(packed_bm_idx);
+
+ packed_bm_idx++;
+ bm_counts[j]++;
+ }
+ }
+
+ bsd.block_mode_count_1plane_always = bm_counts[0];
+ bsd.block_mode_count_1plane_selected = bm_counts[0] + bm_counts[1];
+ bsd.block_mode_count_1plane_2plane_selected = bm_counts[0] + bm_counts[1] + bm_counts[2];
+ bsd.block_mode_count_all = bm_counts[0] + bm_counts[1] + bm_counts[2] + bm_counts[3];
+
+ bsd.decimation_mode_count_always = dm_counts[0];
+ bsd.decimation_mode_count_selected = dm_counts[0] + dm_counts[1] + dm_counts[2];
+ bsd.decimation_mode_count_all = dm_counts[0] + dm_counts[1] + dm_counts[2] + dm_counts[3];
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+ assert(bsd.block_mode_count_1plane_always > 0);
+ assert(bsd.decimation_mode_count_always > 0);
+
+ delete[] percentiles;
+#endif
+
+ // Ensure the end of the array contains valid data (should never get read)
+ for (unsigned int i = bsd.decimation_mode_count_all; i < WEIGHTS_MAX_DECIMATION_MODES; i++)
+ {
+ bsd.decimation_modes[i].maxprec_1plane = -1;
+ bsd.decimation_modes[i].maxprec_2planes = -1;
+ bsd.decimation_modes[i].refprec_1_plane = 0;
+ bsd.decimation_modes[i].refprec_2_planes = 0;
+ }
+
+ // Determine the texels to use for kmeans clustering.
+ assign_kmeans_texels(bsd);
+
+ delete wb;
+}
+
+/**
+ * @brief Allocate block modes and decimation tables for a single 3D block size.
+ *
+ * TODO: This function doesn't include all of the heuristics that we use for 2D block sizes such as
+ * the percentile mode cutoffs. If 3D becomes more widely used we should look at this.
+ *
+ * @param x_texels The number of texels in the X dimension.
+ * @param y_texels The number of texels in the Y dimension.
+ * @param z_texels The number of texels in the Z dimension.
+ * @param[out] bsd The block size descriptor to populate.
+ */
+static void construct_block_size_descriptor_3d(
+ unsigned int x_texels,
+ unsigned int y_texels,
+ unsigned int z_texels,
+ block_size_descriptor& bsd
+) {
+ // Store a remap table for storing packed decimation modes.
+ // Indexing uses [Z * 64 + Y * 8 + X] and max size for each axis is 6.
+ static constexpr unsigned int MAX_DMI = 6 * 64 + 6 * 8 + 6;
+ int decimation_mode_index[MAX_DMI];
+ unsigned int decimation_mode_count = 0;
+
+ dt_init_working_buffers* wb = new dt_init_working_buffers;
+
+ bsd.xdim = static_cast<uint8_t>(x_texels);
+ bsd.ydim = static_cast<uint8_t>(y_texels);
+ bsd.zdim = static_cast<uint8_t>(z_texels);
+ bsd.texel_count = static_cast<uint8_t>(x_texels * y_texels * z_texels);
+
+ for (unsigned int i = 0; i < MAX_DMI; i++)
+ {
+ decimation_mode_index[i] = -1;
+ }
+
+ // gather all the infill-modes that can be used with the current block size
+ for (unsigned int x_weights = 2; x_weights <= x_texels; x_weights++)
+ {
+ for (unsigned int y_weights = 2; y_weights <= y_texels; y_weights++)
+ {
+ for (unsigned int z_weights = 2; z_weights <= z_texels; z_weights++)
+ {
+ unsigned int weight_count = x_weights * y_weights * z_weights;
+ if (weight_count > BLOCK_MAX_WEIGHTS)
+ {
+ continue;
+ }
+
+ decimation_info& di = bsd.decimation_tables[decimation_mode_count];
+ decimation_mode_index[z_weights * 64 + y_weights * 8 + x_weights] = decimation_mode_count;
+ init_decimation_info_3d(x_texels, y_texels, z_texels, x_weights, y_weights, z_weights, di, *wb);
+
+ int maxprec_1plane = -1;
+ int maxprec_2planes = -1;
+ for (unsigned int i = 0; i < 12; i++)
+ {
+ unsigned int bits_1plane = get_ise_sequence_bitcount(weight_count, static_cast<quant_method>(i));
+ if (bits_1plane >= BLOCK_MIN_WEIGHT_BITS && bits_1plane <= BLOCK_MAX_WEIGHT_BITS)
+ {
+ maxprec_1plane = i;
+ }
+
+ unsigned int bits_2planes = get_ise_sequence_bitcount(2 * weight_count, static_cast<quant_method>(i));
+ if (bits_2planes >= BLOCK_MIN_WEIGHT_BITS && bits_2planes <= BLOCK_MAX_WEIGHT_BITS)
+ {
+ maxprec_2planes = i;
+ }
+ }
+
+ if ((2 * weight_count) > BLOCK_MAX_WEIGHTS)
+ {
+ maxprec_2planes = -1;
+ }
+
+ bsd.decimation_modes[decimation_mode_count].maxprec_1plane = static_cast<int8_t>(maxprec_1plane);
+ bsd.decimation_modes[decimation_mode_count].maxprec_2planes = static_cast<int8_t>(maxprec_2planes);
+ bsd.decimation_modes[decimation_mode_count].refprec_1_plane = maxprec_1plane == -1 ? 0 : 0xFFFF;
+ bsd.decimation_modes[decimation_mode_count].refprec_2_planes = maxprec_2planes == -1 ? 0 : 0xFFFF;
+ decimation_mode_count++;
+ }
+ }
+ }
+
+ // Ensure the end of the array contains valid data (should never get read)
+ for (unsigned int i = decimation_mode_count; i < WEIGHTS_MAX_DECIMATION_MODES; i++)
+ {
+ bsd.decimation_modes[i].maxprec_1plane = -1;
+ bsd.decimation_modes[i].maxprec_2planes = -1;
+ bsd.decimation_modes[i].refprec_1_plane = 0;
+ bsd.decimation_modes[i].refprec_2_planes = 0;
+ }
+
+ bsd.decimation_mode_count_always = 0; // Skipped for 3D modes
+ bsd.decimation_mode_count_selected = decimation_mode_count;
+ bsd.decimation_mode_count_all = decimation_mode_count;
+
+ // Construct the list of block formats referencing the decimation tables
+
+ // Clear the list to a known-bad value
+ for (unsigned int i = 0; i < WEIGHTS_MAX_BLOCK_MODES; i++)
+ {
+ bsd.block_mode_packed_index[i] = BLOCK_BAD_BLOCK_MODE;
+ }
+
+ unsigned int packed_idx = 0;
+ unsigned int bm_counts[2] { 0 };
+
+ // Iterate two times to build a usefully ordered list:
+ // - Pass 0 - keep valid single plane block modes
+ // - Pass 1 - keep valid dual plane block modes
+ for (unsigned int j = 0; j < 2; j++)
+ {
+ for (unsigned int i = 0; i < WEIGHTS_MAX_BLOCK_MODES; i++)
+ {
+ // Skip modes we've already included in a previous pass
+ if (bsd.block_mode_packed_index[i] != BLOCK_BAD_BLOCK_MODE)
+ {
+ continue;
+ }
+
+ unsigned int x_weights;
+ unsigned int y_weights;
+ unsigned int z_weights;
+ bool is_dual_plane;
+ unsigned int quant_mode;
+ unsigned int weight_bits;
+
+ bool valid = decode_block_mode_3d(i, x_weights, y_weights, z_weights, is_dual_plane, quant_mode, weight_bits);
+ // Skip invalid encodings
+ if (!valid || x_weights > x_texels || y_weights > y_texels || z_weights > z_texels)
+ {
+ continue;
+ }
+
+ // Skip encodings in the wrong iteration
+ if ((j == 0 && is_dual_plane) || (j == 1 && !is_dual_plane))
+ {
+ continue;
+ }
+
+ // Always skip encodings we can't physically encode based on bit availability
+ if (is_dual_plane)
+ {
+ // This is the only check we need as only support 1 partition
+ if ((109 - weight_bits) <= 0)
+ {
+ continue;
+ }
+ }
+ else
+ {
+ // This is conservative - fewer bits may be available for > 1 partition
+ if ((111 - weight_bits) <= 0)
+ {
+ continue;
+ }
+ }
+
+ int decimation_mode = decimation_mode_index[z_weights * 64 + y_weights * 8 + x_weights];
+ bsd.block_modes[packed_idx].decimation_mode = static_cast<uint8_t>(decimation_mode);
+ bsd.block_modes[packed_idx].quant_mode = static_cast<uint8_t>(quant_mode);
+ bsd.block_modes[packed_idx].weight_bits = static_cast<uint8_t>(weight_bits);
+ bsd.block_modes[packed_idx].is_dual_plane = static_cast<uint8_t>(is_dual_plane);
+ bsd.block_modes[packed_idx].mode_index = static_cast<uint16_t>(i);
+
+ bsd.block_mode_packed_index[i] = static_cast<uint16_t>(packed_idx);
+ bm_counts[j]++;
+ packed_idx++;
+ }
+ }
+
+ bsd.block_mode_count_1plane_always = 0; // Skipped for 3D modes
+ bsd.block_mode_count_1plane_selected = bm_counts[0];
+ bsd.block_mode_count_1plane_2plane_selected = bm_counts[0] + bm_counts[1];
+ bsd.block_mode_count_all = bm_counts[0] + bm_counts[1];
+
+ // Determine the texels to use for kmeans clustering.
+ assign_kmeans_texels(bsd);
+
+ delete wb;
+}
+
+/* See header for documentation. */
+void init_block_size_descriptor(
+ unsigned int x_texels,
+ unsigned int y_texels,
+ unsigned int z_texels,
+ bool can_omit_modes,
+ unsigned int partition_count_cutoff,
+ float mode_cutoff,
+ block_size_descriptor& bsd
+) {
+ if (z_texels > 1)
+ {
+ construct_block_size_descriptor_3d(x_texels, y_texels, z_texels, bsd);
+ }
+ else
+ {
+ construct_block_size_descriptor_2d(x_texels, y_texels, can_omit_modes, mode_cutoff, bsd);
+ }
+
+ init_partition_tables(bsd, can_omit_modes, partition_count_cutoff);
+}
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_color_quantize.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_color_quantize.cpp
new file mode 100644
index 00000000000..1f5a4d92ee3
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_color_quantize.cpp
@@ -0,0 +1,2071 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2021 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+
+/**
+ * @brief Functions for color quantization.
+ *
+ * The design of the color quantization functionality requires the caller to use higher level error
+ * analysis to determine the base encoding that should be used. This earlier analysis will select
+ * the basic type of the endpoint that should be used:
+ *
+ * * Mode: LDR or HDR
+ * * Quantization level
+ * * Channel count: L, LA, RGB, or RGBA
+ * * Endpoint 2 type: Direct color endcode, or scaled from endpoint 1.
+ *
+ * However, this leaves a number of decisions about exactly how to pack the endpoints open. In
+ * particular we need to determine if blue contraction can be used, or/and if delta encoding can be
+ * used. If they can be applied these will allow us to maintain higher precision in the endpoints
+ * without needing additional storage.
+ */
+
+#include <stdio.h>
+#include <assert.h>
+
+#include "astcenc_internal.h"
+
+/**
+ * @brief Determine the quantized value given a quantization level.
+ *
+ * @param quant_level The quantization level to use.
+ * @param value The value to convert. This may be outside of the 0-255 range and will be
+ * clamped before the value is looked up.
+ *
+ * @return The encoded quantized value. These are not necessarily in order; the compressor
+ * scrambles the values slightly to make hardware implementation easier.
+ */
+static inline uint8_t quant_color(
+ quant_method quant_level,
+ int value
+) {
+ return color_unquant_to_uquant_tables[quant_level - QUANT_6][value];
+}
+
+/**
+ * @brief Quantize an LDR RGB color.
+ *
+ * Since this is a fall-back encoding, we cannot actually fail but must produce a sensible result.
+ * For this encoding @c color0 cannot be larger than @c color1. If @c color0 is actually larger
+ * than @c color1, @c color0 is reduced and @c color1 is increased until the constraint is met.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as (r0, r1, g0, g1, b0, b1).
+ * @param quant_level The quantization level to use.
+ */
+static void quantize_rgb(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[6],
+ quant_method quant_level
+) {
+ float scale = 1.0f / 257.0f;
+
+ float r0 = astc::clamp255f(color0.lane<0>() * scale);
+ float g0 = astc::clamp255f(color0.lane<1>() * scale);
+ float b0 = astc::clamp255f(color0.lane<2>() * scale);
+
+ float r1 = astc::clamp255f(color1.lane<0>() * scale);
+ float g1 = astc::clamp255f(color1.lane<1>() * scale);
+ float b1 = astc::clamp255f(color1.lane<2>() * scale);
+
+ int ri0, gi0, bi0, ri1, gi1, bi1;
+ float rgb0_addon = 0.5f;
+ float rgb1_addon = 0.5f;
+ do
+ {
+ ri0 = quant_color(quant_level, astc::max(astc::flt2int_rd(r0 + rgb0_addon), 0));
+ gi0 = quant_color(quant_level, astc::max(astc::flt2int_rd(g0 + rgb0_addon), 0));
+ bi0 = quant_color(quant_level, astc::max(astc::flt2int_rd(b0 + rgb0_addon), 0));
+ ri1 = quant_color(quant_level, astc::min(astc::flt2int_rd(r1 + rgb1_addon), 255));
+ gi1 = quant_color(quant_level, astc::min(astc::flt2int_rd(g1 + rgb1_addon), 255));
+ bi1 = quant_color(quant_level, astc::min(astc::flt2int_rd(b1 + rgb1_addon), 255));
+
+ rgb0_addon -= 0.2f;
+ rgb1_addon += 0.2f;
+ } while (ri0 + gi0 + bi0 > ri1 + gi1 + bi1);
+
+ output[0] = static_cast<uint8_t>(ri0);
+ output[1] = static_cast<uint8_t>(ri1);
+ output[2] = static_cast<uint8_t>(gi0);
+ output[3] = static_cast<uint8_t>(gi1);
+ output[4] = static_cast<uint8_t>(bi0);
+ output[5] = static_cast<uint8_t>(bi1);
+}
+
+/**
+ * @brief Quantize an LDR RGBA color.
+ *
+ * Since this is a fall-back encoding, we cannot actually fail but must produce a sensible result.
+ * For this encoding @c color0.rgb cannot be larger than @c color1.rgb (this indicates blue
+ * contraction). If @c color0.rgb is actually larger than @c color1.rgb, @c color0.rgb is reduced
+ * and @c color1.rgb is increased until the constraint is met.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as (r0, r1, g0, g1, b0, b1, a0, a1).
+ * @param quant_level The quantization level to use.
+ */
+static void quantize_rgba(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[8],
+ quant_method quant_level
+) {
+ float scale = 1.0f / 257.0f;
+
+ float a0 = astc::clamp255f(color0.lane<3>() * scale);
+ float a1 = astc::clamp255f(color1.lane<3>() * scale);
+
+ output[6] = quant_color(quant_level, astc::flt2int_rtn(a0));
+ output[7] = quant_color(quant_level, astc::flt2int_rtn(a1));
+
+ quantize_rgb(color0, color1, output, quant_level);
+}
+
+/**
+ * @brief Try to quantize an LDR RGB color using blue-contraction.
+ *
+ * Blue-contraction is only usable if encoded color 1 is larger than color 0.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as (r1, r0, g1, g0, b1, b0).
+ * @param quant_level The quantization level to use.
+ *
+ * @return Returns @c false on failure, @c true on success.
+ */
+static bool try_quantize_rgb_blue_contract(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[6],
+ quant_method quant_level
+) {
+ float scale = 1.0f / 257.0f;
+
+ float r0 = color0.lane<0>() * scale;
+ float g0 = color0.lane<1>() * scale;
+ float b0 = color0.lane<2>() * scale;
+
+ float r1 = color1.lane<0>() * scale;
+ float g1 = color1.lane<1>() * scale;
+ float b1 = color1.lane<2>() * scale;
+
+ // Apply inverse blue-contraction. This can produce an overflow; which means BC cannot be used.
+ r0 += (r0 - b0);
+ g0 += (g0 - b0);
+ r1 += (r1 - b1);
+ g1 += (g1 - b1);
+
+ if (r0 < 0.0f || r0 > 255.0f || g0 < 0.0f || g0 > 255.0f || b0 < 0.0f || b0 > 255.0f ||
+ r1 < 0.0f || r1 > 255.0f || g1 < 0.0f || g1 > 255.0f || b1 < 0.0f || b1 > 255.0f)
+ {
+ return false;
+ }
+
+ // Quantize the inverse-blue-contracted color
+ int ri0 = quant_color(quant_level, astc::flt2int_rtn(r0));
+ int gi0 = quant_color(quant_level, astc::flt2int_rtn(g0));
+ int bi0 = quant_color(quant_level, astc::flt2int_rtn(b0));
+
+ int ri1 = quant_color(quant_level, astc::flt2int_rtn(r1));
+ int gi1 = quant_color(quant_level, astc::flt2int_rtn(g1));
+ int bi1 = quant_color(quant_level, astc::flt2int_rtn(b1));
+
+ // If color #1 is not larger than color #0 then blue-contraction cannot be used. Note that
+ // blue-contraction and quantization change this order, which is why we must test afterwards.
+ if (ri1 + gi1 + bi1 <= ri0 + gi0 + bi0)
+ {
+ return false;
+ }
+
+ output[0] = static_cast<uint8_t>(ri1);
+ output[1] = static_cast<uint8_t>(ri0);
+ output[2] = static_cast<uint8_t>(gi1);
+ output[3] = static_cast<uint8_t>(gi0);
+ output[4] = static_cast<uint8_t>(bi1);
+ output[5] = static_cast<uint8_t>(bi0);
+
+ return true;
+}
+
+/**
+ * @brief Try to quantize an LDR RGBA color using blue-contraction.
+ *
+ * Blue-contraction is only usable if encoded color 1 RGB is larger than color 0 RGB.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as (r1, r0, g1, g0, b1, b0, a1, a0).
+ * @param quant_level The quantization level to use.
+ *
+ * @return Returns @c false on failure, @c true on success.
+ */
+static int try_quantize_rgba_blue_contract(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[8],
+ quant_method quant_level
+) {
+ float scale = 1.0f / 257.0f;
+
+ float a0 = astc::clamp255f(color0.lane<3>() * scale);
+ float a1 = astc::clamp255f(color1.lane<3>() * scale);
+
+ output[6] = quant_color(quant_level, astc::flt2int_rtn(a1));
+ output[7] = quant_color(quant_level, astc::flt2int_rtn(a0));
+
+ return try_quantize_rgb_blue_contract(color0, color1, output, quant_level);
+}
+
+/**
+ * @brief Try to quantize an LDR RGB color using delta encoding.
+ *
+ * At decode time we move one bit from the offset to the base and seize another bit as a sign bit;
+ * we then unquantize both values as if they contain one extra bit. If the sum of the offsets is
+ * non-negative, then we encode a regular delta.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as (r0, r1, g0, g1, b0, b1).
+ * @param quant_level The quantization level to use.
+ *
+ * @return Returns @c false on failure, @c true on success.
+ */
+static bool try_quantize_rgb_delta(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[6],
+ quant_method quant_level
+) {
+ float scale = 1.0f / 257.0f;
+
+ float r0 = astc::clamp255f(color0.lane<0>() * scale);
+ float g0 = astc::clamp255f(color0.lane<1>() * scale);
+ float b0 = astc::clamp255f(color0.lane<2>() * scale);
+
+ float r1 = astc::clamp255f(color1.lane<0>() * scale);
+ float g1 = astc::clamp255f(color1.lane<1>() * scale);
+ float b1 = astc::clamp255f(color1.lane<2>() * scale);
+
+ // Transform r0 to unorm9
+ int r0a = astc::flt2int_rtn(r0);
+ int g0a = astc::flt2int_rtn(g0);
+ int b0a = astc::flt2int_rtn(b0);
+
+ r0a <<= 1;
+ g0a <<= 1;
+ b0a <<= 1;
+
+ // Mask off the top bit
+ int r0b = r0a & 0xFF;
+ int g0b = g0a & 0xFF;
+ int b0b = b0a & 0xFF;
+
+ // Quantize then unquantize in order to get a value that we take differences against
+ int r0be = quant_color(quant_level, r0b);
+ int g0be = quant_color(quant_level, g0b);
+ int b0be = quant_color(quant_level, b0b);
+
+ r0b = r0be | (r0a & 0x100);
+ g0b = g0be | (g0a & 0x100);
+ b0b = b0be | (b0a & 0x100);
+
+ // Get hold of the second value
+ int r1d = astc::flt2int_rtn(r1);
+ int g1d = astc::flt2int_rtn(g1);
+ int b1d = astc::flt2int_rtn(b1);
+
+ r1d <<= 1;
+ g1d <<= 1;
+ b1d <<= 1;
+
+ // ... and take differences
+ r1d -= r0b;
+ g1d -= g0b;
+ b1d -= b0b;
+
+ // Check if the difference is too large to be encodable
+ if (r1d > 63 || g1d > 63 || b1d > 63 || r1d < -64 || g1d < -64 || b1d < -64)
+ {
+ return false;
+ }
+
+ // Insert top bit of the base into the offset
+ r1d &= 0x7F;
+ g1d &= 0x7F;
+ b1d &= 0x7F;
+
+ r1d |= (r0b & 0x100) >> 1;
+ g1d |= (g0b & 0x100) >> 1;
+ b1d |= (b0b & 0x100) >> 1;
+
+ // Then quantize and unquantize; if this causes either top two bits to flip, then encoding fails
+ // since we have then corrupted either the top bit of the base or the sign bit of the offset
+ int r1de = quant_color(quant_level, r1d);
+ int g1de = quant_color(quant_level, g1d);
+ int b1de = quant_color(quant_level, b1d);
+
+ if (((r1d ^ r1de) | (g1d ^ g1de) | (b1d ^ b1de)) & 0xC0)
+ {
+ return false;
+ }
+
+ // If the sum of offsets triggers blue-contraction then encoding fails
+ vint4 ep0(r0be, g0be, b0be, 0);
+ vint4 ep1(r1de, g1de, b1de, 0);
+ bit_transfer_signed(ep1, ep0);
+ if (hadd_rgb_s(ep1) < 0)
+ {
+ return false;
+ }
+
+ // Check that the offsets produce legitimate sums as well
+ ep0 = ep0 + ep1;
+ if (any((ep0 < vint4(0)) | (ep0 > vint4(0xFF))))
+ {
+ return false;
+ }
+
+ output[0] = static_cast<uint8_t>(r0be);
+ output[1] = static_cast<uint8_t>(r1de);
+ output[2] = static_cast<uint8_t>(g0be);
+ output[3] = static_cast<uint8_t>(g1de);
+ output[4] = static_cast<uint8_t>(b0be);
+ output[5] = static_cast<uint8_t>(b1de);
+
+ return true;
+}
+
+static bool try_quantize_rgb_delta_blue_contract(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[6],
+ quant_method quant_level
+) {
+ // Note: Switch around endpoint colors already at start
+ float scale = 1.0f / 257.0f;
+
+ float r1 = color0.lane<0>() * scale;
+ float g1 = color0.lane<1>() * scale;
+ float b1 = color0.lane<2>() * scale;
+
+ float r0 = color1.lane<0>() * scale;
+ float g0 = color1.lane<1>() * scale;
+ float b0 = color1.lane<2>() * scale;
+
+ // Apply inverse blue-contraction. This can produce an overflow; which means BC cannot be used.
+ r0 += (r0 - b0);
+ g0 += (g0 - b0);
+ r1 += (r1 - b1);
+ g1 += (g1 - b1);
+
+ if (r0 < 0.0f || r0 > 255.0f || g0 < 0.0f || g0 > 255.0f || b0 < 0.0f || b0 > 255.0f ||
+ r1 < 0.0f || r1 > 255.0f || g1 < 0.0f || g1 > 255.0f || b1 < 0.0f || b1 > 255.0f)
+ {
+ return false;
+ }
+
+ // Transform r0 to unorm9
+ int r0a = astc::flt2int_rtn(r0);
+ int g0a = astc::flt2int_rtn(g0);
+ int b0a = astc::flt2int_rtn(b0);
+ r0a <<= 1;
+ g0a <<= 1;
+ b0a <<= 1;
+
+ // Mask off the top bit
+ int r0b = r0a & 0xFF;
+ int g0b = g0a & 0xFF;
+ int b0b = b0a & 0xFF;
+
+ // Quantize, then unquantize in order to get a value that we take differences against.
+ int r0be = quant_color(quant_level, r0b);
+ int g0be = quant_color(quant_level, g0b);
+ int b0be = quant_color(quant_level, b0b);
+
+ r0b = r0be | (r0a & 0x100);
+ g0b = g0be | (g0a & 0x100);
+ b0b = b0be | (b0a & 0x100);
+
+ // Get hold of the second value
+ int r1d = astc::flt2int_rtn(r1);
+ int g1d = astc::flt2int_rtn(g1);
+ int b1d = astc::flt2int_rtn(b1);
+
+ r1d <<= 1;
+ g1d <<= 1;
+ b1d <<= 1;
+
+ // .. and take differences!
+ r1d -= r0b;
+ g1d -= g0b;
+ b1d -= b0b;
+
+ // Check if the difference is too large to be encodable
+ if (r1d > 63 || g1d > 63 || b1d > 63 || r1d < -64 || g1d < -64 || b1d < -64)
+ {
+ return false;
+ }
+
+ // Insert top bit of the base into the offset
+ r1d &= 0x7F;
+ g1d &= 0x7F;
+ b1d &= 0x7F;
+
+ r1d |= (r0b & 0x100) >> 1;
+ g1d |= (g0b & 0x100) >> 1;
+ b1d |= (b0b & 0x100) >> 1;
+
+ // Then quantize and unquantize; if this causes any of the top two bits to flip,
+ // then encoding fails, since we have then corrupted either the top bit of the base
+ // or the sign bit of the offset.
+ int r1de = quant_color(quant_level, r1d);
+ int g1de = quant_color(quant_level, g1d);
+ int b1de = quant_color(quant_level, b1d);
+
+ if (((r1d ^ r1de) | (g1d ^ g1de) | (b1d ^ b1de)) & 0xC0)
+ {
+ return false;
+ }
+
+ // If the sum of offsets does not trigger blue-contraction then encoding fails
+ vint4 ep0(r0be, g0be, b0be, 0);
+ vint4 ep1(r1de, g1de, b1de, 0);
+ bit_transfer_signed(ep1, ep0);
+ if (hadd_rgb_s(ep1) >= 0)
+ {
+ return false;
+ }
+
+ // Check that the offsets produce legitimate sums as well
+ ep0 = ep0 + ep1;
+ if (any((ep0 < vint4(0)) | (ep0 > vint4(0xFF))))
+ {
+ return false;
+ }
+
+ output[0] = static_cast<uint8_t>(r0be);
+ output[1] = static_cast<uint8_t>(r1de);
+ output[2] = static_cast<uint8_t>(g0be);
+ output[3] = static_cast<uint8_t>(g1de);
+ output[4] = static_cast<uint8_t>(b0be);
+ output[5] = static_cast<uint8_t>(b1de);
+
+ return true;
+}
+
+/**
+ * @brief Try to quantize an LDR A color using delta encoding.
+ *
+ * At decode time we move one bit from the offset to the base and seize another bit as a sign bit;
+ * we then unquantize both values as if they contain one extra bit. If the sum of the offsets is
+ * non-negative, then we encode a regular delta.
+ *
+ * This function only compressed the alpha - the other elements in the output array are not touched.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as (x, x, x, x, x, x, a0, a1).
+ * @param quant_level The quantization level to use.
+ *
+ * @return Returns @c false on failure, @c true on success.
+ */
+static bool try_quantize_alpha_delta(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[8],
+ quant_method quant_level
+) {
+ float scale = 1.0f / 257.0f;
+
+ float a0 = astc::clamp255f(color0.lane<3>() * scale);
+ float a1 = astc::clamp255f(color1.lane<3>() * scale);
+
+ int a0a = astc::flt2int_rtn(a0);
+ a0a <<= 1;
+ int a0b = a0a & 0xFF;
+ int a0be = quant_color(quant_level, a0b);
+ a0b = a0be;
+ a0b |= a0a & 0x100;
+ int a1d = astc::flt2int_rtn(a1);
+ a1d <<= 1;
+ a1d -= a0b;
+
+ if (a1d > 63 || a1d < -64)
+ {
+ return false;
+ }
+
+ a1d &= 0x7F;
+ a1d |= (a0b & 0x100) >> 1;
+
+ int a1de = quant_color(quant_level, a1d);
+ int a1du = a1de;
+ if ((a1d ^ a1du) & 0xC0)
+ {
+ return false;
+ }
+
+ a1du &= 0x7F;
+ if (a1du & 0x40)
+ {
+ a1du -= 0x80;
+ }
+
+ a1du += a0b;
+ if (a1du < 0 || a1du > 0x1FF)
+ {
+ return false;
+ }
+
+ output[6] = static_cast<uint8_t>(a0be);
+ output[7] = static_cast<uint8_t>(a1de);
+
+ return true;
+}
+
+/**
+ * @brief Try to quantize an LDR LA color using delta encoding.
+ *
+ * At decode time we move one bit from the offset to the base and seize another bit as a sign bit;
+ * we then unquantize both values as if they contain one extra bit. If the sum of the offsets is
+ * non-negative, then we encode a regular delta.
+ *
+ * This function only compressed the alpha - the other elements in the output array are not touched.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as (l0, l1, a0, a1).
+ * @param quant_level The quantization level to use.
+ *
+ * @return Returns @c false on failure, @c true on success.
+ */
+static bool try_quantize_luminance_alpha_delta(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[4],
+ quant_method quant_level
+) {
+ float scale = 1.0f / 257.0f;
+
+ float l0 = astc::clamp255f(hadd_rgb_s(color0) * ((1.0f / 3.0f) * scale));
+ float l1 = astc::clamp255f(hadd_rgb_s(color1) * ((1.0f / 3.0f) * scale));
+
+ float a0 = astc::clamp255f(color0.lane<3>() * scale);
+ float a1 = astc::clamp255f(color1.lane<3>() * scale);
+
+ int l0a = astc::flt2int_rtn(l0);
+ int a0a = astc::flt2int_rtn(a0);
+ l0a <<= 1;
+ a0a <<= 1;
+
+ int l0b = l0a & 0xFF;
+ int a0b = a0a & 0xFF;
+ int l0be = quant_color(quant_level, l0b);
+ int a0be = quant_color(quant_level, a0b);
+ l0b = l0be;
+ a0b = a0be;
+ l0b |= l0a & 0x100;
+ a0b |= a0a & 0x100;
+
+ int l1d = astc::flt2int_rtn(l1);
+ int a1d = astc::flt2int_rtn(a1);
+ l1d <<= 1;
+ a1d <<= 1;
+ l1d -= l0b;
+ a1d -= a0b;
+
+ if (l1d > 63 || l1d < -64)
+ {
+ return false;
+ }
+
+ if (a1d > 63 || a1d < -64)
+ {
+ return false;
+ }
+
+ l1d &= 0x7F;
+ a1d &= 0x7F;
+ l1d |= (l0b & 0x100) >> 1;
+ a1d |= (a0b & 0x100) >> 1;
+
+ int l1de = quant_color(quant_level, l1d);
+ int a1de = quant_color(quant_level, a1d);
+ int l1du = l1de;
+ int a1du = a1de;
+
+ if ((l1d ^ l1du) & 0xC0)
+ {
+ return false;
+ }
+
+ if ((a1d ^ a1du) & 0xC0)
+ {
+ return false;
+ }
+
+ l1du &= 0x7F;
+ a1du &= 0x7F;
+
+ if (l1du & 0x40)
+ {
+ l1du -= 0x80;
+ }
+
+ if (a1du & 0x40)
+ {
+ a1du -= 0x80;
+ }
+
+ l1du += l0b;
+ a1du += a0b;
+
+ if (l1du < 0 || l1du > 0x1FF)
+ {
+ return false;
+ }
+
+ if (a1du < 0 || a1du > 0x1FF)
+ {
+ return false;
+ }
+
+ output[0] = static_cast<uint8_t>(l0be);
+ output[1] = static_cast<uint8_t>(l1de);
+ output[2] = static_cast<uint8_t>(a0be);
+ output[3] = static_cast<uint8_t>(a1de);
+
+ return true;
+}
+
+/**
+ * @brief Try to quantize an LDR RGBA color using delta encoding.
+ *
+ * At decode time we move one bit from the offset to the base and seize another bit as a sign bit;
+ * we then unquantize both values as if they contain one extra bit. If the sum of the offsets is
+ * non-negative, then we encode a regular delta.
+ *
+ * This function only compressed the alpha - the other elements in the output array are not touched.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as (r0, r1, b0, b1, g0, g1, a0, a1).
+ * @param quant_level The quantization level to use.
+ *
+ * @return Returns @c false on failure, @c true on success.
+ */
+static bool try_quantize_rgba_delta(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[8],
+ quant_method quant_level
+) {
+ return try_quantize_rgb_delta(color0, color1, output, quant_level) &&
+ try_quantize_alpha_delta(color0, color1, output, quant_level);
+}
+
+
+/**
+ * @brief Try to quantize an LDR RGBA color using delta and blue contract encoding.
+ *
+ * At decode time we move one bit from the offset to the base and seize another bit as a sign bit;
+ * we then unquantize both values as if they contain one extra bit. If the sum of the offsets is
+ * non-negative, then we encode a regular delta.
+ *
+ * This function only compressed the alpha - the other elements in the output array are not touched.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as (r0, r1, b0, b1, g0, g1, a0, a1).
+ * @param quant_level The quantization level to use.
+ *
+ * @return Returns @c false on failure, @c true on success.
+ */
+static bool try_quantize_rgba_delta_blue_contract(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[8],
+ quant_method quant_level
+) {
+ // Note that we swap the color0 and color1 ordering for alpha to match RGB blue-contract
+ return try_quantize_rgb_delta_blue_contract(color0, color1, output, quant_level) &&
+ try_quantize_alpha_delta(color1, color0, output, quant_level);
+}
+
+/**
+ * @brief Quantize an LDR RGB color using scale encoding.
+ *
+ * @param color The input unquantized color endpoint and scale factor.
+ * @param[out] output The output endpoints, returned as (r0, g0, b0, s).
+ * @param quant_level The quantization level to use.
+ */
+static void quantize_rgbs(
+ vfloat4 color,
+ uint8_t output[4],
+ quant_method quant_level
+) {
+ float scale = 1.0f / 257.0f;
+
+ float r = astc::clamp255f(color.lane<0>() * scale);
+ float g = astc::clamp255f(color.lane<1>() * scale);
+ float b = astc::clamp255f(color.lane<2>() * scale);
+
+ int ri = quant_color(quant_level, astc::flt2int_rtn(r));
+ int gi = quant_color(quant_level, astc::flt2int_rtn(g));
+ int bi = quant_color(quant_level, astc::flt2int_rtn(b));
+
+ float oldcolorsum = hadd_rgb_s(color) * scale;
+ float newcolorsum = static_cast<float>(ri + gi + bi);
+
+ float scalea = astc::clamp1f(color.lane<3>() * (oldcolorsum + 1e-10f) / (newcolorsum + 1e-10f));
+ int scale_idx = astc::flt2int_rtn(scalea * 256.0f);
+ scale_idx = astc::clamp(scale_idx, 0, 255);
+
+ output[0] = static_cast<uint8_t>(ri);
+ output[1] = static_cast<uint8_t>(gi);
+ output[2] = static_cast<uint8_t>(bi);
+ output[3] = quant_color(quant_level, scale_idx);
+}
+
+/**
+ * @brief Quantize an LDR RGBA color using scale encoding.
+ *
+ * @param color The input unquantized color endpoint and scale factor.
+ * @param[out] output The output endpoints, returned as (r0, g0, b0, s, a0, a1).
+ * @param quant_level The quantization level to use.
+ */
+static void quantize_rgbs_alpha(
+ vfloat4 color0,
+ vfloat4 color1,
+ vfloat4 color,
+ uint8_t output[6],
+ quant_method quant_level
+) {
+ float scale = 1.0f / 257.0f;
+
+ float a0 = astc::clamp255f(color0.lane<3>() * scale);
+ float a1 = astc::clamp255f(color1.lane<3>() * scale);
+
+ output[4] = quant_color(quant_level, astc::flt2int_rtn(a0));
+ output[5] = quant_color(quant_level, astc::flt2int_rtn(a1));
+
+ quantize_rgbs(color, output, quant_level);
+}
+
+/**
+ * @brief Quantize a LDR L color.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as (l0, l1).
+ * @param quant_level The quantization level to use.
+ */
+static void quantize_luminance(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[2],
+ quant_method quant_level
+) {
+ float scale = 1.0f / 257.0f;
+
+ color0 = color0 * scale;
+ color1 = color1 * scale;
+
+ float lum0 = astc::clamp255f(hadd_rgb_s(color0) * (1.0f / 3.0f));
+ float lum1 = astc::clamp255f(hadd_rgb_s(color1) * (1.0f / 3.0f));
+
+ if (lum0 > lum1)
+ {
+ float avg = (lum0 + lum1) * 0.5f;
+ lum0 = avg;
+ lum1 = avg;
+ }
+
+ output[0] = quant_color(quant_level, astc::flt2int_rtn(lum0));
+ output[1] = quant_color(quant_level, astc::flt2int_rtn(lum1));
+}
+
+/**
+ * @brief Quantize a LDR LA color.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as (l0, l1, a0, a1).
+ * @param quant_level The quantization level to use.
+ */
+static void quantize_luminance_alpha(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[4],
+ quant_method quant_level
+) {
+ float scale = 1.0f / 257.0f;
+
+ color0 = color0 * scale;
+ color1 = color1 * scale;
+
+ float lum0 = astc::clamp255f(hadd_rgb_s(color0) * (1.0f / 3.0f));
+ float lum1 = astc::clamp255f(hadd_rgb_s(color1) * (1.0f / 3.0f));
+
+ float a0 = astc::clamp255f(color0.lane<3>());
+ float a1 = astc::clamp255f(color1.lane<3>());
+
+ // If endpoints are close then pull apart slightly; this gives > 8 bit normal map precision.
+ if (quant_level > 18)
+ {
+ if (fabsf(lum0 - lum1) < 3.0f)
+ {
+ if (lum0 < lum1)
+ {
+ lum0 -= 0.5f;
+ lum1 += 0.5f;
+ }
+ else
+ {
+ lum0 += 0.5f;
+ lum1 -= 0.5f;
+ }
+
+ lum0 = astc::clamp255f(lum0);
+ lum1 = astc::clamp255f(lum1);
+ }
+
+ if (fabsf(a0 - a1) < 3.0f)
+ {
+ if (a0 < a1)
+ {
+ a0 -= 0.5f;
+ a1 += 0.5f;
+ }
+ else
+ {
+ a0 += 0.5f;
+ a1 -= 0.5f;
+ }
+
+ a0 = astc::clamp255f(a0);
+ a1 = astc::clamp255f(a1);
+ }
+ }
+
+ output[0] = quant_color(quant_level, astc::flt2int_rtn(lum0));
+ output[1] = quant_color(quant_level, astc::flt2int_rtn(lum1));
+ output[2] = quant_color(quant_level, astc::flt2int_rtn(a0));
+ output[3] = quant_color(quant_level, astc::flt2int_rtn(a1));
+}
+
+/**
+ * @brief Quantize and unquantize a value ensuring top two bits are the same.
+ *
+ * @param quant_level The quantization level to use.
+ * @param value The input unquantized value.
+ * @param[out] quant_value The quantized value.
+ */
+static inline void quantize_and_unquantize_retain_top_two_bits(
+ quant_method quant_level,
+ uint8_t value,
+ uint8_t& quant_value
+) {
+ int perform_loop;
+ uint8_t quantval;
+
+ do
+ {
+ quantval = quant_color(quant_level, value);
+
+ // Perform looping if the top two bits were modified by quant/unquant
+ perform_loop = (value & 0xC0) != (quantval & 0xC0);
+
+ if ((quantval & 0xC0) > (value & 0xC0))
+ {
+ // Quant/unquant rounded UP so that the top two bits changed;
+ // decrement the input in hopes that this will avoid rounding up.
+ value--;
+ }
+ else if ((quantval & 0xC0) < (value & 0xC0))
+ {
+ // Quant/unquant rounded DOWN so that the top two bits changed;
+ // decrement the input in hopes that this will avoid rounding down.
+ value--;
+ }
+ } while (perform_loop);
+
+ quant_value = quantval;
+}
+
+/**
+ * @brief Quantize and unquantize a value ensuring top four bits are the same.
+ *
+ * @param quant_level The quantization level to use.
+ * @param value The input unquantized value.
+ * @param[out] quant_value The quantized value in 0-255 range.
+ */
+static inline void quantize_and_unquantize_retain_top_four_bits(
+ quant_method quant_level,
+ uint8_t value,
+ uint8_t& quant_value
+) {
+ uint8_t perform_loop;
+ uint8_t quantval;
+
+ do
+ {
+ quantval = quant_color(quant_level, value);
+ // Perform looping if the top four bits were modified by quant/unquant
+ perform_loop = (value & 0xF0) != (quantval & 0xF0);
+
+ if ((quantval & 0xF0) > (value & 0xF0))
+ {
+ // Quant/unquant rounded UP so that the top four bits changed;
+ // decrement the input value in hopes that this will avoid rounding up.
+ value--;
+ }
+ else if ((quantval & 0xF0) < (value & 0xF0))
+ {
+ // Quant/unquant rounded DOWN so that the top four bits changed;
+ // decrement the input value in hopes that this will avoid rounding down.
+ value--;
+ }
+ } while (perform_loop);
+
+ quant_value = quantval;
+}
+
+/**
+ * @brief Quantize a HDR RGB color using RGB + offset.
+ *
+ * @param color The input unquantized color endpoint and offset.
+ * @param[out] output The output endpoints, returned as packed RGBS with some mode bits.
+ * @param quant_level The quantization level to use.
+ */
+static void quantize_hdr_rgbo(
+ vfloat4 color,
+ uint8_t output[4],
+ quant_method quant_level
+) {
+ color.set_lane<0>(color.lane<0>() + color.lane<3>());
+ color.set_lane<1>(color.lane<1>() + color.lane<3>());
+ color.set_lane<2>(color.lane<2>() + color.lane<3>());
+
+ color = clamp(0.0f, 65535.0f, color);
+
+ vfloat4 color_bak = color;
+
+ int majcomp;
+ if (color.lane<0>() > color.lane<1>() && color.lane<0>() > color.lane<2>())
+ {
+ majcomp = 0; // red is largest component
+ }
+ else if (color.lane<1>() > color.lane<2>())
+ {
+ majcomp = 1; // green is largest component
+ }
+ else
+ {
+ majcomp = 2; // blue is largest component
+ }
+
+ // swap around the red component and the largest component.
+ switch (majcomp)
+ {
+ case 1:
+ color = color.swz<1, 0, 2, 3>();
+ break;
+ case 2:
+ color = color.swz<2, 1, 0, 3>();
+ break;
+ default:
+ break;
+ }
+
+ static const int mode_bits[5][3] {
+ {11, 5, 7},
+ {11, 6, 5},
+ {10, 5, 8},
+ {9, 6, 7},
+ {8, 7, 6}
+ };
+
+ static const float mode_cutoffs[5][2] {
+ {1024, 4096},
+ {2048, 1024},
+ {2048, 16384},
+ {8192, 16384},
+ {32768, 16384}
+ };
+
+ static const float mode_rscales[5] {
+ 32.0f,
+ 32.0f,
+ 64.0f,
+ 128.0f,
+ 256.0f,
+ };
+
+ static const float mode_scales[5] {
+ 1.0f / 32.0f,
+ 1.0f / 32.0f,
+ 1.0f / 64.0f,
+ 1.0f / 128.0f,
+ 1.0f / 256.0f,
+ };
+
+ float r_base = color.lane<0>();
+ float g_base = color.lane<0>() - color.lane<1>() ;
+ float b_base = color.lane<0>() - color.lane<2>() ;
+ float s_base = color.lane<3>() ;
+
+ for (int mode = 0; mode < 5; mode++)
+ {
+ if (g_base > mode_cutoffs[mode][0] || b_base > mode_cutoffs[mode][0] || s_base > mode_cutoffs[mode][1])
+ {
+ continue;
+ }
+
+ // Encode the mode into a 4-bit vector
+ int mode_enc = mode < 4 ? (mode | (majcomp << 2)) : (majcomp | 0xC);
+
+ float mode_scale = mode_scales[mode];
+ float mode_rscale = mode_rscales[mode];
+
+ int gb_intcutoff = 1 << mode_bits[mode][1];
+ int s_intcutoff = 1 << mode_bits[mode][2];
+
+ // Quantize and unquantize R
+ int r_intval = astc::flt2int_rtn(r_base * mode_scale);
+
+ int r_lowbits = r_intval & 0x3f;
+
+ r_lowbits |= (mode_enc & 3) << 6;
+
+ uint8_t r_quantval;
+ quantize_and_unquantize_retain_top_two_bits(
+ quant_level, static_cast<uint8_t>(r_lowbits), r_quantval);
+
+ r_intval = (r_intval & ~0x3f) | (r_quantval & 0x3f);
+ float r_fval = static_cast<float>(r_intval) * mode_rscale;
+
+ // Recompute G and B, then quantize and unquantize them
+ float g_fval = r_fval - color.lane<1>() ;
+ float b_fval = r_fval - color.lane<2>() ;
+
+ g_fval = astc::clamp(g_fval, 0.0f, 65535.0f);
+ b_fval = astc::clamp(b_fval, 0.0f, 65535.0f);
+
+ int g_intval = astc::flt2int_rtn(g_fval * mode_scale);
+ int b_intval = astc::flt2int_rtn(b_fval * mode_scale);
+
+ if (g_intval >= gb_intcutoff || b_intval >= gb_intcutoff)
+ {
+ continue;
+ }
+
+ int g_lowbits = g_intval & 0x1f;
+ int b_lowbits = b_intval & 0x1f;
+
+ int bit0 = 0;
+ int bit1 = 0;
+ int bit2 = 0;
+ int bit3 = 0;
+
+ switch (mode)
+ {
+ case 0:
+ case 2:
+ bit0 = (r_intval >> 9) & 1;
+ break;
+ case 1:
+ case 3:
+ bit0 = (r_intval >> 8) & 1;
+ break;
+ case 4:
+ case 5:
+ bit0 = (g_intval >> 6) & 1;
+ break;
+ }
+
+ switch (mode)
+ {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ bit2 = (r_intval >> 7) & 1;
+ break;
+ case 4:
+ case 5:
+ bit2 = (b_intval >> 6) & 1;
+ break;
+ }
+
+ switch (mode)
+ {
+ case 0:
+ case 2:
+ bit1 = (r_intval >> 8) & 1;
+ break;
+ case 1:
+ case 3:
+ case 4:
+ case 5:
+ bit1 = (g_intval >> 5) & 1;
+ break;
+ }
+
+ switch (mode)
+ {
+ case 0:
+ bit3 = (r_intval >> 10) & 1;
+ break;
+ case 2:
+ bit3 = (r_intval >> 6) & 1;
+ break;
+ case 1:
+ case 3:
+ case 4:
+ case 5:
+ bit3 = (b_intval >> 5) & 1;
+ break;
+ }
+
+ g_lowbits |= (mode_enc & 0x4) << 5;
+ b_lowbits |= (mode_enc & 0x8) << 4;
+
+ g_lowbits |= bit0 << 6;
+ g_lowbits |= bit1 << 5;
+ b_lowbits |= bit2 << 6;
+ b_lowbits |= bit3 << 5;
+
+ uint8_t g_quantval;
+ uint8_t b_quantval;
+
+ quantize_and_unquantize_retain_top_four_bits(
+ quant_level, static_cast<uint8_t>(g_lowbits), g_quantval);
+ quantize_and_unquantize_retain_top_four_bits(
+ quant_level, static_cast<uint8_t>(b_lowbits), b_quantval);
+
+ g_intval = (g_intval & ~0x1f) | (g_quantval & 0x1f);
+ b_intval = (b_intval & ~0x1f) | (b_quantval & 0x1f);
+
+ g_fval = static_cast<float>(g_intval) * mode_rscale;
+ b_fval = static_cast<float>(b_intval) * mode_rscale;
+
+ // Recompute the scale value, based on the errors introduced to red, green and blue
+
+ // If the error is positive, then the R,G,B errors combined have raised the color
+ // value overall; as such, the scale value needs to be increased.
+ float rgb_errorsum = (r_fval - color.lane<0>() ) + (r_fval - g_fval - color.lane<1>() ) + (r_fval - b_fval - color.lane<2>() );
+
+ float s_fval = s_base + rgb_errorsum * (1.0f / 3.0f);
+ s_fval = astc::clamp(s_fval, 0.0f, 1e9f);
+
+ int s_intval = astc::flt2int_rtn(s_fval * mode_scale);
+
+ if (s_intval >= s_intcutoff)
+ {
+ continue;
+ }
+
+ int s_lowbits = s_intval & 0x1f;
+
+ int bit4;
+ int bit5;
+ int bit6;
+ switch (mode)
+ {
+ case 1:
+ bit6 = (r_intval >> 9) & 1;
+ break;
+ default:
+ bit6 = (s_intval >> 5) & 1;
+ break;
+ }
+
+ switch (mode)
+ {
+ case 4:
+ bit5 = (r_intval >> 7) & 1;
+ break;
+ case 1:
+ bit5 = (r_intval >> 10) & 1;
+ break;
+ default:
+ bit5 = (s_intval >> 6) & 1;
+ break;
+ }
+
+ switch (mode)
+ {
+ case 2:
+ bit4 = (s_intval >> 7) & 1;
+ break;
+ default:
+ bit4 = (r_intval >> 6) & 1;
+ break;
+ }
+
+ s_lowbits |= bit6 << 5;
+ s_lowbits |= bit5 << 6;
+ s_lowbits |= bit4 << 7;
+
+ uint8_t s_quantval;
+
+ quantize_and_unquantize_retain_top_four_bits(
+ quant_level, static_cast<uint8_t>(s_lowbits), s_quantval);
+
+ output[0] = r_quantval;
+ output[1] = g_quantval;
+ output[2] = b_quantval;
+ output[3] = s_quantval;
+ return;
+ }
+
+ // Failed to encode any of the modes above? In that case encode using mode #5
+ float vals[4];
+ vals[0] = color_bak.lane<0>();
+ vals[1] = color_bak.lane<1>();
+ vals[2] = color_bak.lane<2>();
+ vals[3] = color_bak.lane<3>();
+
+ int ivals[4];
+ float cvals[3];
+
+ for (int i = 0; i < 3; i++)
+ {
+ vals[i] = astc::clamp(vals[i], 0.0f, 65020.0f);
+ ivals[i] = astc::flt2int_rtn(vals[i] * (1.0f / 512.0f));
+ cvals[i] = static_cast<float>(ivals[i]) * 512.0f;
+ }
+
+ float rgb_errorsum = (cvals[0] - vals[0]) + (cvals[1] - vals[1]) + (cvals[2] - vals[2]);
+ vals[3] += rgb_errorsum * (1.0f / 3.0f);
+
+ vals[3] = astc::clamp(vals[3], 0.0f, 65020.0f);
+ ivals[3] = astc::flt2int_rtn(vals[3] * (1.0f / 512.0f));
+
+ int encvals[4];
+ encvals[0] = (ivals[0] & 0x3f) | 0xC0;
+ encvals[1] = (ivals[1] & 0x7f) | 0x80;
+ encvals[2] = (ivals[2] & 0x7f) | 0x80;
+ encvals[3] = (ivals[3] & 0x7f) | ((ivals[0] & 0x40) << 1);
+
+ for (uint8_t i = 0; i < 4; i++)
+ {
+ quantize_and_unquantize_retain_top_four_bits(
+ quant_level, static_cast<uint8_t>(encvals[i]), output[i]);
+ }
+
+ return;
+}
+
+/**
+ * @brief Quantize a HDR RGB color using direct RGB encoding.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as packed RGB+RGB pairs with mode bits.
+ * @param quant_level The quantization level to use.
+ */
+static void quantize_hdr_rgb(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[6],
+ quant_method quant_level
+) {
+ // Note: color*.lane<3> is not used so we can ignore it
+ color0 = clamp(0.0f, 65535.0f, color0);
+ color1 = clamp(0.0f, 65535.0f, color1);
+
+ vfloat4 color0_bak = color0;
+ vfloat4 color1_bak = color1;
+
+ int majcomp;
+ if (color1.lane<0>() > color1.lane<1>() && color1.lane<0>() > color1.lane<2>())
+ {
+ majcomp = 0;
+ }
+ else if (color1.lane<1>() > color1.lane<2>())
+ {
+ majcomp = 1;
+ }
+ else
+ {
+ majcomp = 2;
+ }
+
+ // Swizzle the components
+ switch (majcomp)
+ {
+ case 1: // red-green swap
+ color0 = color0.swz<1, 0, 2, 3>();
+ color1 = color1.swz<1, 0, 2, 3>();
+ break;
+ case 2: // red-blue swap
+ color0 = color0.swz<2, 1, 0, 3>();
+ color1 = color1.swz<2, 1, 0, 3>();
+ break;
+ default:
+ break;
+ }
+
+ float a_base = color1.lane<0>();
+ a_base = astc::clamp(a_base, 0.0f, 65535.0f);
+
+ float b0_base = a_base - color1.lane<1>();
+ float b1_base = a_base - color1.lane<2>();
+ float c_base = a_base - color0.lane<0>();
+ float d0_base = a_base - b0_base - c_base - color0.lane<1>();
+ float d1_base = a_base - b1_base - c_base - color0.lane<2>();
+
+ // Number of bits in the various fields in the various modes
+ static const int mode_bits[8][4] {
+ {9, 7, 6, 7},
+ {9, 8, 6, 6},
+ {10, 6, 7, 7},
+ {10, 7, 7, 6},
+ {11, 8, 6, 5},
+ {11, 6, 8, 6},
+ {12, 7, 7, 5},
+ {12, 6, 7, 6}
+ };
+
+ // Cutoffs to use for the computed values of a,b,c,d, assuming the
+ // range 0..65535 are LNS values corresponding to fp16.
+ static const float mode_cutoffs[8][4] {
+ {16384, 8192, 8192, 8}, // mode 0: 9,7,6,7
+ {32768, 8192, 4096, 8}, // mode 1: 9,8,6,6
+ {4096, 8192, 4096, 4}, // mode 2: 10,6,7,7
+ {8192, 8192, 2048, 4}, // mode 3: 10,7,7,6
+ {8192, 2048, 512, 2}, // mode 4: 11,8,6,5
+ {2048, 8192, 1024, 2}, // mode 5: 11,6,8,6
+ {2048, 2048, 256, 1}, // mode 6: 12,7,7,5
+ {1024, 2048, 512, 1}, // mode 7: 12,6,7,6
+ };
+
+ static const float mode_scales[8] {
+ 1.0f / 128.0f,
+ 1.0f / 128.0f,
+ 1.0f / 64.0f,
+ 1.0f / 64.0f,
+ 1.0f / 32.0f,
+ 1.0f / 32.0f,
+ 1.0f / 16.0f,
+ 1.0f / 16.0f,
+ };
+
+ // Scaling factors when going from what was encoded in the mode to 16 bits.
+ static const float mode_rscales[8] {
+ 128.0f,
+ 128.0f,
+ 64.0f,
+ 64.0f,
+ 32.0f,
+ 32.0f,
+ 16.0f,
+ 16.0f
+ };
+
+ // Try modes one by one, with the highest-precision mode first.
+ for (int mode = 7; mode >= 0; mode--)
+ {
+ // For each mode, test if we can in fact accommodate the computed b, c, and d values.
+ // If we clearly can't, then we skip to the next mode.
+
+ float b_cutoff = mode_cutoffs[mode][0];
+ float c_cutoff = mode_cutoffs[mode][1];
+ float d_cutoff = mode_cutoffs[mode][2];
+
+ if (b0_base > b_cutoff || b1_base > b_cutoff || c_base > c_cutoff || fabsf(d0_base) > d_cutoff || fabsf(d1_base) > d_cutoff)
+ {
+ continue;
+ }
+
+ float mode_scale = mode_scales[mode];
+ float mode_rscale = mode_rscales[mode];
+
+ int b_intcutoff = 1 << mode_bits[mode][1];
+ int c_intcutoff = 1 << mode_bits[mode][2];
+ int d_intcutoff = 1 << (mode_bits[mode][3] - 1);
+
+ // Quantize and unquantize A, with the assumption that its high bits can be handled safely.
+ int a_intval = astc::flt2int_rtn(a_base * mode_scale);
+ int a_lowbits = a_intval & 0xFF;
+
+ int a_quantval = quant_color(quant_level, a_lowbits);
+ int a_uquantval = a_quantval;
+ a_intval = (a_intval & ~0xFF) | a_uquantval;
+ float a_fval = static_cast<float>(a_intval) * mode_rscale;
+
+ // Recompute C, then quantize and unquantize it
+ float c_fval = a_fval - color0.lane<0>();
+ c_fval = astc::clamp(c_fval, 0.0f, 65535.0f);
+
+ int c_intval = astc::flt2int_rtn(c_fval * mode_scale);
+
+ if (c_intval >= c_intcutoff)
+ {
+ continue;
+ }
+
+ int c_lowbits = c_intval & 0x3f;
+
+ c_lowbits |= (mode & 1) << 7;
+ c_lowbits |= (a_intval & 0x100) >> 2;
+
+ uint8_t c_quantval;
+
+ quantize_and_unquantize_retain_top_two_bits(
+ quant_level, static_cast<uint8_t>(c_lowbits), c_quantval);
+
+ c_intval = (c_intval & ~0x3F) | (c_quantval & 0x3F);
+ c_fval = static_cast<float>(c_intval) * mode_rscale;
+
+ // Recompute B0 and B1, then quantize and unquantize them
+ float b0_fval = a_fval - color1.lane<1>();
+ float b1_fval = a_fval - color1.lane<2>();
+
+ b0_fval = astc::clamp(b0_fval, 0.0f, 65535.0f);
+ b1_fval = astc::clamp(b1_fval, 0.0f, 65535.0f);
+ int b0_intval = astc::flt2int_rtn(b0_fval * mode_scale);
+ int b1_intval = astc::flt2int_rtn(b1_fval * mode_scale);
+
+ if (b0_intval >= b_intcutoff || b1_intval >= b_intcutoff)
+ {
+ continue;
+ }
+
+ int b0_lowbits = b0_intval & 0x3f;
+ int b1_lowbits = b1_intval & 0x3f;
+
+ int bit0 = 0;
+ int bit1 = 0;
+ switch (mode)
+ {
+ case 0:
+ case 1:
+ case 3:
+ case 4:
+ case 6:
+ bit0 = (b0_intval >> 6) & 1;
+ break;
+ case 2:
+ case 5:
+ case 7:
+ bit0 = (a_intval >> 9) & 1;
+ break;
+ }
+
+ switch (mode)
+ {
+ case 0:
+ case 1:
+ case 3:
+ case 4:
+ case 6:
+ bit1 = (b1_intval >> 6) & 1;
+ break;
+ case 2:
+ bit1 = (c_intval >> 6) & 1;
+ break;
+ case 5:
+ case 7:
+ bit1 = (a_intval >> 10) & 1;
+ break;
+ }
+
+ b0_lowbits |= bit0 << 6;
+ b1_lowbits |= bit1 << 6;
+
+ b0_lowbits |= ((mode >> 1) & 1) << 7;
+ b1_lowbits |= ((mode >> 2) & 1) << 7;
+
+ uint8_t b0_quantval;
+ uint8_t b1_quantval;
+
+ quantize_and_unquantize_retain_top_two_bits(
+ quant_level, static_cast<uint8_t>(b0_lowbits), b0_quantval);
+ quantize_and_unquantize_retain_top_two_bits(
+ quant_level, static_cast<uint8_t>(b1_lowbits), b1_quantval);
+
+ b0_intval = (b0_intval & ~0x3f) | (b0_quantval & 0x3f);
+ b1_intval = (b1_intval & ~0x3f) | (b1_quantval & 0x3f);
+ b0_fval = static_cast<float>(b0_intval) * mode_rscale;
+ b1_fval = static_cast<float>(b1_intval) * mode_rscale;
+
+ // Recompute D0 and D1, then quantize and unquantize them
+ float d0_fval = a_fval - b0_fval - c_fval - color0.lane<1>();
+ float d1_fval = a_fval - b1_fval - c_fval - color0.lane<2>();
+
+ d0_fval = astc::clamp(d0_fval, -65535.0f, 65535.0f);
+ d1_fval = astc::clamp(d1_fval, -65535.0f, 65535.0f);
+
+ int d0_intval = astc::flt2int_rtn(d0_fval * mode_scale);
+ int d1_intval = astc::flt2int_rtn(d1_fval * mode_scale);
+
+ if (abs(d0_intval) >= d_intcutoff || abs(d1_intval) >= d_intcutoff)
+ {
+ continue;
+ }
+
+ int d0_lowbits = d0_intval & 0x1f;
+ int d1_lowbits = d1_intval & 0x1f;
+
+ int bit2 = 0;
+ int bit3 = 0;
+ int bit4;
+ int bit5;
+ switch (mode)
+ {
+ case 0:
+ case 2:
+ bit2 = (d0_intval >> 6) & 1;
+ break;
+ case 1:
+ case 4:
+ bit2 = (b0_intval >> 7) & 1;
+ break;
+ case 3:
+ bit2 = (a_intval >> 9) & 1;
+ break;
+ case 5:
+ bit2 = (c_intval >> 7) & 1;
+ break;
+ case 6:
+ case 7:
+ bit2 = (a_intval >> 11) & 1;
+ break;
+ }
+ switch (mode)
+ {
+ case 0:
+ case 2:
+ bit3 = (d1_intval >> 6) & 1;
+ break;
+ case 1:
+ case 4:
+ bit3 = (b1_intval >> 7) & 1;
+ break;
+ case 3:
+ case 5:
+ case 6:
+ case 7:
+ bit3 = (c_intval >> 6) & 1;
+ break;
+ }
+
+ switch (mode)
+ {
+ case 4:
+ case 6:
+ bit4 = (a_intval >> 9) & 1;
+ bit5 = (a_intval >> 10) & 1;
+ break;
+ default:
+ bit4 = (d0_intval >> 5) & 1;
+ bit5 = (d1_intval >> 5) & 1;
+ break;
+ }
+
+ d0_lowbits |= bit2 << 6;
+ d1_lowbits |= bit3 << 6;
+ d0_lowbits |= bit4 << 5;
+ d1_lowbits |= bit5 << 5;
+
+ d0_lowbits |= (majcomp & 1) << 7;
+ d1_lowbits |= ((majcomp >> 1) & 1) << 7;
+
+ uint8_t d0_quantval;
+ uint8_t d1_quantval;
+
+ quantize_and_unquantize_retain_top_four_bits(
+ quant_level, static_cast<uint8_t>(d0_lowbits), d0_quantval);
+ quantize_and_unquantize_retain_top_four_bits(
+ quant_level, static_cast<uint8_t>(d1_lowbits), d1_quantval);
+
+ output[0] = static_cast<uint8_t>(a_quantval);
+ output[1] = c_quantval;
+ output[2] = b0_quantval;
+ output[3] = b1_quantval;
+ output[4] = d0_quantval;
+ output[5] = d1_quantval;
+ return;
+ }
+
+ // If neither of the modes fit we will use a flat representation for storing data, using 8 bits
+ // for red and green, and 7 bits for blue. This gives color accuracy roughly similar to LDR
+ // 4:4:3 which is not at all great but usable. This representation is used if the light color is
+ // more than 4x the color value of the dark color.
+ float vals[6];
+ vals[0] = color0_bak.lane<0>();
+ vals[1] = color1_bak.lane<0>();
+ vals[2] = color0_bak.lane<1>();
+ vals[3] = color1_bak.lane<1>();
+ vals[4] = color0_bak.lane<2>();
+ vals[5] = color1_bak.lane<2>();
+
+ for (int i = 0; i < 6; i++)
+ {
+ vals[i] = astc::clamp(vals[i], 0.0f, 65020.0f);
+ }
+
+ for (int i = 0; i < 4; i++)
+ {
+ int idx = astc::flt2int_rtn(vals[i] * 1.0f / 256.0f);
+ output[i] = quant_color(quant_level, idx);
+ }
+
+ for (int i = 4; i < 6; i++)
+ {
+ int idx = astc::flt2int_rtn(vals[i] * 1.0f / 512.0f) + 128;
+ quantize_and_unquantize_retain_top_two_bits(
+ quant_level, static_cast<uint8_t>(idx), output[i]);
+ }
+
+ return;
+}
+
+/**
+ * @brief Quantize a HDR RGB + LDR A color using direct RGBA encoding.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as packed RGBA+RGBA pairs with mode bits.
+ * @param quant_level The quantization level to use.
+ */
+static void quantize_hdr_rgb_ldr_alpha(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[8],
+ quant_method quant_level
+) {
+ float scale = 1.0f / 257.0f;
+
+ float a0 = astc::clamp255f(color0.lane<3>() * scale);
+ float a1 = astc::clamp255f(color1.lane<3>() * scale);
+
+ output[6] = quant_color(quant_level, astc::flt2int_rtn(a0));
+ output[7] = quant_color(quant_level, astc::flt2int_rtn(a1));
+
+ quantize_hdr_rgb(color0, color1, output, quant_level);
+}
+
+/**
+ * @brief Quantize a HDR L color using the large range encoding.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as packed (l0, l1).
+ * @param quant_level The quantization level to use.
+ */
+static void quantize_hdr_luminance_large_range(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[2],
+ quant_method quant_level
+) {
+ float lum0 = hadd_rgb_s(color0) * (1.0f / 3.0f);
+ float lum1 = hadd_rgb_s(color1) * (1.0f / 3.0f);
+
+ if (lum1 < lum0)
+ {
+ float avg = (lum0 + lum1) * 0.5f;
+ lum0 = avg;
+ lum1 = avg;
+ }
+
+ int ilum1 = astc::flt2int_rtn(lum1);
+ int ilum0 = astc::flt2int_rtn(lum0);
+
+ // Find the closest encodable point in the upper half of the code-point space
+ int upper_v0 = (ilum0 + 128) >> 8;
+ int upper_v1 = (ilum1 + 128) >> 8;
+
+ upper_v0 = astc::clamp(upper_v0, 0, 255);
+ upper_v1 = astc::clamp(upper_v1, 0, 255);
+
+ // Find the closest encodable point in the lower half of the code-point space
+ int lower_v0 = (ilum1 + 256) >> 8;
+ int lower_v1 = ilum0 >> 8;
+
+ lower_v0 = astc::clamp(lower_v0, 0, 255);
+ lower_v1 = astc::clamp(lower_v1, 0, 255);
+
+ // Determine the distance between the point in code-point space and the input value
+ int upper0_dec = upper_v0 << 8;
+ int upper1_dec = upper_v1 << 8;
+ int lower0_dec = (lower_v1 << 8) + 128;
+ int lower1_dec = (lower_v0 << 8) - 128;
+
+ int upper0_diff = upper0_dec - ilum0;
+ int upper1_diff = upper1_dec - ilum1;
+ int lower0_diff = lower0_dec - ilum0;
+ int lower1_diff = lower1_dec - ilum1;
+
+ int upper_error = (upper0_diff * upper0_diff) + (upper1_diff * upper1_diff);
+ int lower_error = (lower0_diff * lower0_diff) + (lower1_diff * lower1_diff);
+
+ int v0, v1;
+ if (upper_error < lower_error)
+ {
+ v0 = upper_v0;
+ v1 = upper_v1;
+ }
+ else
+ {
+ v0 = lower_v0;
+ v1 = lower_v1;
+ }
+
+ // OK; encode
+ output[0] = quant_color(quant_level, v0);
+ output[1] = quant_color(quant_level, v1);
+}
+
+/**
+ * @brief Quantize a HDR L color using the small range encoding.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as packed (l0, l1) with mode bits.
+ * @param quant_level The quantization level to use.
+ *
+ * @return Returns @c false on failure, @c true on success.
+ */
+static bool try_quantize_hdr_luminance_small_range(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[2],
+ quant_method quant_level
+) {
+ float lum0 = hadd_rgb_s(color0) * (1.0f / 3.0f);
+ float lum1 = hadd_rgb_s(color1) * (1.0f / 3.0f);
+
+ if (lum1 < lum0)
+ {
+ float avg = (lum0 + lum1) * 0.5f;
+ lum0 = avg;
+ lum1 = avg;
+ }
+
+ int ilum1 = astc::flt2int_rtn(lum1);
+ int ilum0 = astc::flt2int_rtn(lum0);
+
+ // Difference of more than a factor-of-2 results in immediate failure
+ if (ilum1 - ilum0 > 2048)
+ {
+ return false;
+ }
+
+ int lowval, highval, diffval;
+ int v0, v1;
+ int v0e, v1e;
+ int v0d, v1d;
+
+ // Try to encode the high-precision submode
+ lowval = (ilum0 + 16) >> 5;
+ highval = (ilum1 + 16) >> 5;
+
+ lowval = astc::clamp(lowval, 0, 2047);
+ highval = astc::clamp(highval, 0, 2047);
+
+ v0 = lowval & 0x7F;
+ v0e = quant_color(quant_level, v0);
+ v0d = v0e;
+
+ if (v0d < 0x80)
+ {
+ lowval = (lowval & ~0x7F) | v0d;
+ diffval = highval - lowval;
+ if (diffval >= 0 && diffval <= 15)
+ {
+ v1 = ((lowval >> 3) & 0xF0) | diffval;
+ v1e = quant_color(quant_level, v1);
+ v1d = v1e;
+ if ((v1d & 0xF0) == (v1 & 0xF0))
+ {
+ output[0] = static_cast<uint8_t>(v0e);
+ output[1] = static_cast<uint8_t>(v1e);
+ return true;
+ }
+ }
+ }
+
+ // Try to encode the low-precision submode
+ lowval = (ilum0 + 32) >> 6;
+ highval = (ilum1 + 32) >> 6;
+
+ lowval = astc::clamp(lowval, 0, 1023);
+ highval = astc::clamp(highval, 0, 1023);
+
+ v0 = (lowval & 0x7F) | 0x80;
+ v0e = quant_color(quant_level, v0);
+ v0d = v0e;
+ if ((v0d & 0x80) == 0)
+ {
+ return false;
+ }
+
+ lowval = (lowval & ~0x7F) | (v0d & 0x7F);
+ diffval = highval - lowval;
+ if (diffval < 0 || diffval > 31)
+ {
+ return false;
+ }
+
+ v1 = ((lowval >> 2) & 0xE0) | diffval;
+ v1e = quant_color(quant_level, v1);
+ v1d = v1e;
+ if ((v1d & 0xE0) != (v1 & 0xE0))
+ {
+ return false;
+ }
+
+ output[0] = static_cast<uint8_t>(v0e);
+ output[1] = static_cast<uint8_t>(v1e);
+ return true;
+}
+
+/**
+ * @brief Quantize a HDR A color using either delta or direct RGBA encoding.
+ *
+ * @param alpha0 The input unquantized color0 endpoint.
+ * @param alpha1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as packed RGBA+RGBA pairs with mode bits.
+ * @param quant_level The quantization level to use.
+ */
+static void quantize_hdr_alpha(
+ float alpha0,
+ float alpha1,
+ uint8_t output[2],
+ quant_method quant_level
+) {
+ alpha0 = astc::clamp(alpha0, 0.0f, 65280.0f);
+ alpha1 = astc::clamp(alpha1, 0.0f, 65280.0f);
+
+ int ialpha0 = astc::flt2int_rtn(alpha0);
+ int ialpha1 = astc::flt2int_rtn(alpha1);
+
+ int val0, val1, diffval;
+ int v6, v7;
+ int v6e, v7e;
+ int v6d, v7d;
+
+ // Try to encode one of the delta submodes, in decreasing-precision order
+ for (int i = 2; i >= 0; i--)
+ {
+ val0 = (ialpha0 + (128 >> i)) >> (8 - i);
+ val1 = (ialpha1 + (128 >> i)) >> (8 - i);
+
+ v6 = (val0 & 0x7F) | ((i & 1) << 7);
+ v6e = quant_color(quant_level, v6);
+ v6d = v6e;
+
+ if ((v6 ^ v6d) & 0x80)
+ {
+ continue;
+ }
+
+ val0 = (val0 & ~0x7f) | (v6d & 0x7f);
+ diffval = val1 - val0;
+ int cutoff = 32 >> i;
+ int mask = 2 * cutoff - 1;
+
+ if (diffval < -cutoff || diffval >= cutoff)
+ {
+ continue;
+ }
+
+ v7 = ((i & 2) << 6) | ((val0 >> 7) << (6 - i)) | (diffval & mask);
+ v7e = quant_color(quant_level, v7);
+ v7d = v7e;
+
+ static const int testbits[3] { 0xE0, 0xF0, 0xF8 };
+
+ if ((v7 ^ v7d) & testbits[i])
+ {
+ continue;
+ }
+
+ output[0] = static_cast<uint8_t>(v6e);
+ output[1] = static_cast<uint8_t>(v7e);
+ return;
+ }
+
+ // Could not encode any of the delta modes; instead encode a flat value
+ val0 = (ialpha0 + 256) >> 9;
+ val1 = (ialpha1 + 256) >> 9;
+ v6 = val0 | 0x80;
+ v7 = val1 | 0x80;
+
+ output[0] = quant_color(quant_level, v6);
+ output[1] = quant_color(quant_level, v7);
+
+ return;
+}
+
+/**
+ * @brief Quantize a HDR RGBA color using either delta or direct RGBA encoding.
+ *
+ * @param color0 The input unquantized color0 endpoint.
+ * @param color1 The input unquantized color1 endpoint.
+ * @param[out] output The output endpoints, returned as packed RGBA+RGBA pairs with mode bits.
+ * @param quant_level The quantization level to use.
+ */
+static void quantize_hdr_rgb_alpha(
+ vfloat4 color0,
+ vfloat4 color1,
+ uint8_t output[8],
+ quant_method quant_level
+) {
+ quantize_hdr_rgb(color0, color1, output, quant_level);
+ quantize_hdr_alpha(color0.lane<3>(), color1.lane<3>(), output + 6, quant_level);
+}
+
+/* See header for documentation. */
+uint8_t pack_color_endpoints(
+ vfloat4 color0,
+ vfloat4 color1,
+ vfloat4 rgbs_color,
+ vfloat4 rgbo_color,
+ int format,
+ uint8_t* output,
+ quant_method quant_level
+) {
+ assert(QUANT_6 <= quant_level && quant_level <= QUANT_256);
+
+ // We do not support negative colors
+ color0 = max(color0, 0.0f);
+ color1 = max(color1, 0.0f);
+
+ uint8_t retval = 0;
+
+ switch (format)
+ {
+ case FMT_RGB:
+ if (quant_level <= 18)
+ {
+ if (try_quantize_rgb_delta_blue_contract(color0, color1, output, quant_level))
+ {
+ retval = FMT_RGB_DELTA;
+ break;
+ }
+ if (try_quantize_rgb_delta(color0, color1, output, quant_level))
+ {
+ retval = FMT_RGB_DELTA;
+ break;
+ }
+ }
+ if (try_quantize_rgb_blue_contract(color0, color1, output, quant_level))
+ {
+ retval = FMT_RGB;
+ break;
+ }
+ quantize_rgb(color0, color1, output, quant_level);
+ retval = FMT_RGB;
+ break;
+
+ case FMT_RGBA:
+ if (quant_level <= 18)
+ {
+ if (try_quantize_rgba_delta_blue_contract(color0, color1, output, quant_level))
+ {
+ retval = FMT_RGBA_DELTA;
+ break;
+ }
+ if (try_quantize_rgba_delta(color0, color1, output, quant_level))
+ {
+ retval = FMT_RGBA_DELTA;
+ break;
+ }
+ }
+ if (try_quantize_rgba_blue_contract(color0, color1, output, quant_level))
+ {
+ retval = FMT_RGBA;
+ break;
+ }
+ quantize_rgba(color0, color1, output, quant_level);
+ retval = FMT_RGBA;
+ break;
+
+ case FMT_RGB_SCALE:
+ quantize_rgbs(rgbs_color, output, quant_level);
+ retval = FMT_RGB_SCALE;
+ break;
+
+ case FMT_HDR_RGB_SCALE:
+ quantize_hdr_rgbo(rgbo_color, output, quant_level);
+ retval = FMT_HDR_RGB_SCALE;
+ break;
+
+ case FMT_HDR_RGB:
+ quantize_hdr_rgb(color0, color1, output, quant_level);
+ retval = FMT_HDR_RGB;
+ break;
+
+ case FMT_RGB_SCALE_ALPHA:
+ quantize_rgbs_alpha(color0, color1, rgbs_color, output, quant_level);
+ retval = FMT_RGB_SCALE_ALPHA;
+ break;
+
+ case FMT_HDR_LUMINANCE_SMALL_RANGE:
+ case FMT_HDR_LUMINANCE_LARGE_RANGE:
+ if (try_quantize_hdr_luminance_small_range(color0, color1, output, quant_level))
+ {
+ retval = FMT_HDR_LUMINANCE_SMALL_RANGE;
+ break;
+ }
+ quantize_hdr_luminance_large_range(color0, color1, output, quant_level);
+ retval = FMT_HDR_LUMINANCE_LARGE_RANGE;
+ break;
+
+ case FMT_LUMINANCE:
+ quantize_luminance(color0, color1, output, quant_level);
+ retval = FMT_LUMINANCE;
+ break;
+
+ case FMT_LUMINANCE_ALPHA:
+ if (quant_level <= 18)
+ {
+ if (try_quantize_luminance_alpha_delta(color0, color1, output, quant_level))
+ {
+ retval = FMT_LUMINANCE_ALPHA_DELTA;
+ break;
+ }
+ }
+ quantize_luminance_alpha(color0, color1, output, quant_level);
+ retval = FMT_LUMINANCE_ALPHA;
+ break;
+
+ case FMT_HDR_RGB_LDR_ALPHA:
+ quantize_hdr_rgb_ldr_alpha(color0, color1, output, quant_level);
+ retval = FMT_HDR_RGB_LDR_ALPHA;
+ break;
+
+ case FMT_HDR_RGBA:
+ quantize_hdr_rgb_alpha(color0, color1, output, quant_level);
+ retval = FMT_HDR_RGBA;
+ break;
+ }
+
+ return retval;
+}
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_color_unquantize.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_color_unquantize.cpp
new file mode 100644
index 00000000000..d31895a627b
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_color_unquantize.cpp
@@ -0,0 +1,941 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2021 Arm Limited
+//
+// 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 <utility>
+
+/**
+ * @brief Functions for color unquantization.
+ */
+
+#include "astcenc_internal.h"
+
+/**
+ * @brief Un-blue-contract a color.
+ *
+ * This function reverses any applied blue contraction.
+ *
+ * @param input The input color that has been blue-contracted.
+ *
+ * @return The uncontracted color.
+ */
+static ASTCENC_SIMD_INLINE vint4 uncontract_color(
+ vint4 input
+) {
+ vmask4 mask(true, true, false, false);
+ vint4 bc0 = asr<1>(input + input.lane<2>());
+ return select(input, bc0, mask);
+}
+
+/**
+ * @brief Unpack an LDR RGBA color that uses delta encoding.
+ *
+ * @param input0 The packed endpoint 0 color.
+ * @param input1 The packed endpoint 1 color deltas.
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void rgba_delta_unpack(
+ vint4 input0,
+ vint4 input1,
+ vint4& output0,
+ vint4& output1
+) {
+ // Apply bit transfer
+ bit_transfer_signed(input1, input0);
+
+ // Apply blue-uncontraction if needed
+ int rgb_sum = hadd_rgb_s(input1);
+ input1 = input1 + input0;
+ if (rgb_sum < 0)
+ {
+ input0 = uncontract_color(input0);
+ input1 = uncontract_color(input1);
+ std::swap(input0, input1);
+ }
+
+ output0 = clamp(0, 255, input0);
+ output1 = clamp(0, 255, input1);
+}
+
+/**
+ * @brief Unpack an LDR RGB color that uses delta encoding.
+ *
+ * Output alpha set to 255.
+ *
+ * @param input0 The packed endpoint 0 color.
+ * @param input1 The packed endpoint 1 color deltas.
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void rgb_delta_unpack(
+ vint4 input0,
+ vint4 input1,
+ vint4& output0,
+ vint4& output1
+) {
+ rgba_delta_unpack(input0, input1, output0, output1);
+ output0.set_lane<3>(255);
+ output1.set_lane<3>(255);
+}
+
+/**
+ * @brief Unpack an LDR RGBA color that uses direct encoding.
+ *
+ * @param input0 The packed endpoint 0 color.
+ * @param input1 The packed endpoint 1 color.
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void rgba_unpack(
+ vint4 input0,
+ vint4 input1,
+ vint4& output0,
+ vint4& output1
+) {
+ // Apply blue-uncontraction if needed
+ if (hadd_rgb_s(input0) > hadd_rgb_s(input1))
+ {
+ input0 = uncontract_color(input0);
+ input1 = uncontract_color(input1);
+ std::swap(input0, input1);
+ }
+
+ output0 = input0;
+ output1 = input1;
+}
+
+/**
+ * @brief Unpack an LDR RGB color that uses direct encoding.
+ *
+ * Output alpha set to 255.
+ *
+ * @param input0 The packed endpoint 0 color.
+ * @param input1 The packed endpoint 1 color.
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void rgb_unpack(
+ vint4 input0,
+ vint4 input1,
+ vint4& output0,
+ vint4& output1
+) {
+ rgba_unpack(input0, input1, output0, output1);
+ output0.set_lane<3>(255);
+ output1.set_lane<3>(255);
+}
+
+/**
+ * @brief Unpack an LDR RGBA color that uses scaled encoding.
+ *
+ * Note only the RGB channels use the scaled encoding, alpha uses direct.
+ *
+ * @param input0 The packed endpoint 0 color.
+ * @param alpha1 The packed endpoint 1 alpha value.
+ * @param scale The packed quantized scale.
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void rgb_scale_alpha_unpack(
+ vint4 input0,
+ uint8_t alpha1,
+ uint8_t scale,
+ vint4& output0,
+ vint4& output1
+) {
+ output1 = input0;
+ output1.set_lane<3>(alpha1);
+
+ output0 = asr<8>(input0 * scale);
+ output0.set_lane<3>(input0.lane<3>());
+}
+
+/**
+ * @brief Unpack an LDR RGB color that uses scaled encoding.
+ *
+ * Output alpha is 255.
+ *
+ * @param input0 The packed endpoint 0 color.
+ * @param scale The packed scale.
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void rgb_scale_unpack(
+ vint4 input0,
+ int scale,
+ vint4& output0,
+ vint4& output1
+) {
+ output1 = input0;
+ output1.set_lane<3>(255);
+
+ output0 = asr<8>(input0 * scale);
+ output0.set_lane<3>(255);
+}
+
+/**
+ * @brief Unpack an LDR L color that uses direct encoding.
+ *
+ * Output alpha is 255.
+ *
+ * @param input The packed endpoints.
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void luminance_unpack(
+ const uint8_t input[2],
+ vint4& output0,
+ vint4& output1
+) {
+ int lum0 = input[0];
+ int lum1 = input[1];
+ output0 = vint4(lum0, lum0, lum0, 255);
+ output1 = vint4(lum1, lum1, lum1, 255);
+}
+
+/**
+ * @brief Unpack an LDR L color that uses delta encoding.
+ *
+ * Output alpha is 255.
+ *
+ * @param input The packed endpoints (L0, L1).
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void luminance_delta_unpack(
+ const uint8_t input[2],
+ vint4& output0,
+ vint4& output1
+) {
+ int v0 = input[0];
+ int v1 = input[1];
+ int l0 = (v0 >> 2) | (v1 & 0xC0);
+ int l1 = l0 + (v1 & 0x3F);
+
+ l1 = astc::min(l1, 255);
+
+ output0 = vint4(l0, l0, l0, 255);
+ output1 = vint4(l1, l1, l1, 255);
+}
+
+/**
+ * @brief Unpack an LDR LA color that uses direct encoding.
+ *
+ * @param input The packed endpoints (L0, L1, A0, A1).
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void luminance_alpha_unpack(
+ const uint8_t input[4],
+ vint4& output0,
+ vint4& output1
+) {
+ int lum0 = input[0];
+ int lum1 = input[1];
+ int alpha0 = input[2];
+ int alpha1 = input[3];
+ output0 = vint4(lum0, lum0, lum0, alpha0);
+ output1 = vint4(lum1, lum1, lum1, alpha1);
+}
+
+/**
+ * @brief Unpack an LDR LA color that uses delta encoding.
+ *
+ * @param input The packed endpoints (L0, L1, A0, A1).
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void luminance_alpha_delta_unpack(
+ const uint8_t input[4],
+ vint4& output0,
+ vint4& output1
+) {
+ int lum0 = input[0];
+ int lum1 = input[1];
+ int alpha0 = input[2];
+ int alpha1 = input[3];
+
+ lum0 |= (lum1 & 0x80) << 1;
+ alpha0 |= (alpha1 & 0x80) << 1;
+ lum1 &= 0x7F;
+ alpha1 &= 0x7F;
+
+ if (lum1 & 0x40)
+ {
+ lum1 -= 0x80;
+ }
+
+ if (alpha1 & 0x40)
+ {
+ alpha1 -= 0x80;
+ }
+
+ lum0 >>= 1;
+ lum1 >>= 1;
+ alpha0 >>= 1;
+ alpha1 >>= 1;
+ lum1 += lum0;
+ alpha1 += alpha0;
+
+ lum1 = astc::clamp(lum1, 0, 255);
+ alpha1 = astc::clamp(alpha1, 0, 255);
+
+ output0 = vint4(lum0, lum0, lum0, alpha0);
+ output1 = vint4(lum1, lum1, lum1, alpha1);
+}
+
+/**
+ * @brief Unpack an HDR RGB + offset encoding.
+ *
+ * @param input The packed endpoints (packed and modal).
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void hdr_rgbo_unpack(
+ const uint8_t input[4],
+ vint4& output0,
+ vint4& output1
+) {
+ int v0 = input[0];
+ int v1 = input[1];
+ int v2 = input[2];
+ int v3 = input[3];
+
+ int modeval = ((v0 & 0xC0) >> 6) | (((v1 & 0x80) >> 7) << 2) | (((v2 & 0x80) >> 7) << 3);
+
+ int majcomp;
+ int mode;
+ if ((modeval & 0xC) != 0xC)
+ {
+ majcomp = modeval >> 2;
+ mode = modeval & 3;
+ }
+ else if (modeval != 0xF)
+ {
+ majcomp = modeval & 3;
+ mode = 4;
+ }
+ else
+ {
+ majcomp = 0;
+ mode = 5;
+ }
+
+ int red = v0 & 0x3F;
+ int green = v1 & 0x1F;
+ int blue = v2 & 0x1F;
+ int scale = v3 & 0x1F;
+
+ int bit0 = (v1 >> 6) & 1;
+ int bit1 = (v1 >> 5) & 1;
+ int bit2 = (v2 >> 6) & 1;
+ int bit3 = (v2 >> 5) & 1;
+ int bit4 = (v3 >> 7) & 1;
+ int bit5 = (v3 >> 6) & 1;
+ int bit6 = (v3 >> 5) & 1;
+
+ int ohcomp = 1 << mode;
+
+ if (ohcomp & 0x30)
+ green |= bit0 << 6;
+ if (ohcomp & 0x3A)
+ green |= bit1 << 5;
+ if (ohcomp & 0x30)
+ blue |= bit2 << 6;
+ if (ohcomp & 0x3A)
+ blue |= bit3 << 5;
+
+ if (ohcomp & 0x3D)
+ scale |= bit6 << 5;
+ if (ohcomp & 0x2D)
+ scale |= bit5 << 6;
+ if (ohcomp & 0x04)
+ scale |= bit4 << 7;
+
+ if (ohcomp & 0x3B)
+ red |= bit4 << 6;
+ if (ohcomp & 0x04)
+ red |= bit3 << 6;
+
+ if (ohcomp & 0x10)
+ red |= bit5 << 7;
+ if (ohcomp & 0x0F)
+ red |= bit2 << 7;
+
+ if (ohcomp & 0x05)
+ red |= bit1 << 8;
+ if (ohcomp & 0x0A)
+ red |= bit0 << 8;
+
+ if (ohcomp & 0x05)
+ red |= bit0 << 9;
+ if (ohcomp & 0x02)
+ red |= bit6 << 9;
+
+ if (ohcomp & 0x01)
+ red |= bit3 << 10;
+ if (ohcomp & 0x02)
+ red |= bit5 << 10;
+
+ // expand to 12 bits.
+ static const int shamts[6] { 1, 1, 2, 3, 4, 5 };
+ int shamt = shamts[mode];
+ red <<= shamt;
+ green <<= shamt;
+ blue <<= shamt;
+ scale <<= shamt;
+
+ // on modes 0 to 4, the values stored for "green" and "blue" are differentials,
+ // not absolute values.
+ if (mode != 5)
+ {
+ green = red - green;
+ blue = red - blue;
+ }
+
+ // switch around components.
+ int temp;
+ switch (majcomp)
+ {
+ case 1:
+ temp = red;
+ red = green;
+ green = temp;
+ break;
+ case 2:
+ temp = red;
+ red = blue;
+ blue = temp;
+ break;
+ default:
+ break;
+ }
+
+ int red0 = red - scale;
+ int green0 = green - scale;
+ int blue0 = blue - scale;
+
+ // clamp to [0,0xFFF].
+ if (red < 0)
+ red = 0;
+ if (green < 0)
+ green = 0;
+ if (blue < 0)
+ blue = 0;
+
+ if (red0 < 0)
+ red0 = 0;
+ if (green0 < 0)
+ green0 = 0;
+ if (blue0 < 0)
+ blue0 = 0;
+
+ output0 = vint4(red0 << 4, green0 << 4, blue0 << 4, 0x7800);
+ output1 = vint4(red << 4, green << 4, blue << 4, 0x7800);
+}
+
+/**
+ * @brief Unpack an HDR RGB direct encoding.
+ *
+ * @param input The packed endpoints (packed and modal).
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void hdr_rgb_unpack(
+ const uint8_t input[6],
+ vint4& output0,
+ vint4& output1
+) {
+
+ int v0 = input[0];
+ int v1 = input[1];
+ int v2 = input[2];
+ int v3 = input[3];
+ int v4 = input[4];
+ int v5 = input[5];
+
+ // extract all the fixed-placement bitfields
+ int modeval = ((v1 & 0x80) >> 7) | (((v2 & 0x80) >> 7) << 1) | (((v3 & 0x80) >> 7) << 2);
+
+ int majcomp = ((v4 & 0x80) >> 7) | (((v5 & 0x80) >> 7) << 1);
+
+ if (majcomp == 3)
+ {
+ output0 = vint4(v0 << 8, v2 << 8, (v4 & 0x7F) << 9, 0x7800);
+ output1 = vint4(v1 << 8, v3 << 8, (v5 & 0x7F) << 9, 0x7800);
+ return;
+ }
+
+ int a = v0 | ((v1 & 0x40) << 2);
+ int b0 = v2 & 0x3f;
+ int b1 = v3 & 0x3f;
+ int c = v1 & 0x3f;
+ int d0 = v4 & 0x7f;
+ int d1 = v5 & 0x7f;
+
+ // get hold of the number of bits in 'd0' and 'd1'
+ static const int dbits_tab[8] { 7, 6, 7, 6, 5, 6, 5, 6 };
+ int dbits = dbits_tab[modeval];
+
+ // extract six variable-placement bits
+ int bit0 = (v2 >> 6) & 1;
+ int bit1 = (v3 >> 6) & 1;
+ int bit2 = (v4 >> 6) & 1;
+ int bit3 = (v5 >> 6) & 1;
+ int bit4 = (v4 >> 5) & 1;
+ int bit5 = (v5 >> 5) & 1;
+
+ // and prepend the variable-placement bits depending on mode.
+ int ohmod = 1 << modeval; // one-hot-mode
+ if (ohmod & 0xA4)
+ a |= bit0 << 9;
+ if (ohmod & 0x8)
+ a |= bit2 << 9;
+ if (ohmod & 0x50)
+ a |= bit4 << 9;
+
+ if (ohmod & 0x50)
+ a |= bit5 << 10;
+ if (ohmod & 0xA0)
+ a |= bit1 << 10;
+
+ if (ohmod & 0xC0)
+ a |= bit2 << 11;
+
+ if (ohmod & 0x4)
+ c |= bit1 << 6;
+ if (ohmod & 0xE8)
+ c |= bit3 << 6;
+
+ if (ohmod & 0x20)
+ c |= bit2 << 7;
+
+ if (ohmod & 0x5B)
+ {
+ b0 |= bit0 << 6;
+ b1 |= bit1 << 6;
+ }
+
+ if (ohmod & 0x12)
+ {
+ b0 |= bit2 << 7;
+ b1 |= bit3 << 7;
+ }
+
+ if (ohmod & 0xAF)
+ {
+ d0 |= bit4 << 5;
+ d1 |= bit5 << 5;
+ }
+
+ if (ohmod & 0x5)
+ {
+ d0 |= bit2 << 6;
+ d1 |= bit3 << 6;
+ }
+
+ // sign-extend 'd0' and 'd1'
+ // note: this code assumes that signed right-shift actually sign-fills, not zero-fills.
+ int32_t d0x = d0;
+ int32_t d1x = d1;
+ int sx_shamt = 32 - dbits;
+ d0x <<= sx_shamt;
+ d0x >>= sx_shamt;
+ d1x <<= sx_shamt;
+ d1x >>= sx_shamt;
+ d0 = d0x;
+ d1 = d1x;
+
+ // expand all values to 12 bits, with left-shift as needed.
+ int val_shamt = (modeval >> 1) ^ 3;
+ a <<= val_shamt;
+ b0 <<= val_shamt;
+ b1 <<= val_shamt;
+ c <<= val_shamt;
+ d0 <<= val_shamt;
+ d1 <<= val_shamt;
+
+ // then compute the actual color values.
+ int red1 = a;
+ int green1 = a - b0;
+ int blue1 = a - b1;
+ int red0 = a - c;
+ int green0 = a - b0 - c - d0;
+ int blue0 = a - b1 - c - d1;
+
+ // clamp the color components to [0,2^12 - 1]
+ red0 = astc::clamp(red0, 0, 4095);
+ green0 = astc::clamp(green0, 0, 4095);
+ blue0 = astc::clamp(blue0, 0, 4095);
+
+ red1 = astc::clamp(red1, 0, 4095);
+ green1 = astc::clamp(green1, 0, 4095);
+ blue1 = astc::clamp(blue1, 0, 4095);
+
+ // switch around the color components
+ int temp0, temp1;
+ switch (majcomp)
+ {
+ case 1: // switch around red and green
+ temp0 = red0;
+ temp1 = red1;
+ red0 = green0;
+ red1 = green1;
+ green0 = temp0;
+ green1 = temp1;
+ break;
+ case 2: // switch around red and blue
+ temp0 = red0;
+ temp1 = red1;
+ red0 = blue0;
+ red1 = blue1;
+ blue0 = temp0;
+ blue1 = temp1;
+ break;
+ case 0: // no switch
+ break;
+ }
+
+ output0 = vint4(red0 << 4, green0 << 4, blue0 << 4, 0x7800);
+ output1 = vint4(red1 << 4, green1 << 4, blue1 << 4, 0x7800);
+}
+
+/**
+ * @brief Unpack an HDR RGB + LDR A direct encoding.
+ *
+ * @param input The packed endpoints (packed and modal).
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void hdr_rgb_ldr_alpha_unpack(
+ const uint8_t input[8],
+ vint4& output0,
+ vint4& output1
+) {
+ hdr_rgb_unpack(input, output0, output1);
+
+ int v6 = input[6];
+ int v7 = input[7];
+ output0.set_lane<3>(v6);
+ output1.set_lane<3>(v7);
+}
+
+/**
+ * @brief Unpack an HDR L (small range) direct encoding.
+ *
+ * @param input The packed endpoints (packed and modal).
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void hdr_luminance_small_range_unpack(
+ const uint8_t input[2],
+ vint4& output0,
+ vint4& output1
+) {
+ int v0 = input[0];
+ int v1 = input[1];
+
+ int y0, y1;
+ if (v0 & 0x80)
+ {
+ y0 = ((v1 & 0xE0) << 4) | ((v0 & 0x7F) << 2);
+ y1 = (v1 & 0x1F) << 2;
+ }
+ else
+ {
+ y0 = ((v1 & 0xF0) << 4) | ((v0 & 0x7F) << 1);
+ y1 = (v1 & 0xF) << 1;
+ }
+
+ y1 += y0;
+ if (y1 > 0xFFF)
+ {
+ y1 = 0xFFF;
+ }
+
+ output0 = vint4(y0 << 4, y0 << 4, y0 << 4, 0x7800);
+ output1 = vint4(y1 << 4, y1 << 4, y1 << 4, 0x7800);
+}
+
+/**
+ * @brief Unpack an HDR L (large range) direct encoding.
+ *
+ * @param input The packed endpoints (packed and modal).
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void hdr_luminance_large_range_unpack(
+ const uint8_t input[2],
+ vint4& output0,
+ vint4& output1
+) {
+ int v0 = input[0];
+ int v1 = input[1];
+
+ int y0, y1;
+ if (v1 >= v0)
+ {
+ y0 = v0 << 4;
+ y1 = v1 << 4;
+ }
+ else
+ {
+ y0 = (v1 << 4) + 8;
+ y1 = (v0 << 4) - 8;
+ }
+
+ output0 = vint4(y0 << 4, y0 << 4, y0 << 4, 0x7800);
+ output1 = vint4(y1 << 4, y1 << 4, y1 << 4, 0x7800);
+}
+
+/**
+ * @brief Unpack an HDR A direct encoding.
+ *
+ * @param input The packed endpoints (packed and modal).
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void hdr_alpha_unpack(
+ const uint8_t input[2],
+ int& output0,
+ int& output1
+) {
+
+ int v6 = input[0];
+ int v7 = input[1];
+
+ int selector = ((v6 >> 7) & 1) | ((v7 >> 6) & 2);
+ v6 &= 0x7F;
+ v7 &= 0x7F;
+ if (selector == 3)
+ {
+ output0 = v6 << 5;
+ output1 = v7 << 5;
+ }
+ else
+ {
+ v6 |= (v7 << (selector + 1)) & 0x780;
+ v7 &= (0x3f >> selector);
+ v7 ^= 32 >> selector;
+ v7 -= 32 >> selector;
+ v6 <<= (4 - selector);
+ v7 <<= (4 - selector);
+ v7 += v6;
+
+ if (v7 < 0)
+ {
+ v7 = 0;
+ }
+ else if (v7 > 0xFFF)
+ {
+ v7 = 0xFFF;
+ }
+
+ output0 = v6;
+ output1 = v7;
+ }
+
+ output0 <<= 4;
+ output1 <<= 4;
+}
+
+/**
+ * @brief Unpack an HDR RGBA direct encoding.
+ *
+ * @param input The packed endpoints (packed and modal).
+ * @param[out] output0 The unpacked endpoint 0 color.
+ * @param[out] output1 The unpacked endpoint 1 color.
+ */
+static void hdr_rgb_hdr_alpha_unpack(
+ const uint8_t input[8],
+ vint4& output0,
+ vint4& output1
+) {
+ hdr_rgb_unpack(input, output0, output1);
+
+ int alpha0, alpha1;
+ hdr_alpha_unpack(input + 6, alpha0, alpha1);
+
+ output0.set_lane<3>(alpha0);
+ output1.set_lane<3>(alpha1);
+}
+
+/* See header for documentation. */
+void unpack_color_endpoints(
+ astcenc_profile decode_mode,
+ int format,
+ const uint8_t* input,
+ bool& rgb_hdr,
+ bool& alpha_hdr,
+ vint4& output0,
+ vint4& output1
+) {
+ // Assume no NaNs and LDR endpoints unless set later
+ rgb_hdr = false;
+ alpha_hdr = false;
+
+ bool alpha_hdr_default = false;
+
+ switch (format)
+ {
+ case FMT_LUMINANCE:
+ luminance_unpack(input, output0, output1);
+ break;
+
+ case FMT_LUMINANCE_DELTA:
+ luminance_delta_unpack(input, output0, output1);
+ break;
+
+ case FMT_HDR_LUMINANCE_SMALL_RANGE:
+ rgb_hdr = true;
+ alpha_hdr_default = true;
+ hdr_luminance_small_range_unpack(input, output0, output1);
+ break;
+
+ case FMT_HDR_LUMINANCE_LARGE_RANGE:
+ rgb_hdr = true;
+ alpha_hdr_default = true;
+ hdr_luminance_large_range_unpack(input, output0, output1);
+ break;
+
+ case FMT_LUMINANCE_ALPHA:
+ luminance_alpha_unpack(input, output0, output1);
+ break;
+
+ case FMT_LUMINANCE_ALPHA_DELTA:
+ luminance_alpha_delta_unpack(input, output0, output1);
+ break;
+
+ case FMT_RGB_SCALE:
+ {
+ vint4 input0q(input[0], input[1], input[2], 0);
+ uint8_t scale = input[3];
+ rgb_scale_unpack(input0q, scale, output0, output1);
+ }
+ break;
+
+ case FMT_RGB_SCALE_ALPHA:
+ {
+ vint4 input0q(input[0], input[1], input[2], input[4]);
+ uint8_t alpha1q = input[5];
+ uint8_t scaleq = input[3];
+ rgb_scale_alpha_unpack(input0q, alpha1q, scaleq, output0, output1);
+ }
+ break;
+
+ case FMT_HDR_RGB_SCALE:
+ rgb_hdr = true;
+ alpha_hdr_default = true;
+ hdr_rgbo_unpack(input, output0, output1);
+ break;
+
+ case FMT_RGB:
+ {
+ vint4 input0q(input[0], input[2], input[4], 0);
+ vint4 input1q(input[1], input[3], input[5], 0);
+ rgb_unpack(input0q, input1q, output0, output1);
+ }
+ break;
+
+ case FMT_RGB_DELTA:
+ {
+ vint4 input0q(input[0], input[2], input[4], 0);
+ vint4 input1q(input[1], input[3], input[5], 0);
+ rgb_delta_unpack(input0q, input1q, output0, output1);
+ }
+ break;
+
+ case FMT_HDR_RGB:
+ rgb_hdr = true;
+ alpha_hdr_default = true;
+ hdr_rgb_unpack(input, output0, output1);
+ break;
+
+ case FMT_RGBA:
+ {
+ vint4 input0q(input[0], input[2], input[4], input[6]);
+ vint4 input1q(input[1], input[3], input[5], input[7]);
+ rgba_unpack(input0q, input1q, output0, output1);
+ }
+ break;
+
+ case FMT_RGBA_DELTA:
+ {
+ vint4 input0q(input[0], input[2], input[4], input[6]);
+ vint4 input1q(input[1], input[3], input[5], input[7]);
+ rgba_delta_unpack(input0q, input1q, output0, output1);
+ }
+ break;
+
+ case FMT_HDR_RGB_LDR_ALPHA:
+ rgb_hdr = true;
+ hdr_rgb_ldr_alpha_unpack(input, output0, output1);
+ break;
+
+ case FMT_HDR_RGBA:
+ rgb_hdr = true;
+ alpha_hdr = true;
+ hdr_rgb_hdr_alpha_unpack(input, output0, output1);
+ break;
+ }
+
+ // Assign a correct default alpha
+ if (alpha_hdr_default)
+ {
+ if (decode_mode == ASTCENC_PRF_HDR)
+ {
+ output0.set_lane<3>(0x7800);
+ output1.set_lane<3>(0x7800);
+ alpha_hdr = true;
+ }
+ else
+ {
+ output0.set_lane<3>(0x00FF);
+ output1.set_lane<3>(0x00FF);
+ alpha_hdr = false;
+ }
+ }
+
+ vint4 ldr_scale(257);
+ vint4 hdr_scale(1);
+ vint4 output_scale = ldr_scale;
+
+ // An LDR profile image
+ if ((decode_mode == ASTCENC_PRF_LDR) ||
+ (decode_mode == ASTCENC_PRF_LDR_SRGB))
+ {
+ // Also matches HDR alpha, as cannot have HDR alpha without HDR RGB
+ if (rgb_hdr == true)
+ {
+ output0 = vint4(0xFF00, 0x0000, 0xFF00, 0xFF00);
+ output1 = vint4(0xFF00, 0x0000, 0xFF00, 0xFF00);
+ output_scale = hdr_scale;
+
+ rgb_hdr = false;
+ alpha_hdr = false;
+ }
+ }
+ // An HDR profile image
+ else
+ {
+ vmask4 hdr_lanes(rgb_hdr, rgb_hdr, rgb_hdr, alpha_hdr);
+ output_scale = select(ldr_scale, hdr_scale, hdr_lanes);
+ }
+
+ output0 = output0 * output_scale;
+ output1 = output1 * output_scale;
+}
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_compress_symbolic.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_compress_symbolic.cpp
new file mode 100644
index 00000000000..4dbe6f1946f
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_compress_symbolic.cpp
@@ -0,0 +1,1459 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+
+/**
+ * @brief Functions to compress a symbolic block.
+ */
+
+#include "astcenc_internal.h"
+#include "astcenc_diagnostic_trace.h"
+
+#include <cassert>
+
+/**
+ * @brief Merge two planes of endpoints into a single vector.
+ *
+ * @param ep_plane1 The endpoints for plane 1.
+ * @param ep_plane2 The endpoints for plane 2.
+ * @param component_plane2 The color component for plane 2.
+ * @param[out] result The merged output.
+ */
+static void merge_endpoints(
+ const endpoints& ep_plane1,
+ const endpoints& ep_plane2,
+ unsigned int component_plane2,
+ endpoints& result
+) {
+ unsigned int partition_count = ep_plane1.partition_count;
+ assert(partition_count == 1);
+
+ vmask4 sep_mask = vint4::lane_id() == vint4(component_plane2);
+
+ result.partition_count = partition_count;
+ result.endpt0[0] = select(ep_plane1.endpt0[0], ep_plane2.endpt0[0], sep_mask);
+ result.endpt1[0] = select(ep_plane1.endpt1[0], ep_plane2.endpt1[0], sep_mask);
+}
+
+/**
+ * @brief Attempt to improve weights given a chosen configuration.
+ *
+ * Given a fixed weight grid decimation and weight value quantization, iterate over all weights (per
+ * partition and per plane) and attempt to improve image quality by moving each weight up by one or
+ * down by one quantization step.
+ *
+ * This is a specialized function which only supports operating on undecimated weight grids,
+ * therefore primarily improving the performance of 4x4 and 5x5 blocks where grid decimation
+ * is needed less often.
+ *
+ * @param decode_mode The decode mode (LDR, HDR).
+ * @param bsd The block size information.
+ * @param blk The image block color data to compress.
+ * @param[out] scb The symbolic compressed block output.
+ */
+static bool realign_weights_undecimated(
+ astcenc_profile decode_mode,
+ const block_size_descriptor& bsd,
+ const image_block& blk,
+ symbolic_compressed_block& scb
+) {
+ // Get the partition descriptor
+ unsigned int partition_count = scb.partition_count;
+ const auto& pi = bsd.get_partition_info(partition_count, scb.partition_index);
+
+ // Get the quantization table
+ const block_mode& bm = bsd.get_block_mode(scb.block_mode);
+ unsigned int weight_quant_level = bm.quant_mode;
+ const quant_and_transfer_table& qat = quant_and_xfer_tables[weight_quant_level];
+
+ unsigned int max_plane = bm.is_dual_plane;
+ int plane2_component = bm.is_dual_plane ? scb.plane2_component : -1;
+ vmask4 plane_mask = vint4::lane_id() == vint4(plane2_component);
+
+ // Decode the color endpoints
+ bool rgb_hdr;
+ bool alpha_hdr;
+ vint4 endpnt0[BLOCK_MAX_PARTITIONS];
+ vint4 endpnt1[BLOCK_MAX_PARTITIONS];
+ vfloat4 endpnt0f[BLOCK_MAX_PARTITIONS];
+ vfloat4 offset[BLOCK_MAX_PARTITIONS];
+
+ promise(partition_count > 0);
+
+ for (unsigned int pa_idx = 0; pa_idx < partition_count; pa_idx++)
+ {
+ unpack_color_endpoints(decode_mode,
+ scb.color_formats[pa_idx],
+ scb.color_values[pa_idx],
+ rgb_hdr, alpha_hdr,
+ endpnt0[pa_idx],
+ endpnt1[pa_idx]);
+ }
+
+ uint8_t* dec_weights_uquant = scb.weights;
+ bool adjustments = false;
+
+ // For each plane and partition ...
+ for (unsigned int pl_idx = 0; pl_idx <= max_plane; pl_idx++)
+ {
+ for (unsigned int pa_idx = 0; pa_idx < partition_count; pa_idx++)
+ {
+ // Compute the endpoint delta for all components in current plane
+ vint4 epd = endpnt1[pa_idx] - endpnt0[pa_idx];
+ epd = select(epd, vint4::zero(), plane_mask);
+
+ endpnt0f[pa_idx] = int_to_float(endpnt0[pa_idx]);
+ offset[pa_idx] = int_to_float(epd) * (1.0f / 64.0f);
+ }
+
+ // For each weight compute previous, current, and next errors
+ promise(bsd.texel_count > 0);
+ for (unsigned int texel = 0; texel < bsd.texel_count; texel++)
+ {
+ int uqw = dec_weights_uquant[texel];
+
+ uint32_t prev_and_next = qat.prev_next_values[uqw];
+ int uqw_down = prev_and_next & 0xFF;
+ int uqw_up = (prev_and_next >> 8) & 0xFF;
+
+ // Interpolate the colors to create the diffs
+ float weight_base = static_cast<float>(uqw);
+ float weight_down = static_cast<float>(uqw_down - uqw);
+ float weight_up = static_cast<float>(uqw_up - uqw);
+
+ unsigned int partition = pi.partition_of_texel[texel];
+ vfloat4 color_offset = offset[partition];
+ vfloat4 color_base = endpnt0f[partition];
+
+ vfloat4 color = color_base + color_offset * weight_base;
+ vfloat4 orig_color = blk.texel(texel);
+ vfloat4 error_weight = blk.channel_weight;
+
+ vfloat4 color_diff = color - orig_color;
+ vfloat4 color_diff_down = color_diff + color_offset * weight_down;
+ vfloat4 color_diff_up = color_diff + color_offset * weight_up;
+
+ float error_base = dot_s(color_diff * color_diff, error_weight);
+ float error_down = dot_s(color_diff_down * color_diff_down, error_weight);
+ float error_up = dot_s(color_diff_up * color_diff_up, error_weight);
+
+ // Check if the prev or next error is better, and if so use it
+ if ((error_up < error_base) && (error_up < error_down) && (uqw < 64))
+ {
+ dec_weights_uquant[texel] = static_cast<uint8_t>(uqw_up);
+ adjustments = true;
+ }
+ else if ((error_down < error_base) && (uqw > 0))
+ {
+ dec_weights_uquant[texel] = static_cast<uint8_t>(uqw_down);
+ adjustments = true;
+ }
+ }
+
+ // Prepare iteration for plane 2
+ dec_weights_uquant += WEIGHTS_PLANE2_OFFSET;
+ plane_mask = ~plane_mask;
+ }
+
+ return adjustments;
+}
+
+/**
+ * @brief Attempt to improve weights given a chosen configuration.
+ *
+ * Given a fixed weight grid decimation and weight value quantization, iterate over all weights (per
+ * partition and per plane) and attempt to improve image quality by moving each weight up by one or
+ * down by one quantization step.
+ *
+ * @param decode_mode The decode mode (LDR, HDR).
+ * @param bsd The block size information.
+ * @param blk The image block color data to compress.
+ * @param[out] scb The symbolic compressed block output.
+ */
+static bool realign_weights_decimated(
+ astcenc_profile decode_mode,
+ const block_size_descriptor& bsd,
+ const image_block& blk,
+ symbolic_compressed_block& scb
+) {
+ // Get the partition descriptor
+ unsigned int partition_count = scb.partition_count;
+ const auto& pi = bsd.get_partition_info(partition_count, scb.partition_index);
+
+ // Get the quantization table
+ const block_mode& bm = bsd.get_block_mode(scb.block_mode);
+ unsigned int weight_quant_level = bm.quant_mode;
+ const quant_and_transfer_table& qat = quant_and_xfer_tables[weight_quant_level];
+
+ // Get the decimation table
+ const decimation_info& di = bsd.get_decimation_info(bm.decimation_mode);
+ unsigned int weight_count = di.weight_count;
+ assert(weight_count != bsd.texel_count);
+
+ unsigned int max_plane = bm.is_dual_plane;
+ int plane2_component = bm.is_dual_plane ? scb.plane2_component : -1;
+ vmask4 plane_mask = vint4::lane_id() == vint4(plane2_component);
+
+ // Decode the color endpoints
+ bool rgb_hdr;
+ bool alpha_hdr;
+ vint4 endpnt0[BLOCK_MAX_PARTITIONS];
+ vint4 endpnt1[BLOCK_MAX_PARTITIONS];
+ vfloat4 endpnt0f[BLOCK_MAX_PARTITIONS];
+ vfloat4 offset[BLOCK_MAX_PARTITIONS];
+
+ promise(partition_count > 0);
+ promise(weight_count > 0);
+
+ for (unsigned int pa_idx = 0; pa_idx < partition_count; pa_idx++)
+ {
+ unpack_color_endpoints(decode_mode,
+ scb.color_formats[pa_idx],
+ scb.color_values[pa_idx],
+ rgb_hdr, alpha_hdr,
+ endpnt0[pa_idx],
+ endpnt1[pa_idx]);
+ }
+
+ uint8_t* dec_weights_uquant = scb.weights;
+ bool adjustments = false;
+
+ // For each plane and partition ...
+ for (unsigned int pl_idx = 0; pl_idx <= max_plane; pl_idx++)
+ {
+ for (unsigned int pa_idx = 0; pa_idx < partition_count; pa_idx++)
+ {
+ // Compute the endpoint delta for all components in current plane
+ vint4 epd = endpnt1[pa_idx] - endpnt0[pa_idx];
+ epd = select(epd, vint4::zero(), plane_mask);
+
+ endpnt0f[pa_idx] = int_to_float(endpnt0[pa_idx]);
+ offset[pa_idx] = int_to_float(epd) * (1.0f / 64.0f);
+ }
+
+ // Create an unquantized weight grid for this decimation level
+ alignas(ASTCENC_VECALIGN) float uq_weightsf[BLOCK_MAX_WEIGHTS];
+ for (unsigned int we_idx = 0; we_idx < weight_count; we_idx += ASTCENC_SIMD_WIDTH)
+ {
+ vint unquant_value(dec_weights_uquant + we_idx);
+ vfloat unquant_valuef = int_to_float(unquant_value);
+ storea(unquant_valuef, uq_weightsf + we_idx);
+ }
+
+ // For each weight compute previous, current, and next errors
+ for (unsigned int we_idx = 0; we_idx < weight_count; we_idx++)
+ {
+ int uqw = dec_weights_uquant[we_idx];
+ uint32_t prev_and_next = qat.prev_next_values[uqw];
+
+ float uqw_base = uq_weightsf[we_idx];
+ float uqw_down = static_cast<float>(prev_and_next & 0xFF);
+ float uqw_up = static_cast<float>((prev_and_next >> 8) & 0xFF);
+
+ float uqw_diff_down = uqw_down - uqw_base;
+ float uqw_diff_up = uqw_up - uqw_base;
+
+ vfloat4 error_basev = vfloat4::zero();
+ vfloat4 error_downv = vfloat4::zero();
+ vfloat4 error_upv = vfloat4::zero();
+
+ // Interpolate the colors to create the diffs
+ unsigned int texels_to_evaluate = di.weight_texel_count[we_idx];
+ promise(texels_to_evaluate > 0);
+ for (unsigned int te_idx = 0; te_idx < texels_to_evaluate; te_idx++)
+ {
+ unsigned int texel = di.weight_texel[te_idx][we_idx];
+
+ const uint8_t *texel_weights = di.texel_weights_texel[we_idx][te_idx];
+ const float *texel_weights_float = di.texel_weights_float_texel[we_idx][te_idx];
+
+ float tw_base = texel_weights_float[0];
+
+ float weight_base = (uqw_base * tw_base
+ + uq_weightsf[texel_weights[1]] * texel_weights_float[1])
+ + (uq_weightsf[texel_weights[2]] * texel_weights_float[2]
+ + uq_weightsf[texel_weights[3]] * texel_weights_float[3]);
+
+ // Ideally this is integer rounded, but IQ gain it isn't worth the overhead
+ // float weight = astc::flt_rd(weight_base + 0.5f);
+ // float weight_down = astc::flt_rd(weight_base + 0.5f + uqw_diff_down * tw_base) - weight;
+ // float weight_up = astc::flt_rd(weight_base + 0.5f + uqw_diff_up * tw_base) - weight;
+ float weight_down = weight_base + uqw_diff_down * tw_base - weight_base;
+ float weight_up = weight_base + uqw_diff_up * tw_base - weight_base;
+
+ unsigned int partition = pi.partition_of_texel[texel];
+ vfloat4 color_offset = offset[partition];
+ vfloat4 color_base = endpnt0f[partition];
+
+ vfloat4 color = color_base + color_offset * weight_base;
+ vfloat4 orig_color = blk.texel(texel);
+
+ vfloat4 color_diff = color - orig_color;
+ vfloat4 color_down_diff = color_diff + color_offset * weight_down;
+ vfloat4 color_up_diff = color_diff + color_offset * weight_up;
+
+ error_basev += color_diff * color_diff;
+ error_downv += color_down_diff * color_down_diff;
+ error_upv += color_up_diff * color_up_diff;
+ }
+
+ vfloat4 error_weight = blk.channel_weight;
+ float error_base = hadd_s(error_basev * error_weight);
+ float error_down = hadd_s(error_downv * error_weight);
+ float error_up = hadd_s(error_upv * error_weight);
+
+ // Check if the prev or next error is better, and if so use it
+ if ((error_up < error_base) && (error_up < error_down) && (uqw < 64))
+ {
+ uq_weightsf[we_idx] = uqw_up;
+ dec_weights_uquant[we_idx] = static_cast<uint8_t>(uqw_up);
+ adjustments = true;
+ }
+ else if ((error_down < error_base) && (uqw > 0))
+ {
+ uq_weightsf[we_idx] = uqw_down;
+ dec_weights_uquant[we_idx] = static_cast<uint8_t>(uqw_down);
+ adjustments = true;
+ }
+ }
+
+ // Prepare iteration for plane 2
+ dec_weights_uquant += WEIGHTS_PLANE2_OFFSET;
+ plane_mask = ~plane_mask;
+ }
+
+ return adjustments;
+}
+
+/**
+ * @brief Compress a block using a chosen partitioning and 1 plane of weights.
+ *
+ * @param config The compressor configuration.
+ * @param bsd The block size information.
+ * @param blk The image block color data to compress.
+ * @param only_always True if we only use "always" percentile block modes.
+ * @param tune_errorval_threshold The error value threshold.
+ * @param partition_count The partition count.
+ * @param partition_index The partition index if @c partition_count is 2-4.
+ * @param[out] scb The symbolic compressed block output.
+ * @param[out] tmpbuf The quantized weights for plane 1.
+ */
+static float compress_symbolic_block_for_partition_1plane(
+ const astcenc_config& config,
+ const block_size_descriptor& bsd,
+ const image_block& blk,
+ bool only_always,
+ float tune_errorval_threshold,
+ unsigned int partition_count,
+ unsigned int partition_index,
+ symbolic_compressed_block& scb,
+ compression_working_buffers& tmpbuf,
+ int quant_limit
+) {
+ promise(partition_count > 0);
+ promise(config.tune_candidate_limit > 0);
+ promise(config.tune_refinement_limit > 0);
+
+ int max_weight_quant = astc::min(static_cast<int>(QUANT_32), quant_limit);
+
+ auto compute_difference = &compute_symbolic_block_difference_1plane;
+ if ((partition_count == 1) && !(config.flags & ASTCENC_FLG_MAP_RGBM))
+ {
+ compute_difference = &compute_symbolic_block_difference_1plane_1partition;
+ }
+
+ const auto& pi = bsd.get_partition_info(partition_count, partition_index);
+
+ // Compute ideal weights and endpoint colors, with no quantization or decimation
+ endpoints_and_weights& ei = tmpbuf.ei1;
+ compute_ideal_colors_and_weights_1plane(blk, pi, ei);
+
+ // Compute ideal weights and endpoint colors for every decimation
+ float* dec_weights_ideal = tmpbuf.dec_weights_ideal;
+ uint8_t* dec_weights_uquant = tmpbuf.dec_weights_uquant;
+
+ // For each decimation mode, compute an ideal set of weights with no quantization
+ unsigned int max_decimation_modes = only_always ? bsd.decimation_mode_count_always
+ : bsd.decimation_mode_count_selected;
+ promise(max_decimation_modes > 0);
+ for (unsigned int i = 0; i < max_decimation_modes; i++)
+ {
+ const auto& dm = bsd.get_decimation_mode(i);
+ if (!dm.is_ref_1_plane(static_cast<quant_method>(max_weight_quant)))
+ {
+ continue;
+ }
+
+ const auto& di = bsd.get_decimation_info(i);
+
+ compute_ideal_weights_for_decimation(
+ ei,
+ di,
+ dec_weights_ideal + i * BLOCK_MAX_WEIGHTS);
+ }
+
+ // Compute maximum colors for the endpoints and ideal weights, then for each endpoint and ideal
+ // weight pair, compute the smallest weight that will result in a color value greater than 1
+ vfloat4 min_ep(10.0f);
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ vfloat4 ep = (vfloat4(1.0f) - ei.ep.endpt0[i]) / (ei.ep.endpt1[i] - ei.ep.endpt0[i]);
+
+ vmask4 use_ep = (ep > vfloat4(0.5f)) & (ep < min_ep);
+ min_ep = select(min_ep, ep, use_ep);
+ }
+
+ float min_wt_cutoff = hmin_s(min_ep);
+
+ // For each mode, use the angular method to compute a shift
+ compute_angular_endpoints_1plane(
+ only_always, bsd, dec_weights_ideal, max_weight_quant, tmpbuf);
+
+ float* weight_low_value = tmpbuf.weight_low_value1;
+ float* weight_high_value = tmpbuf.weight_high_value1;
+ int8_t* qwt_bitcounts = tmpbuf.qwt_bitcounts;
+ float* qwt_errors = tmpbuf.qwt_errors;
+
+ // For each mode (which specifies a decimation and a quantization):
+ // * Compute number of bits needed for the quantized weights
+ // * Generate an optimized set of quantized weights
+ // * Compute quantization errors for the mode
+
+
+ static const int8_t free_bits_for_partition_count[4] {
+ 115 - 4, 111 - 4 - PARTITION_INDEX_BITS, 108 - 4 - PARTITION_INDEX_BITS, 105 - 4 - PARTITION_INDEX_BITS
+ };
+
+ unsigned int max_block_modes = only_always ? bsd.block_mode_count_1plane_always
+ : bsd.block_mode_count_1plane_selected;
+ promise(max_block_modes > 0);
+ for (unsigned int i = 0; i < max_block_modes; i++)
+ {
+ const block_mode& bm = bsd.block_modes[i];
+
+ if (bm.quant_mode > max_weight_quant)
+ {
+ qwt_errors[i] = 1e38f;
+ continue;
+ }
+
+ assert(!bm.is_dual_plane);
+ int bitcount = free_bits_for_partition_count[partition_count - 1] - bm.weight_bits;
+ if (bitcount <= 0)
+ {
+ qwt_errors[i] = 1e38f;
+ continue;
+ }
+
+ if (weight_high_value[i] > 1.02f * min_wt_cutoff)
+ {
+ weight_high_value[i] = 1.0f;
+ }
+
+ int decimation_mode = bm.decimation_mode;
+ const auto& di = bsd.get_decimation_info(decimation_mode);
+
+ qwt_bitcounts[i] = static_cast<int8_t>(bitcount);
+
+ alignas(ASTCENC_VECALIGN) float dec_weights_uquantf[BLOCK_MAX_WEIGHTS];
+
+ // Generate the optimized set of weights for the weight mode
+ compute_quantized_weights_for_decimation(
+ di,
+ weight_low_value[i], weight_high_value[i],
+ dec_weights_ideal + BLOCK_MAX_WEIGHTS * decimation_mode,
+ dec_weights_uquantf,
+ dec_weights_uquant + BLOCK_MAX_WEIGHTS * i,
+ bm.get_weight_quant_mode());
+
+ // Compute weight quantization errors for the block mode
+ qwt_errors[i] = compute_error_of_weight_set_1plane(
+ ei,
+ di,
+ dec_weights_uquantf);
+ }
+
+ // Decide the optimal combination of color endpoint encodings and weight encodings
+ uint8_t partition_format_specifiers[TUNE_MAX_TRIAL_CANDIDATES][BLOCK_MAX_PARTITIONS];
+ int block_mode_index[TUNE_MAX_TRIAL_CANDIDATES];
+
+ quant_method color_quant_level[TUNE_MAX_TRIAL_CANDIDATES];
+ quant_method color_quant_level_mod[TUNE_MAX_TRIAL_CANDIDATES];
+
+ unsigned int candidate_count = compute_ideal_endpoint_formats(
+ pi, blk, ei.ep, qwt_bitcounts, qwt_errors,
+ config.tune_candidate_limit, 0, max_block_modes,
+ partition_format_specifiers, block_mode_index,
+ color_quant_level, color_quant_level_mod, tmpbuf);
+
+ // Iterate over the N believed-to-be-best modes to find out which one is actually best
+ float best_errorval_in_mode = ERROR_CALC_DEFAULT;
+ float best_errorval_in_scb = scb.errorval;
+
+ for (unsigned int i = 0; i < candidate_count; i++)
+ {
+ TRACE_NODE(node0, "candidate");
+
+ const int bm_packed_index = block_mode_index[i];
+ assert(bm_packed_index >= 0 && bm_packed_index < static_cast<int>(bsd.block_mode_count_1plane_selected));
+ const block_mode& qw_bm = bsd.block_modes[bm_packed_index];
+
+ int decimation_mode = qw_bm.decimation_mode;
+ const auto& di = bsd.get_decimation_info(decimation_mode);
+ promise(di.weight_count > 0);
+
+ trace_add_data("weight_x", di.weight_x);
+ trace_add_data("weight_y", di.weight_y);
+ trace_add_data("weight_z", di.weight_z);
+ trace_add_data("weight_quant", qw_bm.quant_mode);
+
+ // Recompute the ideal color endpoints before storing them
+ vfloat4 rgbs_colors[BLOCK_MAX_PARTITIONS];
+ vfloat4 rgbo_colors[BLOCK_MAX_PARTITIONS];
+
+ symbolic_compressed_block workscb;
+ endpoints workep = ei.ep;
+
+ uint8_t* u8_weight_src = dec_weights_uquant + BLOCK_MAX_WEIGHTS * bm_packed_index;
+
+ for (unsigned int j = 0; j < di.weight_count; j++)
+ {
+ workscb.weights[j] = u8_weight_src[j];
+ }
+
+ for (unsigned int l = 0; l < config.tune_refinement_limit; l++)
+ {
+ recompute_ideal_colors_1plane(
+ blk, pi, di, workscb.weights,
+ workep, rgbs_colors, rgbo_colors);
+
+ // Quantize the chosen color, tracking if worth trying the mod value
+ bool all_same = color_quant_level[i] != color_quant_level_mod[i];
+ for (unsigned int j = 0; j < partition_count; j++)
+ {
+ workscb.color_formats[j] = pack_color_endpoints(
+ workep.endpt0[j],
+ workep.endpt1[j],
+ rgbs_colors[j],
+ rgbo_colors[j],
+ partition_format_specifiers[i][j],
+ workscb.color_values[j],
+ color_quant_level[i]);
+
+ all_same = all_same && workscb.color_formats[j] == workscb.color_formats[0];
+ }
+
+ // If all the color endpoint modes are the same, we get a few more bits to store colors;
+ // let's see if we can take advantage of this: requantize all the colors and see if the
+ // endpoint modes remain the same.
+ workscb.color_formats_matched = 0;
+ if (partition_count >= 2 && all_same)
+ {
+ uint8_t colorvals[BLOCK_MAX_PARTITIONS][12];
+ uint8_t color_formats_mod[BLOCK_MAX_PARTITIONS] { 0 };
+ bool all_same_mod = true;
+ for (unsigned int j = 0; j < partition_count; j++)
+ {
+ color_formats_mod[j] = pack_color_endpoints(
+ workep.endpt0[j],
+ workep.endpt1[j],
+ rgbs_colors[j],
+ rgbo_colors[j],
+ partition_format_specifiers[i][j],
+ colorvals[j],
+ color_quant_level_mod[i]);
+
+ // Early out as soon as it's no longer possible to use mod
+ if (color_formats_mod[j] != color_formats_mod[0])
+ {
+ all_same_mod = false;
+ break;
+ }
+ }
+
+ if (all_same_mod)
+ {
+ workscb.color_formats_matched = 1;
+ for (unsigned int j = 0; j < BLOCK_MAX_PARTITIONS; j++)
+ {
+ for (unsigned int k = 0; k < 8; k++)
+ {
+ workscb.color_values[j][k] = colorvals[j][k];
+ }
+
+ workscb.color_formats[j] = color_formats_mod[j];
+ }
+ }
+ }
+
+ // Store header fields
+ workscb.partition_count = static_cast<uint8_t>(partition_count);
+ workscb.partition_index = static_cast<uint16_t>(partition_index);
+ workscb.plane2_component = -1;
+ workscb.quant_mode = workscb.color_formats_matched ? color_quant_level_mod[i] : color_quant_level[i];
+ workscb.block_mode = qw_bm.mode_index;
+ workscb.block_type = SYM_BTYPE_NONCONST;
+
+ // Pre-realign test
+ if (l == 0)
+ {
+ float errorval = compute_difference(config, bsd, workscb, blk);
+ if (errorval == -ERROR_CALC_DEFAULT)
+ {
+ errorval = -errorval;
+ workscb.block_type = SYM_BTYPE_ERROR;
+ }
+
+ trace_add_data("error_prerealign", errorval);
+ best_errorval_in_mode = astc::min(errorval, best_errorval_in_mode);
+
+ // Average refinement improvement is 3.5% per iteration (allow 5%), but the first
+ // iteration can help more so we give it a extra 10% leeway. Use this knowledge to
+ // drive a heuristic to skip blocks that are unlikely to catch up with the best
+ // block we have already.
+ unsigned int iters_remaining = config.tune_refinement_limit - l;
+ float threshold = (0.05f * static_cast<float>(iters_remaining)) + 1.1f;
+ if (errorval > (threshold * best_errorval_in_scb))
+ {
+ break;
+ }
+
+ if (errorval < best_errorval_in_scb)
+ {
+ best_errorval_in_scb = errorval;
+ workscb.errorval = errorval;
+ scb = workscb;
+
+ if (errorval < tune_errorval_threshold)
+ {
+ // Skip remaining candidates - this is "good enough"
+ i = candidate_count;
+ break;
+ }
+ }
+ }
+
+ bool adjustments;
+ if (di.weight_count != bsd.texel_count)
+ {
+ adjustments = realign_weights_decimated(
+ config.profile, bsd, blk, workscb);
+ }
+ else
+ {
+ adjustments = realign_weights_undecimated(
+ config.profile, bsd, blk, workscb);
+ }
+
+ // Post-realign test
+ float errorval = compute_difference(config, bsd, workscb, blk);
+ if (errorval == -ERROR_CALC_DEFAULT)
+ {
+ errorval = -errorval;
+ workscb.block_type = SYM_BTYPE_ERROR;
+ }
+
+ trace_add_data("error_postrealign", errorval);
+ best_errorval_in_mode = astc::min(errorval, best_errorval_in_mode);
+
+ // Average refinement improvement is 3.5% per iteration, so skip blocks that are
+ // unlikely to catch up with the best block we have already. Assume a 5% per step to
+ // give benefit of the doubt ...
+ unsigned int iters_remaining = config.tune_refinement_limit - 1 - l;
+ float threshold = (0.05f * static_cast<float>(iters_remaining)) + 1.0f;
+ if (errorval > (threshold * best_errorval_in_scb))
+ {
+ break;
+ }
+
+ if (errorval < best_errorval_in_scb)
+ {
+ best_errorval_in_scb = errorval;
+ workscb.errorval = errorval;
+ scb = workscb;
+
+ if (errorval < tune_errorval_threshold)
+ {
+ // Skip remaining candidates - this is "good enough"
+ i = candidate_count;
+ break;
+ }
+ }
+
+ if (!adjustments)
+ {
+ break;
+ }
+ }
+ }
+
+ return best_errorval_in_mode;
+}
+
+/**
+ * @brief Compress a block using a chosen partitioning and 2 planes of weights.
+ *
+ * @param config The compressor configuration.
+ * @param bsd The block size information.
+ * @param blk The image block color data to compress.
+ * @param tune_errorval_threshold The error value threshold.
+ * @param plane2_component The component index for the second plane of weights.
+ * @param[out] scb The symbolic compressed block output.
+ * @param[out] tmpbuf The quantized weights for plane 1.
+ */
+static float compress_symbolic_block_for_partition_2planes(
+ const astcenc_config& config,
+ const block_size_descriptor& bsd,
+ const image_block& blk,
+ float tune_errorval_threshold,
+ unsigned int plane2_component,
+ symbolic_compressed_block& scb,
+ compression_working_buffers& tmpbuf,
+ int quant_limit
+) {
+ promise(config.tune_candidate_limit > 0);
+ promise(config.tune_refinement_limit > 0);
+ promise(bsd.decimation_mode_count_selected > 0);
+
+ int max_weight_quant = astc::min(static_cast<int>(QUANT_32), quant_limit);
+
+ // Compute ideal weights and endpoint colors, with no quantization or decimation
+ endpoints_and_weights& ei1 = tmpbuf.ei1;
+ endpoints_and_weights& ei2 = tmpbuf.ei2;
+
+ compute_ideal_colors_and_weights_2planes(bsd, blk, plane2_component, ei1, ei2);
+
+ // Compute ideal weights and endpoint colors for every decimation
+ float* dec_weights_ideal = tmpbuf.dec_weights_ideal;
+ uint8_t* dec_weights_uquant = tmpbuf.dec_weights_uquant;
+
+ // For each decimation mode, compute an ideal set of weights with no quantization
+ for (unsigned int i = 0; i < bsd.decimation_mode_count_selected; i++)
+ {
+ const auto& dm = bsd.get_decimation_mode(i);
+ if (!dm.is_ref_2_plane(static_cast<quant_method>(max_weight_quant)))
+ {
+ continue;
+ }
+
+ const auto& di = bsd.get_decimation_info(i);
+
+ compute_ideal_weights_for_decimation(
+ ei1,
+ di,
+ dec_weights_ideal + i * BLOCK_MAX_WEIGHTS);
+
+ compute_ideal_weights_for_decimation(
+ ei2,
+ di,
+ dec_weights_ideal + i * BLOCK_MAX_WEIGHTS + WEIGHTS_PLANE2_OFFSET);
+ }
+
+ // Compute maximum colors for the endpoints and ideal weights, then for each endpoint and ideal
+ // weight pair, compute the smallest weight that will result in a color value greater than 1
+ vfloat4 min_ep1(10.0f);
+ vfloat4 min_ep2(10.0f);
+
+ vfloat4 ep1 = (vfloat4(1.0f) - ei1.ep.endpt0[0]) / (ei1.ep.endpt1[0] - ei1.ep.endpt0[0]);
+ vmask4 use_ep1 = (ep1 > vfloat4(0.5f)) & (ep1 < min_ep1);
+ min_ep1 = select(min_ep1, ep1, use_ep1);
+
+ vfloat4 ep2 = (vfloat4(1.0f) - ei2.ep.endpt0[0]) / (ei2.ep.endpt1[0] - ei2.ep.endpt0[0]);
+ vmask4 use_ep2 = (ep2 > vfloat4(0.5f)) & (ep2 < min_ep2);
+ min_ep2 = select(min_ep2, ep2, use_ep2);
+
+ vfloat4 err_max(ERROR_CALC_DEFAULT);
+ vmask4 err_mask = vint4::lane_id() == vint4(plane2_component);
+
+ // Set the plane2 component to max error in ep1
+ min_ep1 = select(min_ep1, err_max, err_mask);
+
+ float min_wt_cutoff1 = hmin_s(min_ep1);
+
+ // Set the minwt2 to the plane2 component min in ep2
+ float min_wt_cutoff2 = hmin_s(select(err_max, min_ep2, err_mask));
+
+ compute_angular_endpoints_2planes(
+ bsd, dec_weights_ideal, max_weight_quant, tmpbuf);
+
+ // For each mode (which specifies a decimation and a quantization):
+ // * Compute number of bits needed for the quantized weights
+ // * Generate an optimized set of quantized weights
+ // * Compute quantization errors for the mode
+
+ float* weight_low_value1 = tmpbuf.weight_low_value1;
+ float* weight_high_value1 = tmpbuf.weight_high_value1;
+ float* weight_low_value2 = tmpbuf.weight_low_value2;
+ float* weight_high_value2 = tmpbuf.weight_high_value2;
+
+ int8_t* qwt_bitcounts = tmpbuf.qwt_bitcounts;
+ float* qwt_errors = tmpbuf.qwt_errors;
+
+ unsigned int start_2plane = bsd.block_mode_count_1plane_selected;
+ unsigned int end_2plane = bsd.block_mode_count_1plane_2plane_selected;
+
+ for (unsigned int i = start_2plane; i < end_2plane; i++)
+ {
+ const block_mode& bm = bsd.block_modes[i];
+ assert(bm.is_dual_plane);
+
+ if (bm.quant_mode > max_weight_quant)
+ {
+ qwt_errors[i] = 1e38f;
+ continue;
+ }
+
+ qwt_bitcounts[i] = static_cast<int8_t>(109 - bm.weight_bits);
+
+ if (weight_high_value1[i] > 1.02f * min_wt_cutoff1)
+ {
+ weight_high_value1[i] = 1.0f;
+ }
+
+ if (weight_high_value2[i] > 1.02f * min_wt_cutoff2)
+ {
+ weight_high_value2[i] = 1.0f;
+ }
+
+ unsigned int decimation_mode = bm.decimation_mode;
+ const auto& di = bsd.get_decimation_info(decimation_mode);
+
+ alignas(ASTCENC_VECALIGN) float dec_weights_uquantf[BLOCK_MAX_WEIGHTS];
+
+ // Generate the optimized set of weights for the mode
+ compute_quantized_weights_for_decimation(
+ di,
+ weight_low_value1[i],
+ weight_high_value1[i],
+ dec_weights_ideal + BLOCK_MAX_WEIGHTS * decimation_mode,
+ dec_weights_uquantf,
+ dec_weights_uquant + BLOCK_MAX_WEIGHTS * i,
+ bm.get_weight_quant_mode());
+
+ compute_quantized_weights_for_decimation(
+ di,
+ weight_low_value2[i],
+ weight_high_value2[i],
+ dec_weights_ideal + BLOCK_MAX_WEIGHTS * decimation_mode + WEIGHTS_PLANE2_OFFSET,
+ dec_weights_uquantf + WEIGHTS_PLANE2_OFFSET,
+ dec_weights_uquant + BLOCK_MAX_WEIGHTS * i + WEIGHTS_PLANE2_OFFSET,
+ bm.get_weight_quant_mode());
+
+ // Compute weight quantization errors for the block mode
+ qwt_errors[i] = compute_error_of_weight_set_2planes(
+ ei1,
+ ei2,
+ di,
+ dec_weights_uquantf,
+ dec_weights_uquantf + WEIGHTS_PLANE2_OFFSET);
+ }
+
+ // Decide the optimal combination of color endpoint encodings and weight encodings
+ uint8_t partition_format_specifiers[TUNE_MAX_TRIAL_CANDIDATES][BLOCK_MAX_PARTITIONS];
+ int block_mode_index[TUNE_MAX_TRIAL_CANDIDATES];
+
+ quant_method color_quant_level[TUNE_MAX_TRIAL_CANDIDATES];
+ quant_method color_quant_level_mod[TUNE_MAX_TRIAL_CANDIDATES];
+
+ endpoints epm;
+ merge_endpoints(ei1.ep, ei2.ep, plane2_component, epm);
+
+ const auto& pi = bsd.get_partition_info(1, 0);
+ unsigned int candidate_count = compute_ideal_endpoint_formats(
+ pi, blk, epm, qwt_bitcounts, qwt_errors,
+ config.tune_candidate_limit,
+ bsd.block_mode_count_1plane_selected, bsd.block_mode_count_1plane_2plane_selected,
+ partition_format_specifiers, block_mode_index,
+ color_quant_level, color_quant_level_mod, tmpbuf);
+
+ // Iterate over the N believed-to-be-best modes to find out which one is actually best
+ float best_errorval_in_mode = ERROR_CALC_DEFAULT;
+ float best_errorval_in_scb = scb.errorval;
+
+ for (unsigned int i = 0; i < candidate_count; i++)
+ {
+ TRACE_NODE(node0, "candidate");
+
+ const int bm_packed_index = block_mode_index[i];
+ assert(bm_packed_index >= static_cast<int>(bsd.block_mode_count_1plane_selected) &&
+ bm_packed_index < static_cast<int>(bsd.block_mode_count_1plane_2plane_selected));
+ const block_mode& qw_bm = bsd.block_modes[bm_packed_index];
+
+ int decimation_mode = qw_bm.decimation_mode;
+ const auto& di = bsd.get_decimation_info(decimation_mode);
+ promise(di.weight_count > 0);
+
+ trace_add_data("weight_x", di.weight_x);
+ trace_add_data("weight_y", di.weight_y);
+ trace_add_data("weight_z", di.weight_z);
+ trace_add_data("weight_quant", qw_bm.quant_mode);
+
+ vfloat4 rgbs_color;
+ vfloat4 rgbo_color;
+
+ symbolic_compressed_block workscb;
+ endpoints workep = epm;
+
+ uint8_t* u8_weight1_src = dec_weights_uquant + BLOCK_MAX_WEIGHTS * bm_packed_index;
+ uint8_t* u8_weight2_src = dec_weights_uquant + BLOCK_MAX_WEIGHTS * bm_packed_index + WEIGHTS_PLANE2_OFFSET;
+
+ for (int j = 0; j < di.weight_count; j++)
+ {
+ workscb.weights[j] = u8_weight1_src[j];
+ workscb.weights[j + WEIGHTS_PLANE2_OFFSET] = u8_weight2_src[j];
+ }
+
+ for (unsigned int l = 0; l < config.tune_refinement_limit; l++)
+ {
+ recompute_ideal_colors_2planes(
+ blk, bsd, di,
+ workscb.weights, workscb.weights + WEIGHTS_PLANE2_OFFSET,
+ workep, rgbs_color, rgbo_color, plane2_component);
+
+ // Quantize the chosen color
+ workscb.color_formats[0] = pack_color_endpoints(
+ workep.endpt0[0],
+ workep.endpt1[0],
+ rgbs_color, rgbo_color,
+ partition_format_specifiers[i][0],
+ workscb.color_values[0],
+ color_quant_level[i]);
+
+ // Store header fields
+ workscb.partition_count = 1;
+ workscb.partition_index = 0;
+ workscb.quant_mode = color_quant_level[i];
+ workscb.color_formats_matched = 0;
+ workscb.block_mode = qw_bm.mode_index;
+ workscb.plane2_component = static_cast<int8_t>(plane2_component);
+ workscb.block_type = SYM_BTYPE_NONCONST;
+
+ // Pre-realign test
+ if (l == 0)
+ {
+ float errorval = compute_symbolic_block_difference_2plane(config, bsd, workscb, blk);
+ if (errorval == -ERROR_CALC_DEFAULT)
+ {
+ errorval = -errorval;
+ workscb.block_type = SYM_BTYPE_ERROR;
+ }
+
+ trace_add_data("error_prerealign", errorval);
+ best_errorval_in_mode = astc::min(errorval, best_errorval_in_mode);
+
+ // Average refinement improvement is 3.5% per iteration (allow 5%), but the first
+ // iteration can help more so we give it a extra 10% leeway. Use this knowledge to
+ // drive a heuristic to skip blocks that are unlikely to catch up with the best
+ // block we have already.
+ unsigned int iters_remaining = config.tune_refinement_limit - l;
+ float threshold = (0.05f * static_cast<float>(iters_remaining)) + 1.1f;
+ if (errorval > (threshold * best_errorval_in_scb))
+ {
+ break;
+ }
+
+ if (errorval < best_errorval_in_scb)
+ {
+ best_errorval_in_scb = errorval;
+ workscb.errorval = errorval;
+ scb = workscb;
+
+ if (errorval < tune_errorval_threshold)
+ {
+ // Skip remaining candidates - this is "good enough"
+ i = candidate_count;
+ break;
+ }
+ }
+ }
+
+ // Perform a final pass over the weights to try to improve them.
+ bool adjustments;
+ if (di.weight_count != bsd.texel_count)
+ {
+ adjustments = realign_weights_decimated(
+ config.profile, bsd, blk, workscb);
+ }
+ else
+ {
+ adjustments = realign_weights_undecimated(
+ config.profile, bsd, blk, workscb);
+ }
+
+ // Post-realign test
+ float errorval = compute_symbolic_block_difference_2plane(config, bsd, workscb, blk);
+ if (errorval == -ERROR_CALC_DEFAULT)
+ {
+ errorval = -errorval;
+ workscb.block_type = SYM_BTYPE_ERROR;
+ }
+
+ trace_add_data("error_postrealign", errorval);
+ best_errorval_in_mode = astc::min(errorval, best_errorval_in_mode);
+
+ // Average refinement improvement is 3.5% per iteration, so skip blocks that are
+ // unlikely to catch up with the best block we have already. Assume a 5% per step to
+ // give benefit of the doubt ...
+ unsigned int iters_remaining = config.tune_refinement_limit - 1 - l;
+ float threshold = (0.05f * static_cast<float>(iters_remaining)) + 1.0f;
+ if (errorval > (threshold * best_errorval_in_scb))
+ {
+ break;
+ }
+
+ if (errorval < best_errorval_in_scb)
+ {
+ best_errorval_in_scb = errorval;
+ workscb.errorval = errorval;
+ scb = workscb;
+
+ if (errorval < tune_errorval_threshold)
+ {
+ // Skip remaining candidates - this is "good enough"
+ i = candidate_count;
+ break;
+ }
+ }
+
+ if (!adjustments)
+ {
+ break;
+ }
+ }
+ }
+
+ return best_errorval_in_mode;
+}
+
+/**
+ * @brief Determine the lowest cross-channel correlation factor.
+ *
+ * @param texels_per_block The number of texels in a block.
+ * @param blk The image block color data to compress.
+ *
+ * @return Return the lowest correlation factor.
+ */
+static float prepare_block_statistics(
+ int texels_per_block,
+ const image_block& blk
+) {
+ // Compute covariance matrix, as a collection of 10 scalars that form the upper-triangular row
+ // of the matrix. The matrix is symmetric, so this is all we need for this use case.
+ float rs = 0.0f;
+ float gs = 0.0f;
+ float bs = 0.0f;
+ float as = 0.0f;
+ float rr_var = 0.0f;
+ float gg_var = 0.0f;
+ float bb_var = 0.0f;
+ float aa_var = 0.0f;
+ float rg_cov = 0.0f;
+ float rb_cov = 0.0f;
+ float ra_cov = 0.0f;
+ float gb_cov = 0.0f;
+ float ga_cov = 0.0f;
+ float ba_cov = 0.0f;
+
+ float weight_sum = 0.0f;
+
+ promise(texels_per_block > 0);
+ for (int i = 0; i < texels_per_block; i++)
+ {
+ float weight = hadd_s(blk.channel_weight) / 4.0f;
+ assert(weight >= 0.0f);
+ weight_sum += weight;
+
+ float r = blk.data_r[i];
+ float g = blk.data_g[i];
+ float b = blk.data_b[i];
+ float a = blk.data_a[i];
+
+ float rw = r * weight;
+ rs += rw;
+ rr_var += r * rw;
+ rg_cov += g * rw;
+ rb_cov += b * rw;
+ ra_cov += a * rw;
+
+ float gw = g * weight;
+ gs += gw;
+ gg_var += g * gw;
+ gb_cov += b * gw;
+ ga_cov += a * gw;
+
+ float bw = b * weight;
+ bs += bw;
+ bb_var += b * bw;
+ ba_cov += a * bw;
+
+ float aw = a * weight;
+ as += aw;
+ aa_var += a * aw;
+ }
+
+ float rpt = 1.0f / astc::max(weight_sum, 1e-7f);
+
+ rr_var -= rs * (rs * rpt);
+ rg_cov -= gs * (rs * rpt);
+ rb_cov -= bs * (rs * rpt);
+ ra_cov -= as * (rs * rpt);
+
+ gg_var -= gs * (gs * rpt);
+ gb_cov -= bs * (gs * rpt);
+ ga_cov -= as * (gs * rpt);
+
+ bb_var -= bs * (bs * rpt);
+ ba_cov -= as * (bs * rpt);
+
+ aa_var -= as * (as * rpt);
+
+ // These will give a NaN if a channel is constant - these are fixed up in the next step
+ rg_cov *= astc::rsqrt(rr_var * gg_var);
+ rb_cov *= astc::rsqrt(rr_var * bb_var);
+ ra_cov *= astc::rsqrt(rr_var * aa_var);
+ gb_cov *= astc::rsqrt(gg_var * bb_var);
+ ga_cov *= astc::rsqrt(gg_var * aa_var);
+ ba_cov *= astc::rsqrt(bb_var * aa_var);
+
+ if (astc::isnan(rg_cov)) rg_cov = 1.0f;
+ if (astc::isnan(rb_cov)) rb_cov = 1.0f;
+ if (astc::isnan(ra_cov)) ra_cov = 1.0f;
+ if (astc::isnan(gb_cov)) gb_cov = 1.0f;
+ if (astc::isnan(ga_cov)) ga_cov = 1.0f;
+ if (astc::isnan(ba_cov)) ba_cov = 1.0f;
+
+ float lowest_correlation = astc::min(fabsf(rg_cov), fabsf(rb_cov));
+ lowest_correlation = astc::min(lowest_correlation, fabsf(ra_cov));
+ lowest_correlation = astc::min(lowest_correlation, fabsf(gb_cov));
+ lowest_correlation = astc::min(lowest_correlation, fabsf(ga_cov));
+ lowest_correlation = astc::min(lowest_correlation, fabsf(ba_cov));
+
+ // Diagnostic trace points
+ trace_add_data("min_r", blk.data_min.lane<0>());
+ trace_add_data("max_r", blk.data_max.lane<0>());
+ trace_add_data("min_g", blk.data_min.lane<1>());
+ trace_add_data("max_g", blk.data_max.lane<1>());
+ trace_add_data("min_b", blk.data_min.lane<2>());
+ trace_add_data("max_b", blk.data_max.lane<2>());
+ trace_add_data("min_a", blk.data_min.lane<3>());
+ trace_add_data("max_a", blk.data_max.lane<3>());
+ trace_add_data("cov_rg", fabsf(rg_cov));
+ trace_add_data("cov_rb", fabsf(rb_cov));
+ trace_add_data("cov_ra", fabsf(ra_cov));
+ trace_add_data("cov_gb", fabsf(gb_cov));
+ trace_add_data("cov_ga", fabsf(ga_cov));
+ trace_add_data("cov_ba", fabsf(ba_cov));
+
+ return lowest_correlation;
+}
+
+/* See header for documentation. */
+void compress_block(
+ const astcenc_contexti& ctx,
+ const image_block& blk,
+ physical_compressed_block& pcb,
+ compression_working_buffers& tmpbuf)
+{
+ astcenc_profile decode_mode = ctx.config.profile;
+ symbolic_compressed_block scb;
+ const block_size_descriptor& bsd = *ctx.bsd;
+ float lowest_correl;
+
+ TRACE_NODE(node0, "block");
+ trace_add_data("pos_x", blk.xpos);
+ trace_add_data("pos_y", blk.ypos);
+ trace_add_data("pos_z", blk.zpos);
+
+ // Set stricter block targets for luminance data as we have more bits to play with
+ bool block_is_l = blk.is_luminance();
+ float block_is_l_scale = block_is_l ? 1.0f / 1.5f : 1.0f;
+
+ // Set slightly stricter block targets for lumalpha data as we have more bits to play with
+ bool block_is_la = blk.is_luminancealpha();
+ float block_is_la_scale = block_is_la ? 1.0f / 1.05f : 1.0f;
+
+ bool block_skip_two_plane = false;
+ int max_partitions = ctx.config.tune_partition_count_limit;
+
+ unsigned int requested_partition_indices[3] {
+ ctx.config.tune_2partition_index_limit,
+ ctx.config.tune_3partition_index_limit,
+ ctx.config.tune_4partition_index_limit
+ };
+
+ unsigned int requested_partition_trials[3] {
+ ctx.config.tune_2partitioning_candidate_limit,
+ ctx.config.tune_3partitioning_candidate_limit,
+ ctx.config.tune_4partitioning_candidate_limit
+ };
+
+#if defined(ASTCENC_DIAGNOSTICS)
+ // Do this early in diagnostic builds so we can dump uniform metrics
+ // for every block. Do it later in release builds to avoid redundant work!
+ float error_weight_sum = hadd_s(blk.channel_weight) * bsd.texel_count;
+ float error_threshold = ctx.config.tune_db_limit
+ * error_weight_sum
+ * block_is_l_scale
+ * block_is_la_scale;
+
+ lowest_correl = prepare_block_statistics(bsd.texel_count, blk);
+ trace_add_data("lowest_correl", lowest_correl);
+ trace_add_data("tune_error_threshold", error_threshold);
+#endif
+
+ // Detected a constant-color block
+ if (all(blk.data_min == blk.data_max))
+ {
+ TRACE_NODE(node1, "pass");
+ trace_add_data("partition_count", 0);
+ trace_add_data("plane_count", 1);
+
+ scb.partition_count = 0;
+
+ // Encode as FP16 if using HDR
+ if ((decode_mode == ASTCENC_PRF_HDR) ||
+ (decode_mode == ASTCENC_PRF_HDR_RGB_LDR_A))
+ {
+ scb.block_type = SYM_BTYPE_CONST_F16;
+ vint4 color_f16 = float_to_float16(blk.origin_texel);
+ store(color_f16, scb.constant_color);
+ }
+ // Encode as UNORM16 if NOT using HDR
+ else
+ {
+ scb.block_type = SYM_BTYPE_CONST_U16;
+ vfloat4 color_f32 = clamp(0.0f, 1.0f, blk.origin_texel) * 65535.0f;
+ vint4 color_u16 = float_to_int_rtn(color_f32);
+ store(color_u16, scb.constant_color);
+ }
+
+ trace_add_data("exit", "quality hit");
+
+ symbolic_to_physical(bsd, scb, pcb);
+ return;
+ }
+
+#if !defined(ASTCENC_DIAGNOSTICS)
+ float error_weight_sum = hadd_s(blk.channel_weight) * bsd.texel_count;
+ float error_threshold = ctx.config.tune_db_limit
+ * error_weight_sum
+ * block_is_l_scale
+ * block_is_la_scale;
+#endif
+
+ // Set SCB and mode errors to a very high error value
+ scb.errorval = ERROR_CALC_DEFAULT;
+ scb.block_type = SYM_BTYPE_ERROR;
+
+ float best_errorvals_for_pcount[BLOCK_MAX_PARTITIONS] {
+ ERROR_CALC_DEFAULT, ERROR_CALC_DEFAULT, ERROR_CALC_DEFAULT, ERROR_CALC_DEFAULT
+ };
+
+ float exit_thresholds_for_pcount[BLOCK_MAX_PARTITIONS] {
+ 0.0f,
+ ctx.config.tune_2_partition_early_out_limit_factor,
+ ctx.config.tune_3_partition_early_out_limit_factor,
+ 0.0f
+ };
+
+ // Trial using 1 plane of weights and 1 partition.
+
+ // Most of the time we test it twice, first with a mode cutoff of 0 and then with the specified
+ // mode cutoff. This causes an early-out that speeds up encoding of easy blocks. However, this
+ // optimization is disabled for 4x4 and 5x4 blocks where it nearly always slows down the
+ // compression and slightly reduces image quality.
+
+ float errorval_mult[2] {
+ 1.0f / ctx.config.tune_mode0_mse_overshoot,
+ 1.0f
+ };
+
+ static const float errorval_overshoot = 1.0f / ctx.config.tune_refinement_mse_overshoot;
+
+ // Only enable MODE0 fast path (trial 0) if 2D and more than 25 texels
+ int start_trial = 1;
+ if ((bsd.texel_count >= TUNE_MIN_TEXELS_MODE0_FASTPATH) && (bsd.zdim == 1))
+ {
+ start_trial = 0;
+ }
+
+ int quant_limit = QUANT_32;
+ for (int i = start_trial; i < 2; i++)
+ {
+ TRACE_NODE(node1, "pass");
+ trace_add_data("partition_count", 1);
+ trace_add_data("plane_count", 1);
+ trace_add_data("search_mode", i);
+
+ float errorval = compress_symbolic_block_for_partition_1plane(
+ ctx.config, bsd, blk, i == 0,
+ error_threshold * errorval_mult[i] * errorval_overshoot,
+ 1, 0, scb, tmpbuf, QUANT_32);
+
+ // Record the quant level so we can use the filter later searches
+ const auto& bm = bsd.get_block_mode(scb.block_mode);
+ quant_limit = bm.get_weight_quant_mode();
+
+ best_errorvals_for_pcount[0] = astc::min(best_errorvals_for_pcount[0], errorval);
+ if (errorval < (error_threshold * errorval_mult[i]))
+ {
+ trace_add_data("exit", "quality hit");
+ goto END_OF_TESTS;
+ }
+ }
+
+#if !defined(ASTCENC_DIAGNOSTICS)
+ lowest_correl = prepare_block_statistics(bsd.texel_count, blk);
+#endif
+
+ block_skip_two_plane = lowest_correl > ctx.config.tune_2_plane_early_out_limit_correlation;
+
+ // Test the four possible 1-partition, 2-planes modes. Do this in reverse, as
+ // alpha is the most likely to be non-correlated if it is present in the data.
+ for (int i = BLOCK_MAX_COMPONENTS - 1; i >= 0; i--)
+ {
+ TRACE_NODE(node1, "pass");
+ trace_add_data("partition_count", 1);
+ trace_add_data("plane_count", 2);
+ trace_add_data("plane_component", i);
+
+ if (block_skip_two_plane)
+ {
+ trace_add_data("skip", "tune_2_plane_early_out_limit_correlation");
+ continue;
+ }
+
+ if (blk.grayscale && i != 3)
+ {
+ trace_add_data("skip", "grayscale block");
+ continue;
+ }
+
+ if (blk.is_constant_channel(i))
+ {
+ trace_add_data("skip", "constant component");
+ continue;
+ }
+
+ float errorval = compress_symbolic_block_for_partition_2planes(
+ ctx.config, bsd, blk, error_threshold * errorval_overshoot,
+ i, scb, tmpbuf, quant_limit);
+
+ // If attempting two planes is much worse than the best one plane result
+ // then further two plane searches are unlikely to help so move on ...
+ if (errorval > (best_errorvals_for_pcount[0] * 2.0f))
+ {
+ break;
+ }
+
+ if (errorval < error_threshold)
+ {
+ trace_add_data("exit", "quality hit");
+ goto END_OF_TESTS;
+ }
+ }
+
+ // Find best blocks for 2, 3 and 4 partitions
+ for (int partition_count = 2; partition_count <= max_partitions; partition_count++)
+ {
+ unsigned int partition_indices[TUNE_MAX_PARTITIIONING_CANDIDATES];
+
+ unsigned int requested_indices = requested_partition_indices[partition_count - 2];
+
+ unsigned int requested_trials = requested_partition_trials[partition_count - 2];
+ requested_trials = astc::min(requested_trials, requested_indices);
+
+ unsigned int actual_trials = find_best_partition_candidates(
+ bsd, blk, partition_count, requested_indices, partition_indices, requested_trials);
+
+ float best_error_in_prev = best_errorvals_for_pcount[partition_count - 2];
+
+ for (unsigned int i = 0; i < actual_trials; i++)
+ {
+ TRACE_NODE(node1, "pass");
+ trace_add_data("partition_count", partition_count);
+ trace_add_data("partition_index", partition_indices[i]);
+ trace_add_data("plane_count", 1);
+ trace_add_data("search_mode", i);
+
+ float errorval = compress_symbolic_block_for_partition_1plane(
+ ctx.config, bsd, blk, false,
+ error_threshold * errorval_overshoot,
+ partition_count, partition_indices[i],
+ scb, tmpbuf, quant_limit);
+
+ best_errorvals_for_pcount[partition_count - 1] = astc::min(best_errorvals_for_pcount[partition_count - 1], errorval);
+
+ // If using N partitions doesn't improve much over using N-1 partitions then skip trying
+ // N+1. Error can dramatically improve if the data is correlated or non-correlated and
+ // aligns with a partitioning that suits that encoding, so for this inner loop check add
+ // a large error scale because the "other" trial could be a lot better. In total the
+ // error must be at least 2x worse than the best existing error to early-out.
+ float best_error = best_errorvals_for_pcount[partition_count - 1];
+ float best_error_scale = exit_thresholds_for_pcount[partition_count - 1] * 2.0f;
+ if (best_error > (best_error_in_prev * best_error_scale))
+ {
+ trace_add_data("skip", "tune_partition_early_out_limit_factor");
+ goto END_OF_TESTS;
+ }
+
+ if (errorval < error_threshold)
+ {
+ trace_add_data("exit", "quality hit");
+ goto END_OF_TESTS;
+ }
+ }
+
+ // If using N partitions doesn't improve much over using N-1 partitions then skip trying N+1
+ float best_error = best_errorvals_for_pcount[partition_count - 1];
+ float best_error_scale = exit_thresholds_for_pcount[partition_count - 1];
+ if (best_error > (best_error_in_prev * best_error_scale))
+ {
+ trace_add_data("skip", "tune_partition_early_out_limit_factor");
+ goto END_OF_TESTS;
+ }
+ }
+
+ trace_add_data("exit", "quality not hit");
+
+END_OF_TESTS:
+ // If we still have an error block then convert to something we can encode
+ // TODO: Do something more sensible here, such as average color block
+ if (scb.block_type == SYM_BTYPE_ERROR)
+ {
+#if defined(ASTCENC_DIAGNOSTICS)
+ static bool printed_once = false;
+ if (!printed_once)
+ {
+ printed_once = true;
+ printf("WARN: At least one block failed to find a valid encoding.\n"
+ " Try increasing compression quality settings.\n\n");
+ }
+#endif
+
+ scb.block_type = SYM_BTYPE_CONST_U16;
+ vfloat4 color_f32 = clamp(0.0f, 1.0f, blk.origin_texel) * 65535.0f;
+ vint4 color_u16 = float_to_int_rtn(color_f32);
+ store(color_u16, scb.constant_color);
+ }
+
+ // Compress to a physical block
+ symbolic_to_physical(bsd, scb, pcb);
+}
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_compute_variance.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_compute_variance.cpp
new file mode 100644
index 00000000000..48a4af8cef4
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_compute_variance.cpp
@@ -0,0 +1,472 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+
+/**
+ * @brief Functions to calculate variance per component in a NxN footprint.
+ *
+ * We need N to be parametric, so the routine below uses summed area tables in order to execute in
+ * O(1) time independent of how big N is.
+ *
+ * The addition uses a Brent-Kung-based parallel prefix adder. This uses the prefix tree to first
+ * perform a binary reduction, and then distributes the results. This method means that there is no
+ * serial dependency between a given element and the next one, and also significantly improves
+ * numerical stability allowing us to use floats rather than doubles.
+ */
+
+#include "astcenc_internal.h"
+
+#include <cassert>
+
+/**
+ * @brief Generate a prefix-sum array using the Brent-Kung algorithm.
+ *
+ * This will take an input array of the form:
+ * v0, v1, v2, ...
+ * ... and modify in-place to turn it into a prefix-sum array of the form:
+ * v0, v0+v1, v0+v1+v2, ...
+ *
+ * @param d The array to prefix-sum.
+ * @param items The number of items in the array.
+ * @param stride The item spacing in the array; i.e. dense arrays should use 1.
+ */
+static void brent_kung_prefix_sum(
+ vfloat4* d,
+ size_t items,
+ int stride
+) {
+ if (items < 2)
+ return;
+
+ size_t lc_stride = 2;
+ size_t log2_stride = 1;
+
+ // The reduction-tree loop
+ do {
+ size_t step = lc_stride >> 1;
+ size_t start = lc_stride - 1;
+ size_t iters = items >> log2_stride;
+
+ vfloat4 *da = d + (start * stride);
+ ptrdiff_t ofs = -static_cast<ptrdiff_t>(step * stride);
+ size_t ofs_stride = stride << log2_stride;
+
+ while (iters)
+ {
+ *da = *da + da[ofs];
+ da += ofs_stride;
+ iters--;
+ }
+
+ log2_stride += 1;
+ lc_stride <<= 1;
+ } while (lc_stride <= items);
+
+ // The expansion-tree loop
+ do {
+ log2_stride -= 1;
+ lc_stride >>= 1;
+
+ size_t step = lc_stride >> 1;
+ size_t start = step + lc_stride - 1;
+ size_t iters = (items - step) >> log2_stride;
+
+ vfloat4 *da = d + (start * stride);
+ ptrdiff_t ofs = -static_cast<ptrdiff_t>(step * stride);
+ size_t ofs_stride = stride << log2_stride;
+
+ while (iters)
+ {
+ *da = *da + da[ofs];
+ da += ofs_stride;
+ iters--;
+ }
+ } while (lc_stride > 2);
+}
+
+/* See header for documentation. */
+void compute_pixel_region_variance(
+ astcenc_contexti& ctx,
+ const pixel_region_args& arg
+) {
+ // Unpack the memory structure into local variables
+ const astcenc_image* img = arg.img;
+ astcenc_swizzle swz = arg.swz;
+ bool have_z = arg.have_z;
+
+ int size_x = arg.size_x;
+ int size_y = arg.size_y;
+ int size_z = arg.size_z;
+
+ int offset_x = arg.offset_x;
+ int offset_y = arg.offset_y;
+ int offset_z = arg.offset_z;
+
+ int alpha_kernel_radius = arg.alpha_kernel_radius;
+
+ float* input_alpha_averages = ctx.input_alpha_averages;
+ vfloat4* work_memory = arg.work_memory;
+
+ // Compute memory sizes and dimensions that we need
+ int kernel_radius = alpha_kernel_radius;
+ int kerneldim = 2 * kernel_radius + 1;
+ int kernel_radius_xy = kernel_radius;
+ int kernel_radius_z = have_z ? kernel_radius : 0;
+
+ int padsize_x = size_x + kerneldim;
+ int padsize_y = size_y + kerneldim;
+ int padsize_z = size_z + (have_z ? kerneldim : 0);
+ int sizeprod = padsize_x * padsize_y * padsize_z;
+
+ int zd_start = have_z ? 1 : 0;
+
+ vfloat4 *varbuf1 = work_memory;
+ vfloat4 *varbuf2 = work_memory + sizeprod;
+
+ // Scaling factors to apply to Y and Z for accesses into the work buffers
+ int yst = padsize_x;
+ int zst = padsize_x * padsize_y;
+
+ // Scaling factors to apply to Y and Z for accesses into result buffers
+ int ydt = img->dim_x;
+ int zdt = img->dim_x * img->dim_y;
+
+ // Macros to act as accessor functions for the work-memory
+ #define VARBUF1(z, y, x) varbuf1[z * zst + y * yst + x]
+ #define VARBUF2(z, y, x) varbuf2[z * zst + y * yst + x]
+
+ // Load N and N^2 values into the work buffers
+ if (img->data_type == ASTCENC_TYPE_U8)
+ {
+ // Swizzle data structure 4 = ZERO, 5 = ONE
+ uint8_t data[6];
+ data[ASTCENC_SWZ_0] = 0;
+ data[ASTCENC_SWZ_1] = 255;
+
+ for (int z = zd_start; z < padsize_z; z++)
+ {
+ int z_src = (z - zd_start) + offset_z - kernel_radius_z;
+ z_src = astc::clamp(z_src, 0, static_cast<int>(img->dim_z - 1));
+ uint8_t* data8 = static_cast<uint8_t*>(img->data[z_src]);
+
+ for (int y = 1; y < padsize_y; y++)
+ {
+ int y_src = (y - 1) + offset_y - kernel_radius_xy;
+ y_src = astc::clamp(y_src, 0, static_cast<int>(img->dim_y - 1));
+
+ for (int x = 1; x < padsize_x; x++)
+ {
+ int x_src = (x - 1) + offset_x - kernel_radius_xy;
+ x_src = astc::clamp(x_src, 0, static_cast<int>(img->dim_x - 1));
+
+ data[0] = data8[(4 * img->dim_x * y_src) + (4 * x_src )];
+ data[1] = data8[(4 * img->dim_x * y_src) + (4 * x_src + 1)];
+ data[2] = data8[(4 * img->dim_x * y_src) + (4 * x_src + 2)];
+ data[3] = data8[(4 * img->dim_x * y_src) + (4 * x_src + 3)];
+
+ uint8_t r = data[swz.r];
+ uint8_t g = data[swz.g];
+ uint8_t b = data[swz.b];
+ uint8_t a = data[swz.a];
+
+ vfloat4 d = vfloat4 (r * (1.0f / 255.0f),
+ g * (1.0f / 255.0f),
+ b * (1.0f / 255.0f),
+ a * (1.0f / 255.0f));
+
+ VARBUF1(z, y, x) = d;
+ VARBUF2(z, y, x) = d * d;
+ }
+ }
+ }
+ }
+ else if (img->data_type == ASTCENC_TYPE_F16)
+ {
+ // Swizzle data structure 4 = ZERO, 5 = ONE (in FP16)
+ uint16_t data[6];
+ data[ASTCENC_SWZ_0] = 0;
+ data[ASTCENC_SWZ_1] = 0x3C00;
+
+ for (int z = zd_start; z < padsize_z; z++)
+ {
+ int z_src = (z - zd_start) + offset_z - kernel_radius_z;
+ z_src = astc::clamp(z_src, 0, static_cast<int>(img->dim_z - 1));
+ uint16_t* data16 = static_cast<uint16_t*>(img->data[z_src]);
+
+ for (int y = 1; y < padsize_y; y++)
+ {
+ int y_src = (y - 1) + offset_y - kernel_radius_xy;
+ y_src = astc::clamp(y_src, 0, static_cast<int>(img->dim_y - 1));
+
+ for (int x = 1; x < padsize_x; x++)
+ {
+ int x_src = (x - 1) + offset_x - kernel_radius_xy;
+ x_src = astc::clamp(x_src, 0, static_cast<int>(img->dim_x - 1));
+
+ data[0] = data16[(4 * img->dim_x * y_src) + (4 * x_src )];
+ data[1] = data16[(4 * img->dim_x * y_src) + (4 * x_src + 1)];
+ data[2] = data16[(4 * img->dim_x * y_src) + (4 * x_src + 2)];
+ data[3] = data16[(4 * img->dim_x * y_src) + (4 * x_src + 3)];
+
+ vint4 di(data[swz.r], data[swz.g], data[swz.b], data[swz.a]);
+ vfloat4 d = float16_to_float(di);
+
+ VARBUF1(z, y, x) = d;
+ VARBUF2(z, y, x) = d * d;
+ }
+ }
+ }
+ }
+ else // if (img->data_type == ASTCENC_TYPE_F32)
+ {
+ assert(img->data_type == ASTCENC_TYPE_F32);
+
+ // Swizzle data structure 4 = ZERO, 5 = ONE (in FP16)
+ float data[6];
+ data[ASTCENC_SWZ_0] = 0.0f;
+ data[ASTCENC_SWZ_1] = 1.0f;
+
+ for (int z = zd_start; z < padsize_z; z++)
+ {
+ int z_src = (z - zd_start) + offset_z - kernel_radius_z;
+ z_src = astc::clamp(z_src, 0, static_cast<int>(img->dim_z - 1));
+ float* data32 = static_cast<float*>(img->data[z_src]);
+
+ for (int y = 1; y < padsize_y; y++)
+ {
+ int y_src = (y - 1) + offset_y - kernel_radius_xy;
+ y_src = astc::clamp(y_src, 0, static_cast<int>(img->dim_y - 1));
+
+ for (int x = 1; x < padsize_x; x++)
+ {
+ int x_src = (x - 1) + offset_x - kernel_radius_xy;
+ x_src = astc::clamp(x_src, 0, static_cast<int>(img->dim_x - 1));
+
+ data[0] = data32[(4 * img->dim_x * y_src) + (4 * x_src )];
+ data[1] = data32[(4 * img->dim_x * y_src) + (4 * x_src + 1)];
+ data[2] = data32[(4 * img->dim_x * y_src) + (4 * x_src + 2)];
+ data[3] = data32[(4 * img->dim_x * y_src) + (4 * x_src + 3)];
+
+ float r = data[swz.r];
+ float g = data[swz.g];
+ float b = data[swz.b];
+ float a = data[swz.a];
+
+ vfloat4 d(r, g, b, a);
+
+ VARBUF1(z, y, x) = d;
+ VARBUF2(z, y, x) = d * d;
+ }
+ }
+ }
+ }
+
+ // Pad with an extra layer of 0s; this forms the edge of the SAT tables
+ vfloat4 vbz = vfloat4::zero();
+ for (int z = 0; z < padsize_z; z++)
+ {
+ for (int y = 0; y < padsize_y; y++)
+ {
+ VARBUF1(z, y, 0) = vbz;
+ VARBUF2(z, y, 0) = vbz;
+ }
+
+ for (int x = 0; x < padsize_x; x++)
+ {
+ VARBUF1(z, 0, x) = vbz;
+ VARBUF2(z, 0, x) = vbz;
+ }
+ }
+
+ if (have_z)
+ {
+ for (int y = 0; y < padsize_y; y++)
+ {
+ for (int x = 0; x < padsize_x; x++)
+ {
+ VARBUF1(0, y, x) = vbz;
+ VARBUF2(0, y, x) = vbz;
+ }
+ }
+ }
+
+ // Generate summed-area tables for N and N^2; this is done in-place, using
+ // a Brent-Kung parallel-prefix based algorithm to minimize precision loss
+ for (int z = zd_start; z < padsize_z; z++)
+ {
+ for (int y = 1; y < padsize_y; y++)
+ {
+ brent_kung_prefix_sum(&(VARBUF1(z, y, 1)), padsize_x - 1, 1);
+ brent_kung_prefix_sum(&(VARBUF2(z, y, 1)), padsize_x - 1, 1);
+ }
+ }
+
+ for (int z = zd_start; z < padsize_z; z++)
+ {
+ for (int x = 1; x < padsize_x; x++)
+ {
+ brent_kung_prefix_sum(&(VARBUF1(z, 1, x)), padsize_y - 1, yst);
+ brent_kung_prefix_sum(&(VARBUF2(z, 1, x)), padsize_y - 1, yst);
+ }
+ }
+
+ if (have_z)
+ {
+ for (int y = 1; y < padsize_y; y++)
+ {
+ for (int x = 1; x < padsize_x; x++)
+ {
+ brent_kung_prefix_sum(&(VARBUF1(1, y, x)), padsize_z - 1, zst);
+ brent_kung_prefix_sum(&(VARBUF2(1, y, x)), padsize_z - 1, zst);
+ }
+ }
+ }
+
+ // Compute a few constants used in the variance-calculation.
+ float alpha_kdim = static_cast<float>(2 * alpha_kernel_radius + 1);
+ float alpha_rsamples;
+
+ if (have_z)
+ {
+ alpha_rsamples = 1.0f / (alpha_kdim * alpha_kdim * alpha_kdim);
+ }
+ else
+ {
+ alpha_rsamples = 1.0f / (alpha_kdim * alpha_kdim);
+ }
+
+ // Use the summed-area tables to compute variance for each neighborhood
+ if (have_z)
+ {
+ for (int z = 0; z < size_z; z++)
+ {
+ int z_src = z + kernel_radius_z;
+ int z_dst = z + offset_z;
+ int z_low = z_src - alpha_kernel_radius;
+ int z_high = z_src + alpha_kernel_radius + 1;
+
+ for (int y = 0; y < size_y; y++)
+ {
+ int y_src = y + kernel_radius_xy;
+ int y_dst = y + offset_y;
+ int y_low = y_src - alpha_kernel_radius;
+ int y_high = y_src + alpha_kernel_radius + 1;
+
+ for (int x = 0; x < size_x; x++)
+ {
+ int x_src = x + kernel_radius_xy;
+ int x_dst = x + offset_x;
+ int x_low = x_src - alpha_kernel_radius;
+ int x_high = x_src + alpha_kernel_radius + 1;
+
+ // Summed-area table lookups for alpha average
+ float vasum = ( VARBUF1(z_high, y_low, x_low).lane<3>()
+ - VARBUF1(z_high, y_low, x_high).lane<3>()
+ - VARBUF1(z_high, y_high, x_low).lane<3>()
+ + VARBUF1(z_high, y_high, x_high).lane<3>()) -
+ ( VARBUF1(z_low, y_low, x_low).lane<3>()
+ - VARBUF1(z_low, y_low, x_high).lane<3>()
+ - VARBUF1(z_low, y_high, x_low).lane<3>()
+ + VARBUF1(z_low, y_high, x_high).lane<3>());
+
+ int out_index = z_dst * zdt + y_dst * ydt + x_dst;
+ input_alpha_averages[out_index] = (vasum * alpha_rsamples);
+ }
+ }
+ }
+ }
+ else
+ {
+ for (int y = 0; y < size_y; y++)
+ {
+ int y_src = y + kernel_radius_xy;
+ int y_dst = y + offset_y;
+ int y_low = y_src - alpha_kernel_radius;
+ int y_high = y_src + alpha_kernel_radius + 1;
+
+ for (int x = 0; x < size_x; x++)
+ {
+ int x_src = x + kernel_radius_xy;
+ int x_dst = x + offset_x;
+ int x_low = x_src - alpha_kernel_radius;
+ int x_high = x_src + alpha_kernel_radius + 1;
+
+ // Summed-area table lookups for alpha average
+ float vasum = VARBUF1(0, y_low, x_low).lane<3>()
+ - VARBUF1(0, y_low, x_high).lane<3>()
+ - VARBUF1(0, y_high, x_low).lane<3>()
+ + VARBUF1(0, y_high, x_high).lane<3>();
+
+ int out_index = y_dst * ydt + x_dst;
+ input_alpha_averages[out_index] = (vasum * alpha_rsamples);
+ }
+ }
+ }
+}
+
+/* See header for documentation. */
+unsigned int init_compute_averages(
+ const astcenc_image& img,
+ unsigned int alpha_kernel_radius,
+ const astcenc_swizzle& swz,
+ avg_args& ag
+) {
+ unsigned int size_x = img.dim_x;
+ unsigned int size_y = img.dim_y;
+ unsigned int size_z = img.dim_z;
+
+ // Compute maximum block size and from that the working memory buffer size
+ unsigned int kernel_radius = alpha_kernel_radius;
+ unsigned int kerneldim = 2 * kernel_radius + 1;
+
+ bool have_z = (size_z > 1);
+ unsigned int max_blk_size_xy = have_z ? 16 : 32;
+ unsigned int max_blk_size_z = astc::min(size_z, have_z ? 16u : 1u);
+
+ unsigned int max_padsize_xy = max_blk_size_xy + kerneldim;
+ unsigned int max_padsize_z = max_blk_size_z + (have_z ? kerneldim : 0);
+
+ // Perform block-wise averages calculations across the image
+ // Initialize fields which are not populated until later
+ ag.arg.size_x = 0;
+ ag.arg.size_y = 0;
+ ag.arg.size_z = 0;
+ ag.arg.offset_x = 0;
+ ag.arg.offset_y = 0;
+ ag.arg.offset_z = 0;
+ ag.arg.work_memory = nullptr;
+
+ ag.arg.img = &img;
+ ag.arg.swz = swz;
+ ag.arg.have_z = have_z;
+ ag.arg.alpha_kernel_radius = alpha_kernel_radius;
+
+ ag.img_size_x = size_x;
+ ag.img_size_y = size_y;
+ ag.img_size_z = size_z;
+ ag.blk_size_xy = max_blk_size_xy;
+ ag.blk_size_z = max_blk_size_z;
+ ag.work_memory_size = 2 * max_padsize_xy * max_padsize_xy * max_padsize_z;
+
+ // The parallel task count
+ unsigned int z_tasks = (size_z + max_blk_size_z - 1) / max_blk_size_z;
+ unsigned int y_tasks = (size_y + max_blk_size_xy - 1) / max_blk_size_xy;
+ return z_tasks * y_tasks;
+}
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_decompress_symbolic.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_decompress_symbolic.cpp
new file mode 100644
index 00000000000..8be222b7b3f
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_decompress_symbolic.cpp
@@ -0,0 +1,623 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Functions to decompress a symbolic block.
+ */
+
+#include "astcenc_internal.h"
+
+#include <stdio.h>
+#include <assert.h>
+
+/**
+ * @brief Compute the integer linear interpolation of two color endpoints.
+ *
+ * @param decode_mode The ASTC profile (linear or sRGB)
+ * @param color0 The endpoint0 color.
+ * @param color1 The endpoint1 color.
+ * @param weights The interpolation weight (between 0 and 64).
+ *
+ * @return The interpolated color.
+ */
+static vint4 lerp_color_int(
+ astcenc_profile decode_mode,
+ vint4 color0,
+ vint4 color1,
+ vint4 weights
+) {
+ vint4 weight1 = weights;
+ vint4 weight0 = vint4(64) - weight1;
+
+ if (decode_mode == ASTCENC_PRF_LDR_SRGB)
+ {
+ color0 = asr<8>(color0);
+ color1 = asr<8>(color1);
+ }
+
+ vint4 color = (color0 * weight0) + (color1 * weight1) + vint4(32);
+ color = asr<6>(color);
+
+ if (decode_mode == ASTCENC_PRF_LDR_SRGB)
+ {
+ color = color * vint4(257);
+ }
+
+ return color;
+}
+
+
+/**
+ * @brief Convert integer color value into a float value for the decoder.
+ *
+ * @param data The integer color value post-interpolation.
+ * @param lns_mask If set treat lane as HDR (LNS) else LDR (unorm16).
+ *
+ * @return The float color value.
+ */
+static inline vfloat4 decode_texel(
+ vint4 data,
+ vmask4 lns_mask
+) {
+ vint4 color_lns = vint4::zero();
+ vint4 color_unorm = vint4::zero();
+
+ if (any(lns_mask))
+ {
+ color_lns = lns_to_sf16(data);
+ }
+
+ if (!all(lns_mask))
+ {
+ color_unorm = unorm16_to_sf16(data);
+ }
+
+ // Pick components and then convert to FP16
+ vint4 datai = select(color_unorm, color_lns, lns_mask);
+ return float16_to_float(datai);
+}
+
+/* See header for documentation. */
+void unpack_weights(
+ const block_size_descriptor& bsd,
+ const symbolic_compressed_block& scb,
+ const decimation_info& di,
+ bool is_dual_plane,
+ int weights_plane1[BLOCK_MAX_TEXELS],
+ int weights_plane2[BLOCK_MAX_TEXELS]
+) {
+ // Safe to overshoot as all arrays are allocated to full size
+ if (!is_dual_plane)
+ {
+ // Build full 64-entry weight lookup table
+ vint4 tab0(reinterpret_cast<const int*>(scb.weights + 0));
+ vint4 tab1(reinterpret_cast<const int*>(scb.weights + 16));
+ vint4 tab2(reinterpret_cast<const int*>(scb.weights + 32));
+ vint4 tab3(reinterpret_cast<const int*>(scb.weights + 48));
+
+ vint tab0p, tab1p, tab2p, tab3p;
+ vtable_prepare(tab0, tab1, tab2, tab3, tab0p, tab1p, tab2p, tab3p);
+
+ for (unsigned int i = 0; i < bsd.texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vint summed_value(8);
+ vint weight_count(di.texel_weight_count + i);
+ int max_weight_count = hmax(weight_count).lane<0>();
+
+ promise(max_weight_count > 0);
+ for (int j = 0; j < max_weight_count; j++)
+ {
+ vint texel_weights(di.texel_weights_4t[j] + i);
+ vint texel_weights_int(di.texel_weights_int_4t[j] + i);
+
+ summed_value += vtable_8bt_32bi(tab0p, tab1p, tab2p, tab3p, texel_weights) * texel_weights_int;
+ }
+
+ store(lsr<4>(summed_value), weights_plane1 + i);
+ }
+ }
+ else
+ {
+ // Build a 32-entry weight lookup table per plane
+ // Plane 1
+ vint4 tab0_plane1(reinterpret_cast<const int*>(scb.weights + 0));
+ vint4 tab1_plane1(reinterpret_cast<const int*>(scb.weights + 16));
+ vint tab0_plane1p, tab1_plane1p;
+ vtable_prepare(tab0_plane1, tab1_plane1, tab0_plane1p, tab1_plane1p);
+
+ // Plane 2
+ vint4 tab0_plane2(reinterpret_cast<const int*>(scb.weights + 32));
+ vint4 tab1_plane2(reinterpret_cast<const int*>(scb.weights + 48));
+ vint tab0_plane2p, tab1_plane2p;
+ vtable_prepare(tab0_plane2, tab1_plane2, tab0_plane2p, tab1_plane2p);
+
+ for (unsigned int i = 0; i < bsd.texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vint sum_plane1(8);
+ vint sum_plane2(8);
+
+ vint weight_count(di.texel_weight_count + i);
+ int max_weight_count = hmax(weight_count).lane<0>();
+
+ promise(max_weight_count > 0);
+ for (int j = 0; j < max_weight_count; j++)
+ {
+ vint texel_weights(di.texel_weights_4t[j] + i);
+ vint texel_weights_int(di.texel_weights_int_4t[j] + i);
+
+ sum_plane1 += vtable_8bt_32bi(tab0_plane1p, tab1_plane1p, texel_weights) * texel_weights_int;
+ sum_plane2 += vtable_8bt_32bi(tab0_plane2p, tab1_plane2p, texel_weights) * texel_weights_int;
+ }
+
+ store(lsr<4>(sum_plane1), weights_plane1 + i);
+ store(lsr<4>(sum_plane2), weights_plane2 + i);
+ }
+ }
+}
+
+/**
+ * @brief Return an FP32 NaN value for use in error colors.
+ *
+ * This NaN encoding will turn into 0xFFFF when converted to an FP16 NaN.
+ *
+ * @return The float color value.
+ */
+static float error_color_nan()
+{
+ if32 v;
+ v.u = 0xFFFFE000U;
+ return v.f;
+}
+
+/* See header for documentation. */
+void decompress_symbolic_block(
+ astcenc_profile decode_mode,
+ const block_size_descriptor& bsd,
+ int xpos,
+ int ypos,
+ int zpos,
+ const symbolic_compressed_block& scb,
+ image_block& blk
+) {
+ blk.xpos = xpos;
+ blk.ypos = ypos;
+ blk.zpos = zpos;
+
+ blk.data_min = vfloat4::zero();
+ blk.data_mean = vfloat4::zero();
+ blk.data_max = vfloat4::zero();
+ blk.grayscale = false;
+
+ // If we detected an error-block, blow up immediately.
+ if (scb.block_type == SYM_BTYPE_ERROR)
+ {
+ for (unsigned int i = 0; i < bsd.texel_count; i++)
+ {
+ blk.data_r[i] = error_color_nan();
+ blk.data_g[i] = error_color_nan();
+ blk.data_b[i] = error_color_nan();
+ blk.data_a[i] = error_color_nan();
+ blk.rgb_lns[i] = 0;
+ blk.alpha_lns[i] = 0;
+ }
+
+ return;
+ }
+
+ if ((scb.block_type == SYM_BTYPE_CONST_F16) ||
+ (scb.block_type == SYM_BTYPE_CONST_U16))
+ {
+ vfloat4 color;
+ uint8_t use_lns = 0;
+
+ // UNORM16 constant color block
+ if (scb.block_type == SYM_BTYPE_CONST_U16)
+ {
+ vint4 colori(scb.constant_color);
+
+ // For sRGB decoding a real decoder would just use the top 8 bits for color conversion.
+ // We don't color convert, so rescale the top 8 bits into the full 16 bit dynamic range.
+ if (decode_mode == ASTCENC_PRF_LDR_SRGB)
+ {
+ colori = asr<8>(colori) * 257;
+ }
+
+ vint4 colorf16 = unorm16_to_sf16(colori);
+ color = float16_to_float(colorf16);
+ }
+ // FLOAT16 constant color block
+ else
+ {
+ switch (decode_mode)
+ {
+ case ASTCENC_PRF_LDR_SRGB:
+ case ASTCENC_PRF_LDR:
+ color = vfloat4(error_color_nan());
+ break;
+ case ASTCENC_PRF_HDR_RGB_LDR_A:
+ case ASTCENC_PRF_HDR:
+ // Constant-color block; unpack from FP16 to FP32.
+ color = float16_to_float(vint4(scb.constant_color));
+ use_lns = 1;
+ break;
+ }
+ }
+
+ for (unsigned int i = 0; i < bsd.texel_count; i++)
+ {
+ blk.data_r[i] = color.lane<0>();
+ blk.data_g[i] = color.lane<1>();
+ blk.data_b[i] = color.lane<2>();
+ blk.data_a[i] = color.lane<3>();
+ blk.rgb_lns[i] = use_lns;
+ blk.alpha_lns[i] = use_lns;
+ }
+
+ return;
+ }
+
+ // Get the appropriate partition-table entry
+ int partition_count = scb.partition_count;
+ const auto& pi = bsd.get_partition_info(partition_count, scb.partition_index);
+
+ // Get the appropriate block descriptors
+ const auto& bm = bsd.get_block_mode(scb.block_mode);
+ const auto& di = bsd.get_decimation_info(bm.decimation_mode);
+
+ bool is_dual_plane = static_cast<bool>(bm.is_dual_plane);
+
+ // Unquantize and undecimate the weights
+ int plane1_weights[BLOCK_MAX_TEXELS];
+ int plane2_weights[BLOCK_MAX_TEXELS];
+ unpack_weights(bsd, scb, di, is_dual_plane, plane1_weights, plane2_weights);
+
+ // Now that we have endpoint colors and weights, we can unpack texel colors
+ int plane2_component = is_dual_plane ? scb.plane2_component : -1;
+ vmask4 plane2_mask = vint4::lane_id() == vint4(plane2_component);
+
+ for (int i = 0; i < partition_count; i++)
+ {
+ // Decode the color endpoints for this partition
+ vint4 ep0;
+ vint4 ep1;
+ bool rgb_lns;
+ bool a_lns;
+
+ unpack_color_endpoints(decode_mode,
+ scb.color_formats[i],
+ scb.color_values[i],
+ rgb_lns, a_lns,
+ ep0, ep1);
+
+ vmask4 lns_mask(rgb_lns, rgb_lns, rgb_lns, a_lns);
+
+ int texel_count = pi.partition_texel_count[i];
+ for (int j = 0; j < texel_count; j++)
+ {
+ int tix = pi.texels_of_partition[i][j];
+ vint4 weight = select(vint4(plane1_weights[tix]), vint4(plane2_weights[tix]), plane2_mask);
+ vint4 color = lerp_color_int(decode_mode, ep0, ep1, weight);
+ vfloat4 colorf = decode_texel(color, lns_mask);
+
+ blk.data_r[tix] = colorf.lane<0>();
+ blk.data_g[tix] = colorf.lane<1>();
+ blk.data_b[tix] = colorf.lane<2>();
+ blk.data_a[tix] = colorf.lane<3>();
+ }
+ }
+}
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+
+/* See header for documentation. */
+float compute_symbolic_block_difference_2plane(
+ const astcenc_config& config,
+ const block_size_descriptor& bsd,
+ const symbolic_compressed_block& scb,
+ const image_block& blk
+) {
+ // If we detected an error-block, blow up immediately.
+ if (scb.block_type == SYM_BTYPE_ERROR)
+ {
+ return ERROR_CALC_DEFAULT;
+ }
+
+ assert(scb.block_mode >= 0);
+ assert(scb.partition_count == 1);
+ assert(bsd.get_block_mode(scb.block_mode).is_dual_plane == 1);
+
+ // Get the appropriate block descriptor
+ const block_mode& bm = bsd.get_block_mode(scb.block_mode);
+ const decimation_info& di = bsd.get_decimation_info(bm.decimation_mode);
+
+ // Unquantize and undecimate the weights
+ int plane1_weights[BLOCK_MAX_TEXELS];
+ int plane2_weights[BLOCK_MAX_TEXELS];
+ unpack_weights(bsd, scb, di, true, plane1_weights, plane2_weights);
+
+ vmask4 plane2_mask = vint4::lane_id() == vint4(scb.plane2_component);
+
+ vfloat4 summa = vfloat4::zero();
+
+ // Decode the color endpoints for this partition
+ vint4 ep0;
+ vint4 ep1;
+ bool rgb_lns;
+ bool a_lns;
+
+ unpack_color_endpoints(config.profile,
+ scb.color_formats[0],
+ scb.color_values[0],
+ rgb_lns, a_lns,
+ ep0, ep1);
+
+ // Unpack and compute error for each texel in the partition
+ unsigned int texel_count = bsd.texel_count;
+ for (unsigned int i = 0; i < texel_count; i++)
+ {
+ vint4 weight = select(vint4(plane1_weights[i]), vint4(plane2_weights[i]), plane2_mask);
+ vint4 colori = lerp_color_int(config.profile, ep0, ep1, weight);
+
+ vfloat4 color = int_to_float(colori);
+ vfloat4 oldColor = blk.texel(i);
+
+ // Compare error using a perceptual decode metric for RGBM textures
+ if (config.flags & ASTCENC_FLG_MAP_RGBM)
+ {
+ // Fail encodings that result in zero weight M pixels. Note that this can cause
+ // "interesting" artifacts if we reject all useful encodings - we typically get max
+ // brightness encodings instead which look just as bad. We recommend users apply a
+ // bias to their stored M value, limiting the lower value to 16 or 32 to avoid
+ // getting small M values post-quantization, but we can't prove it would never
+ // happen, especially at low bit rates ...
+ if (color.lane<3>() == 0.0f)
+ {
+ return -ERROR_CALC_DEFAULT;
+ }
+
+ // Compute error based on decoded RGBM color
+ color = vfloat4(
+ color.lane<0>() * color.lane<3>() * config.rgbm_m_scale,
+ color.lane<1>() * color.lane<3>() * config.rgbm_m_scale,
+ color.lane<2>() * color.lane<3>() * config.rgbm_m_scale,
+ 1.0f
+ );
+
+ oldColor = vfloat4(
+ oldColor.lane<0>() * oldColor.lane<3>() * config.rgbm_m_scale,
+ oldColor.lane<1>() * oldColor.lane<3>() * config.rgbm_m_scale,
+ oldColor.lane<2>() * oldColor.lane<3>() * config.rgbm_m_scale,
+ 1.0f
+ );
+ }
+
+ vfloat4 error = oldColor - color;
+ error = min(abs(error), 1e15f);
+ error = error * error;
+
+ summa += min(dot(error, blk.channel_weight), ERROR_CALC_DEFAULT);
+ }
+
+ return summa.lane<0>();
+}
+
+/* See header for documentation. */
+float compute_symbolic_block_difference_1plane(
+ const astcenc_config& config,
+ const block_size_descriptor& bsd,
+ const symbolic_compressed_block& scb,
+ const image_block& blk
+) {
+ assert(bsd.get_block_mode(scb.block_mode).is_dual_plane == 0);
+
+ // If we detected an error-block, blow up immediately.
+ if (scb.block_type == SYM_BTYPE_ERROR)
+ {
+ return ERROR_CALC_DEFAULT;
+ }
+
+ assert(scb.block_mode >= 0);
+
+ // Get the appropriate partition-table entry
+ unsigned int partition_count = scb.partition_count;
+ const auto& pi = bsd.get_partition_info(partition_count, scb.partition_index);
+
+ // Get the appropriate block descriptor
+ const block_mode& bm = bsd.get_block_mode(scb.block_mode);
+ const decimation_info& di = bsd.get_decimation_info(bm.decimation_mode);
+
+ // Unquantize and undecimate the weights
+ int plane1_weights[BLOCK_MAX_TEXELS];
+ unpack_weights(bsd, scb, di, false, plane1_weights, nullptr);
+
+ vfloat4 summa = vfloat4::zero();
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ // Decode the color endpoints for this partition
+ vint4 ep0;
+ vint4 ep1;
+ bool rgb_lns;
+ bool a_lns;
+
+ unpack_color_endpoints(config.profile,
+ scb.color_formats[i],
+ scb.color_values[i],
+ rgb_lns, a_lns,
+ ep0, ep1);
+
+ // Unpack and compute error for each texel in the partition
+ unsigned int texel_count = pi.partition_texel_count[i];
+ for (unsigned int j = 0; j < texel_count; j++)
+ {
+ unsigned int tix = pi.texels_of_partition[i][j];
+ vint4 colori = lerp_color_int(config.profile, ep0, ep1,
+ vint4(plane1_weights[tix]));
+
+ vfloat4 color = int_to_float(colori);
+ vfloat4 oldColor = blk.texel(tix);
+
+ // Compare error using a perceptual decode metric for RGBM textures
+ if (config.flags & ASTCENC_FLG_MAP_RGBM)
+ {
+ // Fail encodings that result in zero weight M pixels. Note that this can cause
+ // "interesting" artifacts if we reject all useful encodings - we typically get max
+ // brightness encodings instead which look just as bad. We recommend users apply a
+ // bias to their stored M value, limiting the lower value to 16 or 32 to avoid
+ // getting small M values post-quantization, but we can't prove it would never
+ // happen, especially at low bit rates ...
+ if (color.lane<3>() == 0.0f)
+ {
+ return -ERROR_CALC_DEFAULT;
+ }
+
+ // Compute error based on decoded RGBM color
+ color = vfloat4(
+ color.lane<0>() * color.lane<3>() * config.rgbm_m_scale,
+ color.lane<1>() * color.lane<3>() * config.rgbm_m_scale,
+ color.lane<2>() * color.lane<3>() * config.rgbm_m_scale,
+ 1.0f
+ );
+
+ oldColor = vfloat4(
+ oldColor.lane<0>() * oldColor.lane<3>() * config.rgbm_m_scale,
+ oldColor.lane<1>() * oldColor.lane<3>() * config.rgbm_m_scale,
+ oldColor.lane<2>() * oldColor.lane<3>() * config.rgbm_m_scale,
+ 1.0f
+ );
+ }
+
+ vfloat4 error = oldColor - color;
+ error = min(abs(error), 1e15f);
+ error = error * error;
+
+ summa += min(dot(error, blk.channel_weight), ERROR_CALC_DEFAULT);
+ }
+ }
+
+ return summa.lane<0>();
+}
+
+/* See header for documentation. */
+float compute_symbolic_block_difference_1plane_1partition(
+ const astcenc_config& config,
+ const block_size_descriptor& bsd,
+ const symbolic_compressed_block& scb,
+ const image_block& blk
+) {
+ // If we detected an error-block, blow up immediately.
+ if (scb.block_type == SYM_BTYPE_ERROR)
+ {
+ return ERROR_CALC_DEFAULT;
+ }
+
+ assert(scb.block_mode >= 0);
+ assert(bsd.get_partition_info(scb.partition_count, scb.partition_index).partition_count == 1);
+
+ // Get the appropriate block descriptor
+ const block_mode& bm = bsd.get_block_mode(scb.block_mode);
+ const decimation_info& di = bsd.get_decimation_info(bm.decimation_mode);
+
+ // Unquantize and undecimate the weights
+ alignas(ASTCENC_VECALIGN) int plane1_weights[BLOCK_MAX_TEXELS];
+ unpack_weights(bsd, scb, di, false, plane1_weights, nullptr);
+
+ // Decode the color endpoints for this partition
+ vint4 ep0;
+ vint4 ep1;
+ bool rgb_lns;
+ bool a_lns;
+
+ unpack_color_endpoints(config.profile,
+ scb.color_formats[0],
+ scb.color_values[0],
+ rgb_lns, a_lns,
+ ep0, ep1);
+
+
+ // Pre-shift sRGB so things round correctly
+ if (config.profile == ASTCENC_PRF_LDR_SRGB)
+ {
+ ep0 = asr<8>(ep0);
+ ep1 = asr<8>(ep1);
+ }
+
+ // Unpack and compute error for each texel in the partition
+ vfloatacc summav = vfloatacc::zero();
+
+ vint lane_id = vint::lane_id();
+ vint srgb_scale(config.profile == ASTCENC_PRF_LDR_SRGB ? 257 : 1);
+
+ unsigned int texel_count = bsd.texel_count;
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ // Compute EP1 contribution
+ vint weight1 = vint::loada(plane1_weights + i);
+ vint ep1_r = vint(ep1.lane<0>()) * weight1;
+ vint ep1_g = vint(ep1.lane<1>()) * weight1;
+ vint ep1_b = vint(ep1.lane<2>()) * weight1;
+ vint ep1_a = vint(ep1.lane<3>()) * weight1;
+
+ // Compute EP0 contribution
+ vint weight0 = vint(64) - weight1;
+ vint ep0_r = vint(ep0.lane<0>()) * weight0;
+ vint ep0_g = vint(ep0.lane<1>()) * weight0;
+ vint ep0_b = vint(ep0.lane<2>()) * weight0;
+ vint ep0_a = vint(ep0.lane<3>()) * weight0;
+
+ // Shift so things round correctly
+ vint colori_r = asr<6>(ep0_r + ep1_r + vint(32)) * srgb_scale;
+ vint colori_g = asr<6>(ep0_g + ep1_g + vint(32)) * srgb_scale;
+ vint colori_b = asr<6>(ep0_b + ep1_b + vint(32)) * srgb_scale;
+ vint colori_a = asr<6>(ep0_a + ep1_a + vint(32)) * srgb_scale;
+
+ // Compute color diff
+ vfloat color_r = int_to_float(colori_r);
+ vfloat color_g = int_to_float(colori_g);
+ vfloat color_b = int_to_float(colori_b);
+ vfloat color_a = int_to_float(colori_a);
+
+ vfloat color_orig_r = loada(blk.data_r + i);
+ vfloat color_orig_g = loada(blk.data_g + i);
+ vfloat color_orig_b = loada(blk.data_b + i);
+ vfloat color_orig_a = loada(blk.data_a + i);
+
+ vfloat color_error_r = min(abs(color_orig_r - color_r), vfloat(1e15f));
+ vfloat color_error_g = min(abs(color_orig_g - color_g), vfloat(1e15f));
+ vfloat color_error_b = min(abs(color_orig_b - color_b), vfloat(1e15f));
+ vfloat color_error_a = min(abs(color_orig_a - color_a), vfloat(1e15f));
+
+ // Compute squared error metric
+ color_error_r = color_error_r * color_error_r;
+ color_error_g = color_error_g * color_error_g;
+ color_error_b = color_error_b * color_error_b;
+ color_error_a = color_error_a * color_error_a;
+
+ vfloat metric = color_error_r * blk.channel_weight.lane<0>()
+ + color_error_g * blk.channel_weight.lane<1>()
+ + color_error_b * blk.channel_weight.lane<2>()
+ + color_error_a * blk.channel_weight.lane<3>();
+
+ // Mask off bad lanes
+ vmask mask = lane_id < vint(texel_count);
+ lane_id += vint(ASTCENC_SIMD_WIDTH);
+ haccumulate(summav, metric, mask);
+ }
+
+ return hadd_s(summav);
+}
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_diagnostic_trace.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_diagnostic_trace.cpp
new file mode 100644
index 00000000000..7fa7ab1a8b1
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_diagnostic_trace.cpp
@@ -0,0 +1,230 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2021-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Functions for the library entrypoint.
+ */
+
+#if defined(ASTCENC_DIAGNOSTICS)
+
+#include <cassert>
+#include <cstdarg>
+#include <cstdio>
+#include <string>
+
+#include "astcenc_diagnostic_trace.h"
+
+/** @brief The global trace logger. */
+static TraceLog* g_TraceLog = nullptr;
+
+/** @brief The JSON indentation level. */
+static const size_t g_trace_indent = 2;
+
+TraceLog::TraceLog(
+ const char* file_name):
+ m_file(file_name, std::ofstream::out | std::ofstream::binary)
+{
+ assert(!g_TraceLog);
+ g_TraceLog = this;
+ m_root = new TraceNode("root");
+}
+
+/* See header for documentation. */
+TraceNode* TraceLog::get_current_leaf()
+{
+ if (m_stack.size())
+ {
+ return m_stack.back();
+ }
+
+ return nullptr;
+}
+
+/* See header for documentation. */
+size_t TraceLog::get_depth()
+{
+ return m_stack.size();
+}
+
+/* See header for documentation. */
+TraceLog::~TraceLog()
+{
+ assert(g_TraceLog == this);
+ delete m_root;
+ g_TraceLog = nullptr;
+}
+
+/* See header for documentation. */
+TraceNode::TraceNode(
+ const char* format,
+ ...
+) {
+ // Format the name string
+ constexpr size_t bufsz = 256;
+ char buffer[bufsz];
+
+ va_list args;
+ va_start (args, format);
+ vsnprintf (buffer, bufsz, format, args);
+ va_end (args);
+
+ // Guarantee there is a nul terminator
+ buffer[bufsz - 1] = 0;
+
+ // Generate the node
+ TraceNode* parent = g_TraceLog->get_current_leaf();
+ size_t depth = g_TraceLog->get_depth();
+ g_TraceLog->m_stack.push_back(this);
+
+ bool comma = parent && parent->m_attrib_count;
+ auto& out = g_TraceLog->m_file;
+
+ if (parent)
+ {
+ parent->m_attrib_count++;
+ }
+
+ if (comma)
+ {
+ out << ',';
+ }
+
+ if (depth)
+ {
+ out << '\n';
+ }
+
+ size_t out_indent = (depth * 2) * g_trace_indent;
+ size_t in_indent = (depth * 2 + 1) * g_trace_indent;
+
+ std::string out_indents("");
+ if (out_indent)
+ {
+ out_indents = std::string(out_indent, ' ');
+ }
+
+ std::string in_indents(in_indent, ' ');
+
+ out << out_indents << "[ \"node\", \"" << buffer << "\",\n";
+ out << in_indents << "[";
+}
+
+/* See header for documentation. */
+void TraceNode::add_attrib(
+ std::string type,
+ std::string key,
+ std::string value
+) {
+ (void)type;
+
+ size_t depth = g_TraceLog->get_depth();
+ size_t indent = (depth * 2) * g_trace_indent;
+ auto& out = g_TraceLog->m_file;
+ bool comma = m_attrib_count;
+ m_attrib_count++;
+
+ if (comma)
+ {
+ out << ',';
+ }
+
+ out << '\n';
+ out << std::string(indent, ' ') << "[ "
+ << "\"" << key << "\", "
+ << value << " ]";
+}
+
+/* See header for documentation. */
+TraceNode::~TraceNode()
+{
+ g_TraceLog->m_stack.pop_back();
+
+ auto& out = g_TraceLog->m_file;
+ size_t depth = g_TraceLog->get_depth();
+ size_t out_indent = (depth * 2) * g_trace_indent;
+ size_t in_indent = (depth * 2 + 1) * g_trace_indent;
+
+ std::string out_indents("");
+ if (out_indent)
+ {
+ out_indents = std::string(out_indent, ' ');
+ }
+
+ std::string in_indents(in_indent, ' ');
+
+ if (m_attrib_count)
+ {
+ out << "\n" << in_indents;
+ }
+ out << "]\n";
+
+ out << out_indents << "]";
+}
+
+/* See header for documentation. */
+void trace_add_data(
+ const char* key,
+ const char* format,
+ ...
+) {
+ constexpr size_t bufsz = 256;
+ char buffer[bufsz];
+
+ va_list args;
+ va_start (args, format);
+ vsnprintf (buffer, bufsz, format, args);
+ va_end (args);
+
+ // Guarantee there is a nul terminator
+ buffer[bufsz - 1] = 0;
+
+ std::string value = "\"" + std::string(buffer) + "\"";
+
+ TraceNode* node = g_TraceLog->get_current_leaf();
+ node->add_attrib("str", key, value);
+}
+
+/* See header for documentation. */
+void trace_add_data(
+ const char* key,
+ float value
+) {
+ char buffer[256];
+ sprintf(buffer, "%.20g", (double)value);
+ TraceNode* node = g_TraceLog->get_current_leaf();
+ node->add_attrib("float", key, buffer);
+}
+
+/* See header for documentation. */
+void trace_add_data(
+ const char* key,
+ int value
+) {
+ TraceNode* node = g_TraceLog->get_current_leaf();
+ node->add_attrib("int", key, std::to_string(value));
+}
+
+/* See header for documentation. */
+void trace_add_data(
+ const char* key,
+ unsigned int value
+) {
+ TraceNode* node = g_TraceLog->get_current_leaf();
+ node->add_attrib("int", key, std::to_string(value));
+}
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_diagnostic_trace.h b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_diagnostic_trace.h
new file mode 100644
index 00000000000..f5586b0ad59
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_diagnostic_trace.h
@@ -0,0 +1,219 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2021-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief This module provides a set of diagnostic tracing utilities.
+ *
+ * Overview
+ * ========
+ *
+ * The built-in diagnostic trace tool generates a hierarchical JSON tree structure. The tree
+ * hierarchy contains three levels:
+ *
+ * - block
+ * - pass
+ * - candidate
+ *
+ * One block node exists for each compressed block in the image. One pass node exists for each major
+ * pass (N partition, M planes, O components) applied to a block. One candidate node exists for each
+ * encoding candidate trialed for a pass.
+ *
+ * Each node contains both the hierarchy but also a number of attributes which explain the behavior.
+ * For example, the block node contains the block coordinates in the image, the pass explains the
+ * pass configuration, and the candidate will explain the candidate encoding such as weight
+ * decimation, refinement error, etc.
+ *
+ * Trace Nodes are designed as scope-managed C++ objects with stack-like push/pop behavior.
+ * Constructing a trace node on the stack will automatically add it to the current node as a child,
+ * and then make it the current node. Destroying the current node will pop the stack and set the
+ * parent to the current node. This provides a robust mechanism for ensuring reliable nesting in the
+ * tree structure.
+ *
+ * A set of utility macros are provided to add attribute annotations to the current trace node.
+ *
+ * Usage
+ * =====
+ *
+ * Create Trace Nodes on the stack using the @c TRACE_NODE() macro. This will compile-out completely
+ * in builds with diagnostics disabled.
+ *
+ * Add annotations to the current trace node using the @c trace_add_data() macro. This will
+ * similarly compile out completely in builds with diagnostics disabled.
+ *
+ * If you need to add additional code to support diagnostics-only behavior wrap
+ * it in preprocessor guards:
+ *
+ * #if defined(ASTCENC_DIAGNOSTICS)
+ * #endif
+ */
+
+#ifndef ASTCENC_DIAGNOSTIC_TRACE_INCLUDED
+#define ASTCENC_DIAGNOSTIC_TRACE_INCLUDED
+
+#if defined(ASTCENC_DIAGNOSTICS)
+
+#include <iostream>
+#include <fstream>
+#include <vector>
+
+/**
+ * @brief Class representing a single node in the trace hierarchy.
+ */
+class TraceNode
+{
+public:
+ /**
+ * @brief Construct a new node.
+ *
+ * Constructing a node will push to the the top of the stack, automatically making it a child of
+ * the current node, and then setting it to become the current node.
+ *
+ * @param format The format template for the node name.
+ * @param ... The format parameters.
+ */
+ TraceNode(const char* format, ...);
+
+ /**
+ * @brief Add an attribute to this node.
+ *
+ * Note that no quoting is applied to the @c value, so if quoting is needed it must be done by
+ * the caller.
+ *
+ * @param type The type of the attribute.
+ * @param key The key of the attribute.
+ * @param value The value of the attribute.
+ */
+ void add_attrib(std::string type, std::string key, std::string value);
+
+ /**
+ * @brief Destroy this node.
+ *
+ * Destroying a node will pop it from the top of the stack, making its parent the current node.
+ * It is invalid behavior to destroy a node that is not the current node; usage must conform to
+ * stack push-pop semantics.
+ */
+ ~TraceNode();
+
+ /**
+ * @brief The number of attributes and child nodes in this node.
+ */
+ unsigned int m_attrib_count { 0 };
+};
+
+/**
+ * @brief Class representing the trace log file being written.
+ */
+class TraceLog
+{
+public:
+ /**
+ * @brief Create a new trace log.
+ *
+ * The trace log is global; there can be only one at a time.
+ *
+ * @param file_name The name of the file to write.
+ */
+ TraceLog(const char* file_name);
+
+ /**
+ * @brief Detroy the trace log.
+ *
+ * Trace logs MUST be cleanly destroyed to ensure the file gets written.
+ */
+ ~TraceLog();
+
+ /**
+ * @brief Get the current child node.
+ *
+ * @return The current leaf node.
+ */
+ TraceNode* get_current_leaf();
+
+ /**
+ * @brief Get the stack depth of the current child node.
+ *
+ * @return The current leaf node stack depth.
+ */
+ size_t get_depth();
+
+ /**
+ * @brief The file stream to write to.
+ */
+ std::ofstream m_file;
+
+ /**
+ * @brief The stack of nodes (newest at the back).
+ */
+ std::vector<TraceNode*> m_stack;
+
+private:
+ /**
+ * @brief The root node in the JSON file.
+ */
+ TraceNode* m_root;
+};
+
+/**
+ * @brief Utility macro to create a trace node on the stack.
+ *
+ * @param name The variable name to use.
+ * @param ... The name template and format parameters.
+ */
+#define TRACE_NODE(name, ...) TraceNode name(__VA_ARGS__);
+
+/**
+ * @brief Add a string annotation to the current node.
+ *
+ * @param key The name of the attribute.
+ * @param format The format template for the attribute value.
+ * @param ... The format parameters.
+ */
+void trace_add_data(const char* key, const char* format, ...);
+
+/**
+ * @brief Add a float annotation to the current node.
+ *
+ * @param key The name of the attribute.
+ * @param value The value of the attribute.
+ */
+void trace_add_data(const char* key, float value);
+
+/**
+ * @brief Add an integer annotation to the current node.
+ *
+ * @param key The name of the attribute.
+ * @param value The value of the attribute.
+ */
+void trace_add_data(const char* key, int value);
+
+/**
+ * @brief Add an unsigned integer annotation to the current node.
+ *
+ * @param key The name of the attribute.
+ * @param value The value of the attribute.
+ */
+void trace_add_data(const char* key, unsigned int value);
+
+#else
+
+#define TRACE_NODE(name, ...)
+
+#define trace_add_data(...)
+
+#endif
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_entry.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_entry.cpp
new file mode 100644
index 00000000000..95125b3998e
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_entry.cpp
@@ -0,0 +1,1442 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Functions for the library entrypoint.
+ */
+
+#include <array>
+#include <cstring>
+#include <new>
+
+#include "astcenc.h"
+#include "astcenc_internal_entry.h"
+#include "astcenc_diagnostic_trace.h"
+
+/**
+ * @brief Record of the quality tuning parameter values.
+ *
+ * See the @c astcenc_config structure for detailed parameter documentation.
+ *
+ * Note that the mse_overshoot entries are scaling factors relative to the base MSE to hit db_limit.
+ * A 20% overshoot is harder to hit for a higher base db_limit, so we may actually use lower ratios
+ * for the more through search presets because the underlying db_limit is so much higher.
+ */
+struct astcenc_preset_config
+{
+ float quality;
+ unsigned int tune_partition_count_limit;
+ unsigned int tune_2partition_index_limit;
+ unsigned int tune_3partition_index_limit;
+ unsigned int tune_4partition_index_limit;
+ unsigned int tune_block_mode_limit;
+ unsigned int tune_refinement_limit;
+ unsigned int tune_candidate_limit;
+ unsigned int tune_2partitioning_candidate_limit;
+ unsigned int tune_3partitioning_candidate_limit;
+ unsigned int tune_4partitioning_candidate_limit;
+ float tune_db_limit_a_base;
+ float tune_db_limit_b_base;
+ float tune_mode0_mse_overshoot;
+ float tune_refinement_mse_overshoot;
+ float tune_2_partition_early_out_limit_factor;
+ float tune_3_partition_early_out_limit_factor;
+ float tune_2_plane_early_out_limit_correlation;
+};
+
+
+/**
+ * @brief The static quality presets that are built-in for high bandwidth
+ * presets (x < 25 texels per block).
+ */
+static const std::array<astcenc_preset_config, 6> preset_configs_high {{
+ {
+ ASTCENC_PRE_FASTEST,
+ 2, 10, 6, 4, 43, 2, 2, 2, 2, 2, 85.2f, 63.2f, 3.5f, 3.5f, 1.0f, 1.0f, 0.85f
+ }, {
+ ASTCENC_PRE_FAST,
+ 3, 18, 10, 8, 55, 3, 3, 2, 2, 2, 85.2f, 63.2f, 3.5f, 3.5f, 1.0f, 1.0f, 0.90f
+ }, {
+ ASTCENC_PRE_MEDIUM,
+ 4, 34, 28, 16, 77, 3, 3, 2, 2, 2, 95.0f, 70.0f, 2.5f, 2.5f, 1.1f, 1.05f, 0.95f
+ }, {
+ ASTCENC_PRE_THOROUGH,
+ 4, 82, 60, 30, 94, 4, 4, 3, 2, 2, 105.0f, 77.0f, 10.0f, 10.0f, 1.35f, 1.15f, 0.97f
+ }, {
+ ASTCENC_PRE_VERYTHOROUGH,
+ 4, 256, 128, 64, 98, 4, 6, 20, 14, 8, 200.0f, 200.0f, 10.0f, 10.0f, 1.6f, 1.4f, 0.98f
+ }, {
+ ASTCENC_PRE_EXHAUSTIVE,
+ 4, 512, 512, 512, 100, 4, 8, 32, 32, 32, 200.0f, 200.0f, 10.0f, 10.0f, 2.0f, 2.0f, 0.99f
+ }
+}};
+
+/**
+ * @brief The static quality presets that are built-in for medium bandwidth
+ * presets (25 <= x < 64 texels per block).
+ */
+static const std::array<astcenc_preset_config, 6> preset_configs_mid {{
+ {
+ ASTCENC_PRE_FASTEST,
+ 2, 10, 6, 4, 43, 2, 2, 2, 2, 2, 85.2f, 63.2f, 3.5f, 3.5f, 1.0f, 1.0f, 0.80f
+ }, {
+ ASTCENC_PRE_FAST,
+ 3, 18, 12, 10, 55, 3, 3, 2, 2, 2, 85.2f, 63.2f, 3.5f, 3.5f, 1.0f, 1.0f, 0.85f
+ }, {
+ ASTCENC_PRE_MEDIUM,
+ 4, 34, 28, 16, 77, 3, 3, 2, 2, 2, 95.0f, 70.0f, 3.0f, 3.0f, 1.1f, 1.05f, 0.90f
+ }, {
+ ASTCENC_PRE_THOROUGH,
+ 4, 82, 60, 30, 94, 4, 4, 3, 2, 2, 105.0f, 77.0f, 10.0f, 10.0f, 1.4f, 1.2f, 0.95f
+ }, {
+ ASTCENC_PRE_VERYTHOROUGH,
+ 4, 256, 128, 64, 98, 4, 6, 12, 8, 3, 200.0f, 200.0f, 10.0f, 10.0f, 1.6f, 1.4f, 0.98f
+ }, {
+ ASTCENC_PRE_EXHAUSTIVE,
+ 4, 256, 256, 256, 100, 4, 8, 32, 32, 32, 200.0f, 200.0f, 10.0f, 10.0f, 2.0f, 2.0f, 0.99f
+ }
+}};
+
+/**
+ * @brief The static quality presets that are built-in for low bandwidth
+ * presets (64 <= x texels per block).
+ */
+static const std::array<astcenc_preset_config, 6> preset_configs_low {{
+ {
+ ASTCENC_PRE_FASTEST,
+ 2, 10, 6, 4, 40, 2, 2, 2, 2, 2, 85.0f, 63.0f, 3.5f, 3.5f, 1.0f, 1.0f, 0.80f
+ }, {
+ ASTCENC_PRE_FAST,
+ 2, 18, 12, 10, 55, 3, 3, 2, 2, 2, 85.0f, 63.0f, 3.5f, 3.5f, 1.0f, 1.0f, 0.85f
+ }, {
+ ASTCENC_PRE_MEDIUM,
+ 3, 34, 28, 16, 77, 3, 3, 2, 2, 2, 95.0f, 70.0f, 3.5f, 3.5f, 1.1f, 1.05f, 0.90f
+ }, {
+ ASTCENC_PRE_THOROUGH,
+ 4, 82, 60, 30, 93, 4, 4, 3, 2, 2, 105.0f, 77.0f, 10.0f, 10.0f, 1.3f, 1.2f, 0.97f
+ }, {
+ ASTCENC_PRE_VERYTHOROUGH,
+ 4, 256, 128, 64, 98, 4, 6, 9, 5, 2, 200.0f, 200.0f, 10.0f, 10.0f, 1.6f, 1.4f, 0.98f
+ }, {
+ ASTCENC_PRE_EXHAUSTIVE,
+ 4, 256, 256, 256, 100, 4, 8, 32, 32, 32, 200.0f, 200.0f, 10.0f, 10.0f, 2.0f, 2.0f, 0.99f
+ }
+}};
+
+/**
+ * @brief Validate CPU floating point meets assumptions made in the codec.
+ *
+ * The codec is written with the assumption that a float threaded through the @c if32 union will be
+ * stored and reloaded as a 32-bit IEEE-754 float with round-to-nearest rounding. This is always the
+ * case in an IEEE-754 compliant system, however not every system or compilation mode is actually
+ * IEEE-754 compliant. This normally fails if the code is compiled with fast math enabled.
+ *
+ * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure.
+ */
+static astcenc_error validate_cpu_float()
+{
+ if32 p;
+ volatile float xprec_testval = 2.51f;
+ p.f = xprec_testval + 12582912.0f;
+ float q = p.f - 12582912.0f;
+
+ if (q != 3.0f)
+ {
+ return ASTCENC_ERR_BAD_CPU_FLOAT;
+ }
+
+ return ASTCENC_SUCCESS;
+}
+
+/**
+ * @brief Validate CPU ISA support meets the requirements of this build of the library.
+ *
+ * Each library build is statically compiled for a particular set of CPU ISA features, such as the
+ * SIMD support or other ISA extensions such as POPCNT. This function checks that the host CPU
+ * actually supports everything this build needs.
+ *
+ * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure.
+ */
+static astcenc_error validate_cpu_isa()
+{
+ #if ASTCENC_SSE >= 41
+ if (!cpu_supports_sse41())
+ {
+ return ASTCENC_ERR_BAD_CPU_ISA;
+ }
+ #endif
+
+ #if ASTCENC_POPCNT >= 1
+ if (!cpu_supports_popcnt())
+ {
+ return ASTCENC_ERR_BAD_CPU_ISA;
+ }
+ #endif
+
+ #if ASTCENC_F16C >= 1
+ if (!cpu_supports_f16c())
+ {
+ return ASTCENC_ERR_BAD_CPU_ISA;
+ }
+ #endif
+
+ #if ASTCENC_AVX >= 2
+ if (!cpu_supports_avx2())
+ {
+ return ASTCENC_ERR_BAD_CPU_ISA;
+ }
+ #endif
+
+ return ASTCENC_SUCCESS;
+}
+
+/**
+ * @brief Validate config profile.
+ *
+ * @param profile The profile to check.
+ *
+ * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure.
+ */
+static astcenc_error validate_profile(
+ astcenc_profile profile
+) {
+ // Values in this enum are from an external user, so not guaranteed to be
+ // bounded to the enum values
+ switch (static_cast<int>(profile))
+ {
+ case ASTCENC_PRF_LDR_SRGB:
+ case ASTCENC_PRF_LDR:
+ case ASTCENC_PRF_HDR_RGB_LDR_A:
+ case ASTCENC_PRF_HDR:
+ return ASTCENC_SUCCESS;
+ default:
+ return ASTCENC_ERR_BAD_PROFILE;
+ }
+}
+
+/**
+ * @brief Validate block size.
+ *
+ * @param block_x The block x dimensions.
+ * @param block_y The block y dimensions.
+ * @param block_z The block z dimensions.
+ *
+ * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure.
+ */
+static astcenc_error validate_block_size(
+ unsigned int block_x,
+ unsigned int block_y,
+ unsigned int block_z
+) {
+ // Test if this is a legal block size at all
+ bool is_legal = (((block_z <= 1) && is_legal_2d_block_size(block_x, block_y)) ||
+ ((block_z >= 2) && is_legal_3d_block_size(block_x, block_y, block_z)));
+ if (!is_legal)
+ {
+ return ASTCENC_ERR_BAD_BLOCK_SIZE;
+ }
+
+ // Test if this build has sufficient capacity for this block size
+ bool have_capacity = (block_x * block_y * block_z) <= BLOCK_MAX_TEXELS;
+ if (!have_capacity)
+ {
+ return ASTCENC_ERR_NOT_IMPLEMENTED;
+ }
+
+ return ASTCENC_SUCCESS;
+}
+
+/**
+ * @brief Validate flags.
+ *
+ * @param flags The flags to check.
+ *
+ * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure.
+ */
+static astcenc_error validate_flags(
+ unsigned int flags
+) {
+ // Flags field must not contain any unknown flag bits
+ unsigned int exMask = ~ASTCENC_ALL_FLAGS;
+ if (popcount(flags & exMask) != 0)
+ {
+ return ASTCENC_ERR_BAD_FLAGS;
+ }
+
+ // Flags field must only contain at most a single map type
+ exMask = ASTCENC_FLG_MAP_MASK
+ | ASTCENC_FLG_MAP_NORMAL
+ | ASTCENC_FLG_MAP_RGBM;
+ if (popcount(flags & exMask) > 1)
+ {
+ return ASTCENC_ERR_BAD_FLAGS;
+ }
+
+ return ASTCENC_SUCCESS;
+}
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+
+/**
+ * @brief Validate single channel compression swizzle.
+ *
+ * @param swizzle The swizzle to check.
+ *
+ * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure.
+ */
+static astcenc_error validate_compression_swz(
+ astcenc_swz swizzle
+) {
+ // Not all enum values are handled; SWZ_Z is invalid for compression
+ switch (static_cast<int>(swizzle))
+ {
+ case ASTCENC_SWZ_R:
+ case ASTCENC_SWZ_G:
+ case ASTCENC_SWZ_B:
+ case ASTCENC_SWZ_A:
+ case ASTCENC_SWZ_0:
+ case ASTCENC_SWZ_1:
+ return ASTCENC_SUCCESS;
+ default:
+ return ASTCENC_ERR_BAD_SWIZZLE;
+ }
+}
+
+/**
+ * @brief Validate overall compression swizzle.
+ *
+ * @param swizzle The swizzle to check.
+ *
+ * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure.
+ */
+static astcenc_error validate_compression_swizzle(
+ const astcenc_swizzle& swizzle
+) {
+ if (validate_compression_swz(swizzle.r) ||
+ validate_compression_swz(swizzle.g) ||
+ validate_compression_swz(swizzle.b) ||
+ validate_compression_swz(swizzle.a))
+ {
+ return ASTCENC_ERR_BAD_SWIZZLE;
+ }
+
+ return ASTCENC_SUCCESS;
+}
+#endif
+
+/**
+ * @brief Validate single channel decompression swizzle.
+ *
+ * @param swizzle The swizzle to check.
+ *
+ * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure.
+ */
+static astcenc_error validate_decompression_swz(
+ astcenc_swz swizzle
+) {
+ // Values in this enum are from an external user, so not guaranteed to be
+ // bounded to the enum values
+ switch (static_cast<int>(swizzle))
+ {
+ case ASTCENC_SWZ_R:
+ case ASTCENC_SWZ_G:
+ case ASTCENC_SWZ_B:
+ case ASTCENC_SWZ_A:
+ case ASTCENC_SWZ_0:
+ case ASTCENC_SWZ_1:
+ case ASTCENC_SWZ_Z:
+ return ASTCENC_SUCCESS;
+ default:
+ return ASTCENC_ERR_BAD_SWIZZLE;
+ }
+}
+
+/**
+ * @brief Validate overall decompression swizzle.
+ *
+ * @param swizzle The swizzle to check.
+ *
+ * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure.
+ */
+static astcenc_error validate_decompression_swizzle(
+ const astcenc_swizzle& swizzle
+) {
+ if (validate_decompression_swz(swizzle.r) ||
+ validate_decompression_swz(swizzle.g) ||
+ validate_decompression_swz(swizzle.b) ||
+ validate_decompression_swz(swizzle.a))
+ {
+ return ASTCENC_ERR_BAD_SWIZZLE;
+ }
+
+ return ASTCENC_SUCCESS;
+}
+
+/**
+ * Validate that an incoming configuration is in-spec.
+ *
+ * This function can respond in two ways:
+ *
+ * * Numerical inputs that have valid ranges are clamped to those valid ranges. No error is thrown
+ * for out-of-range inputs in this case.
+ * * Numerical inputs and logic inputs are are logically invalid and which make no sense
+ * algorithmically will return an error.
+ *
+ * @param[in,out] config The input compressor configuration.
+ *
+ * @return Return @c ASTCENC_SUCCESS if validated, otherwise an error on failure.
+ */
+static astcenc_error validate_config(
+ astcenc_config &config
+) {
+ astcenc_error status;
+
+ status = validate_profile(config.profile);
+ if (status != ASTCENC_SUCCESS)
+ {
+ return status;
+ }
+
+ status = validate_flags(config.flags);
+ if (status != ASTCENC_SUCCESS)
+ {
+ return status;
+ }
+
+ status = validate_block_size(config.block_x, config.block_y, config.block_z);
+ if (status != ASTCENC_SUCCESS)
+ {
+ return status;
+ }
+
+#if defined(ASTCENC_DECOMPRESS_ONLY)
+ // Decompress-only builds only support decompress-only contexts
+ if (!(config.flags & ASTCENC_FLG_DECOMPRESS_ONLY))
+ {
+ return ASTCENC_ERR_BAD_PARAM;
+ }
+#endif
+
+ config.rgbm_m_scale = astc::max(config.rgbm_m_scale, 1.0f);
+
+ config.tune_partition_count_limit = astc::clamp(config.tune_partition_count_limit, 1u, 4u);
+ config.tune_2partition_index_limit = astc::clamp(config.tune_2partition_index_limit, 1u, BLOCK_MAX_PARTITIONINGS);
+ config.tune_3partition_index_limit = astc::clamp(config.tune_3partition_index_limit, 1u, BLOCK_MAX_PARTITIONINGS);
+ config.tune_4partition_index_limit = astc::clamp(config.tune_4partition_index_limit, 1u, BLOCK_MAX_PARTITIONINGS);
+ config.tune_block_mode_limit = astc::clamp(config.tune_block_mode_limit, 1u, 100u);
+ config.tune_refinement_limit = astc::max(config.tune_refinement_limit, 1u);
+ config.tune_candidate_limit = astc::clamp(config.tune_candidate_limit, 1u, TUNE_MAX_TRIAL_CANDIDATES);
+ config.tune_2partitioning_candidate_limit = astc::clamp(config.tune_2partitioning_candidate_limit, 1u, TUNE_MAX_PARTITIIONING_CANDIDATES);
+ config.tune_3partitioning_candidate_limit = astc::clamp(config.tune_3partitioning_candidate_limit, 1u, TUNE_MAX_PARTITIIONING_CANDIDATES);
+ config.tune_4partitioning_candidate_limit = astc::clamp(config.tune_4partitioning_candidate_limit, 1u, TUNE_MAX_PARTITIIONING_CANDIDATES);
+ config.tune_db_limit = astc::max(config.tune_db_limit, 0.0f);
+ config.tune_mode0_mse_overshoot = astc::max(config.tune_mode0_mse_overshoot, 1.0f);
+ config.tune_refinement_mse_overshoot = astc::max(config.tune_refinement_mse_overshoot, 1.0f);
+ config.tune_2_partition_early_out_limit_factor = astc::max(config.tune_2_partition_early_out_limit_factor, 0.0f);
+ config.tune_3_partition_early_out_limit_factor = astc::max(config.tune_3_partition_early_out_limit_factor, 0.0f);
+ config.tune_2_plane_early_out_limit_correlation = astc::max(config.tune_2_plane_early_out_limit_correlation, 0.0f);
+
+ // Specifying a zero weight color component is not allowed; force to small value
+ float max_weight = astc::max(astc::max(config.cw_r_weight, config.cw_g_weight),
+ astc::max(config.cw_b_weight, config.cw_a_weight));
+ if (max_weight > 0.0f)
+ {
+ max_weight /= 1000.0f;
+ config.cw_r_weight = astc::max(config.cw_r_weight, max_weight);
+ config.cw_g_weight = astc::max(config.cw_g_weight, max_weight);
+ config.cw_b_weight = astc::max(config.cw_b_weight, max_weight);
+ config.cw_a_weight = astc::max(config.cw_a_weight, max_weight);
+ }
+ // If all color components error weights are zero then return an error
+ else
+ {
+ return ASTCENC_ERR_BAD_PARAM;
+ }
+
+ return ASTCENC_SUCCESS;
+}
+
+/* See header for documentation. */
+astcenc_error astcenc_config_init(
+ astcenc_profile profile,
+ unsigned int block_x,
+ unsigned int block_y,
+ unsigned int block_z,
+ float quality,
+ unsigned int flags,
+ astcenc_config* configp
+) {
+ astcenc_error status;
+
+ // Check basic library compatibility options here so they are checked early. Note, these checks
+ // are repeated in context_alloc for cases where callers use a manually defined config struct
+ status = validate_cpu_isa();
+ if (status != ASTCENC_SUCCESS)
+ {
+ return status;
+ }
+
+ status = validate_cpu_float();
+ if (status != ASTCENC_SUCCESS)
+ {
+ return status;
+ }
+
+ // Zero init all config fields; although most of will be over written
+ astcenc_config& config = *configp;
+ std::memset(&config, 0, sizeof(config));
+
+ // Process the block size
+ block_z = astc::max(block_z, 1u); // For 2D blocks Z==0 is accepted, but convert to 1
+ status = validate_block_size(block_x, block_y, block_z);
+ if (status != ASTCENC_SUCCESS)
+ {
+ return status;
+ }
+
+ config.block_x = block_x;
+ config.block_y = block_y;
+ config.block_z = block_z;
+
+ float texels = static_cast<float>(block_x * block_y * block_z);
+ float ltexels = logf(texels) / logf(10.0f);
+
+ // Process the performance quality level or preset; note that this must be done before we
+ // process any additional settings, such as color profile and flags, which may replace some of
+ // these settings with more use case tuned values
+ if (quality < ASTCENC_PRE_FASTEST ||
+ quality > ASTCENC_PRE_EXHAUSTIVE)
+ {
+ return ASTCENC_ERR_BAD_QUALITY;
+ }
+
+ static const std::array<astcenc_preset_config, 6>* preset_configs;
+ int texels_int = block_x * block_y * block_z;
+ if (texels_int < 25)
+ {
+ preset_configs = &preset_configs_high;
+ }
+ else if (texels_int < 64)
+ {
+ preset_configs = &preset_configs_mid;
+ }
+ else
+ {
+ preset_configs = &preset_configs_low;
+ }
+
+ // Determine which preset to use, or which pair to interpolate
+ size_t start;
+ size_t end;
+ for (end = 0; end < preset_configs->size(); end++)
+ {
+ if ((*preset_configs)[end].quality >= quality)
+ {
+ break;
+ }
+ }
+
+ start = end == 0 ? 0 : end - 1;
+
+ // Start and end node are the same - so just transfer the values.
+ if (start == end)
+ {
+ config.tune_partition_count_limit = (*preset_configs)[start].tune_partition_count_limit;
+ config.tune_2partition_index_limit = (*preset_configs)[start].tune_2partition_index_limit;
+ config.tune_3partition_index_limit = (*preset_configs)[start].tune_3partition_index_limit;
+ config.tune_4partition_index_limit = (*preset_configs)[start].tune_4partition_index_limit;
+ config.tune_block_mode_limit = (*preset_configs)[start].tune_block_mode_limit;
+ config.tune_refinement_limit = (*preset_configs)[start].tune_refinement_limit;
+ config.tune_candidate_limit = astc::min((*preset_configs)[start].tune_candidate_limit, TUNE_MAX_TRIAL_CANDIDATES);
+ config.tune_2partitioning_candidate_limit = astc::min((*preset_configs)[start].tune_2partitioning_candidate_limit, TUNE_MAX_PARTITIIONING_CANDIDATES);
+ config.tune_3partitioning_candidate_limit = astc::min((*preset_configs)[start].tune_3partitioning_candidate_limit, TUNE_MAX_PARTITIIONING_CANDIDATES);
+ config.tune_4partitioning_candidate_limit = astc::min((*preset_configs)[start].tune_4partitioning_candidate_limit, TUNE_MAX_PARTITIIONING_CANDIDATES);
+ config.tune_db_limit = astc::max((*preset_configs)[start].tune_db_limit_a_base - 35 * ltexels,
+ (*preset_configs)[start].tune_db_limit_b_base - 19 * ltexels);
+
+ config.tune_mode0_mse_overshoot = (*preset_configs)[start].tune_mode0_mse_overshoot;
+ config.tune_refinement_mse_overshoot = (*preset_configs)[start].tune_refinement_mse_overshoot;
+
+ config.tune_2_partition_early_out_limit_factor = (*preset_configs)[start].tune_2_partition_early_out_limit_factor;
+ config.tune_3_partition_early_out_limit_factor =(*preset_configs)[start].tune_3_partition_early_out_limit_factor;
+ config.tune_2_plane_early_out_limit_correlation = (*preset_configs)[start].tune_2_plane_early_out_limit_correlation;
+ }
+ // Start and end node are not the same - so interpolate between them
+ else
+ {
+ auto& node_a = (*preset_configs)[start];
+ auto& node_b = (*preset_configs)[end];
+
+ float wt_range = node_b.quality - node_a.quality;
+ assert(wt_range > 0);
+
+ // Compute interpolation factors
+ float wt_node_a = (node_b.quality - quality) / wt_range;
+ float wt_node_b = (quality - node_a.quality) / wt_range;
+
+ #define LERP(param) ((node_a.param * wt_node_a) + (node_b.param * wt_node_b))
+ #define LERPI(param) astc::flt2int_rtn(\
+ (static_cast<float>(node_a.param) * wt_node_a) + \
+ (static_cast<float>(node_b.param) * wt_node_b))
+ #define LERPUI(param) static_cast<unsigned int>(LERPI(param))
+
+ config.tune_partition_count_limit = LERPI(tune_partition_count_limit);
+ config.tune_2partition_index_limit = LERPI(tune_2partition_index_limit);
+ config.tune_3partition_index_limit = LERPI(tune_3partition_index_limit);
+ config.tune_4partition_index_limit = LERPI(tune_4partition_index_limit);
+ config.tune_block_mode_limit = LERPI(tune_block_mode_limit);
+ config.tune_refinement_limit = LERPI(tune_refinement_limit);
+ config.tune_candidate_limit = astc::min(LERPUI(tune_candidate_limit),
+ TUNE_MAX_TRIAL_CANDIDATES);
+ config.tune_2partitioning_candidate_limit = astc::min(LERPUI(tune_2partitioning_candidate_limit),
+ BLOCK_MAX_PARTITIONINGS);
+ config.tune_3partitioning_candidate_limit = astc::min(LERPUI(tune_3partitioning_candidate_limit),
+ BLOCK_MAX_PARTITIONINGS);
+ config.tune_4partitioning_candidate_limit = astc::min(LERPUI(tune_4partitioning_candidate_limit),
+ BLOCK_MAX_PARTITIONINGS);
+ config.tune_db_limit = astc::max(LERP(tune_db_limit_a_base) - 35 * ltexels,
+ LERP(tune_db_limit_b_base) - 19 * ltexels);
+
+ config.tune_mode0_mse_overshoot = LERP(tune_mode0_mse_overshoot);
+ config.tune_refinement_mse_overshoot = LERP(tune_refinement_mse_overshoot);
+
+ config.tune_2_partition_early_out_limit_factor = LERP(tune_2_partition_early_out_limit_factor);
+ config.tune_3_partition_early_out_limit_factor = LERP(tune_3_partition_early_out_limit_factor);
+ config.tune_2_plane_early_out_limit_correlation = LERP(tune_2_plane_early_out_limit_correlation);
+ #undef LERP
+ #undef LERPI
+ #undef LERPUI
+ }
+
+ // Set heuristics to the defaults for each color profile
+ config.cw_r_weight = 1.0f;
+ config.cw_g_weight = 1.0f;
+ config.cw_b_weight = 1.0f;
+ config.cw_a_weight = 1.0f;
+
+ config.a_scale_radius = 0;
+
+ config.rgbm_m_scale = 0.0f;
+
+ config.profile = profile;
+
+ // Values in this enum are from an external user, so not guaranteed to be
+ // bounded to the enum values
+ switch (static_cast<int>(profile))
+ {
+ case ASTCENC_PRF_LDR:
+ case ASTCENC_PRF_LDR_SRGB:
+ break;
+ case ASTCENC_PRF_HDR_RGB_LDR_A:
+ case ASTCENC_PRF_HDR:
+ config.tune_db_limit = 999.0f;
+ break;
+ default:
+ return ASTCENC_ERR_BAD_PROFILE;
+ }
+
+ // Flags field must not contain any unknown flag bits
+ status = validate_flags(flags);
+ if (status != ASTCENC_SUCCESS)
+ {
+ return status;
+ }
+
+ if (flags & ASTCENC_FLG_MAP_NORMAL)
+ {
+ // Normal map encoding uses L+A blocks, so allow one more partitioning
+ // than normal. We need need fewer bits for endpoints, so more likely
+ // to be able to use more partitions than an RGB/RGBA block
+ config.tune_partition_count_limit = astc::min(config.tune_partition_count_limit + 1u, 4u);
+
+ config.cw_g_weight = 0.0f;
+ config.cw_b_weight = 0.0f;
+ config.tune_2_partition_early_out_limit_factor *= 1.5f;
+ config.tune_3_partition_early_out_limit_factor *= 1.5f;
+ config.tune_2_plane_early_out_limit_correlation = 0.99f;
+
+ // Normals are prone to blocking artifacts on smooth curves
+ // so force compressor to try harder here ...
+ config.tune_db_limit *= 1.03f;
+ }
+ else if (flags & ASTCENC_FLG_MAP_MASK)
+ {
+ // Masks are prone to blocking artifacts on mask edges
+ // so force compressor to try harder here ...
+ config.tune_db_limit *= 1.03f;
+ }
+ else if (flags & ASTCENC_FLG_MAP_RGBM)
+ {
+ config.rgbm_m_scale = 5.0f;
+ config.cw_a_weight = 2.0f * config.rgbm_m_scale;
+ }
+ else // (This is color data)
+ {
+ // This is a very basic perceptual metric for RGB color data, which weights error
+ // significance by the perceptual luminance contribution of each color channel. For
+ // luminance the usual weights to compute luminance from a linear RGB value are as
+ // follows:
+ //
+ // l = r * 0.3 + g * 0.59 + b * 0.11
+ //
+ // ... but we scale these up to keep a better balance between color and alpha. Note
+ // that if the content is using alpha we'd recommend using the -a option to weight
+ // the color contribution by the alpha transparency.
+ if (flags & ASTCENC_FLG_USE_PERCEPTUAL)
+ {
+ config.cw_r_weight = 0.30f * 2.25f;
+ config.cw_g_weight = 0.59f * 2.25f;
+ config.cw_b_weight = 0.11f * 2.25f;
+ }
+ }
+ config.flags = flags;
+
+ return ASTCENC_SUCCESS;
+}
+
+/* See header for documentation. */
+astcenc_error astcenc_context_alloc(
+ const astcenc_config* configp,
+ unsigned int thread_count,
+ astcenc_context** context
+) {
+ astcenc_error status;
+ const astcenc_config& config = *configp;
+
+ status = validate_cpu_isa();
+ if (status != ASTCENC_SUCCESS)
+ {
+ return status;
+ }
+
+ status = validate_cpu_float();
+ if (status != ASTCENC_SUCCESS)
+ {
+ return status;
+ }
+
+ if (thread_count == 0)
+ {
+ return ASTCENC_ERR_BAD_PARAM;
+ }
+
+#if defined(ASTCENC_DIAGNOSTICS)
+ // Force single threaded compressor use in diagnostic mode.
+ if (thread_count != 1)
+ {
+ return ASTCENC_ERR_BAD_PARAM;
+ }
+#endif
+
+ astcenc_context* ctxo = new astcenc_context;
+ astcenc_contexti* ctx = &ctxo->context;
+ ctx->thread_count = thread_count;
+ ctx->config = config;
+ ctx->working_buffers = nullptr;
+
+ // These are allocated per-compress, as they depend on image size
+ ctx->input_alpha_averages = nullptr;
+
+ // Copy the config first and validate the copy (we may modify it)
+ status = validate_config(ctx->config);
+ if (status != ASTCENC_SUCCESS)
+ {
+ delete ctxo;
+ return status;
+ }
+
+ ctx->bsd = aligned_malloc<block_size_descriptor>(sizeof(block_size_descriptor), ASTCENC_VECALIGN);
+ bool can_omit_modes = static_cast<bool>(config.flags & ASTCENC_FLG_SELF_DECOMPRESS_ONLY);
+ init_block_size_descriptor(config.block_x, config.block_y, config.block_z,
+ can_omit_modes,
+ config.tune_partition_count_limit,
+ static_cast<float>(config.tune_block_mode_limit) / 100.0f,
+ *ctx->bsd);
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+ // Do setup only needed by compression
+ if (!(status & ASTCENC_FLG_DECOMPRESS_ONLY))
+ {
+ // Turn a dB limit into a per-texel error for faster use later
+ if ((ctx->config.profile == ASTCENC_PRF_LDR) || (ctx->config.profile == ASTCENC_PRF_LDR_SRGB))
+ {
+ ctx->config.tune_db_limit = astc::pow(0.1f, ctx->config.tune_db_limit * 0.1f) * 65535.0f * 65535.0f;
+ }
+ else
+ {
+ ctx->config.tune_db_limit = 0.0f;
+ }
+
+ size_t worksize = sizeof(compression_working_buffers) * thread_count;
+ ctx->working_buffers = aligned_malloc<compression_working_buffers>(worksize, ASTCENC_VECALIGN);
+ static_assert((sizeof(compression_working_buffers) % ASTCENC_VECALIGN) == 0,
+ "compression_working_buffers size must be multiple of vector alignment");
+ if (!ctx->working_buffers)
+ {
+ aligned_free<block_size_descriptor>(ctx->bsd);
+ delete ctxo;
+ *context = nullptr;
+ return ASTCENC_ERR_OUT_OF_MEM;
+ }
+ }
+#endif
+
+#if defined(ASTCENC_DIAGNOSTICS)
+ ctx->trace_log = new TraceLog(ctx->config.trace_file_path);
+ if (!ctx->trace_log->m_file)
+ {
+ return ASTCENC_ERR_DTRACE_FAILURE;
+ }
+
+ trace_add_data("block_x", config.block_x);
+ trace_add_data("block_y", config.block_y);
+ trace_add_data("block_z", config.block_z);
+#endif
+
+ *context = ctxo;
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+ prepare_angular_tables();
+#endif
+
+ return ASTCENC_SUCCESS;
+}
+
+/* See header dor documentation. */
+void astcenc_context_free(
+ astcenc_context* ctxo
+) {
+ if (ctxo)
+ {
+ astcenc_contexti* ctx = &ctxo->context;
+ aligned_free<compression_working_buffers>(ctx->working_buffers);
+ aligned_free<block_size_descriptor>(ctx->bsd);
+#if defined(ASTCENC_DIAGNOSTICS)
+ delete ctx->trace_log;
+#endif
+ delete ctxo;
+ }
+}
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+
+/**
+ * @brief Compress an image, after any preflight has completed.
+ *
+ * @param[out] ctxo The compressor context.
+ * @param thread_index The thread index.
+ * @param image The intput image.
+ * @param swizzle The input swizzle.
+ * @param[out] buffer The output array for the compressed data.
+ */
+static void compress_image(
+ astcenc_context& ctxo,
+ unsigned int thread_index,
+ const astcenc_image& image,
+ const astcenc_swizzle& swizzle,
+ uint8_t* buffer
+) {
+ astcenc_contexti& ctx = ctxo.context;
+ const block_size_descriptor& bsd = *ctx.bsd;
+ astcenc_profile decode_mode = ctx.config.profile;
+
+ image_block blk;
+
+ int block_x = bsd.xdim;
+ int block_y = bsd.ydim;
+ int block_z = bsd.zdim;
+ blk.texel_count = static_cast<uint8_t>(block_x * block_y * block_z);
+
+ int dim_x = image.dim_x;
+ int dim_y = image.dim_y;
+ int dim_z = image.dim_z;
+
+ int xblocks = (dim_x + block_x - 1) / block_x;
+ int yblocks = (dim_y + block_y - 1) / block_y;
+ int zblocks = (dim_z + block_z - 1) / block_z;
+ int block_count = zblocks * yblocks * xblocks;
+
+ int row_blocks = xblocks;
+ int plane_blocks = xblocks * yblocks;
+
+ // Populate the block channel weights
+ blk.channel_weight = vfloat4(ctx.config.cw_r_weight,
+ ctx.config.cw_g_weight,
+ ctx.config.cw_b_weight,
+ ctx.config.cw_a_weight);
+
+ // Use preallocated scratch buffer
+ auto& temp_buffers = ctx.working_buffers[thread_index];
+
+ // Only the first thread actually runs the initializer
+ ctxo.manage_compress.init(block_count);
+
+ // Determine if we can use an optimized load function
+ bool needs_swz = (swizzle.r != ASTCENC_SWZ_R) || (swizzle.g != ASTCENC_SWZ_G) ||
+ (swizzle.b != ASTCENC_SWZ_B) || (swizzle.a != ASTCENC_SWZ_A);
+
+ bool needs_hdr = (decode_mode == ASTCENC_PRF_HDR) ||
+ (decode_mode == ASTCENC_PRF_HDR_RGB_LDR_A);
+
+ bool use_fast_load = !needs_swz && !needs_hdr &&
+ block_z == 1 && image.data_type == ASTCENC_TYPE_U8;
+
+ auto load_func = load_image_block;
+ if (use_fast_load)
+ {
+ load_func = load_image_block_fast_ldr;
+ }
+
+ // All threads run this processing loop until there is no work remaining
+ while (true)
+ {
+ unsigned int count;
+ unsigned int base = ctxo.manage_compress.get_task_assignment(16, count);
+ if (!count)
+ {
+ break;
+ }
+
+ for (unsigned int i = base; i < base + count; i++)
+ {
+ // Decode i into x, y, z block indices
+ int z = i / plane_blocks;
+ unsigned int rem = i - (z * plane_blocks);
+ int y = rem / row_blocks;
+ int x = rem - (y * row_blocks);
+
+ // Test if we can apply some basic alpha-scale RDO
+ bool use_full_block = true;
+ if (ctx.config.a_scale_radius != 0 && block_z == 1)
+ {
+ int start_x = x * block_x;
+ int end_x = astc::min(dim_x, start_x + block_x);
+
+ int start_y = y * block_y;
+ int end_y = astc::min(dim_y, start_y + block_y);
+
+ // SATs accumulate error, so don't test exactly zero. Test for
+ // less than 1 alpha in the expanded block footprint that
+ // includes the alpha radius.
+ int x_footprint = block_x + 2 * (ctx.config.a_scale_radius - 1);
+
+ int y_footprint = block_y + 2 * (ctx.config.a_scale_radius - 1);
+
+ float footprint = static_cast<float>(x_footprint * y_footprint);
+ float threshold = 0.9f / (255.0f * footprint);
+
+ // Do we have any alpha values?
+ use_full_block = false;
+ for (int ay = start_y; ay < end_y; ay++)
+ {
+ for (int ax = start_x; ax < end_x; ax++)
+ {
+ float a_avg = ctx.input_alpha_averages[ay * dim_x + ax];
+ if (a_avg > threshold)
+ {
+ use_full_block = true;
+ ax = end_x;
+ ay = end_y;
+ }
+ }
+ }
+ }
+
+ // Fetch the full block for compression
+ if (use_full_block)
+ {
+ load_func(decode_mode, image, blk, bsd, x * block_x, y * block_y, z * block_z, swizzle);
+
+ // Scale RGB error contribution by the maximum alpha in the block
+ // This encourages preserving alpha accuracy in regions with high
+ // transparency, and can buy up to 0.5 dB PSNR.
+ if (ctx.config.flags & ASTCENC_FLG_USE_ALPHA_WEIGHT)
+ {
+ float alpha_scale = blk.data_max.lane<3>() * (1.0f / 65535.0f);
+ blk.channel_weight = vfloat4(ctx.config.cw_r_weight * alpha_scale,
+ ctx.config.cw_g_weight * alpha_scale,
+ ctx.config.cw_b_weight * alpha_scale,
+ ctx.config.cw_a_weight);
+ }
+ }
+ // Apply alpha scale RDO - substitute constant color block
+ else
+ {
+ blk.origin_texel = vfloat4::zero();
+ blk.data_min = vfloat4::zero();
+ blk.data_mean = vfloat4::zero();
+ blk.data_max = vfloat4::zero();
+ blk.grayscale = true;
+ }
+
+ int offset = ((z * yblocks + y) * xblocks + x) * 16;
+ uint8_t *bp = buffer + offset;
+ physical_compressed_block* pcb = reinterpret_cast<physical_compressed_block*>(bp);
+ compress_block(ctx, blk, *pcb, temp_buffers);
+ }
+
+ ctxo.manage_compress.complete_task_assignment(count);
+ }
+}
+
+/**
+ * @brief Compute regional averages in an image.
+ *
+ * This function can be called by multiple threads, but only after a single
+ * thread calls the setup function @c init_compute_averages().
+ *
+ * Results are written back into @c img->input_alpha_averages.
+ *
+ * @param[out] ctx The context.
+ * @param ag The average and variance arguments created during setup.
+ */
+static void compute_averages(
+ astcenc_context& ctx,
+ const avg_args &ag
+) {
+ pixel_region_args arg = ag.arg;
+ arg.work_memory = new vfloat4[ag.work_memory_size];
+
+ int size_x = ag.img_size_x;
+ int size_y = ag.img_size_y;
+ int size_z = ag.img_size_z;
+
+ int step_xy = ag.blk_size_xy;
+ int step_z = ag.blk_size_z;
+
+ int y_tasks = (size_y + step_xy - 1) / step_xy;
+
+ // All threads run this processing loop until there is no work remaining
+ while (true)
+ {
+ unsigned int count;
+ unsigned int base = ctx.manage_avg.get_task_assignment(16, count);
+ if (!count)
+ {
+ break;
+ }
+
+ for (unsigned int i = base; i < base + count; i++)
+ {
+ int z = (i / (y_tasks)) * step_z;
+ int y = (i - (z * y_tasks)) * step_xy;
+
+ arg.size_z = astc::min(step_z, size_z - z);
+ arg.offset_z = z;
+
+ arg.size_y = astc::min(step_xy, size_y - y);
+ arg.offset_y = y;
+
+ for (int x = 0; x < size_x; x += step_xy)
+ {
+ arg.size_x = astc::min(step_xy, size_x - x);
+ arg.offset_x = x;
+ compute_pixel_region_variance(ctx.context, arg);
+ }
+ }
+
+ ctx.manage_avg.complete_task_assignment(count);
+ }
+
+ delete[] arg.work_memory;
+}
+
+#endif
+
+/* See header for documentation. */
+astcenc_error astcenc_compress_image(
+ astcenc_context* ctxo,
+ astcenc_image* imagep,
+ const astcenc_swizzle* swizzle,
+ uint8_t* data_out,
+ size_t data_len,
+ unsigned int thread_index
+) {
+#if defined(ASTCENC_DECOMPRESS_ONLY)
+ (void)ctxo;
+ (void)imagep;
+ (void)swizzle;
+ (void)data_out;
+ (void)data_len;
+ (void)thread_index;
+ return ASTCENC_ERR_BAD_CONTEXT;
+#else
+ astcenc_contexti* ctx = &ctxo->context;
+ astcenc_error status;
+ astcenc_image& image = *imagep;
+
+ if (ctx->config.flags & ASTCENC_FLG_DECOMPRESS_ONLY)
+ {
+ return ASTCENC_ERR_BAD_CONTEXT;
+ }
+
+ status = validate_compression_swizzle(*swizzle);
+ if (status != ASTCENC_SUCCESS)
+ {
+ return status;
+ }
+
+ if (thread_index >= ctx->thread_count)
+ {
+ return ASTCENC_ERR_BAD_PARAM;
+ }
+
+ unsigned int block_x = ctx->config.block_x;
+ unsigned int block_y = ctx->config.block_y;
+ unsigned int block_z = ctx->config.block_z;
+
+ unsigned int xblocks = (image.dim_x + block_x - 1) / block_x;
+ unsigned int yblocks = (image.dim_y + block_y - 1) / block_y;
+ unsigned int zblocks = (image.dim_z + block_z - 1) / block_z;
+
+ // Check we have enough output space (16 bytes per block)
+ size_t size_needed = xblocks * yblocks * zblocks * 16;
+ if (data_len < size_needed)
+ {
+ return ASTCENC_ERR_OUT_OF_MEM;
+ }
+
+ // If context thread count is one then implicitly reset
+ if (ctx->thread_count == 1)
+ {
+ astcenc_compress_reset(ctxo);
+ }
+
+ if (ctx->config.a_scale_radius != 0)
+ {
+ // First thread to enter will do setup, other threads will subsequently
+ // enter the critical section but simply skip over the initialization
+ auto init_avg = [ctx, &image, swizzle]() {
+ // Perform memory allocations for the destination buffers
+ size_t texel_count = image.dim_x * image.dim_y * image.dim_z;
+ ctx->input_alpha_averages = new float[texel_count];
+
+ return init_compute_averages(
+ image, ctx->config.a_scale_radius, *swizzle,
+ ctx->avg_preprocess_args);
+ };
+
+ // Only the first thread actually runs the initializer
+ ctxo->manage_avg.init(init_avg);
+
+ // All threads will enter this function and dynamically grab work
+ compute_averages(*ctxo, ctx->avg_preprocess_args);
+ }
+
+ // Wait for compute_averages to complete before compressing
+ ctxo->manage_avg.wait();
+
+ compress_image(*ctxo, thread_index, image, *swizzle, data_out);
+
+ // Wait for compress to complete before freeing memory
+ ctxo->manage_compress.wait();
+
+ auto term_compress = [ctx]() {
+ delete[] ctx->input_alpha_averages;
+ ctx->input_alpha_averages = nullptr;
+ };
+
+ // Only the first thread to arrive actually runs the term
+ ctxo->manage_compress.term(term_compress);
+
+ return ASTCENC_SUCCESS;
+#endif
+}
+
+/* See header for documentation. */
+astcenc_error astcenc_compress_reset(
+ astcenc_context* ctxo
+) {
+#if defined(ASTCENC_DECOMPRESS_ONLY)
+ (void)ctxo;
+ return ASTCENC_ERR_BAD_CONTEXT;
+#else
+ astcenc_contexti* ctx = &ctxo->context;
+ if (ctx->config.flags & ASTCENC_FLG_DECOMPRESS_ONLY)
+ {
+ return ASTCENC_ERR_BAD_CONTEXT;
+ }
+
+ ctxo->manage_avg.reset();
+ ctxo->manage_compress.reset();
+ return ASTCENC_SUCCESS;
+#endif
+}
+
+/* See header for documentation. */
+astcenc_error astcenc_decompress_image(
+ astcenc_context* ctxo,
+ const uint8_t* data,
+ size_t data_len,
+ astcenc_image* image_outp,
+ const astcenc_swizzle* swizzle,
+ unsigned int thread_index
+) {
+ astcenc_error status;
+ astcenc_image& image_out = *image_outp;
+ astcenc_contexti* ctx = &ctxo->context;
+
+ // Today this doesn't matter (working set on stack) but might in future ...
+ if (thread_index >= ctx->thread_count)
+ {
+ return ASTCENC_ERR_BAD_PARAM;
+ }
+
+ status = validate_decompression_swizzle(*swizzle);
+ if (status != ASTCENC_SUCCESS)
+ {
+ return status;
+ }
+
+ unsigned int block_x = ctx->config.block_x;
+ unsigned int block_y = ctx->config.block_y;
+ unsigned int block_z = ctx->config.block_z;
+
+ unsigned int xblocks = (image_out.dim_x + block_x - 1) / block_x;
+ unsigned int yblocks = (image_out.dim_y + block_y - 1) / block_y;
+ unsigned int zblocks = (image_out.dim_z + block_z - 1) / block_z;
+
+ int row_blocks = xblocks;
+ int plane_blocks = xblocks * yblocks;
+
+ // Check we have enough output space (16 bytes per block)
+ size_t size_needed = xblocks * yblocks * zblocks * 16;
+ if (data_len < size_needed)
+ {
+ return ASTCENC_ERR_OUT_OF_MEM;
+ }
+
+ image_block blk;
+ blk.texel_count = static_cast<uint8_t>(block_x * block_y * block_z);
+
+ // If context thread count is one then implicitly reset
+ if (ctx->thread_count == 1)
+ {
+ astcenc_decompress_reset(ctxo);
+ }
+
+ // Only the first thread actually runs the initializer
+ ctxo->manage_decompress.init(zblocks * yblocks * xblocks);
+
+ // All threads run this processing loop until there is no work remaining
+ while (true)
+ {
+ unsigned int count;
+ unsigned int base = ctxo->manage_decompress.get_task_assignment(128, count);
+ if (!count)
+ {
+ break;
+ }
+
+ for (unsigned int i = base; i < base + count; i++)
+ {
+ // Decode i into x, y, z block indices
+ int z = i / plane_blocks;
+ unsigned int rem = i - (z * plane_blocks);
+ int y = rem / row_blocks;
+ int x = rem - (y * row_blocks);
+
+ unsigned int offset = (((z * yblocks + y) * xblocks) + x) * 16;
+ const uint8_t* bp = data + offset;
+
+ const physical_compressed_block& pcb = *reinterpret_cast<const physical_compressed_block*>(bp);
+ symbolic_compressed_block scb;
+
+ physical_to_symbolic(*ctx->bsd, pcb, scb);
+
+ decompress_symbolic_block(ctx->config.profile, *ctx->bsd,
+ x * block_x, y * block_y, z * block_z,
+ scb, blk);
+
+ store_image_block(image_out, blk, *ctx->bsd,
+ x * block_x, y * block_y, z * block_z, *swizzle);
+ }
+
+ ctxo->manage_decompress.complete_task_assignment(count);
+ }
+
+ return ASTCENC_SUCCESS;
+}
+
+/* See header for documentation. */
+astcenc_error astcenc_decompress_reset(
+ astcenc_context* ctxo
+) {
+ ctxo->manage_decompress.reset();
+ return ASTCENC_SUCCESS;
+}
+
+/* See header for documentation. */
+astcenc_error astcenc_get_block_info(
+ astcenc_context* ctxo,
+ const uint8_t data[16],
+ astcenc_block_info* info
+) {
+#if defined(ASTCENC_DECOMPRESS_ONLY)
+ (void)ctxo;
+ (void)data;
+ (void)info;
+ return ASTCENC_ERR_BAD_CONTEXT;
+#else
+ astcenc_contexti* ctx = &ctxo->context;
+
+ // Decode the compressed data into a symbolic form
+ const physical_compressed_block&pcb = *reinterpret_cast<const physical_compressed_block*>(data);
+ symbolic_compressed_block scb;
+ physical_to_symbolic(*ctx->bsd, pcb, scb);
+
+ // Fetch the appropriate partition and decimation tables
+ block_size_descriptor& bsd = *ctx->bsd;
+
+ // Start from a clean slate
+ memset(info, 0, sizeof(*info));
+
+ // Basic info we can always populate
+ info->profile = ctx->config.profile;
+
+ info->block_x = ctx->config.block_x;
+ info->block_y = ctx->config.block_y;
+ info->block_z = ctx->config.block_z;
+ info->texel_count = bsd.texel_count;
+
+ // Check for error blocks first
+ info->is_error_block = scb.block_type == SYM_BTYPE_ERROR;
+ if (info->is_error_block)
+ {
+ return ASTCENC_SUCCESS;
+ }
+
+ // Check for constant color blocks second
+ info->is_constant_block = scb.block_type == SYM_BTYPE_CONST_F16 ||
+ scb.block_type == SYM_BTYPE_CONST_U16;
+ if (info->is_constant_block)
+ {
+ return ASTCENC_SUCCESS;
+ }
+
+ // Otherwise handle a full block ; known to be valid after conditions above have been checked
+ int partition_count = scb.partition_count;
+ const auto& pi = bsd.get_partition_info(partition_count, scb.partition_index);
+
+ const block_mode& bm = bsd.get_block_mode(scb.block_mode);
+ const decimation_info& di = bsd.get_decimation_info(bm.decimation_mode);
+
+ info->weight_x = di.weight_x;
+ info->weight_y = di.weight_y;
+ info->weight_z = di.weight_z;
+
+ info->is_dual_plane_block = bm.is_dual_plane != 0;
+
+ info->partition_count = scb.partition_count;
+ info->partition_index = scb.partition_index;
+ info->dual_plane_component = scb.plane2_component;
+
+ info->color_level_count = get_quant_level(scb.get_color_quant_mode());
+ info->weight_level_count = get_quant_level(bm.get_weight_quant_mode());
+
+ // Unpack color endpoints for each active partition
+ for (unsigned int i = 0; i < scb.partition_count; i++)
+ {
+ bool rgb_hdr;
+ bool a_hdr;
+ vint4 endpnt[2];
+
+ unpack_color_endpoints(ctx->config.profile,
+ scb.color_formats[i],
+ scb.color_values[i],
+ rgb_hdr, a_hdr,
+ endpnt[0], endpnt[1]);
+
+ // Store the color endpoint mode info
+ info->color_endpoint_modes[i] = scb.color_formats[i];
+ info->is_hdr_block = info->is_hdr_block || rgb_hdr || a_hdr;
+
+ // Store the unpacked and decoded color endpoint
+ vmask4 hdr_mask(rgb_hdr, rgb_hdr, rgb_hdr, a_hdr);
+ for (int j = 0; j < 2; j++)
+ {
+ vint4 color_lns = lns_to_sf16(endpnt[j]);
+ vint4 color_unorm = unorm16_to_sf16(endpnt[j]);
+ vint4 datai = select(color_unorm, color_lns, hdr_mask);
+ store(float16_to_float(datai), info->color_endpoints[i][j]);
+ }
+ }
+
+ // Unpack weights for each texel
+ int weight_plane1[BLOCK_MAX_TEXELS];
+ int weight_plane2[BLOCK_MAX_TEXELS];
+
+ unpack_weights(bsd, scb, di, bm.is_dual_plane, weight_plane1, weight_plane2);
+ for (unsigned int i = 0; i < bsd.texel_count; i++)
+ {
+ info->weight_values_plane1[i] = static_cast<float>(weight_plane1[i]) * (1.0f / WEIGHTS_TEXEL_SUM);
+ if (info->is_dual_plane_block)
+ {
+ info->weight_values_plane2[i] = static_cast<float>(weight_plane2[i]) * (1.0f / WEIGHTS_TEXEL_SUM);
+ }
+ }
+
+ // Unpack partition assignments for each texel
+ for (unsigned int i = 0; i < bsd.texel_count; i++)
+ {
+ info->partition_assignment[i] = pi.partition_of_texel[i];
+ }
+
+ return ASTCENC_SUCCESS;
+#endif
+}
+
+/* See header for documentation. */
+const char* astcenc_get_error_string(
+ astcenc_error status
+) {
+ // Values in this enum are from an external user, so not guaranteed to be
+ // bounded to the enum values
+ switch (static_cast<int>(status))
+ {
+ case ASTCENC_SUCCESS:
+ return "ASTCENC_SUCCESS";
+ case ASTCENC_ERR_OUT_OF_MEM:
+ return "ASTCENC_ERR_OUT_OF_MEM";
+ case ASTCENC_ERR_BAD_CPU_FLOAT:
+ return "ASTCENC_ERR_BAD_CPU_FLOAT";
+ case ASTCENC_ERR_BAD_CPU_ISA:
+ return "ASTCENC_ERR_BAD_CPU_ISA";
+ case ASTCENC_ERR_BAD_PARAM:
+ return "ASTCENC_ERR_BAD_PARAM";
+ case ASTCENC_ERR_BAD_BLOCK_SIZE:
+ return "ASTCENC_ERR_BAD_BLOCK_SIZE";
+ case ASTCENC_ERR_BAD_PROFILE:
+ return "ASTCENC_ERR_BAD_PROFILE";
+ case ASTCENC_ERR_BAD_QUALITY:
+ return "ASTCENC_ERR_BAD_QUALITY";
+ case ASTCENC_ERR_BAD_FLAGS:
+ return "ASTCENC_ERR_BAD_FLAGS";
+ case ASTCENC_ERR_BAD_SWIZZLE:
+ return "ASTCENC_ERR_BAD_SWIZZLE";
+ case ASTCENC_ERR_BAD_CONTEXT:
+ return "ASTCENC_ERR_BAD_CONTEXT";
+ case ASTCENC_ERR_NOT_IMPLEMENTED:
+ return "ASTCENC_ERR_NOT_IMPLEMENTED";
+#if defined(ASTCENC_DIAGNOSTICS)
+ case ASTCENC_ERR_DTRACE_FAILURE:
+ return "ASTCENC_ERR_DTRACE_FAILURE";
+#endif
+ default:
+ return nullptr;
+ }
+}
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_find_best_partitioning.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_find_best_partitioning.cpp
new file mode 100644
index 00000000000..c59e093e848
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_find_best_partitioning.cpp
@@ -0,0 +1,776 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+
+/**
+ * @brief Functions for finding best partition for a block.
+ *
+ * The partition search operates in two stages. The first pass uses kmeans clustering to group
+ * texels into an ideal partitioning for the requested partition count, and then compares that
+ * against the 1024 partitionings generated by the ASTC partition hash function. The generated
+ * partitions are then ranked by the number of texels in the wrong partition, compared to the ideal
+ * clustering. All 1024 partitions are tested for similarity and ranked, apart from duplicates and
+ * partitionings that actually generate fewer than the requested partition count, but only the top
+ * N candidates are actually put through a more detailed search. N is determined by the compressor
+ * quality preset.
+ *
+ * For the detailed search, each candidate is checked against two possible encoding methods:
+ *
+ * - The best partitioning assuming different chroma colors (RGB + RGB or RGB + delta endpoints).
+ * - The best partitioning assuming same chroma colors (RGB + scale endpoints).
+ *
+ * This is implemented by computing the compute mean color and dominant direction for each
+ * partition. This defines two lines, both of which go through the mean color value.
+ *
+ * - One line has a direction defined by the dominant direction; this is used to assess the error
+ * from using an uncorrelated color representation.
+ * - The other line goes through (0,0,0,1) and is used to assess the error from using a same chroma
+ * (RGB + scale) color representation.
+ *
+ * The best candidate is selected by computing the squared-errors that result from using these
+ * lines for endpoint selection.
+ */
+
+#include <limits>
+#include "astcenc_internal.h"
+
+/**
+ * @brief Pick some initial kmeans cluster centers.
+ *
+ * @param blk The image block color data to compress.
+ * @param texel_count The number of texels in the block.
+ * @param partition_count The number of partitions in the block.
+ * @param[out] cluster_centers The initial partition cluster center colors.
+ */
+static void kmeans_init(
+ const image_block& blk,
+ unsigned int texel_count,
+ unsigned int partition_count,
+ vfloat4 cluster_centers[BLOCK_MAX_PARTITIONS]
+) {
+ promise(texel_count > 0);
+ promise(partition_count > 0);
+
+ unsigned int clusters_selected = 0;
+ float distances[BLOCK_MAX_TEXELS];
+
+ // Pick a random sample as first cluster center; 145897 from random.org
+ unsigned int sample = 145897 % texel_count;
+ vfloat4 center_color = blk.texel(sample);
+ cluster_centers[clusters_selected] = center_color;
+ clusters_selected++;
+
+ // Compute the distance to the first cluster center
+ float distance_sum = 0.0f;
+ for (unsigned int i = 0; i < texel_count; i++)
+ {
+ vfloat4 color = blk.texel(i);
+ vfloat4 diff = color - center_color;
+ float distance = dot_s(diff * diff, blk.channel_weight);
+ distance_sum += distance;
+ distances[i] = distance;
+ }
+
+ // More numbers from random.org for weighted-random center selection
+ const float cluster_cutoffs[9] {
+ 0.626220f, 0.932770f, 0.275454f,
+ 0.318558f, 0.240113f, 0.009190f,
+ 0.347661f, 0.731960f, 0.156391f
+ };
+
+ unsigned int cutoff = (clusters_selected - 1) + 3 * (partition_count - 2);
+
+ // Pick the remaining samples as needed
+ while (true)
+ {
+ // Pick the next center in a weighted-random fashion.
+ float summa = 0.0f;
+ float distance_cutoff = distance_sum * cluster_cutoffs[cutoff++];
+ for (sample = 0; sample < texel_count; sample++)
+ {
+ summa += distances[sample];
+ if (summa >= distance_cutoff)
+ {
+ break;
+ }
+ }
+
+ // Clamp to a valid range and store the selected cluster center
+ sample = astc::min(sample, texel_count - 1);
+
+ center_color = blk.texel(sample);
+ cluster_centers[clusters_selected++] = center_color;
+ if (clusters_selected >= partition_count)
+ {
+ break;
+ }
+
+ // Compute the distance to the new cluster center, keep the min dist
+ distance_sum = 0.0f;
+ for (unsigned int i = 0; i < texel_count; i++)
+ {
+ vfloat4 color = blk.texel(i);
+ vfloat4 diff = color - center_color;
+ float distance = dot_s(diff * diff, blk.channel_weight);
+ distance = astc::min(distance, distances[i]);
+ distance_sum += distance;
+ distances[i] = distance;
+ }
+ }
+}
+
+/**
+ * @brief Assign texels to clusters, based on a set of chosen center points.
+ *
+ * @param blk The image block color data to compress.
+ * @param texel_count The number of texels in the block.
+ * @param partition_count The number of partitions in the block.
+ * @param cluster_centers The partition cluster center colors.
+ * @param[out] partition_of_texel The partition assigned for each texel.
+ */
+static void kmeans_assign(
+ const image_block& blk,
+ unsigned int texel_count,
+ unsigned int partition_count,
+ const vfloat4 cluster_centers[BLOCK_MAX_PARTITIONS],
+ uint8_t partition_of_texel[BLOCK_MAX_TEXELS]
+) {
+ promise(texel_count > 0);
+ promise(partition_count > 0);
+
+ uint8_t partition_texel_count[BLOCK_MAX_PARTITIONS] { 0 };
+
+ // Find the best partition for every texel
+ for (unsigned int i = 0; i < texel_count; i++)
+ {
+ float best_distance = std::numeric_limits<float>::max();
+ unsigned int best_partition = 0;
+
+ vfloat4 color = blk.texel(i);
+ for (unsigned int j = 0; j < partition_count; j++)
+ {
+ vfloat4 diff = color - cluster_centers[j];
+ float distance = dot_s(diff * diff, blk.channel_weight);
+ if (distance < best_distance)
+ {
+ best_distance = distance;
+ best_partition = j;
+ }
+ }
+
+ partition_of_texel[i] = static_cast<uint8_t>(best_partition);
+ partition_texel_count[best_partition]++;
+ }
+
+ // It is possible to get a situation where a partition ends up without any texels. In this case,
+ // assign texel N to partition N. This is silly, but ensures that every partition retains at
+ // least one texel. Reassigning a texel in this manner may cause another partition to go empty,
+ // so if we actually did a reassignment, run the whole loop over again.
+ bool problem_case;
+ do
+ {
+ problem_case = false;
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ if (partition_texel_count[i] == 0)
+ {
+ partition_texel_count[partition_of_texel[i]]--;
+ partition_texel_count[i]++;
+ partition_of_texel[i] = static_cast<uint8_t>(i);
+ problem_case = true;
+ }
+ }
+ } while (problem_case);
+}
+
+/**
+ * @brief Compute new cluster centers based on their center of gravity.
+ *
+ * @param blk The image block color data to compress.
+ * @param texel_count The number of texels in the block.
+ * @param partition_count The number of partitions in the block.
+ * @param[out] cluster_centers The new cluster center colors.
+ * @param partition_of_texel The partition assigned for each texel.
+ */
+static void kmeans_update(
+ const image_block& blk,
+ unsigned int texel_count,
+ unsigned int partition_count,
+ vfloat4 cluster_centers[BLOCK_MAX_PARTITIONS],
+ const uint8_t partition_of_texel[BLOCK_MAX_TEXELS]
+) {
+ promise(texel_count > 0);
+ promise(partition_count > 0);
+
+ vfloat4 color_sum[BLOCK_MAX_PARTITIONS] {
+ vfloat4::zero(),
+ vfloat4::zero(),
+ vfloat4::zero(),
+ vfloat4::zero()
+ };
+
+ uint8_t partition_texel_count[BLOCK_MAX_PARTITIONS] { 0 };
+
+ // Find the center-of-gravity in each cluster
+ for (unsigned int i = 0; i < texel_count; i++)
+ {
+ uint8_t partition = partition_of_texel[i];
+ color_sum[partition] += blk.texel(i);
+ partition_texel_count[partition]++;
+ }
+
+ // Set the center of gravity to be the new cluster center
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ float scale = 1.0f / static_cast<float>(partition_texel_count[i]);
+ cluster_centers[i] = color_sum[i] * scale;
+ }
+}
+
+/**
+ * @brief Compute bit-mismatch for partitioning in 2-partition mode.
+ *
+ * @param a The texel assignment bitvector for the block.
+ * @param b The texel assignment bitvector for the partition table.
+ *
+ * @return The number of bit mismatches.
+ */
+static inline unsigned int partition_mismatch2(
+ const uint64_t a[2],
+ const uint64_t b[2]
+) {
+ int v1 = popcount(a[0] ^ b[0]) + popcount(a[1] ^ b[1]);
+ int v2 = popcount(a[0] ^ b[1]) + popcount(a[1] ^ b[0]);
+ return astc::min(v1, v2);
+}
+
+/**
+ * @brief Compute bit-mismatch for partitioning in 3-partition mode.
+ *
+ * @param a The texel assignment bitvector for the block.
+ * @param b The texel assignment bitvector for the partition table.
+ *
+ * @return The number of bit mismatches.
+ */
+static inline unsigned int partition_mismatch3(
+ const uint64_t a[3],
+ const uint64_t b[3]
+) {
+ int p00 = popcount(a[0] ^ b[0]);
+ int p01 = popcount(a[0] ^ b[1]);
+ int p02 = popcount(a[0] ^ b[2]);
+
+ int p10 = popcount(a[1] ^ b[0]);
+ int p11 = popcount(a[1] ^ b[1]);
+ int p12 = popcount(a[1] ^ b[2]);
+
+ int p20 = popcount(a[2] ^ b[0]);
+ int p21 = popcount(a[2] ^ b[1]);
+ int p22 = popcount(a[2] ^ b[2]);
+
+ int s0 = p11 + p22;
+ int s1 = p12 + p21;
+ int v0 = astc::min(s0, s1) + p00;
+
+ int s2 = p10 + p22;
+ int s3 = p12 + p20;
+ int v1 = astc::min(s2, s3) + p01;
+
+ int s4 = p10 + p21;
+ int s5 = p11 + p20;
+ int v2 = astc::min(s4, s5) + p02;
+
+ return astc::min(v0, v1, v2);
+}
+
+/**
+ * @brief Compute bit-mismatch for partitioning in 4-partition mode.
+ *
+ * @param a The texel assignment bitvector for the block.
+ * @param b The texel assignment bitvector for the partition table.
+ *
+ * @return The number of bit mismatches.
+ */
+static inline unsigned int partition_mismatch4(
+ const uint64_t a[4],
+ const uint64_t b[4]
+) {
+ int p00 = popcount(a[0] ^ b[0]);
+ int p01 = popcount(a[0] ^ b[1]);
+ int p02 = popcount(a[0] ^ b[2]);
+ int p03 = popcount(a[0] ^ b[3]);
+
+ int p10 = popcount(a[1] ^ b[0]);
+ int p11 = popcount(a[1] ^ b[1]);
+ int p12 = popcount(a[1] ^ b[2]);
+ int p13 = popcount(a[1] ^ b[3]);
+
+ int p20 = popcount(a[2] ^ b[0]);
+ int p21 = popcount(a[2] ^ b[1]);
+ int p22 = popcount(a[2] ^ b[2]);
+ int p23 = popcount(a[2] ^ b[3]);
+
+ int p30 = popcount(a[3] ^ b[0]);
+ int p31 = popcount(a[3] ^ b[1]);
+ int p32 = popcount(a[3] ^ b[2]);
+ int p33 = popcount(a[3] ^ b[3]);
+
+ int mx23 = astc::min(p22 + p33, p23 + p32);
+ int mx13 = astc::min(p21 + p33, p23 + p31);
+ int mx12 = astc::min(p21 + p32, p22 + p31);
+ int mx03 = astc::min(p20 + p33, p23 + p30);
+ int mx02 = astc::min(p20 + p32, p22 + p30);
+ int mx01 = astc::min(p21 + p30, p20 + p31);
+
+ int v0 = p00 + astc::min(p11 + mx23, p12 + mx13, p13 + mx12);
+ int v1 = p01 + astc::min(p10 + mx23, p12 + mx03, p13 + mx02);
+ int v2 = p02 + astc::min(p11 + mx03, p10 + mx13, p13 + mx01);
+ int v3 = p03 + astc::min(p11 + mx02, p12 + mx01, p10 + mx12);
+
+ return astc::min(v0, v1, v2, v3);
+}
+
+using mismatch_dispatch = unsigned int (*)(const uint64_t*, const uint64_t*);
+
+/**
+ * @brief Count the partition table mismatches vs the data clustering.
+ *
+ * @param bsd The block size information.
+ * @param partition_count The number of partitions in the block.
+ * @param bitmaps The block texel partition assignment patterns.
+ * @param[out] mismatch_counts The array storing per partitioning mismatch counts.
+ */
+static void count_partition_mismatch_bits(
+ const block_size_descriptor& bsd,
+ unsigned int partition_count,
+ const uint64_t bitmaps[BLOCK_MAX_PARTITIONS],
+ unsigned int mismatch_counts[BLOCK_MAX_PARTITIONINGS]
+) {
+ unsigned int active_count = bsd.partitioning_count_selected[partition_count - 1];
+
+ if (partition_count == 2)
+ {
+ for (unsigned int i = 0; i < active_count; i++)
+ {
+ mismatch_counts[i] = partition_mismatch2(bitmaps, bsd.coverage_bitmaps_2[i]);
+ }
+ }
+ else if (partition_count == 3)
+ {
+ for (unsigned int i = 0; i < active_count; i++)
+ {
+ mismatch_counts[i] = partition_mismatch3(bitmaps, bsd.coverage_bitmaps_3[i]);
+ }
+ }
+ else
+ {
+ for (unsigned int i = 0; i < active_count; i++)
+ {
+ mismatch_counts[i] = partition_mismatch4(bitmaps, bsd.coverage_bitmaps_4[i]);
+ }
+ }
+}
+
+/**
+ * @brief Use counting sort on the mismatch array to sort partition candidates.
+ *
+ * @param partitioning_count The number of packed partitionings.
+ * @param mismatch_count Partitioning mismatch counts, in index order.
+ * @param[out] partition_ordering Partition index values, in mismatch order.
+ *
+ * @return The number of active partitions in this selection.
+ */
+static unsigned int get_partition_ordering_by_mismatch_bits(
+ unsigned int partitioning_count,
+ const unsigned int mismatch_count[BLOCK_MAX_PARTITIONINGS],
+ unsigned int partition_ordering[BLOCK_MAX_PARTITIONINGS]
+) {
+ unsigned int mscount[256] { 0 };
+
+ // Create the histogram of mismatch counts
+ for (unsigned int i = 0; i < partitioning_count; i++)
+ {
+ mscount[mismatch_count[i]]++;
+ }
+
+ unsigned int active_count = partitioning_count - mscount[255];
+
+ // Create a running sum from the histogram array
+ // Cells store previous values only; i.e. exclude self after sum
+ unsigned int summa = 0;
+ for (unsigned int i = 0; i < 256; i++)
+ {
+ unsigned int cnt = mscount[i];
+ mscount[i] = summa;
+ summa += cnt;
+ }
+
+ // Use the running sum as the index, incrementing after read to allow
+ // sequential entries with the same count
+ for (unsigned int i = 0; i < partitioning_count; i++)
+ {
+ unsigned int idx = mscount[mismatch_count[i]]++;
+ partition_ordering[idx] = i;
+ }
+
+ return active_count;
+}
+
+/**
+ * @brief Use k-means clustering to compute a partition ordering for a block..
+ *
+ * @param bsd The block size information.
+ * @param blk The image block color data to compress.
+ * @param partition_count The desired number of partitions in the block.
+ * @param[out] partition_ordering The list of recommended partition indices, in priority order.
+ *
+ * @return The number of active partitionings in this selection.
+ */
+static unsigned int compute_kmeans_partition_ordering(
+ const block_size_descriptor& bsd,
+ const image_block& blk,
+ unsigned int partition_count,
+ unsigned int partition_ordering[BLOCK_MAX_PARTITIONINGS]
+) {
+ vfloat4 cluster_centers[BLOCK_MAX_PARTITIONS];
+ uint8_t texel_partitions[BLOCK_MAX_TEXELS];
+
+ // Use three passes of k-means clustering to partition the block data
+ for (unsigned int i = 0; i < 3; i++)
+ {
+ if (i == 0)
+ {
+ kmeans_init(blk, bsd.texel_count, partition_count, cluster_centers);
+ }
+ else
+ {
+ kmeans_update(blk, bsd.texel_count, partition_count, cluster_centers, texel_partitions);
+ }
+
+ kmeans_assign(blk, bsd.texel_count, partition_count, cluster_centers, texel_partitions);
+ }
+
+ // Construct the block bitmaps of texel assignments to each partition
+ uint64_t bitmaps[BLOCK_MAX_PARTITIONS] { 0 };
+ unsigned int texels_to_process = astc::min(bsd.texel_count, BLOCK_MAX_KMEANS_TEXELS);
+ promise(texels_to_process > 0);
+ for (unsigned int i = 0; i < texels_to_process; i++)
+ {
+ unsigned int idx = bsd.kmeans_texels[i];
+ bitmaps[texel_partitions[idx]] |= 1ULL << i;
+ }
+
+ // Count the mismatch between the block and the format's partition tables
+ unsigned int mismatch_counts[BLOCK_MAX_PARTITIONINGS];
+ count_partition_mismatch_bits(bsd, partition_count, bitmaps, mismatch_counts);
+
+ // Sort the partitions based on the number of mismatched bits
+ return get_partition_ordering_by_mismatch_bits(
+ bsd.partitioning_count_selected[partition_count - 1],
+ mismatch_counts, partition_ordering);
+}
+
+/**
+ * @brief Insert a partitioning into an order list of results, sorted by error.
+ *
+ * @param max_values The max number of entries in the best result arrays/
+ * @param this_error The error of the new entry.
+ * @param this_partition The partition ID of the new entry.
+ * @param[out] best_errors The array of best error values.
+ * @param[out] best_partitions The array of best partition values.
+ */
+static void insert_result(
+ unsigned int max_values,
+ float this_error,
+ unsigned int this_partition,
+ float* best_errors,
+ unsigned int* best_partitions)
+{
+ // Don't bother searching if the current worst error beats the new error
+ if (this_error >= best_errors[max_values - 1])
+ {
+ return;
+ }
+
+ // Else insert into the list in error-order
+ for (unsigned int i = 0; i < max_values; i++)
+ {
+ // Existing result is better - move on ...
+ if (this_error > best_errors[i])
+ {
+ continue;
+ }
+
+ // Move existing results down one
+ for (unsigned int j = max_values - 1; j > i; j--)
+ {
+ best_errors[j] = best_errors[j - 1];
+ best_partitions[j] = best_partitions[j - 1];
+ }
+
+ // Insert new result
+ best_errors[i] = this_error;
+ best_partitions[i] = this_partition;
+ break;
+ }
+}
+
+/* See header for documentation. */
+unsigned int find_best_partition_candidates(
+ const block_size_descriptor& bsd,
+ const image_block& blk,
+ unsigned int partition_count,
+ unsigned int partition_search_limit,
+ unsigned int best_partitions[TUNE_MAX_PARTITIIONING_CANDIDATES],
+ unsigned int requested_candidates
+) {
+ // Constant used to estimate quantization error for a given partitioning; the optimal value for
+ // this depends on bitrate. These values have been determined empirically.
+ unsigned int texels_per_block = bsd.texel_count;
+ float weight_imprecision_estim = 0.055f;
+ if (texels_per_block <= 20)
+ {
+ weight_imprecision_estim = 0.03f;
+ }
+ else if (texels_per_block <= 31)
+ {
+ weight_imprecision_estim = 0.04f;
+ }
+ else if (texels_per_block <= 41)
+ {
+ weight_imprecision_estim = 0.05f;
+ }
+
+ promise(partition_count > 0);
+ promise(partition_search_limit > 0);
+
+ weight_imprecision_estim = weight_imprecision_estim * weight_imprecision_estim;
+
+ unsigned int partition_sequence[BLOCK_MAX_PARTITIONINGS];
+ unsigned int sequence_len = compute_kmeans_partition_ordering(bsd, blk, partition_count, partition_sequence);
+ partition_search_limit = astc::min(partition_search_limit, sequence_len);
+ requested_candidates = astc::min(partition_search_limit, requested_candidates);
+
+ bool uses_alpha = !blk.is_constant_channel(3);
+
+ // Partitioning errors assuming uncorrelated-chrominance endpoints
+ float uncor_best_errors[TUNE_MAX_PARTITIIONING_CANDIDATES];
+ unsigned int uncor_best_partitions[TUNE_MAX_PARTITIIONING_CANDIDATES];
+
+ // Partitioning errors assuming same-chrominance endpoints
+ float samec_best_errors[TUNE_MAX_PARTITIIONING_CANDIDATES];
+ unsigned int samec_best_partitions[TUNE_MAX_PARTITIIONING_CANDIDATES];
+
+ for (unsigned int i = 0; i < requested_candidates; i++)
+ {
+ uncor_best_errors[i] = ERROR_CALC_DEFAULT;
+ samec_best_errors[i] = ERROR_CALC_DEFAULT;
+ }
+
+ if (uses_alpha)
+ {
+ for (unsigned int i = 0; i < partition_search_limit; i++)
+ {
+ unsigned int partition = partition_sequence[i];
+ const auto& pi = bsd.get_raw_partition_info(partition_count, partition);
+
+ // Compute weighting to give to each component in each partition
+ partition_metrics pms[BLOCK_MAX_PARTITIONS];
+
+ compute_avgs_and_dirs_4_comp(pi, blk, pms);
+
+ line4 uncor_lines[BLOCK_MAX_PARTITIONS];
+ line4 samec_lines[BLOCK_MAX_PARTITIONS];
+
+ processed_line4 uncor_plines[BLOCK_MAX_PARTITIONS];
+ processed_line4 samec_plines[BLOCK_MAX_PARTITIONS];
+
+ float uncor_line_lens[BLOCK_MAX_PARTITIONS];
+ float samec_line_lens[BLOCK_MAX_PARTITIONS];
+
+ for (unsigned int j = 0; j < partition_count; j++)
+ {
+ partition_metrics& pm = pms[j];
+
+ uncor_lines[j].a = pm.avg;
+ uncor_lines[j].b = normalize_safe(pm.dir, unit4());
+
+ uncor_plines[j].amod = uncor_lines[j].a - uncor_lines[j].b * dot(uncor_lines[j].a, uncor_lines[j].b);
+ uncor_plines[j].bs = uncor_lines[j].b;
+
+ samec_lines[j].a = vfloat4::zero();
+ samec_lines[j].b = normalize_safe(pm.avg, unit4());
+
+ samec_plines[j].amod = vfloat4::zero();
+ samec_plines[j].bs = samec_lines[j].b;
+ }
+
+ float uncor_error = 0.0f;
+ float samec_error = 0.0f;
+
+ compute_error_squared_rgba(pi,
+ blk,
+ uncor_plines,
+ samec_plines,
+ uncor_line_lens,
+ samec_line_lens,
+ uncor_error,
+ samec_error);
+
+ // Compute an estimate of error introduced by weight quantization imprecision.
+ // This error is computed as follows, for each partition
+ // 1: compute the principal-axis vector (full length) in error-space
+ // 2: convert the principal-axis vector to regular RGB-space
+ // 3: scale the vector by a constant that estimates average quantization error
+ // 4: for each texel, square the vector, then do a dot-product with the texel's
+ // error weight; sum up the results across all texels.
+ // 4(optimized): square the vector once, then do a dot-product with the average
+ // texel error, then multiply by the number of texels.
+
+ for (unsigned int j = 0; j < partition_count; j++)
+ {
+ float tpp = static_cast<float>(pi.partition_texel_count[j]);
+ vfloat4 error_weights(tpp * weight_imprecision_estim);
+
+ vfloat4 uncor_vector = uncor_lines[j].b * uncor_line_lens[j];
+ vfloat4 samec_vector = samec_lines[j].b * samec_line_lens[j];
+
+ uncor_error += dot_s(uncor_vector * uncor_vector, error_weights);
+ samec_error += dot_s(samec_vector * samec_vector, error_weights);
+ }
+
+ insert_result(requested_candidates, uncor_error, partition, uncor_best_errors, uncor_best_partitions);
+ insert_result(requested_candidates, samec_error, partition, samec_best_errors, samec_best_partitions);
+ }
+ }
+ else
+ {
+ for (unsigned int i = 0; i < partition_search_limit; i++)
+ {
+ unsigned int partition = partition_sequence[i];
+ const auto& pi = bsd.get_raw_partition_info(partition_count, partition);
+
+ // Compute weighting to give to each component in each partition
+ partition_metrics pms[BLOCK_MAX_PARTITIONS];
+ compute_avgs_and_dirs_3_comp_rgb(pi, blk, pms);
+
+ partition_lines3 plines[BLOCK_MAX_PARTITIONS];
+
+ for (unsigned int j = 0; j < partition_count; j++)
+ {
+ partition_metrics& pm = pms[j];
+ partition_lines3& pl = plines[j];
+
+ pl.uncor_line.a = pm.avg;
+ pl.uncor_line.b = normalize_safe(pm.dir, unit3());
+
+ pl.samec_line.a = vfloat4::zero();
+ pl.samec_line.b = normalize_safe(pm.avg, unit3());
+
+ pl.uncor_pline.amod = pl.uncor_line.a - pl.uncor_line.b * dot3(pl.uncor_line.a, pl.uncor_line.b);
+ pl.uncor_pline.bs = pl.uncor_line.b;
+
+ pl.samec_pline.amod = vfloat4::zero();
+ pl.samec_pline.bs = pl.samec_line.b;
+ }
+
+ float uncor_error = 0.0f;
+ float samec_error = 0.0f;
+
+ compute_error_squared_rgb(pi,
+ blk,
+ plines,
+ uncor_error,
+ samec_error);
+
+ // Compute an estimate of error introduced by weight quantization imprecision.
+ // This error is computed as follows, for each partition
+ // 1: compute the principal-axis vector (full length) in error-space
+ // 2: convert the principal-axis vector to regular RGB-space
+ // 3: scale the vector by a constant that estimates average quantization error
+ // 4: for each texel, square the vector, then do a dot-product with the texel's
+ // error weight; sum up the results across all texels.
+ // 4(optimized): square the vector once, then do a dot-product with the average
+ // texel error, then multiply by the number of texels.
+
+ for (unsigned int j = 0; j < partition_count; j++)
+ {
+ partition_lines3& pl = plines[j];
+
+ float tpp = static_cast<float>(pi.partition_texel_count[j]);
+ vfloat4 error_weights(tpp * weight_imprecision_estim);
+
+ vfloat4 uncor_vector = pl.uncor_line.b * pl.uncor_line_len;
+ vfloat4 samec_vector = pl.samec_line.b * pl.samec_line_len;
+
+ uncor_error += dot3_s(uncor_vector * uncor_vector, error_weights);
+ samec_error += dot3_s(samec_vector * samec_vector, error_weights);
+ }
+
+ insert_result(requested_candidates, uncor_error, partition, uncor_best_errors, uncor_best_partitions);
+ insert_result(requested_candidates, samec_error, partition, samec_best_errors, samec_best_partitions);
+ }
+ }
+
+ bool best_is_uncor = uncor_best_partitions[0] > samec_best_partitions[0];
+
+ unsigned int interleave[2 * TUNE_MAX_PARTITIIONING_CANDIDATES];
+ for (unsigned int i = 0; i < requested_candidates; i++)
+ {
+ if (best_is_uncor)
+ {
+ interleave[2 * i] = bsd.get_raw_partition_info(partition_count, uncor_best_partitions[i]).partition_index;
+ interleave[2 * i + 1] = bsd.get_raw_partition_info(partition_count, samec_best_partitions[i]).partition_index;
+ }
+ else
+ {
+ interleave[2 * i] = bsd.get_raw_partition_info(partition_count, samec_best_partitions[i]).partition_index;
+ interleave[2 * i + 1] = bsd.get_raw_partition_info(partition_count, uncor_best_partitions[i]).partition_index;
+ }
+ }
+
+ uint64_t bitmasks[1024/64] { 0 };
+ unsigned int emitted = 0;
+
+ // Deduplicate the first "requested" entries
+ for (unsigned int i = 0; i < requested_candidates * 2; i++)
+ {
+ unsigned int partition = interleave[i];
+
+ unsigned int word = partition / 64;
+ unsigned int bit = partition % 64;
+
+ bool written = bitmasks[word] & (1ull << bit);
+
+ if (!written)
+ {
+ best_partitions[emitted] = partition;
+ bitmasks[word] |= 1ull << bit;
+ emitted++;
+
+ if (emitted == requested_candidates)
+ {
+ break;
+ }
+ }
+ }
+
+ return emitted;
+}
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_ideal_endpoints_and_weights.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_ideal_endpoints_and_weights.cpp
new file mode 100644
index 00000000000..3c18e870146
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_ideal_endpoints_and_weights.cpp
@@ -0,0 +1,1656 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+
+/**
+ * @brief Functions for computing color endpoints and texel weights.
+ */
+
+#include <cassert>
+
+#include "astcenc_internal.h"
+#include "astcenc_vecmathlib.h"
+
+/**
+ * @brief Compute the infilled weight for N texel indices in a decimated grid.
+ *
+ * @param di The weight grid decimation to use.
+ * @param weights The decimated weight values to use.
+ * @param index The first texel index to interpolate.
+ *
+ * @return The interpolated weight for the given set of SIMD_WIDTH texels.
+ */
+static vfloat bilinear_infill_vla(
+ const decimation_info& di,
+ const float* weights,
+ unsigned int index
+) {
+ // Load the bilinear filter texel weight indexes in the decimated grid
+ vint weight_idx0 = vint(di.texel_weights_4t[0] + index);
+ vint weight_idx1 = vint(di.texel_weights_4t[1] + index);
+ vint weight_idx2 = vint(di.texel_weights_4t[2] + index);
+ vint weight_idx3 = vint(di.texel_weights_4t[3] + index);
+
+ // Load the bilinear filter weights from the decimated grid
+ vfloat weight_val0 = gatherf(weights, weight_idx0);
+ vfloat weight_val1 = gatherf(weights, weight_idx1);
+ vfloat weight_val2 = gatherf(weights, weight_idx2);
+ vfloat weight_val3 = gatherf(weights, weight_idx3);
+
+ // Load the weight contribution factors for each decimated weight
+ vfloat tex_weight_float0 = loada(di.texel_weights_float_4t[0] + index);
+ vfloat tex_weight_float1 = loada(di.texel_weights_float_4t[1] + index);
+ vfloat tex_weight_float2 = loada(di.texel_weights_float_4t[2] + index);
+ vfloat tex_weight_float3 = loada(di.texel_weights_float_4t[3] + index);
+
+ // Compute the bilinear interpolation to generate the per-texel weight
+ return (weight_val0 * tex_weight_float0 + weight_val1 * tex_weight_float1) +
+ (weight_val2 * tex_weight_float2 + weight_val3 * tex_weight_float3);
+}
+
+/**
+ * @brief Compute the infilled weight for N texel indices in a decimated grid.
+ *
+ * This is specialized version which computes only two weights per texel for
+ * encodings that are only decimated in a single axis.
+ *
+ * @param di The weight grid decimation to use.
+ * @param weights The decimated weight values to use.
+ * @param index The first texel index to interpolate.
+ *
+ * @return The interpolated weight for the given set of SIMD_WIDTH texels.
+ */
+static vfloat bilinear_infill_vla_2(
+ const decimation_info& di,
+ const float* weights,
+ unsigned int index
+) {
+ // Load the bilinear filter texel weight indexes in the decimated grid
+ vint weight_idx0 = vint(di.texel_weights_4t[0] + index);
+ vint weight_idx1 = vint(di.texel_weights_4t[1] + index);
+
+ // Load the bilinear filter weights from the decimated grid
+ vfloat weight_val0 = gatherf(weights, weight_idx0);
+ vfloat weight_val1 = gatherf(weights, weight_idx1);
+
+ // Load the weight contribution factors for each decimated weight
+ vfloat tex_weight_float0 = loada(di.texel_weights_float_4t[0] + index);
+ vfloat tex_weight_float1 = loada(di.texel_weights_float_4t[1] + index);
+
+ // Compute the bilinear interpolation to generate the per-texel weight
+ return (weight_val0 * tex_weight_float0 + weight_val1 * tex_weight_float1);
+}
+
+/**
+ * @brief Compute the ideal endpoints and weights for 1 color component.
+ *
+ * @param blk The image block color data to compress.
+ * @param pi The partition info for the current trial.
+ * @param[out] ei The computed ideal endpoints and weights.
+ * @param component The color component to compute.
+ */
+static void compute_ideal_colors_and_weights_1_comp(
+ const image_block& blk,
+ const partition_info& pi,
+ endpoints_and_weights& ei,
+ unsigned int component
+) {
+ unsigned int partition_count = pi.partition_count;
+ ei.ep.partition_count = partition_count;
+ promise(partition_count > 0);
+
+ unsigned int texel_count = blk.texel_count;
+ promise(texel_count > 0);
+
+ float error_weight;
+ const float* data_vr = nullptr;
+
+ assert(component < BLOCK_MAX_COMPONENTS);
+ switch (component)
+ {
+ case 0:
+ error_weight = blk.channel_weight.lane<0>();
+ data_vr = blk.data_r;
+ break;
+ case 1:
+ error_weight = blk.channel_weight.lane<1>();
+ data_vr = blk.data_g;
+ break;
+ case 2:
+ error_weight = blk.channel_weight.lane<2>();
+ data_vr = blk.data_b;
+ break;
+ default:
+ assert(component == 3);
+ error_weight = blk.channel_weight.lane<3>();
+ data_vr = blk.data_a;
+ break;
+ }
+
+ vmask4 sep_mask = vint4::lane_id() == vint4(component);
+ bool is_constant_wes { true };
+ float partition0_len_sq { 0.0f };
+
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ float lowvalue { 1e10f };
+ float highvalue { -1e10f };
+
+ unsigned int partition_texel_count = pi.partition_texel_count[i];
+ for (unsigned int j = 0; j < partition_texel_count; j++)
+ {
+ unsigned int tix = pi.texels_of_partition[i][j];
+ float value = data_vr[tix];
+ lowvalue = astc::min(value, lowvalue);
+ highvalue = astc::max(value, highvalue);
+ }
+
+ if (highvalue <= lowvalue)
+ {
+ lowvalue = 0.0f;
+ highvalue = 1e-7f;
+ }
+
+ float length = highvalue - lowvalue;
+ float length_squared = length * length;
+ float scale = 1.0f / length;
+
+ if (i == 0)
+ {
+ partition0_len_sq = length_squared;
+ }
+ else
+ {
+ is_constant_wes = is_constant_wes && length_squared == partition0_len_sq;
+ }
+
+ for (unsigned int j = 0; j < partition_texel_count; j++)
+ {
+ unsigned int tix = pi.texels_of_partition[i][j];
+ float value = (data_vr[tix] - lowvalue) * scale;
+ value = astc::clamp1f(value);
+
+ ei.weights[tix] = value;
+ ei.weight_error_scale[tix] = length_squared * error_weight;
+ assert(!astc::isnan(ei.weight_error_scale[tix]));
+ }
+
+ ei.ep.endpt0[i] = select(blk.data_min, vfloat4(lowvalue), sep_mask);
+ ei.ep.endpt1[i] = select(blk.data_max, vfloat4(highvalue), sep_mask);
+ }
+
+ // Zero initialize any SIMD over-fetch
+ unsigned int texel_count_simd = round_up_to_simd_multiple_vla(texel_count);
+ for (unsigned int i = texel_count; i < texel_count_simd; i++)
+ {
+ ei.weights[i] = 0.0f;
+ ei.weight_error_scale[i] = 0.0f;
+ }
+
+ ei.is_constant_weight_error_scale = is_constant_wes;
+}
+
+/**
+ * @brief Compute the ideal endpoints and weights for 2 color components.
+ *
+ * @param blk The image block color data to compress.
+ * @param pi The partition info for the current trial.
+ * @param[out] ei The computed ideal endpoints and weights.
+ * @param component1 The first color component to compute.
+ * @param component2 The second color component to compute.
+ */
+static void compute_ideal_colors_and_weights_2_comp(
+ const image_block& blk,
+ const partition_info& pi,
+ endpoints_and_weights& ei,
+ int component1,
+ int component2
+) {
+ unsigned int partition_count = pi.partition_count;
+ ei.ep.partition_count = partition_count;
+ promise(partition_count > 0);
+
+ unsigned int texel_count = blk.texel_count;
+ promise(texel_count > 0);
+
+ partition_metrics pms[BLOCK_MAX_PARTITIONS];
+
+ float error_weight;
+ const float* data_vr = nullptr;
+ const float* data_vg = nullptr;
+
+ if (component1 == 0 && component2 == 1)
+ {
+ error_weight = hadd_s(blk.channel_weight.swz<0, 1>()) / 2.0f;
+
+ data_vr = blk.data_r;
+ data_vg = blk.data_g;
+ }
+ else if (component1 == 0 && component2 == 2)
+ {
+ error_weight = hadd_s(blk.channel_weight.swz<0, 2>()) / 2.0f;
+
+ data_vr = blk.data_r;
+ data_vg = blk.data_b;
+ }
+ else // (component1 == 1 && component2 == 2)
+ {
+ assert(component1 == 1 && component2 == 2);
+
+ error_weight = hadd_s(blk.channel_weight.swz<1, 2>()) / 2.0f;
+
+ data_vr = blk.data_g;
+ data_vg = blk.data_b;
+ }
+
+ compute_avgs_and_dirs_2_comp(pi, blk, component1, component2, pms);
+
+ bool is_constant_wes { true };
+ float partition0_len_sq { 0.0f };
+
+ vmask4 comp1_mask = vint4::lane_id() == vint4(component1);
+ vmask4 comp2_mask = vint4::lane_id() == vint4(component2);
+
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ vfloat4 dir = pms[i].dir;
+ if (hadd_s(dir) < 0.0f)
+ {
+ dir = vfloat4::zero() - dir;
+ }
+
+ line2 line { pms[i].avg, normalize_safe(dir, unit2()) };
+ float lowparam { 1e10f };
+ float highparam { -1e10f };
+
+ unsigned int partition_texel_count = pi.partition_texel_count[i];
+ for (unsigned int j = 0; j < partition_texel_count; j++)
+ {
+ unsigned int tix = pi.texels_of_partition[i][j];
+ vfloat4 point = vfloat2(data_vr[tix], data_vg[tix]);
+ float param = dot_s(point - line.a, line.b);
+ ei.weights[tix] = param;
+
+ lowparam = astc::min(param, lowparam);
+ highparam = astc::max(param, highparam);
+ }
+
+ // It is possible for a uniform-color partition to produce length=0;
+ // this causes NaN issues so set to small value to avoid this problem
+ if (highparam <= lowparam)
+ {
+ lowparam = 0.0f;
+ highparam = 1e-7f;
+ }
+
+ float length = highparam - lowparam;
+ float length_squared = length * length;
+ float scale = 1.0f / length;
+
+ if (i == 0)
+ {
+ partition0_len_sq = length_squared;
+ }
+ else
+ {
+ is_constant_wes = is_constant_wes && length_squared == partition0_len_sq;
+ }
+
+ for (unsigned int j = 0; j < partition_texel_count; j++)
+ {
+ unsigned int tix = pi.texels_of_partition[i][j];
+ float idx = (ei.weights[tix] - lowparam) * scale;
+ idx = astc::clamp1f(idx);
+
+ ei.weights[tix] = idx;
+ ei.weight_error_scale[tix] = length_squared * error_weight;
+ assert(!astc::isnan(ei.weight_error_scale[tix]));
+ }
+
+ vfloat4 lowvalue = line.a + line.b * lowparam;
+ vfloat4 highvalue = line.a + line.b * highparam;
+
+ vfloat4 ep0 = select(blk.data_min, vfloat4(lowvalue.lane<0>()), comp1_mask);
+ vfloat4 ep1 = select(blk.data_max, vfloat4(highvalue.lane<0>()), comp1_mask);
+
+ ei.ep.endpt0[i] = select(ep0, vfloat4(lowvalue.lane<1>()), comp2_mask);
+ ei.ep.endpt1[i] = select(ep1, vfloat4(highvalue.lane<1>()), comp2_mask);
+ }
+
+ // Zero initialize any SIMD over-fetch
+ unsigned int texel_count_simd = round_up_to_simd_multiple_vla(texel_count);
+ for (unsigned int i = texel_count; i < texel_count_simd; i++)
+ {
+ ei.weights[i] = 0.0f;
+ ei.weight_error_scale[i] = 0.0f;
+ }
+
+ ei.is_constant_weight_error_scale = is_constant_wes;
+}
+
+/**
+ * @brief Compute the ideal endpoints and weights for 3 color components.
+ *
+ * @param blk The image block color data to compress.
+ * @param pi The partition info for the current trial.
+ * @param[out] ei The computed ideal endpoints and weights.
+ * @param omitted_component The color component excluded from the calculation.
+ */
+static void compute_ideal_colors_and_weights_3_comp(
+ const image_block& blk,
+ const partition_info& pi,
+ endpoints_and_weights& ei,
+ unsigned int omitted_component
+) {
+ unsigned int partition_count = pi.partition_count;
+ ei.ep.partition_count = partition_count;
+ promise(partition_count > 0);
+
+ unsigned int texel_count = blk.texel_count;
+ promise(texel_count > 0);
+
+ partition_metrics pms[BLOCK_MAX_PARTITIONS];
+
+ float error_weight;
+ const float* data_vr = nullptr;
+ const float* data_vg = nullptr;
+ const float* data_vb = nullptr;
+ if (omitted_component == 0)
+ {
+ error_weight = hadd_s(blk.channel_weight.swz<0, 1, 2>());
+ data_vr = blk.data_g;
+ data_vg = blk.data_b;
+ data_vb = blk.data_a;
+ }
+ else if (omitted_component == 1)
+ {
+ error_weight = hadd_s(blk.channel_weight.swz<0, 2, 3>());
+ data_vr = blk.data_r;
+ data_vg = blk.data_b;
+ data_vb = blk.data_a;
+ }
+ else if (omitted_component == 2)
+ {
+ error_weight = hadd_s(blk.channel_weight.swz<0, 1, 3>());
+ data_vr = blk.data_r;
+ data_vg = blk.data_g;
+ data_vb = blk.data_a;
+ }
+ else
+ {
+ assert(omitted_component == 3);
+
+ error_weight = hadd_s(blk.channel_weight.swz<0, 1, 2>());
+ data_vr = blk.data_r;
+ data_vg = blk.data_g;
+ data_vb = blk.data_b;
+ }
+
+ error_weight = error_weight * (1.0f / 3.0f);
+
+ if (omitted_component == 3)
+ {
+ compute_avgs_and_dirs_3_comp_rgb(pi, blk, pms);
+ }
+ else
+ {
+ compute_avgs_and_dirs_3_comp(pi, blk, omitted_component, pms);
+ }
+
+ bool is_constant_wes { true };
+ float partition0_len_sq { 0.0f };
+
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ vfloat4 dir = pms[i].dir;
+ if (hadd_rgb_s(dir) < 0.0f)
+ {
+ dir = vfloat4::zero() - dir;
+ }
+
+ line3 line { pms[i].avg, normalize_safe(dir, unit3()) };
+ float lowparam { 1e10f };
+ float highparam { -1e10f };
+
+ unsigned int partition_texel_count = pi.partition_texel_count[i];
+ for (unsigned int j = 0; j < partition_texel_count; j++)
+ {
+ unsigned int tix = pi.texels_of_partition[i][j];
+ vfloat4 point = vfloat3(data_vr[tix], data_vg[tix], data_vb[tix]);
+ float param = dot3_s(point - line.a, line.b);
+ ei.weights[tix] = param;
+
+ lowparam = astc::min(param, lowparam);
+ highparam = astc::max(param, highparam);
+ }
+
+ // It is possible for a uniform-color partition to produce length=0;
+ // this causes NaN issues so set to small value to avoid this problem
+ if (highparam <= lowparam)
+ {
+ lowparam = 0.0f;
+ highparam = 1e-7f;
+ }
+
+ float length = highparam - lowparam;
+ float length_squared = length * length;
+ float scale = 1.0f / length;
+
+ if (i == 0)
+ {
+ partition0_len_sq = length_squared;
+ }
+ else
+ {
+ is_constant_wes = is_constant_wes && length_squared == partition0_len_sq;
+ }
+
+ for (unsigned int j = 0; j < partition_texel_count; j++)
+ {
+ unsigned int tix = pi.texels_of_partition[i][j];
+ float idx = (ei.weights[tix] - lowparam) * scale;
+ idx = astc::clamp1f(idx);
+
+ ei.weights[tix] = idx;
+ ei.weight_error_scale[tix] = length_squared * error_weight;
+ assert(!astc::isnan(ei.weight_error_scale[tix]));
+ }
+
+ vfloat4 ep0 = line.a + line.b * lowparam;
+ vfloat4 ep1 = line.a + line.b * highparam;
+
+ vfloat4 bmin = blk.data_min;
+ vfloat4 bmax = blk.data_max;
+
+ assert(omitted_component < BLOCK_MAX_COMPONENTS);
+ switch (omitted_component)
+ {
+ case 0:
+ ei.ep.endpt0[i] = vfloat4(bmin.lane<0>(), ep0.lane<0>(), ep0.lane<1>(), ep0.lane<2>());
+ ei.ep.endpt1[i] = vfloat4(bmax.lane<0>(), ep1.lane<0>(), ep1.lane<1>(), ep1.lane<2>());
+ break;
+ case 1:
+ ei.ep.endpt0[i] = vfloat4(ep0.lane<0>(), bmin.lane<1>(), ep0.lane<1>(), ep0.lane<2>());
+ ei.ep.endpt1[i] = vfloat4(ep1.lane<0>(), bmax.lane<1>(), ep1.lane<1>(), ep1.lane<2>());
+ break;
+ case 2:
+ ei.ep.endpt0[i] = vfloat4(ep0.lane<0>(), ep0.lane<1>(), bmin.lane<2>(), ep0.lane<2>());
+ ei.ep.endpt1[i] = vfloat4(ep1.lane<0>(), ep1.lane<1>(), bmax.lane<2>(), ep1.lane<2>());
+ break;
+ default:
+ ei.ep.endpt0[i] = vfloat4(ep0.lane<0>(), ep0.lane<1>(), ep0.lane<2>(), bmin.lane<3>());
+ ei.ep.endpt1[i] = vfloat4(ep1.lane<0>(), ep1.lane<1>(), ep1.lane<2>(), bmax.lane<3>());
+ break;
+ }
+ }
+
+ // Zero initialize any SIMD over-fetch
+ unsigned int texel_count_simd = round_up_to_simd_multiple_vla(texel_count);
+ for (unsigned int i = texel_count; i < texel_count_simd; i++)
+ {
+ ei.weights[i] = 0.0f;
+ ei.weight_error_scale[i] = 0.0f;
+ }
+
+ ei.is_constant_weight_error_scale = is_constant_wes;
+}
+
+/**
+ * @brief Compute the ideal endpoints and weights for 4 color components.
+ *
+ * @param blk The image block color data to compress.
+ * @param pi The partition info for the current trial.
+ * @param[out] ei The computed ideal endpoints and weights.
+ */
+static void compute_ideal_colors_and_weights_4_comp(
+ const image_block& blk,
+ const partition_info& pi,
+ endpoints_and_weights& ei
+) {
+ const float error_weight = hadd_s(blk.channel_weight) / 4.0f;
+
+ unsigned int partition_count = pi.partition_count;
+
+ unsigned int texel_count = blk.texel_count;
+ promise(texel_count > 0);
+ promise(partition_count > 0);
+
+ partition_metrics pms[BLOCK_MAX_PARTITIONS];
+
+ compute_avgs_and_dirs_4_comp(pi, blk, pms);
+
+ bool is_constant_wes { true };
+ float partition0_len_sq { 0.0f };
+
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ vfloat4 dir = pms[i].dir;
+ if (hadd_rgb_s(dir) < 0.0f)
+ {
+ dir = vfloat4::zero() - dir;
+ }
+
+ line4 line { pms[i].avg, normalize_safe(dir, unit4()) };
+ float lowparam { 1e10f };
+ float highparam { -1e10f };
+
+ unsigned int partition_texel_count = pi.partition_texel_count[i];
+ for (unsigned int j = 0; j < partition_texel_count; j++)
+ {
+ unsigned int tix = pi.texels_of_partition[i][j];
+ vfloat4 point = blk.texel(tix);
+ float param = dot_s(point - line.a, line.b);
+ ei.weights[tix] = param;
+
+ lowparam = astc::min(param, lowparam);
+ highparam = astc::max(param, highparam);
+ }
+
+ // It is possible for a uniform-color partition to produce length=0;
+ // this causes NaN issues so set to small value to avoid this problem
+ if (highparam <= lowparam)
+ {
+ lowparam = 0.0f;
+ highparam = 1e-7f;
+ }
+
+ float length = highparam - lowparam;
+ float length_squared = length * length;
+ float scale = 1.0f / length;
+
+ if (i == 0)
+ {
+ partition0_len_sq = length_squared;
+ }
+ else
+ {
+ is_constant_wes = is_constant_wes && length_squared == partition0_len_sq;
+ }
+
+ ei.ep.endpt0[i] = line.a + line.b * lowparam;
+ ei.ep.endpt1[i] = line.a + line.b * highparam;
+
+ for (unsigned int j = 0; j < partition_texel_count; j++)
+ {
+ unsigned int tix = pi.texels_of_partition[i][j];
+ float idx = (ei.weights[tix] - lowparam) * scale;
+ idx = astc::clamp1f(idx);
+
+ ei.weights[tix] = idx;
+ ei.weight_error_scale[tix] = length_squared * error_weight;
+ assert(!astc::isnan(ei.weight_error_scale[tix]));
+ }
+ }
+
+ // Zero initialize any SIMD over-fetch
+ unsigned int texel_count_simd = round_up_to_simd_multiple_vla(texel_count);
+ for (unsigned int i = texel_count; i < texel_count_simd; i++)
+ {
+ ei.weights[i] = 0.0f;
+ ei.weight_error_scale[i] = 0.0f;
+ }
+
+ ei.is_constant_weight_error_scale = is_constant_wes;
+}
+
+/* See header for documentation. */
+void compute_ideal_colors_and_weights_1plane(
+ const image_block& blk,
+ const partition_info& pi,
+ endpoints_and_weights& ei
+) {
+ bool uses_alpha = !blk.is_constant_channel(3);
+
+ if (uses_alpha)
+ {
+ compute_ideal_colors_and_weights_4_comp(blk, pi, ei);
+ }
+ else
+ {
+ compute_ideal_colors_and_weights_3_comp(blk, pi, ei, 3);
+ }
+}
+
+/* See header for documentation. */
+void compute_ideal_colors_and_weights_2planes(
+ const block_size_descriptor& bsd,
+ const image_block& blk,
+ unsigned int plane2_component,
+ endpoints_and_weights& ei1,
+ endpoints_and_weights& ei2
+) {
+ const auto& pi = bsd.get_partition_info(1, 0);
+ bool uses_alpha = !blk.is_constant_channel(3);
+
+ assert(plane2_component < BLOCK_MAX_COMPONENTS);
+ switch (plane2_component)
+ {
+ case 0: // Separate weights for red
+ if (uses_alpha)
+ {
+ compute_ideal_colors_and_weights_3_comp(blk, pi, ei1, 0);
+ }
+ else
+ {
+ compute_ideal_colors_and_weights_2_comp(blk, pi, ei1, 1, 2);
+ }
+ compute_ideal_colors_and_weights_1_comp(blk, pi, ei2, 0);
+ break;
+
+ case 1: // Separate weights for green
+ if (uses_alpha)
+ {
+ compute_ideal_colors_and_weights_3_comp(blk, pi, ei1, 1);
+ }
+ else
+ {
+ compute_ideal_colors_and_weights_2_comp(blk, pi, ei1, 0, 2);
+ }
+ compute_ideal_colors_and_weights_1_comp(blk, pi, ei2, 1);
+ break;
+
+ case 2: // Separate weights for blue
+ if (uses_alpha)
+ {
+ compute_ideal_colors_and_weights_3_comp(blk, pi, ei1, 2);
+ }
+ else
+ {
+ compute_ideal_colors_and_weights_2_comp(blk, pi, ei1, 0, 1);
+ }
+ compute_ideal_colors_and_weights_1_comp(blk, pi, ei2, 2);
+ break;
+
+ default: // Separate weights for alpha
+ assert(uses_alpha);
+ compute_ideal_colors_and_weights_3_comp(blk, pi, ei1, 3);
+ compute_ideal_colors_and_weights_1_comp(blk, pi, ei2, 3);
+ break;
+ }
+}
+
+/* See header for documentation. */
+float compute_error_of_weight_set_1plane(
+ const endpoints_and_weights& eai,
+ const decimation_info& di,
+ const float* dec_weight_quant_uvalue
+) {
+ vfloatacc error_summav = vfloatacc::zero();
+ unsigned int texel_count = di.texel_count;
+
+ // Process SIMD-width chunks, safe to over-fetch - the extra space is zero initialized
+ if (di.max_texel_weight_count > 2)
+ {
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ // Compute the bilinear interpolation of the decimated weight grid
+ vfloat current_values = bilinear_infill_vla(di, dec_weight_quant_uvalue, i);
+
+ // Compute the error between the computed value and the ideal weight
+ vfloat actual_values = loada(eai.weights + i);
+ vfloat diff = current_values - actual_values;
+ vfloat significance = loada(eai.weight_error_scale + i);
+ vfloat error = diff * diff * significance;
+
+ haccumulate(error_summav, error);
+ }
+ }
+ else if (di.max_texel_weight_count > 1)
+ {
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ // Compute the bilinear interpolation of the decimated weight grid
+ vfloat current_values = bilinear_infill_vla_2(di, dec_weight_quant_uvalue, i);
+
+ // Compute the error between the computed value and the ideal weight
+ vfloat actual_values = loada(eai.weights + i);
+ vfloat diff = current_values - actual_values;
+ vfloat significance = loada(eai.weight_error_scale + i);
+ vfloat error = diff * diff * significance;
+
+ haccumulate(error_summav, error);
+ }
+ }
+ else
+ {
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ // Load the weight set directly, without interpolation
+ vfloat current_values = loada(dec_weight_quant_uvalue + i);
+
+ // Compute the error between the computed value and the ideal weight
+ vfloat actual_values = loada(eai.weights + i);
+ vfloat diff = current_values - actual_values;
+ vfloat significance = loada(eai.weight_error_scale + i);
+ vfloat error = diff * diff * significance;
+
+ haccumulate(error_summav, error);
+ }
+ }
+
+ // Resolve the final scalar accumulator sum
+ return hadd_s(error_summav);
+}
+
+/* See header for documentation. */
+float compute_error_of_weight_set_2planes(
+ const endpoints_and_weights& eai1,
+ const endpoints_and_weights& eai2,
+ const decimation_info& di,
+ const float* dec_weight_quant_uvalue_plane1,
+ const float* dec_weight_quant_uvalue_plane2
+) {
+ vfloatacc error_summav = vfloatacc::zero();
+ unsigned int texel_count = di.texel_count;
+
+ // Process SIMD-width chunks, safe to over-fetch - the extra space is zero initialized
+ if (di.max_texel_weight_count > 2)
+ {
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ // Plane 1
+ // Compute the bilinear interpolation of the decimated weight grid
+ vfloat current_values1 = bilinear_infill_vla(di, dec_weight_quant_uvalue_plane1, i);
+
+ // Compute the error between the computed value and the ideal weight
+ vfloat actual_values1 = loada(eai1.weights + i);
+ vfloat diff = current_values1 - actual_values1;
+ vfloat error1 = diff * diff * loada(eai1.weight_error_scale + i);
+
+ // Plane 2
+ // Compute the bilinear interpolation of the decimated weight grid
+ vfloat current_values2 = bilinear_infill_vla(di, dec_weight_quant_uvalue_plane2, i);
+
+ // Compute the error between the computed value and the ideal weight
+ vfloat actual_values2 = loada(eai2.weights + i);
+ diff = current_values2 - actual_values2;
+ vfloat error2 = diff * diff * loada(eai2.weight_error_scale + i);
+
+ haccumulate(error_summav, error1 + error2);
+ }
+ }
+ else if (di.max_texel_weight_count > 1)
+ {
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ // Plane 1
+ // Compute the bilinear interpolation of the decimated weight grid
+ vfloat current_values1 = bilinear_infill_vla_2(di, dec_weight_quant_uvalue_plane1, i);
+
+ // Compute the error between the computed value and the ideal weight
+ vfloat actual_values1 = loada(eai1.weights + i);
+ vfloat diff = current_values1 - actual_values1;
+ vfloat error1 = diff * diff * loada(eai1.weight_error_scale + i);
+
+ // Plane 2
+ // Compute the bilinear interpolation of the decimated weight grid
+ vfloat current_values2 = bilinear_infill_vla_2(di, dec_weight_quant_uvalue_plane2, i);
+
+ // Compute the error between the computed value and the ideal weight
+ vfloat actual_values2 = loada(eai2.weights + i);
+ diff = current_values2 - actual_values2;
+ vfloat error2 = diff * diff * loada(eai2.weight_error_scale + i);
+
+ haccumulate(error_summav, error1 + error2);
+ }
+ }
+ else
+ {
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ // Plane 1
+ // Load the weight set directly, without interpolation
+ vfloat current_values1 = loada(dec_weight_quant_uvalue_plane1 + i);
+
+ // Compute the error between the computed value and the ideal weight
+ vfloat actual_values1 = loada(eai1.weights + i);
+ vfloat diff = current_values1 - actual_values1;
+ vfloat error1 = diff * diff * loada(eai1.weight_error_scale + i);
+
+ // Plane 2
+ // Load the weight set directly, without interpolation
+ vfloat current_values2 = loada(dec_weight_quant_uvalue_plane2 + i);
+
+ // Compute the error between the computed value and the ideal weight
+ vfloat actual_values2 = loada(eai2.weights + i);
+ diff = current_values2 - actual_values2;
+ vfloat error2 = diff * diff * loada(eai2.weight_error_scale + i);
+
+ haccumulate(error_summav, error1 + error2);
+ }
+ }
+
+ // Resolve the final scalar accumulator sum
+ return hadd_s(error_summav);
+}
+
+/* See header for documentation. */
+void compute_ideal_weights_for_decimation(
+ const endpoints_and_weights& ei,
+ const decimation_info& di,
+ float* dec_weight_ideal_value
+) {
+ unsigned int texel_count = di.texel_count;
+ unsigned int weight_count = di.weight_count;
+ bool is_direct = texel_count == weight_count;
+ promise(texel_count > 0);
+ promise(weight_count > 0);
+
+ // Ensure that the end of the output arrays that are used for SIMD paths later are filled so we
+ // can safely run SIMD elsewhere without a loop tail. Note that this is always safe as weight
+ // arrays always contain space for 64 elements
+ unsigned int prev_weight_count_simd = round_down_to_simd_multiple_vla(weight_count - 1);
+ storea(vfloat::zero(), dec_weight_ideal_value + prev_weight_count_simd);
+
+ // If we have a 1:1 mapping just shortcut the computation. Transfer enough to also copy the
+ // zero-initialized SIMD over-fetch region
+ if (is_direct)
+ {
+ unsigned int texel_count_simd = round_up_to_simd_multiple_vla(texel_count);
+ for (unsigned int i = 0; i < texel_count_simd; i += ASTCENC_SIMD_WIDTH)
+ {
+ vfloat weight(ei.weights + i);
+ storea(weight, dec_weight_ideal_value + i);
+ }
+
+ return;
+ }
+
+ // Otherwise compute an estimate and perform single refinement iteration
+ alignas(ASTCENC_VECALIGN) float infilled_weights[BLOCK_MAX_TEXELS];
+
+ // Compute an initial average for each decimated weight
+ bool constant_wes = ei.is_constant_weight_error_scale;
+ vfloat weight_error_scale(ei.weight_error_scale[0]);
+
+ // This overshoots - this is OK as we initialize the array tails in the
+ // decimation table structures to safe values ...
+ for (unsigned int i = 0; i < weight_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ // Start with a small value to avoid div-by-zero later
+ vfloat weight_weight(1e-10f);
+ vfloat initial_weight = vfloat::zero();
+
+ // Accumulate error weighting of all the texels using this weight
+ vint weight_texel_count(di.weight_texel_count + i);
+ unsigned int max_texel_count = hmax(weight_texel_count).lane<0>();
+ promise(max_texel_count > 0);
+
+ for (unsigned int j = 0; j < max_texel_count; j++)
+ {
+ vint texel(di.weight_texel[j] + i);
+ vfloat weight = loada(di.weights_flt[j] + i);
+
+ if (!constant_wes)
+ {
+ weight_error_scale = gatherf(ei.weight_error_scale, texel);
+ }
+
+ vfloat contrib_weight = weight * weight_error_scale;
+
+ weight_weight += contrib_weight;
+ initial_weight += gatherf(ei.weights, texel) * contrib_weight;
+ }
+
+ storea(initial_weight / weight_weight, dec_weight_ideal_value + i);
+ }
+
+ // Populate the interpolated weight grid based on the initial average
+ // Process SIMD-width texel coordinates at at time while we can. Safe to
+ // over-process full SIMD vectors - the tail is zeroed.
+ if (di.max_texel_weight_count <= 2)
+ {
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vfloat weight = bilinear_infill_vla_2(di, dec_weight_ideal_value, i);
+ storea(weight, infilled_weights + i);
+ }
+ }
+ else
+ {
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vfloat weight = bilinear_infill_vla(di, dec_weight_ideal_value, i);
+ storea(weight, infilled_weights + i);
+ }
+ }
+
+ // Perform a single iteration of refinement
+ // Empirically determined step size; larger values don't help but smaller drops image quality
+ constexpr float stepsize = 0.25f;
+ constexpr float chd_scale = -WEIGHTS_TEXEL_SUM;
+
+ for (unsigned int i = 0; i < weight_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vfloat weight_val = loada(dec_weight_ideal_value + i);
+
+ // Accumulate error weighting of all the texels using this weight
+ // Start with a small value to avoid div-by-zero later
+ vfloat error_change0(1e-10f);
+ vfloat error_change1(0.0f);
+
+ // Accumulate error weighting of all the texels using this weight
+ vint weight_texel_count(di.weight_texel_count + i);
+ unsigned int max_texel_count = hmax(weight_texel_count).lane<0>();
+ promise(max_texel_count > 0);
+
+ for (unsigned int j = 0; j < max_texel_count; j++)
+ {
+ vint texel(di.weight_texel[j] + i);
+ vfloat contrib_weight = loada(di.weights_flt[j] + i);
+
+ if (!constant_wes)
+ {
+ weight_error_scale = gatherf(ei.weight_error_scale, texel);
+ }
+
+ vfloat scale = weight_error_scale * contrib_weight;
+ vfloat old_weight = gatherf(infilled_weights, texel);
+ vfloat ideal_weight = gatherf(ei.weights, texel);
+
+ error_change0 += contrib_weight * scale;
+ error_change1 += (old_weight - ideal_weight) * scale;
+ }
+
+ vfloat step = (error_change1 * chd_scale) / error_change0;
+ step = clamp(-stepsize, stepsize, step);
+
+ // Update the weight; note this can store negative values.
+ storea(weight_val + step, dec_weight_ideal_value + i);
+ }
+}
+
+/* See header for documentation. */
+void compute_quantized_weights_for_decimation(
+ const decimation_info& di,
+ float low_bound,
+ float high_bound,
+ const float* dec_weight_ideal_value,
+ float* weight_set_out,
+ uint8_t* quantized_weight_set,
+ quant_method quant_level
+) {
+ int weight_count = di.weight_count;
+ promise(weight_count > 0);
+ const quant_and_transfer_table& qat = quant_and_xfer_tables[quant_level];
+
+ // The available quant levels, stored with a minus 1 bias
+ static const float quant_levels_m1[12] {
+ 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 7.0f, 9.0f, 11.0f, 15.0f, 19.0f, 23.0f, 31.0f
+ };
+
+ vint steps_m1(get_quant_level(quant_level) - 1);
+ float quant_level_m1 = quant_levels_m1[quant_level];
+
+ // Quantize the weight set using both the specified low/high bounds and standard 0..1 bounds
+
+ // TODO: Oddity to investigate; triggered by test in issue #265.
+ if (high_bound <= low_bound)
+ {
+ low_bound = 0.0f;
+ high_bound = 1.0f;
+ }
+
+ float rscale = high_bound - low_bound;
+ float scale = 1.0f / rscale;
+
+ float scaled_low_bound = low_bound * scale;
+ rscale *= 1.0f / 64.0f;
+
+ vfloat scalev(scale);
+ vfloat scaled_low_boundv(scaled_low_bound);
+ vfloat quant_level_m1v(quant_level_m1);
+ vfloat rscalev(rscale);
+ vfloat low_boundv(low_bound);
+
+ // This runs to the rounded-up SIMD size, which is safe as the loop tail is filled with known
+ // safe data in compute_ideal_weights_for_decimation and arrays are always 64 elements
+ if (get_quant_level(quant_level) <= 16)
+ {
+ vint4 tab0(reinterpret_cast<const int*>(qat.quant_to_unquant));
+ vint tab0p;
+ vtable_prepare(tab0, tab0p);
+
+ for (int i = 0; i < weight_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vfloat ix = loada(dec_weight_ideal_value + i) * scalev - scaled_low_boundv;
+ ix = clampzo(ix);
+
+ // Look up the two closest indexes and return the one that was closest
+ vfloat ix1 = ix * quant_level_m1v;
+
+ vint weightl = float_to_int(ix1);
+ vint weighth = min(weightl + vint(1), steps_m1);
+
+ vint ixli = vtable_8bt_32bi(tab0p, weightl);
+ vint ixhi = vtable_8bt_32bi(tab0p, weighth);
+
+ vfloat ixl = int_to_float(ixli);
+ vfloat ixh = int_to_float(ixhi);
+
+ vmask mask = (ixl + ixh) < (vfloat(128.0f) * ix);
+ vint weight = select(ixli, ixhi, mask);
+ ixl = select(ixl, ixh, mask);
+
+ // Invert the weight-scaling that was done initially
+ storea(ixl * rscalev + low_boundv, weight_set_out + i);
+ vint scn = pack_low_bytes(weight);
+ store_nbytes(scn, quantized_weight_set + i);
+ }
+ }
+ else
+ {
+ vint4 tab0(reinterpret_cast<const int*>(qat.quant_to_unquant));
+ vint4 tab1(reinterpret_cast<const int*>(qat.quant_to_unquant + 16));
+ vint tab0p, tab1p;
+ vtable_prepare(tab0, tab1, tab0p, tab1p);
+
+ for (int i = 0; i < weight_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vfloat ix = loada(dec_weight_ideal_value + i) * scalev - scaled_low_boundv;
+ ix = clampzo(ix);
+
+ // Look up the two closest indexes and return the one that was closest
+ vfloat ix1 = ix * quant_level_m1v;
+
+ vint weightl = float_to_int(ix1);
+ vint weighth = min(weightl + vint(1), steps_m1);
+
+ vint ixli = vtable_8bt_32bi(tab0p, tab1p, weightl);
+ vint ixhi = vtable_8bt_32bi(tab0p, tab1p, weighth);
+
+ vfloat ixl = int_to_float(ixli);
+ vfloat ixh = int_to_float(ixhi);
+
+ vmask mask = (ixl + ixh) < (vfloat(128.0f) * ix);
+ vint weight = select(ixli, ixhi, mask);
+ ixl = select(ixl, ixh, mask);
+
+ // Invert the weight-scaling that was done initially
+ storea(ixl * rscalev + low_boundv, weight_set_out + i);
+ vint scn = pack_low_bytes(weight);
+ store_nbytes(scn, quantized_weight_set + i);
+ }
+ }
+}
+
+/**
+ * @brief Compute the RGB + offset for a HDR endpoint mode #7.
+ *
+ * Since the matrix needed has a regular structure we can simplify the inverse calculation. This
+ * gives us ~24 multiplications vs. 96 for a generic inverse.
+ *
+ * mat[0] = vfloat4(rgba_ws.x, 0.0f, 0.0f, wght_ws.x);
+ * mat[1] = vfloat4( 0.0f, rgba_ws.y, 0.0f, wght_ws.y);
+ * mat[2] = vfloat4( 0.0f, 0.0f, rgba_ws.z, wght_ws.z);
+ * mat[3] = vfloat4(wght_ws.x, wght_ws.y, wght_ws.z, psum);
+ * mat = invert(mat);
+ *
+ * @param rgba_weight_sum Sum of partition component error weights.
+ * @param weight_weight_sum Sum of partition component error weights * texel weight.
+ * @param rgbq_sum Sum of partition component error weights * texel weight * color data.
+ * @param psum Sum of RGB color weights * texel weight^2.
+ */
+static inline vfloat4 compute_rgbo_vector(
+ vfloat4 rgba_weight_sum,
+ vfloat4 weight_weight_sum,
+ vfloat4 rgbq_sum,
+ float psum
+) {
+ float X = rgba_weight_sum.lane<0>();
+ float Y = rgba_weight_sum.lane<1>();
+ float Z = rgba_weight_sum.lane<2>();
+ float P = weight_weight_sum.lane<0>();
+ float Q = weight_weight_sum.lane<1>();
+ float R = weight_weight_sum.lane<2>();
+ float S = psum;
+
+ float PP = P * P;
+ float QQ = Q * Q;
+ float RR = R * R;
+
+ float SZmRR = S * Z - RR;
+ float DT = SZmRR * Y - Z * QQ;
+ float YP = Y * P;
+ float QX = Q * X;
+ float YX = Y * X;
+ float mZYP = -Z * YP;
+ float mZQX = -Z * QX;
+ float mRYX = -R * YX;
+ float ZQP = Z * Q * P;
+ float RYP = R * YP;
+ float RQX = R * QX;
+
+ // Compute the reciprocal of matrix determinant
+ float rdet = 1.0f / (DT * X + mZYP * P);
+
+ // Actually compute the adjugate, and then apply 1/det separately
+ vfloat4 mat0(DT, ZQP, RYP, mZYP);
+ vfloat4 mat1(ZQP, SZmRR * X - Z * PP, RQX, mZQX);
+ vfloat4 mat2(RYP, RQX, (S * Y - QQ) * X - Y * PP, mRYX);
+ vfloat4 mat3(mZYP, mZQX, mRYX, Z * YX);
+ vfloat4 vect = rgbq_sum * rdet;
+
+ return vfloat4(dot_s(mat0, vect),
+ dot_s(mat1, vect),
+ dot_s(mat2, vect),
+ dot_s(mat3, vect));
+}
+
+/* See header for documentation. */
+void recompute_ideal_colors_1plane(
+ const image_block& blk,
+ const partition_info& pi,
+ const decimation_info& di,
+ const uint8_t* dec_weights_uquant,
+ endpoints& ep,
+ vfloat4 rgbs_vectors[BLOCK_MAX_PARTITIONS],
+ vfloat4 rgbo_vectors[BLOCK_MAX_PARTITIONS]
+) {
+ unsigned int weight_count = di.weight_count;
+ unsigned int total_texel_count = blk.texel_count;
+ unsigned int partition_count = pi.partition_count;
+
+ promise(weight_count > 0);
+ promise(total_texel_count > 0);
+ promise(partition_count > 0);
+
+ alignas(ASTCENC_VECALIGN) float dec_weight[BLOCK_MAX_WEIGHTS];
+ for (unsigned int i = 0; i < weight_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vint unquant_value(dec_weights_uquant + i);
+ vfloat unquant_valuef = int_to_float(unquant_value) * vfloat(1.0f / 64.0f);
+ storea(unquant_valuef, dec_weight + i);
+ }
+
+ alignas(ASTCENC_VECALIGN) float undec_weight[BLOCK_MAX_TEXELS];
+ float* undec_weight_ref;
+ if (di.max_texel_weight_count == 1)
+ {
+ undec_weight_ref = dec_weight;
+ }
+ else if (di.max_texel_weight_count <= 2)
+ {
+ for (unsigned int i = 0; i < total_texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vfloat weight = bilinear_infill_vla_2(di, dec_weight, i);
+ storea(weight, undec_weight + i);
+ }
+
+ undec_weight_ref = undec_weight;
+ }
+ else
+ {
+ for (unsigned int i = 0; i < total_texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vfloat weight = bilinear_infill_vla(di, dec_weight, i);
+ storea(weight, undec_weight + i);
+ }
+
+ undec_weight_ref = undec_weight;
+ }
+
+ vfloat4 rgba_sum(blk.data_mean * static_cast<float>(blk.texel_count));
+
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ unsigned int texel_count = pi.partition_texel_count[i];
+ const uint8_t *texel_indexes = pi.texels_of_partition[i];
+
+ // Only compute a partition mean if more than one partition
+ if (partition_count > 1)
+ {
+ rgba_sum = vfloat4(1e-17f);
+ promise(texel_count > 0);
+ for (unsigned int j = 0; j < texel_count; j++)
+ {
+ unsigned int tix = texel_indexes[j];
+ rgba_sum += blk.texel(tix);
+ }
+ }
+
+ rgba_sum = rgba_sum * blk.channel_weight;
+ vfloat4 rgba_weight_sum = max(blk.channel_weight * static_cast<float>(texel_count), 1e-17f);
+ vfloat4 scale_dir = normalize((rgba_sum / rgba_weight_sum).swz<0, 1, 2>());
+
+ float scale_max = 0.0f;
+ float scale_min = 1e10f;
+
+ float wmin1 = 1.0f;
+ float wmax1 = 0.0f;
+
+ float left_sum_s = 0.0f;
+ float middle_sum_s = 0.0f;
+ float right_sum_s = 0.0f;
+
+ vfloat4 color_vec_x = vfloat4::zero();
+ vfloat4 color_vec_y = vfloat4::zero();
+
+ vfloat4 scale_vec = vfloat4::zero();
+
+ float weight_weight_sum_s = 1e-17f;
+
+ vfloat4 color_weight = blk.channel_weight;
+ float ls_weight = hadd_rgb_s(color_weight);
+
+ for (unsigned int j = 0; j < texel_count; j++)
+ {
+ unsigned int tix = texel_indexes[j];
+
+ vfloat4 rgba = blk.texel(tix);
+
+ float idx0 = undec_weight_ref[tix];
+
+ float om_idx0 = 1.0f - idx0;
+ wmin1 = astc::min(idx0, wmin1);
+ wmax1 = astc::max(idx0, wmax1);
+
+ float scale = dot3_s(scale_dir, rgba);
+ scale_min = astc::min(scale, scale_min);
+ scale_max = astc::max(scale, scale_max);
+
+ left_sum_s += om_idx0 * om_idx0;
+ middle_sum_s += om_idx0 * idx0;
+ right_sum_s += idx0 * idx0;
+ weight_weight_sum_s += idx0;
+
+ vfloat4 color_idx(idx0);
+ vfloat4 cwprod = rgba;
+ vfloat4 cwiprod = cwprod * color_idx;
+
+ color_vec_y += cwiprod;
+ color_vec_x += cwprod - cwiprod;
+
+ scale_vec += vfloat2(om_idx0, idx0) * (scale * ls_weight);
+ }
+
+ vfloat4 left_sum = vfloat4(left_sum_s) * color_weight;
+ vfloat4 middle_sum = vfloat4(middle_sum_s) * color_weight;
+ vfloat4 right_sum = vfloat4(right_sum_s) * color_weight;
+ vfloat4 lmrs_sum = vfloat3(left_sum_s, middle_sum_s, right_sum_s) * ls_weight;
+
+ vfloat4 weight_weight_sum = vfloat4(weight_weight_sum_s) * color_weight;
+ float psum = right_sum_s * hadd_rgb_s(color_weight);
+
+ color_vec_x = color_vec_x * color_weight;
+ color_vec_y = color_vec_y * color_weight;
+
+ // Initialize the luminance and scale vectors with a reasonable default
+ float scalediv = scale_min / astc::max(scale_max, 1e-10f);
+ scalediv = astc::clamp1f(scalediv);
+
+ vfloat4 sds = scale_dir * scale_max;
+
+ rgbs_vectors[i] = vfloat4(sds.lane<0>(), sds.lane<1>(), sds.lane<2>(), scalediv);
+
+ if (wmin1 >= wmax1 * 0.999f)
+ {
+ // If all weights in the partition were equal, then just take average of all colors in
+ // the partition and use that as both endpoint colors
+ vfloat4 avg = (color_vec_x + color_vec_y) / rgba_weight_sum;
+
+ vmask4 notnan_mask = avg == avg;
+ ep.endpt0[i] = select(ep.endpt0[i], avg, notnan_mask);
+ ep.endpt1[i] = select(ep.endpt1[i], avg, notnan_mask);
+
+ rgbs_vectors[i] = vfloat4(sds.lane<0>(), sds.lane<1>(), sds.lane<2>(), 1.0f);
+ }
+ else
+ {
+ // Otherwise, complete the analytic calculation of ideal-endpoint-values for the given
+ // set of texel weights and pixel colors
+ vfloat4 color_det1 = (left_sum * right_sum) - (middle_sum * middle_sum);
+ vfloat4 color_rdet1 = 1.0f / color_det1;
+
+ float ls_det1 = (lmrs_sum.lane<0>() * lmrs_sum.lane<2>()) - (lmrs_sum.lane<1>() * lmrs_sum.lane<1>());
+ float ls_rdet1 = 1.0f / ls_det1;
+
+ vfloat4 color_mss1 = (left_sum * left_sum)
+ + (2.0f * middle_sum * middle_sum)
+ + (right_sum * right_sum);
+
+ float ls_mss1 = (lmrs_sum.lane<0>() * lmrs_sum.lane<0>())
+ + (2.0f * lmrs_sum.lane<1>() * lmrs_sum.lane<1>())
+ + (lmrs_sum.lane<2>() * lmrs_sum.lane<2>());
+
+ vfloat4 ep0 = (right_sum * color_vec_x - middle_sum * color_vec_y) * color_rdet1;
+ vfloat4 ep1 = (left_sum * color_vec_y - middle_sum * color_vec_x) * color_rdet1;
+
+ vmask4 det_mask = abs(color_det1) > (color_mss1 * 1e-4f);
+ vmask4 notnan_mask = (ep0 == ep0) & (ep1 == ep1);
+ vmask4 full_mask = det_mask & notnan_mask;
+
+ ep.endpt0[i] = select(ep.endpt0[i], ep0, full_mask);
+ ep.endpt1[i] = select(ep.endpt1[i], ep1, full_mask);
+
+ float scale_ep0 = (lmrs_sum.lane<2>() * scale_vec.lane<0>() - lmrs_sum.lane<1>() * scale_vec.lane<1>()) * ls_rdet1;
+ float scale_ep1 = (lmrs_sum.lane<0>() * scale_vec.lane<1>() - lmrs_sum.lane<1>() * scale_vec.lane<0>()) * ls_rdet1;
+
+ if (fabsf(ls_det1) > (ls_mss1 * 1e-4f) && scale_ep0 == scale_ep0 && scale_ep1 == scale_ep1 && scale_ep0 < scale_ep1)
+ {
+ float scalediv2 = scale_ep0 / scale_ep1;
+ vfloat4 sdsm = scale_dir * scale_ep1;
+ rgbs_vectors[i] = vfloat4(sdsm.lane<0>(), sdsm.lane<1>(), sdsm.lane<2>(), scalediv2);
+ }
+ }
+
+ // Calculations specific to mode #7, the HDR RGB-scale mode
+ vfloat4 rgbq_sum = color_vec_x + color_vec_y;
+ rgbq_sum.set_lane<3>(hadd_rgb_s(color_vec_y));
+
+ vfloat4 rgbovec = compute_rgbo_vector(rgba_weight_sum, weight_weight_sum, rgbq_sum, psum);
+ rgbo_vectors[i] = rgbovec;
+
+ // We can get a failure due to the use of a singular (non-invertible) matrix
+ // If it failed, compute rgbo_vectors[] with a different method ...
+ if (astc::isnan(dot_s(rgbovec, rgbovec)))
+ {
+ vfloat4 v0 = ep.endpt0[i];
+ vfloat4 v1 = ep.endpt1[i];
+
+ float avgdif = hadd_rgb_s(v1 - v0) * (1.0f / 3.0f);
+ avgdif = astc::max(avgdif, 0.0f);
+
+ vfloat4 avg = (v0 + v1) * 0.5f;
+ vfloat4 ep0 = avg - vfloat4(avgdif) * 0.5f;
+ rgbo_vectors[i] = vfloat4(ep0.lane<0>(), ep0.lane<1>(), ep0.lane<2>(), avgdif);
+ }
+ }
+}
+
+/* See header for documentation. */
+void recompute_ideal_colors_2planes(
+ const image_block& blk,
+ const block_size_descriptor& bsd,
+ const decimation_info& di,
+ const uint8_t* dec_weights_uquant_plane1,
+ const uint8_t* dec_weights_uquant_plane2,
+ endpoints& ep,
+ vfloat4& rgbs_vector,
+ vfloat4& rgbo_vector,
+ int plane2_component
+) {
+ unsigned int weight_count = di.weight_count;
+ unsigned int total_texel_count = blk.texel_count;
+
+ promise(total_texel_count > 0);
+ promise(weight_count > 0);
+
+ alignas(ASTCENC_VECALIGN) float dec_weight_plane1[BLOCK_MAX_WEIGHTS_2PLANE];
+ alignas(ASTCENC_VECALIGN) float dec_weight_plane2[BLOCK_MAX_WEIGHTS_2PLANE];
+
+ assert(weight_count <= BLOCK_MAX_WEIGHTS_2PLANE);
+
+ for (unsigned int i = 0; i < weight_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vint unquant_value1(dec_weights_uquant_plane1 + i);
+ vfloat unquant_value1f = int_to_float(unquant_value1) * vfloat(1.0f / 64.0f);
+ storea(unquant_value1f, dec_weight_plane1 + i);
+
+ vint unquant_value2(dec_weights_uquant_plane2 + i);
+ vfloat unquant_value2f = int_to_float(unquant_value2) * vfloat(1.0f / 64.0f);
+ storea(unquant_value2f, dec_weight_plane2 + i);
+ }
+
+ alignas(ASTCENC_VECALIGN) float undec_weight_plane1[BLOCK_MAX_TEXELS];
+ alignas(ASTCENC_VECALIGN) float undec_weight_plane2[BLOCK_MAX_TEXELS];
+
+ float* undec_weight_plane1_ref;
+ float* undec_weight_plane2_ref;
+
+ if (di.max_texel_weight_count == 1)
+ {
+ undec_weight_plane1_ref = dec_weight_plane1;
+ undec_weight_plane2_ref = dec_weight_plane2;
+ }
+ else if (di.max_texel_weight_count <= 2)
+ {
+ for (unsigned int i = 0; i < total_texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vfloat weight = bilinear_infill_vla_2(di, dec_weight_plane1, i);
+ storea(weight, undec_weight_plane1 + i);
+
+ weight = bilinear_infill_vla_2(di, dec_weight_plane2, i);
+ storea(weight, undec_weight_plane2 + i);
+ }
+
+ undec_weight_plane1_ref = undec_weight_plane1;
+ undec_weight_plane2_ref = undec_weight_plane2;
+ }
+ else
+ {
+ for (unsigned int i = 0; i < total_texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vfloat weight = bilinear_infill_vla(di, dec_weight_plane1, i);
+ storea(weight, undec_weight_plane1 + i);
+
+ weight = bilinear_infill_vla(di, dec_weight_plane2, i);
+ storea(weight, undec_weight_plane2 + i);
+ }
+
+ undec_weight_plane1_ref = undec_weight_plane1;
+ undec_weight_plane2_ref = undec_weight_plane2;
+ }
+
+ unsigned int texel_count = bsd.texel_count;
+ vfloat4 rgba_weight_sum = max(blk.channel_weight * static_cast<float>(texel_count), 1e-17f);
+ vfloat4 scale_dir = normalize(blk.data_mean.swz<0, 1, 2>());
+
+ float scale_max = 0.0f;
+ float scale_min = 1e10f;
+
+ float wmin1 = 1.0f;
+ float wmax1 = 0.0f;
+
+ float wmin2 = 1.0f;
+ float wmax2 = 0.0f;
+
+ float left1_sum_s = 0.0f;
+ float middle1_sum_s = 0.0f;
+ float right1_sum_s = 0.0f;
+
+ float left2_sum_s = 0.0f;
+ float middle2_sum_s = 0.0f;
+ float right2_sum_s = 0.0f;
+
+ vfloat4 color_vec_x = vfloat4::zero();
+ vfloat4 color_vec_y = vfloat4::zero();
+
+ vfloat4 scale_vec = vfloat4::zero();
+
+ vfloat4 weight_weight_sum = vfloat4(1e-17f);
+
+ vmask4 p2_mask = vint4::lane_id() == vint4(plane2_component);
+ vfloat4 color_weight = blk.channel_weight;
+ float ls_weight = hadd_rgb_s(color_weight);
+
+ for (unsigned int j = 0; j < texel_count; j++)
+ {
+ vfloat4 rgba = blk.texel(j);
+
+ float idx0 = undec_weight_plane1_ref[j];
+
+ float om_idx0 = 1.0f - idx0;
+ wmin1 = astc::min(idx0, wmin1);
+ wmax1 = astc::max(idx0, wmax1);
+
+ float scale = dot3_s(scale_dir, rgba);
+ scale_min = astc::min(scale, scale_min);
+ scale_max = astc::max(scale, scale_max);
+
+ left1_sum_s += om_idx0 * om_idx0;
+ middle1_sum_s += om_idx0 * idx0;
+ right1_sum_s += idx0 * idx0;
+
+ float idx1 = undec_weight_plane2_ref[j];
+
+ float om_idx1 = 1.0f - idx1;
+ wmin2 = astc::min(idx1, wmin2);
+ wmax2 = astc::max(idx1, wmax2);
+
+ left2_sum_s += om_idx1 * om_idx1;
+ middle2_sum_s += om_idx1 * idx1;
+ right2_sum_s += idx1 * idx1;
+
+ vfloat4 color_idx = select(vfloat4(idx0), vfloat4(idx1), p2_mask);
+
+ vfloat4 cwprod = rgba;
+ vfloat4 cwiprod = cwprod * color_idx;
+
+ color_vec_y += cwiprod;
+ color_vec_x += cwprod - cwiprod;
+
+ scale_vec += vfloat2(om_idx0, idx0) * (ls_weight * scale);
+ weight_weight_sum += (color_weight * color_idx);
+ }
+
+ vfloat4 left1_sum = vfloat4(left1_sum_s) * color_weight;
+ vfloat4 middle1_sum = vfloat4(middle1_sum_s) * color_weight;
+ vfloat4 right1_sum = vfloat4(right1_sum_s) * color_weight;
+ vfloat4 lmrs_sum = vfloat3(left1_sum_s, middle1_sum_s, right1_sum_s) * ls_weight;
+
+ vfloat4 left2_sum = vfloat4(left2_sum_s) * color_weight;
+ vfloat4 middle2_sum = vfloat4(middle2_sum_s) * color_weight;
+ vfloat4 right2_sum = vfloat4(right2_sum_s) * color_weight;
+
+ float psum = dot3_s(select(right1_sum, right2_sum, p2_mask), color_weight);
+
+ color_vec_x = color_vec_x * color_weight;
+ color_vec_y = color_vec_y * color_weight;
+
+ // Initialize the luminance and scale vectors with a reasonable default
+ float scalediv = scale_min / astc::max(scale_max, 1e-10f);
+ scalediv = astc::clamp1f(scalediv);
+
+ vfloat4 sds = scale_dir * scale_max;
+
+ rgbs_vector = vfloat4(sds.lane<0>(), sds.lane<1>(), sds.lane<2>(), scalediv);
+
+ if (wmin1 >= wmax1 * 0.999f)
+ {
+ // If all weights in the partition were equal, then just take average of all colors in
+ // the partition and use that as both endpoint colors
+ vfloat4 avg = (color_vec_x + color_vec_y) / rgba_weight_sum;
+
+ vmask4 p1_mask = vint4::lane_id() != vint4(plane2_component);
+ vmask4 notnan_mask = avg == avg;
+ vmask4 full_mask = p1_mask & notnan_mask;
+
+ ep.endpt0[0] = select(ep.endpt0[0], avg, full_mask);
+ ep.endpt1[0] = select(ep.endpt1[0], avg, full_mask);
+
+ rgbs_vector = vfloat4(sds.lane<0>(), sds.lane<1>(), sds.lane<2>(), 1.0f);
+ }
+ else
+ {
+ // Otherwise, complete the analytic calculation of ideal-endpoint-values for the given
+ // set of texel weights and pixel colors
+ vfloat4 color_det1 = (left1_sum * right1_sum) - (middle1_sum * middle1_sum);
+ vfloat4 color_rdet1 = 1.0f / color_det1;
+
+ float ls_det1 = (lmrs_sum.lane<0>() * lmrs_sum.lane<2>()) - (lmrs_sum.lane<1>() * lmrs_sum.lane<1>());
+ float ls_rdet1 = 1.0f / ls_det1;
+
+ vfloat4 color_mss1 = (left1_sum * left1_sum)
+ + (2.0f * middle1_sum * middle1_sum)
+ + (right1_sum * right1_sum);
+
+ float ls_mss1 = (lmrs_sum.lane<0>() * lmrs_sum.lane<0>())
+ + (2.0f * lmrs_sum.lane<1>() * lmrs_sum.lane<1>())
+ + (lmrs_sum.lane<2>() * lmrs_sum.lane<2>());
+
+ vfloat4 ep0 = (right1_sum * color_vec_x - middle1_sum * color_vec_y) * color_rdet1;
+ vfloat4 ep1 = (left1_sum * color_vec_y - middle1_sum * color_vec_x) * color_rdet1;
+
+ float scale_ep0 = (lmrs_sum.lane<2>() * scale_vec.lane<0>() - lmrs_sum.lane<1>() * scale_vec.lane<1>()) * ls_rdet1;
+ float scale_ep1 = (lmrs_sum.lane<0>() * scale_vec.lane<1>() - lmrs_sum.lane<1>() * scale_vec.lane<0>()) * ls_rdet1;
+
+ vmask4 p1_mask = vint4::lane_id() != vint4(plane2_component);
+ vmask4 det_mask = abs(color_det1) > (color_mss1 * 1e-4f);
+ vmask4 notnan_mask = (ep0 == ep0) & (ep1 == ep1);
+ vmask4 full_mask = p1_mask & det_mask & notnan_mask;
+
+ ep.endpt0[0] = select(ep.endpt0[0], ep0, full_mask);
+ ep.endpt1[0] = select(ep.endpt1[0], ep1, full_mask);
+
+ if (fabsf(ls_det1) > (ls_mss1 * 1e-4f) && scale_ep0 == scale_ep0 && scale_ep1 == scale_ep1 && scale_ep0 < scale_ep1)
+ {
+ float scalediv2 = scale_ep0 / scale_ep1;
+ vfloat4 sdsm = scale_dir * scale_ep1;
+ rgbs_vector = vfloat4(sdsm.lane<0>(), sdsm.lane<1>(), sdsm.lane<2>(), scalediv2);
+ }
+ }
+
+ if (wmin2 >= wmax2 * 0.999f)
+ {
+ // If all weights in the partition were equal, then just take average of all colors in
+ // the partition and use that as both endpoint colors
+ vfloat4 avg = (color_vec_x + color_vec_y) / rgba_weight_sum;
+
+ vmask4 notnan_mask = avg == avg;
+ vmask4 full_mask = p2_mask & notnan_mask;
+
+ ep.endpt0[0] = select(ep.endpt0[0], avg, full_mask);
+ ep.endpt1[0] = select(ep.endpt1[0], avg, full_mask);
+ }
+ else
+ {
+ // Otherwise, complete the analytic calculation of ideal-endpoint-values for the given
+ // set of texel weights and pixel colors
+ vfloat4 color_det2 = (left2_sum * right2_sum) - (middle2_sum * middle2_sum);
+ vfloat4 color_rdet2 = 1.0f / color_det2;
+
+ vfloat4 color_mss2 = (left2_sum * left2_sum)
+ + (2.0f * middle2_sum * middle2_sum)
+ + (right2_sum * right2_sum);
+
+ vfloat4 ep0 = (right2_sum * color_vec_x - middle2_sum * color_vec_y) * color_rdet2;
+ vfloat4 ep1 = (left2_sum * color_vec_y - middle2_sum * color_vec_x) * color_rdet2;
+
+ vmask4 det_mask = abs(color_det2) > (color_mss2 * 1e-4f);
+ vmask4 notnan_mask = (ep0 == ep0) & (ep1 == ep1);
+ vmask4 full_mask = p2_mask & det_mask & notnan_mask;
+
+ ep.endpt0[0] = select(ep.endpt0[0], ep0, full_mask);
+ ep.endpt1[0] = select(ep.endpt1[0], ep1, full_mask);
+ }
+
+ // Calculations specific to mode #7, the HDR RGB-scale mode
+ vfloat4 rgbq_sum = color_vec_x + color_vec_y;
+ rgbq_sum.set_lane<3>(hadd_rgb_s(color_vec_y));
+
+ rgbo_vector = compute_rgbo_vector(rgba_weight_sum, weight_weight_sum, rgbq_sum, psum);
+
+ // We can get a failure due to the use of a singular (non-invertible) matrix
+ // If it failed, compute rgbo_vectors[] with a different method ...
+ if (astc::isnan(dot_s(rgbo_vector, rgbo_vector)))
+ {
+ vfloat4 v0 = ep.endpt0[0];
+ vfloat4 v1 = ep.endpt1[0];
+
+ float avgdif = hadd_rgb_s(v1 - v0) * (1.0f / 3.0f);
+ avgdif = astc::max(avgdif, 0.0f);
+
+ vfloat4 avg = (v0 + v1) * 0.5f;
+ vfloat4 ep0 = avg - vfloat4(avgdif) * 0.5f;
+
+ rgbo_vector = vfloat4(ep0.lane<0>(), ep0.lane<1>(), ep0.lane<2>(), avgdif);
+ }
+}
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_image.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_image.cpp
new file mode 100644
index 00000000000..9c0d6727d01
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_image.cpp
@@ -0,0 +1,558 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Functions for creating in-memory ASTC image structures.
+ */
+
+#include <cassert>
+#include <cstring>
+
+#include "astcenc_internal.h"
+
+/**
+ * @brief Loader pipeline function type for data fetch from memory.
+ */
+using pixel_loader = vfloat4(*)(const void*, int);
+
+/**
+ * @brief Loader pipeline function type for swizzling data in a vector.
+ */
+using pixel_swizzler = vfloat4(*)(vfloat4, const astcenc_swizzle&);
+
+/**
+ * @brief Loader pipeline function type for converting data in a vector to LNS.
+ */
+using pixel_converter = vfloat4(*)(vfloat4, vmask4);
+
+/**
+ * @brief Load a 8-bit UNORM texel from a data array.
+ *
+ * @param data The data pointer.
+ * @param base_offset The index offset to the start of the pixel.
+ */
+static vfloat4 load_texel_u8(
+ const void* data,
+ int base_offset
+) {
+ const uint8_t* data8 = static_cast<const uint8_t*>(data);
+ return int_to_float(vint4(data8 + base_offset)) / 255.0f;
+}
+
+/**
+ * @brief Load a 16-bit fp16 texel from a data array.
+ *
+ * @param data The data pointer.
+ * @param base_offset The index offset to the start of the pixel.
+ */
+static vfloat4 load_texel_f16(
+ const void* data,
+ int base_offset
+) {
+ const uint16_t* data16 = static_cast<const uint16_t*>(data);
+ int r = data16[base_offset ];
+ int g = data16[base_offset + 1];
+ int b = data16[base_offset + 2];
+ int a = data16[base_offset + 3];
+ return float16_to_float(vint4(r, g, b, a));
+}
+
+/**
+ * @brief Load a 32-bit float texel from a data array.
+ *
+ * @param data The data pointer.
+ * @param base_offset The index offset to the start of the pixel.
+ */
+static vfloat4 load_texel_f32(
+ const void* data,
+ int base_offset
+) {
+ const float* data32 = static_cast<const float*>(data);
+ return vfloat4(data32 + base_offset);
+}
+
+/**
+ * @brief Dummy no-op swizzle function.
+ *
+ * @param data The source RGBA vector to swizzle.
+ * @param swz The swizzle to use.
+ */
+static vfloat4 swz_texel_skip(
+ vfloat4 data,
+ const astcenc_swizzle& swz
+) {
+ (void)swz;
+ return data;
+}
+
+/**
+ * @brief Swizzle a texel into a new arrangement.
+ *
+ * @param data The source RGBA vector to swizzle.
+ * @param swz The swizzle to use.
+ */
+static vfloat4 swz_texel(
+ vfloat4 data,
+ const astcenc_swizzle& swz
+) {
+ alignas(16) float datas[6];
+
+ storea(data, datas);
+ datas[ASTCENC_SWZ_0] = 0.0f;
+ datas[ASTCENC_SWZ_1] = 1.0f;
+
+ return vfloat4(datas[swz.r], datas[swz.g], datas[swz.b], datas[swz.a]);
+}
+
+/**
+ * @brief Encode a texel that is entirely LDR linear.
+ *
+ * @param data The RGBA data to encode.
+ * @param lns_mask The mask for the HDR channels than need LNS encoding.
+ */
+static vfloat4 encode_texel_unorm(
+ vfloat4 data,
+ vmask4 lns_mask
+) {
+ (void)lns_mask;
+ return data * 65535.0f;
+}
+
+/**
+ * @brief Encode a texel that includes at least some HDR LNS texels.
+ *
+ * @param data The RGBA data to encode.
+ * @param lns_mask The mask for the HDR channels than need LNS encoding.
+ */
+static vfloat4 encode_texel_lns(
+ vfloat4 data,
+ vmask4 lns_mask
+) {
+ vfloat4 datav_unorm = data * 65535.0f;
+ vfloat4 datav_lns = float_to_lns(data);
+ return select(datav_unorm, datav_lns, lns_mask);
+}
+
+/* See header for documentation. */
+void load_image_block(
+ astcenc_profile decode_mode,
+ const astcenc_image& img,
+ image_block& blk,
+ const block_size_descriptor& bsd,
+ unsigned int xpos,
+ unsigned int ypos,
+ unsigned int zpos,
+ const astcenc_swizzle& swz
+) {
+ unsigned int xsize = img.dim_x;
+ unsigned int ysize = img.dim_y;
+ unsigned int zsize = img.dim_z;
+
+ blk.xpos = xpos;
+ blk.ypos = ypos;
+ blk.zpos = zpos;
+
+ // True if any non-identity swizzle
+ bool needs_swz = (swz.r != ASTCENC_SWZ_R) || (swz.g != ASTCENC_SWZ_G) ||
+ (swz.b != ASTCENC_SWZ_B) || (swz.a != ASTCENC_SWZ_A);
+
+ int idx = 0;
+
+ vfloat4 data_min(1e38f);
+ vfloat4 data_mean(0.0f);
+ vfloat4 data_mean_scale(1.0f / static_cast<float>(bsd.texel_count));
+ vfloat4 data_max(-1e38f);
+ vmask4 grayscalev(true);
+
+ // This works because we impose the same choice everywhere during encode
+ uint8_t rgb_lns = (decode_mode == ASTCENC_PRF_HDR) ||
+ (decode_mode == ASTCENC_PRF_HDR_RGB_LDR_A) ? 1 : 0;
+ uint8_t a_lns = decode_mode == ASTCENC_PRF_HDR ? 1 : 0;
+ vint4 use_lns(rgb_lns, rgb_lns, rgb_lns, a_lns);
+ vmask4 lns_mask = use_lns != vint4::zero();
+
+ // Set up the function pointers for loading pipeline as needed
+ pixel_loader loader = load_texel_u8;
+ if (img.data_type == ASTCENC_TYPE_F16)
+ {
+ loader = load_texel_f16;
+ }
+ else if (img.data_type == ASTCENC_TYPE_F32)
+ {
+ loader = load_texel_f32;
+ }
+
+ pixel_swizzler swizzler = swz_texel_skip;
+ if (needs_swz)
+ {
+ swizzler = swz_texel;
+ }
+
+ pixel_converter converter = encode_texel_unorm;
+ if (any(lns_mask))
+ {
+ converter = encode_texel_lns;
+ }
+
+ for (unsigned int z = 0; z < bsd.zdim; z++)
+ {
+ unsigned int zi = astc::min(zpos + z, zsize - 1);
+ void* plane = img.data[zi];
+
+ for (unsigned int y = 0; y < bsd.ydim; y++)
+ {
+ unsigned int yi = astc::min(ypos + y, ysize - 1);
+
+ for (unsigned int x = 0; x < bsd.xdim; x++)
+ {
+ unsigned int xi = astc::min(xpos + x, xsize - 1);
+
+ vfloat4 datav = loader(plane, (4 * xsize * yi) + (4 * xi));
+ datav = swizzler(datav, swz);
+ datav = converter(datav, lns_mask);
+
+ // Compute block metadata
+ data_min = min(data_min, datav);
+ data_mean += datav * data_mean_scale;
+ data_max = max(data_max, datav);
+
+ grayscalev = grayscalev & (datav.swz<0,0,0,0>() == datav.swz<1,1,2,2>());
+
+ blk.data_r[idx] = datav.lane<0>();
+ blk.data_g[idx] = datav.lane<1>();
+ blk.data_b[idx] = datav.lane<2>();
+ blk.data_a[idx] = datav.lane<3>();
+
+ blk.rgb_lns[idx] = rgb_lns;
+ blk.alpha_lns[idx] = a_lns;
+
+ idx++;
+ }
+ }
+ }
+
+ // Reverse the encoding so we store origin block in the original format
+ vfloat4 data_enc = blk.texel(0);
+ vfloat4 data_enc_unorm = data_enc / 65535.0f;
+ vfloat4 data_enc_lns = vfloat4::zero();
+
+ if (rgb_lns || a_lns)
+ {
+ data_enc_lns = float16_to_float(lns_to_sf16(float_to_int(data_enc)));
+ }
+
+ blk.origin_texel = select(data_enc_unorm, data_enc_lns, lns_mask);
+
+ // Store block metadata
+ blk.data_min = data_min;
+ blk.data_mean = data_mean;
+ blk.data_max = data_max;
+ blk.grayscale = all(grayscalev);
+}
+
+/* See header for documentation. */
+void load_image_block_fast_ldr(
+ astcenc_profile decode_mode,
+ const astcenc_image& img,
+ image_block& blk,
+ const block_size_descriptor& bsd,
+ unsigned int xpos,
+ unsigned int ypos,
+ unsigned int zpos,
+ const astcenc_swizzle& swz
+) {
+ (void)swz;
+ (void)decode_mode;
+
+ unsigned int xsize = img.dim_x;
+ unsigned int ysize = img.dim_y;
+
+ blk.xpos = xpos;
+ blk.ypos = ypos;
+ blk.zpos = zpos;
+
+ vfloat4 data_min(1e38f);
+ vfloat4 data_mean = vfloat4::zero();
+ vfloat4 data_max(-1e38f);
+ vmask4 grayscalev(true);
+ int idx = 0;
+
+ const uint8_t* plane = static_cast<const uint8_t*>(img.data[0]);
+ for (unsigned int y = ypos; y < ypos + bsd.ydim; y++)
+ {
+ unsigned int yi = astc::min(y, ysize - 1);
+
+ for (unsigned int x = xpos; x < xpos + bsd.xdim; x++)
+ {
+ unsigned int xi = astc::min(x, xsize - 1);
+
+ vint4 datavi = vint4(plane + (4 * xsize * yi) + (4 * xi));
+ vfloat4 datav = int_to_float(datavi) * (65535.0f / 255.0f);
+
+ // Compute block metadata
+ data_min = min(data_min, datav);
+ data_mean += datav;
+ data_max = max(data_max, datav);
+
+ grayscalev = grayscalev & (datav.swz<0,0,0,0>() == datav.swz<1,1,2,2>());
+
+ blk.data_r[idx] = datav.lane<0>();
+ blk.data_g[idx] = datav.lane<1>();
+ blk.data_b[idx] = datav.lane<2>();
+ blk.data_a[idx] = datav.lane<3>();
+
+ idx++;
+ }
+ }
+
+ // Reverse the encoding so we store origin block in the original format
+ blk.origin_texel = blk.texel(0) / 65535.0f;
+
+ // Store block metadata
+ blk.rgb_lns[0] = 0;
+ blk.alpha_lns[0] = 0;
+ blk.data_min = data_min;
+ blk.data_mean = data_mean / static_cast<float>(bsd.texel_count);
+ blk.data_max = data_max;
+ blk.grayscale = all(grayscalev);
+}
+
+/* See header for documentation. */
+void store_image_block(
+ astcenc_image& img,
+ const image_block& blk,
+ const block_size_descriptor& bsd,
+ unsigned int xpos,
+ unsigned int ypos,
+ unsigned int zpos,
+ const astcenc_swizzle& swz
+) {
+ unsigned int x_size = img.dim_x;
+ unsigned int x_start = xpos;
+ unsigned int x_end = astc::min(x_size, xpos + bsd.xdim);
+ unsigned int x_count = x_end - x_start;
+ unsigned int x_nudge = bsd.xdim - x_count;
+
+ unsigned int y_size = img.dim_y;
+ unsigned int y_start = ypos;
+ unsigned int y_end = astc::min(y_size, ypos + bsd.ydim);
+ unsigned int y_count = y_end - y_start;
+ unsigned int y_nudge = (bsd.ydim - y_count) * bsd.xdim;
+
+ unsigned int z_size = img.dim_z;
+ unsigned int z_start = zpos;
+ unsigned int z_end = astc::min(z_size, zpos + bsd.zdim);
+
+ // True if any non-identity swizzle
+ bool needs_swz = (swz.r != ASTCENC_SWZ_R) || (swz.g != ASTCENC_SWZ_G) ||
+ (swz.b != ASTCENC_SWZ_B) || (swz.a != ASTCENC_SWZ_A);
+
+ // True if any swizzle uses Z reconstruct
+ bool needs_z = (swz.r == ASTCENC_SWZ_Z) || (swz.g == ASTCENC_SWZ_Z) ||
+ (swz.b == ASTCENC_SWZ_Z) || (swz.a == ASTCENC_SWZ_Z);
+
+ int idx = 0;
+ if (img.data_type == ASTCENC_TYPE_U8)
+ {
+ for (unsigned int z = z_start; z < z_end; z++)
+ {
+ // Fetch the image plane
+ uint8_t* data8 = static_cast<uint8_t*>(img.data[z]);
+
+ for (unsigned int y = y_start; y < y_end; y++)
+ {
+ uint8_t* data8_row = data8 + (4 * x_size * y) + (4 * x_start);
+
+ for (unsigned int x = 0; x < x_count; x += ASTCENC_SIMD_WIDTH)
+ {
+ unsigned int max_texels = ASTCENC_SIMD_WIDTH;
+ unsigned int used_texels = astc::min(x_count - x, max_texels);
+
+ // Unaligned load as rows are not always SIMD_WIDTH long
+ vfloat data_r(blk.data_r + idx);
+ vfloat data_g(blk.data_g + idx);
+ vfloat data_b(blk.data_b + idx);
+ vfloat data_a(blk.data_a + idx);
+
+ vint data_ri = float_to_int_rtn(min(data_r, 1.0f) * 255.0f);
+ vint data_gi = float_to_int_rtn(min(data_g, 1.0f) * 255.0f);
+ vint data_bi = float_to_int_rtn(min(data_b, 1.0f) * 255.0f);
+ vint data_ai = float_to_int_rtn(min(data_a, 1.0f) * 255.0f);
+
+ if (needs_swz)
+ {
+ vint swizzle_table[7];
+ swizzle_table[ASTCENC_SWZ_0] = vint(0);
+ swizzle_table[ASTCENC_SWZ_1] = vint(255);
+ swizzle_table[ASTCENC_SWZ_R] = data_ri;
+ swizzle_table[ASTCENC_SWZ_G] = data_gi;
+ swizzle_table[ASTCENC_SWZ_B] = data_bi;
+ swizzle_table[ASTCENC_SWZ_A] = data_ai;
+
+ if (needs_z)
+ {
+ vfloat data_x = (data_r * vfloat(2.0f)) - vfloat(1.0f);
+ vfloat data_y = (data_a * vfloat(2.0f)) - vfloat(1.0f);
+ vfloat data_z = vfloat(1.0f) - (data_x * data_x) - (data_y * data_y);
+ data_z = max(data_z, 0.0f);
+ data_z = (sqrt(data_z) * vfloat(0.5f)) + vfloat(0.5f);
+
+ swizzle_table[ASTCENC_SWZ_Z] = float_to_int_rtn(min(data_z, 1.0f) * 255.0f);
+ }
+
+ data_ri = swizzle_table[swz.r];
+ data_gi = swizzle_table[swz.g];
+ data_bi = swizzle_table[swz.b];
+ data_ai = swizzle_table[swz.a];
+ }
+
+ // Errors are NaN encoded - convert to magenta error color
+ // Branch is OK here - it is almost never true so predicts well
+ vmask nan_mask = data_r != data_r;
+ if (any(nan_mask))
+ {
+ data_ri = select(data_ri, vint(0xFF), nan_mask);
+ data_gi = select(data_gi, vint(0x00), nan_mask);
+ data_bi = select(data_bi, vint(0xFF), nan_mask);
+ data_ai = select(data_ai, vint(0xFF), nan_mask);
+ }
+
+ vint data_rgbai = interleave_rgba8(data_ri, data_gi, data_bi, data_ai);
+ vmask store_mask = vint::lane_id() < vint(used_texels);
+ store_lanes_masked(reinterpret_cast<int*>(data8_row), data_rgbai, store_mask);
+
+ data8_row += ASTCENC_SIMD_WIDTH * 4;
+ idx += used_texels;
+ }
+ idx += x_nudge;
+ }
+ idx += y_nudge;
+ }
+ }
+ else if (img.data_type == ASTCENC_TYPE_F16)
+ {
+ for (unsigned int z = z_start; z < z_end; z++)
+ {
+ // Fetch the image plane
+ uint16_t* data16 = static_cast<uint16_t*>(img.data[z]);
+
+ for (unsigned int y = y_start; y < y_end; y++)
+ {
+ uint16_t* data16_row = data16 + (4 * x_size * y) + (4 * x_start);
+
+ for (unsigned int x = 0; x < x_count; x++)
+ {
+ vint4 color;
+
+ // NaNs are handled inline - no need to special case
+ if (needs_swz)
+ {
+ float data[7];
+ data[ASTCENC_SWZ_0] = 0.0f;
+ data[ASTCENC_SWZ_1] = 1.0f;
+ data[ASTCENC_SWZ_R] = blk.data_r[idx];
+ data[ASTCENC_SWZ_G] = blk.data_g[idx];
+ data[ASTCENC_SWZ_B] = blk.data_b[idx];
+ data[ASTCENC_SWZ_A] = blk.data_a[idx];
+
+ if (needs_z)
+ {
+ float xN = (data[0] * 2.0f) - 1.0f;
+ float yN = (data[3] * 2.0f) - 1.0f;
+ float zN = 1.0f - xN * xN - yN * yN;
+ if (zN < 0.0f)
+ {
+ zN = 0.0f;
+ }
+ data[ASTCENC_SWZ_Z] = (astc::sqrt(zN) * 0.5f) + 0.5f;
+ }
+
+ vfloat4 colorf(data[swz.r], data[swz.g], data[swz.b], data[swz.a]);
+ color = float_to_float16(colorf);
+ }
+ else
+ {
+ vfloat4 colorf = blk.texel(idx);
+ color = float_to_float16(colorf);
+ }
+
+ // TODO: Vectorize with store N shorts?
+ data16_row[0] = static_cast<uint16_t>(color.lane<0>());
+ data16_row[1] = static_cast<uint16_t>(color.lane<1>());
+ data16_row[2] = static_cast<uint16_t>(color.lane<2>());
+ data16_row[3] = static_cast<uint16_t>(color.lane<3>());
+ data16_row += 4;
+ idx++;
+ }
+ idx += x_nudge;
+ }
+ idx += y_nudge;
+ }
+ }
+ else // if (img.data_type == ASTCENC_TYPE_F32)
+ {
+ assert(img.data_type == ASTCENC_TYPE_F32);
+
+ for (unsigned int z = z_start; z < z_end; z++)
+ {
+ // Fetch the image plane
+ float* data32 = static_cast<float*>(img.data[z]);
+
+ for (unsigned int y = y_start; y < y_end; y++)
+ {
+ float* data32_row = data32 + (4 * x_size * y) + (4 * x_start);
+
+ for (unsigned int x = 0; x < x_count; x++)
+ {
+ vfloat4 color = blk.texel(idx);
+
+ // NaNs are handled inline - no need to special case
+ if (needs_swz)
+ {
+ float data[7];
+ data[ASTCENC_SWZ_0] = 0.0f;
+ data[ASTCENC_SWZ_1] = 1.0f;
+ data[ASTCENC_SWZ_R] = color.lane<0>();
+ data[ASTCENC_SWZ_G] = color.lane<1>();
+ data[ASTCENC_SWZ_B] = color.lane<2>();
+ data[ASTCENC_SWZ_A] = color.lane<3>();
+
+ if (needs_z)
+ {
+ float xN = (data[0] * 2.0f) - 1.0f;
+ float yN = (data[3] * 2.0f) - 1.0f;
+ float zN = 1.0f - xN * xN - yN * yN;
+ if (zN < 0.0f)
+ {
+ zN = 0.0f;
+ }
+ data[ASTCENC_SWZ_Z] = (astc::sqrt(zN) * 0.5f) + 0.5f;
+ }
+
+ color = vfloat4(data[swz.r], data[swz.g], data[swz.b], data[swz.a]);
+ }
+
+ store(color, data32_row);
+ data32_row += 4;
+ idx++;
+ }
+ idx += x_nudge;
+ }
+ idx += y_nudge;
+ }
+ }
+}
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_integer_sequence.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_integer_sequence.cpp
new file mode 100644
index 00000000000..9675ab5b29f
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_integer_sequence.cpp
@@ -0,0 +1,744 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2021 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Functions for encoding/decoding Bounded Integer Sequence Encoding.
+ */
+
+#include "astcenc_internal.h"
+
+#include <array>
+
+/** @brief Unpacked quint triplets <low,middle,high> for each packed value */
+static const uint8_t quints_of_integer[128][3] {
+ {0, 0, 0}, {1, 0, 0}, {2, 0, 0}, {3, 0, 0},
+ {4, 0, 0}, {0, 4, 0}, {4, 4, 0}, {4, 4, 4},
+ {0, 1, 0}, {1, 1, 0}, {2, 1, 0}, {3, 1, 0},
+ {4, 1, 0}, {1, 4, 0}, {4, 4, 1}, {4, 4, 4},
+ {0, 2, 0}, {1, 2, 0}, {2, 2, 0}, {3, 2, 0},
+ {4, 2, 0}, {2, 4, 0}, {4, 4, 2}, {4, 4, 4},
+ {0, 3, 0}, {1, 3, 0}, {2, 3, 0}, {3, 3, 0},
+ {4, 3, 0}, {3, 4, 0}, {4, 4, 3}, {4, 4, 4},
+ {0, 0, 1}, {1, 0, 1}, {2, 0, 1}, {3, 0, 1},
+ {4, 0, 1}, {0, 4, 1}, {4, 0, 4}, {0, 4, 4},
+ {0, 1, 1}, {1, 1, 1}, {2, 1, 1}, {3, 1, 1},
+ {4, 1, 1}, {1, 4, 1}, {4, 1, 4}, {1, 4, 4},
+ {0, 2, 1}, {1, 2, 1}, {2, 2, 1}, {3, 2, 1},
+ {4, 2, 1}, {2, 4, 1}, {4, 2, 4}, {2, 4, 4},
+ {0, 3, 1}, {1, 3, 1}, {2, 3, 1}, {3, 3, 1},
+ {4, 3, 1}, {3, 4, 1}, {4, 3, 4}, {3, 4, 4},
+ {0, 0, 2}, {1, 0, 2}, {2, 0, 2}, {3, 0, 2},
+ {4, 0, 2}, {0, 4, 2}, {2, 0, 4}, {3, 0, 4},
+ {0, 1, 2}, {1, 1, 2}, {2, 1, 2}, {3, 1, 2},
+ {4, 1, 2}, {1, 4, 2}, {2, 1, 4}, {3, 1, 4},
+ {0, 2, 2}, {1, 2, 2}, {2, 2, 2}, {3, 2, 2},
+ {4, 2, 2}, {2, 4, 2}, {2, 2, 4}, {3, 2, 4},
+ {0, 3, 2}, {1, 3, 2}, {2, 3, 2}, {3, 3, 2},
+ {4, 3, 2}, {3, 4, 2}, {2, 3, 4}, {3, 3, 4},
+ {0, 0, 3}, {1, 0, 3}, {2, 0, 3}, {3, 0, 3},
+ {4, 0, 3}, {0, 4, 3}, {0, 0, 4}, {1, 0, 4},
+ {0, 1, 3}, {1, 1, 3}, {2, 1, 3}, {3, 1, 3},
+ {4, 1, 3}, {1, 4, 3}, {0, 1, 4}, {1, 1, 4},
+ {0, 2, 3}, {1, 2, 3}, {2, 2, 3}, {3, 2, 3},
+ {4, 2, 3}, {2, 4, 3}, {0, 2, 4}, {1, 2, 4},
+ {0, 3, 3}, {1, 3, 3}, {2, 3, 3}, {3, 3, 3},
+ {4, 3, 3}, {3, 4, 3}, {0, 3, 4}, {1, 3, 4}
+};
+
+/** @brief Packed quint values for each unpacked value, indexed [hi][mid][lo]. */
+static const uint8_t integer_of_quints[5][5][5] {
+ {
+ {0, 1, 2, 3, 4},
+ {8, 9, 10, 11, 12},
+ {16, 17, 18, 19, 20},
+ {24, 25, 26, 27, 28},
+ {5, 13, 21, 29, 6}
+ },
+ {
+ {32, 33, 34, 35, 36},
+ {40, 41, 42, 43, 44},
+ {48, 49, 50, 51, 52},
+ {56, 57, 58, 59, 60},
+ {37, 45, 53, 61, 14}
+ },
+ {
+ {64, 65, 66, 67, 68},
+ {72, 73, 74, 75, 76},
+ {80, 81, 82, 83, 84},
+ {88, 89, 90, 91, 92},
+ {69, 77, 85, 93, 22}
+ },
+ {
+ {96, 97, 98, 99, 100},
+ {104, 105, 106, 107, 108},
+ {112, 113, 114, 115, 116},
+ {120, 121, 122, 123, 124},
+ {101, 109, 117, 125, 30}
+ },
+ {
+ {102, 103, 70, 71, 38},
+ {110, 111, 78, 79, 46},
+ {118, 119, 86, 87, 54},
+ {126, 127, 94, 95, 62},
+ {39, 47, 55, 63, 31}
+ }
+};
+
+/** @brief Unpacked trit quintuplets <low,...,high> for each packed value */
+static const uint8_t trits_of_integer[256][5] {
+ {0, 0, 0, 0, 0}, {1, 0, 0, 0, 0}, {2, 0, 0, 0, 0}, {0, 0, 2, 0, 0},
+ {0, 1, 0, 0, 0}, {1, 1, 0, 0, 0}, {2, 1, 0, 0, 0}, {1, 0, 2, 0, 0},
+ {0, 2, 0, 0, 0}, {1, 2, 0, 0, 0}, {2, 2, 0, 0, 0}, {2, 0, 2, 0, 0},
+ {0, 2, 2, 0, 0}, {1, 2, 2, 0, 0}, {2, 2, 2, 0, 0}, {2, 0, 2, 0, 0},
+ {0, 0, 1, 0, 0}, {1, 0, 1, 0, 0}, {2, 0, 1, 0, 0}, {0, 1, 2, 0, 0},
+ {0, 1, 1, 0, 0}, {1, 1, 1, 0, 0}, {2, 1, 1, 0, 0}, {1, 1, 2, 0, 0},
+ {0, 2, 1, 0, 0}, {1, 2, 1, 0, 0}, {2, 2, 1, 0, 0}, {2, 1, 2, 0, 0},
+ {0, 0, 0, 2, 2}, {1, 0, 0, 2, 2}, {2, 0, 0, 2, 2}, {0, 0, 2, 2, 2},
+ {0, 0, 0, 1, 0}, {1, 0, 0, 1, 0}, {2, 0, 0, 1, 0}, {0, 0, 2, 1, 0},
+ {0, 1, 0, 1, 0}, {1, 1, 0, 1, 0}, {2, 1, 0, 1, 0}, {1, 0, 2, 1, 0},
+ {0, 2, 0, 1, 0}, {1, 2, 0, 1, 0}, {2, 2, 0, 1, 0}, {2, 0, 2, 1, 0},
+ {0, 2, 2, 1, 0}, {1, 2, 2, 1, 0}, {2, 2, 2, 1, 0}, {2, 0, 2, 1, 0},
+ {0, 0, 1, 1, 0}, {1, 0, 1, 1, 0}, {2, 0, 1, 1, 0}, {0, 1, 2, 1, 0},
+ {0, 1, 1, 1, 0}, {1, 1, 1, 1, 0}, {2, 1, 1, 1, 0}, {1, 1, 2, 1, 0},
+ {0, 2, 1, 1, 0}, {1, 2, 1, 1, 0}, {2, 2, 1, 1, 0}, {2, 1, 2, 1, 0},
+ {0, 1, 0, 2, 2}, {1, 1, 0, 2, 2}, {2, 1, 0, 2, 2}, {1, 0, 2, 2, 2},
+ {0, 0, 0, 2, 0}, {1, 0, 0, 2, 0}, {2, 0, 0, 2, 0}, {0, 0, 2, 2, 0},
+ {0, 1, 0, 2, 0}, {1, 1, 0, 2, 0}, {2, 1, 0, 2, 0}, {1, 0, 2, 2, 0},
+ {0, 2, 0, 2, 0}, {1, 2, 0, 2, 0}, {2, 2, 0, 2, 0}, {2, 0, 2, 2, 0},
+ {0, 2, 2, 2, 0}, {1, 2, 2, 2, 0}, {2, 2, 2, 2, 0}, {2, 0, 2, 2, 0},
+ {0, 0, 1, 2, 0}, {1, 0, 1, 2, 0}, {2, 0, 1, 2, 0}, {0, 1, 2, 2, 0},
+ {0, 1, 1, 2, 0}, {1, 1, 1, 2, 0}, {2, 1, 1, 2, 0}, {1, 1, 2, 2, 0},
+ {0, 2, 1, 2, 0}, {1, 2, 1, 2, 0}, {2, 2, 1, 2, 0}, {2, 1, 2, 2, 0},
+ {0, 2, 0, 2, 2}, {1, 2, 0, 2, 2}, {2, 2, 0, 2, 2}, {2, 0, 2, 2, 2},
+ {0, 0, 0, 0, 2}, {1, 0, 0, 0, 2}, {2, 0, 0, 0, 2}, {0, 0, 2, 0, 2},
+ {0, 1, 0, 0, 2}, {1, 1, 0, 0, 2}, {2, 1, 0, 0, 2}, {1, 0, 2, 0, 2},
+ {0, 2, 0, 0, 2}, {1, 2, 0, 0, 2}, {2, 2, 0, 0, 2}, {2, 0, 2, 0, 2},
+ {0, 2, 2, 0, 2}, {1, 2, 2, 0, 2}, {2, 2, 2, 0, 2}, {2, 0, 2, 0, 2},
+ {0, 0, 1, 0, 2}, {1, 0, 1, 0, 2}, {2, 0, 1, 0, 2}, {0, 1, 2, 0, 2},
+ {0, 1, 1, 0, 2}, {1, 1, 1, 0, 2}, {2, 1, 1, 0, 2}, {1, 1, 2, 0, 2},
+ {0, 2, 1, 0, 2}, {1, 2, 1, 0, 2}, {2, 2, 1, 0, 2}, {2, 1, 2, 0, 2},
+ {0, 2, 2, 2, 2}, {1, 2, 2, 2, 2}, {2, 2, 2, 2, 2}, {2, 0, 2, 2, 2},
+ {0, 0, 0, 0, 1}, {1, 0, 0, 0, 1}, {2, 0, 0, 0, 1}, {0, 0, 2, 0, 1},
+ {0, 1, 0, 0, 1}, {1, 1, 0, 0, 1}, {2, 1, 0, 0, 1}, {1, 0, 2, 0, 1},
+ {0, 2, 0, 0, 1}, {1, 2, 0, 0, 1}, {2, 2, 0, 0, 1}, {2, 0, 2, 0, 1},
+ {0, 2, 2, 0, 1}, {1, 2, 2, 0, 1}, {2, 2, 2, 0, 1}, {2, 0, 2, 0, 1},
+ {0, 0, 1, 0, 1}, {1, 0, 1, 0, 1}, {2, 0, 1, 0, 1}, {0, 1, 2, 0, 1},
+ {0, 1, 1, 0, 1}, {1, 1, 1, 0, 1}, {2, 1, 1, 0, 1}, {1, 1, 2, 0, 1},
+ {0, 2, 1, 0, 1}, {1, 2, 1, 0, 1}, {2, 2, 1, 0, 1}, {2, 1, 2, 0, 1},
+ {0, 0, 1, 2, 2}, {1, 0, 1, 2, 2}, {2, 0, 1, 2, 2}, {0, 1, 2, 2, 2},
+ {0, 0, 0, 1, 1}, {1, 0, 0, 1, 1}, {2, 0, 0, 1, 1}, {0, 0, 2, 1, 1},
+ {0, 1, 0, 1, 1}, {1, 1, 0, 1, 1}, {2, 1, 0, 1, 1}, {1, 0, 2, 1, 1},
+ {0, 2, 0, 1, 1}, {1, 2, 0, 1, 1}, {2, 2, 0, 1, 1}, {2, 0, 2, 1, 1},
+ {0, 2, 2, 1, 1}, {1, 2, 2, 1, 1}, {2, 2, 2, 1, 1}, {2, 0, 2, 1, 1},
+ {0, 0, 1, 1, 1}, {1, 0, 1, 1, 1}, {2, 0, 1, 1, 1}, {0, 1, 2, 1, 1},
+ {0, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {2, 1, 1, 1, 1}, {1, 1, 2, 1, 1},
+ {0, 2, 1, 1, 1}, {1, 2, 1, 1, 1}, {2, 2, 1, 1, 1}, {2, 1, 2, 1, 1},
+ {0, 1, 1, 2, 2}, {1, 1, 1, 2, 2}, {2, 1, 1, 2, 2}, {1, 1, 2, 2, 2},
+ {0, 0, 0, 2, 1}, {1, 0, 0, 2, 1}, {2, 0, 0, 2, 1}, {0, 0, 2, 2, 1},
+ {0, 1, 0, 2, 1}, {1, 1, 0, 2, 1}, {2, 1, 0, 2, 1}, {1, 0, 2, 2, 1},
+ {0, 2, 0, 2, 1}, {1, 2, 0, 2, 1}, {2, 2, 0, 2, 1}, {2, 0, 2, 2, 1},
+ {0, 2, 2, 2, 1}, {1, 2, 2, 2, 1}, {2, 2, 2, 2, 1}, {2, 0, 2, 2, 1},
+ {0, 0, 1, 2, 1}, {1, 0, 1, 2, 1}, {2, 0, 1, 2, 1}, {0, 1, 2, 2, 1},
+ {0, 1, 1, 2, 1}, {1, 1, 1, 2, 1}, {2, 1, 1, 2, 1}, {1, 1, 2, 2, 1},
+ {0, 2, 1, 2, 1}, {1, 2, 1, 2, 1}, {2, 2, 1, 2, 1}, {2, 1, 2, 2, 1},
+ {0, 2, 1, 2, 2}, {1, 2, 1, 2, 2}, {2, 2, 1, 2, 2}, {2, 1, 2, 2, 2},
+ {0, 0, 0, 1, 2}, {1, 0, 0, 1, 2}, {2, 0, 0, 1, 2}, {0, 0, 2, 1, 2},
+ {0, 1, 0, 1, 2}, {1, 1, 0, 1, 2}, {2, 1, 0, 1, 2}, {1, 0, 2, 1, 2},
+ {0, 2, 0, 1, 2}, {1, 2, 0, 1, 2}, {2, 2, 0, 1, 2}, {2, 0, 2, 1, 2},
+ {0, 2, 2, 1, 2}, {1, 2, 2, 1, 2}, {2, 2, 2, 1, 2}, {2, 0, 2, 1, 2},
+ {0, 0, 1, 1, 2}, {1, 0, 1, 1, 2}, {2, 0, 1, 1, 2}, {0, 1, 2, 1, 2},
+ {0, 1, 1, 1, 2}, {1, 1, 1, 1, 2}, {2, 1, 1, 1, 2}, {1, 1, 2, 1, 2},
+ {0, 2, 1, 1, 2}, {1, 2, 1, 1, 2}, {2, 2, 1, 1, 2}, {2, 1, 2, 1, 2},
+ {0, 2, 2, 2, 2}, {1, 2, 2, 2, 2}, {2, 2, 2, 2, 2}, {2, 1, 2, 2, 2}
+};
+
+/** @brief Packed trit values for each unpacked value, indexed [hi][][][][lo]. */
+static const uint8_t integer_of_trits[3][3][3][3][3] {
+ {
+ {
+ {
+ {0, 1, 2},
+ {4, 5, 6},
+ {8, 9, 10}
+ },
+ {
+ {16, 17, 18},
+ {20, 21, 22},
+ {24, 25, 26}
+ },
+ {
+ {3, 7, 15},
+ {19, 23, 27},
+ {12, 13, 14}
+ }
+ },
+ {
+ {
+ {32, 33, 34},
+ {36, 37, 38},
+ {40, 41, 42}
+ },
+ {
+ {48, 49, 50},
+ {52, 53, 54},
+ {56, 57, 58}
+ },
+ {
+ {35, 39, 47},
+ {51, 55, 59},
+ {44, 45, 46}
+ }
+ },
+ {
+ {
+ {64, 65, 66},
+ {68, 69, 70},
+ {72, 73, 74}
+ },
+ {
+ {80, 81, 82},
+ {84, 85, 86},
+ {88, 89, 90}
+ },
+ {
+ {67, 71, 79},
+ {83, 87, 91},
+ {76, 77, 78}
+ }
+ }
+ },
+ {
+ {
+ {
+ {128, 129, 130},
+ {132, 133, 134},
+ {136, 137, 138}
+ },
+ {
+ {144, 145, 146},
+ {148, 149, 150},
+ {152, 153, 154}
+ },
+ {
+ {131, 135, 143},
+ {147, 151, 155},
+ {140, 141, 142}
+ }
+ },
+ {
+ {
+ {160, 161, 162},
+ {164, 165, 166},
+ {168, 169, 170}
+ },
+ {
+ {176, 177, 178},
+ {180, 181, 182},
+ {184, 185, 186}
+ },
+ {
+ {163, 167, 175},
+ {179, 183, 187},
+ {172, 173, 174}
+ }
+ },
+ {
+ {
+ {192, 193, 194},
+ {196, 197, 198},
+ {200, 201, 202}
+ },
+ {
+ {208, 209, 210},
+ {212, 213, 214},
+ {216, 217, 218}
+ },
+ {
+ {195, 199, 207},
+ {211, 215, 219},
+ {204, 205, 206}
+ }
+ }
+ },
+ {
+ {
+ {
+ {96, 97, 98},
+ {100, 101, 102},
+ {104, 105, 106}
+ },
+ {
+ {112, 113, 114},
+ {116, 117, 118},
+ {120, 121, 122}
+ },
+ {
+ {99, 103, 111},
+ {115, 119, 123},
+ {108, 109, 110}
+ }
+ },
+ {
+ {
+ {224, 225, 226},
+ {228, 229, 230},
+ {232, 233, 234}
+ },
+ {
+ {240, 241, 242},
+ {244, 245, 246},
+ {248, 249, 250}
+ },
+ {
+ {227, 231, 239},
+ {243, 247, 251},
+ {236, 237, 238}
+ }
+ },
+ {
+ {
+ {28, 29, 30},
+ {60, 61, 62},
+ {92, 93, 94}
+ },
+ {
+ {156, 157, 158},
+ {188, 189, 190},
+ {220, 221, 222}
+ },
+ {
+ {31, 63, 127},
+ {159, 191, 255},
+ {252, 253, 254}
+ }
+ }
+ }
+};
+
+/**
+ * @brief The number of bits, trits, and quints needed for a quant level.
+ */
+struct btq_count
+{
+ /** @brief The quantization level. */
+ uint8_t quant;
+
+ /** @brief The number of bits. */
+ uint8_t bits;
+
+ /** @brief The number of trits. */
+ uint8_t trits;
+
+ /** @brief The number of quints. */
+ uint8_t quints;
+};
+
+/**
+ * @brief The table of bits, trits, and quints needed for a quant encode.
+ */
+static const std::array<btq_count, 21> btq_counts {{
+ { QUANT_2, 1, 0, 0 },
+ { QUANT_3, 0, 1, 0 },
+ { QUANT_4, 2, 0, 0 },
+ { QUANT_5, 0, 0, 1 },
+ { QUANT_6, 1, 1, 0 },
+ { QUANT_8, 3, 0, 0 },
+ { QUANT_10, 1, 0, 1 },
+ { QUANT_12, 2, 1, 0 },
+ { QUANT_16, 4, 0, 0 },
+ { QUANT_20, 2, 0, 1 },
+ { QUANT_24, 3, 1, 0 },
+ { QUANT_32, 5, 0, 0 },
+ { QUANT_40, 3, 0, 1 },
+ { QUANT_48, 4, 1, 0 },
+ { QUANT_64, 6, 0, 0 },
+ { QUANT_80, 4, 0, 1 },
+ { QUANT_96, 5, 1, 0 },
+ { QUANT_128, 7, 0, 0 },
+ { QUANT_160, 5, 0, 1 },
+ { QUANT_192, 6, 1, 0 },
+ { QUANT_256, 8, 0, 0 }
+}};
+
+/**
+ * @brief The sequence scale, round, and divisors needed to compute sizing.
+ *
+ * The length of a quantized sequence in bits is:
+ * (scale * <sequence_len> + round) / divisor
+ */
+struct ise_size
+{
+ /** @brief The quantization level. */
+ uint8_t quant;
+
+ /** @brief The scaling parameter. */
+ uint8_t scale;
+
+ /** @brief The rounding parameter. */
+ uint8_t round;
+
+ /** @brief The divisor parameter. */
+ uint8_t divisor;
+};
+
+/**
+ * @brief The table of scale, round, and divisors needed for quant sizing.
+ */
+static const std::array<ise_size, 21> ise_sizes {{
+ { QUANT_2, 1, 0, 1 },
+ { QUANT_3, 8, 4, 5 },
+ { QUANT_4, 2, 0, 1 },
+ { QUANT_5, 7, 2, 3 },
+ { QUANT_6, 13, 4, 5 },
+ { QUANT_8, 3, 0, 1 },
+ { QUANT_10, 10, 2, 3 },
+ { QUANT_12, 18, 4, 5 },
+ { QUANT_16, 4, 0, 1 },
+ { QUANT_20, 13, 2, 3 },
+ { QUANT_24, 23, 4, 5 },
+ { QUANT_32, 5, 0, 1 },
+ { QUANT_40, 16, 2, 3 },
+ { QUANT_48, 28, 4, 5 },
+ { QUANT_64, 6, 0, 1 },
+ { QUANT_80, 19, 2, 3 },
+ { QUANT_96, 33, 4, 5 },
+ { QUANT_128, 7, 0, 1 },
+ { QUANT_160, 22, 2, 3 },
+ { QUANT_192, 38, 4, 5 },
+ { QUANT_256, 8, 0, 1 }
+}};
+
+/* See header for documentation. */
+unsigned int get_ise_sequence_bitcount(
+ unsigned int character_count,
+ quant_method quant_level
+) {
+ // Cope with out-of bounds values - input might be invalid
+ if (static_cast<size_t>(quant_level) >= ise_sizes.size())
+ {
+ // Arbitrary large number that's more than an ASTC block can hold
+ return 1024;
+ }
+
+ auto& entry = ise_sizes[quant_level];
+ return (entry.scale * character_count + entry.round) / entry.divisor;
+}
+
+/**
+ * @brief Write up to 8 bits at an arbitrary bit offset.
+ *
+ * The stored value is at most 8 bits, but can be stored at an offset of between 0 and 7 bits so may
+ * span two separate bytes in memory.
+ *
+ * @param value The value to write.
+ * @param bitcount The number of bits to write, starting from LSB.
+ * @param bitoffset The bit offset to store at, between 0 and 7.
+ * @param[in,out] ptr The data pointer to write to.
+ */
+static inline void write_bits(
+ unsigned int value,
+ unsigned int bitcount,
+ unsigned int bitoffset,
+ uint8_t ptr[2]
+) {
+ unsigned int mask = (1 << bitcount) - 1;
+ value &= mask;
+ ptr += bitoffset >> 3;
+ bitoffset &= 7;
+ value <<= bitoffset;
+ mask <<= bitoffset;
+ mask = ~mask;
+
+ ptr[0] &= mask;
+ ptr[0] |= value;
+ ptr[1] &= mask >> 8;
+ ptr[1] |= value >> 8;
+}
+
+/**
+ * @brief Read up to 8 bits at an arbitrary bit offset.
+ *
+ * The stored value is at most 8 bits, but can be stored at an offset of between 0 and 7 bits so may
+ * span two separate bytes in memory.
+ *
+ * @param bitcount The number of bits to read.
+ * @param bitoffset The bit offset to read from, between 0 and 7.
+ * @param[in,out] ptr The data pointer to read from.
+ *
+ * @return The read value.
+ */
+static inline unsigned int read_bits(
+ unsigned int bitcount,
+ unsigned int bitoffset,
+ const uint8_t* ptr
+) {
+ unsigned int mask = (1 << bitcount) - 1;
+ ptr += bitoffset >> 3;
+ bitoffset &= 7;
+ unsigned int value = ptr[0] | (ptr[1] << 8);
+ value >>= bitoffset;
+ value &= mask;
+ return value;
+}
+
+/* See header for documentation. */
+void encode_ise(
+ quant_method quant_level,
+ unsigned int character_count,
+ const uint8_t* input_data,
+ uint8_t* output_data,
+ unsigned int bit_offset
+) {
+ promise(character_count > 0);
+
+ unsigned int bits = btq_counts[quant_level].bits;
+ unsigned int trits = btq_counts[quant_level].trits;
+ unsigned int quints = btq_counts[quant_level].quints;
+ unsigned int mask = (1 << bits) - 1;
+
+ // Write out trits and bits
+ if (trits)
+ {
+ unsigned int i = 0;
+ unsigned int full_trit_blocks = character_count / 5;
+
+ for (unsigned int j = 0; j < full_trit_blocks; j++)
+ {
+ unsigned int i4 = input_data[i + 4] >> bits;
+ unsigned int i3 = input_data[i + 3] >> bits;
+ unsigned int i2 = input_data[i + 2] >> bits;
+ unsigned int i1 = input_data[i + 1] >> bits;
+ unsigned int i0 = input_data[i + 0] >> bits;
+
+ uint8_t T = integer_of_trits[i4][i3][i2][i1][i0];
+
+ // The max size of a trit bit count is 6, so we can always safely
+ // pack a single MX value with the following 1 or 2 T bits.
+ uint8_t pack;
+
+ // Element 0 + T0 + T1
+ pack = (input_data[i++] & mask) | (((T >> 0) & 0x3) << bits);
+ write_bits(pack, bits + 2, bit_offset, output_data);
+ bit_offset += bits + 2;
+
+ // Element 1 + T2 + T3
+ pack = (input_data[i++] & mask) | (((T >> 2) & 0x3) << bits);
+ write_bits(pack, bits + 2, bit_offset, output_data);
+ bit_offset += bits + 2;
+
+ // Element 2 + T4
+ pack = (input_data[i++] & mask) | (((T >> 4) & 0x1) << bits);
+ write_bits(pack, bits + 1, bit_offset, output_data);
+ bit_offset += bits + 1;
+
+ // Element 3 + T5 + T6
+ pack = (input_data[i++] & mask) | (((T >> 5) & 0x3) << bits);
+ write_bits(pack, bits + 2, bit_offset, output_data);
+ bit_offset += bits + 2;
+
+ // Element 4 + T7
+ pack = (input_data[i++] & mask) | (((T >> 7) & 0x1) << bits);
+ write_bits(pack, bits + 1, bit_offset, output_data);
+ bit_offset += bits + 1;
+ }
+
+ // Loop tail for a partial block
+ if (i != character_count)
+ {
+ // i4 cannot be present - we know the block is partial
+ // i0 must be present - we know the block isn't empty
+ unsigned int i4 = 0;
+ unsigned int i3 = i + 3 >= character_count ? 0 : input_data[i + 3] >> bits;
+ unsigned int i2 = i + 2 >= character_count ? 0 : input_data[i + 2] >> bits;
+ unsigned int i1 = i + 1 >= character_count ? 0 : input_data[i + 1] >> bits;
+ unsigned int i0 = input_data[i + 0] >> bits;
+
+ uint8_t T = integer_of_trits[i4][i3][i2][i1][i0];
+
+ for (unsigned int j = 0; i < character_count; i++, j++)
+ {
+ // Truncated table as this iteration is always partital
+ static const uint8_t tbits[4] { 2, 2, 1, 2 };
+ static const uint8_t tshift[4] { 0, 2, 4, 5 };
+
+ uint8_t pack = (input_data[i] & mask) |
+ (((T >> tshift[j]) & ((1 << tbits[j]) - 1)) << bits);
+
+ write_bits(pack, bits + tbits[j], bit_offset, output_data);
+ bit_offset += bits + tbits[j];
+ }
+ }
+ }
+ // Write out quints and bits
+ else if (quints)
+ {
+ unsigned int i = 0;
+ unsigned int full_quint_blocks = character_count / 3;
+
+ for (unsigned int j = 0; j < full_quint_blocks; j++)
+ {
+ unsigned int i2 = input_data[i + 2] >> bits;
+ unsigned int i1 = input_data[i + 1] >> bits;
+ unsigned int i0 = input_data[i + 0] >> bits;
+
+ uint8_t T = integer_of_quints[i2][i1][i0];
+
+ // The max size of a quint bit count is 5, so we can always safely
+ // pack a single M value with the following 2 or 3 T bits.
+ uint8_t pack;
+
+ // Element 0
+ pack = (input_data[i++] & mask) | (((T >> 0) & 0x7) << bits);
+ write_bits(pack, bits + 3, bit_offset, output_data);
+ bit_offset += bits + 3;
+
+ // Element 1
+ pack = (input_data[i++] & mask) | (((T >> 3) & 0x3) << bits);
+ write_bits(pack, bits + 2, bit_offset, output_data);
+ bit_offset += bits + 2;
+
+ // Element 2
+ pack = (input_data[i++] & mask) | (((T >> 5) & 0x3) << bits);
+ write_bits(pack, bits + 2, bit_offset, output_data);
+ bit_offset += bits + 2;
+ }
+
+ // Loop tail for a partial block
+ if (i != character_count)
+ {
+ // i2 cannot be present - we know the block is partial
+ // i0 must be present - we know the block isn't empty
+ unsigned int i2 = 0;
+ unsigned int i1 = i + 1 >= character_count ? 0 : input_data[i + 1] >> bits;
+ unsigned int i0 = input_data[i + 0] >> bits;
+
+ uint8_t T = integer_of_quints[i2][i1][i0];
+
+ for (unsigned int j = 0; i < character_count; i++, j++)
+ {
+ // Truncated table as this iteration is always partital
+ static const uint8_t tbits[2] { 3, 2 };
+ static const uint8_t tshift[2] { 0, 3 };
+
+ uint8_t pack = (input_data[i] & mask) |
+ (((T >> tshift[j]) & ((1 << tbits[j]) - 1)) << bits);
+
+ write_bits(pack, bits + tbits[j], bit_offset, output_data);
+ bit_offset += bits + tbits[j];
+ }
+ }
+ }
+ // Write out just bits
+ else
+ {
+ promise(character_count > 0);
+ for (unsigned int i = 0; i < character_count; i++)
+ {
+ write_bits(input_data[i], bits, bit_offset, output_data);
+ bit_offset += bits;
+ }
+ }
+}
+
+/* See header for documentation. */
+void decode_ise(
+ quant_method quant_level,
+ unsigned int character_count,
+ const uint8_t* input_data,
+ uint8_t* output_data,
+ unsigned int bit_offset
+) {
+ promise(character_count > 0);
+
+ // Note: due to how the trit/quint-block unpacking is done in this function, we may write more
+ // temporary results than the number of outputs. The maximum actual number of results is 64 bit,
+ // but we keep 4 additional character_count of padding.
+ uint8_t results[68];
+ uint8_t tq_blocks[22] { 0 }; // Trit-blocks or quint-blocks, must be zeroed
+
+ unsigned int bits = btq_counts[quant_level].bits;
+ unsigned int trits = btq_counts[quant_level].trits;
+ unsigned int quints = btq_counts[quant_level].quints;
+
+ unsigned int lcounter = 0;
+ unsigned int hcounter = 0;
+
+ // Collect bits for each element, as well as bits for any trit-blocks and quint-blocks.
+ for (unsigned int i = 0; i < character_count; i++)
+ {
+ results[i] = static_cast<uint8_t>(read_bits(bits, bit_offset, input_data));
+ bit_offset += bits;
+
+ if (trits)
+ {
+ static const unsigned int bits_to_read[5] { 2, 2, 1, 2, 1 };
+ static const unsigned int block_shift[5] { 0, 2, 4, 5, 7 };
+ static const unsigned int next_lcounter[5] { 1, 2, 3, 4, 0 };
+ static const unsigned int hcounter_incr[5] { 0, 0, 0, 0, 1 };
+ unsigned int tdata = read_bits(bits_to_read[lcounter], bit_offset, input_data);
+ bit_offset += bits_to_read[lcounter];
+ tq_blocks[hcounter] |= tdata << block_shift[lcounter];
+ hcounter += hcounter_incr[lcounter];
+ lcounter = next_lcounter[lcounter];
+ }
+
+ if (quints)
+ {
+ static const unsigned int bits_to_read[3] { 3, 2, 2 };
+ static const unsigned int block_shift[3] { 0, 3, 5 };
+ static const unsigned int next_lcounter[3] { 1, 2, 0 };
+ static const unsigned int hcounter_incr[3] { 0, 0, 1 };
+ unsigned int tdata = read_bits(bits_to_read[lcounter], bit_offset, input_data);
+ bit_offset += bits_to_read[lcounter];
+ tq_blocks[hcounter] |= tdata << block_shift[lcounter];
+ hcounter += hcounter_incr[lcounter];
+ lcounter = next_lcounter[lcounter];
+ }
+ }
+
+ // Unpack trit-blocks or quint-blocks as needed
+ if (trits)
+ {
+ unsigned int trit_blocks = (character_count + 4) / 5;
+ for (unsigned int i = 0; i < trit_blocks; i++)
+ {
+ const uint8_t *tritptr = trits_of_integer[tq_blocks[i]];
+ results[5 * i ] |= tritptr[0] << bits;
+ results[5 * i + 1] |= tritptr[1] << bits;
+ results[5 * i + 2] |= tritptr[2] << bits;
+ results[5 * i + 3] |= tritptr[3] << bits;
+ results[5 * i + 4] |= tritptr[4] << bits;
+ }
+ }
+
+ if (quints)
+ {
+ unsigned int quint_blocks = (character_count + 2) / 3;
+ for (unsigned int i = 0; i < quint_blocks; i++)
+ {
+ const uint8_t *quintptr = quints_of_integer[tq_blocks[i]];
+ results[3 * i ] |= quintptr[0] << bits;
+ results[3 * i + 1] |= quintptr[1] << bits;
+ results[3 * i + 2] |= quintptr[2] << bits;
+ }
+ }
+
+ for (unsigned int i = 0; i < character_count; i++)
+ {
+ output_data[i] = results[i];
+ }
+}
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_internal.h b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_internal.h
new file mode 100644
index 00000000000..0fa8ec67027
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_internal.h
@@ -0,0 +1,2185 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Functions and data declarations.
+ */
+
+#ifndef ASTCENC_INTERNAL_INCLUDED
+#define ASTCENC_INTERNAL_INCLUDED
+
+#include <algorithm>
+#include <cstddef>
+#include <cstdint>
+#if defined(ASTCENC_DIAGNOSTICS)
+ #include <cstdio>
+#endif
+#include <cstdlib>
+
+#include "astcenc.h"
+#include "astcenc_mathlib.h"
+#include "astcenc_vecmathlib.h"
+
+/**
+ * @brief Make a promise to the compiler's optimizer.
+ *
+ * A promise is an expression that the optimizer is can assume is true for to help it generate
+ * faster code. Common use cases for this are to promise that a for loop will iterate more than
+ * once, or that the loop iteration count is a multiple of a vector length, which avoids pre-loop
+ * checks and can avoid loop tails if loops are unrolled by the auto-vectorizer.
+ */
+#if defined(NDEBUG)
+ #if !defined(__clang__) && defined(_MSC_VER)
+ #define promise(cond) __assume(cond)
+ #elif defined(__clang__)
+ #if __has_builtin(__builtin_assume)
+ #define promise(cond) __builtin_assume(cond)
+ #elif __has_builtin(__builtin_unreachable)
+ #define promise(cond) if (!(cond)) { __builtin_unreachable(); }
+ #else
+ #define promise(cond)
+ #endif
+ #else // Assume GCC
+ #define promise(cond) if (!(cond)) { __builtin_unreachable(); }
+ #endif
+#else
+ #define promise(cond) assert(cond)
+#endif
+
+/* ============================================================================
+ Constants
+============================================================================ */
+#if !defined(ASTCENC_BLOCK_MAX_TEXELS)
+ #define ASTCENC_BLOCK_MAX_TEXELS 216 // A 3D 6x6x6 block
+#endif
+
+/** @brief The maximum number of texels a block can support (6x6x6 block). */
+static constexpr unsigned int BLOCK_MAX_TEXELS { ASTCENC_BLOCK_MAX_TEXELS };
+
+/** @brief The maximum number of components a block can support. */
+static constexpr unsigned int BLOCK_MAX_COMPONENTS { 4 };
+
+/** @brief The maximum number of partitions a block can support. */
+static constexpr unsigned int BLOCK_MAX_PARTITIONS { 4 };
+
+/** @brief The number of partitionings, per partition count, suported by the ASTC format. */
+static constexpr unsigned int BLOCK_MAX_PARTITIONINGS { 1024 };
+
+/** @brief The maximum number of weights used during partition selection for texel clustering. */
+static constexpr uint8_t BLOCK_MAX_KMEANS_TEXELS { 64 };
+
+/** @brief The maximum number of weights a block can support. */
+static constexpr unsigned int BLOCK_MAX_WEIGHTS { 64 };
+
+/** @brief The maximum number of weights a block can support per plane in 2 plane mode. */
+static constexpr unsigned int BLOCK_MAX_WEIGHTS_2PLANE { BLOCK_MAX_WEIGHTS / 2 };
+
+/** @brief The minimum number of weight bits a candidate encoding must encode. */
+static constexpr unsigned int BLOCK_MIN_WEIGHT_BITS { 24 };
+
+/** @brief The maximum number of weight bits a candidate encoding can encode. */
+static constexpr unsigned int BLOCK_MAX_WEIGHT_BITS { 96 };
+
+/** @brief The index indicating a bad (unused) block mode in the remap array. */
+static constexpr uint16_t BLOCK_BAD_BLOCK_MODE { 0xFFFFu };
+
+/** @brief The index indicating a bad (unused) partitioning in the remap array. */
+static constexpr uint16_t BLOCK_BAD_PARTITIONING { 0xFFFFu };
+
+/** @brief The number of partition index bits supported by the ASTC format . */
+static constexpr unsigned int PARTITION_INDEX_BITS { 10 };
+
+/** @brief The offset of the plane 2 weights in shared weight arrays. */
+static constexpr unsigned int WEIGHTS_PLANE2_OFFSET { BLOCK_MAX_WEIGHTS_2PLANE };
+
+/** @brief The sum of quantized weights for one texel. */
+static constexpr float WEIGHTS_TEXEL_SUM { 16.0f };
+
+/** @brief The number of block modes supported by the ASTC format. */
+static constexpr unsigned int WEIGHTS_MAX_BLOCK_MODES { 2048 };
+
+/** @brief The number of weight grid decimation modes supported by the ASTC format. */
+static constexpr unsigned int WEIGHTS_MAX_DECIMATION_MODES { 87 };
+
+/** @brief The high default error used to initialize error trackers. */
+static constexpr float ERROR_CALC_DEFAULT { 1e30f };
+
+/**
+ * @brief The minimum texel count for a block to use the one partition fast path.
+ *
+ * This setting skips 4x4 and 5x4 block sizes.
+ */
+static constexpr unsigned int TUNE_MIN_TEXELS_MODE0_FASTPATH { 24 };
+
+/**
+ * @brief The maximum number of candidate encodings tested for each encoding mode.
+ *
+ * This can be dynamically reduced by the compression quality preset.
+ */
+static constexpr unsigned int TUNE_MAX_TRIAL_CANDIDATES { 8 };
+
+/**
+ * @brief The maximum number of candidate partitionings tested for each encoding mode.
+ *
+ * This can be dynamically reduced by the compression quality preset.
+ */
+static constexpr unsigned int TUNE_MAX_PARTITIIONING_CANDIDATES { 32 };
+
+/**
+ * @brief The maximum quant level using full angular endpoint search method.
+ *
+ * The angular endpoint search is used to find the min/max weight that should
+ * be used for a given quantization level. It is effective but expensive, so
+ * we only use it where it has the most value - low quant levels with wide
+ * spacing. It is used below TUNE_MAX_ANGULAR_QUANT (inclusive). Above this we
+ * assume the min weight is 0.0f, and the max weight is 1.0f.
+ *
+ * Note the angular algorithm is vectorized, and using QUANT_12 exactly fills
+ * one 8-wide vector. Decreasing by one doesn't buy much performance, and
+ * increasing by one is disproportionately expensive.
+ */
+static constexpr unsigned int TUNE_MAX_ANGULAR_QUANT { 7 }; /* QUANT_12 */
+
+
+static_assert((BLOCK_MAX_TEXELS % ASTCENC_SIMD_WIDTH) == 0,
+ "BLOCK_MAX_TEXELS must be multiple of ASTCENC_SIMD_WIDTH");
+
+static_assert((BLOCK_MAX_WEIGHTS % ASTCENC_SIMD_WIDTH) == 0,
+ "BLOCK_MAX_WEIGHTS must be multiple of ASTCENC_SIMD_WIDTH");
+
+static_assert((WEIGHTS_MAX_BLOCK_MODES % ASTCENC_SIMD_WIDTH) == 0,
+ "WEIGHTS_MAX_BLOCK_MODES must be multiple of ASTCENC_SIMD_WIDTH");
+
+
+/* ============================================================================
+ Commonly used data structures
+============================================================================ */
+
+/**
+ * @brief The ASTC endpoint formats.
+ *
+ * Note, the values here are used directly in the encoding in the format so do not rearrange.
+ */
+enum endpoint_formats
+{
+ FMT_LUMINANCE = 0,
+ FMT_LUMINANCE_DELTA = 1,
+ FMT_HDR_LUMINANCE_LARGE_RANGE = 2,
+ FMT_HDR_LUMINANCE_SMALL_RANGE = 3,
+ FMT_LUMINANCE_ALPHA = 4,
+ FMT_LUMINANCE_ALPHA_DELTA = 5,
+ FMT_RGB_SCALE = 6,
+ FMT_HDR_RGB_SCALE = 7,
+ FMT_RGB = 8,
+ FMT_RGB_DELTA = 9,
+ FMT_RGB_SCALE_ALPHA = 10,
+ FMT_HDR_RGB = 11,
+ FMT_RGBA = 12,
+ FMT_RGBA_DELTA = 13,
+ FMT_HDR_RGB_LDR_ALPHA = 14,
+ FMT_HDR_RGBA = 15
+};
+
+/**
+ * @brief The ASTC quantization methods.
+ *
+ * Note, the values here are used directly in the encoding in the format so do not rearrange.
+ */
+enum quant_method
+{
+ QUANT_2 = 0,
+ QUANT_3 = 1,
+ QUANT_4 = 2,
+ QUANT_5 = 3,
+ QUANT_6 = 4,
+ QUANT_8 = 5,
+ QUANT_10 = 6,
+ QUANT_12 = 7,
+ QUANT_16 = 8,
+ QUANT_20 = 9,
+ QUANT_24 = 10,
+ QUANT_32 = 11,
+ QUANT_40 = 12,
+ QUANT_48 = 13,
+ QUANT_64 = 14,
+ QUANT_80 = 15,
+ QUANT_96 = 16,
+ QUANT_128 = 17,
+ QUANT_160 = 18,
+ QUANT_192 = 19,
+ QUANT_256 = 20
+};
+
+/**
+ * @brief The number of levels use by an ASTC quantization method.
+ *
+ * @param method The quantization method
+ *
+ * @return The number of levels used by @c method.
+ */
+static inline unsigned int get_quant_level(quant_method method)
+{
+ switch (method)
+ {
+ case QUANT_2: return 2;
+ case QUANT_3: return 3;
+ case QUANT_4: return 4;
+ case QUANT_5: return 5;
+ case QUANT_6: return 6;
+ case QUANT_8: return 8;
+ case QUANT_10: return 10;
+ case QUANT_12: return 12;
+ case QUANT_16: return 16;
+ case QUANT_20: return 20;
+ case QUANT_24: return 24;
+ case QUANT_32: return 32;
+ case QUANT_40: return 40;
+ case QUANT_48: return 48;
+ case QUANT_64: return 64;
+ case QUANT_80: return 80;
+ case QUANT_96: return 96;
+ case QUANT_128: return 128;
+ case QUANT_160: return 160;
+ case QUANT_192: return 192;
+ case QUANT_256: return 256;
+ }
+
+ // Unreachable - the enum is fully described
+ return 0;
+}
+
+/**
+ * @brief Computed metrics about a partition in a block.
+ */
+struct partition_metrics
+{
+ /** @brief The error-weighted average color in the partition. */
+ vfloat4 avg;
+
+ /** @brief The dominant error-weighted direction in the partition. */
+ vfloat4 dir;
+};
+
+/**
+ * @brief Computed lines for a a three component analysis.
+ */
+struct partition_lines3
+{
+ /** @brief Line for uncorrelated chroma. */
+ line3 uncor_line;
+
+ /** @brief Line for correlated chroma, passing though the origin. */
+ line3 samec_line;
+
+ /** @brief Post-processed line for uncorrelated chroma. */
+ processed_line3 uncor_pline;
+
+ /** @brief Post-processed line for correlated chroma, passing though the origin. */
+ processed_line3 samec_pline;
+
+ /** @brief The length of the line for uncorrelated chroma. */
+ float uncor_line_len;
+
+ /** @brief The length of the line for correlated chroma. */
+ float samec_line_len;
+};
+
+/**
+ * @brief The partition information for a single partition.
+ *
+ * ASTC has a total of 1024 candidate partitions for each of 2/3/4 partition counts, although this
+ * 1024 includes seeds that generate duplicates of other seeds and seeds that generate completely
+ * empty partitions. These are both valid encodings, but astcenc will skip both during compression
+ * as they are not useful.
+ */
+struct partition_info
+{
+ /** @brief The number of partitions in this partitioning. */
+ uint16_t partition_count;
+
+ /** @brief The index (seed) of this partitioning. */
+ uint16_t partition_index;
+
+ /**
+ * @brief The number of texels in each partition.
+ *
+ * Note that some seeds result in zero texels assigned to a partition are valid, but are skipped
+ * by this compressor as there is no point spending bits encoding an unused color endpoint.
+ */
+ uint8_t partition_texel_count[BLOCK_MAX_PARTITIONS];
+
+ /** @brief The partition of each texel in the block. */
+ uint8_t partition_of_texel[BLOCK_MAX_TEXELS];
+
+ /** @brief The list of texels in each partition. */
+ uint8_t texels_of_partition[BLOCK_MAX_PARTITIONS][BLOCK_MAX_TEXELS];
+};
+
+/**
+ * @brief The weight grid information for a single decimation pattern.
+ *
+ * ASTC can store one weight per texel, but is also capable of storing lower resolution weight grids
+ * that are interpolated during decompression to assign a with to a texel. Storing fewer weights
+ * can free up a substantial amount of bits that we can then spend on more useful things, such as
+ * more accurate endpoints and weights, or additional partitions.
+ *
+ * This data structure is used to store information about a single weight grid decimation pattern,
+ * for a single block size.
+ */
+struct decimation_info
+{
+ /** @brief The total number of texels in the block. */
+ uint8_t texel_count;
+
+ /** @brief The maximum number of stored weights that contribute to each texel, between 1 and 4. */
+ uint8_t max_texel_weight_count;
+
+ /** @brief The total number of weights stored. */
+ uint8_t weight_count;
+
+ /** @brief The number of stored weights in the X dimension. */
+ uint8_t weight_x;
+
+ /** @brief The number of stored weights in the Y dimension. */
+ uint8_t weight_y;
+
+ /** @brief The number of stored weights in the Z dimension. */
+ uint8_t weight_z;
+
+ /** @brief The number of stored weights that contribute to each texel, between 1 and 4. */
+ uint8_t texel_weight_count[BLOCK_MAX_TEXELS];
+
+ /** @brief The weight index of the N weights that need to be interpolated for each texel. */
+ uint8_t texel_weights_4t[4][BLOCK_MAX_TEXELS];
+
+ /** @brief The bilinear interpolation weighting of the N input weights for each texel, between 0 and 16. */
+ uint8_t texel_weights_int_4t[4][BLOCK_MAX_TEXELS];
+
+ /** @brief The bilinear interpolation weighting of the N input weights for each texel, between 0 and 1. */
+ alignas(ASTCENC_VECALIGN) float texel_weights_float_4t[4][BLOCK_MAX_TEXELS];
+
+ /** @brief The number of texels that each stored weight contributes to. */
+ uint8_t weight_texel_count[BLOCK_MAX_WEIGHTS];
+
+ /** @brief The list of weights that contribute to each texel. */
+ uint8_t weight_texel[BLOCK_MAX_TEXELS][BLOCK_MAX_WEIGHTS];
+
+ /** @brief The list of weight indices that contribute to each texel. */
+ alignas(ASTCENC_VECALIGN) float weights_flt[BLOCK_MAX_TEXELS][BLOCK_MAX_WEIGHTS];
+
+ /**
+ * @brief Folded structure for faster access:
+ * texel_weights_texel[i][j][.] = texel_weights[.][weight_texel[i][j]]
+ */
+ uint8_t texel_weights_texel[BLOCK_MAX_WEIGHTS][BLOCK_MAX_TEXELS][4];
+
+ /**
+ * @brief Folded structure for faster access:
+ * texel_weights_float_texel[i][j][.] = texel_weights_float[.][weight_texel[i][j]]
+ */
+ float texel_weights_float_texel[BLOCK_MAX_WEIGHTS][BLOCK_MAX_TEXELS][4];
+};
+
+/**
+ * @brief Metadata for single block mode for a specific block size.
+ */
+struct block_mode
+{
+ /** @brief The block mode index in the ASTC encoded form. */
+ uint16_t mode_index;
+
+ /** @brief The decimation mode index in the compressor reindexed list. */
+ uint8_t decimation_mode;
+
+ /** @brief The weight quantization used by this block mode. */
+ uint8_t quant_mode;
+
+ /** @brief The weight quantization used by this block mode. */
+ uint8_t weight_bits;
+
+ /** @brief Is a dual weight plane used by this block mode? */
+ uint8_t is_dual_plane : 1;
+
+ /**
+ * @brief Get the weight quantization used by this block mode.
+ *
+ * @return The quantization level.
+ */
+ inline quant_method get_weight_quant_mode() const
+ {
+ return static_cast<quant_method>(this->quant_mode);
+ }
+};
+
+/**
+ * @brief Metadata for single decimation mode for a specific block size.
+ */
+struct decimation_mode
+{
+ /** @brief The max weight precision for 1 plane, or -1 if not supported. */
+ int8_t maxprec_1plane;
+
+ /** @brief The max weight precision for 2 planes, or -1 if not supported. */
+ int8_t maxprec_2planes;
+
+ /**
+ * @brief Bitvector indicating weight quant modes used by active 1 plane block modes.
+ *
+ * Bit 0 = QUANT_2, Bit 1 = QUANT_3, etc.
+ */
+ uint16_t refprec_1_plane;
+
+ /**
+ * @brief Bitvector indicating weight quant methods used by active 2 plane block modes.
+ *
+ * Bit 0 = QUANT_2, Bit 1 = QUANT_3, etc.
+ */
+ uint16_t refprec_2_planes;
+
+ /**
+ * @brief Set a 1 plane weight quant as active.
+ *
+ * @param weight_quant The quant method to set.
+ */
+ void set_ref_1_plane(quant_method weight_quant)
+ {
+ refprec_1_plane |= (1 << weight_quant);
+ }
+
+ /**
+ * @brief Test if this mode is active below a given 1 plane weight quant (inclusive).
+ *
+ * @param max_weight_quant The max quant method to test.
+ */
+ bool is_ref_1_plane(quant_method max_weight_quant) const
+ {
+ uint16_t mask = static_cast<uint16_t>((1 << (max_weight_quant + 1)) - 1);
+ return (refprec_1_plane & mask) != 0;
+ }
+
+ /**
+ * @brief Set a 2 plane weight quant as active.
+ *
+ * @param weight_quant The quant method to set.
+ */
+ void set_ref_2_plane(quant_method weight_quant)
+ {
+ refprec_2_planes |= static_cast<uint16_t>(1 << weight_quant);
+ }
+
+ /**
+ * @brief Test if this mode is active below a given 2 plane weight quant (inclusive).
+ *
+ * @param max_weight_quant The max quant method to test.
+ */
+ bool is_ref_2_plane(quant_method max_weight_quant) const
+ {
+ uint16_t mask = static_cast<uint16_t>((1 << (max_weight_quant + 1)) - 1);
+ return (refprec_2_planes & mask) != 0;
+ }
+};
+
+/**
+ * @brief Data tables for a single block size.
+ *
+ * The decimation tables store the information to apply weight grid dimension reductions. We only
+ * store the decimation modes that are actually needed by the current context; many of the possible
+ * modes will be unused (too many weights for the current block size or disabled by heuristics). The
+ * actual number of weights stored is @c decimation_mode_count, and the @c decimation_modes and
+ * @c decimation_tables arrays store the active modes contiguously at the start of the array. These
+ * entries are not stored in any particular order.
+ *
+ * The block mode tables store the unpacked block mode settings. Block modes are stored in the
+ * compressed block as an 11 bit field, but for any given block size and set of compressor
+ * heuristics, only a subset of the block modes will be used. The actual number of block modes
+ * stored is indicated in @c block_mode_count, and the @c block_modes array store the active modes
+ * contiguously at the start of the array. These entries are stored in incrementing "packed" value
+ * order, which doesn't mean much once unpacked. To allow decompressors to reference the packed data
+ * efficiently the @c block_mode_packed_index array stores the mapping between physical ID and the
+ * actual remapped array index.
+ */
+struct block_size_descriptor
+{
+ /** @brief The block X dimension, in texels. */
+ uint8_t xdim;
+
+ /** @brief The block Y dimension, in texels. */
+ uint8_t ydim;
+
+ /** @brief The block Z dimension, in texels. */
+ uint8_t zdim;
+
+ /** @brief The block total texel count. */
+ uint8_t texel_count;
+
+ /**
+ * @brief The number of stored decimation modes which are "always" modes.
+ *
+ * Always modes are stored at the start of the decimation_modes list.
+ */
+ unsigned int decimation_mode_count_always;
+
+ /** @brief The number of stored decimation modes for selected encodings. */
+ unsigned int decimation_mode_count_selected;
+
+ /** @brief The number of stored decimation modes for any encoding. */
+ unsigned int decimation_mode_count_all;
+
+ /**
+ * @brief The number of stored block modes which are "always" modes.
+ *
+ * Always modes are stored at the start of the block_modes list.
+ */
+ unsigned int block_mode_count_1plane_always;
+
+ /** @brief The number of stored block modes for active 1 plane encodings. */
+ unsigned int block_mode_count_1plane_selected;
+
+ /** @brief The number of stored block modes for active 1 and 2 plane encodings. */
+ unsigned int block_mode_count_1plane_2plane_selected;
+
+ /** @brief The number of stored block modes for any encoding. */
+ unsigned int block_mode_count_all;
+
+ /** @brief The number of selected partitionings for 1/2/3/4 partitionings. */
+ unsigned int partitioning_count_selected[BLOCK_MAX_PARTITIONS];
+
+ /** @brief The number of partitionings for 1/2/3/4 partitionings. */
+ unsigned int partitioning_count_all[BLOCK_MAX_PARTITIONS];
+
+ /** @brief The active decimation modes, stored in low indices. */
+ decimation_mode decimation_modes[WEIGHTS_MAX_DECIMATION_MODES];
+
+ /** @brief The active decimation tables, stored in low indices. */
+ alignas(ASTCENC_VECALIGN) decimation_info decimation_tables[WEIGHTS_MAX_DECIMATION_MODES];
+
+ /** @brief The packed block mode array index, or @c BLOCK_BAD_BLOCK_MODE if not active. */
+ uint16_t block_mode_packed_index[WEIGHTS_MAX_BLOCK_MODES];
+
+ /** @brief The active block modes, stored in low indices. */
+ block_mode block_modes[WEIGHTS_MAX_BLOCK_MODES];
+
+ /** @brief The active partition tables, stored in low indices per-count. */
+ partition_info partitionings[(3 * BLOCK_MAX_PARTITIONINGS) + 1];
+
+ /**
+ * @brief The packed partition table array index, or @c BLOCK_BAD_PARTITIONING if not active.
+ *
+ * Indexed by partition_count - 2, containing 2, 3 and 4 partitions.
+ */
+ uint16_t partitioning_packed_index[3][BLOCK_MAX_PARTITIONINGS];
+
+ /** @brief The active texels for k-means partition selection. */
+ uint8_t kmeans_texels[BLOCK_MAX_KMEANS_TEXELS];
+
+ /**
+ * @brief The canonical 2-partition coverage pattern used during block partition search.
+ *
+ * Indexed by remapped index, not physical index.
+ */
+ uint64_t coverage_bitmaps_2[BLOCK_MAX_PARTITIONINGS][2];
+
+ /**
+ * @brief The canonical 3-partition coverage pattern used during block partition search.
+ *
+ * Indexed by remapped index, not physical index.
+ */
+ uint64_t coverage_bitmaps_3[BLOCK_MAX_PARTITIONINGS][3];
+
+ /**
+ * @brief The canonical 4-partition coverage pattern used during block partition search.
+ *
+ * Indexed by remapped index, not physical index.
+ */
+ uint64_t coverage_bitmaps_4[BLOCK_MAX_PARTITIONINGS][4];
+
+ /**
+ * @brief Get the block mode structure for index @c block_mode.
+ *
+ * This function can only return block modes that are enabled by the current compressor config.
+ * Decompression from an arbitrary source should not use this without first checking that the
+ * packed block mode index is not @c BLOCK_BAD_BLOCK_MODE.
+ *
+ * @param block_mode The packed block mode index.
+ *
+ * @return The block mode structure.
+ */
+ const block_mode& get_block_mode(unsigned int block_mode) const
+ {
+ unsigned int packed_index = this->block_mode_packed_index[block_mode];
+ assert(packed_index != BLOCK_BAD_BLOCK_MODE && packed_index < this->block_mode_count_all);
+ return this->block_modes[packed_index];
+ }
+
+ /**
+ * @brief Get the decimation mode structure for index @c decimation_mode.
+ *
+ * This function can only return decimation modes that are enabled by the current compressor
+ * config. The mode array is stored packed, but this is only ever indexed by the packed index
+ * stored in the @c block_mode and never exists in an unpacked form.
+ *
+ * @param decimation_mode The packed decimation mode index.
+ *
+ * @return The decimation mode structure.
+ */
+ const decimation_mode& get_decimation_mode(unsigned int decimation_mode) const
+ {
+ return this->decimation_modes[decimation_mode];
+ }
+
+ /**
+ * @brief Get the decimation info structure for index @c decimation_mode.
+ *
+ * This function can only return decimation modes that are enabled by the current compressor
+ * config. The mode array is stored packed, but this is only ever indexed by the packed index
+ * stored in the @c block_mode and never exists in an unpacked form.
+ *
+ * @param decimation_mode The packed decimation mode index.
+ *
+ * @return The decimation info structure.
+ */
+ const decimation_info& get_decimation_info(unsigned int decimation_mode) const
+ {
+ return this->decimation_tables[decimation_mode];
+ }
+
+ /**
+ * @brief Get the partition info table for a given partition count.
+ *
+ * @param partition_count The number of partitions we want the table for.
+ *
+ * @return The pointer to the table of 1024 entries (for 2/3/4 parts) or 1 entry (for 1 part).
+ */
+ const partition_info* get_partition_table(unsigned int partition_count) const
+ {
+ if (partition_count == 1)
+ {
+ partition_count = 5;
+ }
+ unsigned int index = (partition_count - 2) * BLOCK_MAX_PARTITIONINGS;
+ return this->partitionings + index;
+ }
+
+ /**
+ * @brief Get the partition info structure for a given partition count and seed.
+ *
+ * @param partition_count The number of partitions we want the info for.
+ * @param index The partition seed (between 0 and 1023).
+ *
+ * @return The partition info structure.
+ */
+ const partition_info& get_partition_info(unsigned int partition_count, unsigned int index) const
+ {
+ unsigned int packed_index = 0;
+ if (partition_count >= 2)
+ {
+ packed_index = this->partitioning_packed_index[partition_count - 2][index];
+ }
+
+ assert(packed_index != BLOCK_BAD_PARTITIONING && packed_index < this->partitioning_count_all[partition_count - 1]);
+ auto& result = get_partition_table(partition_count)[packed_index];
+ assert(index == result.partition_index);
+ return result;
+ }
+
+ /**
+ * @brief Get the partition info structure for a given partition count and seed.
+ *
+ * @param partition_count The number of partitions we want the info for.
+ * @param packed_index The raw array offset.
+ *
+ * @return The partition info structure.
+ */
+ const partition_info& get_raw_partition_info(unsigned int partition_count, unsigned int packed_index) const
+ {
+ assert(packed_index != BLOCK_BAD_PARTITIONING && packed_index < this->partitioning_count_all[partition_count - 1]);
+ auto& result = get_partition_table(partition_count)[packed_index];
+ return result;
+ }
+};
+
+/**
+ * @brief The image data for a single block.
+ *
+ * The @c data_[rgba] fields store the image data in an encoded SoA float form designed for easy
+ * vectorization. Input data is converted to float and stored as values between 0 and 65535. LDR
+ * data is stored as direct UNORM data, HDR data is stored as LNS data.
+ *
+ * The @c rgb_lns and @c alpha_lns fields that assigned a per-texel use of HDR are only used during
+ * decompression. The current compressor will always use HDR endpoint formats when in HDR mode.
+ */
+struct image_block
+{
+ /** @brief The input (compress) or output (decompress) data for the red color component. */
+ alignas(ASTCENC_VECALIGN) float data_r[BLOCK_MAX_TEXELS];
+
+ /** @brief The input (compress) or output (decompress) data for the green color component. */
+ alignas(ASTCENC_VECALIGN) float data_g[BLOCK_MAX_TEXELS];
+
+ /** @brief The input (compress) or output (decompress) data for the blue color component. */
+ alignas(ASTCENC_VECALIGN) float data_b[BLOCK_MAX_TEXELS];
+
+ /** @brief The input (compress) or output (decompress) data for the alpha color component. */
+ alignas(ASTCENC_VECALIGN) float data_a[BLOCK_MAX_TEXELS];
+
+ /** @brief The number of texels in the block. */
+ uint8_t texel_count;
+
+ /** @brief The original data for texel 0 for constant color block encoding. */
+ vfloat4 origin_texel;
+
+ /** @brief The min component value of all texels in the block. */
+ vfloat4 data_min;
+
+ /** @brief The mean component value of all texels in the block. */
+ vfloat4 data_mean;
+
+ /** @brief The max component value of all texels in the block. */
+ vfloat4 data_max;
+
+ /** @brief The relative error significance of the color channels. */
+ vfloat4 channel_weight;
+
+ /** @brief Is this grayscale block where R == G == B for all texels? */
+ bool grayscale;
+
+ /** @brief Set to 1 if a texel is using HDR RGB endpoints (decompression only). */
+ uint8_t rgb_lns[BLOCK_MAX_TEXELS];
+
+ /** @brief Set to 1 if a texel is using HDR alpha endpoints (decompression only). */
+ uint8_t alpha_lns[BLOCK_MAX_TEXELS];
+
+ /** @brief The X position of this block in the input or output image. */
+ unsigned int xpos;
+
+ /** @brief The Y position of this block in the input or output image. */
+ unsigned int ypos;
+
+ /** @brief The Z position of this block in the input or output image. */
+ unsigned int zpos;
+
+ /**
+ * @brief Get an RGBA texel value from the data.
+ *
+ * @param index The texel index.
+ *
+ * @return The texel in RGBA component ordering.
+ */
+ inline vfloat4 texel(unsigned int index) const
+ {
+ return vfloat4(data_r[index],
+ data_g[index],
+ data_b[index],
+ data_a[index]);
+ }
+
+ /**
+ * @brief Get an RGB texel value from the data.
+ *
+ * @param index The texel index.
+ *
+ * @return The texel in RGB0 component ordering.
+ */
+ inline vfloat4 texel3(unsigned int index) const
+ {
+ return vfloat3(data_r[index],
+ data_g[index],
+ data_b[index]);
+ }
+
+ /**
+ * @brief Get the default alpha value for endpoints that don't store it.
+ *
+ * The default depends on whether the alpha endpoint is LDR or HDR.
+ *
+ * @return The alpha value in the scaled range used by the compressor.
+ */
+ inline float get_default_alpha() const
+ {
+ return this->alpha_lns[0] ? static_cast<float>(0x7800) : static_cast<float>(0xFFFF);
+ }
+
+ /**
+ * @brief Test if a single color channel is constant across the block.
+ *
+ * Constant color channels are easier to compress as interpolating between two identical colors
+ * always returns the same value, irrespective of the weight used. They therefore can be ignored
+ * for the purposes of weight selection and use of a second weight plane.
+ *
+ * @return @c true if the channel is constant across the block, @c false otherwise.
+ */
+ inline bool is_constant_channel(int channel) const
+ {
+ vmask4 lane_mask = vint4::lane_id() == vint4(channel);
+ vmask4 color_mask = this->data_min == this->data_max;
+ return any(lane_mask & color_mask);
+ }
+
+ /**
+ * @brief Test if this block is a luminance block with constant 1.0 alpha.
+ *
+ * @return @c true if the block is a luminance block , @c false otherwise.
+ */
+ inline bool is_luminance() const
+ {
+ float default_alpha = this->get_default_alpha();
+ bool alpha1 = (this->data_min.lane<3>() == default_alpha) &&
+ (this->data_max.lane<3>() == default_alpha);
+ return this->grayscale && alpha1;
+ }
+
+ /**
+ * @brief Test if this block is a luminance block with variable alpha.
+ *
+ * @return @c true if the block is a luminance + alpha block , @c false otherwise.
+ */
+ inline bool is_luminancealpha() const
+ {
+ float default_alpha = this->get_default_alpha();
+ bool alpha1 = (this->data_min.lane<3>() == default_alpha) &&
+ (this->data_max.lane<3>() == default_alpha);
+ return this->grayscale && !alpha1;
+ }
+};
+
+/**
+ * @brief Data structure storing the color endpoints for a block.
+ */
+struct endpoints
+{
+ /** @brief The number of partition endpoints stored. */
+ unsigned int partition_count;
+
+ /** @brief The colors for endpoint 0. */
+ vfloat4 endpt0[BLOCK_MAX_PARTITIONS];
+
+ /** @brief The colors for endpoint 1. */
+ vfloat4 endpt1[BLOCK_MAX_PARTITIONS];
+};
+
+/**
+ * @brief Data structure storing the color endpoints and weights.
+ */
+struct endpoints_and_weights
+{
+ /** @brief True if all active values in weight_error_scale are the same. */
+ bool is_constant_weight_error_scale;
+
+ /** @brief The color endpoints. */
+ endpoints ep;
+
+ /** @brief The ideal weight for each texel; may be undecimated or decimated. */
+ alignas(ASTCENC_VECALIGN) float weights[BLOCK_MAX_TEXELS];
+
+ /** @brief The ideal weight error scaling for each texel; may be undecimated or decimated. */
+ alignas(ASTCENC_VECALIGN) float weight_error_scale[BLOCK_MAX_TEXELS];
+};
+
+/**
+ * @brief Utility storing estimated errors from choosing particular endpoint encodings.
+ */
+struct encoding_choice_errors
+{
+ /** @brief Error of using LDR RGB-scale instead of complete endpoints. */
+ float rgb_scale_error;
+
+ /** @brief Error of using HDR RGB-scale instead of complete endpoints. */
+ float rgb_luma_error;
+
+ /** @brief Error of using luminance instead of RGB. */
+ float luminance_error;
+
+ /** @brief Error of discarding alpha and using a constant 1.0 alpha. */
+ float alpha_drop_error;
+
+ /** @brief Can we use delta offset encoding? */
+ bool can_offset_encode;
+
+ /** @brief Can we use blue contraction encoding? */
+ bool can_blue_contract;
+};
+
+/**
+ * @brief Preallocated working buffers, allocated per thread during context creation.
+ */
+struct alignas(ASTCENC_VECALIGN) compression_working_buffers
+{
+ /** @brief Ideal endpoints and weights for plane 1. */
+ endpoints_and_weights ei1;
+
+ /** @brief Ideal endpoints and weights for plane 2. */
+ endpoints_and_weights ei2;
+
+ /**
+ * @brief Decimated ideal weight values in the ~0-1 range.
+ *
+ * Note that values can be slightly below zero or higher than one due to
+ * endpoint extents being inside the ideal color representation.
+ *
+ * For two planes, second plane starts at @c WEIGHTS_PLANE2_OFFSET offsets.
+ */
+ alignas(ASTCENC_VECALIGN) float dec_weights_ideal[WEIGHTS_MAX_DECIMATION_MODES * BLOCK_MAX_WEIGHTS];
+
+ /**
+ * @brief Decimated quantized weight values in the unquantized 0-64 range.
+ *
+ * For two planes, second plane starts at @c WEIGHTS_PLANE2_OFFSET offsets.
+ */
+ uint8_t dec_weights_uquant[WEIGHTS_MAX_BLOCK_MODES * BLOCK_MAX_WEIGHTS];
+
+ /** @brief Error of the best encoding combination for each block mode. */
+ alignas(ASTCENC_VECALIGN) float errors_of_best_combination[WEIGHTS_MAX_BLOCK_MODES];
+
+ /** @brief The best color quant for each block mode. */
+ uint8_t best_quant_levels[WEIGHTS_MAX_BLOCK_MODES];
+
+ /** @brief The best color quant for each block mode if modes are the same and we have spare bits. */
+ uint8_t best_quant_levels_mod[WEIGHTS_MAX_BLOCK_MODES];
+
+ /** @brief The best endpoint format for each partition. */
+ uint8_t best_ep_formats[WEIGHTS_MAX_BLOCK_MODES][BLOCK_MAX_PARTITIONS];
+
+ /** @brief The total bit storage needed for quantized weights for each block mode. */
+ int8_t qwt_bitcounts[WEIGHTS_MAX_BLOCK_MODES];
+
+ /** @brief The cumulative error for quantized weights for each block mode. */
+ float qwt_errors[WEIGHTS_MAX_BLOCK_MODES];
+
+ /** @brief The low weight value in plane 1 for each block mode. */
+ float weight_low_value1[WEIGHTS_MAX_BLOCK_MODES];
+
+ /** @brief The high weight value in plane 1 for each block mode. */
+ float weight_high_value1[WEIGHTS_MAX_BLOCK_MODES];
+
+ /** @brief The low weight value in plane 1 for each quant level and decimation mode. */
+ float weight_low_values1[WEIGHTS_MAX_DECIMATION_MODES][TUNE_MAX_ANGULAR_QUANT + 1];
+
+ /** @brief The high weight value in plane 1 for each quant level and decimation mode. */
+ float weight_high_values1[WEIGHTS_MAX_DECIMATION_MODES][TUNE_MAX_ANGULAR_QUANT + 1];
+
+ /** @brief The low weight value in plane 2 for each block mode. */
+ float weight_low_value2[WEIGHTS_MAX_BLOCK_MODES];
+
+ /** @brief The high weight value in plane 2 for each block mode. */
+ float weight_high_value2[WEIGHTS_MAX_BLOCK_MODES];
+
+ /** @brief The low weight value in plane 2 for each quant level and decimation mode. */
+ float weight_low_values2[WEIGHTS_MAX_DECIMATION_MODES][TUNE_MAX_ANGULAR_QUANT + 1];
+
+ /** @brief The high weight value in plane 2 for each quant level and decimation mode. */
+ float weight_high_values2[WEIGHTS_MAX_DECIMATION_MODES][TUNE_MAX_ANGULAR_QUANT + 1];
+};
+
+struct dt_init_working_buffers
+{
+ uint8_t weight_count_of_texel[BLOCK_MAX_TEXELS];
+ uint8_t grid_weights_of_texel[BLOCK_MAX_TEXELS][4];
+ uint8_t weights_of_texel[BLOCK_MAX_TEXELS][4];
+
+ uint8_t texel_count_of_weight[BLOCK_MAX_WEIGHTS];
+ uint8_t texels_of_weight[BLOCK_MAX_WEIGHTS][BLOCK_MAX_TEXELS];
+ uint8_t texel_weights_of_weight[BLOCK_MAX_WEIGHTS][BLOCK_MAX_TEXELS];
+};
+
+/**
+ * @brief Weight quantization transfer table.
+ *
+ * ASTC can store texel weights at many quantization levels, so for performance we store essential
+ * information about each level as a precomputed data structure. Unquantized weights are integers
+ * or floats in the range [0, 64].
+ *
+ * This structure provides a table, used to estimate the closest quantized weight for a given
+ * floating-point weight. For each quantized weight, the corresponding unquantized values. For each
+ * quantized weight, a previous-value and a next-value.
+*/
+struct quant_and_transfer_table
+{
+ /** @brief The quantization level used. */
+ quant_method method;
+
+ /** @brief The unscrambled unquantized value. */
+ int8_t quant_to_unquant[32];
+
+ /** @brief The scrambling order: scrambled_quant = map[unscrambled_quant]. */
+ int8_t scramble_map[32];
+
+ /** @brief The unscrambling order: unscrambled_unquant = map[scrambled_quant]. */
+ int8_t unscramble_and_unquant_map[32];
+
+ /**
+ * @brief A table of previous-and-next weights, indexed by the current unquantized value.
+ * * bits 7:0 = previous-index, unquantized
+ * * bits 15:8 = next-index, unquantized
+ */
+ uint16_t prev_next_values[65];
+};
+
+/** @brief The precomputed quant and transfer table. */
+extern const quant_and_transfer_table quant_and_xfer_tables[12];
+
+/** @brief The block is an error block, and will return error color or NaN. */
+static constexpr uint8_t SYM_BTYPE_ERROR { 0 };
+
+/** @brief The block is a constant color block using FP16 colors. */
+static constexpr uint8_t SYM_BTYPE_CONST_F16 { 1 };
+
+/** @brief The block is a constant color block using UNORM16 colors. */
+static constexpr uint8_t SYM_BTYPE_CONST_U16 { 2 };
+
+/** @brief The block is a normal non-constant color block. */
+static constexpr uint8_t SYM_BTYPE_NONCONST { 3 };
+
+/**
+ * @brief A symbolic representation of a compressed block.
+ *
+ * The symbolic representation stores the unpacked content of a single
+ * @c physical_compressed_block, in a form which is much easier to access for
+ * the rest of the compressor code.
+ */
+struct symbolic_compressed_block
+{
+ /** @brief The block type, one of the @c SYM_BTYPE_* constants. */
+ uint8_t block_type;
+
+ /** @brief The number of partitions; valid for @c NONCONST blocks. */
+ uint8_t partition_count;
+
+ /** @brief Non-zero if the color formats matched; valid for @c NONCONST blocks. */
+ uint8_t color_formats_matched;
+
+ /** @brief The plane 2 color component, or -1 if single plane; valid for @c NONCONST blocks. */
+ int8_t plane2_component;
+
+ /** @brief The block mode; valid for @c NONCONST blocks. */
+ uint16_t block_mode;
+
+ /** @brief The partition index; valid for @c NONCONST blocks if 2 or more partitions. */
+ uint16_t partition_index;
+
+ /** @brief The endpoint color formats for each partition; valid for @c NONCONST blocks. */
+ uint8_t color_formats[BLOCK_MAX_PARTITIONS];
+
+ /** @brief The endpoint color quant mode; valid for @c NONCONST blocks. */
+ quant_method quant_mode;
+
+ /** @brief The error of the current encoding; valid for @c NONCONST blocks. */
+ float errorval;
+
+ // We can't have both of these at the same time
+ union {
+ /** @brief The constant color; valid for @c CONST blocks. */
+ int constant_color[BLOCK_MAX_COMPONENTS];
+
+ /** @brief The quantized endpoint color pairs; valid for @c NONCONST blocks. */
+ uint8_t color_values[BLOCK_MAX_PARTITIONS][8];
+ };
+
+ /** @brief The quantized and decimated weights.
+ *
+ * Weights are stored in the 0-64 unpacked range allowing them to be used
+ * directly in encoding passes without per-use unpacking. Packing happens
+ * when converting to/from the physical bitstream encoding.
+ *
+ * If dual plane, the second plane starts at @c weights[WEIGHTS_PLANE2_OFFSET].
+ */
+ uint8_t weights[BLOCK_MAX_WEIGHTS];
+
+ /**
+ * @brief Get the weight quantization used by this block mode.
+ *
+ * @return The quantization level.
+ */
+ inline quant_method get_color_quant_mode() const
+ {
+ return this->quant_mode;
+ }
+};
+
+/**
+ * @brief A physical representation of a compressed block.
+ *
+ * The physical representation stores the raw bytes of the format in memory.
+ */
+struct physical_compressed_block
+{
+ /** @brief The ASTC encoded data for a single block. */
+ uint8_t data[16];
+};
+
+
+/**
+ * @brief Parameter structure for @c compute_pixel_region_variance().
+ *
+ * This function takes a structure to avoid spilling arguments to the stack on every function
+ * invocation, as there are a lot of parameters.
+ */
+struct pixel_region_args
+{
+ /** @brief The image to analyze. */
+ const astcenc_image* img;
+
+ /** @brief The component swizzle pattern. */
+ astcenc_swizzle swz;
+
+ /** @brief Should the algorithm bother with Z axis processing? */
+ bool have_z;
+
+ /** @brief The kernel radius for alpha processing. */
+ unsigned int alpha_kernel_radius;
+
+ /** @brief The X dimension of the working data to process. */
+ unsigned int size_x;
+
+ /** @brief The Y dimension of the working data to process. */
+ unsigned int size_y;
+
+ /** @brief The Z dimension of the working data to process. */
+ unsigned int size_z;
+
+ /** @brief The X position of first src and dst data in the data set. */
+ unsigned int offset_x;
+
+ /** @brief The Y position of first src and dst data in the data set. */
+ unsigned int offset_y;
+
+ /** @brief The Z position of first src and dst data in the data set. */
+ unsigned int offset_z;
+
+ /** @brief The working memory buffer. */
+ vfloat4 *work_memory;
+};
+
+/**
+ * @brief Parameter structure for @c compute_averages_proc().
+ */
+struct avg_args
+{
+ /** @brief The arguments for the nested variance computation. */
+ pixel_region_args arg;
+
+ /** @brief The image X dimensions. */
+ unsigned int img_size_x;
+
+ /** @brief The image Y dimensions. */
+ unsigned int img_size_y;
+
+ /** @brief The image Z dimensions. */
+ unsigned int img_size_z;
+
+ /** @brief The maximum working block dimensions in X and Y dimensions. */
+ unsigned int blk_size_xy;
+
+ /** @brief The maximum working block dimensions in Z dimensions. */
+ unsigned int blk_size_z;
+
+ /** @brief The working block memory size. */
+ unsigned int work_memory_size;
+};
+
+#if defined(ASTCENC_DIAGNOSTICS)
+/* See astcenc_diagnostic_trace header for details. */
+class TraceLog;
+#endif
+
+/**
+ * @brief The astcenc compression context.
+ */
+struct astcenc_contexti
+{
+ /** @brief The configuration this context was created with. */
+ astcenc_config config;
+
+ /** @brief The thread count supported by this context. */
+ unsigned int thread_count;
+
+ /** @brief The block size descriptor this context was created with. */
+ block_size_descriptor* bsd;
+
+ /*
+ * Fields below here are not needed in a decompress-only build, but some remain as they are
+ * small and it avoids littering the code with #ifdefs. The most significant contributors to
+ * large structure size are omitted.
+ */
+
+ /** @brief The input image alpha channel averages table, may be @c nullptr if not needed. */
+ float* input_alpha_averages;
+
+ /** @brief The scratch working buffers, one per thread (see @c thread_count). */
+ compression_working_buffers* working_buffers;
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+ /** @brief The pixel region and variance worker arguments. */
+ avg_args avg_preprocess_args;
+#endif
+
+#if defined(ASTCENC_DIAGNOSTICS)
+ /**
+ * @brief The diagnostic trace logger.
+ *
+ * Note that this is a singleton, so can only be used in single threaded mode. It only exists
+ * here so we have a reference to close the file at the end of the capture.
+ */
+ TraceLog* trace_log;
+#endif
+};
+
+/* ============================================================================
+ Functionality for managing block sizes and partition tables.
+============================================================================ */
+
+/**
+ * @brief Populate the block size descriptor for the target block size.
+ *
+ * This will also initialize the partition table metadata, which is stored as part of the BSD
+ * structure.
+ *
+ * @param x_texels The number of texels in the block X dimension.
+ * @param y_texels The number of texels in the block Y dimension.
+ * @param z_texels The number of texels in the block Z dimension.
+ * @param can_omit_modes Can we discard modes and partitionings that astcenc won't use?
+ * @param partition_count_cutoff The partition count cutoff to use, if we can omit partitionings.
+ * @param mode_cutoff The block mode percentile cutoff [0-1].
+ * @param[out] bsd The descriptor to initialize.
+ */
+void init_block_size_descriptor(
+ unsigned int x_texels,
+ unsigned int y_texels,
+ unsigned int z_texels,
+ bool can_omit_modes,
+ unsigned int partition_count_cutoff,
+ float mode_cutoff,
+ block_size_descriptor& bsd);
+
+/**
+ * @brief Populate the partition tables for the target block size.
+ *
+ * Note the @c bsd descriptor must be initialized by calling @c init_block_size_descriptor() before
+ * calling this function.
+ *
+ * @param[out] bsd The block size information structure to populate.
+ * @param can_omit_partitionings True if we can we drop partitionings that astcenc won't use.
+ * @param partition_count_cutoff The partition count cutoff to use, if we can omit partitionings.
+ */
+void init_partition_tables(
+ block_size_descriptor& bsd,
+ bool can_omit_partitionings,
+ unsigned int partition_count_cutoff);
+
+/**
+ * @brief Get the percentile table for 2D block modes.
+ *
+ * This is an empirically determined prioritization of which block modes to use in the search in
+ * terms of their centile (lower centiles = more useful).
+ *
+ * Returns a dynamically allocated array; caller must free with delete[].
+ *
+ * @param xdim The block x size.
+ * @param ydim The block y size.
+ *
+ * @return The unpacked table.
+ */
+const float* get_2d_percentile_table(
+ unsigned int xdim,
+ unsigned int ydim);
+
+/**
+ * @brief Query if a 2D block size is legal.
+ *
+ * @return True if legal, false otherwise.
+ */
+bool is_legal_2d_block_size(
+ unsigned int xdim,
+ unsigned int ydim);
+
+/**
+ * @brief Query if a 3D block size is legal.
+ *
+ * @return True if legal, false otherwise.
+ */
+bool is_legal_3d_block_size(
+ unsigned int xdim,
+ unsigned int ydim,
+ unsigned int zdim);
+
+/* ============================================================================
+ Functionality for managing BISE quantization and unquantization.
+============================================================================ */
+
+/**
+ * @brief The precomputed table for quantizing color values.
+ *
+ * Converts unquant value in 0-255 range into quant value in 0-255 range.
+ * No BISE scrambling is applied at this stage.
+ *
+ * Indexed by [quant_mode - 4][data_value].
+ */
+extern const uint8_t color_unquant_to_uquant_tables[17][256];
+
+/**
+ * @brief The precomputed table for packing quantized color values.
+ *
+ * Converts quant value in 0-255 range into packed quant value in 0-N range,
+ * with BISE scrambling applied.
+ *
+ * Indexed by [quant_mode - 4][data_value].
+ */
+extern const uint8_t color_uquant_to_scrambled_pquant_tables[17][256];
+
+/**
+ * @brief The precomputed table for unpacking color values.
+ *
+ * Converts quant value in 0-N range into unpacked value in 0-255 range,
+ * with BISE unscrambling applied.
+ *
+ * Indexed by [quant_mode - 4][data_value].
+ */
+extern const uint8_t* color_scrambled_pquant_to_uquant_tables[17];
+
+/**
+ * @brief The precomputed quant mode storage table.
+ *
+ * Indexing by [integer_count/2][bits] gives us the quantization level for a given integer count and
+ * number of compressed storage bits. Returns -1 for cases where the requested integer count cannot
+ * ever fit in the supplied storage size.
+ */
+extern const int8_t quant_mode_table[10][128];
+
+/**
+ * @brief Encode a packed string using BISE.
+ *
+ * Note that BISE can return strings that are not a whole number of bytes in length, and ASTC can
+ * start storing strings in a block at arbitrary bit offsets in the encoded data.
+ *
+ * @param quant_level The BISE alphabet size.
+ * @param character_count The number of characters in the string.
+ * @param input_data The unpacked string, one byte per character.
+ * @param[in,out] output_data The output packed string.
+ * @param bit_offset The starting offset in the output storage.
+ */
+void encode_ise(
+ quant_method quant_level,
+ unsigned int character_count,
+ const uint8_t* input_data,
+ uint8_t* output_data,
+ unsigned int bit_offset);
+
+/**
+ * @brief Decode a packed string using BISE.
+ *
+ * Note that BISE input strings are not a whole number of bytes in length, and ASTC can start
+ * strings at arbitrary bit offsets in the encoded data.
+ *
+ * @param quant_level The BISE alphabet size.
+ * @param character_count The number of characters in the string.
+ * @param input_data The packed string.
+ * @param[in,out] output_data The output storage, one byte per character.
+ * @param bit_offset The starting offset in the output storage.
+ */
+void decode_ise(
+ quant_method quant_level,
+ unsigned int character_count,
+ const uint8_t* input_data,
+ uint8_t* output_data,
+ unsigned int bit_offset);
+
+/**
+ * @brief Return the number of bits needed to encode an ISE sequence.
+ *
+ * This implementation assumes that the @c quant level is untrusted, given it may come from random
+ * data being decompressed, so we return an arbitrary unencodable size if that is the case.
+ *
+ * @param character_count The number of items in the sequence.
+ * @param quant_level The desired quantization level.
+ *
+ * @return The number of bits needed to encode the BISE string.
+ */
+unsigned int get_ise_sequence_bitcount(
+ unsigned int character_count,
+ quant_method quant_level);
+
+/* ============================================================================
+ Functionality for managing color partitioning.
+============================================================================ */
+
+/**
+ * @brief Compute averages and dominant directions for each partition in a 2 component texture.
+ *
+ * @param pi The partition info for the current trial.
+ * @param blk The image block color data to be compressed.
+ * @param component1 The first component included in the analysis.
+ * @param component2 The second component included in the analysis.
+ * @param[out] pm The output partition metrics.
+ * - Only pi.partition_count array entries actually get initialized.
+ * - Direction vectors @c pm.dir are not normalized.
+ */
+void compute_avgs_and_dirs_2_comp(
+ const partition_info& pi,
+ const image_block& blk,
+ unsigned int component1,
+ unsigned int component2,
+ partition_metrics pm[BLOCK_MAX_PARTITIONS]);
+
+/**
+ * @brief Compute averages and dominant directions for each partition in a 3 component texture.
+ *
+ * @param pi The partition info for the current trial.
+ * @param blk The image block color data to be compressed.
+ * @param omitted_component The component excluded from the analysis.
+ * @param[out] pm The output partition metrics.
+ * - Only pi.partition_count array entries actually get initialized.
+ * - Direction vectors @c pm.dir are not normalized.
+ */
+void compute_avgs_and_dirs_3_comp(
+ const partition_info& pi,
+ const image_block& blk,
+ unsigned int omitted_component,
+ partition_metrics pm[BLOCK_MAX_PARTITIONS]);
+
+/**
+ * @brief Compute averages and dominant directions for each partition in a 3 component texture.
+ *
+ * This is a specialization of @c compute_avgs_and_dirs_3_comp where the omitted component is
+ * always alpha, a common case during partition search.
+ *
+ * @param pi The partition info for the current trial.
+ * @param blk The image block color data to be compressed.
+ * @param[out] pm The output partition metrics.
+ * - Only pi.partition_count array entries actually get initialized.
+ * - Direction vectors @c pm.dir are not normalized.
+ */
+void compute_avgs_and_dirs_3_comp_rgb(
+ const partition_info& pi,
+ const image_block& blk,
+ partition_metrics pm[BLOCK_MAX_PARTITIONS]);
+
+/**
+ * @brief Compute averages and dominant directions for each partition in a 4 component texture.
+ *
+ * @param pi The partition info for the current trial.
+ * @param blk The image block color data to be compressed.
+ * @param[out] pm The output partition metrics.
+ * - Only pi.partition_count array entries actually get initialized.
+ * - Direction vectors @c pm.dir are not normalized.
+ */
+void compute_avgs_and_dirs_4_comp(
+ const partition_info& pi,
+ const image_block& blk,
+ partition_metrics pm[BLOCK_MAX_PARTITIONS]);
+
+/**
+ * @brief Compute the RGB error for uncorrelated and same chroma projections.
+ *
+ * The output of compute averages and dirs is post processed to define two lines, both of which go
+ * through the mean-color-value. One line has a direction defined by the dominant direction; this
+ * is used to assess the error from using an uncorrelated color representation. The other line goes
+ * through (0,0,0) and is used to assess the error from using an RGBS color representation.
+ *
+ * This function computes the squared error when using these two representations.
+ *
+ * @param pi The partition info for the current trial.
+ * @param blk The image block color data to be compressed.
+ * @param[in,out] plines Processed line inputs, and line length outputs.
+ * @param[out] uncor_error The cumulative error for using the uncorrelated line.
+ * @param[out] samec_error The cumulative error for using the same chroma line.
+ */
+void compute_error_squared_rgb(
+ const partition_info& pi,
+ const image_block& blk,
+ partition_lines3 plines[BLOCK_MAX_PARTITIONS],
+ float& uncor_error,
+ float& samec_error);
+
+/**
+ * @brief Compute the RGBA error for uncorrelated and same chroma projections.
+ *
+ * The output of compute averages and dirs is post processed to define two lines, both of which go
+ * through the mean-color-value. One line has a direction defined by the dominant direction; this
+ * is used to assess the error from using an uncorrelated color representation. The other line goes
+ * through (0,0,0,1) and is used to assess the error from using an RGBS color representation.
+ *
+ * This function computes the squared error when using these two representations.
+ *
+ * @param pi The partition info for the current trial.
+ * @param blk The image block color data to be compressed.
+ * @param uncor_plines Processed uncorrelated partition lines for each partition.
+ * @param samec_plines Processed same chroma partition lines for each partition.
+ * @param[out] uncor_lengths The length of each components deviation from the line.
+ * @param[out] samec_lengths The length of each components deviation from the line.
+ * @param[out] uncor_error The cumulative error for using the uncorrelated line.
+ * @param[out] samec_error The cumulative error for using the same chroma line.
+ */
+void compute_error_squared_rgba(
+ const partition_info& pi,
+ const image_block& blk,
+ const processed_line4 uncor_plines[BLOCK_MAX_PARTITIONS],
+ const processed_line4 samec_plines[BLOCK_MAX_PARTITIONS],
+ float uncor_lengths[BLOCK_MAX_PARTITIONS],
+ float samec_lengths[BLOCK_MAX_PARTITIONS],
+ float& uncor_error,
+ float& samec_error);
+
+/**
+ * @brief Find the best set of partitions to trial for a given block.
+ *
+ * On return the @c best_partitions list will contain the two best partition
+ * candidates; one assuming data has uncorrelated chroma and one assuming the
+ * data has correlated chroma. The best candidate is returned first in the list.
+ *
+ * @param bsd The block size information.
+ * @param blk The image block color data to compress.
+ * @param partition_count The number of partitions in the block.
+ * @param partition_search_limit The number of candidate partition encodings to trial.
+ * @param[out] best_partitions The best partition candidates.
+ * @param requested_candidates The number of requested partitionings. May return fewer if
+ * candidates are not available.
+ *
+ * @return The actual number of candidates returned.
+ */
+unsigned int find_best_partition_candidates(
+ const block_size_descriptor& bsd,
+ const image_block& blk,
+ unsigned int partition_count,
+ unsigned int partition_search_limit,
+ unsigned int best_partitions[TUNE_MAX_PARTITIIONING_CANDIDATES],
+ unsigned int requested_candidates);
+
+/* ============================================================================
+ Functionality for managing images and image related data.
+============================================================================ */
+
+/**
+ * @brief Setup computation of regional averages in an image.
+ *
+ * This must be done by only a single thread per image, before any thread calls
+ * @c compute_averages().
+ *
+ * Results are written back into @c img->input_alpha_averages.
+ *
+ * @param img The input image data, also holds output data.
+ * @param alpha_kernel_radius The kernel radius (in pixels) for alpha mods.
+ * @param swz Input data component swizzle.
+ * @param[out] ag The average variance arguments to init.
+ *
+ * @return The number of tasks in the processing stage.
+ */
+unsigned int init_compute_averages(
+ const astcenc_image& img,
+ unsigned int alpha_kernel_radius,
+ const astcenc_swizzle& swz,
+ avg_args& ag);
+
+/**
+ * @brief Compute averages for a pixel region.
+ *
+ * The routine computes both in a single pass, using a summed-area table to decouple the running
+ * time from the averaging/variance kernel size.
+ *
+ * @param[out] ctx The compressor context storing the output data.
+ * @param arg The input parameter structure.
+ */
+void compute_pixel_region_variance(
+ astcenc_contexti& ctx,
+ const pixel_region_args& arg);
+/**
+ * @brief Load a single image block from the input image.
+ *
+ * @param decode_mode The compression color profile.
+ * @param img The input image data.
+ * @param[out] blk The image block to populate.
+ * @param bsd The block size information.
+ * @param xpos The block X coordinate in the input image.
+ * @param ypos The block Y coordinate in the input image.
+ * @param zpos The block Z coordinate in the input image.
+ * @param swz The swizzle to apply on load.
+ */
+void load_image_block(
+ astcenc_profile decode_mode,
+ const astcenc_image& img,
+ image_block& blk,
+ const block_size_descriptor& bsd,
+ unsigned int xpos,
+ unsigned int ypos,
+ unsigned int zpos,
+ const astcenc_swizzle& swz);
+
+/**
+ * @brief Load a single image block from the input image.
+ *
+ * This specialized variant can be used only if the block is 2D LDR U8 data,
+ * with no swizzle.
+ *
+ * @param decode_mode The compression color profile.
+ * @param img The input image data.
+ * @param[out] blk The image block to populate.
+ * @param bsd The block size information.
+ * @param xpos The block X coordinate in the input image.
+ * @param ypos The block Y coordinate in the input image.
+ * @param zpos The block Z coordinate in the input image.
+ * @param swz The swizzle to apply on load.
+ */
+void load_image_block_fast_ldr(
+ astcenc_profile decode_mode,
+ const astcenc_image& img,
+ image_block& blk,
+ const block_size_descriptor& bsd,
+ unsigned int xpos,
+ unsigned int ypos,
+ unsigned int zpos,
+ const astcenc_swizzle& swz);
+
+/**
+ * @brief Store a single image block to the output image.
+ *
+ * @param[out] img The output image data.
+ * @param blk The image block to export.
+ * @param bsd The block size information.
+ * @param xpos The block X coordinate in the input image.
+ * @param ypos The block Y coordinate in the input image.
+ * @param zpos The block Z coordinate in the input image.
+ * @param swz The swizzle to apply on store.
+ */
+void store_image_block(
+ astcenc_image& img,
+ const image_block& blk,
+ const block_size_descriptor& bsd,
+ unsigned int xpos,
+ unsigned int ypos,
+ unsigned int zpos,
+ const astcenc_swizzle& swz);
+
+/* ============================================================================
+ Functionality for computing endpoint colors and weights for a block.
+============================================================================ */
+
+/**
+ * @brief Compute ideal endpoint colors and weights for 1 plane of weights.
+ *
+ * The ideal endpoints define a color line for the partition. For each texel the ideal weight
+ * defines an exact position on the partition color line. We can then use these to assess the error
+ * introduced by removing and quantizing the weight grid.
+ *
+ * @param blk The image block color data to compress.
+ * @param pi The partition info for the current trial.
+ * @param[out] ei The endpoint and weight values.
+ */
+void compute_ideal_colors_and_weights_1plane(
+ const image_block& blk,
+ const partition_info& pi,
+ endpoints_and_weights& ei);
+
+/**
+ * @brief Compute ideal endpoint colors and weights for 2 planes of weights.
+ *
+ * The ideal endpoints define a color line for the partition. For each texel the ideal weight
+ * defines an exact position on the partition color line. We can then use these to assess the error
+ * introduced by removing and quantizing the weight grid.
+ *
+ * @param bsd The block size information.
+ * @param blk The image block color data to compress.
+ * @param plane2_component The component assigned to plane 2.
+ * @param[out] ei1 The endpoint and weight values for plane 1.
+ * @param[out] ei2 The endpoint and weight values for plane 2.
+ */
+void compute_ideal_colors_and_weights_2planes(
+ const block_size_descriptor& bsd,
+ const image_block& blk,
+ unsigned int plane2_component,
+ endpoints_and_weights& ei1,
+ endpoints_and_weights& ei2);
+
+/**
+ * @brief Compute the optimal unquantized weights for a decimation table.
+ *
+ * After computing ideal weights for the case for a complete weight grid, we we want to compute the
+ * ideal weights for the case where weights exist only for some texels. We do this with a
+ * steepest-descent grid solver which works as follows:
+ *
+ * First, for each actual weight, perform a weighted averaging of the texels affected by the weight.
+ * Then, set step size to <some initial value> and attempt one step towards the original ideal
+ * weight if it helps to reduce error.
+ *
+ * @param ei The non-decimated endpoints and weights.
+ * @param di The selected weight decimation.
+ * @param[out] dec_weight_ideal_value The ideal values for the decimated weight set.
+ */
+void compute_ideal_weights_for_decimation(
+ const endpoints_and_weights& ei,
+ const decimation_info& di,
+ float* dec_weight_ideal_value);
+
+/**
+ * @brief Compute the optimal quantized weights for a decimation table.
+ *
+ * We test the two closest weight indices in the allowed quantization range and keep the weight that
+ * is the closest match.
+ *
+ * @param di The selected weight decimation.
+ * @param low_bound The lowest weight allowed.
+ * @param high_bound The highest weight allowed.
+ * @param dec_weight_ideal_value The ideal weight set.
+ * @param[out] dec_weight_quant_uvalue The output quantized weight as a float.
+ * @param[out] dec_weight_uquant The output quantized weight as encoded int.
+ * @param quant_level The desired weight quant level.
+ */
+void compute_quantized_weights_for_decimation(
+ const decimation_info& di,
+ float low_bound,
+ float high_bound,
+ const float* dec_weight_ideal_value,
+ float* dec_weight_quant_uvalue,
+ uint8_t* dec_weight_uquant,
+ quant_method quant_level);
+
+/**
+ * @brief Compute the error of a decimated weight set for 1 plane.
+ *
+ * After computing ideal weights for the case with one weight per texel, we want to compute the
+ * error for decimated weight grids where weights are stored at a lower resolution. This function
+ * computes the error of the reduced grid, compared to the full grid.
+ *
+ * @param eai The ideal weights for the full grid.
+ * @param di The selected weight decimation.
+ * @param dec_weight_quant_uvalue The quantized weights for the decimated grid.
+ *
+ * @return The accumulated error.
+ */
+float compute_error_of_weight_set_1plane(
+ const endpoints_and_weights& eai,
+ const decimation_info& di,
+ const float* dec_weight_quant_uvalue);
+
+/**
+ * @brief Compute the error of a decimated weight set for 2 planes.
+ *
+ * After computing ideal weights for the case with one weight per texel, we want to compute the
+ * error for decimated weight grids where weights are stored at a lower resolution. This function
+ * computes the error of the reduced grid, compared to the full grid.
+ *
+ * @param eai1 The ideal weights for the full grid and plane 1.
+ * @param eai2 The ideal weights for the full grid and plane 2.
+ * @param di The selected weight decimation.
+ * @param dec_weight_quant_uvalue_plane1 The quantized weights for the decimated grid plane 1.
+ * @param dec_weight_quant_uvalue_plane2 The quantized weights for the decimated grid plane 2.
+ *
+ * @return The accumulated error.
+ */
+float compute_error_of_weight_set_2planes(
+ const endpoints_and_weights& eai1,
+ const endpoints_and_weights& eai2,
+ const decimation_info& di,
+ const float* dec_weight_quant_uvalue_plane1,
+ const float* dec_weight_quant_uvalue_plane2);
+
+/**
+ * @brief Pack a single pair of color endpoints as effectively as possible.
+ *
+ * The user requests a base color endpoint mode in @c format, but the quantizer may choose a
+ * delta-based representation. It will report back the format variant it actually used.
+ *
+ * @param color0 The input unquantized color0 endpoint for absolute endpoint pairs.
+ * @param color1 The input unquantized color1 endpoint for absolute endpoint pairs.
+ * @param rgbs_color The input unquantized RGBS variant endpoint for same chroma endpoints.
+ * @param rgbo_color The input unquantized RGBS variant endpoint for HDR endpoints.
+ * @param format The desired base format.
+ * @param[out] output The output storage for the quantized colors/
+ * @param quant_level The quantization level requested.
+ *
+ * @return The actual endpoint mode used.
+ */
+uint8_t pack_color_endpoints(
+ vfloat4 color0,
+ vfloat4 color1,
+ vfloat4 rgbs_color,
+ vfloat4 rgbo_color,
+ int format,
+ uint8_t* output,
+ quant_method quant_level);
+
+/**
+ * @brief Unpack a single pair of encoded endpoints.
+ *
+ * Endpoints must be unscrambled and converted into the 0-255 range before calling this functions.
+ *
+ * @param decode_mode The decode mode (LDR, HDR).
+ * @param format The color endpoint mode used.
+ * @param input The raw array of encoded input integers. The length of this array
+ * depends on @c format; it can be safely assumed to be large enough.
+ * @param[out] rgb_hdr Is the endpoint using HDR for the RGB channels?
+ * @param[out] alpha_hdr Is the endpoint using HDR for the A channel?
+ * @param[out] output0 The output color for endpoint 0.
+ * @param[out] output1 The output color for endpoint 1.
+ */
+void unpack_color_endpoints(
+ astcenc_profile decode_mode,
+ int format,
+ const uint8_t* input,
+ bool& rgb_hdr,
+ bool& alpha_hdr,
+ vint4& output0,
+ vint4& output1);
+
+/**
+ * @brief Unpack a set of quantized and decimated weights.
+ *
+ * TODO: Can we skip this for non-decimated weights now that the @c scb is
+ * already storing unquantized weights?
+ *
+ * @param bsd The block size information.
+ * @param scb The symbolic compressed encoding.
+ * @param di The weight grid decimation table.
+ * @param is_dual_plane @c true if this is a dual plane block, @c false otherwise.
+ * @param[out] weights_plane1 The output array for storing the plane 1 weights.
+ * @param[out] weights_plane2 The output array for storing the plane 2 weights.
+ */
+void unpack_weights(
+ const block_size_descriptor& bsd,
+ const symbolic_compressed_block& scb,
+ const decimation_info& di,
+ bool is_dual_plane,
+ int weights_plane1[BLOCK_MAX_TEXELS],
+ int weights_plane2[BLOCK_MAX_TEXELS]);
+
+/**
+ * @brief Identify, for each mode, which set of color endpoint produces the best result.
+ *
+ * Returns the best @c tune_candidate_limit best looking modes, along with the ideal color encoding
+ * combination for each. The modified quantization level can be used when all formats are the same,
+ * as this frees up two additional bits of storage.
+ *
+ * @param pi The partition info for the current trial.
+ * @param blk The image block color data to compress.
+ * @param ep The ideal endpoints.
+ * @param qwt_bitcounts Bit counts for different quantization methods.
+ * @param qwt_errors Errors for different quantization methods.
+ * @param tune_candidate_limit The max number of candidates to return, may be less.
+ * @param start_block_mode The first block mode to inspect.
+ * @param end_block_mode The last block mode to inspect.
+ * @param[out] partition_format_specifiers The best formats per partition.
+ * @param[out] block_mode The best packed block mode indexes.
+ * @param[out] quant_level The best color quant level.
+ * @param[out] quant_level_mod The best color quant level if endpoints are the same.
+ * @param[out] tmpbuf Preallocated scratch buffers for the compressor.
+ *
+ * @return The actual number of candidate matches returned.
+ */
+unsigned int compute_ideal_endpoint_formats(
+ const partition_info& pi,
+ const image_block& blk,
+ const endpoints& ep,
+ const int8_t* qwt_bitcounts,
+ const float* qwt_errors,
+ unsigned int tune_candidate_limit,
+ unsigned int start_block_mode,
+ unsigned int end_block_mode,
+ uint8_t partition_format_specifiers[TUNE_MAX_TRIAL_CANDIDATES][BLOCK_MAX_PARTITIONS],
+ int block_mode[TUNE_MAX_TRIAL_CANDIDATES],
+ quant_method quant_level[TUNE_MAX_TRIAL_CANDIDATES],
+ quant_method quant_level_mod[TUNE_MAX_TRIAL_CANDIDATES],
+ compression_working_buffers& tmpbuf);
+
+/**
+ * @brief For a given 1 plane weight set recompute the endpoint colors.
+ *
+ * As we quantize and decimate weights the optimal endpoint colors may change slightly, so we must
+ * recompute the ideal colors for a specific weight set.
+ *
+ * @param blk The image block color data to compress.
+ * @param pi The partition info for the current trial.
+ * @param di The weight grid decimation table.
+ * @param dec_weights_uquant The quantized weight set.
+ * @param[in,out] ep The color endpoints (modifed in place).
+ * @param[out] rgbs_vectors The RGB+scale vectors for LDR blocks.
+ * @param[out] rgbo_vectors The RGB+offset vectors for HDR blocks.
+ */
+void recompute_ideal_colors_1plane(
+ const image_block& blk,
+ const partition_info& pi,
+ const decimation_info& di,
+ const uint8_t* dec_weights_uquant,
+ endpoints& ep,
+ vfloat4 rgbs_vectors[BLOCK_MAX_PARTITIONS],
+ vfloat4 rgbo_vectors[BLOCK_MAX_PARTITIONS]);
+
+/**
+ * @brief For a given 2 plane weight set recompute the endpoint colors.
+ *
+ * As we quantize and decimate weights the optimal endpoint colors may change slightly, so we must
+ * recompute the ideal colors for a specific weight set.
+ *
+ * @param blk The image block color data to compress.
+ * @param bsd The block_size descriptor.
+ * @param di The weight grid decimation table.
+ * @param dec_weights_uquant_plane1 The quantized weight set for plane 1.
+ * @param dec_weights_uquant_plane2 The quantized weight set for plane 2.
+ * @param[in,out] ep The color endpoints (modifed in place).
+ * @param[out] rgbs_vector The RGB+scale color for LDR blocks.
+ * @param[out] rgbo_vector The RGB+offset color for HDR blocks.
+ * @param plane2_component The component assigned to plane 2.
+ */
+void recompute_ideal_colors_2planes(
+ const image_block& blk,
+ const block_size_descriptor& bsd,
+ const decimation_info& di,
+ const uint8_t* dec_weights_uquant_plane1,
+ const uint8_t* dec_weights_uquant_plane2,
+ endpoints& ep,
+ vfloat4& rgbs_vector,
+ vfloat4& rgbo_vector,
+ int plane2_component);
+
+/**
+ * @brief Expand the angular tables needed for the alternative to PCA that we use.
+ */
+void prepare_angular_tables();
+
+/**
+ * @brief Compute the angular endpoints for one plane for each block mode.
+ *
+ * @param only_always Only consider block modes that are always enabled.
+ * @param bsd The block size descriptor for the current trial.
+ * @param dec_weight_ideal_value The ideal decimated unquantized weight values.
+ * @param max_weight_quant The maximum block mode weight quantization allowed.
+ * @param[out] tmpbuf Preallocated scratch buffers for the compressor.
+ */
+void compute_angular_endpoints_1plane(
+ bool only_always,
+ const block_size_descriptor& bsd,
+ const float* dec_weight_ideal_value,
+ unsigned int max_weight_quant,
+ compression_working_buffers& tmpbuf);
+
+/**
+ * @brief Compute the angular endpoints for two planes for each block mode.
+ *
+ * @param bsd The block size descriptor for the current trial.
+ * @param dec_weight_ideal_value The ideal decimated unquantized weight values.
+ * @param max_weight_quant The maximum block mode weight quantization allowed.
+ * @param[out] tmpbuf Preallocated scratch buffers for the compressor.
+ */
+void compute_angular_endpoints_2planes(
+ const block_size_descriptor& bsd,
+ const float* dec_weight_ideal_value,
+ unsigned int max_weight_quant,
+ compression_working_buffers& tmpbuf);
+
+/* ============================================================================
+ Functionality for high level compression and decompression access.
+============================================================================ */
+
+/**
+ * @brief Compress an image block into a physical block.
+ *
+ * @param ctx The compressor context and configuration.
+ * @param blk The image block color data to compress.
+ * @param[out] pcb The physical compressed block output.
+ * @param[out] tmpbuf Preallocated scratch buffers for the compressor.
+ */
+void compress_block(
+ const astcenc_contexti& ctx,
+ const image_block& blk,
+ physical_compressed_block& pcb,
+ compression_working_buffers& tmpbuf);
+
+/**
+ * @brief Decompress a symbolic block in to an image block.
+ *
+ * @param decode_mode The decode mode (LDR, HDR, etc).
+ * @param bsd The block size information.
+ * @param xpos The X coordinate of the block in the overall image.
+ * @param ypos The Y coordinate of the block in the overall image.
+ * @param zpos The Z coordinate of the block in the overall image.
+ * @param[out] blk The decompressed image block color data.
+ */
+void decompress_symbolic_block(
+ astcenc_profile decode_mode,
+ const block_size_descriptor& bsd,
+ int xpos,
+ int ypos,
+ int zpos,
+ const symbolic_compressed_block& scb,
+ image_block& blk);
+
+/**
+ * @brief Compute the error between a symbolic block and the original input data.
+ *
+ * This function is specialized for 2 plane and 1 partition search.
+ *
+ * In RGBM mode this will reject blocks that attempt to encode a zero M value.
+ *
+ * @param config The compressor config.
+ * @param bsd The block size information.
+ * @param scb The symbolic compressed encoding.
+ * @param blk The original image block color data.
+ *
+ * @return Returns the computed error, or a negative value if the encoding
+ * should be rejected for any reason.
+ */
+float compute_symbolic_block_difference_2plane(
+ const astcenc_config& config,
+ const block_size_descriptor& bsd,
+ const symbolic_compressed_block& scb,
+ const image_block& blk);
+
+/**
+ * @brief Compute the error between a symbolic block and the original input data.
+ *
+ * This function is specialized for 1 plane and N partition search.
+ *
+ * In RGBM mode this will reject blocks that attempt to encode a zero M value.
+ *
+ * @param config The compressor config.
+ * @param bsd The block size information.
+ * @param scb The symbolic compressed encoding.
+ * @param blk The original image block color data.
+ *
+ * @return Returns the computed error, or a negative value if the encoding
+ * should be rejected for any reason.
+ */
+float compute_symbolic_block_difference_1plane(
+ const astcenc_config& config,
+ const block_size_descriptor& bsd,
+ const symbolic_compressed_block& scb,
+ const image_block& blk);
+
+/**
+ * @brief Compute the error between a symbolic block and the original input data.
+ *
+ * This function is specialized for 1 plane and 1 partition search.
+ *
+ * In RGBM mode this will reject blocks that attempt to encode a zero M value.
+ *
+ * @param config The compressor config.
+ * @param bsd The block size information.
+ * @param scb The symbolic compressed encoding.
+ * @param blk The original image block color data.
+ *
+ * @return Returns the computed error, or a negative value if the encoding
+ * should be rejected for any reason.
+ */
+float compute_symbolic_block_difference_1plane_1partition(
+ const astcenc_config& config,
+ const block_size_descriptor& bsd,
+ const symbolic_compressed_block& scb,
+ const image_block& blk);
+
+/**
+ * @brief Convert a symbolic representation into a binary physical encoding.
+ *
+ * It is assumed that the symbolic encoding is valid and encodable, or
+ * previously flagged as an error block if an error color it to be encoded.
+ *
+ * @param bsd The block size information.
+ * @param scb The symbolic representation.
+ * @param[out] pcb The binary encoded data.
+ */
+void symbolic_to_physical(
+ const block_size_descriptor& bsd,
+ const symbolic_compressed_block& scb,
+ physical_compressed_block& pcb);
+
+/**
+ * @brief Convert a binary physical encoding into a symbolic representation.
+ *
+ * This function can cope with arbitrary input data; output blocks will be
+ * flagged as an error block if the encoding is invalid.
+ *
+ * @param bsd The block size information.
+ * @param pcb The binary encoded data.
+ * @param[out] scb The output symbolic representation.
+ */
+void physical_to_symbolic(
+ const block_size_descriptor& bsd,
+ const physical_compressed_block& pcb,
+ symbolic_compressed_block& scb);
+
+/* ============================================================================
+Platform-specific functions.
+============================================================================ */
+/**
+ * @brief Run-time detection if the host CPU supports the POPCNT extension.
+ *
+ * @return @c true if supported, @c false if not.
+ */
+bool cpu_supports_popcnt();
+
+/**
+ * @brief Run-time detection if the host CPU supports F16C extension.
+ *
+ * @return @c true if supported, @c false if not.
+ */
+bool cpu_supports_f16c();
+
+/**
+ * @brief Run-time detection if the host CPU supports SSE 4.1 extension.
+ *
+ * @return @c true if supported, @c false if not.
+ */
+bool cpu_supports_sse41();
+
+/**
+ * @brief Run-time detection if the host CPU supports AVX 2 extension.
+ *
+ * @return @c true if supported, @c false if not.
+ */
+bool cpu_supports_avx2();
+
+/**
+ * @brief Allocate an aligned memory buffer.
+ *
+ * Allocated memory must be freed by aligned_free;
+ *
+ * @param size The desired buffer size.
+ * @param align The desired buffer alignment; must be 2^N.
+ *
+ * @return The memory buffer pointer or nullptr on allocation failure.
+ */
+template<typename T>
+T* aligned_malloc(size_t size, size_t align)
+{
+ void* ptr;
+ int error = 0;
+
+#if defined(_WIN32)
+ ptr = _aligned_malloc(size, align);
+#else
+ error = posix_memalign(&ptr, align, size);
+#endif
+
+ if (error || (!ptr))
+ {
+ return nullptr;
+ }
+
+ return static_cast<T*>(ptr);
+}
+
+/**
+ * @brief Free an aligned memory buffer.
+ *
+ * @param ptr The buffer to free.
+ */
+template<typename T>
+void aligned_free(T* ptr)
+{
+#if defined(_WIN32)
+ _aligned_free(reinterpret_cast<void*>(ptr));
+#else
+ free(reinterpret_cast<void*>(ptr));
+#endif
+}
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_internal_entry.h b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_internal_entry.h
new file mode 100644
index 00000000000..4e8794547ab
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_internal_entry.h
@@ -0,0 +1,273 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Functions and data declarations for the outer context.
+ *
+ * The outer context includes thread-pool management, which is slower to
+ * compile due to increased use of C++ stdlib. The inner context used in the
+ * majority of the codec library does not include this.
+ */
+
+#ifndef ASTCENC_INTERNAL_ENTRY_INCLUDED
+#define ASTCENC_INTERNAL_ENTRY_INCLUDED
+
+#include <atomic>
+#include <condition_variable>
+#include <functional>
+#include <mutex>
+
+#include "astcenc_internal.h"
+
+/* ============================================================================
+ Parallel execution control
+============================================================================ */
+
+/**
+ * @brief A simple counter-based manager for parallel task execution.
+ *
+ * The task processing execution consists of:
+ *
+ * * A single-threaded init stage.
+ * * A multi-threaded processing stage.
+ * * A condition variable so threads can wait for processing completion.
+ *
+ * The init stage will be executed by the first thread to arrive in the critical section, there is
+ * no main thread in the thread pool.
+ *
+ * The processing stage uses dynamic dispatch to assign task tickets to threads on an on-demand
+ * basis. Threads may each therefore executed different numbers of tasks, depending on their
+ * processing complexity. The task queue and the task tickets are just counters; the caller must map
+ * these integers to an actual processing partition in a specific problem domain.
+ *
+ * The exit wait condition is needed to ensure processing has finished before a worker thread can
+ * progress to the next stage of the pipeline. Specifically a worker may exit the processing stage
+ * because there are no new tasks to assign to it while other worker threads are still processing.
+ * Calling @c wait() will ensure that all other worker have finished before the thread can proceed.
+ *
+ * The basic usage model:
+ *
+ * // --------- From single-threaded code ---------
+ *
+ * // Reset the tracker state
+ * manager->reset()
+ *
+ * // --------- From multi-threaded code ---------
+ *
+ * // Run the stage init; only first thread actually runs the lambda
+ * manager->init(<lambda>)
+ *
+ * do
+ * {
+ * // Request a task assignment
+ * uint task_count;
+ * uint base_index = manager->get_tasks(<granule>, task_count);
+ *
+ * // Process any tasks we were given (task_count <= granule size)
+ * if (task_count)
+ * {
+ * // Run the user task processing code for N tasks here
+ * ...
+ *
+ * // Flag these tasks as complete
+ * manager->complete_tasks(task_count);
+ * }
+ * } while (task_count);
+ *
+ * // Wait for all threads to complete tasks before progressing
+ * manager->wait()
+ *
+ * // Run the stage term; only first thread actually runs the lambda
+ * manager->term(<lambda>)
+ */
+class ParallelManager
+{
+private:
+ /** @brief Lock used for critical section and condition synchronization. */
+ std::mutex m_lock;
+
+ /** @brief True if the stage init() step has been executed. */
+ bool m_init_done;
+
+ /** @brief True if the stage term() step has been executed. */
+ bool m_term_done;
+
+ /** @brief Condition variable for tracking stage processing completion. */
+ std::condition_variable m_complete;
+
+ /** @brief Number of tasks started, but not necessarily finished. */
+ std::atomic<unsigned int> m_start_count;
+
+ /** @brief Number of tasks finished. */
+ unsigned int m_done_count;
+
+ /** @brief Number of tasks that need to be processed. */
+ unsigned int m_task_count;
+
+public:
+ /** @brief Create a new ParallelManager. */
+ ParallelManager()
+ {
+ reset();
+ }
+
+ /**
+ * @brief Reset the tracker for a new processing batch.
+ *
+ * This must be called from single-threaded code before starting the multi-threaded processing
+ * operations.
+ */
+ void reset()
+ {
+ m_init_done = false;
+ m_term_done = false;
+ m_start_count = 0;
+ m_done_count = 0;
+ m_task_count = 0;
+ }
+
+ /**
+ * @brief Trigger the pipeline stage init step.
+ *
+ * This can be called from multi-threaded code. The first thread to hit this will process the
+ * initialization. Other threads will block and wait for it to complete.
+ *
+ * @param init_func Callable which executes the stage initialization. It must return the
+ * total number of tasks in the stage.
+ */
+ void init(std::function<unsigned int(void)> init_func)
+ {
+ std::lock_guard<std::mutex> lck(m_lock);
+ if (!m_init_done)
+ {
+ m_task_count = init_func();
+ m_init_done = true;
+ }
+ }
+
+ /**
+ * @brief Trigger the pipeline stage init step.
+ *
+ * This can be called from multi-threaded code. The first thread to hit this will process the
+ * initialization. Other threads will block and wait for it to complete.
+ *
+ * @param task_count Total number of tasks needing processing.
+ */
+ void init(unsigned int task_count)
+ {
+ std::lock_guard<std::mutex> lck(m_lock);
+ if (!m_init_done)
+ {
+ m_task_count = task_count;
+ m_init_done = true;
+ }
+ }
+
+ /**
+ * @brief Request a task assignment.
+ *
+ * Assign up to @c granule tasks to the caller for processing.
+ *
+ * @param granule Maximum number of tasks that can be assigned.
+ * @param[out] count Actual number of tasks assigned, or zero if no tasks were assigned.
+ *
+ * @return Task index of the first assigned task; assigned tasks increment from this.
+ */
+ unsigned int get_task_assignment(unsigned int granule, unsigned int& count)
+ {
+ unsigned int base = m_start_count.fetch_add(granule, std::memory_order_relaxed);
+ if (base >= m_task_count)
+ {
+ count = 0;
+ return 0;
+ }
+
+ count = astc::min(m_task_count - base, granule);
+ return base;
+ }
+
+ /**
+ * @brief Complete a task assignment.
+ *
+ * Mark @c count tasks as complete. This will notify all threads blocked on @c wait() if this
+ * completes the processing of the stage.
+ *
+ * @param count The number of completed tasks.
+ */
+ void complete_task_assignment(unsigned int count)
+ {
+ // Note: m_done_count cannot use an atomic without the mutex; this has a race between the
+ // update here and the wait() for other threads
+ std::unique_lock<std::mutex> lck(m_lock);
+ this->m_done_count += count;
+ if (m_done_count == m_task_count)
+ {
+ lck.unlock();
+ m_complete.notify_all();
+ }
+ }
+
+ /**
+ * @brief Wait for stage processing to complete.
+ */
+ void wait()
+ {
+ std::unique_lock<std::mutex> lck(m_lock);
+ m_complete.wait(lck, [this]{ return m_done_count == m_task_count; });
+ }
+
+ /**
+ * @brief Trigger the pipeline stage term step.
+ *
+ * This can be called from multi-threaded code. The first thread to hit this will process the
+ * work pool termination. Caller must have called @c wait() prior to calling this function to
+ * ensure that processing is complete.
+ *
+ * @param term_func Callable which executes the stage termination.
+ */
+ void term(std::function<void(void)> term_func)
+ {
+ std::lock_guard<std::mutex> lck(m_lock);
+ if (!m_term_done)
+ {
+ term_func();
+ m_term_done = true;
+ }
+ }
+};
+
+/**
+ * @brief The astcenc compression context.
+ */
+struct astcenc_context
+{
+ /** @brief The context internal state. */
+ astcenc_contexti context;
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+ /** @brief The parallel manager for averages computation. */
+ ParallelManager manage_avg;
+
+ /** @brief The parallel manager for compression. */
+ ParallelManager manage_compress;
+#endif
+
+ /** @brief The parallel manager for decompression. */
+ ParallelManager manage_decompress;
+};
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.cpp
new file mode 100644
index 00000000000..f276ac7e3db
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.cpp
@@ -0,0 +1,48 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2021 Arm Limited
+//
+// 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 "astcenc_mathlib.h"
+
+/**
+ * @brief 64-bit rotate left.
+ *
+ * @param val The value to rotate.
+ * @param count The rotation, in bits.
+ */
+static inline uint64_t rotl(uint64_t val, int count)
+{
+ return (val << count) | (val >> (64 - count));
+}
+
+/* See header for documentation. */
+void astc::rand_init(uint64_t state[2])
+{
+ state[0] = 0xfaf9e171cea1ec6bULL;
+ state[1] = 0xf1b318cc06af5d71ULL;
+}
+
+/* See header for documentation. */
+uint64_t astc::rand(uint64_t state[2])
+{
+ uint64_t s0 = state[0];
+ uint64_t s1 = state[1];
+ uint64_t res = s0 + s1;
+ s1 ^= s0;
+ state[0] = rotl(s0, 24) ^ s1 ^ (s1 << 16);
+ state[1] = rotl(s1, 37);
+ return res;
+}
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.h b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.h
new file mode 100644
index 00000000000..67e989e7f50
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.h
@@ -0,0 +1,478 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2021 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/*
+ * This module implements a variety of mathematical data types and library
+ * functions used by the codec.
+ */
+
+#ifndef ASTC_MATHLIB_H_INCLUDED
+#define ASTC_MATHLIB_H_INCLUDED
+
+#include <cassert>
+#include <cstdint>
+#include <cmath>
+
+#ifndef ASTCENC_POPCNT
+ #if defined(__POPCNT__)
+ #define ASTCENC_POPCNT 1
+ #else
+ #define ASTCENC_POPCNT 0
+ #endif
+#endif
+
+#ifndef ASTCENC_F16C
+ #if defined(__F16C__)
+ #define ASTCENC_F16C 1
+ #else
+ #define ASTCENC_F16C 0
+ #endif
+#endif
+
+#ifndef ASTCENC_SSE
+ #if defined(__SSE4_2__)
+ #define ASTCENC_SSE 42
+ #elif defined(__SSE4_1__)
+ #define ASTCENC_SSE 41
+ #elif defined(__SSE3__)
+ #define ASTCENC_SSE 30
+ #elif defined(__SSE2__)
+ #define ASTCENC_SSE 20
+ #else
+ #define ASTCENC_SSE 0
+ #endif
+#endif
+
+#ifndef ASTCENC_AVX
+ #if defined(__AVX2__)
+ #define ASTCENC_AVX 2
+ #elif defined(__AVX__)
+ #define ASTCENC_AVX 1
+ #else
+ #define ASTCENC_AVX 0
+ #endif
+#endif
+
+#ifndef ASTCENC_NEON
+ #if defined(__aarch64__)
+ #define ASTCENC_NEON 1
+ #else
+ #define ASTCENC_NEON 0
+ #endif
+#endif
+
+#if ASTCENC_AVX
+ #define ASTCENC_VECALIGN 32
+#else
+ #define ASTCENC_VECALIGN 16
+#endif
+
+#if ASTCENC_SSE != 0 || ASTCENC_AVX != 0 || ASTCENC_POPCNT != 0
+ #include <immintrin.h>
+#endif
+
+/* ============================================================================
+ Fast math library; note that many of the higher-order functions in this set
+ use approximations which are less accurate, but faster, than <cmath> standard
+ library equivalents.
+
+ Note: Many of these are not necessarily faster than simple C versions when
+ used on a single scalar value, but are included for testing purposes as most
+ have an option based on SSE intrinsics and therefore provide an obvious route
+ to future vectorization.
+============================================================================ */
+
+// Union for manipulation of float bit patterns
+typedef union
+{
+ uint32_t u;
+ int32_t s;
+ float f;
+} if32;
+
+// These are namespaced to avoid colliding with C standard library functions.
+namespace astc
+{
+
+static const float PI = 3.14159265358979323846f;
+static const float PI_OVER_TWO = 1.57079632679489661923f;
+
+/**
+ * @brief SP float absolute value.
+ *
+ * @param v The value to make absolute.
+ *
+ * @return The absolute value.
+ */
+static inline float fabs(float v)
+{
+ return std::fabs(v);
+}
+
+/**
+ * @brief Test if a float value is a nan.
+ *
+ * @param v The value test.
+ *
+ * @return Zero is not a NaN, non-zero otherwise.
+ */
+static inline bool isnan(float v)
+{
+ return v != v;
+}
+
+/**
+ * @brief Return the minimum of two values.
+ *
+ * For floats, NaNs are turned into @c q.
+ *
+ * @param p The first value to compare.
+ * @param q The second value to compare.
+ *
+ * @return The smallest value.
+ */
+template<typename T>
+static inline T min(T p, T q)
+{
+ return p < q ? p : q;
+}
+
+/**
+ * @brief Return the minimum of three values.
+ *
+ * For floats, NaNs are turned into @c r.
+ *
+ * @param p The first value to compare.
+ * @param q The second value to compare.
+ * @param r The third value to compare.
+ *
+ * @return The smallest value.
+ */
+template<typename T>
+static inline T min(T p, T q, T r)
+{
+ return min(min(p, q), r);
+}
+
+/**
+ * @brief Return the minimum of four values.
+ *
+ * For floats, NaNs are turned into @c s.
+ *
+ * @param p The first value to compare.
+ * @param q The second value to compare.
+ * @param r The third value to compare.
+ * @param s The fourth value to compare.
+ *
+ * @return The smallest value.
+ */
+template<typename T>
+static inline T min(T p, T q, T r, T s)
+{
+ return min(min(p, q), min(r, s));
+}
+
+/**
+ * @brief Return the maximum of two values.
+ *
+ * For floats, NaNs are turned into @c q.
+ *
+ * @param p The first value to compare.
+ * @param q The second value to compare.
+ *
+ * @return The largest value.
+ */
+template<typename T>
+static inline T max(T p, T q)
+{
+ return p > q ? p : q;
+}
+
+/**
+ * @brief Return the maximum of three values.
+ *
+ * For floats, NaNs are turned into @c r.
+ *
+ * @param p The first value to compare.
+ * @param q The second value to compare.
+ * @param r The third value to compare.
+ *
+ * @return The largest value.
+ */
+template<typename T>
+static inline T max(T p, T q, T r)
+{
+ return max(max(p, q), r);
+}
+
+/**
+ * @brief Return the maximum of four values.
+ *
+ * For floats, NaNs are turned into @c s.
+ *
+ * @param p The first value to compare.
+ * @param q The second value to compare.
+ * @param r The third value to compare.
+ * @param s The fourth value to compare.
+ *
+ * @return The largest value.
+ */
+template<typename T>
+static inline T max(T p, T q, T r, T s)
+{
+ return max(max(p, q), max(r, s));
+}
+
+/**
+ * @brief Clamp a value value between @c mn and @c mx.
+ *
+ * For floats, NaNs are turned into @c mn.
+ *
+ * @param v The value to clamp.
+ * @param mn The min value (inclusive).
+ * @param mx The max value (inclusive).
+ *
+ * @return The clamped value.
+ */
+template<typename T>
+inline T clamp(T v, T mn, T mx)
+{
+ // Do not reorder; correct NaN handling relies on the fact that comparison
+ // with NaN returns false and will fall-though to the "min" value.
+ if (v > mx) return mx;
+ if (v > mn) return v;
+ return mn;
+}
+
+/**
+ * @brief Clamp a float value between 0.0f and 1.0f.
+ *
+ * NaNs are turned into 0.0f.
+ *
+ * @param v The value to clamp.
+ *
+ * @return The clamped value.
+ */
+static inline float clamp1f(float v)
+{
+ return astc::clamp(v, 0.0f, 1.0f);
+}
+
+/**
+ * @brief Clamp a float value between 0.0f and 255.0f.
+ *
+ * NaNs are turned into 0.0f.
+ *
+ * @param v The value to clamp.
+ *
+ * @return The clamped value.
+ */
+static inline float clamp255f(float v)
+{
+ return astc::clamp(v, 0.0f, 255.0f);
+}
+
+/**
+ * @brief SP float round-down.
+ *
+ * @param v The value to round.
+ *
+ * @return The rounded value.
+ */
+static inline float flt_rd(float v)
+{
+ return std::floor(v);
+}
+
+/**
+ * @brief SP float round-to-nearest and convert to integer.
+ *
+ * @param v The value to round.
+ *
+ * @return The rounded value.
+ */
+static inline int flt2int_rtn(float v)
+{
+
+ return static_cast<int>(v + 0.5f);
+}
+
+/**
+ * @brief SP float round down and convert to integer.
+ *
+ * @param v The value to round.
+ *
+ * @return The rounded value.
+ */
+static inline int flt2int_rd(float v)
+{
+ return static_cast<int>(v);
+}
+
+/**
+ * @brief SP float bit-interpreted as an integer.
+ *
+ * @param v The value to bitcast.
+ *
+ * @return The converted value.
+ */
+static inline int float_as_int(float v)
+{
+ union { int a; float b; } u;
+ u.b = v;
+ return u.a;
+}
+
+/**
+ * @brief Integer bit-interpreted as an SP float.
+ *
+ * @param v The value to bitcast.
+ *
+ * @return The converted value.
+ */
+static inline float int_as_float(int v)
+{
+ union { int a; float b; } u;
+ u.a = v;
+ return u.b;
+}
+
+/**
+ * @brief Fast approximation of 1.0 / sqrt(val).
+ *
+ * @param v The input value.
+ *
+ * @return The approximated result.
+ */
+static inline float rsqrt(float v)
+{
+ return 1.0f / std::sqrt(v);
+}
+
+/**
+ * @brief Fast approximation of sqrt(val).
+ *
+ * @param v The input value.
+ *
+ * @return The approximated result.
+ */
+static inline float sqrt(float v)
+{
+ return std::sqrt(v);
+}
+
+/**
+ * @brief Extract mantissa and exponent of a float value.
+ *
+ * @param v The input value.
+ * @param[out] expo The output exponent.
+ *
+ * @return The mantissa.
+ */
+static inline float frexp(float v, int* expo)
+{
+ if32 p;
+ p.f = v;
+ *expo = ((p.u >> 23) & 0xFF) - 126;
+ p.u = (p.u & 0x807fffff) | 0x3f000000;
+ return p.f;
+}
+
+/**
+ * @brief Initialize the seed structure for a random number generator.
+ *
+ * Important note: For the purposes of ASTC we want sets of random numbers to
+ * use the codec, but we want the same seed value across instances and threads
+ * to ensure that image output is stable across compressor runs and across
+ * platforms. Every PRNG created by this call will therefore return the same
+ * sequence of values ...
+ *
+ * @param state The state structure to initialize.
+ */
+void rand_init(uint64_t state[2]);
+
+/**
+ * @brief Return the next random number from the generator.
+ *
+ * This RNG is an implementation of the "xoroshoro-128+ 1.0" PRNG, based on the
+ * public-domain implementation given by David Blackman & Sebastiano Vigna at
+ * http://vigna.di.unimi.it/xorshift/xoroshiro128plus.c
+ *
+ * @param state The state structure to use/update.
+ */
+uint64_t rand(uint64_t state[2]);
+
+}
+
+/* ============================================================================
+ Softfloat library with fp32 and fp16 conversion functionality.
+============================================================================ */
+#if (ASTCENC_F16C == 0) && (ASTCENC_NEON == 0)
+ /* narrowing float->float conversions */
+ uint16_t float_to_sf16(float val);
+ float sf16_to_float(uint16_t val);
+#endif
+
+/*********************************
+ Vector library
+*********************************/
+#include "astcenc_vecmathlib.h"
+
+/*********************************
+ Declaration of line types
+*********************************/
+// parametric line, 2D: The line is given by line = a + b * t.
+
+struct line2
+{
+ vfloat4 a;
+ vfloat4 b;
+};
+
+// parametric line, 3D
+struct line3
+{
+ vfloat4 a;
+ vfloat4 b;
+};
+
+struct line4
+{
+ vfloat4 a;
+ vfloat4 b;
+};
+
+
+struct processed_line2
+{
+ vfloat4 amod;
+ vfloat4 bs;
+};
+
+struct processed_line3
+{
+ vfloat4 amod;
+ vfloat4 bs;
+};
+
+struct processed_line4
+{
+ vfloat4 amod;
+ vfloat4 bs;
+};
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc/softfloat.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib_softfloat.cpp
index 11131bcac37..42db7645496 100644
--- a/3rdparty/bimg/3rdparty/astc/softfloat.cpp
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib_softfloat.cpp
@@ -1,21 +1,33 @@
-/*----------------------------------------------------------------------------*/
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2021 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Soft IEEE-754 floating point library.
+ * @brief Soft-float library for IEEE-754.
*/
-/*----------------------------------------------------------------------------*/
+#if (ASTCENC_F16C == 0) && (ASTCENC_NEON == 0)
-#include "softfloat.h"
+#include "astcenc_mathlib.h"
-#define SOFTFLOAT_INLINE
+/* sized soft-float types. These are mapped to the sized integer
+ types of C99, instead of C's floating-point types; this is because
+ the library needs to maintain exact, bit-level control on all
+ operations on these data types. */
+typedef uint16_t sf16;
+typedef uint32_t sf32;
/******************************************
helper functions and their lookup tables
@@ -48,14 +60,13 @@
};
#endif
-
/*
32-bit count-leading-zeros function: use the Assembly instruction whenever possible. */
-SOFTFLOAT_INLINE uint32_t clz32(uint32_t inp)
+static uint32_t clz32(uint32_t inp)
{
#if defined(__GNUC__) && (defined(__i386) || defined(__amd64))
uint32_t bsr;
- __asm__("bsrl %1, %0": "=r"(bsr):"r"(inp | 1));
+ __asm__("bsrl %1, %0": "=r"(bsr):"r"(inp | 1));
return 31 - bsr;
#else
#if defined(__arm__) && defined(__ARMCC_VERSION)
@@ -63,7 +74,7 @@ SOFTFLOAT_INLINE uint32_t clz32(uint32_t inp)
#else
#if defined(__arm__) && defined(__GNUC__)
uint32_t lz;
- __asm__("clz %0, %1": "=r"(lz):"r"(inp));
+ __asm__("clz %0, %1": "=r"(lz):"r"(inp));
return lz;
#else
/* slow default version */
@@ -84,7 +95,18 @@ SOFTFLOAT_INLINE uint32_t clz32(uint32_t inp)
#endif
}
-static SOFTFLOAT_INLINE uint32_t rtne_shift32(uint32_t inp, uint32_t shamt)
+/* the five rounding modes that IEEE-754r defines */
+typedef enum
+{
+ SF_UP = 0, /* round towards positive infinity */
+ SF_DOWN = 1, /* round towards negative infinity */
+ SF_TOZERO = 2, /* round towards zero */
+ SF_NEARESTEVEN = 3, /* round toward nearest value; if mid-between, round to even value */
+ SF_NEARESTAWAY = 4 /* round toward nearest value; if mid-between, round away from zero */
+} roundmode;
+
+
+static uint32_t rtne_shift32(uint32_t inp, uint32_t shamt)
{
uint32_t vl1 = UINT32_C(1) << shamt;
uint32_t inp2 = inp + (vl1 >> 1); /* added 0.5 ULP */
@@ -95,7 +117,7 @@ static SOFTFLOAT_INLINE uint32_t rtne_shift32(uint32_t inp, uint32_t shamt)
return inp2;
}
-static SOFTFLOAT_INLINE uint32_t rtna_shift32(uint32_t inp, uint32_t shamt)
+static uint32_t rtna_shift32(uint32_t inp, uint32_t shamt)
{
uint32_t vl1 = (UINT32_C(1) << shamt) >> 1;
inp += vl1;
@@ -103,8 +125,7 @@ static SOFTFLOAT_INLINE uint32_t rtna_shift32(uint32_t inp, uint32_t shamt)
return inp;
}
-
-static SOFTFLOAT_INLINE uint32_t rtup_shift32(uint32_t inp, uint32_t shamt)
+static uint32_t rtup_shift32(uint32_t inp, uint32_t shamt)
{
uint32_t vl1 = UINT32_C(1) << shamt;
inp += vl1;
@@ -113,11 +134,8 @@ static SOFTFLOAT_INLINE uint32_t rtup_shift32(uint32_t inp, uint32_t shamt)
return inp;
}
-
-
-
/* convert from FP16 to FP32. */
-sf32 sf16_to_sf32(sf16 inp)
+static sf32 sf16_to_sf32(sf16 inp)
{
uint32_t inpx = inp;
@@ -129,50 +147,54 @@ sf32 sf16_to_sf32(sf16 inp)
with just 1 table lookup, 2 shifts and 1 add.
*/
- #define WITH_MB(a) INT32_C((a) | (1 << 31))
- static const int32_t tbl[64] =
+ #define WITH_MSB(a) (UINT32_C(a) | (1u << 31))
+ static const uint32_t tbl[64] =
{
- WITH_MB(0x00000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000),
- INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000),
- INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000),
- INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), INT32_C(0x1C000), WITH_MB(0x38000),
- WITH_MB(0x38000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000),
- INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000),
- INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000),
- INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), INT32_C(0x54000), WITH_MB(0x70000)
+ WITH_MSB(0x00000), 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000,
+ 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000,
+ 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000,
+ 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000, 0x1C000, WITH_MSB(0x38000),
+ WITH_MSB(0x38000), 0x54000, 0x54000, 0x54000, 0x54000, 0x54000, 0x54000, 0x54000,
+ 0x54000, 0x54000, 0x54000, 0x54000, 0x54000, 0x54000, 0x54000, 0x54000,
+ 0x54000, 0x54000, 0x54000, 0x54000, 0x54000, 0x54000, 0x54000, 0x54000,
+ 0x54000, 0x54000, 0x54000, 0x54000, 0x54000, 0x54000, 0x54000, WITH_MSB(0x70000)
};
- int32_t res = tbl[inpx >> 10];
+ uint32_t res = tbl[inpx >> 10];
res += inpx;
- /* the normal cases: the MSB of 'res' is not set. */
- if (res >= 0) /* signed compare */
+ /* Normal cases: MSB of 'res' not set. */
+ if ((res & WITH_MSB(0)) == 0)
+ {
return res << 13;
+ }
- /* Infinity and Zero: the bottom 10 bits of 'res' are clear. */
- if ((res & UINT32_C(0x3FF)) == 0)
+ /* Infinity and Zero: 10 LSB of 'res' not set. */
+ if ((res & 0x3FF) == 0)
+ {
return res << 13;
+ }
- /* NaN: the exponent field of 'inp' is not zero; NaNs must be quietened. */
+ /* NaN: the exponent field of 'inp' is non-zero. */
if ((inpx & 0x7C00) != 0)
- return (res << 13) | UINT32_C(0x400000);
-
- /* the remaining cases are Denormals. */
{
- uint32_t sign = (inpx & UINT32_C(0x8000)) << 16;
- uint32_t mskval = inpx & UINT32_C(0x7FFF);
- uint32_t leadingzeroes = clz32(mskval);
- mskval <<= leadingzeroes;
- return (mskval >> 8) + ((0x85 - leadingzeroes) << 23) + sign;
+ /* All NaNs are quietened. */
+ return (res << 13) | 0x400000;
}
+
+ /* Denormal cases */
+ uint32_t sign = (inpx & 0x8000) << 16;
+ uint32_t mskval = inpx & 0x7FFF;
+ uint32_t leadingzeroes = clz32(mskval);
+ mskval <<= leadingzeroes;
+ return (mskval >> 8) + ((0x85 - leadingzeroes) << 23) + sign;
}
/* Conversion routine that converts from FP32 to FP16. It supports denormals and all rounding modes. If a NaN is given as input, it is quietened. */
-
-sf16 sf32_to_sf16(sf32 inp, roundmode rmode)
+static sf16 sf32_to_sf16(sf32 inp, roundmode rmode)
{
/* for each possible sign/exponent combination, store a case index. This gives a 512-byte table */
- static const uint8_t tab[512] = {
+ static const uint8_t tab[512] {
0, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
@@ -210,7 +232,7 @@ sf16 sf32_to_sf16(sf32 inp, roundmode rmode)
/* many of the cases below use a case-dependent magic constant. So we look up a magic constant before actually performing the switch. This table allows us to group cases, thereby minimizing code
size. */
- static const uint32_t tabx[60] = {
+ static const uint32_t tabx[60] {
UINT32_C(0), UINT32_C(0), UINT32_C(0), UINT32_C(0), UINT32_C(0), UINT32_C(0x8000), UINT32_C(0x80000000), UINT32_C(0x8000), UINT32_C(0x8000), UINT32_C(0x8000),
UINT32_C(1), UINT32_C(0), UINT32_C(0), UINT32_C(0), UINT32_C(0), UINT32_C(0x8000), UINT32_C(0x8001), UINT32_C(0x8000), UINT32_C(0x8000), UINT32_C(0x8000),
UINT32_C(0), UINT32_C(0), UINT32_C(0), UINT32_C(0), UINT32_C(0), UINT32_C(0x8000), UINT32_C(0x8000), UINT32_C(0x8000), UINT32_C(0x8000), UINT32_C(0x8000),
@@ -228,7 +250,7 @@ sf16 sf32_to_sf16(sf32 inp, roundmode rmode)
switch (idx)
{
/*
- Positive number which may be Infinity or NaN.
+ Positive number which may be Infinity or NaN.
We need to check whether it is NaN; if it is, quieten it by setting the top bit of the mantissa.
(If we don't do this quieting, then a NaN that is distinguished only by having
its low-order bits set, would be turned into an INF. */
@@ -251,7 +273,7 @@ sf16 sf32_to_sf16(sf32 inp, roundmode rmode)
of the mantissa is set.)
*/
p = (inp - 1) & UINT32_C(0x800000); /* zero if INF, nonzero if NaN. */
- return ((inp + vlx) >> 13) | (p >> 14);
+ return static_cast<sf16>(((inp + vlx) >> 13) | (p >> 14));
/*
positive, exponent = 0, round-mode == UP; need to check whether number actually is 0.
If it is, then return 0, else return 1 (the smallest representable nonzero number)
@@ -261,7 +283,7 @@ sf16 sf32_to_sf16(sf32 inp, roundmode rmode)
-inp will set the MSB if the input number is nonzero.
Thus (-inp) >> 31 will turn into 0 if the input number is 0 and 1 otherwise.
*/
- return (uint32_t) (-(int32_t) inp) >> 31;
+ return static_cast<sf16>(static_cast<uint32_t>((-static_cast<int32_t>(inp))) >> 31);
/*
negative, exponent = , round-mode == DOWN, need to check whether number is
@@ -274,7 +296,7 @@ sf16 sf32_to_sf16(sf32 inp, roundmode rmode)
the MSB set if it isn't. We then right-shift the value by 31 places to
get a value that is 0 if the input is -0.0 and 1 otherwise.
*/
- return ((vlx - inp) >> 31) + UINT32_C(0x8000);
+ return static_cast<sf16>(((vlx - inp) >> 31) + UINT32_C(0x8000));
/*
for all other cases involving underflow/overflow, we don't need to
@@ -308,7 +330,7 @@ sf16 sf32_to_sf16(sf32 inp, roundmode rmode)
case 47:
case 48:
case 49:
- return vlx;
+ return static_cast<sf16>(vlx);
/*
for normal numbers, 'vlx' is the difference between the FP32 value of a number and the
@@ -327,14 +349,14 @@ sf16 sf32_to_sf16(sf32 inp, roundmode rmode)
case 36:
case 37:
case 39:
- return (inp + vlx) >> 13;
+ return static_cast<sf16>((inp + vlx) >> 13);
/* normal number, round-to-nearest-even. */
case 33:
case 38:
p = inp + vlx;
p += (inp >> 13) & 1;
- return p >> 13;
+ return static_cast<sf16>(p >> 13);
/*
the various denormal cases. These are not expected to be common, so their performance is a bit
@@ -349,39 +371,29 @@ sf16 sf32_to_sf16(sf32 inp, roundmode rmode)
case 27:
/* denormal, round towards zero. */
p = 126 - ((inp >> 23) & 0xFF);
- return (((inp & UINT32_C(0x7FFFFF)) + UINT32_C(0x800000)) >> p) | vlx;
+ return static_cast<sf16>((((inp & UINT32_C(0x7FFFFF)) + UINT32_C(0x800000)) >> p) | vlx);
case 20:
case 26:
/* denormal, round away from zero. */
p = 126 - ((inp >> 23) & 0xFF);
- return rtup_shift32((inp & UINT32_C(0x7FFFFF)) + UINT32_C(0x800000), p) | vlx;
+ return static_cast<sf16>(rtup_shift32((inp & UINT32_C(0x7FFFFF)) + UINT32_C(0x800000), p) | vlx);
case 24:
case 29:
/* denormal, round to nearest-away */
p = 126 - ((inp >> 23) & 0xFF);
- return rtna_shift32((inp & UINT32_C(0x7FFFFF)) + UINT32_C(0x800000), p) | vlx;
+ return static_cast<sf16>(rtna_shift32((inp & UINT32_C(0x7FFFFF)) + UINT32_C(0x800000), p) | vlx);
case 23:
case 28:
/* denormal, round to nearest-even. */
p = 126 - ((inp >> 23) & 0xFF);
- return rtne_shift32((inp & UINT32_C(0x7FFFFF)) + UINT32_C(0x800000), p) | vlx;
+ return static_cast<sf16>(rtne_shift32((inp & UINT32_C(0x7FFFFF)) + UINT32_C(0x800000), p) | vlx);
}
return 0;
}
-
-
-typedef union if32_
-{
- uint32_t u;
- int32_t s;
- float f;
-} if32;
-
/* convert from soft-float to native-float */
-
-float sf16_to_float(sf16 p)
+float sf16_to_float(uint16_t p)
{
if32 i;
i.u = sf16_to_sf32(p);
@@ -389,10 +401,11 @@ float sf16_to_float(sf16 p)
}
/* convert from native-float to soft-float */
-
-sf16 float_to_sf16(float p, roundmode rm)
+uint16_t float_to_sf16(float p)
{
if32 i;
i.f = p;
- return sf32_to_sf16(i.u, rm);
+ return sf32_to_sf16(i.u, SF_NEARESTEVEN);
}
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_partition_tables.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_partition_tables.cpp
new file mode 100644
index 00000000000..5846a2632c4
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_partition_tables.cpp
@@ -0,0 +1,461 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Functions for generating partition tables on demand.
+ */
+
+#include "astcenc_internal.h"
+
+/**
+ * @brief Generate a canonical representation of a partition pattern.
+ *
+ * The returned value stores two bits per texel, for up to 6x6x6 texels, where the two bits store
+ * the remapped texel index. Remapping ensures that we only match on the partition pattern,
+ * independent of the partition order generated by the hash.
+ *
+ * @param texel_count The number of texels in the block.
+ * @param partition_of_texel The partition assignments, in hash order.
+ * @param[out] bit_pattern The output bit pattern representation.
+ */
+static void generate_canonical_partitioning(
+ unsigned int texel_count,
+ const uint8_t* partition_of_texel,
+ uint64_t bit_pattern[7]
+) {
+ // Clear the pattern
+ for (unsigned int i = 0; i < 7; i++)
+ {
+ bit_pattern[i] = 0;
+ }
+
+ // Store a mapping to reorder the raw partitions so that the the partitions are ordered such
+ // that the lowest texel index in partition N is smaller than the lowest texel index in
+ // partition N + 1.
+ int mapped_index[BLOCK_MAX_PARTITIONS];
+ int map_weight_count = 0;
+
+ for (unsigned int i = 0; i < BLOCK_MAX_PARTITIONS; i++)
+ {
+ mapped_index[i] = -1;
+ }
+
+ for (unsigned int i = 0; i < texel_count; i++)
+ {
+ int index = partition_of_texel[i];
+ if (mapped_index[index] < 0)
+ {
+ mapped_index[index] = map_weight_count++;
+ }
+
+ uint64_t xlat_index = mapped_index[index];
+ bit_pattern[i >> 5] |= xlat_index << (2 * (i & 0x1F));
+ }
+}
+
+/**
+ * @brief Compare two canonical patterns to see if they are the same.
+ *
+ * @param part1 The first canonical bit pattern to check.
+ * @param part2 The second canonical bit pattern to check.
+ *
+ * @return @c true if the patterns are the same, @c false otherwise.
+ */
+static bool compare_canonical_partitionings(
+ const uint64_t part1[7],
+ const uint64_t part2[7]
+) {
+ return (part1[0] == part2[0]) && (part1[1] == part2[1]) &&
+ (part1[2] == part2[2]) && (part1[3] == part2[3]) &&
+ (part1[4] == part2[4]) && (part1[5] == part2[5]) &&
+ (part1[6] == part2[6]);
+}
+
+/**
+ * @brief Hash function used for procedural partition assignment.
+ *
+ * @param inp The hash seed.
+ *
+ * @return The hashed value.
+ */
+static uint32_t hash52(
+ uint32_t inp
+) {
+ inp ^= inp >> 15;
+
+ // (2^4 + 1) * (2^7 + 1) * (2^17 - 1)
+ inp *= 0xEEDE0891;
+ inp ^= inp >> 5;
+ inp += inp << 16;
+ inp ^= inp >> 7;
+ inp ^= inp >> 3;
+ inp ^= inp << 6;
+ inp ^= inp >> 17;
+ return inp;
+}
+
+/**
+ * @brief Select texel assignment for a single coordinate.
+ *
+ * @param seed The seed - the partition index from the block.
+ * @param x The texel X coordinate in the block.
+ * @param y The texel Y coordinate in the block.
+ * @param z The texel Z coordinate in the block.
+ * @param partition_count The total partition count of this encoding.
+ * @param small_block @c true if the blockhas fewer than 32 texels.
+ *
+ * @return The assigned partition index for this texel.
+ */
+static uint8_t select_partition(
+ int seed,
+ int x,
+ int y,
+ int z,
+ int partition_count,
+ bool small_block
+) {
+ // For small blocks bias the coordinates to get better distribution
+ if (small_block)
+ {
+ x <<= 1;
+ y <<= 1;
+ z <<= 1;
+ }
+
+ seed += (partition_count - 1) * 1024;
+
+ uint32_t rnum = hash52(seed);
+
+ uint8_t seed1 = rnum & 0xF;
+ uint8_t seed2 = (rnum >> 4) & 0xF;
+ uint8_t seed3 = (rnum >> 8) & 0xF;
+ uint8_t seed4 = (rnum >> 12) & 0xF;
+ uint8_t seed5 = (rnum >> 16) & 0xF;
+ uint8_t seed6 = (rnum >> 20) & 0xF;
+ uint8_t seed7 = (rnum >> 24) & 0xF;
+ uint8_t seed8 = (rnum >> 28) & 0xF;
+ uint8_t seed9 = (rnum >> 18) & 0xF;
+ uint8_t seed10 = (rnum >> 22) & 0xF;
+ uint8_t seed11 = (rnum >> 26) & 0xF;
+ uint8_t seed12 = ((rnum >> 30) | (rnum << 2)) & 0xF;
+
+ // Squaring all the seeds in order to bias their distribution towards lower values.
+ seed1 *= seed1;
+ seed2 *= seed2;
+ seed3 *= seed3;
+ seed4 *= seed4;
+ seed5 *= seed5;
+ seed6 *= seed6;
+ seed7 *= seed7;
+ seed8 *= seed8;
+ seed9 *= seed9;
+ seed10 *= seed10;
+ seed11 *= seed11;
+ seed12 *= seed12;
+
+ int sh1, sh2;
+ if (seed & 1)
+ {
+ sh1 = (seed & 2 ? 4 : 5);
+ sh2 = (partition_count == 3 ? 6 : 5);
+ }
+ else
+ {
+ sh1 = (partition_count == 3 ? 6 : 5);
+ sh2 = (seed & 2 ? 4 : 5);
+ }
+
+ int sh3 = (seed & 0x10) ? sh1 : sh2;
+
+ seed1 >>= sh1;
+ seed2 >>= sh2;
+ seed3 >>= sh1;
+ seed4 >>= sh2;
+ seed5 >>= sh1;
+ seed6 >>= sh2;
+ seed7 >>= sh1;
+ seed8 >>= sh2;
+
+ seed9 >>= sh3;
+ seed10 >>= sh3;
+ seed11 >>= sh3;
+ seed12 >>= sh3;
+
+ int a = seed1 * x + seed2 * y + seed11 * z + (rnum >> 14);
+ int b = seed3 * x + seed4 * y + seed12 * z + (rnum >> 10);
+ int c = seed5 * x + seed6 * y + seed9 * z + (rnum >> 6);
+ int d = seed7 * x + seed8 * y + seed10 * z + (rnum >> 2);
+
+ // Apply the saw
+ a &= 0x3F;
+ b &= 0x3F;
+ c &= 0x3F;
+ d &= 0x3F;
+
+ // Remove some of the components if we are to output < 4 partitions.
+ if (partition_count <= 3)
+ {
+ d = 0;
+ }
+
+ if (partition_count <= 2)
+ {
+ c = 0;
+ }
+
+ if (partition_count <= 1)
+ {
+ b = 0;
+ }
+
+ uint8_t partition;
+ if (a >= b && a >= c && a >= d)
+ {
+ partition = 0;
+ }
+ else if (b >= c && b >= d)
+ {
+ partition = 1;
+ }
+ else if (c >= d)
+ {
+ partition = 2;
+ }
+ else
+ {
+ partition = 3;
+ }
+
+ return partition;
+}
+
+/**
+ * @brief Generate a single partition info structure.
+ *
+ * @param[out] bsd The block size information.
+ * @param partition_count The partition count of this partitioning.
+ * @param partition_index The partition index / seed of this partitioning.
+ * @param partition_remap_index The remapped partition index of this partitioning.
+ * @param[out] pi The partition info structure to populate.
+ *
+ * @return True if this is a useful partition index, False if we can skip it.
+ */
+static bool generate_one_partition_info_entry(
+ block_size_descriptor& bsd,
+ unsigned int partition_count,
+ unsigned int partition_index,
+ unsigned int partition_remap_index,
+ partition_info& pi
+) {
+ int texels_per_block = bsd.texel_count;
+ bool small_block = texels_per_block < 32;
+
+ uint8_t *partition_of_texel = pi.partition_of_texel;
+
+ // Assign texels to partitions
+ int texel_idx = 0;
+ int counts[BLOCK_MAX_PARTITIONS] { 0 };
+ for (unsigned int z = 0; z < bsd.zdim; z++)
+ {
+ for (unsigned int y = 0; y < bsd.ydim; y++)
+ {
+ for (unsigned int x = 0; x < bsd.xdim; x++)
+ {
+ uint8_t part = select_partition(partition_index, x, y, z, partition_count, small_block);
+ pi.texels_of_partition[part][counts[part]++] = static_cast<uint8_t>(texel_idx++);
+ *partition_of_texel++ = part;
+ }
+ }
+ }
+
+ // Fill loop tail so we can overfetch later
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ int ptex_count = counts[i];
+ int ptex_count_simd = round_up_to_simd_multiple_vla(ptex_count);
+ for (int j = ptex_count; j < ptex_count_simd; j++)
+ {
+ pi.texels_of_partition[i][j] = pi.texels_of_partition[i][ptex_count - 1];
+ }
+ }
+
+ // Populate the actual procedural partition count
+ if (counts[0] == 0)
+ {
+ pi.partition_count = 0;
+ }
+ else if (counts[1] == 0)
+ {
+ pi.partition_count = 1;
+ }
+ else if (counts[2] == 0)
+ {
+ pi.partition_count = 2;
+ }
+ else if (counts[3] == 0)
+ {
+ pi.partition_count = 3;
+ }
+ else
+ {
+ pi.partition_count = 4;
+ }
+
+ // Populate the partition index
+ pi.partition_index = static_cast<uint16_t>(partition_index);
+
+ // Populate the coverage bitmaps for 2/3/4 partitions
+ uint64_t* bitmaps { nullptr };
+ if (partition_count == 2)
+ {
+ bitmaps = bsd.coverage_bitmaps_2[partition_remap_index];
+ }
+ else if (partition_count == 3)
+ {
+ bitmaps = bsd.coverage_bitmaps_3[partition_remap_index];
+ }
+ else if (partition_count == 4)
+ {
+ bitmaps = bsd.coverage_bitmaps_4[partition_remap_index];
+ }
+
+ for (unsigned int i = 0; i < BLOCK_MAX_PARTITIONS; i++)
+ {
+ pi.partition_texel_count[i] = static_cast<uint8_t>(counts[i]);
+ }
+
+ // Valid partitionings have texels in all of the requested partitions
+ bool valid = pi.partition_count == partition_count;
+
+ if (bitmaps)
+ {
+ // Populate the partition coverage bitmap
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ bitmaps[i] = 0ULL;
+ }
+
+ unsigned int texels_to_process = astc::min(bsd.texel_count, BLOCK_MAX_KMEANS_TEXELS);
+ for (unsigned int i = 0; i < texels_to_process; i++)
+ {
+ unsigned int idx = bsd.kmeans_texels[i];
+ bitmaps[pi.partition_of_texel[idx]] |= 1ULL << i;
+ }
+ }
+
+ return valid;
+}
+
+static void build_partition_table_for_one_partition_count(
+ block_size_descriptor& bsd,
+ bool can_omit_partitionings,
+ unsigned int partition_count_cutoff,
+ unsigned int partition_count,
+ partition_info* ptab,
+ uint64_t* canonical_patterns
+) {
+ unsigned int next_index = 0;
+ bsd.partitioning_count_selected[partition_count - 1] = 0;
+ bsd.partitioning_count_all[partition_count - 1] = 0;
+
+ // Skip tables larger than config max partition count if we can omit modes
+ if (can_omit_partitionings && (partition_count > partition_count_cutoff))
+ {
+ return;
+ }
+
+ // Iterate through twice
+ // - Pass 0: Keep selected partitionings
+ // - Pass 1: Keep non-selected partitionings (skip if in omit mode)
+ unsigned int max_iter = can_omit_partitionings ? 1 : 2;
+
+ // Tracker for things we built in the first iteration
+ uint8_t build[BLOCK_MAX_PARTITIONINGS] { 0 };
+ for (unsigned int x = 0; x < max_iter; x++)
+ {
+ for (unsigned int i = 0; i < BLOCK_MAX_PARTITIONINGS; i++)
+ {
+ // Don't include things we built in the first pass
+ if ((x == 1) && build[i])
+ {
+ continue;
+ }
+
+ bool keep_useful = generate_one_partition_info_entry(bsd, partition_count, i, next_index, ptab[next_index]);
+ if ((x == 0) && !keep_useful)
+ {
+ continue;
+ }
+
+ generate_canonical_partitioning(bsd.texel_count, ptab[next_index].partition_of_texel, canonical_patterns + next_index * 7);
+ bool keep_canonical = true;
+ for (unsigned int j = 0; j < next_index; j++)
+ {
+ bool match = compare_canonical_partitionings(canonical_patterns + 7 * next_index, canonical_patterns + 7 * j);
+ if (match)
+ {
+ keep_canonical = false;
+ break;
+ }
+ }
+
+ if (keep_useful && keep_canonical)
+ {
+ if (x == 0)
+ {
+ bsd.partitioning_packed_index[partition_count - 2][i] = static_cast<uint16_t>(next_index);
+ bsd.partitioning_count_selected[partition_count - 1]++;
+ bsd.partitioning_count_all[partition_count - 1]++;
+ build[i] = 1;
+ next_index++;
+ }
+ }
+ else
+ {
+ if (x == 1)
+ {
+ bsd.partitioning_packed_index[partition_count - 2][i] = static_cast<uint16_t>(next_index);
+ bsd.partitioning_count_all[partition_count - 1]++;
+ next_index++;
+ }
+ }
+ }
+ }
+}
+
+/* See header for documentation. */
+void init_partition_tables(
+ block_size_descriptor& bsd,
+ bool can_omit_partitionings,
+ unsigned int partition_count_cutoff
+) {
+ partition_info* par_tab2 = bsd.partitionings;
+ partition_info* par_tab3 = par_tab2 + BLOCK_MAX_PARTITIONINGS;
+ partition_info* par_tab4 = par_tab3 + BLOCK_MAX_PARTITIONINGS;
+ partition_info* par_tab1 = par_tab4 + BLOCK_MAX_PARTITIONINGS;
+
+ generate_one_partition_info_entry(bsd, 1, 0, 0, *par_tab1);
+ bsd.partitioning_count_selected[0] = 1;
+ bsd.partitioning_count_all[0] = 1;
+
+ uint64_t* canonical_patterns = new uint64_t[BLOCK_MAX_PARTITIONINGS * 7];
+ build_partition_table_for_one_partition_count(bsd, can_omit_partitionings, partition_count_cutoff, 2, par_tab2, canonical_patterns);
+ build_partition_table_for_one_partition_count(bsd, can_omit_partitionings, partition_count_cutoff, 3, par_tab3, canonical_patterns);
+ build_partition_table_for_one_partition_count(bsd, can_omit_partitionings, partition_count_cutoff, 4, par_tab4, canonical_patterns);
+
+ delete[] canonical_patterns;
+}
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_percentile_tables.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_percentile_tables.cpp
new file mode 100644
index 00000000000..3914ef24b8b
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_percentile_tables.cpp
@@ -0,0 +1,1251 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Percentile data tables for different block encodings.
+ *
+ * To reduce binary size the tables are stored using a packed differential encoding.
+ */
+
+#include "astcenc_internal.h"
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+/**
+ * @brief Structure containing packed percentile metadata.
+ *
+ * Note that percentile tables do not exist for 3D textures, so no zdim is stored.
+ */
+struct packed_percentile_table
+{
+ /** The block X dimension. */
+ uint8_t xdim;
+
+ /** The block Y dimension. */
+ uint8_t ydim;
+
+ /** The number of packed items in the 1 and 2 plane data. */
+ uint16_t item_count[2];
+
+ /** The accumulator divisor for 1 and 2 plane data. */
+ uint16_t difscales[2];
+
+ /** The initial accumulator values for 1 and 2 plane data. */
+ uint16_t initial_percs[2];
+
+ /** The packed data for the 1 and 2 plane data. */
+ const uint16_t *items[2];
+};
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (4 * 4)
+static const uint16_t percentile_arr_4x4_0[61] {
+ 0x0242, 0x7243, 0x6A51, 0x6A52, 0x5A41, 0x4A53, 0x8851, 0x3842,
+ 0x3852, 0x3853, 0x3043, 0xFA33, 0x1BDF, 0x2022, 0x1032, 0x29CE,
+ 0x21DE, 0x2823, 0x0813, 0x0A13, 0x0A31, 0x0A23, 0x09CF, 0x0833,
+ 0x0A32, 0x01DF, 0x0BDD, 0x0BCF, 0x0221, 0x095F, 0x0A01, 0x0BDE,
+ 0x0BCD, 0x0A22, 0x09AF, 0x0B5F, 0x0B4D, 0x0BCE, 0x0BBF, 0x0A11,
+ 0x01BF, 0x0202, 0x0B5D, 0x1203, 0x034E, 0x0B8E, 0x035E, 0x0212,
+ 0x032E, 0x0B4F, 0x03AF, 0x03AD, 0x03BD, 0x0BBE, 0x03AE, 0x039F,
+ 0x039E, 0x033E, 0x033F, 0x038F, 0x032F
+};
+
+static const uint16_t percentile_arr_4x4_1[84] {
+ 0x0452, 0xFFAE, 0x2433, 0x1DDF, 0x17CD, 0x1E21, 0x1C43, 0x1442,
+ 0x3FBE, 0x1FDD, 0x0E31, 0x0F4F, 0x1423, 0x0FBD, 0x1451, 0x0E03,
+ 0x05CF, 0x0C32, 0x0DDE, 0x27AD, 0x274E, 0x0E02, 0x0F5E, 0x07AF,
+ 0x0F5F, 0x0DCE, 0x0C41, 0x0422, 0x0613, 0x0E12, 0x0611, 0x0F3F,
+ 0x0601, 0x0DBF, 0x05DD, 0x075D, 0x0C02, 0x054E, 0x0431, 0x0413,
+ 0x079F, 0x05BE, 0x0F4D, 0x0403, 0x05AF, 0x055F, 0x05AE, 0x054F,
+ 0x0421, 0x05BD, 0x0DCD, 0x0411, 0x0412, 0x055E, 0x055D, 0x073D,
+ 0x058E, 0x072F, 0x072D, 0x079D, 0x0D2E, 0x0453, 0x078D, 0x053E,
+ 0x053F, 0x059E, 0x052F, 0x058F, 0x072E, 0x078F, 0x059F, 0x078E,
+ 0x071F, 0x073E, 0x051F, 0x070D, 0x079E, 0x070E, 0x071D, 0x0622,
+ 0x070F, 0x071E, 0x07BF, 0x07CE
+};
+
+static const packed_percentile_table block_pcd_4x4 {
+ 4, 4,
+ { 61, 84 },
+ { 184, 141 },
+ { 0, 53 },
+ { percentile_arr_4x4_0, percentile_arr_4x4_1 }
+};
+#endif
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (5 * 4)
+static const uint16_t percentile_arr_5x4_0[91] {
+ 0x02C1, 0xFAD1, 0xE8D3, 0xDAC2, 0xA8D2, 0x70D1, 0x50C2, 0x80C3,
+ 0xD2C3, 0x4AA2, 0x2AD2, 0x2242, 0x2251, 0x42A3, 0x1A43, 0x4A52,
+ 0x32B3, 0x2A41, 0x1042, 0x1851, 0x5892, 0x10A2, 0x2253, 0x10B2,
+ 0x10B3, 0x13DF, 0x3083, 0x08B1, 0x1043, 0x12B1, 0x0AB2, 0x1A93,
+ 0x1852, 0x1A33, 0x09CE, 0x08A3, 0x1022, 0x1283, 0x0853, 0x1AA1,
+ 0x1093, 0x11DE, 0x135F, 0x1832, 0x195F, 0x0A81, 0x11CF, 0x0A31,
+ 0x09DF, 0x0B4D, 0x09AF, 0x03CF, 0x0813, 0x03DD, 0x0A92, 0x0A82,
+ 0x03CD, 0x0023, 0x0BDE, 0x0BBF, 0x1232, 0x0221, 0x0291, 0x0A23,
+ 0x0833, 0x035D, 0x0BCE, 0x01BF, 0x0222, 0x134E, 0x0213, 0x0A01,
+ 0x0B4F, 0x0B5E, 0x038E, 0x032E, 0x03AF, 0x0A11, 0x03AD, 0x0203,
+ 0x0202, 0x0BBD, 0x033E, 0x03AE, 0x03BE, 0x0212, 0x033F, 0x039E,
+ 0x039F, 0x032F, 0x038F
+};
+
+static const uint16_t percentile_arr_5x4_1[104] {
+ 0x0433, 0xB621, 0x5452, 0x4443, 0x7FAE, 0xFCA3, 0x7CC2, 0x24B2,
+ 0x45DF, 0x44B3, 0x7631, 0x27CD, 0x1CD1, 0x1E03, 0x4FBE, 0x774F,
+ 0x1C42, 0x7691, 0x24A2, 0x2681, 0x3C23, 0x3C93, 0x0FBD, 0x1C32,
+ 0x1E82, 0x1E12, 0x0F4E, 0x1602, 0x0FAD, 0x0C51, 0x1FDD, 0x0E13,
+ 0x0DCF, 0x175E, 0x0C22, 0x175F, 0x15DE, 0x0CB1, 0x17AF, 0x1CC1,
+ 0x1F3F, 0x1483, 0x0441, 0x0C91, 0x04D2, 0x0DCE, 0x154E, 0x079F,
+ 0x0CA1, 0x0F5D, 0x0431, 0x15DD, 0x05BF, 0x0C92, 0x0611, 0x0C82,
+ 0x0402, 0x074D, 0x0DBD, 0x055E, 0x05BE, 0x0DCD, 0x0421, 0x05AF,
+ 0x0403, 0x0D4F, 0x055F, 0x05AE, 0x0413, 0x0E01, 0x055D, 0x073D,
+ 0x0C12, 0x0692, 0x0411, 0x072D, 0x078D, 0x079D, 0x058E, 0x0D2E,
+ 0x0453, 0x072F, 0x059E, 0x052F, 0x071F, 0x053F, 0x053E, 0x078F,
+ 0x058F, 0x051F, 0x0F2E, 0x059F, 0x078E, 0x073E, 0x071D, 0x070D,
+ 0x070E, 0x079E, 0x0622, 0x0683, 0x070F, 0x071E, 0x07BF, 0x07CE
+};
+
+static const packed_percentile_table block_pcd_5x4 {
+ 5, 4,
+ { 91, 104 },
+ { 322, 464 },
+ { 0, 202 },
+ { percentile_arr_5x4_0, percentile_arr_5x4_1 }
+};
+#endif
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (5 * 5)
+static const uint16_t percentile_arr_5x5_0[129] {
+ 0x00F3, 0xF8F2, 0x70E3, 0x62E1, 0x60E1, 0x4AC1, 0x3261, 0x38D3,
+ 0x3271, 0x5AF1, 0x5873, 0x2AD1, 0x28E2, 0x28F1, 0x2262, 0x9AC2,
+ 0x18D2, 0x1072, 0x1071, 0x22A2, 0x2062, 0x1A51, 0x10C2, 0x0892,
+ 0x08D1, 0x1AA3, 0x23EE, 0x08C3, 0x0BEF, 0x2242, 0x0863, 0x0AB3,
+ 0x0BFF, 0x0A93, 0x08A2, 0x0A41, 0x1083, 0x0842, 0x10B3, 0x21EE,
+ 0x10B2, 0x00B1, 0x1263, 0x12C3, 0x0A83, 0x0851, 0x11FE, 0x0253,
+ 0x09FD, 0x0A72, 0x09FF, 0x1AB2, 0x0BDF, 0x0A33, 0x0243, 0x0B7F,
+ 0x0AB1, 0x12D2, 0x0252, 0x096F, 0x00A3, 0x0893, 0x0822, 0x0843,
+ 0x097E, 0x097F, 0x01EF, 0x09CE, 0x03FE, 0x0A81, 0x036F, 0x0052,
+ 0x13FD, 0x0AA1, 0x1853, 0x036D, 0x0A92, 0x0832, 0x01DE, 0x0A82,
+ 0x0BED, 0x0231, 0x0BBF, 0x03DD, 0x0B6E, 0x01AF, 0x0813, 0x0023,
+ 0x0A91, 0x015F, 0x037E, 0x01CF, 0x0232, 0x0BCD, 0x0221, 0x0BDE,
+ 0x0213, 0x035F, 0x0B7D, 0x0223, 0x01BF, 0x0BCF, 0x01DF, 0x0033,
+ 0x0222, 0x03CE, 0x0A01, 0x03AF, 0x034D, 0x0B8E, 0x032E, 0x0203,
+ 0x0211, 0x0202, 0x0B5D, 0x03AD, 0x034E, 0x03AE, 0x034F, 0x033F,
+ 0x039F, 0x03BD, 0x03BE, 0x035E, 0x0212, 0x033E, 0x039E, 0x032F,
+ 0x038F
+};
+
+static const uint16_t percentile_arr_5x5_1[126] {
+ 0x0443, 0x6452, 0xFE21, 0x27AE, 0x2433, 0x1FCD, 0x25DF, 0x6CC2,
+ 0x2C62, 0x1F4F, 0x4C42, 0x1FBE, 0x0DEF, 0x34A3, 0x0E03, 0x54B2,
+ 0x1F7D, 0x17DD, 0x0DFF, 0x0CD1, 0x0E31, 0x0C71, 0x1CF1, 0x15FE,
+ 0x1691, 0x1681, 0x24B3, 0x174E, 0x0F6E, 0x0493, 0x175E, 0x1C51,
+ 0x17BD, 0x076D, 0x2CA2, 0x05EE, 0x1472, 0x2423, 0x0DCF, 0x0432,
+ 0x15DE, 0x0612, 0x0CD2, 0x0682, 0x0F5F, 0x07AD, 0x0602, 0x0CE1,
+ 0x0C91, 0x0FAF, 0x073F, 0x0E13, 0x0D7F, 0x0DCE, 0x0422, 0x0D7D,
+ 0x0441, 0x05FD, 0x0CB1, 0x0C83, 0x04C1, 0x0461, 0x0F9F, 0x0DDD,
+ 0x056E, 0x0C92, 0x0482, 0x0431, 0x05ED, 0x0D6F, 0x075D, 0x0402,
+ 0x057E, 0x0DBF, 0x04A1, 0x054E, 0x0F4D, 0x0403, 0x05CD, 0x0453,
+ 0x05AE, 0x0421, 0x0F1F, 0x05BE, 0x0601, 0x0611, 0x05BD, 0x05AF,
+ 0x078D, 0x072D, 0x073D, 0x055E, 0x0F9D, 0x0411, 0x0413, 0x0412,
+ 0x055F, 0x077E, 0x055D, 0x052E, 0x054F, 0x053E, 0x058E, 0x078F,
+ 0x059E, 0x071D, 0x0E92, 0x053F, 0x059F, 0x051F, 0x072F, 0x052F,
+ 0x070D, 0x079E, 0x058F, 0x072E, 0x070E, 0x078E, 0x070F, 0x073E,
+ 0x0622, 0x0683, 0x071E, 0x076F, 0x07BF, 0x07CE
+};
+
+static const packed_percentile_table block_pcd_5x5 {
+ 5, 5,
+ { 129, 126 },
+ { 258, 291 },
+ { 0, 116 },
+ { percentile_arr_5x5_0, percentile_arr_5x5_1 }
+};
+#endif
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (6 * 5)
+static const uint16_t percentile_arr_6x5_0[165] {
+ 0x0163, 0xF8F3, 0x9962, 0x8972, 0x7961, 0x7173, 0x6953, 0x5943,
+ 0x4B41, 0x3AE1, 0x38E3, 0x6971, 0x32C1, 0x28D3, 0x2A61, 0xC8F2,
+ 0x2271, 0x4873, 0x5B21, 0x3AD1, 0x1B13, 0x1952, 0x1B51, 0x12F1,
+ 0x1A62, 0x1322, 0x1951, 0x10E2, 0x1B31, 0x20F1, 0x2102, 0x2072,
+ 0x10D2, 0x1142, 0x2912, 0x3871, 0x2BEE, 0x0862, 0x1123, 0x0AC2,
+ 0x12A2, 0x0A51, 0x1922, 0x0941, 0x1BEF, 0x0B42, 0x08D1, 0x13FF,
+ 0x1933, 0x08C3, 0x08C2, 0x1131, 0x08E1, 0x2903, 0x0863, 0x0B32,
+ 0x1132, 0x1AC3, 0x0A42, 0x1A41, 0x0042, 0x21EE, 0x09FF, 0x03DF,
+ 0x0AA3, 0x11FE, 0x02B3, 0x0B11, 0x10B3, 0x0B03, 0x11FD, 0x0913,
+ 0x0A53, 0x037F, 0x1263, 0x0051, 0x0A33, 0x0B01, 0x016F, 0x0A72,
+ 0x1312, 0x08A2, 0x10B1, 0x0BFE, 0x11EF, 0x0B02, 0x0A52, 0x0043,
+ 0x0822, 0x01CE, 0x0A43, 0x097F, 0x036F, 0x08B2, 0x03FD, 0x0A83,
+ 0x0B33, 0x0AB1, 0x017E, 0x0B23, 0x0852, 0x02D2, 0x0BBF, 0x0BDD,
+ 0x03ED, 0x0AB2, 0x02A1, 0x0853, 0x036D, 0x0892, 0x0032, 0x0A31,
+ 0x0083, 0x09DE, 0x0A93, 0x08A3, 0x1213, 0x0BDE, 0x03CD, 0x036E,
+ 0x037E, 0x0A21, 0x0023, 0x0BCF, 0x01CF, 0x0013, 0x01AF, 0x0A92,
+ 0x0232, 0x035F, 0x0093, 0x0B7D, 0x015F, 0x0282, 0x01BF, 0x09DF,
+ 0x03CE, 0x0223, 0x0833, 0x0222, 0x03AF, 0x0A01, 0x0291, 0x0B4D,
+ 0x032E, 0x038E, 0x0203, 0x0281, 0x035D, 0x03AD, 0x0B9F, 0x0202,
+ 0x034F, 0x03BE, 0x0211, 0x03AE, 0x03BD, 0x0212, 0x034E, 0x033F,
+ 0x033E, 0x035E, 0x039E, 0x032F, 0x038F
+};
+
+static const uint16_t percentile_arr_6x5_1[145] {
+ 0x0443, 0xEFAE, 0x2CC2, 0x2E21, 0x2C52, 0x7C33, 0x47CD, 0x25DF,
+ 0x3CA3, 0xFFBE, 0x2551, 0x24B3, 0x474F, 0x1513, 0x2691, 0x1603,
+ 0x1462, 0x1D32, 0x14B2, 0x5442, 0x2CD2, 0x35EF, 0x0CD1, 0x3D22,
+ 0x17BD, 0x0FDD, 0x0DFF, 0x2631, 0x177D, 0x0CF1, 0x1E81, 0x0E82,
+ 0x1DFE, 0x0F5E, 0x0701, 0x2CA2, 0x1D03, 0x0F4E, 0x1471, 0x0C51,
+ 0x1F6E, 0x2FAF, 0x0561, 0x0C72, 0x176D, 0x0FAD, 0x0DEE, 0x05CF,
+ 0x0E13, 0x0F5F, 0x0E12, 0x0C23, 0x1E02, 0x1D12, 0x0CB1, 0x0C32,
+ 0x0C93, 0x15DE, 0x0F9F, 0x0F3F, 0x0D41, 0x0C41, 0x0CC1, 0x0D31,
+ 0x0C22, 0x05FD, 0x057F, 0x0D01, 0x0461, 0x04E1, 0x0D7D, 0x05CE,
+ 0x0502, 0x0C31, 0x05ED, 0x05DD, 0x0511, 0x0F11, 0x0491, 0x0D6F,
+ 0x0521, 0x056E, 0x0C83, 0x0D23, 0x04A1, 0x0C02, 0x075D, 0x05BF,
+ 0x0C21, 0x079D, 0x0482, 0x05BD, 0x0DBE, 0x05CD, 0x054E, 0x057E,
+ 0x0DAE, 0x074D, 0x078D, 0x0542, 0x0492, 0x05AF, 0x0611, 0x0F3D,
+ 0x0601, 0x071F, 0x055E, 0x059E, 0x0571, 0x054F, 0x0412, 0x0453,
+ 0x058E, 0x0413, 0x0D3E, 0x077E, 0x072D, 0x052E, 0x059F, 0x055D,
+ 0x072F, 0x0403, 0x0411, 0x058F, 0x055F, 0x0692, 0x078E, 0x053F,
+ 0x0D2F, 0x078F, 0x070D, 0x071D, 0x051F, 0x072E, 0x079E, 0x070E,
+ 0x070F, 0x073E, 0x0622, 0x0683, 0x0702, 0x071E, 0x076F, 0x07BF,
+ 0x07CE
+};
+
+static const packed_percentile_table block_pcd_6x5 {
+ 6, 5,
+ { 165, 145 },
+ { 388, 405 },
+ { 0, 156 },
+ { percentile_arr_6x5_0, percentile_arr_6x5_1 }
+};
+#endif
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (6 * 6)
+static const uint16_t percentile_arr_6x6_0[206] {
+ 0x006F, 0xF908, 0xF104, 0xE918, 0xE963, 0xD114, 0xB0F3, 0xA07E,
+ 0x7972, 0x705F, 0x687F, 0x6162, 0x5953, 0x586E, 0x610C, 0x524D,
+ 0x5973, 0x9943, 0x98E3, 0x904F, 0x8341, 0x7AC1, 0x3A61, 0x70D3,
+ 0xA073, 0x6AE1, 0x30F2, 0x3313, 0x2B21, 0x9A2E, 0x4322, 0x225D,
+ 0x2331, 0x2271, 0x22D1, 0x1A2D, 0x221F, 0x22F1, 0x1971, 0x6952,
+ 0x1951, 0x187D, 0x18F1, 0x1902, 0x185E, 0x1B51, 0x105D, 0x1A3D,
+ 0x30E2, 0x10D2, 0x1961, 0x12A2, 0x6072, 0x3942, 0x386D, 0x33EE,
+ 0x104E, 0x4923, 0x101E, 0x2122, 0x1251, 0x1141, 0x182F, 0x3133,
+ 0x080E, 0x1262, 0x123E, 0x1B32, 0x102E, 0x1931, 0x10D1, 0x1912,
+ 0x0871, 0x12C2, 0x08C2, 0x1103, 0x0B03, 0x1062, 0x083D, 0x08E1,
+ 0x1132, 0x184D, 0x0863, 0x08C3, 0x303F, 0x083E, 0x10B3, 0x12A3,
+ 0x0BEF, 0x0B11, 0x1A42, 0x2233, 0x13FF, 0x080F, 0x0A41, 0x0AC3,
+ 0x0842, 0x1A63, 0x0BDF, 0x09FF, 0x12B3, 0x124E, 0x0B12, 0x0B42,
+ 0x0A2F, 0x1253, 0x0913, 0x1051, 0x0B01, 0x120F, 0x0B02, 0x08A2,
+ 0x0BBF, 0x00B1, 0x22B1, 0x01EE, 0x1B33, 0x0B23, 0x0283, 0x13FD,
+ 0x0AB2, 0x11FD, 0x09FE, 0x0A43, 0x08B2, 0x0A1D, 0x0A52, 0x023F,
+ 0x101F, 0x01CE, 0x0A31, 0x0BDD, 0x0293, 0x1822, 0x12A1, 0x03FE,
+ 0x121E, 0x0843, 0x0272, 0x0B6F, 0x0052, 0x0A0D, 0x0BED, 0x12D2,
+ 0x1B7F, 0x1053, 0x0032, 0x01DE, 0x08A3, 0x020E, 0x0883, 0x09EF,
+ 0x0892, 0x0A21, 0x03CD, 0x0B5F, 0x0213, 0x0A32, 0x016F, 0x1292,
+ 0x03DE, 0x017E, 0x0BAF, 0x0223, 0x1093, 0x0BCF, 0x037E, 0x01DF,
+ 0x09CF, 0x015F, 0x09AF, 0x0023, 0x01BF, 0x0222, 0x0282, 0x03CE,
+ 0x1013, 0x036E, 0x097F, 0x0033, 0x0A01, 0x0B6D, 0x03BE, 0x037D,
+ 0x0281, 0x0BAE, 0x0203, 0x032E, 0x034D, 0x034F, 0x0291, 0x0211,
+ 0x038E, 0x03BD, 0x039E, 0x0BAD, 0x033E, 0x034E, 0x039F, 0x0202,
+ 0x035D, 0x0212, 0x033F, 0x035E, 0x038F, 0x032F
+};
+
+static const uint16_t percentile_arr_6x6_1[164] {
+ 0x07AE, 0x8443, 0x7E21, 0x77CD, 0x6C62, 0x9433, 0x6452, 0x34C2,
+ 0x5DDF, 0xC7BE, 0x25EF, 0x24A3, 0x3CF1, 0xFDFF, 0x177D, 0x1F4F,
+ 0xC551, 0x5CB3, 0x1532, 0x1513, 0x143E, 0x245D, 0x14B2, 0x2472,
+ 0x14D2, 0x1FBD, 0x1631, 0x2DFE, 0x1691, 0x17DD, 0x2E03, 0x376E,
+ 0x2442, 0x0F6D, 0x3C71, 0x2CD1, 0x2522, 0x6C51, 0x260D, 0x17AF,
+ 0x0DEE, 0x1C1F, 0x2F01, 0x142E, 0x0CA2, 0x0FAD, 0x3D03, 0x275E,
+ 0x1681, 0x274E, 0x1682, 0x1C23, 0x273F, 0x0F5F, 0x05DE, 0x15FD,
+ 0x0DCF, 0x1E02, 0x04B1, 0x144D, 0x0E12, 0x0D12, 0x1CC1, 0x0E13,
+ 0x1C6D, 0x0C32, 0x043D, 0x0C61, 0x0F9F, 0x04E1, 0x0DCE, 0x0D41,
+ 0x1C93, 0x0C22, 0x061D, 0x0D7F, 0x0C41, 0x0561, 0x0531, 0x0D21,
+ 0x0711, 0x0C91, 0x0501, 0x0C1E, 0x040F, 0x15DD, 0x0431, 0x0C2F,
+ 0x057D, 0x0C2D, 0x0DBE, 0x040E, 0x0D02, 0x0D11, 0x054E, 0x040D,
+ 0x0D23, 0x0DBF, 0x04A1, 0x05ED, 0x0C1D, 0x05BD, 0x072D, 0x056E,
+ 0x0483, 0x0F3D, 0x0482, 0x078D, 0x0F5D, 0x0453, 0x0D9E, 0x0C4E,
+ 0x05CD, 0x079D, 0x0402, 0x05AE, 0x0F1F, 0x0542, 0x074D, 0x056F,
+ 0x0421, 0x0D4F, 0x0601, 0x0571, 0x0492, 0x059F, 0x053F, 0x05AF,
+ 0x0611, 0x055E, 0x0D8E, 0x053E, 0x055D, 0x047D, 0x0411, 0x052E,
+ 0x058F, 0x051F, 0x055F, 0x0D7E, 0x072F, 0x052F, 0x0412, 0x078F,
+ 0x0403, 0x077E, 0x070D, 0x070E, 0x078E, 0x0F1D, 0x072E, 0x0413,
+ 0x070F, 0x0692, 0x079E, 0x060E, 0x0622, 0x0683, 0x0702, 0x071E,
+ 0x073E, 0x076F, 0x07BF, 0x07CE
+};
+
+static const packed_percentile_table block_pcd_6x6 {
+ 6, 6,
+ { 206, 164 },
+ { 769, 644 },
+ { 0, 256 },
+ { percentile_arr_6x6_0, percentile_arr_6x6_1 }
+};
+#endif
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (8 * 5)
+static const uint16_t percentile_arr_8x5_0[226] {
+ 0x0066, 0xF865, 0xE963, 0xA856, 0xA1F2, 0x9875, 0x91C3, 0x91E2,
+ 0x80F3, 0x8076, 0x61E3, 0x6153, 0x5172, 0x59D2, 0x51D3, 0x5047,
+ 0xA943, 0x49B3, 0x4846, 0x4962, 0xC037, 0x4173, 0x39F1, 0x7027,
+ 0xA2C1, 0x3AE1, 0x9341, 0x30D3, 0x5225, 0x2A61, 0x33C1, 0x28E3,
+ 0x53A1, 0x49C2, 0x2A06, 0x4055, 0x2006, 0x21D1, 0x2271, 0x4321,
+ 0x3873, 0x18F2, 0x2015, 0x1A15, 0x1857, 0x52D1, 0x3045, 0x4835,
+ 0x1952, 0x29E1, 0x3207, 0x1036, 0x1816, 0x2A16, 0x2971, 0x13B1,
+ 0x2A17, 0x2351, 0x1025, 0x1826, 0x30E2, 0x1262, 0x20F1, 0x1007,
+ 0x1072, 0x1151, 0x10D2, 0x1235, 0x1205, 0x1062, 0x4AF1, 0x1251,
+ 0x0B31, 0x1381, 0x13EE, 0x1B92, 0x13EF, 0x0942, 0x1AA2, 0x13FF,
+ 0x1161, 0x0B93, 0x19A2, 0x11B1, 0x08D1, 0x12C2, 0x0B13, 0x1B22,
+ 0x2123, 0x09A3, 0x2071, 0x1B7F, 0x1817, 0x0A42, 0x10C2, 0x1233,
+ 0x08C3, 0x0A41, 0x0B42, 0x09C1, 0x0933, 0x1AB3, 0x1382, 0x1BDF,
+ 0x2122, 0x0A53, 0x0AC3, 0x20E1, 0x0941, 0x0931, 0x0042, 0x0BA2,
+ 0x0AA3, 0x0992, 0x0863, 0x08B3, 0x11B2, 0x0902, 0x1283, 0x09FF,
+ 0x0B83, 0x0982, 0x0932, 0x0BFE, 0x0B32, 0x0BBF, 0x11FE, 0x036F,
+ 0x0851, 0x08B1, 0x18A2, 0x11EE, 0x0A52, 0x0BB2, 0x01FD, 0x0A43,
+ 0x1A63, 0x1193, 0x0B91, 0x0043, 0x1231, 0x0A26, 0x0AB1, 0x03FD,
+ 0x096F, 0x00B2, 0x0983, 0x0A72, 0x01CE, 0x0BDD, 0x0022, 0x0B11,
+ 0x1213, 0x0B6D, 0x017E, 0x1333, 0x0112, 0x0852, 0x02D2, 0x097F,
+ 0x01EF, 0x0AB2, 0x0293, 0x0853, 0x0BED, 0x0B12, 0x1303, 0x02A1,
+ 0x0892, 0x0032, 0x0883, 0x0B6E, 0x0292, 0x0A32, 0x037E, 0x0B23,
+ 0x0103, 0x0A21, 0x0B01, 0x0302, 0x0BCD, 0x00A3, 0x0BCF, 0x0BDE,
+ 0x0113, 0x01DE, 0x0B5F, 0x0013, 0x0BAF, 0x0223, 0x0222, 0x0A82,
+ 0x0833, 0x0023, 0x09CF, 0x037D, 0x01AF, 0x095F, 0x03CE, 0x09DF,
+ 0x01BF, 0x0893, 0x0203, 0x0201, 0x0B4D, 0x03BE, 0x032E, 0x03AE,
+ 0x0291, 0x0A02, 0x0211, 0x039F, 0x0281, 0x038E, 0x03AD, 0x033F,
+ 0x035D, 0x033E, 0x034E, 0x034F, 0x0212, 0x03BD, 0x032F, 0x035E,
+ 0x038F, 0x039E
+};
+
+static const uint16_t percentile_arr_8x5_1[167] {
+ 0x0621, 0xFCC2, 0x3443, 0xA433, 0x5532, 0x2551, 0x6CA3, 0x27AE,
+ 0x6452, 0x8E03, 0x3CB3, 0x4DA2, 0x6DDF, 0x37CD, 0x6F01, 0x1691,
+ 0x2E82, 0x27BE, 0x1513, 0x34D2, 0x1D22, 0x3E31, 0x2593, 0x2CB2,
+ 0x1C16, 0x374F, 0x0DD1, 0x2583, 0x6613, 0x0CD1, 0x0C35, 0x1462,
+ 0x3E81, 0x2612, 0x2C42, 0x3407, 0x14A2, 0x0E02, 0x1CF1, 0x0C06,
+ 0x17BD, 0x0F7D, 0x1D23, 0x35B1, 0x179F, 0x0D92, 0x0F5E, 0x1451,
+ 0x04B1, 0x1F6E, 0x0DEF, 0x0D31, 0x374E, 0x15C1, 0x0541, 0x2405,
+ 0x17AD, 0x0471, 0x1472, 0x0DFE, 0x0711, 0x0FDD, 0x0DFF, 0x0432,
+ 0x1D82, 0x0423, 0x0F6D, 0x07AF, 0x0F5F, 0x04C1, 0x1542, 0x0561,
+ 0x0DCF, 0x1D03, 0x1493, 0x0422, 0x0445, 0x0D12, 0x0C25, 0x0415,
+ 0x0DA1, 0x1591, 0x0DEE, 0x05DE, 0x0C31, 0x0491, 0x0441, 0x0D21,
+ 0x078D, 0x057D, 0x0C61, 0x0F3F, 0x0581, 0x0D6E, 0x0501, 0x0CA1,
+ 0x04E1, 0x0DFD, 0x057F, 0x0502, 0x0511, 0x0C82, 0x0483, 0x0C03,
+ 0x079D, 0x0402, 0x0DDD, 0x0611, 0x05AE, 0x0DCE, 0x056F, 0x0421,
+ 0x057E, 0x071F, 0x0DBF, 0x05BE, 0x0412, 0x059F, 0x054E, 0x077E,
+ 0x0C26, 0x05ED, 0x073D, 0x0601, 0x0492, 0x0453, 0x075D, 0x058E,
+ 0x0F2D, 0x05CD, 0x0571, 0x053E, 0x0692, 0x05BD, 0x054F, 0x055E,
+ 0x0411, 0x0F1D, 0x074D, 0x059E, 0x05AF, 0x070D, 0x053F, 0x058F,
+ 0x0413, 0x070F, 0x055D, 0x070E, 0x078F, 0x052E, 0x072F, 0x055F,
+ 0x078E, 0x0F2E, 0x052F, 0x051F, 0x0417, 0x071E, 0x0781, 0x0622,
+ 0x0683, 0x0702, 0x073E, 0x076F, 0x079E, 0x07BF, 0x07CE
+};
+
+static const packed_percentile_table block_pcd_8x5 {
+ 8, 5,
+ { 226, 167 },
+ { 763, 517 },
+ { 0, 178 },
+ { percentile_arr_8x5_0, percentile_arr_8x5_1 }
+};
+#endif
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (8 * 6)
+static const uint16_t percentile_arr_8x6_0[273] {
+ 0x0154, 0xF944, 0xE066, 0xA128, 0x9963, 0x8118, 0x806F, 0x79F2,
+ 0x79E2, 0x7108, 0xD934, 0x6056, 0x69C3, 0x60F3, 0x5972, 0x59E3,
+ 0x5075, 0x91B3, 0xC9D2, 0x807E, 0x385F, 0x4153, 0x3943, 0x4162,
+ 0x3837, 0x3847, 0x7173, 0x31D3, 0x6948, 0x3046, 0x307F, 0x5827,
+ 0x3114, 0x32C1, 0x3076, 0x2A4D, 0x58E3, 0x306E, 0x2924, 0x2A61,
+ 0x29F1, 0x50D3, 0x704F, 0x210C, 0x2BA1, 0x2225, 0x2873, 0x4865,
+ 0x2206, 0x8341, 0x2006, 0x3B21, 0x18F2, 0x21C2, 0x1A1F, 0x23C1,
+ 0x3AE1, 0x1855, 0x19D1, 0x1A15, 0x3815, 0x1207, 0x1835, 0x2A2E,
+ 0x1A16, 0x1836, 0x2271, 0x2845, 0x1A2D, 0x11E1, 0x1816, 0x1171,
+ 0x2217, 0x1952, 0x12D1, 0x3904, 0x125D, 0x4BB1, 0x207D, 0x10E2,
+ 0x1026, 0x2025, 0x12F1, 0x28F1, 0x105D, 0x1235, 0x12A2, 0x1007,
+ 0x123D, 0x1A05, 0x1072, 0x1331, 0x101E, 0x0951, 0x10D2, 0x1057,
+ 0x1B92, 0x185E, 0x1251, 0x19A2, 0x186D, 0x0B81, 0x2BEE, 0x080E,
+ 0x1A33, 0x1942, 0x0B13, 0x0B51, 0x11A3, 0x0923, 0x2322, 0x09B1,
+ 0x184E, 0x1161, 0x18D1, 0x0933, 0x0B93, 0x4A62, 0x1017, 0x082F,
+ 0x0A42, 0x0B82, 0x0AA3, 0x0A41, 0x08C2, 0x08B3, 0x0A3E, 0x22B3,
+ 0x0871, 0x1BBF, 0x09C1, 0x0AC2, 0x09B2, 0x0BEF, 0x082E, 0x1062,
+ 0x0922, 0x08C3, 0x1063, 0x0A53, 0x0BDF, 0x080F, 0x0B42, 0x0A83,
+ 0x084D, 0x103F, 0x0931, 0x08E1, 0x0A0F, 0x1BA2, 0x09FF, 0x1332,
+ 0x03FF, 0x0941, 0x12C3, 0x0A63, 0x003D, 0x0842, 0x083E, 0x0B83,
+ 0x0BB2, 0x0A31, 0x0932, 0x1102, 0x0992, 0x0982, 0x1051, 0x08B1,
+ 0x0A2F, 0x121E, 0x02B1, 0x0A4E, 0x11EE, 0x00A2, 0x1022, 0x0043,
+ 0x0A52, 0x0A1D, 0x0226, 0x1193, 0x03DD, 0x08B2, 0x0BFD, 0x0A43,
+ 0x0A13, 0x0AB2, 0x01FD, 0x09FE, 0x020D, 0x081F, 0x0B33, 0x0053,
+ 0x0B91, 0x0293, 0x0B11, 0x0B7F, 0x0AA1, 0x0B03, 0x0A0E, 0x03FE,
+ 0x01CE, 0x0B6F, 0x0183, 0x0912, 0x023F, 0x0852, 0x0A21, 0x0323,
+ 0x03ED, 0x0A32, 0x13AF, 0x0272, 0x08A3, 0x0B12, 0x0083, 0x0832,
+ 0x13CD, 0x0223, 0x0A92, 0x0092, 0x0AD2, 0x0301, 0x0302, 0x0BDE,
+ 0x0A22, 0x01EF, 0x0B5F, 0x0103, 0x0BCF, 0x096F, 0x017E, 0x0113,
+ 0x01DE, 0x0823, 0x0282, 0x0B6E, 0x015F, 0x0813, 0x01AF, 0x01CF,
+ 0x0B7E, 0x0033, 0x01DF, 0x0BCE, 0x01BF, 0x036D, 0x0A03, 0x017F,
+ 0x03BE, 0x0201, 0x0893, 0x038E, 0x034D, 0x03AE, 0x0202, 0x039F,
+ 0x0291, 0x0A11, 0x032E, 0x033F, 0x034F, 0x0281, 0x037D, 0x03BD,
+ 0x0212, 0x033E, 0x035E, 0x034E, 0x035D, 0x03AD, 0x032F, 0x038F,
+ 0x039E
+};
+
+static const uint16_t percentile_arr_8x6_1[186] {
+ 0x0621, 0xFC33, 0x37AE, 0x1CC2, 0x2C43, 0xAD32, 0x34A3, 0x4551,
+ 0x6452, 0x5C62, 0x1FCD, 0x14F1, 0x4CB3, 0x24D2, 0x15DF, 0x0FBE,
+ 0x2603, 0x3DA2, 0x2E31, 0x25D1, 0x25EF, 0x0D22, 0x2E91, 0x1E82,
+ 0x0FBD, 0x1513, 0x0CB2, 0x0CD1, 0x0F4F, 0x1F7D, 0x1701, 0x0C16,
+ 0x2593, 0x2C42, 0x0C72, 0x14A2, 0x0F6E, 0x0C35, 0x0C71, 0x0D83,
+ 0x0C07, 0x1DFF, 0x043E, 0x1613, 0x07DD, 0x0FAD, 0x1451, 0x076D,
+ 0x0E81, 0x05FE, 0x0406, 0x0E0D, 0x045D, 0x2612, 0x0E02, 0x07AF,
+ 0x0DB1, 0x0F5E, 0x15C1, 0x0C23, 0x1523, 0x0C1F, 0x0D92, 0x04B1,
+ 0x0D31, 0x0432, 0x0D61, 0x0F4E, 0x0D41, 0x0DEE, 0x0D42, 0x04C1,
+ 0x0CE1, 0x079F, 0x0C2E, 0x0405, 0x0C22, 0x0461, 0x0E1D, 0x0582,
+ 0x073F, 0x0571, 0x0C4D, 0x0DFD, 0x05CE, 0x0C6D, 0x05DE, 0x0415,
+ 0x0C45, 0x075F, 0x0C41, 0x0D03, 0x05A1, 0x0711, 0x05CF, 0x0425,
+ 0x0C93, 0x0D21, 0x0591, 0x043D, 0x0D12, 0x0501, 0x040F, 0x0511,
+ 0x0431, 0x0C03, 0x04A1, 0x078D, 0x0581, 0x041E, 0x040D, 0x0C02,
+ 0x040E, 0x05DD, 0x057F, 0x079D, 0x042D, 0x0D9F, 0x0502, 0x056E,
+ 0x0412, 0x071F, 0x044E, 0x05BF, 0x0C1D, 0x0482, 0x05AE, 0x042F,
+ 0x057D, 0x0491, 0x054E, 0x047D, 0x0DBE, 0x0611, 0x0492, 0x0601,
+ 0x05BD, 0x05CD, 0x0426, 0x05ED, 0x072D, 0x073D, 0x0483, 0x0F5D,
+ 0x0421, 0x056F, 0x053F, 0x058E, 0x054F, 0x078F, 0x053E, 0x059E,
+ 0x057E, 0x051F, 0x055D, 0x0413, 0x070D, 0x05AF, 0x0411, 0x0453,
+ 0x0D5E, 0x077E, 0x052F, 0x070F, 0x074D, 0x0692, 0x070E, 0x072F,
+ 0x072E, 0x058F, 0x071D, 0x052E, 0x0417, 0x073E, 0x0781, 0x078E,
+ 0x055F, 0x060E, 0x0622, 0x0683, 0x0702, 0x071E, 0x076F, 0x079E,
+ 0x07BF, 0x07CE
+};
+
+static const packed_percentile_table block_pcd_8x6 {
+ 8, 6,
+ { 273, 186 },
+ { 880, 300 },
+ { 0, 64 },
+ { percentile_arr_8x6_0, percentile_arr_8x6_1 }
+};
+#endif
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (8 * 8)
+static const uint16_t percentile_arr_8x8_0[347] {
+ 0x0334, 0xFD44, 0xDD14, 0x9154, 0x9B08, 0x906A, 0x8928, 0x8108,
+ 0xE866, 0xC918, 0x606F, 0xC0FE, 0x5963, 0x58EE, 0x6534, 0x505A,
+ 0x51E2, 0xA8CF, 0x5354, 0x5314, 0x5134, 0x5524, 0x48F3, 0x504B,
+ 0x487E, 0x5344, 0x49C3, 0x4972, 0x49F2, 0x4856, 0xD0EF, 0x81D2,
+ 0x78DE, 0x4261, 0x3AC1, 0x71E3, 0x6879, 0x390C, 0x3143, 0x31B3,
+ 0x385F, 0x3153, 0x306E, 0x3037, 0x30DF, 0x3162, 0x304F, 0x3075,
+ 0xB03B, 0x2847, 0x28E3, 0x2914, 0x507F, 0x28BF, 0x5173, 0x5073,
+ 0x20D3, 0x2A06, 0x2827, 0x2508, 0x2229, 0x29D3, 0x204A, 0x207A,
+ 0x2046, 0x4148, 0x20FD, 0x4225, 0x23A1, 0x3944, 0x2065, 0x1924,
+ 0x2324, 0x1806, 0x19F1, 0x2215, 0x1876, 0x22AD, 0x502B, 0x1B04,
+ 0x18F2, 0x3A4D, 0x3216, 0x3504, 0x18DD, 0x1B21, 0x10CE, 0x1869,
+ 0x1B41, 0x1855, 0x1207, 0x1AE1, 0x2845, 0x19D1, 0x2A0A, 0x1A2D,
+ 0x2A1A, 0x11C2, 0x1A0B, 0x1217, 0x2816, 0x121B, 0x1271, 0x2AD1,
+ 0x1035, 0x1015, 0x287D, 0x12F1, 0x43C1, 0x1171, 0x1A05, 0x08E2,
+ 0x11E1, 0x3251, 0x2049, 0x20F1, 0x12CD, 0x0A39, 0x1219, 0x1059,
+ 0x1104, 0x1036, 0x1872, 0x3007, 0x08ED, 0x205E, 0x1026, 0x0952,
+ 0x1392, 0x1019, 0x0951, 0x100A, 0x13EE, 0x08D2, 0x1242, 0x0ABD,
+ 0x22A2, 0x0BDF, 0x2B81, 0x0A35, 0x13B1, 0x0839, 0x13BF, 0x0A33,
+ 0x1B31, 0x205D, 0x1241, 0x183A, 0x2025, 0x0B93, 0x0A3D, 0x1017,
+ 0x1313, 0x1253, 0x082A, 0x204E, 0x09A2, 0x080B, 0x0A1F, 0x125D,
+ 0x0A2E, 0x081A, 0x08D1, 0x082F, 0x086D, 0x1B82, 0x0A09, 0x0B22,
+ 0x1062, 0x11A3, 0x2161, 0x0923, 0x129F, 0x1A62, 0x0871, 0x0942,
+ 0x081B, 0x1133, 0x18AE, 0x0A9E, 0x0863, 0x09FF, 0x18C2, 0x0B51,
+ 0x08BD, 0x0AA3, 0x09B1, 0x1AC2, 0x08B3, 0x0829, 0x0BEF, 0x0B83,
+ 0x0AAE, 0x0A8D, 0x1857, 0x185B, 0x08AF, 0x103F, 0x08C3, 0x09B2,
+ 0x0A4E, 0x11C1, 0x0A31, 0x0B42, 0x0A83, 0x0BFF, 0x13DD, 0x00CD,
+ 0x0AB3, 0x0842, 0x08BE, 0x0922, 0x1A8E, 0x08E1, 0x002E, 0x0BA2,
+ 0x0A8F, 0x2263, 0x0252, 0x0B32, 0x0AC3, 0x0941, 0x0A43, 0x083D,
+ 0x083E, 0x0A3E, 0x084D, 0x1131, 0x136F, 0x0AB1, 0x0193, 0x0BFD,
+ 0x0391, 0x0851, 0x13AF, 0x0843, 0x0213, 0x1226, 0x0932, 0x03B2,
+ 0x0902, 0x0BCD, 0x0221, 0x089E, 0x00B1, 0x0BDE, 0x03FE, 0x02A1,
+ 0x0982, 0x009F, 0x080E, 0x0B5F, 0x02BE, 0x0A32, 0x0A2A, 0x01EE,
+ 0x0053, 0x0AB2, 0x0192, 0x09FD, 0x0052, 0x0B03, 0x0293, 0x00A2,
+ 0x0B7F, 0x0BED, 0x0311, 0x08B2, 0x0A72, 0x088E, 0x0333, 0x0B12,
+ 0x0A23, 0x0822, 0x0083, 0x11CE, 0x021D, 0x08A3, 0x088F, 0x029D,
+ 0x0A22, 0x0A3F, 0x01FE, 0x020F, 0x0983, 0x02D2, 0x0292, 0x0B23,
+ 0x001E, 0x0BCF, 0x03CE, 0x09AF, 0x0B02, 0x0301, 0x022F, 0x137E,
+ 0x021E, 0x09EF, 0x016F, 0x0112, 0x097E, 0x080F, 0x020D, 0x0092,
+ 0x01DE, 0x09DF, 0x0032, 0x0033, 0x0A82, 0x03BE, 0x0B6E, 0x001F,
+ 0x020E, 0x0023, 0x09CF, 0x0113, 0x0103, 0x0013, 0x0BAE, 0x0203,
+ 0x0BAD, 0x01BF, 0x034F, 0x095F, 0x036D, 0x0202, 0x017F, 0x0093,
+ 0x0201, 0x034D, 0x0212, 0x035D, 0x03BD, 0x0B3F, 0x035E, 0x0211,
+ 0x0281, 0x0291, 0x032E, 0x037D, 0x034E, 0x038E, 0x039F, 0x032F,
+ 0x033E, 0x038F, 0x039E
+};
+
+static const uint16_t percentile_arr_8x8_1[208] {
+ 0x0621, 0x3443, 0x47CD, 0x97AE, 0xFC62, 0x14F1, 0x24C2, 0x25DF,
+ 0x3C33, 0x1C52, 0x9C72, 0x0FBE, 0x0C5D, 0x343E, 0x24A3, 0x1551,
+ 0x5D32, 0x1CD2, 0x15EF, 0x4E31, 0x04DD, 0x1FDD, 0x174F, 0x0DD1,
+ 0x3E0D, 0x15FF, 0x0DA2, 0x1E03, 0x17BD, 0x177D, 0x14B3, 0x0471,
+ 0x0CAE, 0x1C1F, 0x04D1, 0x0F6E, 0x0DFE, 0x1C42, 0x0C16, 0x0D22,
+ 0x0C9F, 0x2C2E, 0x0FAD, 0x0571, 0x147D, 0x0C07, 0x04B2, 0x0F6D,
+ 0x0F5E, 0x07AF, 0x146D, 0x0C51, 0x0593, 0x2583, 0x0C4E, 0x040B,
+ 0x0C35, 0x0513, 0x0E91, 0x0406, 0x073F, 0x144D, 0x0561, 0x048F,
+ 0x0F01, 0x0F4E, 0x0CA2, 0x075F, 0x1682, 0x04E1, 0x0C1A, 0x04BD,
+ 0x0542, 0x0D41, 0x0DEE, 0x04CD, 0x0DCF, 0x04B1, 0x0C15, 0x0C3D,
+ 0x0423, 0x0592, 0x0DDE, 0x0422, 0x0432, 0x05FD, 0x0DC1, 0x05B1,
+ 0x0DCE, 0x0612, 0x0C2F, 0x0445, 0x0602, 0x0531, 0x0439, 0x0E81,
+ 0x0582, 0x0C61, 0x061D, 0x049E, 0x0405, 0x0409, 0x0DBE, 0x079F,
+ 0x0D21, 0x04C1, 0x0C0A, 0x0E13, 0x04AD, 0x040E, 0x0581, 0x0419,
+ 0x05DD, 0x0D03, 0x049D, 0x0449, 0x0429, 0x048E, 0x0DA1, 0x0425,
+ 0x0512, 0x0501, 0x0431, 0x0523, 0x0441, 0x042D, 0x040F, 0x0D7D,
+ 0x0511, 0x0502, 0x05BF, 0x04A1, 0x0C03, 0x0402, 0x079D, 0x05AE,
+ 0x075D, 0x057F, 0x041D, 0x048D, 0x042A, 0x0453, 0x05AF, 0x078D,
+ 0x0C0D, 0x073D, 0x0491, 0x0591, 0x05BD, 0x072D, 0x057E, 0x051F,
+ 0x0482, 0x0492, 0x041E, 0x0412, 0x0D9F, 0x0421, 0x0493, 0x0711,
+ 0x056E, 0x059E, 0x054E, 0x0611, 0x05ED, 0x074D, 0x070F, 0x056F,
+ 0x052F, 0x053F, 0x071F, 0x054F, 0x05CD, 0x0483, 0x055E, 0x072F,
+ 0x0E01, 0x0426, 0x058F, 0x0413, 0x078F, 0x071D, 0x055F, 0x058E,
+ 0x0411, 0x053E, 0x071E, 0x055D, 0x077E, 0x052E, 0x0692, 0x0417,
+ 0x070D, 0x078E, 0x070E, 0x072E, 0x041B, 0x060E, 0x0622, 0x0683,
+ 0x068D, 0x0702, 0x073E, 0x076F, 0x0781, 0x079E, 0x07BF, 0x07CE
+};
+
+static const packed_percentile_table block_pcd_8x8 {
+ 8, 8,
+ { 347, 208 },
+ { 1144, 267 },
+ { 0, 38 },
+ { percentile_arr_8x8_0, percentile_arr_8x8_1 }
+};
+#endif
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 5)
+static const uint16_t percentile_arr_10x5_0[274] {
+ 0x0165, 0xF975, 0xD866, 0xC056, 0xA946, 0x90C6, 0x90F5, 0x8963,
+ 0x80D6, 0x80E6, 0x60F3, 0x61C3, 0x59F2, 0xA927, 0x5075, 0x4847,
+ 0x5153, 0x4955, 0x49E2, 0x48B6, 0x41D2, 0x4943, 0x8305, 0x8172,
+ 0x4046, 0x4037, 0x40A7, 0x70B7, 0x7AC1, 0x31E3, 0x7027, 0x30E5,
+ 0x69D3, 0x99B3, 0x3315, 0x6115, 0x3136, 0x3076, 0x3173, 0x30D5,
+ 0x3106, 0x8962, 0x2916, 0x30C7, 0x5126, 0x30D3, 0x2956, 0x5117,
+ 0x2B41, 0x2AE1, 0x2A61, 0x29F1, 0x2306, 0x2145, 0x4A85, 0x2057,
+ 0x40E3, 0x4137, 0x3B21, 0x23C1, 0x2065, 0x1925, 0x51C2, 0x5225,
+ 0x4935, 0x1AD1, 0x23A1, 0x19D1, 0x1A71, 0x4055, 0x1873, 0x1A86,
+ 0x1295, 0x18F2, 0x28A6, 0x1952, 0x4AA5, 0x20B5, 0x10C5, 0x2AA2,
+ 0x11E1, 0x1107, 0x10D2, 0x2171, 0x1351, 0x3036, 0x1331, 0x1BEE,
+ 0x2035, 0x1045, 0x1313, 0x0A15, 0x1087, 0x1296, 0x13EF, 0x18E2,
+ 0x1151, 0x1086, 0x10F1, 0x08A5, 0x12C2, 0x1BFF, 0x1095, 0x1A62,
+ 0x1322, 0x0942, 0x1026, 0x1872, 0x1062, 0x0897, 0x1123, 0x08D1,
+ 0x1A06, 0x0806, 0x137F, 0x13B1, 0x13DF, 0x1A51, 0x09B1, 0x0A83,
+ 0x1015, 0x22F1, 0x0961, 0x0B81, 0x12B3, 0x0A35, 0x0AA3, 0x20B3,
+ 0x08C3, 0x2342, 0x0933, 0x0A33, 0x09A2, 0x10C2, 0x0896, 0x2205,
+ 0x0825, 0x20E1, 0x0922, 0x1242, 0x0B16, 0x0B32, 0x09A3, 0x0AC3,
+ 0x0BBF, 0x0B93, 0x0071, 0x0931, 0x0A41, 0x2392, 0x13FE, 0x09C1,
+ 0x0B07, 0x0016, 0x1182, 0x09B2, 0x0A26, 0x0132, 0x0941, 0x0A93,
+ 0x0992, 0x1063, 0x1217, 0x01FF, 0x11EE, 0x1216, 0x0B23, 0x0B82,
+ 0x0042, 0x1102, 0x0213, 0x0B6F, 0x09FE, 0x1207, 0x0807, 0x18B1,
+ 0x0253, 0x0AB1, 0x08A2, 0x13FD, 0x01FD, 0x1983, 0x0AB2, 0x0A31,
+ 0x016F, 0x0B11, 0x00B2, 0x0851, 0x0AD2, 0x0993, 0x0BDD, 0x12A1,
+ 0x017F, 0x0A97, 0x1022, 0x0383, 0x0843, 0x0A52, 0x03A2, 0x097E,
+ 0x0817, 0x03B2, 0x0A43, 0x09EF, 0x0A63, 0x0B33, 0x0B03, 0x0292,
+ 0x0272, 0x09CE, 0x0287, 0x136D, 0x0053, 0x0B12, 0x0083, 0x0892,
+ 0x0112, 0x1282, 0x03ED, 0x0852, 0x0301, 0x1391, 0x0232, 0x0B7E,
+ 0x0221, 0x08A3, 0x0BCD, 0x0BCF, 0x036E, 0x09DE, 0x0103, 0x03DE,
+ 0x0832, 0x0BAF, 0x0302, 0x13CE, 0x035F, 0x0093, 0x0A23, 0x01DF,
+ 0x0013, 0x0A22, 0x0023, 0x0113, 0x09AF, 0x01BF, 0x0033, 0x095F,
+ 0x0203, 0x0281, 0x09CF, 0x037D, 0x0201, 0x0B4D, 0x03AE, 0x03BE,
+ 0x0291, 0x035E, 0x038E, 0x0B9F, 0x03AD, 0x0202, 0x034F, 0x0211,
+ 0x035D, 0x0212, 0x032E, 0x039E, 0x033F, 0x034E, 0x03BD, 0x032F,
+ 0x033E, 0x038F
+};
+
+static const uint16_t percentile_arr_10x5_1[180] {
+ 0x0532, 0xFCA3, 0x3621, 0x6E82, 0x2CC2, 0x3D51, 0x3F01, 0x2691,
+ 0x17AE, 0x35A2, 0x74B3, 0x1603, 0x4433, 0x3C43, 0x6C35, 0x25D1,
+ 0x1D13, 0x15DF, 0x37CD, 0x0D93, 0x1D22, 0x0E81, 0x1452, 0x0CD2,
+ 0x37BE, 0x0CB2, 0x3407, 0x1523, 0x0C16, 0x0CB5, 0x0C96, 0x1486,
+ 0x2631, 0x1506, 0x0F4F, 0x1583, 0x0CD1, 0x2CA2, 0x2612, 0x1613,
+ 0x1602, 0x1F11, 0x179F, 0x17BD, 0x15B1, 0x0406, 0x1D41, 0x0CF1,
+ 0x0D31, 0x0442, 0x1C62, 0x0F6E, 0x077D, 0x0C51, 0x0445, 0x0D15,
+ 0x2592, 0x0CB1, 0x05EF, 0x0542, 0x17AF, 0x1425, 0x075E, 0x0FAD,
+ 0x0CC1, 0x0503, 0x0512, 0x15C1, 0x0C95, 0x0415, 0x0505, 0x0F4E,
+ 0x04A5, 0x0493, 0x0C32, 0x0F5F, 0x04E1, 0x0521, 0x0C85, 0x07DD,
+ 0x0582, 0x15FF, 0x05CF, 0x0405, 0x0D91, 0x05A1, 0x05FE, 0x0C23,
+ 0x0561, 0x0472, 0x0471, 0x0C22, 0x0DEE, 0x076D, 0x0502, 0x0426,
+ 0x0C61, 0x0D7D, 0x0525, 0x05DE, 0x0DCE, 0x079D, 0x0692, 0x0441,
+ 0x0C91, 0x05DD, 0x0511, 0x057F, 0x0611, 0x0DFD, 0x078D, 0x056E,
+ 0x0492, 0x04A1, 0x073F, 0x0C31, 0x05BE, 0x0483, 0x0571, 0x056F,
+ 0x0D9F, 0x0581, 0x0501, 0x057E, 0x05BF, 0x078F, 0x0516, 0x05ED,
+ 0x0402, 0x0F7E, 0x0482, 0x054E, 0x075D, 0x071F, 0x05CD, 0x0535,
+ 0x05AE, 0x0C11, 0x058F, 0x05AF, 0x0421, 0x0413, 0x0601, 0x054F,
+ 0x073D, 0x059E, 0x0487, 0x070F, 0x078E, 0x0781, 0x053E, 0x0403,
+ 0x072D, 0x055D, 0x05BD, 0x079E, 0x0D8E, 0x0412, 0x052E, 0x074D,
+ 0x053F, 0x051F, 0x070E, 0x055F, 0x072F, 0x052F, 0x070D, 0x055E,
+ 0x0417, 0x0453, 0x072E, 0x0622, 0x0683, 0x0702, 0x071D, 0x071E,
+ 0x073E, 0x076F, 0x07BF, 0x07CE
+};
+
+static const packed_percentile_table block_pcd_10x5 {
+ 10, 5,
+ { 274, 180 },
+ { 954, 324 },
+ { 0, 79 },
+ { percentile_arr_10x5_0, percentile_arr_10x5_1 }
+};
+#endif
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 6)
+static const uint16_t percentile_arr_10x6_0[325] {
+ 0x01A4, 0xF954, 0xA066, 0x9975, 0x80F5, 0x7056, 0x6918, 0x6963,
+ 0x58C6, 0x5946, 0x5928, 0x5174, 0x586F, 0xA0E6, 0x5108, 0x48D6,
+ 0x49E2, 0x40F3, 0x9172, 0x41F2, 0xB875, 0x3927, 0x39C3, 0xA953,
+ 0x3934, 0x3305, 0x30B6, 0x6943, 0x31D2, 0x3876, 0x3037, 0x2955,
+ 0x30A7, 0x32C1, 0x29B3, 0x3027, 0x287E, 0x30B7, 0x29E3, 0x5846,
+ 0x2B15, 0x2847, 0x3162, 0x5173, 0x4936, 0x285F, 0x48D3, 0x2164,
+ 0x4906, 0x20E5, 0x2915, 0x2116, 0x407F, 0x20D5, 0x2A61, 0x4117,
+ 0x20E3, 0x2126, 0x4148, 0x206E, 0x39D3, 0x2145, 0x41B4, 0x1B06,
+ 0x2114, 0x2165, 0x5321, 0x5A85, 0x1A4D, 0x1A1F, 0x19F1, 0x3341,
+ 0x184F, 0x1956, 0x3125, 0x30C7, 0x28F2, 0x1937, 0x1AE1, 0x1073,
+ 0x1BA1, 0x1935, 0x110C, 0x1BC1, 0x3A25, 0x19C2, 0x1295, 0x122E,
+ 0x1944, 0x11D1, 0x1124, 0x1857, 0x22D1, 0x2286, 0x1A2D, 0x12A2,
+ 0x2107, 0x1055, 0x2065, 0x0A71, 0x2152, 0x10C5, 0x10D2, 0x1331,
+ 0x08B5, 0x1171, 0x2836, 0x10A6, 0x0904, 0x123D, 0x20F1, 0x12A5,
+ 0x10E2, 0x107D, 0x1AF1, 0x1313, 0x0951, 0x11E1, 0x1B22, 0x1B51,
+ 0x0835, 0x101E, 0x0A5D, 0x0A15, 0x3045, 0x0A96, 0x08A5, 0x1142,
+ 0x12A3, 0x1872, 0x085D, 0x09B1, 0x100E, 0x0887, 0x0886, 0x086D,
+ 0x0933, 0x12B3, 0x0897, 0x08B3, 0x0A33, 0x0923, 0x1095, 0x0BEE,
+ 0x2BB1, 0x085E, 0x1283, 0x0A51, 0x1026, 0x0A06, 0x12C2, 0x08D1,
+ 0x11A2, 0x13BF, 0x08C3, 0x10C2, 0x0A3E, 0x0BDF, 0x0B81, 0x13EF,
+ 0x0A35, 0x0B16, 0x082F, 0x2161, 0x1B32, 0x0806, 0x084E, 0x11A3,
+ 0x1015, 0x1122, 0x2931, 0x0342, 0x0825, 0x0A0F, 0x0896, 0x0A05,
+ 0x0241, 0x09C1, 0x083F, 0x0A42, 0x0071, 0x0B07, 0x082E, 0x0393,
+ 0x12B1, 0x0A62, 0x0226, 0x0A2F, 0x0B92, 0x0063, 0x0932, 0x0862,
+ 0x09FF, 0x0A31, 0x00E1, 0x12B2, 0x09B2, 0x0AC3, 0x0941, 0x0293,
+ 0x1323, 0x104D, 0x003E, 0x083D, 0x0992, 0x1382, 0x03FF, 0x0A13,
+ 0x1016, 0x0A53, 0x0182, 0x1007, 0x0AA1, 0x080F, 0x0A16, 0x0A1E,
+ 0x0042, 0x0902, 0x13DD, 0x0BB2, 0x0A63, 0x00A2, 0x08B1, 0x03FE,
+ 0x1207, 0x08B2, 0x0B83, 0x09EE, 0x0311, 0x0A87, 0x0BAF, 0x03A2,
+ 0x09FD, 0x0051, 0x0B33, 0x020D, 0x09CE, 0x0217, 0x021D, 0x0817,
+ 0x020E, 0x0A4E, 0x001F, 0x0BFD, 0x0297, 0x0983, 0x0A92, 0x0252,
+ 0x0243, 0x0B03, 0x0193, 0x036F, 0x0B12, 0x0043, 0x0822, 0x0A21,
+ 0x01FE, 0x0853, 0x037F, 0x023F, 0x0BED, 0x02D2, 0x0B91, 0x0232,
+ 0x0282, 0x0912, 0x08A3, 0x0852, 0x0223, 0x0BCD, 0x0083, 0x0301,
+ 0x0832, 0x01EF, 0x0892, 0x0302, 0x0A72, 0x03DE, 0x0893, 0x0BCF,
+ 0x09DE, 0x03CE, 0x035F, 0x0833, 0x0023, 0x0103, 0x017E, 0x0813,
+ 0x01CF, 0x01BF, 0x016F, 0x0A22, 0x037E, 0x0113, 0x01AF, 0x0B6E,
+ 0x03BE, 0x0201, 0x0A03, 0x01DF, 0x036D, 0x03AE, 0x015F, 0x0281,
+ 0x033E, 0x0A02, 0x038E, 0x017F, 0x0291, 0x034D, 0x03BD, 0x0B7D,
+ 0x03AD, 0x0211, 0x0212, 0x034F, 0x032E, 0x039F, 0x034E, 0x035D,
+ 0x035E, 0x033F, 0x039E, 0x032F, 0x038F
+};
+
+static const uint16_t percentile_arr_10x6_1[199] {
+ 0x0621, 0xBD32, 0x5CA3, 0x1FAE, 0x64C2, 0x1D51, 0x6C33, 0xFC43,
+ 0x5CB3, 0x25A2, 0x2E82, 0x35D1, 0x4F01, 0x3FBE, 0x3691, 0x2DDF,
+ 0x2E03, 0x3FCD, 0x14D2, 0x1CF1, 0x0C52, 0x3C35, 0x2D22, 0x1513,
+ 0x1462, 0x54B2, 0x0E31, 0x4E81, 0x1593, 0x1D23, 0x1CD1, 0x14B5,
+ 0x2FBD, 0x0C07, 0x1D06, 0x0DEF, 0x14A2, 0x1612, 0x1F4F, 0x0C16,
+ 0x1F7D, 0x0C96, 0x0486, 0x1F9F, 0x0D42, 0x4583, 0x0E02, 0x0472,
+ 0x0DB1, 0x1613, 0x0FAD, 0x0D41, 0x0F11, 0x0E0D, 0x1C42, 0x143E,
+ 0x076E, 0x04B1, 0x0FAF, 0x0D61, 0x0531, 0x0C71, 0x0DFF, 0x0DFE,
+ 0x0406, 0x0C45, 0x0451, 0x0D15, 0x05C1, 0x2CC1, 0x141F, 0x0CE1,
+ 0x0FDD, 0x0C22, 0x0582, 0x0D92, 0x0571, 0x0F6D, 0x0C93, 0x045D,
+ 0x0F5E, 0x044D, 0x0423, 0x0D05, 0x0425, 0x0C95, 0x04A5, 0x0DCE,
+ 0x075F, 0x0E1D, 0x0503, 0x042E, 0x0D91, 0x0512, 0x0DDE, 0x05A1,
+ 0x074E, 0x0C32, 0x0431, 0x0415, 0x0D21, 0x05EE, 0x040E, 0x0DDD,
+ 0x0485, 0x1525, 0x0491, 0x0C26, 0x046D, 0x0C05, 0x05CF, 0x05FD,
+ 0x0E92, 0x073F, 0x0C0D, 0x043D, 0x0502, 0x0C1E, 0x041D, 0x0461,
+ 0x04A1, 0x0511, 0x0581, 0x05BD, 0x0C41, 0x059F, 0x05BF, 0x040F,
+ 0x0C7D, 0x0402, 0x054E, 0x057D, 0x0403, 0x078D, 0x05AE, 0x042D,
+ 0x0483, 0x079D, 0x0D7F, 0x0482, 0x0611, 0x056E, 0x0516, 0x05BE,
+ 0x0535, 0x044E, 0x05AF, 0x0DED, 0x042F, 0x0492, 0x058E, 0x078F,
+ 0x0412, 0x057E, 0x053E, 0x0F1F, 0x073D, 0x0601, 0x0501, 0x075D,
+ 0x059E, 0x05CD, 0x053F, 0x054F, 0x055E, 0x055D, 0x0421, 0x074D,
+ 0x051F, 0x072F, 0x0781, 0x0411, 0x0D6F, 0x077E, 0x0487, 0x070E,
+ 0x070F, 0x072D, 0x058F, 0x078E, 0x079E, 0x052E, 0x0413, 0x072E,
+ 0x071D, 0x052F, 0x055F, 0x073E, 0x0417, 0x0453, 0x060E, 0x0622,
+ 0x0683, 0x0702, 0x070D, 0x071E, 0x076F, 0x07BF, 0x07CE
+};
+
+static const packed_percentile_table block_pcd_10x6 {
+ 10, 6,
+ { 325, 199 },
+ { 922, 381 },
+ { 0, 78 },
+ { percentile_arr_10x6_0, percentile_arr_10x6_1 }
+};
+#endif
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 8)
+static const uint16_t percentile_arr_10x8_0[400] {
+ 0x0154, 0xAB34, 0xAD44, 0x8308, 0x7866, 0x7B64, 0x79A4, 0x7975,
+ 0x686A, 0x6908, 0xC514, 0x6174, 0x6128, 0x6118, 0x5B54, 0x5163,
+ 0xF856, 0x50F5, 0x986F, 0xDD34, 0x48FE, 0x4972, 0x48E6, 0x4146,
+ 0x48EE, 0x40F3, 0x4AC1, 0x38C6, 0x41E2, 0xBB05, 0x707E, 0x38D6,
+ 0x3927, 0x6B14, 0x384B, 0x3948, 0x3153, 0x385A, 0x3134, 0x6B15,
+ 0x39F2, 0x30CF, 0x3143, 0x91D2, 0x31C3, 0x60EF, 0x5973, 0x3076,
+ 0x28D3, 0x3261, 0x2875, 0x28DE, 0x290C, 0x51E3, 0x28A7, 0x20E3,
+ 0x2962, 0x2B06, 0x2917, 0x483B, 0x20B6, 0x2D24, 0x206E, 0x285F,
+ 0x20B7, 0x2936, 0x4047, 0x2037, 0x20DF, 0x28BF, 0x21B4, 0x21B3,
+ 0x1D08, 0x2027, 0x404F, 0x3846, 0x2116, 0x187F, 0x1879, 0x2285,
+ 0x1A29, 0x3915, 0x4873, 0x1955, 0x3114, 0x1B44, 0x2165, 0x107A,
+ 0x1956, 0x6137, 0x1106, 0x3145, 0x1B21, 0x19D3, 0x12AD, 0x1B41,
+ 0x1AD1, 0x1126, 0x18F2, 0x282B, 0x40E5, 0x20D5, 0x2A0A, 0x284A,
+ 0x1286, 0x1295, 0x121A, 0x2A0B, 0x321B, 0x122D, 0x10FD, 0x13A1,
+ 0x32A2, 0x12E1, 0x1164, 0x13C1, 0x124D, 0x1239, 0x4504, 0x10C7,
+ 0x22F1, 0x11F1, 0x0AC2, 0x2125, 0x1225, 0x0B04, 0x1107, 0x1069,
+ 0x1A19, 0x13BF, 0x2A96, 0x08D2, 0x1271, 0x0952, 0x2BDF, 0x0B31,
+ 0x1251, 0x2124, 0x0B13, 0x12BD, 0x1233, 0x13EE, 0x2144, 0x0B16,
+ 0x0A15, 0x18E2, 0x08DD, 0x1097, 0x0857, 0x0B24, 0x0AA5, 0x12A3,
+ 0x11C2, 0x11D1, 0x10CE, 0x0865, 0x123D, 0x08B3, 0x0B51, 0x1971,
+ 0x0A41, 0x0A06, 0x1039, 0x080A, 0x0B22, 0x0923, 0x0836, 0x08C3,
+ 0x0A1F, 0x1072, 0x080B, 0x0935, 0x0855, 0x18A6, 0x0A42, 0x1133,
+ 0x0A83, 0x0A09, 0x0ACD, 0x0A2E, 0x0887, 0x083A, 0x10C5, 0x085E,
+ 0x13B1, 0x087D, 0x0819, 0x0A9F, 0x0049, 0x08F1, 0x0BEF, 0x1161,
+ 0x0B42, 0x09E1, 0x0A05, 0x0904, 0x12AE, 0x029E, 0x0A31, 0x09FF,
+ 0x0951, 0x0859, 0x001A, 0x082F, 0x0B81, 0x08B5, 0x0A35, 0x082A,
+ 0x08ED, 0x1142, 0x1262, 0x0B32, 0x08A5, 0x12D2, 0x03DD, 0x0B07,
+ 0x18AE, 0x083F, 0x00AF, 0x0AB3, 0x086D, 0x0287, 0x0A93, 0x025D,
+ 0x0816, 0x13FF, 0x0A8D, 0x005D, 0x08D1, 0x0392, 0x0845, 0x0AC3,
+ 0x08C2, 0x01A3, 0x0AB1, 0x09A2, 0x005B, 0x0B93, 0x02B2, 0x1086,
+ 0x001B, 0x0863, 0x0216, 0x0AA1, 0x0896, 0x0A8F, 0x084E, 0x0A8E,
+ 0x0A53, 0x0026, 0x0A26, 0x0382, 0x0807, 0x0862, 0x0029, 0x0871,
+ 0x00BD, 0x0835, 0x024E, 0x0806, 0x0941, 0x0895, 0x03AF, 0x0A13,
+ 0x0932, 0x03ED, 0x0BFD, 0x0207, 0x0B83, 0x0993, 0x09B1, 0x03CD,
+ 0x0A3E, 0x03FE, 0x0A21, 0x0015, 0x0B11, 0x0A43, 0x00E1, 0x136F,
+ 0x00BE, 0x00A2, 0x0842, 0x0043, 0x0825, 0x082E, 0x0A2A, 0x03DE,
+ 0x0BA2, 0x0122, 0x0BCF, 0x004D, 0x0323, 0x09C1, 0x0292, 0x083E,
+ 0x0252, 0x0017, 0x0A72, 0x00CD, 0x0182, 0x0A63, 0x0131, 0x09B2,
+ 0x0303, 0x0902, 0x0053, 0x035F, 0x0A32, 0x003D, 0x0992, 0x0A2F,
+ 0x03B2, 0x0ABE, 0x009F, 0x0183, 0x0312, 0x08B1, 0x0B02, 0x0A17,
+ 0x0B7F, 0x0333, 0x0297, 0x0A23, 0x020F, 0x0282, 0x0851, 0x0822,
+ 0x03CE, 0x01EE, 0x000E, 0x08B2, 0x0083, 0x0A1D, 0x00A3, 0x0222,
+ 0x088F, 0x0112, 0x029D, 0x0092, 0x0A3F, 0x0391, 0x089E, 0x0301,
+ 0x01FD, 0x09BF, 0x01CE, 0x0852, 0x01FE, 0x0013, 0x0903, 0x088E,
+ 0x037E, 0x021E, 0x01EF, 0x095F, 0x016F, 0x09DE, 0x03BE, 0x020E,
+ 0x0113, 0x01DF, 0x080F, 0x020D, 0x0833, 0x03AE, 0x0032, 0x03BD,
+ 0x0823, 0x001E, 0x01AF, 0x0203, 0x034F, 0x0093, 0x0A81, 0x036E,
+ 0x0291, 0x038E, 0x0A01, 0x001F, 0x017F, 0x01CF, 0x017E, 0x0202,
+ 0x0BAD, 0x0211, 0x035D, 0x035E, 0x039F, 0x0212, 0x032E, 0x033F,
+ 0x034D, 0x034E, 0x036D, 0x032F, 0x033E, 0x037D, 0x038F, 0x039E
+};
+
+static const uint16_t percentile_arr_10x8_1[221] {
+ 0x0621, 0xDFAE, 0x2443, 0x54C2, 0x37CD, 0x1CF1, 0xFCA3, 0x14D2,
+ 0x2D32, 0x5551, 0x7DDF, 0x5C33, 0x15D1, 0x3462, 0x24B3, 0x7452,
+ 0x5FBE, 0x6472, 0x65A2, 0x1D06, 0x445D, 0x15EF, 0x0E31, 0x1D71,
+ 0x343E, 0x0D42, 0x0CDD, 0x1F01, 0x4691, 0x1435, 0x0E82, 0x0DFF,
+ 0x17DD, 0x0D22, 0x24B2, 0x1603, 0x04B5, 0x24AE, 0x060D, 0x2D13,
+ 0x0C7D, 0x0496, 0x17BD, 0x1F4F, 0x1F7D, 0x1486, 0x0593, 0x1C16,
+ 0x0C07, 0x15FE, 0x041F, 0x14D1, 0x0C9F, 0x0E81, 0x0D15, 0x27AF,
+ 0x0C2E, 0x0D23, 0x176E, 0x0FAD, 0x1C06, 0x1561, 0x0DB1, 0x040B,
+ 0x1C4E, 0x0D83, 0x1711, 0x0C42, 0x0C71, 0x1C1A, 0x0D25, 0x04A2,
+ 0x0C45, 0x076D, 0x0F9F, 0x075F, 0x0E12, 0x046D, 0x048F, 0x1D92,
+ 0x0602, 0x0C39, 0x174E, 0x0C51, 0x0CA1, 0x075E, 0x05C1, 0x14BD,
+ 0x0D31, 0x0423, 0x0F3F, 0x0495, 0x0C93, 0x049E, 0x0D05, 0x04E1,
+ 0x0DEE, 0x0415, 0x04B1, 0x0503, 0x0CCD, 0x042F, 0x0DCF, 0x044D,
+ 0x0541, 0x1582, 0x05DE, 0x0D01, 0x0487, 0x040A, 0x0516, 0x0CA5,
+ 0x05FD, 0x05BF, 0x057D, 0x0DA1, 0x0426, 0x040F, 0x071F, 0x0613,
+ 0x0432, 0x0D12, 0x043D, 0x0425, 0x0461, 0x061D, 0x0D21, 0x0591,
+ 0x079D, 0x048D, 0x0429, 0x0C49, 0x04C1, 0x042A, 0x040E, 0x0485,
+ 0x0511, 0x0405, 0x0502, 0x0441, 0x0C19, 0x0692, 0x0535, 0x058F,
+ 0x041D, 0x059F, 0x072D, 0x04AD, 0x049D, 0x05CE, 0x048E, 0x0C31,
+ 0x057F, 0x078D, 0x0409, 0x041E, 0x05AE, 0x0611, 0x058E, 0x05DD,
+ 0x05CD, 0x056E, 0x0483, 0x073D, 0x054E, 0x0D9E, 0x0402, 0x0491,
+ 0x040D, 0x056F, 0x042D, 0x0581, 0x0421, 0x057E, 0x0781, 0x053E,
+ 0x0482, 0x078F, 0x0413, 0x052E, 0x0601, 0x0422, 0x0492, 0x055E,
+ 0x05BE, 0x0F9E, 0x072F, 0x074D, 0x0412, 0x070F, 0x075D, 0x05BD,
+ 0x051F, 0x071D, 0x073E, 0x077E, 0x0403, 0x0411, 0x078E, 0x055D,
+ 0x05AF, 0x05ED, 0x052F, 0x053F, 0x070D, 0x070E, 0x072E, 0x054F,
+ 0x0417, 0x041B, 0x0453, 0x055F, 0x060E, 0x0622, 0x0683, 0x068D,
+ 0x0702, 0x071E, 0x076F, 0x07BF, 0x07CE
+};
+
+static const packed_percentile_table block_pcd_10x8 =
+{
+ 10, 8,
+ { 400, 221 },
+ { 1119, 376 },
+ { 0, 52 },
+ { percentile_arr_10x8_0, percentile_arr_10x8_1 }
+};
+#endif
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 10)
+static const uint16_t percentile_arr_10x10_0[453] {
+ 0x0334, 0x9514, 0x8954, 0x806A, 0x6F14, 0x6724, 0x6108, 0x6364,
+ 0x5175, 0x5D44, 0x5866, 0x5118, 0x5308, 0xA179, 0x5128, 0xF534,
+ 0x49A4, 0x5354, 0x9174, 0x486F, 0x48EA, 0x40F3, 0x4963, 0x414A,
+ 0xF8F9, 0x3984, 0x4172, 0x387E, 0x405A, 0x38DA, 0x38F5, 0x9B05,
+ 0x30EE, 0x32C1, 0x3261, 0x3D08, 0x31E2, 0x3056, 0x292B, 0x3146,
+ 0x3127, 0x3315, 0x58CA, 0x58E6, 0x290C, 0x3314, 0x8134, 0x28E3,
+ 0x28FE, 0x2948, 0x28C6, 0x78DE, 0x28BB, 0x68D6, 0x286E, 0x2173,
+ 0x2962, 0x21D2, 0x205F, 0x49F2, 0x2917, 0x2306, 0x207F, 0x404F,
+ 0x2153, 0x2943, 0x20CF, 0x21C3, 0x2073, 0x20D3, 0x2136, 0x183B,
+ 0x430A, 0x40A7, 0x18B6, 0x2079, 0x2309, 0x2075, 0x184B, 0x20EF,
+ 0x187A, 0x7837, 0x1B19, 0x20AB, 0x18BA, 0x20B7, 0x1994, 0x19E3,
+ 0x21B4, 0x49B3, 0x38BF, 0x193B, 0x1876, 0x182B, 0x30F2, 0x193A,
+ 0x1827, 0x1965, 0x1914, 0x184A, 0x4047, 0x1916, 0x1285, 0x1937,
+ 0x122D, 0x1915, 0x1321, 0x1955, 0x1046, 0x191B, 0x2106, 0x2919,
+ 0x1344, 0x1524, 0x12E1, 0x3926, 0x10E5, 0x2295, 0x1159, 0x1145,
+ 0x10DF, 0x124D, 0x1271, 0x092A, 0x2169, 0x1704, 0x22A2, 0x1164,
+ 0x13EE, 0x12F1, 0x0AD1, 0x128A, 0x110A, 0x11D3, 0x1286, 0x115A,
+ 0x2BA1, 0x0BBF, 0x3956, 0x2A89, 0x12AD, 0x10E9, 0x0B41, 0x1A29,
+ 0x2225, 0x08FD, 0x1107, 0x08D5, 0x191A, 0x1125, 0x1A96, 0x0B04,
+ 0x18D9, 0x2B16, 0x11F1, 0x0A33, 0x0924, 0x131A, 0x1149, 0x1324,
+ 0x0BEF, 0x0A99, 0x08CB, 0x123D, 0x1331, 0x0BDF, 0x0872, 0x22A3,
+ 0x0AC2, 0x1144, 0x0D04, 0x08D2, 0x08CE, 0x0AA9, 0x0A9A, 0x0B13,
+ 0x1251, 0x0865, 0x1069, 0x0897, 0x1215, 0x18B3, 0x1A62, 0x08C7,
+ 0x185E, 0x10E2, 0x0AA5, 0x21FF, 0x090B, 0x0952, 0x09E1, 0x0A42,
+ 0x08F1, 0x0A06, 0x0B22, 0x087D, 0x1139, 0x021F, 0x122E, 0x082F,
+ 0x09C2, 0x0887, 0x0A0A, 0x03C1, 0x0929, 0x0A5D, 0x0A83, 0x0BFF,
+ 0x0935, 0x085B, 0x0104, 0x08DD, 0x0923, 0x083F, 0x0241, 0x09D1,
+ 0x0A39, 0x0863, 0x0A8B, 0x08A6, 0x008B, 0x1133, 0x13B1, 0x089B,
+ 0x0AB3, 0x0036, 0x0BDD, 0x08ED, 0x0857, 0x0971, 0x0219, 0x1235,
+ 0x0AB1, 0x0ACD, 0x036F, 0x0A31, 0x08AA, 0x003A, 0x08C3, 0x0A05,
+ 0x02BD, 0x0B92, 0x0B07, 0x12B2, 0x08C5, 0x0B51, 0x0381, 0x0A8D,
+ 0x01A3, 0x0896, 0x0855, 0x0BFD, 0x005D, 0x0BFE, 0x023E, 0x08AF,
+ 0x00B9, 0x0A93, 0x00B5, 0x0862, 0x0A0B, 0x0A09, 0x0A72, 0x0332,
+ 0x0AA1, 0x08C9, 0x024E, 0x1382, 0x0951, 0x00A5, 0x0A2A, 0x0059,
+ 0x0A9E, 0x0B42, 0x004E, 0x0942, 0x03ED, 0x09B2, 0x02D2, 0x0849,
+ 0x0035, 0x0216, 0x0961, 0x0BAF, 0x00AE, 0x0826, 0x0287, 0x0A1A,
+ 0x0393, 0x0221, 0x09A2, 0x086D, 0x0226, 0x0871, 0x0039, 0x082A,
+ 0x08C2, 0x08E1, 0x0845, 0x0207, 0x0B23, 0x0015, 0x00D1, 0x0B83,
+ 0x037F, 0x0252, 0x08A9, 0x0099, 0x0A13, 0x0053, 0x0807, 0x03CD,
+ 0x0BDE, 0x0016, 0x089A, 0x0232, 0x035F, 0x0A8E, 0x0AC3, 0x022F,
+ 0x0263, 0x0829, 0x004D, 0x0132, 0x0806, 0x0311, 0x01B1, 0x0941,
+ 0x0086, 0x000B, 0x1122, 0x0025, 0x0842, 0x00BD, 0x0BCF, 0x03A2,
+ 0x0043, 0x0B03, 0x0895, 0x0A8F, 0x008A, 0x09EF, 0x0253, 0x0A1B,
+ 0x0182, 0x0243, 0x0A92, 0x00CD, 0x083E, 0x030B, 0x0223, 0x081A,
+ 0x0A9F, 0x0193, 0x00BE, 0x0017, 0x0931, 0x0391, 0x037E, 0x09C1,
+ 0x0312, 0x0333, 0x03B2, 0x083D, 0x08B1, 0x00B2, 0x002E, 0x021D,
+ 0x0A9D, 0x0192, 0x02AE, 0x0102, 0x0022, 0x081B, 0x0222, 0x009E,
+ 0x021E, 0x000A, 0x089F, 0x0217, 0x0BCE, 0x0052, 0x020F, 0x0A97,
+ 0x0282, 0x008E, 0x0A3F, 0x01FD, 0x00A3, 0x0019, 0x08A2, 0x0301,
+ 0x036E, 0x01FE, 0x03BE, 0x0ABE, 0x01CE, 0x0302, 0x029B, 0x0051,
+ 0x0883, 0x008F, 0x0BAE, 0x01DF, 0x0183, 0x0912, 0x000E, 0x020D,
+ 0x01EE, 0x0B4F, 0x0033, 0x0103, 0x020E, 0x0832, 0x01AF, 0x0913,
+ 0x01DE, 0x0203, 0x001E, 0x0092, 0x0093, 0x000F, 0x015F, 0x0291,
+ 0x0281, 0x0813, 0x001F, 0x01CF, 0x033F, 0x0023, 0x01BF, 0x0202,
+ 0x016F, 0x017E, 0x03AD, 0x0201, 0x034E, 0x0BBD, 0x036D, 0x017F,
+ 0x0211, 0x038E, 0x0212, 0x032E, 0x034D, 0x035E, 0x037D, 0x039E,
+ 0x032F, 0x033E, 0x035D, 0x038F, 0x039F
+};
+
+static const uint16_t percentile_arr_10x10_1[234] {
+ 0x07CD, 0x6E21, 0x24F1, 0x8443, 0xD7AE, 0x24C2, 0x1C62, 0xCCA3,
+ 0x1C33, 0xFDEF, 0x2532, 0x55DF, 0x1472, 0x6C3E, 0x14D2, 0x34DD,
+ 0x1452, 0x745D, 0x4D51, 0x8DD1, 0x247D, 0x75FF, 0x0CB3, 0x17BE,
+ 0x6CAE, 0x17DD, 0x1571, 0x3D06, 0x4E31, 0x0DA2, 0x67BD, 0x160D,
+ 0x2C4E, 0x0D22, 0x176E, 0x3CB2, 0x142E, 0x4DFE, 0x0F4F, 0x1435,
+ 0x0F01, 0x0D42, 0x0F7D, 0x0CB5, 0x1E03, 0x149F, 0x1C96, 0x141F,
+ 0x14B9, 0x0FAF, 0x0439, 0x0E91, 0x2682, 0x1D13, 0x1FAD, 0x0407,
+ 0x3471, 0x0C86, 0x0F6D, 0x0D15, 0x0D61, 0x040B, 0x0C6D, 0x0C16,
+ 0x0C9A, 0x0D0A, 0x0593, 0x0CD1, 0x248F, 0x0C2F, 0x3C42, 0x1523,
+ 0x0445, 0x0E81, 0x0CA2, 0x1525, 0x0406, 0x1C8A, 0x0C1A, 0x04BD,
+ 0x0F5E, 0x0F3F, 0x1F4E, 0x0E1D, 0x0423, 0x0DCF, 0x044D, 0x0D92,
+ 0x0583, 0x0DB1, 0x1449, 0x15EE, 0x0F5F, 0x079F, 0x0D19, 0x0409,
+ 0x04CD, 0x05FD, 0x143D, 0x0612, 0x0D03, 0x0D82, 0x04B1, 0x0C95,
+ 0x0C2A, 0x049E, 0x05AF, 0x0D31, 0x05BE, 0x04E1, 0x0D05, 0x0516,
+ 0x0711, 0x05C1, 0x0509, 0x0D41, 0x0493, 0x048E, 0x0602, 0x05BF,
+ 0x0CA5, 0x0529, 0x0535, 0x0D12, 0x0539, 0x0451, 0x0C29, 0x071F,
+ 0x040A, 0x0F3D, 0x0432, 0x059F, 0x0425, 0x0C99, 0x05DE, 0x05CE,
+ 0x0C0F, 0x0489, 0x051A, 0x0501, 0x0415, 0x057F, 0x0431, 0x0E13,
+ 0x040D, 0x041D, 0x075D, 0x0C53, 0x0502, 0x04C1, 0x049D, 0x0426,
+ 0x040E, 0x05A1, 0x055F, 0x0781, 0x0591, 0x04A9, 0x048B, 0x0D8E,
+ 0x052E, 0x0412, 0x0521, 0x0405, 0x04AD, 0x074D, 0x0611, 0x077E,
+ 0x078F, 0x078D, 0x048D, 0x041E, 0x0487, 0x0461, 0x0C85, 0x05ED,
+ 0x0402, 0x0483, 0x0419, 0x0511, 0x0491, 0x0482, 0x059E, 0x068D,
+ 0x055D, 0x072E, 0x05DD, 0x054E, 0x0441, 0x0422, 0x052F, 0x057D,
+ 0x072D, 0x079D, 0x0CA1, 0x072F, 0x079E, 0x0581, 0x042D, 0x055E,
+ 0x0601, 0x0413, 0x0692, 0x0403, 0x051F, 0x053F, 0x054F, 0x05CD,
+ 0x070F, 0x071D, 0x05AE, 0x05BD, 0x0492, 0x056E, 0x0411, 0x0417,
+ 0x041B, 0x0421, 0x053E, 0x056F, 0x057E, 0x058F, 0x060E, 0x0622,
+ 0x0683, 0x0702, 0x070D, 0x070E, 0x071E, 0x073E, 0x076F, 0x078E,
+ 0x07BF, 0x07CE
+};
+
+static const packed_percentile_table block_pcd_10x10 {
+ 10, 10,
+ { 453, 234 },
+ { 1095, 472 },
+ { 0, 70 },
+ { percentile_arr_10x10_0, percentile_arr_10x10_1 }
+};
+#endif
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (12 * 10)
+static const uint16_t percentile_arr_12x10_0[491] {
+ 0x0334, 0x9954, 0x8514, 0x7128, 0x6364, 0xC174, 0x5D34, 0x5866,
+ 0x5975, 0x5354, 0xAF14, 0x506A, 0x5108, 0x5724, 0x5308, 0x4544,
+ 0x4918, 0x4064, 0x49E2, 0x4179, 0x8163, 0x4054, 0xF81C, 0x394A,
+ 0x38F3, 0x4172, 0x38F5, 0xA06F, 0x68EA, 0x69F2, 0x3134, 0x31A4,
+ 0x305A, 0x68DA, 0x3056, 0x3146, 0x31F5, 0x3148, 0x5A61, 0x32C1,
+ 0x31D2, 0x307E, 0x29E3, 0x30E6, 0x59C3, 0x2984, 0x29B6, 0x28F9,
+ 0x5204, 0x28EE, 0x50CA, 0x2997, 0x48C6, 0x4838, 0x2953, 0x200C,
+ 0x2943, 0x2173, 0x2D08, 0x4162, 0x29B4, 0x2314, 0x21B3, 0x212B,
+ 0x210C, 0x48E3, 0x60DE, 0x205F, 0x20FE, 0x2028, 0x21A6, 0x404F,
+ 0x20D6, 0x2214, 0x2127, 0x1873, 0x40CF, 0x206E, 0x1B09, 0x21C6,
+ 0x2075, 0x19D5, 0x2305, 0x18D3, 0x2076, 0x1804, 0x230A, 0x304B,
+ 0x20BB, 0x18B6, 0x1936, 0x1B19, 0x3037, 0x187F, 0x18A7, 0x1B85,
+ 0x30BA, 0x183B, 0x1027, 0x18EF, 0x1B21, 0x1879, 0x10AB, 0x1917,
+ 0x1114, 0x18BF, 0x1074, 0x1994, 0x2847, 0x111B, 0x28F2, 0x11E5,
+ 0x19A7, 0x113A, 0x1046, 0x28B7, 0x207A, 0x182B, 0x1155, 0x104A,
+ 0x1344, 0x293B, 0x11D3, 0x2014, 0x1044, 0x1018, 0x13A1, 0x1315,
+ 0x2524, 0x20DF, 0x10E5, 0x1126, 0x12A2, 0x1824, 0x2271, 0x11F1,
+ 0x2964, 0x12D1, 0x115A, 0x092A, 0x2341, 0x1A2D, 0x12E1, 0x090A,
+ 0x13BF, 0x0A4D, 0x2119, 0x0BC1, 0x1233, 0x1A8A, 0x2008, 0x1159,
+ 0x1A89, 0x08D5, 0x1156, 0x0834, 0x13EE, 0x1169, 0x1187, 0x1AA3,
+ 0x1229, 0x1331, 0x0A85, 0x0937, 0x1704, 0x08FD, 0x2124, 0x0B13,
+ 0x1251, 0x0AAD, 0x082C, 0x091A, 0x18D9, 0x0A99, 0x1848, 0x18E9,
+ 0x0B95, 0x1144, 0x0AF1, 0x1A25, 0x131A, 0x09C5, 0x0986, 0x1BDF,
+ 0x0B24, 0x0965, 0x1262, 0x0949, 0x0872, 0x09C2, 0x12C2, 0x0916,
+ 0x085E, 0x0B06, 0x08CB, 0x08C7, 0x1242, 0x1BEF, 0x0A9A, 0x1152,
+ 0x08B3, 0x0AA9, 0x090B, 0x08D2, 0x1B22, 0x0B04, 0x0865, 0x0A15,
+ 0x1286, 0x0A83, 0x0A95, 0x09D1, 0x0A06, 0x0196, 0x1139, 0x0A3D,
+ 0x0933, 0x13B1, 0x0123, 0x0D04, 0x08E2, 0x122E, 0x08A6, 0x00CE,
+ 0x0A31, 0x1241, 0x0B51, 0x1057, 0x1171, 0x007D, 0x1145, 0x0A0A,
+ 0x0129, 0x09FF, 0x089B, 0x085B, 0x0063, 0x0AB1, 0x0A1F, 0x0A5D,
+ 0x0AA5, 0x0036, 0x0904, 0x0B86, 0x0A8B, 0x0897, 0x11E1, 0x0332,
+ 0x083F, 0x0A19, 0x02B3, 0x0859, 0x08C3, 0x0855, 0x11B5, 0x01A5,
+ 0x0AB2, 0x0392, 0x10DD, 0x09A3, 0x00ED, 0x0907, 0x1161, 0x002F,
+ 0x0887, 0x0216, 0x0ABD, 0x0B81, 0x0A93, 0x0A21, 0x003A, 0x0ACD,
+ 0x0AA1, 0x0A35, 0x0272, 0x0BDD, 0x03FE, 0x0BAF, 0x0869, 0x0213,
+ 0x088B, 0x020B, 0x00B5, 0x1035, 0x08F1, 0x0151, 0x0A4E, 0x0239,
+ 0x0BA2, 0x00AA, 0x0896, 0x0382, 0x0A08, 0x0A05, 0x0A09, 0x0142,
+ 0x086D, 0x004E, 0x0B23, 0x0106, 0x0807, 0x036F, 0x0995, 0x03FD,
+ 0x08AF, 0x08C5, 0x0062, 0x0053, 0x0B42, 0x0826, 0x021A, 0x01A2,
+ 0x09B1, 0x00C9, 0x09B2, 0x0045, 0x0207, 0x08B9, 0x00A5, 0x0AD2,
+ 0x0095, 0x003E, 0x0A32, 0x0383, 0x0849, 0x0135, 0x029E, 0x0A26,
+ 0x023E, 0x0BFF, 0x0A52, 0x0311, 0x001B, 0x0915, 0x0A8D, 0x0223,
+ 0x022A, 0x0BED, 0x0086, 0x0A96, 0x0222, 0x035F, 0x0A43, 0x085D,
+ 0x0303, 0x0393, 0x0A63, 0x082A, 0x037F, 0x0932, 0x0043, 0x0292,
+ 0x03CD, 0x0BDE, 0x009F, 0x0125, 0x08A9, 0x0253, 0x0015, 0x0192,
+ 0x0A17, 0x08C2, 0x0316, 0x00D1, 0x0282, 0x0871, 0x0312, 0x0122,
+ 0x0A9F, 0x02AE, 0x0006, 0x0A8E, 0x08E1, 0x0016, 0x0B0B, 0x00AE,
+ 0x0025, 0x0193, 0x0AC3, 0x0017, 0x0307, 0x00BD, 0x08BE, 0x0039,
+ 0x0BB2, 0x021B, 0x01FD, 0x084D, 0x03CE, 0x00A3, 0x0302, 0x0BCF,
+ 0x0033, 0x0391, 0x028F, 0x0852, 0x0287, 0x008A, 0x0333, 0x080B,
+ 0x0131, 0x01C1, 0x037E, 0x0A0F, 0x00B1, 0x002E, 0x0099, 0x0902,
+ 0x009A, 0x003D, 0x0982, 0x0301, 0x00CD, 0x0941, 0x0042, 0x0183,
+ 0x029D, 0x08A2, 0x021D, 0x001A, 0x0A97, 0x01EF, 0x01CE, 0x0051,
+ 0x0BAE, 0x022F, 0x03BE, 0x021E, 0x000A, 0x09DF, 0x0029, 0x020D,
+ 0x02BE, 0x029B, 0x09EE, 0x00B2, 0x0912, 0x036E, 0x009E, 0x0022,
+ 0x0019, 0x0892, 0x0032, 0x01FE, 0x0083, 0x023F, 0x0B96, 0x000E,
+ 0x008F, 0x0113, 0x0103, 0x001E, 0x0A0E, 0x0013, 0x008E, 0x0281,
+ 0x09AF, 0x017E, 0x0203, 0x016F, 0x0291, 0x0023, 0x0093, 0x03BD,
+ 0x001F, 0x01CF, 0x01DE, 0x0201, 0x01BF, 0x0B4F, 0x000F, 0x0202,
+ 0x037D, 0x038E, 0x0211, 0x0212, 0x034E, 0x039F, 0x03AD, 0x015F,
+ 0x017F, 0x032E, 0x033F, 0x034D, 0x035E, 0x036D, 0x032F, 0x033E,
+ 0x035D, 0x038F, 0x039E
+};
+
+static const uint16_t percentile_arr_12x10_1[240] {
+ 0x0621, 0xA443, 0xFCC2, 0x3CA3, 0x1D32, 0x14F1, 0x7462, 0x1433,
+ 0x27CD, 0x2571, 0x57AE, 0x5DD1, 0x64B3, 0x44D2, 0x2C72, 0x25A2,
+ 0x1E31, 0x55DF, 0x4C52, 0x1DEF, 0x0D51, 0x3C5D, 0x3C3E, 0x74DD,
+ 0x347D, 0x27BE, 0x5CB5, 0x17DD, 0x2C14, 0x0CAE, 0x24B2, 0x15FF,
+ 0x2701, 0x0D42, 0x1FBD, 0x0C35, 0x1603, 0x060D, 0x1D93, 0x0C96,
+ 0x1C07, 0x1522, 0x0D06, 0x0F4F, 0x0C9F, 0x1F6E, 0x0D86, 0x0C2E,
+ 0x1DFE, 0x0682, 0x1E91, 0x0F7D, 0x0C86, 0x040B, 0x1513, 0x044E,
+ 0x14D1, 0x0C39, 0x14B9, 0x1C71, 0x05B1, 0x0C1F, 0x0681, 0x1445,
+ 0x0C16, 0x0D95, 0x1583, 0x0D61, 0x0FAD, 0x1442, 0x048F, 0x0D0A,
+ 0x049A, 0x0F6D, 0x146D, 0x0C2F, 0x0D25, 0x0406, 0x0C1A, 0x0D23,
+ 0x0612, 0x0FAF, 0x0F11, 0x0592, 0x0515, 0x14E1, 0x0602, 0x048A,
+ 0x0E1D, 0x0CBD, 0x0F9F, 0x0423, 0x075E, 0x174E, 0x0426, 0x0404,
+ 0x0C22, 0x0CA2, 0x0DEE, 0x0CA5, 0x0F3F, 0x05C1, 0x0CCD, 0x0503,
+ 0x044D, 0x0D16, 0x0449, 0x0D82, 0x0613, 0x0585, 0x0519, 0x0C95,
+ 0x075F, 0x0D35, 0x04B1, 0x0509, 0x0531, 0x0DA1, 0x049E, 0x040A,
+ 0x05CF, 0x0D41, 0x0415, 0x0692, 0x05FD, 0x0C25, 0x04A1, 0x0529,
+ 0x0591, 0x0C93, 0x057F, 0x04C1, 0x0512, 0x051A, 0x078D, 0x0451,
+ 0x0C0F, 0x0487, 0x0611, 0x0432, 0x042A, 0x05AF, 0x0461, 0x072D,
+ 0x0409, 0x0405, 0x0D39, 0x05DE, 0x048E, 0x0499, 0x0483, 0x04A9,
+ 0x0491, 0x042D, 0x049D, 0x0429, 0x040E, 0x05AE, 0x0521, 0x043D,
+ 0x0581, 0x05DD, 0x0492, 0x0CAD, 0x041E, 0x058F, 0x071F, 0x072F,
+ 0x0419, 0x073D, 0x057D, 0x0511, 0x05CE, 0x041D, 0x0485, 0x056E,
+ 0x0412, 0x0431, 0x05BF, 0x0441, 0x054E, 0x0489, 0x0421, 0x0502,
+ 0x0408, 0x040D, 0x051F, 0x059F, 0x073E, 0x078F, 0x0482, 0x079D,
+ 0x0C02, 0x05BE, 0x048B, 0x0411, 0x0505, 0x057E, 0x052E, 0x074D,
+ 0x077E, 0x054F, 0x0601, 0x055F, 0x068D, 0x070D, 0x070F, 0x071E,
+ 0x072E, 0x05CD, 0x0403, 0x0501, 0x055D, 0x059E, 0x0781, 0x0413,
+ 0x0417, 0x041B, 0x0453, 0x048D, 0x052F, 0x053E, 0x053F, 0x055E,
+ 0x056F, 0x058E, 0x05BD, 0x05ED, 0x060E, 0x0622, 0x0683, 0x0702,
+ 0x070E, 0x071D, 0x075D, 0x076F, 0x078E, 0x079E, 0x07BF, 0x07CE
+};
+
+static const packed_percentile_table block_pcd_12x10 =
+{
+ 12, 10,
+ { 491, 240 },
+ { 1099, 341 },
+ { 0, 23 },
+ { percentile_arr_12x10_0, percentile_arr_12x10_1 }
+};
+#endif
+
+#if ASTCENC_BLOCK_MAX_TEXELS >= (12 * 12)
+static const uint16_t percentile_arr_12x12_0[529] {
+ 0x0334, 0xF534, 0x8514, 0x8954, 0x7F14, 0xFB54, 0x7B08, 0x7128,
+ 0x7974, 0x6179, 0x6B64, 0x6908, 0x606A, 0x6724, 0xB544, 0xB066,
+ 0xA14A, 0x5118, 0x9975, 0x51F9, 0x981C, 0x49CA, 0x4854, 0x886F,
+ 0x88D4, 0x48EE, 0x41E2, 0x4163, 0x40F3, 0x4261, 0x4064, 0x407E,
+ 0x385A, 0x42C1, 0x4172, 0x38EA, 0x3946, 0x78CF, 0xA056, 0x38DE,
+ 0x3D08, 0x38F9, 0x3B14, 0x38FE, 0xA134, 0x38B8, 0x31A4, 0x71D2,
+ 0x60DA, 0x39C3, 0x99BA, 0x60CA, 0x39F2, 0x30F5, 0x304F, 0x31B6,
+ 0x31F5, 0x3204, 0x3148, 0x305F, 0x2953, 0x3194, 0x3184, 0x310C,
+ 0x889C, 0x300C, 0x2943, 0x30EF, 0x28C6, 0x2997, 0x2838, 0x58E6,
+ 0x20E4, 0x28E3, 0x2873, 0x29E3, 0x2A84, 0x28D3, 0x492B, 0x2962,
+ 0x286E, 0x20BF, 0x21AA, 0x29A6, 0x6A14, 0x2828, 0x89C6, 0x21B3,
+ 0x2305, 0x29B4, 0x2173, 0x2127, 0x20D6, 0x407F, 0x2294, 0x21D9,
+ 0x21D5, 0x2004, 0x404B, 0x18DF, 0x2079, 0x219B, 0x18A8, 0x2385,
+ 0x1936, 0x21AB, 0x188C, 0x1B09, 0x18BA, 0x203B, 0x187A, 0x1875,
+ 0x2344, 0x18BB, 0x18B6, 0x193A, 0x1837, 0x1914, 0x1846, 0x1876,
+ 0x1884, 0x1D24, 0x182B, 0x284A, 0x18A7, 0x18AB, 0x1917, 0x322D,
+ 0x1047, 0x1874, 0x1818, 0x18F2, 0x1164, 0x1B89, 0x2959, 0x1B21,
+ 0x39E5, 0x1827, 0x10F4, 0x18B7, 0x11D3, 0x1A4D, 0x1315, 0x12AD,
+ 0x1AD1, 0x3A71, 0x1319, 0x11A7, 0x2044, 0x2F04, 0x2341, 0x10E5,
+ 0x1155, 0x195A, 0x1024, 0x111B, 0x1251, 0x1233, 0x12E1, 0x13A1,
+ 0x13BF, 0x212A, 0x22A2, 0x113B, 0x23DF, 0x10D5, 0x2399, 0x0814,
+ 0x1126, 0x13EE, 0x1285, 0x10C4, 0x18FD, 0x20D9, 0x0987, 0x1242,
+ 0x29C5, 0x2313, 0x0898, 0x13C1, 0x08C8, 0x11F1, 0x1034, 0x1B24,
+ 0x0B0A, 0x11E9, 0x0808, 0x125D, 0x18E9, 0x0848, 0x1395, 0x0965,
+ 0x123D, 0x2186, 0x1295, 0x18CE, 0x098B, 0x0BEF, 0x1504, 0x082C,
+ 0x0A41, 0x1144, 0x0A89, 0x0956, 0x1331, 0x085E, 0x0B04, 0x128A,
+ 0x12A3, 0x1937, 0x19C2, 0x0952, 0x0872, 0x08B4, 0x1262, 0x1124,
+ 0x1969, 0x1063, 0x0AF1, 0x1225, 0x0894, 0x11C9, 0x18D2, 0x0ACD,
+ 0x0A29, 0x0B06, 0x09B5, 0x18C7, 0x0916, 0x1088, 0x09FF, 0x2206,
+ 0x0A15, 0x08B3, 0x0B51, 0x0A1F, 0x18CB, 0x0AC2, 0x0A2E, 0x1865,
+ 0x08AC, 0x0A31, 0x08A4, 0x138A, 0x0A99, 0x09D1, 0x0A86, 0x189B,
+ 0x0283, 0x0BDD, 0x0ABD, 0x1933, 0x083F, 0x1386, 0x0923, 0x0322,
+ 0x0869, 0x10DD, 0x13B1, 0x082F, 0x087D, 0x11B9, 0x085B, 0x08ED,
+ 0x00C3, 0x08E2, 0x084E, 0x0887, 0x0855, 0x0A0A, 0x0857, 0x0B92,
+ 0x1036, 0x12A5, 0x0293, 0x0945, 0x08A6, 0x0196, 0x19A3, 0x036F,
+ 0x0904, 0x1205, 0x09E1, 0x0381, 0x0971, 0x1219, 0x0BAF, 0x0949,
+ 0x00AF, 0x0AA9, 0x018A, 0x0907, 0x0BFD, 0x003A, 0x0BCD, 0x0AB2,
+ 0x088B, 0x0252, 0x0A4E, 0x03FF, 0x0845, 0x0897, 0x0059, 0x090B,
+ 0x0B42, 0x0807, 0x0A16, 0x0853, 0x0A8D, 0x01B2, 0x0AB1, 0x091A,
+ 0x0195, 0x0A35, 0x00B5, 0x10AA, 0x0115, 0x0A21, 0x0096, 0x0A08,
+ 0x03FE, 0x0B7F, 0x08B9, 0x12B3, 0x023E, 0x0A23, 0x029E, 0x08F1,
+ 0x01A9, 0x0BDE, 0x0843, 0x02D2, 0x0A1A, 0x08C5, 0x0151, 0x0A43,
+ 0x0332, 0x0383, 0x0826, 0x0BED, 0x10C2, 0x00AE, 0x0B82, 0x0213,
+ 0x0232, 0x085D, 0x02A1, 0x101B, 0x035F, 0x0303, 0x0A39, 0x0207,
+ 0x0A53, 0x0142, 0x01A5, 0x082A, 0x0099, 0x0A17, 0x03CF, 0x0906,
+ 0x0125, 0x0A96, 0x0A9A, 0x0209, 0x0393, 0x0961, 0x0131, 0x0A88,
+ 0x0139, 0x099A, 0x0292, 0x0272, 0x0862, 0x08BE, 0x0141, 0x02C3,
+ 0x0886, 0x0039, 0x08A9, 0x01A2, 0x01B1, 0x0851, 0x020B, 0x086D,
+ 0x0312, 0x08CD, 0x020F, 0x0311, 0x0BCE, 0x0135, 0x0006, 0x0849,
+ 0x0132, 0x0A8F, 0x022F, 0x022A, 0x0AAE, 0x0A8E, 0x0263, 0x03A2,
+ 0x083E, 0x009A, 0x021B, 0x0835, 0x0323, 0x0871, 0x0993, 0x0226,
+ 0x0302, 0x0922, 0x0119, 0x0222, 0x021D, 0x0B07, 0x08C9, 0x037E,
+ 0x08BD, 0x0042, 0x00D1, 0x0B33, 0x01C1, 0x0B9A, 0x0282, 0x088A,
+ 0x0182, 0x083D, 0x004D, 0x010A, 0x0A1E, 0x0019, 0x00B2, 0x0999,
+ 0x00A5, 0x0095, 0x0817, 0x0022, 0x031A, 0x0902, 0x00A3, 0x01BF,
+ 0x029F, 0x0816, 0x03B2, 0x0015, 0x0391, 0x0BBE, 0x01FE, 0x1129,
+ 0x002E, 0x01DF, 0x0301, 0x0033, 0x0B6E, 0x00E1, 0x0297, 0x00B1,
+ 0x009F, 0x0B16, 0x000A, 0x001A, 0x0052, 0x080B, 0x030B, 0x029D,
+ 0x0BAE, 0x01FD, 0x020E, 0x00A2, 0x0A3F, 0x0192, 0x0ABE, 0x020D,
+ 0x008F, 0x028B, 0x0083, 0x0025, 0x09EE, 0x01EF, 0x0029, 0x0291,
+ 0x0B4F, 0x0396, 0x0287, 0x008E, 0x0092, 0x0B4E, 0x017E, 0x001E,
+ 0x009E, 0x0103, 0x080F, 0x000E, 0x0113, 0x0203, 0x01CF, 0x0183,
+ 0x01CE, 0x001F, 0x0112, 0x01DE, 0x038E, 0x0832, 0x033E, 0x0212,
+ 0x029B, 0x0023, 0x016F, 0x0201, 0x09AF, 0x0202, 0x0281, 0x035E,
+ 0x034D, 0x037D, 0x03AD, 0x0013, 0x0093, 0x015F, 0x0211, 0x033F,
+ 0x036D, 0x039F, 0x03BD, 0x017F, 0x032E, 0x032F, 0x035D, 0x038F,
+ 0x039E
+};
+
+static const uint16_t percentile_arr_12x12_1[246] {
+ 0x0443, 0xFFCD, 0x2C62, 0x2E21, 0x3CF1, 0x34C2, 0x4CDD, 0x2452,
+ 0xD5DF, 0x1DD1, 0x0FAE, 0x64A3, 0x0C7D, 0x3433, 0x1CD2, 0x2DEF,
+ 0x0C3E, 0x1D71, 0xA472, 0x0D32, 0x54B3, 0x4D51, 0x445D, 0x0E31,
+ 0x1FDD, 0x0DFF, 0x0CAE, 0x45A2, 0x2FBE, 0xA4B9, 0x1C4E, 0x2C9F,
+ 0x160D, 0x0D42, 0x342E, 0x074F, 0x1414, 0x0F6E, 0x0CB2, 0x34B5,
+ 0x0DFE, 0x0D86, 0x1496, 0x1D22, 0x0691, 0x140B, 0x041F, 0x0C35,
+ 0x1D93, 0x1506, 0x1439, 0x0C9A, 0x0F01, 0x2442, 0x0C8F, 0x04D1,
+ 0x1486, 0x0C6D, 0x0513, 0x0C71, 0x0E82, 0x177D, 0x0E03, 0x07BD,
+ 0x0C2F, 0x0D83, 0x07AF, 0x0D61, 0x1407, 0x0DB1, 0x050A, 0x0C94,
+ 0x07AD, 0x0D8A, 0x0C04, 0x0416, 0x0C49, 0x0445, 0x15C1, 0x0C1A,
+ 0x0525, 0x0595, 0x0C8A, 0x075E, 0x0CBD, 0x0681, 0x0F4E, 0x075F,
+ 0x061D, 0x1541, 0x0CB1, 0x0F3F, 0x0406, 0x076D, 0x0DCF, 0x05EE,
+ 0x0D23, 0x0599, 0x0CCD, 0x0711, 0x0C23, 0x079F, 0x0D15, 0x0585,
+ 0x04A2, 0x042A, 0x0D31, 0x05BF, 0x0D92, 0x0C26, 0x043D, 0x0C93,
+ 0x0502, 0x0C15, 0x048B, 0x0D03, 0x0613, 0x0516, 0x0495, 0x0C29,
+ 0x04A5, 0x040F, 0x0425, 0x0539, 0x0D19, 0x04E1, 0x05BE, 0x0422,
+ 0x0432, 0x0C0A, 0x0431, 0x041E, 0x0492, 0x04A9, 0x0582, 0x0529,
+ 0x0487, 0x0C4D, 0x0512, 0x049E, 0x0505, 0x0451, 0x0D7F, 0x0489,
+ 0x0602, 0x05DE, 0x0591, 0x0535, 0x074D, 0x055E, 0x04C1, 0x0612,
+ 0x05DD, 0x05FD, 0x0C61, 0x0521, 0x0484, 0x05CE, 0x0581, 0x0491,
+ 0x051A, 0x04A1, 0x048E, 0x040D, 0x0499, 0x071F, 0x072E, 0x075D,
+ 0x0441, 0x0589, 0x057E, 0x0CAD, 0x0501, 0x054F, 0x0692, 0x0511,
+ 0x049D, 0x0509, 0x056E, 0x040E, 0x0409, 0x0601, 0x048D, 0x0413,
+ 0x053E, 0x0419, 0x072D, 0x0408, 0x0485, 0x042D, 0x041D, 0x05A1,
+ 0x0781, 0x0402, 0x05ED, 0x0C82, 0x0403, 0x057D, 0x05CD, 0x0611,
+ 0x0488, 0x0411, 0x054E, 0x051F, 0x053F, 0x056F, 0x059F, 0x070F,
+ 0x071D, 0x073D, 0x073E, 0x077E, 0x078F, 0x0405, 0x079D, 0x079E,
+ 0x058E, 0x0412, 0x055D, 0x05AE, 0x041B, 0x0421, 0x0453, 0x0417,
+ 0x0483, 0x052E, 0x052F, 0x055F, 0x058F, 0x059E, 0x05AF, 0x05BD,
+ 0x060E, 0x0622, 0x0683, 0x068D, 0x0702, 0x070D, 0x070E, 0x071E,
+ 0x072F, 0x076F, 0x078D, 0x078E, 0x07BF, 0x07CE
+};
+
+static const packed_percentile_table block_pcd_12x12 {
+ 12, 12,
+ { 529, 246 },
+ { 1435, 335 },
+ { 0, 22 },
+ { percentile_arr_12x12_0, percentile_arr_12x12_1 }
+};
+#endif
+
+/**
+ * @brief Fetch the packed percentile table for the given 2D block size.
+ *
+ * @param xdim The block x size.
+ * @param ydim The block y size.
+ *
+ * @return The packed table.
+ */
+static const packed_percentile_table *get_packed_table(
+ int xdim,
+ int ydim
+) {
+ int idx = (ydim << 8) | xdim;
+ switch (idx)
+ {
+#if ASTCENC_BLOCK_MAX_TEXELS >= (4 * 4)
+ case 0x0404: return &block_pcd_4x4;
+#endif
+#if ASTCENC_BLOCK_MAX_TEXELS >= (5 * 4)
+ case 0x0405: return &block_pcd_5x4;
+#endif
+#if ASTCENC_BLOCK_MAX_TEXELS >= (5 * 5)
+ case 0x0505: return &block_pcd_5x5;
+#endif
+#if ASTCENC_BLOCK_MAX_TEXELS >= (6 * 5)
+ case 0x0506: return &block_pcd_6x5;
+#endif
+#if ASTCENC_BLOCK_MAX_TEXELS >= (6 * 6)
+ case 0x0606: return &block_pcd_6x6;
+#endif
+#if ASTCENC_BLOCK_MAX_TEXELS >= (8 * 5)
+ case 0x0508: return &block_pcd_8x5;
+#endif
+#if ASTCENC_BLOCK_MAX_TEXELS >= (8 * 6)
+ case 0x0608: return &block_pcd_8x6;
+#endif
+#if ASTCENC_BLOCK_MAX_TEXELS >= (8 * 8)
+ case 0x0808: return &block_pcd_8x8;
+#endif
+#if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 5)
+ case 0x050A: return &block_pcd_10x5;
+#endif
+#if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 6)
+ case 0x060A: return &block_pcd_10x6;
+#endif
+#if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 8)
+ case 0x080A: return &block_pcd_10x8;
+#endif
+#if ASTCENC_BLOCK_MAX_TEXELS >= (10 * 10)
+ case 0x0A0A: return &block_pcd_10x10;
+#endif
+#if ASTCENC_BLOCK_MAX_TEXELS >= (12 * 10)
+ case 0x0A0C: return &block_pcd_12x10;
+#endif
+#if ASTCENC_BLOCK_MAX_TEXELS >= (12 * 12)
+ case 0x0C0C: return &block_pcd_12x12;
+#endif
+ }
+
+ // Should never hit this with a valid 2D block size
+ return nullptr;
+}
+
+/* See header for documentation. */
+const float *get_2d_percentile_table(
+ unsigned int xdim,
+ unsigned int ydim
+) {
+ float* unpacked_table = new float[2048];
+ const packed_percentile_table *apt = get_packed_table(xdim, ydim);
+
+ // Set the default percentile
+ for (unsigned int i = 0; i < 2048; i++)
+ {
+ unpacked_table[i] = 1.0f;
+ }
+
+ // Populate the unpacked percentile values
+ for (int i = 0; i < 2; i++)
+ {
+ unsigned int itemcount = apt->item_count[i];
+ unsigned int difscale = apt->difscales[i];
+ unsigned int accum = apt->initial_percs[i];
+ const uint16_t *item_ptr = apt->items[i];
+
+ for (unsigned int j = 0; j < itemcount; j++)
+ {
+ uint16_t item = item_ptr[j];
+ unsigned int idx = item & 0x7FF;
+ unsigned int weight = (item >> 11) & 0x1F;
+ accum += weight;
+ unpacked_table[idx] = static_cast<float>(accum) / static_cast<float>(difscale);
+ }
+ }
+
+ return unpacked_table;
+}
+#endif
+
+/* See header for documentation. */
+bool is_legal_2d_block_size(
+ unsigned int xdim,
+ unsigned int ydim
+) {
+ unsigned int idx = (xdim << 8) | ydim;
+ switch (idx)
+ {
+ case 0x0404:
+ case 0x0504:
+ case 0x0505:
+ case 0x0605:
+ case 0x0606:
+ case 0x0805:
+ case 0x0806:
+ case 0x0808:
+ case 0x0A05:
+ case 0x0A06:
+ case 0x0A08:
+ case 0x0A0A:
+ case 0x0C0A:
+ case 0x0C0C:
+ return true;
+ }
+
+ return false;
+}
+
+/* See header for documentation. */
+bool is_legal_3d_block_size(
+ unsigned int xdim,
+ unsigned int ydim,
+ unsigned int zdim
+) {
+ unsigned int idx = (xdim << 16) | (ydim << 8) | zdim;
+ switch (idx)
+ {
+ case 0x030303:
+ case 0x040303:
+ case 0x040403:
+ case 0x040404:
+ case 0x050404:
+ case 0x050504:
+ case 0x050505:
+ case 0x060505:
+ case 0x060605:
+ case 0x060606:
+ return true;
+ }
+
+ return false;
+}
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_pick_best_endpoint_format.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_pick_best_endpoint_format.cpp
new file mode 100644
index 00000000000..5bf0b367897
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_pick_best_endpoint_format.cpp
@@ -0,0 +1,1357 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+
+/**
+ * @brief Functions for finding best endpoint format.
+ *
+ * We assume there are two independent sources of error in any given partition:
+ *
+ * - Encoding choice errors
+ * - Quantization errors
+ *
+ * Encoding choice errors are caused by encoder decisions. For example:
+ *
+ * - Using luminance instead of separate RGB components.
+ * - Using a constant 1.0 alpha instead of storing an alpha component.
+ * - Using RGB+scale instead of storing two full RGB endpoints.
+ *
+ * Quantization errors occur due to the limited precision we use for storage. These errors generally
+ * scale with quantization level, but are not actually independent of color encoding. In particular:
+ *
+ * - If we can use offset encoding then quantization error is halved.
+ * - If we can use blue-contraction then quantization error for RG is halved.
+ * - If we use HDR endpoints the quantization error is higher.
+ *
+ * Apart from these effects, we assume the error is proportional to the quantization step size.
+ */
+
+
+#include "astcenc_internal.h"
+#include "astcenc_vecmathlib.h"
+
+#include <assert.h>
+
+/**
+ * @brief Compute the errors of the endpoint line options for one partition.
+ *
+ * Uncorrelated data assumes storing completely independent RGBA channels for each endpoint. Same
+ * chroma data assumes storing RGBA endpoints which pass though the origin (LDR only). RGBL data
+ * assumes storing RGB + lumashift (HDR only). Luminance error assumes storing RGB channels as a
+ * single value.
+ *
+ *
+ * @param pi The partition info data.
+ * @param partition_index The partition index to compule the error for.
+ * @param blk The image block.
+ * @param uncor_pline The endpoint line assuming uncorrelated endpoints.
+ * @param[out] uncor_err The computed error for the uncorrelated endpoint line.
+ * @param samec_pline The endpoint line assuming the same chroma for both endpoints.
+ * @param[out] samec_err The computed error for the uncorrelated endpoint line.
+ * @param rgbl_pline The endpoint line assuming RGB + lumashift data.
+ * @param[out] rgbl_err The computed error for the RGB + lumashift endpoint line.
+ * @param l_pline The endpoint line assuming luminance data.
+ * @param[out] l_err The computed error for the luminance endpoint line.
+ * @param[out] a_drop_err The computed error for dropping the alpha component.
+ */
+static void compute_error_squared_rgb_single_partition(
+ const partition_info& pi,
+ int partition_index,
+ const image_block& blk,
+ const processed_line3& uncor_pline,
+ float& uncor_err,
+ const processed_line3& samec_pline,
+ float& samec_err,
+ const processed_line3& rgbl_pline,
+ float& rgbl_err,
+ const processed_line3& l_pline,
+ float& l_err,
+ float& a_drop_err
+) {
+ vfloat4 ews = blk.channel_weight;
+
+ unsigned int texel_count = pi.partition_texel_count[partition_index];
+ const uint8_t* texel_indexes = pi.texels_of_partition[partition_index];
+ promise(texel_count > 0);
+
+ vfloatacc a_drop_errv = vfloatacc::zero();
+ vfloat default_a(blk.get_default_alpha());
+
+ vfloatacc uncor_errv = vfloatacc::zero();
+ vfloat uncor_bs0(uncor_pline.bs.lane<0>());
+ vfloat uncor_bs1(uncor_pline.bs.lane<1>());
+ vfloat uncor_bs2(uncor_pline.bs.lane<2>());
+
+ vfloat uncor_amod0(uncor_pline.amod.lane<0>());
+ vfloat uncor_amod1(uncor_pline.amod.lane<1>());
+ vfloat uncor_amod2(uncor_pline.amod.lane<2>());
+
+ vfloatacc samec_errv = vfloatacc::zero();
+ vfloat samec_bs0(samec_pline.bs.lane<0>());
+ vfloat samec_bs1(samec_pline.bs.lane<1>());
+ vfloat samec_bs2(samec_pline.bs.lane<2>());
+
+ vfloatacc rgbl_errv = vfloatacc::zero();
+ vfloat rgbl_bs0(rgbl_pline.bs.lane<0>());
+ vfloat rgbl_bs1(rgbl_pline.bs.lane<1>());
+ vfloat rgbl_bs2(rgbl_pline.bs.lane<2>());
+
+ vfloat rgbl_amod0(rgbl_pline.amod.lane<0>());
+ vfloat rgbl_amod1(rgbl_pline.amod.lane<1>());
+ vfloat rgbl_amod2(rgbl_pline.amod.lane<2>());
+
+ vfloatacc l_errv = vfloatacc::zero();
+ vfloat l_bs0(l_pline.bs.lane<0>());
+ vfloat l_bs1(l_pline.bs.lane<1>());
+ vfloat l_bs2(l_pline.bs.lane<2>());
+
+ vint lane_ids = vint::lane_id();
+ for (unsigned int i = 0; i < texel_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ vint tix(texel_indexes + i);
+
+ vmask mask = lane_ids < vint(texel_count);
+ lane_ids += vint(ASTCENC_SIMD_WIDTH);
+
+ // Compute the error that arises from just ditching alpha
+ vfloat data_a = gatherf(blk.data_a, tix);
+ vfloat alpha_diff = data_a - default_a;
+ alpha_diff = alpha_diff * alpha_diff;
+
+ haccumulate(a_drop_errv, alpha_diff, mask);
+
+ vfloat data_r = gatherf(blk.data_r, tix);
+ vfloat data_g = gatherf(blk.data_g, tix);
+ vfloat data_b = gatherf(blk.data_b, tix);
+
+ // Compute uncorrelated error
+ vfloat param = data_r * uncor_bs0
+ + data_g * uncor_bs1
+ + data_b * uncor_bs2;
+
+ vfloat dist0 = (uncor_amod0 + param * uncor_bs0) - data_r;
+ vfloat dist1 = (uncor_amod1 + param * uncor_bs1) - data_g;
+ vfloat dist2 = (uncor_amod2 + param * uncor_bs2) - data_b;
+
+ vfloat error = dist0 * dist0 * ews.lane<0>()
+ + dist1 * dist1 * ews.lane<1>()
+ + dist2 * dist2 * ews.lane<2>();
+
+ haccumulate(uncor_errv, error, mask);
+
+ // Compute same chroma error - no "amod", its always zero
+ param = data_r * samec_bs0
+ + data_g * samec_bs1
+ + data_b * samec_bs2;
+
+ dist0 = (param * samec_bs0) - data_r;
+ dist1 = (param * samec_bs1) - data_g;
+ dist2 = (param * samec_bs2) - data_b;
+
+ error = dist0 * dist0 * ews.lane<0>()
+ + dist1 * dist1 * ews.lane<1>()
+ + dist2 * dist2 * ews.lane<2>();
+
+ haccumulate(samec_errv, error, mask);
+
+ // Compute rgbl error
+ param = data_r * rgbl_bs0
+ + data_g * rgbl_bs1
+ + data_b * rgbl_bs2;
+
+ dist0 = (rgbl_amod0 + param * rgbl_bs0) - data_r;
+ dist1 = (rgbl_amod1 + param * rgbl_bs1) - data_g;
+ dist2 = (rgbl_amod2 + param * rgbl_bs2) - data_b;
+
+ error = dist0 * dist0 * ews.lane<0>()
+ + dist1 * dist1 * ews.lane<1>()
+ + dist2 * dist2 * ews.lane<2>();
+
+ haccumulate(rgbl_errv, error, mask);
+
+ // Compute luma error - no "amod", its always zero
+ param = data_r * l_bs0
+ + data_g * l_bs1
+ + data_b * l_bs2;
+
+ dist0 = (param * l_bs0) - data_r;
+ dist1 = (param * l_bs1) - data_g;
+ dist2 = (param * l_bs2) - data_b;
+
+ error = dist0 * dist0 * ews.lane<0>()
+ + dist1 * dist1 * ews.lane<1>()
+ + dist2 * dist2 * ews.lane<2>();
+
+ haccumulate(l_errv, error, mask);
+ }
+
+ a_drop_err = hadd_s(a_drop_errv) * ews.lane<3>();
+ uncor_err = hadd_s(uncor_errv);
+ samec_err = hadd_s(samec_errv);
+ rgbl_err = hadd_s(rgbl_errv);
+ l_err = hadd_s(l_errv);
+}
+
+/**
+ * @brief For a given set of input colors and partitioning determine endpoint encode errors.
+ *
+ * This function determines the color error that results from RGB-scale encoding (LDR only),
+ * RGB-lumashift encoding (HDR only), luminance-encoding, and alpha drop. Also determines whether
+ * the endpoints are eligible for offset encoding or blue-contraction
+ *
+ * @param blk The image block.
+ * @param pi The partition info data.
+ * @param ep The idealized endpoints.
+ * @param[out] eci The resulting encoding choice error metrics.
+ */
+static void compute_encoding_choice_errors(
+ const image_block& blk,
+ const partition_info& pi,
+ const endpoints& ep,
+ encoding_choice_errors eci[BLOCK_MAX_PARTITIONS])
+{
+ int partition_count = pi.partition_count;
+ promise(partition_count > 0);
+
+ partition_metrics pms[BLOCK_MAX_PARTITIONS];
+
+ compute_avgs_and_dirs_3_comp_rgb(pi, blk, pms);
+
+ for (int i = 0; i < partition_count; i++)
+ {
+ partition_metrics& pm = pms[i];
+
+ line3 uncor_rgb_lines;
+ line3 samec_rgb_lines; // for LDR-RGB-scale
+ line3 rgb_luma_lines; // for HDR-RGB-scale
+
+ processed_line3 uncor_rgb_plines;
+ processed_line3 samec_rgb_plines;
+ processed_line3 rgb_luma_plines;
+ processed_line3 luminance_plines;
+
+ float uncorr_rgb_error;
+ float samechroma_rgb_error;
+ float rgb_luma_error;
+ float luminance_rgb_error;
+ float alpha_drop_error;
+
+ uncor_rgb_lines.a = pm.avg;
+ uncor_rgb_lines.b = normalize_safe(pm.dir, unit3());
+
+ samec_rgb_lines.a = vfloat4::zero();
+ samec_rgb_lines.b = normalize_safe(pm.avg, unit3());
+
+ rgb_luma_lines.a = pm.avg;
+ rgb_luma_lines.b = unit3();
+
+ uncor_rgb_plines.amod = uncor_rgb_lines.a - uncor_rgb_lines.b * dot3(uncor_rgb_lines.a, uncor_rgb_lines.b);
+ uncor_rgb_plines.bs = uncor_rgb_lines.b;
+
+ // Same chroma always goes though zero, so this is simpler than the others
+ samec_rgb_plines.amod = vfloat4::zero();
+ samec_rgb_plines.bs = samec_rgb_lines.b;
+
+ rgb_luma_plines.amod = rgb_luma_lines.a - rgb_luma_lines.b * dot3(rgb_luma_lines.a, rgb_luma_lines.b);
+ rgb_luma_plines.bs = rgb_luma_lines.b;
+
+ // Luminance always goes though zero, so this is simpler than the others
+ luminance_plines.amod = vfloat4::zero();
+ luminance_plines.bs = unit3();
+
+ compute_error_squared_rgb_single_partition(
+ pi, i, blk,
+ uncor_rgb_plines, uncorr_rgb_error,
+ samec_rgb_plines, samechroma_rgb_error,
+ rgb_luma_plines, rgb_luma_error,
+ luminance_plines, luminance_rgb_error,
+ alpha_drop_error);
+
+ // Determine if we can offset encode RGB lanes
+ vfloat4 endpt0 = ep.endpt0[i];
+ vfloat4 endpt1 = ep.endpt1[i];
+ vfloat4 endpt_diff = abs(endpt1 - endpt0);
+ vmask4 endpt_can_offset = endpt_diff < vfloat4(0.12f * 65535.0f);
+ bool can_offset_encode = (mask(endpt_can_offset) & 0x7) == 0x7;
+
+ // Store out the settings
+ eci[i].rgb_scale_error = (samechroma_rgb_error - uncorr_rgb_error) * 0.7f; // empirical
+ eci[i].rgb_luma_error = (rgb_luma_error - uncorr_rgb_error) * 1.5f; // wild guess
+ eci[i].luminance_error = (luminance_rgb_error - uncorr_rgb_error) * 3.0f; // empirical
+ eci[i].alpha_drop_error = alpha_drop_error * 3.0f;
+ eci[i].can_offset_encode = can_offset_encode;
+ eci[i].can_blue_contract = !blk.is_luminance();
+ }
+}
+
+/**
+ * @brief For a given partition compute the error for every endpoint integer count and quant level.
+ *
+ * @param encode_hdr_rgb @c true if using HDR for RGB, @c false for LDR.
+ * @param encode_hdr_alpha @c true if using HDR for alpha, @c false for LDR.
+ * @param partition_index The partition index.
+ * @param pi The partition info.
+ * @param eci The encoding choice error metrics.
+ * @param ep The idealized endpoints.
+ * @param error_weight The resulting encoding choice error metrics.
+ * @param[out] best_error The best error for each integer count and quant level.
+ * @param[out] format_of_choice The preferred endpoint format for each integer count and quant level.
+ */
+static void compute_color_error_for_every_integer_count_and_quant_level(
+ bool encode_hdr_rgb,
+ bool encode_hdr_alpha,
+ int partition_index,
+ const partition_info& pi,
+ const encoding_choice_errors& eci,
+ const endpoints& ep,
+ vfloat4 error_weight,
+ float best_error[21][4],
+ uint8_t format_of_choice[21][4]
+) {
+ int partition_size = pi.partition_texel_count[partition_index];
+
+ static const float baseline_quant_error[21] {
+ (65536.0f * 65536.0f / 18.0f), // 2 values, 1 step
+ (65536.0f * 65536.0f / 18.0f) / (2 * 2), // 3 values, 2 steps
+ (65536.0f * 65536.0f / 18.0f) / (3 * 3), // 4 values, 3 steps
+ (65536.0f * 65536.0f / 18.0f) / (4 * 4), // 5 values
+ (65536.0f * 65536.0f / 18.0f) / (5 * 5),
+ (65536.0f * 65536.0f / 18.0f) / (7 * 7),
+ (65536.0f * 65536.0f / 18.0f) / (9 * 9),
+ (65536.0f * 65536.0f / 18.0f) / (11 * 11),
+ (65536.0f * 65536.0f / 18.0f) / (15 * 15),
+ (65536.0f * 65536.0f / 18.0f) / (19 * 19),
+ (65536.0f * 65536.0f / 18.0f) / (23 * 23),
+ (65536.0f * 65536.0f / 18.0f) / (31 * 31),
+ (65536.0f * 65536.0f / 18.0f) / (39 * 39),
+ (65536.0f * 65536.0f / 18.0f) / (47 * 47),
+ (65536.0f * 65536.0f / 18.0f) / (63 * 63),
+ (65536.0f * 65536.0f / 18.0f) / (79 * 79),
+ (65536.0f * 65536.0f / 18.0f) / (95 * 95),
+ (65536.0f * 65536.0f / 18.0f) / (127 * 127),
+ (65536.0f * 65536.0f / 18.0f) / (159 * 159),
+ (65536.0f * 65536.0f / 18.0f) / (191 * 191),
+ (65536.0f * 65536.0f / 18.0f) / (255 * 255)
+ };
+
+ vfloat4 ep0 = ep.endpt0[partition_index];
+ vfloat4 ep1 = ep.endpt1[partition_index];
+
+ float ep1_min = hmin_rgb_s(ep1);
+ ep1_min = astc::max(ep1_min, 0.0f);
+
+ float error_weight_rgbsum = hadd_rgb_s(error_weight);
+
+ float range_upper_limit_rgb = encode_hdr_rgb ? 61440.0f : 65535.0f;
+ float range_upper_limit_alpha = encode_hdr_alpha ? 61440.0f : 65535.0f;
+
+ // It is possible to get endpoint colors significantly outside [0,upper-limit] even if the
+ // input data are safely contained in [0,upper-limit]; we need to add an error term for this
+ vfloat4 offset(range_upper_limit_rgb, range_upper_limit_rgb, range_upper_limit_rgb, range_upper_limit_alpha);
+ vfloat4 ep0_range_error_high = max(ep0 - offset, 0.0f);
+ vfloat4 ep1_range_error_high = max(ep1 - offset, 0.0f);
+
+ vfloat4 ep0_range_error_low = min(ep0, 0.0f);
+ vfloat4 ep1_range_error_low = min(ep1, 0.0f);
+
+ vfloat4 sum_range_error =
+ (ep0_range_error_low * ep0_range_error_low) +
+ (ep1_range_error_low * ep1_range_error_low) +
+ (ep0_range_error_high * ep0_range_error_high) +
+ (ep1_range_error_high * ep1_range_error_high);
+
+ float rgb_range_error = dot3_s(sum_range_error, error_weight)
+ * 0.5f * static_cast<float>(partition_size);
+ float alpha_range_error = sum_range_error.lane<3>() * error_weight.lane<3>()
+ * 0.5f * static_cast<float>(partition_size);
+
+ if (encode_hdr_rgb)
+ {
+
+ // Collect some statistics
+ float af, cf;
+ if (ep1.lane<0>() > ep1.lane<1>() && ep1.lane<0>() > ep1.lane<2>())
+ {
+ af = ep1.lane<0>();
+ cf = ep1.lane<0>() - ep0.lane<0>();
+ }
+ else if (ep1.lane<1>() > ep1.lane<2>())
+ {
+ af = ep1.lane<1>();
+ cf = ep1.lane<1>() - ep0.lane<1>();
+ }
+ else
+ {
+ af = ep1.lane<2>();
+ cf = ep1.lane<2>() - ep0.lane<2>();
+ }
+
+ // Estimate of color-component spread in high endpoint color
+ float bf = af - ep1_min;
+ vfloat4 prd = (ep1 - vfloat4(cf)).swz<0, 1, 2>();
+ vfloat4 pdif = prd - ep0.swz<0, 1, 2>();
+ // Estimate of color-component spread in low endpoint color
+ float df = hmax_s(abs(pdif));
+
+ int b = static_cast<int>(bf);
+ int c = static_cast<int>(cf);
+ int d = static_cast<int>(df);
+
+ // Determine which one of the 6 submodes is likely to be used in case of an RGBO-mode
+ int rgbo_mode = 5; // 7 bits per component
+ // mode 4: 8 7 6
+ if (b < 32768 && c < 16384)
+ {
+ rgbo_mode = 4;
+ }
+
+ // mode 3: 9 6 7
+ if (b < 8192 && c < 16384)
+ {
+ rgbo_mode = 3;
+ }
+
+ // mode 2: 10 5 8
+ if (b < 2048 && c < 16384)
+ {
+ rgbo_mode = 2;
+ }
+
+ // mode 1: 11 6 5
+ if (b < 2048 && c < 1024)
+ {
+ rgbo_mode = 1;
+ }
+
+ // mode 0: 11 5 7
+ if (b < 1024 && c < 4096)
+ {
+ rgbo_mode = 0;
+ }
+
+ // Determine which one of the 9 submodes is likely to be used in case of an RGB-mode.
+ int rgb_mode = 8; // 8 bits per component, except 7 bits for blue
+
+ // mode 0: 9 7 6 7
+ if (b < 16384 && c < 8192 && d < 8192)
+ {
+ rgb_mode = 0;
+ }
+
+ // mode 1: 9 8 6 6
+ if (b < 32768 && c < 8192 && d < 4096)
+ {
+ rgb_mode = 1;
+ }
+
+ // mode 2: 10 6 7 7
+ if (b < 4096 && c < 8192 && d < 4096)
+ {
+ rgb_mode = 2;
+ }
+
+ // mode 3: 10 7 7 6
+ if (b < 8192 && c < 8192 && d < 2048)
+ {
+ rgb_mode = 3;
+ }
+
+ // mode 4: 11 8 6 5
+ if (b < 8192 && c < 2048 && d < 512)
+ {
+ rgb_mode = 4;
+ }
+
+ // mode 5: 11 6 8 6
+ if (b < 2048 && c < 8192 && d < 1024)
+ {
+ rgb_mode = 5;
+ }
+
+ // mode 6: 12 7 7 5
+ if (b < 2048 && c < 2048 && d < 256)
+ {
+ rgb_mode = 6;
+ }
+
+ // mode 7: 12 6 7 6
+ if (b < 1024 && c < 2048 && d < 512)
+ {
+ rgb_mode = 7;
+ }
+
+ static const float rgbo_error_scales[6] { 4.0f, 4.0f, 16.0f, 64.0f, 256.0f, 1024.0f };
+ static const float rgb_error_scales[9] { 64.0f, 64.0f, 16.0f, 16.0f, 4.0f, 4.0f, 1.0f, 1.0f, 384.0f };
+
+ float mode7mult = rgbo_error_scales[rgbo_mode] * 0.0015f; // Empirically determined ....
+ float mode11mult = rgb_error_scales[rgb_mode] * 0.010f; // Empirically determined ....
+
+
+ float lum_high = hadd_rgb_s(ep1) * (1.0f / 3.0f);
+ float lum_low = hadd_rgb_s(ep0) * (1.0f / 3.0f);
+ float lumdif = lum_high - lum_low;
+ float mode23mult = lumdif < 960 ? 4.0f : lumdif < 3968 ? 16.0f : 128.0f;
+
+ mode23mult *= 0.0005f; // Empirically determined ....
+
+ // Pick among the available HDR endpoint modes
+ for (int i = QUANT_2; i < QUANT_16; i++)
+ {
+ best_error[i][3] = ERROR_CALC_DEFAULT;
+ best_error[i][2] = ERROR_CALC_DEFAULT;
+ best_error[i][1] = ERROR_CALC_DEFAULT;
+ best_error[i][0] = ERROR_CALC_DEFAULT;
+
+ format_of_choice[i][3] = static_cast<uint8_t>(encode_hdr_alpha ? FMT_HDR_RGBA : FMT_HDR_RGB_LDR_ALPHA);
+ format_of_choice[i][2] = FMT_HDR_RGB;
+ format_of_choice[i][1] = FMT_HDR_RGB_SCALE;
+ format_of_choice[i][0] = FMT_HDR_LUMINANCE_LARGE_RANGE;
+ }
+
+ for (int i = QUANT_16; i <= QUANT_256; i++)
+ {
+ // The base_quant_error should depend on the scale-factor that would be used during
+ // actual encode of the color value
+
+ float base_quant_error = baseline_quant_error[i] * static_cast<float>(partition_size);
+ float rgb_quantization_error = error_weight_rgbsum * base_quant_error * 2.0f;
+ float alpha_quantization_error = error_weight.lane<3>() * base_quant_error * 2.0f;
+ float rgba_quantization_error = rgb_quantization_error + alpha_quantization_error;
+
+ // For 8 integers, we have two encodings: one with HDR A and another one with LDR A
+
+ float full_hdr_rgba_error = rgba_quantization_error + rgb_range_error + alpha_range_error;
+ best_error[i][3] = full_hdr_rgba_error;
+ format_of_choice[i][3] = static_cast<uint8_t>(encode_hdr_alpha ? FMT_HDR_RGBA : FMT_HDR_RGB_LDR_ALPHA);
+
+ // For 6 integers, we have one HDR-RGB encoding
+ float full_hdr_rgb_error = (rgb_quantization_error * mode11mult) + rgb_range_error + eci.alpha_drop_error;
+ best_error[i][2] = full_hdr_rgb_error;
+ format_of_choice[i][2] = FMT_HDR_RGB;
+
+ // For 4 integers, we have one HDR-RGB-Scale encoding
+ float hdr_rgb_scale_error = (rgb_quantization_error * mode7mult) + rgb_range_error + eci.alpha_drop_error + eci.rgb_luma_error;
+
+ best_error[i][1] = hdr_rgb_scale_error;
+ format_of_choice[i][1] = FMT_HDR_RGB_SCALE;
+
+ // For 2 integers, we assume luminance-with-large-range
+ float hdr_luminance_error = (rgb_quantization_error * mode23mult) + rgb_range_error + eci.alpha_drop_error + eci.luminance_error;
+ best_error[i][0] = hdr_luminance_error;
+ format_of_choice[i][0] = FMT_HDR_LUMINANCE_LARGE_RANGE;
+ }
+ }
+ else
+ {
+ for (int i = QUANT_2; i < QUANT_6; i++)
+ {
+ best_error[i][3] = ERROR_CALC_DEFAULT;
+ best_error[i][2] = ERROR_CALC_DEFAULT;
+ best_error[i][1] = ERROR_CALC_DEFAULT;
+ best_error[i][0] = ERROR_CALC_DEFAULT;
+
+ format_of_choice[i][3] = FMT_RGBA;
+ format_of_choice[i][2] = FMT_RGB;
+ format_of_choice[i][1] = FMT_RGB_SCALE;
+ format_of_choice[i][0] = FMT_LUMINANCE;
+ }
+
+ float base_quant_error_rgb = error_weight_rgbsum * static_cast<float>(partition_size);
+ float base_quant_error_a = error_weight.lane<3>() * static_cast<float>(partition_size);
+ float base_quant_error_rgba = base_quant_error_rgb + base_quant_error_a;
+
+ float error_scale_bc_rgba = eci.can_blue_contract ? 0.625f : 1.0f;
+ float error_scale_oe_rgba = eci.can_offset_encode ? 0.5f : 1.0f;
+
+ float error_scale_bc_rgb = eci.can_blue_contract ? 0.5f : 1.0f;
+ float error_scale_oe_rgb = eci.can_offset_encode ? 0.25f : 1.0f;
+
+ // Pick among the available LDR endpoint modes
+ for (int i = QUANT_6; i <= QUANT_256; i++)
+ {
+ // Offset encoding not possible at higher quant levels
+ if (i >= QUANT_192)
+ {
+ error_scale_oe_rgba = 1.0f;
+ error_scale_oe_rgb = 1.0f;
+ }
+
+ float base_quant_error = baseline_quant_error[i];
+ float quant_error_rgb = base_quant_error_rgb * base_quant_error;
+ float quant_error_rgba = base_quant_error_rgba * base_quant_error;
+
+ // 8 integers can encode as RGBA+RGBA
+ float full_ldr_rgba_error = quant_error_rgba
+ * error_scale_bc_rgba
+ * error_scale_oe_rgba
+ + rgb_range_error
+ + alpha_range_error;
+
+ best_error[i][3] = full_ldr_rgba_error;
+ format_of_choice[i][3] = FMT_RGBA;
+
+ // 6 integers can encode as RGB+RGB or RGBS+AA
+ float full_ldr_rgb_error = quant_error_rgb
+ * error_scale_bc_rgb
+ * error_scale_oe_rgb
+ + rgb_range_error
+ + eci.alpha_drop_error;
+
+ float rgbs_alpha_error = quant_error_rgba
+ + eci.rgb_scale_error
+ + rgb_range_error
+ + alpha_range_error;
+
+ if (rgbs_alpha_error < full_ldr_rgb_error)
+ {
+ best_error[i][2] = rgbs_alpha_error;
+ format_of_choice[i][2] = FMT_RGB_SCALE_ALPHA;
+ }
+ else
+ {
+ best_error[i][2] = full_ldr_rgb_error;
+ format_of_choice[i][2] = FMT_RGB;
+ }
+
+ // 4 integers can encode as RGBS or LA+LA
+ float ldr_rgbs_error = quant_error_rgb
+ + rgb_range_error
+ + eci.alpha_drop_error
+ + eci.rgb_scale_error;
+
+ float lum_alpha_error = quant_error_rgba
+ + rgb_range_error
+ + alpha_range_error
+ + eci.luminance_error;
+
+ if (ldr_rgbs_error < lum_alpha_error)
+ {
+ best_error[i][1] = ldr_rgbs_error;
+ format_of_choice[i][1] = FMT_RGB_SCALE;
+ }
+ else
+ {
+ best_error[i][1] = lum_alpha_error;
+ format_of_choice[i][1] = FMT_LUMINANCE_ALPHA;
+ }
+
+ // 2 integers can encode as L+L
+ float luminance_error = quant_error_rgb
+ + rgb_range_error
+ + eci.alpha_drop_error
+ + eci.luminance_error;
+
+ best_error[i][0] = luminance_error;
+ format_of_choice[i][0] = FMT_LUMINANCE;
+ }
+ }
+}
+
+/**
+ * @brief For one partition compute the best format and quantization for a given bit count.
+ *
+ * @param best_combined_error The best error for each quant level and integer count.
+ * @param best_combined_format The best format for each quant level and integer count.
+ * @param bits_available The number of bits available for encoding.
+ * @param[out] best_quant_level The output best color quant level.
+ * @param[out] best_format The output best color format.
+ *
+ * @return The output error for the best pairing.
+ */
+static float one_partition_find_best_combination_for_bitcount(
+ const float best_combined_error[21][4],
+ const uint8_t best_combined_format[21][4],
+ int bits_available,
+ uint8_t& best_quant_level,
+ uint8_t& best_format
+) {
+ int best_integer_count = 0;
+ float best_integer_count_error = ERROR_CALC_DEFAULT;
+
+ for (int integer_count = 1; integer_count <= 4; integer_count++)
+ {
+ // Compute the quantization level for a given number of integers and a given number of bits
+ int quant_level = quant_mode_table[integer_count][bits_available];
+
+ // Don't have enough bits to represent a given endpoint format at all!
+ if (quant_level < QUANT_6)
+ {
+ continue;
+ }
+
+ float integer_count_error = best_combined_error[quant_level][integer_count - 1];
+ if (integer_count_error < best_integer_count_error)
+ {
+ best_integer_count_error = integer_count_error;
+ best_integer_count = integer_count - 1;
+ }
+ }
+
+ int ql = quant_mode_table[best_integer_count + 1][bits_available];
+
+ best_quant_level = static_cast<uint8_t>(ql);
+ best_format = FMT_LUMINANCE;
+
+ if (ql >= QUANT_6)
+ {
+ best_format = best_combined_format[ql][best_integer_count];
+ }
+
+ return best_integer_count_error;
+}
+
+/**
+ * @brief For 2 partitions compute the best format combinations for every pair of quant mode and integer count.
+ *
+ * @param best_error The best error for a single endpoint quant level and integer count.
+ * @param best_format The best format for a single endpoint quant level and integer count.
+ * @param[out] best_combined_error The best combined error pairings for the 2 partitions.
+ * @param[out] best_combined_format The best combined format pairings for the 2 partitions.
+ */
+static void two_partitions_find_best_combination_for_every_quantization_and_integer_count(
+ const float best_error[2][21][4], // indexed by (partition, quant-level, integer-pair-count-minus-1)
+ const uint8_t best_format[2][21][4],
+ float best_combined_error[21][7], // indexed by (quant-level, integer-pair-count-minus-2)
+ uint8_t best_combined_format[21][7][2]
+) {
+ for (int i = QUANT_2; i <= QUANT_256; i++)
+ {
+ for (int j = 0; j < 7; j++)
+ {
+ best_combined_error[i][j] = ERROR_CALC_DEFAULT;
+ }
+ }
+
+ for (int quant = QUANT_6; quant <= QUANT_256; quant++)
+ {
+ for (int i = 0; i < 4; i++) // integer-count for first endpoint-pair
+ {
+ for (int j = 0; j < 4; j++) // integer-count for second endpoint-pair
+ {
+ int low2 = astc::min(i, j);
+ int high2 = astc::max(i, j);
+ if ((high2 - low2) > 1)
+ {
+ continue;
+ }
+
+ int intcnt = i + j;
+ float errorterm = astc::min(best_error[0][quant][i] + best_error[1][quant][j], 1e10f);
+ if (errorterm <= best_combined_error[quant][intcnt])
+ {
+ best_combined_error[quant][intcnt] = errorterm;
+ best_combined_format[quant][intcnt][0] = best_format[0][quant][i];
+ best_combined_format[quant][intcnt][1] = best_format[1][quant][j];
+ }
+ }
+ }
+ }
+}
+
+/**
+ * @brief For 2 partitions compute the best format and quantization for a given bit count.
+ *
+ * @param best_combined_error The best error for each quant level and integer count.
+ * @param best_combined_format The best format for each quant level and integer count.
+ * @param bits_available The number of bits available for encoding.
+ * @param[out] best_quant_level The output best color quant level.
+ * @param[out] best_quant_level_mod The output best color quant level assuming two more bits are available.
+ * @param[out] best_formats The output best color formats.
+ *
+ * @return The output error for the best pairing.
+ */
+static float two_partitions_find_best_combination_for_bitcount(
+ float best_combined_error[21][7],
+ uint8_t best_combined_format[21][7][2],
+ int bits_available,
+ uint8_t& best_quant_level,
+ uint8_t& best_quant_level_mod,
+ uint8_t* best_formats
+) {
+ int best_integer_count = 0;
+ float best_integer_count_error = ERROR_CALC_DEFAULT;
+
+ for (int integer_count = 2; integer_count <= 8; integer_count++)
+ {
+ // Compute the quantization level for a given number of integers and a given number of bits
+ int quant_level = quant_mode_table[integer_count][bits_available];
+
+ // Don't have enough bits to represent a given endpoint format at all!
+ if (quant_level < QUANT_6)
+ {
+ break;
+ }
+
+ float integer_count_error = best_combined_error[quant_level][integer_count - 2];
+ if (integer_count_error < best_integer_count_error)
+ {
+ best_integer_count_error = integer_count_error;
+ best_integer_count = integer_count;
+ }
+ }
+
+ int ql = quant_mode_table[best_integer_count][bits_available];
+ int ql_mod = quant_mode_table[best_integer_count][bits_available + 2];
+
+ best_quant_level = static_cast<uint8_t>(ql);
+ best_quant_level_mod = static_cast<uint8_t>(ql_mod);
+
+ if (ql >= QUANT_6)
+ {
+ for (int i = 0; i < 2; i++)
+ {
+ best_formats[i] = best_combined_format[ql][best_integer_count - 2][i];
+ }
+ }
+ else
+ {
+ for (int i = 0; i < 2; i++)
+ {
+ best_formats[i] = FMT_LUMINANCE;
+ }
+ }
+
+ return best_integer_count_error;
+}
+
+/**
+ * @brief For 3 partitions compute the best format combinations for every pair of quant mode and integer count.
+ *
+ * @param best_error The best error for a single endpoint quant level and integer count.
+ * @param best_format The best format for a single endpoint quant level and integer count.
+ * @param[out] best_combined_error The best combined error pairings for the 3 partitions.
+ * @param[out] best_combined_format The best combined format pairings for the 3 partitions.
+ */
+static void three_partitions_find_best_combination_for_every_quantization_and_integer_count(
+ const float best_error[3][21][4], // indexed by (partition, quant-level, integer-count)
+ const uint8_t best_format[3][21][4],
+ float best_combined_error[21][10],
+ uint8_t best_combined_format[21][10][3]
+) {
+ for (int i = QUANT_2; i <= QUANT_256; i++)
+ {
+ for (int j = 0; j < 10; j++)
+ {
+ best_combined_error[i][j] = ERROR_CALC_DEFAULT;
+ }
+ }
+
+ for (int quant = QUANT_6; quant <= QUANT_256; quant++)
+ {
+ for (int i = 0; i < 4; i++) // integer-count for first endpoint-pair
+ {
+ for (int j = 0; j < 4; j++) // integer-count for second endpoint-pair
+ {
+ int low2 = astc::min(i, j);
+ int high2 = astc::max(i, j);
+ if ((high2 - low2) > 1)
+ {
+ continue;
+ }
+
+ for (int k = 0; k < 4; k++) // integer-count for third endpoint-pair
+ {
+ int low3 = astc::min(k, low2);
+ int high3 = astc::max(k, high2);
+ if ((high3 - low3) > 1)
+ {
+ continue;
+ }
+
+ int intcnt = i + j + k;
+ float errorterm = astc::min(best_error[0][quant][i] + best_error[1][quant][j] + best_error[2][quant][k], 1e10f);
+ if (errorterm <= best_combined_error[quant][intcnt])
+ {
+ best_combined_error[quant][intcnt] = errorterm;
+ best_combined_format[quant][intcnt][0] = best_format[0][quant][i];
+ best_combined_format[quant][intcnt][1] = best_format[1][quant][j];
+ best_combined_format[quant][intcnt][2] = best_format[2][quant][k];
+ }
+ }
+ }
+ }
+ }
+}
+
+/**
+ * @brief For 3 partitions compute the best format and quantization for a given bit count.
+ *
+ * @param best_combined_error The best error for each quant level and integer count.
+ * @param best_combined_format The best format for each quant level and integer count.
+ * @param bits_available The number of bits available for encoding.
+ * @param[out] best_quant_level The output best color quant level.
+ * @param[out] best_quant_level_mod The output best color quant level assuming two more bits are available.
+ * @param[out] best_formats The output best color formats.
+ *
+ * @return The output error for the best pairing.
+ */
+static float three_partitions_find_best_combination_for_bitcount(
+ const float best_combined_error[21][10],
+ const uint8_t best_combined_format[21][10][3],
+ int bits_available,
+ uint8_t& best_quant_level,
+ uint8_t& best_quant_level_mod,
+ uint8_t* best_formats
+) {
+ int best_integer_count = 0;
+ float best_integer_count_error = ERROR_CALC_DEFAULT;
+
+ for (int integer_count = 3; integer_count <= 9; integer_count++)
+ {
+ // Compute the quantization level for a given number of integers and a given number of bits
+ int quant_level = quant_mode_table[integer_count][bits_available];
+
+ // Don't have enough bits to represent a given endpoint format at all!
+ if (quant_level < QUANT_6)
+ {
+ break;
+ }
+
+ float integer_count_error = best_combined_error[quant_level][integer_count - 3];
+ if (integer_count_error < best_integer_count_error)
+ {
+ best_integer_count_error = integer_count_error;
+ best_integer_count = integer_count;
+ }
+ }
+
+ int ql = quant_mode_table[best_integer_count][bits_available];
+ int ql_mod = quant_mode_table[best_integer_count][bits_available + 5];
+
+ best_quant_level = static_cast<uint8_t>(ql);
+ best_quant_level_mod = static_cast<uint8_t>(ql_mod);
+
+ if (ql >= QUANT_6)
+ {
+ for (int i = 0; i < 3; i++)
+ {
+ best_formats[i] = best_combined_format[ql][best_integer_count - 3][i];
+ }
+ }
+ else
+ {
+ for (int i = 0; i < 3; i++)
+ {
+ best_formats[i] = FMT_LUMINANCE;
+ }
+ }
+
+ return best_integer_count_error;
+}
+
+/**
+ * @brief For 4 partitions compute the best format combinations for every pair of quant mode and integer count.
+ *
+ * @param best_error The best error for a single endpoint quant level and integer count.
+ * @param best_format The best format for a single endpoint quant level and integer count.
+ * @param[out] best_combined_error The best combined error pairings for the 4 partitions.
+ * @param[out] best_combined_format The best combined format pairings for the 4 partitions.
+ */
+static void four_partitions_find_best_combination_for_every_quantization_and_integer_count(
+ const float best_error[4][21][4], // indexed by (partition, quant-level, integer-count)
+ const uint8_t best_format[4][21][4],
+ float best_combined_error[21][13],
+ uint8_t best_combined_format[21][13][4]
+) {
+ for (int i = QUANT_2; i <= QUANT_256; i++)
+ {
+ for (int j = 0; j < 13; j++)
+ {
+ best_combined_error[i][j] = ERROR_CALC_DEFAULT;
+ }
+ }
+
+ for (int quant = QUANT_6; quant <= QUANT_256; quant++)
+ {
+ for (int i = 0; i < 4; i++) // integer-count for first endpoint-pair
+ {
+ for (int j = 0; j < 4; j++) // integer-count for second endpoint-pair
+ {
+ int low2 = astc::min(i, j);
+ int high2 = astc::max(i, j);
+ if ((high2 - low2) > 1)
+ {
+ continue;
+ }
+
+ for (int k = 0; k < 4; k++) // integer-count for third endpoint-pair
+ {
+ int low3 = astc::min(k, low2);
+ int high3 = astc::max(k, high2);
+ if ((high3 - low3) > 1)
+ {
+ continue;
+ }
+
+ for (int l = 0; l < 4; l++) // integer-count for fourth endpoint-pair
+ {
+ int low4 = astc::min(l, low3);
+ int high4 = astc::max(l, high3);
+ if ((high4 - low4) > 1)
+ {
+ continue;
+ }
+
+ int intcnt = i + j + k + l;
+ float errorterm = astc::min(best_error[0][quant][i] + best_error[1][quant][j] + best_error[2][quant][k] + best_error[3][quant][l], 1e10f);
+ if (errorterm <= best_combined_error[quant][intcnt])
+ {
+ best_combined_error[quant][intcnt] = errorterm;
+ best_combined_format[quant][intcnt][0] = best_format[0][quant][i];
+ best_combined_format[quant][intcnt][1] = best_format[1][quant][j];
+ best_combined_format[quant][intcnt][2] = best_format[2][quant][k];
+ best_combined_format[quant][intcnt][3] = best_format[3][quant][l];
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+/**
+ * @brief For 4 partitions compute the best format and quantization for a given bit count.
+ *
+ * @param best_combined_error The best error for each quant level and integer count.
+ * @param best_combined_format The best format for each quant level and integer count.
+ * @param bits_available The number of bits available for encoding.
+ * @param[out] best_quant_level The output best color quant level.
+ * @param[out] best_quant_level_mod The output best color quant level assuming two more bits are available.
+ * @param[out] best_formats The output best color formats.
+ *
+ * @return best_error The output error for the best pairing.
+ */
+static float four_partitions_find_best_combination_for_bitcount(
+ const float best_combined_error[21][13],
+ const uint8_t best_combined_format[21][13][4],
+ int bits_available,
+ uint8_t& best_quant_level,
+ uint8_t& best_quant_level_mod,
+ uint8_t* best_formats
+) {
+ int best_integer_count = 0;
+ float best_integer_count_error = ERROR_CALC_DEFAULT;
+
+ for (int integer_count = 4; integer_count <= 9; integer_count++)
+ {
+ // Compute the quantization level for a given number of integers and a given number of bits
+ int quant_level = quant_mode_table[integer_count][bits_available];
+
+ // Don't have enough bits to represent a given endpoint format at all!
+ if (quant_level < QUANT_6)
+ {
+ break;
+ }
+
+ float integer_count_error = best_combined_error[quant_level][integer_count - 4];
+ if (integer_count_error < best_integer_count_error)
+ {
+ best_integer_count_error = integer_count_error;
+ best_integer_count = integer_count;
+ }
+ }
+
+ int ql = quant_mode_table[best_integer_count][bits_available];
+ int ql_mod = quant_mode_table[best_integer_count][bits_available + 8];
+
+ best_quant_level = static_cast<uint8_t>(ql);
+ best_quant_level_mod = static_cast<uint8_t>(ql_mod);
+
+ if (ql >= QUANT_6)
+ {
+ for (int i = 0; i < 4; i++)
+ {
+ best_formats[i] = best_combined_format[ql][best_integer_count - 4][i];
+ }
+ }
+ else
+ {
+ for (int i = 0; i < 4; i++)
+ {
+ best_formats[i] = FMT_LUMINANCE;
+ }
+ }
+
+ return best_integer_count_error;
+}
+
+/* See header for documentation. */
+unsigned int compute_ideal_endpoint_formats(
+ const partition_info& pi,
+ const image_block& blk,
+ const endpoints& ep,
+ // bitcounts and errors computed for the various quantization methods
+ const int8_t* qwt_bitcounts,
+ const float* qwt_errors,
+ unsigned int tune_candidate_limit,
+ unsigned int start_block_mode,
+ unsigned int end_block_mode,
+ // output data
+ uint8_t partition_format_specifiers[TUNE_MAX_TRIAL_CANDIDATES][BLOCK_MAX_PARTITIONS],
+ int block_mode[TUNE_MAX_TRIAL_CANDIDATES],
+ quant_method quant_level[TUNE_MAX_TRIAL_CANDIDATES],
+ quant_method quant_level_mod[TUNE_MAX_TRIAL_CANDIDATES],
+ compression_working_buffers& tmpbuf
+) {
+ int partition_count = pi.partition_count;
+
+ promise(partition_count > 0);
+
+ bool encode_hdr_rgb = static_cast<bool>(blk.rgb_lns[0]);
+ bool encode_hdr_alpha = static_cast<bool>(blk.alpha_lns[0]);
+
+ // Compute the errors that result from various encoding choices (such as using luminance instead
+ // of RGB, discarding Alpha, using RGB-scale in place of two separate RGB endpoints and so on)
+ encoding_choice_errors eci[BLOCK_MAX_PARTITIONS];
+ compute_encoding_choice_errors(blk, pi, ep, eci);
+
+ float best_error[BLOCK_MAX_PARTITIONS][21][4];
+ uint8_t format_of_choice[BLOCK_MAX_PARTITIONS][21][4];
+ for (int i = 0; i < partition_count; i++)
+ {
+ compute_color_error_for_every_integer_count_and_quant_level(
+ encode_hdr_rgb, encode_hdr_alpha, i,
+ pi, eci[i], ep, blk.channel_weight, best_error[i],
+ format_of_choice[i]);
+ }
+
+ float* errors_of_best_combination = tmpbuf.errors_of_best_combination;
+ uint8_t* best_quant_levels = tmpbuf.best_quant_levels;
+ uint8_t* best_quant_levels_mod = tmpbuf.best_quant_levels_mod;
+ uint8_t (&best_ep_formats)[WEIGHTS_MAX_BLOCK_MODES][BLOCK_MAX_PARTITIONS] = tmpbuf.best_ep_formats;
+
+ // Ensure that the first iteration understep contains data that will never be picked
+ unsigned int packed_start_block_mode = round_down_to_simd_multiple_vla(start_block_mode);
+ for (unsigned int i = packed_start_block_mode; i < start_block_mode; i++)
+ {
+ errors_of_best_combination[i] = ERROR_CALC_DEFAULT;
+ best_quant_levels[i] = QUANT_2;
+ best_quant_levels_mod[i] = QUANT_2;
+ }
+
+ // Ensure that last iteration overstep contains data that will never be picked
+ const unsigned int packed_end_block_mode = round_up_to_simd_multiple_vla(end_block_mode);
+ for (unsigned int i = end_block_mode; i < packed_end_block_mode; i++)
+ {
+ errors_of_best_combination[i] = ERROR_CALC_DEFAULT;
+ best_quant_levels[i] = QUANT_2;
+ best_quant_levels_mod[i] = QUANT_2;
+ }
+
+ // Track a scalar best to avoid expensive search at least once ...
+ float error_of_best_combination = ERROR_CALC_DEFAULT;
+ int index_of_best_combination = -1;
+
+ // The block contains 1 partition
+ if (partition_count == 1)
+ {
+ for (unsigned int i = start_block_mode; i < end_block_mode; i++)
+ {
+ if (qwt_errors[i] >= ERROR_CALC_DEFAULT)
+ {
+ errors_of_best_combination[i] = ERROR_CALC_DEFAULT;
+ continue;
+ }
+
+ float error_of_best = one_partition_find_best_combination_for_bitcount(
+ best_error[0], format_of_choice[0], qwt_bitcounts[i],
+ best_quant_levels[i], best_ep_formats[i][0]);
+
+ float total_error = error_of_best + qwt_errors[i];
+ errors_of_best_combination[i] = total_error;
+ best_quant_levels_mod[i] = best_quant_levels[i];
+
+ if (total_error < error_of_best_combination)
+ {
+ error_of_best_combination = total_error;
+ index_of_best_combination = i;
+ }
+ }
+ }
+ // The block contains 2 partitions
+ else if (partition_count == 2)
+ {
+ float combined_best_error[21][7];
+ uint8_t formats_of_choice[21][7][2];
+
+ two_partitions_find_best_combination_for_every_quantization_and_integer_count(
+ best_error, format_of_choice, combined_best_error, formats_of_choice);
+
+ assert(start_block_mode == 0);
+ for (unsigned int i = 0; i < end_block_mode; i++)
+ {
+ if (qwt_errors[i] >= ERROR_CALC_DEFAULT)
+ {
+ errors_of_best_combination[i] = ERROR_CALC_DEFAULT;
+ continue;
+ }
+
+ float error_of_best = two_partitions_find_best_combination_for_bitcount(
+ combined_best_error, formats_of_choice, qwt_bitcounts[i],
+ best_quant_levels[i], best_quant_levels_mod[i],
+ best_ep_formats[i]);
+
+ float total_error = error_of_best + qwt_errors[i];
+ errors_of_best_combination[i] = total_error;
+
+ if (total_error < error_of_best_combination)
+ {
+ error_of_best_combination = total_error;
+ index_of_best_combination = i;
+ }
+ }
+ }
+ // The block contains 3 partitions
+ else if (partition_count == 3)
+ {
+ float combined_best_error[21][10];
+ uint8_t formats_of_choice[21][10][3];
+
+ three_partitions_find_best_combination_for_every_quantization_and_integer_count(
+ best_error, format_of_choice, combined_best_error, formats_of_choice);
+
+ assert(start_block_mode == 0);
+ for (unsigned int i = 0; i < end_block_mode; i++)
+ {
+ if (qwt_errors[i] >= ERROR_CALC_DEFAULT)
+ {
+ errors_of_best_combination[i] = ERROR_CALC_DEFAULT;
+ continue;
+ }
+
+ float error_of_best = three_partitions_find_best_combination_for_bitcount(
+ combined_best_error, formats_of_choice, qwt_bitcounts[i],
+ best_quant_levels[i], best_quant_levels_mod[i],
+ best_ep_formats[i]);
+
+ float total_error = error_of_best + qwt_errors[i];
+ errors_of_best_combination[i] = total_error;
+
+ if (total_error < error_of_best_combination)
+ {
+ error_of_best_combination = total_error;
+ index_of_best_combination = i;
+ }
+ }
+ }
+ // The block contains 4 partitions
+ else // if (partition_count == 4)
+ {
+ assert(partition_count == 4);
+ float combined_best_error[21][13];
+ uint8_t formats_of_choice[21][13][4];
+
+ four_partitions_find_best_combination_for_every_quantization_and_integer_count(
+ best_error, format_of_choice, combined_best_error, formats_of_choice);
+
+ assert(start_block_mode == 0);
+ for (unsigned int i = 0; i < end_block_mode; i++)
+ {
+ if (qwt_errors[i] >= ERROR_CALC_DEFAULT)
+ {
+ errors_of_best_combination[i] = ERROR_CALC_DEFAULT;
+ continue;
+ }
+
+ float error_of_best = four_partitions_find_best_combination_for_bitcount(
+ combined_best_error, formats_of_choice, qwt_bitcounts[i],
+ best_quant_levels[i], best_quant_levels_mod[i],
+ best_ep_formats[i]);
+
+ float total_error = error_of_best + qwt_errors[i];
+ errors_of_best_combination[i] = total_error;
+
+ if (total_error < error_of_best_combination)
+ {
+ error_of_best_combination = total_error;
+ index_of_best_combination = i;
+ }
+ }
+ }
+
+ int best_error_weights[TUNE_MAX_TRIAL_CANDIDATES];
+
+ // Fast path the first result and avoid the list search for trial 0
+ best_error_weights[0] = index_of_best_combination;
+ if (index_of_best_combination >= 0)
+ {
+ errors_of_best_combination[index_of_best_combination] = ERROR_CALC_DEFAULT;
+ }
+
+ // Search the remaining results and pick the best candidate modes for trial 1+
+ for (unsigned int i = 1; i < tune_candidate_limit; i++)
+ {
+ vint vbest_error_index(-1);
+ vfloat vbest_ep_error(ERROR_CALC_DEFAULT);
+
+ start_block_mode = round_down_to_simd_multiple_vla(start_block_mode);
+ vint lane_ids = vint::lane_id() + vint(start_block_mode);
+ for (unsigned int j = start_block_mode; j < end_block_mode; j += ASTCENC_SIMD_WIDTH)
+ {
+ vfloat err = vfloat(errors_of_best_combination + j);
+ vmask mask = err < vbest_ep_error;
+ vbest_ep_error = select(vbest_ep_error, err, mask);
+ vbest_error_index = select(vbest_error_index, lane_ids, mask);
+ lane_ids += vint(ASTCENC_SIMD_WIDTH);
+ }
+
+ // Pick best mode from the SIMD result, using lowest matching index to ensure invariance
+ vmask lanes_min_error = vbest_ep_error == hmin(vbest_ep_error);
+ vbest_error_index = select(vint(0x7FFFFFFF), vbest_error_index, lanes_min_error);
+ vbest_error_index = hmin(vbest_error_index);
+ int best_error_index = vbest_error_index.lane<0>();
+
+ best_error_weights[i] = best_error_index;
+
+ // Max the error for this candidate so we don't pick it again
+ if (best_error_index >= 0)
+ {
+ errors_of_best_combination[best_error_index] = ERROR_CALC_DEFAULT;
+ }
+ // Early-out if no more candidates are valid
+ else
+ {
+ break;
+ }
+ }
+
+ for (unsigned int i = 0; i < tune_candidate_limit; i++)
+ {
+ if (best_error_weights[i] < 0)
+ {
+ return i;
+ }
+
+ block_mode[i] = best_error_weights[i];
+
+ quant_level[i] = static_cast<quant_method>(best_quant_levels[best_error_weights[i]]);
+ quant_level_mod[i] = static_cast<quant_method>(best_quant_levels_mod[best_error_weights[i]]);
+
+ assert(quant_level[i] >= QUANT_6 && quant_level[i] <= QUANT_256);
+ assert(quant_level_mod[i] >= QUANT_6 && quant_level_mod[i] <= QUANT_256);
+
+ for (int j = 0; j < partition_count; j++)
+ {
+ partition_format_specifiers[i][j] = best_ep_formats[best_error_weights[i]][j];
+ }
+ }
+
+ return tune_candidate_limit;
+}
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_platform_isa_detection.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_platform_isa_detection.cpp
new file mode 100644
index 00000000000..4158da31bef
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_platform_isa_detection.cpp
@@ -0,0 +1,166 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2020-2021 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Platform-specific function implementations.
+ *
+ * This module contains functions for querying the host extended ISA support.
+ */
+
+// Include before the defines below to pick up any auto-setup based on compiler
+// built-in config, if not being set explicitly by the build system
+#include "astcenc_internal.h"
+
+#if (ASTCENC_SSE > 0) || (ASTCENC_AVX > 0) || \
+ (ASTCENC_POPCNT > 0) || (ASTCENC_F16C > 0)
+
+static bool g_init { false };
+
+/** Does this CPU support SSE 4.1? Set to -1 if not yet initialized. */
+static bool g_cpu_has_sse41 { false };
+
+/** Does this CPU support AVX2? Set to -1 if not yet initialized. */
+static bool g_cpu_has_avx2 { false };
+
+/** Does this CPU support POPCNT? Set to -1 if not yet initialized. */
+static bool g_cpu_has_popcnt { false };
+
+/** Does this CPU support F16C? Set to -1 if not yet initialized. */
+static bool g_cpu_has_f16c { false };
+
+/* ============================================================================
+ Platform code for Visual Studio
+============================================================================ */
+#if !defined(__clang__) && defined(_MSC_VER)
+#define WIN32_LEAN_AND_MEAN
+#include <Windows.h>
+#include <intrin.h>
+
+/**
+ * @brief Detect platform CPU ISA support and update global trackers.
+ */
+static void detect_cpu_isa()
+{
+ int data[4];
+
+ __cpuid(data, 0);
+ int num_id = data[0];
+
+ if (num_id >= 1)
+ {
+ __cpuidex(data, 1, 0);
+ // SSE41 = Bank 1, ECX, bit 19
+ g_cpu_has_sse41 = data[2] & (1 << 19) ? true : false;
+ // POPCNT = Bank 1, ECX, bit 23
+ g_cpu_has_popcnt = data[2] & (1 << 23) ? true : false;
+ // F16C = Bank 1, ECX, bit 29
+ g_cpu_has_f16c = data[2] & (1 << 29) ? true : false;
+ }
+
+ if (num_id >= 7)
+ {
+ __cpuidex(data, 7, 0);
+ // AVX2 = Bank 7, EBX, bit 5
+ g_cpu_has_avx2 = data[1] & (1 << 5) ? true : false;
+ }
+
+ // Ensure state bits are updated before init flag is updated
+ MemoryBarrier();
+ g_init = true;
+}
+
+/* ============================================================================
+ Platform code for GCC and Clang
+============================================================================ */
+#else
+#include <cpuid.h>
+
+/**
+ * @brief Detect platform CPU ISA support and update global trackers.
+ */
+static void detect_cpu_isa()
+{
+ unsigned int data[4];
+
+ if (__get_cpuid_count(1, 0, &data[0], &data[1], &data[2], &data[3]))
+ {
+ // SSE41 = Bank 1, ECX, bit 19
+ g_cpu_has_sse41 = data[2] & (1 << 19) ? true : false;
+ // POPCNT = Bank 1, ECX, bit 23
+ g_cpu_has_popcnt = data[2] & (1 << 23) ? true : false;
+ // F16C = Bank 1, ECX, bit 29
+ g_cpu_has_f16c = data[2] & (1 << 29) ? true : false;
+ }
+
+ g_cpu_has_avx2 = 0;
+ if (__get_cpuid_count(7, 0, &data[0], &data[1], &data[2], &data[3]))
+ {
+ // AVX2 = Bank 7, EBX, bit 5
+ g_cpu_has_avx2 = data[1] & (1 << 5) ? true : false;
+ }
+
+ // Ensure state bits are updated before init flag is updated
+ __sync_synchronize();
+ g_init = true;
+}
+#endif
+
+/* See header for documentation. */
+bool cpu_supports_popcnt()
+{
+ if (!g_init)
+ {
+ detect_cpu_isa();
+ }
+
+ return g_cpu_has_popcnt;
+}
+
+/* See header for documentation. */
+bool cpu_supports_f16c()
+{
+ if (!g_init)
+ {
+ detect_cpu_isa();
+ }
+
+ return g_cpu_has_f16c;
+}
+
+/* See header for documentation. */
+bool cpu_supports_sse41()
+{
+ if (!g_init)
+ {
+ detect_cpu_isa();
+ }
+
+ return g_cpu_has_sse41;
+}
+
+/* See header for documentation. */
+bool cpu_supports_avx2()
+{
+ if (!g_init)
+ {
+ detect_cpu_isa();
+ }
+
+ return g_cpu_has_avx2;
+}
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_quantization.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_quantization.cpp
new file mode 100644
index 00000000000..478a21ead71
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_quantization.cpp
@@ -0,0 +1,904 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2021 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Functions and data tables for numeric quantization..
+ */
+
+#include "astcenc_internal.h"
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+
+// Starts from QUANT_6
+// Not scrambled
+const uint8_t color_unquant_to_uquant_tables[17][256] {
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
+ 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
+ 153, 153, 153, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
+ 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
+ 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
+ 204, 204, 204, 204, 204, 204, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+ 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, 36,
+ 36, 36, 36, 36, 36, 36, 36, 73, 73, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73,
+ 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 73, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146,
+ 146, 146, 146, 146, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
+ 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182,
+ 182, 182, 182, 182, 182, 182, 182, 182, 182, 219, 219, 219, 219, 219, 219, 219,
+ 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219,
+ 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 219, 255, 255, 255,
+ 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
+ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
+ 56, 56, 56, 56, 56, 56, 56, 84, 84, 84, 84, 84, 84, 84, 84, 84,
+ 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, 84,
+ 84, 84, 84, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
+ 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113, 113,
+ 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142,
+ 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 142, 171, 171, 171,
+ 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171,
+ 171, 171, 171, 171, 171, 171, 171, 171, 171, 199, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227,
+ 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227, 227,
+ 227, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, 23, 23, 23,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 23, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 46, 46, 46, 46, 69, 69, 69, 69, 69, 69,
+ 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
+ 69, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92,
+ 92, 92, 92, 92, 92, 92, 92, 92, 92, 116, 116, 116, 116, 116, 116, 116,
+ 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
+ 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, 139,
+ 139, 139, 139, 139, 139, 139, 139, 163, 163, 163, 163, 163, 163, 163, 163, 163,
+ 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 186,
+ 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, 186,
+ 186, 186, 186, 186, 186, 186, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209,
+ 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 209, 232, 232, 232,
+ 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232,
+ 232, 232, 232, 232, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 17, 17, 17, 17, 17, 17, 17,
+ 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 34, 34, 34, 34, 34, 34,
+ 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 51, 51, 51, 51, 51,
+ 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 68, 85, 85, 85,
+ 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, 119,
+ 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119,
+ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
+ 136, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153, 153,
+ 153, 153, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170, 170,
+ 170, 170, 170, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187, 187,
+ 187, 187, 187, 187, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204, 204,
+ 204, 204, 204, 204, 204, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221, 221,
+ 221, 221, 221, 221, 221, 221, 238, 238, 238, 238, 238, 238, 238, 238, 238, 238,
+ 238, 238, 238, 238, 238, 238, 238, 255, 255, 255, 255, 255, 255, 255, 255, 255
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 0, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40,
+ 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 54, 67, 67, 67,
+ 67, 67, 67, 67, 67, 67, 67, 67, 67, 67, 80, 80, 80, 80, 80, 80,
+ 80, 80, 80, 80, 80, 80, 80, 80, 94, 94, 94, 94, 94, 94, 94, 94,
+ 94, 94, 94, 94, 94, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107, 107,
+ 107, 107, 107, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
+ 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 148, 148, 148,
+ 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, 161, 161, 161, 161, 161,
+ 161, 161, 161, 161, 161, 161, 161, 161, 175, 175, 175, 175, 175, 175, 175, 175,
+ 175, 175, 175, 175, 175, 175, 188, 188, 188, 188, 188, 188, 188, 188, 188, 188,
+ 188, 188, 188, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, 201,
+ 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 215, 228, 228,
+ 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 228, 242, 242, 242, 242, 242,
+ 242, 242, 242, 242, 242, 242, 242, 242, 242, 255, 255, 255, 255, 255, 255, 255
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 33, 33, 33, 33,
+ 33, 33, 33, 33, 33, 33, 33, 44, 44, 44, 44, 44, 44, 44, 44, 44,
+ 44, 44, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 55, 66, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 66, 77, 77, 77, 77, 77, 77, 77, 77,
+ 77, 77, 77, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 88, 99, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 99, 110, 110, 110, 110, 110, 110, 110,
+ 110, 110, 110, 110, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121, 121,
+ 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 134, 145, 145, 145, 145,
+ 145, 145, 145, 145, 145, 145, 145, 156, 156, 156, 156, 156, 156, 156, 156, 156,
+ 156, 156, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 178, 178, 178,
+ 178, 178, 178, 178, 178, 178, 178, 178, 189, 189, 189, 189, 189, 189, 189, 189,
+ 189, 189, 189, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 200, 211, 211,
+ 211, 211, 211, 211, 211, 211, 211, 211, 211, 222, 222, 222, 222, 222, 222, 222,
+ 222, 222, 222, 222, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 233, 244,
+ 244, 244, 244, 244, 244, 244, 244, 244, 244, 244, 255, 255, 255, 255, 255, 255
+ },
+ {
+ 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16, 16,
+ 16, 16, 16, 16, 16, 24, 24, 24, 24, 24, 24, 24, 24, 33, 33, 33,
+ 33, 33, 33, 33, 33, 33, 41, 41, 41, 41, 41, 41, 41, 41, 49, 49,
+ 49, 49, 49, 49, 49, 49, 57, 57, 57, 57, 57, 57, 57, 57, 66, 66,
+ 66, 66, 66, 66, 66, 66, 66, 74, 74, 74, 74, 74, 74, 74, 74, 82,
+ 82, 82, 82, 82, 82, 82, 82, 90, 90, 90, 90, 90, 90, 90, 90, 99,
+ 99, 99, 99, 99, 99, 99, 99, 99, 107, 107, 107, 107, 107, 107, 107, 107,
+ 115, 115, 115, 115, 115, 115, 115, 115, 123, 123, 123, 123, 123, 123, 123, 123,
+ 132, 132, 132, 132, 132, 132, 132, 132, 140, 140, 140, 140, 140, 140, 140, 140,
+ 148, 148, 148, 148, 148, 148, 148, 148, 156, 156, 156, 156, 156, 156, 156, 156,
+ 156, 165, 165, 165, 165, 165, 165, 165, 165, 173, 173, 173, 173, 173, 173, 173,
+ 173, 181, 181, 181, 181, 181, 181, 181, 181, 189, 189, 189, 189, 189, 189, 189,
+ 189, 189, 198, 198, 198, 198, 198, 198, 198, 198, 206, 206, 206, 206, 206, 206,
+ 206, 206, 214, 214, 214, 214, 214, 214, 214, 214, 222, 222, 222, 222, 222, 222,
+ 222, 222, 222, 231, 231, 231, 231, 231, 231, 231, 231, 239, 239, 239, 239, 239,
+ 239, 239, 239, 247, 247, 247, 247, 247, 247, 247, 247, 255, 255, 255, 255, 255
+ },
+ {
+ 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 13, 13, 13, 13, 13, 13,
+ 13, 19, 19, 19, 19, 19, 19, 26, 26, 26, 26, 26, 26, 26, 32, 32,
+ 32, 32, 32, 32, 39, 39, 39, 39, 39, 39, 39, 45, 45, 45, 45, 45,
+ 45, 52, 52, 52, 52, 52, 52, 52, 58, 58, 58, 58, 58, 58, 65, 65,
+ 65, 65, 65, 65, 65, 71, 71, 71, 71, 71, 71, 78, 78, 78, 78, 78,
+ 78, 78, 84, 84, 84, 84, 84, 84, 91, 91, 91, 91, 91, 91, 91, 97,
+ 97, 97, 97, 97, 97, 104, 104, 104, 104, 104, 104, 104, 110, 110, 110, 110,
+ 110, 110, 117, 117, 117, 117, 117, 117, 117, 123, 123, 123, 123, 123, 123, 123,
+ 132, 132, 132, 132, 132, 132, 132, 138, 138, 138, 138, 138, 138, 138, 145, 145,
+ 145, 145, 145, 145, 151, 151, 151, 151, 151, 151, 151, 158, 158, 158, 158, 158,
+ 158, 164, 164, 164, 164, 164, 164, 164, 171, 171, 171, 171, 171, 171, 177, 177,
+ 177, 177, 177, 177, 177, 184, 184, 184, 184, 184, 184, 190, 190, 190, 190, 190,
+ 190, 190, 197, 197, 197, 197, 197, 197, 203, 203, 203, 203, 203, 203, 203, 210,
+ 210, 210, 210, 210, 210, 216, 216, 216, 216, 216, 216, 216, 223, 223, 223, 223,
+ 223, 223, 229, 229, 229, 229, 229, 229, 229, 236, 236, 236, 236, 236, 236, 242,
+ 242, 242, 242, 242, 242, 242, 249, 249, 249, 249, 249, 249, 255, 255, 255, 255
+ },
+ {
+ 0, 0, 0, 5, 5, 5, 5, 5, 5, 11, 11, 11, 11, 11, 16, 16,
+ 16, 16, 16, 21, 21, 21, 21, 21, 21, 27, 27, 27, 27, 27, 32, 32,
+ 32, 32, 32, 32, 38, 38, 38, 38, 38, 43, 43, 43, 43, 43, 48, 48,
+ 48, 48, 48, 48, 54, 54, 54, 54, 54, 59, 59, 59, 59, 59, 59, 65,
+ 65, 65, 65, 65, 70, 70, 70, 70, 70, 70, 76, 76, 76, 76, 76, 81,
+ 81, 81, 81, 81, 86, 86, 86, 86, 86, 86, 92, 92, 92, 92, 92, 97,
+ 97, 97, 97, 97, 97, 103, 103, 103, 103, 103, 108, 108, 108, 108, 108, 113,
+ 113, 113, 113, 113, 113, 119, 119, 119, 119, 119, 124, 124, 124, 124, 124, 124,
+ 131, 131, 131, 131, 131, 131, 136, 136, 136, 136, 136, 142, 142, 142, 142, 142,
+ 142, 147, 147, 147, 147, 147, 152, 152, 152, 152, 152, 158, 158, 158, 158, 158,
+ 158, 163, 163, 163, 163, 163, 169, 169, 169, 169, 169, 169, 174, 174, 174, 174,
+ 174, 179, 179, 179, 179, 179, 185, 185, 185, 185, 185, 185, 190, 190, 190, 190,
+ 190, 196, 196, 196, 196, 196, 196, 201, 201, 201, 201, 201, 207, 207, 207, 207,
+ 207, 207, 212, 212, 212, 212, 212, 217, 217, 217, 217, 217, 223, 223, 223, 223,
+ 223, 223, 228, 228, 228, 228, 228, 234, 234, 234, 234, 234, 234, 239, 239, 239,
+ 239, 239, 244, 244, 244, 244, 244, 250, 250, 250, 250, 250, 250, 255, 255, 255
+ },
+ {
+ 0, 0, 0, 4, 4, 4, 4, 8, 8, 8, 8, 12, 12, 12, 12, 16,
+ 16, 16, 16, 20, 20, 20, 20, 24, 24, 24, 24, 28, 28, 28, 28, 32,
+ 32, 32, 32, 36, 36, 36, 36, 40, 40, 40, 40, 44, 44, 44, 44, 48,
+ 48, 48, 48, 52, 52, 52, 52, 56, 56, 56, 56, 60, 60, 60, 60, 65,
+ 65, 65, 65, 65, 69, 69, 69, 69, 73, 73, 73, 73, 77, 77, 77, 77,
+ 81, 81, 81, 81, 85, 85, 85, 85, 89, 89, 89, 89, 93, 93, 93, 93,
+ 97, 97, 97, 97, 101, 101, 101, 101, 105, 105, 105, 105, 109, 109, 109, 109,
+ 113, 113, 113, 113, 117, 117, 117, 117, 121, 121, 121, 121, 125, 125, 125, 125,
+ 130, 130, 130, 130, 134, 134, 134, 134, 138, 138, 138, 138, 142, 142, 142, 142,
+ 146, 146, 146, 146, 150, 150, 150, 150, 154, 154, 154, 154, 158, 158, 158, 158,
+ 162, 162, 162, 162, 166, 166, 166, 166, 170, 170, 170, 170, 174, 174, 174, 174,
+ 178, 178, 178, 178, 182, 182, 182, 182, 186, 186, 186, 186, 190, 190, 190, 190,
+ 190, 195, 195, 195, 195, 199, 199, 199, 199, 203, 203, 203, 203, 207, 207, 207,
+ 207, 211, 211, 211, 211, 215, 215, 215, 215, 219, 219, 219, 219, 223, 223, 223,
+ 223, 227, 227, 227, 227, 231, 231, 231, 231, 235, 235, 235, 235, 239, 239, 239,
+ 239, 243, 243, 243, 243, 247, 247, 247, 247, 251, 251, 251, 251, 255, 255, 255
+ },
+ {
+ 0, 0, 3, 3, 3, 6, 6, 6, 9, 9, 9, 9, 13, 13, 13, 16,
+ 16, 16, 19, 19, 19, 22, 22, 22, 25, 25, 25, 25, 29, 29, 29, 32,
+ 32, 32, 35, 35, 35, 38, 38, 38, 38, 42, 42, 42, 45, 45, 45, 48,
+ 48, 48, 51, 51, 51, 54, 54, 54, 54, 58, 58, 58, 61, 61, 61, 64,
+ 64, 64, 67, 67, 67, 67, 71, 71, 71, 74, 74, 74, 77, 77, 77, 80,
+ 80, 80, 83, 83, 83, 83, 87, 87, 87, 90, 90, 90, 93, 93, 93, 96,
+ 96, 96, 96, 100, 100, 100, 103, 103, 103, 106, 106, 106, 109, 109, 109, 112,
+ 112, 112, 112, 116, 116, 116, 119, 119, 119, 122, 122, 122, 125, 125, 125, 125,
+ 130, 130, 130, 130, 133, 133, 133, 136, 136, 136, 139, 139, 139, 143, 143, 143,
+ 143, 146, 146, 146, 149, 149, 149, 152, 152, 152, 155, 155, 155, 159, 159, 159,
+ 159, 162, 162, 162, 165, 165, 165, 168, 168, 168, 172, 172, 172, 172, 175, 175,
+ 175, 178, 178, 178, 181, 181, 181, 184, 184, 184, 188, 188, 188, 188, 191, 191,
+ 191, 194, 194, 194, 197, 197, 197, 201, 201, 201, 201, 204, 204, 204, 207, 207,
+ 207, 210, 210, 210, 213, 213, 213, 217, 217, 217, 217, 220, 220, 220, 223, 223,
+ 223, 226, 226, 226, 230, 230, 230, 230, 233, 233, 233, 236, 236, 236, 239, 239,
+ 239, 242, 242, 242, 246, 246, 246, 246, 249, 249, 249, 252, 252, 252, 255, 255
+ },
+ {
+ 0, 0, 2, 2, 5, 5, 5, 8, 8, 8, 10, 10, 13, 13, 13, 16,
+ 16, 16, 18, 18, 21, 21, 21, 24, 24, 24, 26, 26, 29, 29, 29, 32,
+ 32, 32, 35, 35, 35, 37, 37, 40, 40, 40, 43, 43, 43, 45, 45, 48,
+ 48, 48, 51, 51, 51, 53, 53, 56, 56, 56, 59, 59, 59, 61, 61, 64,
+ 64, 64, 67, 67, 67, 70, 70, 70, 72, 72, 75, 75, 75, 78, 78, 78,
+ 80, 80, 83, 83, 83, 86, 86, 86, 88, 88, 91, 91, 91, 94, 94, 94,
+ 96, 96, 99, 99, 99, 102, 102, 102, 104, 104, 107, 107, 107, 110, 110, 110,
+ 112, 112, 115, 115, 115, 118, 118, 118, 120, 120, 123, 123, 123, 126, 126, 126,
+ 129, 129, 129, 132, 132, 132, 135, 135, 137, 137, 137, 140, 140, 140, 143, 143,
+ 145, 145, 145, 148, 148, 148, 151, 151, 153, 153, 153, 156, 156, 156, 159, 159,
+ 161, 161, 161, 164, 164, 164, 167, 167, 169, 169, 169, 172, 172, 172, 175, 175,
+ 177, 177, 177, 180, 180, 180, 183, 183, 185, 185, 185, 188, 188, 188, 191, 191,
+ 191, 194, 194, 196, 196, 196, 199, 199, 199, 202, 202, 204, 204, 204, 207, 207,
+ 207, 210, 210, 212, 212, 212, 215, 215, 215, 218, 218, 220, 220, 220, 223, 223,
+ 223, 226, 226, 226, 229, 229, 231, 231, 231, 234, 234, 234, 237, 237, 239, 239,
+ 239, 242, 242, 242, 245, 245, 247, 247, 247, 250, 250, 250, 253, 253, 255, 255
+ },
+ {
+ 0, 0, 2, 2, 4, 4, 6, 6, 8, 8, 10, 10, 12, 12, 14, 14,
+ 16, 16, 18, 18, 20, 20, 22, 22, 24, 24, 26, 26, 28, 28, 30, 30,
+ 32, 32, 34, 34, 36, 36, 38, 38, 40, 40, 42, 42, 44, 44, 46, 46,
+ 48, 48, 50, 50, 52, 52, 54, 54, 56, 56, 58, 58, 60, 60, 62, 62,
+ 64, 64, 66, 66, 68, 68, 70, 70, 72, 72, 74, 74, 76, 76, 78, 78,
+ 80, 80, 82, 82, 84, 84, 86, 86, 88, 88, 90, 90, 92, 92, 94, 94,
+ 96, 96, 98, 98, 100, 100, 102, 102, 104, 104, 106, 106, 108, 108, 110, 110,
+ 112, 112, 114, 114, 116, 116, 118, 118, 120, 120, 122, 122, 124, 124, 126, 126,
+ 129, 129, 131, 131, 133, 133, 135, 135, 137, 137, 139, 139, 141, 141, 143, 143,
+ 145, 145, 147, 147, 149, 149, 151, 151, 153, 153, 155, 155, 157, 157, 159, 159,
+ 161, 161, 163, 163, 165, 165, 167, 167, 169, 169, 171, 171, 173, 173, 175, 175,
+ 177, 177, 179, 179, 181, 181, 183, 183, 185, 185, 187, 187, 189, 189, 191, 191,
+ 193, 193, 195, 195, 197, 197, 199, 199, 201, 201, 203, 203, 205, 205, 207, 207,
+ 209, 209, 211, 211, 213, 213, 215, 215, 217, 217, 219, 219, 221, 221, 223, 223,
+ 225, 225, 227, 227, 229, 229, 231, 231, 233, 233, 235, 235, 237, 237, 239, 239,
+ 241, 241, 243, 243, 245, 245, 247, 247, 249, 249, 251, 251, 253, 253, 255, 255
+ },
+ {
+ 0, 1, 1, 3, 4, 4, 6, 6, 8, 9, 9, 11, 12, 12, 14, 14,
+ 16, 17, 17, 19, 20, 20, 22, 22, 24, 25, 25, 27, 28, 28, 30, 30,
+ 32, 33, 33, 35, 36, 36, 38, 38, 40, 41, 41, 43, 44, 44, 46, 46,
+ 48, 49, 49, 51, 52, 52, 54, 54, 56, 57, 57, 59, 60, 60, 62, 62,
+ 64, 65, 65, 67, 68, 68, 70, 70, 72, 73, 73, 75, 76, 76, 78, 78,
+ 80, 81, 81, 83, 84, 84, 86, 86, 88, 89, 89, 91, 92, 92, 94, 94,
+ 96, 97, 97, 99, 100, 100, 102, 102, 104, 105, 105, 107, 108, 108, 110, 110,
+ 112, 113, 113, 115, 116, 116, 118, 118, 120, 121, 121, 123, 124, 124, 126, 126,
+ 129, 129, 131, 131, 132, 134, 134, 135, 137, 137, 139, 139, 140, 142, 142, 143,
+ 145, 145, 147, 147, 148, 150, 150, 151, 153, 153, 155, 155, 156, 158, 158, 159,
+ 161, 161, 163, 163, 164, 166, 166, 167, 169, 169, 171, 171, 172, 174, 174, 175,
+ 177, 177, 179, 179, 180, 182, 182, 183, 185, 185, 187, 187, 188, 190, 190, 191,
+ 193, 193, 195, 195, 196, 198, 198, 199, 201, 201, 203, 203, 204, 206, 206, 207,
+ 209, 209, 211, 211, 212, 214, 214, 215, 217, 217, 219, 219, 220, 222, 222, 223,
+ 225, 225, 227, 227, 228, 230, 230, 231, 233, 233, 235, 235, 236, 238, 238, 239,
+ 241, 241, 243, 243, 244, 246, 246, 247, 249, 249, 251, 251, 252, 254, 254, 255
+ },
+ {
+ 0, 1, 2, 2, 4, 5, 6, 6, 8, 9, 10, 10, 12, 13, 14, 14,
+ 16, 17, 18, 18, 20, 21, 22, 22, 24, 25, 26, 26, 28, 29, 30, 30,
+ 32, 33, 34, 34, 36, 37, 38, 38, 40, 41, 42, 42, 44, 45, 46, 46,
+ 48, 49, 50, 50, 52, 53, 54, 54, 56, 57, 58, 58, 60, 61, 62, 62,
+ 64, 65, 66, 66, 68, 69, 70, 70, 72, 73, 74, 74, 76, 77, 78, 78,
+ 80, 81, 82, 82, 84, 85, 86, 86, 88, 89, 90, 90, 92, 93, 94, 94,
+ 96, 97, 98, 98, 100, 101, 102, 102, 104, 105, 106, 106, 108, 109, 110, 110,
+ 112, 113, 114, 114, 116, 117, 118, 118, 120, 121, 122, 122, 124, 125, 126, 126,
+ 129, 129, 130, 131, 133, 133, 134, 135, 137, 137, 138, 139, 141, 141, 142, 143,
+ 145, 145, 146, 147, 149, 149, 150, 151, 153, 153, 154, 155, 157, 157, 158, 159,
+ 161, 161, 162, 163, 165, 165, 166, 167, 169, 169, 170, 171, 173, 173, 174, 175,
+ 177, 177, 178, 179, 181, 181, 182, 183, 185, 185, 186, 187, 189, 189, 190, 191,
+ 193, 193, 194, 195, 197, 197, 198, 199, 201, 201, 202, 203, 205, 205, 206, 207,
+ 209, 209, 210, 211, 213, 213, 214, 215, 217, 217, 218, 219, 221, 221, 222, 223,
+ 225, 225, 226, 227, 229, 229, 230, 231, 233, 233, 234, 235, 237, 237, 238, 239,
+ 241, 241, 242, 243, 245, 245, 246, 247, 249, 249, 250, 251, 253, 253, 254, 255
+ },
+ {
+ 0, 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
+ }
+};
+
+// Starts from QUANT_6
+// Scrambled
+const uint8_t color_uquant_to_scrambled_pquant_tables[17][256] {
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 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
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 8, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 1, 1
+ },
+ {
+ 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
+ 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 14, 14, 14, 14, 14, 14, 14,
+ 14, 14, 14, 14, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 15, 15, 15, 15,
+ 15, 15, 15, 15, 15, 15, 15, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 9,
+ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1
+ },
+ {
+ 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
+ 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6,
+ 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10,
+ 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13,
+ 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
+ 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17,
+ 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21,
+ 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23,
+ 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25,
+ 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29,
+ 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31
+ },
+ {
+ 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16,
+ 16, 24, 24, 24, 24, 24, 24, 32, 32, 32, 32, 32, 32, 32, 2, 2,
+ 2, 2, 2, 2, 10, 10, 10, 10, 10, 10, 10, 18, 18, 18, 18, 18,
+ 18, 26, 26, 26, 26, 26, 26, 26, 34, 34, 34, 34, 34, 34, 4, 4,
+ 4, 4, 4, 4, 4, 12, 12, 12, 12, 12, 12, 20, 20, 20, 20, 20,
+ 20, 20, 28, 28, 28, 28, 28, 28, 36, 36, 36, 36, 36, 36, 36, 6,
+ 6, 6, 6, 6, 6, 14, 14, 14, 14, 14, 14, 14, 22, 22, 22, 22,
+ 22, 22, 30, 30, 30, 30, 30, 30, 30, 38, 38, 38, 38, 38, 38, 38,
+ 39, 39, 39, 39, 39, 39, 39, 31, 31, 31, 31, 31, 31, 31, 23, 23,
+ 23, 23, 23, 23, 15, 15, 15, 15, 15, 15, 15, 7, 7, 7, 7, 7,
+ 7, 37, 37, 37, 37, 37, 37, 37, 29, 29, 29, 29, 29, 29, 21, 21,
+ 21, 21, 21, 21, 21, 13, 13, 13, 13, 13, 13, 5, 5, 5, 5, 5,
+ 5, 5, 35, 35, 35, 35, 35, 35, 27, 27, 27, 27, 27, 27, 27, 19,
+ 19, 19, 19, 19, 19, 11, 11, 11, 11, 11, 11, 11, 3, 3, 3, 3,
+ 3, 3, 33, 33, 33, 33, 33, 33, 33, 25, 25, 25, 25, 25, 25, 17,
+ 17, 17, 17, 17, 17, 17, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1
+ },
+ {
+ 0, 0, 0, 16, 16, 16, 16, 16, 16, 32, 32, 32, 32, 32, 2, 2,
+ 2, 2, 2, 18, 18, 18, 18, 18, 18, 34, 34, 34, 34, 34, 4, 4,
+ 4, 4, 4, 4, 20, 20, 20, 20, 20, 36, 36, 36, 36, 36, 6, 6,
+ 6, 6, 6, 6, 22, 22, 22, 22, 22, 38, 38, 38, 38, 38, 38, 8,
+ 8, 8, 8, 8, 24, 24, 24, 24, 24, 24, 40, 40, 40, 40, 40, 10,
+ 10, 10, 10, 10, 26, 26, 26, 26, 26, 26, 42, 42, 42, 42, 42, 12,
+ 12, 12, 12, 12, 12, 28, 28, 28, 28, 28, 44, 44, 44, 44, 44, 14,
+ 14, 14, 14, 14, 14, 30, 30, 30, 30, 30, 46, 46, 46, 46, 46, 46,
+ 47, 47, 47, 47, 47, 47, 31, 31, 31, 31, 31, 15, 15, 15, 15, 15,
+ 15, 45, 45, 45, 45, 45, 29, 29, 29, 29, 29, 13, 13, 13, 13, 13,
+ 13, 43, 43, 43, 43, 43, 27, 27, 27, 27, 27, 27, 11, 11, 11, 11,
+ 11, 41, 41, 41, 41, 41, 25, 25, 25, 25, 25, 25, 9, 9, 9, 9,
+ 9, 39, 39, 39, 39, 39, 39, 23, 23, 23, 23, 23, 7, 7, 7, 7,
+ 7, 7, 37, 37, 37, 37, 37, 21, 21, 21, 21, 21, 5, 5, 5, 5,
+ 5, 5, 35, 35, 35, 35, 35, 19, 19, 19, 19, 19, 19, 3, 3, 3,
+ 3, 3, 33, 33, 33, 33, 33, 17, 17, 17, 17, 17, 17, 1, 1, 1
+ },
+ {
+ 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4,
+ 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8,
+ 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12,
+ 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16,
+ 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19,
+ 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23,
+ 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27,
+ 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31,
+ 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35,
+ 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39,
+ 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43,
+ 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47,
+ 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51,
+ 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55,
+ 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59,
+ 59, 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63
+ },
+ {
+ 0, 0, 16, 16, 16, 32, 32, 32, 48, 48, 48, 48, 64, 64, 64, 2,
+ 2, 2, 18, 18, 18, 34, 34, 34, 50, 50, 50, 50, 66, 66, 66, 4,
+ 4, 4, 20, 20, 20, 36, 36, 36, 36, 52, 52, 52, 68, 68, 68, 6,
+ 6, 6, 22, 22, 22, 38, 38, 38, 38, 54, 54, 54, 70, 70, 70, 8,
+ 8, 8, 24, 24, 24, 24, 40, 40, 40, 56, 56, 56, 72, 72, 72, 10,
+ 10, 10, 26, 26, 26, 26, 42, 42, 42, 58, 58, 58, 74, 74, 74, 12,
+ 12, 12, 12, 28, 28, 28, 44, 44, 44, 60, 60, 60, 76, 76, 76, 14,
+ 14, 14, 14, 30, 30, 30, 46, 46, 46, 62, 62, 62, 78, 78, 78, 78,
+ 79, 79, 79, 79, 63, 63, 63, 47, 47, 47, 31, 31, 31, 15, 15, 15,
+ 15, 77, 77, 77, 61, 61, 61, 45, 45, 45, 29, 29, 29, 13, 13, 13,
+ 13, 75, 75, 75, 59, 59, 59, 43, 43, 43, 27, 27, 27, 27, 11, 11,
+ 11, 73, 73, 73, 57, 57, 57, 41, 41, 41, 25, 25, 25, 25, 9, 9,
+ 9, 71, 71, 71, 55, 55, 55, 39, 39, 39, 39, 23, 23, 23, 7, 7,
+ 7, 69, 69, 69, 53, 53, 53, 37, 37, 37, 37, 21, 21, 21, 5, 5,
+ 5, 67, 67, 67, 51, 51, 51, 51, 35, 35, 35, 19, 19, 19, 3, 3,
+ 3, 65, 65, 65, 49, 49, 49, 49, 33, 33, 33, 17, 17, 17, 1, 1
+ },
+ {
+ 0, 0, 32, 32, 64, 64, 64, 2, 2, 2, 34, 34, 66, 66, 66, 4,
+ 4, 4, 36, 36, 68, 68, 68, 6, 6, 6, 38, 38, 70, 70, 70, 8,
+ 8, 8, 40, 40, 40, 72, 72, 10, 10, 10, 42, 42, 42, 74, 74, 12,
+ 12, 12, 44, 44, 44, 76, 76, 14, 14, 14, 46, 46, 46, 78, 78, 16,
+ 16, 16, 48, 48, 48, 80, 80, 80, 18, 18, 50, 50, 50, 82, 82, 82,
+ 20, 20, 52, 52, 52, 84, 84, 84, 22, 22, 54, 54, 54, 86, 86, 86,
+ 24, 24, 56, 56, 56, 88, 88, 88, 26, 26, 58, 58, 58, 90, 90, 90,
+ 28, 28, 60, 60, 60, 92, 92, 92, 30, 30, 62, 62, 62, 94, 94, 94,
+ 95, 95, 95, 63, 63, 63, 31, 31, 93, 93, 93, 61, 61, 61, 29, 29,
+ 91, 91, 91, 59, 59, 59, 27, 27, 89, 89, 89, 57, 57, 57, 25, 25,
+ 87, 87, 87, 55, 55, 55, 23, 23, 85, 85, 85, 53, 53, 53, 21, 21,
+ 83, 83, 83, 51, 51, 51, 19, 19, 81, 81, 81, 49, 49, 49, 17, 17,
+ 17, 79, 79, 47, 47, 47, 15, 15, 15, 77, 77, 45, 45, 45, 13, 13,
+ 13, 75, 75, 43, 43, 43, 11, 11, 11, 73, 73, 41, 41, 41, 9, 9,
+ 9, 71, 71, 71, 39, 39, 7, 7, 7, 69, 69, 69, 37, 37, 5, 5,
+ 5, 67, 67, 67, 35, 35, 3, 3, 3, 65, 65, 65, 33, 33, 1, 1
+ },
+ {
+ 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7,
+ 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15,
+ 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23,
+ 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31,
+ 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39,
+ 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47,
+ 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55,
+ 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63,
+ 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71,
+ 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79,
+ 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87,
+ 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95,
+ 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103,
+ 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111,
+ 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119,
+ 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127
+ },
+ {
+ 0, 32, 32, 64, 96, 96, 128, 128, 2, 34, 34, 66, 98, 98, 130, 130,
+ 4, 36, 36, 68, 100, 100, 132, 132, 6, 38, 38, 70, 102, 102, 134, 134,
+ 8, 40, 40, 72, 104, 104, 136, 136, 10, 42, 42, 74, 106, 106, 138, 138,
+ 12, 44, 44, 76, 108, 108, 140, 140, 14, 46, 46, 78, 110, 110, 142, 142,
+ 16, 48, 48, 80, 112, 112, 144, 144, 18, 50, 50, 82, 114, 114, 146, 146,
+ 20, 52, 52, 84, 116, 116, 148, 148, 22, 54, 54, 86, 118, 118, 150, 150,
+ 24, 56, 56, 88, 120, 120, 152, 152, 26, 58, 58, 90, 122, 122, 154, 154,
+ 28, 60, 60, 92, 124, 124, 156, 156, 30, 62, 62, 94, 126, 126, 158, 158,
+ 159, 159, 127, 127, 95, 63, 63, 31, 157, 157, 125, 125, 93, 61, 61, 29,
+ 155, 155, 123, 123, 91, 59, 59, 27, 153, 153, 121, 121, 89, 57, 57, 25,
+ 151, 151, 119, 119, 87, 55, 55, 23, 149, 149, 117, 117, 85, 53, 53, 21,
+ 147, 147, 115, 115, 83, 51, 51, 19, 145, 145, 113, 113, 81, 49, 49, 17,
+ 143, 143, 111, 111, 79, 47, 47, 15, 141, 141, 109, 109, 77, 45, 45, 13,
+ 139, 139, 107, 107, 75, 43, 43, 11, 137, 137, 105, 105, 73, 41, 41, 9,
+ 135, 135, 103, 103, 71, 39, 39, 7, 133, 133, 101, 101, 69, 37, 37, 5,
+ 131, 131, 99, 99, 67, 35, 35, 3, 129, 129, 97, 97, 65, 33, 33, 1
+ },
+ {
+ 0, 64, 128, 128, 2, 66, 130, 130, 4, 68, 132, 132, 6, 70, 134, 134,
+ 8, 72, 136, 136, 10, 74, 138, 138, 12, 76, 140, 140, 14, 78, 142, 142,
+ 16, 80, 144, 144, 18, 82, 146, 146, 20, 84, 148, 148, 22, 86, 150, 150,
+ 24, 88, 152, 152, 26, 90, 154, 154, 28, 92, 156, 156, 30, 94, 158, 158,
+ 32, 96, 160, 160, 34, 98, 162, 162, 36, 100, 164, 164, 38, 102, 166, 166,
+ 40, 104, 168, 168, 42, 106, 170, 170, 44, 108, 172, 172, 46, 110, 174, 174,
+ 48, 112, 176, 176, 50, 114, 178, 178, 52, 116, 180, 180, 54, 118, 182, 182,
+ 56, 120, 184, 184, 58, 122, 186, 186, 60, 124, 188, 188, 62, 126, 190, 190,
+ 191, 191, 127, 63, 189, 189, 125, 61, 187, 187, 123, 59, 185, 185, 121, 57,
+ 183, 183, 119, 55, 181, 181, 117, 53, 179, 179, 115, 51, 177, 177, 113, 49,
+ 175, 175, 111, 47, 173, 173, 109, 45, 171, 171, 107, 43, 169, 169, 105, 41,
+ 167, 167, 103, 39, 165, 165, 101, 37, 163, 163, 99, 35, 161, 161, 97, 33,
+ 159, 159, 95, 31, 157, 157, 93, 29, 155, 155, 91, 27, 153, 153, 89, 25,
+ 151, 151, 87, 23, 149, 149, 85, 21, 147, 147, 83, 19, 145, 145, 81, 17,
+ 143, 143, 79, 15, 141, 141, 77, 13, 139, 139, 75, 11, 137, 137, 73, 9,
+ 135, 135, 71, 7, 133, 133, 69, 5, 131, 131, 67, 3, 129, 129, 65, 1
+ },
+ {
+ 0, 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
+ }
+};
+
+#endif
+
+// Starts from QUANT_6
+// Scrambled
+static const uint8_t color_scrambled_pquant_to_uquant_q6[6] {
+ 0, 255, 51, 204, 102, 153
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q8[8] {
+ 0, 36, 73, 109, 146, 182, 219, 255
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q10[10] {
+ 0, 255, 28, 227, 56, 199, 84, 171, 113, 142
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q12[12] {
+ 0, 255, 69, 186, 23, 232, 92, 163, 46, 209, 116, 139
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q16[16] {
+ 0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q20[20] {
+ 0, 255, 67, 188, 13, 242, 80, 175, 27, 228, 94, 161, 40, 215, 107, 148,
+ 54, 201, 121, 134
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q24[24] {
+ 0, 255, 33, 222, 66, 189, 99, 156, 11, 244, 44, 211, 77, 178, 110, 145,
+ 22, 233, 55, 200, 88, 167, 121, 134
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q32[32] {
+ 0, 8, 16, 24, 33, 41, 49, 57, 66, 74, 82, 90, 99, 107, 115, 123,
+ 132, 140, 148, 156, 165, 173, 181, 189, 198, 206, 214, 222, 231, 239, 247, 255
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q40[40] {
+ 0, 255, 32, 223, 65, 190, 97, 158, 6, 249, 39, 216, 71, 184, 104, 151,
+ 13, 242, 45, 210, 78, 177, 110, 145, 19, 236, 52, 203, 84, 171, 117, 138,
+ 26, 229, 58, 197, 91, 164, 123, 132
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q48[48] {
+ 0, 255, 16, 239, 32, 223, 48, 207, 65, 190, 81, 174, 97, 158, 113, 142,
+ 5, 250, 21, 234, 38, 217, 54, 201, 70, 185, 86, 169, 103, 152, 119, 136,
+ 11, 244, 27, 228, 43, 212, 59, 196, 76, 179, 92, 163, 108, 147, 124, 131
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q64[64] {
+ 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60,
+ 65, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125,
+ 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, 170, 174, 178, 182, 186, 190,
+ 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239, 243, 247, 251, 255,
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q80[80] {
+ 0, 255, 16, 239, 32, 223, 48, 207, 64, 191, 80, 175, 96, 159, 112, 143,
+ 3, 252, 19, 236, 35, 220, 51, 204, 67, 188, 83, 172, 100, 155, 116, 139,
+ 6, 249, 22, 233, 38, 217, 54, 201, 71, 184, 87, 168, 103, 152, 119, 136,
+ 9, 246, 25, 230, 42, 213, 58, 197, 74, 181, 90, 165, 106, 149, 122, 133,
+ 13, 242, 29, 226, 45, 210, 61, 194, 77, 178, 93, 162, 109, 146, 125, 130
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q96[96] {
+ 0, 255, 8, 247, 16, 239, 24, 231, 32, 223, 40, 215, 48, 207, 56, 199,
+ 64, 191, 72, 183, 80, 175, 88, 167, 96, 159, 104, 151, 112, 143, 120, 135,
+ 2, 253, 10, 245, 18, 237, 26, 229, 35, 220, 43, 212, 51, 204, 59, 196,
+ 67, 188, 75, 180, 83, 172, 91, 164, 99, 156, 107, 148, 115, 140, 123, 132,
+ 5, 250, 13, 242, 21, 234, 29, 226, 37, 218, 45, 210, 53, 202, 61, 194,
+ 70, 185, 78, 177, 86, 169, 94, 161, 102, 153, 110, 145, 118, 137, 126, 129
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q128[128] {
+ 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30,
+ 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62,
+ 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94,
+ 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126,
+ 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159,
+ 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191,
+ 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223,
+ 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q160[160] {
+ 0, 255, 8, 247, 16, 239, 24, 231, 32, 223, 40, 215, 48, 207, 56, 199,
+ 64, 191, 72, 183, 80, 175, 88, 167, 96, 159, 104, 151, 112, 143, 120, 135,
+ 1, 254, 9, 246, 17, 238, 25, 230, 33, 222, 41, 214, 49, 206, 57, 198,
+ 65, 190, 73, 182, 81, 174, 89, 166, 97, 158, 105, 150, 113, 142, 121, 134,
+ 3, 252, 11, 244, 19, 236, 27, 228, 35, 220, 43, 212, 51, 204, 59, 196,
+ 67, 188, 75, 180, 83, 172, 91, 164, 99, 156, 107, 148, 115, 140, 123, 132,
+ 4, 251, 12, 243, 20, 235, 28, 227, 36, 219, 44, 211, 52, 203, 60, 195,
+ 68, 187, 76, 179, 84, 171, 92, 163, 100, 155, 108, 147, 116, 139, 124, 131,
+ 6, 249, 14, 241, 22, 233, 30, 225, 38, 217, 46, 209, 54, 201, 62, 193,
+ 70, 185, 78, 177, 86, 169, 94, 161, 102, 153, 110, 145, 118, 137, 126, 129
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q192[192] {
+ 0, 255, 4, 251, 8, 247, 12, 243, 16, 239, 20, 235, 24, 231, 28, 227,
+ 32, 223, 36, 219, 40, 215, 44, 211, 48, 207, 52, 203, 56, 199, 60, 195,
+ 64, 191, 68, 187, 72, 183, 76, 179, 80, 175, 84, 171, 88, 167, 92, 163,
+ 96, 159, 100, 155, 104, 151, 108, 147, 112, 143, 116, 139, 120, 135, 124, 131,
+ 1, 254, 5, 250, 9, 246, 13, 242, 17, 238, 21, 234, 25, 230, 29, 226,
+ 33, 222, 37, 218, 41, 214, 45, 210, 49, 206, 53, 202, 57, 198, 61, 194,
+ 65, 190, 69, 186, 73, 182, 77, 178, 81, 174, 85, 170, 89, 166, 93, 162,
+ 97, 158, 101, 154, 105, 150, 109, 146, 113, 142, 117, 138, 121, 134, 125, 130,
+ 2, 253, 6, 249, 10, 245, 14, 241, 18, 237, 22, 233, 26, 229, 30, 225,
+ 34, 221, 38, 217, 42, 213, 46, 209, 50, 205, 54, 201, 58, 197, 62, 193,
+ 66, 189, 70, 185, 74, 181, 78, 177, 82, 173, 86, 169, 90, 165, 94, 161,
+ 98, 157, 102, 153, 106, 149, 110, 145, 114, 141, 118, 137, 122, 133, 126, 129
+};
+
+static const uint8_t color_scrambled_pquant_to_uquant_q256[256] {
+ 0, 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
+};
+
+const uint8_t* color_scrambled_pquant_to_uquant_tables[17] {
+ color_scrambled_pquant_to_uquant_q6,
+ color_scrambled_pquant_to_uquant_q8,
+ color_scrambled_pquant_to_uquant_q10,
+ color_scrambled_pquant_to_uquant_q12,
+ color_scrambled_pquant_to_uquant_q16,
+ color_scrambled_pquant_to_uquant_q20,
+ color_scrambled_pquant_to_uquant_q24,
+ color_scrambled_pquant_to_uquant_q32,
+ color_scrambled_pquant_to_uquant_q40,
+ color_scrambled_pquant_to_uquant_q48,
+ color_scrambled_pquant_to_uquant_q64,
+ color_scrambled_pquant_to_uquant_q80,
+ color_scrambled_pquant_to_uquant_q96,
+ color_scrambled_pquant_to_uquant_q128,
+ color_scrambled_pquant_to_uquant_q160,
+ color_scrambled_pquant_to_uquant_q192,
+ color_scrambled_pquant_to_uquant_q256
+};
+
+// The quant_mode_table[integer_count/2][bits] gives us the quantization level for a given integer
+// count and number of bits that the integer may fit into.
+const int8_t quant_mode_table[10][128] {
+ {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -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, 0, 2, 3, 5, 6, 8, 9, 11, 12, 14, 15, 17, 18,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20
+ },
+ {
+ -1, -1, -1, -1, 0, 0, 0, 1, 2, 2, 3, 4, 5, 5, 6, 7,
+ 8, 8, 9, 10, 11, 11, 12, 13, 14, 14, 15, 16, 17, 17, 18, 19,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20
+ },
+ {
+ -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3,
+ 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11,
+ 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20
+ },
+ {
+ -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 1, 1, 1,
+ 2, 2, 2, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6, 7, 7, 7,
+ 8, 8, 8, 9, 9, 10, 10, 10, 11, 11, 11, 12, 12, 13, 13, 13,
+ 14, 14, 14, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 19, 19, 19,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20
+ },
+ {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0,
+ 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 4, 4, 4, 4, 5, 5,
+ 5, 5, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 9, 9, 10, 10,
+ 10, 10, 11, 11, 11, 11, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14,
+ 15, 15, 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 19, 19, 19, 19,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20
+ },
+ {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3,
+ 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7,
+ 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11,
+ 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15,
+ 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20
+ },
+ {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2,
+ 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6,
+ 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9,
+ 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13,
+ 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16,
+ 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 19,
+ 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20
+ },
+ {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4,
+ 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7,
+ 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10,
+ 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13,
+ 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16,
+ 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19
+ },
+ {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1,
+ 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 4,
+ 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6,
+ 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 9, 9,
+ 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11,
+ 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14,
+ 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17
+ }
+};
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_symbolic_physical.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_symbolic_physical.cpp
new file mode 100644
index 00000000000..a19b907a24b
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_symbolic_physical.cpp
@@ -0,0 +1,530 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2021 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Functions for converting between symbolic and physical encodings.
+ */
+
+#include "astcenc_internal.h"
+
+#include <cassert>
+
+/**
+ * @brief Write up to 8 bits at an arbitrary bit offset.
+ *
+ * The stored value is at most 8 bits, but can be stored at an offset of between 0 and 7 bits so
+ * may span two separate bytes in memory.
+ *
+ * @param value The value to write.
+ * @param bitcount The number of bits to write, starting from LSB.
+ * @param bitoffset The bit offset to store at, between 0 and 7.
+ * @param[in,out] ptr The data pointer to write to.
+ */
+static inline void write_bits(
+ int value,
+ int bitcount,
+ int bitoffset,
+ uint8_t* ptr
+) {
+ int mask = (1 << bitcount) - 1;
+ value &= mask;
+ ptr += bitoffset >> 3;
+ bitoffset &= 7;
+ value <<= bitoffset;
+ mask <<= bitoffset;
+ mask = ~mask;
+
+ ptr[0] &= mask;
+ ptr[0] |= value;
+ ptr[1] &= mask >> 8;
+ ptr[1] |= value >> 8;
+}
+
+/**
+ * @brief Read up to 8 bits at an arbitrary bit offset.
+ *
+ * The stored value is at most 8 bits, but can be stored at an offset of between 0 and 7 bits so may
+ * span two separate bytes in memory.
+ *
+ * @param bitcount The number of bits to read.
+ * @param bitoffset The bit offset to read from, between 0 and 7.
+ * @param[in,out] ptr The data pointer to read from.
+ *
+ * @return The read value.
+ */
+static inline int read_bits(
+ int bitcount,
+ int bitoffset,
+ const uint8_t* ptr
+) {
+ int mask = (1 << bitcount) - 1;
+ ptr += bitoffset >> 3;
+ bitoffset &= 7;
+ int value = ptr[0] | (ptr[1] << 8);
+ value >>= bitoffset;
+ value &= mask;
+ return value;
+}
+
+/**
+ * @brief Reverse bits in a byte.
+ *
+ * @param p The value to reverse.
+ *
+ * @return The reversed result.
+ */
+static inline int bitrev8(int p)
+{
+ p = ((p & 0x0F) << 4) | ((p >> 4) & 0x0F);
+ p = ((p & 0x33) << 2) | ((p >> 2) & 0x33);
+ p = ((p & 0x55) << 1) | ((p >> 1) & 0x55);
+ return p;
+}
+
+/* See header for documentation. */
+void symbolic_to_physical(
+ const block_size_descriptor& bsd,
+ const symbolic_compressed_block& scb,
+ physical_compressed_block& pcb
+) {
+ assert(scb.block_type != SYM_BTYPE_ERROR);
+
+ // Constant color block using UNORM16 colors
+ if (scb.block_type == SYM_BTYPE_CONST_U16)
+ {
+ // There is currently no attempt to coalesce larger void-extents
+ static const uint8_t cbytes[8] { 0xFC, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
+ for (unsigned int i = 0; i < 8; i++)
+ {
+ pcb.data[i] = cbytes[i];
+ }
+
+ for (unsigned int i = 0; i < BLOCK_MAX_COMPONENTS; i++)
+ {
+ pcb.data[2 * i + 8] = scb.constant_color[i] & 0xFF;
+ pcb.data[2 * i + 9] = (scb.constant_color[i] >> 8) & 0xFF;
+ }
+
+ return;
+ }
+
+ // Constant color block using FP16 colors
+ if (scb.block_type == SYM_BTYPE_CONST_F16)
+ {
+ // There is currently no attempt to coalesce larger void-extents
+ static const uint8_t cbytes[8] { 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
+ for (unsigned int i = 0; i < 8; i++)
+ {
+ pcb.data[i] = cbytes[i];
+ }
+
+ for (unsigned int i = 0; i < BLOCK_MAX_COMPONENTS; i++)
+ {
+ pcb.data[2 * i + 8] = scb.constant_color[i] & 0xFF;
+ pcb.data[2 * i + 9] = (scb.constant_color[i] >> 8) & 0xFF;
+ }
+
+ return;
+ }
+
+ unsigned int partition_count = scb.partition_count;
+
+ // Compress the weights.
+ // They are encoded as an ordinary integer-sequence, then bit-reversed
+ uint8_t weightbuf[16] { 0 };
+
+ const auto& bm = bsd.get_block_mode(scb.block_mode);
+ const auto& di = bsd.get_decimation_info(bm.decimation_mode);
+ int weight_count = di.weight_count;
+ quant_method weight_quant_method = bm.get_weight_quant_mode();
+ float weight_quant_levels = static_cast<float>(get_quant_level(weight_quant_method));
+ int is_dual_plane = bm.is_dual_plane;
+
+ const auto& qat = quant_and_xfer_tables[weight_quant_method];
+
+ int real_weight_count = is_dual_plane ? 2 * weight_count : weight_count;
+
+ int bits_for_weights = get_ise_sequence_bitcount(real_weight_count, weight_quant_method);
+
+ uint8_t weights[64];
+ if (is_dual_plane)
+ {
+ for (int i = 0; i < weight_count; i++)
+ {
+ float uqw = static_cast<float>(scb.weights[i]);
+ float qw = (uqw / 64.0f) * (weight_quant_levels - 1.0f);
+ int qwi = static_cast<int>(qw + 0.5f);
+ weights[2 * i] = qat.scramble_map[qwi];
+
+ uqw = static_cast<float>(scb.weights[i + WEIGHTS_PLANE2_OFFSET]);
+ qw = (uqw / 64.0f) * (weight_quant_levels - 1.0f);
+ qwi = static_cast<int>(qw + 0.5f);
+ weights[2 * i + 1] = qat.scramble_map[qwi];
+ }
+ }
+ else
+ {
+ for (int i = 0; i < weight_count; i++)
+ {
+ float uqw = static_cast<float>(scb.weights[i]);
+ float qw = (uqw / 64.0f) * (weight_quant_levels - 1.0f);
+ int qwi = static_cast<int>(qw + 0.5f);
+ weights[i] = qat.scramble_map[qwi];
+ }
+ }
+
+ encode_ise(weight_quant_method, real_weight_count, weights, weightbuf, 0);
+
+ for (int i = 0; i < 16; i++)
+ {
+ pcb.data[i] = static_cast<uint8_t>(bitrev8(weightbuf[15 - i]));
+ }
+
+ write_bits(scb.block_mode, 11, 0, pcb.data);
+ write_bits(partition_count - 1, 2, 11, pcb.data);
+
+ int below_weights_pos = 128 - bits_for_weights;
+
+ // Encode partition index and color endpoint types for blocks with 2+ partitions
+ if (partition_count > 1)
+ {
+ write_bits(scb.partition_index, 6, 13, pcb.data);
+ write_bits(scb.partition_index >> 6, PARTITION_INDEX_BITS - 6, 19, pcb.data);
+
+ if (scb.color_formats_matched)
+ {
+ write_bits(scb.color_formats[0] << 2, 6, 13 + PARTITION_INDEX_BITS, pcb.data);
+ }
+ else
+ {
+ // Check endpoint types for each partition to determine the lowest class present
+ int low_class = 4;
+
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ int class_of_format = scb.color_formats[i] >> 2;
+ low_class = astc::min(class_of_format, low_class);
+ }
+
+ if (low_class == 3)
+ {
+ low_class = 2;
+ }
+
+ int encoded_type = low_class + 1;
+ int bitpos = 2;
+
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ int classbit_of_format = (scb.color_formats[i] >> 2) - low_class;
+ encoded_type |= classbit_of_format << bitpos;
+ bitpos++;
+ }
+
+ for (unsigned int i = 0; i < partition_count; i++)
+ {
+ int lowbits_of_format = scb.color_formats[i] & 3;
+ encoded_type |= lowbits_of_format << bitpos;
+ bitpos += 2;
+ }
+
+ int encoded_type_lowpart = encoded_type & 0x3F;
+ int encoded_type_highpart = encoded_type >> 6;
+ int encoded_type_highpart_size = (3 * partition_count) - 4;
+ int encoded_type_highpart_pos = 128 - bits_for_weights - encoded_type_highpart_size;
+ write_bits(encoded_type_lowpart, 6, 13 + PARTITION_INDEX_BITS, pcb.data);
+ write_bits(encoded_type_highpart, encoded_type_highpart_size, encoded_type_highpart_pos, pcb.data);
+ below_weights_pos -= encoded_type_highpart_size;
+ }
+ }
+ else
+ {
+ write_bits(scb.color_formats[0], 4, 13, pcb.data);
+ }
+
+ // In dual-plane mode, encode the color component of the second plane of weights
+ if (is_dual_plane)
+ {
+ write_bits(scb.plane2_component, 2, below_weights_pos - 2, pcb.data);
+ }
+
+ // Encode the color components
+ uint8_t values_to_encode[32];
+ int valuecount_to_encode = 0;
+
+ const uint8_t* pack_table = color_uquant_to_scrambled_pquant_tables[scb.quant_mode - QUANT_6];
+ for (unsigned int i = 0; i < scb.partition_count; i++)
+ {
+ int vals = 2 * (scb.color_formats[i] >> 2) + 2;
+ assert(vals <= 8);
+ for (int j = 0; j < vals; j++)
+ {
+ values_to_encode[j + valuecount_to_encode] = pack_table[scb.color_values[i][j]];
+ }
+ valuecount_to_encode += vals;
+ }
+
+ encode_ise(scb.get_color_quant_mode(), valuecount_to_encode, values_to_encode, pcb.data,
+ scb.partition_count == 1 ? 17 : 19 + PARTITION_INDEX_BITS);
+}
+
+/* See header for documentation. */
+void physical_to_symbolic(
+ const block_size_descriptor& bsd,
+ const physical_compressed_block& pcb,
+ symbolic_compressed_block& scb
+) {
+ uint8_t bswapped[16];
+
+ scb.block_type = SYM_BTYPE_NONCONST;
+
+ // Extract header fields
+ int block_mode = read_bits(11, 0, pcb.data);
+ if ((block_mode & 0x1FF) == 0x1FC)
+ {
+ // Constant color block
+
+ // Check what format the data has
+ if (block_mode & 0x200)
+ {
+ scb.block_type = SYM_BTYPE_CONST_F16;
+ }
+ else
+ {
+ scb.block_type = SYM_BTYPE_CONST_U16;
+ }
+
+ scb.partition_count = 0;
+ for (int i = 0; i < 4; i++)
+ {
+ scb.constant_color[i] = pcb.data[2 * i + 8] | (pcb.data[2 * i + 9] << 8);
+ }
+
+ // Additionally, check that the void-extent
+ if (bsd.zdim == 1)
+ {
+ // 2D void-extent
+ int rsvbits = read_bits(2, 10, pcb.data);
+ if (rsvbits != 3)
+ {
+ scb.block_type = SYM_BTYPE_ERROR;
+ return;
+ }
+
+ int vx_low_s = read_bits(8, 12, pcb.data) | (read_bits(5, 12 + 8, pcb.data) << 8);
+ int vx_high_s = read_bits(8, 25, pcb.data) | (read_bits(5, 25 + 8, pcb.data) << 8);
+ int vx_low_t = read_bits(8, 38, pcb.data) | (read_bits(5, 38 + 8, pcb.data) << 8);
+ int vx_high_t = read_bits(8, 51, pcb.data) | (read_bits(5, 51 + 8, pcb.data) << 8);
+
+ int all_ones = vx_low_s == 0x1FFF && vx_high_s == 0x1FFF && vx_low_t == 0x1FFF && vx_high_t == 0x1FFF;
+
+ if ((vx_low_s >= vx_high_s || vx_low_t >= vx_high_t) && !all_ones)
+ {
+ scb.block_type = SYM_BTYPE_ERROR;
+ return;
+ }
+ }
+ else
+ {
+ // 3D void-extent
+ int vx_low_s = read_bits(9, 10, pcb.data);
+ int vx_high_s = read_bits(9, 19, pcb.data);
+ int vx_low_t = read_bits(9, 28, pcb.data);
+ int vx_high_t = read_bits(9, 37, pcb.data);
+ int vx_low_p = read_bits(9, 46, pcb.data);
+ int vx_high_p = read_bits(9, 55, pcb.data);
+
+ int all_ones = vx_low_s == 0x1FF && vx_high_s == 0x1FF && vx_low_t == 0x1FF && vx_high_t == 0x1FF && vx_low_p == 0x1FF && vx_high_p == 0x1FF;
+
+ if ((vx_low_s >= vx_high_s || vx_low_t >= vx_high_t || vx_low_p >= vx_high_p) && !all_ones)
+ {
+ scb.block_type = SYM_BTYPE_ERROR;
+ return;
+ }
+ }
+
+ return;
+ }
+
+ unsigned int packed_index = bsd.block_mode_packed_index[block_mode];
+ if (packed_index == BLOCK_BAD_BLOCK_MODE)
+ {
+ scb.block_type = SYM_BTYPE_ERROR;
+ return;
+ }
+
+ const auto& bm = bsd.get_block_mode(block_mode);
+ const auto& di = bsd.get_decimation_info(bm.decimation_mode);
+
+ int weight_count = di.weight_count;
+ quant_method weight_quant_method = static_cast<quant_method>(bm.quant_mode);
+ int is_dual_plane = bm.is_dual_plane;
+
+ int real_weight_count = is_dual_plane ? 2 * weight_count : weight_count;
+
+ int partition_count = read_bits(2, 11, pcb.data) + 1;
+
+ scb.block_mode = static_cast<uint16_t>(block_mode);
+ scb.partition_count = static_cast<uint8_t>(partition_count);
+
+ for (int i = 0; i < 16; i++)
+ {
+ bswapped[i] = static_cast<uint8_t>(bitrev8(pcb.data[15 - i]));
+ }
+
+ int bits_for_weights = get_ise_sequence_bitcount(real_weight_count, weight_quant_method);
+
+ int below_weights_pos = 128 - bits_for_weights;
+
+ uint8_t indices[64];
+ const auto& qat = quant_and_xfer_tables[weight_quant_method];
+
+ decode_ise(weight_quant_method, real_weight_count, bswapped, indices, 0);
+
+ if (is_dual_plane)
+ {
+ for (int i = 0; i < weight_count; i++)
+ {
+ scb.weights[i] = qat.unscramble_and_unquant_map[indices[2 * i]];
+ scb.weights[i + WEIGHTS_PLANE2_OFFSET] = qat.unscramble_and_unquant_map[indices[2 * i + 1]];
+ }
+ }
+ else
+ {
+ for (int i = 0; i < weight_count; i++)
+ {
+ scb.weights[i] = qat.unscramble_and_unquant_map[indices[i]];
+ }
+ }
+
+ if (is_dual_plane && partition_count == 4)
+ {
+ scb.block_type = SYM_BTYPE_ERROR;
+ return;
+ }
+
+ scb.color_formats_matched = 0;
+
+ // Determine the format of each endpoint pair
+ int color_formats[BLOCK_MAX_PARTITIONS];
+ int encoded_type_highpart_size = 0;
+ if (partition_count == 1)
+ {
+ color_formats[0] = read_bits(4, 13, pcb.data);
+ scb.partition_index = 0;
+ }
+ else
+ {
+ encoded_type_highpart_size = (3 * partition_count) - 4;
+ below_weights_pos -= encoded_type_highpart_size;
+ int encoded_type = read_bits(6, 13 + PARTITION_INDEX_BITS, pcb.data) | (read_bits(encoded_type_highpart_size, below_weights_pos, pcb.data) << 6);
+ int baseclass = encoded_type & 0x3;
+ if (baseclass == 0)
+ {
+ for (int i = 0; i < partition_count; i++)
+ {
+ color_formats[i] = (encoded_type >> 2) & 0xF;
+ }
+
+ below_weights_pos += encoded_type_highpart_size;
+ scb.color_formats_matched = 1;
+ encoded_type_highpart_size = 0;
+ }
+ else
+ {
+ int bitpos = 2;
+ baseclass--;
+
+ for (int i = 0; i < partition_count; i++)
+ {
+ color_formats[i] = (((encoded_type >> bitpos) & 1) + baseclass) << 2;
+ bitpos++;
+ }
+
+ for (int i = 0; i < partition_count; i++)
+ {
+ color_formats[i] |= (encoded_type >> bitpos) & 3;
+ bitpos += 2;
+ }
+ }
+ scb.partition_index = static_cast<uint16_t>(read_bits(6, 13, pcb.data) | (read_bits(PARTITION_INDEX_BITS - 6, 19, pcb.data) << 6));
+ }
+
+ for (int i = 0; i < partition_count; i++)
+ {
+ scb.color_formats[i] = static_cast<uint8_t>(color_formats[i]);
+ }
+
+ // Determine number of color endpoint integers
+ int color_integer_count = 0;
+ for (int i = 0; i < partition_count; i++)
+ {
+ int endpoint_class = color_formats[i] >> 2;
+ color_integer_count += (endpoint_class + 1) * 2;
+ }
+
+ if (color_integer_count > 18)
+ {
+ scb.block_type = SYM_BTYPE_ERROR;
+ return;
+ }
+
+ // Determine the color endpoint format to use
+ static const int color_bits_arr[5] { -1, 115 - 4, 113 - 4 - PARTITION_INDEX_BITS, 113 - 4 - PARTITION_INDEX_BITS, 113 - 4 - PARTITION_INDEX_BITS };
+ int color_bits = color_bits_arr[partition_count] - bits_for_weights - encoded_type_highpart_size;
+ if (is_dual_plane)
+ {
+ color_bits -= 2;
+ }
+
+ if (color_bits < 0)
+ {
+ color_bits = 0;
+ }
+
+ int color_quant_level = quant_mode_table[color_integer_count >> 1][color_bits];
+ if (color_quant_level < QUANT_6)
+ {
+ scb.block_type = SYM_BTYPE_ERROR;
+ return;
+ }
+
+ // Unpack the integer color values and assign to endpoints
+ scb.quant_mode = static_cast<quant_method>(color_quant_level);
+
+ uint8_t values_to_decode[32];
+ decode_ise(static_cast<quant_method>(color_quant_level), color_integer_count, pcb.data,
+ values_to_decode, (partition_count == 1 ? 17 : 19 + PARTITION_INDEX_BITS));
+
+ int valuecount_to_decode = 0;
+ const uint8_t* unpack_table = color_scrambled_pquant_to_uquant_tables[scb.quant_mode - QUANT_6];
+ for (int i = 0; i < partition_count; i++)
+ {
+ int vals = 2 * (color_formats[i] >> 2) + 2;
+ for (int j = 0; j < vals; j++)
+ {
+ scb.color_values[i][j] = unpack_table[values_to_decode[j + valuecount_to_decode]];
+ }
+ valuecount_to_decode += vals;
+ }
+
+ // Fetch component for second-plane in the case of dual plane of weights.
+ if (is_dual_plane)
+ {
+ scb.plane2_component = static_cast<int8_t>(read_bits(2, below_weights_pos - 2, pcb.data));
+ }
+}
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib.h b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib.h
new file mode 100644
index 00000000000..6085c8eb2a6
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib.h
@@ -0,0 +1,570 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2019-2022 Arm Limited
+// Copyright 2008 Jose Fonseca
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/*
+ * This module implements vector support for floats, ints, and vector lane
+ * control masks. It provides access to both explicit vector width types, and
+ * flexible N-wide types where N can be determined at compile time.
+ *
+ * The design of this module encourages use of vector length agnostic code, via
+ * the vint, vfloat, and vmask types. These will take on the widest SIMD vector
+ * with that is available at compile time. The current vector width is
+ * accessible for e.g. loop strides via the ASTCENC_SIMD_WIDTH constant.
+ *
+ * Explicit scalar types are acessible via the vint1, vfloat1, vmask1 types.
+ * These are provided primarily for prototyping and algorithm debug of VLA
+ * implementations.
+ *
+ * Explicit 4-wide types are accessible via the vint4, vfloat4, and vmask4
+ * types. These are provided for use by VLA code, but are also expected to be
+ * used as a fixed-width type and will supported a reference C++ fallback for
+ * use on platforms without SIMD intrinsics.
+ *
+ * Explicit 8-wide types are accessible via the vint8, vfloat8, and vmask8
+ * types. These are provide for use by VLA code, and are not expected to be
+ * used as a fixed-width type in normal code. No reference C implementation is
+ * provided on platforms without underlying SIMD intrinsics.
+ *
+ * With the current implementation ISA support is provided for:
+ *
+ * * 1-wide for scalar reference.
+ * * 4-wide for Armv8-A NEON.
+ * * 4-wide for x86-64 SSE2.
+ * * 4-wide for x86-64 SSE4.1.
+ * * 8-wide for x86-64 AVX2.
+ */
+
+#ifndef ASTC_VECMATHLIB_H_INCLUDED
+#define ASTC_VECMATHLIB_H_INCLUDED
+
+#if ASTCENC_SSE != 0 || ASTCENC_AVX != 0
+ #include <immintrin.h>
+#elif ASTCENC_NEON != 0
+ #include <arm_neon.h>
+#endif
+
+#if !defined(__clang__) && defined(_MSC_VER)
+ #define ASTCENC_SIMD_INLINE __forceinline
+ #define ASTCENC_NO_INLINE
+#elif defined(__GNUC__) && !defined(__clang__)
+ #define ASTCENC_SIMD_INLINE __attribute__((always_inline)) inline
+ #define ASTCENC_NO_INLINE __attribute__ ((noinline))
+#else
+ #define ASTCENC_SIMD_INLINE __attribute__((always_inline, nodebug)) inline
+ #define ASTCENC_NO_INLINE __attribute__ ((noinline))
+#endif
+
+#if ASTCENC_AVX >= 2
+ /* If we have AVX2 expose 8-wide VLA. */
+ #include "astcenc_vecmathlib_sse_4.h"
+ #include "astcenc_vecmathlib_common_4.h"
+ #include "astcenc_vecmathlib_avx2_8.h"
+
+ #define ASTCENC_SIMD_WIDTH 8
+
+ using vfloat = vfloat8;
+
+ #if defined(ASTCENC_NO_INVARIANCE)
+ using vfloatacc = vfloat8;
+ #else
+ using vfloatacc = vfloat4;
+ #endif
+
+ using vint = vint8;
+ using vmask = vmask8;
+
+ constexpr auto loada = vfloat8::loada;
+ constexpr auto load1 = vfloat8::load1;
+
+#elif ASTCENC_SSE >= 20
+ /* If we have SSE expose 4-wide VLA, and 4-wide fixed width. */
+ #include "astcenc_vecmathlib_sse_4.h"
+ #include "astcenc_vecmathlib_common_4.h"
+
+ #define ASTCENC_SIMD_WIDTH 4
+
+ using vfloat = vfloat4;
+ using vfloatacc = vfloat4;
+ using vint = vint4;
+ using vmask = vmask4;
+
+ constexpr auto loada = vfloat4::loada;
+ constexpr auto load1 = vfloat4::load1;
+
+#elif ASTCENC_NEON > 0
+ /* If we have NEON expose 4-wide VLA. */
+ #include "astcenc_vecmathlib_neon_4.h"
+ #include "astcenc_vecmathlib_common_4.h"
+
+ #define ASTCENC_SIMD_WIDTH 4
+
+ using vfloat = vfloat4;
+ using vfloatacc = vfloat4;
+ using vint = vint4;
+ using vmask = vmask4;
+
+ constexpr auto loada = vfloat4::loada;
+ constexpr auto load1 = vfloat4::load1;
+
+#else
+ // If we have nothing expose 4-wide VLA, and 4-wide fixed width.
+
+ // Note: We no longer expose the 1-wide scalar fallback because it is not
+ // invariant with the 4-wide path due to algorithms that use horizontal
+ // operations that accumulate a local vector sum before accumulating into
+ // a running sum.
+ //
+ // For 4 items adding into an accumulator using 1-wide vectors the sum is:
+ //
+ // result = ((((sum + l0) + l1) + l2) + l3)
+ //
+ // ... whereas the accumulator for a 4-wide vector sum is:
+ //
+ // result = sum + ((l0 + l2) + (l1 + l3))
+ //
+ // In "normal maths" this is the same, but the floating point reassociation
+ // differences mean that these will not produce the same result.
+
+ #include "astcenc_vecmathlib_none_4.h"
+ #include "astcenc_vecmathlib_common_4.h"
+
+ #define ASTCENC_SIMD_WIDTH 4
+
+ using vfloat = vfloat4;
+ using vfloatacc = vfloat4;
+ using vint = vint4;
+ using vmask = vmask4;
+
+ constexpr auto loada = vfloat4::loada;
+ constexpr auto load1 = vfloat4::load1;
+#endif
+
+/**
+ * @brief Round a count down to the largest multiple of 8.
+ *
+ * @param count The unrounded value.
+ *
+ * @return The rounded value.
+ */
+ASTCENC_SIMD_INLINE unsigned int round_down_to_simd_multiple_8(unsigned int count)
+{
+ return count & static_cast<unsigned int>(~(8 - 1));
+}
+
+/**
+ * @brief Round a count down to the largest multiple of 4.
+ *
+ * @param count The unrounded value.
+ *
+ * @return The rounded value.
+ */
+ASTCENC_SIMD_INLINE unsigned int round_down_to_simd_multiple_4(unsigned int count)
+{
+ return count & static_cast<unsigned int>(~(4 - 1));
+}
+
+/**
+ * @brief Round a count down to the largest multiple of the SIMD width.
+ *
+ * Assumption that the vector width is a power of two ...
+ *
+ * @param count The unrounded value.
+ *
+ * @return The rounded value.
+ */
+ASTCENC_SIMD_INLINE unsigned int round_down_to_simd_multiple_vla(unsigned int count)
+{
+ return count & static_cast<unsigned int>(~(ASTCENC_SIMD_WIDTH - 1));
+}
+
+/**
+ * @brief Round a count up to the largest multiple of the SIMD width.
+ *
+ * Assumption that the vector width is a power of two ...
+ *
+ * @param count The unrounded value.
+ *
+ * @return The rounded value.
+ */
+ASTCENC_SIMD_INLINE unsigned int round_up_to_simd_multiple_vla(unsigned int count)
+{
+ unsigned int multiples = (count + ASTCENC_SIMD_WIDTH - 1) / ASTCENC_SIMD_WIDTH;
+ return multiples * ASTCENC_SIMD_WIDTH;
+}
+
+/**
+ * @brief Return @c a with lanes negated if the @c b lane is negative.
+ */
+ASTCENC_SIMD_INLINE vfloat change_sign(vfloat a, vfloat b)
+{
+ vint ia = float_as_int(a);
+ vint ib = float_as_int(b);
+ vint sign_mask(static_cast<int>(0x80000000));
+ vint r = ia ^ (ib & sign_mask);
+ return int_as_float(r);
+}
+
+/**
+ * @brief Return fast, but approximate, vector atan(x).
+ *
+ * Max error of this implementation is 0.004883.
+ */
+ASTCENC_SIMD_INLINE vfloat atan(vfloat x)
+{
+ vmask c = abs(x) > vfloat(1.0f);
+ vfloat z = change_sign(vfloat(astc::PI_OVER_TWO), x);
+ vfloat y = select(x, vfloat(1.0f) / x, c);
+ y = y / (y * y * vfloat(0.28f) + vfloat(1.0f));
+ return select(y, z - y, c);
+}
+
+/**
+ * @brief Return fast, but approximate, vector atan2(x, y).
+ */
+ASTCENC_SIMD_INLINE vfloat atan2(vfloat y, vfloat x)
+{
+ vfloat z = atan(abs(y / x));
+ vmask xmask = vmask(float_as_int(x).m);
+ return change_sign(select_msb(z, vfloat(astc::PI) - z, xmask), y);
+}
+
+/*
+ * @brief Factory that returns a unit length 4 component vfloat4.
+ */
+static ASTCENC_SIMD_INLINE vfloat4 unit4()
+{
+ return vfloat4(0.5f);
+}
+
+/**
+ * @brief Factory that returns a unit length 3 component vfloat4.
+ */
+static ASTCENC_SIMD_INLINE vfloat4 unit3()
+{
+ float val = 0.577350258827209473f;
+ return vfloat4(val, val, val, 0.0f);
+}
+
+/**
+ * @brief Factory that returns a unit length 2 component vfloat4.
+ */
+static ASTCENC_SIMD_INLINE vfloat4 unit2()
+{
+ float val = 0.707106769084930420f;
+ return vfloat4(val, val, 0.0f, 0.0f);
+}
+
+/**
+ * @brief Factory that returns a 3 component vfloat4.
+ */
+static ASTCENC_SIMD_INLINE vfloat4 vfloat3(float a, float b, float c)
+{
+ return vfloat4(a, b, c, 0.0f);
+}
+
+/**
+ * @brief Factory that returns a 2 component vfloat4.
+ */
+static ASTCENC_SIMD_INLINE vfloat4 vfloat2(float a, float b)
+{
+ return vfloat4(a, b, 0.0f, 0.0f);
+}
+
+/**
+ * @brief Normalize a non-zero length vector to unit length.
+ */
+static ASTCENC_SIMD_INLINE vfloat4 normalize(vfloat4 a)
+{
+ vfloat4 length = dot(a, a);
+ return a / sqrt(length);
+}
+
+/**
+ * @brief Normalize a vector, returning @c safe if len is zero.
+ */
+static ASTCENC_SIMD_INLINE vfloat4 normalize_safe(vfloat4 a, vfloat4 safe)
+{
+ vfloat4 length = dot(a, a);
+ if (length.lane<0>() != 0.0f)
+ {
+ return a / sqrt(length);
+ }
+
+ return safe;
+}
+
+
+
+#define POLY0(x, c0) ( c0)
+#define POLY1(x, c0, c1) ((POLY0(x, c1) * x) + c0)
+#define POLY2(x, c0, c1, c2) ((POLY1(x, c1, c2) * x) + c0)
+#define POLY3(x, c0, c1, c2, c3) ((POLY2(x, c1, c2, c3) * x) + c0)
+#define POLY4(x, c0, c1, c2, c3, c4) ((POLY3(x, c1, c2, c3, c4) * x) + c0)
+#define POLY5(x, c0, c1, c2, c3, c4, c5) ((POLY4(x, c1, c2, c3, c4, c5) * x) + c0)
+
+/**
+ * @brief Compute an approximate exp2(x) for each lane in the vector.
+ *
+ * Based on 5th degree minimax polynomials, ported from this blog
+ * https://jrfonseca.blogspot.com/2008/09/fast-sse2-pow-tables-or-polynomials.html
+ */
+static ASTCENC_SIMD_INLINE vfloat4 exp2(vfloat4 x)
+{
+ x = clamp(-126.99999f, 129.0f, x);
+
+ vint4 ipart = float_to_int(x - 0.5f);
+ vfloat4 fpart = x - int_to_float(ipart);
+
+ // Integer contrib, using 1 << ipart
+ vfloat4 iexp = int_as_float(lsl<23>(ipart + 127));
+
+ // Fractional contrib, using polynomial fit of 2^x in range [-0.5, 0.5)
+ vfloat4 fexp = POLY5(fpart,
+ 9.9999994e-1f,
+ 6.9315308e-1f,
+ 2.4015361e-1f,
+ 5.5826318e-2f,
+ 8.9893397e-3f,
+ 1.8775767e-3f);
+
+ return iexp * fexp;
+}
+
+/**
+ * @brief Compute an approximate log2(x) for each lane in the vector.
+ *
+ * Based on 5th degree minimax polynomials, ported from this blog
+ * https://jrfonseca.blogspot.com/2008/09/fast-sse2-pow-tables-or-polynomials.html
+ */
+static ASTCENC_SIMD_INLINE vfloat4 log2(vfloat4 x)
+{
+ vint4 exp(0x7F800000);
+ vint4 mant(0x007FFFFF);
+ vint4 one(0x3F800000);
+
+ vint4 i = float_as_int(x);
+
+ vfloat4 e = int_to_float(lsr<23>(i & exp) - 127);
+
+ vfloat4 m = int_as_float((i & mant) | one);
+
+ // Polynomial fit of log2(x)/(x - 1), for x in range [1, 2)
+ vfloat4 p = POLY4(m,
+ 2.8882704548164776201f,
+ -2.52074962577807006663f,
+ 1.48116647521213171641f,
+ -0.465725644288844778798f,
+ 0.0596515482674574969533f);
+
+ // Increases the polynomial degree, but ensures that log2(1) == 0
+ p = p * (m - 1.0f);
+
+ return p + e;
+}
+
+/**
+ * @brief Compute an approximate pow(x, y) for each lane in the vector.
+ *
+ * Power function based on the exp2(log2(x) * y) transform.
+ */
+static ASTCENC_SIMD_INLINE vfloat4 pow(vfloat4 x, vfloat4 y)
+{
+ vmask4 zero_mask = y == vfloat4(0.0f);
+ vfloat4 estimate = exp2(log2(x) * y);
+
+ // Guarantee that y == 0 returns exactly 1.0f
+ return select(estimate, vfloat4(1.0f), zero_mask);
+}
+
+/**
+ * @brief Count the leading zeros for each lane in @c a.
+ *
+ * Valid for all data values of @c a; will return a per-lane value [0, 32].
+ */
+static ASTCENC_SIMD_INLINE vint4 clz(vint4 a)
+{
+ // This function is a horrible abuse of floating point exponents to convert
+ // the original integer value into a 2^N encoding we can recover easily.
+
+ // Convert to float without risk of rounding up by keeping only top 8 bits.
+ // This trick is is guranteed to keep top 8 bits and clear the 9th.
+ a = (~lsr<8>(a)) & a;
+ a = float_as_int(int_to_float(a));
+
+ // Extract and unbias exponent
+ a = vint4(127 + 31) - lsr<23>(a);
+
+ // Clamp result to a valid 32-bit range
+ return clamp(0, 32, a);
+}
+
+/**
+ * @brief Return lanewise 2^a for each lane in @c a.
+ *
+ * Use of signed int means that this is only valid for values in range [0, 31].
+ */
+static ASTCENC_SIMD_INLINE vint4 two_to_the_n(vint4 a)
+{
+ // 2^30 is the largest signed number than can be represented
+ assert(all(a < vint4(31)));
+
+ // This function is a horrible abuse of floating point to use the exponent
+ // and float conversion to generate a 2^N multiple.
+
+ // Bias the exponent
+ vint4 exp = a + 127;
+ exp = lsl<23>(exp);
+
+ // Reinterpret the bits as a float, and then convert to an int
+ vfloat4 f = int_as_float(exp);
+ return float_to_int(f);
+}
+
+/**
+ * @brief Convert unorm16 [0, 65535] to float16 in range [0, 1].
+ */
+static ASTCENC_SIMD_INLINE vint4 unorm16_to_sf16(vint4 p)
+{
+ vint4 fp16_one = vint4(0x3C00);
+ vint4 fp16_small = lsl<8>(p);
+
+ vmask4 is_one = p == vint4(0xFFFF);
+ vmask4 is_small = p < vint4(4);
+
+ // Manually inline clz() on Visual Studio to avoid release build codegen bug
+ // see https://github.com/ARM-software/astc-encoder/issues/259
+#if !defined(__clang__) && defined(_MSC_VER)
+ vint4 a = (~lsr<8>(p)) & p;
+ a = float_as_int(int_to_float(a));
+ a = vint4(127 + 31) - lsr<23>(a);
+ vint4 lz = clamp(0, 32, a) - 16;
+#else
+ vint4 lz = clz(p) - 16;
+#endif
+
+ p = p * two_to_the_n(lz + 1);
+ p = p & vint4(0xFFFF);
+
+ p = lsr<6>(p);
+
+ p = p | lsl<10>(vint4(14) - lz);
+
+ vint4 r = select(p, fp16_one, is_one);
+ r = select(r, fp16_small, is_small);
+ return r;
+}
+
+/**
+ * @brief Convert 16-bit LNS to float16.
+ */
+static ASTCENC_SIMD_INLINE vint4 lns_to_sf16(vint4 p)
+{
+ vint4 mc = p & 0x7FF;
+ vint4 ec = lsr<11>(p);
+
+ vint4 mc_512 = mc * 3;
+ vmask4 mask_512 = mc < vint4(512);
+
+ vint4 mc_1536 = mc * 4 - 512;
+ vmask4 mask_1536 = mc < vint4(1536);
+
+ vint4 mc_else = mc * 5 - 2048;
+
+ vint4 mt = mc_else;
+ mt = select(mt, mc_1536, mask_1536);
+ mt = select(mt, mc_512, mask_512);
+
+ vint4 res = lsl<10>(ec) | lsr<3>(mt);
+ return min(res, vint4(0x7BFF));
+}
+
+/**
+ * @brief Extract mantissa and exponent of a float value.
+ *
+ * @param a The input value.
+ * @param[out] exp The output exponent.
+ *
+ * @return The mantissa.
+ */
+static ASTCENC_SIMD_INLINE vfloat4 frexp(vfloat4 a, vint4& exp)
+{
+ // Interpret the bits as an integer
+ vint4 ai = float_as_int(a);
+
+ // Extract and unbias the exponent
+ exp = (lsr<23>(ai) & 0xFF) - 126;
+
+ // Extract and unbias the mantissa
+ vint4 manti = (ai & static_cast<int>(0x807FFFFF)) | 0x3F000000;
+ return int_as_float(manti);
+}
+
+/**
+ * @brief Convert float to 16-bit LNS.
+ */
+static ASTCENC_SIMD_INLINE vfloat4 float_to_lns(vfloat4 a)
+{
+ vint4 exp;
+ vfloat4 mant = frexp(a, exp);
+
+ // Do these early before we start messing about ...
+ vmask4 mask_underflow_nan = ~(a > vfloat4(1.0f / 67108864.0f));
+ vmask4 mask_infinity = a >= vfloat4(65536.0f);
+
+ // If input is smaller than 2^-14, multiply by 2^25 and don't bias.
+ vmask4 exp_lt_m13 = exp < vint4(-13);
+
+ vfloat4 a1a = a * 33554432.0f;
+ vint4 expa = vint4::zero();
+
+ vfloat4 a1b = (mant - 0.5f) * 4096;
+ vint4 expb = exp + 14;
+
+ a = select(a1b, a1a, exp_lt_m13);
+ exp = select(expb, expa, exp_lt_m13);
+
+ vmask4 a_lt_384 = a < vfloat4(384.0f);
+ vmask4 a_lt_1408 = a <= vfloat4(1408.0f);
+
+ vfloat4 a2a = a * (4.0f / 3.0f);
+ vfloat4 a2b = a + 128.0f;
+ vfloat4 a2c = (a + 512.0f) * (4.0f / 5.0f);
+
+ a = a2c;
+ a = select(a, a2b, a_lt_1408);
+ a = select(a, a2a, a_lt_384);
+
+ a = a + (int_to_float(exp) * 2048.0f) + 1.0f;
+
+ a = select(a, vfloat4(65535.0f), mask_infinity);
+ a = select(a, vfloat4::zero(), mask_underflow_nan);
+
+ return a;
+}
+
+namespace astc
+{
+
+static ASTCENC_SIMD_INLINE float pow(float x, float y)
+{
+ return pow(vfloat4(x), vfloat4(y)).lane<0>();
+}
+
+}
+
+#endif // #ifndef ASTC_VECMATHLIB_H_INCLUDED
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_avx2_8.h b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_avx2_8.h
new file mode 100644
index 00000000000..a785aca75b2
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_avx2_8.h
@@ -0,0 +1,1204 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2019-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief 8x32-bit vectors, implemented using AVX2.
+ *
+ * This module implements 8-wide 32-bit float, int, and mask vectors for x86
+ * AVX2.
+ *
+ * There is a baseline level of functionality provided by all vector widths and
+ * implementations. This is implemented using identical function signatures,
+ * modulo data type, so we can use them as substitutable implementations in VLA
+ * code.
+ */
+
+#ifndef ASTC_VECMATHLIB_AVX2_8_H_INCLUDED
+#define ASTC_VECMATHLIB_AVX2_8_H_INCLUDED
+
+#ifndef ASTCENC_SIMD_INLINE
+ #error "Include astcenc_vecmathlib.h, do not include directly"
+#endif
+
+#include <cstdio>
+
+// Define convenience intrinsics that are missing on older compilers
+#define astcenc_mm256_set_m128i(m, n) _mm256_insertf128_si256(_mm256_castsi128_si256((n)), (m), 1)
+
+// ============================================================================
+// vfloat8 data type
+// ============================================================================
+
+/**
+ * @brief Data type for 8-wide floats.
+ */
+struct vfloat8
+{
+ /**
+ * @brief Construct from zero-initialized value.
+ */
+ ASTCENC_SIMD_INLINE vfloat8() = default;
+
+ /**
+ * @brief Construct from 4 values loaded from an unaligned address.
+ *
+ * Consider using loada() which is better with vectors if data is aligned
+ * to vector length.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat8(const float *p)
+ {
+ m = _mm256_loadu_ps(p);
+ }
+
+ /**
+ * @brief Construct from 1 scalar value replicated across all lanes.
+ *
+ * Consider using zero() for constexpr zeros.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat8(float a)
+ {
+ m = _mm256_set1_ps(a);
+ }
+
+ /**
+ * @brief Construct from 8 scalar values.
+ *
+ * The value of @c a is stored to lane 0 (LSB) in the SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat8(
+ float a, float b, float c, float d,
+ float e, float f, float g, float h)
+ {
+ m = _mm256_set_ps(h, g, f, e, d, c, b, a);
+ }
+
+ /**
+ * @brief Construct from an existing SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat8(__m256 a)
+ {
+ m = a;
+ }
+
+ /**
+ * @brief Get the scalar value of a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE float lane() const
+ {
+ #if !defined(__clang__) && defined(_MSC_VER)
+ return m.m256_f32[l];
+ #else
+ union { __m256 m; float f[8]; } cvt;
+ cvt.m = m;
+ return cvt.f[l];
+ #endif
+ }
+
+ /**
+ * @brief Factory that returns a vector of zeros.
+ */
+ static ASTCENC_SIMD_INLINE vfloat8 zero()
+ {
+ return vfloat8(_mm256_setzero_ps());
+ }
+
+ /**
+ * @brief Factory that returns a replicated scalar loaded from memory.
+ */
+ static ASTCENC_SIMD_INLINE vfloat8 load1(const float* p)
+ {
+ return vfloat8(_mm256_broadcast_ss(p));
+ }
+
+ /**
+ * @brief Factory that returns a vector loaded from 32B aligned memory.
+ */
+ static ASTCENC_SIMD_INLINE vfloat8 loada(const float* p)
+ {
+ return vfloat8(_mm256_load_ps(p));
+ }
+
+ /**
+ * @brief Factory that returns a vector containing the lane IDs.
+ */
+ static ASTCENC_SIMD_INLINE vfloat8 lane_id()
+ {
+ return vfloat8(_mm256_set_ps(7, 6, 5, 4, 3, 2, 1, 0));
+ }
+
+ /**
+ * @brief The vector ...
+ */
+ __m256 m;
+};
+
+// ============================================================================
+// vint8 data type
+// ============================================================================
+
+/**
+ * @brief Data type for 8-wide ints.
+ */
+struct vint8
+{
+ /**
+ * @brief Construct from zero-initialized value.
+ */
+ ASTCENC_SIMD_INLINE vint8() = default;
+
+ /**
+ * @brief Construct from 8 values loaded from an unaligned address.
+ *
+ * Consider using loada() which is better with vectors if data is aligned
+ * to vector length.
+ */
+ ASTCENC_SIMD_INLINE explicit vint8(const int *p)
+ {
+ m = _mm256_loadu_si256(reinterpret_cast<const __m256i*>(p));
+ }
+
+ /**
+ * @brief Construct from 8 uint8_t loaded from an unaligned address.
+ */
+ ASTCENC_SIMD_INLINE explicit vint8(const uint8_t *p)
+ {
+ // _mm_loadu_si64 would be nicer syntax, but missing on older GCC
+ m = _mm256_cvtepu8_epi32(_mm_cvtsi64_si128(*reinterpret_cast<const long long*>(p)));
+ }
+
+ /**
+ * @brief Construct from 1 scalar value replicated across all lanes.
+ *
+ * Consider using vfloat4::zero() for constexpr zeros.
+ */
+ ASTCENC_SIMD_INLINE explicit vint8(int a)
+ {
+ m = _mm256_set1_epi32(a);
+ }
+
+ /**
+ * @brief Construct from 8 scalar values.
+ *
+ * The value of @c a is stored to lane 0 (LSB) in the SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vint8(
+ int a, int b, int c, int d,
+ int e, int f, int g, int h)
+ {
+ m = _mm256_set_epi32(h, g, f, e, d, c, b, a);
+ }
+
+ /**
+ * @brief Construct from an existing SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vint8(__m256i a)
+ {
+ m = a;
+ }
+
+ /**
+ * @brief Get the scalar from a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE int lane() const
+ {
+ #if !defined(__clang__) && defined(_MSC_VER)
+ return m.m256i_i32[l];
+ #else
+ union { __m256i m; int f[8]; } cvt;
+ cvt.m = m;
+ return cvt.f[l];
+ #endif
+ }
+
+ /**
+ * @brief Factory that returns a vector of zeros.
+ */
+ static ASTCENC_SIMD_INLINE vint8 zero()
+ {
+ return vint8(_mm256_setzero_si256());
+ }
+
+ /**
+ * @brief Factory that returns a replicated scalar loaded from memory.
+ */
+ static ASTCENC_SIMD_INLINE vint8 load1(const int* p)
+ {
+ __m128i a = _mm_set1_epi32(*p);
+ return vint8(_mm256_broadcastd_epi32(a));
+ }
+
+ /**
+ * @brief Factory that returns a vector loaded from 32B aligned memory.
+ */
+ static ASTCENC_SIMD_INLINE vint8 loada(const int* p)
+ {
+ return vint8(_mm256_load_si256(reinterpret_cast<const __m256i*>(p)));
+ }
+
+ /**
+ * @brief Factory that returns a vector containing the lane IDs.
+ */
+ static ASTCENC_SIMD_INLINE vint8 lane_id()
+ {
+ return vint8(_mm256_set_epi32(7, 6, 5, 4, 3, 2, 1, 0));
+ }
+
+ /**
+ * @brief The vector ...
+ */
+ __m256i m;
+};
+
+// ============================================================================
+// vmask8 data type
+// ============================================================================
+
+/**
+ * @brief Data type for 8-wide control plane masks.
+ */
+struct vmask8
+{
+ /**
+ * @brief Construct from an existing SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask8(__m256 a)
+ {
+ m = a;
+ }
+
+ /**
+ * @brief Construct from an existing SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask8(__m256i a)
+ {
+ m = _mm256_castsi256_ps(a);
+ }
+
+ /**
+ * @brief Construct from 1 scalar value.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask8(bool a)
+ {
+ vint8 mask(a == false ? 0 : -1);
+ m = _mm256_castsi256_ps(mask.m);
+ }
+
+ /**
+ * @brief The vector ...
+ */
+ __m256 m;
+};
+
+// ============================================================================
+// vmask8 operators and functions
+// ============================================================================
+
+/**
+ * @brief Overload: mask union (or).
+ */
+ASTCENC_SIMD_INLINE vmask8 operator|(vmask8 a, vmask8 b)
+{
+ return vmask8(_mm256_or_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: mask intersect (and).
+ */
+ASTCENC_SIMD_INLINE vmask8 operator&(vmask8 a, vmask8 b)
+{
+ return vmask8(_mm256_and_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: mask difference (xor).
+ */
+ASTCENC_SIMD_INLINE vmask8 operator^(vmask8 a, vmask8 b)
+{
+ return vmask8(_mm256_xor_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: mask invert (not).
+ */
+ASTCENC_SIMD_INLINE vmask8 operator~(vmask8 a)
+{
+ return vmask8(_mm256_xor_si256(_mm256_castps_si256(a.m), _mm256_set1_epi32(-1)));
+}
+
+/**
+ * @brief Return a 8-bit mask code indicating mask status.
+ *
+ * bit0 = lane 0
+ */
+ASTCENC_SIMD_INLINE unsigned int mask(vmask8 a)
+{
+ return static_cast<unsigned int>(_mm256_movemask_ps(a.m));
+}
+
+/**
+ * @brief True if any lanes are enabled, false otherwise.
+ */
+ASTCENC_SIMD_INLINE bool any(vmask8 a)
+{
+ return mask(a) != 0;
+}
+
+/**
+ * @brief True if all lanes are enabled, false otherwise.
+ */
+ASTCENC_SIMD_INLINE bool all(vmask8 a)
+{
+ return mask(a) == 0xFF;
+}
+
+// ============================================================================
+// vint8 operators and functions
+// ============================================================================
+/**
+ * @brief Overload: vector by vector addition.
+ */
+ASTCENC_SIMD_INLINE vint8 operator+(vint8 a, vint8 b)
+{
+ return vint8(_mm256_add_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector incremental addition.
+ */
+ASTCENC_SIMD_INLINE vint8& operator+=(vint8& a, const vint8& b)
+{
+ a = a + b;
+ return a;
+}
+
+/**
+ * @brief Overload: vector by vector subtraction.
+ */
+ASTCENC_SIMD_INLINE vint8 operator-(vint8 a, vint8 b)
+{
+ return vint8(_mm256_sub_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector multiplication.
+ */
+ASTCENC_SIMD_INLINE vint8 operator*(vint8 a, vint8 b)
+{
+ return vint8(_mm256_mullo_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector bit invert.
+ */
+ASTCENC_SIMD_INLINE vint8 operator~(vint8 a)
+{
+ return vint8(_mm256_xor_si256(a.m, _mm256_set1_epi32(-1)));
+}
+
+/**
+ * @brief Overload: vector by vector bitwise or.
+ */
+ASTCENC_SIMD_INLINE vint8 operator|(vint8 a, vint8 b)
+{
+ return vint8(_mm256_or_si256(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector bitwise and.
+ */
+ASTCENC_SIMD_INLINE vint8 operator&(vint8 a, vint8 b)
+{
+ return vint8(_mm256_and_si256(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector bitwise xor.
+ */
+ASTCENC_SIMD_INLINE vint8 operator^(vint8 a, vint8 b)
+{
+ return vint8(_mm256_xor_si256(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector equality.
+ */
+ASTCENC_SIMD_INLINE vmask8 operator==(vint8 a, vint8 b)
+{
+ return vmask8(_mm256_cmpeq_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector inequality.
+ */
+ASTCENC_SIMD_INLINE vmask8 operator!=(vint8 a, vint8 b)
+{
+ return ~vmask8(_mm256_cmpeq_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector less than.
+ */
+ASTCENC_SIMD_INLINE vmask8 operator<(vint8 a, vint8 b)
+{
+ return vmask8(_mm256_cmpgt_epi32(b.m, a.m));
+}
+
+/**
+ * @brief Overload: vector by vector greater than.
+ */
+ASTCENC_SIMD_INLINE vmask8 operator>(vint8 a, vint8 b)
+{
+ return vmask8(_mm256_cmpgt_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Logical shift left.
+ */
+template <int s> ASTCENC_SIMD_INLINE vint8 lsl(vint8 a)
+{
+ return vint8(_mm256_slli_epi32(a.m, s));
+}
+
+/**
+ * @brief Arithmetic shift right.
+ */
+template <int s> ASTCENC_SIMD_INLINE vint8 asr(vint8 a)
+{
+ return vint8(_mm256_srai_epi32(a.m, s));
+}
+
+/**
+ * @brief Logical shift right.
+ */
+template <int s> ASTCENC_SIMD_INLINE vint8 lsr(vint8 a)
+{
+ return vint8(_mm256_srli_epi32(a.m, s));
+}
+
+/**
+ * @brief Return the min vector of two vectors.
+ */
+ASTCENC_SIMD_INLINE vint8 min(vint8 a, vint8 b)
+{
+ return vint8(_mm256_min_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Return the max vector of two vectors.
+ */
+ASTCENC_SIMD_INLINE vint8 max(vint8 a, vint8 b)
+{
+ return vint8(_mm256_max_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Return the horizontal minimum of a vector.
+ */
+ASTCENC_SIMD_INLINE vint8 hmin(vint8 a)
+{
+ __m128i m = _mm_min_epi32(_mm256_extracti128_si256(a.m, 0), _mm256_extracti128_si256(a.m, 1));
+ m = _mm_min_epi32(m, _mm_shuffle_epi32(m, _MM_SHUFFLE(0,0,3,2)));
+ m = _mm_min_epi32(m, _mm_shuffle_epi32(m, _MM_SHUFFLE(0,0,0,1)));
+ m = _mm_shuffle_epi32(m, _MM_SHUFFLE(0,0,0,0));
+
+ __m256i r = astcenc_mm256_set_m128i(m, m);
+ vint8 vmin(r);
+ return vmin;
+}
+
+/**
+ * @brief Return the horizontal maximum of a vector.
+ */
+ASTCENC_SIMD_INLINE vint8 hmax(vint8 a)
+{
+ __m128i m = _mm_max_epi32(_mm256_extracti128_si256(a.m, 0), _mm256_extracti128_si256(a.m, 1));
+ m = _mm_max_epi32(m, _mm_shuffle_epi32(m, _MM_SHUFFLE(0,0,3,2)));
+ m = _mm_max_epi32(m, _mm_shuffle_epi32(m, _MM_SHUFFLE(0,0,0,1)));
+ m = _mm_shuffle_epi32(m, _MM_SHUFFLE(0,0,0,0));
+
+ __m256i r = astcenc_mm256_set_m128i(m, m);
+ vint8 vmax(r);
+ return vmax;
+}
+
+/**
+ * @brief Store a vector to a 16B aligned memory address.
+ */
+ASTCENC_SIMD_INLINE void storea(vint8 a, int* p)
+{
+ _mm256_store_si256(reinterpret_cast<__m256i*>(p), a.m);
+}
+
+/**
+ * @brief Store a vector to an unaligned memory address.
+ */
+ASTCENC_SIMD_INLINE void store(vint8 a, int* p)
+{
+ _mm256_storeu_si256(reinterpret_cast<__m256i*>(p), a.m);
+}
+
+/**
+ * @brief Store lowest N (vector width) bytes into an unaligned address.
+ */
+ASTCENC_SIMD_INLINE void store_nbytes(vint8 a, uint8_t* p)
+{
+ // This is the most logical implementation, but the convenience intrinsic
+ // is missing on older compilers (supported in g++ 9 and clang++ 9).
+ // _mm_storeu_si64(ptr, _mm256_extracti128_si256(v.m, 0))
+ _mm_storel_epi64(reinterpret_cast<__m128i*>(p), _mm256_extracti128_si256(a.m, 0));
+}
+
+/**
+ * @brief Gather N (vector width) indices from the array.
+ */
+ASTCENC_SIMD_INLINE vint8 gatheri(const int* base, vint8 indices)
+{
+ return vint8(_mm256_i32gather_epi32(base, indices.m, 4));
+}
+
+/**
+ * @brief Pack low 8 bits of N (vector width) lanes into bottom of vector.
+ */
+ASTCENC_SIMD_INLINE vint8 pack_low_bytes(vint8 v)
+{
+ __m256i shuf = _mm256_set_epi8(0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 28, 24, 20, 16,
+ 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 12, 8, 4, 0);
+ __m256i a = _mm256_shuffle_epi8(v.m, shuf);
+ __m128i a0 = _mm256_extracti128_si256(a, 0);
+ __m128i a1 = _mm256_extracti128_si256(a, 1);
+ __m128i b = _mm_unpacklo_epi32(a0, a1);
+
+ __m256i r = astcenc_mm256_set_m128i(b, b);
+ return vint8(r);
+}
+
+/**
+ * @brief Return lanes from @c b if @c cond is set, else @c a.
+ */
+ASTCENC_SIMD_INLINE vint8 select(vint8 a, vint8 b, vmask8 cond)
+{
+ __m256i condi = _mm256_castps_si256(cond.m);
+ return vint8(_mm256_blendv_epi8(a.m, b.m, condi));
+}
+
+// ============================================================================
+// vfloat4 operators and functions
+// ============================================================================
+
+/**
+ * @brief Overload: vector by vector addition.
+ */
+ASTCENC_SIMD_INLINE vfloat8 operator+(vfloat8 a, vfloat8 b)
+{
+ return vfloat8(_mm256_add_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector incremental addition.
+ */
+ASTCENC_SIMD_INLINE vfloat8& operator+=(vfloat8& a, const vfloat8& b)
+{
+ a = a + b;
+ return a;
+}
+
+/**
+ * @brief Overload: vector by vector subtraction.
+ */
+ASTCENC_SIMD_INLINE vfloat8 operator-(vfloat8 a, vfloat8 b)
+{
+ return vfloat8(_mm256_sub_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector multiplication.
+ */
+ASTCENC_SIMD_INLINE vfloat8 operator*(vfloat8 a, vfloat8 b)
+{
+ return vfloat8(_mm256_mul_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by scalar multiplication.
+ */
+ASTCENC_SIMD_INLINE vfloat8 operator*(vfloat8 a, float b)
+{
+ return vfloat8(_mm256_mul_ps(a.m, _mm256_set1_ps(b)));
+}
+
+/**
+ * @brief Overload: scalar by vector multiplication.
+ */
+ASTCENC_SIMD_INLINE vfloat8 operator*(float a, vfloat8 b)
+{
+ return vfloat8(_mm256_mul_ps(_mm256_set1_ps(a), b.m));
+}
+
+/**
+ * @brief Overload: vector by vector division.
+ */
+ASTCENC_SIMD_INLINE vfloat8 operator/(vfloat8 a, vfloat8 b)
+{
+ return vfloat8(_mm256_div_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by scalar division.
+ */
+ASTCENC_SIMD_INLINE vfloat8 operator/(vfloat8 a, float b)
+{
+ return vfloat8(_mm256_div_ps(a.m, _mm256_set1_ps(b)));
+}
+
+
+/**
+ * @brief Overload: scalar by vector division.
+ */
+ASTCENC_SIMD_INLINE vfloat8 operator/(float a, vfloat8 b)
+{
+ return vfloat8(_mm256_div_ps(_mm256_set1_ps(a), b.m));
+}
+
+
+/**
+ * @brief Overload: vector by vector equality.
+ */
+ASTCENC_SIMD_INLINE vmask8 operator==(vfloat8 a, vfloat8 b)
+{
+ return vmask8(_mm256_cmp_ps(a.m, b.m, _CMP_EQ_OQ));
+}
+
+/**
+ * @brief Overload: vector by vector inequality.
+ */
+ASTCENC_SIMD_INLINE vmask8 operator!=(vfloat8 a, vfloat8 b)
+{
+ return vmask8(_mm256_cmp_ps(a.m, b.m, _CMP_NEQ_OQ));
+}
+
+/**
+ * @brief Overload: vector by vector less than.
+ */
+ASTCENC_SIMD_INLINE vmask8 operator<(vfloat8 a, vfloat8 b)
+{
+ return vmask8(_mm256_cmp_ps(a.m, b.m, _CMP_LT_OQ));
+}
+
+/**
+ * @brief Overload: vector by vector greater than.
+ */
+ASTCENC_SIMD_INLINE vmask8 operator>(vfloat8 a, vfloat8 b)
+{
+ return vmask8(_mm256_cmp_ps(a.m, b.m, _CMP_GT_OQ));
+}
+
+/**
+ * @brief Overload: vector by vector less than or equal.
+ */
+ASTCENC_SIMD_INLINE vmask8 operator<=(vfloat8 a, vfloat8 b)
+{
+ return vmask8(_mm256_cmp_ps(a.m, b.m, _CMP_LE_OQ));
+}
+
+/**
+ * @brief Overload: vector by vector greater than or equal.
+ */
+ASTCENC_SIMD_INLINE vmask8 operator>=(vfloat8 a, vfloat8 b)
+{
+ return vmask8(_mm256_cmp_ps(a.m, b.m, _CMP_GE_OQ));
+}
+
+/**
+ * @brief Return the min vector of two vectors.
+ *
+ * If either lane value is NaN, @c b will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat8 min(vfloat8 a, vfloat8 b)
+{
+ return vfloat8(_mm256_min_ps(a.m, b.m));
+}
+
+/**
+ * @brief Return the min vector of a vector and a scalar.
+ *
+ * If either lane value is NaN, @c b will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat8 min(vfloat8 a, float b)
+{
+ return min(a, vfloat8(b));
+}
+
+/**
+ * @brief Return the max vector of two vectors.
+ *
+ * If either lane value is NaN, @c b will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat8 max(vfloat8 a, vfloat8 b)
+{
+ return vfloat8(_mm256_max_ps(a.m, b.m));
+}
+
+/**
+ * @brief Return the max vector of a vector and a scalar.
+ *
+ * If either lane value is NaN, @c b will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat8 max(vfloat8 a, float b)
+{
+ return max(a, vfloat8(b));
+}
+
+/**
+ * @brief Return the clamped value between min and max.
+ *
+ * It is assumed that neither @c min nor @c max are NaN values. If @c a is NaN
+ * then @c min will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat8 clamp(float min, float max, vfloat8 a)
+{
+ // Do not reorder - second operand will return if either is NaN
+ a.m = _mm256_max_ps(a.m, _mm256_set1_ps(min));
+ a.m = _mm256_min_ps(a.m, _mm256_set1_ps(max));
+ return a;
+}
+
+/**
+ * @brief Return a clamped value between 0.0f and max.
+ *
+ * It is assumed that @c max is not a NaN value. If @c a is NaN then zero will
+ * be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat8 clampz(float max, vfloat8 a)
+{
+ a.m = _mm256_max_ps(a.m, _mm256_setzero_ps());
+ a.m = _mm256_min_ps(a.m, _mm256_set1_ps(max));
+ return a;
+}
+
+/**
+ * @brief Return a clamped value between 0.0f and 1.0f.
+ *
+ * If @c a is NaN then zero will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat8 clampzo(vfloat8 a)
+{
+ a.m = _mm256_max_ps(a.m, _mm256_setzero_ps());
+ a.m = _mm256_min_ps(a.m, _mm256_set1_ps(1.0f));
+ return a;
+}
+
+/**
+ * @brief Return the absolute value of the float vector.
+ */
+ASTCENC_SIMD_INLINE vfloat8 abs(vfloat8 a)
+{
+ __m256 msk = _mm256_castsi256_ps(_mm256_set1_epi32(0x7fffffff));
+ return vfloat8(_mm256_and_ps(a.m, msk));
+}
+
+/**
+ * @brief Return a float rounded to the nearest integer value.
+ */
+ASTCENC_SIMD_INLINE vfloat8 round(vfloat8 a)
+{
+ constexpr int flags = _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC;
+ return vfloat8(_mm256_round_ps(a.m, flags));
+}
+
+/**
+ * @brief Return the horizontal minimum of a vector.
+ */
+ASTCENC_SIMD_INLINE vfloat8 hmin(vfloat8 a)
+{
+ __m128 vlow = _mm256_castps256_ps128(a.m);
+ __m128 vhigh = _mm256_extractf128_ps(a.m, 1);
+ vlow = _mm_min_ps(vlow, vhigh);
+
+ // First do an horizontal reduction.
+ __m128 shuf = _mm_shuffle_ps(vlow, vlow, _MM_SHUFFLE(2, 3, 0, 1));
+ __m128 mins = _mm_min_ps(vlow, shuf);
+ shuf = _mm_movehl_ps(shuf, mins);
+ mins = _mm_min_ss(mins, shuf);
+
+ // This is the most logical implementation, but the convenience intrinsic
+ // is missing on older compilers (supported in g++ 9 and clang++ 9).
+ //__m256i r = _mm256_set_m128(m, m)
+ __m256 r = _mm256_insertf128_ps(_mm256_castps128_ps256(mins), mins, 1);
+
+ return vfloat8(_mm256_permute_ps(r, 0));
+}
+
+/**
+ * @brief Return the horizontal minimum of a vector.
+ */
+ASTCENC_SIMD_INLINE float hmin_s(vfloat8 a)
+{
+ return hmin(a).lane<0>();
+}
+
+/**
+ * @brief Return the horizontal maximum of a vector.
+ */
+ASTCENC_SIMD_INLINE vfloat8 hmax(vfloat8 a)
+{
+ __m128 vlow = _mm256_castps256_ps128(a.m);
+ __m128 vhigh = _mm256_extractf128_ps(a.m, 1);
+ vhigh = _mm_max_ps(vlow, vhigh);
+
+ // First do an horizontal reduction.
+ __m128 shuf = _mm_shuffle_ps(vhigh, vhigh, _MM_SHUFFLE(2, 3, 0, 1));
+ __m128 maxs = _mm_max_ps(vhigh, shuf);
+ shuf = _mm_movehl_ps(shuf,maxs);
+ maxs = _mm_max_ss(maxs, shuf);
+
+ // This is the most logical implementation, but the convenience intrinsic
+ // is missing on older compilers (supported in g++ 9 and clang++ 9).
+ //__m256i r = _mm256_set_m128(m, m)
+ __m256 r = _mm256_insertf128_ps(_mm256_castps128_ps256(maxs), maxs, 1);
+ return vfloat8(_mm256_permute_ps(r, 0));
+}
+
+/**
+ * @brief Return the horizontal maximum of a vector.
+ */
+ASTCENC_SIMD_INLINE float hmax_s(vfloat8 a)
+{
+ return hmax(a).lane<0>();
+}
+
+/**
+ * @brief Return the horizontal sum of a vector.
+ */
+ASTCENC_SIMD_INLINE float hadd_s(vfloat8 a)
+{
+ // Two sequential 4-wide adds gives invariance with 4-wide code
+ vfloat4 lo(_mm256_extractf128_ps(a.m, 0));
+ vfloat4 hi(_mm256_extractf128_ps(a.m, 1));
+ return hadd_s(lo) + hadd_s(hi);
+}
+
+/**
+ * @brief Return lanes from @c b if @c cond is set, else @c a.
+ */
+ASTCENC_SIMD_INLINE vfloat8 select(vfloat8 a, vfloat8 b, vmask8 cond)
+{
+ return vfloat8(_mm256_blendv_ps(a.m, b.m, cond.m));
+}
+
+/**
+ * @brief Return lanes from @c b if MSB of @c cond is set, else @c a.
+ */
+ASTCENC_SIMD_INLINE vfloat8 select_msb(vfloat8 a, vfloat8 b, vmask8 cond)
+{
+ return vfloat8(_mm256_blendv_ps(a.m, b.m, cond.m));
+}
+
+/**
+ * @brief Accumulate lane-wise sums for a vector, folded 4-wide.
+ *
+ * This is invariant with 4-wide implementations.
+ */
+ASTCENC_SIMD_INLINE void haccumulate(vfloat4& accum, vfloat8 a)
+{
+ vfloat4 lo(_mm256_extractf128_ps(a.m, 0));
+ haccumulate(accum, lo);
+
+ vfloat4 hi(_mm256_extractf128_ps(a.m, 1));
+ haccumulate(accum, hi);
+}
+
+/**
+ * @brief Accumulate lane-wise sums for a vector.
+ *
+ * This is NOT invariant with 4-wide implementations.
+ */
+ASTCENC_SIMD_INLINE void haccumulate(vfloat8& accum, vfloat8 a)
+{
+ accum += a;
+}
+
+/**
+ * @brief Accumulate masked lane-wise sums for a vector, folded 4-wide.
+ *
+ * This is invariant with 4-wide implementations.
+ */
+ASTCENC_SIMD_INLINE void haccumulate(vfloat4& accum, vfloat8 a, vmask8 m)
+{
+ a = select(vfloat8::zero(), a, m);
+ haccumulate(accum, a);
+}
+
+/**
+ * @brief Accumulate masked lane-wise sums for a vector.
+ *
+ * This is NOT invariant with 4-wide implementations.
+ */
+ASTCENC_SIMD_INLINE void haccumulate(vfloat8& accum, vfloat8 a, vmask8 m)
+{
+ a = select(vfloat8::zero(), a, m);
+ haccumulate(accum, a);
+}
+
+/**
+ * @brief Return the sqrt of the lanes in the vector.
+ */
+ASTCENC_SIMD_INLINE vfloat8 sqrt(vfloat8 a)
+{
+ return vfloat8(_mm256_sqrt_ps(a.m));
+}
+
+/**
+ * @brief Load a vector of gathered results from an array;
+ */
+ASTCENC_SIMD_INLINE vfloat8 gatherf(const float* base, vint8 indices)
+{
+ return vfloat8(_mm256_i32gather_ps(base, indices.m, 4));
+}
+
+/**
+ * @brief Store a vector to an unaligned memory address.
+ */
+ASTCENC_SIMD_INLINE void store(vfloat8 a, float* p)
+{
+ _mm256_storeu_ps(p, a.m);
+}
+
+/**
+ * @brief Store a vector to a 32B aligned memory address.
+ */
+ASTCENC_SIMD_INLINE void storea(vfloat8 a, float* p)
+{
+ _mm256_store_ps(p, a.m);
+}
+
+/**
+ * @brief Return a integer value for a float vector, using truncation.
+ */
+ASTCENC_SIMD_INLINE vint8 float_to_int(vfloat8 a)
+{
+ return vint8(_mm256_cvttps_epi32(a.m));
+}
+
+/**
+ * @brief Return a integer value for a float vector, using round-to-nearest.
+ */
+ASTCENC_SIMD_INLINE vint8 float_to_int_rtn(vfloat8 a)
+{
+ a = round(a);
+ return vint8(_mm256_cvttps_epi32(a.m));
+}
+
+
+/**
+ * @brief Return a float value for an integer vector.
+ */
+ASTCENC_SIMD_INLINE vfloat8 int_to_float(vint8 a)
+{
+ return vfloat8(_mm256_cvtepi32_ps(a.m));
+}
+
+/**
+ * @brief Return a float value as an integer bit pattern (i.e. no conversion).
+ *
+ * It is a common trick to convert floats into integer bit patterns, perform
+ * some bit hackery based on knowledge they are IEEE 754 layout, and then
+ * convert them back again. This is the first half of that flip.
+ */
+ASTCENC_SIMD_INLINE vint8 float_as_int(vfloat8 a)
+{
+ return vint8(_mm256_castps_si256(a.m));
+}
+
+/**
+ * @brief Return a integer value as a float bit pattern (i.e. no conversion).
+ *
+ * It is a common trick to convert floats into integer bit patterns, perform
+ * some bit hackery based on knowledge they are IEEE 754 layout, and then
+ * convert them back again. This is the second half of that flip.
+ */
+ASTCENC_SIMD_INLINE vfloat8 int_as_float(vint8 a)
+{
+ return vfloat8(_mm256_castsi256_ps(a.m));
+}
+
+/**
+ * @brief Prepare a vtable lookup table for use with the native SIMD size.
+ */
+ASTCENC_SIMD_INLINE void vtable_prepare(vint4 t0, vint8& t0p)
+{
+ // AVX2 duplicates the table within each 128-bit lane
+ __m128i t0n = t0.m;
+ t0p = vint8(astcenc_mm256_set_m128i(t0n, t0n));
+}
+
+/**
+ * @brief Prepare a vtable lookup table for use with the native SIMD size.
+ */
+ASTCENC_SIMD_INLINE void vtable_prepare(vint4 t0, vint4 t1, vint8& t0p, vint8& t1p)
+{
+ // AVX2 duplicates the table within each 128-bit lane
+ __m128i t0n = t0.m;
+ t0p = vint8(astcenc_mm256_set_m128i(t0n, t0n));
+
+ __m128i t1n = _mm_xor_si128(t0.m, t1.m);
+ t1p = vint8(astcenc_mm256_set_m128i(t1n, t1n));
+}
+
+/**
+ * @brief Prepare a vtable lookup table for use with the native SIMD size.
+ */
+ASTCENC_SIMD_INLINE void vtable_prepare(
+ vint4 t0, vint4 t1, vint4 t2, vint4 t3,
+ vint8& t0p, vint8& t1p, vint8& t2p, vint8& t3p)
+{
+ // AVX2 duplicates the table within each 128-bit lane
+ __m128i t0n = t0.m;
+ t0p = vint8(astcenc_mm256_set_m128i(t0n, t0n));
+
+ __m128i t1n = _mm_xor_si128(t0.m, t1.m);
+ t1p = vint8(astcenc_mm256_set_m128i(t1n, t1n));
+
+ __m128i t2n = _mm_xor_si128(t1.m, t2.m);
+ t2p = vint8(astcenc_mm256_set_m128i(t2n, t2n));
+
+ __m128i t3n = _mm_xor_si128(t2.m, t3.m);
+ t3p = vint8(astcenc_mm256_set_m128i(t3n, t3n));
+}
+
+/**
+ * @brief Perform an 8-bit 16-entry table lookup, with 32-bit indexes.
+ */
+ASTCENC_SIMD_INLINE vint8 vtable_8bt_32bi(vint8 t0, vint8 idx)
+{
+ // Set index byte MSB to 1 for unused bytes so shuffle returns zero
+ __m256i idxx = _mm256_or_si256(idx.m, _mm256_set1_epi32(static_cast<int>(0xFFFFFF00)));
+
+ __m256i result = _mm256_shuffle_epi8(t0.m, idxx);
+ return vint8(result);
+}
+
+/**
+ * @brief Perform an 8-bit 32-entry table lookup, with 32-bit indexes.
+ */
+ASTCENC_SIMD_INLINE vint8 vtable_8bt_32bi(vint8 t0, vint8 t1, vint8 idx)
+{
+ // Set index byte MSB to 1 for unused bytes so shuffle returns zero
+ __m256i idxx = _mm256_or_si256(idx.m, _mm256_set1_epi32(static_cast<int>(0xFFFFFF00)));
+
+ __m256i result = _mm256_shuffle_epi8(t0.m, idxx);
+ idxx = _mm256_sub_epi8(idxx, _mm256_set1_epi8(16));
+
+ __m256i result2 = _mm256_shuffle_epi8(t1.m, idxx);
+ result = _mm256_xor_si256(result, result2);
+ return vint8(result);
+}
+
+/**
+ * @brief Perform an 8-bit 64-entry table lookup, with 32-bit indexes.
+ */
+ASTCENC_SIMD_INLINE vint8 vtable_8bt_32bi(vint8 t0, vint8 t1, vint8 t2, vint8 t3, vint8 idx)
+{
+ // Set index byte MSB to 1 for unused bytes so shuffle returns zero
+ __m256i idxx = _mm256_or_si256(idx.m, _mm256_set1_epi32(static_cast<int>(0xFFFFFF00)));
+
+ __m256i result = _mm256_shuffle_epi8(t0.m, idxx);
+ idxx = _mm256_sub_epi8(idxx, _mm256_set1_epi8(16));
+
+ __m256i result2 = _mm256_shuffle_epi8(t1.m, idxx);
+ result = _mm256_xor_si256(result, result2);
+ idxx = _mm256_sub_epi8(idxx, _mm256_set1_epi8(16));
+
+ result2 = _mm256_shuffle_epi8(t2.m, idxx);
+ result = _mm256_xor_si256(result, result2);
+ idxx = _mm256_sub_epi8(idxx, _mm256_set1_epi8(16));
+
+ result2 = _mm256_shuffle_epi8(t3.m, idxx);
+ result = _mm256_xor_si256(result, result2);
+
+ return vint8(result);
+}
+
+/**
+ * @brief Return a vector of interleaved RGBA data.
+ *
+ * Input vectors have the value stored in the bottom 8 bits of each lane,
+ * with high bits set to zero.
+ *
+ * Output vector stores a single RGBA texel packed in each lane.
+ */
+ASTCENC_SIMD_INLINE vint8 interleave_rgba8(vint8 r, vint8 g, vint8 b, vint8 a)
+{
+ return r + lsl<8>(g) + lsl<16>(b) + lsl<24>(a);
+}
+
+/**
+ * @brief Store a vector, skipping masked lanes.
+ *
+ * All masked lanes must be at the end of vector, after all non-masked lanes.
+ */
+ASTCENC_SIMD_INLINE void store_lanes_masked(int* base, vint8 data, vmask8 mask)
+{
+ _mm256_maskstore_epi32(base, _mm256_castps_si256(mask.m), data.m);
+}
+
+/**
+ * @brief Debug function to print a vector of ints.
+ */
+ASTCENC_SIMD_INLINE void print(vint8 a)
+{
+ alignas(ASTCENC_VECALIGN) int v[8];
+ storea(a, v);
+ printf("v8_i32:\n %8d %8d %8d %8d %8d %8d %8d %8d\n",
+ v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
+}
+
+/**
+ * @brief Debug function to print a vector of ints.
+ */
+ASTCENC_SIMD_INLINE void printx(vint8 a)
+{
+ alignas(ASTCENC_VECALIGN) int v[8];
+ storea(a, v);
+ printf("v8_i32:\n %08x %08x %08x %08x %08x %08x %08x %08x\n",
+ v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7]);
+}
+
+/**
+ * @brief Debug function to print a vector of floats.
+ */
+ASTCENC_SIMD_INLINE void print(vfloat8 a)
+{
+ alignas(ASTCENC_VECALIGN) float v[8];
+ storea(a, v);
+ printf("v8_f32:\n %0.4f %0.4f %0.4f %0.4f %0.4f %0.4f %0.4f %0.4f\n",
+ static_cast<double>(v[0]), static_cast<double>(v[1]),
+ static_cast<double>(v[2]), static_cast<double>(v[3]),
+ static_cast<double>(v[4]), static_cast<double>(v[5]),
+ static_cast<double>(v[6]), static_cast<double>(v[7]));
+}
+
+/**
+ * @brief Debug function to print a vector of masks.
+ */
+ASTCENC_SIMD_INLINE void print(vmask8 a)
+{
+ print(select(vint8(0), vint8(1), a));
+}
+
+#endif // #ifndef ASTC_VECMATHLIB_AVX2_8_H_INCLUDED
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_common_4.h b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_common_4.h
new file mode 100644
index 00000000000..86ee4fd3e1f
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_common_4.h
@@ -0,0 +1,423 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2020-2021 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Generic 4x32-bit vector functions.
+ *
+ * This module implements generic 4-wide vector functions that are valid for
+ * all instruction sets, typically implemented using lower level 4-wide
+ * operations that are ISA-specific.
+ */
+
+#ifndef ASTC_VECMATHLIB_COMMON_4_H_INCLUDED
+#define ASTC_VECMATHLIB_COMMON_4_H_INCLUDED
+
+#ifndef ASTCENC_SIMD_INLINE
+ #error "Include astcenc_vecmathlib.h, do not include directly"
+#endif
+
+#include <cstdio>
+
+// ============================================================================
+// vmask4 operators and functions
+// ============================================================================
+
+/**
+ * @brief True if any lanes are enabled, false otherwise.
+ */
+ASTCENC_SIMD_INLINE bool any(vmask4 a)
+{
+ return mask(a) != 0;
+}
+
+/**
+ * @brief True if all lanes are enabled, false otherwise.
+ */
+ASTCENC_SIMD_INLINE bool all(vmask4 a)
+{
+ return mask(a) == 0xF;
+}
+
+// ============================================================================
+// vint4 operators and functions
+// ============================================================================
+
+/**
+ * @brief Overload: vector by scalar addition.
+ */
+ASTCENC_SIMD_INLINE vint4 operator+(vint4 a, int b)
+{
+ return a + vint4(b);
+}
+
+/**
+ * @brief Overload: vector by vector incremental addition.
+ */
+ASTCENC_SIMD_INLINE vint4& operator+=(vint4& a, const vint4& b)
+{
+ a = a + b;
+ return a;
+}
+
+/**
+ * @brief Overload: vector by scalar subtraction.
+ */
+ASTCENC_SIMD_INLINE vint4 operator-(vint4 a, int b)
+{
+ return a - vint4(b);
+}
+
+/**
+ * @brief Overload: vector by scalar multiplication.
+ */
+ASTCENC_SIMD_INLINE vint4 operator*(vint4 a, int b)
+{
+ return a * vint4(b);
+}
+
+/**
+ * @brief Overload: vector by scalar bitwise or.
+ */
+ASTCENC_SIMD_INLINE vint4 operator|(vint4 a, int b)
+{
+ return a | vint4(b);
+}
+
+/**
+ * @brief Overload: vector by scalar bitwise and.
+ */
+ASTCENC_SIMD_INLINE vint4 operator&(vint4 a, int b)
+{
+ return a & vint4(b);
+}
+
+/**
+ * @brief Overload: vector by scalar bitwise xor.
+ */
+ASTCENC_SIMD_INLINE vint4 operator^(vint4 a, int b)
+{
+ return a ^ vint4(b);
+}
+
+/**
+ * @brief Return the clamped value between min and max.
+ */
+ASTCENC_SIMD_INLINE vint4 clamp(int minv, int maxv, vint4 a)
+{
+ return min(max(a, vint4(minv)), vint4(maxv));
+}
+
+/**
+ * @brief Return the horizontal sum of RGB vector lanes as a scalar.
+ */
+ASTCENC_SIMD_INLINE int hadd_rgb_s(vint4 a)
+{
+ return a.lane<0>() + a.lane<1>() + a.lane<2>();
+}
+
+// ============================================================================
+// vfloat4 operators and functions
+// ============================================================================
+
+/**
+ * @brief Overload: vector by vector incremental addition.
+ */
+ASTCENC_SIMD_INLINE vfloat4& operator+=(vfloat4& a, const vfloat4& b)
+{
+ a = a + b;
+ return a;
+}
+
+/**
+ * @brief Overload: vector by scalar addition.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator+(vfloat4 a, float b)
+{
+ return a + vfloat4(b);
+}
+
+/**
+ * @brief Overload: vector by scalar subtraction.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator-(vfloat4 a, float b)
+{
+ return a - vfloat4(b);
+}
+
+/**
+ * @brief Overload: vector by scalar multiplication.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator*(vfloat4 a, float b)
+{
+ return a * vfloat4(b);
+}
+
+/**
+ * @brief Overload: scalar by vector multiplication.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator*(float a, vfloat4 b)
+{
+ return vfloat4(a) * b;
+}
+
+/**
+ * @brief Overload: vector by scalar division.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator/(vfloat4 a, float b)
+{
+ return a / vfloat4(b);
+}
+
+/**
+ * @brief Overload: scalar by vector division.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator/(float a, vfloat4 b)
+{
+ return vfloat4(a) / b;
+}
+
+/**
+ * @brief Return the min vector of a vector and a scalar.
+ *
+ * If either lane value is NaN, @c b will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat4 min(vfloat4 a, float b)
+{
+ return min(a, vfloat4(b));
+}
+
+/**
+ * @brief Return the max vector of a vector and a scalar.
+ *
+ * If either lane value is NaN, @c b will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat4 max(vfloat4 a, float b)
+{
+ return max(a, vfloat4(b));
+}
+
+/**
+ * @brief Return the clamped value between min and max.
+ *
+ * It is assumed that neither @c min nor @c max are NaN values. If @c a is NaN
+ * then @c min will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat4 clamp(float minv, float maxv, vfloat4 a)
+{
+ // Do not reorder - second operand will return if either is NaN
+ return min(max(a, minv), maxv);
+}
+
+/**
+ * @brief Return the clamped value between 0.0f and max.
+ *
+ * It is assumed that @c max is not a NaN value. If @c a is NaN then zero will
+ * be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat4 clampz(float maxv, vfloat4 a)
+{
+ // Do not reorder - second operand will return if either is NaN
+ return min(max(a, vfloat4::zero()), maxv);
+}
+
+/**
+ * @brief Return the clamped value between 0.0f and 1.0f.
+ *
+ * If @c a is NaN then zero will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat4 clampzo(vfloat4 a)
+{
+ // Do not reorder - second operand will return if either is NaN
+ return min(max(a, vfloat4::zero()), 1.0f);
+}
+
+/**
+ * @brief Return the horizontal minimum of a vector.
+ */
+ASTCENC_SIMD_INLINE float hmin_s(vfloat4 a)
+{
+ return hmin(a).lane<0>();
+}
+
+/**
+ * @brief Return the horizontal min of RGB vector lanes as a scalar.
+ */
+ASTCENC_SIMD_INLINE float hmin_rgb_s(vfloat4 a)
+{
+ a.set_lane<3>(a.lane<0>());
+ return hmin_s(a);
+}
+
+/**
+ * @brief Return the horizontal maximum of a vector.
+ */
+ASTCENC_SIMD_INLINE float hmax_s(vfloat4 a)
+{
+ return hmax(a).lane<0>();
+}
+
+/**
+ * @brief Accumulate lane-wise sums for a vector.
+ */
+ASTCENC_SIMD_INLINE void haccumulate(vfloat4& accum, vfloat4 a)
+{
+ accum = accum + a;
+}
+
+/**
+ * @brief Accumulate lane-wise sums for a masked vector.
+ */
+ASTCENC_SIMD_INLINE void haccumulate(vfloat4& accum, vfloat4 a, vmask4 m)
+{
+ a = select(vfloat4::zero(), a, m);
+ haccumulate(accum, a);
+}
+
+/**
+ * @brief Return the horizontal sum of RGB vector lanes as a scalar.
+ */
+ASTCENC_SIMD_INLINE float hadd_rgb_s(vfloat4 a)
+{
+ return a.lane<0>() + a.lane<1>() + a.lane<2>();
+}
+
+#if !defined(ASTCENC_USE_NATIVE_DOT_PRODUCT)
+
+/**
+ * @brief Return the dot product for the full 4 lanes, returning scalar.
+ */
+ASTCENC_SIMD_INLINE float dot_s(vfloat4 a, vfloat4 b)
+{
+ vfloat4 m = a * b;
+ return hadd_s(m);
+}
+
+/**
+ * @brief Return the dot product for the full 4 lanes, returning vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 dot(vfloat4 a, vfloat4 b)
+{
+ vfloat4 m = a * b;
+ return vfloat4(hadd_s(m));
+}
+
+/**
+ * @brief Return the dot product for the bottom 3 lanes, returning scalar.
+ */
+ASTCENC_SIMD_INLINE float dot3_s(vfloat4 a, vfloat4 b)
+{
+ vfloat4 m = a * b;
+ return hadd_rgb_s(m);
+}
+
+/**
+ * @brief Return the dot product for the bottom 3 lanes, returning vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 dot3(vfloat4 a, vfloat4 b)
+{
+ vfloat4 m = a * b;
+ float d3 = hadd_rgb_s(m);
+ return vfloat4(d3, d3, d3, 0.0f);
+}
+
+#endif
+
+#if !defined(ASTCENC_USE_NATIVE_POPCOUNT)
+
+/**
+ * @brief Population bit count.
+ *
+ * @param v The value to population count.
+ *
+ * @return The number of 1 bits.
+ */
+static inline int popcount(uint64_t v)
+{
+ uint64_t mask1 = 0x5555555555555555ULL;
+ uint64_t mask2 = 0x3333333333333333ULL;
+ uint64_t mask3 = 0x0F0F0F0F0F0F0F0FULL;
+ v -= (v >> 1) & mask1;
+ v = (v & mask2) + ((v >> 2) & mask2);
+ v += v >> 4;
+ v &= mask3;
+ v *= 0x0101010101010101ULL;
+ v >>= 56;
+ return static_cast<int>(v);
+}
+
+#endif
+
+/**
+ * @brief Apply signed bit transfer.
+ *
+ * @param input0 The first encoded endpoint.
+ * @param input1 The second encoded endpoint.
+ */
+static ASTCENC_SIMD_INLINE void bit_transfer_signed(
+ vint4& input0,
+ vint4& input1
+) {
+ input1 = lsr<1>(input1) | (input0 & 0x80);
+ input0 = lsr<1>(input0) & 0x3F;
+
+ vmask4 mask = (input0 & 0x20) != vint4::zero();
+ input0 = select(input0, input0 - 0x40, mask);
+}
+
+/**
+ * @brief Debug function to print a vector of ints.
+ */
+ASTCENC_SIMD_INLINE void print(vint4 a)
+{
+ alignas(16) int v[4];
+ storea(a, v);
+ printf("v4_i32:\n %8d %8d %8d %8d\n",
+ v[0], v[1], v[2], v[3]);
+}
+
+/**
+ * @brief Debug function to print a vector of ints.
+ */
+ASTCENC_SIMD_INLINE void printx(vint4 a)
+{
+ alignas(16) int v[4];
+ storea(a, v);
+ printf("v4_i32:\n %08x %08x %08x %08x\n",
+ v[0], v[1], v[2], v[3]);
+}
+
+/**
+ * @brief Debug function to print a vector of floats.
+ */
+ASTCENC_SIMD_INLINE void print(vfloat4 a)
+{
+ alignas(16) float v[4];
+ storea(a, v);
+ printf("v4_f32:\n %0.4f %0.4f %0.4f %0.4f\n",
+ static_cast<double>(v[0]), static_cast<double>(v[1]),
+ static_cast<double>(v[2]), static_cast<double>(v[3]));
+}
+
+/**
+ * @brief Debug function to print a vector of masks.
+ */
+ASTCENC_SIMD_INLINE void print(vmask4 a)
+{
+ print(select(vint4(0), vint4(1), a));
+}
+
+#endif // #ifndef ASTC_VECMATHLIB_COMMON_4_H_INCLUDED
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_neon_4.h b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_neon_4.h
new file mode 100644
index 00000000000..e668850f88f
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_neon_4.h
@@ -0,0 +1,1073 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2019-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief 4x32-bit vectors, implemented using Armv8-A NEON.
+ *
+ * This module implements 4-wide 32-bit float, int, and mask vectors for
+ * Armv8-A NEON.
+ *
+ * There is a baseline level of functionality provided by all vector widths and
+ * implementations. This is implemented using identical function signatures,
+ * modulo data type, so we can use them as substitutable implementations in VLA
+ * code.
+ *
+ * The 4-wide vectors are also used as a fixed-width type, and significantly
+ * extend the functionality above that available to VLA code.
+ */
+
+#ifndef ASTC_VECMATHLIB_NEON_4_H_INCLUDED
+#define ASTC_VECMATHLIB_NEON_4_H_INCLUDED
+
+#ifndef ASTCENC_SIMD_INLINE
+ #error "Include astcenc_vecmathlib.h, do not include directly"
+#endif
+
+#include <cstdio>
+
+// ============================================================================
+// vfloat4 data type
+// ============================================================================
+
+/**
+ * @brief Data type for 4-wide floats.
+ */
+struct vfloat4
+{
+ /**
+ * @brief Construct from zero-initialized value.
+ */
+ ASTCENC_SIMD_INLINE vfloat4() = default;
+
+ /**
+ * @brief Construct from 4 values loaded from an unaligned address.
+ *
+ * Consider using loada() which is better with vectors if data is aligned
+ * to vector length.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat4(const float *p)
+ {
+ m = vld1q_f32(p);
+ }
+
+ /**
+ * @brief Construct from 1 scalar value replicated across all lanes.
+ *
+ * Consider using zero() for constexpr zeros.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat4(float a)
+ {
+ m = vdupq_n_f32(a);
+ }
+
+ /**
+ * @brief Construct from 4 scalar values.
+ *
+ * The value of @c a is stored to lane 0 (LSB) in the SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat4(float a, float b, float c, float d)
+ {
+ float v[4] { a, b, c, d };
+ m = vld1q_f32(v);
+ }
+
+ /**
+ * @brief Construct from an existing SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat4(float32x4_t a)
+ {
+ m = a;
+ }
+
+ /**
+ * @brief Get the scalar value of a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE float lane() const
+ {
+ return vgetq_lane_f32(m, l);
+ }
+
+ /**
+ * @brief Set the scalar value of a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE void set_lane(float a)
+ {
+ m = vld1q_lane_f32(&a, m, l);
+ }
+
+ /**
+ * @brief Factory that returns a vector of zeros.
+ */
+ static ASTCENC_SIMD_INLINE vfloat4 zero()
+ {
+ return vfloat4(vdupq_n_f32(0.0f));
+ }
+
+ /**
+ * @brief Factory that returns a replicated scalar loaded from memory.
+ */
+ static ASTCENC_SIMD_INLINE vfloat4 load1(const float* p)
+ {
+ return vfloat4(vdupq_n_f32(*p));
+ }
+
+ /**
+ * @brief Factory that returns a vector loaded from 16B aligned memory.
+ */
+ static ASTCENC_SIMD_INLINE vfloat4 loada(const float* p)
+ {
+ return vfloat4(vld1q_f32(p));
+ }
+
+ /**
+ * @brief Factory that returns a vector containing the lane IDs.
+ */
+ static ASTCENC_SIMD_INLINE vfloat4 lane_id()
+ {
+ alignas(16) float data[4] { 0.0f, 1.0f, 2.0f, 3.0f };
+ return vfloat4(vld1q_f32(data));
+ }
+
+ /**
+ * @brief Return a swizzled float 2.
+ */
+ template <int l0, int l1> ASTCENC_SIMD_INLINE vfloat4 swz() const
+ {
+ return vfloat4(lane<l0>(), lane<l1>(), 0.0f, 0.0f);
+ }
+
+ /**
+ * @brief Return a swizzled float 3.
+ */
+ template <int l0, int l1, int l2> ASTCENC_SIMD_INLINE vfloat4 swz() const
+ {
+ return vfloat4(lane<l0>(), lane<l1>(), lane<l2>(), 0.0f);
+ }
+
+ /**
+ * @brief Return a swizzled float 4.
+ */
+ template <int l0, int l1, int l2, int l3> ASTCENC_SIMD_INLINE vfloat4 swz() const
+ {
+ return vfloat4(lane<l0>(), lane<l1>(), lane<l2>(), lane<l3>());
+ }
+
+ /**
+ * @brief The vector ...
+ */
+ float32x4_t m;
+};
+
+// ============================================================================
+// vint4 data type
+// ============================================================================
+
+/**
+ * @brief Data type for 4-wide ints.
+ */
+struct vint4
+{
+ /**
+ * @brief Construct from zero-initialized value.
+ */
+ ASTCENC_SIMD_INLINE vint4() = default;
+
+ /**
+ * @brief Construct from 4 values loaded from an unaligned address.
+ *
+ * Consider using loada() which is better with vectors if data is aligned
+ * to vector length.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(const int *p)
+ {
+ m = vld1q_s32(p);
+ }
+
+ /**
+ * @brief Construct from 4 uint8_t loaded from an unaligned address.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(const uint8_t *p)
+ {
+ uint32x2_t t8 {};
+ // Cast is safe - NEON loads are allowed to be unaligned
+ t8 = vld1_lane_u32(reinterpret_cast<const uint32_t*>(p), t8, 0);
+ uint16x4_t t16 = vget_low_u16(vmovl_u8(vreinterpret_u8_u32(t8)));
+ m = vreinterpretq_s32_u32(vmovl_u16(t16));
+ }
+
+ /**
+ * @brief Construct from 1 scalar value replicated across all lanes.
+ *
+ * Consider using vfloat4::zero() for constexpr zeros.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(int a)
+ {
+ m = vdupq_n_s32(a);
+ }
+
+ /**
+ * @brief Construct from 4 scalar values.
+ *
+ * The value of @c a is stored to lane 0 (LSB) in the SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(int a, int b, int c, int d)
+ {
+ int v[4] { a, b, c, d };
+ m = vld1q_s32(v);
+ }
+
+ /**
+ * @brief Construct from an existing SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(int32x4_t a)
+ {
+ m = a;
+ }
+
+ /**
+ * @brief Get the scalar from a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE int lane() const
+ {
+ return vgetq_lane_s32(m, l);
+ }
+
+ /**
+ * @brief Set the scalar value of a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE void set_lane(int a)
+ {
+ m = vld1q_lane_s32(&a, m, l);
+ }
+
+ /**
+ * @brief Factory that returns a vector of zeros.
+ */
+ static ASTCENC_SIMD_INLINE vint4 zero()
+ {
+ return vint4(0);
+ }
+
+ /**
+ * @brief Factory that returns a replicated scalar loaded from memory.
+ */
+ static ASTCENC_SIMD_INLINE vint4 load1(const int* p)
+ {
+ return vint4(*p);
+ }
+
+ /**
+ * @brief Factory that returns a vector loaded from 16B aligned memory.
+ */
+ static ASTCENC_SIMD_INLINE vint4 loada(const int* p)
+ {
+ return vint4(p);
+ }
+
+ /**
+ * @brief Factory that returns a vector containing the lane IDs.
+ */
+ static ASTCENC_SIMD_INLINE vint4 lane_id()
+ {
+ alignas(16) static const int data[4] { 0, 1, 2, 3 };
+ return vint4(vld1q_s32(data));
+ }
+
+ /**
+ * @brief The vector ...
+ */
+ int32x4_t m;
+};
+
+// ============================================================================
+// vmask4 data type
+// ============================================================================
+
+/**
+ * @brief Data type for 4-wide control plane masks.
+ */
+struct vmask4
+{
+ /**
+ * @brief Construct from an existing SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask4(uint32x4_t a)
+ {
+ m = a;
+ }
+
+#if !defined(_MSC_VER)
+ /**
+ * @brief Construct from an existing SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask4(int32x4_t a)
+ {
+ m = vreinterpretq_u32_s32(a);
+ }
+#endif
+
+ /**
+ * @brief Construct from 1 scalar value.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask4(bool a)
+ {
+ m = vreinterpretq_u32_s32(vdupq_n_s32(a == true ? -1 : 0));
+ }
+
+ /**
+ * @brief Construct from 4 scalar values.
+ *
+ * The value of @c a is stored to lane 0 (LSB) in the SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask4(bool a, bool b, bool c, bool d)
+ {
+ int v[4] {
+ a == true ? -1 : 0,
+ b == true ? -1 : 0,
+ c == true ? -1 : 0,
+ d == true ? -1 : 0
+ };
+
+ int32x4_t ms = vld1q_s32(v);
+ m = vreinterpretq_u32_s32(ms);
+ }
+
+ /**
+ * @brief Get the scalar from a single lane.
+ */
+ template <int32_t l> ASTCENC_SIMD_INLINE uint32_t lane() const
+ {
+ return vgetq_lane_u32(m, l);
+ }
+
+ /**
+ * @brief The vector ...
+ */
+ uint32x4_t m;
+};
+
+// ============================================================================
+// vmask4 operators and functions
+// ============================================================================
+
+/**
+ * @brief Overload: mask union (or).
+ */
+ASTCENC_SIMD_INLINE vmask4 operator|(vmask4 a, vmask4 b)
+{
+ return vmask4(vorrq_u32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: mask intersect (and).
+ */
+ASTCENC_SIMD_INLINE vmask4 operator&(vmask4 a, vmask4 b)
+{
+ return vmask4(vandq_u32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: mask difference (xor).
+ */
+ASTCENC_SIMD_INLINE vmask4 operator^(vmask4 a, vmask4 b)
+{
+ return vmask4(veorq_u32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: mask invert (not).
+ */
+ASTCENC_SIMD_INLINE vmask4 operator~(vmask4 a)
+{
+ return vmask4(vmvnq_u32(a.m));
+}
+
+/**
+ * @brief Return a 4-bit mask code indicating mask status.
+ *
+ * bit0 = lane 0
+ */
+ASTCENC_SIMD_INLINE unsigned int mask(vmask4 a)
+{
+ static const int shifta[4] { 0, 1, 2, 3 };
+ static const int32x4_t shift = vld1q_s32(shifta);
+
+ uint32x4_t tmp = vshrq_n_u32(a.m, 31);
+ return vaddvq_u32(vshlq_u32(tmp, shift));
+}
+
+// ============================================================================
+// vint4 operators and functions
+// ============================================================================
+
+/**
+ * @brief Overload: vector by vector addition.
+ */
+ASTCENC_SIMD_INLINE vint4 operator+(vint4 a, vint4 b)
+{
+ return vint4(vaddq_s32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector subtraction.
+ */
+ASTCENC_SIMD_INLINE vint4 operator-(vint4 a, vint4 b)
+{
+ return vint4(vsubq_s32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector multiplication.
+ */
+ASTCENC_SIMD_INLINE vint4 operator*(vint4 a, vint4 b)
+{
+ return vint4(vmulq_s32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector bit invert.
+ */
+ASTCENC_SIMD_INLINE vint4 operator~(vint4 a)
+{
+ return vint4(vmvnq_s32(a.m));
+}
+
+/**
+ * @brief Overload: vector by vector bitwise or.
+ */
+ASTCENC_SIMD_INLINE vint4 operator|(vint4 a, vint4 b)
+{
+ return vint4(vorrq_s32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector bitwise and.
+ */
+ASTCENC_SIMD_INLINE vint4 operator&(vint4 a, vint4 b)
+{
+ return vint4(vandq_s32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector bitwise xor.
+ */
+ASTCENC_SIMD_INLINE vint4 operator^(vint4 a, vint4 b)
+{
+ return vint4(veorq_s32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector equality.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator==(vint4 a, vint4 b)
+{
+ return vmask4(vceqq_s32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector inequality.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator!=(vint4 a, vint4 b)
+{
+ return ~vmask4(vceqq_s32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector less than.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator<(vint4 a, vint4 b)
+{
+ return vmask4(vcltq_s32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector greater than.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator>(vint4 a, vint4 b)
+{
+ return vmask4(vcgtq_s32(a.m, b.m));
+}
+
+/**
+ * @brief Logical shift left.
+ */
+template <int s> ASTCENC_SIMD_INLINE vint4 lsl(vint4 a)
+{
+ return vint4(vshlq_s32(a.m, vdupq_n_s32(s)));
+}
+
+/**
+ * @brief Logical shift right.
+ */
+template <int s> ASTCENC_SIMD_INLINE vint4 lsr(vint4 a)
+{
+ uint32x4_t ua = vreinterpretq_u32_s32(a.m);
+ ua = vshlq_u32(ua, vdupq_n_s32(-s));
+ return vint4(vreinterpretq_s32_u32(ua));
+}
+
+/**
+ * @brief Arithmetic shift right.
+ */
+template <int s> ASTCENC_SIMD_INLINE vint4 asr(vint4 a)
+{
+ return vint4(vshlq_s32(a.m, vdupq_n_s32(-s)));
+}
+
+/**
+ * @brief Return the min vector of two vectors.
+ */
+ASTCENC_SIMD_INLINE vint4 min(vint4 a, vint4 b)
+{
+ return vint4(vminq_s32(a.m, b.m));
+}
+
+/**
+ * @brief Return the max vector of two vectors.
+ */
+ASTCENC_SIMD_INLINE vint4 max(vint4 a, vint4 b)
+{
+ return vint4(vmaxq_s32(a.m, b.m));
+}
+
+/**
+ * @brief Return the horizontal minimum of a vector.
+ */
+ASTCENC_SIMD_INLINE vint4 hmin(vint4 a)
+{
+ return vint4(vminvq_s32(a.m));
+}
+
+/**
+ * @brief Return the horizontal maximum of a vector.
+ */
+ASTCENC_SIMD_INLINE vint4 hmax(vint4 a)
+{
+ return vint4(vmaxvq_s32(a.m));
+}
+
+/**
+ * @brief Return the horizontal sum of a vector.
+ */
+ASTCENC_SIMD_INLINE int hadd_s(vint4 a)
+{
+ int32x2_t t = vadd_s32(vget_high_s32(a.m), vget_low_s32(a.m));
+ return vget_lane_s32(vpadd_s32(t, t), 0);
+}
+
+/**
+ * @brief Store a vector to a 16B aligned memory address.
+ */
+ASTCENC_SIMD_INLINE void storea(vint4 a, int* p)
+{
+ vst1q_s32(p, a.m);
+}
+
+/**
+ * @brief Store a vector to an unaligned memory address.
+ */
+ASTCENC_SIMD_INLINE void store(vint4 a, int* p)
+{
+ vst1q_s32(p, a.m);
+}
+
+/**
+ * @brief Store lowest N (vector width) bytes into an unaligned address.
+ */
+ASTCENC_SIMD_INLINE void store_nbytes(vint4 a, uint8_t* p)
+{
+ vst1q_lane_s32(reinterpret_cast<int32_t*>(p), a.m, 0);
+}
+
+/**
+ * @brief Gather N (vector width) indices from the array.
+ */
+ASTCENC_SIMD_INLINE vint4 gatheri(const int* base, vint4 indices)
+{
+ alignas(16) int idx[4];
+ storea(indices, idx);
+ alignas(16) int vals[4];
+ vals[0] = base[idx[0]];
+ vals[1] = base[idx[1]];
+ vals[2] = base[idx[2]];
+ vals[3] = base[idx[3]];
+ return vint4(vals);
+}
+
+/**
+ * @brief Pack low 8 bits of N (vector width) lanes into bottom of vector.
+ */
+ASTCENC_SIMD_INLINE vint4 pack_low_bytes(vint4 a)
+{
+ alignas(16) uint8_t shuf[16] {
+ 0, 4, 8, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+ };
+ uint8x16_t idx = vld1q_u8(shuf);
+ int8x16_t av = vreinterpretq_s8_s32(a.m);
+ return vint4(vreinterpretq_s32_s8(vqtbl1q_s8(av, idx)));
+}
+
+/**
+ * @brief Return lanes from @c b if @c cond is set, else @c a.
+ */
+ASTCENC_SIMD_INLINE vint4 select(vint4 a, vint4 b, vmask4 cond)
+{
+ return vint4(vbslq_s32(cond.m, b.m, a.m));
+}
+
+// ============================================================================
+// vfloat4 operators and functions
+// ============================================================================
+
+/**
+ * @brief Overload: vector by vector addition.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator+(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(vaddq_f32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector subtraction.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator-(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(vsubq_f32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector multiplication.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator*(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(vmulq_f32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector division.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator/(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(vdivq_f32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector equality.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator==(vfloat4 a, vfloat4 b)
+{
+ return vmask4(vceqq_f32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector inequality.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator!=(vfloat4 a, vfloat4 b)
+{
+ return vmask4(vmvnq_u32(vceqq_f32(a.m, b.m)));
+}
+
+/**
+ * @brief Overload: vector by vector less than.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator<(vfloat4 a, vfloat4 b)
+{
+ return vmask4(vcltq_f32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector greater than.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator>(vfloat4 a, vfloat4 b)
+{
+ return vmask4(vcgtq_f32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector less than or equal.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator<=(vfloat4 a, vfloat4 b)
+{
+ return vmask4(vcleq_f32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector greater than or equal.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator>=(vfloat4 a, vfloat4 b)
+{
+ return vmask4(vcgeq_f32(a.m, b.m));
+}
+
+/**
+ * @brief Return the min vector of two vectors.
+ *
+ * If either lane value is NaN, @c b will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat4 min(vfloat4 a, vfloat4 b)
+{
+ // Do not reorder - second operand will return if either is NaN
+ return vfloat4(vminnmq_f32(a.m, b.m));
+}
+
+/**
+ * @brief Return the max vector of two vectors.
+ *
+ * If either lane value is NaN, @c b will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat4 max(vfloat4 a, vfloat4 b)
+{
+ // Do not reorder - second operand will return if either is NaN
+ return vfloat4(vmaxnmq_f32(a.m, b.m));
+}
+
+/**
+ * @brief Return the absolute value of the float vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 abs(vfloat4 a)
+{
+ float32x4_t zero = vdupq_n_f32(0.0f);
+ float32x4_t inv = vsubq_f32(zero, a.m);
+ return vfloat4(vmaxq_f32(a.m, inv));
+}
+
+/**
+ * @brief Return a float rounded to the nearest integer value.
+ */
+ASTCENC_SIMD_INLINE vfloat4 round(vfloat4 a)
+{
+ return vfloat4(vrndnq_f32(a.m));
+}
+
+/**
+ * @brief Return the horizontal minimum of a vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 hmin(vfloat4 a)
+{
+ return vfloat4(vminvq_f32(a.m));
+}
+
+/**
+ * @brief Return the horizontal maximum of a vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 hmax(vfloat4 a)
+{
+ return vfloat4(vmaxvq_f32(a.m));
+}
+
+/**
+ * @brief Return the horizontal sum of a vector.
+ */
+ASTCENC_SIMD_INLINE float hadd_s(vfloat4 a)
+{
+ // Perform halving add to ensure invariance; we cannot use vaddqv as this
+ // does (0 + 1 + 2 + 3) which is not invariant with x86 (0 + 2) + (1 + 3).
+ float32x2_t t = vadd_f32(vget_high_f32(a.m), vget_low_f32(a.m));
+ return vget_lane_f32(vpadd_f32(t, t), 0);
+}
+
+/**
+ * @brief Return the sqrt of the lanes in the vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 sqrt(vfloat4 a)
+{
+ return vfloat4(vsqrtq_f32(a.m));
+}
+
+/**
+ * @brief Return lanes from @c b if @c cond is set, else @c a.
+ */
+ASTCENC_SIMD_INLINE vfloat4 select(vfloat4 a, vfloat4 b, vmask4 cond)
+{
+ return vfloat4(vbslq_f32(cond.m, b.m, a.m));
+}
+
+/**
+ * @brief Return lanes from @c b if MSB of @c cond is set, else @c a.
+ */
+ASTCENC_SIMD_INLINE vfloat4 select_msb(vfloat4 a, vfloat4 b, vmask4 cond)
+{
+ static const uint32x4_t msb = vdupq_n_u32(0x80000000u);
+ uint32x4_t mask = vcgeq_u32(cond.m, msb);
+ return vfloat4(vbslq_f32(mask, b.m, a.m));
+}
+
+/**
+ * @brief Load a vector of gathered results from an array;
+ */
+ASTCENC_SIMD_INLINE vfloat4 gatherf(const float* base, vint4 indices)
+{
+ alignas(16) int idx[4];
+ storea(indices, idx);
+ alignas(16) float vals[4];
+ vals[0] = base[idx[0]];
+ vals[1] = base[idx[1]];
+ vals[2] = base[idx[2]];
+ vals[3] = base[idx[3]];
+ return vfloat4(vals);
+}
+
+/**
+ * @brief Store a vector to an unaligned memory address.
+ */
+ASTCENC_SIMD_INLINE void store(vfloat4 a, float* p)
+{
+ vst1q_f32(p, a.m);
+}
+
+/**
+ * @brief Store a vector to a 16B aligned memory address.
+ */
+ASTCENC_SIMD_INLINE void storea(vfloat4 a, float* p)
+{
+ vst1q_f32(p, a.m);
+}
+
+/**
+ * @brief Return a integer value for a float vector, using truncation.
+ */
+ASTCENC_SIMD_INLINE vint4 float_to_int(vfloat4 a)
+{
+ return vint4(vcvtq_s32_f32(a.m));
+}
+
+/**
+ * @brief Return a integer value for a float vector, using round-to-nearest.
+ */
+ASTCENC_SIMD_INLINE vint4 float_to_int_rtn(vfloat4 a)
+{
+ a = round(a);
+ return vint4(vcvtq_s32_f32(a.m));
+}
+
+/**
+ * @brief Return a float value for an integer vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 int_to_float(vint4 a)
+{
+ return vfloat4(vcvtq_f32_s32(a.m));
+}
+
+/**
+ * @brief Return a float16 value for a float vector, using round-to-nearest.
+ */
+ASTCENC_SIMD_INLINE vint4 float_to_float16(vfloat4 a)
+{
+ // Generate float16 value
+ float16x4_t f16 = vcvt_f16_f32(a.m);
+
+ // Convert each 16-bit float pattern to a 32-bit pattern
+ uint16x4_t u16 = vreinterpret_u16_f16(f16);
+ uint32x4_t u32 = vmovl_u16(u16);
+ return vint4(vreinterpretq_s32_u32(u32));
+}
+
+/**
+ * @brief Return a float16 value for a float scalar, using round-to-nearest.
+ */
+static inline uint16_t float_to_float16(float a)
+{
+ vfloat4 av(a);
+ return static_cast<uint16_t>(float_to_float16(av).lane<0>());
+}
+
+/**
+ * @brief Return a float value for a float16 vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 float16_to_float(vint4 a)
+{
+ // Convert each 32-bit float pattern to a 16-bit pattern
+ uint32x4_t u32 = vreinterpretq_u32_s32(a.m);
+ uint16x4_t u16 = vmovn_u32(u32);
+ float16x4_t f16 = vreinterpret_f16_u16(u16);
+
+ // Generate float16 value
+ return vfloat4(vcvt_f32_f16(f16));
+}
+
+/**
+ * @brief Return a float value for a float16 scalar.
+ */
+ASTCENC_SIMD_INLINE float float16_to_float(uint16_t a)
+{
+ vint4 av(a);
+ return float16_to_float(av).lane<0>();
+}
+
+/**
+ * @brief Return a float value as an integer bit pattern (i.e. no conversion).
+ *
+ * It is a common trick to convert floats into integer bit patterns, perform
+ * some bit hackery based on knowledge they are IEEE 754 layout, and then
+ * convert them back again. This is the first half of that flip.
+ */
+ASTCENC_SIMD_INLINE vint4 float_as_int(vfloat4 a)
+{
+ return vint4(vreinterpretq_s32_f32(a.m));
+}
+
+/**
+ * @brief Return a integer value as a float bit pattern (i.e. no conversion).
+ *
+ * It is a common trick to convert floats into integer bit patterns, perform
+ * some bit hackery based on knowledge they are IEEE 754 layout, and then
+ * convert them back again. This is the second half of that flip.
+ */
+ASTCENC_SIMD_INLINE vfloat4 int_as_float(vint4 v)
+{
+ return vfloat4(vreinterpretq_f32_s32(v.m));
+}
+
+/**
+ * @brief Prepare a vtable lookup table for use with the native SIMD size.
+ */
+ASTCENC_SIMD_INLINE void vtable_prepare(vint4 t0, vint4& t0p)
+{
+ t0p = t0;
+}
+
+
+/**
+ * @brief Prepare a vtable lookup table for use with the native SIMD size.
+ */
+ASTCENC_SIMD_INLINE void vtable_prepare(vint4 t0, vint4 t1, vint4& t0p, vint4& t1p)
+{
+ t0p = t0;
+ t1p = t1;
+}
+
+/**
+ * @brief Prepare a vtable lookup table for use with the native SIMD size.
+ */
+ASTCENC_SIMD_INLINE void vtable_prepare(
+ vint4 t0, vint4 t1, vint4 t2, vint4 t3,
+ vint4& t0p, vint4& t1p, vint4& t2p, vint4& t3p)
+{
+ t0p = t0;
+ t1p = t1;
+ t2p = t2;
+ t3p = t3;
+}
+
+/**
+ * @brief Perform an 8-bit 16-entry table lookup, with 32-bit indexes.
+ */
+ASTCENC_SIMD_INLINE vint4 vtable_8bt_32bi(vint4 t0, vint4 idx)
+{
+ int8x16_t table {
+ vreinterpretq_s8_s32(t0.m)
+ };
+
+ // Set index byte above max index for unused bytes so table lookup returns zero
+ int32x4_t idx_masked = vorrq_s32(idx.m, vdupq_n_s32(0xFFFFFF00));
+ uint8x16_t idx_bytes = vreinterpretq_u8_s32(idx_masked);
+
+ return vint4(vreinterpretq_s32_s8(vqtbl1q_s8(table, idx_bytes)));
+}
+
+/**
+ * @brief Perform an 8-bit 32-entry table lookup, with 32-bit indexes.
+ */
+ASTCENC_SIMD_INLINE vint4 vtable_8bt_32bi(vint4 t0, vint4 t1, vint4 idx)
+{
+ int8x16x2_t table {
+ vreinterpretq_s8_s32(t0.m),
+ vreinterpretq_s8_s32(t1.m)
+ };
+
+ // Set index byte above max index for unused bytes so table lookup returns zero
+ int32x4_t idx_masked = vorrq_s32(idx.m, vdupq_n_s32(0xFFFFFF00));
+ uint8x16_t idx_bytes = vreinterpretq_u8_s32(idx_masked);
+
+ return vint4(vreinterpretq_s32_s8(vqtbl2q_s8(table, idx_bytes)));
+}
+
+/**
+ * @brief Perform an 8-bit 64-entry table lookup, with 32-bit indexes.
+ */
+ASTCENC_SIMD_INLINE vint4 vtable_8bt_32bi(vint4 t0, vint4 t1, vint4 t2, vint4 t3, vint4 idx)
+{
+ int8x16x4_t table {
+ vreinterpretq_s8_s32(t0.m),
+ vreinterpretq_s8_s32(t1.m),
+ vreinterpretq_s8_s32(t2.m),
+ vreinterpretq_s8_s32(t3.m)
+ };
+
+ // Set index byte above max index for unused bytes so table lookup returns zero
+ int32x4_t idx_masked = vorrq_s32(idx.m, vdupq_n_s32(0xFFFFFF00));
+ uint8x16_t idx_bytes = vreinterpretq_u8_s32(idx_masked);
+
+ return vint4(vreinterpretq_s32_s8(vqtbl4q_s8(table, idx_bytes)));
+}
+
+/**
+ * @brief Return a vector of interleaved RGBA data.
+ *
+ * Input vectors have the value stored in the bottom 8 bits of each lane,
+ * with high bits set to zero.
+ *
+ * Output vector stores a single RGBA texel packed in each lane.
+ */
+ASTCENC_SIMD_INLINE vint4 interleave_rgba8(vint4 r, vint4 g, vint4 b, vint4 a)
+{
+ return r + lsl<8>(g) + lsl<16>(b) + lsl<24>(a);
+}
+
+/**
+ * @brief Store a vector, skipping masked lanes.
+ *
+ * All masked lanes must be at the end of vector, after all non-masked lanes.
+ */
+ASTCENC_SIMD_INLINE void store_lanes_masked(int* base, vint4 data, vmask4 mask)
+{
+ if (mask.lane<3>())
+ {
+ store(data, base);
+ }
+ else if (mask.lane<2>())
+ {
+ base[0] = data.lane<0>();
+ base[1] = data.lane<1>();
+ base[2] = data.lane<2>();
+ }
+ else if (mask.lane<1>())
+ {
+ base[0] = data.lane<0>();
+ base[1] = data.lane<1>();
+ }
+ else if (mask.lane<0>())
+ {
+ base[0] = data.lane<0>();
+ }
+}
+
+#define ASTCENC_USE_NATIVE_POPCOUNT 1
+
+/**
+ * @brief Population bit count.
+ *
+ * @param v The value to population count.
+ *
+ * @return The number of 1 bits.
+ */
+ASTCENC_SIMD_INLINE int popcount(uint64_t v)
+{
+ return static_cast<int>(vaddlv_u8(vcnt_u8(vcreate_u8(v))));
+}
+
+#endif // #ifndef ASTC_VECMATHLIB_NEON_4_H_INCLUDED
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_none_4.h b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_none_4.h
new file mode 100644
index 00000000000..d9b52be3e42
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_none_4.h
@@ -0,0 +1,1169 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2019-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief 4x32-bit vectors, implemented using plain C++.
+ *
+ * This module implements 4-wide 32-bit float, int, and mask vectors. This
+ * module provides a scalar fallback for VLA code, primarily useful for
+ * debugging VLA algorithms without the complexity of handling SIMD. Only the
+ * baseline level of functionality needed to support VLA is provided.
+ *
+ * Note that the vector conditional operators implemented by this module are
+ * designed to behave like SIMD conditional operators that generate lane masks.
+ * Rather than returning 0/1 booleans like normal C++ code they will return
+ * 0/-1 to give a full lane-width bitmask.
+ *
+ * Note that the documentation for this module still talks about "vectors" to
+ * help developers think about the implied VLA behavior when writing optimized
+ * paths.
+ */
+
+#ifndef ASTC_VECMATHLIB_NONE_4_H_INCLUDED
+#define ASTC_VECMATHLIB_NONE_4_H_INCLUDED
+
+#ifndef ASTCENC_SIMD_INLINE
+ #error "Include astcenc_vecmathlib.h, do not include directly"
+#endif
+
+#include <algorithm>
+#include <cstdio>
+#include <cstring>
+#include <cfenv>
+
+// ============================================================================
+// vfloat4 data type
+// ============================================================================
+
+/**
+ * @brief Data type for 4-wide floats.
+ */
+struct vfloat4
+{
+ /**
+ * @brief Construct from zero-initialized value.
+ */
+ ASTCENC_SIMD_INLINE vfloat4() = default;
+
+ /**
+ * @brief Construct from 4 values loaded from an unaligned address.
+ *
+ * Consider using loada() which is better with wider VLA vectors if data is
+ * aligned to vector length.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat4(const float* p)
+ {
+ m[0] = p[0];
+ m[1] = p[1];
+ m[2] = p[2];
+ m[3] = p[3];
+ }
+
+ /**
+ * @brief Construct from 4 scalar values replicated across all lanes.
+ *
+ * Consider using zero() for constexpr zeros.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat4(float a)
+ {
+ m[0] = a;
+ m[1] = a;
+ m[2] = a;
+ m[3] = a;
+ }
+
+ /**
+ * @brief Construct from 4 scalar values.
+ *
+ * The value of @c a is stored to lane 0 (LSB) in the SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat4(float a, float b, float c, float d)
+ {
+ m[0] = a;
+ m[1] = b;
+ m[2] = c;
+ m[3] = d;
+ }
+
+ /**
+ * @brief Get the scalar value of a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE float lane() const
+ {
+ return m[l];
+ }
+
+ /**
+ * @brief Set the scalar value of a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE void set_lane(float a)
+ {
+ m[l] = a;
+ }
+
+ /**
+ * @brief Factory that returns a vector of zeros.
+ */
+ static ASTCENC_SIMD_INLINE vfloat4 zero()
+ {
+ return vfloat4(0.0f);
+ }
+
+ /**
+ * @brief Factory that returns a replicated scalar loaded from memory.
+ */
+ static ASTCENC_SIMD_INLINE vfloat4 load1(const float* p)
+ {
+ return vfloat4(*p);
+ }
+
+ /**
+ * @brief Factory that returns a vector loaded from aligned memory.
+ */
+ static ASTCENC_SIMD_INLINE vfloat4 loada(const float* p)
+ {
+ return vfloat4(p);
+ }
+
+ /**
+ * @brief Factory that returns a vector containing the lane IDs.
+ */
+ static ASTCENC_SIMD_INLINE vfloat4 lane_id()
+ {
+ return vfloat4(0.0f, 1.0f, 2.0f, 3.0f);
+ }
+
+ /**
+ * @brief Return a swizzled float 2.
+ */
+ template <int l0, int l1> ASTCENC_SIMD_INLINE vfloat4 swz() const
+ {
+ return vfloat4(lane<l0>(), lane<l1>(), 0.0f, 0.0f);
+ }
+
+ /**
+ * @brief Return a swizzled float 3.
+ */
+ template <int l0, int l1, int l2> ASTCENC_SIMD_INLINE vfloat4 swz() const
+ {
+ return vfloat4(lane<l0>(), lane<l1>(), lane<l2>(), 0.0f);
+ }
+
+ /**
+ * @brief Return a swizzled float 4.
+ */
+ template <int l0, int l1, int l2, int l3> ASTCENC_SIMD_INLINE vfloat4 swz() const
+ {
+ return vfloat4(lane<l0>(), lane<l1>(), lane<l2>(), lane<l3>());
+ }
+
+ /**
+ * @brief The vector ...
+ */
+ float m[4];
+};
+
+// ============================================================================
+// vint4 data type
+// ============================================================================
+
+/**
+ * @brief Data type for 4-wide ints.
+ */
+struct vint4
+{
+ /**
+ * @brief Construct from zero-initialized value.
+ */
+ ASTCENC_SIMD_INLINE vint4() = default;
+
+ /**
+ * @brief Construct from 4 values loaded from an unaligned address.
+ *
+ * Consider using vint4::loada() which is better with wider VLA vectors
+ * if data is aligned.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(const int* p)
+ {
+ m[0] = p[0];
+ m[1] = p[1];
+ m[2] = p[2];
+ m[3] = p[3];
+ }
+
+ /**
+ * @brief Construct from 4 uint8_t loaded from an unaligned address.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(const uint8_t *p)
+ {
+ m[0] = p[0];
+ m[1] = p[1];
+ m[2] = p[2];
+ m[3] = p[3];
+ }
+
+ /**
+ * @brief Construct from 4 scalar values.
+ *
+ * The value of @c a is stored to lane 0 (LSB) in the SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(int a, int b, int c, int d)
+ {
+ m[0] = a;
+ m[1] = b;
+ m[2] = c;
+ m[3] = d;
+ }
+
+
+ /**
+ * @brief Construct from 4 scalar values replicated across all lanes.
+ *
+ * Consider using vint4::zero() for constexpr zeros.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(int a)
+ {
+ m[0] = a;
+ m[1] = a;
+ m[2] = a;
+ m[3] = a;
+ }
+
+ /**
+ * @brief Get the scalar value of a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE int lane() const
+ {
+ return m[l];
+ }
+
+ /**
+ * @brief Set the scalar value of a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE void set_lane(int a)
+ {
+ m[l] = a;
+ }
+
+ /**
+ * @brief Factory that returns a vector of zeros.
+ */
+ static ASTCENC_SIMD_INLINE vint4 zero()
+ {
+ return vint4(0);
+ }
+
+ /**
+ * @brief Factory that returns a replicated scalar loaded from memory.
+ */
+ static ASTCENC_SIMD_INLINE vint4 load1(const int* p)
+ {
+ return vint4(*p);
+ }
+
+ /**
+ * @brief Factory that returns a vector loaded from 16B aligned memory.
+ */
+ static ASTCENC_SIMD_INLINE vint4 loada(const int* p)
+ {
+ return vint4(p);
+ }
+
+ /**
+ * @brief Factory that returns a vector containing the lane IDs.
+ */
+ static ASTCENC_SIMD_INLINE vint4 lane_id()
+ {
+ return vint4(0, 1, 2, 3);
+ }
+
+ /**
+ * @brief The vector ...
+ */
+ int m[4];
+};
+
+// ============================================================================
+// vmask4 data type
+// ============================================================================
+
+/**
+ * @brief Data type for 4-wide control plane masks.
+ */
+struct vmask4
+{
+ /**
+ * @brief Construct from an existing mask value.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask4(int* p)
+ {
+ m[0] = p[0];
+ m[1] = p[1];
+ m[2] = p[2];
+ m[3] = p[3];
+ }
+
+ /**
+ * @brief Construct from 1 scalar value.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask4(bool a)
+ {
+ m[0] = a == false ? 0 : -1;
+ m[1] = a == false ? 0 : -1;
+ m[2] = a == false ? 0 : -1;
+ m[3] = a == false ? 0 : -1;
+ }
+
+ /**
+ * @brief Construct from 4 scalar values.
+ *
+ * The value of @c a is stored to lane 0 (LSB) in the SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask4(bool a, bool b, bool c, bool d)
+ {
+ m[0] = a == false ? 0 : -1;
+ m[1] = b == false ? 0 : -1;
+ m[2] = c == false ? 0 : -1;
+ m[3] = d == false ? 0 : -1;
+ }
+
+
+ /**
+ * @brief The vector ...
+ */
+ int m[4];
+};
+
+// ============================================================================
+// vmask4 operators and functions
+// ============================================================================
+
+/**
+ * @brief Overload: mask union (or).
+ */
+ASTCENC_SIMD_INLINE vmask4 operator|(vmask4 a, vmask4 b)
+{
+ return vmask4(a.m[0] | b.m[0],
+ a.m[1] | b.m[1],
+ a.m[2] | b.m[2],
+ a.m[3] | b.m[3]);
+}
+
+/**
+ * @brief Overload: mask intersect (and).
+ */
+ASTCENC_SIMD_INLINE vmask4 operator&(vmask4 a, vmask4 b)
+{
+ return vmask4(a.m[0] & b.m[0],
+ a.m[1] & b.m[1],
+ a.m[2] & b.m[2],
+ a.m[3] & b.m[3]);
+}
+
+/**
+ * @brief Overload: mask difference (xor).
+ */
+ASTCENC_SIMD_INLINE vmask4 operator^(vmask4 a, vmask4 b)
+{
+ return vmask4(a.m[0] ^ b.m[0],
+ a.m[1] ^ b.m[1],
+ a.m[2] ^ b.m[2],
+ a.m[3] ^ b.m[3]);
+}
+
+/**
+ * @brief Overload: mask invert (not).
+ */
+ASTCENC_SIMD_INLINE vmask4 operator~(vmask4 a)
+{
+ return vmask4(~a.m[0],
+ ~a.m[1],
+ ~a.m[2],
+ ~a.m[3]);
+}
+
+/**
+ * @brief Return a 1-bit mask code indicating mask status.
+ *
+ * bit0 = lane 0
+ */
+ASTCENC_SIMD_INLINE unsigned int mask(vmask4 a)
+{
+ return ((a.m[0] >> 31) & 0x1) |
+ ((a.m[1] >> 30) & 0x2) |
+ ((a.m[2] >> 29) & 0x4) |
+ ((a.m[3] >> 28) & 0x8);
+}
+
+// ============================================================================
+// vint4 operators and functions
+// ============================================================================
+
+/**
+ * @brief Overload: vector by vector addition.
+ */
+ASTCENC_SIMD_INLINE vint4 operator+(vint4 a, vint4 b)
+{
+ return vint4(a.m[0] + b.m[0],
+ a.m[1] + b.m[1],
+ a.m[2] + b.m[2],
+ a.m[3] + b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector subtraction.
+ */
+ASTCENC_SIMD_INLINE vint4 operator-(vint4 a, vint4 b)
+{
+ return vint4(a.m[0] - b.m[0],
+ a.m[1] - b.m[1],
+ a.m[2] - b.m[2],
+ a.m[3] - b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector multiplication.
+ */
+ASTCENC_SIMD_INLINE vint4 operator*(vint4 a, vint4 b)
+{
+ return vint4(a.m[0] * b.m[0],
+ a.m[1] * b.m[1],
+ a.m[2] * b.m[2],
+ a.m[3] * b.m[3]);
+}
+
+/**
+ * @brief Overload: vector bit invert.
+ */
+ASTCENC_SIMD_INLINE vint4 operator~(vint4 a)
+{
+ return vint4(~a.m[0],
+ ~a.m[1],
+ ~a.m[2],
+ ~a.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector bitwise or.
+ */
+ASTCENC_SIMD_INLINE vint4 operator|(vint4 a, vint4 b)
+{
+ return vint4(a.m[0] | b.m[0],
+ a.m[1] | b.m[1],
+ a.m[2] | b.m[2],
+ a.m[3] | b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector bitwise and.
+ */
+ASTCENC_SIMD_INLINE vint4 operator&(vint4 a, vint4 b)
+{
+ return vint4(a.m[0] & b.m[0],
+ a.m[1] & b.m[1],
+ a.m[2] & b.m[2],
+ a.m[3] & b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector bitwise xor.
+ */
+ASTCENC_SIMD_INLINE vint4 operator^(vint4 a, vint4 b)
+{
+ return vint4(a.m[0] ^ b.m[0],
+ a.m[1] ^ b.m[1],
+ a.m[2] ^ b.m[2],
+ a.m[3] ^ b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector equality.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator==(vint4 a, vint4 b)
+{
+ return vmask4(a.m[0] == b.m[0],
+ a.m[1] == b.m[1],
+ a.m[2] == b.m[2],
+ a.m[3] == b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector inequality.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator!=(vint4 a, vint4 b)
+{
+ return vmask4(a.m[0] != b.m[0],
+ a.m[1] != b.m[1],
+ a.m[2] != b.m[2],
+ a.m[3] != b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector less than.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator<(vint4 a, vint4 b)
+{
+ return vmask4(a.m[0] < b.m[0],
+ a.m[1] < b.m[1],
+ a.m[2] < b.m[2],
+ a.m[3] < b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector greater than.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator>(vint4 a, vint4 b)
+{
+ return vmask4(a.m[0] > b.m[0],
+ a.m[1] > b.m[1],
+ a.m[2] > b.m[2],
+ a.m[3] > b.m[3]);
+}
+
+/**
+ * @brief Logical shift left.
+ */
+template <int s> ASTCENC_SIMD_INLINE vint4 lsl(vint4 a)
+{
+ return vint4(a.m[0] << s,
+ a.m[1] << s,
+ a.m[2] << s,
+ a.m[3] << s);
+}
+
+/**
+ * @brief Logical shift right.
+ */
+template <int s> ASTCENC_SIMD_INLINE vint4 lsr(vint4 a)
+{
+ unsigned int as0 = static_cast<unsigned int>(a.m[0]) >> s;
+ unsigned int as1 = static_cast<unsigned int>(a.m[1]) >> s;
+ unsigned int as2 = static_cast<unsigned int>(a.m[2]) >> s;
+ unsigned int as3 = static_cast<unsigned int>(a.m[3]) >> s;
+
+ return vint4(static_cast<int>(as0),
+ static_cast<int>(as1),
+ static_cast<int>(as2),
+ static_cast<int>(as3));
+}
+
+/**
+ * @brief Arithmetic shift right.
+ */
+template <int s> ASTCENC_SIMD_INLINE vint4 asr(vint4 a)
+{
+ return vint4(a.m[0] >> s,
+ a.m[1] >> s,
+ a.m[2] >> s,
+ a.m[3] >> s);
+}
+
+/**
+ * @brief Return the min vector of two vectors.
+ */
+ASTCENC_SIMD_INLINE vint4 min(vint4 a, vint4 b)
+{
+ return vint4(a.m[0] < b.m[0] ? a.m[0] : b.m[0],
+ a.m[1] < b.m[1] ? a.m[1] : b.m[1],
+ a.m[2] < b.m[2] ? a.m[2] : b.m[2],
+ a.m[3] < b.m[3] ? a.m[3] : b.m[3]);
+}
+
+/**
+ * @brief Return the min vector of two vectors.
+ */
+ASTCENC_SIMD_INLINE vint4 max(vint4 a, vint4 b)
+{
+ return vint4(a.m[0] > b.m[0] ? a.m[0] : b.m[0],
+ a.m[1] > b.m[1] ? a.m[1] : b.m[1],
+ a.m[2] > b.m[2] ? a.m[2] : b.m[2],
+ a.m[3] > b.m[3] ? a.m[3] : b.m[3]);
+}
+
+/**
+ * @brief Return the horizontal minimum of a single vector.
+ */
+ASTCENC_SIMD_INLINE vint4 hmin(vint4 a)
+{
+ int b = std::min(a.m[0], a.m[1]);
+ int c = std::min(a.m[2], a.m[3]);
+ return vint4(std::min(b, c));
+}
+
+/**
+ * @brief Return the horizontal maximum of a single vector.
+ */
+ASTCENC_SIMD_INLINE vint4 hmax(vint4 a)
+{
+ int b = std::max(a.m[0], a.m[1]);
+ int c = std::max(a.m[2], a.m[3]);
+ return vint4(std::max(b, c));
+}
+
+/**
+ * @brief Return the horizontal sum of vector lanes as a scalar.
+ */
+ASTCENC_SIMD_INLINE int hadd_s(vint4 a)
+{
+ return a.m[0] + a.m[1] + a.m[2] + a.m[3];
+}
+
+/**
+ * @brief Store a vector to an aligned memory address.
+ */
+ASTCENC_SIMD_INLINE void storea(vint4 a, int* p)
+{
+ p[0] = a.m[0];
+ p[1] = a.m[1];
+ p[2] = a.m[2];
+ p[3] = a.m[3];
+}
+
+/**
+ * @brief Store a vector to an unaligned memory address.
+ */
+ASTCENC_SIMD_INLINE void store(vint4 a, int* p)
+{
+ p[0] = a.m[0];
+ p[1] = a.m[1];
+ p[2] = a.m[2];
+ p[3] = a.m[3];
+}
+
+/**
+ * @brief Store lowest N (vector width) bytes into an unaligned address.
+ */
+ASTCENC_SIMD_INLINE void store_nbytes(vint4 a, uint8_t* p)
+{
+ int* pi = reinterpret_cast<int*>(p);
+ *pi = a.m[0];
+}
+
+/**
+ * @brief Gather N (vector width) indices from the array.
+ */
+ASTCENC_SIMD_INLINE vint4 gatheri(const int* base, vint4 indices)
+{
+ return vint4(base[indices.m[0]],
+ base[indices.m[1]],
+ base[indices.m[2]],
+ base[indices.m[3]]);
+}
+
+/**
+ * @brief Pack low 8 bits of N (vector width) lanes into bottom of vector.
+ */
+ASTCENC_SIMD_INLINE vint4 pack_low_bytes(vint4 a)
+{
+ int b0 = a.m[0] & 0xFF;
+ int b1 = a.m[1] & 0xFF;
+ int b2 = a.m[2] & 0xFF;
+ int b3 = a.m[3] & 0xFF;
+
+ int b = b0 | (b1 << 8) | (b2 << 16) | (b3 << 24);
+ return vint4(b, 0, 0, 0);
+}
+
+/**
+ * @brief Return lanes from @c b if MSB of @c cond is set, else @c a.
+ */
+ASTCENC_SIMD_INLINE vint4 select(vint4 a, vint4 b, vmask4 cond)
+{
+ return vint4((cond.m[0] & static_cast<int>(0x80000000)) ? b.m[0] : a.m[0],
+ (cond.m[1] & static_cast<int>(0x80000000)) ? b.m[1] : a.m[1],
+ (cond.m[2] & static_cast<int>(0x80000000)) ? b.m[2] : a.m[2],
+ (cond.m[3] & static_cast<int>(0x80000000)) ? b.m[3] : a.m[3]);
+}
+
+// ============================================================================
+// vfloat4 operators and functions
+// ============================================================================
+
+/**
+ * @brief Overload: vector by vector addition.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator+(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(a.m[0] + b.m[0],
+ a.m[1] + b.m[1],
+ a.m[2] + b.m[2],
+ a.m[3] + b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector subtraction.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator-(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(a.m[0] - b.m[0],
+ a.m[1] - b.m[1],
+ a.m[2] - b.m[2],
+ a.m[3] - b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector multiplication.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator*(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(a.m[0] * b.m[0],
+ a.m[1] * b.m[1],
+ a.m[2] * b.m[2],
+ a.m[3] * b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector division.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator/(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(a.m[0] / b.m[0],
+ a.m[1] / b.m[1],
+ a.m[2] / b.m[2],
+ a.m[3] / b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector equality.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator==(vfloat4 a, vfloat4 b)
+{
+ return vmask4(a.m[0] == b.m[0],
+ a.m[1] == b.m[1],
+ a.m[2] == b.m[2],
+ a.m[3] == b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector inequality.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator!=(vfloat4 a, vfloat4 b)
+{
+ return vmask4(a.m[0] != b.m[0],
+ a.m[1] != b.m[1],
+ a.m[2] != b.m[2],
+ a.m[3] != b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector less than.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator<(vfloat4 a, vfloat4 b)
+{
+ return vmask4(a.m[0] < b.m[0],
+ a.m[1] < b.m[1],
+ a.m[2] < b.m[2],
+ a.m[3] < b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector greater than.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator>(vfloat4 a, vfloat4 b)
+{
+ return vmask4(a.m[0] > b.m[0],
+ a.m[1] > b.m[1],
+ a.m[2] > b.m[2],
+ a.m[3] > b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector less than or equal.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator<=(vfloat4 a, vfloat4 b)
+{
+ return vmask4(a.m[0] <= b.m[0],
+ a.m[1] <= b.m[1],
+ a.m[2] <= b.m[2],
+ a.m[3] <= b.m[3]);
+}
+
+/**
+ * @brief Overload: vector by vector greater than or equal.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator>=(vfloat4 a, vfloat4 b)
+{
+ return vmask4(a.m[0] >= b.m[0],
+ a.m[1] >= b.m[1],
+ a.m[2] >= b.m[2],
+ a.m[3] >= b.m[3]);
+}
+
+/**
+ * @brief Return the min vector of two vectors.
+ *
+ * If either lane value is NaN, @c b will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat4 min(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(a.m[0] < b.m[0] ? a.m[0] : b.m[0],
+ a.m[1] < b.m[1] ? a.m[1] : b.m[1],
+ a.m[2] < b.m[2] ? a.m[2] : b.m[2],
+ a.m[3] < b.m[3] ? a.m[3] : b.m[3]);
+}
+
+/**
+ * @brief Return the max vector of two vectors.
+ *
+ * If either lane value is NaN, @c b will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat4 max(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(a.m[0] > b.m[0] ? a.m[0] : b.m[0],
+ a.m[1] > b.m[1] ? a.m[1] : b.m[1],
+ a.m[2] > b.m[2] ? a.m[2] : b.m[2],
+ a.m[3] > b.m[3] ? a.m[3] : b.m[3]);
+}
+
+/**
+ * @brief Return the absolute value of the float vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 abs(vfloat4 a)
+{
+ return vfloat4(std::abs(a.m[0]),
+ std::abs(a.m[1]),
+ std::abs(a.m[2]),
+ std::abs(a.m[3]));
+}
+
+/**
+ * @brief Return a float rounded to the nearest integer value.
+ */
+ASTCENC_SIMD_INLINE vfloat4 round(vfloat4 a)
+{
+ assert(std::fegetround() == FE_TONEAREST);
+ return vfloat4(std::nearbyint(a.m[0]),
+ std::nearbyint(a.m[1]),
+ std::nearbyint(a.m[2]),
+ std::nearbyint(a.m[3]));
+}
+
+/**
+ * @brief Return the horizontal minimum of a vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 hmin(vfloat4 a)
+{
+ float tmp1 = std::min(a.m[0], a.m[1]);
+ float tmp2 = std::min(a.m[2], a.m[3]);
+ return vfloat4(std::min(tmp1, tmp2));
+}
+
+/**
+ * @brief Return the horizontal maximum of a vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 hmax(vfloat4 a)
+{
+ float tmp1 = std::max(a.m[0], a.m[1]);
+ float tmp2 = std::max(a.m[2], a.m[3]);
+ return vfloat4(std::max(tmp1, tmp2));
+}
+
+/**
+ * @brief Return the horizontal sum of a vector.
+ */
+ASTCENC_SIMD_INLINE float hadd_s(vfloat4 a)
+{
+ // Use halving add, gives invariance with SIMD versions
+ return (a.m[0] + a.m[2]) + (a.m[1] + a.m[3]);
+}
+
+/**
+ * @brief Return the sqrt of the lanes in the vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 sqrt(vfloat4 a)
+{
+ return vfloat4(std::sqrt(a.m[0]),
+ std::sqrt(a.m[1]),
+ std::sqrt(a.m[2]),
+ std::sqrt(a.m[3]));
+}
+
+/**
+ * @brief Return lanes from @c b if @c cond is set, else @c a.
+ */
+ASTCENC_SIMD_INLINE vfloat4 select(vfloat4 a, vfloat4 b, vmask4 cond)
+{
+ return vfloat4((cond.m[0] & static_cast<int>(0x80000000)) ? b.m[0] : a.m[0],
+ (cond.m[1] & static_cast<int>(0x80000000)) ? b.m[1] : a.m[1],
+ (cond.m[2] & static_cast<int>(0x80000000)) ? b.m[2] : a.m[2],
+ (cond.m[3] & static_cast<int>(0x80000000)) ? b.m[3] : a.m[3]);
+}
+
+/**
+ * @brief Return lanes from @c b if MSB of @c cond is set, else @c a.
+ */
+ASTCENC_SIMD_INLINE vfloat4 select_msb(vfloat4 a, vfloat4 b, vmask4 cond)
+{
+ return vfloat4((cond.m[0] & static_cast<int>(0x80000000)) ? b.m[0] : a.m[0],
+ (cond.m[1] & static_cast<int>(0x80000000)) ? b.m[1] : a.m[1],
+ (cond.m[2] & static_cast<int>(0x80000000)) ? b.m[2] : a.m[2],
+ (cond.m[3] & static_cast<int>(0x80000000)) ? b.m[3] : a.m[3]);
+}
+
+/**
+ * @brief Load a vector of gathered results from an array;
+ */
+ASTCENC_SIMD_INLINE vfloat4 gatherf(const float* base, vint4 indices)
+{
+ return vfloat4(base[indices.m[0]],
+ base[indices.m[1]],
+ base[indices.m[2]],
+ base[indices.m[3]]);
+}
+
+/**
+ * @brief Store a vector to an unaligned memory address.
+ */
+ASTCENC_SIMD_INLINE void store(vfloat4 a, float* ptr)
+{
+ ptr[0] = a.m[0];
+ ptr[1] = a.m[1];
+ ptr[2] = a.m[2];
+ ptr[3] = a.m[3];
+}
+
+/**
+ * @brief Store a vector to an aligned memory address.
+ */
+ASTCENC_SIMD_INLINE void storea(vfloat4 a, float* ptr)
+{
+ ptr[0] = a.m[0];
+ ptr[1] = a.m[1];
+ ptr[2] = a.m[2];
+ ptr[3] = a.m[3];
+}
+
+/**
+ * @brief Return a integer value for a float vector, using truncation.
+ */
+ASTCENC_SIMD_INLINE vint4 float_to_int(vfloat4 a)
+{
+ return vint4(static_cast<int>(a.m[0]),
+ static_cast<int>(a.m[1]),
+ static_cast<int>(a.m[2]),
+ static_cast<int>(a.m[3]));
+}
+
+/**f
+ * @brief Return a integer value for a float vector, using round-to-nearest.
+ */
+ASTCENC_SIMD_INLINE vint4 float_to_int_rtn(vfloat4 a)
+{
+ return vint4(static_cast<int>(a.m[0] + 0.5f),
+ static_cast<int>(a.m[1] + 0.5f),
+ static_cast<int>(a.m[2] + 0.5f),
+ static_cast<int>(a.m[3] + 0.5f));
+}
+
+/**
+ * @brief Return a float value for a integer vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 int_to_float(vint4 a)
+{
+ return vfloat4(static_cast<float>(a.m[0]),
+ static_cast<float>(a.m[1]),
+ static_cast<float>(a.m[2]),
+ static_cast<float>(a.m[3]));
+}
+
+/**
+ * @brief Return a float16 value for a float vector, using round-to-nearest.
+ */
+ASTCENC_SIMD_INLINE vint4 float_to_float16(vfloat4 a)
+{
+ return vint4(
+ float_to_sf16(a.lane<0>()),
+ float_to_sf16(a.lane<1>()),
+ float_to_sf16(a.lane<2>()),
+ float_to_sf16(a.lane<3>()));
+}
+
+/**
+ * @brief Return a float16 value for a float scalar, using round-to-nearest.
+ */
+static inline uint16_t float_to_float16(float a)
+{
+ return float_to_sf16(a);
+}
+
+/**
+ * @brief Return a float value for a float16 vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 float16_to_float(vint4 a)
+{
+ return vfloat4(
+ sf16_to_float(static_cast<uint16_t>(a.lane<0>())),
+ sf16_to_float(static_cast<uint16_t>(a.lane<1>())),
+ sf16_to_float(static_cast<uint16_t>(a.lane<2>())),
+ sf16_to_float(static_cast<uint16_t>(a.lane<3>())));
+}
+
+/**
+ * @brief Return a float value for a float16 scalar.
+ */
+ASTCENC_SIMD_INLINE float float16_to_float(uint16_t a)
+{
+ return sf16_to_float(a);
+}
+
+/**
+ * @brief Return a float value as an integer bit pattern (i.e. no conversion).
+ *
+ * It is a common trick to convert floats into integer bit patterns, perform
+ * some bit hackery based on knowledge they are IEEE 754 layout, and then
+ * convert them back again. This is the first half of that flip.
+ */
+ASTCENC_SIMD_INLINE vint4 float_as_int(vfloat4 a)
+{
+ vint4 r;
+ memcpy(r.m, a.m, 4 * 4);
+ return r;
+}
+
+/**
+ * @brief Return a integer value as a float bit pattern (i.e. no conversion).
+ *
+ * It is a common trick to convert floats into integer bit patterns, perform
+ * some bit hackery based on knowledge they are IEEE 754 layout, and then
+ * convert them back again. This is the second half of that flip.
+ */
+ASTCENC_SIMD_INLINE vfloat4 int_as_float(vint4 a)
+{
+ vfloat4 r;
+ memcpy(r.m, a.m, 4 * 4);
+ return r;
+}
+
+/**
+ * @brief Prepare a vtable lookup table for use with the native SIMD size.
+ */
+ASTCENC_SIMD_INLINE void vtable_prepare(vint4 t0, vint4& t0p)
+{
+ t0p = t0;
+}
+
+/**
+ * @brief Prepare a vtable lookup table for use with the native SIMD size.
+ */
+ASTCENC_SIMD_INLINE void vtable_prepare(vint4 t0, vint4 t1, vint4& t0p, vint4& t1p)
+{
+ t0p = t0;
+ t1p = t1;
+}
+
+/**
+ * @brief Prepare a vtable lookup table for use with the native SIMD size.
+ */
+ASTCENC_SIMD_INLINE void vtable_prepare(
+ vint4 t0, vint4 t1, vint4 t2, vint4 t3,
+ vint4& t0p, vint4& t1p, vint4& t2p, vint4& t3p)
+{
+ t0p = t0;
+ t1p = t1;
+ t2p = t2;
+ t3p = t3;
+}
+
+/**
+ * @brief Perform an 8-bit 32-entry table lookup, with 32-bit indexes.
+ */
+ASTCENC_SIMD_INLINE vint4 vtable_8bt_32bi(vint4 t0, vint4 idx)
+{
+ uint8_t table[16];
+ storea(t0, reinterpret_cast<int*>(table + 0));
+
+ return vint4(table[idx.lane<0>()],
+ table[idx.lane<1>()],
+ table[idx.lane<2>()],
+ table[idx.lane<3>()]);
+}
+
+
+/**
+ * @brief Perform an 8-bit 32-entry table lookup, with 32-bit indexes.
+ */
+ASTCENC_SIMD_INLINE vint4 vtable_8bt_32bi(vint4 t0, vint4 t1, vint4 idx)
+{
+ uint8_t table[32];
+ storea(t0, reinterpret_cast<int*>(table + 0));
+ storea(t1, reinterpret_cast<int*>(table + 16));
+
+ return vint4(table[idx.lane<0>()],
+ table[idx.lane<1>()],
+ table[idx.lane<2>()],
+ table[idx.lane<3>()]);
+}
+
+/**
+ * @brief Perform an 8-bit 64-entry table lookup, with 32-bit indexes.
+ */
+ASTCENC_SIMD_INLINE vint4 vtable_8bt_32bi(vint4 t0, vint4 t1, vint4 t2, vint4 t3, vint4 idx)
+{
+ uint8_t table[64];
+ storea(t0, reinterpret_cast<int*>(table + 0));
+ storea(t1, reinterpret_cast<int*>(table + 16));
+ storea(t2, reinterpret_cast<int*>(table + 32));
+ storea(t3, reinterpret_cast<int*>(table + 48));
+
+ return vint4(table[idx.lane<0>()],
+ table[idx.lane<1>()],
+ table[idx.lane<2>()],
+ table[idx.lane<3>()]);
+}
+
+/**
+ * @brief Return a vector of interleaved RGBA data.
+ *
+ * Input vectors have the value stored in the bottom 8 bits of each lane,
+ * with high bits set to zero.
+ *
+ * Output vector stores a single RGBA texel packed in each lane.
+ */
+ASTCENC_SIMD_INLINE vint4 interleave_rgba8(vint4 r, vint4 g, vint4 b, vint4 a)
+{
+ return r + lsl<8>(g) + lsl<16>(b) + lsl<24>(a);
+}
+
+/**
+ * @brief Store a vector, skipping masked lanes.
+ *
+ * All masked lanes must be at the end of vector, after all non-masked lanes.
+ */
+ASTCENC_SIMD_INLINE void store_lanes_masked(int* base, vint4 data, vmask4 mask)
+{
+ if (mask.m[3])
+ {
+ store(data, base);
+ }
+ else if (mask.m[2])
+ {
+ base[0] = data.lane<0>();
+ base[1] = data.lane<1>();
+ base[2] = data.lane<2>();
+ }
+ else if (mask.m[1])
+ {
+ base[0] = data.lane<0>();
+ base[1] = data.lane<1>();
+ }
+ else if (mask.m[0])
+ {
+ base[0] = data.lane<0>();
+ }
+}
+
+#endif // #ifndef ASTC_VECMATHLIB_NONE_4_H_INCLUDED
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_sse_4.h b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_sse_4.h
new file mode 100644
index 00000000000..76fe577a899
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_vecmathlib_sse_4.h
@@ -0,0 +1,1283 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2019-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief 4x32-bit vectors, implemented using SSE.
+ *
+ * This module implements 4-wide 32-bit float, int, and mask vectors for x86
+ * SSE. The implementation requires at least SSE2, but higher levels of SSE can
+ * be selected at compile time to improve performance.
+ *
+ * There is a baseline level of functionality provided by all vector widths and
+ * implementations. This is implemented using identical function signatures,
+ * modulo data type, so we can use them as substitutable implementations in VLA
+ * code.
+ *
+ * The 4-wide vectors are also used as a fixed-width type, and significantly
+ * extend the functionality above that available to VLA code.
+ */
+
+#ifndef ASTC_VECMATHLIB_SSE_4_H_INCLUDED
+#define ASTC_VECMATHLIB_SSE_4_H_INCLUDED
+
+#ifndef ASTCENC_SIMD_INLINE
+ #error "Include astcenc_vecmathlib.h, do not include directly"
+#endif
+
+#include <cstdio>
+
+// ============================================================================
+// vfloat4 data type
+// ============================================================================
+
+/**
+ * @brief Data type for 4-wide floats.
+ */
+struct vfloat4
+{
+ /**
+ * @brief Construct from zero-initialized value.
+ */
+ ASTCENC_SIMD_INLINE vfloat4() = default;
+
+ /**
+ * @brief Construct from 4 values loaded from an unaligned address.
+ *
+ * Consider using loada() which is better with vectors if data is aligned
+ * to vector length.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat4(const float *p)
+ {
+ m = _mm_loadu_ps(p);
+ }
+
+ /**
+ * @brief Construct from 1 scalar value replicated across all lanes.
+ *
+ * Consider using zero() for constexpr zeros.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat4(float a)
+ {
+ m = _mm_set1_ps(a);
+ }
+
+ /**
+ * @brief Construct from 4 scalar values.
+ *
+ * The value of @c a is stored to lane 0 (LSB) in the SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat4(float a, float b, float c, float d)
+ {
+ m = _mm_set_ps(d, c, b, a);
+ }
+
+ /**
+ * @brief Construct from an existing SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vfloat4(__m128 a)
+ {
+ m = a;
+ }
+
+ /**
+ * @brief Get the scalar value of a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE float lane() const
+ {
+ return _mm_cvtss_f32(_mm_shuffle_ps(m, m, l));
+ }
+
+ /**
+ * @brief Set the scalar value of a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE void set_lane(float a)
+ {
+#if ASTCENC_SSE >= 41
+ __m128 v = _mm_set1_ps(a);
+ m = _mm_insert_ps(m, v, l << 6 | l << 4);
+#else
+ alignas(16) float idx[4];
+ _mm_store_ps(idx, m);
+ idx[l] = a;
+ m = _mm_load_ps(idx);
+#endif
+ }
+
+ /**
+ * @brief Factory that returns a vector of zeros.
+ */
+ static ASTCENC_SIMD_INLINE vfloat4 zero()
+ {
+ return vfloat4(_mm_setzero_ps());
+ }
+
+ /**
+ * @brief Factory that returns a replicated scalar loaded from memory.
+ */
+ static ASTCENC_SIMD_INLINE vfloat4 load1(const float* p)
+ {
+ return vfloat4(_mm_load_ps1(p));
+ }
+
+ /**
+ * @brief Factory that returns a vector loaded from 16B aligned memory.
+ */
+ static ASTCENC_SIMD_INLINE vfloat4 loada(const float* p)
+ {
+ return vfloat4(_mm_load_ps(p));
+ }
+
+ /**
+ * @brief Factory that returns a vector containing the lane IDs.
+ */
+ static ASTCENC_SIMD_INLINE vfloat4 lane_id()
+ {
+ return vfloat4(_mm_set_ps(3, 2, 1, 0));
+ }
+
+ /**
+ * @brief Return a swizzled float 2.
+ */
+ template <int l0, int l1> ASTCENC_SIMD_INLINE vfloat4 swz() const
+ {
+ vfloat4 result(_mm_shuffle_ps(m, m, l0 | l1 << 2));
+ result.set_lane<2>(0.0f);
+ result.set_lane<3>(0.0f);
+ return result;
+ }
+
+ /**
+ * @brief Return a swizzled float 3.
+ */
+ template <int l0, int l1, int l2> ASTCENC_SIMD_INLINE vfloat4 swz() const
+ {
+ vfloat4 result(_mm_shuffle_ps(m, m, l0 | l1 << 2 | l2 << 4));
+ result.set_lane<3>(0.0f);
+ return result;
+ }
+
+ /**
+ * @brief Return a swizzled float 4.
+ */
+ template <int l0, int l1, int l2, int l3> ASTCENC_SIMD_INLINE vfloat4 swz() const
+ {
+ return vfloat4(_mm_shuffle_ps(m, m, l0 | l1 << 2 | l2 << 4 | l3 << 6));
+ }
+
+ /**
+ * @brief The vector ...
+ */
+ __m128 m;
+};
+
+// ============================================================================
+// vint4 data type
+// ============================================================================
+
+/**
+ * @brief Data type for 4-wide ints.
+ */
+struct vint4
+{
+ /**
+ * @brief Construct from zero-initialized value.
+ */
+ ASTCENC_SIMD_INLINE vint4() = default;
+
+ /**
+ * @brief Construct from 4 values loaded from an unaligned address.
+ *
+ * Consider using loada() which is better with vectors if data is aligned
+ * to vector length.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(const int *p)
+ {
+ m = _mm_loadu_si128(reinterpret_cast<const __m128i*>(p));
+ }
+
+ /**
+ * @brief Construct from 4 uint8_t loaded from an unaligned address.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(const uint8_t *p)
+ {
+ // _mm_loadu_si32 would be nicer syntax, but missing on older GCC
+ __m128i t = _mm_cvtsi32_si128(*reinterpret_cast<const int*>(p));
+
+#if ASTCENC_SSE >= 41
+ m = _mm_cvtepu8_epi32(t);
+#else
+ t = _mm_unpacklo_epi8(t, _mm_setzero_si128());
+ m = _mm_unpacklo_epi16(t, _mm_setzero_si128());
+#endif
+ }
+
+ /**
+ * @brief Construct from 1 scalar value replicated across all lanes.
+ *
+ * Consider using vfloat4::zero() for constexpr zeros.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(int a)
+ {
+ m = _mm_set1_epi32(a);
+ }
+
+ /**
+ * @brief Construct from 4 scalar values.
+ *
+ * The value of @c a is stored to lane 0 (LSB) in the SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(int a, int b, int c, int d)
+ {
+ m = _mm_set_epi32(d, c, b, a);
+ }
+
+ /**
+ * @brief Construct from an existing SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vint4(__m128i a)
+ {
+ m = a;
+ }
+
+ /**
+ * @brief Get the scalar from a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE int lane() const
+ {
+ return _mm_cvtsi128_si32(_mm_shuffle_epi32(m, l));
+ }
+
+ /**
+ * @brief Set the scalar value of a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE void set_lane(int a)
+ {
+#if ASTCENC_SSE >= 41
+ m = _mm_insert_epi32(m, a, l);
+#else
+ alignas(16) int idx[4];
+ _mm_store_si128(reinterpret_cast<__m128i*>(idx), m);
+ idx[l] = a;
+ m = _mm_load_si128(reinterpret_cast<const __m128i*>(idx));
+#endif
+ }
+
+ /**
+ * @brief Factory that returns a vector of zeros.
+ */
+ static ASTCENC_SIMD_INLINE vint4 zero()
+ {
+ return vint4(_mm_setzero_si128());
+ }
+
+ /**
+ * @brief Factory that returns a replicated scalar loaded from memory.
+ */
+ static ASTCENC_SIMD_INLINE vint4 load1(const int* p)
+ {
+ return vint4(*p);
+ }
+
+ /**
+ * @brief Factory that returns a vector loaded from 16B aligned memory.
+ */
+ static ASTCENC_SIMD_INLINE vint4 loada(const int* p)
+ {
+ return vint4(_mm_load_si128(reinterpret_cast<const __m128i*>(p)));
+ }
+
+ /**
+ * @brief Factory that returns a vector containing the lane IDs.
+ */
+ static ASTCENC_SIMD_INLINE vint4 lane_id()
+ {
+ return vint4(_mm_set_epi32(3, 2, 1, 0));
+ }
+
+ /**
+ * @brief The vector ...
+ */
+ __m128i m;
+};
+
+// ============================================================================
+// vmask4 data type
+// ============================================================================
+
+/**
+ * @brief Data type for 4-wide control plane masks.
+ */
+struct vmask4
+{
+ /**
+ * @brief Construct from an existing SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask4(__m128 a)
+ {
+ m = a;
+ }
+
+ /**
+ * @brief Construct from an existing SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask4(__m128i a)
+ {
+ m = _mm_castsi128_ps(a);
+ }
+
+ /**
+ * @brief Construct from 1 scalar value.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask4(bool a)
+ {
+ vint4 mask(a == false ? 0 : -1);
+ m = _mm_castsi128_ps(mask.m);
+ }
+
+ /**
+ * @brief Construct from 4 scalar values.
+ *
+ * The value of @c a is stored to lane 0 (LSB) in the SIMD register.
+ */
+ ASTCENC_SIMD_INLINE explicit vmask4(bool a, bool b, bool c, bool d)
+ {
+ vint4 mask(a == false ? 0 : -1,
+ b == false ? 0 : -1,
+ c == false ? 0 : -1,
+ d == false ? 0 : -1);
+
+ m = _mm_castsi128_ps(mask.m);
+ }
+
+ /**
+ * @brief Get the scalar value of a single lane.
+ */
+ template <int l> ASTCENC_SIMD_INLINE float lane() const
+ {
+ return _mm_cvtss_f32(_mm_shuffle_ps(m, m, l));
+ }
+
+ /**
+ * @brief The vector ...
+ */
+ __m128 m;
+};
+
+// ============================================================================
+// vmask4 operators and functions
+// ============================================================================
+
+/**
+ * @brief Overload: mask union (or).
+ */
+ASTCENC_SIMD_INLINE vmask4 operator|(vmask4 a, vmask4 b)
+{
+ return vmask4(_mm_or_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: mask intersect (and).
+ */
+ASTCENC_SIMD_INLINE vmask4 operator&(vmask4 a, vmask4 b)
+{
+ return vmask4(_mm_and_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: mask difference (xor).
+ */
+ASTCENC_SIMD_INLINE vmask4 operator^(vmask4 a, vmask4 b)
+{
+ return vmask4(_mm_xor_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: mask invert (not).
+ */
+ASTCENC_SIMD_INLINE vmask4 operator~(vmask4 a)
+{
+ return vmask4(_mm_xor_si128(_mm_castps_si128(a.m), _mm_set1_epi32(-1)));
+}
+
+/**
+ * @brief Return a 4-bit mask code indicating mask status.
+ *
+ * bit0 = lane 0
+ */
+ASTCENC_SIMD_INLINE unsigned int mask(vmask4 a)
+{
+ return static_cast<unsigned int>(_mm_movemask_ps(a.m));
+}
+
+// ============================================================================
+// vint4 operators and functions
+// ============================================================================
+
+/**
+ * @brief Overload: vector by vector addition.
+ */
+ASTCENC_SIMD_INLINE vint4 operator+(vint4 a, vint4 b)
+{
+ return vint4(_mm_add_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector subtraction.
+ */
+ASTCENC_SIMD_INLINE vint4 operator-(vint4 a, vint4 b)
+{
+ return vint4(_mm_sub_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector multiplication.
+ */
+ASTCENC_SIMD_INLINE vint4 operator*(vint4 a, vint4 b)
+{
+#if ASTCENC_SSE >= 41
+ return vint4(_mm_mullo_epi32 (a.m, b.m));
+#else
+ __m128i t1 = _mm_mul_epu32(a.m, b.m);
+ __m128i t2 = _mm_mul_epu32(
+ _mm_srli_si128(a.m, 4),
+ _mm_srli_si128(b.m, 4));
+ __m128i r = _mm_unpacklo_epi32(
+ _mm_shuffle_epi32(t1, _MM_SHUFFLE (0, 0, 2, 0)),
+ _mm_shuffle_epi32(t2, _MM_SHUFFLE (0, 0, 2, 0)));
+ return vint4(r);
+#endif
+}
+
+/**
+ * @brief Overload: vector bit invert.
+ */
+ASTCENC_SIMD_INLINE vint4 operator~(vint4 a)
+{
+ return vint4(_mm_xor_si128(a.m, _mm_set1_epi32(-1)));
+}
+
+/**
+ * @brief Overload: vector by vector bitwise or.
+ */
+ASTCENC_SIMD_INLINE vint4 operator|(vint4 a, vint4 b)
+{
+ return vint4(_mm_or_si128(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector bitwise and.
+ */
+ASTCENC_SIMD_INLINE vint4 operator&(vint4 a, vint4 b)
+{
+ return vint4(_mm_and_si128(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector bitwise xor.
+ */
+ASTCENC_SIMD_INLINE vint4 operator^(vint4 a, vint4 b)
+{
+ return vint4(_mm_xor_si128(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector equality.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator==(vint4 a, vint4 b)
+{
+ return vmask4(_mm_cmpeq_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector inequality.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator!=(vint4 a, vint4 b)
+{
+ return ~vmask4(_mm_cmpeq_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector less than.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator<(vint4 a, vint4 b)
+{
+ return vmask4(_mm_cmplt_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector greater than.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator>(vint4 a, vint4 b)
+{
+ return vmask4(_mm_cmpgt_epi32(a.m, b.m));
+}
+
+/**
+ * @brief Logical shift left.
+ */
+template <int s> ASTCENC_SIMD_INLINE vint4 lsl(vint4 a)
+{
+ return vint4(_mm_slli_epi32(a.m, s));
+}
+
+/**
+ * @brief Logical shift right.
+ */
+template <int s> ASTCENC_SIMD_INLINE vint4 lsr(vint4 a)
+{
+ return vint4(_mm_srli_epi32(a.m, s));
+}
+
+/**
+ * @brief Arithmetic shift right.
+ */
+template <int s> ASTCENC_SIMD_INLINE vint4 asr(vint4 a)
+{
+ return vint4(_mm_srai_epi32(a.m, s));
+}
+
+/**
+ * @brief Return the min vector of two vectors.
+ */
+ASTCENC_SIMD_INLINE vint4 min(vint4 a, vint4 b)
+{
+#if ASTCENC_SSE >= 41
+ return vint4(_mm_min_epi32(a.m, b.m));
+#else
+ vmask4 d = a < b;
+ __m128i ap = _mm_and_si128(_mm_castps_si128(d.m), a.m);
+ __m128i bp = _mm_andnot_si128(_mm_castps_si128(d.m), b.m);
+ return vint4(_mm_or_si128(ap,bp));
+#endif
+}
+
+/**
+ * @brief Return the max vector of two vectors.
+ */
+ASTCENC_SIMD_INLINE vint4 max(vint4 a, vint4 b)
+{
+#if ASTCENC_SSE >= 41
+ return vint4(_mm_max_epi32(a.m, b.m));
+#else
+ vmask4 d = a > b;
+ __m128i ap = _mm_and_si128(_mm_castps_si128(d.m), a.m);
+ __m128i bp = _mm_andnot_si128(_mm_castps_si128(d.m), b.m);
+ return vint4(_mm_or_si128(ap,bp));
+#endif
+}
+
+/**
+ * @brief Return the horizontal minimum of a vector.
+ */
+ASTCENC_SIMD_INLINE vint4 hmin(vint4 a)
+{
+ a = min(a, vint4(_mm_shuffle_epi32(a.m, _MM_SHUFFLE(0, 0, 3, 2))));
+ a = min(a, vint4(_mm_shuffle_epi32(a.m, _MM_SHUFFLE(0, 0, 0, 1))));
+ return vint4(_mm_shuffle_epi32(a.m, _MM_SHUFFLE(0, 0, 0, 0)));
+}
+
+/*
+ * @brief Return the horizontal maximum of a vector.
+ */
+ASTCENC_SIMD_INLINE vint4 hmax(vint4 a)
+{
+ a = max(a, vint4(_mm_shuffle_epi32(a.m, _MM_SHUFFLE(0, 0, 3, 2))));
+ a = max(a, vint4(_mm_shuffle_epi32(a.m, _MM_SHUFFLE(0, 0, 0, 1))));
+ return vint4(_mm_shuffle_epi32(a.m, _MM_SHUFFLE(0, 0, 0, 0)));
+}
+
+/**
+ * @brief Return the horizontal sum of a vector as a scalar.
+ */
+ASTCENC_SIMD_INLINE int hadd_s(vint4 a)
+{
+ // Add top and bottom halves, lane 1/0
+ __m128i fold = _mm_castps_si128(_mm_movehl_ps(_mm_castsi128_ps(a.m),
+ _mm_castsi128_ps(a.m)));
+ __m128i t = _mm_add_epi32(a.m, fold);
+
+ // Add top and bottom halves, lane 0 (_mm_hadd_ps exists but slow)
+ t = _mm_add_epi32(t, _mm_shuffle_epi32(t, 0x55));
+
+ return _mm_cvtsi128_si32(t);
+}
+
+/**
+ * @brief Store a vector to a 16B aligned memory address.
+ */
+ASTCENC_SIMD_INLINE void storea(vint4 a, int* p)
+{
+ _mm_store_si128(reinterpret_cast<__m128i*>(p), a.m);
+}
+
+/**
+ * @brief Store a vector to an unaligned memory address.
+ */
+ASTCENC_SIMD_INLINE void store(vint4 a, int* p)
+{
+ // Cast due to missing intrinsics
+ _mm_storeu_ps(reinterpret_cast<float*>(p), _mm_castsi128_ps(a.m));
+}
+
+/**
+ * @brief Store lowest N (vector width) bytes into an unaligned address.
+ */
+ASTCENC_SIMD_INLINE void store_nbytes(vint4 a, uint8_t* p)
+{
+ // Cast due to missing intrinsics
+ _mm_store_ss(reinterpret_cast<float*>(p), _mm_castsi128_ps(a.m));
+}
+
+/**
+ * @brief Gather N (vector width) indices from the array.
+ */
+ASTCENC_SIMD_INLINE vint4 gatheri(const int* base, vint4 indices)
+{
+#if ASTCENC_AVX >= 2
+ return vint4(_mm_i32gather_epi32(base, indices.m, 4));
+#else
+ alignas(16) int idx[4];
+ storea(indices, idx);
+ return vint4(base[idx[0]], base[idx[1]], base[idx[2]], base[idx[3]]);
+#endif
+}
+
+/**
+ * @brief Pack low 8 bits of N (vector width) lanes into bottom of vector.
+ */
+ASTCENC_SIMD_INLINE vint4 pack_low_bytes(vint4 a)
+{
+#if ASTCENC_SSE >= 41
+ __m128i shuf = _mm_set_epi8(0,0,0,0, 0,0,0,0, 0,0,0,0, 12,8,4,0);
+ return vint4(_mm_shuffle_epi8(a.m, shuf));
+#else
+ __m128i va = _mm_unpacklo_epi8(a.m, _mm_shuffle_epi32(a.m, _MM_SHUFFLE(1,1,1,1)));
+ __m128i vb = _mm_unpackhi_epi8(a.m, _mm_shuffle_epi32(a.m, _MM_SHUFFLE(3,3,3,3)));
+ return vint4(_mm_unpacklo_epi16(va, vb));
+#endif
+}
+
+/**
+ * @brief Return lanes from @c b if @c cond is set, else @c a.
+ */
+ASTCENC_SIMD_INLINE vint4 select(vint4 a, vint4 b, vmask4 cond)
+{
+ __m128i condi = _mm_castps_si128(cond.m);
+
+#if ASTCENC_SSE >= 41
+ return vint4(_mm_blendv_epi8(a.m, b.m, condi));
+#else
+ return vint4(_mm_or_si128(_mm_and_si128(condi, b.m), _mm_andnot_si128(condi, a.m)));
+#endif
+}
+
+// ============================================================================
+// vfloat4 operators and functions
+// ============================================================================
+
+/**
+ * @brief Overload: vector by vector addition.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator+(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(_mm_add_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector subtraction.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator-(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(_mm_sub_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector multiplication.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator*(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(_mm_mul_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector division.
+ */
+ASTCENC_SIMD_INLINE vfloat4 operator/(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(_mm_div_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector equality.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator==(vfloat4 a, vfloat4 b)
+{
+ return vmask4(_mm_cmpeq_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector inequality.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator!=(vfloat4 a, vfloat4 b)
+{
+ return vmask4(_mm_cmpneq_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector less than.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator<(vfloat4 a, vfloat4 b)
+{
+ return vmask4(_mm_cmplt_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector greater than.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator>(vfloat4 a, vfloat4 b)
+{
+ return vmask4(_mm_cmpgt_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector less than or equal.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator<=(vfloat4 a, vfloat4 b)
+{
+ return vmask4(_mm_cmple_ps(a.m, b.m));
+}
+
+/**
+ * @brief Overload: vector by vector greater than or equal.
+ */
+ASTCENC_SIMD_INLINE vmask4 operator>=(vfloat4 a, vfloat4 b)
+{
+ return vmask4(_mm_cmpge_ps(a.m, b.m));
+}
+
+/**
+ * @brief Return the min vector of two vectors.
+ *
+ * If either lane value is NaN, @c b will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat4 min(vfloat4 a, vfloat4 b)
+{
+ // Do not reorder - second operand will return if either is NaN
+ return vfloat4(_mm_min_ps(a.m, b.m));
+}
+
+/**
+ * @brief Return the max vector of two vectors.
+ *
+ * If either lane value is NaN, @c b will be returned for that lane.
+ */
+ASTCENC_SIMD_INLINE vfloat4 max(vfloat4 a, vfloat4 b)
+{
+ // Do not reorder - second operand will return if either is NaN
+ return vfloat4(_mm_max_ps(a.m, b.m));
+}
+
+/**
+ * @brief Return the absolute value of the float vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 abs(vfloat4 a)
+{
+ return vfloat4(_mm_max_ps(_mm_sub_ps(_mm_setzero_ps(), a.m), a.m));
+}
+
+/**
+ * @brief Return a float rounded to the nearest integer value.
+ */
+ASTCENC_SIMD_INLINE vfloat4 round(vfloat4 a)
+{
+#if ASTCENC_SSE >= 41
+ constexpr int flags = _MM_FROUND_TO_NEAREST_INT | _MM_FROUND_NO_EXC;
+ return vfloat4(_mm_round_ps(a.m, flags));
+#else
+ __m128 v = a.m;
+ __m128 neg_zero = _mm_castsi128_ps(_mm_set1_epi32(static_cast<int>(0x80000000)));
+ __m128 no_fraction = _mm_set1_ps(8388608.0f);
+ __m128 abs_mask = _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF));
+ __m128 sign = _mm_and_ps(v, neg_zero);
+ __m128 s_magic = _mm_or_ps(no_fraction, sign);
+ __m128 r1 = _mm_add_ps(v, s_magic);
+ r1 = _mm_sub_ps(r1, s_magic);
+ __m128 r2 = _mm_and_ps(v, abs_mask);
+ __m128 mask = _mm_cmple_ps(r2, no_fraction);
+ r2 = _mm_andnot_ps(mask, v);
+ r1 = _mm_and_ps(r1, mask);
+ return vfloat4(_mm_xor_ps(r1, r2));
+#endif
+}
+
+/**
+ * @brief Return the horizontal minimum of a vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 hmin(vfloat4 a)
+{
+ a = min(a, vfloat4(_mm_shuffle_ps(a.m, a.m, _MM_SHUFFLE(0, 0, 3, 2))));
+ a = min(a, vfloat4(_mm_shuffle_ps(a.m, a.m, _MM_SHUFFLE(0, 0, 0, 1))));
+ return vfloat4(_mm_shuffle_ps(a.m, a.m, _MM_SHUFFLE(0, 0, 0, 0)));
+}
+
+/**
+ * @brief Return the horizontal maximum of a vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 hmax(vfloat4 a)
+{
+ a = max(a, vfloat4(_mm_shuffle_ps(a.m, a.m, _MM_SHUFFLE(0, 0, 3, 2))));
+ a = max(a, vfloat4(_mm_shuffle_ps(a.m, a.m, _MM_SHUFFLE(0, 0, 0, 1))));
+ return vfloat4(_mm_shuffle_ps(a.m, a.m, _MM_SHUFFLE(0, 0, 0, 0)));
+}
+
+/**
+ * @brief Return the horizontal sum of a vector as a scalar.
+ */
+ASTCENC_SIMD_INLINE float hadd_s(vfloat4 a)
+{
+ // Add top and bottom halves, lane 1/0
+ __m128 t = _mm_add_ps(a.m, _mm_movehl_ps(a.m, a.m));
+
+ // Add top and bottom halves, lane 0 (_mm_hadd_ps exists but slow)
+ t = _mm_add_ss(t, _mm_shuffle_ps(t, t, 0x55));
+
+ return _mm_cvtss_f32(t);
+}
+
+/**
+ * @brief Return the sqrt of the lanes in the vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 sqrt(vfloat4 a)
+{
+ return vfloat4(_mm_sqrt_ps(a.m));
+}
+
+/**
+ * @brief Return lanes from @c b if @c cond is set, else @c a.
+ */
+ASTCENC_SIMD_INLINE vfloat4 select(vfloat4 a, vfloat4 b, vmask4 cond)
+{
+#if ASTCENC_SSE >= 41
+ return vfloat4(_mm_blendv_ps(a.m, b.m, cond.m));
+#else
+ return vfloat4(_mm_or_ps(_mm_and_ps(cond.m, b.m), _mm_andnot_ps(cond.m, a.m)));
+#endif
+}
+
+/**
+ * @brief Return lanes from @c b if MSB of @c cond is set, else @c a.
+ */
+ASTCENC_SIMD_INLINE vfloat4 select_msb(vfloat4 a, vfloat4 b, vmask4 cond)
+{
+#if ASTCENC_SSE >= 41
+ return vfloat4(_mm_blendv_ps(a.m, b.m, cond.m));
+#else
+ __m128 d = _mm_castsi128_ps(_mm_srai_epi32(_mm_castps_si128(cond.m), 31));
+ return vfloat4(_mm_or_ps(_mm_and_ps(d, b.m), _mm_andnot_ps(d, a.m)));
+#endif
+}
+
+/**
+ * @brief Load a vector of gathered results from an array;
+ */
+ASTCENC_SIMD_INLINE vfloat4 gatherf(const float* base, vint4 indices)
+{
+#if ASTCENC_AVX >= 2
+ return vfloat4(_mm_i32gather_ps(base, indices.m, 4));
+#else
+ alignas(16) int idx[4];
+ storea(indices, idx);
+ return vfloat4(base[idx[0]], base[idx[1]], base[idx[2]], base[idx[3]]);
+#endif
+}
+
+/**
+ * @brief Store a vector to an unaligned memory address.
+ */
+ASTCENC_SIMD_INLINE void store(vfloat4 a, float* p)
+{
+ _mm_storeu_ps(p, a.m);
+}
+
+/**
+ * @brief Store a vector to a 16B aligned memory address.
+ */
+ASTCENC_SIMD_INLINE void storea(vfloat4 a, float* p)
+{
+ _mm_store_ps(p, a.m);
+}
+
+/**
+ * @brief Return a integer value for a float vector, using truncation.
+ */
+ASTCENC_SIMD_INLINE vint4 float_to_int(vfloat4 a)
+{
+ return vint4(_mm_cvttps_epi32(a.m));
+}
+
+/**
+ * @brief Return a integer value for a float vector, using round-to-nearest.
+ */
+ASTCENC_SIMD_INLINE vint4 float_to_int_rtn(vfloat4 a)
+{
+ a = round(a);
+ return vint4(_mm_cvttps_epi32(a.m));
+}
+
+/**
+ * @brief Return a float value for an integer vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 int_to_float(vint4 a)
+{
+ return vfloat4(_mm_cvtepi32_ps(a.m));
+}
+
+/**
+ * @brief Return a float16 value for a float vector, using round-to-nearest.
+ */
+ASTCENC_SIMD_INLINE vint4 float_to_float16(vfloat4 a)
+{
+#if ASTCENC_F16C >= 1
+ __m128i packedf16 = _mm_cvtps_ph(a.m, 0);
+ __m128i f16 = _mm_cvtepu16_epi32(packedf16);
+ return vint4(f16);
+#else
+ return vint4(
+ float_to_sf16(a.lane<0>()),
+ float_to_sf16(a.lane<1>()),
+ float_to_sf16(a.lane<2>()),
+ float_to_sf16(a.lane<3>()));
+#endif
+}
+
+/**
+ * @brief Return a float16 value for a float scalar, using round-to-nearest.
+ */
+static inline uint16_t float_to_float16(float a)
+{
+#if ASTCENC_F16C >= 1
+ __m128i f16 = _mm_cvtps_ph(_mm_set1_ps(a), 0);
+ return static_cast<uint16_t>(_mm_cvtsi128_si32(f16));
+#else
+ return float_to_sf16(a);
+#endif
+}
+
+/**
+ * @brief Return a float value for a float16 vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 float16_to_float(vint4 a)
+{
+#if ASTCENC_F16C >= 1
+ __m128i packed = _mm_packs_epi32(a.m, a.m);
+ __m128 f32 = _mm_cvtph_ps(packed);
+ return vfloat4(f32);
+#else
+ return vfloat4(
+ sf16_to_float(static_cast<uint16_t>(a.lane<0>())),
+ sf16_to_float(static_cast<uint16_t>(a.lane<1>())),
+ sf16_to_float(static_cast<uint16_t>(a.lane<2>())),
+ sf16_to_float(static_cast<uint16_t>(a.lane<3>())));
+#endif
+}
+
+/**
+ * @brief Return a float value for a float16 scalar.
+ */
+ASTCENC_SIMD_INLINE float float16_to_float(uint16_t a)
+{
+#if ASTCENC_F16C >= 1
+ __m128i packed = _mm_set1_epi16(static_cast<short>(a));
+ __m128 f32 = _mm_cvtph_ps(packed);
+ return _mm_cvtss_f32(f32);
+#else
+ return sf16_to_float(a);
+#endif
+}
+
+/**
+ * @brief Return a float value as an integer bit pattern (i.e. no conversion).
+ *
+ * It is a common trick to convert floats into integer bit patterns, perform
+ * some bit hackery based on knowledge they are IEEE 754 layout, and then
+ * convert them back again. This is the first half of that flip.
+ */
+ASTCENC_SIMD_INLINE vint4 float_as_int(vfloat4 a)
+{
+ return vint4(_mm_castps_si128(a.m));
+}
+
+/**
+ * @brief Return a integer value as a float bit pattern (i.e. no conversion).
+ *
+ * It is a common trick to convert floats into integer bit patterns, perform
+ * some bit hackery based on knowledge they are IEEE 754 layout, and then
+ * convert them back again. This is the second half of that flip.
+ */
+ASTCENC_SIMD_INLINE vfloat4 int_as_float(vint4 v)
+{
+ return vfloat4(_mm_castsi128_ps(v.m));
+}
+
+/**
+ * @brief Prepare a vtable lookup table for use with the native SIMD size.
+ */
+ASTCENC_SIMD_INLINE void vtable_prepare(vint4 t0, vint4& t0p)
+{
+ t0p = t0;
+}
+
+/**
+ * @brief Prepare a vtable lookup table for use with the native SIMD size.
+ */
+ASTCENC_SIMD_INLINE void vtable_prepare(vint4 t0, vint4 t1, vint4& t0p, vint4& t1p)
+{
+#if ASTCENC_SSE >= 30
+ t0p = t0;
+ t1p = t0 ^ t1;
+#else
+ t0p = t0;
+ t1p = t1;
+#endif
+}
+
+/**
+ * @brief Prepare a vtable lookup table for use with the native SIMD size.
+ */
+ASTCENC_SIMD_INLINE void vtable_prepare(
+ vint4 t0, vint4 t1, vint4 t2, vint4 t3,
+ vint4& t0p, vint4& t1p, vint4& t2p, vint4& t3p)
+{
+#if ASTCENC_SSE >= 30
+ t0p = t0;
+ t1p = t0 ^ t1;
+ t2p = t1 ^ t2;
+ t3p = t2 ^ t3;
+#else
+ t0p = t0;
+ t1p = t1;
+ t2p = t2;
+ t3p = t3;
+#endif
+}
+
+/**
+ * @brief Perform an 8-bit 16-entry table lookup, with 32-bit indexes.
+ */
+ASTCENC_SIMD_INLINE vint4 vtable_8bt_32bi(vint4 t0, vint4 idx)
+{
+#if ASTCENC_SSE >= 30
+ // Set index byte MSB to 1 for unused bytes so shuffle returns zero
+ __m128i idxx = _mm_or_si128(idx.m, _mm_set1_epi32(static_cast<int>(0xFFFFFF00)));
+
+ __m128i result = _mm_shuffle_epi8(t0.m, idxx);
+ return vint4(result);
+#else
+ alignas(ASTCENC_VECALIGN) uint8_t table[16];
+ storea(t0, reinterpret_cast<int*>(table + 0));
+
+ return vint4(table[idx.lane<0>()],
+ table[idx.lane<1>()],
+ table[idx.lane<2>()],
+ table[idx.lane<3>()]);
+#endif
+}
+
+/**
+ * @brief Perform an 8-bit 32-entry table lookup, with 32-bit indexes.
+ */
+ASTCENC_SIMD_INLINE vint4 vtable_8bt_32bi(vint4 t0, vint4 t1, vint4 idx)
+{
+#if ASTCENC_SSE >= 30
+ // Set index byte MSB to 1 for unused bytes so shuffle returns zero
+ __m128i idxx = _mm_or_si128(idx.m, _mm_set1_epi32(static_cast<int>(0xFFFFFF00)));
+
+ __m128i result = _mm_shuffle_epi8(t0.m, idxx);
+ idxx = _mm_sub_epi8(idxx, _mm_set1_epi8(16));
+
+ __m128i result2 = _mm_shuffle_epi8(t1.m, idxx);
+ result = _mm_xor_si128(result, result2);
+
+ return vint4(result);
+#else
+ alignas(ASTCENC_VECALIGN) uint8_t table[32];
+ storea(t0, reinterpret_cast<int*>(table + 0));
+ storea(t1, reinterpret_cast<int*>(table + 16));
+
+ return vint4(table[idx.lane<0>()],
+ table[idx.lane<1>()],
+ table[idx.lane<2>()],
+ table[idx.lane<3>()]);
+#endif
+}
+
+/**
+ * @brief Perform an 8-bit 64-entry table lookup, with 32-bit indexes.
+ */
+ASTCENC_SIMD_INLINE vint4 vtable_8bt_32bi(vint4 t0, vint4 t1, vint4 t2, vint4 t3, vint4 idx)
+{
+#if ASTCENC_SSE >= 30
+ // Set index byte MSB to 1 for unused bytes so shuffle returns zero
+ __m128i idxx = _mm_or_si128(idx.m, _mm_set1_epi32(static_cast<int>(0xFFFFFF00)));
+
+ __m128i result = _mm_shuffle_epi8(t0.m, idxx);
+ idxx = _mm_sub_epi8(idxx, _mm_set1_epi8(16));
+
+ __m128i result2 = _mm_shuffle_epi8(t1.m, idxx);
+ result = _mm_xor_si128(result, result2);
+ idxx = _mm_sub_epi8(idxx, _mm_set1_epi8(16));
+
+ result2 = _mm_shuffle_epi8(t2.m, idxx);
+ result = _mm_xor_si128(result, result2);
+ idxx = _mm_sub_epi8(idxx, _mm_set1_epi8(16));
+
+ result2 = _mm_shuffle_epi8(t3.m, idxx);
+ result = _mm_xor_si128(result, result2);
+
+ return vint4(result);
+#else
+ alignas(ASTCENC_VECALIGN) uint8_t table[64];
+ storea(t0, reinterpret_cast<int*>(table + 0));
+ storea(t1, reinterpret_cast<int*>(table + 16));
+ storea(t2, reinterpret_cast<int*>(table + 32));
+ storea(t3, reinterpret_cast<int*>(table + 48));
+
+ return vint4(table[idx.lane<0>()],
+ table[idx.lane<1>()],
+ table[idx.lane<2>()],
+ table[idx.lane<3>()]);
+#endif
+}
+
+/**
+ * @brief Return a vector of interleaved RGBA data.
+ *
+ * Input vectors have the value stored in the bottom 8 bits of each lane,
+ * with high bits set to zero.
+ *
+ * Output vector stores a single RGBA texel packed in each lane.
+ */
+ASTCENC_SIMD_INLINE vint4 interleave_rgba8(vint4 r, vint4 g, vint4 b, vint4 a)
+{
+// Workaround an XCode compiler internal fault; note is slower than slli_epi32
+// so we should revert this when we get the opportunity
+#if defined(__APPLE__)
+ __m128i value = r.m;
+ value = _mm_add_epi32(value, _mm_bslli_si128(g.m, 1));
+ value = _mm_add_epi32(value, _mm_bslli_si128(b.m, 2));
+ value = _mm_add_epi32(value, _mm_bslli_si128(a.m, 3));
+ return vint4(value);
+#else
+ __m128i value = r.m;
+ value = _mm_add_epi32(value, _mm_slli_epi32(g.m, 8));
+ value = _mm_add_epi32(value, _mm_slli_epi32(b.m, 16));
+ value = _mm_add_epi32(value, _mm_slli_epi32(a.m, 24));
+ return vint4(value);
+#endif
+}
+
+/**
+ * @brief Store a vector, skipping masked lanes.
+ *
+ * All masked lanes must be at the end of vector, after all non-masked lanes.
+ */
+ASTCENC_SIMD_INLINE void store_lanes_masked(int* base, vint4 data, vmask4 mask)
+{
+#if ASTCENC_AVX >= 2
+ _mm_maskstore_epi32(base, _mm_castps_si128(mask.m), data.m);
+#else
+ // Note - we cannot use _mm_maskmoveu_si128 as the underlying hardware doesn't guarantee
+ // fault suppression on masked lanes so we can get page faults at the end of an image.
+ if (mask.lane<3>() != 0.0f)
+ {
+ store(data, base);
+ }
+ else if (mask.lane<2>() != 0.0f)
+ {
+ base[0] = data.lane<0>();
+ base[1] = data.lane<1>();
+ base[2] = data.lane<2>();
+ }
+ else if (mask.lane<1>() != 0.0f)
+ {
+ base[0] = data.lane<0>();
+ base[1] = data.lane<1>();
+ }
+ else if (mask.lane<0>() != 0.0f)
+ {
+ base[0] = data.lane<0>();
+ }
+#endif
+}
+
+#if defined(ASTCENC_NO_INVARIANCE) && (ASTCENC_SSE >= 41)
+
+#define ASTCENC_USE_NATIVE_DOT_PRODUCT 1
+
+/**
+ * @brief Return the dot product for the full 4 lanes, returning scalar.
+ */
+ASTCENC_SIMD_INLINE float dot_s(vfloat4 a, vfloat4 b)
+{
+ return _mm_cvtss_f32(_mm_dp_ps(a.m, b.m, 0xFF));
+}
+
+/**
+ * @brief Return the dot product for the full 4 lanes, returning vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 dot(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(_mm_dp_ps(a.m, b.m, 0xFF));
+}
+
+/**
+ * @brief Return the dot product for the bottom 3 lanes, returning scalar.
+ */
+ASTCENC_SIMD_INLINE float dot3_s(vfloat4 a, vfloat4 b)
+{
+ return _mm_cvtss_f32(_mm_dp_ps(a.m, b.m, 0x77));
+}
+
+/**
+ * @brief Return the dot product for the bottom 3 lanes, returning vector.
+ */
+ASTCENC_SIMD_INLINE vfloat4 dot3(vfloat4 a, vfloat4 b)
+{
+ return vfloat4(_mm_dp_ps(a.m, b.m, 0x77));
+}
+
+#endif // #if defined(ASTCENC_NO_INVARIANCE) && (ASTCENC_SSE >= 41)
+
+#if ASTCENC_POPCNT >= 1
+
+#define ASTCENC_USE_NATIVE_POPCOUNT 1
+
+/**
+ * @brief Population bit count.
+ *
+ * @param v The value to population count.
+ *
+ * @return The number of 1 bits.
+ */
+ASTCENC_SIMD_INLINE int popcount(uint64_t v)
+{
+ return static_cast<int>(_mm_popcnt_u64(v));
+}
+
+#endif // ASTCENC_POPCNT >= 1
+
+#endif // #ifndef ASTC_VECMATHLIB_SSE_4_H_INCLUDED
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_weight_align.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_weight_align.cpp
new file mode 100644
index 00000000000..e40a318cf52
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_weight_align.cpp
@@ -0,0 +1,479 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2022 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+#if !defined(ASTCENC_DECOMPRESS_ONLY)
+
+/**
+ * @brief Functions for angular-sum algorithm for weight alignment.
+ *
+ * This algorithm works as follows:
+ * - we compute a complex number P as (cos s*i, sin s*i) for each weight,
+ * where i is the input value and s is a scaling factor based on the spacing between the weights.
+ * - we then add together complex numbers for all the weights.
+ * - we then compute the length and angle of the resulting sum.
+ *
+ * This should produce the following results:
+ * - perfect alignment results in a vector whose length is equal to the sum of lengths of all inputs
+ * - even distribution results in a vector of length 0.
+ * - all samples identical results in perfect alignment for every scaling.
+ *
+ * For each scaling factor within a given set, we compute an alignment factor from 0 to 1. This
+ * should then result in some scalings standing out as having particularly good alignment factors;
+ * we can use this to produce a set of candidate scale/shift values for various quantization levels;
+ * we should then actually try them and see what happens.
+ */
+
+#include "astcenc_internal.h"
+#include "astcenc_vecmathlib.h"
+
+#include <stdio.h>
+#include <cassert>
+#include <cstring>
+
+static constexpr unsigned int ANGULAR_STEPS { 32 };
+
+static_assert((ANGULAR_STEPS % ASTCENC_SIMD_WIDTH) == 0,
+ "ANGULAR_STEPS must be multiple of ASTCENC_SIMD_WIDTH");
+
+static_assert(ANGULAR_STEPS >= 32,
+ "ANGULAR_STEPS must be at least max(steps_for_quant_level)");
+
+// Store a reduced sin/cos table for 64 possible weight values; this causes
+// slight quality loss compared to using sin() and cos() directly. Must be 2^N.
+static constexpr unsigned int SINCOS_STEPS { 64 };
+
+static const uint8_t steps_for_quant_level[12] {
+ 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32
+};
+
+alignas(ASTCENC_VECALIGN) static float sin_table[SINCOS_STEPS][ANGULAR_STEPS];
+alignas(ASTCENC_VECALIGN) static float cos_table[SINCOS_STEPS][ANGULAR_STEPS];
+
+#if defined(ASTCENC_DIAGNOSTICS)
+ static bool print_once { true };
+#endif
+
+/* See header for documentation. */
+void prepare_angular_tables()
+{
+ for (unsigned int i = 0; i < ANGULAR_STEPS; i++)
+ {
+ float angle_step = static_cast<float>(i + 1);
+
+ for (unsigned int j = 0; j < SINCOS_STEPS; j++)
+ {
+ sin_table[j][i] = static_cast<float>(sinf((2.0f * astc::PI / (SINCOS_STEPS - 1.0f)) * angle_step * static_cast<float>(j)));
+ cos_table[j][i] = static_cast<float>(cosf((2.0f * astc::PI / (SINCOS_STEPS - 1.0f)) * angle_step * static_cast<float>(j)));
+ }
+ }
+}
+
+/**
+ * @brief Compute the angular alignment factors and offsets.
+ *
+ * @param weight_count The number of (decimated) weights.
+ * @param dec_weight_ideal_value The ideal decimated unquantized weight values.
+ * @param max_angular_steps The maximum number of steps to be tested.
+ * @param[out] offsets The output angular offsets array.
+ */
+static void compute_angular_offsets(
+ unsigned int weight_count,
+ const float* dec_weight_ideal_value,
+ unsigned int max_angular_steps,
+ float* offsets
+) {
+ promise(weight_count > 0);
+ promise(max_angular_steps > 0);
+
+ alignas(ASTCENC_VECALIGN) int isamplev[BLOCK_MAX_WEIGHTS];
+
+ // Precompute isample; arrays are always allocated 64 elements long
+ for (unsigned int i = 0; i < weight_count; i += ASTCENC_SIMD_WIDTH)
+ {
+ // Add 2^23 and interpreting bits extracts round-to-nearest int
+ vfloat sample = loada(dec_weight_ideal_value + i) * (SINCOS_STEPS - 1.0f) + vfloat(12582912.0f);
+ vint isample = float_as_int(sample) & vint((SINCOS_STEPS - 1));
+ storea(isample, isamplev + i);
+ }
+
+ // Arrays are multiple of SIMD width (ANGULAR_STEPS), safe to overshoot max
+ vfloat mult = vfloat(1.0f / (2.0f * astc::PI));
+
+ for (unsigned int i = 0; i < max_angular_steps; i += ASTCENC_SIMD_WIDTH)
+ {
+ vfloat anglesum_x = vfloat::zero();
+ vfloat anglesum_y = vfloat::zero();
+
+ for (unsigned int j = 0; j < weight_count; j++)
+ {
+ int isample = isamplev[j];
+ anglesum_x += loada(cos_table[isample] + i);
+ anglesum_y += loada(sin_table[isample] + i);
+ }
+
+ vfloat angle = atan2(anglesum_y, anglesum_x);
+ vfloat ofs = angle * mult;
+ storea(ofs, offsets + i);
+ }
+}
+
+/**
+ * @brief For a given step size compute the lowest and highest weight.
+ *
+ * Compute the lowest and highest weight that results from quantizing using the given stepsize and
+ * offset, and then compute the resulting error. The cut errors indicate the error that results from
+ * forcing samples that should have had one weight value one step up or down.
+ *
+ * @param weight_count The number of (decimated) weights.
+ * @param dec_weight_ideal_value The ideal decimated unquantized weight values.
+ * @param max_angular_steps The maximum number of steps to be tested.
+ * @param max_quant_steps The maximum quantization level to be tested.
+ * @param offsets The angular offsets array.
+ * @param[out] lowest_weight Per angular step, the lowest weight.
+ * @param[out] weight_span Per angular step, the span between lowest and highest weight.
+ * @param[out] error Per angular step, the error.
+ * @param[out] cut_low_weight_error Per angular step, the low weight cut error.
+ * @param[out] cut_high_weight_error Per angular step, the high weight cut error.
+ */
+static void compute_lowest_and_highest_weight(
+ unsigned int weight_count,
+ const float* dec_weight_ideal_value,
+ unsigned int max_angular_steps,
+ unsigned int max_quant_steps,
+ const float* offsets,
+ float* lowest_weight,
+ int* weight_span,
+ float* error,
+ float* cut_low_weight_error,
+ float* cut_high_weight_error
+) {
+ promise(weight_count > 0);
+ promise(max_angular_steps > 0);
+
+ vfloat rcp_stepsize = vfloat::lane_id() + vfloat(1.0f);
+
+ // Arrays are ANGULAR_STEPS long, so always safe to run full vectors
+ for (unsigned int sp = 0; sp < max_angular_steps; sp += ASTCENC_SIMD_WIDTH)
+ {
+ vfloat minidx(128.0f);
+ vfloat maxidx(-128.0f);
+ vfloat errval = vfloat::zero();
+ vfloat cut_low_weight_err = vfloat::zero();
+ vfloat cut_high_weight_err = vfloat::zero();
+ vfloat offset = loada(offsets + sp);
+
+ for (unsigned int j = 0; j < weight_count; j++)
+ {
+ vfloat sval = load1(dec_weight_ideal_value + j) * rcp_stepsize - offset;
+ vfloat svalrte = round(sval);
+ vfloat diff = sval - svalrte;
+ errval += diff * diff;
+
+ // Reset tracker on min hit
+ vmask mask = svalrte < minidx;
+ minidx = select(minidx, svalrte, mask);
+ cut_low_weight_err = select(cut_low_weight_err, vfloat::zero(), mask);
+
+ // Accumulate on min hit
+ mask = svalrte == minidx;
+ vfloat accum = cut_low_weight_err + vfloat(1.0f) - vfloat(2.0f) * diff;
+ cut_low_weight_err = select(cut_low_weight_err, accum, mask);
+
+ // Reset tracker on max hit
+ mask = svalrte > maxidx;
+ maxidx = select(maxidx, svalrte, mask);
+ cut_high_weight_err = select(cut_high_weight_err, vfloat::zero(), mask);
+
+ // Accumulate on max hit
+ mask = svalrte == maxidx;
+ accum = cut_high_weight_err + vfloat(1.0f) + vfloat(2.0f) * diff;
+ cut_high_weight_err = select(cut_high_weight_err, accum, mask);
+ }
+
+ // Write out min weight and weight span; clamp span to a usable range
+ vint span = float_to_int(maxidx - minidx + vfloat(1));
+ span = min(span, vint(max_quant_steps + 3));
+ span = max(span, vint(2));
+ storea(minidx, lowest_weight + sp);
+ storea(span, weight_span + sp);
+
+ // The cut_(lowest/highest)_weight_error indicate the error that results from forcing
+ // samples that should have had the weight value one step (up/down).
+ vfloat ssize = 1.0f / rcp_stepsize;
+ vfloat errscale = ssize * ssize;
+ storea(errval * errscale, error + sp);
+ storea(cut_low_weight_err * errscale, cut_low_weight_error + sp);
+ storea(cut_high_weight_err * errscale, cut_high_weight_error + sp);
+
+ rcp_stepsize = rcp_stepsize + vfloat(ASTCENC_SIMD_WIDTH);
+ }
+}
+
+/**
+ * @brief The main function for the angular algorithm.
+ *
+ * @param weight_count The number of (decimated) weights.
+ * @param dec_weight_ideal_value The ideal decimated unquantized weight values.
+ * @param max_quant_level The maximum quantization level to be tested.
+ * @param[out] low_value Per angular step, the lowest weight value.
+ * @param[out] high_value Per angular step, the highest weight value.
+ */
+static void compute_angular_endpoints_for_quant_levels(
+ unsigned int weight_count,
+ const float* dec_weight_ideal_value,
+ unsigned int max_quant_level,
+ float low_value[TUNE_MAX_ANGULAR_QUANT + 1],
+ float high_value[TUNE_MAX_ANGULAR_QUANT + 1]
+) {
+ unsigned int max_quant_steps = steps_for_quant_level[max_quant_level];
+ unsigned int max_angular_steps = steps_for_quant_level[max_quant_level];
+
+ alignas(ASTCENC_VECALIGN) float angular_offsets[ANGULAR_STEPS];
+
+ compute_angular_offsets(weight_count, dec_weight_ideal_value,
+ max_angular_steps, angular_offsets);
+
+ alignas(ASTCENC_VECALIGN) float lowest_weight[ANGULAR_STEPS];
+ alignas(ASTCENC_VECALIGN) int32_t weight_span[ANGULAR_STEPS];
+ alignas(ASTCENC_VECALIGN) float error[ANGULAR_STEPS];
+ alignas(ASTCENC_VECALIGN) float cut_low_weight_error[ANGULAR_STEPS];
+ alignas(ASTCENC_VECALIGN) float cut_high_weight_error[ANGULAR_STEPS];
+
+ compute_lowest_and_highest_weight(weight_count, dec_weight_ideal_value,
+ max_angular_steps, max_quant_steps,
+ angular_offsets, lowest_weight, weight_span, error,
+ cut_low_weight_error, cut_high_weight_error);
+
+ // For each quantization level, find the best error terms. Use packed vectors so data-dependent
+ // branches can become selects. This involves some integer to float casts, but the values are
+ // small enough so they never round the wrong way.
+ vfloat4 best_results[36];
+
+ // Initialize the array to some safe defaults
+ promise(max_quant_steps > 0);
+ for (unsigned int i = 0; i < (max_quant_steps + 4); i++)
+ {
+ // Lane<0> = Best error
+ // Lane<1> = Best scale; -1 indicates no solution found
+ // Lane<2> = Cut low weight
+ best_results[i] = vfloat4(ERROR_CALC_DEFAULT, -1.0f, 0.0f, 0.0f);
+ }
+
+ promise(max_angular_steps > 0);
+ for (unsigned int i = 0; i < max_angular_steps; i++)
+ {
+ float i_flt = static_cast<float>(i);
+
+ int idx_span = weight_span[i];
+
+ float error_cut_low = error[i] + cut_low_weight_error[i];
+ float error_cut_high = error[i] + cut_high_weight_error[i];
+ float error_cut_low_high = error[i] + cut_low_weight_error[i] + cut_high_weight_error[i];
+
+ // Check best error against record N
+ vfloat4 best_result = best_results[idx_span];
+ vfloat4 new_result = vfloat4(error[i], i_flt, 0.0f, 0.0f);
+ vmask4 mask = vfloat4(best_result.lane<0>()) > vfloat4(error[i]);
+ best_results[idx_span] = select(best_result, new_result, mask);
+
+ // Check best error against record N-1 with either cut low or cut high
+ best_result = best_results[idx_span - 1];
+
+ new_result = vfloat4(error_cut_low, i_flt, 1.0f, 0.0f);
+ mask = vfloat4(best_result.lane<0>()) > vfloat4(error_cut_low);
+ best_result = select(best_result, new_result, mask);
+
+ new_result = vfloat4(error_cut_high, i_flt, 0.0f, 0.0f);
+ mask = vfloat4(best_result.lane<0>()) > vfloat4(error_cut_high);
+ best_results[idx_span - 1] = select(best_result, new_result, mask);
+
+ // Check best error against record N-2 with both cut low and high
+ best_result = best_results[idx_span - 2];
+ new_result = vfloat4(error_cut_low_high, i_flt, 1.0f, 0.0f);
+ mask = vfloat4(best_result.lane<0>()) > vfloat4(error_cut_low_high);
+ best_results[idx_span - 2] = select(best_result, new_result, mask);
+ }
+
+ for (unsigned int i = 0; i <= max_quant_level; i++)
+ {
+ unsigned int q = steps_for_quant_level[i];
+ int bsi = static_cast<int>(best_results[q].lane<1>());
+
+ // Did we find anything?
+#if defined(ASTCENC_DIAGNOSTICS)
+ if ((bsi < 0) && print_once)
+ {
+ print_once = false;
+ printf("INFO: Unable to find full encoding within search error limit.\n\n");
+ }
+#endif
+
+ bsi = astc::max(0, bsi);
+
+ float lwi = lowest_weight[bsi] + best_results[q].lane<2>();
+ float hwi = lwi + static_cast<float>(q) - 1.0f;
+
+ float stepsize = 1.0f / (1.0f + static_cast<float>(bsi));
+ low_value[i] = (angular_offsets[bsi] + lwi) * stepsize;
+ high_value[i] = (angular_offsets[bsi] + hwi) * stepsize;
+ }
+}
+
+/* See header for documentation. */
+void compute_angular_endpoints_1plane(
+ bool only_always,
+ const block_size_descriptor& bsd,
+ const float* dec_weight_ideal_value,
+ unsigned int max_weight_quant,
+ compression_working_buffers& tmpbuf
+) {
+ float (&low_value)[WEIGHTS_MAX_BLOCK_MODES] = tmpbuf.weight_low_value1;
+ float (&high_value)[WEIGHTS_MAX_BLOCK_MODES] = tmpbuf.weight_high_value1;
+
+ float (&low_values)[WEIGHTS_MAX_DECIMATION_MODES][TUNE_MAX_ANGULAR_QUANT + 1] = tmpbuf.weight_low_values1;
+ float (&high_values)[WEIGHTS_MAX_DECIMATION_MODES][TUNE_MAX_ANGULAR_QUANT + 1] = tmpbuf.weight_high_values1;
+
+ unsigned int max_decimation_modes = only_always ? bsd.decimation_mode_count_always
+ : bsd.decimation_mode_count_selected;
+ promise(max_decimation_modes > 0);
+ for (unsigned int i = 0; i < max_decimation_modes; i++)
+ {
+ const decimation_mode& dm = bsd.decimation_modes[i];
+ if (!dm.is_ref_1_plane(static_cast<quant_method>(max_weight_quant)))
+ {
+ continue;
+ }
+
+ unsigned int weight_count = bsd.get_decimation_info(i).weight_count;
+
+ unsigned int max_precision = dm.maxprec_1plane;
+ if (max_precision > TUNE_MAX_ANGULAR_QUANT)
+ {
+ max_precision = TUNE_MAX_ANGULAR_QUANT;
+ }
+
+ if (max_precision > max_weight_quant)
+ {
+ max_precision = max_weight_quant;
+ }
+
+ compute_angular_endpoints_for_quant_levels(
+ weight_count,
+ dec_weight_ideal_value + i * BLOCK_MAX_WEIGHTS,
+ max_precision, low_values[i], high_values[i]);
+ }
+
+ unsigned int max_block_modes = only_always ? bsd.block_mode_count_1plane_always
+ : bsd.block_mode_count_1plane_selected;
+ promise(max_block_modes > 0);
+ for (unsigned int i = 0; i < max_block_modes; i++)
+ {
+ const block_mode& bm = bsd.block_modes[i];
+ assert(!bm.is_dual_plane);
+
+ unsigned int quant_mode = bm.quant_mode;
+ unsigned int decim_mode = bm.decimation_mode;
+
+ if (quant_mode <= TUNE_MAX_ANGULAR_QUANT)
+ {
+ low_value[i] = low_values[decim_mode][quant_mode];
+ high_value[i] = high_values[decim_mode][quant_mode];
+ }
+ else
+ {
+ low_value[i] = 0.0f;
+ high_value[i] = 1.0f;
+ }
+ }
+}
+
+/* See header for documentation. */
+void compute_angular_endpoints_2planes(
+ const block_size_descriptor& bsd,
+ const float* dec_weight_ideal_value,
+ unsigned int max_weight_quant,
+ compression_working_buffers& tmpbuf
+) {
+ float (&low_value1)[WEIGHTS_MAX_BLOCK_MODES] = tmpbuf.weight_low_value1;
+ float (&high_value1)[WEIGHTS_MAX_BLOCK_MODES] = tmpbuf.weight_high_value1;
+ float (&low_value2)[WEIGHTS_MAX_BLOCK_MODES] = tmpbuf.weight_low_value2;
+ float (&high_value2)[WEIGHTS_MAX_BLOCK_MODES] = tmpbuf.weight_high_value2;
+
+ float (&low_values1)[WEIGHTS_MAX_DECIMATION_MODES][TUNE_MAX_ANGULAR_QUANT + 1] = tmpbuf.weight_low_values1;
+ float (&high_values1)[WEIGHTS_MAX_DECIMATION_MODES][TUNE_MAX_ANGULAR_QUANT + 1] = tmpbuf.weight_high_values1;
+ float (&low_values2)[WEIGHTS_MAX_DECIMATION_MODES][TUNE_MAX_ANGULAR_QUANT + 1] = tmpbuf.weight_low_values2;
+ float (&high_values2)[WEIGHTS_MAX_DECIMATION_MODES][TUNE_MAX_ANGULAR_QUANT + 1] = tmpbuf.weight_high_values2;
+
+ promise(bsd.decimation_mode_count_selected > 0);
+ for (unsigned int i = 0; i < bsd.decimation_mode_count_selected; i++)
+ {
+ const decimation_mode& dm = bsd.decimation_modes[i];
+ if (!dm.is_ref_2_plane(static_cast<quant_method>(max_weight_quant)))
+ {
+ continue;
+ }
+
+ unsigned int weight_count = bsd.get_decimation_info(i).weight_count;
+
+ unsigned int max_precision = dm.maxprec_2planes;
+ if (max_precision > TUNE_MAX_ANGULAR_QUANT)
+ {
+ max_precision = TUNE_MAX_ANGULAR_QUANT;
+ }
+
+ if (max_precision > max_weight_quant)
+ {
+ max_precision = max_weight_quant;
+ }
+
+ compute_angular_endpoints_for_quant_levels(
+ weight_count,
+ dec_weight_ideal_value + i * BLOCK_MAX_WEIGHTS,
+ max_precision, low_values1[i], high_values1[i]);
+
+ compute_angular_endpoints_for_quant_levels(
+ weight_count,
+ dec_weight_ideal_value + i * BLOCK_MAX_WEIGHTS + WEIGHTS_PLANE2_OFFSET,
+ max_precision, low_values2[i], high_values2[i]);
+ }
+
+ unsigned int start = bsd.block_mode_count_1plane_selected;
+ unsigned int end = bsd.block_mode_count_1plane_2plane_selected;
+ for (unsigned int i = start; i < end; i++)
+ {
+ const block_mode& bm = bsd.block_modes[i];
+ unsigned int quant_mode = bm.quant_mode;
+ unsigned int decim_mode = bm.decimation_mode;
+
+ if (quant_mode <= TUNE_MAX_ANGULAR_QUANT)
+ {
+ low_value1[i] = low_values1[decim_mode][quant_mode];
+ high_value1[i] = high_values1[decim_mode][quant_mode];
+ low_value2[i] = low_values2[decim_mode][quant_mode];
+ high_value2[i] = high_values2[decim_mode][quant_mode];
+ }
+ else
+ {
+ low_value1[i] = 0.0f;
+ high_value1[i] = 1.0f;
+ low_value2[i] = 0.0f;
+ high_value2[i] = 1.0f;
+ }
+ }
+}
+
+#endif
diff --git a/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_weight_quant_xfer_tables.cpp b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_weight_quant_xfer_tables.cpp
new file mode 100644
index 00000000000..35bfa08324c
--- /dev/null
+++ b/3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_weight_quant_xfer_tables.cpp
@@ -0,0 +1,159 @@
+// SPDX-License-Identifier: Apache-2.0
+// ----------------------------------------------------------------------------
+// Copyright 2011-2021 Arm Limited
+//
+// 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.
+// ----------------------------------------------------------------------------
+
+/**
+ * @brief Data tables for quantization transfer.
+ */
+
+#include "astcenc_internal.h"
+
+#define _ 0 // Using _ to indicate an entry that will not be used.
+
+const quant_and_transfer_table quant_and_xfer_tables[12] {
+ // Quantization method 0, range 0..1
+ {
+ QUANT_2,
+ {0, 64},
+ {0, 1},
+ {0, 64},
+ {0x4000,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,
+ _,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,
+ 0x4000}
+ },
+ // Quantization method 1, range 0..2
+ {
+ QUANT_3,
+ {0, 32, 64},
+ {0, 1, 2},
+ {0, 32, 64},
+ {0x2000,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,
+ _,_,0x4000,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,
+ _,_,_,_,0x4020}
+ },
+ // Quantization method 2, range 0..3
+ {
+ QUANT_4,
+ {0, 21, 43, 64},
+ {0, 1, 2, 3},
+ {0, 21, 43, 64},
+ {0x1500,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,0x2b00,_,_,_,_,
+ _,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,0x4015,_,_,_,_,_,_,_,_,_,_,_,_,
+ _,_,_,_,_,_,_,_,0x402b}
+ },
+ // Quantization method 3, range 0..4
+ {
+ QUANT_5,
+ {0, 16, 32, 48, 64},
+ {0, 1, 2, 3, 4},
+ {0, 16, 32, 48, 64},
+ {0x1000,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,0x2000,_,_,_,_,_,_,_,_,_,
+ _,_,_,_,_,_,0x3010,_,_,_,_,_,_,_,_,_,_,_,_,_,_,_,0x4020,_,_,_,
+ _,_,_,_,_,_,_,_,_,_,_,_,0x4030}
+ },
+ // Quantization method 4, range 0..5
+ {
+ QUANT_6,
+ {0, 12, 25, 39, 52, 64},
+ {0, 2, 4, 5, 3, 1},
+ {0, 64, 12, 52, 25, 39},
+ {0x0c00,_,_,_,_,_,_,_,_,_,_,_,0x1900,_,_,_,_,_,_,_,_,_,_,_,_,
+ 0x270c,_,_,_,_,_,_,_,_,_,_,_,_,_,0x3419,_,_,_,_,_,_,_,_,_,_,
+ _,_,0x4027,_,_,_,_,_,_,_,_,_,_,_,0x4034}
+ },
+ // Quantization method 5, range 0..7
+ {
+ QUANT_8,
+ {0, 9, 18, 27, 37, 46, 55, 64},
+ {0, 1, 2, 3, 4, 5, 6, 7},
+ {0, 9, 18, 27, 37, 46, 55, 64},
+ {0x0900,_,_,_,_,_,_,_,_,0x1200,_,_,_,_,_,_,_,_,0x1b09,_,_,
+ _,_,_,_,_,_,0x2512,_,_,_,_,_,_,_,_,_,0x2e1b,_,_,_,_,_,_,_,_,
+ 0x3725,_,_,_,_,_,_,_,_,0x402e,_,_,_,_,_,_,_,_,0x4037}
+ },
+ // Quantization method 6, range 0..9
+ {
+ QUANT_10,
+ {0, 7, 14, 21, 28, 36, 43, 50, 57, 64},
+ {0, 2, 4, 6, 8, 9, 7, 5, 3, 1},
+ {0, 64, 7, 57, 14, 50, 21, 43, 28, 36},
+ {0x0700,_,_,_,_,_,_,0x0e00,_,_,_,_,_,_,0x1507,_,_,_,_,_,_,
+ 0x1c0e,_,_,_,_,_,_,0x2415,_,_,_,_,_,_,_,0x2b1c,_,_,_,_,_,
+ _,0x3224,_,_,_,_,_,_,0x392b,_,_,_,_,_,_,0x4032,_,_,_,_,_,
+ _,0x4039}
+ },
+ // Quantization method 7, range 0..11
+ {
+ QUANT_12,
+ {0, 5, 11, 17, 23, 28, 36, 41, 47, 53, 59, 64},
+ {0, 4, 8, 2, 6, 10, 11, 7, 3, 9, 5, 1},
+ {0, 64, 17, 47, 5, 59, 23, 41, 11, 53, 28, 36},
+ {0x0500,_,_,_,_,0x0b00,_,_,_,_,_,0x1105,_,_,_,_,_,
+ 0x170b,_,_,_,_,_,0x1c11,_,_,_,_,0x2417,_,_,_,_,_,_,_,
+ 0x291c,_,_,_,_,0x2f24,_,_,_,_,_,0x3529,_,_,_,_,_,
+ 0x3b2f,_,_,_,_,_,0x4035,_,_,_,_,0x403b}
+ },
+ // Quantization method 8, range 0..15
+ {
+ QUANT_16,
+ {0, 4, 8, 12, 17, 21, 25, 29, 35, 39, 43, 47, 52, 56, 60, 64},
+ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
+ {0, 4, 8, 12, 17, 21, 25, 29, 35, 39, 43, 47, 52, 56, 60, 64},
+ {0x0400,_,_,_,0x0800,_,_,_,0x0c04,_,_,_,0x1108,_,_,_,_,
+ 0x150c,_,_,_,0x1911,_,_,_,0x1d15,_,_,_,0x2319,_,_,_,_,
+ _,0x271d,_,_,_,0x2b23,_,_,_,0x2f27,_,_,_,0x342b,_,_,_,
+ _,0x382f,_,_,_,0x3c34,_,_,_,0x4038,_,_,_,0x403c}
+ },
+ // Quantization method 9, range 0..19
+ {
+ QUANT_20,
+ {0, 3, 6, 9, 13, 16, 19, 23, 26, 29, 35, 38, 41, 45, 48, 51, 55, 58, 61, 64},
+ {0, 4, 8, 12, 16, 2, 6, 10, 14, 18, 19, 15, 11, 7, 3, 17, 13, 9, 5, 1},
+ {0, 64, 16, 48, 3, 61, 19, 45, 6, 58, 23, 41, 9, 55, 26, 38, 13, 51, 29, 35},
+ {0x0300,_,_,0x0600,_,_,0x0903,_,_,0x0d06,_,_,_,
+ 0x1009,_,_,0x130d,_,_,0x1710,_,_,_,0x1a13,_,_,
+ 0x1d17,_,_,0x231a,_,_,_,_,_,0x261d,_,_,0x2923,_,_,
+ 0x2d26,_,_,_,0x3029,_,_,0x332d,_,_,0x3730,_,_,_,
+ 0x3a33,_,_,0x3d37,_,_,0x403a,_,_,0x403d}
+ },
+ // Quantization method 10, range 0..23
+ {
+ QUANT_24,
+ {0, 2, 5, 8, 11, 13, 16, 19, 22, 24, 27, 30, 34, 37, 40, 42, 45, 48, 51, 53, 56, 59, 62, 64},
+ {0, 8, 16, 2, 10, 18, 4, 12, 20, 6, 14, 22, 23, 15, 7, 21, 13, 5, 19, 11, 3, 17, 9, 1},
+ {0, 64, 8, 56, 16, 48, 24, 40, 2, 62, 11, 53, 19, 45, 27, 37, 5, 59, 13, 51, 22, 42, 30, 34},
+ {0x0200,_,0x0500,_,_,0x0802,_,_,0x0b05,_,_,0x0d08,
+ _,0x100b,_,_,0x130d,_,_,0x1610,_,_,0x1813,_,
+ 0x1b16,_,_,0x1e18,_,_,0x221b,_,_,_,0x251e,_,_,
+ 0x2822,_,_,0x2a25,_,0x2d28,_,_,0x302a,_,_,0x332d,
+ _,_,0x3530,_,0x3833,_,_,0x3b35,_,_,0x3e38,_,_,
+ 0x403b,_,0x403e}
+ },
+ // Quantization method 11, range 0..31
+ {
+ QUANT_32,
+ {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64},
+ {0, 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},
+ {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64},
+ {0x0200,_,0x0400,_,0x0602,_,0x0804,_,0x0a06,_,
+ 0x0c08,_,0x0e0a,_,0x100c,_,0x120e,_,0x1410,_,
+ 0x1612,_,0x1814,_,0x1a16,_,0x1c18,_,0x1e1a,_,
+ 0x221c,_,_,_,0x241e,_,0x2622,_,0x2824,_,0x2a26,_,
+ 0x2c28,_,0x2e2a,_,0x302c,_,0x322e,_,0x3430,_,
+ 0x3632,_,0x3834,_,0x3a36,_,0x3c38,_,0x3e3a,_,
+ 0x403c,_,0x403e}
+ }
+};
diff --git a/3rdparty/bimg/3rdparty/astc/astc_averages_and_directions.cpp b/3rdparty/bimg/3rdparty/astc/astc_averages_and_directions.cpp
deleted file mode 100644
index ece97d07fb1..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_averages_and_directions.cpp
+++ /dev/null
@@ -1,627 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Implements functions for finding dominant direction of a set of
- * colors, using ARM patent pending method.
- */
-/*----------------------------------------------------------------------------*/
-
-#include "astc_codec_internals.h"
-
-#include <math.h>
-#include "mathlib.h"
-
-#ifdef DEBUG_CAPTURE_NAN
- #ifndef _GNU_SOURCE
- #define _GNU_SOURCE
- #endif
-
- #include <fenv.h>
-#endif
-
-/* routines to compute average colors and dominant directions for blocks with 3 and 4 components. */
-
-/*
- for a full block, functions to compute averages and dominant directions. The averages and directions are computed separately for each partition.
- We have separate versions for blocks with and without alpha, since the processing for blocks with alpha is significantly more expensive.
- The direction vectors it produces are NOT normalized.
-*/
-void compute_averages_and_directions_rgba(const partition_info * pt,
- const imageblock * blk,
- const error_weight_block * ewb,
- const float4 * color_scalefactors,
- float4 * averages, float4 * directions_rgba, float3 * directions_gba, float3 * directions_rba, float3 * directions_rga, float3 * directions_rgb)
-{
- int i;
- int partition_count = pt->partition_count;
- int partition;
-
- for (partition = 0; partition < partition_count; partition++)
- {
- const uint8_t *weights = pt->texels_of_partition[partition];
- int texelcount = pt->texels_per_partition[partition];
-
- float4 base_sum = float4(0, 0, 0, 0);
- float partition_weight = 0.0f;
-
- for (i = 0; i < texelcount; i++)
- {
- int iwt = weights[i];
- float weight = ewb->texel_weight[iwt];
- float4 texel_datum = float4(blk->work_data[4 * iwt],
- blk->work_data[4 * iwt + 1],
- blk->work_data[4 * iwt + 2],
- blk->work_data[4 * iwt + 3]) * weight;
- partition_weight += weight;
-
- base_sum = base_sum + texel_datum;
- }
-
- float4 average = base_sum * 1.0f / MAX(partition_weight, 1e-7f);
- averages[partition] = average * color_scalefactors[partition];
-
-
- float4 sum_xp = float4(0, 0, 0, 0);
- float4 sum_yp = float4(0, 0, 0, 0);
- float4 sum_zp = float4(0, 0, 0, 0);
- float4 sum_wp = float4(0, 0, 0, 0);
-
- for (i = 0; i < texelcount; i++)
- {
- int iwt = weights[i];
- float weight = ewb->texel_weight[iwt];
- float4 texel_datum = float4(blk->work_data[4 * iwt],
- blk->work_data[4 * iwt + 1],
- blk->work_data[4 * iwt + 2],
- blk->work_data[4 * iwt + 3]);
- texel_datum = (texel_datum - average) * weight;
-
- if (texel_datum.x > 0.0f)
- sum_xp = sum_xp + texel_datum;
- if (texel_datum.y > 0.0f)
- sum_yp = sum_yp + texel_datum;
- if (texel_datum.z > 0.0f)
- sum_zp = sum_zp + texel_datum;
- if (texel_datum.w > 0.0f)
- sum_wp = sum_wp + texel_datum;
- }
-
- float prod_xp = dot(sum_xp, sum_xp);
- float prod_yp = dot(sum_yp, sum_yp);
- float prod_zp = dot(sum_zp, sum_zp);
- float prod_wp = dot(sum_wp, sum_wp);
-
- float4 best_vector = sum_xp;
- float best_sum = prod_xp;
- if (prod_yp > best_sum)
- {
- best_vector = sum_yp;
- best_sum = prod_yp;
- }
- if (prod_zp > best_sum)
- {
- best_vector = sum_zp;
- best_sum = prod_zp;
- }
- if (prod_wp > best_sum)
- {
- best_vector = sum_wp;
- best_sum = prod_wp;
- }
-
- directions_rgba[partition] = best_vector;
- directions_rgb[partition] = best_vector.xyz;
- directions_rga[partition] = best_vector.xyw;
- directions_rba[partition] = best_vector.xzw;
- directions_gba[partition] = best_vector.yzw;
- }
-}
-
-
-
-
-void compute_averages_and_directions_rgb(const partition_info * pt,
- const imageblock * blk,
- const error_weight_block * ewb,
- const float4 * color_scalefactors, float3 * averages, float3 * directions_rgb, float2 * directions_rg, float2 * directions_rb, float2 * directions_gb)
-{
- int i;
- int partition_count = pt->partition_count;
- int partition;
-
- const float *texel_weights = ewb->texel_weight_rgb;
-
- for (partition = 0; partition < partition_count; partition++)
- {
- const uint8_t *weights = pt->texels_of_partition[partition];
- int texelcount = pt->texels_per_partition[partition];
-
- float3 base_sum = float3(0, 0, 0);
- float partition_weight = 0.0f;
-
- for (i = 0; i < texelcount; i++)
- {
- int iwt = weights[i];
- float weight = texel_weights[iwt];
- float3 texel_datum = float3(blk->work_data[4 * iwt],
- blk->work_data[4 * iwt + 1],
- blk->work_data[4 * iwt + 2]) * weight;
- partition_weight += weight;
-
- base_sum = base_sum + texel_datum;
- }
-
- float4 csf = color_scalefactors[partition];
- float3 average = base_sum * 1.0f / MAX(partition_weight, 1e-7f);
- averages[partition] = average * csf.xyz;
-
-
- float3 sum_xp = float3(0, 0, 0);
- float3 sum_yp = float3(0, 0, 0);
- float3 sum_zp = float3(0, 0, 0);
-
- for (i = 0; i < texelcount; i++)
- {
- int iwt = weights[i];
- float weight = texel_weights[iwt];
- float3 texel_datum = float3(blk->work_data[4 * iwt],
- blk->work_data[4 * iwt + 1],
- blk->work_data[4 * iwt + 2]);
- texel_datum = (texel_datum - average) * weight;
-
- if (texel_datum.x > 0.0f)
- sum_xp = sum_xp + texel_datum;
- if (texel_datum.y > 0.0f)
- sum_yp = sum_yp + texel_datum;
- if (texel_datum.z > 0.0f)
- sum_zp = sum_zp + texel_datum;
- }
-
- float prod_xp = dot(sum_xp, sum_xp);
- float prod_yp = dot(sum_yp, sum_yp);
- float prod_zp = dot(sum_zp, sum_zp);
-
- float3 best_vector = sum_xp;
- float best_sum = prod_xp;
- if (prod_yp > best_sum)
- {
- best_vector = sum_yp;
- best_sum = prod_yp;
- }
- if (prod_zp > best_sum)
- {
- best_vector = sum_zp;
- best_sum = prod_zp;
- }
-
- directions_rgb[partition] = best_vector;
- directions_gb[partition] = best_vector.yz;
- directions_rb[partition] = best_vector.xz;
- directions_rg[partition] = best_vector.xy;
- }
-}
-
-void compute_averages_and_directions_3_components(const partition_info * pt,
- const imageblock * blk,
- const error_weight_block * ewb,
- const float3 * color_scalefactors, int component1, int component2, int component3, float3 * averages, float3 * directions)
-{
- int i;
- int partition_count = pt->partition_count;
- int partition;
-
- const float *texel_weights;
- if (component1 == 1 && component2 == 2 && component3 == 3)
- texel_weights = ewb->texel_weight_gba;
- else if (component1 == 0 && component2 == 2 && component3 == 3)
- texel_weights = ewb->texel_weight_rba;
- else if (component1 == 0 && component2 == 1 && component3 == 3)
- texel_weights = ewb->texel_weight_rga;
- else if (component1 == 0 && component2 == 1 && component3 == 2)
- texel_weights = ewb->texel_weight_rgb;
- else
- {
- texel_weights = ewb->texel_weight_gba;
- ASTC_CODEC_INTERNAL_ERROR;
- }
-
-
- for (partition = 0; partition < partition_count; partition++)
- {
- const uint8_t *weights = pt->texels_of_partition[partition];
- int texelcount = pt->texels_per_partition[partition];
-
- float3 base_sum = float3(0, 0, 0);
- float partition_weight = 0.0f;
-
- for (i = 0; i < texelcount; i++)
- {
- int iwt = weights[i];
- float weight = texel_weights[iwt];
- float3 texel_datum = float3(blk->work_data[4 * iwt + component1],
- blk->work_data[4 * iwt + component2],
- blk->work_data[4 * iwt + component3]) * weight;
- partition_weight += weight;
-
- base_sum = base_sum + texel_datum;
- }
-
- float3 csf = color_scalefactors[partition];
-
- float3 average = base_sum * 1.0f / MAX(partition_weight, 1e-7f);
- averages[partition] = average * csf.xyz;
-
-
- float3 sum_xp = float3(0, 0, 0);
- float3 sum_yp = float3(0, 0, 0);
- float3 sum_zp = float3(0, 0, 0);
-
- for (i = 0; i < texelcount; i++)
- {
- int iwt = weights[i];
- float weight = texel_weights[iwt];
- float3 texel_datum = float3(blk->work_data[4 * iwt + component1],
- blk->work_data[4 * iwt + component2],
- blk->work_data[4 * iwt + component3]);
- texel_datum = (texel_datum - average) * weight;
-
- if (texel_datum.x > 0.0f)
- sum_xp = sum_xp + texel_datum;
- if (texel_datum.y > 0.0f)
- sum_yp = sum_yp + texel_datum;
- if (texel_datum.z > 0.0f)
- sum_zp = sum_zp + texel_datum;
- }
-
- float prod_xp = dot(sum_xp, sum_xp);
- float prod_yp = dot(sum_yp, sum_yp);
- float prod_zp = dot(sum_zp, sum_zp);
-
- float3 best_vector = sum_xp;
- float best_sum = prod_xp;
- if (prod_yp > best_sum)
- {
- best_vector = sum_yp;
- best_sum = prod_yp;
- }
- if (prod_zp > best_sum)
- {
- best_vector = sum_zp;
- best_sum = prod_zp;
- }
-
- if (dot(best_vector, best_vector) < 1e-18)
- best_vector = float3(1, 1, 1);
- directions[partition] = best_vector;
- }
-
-}
-
-
-
-
-void compute_averages_and_directions_2_components(const partition_info * pt,
- const imageblock * blk,
- const error_weight_block * ewb, const float2 * color_scalefactors, int component1, int component2, float2 * averages, float2 * directions)
-{
- int i;
- int partition_count = pt->partition_count;
- int partition;
-
- const float *texel_weights;
- if (component1 == 0 && component2 == 1)
- texel_weights = ewb->texel_weight_rg;
- else if (component1 == 0 && component2 == 2)
- texel_weights = ewb->texel_weight_rb;
- else if (component1 == 1 && component2 == 2)
- texel_weights = ewb->texel_weight_gb;
- else
- {
- texel_weights = ewb->texel_weight_rg;
- // unsupported set of color components.
- ASTC_CODEC_INTERNAL_ERROR;
- exit(1);
- }
-
-
- for (partition = 0; partition < partition_count; partition++)
- {
- const uint8_t *weights = pt->texels_of_partition[partition];
- int texelcount = pt->texels_per_partition[partition];
-
- float2 base_sum = float2(0, 0);
- float partition_weight = 0.0f;
-
- for (i = 0; i < texelcount; i++)
- {
- int iwt = weights[i];
- float weight = texel_weights[iwt];
- float2 texel_datum = float2(blk->work_data[4 * iwt + component1],
- blk->work_data[4 * iwt + component2]) * weight;
- partition_weight += weight;
-
- base_sum = base_sum + texel_datum;
- }
-
- float2 csf = color_scalefactors[partition];
-
- float2 average = base_sum * 1.0f / MAX(partition_weight, 1e-7f);
- averages[partition] = average * csf.xy;
-
-
- float2 sum_xp = float2(0, 0);
- float2 sum_yp = float2(0, 0);
-
- for (i = 0; i < texelcount; i++)
- {
- int iwt = weights[i];
- float weight = texel_weights[iwt];
- float2 texel_datum = float2(blk->work_data[4 * iwt + component1],
- blk->work_data[4 * iwt + component2]);
- texel_datum = (texel_datum - average) * weight;
-
- if (texel_datum.x > 0.0f)
- sum_xp = sum_xp + texel_datum;
- if (texel_datum.y > 0.0f)
- sum_yp = sum_yp + texel_datum;
- }
-
- float prod_xp = dot(sum_xp, sum_xp);
- float prod_yp = dot(sum_yp, sum_yp);
-
- float2 best_vector = sum_xp;
- float best_sum = prod_xp;
- if (prod_yp > best_sum)
- {
- best_vector = sum_yp;
- best_sum = prod_yp;
- }
-
- directions[partition] = best_vector;
- }
-
-}
-
-
-#define XPASTE(x,y) x##y
-#define PASTE(x,y) XPASTE(x,y)
-
-#define TWO_COMPONENT_ERROR_FUNC( funcname, c0_iwt, c1_iwt, c01_name, c01_rname ) \
-float funcname( \
- const partition_info *pt, \
- const imageblock *blk, \
- const error_weight_block *ewb, \
- const processed_line2 *plines, \
- float *length_of_lines \
- ) \
- { \
- int i; \
- float errorsum = 0.0f; \
- int partition; \
- for(partition=0; partition<pt->partition_count; partition++) \
- { \
- const uint8_t *weights = pt->texels_of_partition[ partition ]; \
- int texelcount = pt->texels_per_partition[ partition ]; \
- float lowparam = 1e10f; \
- float highparam = -1e10f; \
- processed_line2 l = plines[partition]; \
- if( ewb->contains_zeroweight_texels ) \
- { \
- for(i=0;i<texelcount;i++) \
- { \
- int iwt = weights[i]; \
- float texel_weight = ewb-> PASTE(texel_weight_ , c01_rname) [i]; \
- if( texel_weight > 1e-20f ) \
- { \
- float2 point = float2(blk->work_data[4*iwt + c0_iwt], blk->work_data[4*iwt + c1_iwt] ); \
- float param = dot( point, l.bs ); \
- float2 rp1 = l.amod + param*l.bis; \
- float2 dist = rp1 - point; \
- float4 ews = ewb->error_weights[iwt]; \
- errorsum += dot( ews. c01_name, dist*dist ); \
- if( param < lowparam ) lowparam = param; \
- if( param > highparam ) highparam = param; \
- } \
- } \
- } \
- else \
- { \
- for(i=0;i<texelcount;i++) \
- { \
- int iwt = weights[i]; \
- float2 point = float2(blk->work_data[4*iwt + c0_iwt], blk->work_data[4*iwt + c1_iwt] ); \
- float param = dot( point, l.bs ); \
- float2 rp1 = l.amod + param*l.bis; \
- float2 dist = rp1 - point; \
- float4 ews = ewb->error_weights[iwt]; \
- errorsum += dot( ews. c01_name, dist*dist ); \
- if( param < lowparam ) lowparam = param; \
- if( param > highparam ) highparam = param; \
- } \
- } \
- float linelen = highparam - lowparam; \
- if( !(linelen > 1e-7f) ) \
- linelen = 1e-7f; \
- length_of_lines[partition] = linelen; \
- } \
- return errorsum; \
- }
-
-
-TWO_COMPONENT_ERROR_FUNC(compute_error_squared_rg, 0, 1, xy, rg)
-TWO_COMPONENT_ERROR_FUNC(compute_error_squared_rb, 0, 2, xz, rb)
-TWO_COMPONENT_ERROR_FUNC(compute_error_squared_gb, 1, 2, yz, gb)
-TWO_COMPONENT_ERROR_FUNC(compute_error_squared_ra, 0, 3, zw, ra)
-
-// function to compute the error across a tile when using a particular set of
-// lines for a particular partitioning. Also compute the length of each
-// color-space line in each partitioning.
-
-#define THREE_COMPONENT_ERROR_FUNC( funcname, c0_iwt, c1_iwt, c2_iwt, c012_name, c012_rname ) \
-float funcname( \
- const partition_info *pt, \
- const imageblock *blk, \
- const error_weight_block *ewb, \
- const processed_line3 *plines, \
- float *length_of_lines \
- ) \
- { \
- int i; \
- float errorsum = 0.0f; \
- int partition; \
- for(partition=0; partition<pt->partition_count; partition++) \
- { \
- const uint8_t *weights = pt->texels_of_partition[ partition ]; \
- int texelcount = pt->texels_per_partition[ partition ]; \
- float lowparam = 1e10f; \
- float highparam = -1e10f; \
- processed_line3 l = plines[partition]; \
- if( ewb->contains_zeroweight_texels ) \
- { \
- for(i=0;i<texelcount;i++) \
- { \
- int iwt = weights[i]; \
- float texel_weight = ewb-> PASTE(texel_weight_ , c012_rname) [i]; \
- if( texel_weight > 1e-20f ) \
- { \
- float3 point = float3(blk->work_data[4*iwt + c0_iwt], blk->work_data[4*iwt + c1_iwt], blk->work_data[4*iwt + c2_iwt] ); \
- float param = dot( point, l.bs ); \
- float3 rp1 = l.amod + param*l.bis; \
- float3 dist = rp1 - point; \
- float4 ews = ewb->error_weights[iwt]; \
- errorsum += dot( ews. c012_name, dist*dist ); \
- if( param < lowparam ) lowparam = param; \
- if( param > highparam ) highparam = param; \
- } \
- } \
- } \
- else \
- { \
- for(i=0;i<texelcount;i++) \
- { \
- int iwt = weights[i]; \
- float3 point = float3(blk->work_data[4*iwt + c0_iwt], blk->work_data[4*iwt + c1_iwt], blk->work_data[4*iwt + c2_iwt] ); \
- float param = dot( point, l.bs ); \
- float3 rp1 = l.amod + param*l.bis; \
- float3 dist = rp1 - point; \
- float4 ews = ewb->error_weights[iwt]; \
- errorsum += dot( ews. c012_name, dist*dist ); \
- if( param < lowparam ) lowparam = param; \
- if( param > highparam ) highparam = param; \
- } \
- } \
- float linelen = highparam - lowparam; \
- if( !(linelen > 1e-7f) ) \
- linelen = 1e-7f; \
- length_of_lines[partition] = linelen; \
- } \
- return errorsum; \
- }
-
-THREE_COMPONENT_ERROR_FUNC(compute_error_squared_gba, 1, 2, 3, yzw, gba)
-THREE_COMPONENT_ERROR_FUNC(compute_error_squared_rba, 0, 2, 3, xzw, rba)
-THREE_COMPONENT_ERROR_FUNC(compute_error_squared_rga, 0, 1, 3, xyw, rga)
-THREE_COMPONENT_ERROR_FUNC(compute_error_squared_rgb, 0, 1, 2, xyz, rgb)
-
-float compute_error_squared_rgba(const partition_info * pt, // the partition that we use when computing the squared-error.
- const imageblock * blk, const error_weight_block * ewb, const processed_line4 * plines, float *length_of_lines)
-{
- int i;
-
- float errorsum = 0.0f;
- int partition;
- for (partition = 0; partition < pt->partition_count; partition++)
- {
- const uint8_t *weights = pt->texels_of_partition[partition];
- int texelcount = pt->texels_per_partition[partition];
- float lowparam = 1e10;
- float highparam = -1e10;
-
- processed_line4 l = plines[partition];
-
- if (ewb->contains_zeroweight_texels)
- {
- for (i = 0; i < texelcount; i++)
- {
- int iwt = weights[i];
- if (ewb->texel_weight[iwt] > 1e-20)
- {
- float4 point = float4(blk->work_data[4 * iwt], blk->work_data[4 * iwt + 1], blk->work_data[4 * iwt + 2], blk->work_data[4 * iwt + 3]);
- float param = dot(point, l.bs);
- float4 rp1 = l.amod + param * l.bis;
- float4 dist = rp1 - point;
- float4 ews = ewb->error_weights[iwt];
- errorsum += dot(ews, dist * dist);
- if (param < lowparam)
- lowparam = param;
- if (param > highparam)
- highparam = param;
- }
- }
- }
- else
- {
- for (i = 0; i < texelcount; i++)
- {
- int iwt = weights[i];
- float4 point = float4(blk->work_data[4 * iwt], blk->work_data[4 * iwt + 1], blk->work_data[4 * iwt + 2], blk->work_data[4 * iwt + 3]);
- float param = dot(point, l.bs);
- float4 rp1 = l.amod + param * l.bis;
- float4 dist = rp1 - point;
- float4 ews = ewb->error_weights[iwt];
- errorsum += dot(ews, dist * dist);
- if (param < lowparam)
- lowparam = param;
- if (param > highparam)
- highparam = param;
- }
- }
-
- float linelen = highparam - lowparam;
- if (!(linelen > 1e-7f))
- linelen = 1e-7f;
- length_of_lines[partition] = linelen;
- }
-
- return errorsum;
-}
-
-
-
-// function to compute the error across a tile when using a particular line for
-// a particular partition.
-float compute_error_squared_rgb_single_partition(int partition_to_test, int xdim, int ydim, int zdim, const partition_info * pt, // the partition that we use when computing the squared-error.
- const imageblock * blk, const error_weight_block * ewb, const processed_line3 * lin // the line for the partition.
- )
-{
- int i;
-
- int texels_per_block = xdim * ydim * zdim;
-
- float errorsum = 0.0f;
-
- for (i = 0; i < texels_per_block; i++)
- {
- int partition = pt->partition_of_texel[i];
- float texel_weight = ewb->texel_weight_rgb[i];
- if (partition != partition_to_test || texel_weight < 1e-20)
- continue;
- float3 point = float3(blk->work_data[4 * i], blk->work_data[4 * i + 1], blk->work_data[4 * i + 2]);
-
- float param = dot(point, lin->bs);
- float3 rp1 = lin->amod + param * lin->bis;
- float3 dist = rp1 - point;
- float4 ews = ewb->error_weights[i];
-
- errorsum += dot(ews.xyz, dist * dist);
- }
- return errorsum;
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_block_sizes2.cpp b/3rdparty/bimg/3rdparty/astc/astc_block_sizes2.cpp
deleted file mode 100644
index 8d42d71c35b..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_block_sizes2.cpp
+++ /dev/null
@@ -1,977 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief For ASTC, generate the block size descriptor and the associated
- * decimation tables.
- */
-/*----------------------------------------------------------------------------*/
-
-#include "astc_codec_internals.h"
-
-extern const float percentile_table_4x4[2048];
-extern const float percentile_table_4x5[2048];
-extern const float percentile_table_4x6[2048];
-extern const float percentile_table_4x8[2048];
-extern const float percentile_table_4x10[2048];
-extern const float percentile_table_4x12[2048];
-extern const float percentile_table_5x4[2048];
-extern const float percentile_table_5x5[2048];
-extern const float percentile_table_5x6[2048];
-extern const float percentile_table_5x8[2048];
-extern const float percentile_table_5x10[2048];
-extern const float percentile_table_5x12[2048];
-extern const float percentile_table_6x4[2048];
-extern const float percentile_table_6x5[2048];
-extern const float percentile_table_6x6[2048];
-extern const float percentile_table_6x8[2048];
-extern const float percentile_table_6x10[2048];
-extern const float percentile_table_6x12[2048];
-extern const float percentile_table_8x4[2048];
-extern const float percentile_table_8x5[2048];
-extern const float percentile_table_8x6[2048];
-extern const float percentile_table_8x8[2048];
-extern const float percentile_table_8x10[2048];
-extern const float percentile_table_8x12[2048];
-extern const float percentile_table_10x4[2048];
-extern const float percentile_table_10x5[2048];
-extern const float percentile_table_10x6[2048];
-extern const float percentile_table_10x8[2048];
-extern const float percentile_table_10x10[2048];
-extern const float percentile_table_10x12[2048];
-extern const float percentile_table_12x4[2048];
-extern const float percentile_table_12x5[2048];
-extern const float percentile_table_12x6[2048];
-extern const float percentile_table_12x8[2048];
-extern const float percentile_table_12x10[2048];
-extern const float percentile_table_12x12[2048];
-
-const float *get_2d_percentile_table(int blockdim_x, int blockdim_y)
-{
- switch (blockdim_x)
- {
- case 4:
- switch (blockdim_y)
- {
- case 4:
- return percentile_table_4x4;
- case 5:
- return percentile_table_4x5;
- case 6:
- return percentile_table_4x6;
- case 8:
- return percentile_table_4x8;
- case 10:
- return percentile_table_4x10;
- case 12:
- return percentile_table_4x12;
- }
- break;
- case 5:
- switch (blockdim_y)
- {
- case 4:
- return percentile_table_5x4;
- case 5:
- return percentile_table_5x5;
- case 6:
- return percentile_table_5x6;
- case 8:
- return percentile_table_5x8;
- case 10:
- return percentile_table_5x10;
- case 12:
- return percentile_table_5x12;
- }
- break;
-
- case 6:
- switch (blockdim_y)
- {
- case 4:
- return percentile_table_6x4;
- case 5:
- return percentile_table_6x5;
- case 6:
- return percentile_table_6x6;
- case 8:
- return percentile_table_6x8;
- case 10:
- return percentile_table_6x10;
- case 12:
- return percentile_table_6x12;
- }
- break;
-
- case 8:
- switch (blockdim_y)
- {
- case 4:
- return percentile_table_8x4;
- case 5:
- return percentile_table_8x5;
- case 6:
- return percentile_table_8x6;
- case 8:
- return percentile_table_8x8;
- case 10:
- return percentile_table_8x10;
- case 12:
- return percentile_table_8x12;
- }
- break;
-
- case 10:
- switch (blockdim_y)
- {
- case 4:
- return percentile_table_10x4;
- case 5:
- return percentile_table_10x5;
- case 6:
- return percentile_table_10x6;
- case 8:
- return percentile_table_10x8;
- case 10:
- return percentile_table_10x10;
- case 12:
- return percentile_table_10x12;
- }
- break;
-
- case 12:
- switch (blockdim_y)
- {
- case 4:
- return percentile_table_12x4;
- case 5:
- return percentile_table_12x5;
- case 6:
- return percentile_table_12x6;
- case 8:
- return percentile_table_12x8;
- case 10:
- return percentile_table_12x10;
- case 12:
- return percentile_table_12x12;
- }
- break;
- default:
- break;
- }
-
- return NULL; // should never happen.
-}
-
-// stubbed for the time being.
-static const float dummy_percentile_table_3d[2048] = { 0 };
-const float *get_3d_percentile_table(int blockdim_x, int blockdim_y, int blockdim_z)
-{
- IGNORE(blockdim_x);
- IGNORE(blockdim_y);
- IGNORE(blockdim_z);
- return dummy_percentile_table_3d;
-}
-
-
-
-// return 0 on invalid mode, 1 on valid mode.
-static int decode_block_mode_2d(int blockmode, int *Nval, int *Mval, int *dual_weight_plane, int *quant_mode)
-{
- int base_quant_mode = (blockmode >> 4) & 1;
- int H = (blockmode >> 9) & 1;
- int D = (blockmode >> 10) & 1;
-
- int A = (blockmode >> 5) & 0x3;
-
- int N = 0, M = 0;
-
- if ((blockmode & 3) != 0)
- {
- base_quant_mode |= (blockmode & 3) << 1;
- int B = (blockmode >> 7) & 3;
- switch ((blockmode >> 2) & 3)
- {
- case 0:
- N = B + 4;
- M = A + 2;
- break;
- case 1:
- N = B + 8;
- M = A + 2;
- break;
- case 2:
- N = A + 2;
- M = B + 8;
- break;
- case 3:
- B &= 1;
- if (blockmode & 0x100)
- {
- N = B + 2;
- M = A + 2;
- }
- else
- {
- N = A + 2;
- M = B + 6;
- }
- break;
- }
- }
- else
- {
- base_quant_mode |= ((blockmode >> 2) & 3) << 1;
- if (((blockmode >> 2) & 3) == 0)
- return 0;
- int B = (blockmode >> 9) & 3;
- switch ((blockmode >> 7) & 3)
- {
- case 0:
- N = 12;
- M = A + 2;
- break;
- case 1:
- N = A + 2;
- M = 12;
- break;
- case 2:
- N = A + 6;
- M = B + 6;
- D = 0;
- H = 0;
- break;
- case 3:
- switch ((blockmode >> 5) & 3)
- {
- case 0:
- N = 6;
- M = 10;
- break;
- case 1:
- N = 10;
- M = 6;
- break;
- case 2:
- case 3:
- return 0;
- }
- break;
- }
- }
-
- int weight_count = N * M * (D + 1);
- int qmode = (base_quant_mode - 2) + 6 * H;
-
- int weightbits = compute_ise_bitcount(weight_count, (quantization_method) qmode);
- if (weight_count > MAX_WEIGHTS_PER_BLOCK || weightbits < MIN_WEIGHT_BITS_PER_BLOCK || weightbits > MAX_WEIGHT_BITS_PER_BLOCK)
- return 0;
-
- *Nval = N;
- *Mval = M;
- *dual_weight_plane = D;
- *quant_mode = qmode;
- return 1;
-}
-
-
-static int decode_block_mode_3d(int blockmode, int *Nval, int *Mval, int *Qval, int *dual_weight_plane, int *quant_mode)
-{
- int base_quant_mode = (blockmode >> 4) & 1;
- int H = (blockmode >> 9) & 1;
- int D = (blockmode >> 10) & 1;
-
- int A = (blockmode >> 5) & 0x3;
-
- int N = 0, M = 0, Q = 0;
-
- if ((blockmode & 3) != 0)
- {
- base_quant_mode |= (blockmode & 3) << 1;
- int B = (blockmode >> 7) & 3;
- int C = (blockmode >> 2) & 0x3;
- N = A + 2;
- M = B + 2;
- Q = C + 2;
- }
- else
- {
- base_quant_mode |= ((blockmode >> 2) & 3) << 1;
- if (((blockmode >> 2) & 3) == 0)
- return 0;
- int B = (blockmode >> 9) & 3;
- if (((blockmode >> 7) & 3) != 3)
- {
- D = 0;
- H = 0;
- }
- switch ((blockmode >> 7) & 3)
- {
- case 0:
- N = 6;
- M = B + 2;
- Q = A + 2;
- break;
- case 1:
- N = A + 2;
- M = 6;
- Q = B + 2;
- break;
- case 2:
- N = A + 2;
- M = B + 2;
- Q = 6;
- break;
- case 3:
- N = 2;
- M = 2;
- Q = 2;
- switch ((blockmode >> 5) & 3)
- {
- case 0:
- N = 6;
- break;
- case 1:
- M = 6;
- break;
- case 2:
- Q = 6;
- break;
- case 3:
- return 0;
- }
- break;
- }
- }
-
- int weight_count = N * M * Q * (D + 1);
- int qmode = (base_quant_mode - 2) + 6 * H;
-
- int weightbits = compute_ise_bitcount(weight_count, (quantization_method) qmode);
- if (weight_count > MAX_WEIGHTS_PER_BLOCK || weightbits < MIN_WEIGHT_BITS_PER_BLOCK || weightbits > MAX_WEIGHT_BITS_PER_BLOCK)
- return 0;
-
- *Nval = N;
- *Mval = M;
- *Qval = Q;
- *dual_weight_plane = D;
- *quant_mode = qmode;
- return 1;
-}
-
-
-
-
-static void initialize_decimation_table_2d(
- // dimensions of the block
- int xdim, int ydim,
- // number of grid points in 2d weight grid
- int x_weights, int y_weights, decimation_table * dt)
-{
- int i, j;
- int x, y;
-
- int texels_per_block = xdim * ydim;
- int weights_per_block = x_weights * y_weights;
-
- int weightcount_of_texel[MAX_TEXELS_PER_BLOCK];
- int grid_weights_of_texel[MAX_TEXELS_PER_BLOCK][4];
- int weights_of_texel[MAX_TEXELS_PER_BLOCK][4];
-
- int texelcount_of_weight[MAX_WEIGHTS_PER_BLOCK];
- int texels_of_weight[MAX_WEIGHTS_PER_BLOCK][MAX_TEXELS_PER_BLOCK];
- int texelweights_of_weight[MAX_WEIGHTS_PER_BLOCK][MAX_TEXELS_PER_BLOCK];
-
- for (i = 0; i < weights_per_block; i++)
- texelcount_of_weight[i] = 0;
- for (i = 0; i < texels_per_block; i++)
- weightcount_of_texel[i] = 0;
-
- for (y = 0; y < ydim; y++)
- for (x = 0; x < xdim; x++)
- {
- int texel = y * xdim + x;
-
- int x_weight = (((1024 + xdim / 2) / (xdim - 1)) * x * (x_weights - 1) + 32) >> 6;
- int y_weight = (((1024 + ydim / 2) / (ydim - 1)) * y * (y_weights - 1) + 32) >> 6;
-
- int x_weight_frac = x_weight & 0xF;
- int y_weight_frac = y_weight & 0xF;
- int x_weight_int = x_weight >> 4;
- int y_weight_int = y_weight >> 4;
- int qweight[4];
- int weight[4];
- qweight[0] = x_weight_int + y_weight_int * x_weights;
- qweight[1] = qweight[0] + 1;
- qweight[2] = qweight[0] + x_weights;
- qweight[3] = qweight[2] + 1;
-
- // truncated-precision bilinear interpolation.
- int prod = x_weight_frac * y_weight_frac;
-
- weight[3] = (prod + 8) >> 4;
- weight[1] = x_weight_frac - weight[3];
- weight[2] = y_weight_frac - weight[3];
- weight[0] = 16 - x_weight_frac - y_weight_frac + weight[3];
-
- for (i = 0; i < 4; i++)
- if (weight[i] != 0)
- {
- grid_weights_of_texel[texel][weightcount_of_texel[texel]] = qweight[i];
- weights_of_texel[texel][weightcount_of_texel[texel]] = weight[i];
- weightcount_of_texel[texel]++;
- texels_of_weight[qweight[i]][texelcount_of_weight[qweight[i]]] = texel;
- texelweights_of_weight[qweight[i]][texelcount_of_weight[qweight[i]]] = weight[i];
- texelcount_of_weight[qweight[i]]++;
- }
- }
-
- for (i = 0; i < texels_per_block; i++)
- {
- dt->texel_num_weights[i] = weightcount_of_texel[i];
-
- // ensure that all 4 entries are actually initialized.
- // This allows a branch-free implementation of compute_value_of_texel_flt()
- for (j = 0; j < 4; j++)
- {
- dt->texel_weights_int[i][j] = 0;
- dt->texel_weights_float[i][j] = 0.0f;
- dt->texel_weights[i][j] = 0;
- }
-
- for (j = 0; j < weightcount_of_texel[i]; j++)
- {
- dt->texel_weights_int[i][j] = weights_of_texel[i][j];
- dt->texel_weights_float[i][j] = static_cast < float >(weights_of_texel[i][j]) * (1.0f / TEXEL_WEIGHT_SUM);
- dt->texel_weights[i][j] = grid_weights_of_texel[i][j];
- }
- }
-
- for (i = 0; i < weights_per_block; i++)
- {
- dt->weight_num_texels[i] = texelcount_of_weight[i];
-
-
- for (j = 0; j < texelcount_of_weight[i]; j++)
- {
- dt->weight_texel[i][j] = texels_of_weight[i][j];
- dt->weights_int[i][j] = texelweights_of_weight[i][j];
- dt->weights_flt[i][j] = static_cast < float >(texelweights_of_weight[i][j]);
- }
- }
-
- dt->num_texels = texels_per_block;
- dt->num_weights = weights_per_block;
-
-
-}
-
-
-
-
-static void initialize_decimation_table_3d(
- // dimensions of the block
- int xdim, int ydim, int zdim,
- // number of grid points in 3d weight grid
- int x_weights, int y_weights, int z_weights, decimation_table * dt)
-{
- int i, j;
- int x, y, z;
-
- int texels_per_block = xdim * ydim * zdim;
- int weights_per_block = x_weights * y_weights * z_weights;
-
- int weightcount_of_texel[MAX_TEXELS_PER_BLOCK];
- int grid_weights_of_texel[MAX_TEXELS_PER_BLOCK][4];
- int weights_of_texel[MAX_TEXELS_PER_BLOCK][4];
-
- int texelcount_of_weight[MAX_WEIGHTS_PER_BLOCK];
- int texels_of_weight[MAX_WEIGHTS_PER_BLOCK][MAX_TEXELS_PER_BLOCK];
- int texelweights_of_weight[MAX_WEIGHTS_PER_BLOCK][MAX_TEXELS_PER_BLOCK];
-
- for (i = 0; i < weights_per_block; i++)
- texelcount_of_weight[i] = 0;
- for (i = 0; i < texels_per_block; i++)
- weightcount_of_texel[i] = 0;
-
- for (z = 0; z < zdim; z++)
- for (y = 0; y < ydim; y++)
- for (x = 0; x < xdim; x++)
- {
- int texel = (z * ydim + y) * xdim + x;
-
- int x_weight = (((1024 + xdim / 2) / (xdim - 1)) * x * (x_weights - 1) + 32) >> 6;
- int y_weight = (((1024 + ydim / 2) / (ydim - 1)) * y * (y_weights - 1) + 32) >> 6;
- int z_weight = (((1024 + zdim / 2) / (zdim - 1)) * z * (z_weights - 1) + 32) >> 6;
-
- int x_weight_frac = x_weight & 0xF;
- int y_weight_frac = y_weight & 0xF;
- int z_weight_frac = z_weight & 0xF;
- int x_weight_int = x_weight >> 4;
- int y_weight_int = y_weight >> 4;
- int z_weight_int = z_weight >> 4;
- int qweight[4];
- int weight[4];
- qweight[0] = (z_weight_int * y_weights + y_weight_int) * x_weights + x_weight_int;
- qweight[3] = ((z_weight_int + 1) * y_weights + (y_weight_int + 1)) * x_weights + (x_weight_int + 1);
-
- // simplex interpolation
- int fs = x_weight_frac;
- int ft = y_weight_frac;
- int fp = z_weight_frac;
-
- int cas = ((fs > ft) << 2) + ((ft > fp) << 1) + ((fs > fp));
- int N = x_weights;
- int NM = x_weights * y_weights;
-
- int s1, s2, w0, w1, w2, w3;
- switch (cas)
- {
- case 7:
- s1 = 1;
- s2 = N;
- w0 = 16 - fs;
- w1 = fs - ft;
- w2 = ft - fp;
- w3 = fp;
- break;
- case 3:
- s1 = N;
- s2 = 1;
- w0 = 16 - ft;
- w1 = ft - fs;
- w2 = fs - fp;
- w3 = fp;
- break;
- case 5:
- s1 = 1;
- s2 = NM;
- w0 = 16 - fs;
- w1 = fs - fp;
- w2 = fp - ft;
- w3 = ft;
- break;
- case 4:
- s1 = NM;
- s2 = 1;
- w0 = 16 - fp;
- w1 = fp - fs;
- w2 = fs - ft;
- w3 = ft;
- break;
- case 2:
- s1 = N;
- s2 = NM;
- w0 = 16 - ft;
- w1 = ft - fp;
- w2 = fp - fs;
- w3 = fs;
- break;
- case 0:
- s1 = NM;
- s2 = N;
- w0 = 16 - fp;
- w1 = fp - ft;
- w2 = ft - fs;
- w3 = fs;
- break;
-
- default:
- s1 = NM;
- s2 = N;
- w0 = 16 - fp;
- w1 = fp - ft;
- w2 = ft - fs;
- w3 = fs;
- break;
- }
-
- qweight[1] = qweight[0] + s1;
- qweight[2] = qweight[1] + s2;
- weight[0] = w0;
- weight[1] = w1;
- weight[2] = w2;
- weight[3] = w3;
-
- /*
- for(i=0;i<4;i++) weight[i] <<= 4; */
-
- for (i = 0; i < 4; i++)
- if (weight[i] != 0)
- {
- grid_weights_of_texel[texel][weightcount_of_texel[texel]] = qweight[i];
- weights_of_texel[texel][weightcount_of_texel[texel]] = weight[i];
- weightcount_of_texel[texel]++;
- texels_of_weight[qweight[i]][texelcount_of_weight[qweight[i]]] = texel;
- texelweights_of_weight[qweight[i]][texelcount_of_weight[qweight[i]]] = weight[i];
- texelcount_of_weight[qweight[i]]++;
- }
- }
-
- for (i = 0; i < texels_per_block; i++)
- {
- dt->texel_num_weights[i] = weightcount_of_texel[i];
-
- // ensure that all 4 entries are actually initialized.
- // This allows a branch-free implementation of compute_value_of_texel_flt()
- for (j = 0; j < 4; j++)
- {
- dt->texel_weights_int[i][j] = 0;
- dt->texel_weights_float[i][j] = 0.0f;
- dt->texel_weights[i][j] = 0;
- }
-
- for (j = 0; j < weightcount_of_texel[i]; j++)
- {
- dt->texel_weights_int[i][j] = weights_of_texel[i][j];
- dt->texel_weights_float[i][j] = static_cast < float >(weights_of_texel[i][j]) * (1.0f / TEXEL_WEIGHT_SUM);
- dt->texel_weights[i][j] = grid_weights_of_texel[i][j];
- }
- }
-
- for (i = 0; i < weights_per_block; i++)
- {
- dt->weight_num_texels[i] = texelcount_of_weight[i];
- for (j = 0; j < texelcount_of_weight[i]; j++)
- {
- dt->weight_texel[i][j] = texels_of_weight[i][j];
- dt->weights_int[i][j] = texelweights_of_weight[i][j];
- dt->weights_flt[i][j] = static_cast < float >(texelweights_of_weight[i][j]);
- }
- }
-
- dt->num_texels = texels_per_block;
- dt->num_weights = weights_per_block;
-}
-
-
-
-void construct_block_size_descriptor_2d(int xdim, int ydim, block_size_descriptor * bsd)
-{
- int decimation_mode_index[256]; // for each of the 256 entries in the decim_table_array, its index
- int decimation_mode_count = 0;
-
- int i;
- int x_weights;
- int y_weights;
-
- for (i = 0; i < 256; i++)
- {
- decimation_mode_index[i] = -1;
- }
-
- // gather all the infill-modes that can be used with the current block size
- for (x_weights = 2; x_weights <= 12; x_weights++)
- for (y_weights = 2; y_weights <= 12; y_weights++)
- {
- if (x_weights * y_weights > MAX_WEIGHTS_PER_BLOCK)
- continue;
- decimation_table *dt = new decimation_table;
- decimation_mode_index[y_weights * 16 + x_weights] = decimation_mode_count;
- initialize_decimation_table_2d(xdim, ydim, x_weights, y_weights, dt);
-
- int weight_count = x_weights * y_weights;
-
- int maxprec_1plane = -1;
- int maxprec_2planes = -1;
- for (i = 0; i < 12; i++)
- {
- int bits_1plane = compute_ise_bitcount(weight_count, (quantization_method) i);
- int bits_2planes = compute_ise_bitcount(2 * weight_count, (quantization_method) i);
- if (bits_1plane >= MIN_WEIGHT_BITS_PER_BLOCK && bits_1plane <= MAX_WEIGHT_BITS_PER_BLOCK)
- maxprec_1plane = i;
- if (bits_2planes >= MIN_WEIGHT_BITS_PER_BLOCK && bits_2planes <= MAX_WEIGHT_BITS_PER_BLOCK)
- maxprec_2planes = i;
- }
-
- if (2 * x_weights * y_weights > MAX_WEIGHTS_PER_BLOCK)
- maxprec_2planes = -1;
-
- bsd->permit_encode[decimation_mode_count] = (x_weights <= xdim && y_weights <= ydim);
-
- bsd->decimation_mode_samples[decimation_mode_count] = weight_count;
- bsd->decimation_mode_maxprec_1plane[decimation_mode_count] = maxprec_1plane;
- bsd->decimation_mode_maxprec_2planes[decimation_mode_count] = maxprec_2planes;
- bsd->decimation_tables[decimation_mode_count] = dt;
-
- decimation_mode_count++;
- }
-
- for (i = 0; i < MAX_DECIMATION_MODES; i++)
- {
- bsd->decimation_mode_percentile[i] = 1.0f;
- }
-
- for (i = decimation_mode_count; i < MAX_DECIMATION_MODES; i++)
- {
- bsd->permit_encode[i] = 0;
- bsd->decimation_mode_samples[i] = 0;
- bsd->decimation_mode_maxprec_1plane[i] = -1;
- bsd->decimation_mode_maxprec_2planes[i] = -1;
- }
-
- bsd->decimation_mode_count = decimation_mode_count;
-
- const float *percentiles = get_2d_percentile_table(xdim, ydim);
-
- // then construct the list of block formats
- for (i = 0; i < 2048; i++)
- {
- int x_weights, y_weights;
- int is_dual_plane;
- int quantization_mode;
- int fail = 0;
- int permit_encode = 1;
-
- if (decode_block_mode_2d(i, &x_weights, &y_weights, &is_dual_plane, &quantization_mode))
- {
- if (x_weights > xdim || y_weights > ydim)
- permit_encode = 0;
- }
- else
- {
- fail = 1;
- permit_encode = 0;
- }
-
- if (fail)
- {
- bsd->block_modes[i].decimation_mode = -1;
- bsd->block_modes[i].quantization_mode = -1;
- bsd->block_modes[i].is_dual_plane = -1;
- bsd->block_modes[i].permit_encode = 0;
- bsd->block_modes[i].permit_decode = 0;
- bsd->block_modes[i].percentile = 1.0f;
- }
- else
- {
- int decimation_mode = decimation_mode_index[y_weights * 16 + x_weights];
- bsd->block_modes[i].decimation_mode = decimation_mode;
- bsd->block_modes[i].quantization_mode = quantization_mode;
- bsd->block_modes[i].is_dual_plane = is_dual_plane;
- bsd->block_modes[i].permit_encode = permit_encode;
- bsd->block_modes[i].permit_decode = permit_encode; // disallow decode of grid size larger than block size.
- bsd->block_modes[i].percentile = percentiles[i];
-
- if (bsd->decimation_mode_percentile[decimation_mode] > percentiles[i])
- bsd->decimation_mode_percentile[decimation_mode] = percentiles[i];
- }
-
- }
-
- if (xdim * ydim <= 64)
- {
- bsd->texelcount_for_bitmap_partitioning = xdim * ydim;
- for (i = 0; i < xdim * ydim; i++)
- bsd->texels_for_bitmap_partitioning[i] = i;
- }
-
- else
- {
- // pick 64 random texels for use with bitmap partitioning.
- int arr[MAX_TEXELS_PER_BLOCK];
- for (i = 0; i < xdim * ydim; i++)
- arr[i] = 0;
- int arr_elements_set = 0;
- while (arr_elements_set < 64)
- {
- int idx = rand() % (xdim * ydim);
- if (arr[idx] == 0)
- {
- arr_elements_set++;
- arr[idx] = 1;
- }
- }
- int texel_weights_written = 0;
- int idx = 0;
- while (texel_weights_written < 64)
- {
- if (arr[idx])
- bsd->texels_for_bitmap_partitioning[texel_weights_written++] = idx;
- idx++;
- }
- bsd->texelcount_for_bitmap_partitioning = 64;
-
- }
-}
-
-
-
-void construct_block_size_descriptor_3d(int xdim, int ydim, int zdim, block_size_descriptor * bsd)
-{
- int decimation_mode_index[512]; // for each of the 512 entries in the decim_table_array, its index
- int decimation_mode_count = 0;
-
- int i;
- int x_weights;
- int y_weights;
- int z_weights;
-
- for (i = 0; i < 512; i++)
- {
- decimation_mode_index[i] = -1;
- }
-
- // gather all the infill-modes that can be used with the current block size
- for (x_weights = 2; x_weights <= 6; x_weights++)
- for (y_weights = 2; y_weights <= 6; y_weights++)
- for (z_weights = 2; z_weights <= 6; z_weights++)
- {
- if ((x_weights * y_weights * z_weights) > MAX_WEIGHTS_PER_BLOCK)
- continue;
- decimation_table *dt = new decimation_table;
- decimation_mode_index[z_weights * 64 + y_weights * 8 + x_weights] = decimation_mode_count;
- initialize_decimation_table_3d(xdim, ydim, zdim, x_weights, y_weights, z_weights, dt);
-
- int weight_count = x_weights * y_weights * z_weights;
-
- int maxprec_1plane = -1;
- int maxprec_2planes = -1;
- for (i = 0; i < 12; i++)
- {
- int bits_1plane = compute_ise_bitcount(weight_count, (quantization_method) i);
- int bits_2planes = compute_ise_bitcount(2 * weight_count, (quantization_method) i);
- if (bits_1plane >= MIN_WEIGHT_BITS_PER_BLOCK && bits_1plane <= MAX_WEIGHT_BITS_PER_BLOCK)
- maxprec_1plane = i;
- if (bits_2planes >= MIN_WEIGHT_BITS_PER_BLOCK && bits_2planes <= MAX_WEIGHT_BITS_PER_BLOCK)
- maxprec_2planes = i;
- }
-
- if ((2 * x_weights * y_weights * z_weights) > MAX_WEIGHTS_PER_BLOCK)
- maxprec_2planes = -1;
-
- bsd->permit_encode[decimation_mode_count] = (x_weights <= xdim && y_weights <= ydim && z_weights <= zdim);
-
- bsd->decimation_mode_samples[decimation_mode_count] = weight_count;
- bsd->decimation_mode_maxprec_1plane[decimation_mode_count] = maxprec_1plane;
- bsd->decimation_mode_maxprec_2planes[decimation_mode_count] = maxprec_2planes;
- bsd->decimation_tables[decimation_mode_count] = dt;
-
- decimation_mode_count++;
- }
-
- for (i = 0; i < MAX_DECIMATION_MODES; i++)
- {
- bsd->decimation_mode_percentile[i] = 1.0f;
- }
-
- for (i = decimation_mode_count; i < MAX_DECIMATION_MODES; i++)
- {
- bsd->permit_encode[i] = 0;
- bsd->decimation_mode_samples[i] = 0;
- bsd->decimation_mode_maxprec_1plane[i] = -1;
- bsd->decimation_mode_maxprec_2planes[i] = -1;
- }
-
- bsd->decimation_mode_count = decimation_mode_count;
-
- const float *percentiles = get_3d_percentile_table(xdim, ydim, zdim);
-
- // then construct the list of block formats
- for (i = 0; i < 2048; i++)
- {
- int x_weights, y_weights, z_weights;
- int is_dual_plane;
- int quantization_mode;
- int fail = 0;
- int permit_encode = 1;
-
- if (decode_block_mode_3d(i, &x_weights, &y_weights, &z_weights, &is_dual_plane, &quantization_mode))
- {
- if (x_weights > xdim || y_weights > ydim || z_weights > zdim)
- permit_encode = 0;
- }
- else
- {
- fail = 1;
- permit_encode = 0;
- }
- if (fail)
- {
- bsd->block_modes[i].decimation_mode = -1;
- bsd->block_modes[i].quantization_mode = -1;
- bsd->block_modes[i].is_dual_plane = -1;
- bsd->block_modes[i].permit_encode = 0;
- bsd->block_modes[i].permit_decode = 0;
- bsd->block_modes[i].percentile = 1.0f;
- }
- else
- {
- int decimation_mode = decimation_mode_index[z_weights * 64 + y_weights * 8 + x_weights];
- bsd->block_modes[i].decimation_mode = decimation_mode;
- bsd->block_modes[i].quantization_mode = quantization_mode;
- bsd->block_modes[i].is_dual_plane = is_dual_plane;
- bsd->block_modes[i].permit_encode = permit_encode;
- bsd->block_modes[i].permit_decode = permit_encode;
- bsd->block_modes[i].percentile = percentiles[i];
-
- if (bsd->decimation_mode_percentile[decimation_mode] > percentiles[i])
- bsd->decimation_mode_percentile[decimation_mode] = percentiles[i];
- }
-
- }
-
- if (xdim * ydim * zdim <= 64)
- {
- bsd->texelcount_for_bitmap_partitioning = xdim * ydim * zdim;
- for (i = 0; i < xdim * ydim * zdim; i++)
- bsd->texels_for_bitmap_partitioning[i] = i;
- }
-
- else
- {
- // pick 64 random texels for use with bitmap partitioning.
- int arr[MAX_TEXELS_PER_BLOCK];
- for (i = 0; i < xdim * ydim * zdim; i++)
- arr[i] = 0;
- int arr_elements_set = 0;
- while (arr_elements_set < 64)
- {
- int idx = rand() % (xdim * ydim * zdim);
- if (arr[idx] == 0)
- {
- arr_elements_set++;
- arr[idx] = 1;
- }
- }
- int texel_weights_written = 0;
- int idx = 0;
- while (texel_weights_written < 64)
- {
- if (arr[idx])
- bsd->texels_for_bitmap_partitioning[texel_weights_written++] = idx;
- idx++;
- }
- bsd->texelcount_for_bitmap_partitioning = 64;
- }
-}
-
-
-
-
-static block_size_descriptor *bsd_pointers[4096];
-
-// function to obtain a block size descriptor. If the descriptor does not exist,
-// it is created as needed. Should not be called from within multi-threaded code.
-const block_size_descriptor *get_block_size_descriptor(int xdim, int ydim, int zdim)
-{
- int bsd_index = xdim + (ydim << 4) + (zdim << 8);
- if (bsd_pointers[bsd_index] == NULL)
- {
- block_size_descriptor *bsd = new block_size_descriptor;
- if (zdim > 1)
- construct_block_size_descriptor_3d(xdim, ydim, zdim, bsd);
- else
- construct_block_size_descriptor_2d(xdim, ydim, bsd);
-
- bsd_pointers[bsd_index] = bsd;
- }
- return bsd_pointers[bsd_index];
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_codec_internals.h b/3rdparty/bimg/3rdparty/astc/astc_codec_internals.h
deleted file mode 100644
index 13356ae2c3b..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_codec_internals.h
+++ /dev/null
@@ -1,816 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012, 2018 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Internal function and data declarations for ASTC codec.
- */
-/*----------------------------------------------------------------------------*/
-
-#ifndef ASTC_CODEC_INTERNALS_INCLUDED
-
-#define ASTC_CODEC_INTERNALS_INCLUDED
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <math.h>
-#include "mathlib.h"
-
-#ifndef MIN
- #define MIN(x,y) ((x)<(y)?(x):(y))
-#endif
-
-#ifndef MAX
- #define MAX(x,y) ((x)>(y)?(x):(y))
-#endif
-
-// Macro to silence warnings on ignored parameters.
-// The presence of this macro should be a signal to look at refactoring.
-#define IGNORE(param) ((void)&param)
-
-#define astc_isnan(p) ((p)!=(p))
-
-// ASTC parameters
-#define MAX_TEXELS_PER_BLOCK 216
-#define MAX_WEIGHTS_PER_BLOCK 64
-#define MIN_WEIGHT_BITS_PER_BLOCK 24
-#define MAX_WEIGHT_BITS_PER_BLOCK 96
-#define PARTITION_BITS 10
-#define PARTITION_COUNT (1 << PARTITION_BITS)
-
-// the sum of weights for one texel.
-#define TEXEL_WEIGHT_SUM 16
-#define MAX_DECIMATION_MODES 87
-#define MAX_WEIGHT_MODES 2048
-
-// error reporting for codec internal errors.
-#define ASTC_CODEC_INTERNAL_ERROR astc_codec_internal_error(__FILE__, __LINE__)
-
-void astc_codec_internal_error(const char *filename, int linenumber);
-
-// uncomment this macro to enable checking for inappropriate NaNs;
-// works on Linux only, and slows down encoding significantly.
-// #define DEBUG_CAPTURE_NAN
-
-// the PRINT_DIAGNOSTICS macro enables the -diag command line switch,
-// which can be used to look for codec bugs
-#define DEBUG_PRINT_DIAGNOSTICS
-
-#ifdef DEBUG_PRINT_DIAGNOSTICS
- extern int print_diagnostics;
-#endif
-
-extern int print_tile_errors;
-extern int print_statistics;
-
-extern int perform_srgb_transform;
-extern int rgb_force_use_of_hdr;
-extern int alpha_force_use_of_hdr;
-
-struct processed_line2
-{
- float2 amod;
- float2 bs;
- float2 bis;
-};
-struct processed_line3
-{
- float3 amod;
- float3 bs;
- float3 bis;
-};
-struct processed_line4
-{
- float4 amod;
- float4 bs;
- float4 bis;
-};
-
-enum astc_decode_mode
-{
- DECODE_LDR_SRGB,
- DECODE_LDR,
- DECODE_HDR
-};
-
-
-/*
- Partition table representation:
- For each block size, we have 3 tables, each with 1024 partitionings;
- these three tables correspond to 2, 3 and 4 partitions respectively.
- For each partitioning, we have:
- * a 4-entry table indicating how many texels there are in each of the 4 partitions.
- This may be from 0 to a very large value.
- * a table indicating the partition index of each of the texels in the block.
- Each index may be 0, 1, 2 or 3.
- * Each element in the table is an uint8_t indicating partition index (0, 1, 2 or 3)
-*/
-
-struct partition_info
-{
- int partition_count;
- uint8_t texels_per_partition[4];
- uint8_t partition_of_texel[MAX_TEXELS_PER_BLOCK];
- uint8_t texels_of_partition[4][MAX_TEXELS_PER_BLOCK];
-
- uint64_t coverage_bitmaps[4]; // used for the purposes of k-means partition search.
-};
-
-
-
-
-/*
- In ASTC, we don't necessarily provide a weight for every texel.
- As such, for each block size, there are a number of patterns where some texels
- have their weights computed as a weighted average of more than 1 weight.
- As such, the codec uses a data structure that tells us: for each texel, which
- weights it is a combination of for each weight, which texels it contributes to.
- The decimation_table is this data structure.
-*/
-struct decimation_table
-{
- int num_texels;
- int num_weights;
- uint8_t texel_num_weights[MAX_TEXELS_PER_BLOCK]; // number of indices that go into the calculation for a texel
- uint8_t texel_weights_int[MAX_TEXELS_PER_BLOCK][4]; // the weight to assign to each weight
- float texel_weights_float[MAX_TEXELS_PER_BLOCK][4]; // the weight to assign to each weight
- uint8_t texel_weights[MAX_TEXELS_PER_BLOCK][4]; // the weights that go into a texel calculation
- uint8_t weight_num_texels[MAX_WEIGHTS_PER_BLOCK]; // the number of texels that a given weight contributes to
- uint8_t weight_texel[MAX_WEIGHTS_PER_BLOCK][MAX_TEXELS_PER_BLOCK]; // the texels that the weight contributes to
- uint8_t weights_int[MAX_WEIGHTS_PER_BLOCK][MAX_TEXELS_PER_BLOCK]; // the weights that the weight contributes to a texel.
- float weights_flt[MAX_WEIGHTS_PER_BLOCK][MAX_TEXELS_PER_BLOCK]; // the weights that the weight contributes to a texel.
-};
-
-
-
-
-/*
- data structure describing information that pertains to a block size and its associated block modes.
-*/
-struct block_mode
-{
- int8_t decimation_mode;
- int8_t quantization_mode;
- int8_t is_dual_plane;
- int8_t permit_encode;
- int8_t permit_decode;
- float percentile;
-};
-
-
-struct block_size_descriptor
-{
- int decimation_mode_count;
- int decimation_mode_samples[MAX_DECIMATION_MODES];
- int decimation_mode_maxprec_1plane[MAX_DECIMATION_MODES];
- int decimation_mode_maxprec_2planes[MAX_DECIMATION_MODES];
- float decimation_mode_percentile[MAX_DECIMATION_MODES];
- int permit_encode[MAX_DECIMATION_MODES];
- const decimation_table *decimation_tables[MAX_DECIMATION_MODES + 1];
- block_mode block_modes[MAX_WEIGHT_MODES];
-
- // for the k-means bed bitmap partitioning algorithm, we don't
- // want to consider more than 64 texels; this array specifies
- // which 64 texels (if that many) to consider.
- int texelcount_for_bitmap_partitioning;
- int texels_for_bitmap_partitioning[64];
-};
-
-// data structure representing one block of an image.
-// it is expanded to float prior to processing to save some computation time
-// on conversions to/from uint8_t (this also allows us to handle HDR textures easily)
-struct imageblock
-{
- float orig_data[MAX_TEXELS_PER_BLOCK * 4]; // original input data
- float work_data[MAX_TEXELS_PER_BLOCK * 4]; // the data that we will compress, either linear or LNS (0..65535 in both cases)
- float deriv_data[MAX_TEXELS_PER_BLOCK * 4]; // derivative of the conversion function used, used to modify error weighting
-
- uint8_t rgb_lns[MAX_TEXELS_PER_BLOCK]; // 1 if RGB data are being treated as LNS
- uint8_t alpha_lns[MAX_TEXELS_PER_BLOCK]; // 1 if Alpha data are being treated as LNS
- uint8_t nan_texel[MAX_TEXELS_PER_BLOCK]; // 1 if the texel is a NaN-texel.
-
- float red_min, red_max;
- float green_min, green_max;
- float blue_min, blue_max;
- float alpha_min, alpha_max;
- int grayscale; // 1 if R=G=B for every pixel, 0 otherwise
-
- int xpos, ypos, zpos;
-};
-
-
-struct error_weighting_params
-{
- float rgb_power;
- float rgb_base_weight;
- float rgb_mean_weight;
- float rgb_stdev_weight;
- float alpha_power;
- float alpha_base_weight;
- float alpha_mean_weight;
- float alpha_stdev_weight;
- float rgb_mean_and_stdev_mixing;
- int mean_stdev_radius;
- int enable_rgb_scale_with_alpha;
- int alpha_radius;
- int ra_normal_angular_scale;
- float block_artifact_suppression;
- float rgba_weights[4];
-
- float block_artifact_suppression_expanded[MAX_TEXELS_PER_BLOCK];
-
- // parameters that deal with heuristic codec speedups
- int partition_search_limit;
- float block_mode_cutoff;
- float texel_avg_error_limit;
- float partition_1_to_2_limit;
- float lowest_correlation_cutoff;
- int max_refinement_iters;
-};
-
-
-
-
-void update_imageblock_flags(imageblock * pb, int xdim, int ydim, int zdim);
-
-
-void imageblock_initialize_orig_from_work(imageblock * pb, int pixelcount);
-
-
-void imageblock_initialize_work_from_orig(imageblock * pb, int pixelcount);
-
-
-
-/*
- Data structure representing error weighting for one block of an image. this is used as
- a multiplier for the error weight to apply to each color component when computing PSNR.
-
- This weighting has several uses: it's usable for RA, GA, BA, A weighting, which is useful
- for alpha-textures it's usable for HDR textures, where weighting should be approximately inverse to
- luminance it's usable for perceptual weighting, where we assign higher weight to low-variability
- regions than to high-variability regions. it's usable for suppressing off-edge block content in
- case the texture doesn't actually extend to the edge of the block.
-
- For the default case (everything is evenly weighted), every weight is 1. For the RA,GA,BA,A case,
- we multiply the R,G,B weights with that of the alpha.
-
- Putting the same weight in every component should result in the default case.
- The following relations should hold:
-
- texel_weight_rg[i] = (texel_weight_r[i] + texel_weight_g[i]) / 2
- texel_weight_lum[i] = (texel_weight_r[i] + texel_weight_g[i] + texel_weight_b[i]) / 3
- texel_weight[i] = (texel_weight_r[i] + texel_weight_g[i] + texel_weight_b[i] + texel_weight_a[i] / 4
- */
-
-struct error_weight_block
-{
- float4 error_weights[MAX_TEXELS_PER_BLOCK];
- float texel_weight[MAX_TEXELS_PER_BLOCK];
- float texel_weight_gba[MAX_TEXELS_PER_BLOCK];
- float texel_weight_rba[MAX_TEXELS_PER_BLOCK];
- float texel_weight_rga[MAX_TEXELS_PER_BLOCK];
- float texel_weight_rgb[MAX_TEXELS_PER_BLOCK];
-
- float texel_weight_rg[MAX_TEXELS_PER_BLOCK];
- float texel_weight_rb[MAX_TEXELS_PER_BLOCK];
- float texel_weight_gb[MAX_TEXELS_PER_BLOCK];
- float texel_weight_ra[MAX_TEXELS_PER_BLOCK];
-
- float texel_weight_r[MAX_TEXELS_PER_BLOCK];
- float texel_weight_g[MAX_TEXELS_PER_BLOCK];
- float texel_weight_b[MAX_TEXELS_PER_BLOCK];
- float texel_weight_a[MAX_TEXELS_PER_BLOCK];
-
- int contains_zeroweight_texels;
-};
-
-
-
-struct error_weight_block_orig
-{
- float4 error_weights[MAX_TEXELS_PER_BLOCK];
-};
-
-
-// enumeration of all the quantization methods we support under this format.
-enum quantization_method
-{
- QUANT_2 = 0,
- QUANT_3 = 1,
- QUANT_4 = 2,
- QUANT_5 = 3,
- QUANT_6 = 4,
- QUANT_8 = 5,
- QUANT_10 = 6,
- QUANT_12 = 7,
- QUANT_16 = 8,
- QUANT_20 = 9,
- QUANT_24 = 10,
- QUANT_32 = 11,
- QUANT_40 = 12,
- QUANT_48 = 13,
- QUANT_64 = 14,
- QUANT_80 = 15,
- QUANT_96 = 16,
- QUANT_128 = 17,
- QUANT_160 = 18,
- QUANT_192 = 19,
- QUANT_256 = 20
-};
-
-
-/*
- In ASTC, we support relatively many combinations of weight precisions and weight transfer functions.
- As such, for each combination we support, we have a hardwired data structure.
-
- This structure provides the following information: A table, used to estimate the closest quantized
- weight for a given floating-point weight. For each quantized weight, the corresponding unquantized
- and floating-point values. For each quantized weight, a previous-value and a next-value.
-*/
-
-struct quantization_and_transfer_table
-{
- quantization_method method;
- uint8_t unquantized_value[32]; // 0..64
- float unquantized_value_flt[32]; // 0..1
- uint8_t prev_quantized_value[32];
- uint8_t next_quantized_value[32];
- uint8_t closest_quantized_weight[1025];
-};
-
-extern const quantization_and_transfer_table quant_and_xfer_tables[12];
-
-
-
-enum endpoint_formats
-{
- FMT_LUMINANCE = 0,
- FMT_LUMINANCE_DELTA = 1,
- FMT_HDR_LUMINANCE_LARGE_RANGE = 2,
- FMT_HDR_LUMINANCE_SMALL_RANGE = 3,
- FMT_LUMINANCE_ALPHA = 4,
- FMT_LUMINANCE_ALPHA_DELTA = 5,
- FMT_RGB_SCALE = 6,
- FMT_HDR_RGB_SCALE = 7,
- FMT_RGB = 8,
- FMT_RGB_DELTA = 9,
- FMT_RGB_SCALE_ALPHA = 10,
- FMT_HDR_RGB = 11,
- FMT_RGBA = 12,
- FMT_RGBA_DELTA = 13,
- FMT_HDR_RGB_LDR_ALPHA = 14,
- FMT_HDR_RGBA = 15,
-};
-
-
-
-struct symbolic_compressed_block
-{
- int error_block; // 1 marks error block, 0 marks non-error-block.
- int block_mode; // 0 to 2047. Negative value marks constant-color block (-1: FP16, -2:UINT16)
- int partition_count; // 1 to 4; Zero marks a constant-color block.
- int partition_index; // 0 to 1023
- int color_formats[4]; // color format for each endpoint color pair.
- int color_formats_matched; // color format for all endpoint pairs are matched.
- int color_values[4][12]; // quantized endpoint color pairs.
- int color_quantization_level;
- uint8_t plane1_weights[MAX_WEIGHTS_PER_BLOCK]; // quantized and decimated weights
- uint8_t plane2_weights[MAX_WEIGHTS_PER_BLOCK];
- int plane2_color_component; // color component for the secondary plane of weights
- int constant_color[4]; // constant-color, as FP16 or UINT16. Used for constant-color blocks only.
-};
-
-
-struct physical_compressed_block
-{
- uint8_t data[16];
-};
-
-
-
-
-const block_size_descriptor *get_block_size_descriptor(int xdim, int ydim, int zdim);
-
-
-// ***********************************************************
-// functions and data pertaining to quantization and encoding
-// **********************************************************
-extern const uint8_t color_quantization_tables[21][256];
-extern const uint8_t color_unquantization_tables[21][256];
-
-void encode_ise(int quantization_level, int elements, const uint8_t * input_data, uint8_t * output_data, int bit_offset);
-
-void decode_ise(int quantization_level, int elements, const uint8_t * input_data, uint8_t * output_data, int bit_offset);
-
-int compute_ise_bitcount(int items, quantization_method quant);
-
-void build_quantization_mode_table(void);
-extern int quantization_mode_table[17][128];
-
-
-// **********************************************
-// functions and data pertaining to partitioning
-// **********************************************
-
-// function to get a pointer to a partition table or an array thereof.
-const partition_info *get_partition_table(int xdim, int ydim, int zdim, int partition_count);
-
-
-
-
-// functions to compute color averages and dominant directions
-// for each partition in a block
-
-
-void compute_averages_and_directions_rgb(const partition_info * pt,
- const imageblock * blk,
- const error_weight_block * ewb,
- const float4 * color_scalefactors, float3 * averages, float3 * directions_rgb, float2 * directions_rg, float2 * directions_rb, float2 * directions_gb);
-
-
-
-void compute_averages_and_directions_rgba(const partition_info * pt,
- const imageblock * blk,
- const error_weight_block * ewb,
- const float4 * color_scalefactors,
- float4 * averages, float4 * directions_rgba, float3 * directions_gba, float3 * directions_rba, float3 * directions_rga, float3 * directions_rgb);
-
-
-void compute_averages_and_directions_3_components(const partition_info * pt,
- const imageblock * blk,
- const error_weight_block * ewb,
- const float3 * color_scalefactors, int component1, int component2, int component3, float3 * averages, float3 * directions);
-
-void compute_averages_and_directions_2_components(const partition_info * pt,
- const imageblock * blk,
- const error_weight_block * ewb, const float2 * color_scalefactors, int component1, int component2, float2 * averages, float2 * directions);
-
-// functions to compute error value across a tile given a partitioning
-// (with the assumption that each partitioning has colors lying on a line where
-// they are represented with infinite precision. Also return the length of the line
-// segments that the partition's colors are actually projected onto.
-float compute_error_squared_gba(const partition_info * pt, // the partition that we use when computing the squared-error.
- const imageblock * blk, const error_weight_block * ewb, const processed_line3 * plines,
- // output: computed length of the partitioning's line. This is not part of the
- // error introduced by partitioning itself, but us used to estimate the error introduced by quantization
- float *length_of_lines);
-
-float compute_error_squared_rba(const partition_info * pt, // the partition that we use when computing the squared-error.
- const imageblock * blk, const error_weight_block * ewb, const processed_line3 * plines,
- // output: computed length of the partitioning's line. This is not part of the
- // error introduced by partitioning itself, but us used to estimate the error introduced by quantization
- float *length_of_lines);
-
-float compute_error_squared_rga(const partition_info * pt, // the partition that we use when computing the squared-error.
- const imageblock * blk, const error_weight_block * ewb, const processed_line3 * plines,
- // output: computed length of the partitioning's line. This is not part of the
- // error introduced by partitioning itself, but us used to estimate the error introduced by quantization
- float *length_of_lines);
-
-float compute_error_squared_rgb(const partition_info * pt, // the partition that we use when computing the squared-error.
- const imageblock * blk, const error_weight_block * ewb, const processed_line3 * plines,
- // output: computed length of the partitioning's line. This is not part of the
- // error introduced by partitioning itself, but us used to estimate the error introduced by quantization
- float *length_of_lines);
-
-
-float compute_error_squared_rgba(const partition_info * pt, // the partition that we use when computing the squared-error.
- const imageblock * blk, const error_weight_block * ewb, const processed_line4 * lines, // one line for each of the partitions. The lines are assumed to be normalized.
- float *length_of_lines);
-
-float compute_error_squared_rg(const partition_info * pt, // the partition that we use when computing the squared-error.
- const imageblock * blk, const error_weight_block * ewb, const processed_line2 * plines, float *length_of_lines);
-
-float compute_error_squared_rb(const partition_info * pt, // the partition that we use when computing the squared-error.
- const imageblock * blk, const error_weight_block * ewb, const processed_line2 * plines, float *length_of_lines);
-
-float compute_error_squared_gb(const partition_info * pt, // the partition that we use when computing the squared-error.
- const imageblock * blk, const error_weight_block * ewb, const processed_line2 * plines, float *length_of_lines);
-
-float compute_error_squared_ra(const partition_info * pt, // the partition that we use when computing the squared-error.
- const imageblock * blk, const error_weight_block * ewb, const processed_line2 * plines, float *length_of_lines);
-
-
-// functions to compute error value across a tile for a particular line function
-// for a single partition.
-float compute_error_squared_rgb_single_partition(int partition_to_test, int xdim, int ydim, int zdim, const partition_info * pt, // the partition that we use when computing the squared-error.
- const imageblock * blk, const error_weight_block * ewb, const processed_line3 * lin // the line for the partition.
- );
-
-
-
-// for each partition, compute its color weightings.
-void compute_partition_error_color_weightings(int xdim, int ydim, int zdim, const error_weight_block * ewb, const partition_info * pi, float4 error_weightings[4], float4 color_scalefactors[4]);
-
-
-
-// function to find the best partitioning for a given block.
-
-void find_best_partitionings(int partition_search_limit, int xdim, int ydim, int zdim, int partition_count, const imageblock * pb, const error_weight_block * ewb, int candidates_to_return,
- // best partitionings to use if the endpoint colors are assumed to be uncorrelated
- int *best_partitions_uncorrellated,
- // best partitionings to use if the endpoint colors have the same chroma
- int *best_partitions_samechroma,
- // best partitionings to use if dual plane of weights are present
- int *best_partitions_dual_weight_planes);
-
-
-// use k-means clustering to compute a partition ordering for a block.
-void kmeans_compute_partition_ordering(int xdim, int ydim, int zdim, int partition_count, const imageblock * blk, int *ordering);
-
-
-
-
-// *********************************************************
-// functions and data pertaining to images and imageblocks
-// *********************************************************
-
-struct astc_codec_image
-{
- uint8_t ***imagedata8;
- uint16_t ***imagedata16;
- int xsize;
- int ysize;
- int zsize;
- int padding;
-};
-
-void destroy_image(astc_codec_image * img);
-astc_codec_image *allocate_image(int bitness, int xsize, int ysize, int zsize, int padding);
-void initialize_image(astc_codec_image * img);
-void fill_image_padding_area(astc_codec_image * img);
-
-
-extern float4 ***input_averages;
-extern float4 ***input_variances;
-extern float ***input_alpha_averages;
-
-
-// the entries here : 0=red, 1=green, 2=blue, 3=alpha, 4=0.0, 5=1.0
-struct swizzlepattern
-{
- uint8_t r;
- uint8_t g;
- uint8_t b;
- uint8_t a;
-};
-
-
-
-int determine_image_channels(const astc_codec_image * img);
-
-// function to compute regional averages and variances for an image
-void compute_averages_and_variances(const astc_codec_image * img, float rgb_power_to_use, float alpha_power_to_use, int avg_kernel_radius, int var_kernel_radius, swizzlepattern swz);
-
-
-/*
- Functions to load image from file.
- If successful, return an astc_codec_image object.
- If unsuccessful, returns NULL.
-
- *result is used to return a result. In case of a successfully loaded image, bits[2:0]
- of *result indicate how many components are present, and bit[7] indicate whether
- the input image was LDR or HDR (0=LDR, 1=HDR).
-
- In case of failure, *result is given a negative value.
-*/
-
-
-astc_codec_image *load_ktx_uncompressed_image(const char *filename, int padding, int *result);
-astc_codec_image *load_dds_uncompressed_image(const char *filename, int padding, int *result);
-astc_codec_image *load_tga_image(const char *tga_filename, int padding, int *result);
-astc_codec_image *load_image_with_stb(const char *filename, int padding, int *result);
-
-astc_codec_image *astc_codec_load_image(const char *filename, int padding, int *result);
-int astc_codec_unlink(const char *filename);
-
-// function to store image to file
-// If successful, returns the number of channels in input image
-// If unsuccessful, returns a negative number.
-int store_ktx_uncompressed_image(const astc_codec_image * img, const char *filename, int bitness);
-int store_dds_uncompressed_image(const astc_codec_image * img, const char *filename, int bitness);
-int store_tga_image(const astc_codec_image * img, const char *tga_filename, int bitness);
-
-int astc_codec_store_image(const astc_codec_image * img, const char *filename, int bitness, const char **format_string);
-
-int get_output_filename_enforced_bitness(const char *filename);
-
-
-// compute a bunch of error metrics
-void compute_error_metrics(int input_image_is_hdr, int input_components, const astc_codec_image * img1, const astc_codec_image * img2, int low_fstop, int high_fstop, int psnrmode);
-
-// fetch an image-block from the input file
-void fetch_imageblock(const astc_codec_image * img, imageblock * pb, // picture-block to initialize with image data
- // block dimensions
- int xdim, int ydim, int zdim,
- // position in picture to fetch block from
- int xpos, int ypos, int zpos, swizzlepattern swz);
-
-
-// write an image block to the output file buffer.
-// the data written are taken from orig_data.
-void write_imageblock(astc_codec_image * img, const imageblock * pb, // picture-block to initialize with image data
- // block dimensions
- int xdim, int ydim, int zdim,
- // position in picture to write block to.
- int xpos, int ypos, int zpos, swizzlepattern swz);
-
-
-// helper function to check whether a given picture-block has alpha that is not
-// just uniformly 1.
-int imageblock_uses_alpha(int xdim, int ydim, int zdim, const imageblock * pb);
-
-
-float compute_imageblock_difference(int xdim, int ydim, int zdim, const imageblock * p1, const imageblock * p2, const error_weight_block * ewb);
-
-
-
-
-
-// ***********************************************************
-// functions pertaining to computing texel weights for a block
-// ***********************************************************
-
-
-struct endpoints
-{
- int partition_count;
- float4 endpt0[4];
- float4 endpt1[4];
-};
-
-
-struct endpoints_and_weights
-{
- endpoints ep;
- float weights[MAX_TEXELS_PER_BLOCK];
- float weight_error_scale[MAX_TEXELS_PER_BLOCK];
-};
-
-
-void compute_endpoints_and_ideal_weights_1_plane(int xdim, int ydim, int zdim, const partition_info * pt, const imageblock * blk, const error_weight_block * ewb, endpoints_and_weights * ei);
-
-void compute_endpoints_and_ideal_weights_2_planes(int xdim, int ydim, int zdim, const partition_info * pt, const imageblock * blk, const error_weight_block * ewb, int separate_component,
- endpoints_and_weights * ei1, // for the three components of the primary plane of weights
- endpoints_and_weights * ei2 // for the remaining component.
- );
-
-void compute_ideal_weights_for_decimation_table(const endpoints_and_weights * eai, const decimation_table * it, float *weight_set, float *weights);
-
-void compute_ideal_quantized_weights_for_decimation_table(const endpoints_and_weights * eai,
- const decimation_table * it,
- float low_bound, float high_bound, const float *weight_set_in, float *weight_set_out, uint8_t * quantized_weight_set, int quantization_level);
-
-
-float compute_error_of_weight_set(const endpoints_and_weights * eai, const decimation_table * it, const float *weights);
-
-
-float compute_value_of_texel_flt(int texel_to_get, const decimation_table * it, const float *weights);
-
-
-int compute_value_of_texel_int(int texel_to_get, const decimation_table * it, const int *weights);
-
-
-void merge_endpoints(const endpoints * ep1, // contains three of the color components
- const endpoints * ep2, // contains the remaining color component
- int separate_component, endpoints * res);
-
-// functions dealing with color endpoints
-
-// function to pack a pair of color endpoints into a series of integers.
-// the format used may or may not match the format specified;
-// the return value is the format actually used.
-int pack_color_endpoints(astc_decode_mode decode_mode, float4 color0, float4 color1, float4 rgbs_color, float4 rgbo_color, float2 luminances, int format, int *output, int quantization_level);
-
-
-// unpack a pair of color endpoints from a series of integers.
-void unpack_color_endpoints(astc_decode_mode decode_mode, int format, int quantization_level, const int *input, int *rgb_hdr, int *alpha_hdr, int *nan_endpoint, ushort4 * output0, ushort4 * output1);
-
-
-struct encoding_choice_errors
-{
- float rgb_scale_error; // error of using LDR RGB-scale instead of complete endpoints.
- float rgb_luma_error; // error of using HDR RGB-scale instead of complete endpoints.
- float luminance_error; // error of using luminance instead of RGB
- float alpha_drop_error; // error of discarding alpha
- float rgb_drop_error; // error of discarding RGB
- int can_offset_encode;
- int can_blue_contract;
-};
-
-// buffers used to store intermediate data in compress_symbolic_block_fixed_partition_*()
-struct compress_fixed_partition_buffers
-{
- endpoints_and_weights* ei1;
- endpoints_and_weights* ei2;
- endpoints_and_weights* eix1;
- endpoints_and_weights* eix2;
- float *decimated_quantized_weights;
- float *decimated_weights;
- float *flt_quantized_decimated_quantized_weights;
- uint8_t *u8_quantized_decimated_quantized_weights;
-};
-
-struct compress_symbolic_block_buffers
-{
- error_weight_block *ewb;
- error_weight_block_orig *ewbo;
- symbolic_compressed_block *tempblocks;
- imageblock *temp;
- compress_fixed_partition_buffers *plane1;
- compress_fixed_partition_buffers *planes2;
-};
-
-void compute_encoding_choice_errors(int xdim, int ydim, int zdim, const imageblock * pb, const partition_info * pi, const error_weight_block * ewb,
- int separate_component, // component that is separated out in 2-plane mode, -1 in 1-plane mode
- encoding_choice_errors * eci);
-
-
-
-void determine_optimal_set_of_endpoint_formats_to_use(int xdim, int ydim, int zdim, const partition_info * pt, const imageblock * blk, const error_weight_block * ewb, const endpoints * ep,
- int separate_component, // separate color component for 2-plane mode; -1 for single-plane mode
- // bitcounts and errors computed for the various quantization methods
- const int *qwt_bitcounts, const float *qwt_errors,
- // output data
- int partition_format_specifiers[4][4], int quantized_weight[4], int quantization_level[4], int quantization_level_mod[4]);
-
-
-void recompute_ideal_colors(int xdim, int ydim, int zdim, int weight_quantization_mode, endpoints * ep, // contains the endpoints we wish to update
- float4 * rgbs_vectors, // used to return RGBS-vectors for endpoint mode #6
- float4 * rgbo_vectors, // used to return RGBS-vectors for endpoint mode #7
- float2 * lum_vectors, // used to return luminance-vectors.
- const uint8_t * weight_set, // the current set of weight values
- const uint8_t * plane2_weight_set, // NULL if plane 2 is not actually used.
- int plane2_color_component, // color component for 2nd plane of weights; -1 if the 2nd plane of weights is not present
- const partition_info * pi, const decimation_table * it, const imageblock * pb, // picture-block containing the actual data.
- const error_weight_block * ewb);
-
-
-
-void expand_block_artifact_suppression(int xdim, int ydim, int zdim, error_weighting_params * ewp);
-
-// Function to set error weights for each color component for each texel in a block.
-// Returns the sum of all the error values set.
-float prepare_error_weight_block(const astc_codec_image * input_image,
- // dimensions of error weight block.
- int xdim, int ydim, int zdim, const error_weighting_params * ewp, const imageblock * blk, error_weight_block * ewb, error_weight_block_orig * ewbo);
-
-
-// functions pertaining to weight alignment
-void prepare_angular_tables(void);
-
-void compute_angular_endpoints_1plane(float mode_cutoff,
- const block_size_descriptor * bsd,
- const float *decimated_quantized_weights, const float *decimated_weights, float low_value[MAX_WEIGHT_MODES], float high_value[MAX_WEIGHT_MODES]);
-
-void compute_angular_endpoints_2planes(float mode_cutoff,
- const block_size_descriptor * bsd,
- const float *decimated_quantized_weights,
- const float *decimated_weights,
- float low_value1[MAX_WEIGHT_MODES], float high_value1[MAX_WEIGHT_MODES], float low_value2[MAX_WEIGHT_MODES], float high_value2[MAX_WEIGHT_MODES]);
-
-
-
-
-/* *********************************** high-level encode and decode functions ************************************ */
-
-float compress_symbolic_block(const astc_codec_image * input_image,
- astc_decode_mode decode_mode, int xdim, int ydim, int zdim, const error_weighting_params * ewp, const imageblock * blk, symbolic_compressed_block * scb,
- compress_symbolic_block_buffers * tmpbuf);
-
-
-float4 lerp_color_flt(const float4 color0, const float4 color1, float weight, // 0..1
- float plane2_weight, // 0..1
- int plane2_color_component // 0..3; -1 if only one plane of weights is present.
- );
-
-
-ushort4 lerp_color_int(astc_decode_mode decode_mode, ushort4 color0, ushort4 color1, int weight, // 0..64
- int plane2_weight, // 0..64
- int plane2_color_component // 0..3; -1 if only one plane of weights is present.
- );
-
-
-void decompress_symbolic_block(astc_decode_mode decode_mode,
- // dimensions of block
- int xdim, int ydim, int zdim,
- // position of block
- int xpos, int ypos, int zpos, const symbolic_compressed_block * scb, imageblock * blk);
-
-
-physical_compressed_block symbolic_to_physical(int xdim, int ydim, int zdim, const symbolic_compressed_block * sc);
-
-void physical_to_symbolic(int xdim, int ydim, int zdim, physical_compressed_block pb, symbolic_compressed_block * res);
-
-
-uint16_t unorm16_to_sf16(uint16_t p);
-uint16_t lns_to_sf16(uint16_t p);
-
-
-#endif
diff --git a/3rdparty/bimg/3rdparty/astc/astc_color_quantize.cpp b/3rdparty/bimg/3rdparty/astc/astc_color_quantize.cpp
deleted file mode 100644
index caa2ba8033f..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_color_quantize.cpp
+++ /dev/null
@@ -1,2096 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Color quantization functions for ASTC.
- */
-/*----------------------------------------------------------------------------*/
-
-#include <stdio.h>
-
-#include "astc_codec_internals.h"
-#include "softfloat.h"
-#include <math.h>
-
-#ifdef DEBUG_PRINT_DIAGNOSTICS
- #include <stdio.h>
-#endif
-
-/*
- quantize an LDR RGB color. Since this is a fall-back encoding, we cannot actually
- fail but must just go on until we can produce a sensible result.
-
- Due to how this encoding works, color0 cannot be larger than color1; as such,
- if color0 is actually larger than color1, then color0 is reduced and color1 is
- increased until color0 is no longer larger than color1.
-*/
-static inline int cqt_lookup(int quantization_level, int value)
-{
- if (value < 0)
- value = 0;
- else if (value > 255)
- value = 255;
- return color_quantization_tables[quantization_level][value];
-}
-
-// clamp an input value to [0,255]; NaN is turned into 0
-static inline float clamp255(float val)
-{
- if (val > 255.0f)
- val = 255.0f;
- else if (val > 0.0f)
- {
- // deliberately empty
- // switching the order of calculation here will fail to handle 0.
- }
- else
- val = 0.0f;
-
- return val;
-}
-
-
-
-// clamp an input value to [0,1]; Nan is turned into 0.
-
-static inline float clamp01(float val)
-{
- if (val > 1.0f)
- val = 1.0f;
- else if (val > 0.0f)
- {
- // deliberately empty
- // switching the order of calculation here will fail to handle 0.
- }
- else
- val = 0.0f;
-
- return val;
-}
-
-
-
-void quantize_rgb(float4 color0, // LDR: 0=lowest, 255=highest
- float4 color1, int output[6], int quantization_level)
-{
- color0.xyz = color0.xyz * (1.0f / 257.0f);
- color1.xyz = color1.xyz * (1.0f / 257.0f);
-
-
- float r0 = clamp255(color0.x);
- float g0 = clamp255(color0.y);
- float b0 = clamp255(color0.z);
-
- float r1 = clamp255(color1.x);
- float g1 = clamp255(color1.y);
- float b1 = clamp255(color1.z);
-
- int ri0, gi0, bi0, ri1, gi1, bi1;
- int ri0b, gi0b, bi0b, ri1b, gi1b, bi1b;
- float rgb0_addon = 0.5f;
- float rgb1_addon = 0.5f;
- int iters = 0;
- do
- {
- ri0 = cqt_lookup(quantization_level, (int)floor(r0 + rgb0_addon));
- gi0 = cqt_lookup(quantization_level, (int)floor(g0 + rgb0_addon));
- bi0 = cqt_lookup(quantization_level, (int)floor(b0 + rgb0_addon));
- ri1 = cqt_lookup(quantization_level, (int)floor(r1 + rgb1_addon));
- gi1 = cqt_lookup(quantization_level, (int)floor(g1 + rgb1_addon));
- bi1 = cqt_lookup(quantization_level, (int)floor(b1 + rgb1_addon));
-
- ri0b = color_unquantization_tables[quantization_level][ri0];
- gi0b = color_unquantization_tables[quantization_level][gi0];
- bi0b = color_unquantization_tables[quantization_level][bi0];
- ri1b = color_unquantization_tables[quantization_level][ri1];
- gi1b = color_unquantization_tables[quantization_level][gi1];
- bi1b = color_unquantization_tables[quantization_level][bi1];
-
- rgb0_addon -= 0.2f;
- rgb1_addon += 0.2f;
- iters++;
- }
- while (ri0b + gi0b + bi0b > ri1b + gi1b + bi1b);
-
- output[0] = ri0;
- output[1] = ri1;
- output[2] = gi0;
- output[3] = gi1;
- output[4] = bi0;
- output[5] = bi1;
-}
-
-
-/*
- quantize an RGBA color. */
-void quantize_rgba(float4 color0, float4 color1, int output[8], int quantization_level)
-{
- color0.w = color0.w * (1.0f / 257.0f);
- color1.w = color1.w * (1.0f / 257.0f);
-
- float a0 = clamp255(color0.w);
- float a1 = clamp255(color1.w);
- int ai0 = color_quantization_tables[quantization_level][(int)floor(a0 + 0.5f)];
- int ai1 = color_quantization_tables[quantization_level][(int)floor(a1 + 0.5f)];
-
- output[6] = ai0;
- output[7] = ai1;
-
- quantize_rgb(color0, color1, output, quantization_level);
-}
-
-
-
-/*
- attempt to quantize RGB endpoint values with blue-contraction. Returns 1 on failure, 0 on success. */
-int try_quantize_rgb_blue_contract(float4 color0, // assumed to be the smaller color
- float4 color1, // assumed to be the larger color
- int output[6], int quantization_level)
-{
- color0.xyz = color0.xyz * (1.0f / 257.0f);
- color1.xyz = color1.xyz * (1.0f / 257.0f);
-
- float r0 = color0.x;
- float g0 = color0.y;
- float b0 = color0.z;
-
- float r1 = color1.x;
- float g1 = color1.y;
- float b1 = color1.z;
-
- // inverse blue-contraction. This can produce an overflow;
- // just bail out immediately if this is the case.
- r0 += (r0 - b0);
- g0 += (g0 - b0);
- r1 += (r1 - b1);
- g1 += (g1 - b1);
-
- if (r0 < 0.0f || r0 > 255.0f || g0 < 0.0f || g0 > 255.0f || b0 < 0.0f || b0 > 255.0f ||
- r1 < 0.0f || r1 > 255.0f || g1 < 0.0f || g1 > 255.0f || b1 < 0.0f || b1 > 255.0f)
- {
- return 0;
- }
-
- // quantize the inverse-blue-contracted color
- int ri0 = color_quantization_tables[quantization_level][(int)floor(r0 + 0.5f)];
- int gi0 = color_quantization_tables[quantization_level][(int)floor(g0 + 0.5f)];
- int bi0 = color_quantization_tables[quantization_level][(int)floor(b0 + 0.5f)];
- int ri1 = color_quantization_tables[quantization_level][(int)floor(r1 + 0.5f)];
- int gi1 = color_quantization_tables[quantization_level][(int)floor(g1 + 0.5f)];
- int bi1 = color_quantization_tables[quantization_level][(int)floor(b1 + 0.5f)];
-
- // then unquantize again
- int ru0 = color_unquantization_tables[quantization_level][ri0];
- int gu0 = color_unquantization_tables[quantization_level][gi0];
- int bu0 = color_unquantization_tables[quantization_level][bi0];
- int ru1 = color_unquantization_tables[quantization_level][ri1];
- int gu1 = color_unquantization_tables[quantization_level][gi1];
- int bu1 = color_unquantization_tables[quantization_level][bi1];
-
- // if color #1 is not larger than color #0, then blue-contraction is not a valid approach.
- // note that blue-contraction and quantization may itself change this order, which is why
- // we must only test AFTER blue-contraction.
- if (ru1 + gu1 + bu1 <= ru0 + gu0 + bu0)
- return 0;
-
- output[0] = ri1;
- output[1] = ri0;
- output[2] = gi1;
- output[3] = gi0;
- output[4] = bi1;
- output[5] = bi0;
-
- return 1;
-}
-
-
-
-
-/*
- quantize an RGBA color with blue-contraction */
-int try_quantize_rgba_blue_contract(float4 color0, float4 color1, int output[8], int quantization_level)
-{
- color0.w = color0.w * (1.0f / 257.0f);
- color1.w = color1.w * (1.0f / 257.0f);
-
- float a0 = clamp255(color0.w);
- float a1 = clamp255(color1.w);
-
- output[7] = color_quantization_tables[quantization_level][(int)floor(a0 + 0.5f)];
- output[6] = color_quantization_tables[quantization_level][(int)floor(a1 + 0.5f)];
-
- return try_quantize_rgb_blue_contract(color0, color1, output, quantization_level);
-}
-
-
-// delta-encoding:
-// at decode time, we move one bit from the offset to the base and seize another bit as a sign bit;
-// we then unquantize both values as if they contain one extra bit.
-
-// if the sum of the offsets is nonnegative, then we encode a regular delta.
-
-
-/*
- attempt to quantize an RGB endpoint value with delta-encoding. */
-
-int try_quantize_rgb_delta(float4 color0, float4 color1, int output[6], int quantization_level)
-{
- color0.xyz = color0.xyz * (1.0f / 257.0f);
- color1.xyz = color1.xyz * (1.0f / 257.0f);
-
- float r0 = clamp255(color0.x);
- float g0 = clamp255(color0.y);
- float b0 = clamp255(color0.z);
-
- float r1 = clamp255(color1.x);
- float g1 = clamp255(color1.y);
- float b1 = clamp255(color1.z);
-
- // transform r0 to unorm9
- int r0a = (int)floor(r0 + 0.5f);
- int g0a = (int)floor(g0 + 0.5f);
- int b0a = (int)floor(b0 + 0.5f);
- r0a <<= 1;
- g0a <<= 1;
- b0a <<= 1;
-
- // mask off the top bit
- int r0b = r0a & 0xFF;
- int g0b = g0a & 0xFF;
- int b0b = b0a & 0xFF;
-
- // quantize, then unquantize in order to get a value that we take
- // differences against.
- int r0be = color_quantization_tables[quantization_level][r0b];
- int g0be = color_quantization_tables[quantization_level][g0b];
- int b0be = color_quantization_tables[quantization_level][b0b];
-
- r0b = color_unquantization_tables[quantization_level][r0be];
- g0b = color_unquantization_tables[quantization_level][g0be];
- b0b = color_unquantization_tables[quantization_level][b0be];
- r0b |= r0a & 0x100; // final unquantized-values for endpoint 0.
- g0b |= g0a & 0x100;
- b0b |= b0a & 0x100;
-
- // then, get hold of the second value
- int r1d = (int)floor(r1 + 0.5f);
- int g1d = (int)floor(g1 + 0.5f);
- int b1d = (int)floor(b1 + 0.5f);
-
- r1d <<= 1;
- g1d <<= 1;
- b1d <<= 1;
- // and take differences!
- r1d -= r0b;
- g1d -= g0b;
- b1d -= b0b;
-
- // check if the difference is too large to be encodable.
- if (r1d > 63 || g1d > 63 || b1d > 63 || r1d < -64 || g1d < -64 || b1d < -64)
- return 0;
-
- // insert top bit of the base into the offset
- r1d &= 0x7F;
- g1d &= 0x7F;
- b1d &= 0x7F;
-
- r1d |= (r0b & 0x100) >> 1;
- g1d |= (g0b & 0x100) >> 1;
- b1d |= (b0b & 0x100) >> 1;
-
- // then quantize & unquantize; if this causes any of the top two bits to flip,
- // then encoding fails, since we have then corrupted either the top bit of the base
- // or the sign bit of the offset.
- int r1de = color_quantization_tables[quantization_level][r1d];
- int g1de = color_quantization_tables[quantization_level][g1d];
- int b1de = color_quantization_tables[quantization_level][b1d];
-
- int r1du = color_unquantization_tables[quantization_level][r1de];
- int g1du = color_unquantization_tables[quantization_level][g1de];
- int b1du = color_unquantization_tables[quantization_level][b1de];
-
- if (((r1d ^ r1du) | (g1d ^ g1du) | (b1d ^ b1du)) & 0xC0)
- return 0;
-
- // check that the sum of the encoded offsets is nonnegative, else encoding fails
- r1du &= 0x7f;
- g1du &= 0x7f;
- b1du &= 0x7f;
- if (r1du & 0x40)
- r1du -= 0x80;
- if (g1du & 0x40)
- g1du -= 0x80;
- if (b1du & 0x40)
- b1du -= 0x80;
- if (r1du + g1du + b1du < 0)
- return 0;
-
- // check that the offsets produce legitimate sums as well.
- r1du += r0b;
- g1du += g0b;
- b1du += b0b;
- if (r1du < 0 || r1du > 0x1FF || g1du < 0 || g1du > 0x1FF || b1du < 0 || b1du > 0x1FF)
- return 0;
-
- // OK, we've come this far; we can now encode legitimate values.
- output[0] = r0be;
- output[1] = r1de;
- output[2] = g0be;
- output[3] = g1de;
- output[4] = b0be;
- output[5] = b1de;
-
- return 1;
-}
-
-
-int try_quantize_rgb_delta_blue_contract(float4 color0, float4 color1, int output[6], int quantization_level)
-{
- color0.xyz = color0.xyz * (1.0f / 257.0f);
- color1.xyz = color1.xyz * (1.0f / 257.0f);
-
- // switch around endpoint colors already at start.
- float r0 = color1.x;
- float g0 = color1.y;
- float b0 = color1.z;
-
- float r1 = color0.x;
- float g1 = color0.y;
- float b1 = color0.z;
-
- // inverse blue-contraction. This step can perform an overflow, in which case
- // we will bail out immediately.
- r0 += (r0 - b0);
- g0 += (g0 - b0);
- r1 += (r1 - b1);
- g1 += (g1 - b1);
-
- if (r0 < 0.0f || r0 > 255.0f || g0 < 0.0f || g0 > 255.0f || b0 < 0.0f || b0 > 255.0f || r1 < 0.0f || r1 > 255.0f || g1 < 0.0f || g1 > 255.0f || b1 < 0.0f || b1 > 255.0f)
- return 0;
-
- // transform r0 to unorm9
- int r0a = (int)floor(r0 + 0.5f);
- int g0a = (int)floor(g0 + 0.5f);
- int b0a = (int)floor(b0 + 0.5f);
- r0a <<= 1;
- g0a <<= 1;
- b0a <<= 1;
-
- // mask off the top bit
- int r0b = r0a & 0xFF;
- int g0b = g0a & 0xFF;
- int b0b = b0a & 0xFF;
-
- // quantize, then unquantize in order to get a value that we take
- // differences against.
- int r0be = color_quantization_tables[quantization_level][r0b];
- int g0be = color_quantization_tables[quantization_level][g0b];
- int b0be = color_quantization_tables[quantization_level][b0b];
-
- r0b = color_unquantization_tables[quantization_level][r0be];
- g0b = color_unquantization_tables[quantization_level][g0be];
- b0b = color_unquantization_tables[quantization_level][b0be];
- r0b |= r0a & 0x100; // final unquantized-values for endpoint 0.
- g0b |= g0a & 0x100;
- b0b |= b0a & 0x100;
-
- // then, get hold of the second value
- int r1d = (int)floor(r1 + 0.5f);
- int g1d = (int)floor(g1 + 0.5f);
- int b1d = (int)floor(b1 + 0.5f);
-
- r1d <<= 1;
- g1d <<= 1;
- b1d <<= 1;
- // and take differences!
- r1d -= r0b;
- g1d -= g0b;
- b1d -= b0b;
-
- // check if the difference is too large to be encodable.
- if (r1d > 63 || g1d > 63 || b1d > 63 || r1d < -64 || g1d < -64 || b1d < -64)
- return 0;
-
- // insert top bit of the base into the offset
- r1d &= 0x7F;
- g1d &= 0x7F;
- b1d &= 0x7F;
-
- r1d |= (r0b & 0x100) >> 1;
- g1d |= (g0b & 0x100) >> 1;
- b1d |= (b0b & 0x100) >> 1;
-
- // then quantize & unquantize; if this causes any of the top two bits to flip,
- // then encoding fails, since we have then corrupted either the top bit of the base
- // or the sign bit of the offset.
- int r1de = color_quantization_tables[quantization_level][r1d];
- int g1de = color_quantization_tables[quantization_level][g1d];
- int b1de = color_quantization_tables[quantization_level][b1d];
-
- int r1du = color_unquantization_tables[quantization_level][r1de];
- int g1du = color_unquantization_tables[quantization_level][g1de];
- int b1du = color_unquantization_tables[quantization_level][b1de];
-
- if (((r1d ^ r1du) | (g1d ^ g1du) | (b1d ^ b1du)) & 0xC0)
- return 0;
-
- // check that the sum of the encoded offsets is negative, else encoding fails
- // note that this is inverse of the test for non-blue-contracted RGB.
- r1du &= 0x7f;
- g1du &= 0x7f;
- b1du &= 0x7f;
- if (r1du & 0x40)
- r1du -= 0x80;
- if (g1du & 0x40)
- g1du -= 0x80;
- if (b1du & 0x40)
- b1du -= 0x80;
- if (r1du + g1du + b1du >= 0)
- return 0;
-
- // check that the offsets produce legitimate sums as well.
- r1du += r0b;
- g1du += g0b;
- b1du += b0b;
- if (r1du < 0 || r1du > 0x1FF || g1du < 0 || g1du > 0x1FF || b1du < 0 || b1du > 0x1FF)
- return 0;
-
- // OK, we've come this far; we can now encode legitimate values.
- output[0] = r0be;
- output[1] = r1de;
- output[2] = g0be;
- output[3] = g1de;
- output[4] = b0be;
- output[5] = b1de;
-
- return 1;
-}
-
-
-int try_quantize_alpha_delta(float4 color0, float4 color1, int output[8], int quantization_level)
-{
- color0.w = color0.w * (1.0f / 257.0f);
- color1.w = color1.w * (1.0f / 257.0f);
-
- // the calculation for alpha-delta is exactly the same as for RGB-delta; see
- // the RGB-delta function for comments.
- float a0 = clamp255(color0.w);
- float a1 = clamp255(color1.w);
-
- int a0a = (int)floor(a0 + 0.5f);
- a0a <<= 1;
- int a0b = a0a & 0xFF;
- int a0be = color_quantization_tables[quantization_level][a0b];
- a0b = color_unquantization_tables[quantization_level][a0be];
- a0b |= a0a & 0x100;
- int a1d = (int)floor(a1 + 0.5f);
- a1d <<= 1;
- a1d -= a0b;
- if (a1d > 63 || a1d < -64)
- return 0;
- a1d &= 0x7F;
- a1d |= (a0b & 0x100) >> 1;
- int a1de = color_quantization_tables[quantization_level][a1d];
- int a1du = color_unquantization_tables[quantization_level][a1de];
- if ((a1d ^ a1du) & 0xC0)
- return 0;
- a1du &= 0x7F;
- if (a1du & 0x40)
- a1du -= 0x80;
- a1du += a0b;
- if (a1du < 0 || a1du > 0x1FF)
- return 0;
- output[6] = a0be;
- output[7] = a1de;
- return 1;
-}
-
-
-
-int try_quantize_luminance_alpha_delta(float4 color0, float4 color1, int output[8], int quantization_level)
-{
- float l0 = clamp255((color0.x + color0.y + color0.z) * ((1.0f / 3.0f) * (1.0f / 257.0f)));
- float l1 = clamp255((color1.x + color1.y + color1.z) * ((1.0f / 3.0f) * (1.0f / 257.0f)));
- float a0 = clamp255(color0.w * (1.0f / 257.0f));
- float a1 = clamp255(color1.w * (1.0f / 257.0f));
-
- int l0a = (int)floor(l0 + 0.5f);
- int a0a = (int)floor(a0 + 0.5f);
- l0a <<= 1;
- a0a <<= 1;
- int l0b = l0a & 0xFF;
- int a0b = a0a & 0xFF;
- int l0be = color_quantization_tables[quantization_level][l0b];
- int a0be = color_quantization_tables[quantization_level][a0b];
- l0b = color_unquantization_tables[quantization_level][l0be];
- a0b = color_unquantization_tables[quantization_level][a0be];
- l0b |= l0a & 0x100;
- a0b |= a0a & 0x100;
- int l1d = (int)floor(l1 + 0.5f);
- int a1d = (int)floor(a1 + 0.5f);
- l1d <<= 1;
- a1d <<= 1;
- l1d -= l0b;
- a1d -= a0b;
- if (l1d > 63 || l1d < -64)
- return 0;
- if (a1d > 63 || a1d < -64)
- return 0;
- l1d &= 0x7F;
- a1d &= 0x7F;
- l1d |= (l0b & 0x100) >> 1;
- a1d |= (a0b & 0x100) >> 1;
-
- int l1de = color_quantization_tables[quantization_level][l1d];
- int a1de = color_quantization_tables[quantization_level][a1d];
- int l1du = color_unquantization_tables[quantization_level][l1de];
- int a1du = color_unquantization_tables[quantization_level][a1de];
- if ((l1d ^ l1du) & 0xC0)
- return 0;
- if ((a1d ^ a1du) & 0xC0)
- return 0;
- l1du &= 0x7F;
- a1du &= 0x7F;
- if (l1du & 0x40)
- l1du -= 0x80;
- if (a1du & 0x40)
- a1du -= 0x80;
- l1du += l0b;
- a1du += a0b;
- if (l1du < 0 || l1du > 0x1FF)
- return 0;
- if (a1du < 0 || a1du > 0x1FF)
- return 0;
- output[0] = l0be;
- output[1] = l1de;
- output[2] = a0be;
- output[3] = a1de;
-
- return 1;
-}
-
-
-
-
-int try_quantize_rgba_delta(float4 color0, float4 color1, int output[8], int quantization_level)
-{
- int alpha_delta_res = try_quantize_alpha_delta(color0, color1, output, quantization_level);
-
- if (alpha_delta_res == 0)
- return 0;
-
- return try_quantize_rgb_delta(color0, color1, output, quantization_level);
-}
-
-
-int try_quantize_rgba_delta_blue_contract(float4 color0, float4 color1, int output[8], int quantization_level)
-{
- // notice that for the alpha encoding, we are swapping around color0 and color1;
- // this is because blue-contraction involves swapping around the two colors.
- int alpha_delta_res = try_quantize_alpha_delta(color1, color0, output, quantization_level);
-
- if (alpha_delta_res == 0)
- return 0;
-
- return try_quantize_rgb_delta_blue_contract(color0, color1, output, quantization_level);
-}
-
-
-
-void quantize_rgbs_new(float4 rgbs_color, // W component is a desired-scale to apply, in the range 0..1
- int output[4], int quantization_level)
-{
- rgbs_color.xyz = rgbs_color.xyz * (1.0f / 257.0f);
-
- float r = clamp255(rgbs_color.x);
- float g = clamp255(rgbs_color.y);
- float b = clamp255(rgbs_color.z);
-
- int ri = color_quantization_tables[quantization_level][(int)floor(r + 0.5f)];
- int gi = color_quantization_tables[quantization_level][(int)floor(g + 0.5f)];
- int bi = color_quantization_tables[quantization_level][(int)floor(b + 0.5f)];
-
- int ru = color_unquantization_tables[quantization_level][ri];
- int gu = color_unquantization_tables[quantization_level][gi];
- int bu = color_unquantization_tables[quantization_level][bi];
-
- float oldcolorsum = rgbs_color.x + rgbs_color.y + rgbs_color.z;
- float newcolorsum = (float)(ru + gu + bu);
-
- float scale = clamp01(rgbs_color.w * (oldcolorsum + 1e-10f) / (newcolorsum + 1e-10f));
-
- int scale_idx = (int)floor(scale * 256.0f + 0.5f);
-
- if (scale_idx < 0)
- scale_idx = 0;
- else if (scale_idx > 255)
- scale_idx = 255;
-
- output[0] = ri;
- output[1] = gi;
- output[2] = bi;
- output[3] = color_quantization_tables[quantization_level][scale_idx];
-}
-
-
-
-void quantize_rgbs_alpha_new(float4 color0, float4 color1, float4 rgbs_color, int output[6], int quantization_level)
-{
- color0.w = color0.w * (1.0f / 257.0f);
- color1.w = color1.w * (1.0f / 257.0f);
-
- float a0 = clamp255(color0.w);
- float a1 = clamp255(color1.w);
-
- int ai0 = color_quantization_tables[quantization_level][(int)floor(a0 + 0.5f)];
- int ai1 = color_quantization_tables[quantization_level][(int)floor(a1 + 0.5f)];
-
- output[4] = ai0;
- output[5] = ai1;
-
- quantize_rgbs_new(rgbs_color, output, quantization_level);
-}
-
-
-
-void quantize_luminance(float4 color0, float4 color1, int output[2], int quantization_level)
-{
- color0.xyz = color0.xyz * (1.0f / 257.0f);
- color1.xyz = color1.xyz * (1.0f / 257.0f);
-
- float lum0 = clamp255((color0.x + color0.y + color0.z) * (1.0f / 3.0f));
- float lum1 = clamp255((color1.x + color1.y + color1.z) * (1.0f / 3.0f));
-
- if (lum0 > lum1)
- {
- float avg = (lum0 + lum1) * 0.5f;
- lum0 = avg;
- lum1 = avg;
- }
-
- output[0] = color_quantization_tables[quantization_level][(int)floor(lum0 + 0.5f)];
- output[1] = color_quantization_tables[quantization_level][(int)floor(lum1 + 0.5f)];
-}
-
-
-
-
-
-
-void quantize_luminance_alpha(float4 color0, float4 color1, int output[4], int quantization_level)
-{
- color0 = color0 * (1.0f / 257.0f);
- color1 = color1 * (1.0f / 257.0f);
-
- float lum0 = clamp255((color0.x + color0.y + color0.z) * (1.0f / 3.0f));
- float lum1 = clamp255((color1.x + color1.y + color1.z) * (1.0f / 3.0f));
- float a0 = clamp255(color0.w);
- float a1 = clamp255(color1.w);
-
- // if the endpoints are *really* close, then pull them apart slightly;
- // this affords for >8 bits precision for normal maps.
- if (quantization_level > 18 && fabs(lum0 - lum1) < 3.0f)
- {
- if (lum0 < lum1)
- {
- lum0 -= 0.5f;
- lum1 += 0.5f;
- }
- else
- {
- lum0 += 0.5f;
- lum1 -= 0.5f;
- }
- lum0 = clamp255(lum0);
- lum1 = clamp255(lum1);
- }
- if (quantization_level > 18 && fabs(a0 - a1) < 3.0f)
- {
- if (a0 < a1)
- {
- a0 -= 0.5f;
- a1 += 0.5f;
- }
- else
- {
- a0 += 0.5f;
- a1 -= 0.5f;
- }
- a0 = clamp255(a0);
- a1 = clamp255(a1);
- }
-
-
- output[0] = color_quantization_tables[quantization_level][(int)floor(lum0 + 0.5f)];
- output[1] = color_quantization_tables[quantization_level][(int)floor(lum1 + 0.5f)];
- output[2] = color_quantization_tables[quantization_level][(int)floor(a0 + 0.5f)];
- output[3] = color_quantization_tables[quantization_level][(int)floor(a1 + 0.5f)];
-}
-
-
-void quantize0(float4 color0, float4 color1, int output[8], int quantization_level)
-{
- IGNORE(color0);
- IGNORE(color1);
- IGNORE(output);
- IGNORE(quantization_level);
-
- int i;
- for (i = 0; i < 8; i++)
- output[i] = 0;
-}
-
-
-// quantize and unquantize a number, wile making sure to retain the top two bits.
-static inline void quantize_and_unquantize_retain_top_two_bits(int quantization_level, int value_to_quantize, // 0 to 255.
- int *quantized_value, int *unquantized_value)
-{
-
- int perform_loop;
- int quantval;
- int uquantval;
-
- do
- {
- quantval = color_quantization_tables[quantization_level][value_to_quantize];
- uquantval = color_unquantization_tables[quantization_level][quantval];
-
- // perform looping if the top two bits were modified by quant/unquant
- perform_loop = (value_to_quantize & 0xC0) != (uquantval & 0xC0);
-
- if ((uquantval & 0xC0) > (value_to_quantize & 0xC0))
- {
- // quant/unquant rounded UP so that the top two bits changed;
- // decrement the input value in hopes that this will avoid rounding up.
- value_to_quantize--;
- }
- else if ((uquantval & 0xC0) < (value_to_quantize & 0xC0))
- {
- // quant/unquant rounded DOWN so that the top two bits changed;
- // decrement the input value in hopes that this will avoid rounding down.
- value_to_quantize--;
- }
- }
- while (perform_loop);
-
- *quantized_value = quantval;
- *unquantized_value = uquantval;
-}
-
-
-// quantize and unquantize a number, wile making sure to retain the top four bits.
-static inline void quantize_and_unquantize_retain_top_four_bits(int quantization_level, int value_to_quantize, // 0 to 255.
- int *quantized_value, int *unquantized_value)
-{
-
- int perform_loop;
- int quantval;
- int uquantval;
-
- do
- {
- quantval = color_quantization_tables[quantization_level][value_to_quantize];
- uquantval = color_unquantization_tables[quantization_level][quantval];
-
- // perform looping if the top two bits were modified by quant/unquant
- perform_loop = (value_to_quantize & 0xF0) != (uquantval & 0xF0);
-
- if ((uquantval & 0xF0) > (value_to_quantize & 0xF0))
- {
- // quant/unquant rounded UP so that the top two bits changed;
- // decrement the input value in hopes that this will avoid rounding up.
- value_to_quantize--;
- }
- else if ((uquantval & 0xF0) < (value_to_quantize & 0xF0))
- {
- // quant/unquant rounded DOWN so that the top two bits changed;
- // decrement the input value in hopes that this will avoid rounding down.
- value_to_quantize--;
- }
- }
- while (perform_loop);
-
- *quantized_value = quantval;
- *unquantized_value = uquantval;
-}
-
-// quantize and unquantize a number, wile making sure to retain the top two bits.
-static inline void quantize_and_unquantize_retain_top_bit(int quantization_level, int value_to_quantize, // 0 to 255.
- int *quantized_value, int *unquantized_value)
-{
-
- int perform_loop;
- int quantval;
- int uquantval;
-
- do
- {
- quantval = color_quantization_tables[quantization_level][value_to_quantize];
- uquantval = color_unquantization_tables[quantization_level][quantval];
-
- // perform looping if the top two bits were modified by quant/unquant
- perform_loop = (value_to_quantize & 0x80) != (uquantval & 0x80);
-
- if ((uquantval & 0x80) > (value_to_quantize & 0x80))
- {
- // quant/unquant rounded UP so that the top two bits changed;
- // decrement the input value in hopes that this will avoid rounding up.
- value_to_quantize--;
- }
- else if ((uquantval & 0x80) < (value_to_quantize & 0x80))
- {
- // quant/unquant rounded DOWN so that the top two bits changed;
- // decrement the input value in hopes that this will avoid rounding down.
- value_to_quantize--;
- }
- }
- while (perform_loop);
-
- *quantized_value = quantval;
- *unquantized_value = uquantval;
-}
-
-
-
-
-
-/*
- HDR color encoding, take #3 */
-
-
-void quantize_hdr_rgbo3(float4 color, int output[4], int quantization_level)
-{
- color.xyz = color.xyz + color.www;
-
- if (!(color.x > 0.0f))
- color.x = 0.0f;
- else if (color.x > 65535.0f)
- color.x = 65535.0f;
-
- if (!(color.y > 0.0f))
- color.y = 0.0f;
- else if (color.y > 65535.0f)
- color.y = 65535.0f;
-
- if (!(color.z > 0.0f))
- color.z = 0.0f;
- else if (color.z > 65535.0f)
- color.z = 65535.0f;
-
- if (!(color.w > 0.0f))
- color.w = 0.0f;
- else if (color.w > 65535.0f)
- color.w = 65535.0f;
-
- float4 color_bak = color;
- int majcomp;
- if (color.x > color.y && color.x > color.z)
- majcomp = 0; // red is largest component
- else if (color.y > color.z)
- majcomp = 1; // green is largest component
- else
- majcomp = 2; // blue is largest component
-
- // swap around the red component and the largest component.
- switch (majcomp)
- {
- case 1:
- color = color.yxzw;
- break;
- case 2:
- color = color.zyxw;
- break;
- default:
- break;
- }
-
- static const int mode_bits[5][3] = {
- {11, 5, 7},
- {11, 6, 5},
- {10, 5, 8},
- {9, 6, 7},
- {8, 7, 6}
- };
-
-
- static const float mode_cutoffs[5][2] = {
- {1024, 4096},
- {2048, 1024},
- {2048, 16384},
- {8192, 16384},
- {32768, 16384}
- };
-
- static const float mode_rscales[5] = {
- 32.0f,
- 32.0f,
- 64.0f,
- 128.0f,
- 256.0f,
- };
-
- static const float mode_scales[5] = {
- 1.0f / 32.0f,
- 1.0f / 32.0f,
- 1.0f / 64.0f,
- 1.0f / 128.0f,
- 1.0f / 256.0f,
- };
-
- float r_base = color.x;
- float g_base = color.x - color.y;
- float b_base = color.x - color.z;
- float s_base = color.w;
-
- int mode;
- for (mode = 0; mode < 5; mode++)
- {
- if (g_base > mode_cutoffs[mode][0] || b_base > mode_cutoffs[mode][0] || s_base > mode_cutoffs[mode][1])
- {
- continue;
- }
-
- // encode the mode into a 4-bit vector.
- int mode_enc = mode < 4 ? (mode | (majcomp << 2)) : (majcomp | 0xC);
-
- float mode_scale = mode_scales[mode];
- float mode_rscale = mode_rscales[mode];
-
- int gb_intcutoff = 1 << mode_bits[mode][1];
- int s_intcutoff = 1 << mode_bits[mode][2];
-
- // first, quantize and unquantize R.
- int r_intval = (int)floor(r_base * mode_scale + 0.5f);
-
- int r_lowbits = r_intval & 0x3f;
-
- r_lowbits |= (mode_enc & 3) << 6;
-
- int r_quantval;
- int r_uquantval;
- quantize_and_unquantize_retain_top_two_bits(quantization_level, r_lowbits, &r_quantval, &r_uquantval);
-
- r_intval = (r_intval & ~0x3f) | (r_uquantval & 0x3f);
- float r_fval = r_intval * mode_rscale;
-
-
- // next, recompute G and B, then quantize and unquantize them.
- float g_fval = r_fval - color.y;
- float b_fval = r_fval - color.z;
- if (g_fval < 0.0f)
- g_fval = 0.0f;
- else if (g_fval > 65535.0f)
- g_fval = 65535.0f;
- if (b_fval < 0.0f)
- b_fval = 0.0f;
- else if (b_fval > 65535.0f)
- b_fval = 65535.0f;
-
- int g_intval = (int)floor(g_fval * mode_scale + 0.5f);
- int b_intval = (int)floor(b_fval * mode_scale + 0.5f);
-
-
- if (g_intval >= gb_intcutoff || b_intval >= gb_intcutoff)
- {
- continue;
- }
-
- int g_lowbits = g_intval & 0x1f;
- int b_lowbits = b_intval & 0x1f;
-
- int bit0 = 0;
- int bit1 = 0;
- int bit2 = 0;
- int bit3 = 0;
-
- switch (mode)
- {
- case 0:
- case 2:
- bit0 = (r_intval >> 9) & 1;
- break;
- case 1:
- case 3:
- bit0 = (r_intval >> 8) & 1;
- break;
- case 4:
- case 5:
- bit0 = (g_intval >> 6) & 1;
- break;
- }
-
- switch (mode)
- {
- case 0:
- case 1:
- case 2:
- case 3:
- bit2 = (r_intval >> 7) & 1;
- break;
- case 4:
- case 5:
- bit2 = (b_intval >> 6) & 1;
- break;
- }
-
- switch (mode)
- {
- case 0:
- case 2:
- bit1 = (r_intval >> 8) & 1;
- break;
- case 1:
- case 3:
- case 4:
- case 5:
- bit1 = (g_intval >> 5) & 1;
- break;
- }
-
- switch (mode)
- {
- case 0:
- bit3 = (r_intval >> 10) & 1;
- break;
- case 2:
- bit3 = (r_intval >> 6) & 1;
- break;
- case 1:
- case 3:
- case 4:
- case 5:
- bit3 = (b_intval >> 5) & 1;
- break;
- }
-
- g_lowbits |= (mode_enc & 0x4) << 5;
- b_lowbits |= (mode_enc & 0x8) << 4;
-
- g_lowbits |= bit0 << 6;
- g_lowbits |= bit1 << 5;
- b_lowbits |= bit2 << 6;
- b_lowbits |= bit3 << 5;
-
- int g_quantval;
- int b_quantval;
- int g_uquantval;
- int b_uquantval;
-
- quantize_and_unquantize_retain_top_four_bits(quantization_level, g_lowbits, &g_quantval, &g_uquantval);
-
- quantize_and_unquantize_retain_top_four_bits(quantization_level, b_lowbits, &b_quantval, &b_uquantval);
-
- g_intval = (g_intval & ~0x1f) | (g_uquantval & 0x1f);
- b_intval = (b_intval & ~0x1f) | (b_uquantval & 0x1f);
-
- g_fval = g_intval * mode_rscale;
- b_fval = b_intval * mode_rscale;
-
-
- // finally, recompute the scale value, based on the errors
- // introduced to red, green and blue.
-
- // If the error is positive, then the R,G,B errors combined have raised the color
- // value overall; as such, the scale value needs to be increased.
- float rgb_errorsum = (r_fval - color.x) + (r_fval - g_fval - color.y) + (r_fval - b_fval - color.z);
-
- float s_fval = s_base + rgb_errorsum * (1.0f / 3.0f);
- if (s_fval < 0.0f)
- s_fval = 0.0f;
- else if (s_fval > 1e9)
- s_fval = 1e9;
-
- int s_intval = (int)floor(s_fval * mode_scale + 0.5f);
-
- if (s_intval >= s_intcutoff)
- {
- continue;
- }
-
- int s_lowbits = s_intval & 0x1f;
-
- int bit4;
- int bit5;
- int bit6;
- switch (mode)
- {
- case 1:
- bit6 = (r_intval >> 9) & 1;
- break;
- default:
- bit6 = (s_intval >> 5) & 1;
- break;
- }
-
- switch (mode)
- {
- case 4:
- bit5 = (r_intval >> 7) & 1;
- break;
- case 1:
- bit5 = (r_intval >> 10) & 1;
- break;
- default:
- bit5 = (s_intval >> 6) & 1;
- break;
- }
-
- switch (mode)
- {
- case 2:
- bit4 = (s_intval >> 7) & 1;
- break;
- default:
- bit4 = (r_intval >> 6) & 1;
- break;
- }
-
-
- s_lowbits |= bit6 << 5;
- s_lowbits |= bit5 << 6;
- s_lowbits |= bit4 << 7;
-
- int s_quantval;
- int s_uquantval;
-
- quantize_and_unquantize_retain_top_four_bits(quantization_level, s_lowbits, &s_quantval, &s_uquantval);
-
- s_intval = (s_intval & ~0x1f) | (s_uquantval & 0x1f);
- s_fval = s_intval * mode_rscale;
- output[0] = r_quantval;
- output[1] = g_quantval;
- output[2] = b_quantval;
- output[3] = s_quantval;
-
- return;
- }
-
- // failed to encode any of the modes above? In that case,
- // encode using mode #5.
- int i;
-
- float vals[4];
- int ivals[4];
- vals[0] = color_bak.x;
- vals[1] = color_bak.y;
- vals[2] = color_bak.z;
- vals[3] = color_bak.w;
-
- float cvals[3];
-
- for (i = 0; i < 3; i++)
- {
- if (vals[i] < 0.0f)
- vals[i] = 0.0f;
- else if (vals[i] > 65020.0f)
- vals[i] = 65020.0f;
-
- ivals[i] = (int)floor(vals[i] * (1.0f / 512.0f) + 0.5f);
- cvals[i] = ivals[i] * 512.0f;
- }
-
- float rgb_errorsum = (cvals[0] - vals[0]) + (cvals[1] - vals[1]) + (cvals[2] - vals[2]);
- vals[3] += rgb_errorsum * (1.0f / 3.0f);
-
- if (vals[3] < 0.0f)
- vals[3] = 0.0f;
- else if (vals[3] > 65020.0f)
- vals[3] = 65020.0f;
-
- ivals[3] = (int)floor(vals[3] * (1.0f / 512.0f) + 0.5f);
-
- int encvals[4];
-
- encvals[0] = (ivals[0] & 0x3f) | 0xC0;
- encvals[1] = (ivals[1] & 0x7f) | 0x80;
- encvals[2] = (ivals[2] & 0x7f) | 0x80;
- encvals[3] = (ivals[3] & 0x7f) | ((ivals[0] & 0x40) << 1);
-
- for (i = 0; i < 4; i++)
- {
- int dummy;
- quantize_and_unquantize_retain_top_four_bits(quantization_level, encvals[i], &(output[i]), &dummy);
- }
-
- return;
-}
-
-
-
-
-
-
-
-void quantize_hdr_rgb3(float4 color0, float4 color1, int output[6], int quantization_level)
-{
- if (!(color0.x > 0.0f))
- color0.x = 0.0f;
- else if (color0.x > 65535.0f)
- color0.x = 65535.0f;
-
- if (!(color0.y > 0.0f))
- color0.y = 0.0f;
- else if (color0.y > 65535.0f)
- color0.y = 65535.0f;
-
- if (!(color0.z > 0.0f))
- color0.z = 0.0f;
- else if (color0.z > 65535.0f)
- color0.z = 65535.0f;
-
- if (!(color1.x > 0.0f))
- color1.x = 0.0f;
- else if (color1.x > 65535.0f)
- color1.x = 65535.0f;
-
- if (!(color1.y > 0.0f))
- color1.y = 0.0f;
- else if (color1.y > 65535.0f)
- color1.y = 65535.0f;
-
- if (!(color1.z > 0.0f))
- color1.z = 0.0f;
- else if (color1.z > 65535.0f)
- color1.z = 65535.0f;
-
- float4 color0_bak = color0;
- float4 color1_bak = color1;
-
- int majcomp;
- if (color1.x > color1.y && color1.x > color1.z)
- majcomp = 0; // red is largest
- else if (color1.y > color1.z)
- majcomp = 1; // green is largest
- else
- majcomp = 2; // blue is largest
-
- // swizzle the components
- switch (majcomp)
- {
- case 1: // red-green swap
- color0 = color0.yxzw;
- color1 = color1.yxzw;
- break;
- case 2: // red-blue swap
- color0 = color0.zyxw;
- color1 = color1.zyxw;
- break;
- default:
- break;
- }
-
- float a_base = color1.x;
- if (a_base < 0.0f)
- a_base = 0.0f;
- else if (a_base > 65535.0f)
- a_base = 65535.0f;
-
-
- float b0_base = a_base - color1.y;
- float b1_base = a_base - color1.z;
- float c_base = a_base - color0.x;
- float d0_base = a_base - b0_base - c_base - color0.y;
- float d1_base = a_base - b1_base - c_base - color0.z;
-
-
-
- // number of bits in the various fields in the various modes
- static const int mode_bits[8][4] = {
- {9, 7, 6, 7},
- {9, 8, 6, 6},
- {10, 6, 7, 7},
- {10, 7, 7, 6},
- {11, 8, 6, 5},
- {11, 6, 8, 6},
- {12, 7, 7, 5},
- {12, 6, 7, 6}
- };
-
- // cutoffs to use for the computed values of a,b,c,d, assuming the
- // range 0..65535 are LNS values corresponding to fp16.
- static const float mode_cutoffs[8][4] = {
- {16384, 8192, 8192, 8}, // mode 0: 9,7,6,7
- {32768, 8192, 4096, 8}, // mode 1: 9,8,6,6
- {4096, 8192, 4096, 4}, // mode 2: 10,6,7,7
- {8192, 8192, 2048, 4}, // mode 3: 10,7,7,6
- {8192, 2048, 512, 2}, // mode 4: 11,8,6,5
- {2048, 8192, 1024, 2}, // mode 5: 11,6,8,6
- {2048, 2048, 256, 1}, // mode 6: 12,7,7,5
- {1024, 2048, 512, 1}, // mode 7: 12,6,7,6
- };
-
- static const float mode_scales[8] = {
- 1.0f / 128.0f,
- 1.0f / 128.0f,
- 1.0f / 64.0f,
- 1.0f / 64.0f,
- 1.0f / 32.0f,
- 1.0f / 32.0f,
- 1.0f / 16.0f,
- 1.0f / 16.0f,
- };
-
- // scaling factors when going from what was encoded in the mode to 16 bits.
- static const float mode_rscales[8] = {
- 128.0f,
- 128.0f,
- 64.0f,
- 64.0f,
- 32.0f,
- 32.0f,
- 16.0f,
- 16.0f
- };
-
-
- // try modes one by one, with the highest-precision mode first.
- int mode;
- for (mode = 7; mode >= 0; mode--)
- {
- // for each mode, test if we can in fact accommodate
- // the computed b,c,d values. If we clearly can't, then we skip to the next mode.
-
- float b_cutoff = mode_cutoffs[mode][0];
- float c_cutoff = mode_cutoffs[mode][1];
- float d_cutoff = mode_cutoffs[mode][2];
-
- if (b0_base > b_cutoff || b1_base > b_cutoff || c_base > c_cutoff || fabs(d0_base) > d_cutoff || fabs(d1_base) > d_cutoff)
- {
- continue;
- }
-
- float mode_scale = mode_scales[mode];
- float mode_rscale = mode_rscales[mode];
-
- int b_intcutoff = 1 << mode_bits[mode][1];
- int c_intcutoff = 1 << mode_bits[mode][2];
- int d_intcutoff = 1 << (mode_bits[mode][3] - 1);
-
- // first, quantize and unquantize A, with the assumption that its high bits can be handled safely.
- int a_intval = (int)floor(a_base * mode_scale + 0.5f);
- int a_lowbits = a_intval & 0xFF;
-
- int a_quantval = color_quantization_tables[quantization_level][a_lowbits];
- int a_uquantval = color_unquantization_tables[quantization_level][a_quantval];
- a_intval = (a_intval & ~0xFF) | a_uquantval;
- float a_fval = a_intval * mode_rscale;
-
- // next, recompute C, then quantize and unquantize it
- float c_fval = a_fval - color0.x;
- if (c_fval < 0.0f)
- c_fval = 0.0f;
- else if (c_fval > 65535.0f)
- c_fval = 65535.0f;
-
- int c_intval = (int)floor(c_fval * mode_scale + 0.5f);
-
- if (c_intval >= c_intcutoff)
- {
- continue;
- }
-
- int c_lowbits = c_intval & 0x3f;
-
- c_lowbits |= (mode & 1) << 7;
- c_lowbits |= (a_intval & 0x100) >> 2;
-
- int c_quantval;
- int c_uquantval;
- quantize_and_unquantize_retain_top_two_bits(quantization_level, c_lowbits, &c_quantval, &c_uquantval);
- c_intval = (c_intval & ~0x3F) | (c_uquantval & 0x3F);
- c_fval = c_intval * mode_rscale;
-
-
- // next, recompute B0 and B1, then quantize and unquantize them
- float b0_fval = a_fval - color1.y;
- float b1_fval = a_fval - color1.z;
- if (b0_fval < 0.0f)
- b0_fval = 0.0f;
- else if (b0_fval > 65535.0f)
- b0_fval = 65535.0f;
- if (b1_fval < 0.0f)
- b1_fval = 0.0f;
- else if (b1_fval > 65535.0f)
- b1_fval = 65535.0f;
-
- int b0_intval = (int)floor(b0_fval * mode_scale + 0.5f);
- int b1_intval = (int)floor(b1_fval * mode_scale + 0.5f);
-
- if (b0_intval >= b_intcutoff || b1_intval >= b_intcutoff)
- {
- continue;
- }
-
-
-
- int b0_lowbits = b0_intval & 0x3f;
- int b1_lowbits = b1_intval & 0x3f;
-
- int bit0 = 0;
- int bit1 = 0;
- switch (mode)
- {
- case 0:
- case 1:
- case 3:
- case 4:
- case 6:
- bit0 = (b0_intval >> 6) & 1;
- break;
- case 2:
- case 5:
- case 7:
- bit0 = (a_intval >> 9) & 1;
- break;
- }
-
- switch (mode)
- {
- case 0:
- case 1:
- case 3:
- case 4:
- case 6:
- bit1 = (b1_intval >> 6) & 1;
- break;
- case 2:
- bit1 = (c_intval >> 6) & 1;
- break;
- case 5:
- case 7:
- bit1 = (a_intval >> 10) & 1;
- break;
- }
-
- b0_lowbits |= bit0 << 6;
- b1_lowbits |= bit1 << 6;
-
- b0_lowbits |= ((mode >> 1) & 1) << 7;
- b1_lowbits |= ((mode >> 2) & 1) << 7;
-
- int b0_quantval;
- int b1_quantval;
- int b0_uquantval;
- int b1_uquantval;
-
- quantize_and_unquantize_retain_top_two_bits(quantization_level, b0_lowbits, &b0_quantval, &b0_uquantval);
-
- quantize_and_unquantize_retain_top_two_bits(quantization_level, b1_lowbits, &b1_quantval, &b1_uquantval);
-
- b0_intval = (b0_intval & ~0x3f) | (b0_uquantval & 0x3f);
- b1_intval = (b1_intval & ~0x3f) | (b1_uquantval & 0x3f);
- b0_fval = b0_intval * mode_rscale;
- b1_fval = b1_intval * mode_rscale;
-
-
- // finally, recompute D0 and D1, then quantize and unquantize them
- float d0_fval = a_fval - b0_fval - c_fval - color0.y;
- float d1_fval = a_fval - b1_fval - c_fval - color0.z;
-
- if (d0_fval < -65535.0f)
- d0_fval = -65535.0f;
- else if (d0_fval > 65535.0f)
- d0_fval = 65535.0f;
-
- if (d1_fval < -65535.0f)
- d1_fval = -65535.0f;
- else if (d1_fval > 65535.0f)
- d1_fval = 65535.0f;
-
- int d0_intval = (int)floor(d0_fval * mode_scale + 0.5f);
- int d1_intval = (int)floor(d1_fval * mode_scale + 0.5f);
-
- if (abs(d0_intval) >= d_intcutoff || abs(d1_intval) >= d_intcutoff)
- continue;
-
- // d0_intval += mode_dbiases[mode];
- // d1_intval += mode_dbiases[mode];
-
- int d0_lowbits = d0_intval & 0x1f;
- int d1_lowbits = d1_intval & 0x1f;
-
- int bit2 = 0;
- int bit3 = 0;
- int bit4;
- int bit5;
- switch (mode)
- {
- case 0:
- case 2:
- bit2 = (d0_intval >> 6) & 1;
- break;
- case 1:
- case 4:
- bit2 = (b0_intval >> 7) & 1;
- break;
- case 3:
- bit2 = (a_intval >> 9) & 1;
- break;
- case 5:
- bit2 = (c_intval >> 7) & 1;
- break;
- case 6:
- case 7:
- bit2 = (a_intval >> 11) & 1;
- break;
- }
- switch (mode)
- {
- case 0:
- case 2:
- bit3 = (d1_intval >> 6) & 1;
- break;
- case 1:
- case 4:
- bit3 = (b1_intval >> 7) & 1;
- break;
- case 3:
- case 5:
- case 6:
- case 7:
- bit3 = (c_intval >> 6) & 1;
- break;
- }
-
- switch (mode)
- {
- case 4:
- case 6:
- bit4 = (a_intval >> 9) & 1;
- bit5 = (a_intval >> 10) & 1;
- break;
- default:
- bit4 = (d0_intval >> 5) & 1;
- bit5 = (d1_intval >> 5) & 1;
- break;
- }
-
- d0_lowbits |= bit2 << 6;
- d1_lowbits |= bit3 << 6;
- d0_lowbits |= bit4 << 5;
- d1_lowbits |= bit5 << 5;
-
- d0_lowbits |= (majcomp & 1) << 7;
- d1_lowbits |= ((majcomp >> 1) & 1) << 7;
-
- int d0_quantval;
- int d1_quantval;
- int d0_uquantval;
- int d1_uquantval;
-
- quantize_and_unquantize_retain_top_four_bits(quantization_level, d0_lowbits, &d0_quantval, &d0_uquantval);
-
- quantize_and_unquantize_retain_top_four_bits(quantization_level, d1_lowbits, &d1_quantval, &d1_uquantval);
-
- output[0] = a_quantval;
- output[1] = c_quantval;
- output[2] = b0_quantval;
- output[3] = b1_quantval;
- output[4] = d0_quantval;
- output[5] = d1_quantval;
- return;
- }
-
- // neither of the modes fit? In this case, we will use a flat representation
- // for storing data, using 8 bits for red and green, and 7 bits for blue.
- // This gives color accuracy roughly similar to LDR 4:4:3 which is not at all great
- // but usable. This representation is used if the light color is more than 4x the
- // color value of the dark color.
- int i;
- float vals[6];
- vals[0] = color0_bak.x;
- vals[1] = color1_bak.x;
- vals[2] = color0_bak.y;
- vals[3] = color1_bak.y;
- vals[4] = color0_bak.z;
- vals[5] = color1_bak.z;
-
-
- for (i = 0; i < 6; i++)
- {
- if (vals[i] < 0.0f)
- vals[i] = 0.0f;
- else if (vals[i] > 65020.0f)
- vals[i] = 65020.0f;
- }
- for (i = 0; i < 4; i++)
- {
- int idx = (int)floor(vals[i] * 1.0f / 256.0f + 0.5f);
- output[i] = color_quantization_tables[quantization_level][idx];
- }
- for (i = 4; i < 6; i++)
- {
- int dummy;
- int idx = (int)floor(vals[i] * 1.0f / 512.0f + 0.5f) + 128;
- quantize_and_unquantize_retain_top_two_bits(quantization_level, idx, &(output[i]), &dummy);
- }
-
- return;
-}
-
-
-
-
-
-void quantize_hdr_rgb_ldr_alpha3(float4 color0, float4 color1, int output[8], int quantization_level)
-{
- color0.w *= (1.0f / 257.0f);
- color1.w *= (1.0f / 257.0f);
-
- quantize_hdr_rgb3(color0, color1, output, quantization_level);
-
- float a0 = clamp255(color0.w);
- float a1 = clamp255(color1.w);
- int ai0 = color_quantization_tables[quantization_level][(int)floor(a0 + 0.5f)];
- int ai1 = color_quantization_tables[quantization_level][(int)floor(a1 + 0.5f)];
-
- output[6] = ai0;
- output[7] = ai1;
-}
-
-
-
-void quantize_hdr_luminance_large_range3(float4 color0, float4 color1, int output[2], int quantization_level)
-{
-
- float lum1 = (color1.x + color1.y + color1.z) * (1.0f / 3.0f);
- float lum0 = (color0.x + color0.y + color0.z) * (1.0f / 3.0f);
-
- if (lum1 < lum0)
- {
- float avg = (lum0 + lum1) * 0.5f;
- lum0 = avg;
- lum1 = avg;
- }
-
- int ilum1 = static_cast < int >(floor(lum1 + 0.5f));
- int ilum0 = static_cast < int >(floor(lum0 + 0.5f));
-
- // find the closest encodable point in the upper half of the code-point space
- int upper_v0 = (ilum0 + 128) >> 8;
- int upper_v1 = (ilum1 + 128) >> 8;
-
- if (upper_v0 < 0)
- upper_v0 = 0;
- else if (upper_v0 > 255)
- upper_v0 = 255;
-
- if (upper_v1 < 0)
- upper_v1 = 0;
- else if (upper_v1 > 255)
- upper_v1 = 255;
-
- // find the closest encodable point in the lower half of the code-point space
- int lower_v0 = (ilum1 + 256) >> 8;
- int lower_v1 = ilum0 >> 8;
-
- if (lower_v0 < 0)
- lower_v0 = 0;
- else if (lower_v0 > 255)
- lower_v0 = 255;
-
- if (lower_v1 < 0)
- lower_v1 = 0;
- else if (lower_v1 > 255)
- lower_v1 = 255;
-
- // determine the distance between the point in code-point space and the input value
- int upper0_dec = upper_v0 << 8;
- int upper1_dec = upper_v1 << 8;
- int lower0_dec = (lower_v1 << 8) + 128;
- int lower1_dec = (lower_v0 << 8) - 128;
-
-
- int upper0_diff = upper0_dec - ilum0;
- int upper1_diff = upper1_dec - ilum1;
- int lower0_diff = lower0_dec - ilum0;
- int lower1_diff = lower1_dec - ilum1;
-
- int upper_error = (upper0_diff * upper0_diff) + (upper1_diff * upper1_diff);
- int lower_error = (lower0_diff * lower0_diff) + (lower1_diff * lower1_diff);
-
- int v0, v1;
- if (upper_error < lower_error)
- {
- v0 = upper_v0;
- v1 = upper_v1;
- }
- else
- {
- v0 = lower_v0;
- v1 = lower_v1;
- }
-
- // OK; encode.
- output[0] = color_quantization_tables[quantization_level][v0];
- output[1] = color_quantization_tables[quantization_level][v1];
-}
-
-
-
-int try_quantize_hdr_luminance_small_range3(float4 color0, float4 color1, int output[2], int quantization_level)
-{
- float lum1 = (color1.x + color1.y + color1.z) * (1.0f / 3.0f);
- float lum0 = (color0.x + color0.y + color0.z) * (1.0f / 3.0f);
-
- if (lum1 < lum0)
- {
- float avg = (lum0 + lum1) * 0.5f;
- lum0 = avg;
- lum1 = avg;
- }
-
- int ilum1 = static_cast < int >(floor(lum1 + 0.5f));
- int ilum0 = static_cast < int >(floor(lum0 + 0.5f));
-
- // difference of more than a factor-of-2 results in immediate failure.
- if (ilum1 - ilum0 > 2048)
- return 0;
-
- int lowval, highval, diffval;
- int v0, v1;
- int v0e, v1e;
- int v0d, v1d;
-
- // first, try to encode the high-precision submode
- lowval = (ilum0 + 16) >> 5;
- highval = (ilum1 + 16) >> 5;
-
- if (lowval < 0)
- lowval = 0;
- else if (lowval > 2047)
- lowval = 2047;
-
- if (highval < 0)
- highval = 0;
- else if (highval > 2047)
- highval = 2047;
-
- v0 = lowval & 0x7F;
- v0e = color_quantization_tables[quantization_level][v0];
- v0d = color_unquantization_tables[quantization_level][v0e];
- if ((v0d & 0x80) == 0x80)
- goto LOW_PRECISION_SUBMODE;
-
- lowval = (lowval & ~0x7F) | (v0d & 0x7F);
- diffval = highval - lowval;
- if (diffval < 0 || diffval > 15)
- goto LOW_PRECISION_SUBMODE;
-
- v1 = ((lowval >> 3) & 0xF0) | diffval;
- v1e = color_quantization_tables[quantization_level][v1];
- v1d = color_unquantization_tables[quantization_level][v1e];
- if ((v1d & 0xF0) != (v1 & 0xF0))
- goto LOW_PRECISION_SUBMODE;
-
- output[0] = v0e;
- output[1] = v1e;
- return 1;
-
-
- // failed to encode the high-precision submode; well, then try to encode the
- // low-precision submode.
- LOW_PRECISION_SUBMODE:
-
- lowval = (ilum0 + 32) >> 6;
- highval = (ilum1 + 32) >> 6;
- if (lowval < 0)
- lowval = 0;
- else if (lowval > 1023)
- lowval = 1023;
- if (highval < 0)
- highval = 0;
- else if (highval > 1023)
- highval = 1023;
-
- v0 = (lowval & 0x7F) | 0x80;
- v0e = color_quantization_tables[quantization_level][v0];
- v0d = color_unquantization_tables[quantization_level][v0e];
- if ((v0d & 0x80) == 0)
- return 0;
-
- lowval = (lowval & ~0x7F) | (v0d & 0x7F);
- diffval = highval - lowval;
- if (diffval < 0 || diffval > 31)
- return 0;
-
- v1 = ((lowval >> 2) & 0xE0) | diffval;
- v1e = color_quantization_tables[quantization_level][v1];
- v1d = color_unquantization_tables[quantization_level][v1e];
- if ((v1d & 0xE0) != (v1 & 0xE0))
- return 0;;
-
- output[0] = v0e;
- output[1] = v1e;
- return 1;
-}
-
-
-void quantize_hdr_alpha3(float alpha0, float alpha1, int output[2], int quantization_level)
-{
- int i;
-
- if (alpha0 < 0)
- alpha0 = 0;
- else if (alpha0 > 65280)
- alpha0 = 65280;
-
- if (alpha1 < 0)
- alpha1 = 0;
- else if (alpha1 > 65280)
- alpha1 = 65280;
-
- int ialpha0 = static_cast < int >(floor(alpha0 + 0.5f));
- int ialpha1 = static_cast < int >(floor(alpha1 + 0.5f));
-
- int val0, val1, diffval;
- int v6, v7;
- int v6e, v7e;
- int v6d, v7d;
-
- // try to encode one of the delta submodes, in decreasing-precision order.
- for (i = 2; i >= 0; i--)
- {
- val0 = (ialpha0 + (128 >> i)) >> (8 - i);
- val1 = (ialpha1 + (128 >> i)) >> (8 - i);
-
- v6 = (val0 & 0x7F) | ((i & 1) << 7);
- v6e = color_quantization_tables[quantization_level][v6];
- v6d = color_unquantization_tables[quantization_level][v6e];
-
- if ((v6 ^ v6d) & 0x80)
- continue;
-
- val0 = (val0 & ~0x7f) | (v6d & 0x7f);
- diffval = val1 - val0;
- int cutoff = 32 >> i;
- int mask = 2 * cutoff - 1;
-
- if (diffval < -cutoff || diffval >= cutoff)
- continue;
-
- v7 = ((i & 2) << 6) | ((val0 >> 7) << (6 - i)) | (diffval & mask);
- v7e = color_quantization_tables[quantization_level][v7];
- v7d = color_unquantization_tables[quantization_level][v7e];
-
- static const int testbits[3] = { 0xE0, 0xF0, 0xF8 };
-
- if ((v7 ^ v7d) & testbits[i])
- continue;
-
- output[0] = v6e;
- output[1] = v7e;
- return;
- }
-
- // could not encode any of the delta modes; instead encode a flat value
- val0 = (ialpha0 + 256) >> 9;
- val1 = (ialpha1 + 256) >> 9;
- v6 = val0 | 0x80;
- v7 = val1 | 0x80;
-
- v6e = color_quantization_tables[quantization_level][v6];
- v7e = color_quantization_tables[quantization_level][v7];
- output[0] = v6e;
- output[1] = v7e;
-
- return;
-}
-
-
-
-void quantize_hdr_rgb_alpha3(float4 color0, float4 color1, int output[8], int quantization_level)
-{
- quantize_hdr_rgb3(color0, color1, output, quantization_level);
- quantize_hdr_alpha3(color0.w, color1.w, output + 6, quantization_level);
-}
-
-
-
-/*
- Quantize a color. When quantizing an RGB or RGBA color, the quantizer may choose a
- delta-based representation; as such, it will report back the format it actually used.
-*/
-int pack_color_endpoints(astc_decode_mode decode_mode, float4 color0, float4 color1, float4 rgbs_color, float4 rgbo_color, float2 luminances, // ! Unused
- int format, int *output, int quantization_level)
-{
-
- IGNORE(luminances);
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("%s : format=%d quantization_level=%d\n", __func__, format, quantization_level);
- printf("Color 0: <%g %g %g %g>\n", color0.x, color0.y, color0.z, color0.w);
- printf("Color 1: <%g %g %g %g>\n", color1.x, color1.y, color1.z, color1.w);
-
- }
- #endif
-
- // we do not support negative colors.
- color0.x = MAX(color0.x, 0.0f);
- color0.y = MAX(color0.y, 0.0f);
- color0.z = MAX(color0.z, 0.0f);
- color0.w = MAX(color0.w, 0.0f);
- color1.x = MAX(color1.x, 0.0f);
- color1.y = MAX(color1.y, 0.0f);
- color1.z = MAX(color1.z, 0.0f);
- color1.w = MAX(color1.w, 0.0f);
-
-
- int retval;
-
- switch (format)
- {
- case FMT_RGB:
- if (quantization_level <= 18)
- {
- if (try_quantize_rgb_delta_blue_contract(color0, color1, output, quantization_level))
- {
- retval = FMT_RGB_DELTA;
- break;
- }
- if (try_quantize_rgb_delta(color0, color1, output, quantization_level))
- {
- retval = FMT_RGB_DELTA;
- break;
- }
- }
- if (try_quantize_rgb_blue_contract(color0, color1, output, quantization_level))
- {
- retval = FMT_RGB;
- break;
- }
- quantize_rgb(color0, color1, output, quantization_level);
- retval = FMT_RGB;
- break;
-
- case FMT_RGBA:
- if (quantization_level <= 18)
- {
- if (try_quantize_rgba_delta_blue_contract(color0, color1, output, quantization_level))
- {
- retval = FMT_RGBA_DELTA;
- break;
- }
- if (try_quantize_rgba_delta(color0, color1, output, quantization_level))
- {
- retval = FMT_RGBA_DELTA;
- break;
- }
- }
- if (try_quantize_rgba_blue_contract(color0, color1, output, quantization_level))
- {
- retval = FMT_RGBA;
- break;
- }
- quantize_rgba(color0, color1, output, quantization_level);
- retval = FMT_RGBA;
- break;
-
- case FMT_RGB_SCALE:
- quantize_rgbs_new(rgbs_color, output, quantization_level);
- // quantize_rgbs( color0, color1, output, quantization_level );
- retval = FMT_RGB_SCALE;
- break;
-
- case FMT_HDR_RGB_SCALE:
- quantize_hdr_rgbo3(rgbo_color, output, quantization_level);
-
- // quantize_hdr_rgb_scale( rgbo_color, output, quantization_level );
- retval = FMT_HDR_RGB_SCALE;
- break;
-
- case FMT_HDR_RGB:
- quantize_hdr_rgb3(color0, color1, output, quantization_level);
-
- // quantize_hdr_rgb_rgba( color0, color1, 0, output, quantization_level );
- retval = FMT_HDR_RGB;
- break;
-
- case FMT_RGB_SCALE_ALPHA:
- quantize_rgbs_alpha_new(color0, color1, rgbs_color, output, quantization_level);
- // quantize_rgbs_alpha( color0, color1, output, quantization_level );
- retval = FMT_RGB_SCALE_ALPHA;
- break;
-
- case FMT_HDR_LUMINANCE_SMALL_RANGE:
- case FMT_HDR_LUMINANCE_LARGE_RANGE:
- if (try_quantize_hdr_luminance_small_range3(color0, color1, output, quantization_level))
- {
- retval = FMT_HDR_LUMINANCE_SMALL_RANGE;
- break;
- }
- quantize_hdr_luminance_large_range3(color0, color1, output, quantization_level);
- retval = FMT_HDR_LUMINANCE_LARGE_RANGE;
- break;
-
- case FMT_LUMINANCE:
- quantize_luminance(color0, color1, output, quantization_level);
- retval = FMT_LUMINANCE;
- break;
-
- case FMT_LUMINANCE_ALPHA:
- if (quantization_level <= 18)
- {
- if (try_quantize_luminance_alpha_delta(color0, color1, output, quantization_level))
- {
- retval = FMT_LUMINANCE_ALPHA_DELTA;
- break;
- }
- }
- quantize_luminance_alpha(color0, color1, output, quantization_level);
- retval = FMT_LUMINANCE_ALPHA;
- break;
-
- case FMT_HDR_RGB_LDR_ALPHA:
- quantize_hdr_rgb_ldr_alpha3(color0, color1, output, quantization_level);
- retval = FMT_HDR_RGB_LDR_ALPHA;
- break;
-
- case FMT_HDR_RGBA:
- quantize_hdr_rgb_alpha3(color0, color1, output, quantization_level);
- retval = FMT_HDR_RGBA;
- break;
-
- default:
- ASTC_CODEC_INTERNAL_ERROR;
- quantize0(color0, color1, output, quantization_level);
- retval = FMT_LUMINANCE;
- break;
- }
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- int i;
- printf("Quantized to format %d\n", retval);
- printf("Quantized color:");
-
- for (i = 0; i < 8; i++)
- printf(" %X", output[i]);
-
- ushort4 res0;
- ushort4 res1;
- int rgb_hdr;
- int alpha_hdr;
- int nan_endpoint;
-
- unpack_color_endpoints(decode_mode, retval, quantization_level, output, &rgb_hdr, &alpha_hdr, &nan_endpoint, &res0, &res1);
- printf("rgb-hdr=%d alpha-hdr=%d nan-endpoint=%d\n", rgb_hdr, alpha_hdr, nan_endpoint);
-
- printf("Unquantized color 0: <%u %u %u %u>\n", res0.x, res0.y, res0.z, res0.w);
- printf("Unquantized color 1: <%u %u %u %u>\n", res1.x, res1.y, res1.z, res1.w);
- printf("\n\n");
- }
- #endif
-
- return retval;
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_color_unquantize.cpp b/3rdparty/bimg/3rdparty/astc/astc_color_unquantize.cpp
deleted file mode 100644
index 5090cfdfd75..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_color_unquantize.cpp
+++ /dev/null
@@ -1,970 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Color unquantization functions for ASTC.
- */
-/*----------------------------------------------------------------------------*/
-
-#include "astc_codec_internals.h"
-
-#include "mathlib.h"
-#include "softfloat.h"
-
-int rgb_delta_unpack(const int input[6], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- // unquantize the color endpoints
- int r0 = color_unquantization_tables[quantization_level][input[0]];
- int g0 = color_unquantization_tables[quantization_level][input[2]];
- int b0 = color_unquantization_tables[quantization_level][input[4]];
-
- int r1 = color_unquantization_tables[quantization_level][input[1]];
- int g1 = color_unquantization_tables[quantization_level][input[3]];
- int b1 = color_unquantization_tables[quantization_level][input[5]];
-
- // perform the bit-transfer procedure
- r0 |= (r1 & 0x80) << 1;
- g0 |= (g1 & 0x80) << 1;
- b0 |= (b1 & 0x80) << 1;
- r1 &= 0x7F;
- g1 &= 0x7F;
- b1 &= 0x7F;
- if (r1 & 0x40)
- r1 -= 0x80;
- if (g1 & 0x40)
- g1 -= 0x80;
- if (b1 & 0x40)
- b1 -= 0x80;
-
- r0 >>= 1;
- g0 >>= 1;
- b0 >>= 1;
- r1 >>= 1;
- g1 >>= 1;
- b1 >>= 1;
-
- int rgbsum = r1 + g1 + b1;
-
- r1 += r0;
- g1 += g0;
- b1 += b0;
-
-
- int retval;
-
- int r0e, g0e, b0e;
- int r1e, g1e, b1e;
-
- if (rgbsum >= 0)
- {
- r0e = r0;
- g0e = g0;
- b0e = b0;
-
- r1e = r1;
- g1e = g1;
- b1e = b1;
-
- retval = 0;
- }
- else
- {
- r0e = (r1 + b1) >> 1;
- g0e = (g1 + b1) >> 1;
- b0e = b1;
-
- r1e = (r0 + b0) >> 1;
- g1e = (g0 + b0) >> 1;
- b1e = b0;
-
- retval = 1;
- }
-
- if (r0e < 0)
- r0e = 0;
- else if (r0e > 255)
- r0e = 255;
-
- if (g0e < 0)
- g0e = 0;
- else if (g0e > 255)
- g0e = 255;
-
- if (b0e < 0)
- b0e = 0;
- else if (b0e > 255)
- b0e = 255;
-
- if (r1e < 0)
- r1e = 0;
- else if (r1e > 255)
- r1e = 255;
-
- if (g1e < 0)
- g1e = 0;
- else if (g1e > 255)
- g1e = 255;
-
- if (b1e < 0)
- b1e = 0;
- else if (b1e > 255)
- b1e = 255;
-
- output0->x = r0e;
- output0->y = g0e;
- output0->z = b0e;
- output0->w = 0xFF;
-
- output1->x = r1e;
- output1->y = g1e;
- output1->z = b1e;
- output1->w = 0xFF;
-
- return retval;
-}
-
-
-int rgb_unpack(const int input[6], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
-
- int ri0b = color_unquantization_tables[quantization_level][input[0]];
- int ri1b = color_unquantization_tables[quantization_level][input[1]];
- int gi0b = color_unquantization_tables[quantization_level][input[2]];
- int gi1b = color_unquantization_tables[quantization_level][input[3]];
- int bi0b = color_unquantization_tables[quantization_level][input[4]];
- int bi1b = color_unquantization_tables[quantization_level][input[5]];
-
- if (ri0b + gi0b + bi0b > ri1b + gi1b + bi1b)
- {
- // blue-contraction
- ri0b = (ri0b + bi0b) >> 1;
- gi0b = (gi0b + bi0b) >> 1;
- ri1b = (ri1b + bi1b) >> 1;
- gi1b = (gi1b + bi1b) >> 1;
-
- output0->x = ri1b;
- output0->y = gi1b;
- output0->z = bi1b;
- output0->w = 255;
-
- output1->x = ri0b;
- output1->y = gi0b;
- output1->z = bi0b;
- output1->w = 255;
- return 1;
- }
- else
- {
- output0->x = ri0b;
- output0->y = gi0b;
- output0->z = bi0b;
- output0->w = 255;
-
- output1->x = ri1b;
- output1->y = gi1b;
- output1->z = bi1b;
- output1->w = 255;
- return 0;
- }
-}
-
-
-
-
-void rgba_unpack(const int input[8], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- int order = rgb_unpack(input, quantization_level, output0, output1);
- if (order == 0)
- {
- output0->w = color_unquantization_tables[quantization_level][input[6]];
- output1->w = color_unquantization_tables[quantization_level][input[7]];
- }
- else
- {
- output0->w = color_unquantization_tables[quantization_level][input[7]];
- output1->w = color_unquantization_tables[quantization_level][input[6]];
- }
-}
-
-
-
-void rgba_delta_unpack(const int input[8], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- int a0 = color_unquantization_tables[quantization_level][input[6]];
- int a1 = color_unquantization_tables[quantization_level][input[7]];
- a0 |= (a1 & 0x80) << 1;
- a1 &= 0x7F;
- if (a1 & 0x40)
- a1 -= 0x80;
- a0 >>= 1;
- a1 >>= 1;
- a1 += a0;
-
- if (a1 < 0)
- a1 = 0;
- else if (a1 > 255)
- a1 = 255;
-
- int order = rgb_delta_unpack(input, quantization_level, output0, output1);
- if (order == 0)
- {
- output0->w = a0;
- output1->w = a1;
- }
- else
- {
- output0->w = a1;
- output1->w = a0;
- }
-}
-
-
-void rgb_scale_unpack(const int input[4], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- int ir = color_unquantization_tables[quantization_level][input[0]];
- int ig = color_unquantization_tables[quantization_level][input[1]];
- int ib = color_unquantization_tables[quantization_level][input[2]];
-
- int iscale = color_unquantization_tables[quantization_level][input[3]];
-
- *output1 = ushort4(ir, ig, ib, 255);
- *output0 = ushort4((ir * iscale) >> 8, (ig * iscale) >> 8, (ib * iscale) >> 8, 255);
-}
-
-
-
-void rgb_scale_alpha_unpack(const int input[6], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- rgb_scale_unpack(input, quantization_level, output0, output1);
- output0->w = color_unquantization_tables[quantization_level][input[4]];
- output1->w = color_unquantization_tables[quantization_level][input[5]];
-
-}
-
-
-void luminance_unpack(const int input[2], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- int lum0 = color_unquantization_tables[quantization_level][input[0]];
- int lum1 = color_unquantization_tables[quantization_level][input[1]];
- *output0 = ushort4(lum0, lum0, lum0, 255);
- *output1 = ushort4(lum1, lum1, lum1, 255);
-}
-
-
-void luminance_delta_unpack(const int input[2], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- int v0 = color_unquantization_tables[quantization_level][input[0]];
- int v1 = color_unquantization_tables[quantization_level][input[1]];
- int l0 = (v0 >> 2) | (v1 & 0xC0);
- int l1 = l0 + (v1 & 0x3F);
-
- if (l1 > 255)
- l1 = 255;
-
- *output0 = ushort4(l0, l0, l0, 255);
- *output1 = ushort4(l1, l1, l1, 255);
-}
-
-
-
-
-void luminance_alpha_unpack(const int input[4], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- int lum0 = color_unquantization_tables[quantization_level][input[0]];
- int lum1 = color_unquantization_tables[quantization_level][input[1]];
- int alpha0 = color_unquantization_tables[quantization_level][input[2]];
- int alpha1 = color_unquantization_tables[quantization_level][input[3]];
- *output0 = ushort4(lum0, lum0, lum0, alpha0);
- *output1 = ushort4(lum1, lum1, lum1, alpha1);
-}
-
-
-void luminance_alpha_delta_unpack(const int input[4], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- int lum0 = color_unquantization_tables[quantization_level][input[0]];
- int lum1 = color_unquantization_tables[quantization_level][input[1]];
- int alpha0 = color_unquantization_tables[quantization_level][input[2]];
- int alpha1 = color_unquantization_tables[quantization_level][input[3]];
-
- lum0 |= (lum1 & 0x80) << 1;
- alpha0 |= (alpha1 & 0x80) << 1;
- lum1 &= 0x7F;
- alpha1 &= 0x7F;
- if (lum1 & 0x40)
- lum1 -= 0x80;
- if (alpha1 & 0x40)
- alpha1 -= 0x80;
-
- lum0 >>= 1;
- lum1 >>= 1;
- alpha0 >>= 1;
- alpha1 >>= 1;
- lum1 += lum0;
- alpha1 += alpha0;
-
- if (lum1 < 0)
- lum1 = 0;
- else if (lum1 > 255)
- lum1 = 255;
-
- if (alpha1 < 0)
- alpha1 = 0;
- else if (alpha1 > 255)
- alpha1 = 255;
-
- *output0 = ushort4(lum0, lum0, lum0, alpha0);
- *output1 = ushort4(lum1, lum1, lum1, alpha1);
-}
-
-
-
-
-// RGB-offset format
-void hdr_rgbo_unpack3(const int input[4], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- int v0 = color_unquantization_tables[quantization_level][input[0]];
- int v1 = color_unquantization_tables[quantization_level][input[1]];
- int v2 = color_unquantization_tables[quantization_level][input[2]];
- int v3 = color_unquantization_tables[quantization_level][input[3]];
-
- int modeval = ((v0 & 0xC0) >> 6) | (((v1 & 0x80) >> 7) << 2) | (((v2 & 0x80) >> 7) << 3);
-
- int majcomp;
- int mode;
- if ((modeval & 0xC) != 0xC)
- {
- majcomp = modeval >> 2;
- mode = modeval & 3;
- }
- else if (modeval != 0xF)
- {
- majcomp = modeval & 3;
- mode = 4;
- }
- else
- {
- majcomp = 0;
- mode = 5;
- }
-
- int red = v0 & 0x3F;
- int green = v1 & 0x1F;
- int blue = v2 & 0x1F;
- int scale = v3 & 0x1F;
-
- int bit0 = (v1 >> 6) & 1;
- int bit1 = (v1 >> 5) & 1;
- int bit2 = (v2 >> 6) & 1;
- int bit3 = (v2 >> 5) & 1;
- int bit4 = (v3 >> 7) & 1;
- int bit5 = (v3 >> 6) & 1;
- int bit6 = (v3 >> 5) & 1;
-
- int ohcomp = 1 << mode;
-
- if (ohcomp & 0x30)
- green |= bit0 << 6;
- if (ohcomp & 0x3A)
- green |= bit1 << 5;
- if (ohcomp & 0x30)
- blue |= bit2 << 6;
- if (ohcomp & 0x3A)
- blue |= bit3 << 5;
-
- if (ohcomp & 0x3D)
- scale |= bit6 << 5;
- if (ohcomp & 0x2D)
- scale |= bit5 << 6;
- if (ohcomp & 0x04)
- scale |= bit4 << 7;
-
- if (ohcomp & 0x3B)
- red |= bit4 << 6;
- if (ohcomp & 0x04)
- red |= bit3 << 6;
-
- if (ohcomp & 0x10)
- red |= bit5 << 7;
- if (ohcomp & 0x0F)
- red |= bit2 << 7;
-
- if (ohcomp & 0x05)
- red |= bit1 << 8;
- if (ohcomp & 0x0A)
- red |= bit0 << 8;
-
- if (ohcomp & 0x05)
- red |= bit0 << 9;
- if (ohcomp & 0x02)
- red |= bit6 << 9;
-
- if (ohcomp & 0x01)
- red |= bit3 << 10;
- if (ohcomp & 0x02)
- red |= bit5 << 10;
-
-
- // expand to 12 bits.
- static const int shamts[6] = { 1, 1, 2, 3, 4, 5 };
- int shamt = shamts[mode];
- red <<= shamt;
- green <<= shamt;
- blue <<= shamt;
- scale <<= shamt;
-
- // on modes 0 to 4, the values stored for "green" and "blue" are differentials,
- // not absolute values.
- if (mode != 5)
- {
- green = red - green;
- blue = red - blue;
- }
-
- // switch around components.
- int temp;
- switch (majcomp)
- {
- case 1:
- temp = red;
- red = green;
- green = temp;
- break;
- case 2:
- temp = red;
- red = blue;
- blue = temp;
- break;
- default:
- break;
- }
-
-
- int red0 = red - scale;
- int green0 = green - scale;
- int blue0 = blue - scale;
-
- // clamp to [0,0xFFF].
- if (red < 0)
- red = 0;
- if (green < 0)
- green = 0;
- if (blue < 0)
- blue = 0;
-
- if (red0 < 0)
- red0 = 0;
- if (green0 < 0)
- green0 = 0;
- if (blue0 < 0)
- blue0 = 0;
-
- *output0 = ushort4(red0 << 4, green0 << 4, blue0 << 4, 0x7800);
- *output1 = ushort4(red << 4, green << 4, blue << 4, 0x7800);
-}
-
-
-
-void hdr_rgb_unpack3(const int input[6], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
-
- int v0 = color_unquantization_tables[quantization_level][input[0]];
- int v1 = color_unquantization_tables[quantization_level][input[1]];
- int v2 = color_unquantization_tables[quantization_level][input[2]];
- int v3 = color_unquantization_tables[quantization_level][input[3]];
- int v4 = color_unquantization_tables[quantization_level][input[4]];
- int v5 = color_unquantization_tables[quantization_level][input[5]];
-
- // extract all the fixed-placement bitfields
- int modeval = ((v1 & 0x80) >> 7) | (((v2 & 0x80) >> 7) << 1) | (((v3 & 0x80) >> 7) << 2);
-
- int majcomp = ((v4 & 0x80) >> 7) | (((v5 & 0x80) >> 7) << 1);
-
- if (majcomp == 3)
- {
- *output0 = ushort4(v0 << 8, v2 << 8, (v4 & 0x7F) << 9, 0x7800);
- *output1 = ushort4(v1 << 8, v3 << 8, (v5 & 0x7F) << 9, 0x7800);
- return;
- }
-
- int a = v0 | ((v1 & 0x40) << 2);
- int b0 = v2 & 0x3f;
- int b1 = v3 & 0x3f;
- int c = v1 & 0x3f;
- int d0 = v4 & 0x7f;
- int d1 = v5 & 0x7f;
-
- // get hold of the number of bits in 'd0' and 'd1'
- static const int dbits_tab[8] = { 7, 6, 7, 6, 5, 6, 5, 6 };
- int dbits = dbits_tab[modeval];
-
- // extract six variable-placement bits
- int bit0 = (v2 >> 6) & 1;
- int bit1 = (v3 >> 6) & 1;
-
- int bit2 = (v4 >> 6) & 1;
- int bit3 = (v5 >> 6) & 1;
- int bit4 = (v4 >> 5) & 1;
- int bit5 = (v5 >> 5) & 1;
-
-
- // and prepend the variable-placement bits depending on mode.
- int ohmod = 1 << modeval; // one-hot-mode
- if (ohmod & 0xA4)
- a |= bit0 << 9;
- if (ohmod & 0x8)
- a |= bit2 << 9;
- if (ohmod & 0x50)
- a |= bit4 << 9;
-
- if (ohmod & 0x50)
- a |= bit5 << 10;
- if (ohmod & 0xA0)
- a |= bit1 << 10;
-
- if (ohmod & 0xC0)
- a |= bit2 << 11;
-
- if (ohmod & 0x4)
- c |= bit1 << 6;
- if (ohmod & 0xE8)
- c |= bit3 << 6;
-
- if (ohmod & 0x20)
- c |= bit2 << 7;
-
-
- if (ohmod & 0x5B)
- b0 |= bit0 << 6;
- if (ohmod & 0x5B)
- b1 |= bit1 << 6;
-
- if (ohmod & 0x12)
- b0 |= bit2 << 7;
- if (ohmod & 0x12)
- b1 |= bit3 << 7;
-
- if (ohmod & 0xAF)
- d0 |= bit4 << 5;
- if (ohmod & 0xAF)
- d1 |= bit5 << 5;
- if (ohmod & 0x5)
- d0 |= bit2 << 6;
- if (ohmod & 0x5)
- d1 |= bit3 << 6;
-
- // sign-extend 'd0' and 'd1'
- // note: this code assumes that signed right-shift actually sign-fills, not zero-fills.
- int32_t d0x = d0;
- int32_t d1x = d1;
- int sx_shamt = 32 - dbits;
- d0x <<= sx_shamt;
- d0x >>= sx_shamt;
- d1x <<= sx_shamt;
- d1x >>= sx_shamt;
- d0 = d0x;
- d1 = d1x;
-
- // expand all values to 12 bits, with left-shift as needed.
- int val_shamt = (modeval >> 1) ^ 3;
- a <<= val_shamt;
- b0 <<= val_shamt;
- b1 <<= val_shamt;
- c <<= val_shamt;
- d0 <<= val_shamt;
- d1 <<= val_shamt;
-
- // then compute the actual color values.
- int red1 = a;
- int green1 = a - b0;
- int blue1 = a - b1;
- int red0 = a - c;
- int green0 = a - b0 - c - d0;
- int blue0 = a - b1 - c - d1;
-
- // clamp the color components to [0,2^12 - 1]
- if (red0 < 0)
- red0 = 0;
- else if (red0 > 0xFFF)
- red0 = 0xFFF;
-
- if (green0 < 0)
- green0 = 0;
- else if (green0 > 0xFFF)
- green0 = 0xFFF;
-
- if (blue0 < 0)
- blue0 = 0;
- else if (blue0 > 0xFFF)
- blue0 = 0xFFF;
-
- if (red1 < 0)
- red1 = 0;
- else if (red1 > 0xFFF)
- red1 = 0xFFF;
-
- if (green1 < 0)
- green1 = 0;
- else if (green1 > 0xFFF)
- green1 = 0xFFF;
-
- if (blue1 < 0)
- blue1 = 0;
- else if (blue1 > 0xFFF)
- blue1 = 0xFFF;
-
-
- // switch around the color components
- int temp0, temp1;
- switch (majcomp)
- {
- case 1: // switch around red and green
- temp0 = red0;
- temp1 = red1;
- red0 = green0;
- red1 = green1;
- green0 = temp0;
- green1 = temp1;
- break;
- case 2: // switch around red and blue
- temp0 = red0;
- temp1 = red1;
- red0 = blue0;
- red1 = blue1;
- blue0 = temp0;
- blue1 = temp1;
- break;
- case 0: // no switch
- break;
- }
-
- *output0 = ushort4(red0 << 4, green0 << 4, blue0 << 4, 0x7800);
- *output1 = ushort4(red1 << 4, green1 << 4, blue1 << 4, 0x7800);
-}
-
-
-
-
-void hdr_rgb_ldr_alpha_unpack3(const int input[8], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- hdr_rgb_unpack3(input, quantization_level, output0, output1);
-
- int v6 = color_unquantization_tables[quantization_level][input[6]];
- int v7 = color_unquantization_tables[quantization_level][input[7]];
- output0->w = v6;
- output1->w = v7;
-}
-
-
-
-void hdr_luminance_small_range_unpack(const int input[2], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- int v0 = color_unquantization_tables[quantization_level][input[0]];
- int v1 = color_unquantization_tables[quantization_level][input[1]];
-
- int y0, y1;
- if (v0 & 0x80)
- {
- y0 = ((v1 & 0xE0) << 4) | ((v0 & 0x7F) << 2);
- y1 = (v1 & 0x1F) << 2;
- }
- else
- {
- y0 = ((v1 & 0xF0) << 4) | ((v0 & 0x7F) << 1);
- y1 = (v1 & 0xF) << 1;
- }
-
- y1 += y0;
- if (y1 > 0xFFF)
- y1 = 0xFFF;
-
- *output0 = ushort4(y0 << 4, y0 << 4, y0 << 4, 0x7800);
- *output1 = ushort4(y1 << 4, y1 << 4, y1 << 4, 0x7800);
-}
-
-
-void hdr_luminance_large_range_unpack(const int input[2], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- int v0 = color_unquantization_tables[quantization_level][input[0]];
- int v1 = color_unquantization_tables[quantization_level][input[1]];
-
- int y0, y1;
- if (v1 >= v0)
- {
- y0 = v0 << 4;
- y1 = v1 << 4;
- }
- else
- {
- y0 = (v1 << 4) + 8;
- y1 = (v0 << 4) - 8;
- }
- *output0 = ushort4(y0 << 4, y0 << 4, y0 << 4, 0x7800);
- *output1 = ushort4(y1 << 4, y1 << 4, y1 << 4, 0x7800);
-}
-
-
-
-void hdr_alpha_unpack(const int input[2], int quantization_level, int *a0, int *a1)
-{
-
- int v6 = color_unquantization_tables[quantization_level][input[0]];
- int v7 = color_unquantization_tables[quantization_level][input[1]];
-
- int selector = ((v6 >> 7) & 1) | ((v7 >> 6) & 2);
- v6 &= 0x7F;
- v7 &= 0x7F;
- if (selector == 3)
- {
- *a0 = v6 << 5;
- *a1 = v7 << 5;
- }
- else
- {
- v6 |= (v7 << (selector + 1)) & 0x780;
- v7 &= (0x3f >> selector);
- v7 ^= 32 >> selector;
- v7 -= 32 >> selector;
- v6 <<= (4 - selector);
- v7 <<= (4 - selector);
- v7 += v6;
-
- if (v7 < 0)
- v7 = 0;
- else if (v7 > 0xFFF)
- v7 = 0xFFF;
-
- *a0 = v6;
- *a1 = v7;
- }
-
- *a0 <<= 4;
- *a1 <<= 4;
-}
-
-
-
-void hdr_rgb_hdr_alpha_unpack3(const int input[8], int quantization_level, ushort4 * output0, ushort4 * output1)
-{
- hdr_rgb_unpack3(input, quantization_level, output0, output1);
-
- int alpha0, alpha1;
- hdr_alpha_unpack(input + 6, quantization_level, &alpha0, &alpha1);
-
- output0->w = alpha0;
- output1->w = alpha1;
-}
-
-
-
-
-
-
-void unpack_color_endpoints(astc_decode_mode decode_mode, int format, int quantization_level, const int *input, int *rgb_hdr, int *alpha_hdr, int *nan_endpoint, ushort4 * output0, ushort4 * output1)
-{
- *nan_endpoint = 0;
-
- switch (format)
- {
- case FMT_LUMINANCE:
- *rgb_hdr = 0;
- *alpha_hdr = 0;
- luminance_unpack(input, quantization_level, output0, output1);
- break;
-
- case FMT_LUMINANCE_DELTA:
- *rgb_hdr = 0;
- *alpha_hdr = 0;
- luminance_delta_unpack(input, quantization_level, output0, output1);
- break;
-
- case FMT_HDR_LUMINANCE_SMALL_RANGE:
- *rgb_hdr = 1;
- *alpha_hdr = -1;
- hdr_luminance_small_range_unpack(input, quantization_level, output0, output1);
- break;
-
- case FMT_HDR_LUMINANCE_LARGE_RANGE:
- *rgb_hdr = 1;
- *alpha_hdr = -1;
- hdr_luminance_large_range_unpack(input, quantization_level, output0, output1);
- break;
-
- case FMT_LUMINANCE_ALPHA:
- *rgb_hdr = 0;
- *alpha_hdr = 0;
- luminance_alpha_unpack(input, quantization_level, output0, output1);
- break;
-
- case FMT_LUMINANCE_ALPHA_DELTA:
- *rgb_hdr = 0;
- *alpha_hdr = 0;
- luminance_alpha_delta_unpack(input, quantization_level, output0, output1);
- break;
-
- case FMT_RGB_SCALE:
- *rgb_hdr = 0;
- *alpha_hdr = 0;
- rgb_scale_unpack(input, quantization_level, output0, output1);
- break;
-
- case FMT_RGB_SCALE_ALPHA:
- *rgb_hdr = 0;
- *alpha_hdr = 0;
- rgb_scale_alpha_unpack(input, quantization_level, output0, output1);
- break;
-
- case FMT_HDR_RGB_SCALE:
- *rgb_hdr = 1;
- *alpha_hdr = -1;
- hdr_rgbo_unpack3(input, quantization_level, output0, output1);
- break;
-
- case FMT_RGB:
- *rgb_hdr = 0;
- *alpha_hdr = 0;
- rgb_unpack(input, quantization_level, output0, output1);
- break;
-
- case FMT_RGB_DELTA:
- *rgb_hdr = 0;
- *alpha_hdr = 0;
- rgb_delta_unpack(input, quantization_level, output0, output1);
- break;
-
- case FMT_HDR_RGB:
- *rgb_hdr = 1;
- *alpha_hdr = -1;
- hdr_rgb_unpack3(input, quantization_level, output0, output1);
- break;
-
- case FMT_RGBA:
- *rgb_hdr = 0;
- *alpha_hdr = 0;
- rgba_unpack(input, quantization_level, output0, output1);
- break;
-
- case FMT_RGBA_DELTA:
- *rgb_hdr = 0;
- *alpha_hdr = 0;
- rgba_delta_unpack(input, quantization_level, output0, output1);
- break;
-
- case FMT_HDR_RGB_LDR_ALPHA:
- *rgb_hdr = 1;
- *alpha_hdr = 0;
- hdr_rgb_ldr_alpha_unpack3(input, quantization_level, output0, output1);
- break;
-
- case FMT_HDR_RGBA:
- *rgb_hdr = 1;
- *alpha_hdr = 1;
- hdr_rgb_hdr_alpha_unpack3(input, quantization_level, output0, output1);
- break;
-
- default:
- ASTC_CODEC_INTERNAL_ERROR;
- }
-
-
-
- if (*alpha_hdr == -1)
- {
- if (alpha_force_use_of_hdr)
- {
- output0->w = 0x7800;
- output1->w = 0x7800;
- *alpha_hdr = 1;
- }
- else
- {
- output0->w = 0x00FF;
- output1->w = 0x00FF;
- *alpha_hdr = 0;
- }
- }
-
-
-
- switch (decode_mode)
- {
- case DECODE_LDR_SRGB:
- if (*rgb_hdr == 1)
- {
- output0->x = 0xFF00;
- output0->y = 0x0000;
- output0->z = 0xFF00;
- output0->w = 0xFF00;
- output1->x = 0xFF00;
- output1->y = 0x0000;
- output1->z = 0xFF00;
- output1->w = 0xFF00;
- }
- else
- {
- output0->x *= 257;
- output0->y *= 257;
- output0->z *= 257;
- output0->w *= 257;
- output1->x *= 257;
- output1->y *= 257;
- output1->z *= 257;
- output1->w *= 257;
- }
- *rgb_hdr = 0;
- *alpha_hdr = 0;
- break;
-
- case DECODE_LDR:
- if (*rgb_hdr == 1)
- {
- output0->x = 0xFFFF;
- output0->y = 0xFFFF;
- output0->z = 0xFFFF;
- output0->w = 0xFFFF;
- output1->x = 0xFFFF;
- output1->y = 0xFFFF;
- output1->z = 0xFFFF;
- output1->w = 0xFFFF;
- *nan_endpoint = 1;
- }
- else
- {
- output0->x *= 257;
- output0->y *= 257;
- output0->z *= 257;
- output0->w *= 257;
- output1->x *= 257;
- output1->y *= 257;
- output1->z *= 257;
- output1->w *= 257;
- }
- *rgb_hdr = 0;
- *alpha_hdr = 0;
- break;
-
- case DECODE_HDR:
-
- if (*rgb_hdr == 0)
- {
- output0->x *= 257;
- output0->y *= 257;
- output0->z *= 257;
- output1->x *= 257;
- output1->y *= 257;
- output1->z *= 257;
- }
- if (*alpha_hdr == 0)
- {
- output0->w *= 257;
- output1->w *= 257;
- }
- break;
- }
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_compress_symbolic.cpp b/3rdparty/bimg/3rdparty/astc/astc_compress_symbolic.cpp
deleted file mode 100644
index 152ca05472c..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_compress_symbolic.cpp
+++ /dev/null
@@ -1,1792 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Compress a block of colors, expressed as a symbolic block, for ASTC.
- */
-/*----------------------------------------------------------------------------*/
-
-#include "astc_codec_internals.h"
-
-#include "softfloat.h"
-#include <math.h>
-#include <string.h>
-#include <stdio.h>
-
-#ifdef DEBUG_CAPTURE_NAN
- #ifndef _GNU_SOURCE
- #define _GNU_SOURCE
- #endif
-
- #include <fenv.h>
-#endif
-
-#include <stdio.h>
-
-int realign_weights(astc_decode_mode decode_mode,
- int xdim, int ydim, int zdim, const imageblock * blk, const error_weight_block * ewb, symbolic_compressed_block * scb, uint8_t * weight_set8, uint8_t * plane2_weight_set8)
-{
- int i, j;
-
- // get the appropriate partition descriptor.
- int partition_count = scb->partition_count;
- const partition_info *pt = get_partition_table(xdim, ydim, zdim, partition_count);
- pt += scb->partition_index;
-
- // get the appropriate block descriptor
- const block_size_descriptor *bsd = get_block_size_descriptor(xdim, ydim, zdim);
- const decimation_table *const *ixtab2 = bsd->decimation_tables;
-
- const decimation_table *it = ixtab2[bsd->block_modes[scb->block_mode].decimation_mode];
-
- int is_dual_plane = bsd->block_modes[scb->block_mode].is_dual_plane;
-
- // get quantization-parameters
- int weight_quantization_level = bsd->block_modes[scb->block_mode].quantization_mode;
-
-
- // decode the color endpoints
- ushort4 color_endpoint0[4];
- ushort4 color_endpoint1[4];
- int rgb_hdr[4];
- int alpha_hdr[4];
- int nan_endpoint[4];
-
-
- for (i = 0; i < partition_count; i++)
- unpack_color_endpoints(decode_mode,
- scb->color_formats[i], scb->color_quantization_level, scb->color_values[i], &rgb_hdr[i], &alpha_hdr[i], &nan_endpoint[i], &(color_endpoint0[i]), &(color_endpoint1[i]));
-
-
- float uq_plane1_weights[MAX_WEIGHTS_PER_BLOCK];
- float uq_plane2_weights[MAX_WEIGHTS_PER_BLOCK];
- int weight_count = it->num_weights;
-
- // read and unquantize the weights.
-
- const quantization_and_transfer_table *qat = &(quant_and_xfer_tables[weight_quantization_level]);
-
- for (i = 0; i < weight_count; i++)
- {
- uq_plane1_weights[i] = qat->unquantized_value_flt[weight_set8[i]];
- }
- if (is_dual_plane)
- {
- for (i = 0; i < weight_count; i++)
- uq_plane2_weights[i] = qat->unquantized_value_flt[plane2_weight_set8[i]];
- }
-
-
- int plane2_color_component = is_dual_plane ? scb->plane2_color_component : -1;
-
- // for each weight, unquantize the weight, use it to compute a color and a color error.
- // then, increment the weight until the color error stops decreasing
- // then, decrement the weight until the color error stops increasing
-
- #define COMPUTE_ERROR( errorvar ) \
- errorvar = 0.0f; \
- for(j=0;j<texels_to_evaluate;j++) \
- { \
- int texel = it->weight_texel[i][j]; \
- int partition = pt->partition_of_texel[texel]; \
- float plane1_weight = compute_value_of_texel_flt( texel, it, uq_plane1_weights ); \
- float plane2_weight = 0.0f; \
- if( is_dual_plane ) \
- plane2_weight = compute_value_of_texel_flt( texel, it, uq_plane2_weights ); \
- int int_plane1_weight = static_cast<int>(floor( plane1_weight*64.0f + 0.5f ) ); \
- int int_plane2_weight = static_cast<int>(floor( plane2_weight*64.0f + 0.5f ) ); \
- ushort4 lrp_color = lerp_color_int( \
- decode_mode, \
- color_endpoint0[partition], \
- color_endpoint1[partition], \
- int_plane1_weight, \
- int_plane2_weight, \
- plane2_color_component ); \
- float4 color = float4( lrp_color.x, lrp_color.y, lrp_color.z, lrp_color.w ); \
- float4 origcolor = float4( \
- blk->work_data[4*texel], \
- blk->work_data[4*texel+1], \
- blk->work_data[4*texel+2], \
- blk->work_data[4*texel+3] ); \
- float4 error_weight = ewb->error_weights[texel]; \
- float4 colordiff = color - origcolor; \
- errorvar += dot( colordiff*colordiff, error_weight ); \
- }
-
-
- int adjustments = 0;
-
- for (i = 0; i < weight_count; i++)
- {
- int current_wt = weight_set8[i];
- int texels_to_evaluate = it->weight_num_texels[i];
-
- float current_error;
-
- COMPUTE_ERROR(current_error);
-
- // increment until error starts increasing.
- while (1)
- {
- int next_wt = qat->next_quantized_value[current_wt];
- if (next_wt == current_wt)
- break;
- uq_plane1_weights[i] = qat->unquantized_value_flt[next_wt];
- float next_error;
- COMPUTE_ERROR(next_error);
- if (next_error < current_error)
- {
- // succeeded, increment the weight
- current_wt = next_wt;
- current_error = next_error;
- adjustments++;
- }
- else
- {
- // failed, back out the attempted increment
- uq_plane1_weights[i] = qat->unquantized_value_flt[current_wt];
- break;
- }
- }
- // decrement until error starts increasing
- while (1)
- {
- int prev_wt = qat->prev_quantized_value[current_wt];
- if (prev_wt == current_wt)
- break;
- uq_plane1_weights[i] = qat->unquantized_value_flt[prev_wt];
- float prev_error;
- COMPUTE_ERROR(prev_error);
- if (prev_error < current_error)
- {
- // succeeded, decrement the weight
- current_wt = prev_wt;
- current_error = prev_error;
- adjustments++;
- }
- else
- {
- // failed, back out the attempted decrement
- uq_plane1_weights[i] = qat->unquantized_value_flt[current_wt];
- break;
- }
- }
-
- weight_set8[i] = current_wt;
- }
-
- if (!is_dual_plane)
- return adjustments;
-
- // processing of the second plane of weights
- for (i = 0; i < weight_count; i++)
- {
- int current_wt = plane2_weight_set8[i];
- int texels_to_evaluate = it->weight_num_texels[i];
-
- float current_error;
-
- COMPUTE_ERROR(current_error);
-
- // increment until error starts increasing.
- while (1)
- {
- int next_wt = qat->next_quantized_value[current_wt];
- if (next_wt == current_wt)
- break;
- uq_plane2_weights[i] = qat->unquantized_value_flt[next_wt];
- float next_error;
- COMPUTE_ERROR(next_error);
- if (next_error < current_error)
- {
- // succeeded, increment the weight
- current_wt = next_wt;
- current_error = next_error;
- adjustments++;
- }
- else
- {
- // failed, back out the attempted increment
- uq_plane2_weights[i] = qat->unquantized_value_flt[current_wt];
- break;
- }
- }
- // decrement until error starts increasing
- while (1)
- {
- int prev_wt = qat->prev_quantized_value[current_wt];
- if (prev_wt == current_wt)
- break;
- uq_plane2_weights[i] = qat->unquantized_value_flt[prev_wt];
- float prev_error;
- COMPUTE_ERROR(prev_error);
- if (prev_error < current_error)
- {
- // succeeded, decrement the weight
- current_wt = prev_wt;
- current_error = prev_error;
- adjustments++;
- }
- else
- {
- // failed, back out the attempted decrement
- uq_plane2_weights[i] = qat->unquantized_value_flt[current_wt];
- break;
- }
- }
-
- plane2_weight_set8[i] = current_wt;
- }
-
- return adjustments;
-}
-
-/*
- function for compressing a block symbolically, given that we have already decided on a partition
-*/
-
-
-
-static void compress_symbolic_block_fixed_partition_1_plane(astc_decode_mode decode_mode,
- float mode_cutoff,
- int max_refinement_iters,
- int xdim, int ydim, int zdim,
- int partition_count, int partition_index,
- const imageblock * blk, const error_weight_block * ewb, symbolic_compressed_block * scb,
- compress_fixed_partition_buffers * tmpbuf)
-{
- int i, j, k;
-
-
- static const int free_bits_for_partition_count[5] = { 0, 115 - 4, 111 - 4 - PARTITION_BITS, 108 - 4 - PARTITION_BITS, 105 - 4 - PARTITION_BITS };
-
- const partition_info *pi = get_partition_table(xdim, ydim, zdim, partition_count);
- pi += partition_index;
-
- // first, compute ideal weights and endpoint colors, under thre assumption that
- // there is no quantization or decimation going on.
- endpoints_and_weights *ei = tmpbuf->ei1;
- endpoints_and_weights *eix = tmpbuf->eix1;
- compute_endpoints_and_ideal_weights_1_plane(xdim, ydim, zdim, pi, blk, ewb, ei);
-
- // next, compute ideal weights and endpoint colors for every decimation.
- const block_size_descriptor *bsd = get_block_size_descriptor(xdim, ydim, zdim);
- const decimation_table *const *ixtab2 = bsd->decimation_tables;
- // int block_mode_count = bsd->single_plane_block_mode_count;
-
-
- float *decimated_quantized_weights = tmpbuf->decimated_quantized_weights;
- float *decimated_weights = tmpbuf->decimated_weights;
- float *flt_quantized_decimated_quantized_weights = tmpbuf->flt_quantized_decimated_quantized_weights;
- uint8_t *u8_quantized_decimated_quantized_weights = tmpbuf->u8_quantized_decimated_quantized_weights;
-
- // for each decimation mode, compute an ideal set of weights
- // (that is, weights computed with the assumption that they are not quantized)
- for (i = 0; i < MAX_DECIMATION_MODES; i++)
- {
- if (bsd->permit_encode[i] == 0 || bsd->decimation_mode_maxprec_1plane[i] < 0 || bsd->decimation_mode_percentile[i] > mode_cutoff)
- continue;
- eix[i] = *ei;
- compute_ideal_weights_for_decimation_table(&(eix[i]), ixtab2[i], decimated_quantized_weights + i * MAX_WEIGHTS_PER_BLOCK, decimated_weights + i * MAX_WEIGHTS_PER_BLOCK);
-
- }
-
- // compute maximum colors for the endpoints and ideal weights.
- // for each endpoint-and-ideal-weight pair, compute the smallest weight value
- // that will result in a color value greater than 1.
-
-
- float4 min_ep = float4(10, 10, 10, 10);
- for (i = 0; i < partition_count; i++)
- {
- #ifdef DEBUG_CAPTURE_NAN
- fedisableexcept(FE_DIVBYZERO | FE_INVALID);
- #endif
-
- float4 ep = (float4(1, 1, 1, 1) - ei->ep.endpt0[i]) / (ei->ep.endpt1[i] - ei->ep.endpt0[i]);
- if (ep.x > 0.5f && ep.x < min_ep.x)
- min_ep.x = ep.x;
- if (ep.y > 0.5f && ep.y < min_ep.y)
- min_ep.y = ep.y;
- if (ep.z > 0.5f && ep.z < min_ep.z)
- min_ep.z = ep.z;
- if (ep.w > 0.5f && ep.w < min_ep.w)
- min_ep.w = ep.w;
-
- #ifdef DEBUG_CAPTURE_NAN
- feenableexcept(FE_DIVBYZERO | FE_INVALID);
- #endif
- }
-
- float min_wt_cutoff = MIN(MIN(min_ep.x, min_ep.y), MIN(min_ep.z, min_ep.w));
-
- // for each mode, use the angular method to compute a shift.
- float weight_low_value[MAX_WEIGHT_MODES];
- float weight_high_value[MAX_WEIGHT_MODES];
-
- compute_angular_endpoints_1plane(mode_cutoff, bsd, decimated_quantized_weights, decimated_weights, weight_low_value, weight_high_value);
-
- // for each mode (which specifies a decimation and a quantization):
- // * compute number of bits needed for the quantized weights.
- // * generate an optimized set of quantized weights.
- // * compute quantization errors for the mode.
-
- int qwt_bitcounts[MAX_WEIGHT_MODES];
- float qwt_errors[MAX_WEIGHT_MODES];
-
- for (i = 0; i < MAX_WEIGHT_MODES; i++)
- {
- if (bsd->block_modes[i].permit_encode == 0 || bsd->block_modes[i].is_dual_plane != 0 || bsd->block_modes[i].percentile > mode_cutoff)
- {
- qwt_errors[i] = 1e38f;
- continue;
- }
- if (weight_high_value[i] > 1.02f * min_wt_cutoff)
- weight_high_value[i] = 1.0f;
-
- int decimation_mode = bsd->block_modes[i].decimation_mode;
- if (bsd->decimation_mode_percentile[decimation_mode] > mode_cutoff)
- ASTC_CODEC_INTERNAL_ERROR;
-
-
- // compute weight bitcount for the mode
- int bits_used_by_weights = compute_ise_bitcount(ixtab2[decimation_mode]->num_weights,
- (quantization_method) bsd->block_modes[i].quantization_mode);
- int bitcount = free_bits_for_partition_count[partition_count] - bits_used_by_weights;
- if (bitcount <= 0 || bits_used_by_weights < 24 || bits_used_by_weights > 96)
- {
- qwt_errors[i] = 1e38f;
- continue;
- }
- qwt_bitcounts[i] = bitcount;
-
-
- // then, generate the optimized set of weights for the weight mode.
- compute_ideal_quantized_weights_for_decimation_table(&(eix[decimation_mode]),
- ixtab2[decimation_mode],
- weight_low_value[i], weight_high_value[i],
- decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * decimation_mode,
- flt_quantized_decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * i,
- u8_quantized_decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * i,
- bsd->block_modes[i].quantization_mode);
-
- // then, compute weight-errors for the weight mode.
- qwt_errors[i] = compute_error_of_weight_set(&(eix[decimation_mode]), ixtab2[decimation_mode], flt_quantized_decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * i);
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Block mode %d -> weight error = %f\n", i, qwt_errors[i]);
- #endif
- }
-
- // for each weighting mode, determine the optimal combination of color endpoint encodings
- // and weight encodings; return results for the 4 best-looking modes.
-
- int partition_format_specifiers[4][4];
- int quantized_weight[4];
- int color_quantization_level[4];
- int color_quantization_level_mod[4];
- determine_optimal_set_of_endpoint_formats_to_use(xdim, ydim, zdim, pi, blk, ewb, &(ei->ep), -1, // used to flag that we are in single-weight mode
- qwt_bitcounts, qwt_errors, partition_format_specifiers, quantized_weight, color_quantization_level, color_quantization_level_mod);
-
-
- // then iterate over the 4 believed-to-be-best modes to find out which one is
- // actually best.
- for (i = 0; i < 4; i++)
- {
- uint8_t *u8_weight_src;
- int weights_to_copy;
-
- if (quantized_weight[i] < 0)
- {
- scb->error_block = 1;
- scb++;
- continue;
- }
-
- int decimation_mode = bsd->block_modes[quantized_weight[i]].decimation_mode;
- int weight_quantization_mode = bsd->block_modes[quantized_weight[i]].quantization_mode;
- const decimation_table *it = ixtab2[decimation_mode];
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("Selected mode = %d\n", quantized_weight[i]);
- printf("Selected decimation mode = %d\n", decimation_mode);
- printf("Selected weight-quantization mode = %d\n", weight_quantization_mode);
- }
- #endif
-
- u8_weight_src = u8_quantized_decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * quantized_weight[i];
-
- weights_to_copy = it->num_weights;
-
- // recompute the ideal color endpoints before storing them.
- float4 rgbs_colors[4];
- float4 rgbo_colors[4];
- float2 lum_intervals[4];
-
- int l;
- for (l = 0; l < max_refinement_iters; l++)
- {
- recompute_ideal_colors(xdim, ydim, zdim, weight_quantization_mode, &(eix[decimation_mode].ep), rgbs_colors, rgbo_colors, lum_intervals, u8_weight_src, NULL, -1, pi, it, blk, ewb);
-
- // quantize the chosen color
-
- // store the colors for the block
- for (j = 0; j < partition_count; j++)
- {
- scb->color_formats[j] = pack_color_endpoints(decode_mode,
- eix[decimation_mode].ep.endpt0[j],
- eix[decimation_mode].ep.endpt1[j],
- rgbs_colors[j], rgbo_colors[j], lum_intervals[j], partition_format_specifiers[i][j], scb->color_values[j], color_quantization_level[i]);
- }
-
-
- // if all the color endpoint modes are the same, we get a few more
- // bits to store colors; let's see if we can take advantage of this:
- // requantize all the colors and see if the endpoint modes remain the same;
- // if they do, then exploit it.
- scb->color_formats_matched = 0;
-
- if ((partition_count >= 2 && scb->color_formats[0] == scb->color_formats[1]
- && color_quantization_level != color_quantization_level_mod)
- && (partition_count == 2 || (scb->color_formats[0] == scb->color_formats[2] && (partition_count == 3 || (scb->color_formats[0] == scb->color_formats[3])))))
- {
- int colorvals[4][12];
- int color_formats_mod[4];
- for (j = 0; j < partition_count; j++)
- {
- color_formats_mod[j] = pack_color_endpoints(decode_mode,
- eix[decimation_mode].ep.endpt0[j],
- eix[decimation_mode].ep.endpt1[j],
- rgbs_colors[j], rgbo_colors[j], lum_intervals[j], partition_format_specifiers[i][j], colorvals[j], color_quantization_level_mod[i]);
- }
- if (color_formats_mod[0] == color_formats_mod[1]
- && (partition_count == 2 || (color_formats_mod[0] == color_formats_mod[2] && (partition_count == 3 || (color_formats_mod[0] == color_formats_mod[3])))))
- {
- scb->color_formats_matched = 1;
- for (j = 0; j < 4; j++)
- for (k = 0; k < 12; k++)
- scb->color_values[j][k] = colorvals[j][k];
- for (j = 0; j < 4; j++)
- scb->color_formats[j] = color_formats_mod[j];
- }
- }
-
-
- // store header fields
- scb->partition_count = partition_count;
- scb->partition_index = partition_index;
- scb->color_quantization_level = scb->color_formats_matched ? color_quantization_level_mod[i] : color_quantization_level[i];
- scb->block_mode = quantized_weight[i];
- scb->error_block = 0;
-
- if (scb->color_quantization_level < 4)
- {
- scb->error_block = 1; // should never happen, but cannot prove it impossible.
- }
-
- // perform a final pass over the weights to try to improve them.
- int adjustments = realign_weights(decode_mode,
- xdim, ydim, zdim,
- blk, ewb, scb,
- u8_weight_src,
- NULL);
-
- if (adjustments == 0)
- break;
- }
-
- for (j = 0; j < weights_to_copy; j++)
- scb->plane1_weights[j] = u8_weight_src[j];
-
- scb++;
- }
-
-}
-
-
-
-
-
-
-static void compress_symbolic_block_fixed_partition_2_planes(astc_decode_mode decode_mode,
- float mode_cutoff,
- int max_refinement_iters,
- int xdim, int ydim, int zdim,
- int partition_count, int partition_index,
- int separate_component, const imageblock * blk, const error_weight_block * ewb,
- symbolic_compressed_block * scb,
- compress_fixed_partition_buffers * tmpbuf)
-{
- int i, j, k;
-
- static const int free_bits_for_partition_count[5] =
- { 0, 113 - 4, 109 - 4 - PARTITION_BITS, 106 - 4 - PARTITION_BITS, 103 - 4 - PARTITION_BITS };
-
- const partition_info *pi = get_partition_table(xdim, ydim, zdim, partition_count);
- pi += partition_index;
-
- // first, compute ideal weights and endpoint colors
- endpoints_and_weights *ei1 = tmpbuf->ei1;
- endpoints_and_weights *ei2 = tmpbuf->ei2;
- endpoints_and_weights *eix1 = tmpbuf->eix1;
- endpoints_and_weights *eix2 = tmpbuf->eix2;
- compute_endpoints_and_ideal_weights_2_planes(xdim, ydim, zdim, pi, blk, ewb, separate_component, ei1, ei2);
-
- // next, compute ideal weights and endpoint colors for every decimation.
- const block_size_descriptor *bsd = get_block_size_descriptor(xdim, ydim, zdim);
- const decimation_table *const *ixtab2 = bsd->decimation_tables;
-
-
- float *decimated_quantized_weights = tmpbuf->decimated_quantized_weights;
- float *decimated_weights = tmpbuf->decimated_weights;
- float *flt_quantized_decimated_quantized_weights = tmpbuf->flt_quantized_decimated_quantized_weights;
- uint8_t *u8_quantized_decimated_quantized_weights = tmpbuf->u8_quantized_decimated_quantized_weights;
-
- // for each decimation mode, compute an ideal set of weights
- for (i = 0; i < MAX_DECIMATION_MODES; i++)
- {
- if (bsd->permit_encode[i] == 0 || bsd->decimation_mode_maxprec_2planes[i] < 0 || bsd->decimation_mode_percentile[i] > mode_cutoff)
- continue;
-
- eix1[i] = *ei1;
- eix2[i] = *ei2;
- compute_ideal_weights_for_decimation_table(&(eix1[i]), ixtab2[i], decimated_quantized_weights + (2 * i) * MAX_WEIGHTS_PER_BLOCK, decimated_weights + (2 * i) * MAX_WEIGHTS_PER_BLOCK);
- compute_ideal_weights_for_decimation_table(&(eix2[i]), ixtab2[i], decimated_quantized_weights + (2 * i + 1) * MAX_WEIGHTS_PER_BLOCK, decimated_weights + (2 * i + 1) * MAX_WEIGHTS_PER_BLOCK);
- }
-
- // compute maximum colors for the endpoints and ideal weights.
- // for each endpoint-and-ideal-weight pair, compute the smallest weight value
- // that will result in a color value greater than 1.
-
- float4 min_ep1 = float4(10, 10, 10, 10);
- float4 min_ep2 = float4(10, 10, 10, 10);
- for (i = 0; i < partition_count; i++)
- {
-
- #ifdef DEBUG_CAPTURE_NAN
- fedisableexcept(FE_DIVBYZERO | FE_INVALID);
- #endif
-
- float4 ep1 = (float4(1, 1, 1, 1) - ei1->ep.endpt0[i]) / (ei1->ep.endpt1[i] - ei1->ep.endpt0[i]);
- if (ep1.x > 0.5f && ep1.x < min_ep1.x)
- min_ep1.x = ep1.x;
- if (ep1.y > 0.5f && ep1.y < min_ep1.y)
- min_ep1.y = ep1.y;
- if (ep1.z > 0.5f && ep1.z < min_ep1.z)
- min_ep1.z = ep1.z;
- if (ep1.w > 0.5f && ep1.w < min_ep1.w)
- min_ep1.w = ep1.w;
- float4 ep2 = (float4(1, 1, 1, 1) - ei2->ep.endpt0[i]) / (ei2->ep.endpt1[i] - ei2->ep.endpt0[i]);
- if (ep2.x > 0.5f && ep2.x < min_ep2.x)
- min_ep2.x = ep2.x;
- if (ep2.y > 0.5f && ep2.y < min_ep2.y)
- min_ep2.y = ep2.y;
- if (ep2.z > 0.5f && ep2.z < min_ep2.z)
- min_ep2.z = ep2.z;
- if (ep2.w > 0.5f && ep2.w < min_ep2.w)
- min_ep2.w = ep2.w;
-
- #ifdef DEBUG_CAPTURE_NAN
- feenableexcept(FE_DIVBYZERO | FE_INVALID);
- #endif
- }
-
- float min_wt_cutoff1, min_wt_cutoff2;
- switch (separate_component)
- {
- case 0:
- min_wt_cutoff2 = min_ep2.x;
- min_ep1.x = 1e30f;
- break;
- case 1:
- min_wt_cutoff2 = min_ep2.y;
- min_ep1.y = 1e30f;
- break;
- case 2:
- min_wt_cutoff2 = min_ep2.z;
- min_ep1.z = 1e30f;
- break;
- case 3:
- min_wt_cutoff2 = min_ep2.w;
- min_ep1.w = 1e30f;
- break;
- default:
- min_wt_cutoff2 = 1e30f;
- }
-
- min_wt_cutoff1 = MIN(MIN(min_ep1.x, min_ep1.y), MIN(min_ep1.z, min_ep1.w));
-
- float weight_low_value1[MAX_WEIGHT_MODES];
- float weight_high_value1[MAX_WEIGHT_MODES];
- float weight_low_value2[MAX_WEIGHT_MODES];
- float weight_high_value2[MAX_WEIGHT_MODES];
-
- compute_angular_endpoints_2planes(mode_cutoff, bsd, decimated_quantized_weights, decimated_weights, weight_low_value1, weight_high_value1, weight_low_value2, weight_high_value2);
-
- // for each mode (which specifies a decimation and a quantization):
- // * generate an optimized set of quantized weights.
- // * compute quantization errors for each mode
- // * compute number of bits needed for the quantized weights.
-
- int qwt_bitcounts[MAX_WEIGHT_MODES];
- float qwt_errors[MAX_WEIGHT_MODES];
- for (i = 0; i < MAX_WEIGHT_MODES; i++)
- {
- if (bsd->block_modes[i].permit_encode == 0 || bsd->block_modes[i].is_dual_plane != 1 || bsd->block_modes[i].percentile > mode_cutoff)
- {
- qwt_errors[i] = 1e38f;
- continue;
- }
- int decimation_mode = bsd->block_modes[i].decimation_mode;
-
- if (weight_high_value1[i] > 1.02f * min_wt_cutoff1)
- weight_high_value1[i] = 1.0f;
- if (weight_high_value2[i] > 1.02f * min_wt_cutoff2)
- weight_high_value2[i] = 1.0f;
-
- // compute weight bitcount for the mode
- int bits_used_by_weights = compute_ise_bitcount(2 * ixtab2[decimation_mode]->num_weights,
- (quantization_method) bsd->block_modes[i].quantization_mode);
- int bitcount = free_bits_for_partition_count[partition_count] - bits_used_by_weights;
- if (bitcount <= 0 || bits_used_by_weights < 24 || bits_used_by_weights > 96)
- {
- qwt_errors[i] = 1e38f;
- continue;
- }
- qwt_bitcounts[i] = bitcount;
-
-
- // then, generate the optimized set of weights for the mode.
- compute_ideal_quantized_weights_for_decimation_table(&(eix1[decimation_mode]),
- ixtab2[decimation_mode],
- weight_low_value1[i],
- weight_high_value1[i],
- decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * (2 * decimation_mode),
- flt_quantized_decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * (2 * i),
- u8_quantized_decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * (2 * i), bsd->block_modes[i].quantization_mode);
- compute_ideal_quantized_weights_for_decimation_table(&(eix2[decimation_mode]),
- ixtab2[decimation_mode],
- weight_low_value2[i],
- weight_high_value2[i],
- decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * (2 * decimation_mode + 1),
- flt_quantized_decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * (2 * i + 1),
- u8_quantized_decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * (2 * i + 1), bsd->block_modes[i].quantization_mode);
-
-
- // then, compute quantization errors for the block mode.
- qwt_errors[i] =
- compute_error_of_weight_set(&(eix1[decimation_mode]),
- ixtab2[decimation_mode],
- flt_quantized_decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * (2 * i))
- + compute_error_of_weight_set(&(eix2[decimation_mode]), ixtab2[decimation_mode], flt_quantized_decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * (2 * i + 1));
- }
-
-
- // decide the optimal combination of color endpoint encodings and weight encoodings.
- int partition_format_specifiers[4][4];
- int quantized_weight[4];
- int color_quantization_level[4];
- int color_quantization_level_mod[4];
-
- endpoints epm;
- merge_endpoints(&(ei1->ep), &(ei2->ep), separate_component, &epm);
-
- determine_optimal_set_of_endpoint_formats_to_use(xdim, ydim, zdim,
- pi,
- blk,
- ewb,
- &epm, separate_component, qwt_bitcounts, qwt_errors, partition_format_specifiers, quantized_weight, color_quantization_level, color_quantization_level_mod);
-
- for (i = 0; i < 4; i++)
- {
- if (quantized_weight[i] < 0)
- {
- scb->error_block = 1;
- scb++;
- continue;
- }
-
- uint8_t *u8_weight1_src;
- uint8_t *u8_weight2_src;
- int weights_to_copy;
-
- int decimation_mode = bsd->block_modes[quantized_weight[i]].decimation_mode;
- int weight_quantization_mode = bsd->block_modes[quantized_weight[i]].quantization_mode;
- const decimation_table *it = ixtab2[decimation_mode];
-
- u8_weight1_src = u8_quantized_decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * (2 * quantized_weight[i]);
- u8_weight2_src = u8_quantized_decimated_quantized_weights + MAX_WEIGHTS_PER_BLOCK * (2 * quantized_weight[i] + 1);
-
-
- weights_to_copy = it->num_weights;
-
- // recompute the ideal color endpoints before storing them.
- merge_endpoints(&(eix1[decimation_mode].ep), &(eix2[decimation_mode].ep), separate_component, &epm);
-
- float4 rgbs_colors[4];
- float4 rgbo_colors[4];
- float2 lum_intervals[4];
-
- int l;
- for (l = 0; l < max_refinement_iters; l++)
- {
- recompute_ideal_colors(xdim, ydim, zdim, weight_quantization_mode, &epm, rgbs_colors, rgbo_colors, lum_intervals, u8_weight1_src, u8_weight2_src, separate_component, pi, it, blk, ewb);
-
- // store the colors for the block
- for (j = 0; j < partition_count; j++)
- {
- scb->color_formats[j] = pack_color_endpoints(decode_mode,
- epm.endpt0[j],
- epm.endpt1[j],
- rgbs_colors[j], rgbo_colors[j], lum_intervals[j], partition_format_specifiers[i][j], scb->color_values[j], color_quantization_level[i]);
- }
- scb->color_formats_matched = 0;
-
- if ((partition_count >= 2 && scb->color_formats[0] == scb->color_formats[1]
- && color_quantization_level != color_quantization_level_mod)
- && (partition_count == 2 || (scb->color_formats[0] == scb->color_formats[2] && (partition_count == 3 || (scb->color_formats[0] == scb->color_formats[3])))))
- {
- int colorvals[4][12];
- int color_formats_mod[4];
- for (j = 0; j < partition_count; j++)
- {
- color_formats_mod[j] = pack_color_endpoints(decode_mode,
- epm.endpt0[j],
- epm.endpt1[j],
- rgbs_colors[j], rgbo_colors[j], lum_intervals[j], partition_format_specifiers[i][j], colorvals[j], color_quantization_level_mod[i]);
- }
- if (color_formats_mod[0] == color_formats_mod[1]
- && (partition_count == 2 || (color_formats_mod[0] == color_formats_mod[2] && (partition_count == 3 || (color_formats_mod[0] == color_formats_mod[3])))))
- {
- scb->color_formats_matched = 1;
- for (j = 0; j < 4; j++)
- for (k = 0; k < 12; k++)
- scb->color_values[j][k] = colorvals[j][k];
- for (j = 0; j < 4; j++)
- scb->color_formats[j] = color_formats_mod[j];
- }
- }
-
-
- // store header fields
- scb->partition_count = partition_count;
- scb->partition_index = partition_index;
- scb->color_quantization_level = scb->color_formats_matched ? color_quantization_level_mod[i] : color_quantization_level[i];
- scb->block_mode = quantized_weight[i];
- scb->plane2_color_component = separate_component;
- scb->error_block = 0;
-
- if (scb->color_quantization_level < 4)
- {
- scb->error_block = 1; // should never happen, but cannot prove it impossible
- }
-
- int adjustments = realign_weights(decode_mode,
- xdim, ydim, zdim,
- blk, ewb, scb,
- u8_weight1_src,
- u8_weight2_src);
-
- if (adjustments == 0)
- break;
- }
-
- for (j = 0; j < weights_to_copy; j++)
- {
- scb->plane1_weights[j] = u8_weight1_src[j];
- scb->plane2_weights[j] = u8_weight2_src[j];
- }
-
- scb++;
- }
-
-}
-
-
-
-
-
-void expand_block_artifact_suppression(int xdim, int ydim, int zdim, error_weighting_params * ewp)
-{
- int x, y, z;
- float centerpos_x = (xdim - 1) * 0.5f;
- float centerpos_y = (ydim - 1) * 0.5f;
- float centerpos_z = (zdim - 1) * 0.5f;
- float *bef = ewp->block_artifact_suppression_expanded;
-
- for (z = 0; z < zdim; z++)
- for (y = 0; y < ydim; y++)
- for (x = 0; x < xdim; x++)
- {
- float xdif = (x - centerpos_x) / xdim;
- float ydif = (y - centerpos_y) / ydim;
- float zdif = (z - centerpos_z) / zdim;
-
- float wdif = 0.36f;
- float dist = sqrt(xdif * xdif + ydif * ydif + zdif * zdif + wdif * wdif);
- *bef = pow(dist, ewp->block_artifact_suppression);
- bef++;
- }
-}
-
-
-
-// Function to set error weights for each color component for each texel in a block.
-// Returns the sum of all the error values set.
-
-float prepare_error_weight_block(const astc_codec_image * input_image,
- int xdim, int ydim, int zdim, const error_weighting_params * ewp, const imageblock * blk, error_weight_block * ewb, error_weight_block_orig * ewbo)
-{
-
- int x, y, z;
- int idx = 0;
-
- int any_mean_stdev_weight =
- ewp->rgb_base_weight != 1.0 || ewp->alpha_base_weight != 1.0 || ewp->rgb_mean_weight != 0.0 || ewp->rgb_stdev_weight != 0.0 || ewp->alpha_mean_weight != 0.0 || ewp->alpha_stdev_weight != 0.0;
-
- float4 color_weights = float4(ewp->rgba_weights[0],
- ewp->rgba_weights[1],
- ewp->rgba_weights[2],
- ewp->rgba_weights[3]);
-
- ewb->contains_zeroweight_texels = 0;
-
- for (z = 0; z < zdim; z++)
- for (y = 0; y < ydim; y++)
- for (x = 0; x < xdim; x++)
- {
- int xpos = x + blk->xpos;
- int ypos = y + blk->ypos;
- int zpos = z + blk->zpos;
-
- if (xpos >= input_image->xsize || ypos >= input_image->ysize || zpos >= input_image->zsize)
- {
- float4 weights = float4(1e-11f, 1e-11f, 1e-11f, 1e-11f);
- ewb->error_weights[idx] = weights;
- ewb->contains_zeroweight_texels = 1;
- }
- else
- {
- float4 error_weight = float4(ewp->rgb_base_weight,
- ewp->rgb_base_weight,
- ewp->rgb_base_weight,
- ewp->alpha_base_weight);
-
- if (any_mean_stdev_weight)
- {
- float4 avg = input_averages[zpos][ypos][xpos];
- if (avg.x < 6e-5f)
- avg.x = 6e-5f;
- if (avg.y < 6e-5f)
- avg.y = 6e-5f;
- if (avg.z < 6e-5f)
- avg.z = 6e-5f;
- if (avg.w < 6e-5f)
- avg.w = 6e-5f;
- /*
- printf("avg: %f %f %f %f\n", avg.x, avg.y, avg.z, avg.w ); */
- avg = avg * avg;
-
- float4 variance = input_variances[zpos][ypos][xpos];
- variance = variance * variance;
-
- float favg = (avg.x + avg.y + avg.z) * (1.0f / 3.0f);
- float fvar = (variance.x + variance.y + variance.z) * (1.0f / 3.0f);
-
- float mixing = ewp->rgb_mean_and_stdev_mixing;
- avg.xyz = float3(favg, favg, favg) * mixing + avg.xyz * (1.0f - mixing);
- variance.xyz = float3(fvar, fvar, fvar) * mixing + variance.xyz * (1.0f - mixing);
-
- float4 stdev = float4(sqrt(MAX(variance.x, 0.0f)),
- sqrt(MAX(variance.y, 0.0f)),
- sqrt(MAX(variance.z, 0.0f)),
- sqrt(MAX(variance.w, 0.0f)));
-
- avg.xyz = avg.xyz * ewp->rgb_mean_weight;
- avg.w = avg.w * ewp->alpha_mean_weight;
- stdev.xyz = stdev.xyz * ewp->rgb_stdev_weight;
- stdev.w = stdev.w * ewp->alpha_stdev_weight;
- error_weight = error_weight + avg + stdev;
-
- error_weight = float4(1.0f, 1.0f, 1.0f, 1.0f) / error_weight;
- }
-
- if (ewp->ra_normal_angular_scale)
- {
- float x = (blk->orig_data[4 * idx] - 0.5f) * 2.0f;
- float y = (blk->orig_data[4 * idx + 3] - 0.5f) * 2.0f;
- float denom = 1.0f - x * x - y * y;
- if (denom < 0.1f)
- denom = 0.1f;
- denom = 1.0f / denom;
- error_weight.x *= 1.0f + x * x * denom;
- error_weight.w *= 1.0f + y * y * denom;
- }
-
- if (ewp->enable_rgb_scale_with_alpha)
- {
- float alpha_scale;
- if (ewp->alpha_radius != 0)
- alpha_scale = input_alpha_averages[zpos][ypos][xpos];
- else
- alpha_scale = blk->orig_data[4 * idx + 3];
- if (alpha_scale < 0.0001f)
- alpha_scale = 0.0001f;
- alpha_scale *= alpha_scale;
- error_weight.xyz = error_weight.xyz * alpha_scale;
- }
- error_weight = error_weight * color_weights;
- error_weight = error_weight * ewp->block_artifact_suppression_expanded[idx];
-
- // if we perform a conversion from linear to sRGB, then we multiply
- // the weight with the derivative of the linear->sRGB transform function.
- if (perform_srgb_transform)
- {
- float r = blk->orig_data[4 * idx];
- float g = blk->orig_data[4 * idx + 1];
- float b = blk->orig_data[4 * idx + 2];
- if (r < 0.0031308f)
- r = 12.92f;
- else
- r = 0.4396f * pow(r, -0.58333f);
- if (g < 0.0031308f)
- g = 12.92f;
- else
- g = 0.4396f * pow(g, -0.58333f);
- if (b < 0.0031308f)
- b = 12.92f;
- else
- b = 0.4396f * pow(b, -0.58333f);
- error_weight.x *= r;
- error_weight.y *= g;
- error_weight.z *= b;
- }
-
- /*
- printf("%f %f %f %f\n", error_weight.x, error_weight.y, error_weight.z, error_weight.w );
- */
-
- // when we loaded the block to begin with, we applied a transfer function
- // and computed the derivative of the transfer function. However, the
- // error-weight computation so far is based on the original color values,
- // not the transfer-function values. As such, we must multiply the
- // error weights by the derivative of the inverse of the transfer function,
- // which is equivalent to dividing by the derivative of the transfer
- // function.
-
- ewbo->error_weights[idx] = error_weight;
-
- error_weight.x /= (blk->deriv_data[4 * idx] * blk->deriv_data[4 * idx] * 1e-10f);
- error_weight.y /= (blk->deriv_data[4 * idx + 1] * blk->deriv_data[4 * idx + 1] * 1e-10f);
- error_weight.z /= (blk->deriv_data[4 * idx + 2] * blk->deriv_data[4 * idx + 2] * 1e-10f);
- error_weight.w /= (blk->deriv_data[4 * idx + 3] * blk->deriv_data[4 * idx + 3] * 1e-10f);
-
- /*
- printf("--> %f %f %f %f\n", error_weight.x, error_weight.y, error_weight.z, error_weight.w );
- */
-
- ewb->error_weights[idx] = error_weight;
- if (dot(error_weight, float4(1, 1, 1, 1)) < 1e-10f)
- ewb->contains_zeroweight_texels = 1;
- }
- idx++;
- }
-
- int i;
-
- float4 error_weight_sum = float4(0, 0, 0, 0);
- int texels_per_block = xdim * ydim * zdim;
-
- for (i = 0; i < texels_per_block; i++)
- {
- error_weight_sum = error_weight_sum + ewb->error_weights[i];
-
- ewb->texel_weight_r[i] = ewb->error_weights[i].x;
- ewb->texel_weight_g[i] = ewb->error_weights[i].y;
- ewb->texel_weight_b[i] = ewb->error_weights[i].z;
- ewb->texel_weight_a[i] = ewb->error_weights[i].w;
-
- ewb->texel_weight_rg[i] = (ewb->error_weights[i].x + ewb->error_weights[i].y) * 0.5f;
- ewb->texel_weight_rb[i] = (ewb->error_weights[i].x + ewb->error_weights[i].z) * 0.5f;
- ewb->texel_weight_gb[i] = (ewb->error_weights[i].y + ewb->error_weights[i].z) * 0.5f;
- ewb->texel_weight_ra[i] = (ewb->error_weights[i].x + ewb->error_weights[i].w) * 0.5f;
-
- ewb->texel_weight_gba[i] = (ewb->error_weights[i].y + ewb->error_weights[i].z + ewb->error_weights[i].w) * 0.333333f;
- ewb->texel_weight_rba[i] = (ewb->error_weights[i].x + ewb->error_weights[i].z + ewb->error_weights[i].w) * 0.333333f;
- ewb->texel_weight_rga[i] = (ewb->error_weights[i].x + ewb->error_weights[i].y + ewb->error_weights[i].w) * 0.333333f;
- ewb->texel_weight_rgb[i] = (ewb->error_weights[i].x + ewb->error_weights[i].y + ewb->error_weights[i].z) * 0.333333f;
- ewb->texel_weight[i] = (ewb->error_weights[i].x + ewb->error_weights[i].y + ewb->error_weights[i].z + ewb->error_weights[i].w) * 0.25f;
- }
-
- return dot(error_weight_sum, float4(1, 1, 1, 1));
-}
-
-
-/*
- functions to analyze block statistical properties:
- * simple properties: * mean * variance
- * covariance-matrix correllation coefficients
- */
-
-
-// compute averages and covariance matrices for 4 components
-static void compute_covariance_matrix(int xdim, int ydim, int zdim, const imageblock * blk, const error_weight_block * ewb, mat4 * cov_matrix)
-{
- int i;
-
- int texels_per_block = xdim * ydim * zdim;
-
- float r_sum = 0.0f;
- float g_sum = 0.0f;
- float b_sum = 0.0f;
- float a_sum = 0.0f;
- float rr_sum = 0.0f;
- float gg_sum = 0.0f;
- float bb_sum = 0.0f;
- float aa_sum = 0.0f;
- float rg_sum = 0.0f;
- float rb_sum = 0.0f;
- float ra_sum = 0.0f;
- float gb_sum = 0.0f;
- float ga_sum = 0.0f;
- float ba_sum = 0.0f;
-
- float weight_sum = 0.0f;
-
- for (i = 0; i < texels_per_block; i++)
- {
- float weight = ewb->texel_weight[i];
- if (weight < 0.0f)
- ASTC_CODEC_INTERNAL_ERROR;
- weight_sum += weight;
- float r = blk->work_data[4 * i];
- float g = blk->work_data[4 * i + 1];
- float b = blk->work_data[4 * i + 2];
- float a = blk->work_data[4 * i + 3];
- r_sum += r * weight;
- rr_sum += r * (r * weight);
- rg_sum += g * (r * weight);
- rb_sum += b * (r * weight);
- ra_sum += a * (r * weight);
- g_sum += g * weight;
- gg_sum += g * (g * weight);
- gb_sum += b * (g * weight);
- ga_sum += a * (g * weight);
- b_sum += b * weight;
- bb_sum += b * (b * weight);
- ba_sum += a * (b * weight);
- a_sum += a * weight;
- aa_sum += a * (a * weight);
- }
-
- float rpt = 1.0f / MAX(weight_sum, 1e-7f);
- float rs = r_sum;
- float gs = g_sum;
- float bs = b_sum;
- float as = a_sum;
-
- cov_matrix->v[0] = float4(rr_sum - rs * rs * rpt, rg_sum - rs * gs * rpt, rb_sum - rs * bs * rpt, ra_sum - rs * as * rpt);
- cov_matrix->v[1] = float4(rg_sum - rs * gs * rpt, gg_sum - gs * gs * rpt, gb_sum - gs * bs * rpt, ga_sum - gs * as * rpt);
- cov_matrix->v[2] = float4(rb_sum - rs * bs * rpt, gb_sum - gs * bs * rpt, bb_sum - bs * bs * rpt, ba_sum - bs * as * rpt);
- cov_matrix->v[3] = float4(ra_sum - rs * as * rpt, ga_sum - gs * as * rpt, ba_sum - bs * as * rpt, aa_sum - as * as * rpt);
-
-}
-
-
-
-void prepare_block_statistics(int xdim, int ydim, int zdim, const imageblock * blk, const error_weight_block * ewb, int *is_normal_map, float *lowest_correl)
-{
- int i;
-
- mat4 cov_matrix;
-
- compute_covariance_matrix(xdim, ydim, zdim, blk, ewb, &cov_matrix);
-
- // use the covariance matrix to compute
- // correllation coefficients
- float rr_var = cov_matrix.v[0].x;
- float gg_var = cov_matrix.v[1].y;
- float bb_var = cov_matrix.v[2].z;
- float aa_var = cov_matrix.v[3].w;
-
- float rg_correlation = cov_matrix.v[0].y / sqrt(MAX(rr_var * gg_var, 1e-30f));
- float rb_correlation = cov_matrix.v[0].z / sqrt(MAX(rr_var * bb_var, 1e-30f));
- float ra_correlation = cov_matrix.v[0].w / sqrt(MAX(rr_var * aa_var, 1e-30f));
- float gb_correlation = cov_matrix.v[1].z / sqrt(MAX(gg_var * bb_var, 1e-30f));
- float ga_correlation = cov_matrix.v[1].w / sqrt(MAX(gg_var * aa_var, 1e-30f));
- float ba_correlation = cov_matrix.v[2].w / sqrt(MAX(bb_var * aa_var, 1e-30f));
-
- if (astc_isnan(rg_correlation))
- rg_correlation = 1.0f;
- if (astc_isnan(rb_correlation))
- rb_correlation = 1.0f;
- if (astc_isnan(ra_correlation))
- ra_correlation = 1.0f;
- if (astc_isnan(gb_correlation))
- gb_correlation = 1.0f;
- if (astc_isnan(ga_correlation))
- ga_correlation = 1.0f;
- if (astc_isnan(ba_correlation))
- ba_correlation = 1.0f;
-
- float lowest_correlation = MIN(fabs(rg_correlation), fabs(rb_correlation));
- lowest_correlation = MIN(lowest_correlation, fabs(ra_correlation));
- lowest_correlation = MIN(lowest_correlation, fabs(gb_correlation));
- lowest_correlation = MIN(lowest_correlation, fabs(ga_correlation));
- lowest_correlation = MIN(lowest_correlation, fabs(ba_correlation));
- *lowest_correl = lowest_correlation;
-
- // compute a "normal-map" factor
- // this factor should be exactly 0.0 for a normal map, while it may be all over the
- // place for anything that is NOT a normal map. We can probably assume that a factor
- // of less than 0.2f represents a normal map.
-
- float nf_sum = 0.0f;
-
- int texels_per_block = xdim * ydim * zdim;
-
- for (i = 0; i < texels_per_block; i++)
- {
- float3 val = float3(blk->orig_data[4 * i],
- blk->orig_data[4 * i + 1],
- blk->orig_data[4 * i + 2]);
- val = (val - float3(0.5f, 0.5f, 0.5f)) * 2.0f;
- float length_squared = dot(val, val);
- float nf = fabs(length_squared - 1.0f);
- nf_sum += nf;
- }
- float nf_avg = nf_sum / texels_per_block;
- *is_normal_map = nf_avg < 0.2;
-}
-
-
-
-
-
-void compress_constant_color_block(int xdim, int ydim, int zdim, const imageblock * blk, const error_weight_block * ewb, symbolic_compressed_block * scb)
-{
- int texel_count = xdim * ydim * zdim;
- int i;
-
- float4 color_sum = float4(0, 0, 0, 0);
- float4 color_weight_sum = float4(0, 0, 0, 0);
-
- const float *clp = blk->work_data;
- for (i = 0; i < texel_count; i++)
- {
- float4 weights = ewb->error_weights[i];
- float4 color_data = float4(clp[4 * i], clp[4 * i + 1], clp[4 * i + 2], clp[4 * i + 3]);
- color_sum = color_sum + (color_data * weights);
- color_weight_sum = color_weight_sum + weights;
- }
-
- float4 avg_color = color_sum / color_weight_sum;
-
- int use_fp16 = blk->rgb_lns[0];
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("Averaged color: %f %f %f %f\n", avg_color.x, avg_color.y, avg_color.z, avg_color.w);
- }
- #endif
-
- // convert the color
- if (blk->rgb_lns[0])
- {
- int avg_red = static_cast < int >(floor(avg_color.x + 0.5f));
- int avg_green = static_cast < int >(floor(avg_color.y + 0.5f));
- int avg_blue = static_cast < int >(floor(avg_color.z + 0.5f));
-
- if (avg_red < 0)
- avg_red = 0;
- else if (avg_red > 65535)
- avg_red = 65535;
-
- if (avg_green < 0)
- avg_green = 0;
- else if (avg_green > 65535)
- avg_green = 65535;
-
- if (avg_blue < 0)
- avg_blue = 0;
- else if (avg_blue > 65535)
- avg_blue = 65535;
-
- avg_color.x = sf16_to_float(lns_to_sf16(avg_red));
- avg_color.y = sf16_to_float(lns_to_sf16(avg_green));
- avg_color.z = sf16_to_float(lns_to_sf16(avg_blue));
- }
- else
- {
- avg_color.x *= (1.0f / 65535.0f);
- avg_color.y *= (1.0f / 65535.0f);
- avg_color.z *= (1.0f / 65535.0f);
- }
- if (blk->alpha_lns[0])
- {
- int avg_alpha = static_cast < int >(floor(avg_color.w + 0.5f));
-
- if (avg_alpha < 0)
- avg_alpha = 0;
- else if (avg_alpha > 65535)
- avg_alpha = 65535;
-
- avg_color.w = sf16_to_float(lns_to_sf16(avg_alpha));
- }
- else
- {
- avg_color.w *= (1.0f / 65535.0f);
- }
-
-#ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("Averaged color: %f %f %f %f (%d)\n", avg_color.x, avg_color.y, avg_color.z, avg_color.w, use_fp16);
-
- }
-#endif
-
- if (use_fp16)
- {
- scb->error_block = 0;
- scb->block_mode = -1;
- scb->partition_count = 0;
- scb->constant_color[0] = float_to_sf16(avg_color.x, SF_NEARESTEVEN);
- scb->constant_color[1] = float_to_sf16(avg_color.y, SF_NEARESTEVEN);
- scb->constant_color[2] = float_to_sf16(avg_color.z, SF_NEARESTEVEN);
- scb->constant_color[3] = float_to_sf16(avg_color.w, SF_NEARESTEVEN);
- }
-
- else
- {
- scb->error_block = 0;
- scb->block_mode = -2;
- scb->partition_count = 0;
- float red = avg_color.x;
- float green = avg_color.y;
- float blue = avg_color.z;
- float alpha = avg_color.w;
- if (red < 0)
- red = 0;
- else if (red > 1)
- red = 1;
- if (green < 0)
- green = 0;
- else if (green > 1)
- green = 1;
- if (blue < 0)
- blue = 0;
- else if (blue > 1)
- blue = 1;
- if (alpha < 0)
- alpha = 0;
- else if (alpha > 1)
- alpha = 1;
- scb->constant_color[0] = static_cast < int >(floor(red * 65535.0f + 0.5f));
- scb->constant_color[1] = static_cast < int >(floor(green * 65535.0f + 0.5f));
- scb->constant_color[2] = static_cast < int >(floor(blue * 65535.0f + 0.5f));
- scb->constant_color[3] = static_cast < int >(floor(alpha * 65535.0f + 0.5f));
- }
-}
-
-int block_mode_histogram[2048];
-
-float compress_symbolic_block(const astc_codec_image * input_image,
- astc_decode_mode decode_mode, int xdim, int ydim, int zdim, const error_weighting_params * ewp, const imageblock * blk, symbolic_compressed_block * scb,
- compress_symbolic_block_buffers * tmpbuf)
-{
- int i, j;
- int xpos = blk->xpos;
- int ypos = blk->ypos;
- int zpos = blk->zpos;
-
- int x, y, z;
-
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("Diagnostics of block of dimension %d x %d x %d\n\n", xdim, ydim, zdim);
-
- printf("XPos: %d YPos: %d ZPos: %d\n", xpos, ypos, zpos);
-
- printf("Red-min: %f Red-max: %f\n", blk->red_min, blk->red_max);
- printf("Green-min: %f Green-max: %f\n", blk->green_min, blk->green_max);
- printf("Blue-min: %f Blue-max: %f\n", blk->blue_min, blk->blue_max);
- printf("Alpha-min: %f Alpha-max: %f\n", blk->alpha_min, blk->alpha_max);
- printf("Grayscale: %d\n", blk->grayscale);
-
- for (z = 0; z < zdim; z++)
- for (y = 0; y < ydim; y++)
- for (x = 0; x < xdim; x++)
- {
- int idx = ((z * ydim + y) * xdim + x) * 4;
- printf("Texel (%d %d %d) : orig=< %g, %g, %g, %g >, work=< %g, %g, %g, %g >\n",
- x, y, z,
- blk->orig_data[idx],
- blk->orig_data[idx + 1], blk->orig_data[idx + 2], blk->orig_data[idx + 3], blk->work_data[idx], blk->work_data[idx + 1], blk->work_data[idx + 2], blk->work_data[idx + 3]);
- }
- printf("\n");
- }
- #endif
-
-
- if (blk->red_min == blk->red_max && blk->green_min == blk->green_max && blk->blue_min == blk->blue_max && blk->alpha_min == blk->alpha_max)
- {
-
- // detected a constant-color block. Encode as FP16 if using HDR
- scb->error_block = 0;
-
- if (rgb_force_use_of_hdr)
- {
- scb->block_mode = -1;
- scb->partition_count = 0;
- scb->constant_color[0] = float_to_sf16(blk->orig_data[0], SF_NEARESTEVEN);
- scb->constant_color[1] = float_to_sf16(blk->orig_data[1], SF_NEARESTEVEN);
- scb->constant_color[2] = float_to_sf16(blk->orig_data[2], SF_NEARESTEVEN);
- scb->constant_color[3] = float_to_sf16(blk->orig_data[3], SF_NEARESTEVEN);
- }
- else
- {
- // Encode as UNORM16 if NOT using HDR.
- scb->block_mode = -2;
- scb->partition_count = 0;
- float red = blk->orig_data[0];
- float green = blk->orig_data[1];
- float blue = blk->orig_data[2];
- float alpha = blk->orig_data[3];
- if (red < 0)
- red = 0;
- else if (red > 1)
- red = 1;
- if (green < 0)
- green = 0;
- else if (green > 1)
- green = 1;
- if (blue < 0)
- blue = 0;
- else if (blue > 1)
- blue = 1;
- if (alpha < 0)
- alpha = 0;
- else if (alpha > 1)
- alpha = 1;
- scb->constant_color[0] = (int)floor(red * 65535.0f + 0.5f);
- scb->constant_color[1] = (int)floor(green * 65535.0f + 0.5f);
- scb->constant_color[2] = (int)floor(blue * 65535.0f + 0.5f);
- scb->constant_color[3] = (int)floor(alpha * 65535.0f + 0.5f);
- }
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("Block is single-color <%4.4X %4.4X %4.4X %4.4X>\n", scb->constant_color[0], scb->constant_color[1], scb->constant_color[2], scb->constant_color[3]);
- }
- #endif
-
- if (print_tile_errors)
- printf("0\n");
-
- physical_compressed_block psb = symbolic_to_physical(xdim, ydim, zdim, scb);
- physical_to_symbolic(xdim, ydim, zdim, psb, scb);
-
- return 0.0f;
- }
-
- error_weight_block *ewb = tmpbuf->ewb;
- error_weight_block_orig *ewbo = tmpbuf->ewbo;
-
- float error_weight_sum = prepare_error_weight_block(input_image,
- xdim, ydim, zdim,
- ewp, blk, ewb, ewbo);
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("\n");
- for (z = 0; z < zdim; z++)
- for (y = 0; y < ydim; y++)
- for (x = 0; x < xdim; x++)
- {
- int idx = (z * ydim + y) * xdim + x;
- printf("ErrorWeight (%d %d %d) : < %g, %g, %g, %g >\n", x, y, z, ewb->error_weights[idx].x, ewb->error_weights[idx].y, ewb->error_weights[idx].z, ewb->error_weights[idx].w);
- }
- printf("\n");
- }
- #endif
-
- symbolic_compressed_block *tempblocks = tmpbuf->tempblocks;
-
- float error_of_best_block = 1e20f;
- // int modesel=0;
-
- imageblock *temp = tmpbuf->temp;
-
- float best_errorvals_in_modes[17];
- for (i = 0; i < 17; i++)
- best_errorvals_in_modes[i] = 1e30f;
-
- int uses_alpha = imageblock_uses_alpha(xdim, ydim, zdim, blk);
-
-
- // compression of average-color blocks disabled for the time being;
- // they produce extremely severe block artifacts.
-#if 0
- // first, compress an averaged-color block
- compress_constant_color_block(xdim, ydim, zdim, blk, ewb, scb);
-
- decompress_symbolic_block(decode_mode, xdim, ydim, zdim, xpos, ypos, zpos, scb, temp);
-
- float avgblock_errorval = compute_imageblock_difference(xdim, ydim, zdim,
- blk, temp, ewb) * 4.0f; // bias somewhat against the average-color block.
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("\n-----------------------------------\n");
- printf("Average-color block test completed\n");
- printf("Resulting error value: %g\n", avgblock_errorval);
- }
- #endif
-
-
- if (avgblock_errorval < error_of_best_block)
- {
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Accepted as better than previous-best-error, which was %g\n", error_of_best_block);
- #endif
-
- error_of_best_block = avgblock_errorval;
- // *scb = tempblocks[j];
- modesel = 0;
- }
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("-----------------------------------\n");
- }
- #endif
-#endif
-
-
- float mode_cutoff = ewp->block_mode_cutoff;
-
- // next, test mode #0. This mode uses 1 plane of weights and 1 partition.
- // we test it twice, first with a modecutoff of 0, then with the specified mode-cutoff.
- // This causes an early-out that speeds up encoding of "easy" content.
-
- float modecutoffs[2];
- float errorval_mult[2] = { 2.5, 1 };
- modecutoffs[0] = 0;
- modecutoffs[1] = mode_cutoff;
-
- #if 0
- if ((error_of_best_block / error_weight_sum) < ewp->texel_avg_error_limit)
- goto END_OF_TESTS;
- #endif
-
- float best_errorval_in_mode;
- for (i = 0; i < 2; i++)
- {
- compress_symbolic_block_fixed_partition_1_plane(decode_mode, modecutoffs[i], ewp->max_refinement_iters, xdim, ydim, zdim, 1, // partition count
- 0, // partition index
- blk, ewb, tempblocks, tmpbuf->plane1);
-
- best_errorval_in_mode = 1e30f;
- for (j = 0; j < 4; j++)
- {
- if (tempblocks[j].error_block)
- continue;
- decompress_symbolic_block(decode_mode, xdim, ydim, zdim, xpos, ypos, zpos, tempblocks + j, temp);
- float errorval = compute_imageblock_difference(xdim, ydim, zdim,
- blk, temp, ewb) * errorval_mult[i];
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("\n-----------------------------------\n");
- printf("Single-weight partition test 0 (1 partition) completed\n");
- printf("Resulting error value: %g\n", errorval);
- }
- #endif
-
- if (errorval < best_errorval_in_mode)
- best_errorval_in_mode = errorval;
-
- if (errorval < error_of_best_block)
- {
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Accepted as better than previous-best-error, which was %g\n", error_of_best_block);
- #endif
-
- error_of_best_block = errorval;
- *scb = tempblocks[j];
-
- // modesel = 0;
- }
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("-----------------------------------\n");
- }
- #endif
- }
-
- best_errorvals_in_modes[0] = best_errorval_in_mode;
- if ((error_of_best_block / error_weight_sum) < ewp->texel_avg_error_limit)
- goto END_OF_TESTS;
- }
-
- int is_normal_map;
- float lowest_correl;
- prepare_block_statistics(xdim, ydim, zdim, blk, ewb, &is_normal_map, &lowest_correl);
-
- if (is_normal_map && lowest_correl < 0.99f)
- lowest_correl = 0.99f;
-
- // next, test the four possible 1-partition, 2-planes modes
- for (i = 0; i < 4; i++)
- {
-
- if (lowest_correl > ewp->lowest_correlation_cutoff)
- continue;
-
- if (blk->grayscale && i != 3)
- continue;
-
- if (!uses_alpha && i == 3)
- continue;
-
- compress_symbolic_block_fixed_partition_2_planes(decode_mode, mode_cutoff, ewp->max_refinement_iters, xdim, ydim, zdim, 1, // partition count
- 0, // partition index
- i, // the color component to test a separate plane of weights for.
- blk, ewb, tempblocks, tmpbuf->planes2);
-
- best_errorval_in_mode = 1e30f;
- for (j = 0; j < 4; j++)
- {
- if (tempblocks[j].error_block)
- continue;
- decompress_symbolic_block(decode_mode, xdim, ydim, zdim, xpos, ypos, zpos, tempblocks + j, temp);
- float errorval = compute_imageblock_difference(xdim, ydim, zdim,
- blk, temp, ewb);
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("\n-----------------------------------\n");
- printf("Dual-weight partition test %d (1 partition) completed\n", i);
- printf("Resulting error value: %g\n", errorval);
- }
- #endif
-
- if (errorval < best_errorval_in_mode)
- best_errorval_in_mode = errorval;
-
- if (errorval < error_of_best_block)
- {
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Accepted as better than previous-best-error, which was %g\n", error_of_best_block);
- #endif
-
- error_of_best_block = errorval;
- *scb = tempblocks[j];
-
- // modesel = i+1;
- }
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("-----------------------------------\n");
- }
- #endif
-
- best_errorvals_in_modes[i + 1] = best_errorval_in_mode;
- }
-
- if ((error_of_best_block / error_weight_sum) < ewp->texel_avg_error_limit)
- goto END_OF_TESTS;
- }
-
- // find best blocks for 2, 3 and 4 partitions
- int partition_count;
- for (partition_count = 2; partition_count <= 4; partition_count++)
- {
- int partition_indices_1plane[2];
- int partition_indices_2planes[2];
-
- find_best_partitionings(ewp->partition_search_limit,
- xdim, ydim, zdim, partition_count, blk, ewb, 1,
- &(partition_indices_1plane[0]), &(partition_indices_1plane[1]), &(partition_indices_2planes[0]));
-
- for (i = 0; i < 2; i++)
- {
- compress_symbolic_block_fixed_partition_1_plane(decode_mode, mode_cutoff, ewp->max_refinement_iters, xdim, ydim, zdim, partition_count, partition_indices_1plane[i], blk, ewb, tempblocks, tmpbuf->plane1);
-
- best_errorval_in_mode = 1e30f;
- for (j = 0; j < 4; j++)
- {
- if (tempblocks[j].error_block)
- continue;
- decompress_symbolic_block(decode_mode, xdim, ydim, zdim, xpos, ypos, zpos, tempblocks + j, temp);
- float errorval = compute_imageblock_difference(xdim, ydim, zdim,
- blk, temp, ewb);
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("\n-----------------------------------\n");
- printf("Single-weight partition test %d (%d partitions) completed\n", i, partition_count);
- printf("Resulting error value: %g\n", errorval);
- }
- #endif
-
- if (errorval < best_errorval_in_mode)
- best_errorval_in_mode = errorval;
-
- if (errorval < error_of_best_block)
- {
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Accepted as better than previous-best-error, which was %g\n", error_of_best_block);
- #endif
-
- error_of_best_block = errorval;
- *scb = tempblocks[j];
-
- // modesel = 4*(partition_count-2) + 5 + i;
- }
- }
-
- best_errorvals_in_modes[4 * (partition_count - 2) + 5 + i] = best_errorval_in_mode;
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("-----------------------------------\n");
- }
- #endif
-
- if ((error_of_best_block / error_weight_sum) < ewp->texel_avg_error_limit)
- goto END_OF_TESTS;
- }
-
-
- if (partition_count == 2 && !is_normal_map && MIN(best_errorvals_in_modes[5], best_errorvals_in_modes[6]) > (best_errorvals_in_modes[0] * ewp->partition_1_to_2_limit))
- goto END_OF_TESTS;
-
- // don't bother to check 4 partitions for dual plane of weightss, ever.
- if (partition_count == 4)
- break;
-
- for (i = 0; i < 2; i++)
- {
- if (lowest_correl > ewp->lowest_correlation_cutoff)
- continue;
- compress_symbolic_block_fixed_partition_2_planes(decode_mode,
- mode_cutoff,
- ewp->max_refinement_iters,
- xdim, ydim, zdim,
- partition_count,
- partition_indices_2planes[i] & (PARTITION_COUNT - 1), partition_indices_2planes[i] >> PARTITION_BITS,
- blk, ewb, tempblocks, tmpbuf->planes2);
-
- best_errorval_in_mode = 1e30f;
- for (j = 0; j < 4; j++)
- {
- if (tempblocks[j].error_block)
- continue;
- decompress_symbolic_block(decode_mode, xdim, ydim, zdim, xpos, ypos, zpos, tempblocks + j, temp);
-
- float errorval = compute_imageblock_difference(xdim, ydim, zdim,
- blk, temp, ewb);
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("\n-----------------------------------\n");
- printf("Dual-weight partition test %d (%d partitions) completed\n", i, partition_count);
- printf("Resulting error value: %g\n", errorval);
- }
- #endif
-
- if (errorval < best_errorval_in_mode)
- best_errorval_in_mode = errorval;
-
- if (errorval < error_of_best_block)
- {
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Accepted as better than previous-best-error, which was %g\n", error_of_best_block);
- #endif
-
- error_of_best_block = errorval;
- *scb = tempblocks[j];
-
- // modesel = 4*(partition_count-2) + 5 + 2 + i;
- }
- }
-
- best_errorvals_in_modes[4 * (partition_count - 2) + 5 + 2 + i] = best_errorval_in_mode;
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("-----------------------------------\n");
- }
- #endif
-
- if ((error_of_best_block / error_weight_sum) < ewp->texel_avg_error_limit)
- goto END_OF_TESTS;
- }
- }
-
- END_OF_TESTS:
-
- #if 0
- if (print_statistics)
- {
- for (i = 0; i < 13; i++)
- printf("%f ", best_errorvals_in_modes[i]);
-
- printf("%d %f %f %f ", modesel, error_of_best_block,
- MIN(best_errorvals_in_modes[1], best_errorvals_in_modes[2]) / best_errorvals_in_modes[0],
- MIN(MIN(best_errorvals_in_modes[7], best_errorvals_in_modes[8]), best_errorvals_in_modes[9]) / best_errorvals_in_modes[0]);
-
- printf("\n");
- }
- #endif
-
- if (scb->block_mode >= 0)
- block_mode_histogram[scb->block_mode & 0x7ff]++;
-
-
- // compress/decompress to a physical block
- physical_compressed_block psb = symbolic_to_physical(xdim, ydim, zdim, scb);
- physical_to_symbolic(xdim, ydim, zdim, psb, scb);
-
-
- if (print_tile_errors)
- printf("%g\n", error_of_best_block);
-
-
- // mean squared error per color component.
- return error_of_best_block / ((float)xdim * ydim * zdim);
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_compute_variance.cpp b/3rdparty/bimg/3rdparty/astc/astc_compute_variance.cpp
deleted file mode 100644
index 782bd1dd021..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_compute_variance.cpp
+++ /dev/null
@@ -1,524 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief ASTC functions to calculate, for each pixel and each color component,
- * its variance within an NxN footprint; we want N to be parametric.
- *
- * The routine below uses summed area tables in order to perform the
- * computation in O(1) time per pixel, independent of big N is.
- */
-/*----------------------------------------------------------------------------*/
-
-#include "astc_codec_internals.h"
-
-#include <math.h>
-#include "mathlib.h"
-#include "softfloat.h"
-
-float4 *** input_averages;
-float *** input_alpha_averages;
-float4 *** input_variances;
-
-#include <stdio.h>
-
-// routine to compute averages and variances for a pixel region.
-// The routine computes both in a single pass, using a summed-area table
-// to decouple the running time from the averaging/variance kernel size.
-
-static void compute_pixel_region_variance(const astc_codec_image * img, float rgb_power_to_use, float alpha_power_to_use, swizzlepattern swz, int use_z_axis,
- int source_xoffset,int source_yoffset, int source_zoffset, // position of upper-left pixel in data set
- int xsize, int ysize, int zsize, // the size of the region to actually compute averages and variances for.
- int avg_var_kernel_radius, int alpha_kernel_radius,
- int dest_xoffset, int dest_yoffset, int dest_zoffset)
-{
- int x, y, z;
-
- int kernel_radius = MAX(avg_var_kernel_radius, alpha_kernel_radius);
- int kerneldim = 2 * kernel_radius + 1;
-
- // allocate memory
- int xpadsize = xsize + kerneldim;
- int ypadsize = ysize + kerneldim;
- int zpadsize = zsize + (use_z_axis ? kerneldim : 1);
-
- double4 ***varbuf1 = new double4 **[zpadsize];
- double4 ***varbuf2 = new double4 **[zpadsize];
- varbuf1[0] = new double4 *[ypadsize * zpadsize];
- varbuf2[0] = new double4 *[ypadsize * zpadsize];
- varbuf1[0][0] = new double4[xpadsize * ypadsize * zpadsize];
- varbuf2[0][0] = new double4[xpadsize * ypadsize * zpadsize];
-
-
- for (z = 1; z < zpadsize; z++)
- {
- varbuf1[z] = varbuf1[0] + ypadsize * z;
- varbuf2[z] = varbuf2[0] + ypadsize * z;
- varbuf1[z][0] = varbuf1[0][0] + xpadsize * ypadsize * z;
- varbuf2[z][0] = varbuf2[0][0] + xpadsize * ypadsize * z;
- }
-
- for (z = 0; z < zpadsize; z++)
- for (y = 1; y < ypadsize; y++)
- {
- varbuf1[z][y] = varbuf1[z][0] + xpadsize * y;
- varbuf2[z][y] = varbuf2[z][0] + xpadsize * y;
- }
-
- int powers_are_1 = (rgb_power_to_use == 1.0f) && (alpha_power_to_use == 1.0f);
-
-
- // load x and x^2 values into the allocated buffers
- if (img->imagedata8)
- {
- uint8_t data[6];
- data[4] = 0;
- data[5] = 255;
-
- for (z = 0; z < zpadsize - 1; z++)
- {
- int z_src = z + source_zoffset - (use_z_axis ? kernel_radius : 0);
- for (y = 0; y < ypadsize - 1; y++)
- {
- int y_src = y + source_yoffset - kernel_radius;
- for (x = 0; x < xpadsize - 1; x++)
- {
- int x_src = x + source_xoffset - kernel_radius;
- data[0] = img->imagedata8[z_src][y_src][4 * x_src + 0];
- data[1] = img->imagedata8[z_src][y_src][4 * x_src + 1];
- data[2] = img->imagedata8[z_src][y_src][4 * x_src + 2];
- data[3] = img->imagedata8[z_src][y_src][4 * x_src + 3];
-
- uint8_t r = data[swz.r];
- uint8_t g = data[swz.g];
- uint8_t b = data[swz.b];
- uint8_t a = data[swz.a];
-
- double4 d = double4(r * (1.0 / 255.0),
- g * (1.0 / 255.0),
- b * (1.0 / 255.0),
- a * (1.0 / 255.0));
-
- if (perform_srgb_transform)
- {
- d.x = (d.x <= 0.04045) ? d.x * (1.0 / 12.92) : (d.x <= 1) ? pow((d.x + 0.055) * (1.0 / 1.055), 2.4) : d.x;
- d.y = (d.y <= 0.04045) ? d.y * (1.0 / 12.92) : (d.y <= 1) ? pow((d.y + 0.055) * (1.0 / 1.055), 2.4) : d.y;
- d.z = (d.z <= 0.04045) ? d.z * (1.0 / 12.92) : (d.z <= 1) ? pow((d.z + 0.055) * (1.0 / 1.055), 2.4) : d.z;
- }
-
- if (!powers_are_1)
- {
- d.x = pow(MAX(d.x, 1e-6), (double)rgb_power_to_use);
- d.y = pow(MAX(d.y, 1e-6), (double)rgb_power_to_use);
- d.z = pow(MAX(d.z, 1e-6), (double)rgb_power_to_use);
- d.w = pow(MAX(d.w, 1e-6), (double)alpha_power_to_use);
- }
-
- varbuf1[z][y][x] = d;
- varbuf2[z][y][x] = d * d;
- }
- }
- }
- }
- else
- {
- uint16_t data[6];
- data[4] = 0;
- data[5] = 0x3C00; // 1.0 encoded as FP16.
-
- for (z = 0; z < zpadsize - 1; z++)
- {
- int z_src = z + source_zoffset - (use_z_axis ? kernel_radius : 0);
- for (y = 0; y < ypadsize - 1; y++)
- {
- int y_src = y + source_yoffset - kernel_radius;
- for (x = 0; x < xpadsize - 1; x++)
- {
- int x_src = x + source_xoffset - kernel_radius;
- data[0] = img->imagedata16[z_src][y_src][4 * x_src];
- data[1] = img->imagedata16[z_src][y_src][4 * x_src + 1];
- data[2] = img->imagedata16[z_src][y_src][4 * x_src + 2];
- data[3] = img->imagedata16[z_src][y_src][4 * x_src + 3];
-
- uint16_t r = data[swz.r];
- uint16_t g = data[swz.g];
- uint16_t b = data[swz.b];
- uint16_t a = data[swz.a];
-
- double4 d = double4(sf16_to_float(r),
- sf16_to_float(g),
- sf16_to_float(b),
- sf16_to_float(a));
-
- if (perform_srgb_transform)
- {
- d.x = (d.x <= 0.04045) ? d.x * (1.0 / 12.92) : (d.x <= 1) ? pow((d.x + 0.055) * (1.0 / 1.055), 2.4) : d.x;
- d.y = (d.y <= 0.04045) ? d.y * (1.0 / 12.92) : (d.y <= 1) ? pow((d.y + 0.055) * (1.0 / 1.055), 2.4) : d.y;
- d.z = (d.z <= 0.04045) ? d.z * (1.0 / 12.92) : (d.z <= 1) ? pow((d.z + 0.055) * (1.0 / 1.055), 2.4) : d.z;
- }
-
- if (!powers_are_1)
- {
- d.x = pow(MAX(d.x, 1e-6), (double)rgb_power_to_use);
- d.y = pow(MAX(d.y, 1e-6), (double)rgb_power_to_use);
- d.z = pow(MAX(d.z, 1e-6), (double)rgb_power_to_use);
- d.w = pow(MAX(d.w, 1e-6), (double)alpha_power_to_use);
- }
-
- varbuf1[z][y][x] = d;
- varbuf2[z][y][x] = d * d;
- }
- }
- }
- }
-
-
-
- // pad out buffers with 0s
- for (z = 0; z < zpadsize; z++)
- {
- for (y = 0; y < ypadsize; y++)
- {
- varbuf1[z][y][xpadsize - 1] = double4(0.0, 0.0, 0.0, 0.0);
- varbuf2[z][y][xpadsize - 1] = double4(0.0, 0.0, 0.0, 0.0);
- }
- for (x = 0; x < xpadsize; x++)
- {
- varbuf1[z][ypadsize - 1][x] = double4(0.0, 0.0, 0.0, 0.0);
- varbuf2[z][ypadsize - 1][x] = double4(0.0, 0.0, 0.0, 0.0);
- }
- }
-
- if (use_z_axis)
- for (y = 0; y < ypadsize; y++)
- for (x = 0; x < xpadsize; x++)
- {
- varbuf1[zpadsize - 1][y][x] = double4(0.0, 0.0, 0.0, 0.0);
- varbuf2[zpadsize - 1][y][x] = double4(0.0, 0.0, 0.0, 0.0);
- }
-
-
- // generate summed-area tables for x and x2; this is done in-place
- for (z = 0; z < zpadsize; z++)
- for (y = 0; y < ypadsize; y++)
- {
- double4 summa1 = double4(0.0, 0.0, 0.0, 0.0);
- double4 summa2 = double4(0.0, 0.0, 0.0, 0.0);
- for (x = 0; x < xpadsize; x++)
- {
- double4 val1 = varbuf1[z][y][x];
- double4 val2 = varbuf2[z][y][x];
- varbuf1[z][y][x] = summa1;
- varbuf2[z][y][x] = summa2;
- summa1 = summa1 + val1;
- summa2 = summa2 + val2;
- }
- }
-
- for (z = 0; z < zpadsize; z++)
- for (x = 0; x < xpadsize; x++)
- {
- double4 summa1 = double4(0.0, 0.0, 0.0, 0.0);
- double4 summa2 = double4(0.0, 0.0, 0.0, 0.0);
- for (y = 0; y < ypadsize; y++)
- {
- double4 val1 = varbuf1[z][y][x];
- double4 val2 = varbuf2[z][y][x];
- varbuf1[z][y][x] = summa1;
- varbuf2[z][y][x] = summa2;
- summa1 = summa1 + val1;
- summa2 = summa2 + val2;
- }
- }
-
- if (use_z_axis)
- for (y = 0; y < ypadsize; y++)
- for (x = 0; x < xpadsize; x++)
- {
- double4 summa1 = double4(0.0, 0.0, 0.0, 0.0);
- double4 summa2 = double4(0.0, 0.0, 0.0, 0.0);
- for (z = 0; z < zpadsize; z++)
- {
- double4 val1 = varbuf1[z][y][x];
- double4 val2 = varbuf2[z][y][x];
- varbuf1[z][y][x] = summa1;
- varbuf2[z][y][x] = summa2;
- summa1 = summa1 + val1;
- summa2 = summa2 + val2;
- }
- }
-
-
- int avg_var_kerneldim = 2 * avg_var_kernel_radius + 1;
- int alpha_kerneldim = 2 * alpha_kernel_radius + 1;
-
-
- // compute a few constants used in the variance-calculation.
- double avg_var_samples;
- double alpha_rsamples;
- double mul1;
-
- if (use_z_axis)
- {
- avg_var_samples = avg_var_kerneldim * avg_var_kerneldim * avg_var_kerneldim;
- alpha_rsamples = 1.0 / (alpha_kerneldim * alpha_kerneldim * alpha_kerneldim);
- }
- else
- {
- avg_var_samples = avg_var_kerneldim * avg_var_kerneldim;
- alpha_rsamples = 1.0 / (alpha_kerneldim * alpha_kerneldim);
- }
-
-
- double avg_var_rsamples = 1.0 / avg_var_samples;
- if (avg_var_samples == 1)
- mul1 = 1.0;
- else
- mul1 = 1.0 / (avg_var_samples * (avg_var_samples - 1));
-
-
- double mul2 = avg_var_samples * mul1;
-
-
- // use the summed-area tables to compute variance for each sample-neighborhood
- if (use_z_axis)
- {
- for (z = 0; z < zsize; z++)
- {
- int z_src = z + kernel_radius;
- int z_dst = z + dest_zoffset;
- for (y = 0; y < ysize; y++)
- {
- int y_src = y + kernel_radius;
- int y_dst = y + dest_yoffset;
-
- for (x = 0; x < xsize; x++)
- {
- int x_src = x + kernel_radius;
- int x_dst = x + dest_xoffset;
-
- // summed-area table lookups for alpha average
- double vasum =
- (varbuf1[z_src + 1][y_src - alpha_kernel_radius][x_src - alpha_kernel_radius].w
- - varbuf1[z_src + 1][y_src - alpha_kernel_radius][x_src + alpha_kernel_radius + 1].w
- - varbuf1[z_src + 1][y_src + alpha_kernel_radius + 1][x_src - alpha_kernel_radius].w
- + varbuf1[z_src + 1][y_src + alpha_kernel_radius + 1][x_src + alpha_kernel_radius + 1].w) -
- (varbuf1[z_src][y_src - alpha_kernel_radius][x_src - alpha_kernel_radius].w
- - varbuf1[z_src][y_src - alpha_kernel_radius][x_src + alpha_kernel_radius + 1].w
- - varbuf1[z_src][y_src + alpha_kernel_radius + 1][x_src - alpha_kernel_radius].w + varbuf1[z_src][y_src + alpha_kernel_radius + 1][x_src + alpha_kernel_radius + 1].w);
- input_alpha_averages[z_dst][y_dst][x_dst] = static_cast < float >(vasum * alpha_rsamples);
-
-
- // summed-area table lookups for RGBA average
- double4 v0sum =
- (varbuf1[z_src + 1][y_src - avg_var_kernel_radius][x_src - avg_var_kernel_radius]
- - varbuf1[z_src + 1][y_src - avg_var_kernel_radius][x_src + avg_var_kernel_radius + 1]
- - varbuf1[z_src + 1][y_src + avg_var_kernel_radius + 1][x_src - avg_var_kernel_radius]
- + varbuf1[z_src + 1][y_src + avg_var_kernel_radius + 1][x_src + avg_var_kernel_radius + 1]) -
- (varbuf1[z_src][y_src - avg_var_kernel_radius][x_src - avg_var_kernel_radius]
- - varbuf1[z_src][y_src - avg_var_kernel_radius][x_src + avg_var_kernel_radius + 1]
- - varbuf1[z_src][y_src + avg_var_kernel_radius + 1][x_src - avg_var_kernel_radius] + varbuf1[z_src][y_src + avg_var_kernel_radius + 1][x_src + avg_var_kernel_radius + 1]);
-
- double4 avg = v0sum * avg_var_rsamples;
-
- float4 favg = float4(static_cast < float >(avg.x),
- static_cast < float >(avg.y),
- static_cast < float >(avg.z),
- static_cast < float >(avg.w));
- input_averages[z_dst][y_dst][x_dst] = favg;
-
-
- // summed-area table lookups for variance
- double4 v1sum =
- (varbuf1[z_src + 1][y_src - avg_var_kernel_radius][x_src - avg_var_kernel_radius]
- - varbuf1[z_src + 1][y_src - avg_var_kernel_radius][x_src + avg_var_kernel_radius + 1]
- - varbuf1[z_src + 1][y_src + avg_var_kernel_radius + 1][x_src - avg_var_kernel_radius]
- + varbuf1[z_src + 1][y_src + avg_var_kernel_radius + 1][x_src + avg_var_kernel_radius + 1]) -
- (varbuf1[z_src][y_src - avg_var_kernel_radius][x_src - avg_var_kernel_radius]
- - varbuf1[z_src][y_src - avg_var_kernel_radius][x_src + avg_var_kernel_radius + 1]
- - varbuf1[z_src][y_src + avg_var_kernel_radius + 1][x_src - avg_var_kernel_radius] + varbuf1[z_src][y_src + avg_var_kernel_radius + 1][x_src + avg_var_kernel_radius + 1]);
- double4 v2sum =
- (varbuf2[z_src + 1][y_src - avg_var_kernel_radius][x_src - avg_var_kernel_radius]
- - varbuf2[z_src + 1][y_src - avg_var_kernel_radius][x_src + avg_var_kernel_radius + 1]
- - varbuf2[z_src + 1][y_src + avg_var_kernel_radius + 1][x_src - avg_var_kernel_radius]
- + varbuf2[z_src + 1][y_src + avg_var_kernel_radius + 1][x_src + avg_var_kernel_radius + 1]) -
- (varbuf2[z_src][y_src - avg_var_kernel_radius][x_src - avg_var_kernel_radius]
- - varbuf2[z_src][y_src - avg_var_kernel_radius][x_src + avg_var_kernel_radius + 1]
- - varbuf2[z_src][y_src + avg_var_kernel_radius + 1][x_src - avg_var_kernel_radius] + varbuf2[z_src][y_src + avg_var_kernel_radius + 1][x_src + avg_var_kernel_radius + 1]);
-
- // the actual variance
- double4 variance = mul2 * v2sum - mul1 * (v1sum * v1sum);
-
- float4 fvar = float4(static_cast < float >(variance.x),
- static_cast < float >(variance.y),
- static_cast < float >(variance.z),
- static_cast < float >(variance.w));
- input_variances[z_dst][y_dst][x_dst] = fvar;
- }
- }
- }
- }
- else
- {
- for (z = 0; z < zsize; z++)
- {
- int z_src = z;
- int z_dst = z + dest_zoffset;
- for (y = 0; y < ysize; y++)
- {
- int y_src = y + kernel_radius;
- int y_dst = y + dest_yoffset;
-
- for (x = 0; x < xsize; x++)
- {
- int x_src = x + kernel_radius;
- int x_dst = x + dest_xoffset;
-
- // summed-area table lookups for alpha average
- double vasum =
- varbuf1[z_src][y_src - alpha_kernel_radius][x_src - alpha_kernel_radius].w
- - varbuf1[z_src][y_src - alpha_kernel_radius][x_src + alpha_kernel_radius + 1].w
- - varbuf1[z_src][y_src + alpha_kernel_radius + 1][x_src - alpha_kernel_radius].w + varbuf1[z_src][y_src + alpha_kernel_radius + 1][x_src + alpha_kernel_radius + 1].w;
- input_alpha_averages[z_dst][y_dst][x_dst] = static_cast < float >(vasum * alpha_rsamples);
-
-
- // summed-area table lookups for RGBA average
- double4 v0sum =
- varbuf1[z_src][y_src - avg_var_kernel_radius][x_src - avg_var_kernel_radius]
- - varbuf1[z_src][y_src - avg_var_kernel_radius][x_src + avg_var_kernel_radius + 1]
- - varbuf1[z_src][y_src + avg_var_kernel_radius + 1][x_src - avg_var_kernel_radius] + varbuf1[z_src][y_src + avg_var_kernel_radius + 1][x_src + avg_var_kernel_radius + 1];
-
- double4 avg = v0sum * avg_var_rsamples;
-
- float4 favg = float4(static_cast < float >(avg.x),
- static_cast < float >(avg.y),
- static_cast < float >(avg.z),
- static_cast < float >(avg.w));
- input_averages[z_dst][y_dst][x_dst] = favg;
-
-
- // summed-area table lookups for variance
- double4 v1sum =
- varbuf1[z_src][y_src - avg_var_kernel_radius][x_src - avg_var_kernel_radius]
- - varbuf1[z_src][y_src - avg_var_kernel_radius][x_src + avg_var_kernel_radius + 1]
- - varbuf1[z_src][y_src + avg_var_kernel_radius + 1][x_src - avg_var_kernel_radius] + varbuf1[z_src][y_src + avg_var_kernel_radius + 1][x_src + avg_var_kernel_radius + 1];
- double4 v2sum =
- varbuf2[z_src][y_src - avg_var_kernel_radius][x_src - avg_var_kernel_radius]
- - varbuf2[z_src][y_src - avg_var_kernel_radius][x_src + avg_var_kernel_radius + 1]
- - varbuf2[z_src][y_src + avg_var_kernel_radius + 1][x_src - avg_var_kernel_radius] + varbuf2[z_src][y_src + avg_var_kernel_radius + 1][x_src + avg_var_kernel_radius + 1];
-
- // the actual variance
- double4 variance = mul2 * v2sum - mul1 * (v1sum * v1sum);
-
- float4 fvar = float4(static_cast < float >(variance.x),
- static_cast < float >(variance.y),
- static_cast < float >(variance.z),
- static_cast < float >(variance.w));
- input_variances[z_dst][y_dst][x_dst] = fvar;
- }
- }
- }
- }
- delete[]varbuf2[0][0];
- delete[]varbuf1[0][0];
- delete[]varbuf2[0];
- delete[]varbuf1[0];
- delete[]varbuf2;
- delete[]varbuf1;
-}
-
-
-static void allocate_input_average_and_variance_buffers(int xsize, int ysize, int zsize)
-{
- int y, z;
- if (input_averages)
- {
- delete[]input_averages[0][0];
- delete[]input_averages[0];
- delete[]input_averages;
- }
- if (input_variances)
- {
- delete[]input_variances[0][0];
- delete[]input_variances[0];
- delete[]input_variances;
- }
- if (input_alpha_averages)
- {
- delete[]input_alpha_averages[0][0];
- delete[]input_alpha_averages[0];
- delete[]input_alpha_averages;
- }
-
- input_averages = new float4 **[zsize];
- input_variances = new float4 **[zsize];
- input_alpha_averages = new float **[zsize];
-
-
- input_averages[0] = new float4 *[ysize * zsize];
- input_variances[0] = new float4 *[ysize * zsize];
- input_alpha_averages[0] = new float *[ysize * zsize];
-
- input_averages[0][0] = new float4[xsize * ysize * zsize];
- input_variances[0][0] = new float4[xsize * ysize * zsize];
- input_alpha_averages[0][0] = new float[xsize * ysize * zsize];
-
- for (z = 1; z < zsize; z++)
- {
- input_averages[z] = input_averages[0] + z * ysize;
- input_variances[z] = input_variances[0] + z * ysize;
- input_alpha_averages[z] = input_alpha_averages[0] + z * ysize;
-
- input_averages[z][0] = input_averages[0][0] + z * ysize * xsize;
- input_variances[z][0] = input_variances[0][0] + z * ysize * xsize;
- input_alpha_averages[z][0] = input_alpha_averages[0][0] + z * ysize * xsize;
- }
-
- for (z = 0; z < zsize; z++)
- for (y = 1; y < ysize; y++)
- {
- input_averages[z][y] = input_averages[z][0] + y * xsize;
- input_variances[z][y] = input_variances[z][0] + y * xsize;
- input_alpha_averages[z][y] = input_alpha_averages[z][0] + y * xsize;
- }
-
-}
-
-
-// compute averages and variances for the current input image.
-void compute_averages_and_variances(const astc_codec_image * img, float rgb_power_to_use, float alpha_power_to_use, int avg_var_kernel_radius, int alpha_kernel_radius, swizzlepattern swz)
-{
- int xsize = img->xsize;
- int ysize = img->ysize;
- int zsize = img->zsize;
- allocate_input_average_and_variance_buffers(xsize, ysize, zsize);
-
-
- int x, y, z;
- for (z = 0; z < zsize; z += 32)
- {
- int zblocksize = MIN(32, zsize - z);
- for (y = 0; y < ysize; y += 32)
- {
- int yblocksize = MIN(32, ysize - y);
- for (x = 0; x < xsize; x += 32)
- {
- int xblocksize = MIN(32, xsize - x);
- compute_pixel_region_variance(img,
- rgb_power_to_use,
- alpha_power_to_use,
- swz,
- (zsize > 1),
- x + img->padding,
- y + img->padding, z + (zsize > 1 ? img->padding : 0), xblocksize, yblocksize, zblocksize, avg_var_kernel_radius, alpha_kernel_radius, x, y, z);
- }
- }
- }
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_decompress_symbolic.cpp b/3rdparty/bimg/3rdparty/astc/astc_decompress_symbolic.cpp
deleted file mode 100644
index 89ff3441b30..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_decompress_symbolic.cpp
+++ /dev/null
@@ -1,317 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Decompress a block of colors, expressed as a symbolic block,
- * for ASTC.
- */
-/*----------------------------------------------------------------------------*/
-
-#include <math.h>
-
-#include "astc_codec_internals.h"
-
-#include "softfloat.h"
-#include <stdio.h>
-
-int compute_value_of_texel_int(int texel_to_get, const decimation_table * it, const int *weights)
-{
- int i;
- int summed_value = 8;
- int weights_to_evaluate = it->texel_num_weights[texel_to_get];
- for (i = 0; i < weights_to_evaluate; i++)
- {
- summed_value += weights[it->texel_weights[texel_to_get][i]] * it->texel_weights_int[texel_to_get][i];
- }
- return summed_value >> 4;
-}
-
-
-ushort4 lerp_color_int(astc_decode_mode decode_mode, ushort4 color0, ushort4 color1, int weight, int plane2_weight, int plane2_color_component // -1 in 1-plane mode
- )
-{
- int4 ecolor0 = int4(color0.x, color0.y, color0.z, color0.w);
- int4 ecolor1 = int4(color1.x, color1.y, color1.z, color1.w);
-
- int4 eweight1 = int4(weight, weight, weight, weight);
- switch (plane2_color_component)
- {
- case 0:
- eweight1.x = plane2_weight;
- break;
- case 1:
- eweight1.y = plane2_weight;
- break;
- case 2:
- eweight1.z = plane2_weight;
- break;
- case 3:
- eweight1.w = plane2_weight;
- break;
- default:
- break;
- }
-
- int4 eweight0 = int4(64, 64, 64, 64) - eweight1;
-
- if (decode_mode == DECODE_LDR_SRGB)
- {
- ecolor0 = ecolor0 >> 8;
- ecolor1 = ecolor1 >> 8;
- }
- int4 color = (ecolor0 * eweight0) + (ecolor1 * eweight1) + int4(32, 32, 32, 32);
- color = color >> 6;
- if (decode_mode == DECODE_LDR_SRGB)
- color = color | (color << 8);
-
- ushort4 rcolor = ushort4(color.x, color.y, color.z, color.w);
- return rcolor;
-}
-
-
-void decompress_symbolic_block(astc_decode_mode decode_mode,
- int xdim, int ydim, int zdim, // dimensions of block
- int xpos, int ypos, int zpos, // position of block
- const symbolic_compressed_block * scb, imageblock * blk)
-{
- blk->xpos = xpos;
- blk->ypos = ypos;
- blk->zpos = zpos;
-
- int i;
-
- // if we detected an error-block, blow up immediately.
- if (scb->error_block)
- {
- if (decode_mode == DECODE_LDR_SRGB)
- {
- for (i = 0; i < xdim * ydim * zdim; i++)
- {
- blk->orig_data[4 * i] = 1.0f;
- blk->orig_data[4 * i + 1] = 0.0f;
- blk->orig_data[4 * i + 2] = 1.0f;
- blk->orig_data[4 * i + 3] = 1.0f;
- blk->rgb_lns[i] = 0;
- blk->alpha_lns[i] = 0;
- blk->nan_texel[i] = 0;
- }
- }
- else
- {
- for (i = 0; i < xdim * ydim * zdim; i++)
- {
- blk->orig_data[4 * i] = 0.0f;
- blk->orig_data[4 * i + 1] = 0.0f;
- blk->orig_data[4 * i + 2] = 0.0f;
- blk->orig_data[4 * i + 3] = 0.0f;
- blk->rgb_lns[i] = 0;
- blk->alpha_lns[i] = 0;
- blk->nan_texel[i] = 1;
- }
- }
-
- imageblock_initialize_work_from_orig(blk, xdim * ydim * zdim);
- update_imageblock_flags(blk, xdim, ydim, zdim);
- return;
- }
-
-
-
-
- if (scb->block_mode < 0)
- {
- float red = 0, green = 0, blue = 0, alpha = 0;
- int use_lns = 0;
- int use_nan = 0;
-
- if (scb->block_mode == -2)
- {
- // For sRGB decoding, we should return only the top 8 bits.
- int mask = (decode_mode == DECODE_LDR_SRGB) ? 0xFF00 : 0xFFFF;
-
- red = sf16_to_float(unorm16_to_sf16(scb->constant_color[0] & mask));
- green = sf16_to_float(unorm16_to_sf16(scb->constant_color[1] & mask));
- blue = sf16_to_float(unorm16_to_sf16(scb->constant_color[2] & mask));
- alpha = sf16_to_float(unorm16_to_sf16(scb->constant_color[3] & mask));
- use_lns = 0;
- use_nan = 0;
- }
- else
- {
- switch (decode_mode)
- {
- case DECODE_LDR_SRGB:
- red = 1.0f;
- green = 0.0f;
- blue = 1.0f;
- alpha = 1.0f;
- use_lns = 0;
- use_nan = 0;
- break;
- case DECODE_LDR:
- red = 0.0f;
- green = 0.0f;
- blue = 0.0f;
- alpha = 0.0f;
- use_lns = 0;
- use_nan = 1;
- break;
- case DECODE_HDR:
- // constant-color block; unpack from FP16 to FP32.
- red = sf16_to_float(scb->constant_color[0]);
- green = sf16_to_float(scb->constant_color[1]);
- blue = sf16_to_float(scb->constant_color[2]);
- alpha = sf16_to_float(scb->constant_color[3]);
- use_lns = 1;
- use_nan = 0;
- break;
- }
- }
-
- for (i = 0; i < xdim * ydim * zdim; i++)
- {
- blk->orig_data[4 * i] = red;
- blk->orig_data[4 * i + 1] = green;
- blk->orig_data[4 * i + 2] = blue;
- blk->orig_data[4 * i + 3] = alpha;
- blk->rgb_lns[i] = use_lns;
- blk->alpha_lns[i] = use_lns;
- blk->nan_texel[i] = use_nan;
- }
-
-
- imageblock_initialize_work_from_orig(blk, xdim * ydim * zdim);
- update_imageblock_flags(blk, xdim, ydim, zdim);
- return;
- }
-
-
- // get the appropriate partition-table entry
- int partition_count = scb->partition_count;
- const partition_info *pt = get_partition_table(xdim, ydim, zdim, partition_count);
- pt += scb->partition_index;
-
- // get the appropriate block descriptor
- const block_size_descriptor *bsd = get_block_size_descriptor(xdim, ydim, zdim);
- const decimation_table *const *ixtab2 = bsd->decimation_tables;
-
-
- const decimation_table *it = ixtab2[bsd->block_modes[scb->block_mode].decimation_mode];
-
- int is_dual_plane = bsd->block_modes[scb->block_mode].is_dual_plane;
-
- int weight_quantization_level = bsd->block_modes[scb->block_mode].quantization_mode;
-
-
- // decode the color endpoints
- ushort4 color_endpoint0[4];
- ushort4 color_endpoint1[4];
- int rgb_hdr_endpoint[4];
- int alpha_hdr_endpoint[4];
- int nan_endpoint[4];
-
- for (i = 0; i < partition_count; i++)
- unpack_color_endpoints(decode_mode,
- scb->color_formats[i],
- scb->color_quantization_level, scb->color_values[i], &(rgb_hdr_endpoint[i]), &(alpha_hdr_endpoint[i]), &(nan_endpoint[i]), &(color_endpoint0[i]), &(color_endpoint1[i]));
-
-
-
-
-
- // first unquantize the weights
- int uq_plane1_weights[MAX_WEIGHTS_PER_BLOCK];
- int uq_plane2_weights[MAX_WEIGHTS_PER_BLOCK];
- int weight_count = it->num_weights;
-
-
- const quantization_and_transfer_table *qat = &(quant_and_xfer_tables[weight_quantization_level]);
-
- for (i = 0; i < weight_count; i++)
- {
- uq_plane1_weights[i] = qat->unquantized_value[scb->plane1_weights[i]];
- }
- if (is_dual_plane)
- {
- for (i = 0; i < weight_count; i++)
- uq_plane2_weights[i] = qat->unquantized_value[scb->plane2_weights[i]];
- }
-
-
- // then undecimate them.
- int weights[MAX_TEXELS_PER_BLOCK];
- int plane2_weights[MAX_TEXELS_PER_BLOCK];
-
-
- int texels_per_block = xdim * ydim * zdim;
- for (i = 0; i < texels_per_block; i++)
- weights[i] = compute_value_of_texel_int(i, it, uq_plane1_weights);
-
- if (is_dual_plane)
- for (i = 0; i < texels_per_block; i++)
- plane2_weights[i] = compute_value_of_texel_int(i, it, uq_plane2_weights);
-
-
- int plane2_color_component = scb->plane2_color_component;
-
-
- // now that we have endpoint colors and weights, we can unpack actual colors for
- // each texel.
- for (i = 0; i < texels_per_block; i++)
- {
- int partition = pt->partition_of_texel[i];
-
- ushort4 color = lerp_color_int(decode_mode,
- color_endpoint0[partition],
- color_endpoint1[partition],
- weights[i],
- plane2_weights[i],
- is_dual_plane ? plane2_color_component : -1);
-
- blk->rgb_lns[i] = rgb_hdr_endpoint[partition];
- blk->alpha_lns[i] = alpha_hdr_endpoint[partition];
- blk->nan_texel[i] = nan_endpoint[partition];
-
- blk->work_data[4 * i] = color.x;
- blk->work_data[4 * i + 1] = color.y;
- blk->work_data[4 * i + 2] = color.z;
- blk->work_data[4 * i + 3] = color.w;
- }
-
- imageblock_initialize_orig_from_work(blk, xdim * ydim * zdim);
-
- update_imageblock_flags(blk, xdim, ydim, zdim);
-}
-
-
-
-float compute_imageblock_difference(int xdim, int ydim, int zdim, const imageblock * p1, const imageblock * p2, const error_weight_block * ewb)
-{
- int i;
- int texels_per_block = xdim * ydim * zdim;
- float summa = 0.0f;
- const float *f1 = p1->work_data;
- const float *f2 = p2->work_data;
- for (i = 0; i < texels_per_block; i++)
- {
- float rdiff = fabsf(f1[4 * i] - f2[4 * i]);
- float gdiff = fabs(f1[4 * i + 1] - f2[4 * i + 1]);
- float bdiff = fabs(f1[4 * i + 2] - f2[4 * i + 2]);
- float adiff = fabs(f1[4 * i + 3] - f2[4 * i + 3]);
- rdiff = MIN(rdiff, 1e15f);
- gdiff = MIN(gdiff, 1e15f);
- bdiff = MIN(bdiff, 1e15f);
- adiff = MIN(adiff, 1e15f);
-
- summa += rdiff * rdiff * ewb->error_weights[i].x + gdiff * gdiff * ewb->error_weights[i].y + bdiff * bdiff * ewb->error_weights[i].z + adiff * adiff * ewb->error_weights[i].w;
- }
-
- return summa;
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_encoding_choice_error.cpp b/3rdparty/bimg/3rdparty/astc/astc_encoding_choice_error.cpp
deleted file mode 100644
index 5da893bb44b..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_encoding_choice_error.cpp
+++ /dev/null
@@ -1,310 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Determine color errors for ASTC compression.
- *
- * We assume that there are two independent sources of color error in
- * any given partition.
- *
- * These are:
- * * quantization errors
- * * encoding choice errors
- *
- * Encoding choice errors are errors that come due to encoding choice,
- * such as:
- * * using luminance instead of RGB
- * * using RGB-scale instead of two RGB endpoints.
- * * dropping Alpha
- *
- * Quantization errors occur due to the limited precision we use for
- * storing numbers.
- *
- * Quantization errors generally scale with quantization level, but are
- * not actually independent of color encoding. In particular:
- * * if we can use offset encoding then quantization error is halved.
- * * if we can use blue-contraction, quantization error for red and
- * green is halved.
- * * quantization error is higher for the HDR endpoint modes.
- *
- * Other than these errors, quantization error is assumed to be
- * proportional to the quantization step.
- */
-/*----------------------------------------------------------------------------*/
-
-#include "astc_codec_internals.h"
-
-#include <math.h>
-
-#ifdef DEBUG_PRINT_DIAGNOSTICS
- #include <stdio.h>
-#endif
-
-// helper function to merge two endpoint-colors
-void merge_endpoints(const endpoints * ep1, // contains three of the color components
- const endpoints * ep2, // contains the remaining color component
- int separate_component, endpoints * res)
-{
- int i;
- int partition_count = ep1->partition_count;
- res->partition_count = partition_count;
- for (i = 0; i < partition_count; i++)
- {
- res->endpt0[i] = ep1->endpt0[i];
- res->endpt1[i] = ep1->endpt1[i];
- }
-
- switch (separate_component)
- {
- case 0:
- for (i = 0; i < partition_count; i++)
- {
- res->endpt0[i].x = ep2->endpt0[i].x;
- res->endpt1[i].x = ep2->endpt1[i].x;
- }
- break;
- case 1:
- for (i = 0; i < partition_count; i++)
- {
- res->endpt0[i].y = ep2->endpt0[i].y;
- res->endpt1[i].y = ep2->endpt1[i].y;
- }
- break;
- case 2:
- for (i = 0; i < partition_count; i++)
- {
- res->endpt0[i].z = ep2->endpt0[i].z;
- res->endpt1[i].z = ep2->endpt1[i].z;
- }
- break;
- case 3:
- for (i = 0; i < partition_count; i++)
- {
- res->endpt0[i].w = ep2->endpt0[i].w;
- res->endpt1[i].w = ep2->endpt1[i].w;
- }
- break;
- }
-}
-
-
-
-/*
- for a given set of input colors and a given partitioning, determine: color error that results
- from RGB-scale encoding (relevant for LDR only) color error that results from RGB-lumashift encoding
- (relevant for HDR only) color error that results from luminance-encoding color error that results
- form dropping alpha. whether we are eligible for offset encoding whether we are eligible for
- blue-contraction
-
- The input data are: color data partitioning error-weight data
- */
-
-
-void compute_encoding_choice_errors(int xdim, int ydim, int zdim, const imageblock * pb, const partition_info * pi, const error_weight_block * ewb,
- int separate_component, // component that is separated out in 2-plane mode, -1 in 1-plane mode
- encoding_choice_errors * eci)
-{
- int i;
-
- int partition_count = pi->partition_count;
-
- int texels_per_block = xdim * ydim * zdim;
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("%s : texels-per-block=%dx%dx%d, separate_component=%d, partition-count=%d\n", __func__, xdim, ydim, zdim, separate_component, partition_count);
- }
- #endif
-
- float3 averages[4];
- float3 directions_rgb[4];
- float2 directions_rg[4];
- float2 directions_rb[4];
- float2 directions_gb[4];
-
- float4 error_weightings[4];
- float4 color_scalefactors[4];
- float4 inverse_color_scalefactors[4];
-
- compute_partition_error_color_weightings(xdim, ydim, zdim, ewb, pi, error_weightings, color_scalefactors);
-
- compute_averages_and_directions_rgb(pi, pb, ewb, color_scalefactors, averages, directions_rgb, directions_rg, directions_rb, directions_gb);
-
- line3 uncorr_rgb_lines[4];
- line3 samechroma_rgb_lines[4]; // for LDR-RGB-scale
- line3 rgb_luma_lines[4]; // for HDR-RGB-scale
- line3 luminance_lines[4];
-
- processed_line3 proc_uncorr_rgb_lines[4];
- processed_line3 proc_samechroma_rgb_lines[4]; // for LDR-RGB-scale
- processed_line3 proc_rgb_luma_lines[4]; // for HDR-RGB-scale
- processed_line3 proc_luminance_lines[4];
-
-
- for (i = 0; i < partition_count; i++)
- {
- inverse_color_scalefactors[i].x = 1.0f / MAX(color_scalefactors[i].x, 1e-7f);
- inverse_color_scalefactors[i].y = 1.0f / MAX(color_scalefactors[i].y, 1e-7f);
- inverse_color_scalefactors[i].z = 1.0f / MAX(color_scalefactors[i].z, 1e-7f);
- inverse_color_scalefactors[i].w = 1.0f / MAX(color_scalefactors[i].w, 1e-7f);
-
-
- uncorr_rgb_lines[i].a = averages[i];
- if (dot(directions_rgb[i], directions_rgb[i]) == 0.0f)
- uncorr_rgb_lines[i].b = normalize(float3(color_scalefactors[i].xyz));
- else
- uncorr_rgb_lines[i].b = normalize(directions_rgb[i]);
-
- samechroma_rgb_lines[i].a = float3(0, 0, 0);
- if (dot(averages[i], averages[i]) < 1e-20)
- samechroma_rgb_lines[i].b = normalize(float3(color_scalefactors[i].xyz));
- else
- samechroma_rgb_lines[i].b = normalize(averages[i]);
-
- rgb_luma_lines[i].a = averages[i];
- rgb_luma_lines[i].b = normalize(color_scalefactors[i].xyz);
-
- luminance_lines[i].a = float3(0, 0, 0);
- luminance_lines[i].b = normalize(color_scalefactors[i].xyz);
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("Partition %d\n", i);
- printf("Average = <%g %g %g>\n", averages[i].x, averages[i].y, averages[i].z);
- printf("Uncorr-rgb-line = <%g %g %g> + t<%g %g %g>\n",
- uncorr_rgb_lines[i].a.x, uncorr_rgb_lines[i].a.y, uncorr_rgb_lines[i].a.z, uncorr_rgb_lines[i].b.x, uncorr_rgb_lines[i].b.y, uncorr_rgb_lines[i].b.z);
- printf("Samechroma-line = t<%g %g %g>\n", samechroma_rgb_lines[i].b.x, samechroma_rgb_lines[i].b.y, samechroma_rgb_lines[i].b.z);
- }
- #endif
-
- proc_uncorr_rgb_lines[i].amod = (uncorr_rgb_lines[i].a - uncorr_rgb_lines[i].b * dot(uncorr_rgb_lines[i].a, uncorr_rgb_lines[i].b)) * inverse_color_scalefactors[i].xyz;
- proc_uncorr_rgb_lines[i].bs = uncorr_rgb_lines[i].b * color_scalefactors[i].xyz;
- proc_uncorr_rgb_lines[i].bis = uncorr_rgb_lines[i].b * inverse_color_scalefactors[i].xyz;
-
- proc_samechroma_rgb_lines[i].amod = (samechroma_rgb_lines[i].a - samechroma_rgb_lines[i].b * dot(samechroma_rgb_lines[i].a, samechroma_rgb_lines[i].b)) * inverse_color_scalefactors[i].xyz;
- proc_samechroma_rgb_lines[i].bs = samechroma_rgb_lines[i].b * color_scalefactors[i].xyz;
- proc_samechroma_rgb_lines[i].bis = samechroma_rgb_lines[i].b * inverse_color_scalefactors[i].xyz;
-
- proc_rgb_luma_lines[i].amod = (rgb_luma_lines[i].a - rgb_luma_lines[i].b * dot(rgb_luma_lines[i].a, rgb_luma_lines[i].b)) * inverse_color_scalefactors[i].xyz;
- proc_rgb_luma_lines[i].bs = rgb_luma_lines[i].b * color_scalefactors[i].xyz;
- proc_rgb_luma_lines[i].bis = rgb_luma_lines[i].b * inverse_color_scalefactors[i].xyz;
-
- proc_luminance_lines[i].amod = (luminance_lines[i].a - luminance_lines[i].b * dot(luminance_lines[i].a, luminance_lines[i].b)) * inverse_color_scalefactors[i].xyz;
- proc_luminance_lines[i].bs = luminance_lines[i].b * color_scalefactors[i].xyz;
- proc_luminance_lines[i].bis = luminance_lines[i].b * inverse_color_scalefactors[i].xyz;
-
- }
-
-
-
- float uncorr_rgb_error[4];
- float samechroma_rgb_error[4];
- float rgb_luma_error[4];
- float luminance_rgb_error[4];
-
-
- for (i = 0; i < partition_count; i++)
- {
-
- uncorr_rgb_error[i] = compute_error_squared_rgb_single_partition(i, xdim, ydim, zdim, pi, pb, ewb, &(proc_uncorr_rgb_lines[i]));
-
- samechroma_rgb_error[i] = compute_error_squared_rgb_single_partition(i, xdim, ydim, zdim, pi, pb, ewb, &(proc_samechroma_rgb_lines[i]));
-
- rgb_luma_error[i] = compute_error_squared_rgb_single_partition(i, xdim, ydim, zdim, pi, pb, ewb, &(proc_rgb_luma_lines[i]));
-
- luminance_rgb_error[i] = compute_error_squared_rgb_single_partition(i, xdim, ydim, zdim, pi, pb, ewb, &(proc_luminance_lines[i]));
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("Partition %d : uncorr-error=%g samechroma-error=%g rgb-luma-error=%g lum-error=%g\n",
- i, uncorr_rgb_error[i], samechroma_rgb_error[i], rgb_luma_error[i], luminance_rgb_error[i]);
- }
- #endif
- }
-
- // compute the error that arises from just ditching alpha and RGB
- float alpha_drop_error[4];
- float rgb_drop_error[4];
- for (i = 0; i < partition_count; i++)
- {
- alpha_drop_error[i] = 0;
- rgb_drop_error[i] = 0;
- }
- for (i = 0; i < texels_per_block; i++)
- {
- int partition = pi->partition_of_texel[i];
- float alpha = pb->work_data[4 * i + 3];
- float default_alpha = pb->alpha_lns[i] ? (float)0x7800 : (float)0xFFFF;
-
- float omalpha = alpha - default_alpha;
- alpha_drop_error[partition] += omalpha * omalpha * ewb->error_weights[i].w;
- float red = pb->work_data[4 * i];
- float green = pb->work_data[4 * i + 1];
- float blue = pb->work_data[4 * i + 2];
- rgb_drop_error[partition] += red * red * ewb->error_weights[i].x + green * green * ewb->error_weights[i].y + blue * blue * ewb->error_weights[i].z;
- }
-
- // check if we are eligible for blue-contraction and offset-encoding
-
- endpoints ep;
- if (separate_component == -1)
- {
- endpoints_and_weights ei;
- compute_endpoints_and_ideal_weights_1_plane(xdim, ydim, zdim, pi, pb, ewb, &ei);
- ep = ei.ep;
- }
- else
- {
- endpoints_and_weights ei1, ei2;
- compute_endpoints_and_ideal_weights_2_planes(xdim, ydim, zdim, pi, pb, ewb, separate_component, &ei1, &ei2);
-
- merge_endpoints(&(ei1.ep), &(ei2.ep), separate_component, &ep);
- }
-
- int eligible_for_offset_encode[4];
- int eligible_for_blue_contraction[4];
-
- for (i = 0; i < partition_count; i++)
- {
- float4 endpt0 = ep.endpt0[i];
- float4 endpt1 = ep.endpt1[i];
- float4 endpt_dif = endpt1 - endpt0;
- if (fabs(endpt_dif.x) < (0.12 * 65535.0f) && fabs(endpt_dif.y) < (0.12 * 65535.0f) && fabs(endpt_dif.z) < (0.12 * 65535.0f))
- eligible_for_offset_encode[i] = 1;
- else
- eligible_for_offset_encode[i] = 0;
- endpt0.x += (endpt0.x - endpt0.z);
- endpt0.y += (endpt0.y - endpt0.z);
- endpt1.x += (endpt1.x - endpt1.z);
- endpt1.y += (endpt1.y - endpt1.z);
- if (endpt0.x > (0.01f * 65535.0f) && endpt0.x < (0.99f * 65535.0f)
- && endpt1.x > (0.01f * 65535.0f) && endpt1.x < (0.99f * 65535.0f)
- && endpt0.y > (0.01f * 65535.0f) && endpt0.y < (0.99f * 65535.0f) && endpt1.y > (0.01f * 65535.0f) && endpt1.y < (0.99f * 65535.0f))
- eligible_for_blue_contraction[i] = 1;
- else
- eligible_for_blue_contraction[i] = 0;
- }
-
-
- // finally, gather up our results
- for (i = 0; i < partition_count; i++)
- {
- eci[i].rgb_scale_error = (samechroma_rgb_error[i] - uncorr_rgb_error[i]) * 0.7f; // empirical
- eci[i].rgb_luma_error = (rgb_luma_error[i] - uncorr_rgb_error[i]) * 1.5f; // wild guess
- eci[i].luminance_error = (luminance_rgb_error[i] - uncorr_rgb_error[i]) * 3.0f; // empirical
- eci[i].alpha_drop_error = alpha_drop_error[i] * 3.0f;
- eci[i].rgb_drop_error = rgb_drop_error[i] * 3.0f;
- eci[i].can_offset_encode = eligible_for_offset_encode[i];
- eci[i].can_blue_contract = eligible_for_blue_contraction[i];
- }
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_find_best_partitioning.cpp b/3rdparty/bimg/3rdparty/astc/astc_find_best_partitioning.cpp
deleted file mode 100644
index f53ab1c9b3e..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_find_best_partitioning.cpp
+++ /dev/null
@@ -1,865 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief ASTC encoding of texture
- *
- * major step 1:
- * * find best partitioning assuming uncorrelated colors
- * * find best partitioning assuming RGBS color representation
- *
- * finding best partitioning for a block:
- * * for each available partitioning:
- * * compute mean-color-value and dominant direction.
- * * this defines two lines, both of which go through the
- * mean-color-value:
- * * one line has a direction defined by the dominant direction;
- * this line is used to assess the error from using an uncorrelated
- * color representation.
- * * the other line goes through (0,0,0,1) and is used to assess the
- * error from using an RGBS color representation.
- * * we then compute, as a sum across the block, the squared-errors
- * that result from using the dominant-direction-lines and the
- * squared-errors that result from using the 0001-lines.
- */
-/*----------------------------------------------------------------------------*/
-
-/*
- * Partition table representation:
- * We have 3 tables, each with 1024 partitionings
- * (these correspond to the 3x128 hardware partitionings crossed with all the
- * partition-transform modes in the hardware.)
- *
- * For each partitioning, we have:
- * * a 4-entry table indicating how many texels there are in each of the 4
- * partitions. this may be from 2 to about 60 or so.
- * * a 64-entry table indicating the partition index of each of the 64 texels
- * in the block. each index may be 0, 1, 2 or 3.
- *
- * each element in the table is an uint8_t indicating partition index (0, 1, 2 or 3)
- */
-
-#include <math.h>
-
-#include "astc_codec_internals.h"
-
-#ifdef DEBUG_PRINT_DIAGNOSTICS
- #include <stdio.h>
-#endif
-
-#include "mathlib.h"
-
-int imageblock_uses_alpha(int xdim, int ydim, int zdim, const imageblock * pb)
-{
- IGNORE(xdim);
- IGNORE(ydim);
- IGNORE(zdim);
-
- return pb->alpha_max != pb->alpha_min;
-}
-
-static void compute_alpha_minmax(int xdim, int ydim, int zdim, const partition_info * pt, const imageblock * blk, const error_weight_block * ewb, float *alpha_min, float *alpha_max)
-{
- int i;
- int partition_count = pt->partition_count;
-
- int texels_per_block = xdim * ydim * zdim;
-
- for (i = 0; i < partition_count; i++)
- {
- alpha_min[i] = 1e38f;
- alpha_max[i] = -1e38f;
- }
-
- for (i = 0; i < texels_per_block; i++)
- {
- if (ewb->texel_weight[i] > 1e-10)
- {
- int partition = pt->partition_of_texel[i];
- float alphaval = blk->work_data[4 * i + 3];
- if (alphaval > alpha_max[partition])
- alpha_max[partition] = alphaval;
- if (alphaval < alpha_min[partition])
- alpha_min[partition] = alphaval;
- }
- }
-
- for (i = 0; i < partition_count; i++)
- {
- if (alpha_min[i] >= alpha_max[i])
- {
- alpha_min[i] = 0;
- alpha_max[i] = 1e-10f;
- }
- }
-}
-
-
-static void compute_rgb_minmax(int xdim,
- int ydim,
- int zdim,
- const partition_info * pt,
- const imageblock * blk, const error_weight_block * ewb, float *red_min, float *red_max, float *green_min, float *green_max, float *blue_min, float *blue_max)
-{
- int i;
- int partition_count = pt->partition_count;
- int texels_per_block = xdim * ydim * zdim;
-
- for (i = 0; i < partition_count; i++)
- {
- red_min[i] = 1e38f;
- red_max[i] = -1e38f;
- green_min[i] = 1e38f;
- green_max[i] = -1e38f;
- blue_min[i] = 1e38f;
- blue_max[i] = -1e38f;
- }
-
- for (i = 0; i < texels_per_block; i++)
- {
- if (ewb->texel_weight[i] > 1e-10f)
- {
- int partition = pt->partition_of_texel[i];
- float redval = blk->work_data[4 * i];
- float greenval = blk->work_data[4 * i + 1];
- float blueval = blk->work_data[4 * i + 2];
- if (redval > red_max[partition])
- red_max[partition] = redval;
- if (redval < red_min[partition])
- red_min[partition] = redval;
- if (greenval > green_max[partition])
- green_max[partition] = greenval;
- if (greenval < green_min[partition])
- green_min[partition] = greenval;
- if (blueval > blue_max[partition])
- blue_max[partition] = blueval;
- if (blueval < blue_min[partition])
- blue_min[partition] = blueval;
- }
- }
- for (i = 0; i < partition_count; i++)
- {
- if (red_min[i] >= red_max[i])
- {
- red_min[i] = 0.0f;
- red_max[i] = 1e-10f;
- }
- if (green_min[i] >= green_max[i])
- {
- green_min[i] = 0.0f;
- green_max[i] = 1e-10f;
- }
- if (blue_min[i] >= blue_max[i])
- {
- blue_min[i] = 0.0f;
- blue_max[i] = 1e-10f;
- }
- }
-}
-
-
-
-void compute_partition_error_color_weightings(int xdim, int ydim, int zdim, const error_weight_block * ewb, const partition_info * pi, float4 error_weightings[4], float4 color_scalefactors[4])
-{
- int i;
- int texels_per_block = xdim * ydim * zdim;
- int pcnt = pi->partition_count;
- for (i = 0; i < pcnt; i++)
- error_weightings[i] = float4(1e-12f, 1e-12f, 1e-12f, 1e-12f);
- for (i = 0; i < texels_per_block; i++)
- {
- int part = pi->partition_of_texel[i];
- error_weightings[part] = error_weightings[part] + ewb->error_weights[i];
- }
- for (i = 0; i < pcnt; i++)
- {
- error_weightings[i] = error_weightings[i] * (1.0f / pi->texels_per_partition[i]);
- }
- for (i = 0; i < pcnt; i++)
- {
- color_scalefactors[i].x = sqrt(error_weightings[i].x);
- color_scalefactors[i].y = sqrt(error_weightings[i].y);
- color_scalefactors[i].z = sqrt(error_weightings[i].z);
- color_scalefactors[i].w = sqrt(error_weightings[i].w);
- }
-
-}
-
-
-/*
- main function to identify the best partitioning for a given number of texels */
-
-
-void find_best_partitionings(int partition_search_limit, int xdim, int ydim, int zdim, int partition_count,
- const imageblock * pb, const error_weight_block * ewb, int candidates_to_return,
- // best partitionings to use if the endpoint colors are assumed to be uncorrelated
- int *best_partitions_uncorrellated,
- // best partitionings to use if the endpoint colors have the same chroma
- int *best_partitions_samechroma,
- // best partitionings to use if using dual plane of weights
- int *best_partitions_dual_weight_planes)
-{
-
-
- int i, j;
-
- int texels_per_block = xdim * ydim * zdim;
-
- // constant used to estimate quantization error for a given partitioning;
- // the optimal value for this constant depends on bitrate.
- // These constants have been determined empirically.
-
- float weight_imprecision_estim = 100;
-
- if (texels_per_block <= 20)
- weight_imprecision_estim = 0.03f;
- else if (texels_per_block <= 31)
- weight_imprecision_estim = 0.04f;
- else if (texels_per_block <= 41)
- weight_imprecision_estim = 0.05f;
- else
- weight_imprecision_estim = 0.055f;
-
-
- int partition_sequence[PARTITION_COUNT];
-
- kmeans_compute_partition_ordering(xdim, ydim, zdim, partition_count, pb, partition_sequence);
-
-
- float weight_imprecision_estim_squared = weight_imprecision_estim * weight_imprecision_estim;
-
-#ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("weight_imprecision_estim = %g\n", weight_imprecision_estim);
-#endif
-
- int uses_alpha = imageblock_uses_alpha(xdim, ydim, zdim, pb);
-
- const partition_info *ptab = get_partition_table(xdim, ydim, zdim, partition_count);
-
- // partitioning errors assuming uncorrelated-chrominance endpoints
- float uncorr_errors[PARTITION_COUNT];
- // partitioning errors assuming same-chrominance endpoints
- float samechroma_errors[PARTITION_COUNT];
-
- // partitioning errors assuming that one of the color channels
- // is uncorrelated from all the other ones
- float separate_errors[4 * PARTITION_COUNT];
-
-
- float *separate_red_errors = separate_errors;
- float *separate_green_errors = separate_errors + PARTITION_COUNT;
- float *separate_blue_errors = separate_errors + 2 * PARTITION_COUNT;
- float *separate_alpha_errors = separate_errors + 3 * PARTITION_COUNT;
-
- int defacto_search_limit = PARTITION_COUNT - 1;
-
- if (uses_alpha)
- {
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Partition testing with alpha, %d partitions\n\n", partition_count);
- #endif
-
- for (i = 0; i < PARTITION_COUNT; i++)
- {
- int partition = partition_sequence[i];
- int bk_partition_count = ptab[partition].partition_count;
-
- if (bk_partition_count < partition_count)
- {
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Partitioning %d-%d: invalid\n", partition_count, partition);
- #endif
-
- uncorr_errors[i] = 1e35f;
- samechroma_errors[i] = 1e35f;
- separate_red_errors[i] = 1e35f;
- separate_green_errors[i] = 1e35f;
- separate_blue_errors[i] = 1e35f;
- separate_alpha_errors[i] = 1e35f;
- continue;
- }
- // the sentinel value for partitions above the search limit must be smaller
- // than the sentinel value for invalid partitions
- if (i >= partition_search_limit)
- {
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Partitioning %d-%d: excluded from testing\n", partition_count, partition);
- #endif
-
- defacto_search_limit = i;
-
- uncorr_errors[i] = 1e34f;
- samechroma_errors[i] = 1e34f;
- separate_red_errors[i] = 1e34f;
- separate_green_errors[i] = 1e34f;
- separate_blue_errors[i] = 1e34f;
- separate_alpha_errors[i] = 1e34f;
- break;
- }
-
- // compute the weighting to give to each color channel
- // in each partition.
- float4 error_weightings[4];
- float4 color_scalefactors[4];
- float4 inverse_color_scalefactors[4];
- compute_partition_error_color_weightings(xdim, ydim, zdim, ewb, ptab + partition, error_weightings, color_scalefactors);
-
- for (j = 0; j < partition_count; j++)
- {
- inverse_color_scalefactors[j].x = 1.0f / MAX(color_scalefactors[j].x, 1e-7f);
- inverse_color_scalefactors[j].y = 1.0f / MAX(color_scalefactors[j].y, 1e-7f);
- inverse_color_scalefactors[j].z = 1.0f / MAX(color_scalefactors[j].z, 1e-7f);
- inverse_color_scalefactors[j].w = 1.0f / MAX(color_scalefactors[j].w, 1e-7f);
- }
-
- float4 averages[4];
- float4 directions_rgba[4];
- float3 directions_gba[4];
- float3 directions_rba[4];
- float3 directions_rga[4];
- float3 directions_rgb[4];
-
- compute_averages_and_directions_rgba(ptab + partition, pb, ewb, color_scalefactors, averages, directions_rgba, directions_gba, directions_rba, directions_rga, directions_rgb);
-
- line4 uncorr_lines[4];
- line4 samechroma_lines[4];
- line3 separate_red_lines[4];
- line3 separate_green_lines[4];
- line3 separate_blue_lines[4];
- line3 separate_alpha_lines[4];
-
- processed_line4 proc_uncorr_lines[4];
- processed_line4 proc_samechroma_lines[4];
- processed_line3 proc_separate_red_lines[4];
- processed_line3 proc_separate_green_lines[4];
- processed_line3 proc_separate_blue_lines[4];
- processed_line3 proc_separate_alpha_lines[4];
-
- float uncorr_linelengths[4];
- float samechroma_linelengths[4];
- float separate_red_linelengths[4];
- float separate_green_linelengths[4];
- float separate_blue_linelengths[4];
- float separate_alpha_linelengths[4];
-
-
-
- for (j = 0; j < partition_count; j++)
- {
- uncorr_lines[j].a = averages[j];
- if (dot(directions_rgba[j], directions_rgba[j]) == 0.0f)
- uncorr_lines[j].b = normalize(float4(1, 1, 1, 1));
- else
- uncorr_lines[j].b = normalize(directions_rgba[j]);
-
- proc_uncorr_lines[j].amod = (uncorr_lines[j].a - uncorr_lines[j].b * dot(uncorr_lines[j].a, uncorr_lines[j].b)) * inverse_color_scalefactors[j];
- proc_uncorr_lines[j].bs = (uncorr_lines[j].b * color_scalefactors[j]);
- proc_uncorr_lines[j].bis = (uncorr_lines[j].b * inverse_color_scalefactors[j]);
-
-
- samechroma_lines[j].a = float4(0, 0, 0, 0);
- if (dot(averages[j], averages[j]) == 0)
- samechroma_lines[j].b = normalize(float4(1, 1, 1, 1));
- else
- samechroma_lines[j].b = normalize(averages[j]);
-
- proc_samechroma_lines[j].amod = (samechroma_lines[j].a - samechroma_lines[j].b * dot(samechroma_lines[j].a, samechroma_lines[j].b)) * inverse_color_scalefactors[j];
- proc_samechroma_lines[j].bs = (samechroma_lines[j].b * color_scalefactors[j]);
- proc_samechroma_lines[j].bis = (samechroma_lines[j].b * inverse_color_scalefactors[j]);
-
- separate_red_lines[j].a = averages[j].yzw;
- if (dot(directions_gba[j], directions_gba[j]) == 0.0f)
- separate_red_lines[j].b = normalize(float3(1, 1, 1));
- else
- separate_red_lines[j].b = normalize(directions_gba[j]);
-
- separate_green_lines[j].a = averages[j].xzw;
- if (dot(directions_rba[j], directions_rba[j]) == 0.0f)
- separate_green_lines[j].b = normalize(float3(1, 1, 1));
- else
- separate_green_lines[j].b = normalize(directions_rba[j]);
-
- separate_blue_lines[j].a = averages[j].xyw;
- if (dot(directions_rga[j], directions_rga[j]) == 0.0f)
- separate_blue_lines[j].b = normalize(float3(1, 1, 1));
- else
- separate_blue_lines[j].b = normalize(directions_rga[j]);
-
- separate_alpha_lines[j].a = averages[j].xyz;
- if (dot(directions_rgb[j], directions_rgb[j]) == 0.0f)
- separate_alpha_lines[j].b = normalize(float3(1, 1, 1));
- else
- separate_alpha_lines[j].b = normalize(directions_rgb[j]);
-
- proc_separate_red_lines[j].amod = (separate_red_lines[j].a - separate_red_lines[j].b * dot(separate_red_lines[j].a, separate_red_lines[j].b)) * inverse_color_scalefactors[j].yzw;
- proc_separate_red_lines[j].bs = (separate_red_lines[j].b * color_scalefactors[j].yzw);
- proc_separate_red_lines[j].bis = (separate_red_lines[j].b * inverse_color_scalefactors[j].yzw);
-
- proc_separate_green_lines[j].amod =
- (separate_green_lines[j].a - separate_green_lines[j].b * dot(separate_green_lines[j].a, separate_green_lines[j].b)) * inverse_color_scalefactors[j].xzw;
- proc_separate_green_lines[j].bs = (separate_green_lines[j].b * color_scalefactors[j].xzw);
- proc_separate_green_lines[j].bis = (separate_green_lines[j].b * inverse_color_scalefactors[j].xzw);
-
- proc_separate_blue_lines[j].amod = (separate_blue_lines[j].a - separate_blue_lines[j].b * dot(separate_blue_lines[j].a, separate_blue_lines[j].b)) * inverse_color_scalefactors[j].xyw;
- proc_separate_blue_lines[j].bs = (separate_blue_lines[j].b * color_scalefactors[j].xyw);
- proc_separate_blue_lines[j].bis = (separate_blue_lines[j].b * inverse_color_scalefactors[j].xyw);
-
- proc_separate_alpha_lines[j].amod =
- (separate_alpha_lines[j].a - separate_alpha_lines[j].b * dot(separate_alpha_lines[j].a, separate_alpha_lines[j].b)) * inverse_color_scalefactors[j].xyz;
- proc_separate_alpha_lines[j].bs = (separate_alpha_lines[j].b * color_scalefactors[j].xyz);
- proc_separate_alpha_lines[j].bis = (separate_alpha_lines[j].b * inverse_color_scalefactors[j].xyz);
-
- }
-
- float uncorr_error = compute_error_squared_rgba(ptab + partition,
- pb,
- ewb,
- proc_uncorr_lines,
- uncorr_linelengths);
- float samechroma_error = compute_error_squared_rgba(ptab + partition,
- pb,
- ewb,
- proc_samechroma_lines,
- samechroma_linelengths);
-
-
- float separate_red_error = compute_error_squared_gba(ptab + partition,
- pb,
- ewb,
- proc_separate_red_lines,
- separate_red_linelengths);
-
- float separate_green_error = compute_error_squared_rba(ptab + partition,
- pb,
- ewb,
- proc_separate_green_lines,
- separate_green_linelengths);
-
- float separate_blue_error = compute_error_squared_rga(ptab + partition,
- pb,
- ewb,
- proc_separate_blue_lines,
- separate_blue_linelengths);
-
- float separate_alpha_error = compute_error_squared_rgb(ptab + partition,
- pb,
- ewb,
- proc_separate_alpha_lines,
- separate_alpha_linelengths);
-
- // compute minimum & maximum alpha values in each partition
- float red_min[4], red_max[4];
- float green_min[4], green_max[4];
- float blue_min[4], blue_max[4];
- float alpha_min[4], alpha_max[4];
- compute_alpha_minmax(xdim, ydim, zdim, ptab + partition, pb, ewb, alpha_min, alpha_max);
-
- compute_rgb_minmax(xdim, ydim, zdim, ptab + partition, pb, ewb, red_min, red_max, green_min, green_max, blue_min, blue_max);
-
- /*
- Compute an estimate of error introduced by weight quantization imprecision.
- This error is computed as follows, for each partition
- 1: compute the principal-axis vector (full length) in error-space
- 2: convert the principal-axis vector to regular RGB-space
- 3: scale the vector by a constant that estimates average quantization error
- 4: for each texel, square the vector, then do a dot-product with the texel's error weight;
- sum up the results across all texels.
- 4(optimized): square the vector once, then do a dot-product with the average texel error,
- then multiply by the number of texels.
- */
-
- for (j = 0; j < partition_count; j++)
- {
- float tpp = (float)(ptab[partition].texels_per_partition[j]);
-
- float4 ics = inverse_color_scalefactors[j];
- float4 error_weights = error_weightings[j] * (tpp * weight_imprecision_estim_squared);
-
- float4 uncorr_vector = (uncorr_lines[j].b * uncorr_linelengths[j]) * ics;
- float4 samechroma_vector = (samechroma_lines[j].b * samechroma_linelengths[j]) * ics;
- float3 separate_red_vector = (separate_red_lines[j].b * separate_red_linelengths[j]) * ics.yzw;
- float3 separate_green_vector = (separate_green_lines[j].b * separate_green_linelengths[j]) * ics.xzw;
- float3 separate_blue_vector = (separate_blue_lines[j].b * separate_blue_linelengths[j]) * ics.xyw;
- float3 separate_alpha_vector = (separate_alpha_lines[j].b * separate_alpha_linelengths[j]) * ics.xyz;
-
- uncorr_vector = uncorr_vector * uncorr_vector;
- samechroma_vector = samechroma_vector * samechroma_vector;
- separate_red_vector = separate_red_vector * separate_red_vector;
- separate_green_vector = separate_green_vector * separate_green_vector;
- separate_blue_vector = separate_blue_vector * separate_blue_vector;
- separate_alpha_vector = separate_alpha_vector * separate_alpha_vector;
-
- uncorr_error += dot(uncorr_vector, error_weights);
- samechroma_error += dot(samechroma_vector, error_weights);
- separate_red_error += dot(separate_red_vector, error_weights.yzw);
- separate_green_error += dot(separate_green_vector, error_weights.xzw);
- separate_blue_error += dot(separate_blue_vector, error_weights.xyw);
- separate_alpha_error += dot(separate_alpha_vector, error_weights.xyz);
-
- float red_scalar = (red_max[j] - red_min[j]);
- float green_scalar = (green_max[j] - green_min[j]);
- float blue_scalar = (blue_max[j] - blue_min[j]);
- float alpha_scalar = (alpha_max[j] - alpha_min[j]);
- red_scalar *= red_scalar;
- green_scalar *= green_scalar;
- blue_scalar *= blue_scalar;
- alpha_scalar *= alpha_scalar;
- separate_red_error += red_scalar * error_weights.x;
- separate_green_error += green_scalar * error_weights.y;
- separate_blue_error += blue_scalar * error_weights.z;
- separate_alpha_error += alpha_scalar * error_weights.w;
- }
-
- uncorr_errors[i] = uncorr_error;
- samechroma_errors[i] = samechroma_error;
- separate_red_errors[i] = separate_red_error;
- separate_green_errors[i] = separate_green_error;
- separate_blue_errors[i] = separate_blue_error;
- separate_alpha_errors[i] = separate_alpha_error;
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Partitioning %d-%d errors: uncorr=%g, samechroma=%g, sep-alpha=%g\n", partition_count, i, uncorr_error, samechroma_error, separate_alpha_error);
- #endif
- }
- }
- else
- {
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Partition testing without alpha, %d partitions\n", partition_count);
- #endif
-
-
-
- for (i = 0; i < PARTITION_COUNT; i++)
- {
-
- int partition = partition_sequence[i];
-
- int bk_partition_count = ptab[partition].partition_count;
- if (bk_partition_count < partition_count)
- {
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Partitioning %d-%d: invalid\n", partition_count, i);
- #endif
-
- uncorr_errors[i] = 1e35f;
- samechroma_errors[i] = 1e35f;
- separate_red_errors[i] = 1e35f;
- separate_green_errors[i] = 1e35f;
- separate_blue_errors[i] = 1e35f;
- continue;
- }
- // the sentinel value for valid partitions above the search limit must be smaller
- // than the sentinel value for invalid partitions
- if (i >= partition_search_limit)
- {
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf(" Partitioning %d-%d: excluded from testing\n", partition_count, partition);
- #endif
-
- defacto_search_limit = i;
- uncorr_errors[i] = 1e34f;
- samechroma_errors[i] = 1e34f;
- separate_red_errors[i] = 1e34f;
- separate_green_errors[i] = 1e34f;
- separate_blue_errors[i] = 1e34f;
- break;
-
- }
-
- // compute the weighting to give to each color channel
- // in each partition.
- float4 error_weightings[4];
- float4 color_scalefactors[4];
- float4 inverse_color_scalefactors[4];
-
- compute_partition_error_color_weightings(xdim, ydim, zdim, ewb, ptab + partition, error_weightings, color_scalefactors);
-
- for (j = 0; j < partition_count; j++)
- {
- inverse_color_scalefactors[j].x = 1.0f / MAX(color_scalefactors[j].x, 1e-7f);
- inverse_color_scalefactors[j].y = 1.0f / MAX(color_scalefactors[j].y, 1e-7f);
- inverse_color_scalefactors[j].z = 1.0f / MAX(color_scalefactors[j].z, 1e-7f);
- inverse_color_scalefactors[j].w = 1.0f / MAX(color_scalefactors[j].w, 1e-7f);
- }
-
- float3 averages[4];
- float3 directions_rgb[4];
- float2 directions_rg[4];
- float2 directions_rb[4];
- float2 directions_gb[4];
-
- compute_averages_and_directions_rgb(ptab + partition, pb, ewb, color_scalefactors, averages, directions_rgb, directions_rg, directions_rb, directions_gb);
-
- line3 uncorr_lines[4];
- line3 samechroma_lines[4];
- line2 separate_red_lines[4];
- line2 separate_green_lines[4];
- line2 separate_blue_lines[4];
-
- processed_line3 proc_uncorr_lines[4];
- processed_line3 proc_samechroma_lines[4];
-
- processed_line2 proc_separate_red_lines[4];
- processed_line2 proc_separate_green_lines[4];
- processed_line2 proc_separate_blue_lines[4];
-
- float uncorr_linelengths[4];
- float samechroma_linelengths[4];
- float separate_red_linelengths[4];
- float separate_green_linelengths[4];
- float separate_blue_linelengths[4];
-
- for (j = 0; j < partition_count; j++)
- {
- uncorr_lines[j].a = averages[j];
- if (dot(directions_rgb[j], directions_rgb[j]) == 0.0f)
- uncorr_lines[j].b = normalize(float3(1, 1, 1));
- else
- uncorr_lines[j].b = normalize(directions_rgb[j]);
-
-
- samechroma_lines[j].a = float3(0, 0, 0);
-
- if (dot(averages[j], averages[j]) == 0.0f)
- samechroma_lines[j].b = normalize(float3(1, 1, 1));
- else
- samechroma_lines[j].b = normalize(averages[j]);
-
- proc_uncorr_lines[j].amod = (uncorr_lines[j].a - uncorr_lines[j].b * dot(uncorr_lines[j].a, uncorr_lines[j].b)) * inverse_color_scalefactors[j].xyz;
- proc_uncorr_lines[j].bs = (uncorr_lines[j].b * color_scalefactors[j].xyz);
- proc_uncorr_lines[j].bis = (uncorr_lines[j].b * inverse_color_scalefactors[j].xyz);
-
- proc_samechroma_lines[j].amod = (samechroma_lines[j].a - samechroma_lines[j].b * dot(samechroma_lines[j].a, samechroma_lines[j].b)) * inverse_color_scalefactors[j].xyz;
- proc_samechroma_lines[j].bs = (samechroma_lines[j].b * color_scalefactors[j].xyz);
- proc_samechroma_lines[j].bis = (samechroma_lines[j].b * inverse_color_scalefactors[j].xyz);
-
- separate_red_lines[j].a = averages[j].yz;
- if (dot(directions_gb[j], directions_gb[j]) == 0.0f)
- separate_red_lines[j].b = normalize(float2(1, 1));
- else
- separate_red_lines[j].b = normalize(directions_gb[j]);
-
- separate_green_lines[j].a = averages[j].xz;
- if (dot(directions_rb[j], directions_rb[j]) == 0.0f)
- separate_green_lines[j].b = normalize(float2(1, 1));
- else
- separate_green_lines[j].b = normalize(directions_rb[j]);
-
- separate_blue_lines[j].a = averages[j].xy;
- if (dot(directions_rg[j], directions_rg[j]) == 0.0f)
- separate_blue_lines[j].b = normalize(float2(1, 1));
- else
- separate_blue_lines[j].b = normalize(directions_rg[j]);
-
- proc_separate_red_lines[j].amod = (separate_red_lines[j].a - separate_red_lines[j].b * dot(separate_red_lines[j].a, separate_red_lines[j].b)) * inverse_color_scalefactors[j].yz;
- proc_separate_red_lines[j].bs = (separate_red_lines[j].b * color_scalefactors[j].yz);
- proc_separate_red_lines[j].bis = (separate_red_lines[j].b * inverse_color_scalefactors[j].yz);
-
- proc_separate_green_lines[j].amod =
- (separate_green_lines[j].a - separate_green_lines[j].b * dot(separate_green_lines[j].a, separate_green_lines[j].b)) * inverse_color_scalefactors[j].xz;
- proc_separate_green_lines[j].bs = (separate_green_lines[j].b * color_scalefactors[j].xz);
- proc_separate_green_lines[j].bis = (separate_green_lines[j].b * inverse_color_scalefactors[j].xz);
-
- proc_separate_blue_lines[j].amod = (separate_blue_lines[j].a - separate_blue_lines[j].b * dot(separate_blue_lines[j].a, separate_blue_lines[j].b)) * inverse_color_scalefactors[j].xy;
- proc_separate_blue_lines[j].bs = (separate_blue_lines[j].b * color_scalefactors[j].xy);
- proc_separate_blue_lines[j].bis = (separate_blue_lines[j].b * inverse_color_scalefactors[j].xy);
-
- }
-
- float uncorr_error = compute_error_squared_rgb(ptab + partition,
- pb,
- ewb,
- proc_uncorr_lines,
- uncorr_linelengths);
- float samechroma_error = compute_error_squared_rgb(ptab + partition,
- pb,
- ewb,
- proc_samechroma_lines,
- samechroma_linelengths);
-
- float separate_red_error = compute_error_squared_gb(ptab + partition,
- pb,
- ewb,
- proc_separate_red_lines,
- separate_red_linelengths);
-
- float separate_green_error = compute_error_squared_rb(ptab + partition,
- pb,
- ewb,
- proc_separate_green_lines,
- separate_green_linelengths);
-
- float separate_blue_error = compute_error_squared_rg(ptab + partition,
- pb,
- ewb,
- proc_separate_blue_lines,
- separate_blue_linelengths);
-
- float red_min[4], red_max[4];
- float green_min[4], green_max[4];
- float blue_min[4], blue_max[4];
-
-
- compute_rgb_minmax(xdim, ydim, zdim, ptab + partition, pb, ewb, red_min, red_max, green_min, green_max, blue_min, blue_max);
-
-
-
- /*
- compute an estimate of error introduced by weight imprecision.
- This error is computed as follows, for each partition
- 1: compute the principal-axis vector (full length) in error-space
- 2: convert the principal-axis vector to regular RGB-space
- 3: scale the vector by a constant that estimates average quantization error.
- 4: for each texel, square the vector, then do a dot-product with the texel's error weight;
- sum up the results across all texels.
- 4(optimized): square the vector once, then do a dot-product with the average texel error,
- then multiply by the number of texels.
- */
-
-
- for (j = 0; j < partition_count; j++)
- {
- float tpp = (float)(ptab[partition].texels_per_partition[j]);
-
- float3 ics = inverse_color_scalefactors[j].xyz;
- float3 error_weights = error_weightings[j].xyz * (tpp * weight_imprecision_estim_squared);
-
- float3 uncorr_vector = (uncorr_lines[j].b * uncorr_linelengths[j]) * ics;
- float3 samechroma_vector = (samechroma_lines[j].b * samechroma_linelengths[j]) * ics;
-
- float2 separate_red_vector = (separate_red_lines[j].b * separate_red_linelengths[j]) * ics.yz;
- float2 separate_green_vector = (separate_green_lines[j].b * separate_green_linelengths[j]) * ics.xz;
- float2 separate_blue_vector = (separate_blue_lines[j].b * separate_blue_linelengths[j]) * ics.xy;
-
- uncorr_vector = uncorr_vector * uncorr_vector;
- samechroma_vector = samechroma_vector * samechroma_vector;
- separate_red_vector = separate_red_vector * separate_red_vector;
- separate_green_vector = separate_green_vector * separate_green_vector;
- separate_blue_vector = separate_blue_vector * separate_blue_vector;
-
- uncorr_error += dot(uncorr_vector, error_weights);
- samechroma_error += dot(samechroma_vector, error_weights);
- separate_red_error += dot(separate_red_vector, error_weights.yz);
- separate_green_error += dot(separate_green_vector, error_weights.xz);
- separate_blue_error += dot(separate_blue_vector, error_weights.xy);
-
- float red_scalar = (red_max[j] - red_min[j]);
- float green_scalar = (green_max[j] - green_min[j]);
- float blue_scalar = (blue_max[j] - blue_min[j]);
-
- red_scalar *= red_scalar;
- green_scalar *= green_scalar;
- blue_scalar *= blue_scalar;
-
- separate_red_error += red_scalar * error_weights.x;
- separate_green_error += green_scalar * error_weights.y;
- separate_blue_error += blue_scalar * error_weights.z;
- }
-
-
- uncorr_errors[i] = uncorr_error;
- samechroma_errors[i] = samechroma_error;
-
- separate_red_errors[i] = separate_red_error;
- separate_green_errors[i] = separate_green_error;
- separate_blue_errors[i] = separate_blue_error;
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Partitioning %d-%d errors: uncorr=%f, samechroma=%f, sep-red=%f, sep-green=%f, sep-blue=%f\n",
- partition_count, partition, uncorr_error, samechroma_error, separate_red_error, separate_green_error, separate_blue_error);
- #endif
- }
- }
-
-
- for (i = 0; i < candidates_to_return; i++)
- {
- int best_uncorr_partition = 0;
- int best_samechroma_partition = 0;
- float best_uncorr_error = 1e30f;
- float best_samechroma_error = 1e30f;
- for (j = 0; j <= defacto_search_limit; j++)
- {
- if (uncorr_errors[j] < best_uncorr_error)
- {
- best_uncorr_partition = j;
- best_uncorr_error = uncorr_errors[j];
- }
- }
- best_partitions_uncorrellated[i] = partition_sequence[best_uncorr_partition];
- uncorr_errors[best_uncorr_partition] = 1e30f;
- samechroma_errors[best_uncorr_partition] = 1e30f;
-
- for (j = 0; j <= defacto_search_limit; j++)
- {
- if (samechroma_errors[j] < best_samechroma_error)
- {
- best_samechroma_partition = j;
- best_samechroma_error = samechroma_errors[j];
- }
- }
- best_partitions_samechroma[i] = partition_sequence[best_samechroma_partition];
- samechroma_errors[best_samechroma_partition] = 1e30f;
- uncorr_errors[best_samechroma_partition] = 1e30f;
- }
-
- for (i = 0; i < 2 * candidates_to_return; i++)
- {
- int best_partition = 0;
- float best_partition_error = 1e30f;
-
- for (j = 0; j <= defacto_search_limit; j++)
- {
- if (1 || !uses_alpha)
- {
- if (separate_errors[j] < best_partition_error)
- {
- best_partition = j;
- best_partition_error = separate_errors[j];
- }
- if (separate_errors[j + PARTITION_COUNT] < best_partition_error)
- {
- best_partition = j + PARTITION_COUNT;
- best_partition_error = separate_errors[j + PARTITION_COUNT];
- }
- if (separate_errors[j + 2 * PARTITION_COUNT] < best_partition_error)
- {
- best_partition = j + 2 * PARTITION_COUNT;
- best_partition_error = separate_errors[j + 2 * PARTITION_COUNT];
- }
- }
- if (uses_alpha)
- {
- if (separate_errors[j + 3 * PARTITION_COUNT] < best_partition_error)
- {
- best_partition = j + 3 * PARTITION_COUNT;
- best_partition_error = separate_errors[j + 3 * PARTITION_COUNT];
- }
- }
- }
-
- separate_errors[best_partition] = 1e30f;
- best_partition = ((best_partition >> PARTITION_BITS) << PARTITION_BITS) | partition_sequence[best_partition & (PARTITION_COUNT - 1)];
- best_partitions_dual_weight_planes[i] = best_partition;
- }
-
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_ideal_endpoints_and_weights.cpp b/3rdparty/bimg/3rdparty/astc/astc_ideal_endpoints_and_weights.cpp
deleted file mode 100644
index 89d697d136f..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_ideal_endpoints_and_weights.cpp
+++ /dev/null
@@ -1,2163 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Functions for computing color endpoints and texel weights.
- */
-/*----------------------------------------------------------------------------*/
-
-#include <math.h>
-
-#include "astc_codec_internals.h"
-
-#ifdef DEBUG_PRINT_DIAGNOSTICS
-#include <stdio.h>
-#endif
-
-
-#ifdef DEBUG_CAPTURE_NAN
- #ifndef _GNU_SOURCE
- #define _GNU_SOURCE
- #endif
-
- #include <fenv.h>
-#endif
-
-static void compute_endpoints_and_ideal_weights_1_component(int xdim, int ydim, int zdim,
- const partition_info * pt, const imageblock * blk,
- const error_weight_block * ewb, endpoints_and_weights * ei,
- int component)
-{
- int i;
-
- int partition_count = pt->partition_count;
- ei->ep.partition_count = partition_count;
-
- float lowvalues[4], highvalues[4];
- float partition_error_scale[4];
- float linelengths_rcp[4];
-
- int texels_per_block = xdim * ydim * zdim;
-
- const float *error_weights;
- switch (component)
- {
- case 0:
- error_weights = ewb->texel_weight_r;
- break;
- case 1:
- error_weights = ewb->texel_weight_g;
- break;
- case 2:
- error_weights = ewb->texel_weight_b;
- break;
- case 3:
- error_weights = ewb->texel_weight_a;
- break;
- default:
- error_weights = ewb->texel_weight_r;
- ASTC_CODEC_INTERNAL_ERROR;
- }
-
-
- for (i = 0; i < partition_count; i++)
- {
- lowvalues[i] = 1e10;
- highvalues[i] = -1e10;
- }
-
- for (i = 0; i < texels_per_block; i++)
- {
- if (error_weights[i] > 1e-10)
- {
- float value = blk->work_data[4 * i + component];
- int partition = pt->partition_of_texel[i];
- if (value < lowvalues[partition])
- lowvalues[partition] = value;
- if (value > highvalues[partition])
- highvalues[partition] = value;
- }
- }
-
- for (i = 0; i < partition_count; i++)
- {
- float diff = highvalues[i] - lowvalues[i];
- if (diff < 0)
- {
- lowvalues[i] = 0;
- highvalues[i] = 0;
- }
- if (diff < 1e-7f)
- diff = 1e-7f;
- partition_error_scale[i] = diff * diff;
- linelengths_rcp[i] = 1.0f / diff;
- }
-
- for (i = 0; i < texels_per_block; i++)
- {
- float value = blk->work_data[4 * i + component];
- int partition = pt->partition_of_texel[i];
- value -= lowvalues[partition];
- value *= linelengths_rcp[partition];
- if (value > 1.0f)
- value = 1.0f;
- else if (!(value > 0.0f))
- value = 0.0f;
-
- ei->weights[i] = value;
- ei->weight_error_scale[i] = partition_error_scale[partition] * error_weights[i];
- if (astc_isnan(ei->weight_error_scale[i]))
- {
- ASTC_CODEC_INTERNAL_ERROR;
- }
- }
-
- for (i = 0; i < partition_count; i++)
- {
- ei->ep.endpt0[i] = float4(blk->red_min, blk->green_min, blk->blue_min, blk->alpha_min);
- ei->ep.endpt1[i] = float4(blk->red_max, blk->green_max, blk->blue_max, blk->alpha_max);
- switch (component)
- {
- case 0: // red/x
- ei->ep.endpt0[i].x = lowvalues[i];
- ei->ep.endpt1[i].x = highvalues[i];
- break;
- case 1: // green/y
- ei->ep.endpt0[i].y = lowvalues[i];
- ei->ep.endpt1[i].y = highvalues[i];
- break;
- case 2: // blue/z
- ei->ep.endpt0[i].z = lowvalues[i];
- ei->ep.endpt1[i].z = highvalues[i];
- break;
- case 3: // alpha/w
- ei->ep.endpt0[i].w = lowvalues[i];
- ei->ep.endpt1[i].w = highvalues[i];
- break;
- }
- }
-
- // print all the data that this function computes.
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("%s: %dx%dx%d texels, %d partitions, component=%d\n", __func__, xdim, ydim, zdim, partition_count, component);
- printf("Endpoints:\n");
- for (i = 0; i < partition_count; i++)
- {
- printf("%d Low: <%g> => <%g %g %g %g>\n", i, lowvalues[i], ei->ep.endpt0[i].x, ei->ep.endpt0[i].y, ei->ep.endpt0[i].z, ei->ep.endpt0[i].w);
- printf("%d High: <%g> => <%g %g %g %g>\n", i, highvalues[i], ei->ep.endpt1[i].x, ei->ep.endpt1[i].y, ei->ep.endpt1[i].z, ei->ep.endpt1[i].w);
- }
- printf("Ideal-weights:\n");
-
- for (i = 0; i < texels_per_block; i++)
- {
- printf("%3d <%2d %2d %2d>=> %g (weight=%g)\n", i, i % xdim, (i / xdim) % ydim, i / (xdim * ydim), ei->weights[i], ei->weight_error_scale[i]);
- }
- printf("\n");
- }
- #endif
-}
-
-
-static void compute_endpoints_and_ideal_weights_2_components(int xdim, int ydim, int zdim, const partition_info * pt,
- const imageblock * blk, const error_weight_block * ewb,
- endpoints_and_weights * ei, int component1, int component2)
-{
- int i;
-
- int partition_count = pt->partition_count;
- ei->ep.partition_count = partition_count;
-
- float4 error_weightings[4];
- float4 color_scalefactors[4];
-
- float2 scalefactors[4];
-
- const float *error_weights;
- if (component1 == 0 && component2 == 1)
- error_weights = ewb->texel_weight_rg;
- else if (component1 == 0 && component2 == 2)
- error_weights = ewb->texel_weight_rb;
- else if (component1 == 1 && component2 == 2)
- error_weights = ewb->texel_weight_gb;
- else
- {
- error_weights = ewb->texel_weight_rg;
- ASTC_CODEC_INTERNAL_ERROR;
- }
-
- int texels_per_block = xdim * ydim * zdim;
-
- compute_partition_error_color_weightings(xdim, ydim, zdim, ewb, pt, error_weightings, color_scalefactors);
-
- for (i = 0; i < partition_count; i++)
- {
- float s1 = 0, s2 = 0;
- switch (component1)
- {
- case 0:
- s1 = color_scalefactors[i].x;
- break;
- case 1:
- s1 = color_scalefactors[i].y;
- break;
- case 2:
- s1 = color_scalefactors[i].z;
- break;
- case 3:
- s1 = color_scalefactors[i].w;
- break;
- }
-
- switch (component2)
- {
- case 0:
- s2 = color_scalefactors[i].x;
- break;
- case 1:
- s2 = color_scalefactors[i].y;
- break;
- case 2:
- s2 = color_scalefactors[i].z;
- break;
- case 3:
- s2 = color_scalefactors[i].w;
- break;
- }
- scalefactors[i] = normalize(float2(s1, s2)) * 1.41421356f;
- }
-
-
- float lowparam[4], highparam[4];
-
- float2 averages[4];
- float2 directions[4];
-
- line2 lines[4];
- float scale[4];
- float length_squared[4];
-
-
- for (i = 0; i < partition_count; i++)
- {
- lowparam[i] = 1e10;
- highparam[i] = -1e10;
- }
-
-
- compute_averages_and_directions_2_components(pt, blk, ewb, scalefactors, component1, component2, averages, directions);
-
- for (i = 0; i < partition_count; i++)
- {
- float2 egv = directions[i];
- if (egv.x + egv.y < 0.0f)
- directions[i] = float2(0, 0) - egv;
- }
-
- for (i = 0; i < partition_count; i++)
- {
- lines[i].a = averages[i];
- if (dot(directions[i], directions[i]) == 0.0f)
- lines[i].b = normalize(float2(1, 1));
- else
- lines[i].b = normalize(directions[i]);
- }
-
-
- for (i = 0; i < texels_per_block; i++)
- {
- if (error_weights[i] > 1e-10)
- {
- int partition = pt->partition_of_texel[i];
- float2 point = float2(blk->work_data[4 * i + component1], blk->work_data[4 * i + component2]) * scalefactors[partition];
- line2 l = lines[partition];
- float param = dot(point - l.a, l.b);
- ei->weights[i] = param;
- if (param < lowparam[partition])
- lowparam[partition] = param;
- if (param > highparam[partition])
- highparam[partition] = param;
- }
- else
- {
- ei->weights[i] = -1e38f;
- }
- }
-
- float2 lowvalues[4];
- float2 highvalues[4];
-
-
- for (i = 0; i < partition_count; i++)
- {
- float length = highparam[i] - lowparam[i];
- if (length < 0) // case for when none of the texels had any weight
- {
- lowparam[i] = 0.0f;
- highparam[i] = 1e-7f;
- }
-
- // it is possible for a uniform-color partition to produce length=0; this
- // causes NaN-production and NaN-propagation later on. Set length to
- // a small value to avoid this problem.
- if (length < 1e-7f)
- length = 1e-7f;
-
- length_squared[i] = length * length;
- scale[i] = 1.0f / length;
-
- float2 ep0 = lines[i].a + lines[i].b * lowparam[i];
- float2 ep1 = lines[i].a + lines[i].b * highparam[i];
-
- ep0 = ep0 / scalefactors[i];
- ep1 = ep1 / scalefactors[i];
-
- lowvalues[i] = ep0;
- highvalues[i] = ep1;
- }
-
-
- for (i = 0; i < partition_count; i++)
- {
- ei->ep.endpt0[i] = float4(blk->red_min, blk->green_min, blk->blue_min, blk->alpha_min);
- ei->ep.endpt1[i] = float4(blk->red_max, blk->green_max, blk->blue_max, blk->alpha_max);
-
- float2 ep0 = lowvalues[i];
- float2 ep1 = highvalues[i];
-
- switch (component1)
- {
- case 0:
- ei->ep.endpt0[i].x = ep0.x;
- ei->ep.endpt1[i].x = ep1.x;
- break;
- case 1:
- ei->ep.endpt0[i].y = ep0.x;
- ei->ep.endpt1[i].y = ep1.x;
- break;
- case 2:
- ei->ep.endpt0[i].z = ep0.x;
- ei->ep.endpt1[i].z = ep1.x;
- break;
- case 3:
- ei->ep.endpt0[i].w = ep0.x;
- ei->ep.endpt1[i].w = ep1.x;
- break;
- }
- switch (component2)
- {
- case 0:
- ei->ep.endpt0[i].x = ep0.y;
- ei->ep.endpt1[i].x = ep1.y;
- break;
- case 1:
- ei->ep.endpt0[i].y = ep0.y;
- ei->ep.endpt1[i].y = ep1.y;
- break;
- case 2:
- ei->ep.endpt0[i].z = ep0.y;
- ei->ep.endpt1[i].z = ep1.y;
- break;
- case 3:
- ei->ep.endpt0[i].w = ep0.y;
- ei->ep.endpt1[i].w = ep1.y;
- break;
- }
- }
-
- for (i = 0; i < texels_per_block; i++)
- {
- int partition = pt->partition_of_texel[i];
- float idx = (ei->weights[i] - lowparam[partition]) * scale[partition];
- if (idx > 1.0f)
- idx = 1.0f;
- else if (!(idx > 0.0f))
- idx = 0.0f;
-
- ei->weights[i] = idx;
- ei->weight_error_scale[i] = length_squared[partition] * error_weights[i];
- if (astc_isnan(ei->weight_error_scale[i]))
- {
- ASTC_CODEC_INTERNAL_ERROR;
- }
- }
-
- // print all the data that this function computes.
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("%s: %dx%dx%d texels, %d partitions, component1=%d, component2=%d\n", __func__, xdim, ydim, zdim, partition_count, component1, component2);
- printf("Endpoints:\n");
- for (i = 0; i < partition_count; i++)
- {
- printf("%d Low: <%g %g> => <%g %g %g %g>\n", i, lowvalues[i].x, lowvalues[i].y, ei->ep.endpt0[i].x, ei->ep.endpt0[i].y, ei->ep.endpt0[i].z, ei->ep.endpt0[i].w);
- printf("%d High: <%g %g> => <%g %g %g %g>\n", i, highvalues[i].x, highvalues[i].y, ei->ep.endpt1[i].x, ei->ep.endpt1[i].y, ei->ep.endpt1[i].z, ei->ep.endpt1[i].w);
- }
- printf("Ideal-weights:\n");
-
- for (i = 0; i < texels_per_block; i++)
- {
- printf("%3d <%2d %2d %2d>=> %g (weight=%g)\n", i, i % xdim, (i / xdim) % ydim, i / (xdim * ydim), ei->weights[i], ei->weight_error_scale[i]);
- }
- printf("\n");
- }
- #endif
-}
-
-static void compute_endpoints_and_ideal_weights_3_components(int xdim, int ydim, int zdim, const partition_info * pt,
- const imageblock * blk, const error_weight_block * ewb,
- endpoints_and_weights * ei, int component1, int component2, int component3)
-{
- int i;
-
- int partition_count = pt->partition_count;
- ei->ep.partition_count = partition_count;
-
- float4 error_weightings[4];
- float4 color_scalefactors[4];
-
- float3 scalefactors[4];
-
- int texels_per_block = xdim * ydim * zdim;
-
- const float *error_weights;
- if (component1 == 1 && component2 == 2 && component3 == 3)
- error_weights = ewb->texel_weight_gba;
- else if (component1 == 0 && component2 == 2 && component3 == 3)
- error_weights = ewb->texel_weight_rba;
- else if (component1 == 0 && component2 == 1 && component3 == 3)
- error_weights = ewb->texel_weight_rga;
- else if (component1 == 0 && component2 == 1 && component3 == 2)
- error_weights = ewb->texel_weight_rgb;
- else
- {
- error_weights = ewb->texel_weight_gba;
- ASTC_CODEC_INTERNAL_ERROR;
- }
-
- compute_partition_error_color_weightings(xdim, ydim, zdim, ewb, pt, error_weightings, color_scalefactors);
-
- for (i = 0; i < partition_count; i++)
- {
- float s1 = 0, s2 = 0, s3 = 0;
- switch (component1)
- {
- case 0:
- s1 = color_scalefactors[i].x;
- break;
- case 1:
- s1 = color_scalefactors[i].y;
- break;
- case 2:
- s1 = color_scalefactors[i].z;
- break;
- case 3:
- s1 = color_scalefactors[i].w;
- break;
- }
-
- switch (component2)
- {
- case 0:
- s2 = color_scalefactors[i].x;
- break;
- case 1:
- s2 = color_scalefactors[i].y;
- break;
- case 2:
- s2 = color_scalefactors[i].z;
- break;
- case 3:
- s2 = color_scalefactors[i].w;
- break;
- }
-
- switch (component3)
- {
- case 0:
- s3 = color_scalefactors[i].x;
- break;
- case 1:
- s3 = color_scalefactors[i].y;
- break;
- case 2:
- s3 = color_scalefactors[i].z;
- break;
- case 3:
- s3 = color_scalefactors[i].w;
- break;
- }
- scalefactors[i] = normalize(float3(s1, s2, s3)) * 1.73205080f;
- }
-
-
- float lowparam[4], highparam[4];
-
- float3 averages[4];
- float3 directions[4];
-
- line3 lines[4];
- float scale[4];
- float length_squared[4];
-
-
- for (i = 0; i < partition_count; i++)
- {
- lowparam[i] = 1e10;
- highparam[i] = -1e10;
- }
-
- compute_averages_and_directions_3_components(pt, blk, ewb, scalefactors, component1, component2, component3, averages, directions);
-
- for (i = 0; i < partition_count; i++)
- {
- float3 direc = directions[i];
- if (direc.x + direc.y + direc.z < 0.0f)
- directions[i] = float3(0, 0, 0) - direc;
- }
-
- for (i = 0; i < partition_count; i++)
- {
- lines[i].a = averages[i];
- if (dot(directions[i], directions[i]) == 0.0f)
- lines[i].b = normalize(float3(1, 1, 1));
- else
- lines[i].b = normalize(directions[i]);
- }
-
-
- for (i = 0; i < texels_per_block; i++)
- {
- if (error_weights[i] > 1e-10)
- {
- int partition = pt->partition_of_texel[i];
- float3 point = float3(blk->work_data[4 * i + component1], blk->work_data[4 * i + component2], blk->work_data[4 * i + component3]) * scalefactors[partition];
- line3 l = lines[partition];
- float param = dot(point - l.a, l.b);
- ei->weights[i] = param;
- if (param < lowparam[partition])
- lowparam[partition] = param;
- if (param > highparam[partition])
- highparam[partition] = param;
- }
- else
- {
- ei->weights[i] = -1e38f;
- }
- }
-
- float3 lowvalues[4];
- float3 highvalues[4];
-
-
- for (i = 0; i < partition_count; i++)
- {
- float length = highparam[i] - lowparam[i];
- if (length < 0) // case for when none of the texels had any weight
- {
- lowparam[i] = 0.0f;
- highparam[i] = 1e-7f;
- }
-
- // it is possible for a uniform-color partition to produce length=0; this
- // causes NaN-production and NaN-propagation later on. Set length to
- // a small value to avoid this problem.
- if (length < 1e-7f)
- length = 1e-7f;
-
- length_squared[i] = length * length;
- scale[i] = 1.0f / length;
-
- float3 ep0 = lines[i].a + lines[i].b * lowparam[i];
- float3 ep1 = lines[i].a + lines[i].b * highparam[i];
-
- ep0 = ep0 / scalefactors[i];
- ep1 = ep1 / scalefactors[i];
-
-
- lowvalues[i] = ep0;
- highvalues[i] = ep1;
- }
-
-
- for (i = 0; i < partition_count; i++)
- {
- ei->ep.endpt0[i] = float4(blk->red_min, blk->green_min, blk->blue_min, blk->alpha_min);
- ei->ep.endpt1[i] = float4(blk->red_max, blk->green_max, blk->blue_max, blk->alpha_max);
-
-
- float3 ep0 = lowvalues[i];
- float3 ep1 = highvalues[i];
-
- switch (component1)
- {
- case 0:
- ei->ep.endpt0[i].x = ep0.x;
- ei->ep.endpt1[i].x = ep1.x;
- break;
- case 1:
- ei->ep.endpt0[i].y = ep0.x;
- ei->ep.endpt1[i].y = ep1.x;
- break;
- case 2:
- ei->ep.endpt0[i].z = ep0.x;
- ei->ep.endpt1[i].z = ep1.x;
- break;
- case 3:
- ei->ep.endpt0[i].w = ep0.x;
- ei->ep.endpt1[i].w = ep1.x;
- break;
- }
- switch (component2)
- {
- case 0:
- ei->ep.endpt0[i].x = ep0.y;
- ei->ep.endpt1[i].x = ep1.y;
- break;
- case 1:
- ei->ep.endpt0[i].y = ep0.y;
- ei->ep.endpt1[i].y = ep1.y;
- break;
- case 2:
- ei->ep.endpt0[i].z = ep0.y;
- ei->ep.endpt1[i].z = ep1.y;
- break;
- case 3:
- ei->ep.endpt0[i].w = ep0.y;
- ei->ep.endpt1[i].w = ep1.y;
- break;
- }
- switch (component3)
- {
- case 0:
- ei->ep.endpt0[i].x = ep0.z;
- ei->ep.endpt1[i].x = ep1.z;
- break;
- case 1:
- ei->ep.endpt0[i].y = ep0.z;
- ei->ep.endpt1[i].y = ep1.z;
- break;
- case 2:
- ei->ep.endpt0[i].z = ep0.z;
- ei->ep.endpt1[i].z = ep1.z;
- break;
- case 3:
- ei->ep.endpt0[i].w = ep0.z;
- ei->ep.endpt1[i].w = ep1.z;
- break;
- }
- }
-
- for (i = 0; i < texels_per_block; i++)
- {
- int partition = pt->partition_of_texel[i];
- float idx = (ei->weights[i] - lowparam[partition]) * scale[partition];
- if (idx > 1.0f)
- idx = 1.0f;
- else if (!(idx > 0.0f))
- idx = 0.0f;
-
- ei->weights[i] = idx;
- ei->weight_error_scale[i] = length_squared[partition] * error_weights[i];
- if (astc_isnan(ei->weight_error_scale[i]))
- {
- ASTC_CODEC_INTERNAL_ERROR;
- }
- }
-
- // print all the data that this function computes.
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("%s: %dx%dx%d texels, %d partitions, component1=%d, component2=%d, component3=%d\n", __func__, xdim, ydim, zdim, partition_count, component1, component2, component3);
- printf("Endpoints:\n");
- for (i = 0; i < partition_count; i++)
- {
- printf("%d Low: <%g %g %f> => <%g %g %g %g>\n", i, lowvalues[i].x, lowvalues[i].y, lowvalues[i].z, ei->ep.endpt0[i].x, ei->ep.endpt0[i].y, ei->ep.endpt0[i].z, ei->ep.endpt0[i].w);
- printf("%d High: <%g %g %g> => <%g %g %g %g>\n", i, highvalues[i].x, highvalues[i].y, highvalues[i].z, ei->ep.endpt1[i].x, ei->ep.endpt1[i].y, ei->ep.endpt1[i].z, ei->ep.endpt1[i].w);
- }
- printf("Ideal-weights:\n");
-
- for (i = 0; i < texels_per_block; i++)
- {
- printf("%3d <%2d %2d %2d>=> %g (weight=%g)\n", i, (i % xdim), (i / xdim) % ydim, i / (xdim * ydim), ei->weights[i], ei->weight_error_scale[i]);
- }
- printf("\n");
- }
- #endif
-}
-
-
-
-static void compute_endpoints_and_ideal_weights_rgba(int xdim, int ydim, int zdim, const partition_info * pt, const imageblock * blk, const error_weight_block * ewb, endpoints_and_weights * ei)
-{
- int i;
-
-
- const float *error_weights = ewb->texel_weight;
-
- int partition_count = pt->partition_count;
- float lowparam[4], highparam[4];
- for (i = 0; i < partition_count; i++)
- {
- lowparam[i] = 1e10;
- highparam[i] = -1e10;
- }
-
- float4 averages[4];
- float4 directions_rgba[4];
- float3 directions_gba[4];
- float3 directions_rba[4];
- float3 directions_rga[4];
- float3 directions_rgb[4];
-
- line4 lines[4];
-
- float scale[4];
- float length_squared[4];
-
- float4 error_weightings[4];
- float4 color_scalefactors[4];
- float4 scalefactors[4];
-
- int texels_per_block = xdim * ydim * zdim;
-
- compute_partition_error_color_weightings(xdim, ydim, zdim, ewb, pt, error_weightings, color_scalefactors);
-
- for (i = 0; i < partition_count; i++)
- scalefactors[i] = normalize(color_scalefactors[i]) * 2.0f;
-
-
-
- compute_averages_and_directions_rgba(pt, blk, ewb, scalefactors, averages, directions_rgba, directions_gba, directions_rba, directions_rga, directions_rgb);
-
- // if the direction-vector ends up pointing from light to dark, FLIP IT!
- // this will make the first endpoint the darkest one.
- for (i = 0; i < partition_count; i++)
- {
- float4 direc = directions_rgba[i];
- if (direc.x + direc.y + direc.z < 0.0f)
- directions_rgba[i] = float4(0, 0, 0, 0) - direc;
- }
-
- for (i = 0; i < partition_count; i++)
- {
- lines[i].a = averages[i];
- if (dot(directions_rgba[i], directions_rgba[i]) == 0.0f)
- lines[i].b = normalize(float4(1, 1, 1, 1));
- else
- lines[i].b = normalize(directions_rgba[i]);
- }
-
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- for (i = 0; i < partition_count; i++)
- {
- printf("Direction-vector %d: <%f %f %f %f>\n", i, directions_rgba[i].x, directions_rgba[i].y, directions_rgba[i].z, directions_rgba[i].w);
- printf("Line %d A: <%f %f %f %f>\n", i, lines[i].a.x, lines[i].a.y, lines[i].a.z, lines[i].a.w);
- printf("Line %d B: <%f %f %f %f>\n", i, lines[i].b.x, lines[i].b.y, lines[i].b.z, lines[i].b.w);
- printf("Scalefactors %d: <%f %f %f %f>\n", i, scalefactors[i].x, scalefactors[i].y, scalefactors[i].z, scalefactors[i].w);
- }
- }
- #endif
-
-
- for (i = 0; i < texels_per_block; i++)
- {
- if (error_weights[i] > 1e-10)
- {
- int partition = pt->partition_of_texel[i];
-
- float4 point = float4(blk->work_data[4 * i], blk->work_data[4 * i + 1], blk->work_data[4 * i + 2], blk->work_data[4 * i + 3]) * scalefactors[partition];
- line4 l = lines[partition];
-
- float param = dot(point - l.a, l.b);
- ei->weights[i] = param;
- if (param < lowparam[partition])
- lowparam[partition] = param;
- if (param > highparam[partition])
- highparam[partition] = param;
- }
- else
- {
- ei->weights[i] = -1e38f;
- }
- }
-
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- for (i = 0; i < partition_count; i++)
- printf("Partition %d: Lowparam=%f Highparam=%f\n", i, lowparam[i], highparam[i]);
- }
- #endif
-
-
- for (i = 0; i < partition_count; i++)
- {
- float length = highparam[i] - lowparam[i];
- if (length < 0)
- {
- lowparam[i] = 0.0f;
- highparam[i] = 1e-7f;
- }
-
-
- // it is possible for a uniform-color partition to produce length=0; this
- // causes NaN-production and NaN-propagation later on. Set length to
- // a small value to avoid this problem.
- if (length < 1e-7f)
- length = 1e-7f;
-
- length_squared[i] = length * length;
- scale[i] = 1.0f / length;
-
- ei->ep.endpt0[i] = (lines[i].a + lines[i].b * lowparam[i]) / scalefactors[i];
- ei->ep.endpt1[i] = (lines[i].a + lines[i].b * highparam[i]) / scalefactors[i];
- }
-
- for (i = 0; i < texels_per_block; i++)
- {
- int partition = pt->partition_of_texel[i];
- float idx = (ei->weights[i] - lowparam[partition]) * scale[partition];
- if (idx > 1.0f)
- idx = 1.0f;
- else if (!(idx > 0.0f))
- idx = 0.0f;
- ei->weights[i] = idx;
- ei->weight_error_scale[i] = error_weights[i] * length_squared[partition];
- if (astc_isnan(ei->weight_error_scale[i]))
- {
- ASTC_CODEC_INTERNAL_ERROR;
- }
- }
-
-
- // print all the data that this function computes.
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("%s: %dx%dx%d texels, %d partitions\n", __func__, xdim, ydim, zdim, partition_count);
- printf("Endpoints:\n");
- for (i = 0; i < partition_count; i++)
- {
- printf("%d Low: <%g %g %g %g>\n", i, ei->ep.endpt0[i].x, ei->ep.endpt0[i].y, ei->ep.endpt0[i].z, ei->ep.endpt0[i].w);
- printf("%d High: <%g %g %g %g>\n", i, ei->ep.endpt1[i].x, ei->ep.endpt1[i].y, ei->ep.endpt1[i].z, ei->ep.endpt1[i].w);
- }
- printf("\nIdeal-weights:\n");
-
- for (i = 0; i < texels_per_block; i++)
- {
- printf("%3d <%2d %2d %2d>=> %g (weight=%g)\n", i, i % xdim, (i / xdim) % ydim, i / (xdim * ydim), ei->weights[i], ei->weight_error_scale[i]);
- }
- printf("\n\n");
- }
- #endif
-
-}
-
-
-
-/*
-
- For a given partitioning, compute: for each partition, the ideal endpoint colors;
- these define a color line for the partition. for each pixel, the ideal position of the pixel on the partition's
- color line. for each pixel, the length of the color line.
-
- These data allow us to assess the error introduced by removing and quantizing the per-pixel weights.
-
- */
-
-void compute_endpoints_and_ideal_weights_1_plane(int xdim, int ydim, int zdim, const partition_info * pt, const imageblock * blk, const error_weight_block * ewb, endpoints_and_weights * ei)
-{
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("%s: texels_per_block=%dx%dx%d\n\n", __func__, xdim, ydim, zdim);
- #endif
-
- int uses_alpha = imageblock_uses_alpha(xdim, ydim, zdim, blk);
- if (uses_alpha)
- {
- compute_endpoints_and_ideal_weights_rgba(xdim, ydim, zdim, pt, blk, ewb, ei);
- }
- else
- {
- compute_endpoints_and_ideal_weights_3_components(xdim, ydim, zdim, pt, blk, ewb, ei, 0, 1, 2);
- }
-}
-
-
-
-void compute_endpoints_and_ideal_weights_2_planes(int xdim, int ydim, int zdim, const partition_info * pt,
- const imageblock * blk, const error_weight_block * ewb, int separate_component,
- endpoints_and_weights * ei1, endpoints_and_weights * ei2)
-{
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("%s: texels_per_block=%dx%dx%d, separate_component=%d\n\n", __func__, xdim, ydim, zdim, separate_component);
- #endif
-
- int uses_alpha = imageblock_uses_alpha(xdim, ydim, zdim, blk);
- switch (separate_component)
- {
- case 0: // separate weights for red
- if (uses_alpha == 1)
- compute_endpoints_and_ideal_weights_3_components(xdim, ydim, zdim, pt, blk, ewb, ei1, 1, 2, 3);
- else
- compute_endpoints_and_ideal_weights_2_components(xdim, ydim, zdim, pt, blk, ewb, ei1, 1, 2);
- compute_endpoints_and_ideal_weights_1_component(xdim, ydim, zdim, pt, blk, ewb, ei2, 0);
- break;
-
- case 1: // separate weights for green
- if (uses_alpha == 1)
- compute_endpoints_and_ideal_weights_3_components(xdim, ydim, zdim, pt, blk, ewb, ei1, 0, 2, 3);
- else
- compute_endpoints_and_ideal_weights_2_components(xdim, ydim, zdim, pt, blk, ewb, ei1, 0, 2);
- compute_endpoints_and_ideal_weights_1_component(xdim, ydim, zdim, pt, blk, ewb, ei2, 1);
- break;
-
- case 2: // separate weights for blue
- if (uses_alpha == 1)
- compute_endpoints_and_ideal_weights_3_components(xdim, ydim, zdim, pt, blk, ewb, ei1, 0, 1, 3);
- else
- compute_endpoints_and_ideal_weights_2_components(xdim, ydim, zdim, pt, blk, ewb, ei1, 0, 1);
- compute_endpoints_and_ideal_weights_1_component(xdim, ydim, zdim, pt, blk, ewb, ei2, 2);
- break;
-
- case 3: // separate weights for alpha
- if (uses_alpha == 0)
- {
- ASTC_CODEC_INTERNAL_ERROR;
- }
- compute_endpoints_and_ideal_weights_3_components(xdim, ydim, zdim, pt, blk, ewb, ei1, 0, 1, 2);
-
- compute_endpoints_and_ideal_weights_1_component(xdim, ydim, zdim, pt, blk, ewb, ei2, 3);
- break;
- }
-
-}
-
-
-
-/*
- After having computed ideal weights for the case where a weight exists for
- every texel, we want to compute the ideal weights for the case where weights
- exist only for some texels.
-
- We do this with a steepest-descent grid solver; this works as follows:
-
- * First, for each actual weight, perform a weighted averaging based on the
- texels affected by the weight.
- * Then, set step size to <some initial value>
- * Then, repeat:
- 1: First, compute for each weight how much the error will change
- if we change the weight by an infinitesimal amount.
- 2: This produces a vector that points the direction we should step in.
- Normalize this vector.
- 3: Perform a step
- 4: Check if the step actually improved the error. If it did, perform
- another step in the same direction; repeat until error no longer
- improves. If the *first* step did not improve error, then we halve
- the step size.
- 5: If the step size dropped down below <some threshold value>,
- then we quit, else we go back to #1.
-
- Subroutines: one routine to apply a step and compute the step's effect on
- the error one routine to compute the error change of an infinitesimal
- weight change
-
- Data structures needed:
- For every decimation pattern, we need:
- * For each weight, a list of <texel, weight> tuples that tell which texels
- the weight influences.
- * For each texel, a list of <texel, weight> tuples that tell which weights
- go into a given texel.
-*/
-
-float compute_value_of_texel_flt(int texel_to_get, const decimation_table * it, const float *weights)
-{
- const uint8_t *texel_weights = it->texel_weights[texel_to_get];
- const float *texel_weights_float = it->texel_weights_float[texel_to_get];
-
- return
- (weights[texel_weights[0]] * texel_weights_float[0] + weights[texel_weights[1]] * texel_weights_float[1]) + (weights[texel_weights[2]] * texel_weights_float[2] + weights[texel_weights[3]] * texel_weights_float[3]);
-}
-
-
-static inline float compute_error_of_texel(const endpoints_and_weights * eai, int texel_to_get, const decimation_table * it, const float *weights)
-{
- float current_value = compute_value_of_texel_flt(texel_to_get, it, weights);
- float valuedif = current_value - eai->weights[texel_to_get];
- return valuedif * valuedif * eai->weight_error_scale[texel_to_get];
-}
-
-/*
- helper function: given
- * for each texel, an ideal weight and an error-modifier these are contained
- in an endpoints_and_weights data structure.
- * a weight_table data structure
- * for each weight, its current value
-
- compute the change to overall error that results from adding N to the weight
-*/
-
-
-// this routine is rather heavily optimized since it consumes a lot of CPU time.
-void compute_two_error_changes_from_perturbing_weight_infill(const endpoints_and_weights * eai, const decimation_table * it,
- float *infilled_weights, int weight_to_perturb,
- float perturbation1, float perturbation2, float *res1, float *res2)
-{
- int num_weights = it->weight_num_texels[weight_to_perturb];
- float error_change0 = 0.0f;
- float error_change1 = 0.0f;
- int i;
-
- const uint8_t *weight_texel_ptr = it->weight_texel[weight_to_perturb];
- const float *weights_ptr = it->weights_flt[weight_to_perturb];
- for (i = num_weights - 1; i >= 0; i--)
- {
- uint8_t weight_texel = weight_texel_ptr[i];
- float weights = weights_ptr[i];
-
- float scale = eai->weight_error_scale[weight_texel] * weights;
- float old_weight = infilled_weights[weight_texel];
- float ideal_weight = eai->weights[weight_texel];
-
- error_change0 += weights * scale;
- error_change1 += (old_weight - ideal_weight) * scale;
- }
- *res1 = error_change0 * (perturbation1 * perturbation1 * (1.0f / (TEXEL_WEIGHT_SUM * TEXEL_WEIGHT_SUM))) + error_change1 * (perturbation1 * (2.0f / TEXEL_WEIGHT_SUM));
- *res2 = error_change0 * (perturbation2 * perturbation2 * (1.0f / (TEXEL_WEIGHT_SUM * TEXEL_WEIGHT_SUM))) + error_change1 * (perturbation2 * (2.0f / TEXEL_WEIGHT_SUM));
-}
-
-
-
-float compute_error_of_weight_set(const endpoints_and_weights * eai, const decimation_table * it, const float *weights)
-{
- int i;
- int texel_count = it->num_texels;
- float error_summa = 0.0;
- for (i = 0; i < texel_count; i++)
- error_summa += compute_error_of_texel(eai, i, it, weights);
- return error_summa;
-}
-
-
-/*
- Given a complete weight set and a decimation table, try to
- compute the optimal weight set (assuming infinite precision)
- given the selected decimation table.
-*/
-
-void compute_ideal_weights_for_decimation_table(const endpoints_and_weights * eai, const decimation_table * it, float *weight_set, float *weights)
-{
- int i, j, k;
-
- int blockdim = (int)floor(sqrt((float)it->num_texels) + 0.5f);
- int texels_per_block = it->num_texels;
- int weight_count = it->num_weights;
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("%s : decimation from %d to %d weights\n\n", __func__, it->num_texels, it->num_weights);
- printf("Input weight set:\n");
- for (i = 0; i < it->num_texels; i++)
- {
- printf("%3d <%2d %2d> : %g\n", i, i % blockdim, i / blockdim, eai->weights[i]);
- }
- printf("\n");
- }
- #endif
-
-
- // perform a shortcut in the case of a complete decimation table
- if (texels_per_block == weight_count)
- {
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("%s : no decimation actually needed: early-out\n\n", __func__);
- #endif
-
- for (i = 0; i < it->num_texels; i++)
- {
- int texel = it->weight_texel[i][0];
- weight_set[i] = eai->weights[texel];
- weights[i] = eai->weight_error_scale[texel];
- }
- return;
- }
-
-
- // if the shortcut is not available, we will instead compute a simple estimate
- // and perform three rounds of refinement on that estimate.
-
- float initial_weight_set[MAX_WEIGHTS_PER_BLOCK];
- float infilled_weights[MAX_TEXELS_PER_BLOCK];
-
- // compute an initial average for each weight.
- for (i = 0; i < weight_count; i++)
- {
- int texel_count = it->weight_num_texels[i];
-
- float weight_weight = 1e-10f; // to avoid 0/0 later on
- float initial_weight = 0.0f;
- for (j = 0; j < texel_count; j++)
- {
- int texel = it->weight_texel[i][j];
- float weight = it->weights_flt[i][j];
- float contrib_weight = weight * eai->weight_error_scale[texel];
- weight_weight += contrib_weight;
- initial_weight += eai->weights[texel] * contrib_weight;
- }
-
- weights[i] = weight_weight;
- weight_set[i] = initial_weight / weight_weight; // this is the 0/0 that is to be avoided.
- }
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- // stash away the initial-weight estimates for later printing
- for (i = 0; i < weight_count; i++)
- initial_weight_set[i] = weight_set[i];
- }
- #endif
-
-
- for (i = 0; i < texels_per_block; i++)
- {
- infilled_weights[i] = compute_value_of_texel_flt(i, it, weight_set);
- }
-
- const float stepsizes[2] = { 0.25f, 0.125f };
-
- for (j = 0; j < 2; j++)
- {
- float stepsize = stepsizes[j];
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Pass %d, step=%f \n", j, stepsize);
- #endif
-
- for (i = 0; i < weight_count; i++)
- {
- float weight_val = weight_set[i];
- float error_change_up, error_change_down;
- compute_two_error_changes_from_perturbing_weight_infill(eai, it, infilled_weights, i, stepsize, -stepsize, &error_change_up, &error_change_down);
-
- /*
- assume that the error-change function behaves like a quadratic function in the interval examined,
- with "error_change_up" and "error_change_down" defining the function at the endpoints
- of the interval. Then, find the position where the function's derivative is zero.
-
- The "fabs(b) >= a" check tests several conditions in one:
- if a is negative, then the 2nd derivative of the function is negative;
- in this case, f'(x)=0 will maximize error.
- If fabs(b) > fabs(a), then f'(x)=0 will lie outside the interval altogether.
- If a and b are both 0, then set step to 0;
- otherwise, we end up computing 0/0, which produces a lethal NaN.
- We can get an a=b=0 situation if an error weight is 0 in the wrong place.
- */
-
- float step;
- float a = (error_change_up + error_change_down) * 2.0f;
- float b = error_change_down - error_change_up;
- if (fabs(b) >= a)
- {
- if (a <= 0.0f)
- {
- if (error_change_up < error_change_down)
- step = 1;
- else if (error_change_up > error_change_down)
- step = -1;
-
- else
- step = 0;
-
- }
- else
- {
- if (a < 1e-10f)
- a = 1e-10f;
- step = b / a;
- if (step < -1.0f)
- step = -1.0f;
- else if (step > 1.0f)
- step = 1.0f;
- }
- }
- else
- step = b / a;
-
-
- step *= stepsize;
- float new_weight_val = weight_val + step;
-
- // update the weight
- weight_set[i] = new_weight_val;
- // update the infilled-weights
- int num_weights = it->weight_num_texels[i];
- float perturbation = (new_weight_val - weight_val) * (1.0f / TEXEL_WEIGHT_SUM);
- const uint8_t *weight_texel_ptr = it->weight_texel[i];
- const float *weights_ptr = it->weights_flt[i];
- for (k = num_weights - 1; k >= 0; k--)
- {
- uint8_t weight_texel = weight_texel_ptr[k];
- float weight_weight = weights_ptr[k];
- infilled_weights[weight_texel] += perturbation * weight_weight;
- }
-
- }
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("\n");
- #endif
- }
-
-
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("Error weights, initial-estimates, final-results\n");
- for (i = 0; i < weight_count; i++)
- {
- printf("%2d -> weight=%g, initial=%g final=%g\n", i, weights[i], initial_weight_set[i], weight_set[i]);
- }
- printf("\n");
- }
- #endif
-
- return;
-}
-
-
-
-
-/*
- For a decimation table, try to compute an optimal weight set, assuming
- that the weights are quantized and subject to a transfer function.
-
- We do this as follows:
- First, we take the initial weights and quantize them. This is our initial estimate.
- Then, go through the weights one by one; try to perturb then up and down one weight at a
- time; apply any perturbations that improve overall error
- Repeat until we have made a complete processing pass over all weights without
- triggering any perturbations *OR* we have run 4 full passes.
-*/
-
-void compute_ideal_quantized_weights_for_decimation_table(const endpoints_and_weights * eai,
- const decimation_table * it,
- float low_bound, float high_bound, const float *weight_set_in, float *weight_set_out, uint8_t * quantized_weight_set, int quantization_level)
-{
- int i;
- int weight_count = it->num_weights;
- int texels_per_block = it->num_texels;
-
- const quantization_and_transfer_table *qat = &(quant_and_xfer_tables[quantization_level]);
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("%s : texels-per-block=%d, weights=%d, quantization-level=%d\n\n", __func__, texels_per_block, weight_count, quantization_level);
-
- printf("Weight values before quantization:\n");
- for (i = 0; i < weight_count; i++)
- printf("%3d : %g\n", i, weight_set_in[i]);
-
- printf("Low-bound: %f High-bound: %f\n", low_bound, high_bound);
- }
- #endif
-
-
- // quantize the weight set using both the specified low/high bounds and the
- // standard 0..1 weight bounds.
-
- /*
- WTF issue that we need to examine some time
- */
-
- if (!((high_bound - low_bound) > 0.5f))
- {
- low_bound = 0.0f;
- high_bound = 1.0f;
- }
-
- float rscale = high_bound - low_bound;
- float scale = 1.0f / rscale;
-
- // rescale the weights so that
- // low_bound -> 0
- // high_bound -> 1
- // OK: first, subtract low_bound, then divide by (high_bound - low_bound)
-
- for (i = 0; i < weight_count; i++)
- weight_set_out[i] = (weight_set_in[i] - low_bound) * scale;
-
-
-
- static const float quantization_step_table[12] = {
- 1.0f / 1.0f,
- 1.0f / 2.0f,
- 1.0f / 3.0f,
- 1.0f / 4.0f,
- 1.0f / 5.0f,
- 1.0f / 7.0f,
- 1.0f / 9.0f,
- 1.0f / 11.0f,
- 1.0f / 15.0f,
- 1.0f / 19.0f,
- 1.0f / 23.0f,
- 1.0f / 31.0f,
- };
-
- float quantization_cutoff = quantization_step_table[quantization_level] * 0.333f;
-
-
- int is_perturbable[MAX_WEIGHTS_PER_BLOCK];
- int perturbable_count = 0;
-
- // quantize the weight set
- for (i = 0; i < weight_count; i++)
- {
- float ix0 = weight_set_out[i];
- if (ix0 < 0.0f)
- ix0 = 0.0f;
- if (ix0 > 1.0f)
- ix0 = 1.0f;
- float ix = ix0;
-
- ix *= 1024.0f;
- int ix2 = (int)floor(ix + 0.5f);
- int weight = qat->closest_quantized_weight[ix2];
-
- ix = qat->unquantized_value_flt[weight];
- weight_set_out[i] = ix;
- quantized_weight_set[i] = weight;
-
- // test whether the error of the weight is greater than 1/3 of the weight spacing;
- // if it is not, then it is flagged as "not perturbable". This causes a
- // quality loss of about 0.002 dB, which is totally worth the speedup we're getting.
- is_perturbable[i] = 0;
- if (fabs(ix - ix0) > quantization_cutoff)
- {
- is_perturbable[i] = 1;
- perturbable_count++;
- }
- }
-
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("Weight values after initial quantization:\n");
- for (i = 0; i < weight_count; i++)
- printf("%3d : %g <%d>\n", i, weight_set_out[i], quantized_weight_set[i]);
- }
- #endif
-
-
-
-
- // if the decimation table is complete, the quantization above was all we needed to do,
- // so we can early-out.
- if (it->num_weights == it->num_texels)
- {
- // invert the weight-scaling that was done initially
- // 0 -> low_bound
- // 1 -> high_bound
-
- rscale = high_bound - low_bound;
- for (i = 0; i < weight_count; i++)
- weight_set_out[i] = (weight_set_out[i] * rscale) + low_bound;
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("Weight values after adjustment:\n");
- for (i = 0; i < weight_count; i++)
- printf("%3d : %g <%d> <error=%g>\n", i, weight_set_out[i], quantized_weight_set[i], weight_set_out[i] - weight_set_in[i]);
- printf("\n");
- printf("%s: Early-out\n\n", __func__);
-
- }
- #endif
-
- return;
- }
-
-
- int weights_tested = 0;
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- int perturbation_count = 0;
- #endif
-
- // if no weights are flagged as perturbable, don't try to perturb them.
- // if only one weight is flagged as perturbable, perturbation is also pointless.
- if (perturbable_count > 1)
- {
- endpoints_and_weights eaix;
- for (i = 0; i < texels_per_block; i++)
- {
- eaix.weights[i] = (eai->weights[i] - low_bound) * scale;
- eaix.weight_error_scale[i] = eai->weight_error_scale[i];
- }
-
- float infilled_weights[MAX_TEXELS_PER_BLOCK];
- for (i = 0; i < texels_per_block; i++)
- infilled_weights[i] = compute_value_of_texel_flt(i, it, weight_set_out);
-
- int weight_to_perturb = 0;
- int weights_since_last_perturbation = 0;
- int num_weights = it->num_weights;
-
- while (weights_since_last_perturbation < num_weights && weights_tested < num_weights * 4)
- {
- int do_quant_mod = 0;
- if (is_perturbable[weight_to_perturb])
- {
-
- int weight_val = quantized_weight_set[weight_to_perturb];
- int weight_next_up = qat->next_quantized_value[weight_val];
- int weight_next_down = qat->prev_quantized_value[weight_val];
- float flt_weight_val = qat->unquantized_value_flt[weight_val];
- float flt_weight_next_up = qat->unquantized_value_flt[weight_next_up];
- float flt_weight_next_down = qat->unquantized_value_flt[weight_next_down];
-
-
- int do_quant_mod = 0;
-
- float error_change_up, error_change_down;
-
- // compute the error change from perturbing the weight either up or down.
- compute_two_error_changes_from_perturbing_weight_infill(&eaix,
- it,
- infilled_weights,
- weight_to_perturb,
- (flt_weight_next_up - flt_weight_val), (flt_weight_next_down - flt_weight_val), &error_change_up, &error_change_down);
-
- int new_weight_val;
- float flt_new_weight_val;
- if (weight_val != weight_next_up && error_change_up < 0.0f)
- {
- do_quant_mod = 1;
- new_weight_val = weight_next_up;
- flt_new_weight_val = flt_weight_next_up;
- }
- else if (weight_val != weight_next_down && error_change_down < 0.0f)
- {
- do_quant_mod = 1;
- new_weight_val = weight_next_down;
- flt_new_weight_val = flt_weight_next_down;
- }
-
-
- if (do_quant_mod)
- {
-
- // update the weight.
- weight_set_out[weight_to_perturb] = flt_new_weight_val;
- quantized_weight_set[weight_to_perturb] = new_weight_val;
-
- // update the infilled-weights
- int num_weights = it->weight_num_texels[weight_to_perturb];
- float perturbation = (flt_new_weight_val - flt_weight_val) * (1.0f / TEXEL_WEIGHT_SUM);
- const uint8_t *weight_texel_ptr = it->weight_texel[weight_to_perturb];
- const float *weights_ptr = it->weights_flt[weight_to_perturb];
- for (i = num_weights - 1; i >= 0; i--)
- {
- uint8_t weight_texel = weight_texel_ptr[i];
- float weights = weights_ptr[i];
- infilled_weights[weight_texel] += perturbation * weights;
- }
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("Perturbation of weight %d : %g\n", weight_to_perturb, perturbation * (float)TEXEL_WEIGHT_SUM);
- perturbation_count++;
- }
- #endif
- }
- }
-
- if (do_quant_mod)
- weights_since_last_perturbation = 0;
- else
- weights_since_last_perturbation++;
-
- weight_to_perturb++;
- if (weight_to_perturb >= num_weights)
- weight_to_perturb -= num_weights;
-
- weights_tested++;
- }
- }
-
- // invert the weight-scaling that was done initially
- // 0 -> low_bound
- // 1 -> high_bound
-
-
- for (i = 0; i < weight_count; i++)
- weight_set_out[i] = (weight_set_out[i] * rscale) + low_bound;
-
-
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("%d weights, %d weight tests, %d perturbations\n", weight_count, weights_tested, perturbation_count);
- printf("Weight values after adjustment:\n");
- for (i = 0; i < weight_count; i++)
- printf("%3d : %g <%d>\n", i, weight_set_out[i], quantized_weight_set[i]);
- printf("\n");
- }
- #endif
-
-}
-
-
-
-
-
-
-static inline float mat_square_sum(mat2 p)
-{
- float a = p.v[0].x;
- float b = p.v[0].y;
- float c = p.v[1].x;
- float d = p.v[1].y;
- return a * a + b * b + c * c + d * d;
-}
-
-
-
-
-
-
-
-
-
-
-/*
- for a given weight set, we wish to recompute the colors so that they are optimal for a particular weight set. */
-void recompute_ideal_colors(int xdim, int ydim, int zdim, int weight_quantization_mode, endpoints * ep, // contains the endpoints we wish to update
- float4 * rgbs_vectors, // used to return RGBS-vectors. (endpoint mode #6)
- float4 * rgbo_vectors, // used to return RGBO-vectors. (endpoint mode #7)
- float2 * lum_vectors, // used to return luminance-vectors.
- const uint8_t * weight_set8, // the current set of weight values
- const uint8_t * plane2_weight_set8, // NULL if plane 2 is not actually used.
- int plane2_color_component, // color component for 2nd plane of weights; -1 if the 2nd plane of weights is not present
- const partition_info * pi, const decimation_table * it, const imageblock * pb, // picture-block containing the actual data.
- const error_weight_block * ewb)
-{
- int i, j;
-
- int texels_per_block = xdim * ydim * zdim;
-
- const quantization_and_transfer_table *qat = &(quant_and_xfer_tables[weight_quantization_mode]);
-
- float weight_set[MAX_WEIGHTS_PER_BLOCK];
- float plane2_weight_set[MAX_WEIGHTS_PER_BLOCK];
-
- for (i = 0; i < it->num_weights; i++)
- {
- weight_set[i] = qat->unquantized_value_flt[weight_set8[i]];
- }
- if (plane2_weight_set8)
- {
- for (i = 0; i < it->num_weights; i++)
- plane2_weight_set[i] = qat->unquantized_value_flt[plane2_weight_set8[i]];
- }
-
- int partition_count = pi->partition_count;
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("%s : %dx%dx%d texels_per_block, %d partitions, plane2-color-component=%d\n\n", __func__, xdim, ydim, zdim, partition_count, plane2_color_component);
-
- printf("Pre-adjustment endpoint-colors: \n");
- for (i = 0; i < partition_count; i++)
- {
- printf("%d Low <%g %g %g %g>\n", i, ep->endpt0[i].x, ep->endpt0[i].y, ep->endpt0[i].z, ep->endpt0[i].w);
- printf("%d High <%g %g %g %g>\n", i, ep->endpt1[i].x, ep->endpt1[i].y, ep->endpt1[i].z, ep->endpt1[i].w);
- }
- }
- #endif
-
-
- mat2 pmat1_red[4], pmat1_green[4], pmat1_blue[4], pmat1_alpha[4], pmat1_lum[4], pmat1_scale[4]; // matrices for plane of weights 1
- mat2 pmat2_red[4], pmat2_green[4], pmat2_blue[4], pmat2_alpha[4]; // matrices for plane of weights 2
- float2 red_vec[4];
- float2 green_vec[4];
- float2 blue_vec[4];
- float2 alpha_vec[4];
- float2 lum_vec[4];
- float2 scale_vec[4];
-
- for (i = 0; i < partition_count; i++)
- {
- for (j = 0; j < 2; j++)
- {
- pmat1_red[i].v[j] = float2(0, 0);
- pmat2_red[i].v[j] = float2(0, 0);
- pmat1_green[i].v[j] = float2(0, 0);
- pmat2_green[i].v[j] = float2(0, 0);
- pmat1_blue[i].v[j] = float2(0, 0);
- pmat2_blue[i].v[j] = float2(0, 0);
- pmat1_alpha[i].v[j] = float2(0, 0);
- pmat2_alpha[i].v[j] = float2(0, 0);
- pmat1_lum[i].v[j] = float2(0, 0);
- pmat1_scale[i].v[j] = float2(0, 0);
- }
- red_vec[i] = float2(0, 0);
- green_vec[i] = float2(0, 0);
- blue_vec[i] = float2(0, 0);
- alpha_vec[i] = float2(0, 0);
- lum_vec[i] = float2(0, 0);
- scale_vec[i] = float2(0, 0);
- }
-
-
- float wmin1[4], wmax1[4];
- float wmin2[4], wmax2[4];
- float red_weight_sum[4];
- float green_weight_sum[4];
- float blue_weight_sum[4];
- float alpha_weight_sum[4];
- float lum_weight_sum[4];
- float scale_weight_sum[4];
-
- float red_weight_weight_sum[4];
- float green_weight_weight_sum[4];
- float blue_weight_weight_sum[4];
-
- float psum[4]; // sum of (weight * qweight^2) across (red,green,blue)
- float qsum[4]; // sum of (weight * qweight * texelval) across (red,green,blue)
-
-
- for (i = 0; i < partition_count; i++)
- {
- wmin1[i] = 1.0f;
- wmax1[i] = 0.0f;
- wmin2[i] = 1.0f;
- wmax2[i] = 0.0f;
- red_weight_sum[i] = 1e-17f;
- green_weight_sum[i] = 1e-17f;
- blue_weight_sum[i] = 1e-17f;
- alpha_weight_sum[i] = 1e-17f;
-
- lum_weight_sum[i] = 1e-17f;
- scale_weight_sum[i] = 1e-17f;
-
- red_weight_weight_sum[i] = 1e-17f;
- green_weight_weight_sum[i] = 1e-17f;
- blue_weight_weight_sum[i] = 1e-17f;
-
- psum[i] = 1e-17f;
- qsum[i] = 1e-17f;
- }
-
-
- // for each partition, compute the direction that an RGB-scale color endpoint pair would have.
- float3 rgb_sum[4];
- float3 rgb_weight_sum[4];
- float3 scale_directions[4];
- float scale_min[4];
- float scale_max[4];
- float lum_min[4];
- float lum_max[4];
-
- for (i = 0; i < partition_count; i++)
- {
- rgb_sum[i] = float3(1e-17f, 1e-17f, 1e-17f);
- rgb_weight_sum[i] = float3(1e-17f, 1e-17f, 1e-17f);
- }
-
-
- for (i = 0; i < texels_per_block; i++)
- {
- float3 rgb = float3(pb->work_data[4 * i], pb->work_data[4 * i + 1], pb->work_data[4 * i + 2]);
- float3 rgb_weight = float3(ewb->texel_weight_r[i],
- ewb->texel_weight_g[i],
- ewb->texel_weight_b[i]);
-
- int part = pi->partition_of_texel[i];
- rgb_sum[part] = rgb_sum[part] + (rgb * rgb_weight);
- rgb_weight_sum[part] = rgb_weight_sum[part] + rgb_weight;
- }
-
- for (i = 0; i < partition_count; i++)
- {
- scale_directions[i] = normalize(rgb_sum[i] / rgb_weight_sum[i]);
- scale_max[i] = 0.0f;
- scale_min[i] = 1e10f;
- lum_max[i] = 0.0f;
- lum_min[i] = 1e10f;
- }
-
-
-
-
-
- for (i = 0; i < texels_per_block; i++)
- {
- float r = pb->work_data[4 * i];
- float g = pb->work_data[4 * i + 1];
- float b = pb->work_data[4 * i + 2];
- float a = pb->work_data[4 * i + 3];
-
- int part = pi->partition_of_texel[i];
- float idx0 = it ? compute_value_of_texel_flt(i, it, weight_set) : weight_set[i];
- float om_idx0 = 1.0f - idx0;
-
- if (idx0 > wmax1[part])
- wmax1[part] = idx0;
- if (idx0 < wmin1[part])
- wmin1[part] = idx0;
-
- float red_weight = ewb->texel_weight_r[i];
- float green_weight = ewb->texel_weight_g[i];
- float blue_weight = ewb->texel_weight_b[i];
- float alpha_weight = ewb->texel_weight_a[i];
-
- float lum_weight = (red_weight + green_weight + blue_weight);
- float scale_weight = lum_weight;
-
- float lum = (r * red_weight + g * green_weight + b * blue_weight) / lum_weight;
- float3 scale_direction = scale_directions[part];
- float scale = dot(scale_direction, float3(r, g, b));
- if (lum < lum_min[part])
- lum_min[part] = scale;
- if (lum > lum_max[part])
- lum_max[part] = scale;
- if (scale < scale_min[part])
- scale_min[part] = scale;
- if (scale > scale_max[part])
- scale_max[part] = scale;
-
-
- red_weight_sum[part] += red_weight;
- green_weight_sum[part] += green_weight;
- blue_weight_sum[part] += blue_weight;
- alpha_weight_sum[part] += alpha_weight;
- lum_weight_sum[part] += lum_weight;
- scale_weight_sum[part] += scale_weight;
-
-
- pmat1_red[part].v[0].x += om_idx0 * om_idx0 * red_weight;
- pmat1_red[part].v[0].y += idx0 * om_idx0 * red_weight;
- pmat1_red[part].v[1].x += idx0 * om_idx0 * red_weight;
- pmat1_red[part].v[1].y += idx0 * idx0 * red_weight;
-
- pmat1_green[part].v[0].x += om_idx0 * om_idx0 * green_weight;
- pmat1_green[part].v[0].y += idx0 * om_idx0 * green_weight;
- pmat1_green[part].v[1].x += idx0 * om_idx0 * green_weight;
- pmat1_green[part].v[1].y += idx0 * idx0 * green_weight;
-
- pmat1_blue[part].v[0].x += om_idx0 * om_idx0 * blue_weight;
- pmat1_blue[part].v[0].y += idx0 * om_idx0 * blue_weight;
- pmat1_blue[part].v[1].x += idx0 * om_idx0 * blue_weight;
- pmat1_blue[part].v[1].y += idx0 * idx0 * blue_weight;
-
- pmat1_alpha[part].v[0].x += om_idx0 * om_idx0 * alpha_weight;
- pmat1_alpha[part].v[0].y += idx0 * om_idx0 * alpha_weight;
- pmat1_alpha[part].v[1].x += idx0 * om_idx0 * alpha_weight;
- pmat1_alpha[part].v[1].y += idx0 * idx0 * alpha_weight;
-
- pmat1_lum[part].v[0].x += om_idx0 * om_idx0 * lum_weight;
- pmat1_lum[part].v[0].y += idx0 * om_idx0 * lum_weight;
- pmat1_lum[part].v[1].x += idx0 * om_idx0 * lum_weight;
- pmat1_lum[part].v[1].y += idx0 * idx0 * lum_weight;
-
- pmat1_scale[part].v[0].x += om_idx0 * om_idx0 * scale_weight;
- pmat1_scale[part].v[0].y += idx0 * om_idx0 * scale_weight;
- pmat1_scale[part].v[1].x += idx0 * om_idx0 * scale_weight;
- pmat1_scale[part].v[1].y += idx0 * idx0 * scale_weight;
-
- float idx1 = 0.0f, om_idx1 = 0.0f;
- if (plane2_weight_set8)
- {
- idx1 = it ? compute_value_of_texel_flt(i, it, plane2_weight_set) : plane2_weight_set[i];
- om_idx1 = 1.0f - idx1;
- if (idx1 > wmax2[part])
- wmax2[part] = idx1;
- if (idx1 < wmin2[part])
- wmin2[part] = idx1;
-
- pmat2_red[part].v[0].x += om_idx1 * om_idx1 * red_weight;
- pmat2_red[part].v[0].y += idx1 * om_idx1 * red_weight;
- pmat2_red[part].v[1].x += idx1 * om_idx1 * red_weight;
- pmat2_red[part].v[1].y += idx1 * idx1 * red_weight;
-
- pmat2_green[part].v[0].x += om_idx1 * om_idx1 * green_weight;
- pmat2_green[part].v[0].y += idx1 * om_idx1 * green_weight;
- pmat2_green[part].v[1].x += idx1 * om_idx1 * green_weight;
- pmat2_green[part].v[1].y += idx1 * idx1 * green_weight;
-
- pmat2_blue[part].v[0].x += om_idx1 * om_idx1 * blue_weight;
- pmat2_blue[part].v[0].y += idx1 * om_idx1 * blue_weight;
- pmat2_blue[part].v[1].x += idx1 * om_idx1 * blue_weight;
- pmat2_blue[part].v[1].y += idx1 * idx1 * blue_weight;
-
- pmat2_alpha[part].v[0].x += om_idx1 * om_idx1 * alpha_weight;
- pmat2_alpha[part].v[0].y += idx1 * om_idx1 * alpha_weight;
- pmat2_alpha[part].v[1].x += idx1 * om_idx1 * alpha_weight;
- pmat2_alpha[part].v[1].y += idx1 * idx1 * alpha_weight;
- }
-
- float red_idx = (plane2_color_component == 0) ? idx1 : idx0;
- float green_idx = (plane2_color_component == 1) ? idx1 : idx0;
- float blue_idx = (plane2_color_component == 2) ? idx1 : idx0;
- float alpha_idx = (plane2_color_component == 3) ? idx1 : idx0;
-
-
- red_vec[part].x += (red_weight * r) * (1.0f - red_idx);
- green_vec[part].x += (green_weight * g) * (1.0f - green_idx);
- blue_vec[part].x += (blue_weight * b) * (1.0f - blue_idx);
- alpha_vec[part].x += (alpha_weight * a) * (1.0f - alpha_idx);
- lum_vec[part].x += (lum_weight * lum) * om_idx0;
- scale_vec[part].x += (scale_weight * scale) * om_idx0;
-
- red_vec[part].y += (red_weight * r) * red_idx;
- green_vec[part].y += (green_weight * g) * green_idx;
- blue_vec[part].y += (blue_weight * b) * blue_idx;
- alpha_vec[part].y += (alpha_weight * a) * alpha_idx;
- lum_vec[part].y += (lum_weight * lum) * idx0;
- scale_vec[part].y += (scale_weight * scale) * idx0;
-
- red_weight_weight_sum[part] += red_weight * red_idx;
- green_weight_weight_sum[part] += green_weight * green_idx;
- blue_weight_weight_sum[part] += blue_weight * blue_idx;
-
- psum[part] += red_weight * red_idx * red_idx + green_weight * green_idx * green_idx + blue_weight * blue_idx * blue_idx;
-
- }
-
- // calculations specific to mode #7, the HDR RGB-scale mode.
- float red_sum[4];
- float green_sum[4];
- float blue_sum[4];
- for (i = 0; i < partition_count; i++)
- {
- red_sum[i] = red_vec[i].x + red_vec[i].y;
- green_sum[i] = green_vec[i].x + green_vec[i].y;
- blue_sum[i] = blue_vec[i].x + blue_vec[i].y;
- qsum[i] = red_vec[i].y + green_vec[i].y + blue_vec[i].y;
- }
-
- // RGB+offset for HDR endpoint mode #7
- int rgbo_fail[4];
- for (i = 0; i < partition_count; i++)
- {
- mat4 mod7_mat;
- mod7_mat.v[0] = float4(red_weight_sum[i], 0.0f, 0.0f, red_weight_weight_sum[i]);
- mod7_mat.v[1] = float4(0.0f, green_weight_sum[i], 0.0f, green_weight_weight_sum[i]);
- mod7_mat.v[2] = float4(0.0f, 0.0f, blue_weight_sum[i], blue_weight_weight_sum[i]);
- mod7_mat.v[3] = float4(red_weight_weight_sum[i], green_weight_weight_sum[i], blue_weight_weight_sum[i], psum[i]);
-
- float4 vect = float4(red_sum[i], green_sum[i], blue_sum[i], qsum[i]);
-
- #ifdef DEBUG_CAPTURE_NAN
- fedisableexcept(FE_DIVBYZERO | FE_INVALID);
- #endif
-
- mat4 rmod7_mat = invert(mod7_mat);
- float4 rgbovec = transform(rmod7_mat, vect);
- rgbo_vectors[i] = rgbovec;
-
- // we will occasionally get a failure due to a singular matrix. Record whether such a
- // failure has taken place; if it did, compute rgbo_vectors[] with a different method
- // later on.
- float chkval = dot(rgbovec, rgbovec);
- rgbo_fail[i] = chkval != chkval;
-
- #ifdef DEBUG_CAPTURE_NAN
- feenableexcept(FE_DIVBYZERO | FE_INVALID);
- #endif
- }
-
-
-
- // initialize the luminance and scale vectors with a reasonable default,
- // just in case the subsequent calculation blows up.
- for (i = 0; i < partition_count; i++)
- {
-
- #ifdef DEBUG_CAPTURE_NAN
- fedisableexcept(FE_DIVBYZERO | FE_INVALID);
- #endif
-
- float scalediv = scale_min[i] / scale_max[i];
- if (!(scalediv > 0.0f))
- scalediv = 0.0f; // set to zero if scalediv is zero, negative, or NaN.
-
- #ifdef DEBUG_CAPTURE_NAN
- feenableexcept(FE_DIVBYZERO | FE_INVALID);
- #endif
-
- if (scalediv > 1.0f)
- scalediv = 1.0f;
-
- rgbs_vectors[i] = float4(scale_directions[i] * scale_max[i], scalediv);
- lum_vectors[i] = float2(lum_min[i], lum_max[i]);
- }
-
-
-
- for (i = 0; i < partition_count; i++)
- {
-
- if (wmin1[i] >= wmax1[i] * 0.999)
- {
- // if all weights in the partition were equal, then just take average
- // of all colors in the partition and use that as both endpoint colors.
- float4 avg = float4((red_vec[i].x + red_vec[i].y) / red_weight_sum[i],
- (green_vec[i].x + green_vec[i].y) / green_weight_sum[i],
- (blue_vec[i].x + blue_vec[i].y) / blue_weight_sum[i],
- (alpha_vec[i].x + alpha_vec[i].y) / alpha_weight_sum[i]);
-
- if (plane2_color_component != 0 && avg.x == avg.x)
- ep->endpt0[i].x = ep->endpt1[i].x = avg.x;
- if (plane2_color_component != 1 && avg.y == avg.y)
- ep->endpt0[i].y = ep->endpt1[i].y = avg.y;
- if (plane2_color_component != 2 && avg.z == avg.z)
- ep->endpt0[i].z = ep->endpt1[i].z = avg.z;
- if (plane2_color_component != 3 && avg.w == avg.w)
- ep->endpt0[i].w = ep->endpt1[i].w = avg.w;
-
- rgbs_vectors[i] = float4(scale_directions[i] * scale_max[i], 1.0f);
- float lumval = (red_vec[i].x + red_vec[i].y + green_vec[i].x + green_vec[i].y + blue_vec[i].x + blue_vec[i].y) / (red_weight_sum[i] + green_weight_sum[i] + blue_weight_sum[i]);
- lum_vectors[i] = float2(lumval, lumval);
- }
-
- else
- {
-
- // otherwise, complete the analytic calculation of ideal-endpoint-values
- // for the given set of texel weights and pixel colors.
-
- #ifdef DEBUG_CAPTURE_NAN
- fedisableexcept(FE_DIVBYZERO | FE_INVALID);
- #endif
-
- float red_det1 = determinant(pmat1_red[i]);
- float green_det1 = determinant(pmat1_green[i]);
- float blue_det1 = determinant(pmat1_blue[i]);
- float alpha_det1 = determinant(pmat1_alpha[i]);
- float lum_det1 = determinant(pmat1_lum[i]);
- float scale_det1 = determinant(pmat1_scale[i]);
-
- float red_mss1 = mat_square_sum(pmat1_red[i]);
- float green_mss1 = mat_square_sum(pmat1_green[i]);
- float blue_mss1 = mat_square_sum(pmat1_blue[i]);
- float alpha_mss1 = mat_square_sum(pmat1_alpha[i]);
- float lum_mss1 = mat_square_sum(pmat1_lum[i]);
- float scale_mss1 = mat_square_sum(pmat1_scale[i]);
-
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Plane-1 partition %d determinants: R=%g G=%g B=%g A=%g L=%g S=%g\n", i, red_det1, green_det1, blue_det1, alpha_det1, lum_det1, scale_det1);
- #endif
-
- pmat1_red[i] = invert(pmat1_red[i]);
- pmat1_green[i] = invert(pmat1_green[i]);
- pmat1_blue[i] = invert(pmat1_blue[i]);
- pmat1_alpha[i] = invert(pmat1_alpha[i]);
- pmat1_lum[i] = invert(pmat1_lum[i]);
- pmat1_scale[i] = invert(pmat1_scale[i]);
-
- float4 ep0 = float4(dot(pmat1_red[i].v[0], red_vec[i]),
- dot(pmat1_green[i].v[0], green_vec[i]),
- dot(pmat1_blue[i].v[0], blue_vec[i]),
- dot(pmat1_alpha[i].v[0], alpha_vec[i]));
- float4 ep1 = float4(dot(pmat1_red[i].v[1], red_vec[i]),
- dot(pmat1_green[i].v[1], green_vec[i]),
- dot(pmat1_blue[i].v[1], blue_vec[i]),
- dot(pmat1_alpha[i].v[1], alpha_vec[i]));
-
- float lum_ep0 = dot(pmat1_lum[i].v[0], lum_vec[i]);
- float lum_ep1 = dot(pmat1_lum[i].v[1], lum_vec[i]);
- float scale_ep0 = dot(pmat1_scale[i].v[0], scale_vec[i]);
- float scale_ep1 = dot(pmat1_scale[i].v[1], scale_vec[i]);
-
-
- if (plane2_color_component != 0 && fabs(red_det1) > (red_mss1 * 1e-4f) && ep0.x == ep0.x && ep1.x == ep1.x)
- {
- ep->endpt0[i].x = ep0.x;
- ep->endpt1[i].x = ep1.x;
- }
- if (plane2_color_component != 1 && fabs(green_det1) > (green_mss1 * 1e-4f) && ep0.y == ep0.y && ep1.y == ep1.y)
- {
- ep->endpt0[i].y = ep0.y;
- ep->endpt1[i].y = ep1.y;
- }
- if (plane2_color_component != 2 && fabs(blue_det1) > (blue_mss1 * 1e-4f) && ep0.z == ep0.z && ep1.z == ep1.z)
- {
- ep->endpt0[i].z = ep0.z;
- ep->endpt1[i].z = ep1.z;
- }
- if (plane2_color_component != 3 && fabs(alpha_det1) > (alpha_mss1 * 1e-4f) && ep0.w == ep0.w && ep1.w == ep1.w)
- {
- ep->endpt0[i].w = ep0.w;
- ep->endpt1[i].w = ep1.w;
- }
-
- if (fabs(lum_det1) > (lum_mss1 * 1e-4f) && lum_ep0 == lum_ep0 && lum_ep1 == lum_ep1 && lum_ep0 < lum_ep1)
- {
- lum_vectors[i].x = lum_ep0;
- lum_vectors[i].y = lum_ep1;
- }
- if (fabs(scale_det1) > (scale_mss1 * 1e-4f) && scale_ep0 == scale_ep0 && scale_ep1 == scale_ep1 && scale_ep0 < scale_ep1)
- {
- float scalediv = scale_ep0 / scale_ep1;
- rgbs_vectors[i] = float4(scale_directions[i] * scale_ep1, scalediv);
- }
-
-
- #ifdef DEBUG_CAPTURE_NAN
- feenableexcept(FE_DIVBYZERO | FE_INVALID);
- #endif
-
- }
-
- if (plane2_weight_set8)
- {
- if (wmin2[i] >= wmax2[i] * 0.999)
- {
- // if all weights in the partition were equal, then just take average
- // of all colors in the partition and use that as both endpoint colors.
- float4 avg = float4((red_vec[i].x + red_vec[i].y) / red_weight_sum[i],
- (green_vec[i].x + green_vec[i].y) / green_weight_sum[i],
- (blue_vec[i].x + blue_vec[i].y) / blue_weight_sum[i],
- (alpha_vec[i].x + alpha_vec[i].y) / alpha_weight_sum[i]);
-
- if (plane2_color_component == 0 && avg.x == avg.x)
- ep->endpt0[i].x = ep->endpt1[i].x = avg.x;
- if (plane2_color_component == 1 && avg.y == avg.y)
- ep->endpt0[i].y = ep->endpt1[i].y = avg.y;
- if (plane2_color_component == 2 && avg.z == avg.z)
- ep->endpt0[i].z = ep->endpt1[i].z = avg.z;
- if (plane2_color_component == 3 && avg.w == avg.w)
- ep->endpt0[i].w = ep->endpt1[i].w = avg.w;
- }
- else
- {
-
- #ifdef DEBUG_CAPTURE_NAN
- fedisableexcept(FE_DIVBYZERO | FE_INVALID);
- #endif
-
- // otherwise, complete the analytic calculation of ideal-endpoint-values
- // for the given set of texel weights and pixel colors.
- float red_det2 = determinant(pmat2_red[i]);
- float green_det2 = determinant(pmat2_green[i]);
- float blue_det2 = determinant(pmat2_blue[i]);
- float alpha_det2 = determinant(pmat2_alpha[i]);
-
- float red_mss2 = mat_square_sum(pmat2_red[i]);
- float green_mss2 = mat_square_sum(pmat2_green[i]);
- float blue_mss2 = mat_square_sum(pmat2_blue[i]);
- float alpha_mss2 = mat_square_sum(pmat2_alpha[i]);
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("Plane-2 partition %d determinants: R=%g G=%g B=%g A=%g\n", i, red_det2, green_det2, blue_det2, alpha_det2);
- #endif
-
- pmat2_red[i] = invert(pmat2_red[i]);
- pmat2_green[i] = invert(pmat2_green[i]);
- pmat2_blue[i] = invert(pmat2_blue[i]);
- pmat2_alpha[i] = invert(pmat2_alpha[i]);
- float4 ep0 = float4(dot(pmat2_red[i].v[0], red_vec[i]),
- dot(pmat2_green[i].v[0], green_vec[i]),
- dot(pmat2_blue[i].v[0], blue_vec[i]),
- dot(pmat2_alpha[i].v[0], alpha_vec[i]));
- float4 ep1 = float4(dot(pmat2_red[i].v[1], red_vec[i]),
- dot(pmat2_green[i].v[1], green_vec[i]),
- dot(pmat2_blue[i].v[1], blue_vec[i]),
- dot(pmat2_alpha[i].v[1], alpha_vec[i]));
-
- if (plane2_color_component == 0 && fabs(red_det2) > (red_mss2 * 1e-4f) && ep0.x == ep0.x && ep1.x == ep1.x)
- {
- ep->endpt0[i].x = ep0.x;
- ep->endpt1[i].x = ep1.x;
- }
- if (plane2_color_component == 1 && fabs(green_det2) > (green_mss2 * 1e-4f) && ep0.y == ep0.y && ep1.y == ep1.y)
- {
- ep->endpt0[i].y = ep0.y;
- ep->endpt1[i].y = ep1.y;
- }
- if (plane2_color_component == 2 && fabs(blue_det2) > (blue_mss2 * 1e-4f) && ep0.z == ep0.z && ep1.z == ep1.z)
- {
- ep->endpt0[i].z = ep0.z;
- ep->endpt1[i].z = ep1.z;
- }
- if (plane2_color_component == 3 && fabs(alpha_det2) > (alpha_mss2 * 1e-4f) && ep0.w == ep0.w && ep1.w == ep1.w)
- {
- ep->endpt0[i].w = ep0.w;
- ep->endpt1[i].w = ep1.w;
- }
-
- #ifdef DEBUG_CAPTURE_NAN
- feenableexcept(FE_DIVBYZERO | FE_INVALID);
- #endif
-
- }
- }
- }
-
- // if the calculation of an RGB-offset vector failed, try to compute
- // a somewhat-sensible value anyway
- for (i = 0; i < partition_count; i++)
- if (rgbo_fail[i])
- {
- float4 v0 = ep->endpt0[i];
- float4 v1 = ep->endpt1[i];
- float avgdif = dot(v1.xyz - v0.xyz, float3(1, 1, 1)) * (1.0f / 3.0f);
- if (avgdif <= 0.0f)
- avgdif = 0.0f;
- float4 avg = (v0 + v1) * 0.5f;
- float4 ep0 = avg - float4(avgdif, avgdif, avgdif, avgdif) * 0.5f;
-
- rgbo_vectors[i] = float4(ep0.xyz, avgdif);
- }
-
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("Post-adjustment endpoint-colors: \n");
- for (i = 0; i < partition_count; i++)
- {
- printf("%d Low <%g %g %g %g>\n", i, ep->endpt0[i].x, ep->endpt0[i].y, ep->endpt0[i].z, ep->endpt0[i].w);
- printf("%d High <%g %g %g %g>\n", i, ep->endpt1[i].x, ep->endpt1[i].y, ep->endpt1[i].z, ep->endpt1[i].w);
-
- printf("%d RGBS: <%g %g %g %g>\n", i, rgbs_vectors[i].x, rgbs_vectors[i].y, rgbs_vectors[i].z, rgbs_vectors[i].w);
-
- printf("%d RGBO <%g %g %g %g>\n", i, rgbo_vectors[i].x, rgbo_vectors[i].y, rgbo_vectors[i].z, rgbo_vectors[i].w);
-
- printf("%d Lum: <%g %g>\n", i, lum_vectors[i].x, lum_vectors[i].y);
- }
- }
- #endif
-
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_imageblock.cpp b/3rdparty/bimg/3rdparty/astc/astc_imageblock.cpp
deleted file mode 100644
index 8740b4cb037..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_imageblock.cpp
+++ /dev/null
@@ -1,324 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Functions for managing ASTC codec images.
- */
-/*----------------------------------------------------------------------------*/
-
-#include <math.h>
-
-#include "astc_codec_internals.h"
-
-#include "softfloat.h"
-#include <stdint.h>
-#include <stdio.h>
-
-// conversion functions between the LNS representation and the FP16 representation.
-
-float float_to_lns(float p)
-{
-
- if (astc_isnan(p) || p <= 1.0f / 67108864.0f)
- {
- // underflow or NaN value, return 0.
- // We count underflow if the input value is smaller than 2^-26.
- return 0;
- }
-
- if (fabs(p) >= 65536.0f)
- {
- // overflow, return a +INF value
- return 65535;
- }
-
- int expo;
- float normfrac = frexp(p, &expo);
- float p1;
- if (expo < -13)
- {
- // input number is smaller than 2^-14. In this case, multiply by 2^25.
- p1 = p * 33554432.0f;
- expo = 0;
- }
- else
- {
- expo += 14;
- p1 = (normfrac - 0.5f) * 4096.0f;
- }
-
- if (p1 < 384.0f)
- p1 *= 4.0f / 3.0f;
- else if (p1 <= 1408.0f)
- p1 += 128.0f;
- else
- p1 = (p1 + 512.0f) * (4.0f / 5.0f);
-
- p1 += expo * 2048.0f;
- return p1 + 1.0f;
-}
-
-
-
-uint16_t lns_to_sf16(uint16_t p)
-{
-
- uint16_t mc = p & 0x7FF;
- uint16_t ec = p >> 11;
- uint16_t mt;
- if (mc < 512)
- mt = 3 * mc;
- else if (mc < 1536)
- mt = 4 * mc - 512;
- else
- mt = 5 * mc - 2048;
-
- uint16_t res = (ec << 10) | (mt >> 3);
- if (res >= 0x7BFF)
- res = 0x7BFF;
- return res;
-}
-
-
-// conversion function from 16-bit LDR value to FP16.
-// note: for LDR interpolation, it is impossible to get a denormal result;
-// this simplifies the conversion.
-// FALSE; we can receive a very small UNORM16 through the constant-block.
-uint16_t unorm16_to_sf16(uint16_t p)
-{
- if (p == 0xFFFF)
- return 0x3C00; // value of 1.0 .
- if (p < 4)
- return p << 8;
-
- int lz = clz32(p) - 16;
- p <<= (lz + 1);
- p >>= 6;
- p |= (14 - lz) << 10;
- return p;
-}
-
-
-
-
-
-void imageblock_initialize_deriv_from_work_and_orig(imageblock * pb, int pixelcount)
-{
- int i;
-
- const float *fptr = pb->orig_data;
- const float *wptr = pb->work_data;
- float *dptr = pb->deriv_data;
-
- for (i = 0; i < pixelcount; i++)
- {
-
- // compute derivatives for RGB first
- if (pb->rgb_lns[i])
- {
- float r = MAX(fptr[0], 6e-5f);
- float g = MAX(fptr[1], 6e-5f);
- float b = MAX(fptr[2], 6e-5f);
-
- float rderiv = (float_to_lns(r * 1.05f) - float_to_lns(r)) / (r * 0.05f);
- float gderiv = (float_to_lns(g * 1.05f) - float_to_lns(g)) / (g * 0.05f);
- float bderiv = (float_to_lns(b * 1.05f) - float_to_lns(b)) / (b * 0.05f);
-
- // the derivative may not actually take values smaller than 1/32 or larger than 2^25;
- // if it does, we clamp it.
- if (rderiv < (1.0f / 32.0f))
- rderiv = (1.0f / 32.0f);
- else if (rderiv > 33554432.0f)
- rderiv = 33554432.0f;
-
- if (gderiv < (1.0f / 32.0f))
- gderiv = (1.0f / 32.0f);
- else if (gderiv > 33554432.0f)
- gderiv = 33554432.0f;
-
- if (bderiv < (1.0f / 32.0f))
- bderiv = (1.0f / 32.0f);
- else if (bderiv > 33554432.0f)
- bderiv = 33554432.0f;
-
- dptr[0] = rderiv;
- dptr[1] = gderiv;
- dptr[2] = bderiv;
- }
- else
- {
- dptr[0] = 65535.0f;
- dptr[1] = 65535.0f;
- dptr[2] = 65535.0f;
- }
-
-
- // then compute derivatives for Alpha
- if (pb->alpha_lns[i])
- {
- float a = MAX(fptr[3], 6e-5f);
- float aderiv = (float_to_lns(a * 1.05f) - float_to_lns(a)) / (a * 0.05f);
- // the derivative may not actually take values smaller than 1/32 or larger than 2^25;
- // if it does, we clamp it.
- if (aderiv < (1.0f / 32.0f))
- aderiv = (1.0f / 32.0f);
- else if (aderiv > 33554432.0f)
- aderiv = 33554432.0f;
-
- dptr[3] = aderiv;
- }
- else
- {
- dptr[3] = 65535.0f;
- }
-
- fptr += 4;
- wptr += 4;
- dptr += 4;
- }
-}
-
-
-
-
-// helper function to initialize the work-data from the orig-data
-void imageblock_initialize_work_from_orig(imageblock * pb, int pixelcount)
-{
- int i;
- float *fptr = pb->orig_data;
- float *wptr = pb->work_data;
-
- for (i = 0; i < pixelcount; i++)
- {
- if (pb->rgb_lns[i])
- {
- wptr[0] = float_to_lns(fptr[0]);
- wptr[1] = float_to_lns(fptr[1]);
- wptr[2] = float_to_lns(fptr[2]);
- }
- else
- {
- wptr[0] = fptr[0] * 65535.0f;
- wptr[1] = fptr[1] * 65535.0f;
- wptr[2] = fptr[2] * 65535.0f;
- }
-
- if (pb->alpha_lns[i])
- {
- wptr[3] = float_to_lns(fptr[3]);
- }
- else
- {
- wptr[3] = fptr[3] * 65535.0f;
- }
- fptr += 4;
- wptr += 4;
- }
-
- imageblock_initialize_deriv_from_work_and_orig(pb, pixelcount);
-}
-
-
-
-
-// helper function to initialize the orig-data from the work-data
-void imageblock_initialize_orig_from_work(imageblock * pb, int pixelcount)
-{
- int i;
- float *fptr = pb->orig_data;
- float *wptr = pb->work_data;
-
- for (i = 0; i < pixelcount; i++)
- {
- if (pb->rgb_lns[i])
- {
- fptr[0] = sf16_to_float(lns_to_sf16((uint16_t) wptr[0]));
- fptr[1] = sf16_to_float(lns_to_sf16((uint16_t) wptr[1]));
- fptr[2] = sf16_to_float(lns_to_sf16((uint16_t) wptr[2]));
- }
- else
- {
- fptr[0] = sf16_to_float(unorm16_to_sf16((uint16_t) wptr[0]));
- fptr[1] = sf16_to_float(unorm16_to_sf16((uint16_t) wptr[1]));
- fptr[2] = sf16_to_float(unorm16_to_sf16((uint16_t) wptr[2]));
- }
-
- if (pb->alpha_lns[i])
- {
- fptr[3] = sf16_to_float(lns_to_sf16((uint16_t) wptr[3]));
- }
- else
- {
- fptr[3] = sf16_to_float(unorm16_to_sf16((uint16_t) wptr[3]));
- }
-
- fptr += 4;
- wptr += 4;
- }
-
- imageblock_initialize_deriv_from_work_and_orig(pb, pixelcount);
-}
-
-
-/*
- For an imageblock, update its flags.
-
- The updating is done based on work_data, not orig_data.
-*/
-void update_imageblock_flags(imageblock * pb, int xdim, int ydim, int zdim)
-{
- int i;
- float red_min = 1e38f, red_max = -1e38f;
- float green_min = 1e38f, green_max = -1e38f;
- float blue_min = 1e38f, blue_max = -1e38f;
- float alpha_min = 1e38f, alpha_max = -1e38f;
-
- int texels_per_block = xdim * ydim * zdim;
-
- int grayscale = 1;
-
- for (i = 0; i < texels_per_block; i++)
- {
- float red = pb->work_data[4 * i];
- float green = pb->work_data[4 * i + 1];
- float blue = pb->work_data[4 * i + 2];
- float alpha = pb->work_data[4 * i + 3];
- if (red < red_min)
- red_min = red;
- if (red > red_max)
- red_max = red;
- if (green < green_min)
- green_min = green;
- if (green > green_max)
- green_max = green;
- if (blue < blue_min)
- blue_min = blue;
- if (blue > blue_max)
- blue_max = blue;
- if (alpha < alpha_min)
- alpha_min = alpha;
- if (alpha > alpha_max)
- alpha_max = alpha;
-
- if (grayscale == 1 && (red != green || red != blue))
- grayscale = 0;
- }
-
- pb->red_min = red_min;
- pb->red_max = red_max;
- pb->green_min = green_min;
- pb->green_max = green_max;
- pb->blue_min = blue_min;
- pb->blue_max = blue_max;
- pb->alpha_min = alpha_min;
- pb->alpha_max = alpha_max;
- pb->grayscale = grayscale;
-}
-
diff --git a/3rdparty/bimg/3rdparty/astc/astc_integer_sequence.cpp b/3rdparty/bimg/3rdparty/astc/astc_integer_sequence.cpp
deleted file mode 100644
index 58c706a96d8..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_integer_sequence.cpp
+++ /dev/null
@@ -1,649 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Functions to encode/decode data using Bounded Integer Sequence
- * Encoding.
- */
-/*----------------------------------------------------------------------------*/
-#include "astc_codec_internals.h"
- // unpacked quint triplets <low,middle,high> for each packed-quint value
-static const uint8_t quints_of_integer[128][3] = {
- {0, 0, 0}, {1, 0, 0}, {2, 0, 0}, {3, 0, 0},
- {4, 0, 0}, {0, 4, 0}, {4, 4, 0}, {4, 4, 4},
- {0, 1, 0}, {1, 1, 0}, {2, 1, 0}, {3, 1, 0},
- {4, 1, 0}, {1, 4, 0}, {4, 4, 1}, {4, 4, 4},
- {0, 2, 0}, {1, 2, 0}, {2, 2, 0}, {3, 2, 0},
- {4, 2, 0}, {2, 4, 0}, {4, 4, 2}, {4, 4, 4},
- {0, 3, 0}, {1, 3, 0}, {2, 3, 0}, {3, 3, 0},
- {4, 3, 0}, {3, 4, 0}, {4, 4, 3}, {4, 4, 4},
- {0, 0, 1}, {1, 0, 1}, {2, 0, 1}, {3, 0, 1},
- {4, 0, 1}, {0, 4, 1}, {4, 0, 4}, {0, 4, 4},
- {0, 1, 1}, {1, 1, 1}, {2, 1, 1}, {3, 1, 1},
- {4, 1, 1}, {1, 4, 1}, {4, 1, 4}, {1, 4, 4},
- {0, 2, 1}, {1, 2, 1}, {2, 2, 1}, {3, 2, 1},
- {4, 2, 1}, {2, 4, 1}, {4, 2, 4}, {2, 4, 4},
- {0, 3, 1}, {1, 3, 1}, {2, 3, 1}, {3, 3, 1},
- {4, 3, 1}, {3, 4, 1}, {4, 3, 4}, {3, 4, 4},
- {0, 0, 2}, {1, 0, 2}, {2, 0, 2}, {3, 0, 2},
- {4, 0, 2}, {0, 4, 2}, {2, 0, 4}, {3, 0, 4},
- {0, 1, 2}, {1, 1, 2}, {2, 1, 2}, {3, 1, 2},
- {4, 1, 2}, {1, 4, 2}, {2, 1, 4}, {3, 1, 4},
- {0, 2, 2}, {1, 2, 2}, {2, 2, 2}, {3, 2, 2},
- {4, 2, 2}, {2, 4, 2}, {2, 2, 4}, {3, 2, 4},
- {0, 3, 2}, {1, 3, 2}, {2, 3, 2}, {3, 3, 2},
- {4, 3, 2}, {3, 4, 2}, {2, 3, 4}, {3, 3, 4},
- {0, 0, 3}, {1, 0, 3}, {2, 0, 3}, {3, 0, 3},
- {4, 0, 3}, {0, 4, 3}, {0, 0, 4}, {1, 0, 4},
- {0, 1, 3}, {1, 1, 3}, {2, 1, 3}, {3, 1, 3},
- {4, 1, 3}, {1, 4, 3}, {0, 1, 4}, {1, 1, 4},
- {0, 2, 3}, {1, 2, 3}, {2, 2, 3}, {3, 2, 3},
- {4, 2, 3}, {2, 4, 3}, {0, 2, 4}, {1, 2, 4},
- {0, 3, 3}, {1, 3, 3}, {2, 3, 3}, {3, 3, 3},
- {4, 3, 3}, {3, 4, 3}, {0, 3, 4}, {1, 3, 4},
-};
-
-// packed quint-value for every unpacked quint-triplet
-// indexed by [high][middle][low]
-static const uint8_t integer_of_quints[5][5][5] = {
- {
- {0, 1, 2, 3, 4,},
- {8, 9, 10, 11, 12,},
- {16, 17, 18, 19, 20,},
- {24, 25, 26, 27, 28,},
- {5, 13, 21, 29, 6,},
- },
- {
- {32, 33, 34, 35, 36,},
- {40, 41, 42, 43, 44,},
- {48, 49, 50, 51, 52,},
- {56, 57, 58, 59, 60,},
- {37, 45, 53, 61, 14,},
- },
- {
- {64, 65, 66, 67, 68,},
- {72, 73, 74, 75, 76,},
- {80, 81, 82, 83, 84,},
- {88, 89, 90, 91, 92,},
- {69, 77, 85, 93, 22,},
- },
- {
- {96, 97, 98, 99, 100,},
- {104, 105, 106, 107, 108,},
- {112, 113, 114, 115, 116,},
- {120, 121, 122, 123, 124,},
- {101, 109, 117, 125, 30,},
- },
- {
- {102, 103, 70, 71, 38,},
- {110, 111, 78, 79, 46,},
- {118, 119, 86, 87, 54,},
- {126, 127, 94, 95, 62,},
- {39, 47, 55, 63, 31,},
- },
-};
-
-// unpacked trit quintuplets <low,_,_,_,high> for each packed-quint value
-static const uint8_t trits_of_integer[256][5] = {
- {0, 0, 0, 0, 0}, {1, 0, 0, 0, 0}, {2, 0, 0, 0, 0}, {0, 0, 2, 0, 0},
- {0, 1, 0, 0, 0}, {1, 1, 0, 0, 0}, {2, 1, 0, 0, 0}, {1, 0, 2, 0, 0},
- {0, 2, 0, 0, 0}, {1, 2, 0, 0, 0}, {2, 2, 0, 0, 0}, {2, 0, 2, 0, 0},
- {0, 2, 2, 0, 0}, {1, 2, 2, 0, 0}, {2, 2, 2, 0, 0}, {2, 0, 2, 0, 0},
- {0, 0, 1, 0, 0}, {1, 0, 1, 0, 0}, {2, 0, 1, 0, 0}, {0, 1, 2, 0, 0},
- {0, 1, 1, 0, 0}, {1, 1, 1, 0, 0}, {2, 1, 1, 0, 0}, {1, 1, 2, 0, 0},
- {0, 2, 1, 0, 0}, {1, 2, 1, 0, 0}, {2, 2, 1, 0, 0}, {2, 1, 2, 0, 0},
- {0, 0, 0, 2, 2}, {1, 0, 0, 2, 2}, {2, 0, 0, 2, 2}, {0, 0, 2, 2, 2},
- {0, 0, 0, 1, 0}, {1, 0, 0, 1, 0}, {2, 0, 0, 1, 0}, {0, 0, 2, 1, 0},
- {0, 1, 0, 1, 0}, {1, 1, 0, 1, 0}, {2, 1, 0, 1, 0}, {1, 0, 2, 1, 0},
- {0, 2, 0, 1, 0}, {1, 2, 0, 1, 0}, {2, 2, 0, 1, 0}, {2, 0, 2, 1, 0},
- {0, 2, 2, 1, 0}, {1, 2, 2, 1, 0}, {2, 2, 2, 1, 0}, {2, 0, 2, 1, 0},
- {0, 0, 1, 1, 0}, {1, 0, 1, 1, 0}, {2, 0, 1, 1, 0}, {0, 1, 2, 1, 0},
- {0, 1, 1, 1, 0}, {1, 1, 1, 1, 0}, {2, 1, 1, 1, 0}, {1, 1, 2, 1, 0},
- {0, 2, 1, 1, 0}, {1, 2, 1, 1, 0}, {2, 2, 1, 1, 0}, {2, 1, 2, 1, 0},
- {0, 1, 0, 2, 2}, {1, 1, 0, 2, 2}, {2, 1, 0, 2, 2}, {1, 0, 2, 2, 2},
- {0, 0, 0, 2, 0}, {1, 0, 0, 2, 0}, {2, 0, 0, 2, 0}, {0, 0, 2, 2, 0},
- {0, 1, 0, 2, 0}, {1, 1, 0, 2, 0}, {2, 1, 0, 2, 0}, {1, 0, 2, 2, 0},
- {0, 2, 0, 2, 0}, {1, 2, 0, 2, 0}, {2, 2, 0, 2, 0}, {2, 0, 2, 2, 0},
- {0, 2, 2, 2, 0}, {1, 2, 2, 2, 0}, {2, 2, 2, 2, 0}, {2, 0, 2, 2, 0},
- {0, 0, 1, 2, 0}, {1, 0, 1, 2, 0}, {2, 0, 1, 2, 0}, {0, 1, 2, 2, 0},
- {0, 1, 1, 2, 0}, {1, 1, 1, 2, 0}, {2, 1, 1, 2, 0}, {1, 1, 2, 2, 0},
- {0, 2, 1, 2, 0}, {1, 2, 1, 2, 0}, {2, 2, 1, 2, 0}, {2, 1, 2, 2, 0},
- {0, 2, 0, 2, 2}, {1, 2, 0, 2, 2}, {2, 2, 0, 2, 2}, {2, 0, 2, 2, 2},
- {0, 0, 0, 0, 2}, {1, 0, 0, 0, 2}, {2, 0, 0, 0, 2}, {0, 0, 2, 0, 2},
- {0, 1, 0, 0, 2}, {1, 1, 0, 0, 2}, {2, 1, 0, 0, 2}, {1, 0, 2, 0, 2},
- {0, 2, 0, 0, 2}, {1, 2, 0, 0, 2}, {2, 2, 0, 0, 2}, {2, 0, 2, 0, 2},
- {0, 2, 2, 0, 2}, {1, 2, 2, 0, 2}, {2, 2, 2, 0, 2}, {2, 0, 2, 0, 2},
- {0, 0, 1, 0, 2}, {1, 0, 1, 0, 2}, {2, 0, 1, 0, 2}, {0, 1, 2, 0, 2},
- {0, 1, 1, 0, 2}, {1, 1, 1, 0, 2}, {2, 1, 1, 0, 2}, {1, 1, 2, 0, 2},
- {0, 2, 1, 0, 2}, {1, 2, 1, 0, 2}, {2, 2, 1, 0, 2}, {2, 1, 2, 0, 2},
- {0, 2, 2, 2, 2}, {1, 2, 2, 2, 2}, {2, 2, 2, 2, 2}, {2, 0, 2, 2, 2},
- {0, 0, 0, 0, 1}, {1, 0, 0, 0, 1}, {2, 0, 0, 0, 1}, {0, 0, 2, 0, 1},
- {0, 1, 0, 0, 1}, {1, 1, 0, 0, 1}, {2, 1, 0, 0, 1}, {1, 0, 2, 0, 1},
- {0, 2, 0, 0, 1}, {1, 2, 0, 0, 1}, {2, 2, 0, 0, 1}, {2, 0, 2, 0, 1},
- {0, 2, 2, 0, 1}, {1, 2, 2, 0, 1}, {2, 2, 2, 0, 1}, {2, 0, 2, 0, 1},
- {0, 0, 1, 0, 1}, {1, 0, 1, 0, 1}, {2, 0, 1, 0, 1}, {0, 1, 2, 0, 1},
- {0, 1, 1, 0, 1}, {1, 1, 1, 0, 1}, {2, 1, 1, 0, 1}, {1, 1, 2, 0, 1},
- {0, 2, 1, 0, 1}, {1, 2, 1, 0, 1}, {2, 2, 1, 0, 1}, {2, 1, 2, 0, 1},
- {0, 0, 1, 2, 2}, {1, 0, 1, 2, 2}, {2, 0, 1, 2, 2}, {0, 1, 2, 2, 2},
- {0, 0, 0, 1, 1}, {1, 0, 0, 1, 1}, {2, 0, 0, 1, 1}, {0, 0, 2, 1, 1},
- {0, 1, 0, 1, 1}, {1, 1, 0, 1, 1}, {2, 1, 0, 1, 1}, {1, 0, 2, 1, 1},
- {0, 2, 0, 1, 1}, {1, 2, 0, 1, 1}, {2, 2, 0, 1, 1}, {2, 0, 2, 1, 1},
- {0, 2, 2, 1, 1}, {1, 2, 2, 1, 1}, {2, 2, 2, 1, 1}, {2, 0, 2, 1, 1},
- {0, 0, 1, 1, 1}, {1, 0, 1, 1, 1}, {2, 0, 1, 1, 1}, {0, 1, 2, 1, 1},
- {0, 1, 1, 1, 1}, {1, 1, 1, 1, 1}, {2, 1, 1, 1, 1}, {1, 1, 2, 1, 1},
- {0, 2, 1, 1, 1}, {1, 2, 1, 1, 1}, {2, 2, 1, 1, 1}, {2, 1, 2, 1, 1},
- {0, 1, 1, 2, 2}, {1, 1, 1, 2, 2}, {2, 1, 1, 2, 2}, {1, 1, 2, 2, 2},
- {0, 0, 0, 2, 1}, {1, 0, 0, 2, 1}, {2, 0, 0, 2, 1}, {0, 0, 2, 2, 1},
- {0, 1, 0, 2, 1}, {1, 1, 0, 2, 1}, {2, 1, 0, 2, 1}, {1, 0, 2, 2, 1},
- {0, 2, 0, 2, 1}, {1, 2, 0, 2, 1}, {2, 2, 0, 2, 1}, {2, 0, 2, 2, 1},
- {0, 2, 2, 2, 1}, {1, 2, 2, 2, 1}, {2, 2, 2, 2, 1}, {2, 0, 2, 2, 1},
- {0, 0, 1, 2, 1}, {1, 0, 1, 2, 1}, {2, 0, 1, 2, 1}, {0, 1, 2, 2, 1},
- {0, 1, 1, 2, 1}, {1, 1, 1, 2, 1}, {2, 1, 1, 2, 1}, {1, 1, 2, 2, 1},
- {0, 2, 1, 2, 1}, {1, 2, 1, 2, 1}, {2, 2, 1, 2, 1}, {2, 1, 2, 2, 1},
- {0, 2, 1, 2, 2}, {1, 2, 1, 2, 2}, {2, 2, 1, 2, 2}, {2, 1, 2, 2, 2},
- {0, 0, 0, 1, 2}, {1, 0, 0, 1, 2}, {2, 0, 0, 1, 2}, {0, 0, 2, 1, 2},
- {0, 1, 0, 1, 2}, {1, 1, 0, 1, 2}, {2, 1, 0, 1, 2}, {1, 0, 2, 1, 2},
- {0, 2, 0, 1, 2}, {1, 2, 0, 1, 2}, {2, 2, 0, 1, 2}, {2, 0, 2, 1, 2},
- {0, 2, 2, 1, 2}, {1, 2, 2, 1, 2}, {2, 2, 2, 1, 2}, {2, 0, 2, 1, 2},
- {0, 0, 1, 1, 2}, {1, 0, 1, 1, 2}, {2, 0, 1, 1, 2}, {0, 1, 2, 1, 2},
- {0, 1, 1, 1, 2}, {1, 1, 1, 1, 2}, {2, 1, 1, 1, 2}, {1, 1, 2, 1, 2},
- {0, 2, 1, 1, 2}, {1, 2, 1, 1, 2}, {2, 2, 1, 1, 2}, {2, 1, 2, 1, 2},
- {0, 2, 2, 2, 2}, {1, 2, 2, 2, 2}, {2, 2, 2, 2, 2}, {2, 1, 2, 2, 2},
-};
-
-// packed trit-value for every unpacked trit-quintuplet
-// indexed by [high][][][][low]
-static const uint8_t integer_of_trits[3][3][3][3][3] = {
- {
- {
- {
- {0, 1, 2,},
- {4, 5, 6,},
- {8, 9, 10,},
- },
- {
- {16, 17, 18,},
- {20, 21, 22,},
- {24, 25, 26,},
- },
- {
- {3, 7, 15,},
- {19, 23, 27,},
- {12, 13, 14,},
- },
- },
- {
- {
- {32, 33, 34,},
- {36, 37, 38,},
- {40, 41, 42,},
- },
- {
- {48, 49, 50,},
- {52, 53, 54,},
- {56, 57, 58,},
- },
- {
- {35, 39, 47,},
- {51, 55, 59,},
- {44, 45, 46,},
- },
- },
- {
- {
- {64, 65, 66,},
- {68, 69, 70,},
- {72, 73, 74,},
- },
- {
- {80, 81, 82,},
- {84, 85, 86,},
- {88, 89, 90,},
- },
- {
- {67, 71, 79,},
- {83, 87, 91,},
- {76, 77, 78,},
- },
- },
- },
- {
- {
- {
- {128, 129, 130,},
- {132, 133, 134,},
- {136, 137, 138,},
- },
- {
- {144, 145, 146,},
- {148, 149, 150,},
- {152, 153, 154,},
- },
- {
- {131, 135, 143,},
- {147, 151, 155,},
- {140, 141, 142,},
- },
- },
- {
- {
- {160, 161, 162,},
- {164, 165, 166,},
- {168, 169, 170,},
- },
- {
- {176, 177, 178,},
- {180, 181, 182,},
- {184, 185, 186,},
- },
- {
- {163, 167, 175,},
- {179, 183, 187,},
- {172, 173, 174,},
- },
- },
- {
- {
- {192, 193, 194,},
- {196, 197, 198,},
- {200, 201, 202,},
- },
- {
- {208, 209, 210,},
- {212, 213, 214,},
- {216, 217, 218,},
- },
- {
- {195, 199, 207,},
- {211, 215, 219,},
- {204, 205, 206,},
- },
- },
- },
- {
- {
- {
- {96, 97, 98,},
- {100, 101, 102,},
- {104, 105, 106,},
- },
- {
- {112, 113, 114,},
- {116, 117, 118,},
- {120, 121, 122,},
- },
- {
- {99, 103, 111,},
- {115, 119, 123,},
- {108, 109, 110,},
- },
- },
- {
- {
- {224, 225, 226,},
- {228, 229, 230,},
- {232, 233, 234,},
- },
- {
- {240, 241, 242,},
- {244, 245, 246,},
- {248, 249, 250,},
- },
- {
- {227, 231, 239,},
- {243, 247, 251,},
- {236, 237, 238,},
- },
- },
- {
- {
- {28, 29, 30,},
- {60, 61, 62,},
- {92, 93, 94,},
- },
- {
- {156, 157, 158,},
- {188, 189, 190,},
- {220, 221, 222,},
- },
- {
- {31, 63, 127,},
- {159, 191, 255,},
- {252, 253, 254,},
- },
- },
- },
-};
-
-
-
-void find_number_of_bits_trits_quints(int quantization_level, int *bits, int *trits, int *quints)
-{
- *bits = 0;
- *trits = 0;
- *quints = 0;
- switch (quantization_level)
- {
- case QUANT_2:
- *bits = 1;
- break;
- case QUANT_3:
- *bits = 0;
- *trits = 1;
- break;
- case QUANT_4:
- *bits = 2;
- break;
- case QUANT_5:
- *bits = 0;
- *quints = 1;
- break;
- case QUANT_6:
- *bits = 1;
- *trits = 1;
- break;
- case QUANT_8:
- *bits = 3;
- break;
- case QUANT_10:
- *bits = 1;
- *quints = 1;
- break;
- case QUANT_12:
- *bits = 2;
- *trits = 1;
- break;
- case QUANT_16:
- *bits = 4;
- break;
- case QUANT_20:
- *bits = 2;
- *quints = 1;
- break;
- case QUANT_24:
- *bits = 3;
- *trits = 1;
- break;
- case QUANT_32:
- *bits = 5;
- break;
- case QUANT_40:
- *bits = 3;
- *quints = 1;
- break;
- case QUANT_48:
- *bits = 4;
- *trits = 1;
- break;
- case QUANT_64:
- *bits = 6;
- break;
- case QUANT_80:
- *bits = 4;
- *quints = 1;
- break;
- case QUANT_96:
- *bits = 5;
- *trits = 1;
- break;
- case QUANT_128:
- *bits = 7;
- break;
- case QUANT_160:
- *bits = 5;
- *quints = 1;
- break;
- case QUANT_192:
- *bits = 6;
- *trits = 1;
- break;
- case QUANT_256:
- *bits = 8;
- break;
- }
-}
-
-
-// routine to write up to 8 bits
-static inline void write_bits(int value, int bitcount, int bitoffset, uint8_t * ptr)
-{
- int mask = (1 << bitcount) - 1;
- value &= mask;
- ptr += bitoffset >> 3;
- bitoffset &= 7;
- value <<= bitoffset;
- mask <<= bitoffset;
- mask = ~mask;
-
- ptr[0] &= mask;
- ptr[0] |= value;
- ptr[1] &= mask >> 8;
- ptr[1] |= value >> 8;
-}
-
-
-// routine to read up to 8 bits
-static inline int read_bits(int bitcount, int bitoffset, const uint8_t * ptr)
-{
- int mask = (1 << bitcount) - 1;
- ptr += bitoffset >> 3;
- bitoffset &= 7;
- int value = ptr[0] | (ptr[1] << 8);
- value >>= bitoffset;
- value &= mask;
- return value;
-}
-
-
-
-
-void encode_ise(int quantization_level, int elements, const uint8_t * input_data, uint8_t * output_data, int bit_offset)
-{
- int i;
- uint8_t lowparts[64];
- uint8_t highparts[69]; // 64 elements + 5 elements for padding
- uint8_t tq_blocks[22]; // trit-blocks or quint-blocks
-
- int bits, trits, quints;
- find_number_of_bits_trits_quints(quantization_level, &bits, &trits, &quints);
-
- for (i = 0; i < elements; i++)
- {
- lowparts[i] = input_data[i] & ((1 << bits) - 1);
- highparts[i] = input_data[i] >> bits;
- }
- for (i = elements; i < elements + 5; i++)
- highparts[i] = 0; // padding before we start constructing trit-blocks or quint-blocks
-
- // construct trit-blocks or quint-blocks as necessary
- if (trits)
- {
- int trit_blocks = (elements + 4) / 5;
- for (i = 0; i < trit_blocks; i++)
- tq_blocks[i] = integer_of_trits[highparts[5 * i + 4]][highparts[5 * i + 3]][highparts[5 * i + 2]][highparts[5 * i + 1]][highparts[5 * i]];
- }
- if (quints)
- {
- int quint_blocks = (elements + 2) / 3;
- for (i = 0; i < quint_blocks; i++)
- tq_blocks[i] = integer_of_quints[highparts[3 * i + 2]][highparts[3 * i + 1]][highparts[3 * i]];
- }
-
- // then, write out the actual bits.
- int lcounter = 0;
- int hcounter = 0;
- for (i = 0; i < elements; i++)
- {
- write_bits(lowparts[i], bits, bit_offset, output_data);
- bit_offset += bits;
- if (trits)
- {
- static const int bits_to_write[5] = { 2, 2, 1, 2, 1 };
- static const int block_shift[5] = { 0, 2, 4, 5, 7 };
- static const int next_lcounter[5] = { 1, 2, 3, 4, 0 };
- static const int hcounter_incr[5] = { 0, 0, 0, 0, 1 };
- write_bits(tq_blocks[hcounter] >> block_shift[lcounter], bits_to_write[lcounter], bit_offset, output_data);
- bit_offset += bits_to_write[lcounter];
- hcounter += hcounter_incr[lcounter];
- lcounter = next_lcounter[lcounter];
- }
- if (quints)
- {
- static const int bits_to_write[3] = { 3, 2, 2 };
- static const int block_shift[3] = { 0, 3, 5 };
- static const int next_lcounter[3] = { 1, 2, 0 };
- static const int hcounter_incr[3] = { 0, 0, 1 };
- write_bits(tq_blocks[hcounter] >> block_shift[lcounter], bits_to_write[lcounter], bit_offset, output_data);
- bit_offset += bits_to_write[lcounter];
- hcounter += hcounter_incr[lcounter];
- lcounter = next_lcounter[lcounter];
- }
- }
-}
-
-
-
-
-void decode_ise(int quantization_level, int elements, const uint8_t * input_data, uint8_t * output_data, int bit_offset)
-{
- int i;
- // note: due to how the trit/quint-block unpacking is done in this function,
- // we may write more temporary results than the number of outputs
- // The maximum actual number of results is 64 bit, but we keep 4 additional elements
- // of padding.
- uint8_t results[68];
- uint8_t tq_blocks[22]; // trit-blocks or quint-blocks
-
- int bits, trits, quints;
- find_number_of_bits_trits_quints(quantization_level, &bits, &trits, &quints);
-
- int lcounter = 0;
- int hcounter = 0;
-
- // trit-blocks or quint-blocks must be zeroed out before we collect them in the loop below.
- for (i = 0; i < 22; i++)
- tq_blocks[i] = 0;
-
- // collect bits for each element, as well as bits for any trit-blocks and quint-blocks.
- for (i = 0; i < elements; i++)
- {
- results[i] = read_bits(bits, bit_offset, input_data);
- bit_offset += bits;
- if (trits)
- {
- static const int bits_to_read[5] = { 2, 2, 1, 2, 1 };
- static const int block_shift[5] = { 0, 2, 4, 5, 7 };
- static const int next_lcounter[5] = { 1, 2, 3, 4, 0 };
- static const int hcounter_incr[5] = { 0, 0, 0, 0, 1 };
- int tdata = read_bits(bits_to_read[lcounter], bit_offset, input_data);
- bit_offset += bits_to_read[lcounter];
- tq_blocks[hcounter] |= tdata << block_shift[lcounter];
- hcounter += hcounter_incr[lcounter];
- lcounter = next_lcounter[lcounter];
- }
- if (quints)
- {
- static const int bits_to_read[3] = { 3, 2, 2 };
- static const int block_shift[3] = { 0, 3, 5 };
- static const int next_lcounter[3] = { 1, 2, 0 };
- static const int hcounter_incr[3] = { 0, 0, 1 };
- int tdata = read_bits(bits_to_read[lcounter], bit_offset, input_data);
- bit_offset += bits_to_read[lcounter];
- tq_blocks[hcounter] |= tdata << block_shift[lcounter];
- hcounter += hcounter_incr[lcounter];
- lcounter = next_lcounter[lcounter];
- }
- }
-
-
- // unpack trit-blocks or quint-blocks as needed
- if (trits)
- {
- int trit_blocks = (elements + 4) / 5;
- for (i = 0; i < trit_blocks; i++)
- {
- const uint8_t *tritptr = trits_of_integer[tq_blocks[i]];
- results[5 * i] |= tritptr[0] << bits;
- results[5 * i + 1] |= tritptr[1] << bits;
- results[5 * i + 2] |= tritptr[2] << bits;
- results[5 * i + 3] |= tritptr[3] << bits;
- results[5 * i + 4] |= tritptr[4] << bits;
- }
- }
-
- if (quints)
- {
- int quint_blocks = (elements + 2) / 3;
- for (i = 0; i < quint_blocks; i++)
- {
- const uint8_t *quintptr = quints_of_integer[tq_blocks[i]];
- results[3 * i] |= quintptr[0] << bits;
- results[3 * i + 1] |= quintptr[1] << bits;
- results[3 * i + 2] |= quintptr[2] << bits;
- }
- }
-
- for (i = 0; i < elements; i++)
- output_data[i] = results[i];
-}
-
-
-
-
-int compute_ise_bitcount(int items, quantization_method quant)
-{
- switch (quant)
- {
- case QUANT_2:
- return items;
- case QUANT_3:
- return (8 * items + 4) / 5;
- case QUANT_4:
- return 2 * items;
- case QUANT_5:
- return (7 * items + 2) / 3;
- case QUANT_6:
- return (13 * items + 4) / 5;
- case QUANT_8:
- return 3 * items;
- case QUANT_10:
- return (10 * items + 2) / 3;
- case QUANT_12:
- return (18 * items + 4) / 5;
- case QUANT_16:
- return items * 4;
- case QUANT_20:
- return (13 * items + 2) / 3;
- case QUANT_24:
- return (23 * items + 4) / 5;
- case QUANT_32:
- return 5 * items;
- case QUANT_40:
- return (16 * items + 2) / 3;
- case QUANT_48:
- return (28 * items + 4) / 5;
- case QUANT_64:
- return 6 * items;
- case QUANT_80:
- return (19 * items + 2) / 3;
- case QUANT_96:
- return (33 * items + 4) / 5;
- case QUANT_128:
- return 7 * items;
- case QUANT_160:
- return (22 * items + 2) / 3;
- case QUANT_192:
- return (38 * items + 4) / 5;
- case QUANT_256:
- return 8 * items;
- default:
- return 100000;
- }
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_kmeans_partitioning.cpp b/3rdparty/bimg/3rdparty/astc/astc_kmeans_partitioning.cpp
deleted file mode 100644
index 13fd4abc40b..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_kmeans_partitioning.cpp
+++ /dev/null
@@ -1,520 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief approximate k-means cluster partitioning. Do this in 2 stages
- *
- * 1: basic clustering, a couple of passes just to get a few clusters
- * 2: clustering based on line, a few passes until it seems to
- * stabilize.
- *
- * After clustering is done, we use the clustering result to construct
- * one bitmap for each partition. We then scan though the partition table,
- * counting how well the bitmaps matched.
- */
-/*----------------------------------------------------------------------------*/
-
-#include "astc_codec_internals.h"
-
-// for k++ means, we need pseudo-random numbers, however using random numbers directly
-// results in irreproducible encoding results. As such, we will instead
-// just supply a handful of numbers from random.org, and apply an algorithm similar
-// to XKCD #221. (http://xkcd.com/221/)
-// cluster the texels using the k++ means clustering initialization algorithm.
-
-void kpp_initialize(int xdim, int ydim, int zdim, int partition_count, const imageblock * blk, float4 * cluster_centers)
-{
- int i;
-
- int texels_per_block = xdim * ydim * zdim;
-
- int cluster_center_samples[4];
- // pick a random sample as first center-point.
- cluster_center_samples[0] = 145897 /* number from random.org */ % texels_per_block;
- int samples_selected = 1;
-
- float distances[MAX_TEXELS_PER_BLOCK];
-
- // compute the distance to the first point.
- int sample = cluster_center_samples[0];
- float4 center_color = float4(blk->work_data[4 * sample],
- blk->work_data[4 * sample + 1],
- blk->work_data[4 * sample + 2],
- blk->work_data[4 * sample + 3]);
-
- float distance_sum = 0.0f;
- for (i = 0; i < texels_per_block; i++)
- {
- float4 color = float4(blk->work_data[4 * i],
- blk->work_data[4 * i + 1],
- blk->work_data[4 * i + 2],
- blk->work_data[4 * i + 3]);
- float4 diff = color - center_color;
- float distance = dot(diff, diff);
- distance_sum += distance;
- distances[i] = distance;
- }
-
- // more numbers from random.org
- float cluster_cutoffs[25] = {
- 0.952312f, 0.206893f, 0.835984f, 0.507813f, 0.466170f,
- 0.872331f, 0.488028f, 0.866394f, 0.363093f, 0.467905f,
- 0.812967f, 0.626220f, 0.932770f, 0.275454f, 0.832020f,
- 0.362217f, 0.318558f, 0.240113f, 0.009190f, 0.983995f,
- 0.566812f, 0.347661f, 0.731960f, 0.156391f, 0.297786f
- };
-
- while (1)
- {
- // pick a point in a weighted-random fashion.
- float summa = 0.0f;
- float distance_cutoff = distance_sum * cluster_cutoffs[samples_selected + 5 * partition_count];
- for (i = 0; i < texels_per_block; i++)
- {
- summa += distances[i];
- if (summa >= distance_cutoff)
- break;
- }
- sample = i;
- if (sample >= texels_per_block)
- sample = texels_per_block - 1;
-
-
- cluster_center_samples[samples_selected] = sample;
- samples_selected++;
- if (samples_selected >= partition_count)
- break;
-
- // update the distances with the new point.
- center_color = float4(blk->work_data[4 * sample], blk->work_data[4 * sample + 1], blk->work_data[4 * sample + 2], blk->work_data[4 * sample + 3]);
-
- distance_sum = 0.0f;
- for (i = 0; i < texels_per_block; i++)
- {
- float4 color = float4(blk->work_data[4 * i],
- blk->work_data[4 * i + 1],
- blk->work_data[4 * i + 2],
- blk->work_data[4 * i + 3]);
- float4 diff = color - center_color;
- float distance = dot(diff, diff);
- distance = MIN(distance, distances[i]);
- distance_sum += distance;
- distances[i] = distance;
- }
- }
-
- // finally, gather up the results.
- for (i = 0; i < partition_count; i++)
- {
- int sample = cluster_center_samples[i];
- float4 color = float4(blk->work_data[4 * sample],
- blk->work_data[4 * sample + 1],
- blk->work_data[4 * sample + 2],
- blk->work_data[4 * sample + 3]);
- cluster_centers[i] = color;
- }
-}
-
-
-// basic K-means clustering: given a set of cluster centers,
-// assign each texel to a partition
-void basic_kmeans_assign_pass(int xdim, int ydim, int zdim, int partition_count, const imageblock * blk, const float4 * cluster_centers, int *partition_of_texel)
-{
- int i, j;
-
- int texels_per_block = xdim * ydim * zdim;
-
- float distances[MAX_TEXELS_PER_BLOCK];
- float4 center_color = cluster_centers[0];
-
- int texels_per_partition[4];
-
- texels_per_partition[0] = texels_per_block;
- for (i = 1; i < partition_count; i++)
- texels_per_partition[i] = 0;
-
-
- for (i = 0; i < texels_per_block; i++)
- {
- float4 color = float4(blk->work_data[4 * i],
- blk->work_data[4 * i + 1],
- blk->work_data[4 * i + 2],
- blk->work_data[4 * i + 3]);
- float4 diff = color - center_color;
- float distance = dot(diff, diff);
- distances[i] = distance;
- partition_of_texel[i] = 0;
- }
-
-
-
- for (j = 1; j < partition_count; j++)
- {
- float4 center_color = cluster_centers[j];
-
- for (i = 0; i < texels_per_block; i++)
- {
- float4 color = float4(blk->work_data[4 * i],
- blk->work_data[4 * i + 1],
- blk->work_data[4 * i + 2],
- blk->work_data[4 * i + 3]);
- float4 diff = color - center_color;
- float distance = dot(diff, diff);
- if (distance < distances[i])
- {
- distances[i] = distance;
- texels_per_partition[partition_of_texel[i]]--;
- texels_per_partition[j]++;
- partition_of_texel[i] = j;
- }
- }
- }
-
- // it is possible to get a situation where one of the partitions ends up
- // without any texels. In this case, we assign texel N to partition N;
- // this is silly, but ensures that every partition retains at least one texel.
- // Reassigning a texel in this manner may cause another partition to go empty,
- // so if we actually did a reassignment, we run the whole loop over again.
- int problem_case;
- do
- {
- problem_case = 0;
- for (i = 0; i < partition_count; i++)
- {
- if (texels_per_partition[i] == 0)
- {
- texels_per_partition[partition_of_texel[i]]--;
- texels_per_partition[i]++;
- partition_of_texel[i] = i;
- problem_case = 1;
- }
- }
- }
- while (problem_case != 0);
-
-}
-
-
-// basic k-means clustering: given a set of cluster assignments
-// for the texels, find the center position of each cluster.
-void basic_kmeans_update(int xdim, int ydim, int zdim, int partition_count, const imageblock * blk, const int *partition_of_texel, float4 * cluster_centers)
-{
- int i;
-
- int texels_per_block = xdim * ydim * zdim;
-
- float4 color_sum[4];
- int weight_sum[4];
-
- for (i = 0; i < partition_count; i++)
- {
- color_sum[i] = float4(0, 0, 0, 0);
- weight_sum[i] = 0;
- }
-
-
- // first, find the center-of-gravity in each cluster
- for (i = 0; i < texels_per_block; i++)
- {
- float4 color = float4(blk->work_data[4 * i],
- blk->work_data[4 * i + 1],
- blk->work_data[4 * i + 2],
- blk->work_data[4 * i + 3]);
- int part = partition_of_texel[i];
- color_sum[part] = color_sum[part] + color;
- weight_sum[part]++;
- }
-
- for (i = 0; i < partition_count; i++)
- {
- cluster_centers[i] = color_sum[i] * (1.0f / weight_sum[i]);
- }
-}
-
-
-
-
-// after a few rounds of k-means-clustering, we should have a set of 2, 3 or 4 partitions;
-// we then turn this set into 2, 3 or 4 bitmaps. Then, for each of the 1024 partitions,
-// we try to match the bitmaps as well as possible.
-
-
-
-
-static inline int bitcount(uint64_t p)
-{
- if (sizeof(void *) > 4)
- {
- uint64_t mask1 = 0x5555555555555555ULL;
- uint64_t mask2 = 0x3333333333333333ULL;
- uint64_t mask3 = 0x0F0F0F0F0F0F0F0FULL;
- // best-known algorithm for 64-bit bitcount, assuming 64-bit processor
- // should probably be adapted for use with 32-bit processors and/or processors
- // with a POPCNT instruction, but leave that for later.
- p -= (p >> 1) & mask1;
- p = (p & mask2) + ((p >> 2) & mask2);
- p += p >> 4;
- p &= mask3;
- p *= 0x0101010101010101ULL;
- p >>= 56;
- return (int)p;
- }
- else
- {
- // on 32-bit processor, split the 64-bit input argument in two,
- // and bitcount each half separately.
- uint32_t p1 = (uint32_t) p;
- uint32_t p2 = (uint32_t) (p >> 32);
- uint32_t mask1 = 0x55555555U;
- uint32_t mask2 = 0x33333333U;
- uint32_t mask3 = 0x0F0F0F0FU;
- p1 = p1 - ((p1 >> 1) & mask1);
- p2 = p2 - ((p2 >> 1) & mask1);
- p1 = (p1 & mask2) + ((p1 >> 2) & mask2);
- p2 = (p2 & mask2) + ((p2 >> 2) & mask2);
- p1 += p1 >> 4;
- p2 += p2 >> 4;
- p1 &= mask3;
- p2 &= mask3;
- p1 += p2;
- p1 *= 0x01010101U;
- p1 >>= 24;
- return (int)p1;
- }
-}
-
-
-// compute the bit-mismatch for a partitioning in 2-partition mode
-static inline int partition_mismatch2(uint64_t a0, uint64_t a1, uint64_t b0, uint64_t b1)
-{
- int v1 = bitcount(a0 ^ b0) + bitcount(a1 ^ b1);
- int v2 = bitcount(a0 ^ b1) + bitcount(a1 ^ b0);
- return MIN(v1, v2);
-}
-
-
-// compute the bit-mismatch for a partitioning in 3-partition mode
-static inline int partition_mismatch3(uint64_t a0, uint64_t a1, uint64_t a2, uint64_t b0, uint64_t b1, uint64_t b2)
-{
- int p00 = bitcount(a0 ^ b0);
- int p01 = bitcount(a0 ^ b1);
- int p02 = bitcount(a0 ^ b2);
-
- int p10 = bitcount(a1 ^ b0);
- int p11 = bitcount(a1 ^ b1);
- int p12 = bitcount(a1 ^ b2);
-
- int p20 = bitcount(a2 ^ b0);
- int p21 = bitcount(a2 ^ b1);
- int p22 = bitcount(a2 ^ b2);
-
- int s0 = p11 + p22;
- int s1 = p12 + p21;
- int v0 = MIN(s0, s1) + p00;
-
- int s2 = p10 + p22;
- int s3 = p12 + p20;
- int v1 = MIN(s2, s3) + p01;
-
- int s4 = p10 + p21;
- int s5 = p11 + p20;
- int v2 = MIN(s4, s5) + p02;
-
- if (v1 < v0)
- v0 = v1;
- if (v2 < v0)
- v0 = v2;
-
- // 9 add, 5 MIN
-
- return v0;
-}
-
-static inline int MIN3(int a, int b, int c)
-{
- int d = MIN(a, b);
- return MIN(c, d);
-}
-
-// compute the bit-mismatch for a partitioning in 4-partition mode
-static inline int partition_mismatch4(uint64_t a0, uint64_t a1, uint64_t a2, uint64_t a3, uint64_t b0, uint64_t b1, uint64_t b2, uint64_t b3)
-{
- int p00 = bitcount(a0 ^ b0);
- int p01 = bitcount(a0 ^ b1);
- int p02 = bitcount(a0 ^ b2);
- int p03 = bitcount(a0 ^ b3);
-
- int p10 = bitcount(a1 ^ b0);
- int p11 = bitcount(a1 ^ b1);
- int p12 = bitcount(a1 ^ b2);
- int p13 = bitcount(a1 ^ b3);
-
- int p20 = bitcount(a2 ^ b0);
- int p21 = bitcount(a2 ^ b1);
- int p22 = bitcount(a2 ^ b2);
- int p23 = bitcount(a2 ^ b3);
-
- int p30 = bitcount(a3 ^ b0);
- int p31 = bitcount(a3 ^ b1);
- int p32 = bitcount(a3 ^ b2);
- int p33 = bitcount(a3 ^ b3);
-
- int mx23 = MIN(p22 + p33, p23 + p32);
- int mx13 = MIN(p21 + p33, p23 + p31);
- int mx12 = MIN(p21 + p32, p22 + p31);
- int mx03 = MIN(p20 + p33, p23 + p30);
- int mx02 = MIN(p20 + p32, p22 + p30);
- int mx01 = MIN(p21 + p30, p20 + p31);
-
- int v0 = p00 + MIN3(p11 + mx23, p12 + mx13, p13 + mx12);
- int v1 = p01 + MIN3(p10 + mx23, p12 + mx03, p13 + mx02);
- int v2 = p02 + MIN3(p11 + mx03, p10 + mx13, p13 + mx01);
- int v3 = p03 + MIN3(p11 + mx02, p12 + mx01, p10 + mx12);
-
- int x0 = MIN(v0, v1);
- int x1 = MIN(v2, v3);
- return MIN(x0, x1);
-
- // 16 bitcount, 17 MIN, 28 ADD
-}
-
-
-
-void count_partition_mismatch_bits(int xdim, int ydim, int zdim, int partition_count, const uint64_t bitmaps[4], int bitcounts[PARTITION_COUNT])
-{
- int i;
- const partition_info *pi = get_partition_table(xdim, ydim, zdim, partition_count);
-
- if (partition_count == 2)
- {
- uint64_t bm0 = bitmaps[0];
- uint64_t bm1 = bitmaps[1];
- for (i = 0; i < PARTITION_COUNT; i++)
- {
- if (pi->partition_count == 2)
- {
- bitcounts[i] = partition_mismatch2(bm0, bm1, pi->coverage_bitmaps[0], pi->coverage_bitmaps[1]);
- }
- else
- bitcounts[i] = 255;
- pi++;
- }
- }
- else if (partition_count == 3)
- {
- uint64_t bm0 = bitmaps[0];
- uint64_t bm1 = bitmaps[1];
- uint64_t bm2 = bitmaps[2];
- for (i = 0; i < PARTITION_COUNT; i++)
- {
- if (pi->partition_count == 3)
- {
- bitcounts[i] = partition_mismatch3(bm0, bm1, bm2, pi->coverage_bitmaps[0], pi->coverage_bitmaps[1], pi->coverage_bitmaps[2]);
- }
- else
- bitcounts[i] = 255;
- pi++;
- }
- }
- else if (partition_count == 4)
- {
- uint64_t bm0 = bitmaps[0];
- uint64_t bm1 = bitmaps[1];
- uint64_t bm2 = bitmaps[2];
- uint64_t bm3 = bitmaps[3];
- for (i = 0; i < PARTITION_COUNT; i++)
- {
- if (pi->partition_count == 4)
- {
- bitcounts[i] = partition_mismatch4(bm0, bm1, bm2, bm3, pi->coverage_bitmaps[0], pi->coverage_bitmaps[1], pi->coverage_bitmaps[2], pi->coverage_bitmaps[3]);
- }
- else
- bitcounts[i] = 255;
- pi++;
- }
- }
-
-}
-
-
-// counting-sort on the mismatch-bits, thereby
-// sorting the partitions into an ordering.
-
-void get_partition_ordering_by_mismatch_bits(const int mismatch_bits[PARTITION_COUNT], int partition_ordering[PARTITION_COUNT])
-{
- int i;
-
- int mscount[256];
- for (i = 0; i < 256; i++)
- mscount[i] = 0;
-
- for (i = 0; i < PARTITION_COUNT; i++)
- mscount[mismatch_bits[i]]++;
-
- int summa = 0;
- for (i = 0; i < 256; i++)
- {
- int cnt = mscount[i];
- mscount[i] = summa;
- summa += cnt;
- }
-
- for (i = 0; i < PARTITION_COUNT; i++)
- {
- int idx = mscount[mismatch_bits[i]]++;
- partition_ordering[idx] = i;
- }
-}
-
-
-
-
-void kmeans_compute_partition_ordering(int xdim, int ydim, int zdim, int partition_count, const imageblock * blk, int *ordering)
-{
- int i;
-
- const block_size_descriptor *bsd = get_block_size_descriptor(xdim, ydim, zdim);
-
- float4 cluster_centers[4];
- int partition_of_texel[MAX_TEXELS_PER_BLOCK];
-
- // 3 passes of plain k-means partitioning
- for (i = 0; i < 3; i++)
- {
- if (i == 0)
- kpp_initialize(xdim, ydim, zdim, partition_count, blk, cluster_centers);
- else
- basic_kmeans_update(xdim, ydim, zdim, partition_count, blk, partition_of_texel, cluster_centers);
-
- basic_kmeans_assign_pass(xdim, ydim, zdim, partition_count, blk, cluster_centers, partition_of_texel);
- }
-
- // at this point, we have a near-ideal partitioning.
-
- // construct bitmaps
- uint64_t bitmaps[4];
- for (i = 0; i < 4; i++)
- bitmaps[i] = 0ULL;
-
- int texels_to_process = bsd->texelcount_for_bitmap_partitioning;
- for (i = 0; i < texels_to_process; i++)
- {
- int idx = bsd->texels_for_bitmap_partitioning[i];
- bitmaps[partition_of_texel[idx]] |= 1ULL << i;
- }
-
- int bitcounts[PARTITION_COUNT];
- // for each entry in the partition table, count bits of partition-mismatch.
- count_partition_mismatch_bits(xdim, ydim, zdim, partition_count, bitmaps, bitcounts);
-
- // finally, sort the partitions by bits-of-partition-mismatch
- get_partition_ordering_by_mismatch_bits(bitcounts, ordering);
-
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_lib.cpp b/3rdparty/bimg/3rdparty/astc/astc_lib.cpp
deleted file mode 100644
index f01605217fd..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_lib.cpp
+++ /dev/null
@@ -1,565 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * @author Andrew Willmott
- *
- * @brief Library api for astc codec, to be used as an alternative to astc_toplevel.cpp
- */
-/*----------------------------------------------------------------------------*/
-
-
-#include "astc_lib.h"
-
-#include "astc_codec_internals.h"
-
-#include <math.h>
-#include <stdio.h>
-
-// Globals declared in astc_codec_internals.h
-int perform_srgb_transform = 0;
-int alpha_force_use_of_hdr = 0;
-int rgb_force_use_of_hdr = 0;
-int print_tile_errors = 0;
-
-#ifdef DEBUG_PRINT_DIAGNOSTICS
- int print_diagnostics = 0;
- int diagnostics_tile = -1;
-#endif
-
-// ASTC code expects this to be defined
-void astc_codec_internal_error(const char* filename, int line)
-{
- fprintf(stderr, "ASTC encode error @ %s:%d\n", filename, line);
-}
-
-// @todo add HDR variants
-
-namespace
-{
- static bool s_tables_initialised = false;
-
- inline void init_tables()
- {
- if (!s_tables_initialised)
- {
- prepare_angular_tables();
- build_quantization_mode_table();
-
- s_tables_initialised = true;
- }
- }
-
- const swizzlepattern k_swizzles[] =
- {
- { 0, 1, 2, 3 }, // ASTC_RGBA
- { 2, 1, 0, 3 }, // ASTC_BGRA
- { 0, 0, 0, 1 }, // ASTC_ENC_NORMAL_RA
- { 0, 0, 0, 1 }, // ASTC_ENC_NORMAL_RA_PCPT
- { 0, 3, 6, 5 }, // ASTC_DEC_RA_NORMAL
- };
-
- void alloc_temp_buffers(compress_symbolic_block_buffers* temp_buffers)
- {
- temp_buffers->ewb = new error_weight_block;
- temp_buffers->ewbo = new error_weight_block_orig;
- temp_buffers->tempblocks = new symbolic_compressed_block[4];
- temp_buffers->temp = new imageblock;
-
- temp_buffers->planes2 = new compress_fixed_partition_buffers;
- temp_buffers->planes2->ei1 = new endpoints_and_weights;
- temp_buffers->planes2->ei2 = new endpoints_and_weights;
- temp_buffers->planes2->eix1 = new endpoints_and_weights[MAX_DECIMATION_MODES];
- temp_buffers->planes2->eix2 = new endpoints_and_weights[MAX_DECIMATION_MODES];
- temp_buffers->planes2->decimated_quantized_weights = new float[2 * MAX_DECIMATION_MODES * MAX_WEIGHTS_PER_BLOCK];
- temp_buffers->planes2->decimated_weights = new float[2 * MAX_DECIMATION_MODES * MAX_WEIGHTS_PER_BLOCK];
- temp_buffers->planes2->flt_quantized_decimated_quantized_weights = new float[2 * MAX_WEIGHT_MODES * MAX_WEIGHTS_PER_BLOCK];
- temp_buffers->planes2->u8_quantized_decimated_quantized_weights = new uint8_t[2 * MAX_WEIGHT_MODES * MAX_WEIGHTS_PER_BLOCK];
- temp_buffers->plane1 = temp_buffers->planes2;
- }
-
- void free_temp_buffers(compress_symbolic_block_buffers* temp_buffers)
- {
- delete[] temp_buffers->planes2->decimated_quantized_weights;
- delete[] temp_buffers->planes2->decimated_weights;
- delete[] temp_buffers->planes2->flt_quantized_decimated_quantized_weights;
- delete[] temp_buffers->planes2->u8_quantized_decimated_quantized_weights;
- delete[] temp_buffers->planes2->eix1;
- delete[] temp_buffers->planes2->eix2;
- delete temp_buffers->planes2->ei1;
- delete temp_buffers->planes2->ei2;
- delete temp_buffers->planes2;
-
- delete[] temp_buffers->tempblocks;
- delete temp_buffers->temp;
- delete temp_buffers->ewbo;
- delete temp_buffers->ewb;
- }
-
-
- // More direct version of the astc_codec_image routine, which operates on a
- // more conventional 2D image layout. Doesn't support padding, so
- // mean_stdev_radius and alpha_radius etc. must be zero.
- void to_imageblock
- (
- imageblock* pb,
- const uint8_t* src_data,
- int src_stride,
- int xpos,
- int ypos,
- int xsize,
- int ysize,
- int xdim,
- int ydim,
- swizzlepattern swz,
- bool srgb
- )
- {
- float* fptr = pb->orig_data;
-
- pb->xpos = xpos;
- pb->ypos = ypos;
- pb->zpos = 0;
-
- float data[6];
- data[4] = 0;
- data[5] = 1;
-
- for (int y = 0; y < ydim; y++)
- {
- for (int x = 0; x < xdim; x++)
- {
- int xi = xpos + x;
- int yi = ypos + y;
-
- if (xi >= xsize)
- xi = xsize - 1;
- if (yi >= ysize)
- yi = ysize - 1;
-
- int offset = src_stride * yi + 4 * xi;
-
- int r = src_data[offset + 0];
- int g = src_data[offset + 1];
- int b = src_data[offset + 2];
- int a = src_data[offset + 3];
-
- data[0] = r / 255.0f;
- data[1] = g / 255.0f;
- data[2] = b / 255.0f;
- data[3] = a / 255.0f;
-
- fptr[0] = data[swz.r];
- fptr[1] = data[swz.g];
- fptr[2] = data[swz.b];
- fptr[3] = data[swz.a];
-
- fptr += 4;
- }
- }
-
- // perform sRGB-to-linear transform on input data, if requested.
- int pixelcount = xdim * ydim;
-
- if (srgb)
- {
- fptr = pb->orig_data;
-
- for (int i = 0; i < pixelcount; i++)
- {
- float r = fptr[0];
- float g = fptr[1];
- float b = fptr[2];
-
- if (r <= 0.04045f)
- r = r * (1.0f / 12.92f);
- else if (r <= 1)
- r = pow((r + 0.055f) * (1.0f / 1.055f), 2.4f);
-
- if (g <= 0.04045f)
- g = g * (1.0f / 12.92f);
- else if (g <= 1)
- g = pow((g + 0.055f) * (1.0f / 1.055f), 2.4f);
-
- if (b <= 0.04045f)
- b = b * (1.0f / 12.92f);
- else if (b <= 1)
- b = pow((b + 0.055f) * (1.0f / 1.055f), 2.4f);
-
- fptr[0] = r;
- fptr[1] = g;
- fptr[2] = b;
-
- fptr += 4;
- }
- }
-
- for (int i = 0; i < pixelcount; i++)
- {
- pb->rgb_lns [i] = 0;
- pb->alpha_lns[i] = 0;
- pb->nan_texel[i] = 0;
- }
-
- imageblock_initialize_work_from_orig(pb, pixelcount);
-
- update_imageblock_flags(pb, xdim, ydim, 1);
- }
-
- void encode_astc
- (
- const uint8_t* src,
- int src_stride,
- swizzlepattern src_swz,
- int xsize,
- int ysize,
- int xdim,
- int ydim,
- const error_weighting_params* ewp,
- astc_decode_mode decode_mode,
- uint8_t* dst
- )
- {
- int xblocks = (xsize + xdim - 1) / xdim;
- int yblocks = (ysize + ydim - 1) / ydim;
-
- get_block_size_descriptor(xdim, ydim, 1);
- get_partition_table(xdim, ydim, 1, 0);
-
- imageblock pb;
-
- compress_symbolic_block_buffers temp_buffers;
- alloc_temp_buffers(&temp_buffers);
-
- astc_codec_image image_info = { nullptr, nullptr, xsize, ysize, 1, 0 };
-
- for (int y = 0; y < yblocks; y++)
- for (int x = 0; x < xblocks; x++)
- {
- to_imageblock(&pb, src, src_stride, x * xdim, y * ydim, xsize, ysize, xdim, ydim, src_swz, decode_mode == DECODE_LDR_SRGB);
-
- symbolic_compressed_block scb;
- compress_symbolic_block(&image_info, decode_mode, xdim, ydim, 1, ewp, &pb, &scb, &temp_buffers);
-
- physical_compressed_block pcb = symbolic_to_physical(xdim, ydim, 1, &scb);
-
- uint8_t* dst_block = dst + (y * xblocks + x) * 16;
-
- *(physical_compressed_block*) dst_block = pcb;
- }
-
- free_temp_buffers(&temp_buffers);
- }
-
- void init_ewp(error_weighting_params& ewp)
- {
- ewp.rgb_power = 1.0f;
- ewp.alpha_power = 1.0f;
- ewp.rgb_base_weight = 1.0f;
- ewp.alpha_base_weight = 1.0f;
- ewp.rgb_mean_weight = 0.0f;
- ewp.rgb_stdev_weight = 0.0f;
- ewp.alpha_mean_weight = 0.0f;
- ewp.alpha_stdev_weight = 0.0f;
-
- ewp.rgb_mean_and_stdev_mixing = 0.0f;
- ewp.mean_stdev_radius = 0;
- ewp.enable_rgb_scale_with_alpha = 0;
- ewp.alpha_radius = 0;
-
- ewp.block_artifact_suppression = 0.0f;
- ewp.rgba_weights[0] = 1.0f;
- ewp.rgba_weights[1] = 1.0f;
- ewp.rgba_weights[2] = 1.0f;
- ewp.rgba_weights[3] = 1.0f;
- ewp.ra_normal_angular_scale = 0;
- }
-
- void setup_ewp(ASTC_COMPRESS_MODE mode, int ydim, int xdim, error_weighting_params& ewp)
- {
- float oplimit = 0.0;
- float dblimit_2d = 0.0;
- float bmc = 0.0;
- float mincorrel = 0.0;
-
- int plimit = -1;
- int maxiters = 0;
-
- float log10_texels_2d = log((float)(xdim * ydim)) / log(10.0f);
-
- if (mode == ASTC_COMPRESS_VERY_FAST)
- {
- plimit = 2;
- oplimit = 1.0;
- dblimit_2d = MAX(70 - 35 * log10_texels_2d, 53 - 19 * log10_texels_2d);
- bmc = 25;
- mincorrel = 0.5;
- maxiters = 1;
- }
- else if (mode == ASTC_COMPRESS_FAST)
- {
- plimit = 4;
- oplimit = 1.0;
- mincorrel = 0.5;
- dblimit_2d = MAX(85 - 35 * log10_texels_2d, 63 - 19 * log10_texels_2d);
- bmc = 50;
- maxiters = 1;
- }
- else if (mode == ASTC_COMPRESS_MEDIUM)
- {
- plimit = 25;
- oplimit = 1.2f;
- mincorrel = 0.75f;
- dblimit_2d = MAX(95 - 35 * log10_texels_2d, 70 - 19 * log10_texels_2d);
- bmc = 75;
- maxiters = 2;
- }
- else if (mode == ASTC_COMPRESS_THOROUGH)
- {
- plimit = 100;
- oplimit = 2.5f;
- mincorrel = 0.95f;
- dblimit_2d = MAX(105 - 35 * log10_texels_2d, 77 - 19 * log10_texels_2d);
- bmc = 95;
- maxiters = 4;
- }
- else if (mode == ASTC_COMPRESS_EXHAUSTIVE)
- {
- plimit = PARTITION_COUNT;
- oplimit = 1000.0f;
- mincorrel = 0.99f;
- dblimit_2d = 999.0f;
- bmc = 100;
- maxiters = 4;
- }
-
- ewp.max_refinement_iters = maxiters;
- ewp.block_mode_cutoff = bmc / 100.0f;
-
- float texel_avg_error_limit_2d;
-
- if (rgb_force_use_of_hdr == 0)
- {
- texel_avg_error_limit_2d = pow(0.1f, dblimit_2d * 0.1f) * 65535.0f * 65535.0f;
- }
- else
- {
- texel_avg_error_limit_2d = 0.0f;
- }
- ewp.partition_1_to_2_limit = oplimit;
- ewp.lowest_correlation_cutoff = mincorrel;
-
- int partitions_to_test = plimit;
- if (partitions_to_test < 1)
- partitions_to_test = 1;
- else if (partitions_to_test > PARTITION_COUNT)
- partitions_to_test = PARTITION_COUNT;
- ewp.partition_search_limit = partitions_to_test;
-
- ewp.texel_avg_error_limit = texel_avg_error_limit_2d;
-
- expand_block_artifact_suppression(xdim, ydim, 1, &ewp);
- }
-
- void setup_ewp(ASTC_CHANNELS channels, error_weighting_params& ewp)
- {
- if (channels == ASTC_ENC_NORMAL_RA)
- {
- ewp.rgba_weights[0] = 1.0f;
- ewp.rgba_weights[1] = 0.01f;
- ewp.rgba_weights[2] = 0.01f;
- ewp.rgba_weights[3] = 1.0f;
- ewp.ra_normal_angular_scale = 1;
- }
- }
-}
-
-size_t astc_compressed_size(int w, int h, int bw, int bh)
-{
- int nx = (w + bw - 1) / bw;
- int ny = (h + bh - 1) / bh;
-
- return nx * ny * 16;
-}
-
-void astc_compress
-(
- int src_width,
- int src_height,
- const uint8_t* src_data,
- ASTC_CHANNELS src_channels,
- int src_stride,
-
- int block_width,
- int block_height,
- ASTC_COMPRESS_MODE compress_mode,
- ASTC_DECODE_MODE decode_mode,
- uint8_t* dst_data
-)
-{
- init_tables();
-
- error_weighting_params ewp;
- init_ewp(ewp);
- setup_ewp(compress_mode, block_width, block_height, ewp);
- setup_ewp(src_channels, ewp); // For special-case encoding of some channel types such as normals
-
- if (src_stride == 0)
- src_stride = src_width * 4;
-
- encode_astc
- (
- src_data,
- src_stride,
- k_swizzles[src_channels],
- src_width, src_height,
- block_width, block_height,
- &ewp,
- (astc_decode_mode) decode_mode,
- dst_data
- );
-}
-
-namespace
-{
- // More direct version of the astc_codec_image routine, which operates on a
- // more conventional 2D image layout.
- void from_imageblock(int xdim, int ydim, const imageblock* pb, bool srgb, swizzlepattern swz, uint8_t* dst_data, int dst_stride)
- {
- const float* fptr = pb->orig_data;
- const uint8_t* nptr = pb->nan_texel;
-
- for (int y = 0; y < ydim; y++)
- {
- for (int x = 0; x < xdim; x++)
- {
- if (*nptr)
- {
- // NaN-pixel, but we can't display it. Display purple instead.
- dst_data[4 * x + swz.r] = 0xFF;
- dst_data[4 * x + swz.g] = 0x00;
- dst_data[4 * x + swz.b] = 0xFF;
- dst_data[4 * x + swz.a] = 0xFF;
- }
- else
- {
- float r = fptr[0];
- float g = fptr[1];
- float b = fptr[2];
- float a = fptr[3];
-
- if (srgb)
- {
- if (r <= 0.0031308f)
- r = r * 12.92f;
- else if (r <= 1)
- r = 1.055f * pow(r, (1.0f / 2.4f)) - 0.055f;
-
- if (g <= 0.0031308f)
- g = g * 12.92f;
- else if (g <= 1)
- g = 1.055f * pow(g, (1.0f / 2.4f)) - 0.055f;
-
- if (b <= 0.0031308f)
- b = b * 12.92f;
- else if (b <= 1)
- b = 1.055f * pow(b, (1.0f / 2.4f)) - 0.055f;
- }
-
- // clamp to [0,1]
- if (r > 1.0f)
- r = 1.0f;
- if (g > 1.0f)
- g = 1.0f;
- if (b > 1.0f)
- b = 1.0f;
- if (a > 1.0f)
- a = 1.0f;
-
- // pack the data
- dst_data[4 * x + swz.r] = uint8_t(floorf(r * 255.0f + 0.5f));
- dst_data[4 * x + swz.g] = uint8_t(floorf(g * 255.0f + 0.5f));
- dst_data[4 * x + swz.b] = uint8_t(floorf(b * 255.0f + 0.5f));
- dst_data[4 * x + swz.a] = uint8_t(floorf(a * 255.0f + 0.5f));
- }
-
- fptr += 4;
- nptr++;
- }
-
- dst_data += dst_stride;
- }
- }
-}
-
-void astc_decompress
-(
- const uint8_t* src_data,
- int xdim,
- int ydim,
- ASTC_DECODE_MODE decode_mode,
-
- int xsize,
- int ysize,
- uint8_t* dst_data,
- ASTC_CHANNELS dst_channels,
- int dst_stride
-)
-{
- init_tables();
-
- int xblocks = (xsize + xdim - 1) / xdim;
- int yblocks = (ysize + ydim - 1) / ydim;
-
- if (dst_stride == 0)
- dst_stride = 4 * xsize;
-
- imageblock pb;
-
- for (int y = 0; y < yblocks; y++)
- {
- int ypos = y * ydim;
- int clamp_ydim = MIN(ysize - ypos, ydim);
-
- uint8_t* dst_row = dst_data + ypos * dst_stride;
-
- for (int x = 0; x < xblocks; x++)
- {
- int xpos = x * xdim;
- int clamp_xdim = MIN(xsize - xpos, xdim);
-
- physical_compressed_block pcb = *(const physical_compressed_block *) src_data;
- symbolic_compressed_block scb;
-
- physical_to_symbolic(xdim, ydim, 1, pcb, &scb);
- decompress_symbolic_block((astc_decode_mode) decode_mode, xdim, ydim, 1, xpos, ypos, 0, &scb, &pb);
-
- from_imageblock(clamp_xdim, clamp_ydim, &pb, decode_mode == ASTC_DECODE_LDR_SRGB, k_swizzles[dst_channels], dst_row + xpos * 4, dst_stride);
-
- src_data += 16;
- }
- }
-}
-
-// Relevant astc source files. These aren't set up for a bulk build yet though.
-#ifdef DISABLED
- #include "astc_block_sizes2.cpp"
- #include "astc_color_quantize.cpp"
- #include "astc_color_unquantize.cpp"
- #include "astc_compress_symbolic.cpp"
- #include "astc_compute_variance.cpp"
- #include "astc_decompress_symbolic.cpp"
- #include "astc_encoding_choice_error.cpp"
- #include "astc_find_best_partitioning.cpp"
- #include "astc_ideal_endpoints_and_weights.cpp"
- #include "astc_imageblock.cpp"
- #include "astc_integer_sequence.cpp"
- #include "astc_kmeans_partitioning.cpp"
- #include "astc_partition_tables.cpp"
- #include "astc_percentile_tables.cpp"
- #include "astc_pick_best_endpoint_format.cpp"
- #include "astc_quantization.cpp"
- #include "astc_symbolic_physical.cpp"
- #include "astc_weight_align.cpp"
- #include "astc_weight_quant_xfer_tables.cpp"
- #include "mathlib.cpp"
- #include "softfloat.cpp"
-#endif
diff --git a/3rdparty/bimg/3rdparty/astc/astc_lib.h b/3rdparty/bimg/3rdparty/astc/astc_lib.h
deleted file mode 100644
index 527e00a083d..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_lib.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * @author Andrew Willmott
- *
- * @brief Library api for astc codec, to be used as an alternative to astc_toplevel.cpp
- */
-/*----------------------------------------------------------------------------*/
-
-#ifndef ASTC_LIB_H
-#define ASTC_LIB_H
-
-#include <stdint.h>
-#include <stdlib.h>
-
-enum ASTC_COMPRESS_MODE // Trade-off compression quality for speed
-{
- ASTC_COMPRESS_VERY_FAST,
- ASTC_COMPRESS_FAST,
- ASTC_COMPRESS_MEDIUM,
- ASTC_COMPRESS_THOROUGH,
- ASTC_COMPRESS_EXHAUSTIVE,
-};
-
-enum ASTC_DECODE_MODE
-{
- ASTC_DECODE_LDR_SRGB, // texture will be decompressed to 8-bit SRGB
- ASTC_DECODE_LDR_LINEAR, // texture will be decompressed to 8-bit linear
- ASTC_DECODE_HDR // texture will be decompressed to 16-bit linear
-};
-
-enum ASTC_CHANNELS
-{
- ASTC_RGBA, // Encode/decode into RGBA
- ASTC_BGRA, // Encode/decode into BGRA
- ASTC_ENC_NORMAL_RA, // Encode normal XYZ as XY in RA with reconstructed Z
- ASTC_DEC_RA_NORMAL, // Decode RA into XY and reconstructed Z
-};
-
-
-size_t astc_compressed_size(int block_width, int block_height, int width, int height);
-//!< Returns size of the compressed data for a width x height source image, assuming the given block size
-
-void astc_compress
-(
- int src_width,
- int src_height,
- const uint8_t* src_data,
- ASTC_CHANNELS src_channels,
- int src_stride,
-
- int block_width,
- int block_height,
- ASTC_COMPRESS_MODE compress_mode,
- ASTC_DECODE_MODE decode_mode,
- uint8_t* dst_data
-);
-//!< Compress 8-bit rgba source image into dst_data (expected to be of size astc_compressed_size(...))
-
-void astc_decompress
-(
- const uint8_t* src_data,
- int block_width,
- int block_height,
- ASTC_DECODE_MODE decode_mode,
-
- int dst_width,
- int dst_height,
- uint8_t* dst_data,
- ASTC_CHANNELS dst_channels,
- int dst_stride
-);
-//!< Decompress astc source image into 8-bit rgba destination image.
-
-#endif
-
diff --git a/3rdparty/bimg/3rdparty/astc/astc_partition_tables.cpp b/3rdparty/bimg/3rdparty/astc/astc_partition_tables.cpp
deleted file mode 100644
index 7e0a46011c8..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_partition_tables.cpp
+++ /dev/null
@@ -1,323 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Functions to generate partition tables for ASTC.
- *
- * We generate tables only for the block sizes that have actually been
- * specified to the codec.
- */
-/*----------------------------------------------------------------------------*/
-
-#include "astc_codec_internals.h"
-
-static partition_info **partition_tables[4096];
-
-/*
- Produce a canonicalized representation of a partition pattern
-
- The largest possible such representation is 432 bits, equal to 7 uint64_t values.
-*/
-static void gen_canonicalized_partition_table(int texel_count, const uint8_t * partition_table, uint64_t canonicalized[7])
-{
- int i;
- for (i = 0; i < 7; i++)
- canonicalized[i] = 0;
-
- int mapped_index[4];
- int map_weight_count = 0;
- for (i = 0; i < 4; i++)
- mapped_index[i] = -1;
-
- for (i = 0; i < texel_count; i++)
- {
- int index = partition_table[i];
- if (mapped_index[index] == -1)
- mapped_index[index] = map_weight_count++;
- uint64_t xlat_index = mapped_index[index];
- canonicalized[i >> 5] |= xlat_index << (2 * (i & 0x1F));
- }
-}
-
-
-static int compare_canonicalized_partition_tables(const uint64_t part1[7], const uint64_t part2[7])
-{
- if (part1[0] != part2[0])
- return 0;
- if (part1[1] != part2[1])
- return 0;
- if (part1[2] != part2[2])
- return 0;
- if (part1[3] != part2[3])
- return 0;
- if (part1[4] != part2[4])
- return 0;
- if (part1[5] != part2[5])
- return 0;
- if (part1[6] != part2[6])
- return 0;
- return 1;
-}
-
-
-/*
- For a partition table, detect partitionings that are equivalent, then mark them as invalid. This reduces the number of partitions that the codec has to consider and thus improves encode
- performance. */
-static void partition_table_zap_equal_elements(int xdim, int ydim, int zdim, partition_info * pi)
-{
- int partition_tables_zapped = 0;
-
- int texel_count = xdim * ydim * zdim;
-
- int i, j;
- uint64_t *canonicalizeds = new uint64_t[PARTITION_COUNT * 7];
-
-
- for (i = 0; i < PARTITION_COUNT; i++)
- {
- gen_canonicalized_partition_table(texel_count, pi[i].partition_of_texel, canonicalizeds + i * 7);
- }
-
- for (i = 0; i < PARTITION_COUNT; i++)
- {
- for (j = 0; j < i; j++)
- {
- if (compare_canonicalized_partition_tables(canonicalizeds + 7 * i, canonicalizeds + 7 * j))
- {
- pi[i].partition_count = 0;
- partition_tables_zapped++;
- break;
- }
- }
- }
- delete[]canonicalizeds;
-}
-
-
-uint32_t hash52(uint32_t inp)
-{
- inp ^= inp >> 15;
-
- inp *= 0xEEDE0891; // (2^4+1)*(2^7+1)*(2^17-1)
- inp ^= inp >> 5;
- inp += inp << 16;
- inp ^= inp >> 7;
- inp ^= inp >> 3;
- inp ^= inp << 6;
- inp ^= inp >> 17;
- return inp;
-}
-
-
-
-int select_partition(int seed, int x, int y, int z, int partitioncount, int small_block)
-{
- if (small_block)
- {
- x <<= 1;
- y <<= 1;
- z <<= 1;
- }
-
- seed += (partitioncount - 1) * 1024;
-
- uint32_t rnum = hash52(seed);
-
- uint8_t seed1 = rnum & 0xF;
- uint8_t seed2 = (rnum >> 4) & 0xF;
- uint8_t seed3 = (rnum >> 8) & 0xF;
- uint8_t seed4 = (rnum >> 12) & 0xF;
- uint8_t seed5 = (rnum >> 16) & 0xF;
- uint8_t seed6 = (rnum >> 20) & 0xF;
- uint8_t seed7 = (rnum >> 24) & 0xF;
- uint8_t seed8 = (rnum >> 28) & 0xF;
- uint8_t seed9 = (rnum >> 18) & 0xF;
- uint8_t seed10 = (rnum >> 22) & 0xF;
- uint8_t seed11 = (rnum >> 26) & 0xF;
- uint8_t seed12 = ((rnum >> 30) | (rnum << 2)) & 0xF;
-
- // squaring all the seeds in order to bias their distribution
- // towards lower values.
- seed1 *= seed1;
- seed2 *= seed2;
- seed3 *= seed3;
- seed4 *= seed4;
- seed5 *= seed5;
- seed6 *= seed6;
- seed7 *= seed7;
- seed8 *= seed8;
- seed9 *= seed9;
- seed10 *= seed10;
- seed11 *= seed11;
- seed12 *= seed12;
-
-
- int sh1, sh2, sh3;
- if (seed & 1)
- {
- sh1 = (seed & 2 ? 4 : 5);
- sh2 = (partitioncount == 3 ? 6 : 5);
- }
- else
- {
- sh1 = (partitioncount == 3 ? 6 : 5);
- sh2 = (seed & 2 ? 4 : 5);
- }
- sh3 = (seed & 0x10) ? sh1 : sh2;
-
- seed1 >>= sh1;
- seed2 >>= sh2;
- seed3 >>= sh1;
- seed4 >>= sh2;
- seed5 >>= sh1;
- seed6 >>= sh2;
- seed7 >>= sh1;
- seed8 >>= sh2;
-
- seed9 >>= sh3;
- seed10 >>= sh3;
- seed11 >>= sh3;
- seed12 >>= sh3;
-
-
-
- int a = seed1 * x + seed2 * y + seed11 * z + (rnum >> 14);
- int b = seed3 * x + seed4 * y + seed12 * z + (rnum >> 10);
- int c = seed5 * x + seed6 * y + seed9 * z + (rnum >> 6);
- int d = seed7 * x + seed8 * y + seed10 * z + (rnum >> 2);
-
-
- // apply the saw
- a &= 0x3F;
- b &= 0x3F;
- c &= 0x3F;
- d &= 0x3F;
-
- // remove some of the components if we are to output < 4 partitions.
- if (partitioncount <= 3)
- d = 0;
- if (partitioncount <= 2)
- c = 0;
- if (partitioncount <= 1)
- b = 0;
-
- int partition;
- if (a >= b && a >= c && a >= d)
- partition = 0;
- else if (b >= c && b >= d)
- partition = 1;
- else if (c >= d)
- partition = 2;
- else
- partition = 3;
- return partition;
-}
-
-
-
-void generate_one_partition_table(int xdim, int ydim, int zdim, int partition_count, int partition_index, partition_info * pt)
-{
- int small_block = (xdim * ydim * zdim) < 32;
-
- uint8_t *partition_of_texel = pt->partition_of_texel;
- int x, y, z, i;
-
-
- for (z = 0; z < zdim; z++)
- for (y = 0; y < ydim; y++)
- for (x = 0; x < xdim; x++)
- {
- uint8_t part = select_partition(partition_index, x, y, z, partition_count, small_block);
- *partition_of_texel++ = part;
- }
-
-
- int texels_per_block = xdim * ydim * zdim;
-
- int counts[4];
- for (i = 0; i < 4; i++)
- counts[i] = 0;
-
- for (i = 0; i < texels_per_block; i++)
- {
- int partition = pt->partition_of_texel[i];
- pt->texels_of_partition[partition][counts[partition]++] = i;
- }
-
- for (i = 0; i < 4; i++)
- pt->texels_per_partition[i] = counts[i];
-
- if (counts[0] == 0)
- pt->partition_count = 0;
- else if (counts[1] == 0)
- pt->partition_count = 1;
- else if (counts[2] == 0)
- pt->partition_count = 2;
- else if (counts[3] == 0)
- pt->partition_count = 3;
- else
- pt->partition_count = 4;
-
-
-
- for (i = 0; i < 4; i++)
- pt->coverage_bitmaps[i] = 0ULL;
-
- const block_size_descriptor *bsd = get_block_size_descriptor(xdim, ydim, zdim);
- int texels_to_process = bsd->texelcount_for_bitmap_partitioning;
- for (i = 0; i < texels_to_process; i++)
- {
- int idx = bsd->texels_for_bitmap_partitioning[i];
- pt->coverage_bitmaps[pt->partition_of_texel[idx]] |= 1ULL << i;
- }
-
-}
-
-static void generate_partition_tables(int xdim, int ydim, int zdim)
-{
- int i;
-
-
- partition_info *one_partition = new partition_info;
- partition_info *two_partitions = new partition_info[1024];
- partition_info *three_partitions = new partition_info[1024];
- partition_info *four_partitions = new partition_info[1024];
-
- partition_info **partition_table = new partition_info *[5];
- partition_table[0] = NULL;
- partition_table[1] = one_partition;
- partition_table[2] = two_partitions;
- partition_table[3] = three_partitions;
- partition_table[4] = four_partitions;
-
- generate_one_partition_table(xdim, ydim, zdim, 1, 0, one_partition);
- for (i = 0; i < 1024; i++)
- {
- generate_one_partition_table(xdim, ydim, zdim, 2, i, two_partitions + i);
- generate_one_partition_table(xdim, ydim, zdim, 3, i, three_partitions + i);
- generate_one_partition_table(xdim, ydim, zdim, 4, i, four_partitions + i);
- }
-
- partition_table_zap_equal_elements(xdim, ydim, zdim, two_partitions);
- partition_table_zap_equal_elements(xdim, ydim, zdim, three_partitions);
- partition_table_zap_equal_elements(xdim, ydim, zdim, four_partitions);
-
- partition_tables[xdim + 16 * ydim + 256 * zdim] = partition_table;
-}
-
-
-const partition_info *get_partition_table(int xdim, int ydim, int zdim, int partition_count)
-{
- int ptindex = xdim + 16 * ydim + 256 * zdim;
- if (partition_tables[ptindex] == NULL)
- generate_partition_tables(xdim, ydim, zdim);
-
- return partition_tables[ptindex][partition_count];
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_percentile_tables.cpp b/3rdparty/bimg/3rdparty/astc/astc_percentile_tables.cpp
deleted file mode 100644
index 6b96ef8cf72..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_percentile_tables.cpp
+++ /dev/null
@@ -1,4768 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Percentile tables for ASTC.
- */
-/*----------------------------------------------------------------------------*/
-
-extern const float percentile_table_4x4[2048];
-extern const float percentile_table_4x5[2048];
-extern const float percentile_table_4x6[2048];
-extern const float percentile_table_4x8[2048];
-extern const float percentile_table_4x10[2048];
-extern const float percentile_table_4x12[2048];
-extern const float percentile_table_5x4[2048];
-extern const float percentile_table_5x5[2048];
-extern const float percentile_table_5x6[2048];
-extern const float percentile_table_5x8[2048];
-extern const float percentile_table_5x10[2048];
-extern const float percentile_table_5x12[2048];
-extern const float percentile_table_6x4[2048];
-extern const float percentile_table_6x5[2048];
-extern const float percentile_table_6x6[2048];
-extern const float percentile_table_6x8[2048];
-extern const float percentile_table_6x10[2048];
-extern const float percentile_table_6x12[2048];
-extern const float percentile_table_8x4[2048];
-extern const float percentile_table_8x5[2048];
-extern const float percentile_table_8x6[2048];
-extern const float percentile_table_8x8[2048];
-extern const float percentile_table_8x10[2048];
-extern const float percentile_table_8x12[2048];
-extern const float percentile_table_10x4[2048];
-extern const float percentile_table_10x5[2048];
-extern const float percentile_table_10x6[2048];
-extern const float percentile_table_10x8[2048];
-extern const float percentile_table_10x10[2048];
-extern const float percentile_table_10x12[2048];
-extern const float percentile_table_12x4[2048];
-extern const float percentile_table_12x5[2048];
-extern const float percentile_table_12x6[2048];
-extern const float percentile_table_12x8[2048];
-extern const float percentile_table_12x10[2048];
-extern const float percentile_table_12x12[2048];
-
-
-const float percentile_table_4x4[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.8661f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7732f, 0.8567f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7818f, 0.8914f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.4578f, 0.5679f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4183f, 0.4961f, 0.5321f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9151f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9400f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9678f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8111f, 0.8833f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8299f, 0.8988f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9182f, 0.9692f, 0.9820f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9663f, 0.9911f, 0.8707f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9088f, 0.9374f, 0.8793f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8750f, 0.8952f, 0.7356f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.2746f, 0.0000f, 0.0772f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.1487f, 0.2193f, 0.3263f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9917f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9996f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9516f, 0.9838f, 0.9927f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9731f, 0.9906f, 0.9448f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9900f, 0.9999f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9991f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9949f, 0.9987f, 0.9936f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9966f, 0.9985f, 0.9615f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9269f, 0.9577f, 0.9057f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9023f, 0.9241f, 0.7499f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9757f, 0.9846f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9922f, 0.9932f, 0.9792f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9881f, 0.9494f, 0.8178f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9780f, 0.8518f, 0.6206f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9472f, 0.7191f, 0.7003f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8356f, 0.3772f, 0.9971f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 0.9980f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f, 0.9977f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9769f, 0.9875f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9945f, 0.9941f, 0.9861f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9956f, 0.9982f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9989f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9868f, 0.9854f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9888f, 0.9811f, 0.9706f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9894f, 0.9425f, 0.8465f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9718f, 0.8614f, 0.6422f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9648f, 0.9212f, 0.8412f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9596f, 0.9557f, 0.9537f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6814f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7971f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9999f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f, 0.9994f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9961f, 0.9984f, 0.9958f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9952f, 0.9994f, 0.9633f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9829f, 0.9120f, 0.8042f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9744f, 0.9296f, 0.9349f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9973f, 0.9993f, 0.9988f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f, 0.9998f, 0.9802f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8874f, 0.5963f, 0.9323f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8239f, 0.7625f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6625f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7895f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_4x5[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.8886f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7962f, 0.9052f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8118f, 0.9315f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7247f, 0.8069f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7789f, 0.8308f, 0.8434f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.4129f, 0.4395f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3795f, 0.3370f, 0.1853f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9566f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8585f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8946f, 0.9102f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9502f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9739f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8854f, 0.9554f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9150f, 0.9748f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7849f, 0.8689f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8214f, 0.7729f, 0.8016f,
- 1.0000f, 0.9172f, 0.9659f, 0.9781f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9701f, 0.9873f, 0.8394f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9457f, 0.9637f, 0.9334f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9236f, 0.9407f, 0.7395f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6662f, 0.6019f, 0.7169f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5436f, 0.7007f, 0.7907f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.0000f, 0.2718f, 0.5740f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.0959f, 0.5888f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9946f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9996f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9928f, 0.9995f, 0.9986f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9980f, 0.9998f, 0.9879f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9441f, 0.9773f, 0.9256f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9812f, 0.9789f, 0.8975f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9940f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9994f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9973f, 0.9992f, 0.9949f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9983f, 0.9990f, 0.9541f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9690f, 0.9841f, 0.9730f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9425f, 0.9602f, 0.8354f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9001f, 0.6261f, 0.6370f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8549f, 0.8473f, 0.6477f,
- 1.0000f, 1.0000f, 0.9648f, 0.9867f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9910f, 0.9884f, 0.9827f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9890f, 0.9670f, 0.9077f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9855f, 0.9276f, 0.6753f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9711f, 0.7668f, 0.5272f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9295f, 0.5087f, 0.9971f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9488f, 0.6570f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7537f, 0.9590f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f, 0.9979f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f, 0.9982f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9848f, 0.9932f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9953f, 0.9955f, 0.9936f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9797f, 0.9720f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9680f, 0.9861f, 0.9353f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9958f, 0.9987f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 0.9976f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9924f, 0.9905f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9915f, 0.9919f, 0.9819f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9895f, 0.9389f, 0.8512f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9764f, 0.8917f, 0.4628f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9756f, 0.8262f, 0.6148f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9372f, 0.6843f, 0.6926f,
- 1.0000f, 0.9614f, 0.9194f, 0.8723f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9473f, 0.9515f, 0.9625f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7322f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9126f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 1.0000f, 0.9999f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f, 0.9988f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9966f, 0.9991f, 0.9978f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9962f, 0.9999f, 0.9579f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9900f, 0.8789f, 0.7088f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9805f, 0.8620f, 0.9026f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8822f, 0.8655f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8166f, 0.9943f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9960f, 0.9997f, 0.9989f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9970f, 0.9999f, 0.9834f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9215f, 0.5589f, 0.9528f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8756f, 0.7604f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4861f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7467f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_4x6[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7443f, 0.8512f,
- 1.0000f, 1.0000f, 1.0000f, 0.8929f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7596f, 0.8882f,
- 1.0000f, 1.0000f, 0.8221f, 0.9144f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7051f, 0.6993f,
- 1.0000f, 1.0000f, 0.8355f, 0.9440f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7830f, 0.7737f, 0.7389f,
- 1.0000f, 1.0000f, 0.7918f, 0.8542f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2729f, 0.4793f, 0.1616f,
- 1.0000f, 0.8322f, 0.8760f, 0.8995f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4122f, 0.2349f, 0.0000f,
- 1.0000f, 1.0000f, 0.6930f, 0.7495f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7225f, 0.5849f, 0.3642f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9695f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9526f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9550f, 0.9840f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9654f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9824f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9036f, 0.9718f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9414f, 0.9800f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8600f, 0.9466f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8859f, 0.8735f, 0.8451f,
- 1.0000f, 0.9271f, 0.9605f, 0.9733f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9177f, 0.9626f, 0.9401f,
- 1.0000f, 0.9711f, 0.9893f, 0.8255f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9209f, 0.9616f, 0.6804f,
- 1.0000f, 0.9584f, 0.9635f, 0.9110f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5268f, 0.4632f, 0.8387f,
- 1.0000f, 0.9161f, 0.9316f, 0.7167f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5749f, 0.6867f, 0.8973f,
- 1.0000f, 0.7784f, 0.6674f, 0.8115f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0882f, 0.5113f, 1.0000f,
- 1.0000f, 0.6455f, 0.8040f, 0.8628f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3374f, 1.0000f, 1.0000f,
- 1.0000f, 0.3093f, 0.5529f, 0.8289f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3896f, 0.8811f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9962f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9998f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9933f, 0.9992f, 0.9988f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9982f, 0.9997f, 0.9830f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9970f, 0.9913f, 0.9538f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f, 0.9871f, 0.9645f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9948f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9995f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 0.9991f, 0.9921f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9991f, 0.9514f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9761f, 0.9909f, 0.9851f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9490f, 0.9755f, 0.8835f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9286f, 0.7110f, 0.8187f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8951f, 0.9193f, 0.8077f,
- 1.0000f, 1.0000f, 0.9679f, 0.9917f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9794f, 0.9703f, 0.9453f,
- 1.0000f, 0.9906f, 0.9941f, 0.9856f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9812f, 0.9561f, 0.7876f,
- 1.0000f, 0.9866f, 0.9748f, 0.9127f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9687f, 0.7335f, 0.9478f,
- 1.0000f, 0.9898f, 0.9387f, 0.7280f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9074f, 0.6294f, 1.0000f,
- 1.0000f, 0.9671f, 0.8419f, 0.5944f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9256f, 0.9960f, 1.0000f,
- 1.0000f, 0.9502f, 0.6039f, 0.9985f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6607f, 1.0000f, 1.0000f,
- 1.0000f, 0.9775f, 0.6127f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8656f, 0.9225f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9989f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f, 0.9975f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9845f, 0.9946f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9958f, 0.9966f, 0.9955f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9861f, 0.9768f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9740f, 0.9835f, 0.9330f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9938f, 0.9980f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9951f, 0.9986f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9943f, 0.9902f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9924f, 0.9880f, 0.9781f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9889f, 0.9301f, 0.8906f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9787f, 0.9055f, 0.4955f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9806f, 0.8000f, 0.4303f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9015f, 0.6211f, 0.5645f,
- 1.0000f, 0.9663f, 0.9240f, 0.8709f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8151f, 1.0000f, 1.0000f,
- 1.0000f, 0.9573f, 0.9595f, 0.9726f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9359f, 1.0000f, 1.0000f,
- 1.0000f, 0.7644f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9344f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 1.0000f, 0.9998f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 1.0000f, 0.9987f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9953f, 0.9983f, 0.9972f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9935f, 0.9997f, 0.9373f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9885f, 0.8683f, 0.6534f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9818f, 0.8571f, 0.8786f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7960f, 0.7546f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6376f, 0.9930f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9974f, 0.9999f, 0.9995f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9927f, 0.9999f, 0.9875f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9092f, 0.5405f, 0.9427f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8482f, 0.6740f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4469f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7691f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_4x8[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6540f, 0.8090f, 1.0000f, 1.0000f, 0.9047f, 0.9767f,
- 1.0000f, 1.0000f, 1.0000f, 0.9273f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6869f, 0.8003f, 0.8742f, 1.0000f, 1.0000f, 0.9569f, 0.9887f,
- 1.0000f, 1.0000f, 0.8833f, 0.9454f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7850f, 0.6687f, 0.3938f, 1.0000f, 1.0000f, 0.8390f, 0.8033f,
- 1.0000f, 1.0000f, 0.8724f, 0.9732f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6489f, 0.6254f, 0.2363f, 1.0000f, 0.8524f, 0.8851f, 0.8117f,
- 1.0000f, 1.0000f, 0.8481f, 0.9106f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1043f, 0.1756f, 0.1402f, 1.0000f, 0.8647f, 0.7274f, 0.3414f,
- 1.0000f, 0.9000f, 0.9174f, 0.9444f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3601f, 0.0000f, 0.4370f, 1.0000f, 0.7036f, 0.6435f, 0.2612f,
- 1.0000f, 1.0000f, 0.8143f, 0.8586f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8195f, 0.7196f, 0.5069f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9120f, 0.9463f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8920f, 0.9544f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7626f, 0.7881f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7524f, 0.8413f, 0.3226f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8220f, 0.4960f, 0.0657f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5448f, 0.2826f, 0.2081f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9846f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9693f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9673f, 0.9927f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9858f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9921f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9435f, 0.9866f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9738f, 0.9915f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9200f, 0.9750f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9134f, 0.9308f, 0.8903f,
- 1.0000f, 0.9405f, 0.9645f, 0.9687f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8606f, 0.7077f, 0.7420f, 1.0000f, 0.9825f, 0.9880f, 0.9761f,
- 1.0000f, 0.9834f, 0.9829f, 0.7943f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7593f, 0.7757f, 0.7724f, 1.0000f, 0.9608f, 0.9800f, 0.8436f,
- 1.0000f, 0.9600f, 0.9615f, 0.9319f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3037f, 0.8869f, 1.0000f, 1.0000f, 0.5767f, 0.7455f, 0.9577f,
- 1.0000f, 0.9212f, 0.9363f, 0.6953f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5917f, 1.0000f, 1.0000f, 1.0000f, 0.7311f, 0.8761f, 0.9331f,
- 1.0000f, 0.8295f, 0.6995f, 0.8815f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4085f, 0.8545f, 1.0000f,
- 1.0000f, 0.6911f, 0.8686f, 0.9062f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6734f, 1.0000f, 1.0000f,
- 1.0000f, 0.4502f, 0.7157f, 0.9092f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5613f, 0.9491f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8319f, 0.9016f, 0.9160f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9630f, 0.8503f, 0.8459f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4628f, 0.7912f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6124f, 0.8969f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5172f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9997f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9976f, 0.9997f, 0.9981f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f, 0.9999f, 0.9638f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9974f, 0.9913f, 0.9285f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9854f, 0.9719f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9997f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9995f, 0.9901f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9986f, 0.9395f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9795f, 0.9904f, 0.9850f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9473f, 0.9784f, 0.8627f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9623f, 0.7692f, 0.8705f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9385f, 0.9592f, 0.8367f,
- 1.0000f, 1.0000f, 0.9773f, 0.9930f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9518f, 0.9225f, 0.8062f, 1.0000f, 0.9907f, 0.9552f, 0.9261f,
- 1.0000f, 0.9968f, 0.9944f, 0.9891f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9561f, 0.8343f, 0.9999f, 1.0000f, 0.9805f, 0.9509f, 0.6058f,
- 1.0000f, 0.9961f, 0.9877f, 0.9535f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9425f, 0.9910f, 1.0000f, 1.0000f, 0.9526f, 0.6190f, 0.8270f,
- 1.0000f, 0.9942f, 0.9744f, 0.8245f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7559f, 1.0000f, 1.0000f, 1.0000f, 0.8565f, 0.3782f, 1.0000f,
- 1.0000f, 0.9815f, 0.8886f, 0.7235f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8779f, 1.0000f, 1.0000f, 1.0000f, 0.9652f, 0.9949f, 1.0000f,
- 1.0000f, 0.9755f, 0.7384f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6639f, 1.0000f, 1.0000f,
- 1.0000f, 0.9838f, 0.6590f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9077f, 0.9147f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9810f, 0.9353f, 0.6826f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9584f, 0.8953f, 0.6379f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9342f, 0.5271f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7973f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9700f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9237f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9973f, 0.9983f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 0.9969f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9894f, 0.9951f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f, 0.9966f, 0.9955f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9869f, 0.9725f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9789f, 0.9873f, 0.9415f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9962f, 0.9992f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9939f, 0.9953f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f, 0.9980f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9946f, 0.9935f, 0.9884f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9957f, 0.9680f, 0.9249f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9862f, 0.9374f, 0.4852f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9820f, 0.8170f, 0.4740f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8985f, 0.6780f, 0.5691f,
- 1.0000f, 0.9659f, 0.9296f, 0.9031f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5843f, 1.0000f, 1.0000f,
- 1.0000f, 0.9482f, 0.9666f, 0.9842f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8797f, 1.0000f, 1.0000f,
- 1.0000f, 0.8666f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9713f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9998f, 0.9994f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 1.0000f, 0.9924f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9932f, 0.9990f, 0.9979f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9918f, 0.9999f, 0.9187f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9897f, 0.7788f, 0.5362f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9778f, 0.7819f, 0.7347f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7117f, 0.6317f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5530f, 0.9937f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9971f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9959f, 1.0000f, 0.9985f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9500f, 0.5989f, 0.9706f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8936f, 0.7490f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4231f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7659f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_4x10[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8566f, 0.9251f, 1.0000f, 1.0000f, 0.9271f, 0.9827f,
- 1.0000f, 1.0000f, 1.0000f, 0.9436f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8821f, 0.9344f, 0.9492f, 1.0000f, 1.0000f, 0.9428f, 0.9930f,
- 1.0000f, 1.0000f, 0.8766f, 0.9560f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8938f, 0.7784f, 0.3546f, 1.0000f, 1.0000f, 0.8646f, 0.8199f,
- 1.0000f, 1.0000f, 0.8737f, 0.9734f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7535f, 0.7283f, 0.2504f, 1.0000f, 0.8807f, 0.9012f, 0.8281f,
- 1.0000f, 1.0000f, 0.8874f, 0.9280f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7759f, 0.3657f, 0.2921f, 1.0000f, 0.8913f, 0.7955f, 0.3984f,
- 1.0000f, 0.9160f, 0.9412f, 0.9671f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6872f, 0.0745f, 0.6100f, 1.0000f, 0.7706f, 0.7381f, 0.3187f,
- 1.0000f, 1.0000f, 0.8301f, 0.8707f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8468f, 0.7733f, 0.5470f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8047f, 0.7932f, 1.0000f, 1.0000f, 0.9395f, 0.9712f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8358f, 0.8692f, 0.8320f, 1.0000f, 1.0000f, 0.9060f, 0.9627f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8024f, 0.6745f, 0.2645f, 1.0000f, 1.0000f, 0.8377f, 0.8630f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7250f, 0.2193f, 0.2008f, 1.0000f, 0.8220f, 0.8926f, 0.4195f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7112f, 0.1026f, 0.4946f, 1.0000f, 0.8598f, 0.6657f, 0.3055f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3767f, 0.1538f, 1.0000f, 1.0000f, 0.6913f, 0.4682f, 0.4591f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5926f, 0.7979f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5866f, 0.6366f, 0.6562f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6994f, 0.4296f, 0.1289f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6701f, 0.3312f, 0.3434f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0378f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1783f, 0.2350f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9921f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9784f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9831f, 0.9939f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9972f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9957f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9614f, 0.9924f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9884f, 0.9951f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9420f, 0.9815f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9387f, 0.9461f, 0.8661f,
- 1.0000f, 0.9567f, 0.9659f, 0.9652f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8834f, 0.8339f, 0.9000f, 1.0000f, 0.9857f, 0.9896f, 0.9760f,
- 1.0000f, 0.9901f, 0.9819f, 0.7622f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8135f, 0.9083f, 0.8900f, 1.0000f, 0.9594f, 0.9798f, 0.8002f,
- 1.0000f, 0.9677f, 0.9515f, 0.8861f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5178f, 0.8550f, 1.0000f, 1.0000f, 0.5985f, 0.7810f, 0.9500f,
- 1.0000f, 0.9105f, 0.9201f, 0.6788f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7316f, 1.0000f, 1.0000f, 1.0000f, 0.7650f, 0.8534f, 0.9469f,
- 1.0000f, 0.8485f, 0.7476f, 0.9036f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5025f, 0.9072f, 1.0000f,
- 1.0000f, 0.7678f, 0.8793f, 0.9221f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7594f, 1.0000f, 1.0000f,
- 1.0000f, 0.4772f, 0.7835f, 0.9191f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6044f, 0.9689f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6465f, 0.7034f, 0.9231f, 1.0000f, 0.8451f, 0.9308f, 0.9665f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7349f, 0.8241f, 0.9445f, 1.0000f, 0.9850f, 0.8976f, 0.9149f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6314f, 1.0000f, 1.0000f, 1.0000f, 0.6610f, 0.9261f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7860f, 0.9379f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7147f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5326f, 0.6155f, 0.9573f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5253f, 0.8582f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 0.9988f, 0.9974f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9998f, 0.9530f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9990f, 0.9839f, 0.8722f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9986f, 0.9770f, 0.9353f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9999f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9991f, 0.9890f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9993f, 0.9139f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9854f, 0.9919f, 0.9878f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9545f, 0.9846f, 0.8677f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9640f, 0.7446f, 0.8501f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9241f, 0.9476f, 0.8432f,
- 1.0000f, 1.0000f, 0.9779f, 0.9978f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9587f, 0.8887f, 0.6209f, 1.0000f, 0.9871f, 0.9553f, 0.9317f,
- 1.0000f, 0.9946f, 0.9959f, 0.9928f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9181f, 0.6830f, 0.9999f, 1.0000f, 0.9750f, 0.9335f, 0.5610f,
- 1.0000f, 0.9960f, 0.9916f, 0.9707f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9048f, 0.9484f, 1.0000f, 1.0000f, 0.9507f, 0.6415f, 0.7506f,
- 1.0000f, 0.9914f, 0.9739f, 0.8614f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5398f, 1.0000f, 1.0000f, 1.0000f, 0.8517f, 0.2785f, 1.0000f,
- 1.0000f, 0.9835f, 0.9299f, 0.8069f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9601f, 1.0000f, 1.0000f, 1.0000f, 0.9684f, 0.9926f, 1.0000f,
- 1.0000f, 0.9864f, 0.8414f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7414f, 1.0000f, 1.0000f,
- 1.0000f, 0.9806f, 0.7565f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9289f, 0.9362f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9646f, 0.8156f, 0.9811f, 1.0000f, 0.9843f, 0.9128f, 0.7181f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9211f, 0.6953f, 1.0000f, 1.0000f, 0.9453f, 0.9094f, 0.5542f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9326f, 1.0000f, 1.0000f, 1.0000f, 0.9701f, 0.4859f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7216f, 1.0000f, 1.0000f, 1.0000f, 0.7884f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9789f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8848f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9580f, 0.8752f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9370f, 0.9620f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9765f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9904f, 0.9985f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9948f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9969f, 0.9935f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9887f, 0.9981f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 0.9977f, 0.9962f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9723f, 0.9793f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9744f, 0.9874f, 0.8964f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9950f, 0.9983f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f, 0.9971f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9976f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9933f, 0.9937f, 0.9941f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9909f, 0.9718f, 0.9523f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9881f, 0.9607f, 0.5805f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9868f, 0.8396f, 0.4496f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8780f, 0.7073f, 0.5743f,
- 1.0000f, 0.9729f, 0.9404f, 0.9117f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4398f, 1.0000f, 1.0000f,
- 1.0000f, 0.9695f, 0.9633f, 0.9893f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7908f, 1.0000f, 1.0000f,
- 1.0000f, 0.8951f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9823f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9966f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9997f, 0.9989f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 1.0000f, 0.9906f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9861f, 0.9984f, 0.9955f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9899f, 0.9999f, 0.9024f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9943f, 0.8113f, 0.5679f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9775f, 0.8261f, 0.8091f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6262f, 0.4091f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3877f, 0.9802f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9953f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9911f, 1.0000f, 0.9982f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9538f, 0.6514f, 0.9755f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9171f, 0.8178f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5103f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8988f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_4x12[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8570f, 0.9351f, 1.0000f, 1.0000f, 0.9461f, 0.9884f,
- 1.0000f, 1.0000f, 1.0000f, 0.9476f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8944f, 0.9376f, 0.9581f, 1.0000f, 1.0000f, 0.9811f, 0.9855f,
- 1.0000f, 1.0000f, 0.8777f, 0.9658f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9121f, 0.8362f, 0.4335f, 1.0000f, 1.0000f, 0.8910f, 0.8445f,
- 1.0000f, 1.0000f, 0.9001f, 0.9751f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7894f, 0.7758f, 0.3577f, 1.0000f, 0.9024f, 0.9256f, 0.8509f,
- 1.0000f, 1.0000f, 0.9301f, 0.9384f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7873f, 0.5440f, 0.4410f, 1.0000f, 0.9013f, 0.8413f, 0.4701f,
- 1.0000f, 0.9468f, 0.9618f, 0.9630f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7346f, 0.1421f, 0.7373f, 1.0000f, 0.8184f, 0.8105f, 0.3846f,
- 1.0000f, 1.0000f, 0.8656f, 0.9141f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8886f, 0.8002f, 0.6091f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5378f, 1.0000f, 1.0000f, 1.0000f, 0.6809f, 1.0000f, 0.8396f, 0.8125f, 0.5731f, 1.0000f, 0.9438f, 0.9669f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6042f, 1.0000f, 1.0000f, 1.0000f, 0.6916f, 0.8311f, 0.8752f, 0.8585f, 0.3390f, 1.0000f, 0.9247f, 0.9600f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6616f, 1.0000f, 1.0000f, 1.0000f, 0.1980f, 0.8165f, 0.7143f, 0.3757f, 0.6363f, 1.0000f, 0.8294f, 0.8477f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4913f, 1.0000f, 1.0000f, 1.0000f, 0.1094f, 0.7507f, 0.2782f, 0.2886f, 1.0000f, 0.8222f, 0.8898f, 0.3091f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0310f, 1.0000f, 1.0000f, 1.0000f, 0.5560f, 0.7686f, 0.1850f, 0.6319f, 1.0000f, 0.9191f, 0.7050f, 0.2461f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5675f, 0.2231f, 1.0000f, 1.0000f, 0.6985f, 0.4180f, 0.4557f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8145f, 0.8826f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8023f, 0.7710f, 0.6274f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8328f, 0.5182f, 0.1259f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7290f, 0.2349f, 0.4100f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6951f, 0.0862f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3292f, 0.4773f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9896f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9874f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9865f, 0.9955f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7113f, 0.7782f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7981f, 0.8493f, 0.4484f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7082f, 0.2106f, 0.2571f, 1.0000f, 1.0000f, 1.0000f, 0.9963f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6183f, 0.0618f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9972f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4259f, 0.1570f, 1.0000f, 1.0000f, 1.0000f, 0.9717f, 0.9958f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1715f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9922f, 0.9966f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9391f, 0.9848f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9574f, 0.9675f, 0.8990f,
- 1.0000f, 0.9841f, 0.9587f, 0.9624f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9034f, 0.8540f, 0.9309f, 1.0000f, 0.9732f, 0.9837f, 0.9686f,
- 1.0000f, 0.9912f, 0.9827f, 0.7481f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8276f, 0.9399f, 0.8790f, 1.0000f, 0.9343f, 0.9760f, 0.7612f,
- 1.0000f, 0.9746f, 0.9612f, 0.8967f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6406f, 0.8863f, 1.0000f, 1.0000f, 0.6138f, 0.8065f, 0.9265f,
- 1.0000f, 0.9359f, 0.9292f, 0.6733f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7938f, 1.0000f, 1.0000f, 1.0000f, 0.7637f, 0.8599f, 0.9680f,
- 1.0000f, 0.8670f, 0.7232f, 0.8979f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5945f, 0.9483f, 1.0000f,
- 1.0000f, 0.7661f, 0.8738f, 0.9423f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8345f, 1.0000f, 1.0000f,
- 1.0000f, 0.4981f, 0.8429f, 0.9533f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6695f, 0.9795f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4017f, 1.0000f, 1.0000f, 1.0000f, 0.9707f, 0.6880f, 0.7828f, 0.9519f, 1.0000f, 0.8203f, 0.9162f, 0.9505f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6229f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8044f, 0.8851f, 0.9727f, 1.0000f, 0.9770f, 0.8628f, 0.8711f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6656f, 1.0000f, 1.0000f, 1.0000f, 0.5842f, 0.9099f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7734f, 0.9078f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7401f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5116f, 0.7916f, 0.9498f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6492f, 0.9741f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9999f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9971f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9996f, 0.9948f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9989f, 0.9219f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9756f, 0.8524f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f, 0.9653f, 0.9446f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5617f, 0.8697f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7261f, 0.9702f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9999f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9983f, 0.9994f, 0.9917f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9986f, 0.9238f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9799f, 0.9920f, 0.9851f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9554f, 0.9787f, 0.8555f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9696f, 0.7805f, 0.8614f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9318f, 0.9540f, 0.8933f,
- 1.0000f, 1.0000f, 0.9815f, 0.9981f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9326f, 0.8764f, 0.5894f, 1.0000f, 0.9915f, 0.9407f, 0.9200f,
- 1.0000f, 0.9940f, 0.9982f, 0.9946f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9152f, 0.6449f, 1.0000f, 1.0000f, 0.9722f, 0.9526f, 0.5249f,
- 1.0000f, 0.9960f, 0.9893f, 0.9774f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8956f, 0.9210f, 1.0000f, 1.0000f, 0.9647f, 0.6845f, 0.7586f,
- 1.0000f, 0.9951f, 0.9868f, 0.8874f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4843f, 1.0000f, 1.0000f, 1.0000f, 0.8724f, 0.2989f, 1.0000f,
- 1.0000f, 0.9877f, 0.9453f, 0.8258f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9593f, 1.0000f, 1.0000f, 1.0000f, 0.9779f, 0.9931f, 1.0000f,
- 1.0000f, 0.9834f, 0.8814f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7850f, 1.0000f, 1.0000f,
- 1.0000f, 0.9858f, 0.8240f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9512f, 0.9791f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9664f, 1.0000f, 1.0000f, 1.0000f, 0.9942f, 0.9547f, 0.8085f, 0.9335f, 1.0000f, 0.9823f, 0.8802f, 0.6575f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9283f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9067f, 0.5502f, 1.0000f, 1.0000f, 0.9088f, 0.8642f, 0.3484f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9228f, 1.0000f, 1.0000f, 1.0000f, 0.9415f, 0.3668f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5994f, 1.0000f, 1.0000f, 1.0000f, 0.7560f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9636f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8461f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9561f, 0.7018f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8921f, 0.9171f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9368f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9969f, 0.9991f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9808f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9927f, 0.9962f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9887f, 0.9933f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9929f, 0.9956f, 0.9975f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9898f, 0.9804f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9890f, 0.9925f, 0.9274f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9131f, 0.7534f, 1.0000f, 1.0000f, 1.0000f, 0.9976f, 0.9987f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9110f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9990f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9965f, 0.9980f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9949f, 0.9936f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f, 0.9737f, 0.9567f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9830f, 0.9641f, 0.5787f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9844f, 0.8379f, 0.5048f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8839f, 0.7455f, 0.6771f,
- 1.0000f, 0.9819f, 0.9430f, 0.9181f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2677f, 1.0000f, 1.0000f,
- 1.0000f, 0.9712f, 0.9691f, 0.9880f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7202f, 1.0000f, 1.0000f,
- 1.0000f, 0.9490f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9974f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9938f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9998f, 0.9995f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 1.0000f, 0.9904f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9907f, 0.9992f, 0.9944f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9861f, 0.9998f, 0.9056f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9909f, 0.7959f, 0.4630f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9765f, 0.7173f, 0.7318f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6533f, 0.3193f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3931f, 0.9783f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9953f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 1.0000f, 0.9992f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9871f, 0.7428f, 0.9901f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9606f, 0.9045f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5315f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8683f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_5x4[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9496f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8709f, 0.9575f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9171f, 0.9748f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7120f, 0.8199f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7195f, 0.8475f, 0.8778f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.8093f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7545f, 0.8939f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7609f, 0.8637f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8146f, 0.7796f, 0.7858f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.4100f, 0.4583f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3782f, 0.3366f, 0.1850f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9259f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9468f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9789f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8600f, 0.9338f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8996f, 0.9424f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9871f, 0.9983f, 0.9979f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9960f, 0.9996f, 0.9853f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9691f, 0.9797f, 0.9711f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9375f, 0.9680f, 0.8560f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7043f, 0.5964f, 0.6432f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6090f, 0.6709f, 0.7735f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9279f, 0.9550f, 0.8744f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9701f, 0.9537f, 0.8386f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8879f, 0.5694f, 0.6328f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8247f, 0.8295f, 0.6886f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.0000f, 0.2712f, 0.5397f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.0963f, 0.5833f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9937f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9990f, 0.9997f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9440f, 0.9832f, 0.9914f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9756f, 0.9930f, 0.9075f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9933f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9998f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9970f, 0.9993f, 0.9943f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9995f, 0.9612f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9563f, 0.9781f, 0.9482f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9509f, 0.9600f, 0.7919f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9846f, 0.9901f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9955f, 0.9949f, 0.9922f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9891f, 0.9319f, 0.8673f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9773f, 0.8910f, 0.4347f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9635f, 0.8035f, 0.5226f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9148f, 0.5045f, 0.9972f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9839f, 0.9624f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9647f, 0.9818f, 0.8812f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9739f, 0.8431f, 0.6214f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9409f, 0.6619f, 0.6966f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9523f, 0.6526f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7410f, 0.9658f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 0.9977f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f, 0.9982f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9720f, 0.9905f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9940f, 0.9876f, 0.9910f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9966f, 0.9987f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f, 0.9992f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9918f, 0.9896f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9865f, 0.9881f, 0.9811f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9886f, 0.9669f, 0.9238f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9804f, 0.9392f, 0.6799f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9926f, 0.9100f, 0.7478f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9825f, 0.9023f, 0.9216f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4818f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7267f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8518f, 0.8968f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8341f, 0.9952f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9999f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f, 0.9980f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9957f, 0.9991f, 0.9974f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9946f, 0.9995f, 0.9588f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9859f, 0.9049f, 0.7977f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9765f, 0.9299f, 0.9357f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9962f, 0.9994f, 0.9986f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f, 0.9999f, 0.9730f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9124f, 0.5547f, 0.9454f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8846f, 0.7672f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7339f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9194f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_5x5[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9673f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8974f, 0.9705f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9498f, 0.9880f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7791f, 0.9035f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8333f, 0.9204f, 0.9408f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.6652f, 0.7473f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6369f, 0.6289f, 0.4604f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.7754f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.6903f, 0.8953f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7639f, 0.8932f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8120f, 0.8089f, 0.7862f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.6844f, 0.7250f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6955f, 0.6206f, 0.3520f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.2657f, 0.4988f, 0.1727f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5175f, 0.1199f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9727f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8910f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9055f, 0.9093f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9665f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9861f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9131f, 0.9740f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9510f, 0.9875f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8027f, 0.9112f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8448f, 0.8392f, 0.8528f,
- 1.0000f, 0.9910f, 0.9977f, 0.9974f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9976f, 0.9998f, 0.9802f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9772f, 0.9892f, 0.9845f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9568f, 0.9747f, 0.8704f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7678f, 0.7431f, 0.8728f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6783f, 0.8888f, 0.8421f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3271f, 0.5343f, 0.8182f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3750f, 0.8502f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9168f, 0.9522f, 0.8304f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9713f, 0.9448f, 0.7598f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9290f, 0.6512f, 0.7056f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8798f, 0.8630f, 0.7515f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3020f, 0.6100f, 0.8243f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4798f, 0.8866f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.2212f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4198f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9967f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9992f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9934f, 0.9986f, 0.9991f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9981f, 0.9997f, 0.9813f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9435f, 0.9657f, 0.9186f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9835f, 0.9734f, 0.8752f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9965f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9993f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9990f, 0.9931f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9996f, 0.9600f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9766f, 0.9900f, 0.9870f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9620f, 0.9790f, 0.8680f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9557f, 0.7202f, 0.7298f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9274f, 0.9150f, 0.7556f,
- 1.0000f, 1.0000f, 0.9830f, 0.9888f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9951f, 0.9955f, 0.9953f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9913f, 0.9590f, 0.9222f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9796f, 0.9257f, 0.5728f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9630f, 0.7006f, 0.3980f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8775f, 0.4409f, 0.9903f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9697f, 0.6582f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8058f, 0.9074f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9784f, 0.9681f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9461f, 0.9778f, 0.8605f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9856f, 0.8995f, 0.7344f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9648f, 0.7717f, 0.8475f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9689f, 0.6442f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7962f, 0.9336f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9421f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8151f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f, 0.9990f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9971f, 0.9984f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9865f, 0.9969f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9962f, 0.9946f, 0.9958f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9760f, 0.9819f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9610f, 0.9840f, 0.9546f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9973f, 0.9995f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9987f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9906f, 0.9936f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9928f, 0.9919f, 0.9851f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9896f, 0.9579f, 0.9239f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9753f, 0.9305f, 0.5978f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9808f, 0.9015f, 0.7154f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9639f, 0.8213f, 0.7929f,
- 1.0000f, 0.9922f, 0.9395f, 0.7388f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9925f, 0.9321f, 0.9534f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5473f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7995f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8363f, 0.9351f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8274f, 0.9983f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9996f, 0.9999f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9982f, 1.0000f, 0.9916f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9941f, 0.9995f, 0.9989f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9944f, 0.9999f, 0.9486f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9884f, 0.8554f, 0.6717f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9824f, 0.8655f, 0.9366f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8844f, 0.8580f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7828f, 0.9960f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9939f, 0.9997f, 0.9978f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9949f, 0.9994f, 0.9720f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9381f, 0.5602f, 0.9473f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8821f, 0.7105f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5854f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7896f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_5x6[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7676f, 0.8675f,
- 1.0000f, 1.0000f, 1.0000f, 0.9864f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7053f, 0.9024f,
- 1.0000f, 1.0000f, 0.9386f, 0.9764f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7801f, 0.7480f,
- 1.0000f, 1.0000f, 0.9611f, 0.9896f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8218f, 0.8480f, 0.8548f,
- 1.0000f, 1.0000f, 0.8503f, 0.9257f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8005f, 0.6960f, 0.3353f,
- 1.0000f, 0.8947f, 0.9459f, 0.9561f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6706f, 0.6054f, 0.2768f,
- 1.0000f, 1.0000f, 0.7892f, 0.8033f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2041f, 0.1229f, 0.0000f,
- 1.0000f, 0.7546f, 0.6863f, 0.4459f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3735f, 0.1652f, 0.2428f,
- 1.0000f, 1.0000f, 1.0000f, 0.8695f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8914f, 0.9111f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8267f, 0.9097f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8613f, 0.8655f, 0.8194f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7412f, 0.8060f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7739f, 0.6811f, 0.4847f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7978f, 0.6426f, 0.3562f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6252f, 0.4722f, 0.0797f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9822f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9675f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9641f, 0.9852f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9826f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9889f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9352f, 0.9793f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9648f, 0.9912f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8994f, 0.9701f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9083f, 0.9192f, 0.8846f,
- 1.0000f, 0.9938f, 0.9983f, 0.9985f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9232f, 0.9570f, 0.9270f,
- 1.0000f, 0.9993f, 0.9999f, 0.9808f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9219f, 0.9543f, 0.6541f,
- 1.0000f, 0.9753f, 0.9879f, 0.9779f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6188f, 0.5981f, 0.9069f,
- 1.0000f, 0.9449f, 0.9689f, 0.8593f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7008f, 0.7950f, 0.9340f,
- 1.0000f, 0.8292f, 0.8315f, 0.9166f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3094f, 0.7513f, 1.0000f,
- 1.0000f, 0.7303f, 0.9293f, 0.8880f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5724f, 1.0000f, 1.0000f,
- 1.0000f, 0.4322f, 0.7265f, 0.8387f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5815f, 0.9363f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9054f, 0.9516f, 0.8115f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9774f, 0.9329f, 0.7377f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9305f, 0.6369f, 0.7226f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8734f, 0.8457f, 0.7645f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4184f, 0.6759f, 0.8897f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5631f, 0.9375f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4043f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6122f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9973f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9997f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9961f, 0.9991f, 0.9981f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9999f, 0.9798f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9974f, 0.9918f, 0.9469f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9886f, 0.9655f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9996f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 0.9993f, 0.9926f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9995f, 0.9430f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9844f, 0.9934f, 0.9883f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9595f, 0.9860f, 0.8930f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9626f, 0.7580f, 0.8715f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9419f, 0.9587f, 0.8754f,
- 1.0000f, 1.0000f, 0.9736f, 0.9956f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9784f, 0.9669f, 0.9552f,
- 1.0000f, 0.9945f, 0.9948f, 0.9976f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9682f, 0.9478f, 0.7832f,
- 1.0000f, 0.9921f, 0.9603f, 0.9039f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9742f, 0.8434f, 0.9695f,
- 1.0000f, 0.9789f, 0.9282f, 0.5534f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9440f, 0.7141f, 1.0000f,
- 1.0000f, 0.9634f, 0.7446f, 0.3889f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9497f, 0.9903f, 1.0000f,
- 1.0000f, 0.8828f, 0.4971f, 0.9909f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6912f, 1.0000f, 1.0000f,
- 1.0000f, 0.9507f, 0.4594f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8978f, 1.0000f, 1.0000f,
- 1.0000f, 0.7708f, 0.7612f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9963f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9835f, 0.9725f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9534f, 0.9813f, 0.8863f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9747f, 0.9152f, 0.7862f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9731f, 0.8243f, 0.8634f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9719f, 0.7097f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8772f, 0.9179f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9713f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8142f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9990f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9978f, 0.9980f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9970f, 0.9959f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9831f, 0.9943f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9971f, 0.9929f, 0.9964f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9803f, 0.9868f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9817f, 0.9946f, 0.9408f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9958f, 0.9986f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9966f, 0.9967f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9931f, 0.9952f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9924f, 0.9875f, 0.9769f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9893f, 0.9525f, 0.9206f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9707f, 0.9245f, 0.5433f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9839f, 0.8571f, 0.5900f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9317f, 0.7185f, 0.6652f,
- 1.0000f, 0.9941f, 0.9488f, 0.7922f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8363f, 1.0000f, 1.0000f,
- 1.0000f, 0.9900f, 0.9578f, 0.9662f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9618f, 1.0000f, 1.0000f,
- 1.0000f, 0.5093f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8410f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8339f, 0.9397f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8526f, 0.9975f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9998f, 0.9979f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9982f, 1.0000f, 0.9872f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9906f, 0.9989f, 0.9954f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9848f, 0.9999f, 0.9139f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9915f, 0.8791f, 0.6311f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9856f, 0.8810f, 0.8963f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7770f, 0.7341f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6597f, 0.9984f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9950f, 0.9997f, 0.9994f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9936f, 1.0000f, 0.9758f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9009f, 0.5208f, 0.9125f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8168f, 0.6484f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5321f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8087f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_5x8[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7170f, 0.8180f, 1.0000f, 1.0000f, 0.9306f, 0.9785f,
- 1.0000f, 1.0000f, 1.0000f, 0.9950f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6965f, 0.8011f, 0.8628f, 1.0000f, 1.0000f, 0.9641f, 0.9929f,
- 1.0000f, 1.0000f, 0.9698f, 0.9907f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8033f, 0.7695f, 0.5461f, 1.0000f, 1.0000f, 0.8906f, 0.8389f,
- 1.0000f, 1.0000f, 0.9849f, 0.9943f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7269f, 0.7332f, 0.3842f, 1.0000f, 0.9127f, 0.9202f, 0.8794f,
- 1.0000f, 1.0000f, 0.9070f, 0.9559f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7034f, 0.3723f, 0.2234f, 1.0000f, 0.8946f, 0.7922f, 0.3594f,
- 1.0000f, 0.9242f, 0.9635f, 0.9682f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6392f, 0.0795f, 0.6486f, 1.0000f, 0.7642f, 0.7103f, 0.3052f,
- 1.0000f, 1.0000f, 0.8823f, 0.8660f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0406f, 0.0000f, 1.0000f, 1.0000f, 0.7898f, 0.3960f, 0.1575f,
- 1.0000f, 0.8530f, 0.7721f, 0.5161f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1334f, 0.2435f, 1.0000f, 1.0000f, 0.7069f, 0.3461f, 0.4915f,
- 1.0000f, 1.0000f, 1.0000f, 0.9138f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9288f, 0.9617f,
- 1.0000f, 1.0000f, 0.9366f, 0.9407f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9160f, 0.9468f,
- 1.0000f, 1.0000f, 0.8933f, 0.9340f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8139f, 0.8408f,
- 1.0000f, 0.9212f, 0.9105f, 0.8580f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8352f, 0.8809f, 0.4176f,
- 1.0000f, 1.0000f, 0.8220f, 0.8893f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8780f, 0.5863f, 0.1090f,
- 1.0000f, 0.8426f, 0.7589f, 0.5668f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6343f, 0.3327f, 0.2762f,
- 1.0000f, 0.8720f, 0.7451f, 0.5388f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6818f, 0.2028f, 0.2913f,
- 1.0000f, 0.7507f, 0.6293f, 0.2599f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4473f, 0.1808f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9896f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9781f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9823f, 0.9956f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9937f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9954f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9579f, 0.9919f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9838f, 0.9931f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9391f, 0.9827f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9374f, 0.9518f, 0.9034f,
- 1.0000f, 0.9982f, 0.9996f, 0.9986f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8612f, 0.7136f, 0.7301f, 1.0000f, 0.9801f, 0.9909f, 0.9734f,
- 1.0000f, 0.9995f, 0.9993f, 0.9789f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7669f, 0.7422f, 0.7773f, 1.0000f, 0.9664f, 0.9820f, 0.8240f,
- 1.0000f, 0.9769f, 0.9901f, 0.9773f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4378f, 0.9438f, 1.0000f, 1.0000f, 0.6531f, 0.8119f, 0.9692f,
- 1.0000f, 0.9460f, 0.9793f, 0.8750f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6780f, 1.0000f, 1.0000f, 1.0000f, 0.8054f, 0.9116f, 0.9629f,
- 1.0000f, 0.8596f, 0.8201f, 0.9399f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5237f, 0.8644f, 1.0000f,
- 1.0000f, 0.7824f, 0.9357f, 0.9022f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7534f, 1.0000f, 1.0000f,
- 1.0000f, 0.4659f, 0.8496f, 0.8997f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6741f, 0.9747f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8972f, 0.9423f, 0.7945f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8334f, 0.9171f, 0.9222f,
- 1.0000f, 0.9805f, 0.9182f, 0.6930f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9687f, 0.8735f, 0.8563f,
- 1.0000f, 0.9415f, 0.6702f, 0.7850f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5799f, 0.8444f, 1.0000f,
- 1.0000f, 0.8879f, 0.8461f, 0.8160f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7000f, 0.9383f, 1.0000f,
- 1.0000f, 0.4831f, 0.7799f, 0.9315f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5602f, 1.0000f, 1.0000f,
- 1.0000f, 0.6191f, 0.9572f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6242f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7967f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9998f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9988f, 0.9972f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9997f, 0.9539f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9890f, 0.9192f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9983f, 0.9869f, 0.9724f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9998f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9995f, 0.9914f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9987f, 0.9232f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9835f, 0.9933f, 0.9893f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9511f, 0.9812f, 0.8705f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9708f, 0.8076f, 0.9081f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9532f, 0.9703f, 0.8690f,
- 1.0000f, 1.0000f, 0.9884f, 0.9991f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9445f, 0.9332f, 0.8297f, 1.0000f, 0.9856f, 0.9760f, 0.9605f,
- 1.0000f, 0.9981f, 0.9959f, 0.9989f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9623f, 0.8278f, 0.9999f, 1.0000f, 0.9872f, 0.9552f, 0.6660f,
- 1.0000f, 0.9979f, 0.9899f, 0.9525f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9676f, 0.9922f, 1.0000f, 1.0000f, 0.9598f, 0.6894f, 0.8513f,
- 1.0000f, 0.9912f, 0.9430f, 0.6139f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8546f, 1.0000f, 1.0000f, 1.0000f, 0.8985f, 0.4070f, 1.0000f,
- 1.0000f, 0.9752f, 0.8259f, 0.4566f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9475f, 1.0000f, 1.0000f, 1.0000f, 0.9058f, 0.9453f, 1.0000f,
- 1.0000f, 0.8919f, 0.5734f, 0.9973f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4998f, 1.0000f, 1.0000f,
- 1.0000f, 0.9566f, 0.4281f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9504f, 1.0000f, 1.0000f,
- 1.0000f, 0.8098f, 0.6575f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9939f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9887f, 0.9756f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9875f, 0.9647f, 0.7479f,
- 1.0000f, 0.9653f, 0.9842f, 0.8959f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9670f, 0.9270f, 0.7203f,
- 1.0000f, 0.9878f, 0.9483f, 0.8865f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9545f, 0.5978f, 1.0000f,
- 1.0000f, 0.9765f, 0.9046f, 0.9490f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8479f, 1.0000f, 1.0000f,
- 1.0000f, 0.9777f, 0.7875f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9093f, 1.0000f, 1.0000f,
- 1.0000f, 0.9279f, 0.9585f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7362f, 1.0000f, 1.0000f,
- 1.0000f, 0.9743f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8315f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9978f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9945f, 0.9980f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9948f, 0.9969f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9852f, 0.9926f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9962f, 0.9960f, 0.9963f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9816f, 0.9845f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9831f, 0.9882f, 0.9592f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9967f, 0.9996f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 0.9977f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9957f, 0.9946f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9971f, 0.9966f, 0.9924f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9951f, 0.9659f, 0.9297f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9714f, 0.9611f, 0.4745f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9862f, 0.8371f, 0.5080f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8851f, 0.7393f, 0.6035f,
- 1.0000f, 0.9976f, 0.9808f, 0.9149f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6439f, 1.0000f, 1.0000f,
- 1.0000f, 0.9965f, 0.9729f, 0.9917f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9251f, 1.0000f, 1.0000f,
- 1.0000f, 0.5922f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9349f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8837f, 0.9497f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8765f, 0.9992f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f, 0.9994f, 0.9990f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9953f, 1.0000f, 0.9738f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9797f, 0.9985f, 0.9935f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9904f, 0.9999f, 0.9010f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9866f, 0.7747f, 0.5533f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9719f, 0.7989f, 0.7562f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7616f, 0.6618f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6087f, 0.9975f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9970f, 1.0000f, 0.9998f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9941f, 0.9998f, 0.9859f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9261f, 0.5314f, 0.9323f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8675f, 0.6856f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3191f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7236f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_5x10[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8828f, 0.9380f, 1.0000f, 1.0000f, 0.9474f, 0.9876f,
- 1.0000f, 1.0000f, 1.0000f, 0.9969f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9001f, 0.9507f, 0.9435f, 1.0000f, 1.0000f, 0.9629f, 0.9920f,
- 1.0000f, 1.0000f, 0.9747f, 0.9932f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9144f, 0.8460f, 0.4607f, 1.0000f, 1.0000f, 0.8863f, 0.8325f,
- 1.0000f, 1.0000f, 0.9864f, 0.9957f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8000f, 0.7799f, 0.3655f, 1.0000f, 0.9060f, 0.9291f, 0.8517f,
- 1.0000f, 1.0000f, 0.9234f, 0.9619f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7902f, 0.3573f, 0.2754f, 1.0000f, 0.9172f, 0.8197f, 0.3042f,
- 1.0000f, 0.9550f, 0.9704f, 0.9787f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7244f, 0.0600f, 0.6069f, 1.0000f, 0.7961f, 0.7590f, 0.2856f,
- 1.0000f, 1.0000f, 0.8770f, 0.8851f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5834f, 0.1053f, 1.0000f, 1.0000f, 0.8246f, 0.4735f, 0.1961f,
- 1.0000f, 0.8503f, 0.7861f, 0.4860f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2949f, 0.5229f, 1.0000f, 1.0000f, 0.7710f, 0.3896f, 0.6023f,
- 1.0000f, 1.0000f, 1.0000f, 0.9275f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8614f, 0.8180f, 1.0000f, 1.0000f, 0.9461f, 0.9783f,
- 1.0000f, 1.0000f, 0.9358f, 0.9421f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8474f, 0.8885f, 0.8356f, 1.0000f, 1.0000f, 0.9298f, 0.9798f,
- 1.0000f, 1.0000f, 0.9126f, 0.9415f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8430f, 0.7410f, 0.3736f, 1.0000f, 1.0000f, 0.8719f, 0.8928f,
- 1.0000f, 0.9321f, 0.9098f, 0.8586f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7733f, 0.3401f, 0.2651f, 1.0000f, 0.8745f, 0.9217f, 0.4542f,
- 1.0000f, 1.0000f, 0.8654f, 0.9107f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7686f, 0.1264f, 0.5169f, 1.0000f, 0.9040f, 0.7056f, 0.2329f,
- 1.0000f, 0.8840f, 0.8074f, 0.6534f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5046f, 0.1459f, 1.0000f, 1.0000f, 0.7120f, 0.3314f, 0.5107f,
- 1.0000f, 0.8874f, 0.7841f, 0.5784f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4128f, 0.2091f, 1.0000f, 1.0000f, 0.7514f, 0.3225f, 0.5682f,
- 1.0000f, 0.7778f, 0.6958f, 0.2441f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1650f, 1.0000f, 1.0000f, 1.0000f, 0.6114f, 0.3816f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6415f, 0.8110f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5576f, 0.6495f, 0.6684f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7302f, 0.5465f, 0.1821f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7273f, 0.4671f, 0.4923f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6203f, 0.0829f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2546f, 0.4985f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9947f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9813f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0322f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9867f, 0.9970f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9946f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9794f, 0.9904f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9858f, 0.9968f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9428f, 0.9840f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9556f, 0.9613f, 0.8896f,
- 1.0000f, 0.9990f, 0.9988f, 0.9993f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9117f, 0.8401f, 0.9079f, 1.0000f, 0.9827f, 0.9897f, 0.9767f,
- 1.0000f, 0.9996f, 0.9998f, 0.9881f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8386f, 0.9283f, 0.9242f, 1.0000f, 0.9579f, 0.9771f, 0.8092f,
- 1.0000f, 0.9779f, 0.9849f, 0.9759f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6247f, 0.9069f, 1.0000f, 1.0000f, 0.6374f, 0.8145f, 0.9365f,
- 1.0000f, 0.9487f, 0.9717f, 0.8531f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8038f, 1.0000f, 1.0000f, 1.0000f, 0.7981f, 0.8817f, 0.9730f,
- 1.0000f, 0.9030f, 0.8694f, 0.9680f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5882f, 0.8805f, 1.0000f,
- 1.0000f, 0.8230f, 0.9650f, 0.9538f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7941f, 1.0000f, 1.0000f,
- 1.0000f, 0.3975f, 0.8668f, 0.8960f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7088f, 0.9685f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8781f, 0.9441f, 0.7882f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6925f, 0.7213f, 0.9250f, 1.0000f, 0.8707f, 0.9344f, 0.9722f,
- 1.0000f, 0.9873f, 0.9154f, 0.6991f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7663f, 0.8416f, 0.9635f, 1.0000f, 0.9861f, 0.9135f, 0.9190f,
- 1.0000f, 0.9267f, 0.6720f, 0.7540f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7488f, 1.0000f, 1.0000f, 1.0000f, 0.7182f, 0.9448f, 1.0000f,
- 1.0000f, 0.8573f, 0.8163f, 0.8056f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8489f, 0.9739f, 1.0000f,
- 1.0000f, 0.5288f, 0.8278f, 0.9624f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6611f, 1.0000f, 1.0000f,
- 1.0000f, 0.6823f, 0.9775f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6891f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8627f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4478f, 0.6290f, 0.9660f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5629f, 0.8641f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9992f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9978f, 0.9986f, 0.9960f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9998f, 0.9306f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9981f, 0.9763f, 0.8559f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9690f, 0.9329f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9999f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9988f, 0.9892f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9994f, 0.9011f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9846f, 0.9934f, 0.9928f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9591f, 0.9902f, 0.8732f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9665f, 0.7755f, 0.8545f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9468f, 0.9525f, 0.8371f,
- 1.0000f, 1.0000f, 0.9855f, 0.9995f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9574f, 0.8980f, 0.7024f, 1.0000f, 0.9895f, 0.9806f, 0.9562f,
- 1.0000f, 0.9980f, 0.9991f, 0.9994f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9455f, 0.7330f, 1.0000f, 1.0000f, 0.9823f, 0.9640f, 0.5930f,
- 1.0000f, 0.9955f, 0.9843f, 0.9500f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9181f, 0.9481f, 1.0000f, 1.0000f, 0.9351f, 0.6857f, 0.7436f,
- 1.0000f, 0.9899f, 0.9791f, 0.6789f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6159f, 1.0000f, 1.0000f, 1.0000f, 0.8758f, 0.2214f, 1.0000f,
- 1.0000f, 0.9918f, 0.8793f, 0.5977f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9020f, 1.0000f, 1.0000f, 1.0000f, 0.8445f, 0.9050f, 1.0000f,
- 1.0000f, 0.9258f, 0.6648f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4411f, 1.0000f, 1.0000f,
- 1.0000f, 0.9694f, 0.4342f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9519f, 1.0000f, 1.0000f,
- 1.0000f, 0.7921f, 0.7151f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9852f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9907f, 0.9816f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9675f, 0.8681f, 0.9926f, 1.0000f, 0.9916f, 0.9387f, 0.7639f,
- 1.0000f, 0.9585f, 0.9914f, 0.8991f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9372f, 0.7615f, 1.0000f, 1.0000f, 0.9494f, 0.9088f, 0.6332f,
- 1.0000f, 0.9909f, 0.9645f, 0.8917f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9655f, 1.0000f, 1.0000f, 1.0000f, 0.9544f, 0.4798f, 1.0000f,
- 1.0000f, 0.9836f, 0.9225f, 0.9531f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7383f, 1.0000f, 1.0000f, 1.0000f, 0.8128f, 1.0000f, 1.0000f,
- 1.0000f, 0.9820f, 0.8263f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9199f, 1.0000f, 1.0000f,
- 1.0000f, 0.9568f, 0.9870f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6573f, 1.0000f, 1.0000f,
- 1.0000f, 0.9743f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8341f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9608f, 0.9208f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9394f, 0.9726f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9982f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9708f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9952f, 0.9976f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9922f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9961f, 0.9938f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9911f, 0.9973f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f, 0.9965f, 0.9966f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9755f, 0.9884f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9602f, 0.9833f, 0.9163f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f, 0.9950f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9942f, 0.9930f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9944f, 0.9974f, 0.9964f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9949f, 0.9735f, 0.9670f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9802f, 0.9597f, 0.5407f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9887f, 0.8294f, 0.3135f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8949f, 0.7356f, 0.5347f,
- 1.0000f, 0.9990f, 0.9940f, 0.9336f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4200f, 1.0000f, 1.0000f,
- 1.0000f, 0.9971f, 0.9713f, 0.9954f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8600f, 1.0000f, 1.0000f,
- 1.0000f, 0.6754f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9408f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8970f, 0.9513f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9983f, 1.0000f, 1.0000f,
- 1.0000f, 0.8939f, 0.9986f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9999f, 0.9993f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f, 0.9997f, 0.9751f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9889f, 0.9992f, 0.9962f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9699f, 0.9997f, 0.8310f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9878f, 0.7462f, 0.5521f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9830f, 0.8019f, 0.8214f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6455f, 0.4052f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4271f, 0.9809f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9936f, 0.9999f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9958f, 1.0000f, 0.9924f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9401f, 0.5733f, 0.9314f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8907f, 0.7566f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3488f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7820f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_5x12[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8780f, 0.9349f, 1.0000f, 1.0000f, 0.9364f, 0.9901f,
- 1.0000f, 1.0000f, 1.0000f, 0.9975f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9180f, 0.9637f, 0.9656f, 1.0000f, 1.0000f, 0.9733f, 0.9894f,
- 1.0000f, 1.0000f, 0.9802f, 0.9969f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9172f, 0.8662f, 0.5213f, 1.0000f, 1.0000f, 0.9146f, 0.8459f,
- 1.0000f, 1.0000f, 0.9914f, 0.9959f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8116f, 0.8244f, 0.4387f, 1.0000f, 0.9313f, 0.9320f, 0.8625f,
- 1.0000f, 1.0000f, 0.9589f, 0.9742f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8289f, 0.4504f, 0.4006f, 1.0000f, 0.9104f, 0.8562f, 0.3463f,
- 1.0000f, 0.9494f, 0.9864f, 0.9861f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7709f, 0.0893f, 0.6998f, 1.0000f, 0.8274f, 0.7886f, 0.3091f,
- 1.0000f, 1.0000f, 0.9069f, 0.9188f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5676f, 0.1455f, 1.0000f, 1.0000f, 0.8362f, 0.5805f, 0.2600f,
- 1.0000f, 0.8846f, 0.8197f, 0.5586f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4675f, 0.6560f, 1.0000f, 1.0000f, 0.8099f, 0.4897f, 0.7086f,
- 1.0000f, 1.0000f, 1.0000f, 0.9506f, 0.5058f, 1.0000f, 1.0000f, 1.0000f, 0.6937f, 1.0000f, 0.8698f, 0.8304f, 0.5929f, 1.0000f, 0.9540f, 0.9721f,
- 1.0000f, 1.0000f, 0.9605f, 0.9616f, 0.6722f, 1.0000f, 1.0000f, 1.0000f, 0.7223f, 0.8835f, 0.8745f, 0.8889f, 0.3242f, 1.0000f, 0.9450f, 0.9642f,
- 1.0000f, 1.0000f, 0.9391f, 0.9568f, 0.7142f, 1.0000f, 1.0000f, 1.0000f, 0.3317f, 0.8523f, 0.7828f, 0.4842f, 0.7446f, 1.0000f, 0.8549f, 0.8587f,
- 1.0000f, 0.9557f, 0.9268f, 0.8710f, 0.6050f, 1.0000f, 1.0000f, 1.0000f, 0.1696f, 0.7997f, 0.4265f, 0.4326f, 1.0000f, 0.8498f, 0.8909f, 0.3167f,
- 1.0000f, 1.0000f, 0.8757f, 0.9244f, 0.6816f, 1.0000f, 1.0000f, 1.0000f, 0.6457f, 0.7789f, 0.1325f, 0.5541f, 1.0000f, 0.8939f, 0.6968f, 0.2032f,
- 1.0000f, 0.9129f, 0.8066f, 0.6280f, 0.0533f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5312f, 0.1581f, 1.0000f, 1.0000f, 0.7169f, 0.2931f, 0.4787f,
- 1.0000f, 0.8929f, 0.8149f, 0.6526f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5450f, 0.3874f, 1.0000f, 1.0000f, 0.7423f, 0.3391f, 0.5763f,
- 1.0000f, 0.8333f, 0.7646f, 0.3535f, 0.6422f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2241f, 1.0000f, 1.0000f, 1.0000f, 0.6785f, 0.3807f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8674f, 0.9033f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8347f, 0.7942f, 0.6690f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8734f, 0.5496f, 0.2141f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7749f, 0.3603f, 0.5970f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7375f, 0.0330f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3012f, 0.3739f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9929f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6492f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9923f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0720f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9856f, 0.9963f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7513f, 0.7961f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8376f, 0.8536f, 0.4618f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7468f, 0.2849f, 0.4137f, 1.0000f, 1.0000f, 1.0000f, 0.9973f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7114f, 0.1048f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9974f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6207f, 0.1186f, 1.0000f, 1.0000f, 1.0000f, 0.9799f, 0.9960f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1811f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9936f, 0.9967f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5263f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9573f, 0.9910f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2429f, 1.0000f, 1.0000f, 1.0000f, 0.9562f, 0.9792f, 0.8977f,
- 1.0000f, 0.9987f, 0.9976f, 0.9994f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9357f, 0.8445f, 0.9535f, 1.0000f, 0.9769f, 0.9828f, 0.9680f,
- 1.0000f, 0.9998f, 1.0000f, 0.9899f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8650f, 0.9438f, 0.9196f, 1.0000f, 0.9237f, 0.9762f, 0.7729f,
- 1.0000f, 0.9844f, 0.9892f, 0.9795f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7301f, 0.9398f, 1.0000f, 1.0000f, 0.6244f, 0.8165f, 0.8919f,
- 1.0000f, 0.9675f, 0.9853f, 0.8485f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8612f, 1.0000f, 1.0000f, 1.0000f, 0.7847f, 0.8802f, 0.9847f,
- 1.0000f, 0.9051f, 0.8722f, 0.9578f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6387f, 0.9024f, 1.0000f,
- 1.0000f, 0.8318f, 0.9611f, 0.9600f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8432f, 1.0000f, 1.0000f,
- 1.0000f, 0.4446f, 0.8996f, 0.9405f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7351f, 0.9816f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8768f, 0.9431f, 0.7808f, 0.4202f, 1.0000f, 1.0000f, 1.0000f, 0.9703f, 0.7249f, 0.8181f, 0.9716f, 1.0000f, 0.8213f, 0.9260f, 0.9475f,
- 1.0000f, 0.9850f, 0.9163f, 0.6626f, 0.6317f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8133f, 0.8987f, 0.9841f, 1.0000f, 0.9750f, 0.8879f, 0.9213f,
- 1.0000f, 0.9488f, 0.6877f, 0.7688f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7867f, 1.0000f, 1.0000f, 1.0000f, 0.6130f, 0.9204f, 1.0000f,
- 1.0000f, 0.8968f, 0.8418f, 0.8228f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8032f, 0.9512f, 1.0000f,
- 1.0000f, 0.4951f, 0.8390f, 0.9651f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6010f, 1.0000f, 1.0000f,
- 1.0000f, 0.6658f, 0.9781f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7667f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9155f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5162f, 0.8049f, 0.9694f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6846f, 0.9784f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9997f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9989f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9986f, 0.9988f, 0.9912f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f, 0.9994f, 0.9005f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9980f, 0.9758f, 0.8259f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9982f, 0.9551f, 0.9384f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5888f, 0.8813f, 1.0000f, 1.0000f, 1.0000f, 0.9990f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7491f, 0.9729f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9981f, 0.9993f, 0.9921f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9991f, 0.9060f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9831f, 0.9925f, 0.9869f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9500f, 0.9777f, 0.8574f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9670f, 0.7979f, 0.8511f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9463f, 0.9661f, 0.9298f,
- 1.0000f, 1.0000f, 0.9917f, 0.9996f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9482f, 0.9112f, 0.6352f, 1.0000f, 0.9887f, 0.9523f, 0.9517f,
- 1.0000f, 0.9999f, 0.9989f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9078f, 0.7057f, 1.0000f, 1.0000f, 0.9595f, 0.9646f, 0.5110f,
- 1.0000f, 0.9984f, 0.9938f, 0.9773f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9121f, 0.9015f, 1.0000f, 1.0000f, 0.9707f, 0.6754f, 0.7196f,
- 1.0000f, 0.9940f, 0.9872f, 0.7769f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5005f, 1.0000f, 1.0000f, 1.0000f, 0.8948f, 0.1922f, 1.0000f,
- 1.0000f, 0.9858f, 0.8824f, 0.5720f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8899f, 1.0000f, 1.0000f, 1.0000f, 0.9411f, 0.9335f, 1.0000f,
- 1.0000f, 0.9229f, 0.7275f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5358f, 1.0000f, 1.0000f,
- 1.0000f, 0.9631f, 0.5847f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9788f, 1.0000f, 1.0000f,
- 1.0000f, 0.8686f, 0.8014f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9890f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9919f, 0.9927f, 0.9546f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 0.9584f, 0.8404f, 0.9689f, 1.0000f, 0.9954f, 0.9095f, 0.6907f,
- 1.0000f, 0.9685f, 0.9941f, 0.9290f, 0.9086f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9252f, 0.6168f, 1.0000f, 1.0000f, 0.9283f, 0.8857f, 0.4072f,
- 1.0000f, 0.9943f, 0.9806f, 0.9275f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9444f, 1.0000f, 1.0000f, 1.0000f, 0.9469f, 0.2685f, 1.0000f,
- 1.0000f, 0.9885f, 0.9666f, 0.9825f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5405f, 1.0000f, 1.0000f, 1.0000f, 0.7580f, 1.0000f, 1.0000f,
- 1.0000f, 0.9946f, 0.8791f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8637f, 1.0000f, 1.0000f,
- 1.0000f, 0.9698f, 0.9903f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5631f, 1.0000f, 1.0000f,
- 1.0000f, 0.9834f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8600f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9738f, 0.7923f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9221f, 0.9371f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9378f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9981f, 0.9997f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9754f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9958f, 0.9955f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9948f, 0.9949f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f, 0.9972f, 0.9933f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9906f, 0.9867f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9725f, 0.9877f, 0.9305f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9342f, 0.8082f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9995f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9418f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9962f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9997f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f, 0.9951f, 0.9952f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9990f, 0.9819f, 0.9626f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9882f, 0.9529f, 0.4562f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9965f, 0.8958f, 0.3672f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9042f, 0.7535f, 0.6090f,
- 1.0000f, 0.9993f, 0.9897f, 0.9621f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2515f, 1.0000f, 1.0000f,
- 1.0000f, 0.9978f, 0.9837f, 0.9970f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7602f, 1.0000f, 1.0000f,
- 1.0000f, 0.7905f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9712f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9138f, 0.9457f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9934f, 1.0000f, 1.0000f,
- 1.0000f, 0.9327f, 0.9987f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9992f, 0.9983f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9971f, 1.0000f, 0.9822f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9956f, 0.9985f, 0.9874f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9880f, 0.9998f, 0.8472f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9908f, 0.7326f, 0.4731f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9425f, 0.7399f, 0.7624f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7027f, 0.2767f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3941f, 0.9812f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9945f, 1.0000f, 0.9998f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 1.0000f, 0.9931f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9809f, 0.6593f, 0.9766f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9746f, 0.8868f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2341f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7558f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_6x4[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9673f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8992f, 0.9737f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9398f, 0.9849f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7787f, 0.8814f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8128f, 0.8718f, 0.9182f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9354f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9262f, 0.9793f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8501f, 0.9493f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8559f, 0.8693f, 0.8377f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7200f, 0.7741f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7542f, 0.6070f, 0.3882f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.6630f, 0.8167f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.6893f, 0.8641f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7078f, 0.6828f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7595f, 0.7647f, 0.6763f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.2717f, 0.4628f, 0.0876f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4109f, 0.2335f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9467f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9664f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9823f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8743f, 0.9454f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9054f, 0.9628f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9904f, 0.9993f, 0.9982f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9974f, 0.9998f, 0.9817f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9787f, 0.9897f, 0.9834f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9530f, 0.9767f, 0.8767f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8205f, 0.7318f, 0.8008f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7259f, 0.8048f, 0.8471f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9967f, 0.9893f, 0.9427f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9959f, 0.9828f, 0.9619f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9231f, 0.7139f, 0.8242f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8883f, 0.9294f, 0.8277f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3079f, 0.5404f, 0.8311f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3622f, 0.8614f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9073f, 0.9384f, 0.8949f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8928f, 0.9148f, 0.5980f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4291f, 0.5542f, 0.8837f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9965f, 1.0000f,
- 1.0000f, 0.5667f, 0.7434f, 0.8905f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9998f,
- 1.0000f, 0.1611f, 0.4950f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9656f, 0.9844f, 0.9934f,
- 1.0000f, 0.3359f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9811f, 0.9920f, 0.9165f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9936f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9995f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f, 0.9987f, 0.9908f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 0.9988f, 0.9564f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9698f, 0.9799f, 0.9598f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9553f, 0.9638f, 0.7878f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9881f, 0.9928f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9948f, 0.9980f, 0.9950f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9876f, 0.9413f, 0.8860f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9752f, 0.9130f, 0.5107f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9690f, 0.8530f, 0.5777f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9441f, 0.6160f, 0.9985f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9858f, 0.9714f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9730f, 0.9868f, 0.9247f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9781f, 0.8089f, 0.4789f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9092f, 0.6244f, 0.5880f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9745f, 0.6409f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8587f, 0.9215f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9722f, 0.9647f, 0.8790f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9805f, 0.9198f, 0.7377f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f,
- 1.0000f, 0.9681f, 0.6955f, 0.9608f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9969f, 0.9979f,
- 1.0000f, 0.9309f, 0.6327f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9963f, 0.9977f,
- 1.0000f, 0.9481f, 0.9961f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9706f, 0.9911f,
- 1.0000f, 0.6560f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9926f, 0.9923f, 0.9946f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9972f, 0.9992f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9943f, 0.9989f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9914f, 0.9901f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9885f, 0.9863f, 0.9760f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9872f, 0.9774f, 0.9505f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9889f, 0.9576f, 0.7488f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9917f, 0.9013f, 0.6696f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9854f, 0.8971f, 0.8668f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4462f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7695f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8345f, 0.7965f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6489f, 0.9983f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8440f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 1.0000f, 0.9999f,
- 1.0000f, 0.9541f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9999f, 0.9971f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9957f, 0.9994f, 0.9976f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9931f, 0.9998f, 0.9518f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9939f, 0.9369f, 0.7921f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9839f, 0.9278f, 0.9325f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9953f, 0.9990f, 0.9941f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9955f, 0.9999f, 0.9587f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9033f, 0.5262f, 0.9340f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8409f, 0.7016f, 0.9999f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7833f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9111f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_6x5[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9817f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9250f, 0.9803f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9595f, 0.9914f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8438f, 0.9238f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8903f, 0.9454f, 0.9562f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7381f, 0.8169f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7219f, 0.6800f, 0.5402f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9620f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9587f, 0.9847f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9045f, 0.9696f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9090f, 0.9325f, 0.8704f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7951f, 0.7921f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7766f, 0.6848f, 0.4307f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8008f, 0.6425f, 0.3692f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6596f, 0.5073f, 0.0799f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.6702f, 0.8143f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7040f, 0.8816f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7600f, 0.7419f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7980f, 0.8246f, 0.7891f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7633f, 0.6896f, 0.3081f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6364f, 0.6026f, 0.2805f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9866f,
- 1.0000f, 0.2115f, 0.1301f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8951f,
- 1.0000f, 0.4014f, 0.1727f, 0.2470f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9420f, 0.9300f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9825f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9881f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9263f, 0.9812f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9628f, 0.9891f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8524f, 0.9186f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8798f, 0.8626f, 0.8545f,
- 1.0000f, 0.9939f, 0.9989f, 0.9978f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9993f, 0.9996f, 0.9755f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9799f, 0.9922f, 0.9908f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9604f, 0.9838f, 0.8919f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8415f, 0.8344f, 0.9288f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7531f, 0.9225f, 0.8834f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4445f, 0.6235f, 0.8886f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5191f, 0.8967f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9979f, 0.9874f, 0.9349f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9959f, 0.9834f, 0.9675f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9544f, 0.7494f, 0.8586f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9408f, 0.9535f, 0.8645f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4167f, 0.7456f, 0.8320f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5864f, 0.9465f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3509f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6167f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8935f, 0.9199f, 0.8742f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8665f, 0.9029f, 0.5948f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5687f, 0.6301f, 0.9431f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9971f, 1.0000f,
- 1.0000f, 0.6484f, 0.8195f, 0.9385f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9997f,
- 1.0000f, 0.3314f, 0.7733f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 0.9996f, 0.9991f,
- 1.0000f, 0.6098f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9983f, 0.9998f, 0.9842f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9570f, 0.9775f, 0.9312f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9862f, 0.9780f, 0.8852f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9988f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 0.9993f, 0.9925f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9991f, 0.9487f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9765f, 0.9895f, 0.9808f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9507f, 0.9760f, 0.8565f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9517f, 0.7342f, 0.7700f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9337f, 0.9133f, 0.7799f,
- 1.0000f, 1.0000f, 0.9851f, 0.9977f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9980f, 0.9956f, 0.9962f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9870f, 0.9644f, 0.9212f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9722f, 0.9396f, 0.5301f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9579f, 0.7566f, 0.3857f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8779f, 0.4950f, 0.9957f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9683f, 0.7175f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8761f, 0.9014f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9885f, 0.9794f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9750f, 0.9932f, 0.9443f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9830f, 0.8606f, 0.5777f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9373f, 0.7302f, 0.6752f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9612f, 0.4702f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7861f, 0.7667f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9690f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8296f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9667f, 0.9716f, 0.8684f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9739f, 0.9361f, 0.6992f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f,
- 1.0000f, 0.9785f, 0.8035f, 0.9821f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9969f, 0.9990f,
- 1.0000f, 0.9636f, 0.7260f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f, 0.9986f,
- 1.0000f, 0.9553f, 0.9930f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9904f, 0.9954f,
- 1.0000f, 0.6650f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9973f, 0.9948f, 0.9982f,
- 1.0000f, 0.8998f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9790f, 0.9770f,
- 1.0000f, 0.9952f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9703f, 0.9911f, 0.9660f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9961f, 0.9981f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9950f, 0.9972f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9917f, 0.9935f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9888f, 0.9898f, 0.9859f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9901f, 0.9710f, 0.9119f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9733f, 0.9476f, 0.5594f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9728f, 0.9104f, 0.7830f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9652f, 0.8461f, 0.8116f,
- 1.0000f, 0.9944f, 0.9275f, 0.7131f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9937f, 0.9173f, 0.9147f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4827f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8221f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8368f, 0.8392f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7086f, 0.9984f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8503f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9999f, 0.9999f,
- 1.0000f, 0.9744f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 1.0000f, 0.9946f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9967f, 0.9997f, 0.9976f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9941f, 0.9999f, 0.9526f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9920f, 0.8723f, 0.6944f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9855f, 0.8482f, 0.9160f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9060f, 0.8869f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8271f, 0.9965f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9927f, 0.9985f, 0.9992f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9877f, 0.9998f, 0.9497f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9075f, 0.4576f, 0.8983f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8063f, 0.6541f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5499f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8090f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_6x6[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8106f, 0.8853f,
- 1.0000f, 1.0000f, 1.0000f, 0.9930f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7864f, 0.9450f,
- 1.0000f, 1.0000f, 0.9513f, 0.9905f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8216f, 0.8013f,
- 1.0000f, 1.0000f, 0.9714f, 0.9946f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8453f, 0.8645f, 0.8629f,
- 1.0000f, 1.0000f, 0.8899f, 0.9579f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8525f, 0.7728f, 0.4573f,
- 1.0000f, 0.9120f, 0.9600f, 0.9709f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7079f, 0.7007f, 0.2804f,
- 1.0000f, 1.0000f, 0.8434f, 0.8542f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7615f, 0.3425f, 0.0000f,
- 1.0000f, 0.8340f, 0.7439f, 0.5516f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6893f, 0.2428f, 0.2979f,
- 1.0000f, 1.0000f, 1.0000f, 0.9744f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9764f, 0.9869f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9177f, 0.9724f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9199f, 0.9401f, 0.8679f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8379f, 0.8560f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8279f, 0.7219f, 0.5251f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8471f, 0.7185f, 0.4349f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6933f, 0.5759f, 0.2166f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.6970f, 0.8397f, 0.0794f, 1.0000f, 1.0000f, 1.0000f, 0.0403f, 1.0000f, 1.0000f, 1.0000f, 0.3571f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8320f, 0.9095f, 0.1892f, 1.0000f, 1.0000f, 1.0000f, 0.1171f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7916f, 0.7837f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8259f, 0.8489f, 0.8083f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7965f, 0.7528f, 0.4100f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6853f, 0.6812f, 0.3279f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9897f,
- 1.0000f, 0.7252f, 0.3130f, 0.1542f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9807f,
- 1.0000f, 0.6646f, 0.2621f, 0.3846f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9833f, 0.9944f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9903f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9908f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9458f, 0.9895f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9719f, 0.9889f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9252f, 0.9749f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9357f, 0.9375f, 0.8957f,
- 1.0000f, 0.9957f, 0.9997f, 0.9982f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9607f, 0.9729f, 0.9155f,
- 1.0000f, 0.9989f, 0.9999f, 0.9794f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9409f, 0.9572f, 0.6555f,
- 1.0000f, 0.9773f, 0.9910f, 0.9844f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6508f, 0.6154f, 0.9056f,
- 1.0000f, 0.9466f, 0.9803f, 0.8823f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7114f, 0.8151f, 0.9434f,
- 1.0000f, 0.8869f, 0.8760f, 0.9392f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3710f, 0.9015f, 1.0000f,
- 1.0000f, 0.7941f, 0.9426f, 0.9082f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6312f, 1.0000f, 1.0000f,
- 1.0000f, 0.5069f, 0.8129f, 0.8928f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6411f, 0.9586f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9978f, 0.9913f, 0.9302f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9988f, 0.9826f, 0.9482f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9543f, 0.7284f, 0.8695f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9242f, 0.9339f, 0.8986f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4975f, 0.8360f, 0.8884f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6460f, 0.9647f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5680f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6601f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9132f, 0.9166f, 0.8416f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8728f, 0.9029f, 0.5837f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5908f, 0.6261f, 0.9292f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9983f, 1.0000f,
- 1.0000f, 0.6362f, 0.8195f, 0.9282f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9999f,
- 1.0000f, 0.4781f, 0.9043f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9983f, 0.9995f, 0.9986f,
- 1.0000f, 0.7043f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9999f, 0.9786f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 0.9940f, 0.9593f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f, 0.9887f, 0.9687f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 0.9999f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9996f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9981f, 0.9841f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 0.9974f, 0.9188f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9777f, 0.9915f, 0.9881f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9474f, 0.9830f, 0.8943f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9621f, 0.7700f, 0.8711f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9330f, 0.9550f, 0.8838f,
- 1.0000f, 1.0000f, 0.9925f, 0.9987f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9818f, 0.9790f, 0.9703f,
- 1.0000f, 0.9969f, 0.9984f, 0.9996f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9854f, 0.9698f, 0.8662f,
- 1.0000f, 0.9942f, 0.9628f, 0.9143f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9768f, 0.8776f, 0.9754f,
- 1.0000f, 0.9739f, 0.9498f, 0.5161f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9505f, 0.7408f, 1.0000f,
- 1.0000f, 0.9653f, 0.8037f, 0.4225f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9348f, 0.9918f, 1.0000f,
- 1.0000f, 0.8507f, 0.5341f, 0.9892f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7469f, 1.0000f, 1.0000f,
- 1.0000f, 0.9520f, 0.4880f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9490f, 1.0000f, 1.0000f,
- 1.0000f, 0.8173f, 0.7557f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9967f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9875f, 0.9867f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9682f, 0.9952f, 0.9614f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9848f, 0.8791f, 0.6099f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9321f, 0.7499f, 0.7315f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9418f, 0.5430f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8238f, 0.7586f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9535f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6208f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9692f, 0.9798f, 0.8913f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9811f, 0.9383f, 0.7378f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9973f,
- 1.0000f, 0.9670f, 0.8300f, 0.9822f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9970f, 0.9980f,
- 1.0000f, 0.9665f, 0.7347f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f, 0.9955f,
- 1.0000f, 0.9565f, 0.9934f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9815f, 0.9947f,
- 1.0000f, 0.7149f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9965f, 0.9961f, 0.9976f,
- 1.0000f, 0.9659f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9863f, 0.9938f,
- 1.0000f, 0.9951f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9759f, 0.9977f, 0.9640f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9963f, 0.9972f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9900f, 0.9954f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9927f, 0.9958f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9857f, 0.9782f, 0.9837f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9920f, 0.9557f, 0.9272f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9734f, 0.9231f, 0.5598f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9851f, 0.8612f, 0.6039f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9262f, 0.7755f, 0.6689f,
- 1.0000f, 0.9949f, 0.9311f, 0.7890f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8578f, 1.0000f, 1.0000f,
- 1.0000f, 0.9960f, 0.9366f, 0.9442f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9634f, 1.0000f, 1.0000f,
- 1.0000f, 0.4464f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7671f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9001f, 0.9107f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7783f, 0.9998f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8744f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9990f, 0.9990f, 0.9997f,
- 1.0000f, 0.9676f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 1.0000f, 0.9932f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9860f, 0.9994f, 0.9979f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9872f, 1.0000f, 0.9210f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9936f, 0.9069f, 0.6771f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9884f, 0.8972f, 0.9221f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8060f, 0.7989f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6730f, 0.9988f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9878f, 0.9992f, 0.9985f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9923f, 0.9998f, 0.9528f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8807f, 0.3973f, 0.8595f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7643f, 0.5978f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4681f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7811f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_6x8[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7507f, 0.8312f, 1.0000f, 1.0000f, 0.9510f, 0.9872f,
- 1.0000f, 1.0000f, 1.0000f, 0.9960f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7791f, 0.8374f, 0.8893f, 1.0000f, 1.0000f, 0.9809f, 0.9948f,
- 1.0000f, 1.0000f, 0.9710f, 0.9957f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8389f, 0.7750f, 0.5758f, 1.0000f, 1.0000f, 0.8996f, 0.8296f,
- 1.0000f, 1.0000f, 0.9880f, 0.9956f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7361f, 0.7599f, 0.3527f, 1.0000f, 0.9236f, 0.9323f, 0.8634f,
- 1.0000f, 1.0000f, 0.9331f, 0.9540f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7483f, 0.4613f, 0.2516f, 1.0000f, 0.9254f, 0.8264f, 0.4148f,
- 1.0000f, 0.9441f, 0.9799f, 0.9751f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7013f, 0.1466f, 0.7850f, 1.0000f, 0.7870f, 0.7459f, 0.3889f,
- 1.0000f, 1.0000f, 0.8858f, 0.8905f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6250f, 0.0671f, 1.0000f, 1.0000f, 0.8434f, 0.4063f, 0.1118f,
- 1.0000f, 0.8578f, 0.7947f, 0.5703f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3140f, 0.4470f, 1.0000f, 1.0000f, 0.7261f, 0.2774f, 0.4683f,
- 1.0000f, 1.0000f, 1.0000f, 0.9918f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9600f, 0.9795f,
- 1.0000f, 1.0000f, 0.9890f, 0.9950f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9306f, 0.9573f,
- 1.0000f, 1.0000f, 0.9551f, 0.9818f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8216f, 0.8535f,
- 1.0000f, 0.9516f, 0.9534f, 0.9040f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8620f, 0.9083f, 0.4231f,
- 1.0000f, 1.0000f, 0.8962f, 0.9007f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9157f, 0.6601f, 0.1800f,
- 1.0000f, 0.8916f, 0.7966f, 0.5647f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6677f, 0.3618f, 0.3343f,
- 1.0000f, 0.9167f, 0.7927f, 0.5342f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7386f, 0.1634f, 0.3020f,
- 1.0000f, 0.7687f, 0.6559f, 0.2897f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5591f, 0.1293f, 1.0000f,
- 1.0000f, 1.0000f, 0.7435f, 0.8798f, 0.6474f, 1.0000f, 1.0000f, 1.0000f, 0.1950f, 1.0000f, 1.0000f, 1.0000f, 0.5959f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9051f, 0.9314f, 0.5085f, 1.0000f, 1.0000f, 1.0000f, 0.2645f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8507f, 0.8248f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8881f, 0.8973f, 0.8419f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8564f, 0.8059f, 0.5150f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7411f, 0.7729f, 0.4394f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9951f,
- 1.0000f, 0.7984f, 0.5279f, 0.2378f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9862f,
- 1.0000f, 0.7531f, 0.4313f, 0.5909f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9864f, 0.9927f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9947f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9963f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9646f, 0.9920f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9827f, 0.9940f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9461f, 0.9839f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9474f, 0.9568f, 0.8674f,
- 1.0000f, 0.9972f, 0.9996f, 0.9991f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8700f, 0.7129f, 0.7156f, 1.0000f, 0.9915f, 0.9922f, 0.9770f,
- 1.0000f, 0.9998f, 0.9999f, 0.9815f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7708f, 0.7337f, 0.7771f, 1.0000f, 0.9651f, 0.9902f, 0.8449f,
- 1.0000f, 0.9792f, 0.9931f, 0.9885f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4819f, 0.9546f, 1.0000f, 1.0000f, 0.6639f, 0.8232f, 0.9697f,
- 1.0000f, 0.9454f, 0.9774f, 0.9093f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7043f, 1.0000f, 1.0000f, 1.0000f, 0.8022f, 0.9115f, 0.9631f,
- 1.0000f, 0.8822f, 0.8761f, 0.9378f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6340f, 0.9207f, 1.0000f,
- 1.0000f, 0.8095f, 0.9562f, 0.9197f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8182f, 1.0000f, 1.0000f,
- 1.0000f, 0.5019f, 0.9029f, 0.9281f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7209f, 0.9777f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9995f, 0.9925f, 0.9467f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8687f, 0.9347f, 0.9289f,
- 1.0000f, 0.9990f, 0.9851f, 0.9589f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9719f, 0.8869f, 0.8846f,
- 1.0000f, 0.9675f, 0.7889f, 0.9072f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6058f, 0.8521f, 1.0000f,
- 1.0000f, 0.9413f, 0.9492f, 0.9339f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7182f, 0.9400f, 1.0000f,
- 1.0000f, 0.4953f, 0.9136f, 0.9272f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6714f, 1.0000f, 1.0000f,
- 1.0000f, 0.7101f, 0.9802f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6918f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7665f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9245f, 0.9187f, 0.8492f, 0.5531f, 1.0000f, 1.0000f, 1.0000f, 0.0934f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8606f, 0.8951f, 0.5215f, 0.2100f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6295f, 0.6886f, 0.9522f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 1.0000f,
- 1.0000f, 0.6750f, 0.8550f, 0.9528f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9996f,
- 1.0000f, 0.6009f, 0.9498f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9980f, 0.9995f, 0.9980f,
- 1.0000f, 0.8148f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 1.0000f, 0.9504f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9982f, 0.9911f, 0.9298f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9875f, 0.9731f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9998f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9987f, 0.9788f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9971f, 0.8984f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9684f, 0.9898f, 0.9833f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9363f, 0.9743f, 0.8358f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9665f, 0.7643f, 0.8737f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9370f, 0.9610f, 0.8786f,
- 1.0000f, 1.0000f, 0.9942f, 0.9964f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9693f, 0.9661f, 0.8592f, 1.0000f, 0.9913f, 0.9755f, 0.9688f,
- 1.0000f, 0.9988f, 0.9970f, 0.9993f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9723f, 0.9177f, 1.0000f, 1.0000f, 0.9883f, 0.9762f, 0.6982f,
- 1.0000f, 0.9938f, 0.9888f, 0.9595f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9605f, 0.9895f, 1.0000f, 1.0000f, 0.9486f, 0.7235f, 0.8774f,
- 1.0000f, 0.9867f, 0.9679f, 0.5809f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8464f, 1.0000f, 1.0000f, 1.0000f, 0.9146f, 0.3977f, 1.0000f,
- 1.0000f, 0.9739f, 0.8404f, 0.3800f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9727f, 1.0000f, 1.0000f, 1.0000f, 0.8648f, 0.9226f, 1.0000f,
- 1.0000f, 0.8939f, 0.5469f, 0.9983f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4542f, 1.0000f, 1.0000f,
- 1.0000f, 0.9480f, 0.3251f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9217f, 1.0000f, 1.0000f,
- 1.0000f, 0.7621f, 0.6518f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9621f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9935f, 0.9936f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9836f, 0.9848f, 0.7831f,
- 1.0000f, 0.9878f, 0.9959f, 0.9714f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9702f, 0.9406f, 0.7811f,
- 1.0000f, 0.9953f, 0.9385f, 0.7312f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9579f, 0.6430f, 1.0000f,
- 1.0000f, 0.9641f, 0.8749f, 0.8810f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8478f, 1.0000f, 1.0000f,
- 1.0000f, 0.9584f, 0.6385f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9061f, 1.0000f, 1.0000f,
- 1.0000f, 0.8280f, 0.8199f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6950f, 1.0000f, 1.0000f,
- 1.0000f, 0.9434f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6155f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9806f, 0.9766f, 0.9104f, 0.0354f, 1.0000f, 1.0000f, 1.0000f, 0.4752f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9900f, 0.9427f, 0.7577f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f,
- 1.0000f, 0.9785f, 0.9125f, 0.9977f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9976f, 0.9994f,
- 1.0000f, 0.9812f, 0.8077f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f, 0.9929f,
- 1.0000f, 0.9616f, 0.9968f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9967f, 0.9905f,
- 1.0000f, 0.7908f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9974f, 0.9954f, 0.9984f,
- 1.0000f, 0.9557f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9821f, 0.9909f,
- 1.0000f, 0.9853f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9830f, 0.9924f, 0.9636f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9962f, 0.9978f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9966f, 0.9973f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9706f, 0.9981f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9943f, 0.9945f, 0.9933f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9392f, 0.9263f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9670f, 0.9355f, 0.3709f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9907f, 0.8165f, 0.4886f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8724f, 0.7287f, 0.5860f,
- 1.0000f, 0.9992f, 0.9759f, 0.8661f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6819f, 1.0000f, 1.0000f,
- 1.0000f, 0.9986f, 0.9747f, 0.9842f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9447f, 1.0000f, 1.0000f,
- 1.0000f, 0.5406f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8834f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9420f, 0.9656f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f, 1.0000f, 1.0000f,
- 1.0000f, 0.9018f, 0.9996f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8712f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9999f, 0.9999f,
- 1.0000f, 0.9626f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 1.0000f, 0.9781f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9824f, 0.9994f, 0.9969f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9856f, 0.9998f, 0.8928f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9859f, 0.8003f, 0.6107f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9845f, 0.8113f, 0.8131f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8041f, 0.7073f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6785f, 0.9989f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9893f, 1.0000f, 0.9987f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9870f, 1.0000f, 0.9735f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8327f, 0.3436f, 0.8343f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7554f, 0.6203f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2239f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6852f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_6x10[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9113f, 0.9605f, 1.0000f, 1.0000f, 0.9651f, 0.9905f,
- 1.0000f, 1.0000f, 1.0000f, 0.9986f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9297f, 0.9572f, 0.9655f, 1.0000f, 1.0000f, 0.9680f, 0.9938f,
- 1.0000f, 1.0000f, 0.9769f, 0.9966f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9434f, 0.8648f, 0.4724f, 1.0000f, 1.0000f, 0.9029f, 0.8206f,
- 1.0000f, 1.0000f, 0.9929f, 0.9937f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8133f, 0.7768f, 0.4066f, 1.0000f, 0.9338f, 0.9224f, 0.8220f,
- 1.0000f, 1.0000f, 0.9384f, 0.9696f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8118f, 0.4443f, 0.3663f, 1.0000f, 0.9358f, 0.8449f, 0.3799f,
- 1.0000f, 0.9624f, 0.9881f, 0.9847f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7514f, 0.0924f, 0.7271f, 1.0000f, 0.8057f, 0.7892f, 0.3453f,
- 1.0000f, 1.0000f, 0.8889f, 0.8976f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7575f, 0.0336f, 1.0000f, 1.0000f, 0.8849f, 0.4385f, 0.1879f,
- 1.0000f, 0.8909f, 0.8072f, 0.5233f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3074f, 0.3933f, 1.0000f, 1.0000f, 0.7857f, 0.2391f, 0.5425f,
- 1.0000f, 1.0000f, 1.0000f, 0.9927f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8869f, 0.8500f, 1.0000f, 1.0000f, 0.9712f, 0.9720f,
- 1.0000f, 1.0000f, 0.9890f, 0.9970f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8985f, 0.9391f, 0.8695f, 1.0000f, 1.0000f, 0.9446f, 0.9736f,
- 1.0000f, 1.0000f, 0.9659f, 0.9844f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8659f, 0.7674f, 0.4262f, 1.0000f, 1.0000f, 0.8474f, 0.8900f,
- 1.0000f, 0.9692f, 0.9783f, 0.9020f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7804f, 0.4000f, 0.3231f, 1.0000f, 0.8838f, 0.9397f, 0.4559f,
- 1.0000f, 1.0000f, 0.9246f, 0.9311f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7994f, 0.1379f, 0.6466f, 1.0000f, 0.9208f, 0.7374f, 0.3153f,
- 1.0000f, 0.9201f, 0.8397f, 0.6361f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5610f, 0.1510f, 1.0000f, 1.0000f, 0.7219f, 0.3523f, 0.5786f,
- 1.0000f, 0.9177f, 0.8423f, 0.5185f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5656f, 0.1641f, 1.0000f, 1.0000f, 0.7875f, 0.2300f, 0.4935f,
- 1.0000f, 0.8192f, 0.6885f, 0.2571f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1230f, 1.0000f, 1.0000f, 1.0000f, 0.6501f, 0.2916f, 1.0000f,
- 1.0000f, 1.0000f, 0.7712f, 0.9063f, 0.6824f, 1.0000f, 1.0000f, 1.0000f, 0.2659f, 1.0000f, 0.6762f, 0.7749f, 0.7348f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9216f, 0.9193f, 0.6252f, 1.0000f, 1.0000f, 1.0000f, 0.2995f, 0.6215f, 0.7030f, 0.6915f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8550f, 0.8318f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7654f, 0.5869f, 0.2099f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8994f, 0.8752f, 0.8277f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7534f, 0.4778f, 0.5086f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9011f, 0.8624f, 0.5987f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6666f, 0.1080f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7909f, 0.8291f, 0.4987f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4197f, 0.6026f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9932f,
- 1.0000f, 0.8088f, 0.5700f, 0.2747f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6289f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9924f,
- 1.0000f, 0.7731f, 0.4670f, 0.6855f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0749f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9903f, 0.9988f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5948f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9953f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9799f, 0.9958f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9886f, 0.9922f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9525f, 0.9790f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9628f, 0.9610f, 0.8487f,
- 1.0000f, 0.9992f, 0.9991f, 0.9990f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9254f, 0.8817f, 0.9231f, 1.0000f, 0.9836f, 0.9925f, 0.9776f,
- 1.0000f, 0.9997f, 0.9999f, 0.9897f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8636f, 0.9331f, 0.9504f, 1.0000f, 0.9577f, 0.9838f, 0.8148f,
- 1.0000f, 0.9821f, 0.9899f, 0.9849f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6730f, 0.9046f, 1.0000f, 1.0000f, 0.6103f, 0.8162f, 0.9096f,
- 1.0000f, 0.9428f, 0.9793f, 0.8740f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8512f, 1.0000f, 1.0000f, 1.0000f, 0.7555f, 0.8763f, 0.9684f,
- 1.0000f, 0.9283f, 0.8938f, 0.9762f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6601f, 0.9003f, 1.0000f,
- 1.0000f, 0.8525f, 0.9747f, 0.9520f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8263f, 1.0000f, 1.0000f,
- 1.0000f, 0.4133f, 0.8706f, 0.9276f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7470f, 0.9812f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9985f, 0.9913f, 0.9546f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7323f, 0.7245f, 0.9104f, 1.0000f, 0.8806f, 0.9552f, 0.9664f,
- 1.0000f, 0.9997f, 0.9901f, 0.9637f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7786f, 0.8331f, 0.9765f, 1.0000f, 0.9892f, 0.9261f, 0.9557f,
- 1.0000f, 0.9705f, 0.7944f, 0.8948f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7693f, 1.0000f, 1.0000f, 1.0000f, 0.7059f, 0.9452f, 1.0000f,
- 1.0000f, 0.9458f, 0.9498f, 0.9351f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8671f, 0.9672f, 1.0000f,
- 1.0000f, 0.5282f, 0.9304f, 0.9541f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7297f, 1.0000f, 1.0000f,
- 1.0000f, 0.7635f, 0.9883f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7492f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8041f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9161f, 0.8929f, 0.8103f, 0.6431f, 1.0000f, 1.0000f, 1.0000f, 0.2832f, 0.5037f, 0.6064f, 0.9728f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8575f, 0.8828f, 0.4501f, 0.3732f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5743f, 0.8344f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5829f, 0.6794f, 0.9440f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 0.6698f, 0.8587f, 0.9581f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9994f,
- 1.0000f, 0.6944f, 0.9755f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9989f, 0.9961f,
- 1.0000f, 0.8784f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9996f, 0.9365f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9976f, 0.9806f, 0.8718f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9724f, 0.9470f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9964f, 0.9709f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9973f, 0.8773f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9802f, 0.9915f, 0.9857f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9324f, 0.9824f, 0.8384f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9481f, 0.7423f, 0.8235f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9185f, 0.9422f, 0.8358f,
- 1.0000f, 1.0000f, 0.9935f, 0.9989f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9596f, 0.9290f, 0.7615f, 1.0000f, 0.9918f, 0.9740f, 0.9830f,
- 1.0000f, 0.9977f, 0.9995f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9403f, 0.7595f, 1.0000f, 1.0000f, 0.9701f, 0.9633f, 0.6534f,
- 1.0000f, 0.9951f, 0.9688f, 0.9591f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9169f, 0.9562f, 1.0000f, 1.0000f, 0.9536f, 0.6634f, 0.7398f,
- 1.0000f, 0.9888f, 0.9531f, 0.7113f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7002f, 1.0000f, 1.0000f, 1.0000f, 0.8537f, 0.2204f, 1.0000f,
- 1.0000f, 0.9773f, 0.8729f, 0.4325f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8919f, 1.0000f, 1.0000f, 1.0000f, 0.8611f, 0.8410f, 1.0000f,
- 1.0000f, 0.9129f, 0.6141f, 0.9975f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3593f, 1.0000f, 1.0000f,
- 1.0000f, 0.9410f, 0.3866f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9071f, 1.0000f, 1.0000f,
- 1.0000f, 0.7927f, 0.5909f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9088f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9941f, 0.9971f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9732f, 0.9145f, 0.9950f, 1.0000f, 0.9969f, 0.9345f, 0.7839f,
- 1.0000f, 0.9841f, 0.9974f, 0.9796f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9509f, 0.8010f, 1.0000f, 1.0000f, 0.9493f, 0.9515f, 0.6973f,
- 1.0000f, 0.9920f, 0.9378f, 0.8026f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9487f, 1.0000f, 1.0000f, 1.0000f, 0.9646f, 0.4884f, 1.0000f,
- 1.0000f, 0.9779f, 0.9153f, 0.8957f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7447f, 1.0000f, 1.0000f, 1.0000f, 0.8249f, 1.0000f, 1.0000f,
- 1.0000f, 0.9751f, 0.7140f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8859f, 1.0000f, 1.0000f,
- 1.0000f, 0.9080f, 0.9371f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5330f, 1.0000f, 1.0000f,
- 1.0000f, 0.9464f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6325f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9943f, 0.9833f, 0.9137f, 0.7166f, 1.0000f, 1.0000f, 1.0000f, 0.6178f, 0.9615f, 0.9317f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9949f, 0.9567f, 0.7821f, 0.0544f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9601f, 0.9867f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9947f,
- 1.0000f, 0.9815f, 0.8966f, 0.9981f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9668f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9956f, 0.9994f,
- 1.0000f, 0.9786f, 0.8599f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9946f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f, 0.9869f,
- 1.0000f, 0.9743f, 0.9982f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 0.9874f,
- 1.0000f, 0.8462f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 0.9954f, 0.9965f,
- 1.0000f, 0.9476f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9879f, 0.9852f,
- 1.0000f, 0.9911f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9827f, 0.9980f, 0.9239f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9944f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9959f, 0.9960f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9917f, 0.9967f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9955f, 0.9864f, 0.9934f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9978f, 0.9037f, 0.9642f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9758f, 0.9676f, 0.3382f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9895f, 0.8177f, 0.2481f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8371f, 0.6396f, 0.4616f,
- 1.0000f, 0.9992f, 0.9931f, 0.9268f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5378f, 1.0000f, 1.0000f,
- 1.0000f, 0.9993f, 0.9876f, 0.9983f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8562f, 1.0000f, 1.0000f,
- 1.0000f, 0.5518f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9121f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9619f, 0.9716f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9416f, 0.9995f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8879f, 1.0000f, 1.0000f, 0.5472f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 0.9995f, 0.9998f,
- 1.0000f, 0.9586f, 1.0000f, 1.0000f, 0.1993f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f, 0.9809f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9859f, 0.9972f, 0.9940f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9872f, 0.9997f, 0.8795f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9962f, 0.8683f, 0.5565f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9862f, 0.8304f, 0.7977f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7192f, 0.4831f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5136f, 0.9909f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9907f, 0.9998f, 0.9999f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9818f, 1.0000f, 0.9854f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9054f, 0.3309f, 0.8436f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7961f, 0.6568f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1765f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7086f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_6x12[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9358f, 0.9687f, 1.0000f, 1.0000f, 0.9758f, 0.9938f,
- 1.0000f, 1.0000f, 1.0000f, 0.9976f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9388f, 0.9790f, 0.9579f, 1.0000f, 1.0000f, 0.9956f, 0.9959f,
- 1.0000f, 1.0000f, 0.9823f, 0.9981f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9393f, 0.8955f, 0.5579f, 1.0000f, 1.0000f, 0.9352f, 0.8171f,
- 1.0000f, 1.0000f, 0.9961f, 0.9958f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8496f, 0.8435f, 0.4922f, 1.0000f, 0.9433f, 0.9471f, 0.8360f,
- 1.0000f, 1.0000f, 0.9751f, 0.9655f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8472f, 0.5535f, 0.4179f, 1.0000f, 0.9323f, 0.8920f, 0.4065f,
- 1.0000f, 0.9817f, 0.9834f, 0.9907f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8254f, 0.1082f, 0.7436f, 1.0000f, 0.8460f, 0.7976f, 0.3593f,
- 1.0000f, 1.0000f, 0.9410f, 0.9212f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8100f, 0.0675f, 1.0000f, 1.0000f, 0.9170f, 0.5706f, 0.2586f,
- 1.0000f, 0.9232f, 0.8531f, 0.6146f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4290f, 0.5024f, 1.0000f, 1.0000f, 0.8588f, 0.3338f, 0.6441f,
- 1.0000f, 1.0000f, 1.0000f, 0.9893f, 0.5788f, 1.0000f, 1.0000f, 1.0000f, 0.7577f, 1.0000f, 0.9112f, 0.8718f, 0.6181f, 1.0000f, 0.9829f, 0.9864f,
- 1.0000f, 1.0000f, 0.9903f, 0.9939f, 0.7260f, 1.0000f, 1.0000f, 1.0000f, 0.7673f, 0.8972f, 0.9119f, 0.8837f, 0.3715f, 1.0000f, 0.9724f, 0.9663f,
- 1.0000f, 1.0000f, 0.9802f, 0.9871f, 0.7457f, 1.0000f, 1.0000f, 1.0000f, 0.3891f, 0.8980f, 0.8185f, 0.5219f, 0.7857f, 1.0000f, 0.8769f, 0.8610f,
- 1.0000f, 0.9787f, 0.9854f, 0.9127f, 0.6964f, 1.0000f, 1.0000f, 1.0000f, 0.1538f, 0.8410f, 0.4767f, 0.4973f, 1.0000f, 0.8893f, 0.9225f, 0.2978f,
- 1.0000f, 1.0000f, 0.9427f, 0.9279f, 0.7066f, 1.0000f, 1.0000f, 1.0000f, 0.6938f, 0.8565f, 0.1859f, 0.6345f, 1.0000f, 0.9259f, 0.7749f, 0.2331f,
- 1.0000f, 0.9539f, 0.8484f, 0.6628f, 0.0953f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6598f, 0.2242f, 1.0000f, 1.0000f, 0.7616f, 0.3196f, 0.5264f,
- 1.0000f, 0.9498f, 0.8903f, 0.6280f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6214f, 0.2151f, 1.0000f, 1.0000f, 0.8295f, 0.2420f, 0.4664f,
- 1.0000f, 0.8738f, 0.7394f, 0.3531f, 0.6473f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1202f, 1.0000f, 1.0000f, 1.0000f, 0.7236f, 0.3051f, 1.0000f,
- 1.0000f, 1.0000f, 0.8085f, 0.9252f, 0.6885f, 1.0000f, 1.0000f, 1.0000f, 0.3469f, 1.0000f, 0.9052f, 0.9205f, 0.7635f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9534f, 0.9518f, 0.7188f, 1.0000f, 1.0000f, 1.0000f, 0.3654f, 0.9029f, 0.8423f, 0.7164f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9455f, 0.8385f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9239f, 0.6312f, 0.2750f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9272f, 0.9370f, 0.8599f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8321f, 0.3833f, 0.6377f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9060f, 0.9134f, 0.5936f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8213f, 0.0524f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8654f, 0.8856f, 0.5074f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4716f, 0.5124f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9980f,
- 1.0000f, 0.8334f, 0.7212f, 0.3950f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7477f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9974f,
- 1.0000f, 0.8938f, 0.5747f, 0.7351f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0193f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9944f, 0.9929f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0371f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8114f, 0.8448f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6112f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8911f, 0.9067f, 0.5356f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8069f, 0.3404f, 0.4819f, 1.0000f, 1.0000f, 1.0000f, 0.9969f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7804f, 0.1429f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7116f, 0.1645f, 1.0000f, 1.0000f, 1.0000f, 0.9847f, 0.9932f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2668f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9953f, 0.9937f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6042f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9744f, 0.9873f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1961f, 1.0000f, 1.0000f, 1.0000f, 0.9731f, 0.9774f, 0.8676f,
- 1.0000f, 0.9978f, 0.9990f, 0.9994f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9422f, 0.8643f, 0.9588f, 1.0000f, 0.9808f, 0.9866f, 0.9646f,
- 1.0000f, 0.9998f, 0.9993f, 0.9890f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8749f, 0.9329f, 0.9341f, 1.0000f, 0.9292f, 0.9784f, 0.7875f,
- 1.0000f, 0.9842f, 0.9946f, 0.9857f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7415f, 0.9265f, 1.0000f, 1.0000f, 0.5900f, 0.8038f, 0.8865f,
- 1.0000f, 0.9524f, 0.9899f, 0.8846f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8818f, 1.0000f, 1.0000f, 1.0000f, 0.7518f, 0.8554f, 0.9826f,
- 1.0000f, 0.9097f, 0.8929f, 0.9716f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6990f, 0.9191f, 1.0000f,
- 1.0000f, 0.8632f, 0.9690f, 0.9598f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8778f, 1.0000f, 1.0000f,
- 1.0000f, 0.4612f, 0.9105f, 0.9616f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7786f, 0.9850f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9989f, 0.9954f, 0.9574f, 0.4506f, 1.0000f, 1.0000f, 1.0000f, 0.9702f, 0.7557f, 0.8268f, 0.9748f, 1.0000f, 0.8398f, 0.9405f, 0.9593f,
- 1.0000f, 0.9990f, 0.9919f, 0.9638f, 0.6077f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8241f, 0.9298f, 0.9915f, 1.0000f, 0.9839f, 0.8963f, 0.9364f,
- 1.0000f, 0.9771f, 0.8199f, 0.9021f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8054f, 1.0000f, 1.0000f, 1.0000f, 0.5828f, 0.8542f, 1.0000f,
- 1.0000f, 0.9529f, 0.9492f, 0.9564f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8023f, 0.9559f, 1.0000f,
- 1.0000f, 0.5446f, 0.9198f, 0.9629f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6007f, 1.0000f, 1.0000f,
- 1.0000f, 0.7943f, 0.9877f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8144f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8759f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9005f, 0.8875f, 0.7840f, 0.7016f, 1.0000f, 1.0000f, 1.0000f, 0.2503f, 0.5664f, 0.8129f, 0.9761f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8808f, 0.8519f, 0.3774f, 0.4870f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7091f, 0.9764f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6567f, 0.6717f, 0.9347f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 1.0000f,
- 1.0000f, 0.6858f, 0.8281f, 0.9694f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9998f,
- 1.0000f, 0.6775f, 0.9698f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9982f, 0.9934f,
- 1.0000f, 0.8687f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9996f, 0.9044f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9768f, 0.8507f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9980f, 0.9667f, 0.9438f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5864f, 0.8827f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9999f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7596f, 0.9741f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9970f, 0.9734f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9986f, 0.9975f, 0.8697f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9705f, 0.9861f, 0.9793f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9037f, 0.9642f, 0.8227f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9482f, 0.7373f, 0.8373f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9317f, 0.9476f, 0.9184f,
- 1.0000f, 1.0000f, 0.9982f, 0.9984f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9611f, 0.9607f, 0.6911f, 1.0000f, 0.9950f, 0.9713f, 0.9569f,
- 1.0000f, 0.9994f, 0.9992f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9671f, 0.7538f, 1.0000f, 1.0000f, 0.9875f, 0.9659f, 0.5971f,
- 1.0000f, 0.9935f, 0.9852f, 0.9845f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9162f, 0.8728f, 1.0000f, 1.0000f, 0.9926f, 0.6688f, 0.6658f,
- 1.0000f, 0.9927f, 0.9796f, 0.7711f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5401f, 1.0000f, 1.0000f, 1.0000f, 0.9013f, 0.1752f, 1.0000f,
- 1.0000f, 0.9924f, 0.8788f, 0.5491f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8621f, 1.0000f, 1.0000f, 1.0000f, 0.9246f, 0.7959f, 1.0000f,
- 1.0000f, 0.9513f, 0.6746f, 0.9997f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4345f, 1.0000f, 1.0000f,
- 1.0000f, 0.9820f, 0.4235f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9382f, 1.0000f, 1.0000f,
- 1.0000f, 0.8347f, 0.6536f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9090f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9965f, 0.9991f, 0.9544f, 1.0000f, 1.0000f, 1.0000f, 0.9972f, 0.9620f, 0.8708f, 0.9683f, 1.0000f, 0.9901f, 0.9651f, 0.7909f,
- 1.0000f, 0.9971f, 0.9996f, 0.9837f, 0.9075f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9720f, 0.6504f, 1.0000f, 1.0000f, 0.9583f, 0.9285f, 0.5173f,
- 1.0000f, 0.9964f, 0.9487f, 0.8576f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9444f, 1.0000f, 1.0000f, 1.0000f, 0.9679f, 0.3124f, 1.0000f,
- 1.0000f, 0.9911f, 0.9304f, 0.9082f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5310f, 1.0000f, 1.0000f, 1.0000f, 0.7730f, 1.0000f, 1.0000f,
- 1.0000f, 0.9882f, 0.7283f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8798f, 1.0000f, 1.0000f,
- 1.0000f, 0.9310f, 0.9148f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2827f, 1.0000f, 1.0000f,
- 1.0000f, 0.9781f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7041f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9941f, 0.9917f, 0.8989f, 0.7140f, 1.0000f, 1.0000f, 1.0000f, 0.6831f, 0.9905f, 0.7992f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9968f, 0.9755f, 0.7692f, 0.0818f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9449f, 0.9465f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9986f,
- 1.0000f, 0.9895f, 0.8884f, 0.9962f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9460f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f, 0.9984f,
- 1.0000f, 0.9814f, 0.8007f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9508f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9955f,
- 1.0000f, 0.9727f, 0.9988f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9859f, 0.9951f,
- 1.0000f, 0.7926f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9923f, 0.9993f,
- 1.0000f, 0.9376f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9921f, 0.9738f,
- 1.0000f, 0.9884f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9811f, 0.9831f, 0.9399f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9634f, 0.8308f, 1.0000f, 1.0000f, 1.0000f, 0.9976f, 0.9998f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9549f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9979f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9973f, 0.9983f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9960f, 0.9966f, 0.9868f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9967f, 0.9709f, 0.9155f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9948f, 0.9177f, 0.3267f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9931f, 0.8946f, 0.2903f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9335f, 0.6803f, 0.4399f,
- 1.0000f, 0.9995f, 0.9945f, 0.9554f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4122f, 1.0000f, 1.0000f,
- 1.0000f, 0.9997f, 0.9880f, 0.9942f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7654f, 1.0000f, 1.0000f,
- 1.0000f, 0.7498f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9602f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9805f, 0.9897f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 1.0000f, 1.0000f,
- 1.0000f, 0.9141f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8158f, 1.0000f, 1.0000f, 0.6409f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f,
- 1.0000f, 0.9503f, 1.0000f, 1.0000f, 0.2058f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 1.0000f, 0.9777f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9913f, 0.9995f, 0.9909f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9625f, 0.9996f, 0.8665f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9949f, 0.7892f, 0.4559f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9675f, 0.7767f, 0.7306f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7329f, 0.4008f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4453f, 0.9799f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9886f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9963f, 1.0000f, 0.9888f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9416f, 0.5622f, 0.9219f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8997f, 0.7822f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1318f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6247f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_8x4[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5963f, 0.7486f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9848f, 1.0000f, 0.6398f, 0.7224f, 0.8643f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9457f, 0.9860f, 1.0000f, 0.7062f, 0.6776f, 0.3793f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9709f, 0.9926f, 1.0000f, 0.6455f, 0.6093f, 0.2651f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8467f, 0.9265f, 1.0000f, 0.1066f, 0.2089f, 0.1762f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9062f, 0.9314f, 0.9622f, 1.0000f, 0.3263f, 0.0000f, 0.4242f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9684f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9578f, 0.9940f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9175f, 0.9677f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9161f, 0.9372f, 0.8867f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8299f, 0.8797f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8323f, 0.7413f, 0.5665f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8917f, 0.9715f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9495f, 0.9852f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8491f, 0.8088f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8622f, 0.8900f, 0.8197f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8683f, 0.7659f, 0.3625f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7522f, 0.6725f, 0.2412f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9703f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9016f, 0.9426f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8779f, 0.9447f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7592f, 0.7852f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9885f,
- 1.0000f, 0.7820f, 0.8558f, 0.3060f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9909f,
- 1.0000f, 0.8396f, 0.4941f, 0.0653f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9436f, 0.9738f,
- 1.0000f, 0.5503f, 0.2856f, 0.1425f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9513f, 0.9798f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9968f, 0.9992f, 0.9977f, 1.0000f, 0.7945f, 0.6278f, 0.7185f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9990f, 0.9998f, 0.9636f, 1.0000f, 0.6672f, 0.7339f, 0.7692f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9794f, 0.9918f, 0.9871f, 1.0000f, 0.4107f, 0.8884f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9505f, 0.9749f, 0.8741f, 1.0000f, 0.6512f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8951f, 0.7975f, 0.8833f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8116f, 0.8815f, 0.9119f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9978f, 0.9907f, 0.9228f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9995f, 0.9844f, 0.9696f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9600f, 0.7883f, 0.8850f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9383f, 0.9563f, 0.8444f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4499f, 0.6826f, 0.9032f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5238f, 0.9290f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9808f, 0.9875f, 0.9690f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9585f, 0.9726f, 0.8372f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5745f, 0.7757f, 0.9615f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 1.0000f,
- 1.0000f, 0.7264f, 0.8984f, 0.9349f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9998f,
- 1.0000f, 0.3446f, 0.8580f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9826f, 0.9901f, 0.9949f,
- 1.0000f, 0.6566f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9912f, 0.9953f, 0.9147f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8143f, 0.8663f, 0.9105f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9980f, 1.0000f,
- 1.0000f, 0.9486f, 0.8033f, 0.8420f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9987f,
- 1.0000f, 0.4726f, 0.8536f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9986f, 0.9994f, 0.9923f,
- 1.0000f, 0.6338f, 0.8934f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9991f, 0.9467f,
- 1.0000f, 0.5047f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9835f, 0.9856f, 0.9629f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9607f, 0.9743f, 0.7914f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9789f, 0.9895f, 1.0000f, 0.9253f, 0.8601f, 0.8004f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9976f, 0.9888f, 0.9955f, 1.0000f, 0.9522f, 0.7557f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9904f, 0.9530f, 0.9188f, 1.0000f, 0.9547f, 0.9938f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9759f, 0.9302f, 0.4614f, 1.0000f, 0.7104f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9764f, 0.9091f, 0.6875f, 1.0000f, 0.9000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9593f, 0.7301f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9754f, 0.9812f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9784f, 0.9817f, 0.9405f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9769f, 0.8170f, 0.4834f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8967f, 0.6972f, 0.5585f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9822f, 0.6924f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9077f, 0.9215f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9830f, 0.9643f, 0.9278f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9664f, 0.9415f, 0.6156f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9981f,
- 1.0000f, 0.9539f, 0.6030f, 0.8249f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f, 0.9983f,
- 1.0000f, 0.8703f, 0.3956f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9993f,
- 1.0000f, 0.9555f, 0.9928f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9732f, 0.9898f,
- 1.0000f, 0.7018f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9970f, 0.9951f, 0.9966f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9779f, 0.9337f, 0.7145f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9959f, 0.9974f,
- 1.0000f, 0.9671f, 0.8760f, 0.6619f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9963f, 0.9965f,
- 1.0000f, 0.9477f, 0.5146f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9971f, 0.9982f,
- 1.0000f, 0.8061f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9931f, 0.9920f, 0.9915f,
- 1.0000f, 0.9570f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9943f, 0.9891f, 0.9657f,
- 1.0000f, 0.9360f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9947f, 0.9774f, 0.8274f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9867f, 0.8223f, 0.5420f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9803f, 0.7789f, 0.7626f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4376f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7376f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7725f, 0.6217f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5894f, 0.9936f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5821f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9996f, 0.9994f,
- 1.0000f, 0.9047f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 1.0000f, 0.9933f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9973f, 0.9997f, 0.9979f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9957f, 0.9997f, 0.9721f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9945f, 0.9394f, 0.8348f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9863f, 0.9326f, 0.9241f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9989f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9882f, 0.9990f, 0.9961f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9878f, 0.9999f, 0.9202f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9133f, 0.5329f, 0.9650f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8514f, 0.7450f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8722f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9839f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_8x5[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6120f, 0.7696f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9884f, 1.0000f, 0.6510f, 0.7169f, 0.8592f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9559f, 0.9917f, 1.0000f, 0.7477f, 0.7506f, 0.4645f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9756f, 0.9915f, 1.0000f, 0.6919f, 0.7135f, 0.4257f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8997f, 0.9452f, 1.0000f, 0.6803f, 0.3829f, 0.3319f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9256f, 0.9644f, 0.9682f, 1.0000f, 0.6067f, 0.1057f, 0.6598f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.7850f, 0.9046f, 1.0000f, 0.0406f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8524f, 0.7722f, 0.6420f, 1.0000f, 0.1579f, 0.2461f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9765f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9751f, 0.9971f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9301f, 0.9847f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9265f, 0.9518f, 0.9058f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8641f, 0.8673f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8324f, 0.7774f, 0.5302f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8959f, 0.7589f, 0.5644f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7669f, 0.6465f, 0.2254f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9092f, 0.9809f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9638f, 0.9866f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8880f, 0.8455f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8985f, 0.9168f, 0.8735f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8972f, 0.8142f, 0.3585f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7748f, 0.6956f, 0.2776f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9946f,
- 1.0000f, 0.8225f, 0.3945f, 0.0782f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9511f,
- 1.0000f, 0.7299f, 0.2913f, 0.4359f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9609f, 0.9655f,
- 1.0000f, 1.0000f, 0.9158f, 0.9525f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9034f, 0.9437f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8285f, 0.8472f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9940f,
- 1.0000f, 0.8305f, 0.9081f, 0.3712f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9958f,
- 1.0000f, 0.8720f, 0.5899f, 0.1814f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9545f, 0.9931f,
- 1.0000f, 0.6172f, 0.3049f, 0.3185f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9869f, 0.9956f,
- 1.0000f, 0.7030f, 0.2045f, 0.2621f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9336f, 0.9660f,
- 1.0000f, 0.4456f, 0.1321f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9362f, 0.9237f, 0.9137f,
- 1.0000f, 0.9978f, 0.9994f, 0.9972f, 1.0000f, 0.7825f, 0.5958f, 0.7100f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9994f, 0.9999f, 0.9596f, 1.0000f, 0.6555f, 0.7235f, 0.7391f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9813f, 0.9900f, 0.9893f, 1.0000f, 0.5442f, 0.9489f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9474f, 0.9789f, 0.8657f, 1.0000f, 0.7800f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8689f, 0.8608f, 0.9371f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7989f, 0.9345f, 0.8894f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5509f, 0.7616f, 0.9413f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6224f, 0.9539f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9996f, 0.9910f, 0.9126f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9993f, 0.9777f, 0.9677f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9742f, 0.8184f, 0.9022f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9496f, 0.9666f, 0.8766f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4904f, 0.8344f, 0.8907f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6722f, 0.9649f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4988f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7966f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9828f, 0.9836f, 0.9737f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9571f, 0.9708f, 0.8363f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6326f, 0.8400f, 0.9797f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 1.0000f,
- 1.0000f, 0.8011f, 0.9199f, 0.9627f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9997f,
- 1.0000f, 0.5227f, 0.8704f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9981f, 0.9998f, 0.9998f,
- 1.0000f, 0.7449f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 1.0000f, 0.9879f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9603f, 0.9773f, 0.9246f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9933f, 0.9793f, 0.8558f,
- 1.0000f, 0.8034f, 0.8795f, 0.9148f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 1.0000f,
- 1.0000f, 0.9444f, 0.8099f, 0.8245f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f,
- 1.0000f, 0.5775f, 0.9010f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9992f, 0.9890f,
- 1.0000f, 0.7330f, 0.9353f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9989f, 0.9208f,
- 1.0000f, 0.5577f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9843f, 0.9953f, 0.9850f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9552f, 0.9863f, 0.8838f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9698f, 0.8056f, 0.8121f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9503f, 0.9189f, 0.8205f,
- 1.0000f, 1.0000f, 0.9873f, 0.9857f, 1.0000f, 0.9178f, 0.8507f, 0.8382f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9970f, 0.9922f, 0.9983f, 1.0000f, 0.9621f, 0.7420f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9903f, 0.9578f, 0.9388f, 1.0000f, 0.9615f, 0.9935f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9703f, 0.9327f, 0.4553f, 1.0000f, 0.7920f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9718f, 0.8265f, 0.4155f, 1.0000f, 0.9584f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8853f, 0.5373f, 0.9948f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9747f, 0.7943f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9227f, 0.9274f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9840f, 0.9854f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9713f, 0.9944f, 0.9565f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9801f, 0.8419f, 0.5070f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8867f, 0.7361f, 0.5839f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9429f, 0.4051f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7897f, 0.6993f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9805f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8489f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9785f, 0.9824f, 0.9532f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9832f, 0.9590f, 0.6880f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f,
- 1.0000f, 0.9723f, 0.7066f, 0.8625f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 0.9993f,
- 1.0000f, 0.8947f, 0.4734f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9963f, 0.9980f,
- 1.0000f, 0.9115f, 0.9459f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9926f, 0.9967f,
- 1.0000f, 0.4820f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9969f, 0.9990f,
- 1.0000f, 0.9466f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9781f, 0.9898f,
- 1.0000f, 0.9961f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9733f, 0.9905f, 0.9821f,
- 1.0000f, 0.9769f, 0.9379f, 0.7643f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9951f, 0.9982f,
- 1.0000f, 0.9671f, 0.8810f, 0.7267f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9976f, 0.9924f,
- 1.0000f, 0.9632f, 0.6014f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9887f, 0.9977f,
- 1.0000f, 0.8751f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9966f, 0.9920f, 0.9913f,
- 1.0000f, 0.9104f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9960f, 0.9895f, 0.9481f,
- 1.0000f, 0.7561f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9876f, 0.9693f, 0.6275f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9936f, 0.9688f, 0.8934f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9817f, 0.9283f, 0.9318f,
- 1.0000f, 0.9942f, 0.8437f, 0.5710f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9882f, 0.8163f, 0.7874f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3452f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7203f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8078f, 0.6763f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6681f, 0.9964f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6640f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9986f, 0.9984f,
- 1.0000f, 0.9292f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9974f, 0.9999f, 0.9908f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9955f, 0.9991f, 0.9988f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9938f, 1.0000f, 0.9760f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f, 0.9069f, 0.7534f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9949f, 0.8824f, 0.9421f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9396f, 0.8921f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8575f, 0.9929f, 1.0000f,
- 1.0000f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9728f, 0.9990f, 0.9986f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9860f, 1.0000f, 0.8781f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9218f, 0.5149f, 0.9405f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8541f, 0.6842f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6374f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9309f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_8x6[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6348f, 0.7860f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8285f, 0.9042f,
- 1.0000f, 1.0000f, 1.0000f, 0.9940f, 1.0000f, 0.6847f, 0.7223f, 0.8700f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7983f, 0.9615f,
- 1.0000f, 1.0000f, 0.9487f, 0.9920f, 1.0000f, 0.7690f, 0.7645f, 0.4879f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8948f, 0.8713f,
- 1.0000f, 1.0000f, 0.9808f, 0.9956f, 1.0000f, 0.6912f, 0.7029f, 0.4162f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9254f, 0.9272f, 0.9100f,
- 1.0000f, 1.0000f, 0.9263f, 0.9493f, 1.0000f, 0.7141f, 0.4679f, 0.4243f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9081f, 0.8499f, 0.5771f,
- 1.0000f, 0.9382f, 0.9724f, 0.9625f, 1.0000f, 0.6704f, 0.2426f, 0.8042f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7798f, 0.8117f, 0.3822f,
- 1.0000f, 1.0000f, 0.8969f, 0.9011f, 1.0000f, 0.6075f, 0.0672f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8203f, 0.5325f, 0.1476f,
- 1.0000f, 0.8857f, 0.7943f, 0.5976f, 1.0000f, 0.3069f, 0.5075f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7599f, 0.3735f, 0.4746f,
- 1.0000f, 1.0000f, 1.0000f, 0.9801f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9845f, 0.9983f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9469f, 0.9779f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9397f, 0.9546f, 0.8787f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8774f, 0.8991f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8555f, 0.8022f, 0.5612f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9128f, 0.7623f, 0.5264f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7776f, 0.6470f, 0.2700f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9338f, 0.9885f, 0.7429f, 1.0000f, 1.0000f, 1.0000f, 0.1977f, 1.0000f, 1.0000f, 1.0000f, 0.5823f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9716f, 0.9912f, 0.4944f, 1.0000f, 1.0000f, 1.0000f, 0.1297f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8980f, 0.8410f, 0.5386f, 1.0000f, 1.0000f, 1.0000f, 0.0899f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9109f, 0.9322f, 0.8569f, 0.2287f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9219f, 0.8348f, 0.3994f, 0.0352f, 1.0000f, 1.0000f, 1.0000f, 0.4610f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8003f, 0.7327f, 0.3909f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9937f,
- 1.0000f, 0.8528f, 0.4078f, 0.1113f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9905f,
- 1.0000f, 0.7249f, 0.2834f, 0.4398f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9907f, 0.9974f,
- 1.0000f, 1.0000f, 0.9361f, 0.9707f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9353f, 0.9529f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8169f, 0.8394f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9945f,
- 1.0000f, 0.8470f, 0.8925f, 0.3268f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f,
- 1.0000f, 0.8903f, 0.6510f, 0.2565f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9698f, 0.9948f,
- 1.0000f, 0.6741f, 0.3553f, 0.4470f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9914f, 0.9957f,
- 1.0000f, 0.7196f, 0.1815f, 0.2957f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9463f, 0.9872f,
- 1.0000f, 0.5503f, 0.1651f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9594f, 0.9600f, 0.9183f,
- 1.0000f, 0.9981f, 0.9993f, 0.9973f, 1.0000f, 0.7922f, 0.6124f, 0.6880f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9605f, 0.9689f, 0.9137f,
- 1.0000f, 0.9995f, 0.9998f, 0.9579f, 1.0000f, 0.6777f, 0.7000f, 0.7301f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9511f, 0.9430f, 0.6550f,
- 1.0000f, 0.9736f, 0.9870f, 0.9827f, 1.0000f, 0.5926f, 0.9517f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7169f, 0.6971f, 0.9410f,
- 1.0000f, 0.9306f, 0.9752f, 0.8316f, 1.0000f, 0.7819f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7881f, 0.8799f, 0.9720f,
- 1.0000f, 0.8762f, 0.8725f, 0.9568f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5139f, 0.9443f, 1.0000f,
- 1.0000f, 0.8134f, 0.9505f, 0.9022f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7454f, 1.0000f, 1.0000f,
- 1.0000f, 0.5445f, 0.8687f, 0.9246f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7085f, 0.9775f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9997f, 0.9926f, 0.9071f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9994f, 0.9836f, 0.9636f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9666f, 0.7840f, 0.8750f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9437f, 0.9589f, 0.8846f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5010f, 0.8914f, 0.9237f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7353f, 0.9848f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6666f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7712f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9853f, 0.9856f, 0.9685f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9646f, 0.9794f, 0.8363f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6430f, 0.8455f, 0.9740f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 1.0000f,
- 1.0000f, 0.7963f, 0.9201f, 0.9620f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9996f,
- 1.0000f, 0.6307f, 0.9061f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f, 0.9999f, 0.9996f,
- 1.0000f, 0.8379f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9998f, 0.9883f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9969f, 0.9928f, 0.9703f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9951f, 0.9656f,
- 1.0000f, 0.8219f, 0.8738f, 0.9289f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 1.0000f,
- 1.0000f, 0.9631f, 0.8080f, 0.8582f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f,
- 1.0000f, 0.5874f, 0.9174f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9992f, 0.9768f,
- 1.0000f, 0.7552f, 0.9297f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9980f, 0.8881f,
- 1.0000f, 0.6589f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9824f, 0.9962f, 0.9895f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9535f, 0.9862f, 0.9032f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9744f, 0.8268f, 0.8937f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9562f, 0.9694f, 0.9210f,
- 1.0000f, 1.0000f, 0.9818f, 0.9787f, 1.0000f, 0.9403f, 0.8649f, 0.8332f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9814f, 0.9821f, 0.9764f,
- 1.0000f, 0.9979f, 0.9867f, 0.9976f, 1.0000f, 0.9573f, 0.7755f, 0.9998f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9888f, 0.9811f, 0.9090f,
- 1.0000f, 0.9953f, 0.9417f, 0.9001f, 1.0000f, 0.9680f, 0.9935f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9842f, 0.9390f, 0.9898f,
- 1.0000f, 0.9783f, 0.9165f, 0.3171f, 1.0000f, 0.8236f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9748f, 0.8440f, 1.0000f,
- 1.0000f, 0.9641f, 0.8061f, 0.3646f, 1.0000f, 0.9584f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9499f, 0.9878f, 1.0000f,
- 1.0000f, 0.8596f, 0.5202f, 0.9982f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8675f, 1.0000f, 1.0000f,
- 1.0000f, 0.9424f, 0.5558f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9551f, 1.0000f, 1.0000f,
- 1.0000f, 0.8252f, 0.8098f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9916f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9890f, 0.9947f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9902f, 0.9924f, 0.9712f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9790f, 0.8151f, 0.4541f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9147f, 0.7504f, 0.6026f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9346f, 0.3459f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7528f, 0.6171f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9368f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5718f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9760f, 0.9859f, 0.9651f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9772f, 0.9756f, 0.7479f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9972f,
- 1.0000f, 0.9728f, 0.7114f, 0.9052f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9986f,
- 1.0000f, 0.9156f, 0.4322f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9966f, 0.9959f,
- 1.0000f, 0.9280f, 0.9330f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9909f, 0.9963f,
- 1.0000f, 0.4814f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f, 0.9984f, 1.0000f,
- 1.0000f, 0.9192f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9864f, 0.9954f,
- 1.0000f, 0.9481f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9900f, 0.9971f, 0.9833f,
- 1.0000f, 0.9805f, 0.9456f, 0.8301f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9960f, 0.9992f,
- 1.0000f, 0.9732f, 0.9119f, 0.7902f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9967f, 0.9851f,
- 1.0000f, 0.9661f, 0.6627f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9893f, 0.9978f,
- 1.0000f, 0.8869f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9931f, 0.9918f, 0.9880f,
- 1.0000f, 0.8959f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9933f, 0.9540f, 0.9675f,
- 1.0000f, 0.6941f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9830f, 0.9557f, 0.6218f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9939f, 0.9314f, 0.7057f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9523f, 0.8636f, 0.8425f,
- 1.0000f, 0.9930f, 0.8822f, 0.6389f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8662f, 1.0000f, 1.0000f,
- 1.0000f, 0.9922f, 0.8810f, 0.8485f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9450f, 1.0000f, 1.0000f,
- 1.0000f, 0.2138f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6813f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8622f, 0.7379f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7275f, 0.9988f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7734f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f, 0.9990f, 0.9986f,
- 1.0000f, 0.9670f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 1.0000f, 0.9875f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9942f, 0.9991f, 0.9990f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9944f, 0.9999f, 0.9475f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 0.9228f, 0.7576f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9950f, 0.8892f, 0.9610f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8609f, 0.8186f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7668f, 0.9985f, 1.0000f,
- 1.0000f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9798f, 0.9999f, 0.9964f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9839f, 1.0000f, 0.9375f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8542f, 0.3364f, 0.8834f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7404f, 0.6265f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5665f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8514f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_8x8[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6539f, 0.8057f, 1.0000f, 1.0000f, 0.8190f, 0.8664f, 1.0000f, 1.0000f, 0.9665f, 0.9926f,
- 1.0000f, 1.0000f, 1.0000f, 0.9969f, 1.0000f, 0.7563f, 0.7444f, 0.8563f, 1.0000f, 0.8161f, 0.8706f, 0.8925f, 1.0000f, 1.0000f, 0.9863f, 0.9956f,
- 1.0000f, 1.0000f, 0.9786f, 0.9960f, 1.0000f, 0.8529f, 0.8117f, 0.5924f, 1.0000f, 0.9100f, 0.8609f, 0.6746f, 1.0000f, 1.0000f, 0.9382f, 0.8726f,
- 1.0000f, 1.0000f, 0.9941f, 0.9942f, 1.0000f, 0.7543f, 0.7979f, 0.4968f, 1.0000f, 0.8368f, 0.8493f, 0.5366f, 1.0000f, 0.9476f, 0.9487f, 0.9213f,
- 1.0000f, 1.0000f, 0.9326f, 0.9588f, 1.0000f, 0.7205f, 0.6146f, 0.5412f, 1.0000f, 0.7849f, 0.6074f, 0.3232f, 1.0000f, 0.9498f, 0.8642f, 0.5125f,
- 1.0000f, 0.9562f, 0.9712f, 0.9698f, 1.0000f, 0.7113f, 0.3712f, 0.9158f, 1.0000f, 0.7947f, 0.2448f, 0.9190f, 1.0000f, 0.8456f, 0.8102f, 0.4805f,
- 1.0000f, 1.0000f, 0.8795f, 0.8987f, 1.0000f, 0.6447f, 0.1531f, 1.0000f, 1.0000f, 0.7065f, 0.0985f, 1.0000f, 1.0000f, 0.8736f, 0.4914f, 0.1851f,
- 1.0000f, 0.8907f, 0.8010f, 0.5802f, 1.0000f, 0.5176f, 0.6629f, 1.0000f, 1.0000f, 0.4582f, 0.6110f, 1.0000f, 1.0000f, 0.7602f, 0.3314f, 0.5590f,
- 1.0000f, 1.0000f, 1.0000f, 0.9792f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9762f, 0.9823f,
- 1.0000f, 1.0000f, 0.9932f, 0.9990f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9638f, 0.9661f,
- 1.0000f, 1.0000f, 0.9723f, 0.9817f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8969f, 0.9198f,
- 1.0000f, 0.9642f, 0.9743f, 0.9091f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9040f, 0.9332f, 0.5633f,
- 1.0000f, 1.0000f, 0.9022f, 0.9221f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9313f, 0.7040f, 0.2718f,
- 1.0000f, 0.8716f, 0.8219f, 0.5843f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6991f, 0.4215f, 0.5021f,
- 1.0000f, 0.9376f, 0.7749f, 0.5457f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8072f, 0.2258f, 0.3938f,
- 1.0000f, 0.7882f, 0.6802f, 0.3150f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6250f, 0.2059f, 1.0000f,
- 1.0000f, 1.0000f, 0.9626f, 0.9968f, 0.7963f, 1.0000f, 1.0000f, 1.0000f, 0.1272f, 1.0000f, 1.0000f, 1.0000f, 0.4638f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9916f, 0.9966f, 0.5502f, 1.0000f, 1.0000f, 1.0000f, 0.1745f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9345f, 0.8852f, 0.6478f, 1.0000f, 1.0000f, 1.0000f, 0.1132f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9523f, 0.9613f, 0.8943f, 0.2981f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9459f, 0.8916f, 0.4694f, 0.6417f, 1.0000f, 1.0000f, 1.0000f, 0.6216f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8176f, 0.8132f, 0.4860f, 0.0667f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f,
- 1.0000f, 0.8843f, 0.5074f, 0.2159f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9914f,
- 1.0000f, 0.7714f, 0.3556f, 0.5719f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9919f, 0.9989f,
- 1.0000f, 1.0000f, 0.9657f, 0.9848f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9705f, 0.9548f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8653f, 0.8815f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9874f,
- 1.0000f, 0.9057f, 0.9228f, 0.4750f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9983f,
- 1.0000f, 0.9258f, 0.7361f, 0.3476f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9806f, 0.9961f,
- 1.0000f, 0.7228f, 0.4080f, 0.6037f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9933f, 0.9939f,
- 1.0000f, 0.7766f, 0.2539f, 0.4468f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9694f, 0.9909f,
- 1.0000f, 0.6569f, 0.3635f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9709f, 0.9843f, 0.8996f,
- 1.0000f, 0.9990f, 0.9988f, 0.9974f, 1.0000f, 0.7732f, 0.5884f, 0.7136f, 1.0000f, 0.8766f, 0.7273f, 0.7382f, 1.0000f, 0.9927f, 0.9959f, 0.9846f,
- 1.0000f, 0.9998f, 0.9994f, 0.9592f, 1.0000f, 0.6600f, 0.6913f, 0.7403f, 1.0000f, 0.7931f, 0.7339f, 0.7464f, 1.0000f, 0.9809f, 0.9904f, 0.8674f,
- 1.0000f, 0.9634f, 0.9833f, 0.9780f, 1.0000f, 0.6317f, 0.9605f, 1.0000f, 1.0000f, 0.6000f, 0.9691f, 1.0000f, 1.0000f, 0.7296f, 0.8695f, 0.9889f,
- 1.0000f, 0.9265f, 0.9684f, 0.8394f, 1.0000f, 0.8342f, 1.0000f, 1.0000f, 1.0000f, 0.7914f, 1.0000f, 1.0000f, 1.0000f, 0.8552f, 0.9492f, 0.9841f,
- 1.0000f, 0.8468f, 0.8233f, 0.9465f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6858f, 0.9236f, 1.0000f,
- 1.0000f, 0.7816f, 0.9436f, 0.8598f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8685f, 1.0000f, 1.0000f,
- 1.0000f, 0.4279f, 0.8898f, 0.9430f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7484f, 0.9759f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9998f, 0.9944f, 0.9279f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9133f, 0.9370f, 0.9401f,
- 1.0000f, 0.9998f, 0.9853f, 0.9719f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9828f, 0.8978f, 0.8870f,
- 1.0000f, 0.9654f, 0.8275f, 0.9049f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6659f, 0.9125f, 1.0000f,
- 1.0000f, 0.9543f, 0.9702f, 0.9320f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8247f, 0.9680f, 1.0000f,
- 1.0000f, 0.4342f, 0.9083f, 0.9448f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7898f, 1.0000f, 1.0000f,
- 1.0000f, 0.7523f, 0.9851f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7159f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7621f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9887f, 0.9883f, 0.9716f, 0.6774f, 1.0000f, 1.0000f, 1.0000f, 0.0827f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9740f, 0.9771f, 0.8586f, 0.2894f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7016f, 0.8776f, 0.9858f, 0.6509f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f,
- 1.0000f, 0.8419f, 0.9442f, 0.9768f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f,
- 1.0000f, 0.7089f, 0.9272f, 1.0000f, 0.3396f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9999f, 0.9986f,
- 1.0000f, 0.9031f, 1.0000f, 1.0000f, 0.2806f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9996f, 0.9676f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 0.9955f, 0.9538f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9900f, 0.9726f,
- 1.0000f, 0.8328f, 0.8756f, 0.9117f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 0.9557f, 0.8147f, 0.8540f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f,
- 1.0000f, 0.6351f, 0.9388f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9980f, 0.9971f, 0.9579f,
- 1.0000f, 0.8355f, 0.9618f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9951f, 0.8381f,
- 1.0000f, 0.7696f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9630f, 0.9870f, 0.9867f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9306f, 0.9646f, 0.8288f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9736f, 0.8205f, 0.9108f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9553f, 0.9650f, 0.9293f,
- 1.0000f, 1.0000f, 0.9876f, 0.9872f, 1.0000f, 0.9596f, 0.8879f, 0.8431f, 1.0000f, 0.9601f, 0.9687f, 0.8805f, 1.0000f, 0.9907f, 0.9746f, 0.9831f,
- 1.0000f, 0.9992f, 0.9938f, 0.9985f, 1.0000f, 0.9339f, 0.8026f, 0.9997f, 1.0000f, 0.9753f, 0.9166f, 1.0000f, 1.0000f, 0.9893f, 0.9936f, 0.7783f,
- 1.0000f, 0.9947f, 0.9407f, 0.9358f, 1.0000f, 0.9798f, 0.9983f, 1.0000f, 1.0000f, 0.9783f, 0.9897f, 1.0000f, 1.0000f, 0.9825f, 0.8261f, 0.9503f,
- 1.0000f, 0.9812f, 0.9413f, 0.4405f, 1.0000f, 0.8824f, 1.0000f, 1.0000f, 1.0000f, 0.9528f, 1.0000f, 1.0000f, 1.0000f, 0.9351f, 0.5546f, 1.0000f,
- 1.0000f, 0.9820f, 0.7995f, 0.1638f, 1.0000f, 0.9508f, 1.0000f, 1.0000f, 1.0000f, 0.9777f, 1.0000f, 1.0000f, 1.0000f, 0.8934f, 0.8785f, 1.0000f,
- 1.0000f, 0.8620f, 0.4525f, 0.9899f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5320f, 1.0000f, 1.0000f,
- 1.0000f, 0.9570f, 0.3789f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8575f, 1.0000f, 1.0000f,
- 1.0000f, 0.7658f, 0.5225f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8406f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9930f, 0.9978f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9895f, 0.9789f, 0.8960f,
- 1.0000f, 0.9913f, 0.9935f, 0.9948f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9774f, 0.9583f, 0.8087f,
- 1.0000f, 0.9865f, 0.9066f, 0.5677f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9733f, 0.7677f, 1.0000f,
- 1.0000f, 0.9300f, 0.8444f, 0.7640f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9174f, 1.0000f, 1.0000f,
- 1.0000f, 0.9673f, 0.4010f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9250f, 1.0000f, 1.0000f,
- 1.0000f, 0.7799f, 0.6284f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6718f, 1.0000f, 1.0000f,
- 1.0000f, 0.9150f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3864f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9803f, 0.9856f, 0.9765f, 0.6966f, 1.0000f, 1.0000f, 1.0000f, 0.5963f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9838f, 0.9801f, 0.8833f, 0.0503f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9929f,
- 1.0000f, 0.9669f, 0.8042f, 0.9814f, 0.3067f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9972f,
- 1.0000f, 0.9518f, 0.6181f, 1.0000f, 0.2356f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9973f,
- 1.0000f, 0.9206f, 0.9182f, 1.0000f, 0.0271f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9957f, 0.9976f,
- 1.0000f, 0.5761f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9979f, 0.9991f,
- 1.0000f, 0.8952f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9952f, 0.9970f,
- 1.0000f, 0.8315f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9836f, 0.9924f, 0.9891f,
- 1.0000f, 0.9749f, 0.9566f, 0.8746f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 0.9984f,
- 1.0000f, 0.9918f, 0.9364f, 0.8631f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9953f, 0.9945f,
- 1.0000f, 0.9795f, 0.7318f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9881f, 0.9902f,
- 1.0000f, 0.9454f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9921f, 0.9609f, 0.9860f,
- 1.0000f, 0.9424f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f, 0.9471f, 0.9286f,
- 1.0000f, 0.6940f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9756f, 0.9394f, 0.4148f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9963f, 0.9243f, 0.6384f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9418f, 0.7866f, 0.7251f,
- 1.0000f, 0.9982f, 0.9513f, 0.7424f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7182f, 1.0000f, 1.0000f,
- 1.0000f, 0.9962f, 0.9482f, 0.9729f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9575f, 1.0000f, 1.0000f,
- 1.0000f, 0.1408f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6689f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9533f, 0.9141f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8861f, 0.9996f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9005f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9999f, 0.9967f,
- 1.0000f, 0.9949f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f, 0.9993f, 0.9975f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9922f, 0.9999f, 0.9981f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9911f, 1.0000f, 0.8889f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f, 0.9014f, 0.6886f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9885f, 0.8505f, 0.9074f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8481f, 0.7832f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7582f, 0.9994f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9906f, 0.9997f, 0.9985f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9879f, 1.0000f, 0.9622f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8302f, 0.2629f, 0.8517f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7504f, 0.5273f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1955f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6830f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_8x10[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8029f, 0.8183f, 1.0000f, 1.0000f, 0.9742f, 0.9767f, 1.0000f, 1.0000f, 0.9905f, 0.9983f,
- 1.0000f, 1.0000f, 1.0000f, 0.9980f, 1.0000f, 0.7921f, 0.8421f, 0.8718f, 1.0000f, 0.9775f, 0.9700f, 0.9587f, 1.0000f, 1.0000f, 0.9598f, 0.9960f,
- 1.0000f, 1.0000f, 0.9851f, 0.9976f, 1.0000f, 0.9128f, 0.9270f, 0.5965f, 1.0000f, 0.9576f, 0.9361f, 0.6235f, 1.0000f, 1.0000f, 0.9553f, 0.8776f,
- 1.0000f, 1.0000f, 0.9891f, 0.9934f, 1.0000f, 0.8587f, 0.8324f, 0.4406f, 1.0000f, 0.9156f, 0.8737f, 0.5514f, 1.0000f, 0.9684f, 0.9671f, 0.8883f,
- 1.0000f, 1.0000f, 0.9750f, 0.9595f, 1.0000f, 0.8490f, 0.7375f, 0.5859f, 1.0000f, 0.9053f, 0.6035f, 0.5065f, 1.0000f, 0.9668f, 0.9014f, 0.4294f,
- 1.0000f, 0.9764f, 0.9914f, 0.9819f, 1.0000f, 0.8866f, 0.4180f, 0.8958f, 1.0000f, 0.8875f, 0.1874f, 0.8248f, 1.0000f, 0.8998f, 0.8468f, 0.4064f,
- 1.0000f, 1.0000f, 0.9322f, 0.8785f, 1.0000f, 0.7309f, 0.2514f, 1.0000f, 1.0000f, 0.8512f, 0.0364f, 1.0000f, 1.0000f, 0.9233f, 0.5297f, 0.1973f,
- 1.0000f, 0.9221f, 0.8143f, 0.4872f, 1.0000f, 0.6655f, 0.7173f, 1.0000f, 1.0000f, 0.5017f, 0.4773f, 1.0000f, 1.0000f, 0.8618f, 0.2848f, 0.4723f,
- 1.0000f, 1.0000f, 1.0000f, 0.9927f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9644f, 0.9099f, 1.0000f, 1.0000f, 0.9884f, 0.9874f,
- 1.0000f, 1.0000f, 0.9948f, 0.9953f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9661f, 0.9616f, 0.9121f, 1.0000f, 1.0000f, 0.9634f, 0.9756f,
- 1.0000f, 1.0000f, 0.9733f, 0.9946f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9459f, 0.8804f, 0.5593f, 1.0000f, 1.0000f, 0.9436f, 0.9328f,
- 1.0000f, 0.9718f, 0.9917f, 0.9038f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8925f, 0.5749f, 0.4969f, 1.0000f, 0.9606f, 0.9630f, 0.6103f,
- 1.0000f, 1.0000f, 0.9440f, 0.9468f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8892f, 0.2768f, 0.7770f, 1.0000f, 0.9674f, 0.8209f, 0.4515f,
- 1.0000f, 0.9691f, 0.8813f, 0.6847f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7242f, 0.2250f, 1.0000f, 1.0000f, 0.8156f, 0.4620f, 0.6569f,
- 1.0000f, 0.9569f, 0.8545f, 0.5473f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7265f, 0.1574f, 1.0000f, 1.0000f, 0.8747f, 0.3429f, 0.5251f,
- 1.0000f, 0.8917f, 0.7102f, 0.3149f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2067f, 1.0000f, 1.0000f, 1.0000f, 0.7788f, 0.4351f, 1.0000f,
- 1.0000f, 1.0000f, 0.9703f, 0.9956f, 0.8934f, 1.0000f, 1.0000f, 1.0000f, 0.1472f, 1.0000f, 0.7219f, 0.7999f, 0.5341f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9893f, 0.9975f, 0.6766f, 1.0000f, 1.0000f, 1.0000f, 0.2599f, 0.7053f, 0.7889f, 0.7353f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9609f, 0.9149f, 0.7621f, 1.0000f, 1.0000f, 1.0000f, 0.1368f, 0.8577f, 0.7460f, 0.3756f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9658f, 0.9627f, 0.9022f, 0.4004f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8727f, 0.6202f, 0.6451f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9561f, 0.9246f, 0.5895f, 0.7541f, 1.0000f, 1.0000f, 1.0000f, 0.6683f, 0.7640f, 0.1675f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9240f, 0.9077f, 0.6001f, 0.1155f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6298f, 0.7003f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f,
- 1.0000f, 0.9195f, 0.5786f, 0.2998f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7287f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9961f,
- 1.0000f, 0.8974f, 0.3820f, 0.6329f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0921f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9965f, 0.9999f,
- 1.0000f, 1.0000f, 0.9591f, 0.9780f, 0.0790f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9772f, 0.9454f, 0.5930f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9294f, 0.9046f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f,
- 1.0000f, 0.9499f, 0.9426f, 0.5112f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9963f,
- 1.0000f, 0.9486f, 0.8566f, 0.4568f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9868f, 0.9988f,
- 1.0000f, 0.8639f, 0.5205f, 0.6793f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9973f, 0.9911f,
- 1.0000f, 0.8849f, 0.3361f, 0.5633f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9849f, 0.9931f,
- 1.0000f, 0.7905f, 0.4237f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9816f, 0.9876f, 0.8698f,
- 1.0000f, 0.9989f, 0.9989f, 0.9988f, 1.0000f, 0.7937f, 0.5554f, 0.6900f, 1.0000f, 0.9371f, 0.8900f, 0.9311f, 1.0000f, 0.9919f, 0.9940f, 0.9786f,
- 1.0000f, 0.9999f, 0.9999f, 0.9753f, 1.0000f, 0.6421f, 0.6978f, 0.7439f, 1.0000f, 0.9030f, 0.9381f, 0.9584f, 1.0000f, 0.9715f, 0.9928f, 0.8669f,
- 1.0000f, 0.9565f, 0.9811f, 0.9730f, 1.0000f, 0.6169f, 0.9525f, 1.0000f, 1.0000f, 0.7678f, 0.9350f, 1.0000f, 1.0000f, 0.6820f, 0.8629f, 0.9620f,
- 1.0000f, 0.9107f, 0.9602f, 0.8299f, 1.0000f, 0.8044f, 1.0000f, 1.0000f, 1.0000f, 0.9189f, 1.0000f, 1.0000f, 1.0000f, 0.8287f, 0.9176f, 0.9853f,
- 1.0000f, 0.8966f, 0.8608f, 0.9759f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7126f, 0.9069f, 1.0000f,
- 1.0000f, 0.8337f, 0.9482f, 0.9412f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8261f, 1.0000f, 1.0000f,
- 1.0000f, 0.3221f, 0.7839f, 0.9339f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7150f, 0.9169f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9995f, 0.9920f, 0.9421f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7562f, 0.7331f, 0.9114f, 1.0000f, 0.9345f, 0.9529f, 0.9770f,
- 1.0000f, 0.9997f, 0.9897f, 0.9678f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8058f, 0.8708f, 0.9904f, 1.0000f, 0.9938f, 0.9387f, 0.9778f,
- 1.0000f, 0.9681f, 0.8433f, 0.8991f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8349f, 1.0000f, 1.0000f, 1.0000f, 0.7753f, 0.9736f, 1.0000f,
- 1.0000f, 0.9613f, 0.9623f, 0.9508f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9317f, 0.9888f, 1.0000f,
- 1.0000f, 0.4921f, 0.9355f, 0.9739f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8222f, 1.0000f, 1.0000f,
- 1.0000f, 0.8235f, 0.9872f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7805f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7873f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9857f, 0.9886f, 0.9654f, 0.7953f, 1.0000f, 1.0000f, 1.0000f, 0.1775f, 0.5710f, 0.6069f, 0.9796f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9804f, 0.9862f, 0.8766f, 0.4122f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5823f, 0.8115f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7581f, 0.8840f, 0.9909f, 0.8087f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 1.0000f,
- 1.0000f, 0.8409f, 0.9431f, 0.9835f, 0.0191f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f,
- 1.0000f, 0.8014f, 0.9521f, 1.0000f, 0.5430f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9996f, 0.9978f,
- 1.0000f, 0.9366f, 1.0000f, 1.0000f, 0.3074f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9402f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9900f, 0.9084f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9986f, 0.9806f, 0.9464f,
- 1.0000f, 0.8397f, 0.8942f, 0.9202f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 1.0000f,
- 1.0000f, 0.9557f, 0.8101f, 0.8822f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6598f, 0.9392f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9943f, 0.9572f,
- 1.0000f, 0.8386f, 0.9648f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9955f, 0.8170f,
- 1.0000f, 0.8689f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9706f, 0.9846f, 0.9860f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9061f, 0.9855f, 0.8445f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9397f, 0.7659f, 0.8534f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9258f, 0.9512f, 0.9162f,
- 1.0000f, 1.0000f, 0.9991f, 0.9992f, 1.0000f, 0.9922f, 0.8479f, 0.7734f, 1.0000f, 0.9783f, 0.9724f, 0.8501f, 1.0000f, 0.9970f, 0.9930f, 0.9761f,
- 1.0000f, 0.9967f, 0.9997f, 0.9997f, 1.0000f, 0.9491f, 0.7418f, 1.0000f, 1.0000f, 0.9828f, 0.8456f, 1.0000f, 1.0000f, 0.9844f, 0.9944f, 0.7716f,
- 1.0000f, 0.9987f, 0.9954f, 0.9300f, 1.0000f, 0.9840f, 0.9978f, 1.0000f, 1.0000f, 0.9799f, 0.9687f, 1.0000f, 1.0000f, 0.9814f, 0.7697f, 0.8831f,
- 1.0000f, 0.9925f, 0.9694f, 0.4461f, 1.0000f, 0.8073f, 1.0000f, 1.0000f, 1.0000f, 0.7856f, 1.0000f, 1.0000f, 1.0000f, 0.9709f, 0.3497f, 1.0000f,
- 1.0000f, 0.9958f, 0.8598f, 0.2684f, 1.0000f, 0.9252f, 1.0000f, 1.0000f, 1.0000f, 0.8982f, 1.0000f, 1.0000f, 1.0000f, 0.9288f, 0.6711f, 1.0000f,
- 1.0000f, 0.9416f, 0.5159f, 0.9998f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3627f, 1.0000f, 1.0000f,
- 1.0000f, 0.9882f, 0.2341f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8555f, 1.0000f, 1.0000f,
- 1.0000f, 0.8129f, 0.3944f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6267f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9935f, 0.9981f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9912f, 0.9473f, 0.9974f, 1.0000f, 0.9977f, 0.9580f, 0.8659f,
- 1.0000f, 0.9981f, 0.9985f, 0.9947f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9824f, 0.8374f, 1.0000f, 1.0000f, 0.9890f, 0.9333f, 0.7396f,
- 1.0000f, 0.9979f, 0.9477f, 0.6391f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9712f, 1.0000f, 1.0000f, 1.0000f, 0.9916f, 0.6136f, 1.0000f,
- 1.0000f, 0.9533f, 0.8312f, 0.7521f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7984f, 1.0000f, 1.0000f, 1.0000f, 0.9305f, 1.0000f, 1.0000f,
- 1.0000f, 0.9826f, 0.4823f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9537f, 1.0000f, 1.0000f,
- 1.0000f, 0.9006f, 0.6627f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4672f, 1.0000f, 1.0000f,
- 1.0000f, 0.9516f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.2923f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9745f, 0.9788f, 0.9727f, 0.8196f, 1.0000f, 1.0000f, 1.0000f, 0.3882f, 0.9936f, 0.8950f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9949f, 0.9821f, 0.9276f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9641f, 0.9907f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f,
- 1.0000f, 0.9801f, 0.8361f, 0.9549f, 0.7028f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9651f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9747f, 1.0000f,
- 1.0000f, 0.9878f, 0.6360f, 1.0000f, 0.2159f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9866f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9962f, 0.9880f,
- 1.0000f, 0.9637f, 0.9227f, 1.0000f, 0.0654f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f, 0.9983f,
- 1.0000f, 0.6952f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9982f, 0.9991f,
- 1.0000f, 0.9208f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9971f,
- 1.0000f, 0.7969f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9966f, 0.9952f, 0.9495f,
- 1.0000f, 0.9959f, 0.9664f, 0.8523f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9990f, 0.9992f,
- 1.0000f, 0.9831f, 0.9182f, 0.8274f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f, 0.9957f,
- 1.0000f, 0.9870f, 0.7501f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9970f, 0.9996f,
- 1.0000f, 0.9092f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9902f, 0.9837f,
- 1.0000f, 0.9504f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9942f, 0.9895f, 0.9376f,
- 1.0000f, 0.7078f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9939f, 0.9809f, 0.3562f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9951f, 0.8909f, 0.3292f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9264f, 0.7196f, 0.5386f,
- 1.0000f, 0.9997f, 0.9794f, 0.8649f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6926f, 1.0000f, 1.0000f,
- 1.0000f, 0.9996f, 0.9450f, 0.9721f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9214f, 1.0000f, 1.0000f,
- 1.0000f, 0.2427f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6540f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9445f, 0.9545f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 1.0000f, 1.0000f,
- 1.0000f, 0.9282f, 0.9993f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8857f, 1.0000f, 1.0000f, 0.7480f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9969f, 0.9994f, 0.9986f,
- 1.0000f, 0.9791f, 1.0000f, 1.0000f, 0.1039f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9842f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0517f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9833f, 0.9984f, 0.9990f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9864f, 0.9998f, 0.8794f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9924f, 0.8679f, 0.6739f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9972f, 0.9142f, 0.9407f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7822f, 0.6874f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6511f, 0.9899f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9932f, 0.9994f, 0.9994f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9697f, 1.0000f, 0.9541f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9135f, 0.3692f, 0.8756f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7601f, 0.5671f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1263f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6481f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_8x12[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8054f, 0.8341f, 1.0000f, 1.0000f, 0.9810f, 0.9675f, 1.0000f, 1.0000f, 0.9943f, 0.9994f,
- 1.0000f, 1.0000f, 1.0000f, 0.9986f, 1.0000f, 0.8624f, 0.8820f, 0.8375f, 1.0000f, 0.9572f, 0.9701f, 0.9819f, 1.0000f, 1.0000f, 0.9868f, 0.9979f,
- 1.0000f, 1.0000f, 0.9915f, 0.9972f, 1.0000f, 0.9009f, 0.9330f, 0.6438f, 1.0000f, 0.9640f, 0.9394f, 0.6551f, 1.0000f, 1.0000f, 0.9521f, 0.8586f,
- 1.0000f, 1.0000f, 0.9962f, 0.9975f, 1.0000f, 0.9383f, 0.8132f, 0.4939f, 1.0000f, 0.9373f, 0.9017f, 0.5792f, 1.0000f, 0.9525f, 0.9604f, 0.8652f,
- 1.0000f, 1.0000f, 0.9899f, 0.9672f, 1.0000f, 0.9053f, 0.7622f, 0.5825f, 1.0000f, 0.9208f, 0.6175f, 0.5434f, 1.0000f, 0.9583f, 0.9232f, 0.3895f,
- 1.0000f, 0.9765f, 0.9813f, 0.9742f, 1.0000f, 0.8845f, 0.4758f, 0.8948f, 1.0000f, 0.8595f, 0.1803f, 0.8282f, 1.0000f, 0.9038f, 0.8196f, 0.3837f,
- 1.0000f, 1.0000f, 0.9436f, 0.9136f, 1.0000f, 0.7854f, 0.3658f, 1.0000f, 1.0000f, 0.8419f, 0.0601f, 1.0000f, 1.0000f, 0.9478f, 0.5757f, 0.2737f,
- 1.0000f, 0.9466f, 0.8397f, 0.5278f, 1.0000f, 0.7148f, 0.7692f, 1.0000f, 1.0000f, 0.5071f, 0.4518f, 1.0000f, 1.0000f, 0.8901f, 0.3415f, 0.5509f,
- 1.0000f, 1.0000f, 1.0000f, 0.9940f, 0.6145f, 1.0000f, 1.0000f, 1.0000f, 0.8495f, 1.0000f, 0.9607f, 0.9220f, 0.6381f, 1.0000f, 0.9945f, 0.9969f,
- 1.0000f, 1.0000f, 0.9961f, 0.9995f, 0.8246f, 1.0000f, 1.0000f, 1.0000f, 0.8080f, 0.9440f, 0.9634f, 0.9238f, 0.4567f, 1.0000f, 0.9863f, 0.9898f,
- 1.0000f, 1.0000f, 0.9779f, 0.9934f, 0.8184f, 1.0000f, 1.0000f, 1.0000f, 0.5358f, 0.9418f, 0.9123f, 0.6323f, 0.8093f, 1.0000f, 0.9357f, 0.8725f,
- 1.0000f, 0.9882f, 0.9885f, 0.9279f, 0.8067f, 1.0000f, 1.0000f, 1.0000f, 0.2212f, 0.9002f, 0.5891f, 0.6235f, 1.0000f, 0.9449f, 0.9389f, 0.4420f,
- 1.0000f, 1.0000f, 0.9453f, 0.9335f, 0.7823f, 1.0000f, 1.0000f, 1.0000f, 0.7775f, 0.8837f, 0.3086f, 0.7792f, 1.0000f, 0.9506f, 0.7884f, 0.2665f,
- 1.0000f, 0.9760f, 0.8760f, 0.6893f, 0.1970f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7395f, 0.3598f, 1.0000f, 1.0000f, 0.8209f, 0.3287f, 0.5858f,
- 1.0000f, 0.9723f, 0.8987f, 0.6113f, 0.1450f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7169f, 0.1631f, 1.0000f, 1.0000f, 0.8484f, 0.1888f, 0.3476f,
- 1.0000f, 0.9176f, 0.7511f, 0.3951f, 0.6660f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1357f, 1.0000f, 1.0000f, 1.0000f, 0.7473f, 0.2879f, 1.0000f,
- 1.0000f, 1.0000f, 0.9762f, 0.9920f, 0.9074f, 1.0000f, 1.0000f, 1.0000f, 0.2133f, 1.0000f, 0.9494f, 0.9445f, 0.6467f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9911f, 0.9973f, 0.7082f, 1.0000f, 1.0000f, 1.0000f, 0.3537f, 0.9547f, 0.8803f, 0.7657f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9794f, 0.9268f, 0.7942f, 1.0000f, 1.0000f, 1.0000f, 0.2592f, 0.9490f, 0.7293f, 0.4615f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9852f, 0.9715f, 0.9319f, 0.5156f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9422f, 0.5546f, 0.7314f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9558f, 0.9510f, 0.6410f, 0.7355f, 1.0000f, 1.0000f, 1.0000f, 0.7273f, 0.8662f, 0.1062f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9482f, 0.9088f, 0.6352f, 0.2368f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6051f, 0.6687f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f,
- 1.0000f, 0.9565f, 0.6265f, 0.4370f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7675f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9946f,
- 1.0000f, 0.9130f, 0.5197f, 0.7567f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0320f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 0.9985f,
- 1.0000f, 1.0000f, 0.9835f, 0.9822f, 0.2443f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8795f, 0.8615f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9666f, 0.9486f, 0.4166f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9413f, 0.9189f, 0.5618f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9150f, 0.9156f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8861f, 0.5027f, 0.5653f, 1.0000f, 1.0000f, 1.0000f, 0.9978f,
- 1.0000f, 0.9624f, 0.9431f, 0.5723f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8716f, 0.3154f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f,
- 1.0000f, 0.9621f, 0.8689f, 0.4850f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7434f, 0.2053f, 1.0000f, 1.0000f, 1.0000f, 0.9951f, 0.9953f,
- 1.0000f, 0.8925f, 0.5238f, 0.7037f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4270f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9976f, 0.9931f,
- 1.0000f, 0.9169f, 0.4711f, 0.6633f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6942f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9865f, 0.9896f,
- 1.0000f, 0.8536f, 0.5318f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1541f, 1.0000f, 1.0000f, 1.0000f, 0.9824f, 0.9928f, 0.8743f,
- 1.0000f, 0.9989f, 0.9992f, 0.9987f, 1.0000f, 0.7839f, 0.5396f, 0.6792f, 1.0000f, 0.9698f, 0.9081f, 0.9726f, 1.0000f, 0.9887f, 0.9854f, 0.9656f,
- 1.0000f, 0.9996f, 0.9999f, 0.9842f, 1.0000f, 0.6523f, 0.6740f, 0.7211f, 1.0000f, 0.9102f, 0.9398f, 0.9600f, 1.0000f, 0.9614f, 0.9859f, 0.8294f,
- 1.0000f, 0.9744f, 0.9846f, 0.9787f, 1.0000f, 0.6818f, 0.9663f, 1.0000f, 1.0000f, 0.7986f, 0.9517f, 1.0000f, 1.0000f, 0.6294f, 0.8430f, 0.9362f,
- 1.0000f, 0.9067f, 0.9579f, 0.8318f, 1.0000f, 0.8040f, 1.0000f, 1.0000f, 1.0000f, 0.9408f, 1.0000f, 1.0000f, 1.0000f, 0.7870f, 0.8853f, 0.9880f,
- 1.0000f, 0.8786f, 0.8566f, 0.9533f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7104f, 0.9163f, 1.0000f,
- 1.0000f, 0.8119f, 0.9631f, 0.9352f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8634f, 1.0000f, 1.0000f,
- 1.0000f, 0.3352f, 0.8027f, 0.9576f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7252f, 0.9341f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9983f, 0.9966f, 0.9474f, 0.5114f, 1.0000f, 1.0000f, 1.0000f, 0.9659f, 0.8013f, 0.8546f, 0.9908f, 1.0000f, 0.9024f, 0.9457f, 0.9647f,
- 1.0000f, 0.9998f, 0.9923f, 0.9808f, 0.6019f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8576f, 0.9529f, 0.9963f, 1.0000f, 0.9891f, 0.9313f, 0.9637f,
- 1.0000f, 0.9769f, 0.8680f, 0.9116f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8917f, 1.0000f, 1.0000f, 1.0000f, 0.6990f, 0.9182f, 1.0000f,
- 1.0000f, 0.9678f, 0.9597f, 0.9728f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8812f, 0.9653f, 1.0000f,
- 1.0000f, 0.4895f, 0.9250f, 0.9739f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6843f, 1.0000f, 1.0000f,
- 1.0000f, 0.8107f, 0.9844f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8452f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8474f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9932f, 0.9925f, 0.9784f, 0.8222f, 1.0000f, 1.0000f, 1.0000f, 0.0960f, 0.5923f, 0.7999f, 0.9906f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9736f, 0.9789f, 0.8734f, 0.3778f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7415f, 0.9627f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7759f, 0.9273f, 0.9974f, 0.7928f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 0.8933f, 0.9514f, 0.9876f, 0.0163f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f,
- 1.0000f, 0.8329f, 0.9586f, 1.0000f, 0.5472f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9982f, 0.9988f, 0.9967f,
- 1.0000f, 0.9569f, 1.0000f, 1.0000f, 0.3018f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9997f, 0.9201f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9754f, 0.8909f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9990f, 0.9772f, 0.9427f,
- 1.0000f, 0.8671f, 0.8698f, 0.9346f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6579f, 0.8707f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9551f, 0.8258f, 0.8505f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7726f, 0.9806f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6966f, 0.9669f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9968f, 0.9544f,
- 1.0000f, 0.8778f, 0.9767f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9969f, 0.8234f,
- 1.0000f, 0.8964f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9325f, 0.9752f, 0.9720f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8893f, 0.9540f, 0.8171f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9296f, 0.7743f, 0.8364f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9368f, 0.9470f, 0.9262f,
- 1.0000f, 1.0000f, 0.9992f, 0.9995f, 1.0000f, 0.9889f, 0.8829f, 0.7604f, 1.0000f, 0.9562f, 0.9837f, 0.7971f, 1.0000f, 0.9850f, 0.9747f, 0.9826f,
- 1.0000f, 1.0000f, 0.9999f, 0.9990f, 1.0000f, 0.9590f, 0.7585f, 1.0000f, 1.0000f, 0.9950f, 0.7899f, 0.9999f, 1.0000f, 0.9989f, 0.9927f, 0.7375f,
- 1.0000f, 0.9976f, 0.9782f, 0.9749f, 1.0000f, 0.9774f, 0.9980f, 1.0000f, 1.0000f, 0.9681f, 0.9143f, 1.0000f, 1.0000f, 0.9965f, 0.7060f, 0.7640f,
- 1.0000f, 0.9986f, 0.9883f, 0.5689f, 1.0000f, 0.8158f, 1.0000f, 1.0000f, 1.0000f, 0.6917f, 1.0000f, 1.0000f, 1.0000f, 0.9833f, 0.2291f, 1.0000f,
- 1.0000f, 0.9984f, 0.8769f, 0.1717f, 1.0000f, 0.9378f, 1.0000f, 1.0000f, 1.0000f, 0.8941f, 1.0000f, 1.0000f, 1.0000f, 0.9195f, 0.7014f, 1.0000f,
- 1.0000f, 0.9302f, 0.4805f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3718f, 1.0000f, 1.0000f,
- 1.0000f, 0.9918f, 0.3221f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8643f, 1.0000f, 1.0000f,
- 1.0000f, 0.8526f, 0.4469f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6205f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9970f, 0.9980f, 0.9801f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9831f, 0.8994f, 0.9731f, 1.0000f, 0.9949f, 0.9799f, 0.8352f,
- 1.0000f, 0.9973f, 0.9985f, 0.9954f, 0.8885f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9856f, 0.7530f, 1.0000f, 1.0000f, 0.9839f, 0.9403f, 0.5955f,
- 1.0000f, 0.9998f, 0.9291f, 0.7548f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9796f, 1.0000f, 1.0000f, 1.0000f, 0.9757f, 0.4218f, 1.0000f,
- 1.0000f, 0.9684f, 0.9109f, 0.9095f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6495f, 1.0000f, 1.0000f, 1.0000f, 0.8515f, 1.0000f, 1.0000f,
- 1.0000f, 0.9930f, 0.5582f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8972f, 1.0000f, 1.0000f,
- 1.0000f, 0.8751f, 0.6868f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1262f, 1.0000f, 1.0000f,
- 1.0000f, 0.9777f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4060f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9995f, 0.9921f, 0.9718f, 0.8408f, 1.0000f, 1.0000f, 1.0000f, 0.4320f, 0.9894f, 0.8306f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9971f, 0.9815f, 0.9308f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9791f, 0.9593f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f,
- 1.0000f, 0.9861f, 0.8463f, 0.9939f, 0.7454f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9686f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9870f, 0.9941f,
- 1.0000f, 0.9867f, 0.6766f, 1.0000f, 0.2518f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9644f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9912f,
- 1.0000f, 0.9828f, 0.9712f, 1.0000f, 0.1163f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9707f, 0.9892f,
- 1.0000f, 0.7190f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9978f, 0.9872f,
- 1.0000f, 0.9214f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9938f, 0.9958f,
- 1.0000f, 0.7808f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f, 0.9917f, 0.9536f,
- 1.0000f, 0.9956f, 0.9610f, 0.8956f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9689f, 0.8605f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9977f,
- 1.0000f, 0.9944f, 0.9244f, 0.7913f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9462f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9878f,
- 1.0000f, 0.9874f, 0.7957f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f, 0.9998f,
- 1.0000f, 0.9226f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9947f, 0.9734f,
- 1.0000f, 0.9555f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9981f, 0.9848f, 0.8869f,
- 1.0000f, 0.7709f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9914f, 0.9617f, 0.2949f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9936f, 0.9285f, 0.2808f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9709f, 0.7126f, 0.4007f,
- 1.0000f, 0.9995f, 0.9650f, 0.9031f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5987f, 1.0000f, 1.0000f,
- 1.0000f, 0.9999f, 0.9803f, 0.9955f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8877f, 1.0000f, 1.0000f,
- 1.0000f, 0.4113f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7492f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9704f, 0.9502f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9498f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9256f, 1.0000f, 1.0000f, 0.7334f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9982f,
- 1.0000f, 0.9935f, 1.0000f, 1.0000f, 0.0731f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9817f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0468f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9692f, 0.9959f, 0.9901f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9903f, 0.9997f, 0.9046f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9924f, 0.8441f, 0.6082f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9952f, 0.8270f, 0.8556f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8145f, 0.6606f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6713f, 0.9909f, 1.0000f,
- 1.0000f, 0.9997f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9960f, 1.0000f, 0.9998f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9904f, 1.0000f, 0.9695f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8979f, 0.4663f, 0.9060f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8386f, 0.7231f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0849f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4984f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_10x4[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8283f, 0.9411f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9911f, 1.0000f, 0.8198f, 0.8943f, 0.9580f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9666f, 0.9914f, 1.0000f, 0.8649f, 0.7945f, 0.3479f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9856f, 0.9971f, 1.0000f, 0.7514f, 0.7303f, 0.3081f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8956f, 0.9461f, 1.0000f, 0.7426f, 0.3814f, 0.2020f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9385f, 0.9530f, 0.9764f, 1.0000f, 0.6902f, 0.0741f, 0.6157f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9734f, 1.0000f, 1.0000f, 0.7894f, 0.8086f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9724f, 0.9930f, 1.0000f, 0.8017f, 0.8803f, 0.8262f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9377f, 0.9777f, 1.0000f, 0.7655f, 0.7131f, 0.3217f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9368f, 0.9485f, 0.8846f, 1.0000f, 0.7204f, 0.2192f, 0.2356f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8514f, 0.9082f, 1.0000f, 0.7237f, 0.1048f, 0.4972f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8633f, 0.7710f, 0.6434f, 1.0000f, 0.3704f, 0.1327f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9224f, 0.9768f, 1.0000f, 1.0000f, 0.5507f, 0.7736f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9672f, 0.9919f, 1.0000f, 0.5135f, 0.6036f, 0.5645f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8696f, 0.8364f, 1.0000f, 0.6584f, 0.4134f, 0.1824f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8861f, 0.9172f, 0.8459f, 1.0000f, 0.6485f, 0.3593f, 0.5054f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8995f, 0.8177f, 0.4801f, 1.0000f, 0.0383f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7790f, 0.7816f, 0.2803f, 1.0000f, 0.1601f, 0.2510f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9816f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9117f, 0.9634f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9093f, 0.9685f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8421f, 0.8665f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9935f,
- 1.0000f, 0.8383f, 0.9058f, 0.4236f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9937f,
- 1.0000f, 0.8832f, 0.6727f, 0.2658f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9523f, 0.9828f,
- 1.0000f, 0.6941f, 0.4888f, 0.3352f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9696f, 0.9845f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9963f, 0.9989f, 0.9966f, 1.0000f, 0.8727f, 0.8344f, 0.9331f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9995f, 0.9999f, 0.9627f, 1.0000f, 0.7919f, 0.9244f, 0.9284f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9842f, 0.9923f, 0.9895f, 1.0000f, 0.5780f, 0.8712f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9678f, 0.9835f, 0.8817f, 1.0000f, 0.7683f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9293f, 0.8477f, 0.9139f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8601f, 0.9070f, 0.9350f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9983f, 0.9801f, 0.8773f, 1.0000f, 0.5911f, 0.7167f, 0.9500f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9982f, 0.9702f, 0.9394f, 1.0000f, 0.7056f, 0.8303f, 0.9477f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9641f, 0.7485f, 0.8681f, 1.0000f, 0.6632f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9214f, 0.9538f, 0.8440f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5435f, 0.7600f, 0.9234f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6215f, 0.9654f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9781f, 0.9849f, 0.9729f, 1.0000f, 0.4620f, 0.6327f, 0.9182f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9594f, 0.9749f, 0.8132f, 1.0000f, 0.5214f, 0.8916f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6381f, 0.7969f, 0.9552f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f,
- 1.0000f, 0.7763f, 0.8742f, 0.9428f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9999f,
- 1.0000f, 0.4032f, 0.9033f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9881f, 0.9926f, 0.9956f,
- 1.0000f, 0.7018f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9953f, 0.9939f, 0.9045f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8617f, 0.9312f, 0.9608f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 1.0000f,
- 1.0000f, 0.9785f, 0.9020f, 0.8888f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f,
- 1.0000f, 0.6773f, 0.9341f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9990f, 0.9906f,
- 1.0000f, 0.8040f, 0.9322f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9988f, 0.9264f,
- 1.0000f, 0.7270f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9793f, 0.9820f, 0.9508f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9690f, 0.9718f, 0.7572f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9965f, 0.9916f, 1.0000f, 0.9614f, 0.8402f, 0.6818f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9981f, 0.9921f, 0.9984f, 1.0000f, 0.9161f, 0.6981f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9986f, 0.9621f, 0.9573f, 1.0000f, 0.9105f, 0.9420f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9869f, 0.9444f, 0.6097f, 1.0000f, 0.5289f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9813f, 0.9566f, 0.8109f, 1.0000f, 0.9587f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9773f, 0.8567f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9878f, 0.9838f, 1.0000f, 0.9493f, 0.7456f, 0.9903f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9859f, 0.9852f, 0.9008f, 1.0000f, 0.9274f, 0.6861f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9809f, 0.8241f, 0.4433f, 1.0000f, 0.9303f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8929f, 0.7093f, 0.5576f, 1.0000f, 0.7397f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9759f, 0.7628f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9193f, 0.9128f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9872f, 0.9601f, 0.9150f, 1.0000f, 0.9453f, 0.7993f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9739f, 0.9403f, 0.5712f, 1.0000f, 0.8902f, 0.9824f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f,
- 1.0000f, 0.9469f, 0.6535f, 0.7335f, 1.0000f, 0.9647f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 0.9994f,
- 1.0000f, 0.8532f, 0.2943f, 1.0000f, 1.0000f, 0.9955f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9990f,
- 1.0000f, 0.9436f, 0.9901f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9713f, 0.9951f,
- 1.0000f, 0.7868f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9960f, 0.9962f, 0.9975f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9797f, 0.9254f, 0.7543f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9972f, 0.9985f,
- 1.0000f, 0.9545f, 0.8969f, 0.6271f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9958f, 0.9941f,
- 1.0000f, 0.9660f, 0.4714f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9898f, 0.9974f,
- 1.0000f, 0.8063f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9932f, 0.9887f, 0.9945f,
- 1.0000f, 0.9707f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9893f, 0.9884f, 0.9754f,
- 1.0000f, 0.8982f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9969f, 0.9890f, 0.8584f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9943f, 0.8323f, 0.5846f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9790f, 0.8495f, 0.8154f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5973f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8875f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6680f, 0.3923f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4527f, 0.9831f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4335f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9997f, 0.9996f,
- 1.0000f, 0.7842f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9998f, 0.9947f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9978f, 1.0000f, 0.9997f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 1.0000f, 0.9909f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f, 0.9516f, 0.8758f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9928f, 0.9559f, 0.9359f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9862f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9805f, 0.9980f, 0.9949f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9866f, 0.9995f, 0.8550f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9203f, 0.5363f, 0.9744f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8220f, 0.7366f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8788f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9875f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_10x5[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8462f, 0.9403f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9942f, 1.0000f, 0.8593f, 0.9155f, 0.9673f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9628f, 0.9948f, 1.0000f, 0.8912f, 0.8324f, 0.4420f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9895f, 0.9959f, 1.0000f, 0.7946f, 0.7847f, 0.3829f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9332f, 0.9648f, 1.0000f, 0.7965f, 0.3746f, 0.2759f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9547f, 0.9812f, 0.9758f, 1.0000f, 0.7256f, 0.0857f, 0.6373f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8371f, 0.9247f, 1.0000f, 0.6694f, 0.0608f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9051f, 0.8356f, 0.7286f, 1.0000f, 0.2660f, 0.5139f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9774f, 1.0000f, 1.0000f, 0.8133f, 0.8022f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9778f, 0.9926f, 1.0000f, 0.8240f, 0.8854f, 0.8387f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9450f, 0.9853f, 1.0000f, 0.8169f, 0.7423f, 0.3906f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9430f, 0.9541f, 0.8741f, 1.0000f, 0.7591f, 0.3143f, 0.4061f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8842f, 0.8753f, 1.0000f, 0.7614f, 0.1271f, 0.5615f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8418f, 0.7723f, 0.5785f, 1.0000f, 0.5261f, 0.1800f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8956f, 0.8096f, 0.6461f, 1.0000f, 0.4489f, 0.1966f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8151f, 0.7369f, 0.2098f, 1.0000f, 0.1456f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9346f, 0.9885f, 1.0000f, 1.0000f, 0.5322f, 0.7701f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9782f, 0.9950f, 1.0000f, 0.5014f, 0.5558f, 0.5947f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8967f, 0.8402f, 1.0000f, 0.6731f, 0.5728f, 0.2558f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9061f, 0.9198f, 0.8805f, 1.0000f, 0.7038f, 0.5078f, 0.6543f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9206f, 0.8307f, 0.3321f, 1.0000f, 0.6240f, 0.1081f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8115f, 0.7448f, 0.2857f, 1.0000f, 0.2954f, 0.5840f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9965f,
- 1.0000f, 0.8648f, 0.5500f, 0.1633f, 1.0000f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9530f,
- 1.0000f, 0.7765f, 0.3662f, 0.5201f, 1.0000f, 0.0325f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9668f, 0.9602f,
- 1.0000f, 1.0000f, 0.9173f, 0.9512f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9223f, 0.9575f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8830f, 0.9010f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9953f,
- 1.0000f, 0.8564f, 0.9181f, 0.4820f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9957f,
- 1.0000f, 0.9138f, 0.6836f, 0.2226f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9737f, 0.9976f,
- 1.0000f, 0.7134f, 0.3233f, 0.4624f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9882f, 0.9936f,
- 1.0000f, 0.7679f, 0.3050f, 0.4281f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9286f, 0.9697f,
- 1.0000f, 0.6149f, 0.2340f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9481f, 0.9375f, 0.9271f,
- 1.0000f, 0.9980f, 0.9996f, 0.9967f, 1.0000f, 0.8900f, 0.8448f, 0.9396f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9997f, 0.9998f, 0.9353f, 1.0000f, 0.8003f, 0.9309f, 0.9263f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9847f, 0.9947f, 0.9934f, 1.0000f, 0.6938f, 0.9190f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9524f, 0.9832f, 0.8817f, 1.0000f, 0.8688f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9071f, 0.8978f, 0.9687f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8550f, 0.9653f, 0.9437f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6102f, 0.8274f, 0.9710f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7165f, 0.9732f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9972f, 0.9798f, 0.8578f, 1.0000f, 0.6329f, 0.7315f, 0.9741f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9992f, 0.9728f, 0.9214f, 1.0000f, 0.7342f, 0.8040f, 0.9607f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9597f, 0.7658f, 0.8701f, 1.0000f, 0.7545f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9443f, 0.9518f, 0.8675f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4210f, 0.8187f, 0.9020f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7070f, 0.9558f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6051f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8634f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9815f, 0.9908f, 0.9724f, 1.0000f, 0.3492f, 0.6194f, 0.9147f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9536f, 0.9766f, 0.7984f, 1.0000f, 0.4885f, 0.8989f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6619f, 0.8291f, 0.9317f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f,
- 1.0000f, 0.7867f, 0.8999f, 0.9719f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f,
- 1.0000f, 0.5999f, 0.8792f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9986f, 0.9999f, 0.9996f,
- 1.0000f, 0.7786f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9994f, 0.9924f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9754f, 0.9879f, 0.9361f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9838f, 0.8477f,
- 1.0000f, 0.8661f, 0.9324f, 0.9638f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 1.0000f,
- 1.0000f, 0.9828f, 0.9110f, 0.9041f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9995f,
- 1.0000f, 0.7102f, 0.9658f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9987f, 0.9906f,
- 1.0000f, 0.8506f, 0.9678f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9989f, 0.9031f,
- 1.0000f, 0.6657f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9868f, 0.9922f, 0.9871f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9581f, 0.9887f, 0.8521f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9801f, 0.7907f, 0.8059f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9475f, 0.9129f, 0.8223f,
- 1.0000f, 1.0000f, 0.9919f, 0.9978f, 1.0000f, 0.9570f, 0.8621f, 0.7397f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9954f, 0.9986f, 0.9962f, 1.0000f, 0.9382f, 0.7497f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9961f, 0.9663f, 0.9618f, 1.0000f, 0.9231f, 0.9706f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9862f, 0.9456f, 0.5672f, 1.0000f, 0.6285f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9794f, 0.8779f, 0.5894f, 1.0000f, 0.8934f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8923f, 0.6971f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9715f, 0.8866f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9643f, 0.9633f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9930f, 0.9873f, 1.0000f, 0.9494f, 0.7636f, 0.9971f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9805f, 0.9850f, 0.9424f, 1.0000f, 0.9368f, 0.7568f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9856f, 0.8078f, 0.3407f, 1.0000f, 0.9417f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9091f, 0.7226f, 0.5382f, 1.0000f, 0.7521f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9279f, 0.4139f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7926f, 0.7005f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9469f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8727f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9901f, 0.9701f, 0.9294f, 1.0000f, 0.9389f, 0.7807f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9819f, 0.9302f, 0.6503f, 1.0000f, 0.8945f, 0.9915f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f,
- 1.0000f, 0.9488f, 0.6870f, 0.7473f, 1.0000f, 0.9750f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9994f,
- 1.0000f, 0.8766f, 0.2451f, 1.0000f, 1.0000f, 0.9945f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f, 0.9990f,
- 1.0000f, 0.8714f, 0.9120f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9932f, 0.9966f,
- 1.0000f, 0.4351f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9982f, 0.9997f, 0.9993f,
- 1.0000f, 0.9623f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9844f, 0.9890f,
- 1.0000f, 0.9876f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9745f, 0.9903f, 0.9822f,
- 1.0000f, 0.9898f, 0.9506f, 0.7887f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9955f,
- 1.0000f, 0.9586f, 0.9081f, 0.6801f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9969f, 0.9893f,
- 1.0000f, 0.9591f, 0.4950f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9951f, 0.9958f,
- 1.0000f, 0.8607f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9983f, 0.9865f, 0.9911f,
- 1.0000f, 0.9339f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9943f, 0.9770f, 0.9564f,
- 1.0000f, 0.6418f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9808f, 0.9762f, 0.6581f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9917f, 0.9683f, 0.9101f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9835f, 0.9612f, 0.9553f,
- 1.0000f, 0.9963f, 0.8340f, 0.5442f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9825f, 0.8205f, 0.8257f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3577f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7744f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6904f, 0.3984f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4690f, 0.9790f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4557f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9991f, 0.9973f,
- 1.0000f, 0.8433f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9940f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9981f, 0.9999f, 0.9993f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 1.0000f, 0.9859f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f, 0.9410f, 0.7827f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9938f, 0.9239f, 0.9463f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9692f, 0.8878f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8889f, 0.9928f, 1.0000f,
- 1.0000f, 0.9975f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9841f, 0.9974f, 0.9913f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9786f, 0.9984f, 0.8492f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9255f, 0.4755f, 0.9164f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8535f, 0.7196f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6766f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9500f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_10x6[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8941f, 0.9467f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8379f, 0.9490f,
- 1.0000f, 1.0000f, 1.0000f, 0.9941f, 1.0000f, 0.8989f, 0.9438f, 0.9693f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8151f, 0.9709f,
- 1.0000f, 1.0000f, 0.9775f, 0.9933f, 1.0000f, 0.9080f, 0.8642f, 0.4327f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9163f, 0.8850f,
- 1.0000f, 1.0000f, 0.9867f, 0.9931f, 1.0000f, 0.8135f, 0.7809f, 0.4020f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9368f, 0.9362f, 0.9130f,
- 1.0000f, 1.0000f, 0.9517f, 0.9765f, 1.0000f, 0.8240f, 0.4618f, 0.4733f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9355f, 0.8951f, 0.6674f,
- 1.0000f, 0.9665f, 0.9847f, 0.9792f, 1.0000f, 0.7557f, 0.1083f, 0.7349f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8352f, 0.8595f, 0.5053f,
- 1.0000f, 1.0000f, 0.9245f, 0.9223f, 1.0000f, 0.7599f, 0.0550f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8419f, 0.5920f, 0.1947f,
- 1.0000f, 0.9147f, 0.8338f, 0.6978f, 1.0000f, 0.3094f, 0.3954f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7977f, 0.4386f, 0.5523f,
- 1.0000f, 1.0000f, 1.0000f, 0.9862f, 1.0000f, 1.0000f, 0.8406f, 0.8392f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9876f, 0.9902f, 1.0000f, 0.8509f, 0.9097f, 0.8458f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9568f, 0.9839f, 1.0000f, 0.8269f, 0.7827f, 0.4145f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9578f, 0.9614f, 0.8471f, 1.0000f, 0.7736f, 0.3680f, 0.4444f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8764f, 0.8742f, 1.0000f, 0.7679f, 0.1488f, 0.6830f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8687f, 0.7698f, 0.5151f, 1.0000f, 0.5568f, 0.2373f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9266f, 0.7945f, 0.5747f, 1.0000f, 0.5339f, 0.2167f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7912f, 0.6891f, 0.2565f, 1.0000f, 0.0936f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9528f, 0.9936f, 0.7844f, 1.0000f, 0.5293f, 0.7536f, 0.2275f, 1.0000f, 1.0000f, 1.0000f, 0.7063f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9824f, 0.9957f, 0.6204f, 0.5386f, 0.5432f, 0.5703f, 0.1226f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9017f, 0.8497f, 0.7324f, 0.6769f, 0.5792f, 0.3172f, 0.1722f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9062f, 0.9230f, 0.8432f, 0.3542f, 0.7035f, 0.5003f, 0.6920f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9315f, 0.8283f, 0.3817f, 0.7274f, 0.6044f, 0.1606f, 1.0000f, 0.5878f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8041f, 0.7660f, 0.3471f, 0.0336f, 0.4082f, 0.6706f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f,
- 1.0000f, 0.8891f, 0.4790f, 0.1362f, 0.5199f, 0.6243f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9950f,
- 1.0000f, 0.7755f, 0.2752f, 0.4902f, 0.1835f, 0.0761f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9939f, 0.9989f,
- 1.0000f, 1.0000f, 0.9450f, 0.9724f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9381f, 0.9750f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8709f, 0.8970f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9962f,
- 1.0000f, 0.8365f, 0.9294f, 0.4267f, 0.6125f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9945f,
- 1.0000f, 0.9122f, 0.7199f, 0.3248f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9681f, 0.9942f,
- 1.0000f, 0.7299f, 0.3886f, 0.6003f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9919f, 0.9975f,
- 1.0000f, 0.8057f, 0.2472f, 0.4502f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9632f, 0.9869f,
- 1.0000f, 0.6575f, 0.2842f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9661f, 0.9786f, 0.9252f,
- 1.0000f, 0.9972f, 0.9986f, 0.9974f, 1.0000f, 0.9106f, 0.8653f, 0.9601f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9677f, 0.9697f, 0.9088f,
- 1.0000f, 0.9996f, 0.9996f, 0.9419f, 1.0000f, 0.8181f, 0.9501f, 0.9685f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9689f, 0.9507f, 0.6541f,
- 1.0000f, 0.9779f, 0.9954f, 0.9849f, 1.0000f, 0.7172f, 0.9201f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7468f, 0.7249f, 0.9208f,
- 1.0000f, 0.9259f, 0.9815f, 0.8484f, 1.0000f, 0.8829f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7862f, 0.8775f, 0.9799f,
- 1.0000f, 0.9114f, 0.9139f, 0.9743f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6506f, 0.9705f, 1.0000f,
- 1.0000f, 0.8618f, 0.9739f, 0.9444f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8166f, 1.0000f, 1.0000f,
- 1.0000f, 0.5613f, 0.9193f, 0.9563f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7619f, 0.9890f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9980f, 0.9818f, 0.8607f, 1.0000f, 0.6471f, 0.7444f, 0.9645f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9991f, 0.9736f, 0.9321f, 1.0000f, 0.7224f, 0.8254f, 0.9720f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9479f, 0.7491f, 0.8311f, 1.0000f, 0.7928f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9186f, 0.9280f, 0.8445f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4206f, 0.8676f, 0.9301f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7397f, 0.9809f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6949f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8009f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9864f, 0.9881f, 0.9747f, 1.0000f, 0.3611f, 0.6164f, 0.9155f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9636f, 0.9758f, 0.8025f, 1.0000f, 0.4676f, 0.8839f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6359f, 0.8088f, 0.9335f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 1.0000f,
- 1.0000f, 0.7718f, 0.8931f, 0.9673f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9983f, 0.9999f,
- 1.0000f, 0.6642f, 0.9071f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9998f, 0.9996f,
- 1.0000f, 0.8120f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9998f, 0.9926f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9976f, 0.9963f, 0.9754f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9955f, 0.9796f,
- 1.0000f, 0.8797f, 0.9400f, 0.9619f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 1.0000f,
- 1.0000f, 0.9812f, 0.9216f, 0.9170f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9997f,
- 1.0000f, 0.7007f, 0.9653f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9976f, 0.9649f,
- 1.0000f, 0.8583f, 0.9554f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9969f, 0.8731f,
- 1.0000f, 0.7090f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9859f, 0.9923f, 0.9914f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9549f, 0.9896f, 0.8786f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9802f, 0.8522f, 0.8818f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9713f, 0.9582f, 0.9407f,
- 1.0000f, 1.0000f, 0.9885f, 0.9894f, 1.0000f, 0.9761f, 0.9008f, 0.7792f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9806f, 0.9640f, 0.9878f,
- 1.0000f, 0.9986f, 0.9953f, 0.9995f, 1.0000f, 0.9610f, 0.8104f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9833f, 0.9830f, 0.9237f,
- 1.0000f, 0.9982f, 0.9308f, 0.9432f, 1.0000f, 0.9461f, 0.9728f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9904f, 0.9539f, 0.9944f,
- 1.0000f, 0.9605f, 0.9596f, 0.3748f, 1.0000f, 0.6609f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9821f, 0.8860f, 1.0000f,
- 1.0000f, 0.9857f, 0.8807f, 0.4560f, 1.0000f, 0.9026f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9425f, 0.9929f, 1.0000f,
- 1.0000f, 0.9035f, 0.6435f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9394f, 1.0000f, 1.0000f,
- 1.0000f, 0.9836f, 0.6861f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9732f, 1.0000f, 1.0000f,
- 1.0000f, 0.8961f, 0.8559f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9883f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9912f, 0.9906f, 1.0000f, 0.9669f, 0.8225f, 0.9989f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9717f, 0.9947f, 0.9388f, 1.0000f, 0.9473f, 0.8210f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9841f, 0.7961f, 0.2929f, 1.0000f, 0.9484f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8881f, 0.7118f, 0.4846f, 1.0000f, 0.7640f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9178f, 0.3324f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7578f, 0.6321f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9273f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6397f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9967f, 0.9827f, 0.9533f, 1.0000f, 0.9455f, 0.7878f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9844f, 0.9558f, 0.6800f, 1.0000f, 0.9044f, 0.9921f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f,
- 1.0000f, 0.9623f, 0.6738f, 0.7513f, 1.0000f, 0.9701f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9999f,
- 1.0000f, 0.8921f, 0.2659f, 1.0000f, 1.0000f, 0.9928f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9959f, 0.9978f,
- 1.0000f, 0.8698f, 0.8325f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9887f, 0.9979f,
- 1.0000f, 0.3399f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9981f, 0.9980f, 0.9999f,
- 1.0000f, 0.8911f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9918f, 0.9988f,
- 1.0000f, 0.9348f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9892f, 0.9958f, 0.9910f,
- 1.0000f, 0.9852f, 0.9328f, 0.8534f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9948f, 0.9992f,
- 1.0000f, 0.9544f, 0.9342f, 0.7421f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9970f, 0.9871f,
- 1.0000f, 0.9587f, 0.4953f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9900f, 0.9934f,
- 1.0000f, 0.8571f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9854f, 0.9925f, 0.9874f,
- 1.0000f, 0.9053f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9971f, 0.9496f, 0.9768f,
- 1.0000f, 0.5246f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9657f, 0.9573f, 0.5962f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9938f, 0.9627f, 0.7895f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9772f, 0.8998f, 0.8980f,
- 1.0000f, 0.9966f, 0.8547f, 0.6085f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8753f, 1.0000f, 1.0000f,
- 1.0000f, 0.9916f, 0.7993f, 0.8630f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9523f, 1.0000f, 1.0000f,
- 1.0000f, 0.2057f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7145f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7373f, 0.5103f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5835f, 0.9782f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5478f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9990f, 0.9990f,
- 1.0000f, 0.8720f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f, 0.9961f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 0.9997f, 0.9984f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9965f, 0.9999f, 0.9789f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9982f, 0.9592f, 0.8072f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 0.9413f, 0.9512f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9375f, 0.8871f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8195f, 0.9988f, 1.0000f,
- 1.0000f, 0.9985f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9898f, 0.9993f, 0.9951f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9908f, 0.9993f, 0.8297f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8665f, 0.3015f, 0.8901f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7773f, 0.5658f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6282f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9287f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_10x8[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9515f, 0.9479f, 1.0000f, 1.0000f, 0.8697f, 0.8771f, 1.0000f, 1.0000f, 0.9852f, 0.9958f,
- 1.0000f, 1.0000f, 1.0000f, 0.9911f, 1.0000f, 0.9611f, 0.9295f, 0.9716f, 1.0000f, 0.8951f, 0.9092f, 0.9403f, 1.0000f, 1.0000f, 0.9972f, 0.9990f,
- 1.0000f, 1.0000f, 0.9844f, 0.9969f, 1.0000f, 0.9664f, 0.9466f, 0.6276f, 1.0000f, 0.9493f, 0.9133f, 0.7285f, 1.0000f, 1.0000f, 0.9671f, 0.9099f,
- 1.0000f, 1.0000f, 0.9965f, 0.9962f, 1.0000f, 0.9506f, 0.8726f, 0.6061f, 1.0000f, 0.8687f, 0.8894f, 0.5709f, 1.0000f, 0.9763f, 0.9710f, 0.9254f,
- 1.0000f, 1.0000f, 0.9651f, 0.9654f, 1.0000f, 0.9339f, 0.6408f, 0.6024f, 1.0000f, 0.8967f, 0.7477f, 0.4102f, 1.0000f, 0.9697f, 0.9447f, 0.6344f,
- 1.0000f, 0.9838f, 0.9908f, 0.9749f, 1.0000f, 0.8789f, 0.2292f, 0.8488f, 1.0000f, 0.9085f, 0.4279f, 0.9377f, 1.0000f, 0.9323f, 0.8919f, 0.5870f,
- 1.0000f, 1.0000f, 0.9489f, 0.9408f, 1.0000f, 0.8587f, 0.0655f, 1.0000f, 1.0000f, 0.8077f, 0.1170f, 1.0000f, 1.0000f, 0.9272f, 0.5831f, 0.2550f,
- 1.0000f, 0.9497f, 0.8762f, 0.6703f, 1.0000f, 0.5236f, 0.5095f, 1.0000f, 1.0000f, 0.6501f, 0.6867f, 1.0000f, 1.0000f, 0.8943f, 0.3798f, 0.6470f,
- 1.0000f, 1.0000f, 1.0000f, 0.9858f, 1.0000f, 1.0000f, 0.9397f, 0.8885f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9925f, 0.9871f,
- 1.0000f, 1.0000f, 0.9879f, 0.9977f, 1.0000f, 0.9532f, 0.9427f, 0.8477f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9890f, 0.9784f,
- 1.0000f, 1.0000f, 0.9647f, 0.9866f, 1.0000f, 0.9192f, 0.8807f, 0.5458f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9248f, 0.9260f,
- 1.0000f, 0.9792f, 0.9856f, 0.8618f, 1.0000f, 0.9113f, 0.5750f, 0.5909f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9502f, 0.9644f, 0.6136f,
- 1.0000f, 1.0000f, 0.9355f, 0.8735f, 1.0000f, 0.8911f, 0.3399f, 0.7919f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9722f, 0.8576f, 0.4565f,
- 1.0000f, 0.9328f, 0.8179f, 0.5142f, 1.0000f, 0.7394f, 0.3860f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8466f, 0.5281f, 0.6098f,
- 1.0000f, 0.9626f, 0.8454f, 0.5500f, 1.0000f, 0.7352f, 0.3026f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9140f, 0.3179f, 0.4941f,
- 1.0000f, 0.8975f, 0.7239f, 0.3255f, 1.0000f, 0.2379f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7670f, 0.2871f, 1.0000f,
- 1.0000f, 1.0000f, 0.9746f, 0.9918f, 0.9035f, 1.0000f, 0.7019f, 0.8062f, 0.1283f, 1.0000f, 1.0000f, 1.0000f, 0.5326f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9875f, 0.9948f, 0.6787f, 0.6618f, 0.6439f, 0.5627f, 0.1819f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9688f, 0.8716f, 0.8311f, 0.8016f, 0.7216f, 0.3922f, 0.1716f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9731f, 0.9553f, 0.8834f, 0.4337f, 0.8780f, 0.5948f, 0.6994f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9528f, 0.9160f, 0.4620f, 0.8407f, 0.7069f, 0.3103f, 1.0000f, 0.4162f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9078f, 0.8207f, 0.4220f, 0.0000f, 0.6731f, 0.6892f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9936f,
- 1.0000f, 0.8998f, 0.5542f, 0.2015f, 0.7779f, 0.6841f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9940f,
- 1.0000f, 0.8648f, 0.2948f, 0.5044f, 0.1610f, 0.1052f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9991f,
- 1.0000f, 1.0000f, 0.9725f, 0.9787f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9771f, 0.9577f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9371f, 0.9361f, 0.0921f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9972f,
- 1.0000f, 0.9585f, 0.9737f, 0.6207f, 0.6171f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9898f,
- 1.0000f, 0.9704f, 0.8544f, 0.4837f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9903f, 0.9991f,
- 1.0000f, 0.8565f, 0.4784f, 0.7118f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9942f, 0.9949f,
- 1.0000f, 0.9020f, 0.3470f, 0.5415f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9850f, 0.9932f,
- 1.0000f, 0.7968f, 0.4509f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9896f, 0.9909f, 0.9071f,
- 1.0000f, 0.9987f, 0.9993f, 0.9974f, 1.0000f, 0.9027f, 0.8668f, 0.9565f, 1.0000f, 0.8860f, 0.7436f, 0.7576f, 1.0000f, 0.9959f, 0.9947f, 0.9829f,
- 1.0000f, 0.9997f, 0.9999f, 0.9545f, 1.0000f, 0.8431f, 0.9413f, 0.9811f, 1.0000f, 0.8107f, 0.7537f, 0.7633f, 1.0000f, 0.9864f, 0.9929f, 0.8744f,
- 1.0000f, 0.9604f, 0.9867f, 0.9827f, 1.0000f, 0.8032f, 0.9470f, 1.0000f, 1.0000f, 0.6560f, 0.9678f, 1.0000f, 1.0000f, 0.7652f, 0.8877f, 0.9774f,
- 1.0000f, 0.9064f, 0.9755f, 0.8359f, 1.0000f, 0.9127f, 1.0000f, 1.0000f, 1.0000f, 0.7832f, 1.0000f, 1.0000f, 1.0000f, 0.8607f, 0.9596f, 0.9880f,
- 1.0000f, 0.8658f, 0.8816f, 0.9622f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7814f, 0.9510f, 1.0000f,
- 1.0000f, 0.8273f, 0.9713f, 0.9461f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9289f, 1.0000f, 1.0000f,
- 1.0000f, 0.5189f, 0.9179f, 0.9728f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8193f, 0.9719f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9982f, 0.9834f, 0.8851f, 1.0000f, 0.6531f, 0.7498f, 0.9278f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9317f, 0.9456f, 0.9437f,
- 1.0000f, 0.9985f, 0.9707f, 0.9283f, 1.0000f, 0.7518f, 0.8165f, 0.9825f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9877f, 0.9056f, 0.8959f,
- 1.0000f, 0.9418f, 0.7743f, 0.8522f, 1.0000f, 0.8511f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7143f, 0.9049f, 1.0000f,
- 1.0000f, 0.9366f, 0.9387f, 0.9266f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8335f, 0.9782f, 1.0000f,
- 1.0000f, 0.3329f, 0.7984f, 0.9350f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8868f, 1.0000f, 1.0000f,
- 1.0000f, 0.7191f, 0.9212f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7761f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7952f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9891f, 0.9807f, 0.9740f, 0.8047f, 0.3669f, 0.5585f, 0.9224f, 0.0517f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9619f, 0.9789f, 0.8323f, 0.4043f, 0.4452f, 0.8419f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7093f, 0.8707f, 0.9700f, 0.8500f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 0.8260f, 0.9186f, 0.9823f, 0.0191f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f,
- 1.0000f, 0.7167f, 0.9005f, 1.0000f, 0.6814f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9999f, 0.9975f,
- 1.0000f, 0.8628f, 1.0000f, 1.0000f, 0.1918f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9997f, 0.9752f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0789f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9983f, 0.9640f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9927f, 0.9818f,
- 1.0000f, 0.9106f, 0.9475f, 0.9573f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9986f, 1.0000f,
- 1.0000f, 0.9884f, 0.9334f, 0.9382f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f,
- 1.0000f, 0.7689f, 0.9684f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9964f, 0.9536f,
- 1.0000f, 0.8935f, 0.9779f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9966f, 0.9943f, 0.8122f,
- 1.0000f, 0.7797f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9588f, 0.9848f, 0.9694f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9218f, 0.9681f, 0.8247f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9557f, 0.8371f, 0.8983f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9561f, 0.9600f, 0.9312f,
- 1.0000f, 1.0000f, 0.9963f, 0.9995f, 1.0000f, 0.9901f, 0.8753f, 0.8234f, 1.0000f, 0.9941f, 0.9766f, 0.8843f, 1.0000f, 0.9967f, 0.9893f, 0.9809f,
- 1.0000f, 0.9995f, 0.9989f, 0.9980f, 1.0000f, 0.9630f, 0.8220f, 1.0000f, 1.0000f, 0.9913f, 0.9120f, 1.0000f, 1.0000f, 0.9920f, 0.9944f, 0.8298f,
- 1.0000f, 0.9973f, 0.9983f, 0.9523f, 1.0000f, 0.9840f, 0.9804f, 1.0000f, 1.0000f, 0.9873f, 0.9888f, 1.0000f, 1.0000f, 0.9970f, 0.8555f, 0.9661f,
- 1.0000f, 0.9935f, 0.9820f, 0.4675f, 1.0000f, 0.7308f, 1.0000f, 1.0000f, 1.0000f, 0.9344f, 1.0000f, 1.0000f, 1.0000f, 0.9836f, 0.6918f, 1.0000f,
- 1.0000f, 0.9906f, 0.9013f, 0.2200f, 1.0000f, 0.9166f, 1.0000f, 1.0000f, 1.0000f, 0.9882f, 1.0000f, 1.0000f, 1.0000f, 0.9675f, 0.8902f, 1.0000f,
- 1.0000f, 0.9423f, 0.5371f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6590f, 1.0000f, 1.0000f,
- 1.0000f, 0.9842f, 0.4889f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9236f, 1.0000f, 1.0000f,
- 1.0000f, 0.9042f, 0.5986f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7867f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9979f, 0.9956f, 1.0000f, 0.9895f, 0.8136f, 0.9760f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9869f, 0.9933f, 0.9242f,
- 1.0000f, 0.9965f, 0.9984f, 0.9569f, 1.0000f, 0.9549f, 0.7884f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9928f, 0.9581f, 0.8383f,
- 1.0000f, 0.9432f, 0.9153f, 0.3536f, 1.0000f, 0.9776f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9924f, 0.7707f, 1.0000f,
- 1.0000f, 0.9633f, 0.7557f, 0.4993f, 1.0000f, 0.7614f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9484f, 1.0000f, 1.0000f,
- 1.0000f, 0.9886f, 0.2465f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9658f, 1.0000f, 1.0000f,
- 1.0000f, 0.8347f, 0.3603f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6969f, 1.0000f, 1.0000f,
- 1.0000f, 0.9607f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.2712f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9757f, 0.9905f, 0.9637f, 0.7902f, 0.9592f, 0.6376f, 1.0000f, 0.6241f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9900f, 0.9831f, 0.7849f, 0.1502f, 0.8443f, 0.9768f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f,
- 1.0000f, 0.9854f, 0.7457f, 0.8597f, 0.5791f, 0.9147f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9981f, 0.9997f,
- 1.0000f, 0.9519f, 0.3733f, 1.0000f, 0.2792f, 0.9916f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9978f, 0.9998f,
- 1.0000f, 0.9691f, 0.6943f, 1.0000f, 0.0378f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9960f, 0.9999f,
- 1.0000f, 0.3982f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9985f, 1.0000f,
- 1.0000f, 0.8798f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9955f, 0.9968f,
- 1.0000f, 0.6759f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9799f, 0.9975f, 0.9937f,
- 1.0000f, 0.9971f, 0.9734f, 0.8927f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9951f, 0.9917f,
- 1.0000f, 0.9860f, 0.9300f, 0.8151f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9961f, 0.9921f,
- 1.0000f, 0.9802f, 0.6310f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9946f, 0.9996f,
- 1.0000f, 0.8825f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9986f, 0.9797f,
- 1.0000f, 0.9451f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9953f, 0.9931f, 0.9668f,
- 1.0000f, 0.4730f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9952f, 0.9743f, 0.4395f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9615f, 0.6647f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9794f, 0.8286f, 0.7373f,
- 1.0000f, 0.9981f, 0.9306f, 0.7595f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7725f, 1.0000f, 1.0000f,
- 1.0000f, 0.9950f, 0.9230f, 0.9816f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9846f, 1.0000f, 1.0000f,
- 1.0000f, 0.1394f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6675f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8395f, 0.7330f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7263f, 0.9914f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7044f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9998f, 0.9990f,
- 1.0000f, 0.8990f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 1.0000f, 0.9814f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9923f, 0.9998f, 0.9988f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9957f, 0.9994f, 0.9540f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9392f, 0.8000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 0.9442f, 0.9205f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9173f, 0.8638f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8092f, 0.9994f, 1.0000f,
- 1.0000f, 0.9976f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9938f, 0.9995f, 0.9979f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9862f, 0.9987f, 0.9199f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8678f, 0.2109f, 0.8533f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7936f, 0.5668f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2632f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7415f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_10x10[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9686f, 0.9633f, 1.0000f, 1.0000f, 0.9876f, 0.9703f, 1.0000f, 1.0000f, 0.9951f, 0.9984f,
- 1.0000f, 1.0000f, 1.0000f, 0.9987f, 1.0000f, 0.9597f, 0.9643f, 0.9819f, 1.0000f, 0.9912f, 0.9804f, 0.9869f, 1.0000f, 1.0000f, 0.9981f, 0.9988f,
- 1.0000f, 1.0000f, 0.9866f, 0.9992f, 1.0000f, 0.9719f, 0.9513f, 0.6842f, 1.0000f, 0.9677f, 0.9562f, 0.6732f, 1.0000f, 1.0000f, 0.9855f, 0.8914f,
- 1.0000f, 1.0000f, 0.9976f, 0.9965f, 1.0000f, 0.9489f, 0.9125f, 0.6280f, 1.0000f, 0.9555f, 0.9218f, 0.5776f, 1.0000f, 0.9848f, 0.9797f, 0.9019f,
- 1.0000f, 1.0000f, 0.9722f, 0.9737f, 1.0000f, 0.9587f, 0.7179f, 0.6996f, 1.0000f, 0.9485f, 0.6921f, 0.6084f, 1.0000f, 0.9680f, 0.9464f, 0.5482f,
- 1.0000f, 0.9928f, 0.9888f, 0.9630f, 1.0000f, 0.9316f, 0.3859f, 0.9151f, 1.0000f, 0.9447f, 0.3221f, 0.8991f, 1.0000f, 0.9326f, 0.8735f, 0.5210f,
- 1.0000f, 1.0000f, 0.9365f, 0.9047f, 1.0000f, 0.8590f, 0.1201f, 1.0000f, 1.0000f, 0.8610f, 0.0462f, 1.0000f, 1.0000f, 0.9540f, 0.5048f, 0.2354f,
- 1.0000f, 0.9551f, 0.8452f, 0.5669f, 1.0000f, 0.6051f, 0.6704f, 1.0000f, 1.0000f, 0.5983f, 0.6150f, 1.0000f, 1.0000f, 0.8866f, 0.3154f, 0.5406f,
- 1.0000f, 1.0000f, 1.0000f, 0.9933f, 1.0000f, 1.0000f, 0.9700f, 0.8930f, 1.0000f, 1.0000f, 0.9765f, 0.9073f, 1.0000f, 1.0000f, 0.9902f, 0.9934f,
- 1.0000f, 1.0000f, 0.9981f, 0.9982f, 1.0000f, 0.9750f, 0.9306f, 0.8620f, 1.0000f, 0.9620f, 0.9649f, 0.9113f, 1.0000f, 1.0000f, 0.9873f, 0.9878f,
- 1.0000f, 1.0000f, 0.9914f, 0.9909f, 1.0000f, 0.9438f, 0.9067f, 0.5915f, 1.0000f, 0.9614f, 0.9212f, 0.6344f, 1.0000f, 1.0000f, 0.9509f, 0.9341f,
- 1.0000f, 0.9852f, 0.9853f, 0.8669f, 1.0000f, 0.9356f, 0.5949f, 0.6407f, 1.0000f, 0.9346f, 0.6376f, 0.4882f, 1.0000f, 0.9729f, 0.9817f, 0.6647f,
- 1.0000f, 1.0000f, 0.9573f, 0.9224f, 1.0000f, 0.9274f, 0.4705f, 0.8707f, 1.0000f, 0.9403f, 0.4174f, 0.8396f, 1.0000f, 0.9793f, 0.8539f, 0.5595f,
- 1.0000f, 0.9601f, 0.8529f, 0.5705f, 1.0000f, 0.8121f, 0.5007f, 1.0000f, 1.0000f, 0.8227f, 0.3286f, 1.0000f, 1.0000f, 0.9005f, 0.4838f, 0.7513f,
- 1.0000f, 0.9580f, 0.8753f, 0.4567f, 1.0000f, 0.7422f, 0.4275f, 1.0000f, 1.0000f, 0.8005f, 0.2434f, 1.0000f, 1.0000f, 0.9144f, 0.3582f, 0.6117f,
- 1.0000f, 0.8841f, 0.6788f, 0.2513f, 1.0000f, 0.3348f, 1.0000f, 1.0000f, 1.0000f, 0.2949f, 1.0000f, 1.0000f, 1.0000f, 0.8093f, 0.4613f, 1.0000f,
- 1.0000f, 1.0000f, 0.9864f, 0.9965f, 0.8998f, 1.0000f, 0.7243f, 0.8107f, 0.0803f, 1.0000f, 0.7755f, 0.8807f, 0.4324f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9950f, 0.9978f, 0.6895f, 0.7113f, 0.7020f, 0.5330f, 0.1295f, 0.7285f, 0.8149f, 0.7201f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9716f, 0.9012f, 0.8314f, 0.8162f, 0.7403f, 0.4018f, 0.1665f, 0.8953f, 0.7566f, 0.3912f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9826f, 0.9683f, 0.9087f, 0.4518f, 0.8983f, 0.5740f, 0.7068f, 1.0000f, 0.8882f, 0.6815f, 0.6676f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9697f, 0.9468f, 0.5558f, 0.8507f, 0.7495f, 0.3965f, 1.0000f, 0.4659f, 0.8350f, 0.2666f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9434f, 0.8815f, 0.5520f, 0.0320f, 0.7157f, 0.7929f, 1.0000f, 1.0000f, 0.7477f, 0.7804f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f,
- 1.0000f, 0.9501f, 0.5129f, 0.2591f, 0.7670f, 0.6869f, 1.0000f, 1.0000f, 1.0000f, 0.7601f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f,
- 1.0000f, 0.9157f, 0.3086f, 0.5089f, 0.2273f, 0.1008f, 1.0000f, 1.0000f, 1.0000f, 0.1575f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9998f,
- 1.0000f, 1.0000f, 0.9782f, 0.9947f, 0.3018f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9861f, 0.9815f, 0.6439f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9533f, 0.9300f, 0.2022f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f,
- 1.0000f, 0.9694f, 0.9476f, 0.6589f, 0.6500f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f,
- 1.0000f, 0.9832f, 0.8922f, 0.5632f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9925f, 0.9988f,
- 1.0000f, 0.9033f, 0.5170f, 0.7771f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9944f,
- 1.0000f, 0.8824f, 0.3804f, 0.6469f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9953f, 0.9770f,
- 1.0000f, 0.8290f, 0.5291f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9906f, 0.9921f, 0.8798f,
- 1.0000f, 0.9995f, 0.9992f, 0.9980f, 1.0000f, 0.9230f, 0.8849f, 0.9590f, 1.0000f, 0.9375f, 0.8938f, 0.9370f, 1.0000f, 0.9952f, 0.9968f, 0.9891f,
- 1.0000f, 0.9998f, 0.9999f, 0.9623f, 1.0000f, 0.8640f, 0.9493f, 0.9881f, 1.0000f, 0.9163f, 0.9521f, 0.9779f, 1.0000f, 0.9857f, 0.9874f, 0.8890f,
- 1.0000f, 0.9529f, 0.9871f, 0.9802f, 1.0000f, 0.8078f, 0.9544f, 1.0000f, 1.0000f, 0.8049f, 0.9442f, 1.0000f, 1.0000f, 0.7091f, 0.8906f, 0.9671f,
- 1.0000f, 0.9206f, 0.9652f, 0.8302f, 1.0000f, 0.9175f, 1.0000f, 1.0000f, 1.0000f, 0.9040f, 1.0000f, 1.0000f, 1.0000f, 0.8408f, 0.9336f, 0.9905f,
- 1.0000f, 0.9026f, 0.8833f, 0.9784f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7531f, 0.9407f, 1.0000f,
- 1.0000f, 0.8580f, 0.9611f, 0.9774f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8961f, 1.0000f, 1.0000f,
- 1.0000f, 0.3694f, 0.8697f, 0.9674f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7548f, 0.9384f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9986f, 0.9900f, 0.8968f, 1.0000f, 0.7044f, 0.7787f, 0.9517f, 1.0000f, 0.7975f, 0.7738f, 0.9060f, 1.0000f, 0.9295f, 0.9662f, 0.9760f,
- 1.0000f, 0.9985f, 0.9788f, 0.9351f, 1.0000f, 0.7459f, 0.8189f, 0.9899f, 1.0000f, 0.8385f, 0.8560f, 0.9927f, 1.0000f, 0.9859f, 0.9451f, 0.9813f,
- 1.0000f, 0.9398f, 0.7653f, 0.8486f, 1.0000f, 0.8762f, 1.0000f, 1.0000f, 1.0000f, 0.8550f, 1.0000f, 1.0000f, 1.0000f, 0.7990f, 0.9862f, 1.0000f,
- 1.0000f, 0.9188f, 0.9268f, 0.9119f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9235f, 0.9923f, 1.0000f,
- 1.0000f, 0.3638f, 0.8497f, 0.9668f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9194f, 1.0000f, 1.0000f,
- 1.0000f, 0.7721f, 0.9481f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7346f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7704f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9916f, 0.9926f, 0.9742f, 0.8201f, 0.3525f, 0.5368f, 0.9252f, 0.1389f, 0.6017f, 0.5846f, 0.9800f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9692f, 0.9834f, 0.8570f, 0.4373f, 0.4071f, 0.8277f, 1.0000f, 1.0000f, 0.6312f, 0.8326f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7135f, 0.8858f, 0.9594f, 0.8362f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 0.8430f, 0.9389f, 0.9836f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f,
- 1.0000f, 0.8020f, 0.9460f, 1.0000f, 0.7306f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9995f, 0.9964f,
- 1.0000f, 0.9285f, 1.0000f, 1.0000f, 0.2108f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9655f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0909f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9918f, 0.9200f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9830f, 0.9607f,
- 1.0000f, 0.9290f, 0.9421f, 0.9604f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f,
- 1.0000f, 0.9828f, 0.9246f, 0.9525f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 0.7851f, 0.9734f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9943f, 0.9505f,
- 1.0000f, 0.9106f, 0.9840f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9922f, 0.7867f,
- 1.0000f, 0.8945f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9636f, 0.9886f, 0.9732f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9132f, 0.9640f, 0.8441f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9472f, 0.7687f, 0.8373f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9321f, 0.9331f, 0.8976f,
- 1.0000f, 1.0000f, 0.9970f, 0.9996f, 1.0000f, 0.9956f, 0.9182f, 0.8475f, 1.0000f, 0.9569f, 0.9838f, 0.8688f, 1.0000f, 0.9911f, 0.9938f, 0.9884f,
- 1.0000f, 1.0000f, 0.9954f, 0.9995f, 1.0000f, 0.9896f, 0.8725f, 1.0000f, 1.0000f, 0.9972f, 0.9258f, 1.0000f, 1.0000f, 0.9915f, 0.9963f, 0.8176f,
- 1.0000f, 1.0000f, 0.9985f, 0.9393f, 1.0000f, 0.9850f, 0.9937f, 1.0000f, 1.0000f, 0.9822f, 0.9705f, 1.0000f, 1.0000f, 0.9993f, 0.7636f, 0.8899f,
- 1.0000f, 0.9903f, 0.9844f, 0.3467f, 1.0000f, 0.7883f, 1.0000f, 1.0000f, 1.0000f, 0.8252f, 1.0000f, 1.0000f, 1.0000f, 0.9617f, 0.4750f, 1.0000f,
- 1.0000f, 0.9984f, 0.9053f, 0.2192f, 1.0000f, 0.9093f, 1.0000f, 1.0000f, 1.0000f, 0.9497f, 1.0000f, 1.0000f, 1.0000f, 0.9416f, 0.7365f, 1.0000f,
- 1.0000f, 0.9811f, 0.4965f, 0.9930f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5251f, 1.0000f, 1.0000f,
- 1.0000f, 0.9967f, 0.2879f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8716f, 1.0000f, 1.0000f,
- 1.0000f, 0.8600f, 0.4470f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5880f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9974f, 0.9971f, 1.0000f, 0.9969f, 0.8630f, 0.9966f, 1.0000f, 0.9889f, 0.9241f, 0.9946f, 1.0000f, 0.9962f, 0.9767f, 0.8874f,
- 1.0000f, 0.9973f, 0.9999f, 0.9762f, 1.0000f, 0.9689f, 0.8135f, 1.0000f, 1.0000f, 0.9868f, 0.8744f, 1.0000f, 1.0000f, 0.9936f, 0.9708f, 0.8064f,
- 1.0000f, 0.9990f, 0.9138f, 0.3409f, 1.0000f, 0.9786f, 1.0000f, 1.0000f, 1.0000f, 0.9945f, 1.0000f, 1.0000f, 1.0000f, 0.9957f, 0.6530f, 1.0000f,
- 1.0000f, 0.9665f, 0.7584f, 0.6215f, 1.0000f, 0.7960f, 1.0000f, 1.0000f, 1.0000f, 0.8214f, 1.0000f, 1.0000f, 1.0000f, 0.9263f, 1.0000f, 1.0000f,
- 1.0000f, 0.9932f, 0.2809f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9576f, 1.0000f, 1.0000f,
- 1.0000f, 0.8789f, 0.4794f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4923f, 1.0000f, 1.0000f,
- 1.0000f, 0.9727f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.1844f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9894f, 0.9931f, 0.9646f, 0.8518f, 0.9740f, 0.6760f, 1.0000f, 0.3749f, 0.9755f, 0.8771f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9972f, 0.9806f, 0.8419f, 0.0162f, 0.8659f, 0.9745f, 1.0000f, 1.0000f, 0.9566f, 0.9892f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f,
- 1.0000f, 0.9955f, 0.7384f, 0.9080f, 0.7326f, 0.9169f, 1.0000f, 1.0000f, 1.0000f, 0.9791f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9949f, 0.9986f,
- 1.0000f, 0.9714f, 0.4225f, 1.0000f, 0.1933f, 0.9795f, 1.0000f, 1.0000f, 1.0000f, 0.9809f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f,
- 1.0000f, 0.9757f, 0.7914f, 1.0000f, 0.1105f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9983f, 0.9997f,
- 1.0000f, 0.5444f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9977f, 0.9994f, 0.9940f,
- 1.0000f, 0.8678f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 0.6618f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 1.0000f, 0.9897f,
- 1.0000f, 0.9991f, 0.9658f, 0.9429f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9948f, 1.0000f,
- 1.0000f, 0.9942f, 0.9425f, 0.8780f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f, 0.9846f,
- 1.0000f, 0.9939f, 0.6971f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9711f,
- 1.0000f, 0.9455f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9724f, 0.9777f,
- 1.0000f, 0.9752f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9883f, 0.9412f,
- 1.0000f, 0.5811f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9982f, 0.9879f, 0.4421f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9969f, 0.9536f, 0.4123f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9583f, 0.7820f, 0.6183f,
- 1.0000f, 0.9994f, 0.9772f, 0.8035f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7264f, 1.0000f, 1.0000f,
- 1.0000f, 0.9959f, 0.9627f, 0.9908f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9379f, 1.0000f, 1.0000f,
- 1.0000f, 0.1755f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6946f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9100f, 0.8338f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f, 1.0000f, 1.0000f,
- 1.0000f, 0.8265f, 0.9995f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7899f, 1.0000f, 1.0000f, 0.7619f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f,
- 1.0000f, 0.9747f, 1.0000f, 1.0000f, 0.0584f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 1.0000f, 0.9824f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0694f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f, 0.9979f, 0.9990f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9842f, 1.0000f, 0.9311f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9958f, 0.9361f, 0.7836f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9919f, 0.9279f, 0.9548f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8649f, 0.7440f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7945f, 0.9959f, 1.0000f,
- 1.0000f, 0.9941f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9961f, 1.0000f, 0.9960f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f, 0.9990f, 0.9559f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8464f, 0.2739f, 0.8240f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7222f, 0.6248f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1483f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6559f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_10x12[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9716f, 0.9549f, 1.0000f, 1.0000f, 0.9881f, 0.9817f, 1.0000f, 1.0000f, 0.9984f, 0.9983f,
- 1.0000f, 1.0000f, 1.0000f, 0.9997f, 1.0000f, 0.9617f, 0.9697f, 0.9825f, 1.0000f, 0.9916f, 0.9941f, 0.9689f, 1.0000f, 1.0000f, 0.9980f, 0.9967f,
- 1.0000f, 1.0000f, 0.9940f, 0.9997f, 1.0000f, 0.9641f, 0.9573f, 0.7080f, 1.0000f, 0.9918f, 0.9662f, 0.6854f, 1.0000f, 1.0000f, 0.9815f, 0.8889f,
- 1.0000f, 1.0000f, 0.9986f, 0.9932f, 1.0000f, 0.9604f, 0.8881f, 0.6661f, 1.0000f, 0.9456f, 0.9130f, 0.6171f, 1.0000f, 0.9600f, 0.9718f, 0.8502f,
- 1.0000f, 1.0000f, 0.9899f, 0.9695f, 1.0000f, 0.9535f, 0.7366f, 0.7328f, 1.0000f, 0.9656f, 0.6923f, 0.6142f, 1.0000f, 0.9768f, 0.9189f, 0.4897f,
- 1.0000f, 0.9924f, 0.9956f, 0.9650f, 1.0000f, 0.9349f, 0.4381f, 0.9238f, 1.0000f, 0.9344f, 0.3154f, 0.8961f, 1.0000f, 0.9270f, 0.8531f, 0.4604f,
- 1.0000f, 1.0000f, 0.9731f, 0.8982f, 1.0000f, 0.9222f, 0.2598f, 1.0000f, 1.0000f, 0.8512f, 0.0780f, 1.0000f, 1.0000f, 0.9411f, 0.5059f, 0.1684f,
- 1.0000f, 0.9853f, 0.8463f, 0.5987f, 1.0000f, 0.7036f, 0.7578f, 1.0000f, 1.0000f, 0.5618f, 0.5823f, 1.0000f, 1.0000f, 0.9093f, 0.2466f, 0.4938f,
- 1.0000f, 1.0000f, 1.0000f, 0.9972f, 0.6877f, 1.0000f, 0.9506f, 0.9112f, 0.8695f, 1.0000f, 0.9909f, 0.9042f, 0.6611f, 1.0000f, 0.9971f, 0.9973f,
- 1.0000f, 1.0000f, 0.9974f, 0.9945f, 0.8704f, 0.9827f, 0.9296f, 0.8642f, 0.7829f, 0.9553f, 0.9673f, 0.9380f, 0.4690f, 1.0000f, 0.9977f, 0.9878f,
- 1.0000f, 1.0000f, 0.9936f, 0.9937f, 0.8453f, 0.9626f, 0.9036f, 0.6373f, 0.5889f, 0.9782f, 0.9155f, 0.6586f, 0.8293f, 1.0000f, 0.9483f, 0.9081f,
- 1.0000f, 0.9770f, 0.9960f, 0.8975f, 0.7997f, 0.9502f, 0.6401f, 0.6686f, 0.2911f, 0.9460f, 0.6316f, 0.6259f, 1.0000f, 0.9647f, 0.9653f, 0.5176f,
- 1.0000f, 1.0000f, 0.9539f, 0.9143f, 0.7943f, 0.9415f, 0.5253f, 0.8772f, 0.8247f, 0.9546f, 0.4239f, 0.8443f, 1.0000f, 0.9667f, 0.8114f, 0.3782f,
- 1.0000f, 0.9475f, 0.8596f, 0.5652f, 0.2972f, 0.8259f, 0.5789f, 1.0000f, 1.0000f, 0.7983f, 0.4472f, 1.0000f, 1.0000f, 0.8624f, 0.3886f, 0.6508f,
- 1.0000f, 0.9756f, 0.8669f, 0.5440f, 0.3675f, 0.7915f, 0.5583f, 1.0000f, 1.0000f, 0.7814f, 0.2532f, 1.0000f, 1.0000f, 0.9275f, 0.1836f, 0.4092f,
- 1.0000f, 0.9254f, 0.6991f, 0.3033f, 0.7123f, 0.4979f, 1.0000f, 1.0000f, 1.0000f, 0.2196f, 1.0000f, 1.0000f, 1.0000f, 0.7439f, 0.3214f, 1.0000f,
- 1.0000f, 1.0000f, 0.9913f, 0.9990f, 0.9260f, 1.0000f, 0.7166f, 0.8163f, 0.1280f, 1.0000f, 0.9804f, 0.9570f, 0.5137f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9986f, 0.9958f, 0.6808f, 0.7347f, 0.7269f, 0.5512f, 0.2056f, 0.9692f, 0.9311f, 0.7956f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9912f, 0.9330f, 0.8432f, 0.8578f, 0.8151f, 0.4516f, 0.2333f, 0.9808f, 0.7643f, 0.4815f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9791f, 0.9659f, 0.9233f, 0.5098f, 0.9023f, 0.6230f, 0.7385f, 1.0000f, 0.9398f, 0.6112f, 0.7403f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9765f, 0.9490f, 0.5687f, 0.8738f, 0.8088f, 0.4042f, 1.0000f, 0.6081f, 0.9160f, 0.1911f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9195f, 0.8835f, 0.5548f, 0.0989f, 0.7544f, 0.7770f, 1.0000f, 1.0000f, 0.7101f, 0.7594f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f,
- 1.0000f, 0.9580f, 0.6050f, 0.3332f, 0.7527f, 0.7228f, 1.0000f, 1.0000f, 1.0000f, 0.8075f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f,
- 1.0000f, 0.9393f, 0.3938f, 0.6482f, 0.2400f, 0.1760f, 1.0000f, 1.0000f, 1.0000f, 0.0560f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 0.9998f,
- 1.0000f, 1.0000f, 0.9736f, 0.9949f, 0.3729f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9362f, 0.8827f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9895f, 0.9772f, 0.4191f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9402f, 0.9494f, 0.6287f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9664f, 0.9577f, 0.2127f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9200f, 0.5291f, 0.5955f, 1.0000f, 1.0000f, 1.0000f, 0.9981f,
- 1.0000f, 0.9786f, 0.9836f, 0.6900f, 0.6710f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8904f, 0.3506f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f,
- 1.0000f, 0.9594f, 0.8940f, 0.6019f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8304f, 0.2849f, 1.0000f, 1.0000f, 1.0000f, 0.9963f, 0.9964f,
- 1.0000f, 0.8968f, 0.5403f, 0.7901f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5756f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9953f,
- 1.0000f, 0.9463f, 0.4856f, 0.7144f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7492f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9840f, 0.9846f,
- 1.0000f, 0.8236f, 0.5856f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1607f, 1.0000f, 1.0000f, 1.0000f, 0.9910f, 0.9903f, 0.8559f,
- 1.0000f, 0.9983f, 0.9999f, 0.9988f, 1.0000f, 0.9367f, 0.8747f, 0.9723f, 1.0000f, 0.9713f, 0.9100f, 0.9777f, 1.0000f, 0.9908f, 0.9905f, 0.9823f,
- 1.0000f, 0.9998f, 0.9998f, 0.9524f, 1.0000f, 0.8713f, 0.9498f, 0.9708f, 1.0000f, 0.9002f, 0.9584f, 0.9849f, 1.0000f, 0.9597f, 0.9860f, 0.8493f,
- 1.0000f, 0.9610f, 0.9926f, 0.9847f, 1.0000f, 0.8550f, 0.9753f, 1.0000f, 1.0000f, 0.8315f, 0.9620f, 1.0000f, 1.0000f, 0.6760f, 0.8540f, 0.9183f,
- 1.0000f, 0.9178f, 0.9763f, 0.8270f, 1.0000f, 0.9487f, 1.0000f, 1.0000f, 1.0000f, 0.9353f, 1.0000f, 1.0000f, 1.0000f, 0.8063f, 0.9320f, 0.9884f,
- 1.0000f, 0.8873f, 0.8521f, 0.9799f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7692f, 0.9371f, 1.0000f,
- 1.0000f, 0.8200f, 0.9590f, 0.9531f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8587f, 1.0000f, 1.0000f,
- 1.0000f, 0.3620f, 0.8788f, 0.9784f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7660f, 0.9629f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9959f, 0.9900f, 0.9049f, 0.5366f, 0.6946f, 0.7858f, 0.9520f, 0.9687f, 0.8348f, 0.8911f, 0.9876f, 1.0000f, 0.9172f, 0.9635f, 0.9810f,
- 1.0000f, 0.9996f, 0.9893f, 0.9467f, 0.6560f, 0.7627f, 0.8023f, 0.9914f, 1.0000f, 0.8843f, 0.9556f, 0.9977f, 1.0000f, 0.9874f, 0.9306f, 0.9793f,
- 1.0000f, 0.9448f, 0.7970f, 0.8651f, 1.0000f, 0.9118f, 1.0000f, 1.0000f, 1.0000f, 0.8954f, 1.0000f, 1.0000f, 1.0000f, 0.7058f, 0.9513f, 1.0000f,
- 1.0000f, 0.9444f, 0.9431f, 0.9452f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8812f, 0.9898f, 1.0000f,
- 1.0000f, 0.3834f, 0.8392f, 0.9644f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8326f, 1.0000f, 1.0000f,
- 1.0000f, 0.7676f, 0.9427f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7844f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8370f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9935f, 0.9873f, 0.9741f, 0.7887f, 0.3990f, 0.5329f, 0.9291f, 0.0443f, 0.6534f, 0.8422f, 0.9928f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9802f, 0.9806f, 0.8606f, 0.3391f, 0.4334f, 0.8188f, 1.0000f, 1.0000f, 0.7561f, 0.9869f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7708f, 0.9062f, 0.9955f, 0.8359f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 0.8858f, 0.9738f, 0.9886f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f,
- 1.0000f, 0.8050f, 0.9423f, 1.0000f, 0.7248f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9993f, 0.9968f,
- 1.0000f, 0.9149f, 1.0000f, 1.0000f, 0.1529f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 0.9385f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1367f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9788f, 0.9228f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9829f, 0.9542f,
- 1.0000f, 0.9325f, 0.9623f, 0.9567f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6831f, 0.9009f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9919f, 0.9440f, 0.9779f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7799f, 0.9842f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9999f,
- 1.0000f, 0.8101f, 0.9758f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9887f, 0.9280f,
- 1.0000f, 0.9211f, 0.9879f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9934f, 0.8037f,
- 1.0000f, 0.9137f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9471f, 0.9638f, 0.9613f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8721f, 0.9479f, 0.8010f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9249f, 0.7510f, 0.8282f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9068f, 0.9265f, 0.9339f,
- 1.0000f, 1.0000f, 1.0000f, 0.9994f, 1.0000f, 0.9997f, 0.9358f, 0.8851f, 1.0000f, 0.9733f, 0.9726f, 0.7929f, 1.0000f, 0.9966f, 0.9896f, 0.9684f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9868f, 0.8763f, 1.0000f, 1.0000f, 0.9710f, 0.8819f, 1.0000f, 1.0000f, 0.9987f, 0.9969f, 0.7873f,
- 1.0000f, 0.9984f, 0.9927f, 0.9389f, 1.0000f, 0.9855f, 0.9989f, 1.0000f, 1.0000f, 0.9832f, 0.9166f, 1.0000f, 1.0000f, 0.9676f, 0.7308f, 0.8402f,
- 1.0000f, 0.9976f, 0.9509f, 0.5721f, 1.0000f, 0.8212f, 1.0000f, 1.0000f, 1.0000f, 0.7457f, 1.0000f, 1.0000f, 1.0000f, 0.9871f, 0.2787f, 1.0000f,
- 1.0000f, 0.9992f, 0.8804f, 0.1092f, 1.0000f, 0.8989f, 1.0000f, 1.0000f, 1.0000f, 0.8896f, 1.0000f, 1.0000f, 1.0000f, 0.9751f, 0.6428f, 1.0000f,
- 1.0000f, 0.9335f, 0.4427f, 0.9946f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4732f, 1.0000f, 1.0000f,
- 1.0000f, 0.9962f, 0.2661f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8947f, 1.0000f, 1.0000f,
- 1.0000f, 0.8660f, 0.4647f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4141f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9994f, 0.9988f, 0.9743f, 0.9951f, 0.8918f, 0.9844f, 0.9992f, 0.9979f, 0.9075f, 0.9902f, 1.0000f, 0.9857f, 0.9906f, 0.8678f,
- 1.0000f, 0.9979f, 0.9989f, 0.9890f, 0.9217f, 0.9821f, 0.8224f, 1.0000f, 1.0000f, 0.9957f, 0.7754f, 1.0000f, 1.0000f, 0.9705f, 0.9607f, 0.7187f,
- 1.0000f, 0.9988f, 0.9560f, 0.5215f, 1.0000f, 0.9406f, 1.0000f, 1.0000f, 1.0000f, 0.9892f, 1.0000f, 1.0000f, 1.0000f, 0.9970f, 0.4774f, 1.0000f,
- 1.0000f, 0.9681f, 0.8412f, 0.7289f, 1.0000f, 0.8337f, 1.0000f, 1.0000f, 1.0000f, 0.6969f, 1.0000f, 1.0000f, 1.0000f, 0.8796f, 1.0000f, 1.0000f,
- 1.0000f, 0.9950f, 0.3094f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9419f, 1.0000f, 1.0000f,
- 1.0000f, 0.8381f, 0.5477f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1984f, 1.0000f, 1.0000f,
- 1.0000f, 0.9721f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.2265f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9933f, 0.9961f, 0.9746f, 0.8126f, 0.9728f, 0.6636f, 1.0000f, 0.3449f, 0.9948f, 0.8730f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9990f, 0.9944f, 0.9029f, 0.0172f, 0.8615f, 0.9760f, 1.0000f, 1.0000f, 0.9795f, 0.9851f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9991f, 0.8139f, 0.9376f, 0.7013f, 0.9301f, 1.0000f, 1.0000f, 1.0000f, 0.9748f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9943f,
- 1.0000f, 0.9838f, 0.6784f, 1.0000f, 0.1186f, 0.9974f, 1.0000f, 1.0000f, 1.0000f, 0.9563f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9999f,
- 1.0000f, 0.9775f, 0.8473f, 1.0000f, 0.1451f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9978f, 0.9939f,
- 1.0000f, 0.6201f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9990f, 1.0000f, 0.9982f,
- 1.0000f, 0.9106f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9980f, 0.9982f,
- 1.0000f, 0.6344f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9999f, 0.9866f,
- 1.0000f, 1.0000f, 0.9864f, 0.9587f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9929f, 0.8996f, 1.0000f, 1.0000f, 1.0000f, 0.9965f, 0.9942f,
- 1.0000f, 0.9987f, 0.9700f, 0.8933f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9670f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f,
- 1.0000f, 0.9968f, 0.7724f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9834f, 0.9930f,
- 1.0000f, 0.9244f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9952f, 0.9813f,
- 1.0000f, 0.9315f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9528f, 0.9055f,
- 1.0000f, 0.6455f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9797f, 0.9517f, 0.3273f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9286f, 0.3564f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9678f, 0.7611f, 0.4560f,
- 1.0000f, 0.9999f, 0.9819f, 0.8633f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7207f, 1.0000f, 1.0000f,
- 1.0000f, 0.9976f, 0.9917f, 0.9859f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8687f, 1.0000f, 1.0000f,
- 1.0000f, 0.2725f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6735f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9435f, 0.8755f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8780f, 0.9882f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8483f, 1.0000f, 1.0000f, 0.7421f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f,
- 1.0000f, 0.9703f, 1.0000f, 1.0000f, 0.0320f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9995f, 0.9862f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0885f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9889f, 0.9995f, 0.9923f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9921f, 1.0000f, 0.9087f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9938f, 0.9016f, 0.7475f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9963f, 0.8866f, 0.9206f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8926f, 0.7739f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7785f, 0.9954f, 1.0000f,
- 1.0000f, 0.9947f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9922f, 0.9971f, 0.9995f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 1.0000f, 0.9632f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8569f, 0.4287f, 0.9124f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8176f, 0.5923f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0673f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5019f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_12x4[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3987f, 1.0000f, 0.8105f, 0.9465f, 0.6269f, 1.0000f, 1.0000f, 1.0000f, 0.4786f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9946f, 0.4927f, 0.8691f, 0.9409f, 0.9569f, 0.6578f, 1.0000f, 1.0000f, 1.0000f, 0.3330f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9774f, 0.9944f, 0.6317f, 0.9052f, 0.8220f, 0.4495f, 0.2254f, 1.0000f, 1.0000f, 1.0000f, 0.6854f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9899f, 0.9969f, 0.4996f, 0.7915f, 0.7847f, 0.3712f, 0.2484f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9222f, 0.9576f, 0.0327f, 0.7824f, 0.5463f, 0.2705f, 0.5641f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9588f, 0.9649f, 0.9819f, 0.0000f, 0.7730f, 0.1103f, 0.7281f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9765f, 1.0000f, 1.0000f, 0.8239f, 0.8201f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9752f, 0.9908f, 1.0000f, 0.8276f, 0.8844f, 0.8735f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9556f, 0.9815f, 1.0000f, 0.8485f, 0.7369f, 0.4165f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9516f, 0.9700f, 0.9086f, 1.0000f, 0.7451f, 0.2920f, 0.3618f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9140f, 0.9393f, 1.0000f, 0.7892f, 0.1733f, 0.6363f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8957f, 0.8434f, 0.7064f, 1.0000f, 0.5583f, 0.1276f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9232f, 0.9870f, 1.0000f, 1.0000f, 0.8023f, 0.9005f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9643f, 0.9885f, 1.0000f, 0.7396f, 0.7581f, 0.5865f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8804f, 0.8417f, 1.0000f, 0.8124f, 0.5064f, 0.1583f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9119f, 0.9280f, 0.8615f, 1.0000f, 0.7251f, 0.3026f, 0.4857f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9242f, 0.8646f, 0.5754f, 1.0000f, 0.7129f, 0.0626f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7937f, 0.8085f, 0.3805f, 1.0000f, 0.3230f, 0.4715f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9791f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9350f, 0.9756f, 1.0000f, 1.0000f, 0.7032f, 0.7530f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9289f, 0.9613f, 1.0000f, 0.7607f, 0.8348f, 0.4076f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8469f, 0.8502f, 1.0000f, 0.7097f, 0.2132f, 0.4338f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f,
- 1.0000f, 0.8383f, 0.9028f, 0.3427f, 1.0000f, 0.6778f, 0.0888f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9974f,
- 1.0000f, 0.9192f, 0.6998f, 0.2005f, 1.0000f, 0.5199f, 0.1431f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9722f, 0.9911f,
- 1.0000f, 0.7191f, 0.4643f, 0.2370f, 1.0000f, 0.1870f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9880f, 0.9913f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9983f, 0.9986f, 0.9933f, 0.5399f, 0.9017f, 0.8400f, 0.9384f, 0.9543f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9991f, 0.9995f, 0.9434f, 0.6659f, 0.8182f, 0.9162f, 0.8777f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9851f, 0.9922f, 0.9841f, 1.0000f, 0.6410f, 0.8920f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9550f, 0.9848f, 0.8706f, 1.0000f, 0.7958f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9367f, 0.8451f, 0.9307f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8749f, 0.9202f, 0.9473f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9989f, 0.9787f, 0.8583f, 1.0000f, 0.6891f, 0.8144f, 0.9844f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9973f, 0.9727f, 0.9359f, 1.0000f, 0.8044f, 0.9270f, 0.9637f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9716f, 0.7980f, 0.8763f, 1.0000f, 0.6497f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9495f, 0.9563f, 0.8969f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5919f, 0.8330f, 0.9582f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6928f, 0.9827f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9811f, 0.9855f, 0.9683f, 1.0000f, 0.4570f, 0.8567f, 0.9342f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9450f, 0.9625f, 0.7777f, 1.0000f, 0.6816f, 0.9803f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6454f, 0.8163f, 0.9261f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f,
- 1.0000f, 0.7801f, 0.8908f, 0.9601f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f,
- 1.0000f, 0.5523f, 0.9426f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9888f, 0.9947f, 0.9953f,
- 1.0000f, 0.7682f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9935f, 0.9936f, 0.9130f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8294f, 0.9172f, 0.9442f, 1.0000f, 0.5697f, 0.8993f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9990f, 1.0000f,
- 1.0000f, 0.9799f, 0.8661f, 0.8981f, 1.0000f, 0.8257f, 0.9834f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9985f,
- 1.0000f, 0.6220f, 0.9040f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9991f, 0.9920f,
- 1.0000f, 0.7870f, 0.9063f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9993f, 0.9376f,
- 1.0000f, 0.7556f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9925f, 0.9882f, 0.9672f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9795f, 0.9778f, 0.7657f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9893f, 0.9977f, 0.9417f, 0.9732f, 0.8365f, 0.6171f, 0.9996f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9968f, 0.9972f, 0.9942f, 0.8001f, 0.9151f, 0.6739f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9958f, 0.9770f, 0.9595f, 1.0000f, 0.9182f, 0.9074f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9906f, 0.9689f, 0.6021f, 1.0000f, 0.5267f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9891f, 0.9619f, 0.8312f, 1.0000f, 0.9742f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9830f, 0.8882f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9660f, 0.9823f, 1.0000f, 0.9401f, 0.7424f, 0.9711f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9737f, 0.9864f, 0.9108f, 1.0000f, 0.9315f, 0.5810f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9877f, 0.8630f, 0.5334f, 1.0000f, 0.9324f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8933f, 0.7632f, 0.6537f, 1.0000f, 0.6071f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9861f, 0.8599f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9509f, 0.9631f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9867f, 0.9530f, 0.9298f, 1.0000f, 0.9458f, 0.7339f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9783f, 0.9480f, 0.5132f, 1.0000f, 0.8676f, 0.9502f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f,
- 1.0000f, 0.9655f, 0.6964f, 0.7222f, 1.0000f, 0.9251f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9994f,
- 1.0000f, 0.8535f, 0.2596f, 1.0000f, 1.0000f, 0.9536f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f,
- 1.0000f, 0.9808f, 0.9896f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9858f, 0.9938f,
- 1.0000f, 0.8519f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9976f, 0.9951f, 0.9982f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9837f, 0.8895f, 0.6699f, 1.0000f, 0.8870f, 0.7504f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9987f,
- 1.0000f, 0.9487f, 0.8551f, 0.3897f, 1.0000f, 0.8791f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f, 0.9940f,
- 1.0000f, 0.9333f, 0.3130f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9931f, 0.9980f,
- 1.0000f, 0.7310f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9981f, 0.9961f, 0.9967f,
- 1.0000f, 0.9677f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9971f, 0.9929f, 0.9904f,
- 1.0000f, 0.8720f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9927f, 0.9965f, 0.8945f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9916f, 0.8065f, 0.4418f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9761f, 0.7478f, 0.7706f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5970f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8857f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6619f, 0.3522f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4252f, 0.9607f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.2814f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9992f, 0.9994f,
- 1.0000f, 0.7160f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9959f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9997f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9978f, 1.0000f, 0.9874f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9706f, 0.9212f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9956f, 0.9747f, 0.9666f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9962f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9918f, 0.9996f, 0.9949f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9954f, 0.9996f, 0.8831f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9523f, 0.6121f, 0.9694f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8817f, 0.7753f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9097f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9901f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_12x5[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3385f, 1.0000f, 0.8818f, 0.9311f, 0.6057f, 1.0000f, 1.0000f, 1.0000f, 0.4810f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9964f, 0.5033f, 0.8904f, 0.9448f, 0.9478f, 0.6751f, 1.0000f, 1.0000f, 1.0000f, 0.2676f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9709f, 0.9951f, 0.6474f, 0.9174f, 0.8674f, 0.5245f, 0.3884f, 1.0000f, 1.0000f, 1.0000f, 0.7693f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9930f, 0.9961f, 0.6015f, 0.8068f, 0.8243f, 0.4456f, 0.3816f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9518f, 0.9659f, 0.6327f, 0.8317f, 0.4635f, 0.3678f, 0.7032f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9685f, 0.9763f, 0.9802f, 0.0329f, 0.7475f, 0.1053f, 0.6912f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8447f, 0.9466f, 0.0000f, 0.7305f, 0.0894f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9265f, 0.8518f, 0.7498f, 0.6437f, 0.4517f, 0.6364f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 0.9872f, 1.0000f, 1.0000f, 0.8462f, 0.8490f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9826f, 0.9955f, 1.0000f, 0.8700f, 0.9032f, 0.8883f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9567f, 0.9851f, 1.0000f, 0.8585f, 0.8050f, 0.4923f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9627f, 0.9705f, 0.8840f, 1.0000f, 0.7979f, 0.4016f, 0.5141f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8974f, 0.9077f, 1.0000f, 0.8015f, 0.1211f, 0.5671f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9022f, 0.8198f, 0.6137f, 1.0000f, 0.5581f, 0.1343f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9296f, 0.8531f, 0.7227f, 1.0000f, 0.5760f, 0.2593f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8611f, 0.8033f, 0.2759f, 1.0000f, 0.1907f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9415f, 0.9895f, 1.0000f, 1.0000f, 0.8228f, 0.9086f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9689f, 0.9937f, 1.0000f, 0.7672f, 0.7793f, 0.6214f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9140f, 0.8712f, 1.0000f, 0.8347f, 0.5847f, 0.2424f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9333f, 0.9319f, 0.8687f, 1.0000f, 0.7753f, 0.4272f, 0.6718f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9289f, 0.8545f, 0.3748f, 1.0000f, 0.7587f, 0.0520f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8101f, 0.7773f, 0.3310f, 1.0000f, 0.3460f, 0.4334f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f,
- 1.0000f, 0.8749f, 0.5932f, 0.1797f, 1.0000f, 0.6816f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9729f,
- 1.0000f, 0.8213f, 0.4752f, 0.6098f, 1.0000f, 0.0710f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9832f, 0.9645f,
- 1.0000f, 1.0000f, 0.9484f, 0.9781f, 1.0000f, 1.0000f, 0.7254f, 0.7543f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9340f, 0.9733f, 1.0000f, 0.7888f, 0.8649f, 0.3609f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.8662f, 0.8725f, 1.0000f, 0.7356f, 0.2840f, 0.5974f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9945f,
- 1.0000f, 0.8598f, 0.9059f, 0.3535f, 1.0000f, 0.7089f, 0.1575f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9986f,
- 1.0000f, 0.9041f, 0.6943f, 0.1460f, 1.0000f, 0.6510f, 0.1686f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9880f, 0.9977f,
- 1.0000f, 0.7061f, 0.2920f, 0.4145f, 1.0000f, 0.2016f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9943f, 0.9966f,
- 1.0000f, 0.7961f, 0.3155f, 0.4080f, 1.0000f, 0.5296f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9578f, 0.9737f,
- 1.0000f, 0.6880f, 0.2228f, 1.0000f, 1.0000f, 0.2330f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9663f, 0.9572f, 0.9422f,
- 1.0000f, 0.9980f, 0.9971f, 0.9949f, 0.5088f, 0.9003f, 0.8376f, 0.9191f, 0.9507f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9982f, 0.9995f, 0.9122f, 0.6615f, 0.8433f, 0.9304f, 0.9113f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9874f, 0.9953f, 0.9893f, 1.0000f, 0.7331f, 0.9368f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9513f, 0.9823f, 0.8559f, 1.0000f, 0.8955f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9148f, 0.8862f, 0.9541f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8636f, 0.9636f, 0.9650f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5890f, 0.8390f, 0.9717f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7280f, 0.9835f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9990f, 0.9741f, 0.8361f, 1.0000f, 0.7200f, 0.8419f, 0.9890f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9978f, 0.9622f, 0.9157f, 1.0000f, 0.8134f, 0.9490f, 0.9713f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9588f, 0.7943f, 0.8807f, 1.0000f, 0.7713f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9501f, 0.9641f, 0.9216f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4867f, 0.8984f, 0.9395f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7453f, 0.9785f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6848f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9165f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9770f, 0.9806f, 0.9557f, 1.0000f, 0.4694f, 0.8572f, 0.9460f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9347f, 0.9617f, 0.7609f, 1.0000f, 0.6974f, 0.9842f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6581f, 0.8166f, 0.9068f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 0.7925f, 0.8945f, 0.9777f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9999f,
- 1.0000f, 0.6290f, 0.8965f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9999f, 0.9997f,
- 1.0000f, 0.8258f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9924f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9813f, 0.9926f, 0.9281f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f, 0.9883f, 0.8504f,
- 1.0000f, 0.8332f, 0.9131f, 0.9326f, 1.0000f, 0.5626f, 0.9199f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9983f, 1.0000f,
- 1.0000f, 0.9721f, 0.8760f, 0.9257f, 1.0000f, 0.8476f, 0.9888f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9984f,
- 1.0000f, 0.6252f, 0.9381f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9991f, 0.9909f,
- 1.0000f, 0.8150f, 0.9441f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9992f, 0.9241f,
- 1.0000f, 0.6176f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9898f, 0.9942f, 0.9900f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9792f, 0.9907f, 0.8924f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9774f, 0.8288f, 0.8182f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9608f, 0.9409f, 0.8303f,
- 1.0000f, 1.0000f, 0.9957f, 0.9905f, 0.9402f, 0.9551f, 0.8624f, 0.6546f, 0.9989f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9948f, 0.9959f, 0.9973f, 0.7851f, 0.9472f, 0.7429f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9952f, 0.9361f, 0.9530f, 1.0000f, 0.8914f, 0.8851f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9809f, 0.9697f, 0.4978f, 1.0000f, 0.5346f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9920f, 0.9182f, 0.6684f, 1.0000f, 0.8893f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8934f, 0.7145f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9863f, 0.9013f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9654f, 0.9752f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9598f, 0.9914f, 1.0000f, 0.9672f, 0.7733f, 0.9756f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9816f, 0.9869f, 0.9104f, 1.0000f, 0.9495f, 0.6401f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9938f, 0.8273f, 0.4208f, 1.0000f, 0.9249f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8784f, 0.7565f, 0.5490f, 1.0000f, 0.5716f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9701f, 0.5803f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8118f, 0.7997f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9799f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9233f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9860f, 0.9795f, 0.9429f, 1.0000f, 0.9546f, 0.7869f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9829f, 0.9524f, 0.5443f, 1.0000f, 0.9095f, 0.9725f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f,
- 1.0000f, 0.9667f, 0.6650f, 0.7117f, 1.0000f, 0.9435f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9996f,
- 1.0000f, 0.8829f, 0.2123f, 1.0000f, 1.0000f, 0.9693f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9995f,
- 1.0000f, 0.8994f, 0.9224f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9940f, 0.9967f,
- 1.0000f, 0.5395f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9970f, 0.9996f,
- 1.0000f, 0.9744f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9885f, 0.9935f,
- 1.0000f, 0.9845f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9680f, 0.9902f, 0.9877f,
- 1.0000f, 0.9866f, 0.9354f, 0.7380f, 1.0000f, 0.9273f, 0.7813f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9972f, 0.9962f,
- 1.0000f, 0.9676f, 0.8795f, 0.4396f, 1.0000f, 0.8873f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9981f, 0.9911f,
- 1.0000f, 0.9593f, 0.2510f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f, 0.9932f,
- 1.0000f, 0.7630f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9976f, 0.9956f, 0.9965f,
- 1.0000f, 0.8772f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9854f, 0.9767f,
- 1.0000f, 0.5194f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9933f, 0.9916f, 0.7003f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9928f, 0.9759f, 0.9375f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9918f, 0.9603f, 0.9839f,
- 1.0000f, 0.9979f, 0.7832f, 0.4576f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9819f, 0.7906f, 0.7651f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3077f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7405f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6784f, 0.3232f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3950f, 0.9788f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.2998f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f, 0.9996f,
- 1.0000f, 0.7520f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 1.0000f, 0.9946f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 1.0000f, 0.9998f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9960f, 1.0000f, 0.9968f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 0.9562f, 0.8737f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 0.9535f, 0.9454f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9631f, 0.9050f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9388f, 0.9974f, 1.0000f,
- 1.0000f, 0.9998f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9848f, 0.9989f, 0.9922f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9857f, 0.9999f, 0.8405f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9748f, 0.5536f, 0.9583f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9208f, 0.8085f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7173f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9613f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_12x6[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.4495f, 1.0000f, 0.9421f, 0.9517f, 0.7621f, 1.0000f, 1.0000f, 1.0000f, 0.4827f, 1.0000f, 0.8797f, 0.9512f,
- 1.0000f, 1.0000f, 1.0000f, 0.9944f, 0.6889f, 0.9444f, 0.9633f, 0.9713f, 0.7033f, 1.0000f, 1.0000f, 1.0000f, 0.2638f, 1.0000f, 0.8294f, 0.9784f,
- 1.0000f, 1.0000f, 0.9823f, 0.9970f, 0.6859f, 0.9375f, 0.9393f, 0.5485f, 0.3832f, 1.0000f, 1.0000f, 1.0000f, 0.7745f, 1.0000f, 0.9591f, 0.9129f,
- 1.0000f, 1.0000f, 0.9882f, 0.9939f, 0.7113f, 0.8930f, 0.8759f, 0.5041f, 0.3565f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9665f, 0.9507f, 0.9281f,
- 1.0000f, 1.0000f, 0.9836f, 0.9730f, 0.7294f, 0.8913f, 0.5839f, 0.4607f, 0.7344f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9532f, 0.9416f, 0.7269f,
- 1.0000f, 0.9778f, 0.9935f, 0.9828f, 0.0834f, 0.8558f, 0.1109f, 0.7512f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9201f, 0.9084f, 0.5666f,
- 1.0000f, 1.0000f, 0.9608f, 0.9471f, 0.0187f, 0.8450f, 0.0373f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9187f, 0.7466f, 0.3132f,
- 1.0000f, 0.9668f, 0.8905f, 0.7218f, 0.6538f, 0.4989f, 0.4881f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9165f, 0.6078f, 0.6734f,
- 1.0000f, 1.0000f, 1.0000f, 0.9864f, 1.0000f, 1.0000f, 0.9357f, 0.8768f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9820f, 0.9980f, 1.0000f, 0.8730f, 0.9351f, 0.9029f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9756f, 0.9866f, 1.0000f, 0.9037f, 0.8815f, 0.5438f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9759f, 0.9812f, 0.8593f, 1.0000f, 0.8778f, 0.4935f, 0.5753f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9587f, 0.9158f, 1.0000f, 0.8922f, 0.1996f, 0.6637f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9497f, 0.8462f, 0.6472f, 1.0000f, 0.6947f, 0.2723f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9746f, 0.9288f, 0.6918f, 1.0000f, 0.7394f, 0.1897f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9256f, 0.7825f, 0.3766f, 1.0000f, 0.1350f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9433f, 0.9957f, 0.8437f, 1.0000f, 0.8963f, 0.9235f, 0.3495f, 1.0000f, 1.0000f, 1.0000f, 0.7663f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9878f, 0.9916f, 0.7556f, 0.8740f, 0.8334f, 0.6505f, 0.1794f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9560f, 0.8399f, 0.7844f, 0.9005f, 0.6797f, 0.3632f, 0.1231f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9616f, 0.9492f, 0.8570f, 0.5195f, 0.8852f, 0.4662f, 0.7087f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9541f, 0.9180f, 0.4381f, 0.8109f, 0.8690f, 0.0976f, 1.0000f, 0.6404f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8824f, 0.8347f, 0.3958f, 0.0687f, 0.5530f, 0.5621f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f,
- 1.0000f, 0.9398f, 0.5881f, 0.2094f, 0.6829f, 0.8060f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f,
- 1.0000f, 0.8980f, 0.3699f, 0.6266f, 0.1691f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9972f, 0.9942f,
- 1.0000f, 1.0000f, 0.9649f, 0.9896f, 1.0000f, 1.0000f, 0.8373f, 0.7919f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9595f, 0.9810f, 1.0000f, 0.8870f, 0.8996f, 0.4081f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9091f, 0.8581f, 0.0535f, 0.8139f, 0.4143f, 0.6154f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9986f,
- 1.0000f, 0.9339f, 0.9215f, 0.3284f, 0.6116f, 0.8487f, 0.2463f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9974f,
- 1.0000f, 0.9683f, 0.7991f, 0.2283f, 1.0000f, 0.7489f, 0.3054f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9908f, 0.9988f,
- 1.0000f, 0.8281f, 0.3355f, 0.5246f, 1.0000f, 0.3208f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9975f, 0.9960f,
- 1.0000f, 0.9021f, 0.2551f, 0.3895f, 1.0000f, 0.6604f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9899f, 0.9975f,
- 1.0000f, 0.7684f, 0.2373f, 1.0000f, 1.0000f, 0.2189f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9940f, 0.9927f, 0.9600f,
- 1.0000f, 0.9982f, 0.9982f, 0.9919f, 0.4204f, 0.9122f, 0.8360f, 0.9455f, 0.9242f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9861f, 0.9657f, 0.8896f,
- 1.0000f, 0.9983f, 0.9998f, 0.9194f, 0.5709f, 0.8523f, 0.9208f, 0.9487f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9698f, 0.9427f, 0.6766f,
- 1.0000f, 0.9676f, 0.9870f, 0.9804f, 1.0000f, 0.7599f, 0.9275f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7956f, 0.7882f, 0.9326f,
- 1.0000f, 0.9099f, 0.9750f, 0.8267f, 1.0000f, 0.8861f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8184f, 0.9136f, 0.9876f,
- 1.0000f, 0.9114f, 0.8887f, 0.9793f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7004f, 0.9621f, 1.0000f,
- 1.0000f, 0.8604f, 0.9661f, 0.9653f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8321f, 1.0000f, 1.0000f,
- 1.0000f, 0.5961f, 0.9269f, 0.9680f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8026f, 0.9850f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9991f, 0.9737f, 0.8254f, 1.0000f, 0.7578f, 0.8412f, 0.9815f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9977f, 0.9706f, 0.9173f, 1.0000f, 0.8154f, 0.9381f, 0.9787f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9522f, 0.7725f, 0.8511f, 1.0000f, 0.8043f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9313f, 0.9404f, 0.9107f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5093f, 0.8939f, 0.9564f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7974f, 0.9645f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7805f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8955f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9796f, 0.9743f, 0.9578f, 1.0000f, 0.5296f, 0.8626f, 0.9569f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9502f, 0.9672f, 0.7938f, 1.0000f, 0.7140f, 0.9726f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6192f, 0.8169f, 0.8700f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7704f, 0.8546f, 0.9765f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f,
- 1.0000f, 0.7192f, 0.9068f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9997f, 0.9999f,
- 1.0000f, 0.8475f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 1.0000f, 0.9933f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9936f, 0.9807f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9961f, 0.9798f,
- 1.0000f, 0.8535f, 0.9262f, 0.9476f, 1.0000f, 0.5796f, 0.8680f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9998f,
- 1.0000f, 0.9762f, 0.8749f, 0.9013f, 1.0000f, 0.8076f, 0.9874f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9984f, 0.9971f,
- 1.0000f, 0.6370f, 0.9144f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9984f, 0.9733f,
- 1.0000f, 0.8307f, 0.9410f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9966f, 0.8637f,
- 1.0000f, 0.6336f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9848f, 0.9963f, 0.9910f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9723f, 0.9868f, 0.8972f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9894f, 0.8878f, 0.9052f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9790f, 0.9691f, 0.9551f,
- 1.0000f, 1.0000f, 0.9892f, 0.9945f, 0.9060f, 0.9833f, 0.8615f, 0.7166f, 0.9967f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9924f, 0.9818f, 0.9923f,
- 1.0000f, 0.9965f, 0.9981f, 0.9988f, 0.6702f, 0.9687f, 0.7901f, 0.9998f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9857f, 0.9838f, 0.9465f,
- 1.0000f, 0.9965f, 0.9918f, 0.9387f, 1.0000f, 0.9555f, 0.8227f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9801f, 0.9629f, 0.9941f,
- 1.0000f, 0.9952f, 0.9781f, 0.3426f, 1.0000f, 0.5575f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9950f, 0.9076f, 1.0000f,
- 1.0000f, 0.9985f, 0.9294f, 0.5392f, 1.0000f, 0.8834f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9872f, 0.9951f, 1.0000f,
- 1.0000f, 0.9546f, 0.6670f, 0.9968f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8988f, 1.0000f, 1.0000f,
- 1.0000f, 0.9937f, 0.7370f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9716f, 1.0000f, 1.0000f,
- 1.0000f, 0.9229f, 0.8947f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9641f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9978f, 0.9913f, 1.0000f, 0.9845f, 0.7785f, 0.9709f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9898f, 0.9926f, 0.9449f, 1.0000f, 0.9527f, 0.6571f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9964f, 0.9222f, 0.2892f, 1.0000f, 0.9604f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9740f, 0.7244f, 0.4551f, 1.0000f, 0.5921f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9859f, 0.4020f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8720f, 0.6438f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9720f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7060f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9886f, 0.9840f, 0.9482f, 1.0000f, 0.9775f, 0.7319f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9884f, 0.9537f, 0.6000f, 1.0000f, 0.8787f, 0.9438f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f,
- 1.0000f, 0.9831f, 0.6229f, 0.6039f, 1.0000f, 0.9332f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 0.9151f, 0.1467f, 1.0000f, 1.0000f, 0.9363f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9987f,
- 1.0000f, 0.9612f, 0.7863f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9994f,
- 1.0000f, 0.4264f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9973f, 0.9958f, 1.0000f,
- 1.0000f, 0.9249f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9915f, 0.9997f,
- 1.0000f, 0.8659f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9911f, 0.9992f, 0.9976f,
- 1.0000f, 0.9901f, 0.9637f, 0.7765f, 1.0000f, 0.9460f, 0.7443f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9948f, 0.9953f,
- 1.0000f, 0.9772f, 0.8843f, 0.5345f, 1.0000f, 0.8212f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 0.9852f,
- 1.0000f, 0.9855f, 0.2975f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9969f, 0.9930f,
- 1.0000f, 0.8093f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9929f, 0.9991f, 0.9946f,
- 1.0000f, 0.9045f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9947f, 0.9954f, 0.9769f,
- 1.0000f, 0.2809f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9962f, 0.9903f, 0.6976f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9888f, 0.8425f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9890f, 0.9301f, 0.9320f,
- 1.0000f, 0.9921f, 0.8499f, 0.4772f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8710f, 1.0000f, 1.0000f,
- 1.0000f, 0.9825f, 0.8198f, 0.8240f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9582f, 1.0000f, 1.0000f,
- 1.0000f, 0.1579f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6301f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7534f, 0.4323f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5145f, 0.9573f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4438f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f,
- 1.0000f, 0.8009f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f, 0.9880f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9956f, 1.0000f, 0.9989f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9979f, 1.0000f, 0.9753f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9695f, 0.8806f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9990f, 0.9843f, 0.9702f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9625f, 0.8648f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8386f, 0.9995f, 1.0000f,
- 1.0000f, 0.9932f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9955f, 0.9990f, 0.9905f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9906f, 0.9996f, 0.8669f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9345f, 0.4718f, 0.9307f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8124f, 0.7419f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7642f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9369f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_12x8[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5588f, 1.0000f, 0.9555f, 0.9382f, 0.7966f, 1.0000f, 0.8855f, 0.9307f, 0.5111f, 1.0000f, 0.9837f, 0.9961f,
- 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.7459f, 0.9753f, 0.9716f, 0.9745f, 0.7119f, 0.9180f, 0.9366f, 0.9447f, 0.2944f, 1.0000f, 0.9984f, 0.9977f,
- 1.0000f, 1.0000f, 0.9795f, 0.9985f, 0.7823f, 0.9875f, 0.9631f, 0.6537f, 0.5466f, 0.9551f, 0.9497f, 0.7555f, 0.8055f, 1.0000f, 0.9832f, 0.9372f,
- 1.0000f, 1.0000f, 0.9958f, 0.9928f, 0.7856f, 0.9324f, 0.9187f, 0.5956f, 0.4727f, 0.9296f, 0.9130f, 0.6180f, 1.0000f, 0.9859f, 0.9798f, 0.9590f,
- 1.0000f, 1.0000f, 0.9783f, 0.9547f, 0.7142f, 0.9340f, 0.6273f, 0.5989f, 0.7756f, 0.9280f, 0.7721f, 0.4374f, 1.0000f, 0.9722f, 0.9488f, 0.6334f,
- 1.0000f, 0.9903f, 0.9917f, 0.9750f, 0.1410f, 0.9042f, 0.2259f, 0.8376f, 1.0000f, 0.9136f, 0.4580f, 0.9216f, 1.0000f, 0.9251f, 0.8903f, 0.6054f,
- 1.0000f, 1.0000f, 0.9719f, 0.9433f, 0.1210f, 0.9035f, 0.0611f, 1.0000f, 1.0000f, 0.8465f, 0.1681f, 1.0000f, 1.0000f, 0.9605f, 0.6566f, 0.3930f,
- 1.0000f, 0.9786f, 0.8707f, 0.6808f, 0.6622f, 0.5338f, 0.4921f, 1.0000f, 1.0000f, 0.7419f, 0.7593f, 1.0000f, 1.0000f, 0.9302f, 0.5017f, 0.7399f,
- 1.0000f, 1.0000f, 1.0000f, 0.9957f, 1.0000f, 1.0000f, 0.9582f, 0.9028f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9948f,
- 1.0000f, 1.0000f, 0.9952f, 0.9942f, 1.0000f, 0.9734f, 0.9679f, 0.9143f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9916f, 0.9924f,
- 1.0000f, 1.0000f, 0.9899f, 0.9852f, 1.0000f, 0.9313f, 0.9174f, 0.6242f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9666f, 0.9506f,
- 1.0000f, 0.9878f, 0.9918f, 0.8600f, 1.0000f, 0.9392f, 0.6211f, 0.6980f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9768f, 0.9841f, 0.6705f,
- 1.0000f, 1.0000f, 0.9707f, 0.8863f, 1.0000f, 0.9103f, 0.3685f, 0.7839f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9685f, 0.8779f, 0.4678f,
- 1.0000f, 0.9773f, 0.8529f, 0.5381f, 1.0000f, 0.7498f, 0.4530f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9007f, 0.5779f, 0.6117f,
- 1.0000f, 0.9790f, 0.8847f, 0.6086f, 1.0000f, 0.7358f, 0.2569f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9334f, 0.4479f, 0.5851f,
- 1.0000f, 0.9423f, 0.7612f, 0.3988f, 1.0000f, 0.1593f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8341f, 0.4159f, 1.0000f,
- 1.0000f, 1.0000f, 0.9815f, 0.9983f, 0.9049f, 1.0000f, 0.9377f, 0.9110f, 0.1767f, 1.0000f, 1.0000f, 1.0000f, 0.6480f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9925f, 0.9938f, 0.7252f, 0.9465f, 0.8871f, 0.6731f, 0.2795f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9656f, 0.8688f, 0.8364f, 0.9620f, 0.7337f, 0.5507f, 0.0864f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9793f, 0.9645f, 0.8590f, 0.3871f, 0.9329f, 0.5887f, 0.8069f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9725f, 0.9257f, 0.4046f, 0.8725f, 0.8993f, 0.2338f, 1.0000f, 0.4268f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9240f, 0.8539f, 0.4214f, 0.0177f, 0.6594f, 0.7209f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9955f,
- 1.0000f, 0.9535f, 0.5815f, 0.2492f, 0.7649f, 0.8139f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9951f,
- 1.0000f, 0.9070f, 0.3300f, 0.5742f, 0.0985f, 0.0349f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9969f, 0.9981f,
- 1.0000f, 1.0000f, 0.9809f, 0.9877f, 1.0000f, 1.0000f, 0.8152f, 0.7981f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9755f, 0.9842f, 1.0000f, 0.9205f, 0.8770f, 0.5064f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9397f, 0.8956f, 0.2720f, 0.8971f, 0.5294f, 0.7050f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9934f,
- 1.0000f, 0.9470f, 0.9543f, 0.5204f, 0.4776f, 0.8697f, 0.4103f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9887f,
- 1.0000f, 0.9698f, 0.7919f, 0.3017f, 1.0000f, 0.7950f, 0.5249f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9894f, 0.9987f,
- 1.0000f, 0.8486f, 0.3432f, 0.6508f, 1.0000f, 0.5158f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 0.9988f,
- 1.0000f, 0.8895f, 0.2016f, 0.3496f, 1.0000f, 0.7004f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9935f, 0.9974f,
- 1.0000f, 0.7806f, 0.2870f, 1.0000f, 1.0000f, 0.3090f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9872f, 0.9921f, 0.9350f,
- 1.0000f, 0.9995f, 0.9970f, 0.9964f, 0.4426f, 0.9077f, 0.8669f, 0.9479f, 0.9413f, 0.9156f, 0.7439f, 0.7379f, 1.0000f, 0.9956f, 0.9992f, 0.9788f,
- 1.0000f, 0.9999f, 0.9998f, 0.9285f, 0.5627f, 0.8678f, 0.9246f, 0.9676f, 1.0000f, 0.8166f, 0.7668f, 0.7686f, 1.0000f, 0.9910f, 0.9926f, 0.8926f,
- 1.0000f, 0.9418f, 0.9883f, 0.9807f, 1.0000f, 0.8268f, 0.9601f, 1.0000f, 1.0000f, 0.7274f, 0.9739f, 1.0000f, 1.0000f, 0.8293f, 0.9021f, 0.9943f,
- 1.0000f, 0.8941f, 0.9642f, 0.8192f, 1.0000f, 0.9442f, 1.0000f, 1.0000f, 1.0000f, 0.8218f, 1.0000f, 1.0000f, 1.0000f, 0.8919f, 0.9766f, 0.9950f,
- 1.0000f, 0.8813f, 0.8560f, 0.9737f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8179f, 0.9567f, 1.0000f,
- 1.0000f, 0.8305f, 0.9539f, 0.9408f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9527f, 1.0000f, 1.0000f,
- 1.0000f, 0.5424f, 0.9274f, 0.9776f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8125f, 0.9760f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9984f, 0.9854f, 0.8497f, 1.0000f, 0.7888f, 0.8839f, 0.9863f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9623f, 0.9510f, 0.9514f,
- 1.0000f, 0.9959f, 0.9649f, 0.9263f, 1.0000f, 0.8387f, 0.9519f, 0.9813f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9828f, 0.9193f, 0.9228f,
- 1.0000f, 0.9523f, 0.7872f, 0.8421f, 1.0000f, 0.8805f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7631f, 0.9428f, 1.0000f,
- 1.0000f, 0.9222f, 0.9437f, 0.9361f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8761f, 0.9873f, 1.0000f,
- 1.0000f, 0.3748f, 0.8243f, 0.9594f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8978f, 1.0000f, 1.0000f,
- 1.0000f, 0.7517f, 0.9291f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7935f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8743f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9826f, 0.9802f, 0.9616f, 0.8454f, 0.5666f, 0.8788f, 0.9704f, 0.1105f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9612f, 0.9688f, 0.8011f, 0.4970f, 0.7316f, 0.9870f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6650f, 0.8610f, 0.9403f, 0.8432f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 0.8098f, 0.9149f, 0.9811f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7231f, 0.9162f, 1.0000f, 0.7574f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f, 0.9989f,
- 1.0000f, 0.8620f, 1.0000f, 1.0000f, 0.1504f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9804f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0481f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9966f, 0.9742f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9944f, 0.9839f,
- 1.0000f, 0.8949f, 0.9461f, 0.9493f, 1.0000f, 0.6022f, 0.8911f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9999f,
- 1.0000f, 0.9834f, 0.9116f, 0.9578f, 1.0000f, 0.8410f, 0.9929f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f,
- 1.0000f, 0.7164f, 0.9531f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9954f, 0.9563f,
- 1.0000f, 0.8580f, 0.9713f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9914f, 0.8280f,
- 1.0000f, 0.6422f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9659f, 0.9937f, 0.9848f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9211f, 0.9830f, 0.8399f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9758f, 0.8734f, 0.9199f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9771f, 0.9763f, 0.9701f,
- 1.0000f, 1.0000f, 0.9999f, 0.9893f, 0.9123f, 0.9945f, 0.8830f, 0.7704f, 0.9897f, 0.9933f, 0.9728f, 0.8317f, 1.0000f, 0.9986f, 0.9920f, 0.9962f,
- 1.0000f, 0.9998f, 0.9999f, 0.9960f, 0.6678f, 0.9634f, 0.8329f, 1.0000f, 1.0000f, 0.9907f, 0.9083f, 1.0000f, 1.0000f, 0.9988f, 0.9992f, 0.8752f,
- 1.0000f, 0.9999f, 0.9970f, 0.9318f, 1.0000f, 0.9900f, 0.9387f, 1.0000f, 1.0000f, 0.9973f, 0.9885f, 1.0000f, 1.0000f, 0.9995f, 0.8476f, 0.9502f,
- 1.0000f, 0.9981f, 0.9846f, 0.3162f, 1.0000f, 0.6858f, 1.0000f, 1.0000f, 1.0000f, 0.8716f, 1.0000f, 1.0000f, 1.0000f, 0.9932f, 0.7996f, 1.0000f,
- 1.0000f, 0.9977f, 0.8796f, 0.2097f, 1.0000f, 0.8640f, 1.0000f, 1.0000f, 1.0000f, 0.9800f, 1.0000f, 1.0000f, 1.0000f, 0.9731f, 0.9097f, 1.0000f,
- 1.0000f, 0.9710f, 0.4873f, 0.9844f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7073f, 1.0000f, 1.0000f,
- 1.0000f, 0.9818f, 0.4824f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9268f, 1.0000f, 1.0000f,
- 1.0000f, 0.9063f, 0.6907f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8256f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9982f, 0.9857f, 1.0000f, 0.9912f, 0.8040f, 0.9880f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9850f, 0.9890f, 0.9234f,
- 1.0000f, 0.9940f, 0.9975f, 0.9781f, 1.0000f, 0.9586f, 0.7739f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9913f, 0.9638f, 0.8549f,
- 1.0000f, 0.9973f, 0.8963f, 0.2644f, 1.0000f, 0.9672f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9986f, 0.7904f, 1.0000f,
- 1.0000f, 0.9609f, 0.6782f, 0.3810f, 1.0000f, 0.6393f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9669f, 1.0000f, 1.0000f,
- 1.0000f, 0.9820f, 0.3366f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9822f, 1.0000f, 1.0000f,
- 1.0000f, 0.8649f, 0.4629f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7790f, 1.0000f, 1.0000f,
- 1.0000f, 0.9778f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.3232f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9980f, 0.9930f, 0.9682f, 0.8570f, 0.9868f, 0.7773f, 1.0000f, 0.7097f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9975f, 0.9575f, 0.7027f, 0.2178f, 0.9014f, 0.9571f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f,
- 1.0000f, 0.9865f, 0.7187f, 0.6757f, 0.6451f, 0.9168f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 1.0000f,
- 1.0000f, 0.9695f, 0.1934f, 1.0000f, 0.2415f, 0.9627f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 1.0000f,
- 1.0000f, 0.9662f, 0.6833f, 1.0000f, 0.1314f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9965f, 0.9965f,
- 1.0000f, 0.3622f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9990f, 1.0000f,
- 1.0000f, 0.8879f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9888f, 0.9994f,
- 1.0000f, 0.6148f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9955f, 0.9978f, 0.9953f,
- 1.0000f, 0.9963f, 0.9747f, 0.8084f, 1.0000f, 0.9692f, 0.7295f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f, 0.9972f,
- 1.0000f, 0.9824f, 0.9056f, 0.7479f, 1.0000f, 0.8630f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9947f,
- 1.0000f, 0.9909f, 0.4321f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9968f,
- 1.0000f, 0.8444f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9891f, 0.9896f,
- 1.0000f, 0.9356f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9976f, 0.9652f,
- 1.0000f, 0.1851f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9941f, 0.9882f, 0.5923f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9856f, 0.7536f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9861f, 0.8822f, 0.8518f,
- 1.0000f, 0.9939f, 0.8934f, 0.6932f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8112f, 1.0000f, 1.0000f,
- 1.0000f, 0.9982f, 0.8887f, 0.9475f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9922f, 1.0000f, 1.0000f,
- 1.0000f, 0.0739f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5704f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8231f, 0.6883f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6956f, 0.9866f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6364f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9967f, 1.0000f, 1.0000f,
- 1.0000f, 0.9090f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 1.0000f, 0.9905f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9906f, 0.9997f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9946f, 0.9996f, 0.9484f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9971f, 0.9559f, 0.8026f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9990f, 0.9598f, 0.9451f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9456f, 0.8508f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8659f, 0.9979f, 1.0000f,
- 1.0000f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9991f, 0.9979f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9902f, 0.9998f, 0.9345f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9000f, 0.3559f, 0.8985f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8353f, 0.6303f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5548f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8205f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_12x10[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6207f, 1.0000f, 0.9776f, 0.9505f, 0.7947f, 1.0000f, 0.9931f, 0.9859f, 0.4908f, 1.0000f, 0.9972f, 0.9997f,
- 1.0000f, 1.0000f, 1.0000f, 0.9980f, 0.7324f, 0.9738f, 0.9791f, 0.9809f, 0.7362f, 0.9959f, 0.9913f, 0.9638f, 0.2599f, 1.0000f, 0.9977f, 0.9994f,
- 1.0000f, 1.0000f, 0.9957f, 0.9991f, 0.7556f, 0.9800f, 0.9550f, 0.6656f, 0.5596f, 0.9935f, 0.9709f, 0.7168f, 0.8272f, 1.0000f, 0.9874f, 0.9291f,
- 1.0000f, 1.0000f, 0.9961f, 0.9844f, 0.8027f, 0.9422f, 0.9112f, 0.6472f, 0.4826f, 0.9821f, 0.9340f, 0.6631f, 1.0000f, 0.9882f, 0.9592f, 0.9172f,
- 1.0000f, 1.0000f, 0.9898f, 0.9717f, 0.7343f, 0.9572f, 0.7065f, 0.6914f, 0.8340f, 0.9606f, 0.7208f, 0.6299f, 1.0000f, 0.9833f, 0.9493f, 0.5704f,
- 1.0000f, 0.9922f, 0.9852f, 0.9539f, 0.2317f, 0.9211f, 0.3620f, 0.8999f, 1.0000f, 0.9194f, 0.3453f, 0.9068f, 1.0000f, 0.9687f, 0.8601f, 0.5523f,
- 1.0000f, 1.0000f, 0.9535f, 0.9074f, 0.1950f, 0.8782f, 0.0978f, 1.0000f, 1.0000f, 0.9386f, 0.1450f, 1.0000f, 1.0000f, 0.9489f, 0.5947f, 0.3046f,
- 1.0000f, 0.9760f, 0.8551f, 0.5845f, 0.6847f, 0.6047f, 0.6176f, 1.0000f, 1.0000f, 0.6731f, 0.7147f, 1.0000f, 1.0000f, 0.9020f, 0.4045f, 0.6500f,
- 1.0000f, 1.0000f, 1.0000f, 0.9963f, 1.0000f, 1.0000f, 0.9666f, 0.9296f, 1.0000f, 1.0000f, 0.9856f, 0.9395f, 1.0000f, 1.0000f, 0.9986f, 0.9972f,
- 1.0000f, 1.0000f, 0.9960f, 0.9991f, 1.0000f, 0.9589f, 0.9452f, 0.9148f, 1.0000f, 0.9876f, 0.9881f, 0.9061f, 1.0000f, 1.0000f, 0.9956f, 0.9728f,
- 1.0000f, 1.0000f, 0.9905f, 0.9837f, 1.0000f, 0.9582f, 0.8941f, 0.6527f, 1.0000f, 0.9733f, 0.9448f, 0.6754f, 1.0000f, 1.0000f, 0.9798f, 0.9528f,
- 1.0000f, 0.9871f, 0.9947f, 0.8712f, 1.0000f, 0.9404f, 0.6358f, 0.7106f, 1.0000f, 0.9579f, 0.6605f, 0.6329f, 1.0000f, 0.9813f, 0.9817f, 0.6824f,
- 1.0000f, 1.0000f, 0.9750f, 0.9200f, 1.0000f, 0.9532f, 0.4742f, 0.8629f, 1.0000f, 0.9565f, 0.4614f, 0.8620f, 1.0000f, 0.9893f, 0.8948f, 0.5913f,
- 1.0000f, 0.9755f, 0.8738f, 0.6144f, 1.0000f, 0.8000f, 0.5739f, 1.0000f, 1.0000f, 0.8307f, 0.3565f, 1.0000f, 1.0000f, 0.9250f, 0.5486f, 0.7470f,
- 1.0000f, 0.9787f, 0.8919f, 0.5375f, 1.0000f, 0.7488f, 0.4148f, 1.0000f, 1.0000f, 0.8373f, 0.3164f, 1.0000f, 1.0000f, 0.9265f, 0.4524f, 0.6681f,
- 1.0000f, 0.9426f, 0.6980f, 0.2734f, 1.0000f, 0.2862f, 1.0000f, 1.0000f, 1.0000f, 0.4388f, 1.0000f, 1.0000f, 1.0000f, 0.8190f, 0.5560f, 1.0000f,
- 1.0000f, 1.0000f, 0.9879f, 0.9975f, 0.9118f, 1.0000f, 0.9501f, 0.9270f, 0.1541f, 1.0000f, 0.7790f, 0.8730f, 0.5300f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9951f, 0.9973f, 0.6801f, 0.9648f, 0.8591f, 0.6778f, 0.1875f, 0.7849f, 0.8284f, 0.6936f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9767f, 0.8903f, 0.8226f, 0.9730f, 0.7505f, 0.5810f, 0.0442f, 0.9047f, 0.7700f, 0.5262f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9863f, 0.9714f, 0.8880f, 0.3340f, 0.9609f, 0.6387f, 0.8166f, 1.0000f, 0.8864f, 0.7044f, 0.7267f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9896f, 0.9485f, 0.4950f, 0.8395f, 0.9034f, 0.3675f, 1.0000f, 0.3782f, 0.8541f, 0.2667f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9430f, 0.8703f, 0.4867f, 0.0177f, 0.7188f, 0.8014f, 1.0000f, 1.0000f, 0.7961f, 0.7685f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f,
- 1.0000f, 0.9286f, 0.5109f, 0.2245f, 0.7654f, 0.8521f, 1.0000f, 1.0000f, 1.0000f, 0.8066f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f,
- 1.0000f, 0.9013f, 0.2798f, 0.4990f, 0.0771f, 0.1074f, 1.0000f, 1.0000f, 1.0000f, 0.2099f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9999f,
- 1.0000f, 1.0000f, 0.9887f, 0.9901f, 0.4295f, 1.0000f, 0.8469f, 0.8078f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9740f, 0.9802f, 0.6870f, 0.9516f, 0.8848f, 0.4658f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9557f, 0.9260f, 0.3396f, 0.9228f, 0.5632f, 0.7023f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f,
- 1.0000f, 0.9561f, 0.9568f, 0.5225f, 0.5148f, 0.9223f, 0.4342f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f,
- 1.0000f, 0.9866f, 0.8561f, 0.4247f, 1.0000f, 0.8459f, 0.6014f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9916f, 0.9994f,
- 1.0000f, 0.8832f, 0.3993f, 0.7286f, 1.0000f, 0.6079f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9932f,
- 1.0000f, 0.9160f, 0.2025f, 0.4097f, 1.0000f, 0.7001f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9941f, 0.9915f,
- 1.0000f, 0.7606f, 0.3282f, 1.0000f, 1.0000f, 0.3728f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9827f, 0.9962f, 0.9054f,
- 1.0000f, 0.9994f, 0.9997f, 0.9988f, 0.4479f, 0.9473f, 0.8840f, 0.9575f, 0.9460f, 0.9481f, 0.9041f, 0.9400f, 1.0000f, 0.9936f, 0.9979f, 0.9869f,
- 1.0000f, 0.9998f, 0.9998f, 0.9391f, 0.5775f, 0.8790f, 0.9301f, 0.9743f, 1.0000f, 0.9177f, 0.9554f, 0.9825f, 1.0000f, 0.9911f, 0.9929f, 0.9087f,
- 1.0000f, 0.9335f, 0.9672f, 0.9654f, 1.0000f, 0.8438f, 0.9619f, 1.0000f, 1.0000f, 0.8129f, 0.9657f, 1.0000f, 1.0000f, 0.7761f, 0.8934f, 0.9925f,
- 1.0000f, 0.8956f, 0.9596f, 0.7877f, 1.0000f, 0.9359f, 1.0000f, 1.0000f, 1.0000f, 0.9439f, 1.0000f, 1.0000f, 1.0000f, 0.8872f, 0.9622f, 0.9963f,
- 1.0000f, 0.8970f, 0.8648f, 0.9684f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7820f, 0.9435f, 1.0000f,
- 1.0000f, 0.8249f, 0.9632f, 0.9735f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9100f, 1.0000f, 1.0000f,
- 1.0000f, 0.3889f, 0.8531f, 0.9701f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7589f, 0.9363f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9986f, 0.9757f, 0.8815f, 1.0000f, 0.8153f, 0.8807f, 0.9854f, 1.0000f, 0.7987f, 0.7905f, 0.9136f, 1.0000f, 0.9651f, 0.9782f, 0.9848f,
- 1.0000f, 0.9990f, 0.9720f, 0.9330f, 1.0000f, 0.8823f, 0.9669f, 0.9914f, 1.0000f, 0.8318f, 0.8685f, 0.9939f, 1.0000f, 0.9902f, 0.9612f, 0.9769f,
- 1.0000f, 0.9354f, 0.7522f, 0.8104f, 1.0000f, 0.9106f, 1.0000f, 1.0000f, 1.0000f, 0.8721f, 1.0000f, 1.0000f, 1.0000f, 0.8261f, 0.9771f, 1.0000f,
- 1.0000f, 0.9081f, 0.9234f, 0.9183f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9306f, 0.9937f, 1.0000f,
- 1.0000f, 0.3941f, 0.8581f, 0.9806f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9349f, 1.0000f, 1.0000f,
- 1.0000f, 0.7669f, 0.9586f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7776f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8406f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9892f, 0.9839f, 0.9689f, 0.8773f, 0.6112f, 0.8610f, 0.9811f, 0.1716f, 0.5980f, 0.6238f, 0.9796f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9635f, 0.9762f, 0.8237f, 0.5187f, 0.7399f, 0.9753f, 1.0000f, 1.0000f, 0.6415f, 0.8449f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.6706f, 0.8765f, 0.9497f, 0.8511f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f,
- 1.0000f, 0.8141f, 0.9166f, 0.9857f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f,
- 1.0000f, 0.7731f, 0.9543f, 1.0000f, 0.7228f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9998f, 0.9996f,
- 1.0000f, 0.8978f, 1.0000f, 1.0000f, 0.1169f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9675f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.0559f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9953f, 0.9512f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9868f, 0.9712f,
- 1.0000f, 0.9316f, 0.9456f, 0.9603f, 1.0000f, 0.6553f, 0.9124f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 1.0000f,
- 1.0000f, 0.9846f, 0.9239f, 0.9692f, 1.0000f, 0.8384f, 0.9969f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f,
- 1.0000f, 0.7380f, 0.9443f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9924f, 0.9377f,
- 1.0000f, 0.8896f, 0.9823f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 0.9927f, 0.7805f,
- 1.0000f, 0.7863f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9722f, 0.9835f, 0.9841f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9368f, 0.9725f, 0.8501f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9663f, 0.8040f, 0.8667f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9520f, 0.9372f, 0.9629f,
- 1.0000f, 1.0000f, 0.9987f, 0.9999f, 0.9477f, 0.9923f, 0.9154f, 0.7834f, 0.9982f, 0.9920f, 0.9794f, 0.8363f, 1.0000f, 0.9982f, 0.9948f, 0.9899f,
- 1.0000f, 0.9990f, 0.9975f, 1.0000f, 0.7086f, 0.9819f, 0.8756f, 1.0000f, 1.0000f, 0.9967f, 0.9189f, 1.0000f, 1.0000f, 0.9971f, 0.9960f, 0.8676f,
- 1.0000f, 0.9981f, 0.9509f, 0.9413f, 1.0000f, 0.9842f, 0.9468f, 1.0000f, 1.0000f, 0.9946f, 0.9909f, 1.0000f, 1.0000f, 0.9944f, 0.8116f, 0.9130f,
- 1.0000f, 0.9976f, 0.9907f, 0.2986f, 1.0000f, 0.7573f, 1.0000f, 1.0000f, 1.0000f, 0.8490f, 1.0000f, 1.0000f, 1.0000f, 0.9952f, 0.5879f, 1.0000f,
- 1.0000f, 0.9978f, 0.8963f, 0.1264f, 1.0000f, 0.8747f, 1.0000f, 1.0000f, 1.0000f, 0.9681f, 1.0000f, 1.0000f, 1.0000f, 0.9660f, 0.8427f, 1.0000f,
- 1.0000f, 0.9895f, 0.5337f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5668f, 1.0000f, 1.0000f,
- 1.0000f, 0.9918f, 0.2925f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9094f, 1.0000f, 1.0000f,
- 1.0000f, 0.8639f, 0.4569f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6444f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9985f, 0.9940f, 1.0000f, 0.9973f, 0.8351f, 0.9903f, 1.0000f, 0.9980f, 0.9326f, 0.9989f, 1.0000f, 1.0000f, 0.9933f, 0.8985f,
- 1.0000f, 0.9943f, 0.9955f, 0.9873f, 1.0000f, 0.9745f, 0.7746f, 1.0000f, 1.0000f, 0.9938f, 0.9006f, 1.0000f, 1.0000f, 0.9945f, 0.9789f, 0.7974f,
- 1.0000f, 0.9850f, 0.9524f, 0.2388f, 1.0000f, 0.9599f, 1.0000f, 1.0000f, 1.0000f, 0.9942f, 1.0000f, 1.0000f, 1.0000f, 0.9958f, 0.7127f, 1.0000f,
- 1.0000f, 0.9773f, 0.7247f, 0.4198f, 1.0000f, 0.6892f, 1.0000f, 1.0000f, 1.0000f, 0.8571f, 1.0000f, 1.0000f, 1.0000f, 0.9382f, 1.0000f, 1.0000f,
- 1.0000f, 0.9884f, 0.2172f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9642f, 1.0000f, 1.0000f,
- 1.0000f, 0.8480f, 0.4434f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6269f, 1.0000f, 1.0000f,
- 1.0000f, 0.9311f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.2529f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9999f, 0.9981f, 0.9645f, 0.8911f, 0.9990f, 0.7919f, 1.0000f, 0.5031f, 0.9778f, 0.8992f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9970f, 0.9886f, 0.8417f, 0.0322f, 0.9281f, 0.9678f, 1.0000f, 1.0000f, 0.9706f, 0.9889f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9983f,
- 1.0000f, 0.9950f, 0.7891f, 0.9206f, 0.7435f, 0.9142f, 1.0000f, 1.0000f, 1.0000f, 0.9861f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 1.0000f,
- 1.0000f, 0.9780f, 0.2459f, 1.0000f, 0.0876f, 0.9764f, 1.0000f, 1.0000f, 1.0000f, 0.9928f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9815f, 0.7453f, 1.0000f, 0.1796f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9978f, 0.9993f,
- 1.0000f, 0.5449f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 1.0000f, 0.9995f,
- 1.0000f, 0.8888f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9974f, 1.0000f,
- 1.0000f, 0.3223f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 0.9991f, 0.9878f,
- 1.0000f, 0.9952f, 0.9695f, 0.8856f, 1.0000f, 0.9703f, 0.8091f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9964f,
- 1.0000f, 0.9864f, 0.9275f, 0.7715f, 1.0000f, 0.8799f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9983f,
- 1.0000f, 0.9785f, 0.4700f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9949f, 0.9910f,
- 1.0000f, 0.8658f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9977f,
- 1.0000f, 0.9626f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9970f, 0.9804f,
- 1.0000f, 0.3836f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9954f, 0.9930f, 0.5070f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9546f, 0.5412f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9831f, 0.8202f, 0.7305f,
- 1.0000f, 0.9993f, 0.9321f, 0.7622f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7638f, 1.0000f, 1.0000f,
- 1.0000f, 0.9906f, 0.9217f, 0.9698f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9345f, 1.0000f, 1.0000f,
- 1.0000f, 0.0665f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.4784f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8694f, 0.8214f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 1.0000f, 1.0000f,
- 1.0000f, 0.8295f, 0.9829f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7417f, 1.0000f, 1.0000f, 0.8178f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 1.0000f, 0.9996f,
- 1.0000f, 0.9255f, 1.0000f, 1.0000f, 0.1357f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f, 0.9965f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1629f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9919f, 0.9996f, 0.9966f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9967f, 0.9984f, 0.9616f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f, 0.9464f, 0.7933f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9417f, 0.9748f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9027f, 0.8053f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8329f, 0.9992f, 1.0000f,
- 1.0000f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9890f, 1.0000f, 0.9984f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 1.0000f, 0.9409f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8926f, 0.3509f, 0.9244f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7540f, 0.6579f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3105f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6958f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
-
-const float percentile_table_12x12[2048] = {
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6459f, 1.0000f, 0.9751f, 0.9422f, 0.8309f, 1.0000f, 0.9931f, 0.9934f, 0.5189f, 1.0000f, 0.9984f, 0.9983f,
- 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.8017f, 0.9895f, 0.9892f, 0.9881f, 0.7254f, 0.9869f, 0.9932f, 0.9621f, 0.2345f, 1.0000f, 0.9979f, 0.9988f,
- 1.0000f, 1.0000f, 0.9882f, 0.9996f, 0.7782f, 0.9961f, 0.9574f, 0.7435f, 0.5997f, 0.9965f, 0.9644f, 0.7057f, 0.8481f, 1.0000f, 0.9914f, 0.9132f,
- 1.0000f, 1.0000f, 0.9990f, 0.9919f, 0.8255f, 0.9789f, 0.9227f, 0.6933f, 0.5375f, 0.9716f, 0.9361f, 0.6779f, 1.0000f, 0.9858f, 0.9781f, 0.9066f,
- 1.0000f, 1.0000f, 0.9834f, 0.9545f, 0.7662f, 0.9394f, 0.6975f, 0.7216f, 0.8351f, 0.9755f, 0.7097f, 0.6513f, 1.0000f, 0.9863f, 0.9178f, 0.4660f,
- 1.0000f, 0.9725f, 0.9933f, 0.9434f, 0.2471f, 0.9189f, 0.3612f, 0.9206f, 1.0000f, 0.9402f, 0.3160f, 0.9155f, 1.0000f, 0.9609f, 0.8537f, 0.4868f,
- 1.0000f, 1.0000f, 0.9701f, 0.8698f, 0.3053f, 0.8945f, 0.1802f, 1.0000f, 1.0000f, 0.9097f, 0.1414f, 1.0000f, 1.0000f, 0.9735f, 0.5781f, 0.2594f,
- 1.0000f, 0.9799f, 0.8628f, 0.5549f, 0.7235f, 0.6824f, 0.6996f, 1.0000f, 1.0000f, 0.6566f, 0.6802f, 1.0000f, 1.0000f, 0.9138f, 0.3107f, 0.6348f,
- 1.0000f, 1.0000f, 1.0000f, 0.9960f, 0.7016f, 1.0000f, 0.9711f, 0.9184f, 0.8830f, 1.0000f, 0.9853f, 0.9378f, 0.6710f, 1.0000f, 0.9975f, 0.9957f,
- 1.0000f, 1.0000f, 0.9975f, 0.9999f, 0.8723f, 0.9875f, 0.9486f, 0.9398f, 0.8210f, 0.9647f, 0.9783f, 0.9021f, 0.5149f, 1.0000f, 0.9980f, 0.9926f,
- 1.0000f, 1.0000f, 0.9947f, 0.9888f, 0.8966f, 0.9873f, 0.9252f, 0.7117f, 0.6615f, 0.9718f, 0.9475f, 0.7137f, 0.8952f, 1.0000f, 0.9596f, 0.9339f,
- 1.0000f, 0.9923f, 0.9870f, 0.8878f, 0.8637f, 0.9464f, 0.6891f, 0.7469f, 0.4040f, 0.9507f, 0.6756f, 0.6869f, 1.0000f, 0.9830f, 0.9704f, 0.5812f,
- 1.0000f, 1.0000f, 0.9593f, 0.9167f, 0.8068f, 0.9558f, 0.5302f, 0.8806f, 0.8233f, 0.9825f, 0.4531f, 0.8915f, 1.0000f, 0.9739f, 0.8443f, 0.3467f,
- 1.0000f, 0.9836f, 0.8757f, 0.5651f, 0.2714f, 0.7977f, 0.6291f, 1.0000f, 1.0000f, 0.8116f, 0.4268f, 1.0000f, 1.0000f, 0.9109f, 0.3660f, 0.6540f,
- 1.0000f, 0.9921f, 0.9172f, 0.5515f, 0.5480f, 0.7737f, 0.5446f, 1.0000f, 1.0000f, 0.8341f, 0.3317f, 1.0000f, 1.0000f, 0.9161f, 0.2772f, 0.5265f,
- 1.0000f, 0.9531f, 0.7273f, 0.2944f, 0.7452f, 0.4618f, 1.0000f, 1.0000f, 1.0000f, 0.3755f, 1.0000f, 1.0000f, 1.0000f, 0.8092f, 0.3851f, 1.0000f,
- 1.0000f, 1.0000f, 0.9887f, 0.9982f, 0.9281f, 1.0000f, 0.9658f, 0.9352f, 0.1329f, 1.0000f, 0.9864f, 0.9410f, 0.5030f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9988f, 0.9984f, 0.6954f, 0.9479f, 0.8814f, 0.7157f, 0.2014f, 0.9811f, 0.9453f, 0.7796f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9809f, 0.9084f, 0.8663f, 0.9661f, 0.8030f, 0.6263f, 0.0965f, 0.9913f, 0.7895f, 0.5717f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9680f, 0.9757f, 0.9059f, 0.3993f, 0.9748f, 0.6663f, 0.8592f, 1.0000f, 0.9688f, 0.6912f, 0.7937f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9706f, 0.9639f, 0.5227f, 0.8500f, 0.9247f, 0.3368f, 1.0000f, 0.4827f, 0.9335f, 0.1946f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9561f, 0.8619f, 0.4909f, 0.0437f, 0.7752f, 0.8518f, 1.0000f, 1.0000f, 0.7347f, 0.7767f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f,
- 1.0000f, 0.9677f, 0.5749f, 0.2886f, 0.7291f, 0.8372f, 1.0000f, 1.0000f, 1.0000f, 0.8681f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9996f,
- 1.0000f, 0.9313f, 0.3265f, 0.6234f, 0.1063f, 0.2147f, 1.0000f, 1.0000f, 1.0000f, 0.1153f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9978f, 1.0000f,
- 1.0000f, 1.0000f, 0.9856f, 0.9986f, 0.4990f, 1.0000f, 0.8413f, 0.8128f, 1.0000f, 1.0000f, 0.9348f, 0.8452f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9954f, 0.9803f, 0.4949f, 0.9457f, 0.9257f, 0.5339f, 1.0000f, 0.9872f, 0.9691f, 0.6591f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9721f, 0.9272f, 0.4087f, 0.9641f, 0.5875f, 0.7631f, 1.0000f, 0.9535f, 0.5843f, 0.6687f, 1.0000f, 1.0000f, 1.0000f, 0.9997f,
- 1.0000f, 0.9723f, 0.9445f, 0.6147f, 0.6206f, 0.8789f, 0.4703f, 1.0000f, 1.0000f, 0.9149f, 0.4444f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9890f,
- 1.0000f, 0.9841f, 0.8610f, 0.4313f, 1.0000f, 0.8176f, 0.6117f, 1.0000f, 1.0000f, 0.8740f, 0.2408f, 1.0000f, 1.0000f, 1.0000f, 0.9986f, 0.9985f,
- 1.0000f, 0.8994f, 0.4178f, 0.7486f, 1.0000f, 0.6431f, 1.0000f, 1.0000f, 1.0000f, 0.6404f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9989f, 0.9916f,
- 1.0000f, 0.9300f, 0.2829f, 0.5584f, 1.0000f, 0.7417f, 1.0000f, 1.0000f, 1.0000f, 0.8298f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9963f, 0.9964f,
- 1.0000f, 0.8244f, 0.4575f, 1.0000f, 1.0000f, 0.4744f, 1.0000f, 1.0000f, 1.0000f, 0.2214f, 1.0000f, 1.0000f, 1.0000f, 0.9944f, 0.9900f, 0.8838f,
- 1.0000f, 0.9996f, 0.9997f, 0.9984f, 0.4786f, 0.9295f, 0.8862f, 0.9633f, 0.9490f, 0.9672f, 0.9200f, 0.9730f, 1.0000f, 0.9956f, 0.9946f, 0.9742f,
- 1.0000f, 0.9999f, 0.9991f, 0.9603f, 0.5967f, 0.8870f, 0.9430f, 0.9650f, 1.0000f, 0.9322f, 0.9555f, 0.9787f, 1.0000f, 0.9815f, 0.9866f, 0.8893f,
- 1.0000f, 0.9482f, 0.9813f, 0.9524f, 1.0000f, 0.8715f, 0.9805f, 1.0000f, 1.0000f, 0.8773f, 0.9766f, 1.0000f, 1.0000f, 0.7196f, 0.8930f, 0.9764f,
- 1.0000f, 0.8959f, 0.9606f, 0.7825f, 1.0000f, 0.9460f, 1.0000f, 1.0000f, 1.0000f, 0.9630f, 1.0000f, 1.0000f, 1.0000f, 0.8383f, 0.9521f, 0.9948f,
- 1.0000f, 0.8490f, 0.8140f, 0.9565f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7502f, 0.9386f, 1.0000f,
- 1.0000f, 0.7810f, 0.9382f, 0.9636f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8320f, 1.0000f, 1.0000f,
- 1.0000f, 0.2999f, 0.8646f, 0.9777f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7600f, 0.9696f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9997f, 0.9850f, 0.9027f, 0.5618f, 0.8055f, 0.9001f, 0.9974f, 0.9685f, 0.8509f, 0.8556f, 0.9959f, 1.0000f, 0.9441f, 0.9774f, 0.9762f,
- 1.0000f, 0.9965f, 0.9693f, 0.9242f, 0.6376f, 0.8423f, 0.9666f, 0.9922f, 1.0000f, 0.8987f, 0.9669f, 0.9991f, 1.0000f, 0.9938f, 0.9528f, 0.9891f,
- 1.0000f, 0.9612f, 0.7923f, 0.8574f, 1.0000f, 0.9237f, 1.0000f, 1.0000f, 1.0000f, 0.9344f, 1.0000f, 1.0000f, 1.0000f, 0.7535f, 0.9768f, 1.0000f,
- 1.0000f, 0.9449f, 0.9374f, 0.9517f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9040f, 0.9955f, 1.0000f,
- 1.0000f, 0.3213f, 0.8923f, 0.9708f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8765f, 1.0000f, 1.0000f,
- 1.0000f, 0.7552f, 0.9548f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7839f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8706f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9918f, 0.9807f, 0.9627f, 0.8546f, 0.6176f, 0.8781f, 0.9819f, 0.0866f, 0.6733f, 0.8288f, 0.9937f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9744f, 0.9737f, 0.8199f, 0.3803f, 0.7519f, 0.9930f, 1.0000f, 1.0000f, 0.7615f, 0.9885f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.7365f, 0.9090f, 0.9793f, 0.8277f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8528f, 0.9568f, 0.9837f, 0.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9990f, 0.9999f,
- 1.0000f, 0.7722f, 0.9414f, 1.0000f, 0.6847f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9977f, 0.9969f,
- 1.0000f, 0.8885f, 1.0000f, 1.0000f, 0.0762f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 0.9624f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1243f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9920f, 0.9276f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9827f, 0.9500f,
- 1.0000f, 0.9304f, 0.9600f, 0.9571f, 1.0000f, 0.6639f, 0.9078f, 1.0000f, 1.0000f, 0.7310f, 0.8980f, 1.0000f, 1.0000f, 1.0000f, 0.9989f, 1.0000f,
- 1.0000f, 0.9896f, 0.9211f, 0.9675f, 1.0000f, 0.8362f, 0.9969f, 1.0000f, 1.0000f, 0.8004f, 0.9848f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f,
- 1.0000f, 0.7853f, 0.9779f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9941f, 0.9331f,
- 1.0000f, 0.9120f, 0.9894f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9999f, 0.9899f, 0.7867f,
- 1.0000f, 0.8222f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9365f, 0.9746f, 0.9653f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9034f, 0.9538f, 0.7964f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9581f, 0.8043f, 0.8462f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9357f, 0.9493f, 0.9390f,
- 1.0000f, 1.0000f, 0.9983f, 0.9987f, 0.9103f, 0.9995f, 0.9426f, 0.8973f, 0.9978f, 0.9971f, 0.9839f, 0.8152f, 1.0000f, 0.9945f, 0.9970f, 0.9795f,
- 1.0000f, 0.9991f, 0.9998f, 0.9973f, 0.7647f, 0.9728f, 0.9114f, 1.0000f, 1.0000f, 0.9976f, 0.9216f, 0.9999f, 1.0000f, 0.9981f, 0.9844f, 0.8164f,
- 1.0000f, 0.9999f, 0.9828f, 0.9541f, 1.0000f, 0.9797f, 0.9664f, 1.0000f, 1.0000f, 0.9785f, 0.9590f, 1.0000f, 1.0000f, 0.9980f, 0.7568f, 0.8854f,
- 1.0000f, 0.9843f, 0.9832f, 0.4132f, 1.0000f, 0.8187f, 1.0000f, 1.0000f, 1.0000f, 0.8393f, 1.0000f, 1.0000f, 1.0000f, 0.9683f, 0.4401f, 1.0000f,
- 1.0000f, 0.9952f, 0.8565f, 0.0654f, 1.0000f, 0.9144f, 1.0000f, 1.0000f, 1.0000f, 0.9126f, 1.0000f, 1.0000f, 1.0000f, 0.9867f, 0.7177f, 1.0000f,
- 1.0000f, 0.9884f, 0.2654f, 0.9999f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.5906f, 1.0000f, 1.0000f,
- 1.0000f, 0.9927f, 0.1728f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8672f, 1.0000f, 1.0000f,
- 1.0000f, 0.8731f, 0.5070f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.3946f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 0.9986f, 1.0000f, 0.9929f, 0.9979f, 0.8655f, 0.9861f, 0.9990f, 0.9902f, 0.9262f, 0.9732f, 1.0000f, 0.9972f, 0.9943f, 0.8583f,
- 1.0000f, 0.9939f, 0.9846f, 0.9698f, 0.9047f, 0.9772f, 0.7991f, 1.0000f, 1.0000f, 0.9948f, 0.8403f, 1.0000f, 1.0000f, 0.9967f, 0.9878f, 0.7328f,
- 1.0000f, 0.9942f, 0.9587f, 0.3898f, 1.0000f, 0.9791f, 1.0000f, 1.0000f, 1.0000f, 0.9851f, 1.0000f, 1.0000f, 1.0000f, 0.9958f, 0.6087f, 1.0000f,
- 1.0000f, 0.9406f, 0.7707f, 0.5410f, 1.0000f, 0.7881f, 1.0000f, 1.0000f, 1.0000f, 0.7077f, 1.0000f, 1.0000f, 1.0000f, 0.9286f, 1.0000f, 1.0000f,
- 1.0000f, 0.9910f, 0.2280f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9511f, 1.0000f, 1.0000f,
- 1.0000f, 0.8601f, 0.4223f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.2533f, 1.0000f, 1.0000f,
- 1.0000f, 0.9821f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.2080f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9959f, 0.9713f, 0.9753f, 0.8471f, 0.9879f, 0.8331f, 1.0000f, 0.3708f, 0.9967f, 0.9014f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9966f, 0.9877f, 0.8689f, 0.0321f, 0.9577f, 0.9770f, 1.0000f, 1.0000f, 0.9817f, 0.9940f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9992f,
- 1.0000f, 0.9928f, 0.8080f, 0.9497f, 0.7037f, 0.9222f, 1.0000f, 1.0000f, 1.0000f, 0.9859f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9615f, 0.5110f, 1.0000f, 0.0206f, 0.9907f, 1.0000f, 1.0000f, 1.0000f, 0.9801f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9973f, 0.9992f,
- 1.0000f, 0.9369f, 0.7400f, 1.0000f, 0.1654f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9991f, 0.9962f,
- 1.0000f, 0.5684f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 0.9909f, 1.0000f,
- 1.0000f, 0.8938f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9968f, 0.9992f,
- 1.0000f, 0.4488f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9987f, 0.9955f, 0.9898f,
- 1.0000f, 0.9936f, 0.9855f, 0.8900f, 1.0000f, 0.9584f, 0.7950f, 1.0000f, 1.0000f, 0.9953f, 0.9072f, 1.0000f, 1.0000f, 1.0000f, 0.9997f, 1.0000f,
- 1.0000f, 0.9905f, 0.9655f, 0.8266f, 1.0000f, 0.9232f, 1.0000f, 1.0000f, 1.0000f, 0.9504f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f,
- 1.0000f, 0.9981f, 0.6320f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9998f, 1.0000f,
- 1.0000f, 0.9008f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9823f, 0.9618f,
- 1.0000f, 0.9195f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9988f, 0.9935f, 0.9468f,
- 1.0000f, 0.3515f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9915f, 0.9904f, 0.3418f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9985f, 0.9471f, 0.4357f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9924f, 0.7909f, 0.6057f,
- 1.0000f, 0.9971f, 0.9903f, 0.8822f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.7382f, 1.0000f, 1.0000f,
- 1.0000f, 0.9989f, 0.9912f, 0.9759f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9326f, 1.0000f, 1.0000f,
- 1.0000f, 0.1874f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.5936f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.9290f, 0.8748f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8104f, 0.9963f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 0.8433f, 1.0000f, 1.0000f, 0.7692f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f,
- 1.0000f, 0.9514f, 1.0000f, 1.0000f, 0.0546f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9993f, 1.0000f, 0.9949f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1497f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9976f, 0.9950f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f, 0.9994f, 0.9418f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9908f, 0.9309f, 0.7584f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9951f, 0.9267f, 0.9318f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9437f, 0.7677f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8797f, 0.9994f, 1.0000f,
- 1.0000f, 0.9982f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9994f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9995f, 0.9995f, 0.9551f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.9053f, 0.3564f, 0.8908f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.8846f, 0.6486f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.1577f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 0.6027f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
- 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f, 1.0000f,
-};
diff --git a/3rdparty/bimg/3rdparty/astc/astc_pick_best_endpoint_format.cpp b/3rdparty/bimg/3rdparty/astc/astc_pick_best_endpoint_format.cpp
deleted file mode 100644
index 5c6360ddc91..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_pick_best_endpoint_format.cpp
+++ /dev/null
@@ -1,938 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Functions to pick the best ASTC endpoint format for a given block.
- */
-/*----------------------------------------------------------------------------*/
-#include "astc_codec_internals.h"
-
-#ifdef DEBUG_PRINT_DIAGNOSTICS
- #include <stdio.h>
-#endif
-
-#include <math.h>
-
-/*
- functions to determine, for a given partitioning, which color endpoint formats are the best to use.
-
- */
-
-
-// for a given partition, compute for every (integer-component-count, quantization-level)
-// the color error.
-
-
-static void compute_color_error_for_every_integer_count_and_quantization_level(int encode_hdr_rgb, // 1 = perform HDR encoding, 0 = perform LDR encoding.
- int encode_hdr_alpha, int partition_index, const partition_info * pi,
- const encoding_choice_errors * eci, // pointer to the structure for the CURRENT partition.
- const endpoints * ep, float4 error_weightings[4],
- // arrays to return results back through.
- float best_error[21][4], int format_of_choice[21][4])
-{
- int i, j;
- int partition_size = pi->texels_per_partition[partition_index];
-
- static const float baseline_quant_error[21] = {
- (65536.0f * 65536.0f / 18.0f), // 2 values, 1 step
- (65536.0f * 65536.0f / 18.0f) / (2 * 2), // 3 values, 2 steps
- (65536.0f * 65536.0f / 18.0f) / (3 * 3), // 4 values, 3 steps
- (65536.0f * 65536.0f / 18.0f) / (4 * 4), // 5 values
- (65536.0f * 65536.0f / 18.0f) / (5 * 5),
- (65536.0f * 65536.0f / 18.0f) / (7 * 7),
- (65536.0f * 65536.0f / 18.0f) / (9 * 9),
- (65536.0f * 65536.0f / 18.0f) / (11 * 11),
- (65536.0f * 65536.0f / 18.0f) / (15 * 15),
- (65536.0f * 65536.0f / 18.0f) / (19 * 19),
- (65536.0f * 65536.0f / 18.0f) / (23 * 23),
- (65536.0f * 65536.0f / 18.0f) / (31 * 31),
- (65536.0f * 65536.0f / 18.0f) / (39 * 39),
- (65536.0f * 65536.0f / 18.0f) / (47 * 47),
- (65536.0f * 65536.0f / 18.0f) / (63 * 63),
- (65536.0f * 65536.0f / 18.0f) / (79 * 79),
- (65536.0f * 65536.0f / 18.0f) / (95 * 95),
- (65536.0f * 65536.0f / 18.0f) / (127 * 127),
- (65536.0f * 65536.0f / 18.0f) / (159 * 159),
- (65536.0f * 65536.0f / 18.0f) / (191 * 191),
- (65536.0f * 65536.0f / 18.0f) / (255 * 255)
- };
-
- float4 ep0 = ep->endpt0[partition_index];
- float4 ep1 = ep->endpt1[partition_index];
-
- float ep0_max = MAX(MAX(ep0.x, ep0.y), ep0.z);
- float ep0_min = MIN(MIN(ep0.x, ep0.y), ep0.z);
- float ep1_max = MAX(MAX(ep1.x, ep1.y), ep1.z);
- float ep1_min = MIN(MIN(ep1.x, ep1.y), ep1.z);
-
- ep0_min = MAX(ep0_min, 0.0f);
- ep1_min = MAX(ep1_min, 0.0f);
- ep0_max = MAX(ep0_max, 1e-10f);
- ep1_max = MAX(ep1_max, 1e-10f);
-
- float4 error_weight = error_weightings[partition_index];
-
- float error_weight_rgbsum = error_weight.x + error_weight.y + error_weight.z;
-
- float range_upper_limit_rgb = encode_hdr_rgb ? 61440.0f : 65535.0f;
- float range_upper_limit_alpha = encode_hdr_alpha ? 61440.0f : 65535.0f;
-
- // it is possible to get endpoint colors significantly outside [0,upper-limit]
- // even if the input data are safely contained in [0,upper-limit];
- // we need to add an error term for this situation,
- float4 ep0_range_error_high;
- float4 ep1_range_error_high;
- float4 ep0_range_error_low;
- float4 ep1_range_error_low;
-
- ep0_range_error_high.x = MAX(0.0f, ep0.x - range_upper_limit_rgb);
- ep0_range_error_high.y = MAX(0.0f, ep0.y - range_upper_limit_rgb);
- ep0_range_error_high.z = MAX(0.0f, ep0.z - range_upper_limit_rgb);
- ep0_range_error_high.w = MAX(0.0f, ep0.w - range_upper_limit_alpha);
- ep1_range_error_high.x = MAX(0.0f, ep1.x - range_upper_limit_rgb);
- ep1_range_error_high.y = MAX(0.0f, ep1.y - range_upper_limit_rgb);
- ep1_range_error_high.z = MAX(0.0f, ep1.z - range_upper_limit_rgb);
- ep1_range_error_high.w = MAX(0.0f, ep1.w - range_upper_limit_alpha);
-
- ep0_range_error_low.x = MIN(0.0f, ep0.x);
- ep0_range_error_low.y = MIN(0.0f, ep0.y);
- ep0_range_error_low.z = MIN(0.0f, ep0.z);
- ep0_range_error_low.w = MIN(0.0f, ep0.w);
- ep1_range_error_low.x = MIN(0.0f, ep1.x);
- ep1_range_error_low.y = MIN(0.0f, ep1.y);
- ep1_range_error_low.z = MIN(0.0f, ep1.z);
- ep1_range_error_low.w = MIN(0.0f, ep1.w);
-
- float4 sum_range_error =
- (ep0_range_error_low * ep0_range_error_low) + (ep1_range_error_low * ep1_range_error_low) + (ep0_range_error_high * ep0_range_error_high) + (ep1_range_error_high * ep1_range_error_high);
- float rgb_range_error = dot(sum_range_error.xyz, error_weight.xyz) * 0.5f * partition_size;
- float alpha_range_error = sum_range_error.w * error_weight.w * 0.5f * partition_size;
-
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("%s : partition=%d\nrgb-error_wt=%f alpha_error_wt=%f\n", __func__, partition_index, error_weight_rgbsum, error_weight.w);
-
- printf("ep0 = %f %f %f %f\n", ep0.x, ep0.y, ep0.z, ep0.w);
- printf("ep1 = %f %f %f %f\n", ep1.x, ep1.y, ep1.z, ep1.w);
-
-
- printf("rgb_range_error = %f, alpha_range_error = %f\n", rgb_range_error, alpha_range_error);
-
- printf("rgb-luma-error: %f\n", eci->rgb_luma_error);
- }
- #endif
-
- if (encode_hdr_rgb)
- {
-
- // collect some statistics
- float af, cf;
- if (ep1.x > ep1.y && ep1.x > ep1.z)
- {
- af = ep1.x;
- cf = ep1.x - ep0.x;
- }
- else if (ep1.y > ep1.z)
- {
- af = ep1.y;
- cf = ep1.y - ep0.y;
- }
- else
- {
- af = ep1.z;
- cf = ep1.z - ep0.z;
- }
-
- float bf = af - ep1_min; // estimate of color-component spread in high endpoint color
- float3 prd = ep1.xyz - float3(cf, cf, cf);
- float3 pdif = prd - ep0.xyz;
- // estimate of color-component spread in low endpoint color
- float df = MAX(MAX(fabs(pdif.x), fabs(pdif.y)), fabs(pdif.z));
-
- int b = (int)bf;
- int c = (int)cf;
- int d = (int)df;
-
-
- // determine which one of the 6 submodes is likely to be used in
- // case of an RGBO-mode
- int rgbo_mode = 5; // 7 bits per component
- // mode 4: 8 7 6
- if (b < 32768 && c < 16384)
- rgbo_mode = 4;
- // mode 3: 9 6 7
- if (b < 8192 && c < 16384)
- rgbo_mode = 3;
- // mode 2: 10 5 8
- if (b < 2048 && c < 16384)
- rgbo_mode = 2;
- // mode 1: 11 6 5
- if (b < 2048 && c < 1024)
- rgbo_mode = 1;
- // mode 0: 11 5 7
- if (b < 1024 && c < 4096)
- rgbo_mode = 0;
-
- // determine which one of the 9 submodes is likely to be used in
- // case of an RGB-mode.
- int rgb_mode = 8; // 8 bits per component, except 7 bits for blue
-
- // mode 0: 9 7 6 7
- if (b < 16384 && c < 8192 && d < 8192)
- rgb_mode = 0;
- // mode 1: 9 8 6 6
- if (b < 32768 && c < 8192 && d < 4096)
- rgb_mode = 1;
- // mode 2: 10 6 7 7
- if (b < 4096 && c < 8192 && d < 4096)
- rgb_mode = 2;
- // mode 3: 10 7 7 6
- if (b < 8192 && c < 8192 && d < 2048)
- rgb_mode = 3;
- // mode 4: 11 8 6 5
- if (b < 8192 && c < 2048 && d < 512)
- rgb_mode = 4;
- // mode 5: 11 6 8 6
- if (b < 2048 && c < 8192 && d < 1024)
- rgb_mode = 5;
- // mode 6: 12 7 7 5
- if (b < 2048 && c < 2048 && d < 256)
- rgb_mode = 6;
- // mode 7: 12 6 7 6
- if (b < 1024 && c < 2048 && d < 512)
- rgb_mode = 7;
-
-
- static const float rgbo_error_scales[6] = { 4.0f, 4.0f, 16.0f, 64.0f, 256.0f, 1024.0f };
- static const float rgb_error_scales[9] = { 64.0f, 64.0f, 16.0f, 16.0f, 4.0f, 4.0f, 1.0f, 1.0f, 384.0f };
-
- float mode7mult = rgbo_error_scales[rgbo_mode] * 0.0015f; // empirically determined ....
- float mode11mult = rgb_error_scales[rgb_mode] * 0.010f; // empirically determined ....
-
-
- float lum_high = (ep1.x + ep1.y + ep1.z) * (1.0f / 3.0f);
- float lum_low = (ep0.x + ep0.y + ep0.z) * (1.0f / 3.0f);
- float lumdif = lum_high - lum_low;
- float mode23mult = lumdif < 960 ? 4.0f : lumdif < 3968 ? 16.0f : 128.0f;
-
- mode23mult *= 0.0005f; // empirically determined ....
-
-
-
- // pick among the available HDR endpoint modes
- for (i = 0; i < 8; i++)
- {
- best_error[i][3] = 1e30f;
- format_of_choice[i][3] = encode_hdr_alpha ? FMT_HDR_RGBA : FMT_HDR_RGB_LDR_ALPHA;
- best_error[i][2] = 1e30f;
- format_of_choice[i][2] = FMT_HDR_RGB;
- best_error[i][1] = 1e30f;
- format_of_choice[i][1] = FMT_HDR_RGB_SCALE;
- best_error[i][0] = 1e30f;
- format_of_choice[i][0] = FMT_HDR_LUMINANCE_LARGE_RANGE;
- }
-
-
- for (i = 8; i < 21; i++)
- {
- // base_quant_error should depend on the scale-factor that would be used
- // during actual encode of the color value.
-
- float base_quant_error = baseline_quant_error[i] * partition_size * 1.0f;
- float rgb_quantization_error = error_weight_rgbsum * base_quant_error * 2.0f;
- float alpha_quantization_error = error_weight.w * base_quant_error * 2.0f;
- float rgba_quantization_error = rgb_quantization_error + alpha_quantization_error;
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("rgba-quant = %f can_offset_encode=%d\n", rgba_quantization_error, eci->can_offset_encode);
- #endif
-
- // for 8 integers, we have two encodings: one with HDR alpha and another one
- // with LDR alpha.
-
- float full_hdr_rgba_error = rgba_quantization_error + rgb_range_error + alpha_range_error;
- best_error[i][3] = full_hdr_rgba_error;
- format_of_choice[i][3] = encode_hdr_alpha ? FMT_HDR_RGBA : FMT_HDR_RGB_LDR_ALPHA;
-
- // for 6 integers, we have one HDR-RGB encoding
- float full_hdr_rgb_error = (rgb_quantization_error * mode11mult) + rgb_range_error + eci->alpha_drop_error;
- best_error[i][2] = full_hdr_rgb_error;
- format_of_choice[i][2] = FMT_HDR_RGB;
-
- // for 4 integers, we have one HDR-RGB-Scale encoding
- float hdr_rgb_scale_error = (rgb_quantization_error * mode7mult) + rgb_range_error + eci->alpha_drop_error + eci->rgb_luma_error;
-
- best_error[i][1] = hdr_rgb_scale_error;
- format_of_choice[i][1] = FMT_HDR_RGB_SCALE;
-
- // for 2 integers, we assume luminance-with-large-range
- float hdr_luminance_error = (rgb_quantization_error * mode23mult) + rgb_range_error + eci->alpha_drop_error + eci->luminance_error;
- best_error[i][0] = hdr_luminance_error;
- format_of_choice[i][0] = FMT_HDR_LUMINANCE_LARGE_RANGE;
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- for (j = 0; j < 4; j++)
- {
- printf("(hdr) quant-level=%d ints=%d format=%d error=%f\n", i, j, format_of_choice[i][j], best_error[i][j]);
- }
- }
- #endif
- }
- }
-
-
- else
- {
- for (i = 0; i < 4; i++)
- {
- best_error[i][3] = 1e30f;
- best_error[i][2] = 1e30f;
- best_error[i][1] = 1e30f;
- best_error[i][0] = 1e30f;
-
- format_of_choice[i][3] = FMT_RGBA;
- format_of_choice[i][2] = FMT_RGB;
- format_of_choice[i][1] = FMT_RGB_SCALE;
- format_of_choice[i][0] = FMT_LUMINANCE;
- }
-
-
- // pick among the available LDR endpoint modes
- for (i = 4; i < 21; i++)
- {
- float base_quant_error = baseline_quant_error[i] * partition_size * 1.0f;
- float rgb_quantization_error = error_weight_rgbsum * base_quant_error;
- float alpha_quantization_error = error_weight.w * base_quant_error;
- float rgba_quantization_error = rgb_quantization_error + alpha_quantization_error;
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- printf("rgba-quant = %f can_offset_encode=%d\n", rgba_quantization_error, eci->can_offset_encode);
- #endif
-
- // for 8 integers, the available encodings are:
- // full LDR RGB-Alpha
- float full_ldr_rgba_error = rgba_quantization_error;
- if (eci->can_blue_contract)
- full_ldr_rgba_error *= 0.625f;
- if (eci->can_offset_encode && i <= 18)
- full_ldr_rgba_error *= 0.5f;
- full_ldr_rgba_error += rgb_range_error + alpha_range_error;
-
- best_error[i][3] = full_ldr_rgba_error;
- format_of_choice[i][3] = FMT_RGBA;
-
- // for 6 integers, we have:
- // - an LDR-RGB encoding
- // - an RGBS + Alpha encoding (LDR)
-
- float full_ldr_rgb_error = rgb_quantization_error;
- if (eci->can_blue_contract)
- full_ldr_rgb_error *= 0.5f;
- if (eci->can_offset_encode && i <= 18)
- full_ldr_rgb_error *= 0.25f;
- full_ldr_rgb_error += eci->alpha_drop_error + rgb_range_error;
-
- float rgbs_alpha_error = rgba_quantization_error + eci->rgb_scale_error + rgb_range_error + alpha_range_error;
-
- if (rgbs_alpha_error < full_ldr_rgb_error)
- {
- best_error[i][2] = rgbs_alpha_error;
- format_of_choice[i][2] = FMT_RGB_SCALE_ALPHA;
- }
- else
- {
- best_error[i][2] = full_ldr_rgb_error;
- format_of_choice[i][2] = FMT_RGB;
- }
-
-
- // for 4 integers, we have a Luminance-Alpha encoding and the RGBS encoding
- float ldr_rgbs_error = rgb_quantization_error + eci->alpha_drop_error + eci->rgb_scale_error + rgb_range_error;
-
- float lum_alpha_error = rgba_quantization_error + eci->luminance_error + rgb_range_error + alpha_range_error;
-
- if (ldr_rgbs_error < lum_alpha_error)
- {
- best_error[i][1] = ldr_rgbs_error;
- format_of_choice[i][1] = FMT_RGB_SCALE;
- }
- else
- {
- best_error[i][1] = lum_alpha_error;
- format_of_choice[i][1] = FMT_LUMINANCE_ALPHA;
- }
-
-
- // for 2 integers, we have a Luminance-encoding and an Alpha-encoding.
- float luminance_error = rgb_quantization_error + eci->alpha_drop_error + eci->luminance_error + rgb_range_error;
-
- best_error[i][0] = luminance_error;
- format_of_choice[i][0] = FMT_LUMINANCE;
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- for (j = 0; j < 4; j++)
- {
- printf(" (ldr) quant-level=%d ints=%d format=%d error=%f\n", i, j, format_of_choice[i][j], best_error[i][j]);
- }
- }
- #endif
- }
- }
-}
-
-
-
-// for 1 partition, find the best combination (one format + a quantization level) for a given bitcount
-
-static void one_partition_find_best_combination_for_bitcount(float combined_best_error[21][4],
- int formats_of_choice[21][4], int bits_available, int *best_quantization_level, int *best_formats, float *error_of_best_combination)
-{
- int i;
- int best_integer_count = -1;
- float best_integer_count_error = 1e20f;
- for (i = 0; i < 4; i++)
- {
- // compute the quantization level for a given number of integers and a given number of bits.
- int quantization_level = quantization_mode_table[i + 1][bits_available];
- if (quantization_level == -1)
- continue; // used to indicate the case where we don't have enough bits to represent a given endpoint format at all.
- if (combined_best_error[quantization_level][i] < best_integer_count_error)
- {
- best_integer_count_error = combined_best_error[quantization_level][i];
- best_integer_count = i;
- }
- }
-
- int ql = quantization_mode_table[best_integer_count + 1][bits_available];
-
- *best_quantization_level = ql;
- *error_of_best_combination = best_integer_count_error;
- if (ql >= 0)
- *best_formats = formats_of_choice[ql][best_integer_count];
- else
- *best_formats = FMT_LUMINANCE;
-
-}
-
-
-
-// for 2 partitions, find the best format combinations for every (quantization-mode, integer-count) combination
-
-static void two_partitions_find_best_combination_for_every_quantization_and_integer_count(float best_error[2][21][4], // indexed by (partition, quant-level, integer-pair-count-minus-1)
- int format_of_choice[2][21][4],
- float combined_best_error[21][7], // indexed by (quant-level, integer-pair-count-minus-2)
- int formats_of_choice[21][7][2])
-{
- int i, j;
-
- for (i = 0; i < 21; i++)
- for (j = 0; j < 7; j++)
- combined_best_error[i][j] = 1e30f;
-
- int quant;
- for (quant = 5; quant < 21; quant++)
- {
- for (i = 0; i < 4; i++) // integer-count for first endpoint-pair
- {
- for (j = 0; j < 4; j++) // integer-count for second endpoint-pair
- {
- int low2 = MIN(i, j);
- int high2 = MAX(i, j);
- if ((high2 - low2) > 1)
- continue;
-
- int intcnt = i + j;
- float errorterm = MIN(best_error[0][quant][i] + best_error[1][quant][j], 1e10f);
- if (errorterm <= combined_best_error[quant][intcnt])
- {
- combined_best_error[quant][intcnt] = errorterm;
- formats_of_choice[quant][intcnt][0] = format_of_choice[0][quant][i];
- formats_of_choice[quant][intcnt][1] = format_of_choice[1][quant][j];
- }
- }
- }
- }
-}
-
-
-// for 2 partitions, find the best combination (two formats + a quantization level) for a given bitcount
-
-static void two_partitions_find_best_combination_for_bitcount(float combined_best_error[21][7],
- int formats_of_choice[21][7][2],
- int bits_available, int *best_quantization_level, int *best_quantization_level_mod, int *best_formats, float *error_of_best_combination)
-{
- int i;
-
- int best_integer_count = 0;
- float best_integer_count_error = 1e20f;
- int integer_count;
-
- for (integer_count = 2; integer_count <= 8; integer_count++)
- {
- // compute the quantization level for a given number of integers and a given number of bits.
- int quantization_level = quantization_mode_table[integer_count][bits_available];
- if (quantization_level == -1)
- break; // used to indicate the case where we don't have enough bits to represent a given endpoint format at all.
- float integer_count_error = combined_best_error[quantization_level][integer_count - 2];
- if (integer_count_error < best_integer_count_error)
- {
- best_integer_count_error = integer_count_error;
- best_integer_count = integer_count;
- }
- }
-
- int ql = quantization_mode_table[best_integer_count][bits_available];
- int ql_mod = quantization_mode_table[best_integer_count][bits_available + 2];
-
- *best_quantization_level = ql;
- *best_quantization_level_mod = ql_mod;
- *error_of_best_combination = best_integer_count_error;
- if (ql >= 0)
- {
- for (i = 0; i < 2; i++)
- best_formats[i] = formats_of_choice[ql][best_integer_count - 2][i];
- }
- else
- {
- for (i = 0; i < 2; i++)
- best_formats[i] = FMT_LUMINANCE;
- }
-}
-
-
-
-
-// for 3 partitions, find the best format combinations for every (quantization-mode, integer-count) combination
-
-static void three_partitions_find_best_combination_for_every_quantization_and_integer_count(float best_error[3][21][4], // indexed by (partition, quant-level, integer-count)
- int format_of_choice[3][21][4], float combined_best_error[21][10], int formats_of_choice[21][10][3])
-{
- int i, j, k;
-
- for (i = 0; i < 21; i++)
- for (j = 0; j < 10; j++)
- combined_best_error[i][j] = 1e30f;
-
- int quant;
- for (quant = 5; quant < 21; quant++)
- {
- for (i = 0; i < 4; i++) // integer-count for first endpoint-pair
- {
- for (j = 0; j < 4; j++) // integer-count for second endpoint-pair
- {
- int low2 = MIN(i, j);
- int high2 = MAX(i, j);
- if ((high2 - low2) > 1)
- continue;
- for (k = 0; k < 4; k++) // integer-count for third endpoint-pair
- {
- int low3 = MIN(k, low2);
- int high3 = MAX(k, high2);
- if ((high3 - low3) > 1)
- continue;
-
- int intcnt = i + j + k;
- float errorterm = MIN(best_error[0][quant][i] + best_error[1][quant][j] + best_error[2][quant][k], 1e10f);
- if (errorterm <= combined_best_error[quant][intcnt])
- {
- combined_best_error[quant][intcnt] = errorterm;
- formats_of_choice[quant][intcnt][0] = format_of_choice[0][quant][i];
- formats_of_choice[quant][intcnt][1] = format_of_choice[1][quant][j];
- formats_of_choice[quant][intcnt][2] = format_of_choice[2][quant][k];
- }
- }
- }
- }
- }
-}
-
-
-// for 3 partitions, find the best combination (three formats + a quantization level) for a given bitcount
-
-static void three_partitions_find_best_combination_for_bitcount(float combined_best_error[21][10],
- int formats_of_choice[21][10][3],
- int bits_available, int *best_quantization_level, int *best_quantization_level_mod, int *best_formats, float *error_of_best_combination)
-{
- int i;
-
- int best_integer_count = 0;
- float best_integer_count_error = 1e20f;
- int integer_count;
-
- for (integer_count = 3; integer_count <= 9; integer_count++)
- {
- // compute the quantization level for a given number of integers and a given number of bits.
- int quantization_level = quantization_mode_table[integer_count][bits_available];
- if (quantization_level == -1)
- break; // used to indicate the case where we don't have enough bits to represent a given endpoint format at all.
- float integer_count_error = combined_best_error[quantization_level][integer_count - 3];
- if (integer_count_error < best_integer_count_error)
- {
- best_integer_count_error = integer_count_error;
- best_integer_count = integer_count;
- }
- }
-
- int ql = quantization_mode_table[best_integer_count][bits_available];
- int ql_mod = quantization_mode_table[best_integer_count][bits_available + 5];
-
- *best_quantization_level = ql;
- *best_quantization_level_mod = ql_mod;
- *error_of_best_combination = best_integer_count_error;
- if (ql >= 0)
- {
- for (i = 0; i < 3; i++)
- best_formats[i] = formats_of_choice[ql][best_integer_count - 3][i];
- }
- else
- {
- for (i = 0; i < 3; i++)
- best_formats[i] = FMT_LUMINANCE;
- }
-}
-
-
-
-
-// for 4 partitions, find the best format combinations for every (quantization-mode, integer-count) combination
-
-static void four_partitions_find_best_combination_for_every_quantization_and_integer_count(float best_error[4][21][4], // indexed by (partition, quant-level, integer-count)
- int format_of_choice[4][21][4], float combined_best_error[21][13], int formats_of_choice[21][13][4])
-{
- int i, j, k, l;
-
- for (i = 0; i < 21; i++)
- for (j = 0; j < 13; j++)
- combined_best_error[i][j] = 1e30f;
-
- int quant;
- for (quant = 5; quant < 21; quant++)
- {
- for (i = 0; i < 4; i++) // integer-count for first endpoint-pair
- {
- for (j = 0; j < 4; j++) // integer-count for second endpoint-pair
- {
- int low2 = MIN(i, j);
- int high2 = MAX(i, j);
- if ((high2 - low2) > 1)
- continue;
- for (k = 0; k < 4; k++) // integer-count for third endpoint-pair
- {
- int low3 = MIN(k, low2);
- int high3 = MAX(k, high2);
- if ((high3 - low3) > 1)
- continue;
- for (l = 0; l < 4; l++) // integer-count for fourth endpoint-pair
- {
- int low4 = MIN(l, low3);
- int high4 = MAX(l, high3);
- if ((high4 - low4) > 1)
- continue;
-
- int intcnt = i + j + k + l;
- float errorterm = MIN(best_error[0][quant][i] + best_error[1][quant][j] + best_error[2][quant][k] + best_error[3][quant][l], 1e10f);
- if (errorterm <= combined_best_error[quant][intcnt])
- {
- combined_best_error[quant][intcnt] = errorterm;
- formats_of_choice[quant][intcnt][0] = format_of_choice[0][quant][i];
- formats_of_choice[quant][intcnt][1] = format_of_choice[1][quant][j];
- formats_of_choice[quant][intcnt][2] = format_of_choice[2][quant][k];
- formats_of_choice[quant][intcnt][3] = format_of_choice[3][quant][l];
- }
- }
- }
- }
- }
- }
-}
-
-
-
-
-
-
-// for 4 partitions, find the best combination (four formats + a quantization level) for a given bitcount
-
-static void four_partitions_find_best_combination_for_bitcount(float combined_best_error[21][13],
- int formats_of_choice[21][13][4],
- int bits_available, int *best_quantization_level, int *best_quantization_level_mod, int *best_formats, float *error_of_best_combination)
-{
- int i;
- int best_integer_count = 0;
- float best_integer_count_error = 1e20f;
- int integer_count;
-
- for (integer_count = 4; integer_count <= 9; integer_count++)
- {
- // compute the quantization level for a given number of integers and a given number of bits.
- int quantization_level = quantization_mode_table[integer_count][bits_available];
- if (quantization_level == -1)
- break; // used to indicate the case where we don't have enough bits to represent a given endpoint format at all.
- float integer_count_error = combined_best_error[quantization_level][integer_count - 4];
- if (integer_count_error < best_integer_count_error)
- {
- best_integer_count_error = integer_count_error;
- best_integer_count = integer_count;
- }
- }
-
- int ql = quantization_mode_table[best_integer_count][bits_available];
- int ql_mod = quantization_mode_table[best_integer_count][bits_available + 8];
-
- *best_quantization_level = ql;
- *best_quantization_level_mod = ql_mod;
- *error_of_best_combination = best_integer_count_error;
- if (ql >= 0)
- {
- for (i = 0; i < 4; i++)
- best_formats[i] = formats_of_choice[ql][best_integer_count - 4][i];
- }
- else
- {
- for (i = 0; i < 4; i++)
- best_formats[i] = FMT_LUMINANCE;
- }
-}
-
-
-
-/*
- The determine_optimal_set_of_endpoint_formats_to_use() function.
-
- It identifies, for each mode, which set of color endpoint encodings
- produces the best overall result. It then reports back which 4 modes
- look best, along with the ideal color encoding combination for each.
-
- It takes as input:
- a partitioning an imageblock,
- a set of color endpoints.
- for each mode, the number of bits available for color encoding and the error incurred by quantization.
- in case of 2 plane of weights, a specifier for which color component to use for the second plane of weights.
-
- It delivers as output for each of the 4 selected modes:
- format specifier
- for each partition
- quantization level to use
- modified quantization level to use
- (when all format specifiers are equal)
- */
-
-void determine_optimal_set_of_endpoint_formats_to_use(int xdim, int ydim, int zdim,
- const partition_info * pt, const imageblock * blk, const error_weight_block * ewb,
- const endpoints * ep,
- int separate_component, // separate color component for 2-plane mode; -1 for single-plane mode
- // bitcounts and errors computed for the various quantization methods
- const int *qwt_bitcounts, const float *qwt_errors,
- // output data
- int partition_format_specifiers[4][4], int quantized_weight[4],
- int quantization_level[4], int quantization_level_mod[4])
-{
- int i, j;
- int partition_count = pt->partition_count;
-
- int encode_hdr_rgb = blk->rgb_lns[0];
- int encode_hdr_alpha = blk->alpha_lns[0];
-
-
- // call a helper function to compute the errors that result from various
- // encoding choices (such as using luminance instead of RGB, discarding Alpha,
- // using RGB-scale in place of two separate RGB endpoints and so on)
- encoding_choice_errors eci[4];
- compute_encoding_choice_errors(xdim, ydim, zdim, blk, pt, ewb, separate_component, eci);
-
- // for each partition, compute the error weights to apply for that partition.
- float4 error_weightings[4];
- float4 dummied_color_scalefactors[4]; // only used to receive data
- compute_partition_error_color_weightings(xdim, ydim, zdim, ewb, pt, error_weightings, dummied_color_scalefactors);
-
-
- float best_error[4][21][4];
- int format_of_choice[4][21][4];
- for (i = 0; i < partition_count; i++)
- compute_color_error_for_every_integer_count_and_quantization_level(encode_hdr_rgb, encode_hdr_alpha, i, pt, &(eci[i]), ep, error_weightings, best_error[i], format_of_choice[i]);
-
- float errors_of_best_combination[MAX_WEIGHT_MODES];
- int best_quantization_levels[MAX_WEIGHT_MODES];
- int best_quantization_levels_mod[MAX_WEIGHT_MODES];
- int best_ep_formats[MAX_WEIGHT_MODES][4];
-
- // code for the case where the block contains 1 partition
- if (partition_count == 1)
- {
- int best_quantization_level;
- int best_format;
- float error_of_best_combination;
- for (i = 0; i < MAX_WEIGHT_MODES; i++)
- {
- if (qwt_errors[i] >= 1e29f)
- {
- errors_of_best_combination[i] = 1e30f;
- continue;
- }
-
- one_partition_find_best_combination_for_bitcount(best_error[0], format_of_choice[0], qwt_bitcounts[i], &best_quantization_level, &best_format, &error_of_best_combination);
- error_of_best_combination += qwt_errors[i];
-
- errors_of_best_combination[i] = error_of_best_combination;
- best_quantization_levels[i] = best_quantization_level;
- best_quantization_levels_mod[i] = best_quantization_level;
- best_ep_formats[i][0] = best_format;
- }
- }
-
- // code for the case where the block contains 2 partitions
- else if (partition_count == 2)
- {
- int best_quantization_level;
- int best_quantization_level_mod;
- int best_formats[2];
- float error_of_best_combination;
-
- float combined_best_error[21][7];
- int formats_of_choice[21][7][2];
-
- two_partitions_find_best_combination_for_every_quantization_and_integer_count(best_error, format_of_choice, combined_best_error, formats_of_choice);
-
-
- for (i = 0; i < MAX_WEIGHT_MODES; i++)
- {
- if (qwt_errors[i] >= 1e29f)
- {
- errors_of_best_combination[i] = 1e30f;
- continue;
- }
-
- two_partitions_find_best_combination_for_bitcount(combined_best_error, formats_of_choice, qwt_bitcounts[i],
- &best_quantization_level, &best_quantization_level_mod, best_formats, &error_of_best_combination);
-
- error_of_best_combination += qwt_errors[i];
-
- errors_of_best_combination[i] = error_of_best_combination;
- best_quantization_levels[i] = best_quantization_level;
- best_quantization_levels_mod[i] = best_quantization_level_mod;
- best_ep_formats[i][0] = best_formats[0];
- best_ep_formats[i][1] = best_formats[1];
- }
- }
-
- // code for the case where the block contains 3 partitions
- else if (partition_count == 3)
- {
- int best_quantization_level;
- int best_quantization_level_mod;
- int best_formats[3];
- float error_of_best_combination;
-
- float combined_best_error[21][10];
- int formats_of_choice[21][10][3];
-
- three_partitions_find_best_combination_for_every_quantization_and_integer_count(best_error, format_of_choice, combined_best_error, formats_of_choice);
-
- for (i = 0; i < MAX_WEIGHT_MODES; i++)
- {
- if (qwt_errors[i] >= 1e29f)
- {
- errors_of_best_combination[i] = 1e30f;
- continue;
- }
-
- three_partitions_find_best_combination_for_bitcount(combined_best_error,
- formats_of_choice, qwt_bitcounts[i], &best_quantization_level, &best_quantization_level_mod, best_formats, &error_of_best_combination);
- error_of_best_combination += qwt_errors[i];
-
- errors_of_best_combination[i] = error_of_best_combination;
- best_quantization_levels[i] = best_quantization_level;
- best_quantization_levels_mod[i] = best_quantization_level_mod;
- best_ep_formats[i][0] = best_formats[0];
- best_ep_formats[i][1] = best_formats[1];
- best_ep_formats[i][2] = best_formats[2];
- }
- }
-
- // code for the case where the block contains 4 partitions
- else if (partition_count == 4)
- {
- int best_quantization_level;
- int best_quantization_level_mod;
- int best_formats[4];
- float error_of_best_combination;
-
- float combined_best_error[21][13];
- int formats_of_choice[21][13][4];
-
- four_partitions_find_best_combination_for_every_quantization_and_integer_count(best_error, format_of_choice, combined_best_error, formats_of_choice);
-
- for (i = 0; i < MAX_WEIGHT_MODES; i++)
- {
- if (qwt_errors[i] >= 1e29f)
- {
- errors_of_best_combination[i] = 1e30f;
- continue;
- }
- four_partitions_find_best_combination_for_bitcount(combined_best_error,
- formats_of_choice, qwt_bitcounts[i], &best_quantization_level, &best_quantization_level_mod, best_formats, &error_of_best_combination);
- error_of_best_combination += qwt_errors[i];
-
- errors_of_best_combination[i] = error_of_best_combination;
- best_quantization_levels[i] = best_quantization_level;
- best_quantization_levels_mod[i] = best_quantization_level_mod;
- best_ep_formats[i][0] = best_formats[0];
- best_ep_formats[i][1] = best_formats[1];
- best_ep_formats[i][2] = best_formats[2];
- best_ep_formats[i][3] = best_formats[3];
- }
- }
-
- // finally, go through the results and pick the 4 best-looking modes.
-
- int best_error_weights[4];
-
- for (i = 0; i < 4; i++)
- {
- float best_ep_error = 1e30f;
- int best_error_index = -1;
- for (j = 0; j < MAX_WEIGHT_MODES; j++)
- {
- if (errors_of_best_combination[j] < best_ep_error && best_quantization_levels[j] >= 5)
- {
- best_ep_error = errors_of_best_combination[j];
- best_error_index = j;
- }
- }
- best_error_weights[i] = best_error_index;
-
- if(best_error_index >= 0)
- {
- errors_of_best_combination[best_error_index] = 1e30f;
- }
- }
-
- for (i = 0; i < 4; i++)
- {
- quantized_weight[i] = best_error_weights[i];
- if (quantized_weight[i] >= 0)
- {
- quantization_level[i] = best_quantization_levels[best_error_weights[i]];
- quantization_level_mod[i] = best_quantization_levels_mod[best_error_weights[i]];
- for (j = 0; j < partition_count; j++)
- {
- partition_format_specifiers[i][j] = best_ep_formats[best_error_weights[i]][j];
- }
- }
- }
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_quantization.cpp b/3rdparty/bimg/3rdparty/astc/astc_quantization.cpp
deleted file mode 100644
index 183c5a334a5..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_quantization.cpp
+++ /dev/null
@@ -1,558 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Functions and data table related to data quantization in ASTC.
- */
-/*----------------------------------------------------------------------------*/
-
-#include "astc_codec_internals.h"
-
-const uint8_t color_quantization_tables[21][256] = {
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- },
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- },
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- },
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 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,
- },
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- },
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- },
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- },
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15,
- },
- {
- 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 1, 1,
- },
- {
- 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1, 1, 1,
- },
- {
- 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
- 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6,
- 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10,
- 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13,
- 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15,
- 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17,
- 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21,
- 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23,
- 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25,
- 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29,
- 29, 29, 29, 30, 30, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31,
- },
- {
- 0, 0, 0, 0, 8, 8, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16,
- 16, 24, 24, 24, 24, 24, 24, 32, 32, 32, 32, 32, 32, 32, 2, 2,
- 2, 2, 2, 2, 10, 10, 10, 10, 10, 10, 10, 18, 18, 18, 18, 18,
- 18, 26, 26, 26, 26, 26, 26, 26, 34, 34, 34, 34, 34, 34, 4, 4,
- 4, 4, 4, 4, 4, 12, 12, 12, 12, 12, 12, 20, 20, 20, 20, 20,
- 20, 20, 28, 28, 28, 28, 28, 28, 36, 36, 36, 36, 36, 36, 36, 6,
- 6, 6, 6, 6, 6, 14, 14, 14, 14, 14, 14, 14, 22, 22, 22, 22,
- 22, 22, 30, 30, 30, 30, 30, 30, 30, 38, 38, 38, 38, 38, 38, 38,
- 39, 39, 39, 39, 39, 39, 39, 31, 31, 31, 31, 31, 31, 31, 23, 23,
- 23, 23, 23, 23, 15, 15, 15, 15, 15, 15, 15, 7, 7, 7, 7, 7,
- 7, 37, 37, 37, 37, 37, 37, 37, 29, 29, 29, 29, 29, 29, 21, 21,
- 21, 21, 21, 21, 21, 13, 13, 13, 13, 13, 13, 5, 5, 5, 5, 5,
- 5, 5, 35, 35, 35, 35, 35, 35, 27, 27, 27, 27, 27, 27, 27, 19,
- 19, 19, 19, 19, 19, 11, 11, 11, 11, 11, 11, 11, 3, 3, 3, 3,
- 3, 3, 33, 33, 33, 33, 33, 33, 33, 25, 25, 25, 25, 25, 25, 17,
- 17, 17, 17, 17, 17, 17, 9, 9, 9, 9, 9, 9, 1, 1, 1, 1,
- },
- {
- 0, 0, 0, 16, 16, 16, 16, 16, 16, 32, 32, 32, 32, 32, 2, 2,
- 2, 2, 2, 18, 18, 18, 18, 18, 18, 34, 34, 34, 34, 34, 4, 4,
- 4, 4, 4, 4, 20, 20, 20, 20, 20, 36, 36, 36, 36, 36, 6, 6,
- 6, 6, 6, 6, 22, 22, 22, 22, 22, 38, 38, 38, 38, 38, 38, 8,
- 8, 8, 8, 8, 24, 24, 24, 24, 24, 24, 40, 40, 40, 40, 40, 10,
- 10, 10, 10, 10, 26, 26, 26, 26, 26, 26, 42, 42, 42, 42, 42, 12,
- 12, 12, 12, 12, 12, 28, 28, 28, 28, 28, 44, 44, 44, 44, 44, 14,
- 14, 14, 14, 14, 14, 30, 30, 30, 30, 30, 46, 46, 46, 46, 46, 46,
- 47, 47, 47, 47, 47, 47, 31, 31, 31, 31, 31, 15, 15, 15, 15, 15,
- 15, 45, 45, 45, 45, 45, 29, 29, 29, 29, 29, 13, 13, 13, 13, 13,
- 13, 43, 43, 43, 43, 43, 27, 27, 27, 27, 27, 27, 11, 11, 11, 11,
- 11, 41, 41, 41, 41, 41, 25, 25, 25, 25, 25, 25, 9, 9, 9, 9,
- 9, 39, 39, 39, 39, 39, 39, 23, 23, 23, 23, 23, 7, 7, 7, 7,
- 7, 7, 37, 37, 37, 37, 37, 21, 21, 21, 21, 21, 5, 5, 5, 5,
- 5, 5, 35, 35, 35, 35, 35, 19, 19, 19, 19, 19, 19, 3, 3, 3,
- 3, 3, 33, 33, 33, 33, 33, 17, 17, 17, 17, 17, 17, 1, 1, 1,
- },
- {
- 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4,
- 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8,
- 8, 8, 8, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 11, 12,
- 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16,
- 16, 16, 16, 16, 17, 17, 17, 17, 18, 18, 18, 18, 19, 19, 19, 19,
- 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, 23,
- 24, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 26, 27, 27, 27, 27,
- 28, 28, 28, 28, 29, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 31,
- 32, 32, 32, 32, 33, 33, 33, 33, 34, 34, 34, 34, 35, 35, 35, 35,
- 36, 36, 36, 36, 37, 37, 37, 37, 38, 38, 38, 38, 39, 39, 39, 39,
- 40, 40, 40, 40, 41, 41, 41, 41, 42, 42, 42, 42, 43, 43, 43, 43,
- 44, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 46, 47, 47, 47, 47,
- 47, 48, 48, 48, 48, 49, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51,
- 51, 52, 52, 52, 52, 53, 53, 53, 53, 54, 54, 54, 54, 55, 55, 55,
- 55, 56, 56, 56, 56, 57, 57, 57, 57, 58, 58, 58, 58, 59, 59, 59,
- 59, 60, 60, 60, 60, 61, 61, 61, 61, 62, 62, 62, 62, 63, 63, 63,
- },
- {
- 0, 0, 16, 16, 16, 32, 32, 32, 48, 48, 48, 48, 64, 64, 64, 2,
- 2, 2, 18, 18, 18, 34, 34, 34, 50, 50, 50, 50, 66, 66, 66, 4,
- 4, 4, 20, 20, 20, 36, 36, 36, 36, 52, 52, 52, 68, 68, 68, 6,
- 6, 6, 22, 22, 22, 38, 38, 38, 38, 54, 54, 54, 70, 70, 70, 8,
- 8, 8, 24, 24, 24, 24, 40, 40, 40, 56, 56, 56, 72, 72, 72, 10,
- 10, 10, 26, 26, 26, 26, 42, 42, 42, 58, 58, 58, 74, 74, 74, 12,
- 12, 12, 12, 28, 28, 28, 44, 44, 44, 60, 60, 60, 76, 76, 76, 14,
- 14, 14, 14, 30, 30, 30, 46, 46, 46, 62, 62, 62, 78, 78, 78, 78,
- 79, 79, 79, 79, 63, 63, 63, 47, 47, 47, 31, 31, 31, 15, 15, 15,
- 15, 77, 77, 77, 61, 61, 61, 45, 45, 45, 29, 29, 29, 13, 13, 13,
- 13, 75, 75, 75, 59, 59, 59, 43, 43, 43, 27, 27, 27, 27, 11, 11,
- 11, 73, 73, 73, 57, 57, 57, 41, 41, 41, 25, 25, 25, 25, 9, 9,
- 9, 71, 71, 71, 55, 55, 55, 39, 39, 39, 39, 23, 23, 23, 7, 7,
- 7, 69, 69, 69, 53, 53, 53, 37, 37, 37, 37, 21, 21, 21, 5, 5,
- 5, 67, 67, 67, 51, 51, 51, 51, 35, 35, 35, 19, 19, 19, 3, 3,
- 3, 65, 65, 65, 49, 49, 49, 49, 33, 33, 33, 17, 17, 17, 1, 1,
- },
- {
- 0, 0, 32, 32, 64, 64, 64, 2, 2, 2, 34, 34, 66, 66, 66, 4,
- 4, 4, 36, 36, 68, 68, 68, 6, 6, 6, 38, 38, 70, 70, 70, 8,
- 8, 8, 40, 40, 40, 72, 72, 10, 10, 10, 42, 42, 42, 74, 74, 12,
- 12, 12, 44, 44, 44, 76, 76, 14, 14, 14, 46, 46, 46, 78, 78, 16,
- 16, 16, 48, 48, 48, 80, 80, 80, 18, 18, 50, 50, 50, 82, 82, 82,
- 20, 20, 52, 52, 52, 84, 84, 84, 22, 22, 54, 54, 54, 86, 86, 86,
- 24, 24, 56, 56, 56, 88, 88, 88, 26, 26, 58, 58, 58, 90, 90, 90,
- 28, 28, 60, 60, 60, 92, 92, 92, 30, 30, 62, 62, 62, 94, 94, 94,
- 95, 95, 95, 63, 63, 63, 31, 31, 93, 93, 93, 61, 61, 61, 29, 29,
- 91, 91, 91, 59, 59, 59, 27, 27, 89, 89, 89, 57, 57, 57, 25, 25,
- 87, 87, 87, 55, 55, 55, 23, 23, 85, 85, 85, 53, 53, 53, 21, 21,
- 83, 83, 83, 51, 51, 51, 19, 19, 81, 81, 81, 49, 49, 49, 17, 17,
- 17, 79, 79, 47, 47, 47, 15, 15, 15, 77, 77, 45, 45, 45, 13, 13,
- 13, 75, 75, 43, 43, 43, 11, 11, 11, 73, 73, 41, 41, 41, 9, 9,
- 9, 71, 71, 71, 39, 39, 7, 7, 7, 69, 69, 69, 37, 37, 5, 5,
- 5, 67, 67, 67, 35, 35, 3, 3, 3, 65, 65, 65, 33, 33, 1, 1,
- },
- {
- 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7,
- 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15,
- 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23,
- 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31,
- 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38, 38, 39, 39,
- 40, 40, 41, 41, 42, 42, 43, 43, 44, 44, 45, 45, 46, 46, 47, 47,
- 48, 48, 49, 49, 50, 50, 51, 51, 52, 52, 53, 53, 54, 54, 55, 55,
- 56, 56, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63,
- 64, 64, 65, 65, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 71, 71,
- 72, 72, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 78, 78, 79, 79,
- 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 85, 85, 86, 86, 87, 87,
- 88, 88, 89, 89, 90, 90, 91, 91, 92, 92, 93, 93, 94, 94, 95, 95,
- 96, 96, 97, 97, 98, 98, 99, 99, 100, 100, 101, 101, 102, 102, 103, 103,
- 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 109, 109, 110, 110, 111, 111,
- 112, 112, 113, 113, 114, 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, 119,
- 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, 125, 125, 126, 126, 127, 127,
- },
- {
- 0, 32, 32, 64, 96, 96, 128, 128, 2, 34, 34, 66, 98, 98, 130, 130,
- 4, 36, 36, 68, 100, 100, 132, 132, 6, 38, 38, 70, 102, 102, 134, 134,
- 8, 40, 40, 72, 104, 104, 136, 136, 10, 42, 42, 74, 106, 106, 138, 138,
- 12, 44, 44, 76, 108, 108, 140, 140, 14, 46, 46, 78, 110, 110, 142, 142,
- 16, 48, 48, 80, 112, 112, 144, 144, 18, 50, 50, 82, 114, 114, 146, 146,
- 20, 52, 52, 84, 116, 116, 148, 148, 22, 54, 54, 86, 118, 118, 150, 150,
- 24, 56, 56, 88, 120, 120, 152, 152, 26, 58, 58, 90, 122, 122, 154, 154,
- 28, 60, 60, 92, 124, 124, 156, 156, 30, 62, 62, 94, 126, 126, 158, 158,
- 159, 159, 127, 127, 95, 63, 63, 31, 157, 157, 125, 125, 93, 61, 61, 29,
- 155, 155, 123, 123, 91, 59, 59, 27, 153, 153, 121, 121, 89, 57, 57, 25,
- 151, 151, 119, 119, 87, 55, 55, 23, 149, 149, 117, 117, 85, 53, 53, 21,
- 147, 147, 115, 115, 83, 51, 51, 19, 145, 145, 113, 113, 81, 49, 49, 17,
- 143, 143, 111, 111, 79, 47, 47, 15, 141, 141, 109, 109, 77, 45, 45, 13,
- 139, 139, 107, 107, 75, 43, 43, 11, 137, 137, 105, 105, 73, 41, 41, 9,
- 135, 135, 103, 103, 71, 39, 39, 7, 133, 133, 101, 101, 69, 37, 37, 5,
- 131, 131, 99, 99, 67, 35, 35, 3, 129, 129, 97, 97, 65, 33, 33, 1,
- },
- {
- 0, 64, 128, 128, 2, 66, 130, 130, 4, 68, 132, 132, 6, 70, 134, 134,
- 8, 72, 136, 136, 10, 74, 138, 138, 12, 76, 140, 140, 14, 78, 142, 142,
- 16, 80, 144, 144, 18, 82, 146, 146, 20, 84, 148, 148, 22, 86, 150, 150,
- 24, 88, 152, 152, 26, 90, 154, 154, 28, 92, 156, 156, 30, 94, 158, 158,
- 32, 96, 160, 160, 34, 98, 162, 162, 36, 100, 164, 164, 38, 102, 166, 166,
- 40, 104, 168, 168, 42, 106, 170, 170, 44, 108, 172, 172, 46, 110, 174, 174,
- 48, 112, 176, 176, 50, 114, 178, 178, 52, 116, 180, 180, 54, 118, 182, 182,
- 56, 120, 184, 184, 58, 122, 186, 186, 60, 124, 188, 188, 62, 126, 190, 190,
- 191, 191, 127, 63, 189, 189, 125, 61, 187, 187, 123, 59, 185, 185, 121, 57,
- 183, 183, 119, 55, 181, 181, 117, 53, 179, 179, 115, 51, 177, 177, 113, 49,
- 175, 175, 111, 47, 173, 173, 109, 45, 171, 171, 107, 43, 169, 169, 105, 41,
- 167, 167, 103, 39, 165, 165, 101, 37, 163, 163, 99, 35, 161, 161, 97, 33,
- 159, 159, 95, 31, 157, 157, 93, 29, 155, 155, 91, 27, 153, 153, 89, 25,
- 151, 151, 87, 23, 149, 149, 85, 21, 147, 147, 83, 19, 145, 145, 81, 17,
- 143, 143, 79, 15, 141, 141, 77, 13, 139, 139, 75, 11, 137, 137, 73, 9,
- 135, 135, 71, 7, 133, 133, 69, 5, 131, 131, 67, 3, 129, 129, 65, 1,
- },
- {
- 0, 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,
- },
-};
-
-
-const uint8_t color_unquantization_tables[21][256] = {
- {
- 0, 255,
- },
- {
- 0, 128, 255,
- },
- {
- 0, 85, 170, 255,
- },
- {
- 0, 64, 128, 192, 255,
- },
- {
- 0, 255, 51, 204, 102, 153,
- },
- {
- 0, 36, 73, 109, 146, 182, 219, 255,
- },
- {
- 0, 255, 28, 227, 56, 199, 84, 171, 113, 142,
- },
- {
- 0, 255, 69, 186, 23, 232, 92, 163, 46, 209, 116, 139,
- },
- {
- 0, 17, 34, 51, 68, 85, 102, 119, 136, 153, 170, 187, 204, 221, 238, 255,
- },
- {
- 0, 255, 67, 188, 13, 242, 80, 175, 27, 228, 94, 161, 40, 215, 107, 148,
- 54, 201, 121, 134,
- },
- {
- 0, 255, 33, 222, 66, 189, 99, 156, 11, 244, 44, 211, 77, 178, 110, 145,
- 22, 233, 55, 200, 88, 167, 121, 134,
- },
- {
- 0, 8, 16, 24, 33, 41, 49, 57, 66, 74, 82, 90, 99, 107, 115, 123,
- 132, 140, 148, 156, 165, 173, 181, 189, 198, 206, 214, 222, 231, 239, 247, 255,
- },
- {
- 0, 255, 32, 223, 65, 190, 97, 158, 6, 249, 39, 216, 71, 184, 104, 151,
- 13, 242, 45, 210, 78, 177, 110, 145, 19, 236, 52, 203, 84, 171, 117, 138,
- 26, 229, 58, 197, 91, 164, 123, 132,
- },
- {
- 0, 255, 16, 239, 32, 223, 48, 207, 65, 190, 81, 174, 97, 158, 113, 142,
- 5, 250, 21, 234, 38, 217, 54, 201, 70, 185, 86, 169, 103, 152, 119, 136,
- 11, 244, 27, 228, 43, 212, 59, 196, 76, 179, 92, 163, 108, 147, 124, 131,
- },
- {
- 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, 56, 60,
- 65, 69, 73, 77, 81, 85, 89, 93, 97, 101, 105, 109, 113, 117, 121, 125,
- 130, 134, 138, 142, 146, 150, 154, 158, 162, 166, 170, 174, 178, 182, 186, 190,
- 195, 199, 203, 207, 211, 215, 219, 223, 227, 231, 235, 239, 243, 247, 251, 255,
- },
- {
- 0, 255, 16, 239, 32, 223, 48, 207, 64, 191, 80, 175, 96, 159, 112, 143,
- 3, 252, 19, 236, 35, 220, 51, 204, 67, 188, 83, 172, 100, 155, 116, 139,
- 6, 249, 22, 233, 38, 217, 54, 201, 71, 184, 87, 168, 103, 152, 119, 136,
- 9, 246, 25, 230, 42, 213, 58, 197, 74, 181, 90, 165, 106, 149, 122, 133,
- 13, 242, 29, 226, 45, 210, 61, 194, 77, 178, 93, 162, 109, 146, 125, 130,
- },
- {
- 0, 255, 8, 247, 16, 239, 24, 231, 32, 223, 40, 215, 48, 207, 56, 199,
- 64, 191, 72, 183, 80, 175, 88, 167, 96, 159, 104, 151, 112, 143, 120, 135,
- 2, 253, 10, 245, 18, 237, 26, 229, 35, 220, 43, 212, 51, 204, 59, 196,
- 67, 188, 75, 180, 83, 172, 91, 164, 99, 156, 107, 148, 115, 140, 123, 132,
- 5, 250, 13, 242, 21, 234, 29, 226, 37, 218, 45, 210, 53, 202, 61, 194,
- 70, 185, 78, 177, 86, 169, 94, 161, 102, 153, 110, 145, 118, 137, 126, 129,
- },
- {
- 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30,
- 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62,
- 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94,
- 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 118, 120, 122, 124, 126,
- 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 153, 155, 157, 159,
- 161, 163, 165, 167, 169, 171, 173, 175, 177, 179, 181, 183, 185, 187, 189, 191,
- 193, 195, 197, 199, 201, 203, 205, 207, 209, 211, 213, 215, 217, 219, 221, 223,
- 225, 227, 229, 231, 233, 235, 237, 239, 241, 243, 245, 247, 249, 251, 253, 255,
- },
- {
- 0, 255, 8, 247, 16, 239, 24, 231, 32, 223, 40, 215, 48, 207, 56, 199,
- 64, 191, 72, 183, 80, 175, 88, 167, 96, 159, 104, 151, 112, 143, 120, 135,
- 1, 254, 9, 246, 17, 238, 25, 230, 33, 222, 41, 214, 49, 206, 57, 198,
- 65, 190, 73, 182, 81, 174, 89, 166, 97, 158, 105, 150, 113, 142, 121, 134,
- 3, 252, 11, 244, 19, 236, 27, 228, 35, 220, 43, 212, 51, 204, 59, 196,
- 67, 188, 75, 180, 83, 172, 91, 164, 99, 156, 107, 148, 115, 140, 123, 132,
- 4, 251, 12, 243, 20, 235, 28, 227, 36, 219, 44, 211, 52, 203, 60, 195,
- 68, 187, 76, 179, 84, 171, 92, 163, 100, 155, 108, 147, 116, 139, 124, 131,
- 6, 249, 14, 241, 22, 233, 30, 225, 38, 217, 46, 209, 54, 201, 62, 193,
- 70, 185, 78, 177, 86, 169, 94, 161, 102, 153, 110, 145, 118, 137, 126, 129,
- },
- {
- 0, 255, 4, 251, 8, 247, 12, 243, 16, 239, 20, 235, 24, 231, 28, 227,
- 32, 223, 36, 219, 40, 215, 44, 211, 48, 207, 52, 203, 56, 199, 60, 195,
- 64, 191, 68, 187, 72, 183, 76, 179, 80, 175, 84, 171, 88, 167, 92, 163,
- 96, 159, 100, 155, 104, 151, 108, 147, 112, 143, 116, 139, 120, 135, 124, 131,
- 1, 254, 5, 250, 9, 246, 13, 242, 17, 238, 21, 234, 25, 230, 29, 226,
- 33, 222, 37, 218, 41, 214, 45, 210, 49, 206, 53, 202, 57, 198, 61, 194,
- 65, 190, 69, 186, 73, 182, 77, 178, 81, 174, 85, 170, 89, 166, 93, 162,
- 97, 158, 101, 154, 105, 150, 109, 146, 113, 142, 117, 138, 121, 134, 125, 130,
- 2, 253, 6, 249, 10, 245, 14, 241, 18, 237, 22, 233, 26, 229, 30, 225,
- 34, 221, 38, 217, 42, 213, 46, 209, 50, 205, 54, 201, 58, 197, 62, 193,
- 66, 189, 70, 185, 74, 181, 78, 177, 82, 173, 86, 169, 90, 165, 94, 161,
- 98, 157, 102, 153, 106, 149, 110, 145, 114, 141, 118, 137, 122, 133, 126, 129,
- },
- {
- 0, 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,
- },
-};
-
-// quantization_mode_table[integercount/2][bits] gives
-// us the quantization level for a given integer count and number of bits that
-// the integer may fit into. This is needed for color decoding,
-// and for the color encoding.
-int quantization_mode_table[17][128];
-
-void build_quantization_mode_table(void)
-{
- int i, j;
- for (i = 0; i <= 16; i++)
- for (j = 0; j < 128; j++)
- quantization_mode_table[i][j] = -1;
-
- for (i = 0; i < 21; i++)
- for (j = 1; j <= 16; j++)
- {
- int p = compute_ise_bitcount(2 * j, (quantization_method) i);
- if (p < 128)
- quantization_mode_table[j][p] = i;
- }
- for (i = 0; i <= 16; i++)
- {
- int largest_value_so_far = -1;
- for (j = 0; j < 128; j++)
- {
- if (quantization_mode_table[i][j] > largest_value_so_far)
- largest_value_so_far = quantization_mode_table[i][j];
- else
- quantization_mode_table[i][j] = largest_value_so_far;
- }
- }
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_symbolic_physical.cpp b/3rdparty/bimg/3rdparty/astc/astc_symbolic_physical.cpp
deleted file mode 100644
index d395b8cfcd0..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_symbolic_physical.cpp
+++ /dev/null
@@ -1,431 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Functions to convert a compressed block between the symbolic and
- * the physical representation.
- */
-/*----------------------------------------------------------------------------*/
-
-#include "astc_codec_internals.h"
-
-// routine to write up to 8 bits
-static inline void write_bits(int value, int bitcount, int bitoffset, uint8_t * ptr)
-{
- int mask = (1 << bitcount) - 1;
- value &= mask;
- ptr += bitoffset >> 3;
- bitoffset &= 7;
- value <<= bitoffset;
- mask <<= bitoffset;
- mask = ~mask;
-
- ptr[0] &= mask;
- ptr[0] |= value;
- ptr[1] &= mask >> 8;
- ptr[1] |= value >> 8;
-}
-
-
-// routine to read up to 8 bits
-static inline int read_bits(int bitcount, int bitoffset, const uint8_t * ptr)
-{
- int mask = (1 << bitcount) - 1;
- ptr += bitoffset >> 3;
- bitoffset &= 7;
- int value = ptr[0] | (ptr[1] << 8);
- value >>= bitoffset;
- value &= mask;
- return value;
-}
-
-
-int bitrev8(int p)
-{
- p = ((p & 0xF) << 4) | ((p >> 4) & 0xF);
- p = ((p & 0x33) << 2) | ((p >> 2) & 0x33);
- p = ((p & 0x55) << 1) | ((p >> 1) & 0x55);
- return p;
-}
-
-
-
-
-physical_compressed_block symbolic_to_physical(int xdim, int ydim, int zdim, const symbolic_compressed_block * sc)
-{
- int i, j;
- physical_compressed_block res;
-
-
- if (sc->block_mode == -2)
- {
- // UNORM16 constant-color block.
- // This encodes separate constant-color blocks. There is currently
- // no attempt to coalesce them into larger void-extents.
-
- static const uint8_t cbytes[8] = { 0xFC, 0xFD, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
- for (i = 0; i < 8; i++)
- res.data[i] = cbytes[i];
-
- for (i = 0; i < 4; i++)
- {
- res.data[2 * i + 8] = sc->constant_color[i] & 0xFF;
- res.data[2 * i + 9] = (sc->constant_color[i] >> 8) & 0xFF;
- }
- return res;
- }
-
-
- if (sc->block_mode == -1)
- {
- // FP16 constant-color block.
- // This encodes separate constant-color blocks. There is currently
- // no attempt to coalesce them into larger void-extents.
-
- static const uint8_t cbytes[8] = { 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
- for (i = 0; i < 8; i++)
- res.data[i] = cbytes[i];
-
- for (i = 0; i < 4; i++)
- {
- res.data[2 * i + 8] = sc->constant_color[i] & 0xFF;
- res.data[2 * i + 9] = (sc->constant_color[i] >> 8) & 0xFF;
- }
- return res;
- }
-
-
-
- int partition_count = sc->partition_count;
-
- // first, compress the weights. They are encoded as an ordinary
- // integer-sequence, then bit-reversed
- uint8_t weightbuf[16];
- for (i = 0; i < 16; i++)
- weightbuf[i] = 0;
-
- const block_size_descriptor *bsd = get_block_size_descriptor(xdim, ydim, zdim);
- const decimation_table *const *ixtab2 = bsd->decimation_tables;
-
-
- int weight_count = ixtab2[bsd->block_modes[sc->block_mode].decimation_mode]->num_weights;
- int weight_quantization_method = bsd->block_modes[sc->block_mode].quantization_mode;
- int is_dual_plane = bsd->block_modes[sc->block_mode].is_dual_plane;
-
- int real_weight_count = is_dual_plane ? 2 * weight_count : weight_count;
-
- int bits_for_weights = compute_ise_bitcount(real_weight_count,
- (quantization_method) weight_quantization_method);
-
-
- if (is_dual_plane)
- {
- uint8_t weights[64];
- for (i = 0; i < weight_count; i++)
- {
- weights[2 * i] = sc->plane1_weights[i];
- weights[2 * i + 1] = sc->plane2_weights[i];
- }
- encode_ise(weight_quantization_method, real_weight_count, weights, weightbuf, 0);
- }
- else
- {
- encode_ise(weight_quantization_method, weight_count, sc->plane1_weights, weightbuf, 0);
- }
-
- for (i = 0; i < 16; i++)
- res.data[i] = bitrev8(weightbuf[15 - i]);
-
- write_bits(sc->block_mode, 11, 0, res.data);
- write_bits(partition_count - 1, 2, 11, res.data);
-
- int below_weights_pos = 128 - bits_for_weights;
-
- // encode partition index and color endpoint types for blocks with
- // 2 or more partitions.
- if (partition_count > 1)
- {
- write_bits(sc->partition_index, 6, 13, res.data);
- write_bits(sc->partition_index >> 6, PARTITION_BITS - 6, 19, res.data);
-
- if (sc->color_formats_matched)
- {
- write_bits(sc->color_formats[0] << 2, 6, 13 + PARTITION_BITS, res.data);
- }
- else
- {
- // go through the selected endpoint type classes for each partition
- // in order to determine the lowest class present.
- int low_class = 4;
- for (i = 0; i < partition_count; i++)
- {
- int class_of_format = sc->color_formats[i] >> 2;
- if (class_of_format < low_class)
- low_class = class_of_format;
- }
- if (low_class == 3)
- low_class = 2;
- int encoded_type = low_class + 1;
- int bitpos = 2;
- for (i = 0; i < partition_count; i++)
- {
- int classbit_of_format = (sc->color_formats[i] >> 2) - low_class;
-
- encoded_type |= classbit_of_format << bitpos;
- bitpos++;
- }
- for (i = 0; i < partition_count; i++)
- {
- int lowbits_of_format = sc->color_formats[i] & 3;
- encoded_type |= lowbits_of_format << bitpos;
- bitpos += 2;
- }
- int encoded_type_lowpart = encoded_type & 0x3F;
- int encoded_type_highpart = encoded_type >> 6;
- int encoded_type_highpart_size = (3 * partition_count) - 4;
- int encoded_type_highpart_pos = 128 - bits_for_weights - encoded_type_highpart_size;
- write_bits(encoded_type_lowpart, 6, 13 + PARTITION_BITS, res.data);
- write_bits(encoded_type_highpart, encoded_type_highpart_size, encoded_type_highpart_pos, res.data);
-
- below_weights_pos -= encoded_type_highpart_size;
- }
- }
-
- else
- write_bits(sc->color_formats[0], 4, 13, res.data);
-
- // in dual-plane mode, encode the color component of the second plane of weights
- if (is_dual_plane)
- write_bits(sc->plane2_color_component, 2, below_weights_pos - 2, res.data);
-
- // finally, encode the color bits
- // first, get hold of all the color components to encode
- uint8_t values_to_encode[32];
- int valuecount_to_encode = 0;
- for (i = 0; i < sc->partition_count; i++)
- {
- int vals = 2 * (sc->color_formats[i] >> 2) + 2;
- for (j = 0; j < vals; j++)
- values_to_encode[j + valuecount_to_encode] = sc->color_values[i][j];
- valuecount_to_encode += vals;
- }
- // then, encode an ISE based on them.
- encode_ise(sc->color_quantization_level, valuecount_to_encode, values_to_encode, res.data, (sc->partition_count == 1 ? 17 : 19 + PARTITION_BITS));
-
- return res;
-}
-
-
-void physical_to_symbolic(int xdim, int ydim, int zdim, physical_compressed_block pb, symbolic_compressed_block * res)
-{
- uint8_t bswapped[16];
- int i, j;
-
- res->error_block = 0;
-
- // get hold of the block-size descriptor and the decimation tables.
- const block_size_descriptor *bsd = get_block_size_descriptor(xdim, ydim, zdim);
- const decimation_table *const *ixtab2 = bsd->decimation_tables;
-
- // extract header fields
- int block_mode = read_bits(11, 0, pb.data);
-
-
- if ((block_mode & 0x1FF) == 0x1FC)
- {
- // void-extent block!
-
- // check what format the data has
- if (block_mode & 0x200)
- res->block_mode = -1; // floating-point
- else
- res->block_mode = -2; // unorm16.
-
- res->partition_count = 0;
- for (i = 0; i < 4; i++)
- {
- res->constant_color[i] = pb.data[2 * i + 8] | (pb.data[2 * i + 9] << 8);
- }
-
- // additionally, check that the void-extent
- if (zdim == 1)
- {
- // 2D void-extent
- int rsvbits = read_bits(2, 10, pb.data);
- if (rsvbits != 3)
- res->error_block = 1;
-
- int vx_low_s = read_bits(8, 12, pb.data) | (read_bits(5, 12 + 8, pb.data) << 8);
- int vx_high_s = read_bits(8, 25, pb.data) | (read_bits(5, 25 + 8, pb.data) << 8);
- int vx_low_t = read_bits(8, 38, pb.data) | (read_bits(5, 38 + 8, pb.data) << 8);
- int vx_high_t = read_bits(8, 51, pb.data) | (read_bits(5, 51 + 8, pb.data) << 8);
-
- int all_ones = vx_low_s == 0x1FFF && vx_high_s == 0x1FFF && vx_low_t == 0x1FFF && vx_high_t == 0x1FFF;
-
- if ((vx_low_s >= vx_high_s || vx_low_t >= vx_high_t) && !all_ones)
- res->error_block = 1;
- }
- else
- {
- // 3D void-extent
- int vx_low_s = read_bits(9, 10, pb.data);
- int vx_high_s = read_bits(9, 19, pb.data);
- int vx_low_t = read_bits(9, 28, pb.data);
- int vx_high_t = read_bits(9, 37, pb.data);
- int vx_low_p = read_bits(9, 46, pb.data);
- int vx_high_p = read_bits(9, 55, pb.data);
-
- int all_ones = vx_low_s == 0x1FF && vx_high_s == 0x1FF && vx_low_t == 0x1FF && vx_high_t == 0x1FF && vx_low_p == 0x1FF && vx_high_p == 0x1FF;
-
- if ((vx_low_s >= vx_high_s || vx_low_t >= vx_high_t || vx_low_p >= vx_high_p) && !all_ones)
- res->error_block = 1;
- }
-
- return;
- }
-
- if (bsd->block_modes[block_mode].permit_decode == 0)
- {
- res->error_block = 1;
- return;
- }
-
- int weight_count = ixtab2[bsd->block_modes[block_mode].decimation_mode]->num_weights;
- int weight_quantization_method = bsd->block_modes[block_mode].quantization_mode;
- int is_dual_plane = bsd->block_modes[block_mode].is_dual_plane;
-
- int real_weight_count = is_dual_plane ? 2 * weight_count : weight_count;
-
- int partition_count = read_bits(2, 11, pb.data) + 1;
-
- res->block_mode = block_mode;
- res->partition_count = partition_count;
-
- for (i = 0; i < 16; i++)
- bswapped[i] = bitrev8(pb.data[15 - i]);
-
- int bits_for_weights = compute_ise_bitcount(real_weight_count,
- (quantization_method) weight_quantization_method);
-
- int below_weights_pos = 128 - bits_for_weights;
-
- if (is_dual_plane)
- {
- uint8_t indices[64];
- decode_ise(weight_quantization_method, real_weight_count, bswapped, indices, 0);
- for (i = 0; i < weight_count; i++)
- {
- res->plane1_weights[i] = indices[2 * i];
- res->plane2_weights[i] = indices[2 * i + 1];
- }
- }
- else
- {
- decode_ise(weight_quantization_method, weight_count, bswapped, res->plane1_weights, 0);
- }
-
- if (is_dual_plane && partition_count == 4)
- res->error_block = 1;
-
-
-
- res->color_formats_matched = 0;
-
- // then, determine the format of each endpoint pair
- int color_formats[4];
- int encoded_type_highpart_size = 0;
- if (partition_count == 1)
- {
- color_formats[0] = read_bits(4, 13, pb.data);
- res->partition_index = 0;
- }
- else
- {
- encoded_type_highpart_size = (3 * partition_count) - 4;
- below_weights_pos -= encoded_type_highpart_size;
- int encoded_type = read_bits(6, 13 + PARTITION_BITS, pb.data) | (read_bits(encoded_type_highpart_size, below_weights_pos, pb.data) << 6);
- int baseclass = encoded_type & 0x3;
- if (baseclass == 0)
- {
- for (i = 0; i < partition_count; i++)
- {
- color_formats[i] = (encoded_type >> 2) & 0xF;
- }
- below_weights_pos += encoded_type_highpart_size;
- res->color_formats_matched = 1;
- encoded_type_highpart_size = 0;
- }
- else
- {
- int bitpos = 2;
- baseclass--;
- for (i = 0; i < partition_count; i++)
- {
- color_formats[i] = (((encoded_type >> bitpos) & 1) + baseclass) << 2;
- bitpos++;
- }
- for (i = 0; i < partition_count; i++)
- {
- color_formats[i] |= (encoded_type >> bitpos) & 3;
- bitpos += 2;
- }
- }
- res->partition_index = read_bits(6, 13, pb.data) | (read_bits(PARTITION_BITS - 6, 19, pb.data) << 6);
-
- }
- for (i = 0; i < partition_count; i++)
- res->color_formats[i] = color_formats[i];
-
-
- // then, determine the number of integers we need to unpack for the endpoint pairs
- int color_integer_count = 0;
- for (i = 0; i < partition_count; i++)
- {
- int endpoint_class = color_formats[i] >> 2;
- color_integer_count += (endpoint_class + 1) * 2;
- }
-
- if (color_integer_count > 18)
- res->error_block = 1;
-
- // then, determine the color endpoint format to use for these integers
- static const int color_bits_arr[5] = { -1, 115 - 4, 113 - 4 - PARTITION_BITS, 113 - 4 - PARTITION_BITS, 113 - 4 - PARTITION_BITS };
- int color_bits = color_bits_arr[partition_count] - bits_for_weights - encoded_type_highpart_size;
- if (is_dual_plane)
- color_bits -= 2;
- if (color_bits < 0)
- color_bits = 0;
-
- int color_quantization_level = quantization_mode_table[color_integer_count >> 1][color_bits];
- res->color_quantization_level = color_quantization_level;
- if (color_quantization_level < 4)
- res->error_block = 1;
-
-
- // then unpack the integer-bits
- uint8_t values_to_decode[32];
- decode_ise(color_quantization_level, color_integer_count, pb.data, values_to_decode, (partition_count == 1 ? 17 : 19 + PARTITION_BITS));
-
- // and distribute them over the endpoint types
- int valuecount_to_decode = 0;
-
- for (i = 0; i < partition_count; i++)
- {
- int vals = 2 * (color_formats[i] >> 2) + 2;
- for (j = 0; j < vals; j++)
- res->color_values[i][j] = values_to_decode[j + valuecount_to_decode];
- valuecount_to_decode += vals;
- }
-
- // get hold of color component for second-plane in the case of dual plane of weights.
- if (is_dual_plane)
- res->plane2_color_component = read_bits(2, below_weights_pos - 2, pb.data);
-
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_weight_align.cpp b/3rdparty/bimg/3rdparty/astc/astc_weight_align.cpp
deleted file mode 100644
index 789438fd137..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_weight_align.cpp
+++ /dev/null
@@ -1,600 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Angular-sum algorithm for weight alignment.
- *
- * This algorithm works as follows:
- * * we compute a complex number P as (cos s*i, sin s*i) for each
- * weight, where i is the input value and s is a scaling factor
- * based on the spacing between the weights.
- * * we then add together complex numbers for all the weights.
- * * we then compute the length and angle of the resulting sum.
- *
- * This should produce the following results:
- * * perfect alignment results in a vector whose length is equal to
- * the sum of lengths of all inputs
- * * even distribution results in a vector of length 0.
- * * all samples identical results in perfect alignment for every
- * scaling.
- *
- * For each scaling factor within a given set, we compute an alignment
- * factor from 0 to 1. This should then result in some scalings standing
- * out as having particularly good alignment factors; we can use this to
- * produce a set of candidate scale/shift values for various quantization
- * levels; we should then actually try them and see what happens.
- *
- * Assuming N quantization steps, the scaling factor becomes s=2*PI*(N-1);
- * we should probably have about 1 scaling factor for every 1/4
- * quantization step (perhaps 1/8 for low levels of quantization)
- */
-/*----------------------------------------------------------------------------*/
-
-#define _USE_MATH_DEFINES // for M_PI on windows
-
-#include <math.h>
-#include "astc_codec_internals.h"
-
-#ifdef DEBUG_PRINT_DIAGNOSTICS
- #include <stdio.h>
-#endif
-
-static const float angular_steppings[] = {
- 1.0, 1.125,
- 1.25, 1.375,
- 1.5, 1.625,
- 1.75, 1.875,
-
- 2.0, 2.25, 2.5, 2.75,
- 3.0, 3.25, 3.5, 3.75,
- 4.0, 4.25, 4.5, 4.75,
- 5.0, 5.25, 5.5, 5.75,
- 6.0, 6.25, 6.5, 6.75,
- 7.0, 7.25, 7.5, 7.75,
-
- 8.0, 8.5,
- 9.0, 9.5,
- 10.0, 10.5,
- 11.0, 11.5,
- 12.0, 12.5,
- 13.0, 13.5,
- 14.0, 14.5,
- 15.0, 15.5,
- 16.0, 16.5,
- 17.0, 17.5,
- 18.0, 18.5,
- 19.0, 19.5,
- 20.0, 20.5,
- 21.0, 21.5,
- 22.0, 22.5,
- 23.0, 23.5,
- 24.0, 24.5,
- 25.0, 25.5,
- 26.0, 26.5,
- 27.0, 27.5,
- 28.0, 28.5,
- 29.0, 29.5,
- 30.0, 30.5,
- 31.0, 31.5,
- 32.0, 32.5,
- 33.0, 33.5,
- 34.0, 34.5,
- 35.0, 35.5,
-};
-
-#define ANGULAR_STEPS ((int)(sizeof(angular_steppings)/sizeof(angular_steppings[0])))
-
-static float stepsizes[ANGULAR_STEPS];
-static float stepsizes_sqr[ANGULAR_STEPS];
-
-static int max_angular_steps_needed_for_quant_level[13];
-
-// we store sine/cosine values for 64 possible weight values; this causes
-// slight quality loss compared to using sin() and cos() directly.
-
-#define SINCOS_STEPS 64
-
-static float sin_table[SINCOS_STEPS][ANGULAR_STEPS];
-static float cos_table[SINCOS_STEPS][ANGULAR_STEPS];
-
-void prepare_angular_tables(void)
-{
- int i, j;
- int max_angular_steps_needed_for_quant_steps[40];
- for (i = 0; i < ANGULAR_STEPS; i++)
- {
- stepsizes[i] = 1.0f / angular_steppings[i];
- stepsizes_sqr[i] = stepsizes[i] * stepsizes[i];
-
- for (j = 0; j < SINCOS_STEPS; j++)
- {
- sin_table[j][i] = static_cast < float >(sin((2.0f * M_PI / (SINCOS_STEPS - 1.0f)) * angular_steppings[i] * j));
- cos_table[j][i] = static_cast < float >(cos((2.0f * M_PI / (SINCOS_STEPS - 1.0f)) * angular_steppings[i] * j));
- }
-
- int p = static_cast < int >(floor(angular_steppings[i])) + 1;
- max_angular_steps_needed_for_quant_steps[p] = MIN(i + 1, ANGULAR_STEPS - 1);
- }
-
-
- // yes, the next-to-last entry is supposed to have the value 33. This because under
- // ASTC, the 32-weight mode leaves a double-sized hole in the middle of the
- // weight space, so we are better off matching 33 weights than 32.
- static const int steps_of_level[] = { 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 33, 36 };
-
- for (i = 0; i < 13; i++)
- max_angular_steps_needed_for_quant_level[i] = max_angular_steps_needed_for_quant_steps[steps_of_level[i]];
-
-}
-
-
-union if32
-{
- float f;
- int32_t s;
- uint32_t u;
-};
-
-
-// function to compute angular sums; then, from the
-// angular sums, compute alignment factor and offset.
-
-/* static inline */
-void compute_angular_offsets(int samplecount, const float *samples, const float *sample_weights, int max_angular_steps, float *offsets)
-{
- int i, j;
-
- float anglesum_x[ANGULAR_STEPS];
- float anglesum_y[ANGULAR_STEPS];
-
- for (i = 0; i < max_angular_steps; i++)
- {
- anglesum_x[i] = 0;
- anglesum_y[i] = 0;
- }
-
-
- // compute the angle-sums.
- for (i = 0; i < samplecount; i++)
- {
- float sample = samples[i];
- float sample_weight = sample_weights[i];
- if32 p;
- p.f = (sample * (SINCOS_STEPS - 1.0f)) + 12582912.0f;
- unsigned int isample = p.u & 0x3F;
-
- const float *sinptr = sin_table[isample];
- const float *cosptr = cos_table[isample];
-
- for (j = 0; j < max_angular_steps; j++)
- {
- float cp = cosptr[j];
- float sp = sinptr[j];
-
- anglesum_x[j] += cp * sample_weight;
- anglesum_y[j] += sp * sample_weight;
- }
- }
-
- // post-process the angle-sums
- for (i = 0; i < max_angular_steps; i++)
- {
- float angle = atan2(anglesum_y[i], anglesum_x[i]); // positive angle -> positive offset
- offsets[i] = angle * (stepsizes[i] * (1.0f / (2.0f * (float)M_PI)));
- }
-}
-
-
-
-// for a given step-size and a given offset, compute the
-// lowest and highest weight that results from quantizing using the stepsize & offset.
-// also, compute the resulting error.
-
-
-/* static inline */
-void compute_lowest_and_highest_weight(int samplecount, const float *samples, const float *sample_weights,
- int max_angular_steps, const float *offsets,
- int8_t * lowest_weight, int8_t * highest_weight,
- float *error, float *cut_low_weight_error, float *cut_high_weight_error)
-{
- int i;
-
- int sp;
-
- float error_from_forcing_weight_down[60];
- float error_from_forcing_weight_either_way[60];
- for (i = 0; i < 60; i++)
- {
- error_from_forcing_weight_down[i] = 0;
- error_from_forcing_weight_either_way[i] = 0;
- }
-
- // weight + 12
- static const unsigned int idxtab[256] = {
-
- 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, 55, 55, 55, 55,
- 55, 55, 55, 55, 55, 55, 55, 55,
- 55, 55, 55, 55, 55, 55, 55, 55,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 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, 55, 55, 55, 55,
- 55, 55, 55, 55, 55, 55, 55, 55,
- 55, 55, 55, 55, 55, 55, 55, 55,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 2, 3,
- 4, 5, 6, 7, 8, 9, 10, 11
- };
-
-
-
- for (sp = 0; sp < max_angular_steps; sp++)
- {
- unsigned int minidx_bias12 = 55;
- unsigned int maxidx_bias12 = 0;
-
- float errval = 0.0f;
-
- float rcp_stepsize = angular_steppings[sp];
- float offset = offsets[sp];
-
- float scaled_offset = rcp_stepsize * offset;
-
-
- for (i = 0; i < samplecount - 1; i += 2)
- {
- float wt1 = sample_weights[i];
- float wt2 = sample_weights[i + 1];
- if32 p1, p2;
- float sval1 = (samples[i] * rcp_stepsize) - scaled_offset;
- float sval2 = (samples[i + 1] * rcp_stepsize) - scaled_offset;
- p1.f = sval1 + 12582912.0f; // FP representation abuse to avoid floor() and float->int conversion
- p2.f = sval2 + 12582912.0f; // FP representation abuse to avoid floor() and float->int conversion
- float isval1 = p1.f - 12582912.0f;
- float isval2 = p2.f - 12582912.0f;
- float dif1 = sval1 - isval1;
- float dif2 = sval2 - isval2;
-
- errval += (dif1 * wt1) * dif1;
- errval += (dif2 * wt2) * dif2;
-
- // table lookups that really perform a minmax function.
- unsigned int idx1_bias12 = idxtab[p1.u & 0xFF];
- unsigned int idx2_bias12 = idxtab[p2.u & 0xFF];
-
- if (idx1_bias12 < minidx_bias12)
- minidx_bias12 = idx1_bias12;
- if (idx1_bias12 > maxidx_bias12)
- maxidx_bias12 = idx1_bias12;
- if (idx2_bias12 < minidx_bias12)
- minidx_bias12 = idx2_bias12;
- if (idx2_bias12 > maxidx_bias12)
- maxidx_bias12 = idx2_bias12;
-
- error_from_forcing_weight_either_way[idx1_bias12] += wt1;
- error_from_forcing_weight_down[idx1_bias12] += (dif1 * wt1);
-
- error_from_forcing_weight_either_way[idx2_bias12] += wt2;
- error_from_forcing_weight_down[idx2_bias12] += (dif2 * wt2);
- }
-
- if (samplecount & 1)
- {
- i = samplecount - 1;
- float wt = sample_weights[i];
- if32 p;
- float sval = (samples[i] * rcp_stepsize) - scaled_offset;
- p.f = sval + 12582912.0f; // FP representation abuse to avoid floor() and float->int conversion
- float isval = p.f - 12582912.0f;
- float dif = sval - isval;
-
- errval += (dif * wt) * dif;
-
- unsigned int idx_bias12 = idxtab[p.u & 0xFF];
-
- if (idx_bias12 < minidx_bias12)
- minidx_bias12 = idx_bias12;
- if (idx_bias12 > maxidx_bias12)
- maxidx_bias12 = idx_bias12;
-
- error_from_forcing_weight_either_way[idx_bias12] += wt;
- error_from_forcing_weight_down[idx_bias12] += dif * wt;
- }
-
-
- lowest_weight[sp] = (int)minidx_bias12 - 12;
- highest_weight[sp] = (int)maxidx_bias12 - 12;
- error[sp] = errval;
-
- // the cut_(lowest/highest)_weight_error indicate the error that results from
- // forcing samples that should have had the (lowest/highest) weight value
- // one step (up/down).
- cut_low_weight_error[sp] = error_from_forcing_weight_either_way[minidx_bias12] - 2.0f * error_from_forcing_weight_down[minidx_bias12];
- cut_high_weight_error[sp] = error_from_forcing_weight_either_way[maxidx_bias12] + 2.0f * error_from_forcing_weight_down[maxidx_bias12];
-
- // clear out the error-from-forcing values we actually used in this pass
- // so that these are clean for the next pass.
- unsigned int ui;
- for (ui = minidx_bias12 & ~0x3; ui <= maxidx_bias12; ui += 4)
- {
- error_from_forcing_weight_either_way[ui] = 0;
- error_from_forcing_weight_down[ui] = 0;
- error_from_forcing_weight_either_way[ui + 1] = 0;
- error_from_forcing_weight_down[ui + 1] = 0;
- error_from_forcing_weight_either_way[ui + 2] = 0;
- error_from_forcing_weight_down[ui + 2] = 0;
- error_from_forcing_weight_either_way[ui + 3] = 0;
- error_from_forcing_weight_down[ui + 3] = 0;
- }
- }
-
-
- for (sp = 0; sp < max_angular_steps; sp++)
- {
- float errscale = stepsizes_sqr[sp];
- error[sp] *= errscale;
- cut_low_weight_error[sp] *= errscale;
- cut_high_weight_error[sp] *= errscale;
- }
-}
-
-
-
-// main function for running the angular algorithm.
-
-
-void compute_angular_endpoints_for_quantization_levels(int samplecount, const float *samples, const float *sample_weights, int max_quantization_level, float low_value[12], float high_value[12])
-{
- int i;
-
-
- max_quantization_level++; // Temporarily increase level - needs refinement
-
- static const int quantization_steps_for_level[13] = { 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 33, 36 };
- int max_quantization_steps = quantization_steps_for_level[max_quantization_level];
-
- float offsets[ANGULAR_STEPS];
-
- int max_angular_steps = max_angular_steps_needed_for_quant_level[max_quantization_level];
-
- compute_angular_offsets(samplecount, samples, sample_weights, max_angular_steps, offsets);
-
-
- // the +4 offsets are to allow for vectorization within compute_lowest_and_highest_weight().
- int8_t lowest_weight[ANGULAR_STEPS + 4];
- int8_t highest_weight[ANGULAR_STEPS + 4];
- float error[ANGULAR_STEPS + 4];
-
- float cut_low_weight_error[ANGULAR_STEPS + 4];
- float cut_high_weight_error[ANGULAR_STEPS + 4];
-
- compute_lowest_and_highest_weight(samplecount, samples, sample_weights, max_angular_steps, offsets, lowest_weight, highest_weight, error, cut_low_weight_error, cut_high_weight_error);
-
-
- #ifdef DEBUG_PRINT_DIAGNOSTICS
- if (print_diagnostics)
- {
- printf("%s : max-angular-steps=%d \n", __func__, max_angular_steps);
- printf("Samplecount=%d, max_quantization_level=%d\n", samplecount, max_quantization_level);
- for (i = 0; i < samplecount; i++)
- printf("Sample %d : %f (weight %f)\n", i, samples[i], sample_weights[i]);
-
- for (i = 0; i < max_angular_steps; i++)
- {
- printf("%d: offset=%f error=%f lowest=%d highest=%d cl=%f ch=%f\n", i, offsets[i], error[i], lowest_weight[i], highest_weight[i], cut_low_weight_error[i], cut_high_weight_error[i]);
- }
- printf("\n");
- }
- #endif
-
- // for each quantization level, find the best error terms.
- float best_errors[40];
- int best_scale[40];
- uint8_t cut_low_weight[40];
-
- for (i = 0; i < (max_quantization_steps + 4); i++)
- {
- best_errors[i] = 1e30f;
- best_scale[i] = -1; // Indicates no solution found
- cut_low_weight[i] = 0;
- }
-
-
-
- for (i = 0; i < max_angular_steps; i++)
- {
- int samplecount = highest_weight[i] - lowest_weight[i] + 1;
- if (samplecount >= (max_quantization_steps + 4))
- {
- continue;
- }
- if (samplecount < 2)
- samplecount = 2;
-
- if (best_errors[samplecount] > error[i])
- {
- best_errors[samplecount] = error[i];
- best_scale[samplecount] = i;
- cut_low_weight[samplecount] = 0;
- }
-
- float error_cut_low = error[i] + cut_low_weight_error[i];
- float error_cut_high = error[i] + cut_high_weight_error[i];
- float error_cut_low_high = error[i] + cut_low_weight_error[i] + cut_high_weight_error[i];
-
- if (best_errors[samplecount - 1] > error_cut_low)
- {
- best_errors[samplecount - 1] = error_cut_low;
- best_scale[samplecount - 1] = i;
- cut_low_weight[samplecount - 1] = 1;
- }
-
- if (best_errors[samplecount - 1] > error_cut_high)
- {
- best_errors[samplecount - 1] = error_cut_high;
- best_scale[samplecount - 1] = i;
- cut_low_weight[samplecount - 1] = 0;
- }
-
- if (best_errors[samplecount - 2] > error_cut_low_high)
- {
- best_errors[samplecount - 2] = error_cut_low_high;
- best_scale[samplecount - 2] = i;
- cut_low_weight[samplecount - 2] = 1;
- }
-
- }
-
- // if we got a better error-value for a low sample count than for a high one,
- // use the low sample count error value for the higher sample count as well.
- for (i = 3; i <= max_quantization_steps; i++)
- {
- if (best_errors[i] > best_errors[i - 1])
- {
- best_errors[i] = best_errors[i - 1];
- best_scale[i] = best_scale[i - 1];
- cut_low_weight[i] = cut_low_weight[i - 1];
- }
- }
-
-
- max_quantization_level--; // Decrease level again (see corresponding ++, above)
-
- static const int ql_weights[12] = { 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 33 };
- for (i = 0; i <= max_quantization_level; i++)
- {
- int q = ql_weights[i];
- int bsi = best_scale[q];
-
- // Did we find anything?
- if(bsi < 0)
- {
- printf("ERROR: Unable to find an encoding within the specified error limits. Please revise the error limit values and try again.\n");
- exit(1);
- }
-
- float stepsize = stepsizes[bsi];
- int lwi = lowest_weight[bsi] + cut_low_weight[q];
- int hwi = lwi + q - 1;
- float offset = offsets[bsi];
-
- low_value[i] = offset + lwi * stepsize;
- high_value[i] = offset + hwi * stepsize;
- }
-
-}
-
-
-// helper functions that will compute ideal angular-endpoints
-// for a given set of weights and a given block size descriptors
-
-void compute_angular_endpoints_1plane(float mode_cutoff, const block_size_descriptor * bsd,
- const float *decimated_quantized_weights, const float *decimated_weights,
- float low_value[MAX_WEIGHT_MODES], float high_value[MAX_WEIGHT_MODES])
-{
- int i;
- float low_values[MAX_DECIMATION_MODES][12];
- float high_values[MAX_DECIMATION_MODES][12];
-
- for (i = 0; i < MAX_DECIMATION_MODES; i++)
- {
- int samplecount = bsd->decimation_mode_samples[i];
- int quant_mode = bsd->decimation_mode_maxprec_1plane[i];
- float percentile = bsd->decimation_mode_percentile[i];
- int permit_encode = bsd->permit_encode[i];
- if (permit_encode == 0 || samplecount < 1 || quant_mode < 0 || percentile > mode_cutoff)
- continue;
-
-
- compute_angular_endpoints_for_quantization_levels(samplecount,
- decimated_quantized_weights + i * MAX_WEIGHTS_PER_BLOCK,
- decimated_weights + i * MAX_WEIGHTS_PER_BLOCK, quant_mode, low_values[i], high_values[i]);
- }
-
- for (i = 0; i < MAX_WEIGHT_MODES; i++)
- {
- if (bsd->block_modes[i].is_dual_plane != 0 || bsd->block_modes[i].percentile > mode_cutoff)
- continue;
- int quant_mode = bsd->block_modes[i].quantization_mode;
- int decim_mode = bsd->block_modes[i].decimation_mode;
-
- low_value[i] = low_values[decim_mode][quant_mode];
- high_value[i] = high_values[decim_mode][quant_mode];
- }
-
-}
-
-
-
-void compute_angular_endpoints_2planes(float mode_cutoff,
- const block_size_descriptor * bsd,
- const float *decimated_quantized_weights,
- const float *decimated_weights,
- float low_value1[MAX_WEIGHT_MODES], float high_value1[MAX_WEIGHT_MODES], float low_value2[MAX_WEIGHT_MODES], float high_value2[MAX_WEIGHT_MODES])
-{
- int i;
- float low_values1[MAX_DECIMATION_MODES][12];
- float high_values1[MAX_DECIMATION_MODES][12];
- float low_values2[MAX_DECIMATION_MODES][12];
- float high_values2[MAX_DECIMATION_MODES][12];
-
- for (i = 0; i < MAX_DECIMATION_MODES; i++)
- {
- int samplecount = bsd->decimation_mode_samples[i];
- int quant_mode = bsd->decimation_mode_maxprec_2planes[i];
- float percentile = bsd->decimation_mode_percentile[i];
- int permit_encode = bsd->permit_encode[i];
- if (permit_encode == 0 || samplecount < 1 || quant_mode < 0 || percentile > mode_cutoff)
- continue;
-
- compute_angular_endpoints_for_quantization_levels(samplecount,
- decimated_quantized_weights + 2 * i * MAX_WEIGHTS_PER_BLOCK,
- decimated_weights + 2 * i * MAX_WEIGHTS_PER_BLOCK, quant_mode, low_values1[i], high_values1[i]);
-
- compute_angular_endpoints_for_quantization_levels(samplecount,
- decimated_quantized_weights + (2 * i + 1) * MAX_WEIGHTS_PER_BLOCK,
- decimated_weights + (2 * i + 1) * MAX_WEIGHTS_PER_BLOCK, quant_mode, low_values2[i], high_values2[i]);
-
- }
-
- for (i = 0; i < MAX_WEIGHT_MODES; i++)
- {
- if (bsd->block_modes[i].is_dual_plane != 1 || bsd->block_modes[i].percentile > mode_cutoff)
- continue;
- int quant_mode = bsd->block_modes[i].quantization_mode;
- int decim_mode = bsd->block_modes[i].decimation_mode;
-
- low_value1[i] = low_values1[decim_mode][quant_mode];
- high_value1[i] = high_values1[decim_mode][quant_mode];
- low_value2[i] = low_values2[decim_mode][quant_mode];
- high_value2[i] = high_values2[decim_mode][quant_mode];
- }
-}
diff --git a/3rdparty/bimg/3rdparty/astc/astc_weight_quant_xfer_tables.cpp b/3rdparty/bimg/3rdparty/astc/astc_weight_quant_xfer_tables.cpp
deleted file mode 100644
index 4294735021d..00000000000
--- a/3rdparty/bimg/3rdparty/astc/astc_weight_quant_xfer_tables.cpp
+++ /dev/null
@@ -1,1003 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Quantization transfer tables for ASTC.
- */
-/*----------------------------------------------------------------------------*/
-
-
-#include "astc_codec_internals.h"
-
-const quantization_and_transfer_table quant_and_xfer_tables[12] = {
- // quantization method 0, range 0..1
- {
- QUANT_2,
- {0, 64,},
- {
- 0.000000, 1.000000,},
- {0, 0,},
- {1, 1,},
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1,
- },
- },
-
-
-
-
- // quantization method 1, range 0..2
- {
- QUANT_3,
- {0, 32, 64,},
- {
- 0.000000, 0.500000, 1.000000,},
- {0, 0, 1,},
- {1, 2, 2,},
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2,
- },
- },
-
-
-
-
- // quantization method 2, range 0..3
- {
- QUANT_4,
- {0, 21, 43, 64,},
- {
- 0.000000, 0.328125, 0.671875, 1.000000,},
- {0, 0, 1, 2,},
- {1, 2, 3, 3,},
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3,
- },
- },
-
-
-
-
- // quantization method 3, range 0..4
- {
- QUANT_5,
- {0, 16, 32, 48, 64,},
- {
- 0.000000, 0.250000, 0.500000, 0.750000,
- 1.000000,},
- {0, 0, 1, 2, 3,},
- {1, 2, 3, 4, 4,},
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4,
- },
- },
-
-
-
-
- // quantization method 4, range 0..5
- {
- QUANT_6,
- {0, 64, 12, 52, 25, 39,},
- {
- 0.000000, 1.000000, 0.187500, 0.812500,
- 0.390625, 0.609375,},
- {0, 3, 0, 5, 2, 4,},
- {2, 1, 4, 1, 5, 3,},
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 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,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1,
- },
- },
-
-
-
-
- // quantization method 5, range 0..7
- {
- QUANT_8,
- {0, 9, 18, 27, 37, 46, 55, 64,},
- {
- 0.000000, 0.140625, 0.281250, 0.421875,
- 0.578125, 0.718750, 0.859375, 1.000000,},
- {0, 0, 1, 2, 3, 4, 5, 6,},
- {1, 2, 3, 4, 5, 6, 7, 7,},
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7,
- },
- },
-
-
-
-
- // quantization method 6, range 0..9
- {
- QUANT_10,
- {0, 64, 7, 57, 14, 50, 21, 43, 28, 36,},
- {
- 0.000000, 1.000000, 0.109375, 0.890625,
- 0.218750, 0.781250, 0.328125, 0.671875,
- 0.437500, 0.562500,},
- {0, 3, 0, 5, 2, 7, 4, 9, 6, 8,},
- {2, 1, 4, 1, 6, 3, 8, 5, 9, 7,},
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 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, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1,
- },
- },
-
-
-
-
- // quantization method 7, range 0..11
- {
- QUANT_12,
- {0, 64, 17, 47, 5, 59, 23, 41, 11, 53, 28, 36,},
- {
- 0.000000, 1.000000, 0.265625, 0.734375,
- 0.078125, 0.921875, 0.359375, 0.640625,
- 0.171875, 0.828125, 0.437500, 0.562500,},
- {0, 5, 8, 7, 0, 9, 2, 11, 4, 3, 6, 10,},
- {4, 1, 6, 9, 8, 1, 10, 3, 2, 5, 11, 7,},
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1,
- },
- },
-
-
-
-
- // quantization method 8, range 0..15
- {
- QUANT_16,
- {0, 4, 8, 12, 17, 21, 25, 29, 35, 39, 43, 47, 52, 56, 60, 64,},
- {
- 0.000000, 0.062500, 0.125000, 0.187500,
- 0.265625, 0.328125, 0.390625, 0.453125,
- 0.546875, 0.609375, 0.671875, 0.734375,
- 0.812500, 0.875000, 0.937500, 1.000000,},
- {0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,},
- {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 15,},
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
- 15,
- },
- },
-
-
-
-
- // quantization method 9, range 0..19
- {
- QUANT_20,
- {0, 64, 16, 48, 3, 61, 19, 45, 6, 58, 23, 41, 9, 55, 26, 38, 13, 51, 29, 35,},
- {
- 0.000000, 1.000000, 0.250000, 0.750000,
- 0.046875, 0.953125, 0.296875, 0.703125,
- 0.093750, 0.906250, 0.359375, 0.640625,
- 0.140625, 0.859375, 0.406250, 0.593750,
- 0.203125, 0.796875, 0.453125, 0.546875,},
- {0, 5, 16, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 17, 10, 19, 12, 3, 14, 18,},
- {4, 1, 6, 17, 8, 1, 10, 3, 12, 5, 14, 7, 16, 9, 18, 11, 2, 13, 19, 15,},
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15, 15, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1,
- },
- },
-
-
-
-
- // quantization method 10, range 0..23
- {
- QUANT_24,
- {0, 64, 8, 56, 16, 48, 24, 40, 2, 62, 11, 53, 19, 45, 27, 37, 5, 59, 13, 51, 22, 42, 30, 34,},
- {
- 0.000000, 1.000000, 0.125000, 0.875000,
- 0.250000, 0.750000, 0.375000, 0.625000,
- 0.031250, 0.968750, 0.171875, 0.828125,
- 0.296875, 0.703125, 0.421875, 0.578125,
- 0.078125, 0.921875, 0.203125, 0.796875,
- 0.343750, 0.656250, 0.468750, 0.531250,},
- {0, 9, 16, 11, 18, 13, 20, 15, 0, 17, 2, 19, 4, 21, 6, 23, 8, 3, 10, 5, 12, 7, 14, 22,},
- {8, 1, 10, 17, 12, 19, 14, 21, 16, 1, 18, 3, 20, 5, 22, 7, 2, 9, 4, 11, 6, 13, 23, 15,},
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
- 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
- 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
- 23, 23, 23, 23, 23, 23, 23, 23, 23, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15, 15, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1,
- },
- },
-
-
-
-
- // quantization method 11, range 0..31
- {
- QUANT_32,
- {0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 28, 30, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, 62, 64,},
- {
- 0.000000, 0.031250, 0.062500, 0.093750,
- 0.125000, 0.156250, 0.187500, 0.218750,
- 0.250000, 0.281250, 0.312500, 0.343750,
- 0.375000, 0.406250, 0.437500, 0.468750,
- 0.531250, 0.562500, 0.593750, 0.625000,
- 0.656250, 0.687500, 0.718750, 0.750000,
- 0.781250, 0.812500, 0.843750, 0.875000,
- 0.906250, 0.937500, 0.968750, 1.000000,},
- {0, 0, 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,},
- {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, 31,},
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
- 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8,
- 8, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
- 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
- 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14,
- 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
- 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21,
- 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
- 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
- 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
- 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
- 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
- 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25,
- 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
- 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
- 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
- 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29,
- 29, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, 31,
- 31,
- },
- },
-
-};
diff --git a/3rdparty/bimg/3rdparty/astc/license.txt b/3rdparty/bimg/3rdparty/astc/license.txt
deleted file mode 100644
index a33bccd57e7..00000000000
--- a/3rdparty/bimg/3rdparty/astc/license.txt
+++ /dev/null
@@ -1,137 +0,0 @@
-END USER LICENCE AGREEMENT FOR THE MALI ASTC SPECIFICATION AND SOFTWARE CODEC,
-VERSION: 1.3
-
-THIS END USER LICENCE AGREEMENT ("LICENCE") IS A LEGAL AGREEMENT BETWEEN YOU
-(EITHER A SINGLE INDIVIDUAL, OR SINGLE LEGAL ENTITY) AND ARM LIMITED ("ARM")
-FOR THE USE OF THE SOFTWARE ACCOMPANYING THIS LICENCE. ARM IS ONLY WILLING
-TO LICENSE THE SOFTWARE TO YOU ON CONDITION THAT YOU ACCEPT ALL OF THE TERMS
-IN THIS LICENCE. BY CLICKING "I AGREE" OR BY INSTALLING OR OTHERWISE USING
-OR COPYING THE SOFTWARE YOU INDICATE THAT YOU AGREE TO BE BOUND BY ALL THE
-TERMS OF THIS LICENCE.
-
-IF YOU DO NOT AGREE TO THE TERMS OF THIS LICENCE, ARM IS UNWILLING TO LICENSE
-THE SOFTWARE TO YOU AND YOU MAY NOT INSTALL, USE OR COPY THE SOFTWARE.
-
-1. DEFINITIONS.
-
-"Authorised Purpose" means the use of the Software solely to develop products
-and tools which implement the Khronos ASTC specification to;
-(i) compress texture images into ASTC format ("Compression Results");
-(ii) distribute such Compression Results to third parties; and
-(iii) decompress texture images stored in ASTC format.
-
-"Software" means the source code and Software binaries accompanying this
-Licence, and any printed, electronic or online documentation supplied with it,
-in all cases relating to the MALI ASTC SPECIFICATION AND SOFTWARE CODEC.
-
-2. LICENCE GRANT.
-
-ARM hereby grants to you, subject to the terms and conditions of this Licence,
-a nonexclusive, nontransferable, free of charge, royalty free, worldwide
-licence to use, copy, modify and (subject to Clause 3 below) distribute the
-Software solely for the Authorised Purpose.
-
-No right is granted to use the Software to develop hardware.
-
-Notwithstanding the foregoing, nothing in this Licence prevents you from
-using the Software to develop products that conform to an application
-programming interface specification issued by The Khronos Group Inc.
-("Khronos"), provided that you have licences to develop such products
-under the relevant Khronos agreements.
-
- 3. RESTRICTIONS ON USE OF THE SOFTWARE.
-
-RESTRICTIONS ON TRANSFER OF LICENSED RIGHTS: The rights granted to you under
-this Licence may not be assigned by you to any third party without the prior
-written consent of ARM.
-
-TITLE AND RESERVATION OF RIGHTS: You acquire no rights to the Software other
-than as expressly provided by this Licence. The Software is licensed not sold.
-ARM does not transfer title to the Software to you. In no event shall the
-licences granted in Clause 2 be construed as granting you expressly or by
-implication, estoppel or otherwise, licences to any ARM technology other than
-the Software.
-
-NOTICES: You shall not remove from the Software any copyright notice or other
-notice (whether ARM's or its licensor's), and you shall ensure that any such
-notice is reproduced in any copies of the whole or any part of the Software
-made by you. You shall not use ARM's or its licensor's name, logo or
-trademarks to market Compression Results. If you distribute the Software to a
-third party, you agree to include a copy of this Licence with such
-distribution.
-
-4. NO SUPPORT.
-
-ARM has no obligation to support or to continue providing or updating any of
-the Software.
-
-5. NO WARRANTIES.
-
-YOU AGREE THAT THE SOFTWARE IS LICENSED "AS IS", AND THAT ARM EXPRESSLY
-DISCLAIMS ALL REPRESENTATIONS, WARRANTIES, CONDITIONS OR OTHER TERMS, EXPRESS,
-IMPLIED OR STATUTORY, TO THE FULLEST EXTENT PERMITTED BY LAW. YOU EXPRESSLY
-ASSUME ALL LIABILITIES AND RISKS, FOR USE OR OPERATION OF ANY APPLICATION
-PROGRAMS YOU CREATE WITH THE SOFTWARE, AND YOU ASSUME THE ENTIRE COST OF ALL
-NECESSARY SERVICING, REPAIR OR CORRECTION.
-
-6. LIMITATION OF LIABILITY.
-
-TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL ARM BE
-LIABLE FOR ANY INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
-(INCLUDING LOSS OF PROFITS) ARISING OUT OF THE USE OR INABILITY TO USE THE
-SOFTWARE WHETHER BASED ON A CLAIM UNDER CONTRACT, TORT OR OTHER LEGAL THEORY,
-EVEN IF ARM WAS ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
-
-ARM does not seek to limit or exclude liability for death or personal injury
-arising from ARM's negligence and because some jurisdictions do not permit the
-exclusion or limitation of liability for consequential or incidental damages
-the above limitation relating to liability for consequential damages may not
-apply to you.
-
-NOTWITHSTANDING ANYTHING TO THE CONTRARY CONTAINED IN THIS LICENCE, THE
-MAXIMUM LIABILITY OF ARM TO YOU IN AGGREGATE FOR ALL CLAIMS MADE AGAINST ARM
-IN CONTRACT TORT OR OTHERWISE UNDER OR IN CONNECTION WITH THE SUBJECT MATTER
-OF THIS LICENCE SHALL NOT EXCEED THE GREATER OF THE TOTAL OF SUMS PAID BY YOU
-TO ARM (IF ANY) FOR THIS LICENCE AND US$5.00.
-
-7. U.S. GOVERNMENT END USERS.
-
-US Government Restrictions: Use, duplication, reproduction, release,
-modification, disclosure or transfer of this commercial product and
-accompanying documentation is restricted in accordance with the terms
-of this Licence.
-
-8. TERM AND TERMINATION.
-
-This Licence shall remain in force until terminated by you or by ARM. Without
-prejudice to any of its other rights if you are in breach of any of the terms
-and conditions of this Licence then ARM may terminate this Licence immediately
-upon giving written notice to you. You may terminate this Licence at any time.
-
-Upon termination of this Licence by you or by ARM you shall stop using the
-Software and destroy all copies of the Software in your possession together
-with all documentation and related materials. The provisions of Clauses 1, 3,
-4, 5, 6, 7, 8 and 9 shall survive termination of this Licence.
-
-9. GENERAL.
-
-This Licence is governed by English Law. Except where ARM agrees otherwise in
-a written contract signed by you and ARM, this is the only agreement between
-you and ARM relating to the Software and it may only be modified by written
-agreement between you and ARM. Except as expressly agreed in writing, this
-Licence may not be modified by purchase orders, advertising or other
-representation by any person. If any clause in this Licence is held by a court
-of law to be illegal or unenforceable the remaining provisions of this Licence
-shall not be affected thereby. The failure by ARM to enforce any of the
-provisions of this Licence, unless waived in writing, shall not constitute a
-waiver of ARM's rights to enforce such provision or any other provision of
-this Licence in the future.
-
-You agree to comply fully with all laws and regulations of the United States
-and other countries ("Export Laws") to assure that the Software is not;
-(1) exported, directly or indirectly, in violation of Export Laws, either to
-any countries that are subject to U.S.A. export restrictions or to any end
-user who has been prohibited from participating in the U.S.A. export
-transactions by any federal agency of the U.S.A. government; or
-(2) intended to be used for any purpose prohibited by Export Laws, including,
-without limitation, nuclear, chemical, or biological weapons proliferation.
diff --git a/3rdparty/bimg/3rdparty/astc/mathlib.cpp b/3rdparty/bimg/3rdparty/astc/mathlib.cpp
deleted file mode 100644
index ee6a86b4298..00000000000
--- a/3rdparty/bimg/3rdparty/astc/mathlib.cpp
+++ /dev/null
@@ -1,781 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Library of math functions.
- */
-/*----------------------------------------------------------------------------*/
-
-#define _USE_MATH_DEFINES // for M_PI on windows
-
-#include <time.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <math.h>
-#include "mathlib.h"
-
-#ifdef WIN32
- double cbrt(double n)
- {
- return n < 0 ? -pow(-n, 1.0 / 3.0) : pow(n, 1.0 / 3.0);
- }
-#endif
-
-/**************************
- basic OpenCL functions
-**************************/
-
-float inversesqrt(float p)
-{
- return 1.0f / sqrt(p);
-}
-float acospi(float p)
-{
- return static_cast < float >(acos(p) * (1.0f / M_PI));
-};
-float sinpi(float p)
-{
- return static_cast < float >(sin(p * M_PI));
-}
-float cospi(float p)
-{
- return static_cast < float >(cos(p * M_PI));
-}
-
-
-float nan(int p)
-{
- union
- {
- int p;
- float q;
- } v;
- v.p = p | 0x7FC00000U;
- return v.q;
-}
-
-#if !_MSC_VER && !__clang__ && (__cplusplus < 201103L)
-float fmax(float p, float q)
-{
- if (p != p)
- return q;
- if (q != q)
- return p;
- if (p > q)
- return p;
- return q;
-}
-
-float fmin(float p, float q)
-{
- if (p != p)
- return q;
- if (q != q)
- return p;
- if (p < q)
- return p;
- return q;
-}
-#endif // C++11
-
-float2 fmax(float2 p, float2 q)
-{
- return float2(fmax(p.x, q.x), fmax(p.y, q.y));
-}
-
-float3 fmax(float3 p, float3 q)
-{
- return float3(fmax(p.x, q.x), fmax(p.y, q.y), fmax(p.z, q.z));
-}
-
-float4 fmax(float4 p, float4 q)
-{
- return float4(fmax(p.x, q.x), fmax(p.y, q.y), fmax(p.z, q.z), fmax(p.w, q.w));
-}
-
-
-float2 fmin(float2 p, float2 q)
-{
- return float2(fmin(p.x, q.x), fmin(p.y, q.y));
-}
-
-float3 fmin(float3 p, float3 q)
-{
- return float3(fmin(p.x, q.x), fmin(p.y, q.y), fmin(p.z, q.z));
-}
-
-float4 fmin(float4 p, float4 q)
-{
- return float4(fmin(p.x, q.x), fmin(p.y, q.y), fmin(p.z, q.z), fmin(p.w, q.w));
-}
-
-/*
- float dot( float2 p, float2 q ) { return p.x*q.x + p.y*q.y; } float dot( float3 p, float3 q ) { return p.x*q.x + p.y*q.y + p.z*q.z; } float dot( float4 p, float4 q ) { return p.x*q.x + p.y*q.y +
- p.z*q.z + p.w*q.w; } */
-
-float3 cross(float3 p, float3 q)
-{
- return p.yzx * q.zxy - p.zxy * q.yzx;
-}
-
-float4 cross(float4 p, float4 q)
-{
- return float4(p.yzx * q.zxy - p.zxy * q.yzx, 0.0f);
-}
-
-float length(float2 p)
-{
- return sqrt(dot(p, p));
-}
-
-float length(float3 p)
-{
- return sqrt(dot(p, p));
-}
-
-float length(float4 p)
-{
- return sqrt(dot(p, p));
-}
-
-float length_sqr(float2 p)
-{
- return dot(p, p);
-}
-
-float length_sqr(float3 p)
-{
- return dot(p, p);
-}
-
-float length_sqr(float4 p)
-{
- return dot(p, p);
-}
-
-
-float distance(float2 p, float2 q)
-{
- return length(q - p);
-}
-
-float distance(float3 p, float3 q)
-{
- return length(q - p);
-}
-
-float distance(float4 p, float4 q)
-{
- return length(q - p);
-}
-
-float distance_sqr(float2 p, float2 q)
-{
- return length_sqr(q - p);
-}
-
-float distance_sqr(float3 p, float3 q)
-{
- return length_sqr(q - p);
-}
-
-float distance_sqr(float4 p, float4 q)
-{
- return length_sqr(q - p);
-}
-
-
-float2 normalize(float2 p)
-{
- return p / length(p);
-}
-
-float3 normalize(float3 p)
-{
- return p / length(p);
-}
-
-float4 normalize(float4 p)
-{
- return p / length(p);
-}
-
-
-/**************************************************
- matrix functions, for 2x2, 3x3 and 4x4 matrices:
-
- * trace
- * determinant
- * transform
- * inverse
- * adjugate
- * characteristic polynomial
- * eigenvalue
- * eigenvector
-
- additionally, root solver
- for 2nd, 3rd and 4th degree monic polynomials.
-
-*************************************************/
-
-/*
- struct mat2 { float2 v[2]; };
- struct mat3 { float3 v[3]; };
- struct mat4 { float4 v[4]; };
-*/
-
-float trace(mat2 p)
-{
- return p.v[0].x + p.v[1].y;
-}
-
-float trace(mat3 p)
-{
- return p.v[0].x + p.v[1].y + p.v[2].z;
-}
-
-float trace(mat4 p)
-{
- return p.v[0].x + p.v[1].y + p.v[2].z + p.v[3].w;
-}
-
-float determinant(mat2 p)
-{
- float2 v = p.v[0].xy * p.v[1].yx;
- return v.x - v.y;
-}
-
-float determinant(mat3 p)
-{
- return dot(p.v[0], cross(p.v[1], p.v[2]));
-}
-
-float determinant(mat4 p)
-{
- return dot(p.v[0],
- float4(dot(p.v[1].yzw, cross(p.v[2].yzw, p.v[3].yzw)),
- -dot(p.v[1].xzw, cross(p.v[2].xzw, p.v[3].xzw)), dot(p.v[1].xyw, cross(p.v[2].xyw, p.v[3].xyw)), -dot(p.v[1].xyz, cross(p.v[2].xyz, p.v[3].xyz))));
-}
-
-
-/*
- characteristic polynomials for matrices. These polynomials are monic, meaning that the coefficient of the highest component is 1; this component is omitted. The first component is the constant
- part. */
-
-float2 characteristic_poly(mat2 p)
-{
- return float2(determinant(p), -trace(p));
-}
-
-
-float3 characteristic_poly(mat3 p)
-{
- float2 v1 = (p.v[0].xy * p.v[1].yx) + (p.v[0].xz * p.v[2].zx) + (p.v[1].yz * p.v[2].zy);
-
- return float3(-determinant(p), v1.x - v1.y, -trace(p));
-}
-
-
-float4 characteristic_poly(mat4 p)
-{
- float2 v1 = (p.v[0].xy * p.v[1].yx) + (p.v[0].xz * p.v[2].zx) + (p.v[0].xw * p.v[3].wx) + (p.v[1].yz * p.v[2].zy) + (p.v[1].yw * p.v[3].wy) + (p.v[2].zw * p.v[3].wz);
-
- return float4(determinant(p),
- -dot(p.v[1].yzw, cross(p.v[2].yzw, p.v[3].yzw))
- - dot(p.v[0].xzw, cross(p.v[2].xzw, p.v[3].xzw)) - dot(p.v[0].xyw, cross(p.v[1].xyw, p.v[3].xyw)) - dot(p.v[0].xyz, cross(p.v[1].xyz, p.v[2].xyz)), v1.x - v1.y, -trace(p));
-}
-
-
-/*
- Root finders for monic polynomials (highest coefficient is equal to 1)
-
- Returns a vector with length equal to the number of roots that the polynomial has;
- for roots that do not genuinely exist, we return NaN.
-
- The polynomial is basically
-
- poly(n) = p.x + p.y*n + p.z*n^2 + p.w*n^3
-
- (including only the components of the vector that actually exist; the next coefficient
- has the value 1, and the remaining ones have value 0. )
- */
-
-
-float2 solve_monic(float2 p)
-{
- float v = sqrt(p.y * p.y - 4 * p.x);
- return (p.yy + float2(v, -v)) * -0.5f;
-}
-
-float3 solve_monic(float3 p)
-{
-
- p = p * (1.0f / 3.0f);
-
- float pz = p.z;
-
- // compute a normalization value to scale the vector by.
- // The normalization factor is divided by 2^20.
- // This is supposed to make internal calculations unlikely
- // to overflow while also making underflows unlikely.
- float scal = 1.0f;
-
- float cx = static_cast < float >(cbrt(fabs(p.x)));
- float cy = static_cast < float >(cbrt(fabs(p.y)));
- scal = fmax(fmax(fabsf(p.z), cx), cy * cy) * (1.0f / 1048576.0f);
- float rscal = 1.0f / scal;
- p = p * float3(rscal * rscal * rscal, rscal * rscal, rscal);
-
- float bb = p.z * p.z; // div scal^2
-
- float nq = bb - p.y; // div scal^2
- float r = 1.5f * (p.y * p.z - p.x) - p.z * bb; // div scal^3
- float nq3 = nq * nq * nq; // div scal^6
- float r2 = r * r; // div scal^6
-
- if (nq3 < r2)
- {
- // one root
- float root = sqrt(r2 - nq3); // div scal^3
- float s = static_cast < float >(cbrt(r + root)); // div scal
- float t = static_cast < float >(cbrt(r - root)); // div scal
- return float3((s + t) * scal - pz, nan(0), nan(0));
- }
- else
- {
- // three roots
- float phi_r = inversesqrt(nq3); // div scal ^ -3
- float phi_root = static_cast < float >(cbrt(phi_r * nq3)); // div scal
- float theta = acospi(r * phi_r);
- theta *= 1.0f / 3.0f;
- float ncprod = phi_root * cospi(theta);
- float dev = 1.73205080756887729353f * phi_root * sinpi(theta);
- return float3(2 * ncprod, -dev - ncprod, dev - ncprod) * scal - pz;
- }
-}
-
-
-/*
- * This function is not overflow-safe. Use with care.
- */
-float4 solve_monic(float4 p)
-{
-
- // step 1: depress the input polynomial
- float bias = p.w * 0.25f;
- float3 qv = float3((-3.0f / 256.0f) * p.w * p.w, (1.0f / 8.0f) * p.w, (-3.0 / 8.0f));
- float3 rv = float3((1.0f / 16.0f) * p.z * p.w - (1.0f / 4.0f) * p.y, (-1.0f / 2.0f) * p.z, 0.0f);
- float3 qx = float3(qv * p.w + rv) * p.w + p.xyz;
-
- // step 2: solve a cubic equation to get hold of a parameter p.
- float3 monicp = float3(-qx.y * qx.y, (qx.z * qx.z) - (4.0f * qx.x), 2.0f * qx.z);
- float4 v = float4(solve_monic(monicp), 1e-37f);
-
- // the cubic equation may have multiple solutions; at least one of them
- // is numerically at least nonnegative (but may have become negative as a result of
- // a roundoff error). We use fmax() to extract this value or a very small positive value.
- float2 v2 = fmax(v.xy, v.zw);
- float p2 = fmax(v2.x, v2.y); // p^2
- float pr = inversesqrt(p2); // 1/p
- float pm = p2 * pr; // p
-
- // step 3: use the solution for the cubic equation to set up two quadratic equations;
- // these two equations then result in the 4 possible roots.
- float f1 = qx.z + p2;
- float f2 = qx.y * pr;
- float s = 0.5f * (f1 + f2);
- float q = 0.5f * (f1 - f2);
-
- float4 res = float4(solve_monic(float2(q, pm)),
- solve_monic(float2(s, -pm)));
-
- // finally, order the results and apply the bias.
- if (res.x != res.x)
- return res.zwxy - bias;
- else
- return res - bias;
-}
-
-
-
-float2 transform(mat2 p, float2 q)
-{
- return float2(dot(p.v[0], q), dot(p.v[1], q));
-}
-
-
-float3 transform(mat3 p, float3 q)
-{
- return float3(dot(p.v[0], q), dot(p.v[1], q), dot(p.v[2], q));
-}
-
-
-float4 transform(mat4 p, float4 q)
-{
- return float4(dot(p.v[0], q), dot(p.v[1], q), dot(p.v[2], q), dot(p.v[3], q));
-}
-
-
-
-mat2 adjugate(mat2 p)
-{
- mat2 res;
- res.v[0] = float2(p.v[1].y, -p.v[0].y);
- res.v[1] = float2(-p.v[1].x, p.v[0].x);
- return res;
-}
-
-
-
-mat2 invert(mat2 p)
-{
- float rdet = 1.0f / determinant(p);
- mat2 res;
- res.v[0] = float2(p.v[1].y, -p.v[0].y) * rdet;
- res.v[1] = float2(-p.v[1].x, p.v[0].x) * rdet;
- return res;
-}
-
-
-
-mat3 adjugate(mat3 p)
-{
- mat3 res;
- float3 prd0 = cross(p.v[1], p.v[2]);
- float3 prd1 = cross(p.v[2], p.v[0]);
- float3 prd2 = cross(p.v[0], p.v[1]);
- res.v[0] = float3(prd0.x, prd1.x, prd2.x);
- res.v[1] = float3(prd0.y, prd1.y, prd2.y);
- res.v[2] = float3(prd0.z, prd1.z, prd2.z);
- return res;
-}
-
-
-
-mat3 invert(mat3 p)
-{
- float3 cross0 = cross(p.v[1], p.v[2]);
- float det = dot(cross0, p.v[0]);
- float rdet = 1.0f / det;
- mat3 res;
- float3 prd0 = cross0 * rdet;
- float3 prd1 = cross(p.v[2], p.v[0]) * rdet;
- float3 prd2 = cross(p.v[0], p.v[1]) * rdet;
- res.v[0] = float3(prd0.x, prd1.x, prd2.x);
- res.v[1] = float3(prd0.y, prd1.y, prd2.y);
- res.v[2] = float3(prd0.z, prd1.z, prd2.z);
- return res;
-}
-
-
-
-mat4 adjugate(mat4 p)
-{
- mat4 res;
-
- float3 bpc0 = cross(p.v[2].yzw, p.v[3].yzw);
- float3 tpc0 = cross(p.v[0].yzw, p.v[1].yzw);
- res.v[0] = float4(dot(bpc0, p.v[1].yzw), -dot(bpc0, p.v[0].yzw), dot(tpc0, p.v[3].yzw), -dot(tpc0, p.v[2].yzw));
-
- float3 bpc1 = cross(p.v[2].xzw, p.v[3].xzw);
- float3 tpc1 = cross(p.v[0].xzw, p.v[1].xzw);
- res.v[1] = float4(-dot(bpc1, p.v[1].xzw), dot(bpc1, p.v[0].xzw), -dot(tpc1, p.v[3].xzw), dot(tpc1, p.v[2].xzw));
-
- float3 bpc2 = cross(p.v[2].xyw, p.v[3].xyw);
- float3 tpc2 = cross(p.v[0].xyw, p.v[1].xyw);
- res.v[2] = float4(dot(bpc2, p.v[1].xyw), -dot(bpc2, p.v[0].xyw), dot(tpc2, p.v[3].xyw), -dot(tpc2, p.v[2].xyw));
-
- float3 bpc3 = cross(p.v[2].xyz, p.v[3].xyz);
- float3 tpc3 = cross(p.v[0].xyz, p.v[1].xyz);
- res.v[3] = float4(-dot(bpc3, p.v[1].xyz), dot(bpc3, p.v[0].xyz), -dot(tpc3, p.v[3].xyz), dot(tpc3, p.v[2].xyz));
-
- return res;
-}
-
-
-
-mat4 invert(mat4 p)
-{
- // cross products between the bottom two rows
- float3 bpc0 = cross(p.v[2].yzw, p.v[3].yzw);
- float3 bpc1 = cross(p.v[2].xzw, p.v[3].xzw);
- float3 bpc2 = cross(p.v[2].xyw, p.v[3].xyw);
- float3 bpc3 = cross(p.v[2].xyz, p.v[3].xyz);
-
- // dot-products for the top rows
- float4 row1 = float4(dot(bpc0, p.v[1].yzw),
- -dot(bpc1, p.v[1].xzw),
- dot(bpc2, p.v[1].xyw),
- -dot(bpc3, p.v[1].xyz));
-
- float det = dot(p.v[0], row1);
- float rdet = 1.0f / det;
-
- mat4 res;
-
- float3 tpc0 = cross(p.v[0].yzw, p.v[1].yzw);
- res.v[0] = float4(row1.x, -dot(bpc0, p.v[0].yzw), dot(tpc0, p.v[3].yzw), -dot(tpc0, p.v[2].yzw)) * rdet;
-
- float3 tpc1 = cross(p.v[0].xzw, p.v[1].xzw);
- res.v[1] = float4(row1.y, dot(bpc1, p.v[0].xzw), -dot(tpc1, p.v[3].xzw), dot(tpc1, p.v[2].xzw)) * rdet;
- float3 tpc2 = cross(p.v[0].xyw, p.v[1].xyw);
-
- res.v[2] = float4(row1.z, -dot(bpc2, p.v[0].xyw), dot(tpc2, p.v[3].xyw), -dot(tpc2, p.v[2].xyw)) * rdet;
-
- float3 tpc3 = cross(p.v[0].xyz, p.v[1].xyz);
- res.v[3] = float4(row1.w, dot(bpc3, p.v[0].xyz), -dot(tpc3, p.v[3].xyz), dot(tpc3, p.v[2].xyz)) * rdet;
-
-
- return res;
-}
-
-
-
-float2 eigenvalues(mat2 p)
-{
- return solve_monic(characteristic_poly(p));
-}
-
-float3 eigenvalues(mat3 p)
-{
- return solve_monic(characteristic_poly(p));
-}
-
-float4 eigenvalues(mat4 p)
-{
- return solve_monic(characteristic_poly(p));
-}
-
-float2 eigenvector(mat2 p, float eigvl)
-{
- // for a mat2, we first reverse-subtract the eigenvalue from the matrix diagonal,
- // then return whichever row had the larger sum-of-absolute-values.
- float4 v = float4(p.v[0], p.v[1]);
- v.xw = eigvl - v.xw;
- if (fabs(v.x) + fabs(v.y) > fabs(v.z) + fabs(v.w))
- return v.yx;
- else
- return v.wz;
-}
-
-
-float3 eigenvector(mat3 p, float eigvl)
-{
- // for a mat3, we obtain the eigenvector as follows:
- // step 1: subtract the eigenvalue from the matrix diagonal
- // step 2: take two cross products between rows in the matrix
- // step 3: return whichever of the cross products resulted in a longer vector.
-
- float3 r0 = p.v[0];
- float3 r1 = p.v[1];
- float3 r2 = p.v[2];
-
- r0.x = r0.x - eigvl;
- r1.y = r1.y - eigvl;
- r2.z = r2.z - eigvl;
-
- float3 v1 = cross(r0, r1);
- float3 v2 = cross(r1, r2);
-
- float len1 = dot(v1, v1);
- float len2 = dot(v2, v2);
- return len1 > len2 ? v1 : v2;
-}
-
-
-// generalized cross product: 3 vectors with 4 components each.
-// The result is a vector that is perpendicular to all the three specified vectors.
-
-// it works in the sense that it produces a perpendicular-to-everything vector,
-// but it has not been tested whether it points in the "right" direction.
-float4 gcross(float4 p, float4 q, float4 r)
-{
- return float4(dot(p.yzw, cross(q.yzw, r.yzw)), -dot(p.xzw, cross(q.xzw, r.xzw)), dot(p.xyw, cross(q.xyw, r.xyw)), -dot(p.xyz, cross(q.xyz, r.xyz)));
-}
-
-
-
-float4 eigenvector(mat4 p, float eigvl)
-{
- float4 r0 = p.v[0];
- float4 r1 = p.v[1];
- float4 r2 = p.v[2];
- float4 r3 = p.v[3];
-
- r0.x = r0.x - eigvl;
- r1.y = r1.y - eigvl;
- r2.z = r2.z - eigvl;
- r3.w = r3.w - eigvl;
-
- // generate four candidate vectors using the generalized cross product.
- // These will in general point in the same direction (or 180 degree opposite),
- // however they will have different lengths. Pick the longest one.
- float3 tpc0 = cross(r0.yzw, r1.yzw);
- float3 tpc1 = cross(r0.xzw, r1.xzw);
- float3 tpc2 = cross(r0.xyw, r1.xyw);
- float3 tpc3 = cross(r0.xyz, r1.xyz);
-
- float4 v1 = float4(dot(r2.yzw, tpc0),
- -dot(r2.xzw, tpc1),
- dot(r2.xyw, tpc2),
- -dot(r2.xyz, tpc3));
-
- float4 v2 = float4(dot(r3.yzw, tpc0),
- -dot(r3.xzw, tpc1),
- dot(r3.xyw, tpc2),
- -dot(r3.xyz, tpc3));
-
- float3 bpc0 = cross(r2.yzw, r3.yzw);
- float3 bpc1 = cross(r2.xzw, r3.xzw);
- float3 bpc2 = cross(r2.xyw, r3.xyw);
- float3 bpc3 = cross(r2.xyz, r3.xyz);
-
- float4 v3 = float4(dot(r0.yzw, bpc0),
- -dot(r0.xzw, bpc1),
- dot(r0.xyw, bpc2),
- -dot(r0.xyz, bpc3));
-
- float4 v4 = float4(dot(r1.yzw, bpc0),
- -dot(r1.xzw, bpc1),
- dot(r1.xyw, bpc2),
- -dot(r1.xyz, bpc3));
-
- float len1 = dot(v1, v1);
- float len2 = dot(v2, v2);
- float len3 = dot(v3, v3);
- float len4 = dot(v4, v4);
-
- if (fmax(len1, len2) > fmax(len3, len4))
- return len1 > len2 ? v1 : v2;
- else
- return len3 > len4 ? v3 : v4;
-}
-
-
-// matrix multiply
-
-mat2 operator *(mat2 a, mat2 b)
-{
- mat2 res;
- res.v[0] = a.v[0].x * b.v[0] + a.v[0].y * b.v[1];
- res.v[1] = a.v[1].x * b.v[0] + a.v[1].y * b.v[1];
- return res;
-}
-
-mat3 operator *(mat3 a, mat3 b)
-{
- mat3 res;
- res.v[0] = a.v[0].x * b.v[0] + a.v[0].y * b.v[1] + a.v[0].z * b.v[2];
- res.v[1] = a.v[1].x * b.v[0] + a.v[1].y * b.v[1] + a.v[1].z * b.v[2];
- res.v[2] = a.v[2].x * b.v[0] + a.v[2].y * b.v[1] + a.v[2].z * b.v[2];
- return res;
-}
-
-mat4 operator *(mat4 a, mat4 b)
-{
- mat4 res;
- res.v[0] = a.v[0].x * b.v[0] + a.v[0].y * b.v[1] + a.v[0].z * b.v[2] + a.v[0].w * b.v[3];
- res.v[1] = a.v[1].x * b.v[0] + a.v[1].y * b.v[1] + a.v[1].z * b.v[2] + a.v[1].w * b.v[3];
- res.v[2] = a.v[2].x * b.v[0] + a.v[2].y * b.v[1] + a.v[2].z * b.v[2] + a.v[2].w * b.v[3];
- res.v[3] = a.v[3].x * b.v[0] + a.v[3].y * b.v[1] + a.v[3].z * b.v[2] + a.v[3].w * b.v[3];
- return res;
-}
-
-
-
-/*************************
-
-simple geometric functions
-
-*************************/
-
-
-// return parameter value for the point on the line closest to the specified point
-float param_nearest_on_line(float2 point, line2 line)
-{
- return dot(point - line.a, line.b) / dot(line.b, line.b);
-}
-
-float param_nearest_on_line(float3 point, line3 line)
-{
- return dot(point - line.a, line.b) / dot(line.b, line.b);
-}
-
-float param_nearest_on_line(float4 point, line4 line)
-{
- return dot(point - line.a, line.b) / dot(line.b, line.b);
-}
-
-
-// return distance between point and line
-float point_line_distance(float2 point, line2 line)
-{
- return distance(point, line.a + line.b * param_nearest_on_line(point, line));
-}
-
-float point_line_distance(float3 point, line3 line)
-{
- return distance(point, line.a + line.b * param_nearest_on_line(point, line));
-}
-
-float point_line_distance(float4 point, line4 line)
-{
- return distance(point, line.a + line.b * param_nearest_on_line(point, line));
-}
-
-
-float point_line_distance_sqr(float2 point, line2 line)
-{
- return distance_sqr(point, line.a + line.b * param_nearest_on_line(point, line));
-}
-
-float point_line_distance_sqr(float3 point, line3 line)
-{
- return distance_sqr(point, line.a + line.b * param_nearest_on_line(point, line));
-}
-
-float point_line_distance_sqr(float4 point, line4 line)
-{
- return distance_sqr(point, line.a + line.b * param_nearest_on_line(point, line));
-}
-
-
-
-// distance between plane/hyperplane in 3D and 4D
-float point_plane_3d_distance(float3 point, plane_3d plane)
-{
- return dot(point - plane.root_point, plane.normal);
-}
-
-
-float point_hyperplane_4d_distance(float4 point, hyperplane_4d plane)
-{
- return dot(point - plane.root_point, plane.normal);
-}
-
-
-// helper functions to produce a 3D plane from three points and a 4D hyperplane from four points.
-plane_3d generate_plane_from_points(float3 point0, float3 point1, float3 point2)
-{
- plane_3d res;
- res.root_point = point0;
- res.normal = normalize(cross(point1 - point0, point2 - point0));
- return res;
-}
-
-hyperplane_4d generate_hyperplane_from_points(float4 point0, float4 point1, float4 point2, float4 point3)
-{
- hyperplane_4d res;
- res.root_point = point0;
- res.normal = normalize(gcross(point1 - point0, point2 - point0, point3 - point0));
- return res;
-}
-
-
diff --git a/3rdparty/bimg/3rdparty/astc/mathlib.h b/3rdparty/bimg/3rdparty/astc/mathlib.h
deleted file mode 100644
index eed87fc2edf..00000000000
--- a/3rdparty/bimg/3rdparty/astc/mathlib.h
+++ /dev/null
@@ -1,200 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012, 2018 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Internal math library declarations for ASTC codec.
- */
-/*----------------------------------------------------------------------------*/
-
-#ifndef MATHLIB_H_INCLUDED
-
-#define MATHLIB_H_INCLUDED
-
-#include "vectypes.h"
-
-// basic OpenCL functions
-float inversesqrt(float p);
-float acospi(float p);
-float sinpi(float p);
-float cospi(float p);
-
-float nan(int p);
-
-#if !_MSC_VER && !__clang__ && (__cplusplus < 201103L)
-float fmax(float p, float q);
-float fmin(float p, float q);
-#endif // C++11
-
-float2 fmax(float2 p, float2 q);
-
-float3 fmax(float3 p, float3 q);
-
-float4 fmax(float4 p, float4 q);
-float2 fmin(float2 p, float2 q);
-float3 fmin(float3 p, float3 q);
-float4 fmin(float4 p, float4 q);
-
-/*
- float dot( float2 p, float2 q );
- float dot( float3 p, float3 q );
- float dot( float4 p, float4 q );
-*/
-
-static inline float dot(float2 p, float2 q)
-{
- return p.x * q.x + p.y * q.y;
-}
-static inline float dot(float3 p, float3 q)
-{
- return p.x * q.x + p.y * q.y + p.z * q.z;
-}
-static inline float dot(float4 p, float4 q)
-{
- return p.x * q.x + p.y * q.y + p.z * q.z + p.w * q.w;
-}
-
-
-float3 cross(float3 p, float3 q);
-float4 cross(float4 p, float4 q);
-
-float length(float2 p);
-float length(float3 p);
-float length(float4 p);
-
-float length_sqr(float2 p);
-float length_sqr(float3 p);
-float length_sqr(float4 p);
-
-float distance(float2 p, float2 q);
-float distance(float3 p, float3 q);
-float distance(float4 p, float4 q);
-
-float distance_sqr(float2 p, float2 q);
-float distance_sqr(float3 p, float3 q);
-float distance_sqr(float4 p, float4 q);
-
-float2 normalize(float2 p);
-float3 normalize(float3 p);
-float4 normalize(float4 p);
-
-
-
-// functions other than just basic OpenCL functions
-
-float4 gcross(float4 p, float4 q, float4 r);
-
-struct mat2
-{
- float2 v[2];
-};
-struct mat3
-{
- float3 v[3];
-};
-struct mat4
-{
- float4 v[4];
-};
-
-float trace(mat2 p);
-float trace(mat3 p);
-float trace(mat4 p);
-
-float determinant(mat2 p);
-float determinant(mat3 p);
-float determinant(mat4 p);
-
-float2 characteristic_poly(mat2 p);
-float3 characteristic_poly(mat3 p);
-float4 characteristic_poly(mat4 p);
-
-float2 solve_monic(float2 p);
-float3 solve_monic(float3 p);
-float4 solve_monic(float4 p);
-
-float2 transform(mat2 p, float2 q);
-float3 transform(mat3 p, float3 q);
-float4 transform(mat4 p, float4 q);
-
-mat2 adjugate(mat2 p);
-mat3 adjugate(mat3 p);
-mat4 adjugate(mat4 p);
-
-mat2 invert(mat2 p);
-mat3 invert(mat3 p);
-mat4 invert(mat4 p);
-
-float2 eigenvalues(mat2 p);
-float3 eigenvalues(mat3 p);
-float4 eigenvalues(mat4 p);
-
-float2 eigenvector(mat2 p, float eigvl);
-float3 eigenvector(mat3 p, float eigvl);
-float4 eigenvector(mat4 p, float eigvl);
-
-mat2 operator *(mat2 a, mat2 b);
-mat3 operator *(mat3 a, mat3 b);
-mat4 operator *(mat4 a, mat4 b);
-
-
-
-// parametric line, 2D: The line is given by line = a + b*t.
-struct line2
-{
- float2 a;
- float2 b;
-};
-
-// parametric line, 3D
-struct line3
-{
- float3 a;
- float3 b;
-};
-
-struct line4
-{
- float4 a;
- float4 b;
-};
-
-// plane/hyperplane defined by a point and a normal vector
-struct plane_3d
-{
- float3 root_point;
- float3 normal; // normalized
-};
-
-struct hyperplane_4d
-{
- float4 root_point;
- float4 normal; // normalized
-};
-
-float param_nearest_on_line(float2 point, line2 line);
-float param_nearest_on_line(float3 point, line3 line);
-float param_nearest_on_line(float4 point, line4 line);
-
-float point_line_distance(float2 point, line2 line);
-float point_line_distance(float3 point, line3 line);
-float point_line_distance(float4 point, line4 line);
-
-float point_line_distance_sqr(float2 point, line2 line);
-float point_line_distance_sqr(float3 point, line3 line);
-float point_line_distance_sqr(float4 point, line4 line);
-
-float point_plane_3d_distance(float3 point, plane_3d plane);
-float point_hyperplane_4d_distance(float4 point, hyperplane_4d plane);
-
-plane_3d generate_plane_from_points(float3 point0, float3 point1, float3 point2);
-hyperplane_4d generate_hyperplane_from_points(float4 point0, float4 point1, float4 point2, float4 point3);
-
-
-#endif
diff --git a/3rdparty/bimg/3rdparty/astc/readme.txt b/3rdparty/bimg/3rdparty/astc/readme.txt
deleted file mode 100644
index 17ad54eb81c..00000000000
--- a/3rdparty/bimg/3rdparty/astc/readme.txt
+++ /dev/null
@@ -1 +0,0 @@
-Library version of astc-encoder, from https://github.com/andrewwillmott/astc-encoder.
diff --git a/3rdparty/bimg/3rdparty/astc/softfloat.h b/3rdparty/bimg/3rdparty/astc/softfloat.h
deleted file mode 100644
index 1cf9ba767fb..00000000000
--- a/3rdparty/bimg/3rdparty/astc/softfloat.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Soft IEEE-754 floating point library.
- */
-/*----------------------------------------------------------------------------*/
-
-#ifndef SOFTFLOAT_H_INCLUDED
-
-#define SOFTFLOAT_H_INCLUDED
-
-#if defined __cplusplus
-extern "C"
-{
-#endif
-
-#if defined __cplusplus && !defined(_MSC_VER)
-
- /* if compiling as C++, we need to define these macros in order to obtain all the macros in stdint.h . */
- #define __STDC_LIMIT_MACROS
- #define __STDC_CONSTANT_MACROS
- #include <stdint.h>
-
-#else
-
- typedef unsigned char uint8_t;
- typedef signed char int8_t;
- typedef unsigned short uint16_t;
- typedef signed short int16_t;
- typedef unsigned int uint32_t;
- typedef signed int int32_t;
-
-#endif
-
-
-uint32_t clz32(uint32_t p);
-
-
-/* targets that don't have UINT32_C probably don't have the rest of C99s stdint.h */
-#ifndef UINT32_C
-
- #define PASTE(a) a
- #define UINT64_C(a) PASTE(a##ULL)
- #define UINT32_C(a) PASTE(a##U)
- #define INT64_C(a) PASTE(a##LL)
- #define INT32_C(a) a
-
- #define PRIX32 "X"
- #define PRId32 "d"
- #define PRIu32 "u"
- #define PRIX64 "LX"
- #define PRId64 "Ld"
- #define PRIu64 "Lu"
-
-#endif
-
- /* sized soft-float types. These are mapped to the sized integer types of C99, instead of C's
- floating-point types; this is because the library needs to maintain exact, bit-level control on all
- operations on these data types. */
- typedef uint16_t sf16;
- typedef uint32_t sf32;
-
- /* the five rounding modes that IEEE-754r defines */
- typedef enum
- {
- SF_UP = 0, /* round towards positive infinity */
- SF_DOWN = 1, /* round towards negative infinity */
- SF_TOZERO = 2, /* round towards zero */
- SF_NEARESTEVEN = 3, /* round toward nearest value; if mid-between, round to even value */
- SF_NEARESTAWAY = 4 /* round toward nearest value; if mid-between, round away from zero */
- } roundmode;
-
- /* narrowing float->float conversions */
- sf16 sf32_to_sf16(sf32, roundmode);
-
- /* widening float->float conversions */
- sf32 sf16_to_sf32(sf16);
-
- sf16 float_to_sf16(float, roundmode);
- float sf16_to_float(sf16);
-
-
-#if defined __cplusplus
-}
-#endif
-
-#endif
diff --git a/3rdparty/bimg/3rdparty/astc/vectypes.h b/3rdparty/bimg/3rdparty/astc/vectypes.h
deleted file mode 100644
index 30e9b15dc55..00000000000
--- a/3rdparty/bimg/3rdparty/astc/vectypes.h
+++ /dev/null
@@ -1,16209 +0,0 @@
-/*----------------------------------------------------------------------------*/
-/**
- * This confidential and proprietary software may be used only as
- * authorised by a licensing agreement from ARM Limited
- * (C) COPYRIGHT 2011-2012 ARM Limited
- * ALL RIGHTS RESERVED
- *
- * The entire notice above must be reproduced on all authorised
- * copies and copies may only be made to the extent permitted
- * by a licensing agreement from ARM Limited.
- *
- * @brief Template library for fixed-size vectors.
- */
-/*----------------------------------------------------------------------------*/
-
-#include <string.h>
-#include <stdint.h>
-
-typedef uint32_t uint;
-typedef uint16_t ushort;
-typedef uint64_t ulong;
-typedef uint8_t uchar;
-typedef int8_t schar;
-
-template < typename vtype > class vtype2;
-
-template < typename vtype > class vtype3;
-
-template < typename vtype > class vtype4;
-
-template < typename vtype > struct vtype2_xx_ref
-{
- vtype2 < vtype > *v;
- vtype2_xx_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_xy_ref
-{
- vtype2 < vtype > *v;
- vtype2_xy_ref(vtype2 < vtype > *p):v(p)
- {
- };
- inline vtype2_xy_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype2_yx_ref
-{
- vtype2 < vtype > *v;
- vtype2_yx_ref(vtype2 < vtype > *p):v(p)
- {
- };
- inline vtype2_yx_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype2_yy_ref
-{
- vtype2 < vtype > *v;
- vtype2_yy_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xx_ref
-{
- vtype3 < vtype > *v;
- vtype3_xx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xy_ref
-{
- vtype3 < vtype > *v;
- vtype3_xy_ref(vtype3 < vtype > *p):v(p)
- {
- };
- inline vtype3_xy_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype3_xz_ref
-{
- vtype3 < vtype > *v;
- vtype3_xz_ref(vtype3 < vtype > *p):v(p)
- {
- };
- inline vtype3_xz_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype3_yx_ref
-{
- vtype3 < vtype > *v;
- vtype3_yx_ref(vtype3 < vtype > *p):v(p)
- {
- };
- inline vtype3_yx_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype3_yy_ref
-{
- vtype3 < vtype > *v;
- vtype3_yy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yz_ref
-{
- vtype3 < vtype > *v;
- vtype3_yz_ref(vtype3 < vtype > *p):v(p)
- {
- };
- inline vtype3_yz_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype3_zx_ref
-{
- vtype3 < vtype > *v;
- vtype3_zx_ref(vtype3 < vtype > *p):v(p)
- {
- };
- inline vtype3_zx_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype3_zy_ref
-{
- vtype3 < vtype > *v;
- vtype3_zy_ref(vtype3 < vtype > *p):v(p)
- {
- };
- inline vtype3_zy_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype3_zz_ref
-{
- vtype3 < vtype > *v;
- vtype3_zz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xy_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype4_xz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xz_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype4_xw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xw_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype4_yx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_yx_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype4_yy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_yz_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype4_yw_ref
-{
- vtype4 < vtype > *v;
- vtype4_yw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_yw_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype4_zx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zx_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype4_zy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zy_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype4_zz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zw_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype4_wx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wx_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype4_wy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wy_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype4_wz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wz_ref & operator=(const vtype2 < vtype > &);
-};
-template < typename vtype > struct vtype4_ww_ref
-{
- vtype4 < vtype > *v;
- vtype4_ww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_xxx_ref
-{
- vtype2 < vtype > *v;
- vtype2_xxx_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_xxy_ref
-{
- vtype2 < vtype > *v;
- vtype2_xxy_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_xyx_ref
-{
- vtype2 < vtype > *v;
- vtype2_xyx_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_xyy_ref
-{
- vtype2 < vtype > *v;
- vtype2_xyy_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_yxx_ref
-{
- vtype2 < vtype > *v;
- vtype2_yxx_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_yxy_ref
-{
- vtype2 < vtype > *v;
- vtype2_yxy_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_yyx_ref
-{
- vtype2 < vtype > *v;
- vtype2_yyx_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_yyy_ref
-{
- vtype2 < vtype > *v;
- vtype2_yyy_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xxx_ref
-{
- vtype3 < vtype > *v;
- vtype3_xxx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xxy_ref
-{
- vtype3 < vtype > *v;
- vtype3_xxy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xxz_ref
-{
- vtype3 < vtype > *v;
- vtype3_xxz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xyx_ref
-{
- vtype3 < vtype > *v;
- vtype3_xyx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xyy_ref
-{
- vtype3 < vtype > *v;
- vtype3_xyy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xyz_ref
-{
- vtype3 < vtype > *v;
- vtype3_xyz_ref(vtype3 < vtype > *p):v(p)
- {
- };
- inline vtype3_xyz_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype3_xzx_ref
-{
- vtype3 < vtype > *v;
- vtype3_xzx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xzy_ref
-{
- vtype3 < vtype > *v;
- vtype3_xzy_ref(vtype3 < vtype > *p):v(p)
- {
- };
- inline vtype3_xzy_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype3_xzz_ref
-{
- vtype3 < vtype > *v;
- vtype3_xzz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yxx_ref
-{
- vtype3 < vtype > *v;
- vtype3_yxx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yxy_ref
-{
- vtype3 < vtype > *v;
- vtype3_yxy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yxz_ref
-{
- vtype3 < vtype > *v;
- vtype3_yxz_ref(vtype3 < vtype > *p):v(p)
- {
- };
- inline vtype3_yxz_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype3_yyx_ref
-{
- vtype3 < vtype > *v;
- vtype3_yyx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yyy_ref
-{
- vtype3 < vtype > *v;
- vtype3_yyy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yyz_ref
-{
- vtype3 < vtype > *v;
- vtype3_yyz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yzx_ref
-{
- vtype3 < vtype > *v;
- vtype3_yzx_ref(vtype3 < vtype > *p):v(p)
- {
- };
- inline vtype3_yzx_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype3_yzy_ref
-{
- vtype3 < vtype > *v;
- vtype3_yzy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yzz_ref
-{
- vtype3 < vtype > *v;
- vtype3_yzz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zxx_ref
-{
- vtype3 < vtype > *v;
- vtype3_zxx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zxy_ref
-{
- vtype3 < vtype > *v;
- vtype3_zxy_ref(vtype3 < vtype > *p):v(p)
- {
- };
- inline vtype3_zxy_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype3_zxz_ref
-{
- vtype3 < vtype > *v;
- vtype3_zxz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zyx_ref
-{
- vtype3 < vtype > *v;
- vtype3_zyx_ref(vtype3 < vtype > *p):v(p)
- {
- };
- inline vtype3_zyx_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype3_zyy_ref
-{
- vtype3 < vtype > *v;
- vtype3_zyy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zyz_ref
-{
- vtype3 < vtype > *v;
- vtype3_zyz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zzx_ref
-{
- vtype3 < vtype > *v;
- vtype3_zzx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zzy_ref
-{
- vtype3 < vtype > *v;
- vtype3_zzy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zzz_ref
-{
- vtype3 < vtype > *v;
- vtype3_zzz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xyz_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_xyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xyw_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_xzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xzy_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_xzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xzw_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_xwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xwy_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_xwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xwz_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_xww_ref
-{
- vtype4 < vtype > *v;
- vtype4_xww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_yxz_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_yxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_yxw_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_yyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_yzx_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_yzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_yzw_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_ywx_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_ywx_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_ywy_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywz_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_ywz_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_yww_ref
-{
- vtype4 < vtype > *v;
- vtype4_yww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zxy_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_zxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zxw_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_zyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zyx_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_zyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zyw_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_zzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zwx_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_zwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zwy_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_zwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zww_ref
-{
- vtype4 < vtype > *v;
- vtype4_zww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wxy_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_wxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wxz_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_wxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wyx_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_wyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wyz_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_wyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wzx_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_wzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wzy_ref & operator=(const vtype3 < vtype > &);
-};
-template < typename vtype > struct vtype4_wzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_www_ref
-{
- vtype4 < vtype > *v;
- vtype4_www_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_xxxx_ref
-{
- vtype2 < vtype > *v;
- vtype2_xxxx_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_xxxy_ref
-{
- vtype2 < vtype > *v;
- vtype2_xxxy_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_xxyx_ref
-{
- vtype2 < vtype > *v;
- vtype2_xxyx_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_xxyy_ref
-{
- vtype2 < vtype > *v;
- vtype2_xxyy_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_xyxx_ref
-{
- vtype2 < vtype > *v;
- vtype2_xyxx_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_xyxy_ref
-{
- vtype2 < vtype > *v;
- vtype2_xyxy_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_xyyx_ref
-{
- vtype2 < vtype > *v;
- vtype2_xyyx_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_xyyy_ref
-{
- vtype2 < vtype > *v;
- vtype2_xyyy_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_yxxx_ref
-{
- vtype2 < vtype > *v;
- vtype2_yxxx_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_yxxy_ref
-{
- vtype2 < vtype > *v;
- vtype2_yxxy_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_yxyx_ref
-{
- vtype2 < vtype > *v;
- vtype2_yxyx_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_yxyy_ref
-{
- vtype2 < vtype > *v;
- vtype2_yxyy_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_yyxx_ref
-{
- vtype2 < vtype > *v;
- vtype2_yyxx_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_yyxy_ref
-{
- vtype2 < vtype > *v;
- vtype2_yyxy_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_yyyx_ref
-{
- vtype2 < vtype > *v;
- vtype2_yyyx_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype2_yyyy_ref
-{
- vtype2 < vtype > *v;
- vtype2_yyyy_ref(vtype2 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xxxx_ref
-{
- vtype3 < vtype > *v;
- vtype3_xxxx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xxxy_ref
-{
- vtype3 < vtype > *v;
- vtype3_xxxy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xxxz_ref
-{
- vtype3 < vtype > *v;
- vtype3_xxxz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xxyx_ref
-{
- vtype3 < vtype > *v;
- vtype3_xxyx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xxyy_ref
-{
- vtype3 < vtype > *v;
- vtype3_xxyy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xxyz_ref
-{
- vtype3 < vtype > *v;
- vtype3_xxyz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xxzx_ref
-{
- vtype3 < vtype > *v;
- vtype3_xxzx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xxzy_ref
-{
- vtype3 < vtype > *v;
- vtype3_xxzy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xxzz_ref
-{
- vtype3 < vtype > *v;
- vtype3_xxzz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xyxx_ref
-{
- vtype3 < vtype > *v;
- vtype3_xyxx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xyxy_ref
-{
- vtype3 < vtype > *v;
- vtype3_xyxy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xyxz_ref
-{
- vtype3 < vtype > *v;
- vtype3_xyxz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xyyx_ref
-{
- vtype3 < vtype > *v;
- vtype3_xyyx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xyyy_ref
-{
- vtype3 < vtype > *v;
- vtype3_xyyy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xyyz_ref
-{
- vtype3 < vtype > *v;
- vtype3_xyyz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xyzx_ref
-{
- vtype3 < vtype > *v;
- vtype3_xyzx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xyzy_ref
-{
- vtype3 < vtype > *v;
- vtype3_xyzy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xyzz_ref
-{
- vtype3 < vtype > *v;
- vtype3_xyzz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xzxx_ref
-{
- vtype3 < vtype > *v;
- vtype3_xzxx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xzxy_ref
-{
- vtype3 < vtype > *v;
- vtype3_xzxy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xzxz_ref
-{
- vtype3 < vtype > *v;
- vtype3_xzxz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xzyx_ref
-{
- vtype3 < vtype > *v;
- vtype3_xzyx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xzyy_ref
-{
- vtype3 < vtype > *v;
- vtype3_xzyy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xzyz_ref
-{
- vtype3 < vtype > *v;
- vtype3_xzyz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xzzx_ref
-{
- vtype3 < vtype > *v;
- vtype3_xzzx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xzzy_ref
-{
- vtype3 < vtype > *v;
- vtype3_xzzy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_xzzz_ref
-{
- vtype3 < vtype > *v;
- vtype3_xzzz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yxxx_ref
-{
- vtype3 < vtype > *v;
- vtype3_yxxx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yxxy_ref
-{
- vtype3 < vtype > *v;
- vtype3_yxxy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yxxz_ref
-{
- vtype3 < vtype > *v;
- vtype3_yxxz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yxyx_ref
-{
- vtype3 < vtype > *v;
- vtype3_yxyx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yxyy_ref
-{
- vtype3 < vtype > *v;
- vtype3_yxyy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yxyz_ref
-{
- vtype3 < vtype > *v;
- vtype3_yxyz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yxzx_ref
-{
- vtype3 < vtype > *v;
- vtype3_yxzx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yxzy_ref
-{
- vtype3 < vtype > *v;
- vtype3_yxzy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yxzz_ref
-{
- vtype3 < vtype > *v;
- vtype3_yxzz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yyxx_ref
-{
- vtype3 < vtype > *v;
- vtype3_yyxx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yyxy_ref
-{
- vtype3 < vtype > *v;
- vtype3_yyxy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yyxz_ref
-{
- vtype3 < vtype > *v;
- vtype3_yyxz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yyyx_ref
-{
- vtype3 < vtype > *v;
- vtype3_yyyx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yyyy_ref
-{
- vtype3 < vtype > *v;
- vtype3_yyyy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yyyz_ref
-{
- vtype3 < vtype > *v;
- vtype3_yyyz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yyzx_ref
-{
- vtype3 < vtype > *v;
- vtype3_yyzx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yyzy_ref
-{
- vtype3 < vtype > *v;
- vtype3_yyzy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yyzz_ref
-{
- vtype3 < vtype > *v;
- vtype3_yyzz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yzxx_ref
-{
- vtype3 < vtype > *v;
- vtype3_yzxx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yzxy_ref
-{
- vtype3 < vtype > *v;
- vtype3_yzxy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yzxz_ref
-{
- vtype3 < vtype > *v;
- vtype3_yzxz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yzyx_ref
-{
- vtype3 < vtype > *v;
- vtype3_yzyx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yzyy_ref
-{
- vtype3 < vtype > *v;
- vtype3_yzyy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yzyz_ref
-{
- vtype3 < vtype > *v;
- vtype3_yzyz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yzzx_ref
-{
- vtype3 < vtype > *v;
- vtype3_yzzx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yzzy_ref
-{
- vtype3 < vtype > *v;
- vtype3_yzzy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_yzzz_ref
-{
- vtype3 < vtype > *v;
- vtype3_yzzz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zxxx_ref
-{
- vtype3 < vtype > *v;
- vtype3_zxxx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zxxy_ref
-{
- vtype3 < vtype > *v;
- vtype3_zxxy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zxxz_ref
-{
- vtype3 < vtype > *v;
- vtype3_zxxz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zxyx_ref
-{
- vtype3 < vtype > *v;
- vtype3_zxyx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zxyy_ref
-{
- vtype3 < vtype > *v;
- vtype3_zxyy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zxyz_ref
-{
- vtype3 < vtype > *v;
- vtype3_zxyz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zxzx_ref
-{
- vtype3 < vtype > *v;
- vtype3_zxzx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zxzy_ref
-{
- vtype3 < vtype > *v;
- vtype3_zxzy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zxzz_ref
-{
- vtype3 < vtype > *v;
- vtype3_zxzz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zyxx_ref
-{
- vtype3 < vtype > *v;
- vtype3_zyxx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zyxy_ref
-{
- vtype3 < vtype > *v;
- vtype3_zyxy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zyxz_ref
-{
- vtype3 < vtype > *v;
- vtype3_zyxz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zyyx_ref
-{
- vtype3 < vtype > *v;
- vtype3_zyyx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zyyy_ref
-{
- vtype3 < vtype > *v;
- vtype3_zyyy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zyyz_ref
-{
- vtype3 < vtype > *v;
- vtype3_zyyz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zyzx_ref
-{
- vtype3 < vtype > *v;
- vtype3_zyzx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zyzy_ref
-{
- vtype3 < vtype > *v;
- vtype3_zyzy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zyzz_ref
-{
- vtype3 < vtype > *v;
- vtype3_zyzz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zzxx_ref
-{
- vtype3 < vtype > *v;
- vtype3_zzxx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zzxy_ref
-{
- vtype3 < vtype > *v;
- vtype3_zzxy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zzxz_ref
-{
- vtype3 < vtype > *v;
- vtype3_zzxz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zzyx_ref
-{
- vtype3 < vtype > *v;
- vtype3_zzyx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zzyy_ref
-{
- vtype3 < vtype > *v;
- vtype3_zzyy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zzyz_ref
-{
- vtype3 < vtype > *v;
- vtype3_zzyz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zzzx_ref
-{
- vtype3 < vtype > *v;
- vtype3_zzzx_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zzzy_ref
-{
- vtype3 < vtype > *v;
- vtype3_zzzy_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype3_zzzz_ref
-{
- vtype3 < vtype > *v;
- vtype3_zzzz_ref(vtype3 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xxww_ref
-{
- vtype4 < vtype > *v;
- vtype4_xxww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xyzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xyzw_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_xywx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xywx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xywy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xywy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xywz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xywz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xywz_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_xyww_ref
-{
- vtype4 < vtype > *v;
- vtype4_xyww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xzyw_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_xzzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xzwy_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_xzwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xzww_ref
-{
- vtype4 < vtype > *v;
- vtype4_xzww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xwyz_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_xwyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_xwzy_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_xwzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_xwww_ref
-{
- vtype4 < vtype > *v;
- vtype4_xwww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_yxzw_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_yxwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yxwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_yxwz_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_yxww_ref
-{
- vtype4 < vtype > *v;
- vtype4_yxww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yywx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yywx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yywy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yywy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yywz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yywz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yyww_ref
-{
- vtype4 < vtype > *v;
- vtype4_yyww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_yzxw_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_yzyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_yzwx_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_yzwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_yzww_ref
-{
- vtype4 < vtype > *v;
- vtype4_yzww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_ywxz_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_ywxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_ywzx_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_ywzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_ywww_ref
-{
- vtype4 < vtype > *v;
- vtype4_ywww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zxyw_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_zxzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zxwy_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_zxwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zxww_ref
-{
- vtype4 < vtype > *v;
- vtype4_zxww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zyxw_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_zyyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zywx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zywx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zywx_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_zywy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zywy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zywz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zywz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zyww_ref
-{
- vtype4 < vtype > *v;
- vtype4_zyww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zzww_ref
-{
- vtype4 < vtype > *v;
- vtype4_zzww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zwxy_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_zwxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_zwyx_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_zwyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_zwww_ref
-{
- vtype4 < vtype > *v;
- vtype4_zwww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wxyz_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_wxyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wxzy_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_wxzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wxww_ref
-{
- vtype4 < vtype > *v;
- vtype4_wxww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wyxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wyxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wyxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wyxz_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_wyxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wyyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wyyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wyyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wyyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wyzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wyzx_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_wyzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wyzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wyzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wywx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wywx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wywy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wywy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wywz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wywz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wyww_ref
-{
- vtype4 < vtype > *v;
- vtype4_wyww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wzxy_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_wzxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
- inline vtype4_wzyx_ref & operator=(const vtype4 < vtype > &);
-};
-template < typename vtype > struct vtype4_wzyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wzww_ref
-{
- vtype4 < vtype > *v;
- vtype4_wzww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwxx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwxx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwxy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwxy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwxz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwxz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwxw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwxw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwyx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwyx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwyy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwyy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwyz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwyz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwyw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwyw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwzx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwzx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwzy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwzy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwzz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwzz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwzw_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwzw_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwwx_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwwx_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwwy_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwwy_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwwz_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwwz_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-template < typename vtype > struct vtype4_wwww_ref
-{
- vtype4 < vtype > *v;
- vtype4_wwww_ref(vtype4 < vtype > *p):v(p)
- {
- };
-};
-
-template < typename vtype > class vtype2
-{
- public:
- vtype x, y;
- vtype2()
- {
- };
- vtype2(vtype p, vtype q):x(p), y(q)
- {
- };
- vtype2(const vtype2 & p):x(p.x), y(p.y)
- {
- };
- inline vtype2(const vtype2_xx_ref < vtype > &v);
- inline vtype2(const vtype2_xy_ref < vtype > &v);
- inline vtype2(const vtype2_yx_ref < vtype > &v);
- inline vtype2(const vtype2_yy_ref < vtype > &v);
- inline vtype2(const vtype3_xx_ref < vtype > &v);
- inline vtype2(const vtype3_xy_ref < vtype > &v);
- inline vtype2(const vtype3_xz_ref < vtype > &v);
- inline vtype2(const vtype3_yx_ref < vtype > &v);
- inline vtype2(const vtype3_yy_ref < vtype > &v);
- inline vtype2(const vtype3_yz_ref < vtype > &v);
- inline vtype2(const vtype3_zx_ref < vtype > &v);
- inline vtype2(const vtype3_zy_ref < vtype > &v);
- inline vtype2(const vtype3_zz_ref < vtype > &v);
- inline vtype2(const vtype4_xx_ref < vtype > &v);
- inline vtype2(const vtype4_xy_ref < vtype > &v);
- inline vtype2(const vtype4_xz_ref < vtype > &v);
- inline vtype2(const vtype4_xw_ref < vtype > &v);
- inline vtype2(const vtype4_yx_ref < vtype > &v);
- inline vtype2(const vtype4_yy_ref < vtype > &v);
- inline vtype2(const vtype4_yz_ref < vtype > &v);
- inline vtype2(const vtype4_yw_ref < vtype > &v);
- inline vtype2(const vtype4_zx_ref < vtype > &v);
- inline vtype2(const vtype4_zy_ref < vtype > &v);
- inline vtype2(const vtype4_zz_ref < vtype > &v);
- inline vtype2(const vtype4_zw_ref < vtype > &v);
- inline vtype2(const vtype4_wx_ref < vtype > &v);
- inline vtype2(const vtype4_wy_ref < vtype > &v);
- inline vtype2(const vtype4_wz_ref < vtype > &v);
- inline vtype2(const vtype4_ww_ref < vtype > &v);
- vtype2_xx_ref < vtype > xx()
- {
- return vtype2_xx_ref < vtype > (this);
- }
- vtype2_xy_ref < vtype > xy()
- {
- return vtype2_xy_ref < vtype > (this);
- }
- vtype2_yx_ref < vtype > yx()
- {
- return vtype2_yx_ref < vtype > (this);
- }
- vtype2_yy_ref < vtype > yy()
- {
- return vtype2_yy_ref < vtype > (this);
- }
- vtype2_xxx_ref < vtype > xxx()
- {
- return vtype2_xxx_ref < vtype > (this);
- }
- vtype2_xxy_ref < vtype > xxy()
- {
- return vtype2_xxy_ref < vtype > (this);
- }
- vtype2_xyx_ref < vtype > xyx()
- {
- return vtype2_xyx_ref < vtype > (this);
- }
- vtype2_xyy_ref < vtype > xyy()
- {
- return vtype2_xyy_ref < vtype > (this);
- }
- vtype2_yxx_ref < vtype > yxx()
- {
- return vtype2_yxx_ref < vtype > (this);
- }
- vtype2_yxy_ref < vtype > yxy()
- {
- return vtype2_yxy_ref < vtype > (this);
- }
- vtype2_yyx_ref < vtype > yyx()
- {
- return vtype2_yyx_ref < vtype > (this);
- }
- vtype2_yyy_ref < vtype > yyy()
- {
- return vtype2_yyy_ref < vtype > (this);
- }
- vtype2_xxxx_ref < vtype > xxxx()
- {
- return vtype2_xxxx_ref < vtype > (this);
- }
- vtype2_xxxy_ref < vtype > xxxy()
- {
- return vtype2_xxxy_ref < vtype > (this);
- }
- vtype2_xxyx_ref < vtype > xxyx()
- {
- return vtype2_xxyx_ref < vtype > (this);
- }
- vtype2_xxyy_ref < vtype > xxyy()
- {
- return vtype2_xxyy_ref < vtype > (this);
- }
- vtype2_xyxx_ref < vtype > xyxx()
- {
- return vtype2_xyxx_ref < vtype > (this);
- }
- vtype2_xyxy_ref < vtype > xyxy()
- {
- return vtype2_xyxy_ref < vtype > (this);
- }
- vtype2_xyyx_ref < vtype > xyyx()
- {
- return vtype2_xyyx_ref < vtype > (this);
- }
- vtype2_xyyy_ref < vtype > xyyy()
- {
- return vtype2_xyyy_ref < vtype > (this);
- }
- vtype2_yxxx_ref < vtype > yxxx()
- {
- return vtype2_yxxx_ref < vtype > (this);
- }
- vtype2_yxxy_ref < vtype > yxxy()
- {
- return vtype2_yxxy_ref < vtype > (this);
- }
- vtype2_yxyx_ref < vtype > yxyx()
- {
- return vtype2_yxyx_ref < vtype > (this);
- }
- vtype2_yxyy_ref < vtype > yxyy()
- {
- return vtype2_yxyy_ref < vtype > (this);
- }
- vtype2_yyxx_ref < vtype > yyxx()
- {
- return vtype2_yyxx_ref < vtype > (this);
- }
- vtype2_yyxy_ref < vtype > yyxy()
- {
- return vtype2_yyxy_ref < vtype > (this);
- }
- vtype2_yyyx_ref < vtype > yyyx()
- {
- return vtype2_yyyx_ref < vtype > (this);
- }
- vtype2_yyyy_ref < vtype > yyyy()
- {
- return vtype2_yyyy_ref < vtype > (this);
- }
-};
-
-template < typename vtype > class vtype3
-{
- public:
- vtype x, y, z;
- vtype3()
- {
- };
- vtype3(vtype p, vtype q, vtype r):x(p), y(q), z(r)
- {
- };
- vtype3(const vtype3 & p):x(p.x), y(p.y), z(p.z)
- {
- };
- vtype3(vtype p, const vtype2 < vtype > &q):x(p), y(q.x), z(q.y)
- {
- };
- vtype3(const vtype2 < vtype > &p, vtype q):x(p.x), y(p.y), z(q)
- {
- };
- inline vtype3(const vtype2_xxx_ref < vtype > &v);
- inline vtype3(const vtype2_xxy_ref < vtype > &v);
- inline vtype3(const vtype2_xyx_ref < vtype > &v);
- inline vtype3(const vtype2_xyy_ref < vtype > &v);
- inline vtype3(const vtype2_yxx_ref < vtype > &v);
- inline vtype3(const vtype2_yxy_ref < vtype > &v);
- inline vtype3(const vtype2_yyx_ref < vtype > &v);
- inline vtype3(const vtype2_yyy_ref < vtype > &v);
- inline vtype3(const vtype3_xxx_ref < vtype > &v);
- inline vtype3(const vtype3_xxy_ref < vtype > &v);
- inline vtype3(const vtype3_xxz_ref < vtype > &v);
- inline vtype3(const vtype3_xyx_ref < vtype > &v);
- inline vtype3(const vtype3_xyy_ref < vtype > &v);
- inline vtype3(const vtype3_xyz_ref < vtype > &v);
- inline vtype3(const vtype3_xzx_ref < vtype > &v);
- inline vtype3(const vtype3_xzy_ref < vtype > &v);
- inline vtype3(const vtype3_xzz_ref < vtype > &v);
- inline vtype3(const vtype3_yxx_ref < vtype > &v);
- inline vtype3(const vtype3_yxy_ref < vtype > &v);
- inline vtype3(const vtype3_yxz_ref < vtype > &v);
- inline vtype3(const vtype3_yyx_ref < vtype > &v);
- inline vtype3(const vtype3_yyy_ref < vtype > &v);
- inline vtype3(const vtype3_yyz_ref < vtype > &v);
- inline vtype3(const vtype3_yzx_ref < vtype > &v);
- inline vtype3(const vtype3_yzy_ref < vtype > &v);
- inline vtype3(const vtype3_yzz_ref < vtype > &v);
- inline vtype3(const vtype3_zxx_ref < vtype > &v);
- inline vtype3(const vtype3_zxy_ref < vtype > &v);
- inline vtype3(const vtype3_zxz_ref < vtype > &v);
- inline vtype3(const vtype3_zyx_ref < vtype > &v);
- inline vtype3(const vtype3_zyy_ref < vtype > &v);
- inline vtype3(const vtype3_zyz_ref < vtype > &v);
- inline vtype3(const vtype3_zzx_ref < vtype > &v);
- inline vtype3(const vtype3_zzy_ref < vtype > &v);
- inline vtype3(const vtype3_zzz_ref < vtype > &v);
- inline vtype3(const vtype4_xxx_ref < vtype > &v);
- inline vtype3(const vtype4_xxy_ref < vtype > &v);
- inline vtype3(const vtype4_xxz_ref < vtype > &v);
- inline vtype3(const vtype4_xxw_ref < vtype > &v);
- inline vtype3(const vtype4_xyx_ref < vtype > &v);
- inline vtype3(const vtype4_xyy_ref < vtype > &v);
- inline vtype3(const vtype4_xyz_ref < vtype > &v);
- inline vtype3(const vtype4_xyw_ref < vtype > &v);
- inline vtype3(const vtype4_xzx_ref < vtype > &v);
- inline vtype3(const vtype4_xzy_ref < vtype > &v);
- inline vtype3(const vtype4_xzz_ref < vtype > &v);
- inline vtype3(const vtype4_xzw_ref < vtype > &v);
- inline vtype3(const vtype4_xwx_ref < vtype > &v);
- inline vtype3(const vtype4_xwy_ref < vtype > &v);
- inline vtype3(const vtype4_xwz_ref < vtype > &v);
- inline vtype3(const vtype4_xww_ref < vtype > &v);
- inline vtype3(const vtype4_yxx_ref < vtype > &v);
- inline vtype3(const vtype4_yxy_ref < vtype > &v);
- inline vtype3(const vtype4_yxz_ref < vtype > &v);
- inline vtype3(const vtype4_yxw_ref < vtype > &v);
- inline vtype3(const vtype4_yyx_ref < vtype > &v);
- inline vtype3(const vtype4_yyy_ref < vtype > &v);
- inline vtype3(const vtype4_yyz_ref < vtype > &v);
- inline vtype3(const vtype4_yyw_ref < vtype > &v);
- inline vtype3(const vtype4_yzx_ref < vtype > &v);
- inline vtype3(const vtype4_yzy_ref < vtype > &v);
- inline vtype3(const vtype4_yzz_ref < vtype > &v);
- inline vtype3(const vtype4_yzw_ref < vtype > &v);
- inline vtype3(const vtype4_ywx_ref < vtype > &v);
- inline vtype3(const vtype4_ywy_ref < vtype > &v);
- inline vtype3(const vtype4_ywz_ref < vtype > &v);
- inline vtype3(const vtype4_yww_ref < vtype > &v);
- inline vtype3(const vtype4_zxx_ref < vtype > &v);
- inline vtype3(const vtype4_zxy_ref < vtype > &v);
- inline vtype3(const vtype4_zxz_ref < vtype > &v);
- inline vtype3(const vtype4_zxw_ref < vtype > &v);
- inline vtype3(const vtype4_zyx_ref < vtype > &v);
- inline vtype3(const vtype4_zyy_ref < vtype > &v);
- inline vtype3(const vtype4_zyz_ref < vtype > &v);
- inline vtype3(const vtype4_zyw_ref < vtype > &v);
- inline vtype3(const vtype4_zzx_ref < vtype > &v);
- inline vtype3(const vtype4_zzy_ref < vtype > &v);
- inline vtype3(const vtype4_zzz_ref < vtype > &v);
- inline vtype3(const vtype4_zzw_ref < vtype > &v);
- inline vtype3(const vtype4_zwx_ref < vtype > &v);
- inline vtype3(const vtype4_zwy_ref < vtype > &v);
- inline vtype3(const vtype4_zwz_ref < vtype > &v);
- inline vtype3(const vtype4_zww_ref < vtype > &v);
- inline vtype3(const vtype4_wxx_ref < vtype > &v);
- inline vtype3(const vtype4_wxy_ref < vtype > &v);
- inline vtype3(const vtype4_wxz_ref < vtype > &v);
- inline vtype3(const vtype4_wxw_ref < vtype > &v);
- inline vtype3(const vtype4_wyx_ref < vtype > &v);
- inline vtype3(const vtype4_wyy_ref < vtype > &v);
- inline vtype3(const vtype4_wyz_ref < vtype > &v);
- inline vtype3(const vtype4_wyw_ref < vtype > &v);
- inline vtype3(const vtype4_wzx_ref < vtype > &v);
- inline vtype3(const vtype4_wzy_ref < vtype > &v);
- inline vtype3(const vtype4_wzz_ref < vtype > &v);
- inline vtype3(const vtype4_wzw_ref < vtype > &v);
- inline vtype3(const vtype4_wwx_ref < vtype > &v);
- inline vtype3(const vtype4_wwy_ref < vtype > &v);
- inline vtype3(const vtype4_wwz_ref < vtype > &v);
- inline vtype3(const vtype4_www_ref < vtype > &v);
- vtype3_xx_ref < vtype > xx()
- {
- return vtype3_xx_ref < vtype > (this);
- }
- vtype3_xy_ref < vtype > xy()
- {
- return vtype3_xy_ref < vtype > (this);
- }
- vtype3_xz_ref < vtype > xz()
- {
- return vtype3_xz_ref < vtype > (this);
- }
- vtype3_yx_ref < vtype > yx()
- {
- return vtype3_yx_ref < vtype > (this);
- }
- vtype3_yy_ref < vtype > yy()
- {
- return vtype3_yy_ref < vtype > (this);
- }
- vtype3_yz_ref < vtype > yz()
- {
- return vtype3_yz_ref < vtype > (this);
- }
- vtype3_zx_ref < vtype > zx()
- {
- return vtype3_zx_ref < vtype > (this);
- }
- vtype3_zy_ref < vtype > zy()
- {
- return vtype3_zy_ref < vtype > (this);
- }
- vtype3_zz_ref < vtype > zz()
- {
- return vtype3_zz_ref < vtype > (this);
- }
- vtype3_xxx_ref < vtype > xxx()
- {
- return vtype3_xxx_ref < vtype > (this);
- }
- vtype3_xxy_ref < vtype > xxy()
- {
- return vtype3_xxy_ref < vtype > (this);
- }
- vtype3_xxz_ref < vtype > xxz()
- {
- return vtype3_xxz_ref < vtype > (this);
- }
- vtype3_xyx_ref < vtype > xyx()
- {
- return vtype3_xyx_ref < vtype > (this);
- }
- vtype3_xyy_ref < vtype > xyy()
- {
- return vtype3_xyy_ref < vtype > (this);
- }
- vtype3_xyz_ref < vtype > xyz()
- {
- return vtype3_xyz_ref < vtype > (this);
- }
- vtype3_xzx_ref < vtype > xzx()
- {
- return vtype3_xzx_ref < vtype > (this);
- }
- vtype3_xzy_ref < vtype > xzy()
- {
- return vtype3_xzy_ref < vtype > (this);
- }
- vtype3_xzz_ref < vtype > xzz()
- {
- return vtype3_xzz_ref < vtype > (this);
- }
- vtype3_yxx_ref < vtype > yxx()
- {
- return vtype3_yxx_ref < vtype > (this);
- }
- vtype3_yxy_ref < vtype > yxy()
- {
- return vtype3_yxy_ref < vtype > (this);
- }
- vtype3_yxz_ref < vtype > yxz()
- {
- return vtype3_yxz_ref < vtype > (this);
- }
- vtype3_yyx_ref < vtype > yyx()
- {
- return vtype3_yyx_ref < vtype > (this);
- }
- vtype3_yyy_ref < vtype > yyy()
- {
- return vtype3_yyy_ref < vtype > (this);
- }
- vtype3_yyz_ref < vtype > yyz()
- {
- return vtype3_yyz_ref < vtype > (this);
- }
- vtype3_yzx_ref < vtype > yzx()
- {
- return vtype3_yzx_ref < vtype > (this);
- }
- vtype3_yzy_ref < vtype > yzy()
- {
- return vtype3_yzy_ref < vtype > (this);
- }
- vtype3_yzz_ref < vtype > yzz()
- {
- return vtype3_yzz_ref < vtype > (this);
- }
- vtype3_zxx_ref < vtype > zxx()
- {
- return vtype3_zxx_ref < vtype > (this);
- }
- vtype3_zxy_ref < vtype > zxy()
- {
- return vtype3_zxy_ref < vtype > (this);
- }
- vtype3_zxz_ref < vtype > zxz()
- {
- return vtype3_zxz_ref < vtype > (this);
- }
- vtype3_zyx_ref < vtype > zyx()
- {
- return vtype3_zyx_ref < vtype > (this);
- }
- vtype3_zyy_ref < vtype > zyy()
- {
- return vtype3_zyy_ref < vtype > (this);
- }
- vtype3_zyz_ref < vtype > zyz()
- {
- return vtype3_zyz_ref < vtype > (this);
- }
- vtype3_zzx_ref < vtype > zzx()
- {
- return vtype3_zzx_ref < vtype > (this);
- }
- vtype3_zzy_ref < vtype > zzy()
- {
- return vtype3_zzy_ref < vtype > (this);
- }
- vtype3_zzz_ref < vtype > zzz()
- {
- return vtype3_zzz_ref < vtype > (this);
- }
- vtype3_xxxx_ref < vtype > xxxx()
- {
- return vtype3_xxxx_ref < vtype > (this);
- }
- vtype3_xxxy_ref < vtype > xxxy()
- {
- return vtype3_xxxy_ref < vtype > (this);
- }
- vtype3_xxxz_ref < vtype > xxxz()
- {
- return vtype3_xxxz_ref < vtype > (this);
- }
- vtype3_xxyx_ref < vtype > xxyx()
- {
- return vtype3_xxyx_ref < vtype > (this);
- }
- vtype3_xxyy_ref < vtype > xxyy()
- {
- return vtype3_xxyy_ref < vtype > (this);
- }
- vtype3_xxyz_ref < vtype > xxyz()
- {
- return vtype3_xxyz_ref < vtype > (this);
- }
- vtype3_xxzx_ref < vtype > xxzx()
- {
- return vtype3_xxzx_ref < vtype > (this);
- }
- vtype3_xxzy_ref < vtype > xxzy()
- {
- return vtype3_xxzy_ref < vtype > (this);
- }
- vtype3_xxzz_ref < vtype > xxzz()
- {
- return vtype3_xxzz_ref < vtype > (this);
- }
- vtype3_xyxx_ref < vtype > xyxx()
- {
- return vtype3_xyxx_ref < vtype > (this);
- }
- vtype3_xyxy_ref < vtype > xyxy()
- {
- return vtype3_xyxy_ref < vtype > (this);
- }
- vtype3_xyxz_ref < vtype > xyxz()
- {
- return vtype3_xyxz_ref < vtype > (this);
- }
- vtype3_xyyx_ref < vtype > xyyx()
- {
- return vtype3_xyyx_ref < vtype > (this);
- }
- vtype3_xyyy_ref < vtype > xyyy()
- {
- return vtype3_xyyy_ref < vtype > (this);
- }
- vtype3_xyyz_ref < vtype > xyyz()
- {
- return vtype3_xyyz_ref < vtype > (this);
- }
- vtype3_xyzx_ref < vtype > xyzx()
- {
- return vtype3_xyzx_ref < vtype > (this);
- }
- vtype3_xyzy_ref < vtype > xyzy()
- {
- return vtype3_xyzy_ref < vtype > (this);
- }
- vtype3_xyzz_ref < vtype > xyzz()
- {
- return vtype3_xyzz_ref < vtype > (this);
- }
- vtype3_xzxx_ref < vtype > xzxx()
- {
- return vtype3_xzxx_ref < vtype > (this);
- }
- vtype3_xzxy_ref < vtype > xzxy()
- {
- return vtype3_xzxy_ref < vtype > (this);
- }
- vtype3_xzxz_ref < vtype > xzxz()
- {
- return vtype3_xzxz_ref < vtype > (this);
- }
- vtype3_xzyx_ref < vtype > xzyx()
- {
- return vtype3_xzyx_ref < vtype > (this);
- }
- vtype3_xzyy_ref < vtype > xzyy()
- {
- return vtype3_xzyy_ref < vtype > (this);
- }
- vtype3_xzyz_ref < vtype > xzyz()
- {
- return vtype3_xzyz_ref < vtype > (this);
- }
- vtype3_xzzx_ref < vtype > xzzx()
- {
- return vtype3_xzzx_ref < vtype > (this);
- }
- vtype3_xzzy_ref < vtype > xzzy()
- {
- return vtype3_xzzy_ref < vtype > (this);
- }
- vtype3_xzzz_ref < vtype > xzzz()
- {
- return vtype3_xzzz_ref < vtype > (this);
- }
- vtype3_yxxx_ref < vtype > yxxx()
- {
- return vtype3_yxxx_ref < vtype > (this);
- }
- vtype3_yxxy_ref < vtype > yxxy()
- {
- return vtype3_yxxy_ref < vtype > (this);
- }
- vtype3_yxxz_ref < vtype > yxxz()
- {
- return vtype3_yxxz_ref < vtype > (this);
- }
- vtype3_yxyx_ref < vtype > yxyx()
- {
- return vtype3_yxyx_ref < vtype > (this);
- }
- vtype3_yxyy_ref < vtype > yxyy()
- {
- return vtype3_yxyy_ref < vtype > (this);
- }
- vtype3_yxyz_ref < vtype > yxyz()
- {
- return vtype3_yxyz_ref < vtype > (this);
- }
- vtype3_yxzx_ref < vtype > yxzx()
- {
- return vtype3_yxzx_ref < vtype > (this);
- }
- vtype3_yxzy_ref < vtype > yxzy()
- {
- return vtype3_yxzy_ref < vtype > (this);
- }
- vtype3_yxzz_ref < vtype > yxzz()
- {
- return vtype3_yxzz_ref < vtype > (this);
- }
- vtype3_yyxx_ref < vtype > yyxx()
- {
- return vtype3_yyxx_ref < vtype > (this);
- }
- vtype3_yyxy_ref < vtype > yyxy()
- {
- return vtype3_yyxy_ref < vtype > (this);
- }
- vtype3_yyxz_ref < vtype > yyxz()
- {
- return vtype3_yyxz_ref < vtype > (this);
- }
- vtype3_yyyx_ref < vtype > yyyx()
- {
- return vtype3_yyyx_ref < vtype > (this);
- }
- vtype3_yyyy_ref < vtype > yyyy()
- {
- return vtype3_yyyy_ref < vtype > (this);
- }
- vtype3_yyyz_ref < vtype > yyyz()
- {
- return vtype3_yyyz_ref < vtype > (this);
- }
- vtype3_yyzx_ref < vtype > yyzx()
- {
- return vtype3_yyzx_ref < vtype > (this);
- }
- vtype3_yyzy_ref < vtype > yyzy()
- {
- return vtype3_yyzy_ref < vtype > (this);
- }
- vtype3_yyzz_ref < vtype > yyzz()
- {
- return vtype3_yyzz_ref < vtype > (this);
- }
- vtype3_yzxx_ref < vtype > yzxx()
- {
- return vtype3_yzxx_ref < vtype > (this);
- }
- vtype3_yzxy_ref < vtype > yzxy()
- {
- return vtype3_yzxy_ref < vtype > (this);
- }
- vtype3_yzxz_ref < vtype > yzxz()
- {
- return vtype3_yzxz_ref < vtype > (this);
- }
- vtype3_yzyx_ref < vtype > yzyx()
- {
- return vtype3_yzyx_ref < vtype > (this);
- }
- vtype3_yzyy_ref < vtype > yzyy()
- {
- return vtype3_yzyy_ref < vtype > (this);
- }
- vtype3_yzyz_ref < vtype > yzyz()
- {
- return vtype3_yzyz_ref < vtype > (this);
- }
- vtype3_yzzx_ref < vtype > yzzx()
- {
- return vtype3_yzzx_ref < vtype > (this);
- }
- vtype3_yzzy_ref < vtype > yzzy()
- {
- return vtype3_yzzy_ref < vtype > (this);
- }
- vtype3_yzzz_ref < vtype > yzzz()
- {
- return vtype3_yzzz_ref < vtype > (this);
- }
- vtype3_zxxx_ref < vtype > zxxx()
- {
- return vtype3_zxxx_ref < vtype > (this);
- }
- vtype3_zxxy_ref < vtype > zxxy()
- {
- return vtype3_zxxy_ref < vtype > (this);
- }
- vtype3_zxxz_ref < vtype > zxxz()
- {
- return vtype3_zxxz_ref < vtype > (this);
- }
- vtype3_zxyx_ref < vtype > zxyx()
- {
- return vtype3_zxyx_ref < vtype > (this);
- }
- vtype3_zxyy_ref < vtype > zxyy()
- {
- return vtype3_zxyy_ref < vtype > (this);
- }
- vtype3_zxyz_ref < vtype > zxyz()
- {
- return vtype3_zxyz_ref < vtype > (this);
- }
- vtype3_zxzx_ref < vtype > zxzx()
- {
- return vtype3_zxzx_ref < vtype > (this);
- }
- vtype3_zxzy_ref < vtype > zxzy()
- {
- return vtype3_zxzy_ref < vtype > (this);
- }
- vtype3_zxzz_ref < vtype > zxzz()
- {
- return vtype3_zxzz_ref < vtype > (this);
- }
- vtype3_zyxx_ref < vtype > zyxx()
- {
- return vtype3_zyxx_ref < vtype > (this);
- }
- vtype3_zyxy_ref < vtype > zyxy()
- {
- return vtype3_zyxy_ref < vtype > (this);
- }
- vtype3_zyxz_ref < vtype > zyxz()
- {
- return vtype3_zyxz_ref < vtype > (this);
- }
- vtype3_zyyx_ref < vtype > zyyx()
- {
- return vtype3_zyyx_ref < vtype > (this);
- }
- vtype3_zyyy_ref < vtype > zyyy()
- {
- return vtype3_zyyy_ref < vtype > (this);
- }
- vtype3_zyyz_ref < vtype > zyyz()
- {
- return vtype3_zyyz_ref < vtype > (this);
- }
- vtype3_zyzx_ref < vtype > zyzx()
- {
- return vtype3_zyzx_ref < vtype > (this);
- }
- vtype3_zyzy_ref < vtype > zyzy()
- {
- return vtype3_zyzy_ref < vtype > (this);
- }
- vtype3_zyzz_ref < vtype > zyzz()
- {
- return vtype3_zyzz_ref < vtype > (this);
- }
- vtype3_zzxx_ref < vtype > zzxx()
- {
- return vtype3_zzxx_ref < vtype > (this);
- }
- vtype3_zzxy_ref < vtype > zzxy()
- {
- return vtype3_zzxy_ref < vtype > (this);
- }
- vtype3_zzxz_ref < vtype > zzxz()
- {
- return vtype3_zzxz_ref < vtype > (this);
- }
- vtype3_zzyx_ref < vtype > zzyx()
- {
- return vtype3_zzyx_ref < vtype > (this);
- }
- vtype3_zzyy_ref < vtype > zzyy()
- {
- return vtype3_zzyy_ref < vtype > (this);
- }
- vtype3_zzyz_ref < vtype > zzyz()
- {
- return vtype3_zzyz_ref < vtype > (this);
- }
- vtype3_zzzx_ref < vtype > zzzx()
- {
- return vtype3_zzzx_ref < vtype > (this);
- }
- vtype3_zzzy_ref < vtype > zzzy()
- {
- return vtype3_zzzy_ref < vtype > (this);
- }
- vtype3_zzzz_ref < vtype > zzzz()
- {
- return vtype3_zzzz_ref < vtype > (this);
- }
-};
-
-template < typename vtype > class vtype4
-{
- public:
- vtype x, y, z, w;
- vtype4()
- {
- };
- vtype4(vtype p, vtype q, vtype r, vtype s):x(p), y(q), z(r), w(s)
- {
- };
- vtype4(const vtype2 < vtype > &p, const vtype2 < vtype > &q):x(p.x), y(p.y), z(q.x), w(q.y)
- {
- };
- vtype4(const vtype2 < vtype > &p, vtype q, vtype r):x(p.x), y(p.y), z(q), w(r)
- {
- };
- vtype4(vtype p, const vtype2 < vtype > &q, vtype r):x(p), y(q.x), z(q.y), w(r)
- {
- };
- vtype4(vtype p, vtype q, const vtype2 < vtype > &r):x(p), y(q), z(r.x), w(r.y)
- {
- };
- vtype4(const vtype3 < vtype > &p, vtype q):x(p.x), y(p.y), z(p.z), w(q)
- {
- };
- vtype4(vtype p, const vtype3 < vtype > &q):x(p), y(q.x), z(q.y), w(q.z)
- {
- };
- vtype4(const vtype4 & p):x(p.x), y(p.y), z(p.z), w(p.w)
- {
- };
- inline vtype4(const vtype2_xxxx_ref < vtype > &v);
- inline vtype4(const vtype2_xxxy_ref < vtype > &v);
- inline vtype4(const vtype2_xxyx_ref < vtype > &v);
- inline vtype4(const vtype2_xxyy_ref < vtype > &v);
- inline vtype4(const vtype2_xyxx_ref < vtype > &v);
- inline vtype4(const vtype2_xyxy_ref < vtype > &v);
- inline vtype4(const vtype2_xyyx_ref < vtype > &v);
- inline vtype4(const vtype2_xyyy_ref < vtype > &v);
- inline vtype4(const vtype2_yxxx_ref < vtype > &v);
- inline vtype4(const vtype2_yxxy_ref < vtype > &v);
- inline vtype4(const vtype2_yxyx_ref < vtype > &v);
- inline vtype4(const vtype2_yxyy_ref < vtype > &v);
- inline vtype4(const vtype2_yyxx_ref < vtype > &v);
- inline vtype4(const vtype2_yyxy_ref < vtype > &v);
- inline vtype4(const vtype2_yyyx_ref < vtype > &v);
- inline vtype4(const vtype2_yyyy_ref < vtype > &v);
- inline vtype4(const vtype3_xxxx_ref < vtype > &v);
- inline vtype4(const vtype3_xxxy_ref < vtype > &v);
- inline vtype4(const vtype3_xxxz_ref < vtype > &v);
- inline vtype4(const vtype3_xxyx_ref < vtype > &v);
- inline vtype4(const vtype3_xxyy_ref < vtype > &v);
- inline vtype4(const vtype3_xxyz_ref < vtype > &v);
- inline vtype4(const vtype3_xxzx_ref < vtype > &v);
- inline vtype4(const vtype3_xxzy_ref < vtype > &v);
- inline vtype4(const vtype3_xxzz_ref < vtype > &v);
- inline vtype4(const vtype3_xyxx_ref < vtype > &v);
- inline vtype4(const vtype3_xyxy_ref < vtype > &v);
- inline vtype4(const vtype3_xyxz_ref < vtype > &v);
- inline vtype4(const vtype3_xyyx_ref < vtype > &v);
- inline vtype4(const vtype3_xyyy_ref < vtype > &v);
- inline vtype4(const vtype3_xyyz_ref < vtype > &v);
- inline vtype4(const vtype3_xyzx_ref < vtype > &v);
- inline vtype4(const vtype3_xyzy_ref < vtype > &v);
- inline vtype4(const vtype3_xyzz_ref < vtype > &v);
- inline vtype4(const vtype3_xzxx_ref < vtype > &v);
- inline vtype4(const vtype3_xzxy_ref < vtype > &v);
- inline vtype4(const vtype3_xzxz_ref < vtype > &v);
- inline vtype4(const vtype3_xzyx_ref < vtype > &v);
- inline vtype4(const vtype3_xzyy_ref < vtype > &v);
- inline vtype4(const vtype3_xzyz_ref < vtype > &v);
- inline vtype4(const vtype3_xzzx_ref < vtype > &v);
- inline vtype4(const vtype3_xzzy_ref < vtype > &v);
- inline vtype4(const vtype3_xzzz_ref < vtype > &v);
- inline vtype4(const vtype3_yxxx_ref < vtype > &v);
- inline vtype4(const vtype3_yxxy_ref < vtype > &v);
- inline vtype4(const vtype3_yxxz_ref < vtype > &v);
- inline vtype4(const vtype3_yxyx_ref < vtype > &v);
- inline vtype4(const vtype3_yxyy_ref < vtype > &v);
- inline vtype4(const vtype3_yxyz_ref < vtype > &v);
- inline vtype4(const vtype3_yxzx_ref < vtype > &v);
- inline vtype4(const vtype3_yxzy_ref < vtype > &v);
- inline vtype4(const vtype3_yxzz_ref < vtype > &v);
- inline vtype4(const vtype3_yyxx_ref < vtype > &v);
- inline vtype4(const vtype3_yyxy_ref < vtype > &v);
- inline vtype4(const vtype3_yyxz_ref < vtype > &v);
- inline vtype4(const vtype3_yyyx_ref < vtype > &v);
- inline vtype4(const vtype3_yyyy_ref < vtype > &v);
- inline vtype4(const vtype3_yyyz_ref < vtype > &v);
- inline vtype4(const vtype3_yyzx_ref < vtype > &v);
- inline vtype4(const vtype3_yyzy_ref < vtype > &v);
- inline vtype4(const vtype3_yyzz_ref < vtype > &v);
- inline vtype4(const vtype3_yzxx_ref < vtype > &v);
- inline vtype4(const vtype3_yzxy_ref < vtype > &v);
- inline vtype4(const vtype3_yzxz_ref < vtype > &v);
- inline vtype4(const vtype3_yzyx_ref < vtype > &v);
- inline vtype4(const vtype3_yzyy_ref < vtype > &v);
- inline vtype4(const vtype3_yzyz_ref < vtype > &v);
- inline vtype4(const vtype3_yzzx_ref < vtype > &v);
- inline vtype4(const vtype3_yzzy_ref < vtype > &v);
- inline vtype4(const vtype3_yzzz_ref < vtype > &v);
- inline vtype4(const vtype3_zxxx_ref < vtype > &v);
- inline vtype4(const vtype3_zxxy_ref < vtype > &v);
- inline vtype4(const vtype3_zxxz_ref < vtype > &v);
- inline vtype4(const vtype3_zxyx_ref < vtype > &v);
- inline vtype4(const vtype3_zxyy_ref < vtype > &v);
- inline vtype4(const vtype3_zxyz_ref < vtype > &v);
- inline vtype4(const vtype3_zxzx_ref < vtype > &v);
- inline vtype4(const vtype3_zxzy_ref < vtype > &v);
- inline vtype4(const vtype3_zxzz_ref < vtype > &v);
- inline vtype4(const vtype3_zyxx_ref < vtype > &v);
- inline vtype4(const vtype3_zyxy_ref < vtype > &v);
- inline vtype4(const vtype3_zyxz_ref < vtype > &v);
- inline vtype4(const vtype3_zyyx_ref < vtype > &v);
- inline vtype4(const vtype3_zyyy_ref < vtype > &v);
- inline vtype4(const vtype3_zyyz_ref < vtype > &v);
- inline vtype4(const vtype3_zyzx_ref < vtype > &v);
- inline vtype4(const vtype3_zyzy_ref < vtype > &v);
- inline vtype4(const vtype3_zyzz_ref < vtype > &v);
- inline vtype4(const vtype3_zzxx_ref < vtype > &v);
- inline vtype4(const vtype3_zzxy_ref < vtype > &v);
- inline vtype4(const vtype3_zzxz_ref < vtype > &v);
- inline vtype4(const vtype3_zzyx_ref < vtype > &v);
- inline vtype4(const vtype3_zzyy_ref < vtype > &v);
- inline vtype4(const vtype3_zzyz_ref < vtype > &v);
- inline vtype4(const vtype3_zzzx_ref < vtype > &v);
- inline vtype4(const vtype3_zzzy_ref < vtype > &v);
- inline vtype4(const vtype3_zzzz_ref < vtype > &v);
- inline vtype4(const vtype4_xxxx_ref < vtype > &v);
- inline vtype4(const vtype4_xxxy_ref < vtype > &v);
- inline vtype4(const vtype4_xxxz_ref < vtype > &v);
- inline vtype4(const vtype4_xxxw_ref < vtype > &v);
- inline vtype4(const vtype4_xxyx_ref < vtype > &v);
- inline vtype4(const vtype4_xxyy_ref < vtype > &v);
- inline vtype4(const vtype4_xxyz_ref < vtype > &v);
- inline vtype4(const vtype4_xxyw_ref < vtype > &v);
- inline vtype4(const vtype4_xxzx_ref < vtype > &v);
- inline vtype4(const vtype4_xxzy_ref < vtype > &v);
- inline vtype4(const vtype4_xxzz_ref < vtype > &v);
- inline vtype4(const vtype4_xxzw_ref < vtype > &v);
- inline vtype4(const vtype4_xxwx_ref < vtype > &v);
- inline vtype4(const vtype4_xxwy_ref < vtype > &v);
- inline vtype4(const vtype4_xxwz_ref < vtype > &v);
- inline vtype4(const vtype4_xxww_ref < vtype > &v);
- inline vtype4(const vtype4_xyxx_ref < vtype > &v);
- inline vtype4(const vtype4_xyxy_ref < vtype > &v);
- inline vtype4(const vtype4_xyxz_ref < vtype > &v);
- inline vtype4(const vtype4_xyxw_ref < vtype > &v);
- inline vtype4(const vtype4_xyyx_ref < vtype > &v);
- inline vtype4(const vtype4_xyyy_ref < vtype > &v);
- inline vtype4(const vtype4_xyyz_ref < vtype > &v);
- inline vtype4(const vtype4_xyyw_ref < vtype > &v);
- inline vtype4(const vtype4_xyzx_ref < vtype > &v);
- inline vtype4(const vtype4_xyzy_ref < vtype > &v);
- inline vtype4(const vtype4_xyzz_ref < vtype > &v);
- inline vtype4(const vtype4_xyzw_ref < vtype > &v);
- inline vtype4(const vtype4_xywx_ref < vtype > &v);
- inline vtype4(const vtype4_xywy_ref < vtype > &v);
- inline vtype4(const vtype4_xywz_ref < vtype > &v);
- inline vtype4(const vtype4_xyww_ref < vtype > &v);
- inline vtype4(const vtype4_xzxx_ref < vtype > &v);
- inline vtype4(const vtype4_xzxy_ref < vtype > &v);
- inline vtype4(const vtype4_xzxz_ref < vtype > &v);
- inline vtype4(const vtype4_xzxw_ref < vtype > &v);
- inline vtype4(const vtype4_xzyx_ref < vtype > &v);
- inline vtype4(const vtype4_xzyy_ref < vtype > &v);
- inline vtype4(const vtype4_xzyz_ref < vtype > &v);
- inline vtype4(const vtype4_xzyw_ref < vtype > &v);
- inline vtype4(const vtype4_xzzx_ref < vtype > &v);
- inline vtype4(const vtype4_xzzy_ref < vtype > &v);
- inline vtype4(const vtype4_xzzz_ref < vtype > &v);
- inline vtype4(const vtype4_xzzw_ref < vtype > &v);
- inline vtype4(const vtype4_xzwx_ref < vtype > &v);
- inline vtype4(const vtype4_xzwy_ref < vtype > &v);
- inline vtype4(const vtype4_xzwz_ref < vtype > &v);
- inline vtype4(const vtype4_xzww_ref < vtype > &v);
- inline vtype4(const vtype4_xwxx_ref < vtype > &v);
- inline vtype4(const vtype4_xwxy_ref < vtype > &v);
- inline vtype4(const vtype4_xwxz_ref < vtype > &v);
- inline vtype4(const vtype4_xwxw_ref < vtype > &v);
- inline vtype4(const vtype4_xwyx_ref < vtype > &v);
- inline vtype4(const vtype4_xwyy_ref < vtype > &v);
- inline vtype4(const vtype4_xwyz_ref < vtype > &v);
- inline vtype4(const vtype4_xwyw_ref < vtype > &v);
- inline vtype4(const vtype4_xwzx_ref < vtype > &v);
- inline vtype4(const vtype4_xwzy_ref < vtype > &v);
- inline vtype4(const vtype4_xwzz_ref < vtype > &v);
- inline vtype4(const vtype4_xwzw_ref < vtype > &v);
- inline vtype4(const vtype4_xwwx_ref < vtype > &v);
- inline vtype4(const vtype4_xwwy_ref < vtype > &v);
- inline vtype4(const vtype4_xwwz_ref < vtype > &v);
- inline vtype4(const vtype4_xwww_ref < vtype > &v);
- inline vtype4(const vtype4_yxxx_ref < vtype > &v);
- inline vtype4(const vtype4_yxxy_ref < vtype > &v);
- inline vtype4(const vtype4_yxxz_ref < vtype > &v);
- inline vtype4(const vtype4_yxxw_ref < vtype > &v);
- inline vtype4(const vtype4_yxyx_ref < vtype > &v);
- inline vtype4(const vtype4_yxyy_ref < vtype > &v);
- inline vtype4(const vtype4_yxyz_ref < vtype > &v);
- inline vtype4(const vtype4_yxyw_ref < vtype > &v);
- inline vtype4(const vtype4_yxzx_ref < vtype > &v);
- inline vtype4(const vtype4_yxzy_ref < vtype > &v);
- inline vtype4(const vtype4_yxzz_ref < vtype > &v);
- inline vtype4(const vtype4_yxzw_ref < vtype > &v);
- inline vtype4(const vtype4_yxwx_ref < vtype > &v);
- inline vtype4(const vtype4_yxwy_ref < vtype > &v);
- inline vtype4(const vtype4_yxwz_ref < vtype > &v);
- inline vtype4(const vtype4_yxww_ref < vtype > &v);
- inline vtype4(const vtype4_yyxx_ref < vtype > &v);
- inline vtype4(const vtype4_yyxy_ref < vtype > &v);
- inline vtype4(const vtype4_yyxz_ref < vtype > &v);
- inline vtype4(const vtype4_yyxw_ref < vtype > &v);
- inline vtype4(const vtype4_yyyx_ref < vtype > &v);
- inline vtype4(const vtype4_yyyy_ref < vtype > &v);
- inline vtype4(const vtype4_yyyz_ref < vtype > &v);
- inline vtype4(const vtype4_yyyw_ref < vtype > &v);
- inline vtype4(const vtype4_yyzx_ref < vtype > &v);
- inline vtype4(const vtype4_yyzy_ref < vtype > &v);
- inline vtype4(const vtype4_yyzz_ref < vtype > &v);
- inline vtype4(const vtype4_yyzw_ref < vtype > &v);
- inline vtype4(const vtype4_yywx_ref < vtype > &v);
- inline vtype4(const vtype4_yywy_ref < vtype > &v);
- inline vtype4(const vtype4_yywz_ref < vtype > &v);
- inline vtype4(const vtype4_yyww_ref < vtype > &v);
- inline vtype4(const vtype4_yzxx_ref < vtype > &v);
- inline vtype4(const vtype4_yzxy_ref < vtype > &v);
- inline vtype4(const vtype4_yzxz_ref < vtype > &v);
- inline vtype4(const vtype4_yzxw_ref < vtype > &v);
- inline vtype4(const vtype4_yzyx_ref < vtype > &v);
- inline vtype4(const vtype4_yzyy_ref < vtype > &v);
- inline vtype4(const vtype4_yzyz_ref < vtype > &v);
- inline vtype4(const vtype4_yzyw_ref < vtype > &v);
- inline vtype4(const vtype4_yzzx_ref < vtype > &v);
- inline vtype4(const vtype4_yzzy_ref < vtype > &v);
- inline vtype4(const vtype4_yzzz_ref < vtype > &v);
- inline vtype4(const vtype4_yzzw_ref < vtype > &v);
- inline vtype4(const vtype4_yzwx_ref < vtype > &v);
- inline vtype4(const vtype4_yzwy_ref < vtype > &v);
- inline vtype4(const vtype4_yzwz_ref < vtype > &v);
- inline vtype4(const vtype4_yzww_ref < vtype > &v);
- inline vtype4(const vtype4_ywxx_ref < vtype > &v);
- inline vtype4(const vtype4_ywxy_ref < vtype > &v);
- inline vtype4(const vtype4_ywxz_ref < vtype > &v);
- inline vtype4(const vtype4_ywxw_ref < vtype > &v);
- inline vtype4(const vtype4_ywyx_ref < vtype > &v);
- inline vtype4(const vtype4_ywyy_ref < vtype > &v);
- inline vtype4(const vtype4_ywyz_ref < vtype > &v);
- inline vtype4(const vtype4_ywyw_ref < vtype > &v);
- inline vtype4(const vtype4_ywzx_ref < vtype > &v);
- inline vtype4(const vtype4_ywzy_ref < vtype > &v);
- inline vtype4(const vtype4_ywzz_ref < vtype > &v);
- inline vtype4(const vtype4_ywzw_ref < vtype > &v);
- inline vtype4(const vtype4_ywwx_ref < vtype > &v);
- inline vtype4(const vtype4_ywwy_ref < vtype > &v);
- inline vtype4(const vtype4_ywwz_ref < vtype > &v);
- inline vtype4(const vtype4_ywww_ref < vtype > &v);
- inline vtype4(const vtype4_zxxx_ref < vtype > &v);
- inline vtype4(const vtype4_zxxy_ref < vtype > &v);
- inline vtype4(const vtype4_zxxz_ref < vtype > &v);
- inline vtype4(const vtype4_zxxw_ref < vtype > &v);
- inline vtype4(const vtype4_zxyx_ref < vtype > &v);
- inline vtype4(const vtype4_zxyy_ref < vtype > &v);
- inline vtype4(const vtype4_zxyz_ref < vtype > &v);
- inline vtype4(const vtype4_zxyw_ref < vtype > &v);
- inline vtype4(const vtype4_zxzx_ref < vtype > &v);
- inline vtype4(const vtype4_zxzy_ref < vtype > &v);
- inline vtype4(const vtype4_zxzz_ref < vtype > &v);
- inline vtype4(const vtype4_zxzw_ref < vtype > &v);
- inline vtype4(const vtype4_zxwx_ref < vtype > &v);
- inline vtype4(const vtype4_zxwy_ref < vtype > &v);
- inline vtype4(const vtype4_zxwz_ref < vtype > &v);
- inline vtype4(const vtype4_zxww_ref < vtype > &v);
- inline vtype4(const vtype4_zyxx_ref < vtype > &v);
- inline vtype4(const vtype4_zyxy_ref < vtype > &v);
- inline vtype4(const vtype4_zyxz_ref < vtype > &v);
- inline vtype4(const vtype4_zyxw_ref < vtype > &v);
- inline vtype4(const vtype4_zyyx_ref < vtype > &v);
- inline vtype4(const vtype4_zyyy_ref < vtype > &v);
- inline vtype4(const vtype4_zyyz_ref < vtype > &v);
- inline vtype4(const vtype4_zyyw_ref < vtype > &v);
- inline vtype4(const vtype4_zyzx_ref < vtype > &v);
- inline vtype4(const vtype4_zyzy_ref < vtype > &v);
- inline vtype4(const vtype4_zyzz_ref < vtype > &v);
- inline vtype4(const vtype4_zyzw_ref < vtype > &v);
- inline vtype4(const vtype4_zywx_ref < vtype > &v);
- inline vtype4(const vtype4_zywy_ref < vtype > &v);
- inline vtype4(const vtype4_zywz_ref < vtype > &v);
- inline vtype4(const vtype4_zyww_ref < vtype > &v);
- inline vtype4(const vtype4_zzxx_ref < vtype > &v);
- inline vtype4(const vtype4_zzxy_ref < vtype > &v);
- inline vtype4(const vtype4_zzxz_ref < vtype > &v);
- inline vtype4(const vtype4_zzxw_ref < vtype > &v);
- inline vtype4(const vtype4_zzyx_ref < vtype > &v);
- inline vtype4(const vtype4_zzyy_ref < vtype > &v);
- inline vtype4(const vtype4_zzyz_ref < vtype > &v);
- inline vtype4(const vtype4_zzyw_ref < vtype > &v);
- inline vtype4(const vtype4_zzzx_ref < vtype > &v);
- inline vtype4(const vtype4_zzzy_ref < vtype > &v);
- inline vtype4(const vtype4_zzzz_ref < vtype > &v);
- inline vtype4(const vtype4_zzzw_ref < vtype > &v);
- inline vtype4(const vtype4_zzwx_ref < vtype > &v);
- inline vtype4(const vtype4_zzwy_ref < vtype > &v);
- inline vtype4(const vtype4_zzwz_ref < vtype > &v);
- inline vtype4(const vtype4_zzww_ref < vtype > &v);
- inline vtype4(const vtype4_zwxx_ref < vtype > &v);
- inline vtype4(const vtype4_zwxy_ref < vtype > &v);
- inline vtype4(const vtype4_zwxz_ref < vtype > &v);
- inline vtype4(const vtype4_zwxw_ref < vtype > &v);
- inline vtype4(const vtype4_zwyx_ref < vtype > &v);
- inline vtype4(const vtype4_zwyy_ref < vtype > &v);
- inline vtype4(const vtype4_zwyz_ref < vtype > &v);
- inline vtype4(const vtype4_zwyw_ref < vtype > &v);
- inline vtype4(const vtype4_zwzx_ref < vtype > &v);
- inline vtype4(const vtype4_zwzy_ref < vtype > &v);
- inline vtype4(const vtype4_zwzz_ref < vtype > &v);
- inline vtype4(const vtype4_zwzw_ref < vtype > &v);
- inline vtype4(const vtype4_zwwx_ref < vtype > &v);
- inline vtype4(const vtype4_zwwy_ref < vtype > &v);
- inline vtype4(const vtype4_zwwz_ref < vtype > &v);
- inline vtype4(const vtype4_zwww_ref < vtype > &v);
- inline vtype4(const vtype4_wxxx_ref < vtype > &v);
- inline vtype4(const vtype4_wxxy_ref < vtype > &v);
- inline vtype4(const vtype4_wxxz_ref < vtype > &v);
- inline vtype4(const vtype4_wxxw_ref < vtype > &v);
- inline vtype4(const vtype4_wxyx_ref < vtype > &v);
- inline vtype4(const vtype4_wxyy_ref < vtype > &v);
- inline vtype4(const vtype4_wxyz_ref < vtype > &v);
- inline vtype4(const vtype4_wxyw_ref < vtype > &v);
- inline vtype4(const vtype4_wxzx_ref < vtype > &v);
- inline vtype4(const vtype4_wxzy_ref < vtype > &v);
- inline vtype4(const vtype4_wxzz_ref < vtype > &v);
- inline vtype4(const vtype4_wxzw_ref < vtype > &v);
- inline vtype4(const vtype4_wxwx_ref < vtype > &v);
- inline vtype4(const vtype4_wxwy_ref < vtype > &v);
- inline vtype4(const vtype4_wxwz_ref < vtype > &v);
- inline vtype4(const vtype4_wxww_ref < vtype > &v);
- inline vtype4(const vtype4_wyxx_ref < vtype > &v);
- inline vtype4(const vtype4_wyxy_ref < vtype > &v);
- inline vtype4(const vtype4_wyxz_ref < vtype > &v);
- inline vtype4(const vtype4_wyxw_ref < vtype > &v);
- inline vtype4(const vtype4_wyyx_ref < vtype > &v);
- inline vtype4(const vtype4_wyyy_ref < vtype > &v);
- inline vtype4(const vtype4_wyyz_ref < vtype > &v);
- inline vtype4(const vtype4_wyyw_ref < vtype > &v);
- inline vtype4(const vtype4_wyzx_ref < vtype > &v);
- inline vtype4(const vtype4_wyzy_ref < vtype > &v);
- inline vtype4(const vtype4_wyzz_ref < vtype > &v);
- inline vtype4(const vtype4_wyzw_ref < vtype > &v);
- inline vtype4(const vtype4_wywx_ref < vtype > &v);
- inline vtype4(const vtype4_wywy_ref < vtype > &v);
- inline vtype4(const vtype4_wywz_ref < vtype > &v);
- inline vtype4(const vtype4_wyww_ref < vtype > &v);
- inline vtype4(const vtype4_wzxx_ref < vtype > &v);
- inline vtype4(const vtype4_wzxy_ref < vtype > &v);
- inline vtype4(const vtype4_wzxz_ref < vtype > &v);
- inline vtype4(const vtype4_wzxw_ref < vtype > &v);
- inline vtype4(const vtype4_wzyx_ref < vtype > &v);
- inline vtype4(const vtype4_wzyy_ref < vtype > &v);
- inline vtype4(const vtype4_wzyz_ref < vtype > &v);
- inline vtype4(const vtype4_wzyw_ref < vtype > &v);
- inline vtype4(const vtype4_wzzx_ref < vtype > &v);
- inline vtype4(const vtype4_wzzy_ref < vtype > &v);
- inline vtype4(const vtype4_wzzz_ref < vtype > &v);
- inline vtype4(const vtype4_wzzw_ref < vtype > &v);
- inline vtype4(const vtype4_wzwx_ref < vtype > &v);
- inline vtype4(const vtype4_wzwy_ref < vtype > &v);
- inline vtype4(const vtype4_wzwz_ref < vtype > &v);
- inline vtype4(const vtype4_wzww_ref < vtype > &v);
- inline vtype4(const vtype4_wwxx_ref < vtype > &v);
- inline vtype4(const vtype4_wwxy_ref < vtype > &v);
- inline vtype4(const vtype4_wwxz_ref < vtype > &v);
- inline vtype4(const vtype4_wwxw_ref < vtype > &v);
- inline vtype4(const vtype4_wwyx_ref < vtype > &v);
- inline vtype4(const vtype4_wwyy_ref < vtype > &v);
- inline vtype4(const vtype4_wwyz_ref < vtype > &v);
- inline vtype4(const vtype4_wwyw_ref < vtype > &v);
- inline vtype4(const vtype4_wwzx_ref < vtype > &v);
- inline vtype4(const vtype4_wwzy_ref < vtype > &v);
- inline vtype4(const vtype4_wwzz_ref < vtype > &v);
- inline vtype4(const vtype4_wwzw_ref < vtype > &v);
- inline vtype4(const vtype4_wwwx_ref < vtype > &v);
- inline vtype4(const vtype4_wwwy_ref < vtype > &v);
- inline vtype4(const vtype4_wwwz_ref < vtype > &v);
- inline vtype4(const vtype4_wwww_ref < vtype > &v);
- vtype4_xx_ref < vtype > xx()
- {
- return vtype4_xx_ref < vtype > (this);
- }
- vtype4_xy_ref < vtype > xy()
- {
- return vtype4_xy_ref < vtype > (this);
- }
- vtype4_xz_ref < vtype > xz()
- {
- return vtype4_xz_ref < vtype > (this);
- }
- vtype4_xw_ref < vtype > xw()
- {
- return vtype4_xw_ref < vtype > (this);
- }
- vtype4_yx_ref < vtype > yx()
- {
- return vtype4_yx_ref < vtype > (this);
- }
- vtype4_yy_ref < vtype > yy()
- {
- return vtype4_yy_ref < vtype > (this);
- }
- vtype4_yz_ref < vtype > yz()
- {
- return vtype4_yz_ref < vtype > (this);
- }
- vtype4_yw_ref < vtype > yw()
- {
- return vtype4_yw_ref < vtype > (this);
- }
- vtype4_zx_ref < vtype > zx()
- {
- return vtype4_zx_ref < vtype > (this);
- }
- vtype4_zy_ref < vtype > zy()
- {
- return vtype4_zy_ref < vtype > (this);
- }
- vtype4_zz_ref < vtype > zz()
- {
- return vtype4_zz_ref < vtype > (this);
- }
- vtype4_zw_ref < vtype > zw()
- {
- return vtype4_zw_ref < vtype > (this);
- }
- vtype4_wx_ref < vtype > wx()
- {
- return vtype4_wx_ref < vtype > (this);
- }
- vtype4_wy_ref < vtype > wy()
- {
- return vtype4_wy_ref < vtype > (this);
- }
- vtype4_wz_ref < vtype > wz()
- {
- return vtype4_wz_ref < vtype > (this);
- }
- vtype4_ww_ref < vtype > ww()
- {
- return vtype4_ww_ref < vtype > (this);
- }
- vtype4_xxx_ref < vtype > xxx()
- {
- return vtype4_xxx_ref < vtype > (this);
- }
- vtype4_xxy_ref < vtype > xxy()
- {
- return vtype4_xxy_ref < vtype > (this);
- }
- vtype4_xxz_ref < vtype > xxz()
- {
- return vtype4_xxz_ref < vtype > (this);
- }
- vtype4_xxw_ref < vtype > xxw()
- {
- return vtype4_xxw_ref < vtype > (this);
- }
- vtype4_xyx_ref < vtype > xyx()
- {
- return vtype4_xyx_ref < vtype > (this);
- }
- vtype4_xyy_ref < vtype > xyy()
- {
- return vtype4_xyy_ref < vtype > (this);
- }
- vtype4_xyz_ref < vtype > xyz()
- {
- return vtype4_xyz_ref < vtype > (this);
- }
- vtype4_xyw_ref < vtype > xyw()
- {
- return vtype4_xyw_ref < vtype > (this);
- }
- vtype4_xzx_ref < vtype > xzx()
- {
- return vtype4_xzx_ref < vtype > (this);
- }
- vtype4_xzy_ref < vtype > xzy()
- {
- return vtype4_xzy_ref < vtype > (this);
- }
- vtype4_xzz_ref < vtype > xzz()
- {
- return vtype4_xzz_ref < vtype > (this);
- }
- vtype4_xzw_ref < vtype > xzw()
- {
- return vtype4_xzw_ref < vtype > (this);
- }
- vtype4_xwx_ref < vtype > xwx()
- {
- return vtype4_xwx_ref < vtype > (this);
- }
- vtype4_xwy_ref < vtype > xwy()
- {
- return vtype4_xwy_ref < vtype > (this);
- }
- vtype4_xwz_ref < vtype > xwz()
- {
- return vtype4_xwz_ref < vtype > (this);
- }
- vtype4_xww_ref < vtype > xww()
- {
- return vtype4_xww_ref < vtype > (this);
- }
- vtype4_yxx_ref < vtype > yxx()
- {
- return vtype4_yxx_ref < vtype > (this);
- }
- vtype4_yxy_ref < vtype > yxy()
- {
- return vtype4_yxy_ref < vtype > (this);
- }
- vtype4_yxz_ref < vtype > yxz()
- {
- return vtype4_yxz_ref < vtype > (this);
- }
- vtype4_yxw_ref < vtype > yxw()
- {
- return vtype4_yxw_ref < vtype > (this);
- }
- vtype4_yyx_ref < vtype > yyx()
- {
- return vtype4_yyx_ref < vtype > (this);
- }
- vtype4_yyy_ref < vtype > yyy()
- {
- return vtype4_yyy_ref < vtype > (this);
- }
- vtype4_yyz_ref < vtype > yyz()
- {
- return vtype4_yyz_ref < vtype > (this);
- }
- vtype4_yyw_ref < vtype > yyw()
- {
- return vtype4_yyw_ref < vtype > (this);
- }
- vtype4_yzx_ref < vtype > yzx()
- {
- return vtype4_yzx_ref < vtype > (this);
- }
- vtype4_yzy_ref < vtype > yzy()
- {
- return vtype4_yzy_ref < vtype > (this);
- }
- vtype4_yzz_ref < vtype > yzz()
- {
- return vtype4_yzz_ref < vtype > (this);
- }
- vtype4_yzw_ref < vtype > yzw()
- {
- return vtype4_yzw_ref < vtype > (this);
- }
- vtype4_ywx_ref < vtype > ywx()
- {
- return vtype4_ywx_ref < vtype > (this);
- }
- vtype4_ywy_ref < vtype > ywy()
- {
- return vtype4_ywy_ref < vtype > (this);
- }
- vtype4_ywz_ref < vtype > ywz()
- {
- return vtype4_ywz_ref < vtype > (this);
- }
- vtype4_yww_ref < vtype > yww()
- {
- return vtype4_yww_ref < vtype > (this);
- }
- vtype4_zxx_ref < vtype > zxx()
- {
- return vtype4_zxx_ref < vtype > (this);
- }
- vtype4_zxy_ref < vtype > zxy()
- {
- return vtype4_zxy_ref < vtype > (this);
- }
- vtype4_zxz_ref < vtype > zxz()
- {
- return vtype4_zxz_ref < vtype > (this);
- }
- vtype4_zxw_ref < vtype > zxw()
- {
- return vtype4_zxw_ref < vtype > (this);
- }
- vtype4_zyx_ref < vtype > zyx()
- {
- return vtype4_zyx_ref < vtype > (this);
- }
- vtype4_zyy_ref < vtype > zyy()
- {
- return vtype4_zyy_ref < vtype > (this);
- }
- vtype4_zyz_ref < vtype > zyz()
- {
- return vtype4_zyz_ref < vtype > (this);
- }
- vtype4_zyw_ref < vtype > zyw()
- {
- return vtype4_zyw_ref < vtype > (this);
- }
- vtype4_zzx_ref < vtype > zzx()
- {
- return vtype4_zzx_ref < vtype > (this);
- }
- vtype4_zzy_ref < vtype > zzy()
- {
- return vtype4_zzy_ref < vtype > (this);
- }
- vtype4_zzz_ref < vtype > zzz()
- {
- return vtype4_zzz_ref < vtype > (this);
- }
- vtype4_zzw_ref < vtype > zzw()
- {
- return vtype4_zzw_ref < vtype > (this);
- }
- vtype4_zwx_ref < vtype > zwx()
- {
- return vtype4_zwx_ref < vtype > (this);
- }
- vtype4_zwy_ref < vtype > zwy()
- {
- return vtype4_zwy_ref < vtype > (this);
- }
- vtype4_zwz_ref < vtype > zwz()
- {
- return vtype4_zwz_ref < vtype > (this);
- }
- vtype4_zww_ref < vtype > zww()
- {
- return vtype4_zww_ref < vtype > (this);
- }
- vtype4_wxx_ref < vtype > wxx()
- {
- return vtype4_wxx_ref < vtype > (this);
- }
- vtype4_wxy_ref < vtype > wxy()
- {
- return vtype4_wxy_ref < vtype > (this);
- }
- vtype4_wxz_ref < vtype > wxz()
- {
- return vtype4_wxz_ref < vtype > (this);
- }
- vtype4_wxw_ref < vtype > wxw()
- {
- return vtype4_wxw_ref < vtype > (this);
- }
- vtype4_wyx_ref < vtype > wyx()
- {
- return vtype4_wyx_ref < vtype > (this);
- }
- vtype4_wyy_ref < vtype > wyy()
- {
- return vtype4_wyy_ref < vtype > (this);
- }
- vtype4_wyz_ref < vtype > wyz()
- {
- return vtype4_wyz_ref < vtype > (this);
- }
- vtype4_wyw_ref < vtype > wyw()
- {
- return vtype4_wyw_ref < vtype > (this);
- }
- vtype4_wzx_ref < vtype > wzx()
- {
- return vtype4_wzx_ref < vtype > (this);
- }
- vtype4_wzy_ref < vtype > wzy()
- {
- return vtype4_wzy_ref < vtype > (this);
- }
- vtype4_wzz_ref < vtype > wzz()
- {
- return vtype4_wzz_ref < vtype > (this);
- }
- vtype4_wzw_ref < vtype > wzw()
- {
- return vtype4_wzw_ref < vtype > (this);
- }
- vtype4_wwx_ref < vtype > wwx()
- {
- return vtype4_wwx_ref < vtype > (this);
- }
- vtype4_wwy_ref < vtype > wwy()
- {
- return vtype4_wwy_ref < vtype > (this);
- }
- vtype4_wwz_ref < vtype > wwz()
- {
- return vtype4_wwz_ref < vtype > (this);
- }
- vtype4_www_ref < vtype > www()
- {
- return vtype4_www_ref < vtype > (this);
- }
- vtype4_xxxx_ref < vtype > xxxx()
- {
- return vtype4_xxxx_ref < vtype > (this);
- }
- vtype4_xxxy_ref < vtype > xxxy()
- {
- return vtype4_xxxy_ref < vtype > (this);
- }
- vtype4_xxxz_ref < vtype > xxxz()
- {
- return vtype4_xxxz_ref < vtype > (this);
- }
- vtype4_xxxw_ref < vtype > xxxw()
- {
- return vtype4_xxxw_ref < vtype > (this);
- }
- vtype4_xxyx_ref < vtype > xxyx()
- {
- return vtype4_xxyx_ref < vtype > (this);
- }
- vtype4_xxyy_ref < vtype > xxyy()
- {
- return vtype4_xxyy_ref < vtype > (this);
- }
- vtype4_xxyz_ref < vtype > xxyz()
- {
- return vtype4_xxyz_ref < vtype > (this);
- }
- vtype4_xxyw_ref < vtype > xxyw()
- {
- return vtype4_xxyw_ref < vtype > (this);
- }
- vtype4_xxzx_ref < vtype > xxzx()
- {
- return vtype4_xxzx_ref < vtype > (this);
- }
- vtype4_xxzy_ref < vtype > xxzy()
- {
- return vtype4_xxzy_ref < vtype > (this);
- }
- vtype4_xxzz_ref < vtype > xxzz()
- {
- return vtype4_xxzz_ref < vtype > (this);
- }
- vtype4_xxzw_ref < vtype > xxzw()
- {
- return vtype4_xxzw_ref < vtype > (this);
- }
- vtype4_xxwx_ref < vtype > xxwx()
- {
- return vtype4_xxwx_ref < vtype > (this);
- }
- vtype4_xxwy_ref < vtype > xxwy()
- {
- return vtype4_xxwy_ref < vtype > (this);
- }
- vtype4_xxwz_ref < vtype > xxwz()
- {
- return vtype4_xxwz_ref < vtype > (this);
- }
- vtype4_xxww_ref < vtype > xxww()
- {
- return vtype4_xxww_ref < vtype > (this);
- }
- vtype4_xyxx_ref < vtype > xyxx()
- {
- return vtype4_xyxx_ref < vtype > (this);
- }
- vtype4_xyxy_ref < vtype > xyxy()
- {
- return vtype4_xyxy_ref < vtype > (this);
- }
- vtype4_xyxz_ref < vtype > xyxz()
- {
- return vtype4_xyxz_ref < vtype > (this);
- }
- vtype4_xyxw_ref < vtype > xyxw()
- {
- return vtype4_xyxw_ref < vtype > (this);
- }
- vtype4_xyyx_ref < vtype > xyyx()
- {
- return vtype4_xyyx_ref < vtype > (this);
- }
- vtype4_xyyy_ref < vtype > xyyy()
- {
- return vtype4_xyyy_ref < vtype > (this);
- }
- vtype4_xyyz_ref < vtype > xyyz()
- {
- return vtype4_xyyz_ref < vtype > (this);
- }
- vtype4_xyyw_ref < vtype > xyyw()
- {
- return vtype4_xyyw_ref < vtype > (this);
- }
- vtype4_xyzx_ref < vtype > xyzx()
- {
- return vtype4_xyzx_ref < vtype > (this);
- }
- vtype4_xyzy_ref < vtype > xyzy()
- {
- return vtype4_xyzy_ref < vtype > (this);
- }
- vtype4_xyzz_ref < vtype > xyzz()
- {
- return vtype4_xyzz_ref < vtype > (this);
- }
- vtype4_xyzw_ref < vtype > xyzw()
- {
- return vtype4_xyzw_ref < vtype > (this);
- }
- vtype4_xywx_ref < vtype > xywx()
- {
- return vtype4_xywx_ref < vtype > (this);
- }
- vtype4_xywy_ref < vtype > xywy()
- {
- return vtype4_xywy_ref < vtype > (this);
- }
- vtype4_xywz_ref < vtype > xywz()
- {
- return vtype4_xywz_ref < vtype > (this);
- }
- vtype4_xyww_ref < vtype > xyww()
- {
- return vtype4_xyww_ref < vtype > (this);
- }
- vtype4_xzxx_ref < vtype > xzxx()
- {
- return vtype4_xzxx_ref < vtype > (this);
- }
- vtype4_xzxy_ref < vtype > xzxy()
- {
- return vtype4_xzxy_ref < vtype > (this);
- }
- vtype4_xzxz_ref < vtype > xzxz()
- {
- return vtype4_xzxz_ref < vtype > (this);
- }
- vtype4_xzxw_ref < vtype > xzxw()
- {
- return vtype4_xzxw_ref < vtype > (this);
- }
- vtype4_xzyx_ref < vtype > xzyx()
- {
- return vtype4_xzyx_ref < vtype > (this);
- }
- vtype4_xzyy_ref < vtype > xzyy()
- {
- return vtype4_xzyy_ref < vtype > (this);
- }
- vtype4_xzyz_ref < vtype > xzyz()
- {
- return vtype4_xzyz_ref < vtype > (this);
- }
- vtype4_xzyw_ref < vtype > xzyw()
- {
- return vtype4_xzyw_ref < vtype > (this);
- }
- vtype4_xzzx_ref < vtype > xzzx()
- {
- return vtype4_xzzx_ref < vtype > (this);
- }
- vtype4_xzzy_ref < vtype > xzzy()
- {
- return vtype4_xzzy_ref < vtype > (this);
- }
- vtype4_xzzz_ref < vtype > xzzz()
- {
- return vtype4_xzzz_ref < vtype > (this);
- }
- vtype4_xzzw_ref < vtype > xzzw()
- {
- return vtype4_xzzw_ref < vtype > (this);
- }
- vtype4_xzwx_ref < vtype > xzwx()
- {
- return vtype4_xzwx_ref < vtype > (this);
- }
- vtype4_xzwy_ref < vtype > xzwy()
- {
- return vtype4_xzwy_ref < vtype > (this);
- }
- vtype4_xzwz_ref < vtype > xzwz()
- {
- return vtype4_xzwz_ref < vtype > (this);
- }
- vtype4_xzww_ref < vtype > xzww()
- {
- return vtype4_xzww_ref < vtype > (this);
- }
- vtype4_xwxx_ref < vtype > xwxx()
- {
- return vtype4_xwxx_ref < vtype > (this);
- }
- vtype4_xwxy_ref < vtype > xwxy()
- {
- return vtype4_xwxy_ref < vtype > (this);
- }
- vtype4_xwxz_ref < vtype > xwxz()
- {
- return vtype4_xwxz_ref < vtype > (this);
- }
- vtype4_xwxw_ref < vtype > xwxw()
- {
- return vtype4_xwxw_ref < vtype > (this);
- }
- vtype4_xwyx_ref < vtype > xwyx()
- {
- return vtype4_xwyx_ref < vtype > (this);
- }
- vtype4_xwyy_ref < vtype > xwyy()
- {
- return vtype4_xwyy_ref < vtype > (this);
- }
- vtype4_xwyz_ref < vtype > xwyz()
- {
- return vtype4_xwyz_ref < vtype > (this);
- }
- vtype4_xwyw_ref < vtype > xwyw()
- {
- return vtype4_xwyw_ref < vtype > (this);
- }
- vtype4_xwzx_ref < vtype > xwzx()
- {
- return vtype4_xwzx_ref < vtype > (this);
- }
- vtype4_xwzy_ref < vtype > xwzy()
- {
- return vtype4_xwzy_ref < vtype > (this);
- }
- vtype4_xwzz_ref < vtype > xwzz()
- {
- return vtype4_xwzz_ref < vtype > (this);
- }
- vtype4_xwzw_ref < vtype > xwzw()
- {
- return vtype4_xwzw_ref < vtype > (this);
- }
- vtype4_xwwx_ref < vtype > xwwx()
- {
- return vtype4_xwwx_ref < vtype > (this);
- }
- vtype4_xwwy_ref < vtype > xwwy()
- {
- return vtype4_xwwy_ref < vtype > (this);
- }
- vtype4_xwwz_ref < vtype > xwwz()
- {
- return vtype4_xwwz_ref < vtype > (this);
- }
- vtype4_xwww_ref < vtype > xwww()
- {
- return vtype4_xwww_ref < vtype > (this);
- }
- vtype4_yxxx_ref < vtype > yxxx()
- {
- return vtype4_yxxx_ref < vtype > (this);
- }
- vtype4_yxxy_ref < vtype > yxxy()
- {
- return vtype4_yxxy_ref < vtype > (this);
- }
- vtype4_yxxz_ref < vtype > yxxz()
- {
- return vtype4_yxxz_ref < vtype > (this);
- }
- vtype4_yxxw_ref < vtype > yxxw()
- {
- return vtype4_yxxw_ref < vtype > (this);
- }
- vtype4_yxyx_ref < vtype > yxyx()
- {
- return vtype4_yxyx_ref < vtype > (this);
- }
- vtype4_yxyy_ref < vtype > yxyy()
- {
- return vtype4_yxyy_ref < vtype > (this);
- }
- vtype4_yxyz_ref < vtype > yxyz()
- {
- return vtype4_yxyz_ref < vtype > (this);
- }
- vtype4_yxyw_ref < vtype > yxyw()
- {
- return vtype4_yxyw_ref < vtype > (this);
- }
- vtype4_yxzx_ref < vtype > yxzx()
- {
- return vtype4_yxzx_ref < vtype > (this);
- }
- vtype4_yxzy_ref < vtype > yxzy()
- {
- return vtype4_yxzy_ref < vtype > (this);
- }
- vtype4_yxzz_ref < vtype > yxzz()
- {
- return vtype4_yxzz_ref < vtype > (this);
- }
- vtype4_yxzw_ref < vtype > yxzw()
- {
- return vtype4_yxzw_ref < vtype > (this);
- }
- vtype4_yxwx_ref < vtype > yxwx()
- {
- return vtype4_yxwx_ref < vtype > (this);
- }
- vtype4_yxwy_ref < vtype > yxwy()
- {
- return vtype4_yxwy_ref < vtype > (this);
- }
- vtype4_yxwz_ref < vtype > yxwz()
- {
- return vtype4_yxwz_ref < vtype > (this);
- }
- vtype4_yxww_ref < vtype > yxww()
- {
- return vtype4_yxww_ref < vtype > (this);
- }
- vtype4_yyxx_ref < vtype > yyxx()
- {
- return vtype4_yyxx_ref < vtype > (this);
- }
- vtype4_yyxy_ref < vtype > yyxy()
- {
- return vtype4_yyxy_ref < vtype > (this);
- }
- vtype4_yyxz_ref < vtype > yyxz()
- {
- return vtype4_yyxz_ref < vtype > (this);
- }
- vtype4_yyxw_ref < vtype > yyxw()
- {
- return vtype4_yyxw_ref < vtype > (this);
- }
- vtype4_yyyx_ref < vtype > yyyx()
- {
- return vtype4_yyyx_ref < vtype > (this);
- }
- vtype4_yyyy_ref < vtype > yyyy()
- {
- return vtype4_yyyy_ref < vtype > (this);
- }
- vtype4_yyyz_ref < vtype > yyyz()
- {
- return vtype4_yyyz_ref < vtype > (this);
- }
- vtype4_yyyw_ref < vtype > yyyw()
- {
- return vtype4_yyyw_ref < vtype > (this);
- }
- vtype4_yyzx_ref < vtype > yyzx()
- {
- return vtype4_yyzx_ref < vtype > (this);
- }
- vtype4_yyzy_ref < vtype > yyzy()
- {
- return vtype4_yyzy_ref < vtype > (this);
- }
- vtype4_yyzz_ref < vtype > yyzz()
- {
- return vtype4_yyzz_ref < vtype > (this);
- }
- vtype4_yyzw_ref < vtype > yyzw()
- {
- return vtype4_yyzw_ref < vtype > (this);
- }
- vtype4_yywx_ref < vtype > yywx()
- {
- return vtype4_yywx_ref < vtype > (this);
- }
- vtype4_yywy_ref < vtype > yywy()
- {
- return vtype4_yywy_ref < vtype > (this);
- }
- vtype4_yywz_ref < vtype > yywz()
- {
- return vtype4_yywz_ref < vtype > (this);
- }
- vtype4_yyww_ref < vtype > yyww()
- {
- return vtype4_yyww_ref < vtype > (this);
- }
- vtype4_yzxx_ref < vtype > yzxx()
- {
- return vtype4_yzxx_ref < vtype > (this);
- }
- vtype4_yzxy_ref < vtype > yzxy()
- {
- return vtype4_yzxy_ref < vtype > (this);
- }
- vtype4_yzxz_ref < vtype > yzxz()
- {
- return vtype4_yzxz_ref < vtype > (this);
- }
- vtype4_yzxw_ref < vtype > yzxw()
- {
- return vtype4_yzxw_ref < vtype > (this);
- }
- vtype4_yzyx_ref < vtype > yzyx()
- {
- return vtype4_yzyx_ref < vtype > (this);
- }
- vtype4_yzyy_ref < vtype > yzyy()
- {
- return vtype4_yzyy_ref < vtype > (this);
- }
- vtype4_yzyz_ref < vtype > yzyz()
- {
- return vtype4_yzyz_ref < vtype > (this);
- }
- vtype4_yzyw_ref < vtype > yzyw()
- {
- return vtype4_yzyw_ref < vtype > (this);
- }
- vtype4_yzzx_ref < vtype > yzzx()
- {
- return vtype4_yzzx_ref < vtype > (this);
- }
- vtype4_yzzy_ref < vtype > yzzy()
- {
- return vtype4_yzzy_ref < vtype > (this);
- }
- vtype4_yzzz_ref < vtype > yzzz()
- {
- return vtype4_yzzz_ref < vtype > (this);
- }
- vtype4_yzzw_ref < vtype > yzzw()
- {
- return vtype4_yzzw_ref < vtype > (this);
- }
- vtype4_yzwx_ref < vtype > yzwx()
- {
- return vtype4_yzwx_ref < vtype > (this);
- }
- vtype4_yzwy_ref < vtype > yzwy()
- {
- return vtype4_yzwy_ref < vtype > (this);
- }
- vtype4_yzwz_ref < vtype > yzwz()
- {
- return vtype4_yzwz_ref < vtype > (this);
- }
- vtype4_yzww_ref < vtype > yzww()
- {
- return vtype4_yzww_ref < vtype > (this);
- }
- vtype4_ywxx_ref < vtype > ywxx()
- {
- return vtype4_ywxx_ref < vtype > (this);
- }
- vtype4_ywxy_ref < vtype > ywxy()
- {
- return vtype4_ywxy_ref < vtype > (this);
- }
- vtype4_ywxz_ref < vtype > ywxz()
- {
- return vtype4_ywxz_ref < vtype > (this);
- }
- vtype4_ywxw_ref < vtype > ywxw()
- {
- return vtype4_ywxw_ref < vtype > (this);
- }
- vtype4_ywyx_ref < vtype > ywyx()
- {
- return vtype4_ywyx_ref < vtype > (this);
- }
- vtype4_ywyy_ref < vtype > ywyy()
- {
- return vtype4_ywyy_ref < vtype > (this);
- }
- vtype4_ywyz_ref < vtype > ywyz()
- {
- return vtype4_ywyz_ref < vtype > (this);
- }
- vtype4_ywyw_ref < vtype > ywyw()
- {
- return vtype4_ywyw_ref < vtype > (this);
- }
- vtype4_ywzx_ref < vtype > ywzx()
- {
- return vtype4_ywzx_ref < vtype > (this);
- }
- vtype4_ywzy_ref < vtype > ywzy()
- {
- return vtype4_ywzy_ref < vtype > (this);
- }
- vtype4_ywzz_ref < vtype > ywzz()
- {
- return vtype4_ywzz_ref < vtype > (this);
- }
- vtype4_ywzw_ref < vtype > ywzw()
- {
- return vtype4_ywzw_ref < vtype > (this);
- }
- vtype4_ywwx_ref < vtype > ywwx()
- {
- return vtype4_ywwx_ref < vtype > (this);
- }
- vtype4_ywwy_ref < vtype > ywwy()
- {
- return vtype4_ywwy_ref < vtype > (this);
- }
- vtype4_ywwz_ref < vtype > ywwz()
- {
- return vtype4_ywwz_ref < vtype > (this);
- }
- vtype4_ywww_ref < vtype > ywww()
- {
- return vtype4_ywww_ref < vtype > (this);
- }
- vtype4_zxxx_ref < vtype > zxxx()
- {
- return vtype4_zxxx_ref < vtype > (this);
- }
- vtype4_zxxy_ref < vtype > zxxy()
- {
- return vtype4_zxxy_ref < vtype > (this);
- }
- vtype4_zxxz_ref < vtype > zxxz()
- {
- return vtype4_zxxz_ref < vtype > (this);
- }
- vtype4_zxxw_ref < vtype > zxxw()
- {
- return vtype4_zxxw_ref < vtype > (this);
- }
- vtype4_zxyx_ref < vtype > zxyx()
- {
- return vtype4_zxyx_ref < vtype > (this);
- }
- vtype4_zxyy_ref < vtype > zxyy()
- {
- return vtype4_zxyy_ref < vtype > (this);
- }
- vtype4_zxyz_ref < vtype > zxyz()
- {
- return vtype4_zxyz_ref < vtype > (this);
- }
- vtype4_zxyw_ref < vtype > zxyw()
- {
- return vtype4_zxyw_ref < vtype > (this);
- }
- vtype4_zxzx_ref < vtype > zxzx()
- {
- return vtype4_zxzx_ref < vtype > (this);
- }
- vtype4_zxzy_ref < vtype > zxzy()
- {
- return vtype4_zxzy_ref < vtype > (this);
- }
- vtype4_zxzz_ref < vtype > zxzz()
- {
- return vtype4_zxzz_ref < vtype > (this);
- }
- vtype4_zxzw_ref < vtype > zxzw()
- {
- return vtype4_zxzw_ref < vtype > (this);
- }
- vtype4_zxwx_ref < vtype > zxwx()
- {
- return vtype4_zxwx_ref < vtype > (this);
- }
- vtype4_zxwy_ref < vtype > zxwy()
- {
- return vtype4_zxwy_ref < vtype > (this);
- }
- vtype4_zxwz_ref < vtype > zxwz()
- {
- return vtype4_zxwz_ref < vtype > (this);
- }
- vtype4_zxww_ref < vtype > zxww()
- {
- return vtype4_zxww_ref < vtype > (this);
- }
- vtype4_zyxx_ref < vtype > zyxx()
- {
- return vtype4_zyxx_ref < vtype > (this);
- }
- vtype4_zyxy_ref < vtype > zyxy()
- {
- return vtype4_zyxy_ref < vtype > (this);
- }
- vtype4_zyxz_ref < vtype > zyxz()
- {
- return vtype4_zyxz_ref < vtype > (this);
- }
- vtype4_zyxw_ref < vtype > zyxw()
- {
- return vtype4_zyxw_ref < vtype > (this);
- }
- vtype4_zyyx_ref < vtype > zyyx()
- {
- return vtype4_zyyx_ref < vtype > (this);
- }
- vtype4_zyyy_ref < vtype > zyyy()
- {
- return vtype4_zyyy_ref < vtype > (this);
- }
- vtype4_zyyz_ref < vtype > zyyz()
- {
- return vtype4_zyyz_ref < vtype > (this);
- }
- vtype4_zyyw_ref < vtype > zyyw()
- {
- return vtype4_zyyw_ref < vtype > (this);
- }
- vtype4_zyzx_ref < vtype > zyzx()
- {
- return vtype4_zyzx_ref < vtype > (this);
- }
- vtype4_zyzy_ref < vtype > zyzy()
- {
- return vtype4_zyzy_ref < vtype > (this);
- }
- vtype4_zyzz_ref < vtype > zyzz()
- {
- return vtype4_zyzz_ref < vtype > (this);
- }
- vtype4_zyzw_ref < vtype > zyzw()
- {
- return vtype4_zyzw_ref < vtype > (this);
- }
- vtype4_zywx_ref < vtype > zywx()
- {
- return vtype4_zywx_ref < vtype > (this);
- }
- vtype4_zywy_ref < vtype > zywy()
- {
- return vtype4_zywy_ref < vtype > (this);
- }
- vtype4_zywz_ref < vtype > zywz()
- {
- return vtype4_zywz_ref < vtype > (this);
- }
- vtype4_zyww_ref < vtype > zyww()
- {
- return vtype4_zyww_ref < vtype > (this);
- }
- vtype4_zzxx_ref < vtype > zzxx()
- {
- return vtype4_zzxx_ref < vtype > (this);
- }
- vtype4_zzxy_ref < vtype > zzxy()
- {
- return vtype4_zzxy_ref < vtype > (this);
- }
- vtype4_zzxz_ref < vtype > zzxz()
- {
- return vtype4_zzxz_ref < vtype > (this);
- }
- vtype4_zzxw_ref < vtype > zzxw()
- {
- return vtype4_zzxw_ref < vtype > (this);
- }
- vtype4_zzyx_ref < vtype > zzyx()
- {
- return vtype4_zzyx_ref < vtype > (this);
- }
- vtype4_zzyy_ref < vtype > zzyy()
- {
- return vtype4_zzyy_ref < vtype > (this);
- }
- vtype4_zzyz_ref < vtype > zzyz()
- {
- return vtype4_zzyz_ref < vtype > (this);
- }
- vtype4_zzyw_ref < vtype > zzyw()
- {
- return vtype4_zzyw_ref < vtype > (this);
- }
- vtype4_zzzx_ref < vtype > zzzx()
- {
- return vtype4_zzzx_ref < vtype > (this);
- }
- vtype4_zzzy_ref < vtype > zzzy()
- {
- return vtype4_zzzy_ref < vtype > (this);
- }
- vtype4_zzzz_ref < vtype > zzzz()
- {
- return vtype4_zzzz_ref < vtype > (this);
- }
- vtype4_zzzw_ref < vtype > zzzw()
- {
- return vtype4_zzzw_ref < vtype > (this);
- }
- vtype4_zzwx_ref < vtype > zzwx()
- {
- return vtype4_zzwx_ref < vtype > (this);
- }
- vtype4_zzwy_ref < vtype > zzwy()
- {
- return vtype4_zzwy_ref < vtype > (this);
- }
- vtype4_zzwz_ref < vtype > zzwz()
- {
- return vtype4_zzwz_ref < vtype > (this);
- }
- vtype4_zzww_ref < vtype > zzww()
- {
- return vtype4_zzww_ref < vtype > (this);
- }
- vtype4_zwxx_ref < vtype > zwxx()
- {
- return vtype4_zwxx_ref < vtype > (this);
- }
- vtype4_zwxy_ref < vtype > zwxy()
- {
- return vtype4_zwxy_ref < vtype > (this);
- }
- vtype4_zwxz_ref < vtype > zwxz()
- {
- return vtype4_zwxz_ref < vtype > (this);
- }
- vtype4_zwxw_ref < vtype > zwxw()
- {
- return vtype4_zwxw_ref < vtype > (this);
- }
- vtype4_zwyx_ref < vtype > zwyx()
- {
- return vtype4_zwyx_ref < vtype > (this);
- }
- vtype4_zwyy_ref < vtype > zwyy()
- {
- return vtype4_zwyy_ref < vtype > (this);
- }
- vtype4_zwyz_ref < vtype > zwyz()
- {
- return vtype4_zwyz_ref < vtype > (this);
- }
- vtype4_zwyw_ref < vtype > zwyw()
- {
- return vtype4_zwyw_ref < vtype > (this);
- }
- vtype4_zwzx_ref < vtype > zwzx()
- {
- return vtype4_zwzx_ref < vtype > (this);
- }
- vtype4_zwzy_ref < vtype > zwzy()
- {
- return vtype4_zwzy_ref < vtype > (this);
- }
- vtype4_zwzz_ref < vtype > zwzz()
- {
- return vtype4_zwzz_ref < vtype > (this);
- }
- vtype4_zwzw_ref < vtype > zwzw()
- {
- return vtype4_zwzw_ref < vtype > (this);
- }
- vtype4_zwwx_ref < vtype > zwwx()
- {
- return vtype4_zwwx_ref < vtype > (this);
- }
- vtype4_zwwy_ref < vtype > zwwy()
- {
- return vtype4_zwwy_ref < vtype > (this);
- }
- vtype4_zwwz_ref < vtype > zwwz()
- {
- return vtype4_zwwz_ref < vtype > (this);
- }
- vtype4_zwww_ref < vtype > zwww()
- {
- return vtype4_zwww_ref < vtype > (this);
- }
- vtype4_wxxx_ref < vtype > wxxx()
- {
- return vtype4_wxxx_ref < vtype > (this);
- }
- vtype4_wxxy_ref < vtype > wxxy()
- {
- return vtype4_wxxy_ref < vtype > (this);
- }
- vtype4_wxxz_ref < vtype > wxxz()
- {
- return vtype4_wxxz_ref < vtype > (this);
- }
- vtype4_wxxw_ref < vtype > wxxw()
- {
- return vtype4_wxxw_ref < vtype > (this);
- }
- vtype4_wxyx_ref < vtype > wxyx()
- {
- return vtype4_wxyx_ref < vtype > (this);
- }
- vtype4_wxyy_ref < vtype > wxyy()
- {
- return vtype4_wxyy_ref < vtype > (this);
- }
- vtype4_wxyz_ref < vtype > wxyz()
- {
- return vtype4_wxyz_ref < vtype > (this);
- }
- vtype4_wxyw_ref < vtype > wxyw()
- {
- return vtype4_wxyw_ref < vtype > (this);
- }
- vtype4_wxzx_ref < vtype > wxzx()
- {
- return vtype4_wxzx_ref < vtype > (this);
- }
- vtype4_wxzy_ref < vtype > wxzy()
- {
- return vtype4_wxzy_ref < vtype > (this);
- }
- vtype4_wxzz_ref < vtype > wxzz()
- {
- return vtype4_wxzz_ref < vtype > (this);
- }
- vtype4_wxzw_ref < vtype > wxzw()
- {
- return vtype4_wxzw_ref < vtype > (this);
- }
- vtype4_wxwx_ref < vtype > wxwx()
- {
- return vtype4_wxwx_ref < vtype > (this);
- }
- vtype4_wxwy_ref < vtype > wxwy()
- {
- return vtype4_wxwy_ref < vtype > (this);
- }
- vtype4_wxwz_ref < vtype > wxwz()
- {
- return vtype4_wxwz_ref < vtype > (this);
- }
- vtype4_wxww_ref < vtype > wxww()
- {
- return vtype4_wxww_ref < vtype > (this);
- }
- vtype4_wyxx_ref < vtype > wyxx()
- {
- return vtype4_wyxx_ref < vtype > (this);
- }
- vtype4_wyxy_ref < vtype > wyxy()
- {
- return vtype4_wyxy_ref < vtype > (this);
- }
- vtype4_wyxz_ref < vtype > wyxz()
- {
- return vtype4_wyxz_ref < vtype > (this);
- }
- vtype4_wyxw_ref < vtype > wyxw()
- {
- return vtype4_wyxw_ref < vtype > (this);
- }
- vtype4_wyyx_ref < vtype > wyyx()
- {
- return vtype4_wyyx_ref < vtype > (this);
- }
- vtype4_wyyy_ref < vtype > wyyy()
- {
- return vtype4_wyyy_ref < vtype > (this);
- }
- vtype4_wyyz_ref < vtype > wyyz()
- {
- return vtype4_wyyz_ref < vtype > (this);
- }
- vtype4_wyyw_ref < vtype > wyyw()
- {
- return vtype4_wyyw_ref < vtype > (this);
- }
- vtype4_wyzx_ref < vtype > wyzx()
- {
- return vtype4_wyzx_ref < vtype > (this);
- }
- vtype4_wyzy_ref < vtype > wyzy()
- {
- return vtype4_wyzy_ref < vtype > (this);
- }
- vtype4_wyzz_ref < vtype > wyzz()
- {
- return vtype4_wyzz_ref < vtype > (this);
- }
- vtype4_wyzw_ref < vtype > wyzw()
- {
- return vtype4_wyzw_ref < vtype > (this);
- }
- vtype4_wywx_ref < vtype > wywx()
- {
- return vtype4_wywx_ref < vtype > (this);
- }
- vtype4_wywy_ref < vtype > wywy()
- {
- return vtype4_wywy_ref < vtype > (this);
- }
- vtype4_wywz_ref < vtype > wywz()
- {
- return vtype4_wywz_ref < vtype > (this);
- }
- vtype4_wyww_ref < vtype > wyww()
- {
- return vtype4_wyww_ref < vtype > (this);
- }
- vtype4_wzxx_ref < vtype > wzxx()
- {
- return vtype4_wzxx_ref < vtype > (this);
- }
- vtype4_wzxy_ref < vtype > wzxy()
- {
- return vtype4_wzxy_ref < vtype > (this);
- }
- vtype4_wzxz_ref < vtype > wzxz()
- {
- return vtype4_wzxz_ref < vtype > (this);
- }
- vtype4_wzxw_ref < vtype > wzxw()
- {
- return vtype4_wzxw_ref < vtype > (this);
- }
- vtype4_wzyx_ref < vtype > wzyx()
- {
- return vtype4_wzyx_ref < vtype > (this);
- }
- vtype4_wzyy_ref < vtype > wzyy()
- {
- return vtype4_wzyy_ref < vtype > (this);
- }
- vtype4_wzyz_ref < vtype > wzyz()
- {
- return vtype4_wzyz_ref < vtype > (this);
- }
- vtype4_wzyw_ref < vtype > wzyw()
- {
- return vtype4_wzyw_ref < vtype > (this);
- }
- vtype4_wzzx_ref < vtype > wzzx()
- {
- return vtype4_wzzx_ref < vtype > (this);
- }
- vtype4_wzzy_ref < vtype > wzzy()
- {
- return vtype4_wzzy_ref < vtype > (this);
- }
- vtype4_wzzz_ref < vtype > wzzz()
- {
- return vtype4_wzzz_ref < vtype > (this);
- }
- vtype4_wzzw_ref < vtype > wzzw()
- {
- return vtype4_wzzw_ref < vtype > (this);
- }
- vtype4_wzwx_ref < vtype > wzwx()
- {
- return vtype4_wzwx_ref < vtype > (this);
- }
- vtype4_wzwy_ref < vtype > wzwy()
- {
- return vtype4_wzwy_ref < vtype > (this);
- }
- vtype4_wzwz_ref < vtype > wzwz()
- {
- return vtype4_wzwz_ref < vtype > (this);
- }
- vtype4_wzww_ref < vtype > wzww()
- {
- return vtype4_wzww_ref < vtype > (this);
- }
- vtype4_wwxx_ref < vtype > wwxx()
- {
- return vtype4_wwxx_ref < vtype > (this);
- }
- vtype4_wwxy_ref < vtype > wwxy()
- {
- return vtype4_wwxy_ref < vtype > (this);
- }
- vtype4_wwxz_ref < vtype > wwxz()
- {
- return vtype4_wwxz_ref < vtype > (this);
- }
- vtype4_wwxw_ref < vtype > wwxw()
- {
- return vtype4_wwxw_ref < vtype > (this);
- }
- vtype4_wwyx_ref < vtype > wwyx()
- {
- return vtype4_wwyx_ref < vtype > (this);
- }
- vtype4_wwyy_ref < vtype > wwyy()
- {
- return vtype4_wwyy_ref < vtype > (this);
- }
- vtype4_wwyz_ref < vtype > wwyz()
- {
- return vtype4_wwyz_ref < vtype > (this);
- }
- vtype4_wwyw_ref < vtype > wwyw()
- {
- return vtype4_wwyw_ref < vtype > (this);
- }
- vtype4_wwzx_ref < vtype > wwzx()
- {
- return vtype4_wwzx_ref < vtype > (this);
- }
- vtype4_wwzy_ref < vtype > wwzy()
- {
- return vtype4_wwzy_ref < vtype > (this);
- }
- vtype4_wwzz_ref < vtype > wwzz()
- {
- return vtype4_wwzz_ref < vtype > (this);
- }
- vtype4_wwzw_ref < vtype > wwzw()
- {
- return vtype4_wwzw_ref < vtype > (this);
- }
- vtype4_wwwx_ref < vtype > wwwx()
- {
- return vtype4_wwwx_ref < vtype > (this);
- }
- vtype4_wwwy_ref < vtype > wwwy()
- {
- return vtype4_wwwy_ref < vtype > (this);
- }
- vtype4_wwwz_ref < vtype > wwwz()
- {
- return vtype4_wwwz_ref < vtype > (this);
- }
- vtype4_wwww_ref < vtype > wwww()
- {
- return vtype4_wwww_ref < vtype > (this);
- }
-};
-
-template < typename vtype > vtype2_xy_ref < vtype > &vtype2_xy_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->x = other.x;
- v->y = other.y;
- return *this;
-}
-
-template < typename vtype > vtype2_yx_ref < vtype > &vtype2_yx_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->y = other.x;
- v->x = other.y;
- return *this;
-}
-
-template < typename vtype > vtype3_xy_ref < vtype > &vtype3_xy_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->x = other.x;
- v->y = other.y;
- return *this;
-}
-
-template < typename vtype > vtype3_xz_ref < vtype > &vtype3_xz_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->x = other.x;
- v->z = other.y;
- return *this;
-}
-
-template < typename vtype > vtype3_yx_ref < vtype > &vtype3_yx_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->y = other.x;
- v->x = other.y;
- return *this;
-}
-
-template < typename vtype > vtype3_yz_ref < vtype > &vtype3_yz_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->y = other.x;
- v->z = other.y;
- return *this;
-}
-
-template < typename vtype > vtype3_zx_ref < vtype > &vtype3_zx_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->z = other.x;
- v->x = other.y;
- return *this;
-}
-
-template < typename vtype > vtype3_zy_ref < vtype > &vtype3_zy_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->z = other.x;
- v->y = other.y;
- return *this;
-}
-
-template < typename vtype > vtype3_xyz_ref < vtype > &vtype3_xyz_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->x = other.x;
- v->y = other.y;
- v->z = other.z;
- return *this;
-}
-
-template < typename vtype > vtype3_xzy_ref < vtype > &vtype3_xzy_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->x = other.x;
- v->z = other.y;
- v->y = other.z;
- return *this;
-}
-
-template < typename vtype > vtype3_yxz_ref < vtype > &vtype3_yxz_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->y = other.x;
- v->x = other.y;
- v->z = other.z;
- return *this;
-}
-
-template < typename vtype > vtype3_yzx_ref < vtype > &vtype3_yzx_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->y = other.x;
- v->z = other.y;
- v->x = other.z;
- return *this;
-}
-
-template < typename vtype > vtype3_zxy_ref < vtype > &vtype3_zxy_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->z = other.x;
- v->x = other.y;
- v->y = other.z;
- return *this;
-}
-
-template < typename vtype > vtype3_zyx_ref < vtype > &vtype3_zyx_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->z = other.x;
- v->y = other.y;
- v->x = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_xy_ref < vtype > &vtype4_xy_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->x = other.x;
- v->y = other.y;
- return *this;
-}
-
-template < typename vtype > vtype4_xz_ref < vtype > &vtype4_xz_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->x = other.x;
- v->z = other.y;
- return *this;
-}
-
-template < typename vtype > vtype4_xw_ref < vtype > &vtype4_xw_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->x = other.x;
- v->w = other.y;
- return *this;
-}
-
-template < typename vtype > vtype4_yx_ref < vtype > &vtype4_yx_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->y = other.x;
- v->x = other.y;
- return *this;
-}
-
-template < typename vtype > vtype4_yz_ref < vtype > &vtype4_yz_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->y = other.x;
- v->z = other.y;
- return *this;
-}
-
-template < typename vtype > vtype4_yw_ref < vtype > &vtype4_yw_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->y = other.x;
- v->w = other.y;
- return *this;
-}
-
-template < typename vtype > vtype4_zx_ref < vtype > &vtype4_zx_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->z = other.x;
- v->x = other.y;
- return *this;
-}
-
-template < typename vtype > vtype4_zy_ref < vtype > &vtype4_zy_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->z = other.x;
- v->y = other.y;
- return *this;
-}
-
-template < typename vtype > vtype4_zw_ref < vtype > &vtype4_zw_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->z = other.x;
- v->w = other.y;
- return *this;
-}
-
-template < typename vtype > vtype4_wx_ref < vtype > &vtype4_wx_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->w = other.x;
- v->x = other.y;
- return *this;
-}
-
-template < typename vtype > vtype4_wy_ref < vtype > &vtype4_wy_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->w = other.x;
- v->y = other.y;
- return *this;
-}
-
-template < typename vtype > vtype4_wz_ref < vtype > &vtype4_wz_ref < vtype >::operator=(const vtype2 < vtype > &other)
-{
- v->w = other.x;
- v->z = other.y;
- return *this;
-}
-
-template < typename vtype > vtype4_xyz_ref < vtype > &vtype4_xyz_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->x = other.x;
- v->y = other.y;
- v->z = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_xyw_ref < vtype > &vtype4_xyw_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->x = other.x;
- v->y = other.y;
- v->w = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_xzy_ref < vtype > &vtype4_xzy_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->x = other.x;
- v->z = other.y;
- v->y = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_xzw_ref < vtype > &vtype4_xzw_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->x = other.x;
- v->z = other.y;
- v->w = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_xwy_ref < vtype > &vtype4_xwy_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->x = other.x;
- v->w = other.y;
- v->y = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_xwz_ref < vtype > &vtype4_xwz_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->x = other.x;
- v->w = other.y;
- v->z = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_yxz_ref < vtype > &vtype4_yxz_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->y = other.x;
- v->x = other.y;
- v->z = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_yxw_ref < vtype > &vtype4_yxw_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->y = other.x;
- v->x = other.y;
- v->w = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_yzx_ref < vtype > &vtype4_yzx_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->y = other.x;
- v->z = other.y;
- v->x = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_yzw_ref < vtype > &vtype4_yzw_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->y = other.x;
- v->z = other.y;
- v->w = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_ywx_ref < vtype > &vtype4_ywx_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->y = other.x;
- v->w = other.y;
- v->x = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_ywz_ref < vtype > &vtype4_ywz_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->y = other.x;
- v->w = other.y;
- v->z = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_zxy_ref < vtype > &vtype4_zxy_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->z = other.x;
- v->x = other.y;
- v->y = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_zxw_ref < vtype > &vtype4_zxw_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->z = other.x;
- v->x = other.y;
- v->w = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_zyx_ref < vtype > &vtype4_zyx_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->z = other.x;
- v->y = other.y;
- v->x = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_zyw_ref < vtype > &vtype4_zyw_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->z = other.x;
- v->y = other.y;
- v->w = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_zwx_ref < vtype > &vtype4_zwx_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->z = other.x;
- v->w = other.y;
- v->x = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_zwy_ref < vtype > &vtype4_zwy_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->z = other.x;
- v->w = other.y;
- v->y = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_wxy_ref < vtype > &vtype4_wxy_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->w = other.x;
- v->x = other.y;
- v->y = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_wxz_ref < vtype > &vtype4_wxz_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->w = other.x;
- v->x = other.y;
- v->z = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_wyx_ref < vtype > &vtype4_wyx_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->w = other.x;
- v->y = other.y;
- v->x = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_wyz_ref < vtype > &vtype4_wyz_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->w = other.x;
- v->y = other.y;
- v->z = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_wzx_ref < vtype > &vtype4_wzx_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->w = other.x;
- v->z = other.y;
- v->x = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_wzy_ref < vtype > &vtype4_wzy_ref < vtype >::operator=(const vtype3 < vtype > &other)
-{
- v->w = other.x;
- v->z = other.y;
- v->y = other.z;
- return *this;
-}
-
-template < typename vtype > vtype4_xyzw_ref < vtype > &vtype4_xyzw_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->x = other.x;
- v->y = other.y;
- v->z = other.z;
- v->w = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_xywz_ref < vtype > &vtype4_xywz_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->x = other.x;
- v->y = other.y;
- v->w = other.z;
- v->z = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_xzyw_ref < vtype > &vtype4_xzyw_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->x = other.x;
- v->z = other.y;
- v->y = other.z;
- v->w = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_xzwy_ref < vtype > &vtype4_xzwy_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->x = other.x;
- v->z = other.y;
- v->w = other.z;
- v->y = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_xwyz_ref < vtype > &vtype4_xwyz_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->x = other.x;
- v->w = other.y;
- v->y = other.z;
- v->z = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_xwzy_ref < vtype > &vtype4_xwzy_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->x = other.x;
- v->w = other.y;
- v->z = other.z;
- v->y = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_yxzw_ref < vtype > &vtype4_yxzw_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->y = other.x;
- v->x = other.y;
- v->z = other.z;
- v->w = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_yxwz_ref < vtype > &vtype4_yxwz_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->y = other.x;
- v->x = other.y;
- v->w = other.z;
- v->z = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_yzxw_ref < vtype > &vtype4_yzxw_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->y = other.x;
- v->z = other.y;
- v->x = other.z;
- v->w = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_yzwx_ref < vtype > &vtype4_yzwx_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->y = other.x;
- v->z = other.y;
- v->w = other.z;
- v->x = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_ywxz_ref < vtype > &vtype4_ywxz_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->y = other.x;
- v->w = other.y;
- v->x = other.z;
- v->z = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_ywzx_ref < vtype > &vtype4_ywzx_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->y = other.x;
- v->w = other.y;
- v->z = other.z;
- v->x = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_zxyw_ref < vtype > &vtype4_zxyw_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->z = other.x;
- v->x = other.y;
- v->y = other.z;
- v->w = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_zxwy_ref < vtype > &vtype4_zxwy_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->z = other.x;
- v->x = other.y;
- v->w = other.z;
- v->y = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_zyxw_ref < vtype > &vtype4_zyxw_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->z = other.x;
- v->y = other.y;
- v->x = other.z;
- v->w = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_zywx_ref < vtype > &vtype4_zywx_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->z = other.x;
- v->y = other.y;
- v->w = other.z;
- v->x = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_zwxy_ref < vtype > &vtype4_zwxy_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->z = other.x;
- v->w = other.y;
- v->x = other.z;
- v->y = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_zwyx_ref < vtype > &vtype4_zwyx_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->z = other.x;
- v->w = other.y;
- v->y = other.z;
- v->x = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_wxyz_ref < vtype > &vtype4_wxyz_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->w = other.x;
- v->x = other.y;
- v->y = other.z;
- v->z = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_wxzy_ref < vtype > &vtype4_wxzy_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->w = other.x;
- v->x = other.y;
- v->z = other.z;
- v->y = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_wyxz_ref < vtype > &vtype4_wyxz_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->w = other.x;
- v->y = other.y;
- v->x = other.z;
- v->z = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_wyzx_ref < vtype > &vtype4_wyzx_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->w = other.x;
- v->y = other.y;
- v->z = other.z;
- v->x = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_wzxy_ref < vtype > &vtype4_wzxy_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->w = other.x;
- v->z = other.y;
- v->x = other.z;
- v->y = other.w;
- return *this;
-}
-
-template < typename vtype > vtype4_wzyx_ref < vtype > &vtype4_wzyx_ref < vtype >::operator=(const vtype4 < vtype > &other)
-{
- v->w = other.x;
- v->z = other.y;
- v->y = other.z;
- v->x = other.w;
- return *this;
-}
-
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype2_xx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype2_xy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype2_yx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype2_yy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype3_xx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype3_xy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype3_xz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype3_yx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype3_yy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype3_yz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype3_zx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype3_zy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype3_zz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_xx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_xy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_xz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_xw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_yx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_yy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_yz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_yw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_zx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_zy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_zz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_zw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_wx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_wy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_wz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
-}
-template < typename vtype > vtype2 < vtype >::vtype2(const vtype4_ww_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype2_xxx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype2_xxy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype2_xyx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype2_xyy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype2_yxx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype2_yxy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype2_yyx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype2_yyy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_xxx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_xxy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_xxz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_xyx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_xyy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_xyz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_xzx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_xzy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_xzz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_yxx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_yxy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_yxz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_yyx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_yyy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_yyz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_yzx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_yzy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_yzz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_zxx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_zxy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_zxz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_zyx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_zyy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_zyz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_zzx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_zzy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype3_zzz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xxx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xxy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xxz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xxw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xyx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xyy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xyz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xyw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xzx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xzy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xzz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xzw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xwx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xwy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xwz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_xww_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_yxx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_yxy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_yxz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_yxw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_yyx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_yyy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_yyz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_yyw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_yzx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_yzy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_yzz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_yzw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_ywx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_ywy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_ywz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_yww_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zxx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zxy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zxz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zxw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zyx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zyy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zyz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zyw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zzx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zzy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zzz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zzw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zwx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zwy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zwz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_zww_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wxx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wxy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wxz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wxw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wyx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wyy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wyz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wyw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wzx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wzy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wzz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wzw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->w;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wwx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->x;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wwy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->y;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_wwz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->z;
-}
-template < typename vtype > vtype3 < vtype >::vtype3(const vtype4_www_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_xxxx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_xxxy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_xxyx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_xxyy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_xyxx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_xyxy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_xyyx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_xyyy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_yxxx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_yxxy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_yxyx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_yxyy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_yyxx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_yyxy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_yyyx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype2_yyyy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xxxx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xxxy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xxxz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xxyx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xxyy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xxyz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xxzx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xxzy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xxzz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xyxx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xyxy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xyxz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xyyx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xyyy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xyyz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xyzx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xyzy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xyzz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xzxx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xzxy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xzxz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xzyx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xzyy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xzyz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xzzx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xzzy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_xzzz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yxxx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yxxy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yxxz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yxyx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yxyy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yxyz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yxzx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yxzy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yxzz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yyxx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yyxy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yyxz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yyyx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yyyy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yyyz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yyzx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yyzy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yyzz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yzxx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yzxy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yzxz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yzyx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yzyy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yzyz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yzzx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yzzy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_yzzz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zxxx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zxxy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zxxz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zxyx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zxyy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zxyz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zxzx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zxzy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zxzz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zyxx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zyxy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zyxz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zyyx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zyyy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zyyz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zyzx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zyzy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zyzz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zzxx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zzxy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zzxz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zzyx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zzyy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zzyz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zzzx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zzzy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype3_zzzz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxxx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxxy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxxz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxxw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxyx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxyy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxyz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxyw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxzx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxzy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxzz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxzw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxwx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxwy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxwz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xxww_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->x;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xyxx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xyxy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xyxz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xyxw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xyyx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xyyy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xyyz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xyyw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xyzx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xyzy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xyzz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xyzw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xywx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xywy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xywz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xyww_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->y;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzxx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzxy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzxz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzxw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzyx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzyy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzyz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzyw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzzx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzzy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzzz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzzw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzwx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzwy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzwz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xzww_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->z;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwxx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwxy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwxz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwxw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwyx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwyy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwyz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwyw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwzx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwzy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwzz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwzw_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwwx_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwwy_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwwz_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_xwww_ref < vtype > &v)
-{
- x = v.v->x;
- y = v.v->w;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxxx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxxy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxxz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxxw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxyx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxyy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxyz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxyw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxzx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxzy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxzz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxzw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxwx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxwy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxwz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yxww_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->x;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yyxx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yyxy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yyxz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yyxw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yyyx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yyyy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yyyz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yyyw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yyzx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yyzy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yyzz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yyzw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yywx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yywy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yywz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yyww_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->y;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzxx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzxy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzxz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzxw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzyx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzyy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzyz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzyw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzzx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzzy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzzz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzzw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzwx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzwy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzwz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_yzww_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->z;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywxx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywxy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywxz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywxw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywyx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywyy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywyz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywyw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywzx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywzy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywzz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywzw_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywwx_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywwy_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywwz_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_ywww_ref < vtype > &v)
-{
- x = v.v->y;
- y = v.v->w;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxxx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxxy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxxz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxxw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxyx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxyy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxyz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxyw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxzx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxzy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxzz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxzw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxwx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxwy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxwz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zxww_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->x;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zyxx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zyxy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zyxz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zyxw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zyyx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zyyy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zyyz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zyyw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zyzx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zyzy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zyzz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zyzw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zywx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zywy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zywz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zyww_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->y;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzxx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzxy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzxz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzxw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzyx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzyy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzyz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzyw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzzx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzzy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzzz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzzw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzwx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzwy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzwz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zzww_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->z;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwxx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwxy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwxz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwxw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwyx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwyy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwyz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwyw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwzx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwzy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwzz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwzw_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwwx_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwwy_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwwz_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_zwww_ref < vtype > &v)
-{
- x = v.v->z;
- y = v.v->w;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxxx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxxy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxxz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxxw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxyx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxyy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxyz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxyw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxzx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxzy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxzz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxzw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxwx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxwy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxwz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wxww_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->x;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wyxx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wyxy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wyxz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wyxw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wyyx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wyyy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wyyz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wyyw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wyzx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wyzy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wyzz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wyzw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wywx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wywy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wywz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wyww_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->y;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzxx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzxy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzxz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzxw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzyx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzyy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzyz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzyw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzzx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzzy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzzz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzzw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzwx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzwy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzwz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wzww_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->z;
- z = v.v->w;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwxx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->x;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwxy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->x;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwxz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->x;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwxw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->x;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwyx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->y;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwyy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->y;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwyz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->y;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwyw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->y;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwzx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->z;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwzy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->z;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwzz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->z;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwzw_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->z;
- w = v.v->w;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwwx_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->w;
- w = v.v->x;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwwy_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->w;
- w = v.v->y;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwwz_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->w;
- w = v.v->z;
-}
-template < typename vtype > vtype4 < vtype >::vtype4(const vtype4_wwww_ref < vtype > &v)
-{
- x = v.v->w;
- y = v.v->w;
- z = v.v->w;
- w = v.v->w;
-}
-typedef vtype2 < float >float2;
-typedef vtype3 < float >float3;
-typedef vtype4 < float >float4;
-typedef vtype2 < double >double2;
-typedef vtype3 < double >double3;
-typedef vtype4 < double >double4;
-typedef vtype2 < int32_t >int2;
-typedef vtype3 < int32_t >int3;
-typedef vtype4 < int32_t >int4;
-typedef vtype2 < uint > uint2;
-typedef vtype3 < uint > uint3;
-typedef vtype4 < uint > uint4;
-typedef vtype2 < int16_t >short2;
-typedef vtype3 < int16_t >short3;
-typedef vtype4 < int16_t >short4;
-typedef vtype2 < ushort > ushort2;
-typedef vtype3 < ushort > ushort3;
-typedef vtype4 < ushort > ushort4;
-typedef vtype2 < int64_t >long2;
-typedef vtype3 < int64_t >long3;
-typedef vtype4 < int64_t >long4;
-typedef vtype2 < ulong > ulong2;
-typedef vtype3 < ulong > ulong3;
-typedef vtype4 < ulong > ulong4;
-static inline float2 operator+(float2 p, float2 q)
-{
- return float2(p.x + q.x, p.y + q.y);
-}
-static inline float3 operator+(float3 p, float3 q)
-{
- return float3(p.x + q.x, p.y + q.y, p.z + q.z);
-}
-static inline float4 operator+(float4 p, float4 q)
-{
- return float4(p.x + q.x, p.y + q.y, p.z + q.z, p.w + q.w);
-}
-static inline float2 operator+(float2 p, float q)
-{
- return float2(p.x + q, p.y + q);
-}
-static inline float3 operator+(float3 p, float q)
-{
- return float3(p.x + q, p.y + q, p.z + q);
-}
-static inline float4 operator+(float4 p, float q)
-{
- return float4(p.x + q, p.y + q, p.z + q, p.w + q);
-}
-static inline float2 operator+(float p, float2 q)
-{
- return float2(p + q.x, p + q.y);
-}
-static inline float3 operator+(float p, float3 q)
-{
- return float3(p + q.x, p + q.y, p + q.z);
-}
-static inline float4 operator+(float p, float4 q)
-{
- return float4(p + q.x, p + q.y, p + q.z, p + q.w);
-}
-static inline double2 operator+(double2 p, double2 q)
-{
- return double2(p.x + q.x, p.y + q.y);
-}
-static inline double3 operator+(double3 p, double3 q)
-{
- return double3(p.x + q.x, p.y + q.y, p.z + q.z);
-}
-static inline double4 operator+(double4 p, double4 q)
-{
- return double4(p.x + q.x, p.y + q.y, p.z + q.z, p.w + q.w);
-}
-static inline double2 operator+(double2 p, double q)
-{
- return double2(p.x + q, p.y + q);
-}
-static inline double3 operator+(double3 p, double q)
-{
- return double3(p.x + q, p.y + q, p.z + q);
-}
-static inline double4 operator+(double4 p, double q)
-{
- return double4(p.x + q, p.y + q, p.z + q, p.w + q);
-}
-static inline double2 operator+(double p, double2 q)
-{
- return double2(p + q.x, p + q.y);
-}
-static inline double3 operator+(double p, double3 q)
-{
- return double3(p + q.x, p + q.y, p + q.z);
-}
-static inline double4 operator+(double p, double4 q)
-{
- return double4(p + q.x, p + q.y, p + q.z, p + q.w);
-}
-static inline int2 operator+(int2 p, int2 q)
-{
- return int2(p.x + q.x, p.y + q.y);
-}
-static inline int3 operator+(int3 p, int3 q)
-{
- return int3(p.x + q.x, p.y + q.y, p.z + q.z);
-}
-static inline int4 operator+(int4 p, int4 q)
-{
- return int4(p.x + q.x, p.y + q.y, p.z + q.z, p.w + q.w);
-}
-static inline int2 operator+(int2 p, int q)
-{
- return int2(p.x + q, p.y + q);
-}
-static inline int3 operator+(int3 p, int q)
-{
- return int3(p.x + q, p.y + q, p.z + q);
-}
-static inline int4 operator+(int4 p, int q)
-{
- return int4(p.x + q, p.y + q, p.z + q, p.w + q);
-}
-static inline int2 operator+(int p, int2 q)
-{
- return int2(p + q.x, p + q.y);
-}
-static inline int3 operator+(int p, int3 q)
-{
- return int3(p + q.x, p + q.y, p + q.z);
-}
-static inline int4 operator+(int p, int4 q)
-{
- return int4(p + q.x, p + q.y, p + q.z, p + q.w);
-}
-static inline uint2 operator+(uint2 p, uint2 q)
-{
- return uint2(p.x + q.x, p.y + q.y);
-}
-static inline uint3 operator+(uint3 p, uint3 q)
-{
- return uint3(p.x + q.x, p.y + q.y, p.z + q.z);
-}
-static inline uint4 operator+(uint4 p, uint4 q)
-{
- return uint4(p.x + q.x, p.y + q.y, p.z + q.z, p.w + q.w);
-}
-static inline uint2 operator+(uint2 p, uint q)
-{
- return uint2(p.x + q, p.y + q);
-}
-static inline uint3 operator+(uint3 p, uint q)
-{
- return uint3(p.x + q, p.y + q, p.z + q);
-}
-static inline uint4 operator+(uint4 p, uint q)
-{
- return uint4(p.x + q, p.y + q, p.z + q, p.w + q);
-}
-static inline uint2 operator+(uint p, uint2 q)
-{
- return uint2(p + q.x, p + q.y);
-}
-static inline uint3 operator+(uint p, uint3 q)
-{
- return uint3(p + q.x, p + q.y, p + q.z);
-}
-static inline uint4 operator+(uint p, uint4 q)
-{
- return uint4(p + q.x, p + q.y, p + q.z, p + q.w);
-}
-static inline short2 operator+(short2 p, short2 q)
-{
- return short2(p.x + q.x, p.y + q.y);
-}
-static inline short3 operator+(short3 p, short3 q)
-{
- return short3(p.x + q.x, p.y + q.y, p.z + q.z);
-}
-static inline short4 operator+(short4 p, short4 q)
-{
- return short4(p.x + q.x, p.y + q.y, p.z + q.z, p.w + q.w);
-}
-static inline short2 operator+(short2 p, short q)
-{
- return short2(p.x + q, p.y + q);
-}
-static inline short3 operator+(short3 p, short q)
-{
- return short3(p.x + q, p.y + q, p.z + q);
-}
-static inline short4 operator+(short4 p, short q)
-{
- return short4(p.x + q, p.y + q, p.z + q, p.w + q);
-}
-static inline short2 operator+(short p, short2 q)
-{
- return short2(p + q.x, p + q.y);
-}
-static inline short3 operator+(short p, short3 q)
-{
- return short3(p + q.x, p + q.y, p + q.z);
-}
-static inline short4 operator+(short p, short4 q)
-{
- return short4(p + q.x, p + q.y, p + q.z, p + q.w);
-}
-static inline ushort2 operator+(ushort2 p, ushort2 q)
-{
- return ushort2(p.x + q.x, p.y + q.y);
-}
-static inline ushort3 operator+(ushort3 p, ushort3 q)
-{
- return ushort3(p.x + q.x, p.y + q.y, p.z + q.z);
-}
-static inline ushort4 operator+(ushort4 p, ushort4 q)
-{
- return ushort4(p.x + q.x, p.y + q.y, p.z + q.z, p.w + q.w);
-}
-static inline ushort2 operator+(ushort2 p, ushort q)
-{
- return ushort2(p.x + q, p.y + q);
-}
-static inline ushort3 operator+(ushort3 p, ushort q)
-{
- return ushort3(p.x + q, p.y + q, p.z + q);
-}
-static inline ushort4 operator+(ushort4 p, ushort q)
-{
- return ushort4(p.x + q, p.y + q, p.z + q, p.w + q);
-}
-static inline ushort2 operator+(ushort p, ushort2 q)
-{
- return ushort2(p + q.x, p + q.y);
-}
-static inline ushort3 operator+(ushort p, ushort3 q)
-{
- return ushort3(p + q.x, p + q.y, p + q.z);
-}
-static inline ushort4 operator+(ushort p, ushort4 q)
-{
- return ushort4(p + q.x, p + q.y, p + q.z, p + q.w);
-}
-static inline long2 operator+(long2 p, long2 q)
-{
- return long2(p.x + q.x, p.y + q.y);
-}
-static inline long3 operator+(long3 p, long3 q)
-{
- return long3(p.x + q.x, p.y + q.y, p.z + q.z);
-}
-static inline long4 operator+(long4 p, long4 q)
-{
- return long4(p.x + q.x, p.y + q.y, p.z + q.z, p.w + q.w);
-}
-static inline long2 operator+(long2 p, long q)
-{
- return long2(p.x + q, p.y + q);
-}
-static inline long3 operator+(long3 p, long q)
-{
- return long3(p.x + q, p.y + q, p.z + q);
-}
-static inline long4 operator+(long4 p, long q)
-{
- return long4(p.x + q, p.y + q, p.z + q, p.w + q);
-}
-static inline long2 operator+(long p, long2 q)
-{
- return long2(p + q.x, p + q.y);
-}
-static inline long3 operator+(long p, long3 q)
-{
- return long3(p + q.x, p + q.y, p + q.z);
-}
-static inline long4 operator+(long p, long4 q)
-{
- return long4(p + q.x, p + q.y, p + q.z, p + q.w);
-}
-static inline ulong2 operator+(ulong2 p, ulong2 q)
-{
- return ulong2(p.x + q.x, p.y + q.y);
-}
-static inline ulong3 operator+(ulong3 p, ulong3 q)
-{
- return ulong3(p.x + q.x, p.y + q.y, p.z + q.z);
-}
-static inline ulong4 operator+(ulong4 p, ulong4 q)
-{
- return ulong4(p.x + q.x, p.y + q.y, p.z + q.z, p.w + q.w);
-}
-static inline ulong2 operator+(ulong2 p, ulong q)
-{
- return ulong2(p.x + q, p.y + q);
-}
-static inline ulong3 operator+(ulong3 p, ulong q)
-{
- return ulong3(p.x + q, p.y + q, p.z + q);
-}
-static inline ulong4 operator+(ulong4 p, ulong q)
-{
- return ulong4(p.x + q, p.y + q, p.z + q, p.w + q);
-}
-static inline ulong2 operator+(ulong p, ulong2 q)
-{
- return ulong2(p + q.x, p + q.y);
-}
-static inline ulong3 operator+(ulong p, ulong3 q)
-{
- return ulong3(p + q.x, p + q.y, p + q.z);
-}
-static inline ulong4 operator+(ulong p, ulong4 q)
-{
- return ulong4(p + q.x, p + q.y, p + q.z, p + q.w);
-}
-static inline float2 operator-(float2 p, float2 q)
-{
- return float2(p.x - q.x, p.y - q.y);
-}
-static inline float3 operator-(float3 p, float3 q)
-{
- return float3(p.x - q.x, p.y - q.y, p.z - q.z);
-}
-static inline float4 operator-(float4 p, float4 q)
-{
- return float4(p.x - q.x, p.y - q.y, p.z - q.z, p.w - q.w);
-}
-static inline float2 operator-(float2 p, float q)
-{
- return float2(p.x - q, p.y - q);
-}
-static inline float3 operator-(float3 p, float q)
-{
- return float3(p.x - q, p.y - q, p.z - q);
-}
-static inline float4 operator-(float4 p, float q)
-{
- return float4(p.x - q, p.y - q, p.z - q, p.w - q);
-}
-static inline float2 operator-(float p, float2 q)
-{
- return float2(p - q.x, p - q.y);
-}
-static inline float3 operator-(float p, float3 q)
-{
- return float3(p - q.x, p - q.y, p - q.z);
-}
-static inline float4 operator-(float p, float4 q)
-{
- return float4(p - q.x, p - q.y, p - q.z, p - q.w);
-}
-static inline double2 operator-(double2 p, double2 q)
-{
- return double2(p.x - q.x, p.y - q.y);
-}
-static inline double3 operator-(double3 p, double3 q)
-{
- return double3(p.x - q.x, p.y - q.y, p.z - q.z);
-}
-static inline double4 operator-(double4 p, double4 q)
-{
- return double4(p.x - q.x, p.y - q.y, p.z - q.z, p.w - q.w);
-}
-static inline double2 operator-(double2 p, double q)
-{
- return double2(p.x - q, p.y - q);
-}
-static inline double3 operator-(double3 p, double q)
-{
- return double3(p.x - q, p.y - q, p.z - q);
-}
-static inline double4 operator-(double4 p, double q)
-{
- return double4(p.x - q, p.y - q, p.z - q, p.w - q);
-}
-static inline double2 operator-(double p, double2 q)
-{
- return double2(p - q.x, p - q.y);
-}
-static inline double3 operator-(double p, double3 q)
-{
- return double3(p - q.x, p - q.y, p - q.z);
-}
-static inline double4 operator-(double p, double4 q)
-{
- return double4(p - q.x, p - q.y, p - q.z, p - q.w);
-}
-static inline int2 operator-(int2 p, int2 q)
-{
- return int2(p.x - q.x, p.y - q.y);
-}
-static inline int3 operator-(int3 p, int3 q)
-{
- return int3(p.x - q.x, p.y - q.y, p.z - q.z);
-}
-static inline int4 operator-(int4 p, int4 q)
-{
- return int4(p.x - q.x, p.y - q.y, p.z - q.z, p.w - q.w);
-}
-static inline int2 operator-(int2 p, int q)
-{
- return int2(p.x - q, p.y - q);
-}
-static inline int3 operator-(int3 p, int q)
-{
- return int3(p.x - q, p.y - q, p.z - q);
-}
-static inline int4 operator-(int4 p, int q)
-{
- return int4(p.x - q, p.y - q, p.z - q, p.w - q);
-}
-static inline int2 operator-(int p, int2 q)
-{
- return int2(p - q.x, p - q.y);
-}
-static inline int3 operator-(int p, int3 q)
-{
- return int3(p - q.x, p - q.y, p - q.z);
-}
-static inline int4 operator-(int p, int4 q)
-{
- return int4(p - q.x, p - q.y, p - q.z, p - q.w);
-}
-static inline uint2 operator-(uint2 p, uint2 q)
-{
- return uint2(p.x - q.x, p.y - q.y);
-}
-static inline uint3 operator-(uint3 p, uint3 q)
-{
- return uint3(p.x - q.x, p.y - q.y, p.z - q.z);
-}
-static inline uint4 operator-(uint4 p, uint4 q)
-{
- return uint4(p.x - q.x, p.y - q.y, p.z - q.z, p.w - q.w);
-}
-static inline uint2 operator-(uint2 p, uint q)
-{
- return uint2(p.x - q, p.y - q);
-}
-static inline uint3 operator-(uint3 p, uint q)
-{
- return uint3(p.x - q, p.y - q, p.z - q);
-}
-static inline uint4 operator-(uint4 p, uint q)
-{
- return uint4(p.x - q, p.y - q, p.z - q, p.w - q);
-}
-static inline uint2 operator-(uint p, uint2 q)
-{
- return uint2(p - q.x, p - q.y);
-}
-static inline uint3 operator-(uint p, uint3 q)
-{
- return uint3(p - q.x, p - q.y, p - q.z);
-}
-static inline uint4 operator-(uint p, uint4 q)
-{
- return uint4(p - q.x, p - q.y, p - q.z, p - q.w);
-}
-static inline short2 operator-(short2 p, short2 q)
-{
- return short2(p.x - q.x, p.y - q.y);
-}
-static inline short3 operator-(short3 p, short3 q)
-{
- return short3(p.x - q.x, p.y - q.y, p.z - q.z);
-}
-static inline short4 operator-(short4 p, short4 q)
-{
- return short4(p.x - q.x, p.y - q.y, p.z - q.z, p.w - q.w);
-}
-static inline short2 operator-(short2 p, short q)
-{
- return short2(p.x - q, p.y - q);
-}
-static inline short3 operator-(short3 p, short q)
-{
- return short3(p.x - q, p.y - q, p.z - q);
-}
-static inline short4 operator-(short4 p, short q)
-{
- return short4(p.x - q, p.y - q, p.z - q, p.w - q);
-}
-static inline short2 operator-(short p, short2 q)
-{
- return short2(p - q.x, p - q.y);
-}
-static inline short3 operator-(short p, short3 q)
-{
- return short3(p - q.x, p - q.y, p - q.z);
-}
-static inline short4 operator-(short p, short4 q)
-{
- return short4(p - q.x, p - q.y, p - q.z, p - q.w);
-}
-static inline ushort2 operator-(ushort2 p, ushort2 q)
-{
- return ushort2(p.x - q.x, p.y - q.y);
-}
-static inline ushort3 operator-(ushort3 p, ushort3 q)
-{
- return ushort3(p.x - q.x, p.y - q.y, p.z - q.z);
-}
-static inline ushort4 operator-(ushort4 p, ushort4 q)
-{
- return ushort4(p.x - q.x, p.y - q.y, p.z - q.z, p.w - q.w);
-}
-static inline ushort2 operator-(ushort2 p, ushort q)
-{
- return ushort2(p.x - q, p.y - q);
-}
-static inline ushort3 operator-(ushort3 p, ushort q)
-{
- return ushort3(p.x - q, p.y - q, p.z - q);
-}
-static inline ushort4 operator-(ushort4 p, ushort q)
-{
- return ushort4(p.x - q, p.y - q, p.z - q, p.w - q);
-}
-static inline ushort2 operator-(ushort p, ushort2 q)
-{
- return ushort2(p - q.x, p - q.y);
-}
-static inline ushort3 operator-(ushort p, ushort3 q)
-{
- return ushort3(p - q.x, p - q.y, p - q.z);
-}
-static inline ushort4 operator-(ushort p, ushort4 q)
-{
- return ushort4(p - q.x, p - q.y, p - q.z, p - q.w);
-}
-static inline long2 operator-(long2 p, long2 q)
-{
- return long2(p.x - q.x, p.y - q.y);
-}
-static inline long3 operator-(long3 p, long3 q)
-{
- return long3(p.x - q.x, p.y - q.y, p.z - q.z);
-}
-static inline long4 operator-(long4 p, long4 q)
-{
- return long4(p.x - q.x, p.y - q.y, p.z - q.z, p.w - q.w);
-}
-static inline long2 operator-(long2 p, long q)
-{
- return long2(p.x - q, p.y - q);
-}
-static inline long3 operator-(long3 p, long q)
-{
- return long3(p.x - q, p.y - q, p.z - q);
-}
-static inline long4 operator-(long4 p, long q)
-{
- return long4(p.x - q, p.y - q, p.z - q, p.w - q);
-}
-static inline long2 operator-(long p, long2 q)
-{
- return long2(p - q.x, p - q.y);
-}
-static inline long3 operator-(long p, long3 q)
-{
- return long3(p - q.x, p - q.y, p - q.z);
-}
-static inline long4 operator-(long p, long4 q)
-{
- return long4(p - q.x, p - q.y, p - q.z, p - q.w);
-}
-static inline ulong2 operator-(ulong2 p, ulong2 q)
-{
- return ulong2(p.x - q.x, p.y - q.y);
-}
-static inline ulong3 operator-(ulong3 p, ulong3 q)
-{
- return ulong3(p.x - q.x, p.y - q.y, p.z - q.z);
-}
-static inline ulong4 operator-(ulong4 p, ulong4 q)
-{
- return ulong4(p.x - q.x, p.y - q.y, p.z - q.z, p.w - q.w);
-}
-static inline ulong2 operator-(ulong2 p, ulong q)
-{
- return ulong2(p.x - q, p.y - q);
-}
-static inline ulong3 operator-(ulong3 p, ulong q)
-{
- return ulong3(p.x - q, p.y - q, p.z - q);
-}
-static inline ulong4 operator-(ulong4 p, ulong q)
-{
- return ulong4(p.x - q, p.y - q, p.z - q, p.w - q);
-}
-static inline ulong2 operator-(ulong p, ulong2 q)
-{
- return ulong2(p - q.x, p - q.y);
-}
-static inline ulong3 operator-(ulong p, ulong3 q)
-{
- return ulong3(p - q.x, p - q.y, p - q.z);
-}
-static inline ulong4 operator-(ulong p, ulong4 q)
-{
- return ulong4(p - q.x, p - q.y, p - q.z, p - q.w);
-}
-static inline float2 operator*(float2 p, float2 q)
-{
- return float2(p.x * q.x, p.y * q.y);
-}
-static inline float3 operator*(float3 p, float3 q)
-{
- return float3(p.x * q.x, p.y * q.y, p.z * q.z);
-}
-static inline float4 operator*(float4 p, float4 q)
-{
- return float4(p.x * q.x, p.y * q.y, p.z * q.z, p.w * q.w);
-}
-static inline float2 operator*(float2 p, float q)
-{
- return float2(p.x * q, p.y * q);
-}
-static inline float3 operator*(float3 p, float q)
-{
- return float3(p.x * q, p.y * q, p.z * q);
-}
-static inline float4 operator*(float4 p, float q)
-{
- return float4(p.x * q, p.y * q, p.z * q, p.w * q);
-}
-static inline float2 operator*(float p, float2 q)
-{
- return float2(p * q.x, p * q.y);
-}
-static inline float3 operator*(float p, float3 q)
-{
- return float3(p * q.x, p * q.y, p * q.z);
-}
-static inline float4 operator*(float p, float4 q)
-{
- return float4(p * q.x, p * q.y, p * q.z, p * q.w);
-}
-static inline double2 operator*(double2 p, double2 q)
-{
- return double2(p.x * q.x, p.y * q.y);
-}
-static inline double3 operator*(double3 p, double3 q)
-{
- return double3(p.x * q.x, p.y * q.y, p.z * q.z);
-}
-static inline double4 operator*(double4 p, double4 q)
-{
- return double4(p.x * q.x, p.y * q.y, p.z * q.z, p.w * q.w);
-}
-static inline double2 operator*(double2 p, double q)
-{
- return double2(p.x * q, p.y * q);
-}
-static inline double3 operator*(double3 p, double q)
-{
- return double3(p.x * q, p.y * q, p.z * q);
-}
-static inline double4 operator*(double4 p, double q)
-{
- return double4(p.x * q, p.y * q, p.z * q, p.w * q);
-}
-static inline double2 operator*(double p, double2 q)
-{
- return double2(p * q.x, p * q.y);
-}
-static inline double3 operator*(double p, double3 q)
-{
- return double3(p * q.x, p * q.y, p * q.z);
-}
-static inline double4 operator*(double p, double4 q)
-{
- return double4(p * q.x, p * q.y, p * q.z, p * q.w);
-}
-static inline int2 operator*(int2 p, int2 q)
-{
- return int2(p.x * q.x, p.y * q.y);
-}
-static inline int3 operator*(int3 p, int3 q)
-{
- return int3(p.x * q.x, p.y * q.y, p.z * q.z);
-}
-static inline int4 operator*(int4 p, int4 q)
-{
- return int4(p.x * q.x, p.y * q.y, p.z * q.z, p.w * q.w);
-}
-static inline int2 operator*(int2 p, int q)
-{
- return int2(p.x * q, p.y * q);
-}
-static inline int3 operator*(int3 p, int q)
-{
- return int3(p.x * q, p.y * q, p.z * q);
-}
-static inline int4 operator*(int4 p, int q)
-{
- return int4(p.x * q, p.y * q, p.z * q, p.w * q);
-}
-static inline int2 operator*(int p, int2 q)
-{
- return int2(p * q.x, p * q.y);
-}
-static inline int3 operator*(int p, int3 q)
-{
- return int3(p * q.x, p * q.y, p * q.z);
-}
-static inline int4 operator*(int p, int4 q)
-{
- return int4(p * q.x, p * q.y, p * q.z, p * q.w);
-}
-static inline uint2 operator*(uint2 p, uint2 q)
-{
- return uint2(p.x * q.x, p.y * q.y);
-}
-static inline uint3 operator*(uint3 p, uint3 q)
-{
- return uint3(p.x * q.x, p.y * q.y, p.z * q.z);
-}
-static inline uint4 operator*(uint4 p, uint4 q)
-{
- return uint4(p.x * q.x, p.y * q.y, p.z * q.z, p.w * q.w);
-}
-static inline uint2 operator*(uint2 p, uint q)
-{
- return uint2(p.x * q, p.y * q);
-}
-static inline uint3 operator*(uint3 p, uint q)
-{
- return uint3(p.x * q, p.y * q, p.z * q);
-}
-static inline uint4 operator*(uint4 p, uint q)
-{
- return uint4(p.x * q, p.y * q, p.z * q, p.w * q);
-}
-static inline uint2 operator*(uint p, uint2 q)
-{
- return uint2(p * q.x, p * q.y);
-}
-static inline uint3 operator*(uint p, uint3 q)
-{
- return uint3(p * q.x, p * q.y, p * q.z);
-}
-static inline uint4 operator*(uint p, uint4 q)
-{
- return uint4(p * q.x, p * q.y, p * q.z, p * q.w);
-}
-static inline short2 operator*(short2 p, short2 q)
-{
- return short2(p.x * q.x, p.y * q.y);
-}
-static inline short3 operator*(short3 p, short3 q)
-{
- return short3(p.x * q.x, p.y * q.y, p.z * q.z);
-}
-static inline short4 operator*(short4 p, short4 q)
-{
- return short4(p.x * q.x, p.y * q.y, p.z * q.z, p.w * q.w);
-}
-static inline short2 operator*(short2 p, short q)
-{
- return short2(p.x * q, p.y * q);
-}
-static inline short3 operator*(short3 p, short q)
-{
- return short3(p.x * q, p.y * q, p.z * q);
-}
-static inline short4 operator*(short4 p, short q)
-{
- return short4(p.x * q, p.y * q, p.z * q, p.w * q);
-}
-static inline short2 operator*(short p, short2 q)
-{
- return short2(p * q.x, p * q.y);
-}
-static inline short3 operator*(short p, short3 q)
-{
- return short3(p * q.x, p * q.y, p * q.z);
-}
-static inline short4 operator*(short p, short4 q)
-{
- return short4(p * q.x, p * q.y, p * q.z, p * q.w);
-}
-static inline ushort2 operator*(ushort2 p, ushort2 q)
-{
- return ushort2(p.x * q.x, p.y * q.y);
-}
-static inline ushort3 operator*(ushort3 p, ushort3 q)
-{
- return ushort3(p.x * q.x, p.y * q.y, p.z * q.z);
-}
-static inline ushort4 operator*(ushort4 p, ushort4 q)
-{
- return ushort4(p.x * q.x, p.y * q.y, p.z * q.z, p.w * q.w);
-}
-static inline ushort2 operator*(ushort2 p, ushort q)
-{
- return ushort2(p.x * q, p.y * q);
-}
-static inline ushort3 operator*(ushort3 p, ushort q)
-{
- return ushort3(p.x * q, p.y * q, p.z * q);
-}
-static inline ushort4 operator*(ushort4 p, ushort q)
-{
- return ushort4(p.x * q, p.y * q, p.z * q, p.w * q);
-}
-static inline ushort2 operator*(ushort p, ushort2 q)
-{
- return ushort2(p * q.x, p * q.y);
-}
-static inline ushort3 operator*(ushort p, ushort3 q)
-{
- return ushort3(p * q.x, p * q.y, p * q.z);
-}
-static inline ushort4 operator*(ushort p, ushort4 q)
-{
- return ushort4(p * q.x, p * q.y, p * q.z, p * q.w);
-}
-static inline long2 operator*(long2 p, long2 q)
-{
- return long2(p.x * q.x, p.y * q.y);
-}
-static inline long3 operator*(long3 p, long3 q)
-{
- return long3(p.x * q.x, p.y * q.y, p.z * q.z);
-}
-static inline long4 operator*(long4 p, long4 q)
-{
- return long4(p.x * q.x, p.y * q.y, p.z * q.z, p.w * q.w);
-}
-static inline long2 operator*(long2 p, long q)
-{
- return long2(p.x * q, p.y * q);
-}
-static inline long3 operator*(long3 p, long q)
-{
- return long3(p.x * q, p.y * q, p.z * q);
-}
-static inline long4 operator*(long4 p, long q)
-{
- return long4(p.x * q, p.y * q, p.z * q, p.w * q);
-}
-static inline long2 operator*(long p, long2 q)
-{
- return long2(p * q.x, p * q.y);
-}
-static inline long3 operator*(long p, long3 q)
-{
- return long3(p * q.x, p * q.y, p * q.z);
-}
-static inline long4 operator*(long p, long4 q)
-{
- return long4(p * q.x, p * q.y, p * q.z, p * q.w);
-}
-static inline ulong2 operator*(ulong2 p, ulong2 q)
-{
- return ulong2(p.x * q.x, p.y * q.y);
-}
-static inline ulong3 operator*(ulong3 p, ulong3 q)
-{
- return ulong3(p.x * q.x, p.y * q.y, p.z * q.z);
-}
-static inline ulong4 operator*(ulong4 p, ulong4 q)
-{
- return ulong4(p.x * q.x, p.y * q.y, p.z * q.z, p.w * q.w);
-}
-static inline ulong2 operator*(ulong2 p, ulong q)
-{
- return ulong2(p.x * q, p.y * q);
-}
-static inline ulong3 operator*(ulong3 p, ulong q)
-{
- return ulong3(p.x * q, p.y * q, p.z * q);
-}
-static inline ulong4 operator*(ulong4 p, ulong q)
-{
- return ulong4(p.x * q, p.y * q, p.z * q, p.w * q);
-}
-static inline ulong2 operator*(ulong p, ulong2 q)
-{
- return ulong2(p * q.x, p * q.y);
-}
-static inline ulong3 operator*(ulong p, ulong3 q)
-{
- return ulong3(p * q.x, p * q.y, p * q.z);
-}
-static inline ulong4 operator*(ulong p, ulong4 q)
-{
- return ulong4(p * q.x, p * q.y, p * q.z, p * q.w);
-}
-static inline float2 operator/(float2 p, float2 q)
-{
- return float2(p.x / q.x, p.y / q.y);
-}
-static inline float3 operator/(float3 p, float3 q)
-{
- return float3(p.x / q.x, p.y / q.y, p.z / q.z);
-}
-static inline float4 operator/(float4 p, float4 q)
-{
- return float4(p.x / q.x, p.y / q.y, p.z / q.z, p.w / q.w);
-}
-static inline float2 operator/(float2 p, float q)
-{
- return float2(p.x / q, p.y / q);
-}
-static inline float3 operator/(float3 p, float q)
-{
- return float3(p.x / q, p.y / q, p.z / q);
-}
-static inline float4 operator/(float4 p, float q)
-{
- return float4(p.x / q, p.y / q, p.z / q, p.w / q);
-}
-static inline float2 operator/(float p, float2 q)
-{
- return float2(p / q.x, p / q.y);
-}
-static inline float3 operator/(float p, float3 q)
-{
- return float3(p / q.x, p / q.y, p / q.z);
-}
-static inline float4 operator/(float p, float4 q)
-{
- return float4(p / q.x, p / q.y, p / q.z, p / q.w);
-}
-static inline double2 operator/(double2 p, double2 q)
-{
- return double2(p.x / q.x, p.y / q.y);
-}
-static inline double3 operator/(double3 p, double3 q)
-{
- return double3(p.x / q.x, p.y / q.y, p.z / q.z);
-}
-static inline double4 operator/(double4 p, double4 q)
-{
- return double4(p.x / q.x, p.y / q.y, p.z / q.z, p.w / q.w);
-}
-static inline double2 operator/(double2 p, double q)
-{
- return double2(p.x / q, p.y / q);
-}
-static inline double3 operator/(double3 p, double q)
-{
- return double3(p.x / q, p.y / q, p.z / q);
-}
-static inline double4 operator/(double4 p, double q)
-{
- return double4(p.x / q, p.y / q, p.z / q, p.w / q);
-}
-static inline double2 operator/(double p, double2 q)
-{
- return double2(p / q.x, p / q.y);
-}
-static inline double3 operator/(double p, double3 q)
-{
- return double3(p / q.x, p / q.y, p / q.z);
-}
-static inline double4 operator/(double p, double4 q)
-{
- return double4(p / q.x, p / q.y, p / q.z, p / q.w);
-}
-static inline int2 operator/(int2 p, int2 q)
-{
- return int2(p.x / q.x, p.y / q.y);
-}
-static inline int3 operator/(int3 p, int3 q)
-{
- return int3(p.x / q.x, p.y / q.y, p.z / q.z);
-}
-static inline int4 operator/(int4 p, int4 q)
-{
- return int4(p.x / q.x, p.y / q.y, p.z / q.z, p.w / q.w);
-}
-static inline int2 operator/(int2 p, int q)
-{
- return int2(p.x / q, p.y / q);
-}
-static inline int3 operator/(int3 p, int q)
-{
- return int3(p.x / q, p.y / q, p.z / q);
-}
-static inline int4 operator/(int4 p, int q)
-{
- return int4(p.x / q, p.y / q, p.z / q, p.w / q);
-}
-static inline int2 operator/(int p, int2 q)
-{
- return int2(p / q.x, p / q.y);
-}
-static inline int3 operator/(int p, int3 q)
-{
- return int3(p / q.x, p / q.y, p / q.z);
-}
-static inline int4 operator/(int p, int4 q)
-{
- return int4(p / q.x, p / q.y, p / q.z, p / q.w);
-}
-static inline uint2 operator/(uint2 p, uint2 q)
-{
- return uint2(p.x / q.x, p.y / q.y);
-}
-static inline uint3 operator/(uint3 p, uint3 q)
-{
- return uint3(p.x / q.x, p.y / q.y, p.z / q.z);
-}
-static inline uint4 operator/(uint4 p, uint4 q)
-{
- return uint4(p.x / q.x, p.y / q.y, p.z / q.z, p.w / q.w);
-}
-static inline uint2 operator/(uint2 p, uint q)
-{
- return uint2(p.x / q, p.y / q);
-}
-static inline uint3 operator/(uint3 p, uint q)
-{
- return uint3(p.x / q, p.y / q, p.z / q);
-}
-static inline uint4 operator/(uint4 p, uint q)
-{
- return uint4(p.x / q, p.y / q, p.z / q, p.w / q);
-}
-static inline uint2 operator/(uint p, uint2 q)
-{
- return uint2(p / q.x, p / q.y);
-}
-static inline uint3 operator/(uint p, uint3 q)
-{
- return uint3(p / q.x, p / q.y, p / q.z);
-}
-static inline uint4 operator/(uint p, uint4 q)
-{
- return uint4(p / q.x, p / q.y, p / q.z, p / q.w);
-}
-static inline short2 operator/(short2 p, short2 q)
-{
- return short2(p.x / q.x, p.y / q.y);
-}
-static inline short3 operator/(short3 p, short3 q)
-{
- return short3(p.x / q.x, p.y / q.y, p.z / q.z);
-}
-static inline short4 operator/(short4 p, short4 q)
-{
- return short4(p.x / q.x, p.y / q.y, p.z / q.z, p.w / q.w);
-}
-static inline short2 operator/(short2 p, short q)
-{
- return short2(p.x / q, p.y / q);
-}
-static inline short3 operator/(short3 p, short q)
-{
- return short3(p.x / q, p.y / q, p.z / q);
-}
-static inline short4 operator/(short4 p, short q)
-{
- return short4(p.x / q, p.y / q, p.z / q, p.w / q);
-}
-static inline short2 operator/(short p, short2 q)
-{
- return short2(p / q.x, p / q.y);
-}
-static inline short3 operator/(short p, short3 q)
-{
- return short3(p / q.x, p / q.y, p / q.z);
-}
-static inline short4 operator/(short p, short4 q)
-{
- return short4(p / q.x, p / q.y, p / q.z, p / q.w);
-}
-static inline ushort2 operator/(ushort2 p, ushort2 q)
-{
- return ushort2(p.x / q.x, p.y / q.y);
-}
-static inline ushort3 operator/(ushort3 p, ushort3 q)
-{
- return ushort3(p.x / q.x, p.y / q.y, p.z / q.z);
-}
-static inline ushort4 operator/(ushort4 p, ushort4 q)
-{
- return ushort4(p.x / q.x, p.y / q.y, p.z / q.z, p.w / q.w);
-}
-static inline ushort2 operator/(ushort2 p, ushort q)
-{
- return ushort2(p.x / q, p.y / q);
-}
-static inline ushort3 operator/(ushort3 p, ushort q)
-{
- return ushort3(p.x / q, p.y / q, p.z / q);
-}
-static inline ushort4 operator/(ushort4 p, ushort q)
-{
- return ushort4(p.x / q, p.y / q, p.z / q, p.w / q);
-}
-static inline ushort2 operator/(ushort p, ushort2 q)
-{
- return ushort2(p / q.x, p / q.y);
-}
-static inline ushort3 operator/(ushort p, ushort3 q)
-{
- return ushort3(p / q.x, p / q.y, p / q.z);
-}
-static inline ushort4 operator/(ushort p, ushort4 q)
-{
- return ushort4(p / q.x, p / q.y, p / q.z, p / q.w);
-}
-static inline long2 operator/(long2 p, long2 q)
-{
- return long2(p.x / q.x, p.y / q.y);
-}
-static inline long3 operator/(long3 p, long3 q)
-{
- return long3(p.x / q.x, p.y / q.y, p.z / q.z);
-}
-static inline long4 operator/(long4 p, long4 q)
-{
- return long4(p.x / q.x, p.y / q.y, p.z / q.z, p.w / q.w);
-}
-static inline long2 operator/(long2 p, long q)
-{
- return long2(p.x / q, p.y / q);
-}
-static inline long3 operator/(long3 p, long q)
-{
- return long3(p.x / q, p.y / q, p.z / q);
-}
-static inline long4 operator/(long4 p, long q)
-{
- return long4(p.x / q, p.y / q, p.z / q, p.w / q);
-}
-static inline long2 operator/(long p, long2 q)
-{
- return long2(p / q.x, p / q.y);
-}
-static inline long3 operator/(long p, long3 q)
-{
- return long3(p / q.x, p / q.y, p / q.z);
-}
-static inline long4 operator/(long p, long4 q)
-{
- return long4(p / q.x, p / q.y, p / q.z, p / q.w);
-}
-static inline ulong2 operator/(ulong2 p, ulong2 q)
-{
- return ulong2(p.x / q.x, p.y / q.y);
-}
-static inline ulong3 operator/(ulong3 p, ulong3 q)
-{
- return ulong3(p.x / q.x, p.y / q.y, p.z / q.z);
-}
-static inline ulong4 operator/(ulong4 p, ulong4 q)
-{
- return ulong4(p.x / q.x, p.y / q.y, p.z / q.z, p.w / q.w);
-}
-static inline ulong2 operator/(ulong2 p, ulong q)
-{
- return ulong2(p.x / q, p.y / q);
-}
-static inline ulong3 operator/(ulong3 p, ulong q)
-{
- return ulong3(p.x / q, p.y / q, p.z / q);
-}
-static inline ulong4 operator/(ulong4 p, ulong q)
-{
- return ulong4(p.x / q, p.y / q, p.z / q, p.w / q);
-}
-static inline ulong2 operator/(ulong p, ulong2 q)
-{
- return ulong2(p / q.x, p / q.y);
-}
-static inline ulong3 operator/(ulong p, ulong3 q)
-{
- return ulong3(p / q.x, p / q.y, p / q.z);
-}
-static inline ulong4 operator/(ulong p, ulong4 q)
-{
- return ulong4(p / q.x, p / q.y, p / q.z, p / q.w);
-}
-static inline int2 operator%(int2 p, int2 q)
-{
- return int2(p.x % q.x, p.y % q.y);
-}
-static inline int3 operator%(int3 p, int3 q)
-{
- return int3(p.x % q.x, p.y % q.y, p.z % q.z);
-}
-static inline int4 operator%(int4 p, int4 q)
-{
- return int4(p.x % q.x, p.y % q.y, p.z % q.z, p.w % q.w);
-}
-static inline int2 operator%(int2 p, int q)
-{
- return int2(p.x % q, p.y % q);
-}
-static inline int3 operator%(int3 p, int q)
-{
- return int3(p.x % q, p.y % q, p.z % q);
-}
-static inline int4 operator%(int4 p, int q)
-{
- return int4(p.x % q, p.y % q, p.z % q, p.w % q);
-}
-static inline int2 operator%(int p, int2 q)
-{
- return int2(p % q.x, p % q.y);
-}
-static inline int3 operator%(int p, int3 q)
-{
- return int3(p % q.x, p % q.y, p % q.z);
-}
-static inline int4 operator%(int p, int4 q)
-{
- return int4(p % q.x, p % q.y, p % q.z, p % q.w);
-}
-static inline uint2 operator%(uint2 p, uint2 q)
-{
- return uint2(p.x % q.x, p.y % q.y);
-}
-static inline uint3 operator%(uint3 p, uint3 q)
-{
- return uint3(p.x % q.x, p.y % q.y, p.z % q.z);
-}
-static inline uint4 operator%(uint4 p, uint4 q)
-{
- return uint4(p.x % q.x, p.y % q.y, p.z % q.z, p.w % q.w);
-}
-static inline uint2 operator%(uint2 p, uint q)
-{
- return uint2(p.x % q, p.y % q);
-}
-static inline uint3 operator%(uint3 p, uint q)
-{
- return uint3(p.x % q, p.y % q, p.z % q);
-}
-static inline uint4 operator%(uint4 p, uint q)
-{
- return uint4(p.x % q, p.y % q, p.z % q, p.w % q);
-}
-static inline uint2 operator%(uint p, uint2 q)
-{
- return uint2(p % q.x, p % q.y);
-}
-static inline uint3 operator%(uint p, uint3 q)
-{
- return uint3(p % q.x, p % q.y, p % q.z);
-}
-static inline uint4 operator%(uint p, uint4 q)
-{
- return uint4(p % q.x, p % q.y, p % q.z, p % q.w);
-}
-static inline short2 operator%(short2 p, short2 q)
-{
- return short2(p.x % q.x, p.y % q.y);
-}
-static inline short3 operator%(short3 p, short3 q)
-{
- return short3(p.x % q.x, p.y % q.y, p.z % q.z);
-}
-static inline short4 operator%(short4 p, short4 q)
-{
- return short4(p.x % q.x, p.y % q.y, p.z % q.z, p.w % q.w);
-}
-static inline short2 operator%(short2 p, short q)
-{
- return short2(p.x % q, p.y % q);
-}
-static inline short3 operator%(short3 p, short q)
-{
- return short3(p.x % q, p.y % q, p.z % q);
-}
-static inline short4 operator%(short4 p, short q)
-{
- return short4(p.x % q, p.y % q, p.z % q, p.w % q);
-}
-static inline short2 operator%(short p, short2 q)
-{
- return short2(p % q.x, p % q.y);
-}
-static inline short3 operator%(short p, short3 q)
-{
- return short3(p % q.x, p % q.y, p % q.z);
-}
-static inline short4 operator%(short p, short4 q)
-{
- return short4(p % q.x, p % q.y, p % q.z, p % q.w);
-}
-static inline ushort2 operator%(ushort2 p, ushort2 q)
-{
- return ushort2(p.x % q.x, p.y % q.y);
-}
-static inline ushort3 operator%(ushort3 p, ushort3 q)
-{
- return ushort3(p.x % q.x, p.y % q.y, p.z % q.z);
-}
-static inline ushort4 operator%(ushort4 p, ushort4 q)
-{
- return ushort4(p.x % q.x, p.y % q.y, p.z % q.z, p.w % q.w);
-}
-static inline ushort2 operator%(ushort2 p, ushort q)
-{
- return ushort2(p.x % q, p.y % q);
-}
-static inline ushort3 operator%(ushort3 p, ushort q)
-{
- return ushort3(p.x % q, p.y % q, p.z % q);
-}
-static inline ushort4 operator%(ushort4 p, ushort q)
-{
- return ushort4(p.x % q, p.y % q, p.z % q, p.w % q);
-}
-static inline ushort2 operator%(ushort p, ushort2 q)
-{
- return ushort2(p % q.x, p % q.y);
-}
-static inline ushort3 operator%(ushort p, ushort3 q)
-{
- return ushort3(p % q.x, p % q.y, p % q.z);
-}
-static inline ushort4 operator%(ushort p, ushort4 q)
-{
- return ushort4(p % q.x, p % q.y, p % q.z, p % q.w);
-}
-static inline long2 operator%(long2 p, long2 q)
-{
- return long2(p.x % q.x, p.y % q.y);
-}
-static inline long3 operator%(long3 p, long3 q)
-{
- return long3(p.x % q.x, p.y % q.y, p.z % q.z);
-}
-static inline long4 operator%(long4 p, long4 q)
-{
- return long4(p.x % q.x, p.y % q.y, p.z % q.z, p.w % q.w);
-}
-static inline long2 operator%(long2 p, long q)
-{
- return long2(p.x % q, p.y % q);
-}
-static inline long3 operator%(long3 p, long q)
-{
- return long3(p.x % q, p.y % q, p.z % q);
-}
-static inline long4 operator%(long4 p, long q)
-{
- return long4(p.x % q, p.y % q, p.z % q, p.w % q);
-}
-static inline long2 operator%(long p, long2 q)
-{
- return long2(p % q.x, p % q.y);
-}
-static inline long3 operator%(long p, long3 q)
-{
- return long3(p % q.x, p % q.y, p % q.z);
-}
-static inline long4 operator%(long p, long4 q)
-{
- return long4(p % q.x, p % q.y, p % q.z, p % q.w);
-}
-static inline ulong2 operator%(ulong2 p, ulong2 q)
-{
- return ulong2(p.x % q.x, p.y % q.y);
-}
-static inline ulong3 operator%(ulong3 p, ulong3 q)
-{
- return ulong3(p.x % q.x, p.y % q.y, p.z % q.z);
-}
-static inline ulong4 operator%(ulong4 p, ulong4 q)
-{
- return ulong4(p.x % q.x, p.y % q.y, p.z % q.z, p.w % q.w);
-}
-static inline ulong2 operator%(ulong2 p, ulong q)
-{
- return ulong2(p.x % q, p.y % q);
-}
-static inline ulong3 operator%(ulong3 p, ulong q)
-{
- return ulong3(p.x % q, p.y % q, p.z % q);
-}
-static inline ulong4 operator%(ulong4 p, ulong q)
-{
- return ulong4(p.x % q, p.y % q, p.z % q, p.w % q);
-}
-static inline ulong2 operator%(ulong p, ulong2 q)
-{
- return ulong2(p % q.x, p % q.y);
-}
-static inline ulong3 operator%(ulong p, ulong3 q)
-{
- return ulong3(p % q.x, p % q.y, p % q.z);
-}
-static inline ulong4 operator%(ulong p, ulong4 q)
-{
- return ulong4(p % q.x, p % q.y, p % q.z, p % q.w);
-}
-static inline int2 operator&(int2 p, int2 q)
-{
- return int2(p.x & q.x, p.y & q.y);
-}
-static inline int3 operator&(int3 p, int3 q)
-{
- return int3(p.x & q.x, p.y & q.y, p.z & q.z);
-}
-static inline int4 operator&(int4 p, int4 q)
-{
- return int4(p.x & q.x, p.y & q.y, p.z & q.z, p.w & q.w);
-}
-static inline int2 operator&(int2 p, int q)
-{
- return int2(p.x & q, p.y & q);
-}
-static inline int3 operator&(int3 p, int q)
-{
- return int3(p.x & q, p.y & q, p.z & q);
-}
-static inline int4 operator&(int4 p, int q)
-{
- return int4(p.x & q, p.y & q, p.z & q, p.w & q);
-}
-static inline int2 operator&(int p, int2 q)
-{
- return int2(p & q.x, p & q.y);
-}
-static inline int3 operator&(int p, int3 q)
-{
- return int3(p & q.x, p & q.y, p & q.z);
-}
-static inline int4 operator&(int p, int4 q)
-{
- return int4(p & q.x, p & q.y, p & q.z, p & q.w);
-}
-static inline uint2 operator&(uint2 p, uint2 q)
-{
- return uint2(p.x & q.x, p.y & q.y);
-}
-static inline uint3 operator&(uint3 p, uint3 q)
-{
- return uint3(p.x & q.x, p.y & q.y, p.z & q.z);
-}
-static inline uint4 operator&(uint4 p, uint4 q)
-{
- return uint4(p.x & q.x, p.y & q.y, p.z & q.z, p.w & q.w);
-}
-static inline uint2 operator&(uint2 p, uint q)
-{
- return uint2(p.x & q, p.y & q);
-}
-static inline uint3 operator&(uint3 p, uint q)
-{
- return uint3(p.x & q, p.y & q, p.z & q);
-}
-static inline uint4 operator&(uint4 p, uint q)
-{
- return uint4(p.x & q, p.y & q, p.z & q, p.w & q);
-}
-static inline uint2 operator&(uint p, uint2 q)
-{
- return uint2(p & q.x, p & q.y);
-}
-static inline uint3 operator&(uint p, uint3 q)
-{
- return uint3(p & q.x, p & q.y, p & q.z);
-}
-static inline uint4 operator&(uint p, uint4 q)
-{
- return uint4(p & q.x, p & q.y, p & q.z, p & q.w);
-}
-static inline short2 operator&(short2 p, short2 q)
-{
- return short2(p.x & q.x, p.y & q.y);
-}
-static inline short3 operator&(short3 p, short3 q)
-{
- return short3(p.x & q.x, p.y & q.y, p.z & q.z);
-}
-static inline short4 operator&(short4 p, short4 q)
-{
- return short4(p.x & q.x, p.y & q.y, p.z & q.z, p.w & q.w);
-}
-static inline short2 operator&(short2 p, short q)
-{
- return short2(p.x & q, p.y & q);
-}
-static inline short3 operator&(short3 p, short q)
-{
- return short3(p.x & q, p.y & q, p.z & q);
-}
-static inline short4 operator&(short4 p, short q)
-{
- return short4(p.x & q, p.y & q, p.z & q, p.w & q);
-}
-static inline short2 operator&(short p, short2 q)
-{
- return short2(p & q.x, p & q.y);
-}
-static inline short3 operator&(short p, short3 q)
-{
- return short3(p & q.x, p & q.y, p & q.z);
-}
-static inline short4 operator&(short p, short4 q)
-{
- return short4(p & q.x, p & q.y, p & q.z, p & q.w);
-}
-static inline ushort2 operator&(ushort2 p, ushort2 q)
-{
- return ushort2(p.x & q.x, p.y & q.y);
-}
-static inline ushort3 operator&(ushort3 p, ushort3 q)
-{
- return ushort3(p.x & q.x, p.y & q.y, p.z & q.z);
-}
-static inline ushort4 operator&(ushort4 p, ushort4 q)
-{
- return ushort4(p.x & q.x, p.y & q.y, p.z & q.z, p.w & q.w);
-}
-static inline ushort2 operator&(ushort2 p, ushort q)
-{
- return ushort2(p.x & q, p.y & q);
-}
-static inline ushort3 operator&(ushort3 p, ushort q)
-{
- return ushort3(p.x & q, p.y & q, p.z & q);
-}
-static inline ushort4 operator&(ushort4 p, ushort q)
-{
- return ushort4(p.x & q, p.y & q, p.z & q, p.w & q);
-}
-static inline ushort2 operator&(ushort p, ushort2 q)
-{
- return ushort2(p & q.x, p & q.y);
-}
-static inline ushort3 operator&(ushort p, ushort3 q)
-{
- return ushort3(p & q.x, p & q.y, p & q.z);
-}
-static inline ushort4 operator&(ushort p, ushort4 q)
-{
- return ushort4(p & q.x, p & q.y, p & q.z, p & q.w);
-}
-static inline long2 operator&(long2 p, long2 q)
-{
- return long2(p.x & q.x, p.y & q.y);
-}
-static inline long3 operator&(long3 p, long3 q)
-{
- return long3(p.x & q.x, p.y & q.y, p.z & q.z);
-}
-static inline long4 operator&(long4 p, long4 q)
-{
- return long4(p.x & q.x, p.y & q.y, p.z & q.z, p.w & q.w);
-}
-static inline long2 operator&(long2 p, long q)
-{
- return long2(p.x & q, p.y & q);
-}
-static inline long3 operator&(long3 p, long q)
-{
- return long3(p.x & q, p.y & q, p.z & q);
-}
-static inline long4 operator&(long4 p, long q)
-{
- return long4(p.x & q, p.y & q, p.z & q, p.w & q);
-}
-static inline long2 operator&(long p, long2 q)
-{
- return long2(p & q.x, p & q.y);
-}
-static inline long3 operator&(long p, long3 q)
-{
- return long3(p & q.x, p & q.y, p & q.z);
-}
-static inline long4 operator&(long p, long4 q)
-{
- return long4(p & q.x, p & q.y, p & q.z, p & q.w);
-}
-static inline ulong2 operator&(ulong2 p, ulong2 q)
-{
- return ulong2(p.x & q.x, p.y & q.y);
-}
-static inline ulong3 operator&(ulong3 p, ulong3 q)
-{
- return ulong3(p.x & q.x, p.y & q.y, p.z & q.z);
-}
-static inline ulong4 operator&(ulong4 p, ulong4 q)
-{
- return ulong4(p.x & q.x, p.y & q.y, p.z & q.z, p.w & q.w);
-}
-static inline ulong2 operator&(ulong2 p, ulong q)
-{
- return ulong2(p.x & q, p.y & q);
-}
-static inline ulong3 operator&(ulong3 p, ulong q)
-{
- return ulong3(p.x & q, p.y & q, p.z & q);
-}
-static inline ulong4 operator&(ulong4 p, ulong q)
-{
- return ulong4(p.x & q, p.y & q, p.z & q, p.w & q);
-}
-static inline ulong2 operator&(ulong p, ulong2 q)
-{
- return ulong2(p & q.x, p & q.y);
-}
-static inline ulong3 operator&(ulong p, ulong3 q)
-{
- return ulong3(p & q.x, p & q.y, p & q.z);
-}
-static inline ulong4 operator&(ulong p, ulong4 q)
-{
- return ulong4(p & q.x, p & q.y, p & q.z, p & q.w);
-}
-static inline int2 operator|(int2 p, int2 q)
-{
- return int2(p.x | q.x, p.y | q.y);
-}
-static inline int3 operator|(int3 p, int3 q)
-{
- return int3(p.x | q.x, p.y | q.y, p.z | q.z);
-}
-static inline int4 operator|(int4 p, int4 q)
-{
- return int4(p.x | q.x, p.y | q.y, p.z | q.z, p.w | q.w);
-}
-static inline int2 operator|(int2 p, int q)
-{
- return int2(p.x | q, p.y | q);
-}
-static inline int3 operator|(int3 p, int q)
-{
- return int3(p.x | q, p.y | q, p.z | q);
-}
-static inline int4 operator|(int4 p, int q)
-{
- return int4(p.x | q, p.y | q, p.z | q, p.w | q);
-}
-static inline int2 operator|(int p, int2 q)
-{
- return int2(p | q.x, p | q.y);
-}
-static inline int3 operator|(int p, int3 q)
-{
- return int3(p | q.x, p | q.y, p | q.z);
-}
-static inline int4 operator|(int p, int4 q)
-{
- return int4(p | q.x, p | q.y, p | q.z, p | q.w);
-}
-static inline uint2 operator|(uint2 p, uint2 q)
-{
- return uint2(p.x | q.x, p.y | q.y);
-}
-static inline uint3 operator|(uint3 p, uint3 q)
-{
- return uint3(p.x | q.x, p.y | q.y, p.z | q.z);
-}
-static inline uint4 operator|(uint4 p, uint4 q)
-{
- return uint4(p.x | q.x, p.y | q.y, p.z | q.z, p.w | q.w);
-}
-static inline uint2 operator|(uint2 p, uint q)
-{
- return uint2(p.x | q, p.y | q);
-}
-static inline uint3 operator|(uint3 p, uint q)
-{
- return uint3(p.x | q, p.y | q, p.z | q);
-}
-static inline uint4 operator|(uint4 p, uint q)
-{
- return uint4(p.x | q, p.y | q, p.z | q, p.w | q);
-}
-static inline uint2 operator|(uint p, uint2 q)
-{
- return uint2(p | q.x, p | q.y);
-}
-static inline uint3 operator|(uint p, uint3 q)
-{
- return uint3(p | q.x, p | q.y, p | q.z);
-}
-static inline uint4 operator|(uint p, uint4 q)
-{
- return uint4(p | q.x, p | q.y, p | q.z, p | q.w);
-}
-static inline short2 operator|(short2 p, short2 q)
-{
- return short2(p.x | q.x, p.y | q.y);
-}
-static inline short3 operator|(short3 p, short3 q)
-{
- return short3(p.x | q.x, p.y | q.y, p.z | q.z);
-}
-static inline short4 operator|(short4 p, short4 q)
-{
- return short4(p.x | q.x, p.y | q.y, p.z | q.z, p.w | q.w);
-}
-static inline short2 operator|(short2 p, short q)
-{
- return short2(p.x | q, p.y | q);
-}
-static inline short3 operator|(short3 p, short q)
-{
- return short3(p.x | q, p.y | q, p.z | q);
-}
-static inline short4 operator|(short4 p, short q)
-{
- return short4(p.x | q, p.y | q, p.z | q, p.w | q);
-}
-static inline short2 operator|(short p, short2 q)
-{
- return short2(p | q.x, p | q.y);
-}
-static inline short3 operator|(short p, short3 q)
-{
- return short3(p | q.x, p | q.y, p | q.z);
-}
-static inline short4 operator|(short p, short4 q)
-{
- return short4(p | q.x, p | q.y, p | q.z, p | q.w);
-}
-static inline ushort2 operator|(ushort2 p, ushort2 q)
-{
- return ushort2(p.x | q.x, p.y | q.y);
-}
-static inline ushort3 operator|(ushort3 p, ushort3 q)
-{
- return ushort3(p.x | q.x, p.y | q.y, p.z | q.z);
-}
-static inline ushort4 operator|(ushort4 p, ushort4 q)
-{
- return ushort4(p.x | q.x, p.y | q.y, p.z | q.z, p.w | q.w);
-}
-static inline ushort2 operator|(ushort2 p, ushort q)
-{
- return ushort2(p.x | q, p.y | q);
-}
-static inline ushort3 operator|(ushort3 p, ushort q)
-{
- return ushort3(p.x | q, p.y | q, p.z | q);
-}
-static inline ushort4 operator|(ushort4 p, ushort q)
-{
- return ushort4(p.x | q, p.y | q, p.z | q, p.w | q);
-}
-static inline ushort2 operator|(ushort p, ushort2 q)
-{
- return ushort2(p | q.x, p | q.y);
-}
-static inline ushort3 operator|(ushort p, ushort3 q)
-{
- return ushort3(p | q.x, p | q.y, p | q.z);
-}
-static inline ushort4 operator|(ushort p, ushort4 q)
-{
- return ushort4(p | q.x, p | q.y, p | q.z, p | q.w);
-}
-static inline long2 operator|(long2 p, long2 q)
-{
- return long2(p.x | q.x, p.y | q.y);
-}
-static inline long3 operator|(long3 p, long3 q)
-{
- return long3(p.x | q.x, p.y | q.y, p.z | q.z);
-}
-static inline long4 operator|(long4 p, long4 q)
-{
- return long4(p.x | q.x, p.y | q.y, p.z | q.z, p.w | q.w);
-}
-static inline long2 operator|(long2 p, long q)
-{
- return long2(p.x | q, p.y | q);
-}
-static inline long3 operator|(long3 p, long q)
-{
- return long3(p.x | q, p.y | q, p.z | q);
-}
-static inline long4 operator|(long4 p, long q)
-{
- return long4(p.x | q, p.y | q, p.z | q, p.w | q);
-}
-static inline long2 operator|(long p, long2 q)
-{
- return long2(p | q.x, p | q.y);
-}
-static inline long3 operator|(long p, long3 q)
-{
- return long3(p | q.x, p | q.y, p | q.z);
-}
-static inline long4 operator|(long p, long4 q)
-{
- return long4(p | q.x, p | q.y, p | q.z, p | q.w);
-}
-static inline ulong2 operator|(ulong2 p, ulong2 q)
-{
- return ulong2(p.x | q.x, p.y | q.y);
-}
-static inline ulong3 operator|(ulong3 p, ulong3 q)
-{
- return ulong3(p.x | q.x, p.y | q.y, p.z | q.z);
-}
-static inline ulong4 operator|(ulong4 p, ulong4 q)
-{
- return ulong4(p.x | q.x, p.y | q.y, p.z | q.z, p.w | q.w);
-}
-static inline ulong2 operator|(ulong2 p, ulong q)
-{
- return ulong2(p.x | q, p.y | q);
-}
-static inline ulong3 operator|(ulong3 p, ulong q)
-{
- return ulong3(p.x | q, p.y | q, p.z | q);
-}
-static inline ulong4 operator|(ulong4 p, ulong q)
-{
- return ulong4(p.x | q, p.y | q, p.z | q, p.w | q);
-}
-static inline ulong2 operator|(ulong p, ulong2 q)
-{
- return ulong2(p | q.x, p | q.y);
-}
-static inline ulong3 operator|(ulong p, ulong3 q)
-{
- return ulong3(p | q.x, p | q.y, p | q.z);
-}
-static inline ulong4 operator|(ulong p, ulong4 q)
-{
- return ulong4(p | q.x, p | q.y, p | q.z, p | q.w);
-}
-static inline int2 operator^(int2 p, int2 q)
-{
- return int2(p.x ^ q.x, p.y ^ q.y);
-}
-static inline int3 operator^(int3 p, int3 q)
-{
- return int3(p.x ^ q.x, p.y ^ q.y, p.z ^ q.z);
-}
-static inline int4 operator^(int4 p, int4 q)
-{
- return int4(p.x ^ q.x, p.y ^ q.y, p.z ^ q.z, p.w ^ q.w);
-}
-static inline int2 operator^(int2 p, int q)
-{
- return int2(p.x ^ q, p.y ^ q);
-}
-static inline int3 operator^(int3 p, int q)
-{
- return int3(p.x ^ q, p.y ^ q, p.z ^ q);
-}
-static inline int4 operator^(int4 p, int q)
-{
- return int4(p.x ^ q, p.y ^ q, p.z ^ q, p.w ^ q);
-}
-static inline int2 operator^(int p, int2 q)
-{
- return int2(p ^ q.x, p ^ q.y);
-}
-static inline int3 operator^(int p, int3 q)
-{
- return int3(p ^ q.x, p ^ q.y, p ^ q.z);
-}
-static inline int4 operator^(int p, int4 q)
-{
- return int4(p ^ q.x, p ^ q.y, p ^ q.z, p ^ q.w);
-}
-static inline uint2 operator^(uint2 p, uint2 q)
-{
- return uint2(p.x ^ q.x, p.y ^ q.y);
-}
-static inline uint3 operator^(uint3 p, uint3 q)
-{
- return uint3(p.x ^ q.x, p.y ^ q.y, p.z ^ q.z);
-}
-static inline uint4 operator^(uint4 p, uint4 q)
-{
- return uint4(p.x ^ q.x, p.y ^ q.y, p.z ^ q.z, p.w ^ q.w);
-}
-static inline uint2 operator^(uint2 p, uint q)
-{
- return uint2(p.x ^ q, p.y ^ q);
-}
-static inline uint3 operator^(uint3 p, uint q)
-{
- return uint3(p.x ^ q, p.y ^ q, p.z ^ q);
-}
-static inline uint4 operator^(uint4 p, uint q)
-{
- return uint4(p.x ^ q, p.y ^ q, p.z ^ q, p.w ^ q);
-}
-static inline uint2 operator^(uint p, uint2 q)
-{
- return uint2(p ^ q.x, p ^ q.y);
-}
-static inline uint3 operator^(uint p, uint3 q)
-{
- return uint3(p ^ q.x, p ^ q.y, p ^ q.z);
-}
-static inline uint4 operator^(uint p, uint4 q)
-{
- return uint4(p ^ q.x, p ^ q.y, p ^ q.z, p ^ q.w);
-}
-static inline short2 operator^(short2 p, short2 q)
-{
- return short2(p.x ^ q.x, p.y ^ q.y);
-}
-static inline short3 operator^(short3 p, short3 q)
-{
- return short3(p.x ^ q.x, p.y ^ q.y, p.z ^ q.z);
-}
-static inline short4 operator^(short4 p, short4 q)
-{
- return short4(p.x ^ q.x, p.y ^ q.y, p.z ^ q.z, p.w ^ q.w);
-}
-static inline short2 operator^(short2 p, short q)
-{
- return short2(p.x ^ q, p.y ^ q);
-}
-static inline short3 operator^(short3 p, short q)
-{
- return short3(p.x ^ q, p.y ^ q, p.z ^ q);
-}
-static inline short4 operator^(short4 p, short q)
-{
- return short4(p.x ^ q, p.y ^ q, p.z ^ q, p.w ^ q);
-}
-static inline short2 operator^(short p, short2 q)
-{
- return short2(p ^ q.x, p ^ q.y);
-}
-static inline short3 operator^(short p, short3 q)
-{
- return short3(p ^ q.x, p ^ q.y, p ^ q.z);
-}
-static inline short4 operator^(short p, short4 q)
-{
- return short4(p ^ q.x, p ^ q.y, p ^ q.z, p ^ q.w);
-}
-static inline ushort2 operator^(ushort2 p, ushort2 q)
-{
- return ushort2(p.x ^ q.x, p.y ^ q.y);
-}
-static inline ushort3 operator^(ushort3 p, ushort3 q)
-{
- return ushort3(p.x ^ q.x, p.y ^ q.y, p.z ^ q.z);
-}
-static inline ushort4 operator^(ushort4 p, ushort4 q)
-{
- return ushort4(p.x ^ q.x, p.y ^ q.y, p.z ^ q.z, p.w ^ q.w);
-}
-static inline ushort2 operator^(ushort2 p, ushort q)
-{
- return ushort2(p.x ^ q, p.y ^ q);
-}
-static inline ushort3 operator^(ushort3 p, ushort q)
-{
- return ushort3(p.x ^ q, p.y ^ q, p.z ^ q);
-}
-static inline ushort4 operator^(ushort4 p, ushort q)
-{
- return ushort4(p.x ^ q, p.y ^ q, p.z ^ q, p.w ^ q);
-}
-static inline ushort2 operator^(ushort p, ushort2 q)
-{
- return ushort2(p ^ q.x, p ^ q.y);
-}
-static inline ushort3 operator^(ushort p, ushort3 q)
-{
- return ushort3(p ^ q.x, p ^ q.y, p ^ q.z);
-}
-static inline ushort4 operator^(ushort p, ushort4 q)
-{
- return ushort4(p ^ q.x, p ^ q.y, p ^ q.z, p ^ q.w);
-}
-static inline long2 operator^(long2 p, long2 q)
-{
- return long2(p.x ^ q.x, p.y ^ q.y);
-}
-static inline long3 operator^(long3 p, long3 q)
-{
- return long3(p.x ^ q.x, p.y ^ q.y, p.z ^ q.z);
-}
-static inline long4 operator^(long4 p, long4 q)
-{
- return long4(p.x ^ q.x, p.y ^ q.y, p.z ^ q.z, p.w ^ q.w);
-}
-static inline long2 operator^(long2 p, long q)
-{
- return long2(p.x ^ q, p.y ^ q);
-}
-static inline long3 operator^(long3 p, long q)
-{
- return long3(p.x ^ q, p.y ^ q, p.z ^ q);
-}
-static inline long4 operator^(long4 p, long q)
-{
- return long4(p.x ^ q, p.y ^ q, p.z ^ q, p.w ^ q);
-}
-static inline long2 operator^(long p, long2 q)
-{
- return long2(p ^ q.x, p ^ q.y);
-}
-static inline long3 operator^(long p, long3 q)
-{
- return long3(p ^ q.x, p ^ q.y, p ^ q.z);
-}
-static inline long4 operator^(long p, long4 q)
-{
- return long4(p ^ q.x, p ^ q.y, p ^ q.z, p ^ q.w);
-}
-static inline ulong2 operator^(ulong2 p, ulong2 q)
-{
- return ulong2(p.x ^ q.x, p.y ^ q.y);
-}
-static inline ulong3 operator^(ulong3 p, ulong3 q)
-{
- return ulong3(p.x ^ q.x, p.y ^ q.y, p.z ^ q.z);
-}
-static inline ulong4 operator^(ulong4 p, ulong4 q)
-{
- return ulong4(p.x ^ q.x, p.y ^ q.y, p.z ^ q.z, p.w ^ q.w);
-}
-static inline ulong2 operator^(ulong2 p, ulong q)
-{
- return ulong2(p.x ^ q, p.y ^ q);
-}
-static inline ulong3 operator^(ulong3 p, ulong q)
-{
- return ulong3(p.x ^ q, p.y ^ q, p.z ^ q);
-}
-static inline ulong4 operator^(ulong4 p, ulong q)
-{
- return ulong4(p.x ^ q, p.y ^ q, p.z ^ q, p.w ^ q);
-}
-static inline ulong2 operator^(ulong p, ulong2 q)
-{
- return ulong2(p ^ q.x, p ^ q.y);
-}
-static inline ulong3 operator^(ulong p, ulong3 q)
-{
- return ulong3(p ^ q.x, p ^ q.y, p ^ q.z);
-}
-static inline ulong4 operator^(ulong p, ulong4 q)
-{
- return ulong4(p ^ q.x, p ^ q.y, p ^ q.z, p ^ q.w);
-}
-static inline int2 operator<<(int2 p, int2 q)
-{
- return int2(p.x << q.x, p.y << q.y);
-}
-static inline int3 operator<<(int3 p, int3 q)
-{
- return int3(p.x << q.x, p.y << q.y, p.z << q.z);
-}
-static inline int4 operator<<(int4 p, int4 q)
-{
- return int4(p.x << q.x, p.y << q.y, p.z << q.z, p.w << q.w);
-}
-static inline int2 operator<<(int2 p, int q)
-{
- return int2(p.x << q, p.y << q);
-}
-static inline int3 operator<<(int3 p, int q)
-{
- return int3(p.x << q, p.y << q, p.z << q);
-}
-static inline int4 operator<<(int4 p, int q)
-{
- return int4(p.x << q, p.y << q, p.z << q, p.w << q);
-}
-static inline int2 operator<<(int p, int2 q)
-{
- return int2(p << q.x, p << q.y);
-}
-static inline int3 operator<<(int p, int3 q)
-{
- return int3(p << q.x, p << q.y, p << q.z);
-}
-static inline int4 operator<<(int p, int4 q)
-{
- return int4(p << q.x, p << q.y, p << q.z, p << q.w);
-}
-static inline uint2 operator<<(uint2 p, uint2 q)
-{
- return uint2(p.x << q.x, p.y << q.y);
-}
-static inline uint3 operator<<(uint3 p, uint3 q)
-{
- return uint3(p.x << q.x, p.y << q.y, p.z << q.z);
-}
-static inline uint4 operator<<(uint4 p, uint4 q)
-{
- return uint4(p.x << q.x, p.y << q.y, p.z << q.z, p.w << q.w);
-}
-static inline uint2 operator<<(uint2 p, uint q)
-{
- return uint2(p.x << q, p.y << q);
-}
-static inline uint3 operator<<(uint3 p, uint q)
-{
- return uint3(p.x << q, p.y << q, p.z << q);
-}
-static inline uint4 operator<<(uint4 p, uint q)
-{
- return uint4(p.x << q, p.y << q, p.z << q, p.w << q);
-}
-static inline uint2 operator<<(uint p, uint2 q)
-{
- return uint2(p << q.x, p << q.y);
-}
-static inline uint3 operator<<(uint p, uint3 q)
-{
- return uint3(p << q.x, p << q.y, p << q.z);
-}
-static inline uint4 operator<<(uint p, uint4 q)
-{
- return uint4(p << q.x, p << q.y, p << q.z, p << q.w);
-}
-static inline short2 operator<<(short2 p, short2 q)
-{
- return short2(p.x << q.x, p.y << q.y);
-}
-static inline short3 operator<<(short3 p, short3 q)
-{
- return short3(p.x << q.x, p.y << q.y, p.z << q.z);
-}
-static inline short4 operator<<(short4 p, short4 q)
-{
- return short4(p.x << q.x, p.y << q.y, p.z << q.z, p.w << q.w);
-}
-static inline short2 operator<<(short2 p, short q)
-{
- return short2(p.x << q, p.y << q);
-}
-static inline short3 operator<<(short3 p, short q)
-{
- return short3(p.x << q, p.y << q, p.z << q);
-}
-static inline short4 operator<<(short4 p, short q)
-{
- return short4(p.x << q, p.y << q, p.z << q, p.w << q);
-}
-static inline short2 operator<<(short p, short2 q)
-{
- return short2(p << q.x, p << q.y);
-}
-static inline short3 operator<<(short p, short3 q)
-{
- return short3(p << q.x, p << q.y, p << q.z);
-}
-static inline short4 operator<<(short p, short4 q)
-{
- return short4(p << q.x, p << q.y, p << q.z, p << q.w);
-}
-static inline ushort2 operator<<(ushort2 p, ushort2 q)
-{
- return ushort2(p.x << q.x, p.y << q.y);
-}
-static inline ushort3 operator<<(ushort3 p, ushort3 q)
-{
- return ushort3(p.x << q.x, p.y << q.y, p.z << q.z);
-}
-static inline ushort4 operator<<(ushort4 p, ushort4 q)
-{
- return ushort4(p.x << q.x, p.y << q.y, p.z << q.z, p.w << q.w);
-}
-static inline ushort2 operator<<(ushort2 p, ushort q)
-{
- return ushort2(p.x << q, p.y << q);
-}
-static inline ushort3 operator<<(ushort3 p, ushort q)
-{
- return ushort3(p.x << q, p.y << q, p.z << q);
-}
-static inline ushort4 operator<<(ushort4 p, ushort q)
-{
- return ushort4(p.x << q, p.y << q, p.z << q, p.w << q);
-}
-static inline ushort2 operator<<(ushort p, ushort2 q)
-{
- return ushort2(p << q.x, p << q.y);
-}
-static inline ushort3 operator<<(ushort p, ushort3 q)
-{
- return ushort3(p << q.x, p << q.y, p << q.z);
-}
-static inline ushort4 operator<<(ushort p, ushort4 q)
-{
- return ushort4(p << q.x, p << q.y, p << q.z, p << q.w);
-}
-static inline long2 operator<<(long2 p, long2 q)
-{
- return long2(p.x << q.x, p.y << q.y);
-}
-static inline long3 operator<<(long3 p, long3 q)
-{
- return long3(p.x << q.x, p.y << q.y, p.z << q.z);
-}
-static inline long4 operator<<(long4 p, long4 q)
-{
- return long4(p.x << q.x, p.y << q.y, p.z << q.z, p.w << q.w);
-}
-static inline long2 operator<<(long2 p, long q)
-{
- return long2(p.x << q, p.y << q);
-}
-static inline long3 operator<<(long3 p, long q)
-{
- return long3(p.x << q, p.y << q, p.z << q);
-}
-static inline long4 operator<<(long4 p, long q)
-{
- return long4(p.x << q, p.y << q, p.z << q, p.w << q);
-}
-static inline long2 operator<<(long p, long2 q)
-{
- return long2(p << q.x, p << q.y);
-}
-static inline long3 operator<<(long p, long3 q)
-{
- return long3(p << q.x, p << q.y, p << q.z);
-}
-static inline long4 operator<<(long p, long4 q)
-{
- return long4(p << q.x, p << q.y, p << q.z, p << q.w);
-}
-static inline ulong2 operator<<(ulong2 p, ulong2 q)
-{
- return ulong2(p.x << q.x, p.y << q.y);
-}
-static inline ulong3 operator<<(ulong3 p, ulong3 q)
-{
- return ulong3(p.x << q.x, p.y << q.y, p.z << q.z);
-}
-static inline ulong4 operator<<(ulong4 p, ulong4 q)
-{
- return ulong4(p.x << q.x, p.y << q.y, p.z << q.z, p.w << q.w);
-}
-static inline ulong2 operator<<(ulong2 p, ulong q)
-{
- return ulong2(p.x << q, p.y << q);
-}
-static inline ulong3 operator<<(ulong3 p, ulong q)
-{
- return ulong3(p.x << q, p.y << q, p.z << q);
-}
-static inline ulong4 operator<<(ulong4 p, ulong q)
-{
- return ulong4(p.x << q, p.y << q, p.z << q, p.w << q);
-}
-static inline ulong2 operator<<(ulong p, ulong2 q)
-{
- return ulong2(p << q.x, p << q.y);
-}
-static inline ulong3 operator<<(ulong p, ulong3 q)
-{
- return ulong3(p << q.x, p << q.y, p << q.z);
-}
-static inline ulong4 operator<<(ulong p, ulong4 q)
-{
- return ulong4(p << q.x, p << q.y, p << q.z, p << q.w);
-}
-static inline int2 operator>>(int2 p, int2 q)
-{
- return int2(p.x >> q.x, p.y >> q.y);
-}
-static inline int3 operator>>(int3 p, int3 q)
-{
- return int3(p.x >> q.x, p.y >> q.y, p.z >> q.z);
-}
-static inline int4 operator>>(int4 p, int4 q)
-{
- return int4(p.x >> q.x, p.y >> q.y, p.z >> q.z, p.w >> q.w);
-}
-static inline int2 operator>>(int2 p, int q)
-{
- return int2(p.x >> q, p.y >> q);
-}
-static inline int3 operator>>(int3 p, int q)
-{
- return int3(p.x >> q, p.y >> q, p.z >> q);
-}
-static inline int4 operator>>(int4 p, int q)
-{
- return int4(p.x >> q, p.y >> q, p.z >> q, p.w >> q);
-}
-static inline int2 operator>>(int p, int2 q)
-{
- return int2(p >> q.x, p >> q.y);
-}
-static inline int3 operator>>(int p, int3 q)
-{
- return int3(p >> q.x, p >> q.y, p >> q.z);
-}
-static inline int4 operator>>(int p, int4 q)
-{
- return int4(p >> q.x, p >> q.y, p >> q.z, p >> q.w);
-}
-static inline uint2 operator>>(uint2 p, uint2 q)
-{
- return uint2(p.x >> q.x, p.y >> q.y);
-}
-static inline uint3 operator>>(uint3 p, uint3 q)
-{
- return uint3(p.x >> q.x, p.y >> q.y, p.z >> q.z);
-}
-static inline uint4 operator>>(uint4 p, uint4 q)
-{
- return uint4(p.x >> q.x, p.y >> q.y, p.z >> q.z, p.w >> q.w);
-}
-static inline uint2 operator>>(uint2 p, uint q)
-{
- return uint2(p.x >> q, p.y >> q);
-}
-static inline uint3 operator>>(uint3 p, uint q)
-{
- return uint3(p.x >> q, p.y >> q, p.z >> q);
-}
-static inline uint4 operator>>(uint4 p, uint q)
-{
- return uint4(p.x >> q, p.y >> q, p.z >> q, p.w >> q);
-}
-static inline uint2 operator>>(uint p, uint2 q)
-{
- return uint2(p >> q.x, p >> q.y);
-}
-static inline uint3 operator>>(uint p, uint3 q)
-{
- return uint3(p >> q.x, p >> q.y, p >> q.z);
-}
-static inline uint4 operator>>(uint p, uint4 q)
-{
- return uint4(p >> q.x, p >> q.y, p >> q.z, p >> q.w);
-}
-static inline short2 operator>>(short2 p, short2 q)
-{
- return short2(p.x >> q.x, p.y >> q.y);
-}
-static inline short3 operator>>(short3 p, short3 q)
-{
- return short3(p.x >> q.x, p.y >> q.y, p.z >> q.z);
-}
-static inline short4 operator>>(short4 p, short4 q)
-{
- return short4(p.x >> q.x, p.y >> q.y, p.z >> q.z, p.w >> q.w);
-}
-static inline short2 operator>>(short2 p, short q)
-{
- return short2(p.x >> q, p.y >> q);
-}
-static inline short3 operator>>(short3 p, short q)
-{
- return short3(p.x >> q, p.y >> q, p.z >> q);
-}
-static inline short4 operator>>(short4 p, short q)
-{
- return short4(p.x >> q, p.y >> q, p.z >> q, p.w >> q);
-}
-static inline short2 operator>>(short p, short2 q)
-{
- return short2(p >> q.x, p >> q.y);
-}
-static inline short3 operator>>(short p, short3 q)
-{
- return short3(p >> q.x, p >> q.y, p >> q.z);
-}
-static inline short4 operator>>(short p, short4 q)
-{
- return short4(p >> q.x, p >> q.y, p >> q.z, p >> q.w);
-}
-static inline ushort2 operator>>(ushort2 p, ushort2 q)
-{
- return ushort2(p.x >> q.x, p.y >> q.y);
-}
-static inline ushort3 operator>>(ushort3 p, ushort3 q)
-{
- return ushort3(p.x >> q.x, p.y >> q.y, p.z >> q.z);
-}
-static inline ushort4 operator>>(ushort4 p, ushort4 q)
-{
- return ushort4(p.x >> q.x, p.y >> q.y, p.z >> q.z, p.w >> q.w);
-}
-static inline ushort2 operator>>(ushort2 p, ushort q)
-{
- return ushort2(p.x >> q, p.y >> q);
-}
-static inline ushort3 operator>>(ushort3 p, ushort q)
-{
- return ushort3(p.x >> q, p.y >> q, p.z >> q);
-}
-static inline ushort4 operator>>(ushort4 p, ushort q)
-{
- return ushort4(p.x >> q, p.y >> q, p.z >> q, p.w >> q);
-}
-static inline ushort2 operator>>(ushort p, ushort2 q)
-{
- return ushort2(p >> q.x, p >> q.y);
-}
-static inline ushort3 operator>>(ushort p, ushort3 q)
-{
- return ushort3(p >> q.x, p >> q.y, p >> q.z);
-}
-static inline ushort4 operator>>(ushort p, ushort4 q)
-{
- return ushort4(p >> q.x, p >> q.y, p >> q.z, p >> q.w);
-}
-static inline long2 operator>>(long2 p, long2 q)
-{
- return long2(p.x >> q.x, p.y >> q.y);
-}
-static inline long3 operator>>(long3 p, long3 q)
-{
- return long3(p.x >> q.x, p.y >> q.y, p.z >> q.z);
-}
-static inline long4 operator>>(long4 p, long4 q)
-{
- return long4(p.x >> q.x, p.y >> q.y, p.z >> q.z, p.w >> q.w);
-}
-static inline long2 operator>>(long2 p, long q)
-{
- return long2(p.x >> q, p.y >> q);
-}
-static inline long3 operator>>(long3 p, long q)
-{
- return long3(p.x >> q, p.y >> q, p.z >> q);
-}
-static inline long4 operator>>(long4 p, long q)
-{
- return long4(p.x >> q, p.y >> q, p.z >> q, p.w >> q);
-}
-static inline long2 operator>>(long p, long2 q)
-{
- return long2(p >> q.x, p >> q.y);
-}
-static inline long3 operator>>(long p, long3 q)
-{
- return long3(p >> q.x, p >> q.y, p >> q.z);
-}
-static inline long4 operator>>(long p, long4 q)
-{
- return long4(p >> q.x, p >> q.y, p >> q.z, p >> q.w);
-}
-static inline ulong2 operator>>(ulong2 p, ulong2 q)
-{
- return ulong2(p.x >> q.x, p.y >> q.y);
-}
-static inline ulong3 operator>>(ulong3 p, ulong3 q)
-{
- return ulong3(p.x >> q.x, p.y >> q.y, p.z >> q.z);
-}
-static inline ulong4 operator>>(ulong4 p, ulong4 q)
-{
- return ulong4(p.x >> q.x, p.y >> q.y, p.z >> q.z, p.w >> q.w);
-}
-static inline ulong2 operator>>(ulong2 p, ulong q)
-{
- return ulong2(p.x >> q, p.y >> q);
-}
-static inline ulong3 operator>>(ulong3 p, ulong q)
-{
- return ulong3(p.x >> q, p.y >> q, p.z >> q);
-}
-static inline ulong4 operator>>(ulong4 p, ulong q)
-{
- return ulong4(p.x >> q, p.y >> q, p.z >> q, p.w >> q);
-}
-static inline ulong2 operator>>(ulong p, ulong2 q)
-{
- return ulong2(p >> q.x, p >> q.y);
-}
-static inline ulong3 operator>>(ulong p, ulong3 q)
-{
- return ulong3(p >> q.x, p >> q.y, p >> q.z);
-}
-static inline ulong4 operator>>(ulong p, ulong4 q)
-{
- return ulong4(p >> q.x, p >> q.y, p >> q.z, p >> q.w);
-}
-static inline int2 operator==(float2 p, float2 q)
-{
- return int2(p.x == q.x, p.y == q.y);
-}
-static inline int3 operator==(float3 p, float3 q)
-{
- return int3(p.x == q.x, p.y == q.y, p.z == q.z);
-}
-static inline int4 operator==(float4 p, float4 q)
-{
- return int4(p.x == q.x, p.y == q.y, p.z == q.z, p.w == q.w);
-}
-static inline int2 operator==(float2 p, float q)
-{
- return int2(p.x == q, p.y == q);
-}
-static inline int3 operator==(float3 p, float q)
-{
- return int3(p.x == q, p.y == q, p.z == q);
-}
-static inline int4 operator==(float4 p, float q)
-{
- return int4(p.x == q, p.y == q, p.z == q, p.w == q);
-}
-static inline int2 operator==(float p, float2 q)
-{
- return int2(p == q.x, p == q.y);
-}
-static inline int3 operator==(float p, float3 q)
-{
- return int3(p == q.x, p == q.y, p == q.z);
-}
-static inline int4 operator==(float p, float4 q)
-{
- return int4(p == q.x, p == q.y, p == q.z, p == q.w);
-}
-static inline long2 operator==(double2 p, double2 q)
-{
- return long2(p.x == q.x, p.y == q.y);
-}
-static inline long3 operator==(double3 p, double3 q)
-{
- return long3(p.x == q.x, p.y == q.y, p.z == q.z);
-}
-static inline long4 operator==(double4 p, double4 q)
-{
- return long4(p.x == q.x, p.y == q.y, p.z == q.z, p.w == q.w);
-}
-static inline long2 operator==(double2 p, double q)
-{
- return long2(p.x == q, p.y == q);
-}
-static inline long3 operator==(double3 p, double q)
-{
- return long3(p.x == q, p.y == q, p.z == q);
-}
-static inline long4 operator==(double4 p, double q)
-{
- return long4(p.x == q, p.y == q, p.z == q, p.w == q);
-}
-static inline long2 operator==(double p, double2 q)
-{
- return long2(p == q.x, p == q.y);
-}
-static inline long3 operator==(double p, double3 q)
-{
- return long3(p == q.x, p == q.y, p == q.z);
-}
-static inline long4 operator==(double p, double4 q)
-{
- return long4(p == q.x, p == q.y, p == q.z, p == q.w);
-}
-static inline int2 operator==(int2 p, int2 q)
-{
- return int2(p.x == q.x, p.y == q.y);
-}
-static inline int3 operator==(int3 p, int3 q)
-{
- return int3(p.x == q.x, p.y == q.y, p.z == q.z);
-}
-static inline int4 operator==(int4 p, int4 q)
-{
- return int4(p.x == q.x, p.y == q.y, p.z == q.z, p.w == q.w);
-}
-static inline int2 operator==(int2 p, int q)
-{
- return int2(p.x == q, p.y == q);
-}
-static inline int3 operator==(int3 p, int q)
-{
- return int3(p.x == q, p.y == q, p.z == q);
-}
-static inline int4 operator==(int4 p, int q)
-{
- return int4(p.x == q, p.y == q, p.z == q, p.w == q);
-}
-static inline int2 operator==(int p, int2 q)
-{
- return int2(p == q.x, p == q.y);
-}
-static inline int3 operator==(int p, int3 q)
-{
- return int3(p == q.x, p == q.y, p == q.z);
-}
-static inline int4 operator==(int p, int4 q)
-{
- return int4(p == q.x, p == q.y, p == q.z, p == q.w);
-}
-static inline int2 operator==(uint2 p, uint2 q)
-{
- return int2(p.x == q.x, p.y == q.y);
-}
-static inline int3 operator==(uint3 p, uint3 q)
-{
- return int3(p.x == q.x, p.y == q.y, p.z == q.z);
-}
-static inline int4 operator==(uint4 p, uint4 q)
-{
- return int4(p.x == q.x, p.y == q.y, p.z == q.z, p.w == q.w);
-}
-static inline int2 operator==(uint2 p, uint q)
-{
- return int2(p.x == q, p.y == q);
-}
-static inline int3 operator==(uint3 p, uint q)
-{
- return int3(p.x == q, p.y == q, p.z == q);
-}
-static inline int4 operator==(uint4 p, uint q)
-{
- return int4(p.x == q, p.y == q, p.z == q, p.w == q);
-}
-static inline int2 operator==(uint p, uint2 q)
-{
- return int2(p == q.x, p == q.y);
-}
-static inline int3 operator==(uint p, uint3 q)
-{
- return int3(p == q.x, p == q.y, p == q.z);
-}
-static inline int4 operator==(uint p, uint4 q)
-{
- return int4(p == q.x, p == q.y, p == q.z, p == q.w);
-}
-static inline short2 operator==(short2 p, short2 q)
-{
- return short2(p.x == q.x, p.y == q.y);
-}
-static inline short3 operator==(short3 p, short3 q)
-{
- return short3(p.x == q.x, p.y == q.y, p.z == q.z);
-}
-static inline short4 operator==(short4 p, short4 q)
-{
- return short4(p.x == q.x, p.y == q.y, p.z == q.z, p.w == q.w);
-}
-static inline short2 operator==(short2 p, short q)
-{
- return short2(p.x == q, p.y == q);
-}
-static inline short3 operator==(short3 p, short q)
-{
- return short3(p.x == q, p.y == q, p.z == q);
-}
-static inline short4 operator==(short4 p, short q)
-{
- return short4(p.x == q, p.y == q, p.z == q, p.w == q);
-}
-static inline short2 operator==(short p, short2 q)
-{
- return short2(p == q.x, p == q.y);
-}
-static inline short3 operator==(short p, short3 q)
-{
- return short3(p == q.x, p == q.y, p == q.z);
-}
-static inline short4 operator==(short p, short4 q)
-{
- return short4(p == q.x, p == q.y, p == q.z, p == q.w);
-}
-static inline short2 operator==(ushort2 p, ushort2 q)
-{
- return short2(p.x == q.x, p.y == q.y);
-}
-static inline short3 operator==(ushort3 p, ushort3 q)
-{
- return short3(p.x == q.x, p.y == q.y, p.z == q.z);
-}
-static inline short4 operator==(ushort4 p, ushort4 q)
-{
- return short4(p.x == q.x, p.y == q.y, p.z == q.z, p.w == q.w);
-}
-static inline short2 operator==(ushort2 p, ushort q)
-{
- return short2(p.x == q, p.y == q);
-}
-static inline short3 operator==(ushort3 p, ushort q)
-{
- return short3(p.x == q, p.y == q, p.z == q);
-}
-static inline short4 operator==(ushort4 p, ushort q)
-{
- return short4(p.x == q, p.y == q, p.z == q, p.w == q);
-}
-static inline short2 operator==(ushort p, ushort2 q)
-{
- return short2(p == q.x, p == q.y);
-}
-static inline short3 operator==(ushort p, ushort3 q)
-{
- return short3(p == q.x, p == q.y, p == q.z);
-}
-static inline short4 operator==(ushort p, ushort4 q)
-{
- return short4(p == q.x, p == q.y, p == q.z, p == q.w);
-}
-static inline long2 operator==(long2 p, long2 q)
-{
- return long2(p.x == q.x, p.y == q.y);
-}
-static inline long3 operator==(long3 p, long3 q)
-{
- return long3(p.x == q.x, p.y == q.y, p.z == q.z);
-}
-static inline long4 operator==(long4 p, long4 q)
-{
- return long4(p.x == q.x, p.y == q.y, p.z == q.z, p.w == q.w);
-}
-static inline long2 operator==(long2 p, long q)
-{
- return long2(p.x == q, p.y == q);
-}
-static inline long3 operator==(long3 p, long q)
-{
- return long3(p.x == q, p.y == q, p.z == q);
-}
-static inline long4 operator==(long4 p, long q)
-{
- return long4(p.x == q, p.y == q, p.z == q, p.w == q);
-}
-static inline long2 operator==(long p, long2 q)
-{
- return long2(p == q.x, p == q.y);
-}
-static inline long3 operator==(long p, long3 q)
-{
- return long3(p == q.x, p == q.y, p == q.z);
-}
-static inline long4 operator==(long p, long4 q)
-{
- return long4(p == q.x, p == q.y, p == q.z, p == q.w);
-}
-static inline long2 operator==(ulong2 p, ulong2 q)
-{
- return long2(p.x == q.x, p.y == q.y);
-}
-static inline long3 operator==(ulong3 p, ulong3 q)
-{
- return long3(p.x == q.x, p.y == q.y, p.z == q.z);
-}
-static inline long4 operator==(ulong4 p, ulong4 q)
-{
- return long4(p.x == q.x, p.y == q.y, p.z == q.z, p.w == q.w);
-}
-static inline long2 operator==(ulong2 p, ulong q)
-{
- return long2(p.x == q, p.y == q);
-}
-static inline long3 operator==(ulong3 p, ulong q)
-{
- return long3(p.x == q, p.y == q, p.z == q);
-}
-static inline long4 operator==(ulong4 p, ulong q)
-{
- return long4(p.x == q, p.y == q, p.z == q, p.w == q);
-}
-static inline long2 operator==(ulong p, ulong2 q)
-{
- return long2(p == q.x, p == q.y);
-}
-static inline long3 operator==(ulong p, ulong3 q)
-{
- return long3(p == q.x, p == q.y, p == q.z);
-}
-static inline long4 operator==(ulong p, ulong4 q)
-{
- return long4(p == q.x, p == q.y, p == q.z, p == q.w);
-}
-static inline int2 operator!=(float2 p, float2 q)
-{
- return int2(p.x != q.x, p.y != q.y);
-}
-static inline int3 operator!=(float3 p, float3 q)
-{
- return int3(p.x != q.x, p.y != q.y, p.z != q.z);
-}
-static inline int4 operator!=(float4 p, float4 q)
-{
- return int4(p.x != q.x, p.y != q.y, p.z != q.z, p.w != q.w);
-}
-static inline int2 operator!=(float2 p, float q)
-{
- return int2(p.x != q, p.y != q);
-}
-static inline int3 operator!=(float3 p, float q)
-{
- return int3(p.x != q, p.y != q, p.z != q);
-}
-static inline int4 operator!=(float4 p, float q)
-{
- return int4(p.x != q, p.y != q, p.z != q, p.w != q);
-}
-static inline int2 operator!=(float p, float2 q)
-{
- return int2(p != q.x, p != q.y);
-}
-static inline int3 operator!=(float p, float3 q)
-{
- return int3(p != q.x, p != q.y, p != q.z);
-}
-static inline int4 operator!=(float p, float4 q)
-{
- return int4(p != q.x, p != q.y, p != q.z, p != q.w);
-}
-static inline long2 operator!=(double2 p, double2 q)
-{
- return long2(p.x != q.x, p.y != q.y);
-}
-static inline long3 operator!=(double3 p, double3 q)
-{
- return long3(p.x != q.x, p.y != q.y, p.z != q.z);
-}
-static inline long4 operator!=(double4 p, double4 q)
-{
- return long4(p.x != q.x, p.y != q.y, p.z != q.z, p.w != q.w);
-}
-static inline long2 operator!=(double2 p, double q)
-{
- return long2(p.x != q, p.y != q);
-}
-static inline long3 operator!=(double3 p, double q)
-{
- return long3(p.x != q, p.y != q, p.z != q);
-}
-static inline long4 operator!=(double4 p, double q)
-{
- return long4(p.x != q, p.y != q, p.z != q, p.w != q);
-}
-static inline long2 operator!=(double p, double2 q)
-{
- return long2(p != q.x, p != q.y);
-}
-static inline long3 operator!=(double p, double3 q)
-{
- return long3(p != q.x, p != q.y, p != q.z);
-}
-static inline long4 operator!=(double p, double4 q)
-{
- return long4(p != q.x, p != q.y, p != q.z, p != q.w);
-}
-static inline int2 operator!=(int2 p, int2 q)
-{
- return int2(p.x != q.x, p.y != q.y);
-}
-static inline int3 operator!=(int3 p, int3 q)
-{
- return int3(p.x != q.x, p.y != q.y, p.z != q.z);
-}
-static inline int4 operator!=(int4 p, int4 q)
-{
- return int4(p.x != q.x, p.y != q.y, p.z != q.z, p.w != q.w);
-}
-static inline int2 operator!=(int2 p, int q)
-{
- return int2(p.x != q, p.y != q);
-}
-static inline int3 operator!=(int3 p, int q)
-{
- return int3(p.x != q, p.y != q, p.z != q);
-}
-static inline int4 operator!=(int4 p, int q)
-{
- return int4(p.x != q, p.y != q, p.z != q, p.w != q);
-}
-static inline int2 operator!=(int p, int2 q)
-{
- return int2(p != q.x, p != q.y);
-}
-static inline int3 operator!=(int p, int3 q)
-{
- return int3(p != q.x, p != q.y, p != q.z);
-}
-static inline int4 operator!=(int p, int4 q)
-{
- return int4(p != q.x, p != q.y, p != q.z, p != q.w);
-}
-static inline int2 operator!=(uint2 p, uint2 q)
-{
- return int2(p.x != q.x, p.y != q.y);
-}
-static inline int3 operator!=(uint3 p, uint3 q)
-{
- return int3(p.x != q.x, p.y != q.y, p.z != q.z);
-}
-static inline int4 operator!=(uint4 p, uint4 q)
-{
- return int4(p.x != q.x, p.y != q.y, p.z != q.z, p.w != q.w);
-}
-static inline int2 operator!=(uint2 p, uint q)
-{
- return int2(p.x != q, p.y != q);
-}
-static inline int3 operator!=(uint3 p, uint q)
-{
- return int3(p.x != q, p.y != q, p.z != q);
-}
-static inline int4 operator!=(uint4 p, uint q)
-{
- return int4(p.x != q, p.y != q, p.z != q, p.w != q);
-}
-static inline int2 operator!=(uint p, uint2 q)
-{
- return int2(p != q.x, p != q.y);
-}
-static inline int3 operator!=(uint p, uint3 q)
-{
- return int3(p != q.x, p != q.y, p != q.z);
-}
-static inline int4 operator!=(uint p, uint4 q)
-{
- return int4(p != q.x, p != q.y, p != q.z, p != q.w);
-}
-static inline short2 operator!=(short2 p, short2 q)
-{
- return short2(p.x != q.x, p.y != q.y);
-}
-static inline short3 operator!=(short3 p, short3 q)
-{
- return short3(p.x != q.x, p.y != q.y, p.z != q.z);
-}
-static inline short4 operator!=(short4 p, short4 q)
-{
- return short4(p.x != q.x, p.y != q.y, p.z != q.z, p.w != q.w);
-}
-static inline short2 operator!=(short2 p, short q)
-{
- return short2(p.x != q, p.y != q);
-}
-static inline short3 operator!=(short3 p, short q)
-{
- return short3(p.x != q, p.y != q, p.z != q);
-}
-static inline short4 operator!=(short4 p, short q)
-{
- return short4(p.x != q, p.y != q, p.z != q, p.w != q);
-}
-static inline short2 operator!=(short p, short2 q)
-{
- return short2(p != q.x, p != q.y);
-}
-static inline short3 operator!=(short p, short3 q)
-{
- return short3(p != q.x, p != q.y, p != q.z);
-}
-static inline short4 operator!=(short p, short4 q)
-{
- return short4(p != q.x, p != q.y, p != q.z, p != q.w);
-}
-static inline short2 operator!=(ushort2 p, ushort2 q)
-{
- return short2(p.x != q.x, p.y != q.y);
-}
-static inline short3 operator!=(ushort3 p, ushort3 q)
-{
- return short3(p.x != q.x, p.y != q.y, p.z != q.z);
-}
-static inline short4 operator!=(ushort4 p, ushort4 q)
-{
- return short4(p.x != q.x, p.y != q.y, p.z != q.z, p.w != q.w);
-}
-static inline short2 operator!=(ushort2 p, ushort q)
-{
- return short2(p.x != q, p.y != q);
-}
-static inline short3 operator!=(ushort3 p, ushort q)
-{
- return short3(p.x != q, p.y != q, p.z != q);
-}
-static inline short4 operator!=(ushort4 p, ushort q)
-{
- return short4(p.x != q, p.y != q, p.z != q, p.w != q);
-}
-static inline short2 operator!=(ushort p, ushort2 q)
-{
- return short2(p != q.x, p != q.y);
-}
-static inline short3 operator!=(ushort p, ushort3 q)
-{
- return short3(p != q.x, p != q.y, p != q.z);
-}
-static inline short4 operator!=(ushort p, ushort4 q)
-{
- return short4(p != q.x, p != q.y, p != q.z, p != q.w);
-}
-static inline long2 operator!=(long2 p, long2 q)
-{
- return long2(p.x != q.x, p.y != q.y);
-}
-static inline long3 operator!=(long3 p, long3 q)
-{
- return long3(p.x != q.x, p.y != q.y, p.z != q.z);
-}
-static inline long4 operator!=(long4 p, long4 q)
-{
- return long4(p.x != q.x, p.y != q.y, p.z != q.z, p.w != q.w);
-}
-static inline long2 operator!=(long2 p, long q)
-{
- return long2(p.x != q, p.y != q);
-}
-static inline long3 operator!=(long3 p, long q)
-{
- return long3(p.x != q, p.y != q, p.z != q);
-}
-static inline long4 operator!=(long4 p, long q)
-{
- return long4(p.x != q, p.y != q, p.z != q, p.w != q);
-}
-static inline long2 operator!=(long p, long2 q)
-{
- return long2(p != q.x, p != q.y);
-}
-static inline long3 operator!=(long p, long3 q)
-{
- return long3(p != q.x, p != q.y, p != q.z);
-}
-static inline long4 operator!=(long p, long4 q)
-{
- return long4(p != q.x, p != q.y, p != q.z, p != q.w);
-}
-static inline long2 operator!=(ulong2 p, ulong2 q)
-{
- return long2(p.x != q.x, p.y != q.y);
-}
-static inline long3 operator!=(ulong3 p, ulong3 q)
-{
- return long3(p.x != q.x, p.y != q.y, p.z != q.z);
-}
-static inline long4 operator!=(ulong4 p, ulong4 q)
-{
- return long4(p.x != q.x, p.y != q.y, p.z != q.z, p.w != q.w);
-}
-static inline long2 operator!=(ulong2 p, ulong q)
-{
- return long2(p.x != q, p.y != q);
-}
-static inline long3 operator!=(ulong3 p, ulong q)
-{
- return long3(p.x != q, p.y != q, p.z != q);
-}
-static inline long4 operator!=(ulong4 p, ulong q)
-{
- return long4(p.x != q, p.y != q, p.z != q, p.w != q);
-}
-static inline long2 operator!=(ulong p, ulong2 q)
-{
- return long2(p != q.x, p != q.y);
-}
-static inline long3 operator!=(ulong p, ulong3 q)
-{
- return long3(p != q.x, p != q.y, p != q.z);
-}
-static inline long4 operator!=(ulong p, ulong4 q)
-{
- return long4(p != q.x, p != q.y, p != q.z, p != q.w);
-}
-static inline int2 operator>(float2 p, float2 q)
-{
- return int2(p.x > q.x, p.y > q.y);
-}
-static inline int3 operator>(float3 p, float3 q)
-{
- return int3(p.x > q.x, p.y > q.y, p.z > q.z);
-}
-static inline int4 operator>(float4 p, float4 q)
-{
- return int4(p.x > q.x, p.y > q.y, p.z > q.z, p.w > q.w);
-}
-static inline int2 operator>(float2 p, float q)
-{
- return int2(p.x > q, p.y > q);
-}
-static inline int3 operator>(float3 p, float q)
-{
- return int3(p.x > q, p.y > q, p.z > q);
-}
-static inline int4 operator>(float4 p, float q)
-{
- return int4(p.x > q, p.y > q, p.z > q, p.w > q);
-}
-static inline int2 operator>(float p, float2 q)
-{
- return int2(p > q.x, p > q.y);
-}
-static inline int3 operator>(float p, float3 q)
-{
- return int3(p > q.x, p > q.y, p > q.z);
-}
-static inline int4 operator>(float p, float4 q)
-{
- return int4(p > q.x, p > q.y, p > q.z, p > q.w);
-}
-static inline long2 operator>(double2 p, double2 q)
-{
- return long2(p.x > q.x, p.y > q.y);
-}
-static inline long3 operator>(double3 p, double3 q)
-{
- return long3(p.x > q.x, p.y > q.y, p.z > q.z);
-}
-static inline long4 operator>(double4 p, double4 q)
-{
- return long4(p.x > q.x, p.y > q.y, p.z > q.z, p.w > q.w);
-}
-static inline long2 operator>(double2 p, double q)
-{
- return long2(p.x > q, p.y > q);
-}
-static inline long3 operator>(double3 p, double q)
-{
- return long3(p.x > q, p.y > q, p.z > q);
-}
-static inline long4 operator>(double4 p, double q)
-{
- return long4(p.x > q, p.y > q, p.z > q, p.w > q);
-}
-static inline long2 operator>(double p, double2 q)
-{
- return long2(p > q.x, p > q.y);
-}
-static inline long3 operator>(double p, double3 q)
-{
- return long3(p > q.x, p > q.y, p > q.z);
-}
-static inline long4 operator>(double p, double4 q)
-{
- return long4(p > q.x, p > q.y, p > q.z, p > q.w);
-}
-static inline int2 operator>(int2 p, int2 q)
-{
- return int2(p.x > q.x, p.y > q.y);
-}
-static inline int3 operator>(int3 p, int3 q)
-{
- return int3(p.x > q.x, p.y > q.y, p.z > q.z);
-}
-static inline int4 operator>(int4 p, int4 q)
-{
- return int4(p.x > q.x, p.y > q.y, p.z > q.z, p.w > q.w);
-}
-static inline int2 operator>(int2 p, int q)
-{
- return int2(p.x > q, p.y > q);
-}
-static inline int3 operator>(int3 p, int q)
-{
- return int3(p.x > q, p.y > q, p.z > q);
-}
-static inline int4 operator>(int4 p, int q)
-{
- return int4(p.x > q, p.y > q, p.z > q, p.w > q);
-}
-static inline int2 operator>(int p, int2 q)
-{
- return int2(p > q.x, p > q.y);
-}
-static inline int3 operator>(int p, int3 q)
-{
- return int3(p > q.x, p > q.y, p > q.z);
-}
-static inline int4 operator>(int p, int4 q)
-{
- return int4(p > q.x, p > q.y, p > q.z, p > q.w);
-}
-static inline int2 operator>(uint2 p, uint2 q)
-{
- return int2(p.x > q.x, p.y > q.y);
-}
-static inline int3 operator>(uint3 p, uint3 q)
-{
- return int3(p.x > q.x, p.y > q.y, p.z > q.z);
-}
-static inline int4 operator>(uint4 p, uint4 q)
-{
- return int4(p.x > q.x, p.y > q.y, p.z > q.z, p.w > q.w);
-}
-static inline int2 operator>(uint2 p, uint q)
-{
- return int2(p.x > q, p.y > q);
-}
-static inline int3 operator>(uint3 p, uint q)
-{
- return int3(p.x > q, p.y > q, p.z > q);
-}
-static inline int4 operator>(uint4 p, uint q)
-{
- return int4(p.x > q, p.y > q, p.z > q, p.w > q);
-}
-static inline int2 operator>(uint p, uint2 q)
-{
- return int2(p > q.x, p > q.y);
-}
-static inline int3 operator>(uint p, uint3 q)
-{
- return int3(p > q.x, p > q.y, p > q.z);
-}
-static inline int4 operator>(uint p, uint4 q)
-{
- return int4(p > q.x, p > q.y, p > q.z, p > q.w);
-}
-static inline short2 operator>(short2 p, short2 q)
-{
- return short2(p.x > q.x, p.y > q.y);
-}
-static inline short3 operator>(short3 p, short3 q)
-{
- return short3(p.x > q.x, p.y > q.y, p.z > q.z);
-}
-static inline short4 operator>(short4 p, short4 q)
-{
- return short4(p.x > q.x, p.y > q.y, p.z > q.z, p.w > q.w);
-}
-static inline short2 operator>(short2 p, short q)
-{
- return short2(p.x > q, p.y > q);
-}
-static inline short3 operator>(short3 p, short q)
-{
- return short3(p.x > q, p.y > q, p.z > q);
-}
-static inline short4 operator>(short4 p, short q)
-{
- return short4(p.x > q, p.y > q, p.z > q, p.w > q);
-}
-static inline short2 operator>(short p, short2 q)
-{
- return short2(p > q.x, p > q.y);
-}
-static inline short3 operator>(short p, short3 q)
-{
- return short3(p > q.x, p > q.y, p > q.z);
-}
-static inline short4 operator>(short p, short4 q)
-{
- return short4(p > q.x, p > q.y, p > q.z, p > q.w);
-}
-static inline short2 operator>(ushort2 p, ushort2 q)
-{
- return short2(p.x > q.x, p.y > q.y);
-}
-static inline short3 operator>(ushort3 p, ushort3 q)
-{
- return short3(p.x > q.x, p.y > q.y, p.z > q.z);
-}
-static inline short4 operator>(ushort4 p, ushort4 q)
-{
- return short4(p.x > q.x, p.y > q.y, p.z > q.z, p.w > q.w);
-}
-static inline short2 operator>(ushort2 p, ushort q)
-{
- return short2(p.x > q, p.y > q);
-}
-static inline short3 operator>(ushort3 p, ushort q)
-{
- return short3(p.x > q, p.y > q, p.z > q);
-}
-static inline short4 operator>(ushort4 p, ushort q)
-{
- return short4(p.x > q, p.y > q, p.z > q, p.w > q);
-}
-static inline short2 operator>(ushort p, ushort2 q)
-{
- return short2(p > q.x, p > q.y);
-}
-static inline short3 operator>(ushort p, ushort3 q)
-{
- return short3(p > q.x, p > q.y, p > q.z);
-}
-static inline short4 operator>(ushort p, ushort4 q)
-{
- return short4(p > q.x, p > q.y, p > q.z, p > q.w);
-}
-static inline long2 operator>(long2 p, long2 q)
-{
- return long2(p.x > q.x, p.y > q.y);
-}
-static inline long3 operator>(long3 p, long3 q)
-{
- return long3(p.x > q.x, p.y > q.y, p.z > q.z);
-}
-static inline long4 operator>(long4 p, long4 q)
-{
- return long4(p.x > q.x, p.y > q.y, p.z > q.z, p.w > q.w);
-}
-static inline long2 operator>(long2 p, long q)
-{
- return long2(p.x > q, p.y > q);
-}
-static inline long3 operator>(long3 p, long q)
-{
- return long3(p.x > q, p.y > q, p.z > q);
-}
-static inline long4 operator>(long4 p, long q)
-{
- return long4(p.x > q, p.y > q, p.z > q, p.w > q);
-}
-static inline long2 operator>(long p, long2 q)
-{
- return long2(p > q.x, p > q.y);
-}
-static inline long3 operator>(long p, long3 q)
-{
- return long3(p > q.x, p > q.y, p > q.z);
-}
-static inline long4 operator>(long p, long4 q)
-{
- return long4(p > q.x, p > q.y, p > q.z, p > q.w);
-}
-static inline long2 operator>(ulong2 p, ulong2 q)
-{
- return long2(p.x > q.x, p.y > q.y);
-}
-static inline long3 operator>(ulong3 p, ulong3 q)
-{
- return long3(p.x > q.x, p.y > q.y, p.z > q.z);
-}
-static inline long4 operator>(ulong4 p, ulong4 q)
-{
- return long4(p.x > q.x, p.y > q.y, p.z > q.z, p.w > q.w);
-}
-static inline long2 operator>(ulong2 p, ulong q)
-{
- return long2(p.x > q, p.y > q);
-}
-static inline long3 operator>(ulong3 p, ulong q)
-{
- return long3(p.x > q, p.y > q, p.z > q);
-}
-static inline long4 operator>(ulong4 p, ulong q)
-{
- return long4(p.x > q, p.y > q, p.z > q, p.w > q);
-}
-static inline long2 operator>(ulong p, ulong2 q)
-{
- return long2(p > q.x, p > q.y);
-}
-static inline long3 operator>(ulong p, ulong3 q)
-{
- return long3(p > q.x, p > q.y, p > q.z);
-}
-static inline long4 operator>(ulong p, ulong4 q)
-{
- return long4(p > q.x, p > q.y, p > q.z, p > q.w);
-}
-static inline int2 operator<(float2 p, float2 q)
-{
- return int2(p.x < q.x, p.y < q.y);
-}
-static inline int3 operator<(float3 p, float3 q)
-{
- return int3(p.x < q.x, p.y < q.y, p.z < q.z);
-}
-static inline int4 operator<(float4 p, float4 q)
-{
- return int4(p.x < q.x, p.y < q.y, p.z < q.z, p.w < q.w);
-}
-static inline int2 operator<(float2 p, float q)
-{
- return int2(p.x < q, p.y < q);
-}
-static inline int3 operator<(float3 p, float q)
-{
- return int3(p.x < q, p.y < q, p.z < q);
-}
-static inline int4 operator<(float4 p, float q)
-{
- return int4(p.x < q, p.y < q, p.z < q, p.w < q);
-}
-static inline int2 operator<(float p, float2 q)
-{
- return int2(p < q.x, p < q.y);
-}
-static inline int3 operator<(float p, float3 q)
-{
- return int3(p < q.x, p < q.y, p < q.z);
-}
-static inline int4 operator<(float p, float4 q)
-{
- return int4(p < q.x, p < q.y, p < q.z, p < q.w);
-}
-static inline long2 operator<(double2 p, double2 q)
-{
- return long2(p.x < q.x, p.y < q.y);
-}
-static inline long3 operator<(double3 p, double3 q)
-{
- return long3(p.x < q.x, p.y < q.y, p.z < q.z);
-}
-static inline long4 operator<(double4 p, double4 q)
-{
- return long4(p.x < q.x, p.y < q.y, p.z < q.z, p.w < q.w);
-}
-static inline long2 operator<(double2 p, double q)
-{
- return long2(p.x < q, p.y < q);
-}
-static inline long3 operator<(double3 p, double q)
-{
- return long3(p.x < q, p.y < q, p.z < q);
-}
-static inline long4 operator<(double4 p, double q)
-{
- return long4(p.x < q, p.y < q, p.z < q, p.w < q);
-}
-static inline long2 operator<(double p, double2 q)
-{
- return long2(p < q.x, p < q.y);
-}
-static inline long3 operator<(double p, double3 q)
-{
- return long3(p < q.x, p < q.y, p < q.z);
-}
-static inline long4 operator<(double p, double4 q)
-{
- return long4(p < q.x, p < q.y, p < q.z, p < q.w);
-}
-static inline int2 operator<(int2 p, int2 q)
-{
- return int2(p.x < q.x, p.y < q.y);
-}
-static inline int3 operator<(int3 p, int3 q)
-{
- return int3(p.x < q.x, p.y < q.y, p.z < q.z);
-}
-static inline int4 operator<(int4 p, int4 q)
-{
- return int4(p.x < q.x, p.y < q.y, p.z < q.z, p.w < q.w);
-}
-static inline int2 operator<(int2 p, int q)
-{
- return int2(p.x < q, p.y < q);
-}
-static inline int3 operator<(int3 p, int q)
-{
- return int3(p.x < q, p.y < q, p.z < q);
-}
-static inline int4 operator<(int4 p, int q)
-{
- return int4(p.x < q, p.y < q, p.z < q, p.w < q);
-}
-static inline int2 operator<(int p, int2 q)
-{
- return int2(p < q.x, p < q.y);
-}
-static inline int3 operator<(int p, int3 q)
-{
- return int3(p < q.x, p < q.y, p < q.z);
-}
-static inline int4 operator<(int p, int4 q)
-{
- return int4(p < q.x, p < q.y, p < q.z, p < q.w);
-}
-static inline int2 operator<(uint2 p, uint2 q)
-{
- return int2(p.x < q.x, p.y < q.y);
-}
-static inline int3 operator<(uint3 p, uint3 q)
-{
- return int3(p.x < q.x, p.y < q.y, p.z < q.z);
-}
-static inline int4 operator<(uint4 p, uint4 q)
-{
- return int4(p.x < q.x, p.y < q.y, p.z < q.z, p.w < q.w);
-}
-static inline int2 operator<(uint2 p, uint q)
-{
- return int2(p.x < q, p.y < q);
-}
-static inline int3 operator<(uint3 p, uint q)
-{
- return int3(p.x < q, p.y < q, p.z < q);
-}
-static inline int4 operator<(uint4 p, uint q)
-{
- return int4(p.x < q, p.y < q, p.z < q, p.w < q);
-}
-static inline int2 operator<(uint p, uint2 q)
-{
- return int2(p < q.x, p < q.y);
-}
-static inline int3 operator<(uint p, uint3 q)
-{
- return int3(p < q.x, p < q.y, p < q.z);
-}
-static inline int4 operator<(uint p, uint4 q)
-{
- return int4(p < q.x, p < q.y, p < q.z, p < q.w);
-}
-static inline short2 operator<(short2 p, short2 q)
-{
- return short2(p.x < q.x, p.y < q.y);
-}
-static inline short3 operator<(short3 p, short3 q)
-{
- return short3(p.x < q.x, p.y < q.y, p.z < q.z);
-}
-static inline short4 operator<(short4 p, short4 q)
-{
- return short4(p.x < q.x, p.y < q.y, p.z < q.z, p.w < q.w);
-}
-static inline short2 operator<(short2 p, short q)
-{
- return short2(p.x < q, p.y < q);
-}
-static inline short3 operator<(short3 p, short q)
-{
- return short3(p.x < q, p.y < q, p.z < q);
-}
-static inline short4 operator<(short4 p, short q)
-{
- return short4(p.x < q, p.y < q, p.z < q, p.w < q);
-}
-static inline short2 operator<(short p, short2 q)
-{
- return short2(p < q.x, p < q.y);
-}
-static inline short3 operator<(short p, short3 q)
-{
- return short3(p < q.x, p < q.y, p < q.z);
-}
-static inline short4 operator<(short p, short4 q)
-{
- return short4(p < q.x, p < q.y, p < q.z, p < q.w);
-}
-static inline short2 operator<(ushort2 p, ushort2 q)
-{
- return short2(p.x < q.x, p.y < q.y);
-}
-static inline short3 operator<(ushort3 p, ushort3 q)
-{
- return short3(p.x < q.x, p.y < q.y, p.z < q.z);
-}
-static inline short4 operator<(ushort4 p, ushort4 q)
-{
- return short4(p.x < q.x, p.y < q.y, p.z < q.z, p.w < q.w);
-}
-static inline short2 operator<(ushort2 p, ushort q)
-{
- return short2(p.x < q, p.y < q);
-}
-static inline short3 operator<(ushort3 p, ushort q)
-{
- return short3(p.x < q, p.y < q, p.z < q);
-}
-static inline short4 operator<(ushort4 p, ushort q)
-{
- return short4(p.x < q, p.y < q, p.z < q, p.w < q);
-}
-static inline short2 operator<(ushort p, ushort2 q)
-{
- return short2(p < q.x, p < q.y);
-}
-static inline short3 operator<(ushort p, ushort3 q)
-{
- return short3(p < q.x, p < q.y, p < q.z);
-}
-static inline short4 operator<(ushort p, ushort4 q)
-{
- return short4(p < q.x, p < q.y, p < q.z, p < q.w);
-}
-static inline long2 operator<(long2 p, long2 q)
-{
- return long2(p.x < q.x, p.y < q.y);
-}
-static inline long3 operator<(long3 p, long3 q)
-{
- return long3(p.x < q.x, p.y < q.y, p.z < q.z);
-}
-static inline long4 operator<(long4 p, long4 q)
-{
- return long4(p.x < q.x, p.y < q.y, p.z < q.z, p.w < q.w);
-}
-static inline long2 operator<(long2 p, long q)
-{
- return long2(p.x < q, p.y < q);
-}
-static inline long3 operator<(long3 p, long q)
-{
- return long3(p.x < q, p.y < q, p.z < q);
-}
-static inline long4 operator<(long4 p, long q)
-{
- return long4(p.x < q, p.y < q, p.z < q, p.w < q);
-}
-static inline long2 operator<(long p, long2 q)
-{
- return long2(p < q.x, p < q.y);
-}
-static inline long3 operator<(long p, long3 q)
-{
- return long3(p < q.x, p < q.y, p < q.z);
-}
-static inline long4 operator<(long p, long4 q)
-{
- return long4(p < q.x, p < q.y, p < q.z, p < q.w);
-}
-static inline long2 operator<(ulong2 p, ulong2 q)
-{
- return long2(p.x < q.x, p.y < q.y);
-}
-static inline long3 operator<(ulong3 p, ulong3 q)
-{
- return long3(p.x < q.x, p.y < q.y, p.z < q.z);
-}
-static inline long4 operator<(ulong4 p, ulong4 q)
-{
- return long4(p.x < q.x, p.y < q.y, p.z < q.z, p.w < q.w);
-}
-static inline long2 operator<(ulong2 p, ulong q)
-{
- return long2(p.x < q, p.y < q);
-}
-static inline long3 operator<(ulong3 p, ulong q)
-{
- return long3(p.x < q, p.y < q, p.z < q);
-}
-static inline long4 operator<(ulong4 p, ulong q)
-{
- return long4(p.x < q, p.y < q, p.z < q, p.w < q);
-}
-static inline long2 operator<(ulong p, ulong2 q)
-{
- return long2(p < q.x, p < q.y);
-}
-static inline long3 operator<(ulong p, ulong3 q)
-{
- return long3(p < q.x, p < q.y, p < q.z);
-}
-static inline long4 operator<(ulong p, ulong4 q)
-{
- return long4(p < q.x, p < q.y, p < q.z, p < q.w);
-}
-static inline int2 operator>=(float2 p, float2 q)
-{
- return int2(p.x >= q.x, p.y >= q.y);
-}
-static inline int3 operator>=(float3 p, float3 q)
-{
- return int3(p.x >= q.x, p.y >= q.y, p.z >= q.z);
-}
-static inline int4 operator>=(float4 p, float4 q)
-{
- return int4(p.x >= q.x, p.y >= q.y, p.z >= q.z, p.w >= q.w);
-}
-static inline int2 operator>=(float2 p, float q)
-{
- return int2(p.x >= q, p.y >= q);
-}
-static inline int3 operator>=(float3 p, float q)
-{
- return int3(p.x >= q, p.y >= q, p.z >= q);
-}
-static inline int4 operator>=(float4 p, float q)
-{
- return int4(p.x >= q, p.y >= q, p.z >= q, p.w >= q);
-}
-static inline int2 operator>=(float p, float2 q)
-{
- return int2(p >= q.x, p >= q.y);
-}
-static inline int3 operator>=(float p, float3 q)
-{
- return int3(p >= q.x, p >= q.y, p >= q.z);
-}
-static inline int4 operator>=(float p, float4 q)
-{
- return int4(p >= q.x, p >= q.y, p >= q.z, p >= q.w);
-}
-static inline long2 operator>=(double2 p, double2 q)
-{
- return long2(p.x >= q.x, p.y >= q.y);
-}
-static inline long3 operator>=(double3 p, double3 q)
-{
- return long3(p.x >= q.x, p.y >= q.y, p.z >= q.z);
-}
-static inline long4 operator>=(double4 p, double4 q)
-{
- return long4(p.x >= q.x, p.y >= q.y, p.z >= q.z, p.w >= q.w);
-}
-static inline long2 operator>=(double2 p, double q)
-{
- return long2(p.x >= q, p.y >= q);
-}
-static inline long3 operator>=(double3 p, double q)
-{
- return long3(p.x >= q, p.y >= q, p.z >= q);
-}
-static inline long4 operator>=(double4 p, double q)
-{
- return long4(p.x >= q, p.y >= q, p.z >= q, p.w >= q);
-}
-static inline long2 operator>=(double p, double2 q)
-{
- return long2(p >= q.x, p >= q.y);
-}
-static inline long3 operator>=(double p, double3 q)
-{
- return long3(p >= q.x, p >= q.y, p >= q.z);
-}
-static inline long4 operator>=(double p, double4 q)
-{
- return long4(p >= q.x, p >= q.y, p >= q.z, p >= q.w);
-}
-static inline int2 operator>=(int2 p, int2 q)
-{
- return int2(p.x >= q.x, p.y >= q.y);
-}
-static inline int3 operator>=(int3 p, int3 q)
-{
- return int3(p.x >= q.x, p.y >= q.y, p.z >= q.z);
-}
-static inline int4 operator>=(int4 p, int4 q)
-{
- return int4(p.x >= q.x, p.y >= q.y, p.z >= q.z, p.w >= q.w);
-}
-static inline int2 operator>=(int2 p, int q)
-{
- return int2(p.x >= q, p.y >= q);
-}
-static inline int3 operator>=(int3 p, int q)
-{
- return int3(p.x >= q, p.y >= q, p.z >= q);
-}
-static inline int4 operator>=(int4 p, int q)
-{
- return int4(p.x >= q, p.y >= q, p.z >= q, p.w >= q);
-}
-static inline int2 operator>=(int p, int2 q)
-{
- return int2(p >= q.x, p >= q.y);
-}
-static inline int3 operator>=(int p, int3 q)
-{
- return int3(p >= q.x, p >= q.y, p >= q.z);
-}
-static inline int4 operator>=(int p, int4 q)
-{
- return int4(p >= q.x, p >= q.y, p >= q.z, p >= q.w);
-}
-static inline int2 operator>=(uint2 p, uint2 q)
-{
- return int2(p.x >= q.x, p.y >= q.y);
-}
-static inline int3 operator>=(uint3 p, uint3 q)
-{
- return int3(p.x >= q.x, p.y >= q.y, p.z >= q.z);
-}
-static inline int4 operator>=(uint4 p, uint4 q)
-{
- return int4(p.x >= q.x, p.y >= q.y, p.z >= q.z, p.w >= q.w);
-}
-static inline int2 operator>=(uint2 p, uint q)
-{
- return int2(p.x >= q, p.y >= q);
-}
-static inline int3 operator>=(uint3 p, uint q)
-{
- return int3(p.x >= q, p.y >= q, p.z >= q);
-}
-static inline int4 operator>=(uint4 p, uint q)
-{
- return int4(p.x >= q, p.y >= q, p.z >= q, p.w >= q);
-}
-static inline int2 operator>=(uint p, uint2 q)
-{
- return int2(p >= q.x, p >= q.y);
-}
-static inline int3 operator>=(uint p, uint3 q)
-{
- return int3(p >= q.x, p >= q.y, p >= q.z);
-}
-static inline int4 operator>=(uint p, uint4 q)
-{
- return int4(p >= q.x, p >= q.y, p >= q.z, p >= q.w);
-}
-static inline short2 operator>=(short2 p, short2 q)
-{
- return short2(p.x >= q.x, p.y >= q.y);
-}
-static inline short3 operator>=(short3 p, short3 q)
-{
- return short3(p.x >= q.x, p.y >= q.y, p.z >= q.z);
-}
-static inline short4 operator>=(short4 p, short4 q)
-{
- return short4(p.x >= q.x, p.y >= q.y, p.z >= q.z, p.w >= q.w);
-}
-static inline short2 operator>=(short2 p, short q)
-{
- return short2(p.x >= q, p.y >= q);
-}
-static inline short3 operator>=(short3 p, short q)
-{
- return short3(p.x >= q, p.y >= q, p.z >= q);
-}
-static inline short4 operator>=(short4 p, short q)
-{
- return short4(p.x >= q, p.y >= q, p.z >= q, p.w >= q);
-}
-static inline short2 operator>=(short p, short2 q)
-{
- return short2(p >= q.x, p >= q.y);
-}
-static inline short3 operator>=(short p, short3 q)
-{
- return short3(p >= q.x, p >= q.y, p >= q.z);
-}
-static inline short4 operator>=(short p, short4 q)
-{
- return short4(p >= q.x, p >= q.y, p >= q.z, p >= q.w);
-}
-static inline short2 operator>=(ushort2 p, ushort2 q)
-{
- return short2(p.x >= q.x, p.y >= q.y);
-}
-static inline short3 operator>=(ushort3 p, ushort3 q)
-{
- return short3(p.x >= q.x, p.y >= q.y, p.z >= q.z);
-}
-static inline short4 operator>=(ushort4 p, ushort4 q)
-{
- return short4(p.x >= q.x, p.y >= q.y, p.z >= q.z, p.w >= q.w);
-}
-static inline short2 operator>=(ushort2 p, ushort q)
-{
- return short2(p.x >= q, p.y >= q);
-}
-static inline short3 operator>=(ushort3 p, ushort q)
-{
- return short3(p.x >= q, p.y >= q, p.z >= q);
-}
-static inline short4 operator>=(ushort4 p, ushort q)
-{
- return short4(p.x >= q, p.y >= q, p.z >= q, p.w >= q);
-}
-static inline short2 operator>=(ushort p, ushort2 q)
-{
- return short2(p >= q.x, p >= q.y);
-}
-static inline short3 operator>=(ushort p, ushort3 q)
-{
- return short3(p >= q.x, p >= q.y, p >= q.z);
-}
-static inline short4 operator>=(ushort p, ushort4 q)
-{
- return short4(p >= q.x, p >= q.y, p >= q.z, p >= q.w);
-}
-static inline long2 operator>=(long2 p, long2 q)
-{
- return long2(p.x >= q.x, p.y >= q.y);
-}
-static inline long3 operator>=(long3 p, long3 q)
-{
- return long3(p.x >= q.x, p.y >= q.y, p.z >= q.z);
-}
-static inline long4 operator>=(long4 p, long4 q)
-{
- return long4(p.x >= q.x, p.y >= q.y, p.z >= q.z, p.w >= q.w);
-}
-static inline long2 operator>=(long2 p, long q)
-{
- return long2(p.x >= q, p.y >= q);
-}
-static inline long3 operator>=(long3 p, long q)
-{
- return long3(p.x >= q, p.y >= q, p.z >= q);
-}
-static inline long4 operator>=(long4 p, long q)
-{
- return long4(p.x >= q, p.y >= q, p.z >= q, p.w >= q);
-}
-static inline long2 operator>=(long p, long2 q)
-{
- return long2(p >= q.x, p >= q.y);
-}
-static inline long3 operator>=(long p, long3 q)
-{
- return long3(p >= q.x, p >= q.y, p >= q.z);
-}
-static inline long4 operator>=(long p, long4 q)
-{
- return long4(p >= q.x, p >= q.y, p >= q.z, p >= q.w);
-}
-static inline long2 operator>=(ulong2 p, ulong2 q)
-{
- return long2(p.x >= q.x, p.y >= q.y);
-}
-static inline long3 operator>=(ulong3 p, ulong3 q)
-{
- return long3(p.x >= q.x, p.y >= q.y, p.z >= q.z);
-}
-static inline long4 operator>=(ulong4 p, ulong4 q)
-{
- return long4(p.x >= q.x, p.y >= q.y, p.z >= q.z, p.w >= q.w);
-}
-static inline long2 operator>=(ulong2 p, ulong q)
-{
- return long2(p.x >= q, p.y >= q);
-}
-static inline long3 operator>=(ulong3 p, ulong q)
-{
- return long3(p.x >= q, p.y >= q, p.z >= q);
-}
-static inline long4 operator>=(ulong4 p, ulong q)
-{
- return long4(p.x >= q, p.y >= q, p.z >= q, p.w >= q);
-}
-static inline long2 operator>=(ulong p, ulong2 q)
-{
- return long2(p >= q.x, p >= q.y);
-}
-static inline long3 operator>=(ulong p, ulong3 q)
-{
- return long3(p >= q.x, p >= q.y, p >= q.z);
-}
-static inline long4 operator>=(ulong p, ulong4 q)
-{
- return long4(p >= q.x, p >= q.y, p >= q.z, p >= q.w);
-}
-static inline int2 operator<=(float2 p, float2 q)
-{
- return int2(p.x <= q.x, p.y <= q.y);
-}
-static inline int3 operator<=(float3 p, float3 q)
-{
- return int3(p.x <= q.x, p.y <= q.y, p.z <= q.z);
-}
-static inline int4 operator<=(float4 p, float4 q)
-{
- return int4(p.x <= q.x, p.y <= q.y, p.z <= q.z, p.w <= q.w);
-}
-static inline int2 operator<=(float2 p, float q)
-{
- return int2(p.x <= q, p.y <= q);
-}
-static inline int3 operator<=(float3 p, float q)
-{
- return int3(p.x <= q, p.y <= q, p.z <= q);
-}
-static inline int4 operator<=(float4 p, float q)
-{
- return int4(p.x <= q, p.y <= q, p.z <= q, p.w <= q);
-}
-static inline int2 operator<=(float p, float2 q)
-{
- return int2(p <= q.x, p <= q.y);
-}
-static inline int3 operator<=(float p, float3 q)
-{
- return int3(p <= q.x, p <= q.y, p <= q.z);
-}
-static inline int4 operator<=(float p, float4 q)
-{
- return int4(p <= q.x, p <= q.y, p <= q.z, p <= q.w);
-}
-static inline long2 operator<=(double2 p, double2 q)
-{
- return long2(p.x <= q.x, p.y <= q.y);
-}
-static inline long3 operator<=(double3 p, double3 q)
-{
- return long3(p.x <= q.x, p.y <= q.y, p.z <= q.z);
-}
-static inline long4 operator<=(double4 p, double4 q)
-{
- return long4(p.x <= q.x, p.y <= q.y, p.z <= q.z, p.w <= q.w);
-}
-static inline long2 operator<=(double2 p, double q)
-{
- return long2(p.x <= q, p.y <= q);
-}
-static inline long3 operator<=(double3 p, double q)
-{
- return long3(p.x <= q, p.y <= q, p.z <= q);
-}
-static inline long4 operator<=(double4 p, double q)
-{
- return long4(p.x <= q, p.y <= q, p.z <= q, p.w <= q);
-}
-static inline long2 operator<=(double p, double2 q)
-{
- return long2(p <= q.x, p <= q.y);
-}
-static inline long3 operator<=(double p, double3 q)
-{
- return long3(p <= q.x, p <= q.y, p <= q.z);
-}
-static inline long4 operator<=(double p, double4 q)
-{
- return long4(p <= q.x, p <= q.y, p <= q.z, p <= q.w);
-}
-static inline int2 operator<=(int2 p, int2 q)
-{
- return int2(p.x <= q.x, p.y <= q.y);
-}
-static inline int3 operator<=(int3 p, int3 q)
-{
- return int3(p.x <= q.x, p.y <= q.y, p.z <= q.z);
-}
-static inline int4 operator<=(int4 p, int4 q)
-{
- return int4(p.x <= q.x, p.y <= q.y, p.z <= q.z, p.w <= q.w);
-}
-static inline int2 operator<=(int2 p, int q)
-{
- return int2(p.x <= q, p.y <= q);
-}
-static inline int3 operator<=(int3 p, int q)
-{
- return int3(p.x <= q, p.y <= q, p.z <= q);
-}
-static inline int4 operator<=(int4 p, int q)
-{
- return int4(p.x <= q, p.y <= q, p.z <= q, p.w <= q);
-}
-static inline int2 operator<=(int p, int2 q)
-{
- return int2(p <= q.x, p <= q.y);
-}
-static inline int3 operator<=(int p, int3 q)
-{
- return int3(p <= q.x, p <= q.y, p <= q.z);
-}
-static inline int4 operator<=(int p, int4 q)
-{
- return int4(p <= q.x, p <= q.y, p <= q.z, p <= q.w);
-}
-static inline int2 operator<=(uint2 p, uint2 q)
-{
- return int2(p.x <= q.x, p.y <= q.y);
-}
-static inline int3 operator<=(uint3 p, uint3 q)
-{
- return int3(p.x <= q.x, p.y <= q.y, p.z <= q.z);
-}
-static inline int4 operator<=(uint4 p, uint4 q)
-{
- return int4(p.x <= q.x, p.y <= q.y, p.z <= q.z, p.w <= q.w);
-}
-static inline int2 operator<=(uint2 p, uint q)
-{
- return int2(p.x <= q, p.y <= q);
-}
-static inline int3 operator<=(uint3 p, uint q)
-{
- return int3(p.x <= q, p.y <= q, p.z <= q);
-}
-static inline int4 operator<=(uint4 p, uint q)
-{
- return int4(p.x <= q, p.y <= q, p.z <= q, p.w <= q);
-}
-static inline int2 operator<=(uint p, uint2 q)
-{
- return int2(p <= q.x, p <= q.y);
-}
-static inline int3 operator<=(uint p, uint3 q)
-{
- return int3(p <= q.x, p <= q.y, p <= q.z);
-}
-static inline int4 operator<=(uint p, uint4 q)
-{
- return int4(p <= q.x, p <= q.y, p <= q.z, p <= q.w);
-}
-static inline short2 operator<=(short2 p, short2 q)
-{
- return short2(p.x <= q.x, p.y <= q.y);
-}
-static inline short3 operator<=(short3 p, short3 q)
-{
- return short3(p.x <= q.x, p.y <= q.y, p.z <= q.z);
-}
-static inline short4 operator<=(short4 p, short4 q)
-{
- return short4(p.x <= q.x, p.y <= q.y, p.z <= q.z, p.w <= q.w);
-}
-static inline short2 operator<=(short2 p, short q)
-{
- return short2(p.x <= q, p.y <= q);
-}
-static inline short3 operator<=(short3 p, short q)
-{
- return short3(p.x <= q, p.y <= q, p.z <= q);
-}
-static inline short4 operator<=(short4 p, short q)
-{
- return short4(p.x <= q, p.y <= q, p.z <= q, p.w <= q);
-}
-static inline short2 operator<=(short p, short2 q)
-{
- return short2(p <= q.x, p <= q.y);
-}
-static inline short3 operator<=(short p, short3 q)
-{
- return short3(p <= q.x, p <= q.y, p <= q.z);
-}
-static inline short4 operator<=(short p, short4 q)
-{
- return short4(p <= q.x, p <= q.y, p <= q.z, p <= q.w);
-}
-static inline short2 operator<=(ushort2 p, ushort2 q)
-{
- return short2(p.x <= q.x, p.y <= q.y);
-}
-static inline short3 operator<=(ushort3 p, ushort3 q)
-{
- return short3(p.x <= q.x, p.y <= q.y, p.z <= q.z);
-}
-static inline short4 operator<=(ushort4 p, ushort4 q)
-{
- return short4(p.x <= q.x, p.y <= q.y, p.z <= q.z, p.w <= q.w);
-}
-static inline short2 operator<=(ushort2 p, ushort q)
-{
- return short2(p.x <= q, p.y <= q);
-}
-static inline short3 operator<=(ushort3 p, ushort q)
-{
- return short3(p.x <= q, p.y <= q, p.z <= q);
-}
-static inline short4 operator<=(ushort4 p, ushort q)
-{
- return short4(p.x <= q, p.y <= q, p.z <= q, p.w <= q);
-}
-static inline short2 operator<=(ushort p, ushort2 q)
-{
- return short2(p <= q.x, p <= q.y);
-}
-static inline short3 operator<=(ushort p, ushort3 q)
-{
- return short3(p <= q.x, p <= q.y, p <= q.z);
-}
-static inline short4 operator<=(ushort p, ushort4 q)
-{
- return short4(p <= q.x, p <= q.y, p <= q.z, p <= q.w);
-}
-static inline long2 operator<=(long2 p, long2 q)
-{
- return long2(p.x <= q.x, p.y <= q.y);
-}
-static inline long3 operator<=(long3 p, long3 q)
-{
- return long3(p.x <= q.x, p.y <= q.y, p.z <= q.z);
-}
-static inline long4 operator<=(long4 p, long4 q)
-{
- return long4(p.x <= q.x, p.y <= q.y, p.z <= q.z, p.w <= q.w);
-}
-static inline long2 operator<=(long2 p, long q)
-{
- return long2(p.x <= q, p.y <= q);
-}
-static inline long3 operator<=(long3 p, long q)
-{
- return long3(p.x <= q, p.y <= q, p.z <= q);
-}
-static inline long4 operator<=(long4 p, long q)
-{
- return long4(p.x <= q, p.y <= q, p.z <= q, p.w <= q);
-}
-static inline long2 operator<=(long p, long2 q)
-{
- return long2(p <= q.x, p <= q.y);
-}
-static inline long3 operator<=(long p, long3 q)
-{
- return long3(p <= q.x, p <= q.y, p <= q.z);
-}
-static inline long4 operator<=(long p, long4 q)
-{
- return long4(p <= q.x, p <= q.y, p <= q.z, p <= q.w);
-}
-static inline long2 operator<=(ulong2 p, ulong2 q)
-{
- return long2(p.x <= q.x, p.y <= q.y);
-}
-static inline long3 operator<=(ulong3 p, ulong3 q)
-{
- return long3(p.x <= q.x, p.y <= q.y, p.z <= q.z);
-}
-static inline long4 operator<=(ulong4 p, ulong4 q)
-{
- return long4(p.x <= q.x, p.y <= q.y, p.z <= q.z, p.w <= q.w);
-}
-static inline long2 operator<=(ulong2 p, ulong q)
-{
- return long2(p.x <= q, p.y <= q);
-}
-static inline long3 operator<=(ulong3 p, ulong q)
-{
- return long3(p.x <= q, p.y <= q, p.z <= q);
-}
-static inline long4 operator<=(ulong4 p, ulong q)
-{
- return long4(p.x <= q, p.y <= q, p.z <= q, p.w <= q);
-}
-static inline long2 operator<=(ulong p, ulong2 q)
-{
- return long2(p <= q.x, p <= q.y);
-}
-static inline long3 operator<=(ulong p, ulong3 q)
-{
- return long3(p <= q.x, p <= q.y, p <= q.z);
-}
-static inline long4 operator<=(ulong p, ulong4 q)
-{
- return long4(p <= q.x, p <= q.y, p <= q.z, p <= q.w);
-}
-static inline int2 operator&&(float2 p, float2 q)
-{
- return int2(p.x && q.x, p.y && q.y);
-}
-static inline int3 operator&&(float3 p, float3 q)
-{
- return int3(p.x && q.x, p.y && q.y, p.z && q.z);
-}
-static inline int4 operator&&(float4 p, float4 q)
-{
- return int4(p.x && q.x, p.y && q.y, p.z && q.z, p.w && q.w);
-}
-static inline int2 operator&&(float2 p, float q)
-{
- return int2(p.x && q, p.y && q);
-}
-static inline int3 operator&&(float3 p, float q)
-{
- return int3(p.x && q, p.y && q, p.z && q);
-}
-static inline int4 operator&&(float4 p, float q)
-{
- return int4(p.x && q, p.y && q, p.z && q, p.w && q);
-}
-static inline int2 operator&&(float p, float2 q)
-{
- return int2(p && q.x, p && q.y);
-}
-static inline int3 operator&&(float p, float3 q)
-{
- return int3(p && q.x, p && q.y, p && q.z);
-}
-static inline int4 operator&&(float p, float4 q)
-{
- return int4(p && q.x, p && q.y, p && q.z, p && q.w);
-}
-static inline long2 operator&&(double2 p, double2 q)
-{
- return long2(p.x && q.x, p.y && q.y);
-}
-static inline long3 operator&&(double3 p, double3 q)
-{
- return long3(p.x && q.x, p.y && q.y, p.z && q.z);
-}
-static inline long4 operator&&(double4 p, double4 q)
-{
- return long4(p.x && q.x, p.y && q.y, p.z && q.z, p.w && q.w);
-}
-static inline long2 operator&&(double2 p, double q)
-{
- return long2(p.x && q, p.y && q);
-}
-static inline long3 operator&&(double3 p, double q)
-{
- return long3(p.x && q, p.y && q, p.z && q);
-}
-static inline long4 operator&&(double4 p, double q)
-{
- return long4(p.x && q, p.y && q, p.z && q, p.w && q);
-}
-static inline long2 operator&&(double p, double2 q)
-{
- return long2(p && q.x, p && q.y);
-}
-static inline long3 operator&&(double p, double3 q)
-{
- return long3(p && q.x, p && q.y, p && q.z);
-}
-static inline long4 operator&&(double p, double4 q)
-{
- return long4(p && q.x, p && q.y, p && q.z, p && q.w);
-}
-static inline int2 operator&&(int2 p, int2 q)
-{
- return int2(p.x && q.x, p.y && q.y);
-}
-static inline int3 operator&&(int3 p, int3 q)
-{
- return int3(p.x && q.x, p.y && q.y, p.z && q.z);
-}
-static inline int4 operator&&(int4 p, int4 q)
-{
- return int4(p.x && q.x, p.y && q.y, p.z && q.z, p.w && q.w);
-}
-static inline int2 operator&&(int2 p, int q)
-{
- return int2(p.x && q, p.y && q);
-}
-static inline int3 operator&&(int3 p, int q)
-{
- return int3(p.x && q, p.y && q, p.z && q);
-}
-static inline int4 operator&&(int4 p, int q)
-{
- return int4(p.x && q, p.y && q, p.z && q, p.w && q);
-}
-static inline int2 operator&&(int p, int2 q)
-{
- return int2(p && q.x, p && q.y);
-}
-static inline int3 operator&&(int p, int3 q)
-{
- return int3(p && q.x, p && q.y, p && q.z);
-}
-static inline int4 operator&&(int p, int4 q)
-{
- return int4(p && q.x, p && q.y, p && q.z, p && q.w);
-}
-static inline int2 operator&&(uint2 p, uint2 q)
-{
- return int2(p.x && q.x, p.y && q.y);
-}
-static inline int3 operator&&(uint3 p, uint3 q)
-{
- return int3(p.x && q.x, p.y && q.y, p.z && q.z);
-}
-static inline int4 operator&&(uint4 p, uint4 q)
-{
- return int4(p.x && q.x, p.y && q.y, p.z && q.z, p.w && q.w);
-}
-static inline int2 operator&&(uint2 p, uint q)
-{
- return int2(p.x && q, p.y && q);
-}
-static inline int3 operator&&(uint3 p, uint q)
-{
- return int3(p.x && q, p.y && q, p.z && q);
-}
-static inline int4 operator&&(uint4 p, uint q)
-{
- return int4(p.x && q, p.y && q, p.z && q, p.w && q);
-}
-static inline int2 operator&&(uint p, uint2 q)
-{
- return int2(p && q.x, p && q.y);
-}
-static inline int3 operator&&(uint p, uint3 q)
-{
- return int3(p && q.x, p && q.y, p && q.z);
-}
-static inline int4 operator&&(uint p, uint4 q)
-{
- return int4(p && q.x, p && q.y, p && q.z, p && q.w);
-}
-static inline short2 operator&&(short2 p, short2 q)
-{
- return short2(p.x && q.x, p.y && q.y);
-}
-static inline short3 operator&&(short3 p, short3 q)
-{
- return short3(p.x && q.x, p.y && q.y, p.z && q.z);
-}
-static inline short4 operator&&(short4 p, short4 q)
-{
- return short4(p.x && q.x, p.y && q.y, p.z && q.z, p.w && q.w);
-}
-static inline short2 operator&&(short2 p, short q)
-{
- return short2(p.x && q, p.y && q);
-}
-static inline short3 operator&&(short3 p, short q)
-{
- return short3(p.x && q, p.y && q, p.z && q);
-}
-static inline short4 operator&&(short4 p, short q)
-{
- return short4(p.x && q, p.y && q, p.z && q, p.w && q);
-}
-static inline short2 operator&&(short p, short2 q)
-{
- return short2(p && q.x, p && q.y);
-}
-static inline short3 operator&&(short p, short3 q)
-{
- return short3(p && q.x, p && q.y, p && q.z);
-}
-static inline short4 operator&&(short p, short4 q)
-{
- return short4(p && q.x, p && q.y, p && q.z, p && q.w);
-}
-static inline short2 operator&&(ushort2 p, ushort2 q)
-{
- return short2(p.x && q.x, p.y && q.y);
-}
-static inline short3 operator&&(ushort3 p, ushort3 q)
-{
- return short3(p.x && q.x, p.y && q.y, p.z && q.z);
-}
-static inline short4 operator&&(ushort4 p, ushort4 q)
-{
- return short4(p.x && q.x, p.y && q.y, p.z && q.z, p.w && q.w);
-}
-static inline short2 operator&&(ushort2 p, ushort q)
-{
- return short2(p.x && q, p.y && q);
-}
-static inline short3 operator&&(ushort3 p, ushort q)
-{
- return short3(p.x && q, p.y && q, p.z && q);
-}
-static inline short4 operator&&(ushort4 p, ushort q)
-{
- return short4(p.x && q, p.y && q, p.z && q, p.w && q);
-}
-static inline short2 operator&&(ushort p, ushort2 q)
-{
- return short2(p && q.x, p && q.y);
-}
-static inline short3 operator&&(ushort p, ushort3 q)
-{
- return short3(p && q.x, p && q.y, p && q.z);
-}
-static inline short4 operator&&(ushort p, ushort4 q)
-{
- return short4(p && q.x, p && q.y, p && q.z, p && q.w);
-}
-static inline long2 operator&&(long2 p, long2 q)
-{
- return long2(p.x && q.x, p.y && q.y);
-}
-static inline long3 operator&&(long3 p, long3 q)
-{
- return long3(p.x && q.x, p.y && q.y, p.z && q.z);
-}
-static inline long4 operator&&(long4 p, long4 q)
-{
- return long4(p.x && q.x, p.y && q.y, p.z && q.z, p.w && q.w);
-}
-static inline long2 operator&&(long2 p, long q)
-{
- return long2(p.x && q, p.y && q);
-}
-static inline long3 operator&&(long3 p, long q)
-{
- return long3(p.x && q, p.y && q, p.z && q);
-}
-static inline long4 operator&&(long4 p, long q)
-{
- return long4(p.x && q, p.y && q, p.z && q, p.w && q);
-}
-static inline long2 operator&&(long p, long2 q)
-{
- return long2(p && q.x, p && q.y);
-}
-static inline long3 operator&&(long p, long3 q)
-{
- return long3(p && q.x, p && q.y, p && q.z);
-}
-static inline long4 operator&&(long p, long4 q)
-{
- return long4(p && q.x, p && q.y, p && q.z, p && q.w);
-}
-static inline long2 operator&&(ulong2 p, ulong2 q)
-{
- return long2(p.x && q.x, p.y && q.y);
-}
-static inline long3 operator&&(ulong3 p, ulong3 q)
-{
- return long3(p.x && q.x, p.y && q.y, p.z && q.z);
-}
-static inline long4 operator&&(ulong4 p, ulong4 q)
-{
- return long4(p.x && q.x, p.y && q.y, p.z && q.z, p.w && q.w);
-}
-static inline long2 operator&&(ulong2 p, ulong q)
-{
- return long2(p.x && q, p.y && q);
-}
-static inline long3 operator&&(ulong3 p, ulong q)
-{
- return long3(p.x && q, p.y && q, p.z && q);
-}
-static inline long4 operator&&(ulong4 p, ulong q)
-{
- return long4(p.x && q, p.y && q, p.z && q, p.w && q);
-}
-static inline long2 operator&&(ulong p, ulong2 q)
-{
- return long2(p && q.x, p && q.y);
-}
-static inline long3 operator&&(ulong p, ulong3 q)
-{
- return long3(p && q.x, p && q.y, p && q.z);
-}
-static inline long4 operator&&(ulong p, ulong4 q)
-{
- return long4(p && q.x, p && q.y, p && q.z, p && q.w);
-}
-static inline int2 operator||(float2 p, float2 q)
-{
- return int2(p.x || q.x, p.y || q.y);
-}
-static inline int3 operator||(float3 p, float3 q)
-{
- return int3(p.x || q.x, p.y || q.y, p.z || q.z);
-}
-static inline int4 operator||(float4 p, float4 q)
-{
- return int4(p.x || q.x, p.y || q.y, p.z || q.z, p.w || q.w);
-}
-static inline int2 operator||(float2 p, float q)
-{
- return int2(p.x || q, p.y || q);
-}
-static inline int3 operator||(float3 p, float q)
-{
- return int3(p.x || q, p.y || q, p.z || q);
-}
-static inline int4 operator||(float4 p, float q)
-{
- return int4(p.x || q, p.y || q, p.z || q, p.w || q);
-}
-static inline int2 operator||(float p, float2 q)
-{
- return int2(p || q.x, p || q.y);
-}
-static inline int3 operator||(float p, float3 q)
-{
- return int3(p || q.x, p || q.y, p || q.z);
-}
-static inline int4 operator||(float p, float4 q)
-{
- return int4(p || q.x, p || q.y, p || q.z, p || q.w);
-}
-static inline long2 operator||(double2 p, double2 q)
-{
- return long2(p.x || q.x, p.y || q.y);
-}
-static inline long3 operator||(double3 p, double3 q)
-{
- return long3(p.x || q.x, p.y || q.y, p.z || q.z);
-}
-static inline long4 operator||(double4 p, double4 q)
-{
- return long4(p.x || q.x, p.y || q.y, p.z || q.z, p.w || q.w);
-}
-static inline long2 operator||(double2 p, double q)
-{
- return long2(p.x || q, p.y || q);
-}
-static inline long3 operator||(double3 p, double q)
-{
- return long3(p.x || q, p.y || q, p.z || q);
-}
-static inline long4 operator||(double4 p, double q)
-{
- return long4(p.x || q, p.y || q, p.z || q, p.w || q);
-}
-static inline long2 operator||(double p, double2 q)
-{
- return long2(p || q.x, p || q.y);
-}
-static inline long3 operator||(double p, double3 q)
-{
- return long3(p || q.x, p || q.y, p || q.z);
-}
-static inline long4 operator||(double p, double4 q)
-{
- return long4(p || q.x, p || q.y, p || q.z, p || q.w);
-}
-static inline int2 operator||(int2 p, int2 q)
-{
- return int2(p.x || q.x, p.y || q.y);
-}
-static inline int3 operator||(int3 p, int3 q)
-{
- return int3(p.x || q.x, p.y || q.y, p.z || q.z);
-}
-static inline int4 operator||(int4 p, int4 q)
-{
- return int4(p.x || q.x, p.y || q.y, p.z || q.z, p.w || q.w);
-}
-static inline int2 operator||(int2 p, int q)
-{
- return int2(p.x || q, p.y || q);
-}
-static inline int3 operator||(int3 p, int q)
-{
- return int3(p.x || q, p.y || q, p.z || q);
-}
-static inline int4 operator||(int4 p, int q)
-{
- return int4(p.x || q, p.y || q, p.z || q, p.w || q);
-}
-static inline int2 operator||(int p, int2 q)
-{
- return int2(p || q.x, p || q.y);
-}
-static inline int3 operator||(int p, int3 q)
-{
- return int3(p || q.x, p || q.y, p || q.z);
-}
-static inline int4 operator||(int p, int4 q)
-{
- return int4(p || q.x, p || q.y, p || q.z, p || q.w);
-}
-static inline int2 operator||(uint2 p, uint2 q)
-{
- return int2(p.x || q.x, p.y || q.y);
-}
-static inline int3 operator||(uint3 p, uint3 q)
-{
- return int3(p.x || q.x, p.y || q.y, p.z || q.z);
-}
-static inline int4 operator||(uint4 p, uint4 q)
-{
- return int4(p.x || q.x, p.y || q.y, p.z || q.z, p.w || q.w);
-}
-static inline int2 operator||(uint2 p, uint q)
-{
- return int2(p.x || q, p.y || q);
-}
-static inline int3 operator||(uint3 p, uint q)
-{
- return int3(p.x || q, p.y || q, p.z || q);
-}
-static inline int4 operator||(uint4 p, uint q)
-{
- return int4(p.x || q, p.y || q, p.z || q, p.w || q);
-}
-static inline int2 operator||(uint p, uint2 q)
-{
- return int2(p || q.x, p || q.y);
-}
-static inline int3 operator||(uint p, uint3 q)
-{
- return int3(p || q.x, p || q.y, p || q.z);
-}
-static inline int4 operator||(uint p, uint4 q)
-{
- return int4(p || q.x, p || q.y, p || q.z, p || q.w);
-}
-static inline short2 operator||(short2 p, short2 q)
-{
- return short2(p.x || q.x, p.y || q.y);
-}
-static inline short3 operator||(short3 p, short3 q)
-{
- return short3(p.x || q.x, p.y || q.y, p.z || q.z);
-}
-static inline short4 operator||(short4 p, short4 q)
-{
- return short4(p.x || q.x, p.y || q.y, p.z || q.z, p.w || q.w);
-}
-static inline short2 operator||(short2 p, short q)
-{
- return short2(p.x || q, p.y || q);
-}
-static inline short3 operator||(short3 p, short q)
-{
- return short3(p.x || q, p.y || q, p.z || q);
-}
-static inline short4 operator||(short4 p, short q)
-{
- return short4(p.x || q, p.y || q, p.z || q, p.w || q);
-}
-static inline short2 operator||(short p, short2 q)
-{
- return short2(p || q.x, p || q.y);
-}
-static inline short3 operator||(short p, short3 q)
-{
- return short3(p || q.x, p || q.y, p || q.z);
-}
-static inline short4 operator||(short p, short4 q)
-{
- return short4(p || q.x, p || q.y, p || q.z, p || q.w);
-}
-static inline short2 operator||(ushort2 p, ushort2 q)
-{
- return short2(p.x || q.x, p.y || q.y);
-}
-static inline short3 operator||(ushort3 p, ushort3 q)
-{
- return short3(p.x || q.x, p.y || q.y, p.z || q.z);
-}
-static inline short4 operator||(ushort4 p, ushort4 q)
-{
- return short4(p.x || q.x, p.y || q.y, p.z || q.z, p.w || q.w);
-}
-static inline short2 operator||(ushort2 p, ushort q)
-{
- return short2(p.x || q, p.y || q);
-}
-static inline short3 operator||(ushort3 p, ushort q)
-{
- return short3(p.x || q, p.y || q, p.z || q);
-}
-static inline short4 operator||(ushort4 p, ushort q)
-{
- return short4(p.x || q, p.y || q, p.z || q, p.w || q);
-}
-static inline short2 operator||(ushort p, ushort2 q)
-{
- return short2(p || q.x, p || q.y);
-}
-static inline short3 operator||(ushort p, ushort3 q)
-{
- return short3(p || q.x, p || q.y, p || q.z);
-}
-static inline short4 operator||(ushort p, ushort4 q)
-{
- return short4(p || q.x, p || q.y, p || q.z, p || q.w);
-}
-static inline long2 operator||(long2 p, long2 q)
-{
- return long2(p.x || q.x, p.y || q.y);
-}
-static inline long3 operator||(long3 p, long3 q)
-{
- return long3(p.x || q.x, p.y || q.y, p.z || q.z);
-}
-static inline long4 operator||(long4 p, long4 q)
-{
- return long4(p.x || q.x, p.y || q.y, p.z || q.z, p.w || q.w);
-}
-static inline long2 operator||(long2 p, long q)
-{
- return long2(p.x || q, p.y || q);
-}
-static inline long3 operator||(long3 p, long q)
-{
- return long3(p.x || q, p.y || q, p.z || q);
-}
-static inline long4 operator||(long4 p, long q)
-{
- return long4(p.x || q, p.y || q, p.z || q, p.w || q);
-}
-static inline long2 operator||(long p, long2 q)
-{
- return long2(p || q.x, p || q.y);
-}
-static inline long3 operator||(long p, long3 q)
-{
- return long3(p || q.x, p || q.y, p || q.z);
-}
-static inline long4 operator||(long p, long4 q)
-{
- return long4(p || q.x, p || q.y, p || q.z, p || q.w);
-}
-static inline long2 operator||(ulong2 p, ulong2 q)
-{
- return long2(p.x || q.x, p.y || q.y);
-}
-static inline long3 operator||(ulong3 p, ulong3 q)
-{
- return long3(p.x || q.x, p.y || q.y, p.z || q.z);
-}
-static inline long4 operator||(ulong4 p, ulong4 q)
-{
- return long4(p.x || q.x, p.y || q.y, p.z || q.z, p.w || q.w);
-}
-static inline long2 operator||(ulong2 p, ulong q)
-{
- return long2(p.x || q, p.y || q);
-}
-static inline long3 operator||(ulong3 p, ulong q)
-{
- return long3(p.x || q, p.y || q, p.z || q);
-}
-static inline long4 operator||(ulong4 p, ulong q)
-{
- return long4(p.x || q, p.y || q, p.z || q, p.w || q);
-}
-static inline long2 operator||(ulong p, ulong2 q)
-{
- return long2(p || q.x, p || q.y);
-}
-static inline long3 operator||(ulong p, ulong3 q)
-{
- return long3(p || q.x, p || q.y, p || q.z);
-}
-static inline long4 operator||(ulong p, ulong4 q)
-{
- return long4(p || q.x, p || q.y, p || q.z, p || q.w);
-}
-static inline float2 convert_float2(float2 p)
-{
- return float2((float)p.x, (float)p.y);
-}
-static inline float3 convert_float3(float3 p)
-{
- return float3((float)p.x, (float)p.y, (float)p.z);
-}
-static inline float4 convert_float4(float4 p)
-{
- return float4((float)p.x, (float)p.y, (float)p.z, (float)p.w);
-}
-static inline float2 convert_float2(double2 p)
-{
- return float2((float)p.x, (float)p.y);
-}
-static inline float3 convert_float3(double3 p)
-{
- return float3((float)p.x, (float)p.y, (float)p.z);
-}
-static inline float4 convert_float4(double4 p)
-{
- return float4((float)p.x, (float)p.y, (float)p.z, (float)p.w);
-}
-static inline float2 convert_float2(int2 p)
-{
- return float2((float)p.x, (float)p.y);
-}
-static inline float3 convert_float3(int3 p)
-{
- return float3((float)p.x, (float)p.y, (float)p.z);
-}
-static inline float4 convert_float4(int4 p)
-{
- return float4((float)p.x, (float)p.y, (float)p.z, (float)p.w);
-}
-static inline float2 convert_float2(uint2 p)
-{
- return float2((float)p.x, (float)p.y);
-}
-static inline float3 convert_float3(uint3 p)
-{
- return float3((float)p.x, (float)p.y, (float)p.z);
-}
-static inline float4 convert_float4(uint4 p)
-{
- return float4((float)p.x, (float)p.y, (float)p.z, (float)p.w);
-}
-static inline float2 convert_float2(short2 p)
-{
- return float2((float)p.x, (float)p.y);
-}
-static inline float3 convert_float3(short3 p)
-{
- return float3((float)p.x, (float)p.y, (float)p.z);
-}
-static inline float4 convert_float4(short4 p)
-{
- return float4((float)p.x, (float)p.y, (float)p.z, (float)p.w);
-}
-static inline float2 convert_float2(ushort2 p)
-{
- return float2((float)p.x, (float)p.y);
-}
-static inline float3 convert_float3(ushort3 p)
-{
- return float3((float)p.x, (float)p.y, (float)p.z);
-}
-static inline float4 convert_float4(ushort4 p)
-{
- return float4((float)p.x, (float)p.y, (float)p.z, (float)p.w);
-}
-static inline float2 convert_float2(long2 p)
-{
- return float2((float)p.x, (float)p.y);
-}
-static inline float3 convert_float3(long3 p)
-{
- return float3((float)p.x, (float)p.y, (float)p.z);
-}
-static inline float4 convert_float4(long4 p)
-{
- return float4((float)p.x, (float)p.y, (float)p.z, (float)p.w);
-}
-static inline float2 convert_float2(ulong2 p)
-{
- return float2((float)p.x, (float)p.y);
-}
-static inline float3 convert_float3(ulong3 p)
-{
- return float3((float)p.x, (float)p.y, (float)p.z);
-}
-static inline float4 convert_float4(ulong4 p)
-{
- return float4((float)p.x, (float)p.y, (float)p.z, (float)p.w);
-}
-static inline double2 convert_double2(float2 p)
-{
- return double2((double)p.x, (double)p.y);
-}
-static inline double3 convert_double3(float3 p)
-{
- return double3((double)p.x, (double)p.y, (double)p.z);
-}
-static inline double4 convert_double4(float4 p)
-{
- return double4((double)p.x, (double)p.y, (double)p.z, (double)p.w);
-}
-static inline double2 convert_double2(double2 p)
-{
- return double2((double)p.x, (double)p.y);
-}
-static inline double3 convert_double3(double3 p)
-{
- return double3((double)p.x, (double)p.y, (double)p.z);
-}
-static inline double4 convert_double4(double4 p)
-{
- return double4((double)p.x, (double)p.y, (double)p.z, (double)p.w);
-}
-static inline double2 convert_double2(int2 p)
-{
- return double2((double)p.x, (double)p.y);
-}
-static inline double3 convert_double3(int3 p)
-{
- return double3((double)p.x, (double)p.y, (double)p.z);
-}
-static inline double4 convert_double4(int4 p)
-{
- return double4((double)p.x, (double)p.y, (double)p.z, (double)p.w);
-}
-static inline double2 convert_double2(uint2 p)
-{
- return double2((double)p.x, (double)p.y);
-}
-static inline double3 convert_double3(uint3 p)
-{
- return double3((double)p.x, (double)p.y, (double)p.z);
-}
-static inline double4 convert_double4(uint4 p)
-{
- return double4((double)p.x, (double)p.y, (double)p.z, (double)p.w);
-}
-static inline double2 convert_double2(short2 p)
-{
- return double2((double)p.x, (double)p.y);
-}
-static inline double3 convert_double3(short3 p)
-{
- return double3((double)p.x, (double)p.y, (double)p.z);
-}
-static inline double4 convert_double4(short4 p)
-{
- return double4((double)p.x, (double)p.y, (double)p.z, (double)p.w);
-}
-static inline double2 convert_double2(ushort2 p)
-{
- return double2((double)p.x, (double)p.y);
-}
-static inline double3 convert_double3(ushort3 p)
-{
- return double3((double)p.x, (double)p.y, (double)p.z);
-}
-static inline double4 convert_double4(ushort4 p)
-{
- return double4((double)p.x, (double)p.y, (double)p.z, (double)p.w);
-}
-static inline double2 convert_double2(long2 p)
-{
- return double2((double)p.x, (double)p.y);
-}
-static inline double3 convert_double3(long3 p)
-{
- return double3((double)p.x, (double)p.y, (double)p.z);
-}
-static inline double4 convert_double4(long4 p)
-{
- return double4((double)p.x, (double)p.y, (double)p.z, (double)p.w);
-}
-static inline double2 convert_double2(ulong2 p)
-{
- return double2((double)p.x, (double)p.y);
-}
-static inline double3 convert_double3(ulong3 p)
-{
- return double3((double)p.x, (double)p.y, (double)p.z);
-}
-static inline double4 convert_double4(ulong4 p)
-{
- return double4((double)p.x, (double)p.y, (double)p.z, (double)p.w);
-}
-static inline int2 convert_int2(float2 p)
-{
- return int2((int)p.x, (int)p.y);
-}
-static inline int3 convert_int3(float3 p)
-{
- return int3((int)p.x, (int)p.y, (int)p.z);
-}
-static inline int4 convert_int4(float4 p)
-{
- return int4((int)p.x, (int)p.y, (int)p.z, (int)p.w);
-}
-static inline int2 convert_int2(double2 p)
-{
- return int2((int)p.x, (int)p.y);
-}
-static inline int3 convert_int3(double3 p)
-{
- return int3((int)p.x, (int)p.y, (int)p.z);
-}
-static inline int4 convert_int4(double4 p)
-{
- return int4((int)p.x, (int)p.y, (int)p.z, (int)p.w);
-}
-static inline int2 convert_int2(int2 p)
-{
- return int2((int)p.x, (int)p.y);
-}
-static inline int3 convert_int3(int3 p)
-{
- return int3((int)p.x, (int)p.y, (int)p.z);
-}
-static inline int4 convert_int4(int4 p)
-{
- return int4((int)p.x, (int)p.y, (int)p.z, (int)p.w);
-}
-static inline int2 convert_int2(uint2 p)
-{
- return int2((int)p.x, (int)p.y);
-}
-static inline int3 convert_int3(uint3 p)
-{
- return int3((int)p.x, (int)p.y, (int)p.z);
-}
-static inline int4 convert_int4(uint4 p)
-{
- return int4((int)p.x, (int)p.y, (int)p.z, (int)p.w);
-}
-static inline int2 convert_int2(short2 p)
-{
- return int2((int)p.x, (int)p.y);
-}
-static inline int3 convert_int3(short3 p)
-{
- return int3((int)p.x, (int)p.y, (int)p.z);
-}
-static inline int4 convert_int4(short4 p)
-{
- return int4((int)p.x, (int)p.y, (int)p.z, (int)p.w);
-}
-static inline int2 convert_int2(ushort2 p)
-{
- return int2((int)p.x, (int)p.y);
-}
-static inline int3 convert_int3(ushort3 p)
-{
- return int3((int)p.x, (int)p.y, (int)p.z);
-}
-static inline int4 convert_int4(ushort4 p)
-{
- return int4((int)p.x, (int)p.y, (int)p.z, (int)p.w);
-}
-static inline int2 convert_int2(long2 p)
-{
- return int2((int)p.x, (int)p.y);
-}
-static inline int3 convert_int3(long3 p)
-{
- return int3((int)p.x, (int)p.y, (int)p.z);
-}
-static inline int4 convert_int4(long4 p)
-{
- return int4((int)p.x, (int)p.y, (int)p.z, (int)p.w);
-}
-static inline int2 convert_int2(ulong2 p)
-{
- return int2((int)p.x, (int)p.y);
-}
-static inline int3 convert_int3(ulong3 p)
-{
- return int3((int)p.x, (int)p.y, (int)p.z);
-}
-static inline int4 convert_int4(ulong4 p)
-{
- return int4((int)p.x, (int)p.y, (int)p.z, (int)p.w);
-}
-static inline uint2 convert_uint2(float2 p)
-{
- return uint2((uint) p.x, (uint) p.y);
-}
-static inline uint3 convert_uint3(float3 p)
-{
- return uint3((uint) p.x, (uint) p.y, (uint) p.z);
-}
-static inline uint4 convert_uint4(float4 p)
-{
- return uint4((uint) p.x, (uint) p.y, (uint) p.z, (uint) p.w);
-}
-static inline uint2 convert_uint2(double2 p)
-{
- return uint2((uint) p.x, (uint) p.y);
-}
-static inline uint3 convert_uint3(double3 p)
-{
- return uint3((uint) p.x, (uint) p.y, (uint) p.z);
-}
-static inline uint4 convert_uint4(double4 p)
-{
- return uint4((uint) p.x, (uint) p.y, (uint) p.z, (uint) p.w);
-}
-static inline uint2 convert_uint2(int2 p)
-{
- return uint2((uint) p.x, (uint) p.y);
-}
-static inline uint3 convert_uint3(int3 p)
-{
- return uint3((uint) p.x, (uint) p.y, (uint) p.z);
-}
-static inline uint4 convert_uint4(int4 p)
-{
- return uint4((uint) p.x, (uint) p.y, (uint) p.z, (uint) p.w);
-}
-static inline uint2 convert_uint2(uint2 p)
-{
- return uint2((uint) p.x, (uint) p.y);
-}
-static inline uint3 convert_uint3(uint3 p)
-{
- return uint3((uint) p.x, (uint) p.y, (uint) p.z);
-}
-static inline uint4 convert_uint4(uint4 p)
-{
- return uint4((uint) p.x, (uint) p.y, (uint) p.z, (uint) p.w);
-}
-static inline uint2 convert_uint2(short2 p)
-{
- return uint2((uint) p.x, (uint) p.y);
-}
-static inline uint3 convert_uint3(short3 p)
-{
- return uint3((uint) p.x, (uint) p.y, (uint) p.z);
-}
-static inline uint4 convert_uint4(short4 p)
-{
- return uint4((uint) p.x, (uint) p.y, (uint) p.z, (uint) p.w);
-}
-static inline uint2 convert_uint2(ushort2 p)
-{
- return uint2((uint) p.x, (uint) p.y);
-}
-static inline uint3 convert_uint3(ushort3 p)
-{
- return uint3((uint) p.x, (uint) p.y, (uint) p.z);
-}
-static inline uint4 convert_uint4(ushort4 p)
-{
- return uint4((uint) p.x, (uint) p.y, (uint) p.z, (uint) p.w);
-}
-static inline uint2 convert_uint2(long2 p)
-{
- return uint2((uint) p.x, (uint) p.y);
-}
-static inline uint3 convert_uint3(long3 p)
-{
- return uint3((uint) p.x, (uint) p.y, (uint) p.z);
-}
-static inline uint4 convert_uint4(long4 p)
-{
- return uint4((uint) p.x, (uint) p.y, (uint) p.z, (uint) p.w);
-}
-static inline uint2 convert_uint2(ulong2 p)
-{
- return uint2((uint) p.x, (uint) p.y);
-}
-static inline uint3 convert_uint3(ulong3 p)
-{
- return uint3((uint) p.x, (uint) p.y, (uint) p.z);
-}
-static inline uint4 convert_uint4(ulong4 p)
-{
- return uint4((uint) p.x, (uint) p.y, (uint) p.z, (uint) p.w);
-}
-static inline short2 convert_short2(float2 p)
-{
- return short2((short)p.x, (short)p.y);
-}
-static inline short3 convert_short3(float3 p)
-{
- return short3((short)p.x, (short)p.y, (short)p.z);
-}
-static inline short4 convert_short4(float4 p)
-{
- return short4((short)p.x, (short)p.y, (short)p.z, (short)p.w);
-}
-static inline short2 convert_short2(double2 p)
-{
- return short2((short)p.x, (short)p.y);
-}
-static inline short3 convert_short3(double3 p)
-{
- return short3((short)p.x, (short)p.y, (short)p.z);
-}
-static inline short4 convert_short4(double4 p)
-{
- return short4((short)p.x, (short)p.y, (short)p.z, (short)p.w);
-}
-static inline short2 convert_short2(int2 p)
-{
- return short2((short)p.x, (short)p.y);
-}
-static inline short3 convert_short3(int3 p)
-{
- return short3((short)p.x, (short)p.y, (short)p.z);
-}
-static inline short4 convert_short4(int4 p)
-{
- return short4((short)p.x, (short)p.y, (short)p.z, (short)p.w);
-}
-static inline short2 convert_short2(uint2 p)
-{
- return short2((short)p.x, (short)p.y);
-}
-static inline short3 convert_short3(uint3 p)
-{
- return short3((short)p.x, (short)p.y, (short)p.z);
-}
-static inline short4 convert_short4(uint4 p)
-{
- return short4((short)p.x, (short)p.y, (short)p.z, (short)p.w);
-}
-static inline short2 convert_short2(short2 p)
-{
- return short2((short)p.x, (short)p.y);
-}
-static inline short3 convert_short3(short3 p)
-{
- return short3((short)p.x, (short)p.y, (short)p.z);
-}
-static inline short4 convert_short4(short4 p)
-{
- return short4((short)p.x, (short)p.y, (short)p.z, (short)p.w);
-}
-static inline short2 convert_short2(ushort2 p)
-{
- return short2((short)p.x, (short)p.y);
-}
-static inline short3 convert_short3(ushort3 p)
-{
- return short3((short)p.x, (short)p.y, (short)p.z);
-}
-static inline short4 convert_short4(ushort4 p)
-{
- return short4((short)p.x, (short)p.y, (short)p.z, (short)p.w);
-}
-static inline short2 convert_short2(long2 p)
-{
- return short2((short)p.x, (short)p.y);
-}
-static inline short3 convert_short3(long3 p)
-{
- return short3((short)p.x, (short)p.y, (short)p.z);
-}
-static inline short4 convert_short4(long4 p)
-{
- return short4((short)p.x, (short)p.y, (short)p.z, (short)p.w);
-}
-static inline short2 convert_short2(ulong2 p)
-{
- return short2((short)p.x, (short)p.y);
-}
-static inline short3 convert_short3(ulong3 p)
-{
- return short3((short)p.x, (short)p.y, (short)p.z);
-}
-static inline short4 convert_short4(ulong4 p)
-{
- return short4((short)p.x, (short)p.y, (short)p.z, (short)p.w);
-}
-static inline ushort2 convert_ushort2(float2 p)
-{
- return ushort2((ushort) p.x, (ushort) p.y);
-}
-static inline ushort3 convert_ushort3(float3 p)
-{
- return ushort3((ushort) p.x, (ushort) p.y, (ushort) p.z);
-}
-static inline ushort4 convert_ushort4(float4 p)
-{
- return ushort4((ushort) p.x, (ushort) p.y, (ushort) p.z, (ushort) p.w);
-}
-static inline ushort2 convert_ushort2(double2 p)
-{
- return ushort2((ushort) p.x, (ushort) p.y);
-}
-static inline ushort3 convert_ushort3(double3 p)
-{
- return ushort3((ushort) p.x, (ushort) p.y, (ushort) p.z);
-}
-static inline ushort4 convert_ushort4(double4 p)
-{
- return ushort4((ushort) p.x, (ushort) p.y, (ushort) p.z, (ushort) p.w);
-}
-static inline ushort2 convert_ushort2(int2 p)
-{
- return ushort2((ushort) p.x, (ushort) p.y);
-}
-static inline ushort3 convert_ushort3(int3 p)
-{
- return ushort3((ushort) p.x, (ushort) p.y, (ushort) p.z);
-}
-static inline ushort4 convert_ushort4(int4 p)
-{
- return ushort4((ushort) p.x, (ushort) p.y, (ushort) p.z, (ushort) p.w);
-}
-static inline ushort2 convert_ushort2(uint2 p)
-{
- return ushort2((ushort) p.x, (ushort) p.y);
-}
-static inline ushort3 convert_ushort3(uint3 p)
-{
- return ushort3((ushort) p.x, (ushort) p.y, (ushort) p.z);
-}
-static inline ushort4 convert_ushort4(uint4 p)
-{
- return ushort4((ushort) p.x, (ushort) p.y, (ushort) p.z, (ushort) p.w);
-}
-static inline ushort2 convert_ushort2(short2 p)
-{
- return ushort2((ushort) p.x, (ushort) p.y);
-}
-static inline ushort3 convert_ushort3(short3 p)
-{
- return ushort3((ushort) p.x, (ushort) p.y, (ushort) p.z);
-}
-static inline ushort4 convert_ushort4(short4 p)
-{
- return ushort4((ushort) p.x, (ushort) p.y, (ushort) p.z, (ushort) p.w);
-}
-static inline ushort2 convert_ushort2(ushort2 p)
-{
- return ushort2((ushort) p.x, (ushort) p.y);
-}
-static inline ushort3 convert_ushort3(ushort3 p)
-{
- return ushort3((ushort) p.x, (ushort) p.y, (ushort) p.z);
-}
-static inline ushort4 convert_ushort4(ushort4 p)
-{
- return ushort4((ushort) p.x, (ushort) p.y, (ushort) p.z, (ushort) p.w);
-}
-static inline ushort2 convert_ushort2(long2 p)
-{
- return ushort2((ushort) p.x, (ushort) p.y);
-}
-static inline ushort3 convert_ushort3(long3 p)
-{
- return ushort3((ushort) p.x, (ushort) p.y, (ushort) p.z);
-}
-static inline ushort4 convert_ushort4(long4 p)
-{
- return ushort4((ushort) p.x, (ushort) p.y, (ushort) p.z, (ushort) p.w);
-}
-static inline ushort2 convert_ushort2(ulong2 p)
-{
- return ushort2((ushort) p.x, (ushort) p.y);
-}
-static inline ushort3 convert_ushort3(ulong3 p)
-{
- return ushort3((ushort) p.x, (ushort) p.y, (ushort) p.z);
-}
-static inline ushort4 convert_ushort4(ulong4 p)
-{
- return ushort4((ushort) p.x, (ushort) p.y, (ushort) p.z, (ushort) p.w);
-}
-static inline long2 convert_long2(float2 p)
-{
- return long2((long)p.x, (long)p.y);
-}
-static inline long3 convert_long3(float3 p)
-{
- return long3((long)p.x, (long)p.y, (long)p.z);
-}
-static inline long4 convert_long4(float4 p)
-{
- return long4((long)p.x, (long)p.y, (long)p.z, (long)p.w);
-}
-static inline long2 convert_long2(double2 p)
-{
- return long2((long)p.x, (long)p.y);
-}
-static inline long3 convert_long3(double3 p)
-{
- return long3((long)p.x, (long)p.y, (long)p.z);
-}
-static inline long4 convert_long4(double4 p)
-{
- return long4((long)p.x, (long)p.y, (long)p.z, (long)p.w);
-}
-static inline long2 convert_long2(int2 p)
-{
- return long2((long)p.x, (long)p.y);
-}
-static inline long3 convert_long3(int3 p)
-{
- return long3((long)p.x, (long)p.y, (long)p.z);
-}
-static inline long4 convert_long4(int4 p)
-{
- return long4((long)p.x, (long)p.y, (long)p.z, (long)p.w);
-}
-static inline long2 convert_long2(uint2 p)
-{
- return long2((long)p.x, (long)p.y);
-}
-static inline long3 convert_long3(uint3 p)
-{
- return long3((long)p.x, (long)p.y, (long)p.z);
-}
-static inline long4 convert_long4(uint4 p)
-{
- return long4((long)p.x, (long)p.y, (long)p.z, (long)p.w);
-}
-static inline long2 convert_long2(short2 p)
-{
- return long2((long)p.x, (long)p.y);
-}
-static inline long3 convert_long3(short3 p)
-{
- return long3((long)p.x, (long)p.y, (long)p.z);
-}
-static inline long4 convert_long4(short4 p)
-{
- return long4((long)p.x, (long)p.y, (long)p.z, (long)p.w);
-}
-static inline long2 convert_long2(ushort2 p)
-{
- return long2((long)p.x, (long)p.y);
-}
-static inline long3 convert_long3(ushort3 p)
-{
- return long3((long)p.x, (long)p.y, (long)p.z);
-}
-static inline long4 convert_long4(ushort4 p)
-{
- return long4((long)p.x, (long)p.y, (long)p.z, (long)p.w);
-}
-static inline long2 convert_long2(long2 p)
-{
- return long2((long)p.x, (long)p.y);
-}
-static inline long3 convert_long3(long3 p)
-{
- return long3((long)p.x, (long)p.y, (long)p.z);
-}
-static inline long4 convert_long4(long4 p)
-{
- return long4((long)p.x, (long)p.y, (long)p.z, (long)p.w);
-}
-static inline long2 convert_long2(ulong2 p)
-{
- return long2((long)p.x, (long)p.y);
-}
-static inline long3 convert_long3(ulong3 p)
-{
- return long3((long)p.x, (long)p.y, (long)p.z);
-}
-static inline long4 convert_long4(ulong4 p)
-{
- return long4((long)p.x, (long)p.y, (long)p.z, (long)p.w);
-}
-static inline ulong2 convert_ulong2(float2 p)
-{
- return ulong2((ulong) p.x, (ulong) p.y);
-}
-static inline ulong3 convert_ulong3(float3 p)
-{
- return ulong3((ulong) p.x, (ulong) p.y, (ulong) p.z);
-}
-static inline ulong4 convert_ulong4(float4 p)
-{
- return ulong4((ulong) p.x, (ulong) p.y, (ulong) p.z, (ulong) p.w);
-}
-static inline ulong2 convert_ulong2(double2 p)
-{
- return ulong2((ulong) p.x, (ulong) p.y);
-}
-static inline ulong3 convert_ulong3(double3 p)
-{
- return ulong3((ulong) p.x, (ulong) p.y, (ulong) p.z);
-}
-static inline ulong4 convert_ulong4(double4 p)
-{
- return ulong4((ulong) p.x, (ulong) p.y, (ulong) p.z, (ulong) p.w);
-}
-static inline ulong2 convert_ulong2(int2 p)
-{
- return ulong2((ulong) p.x, (ulong) p.y);
-}
-static inline ulong3 convert_ulong3(int3 p)
-{
- return ulong3((ulong) p.x, (ulong) p.y, (ulong) p.z);
-}
-static inline ulong4 convert_ulong4(int4 p)
-{
- return ulong4((ulong) p.x, (ulong) p.y, (ulong) p.z, (ulong) p.w);
-}
-static inline ulong2 convert_ulong2(uint2 p)
-{
- return ulong2((ulong) p.x, (ulong) p.y);
-}
-static inline ulong3 convert_ulong3(uint3 p)
-{
- return ulong3((ulong) p.x, (ulong) p.y, (ulong) p.z);
-}
-static inline ulong4 convert_ulong4(uint4 p)
-{
- return ulong4((ulong) p.x, (ulong) p.y, (ulong) p.z, (ulong) p.w);
-}
-static inline ulong2 convert_ulong2(short2 p)
-{
- return ulong2((ulong) p.x, (ulong) p.y);
-}
-static inline ulong3 convert_ulong3(short3 p)
-{
- return ulong3((ulong) p.x, (ulong) p.y, (ulong) p.z);
-}
-static inline ulong4 convert_ulong4(short4 p)
-{
- return ulong4((ulong) p.x, (ulong) p.y, (ulong) p.z, (ulong) p.w);
-}
-static inline ulong2 convert_ulong2(ushort2 p)
-{
- return ulong2((ulong) p.x, (ulong) p.y);
-}
-static inline ulong3 convert_ulong3(ushort3 p)
-{
- return ulong3((ulong) p.x, (ulong) p.y, (ulong) p.z);
-}
-static inline ulong4 convert_ulong4(ushort4 p)
-{
- return ulong4((ulong) p.x, (ulong) p.y, (ulong) p.z, (ulong) p.w);
-}
-static inline ulong2 convert_ulong2(long2 p)
-{
- return ulong2((ulong) p.x, (ulong) p.y);
-}
-static inline ulong3 convert_ulong3(long3 p)
-{
- return ulong3((ulong) p.x, (ulong) p.y, (ulong) p.z);
-}
-static inline ulong4 convert_ulong4(long4 p)
-{
- return ulong4((ulong) p.x, (ulong) p.y, (ulong) p.z, (ulong) p.w);
-}
-static inline ulong2 convert_ulong2(ulong2 p)
-{
- return ulong2((ulong) p.x, (ulong) p.y);
-}
-static inline ulong3 convert_ulong3(ulong3 p)
-{
- return ulong3((ulong) p.x, (ulong) p.y, (ulong) p.z);
-}
-static inline ulong4 convert_ulong4(ulong4 p)
-{
- return ulong4((ulong) p.x, (ulong) p.y, (ulong) p.z, (ulong) p.w);
-}
-static inline float2 as_float2(float2 inp)
-{
- float2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline int2 as_int2(float2 inp)
-{
- int2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline uint2 as_uint2(float2 inp)
-{
- uint2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline double2 as_double2(double2 inp)
-{
- double2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline long2 as_long2(double2 inp)
-{
- long2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline ulong2 as_ulong2(double2 inp)
-{
- ulong2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline float2 as_float2(int2 inp)
-{
- float2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline int2 as_int2(int2 inp)
-{
- int2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline uint2 as_uint2(int2 inp)
-{
- uint2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline float2 as_float2(uint2 inp)
-{
- float2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline int2 as_int2(uint2 inp)
-{
- int2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline uint2 as_uint2(uint2 inp)
-{
- uint2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline short2 as_short2(short2 inp)
-{
- short2 val1;
- memcpy(&val1, &inp, 4);
- return val1;
-}
-static inline ushort2 as_ushort2(short2 inp)
-{
- ushort2 val1;
- memcpy(&val1, &inp, 4);
- return val1;
-}
-static inline short2 as_short2(ushort2 inp)
-{
- short2 val1;
- memcpy(&val1, &inp, 4);
- return val1;
-}
-static inline ushort2 as_ushort2(ushort2 inp)
-{
- ushort2 val1;
- memcpy(&val1, &inp, 4);
- return val1;
-}
-static inline double2 as_double2(long2 inp)
-{
- double2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline long2 as_long2(long2 inp)
-{
- long2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline ulong2 as_ulong2(long2 inp)
-{
- ulong2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline double2 as_double2(ulong2 inp)
-{
- double2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline long2 as_long2(ulong2 inp)
-{
- long2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline ulong2 as_ulong2(ulong2 inp)
-{
- ulong2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline short4 as_short4(float2 inp)
-{
- short4 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline ushort4 as_ushort4(float2 inp)
-{
- ushort4 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline float4 as_float4(double2 inp)
-{
- float4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline int4 as_int4(double2 inp)
-{
- int4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline uint4 as_uint4(double2 inp)
-{
- uint4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline short4 as_short4(int2 inp)
-{
- short4 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline ushort4 as_ushort4(int2 inp)
-{
- ushort4 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline short4 as_short4(uint2 inp)
-{
- short4 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline ushort4 as_ushort4(uint2 inp)
-{
- ushort4 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline float4 as_float4(long2 inp)
-{
- float4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline int4 as_int4(long2 inp)
-{
- int4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline uint4 as_uint4(long2 inp)
-{
- uint4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline float4 as_float4(ulong2 inp)
-{
- float4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline int4 as_int4(ulong2 inp)
-{
- int4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline uint4 as_uint4(ulong2 inp)
-{
- uint4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline float3 as_float3(float3 inp)
-{
- float3 val1;
- memcpy(&val1, &inp, 12);
- return val1;
-}
-static inline int3 as_int3(float3 inp)
-{
- int3 val1;
- memcpy(&val1, &inp, 12);
- return val1;
-}
-static inline uint3 as_uint3(float3 inp)
-{
- uint3 val1;
- memcpy(&val1, &inp, 12);
- return val1;
-}
-static inline double3 as_double3(double3 inp)
-{
- double3 val1;
- memcpy(&val1, &inp, 24);
- return val1;
-}
-static inline long3 as_long3(double3 inp)
-{
- long3 val1;
- memcpy(&val1, &inp, 24);
- return val1;
-}
-static inline ulong3 as_ulong3(double3 inp)
-{
- ulong3 val1;
- memcpy(&val1, &inp, 24);
- return val1;
-}
-static inline float3 as_float3(int3 inp)
-{
- float3 val1;
- memcpy(&val1, &inp, 12);
- return val1;
-}
-static inline int3 as_int3(int3 inp)
-{
- int3 val1;
- memcpy(&val1, &inp, 12);
- return val1;
-}
-static inline uint3 as_uint3(int3 inp)
-{
- uint3 val1;
- memcpy(&val1, &inp, 12);
- return val1;
-}
-static inline float3 as_float3(uint3 inp)
-{
- float3 val1;
- memcpy(&val1, &inp, 12);
- return val1;
-}
-static inline int3 as_int3(uint3 inp)
-{
- int3 val1;
- memcpy(&val1, &inp, 12);
- return val1;
-}
-static inline uint3 as_uint3(uint3 inp)
-{
- uint3 val1;
- memcpy(&val1, &inp, 12);
- return val1;
-}
-static inline short3 as_short3(short3 inp)
-{
- short3 val1;
- memcpy(&val1, &inp, 6);
- return val1;
-}
-static inline ushort3 as_ushort3(short3 inp)
-{
- ushort3 val1;
- memcpy(&val1, &inp, 6);
- return val1;
-}
-static inline short3 as_short3(ushort3 inp)
-{
- short3 val1;
- memcpy(&val1, &inp, 6);
- return val1;
-}
-static inline ushort3 as_ushort3(ushort3 inp)
-{
- ushort3 val1;
- memcpy(&val1, &inp, 6);
- return val1;
-}
-static inline double3 as_double3(long3 inp)
-{
- double3 val1;
- memcpy(&val1, &inp, 24);
- return val1;
-}
-static inline long3 as_long3(long3 inp)
-{
- long3 val1;
- memcpy(&val1, &inp, 24);
- return val1;
-}
-static inline ulong3 as_ulong3(long3 inp)
-{
- ulong3 val1;
- memcpy(&val1, &inp, 24);
- return val1;
-}
-static inline double3 as_double3(ulong3 inp)
-{
- double3 val1;
- memcpy(&val1, &inp, 24);
- return val1;
-}
-static inline long3 as_long3(ulong3 inp)
-{
- long3 val1;
- memcpy(&val1, &inp, 24);
- return val1;
-}
-static inline ulong3 as_ulong3(ulong3 inp)
-{
- ulong3 val1;
- memcpy(&val1, &inp, 24);
- return val1;
-}
-static inline double2 as_double2(float4 inp)
-{
- double2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline long2 as_long2(float4 inp)
-{
- long2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline ulong2 as_ulong2(float4 inp)
-{
- ulong2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline double2 as_double2(int4 inp)
-{
- double2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline long2 as_long2(int4 inp)
-{
- long2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline ulong2 as_ulong2(int4 inp)
-{
- ulong2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline double2 as_double2(uint4 inp)
-{
- double2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline long2 as_long2(uint4 inp)
-{
- long2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline ulong2 as_ulong2(uint4 inp)
-{
- ulong2 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline float2 as_float2(short4 inp)
-{
- float2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline int2 as_int2(short4 inp)
-{
- int2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline uint2 as_uint2(short4 inp)
-{
- uint2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline float2 as_float2(ushort4 inp)
-{
- float2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline int2 as_int2(ushort4 inp)
-{
- int2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline uint2 as_uint2(ushort4 inp)
-{
- uint2 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline float4 as_float4(float4 inp)
-{
- float4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline int4 as_int4(float4 inp)
-{
- int4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline uint4 as_uint4(float4 inp)
-{
- uint4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline double4 as_double4(double4 inp)
-{
- double4 val1;
- memcpy(&val1, &inp, 32);
- return val1;
-}
-static inline long4 as_long4(double4 inp)
-{
- long4 val1;
- memcpy(&val1, &inp, 32);
- return val1;
-}
-static inline ulong4 as_ulong4(double4 inp)
-{
- ulong4 val1;
- memcpy(&val1, &inp, 32);
- return val1;
-}
-static inline float4 as_float4(int4 inp)
-{
- float4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline int4 as_int4(int4 inp)
-{
- int4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline uint4 as_uint4(int4 inp)
-{
- uint4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline float4 as_float4(uint4 inp)
-{
- float4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline int4 as_int4(uint4 inp)
-{
- int4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline uint4 as_uint4(uint4 inp)
-{
- uint4 val1;
- memcpy(&val1, &inp, 16);
- return val1;
-}
-static inline short4 as_short4(short4 inp)
-{
- short4 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline ushort4 as_ushort4(short4 inp)
-{
- ushort4 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline short4 as_short4(ushort4 inp)
-{
- short4 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline ushort4 as_ushort4(ushort4 inp)
-{
- ushort4 val1;
- memcpy(&val1, &inp, 8);
- return val1;
-}
-static inline double4 as_double4(long4 inp)
-{
- double4 val1;
- memcpy(&val1, &inp, 32);
- return val1;
-}
-static inline long4 as_long4(long4 inp)
-{
- long4 val1;
- memcpy(&val1, &inp, 32);
- return val1;
-}
-static inline ulong4 as_ulong4(long4 inp)
-{
- ulong4 val1;
- memcpy(&val1, &inp, 32);
- return val1;
-}
-static inline double4 as_double4(ulong4 inp)
-{
- double4 val1;
- memcpy(&val1, &inp, 32);
- return val1;
-}
-static inline long4 as_long4(ulong4 inp)
-{
- long4 val1;
- memcpy(&val1, &inp, 32);
- return val1;
-}
-static inline ulong4 as_ulong4(ulong4 inp)
-{
- ulong4 val1;
- memcpy(&val1, &inp, 32);
- return val1;
-}
-
-#define xx xx()
-#define xy xy()
-#define xz xz()
-#define xw xw()
-#define yx yx()
-#define yy yy()
-#define yz yz()
-#define yw yw()
-#define zx zx()
-#define zy zy()
-#define zz zz()
-#define zw zw()
-#define wx wx()
-#define wy wy()
-#define wz wz()
-#define ww ww()
-#define xxx xxx()
-#define xxy xxy()
-#define xxz xxz()
-#define xxw xxw()
-#define xyx xyx()
-#define xyy xyy()
-#define xyz xyz()
-#define xyw xyw()
-#define xzx xzx()
-#define xzy xzy()
-#define xzz xzz()
-#define xzw xzw()
-#define xwx xwx()
-#define xwy xwy()
-#define xwz xwz()
-#define xww xww()
-#define yxx yxx()
-#define yxy yxy()
-#define yxz yxz()
-#define yxw yxw()
-#define yyx yyx()
-#define yyy yyy()
-#define yyz yyz()
-#define yyw yyw()
-#define yzx yzx()
-#define yzy yzy()
-#define yzz yzz()
-#define yzw yzw()
-#define ywx ywx()
-#define ywy ywy()
-#define ywz ywz()
-#define yww yww()
-#define zxx zxx()
-#define zxy zxy()
-#define zxz zxz()
-#define zxw zxw()
-#define zyx zyx()
-#define zyy zyy()
-#define zyz zyz()
-#define zyw zyw()
-#define zzx zzx()
-#define zzy zzy()
-#define zzz zzz()
-#define zzw zzw()
-#define zwx zwx()
-#define zwy zwy()
-#define zwz zwz()
-#define zww zww()
-#define wxx wxx()
-#define wxy wxy()
-#define wxz wxz()
-#define wxw wxw()
-#define wyx wyx()
-#define wyy wyy()
-#define wyz wyz()
-#define wyw wyw()
-#define wzx wzx()
-#define wzy wzy()
-#define wzz wzz()
-#define wzw wzw()
-#define wwx wwx()
-#define wwy wwy()
-#define wwz wwz()
-#define www www()
-#define xxxx xxxx()
-#define xxxy xxxy()
-#define xxxz xxxz()
-#define xxxw xxxw()
-#define xxyx xxyx()
-#define xxyy xxyy()
-#define xxyz xxyz()
-#define xxyw xxyw()
-#define xxzx xxzx()
-#define xxzy xxzy()
-#define xxzz xxzz()
-#define xxzw xxzw()
-#define xxwx xxwx()
-#define xxwy xxwy()
-#define xxwz xxwz()
-#define xxww xxww()
-#define xyxx xyxx()
-#define xyxy xyxy()
-#define xyxz xyxz()
-#define xyxw xyxw()
-#define xyyx xyyx()
-#define xyyy xyyy()
-#define xyyz xyyz()
-#define xyyw xyyw()
-#define xyzx xyzx()
-#define xyzy xyzy()
-#define xyzz xyzz()
-#define xyzw xyzw()
-#define xywx xywx()
-#define xywy xywy()
-#define xywz xywz()
-#define xyww xyww()
-#define xzxx xzxx()
-#define xzxy xzxy()
-#define xzxz xzxz()
-#define xzxw xzxw()
-#define xzyx xzyx()
-#define xzyy xzyy()
-#define xzyz xzyz()
-#define xzyw xzyw()
-#define xzzx xzzx()
-#define xzzy xzzy()
-#define xzzz xzzz()
-#define xzzw xzzw()
-#define xzwx xzwx()
-#define xzwy xzwy()
-#define xzwz xzwz()
-#define xzww xzww()
-#define xwxx xwxx()
-#define xwxy xwxy()
-#define xwxz xwxz()
-#define xwxw xwxw()
-#define xwyx xwyx()
-#define xwyy xwyy()
-#define xwyz xwyz()
-#define xwyw xwyw()
-#define xwzx xwzx()
-#define xwzy xwzy()
-#define xwzz xwzz()
-#define xwzw xwzw()
-#define xwwx xwwx()
-#define xwwy xwwy()
-#define xwwz xwwz()
-#define xwww xwww()
-#define yxxx yxxx()
-#define yxxy yxxy()
-#define yxxz yxxz()
-#define yxxw yxxw()
-#define yxyx yxyx()
-#define yxyy yxyy()
-#define yxyz yxyz()
-#define yxyw yxyw()
-#define yxzx yxzx()
-#define yxzy yxzy()
-#define yxzz yxzz()
-#define yxzw yxzw()
-#define yxwx yxwx()
-#define yxwy yxwy()
-#define yxwz yxwz()
-#define yxww yxww()
-#define yyxx yyxx()
-#define yyxy yyxy()
-#define yyxz yyxz()
-#define yyxw yyxw()
-#define yyyx yyyx()
-#define yyyy yyyy()
-#define yyyz yyyz()
-#define yyyw yyyw()
-#define yyzx yyzx()
-#define yyzy yyzy()
-#define yyzz yyzz()
-#define yyzw yyzw()
-#define yywx yywx()
-#define yywy yywy()
-#define yywz yywz()
-#define yyww yyww()
-#define yzxx yzxx()
-#define yzxy yzxy()
-#define yzxz yzxz()
-#define yzxw yzxw()
-#define yzyx yzyx()
-#define yzyy yzyy()
-#define yzyz yzyz()
-#define yzyw yzyw()
-#define yzzx yzzx()
-#define yzzy yzzy()
-#define yzzz yzzz()
-#define yzzw yzzw()
-#define yzwx yzwx()
-#define yzwy yzwy()
-#define yzwz yzwz()
-#define yzww yzww()
-#define ywxx ywxx()
-#define ywxy ywxy()
-#define ywxz ywxz()
-#define ywxw ywxw()
-#define ywyx ywyx()
-#define ywyy ywyy()
-#define ywyz ywyz()
-#define ywyw ywyw()
-#define ywzx ywzx()
-#define ywzy ywzy()
-#define ywzz ywzz()
-#define ywzw ywzw()
-#define ywwx ywwx()
-#define ywwy ywwy()
-#define ywwz ywwz()
-#define ywww ywww()
-#define zxxx zxxx()
-#define zxxy zxxy()
-#define zxxz zxxz()
-#define zxxw zxxw()
-#define zxyx zxyx()
-#define zxyy zxyy()
-#define zxyz zxyz()
-#define zxyw zxyw()
-#define zxzx zxzx()
-#define zxzy zxzy()
-#define zxzz zxzz()
-#define zxzw zxzw()
-#define zxwx zxwx()
-#define zxwy zxwy()
-#define zxwz zxwz()
-#define zxww zxww()
-#define zyxx zyxx()
-#define zyxy zyxy()
-#define zyxz zyxz()
-#define zyxw zyxw()
-#define zyyx zyyx()
-#define zyyy zyyy()
-#define zyyz zyyz()
-#define zyyw zyyw()
-#define zyzx zyzx()
-#define zyzy zyzy()
-#define zyzz zyzz()
-#define zyzw zyzw()
-#define zywx zywx()
-#define zywy zywy()
-#define zywz zywz()
-#define zyww zyww()
-#define zzxx zzxx()
-#define zzxy zzxy()
-#define zzxz zzxz()
-#define zzxw zzxw()
-#define zzyx zzyx()
-#define zzyy zzyy()
-#define zzyz zzyz()
-#define zzyw zzyw()
-#define zzzx zzzx()
-#define zzzy zzzy()
-#define zzzz zzzz()
-#define zzzw zzzw()
-#define zzwx zzwx()
-#define zzwy zzwy()
-#define zzwz zzwz()
-#define zzww zzww()
-#define zwxx zwxx()
-#define zwxy zwxy()
-#define zwxz zwxz()
-#define zwxw zwxw()
-#define zwyx zwyx()
-#define zwyy zwyy()
-#define zwyz zwyz()
-#define zwyw zwyw()
-#define zwzx zwzx()
-#define zwzy zwzy()
-#define zwzz zwzz()
-#define zwzw zwzw()
-#define zwwx zwwx()
-#define zwwy zwwy()
-#define zwwz zwwz()
-#define zwww zwww()
-#define wxxx wxxx()
-#define wxxy wxxy()
-#define wxxz wxxz()
-#define wxxw wxxw()
-#define wxyx wxyx()
-#define wxyy wxyy()
-#define wxyz wxyz()
-#define wxyw wxyw()
-#define wxzx wxzx()
-#define wxzy wxzy()
-#define wxzz wxzz()
-#define wxzw wxzw()
-#define wxwx wxwx()
-#define wxwy wxwy()
-#define wxwz wxwz()
-#define wxww wxww()
-#define wyxx wyxx()
-#define wyxy wyxy()
-#define wyxz wyxz()
-#define wyxw wyxw()
-#define wyyx wyyx()
-#define wyyy wyyy()
-#define wyyz wyyz()
-#define wyyw wyyw()
-#define wyzx wyzx()
-#define wyzy wyzy()
-#define wyzz wyzz()
-#define wyzw wyzw()
-#define wywx wywx()
-#define wywy wywy()
-#define wywz wywz()
-#define wyww wyww()
-#define wzxx wzxx()
-#define wzxy wzxy()
-#define wzxz wzxz()
-#define wzxw wzxw()
-#define wzyx wzyx()
-#define wzyy wzyy()
-#define wzyz wzyz()
-#define wzyw wzyw()
-#define wzzx wzzx()
-#define wzzy wzzy()
-#define wzzz wzzz()
-#define wzzw wzzw()
-#define wzwx wzwx()
-#define wzwy wzwy()
-#define wzwz wzwz()
-#define wzww wzww()
-#define wwxx wwxx()
-#define wwxy wwxy()
-#define wwxz wwxz()
-#define wwxw wwxw()
-#define wwyx wwyx()
-#define wwyy wwyy()
-#define wwyz wwyz()
-#define wwyw wwyw()
-#define wwzx wwzx()
-#define wwzy wwzy()
-#define wwzz wwzz()
-#define wwzw wwzw()
-#define wwwx wwwx()
-#define wwwy wwwy()
-#define wwwz wwwz()
-#define wwww wwww()
diff --git a/3rdparty/bimg/3rdparty/nvtt/nvtt.cpp b/3rdparty/bimg/3rdparty/nvtt/nvtt.cpp
index d37921567ee..62f943b1026 100644
--- a/3rdparty/bimg/3rdparty/nvtt/nvtt.cpp
+++ b/3rdparty/bimg/3rdparty/nvtt/nvtt.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
*/
#include "nvtt.h"
diff --git a/3rdparty/bimg/LICENSE b/3rdparty/bimg/LICENSE
index 9fbd22dcba1..e21e5d5f338 100644
--- a/3rdparty/bimg/LICENSE
+++ b/3rdparty/bimg/LICENSE
@@ -1,4 +1,4 @@
-Copyright 2010-2021 Branimir Karadzic
+Copyright 2010-2022 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/3rdparty/bimg/README.md b/3rdparty/bimg/README.md
index ea37931f46e..d24e8c1f715 100644
--- a/3rdparty/bimg/README.md
+++ b/3rdparty/bimg/README.md
@@ -22,7 +22,7 @@ https://github.com/bkaradzic/bimg
<img align="right" src="http://opensource.org/trademarks/opensource/OSI-Approved-License-100x137.png">
</a>
- Copyright 2010-2021 Branimir Karadzic
+ Copyright 2010-2022 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/3rdparty/bimg/include/bimg/bimg.h b/3rdparty/bimg/include/bimg/bimg.h
index 6cc64ca0de6..07a5db6d002 100644
--- a/3rdparty/bimg/include/bimg/bimg.h
+++ b/3rdparty/bimg/include/bimg/bimg.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
*/
#ifndef BIMG_IMAGE_H_HEADER_GUARD
@@ -69,11 +69,19 @@ namespace bimg
ATCE, //!< ATCE RGBA 8 BPP explicit alpha
ATCI, //!< ATCI RGBA 8 BPP interpolated alpha
ASTC4x4, //!< ASTC 4x4 8.0 BPP
+ ASTC5x4, //!< ASTC 5x4 6.40 BPP
ASTC5x5, //!< ASTC 5x5 5.12 BPP
+ ASTC6x5, //!< ASTC 6x5 4.27 BPP
ASTC6x6, //!< ASTC 6x6 3.56 BPP
ASTC8x5, //!< ASTC 8x5 3.20 BPP
ASTC8x6, //!< ASTC 8x6 2.67 BPP
+ ASTC8x8, //!< ASTC 8x8 2.00 BPP
ASTC10x5, //!< ASTC 10x5 2.56 BPP
+ ASTC10x6, //!< ASTC 10x6 2.13 BPP
+ ASTC10x8, //!< ASTC 10x8 1.60 BPP
+ ASTC10x10, //!< ASTC 10x10 1.28 BPP
+ ASTC12x10, //!< ASTC 12x10 1.07 BPP
+ ASTC12x12, //!< ASTC 12x12 0.89 BPP
Unknown, // Compressed formats above.
@@ -121,8 +129,11 @@ namespace bimg
RGBA32I,
RGBA32U,
RGBA32F,
+ B5G6R5,
R5G6B5,
+ BGRA4,
RGBA4,
+ BGR5A1,
RGB5A1,
RGB10A2,
RG11B10F,
diff --git a/3rdparty/bimg/include/bimg/decode.h b/3rdparty/bimg/include/bimg/decode.h
index 8abcc811596..d5c942d2f98 100644
--- a/3rdparty/bimg/include/bimg/decode.h
+++ b/3rdparty/bimg/include/bimg/decode.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
*/
#ifndef BIMG_DECODE_H_HEADER_GUARD
diff --git a/3rdparty/bimg/include/bimg/encode.h b/3rdparty/bimg/include/bimg/encode.h
index ee5486fcf41..26fd79cefad 100644
--- a/3rdparty/bimg/include/bimg/encode.h
+++ b/3rdparty/bimg/include/bimg/encode.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
*/
#ifndef BIMG_ENCODE_H_HEADER_GUARD
diff --git a/3rdparty/bimg/makefile b/3rdparty/bimg/makefile
index c2e23f81fb2..f97c689f5e2 100644
--- a/3rdparty/bimg/makefile
+++ b/3rdparty/bimg/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
#
UNAME := $(shell uname)
@@ -161,6 +161,14 @@ osx-x64-release: .build/projects/gmake-osx-x64
make -C .build/projects/gmake-osx config=release
osx-x64: osx-x64-debug osx-x64-release
+.build/projects/gmake-osx-arm64:
+ $(GENIE) --gcc=osx-arm64 gmake
+osx-arm64-debug: .build/projects/gmake-osx-arm64
+ make -C .build/projects/gmake-osx-arm64 config=debug
+osx-arm64-release: .build/projects/gmake-osx-arm64
+ make -C .build/projects/gmake-osx-arm64 config=release
+osx-arm64: osx-arm64-debug osx-arm64-release
+
.build/projects/gmake-ios-arm:
$(GENIE) --gcc=ios-arm gmake
ios-arm-debug: .build/projects/gmake-ios-arm ## Build - iOS ARM Debug
diff --git a/3rdparty/bimg/scripts/bimg.lua b/3rdparty/bimg/scripts/bimg.lua
index 53426f1375f..0dde12d3899 100644
--- a/3rdparty/bimg/scripts/bimg.lua
+++ b/3rdparty/bimg/scripts/bimg.lua
@@ -1,5 +1,5 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
-- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
--
@@ -7,35 +7,30 @@ project "bimg"
kind "StaticLib"
includedirs {
- path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
- path.join(BIMG_DIR, "3rdparty/astc-codec"),
- path.join(BIMG_DIR, "3rdparty/astc-codec/include"),
+ path.join(BIMG_DIR, "3rdparty/astc-encoder/include"),
path.join(BIMG_DIR, "3rdparty/tinyexr/deps/miniz"),
}
- local ASTC_CODEC_DIR = path.join(BIMG_DIR, "3rdparty/astc-codec")
-
files {
path.join(BIMG_DIR, "include/**"),
path.join(BIMG_DIR, "src/image.*"),
path.join(BIMG_DIR, "src/image_gnf.cpp"),
- path.join(ASTC_CODEC_DIR, "src/decoder/astc_file.*"),
- path.join(ASTC_CODEC_DIR, "src/decoder/codec.*"),
- path.join(ASTC_CODEC_DIR, "src/decoder/endpoint_codec.*"),
- path.join(ASTC_CODEC_DIR, "src/decoder/footprint.*"),
- path.join(ASTC_CODEC_DIR, "src/decoder/integer_sequence_codec.*"),
- path.join(ASTC_CODEC_DIR, "src/decoder/intermediate_astc_block.*"),
- path.join(ASTC_CODEC_DIR, "src/decoder/logical_astc_block.*"),
- path.join(ASTC_CODEC_DIR, "src/decoder/partition.*"),
- path.join(ASTC_CODEC_DIR, "src/decoder/physical_astc_block.*"),
- path.join(ASTC_CODEC_DIR, "src/decoder/quantization.*"),
- path.join(ASTC_CODEC_DIR, "src/decoder/weight_infill.*"),
+ path.join(BIMG_DIR, "3rdparty/astc-encoder/source/**.cpp"),
+ path.join(BIMG_DIR, "3rdparty/astc-encoder/source/**.h"),
path.join(BIMG_DIR, "3rdparty/tinyexr/deps/miniz/miniz.*"),
}
+ using_bx()
+
+ configuration {}
+
+ removeflags {
+ "FloatFast", -- astc-encoder doesn't work with it.
+ }
+
configuration { "linux-*" }
buildoptions {
"-fPIC",
diff --git a/3rdparty/bimg/scripts/bimg_decode.lua b/3rdparty/bimg/scripts/bimg_decode.lua
index 5e8d8acfdc6..143027e731e 100644
--- a/3rdparty/bimg/scripts/bimg_decode.lua
+++ b/3rdparty/bimg/scripts/bimg_decode.lua
@@ -1,5 +1,5 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
-- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
--
@@ -7,7 +7,6 @@ project "bimg_decode"
kind "StaticLib"
includedirs {
- path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
path.join(BIMG_DIR, "3rdparty"),
path.join(BIMG_DIR, "3rdparty/tinyexr/deps/miniz"),
@@ -18,6 +17,8 @@ project "bimg_decode"
path.join(BIMG_DIR, "src/image_decode.*"),
}
+ using_bx()
+
configuration { "linux-*" }
buildoptions {
"-fPIC",
diff --git a/3rdparty/bimg/scripts/bimg_encode.lua b/3rdparty/bimg/scripts/bimg_encode.lua
index c561dd62fc6..6bc48d345e0 100644
--- a/3rdparty/bimg/scripts/bimg_encode.lua
+++ b/3rdparty/bimg/scripts/bimg_encode.lua
@@ -1,5 +1,5 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
-- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
--
@@ -7,11 +7,11 @@ project "bimg_encode"
kind "StaticLib"
includedirs {
- path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
path.join(BIMG_DIR, "3rdparty"),
- path.join(BIMG_DIR, "3rdparty/nvtt"),
+ path.join(BIMG_DIR, "3rdparty/astc-encoder/include"),
path.join(BIMG_DIR, "3rdparty/iqa/include"),
+ path.join(BIMG_DIR, "3rdparty/nvtt"),
path.join(BIMG_DIR, "3rdparty/tinyexr/deps/miniz"),
}
@@ -31,13 +31,19 @@ project "bimg_encode"
path.join(BIMG_DIR, "3rdparty/nvtt/**.h"),
path.join(BIMG_DIR, "3rdparty/pvrtc/**.cpp"),
path.join(BIMG_DIR, "3rdparty/pvrtc/**.h"),
- path.join(BIMG_DIR, "3rdparty/astc/**.cpp"),
- path.join(BIMG_DIR, "3rdparty/astc/**.h"),
path.join(BIMG_DIR, "3rdparty/tinyexr/**.h"),
path.join(BIMG_DIR, "3rdparty/iqa/include/**.h"),
path.join(BIMG_DIR, "3rdparty/iqa/source/**.c"),
}
+ using_bx()
+
+ configuration {}
+
+ removeflags {
+ "FloatFast", -- astc-encoder doesn't work with it.
+ }
+
configuration { "linux-*" }
buildoptions {
"-fPIC",
diff --git a/3rdparty/bimg/scripts/genie.lua b/3rdparty/bimg/scripts/genie.lua
index d05658c1fc0..2cd13581109 100644
--- a/3rdparty/bimg/scripts/genie.lua
+++ b/3rdparty/bimg/scripts/genie.lua
@@ -1,6 +1,6 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
--
newoption {
@@ -37,7 +37,6 @@ solution "bimg"
end
language "C++"
- startproject "example-00-helloworld"
MODULE_DIR = path.getabsolute("..")
BIMG_DIR = path.getabsolute("..")
@@ -64,12 +63,11 @@ function copyLib()
end
group "libs"
+dofile(path.join(BX_DIR, "scripts/bx.lua"))
dofile "bimg.lua"
dofile "bimg_decode.lua"
dofile "bimg_encode.lua"
-dofile(path.join(BX_DIR, "scripts/bx.lua"))
-
if _OPTIONS["with-tools"] then
group "tools"
dofile "texturec.lua"
diff --git a/3rdparty/bimg/scripts/texturec.lua b/3rdparty/bimg/scripts/texturec.lua
index 9f2b90945cd..2a392696701 100644
--- a/3rdparty/bimg/scripts/texturec.lua
+++ b/3rdparty/bimg/scripts/texturec.lua
@@ -1,13 +1,12 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
--
project "texturec"
kind "ConsoleApp"
includedirs {
- path.join(BX_DIR, "include"),
path.join(BIMG_DIR, "include"),
}
@@ -20,9 +19,10 @@ project "texturec"
"bimg_decode",
"bimg_encode",
"bimg",
- "bx",
}
+ using_bx()
+
configuration { "mingw-*" }
targetextension ".exe"
diff --git a/3rdparty/bimg/src/bimg_p.h b/3rdparty/bimg/src/bimg_p.h
index 83a9e28dc25..909d654f848 100644
--- a/3rdparty/bimg/src/bimg_p.h
+++ b/3rdparty/bimg/src/bimg_p.h
@@ -1,13 +1,48 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
*/
#ifndef BIMG_P_H_HEADER_GUARD
#define BIMG_P_H_HEADER_GUARD
+#ifndef BX_CONFIG_DEBUG
+# error "BX_CONFIG_DEBUG must be defined in build script!"
+#endif // BIMG_CONFIG_DEBUG
+
+#if BX_CONFIG_DEBUG
+# define BX_TRACE _BIMG_TRACE
+# define BX_WARN _BIMG_WARN
+# define BX_ASSERT _BIMG_ASSERT
+#endif // BX_CONFIG_DEBUG
+
+#define BX_ASSERT2 BX_ASSERT
+
+#define _BIMG_TRACE(_format, ...) \
+ BX_MACRO_BLOCK_BEGIN \
+ bx::debugPrintf(__FILE__ "(" BX_STRINGIZE(__LINE__) "): BX " _format "\n", ##__VA_ARGS__); \
+ BX_MACRO_BLOCK_END
+
+#define _BIMG_WARN(_condition, _format, ...) \
+ BX_MACRO_BLOCK_BEGIN \
+ if (!BX_IGNORE_C4127(_condition) ) \
+ { \
+ BX_TRACE("WARN " _format, ##__VA_ARGS__); \
+ } \
+ BX_MACRO_BLOCK_END
+
+#define _BIMG_ASSERT(_condition, _format, ...) \
+ BX_MACRO_BLOCK_BEGIN \
+ if (!BX_IGNORE_C4127(_condition) ) \
+ { \
+ BX_TRACE("ASSERT " _format, ##__VA_ARGS__); \
+ bx::debugBreak(); \
+ } \
+ BX_MACRO_BLOCK_END
+
#include <bimg/bimg.h>
#include <bx/allocator.h>
+#include <bx/debug.h>
#include <bx/readerwriter.h>
#include <bx/pixelformat.h>
#include <bx/endian.h>
diff --git a/3rdparty/bimg/src/config.h b/3rdparty/bimg/src/config.h
index 4c2beb105c1..8d4d94fe99a 100644
--- a/3rdparty/bimg/src/config.h
+++ b/3rdparty/bimg/src/config.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
*/
#ifndef BIMG_CONFIG_H_HEADER_GUARD
diff --git a/3rdparty/bimg/src/image.cpp b/3rdparty/bimg/src/image.cpp
index 63b0d5f5f0e..63d46254a09 100644
--- a/3rdparty/bimg/src/image.cpp
+++ b/3rdparty/bimg/src/image.cpp
@@ -1,12 +1,12 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
*/
#include "bimg_p.h"
#include <bx/hash.h>
-#include <astc-codec/astc-codec.h>
+#include <astcenc.h>
#include <bx/debug.h>
@@ -46,11 +46,19 @@ namespace bimg
{ 8, 4, 4, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ATCE
{ 8, 4, 4, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ATCI
{ 8, 4, 4, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC4x4
+ { 6, 5, 4, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC5x4
{ 6, 5, 5, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC5x5
+ { 4, 6, 5, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC6x5
{ 4, 6, 6, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC6x6
{ 4, 8, 5, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC8x5
{ 3, 8, 6, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC8x6
+ { 2, 8, 8, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC8x8
{ 3, 10, 5, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC10x5
+ { 2, 10, 6, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC10x6
+ { 2, 10, 8, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC10x8
+ { 1, 10,10, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC10x10
+ { 1, 12,10, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC12x10
+ { 1, 12,12, 16, 1, 1, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // ASTC12x12
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, uint8_t(bx::EncodingType::Count) }, // Unknown
{ 1, 8, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0, uint8_t(bx::EncodingType::Unorm) }, // R1
{ 8, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 8, uint8_t(bx::EncodingType::Unorm) }, // A8
@@ -96,8 +104,11 @@ namespace bimg
{ 128, 1, 1, 16, 1, 1, 0, 0, 32, 32, 32, 32, uint8_t(bx::EncodingType::Int ) }, // RGBA32I
{ 128, 1, 1, 16, 1, 1, 0, 0, 32, 32, 32, 32, uint8_t(bx::EncodingType::Uint ) }, // RGBA32U
{ 128, 1, 1, 16, 1, 1, 0, 0, 32, 32, 32, 32, uint8_t(bx::EncodingType::Float) }, // RGBA32F
+ { 16, 1, 1, 2, 1, 1, 0, 0, 5, 6, 5, 0, uint8_t(bx::EncodingType::Unorm) }, // B5G6R5
{ 16, 1, 1, 2, 1, 1, 0, 0, 5, 6, 5, 0, uint8_t(bx::EncodingType::Unorm) }, // R5G6B5
+ { 16, 1, 1, 2, 1, 1, 0, 0, 4, 4, 4, 4, uint8_t(bx::EncodingType::Unorm) }, // BGRA4
{ 16, 1, 1, 2, 1, 1, 0, 0, 4, 4, 4, 4, uint8_t(bx::EncodingType::Unorm) }, // RGBA4
+ { 16, 1, 1, 2, 1, 1, 0, 0, 5, 5, 5, 1, uint8_t(bx::EncodingType::Unorm) }, // BGR5A1
{ 16, 1, 1, 2, 1, 1, 0, 0, 5, 5, 5, 1, uint8_t(bx::EncodingType::Unorm) }, // RGB5A1
{ 32, 1, 1, 4, 1, 1, 0, 0, 10, 10, 10, 2, uint8_t(bx::EncodingType::Unorm) }, // RGB10A2
{ 32, 1, 1, 4, 1, 1, 0, 0, 11, 11, 10, 0, uint8_t(bx::EncodingType::Unorm) }, // RG11B10F
@@ -136,11 +147,19 @@ namespace bimg
"ATCE", // ATCE
"ATCI", // ATCI
"ASTC4x4", // ASTC4x4
+ "ASTC5x4", // ASTC5x4
"ASTC5x5", // ASTC5x5
+ "ASTC6x5", // ASTC6x5
"ASTC6x6", // ASTC6x6
"ASTC8x5", // ASTC8x5
"ASTC8x6", // ASTC8x6
+ "ASTC8x8", // ASTC8x8
"ASTC10x5", // ASTC10x5
+ "ASTC10x6", // ASTC10x6
+ "ASTC10x8", // ASTC10x8
+ "ASTC10x10", // ASTC10x10
+ "ASTC12x10", // ASTC12x10
+ "ASTC12x12", // ASTC12x12
"<unknown>", // Unknown
"R1", // R1
"A8", // A8
@@ -186,11 +205,14 @@ namespace bimg
"RGBA32I", // RGBA32I
"RGBA32U", // RGBA32U
"RGBA32F", // RGBA32F
+ "B5G6R5", // B5G6R5
"R5G6B5", // R5G6B5
+ "BGRA4", // BGRA4
"RGBA4", // RGBA4
+ "BGR5A1", // BGR5A1
"RGB5A1", // RGB5A1
"RGB10A2", // RGB10A2
- "RG11B10F", // RG11B10F
+ "RG11B10F", // RG11B10F
"<unknown>", // UnknownDepth
"D16", // D16
"D24", // D24
@@ -1058,11 +1080,19 @@ namespace bimg
{ NULL, NULL }, // ATCE
{ NULL, NULL }, // ATCI
{ NULL, NULL }, // ASTC4x4
+ { NULL, NULL }, // ASTC5x4
{ NULL, NULL }, // ASTC5x5
+ { NULL, NULL }, // ASTC6x5
{ NULL, NULL }, // ASTC6x6
{ NULL, NULL }, // ASTC8x5
{ NULL, NULL }, // ASTC8x6
+ { NULL, NULL }, // ASTC8x8
{ NULL, NULL }, // ASTC10x5
+ { NULL, NULL }, // ASTC10x6
+ { NULL, NULL }, // ASTC10x8
+ { NULL, NULL }, // ASTC10x10
+ { NULL, NULL }, // ASTC12x10
+ { NULL, NULL }, // ASTC12x12
{ NULL, NULL }, // Unknown
{ NULL, NULL }, // R1
{ bx::packA8, bx::unpackA8 }, // A8
@@ -1108,8 +1138,11 @@ namespace bimg
{ bx::packRgba32I, bx::unpackRgba32I }, // RGBA32I
{ bx::packRgba32U, bx::unpackRgba32U }, // RGBA32U
{ bx::packRgba32F, bx::unpackRgba32F }, // RGBA32F
+ { bx::packB5G6R5, bx::unpackB5G6R5 }, // B5G6R5
{ bx::packR5G6B5, bx::unpackR5G6B5 }, // R5G6B5
+ { bx::packBgra4, bx::unpackBgra4 }, // BGRA4
{ bx::packRgba4, bx::unpackRgba4 }, // RGBA4
+ { bx::packBgr5a1, bx::unpackBgr5a1 }, // BGR5A1
{ bx::packRgb5a1, bx::unpackRgb5a1 }, // RGB5A1
{ bx::packRgb10A2, bx::unpackRgb10A2 }, // RGB10A2
{ bx::packRG11B10F, bx::unpackRG11B10F }, // RG11B10F
@@ -1123,7 +1156,7 @@ namespace bimg
{ bx::packR32F, bx::unpackR32F }, // D32F
{ bx::packR8, bx::unpackR8 }, // D0S8
};
- BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_packUnpack) );
+ BX_STATIC_ASSERT(TextureFormat::Count == BX_COUNTOF(s_packUnpack) );
PackFn getPack(TextureFormat::Enum _format)
{
@@ -1284,7 +1317,7 @@ namespace bimg
bx::MemoryReader reader(_src, _size);
uint32_t magic;
- bx::read(&reader, magic);
+ bx::read(&reader, magic, bx::ErrorIgnore{});
ImageContainer imageContainer;
if (magicT != magic)
@@ -3315,20 +3348,28 @@ namespace bimg
#define DDS_BC5U BX_MAKEFOURCC('B', 'C', '5', 'U')
#define DDS_DX10 BX_MAKEFOURCC('D', 'X', '1', '0')
-#define DDS_ETC1 BX_MAKEFOURCC('E', 'T', 'C', '1')
-#define DDS_ETC2 BX_MAKEFOURCC('E', 'T', 'C', '2')
-#define DDS_ET2A BX_MAKEFOURCC('E', 'T', '2', 'A')
-#define DDS_PTC2 BX_MAKEFOURCC('P', 'T', 'C', '2')
-#define DDS_PTC4 BX_MAKEFOURCC('P', 'T', 'C', '4')
-#define DDS_ATC BX_MAKEFOURCC('A', 'T', 'C', ' ')
-#define DDS_ATCE BX_MAKEFOURCC('A', 'T', 'C', 'E')
-#define DDS_ATCI BX_MAKEFOURCC('A', 'T', 'C', 'I')
-#define DDS_ASTC4x4 BX_MAKEFOURCC('A', 'S', '4', '4')
-#define DDS_ASTC5x5 BX_MAKEFOURCC('A', 'S', '5', '5')
-#define DDS_ASTC6x6 BX_MAKEFOURCC('A', 'S', '6', '6')
-#define DDS_ASTC8x5 BX_MAKEFOURCC('A', 'S', '8', '5')
-#define DDS_ASTC8x6 BX_MAKEFOURCC('A', 'S', '8', '6')
-#define DDS_ASTC10x5 BX_MAKEFOURCC('A', 'S', ':', '5')
+#define DDS_ETC1 BX_MAKEFOURCC('E', 'T', 'C', '1')
+#define DDS_ETC2 BX_MAKEFOURCC('E', 'T', 'C', '2')
+#define DDS_ET2A BX_MAKEFOURCC('E', 'T', '2', 'A')
+#define DDS_PTC2 BX_MAKEFOURCC('P', 'T', 'C', '2')
+#define DDS_PTC4 BX_MAKEFOURCC('P', 'T', 'C', '4')
+#define DDS_ATC BX_MAKEFOURCC('A', 'T', 'C', ' ')
+#define DDS_ATCE BX_MAKEFOURCC('A', 'T', 'C', 'E')
+#define DDS_ATCI BX_MAKEFOURCC('A', 'T', 'C', 'I')
+#define DDS_ASTC4x4 BX_MAKEFOURCC('A', 'S', '4', '4')
+#define DDS_ASTC5x4 BX_MAKEFOURCC('A', 'S', '5', '4')
+#define DDS_ASTC5x5 BX_MAKEFOURCC('A', 'S', '5', '5')
+#define DDS_ASTC6x5 BX_MAKEFOURCC('A', 'S', '6', '5')
+#define DDS_ASTC6x6 BX_MAKEFOURCC('A', 'S', '6', '6')
+#define DDS_ASTC8x5 BX_MAKEFOURCC('A', 'S', '8', '5')
+#define DDS_ASTC8x6 BX_MAKEFOURCC('A', 'S', '8', '6')
+#define DDS_ASTC8x8 BX_MAKEFOURCC('A', 'S', '8', '8')
+#define DDS_ASTC10x5 BX_MAKEFOURCC('A', 'S', ':', '5')
+#define DDS_ASTC10x6 BX_MAKEFOURCC('A', 'S', ':', '6')
+#define DDS_ASTC10x8 BX_MAKEFOURCC('A', 'S', ':', '8')
+#define DDS_ASTC10x10 BX_MAKEFOURCC('A', 'S', ':', ':')
+#define DDS_ASTC12x10 BX_MAKEFOURCC('A', 'S', '<', ':')
+#define DDS_ASTC12x12 BX_MAKEFOURCC('A', 'S', '<', '<')
#define DDS_R8G8B8 20
#define DDS_A8R8G8B8 21
@@ -3456,11 +3497,19 @@ namespace bimg
{ DDS_ATCE, TextureFormat::ATCE, false },
{ DDS_ATCI, TextureFormat::ATCI, false },
{ DDS_ASTC4x4, TextureFormat::ASTC4x4, false },
+ { DDS_ASTC5x4, TextureFormat::ASTC5x4, false },
{ DDS_ASTC5x5, TextureFormat::ASTC5x5, false },
+ { DDS_ASTC6x5, TextureFormat::ASTC6x5, false },
{ DDS_ASTC6x6, TextureFormat::ASTC6x6, false },
{ DDS_ASTC8x5, TextureFormat::ASTC8x5, false },
{ DDS_ASTC8x6, TextureFormat::ASTC8x6, false },
+ { DDS_ASTC8x8, TextureFormat::ASTC8x8, false },
{ DDS_ASTC10x5, TextureFormat::ASTC10x5, false },
+ { DDS_ASTC10x6, TextureFormat::ASTC10x6, false },
+ { DDS_ASTC10x8, TextureFormat::ASTC10x8, false },
+ { DDS_ASTC10x10, TextureFormat::ASTC10x10,false },
+ { DDS_ASTC12x10, TextureFormat::ASTC12x10,false },
+ { DDS_ASTC12x12, TextureFormat::ASTC12x12,false },
{ DDS_A16B16G16R16, TextureFormat::RGBA16, false },
{ DDS_A16B16G16R16F, TextureFormat::RGBA16F, false },
@@ -3479,8 +3528,11 @@ namespace bimg
{ DDS_A16B16G16R16, TextureFormat::RGBA16, false },
{ DDS_A16B16G16R16F, TextureFormat::RGBA16F, false },
{ DDS_A32B32G32R32F, TextureFormat::RGBA32F, false },
+ { DDS_R5G6B5, TextureFormat::B5G6R5, false },
{ DDS_R5G6B5, TextureFormat::R5G6B5, false },
+ { DDS_A4R4G4B4, TextureFormat::BGRA4, false },
{ DDS_A4R4G4B4, TextureFormat::RGBA4, false },
+ { DDS_A1R5G5B5, TextureFormat::BGR5A1, false },
{ DDS_A1R5G5B5, TextureFormat::RGB5A1, false },
{ DDS_A2B10G10R10, TextureFormat::RGB10A2, false },
};
@@ -3519,8 +3571,11 @@ namespace bimg
{ DDS_FORMAT_R16G16B16A16_FLOAT, TextureFormat::RGBA16F, false },
{ DDS_FORMAT_R32G32B32A32_UINT, TextureFormat::RGBA32U, false },
{ DDS_FORMAT_R32G32B32A32_FLOAT, TextureFormat::RGBA32F, false },
+ { DDS_FORMAT_B5G6R5_UNORM, TextureFormat::B5G6R5, false },
{ DDS_FORMAT_B5G6R5_UNORM, TextureFormat::R5G6B5, false },
+ { DDS_FORMAT_B4G4R4A4_UNORM, TextureFormat::BGRA4, false },
{ DDS_FORMAT_B4G4R4A4_UNORM, TextureFormat::RGBA4, false },
+ { DDS_FORMAT_B5G5R5A1_UNORM, TextureFormat::BGR5A1, false },
{ DDS_FORMAT_B5G5R5A1_UNORM, TextureFormat::RGB5A1, false },
{ DDS_FORMAT_R10G10B10A2_UNORM, TextureFormat::RGB10A2, false },
{ DDS_FORMAT_R11G11B10_FLOAT, TextureFormat::RG11B10F, false },
@@ -3539,8 +3594,11 @@ namespace bimg
{ 8, DDPF_LUMINANCE, { 0x000000ff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R8 },
{ 16, DDPF_BUMPDUDV, { 0x000000ff, 0x0000ff00, 0x00000000, 0x00000000 }, TextureFormat::RG8S },
{ 16, DDPF_RGB, { 0x0000ffff, 0x00000000, 0x00000000, 0x00000000 }, TextureFormat::R16U },
+ { 16, DDPF_RGB|DDPF_ALPHAPIXELS, { 0x0000000f, 0x000000f0, 0x00000f00, 0x0000f000 }, TextureFormat::BGRA4 },
{ 16, DDPF_RGB|DDPF_ALPHAPIXELS, { 0x00000f00, 0x000000f0, 0x0000000f, 0x0000f000 }, TextureFormat::RGBA4 },
+ { 16, DDPF_RGB, { 0x0000001f, 0x000007e0, 0x0000f800, 0x00000000 }, TextureFormat::B5G6R5 },
{ 16, DDPF_RGB, { 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000 }, TextureFormat::R5G6B5 },
+ { 16, DDPF_RGB, { 0x0000001f, 0x000003e0, 0x00007c00, 0x00008000 }, TextureFormat::BGR5A1 },
{ 16, DDPF_RGB, { 0x00007c00, 0x000003e0, 0x0000001f, 0x00008000 }, TextureFormat::RGB5A1 },
{ 24, DDPF_RGB, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }, TextureFormat::RGB8 },
{ 24, DDPF_RGB, { 0x000000ff, 0x0000ff00, 0x00ff0000, 0x00000000 }, TextureFormat::RGB8 },
@@ -3648,6 +3706,8 @@ namespace bimg
total += bx::read(_reader, miscFlags2, _err);
}
+ BX_UNUSED(total);
+
if (!_err->isOk() )
{
return false;
@@ -3792,17 +3852,33 @@ namespace bimg
#define KTX_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
#define KTX_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
#define KTX_COMPRESSED_RGBA_ASTC_4x4_KHR 0x93B0
+#define KTX_COMPRESSED_RGBA_ASTC_5x4_KHR 0x93B1
#define KTX_COMPRESSED_RGBA_ASTC_5x5_KHR 0x93B2
+#define KTX_COMPRESSED_RGBA_ASTC_6x5_KHR 0x93B3
#define KTX_COMPRESSED_RGBA_ASTC_6x6_KHR 0x93B4
#define KTX_COMPRESSED_RGBA_ASTC_8x5_KHR 0x93B5
#define KTX_COMPRESSED_RGBA_ASTC_8x6_KHR 0x93B6
+#define KTX_COMPRESSED_RGBA_ASTC_8x8_KHR 0x93B7
#define KTX_COMPRESSED_RGBA_ASTC_10x5_KHR 0x93B8
+#define KTX_COMPRESSED_RGBA_ASTC_10x6_KHR 0x93B9
+#define KTX_COMPRESSED_RGBA_ASTC_10x8_KHR 0x93BA
+#define KTX_COMPRESSED_RGBA_ASTC_10x10_KHR 0x93BB
+#define KTX_COMPRESSED_RGBA_ASTC_12x10_KHR 0x93BC
+#define KTX_COMPRESSED_RGBA_ASTC_12x12_KHR 0x93BD
#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR 0x93D0
+#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR 0x93D1
#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR 0x93D2
+#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR 0x93D3
#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR 0x93D4
#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR 0x93D5
#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR 0x93D6
+#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR 0x93D7
#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR 0x93D8
+#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR 0x93D9
+#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR 0x93DA
+#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR 0x93DB
+#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR 0x93DC
+#define KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR 0x93DD
#define KTX_A8 0x803C
#define KTX_R8 0x8229
@@ -3916,11 +3992,19 @@ namespace bimg
{ KTX_ATC_RGBA_EXPLICIT_ALPHA_AMD, KTX_ZERO, KTX_ATC_RGBA_EXPLICIT_ALPHA_AMD, KTX_ZERO, }, // ATCE
{ KTX_ATC_RGBA_INTERPOLATED_ALPHA_AMD, KTX_ZERO, KTX_ATC_RGBA_INTERPOLATED_ALPHA_AMD, KTX_ZERO, }, // ATCI
{ KTX_COMPRESSED_RGBA_ASTC_4x4_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR, KTX_COMPRESSED_RGBA_ASTC_4x4_KHR, KTX_ZERO, }, // ASTC4x4
+ { KTX_COMPRESSED_RGBA_ASTC_5x4_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR, KTX_COMPRESSED_RGBA_ASTC_5x4_KHR, KTX_ZERO, }, // ASTC5x4
{ KTX_COMPRESSED_RGBA_ASTC_5x5_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR, KTX_COMPRESSED_RGBA_ASTC_5x5_KHR, KTX_ZERO, }, // ASTC5x5
+ { KTX_COMPRESSED_RGBA_ASTC_6x5_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR, KTX_COMPRESSED_RGBA_ASTC_6x5_KHR, KTX_ZERO, }, // ASTC6x5
{ KTX_COMPRESSED_RGBA_ASTC_6x6_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR, KTX_COMPRESSED_RGBA_ASTC_6x6_KHR, KTX_ZERO, }, // ASTC6x6
{ KTX_COMPRESSED_RGBA_ASTC_8x5_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR, KTX_COMPRESSED_RGBA_ASTC_8x5_KHR, KTX_ZERO, }, // ASTC8x5
{ KTX_COMPRESSED_RGBA_ASTC_8x6_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR, KTX_COMPRESSED_RGBA_ASTC_8x6_KHR, KTX_ZERO, }, // ASTC8x6
+ { KTX_COMPRESSED_RGBA_ASTC_8x8_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR, KTX_COMPRESSED_RGBA_ASTC_8x8_KHR, KTX_ZERO, }, // ASTC8x8
{ KTX_COMPRESSED_RGBA_ASTC_10x5_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR, KTX_COMPRESSED_RGBA_ASTC_10x5_KHR, KTX_ZERO, }, // ASTC10x5
+ { KTX_COMPRESSED_RGBA_ASTC_10x6_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR, KTX_COMPRESSED_RGBA_ASTC_10x6_KHR, KTX_ZERO, }, // ASTC10x6
+ { KTX_COMPRESSED_RGBA_ASTC_10x8_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR, KTX_COMPRESSED_RGBA_ASTC_10x8_KHR, KTX_ZERO, }, // ASTC10x8
+ { KTX_COMPRESSED_RGBA_ASTC_10x10_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR, KTX_COMPRESSED_RGBA_ASTC_10x10_KHR, KTX_ZERO, }, // ASTC10x10
+ { KTX_COMPRESSED_RGBA_ASTC_12x10_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR, KTX_COMPRESSED_RGBA_ASTC_12x10_KHR, KTX_ZERO, }, // ASTC12x10
+ { KTX_COMPRESSED_RGBA_ASTC_12x12_KHR, KTX_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR, KTX_COMPRESSED_RGBA_ASTC_12x12_KHR, KTX_ZERO, }, // ASTC12x12
{ KTX_ZERO, KTX_ZERO, KTX_ZERO, KTX_ZERO, }, // Unknown
{ KTX_ZERO, KTX_ZERO, KTX_ZERO, KTX_ZERO, }, // R1
{ KTX_ALPHA, KTX_ZERO, KTX_ALPHA, KTX_UNSIGNED_BYTE, }, // A8
@@ -3966,8 +4050,11 @@ namespace bimg
{ KTX_RGBA32I, KTX_ZERO, KTX_RGBA, KTX_INT, }, // RGBA32I
{ KTX_RGBA32UI, KTX_ZERO, KTX_RGBA, KTX_UNSIGNED_INT, }, // RGBA32U
{ KTX_RGBA32F, KTX_ZERO, KTX_RGBA, KTX_FLOAT, }, // RGBA32F
+ { KTX_RGB565, KTX_ZERO, KTX_RGB, KTX_UNSIGNED_SHORT_5_6_5, }, // B5G6R5
{ KTX_RGB565, KTX_ZERO, KTX_RGB, KTX_UNSIGNED_SHORT_5_6_5, }, // R5G6B5
+ { KTX_RGBA4, KTX_ZERO, KTX_BGRA, KTX_UNSIGNED_SHORT_4_4_4_4, }, // BGRA4
{ KTX_RGBA4, KTX_ZERO, KTX_RGBA, KTX_UNSIGNED_SHORT_4_4_4_4, }, // RGBA4
+ { KTX_RGB5_A1, KTX_ZERO, KTX_BGRA, KTX_UNSIGNED_SHORT_5_5_5_1, }, // BGR5A1
{ KTX_RGB5_A1, KTX_ZERO, KTX_RGBA, KTX_UNSIGNED_SHORT_5_5_5_1, }, // RGB5A1
{ KTX_RGB10_A2, KTX_ZERO, KTX_RGBA, KTX_UNSIGNED_INT_2_10_10_10_REV, }, // RGB10A2
{ KTX_R11F_G11F_B10F, KTX_ZERO, KTX_RGB, KTX_UNSIGNED_INT_10F_11F_11F_REV, }, // RG11B10F
@@ -3994,7 +4081,7 @@ namespace bimg
BX_ERROR_SCOPE(_err);
uint8_t identifier[8];
- bx::read(_reader, identifier);
+ bx::read(_reader, identifier, _err);
if (identifier[1] != '1'
&& identifier[2] != '1')
@@ -4004,45 +4091,50 @@ namespace bimg
}
uint32_t endianness;
- bx::read(_reader, endianness);
+ bx::read(_reader, endianness, _err);
bool fromLittleEndian = 0x04030201 == endianness;
uint32_t glType;
- bx::readHE(_reader, glType, fromLittleEndian);
+ bx::readHE(_reader, glType, fromLittleEndian, _err);
uint32_t glTypeSize;
- bx::readHE(_reader, glTypeSize, fromLittleEndian);
+ bx::readHE(_reader, glTypeSize, fromLittleEndian, _err);
uint32_t glFormat;
- bx::readHE(_reader, glFormat, fromLittleEndian);
+ bx::readHE(_reader, glFormat, fromLittleEndian, _err);
uint32_t glInternalFormat;
- bx::readHE(_reader, glInternalFormat, fromLittleEndian);
+ bx::readHE(_reader, glInternalFormat, fromLittleEndian, _err);
uint32_t glBaseInternalFormat;
- bx::readHE(_reader, glBaseInternalFormat, fromLittleEndian);
+ bx::readHE(_reader, glBaseInternalFormat, fromLittleEndian, _err);
uint32_t width;
- bx::readHE(_reader, width, fromLittleEndian);
+ bx::readHE(_reader, width, fromLittleEndian, _err);
uint32_t height;
- bx::readHE(_reader, height, fromLittleEndian);
+ bx::readHE(_reader, height, fromLittleEndian, _err);
uint32_t depth;
- bx::readHE(_reader, depth, fromLittleEndian);
+ bx::readHE(_reader, depth, fromLittleEndian, _err);
uint32_t numberOfArrayElements;
- bx::readHE(_reader, numberOfArrayElements, fromLittleEndian);
+ bx::readHE(_reader, numberOfArrayElements, fromLittleEndian, _err);
uint32_t numFaces;
- bx::readHE(_reader, numFaces, fromLittleEndian);
+ bx::readHE(_reader, numFaces, fromLittleEndian, _err);
uint32_t numMips;
- bx::readHE(_reader, numMips, fromLittleEndian);
+ bx::readHE(_reader, numMips, fromLittleEndian, _err);
uint32_t metaDataSize;
- bx::readHE(_reader, metaDataSize, fromLittleEndian);
+ bx::readHE(_reader, metaDataSize, fromLittleEndian, _err);
+
+ if (!_err->isOk() )
+ {
+ return false;
+ }
// skip meta garbage...
int64_t offset = bx::skip(_reader, metaDataSize);
@@ -4141,8 +4233,11 @@ namespace bimg
#define PVR3_BGRA8 PVR3_MAKE8CC('b', 'g', 'r', 'a', 8, 8, 8, 8)
#define PVR3_RGBA16 PVR3_MAKE8CC('r', 'g', 'b', 'a', 16, 16, 16, 16)
#define PVR3_RGBA32 PVR3_MAKE8CC('r', 'g', 'b', 'a', 32, 32, 32, 32)
+#define PVR3_BGR565 PVR3_MAKE8CC('b', 'g', 'r', 0, 5, 6, 5, 0)
#define PVR3_RGB565 PVR3_MAKE8CC('r', 'g', 'b', 0, 5, 6, 5, 0)
+#define PVR3_BGRA4 PVR3_MAKE8CC('b', 'g', 'r', 'a', 4, 4, 4, 4)
#define PVR3_RGBA4 PVR3_MAKE8CC('r', 'g', 'b', 'a', 4, 4, 4, 4)
+#define PVR3_BGRA51 PVR3_MAKE8CC('b', 'g', 'r', 'a', 5, 5, 5, 1)
#define PVR3_RGBA51 PVR3_MAKE8CC('r', 'g', 'b', 'a', 5, 5, 5, 1)
#define PVR3_RGB10A2 PVR3_MAKE8CC('r', 'g', 'b', 'a', 10, 10, 10, 2)
@@ -4187,8 +4282,11 @@ namespace bimg
{ PVR3_RGBA16, PVR3_CHANNEL_TYPE_FLOAT, TextureFormat::RGBA16F },
{ PVR3_RGBA32, PVR3_CHANNEL_TYPE_ANY, TextureFormat::RGBA32U },
{ PVR3_RGBA32, PVR3_CHANNEL_TYPE_FLOAT, TextureFormat::RGBA32F },
+ { PVR3_RGB565, PVR3_CHANNEL_TYPE_ANY, TextureFormat::B5G6R5 },
{ PVR3_RGB565, PVR3_CHANNEL_TYPE_ANY, TextureFormat::R5G6B5 },
+ { PVR3_BGRA4, PVR3_CHANNEL_TYPE_ANY, TextureFormat::BGRA4 },
{ PVR3_RGBA4, PVR3_CHANNEL_TYPE_ANY, TextureFormat::RGBA4 },
+ { PVR3_BGRA51, PVR3_CHANNEL_TYPE_ANY, TextureFormat::BGR5A1 },
{ PVR3_RGBA51, PVR3_CHANNEL_TYPE_ANY, TextureFormat::RGB5A1 },
{ PVR3_RGB10A2, PVR3_CHANNEL_TYPE_ANY, TextureFormat::RGB10A2 },
};
@@ -4198,37 +4296,42 @@ namespace bimg
BX_ERROR_SCOPE(_err);
uint32_t flags;
- bx::read(_reader, flags);
+ bx::read(_reader, flags, _err);
uint64_t pixelFormat;
- bx::read(_reader, pixelFormat);
+ bx::read(_reader, pixelFormat, _err);
uint32_t colorSpace;
- bx::read(_reader, colorSpace); // 0 - linearRGB, 1 - sRGB
+ bx::read(_reader, colorSpace, _err); // 0 - linearRGB, 1 - sRGB
uint32_t channelType;
- bx::read(_reader, channelType);
+ bx::read(_reader, channelType, _err);
uint32_t height;
- bx::read(_reader, height);
+ bx::read(_reader, height, _err);
uint32_t width;
- bx::read(_reader, width);
+ bx::read(_reader, width, _err);
uint32_t depth;
- bx::read(_reader, depth);
+ bx::read(_reader, depth, _err);
uint32_t numSurfaces;
- bx::read(_reader, numSurfaces);
+ bx::read(_reader, numSurfaces, _err);
uint32_t numFaces;
- bx::read(_reader, numFaces);
+ bx::read(_reader, numFaces, _err);
uint32_t numMips;
- bx::read(_reader, numMips);
+ bx::read(_reader, numMips, _err);
uint32_t metaDataSize;
- bx::read(_reader, metaDataSize);
+ bx::read(_reader, metaDataSize, _err);
+
+ if (!_err->isOk() )
+ {
+ return false;
+ }
// skip meta garbage...
int64_t offset = bx::skip(_reader, metaDataSize);
@@ -4298,7 +4401,7 @@ namespace bimg
else if (BIMG_CHUNK_MAGIC_TEX == magic)
{
TextureCreate tc;
- bx::read(_reader, tc);
+ bx::read(_reader, tc, _err);
_imageContainer.m_format = tc.m_format;
_imageContainer.m_orientation = Orientation::R0;
@@ -4734,11 +4837,19 @@ namespace bimg
break;
case TextureFormat::ASTC4x4:
+ case TextureFormat::ASTC5x4:
case TextureFormat::ASTC5x5:
+ case TextureFormat::ASTC6x5:
case TextureFormat::ASTC6x6:
case TextureFormat::ASTC8x5:
case TextureFormat::ASTC8x6:
+ case TextureFormat::ASTC8x8:
case TextureFormat::ASTC10x5:
+ case TextureFormat::ASTC10x6:
+ case TextureFormat::ASTC10x8:
+ case TextureFormat::ASTC10x10:
+ case TextureFormat::ASTC12x10:
+ case TextureFormat::ASTC12x12:
imageDecodeToRgba8(_allocator, _dst, _src, _width, _height, _dstPitch, _srcFormat);
imageSwizzleBgra8(_dst, _dstPitch, _width, _height, _dst, _dstPitch);
break;
@@ -4792,31 +4903,89 @@ namespace bimg
break;
case TextureFormat::ASTC4x4:
+ case TextureFormat::ASTC5x4:
case TextureFormat::ASTC5x5:
+ case TextureFormat::ASTC6x5:
case TextureFormat::ASTC6x6:
case TextureFormat::ASTC8x5:
case TextureFormat::ASTC8x6:
+ case TextureFormat::ASTC8x8:
case TextureFormat::ASTC10x5:
+ case TextureFormat::ASTC10x6:
+ case TextureFormat::ASTC10x8:
+ case TextureFormat::ASTC10x10:
+ case TextureFormat::ASTC12x10:
+ case TextureFormat::ASTC12x12:
if (BX_ENABLED(BIMG_DECODE_ASTC) )
{
- if (!astc_codec::ASTCDecompressToRGBA(
- (const uint8_t*)_src
- , imageGetSize(NULL, uint16_t(_width), uint16_t(_height), 0, false, false, 1, _srcFormat)
- , _width
- , _height
- , TextureFormat::ASTC4x4 == _srcFormat ? astc_codec::FootprintType::k4x4
- : TextureFormat::ASTC5x5 == _srcFormat ? astc_codec::FootprintType::k5x5
- : TextureFormat::ASTC6x6 == _srcFormat ? astc_codec::FootprintType::k6x6
- : TextureFormat::ASTC8x5 == _srcFormat ? astc_codec::FootprintType::k8x5
- : TextureFormat::ASTC8x6 == _srcFormat ? astc_codec::FootprintType::k8x6
- : astc_codec::FootprintType::k10x5
- , (uint8_t*)_dst
- , _width*_height*4
- , _dstPitch
- ) )
- {
- imageCheckerboard(_dst, _width, _height, 16, UINT32_C(0xff000000), UINT32_C(0xffffff00) );
- }
+ const bimg::ImageBlockInfo& astcBlockInfo = bimg::getBlockInfo(_srcFormat);
+
+ astcenc_config config{};
+
+ astcenc_error status = astcenc_config_init(
+ ASTCENC_PRF_LDR
+ , astcBlockInfo.blockWidth
+ , astcBlockInfo.blockHeight
+ , 1
+ , ASTCENC_PRE_MEDIUM
+ , ASTCENC_FLG_DECOMPRESS_ONLY
+ , &config
+ );
+
+ if (status != ASTCENC_SUCCESS)
+ {
+ BX_TRACE("astc error in config init %s", astcenc_get_error_string(status));
+ imageCheckerboard(_dst, _width, _height, 16, UINT32_C(0xff000000), UINT32_C(0xffffff00) );
+ break;
+ }
+
+ astcenc_context* context;
+ status = astcenc_context_alloc(&config, 1, &context);
+
+ if (status != ASTCENC_SUCCESS)
+ {
+ BX_TRACE("astc error in context alloc %s", astcenc_get_error_string(status));
+ imageCheckerboard(_dst, _width, _height, 16, UINT32_C(0xff000000), UINT32_C(0xffffff00) );
+ break;
+ }
+
+ //Put image data into an astcenc_image
+ astcenc_image image{};
+ image.dim_x = _width;
+ image.dim_y = _height;
+ image.dim_z = 1;
+ image.data_type = ASTCENC_TYPE_U8;
+ image.data = &_dst;
+
+ const uint32_t size = imageGetSize(NULL, uint16_t(_width), uint16_t(_height), 0, false, false, 1, _srcFormat);
+
+ static const astcenc_swizzle swizzle
+ { //0123/rgba swizzle corresponds to ASTC_RGBA
+ ASTCENC_SWZ_R,
+ ASTCENC_SWZ_G,
+ ASTCENC_SWZ_B,
+ ASTCENC_SWZ_A,
+ };
+
+ status = astcenc_decompress_image(
+ context
+ , (const uint8_t*)_src
+ , size
+ , &image
+ , &swizzle
+ , 0
+ );
+
+ if (status != ASTCENC_SUCCESS)
+ {
+ BX_TRACE("astc error in compress image %s", astcenc_get_error_string(status));
+ imageCheckerboard(_dst, _width, _height, 16, UINT32_C(0xff000000), UINT32_C(0xffffff00) );
+
+ astcenc_context_free(context);
+ break;
+ }
+
+ astcenc_context_free(context);
}
else
{
@@ -5039,7 +5208,7 @@ namespace bimg
if (_imageContainer.m_ktx)
{
- const uint32_t size = mipSize * ((_imageContainer.m_numLayers<=1 && _imageContainer.m_cubeMap) ? 1 : numSides);
+ const uint32_t size = mipSize * numSides;
uint32_t imageSize = bx::toHostEndian(*(const uint32_t*)&data[offset], _imageContainer.m_ktxLE);
BX_ASSERT(size == imageSize, "KTX: Image size mismatch %d (expected %d).", size, imageSize);
BX_UNUSED(size, imageSize);
@@ -5471,7 +5640,7 @@ namespace bimg
return total;
}
- static int32_t imageWriteDdsHeader(bx::WriterI* _writer, TextureFormat::Enum _format, bool _cubeMap, uint32_t _width, uint32_t _height, uint32_t _depth, uint8_t _numMips, bx::Error* _err)
+ static int32_t imageWriteDdsHeader(bx::WriterI* _writer, TextureFormat::Enum _format, bool _cubeMap, uint32_t _width, uint32_t _height, uint32_t _depth, uint8_t _numMips, uint32_t _numLayers, bx::Error* _err)
{
BX_ERROR_SCOPE(_err);
@@ -5548,7 +5717,6 @@ namespace bimg
total += bx::write(_writer, pitchOrLinearSize, _err);
total += bx::write(_writer, _depth, _err);
total += bx::write(_writer, uint32_t(_numMips), _err);
-
total += bx::writeRep(_writer, 0, 44, _err); // reserved1
if (UINT32_MAX != ddspf)
@@ -5586,7 +5754,8 @@ namespace bimg
0,
0,
};
- total += bx::write(_writer, caps, sizeof(caps) );
+
+ total += bx::write(_writer, caps, sizeof(caps), _err);
total += bx::writeRep(_writer, 0, 4, _err); // reserved2
@@ -5598,10 +5767,10 @@ namespace bimg
if (UINT32_MAX != dxgiFormat)
{
- total += bx::write(_writer, dxgiFormat);
+ total += bx::write(_writer, dxgiFormat, _err);
total += bx::write(_writer, uint32_t(1 < _depth ? DDS_DX10_DIMENSION_TEXTURE3D : DDS_DX10_DIMENSION_TEXTURE2D), _err); // dims
total += bx::write(_writer, uint32_t(_cubeMap ? DDS_DX10_MISC_TEXTURECUBE : 0), _err); // miscFlags
- total += bx::write(_writer, uint32_t(1), _err); // arraySize
+ total += bx::write(_writer, uint32_t(_numLayers), _err); // arraySize
total += bx::write(_writer, uint32_t(0), _err); // miscFlags2
BX_WARN(total-headerStart == DDS_HEADER_SIZE+20
@@ -5627,6 +5796,7 @@ namespace bimg
, _imageContainer.m_height
, _imageContainer.m_depth
, _imageContainer.m_numMips
+ , _imageContainer.m_numLayers
, _err
);
@@ -5635,7 +5805,7 @@ namespace bimg
return total;
}
- for (uint8_t side = 0, numSides = _imageContainer.m_cubeMap ? 6 : 1; side < numSides && _err->isOk(); ++side)
+ for (uint8_t side = 0, numSides = _imageContainer.m_numLayers * (_imageContainer.m_cubeMap ? 6 : 1); side < numSides && _err->isOk(); ++side)
{
for (uint8_t lod = 0, num = _imageContainer.m_numMips; lod < num && _err->isOk(); ++lod)
{
diff --git a/3rdparty/bimg/src/image_cubemap_filter.cpp b/3rdparty/bimg/src/image_cubemap_filter.cpp
index fcc36fc8f6e..99338998238 100644
--- a/3rdparty/bimg/src/image_cubemap_filter.cpp
+++ b/3rdparty/bimg/src/image_cubemap_filter.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
*/
#include "bimg_p.h"
@@ -430,10 +430,10 @@ namespace bimg
{
Aabb()
{
- m_min[0] = bx::kFloatMax;
- m_min[1] = bx::kFloatMax;
- m_max[0] = -bx::kFloatMax;
- m_max[1] = -bx::kFloatMax;
+ m_min[0] = bx::max<float>();
+ m_min[1] = bx::max<float>();
+ m_max[0] = bx::min<float>();
+ m_max[1] = bx::min<float>();
}
void add(float _x, float _y)
@@ -455,10 +455,10 @@ namespace bimg
bool isEmpty() const
{
// Has to have at least two points added so that no value is equal to initial state.
- return ( (m_min[0] == bx::kFloatMax)
- || (m_min[1] == bx::kFloatMax)
- || (m_max[0] == -bx::kFloatMax)
- || (m_max[1] == -bx::kFloatMax)
+ return ( (m_min[0] == bx::max<float>() )
+ || (m_min[1] == bx::max<float>() )
+ || (m_max[0] == bx::min<float>() )
+ || (m_max[1] == bx::min<float>() )
);
}
@@ -896,7 +896,7 @@ namespace bimg
if (0.0f < totalWeight)
{
- // Optimized Reversible Tonemapper for Resovle
+ // Optimized Reversible Tonemapper for Resolve
// https://web.archive.org/web/20180717182019/https://gpuopen.com/optimized-reversible-tonemapper-for-resolve/
// Average, then reverse the tonemapper
//
diff --git a/3rdparty/bimg/src/image_decode.cpp b/3rdparty/bimg/src/image_decode.cpp
index d7213aef6fd..dd391e5f8d1 100644
--- a/3rdparty/bimg/src/image_decode.cpp
+++ b/3rdparty/bimg/src/image_decode.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
*/
#include "bimg_p.h"
@@ -491,7 +491,6 @@ namespace bimg
if (UINT8_MAX != idxR)
{
const bool asFloat = exrHeader.pixel_types[idxR] == TINYEXR_PIXELTYPE_FLOAT;
- uint32_t srcBpp = 32;
uint32_t dstBpp = asFloat ? 32 : 16;
format = asFloat ? TextureFormat::R32F : TextureFormat::R16F;
uint32_t stepR = 1;
@@ -501,7 +500,6 @@ namespace bimg
if (UINT8_MAX != idxG)
{
- srcBpp += 32;
dstBpp = asFloat ? 64 : 32;
format = asFloat ? TextureFormat::RG32F : TextureFormat::RG16F;
stepG = 1;
@@ -509,7 +507,6 @@ namespace bimg
if (UINT8_MAX != idxB)
{
- srcBpp += 32;
dstBpp = asFloat ? 128 : 64;
format = asFloat ? TextureFormat::RGBA32F : TextureFormat::RGBA16F;
stepB = 1;
@@ -517,7 +514,6 @@ namespace bimg
if (UINT8_MAX != idxA)
{
- srcBpp += 32;
dstBpp = asFloat ? 128 : 64;
format = asFloat ? TextureFormat::RGBA32F : TextureFormat::RGBA16F;
stepA = 1;
diff --git a/3rdparty/bimg/src/image_encode.cpp b/3rdparty/bimg/src/image_encode.cpp
index 47f5f68e016..e006940a3a8 100644
--- a/3rdparty/bimg/src/image_encode.cpp
+++ b/3rdparty/bimg/src/image_encode.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
*/
#include <bimg/encode.h>
@@ -12,7 +12,7 @@
#include <nvtt/nvtt.h>
#include <pvrtc/PvrTcEncoder.h>
#include <edtaa3/edtaa3func.h>
-#include <astc/astc_lib.h>
+#include <astcenc.h>
BX_PRAGMA_DIAGNOSTIC_PUSH();
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4100) // warning C4100: 'alloc_context': unreferenced formal parameter
@@ -41,18 +41,18 @@ namespace bimg
};
BX_STATIC_ASSERT(Quality::Count == BX_COUNTOF(s_squishQuality) );
- static const ASTC_COMPRESS_MODE s_astcQuality[] =
+ static const float s_astcQuality[] =
{
// Standard
- ASTC_COMPRESS_MEDIUM, // Default
- ASTC_COMPRESS_THOROUGH, // Highest
- ASTC_COMPRESS_FAST, // Fastest
+ ASTCENC_PRE_MEDIUM, // Default
+ ASTCENC_PRE_THOROUGH, // Highest
+ ASTCENC_PRE_FAST, // Fastest
// Normal map
- ASTC_COMPRESS_MEDIUM, // Default
- ASTC_COMPRESS_THOROUGH, // Highest
- ASTC_COMPRESS_FAST, // Fastest
+ ASTCENC_PRE_MEDIUM, // Default
+ ASTCENC_PRE_THOROUGH, // Highest
+ ASTCENC_PRE_FAST, // Fastest
};
- BX_STATIC_ASSERT(Quality::Count == BX_COUNTOF(s_astcQuality));
+ BX_STATIC_ASSERT(Quality::Count == BX_COUNTOF(s_astcQuality) );
void imageEncodeFromRgba8(bx::AllocatorI* _allocator, void* _dst, const void* _src, uint32_t _width, uint32_t _height, uint32_t _depth, TextureFormat::Enum _format, Quality::Enum _quality, bx::Error* _err)
{
@@ -142,25 +142,103 @@ namespace bimg
break;
case TextureFormat::ASTC4x4:
+ case TextureFormat::ASTC5x4:
case TextureFormat::ASTC5x5:
+ case TextureFormat::ASTC6x5:
case TextureFormat::ASTC6x6:
case TextureFormat::ASTC8x5:
case TextureFormat::ASTC8x6:
+ case TextureFormat::ASTC8x8:
case TextureFormat::ASTC10x5:
+ case TextureFormat::ASTC10x6:
+ case TextureFormat::ASTC10x8:
+ case TextureFormat::ASTC10x10:
+ case TextureFormat::ASTC12x10:
+ case TextureFormat::ASTC12x12:
{
const bimg::ImageBlockInfo& astcBlockInfo = bimg::getBlockInfo(_format);
- ASTC_COMPRESS_MODE compress_mode = s_astcQuality[_quality];
- ASTC_DECODE_MODE decode_mode = ASTC_DECODE_LDR_LINEAR;
+ astcenc_config config{};
+
+ uint32_t astcFlags = ASTCENC_FLG_SELF_DECOMPRESS_ONLY;
+
+ if (Quality::NormalMapDefault <= _quality)
+ {
+ astcFlags |= ASTCENC_FLG_MAP_NORMAL;
+ }
+
+ astcenc_error status = astcenc_config_init(
+ ASTCENC_PRF_LDR
+ , astcBlockInfo.blockWidth
+ , astcBlockInfo.blockHeight
+ , 1
+ , s_astcQuality[_quality]
+ , astcFlags
+ , &config
+ );
+
+ if (status != ASTCENC_SUCCESS)
+ {
+ BX_TRACE("astc error in config init %s", astcenc_get_error_string(status) );
+ BX_ERROR_SET(_err, BIMG_ERROR, "Unable to initialize astc config!");
+ break;
+ }
+
+ astcenc_context* context;
+ status = astcenc_context_alloc(&config, 1, &context);
+
+ if (status != ASTCENC_SUCCESS)
+ {
+ BX_TRACE("astc error in context alloc %s", astcenc_get_error_string(status) );
+ BX_ERROR_SET(_err, BIMG_ERROR, "Unable to alloc astc context!");
+ break;
+ }
+
+ astcenc_image image{};
+ image.dim_x = _width;
+ image.dim_y = _height;
+ image.dim_z = 1;
+ image.data_type = ASTCENC_TYPE_U8;
+ image.data = (void**)&src;
+
+ const size_t blockCountX = (_width + astcBlockInfo.blockWidth - 1) / astcBlockInfo.blockWidth;
+ const size_t blockCountY = (_height + astcBlockInfo.blockHeight - 1) / astcBlockInfo.blockHeight;
+ const size_t compLen = blockCountX * blockCountY * 16;
if (Quality::NormalMapDefault <= _quality)
{
- astc_compress(_width, _height, src, ASTC_ENC_NORMAL_RA, srcPitch, astcBlockInfo.blockWidth, astcBlockInfo.blockHeight, compress_mode, decode_mode, dst);
+ static const astcenc_swizzle swizzle
+ { //0001/rrrg swizzle corresponds to ASTC_ENC_NORMAL_RA
+ ASTCENC_SWZ_R,
+ ASTCENC_SWZ_R,
+ ASTCENC_SWZ_R,
+ ASTCENC_SWZ_G,
+ };
+
+ status = astcenc_compress_image(context, &image, &swizzle, dst, compLen, 0);
}
else
{
- astc_compress(_width, _height, src, ASTC_RGBA, srcPitch, astcBlockInfo.blockWidth, astcBlockInfo.blockHeight, compress_mode, decode_mode, dst);
+ static const astcenc_swizzle swizzle
+ { //0123/rgba swizzle corresponds to ASTC_RGBA
+ ASTCENC_SWZ_R,
+ ASTCENC_SWZ_G,
+ ASTCENC_SWZ_B,
+ ASTCENC_SWZ_A,
+ };
+
+ status = astcenc_compress_image(context, &image, &swizzle, dst, compLen, 0);
}
+
+ if (status != ASTCENC_SUCCESS)
+ {
+ BX_TRACE("astc error in compress image %s", astcenc_get_error_string(status) );
+ BX_ERROR_SET(_err, BIMG_ERROR, "Unable to compress astc image!");
+ astcenc_context_free(context);
+ break;
+ }
+
+ astcenc_context_free(context);
}
break;
@@ -252,11 +330,19 @@ namespace bimg
case TextureFormat::PTC14:
case TextureFormat::PTC14A:
case TextureFormat::ASTC4x4:
+ case TextureFormat::ASTC5x4:
case TextureFormat::ASTC5x5:
+ case TextureFormat::ASTC6x5:
case TextureFormat::ASTC6x6:
case TextureFormat::ASTC8x5:
case TextureFormat::ASTC8x6:
+ case TextureFormat::ASTC8x8:
case TextureFormat::ASTC10x5:
+ case TextureFormat::ASTC10x6:
+ case TextureFormat::ASTC10x8:
+ case TextureFormat::ASTC10x10:
+ case TextureFormat::ASTC12x10:
+ case TextureFormat::ASTC12x12:
{
uint8_t* temp = (uint8_t*)BX_ALLOC(_allocator, _width*_height*_depth*4);
imageDecodeToRgba8(_allocator, temp, _src, _width, _height, _width*4, _srcFormat);
diff --git a/3rdparty/bimg/src/image_gnf.cpp b/3rdparty/bimg/src/image_gnf.cpp
index 6d346192f59..7d7f0aa190e 100644
--- a/3rdparty/bimg/src/image_gnf.cpp
+++ b/3rdparty/bimg/src/image_gnf.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
*/
#include "bimg_p.h"
@@ -21,7 +21,7 @@ namespace bimg
bx::MemoryReader reader(_src, _size);
uint32_t magic;
- bx::read(&reader, magic);
+ bx::read(&reader, magic, bx::ErrorIgnore{});
ImageContainer imageContainer;
if (BIMG_CHUNK_MAGIC_GNF != magic
diff --git a/3rdparty/bimg/tools/texturec/texturec.cpp b/3rdparty/bimg/tools/texturec/texturec.cpp
index 63a1b14c0b1..f53bbd50917 100644
--- a/3rdparty/bimg/tools/texturec/texturec.cpp
+++ b/3rdparty/bimg/tools/texturec/texturec.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bimg#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bimg/blob/master/LICENSE
*/
#include <bx/allocator.h>
@@ -896,8 +896,8 @@ void help(const char* _error = NULL, bool _showHelp = true)
bx::printf(
"texturec, bgfx texture compiler tool, version %d.%d.%d.\n"
- "Copyright 2011-2021 Branimir Karadzic. All rights reserved.\n"
- "License: https://github.com/bkaradzic/bimg#license-bsd-2-clause\n\n"
+ "Copyright 2011-2022 Branimir Karadzic. All rights reserved.\n"
+ "License: https://github.com/bkaradzic/bimg/blob/master/LICENSE\n\n"
, BIMG_TEXTUREC_VERSION_MAJOR
, BIMG_TEXTUREC_VERSION_MINOR
, BIMG_API_VERSION
diff --git a/3rdparty/bx/3rdparty/catch/catch.hpp b/3rdparty/bx/3rdparty/catch/catch.hpp
deleted file mode 100644
index 0384171ae4a..00000000000
--- a/3rdparty/bx/3rdparty/catch/catch.hpp
+++ /dev/null
@@ -1,17881 +0,0 @@
-/*
- * Catch v2.13.4
- * Generated: 2020-12-29 14:48:00.116107
- * ----------------------------------------------------------
- * This file has been merged from multiple headers. Please don't edit it directly
- * Copyright (c) 2020 Two Blue Cubes Ltd. All rights reserved.
- *
- * Distributed under the Boost Software License, Version 1.0. (See accompanying
- * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
- */
-#ifndef TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
-#define TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
-// start catch.hpp
-
-
-#define CATCH_VERSION_MAJOR 2
-#define CATCH_VERSION_MINOR 13
-#define CATCH_VERSION_PATCH 4
-
-#ifdef __clang__
-# pragma clang system_header
-#elif defined __GNUC__
-# pragma GCC system_header
-#endif
-
-// start catch_suppress_warnings.h
-
-#ifdef __clang__
-# ifdef __ICC // icpc defines the __clang__ macro
-# pragma warning(push)
-# pragma warning(disable: 161 1682)
-# else // __ICC
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wpadded"
-# pragma clang diagnostic ignored "-Wswitch-enum"
-# pragma clang diagnostic ignored "-Wcovered-switch-default"
-# endif
-#elif defined __GNUC__
- // Because REQUIREs trigger GCC's -Wparentheses, and because still
- // supported version of g++ have only buggy support for _Pragmas,
- // Wparentheses have to be suppressed globally.
-# pragma GCC diagnostic ignored "-Wparentheses" // See #674 for details
-
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wunused-variable"
-# pragma GCC diagnostic ignored "-Wpadded"
-#endif
-// end catch_suppress_warnings.h
-#if defined(CATCH_CONFIG_MAIN) || defined(CATCH_CONFIG_RUNNER)
-# define CATCH_IMPL
-# define CATCH_CONFIG_ALL_PARTS
-#endif
-
-// In the impl file, we want to have access to all parts of the headers
-// Can also be used to sanely support PCHs
-#if defined(CATCH_CONFIG_ALL_PARTS)
-# define CATCH_CONFIG_EXTERNAL_INTERFACES
-# if defined(CATCH_CONFIG_DISABLE_MATCHERS)
-# undef CATCH_CONFIG_DISABLE_MATCHERS
-# endif
-# if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
-# define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-# endif
-#endif
-
-#if !defined(CATCH_CONFIG_IMPL_ONLY)
-// start catch_platform.h
-
-#ifdef __APPLE__
-# include <TargetConditionals.h>
-# if TARGET_OS_OSX == 1
-# define CATCH_PLATFORM_MAC
-# elif TARGET_OS_IPHONE == 1
-# define CATCH_PLATFORM_IPHONE
-# endif
-
-#elif defined(linux) || defined(__linux) || defined(__linux__)
-# define CATCH_PLATFORM_LINUX
-
-#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__)
-# define CATCH_PLATFORM_WINDOWS
-#endif
-
-// end catch_platform.h
-
-#ifdef CATCH_IMPL
-# ifndef CLARA_CONFIG_MAIN
-# define CLARA_CONFIG_MAIN_NOT_DEFINED
-# define CLARA_CONFIG_MAIN
-# endif
-#endif
-
-// start catch_user_interfaces.h
-
-namespace Catch {
- unsigned int rngSeed();
-}
-
-// end catch_user_interfaces.h
-// start catch_tag_alias_autoregistrar.h
-
-// start catch_common.h
-
-// start catch_compiler_capabilities.h
-
-// Detect a number of compiler features - by compiler
-// The following features are defined:
-//
-// CATCH_CONFIG_COUNTER : is the __COUNTER__ macro supported?
-// CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported?
-// CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported?
-// CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled?
-// ****************
-// Note to maintainers: if new toggles are added please document them
-// in configuration.md, too
-// ****************
-
-// In general each macro has a _NO_<feature name> form
-// (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature.
-// Many features, at point of detection, define an _INTERNAL_ macro, so they
-// can be combined, en-mass, with the _NO_ forms later.
-
-#ifdef __cplusplus
-
-# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
-# define CATCH_CPP14_OR_GREATER
-# endif
-
-# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
-# define CATCH_CPP17_OR_GREATER
-# endif
-
-#endif
-
-// We have to avoid both ICC and Clang, because they try to mask themselves
-// as gcc, and we want only GCC in this block
-#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__)
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" )
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" )
-
-# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__)
-
-#endif
-
-#if defined(__clang__)
-
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" )
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" )
-
-// As of this writing, IBM XL's implementation of __builtin_constant_p has a bug
-// which results in calls to destructors being emitted for each temporary,
-// without a matching initialization. In practice, this can result in something
-// like `std::string::~string` being called on an uninitialized value.
-//
-// For example, this code will likely segfault under IBM XL:
-// ```
-// REQUIRE(std::string("12") + "34" == "1234")
-// ```
-//
-// Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented.
-# if !defined(__ibmxl__) && !defined(__CUDACC__)
-# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */
-# endif
-
-# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \
- _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"")
-
-# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wparentheses\"" )
-
-# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" )
-
-# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" )
-
-# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- _Pragma( "clang diagnostic ignored \"-Wunused-template\"" )
-
-#endif // __clang__
-
-////////////////////////////////////////////////////////////////////////////////
-// Assume that non-Windows platforms support posix signals by default
-#if !defined(CATCH_PLATFORM_WINDOWS)
- #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// We know some environments not to support full POSIX signals
-#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__)
- #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
-#endif
-
-#ifdef __OS400__
-# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
-# define CATCH_CONFIG_COLOUR_NONE
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// Android somehow still does not support std::to_string
-#if defined(__ANDROID__)
-# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
-# define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// Not all Windows environments support SEH properly
-#if defined(__MINGW32__)
-# define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// PS4
-#if defined(__ORBIS__)
-# define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// Cygwin
-#ifdef __CYGWIN__
-
-// Required for some versions of Cygwin to declare gettimeofday
-// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin
-# define _BSD_SOURCE
-// some versions of cygwin (most) do not support std::to_string. Use the libstd check.
-// https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813
-# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
- && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
-
-# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
-
-# endif
-#endif // __CYGWIN__
-
-////////////////////////////////////////////////////////////////////////////////
-// Visual C++
-#if defined(_MSC_VER)
-
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) )
-
-// Universal Windows platform does not support SEH
-// Or console colours (or console at all...)
-# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
-# define CATCH_CONFIG_COLOUR_NONE
-# else
-# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
-# endif
-
-// MSVC traditional preprocessor needs some workaround for __VA_ARGS__
-// _MSVC_TRADITIONAL == 0 means new conformant preprocessor
-// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor
-# if !defined(__clang__) // Handle Clang masquerading for msvc
-# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL)
-# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-# endif // MSVC_TRADITIONAL
-# endif // __clang__
-
-#endif // _MSC_VER
-
-#if defined(_REENTRANT) || defined(_MSC_VER)
-// Enable async processing, as -pthread is specified or no additional linking is required
-# define CATCH_INTERNAL_CONFIG_USE_ASYNC
-#endif // _MSC_VER
-
-////////////////////////////////////////////////////////////////////////////////
-// Check if we are compiled with -fno-exceptions or equivalent
-#if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND)
-# define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-// DJGPP
-#ifdef __DJGPP__
-# define CATCH_INTERNAL_CONFIG_NO_WCHAR
-#endif // __DJGPP__
-
-////////////////////////////////////////////////////////////////////////////////
-// Embarcadero C++Build
-#if defined(__BORLANDC__)
- #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-
-// Use of __COUNTER__ is suppressed during code analysis in
-// CLion/AppCode 2017.2.x and former, because __COUNTER__ is not properly
-// handled by it.
-// Otherwise all supported compilers support COUNTER macro,
-// but user still might want to turn it off
-#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L )
- #define CATCH_INTERNAL_CONFIG_COUNTER
-#endif
-
-////////////////////////////////////////////////////////////////////////////////
-
-// RTX is a special version of Windows that is real time.
-// This means that it is detected as Windows, but does not provide
-// the same set of capabilities as real Windows does.
-#if defined(UNDER_RTSS) || defined(RTX64_BUILD)
- #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
- #define CATCH_INTERNAL_CONFIG_NO_ASYNC
- #define CATCH_CONFIG_COLOUR_NONE
-#endif
-
-#if !defined(_GLIBCXX_USE_C99_MATH_TR1)
-#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER
-#endif
-
-// Various stdlib support checks that require __has_include
-#if defined(__has_include)
- // Check if string_view is available and usable
- #if __has_include(<string_view>) && defined(CATCH_CPP17_OR_GREATER)
- # define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW
- #endif
-
- // Check if optional is available and usable
- # if __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
- # define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL
- # endif // __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
-
- // Check if byte is available and usable
- # if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
- # include <cstddef>
- # if __cpp_lib_byte > 0
- # define CATCH_INTERNAL_CONFIG_CPP17_BYTE
- # endif
- # endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
-
- // Check if variant is available and usable
- # if __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
- # if defined(__clang__) && (__clang_major__ < 8)
- // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852
- // fix should be in clang 8, workaround in libstdc++ 8.2
- # include <ciso646>
- # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
- # define CATCH_CONFIG_NO_CPP17_VARIANT
- # else
- # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
- # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
- # else
- # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
- # endif // defined(__clang__) && (__clang_major__ < 8)
- # endif // __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
-#endif // defined(__has_include)
-
-#if defined(CATCH_INTERNAL_CONFIG_COUNTER) && !defined(CATCH_CONFIG_NO_COUNTER) && !defined(CATCH_CONFIG_COUNTER)
-# define CATCH_CONFIG_COUNTER
-#endif
-#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH)
-# define CATCH_CONFIG_WINDOWS_SEH
-#endif
-// This is set by default, because we assume that unix compilers are posix-signal-compatible by default.
-#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS)
-# define CATCH_CONFIG_POSIX_SIGNALS
-#endif
-// This is set by default, because we assume that compilers with no wchar_t support are just rare exceptions.
-#if !defined(CATCH_INTERNAL_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_NO_WCHAR) && !defined(CATCH_CONFIG_WCHAR)
-# define CATCH_CONFIG_WCHAR
-#endif
-
-#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING)
-# define CATCH_CONFIG_CPP11_TO_STRING
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL)
-# define CATCH_CONFIG_CPP17_OPTIONAL
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
-# define CATCH_CONFIG_CPP17_STRING_VIEW
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT)
-# define CATCH_CONFIG_CPP17_VARIANT
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE)
-# define CATCH_CONFIG_CPP17_BYTE
-#endif
-
-#if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
-# define CATCH_INTERNAL_CONFIG_NEW_CAPTURE
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE)
-# define CATCH_CONFIG_NEW_CAPTURE
-#endif
-
-#if !defined(CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-# define CATCH_CONFIG_DISABLE_EXCEPTIONS
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN)
-# define CATCH_CONFIG_POLYFILL_ISNAN
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC)
-# define CATCH_CONFIG_USE_ASYNC
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_NO_ANDROID_LOGWRITE) && !defined(CATCH_CONFIG_ANDROID_LOGWRITE)
-# define CATCH_CONFIG_ANDROID_LOGWRITE
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
-# define CATCH_CONFIG_GLOBAL_NEXTAFTER
-#endif
-
-// Even if we do not think the compiler has that warning, we still have
-// to provide a macro that can be used by the code.
-#if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION)
-# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
-#endif
-#if !defined(CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION)
-# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-#endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
-#endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
-#endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS
-#endif
-#if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS
-#endif
-
-// The goal of this macro is to avoid evaluation of the arguments, but
-// still have the compiler warn on problems inside...
-#if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN)
-# define CATCH_INTERNAL_IGNORE_BUT_WARN(...)
-#endif
-
-#if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10)
-# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
-#elif defined(__clang__) && (__clang_major__ < 5)
-# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
-#endif
-
-#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS)
-# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
-#endif
-
-#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-#define CATCH_TRY if ((true))
-#define CATCH_CATCH_ALL if ((false))
-#define CATCH_CATCH_ANON(type) if ((false))
-#else
-#define CATCH_TRY try
-#define CATCH_CATCH_ALL catch (...)
-#define CATCH_CATCH_ANON(type) catch (type)
-#endif
-
-#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR)
-#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#endif
-
-// end catch_compiler_capabilities.h
-#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line
-#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
-#ifdef CATCH_CONFIG_COUNTER
-# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ )
-#else
-# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
-#endif
-
-#include <iosfwd>
-#include <string>
-#include <cstdint>
-
-// We need a dummy global operator<< so we can bring it into Catch namespace later
-struct Catch_global_namespace_dummy {};
-std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy);
-
-namespace Catch {
-
- struct CaseSensitive { enum Choice {
- Yes,
- No
- }; };
-
- class NonCopyable {
- NonCopyable( NonCopyable const& ) = delete;
- NonCopyable( NonCopyable && ) = delete;
- NonCopyable& operator = ( NonCopyable const& ) = delete;
- NonCopyable& operator = ( NonCopyable && ) = delete;
-
- protected:
- NonCopyable();
- virtual ~NonCopyable();
- };
-
- struct SourceLineInfo {
-
- SourceLineInfo() = delete;
- SourceLineInfo( char const* _file, std::size_t _line ) noexcept
- : file( _file ),
- line( _line )
- {}
-
- SourceLineInfo( SourceLineInfo const& other ) = default;
- SourceLineInfo& operator = ( SourceLineInfo const& ) = default;
- SourceLineInfo( SourceLineInfo&& ) noexcept = default;
- SourceLineInfo& operator = ( SourceLineInfo&& ) noexcept = default;
-
- bool empty() const noexcept { return file[0] == '\0'; }
- bool operator == ( SourceLineInfo const& other ) const noexcept;
- bool operator < ( SourceLineInfo const& other ) const noexcept;
-
- char const* file;
- std::size_t line;
- };
-
- std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info );
-
- // Bring in operator<< from global namespace into Catch namespace
- // This is necessary because the overload of operator<< above makes
- // lookup stop at namespace Catch
- using ::operator<<;
-
- // Use this in variadic streaming macros to allow
- // >> +StreamEndStop
- // as well as
- // >> stuff +StreamEndStop
- struct StreamEndStop {
- std::string operator+() const;
- };
- template<typename T>
- T const& operator + ( T const& value, StreamEndStop ) {
- return value;
- }
-}
-
-#define CATCH_INTERNAL_LINEINFO \
- ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
-
-// end catch_common.h
-namespace Catch {
-
- struct RegistrarForTagAliases {
- RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo );
- };
-
-} // end namespace Catch
-
-#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
-// end catch_tag_alias_autoregistrar.h
-// start catch_test_registry.h
-
-// start catch_interfaces_testcase.h
-
-#include <vector>
-
-namespace Catch {
-
- class TestSpec;
-
- struct ITestInvoker {
- virtual void invoke () const = 0;
- virtual ~ITestInvoker();
- };
-
- class TestCase;
- struct IConfig;
-
- struct ITestCaseRegistry {
- virtual ~ITestCaseRegistry();
- virtual std::vector<TestCase> const& getAllTests() const = 0;
- virtual std::vector<TestCase> const& getAllTestsSorted( IConfig const& config ) const = 0;
- };
-
- bool isThrowSafe( TestCase const& testCase, IConfig const& config );
- bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config );
- std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config );
- std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config );
-
-}
-
-// end catch_interfaces_testcase.h
-// start catch_stringref.h
-
-#include <cstddef>
-#include <string>
-#include <iosfwd>
-#include <cassert>
-
-namespace Catch {
-
- /// A non-owning string class (similar to the forthcoming std::string_view)
- /// Note that, because a StringRef may be a substring of another string,
- /// it may not be null terminated.
- class StringRef {
- public:
- using size_type = std::size_t;
- using const_iterator = const char*;
-
- private:
- static constexpr char const* const s_empty = "";
-
- char const* m_start = s_empty;
- size_type m_size = 0;
-
- public: // construction
- constexpr StringRef() noexcept = default;
-
- StringRef( char const* rawChars ) noexcept;
-
- constexpr StringRef( char const* rawChars, size_type size ) noexcept
- : m_start( rawChars ),
- m_size( size )
- {}
-
- StringRef( std::string const& stdString ) noexcept
- : m_start( stdString.c_str() ),
- m_size( stdString.size() )
- {}
-
- explicit operator std::string() const {
- return std::string(m_start, m_size);
- }
-
- public: // operators
- auto operator == ( StringRef const& other ) const noexcept -> bool;
- auto operator != (StringRef const& other) const noexcept -> bool {
- return !(*this == other);
- }
-
- auto operator[] ( size_type index ) const noexcept -> char {
- assert(index < m_size);
- return m_start[index];
- }
-
- public: // named queries
- constexpr auto empty() const noexcept -> bool {
- return m_size == 0;
- }
- constexpr auto size() const noexcept -> size_type {
- return m_size;
- }
-
- // Returns the current start pointer. If the StringRef is not
- // null-terminated, throws std::domain_exception
- auto c_str() const -> char const*;
-
- public: // substrings and searches
- // Returns a substring of [start, start + length).
- // If start + length > size(), then the substring is [start, size()).
- // If start > size(), then the substring is empty.
- auto substr( size_type start, size_type length ) const noexcept -> StringRef;
-
- // Returns the current start pointer. May not be null-terminated.
- auto data() const noexcept -> char const*;
-
- constexpr auto isNullTerminated() const noexcept -> bool {
- return m_start[m_size] == '\0';
- }
-
- public: // iterators
- constexpr const_iterator begin() const { return m_start; }
- constexpr const_iterator end() const { return m_start + m_size; }
- };
-
- auto operator += ( std::string& lhs, StringRef const& sr ) -> std::string&;
- auto operator << ( std::ostream& os, StringRef const& sr ) -> std::ostream&;
-
- constexpr auto operator "" _sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
- return StringRef( rawChars, size );
- }
-} // namespace Catch
-
-constexpr auto operator "" _catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef {
- return Catch::StringRef( rawChars, size );
-}
-
-// end catch_stringref.h
-// start catch_preprocessor.hpp
-
-
-#define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__
-#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__)))
-#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__)))
-#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__)))
-#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__)))
-#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__)))
-
-#ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__
-// MSVC needs more evaluations
-#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__)))
-#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__))
-#else
-#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__)
-#endif
-
-#define CATCH_REC_END(...)
-#define CATCH_REC_OUT
-
-#define CATCH_EMPTY()
-#define CATCH_DEFER(id) id CATCH_EMPTY()
-
-#define CATCH_REC_GET_END2() 0, CATCH_REC_END
-#define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2
-#define CATCH_REC_GET_END(...) CATCH_REC_GET_END1
-#define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT
-#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0)
-#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next)
-
-#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ )
-#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ )
-#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ )
-
-#define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ )
-#define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ )
-#define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ )
-
-// Applies the function macro `f` to each of the remaining parameters, inserts commas between the results,
-// and passes userdata as the first parameter to each invocation,
-// e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c)
-#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0))
-
-#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0))
-
-#define INTERNAL_CATCH_EXPAND1(param) INTERNAL_CATCH_EXPAND2(param)
-#define INTERNAL_CATCH_EXPAND2(...) INTERNAL_CATCH_NO## __VA_ARGS__
-#define INTERNAL_CATCH_DEF(...) INTERNAL_CATCH_DEF __VA_ARGS__
-#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF
-#define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__)
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__
-#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param))
-#else
-// MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF
-#define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__)
-#define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__
-#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1)
-#endif
-
-#define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__
-#define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name)
-
-#define INTERNAL_CATCH_REMOVE_PARENS(...) INTERNAL_CATCH_EXPAND1(INTERNAL_CATCH_DEF __VA_ARGS__)
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS_GEN(__VA_ARGS__)>())
-#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))
-#else
-#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS_GEN(__VA_ARGS__)>()))
-#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)))
-#endif
-
-#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\
- CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__)
-
-#define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0)
-#define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1)
-#define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2)
-#define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3)
-#define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4)
-#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5)
-#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _3, _4, _5, _6)
-#define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7)
-#define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8)
-#define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9)
-#define INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10)
-
-#define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N
-
-#define INTERNAL_CATCH_TYPE_GEN\
- template<typename...> struct TypeList {};\
- template<typename...Ts>\
- constexpr auto get_wrapper() noexcept -> TypeList<Ts...> { return {}; }\
- template<template<typename...> class...> struct TemplateTypeList{};\
- template<template<typename...> class...Cs>\
- constexpr auto get_wrapper() noexcept -> TemplateTypeList<Cs...> { return {}; }\
- template<typename...>\
- struct append;\
- template<typename...>\
- struct rewrap;\
- template<template<typename...> class, typename...>\
- struct create;\
- template<template<typename...> class, typename>\
- struct convert;\
- \
- template<typename T> \
- struct append<T> { using type = T; };\
- template< template<typename...> class L1, typename...E1, template<typename...> class L2, typename...E2, typename...Rest>\
- struct append<L1<E1...>, L2<E2...>, Rest...> { using type = typename append<L1<E1...,E2...>, Rest...>::type; };\
- template< template<typename...> class L1, typename...E1, typename...Rest>\
- struct append<L1<E1...>, TypeList<mpl_::na>, Rest...> { using type = L1<E1...>; };\
- \
- template< template<typename...> class Container, template<typename...> class List, typename...elems>\
- struct rewrap<TemplateTypeList<Container>, List<elems...>> { using type = TypeList<Container<elems...>>; };\
- template< template<typename...> class Container, template<typename...> class List, class...Elems, typename...Elements>\
- struct rewrap<TemplateTypeList<Container>, List<Elems...>, Elements...> { using type = typename append<TypeList<Container<Elems...>>, typename rewrap<TemplateTypeList<Container>, Elements...>::type>::type; };\
- \
- template<template <typename...> class Final, template< typename...> class...Containers, typename...Types>\
- struct create<Final, TemplateTypeList<Containers...>, TypeList<Types...>> { using type = typename append<Final<>, typename rewrap<TemplateTypeList<Containers>, Types...>::type...>::type; };\
- template<template <typename...> class Final, template <typename...> class List, typename...Ts>\
- struct convert<Final, List<Ts...>> { using type = typename append<Final<>,TypeList<Ts>...>::type; };
-
-#define INTERNAL_CATCH_NTTP_1(signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)> struct Nttp{};\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- constexpr auto get_wrapper() noexcept -> Nttp<__VA_ARGS__> { return {}; } \
- template<template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...> struct NttpTemplateTypeList{};\
- template<template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...Cs>\
- constexpr auto get_wrapper() noexcept -> NttpTemplateTypeList<Cs...> { return {}; } \
- \
- template< template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class Container, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class List, INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- struct rewrap<NttpTemplateTypeList<Container>, List<__VA_ARGS__>> { using type = TypeList<Container<__VA_ARGS__>>; };\
- template< template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class Container, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class List, INTERNAL_CATCH_REMOVE_PARENS(signature), typename...Elements>\
- struct rewrap<NttpTemplateTypeList<Container>, List<__VA_ARGS__>, Elements...> { using type = typename append<TypeList<Container<__VA_ARGS__>>, typename rewrap<NttpTemplateTypeList<Container>, Elements...>::type>::type; };\
- template<template <typename...> class Final, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...Containers, typename...Types>\
- struct create<Final, NttpTemplateTypeList<Containers...>, TypeList<Types...>> { using type = typename append<Final<>, typename rewrap<NttpTemplateTypeList<Containers>, Types...>::type...>::type; };
-
-#define INTERNAL_CATCH_DECLARE_SIG_TEST0(TestName)
-#define INTERNAL_CATCH_DECLARE_SIG_TEST1(TestName, signature)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- static void TestName()
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_X(TestName, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- static void TestName()
-
-#define INTERNAL_CATCH_DEFINE_SIG_TEST0(TestName)
-#define INTERNAL_CATCH_DEFINE_SIG_TEST1(TestName, signature)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- static void TestName()
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_X(TestName, signature,...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- static void TestName()
-
-#define INTERNAL_CATCH_NTTP_REGISTER0(TestFunc, signature)\
- template<typename Type>\
- void reg_test(TypeList<Type>, Catch::NameAndTags nameAndTags)\
- {\
- Catch::AutoReg( Catch::makeTestInvoker(&TestFunc<Type>), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), nameAndTags);\
- }
-
-#define INTERNAL_CATCH_NTTP_REGISTER(TestFunc, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- void reg_test(Nttp<__VA_ARGS__>, Catch::NameAndTags nameAndTags)\
- {\
- Catch::AutoReg( Catch::makeTestInvoker(&TestFunc<__VA_ARGS__>), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), nameAndTags);\
- }
-
-#define INTERNAL_CATCH_NTTP_REGISTER_METHOD0(TestName, signature, ...)\
- template<typename Type>\
- void reg_test(TypeList<Type>, Catch::StringRef className, Catch::NameAndTags nameAndTags)\
- {\
- Catch::AutoReg( Catch::makeTestInvoker(&TestName<Type>::test), CATCH_INTERNAL_LINEINFO, className, nameAndTags);\
- }
-
-#define INTERNAL_CATCH_NTTP_REGISTER_METHOD(TestName, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
- void reg_test(Nttp<__VA_ARGS__>, Catch::StringRef className, Catch::NameAndTags nameAndTags)\
- {\
- Catch::AutoReg( Catch::makeTestInvoker(&TestName<__VA_ARGS__>::test), CATCH_INTERNAL_LINEINFO, className, nameAndTags);\
- }
-
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD0(TestName, ClassName)
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD1(TestName, ClassName, signature)\
- template<typename TestType> \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName)<TestType> { \
- void test();\
- }
-
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X(TestName, ClassName, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)> \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName)<__VA_ARGS__> { \
- void test();\
- }
-
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD0(TestName)
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD1(TestName, signature)\
- template<typename TestType> \
- void INTERNAL_CATCH_MAKE_NAMESPACE(TestName)::TestName<TestType>::test()
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X(TestName, signature, ...)\
- template<INTERNAL_CATCH_REMOVE_PARENS(signature)> \
- void INTERNAL_CATCH_MAKE_NAMESPACE(TestName)::TestName<__VA_ARGS__>::test()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define INTERNAL_CATCH_NTTP_0
-#define INTERNAL_CATCH_NTTP_GEN(...) INTERNAL_CATCH_VA_NARGS_IMPL(__VA_ARGS__, INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__),INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_0)
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD1, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD0)(TestName, __VA_ARGS__)
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD1, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD0)(TestName, ClassName, __VA_ARGS__)
-#define INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD0, INTERNAL_CATCH_NTTP_REGISTER_METHOD0)(TestName, __VA_ARGS__)
-#define INTERNAL_CATCH_NTTP_REG_GEN(TestFunc, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER0, INTERNAL_CATCH_NTTP_REGISTER0)(TestFunc, __VA_ARGS__)
-#define INTERNAL_CATCH_DEFINE_SIG_TEST(TestName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DEFINE_SIG_TEST1, INTERNAL_CATCH_DEFINE_SIG_TEST0)(TestName, __VA_ARGS__)
-#define INTERNAL_CATCH_DECLARE_SIG_TEST(TestName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DECLARE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST1, INTERNAL_CATCH_DECLARE_SIG_TEST0)(TestName, __VA_ARGS__)
-#define INTERNAL_CATCH_REMOVE_PARENS_GEN(...) INTERNAL_CATCH_VA_NARGS_IMPL(__VA_ARGS__, INTERNAL_CATCH_REMOVE_PARENS_11_ARG,INTERNAL_CATCH_REMOVE_PARENS_10_ARG,INTERNAL_CATCH_REMOVE_PARENS_9_ARG,INTERNAL_CATCH_REMOVE_PARENS_8_ARG,INTERNAL_CATCH_REMOVE_PARENS_7_ARG,INTERNAL_CATCH_REMOVE_PARENS_6_ARG,INTERNAL_CATCH_REMOVE_PARENS_5_ARG,INTERNAL_CATCH_REMOVE_PARENS_4_ARG,INTERNAL_CATCH_REMOVE_PARENS_3_ARG,INTERNAL_CATCH_REMOVE_PARENS_2_ARG,INTERNAL_CATCH_REMOVE_PARENS_1_ARG)(__VA_ARGS__)
-#else
-#define INTERNAL_CATCH_NTTP_0(signature)
-#define INTERNAL_CATCH_NTTP_GEN(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL(__VA_ARGS__, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1,INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_0)( __VA_ARGS__))
-#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD1, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD0)(TestName, __VA_ARGS__))
-#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD1, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD0)(TestName, ClassName, __VA_ARGS__))
-#define INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD0, INTERNAL_CATCH_NTTP_REGISTER_METHOD0)(TestName, __VA_ARGS__))
-#define INTERNAL_CATCH_NTTP_REG_GEN(TestFunc, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER0, INTERNAL_CATCH_NTTP_REGISTER0)(TestFunc, __VA_ARGS__))
-#define INTERNAL_CATCH_DEFINE_SIG_TEST(TestName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DEFINE_SIG_TEST1, INTERNAL_CATCH_DEFINE_SIG_TEST0)(TestName, __VA_ARGS__))
-#define INTERNAL_CATCH_DECLARE_SIG_TEST(TestName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DECLARE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST1, INTERNAL_CATCH_DECLARE_SIG_TEST0)(TestName, __VA_ARGS__))
-#define INTERNAL_CATCH_REMOVE_PARENS_GEN(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL(__VA_ARGS__, INTERNAL_CATCH_REMOVE_PARENS_11_ARG,INTERNAL_CATCH_REMOVE_PARENS_10_ARG,INTERNAL_CATCH_REMOVE_PARENS_9_ARG,INTERNAL_CATCH_REMOVE_PARENS_8_ARG,INTERNAL_CATCH_REMOVE_PARENS_7_ARG,INTERNAL_CATCH_REMOVE_PARENS_6_ARG,INTERNAL_CATCH_REMOVE_PARENS_5_ARG,INTERNAL_CATCH_REMOVE_PARENS_4_ARG,INTERNAL_CATCH_REMOVE_PARENS_3_ARG,INTERNAL_CATCH_REMOVE_PARENS_2_ARG,INTERNAL_CATCH_REMOVE_PARENS_1_ARG)(__VA_ARGS__))
-#endif
-
-// end catch_preprocessor.hpp
-// start catch_meta.hpp
-
-
-#include <type_traits>
-
-namespace Catch {
- template<typename T>
- struct always_false : std::false_type {};
-
- template <typename> struct true_given : std::true_type {};
- struct is_callable_tester {
- template <typename Fun, typename... Args>
- true_given<decltype(std::declval<Fun>()(std::declval<Args>()...))> static test(int);
- template <typename...>
- std::false_type static test(...);
- };
-
- template <typename T>
- struct is_callable;
-
- template <typename Fun, typename... Args>
- struct is_callable<Fun(Args...)> : decltype(is_callable_tester::test<Fun, Args...>(0)) {};
-
-#if defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703
- // std::result_of is deprecated in C++17 and removed in C++20. Hence, it is
- // replaced with std::invoke_result here.
- template <typename Func, typename... U>
- using FunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::invoke_result_t<Func, U...>>>;
-#else
- // Keep ::type here because we still support C++11
- template <typename Func, typename... U>
- using FunctionReturnType = typename std::remove_reference<typename std::remove_cv<typename std::result_of<Func(U...)>::type>::type>::type;
-#endif
-
-} // namespace Catch
-
-namespace mpl_{
- struct na;
-}
-
-// end catch_meta.hpp
-namespace Catch {
-
-template<typename C>
-class TestInvokerAsMethod : public ITestInvoker {
- void (C::*m_testAsMethod)();
-public:
- TestInvokerAsMethod( void (C::*testAsMethod)() ) noexcept : m_testAsMethod( testAsMethod ) {}
-
- void invoke() const override {
- C obj;
- (obj.*m_testAsMethod)();
- }
-};
-
-auto makeTestInvoker( void(*testAsFunction)() ) noexcept -> ITestInvoker*;
-
-template<typename C>
-auto makeTestInvoker( void (C::*testAsMethod)() ) noexcept -> ITestInvoker* {
- return new(std::nothrow) TestInvokerAsMethod<C>( testAsMethod );
-}
-
-struct NameAndTags {
- NameAndTags( StringRef const& name_ = StringRef(), StringRef const& tags_ = StringRef() ) noexcept;
- StringRef name;
- StringRef tags;
-};
-
-struct AutoReg : NonCopyable {
- AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept;
- ~AutoReg();
-};
-
-} // end namespace Catch
-
-#if defined(CATCH_CONFIG_DISABLE)
- #define INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( TestName, ... ) \
- static void TestName()
- #define INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION( TestName, ClassName, ... ) \
- namespace{ \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \
- void test(); \
- }; \
- } \
- void TestName::test()
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( TestName, TestFunc, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_DEFINE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature))
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( TestNameClass, TestName, ClassName, Name, Tags, Signature, ... ) \
- namespace{ \
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
- INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
- } \
- } \
- INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))
-
- #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ )
- #else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
- #endif
-
- #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ )
- #else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) )
- #endif
-
- #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
- #else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
- #endif
-
- #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
- #else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
- #endif
-#endif
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \
- static void TestName(); \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &TestName ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- static void TestName()
- #define INTERNAL_CATCH_TESTCASE( ... ) \
- INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), __VA_ARGS__ )
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &QualifiedMethod ), CATCH_INTERNAL_LINEINFO, "&" #QualifiedMethod, Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \
- void test(); \
- }; \
- Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( Catch::makeTestInvoker( &TestName::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \
- } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- void TestName::test()
- #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \
- INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), ClassName, __VA_ARGS__ )
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( Function ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
- ///////////////////////////////////////////////////////////////////////////////
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_2(TestName, TestFunc, Name, Tags, Signature, ... )\
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- INTERNAL_CATCH_DECLARE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){\
- INTERNAL_CATCH_TYPE_GEN\
- INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- INTERNAL_CATCH_NTTP_REG_GEN(TestFunc,INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- template<typename...Types> \
- struct TestName{\
- TestName(){\
- int index = 0; \
- constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
- using expander = int[];\
- (void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \
- }\
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
- TestName<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>();\
- return 0;\
- }();\
- }\
- }\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- INTERNAL_CATCH_DEFINE_SIG_TEST(TestFunc,INTERNAL_CATCH_REMOVE_PARENS(Signature))
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
-#endif
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) )
-#endif
-
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(TestName, TestFuncName, Name, Tags, Signature, TmplTypes, TypesList) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- template<typename TestType> static void TestFuncName(); \
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
- INTERNAL_CATCH_TYPE_GEN \
- INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
- template<typename... Types> \
- struct TestName { \
- void reg_tests() { \
- int index = 0; \
- using expander = int[]; \
- constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
- constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
- constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
- (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++)... };/* NOLINT */\
- } \
- }; \
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
- using TestInit = typename create<TestName, decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>()), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
- TestInit t; \
- t.reg_tests(); \
- return 0; \
- }(); \
- } \
- } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- template<typename TestType> \
- static void TestFuncName()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename T,__VA_ARGS__)
-#else
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, typename T, __VA_ARGS__ ) )
-#endif
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__)
-#else
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, Signature, __VA_ARGS__ ) )
-#endif
-
- #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2(TestName, TestFunc, Name, Tags, TmplList)\
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- template<typename TestType> static void TestFunc(); \
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){\
- INTERNAL_CATCH_TYPE_GEN\
- template<typename... Types> \
- struct TestName { \
- void reg_tests() { \
- int index = 0; \
- using expander = int[]; \
- (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */\
- } \
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
- using TestInit = typename convert<TestName, TmplList>::type; \
- TestInit t; \
- t.reg_tests(); \
- return 0; \
- }(); \
- }}\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- template<typename TestType> \
- static void TestFunc()
-
- #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(Name, Tags, TmplList) \
- INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), Name, Tags, TmplList )
-
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, Signature, ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){ \
- INTERNAL_CATCH_TYPE_GEN\
- INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
- INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- template<typename...Types> \
- struct TestNameClass{\
- TestNameClass(){\
- int index = 0; \
- constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
- using expander = int[];\
- (void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \
- }\
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
- TestNameClass<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>();\
- return 0;\
- }();\
- }\
- }\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
-#endif
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____C_L_A_S_S____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
-#endif
-
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2(TestNameClass, TestName, ClassName, Name, Tags, Signature, TmplTypes, TypesList)\
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- template<typename TestType> \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \
- void test();\
- };\
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestNameClass) {\
- INTERNAL_CATCH_TYPE_GEN \
- INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
- template<typename...Types>\
- struct TestNameClass{\
- void reg_tests(){\
- int index = 0;\
- using expander = int[];\
- constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
- constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
- constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
- (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + "<" + std::string(types_list[index % num_types]) + ">", Tags } ), index++)... };/* NOLINT */ \
- }\
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
- using TestInit = typename create<TestNameClass, decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>()), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type;\
- TestInit t;\
- t.reg_tests();\
- return 0;\
- }(); \
- }\
- }\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- template<typename TestType> \
- void TestName<TestType>::test()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, typename T, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, typename T,__VA_ARGS__ ) )
-#endif
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... )\
- INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, Signature, __VA_ARGS__ )
-#else
- #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... )\
- INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, Signature,__VA_ARGS__ ) )
-#endif
-
- #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, TmplList) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
- template<typename TestType> \
- struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \
- void test();\
- };\
- namespace {\
- namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){ \
- INTERNAL_CATCH_TYPE_GEN\
- template<typename...Types>\
- struct TestNameClass{\
- void reg_tests(){\
- int index = 0;\
- using expander = int[];\
- (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */ \
- }\
- };\
- static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
- using TestInit = typename convert<TestNameClass, TmplList>::type;\
- TestInit t;\
- t.reg_tests();\
- return 0;\
- }(); \
- }}\
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- template<typename TestType> \
- void TestName<TestType>::test()
-
-#define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD(ClassName, Name, Tags, TmplList) \
- INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____ ), INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_M_P_L_A_T_E____T_E_S_T____F_U_N_C____ ), ClassName, Name, Tags, TmplList )
-
-// end catch_test_registry.h
-// start catch_capture.hpp
-
-// start catch_assertionhandler.h
-
-// start catch_assertioninfo.h
-
-// start catch_result_type.h
-
-namespace Catch {
-
- // ResultWas::OfType enum
- struct ResultWas { enum OfType {
- Unknown = -1,
- Ok = 0,
- Info = 1,
- Warning = 2,
-
- FailureBit = 0x10,
-
- ExpressionFailed = FailureBit | 1,
- ExplicitFailure = FailureBit | 2,
-
- Exception = 0x100 | FailureBit,
-
- ThrewException = Exception | 1,
- DidntThrowException = Exception | 2,
-
- FatalErrorCondition = 0x200 | FailureBit
-
- }; };
-
- bool isOk( ResultWas::OfType resultType );
- bool isJustInfo( int flags );
-
- // ResultDisposition::Flags enum
- struct ResultDisposition { enum Flags {
- Normal = 0x01,
-
- ContinueOnFailure = 0x02, // Failures fail test, but execution continues
- FalseTest = 0x04, // Prefix expression with !
- SuppressFail = 0x08 // Failures are reported but do not fail the test
- }; };
-
- ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs );
-
- bool shouldContinueOnFailure( int flags );
- inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; }
- bool shouldSuppressFailure( int flags );
-
-} // end namespace Catch
-
-// end catch_result_type.h
-namespace Catch {
-
- struct AssertionInfo
- {
- StringRef macroName;
- SourceLineInfo lineInfo;
- StringRef capturedExpression;
- ResultDisposition::Flags resultDisposition;
-
- // We want to delete this constructor but a compiler bug in 4.8 means
- // the struct is then treated as non-aggregate
- //AssertionInfo() = delete;
- };
-
-} // end namespace Catch
-
-// end catch_assertioninfo.h
-// start catch_decomposer.h
-
-// start catch_tostring.h
-
-#include <vector>
-#include <cstddef>
-#include <type_traits>
-#include <string>
-// start catch_stream.h
-
-#include <iosfwd>
-#include <cstddef>
-#include <ostream>
-
-namespace Catch {
-
- std::ostream& cout();
- std::ostream& cerr();
- std::ostream& clog();
-
- class StringRef;
-
- struct IStream {
- virtual ~IStream();
- virtual std::ostream& stream() const = 0;
- };
-
- auto makeStream( StringRef const &filename ) -> IStream const*;
-
- class ReusableStringStream : NonCopyable {
- std::size_t m_index;
- std::ostream* m_oss;
- public:
- ReusableStringStream();
- ~ReusableStringStream();
-
- auto str() const -> std::string;
-
- template<typename T>
- auto operator << ( T const& value ) -> ReusableStringStream& {
- *m_oss << value;
- return *this;
- }
- auto get() -> std::ostream& { return *m_oss; }
- };
-}
-
-// end catch_stream.h
-// start catch_interfaces_enum_values_registry.h
-
-#include <vector>
-
-namespace Catch {
-
- namespace Detail {
- struct EnumInfo {
- StringRef m_name;
- std::vector<std::pair<int, StringRef>> m_values;
-
- ~EnumInfo();
-
- StringRef lookup( int value ) const;
- };
- } // namespace Detail
-
- struct IMutableEnumValuesRegistry {
- virtual ~IMutableEnumValuesRegistry();
-
- virtual Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values ) = 0;
-
- template<typename E>
- Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::initializer_list<E> values ) {
- static_assert(sizeof(int) >= sizeof(E), "Cannot serialize enum to int");
- std::vector<int> intValues;
- intValues.reserve( values.size() );
- for( auto enumValue : values )
- intValues.push_back( static_cast<int>( enumValue ) );
- return registerEnum( enumName, allEnums, intValues );
- }
- };
-
-} // Catch
-
-// end catch_interfaces_enum_values_registry.h
-
-#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
-#include <string_view>
-#endif
-
-#ifdef __OBJC__
-// start catch_objc_arc.hpp
-
-#import <Foundation/Foundation.h>
-
-#ifdef __has_feature
-#define CATCH_ARC_ENABLED __has_feature(objc_arc)
-#else
-#define CATCH_ARC_ENABLED 0
-#endif
-
-void arcSafeRelease( NSObject* obj );
-id performOptionalSelector( id obj, SEL sel );
-
-#if !CATCH_ARC_ENABLED
-inline void arcSafeRelease( NSObject* obj ) {
- [obj release];
-}
-inline id performOptionalSelector( id obj, SEL sel ) {
- if( [obj respondsToSelector: sel] )
- return [obj performSelector: sel];
- return nil;
-}
-#define CATCH_UNSAFE_UNRETAINED
-#define CATCH_ARC_STRONG
-#else
-inline void arcSafeRelease( NSObject* ){}
-inline id performOptionalSelector( id obj, SEL sel ) {
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Warc-performSelector-leaks"
-#endif
- if( [obj respondsToSelector: sel] )
- return [obj performSelector: sel];
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
- return nil;
-}
-#define CATCH_UNSAFE_UNRETAINED __unsafe_unretained
-#define CATCH_ARC_STRONG __strong
-#endif
-
-// end catch_objc_arc.hpp
-#endif
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4180) // We attempt to stream a function (address) by const&, which MSVC complains about but is harmless
-#endif
-
-namespace Catch {
- namespace Detail {
-
- extern const std::string unprintableString;
-
- std::string rawMemoryToString( const void *object, std::size_t size );
-
- template<typename T>
- std::string rawMemoryToString( const T& object ) {
- return rawMemoryToString( &object, sizeof(object) );
- }
-
- template<typename T>
- class IsStreamInsertable {
- template<typename Stream, typename U>
- static auto test(int)
- -> decltype(std::declval<Stream&>() << std::declval<U>(), std::true_type());
-
- template<typename, typename>
- static auto test(...)->std::false_type;
-
- public:
- static const bool value = decltype(test<std::ostream, const T&>(0))::value;
- };
-
- template<typename E>
- std::string convertUnknownEnumToString( E e );
-
- template<typename T>
- typename std::enable_if<
- !std::is_enum<T>::value && !std::is_base_of<std::exception, T>::value,
- std::string>::type convertUnstreamable( T const& ) {
- return Detail::unprintableString;
- }
- template<typename T>
- typename std::enable_if<
- !std::is_enum<T>::value && std::is_base_of<std::exception, T>::value,
- std::string>::type convertUnstreamable(T const& ex) {
- return ex.what();
- }
-
- template<typename T>
- typename std::enable_if<
- std::is_enum<T>::value
- , std::string>::type convertUnstreamable( T const& value ) {
- return convertUnknownEnumToString( value );
- }
-
-#if defined(_MANAGED)
- //! Convert a CLR string to a utf8 std::string
- template<typename T>
- std::string clrReferenceToString( T^ ref ) {
- if (ref == nullptr)
- return std::string("null");
- auto bytes = System::Text::Encoding::UTF8->GetBytes(ref->ToString());
- cli::pin_ptr<System::Byte> p = &bytes[0];
- return std::string(reinterpret_cast<char const *>(p), bytes->Length);
- }
-#endif
-
- } // namespace Detail
-
- // If we decide for C++14, change these to enable_if_ts
- template <typename T, typename = void>
- struct StringMaker {
- template <typename Fake = T>
- static
- typename std::enable_if<::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>::type
- convert(const Fake& value) {
- ReusableStringStream rss;
- // NB: call using the function-like syntax to avoid ambiguity with
- // user-defined templated operator<< under clang.
- rss.operator<<(value);
- return rss.str();
- }
-
- template <typename Fake = T>
- static
- typename std::enable_if<!::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>::type
- convert( const Fake& value ) {
-#if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER)
- return Detail::convertUnstreamable(value);
-#else
- return CATCH_CONFIG_FALLBACK_STRINGIFIER(value);
-#endif
- }
- };
-
- namespace Detail {
-
- // This function dispatches all stringification requests inside of Catch.
- // Should be preferably called fully qualified, like ::Catch::Detail::stringify
- template <typename T>
- std::string stringify(const T& e) {
- return ::Catch::StringMaker<typename std::remove_cv<typename std::remove_reference<T>::type>::type>::convert(e);
- }
-
- template<typename E>
- std::string convertUnknownEnumToString( E e ) {
- return ::Catch::Detail::stringify(static_cast<typename std::underlying_type<E>::type>(e));
- }
-
-#if defined(_MANAGED)
- template <typename T>
- std::string stringify( T^ e ) {
- return ::Catch::StringMaker<T^>::convert(e);
- }
-#endif
-
- } // namespace Detail
-
- // Some predefined specializations
-
- template<>
- struct StringMaker<std::string> {
- static std::string convert(const std::string& str);
- };
-
-#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
- template<>
- struct StringMaker<std::string_view> {
- static std::string convert(std::string_view str);
- };
-#endif
-
- template<>
- struct StringMaker<char const *> {
- static std::string convert(char const * str);
- };
- template<>
- struct StringMaker<char *> {
- static std::string convert(char * str);
- };
-
-#ifdef CATCH_CONFIG_WCHAR
- template<>
- struct StringMaker<std::wstring> {
- static std::string convert(const std::wstring& wstr);
- };
-
-# ifdef CATCH_CONFIG_CPP17_STRING_VIEW
- template<>
- struct StringMaker<std::wstring_view> {
- static std::string convert(std::wstring_view str);
- };
-# endif
-
- template<>
- struct StringMaker<wchar_t const *> {
- static std::string convert(wchar_t const * str);
- };
- template<>
- struct StringMaker<wchar_t *> {
- static std::string convert(wchar_t * str);
- };
-#endif
-
- // TBD: Should we use `strnlen` to ensure that we don't go out of the buffer,
- // while keeping string semantics?
- template<int SZ>
- struct StringMaker<char[SZ]> {
- static std::string convert(char const* str) {
- return ::Catch::Detail::stringify(std::string{ str });
- }
- };
- template<int SZ>
- struct StringMaker<signed char[SZ]> {
- static std::string convert(signed char const* str) {
- return ::Catch::Detail::stringify(std::string{ reinterpret_cast<char const *>(str) });
- }
- };
- template<int SZ>
- struct StringMaker<unsigned char[SZ]> {
- static std::string convert(unsigned char const* str) {
- return ::Catch::Detail::stringify(std::string{ reinterpret_cast<char const *>(str) });
- }
- };
-
-#if defined(CATCH_CONFIG_CPP17_BYTE)
- template<>
- struct StringMaker<std::byte> {
- static std::string convert(std::byte value);
- };
-#endif // defined(CATCH_CONFIG_CPP17_BYTE)
- template<>
- struct StringMaker<int> {
- static std::string convert(int value);
- };
- template<>
- struct StringMaker<long> {
- static std::string convert(long value);
- };
- template<>
- struct StringMaker<long long> {
- static std::string convert(long long value);
- };
- template<>
- struct StringMaker<unsigned int> {
- static std::string convert(unsigned int value);
- };
- template<>
- struct StringMaker<unsigned long> {
- static std::string convert(unsigned long value);
- };
- template<>
- struct StringMaker<unsigned long long> {
- static std::string convert(unsigned long long value);
- };
-
- template<>
- struct StringMaker<bool> {
- static std::string convert(bool b);
- };
-
- template<>
- struct StringMaker<char> {
- static std::string convert(char c);
- };
- template<>
- struct StringMaker<signed char> {
- static std::string convert(signed char c);
- };
- template<>
- struct StringMaker<unsigned char> {
- static std::string convert(unsigned char c);
- };
-
- template<>
- struct StringMaker<std::nullptr_t> {
- static std::string convert(std::nullptr_t);
- };
-
- template<>
- struct StringMaker<float> {
- static std::string convert(float value);
- static int precision;
- };
-
- template<>
- struct StringMaker<double> {
- static std::string convert(double value);
- static int precision;
- };
-
- template <typename T>
- struct StringMaker<T*> {
- template <typename U>
- static std::string convert(U* p) {
- if (p) {
- return ::Catch::Detail::rawMemoryToString(p);
- } else {
- return "nullptr";
- }
- }
- };
-
- template <typename R, typename C>
- struct StringMaker<R C::*> {
- static std::string convert(R C::* p) {
- if (p) {
- return ::Catch::Detail::rawMemoryToString(p);
- } else {
- return "nullptr";
- }
- }
- };
-
-#if defined(_MANAGED)
- template <typename T>
- struct StringMaker<T^> {
- static std::string convert( T^ ref ) {
- return ::Catch::Detail::clrReferenceToString(ref);
- }
- };
-#endif
-
- namespace Detail {
- template<typename InputIterator, typename Sentinel = InputIterator>
- std::string rangeToString(InputIterator first, Sentinel last) {
- ReusableStringStream rss;
- rss << "{ ";
- if (first != last) {
- rss << ::Catch::Detail::stringify(*first);
- for (++first; first != last; ++first)
- rss << ", " << ::Catch::Detail::stringify(*first);
- }
- rss << " }";
- return rss.str();
- }
- }
-
-#ifdef __OBJC__
- template<>
- struct StringMaker<NSString*> {
- static std::string convert(NSString * nsstring) {
- if (!nsstring)
- return "nil";
- return std::string("@") + [nsstring UTF8String];
- }
- };
- template<>
- struct StringMaker<NSObject*> {
- static std::string convert(NSObject* nsObject) {
- return ::Catch::Detail::stringify([nsObject description]);
- }
-
- };
- namespace Detail {
- inline std::string stringify( NSString* nsstring ) {
- return StringMaker<NSString*>::convert( nsstring );
- }
-
- } // namespace Detail
-#endif // __OBJC__
-
-} // namespace Catch
-
-//////////////////////////////////////////////////////
-// Separate std-lib types stringification, so it can be selectively enabled
-// This means that we do not bring in
-
-#if defined(CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS)
-# define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
-# define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
-# define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
-# define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-# define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
-#endif
-
-// Separate std::pair specialization
-#if defined(CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER)
-#include <utility>
-namespace Catch {
- template<typename T1, typename T2>
- struct StringMaker<std::pair<T1, T2> > {
- static std::string convert(const std::pair<T1, T2>& pair) {
- ReusableStringStream rss;
- rss << "{ "
- << ::Catch::Detail::stringify(pair.first)
- << ", "
- << ::Catch::Detail::stringify(pair.second)
- << " }";
- return rss.str();
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
-
-#if defined(CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_OPTIONAL)
-#include <optional>
-namespace Catch {
- template<typename T>
- struct StringMaker<std::optional<T> > {
- static std::string convert(const std::optional<T>& optional) {
- ReusableStringStream rss;
- if (optional.has_value()) {
- rss << ::Catch::Detail::stringify(*optional);
- } else {
- rss << "{ }";
- }
- return rss.str();
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
-
-// Separate std::tuple specialization
-#if defined(CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER)
-#include <tuple>
-namespace Catch {
- namespace Detail {
- template<
- typename Tuple,
- std::size_t N = 0,
- bool = (N < std::tuple_size<Tuple>::value)
- >
- struct TupleElementPrinter {
- static void print(const Tuple& tuple, std::ostream& os) {
- os << (N ? ", " : " ")
- << ::Catch::Detail::stringify(std::get<N>(tuple));
- TupleElementPrinter<Tuple, N + 1>::print(tuple, os);
- }
- };
-
- template<
- typename Tuple,
- std::size_t N
- >
- struct TupleElementPrinter<Tuple, N, false> {
- static void print(const Tuple&, std::ostream&) {}
- };
-
- }
-
- template<typename ...Types>
- struct StringMaker<std::tuple<Types...>> {
- static std::string convert(const std::tuple<Types...>& tuple) {
- ReusableStringStream rss;
- rss << '{';
- Detail::TupleElementPrinter<std::tuple<Types...>>::print(tuple, rss.get());
- rss << " }";
- return rss.str();
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
-
-#if defined(CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_VARIANT)
-#include <variant>
-namespace Catch {
- template<>
- struct StringMaker<std::monostate> {
- static std::string convert(const std::monostate&) {
- return "{ }";
- }
- };
-
- template<typename... Elements>
- struct StringMaker<std::variant<Elements...>> {
- static std::string convert(const std::variant<Elements...>& variant) {
- if (variant.valueless_by_exception()) {
- return "{valueless variant}";
- } else {
- return std::visit(
- [](const auto& value) {
- return ::Catch::Detail::stringify(value);
- },
- variant
- );
- }
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
-
-namespace Catch {
- // Import begin/ end from std here
- using std::begin;
- using std::end;
-
- namespace detail {
- template <typename...>
- struct void_type {
- using type = void;
- };
-
- template <typename T, typename = void>
- struct is_range_impl : std::false_type {
- };
-
- template <typename T>
- struct is_range_impl<T, typename void_type<decltype(begin(std::declval<T>()))>::type> : std::true_type {
- };
- } // namespace detail
-
- template <typename T>
- struct is_range : detail::is_range_impl<T> {
- };
-
-#if defined(_MANAGED) // Managed types are never ranges
- template <typename T>
- struct is_range<T^> {
- static const bool value = false;
- };
-#endif
-
- template<typename Range>
- std::string rangeToString( Range const& range ) {
- return ::Catch::Detail::rangeToString( begin( range ), end( range ) );
- }
-
- // Handle vector<bool> specially
- template<typename Allocator>
- std::string rangeToString( std::vector<bool, Allocator> const& v ) {
- ReusableStringStream rss;
- rss << "{ ";
- bool first = true;
- for( bool b : v ) {
- if( first )
- first = false;
- else
- rss << ", ";
- rss << ::Catch::Detail::stringify( b );
- }
- rss << " }";
- return rss.str();
- }
-
- template<typename R>
- struct StringMaker<R, typename std::enable_if<is_range<R>::value && !::Catch::Detail::IsStreamInsertable<R>::value>::type> {
- static std::string convert( R const& range ) {
- return rangeToString( range );
- }
- };
-
- template <typename T, int SZ>
- struct StringMaker<T[SZ]> {
- static std::string convert(T const(&arr)[SZ]) {
- return rangeToString(arr);
- }
- };
-
-} // namespace Catch
-
-// Separate std::chrono::duration specialization
-#if defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
-#include <ctime>
-#include <ratio>
-#include <chrono>
-
-namespace Catch {
-
-template <class Ratio>
-struct ratio_string {
- static std::string symbol();
-};
-
-template <class Ratio>
-std::string ratio_string<Ratio>::symbol() {
- Catch::ReusableStringStream rss;
- rss << '[' << Ratio::num << '/'
- << Ratio::den << ']';
- return rss.str();
-}
-template <>
-struct ratio_string<std::atto> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::femto> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::pico> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::nano> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::micro> {
- static std::string symbol();
-};
-template <>
-struct ratio_string<std::milli> {
- static std::string symbol();
-};
-
- ////////////
- // std::chrono::duration specializations
- template<typename Value, typename Ratio>
- struct StringMaker<std::chrono::duration<Value, Ratio>> {
- static std::string convert(std::chrono::duration<Value, Ratio> const& duration) {
- ReusableStringStream rss;
- rss << duration.count() << ' ' << ratio_string<Ratio>::symbol() << 's';
- return rss.str();
- }
- };
- template<typename Value>
- struct StringMaker<std::chrono::duration<Value, std::ratio<1>>> {
- static std::string convert(std::chrono::duration<Value, std::ratio<1>> const& duration) {
- ReusableStringStream rss;
- rss << duration.count() << " s";
- return rss.str();
- }
- };
- template<typename Value>
- struct StringMaker<std::chrono::duration<Value, std::ratio<60>>> {
- static std::string convert(std::chrono::duration<Value, std::ratio<60>> const& duration) {
- ReusableStringStream rss;
- rss << duration.count() << " m";
- return rss.str();
- }
- };
- template<typename Value>
- struct StringMaker<std::chrono::duration<Value, std::ratio<3600>>> {
- static std::string convert(std::chrono::duration<Value, std::ratio<3600>> const& duration) {
- ReusableStringStream rss;
- rss << duration.count() << " h";
- return rss.str();
- }
- };
-
- ////////////
- // std::chrono::time_point specialization
- // Generic time_point cannot be specialized, only std::chrono::time_point<system_clock>
- template<typename Clock, typename Duration>
- struct StringMaker<std::chrono::time_point<Clock, Duration>> {
- static std::string convert(std::chrono::time_point<Clock, Duration> const& time_point) {
- return ::Catch::Detail::stringify(time_point.time_since_epoch()) + " since epoch";
- }
- };
- // std::chrono::time_point<system_clock> specialization
- template<typename Duration>
- struct StringMaker<std::chrono::time_point<std::chrono::system_clock, Duration>> {
- static std::string convert(std::chrono::time_point<std::chrono::system_clock, Duration> const& time_point) {
- auto converted = std::chrono::system_clock::to_time_t(time_point);
-
-#ifdef _MSC_VER
- std::tm timeInfo = {};
- gmtime_s(&timeInfo, &converted);
-#else
- std::tm* timeInfo = std::gmtime(&converted);
-#endif
-
- auto const timeStampSize = sizeof("2017-01-16T17:06:45Z");
- char timeStamp[timeStampSize];
- const char * const fmt = "%Y-%m-%dT%H:%M:%SZ";
-
-#ifdef _MSC_VER
- std::strftime(timeStamp, timeStampSize, fmt, &timeInfo);
-#else
- std::strftime(timeStamp, timeStampSize, fmt, timeInfo);
-#endif
- return std::string(timeStamp);
- }
- };
-}
-#endif // CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-
-#define INTERNAL_CATCH_REGISTER_ENUM( enumName, ... ) \
-namespace Catch { \
- template<> struct StringMaker<enumName> { \
- static std::string convert( enumName value ) { \
- static const auto& enumInfo = ::Catch::getMutableRegistryHub().getMutableEnumValuesRegistry().registerEnum( #enumName, #__VA_ARGS__, { __VA_ARGS__ } ); \
- return static_cast<std::string>(enumInfo.lookup( static_cast<int>( value ) )); \
- } \
- }; \
-}
-
-#define CATCH_REGISTER_ENUM( enumName, ... ) INTERNAL_CATCH_REGISTER_ENUM( enumName, __VA_ARGS__ )
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-// end catch_tostring.h
-#include <iosfwd>
-
-#ifdef _MSC_VER
-#pragma warning(push)
-#pragma warning(disable:4389) // '==' : signed/unsigned mismatch
-#pragma warning(disable:4018) // more "signed/unsigned mismatch"
-#pragma warning(disable:4312) // Converting int to T* using reinterpret_cast (issue on x64 platform)
-#pragma warning(disable:4180) // qualifier applied to function type has no meaning
-#pragma warning(disable:4800) // Forcing result to true or false
-#endif
-
-namespace Catch {
-
- struct ITransientExpression {
- auto isBinaryExpression() const -> bool { return m_isBinaryExpression; }
- auto getResult() const -> bool { return m_result; }
- virtual void streamReconstructedExpression( std::ostream &os ) const = 0;
-
- ITransientExpression( bool isBinaryExpression, bool result )
- : m_isBinaryExpression( isBinaryExpression ),
- m_result( result )
- {}
-
- // We don't actually need a virtual destructor, but many static analysers
- // complain if it's not here :-(
- virtual ~ITransientExpression();
-
- bool m_isBinaryExpression;
- bool m_result;
-
- };
-
- void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs );
-
- template<typename LhsT, typename RhsT>
- class BinaryExpr : public ITransientExpression {
- LhsT m_lhs;
- StringRef m_op;
- RhsT m_rhs;
-
- void streamReconstructedExpression( std::ostream &os ) const override {
- formatReconstructedExpression
- ( os, Catch::Detail::stringify( m_lhs ), m_op, Catch::Detail::stringify( m_rhs ) );
- }
-
- public:
- BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs )
- : ITransientExpression{ true, comparisonResult },
- m_lhs( lhs ),
- m_op( op ),
- m_rhs( rhs )
- {}
-
- template<typename T>
- auto operator && ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator || ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator == ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator != ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator > ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator < ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator >= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename T>
- auto operator <= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<T>::value,
- "chained comparisons are not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
- };
-
- template<typename LhsT>
- class UnaryExpr : public ITransientExpression {
- LhsT m_lhs;
-
- void streamReconstructedExpression( std::ostream &os ) const override {
- os << Catch::Detail::stringify( m_lhs );
- }
-
- public:
- explicit UnaryExpr( LhsT lhs )
- : ITransientExpression{ false, static_cast<bool>(lhs) },
- m_lhs( lhs )
- {}
- };
-
- // Specialised comparison functions to handle equality comparisons between ints and pointers (NULL deduces as an int)
- template<typename LhsT, typename RhsT>
- auto compareEqual( LhsT const& lhs, RhsT const& rhs ) -> bool { return static_cast<bool>(lhs == rhs); }
- template<typename T>
- auto compareEqual( T* const& lhs, int rhs ) -> bool { return lhs == reinterpret_cast<void const*>( rhs ); }
- template<typename T>
- auto compareEqual( T* const& lhs, long rhs ) -> bool { return lhs == reinterpret_cast<void const*>( rhs ); }
- template<typename T>
- auto compareEqual( int lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) == rhs; }
- template<typename T>
- auto compareEqual( long lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) == rhs; }
-
- template<typename LhsT, typename RhsT>
- auto compareNotEqual( LhsT const& lhs, RhsT&& rhs ) -> bool { return static_cast<bool>(lhs != rhs); }
- template<typename T>
- auto compareNotEqual( T* const& lhs, int rhs ) -> bool { return lhs != reinterpret_cast<void const*>( rhs ); }
- template<typename T>
- auto compareNotEqual( T* const& lhs, long rhs ) -> bool { return lhs != reinterpret_cast<void const*>( rhs ); }
- template<typename T>
- auto compareNotEqual( int lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) != rhs; }
- template<typename T>
- auto compareNotEqual( long lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) != rhs; }
-
- template<typename LhsT>
- class ExprLhs {
- LhsT m_lhs;
- public:
- explicit ExprLhs( LhsT lhs ) : m_lhs( lhs ) {}
-
- template<typename RhsT>
- auto operator == ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { compareEqual( m_lhs, rhs ), m_lhs, "==", rhs };
- }
- auto operator == ( bool rhs ) -> BinaryExpr<LhsT, bool> const {
- return { m_lhs == rhs, m_lhs, "==", rhs };
- }
-
- template<typename RhsT>
- auto operator != ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { compareNotEqual( m_lhs, rhs ), m_lhs, "!=", rhs };
- }
- auto operator != ( bool rhs ) -> BinaryExpr<LhsT, bool> const {
- return { m_lhs != rhs, m_lhs, "!=", rhs };
- }
-
- template<typename RhsT>
- auto operator > ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs > rhs), m_lhs, ">", rhs };
- }
- template<typename RhsT>
- auto operator < ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs < rhs), m_lhs, "<", rhs };
- }
- template<typename RhsT>
- auto operator >= ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs >= rhs), m_lhs, ">=", rhs };
- }
- template<typename RhsT>
- auto operator <= ( RhsT const& rhs ) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs <= rhs), m_lhs, "<=", rhs };
- }
- template <typename RhsT>
- auto operator | (RhsT const& rhs) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs | rhs), m_lhs, "|", rhs };
- }
- template <typename RhsT>
- auto operator & (RhsT const& rhs) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs & rhs), m_lhs, "&", rhs };
- }
- template <typename RhsT>
- auto operator ^ (RhsT const& rhs) -> BinaryExpr<LhsT, RhsT const&> const {
- return { static_cast<bool>(m_lhs ^ rhs), m_lhs, "^", rhs };
- }
-
- template<typename RhsT>
- auto operator && ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<RhsT>::value,
- "operator&& is not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- template<typename RhsT>
- auto operator || ( RhsT const& ) -> BinaryExpr<LhsT, RhsT const&> const {
- static_assert(always_false<RhsT>::value,
- "operator|| is not supported inside assertions, "
- "wrap the expression inside parentheses, or decompose it");
- }
-
- auto makeUnaryExpr() const -> UnaryExpr<LhsT> {
- return UnaryExpr<LhsT>{ m_lhs };
- }
- };
-
- void handleExpression( ITransientExpression const& expr );
-
- template<typename T>
- void handleExpression( ExprLhs<T> const& expr ) {
- handleExpression( expr.makeUnaryExpr() );
- }
-
- struct Decomposer {
- template<typename T>
- auto operator <= ( T const& lhs ) -> ExprLhs<T const&> {
- return ExprLhs<T const&>{ lhs };
- }
-
- auto operator <=( bool value ) -> ExprLhs<bool> {
- return ExprLhs<bool>{ value };
- }
- };
-
-} // end namespace Catch
-
-#ifdef _MSC_VER
-#pragma warning(pop)
-#endif
-
-// end catch_decomposer.h
-// start catch_interfaces_capture.h
-
-#include <string>
-#include <chrono>
-
-namespace Catch {
-
- class AssertionResult;
- struct AssertionInfo;
- struct SectionInfo;
- struct SectionEndInfo;
- struct MessageInfo;
- struct MessageBuilder;
- struct Counts;
- struct AssertionReaction;
- struct SourceLineInfo;
-
- struct ITransientExpression;
- struct IGeneratorTracker;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- struct BenchmarkInfo;
- template <typename Duration = std::chrono::duration<double, std::nano>>
- struct BenchmarkStats;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- struct IResultCapture {
-
- virtual ~IResultCapture();
-
- virtual bool sectionStarted( SectionInfo const& sectionInfo,
- Counts& assertions ) = 0;
- virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0;
- virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0;
-
- virtual auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- virtual void benchmarkPreparing( std::string const& name ) = 0;
- virtual void benchmarkStarting( BenchmarkInfo const& info ) = 0;
- virtual void benchmarkEnded( BenchmarkStats<> const& stats ) = 0;
- virtual void benchmarkFailed( std::string const& error ) = 0;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- virtual void pushScopedMessage( MessageInfo const& message ) = 0;
- virtual void popScopedMessage( MessageInfo const& message ) = 0;
-
- virtual void emplaceUnscopedMessage( MessageBuilder const& builder ) = 0;
-
- virtual void handleFatalErrorCondition( StringRef message ) = 0;
-
- virtual void handleExpr
- ( AssertionInfo const& info,
- ITransientExpression const& expr,
- AssertionReaction& reaction ) = 0;
- virtual void handleMessage
- ( AssertionInfo const& info,
- ResultWas::OfType resultType,
- StringRef const& message,
- AssertionReaction& reaction ) = 0;
- virtual void handleUnexpectedExceptionNotThrown
- ( AssertionInfo const& info,
- AssertionReaction& reaction ) = 0;
- virtual void handleUnexpectedInflightException
- ( AssertionInfo const& info,
- std::string const& message,
- AssertionReaction& reaction ) = 0;
- virtual void handleIncomplete
- ( AssertionInfo const& info ) = 0;
- virtual void handleNonExpr
- ( AssertionInfo const &info,
- ResultWas::OfType resultType,
- AssertionReaction &reaction ) = 0;
-
- virtual bool lastAssertionPassed() = 0;
- virtual void assertionPassed() = 0;
-
- // Deprecated, do not use:
- virtual std::string getCurrentTestName() const = 0;
- virtual const AssertionResult* getLastResult() const = 0;
- virtual void exceptionEarlyReported() = 0;
- };
-
- IResultCapture& getResultCapture();
-}
-
-// end catch_interfaces_capture.h
-namespace Catch {
-
- struct TestFailureException{};
- struct AssertionResultData;
- struct IResultCapture;
- class RunContext;
-
- class LazyExpression {
- friend class AssertionHandler;
- friend struct AssertionStats;
- friend class RunContext;
-
- ITransientExpression const* m_transientExpression = nullptr;
- bool m_isNegated;
- public:
- LazyExpression( bool isNegated );
- LazyExpression( LazyExpression const& other );
- LazyExpression& operator = ( LazyExpression const& ) = delete;
-
- explicit operator bool() const;
-
- friend auto operator << ( std::ostream& os, LazyExpression const& lazyExpr ) -> std::ostream&;
- };
-
- struct AssertionReaction {
- bool shouldDebugBreak = false;
- bool shouldThrow = false;
- };
-
- class AssertionHandler {
- AssertionInfo m_assertionInfo;
- AssertionReaction m_reaction;
- bool m_completed = false;
- IResultCapture& m_resultCapture;
-
- public:
- AssertionHandler
- ( StringRef const& macroName,
- SourceLineInfo const& lineInfo,
- StringRef capturedExpression,
- ResultDisposition::Flags resultDisposition );
- ~AssertionHandler() {
- if ( !m_completed ) {
- m_resultCapture.handleIncomplete( m_assertionInfo );
- }
- }
-
- template<typename T>
- void handleExpr( ExprLhs<T> const& expr ) {
- handleExpr( expr.makeUnaryExpr() );
- }
- void handleExpr( ITransientExpression const& expr );
-
- void handleMessage(ResultWas::OfType resultType, StringRef const& message);
-
- void handleExceptionThrownAsExpected();
- void handleUnexpectedExceptionNotThrown();
- void handleExceptionNotThrownAsExpected();
- void handleThrowingCallSkipped();
- void handleUnexpectedInflightException();
-
- void complete();
- void setCompleted();
-
- // query
- auto allowThrows() const -> bool;
- };
-
- void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef const& matcherString );
-
-} // namespace Catch
-
-// end catch_assertionhandler.h
-// start catch_message.h
-
-#include <string>
-#include <vector>
-
-namespace Catch {
-
- struct MessageInfo {
- MessageInfo( StringRef const& _macroName,
- SourceLineInfo const& _lineInfo,
- ResultWas::OfType _type );
-
- StringRef macroName;
- std::string message;
- SourceLineInfo lineInfo;
- ResultWas::OfType type;
- unsigned int sequence;
-
- bool operator == ( MessageInfo const& other ) const;
- bool operator < ( MessageInfo const& other ) const;
- private:
- static unsigned int globalCount;
- };
-
- struct MessageStream {
-
- template<typename T>
- MessageStream& operator << ( T const& value ) {
- m_stream << value;
- return *this;
- }
-
- ReusableStringStream m_stream;
- };
-
- struct MessageBuilder : MessageStream {
- MessageBuilder( StringRef const& macroName,
- SourceLineInfo const& lineInfo,
- ResultWas::OfType type );
-
- template<typename T>
- MessageBuilder& operator << ( T const& value ) {
- m_stream << value;
- return *this;
- }
-
- MessageInfo m_info;
- };
-
- class ScopedMessage {
- public:
- explicit ScopedMessage( MessageBuilder const& builder );
- ScopedMessage( ScopedMessage& duplicate ) = delete;
- ScopedMessage( ScopedMessage&& old );
- ~ScopedMessage();
-
- MessageInfo m_info;
- bool m_moved;
- };
-
- class Capturer {
- std::vector<MessageInfo> m_messages;
- IResultCapture& m_resultCapture = getResultCapture();
- size_t m_captured = 0;
- public:
- Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names );
- ~Capturer();
-
- void captureValue( size_t index, std::string const& value );
-
- template<typename T>
- void captureValues( size_t index, T const& value ) {
- captureValue( index, Catch::Detail::stringify( value ) );
- }
-
- template<typename T, typename... Ts>
- void captureValues( size_t index, T const& value, Ts const&... values ) {
- captureValue( index, Catch::Detail::stringify(value) );
- captureValues( index+1, values... );
- }
- };
-
-} // end namespace Catch
-
-// end catch_message.h
-#if !defined(CATCH_CONFIG_DISABLE)
-
-#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION)
- #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__
-#else
- #define CATCH_INTERNAL_STRINGIFY(...) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"
-#endif
-
-#if defined(CATCH_CONFIG_FAST_COMPILE) || defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-
-///////////////////////////////////////////////////////////////////////////////
-// Another way to speed-up compilation is to omit local try-catch for REQUIRE*
-// macros.
-#define INTERNAL_CATCH_TRY
-#define INTERNAL_CATCH_CATCH( capturer )
-
-#else // CATCH_CONFIG_FAST_COMPILE
-
-#define INTERNAL_CATCH_TRY try
-#define INTERNAL_CATCH_CATCH( handler ) catch(...) { handler.handleUnexpectedInflightException(); }
-
-#endif
-
-#define INTERNAL_CATCH_REACT( handler ) handler.complete();
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \
- do { \
- CATCH_INTERNAL_IGNORE_BUT_WARN(__VA_ARGS__); \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
- INTERNAL_CATCH_TRY { \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
- catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( (void)0, (false) && static_cast<bool>( !!(__VA_ARGS__) ) )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_IF( macroName, resultDisposition, ... ) \
- INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
- if( Catch::getResultCapture().lastAssertionPassed() )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_ELSE( macroName, resultDisposition, ... ) \
- INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
- if( !Catch::getResultCapture().lastAssertionPassed() )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_NO_THROW( macroName, resultDisposition, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
- try { \
- static_cast<void>(__VA_ARGS__); \
- catchAssertionHandler.handleExceptionNotThrownAsExpected(); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleUnexpectedInflightException(); \
- } \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS( macroName, resultDisposition, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition); \
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(__VA_ARGS__); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleExceptionThrownAsExpected(); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS_AS( macroName, exceptionType, resultDisposition, expr ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr) ", " CATCH_INTERNAL_STRINGIFY(exceptionType), resultDisposition ); \
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(expr); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( exceptionType const& ) { \
- catchAssertionHandler.handleExceptionThrownAsExpected(); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleUnexpectedInflightException(); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), resultDisposition ); \
- catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_CAPTURE( varName, macroName, ... ) \
- auto varName = Catch::Capturer( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info, #__VA_ARGS__ ); \
- varName.captureValues( 0, __VA_ARGS__ )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_INFO( macroName, log ) \
- Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log );
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_UNSCOPED_INFO( macroName, log ) \
- Catch::getResultCapture().emplaceUnscopedMessage( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log )
-
-///////////////////////////////////////////////////////////////////////////////
-// Although this is matcher-based, it can be used with just a string
-#define INTERNAL_CATCH_THROWS_STR_MATCHES( macroName, resultDisposition, matcher, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(__VA_ARGS__); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( ... ) { \
- Catch::handleExceptionMatchExpr( catchAssertionHandler, matcher, #matcher##_catch_sr ); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-#endif // CATCH_CONFIG_DISABLE
-
-// end catch_capture.hpp
-// start catch_section.h
-
-// start catch_section_info.h
-
-// start catch_totals.h
-
-#include <cstddef>
-
-namespace Catch {
-
- struct Counts {
- Counts operator - ( Counts const& other ) const;
- Counts& operator += ( Counts const& other );
-
- std::size_t total() const;
- bool allPassed() const;
- bool allOk() const;
-
- std::size_t passed = 0;
- std::size_t failed = 0;
- std::size_t failedButOk = 0;
- };
-
- struct Totals {
-
- Totals operator - ( Totals const& other ) const;
- Totals& operator += ( Totals const& other );
-
- Totals delta( Totals const& prevTotals ) const;
-
- int error = 0;
- Counts assertions;
- Counts testCases;
- };
-}
-
-// end catch_totals.h
-#include <string>
-
-namespace Catch {
-
- struct SectionInfo {
- SectionInfo
- ( SourceLineInfo const& _lineInfo,
- std::string const& _name );
-
- // Deprecated
- SectionInfo
- ( SourceLineInfo const& _lineInfo,
- std::string const& _name,
- std::string const& ) : SectionInfo( _lineInfo, _name ) {}
-
- std::string name;
- std::string description; // !Deprecated: this will always be empty
- SourceLineInfo lineInfo;
- };
-
- struct SectionEndInfo {
- SectionInfo sectionInfo;
- Counts prevAssertions;
- double durationInSeconds;
- };
-
-} // end namespace Catch
-
-// end catch_section_info.h
-// start catch_timer.h
-
-#include <cstdint>
-
-namespace Catch {
-
- auto getCurrentNanosecondsSinceEpoch() -> uint64_t;
- auto getEstimatedClockResolution() -> uint64_t;
-
- class Timer {
- uint64_t m_nanoseconds = 0;
- public:
- void start();
- auto getElapsedNanoseconds() const -> uint64_t;
- auto getElapsedMicroseconds() const -> uint64_t;
- auto getElapsedMilliseconds() const -> unsigned int;
- auto getElapsedSeconds() const -> double;
- };
-
-} // namespace Catch
-
-// end catch_timer.h
-#include <string>
-
-namespace Catch {
-
- class Section : NonCopyable {
- public:
- Section( SectionInfo const& info );
- ~Section();
-
- // This indicates whether the section should be executed or not
- explicit operator bool() const;
-
- private:
- SectionInfo m_info;
-
- std::string m_name;
- Counts m_assertions;
- bool m_sectionIncluded;
- Timer m_timer;
- };
-
-} // end namespace Catch
-
-#define INTERNAL_CATCH_SECTION( ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \
- if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
-#define INTERNAL_CATCH_DYNAMIC_SECTION( ... ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_UNUSED_WARNINGS \
- if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, (Catch::ReusableStringStream() << __VA_ARGS__).str() ) ) \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
-// end catch_section.h
-// start catch_interfaces_exception.h
-
-// start catch_interfaces_registry_hub.h
-
-#include <string>
-#include <memory>
-
-namespace Catch {
-
- class TestCase;
- struct ITestCaseRegistry;
- struct IExceptionTranslatorRegistry;
- struct IExceptionTranslator;
- struct IReporterRegistry;
- struct IReporterFactory;
- struct ITagAliasRegistry;
- struct IMutableEnumValuesRegistry;
-
- class StartupExceptionRegistry;
-
- using IReporterFactoryPtr = std::shared_ptr<IReporterFactory>;
-
- struct IRegistryHub {
- virtual ~IRegistryHub();
-
- virtual IReporterRegistry const& getReporterRegistry() const = 0;
- virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0;
- virtual ITagAliasRegistry const& getTagAliasRegistry() const = 0;
- virtual IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const = 0;
-
- virtual StartupExceptionRegistry const& getStartupExceptionRegistry() const = 0;
- };
-
- struct IMutableRegistryHub {
- virtual ~IMutableRegistryHub();
- virtual void registerReporter( std::string const& name, IReporterFactoryPtr const& factory ) = 0;
- virtual void registerListener( IReporterFactoryPtr const& factory ) = 0;
- virtual void registerTest( TestCase const& testInfo ) = 0;
- virtual void registerTranslator( const IExceptionTranslator* translator ) = 0;
- virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0;
- virtual void registerStartupException() noexcept = 0;
- virtual IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() = 0;
- };
-
- IRegistryHub const& getRegistryHub();
- IMutableRegistryHub& getMutableRegistryHub();
- void cleanUp();
- std::string translateActiveException();
-
-}
-
-// end catch_interfaces_registry_hub.h
-#if defined(CATCH_CONFIG_DISABLE)
- #define INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( translatorName, signature) \
- static std::string translatorName( signature )
-#endif
-
-#include <exception>
-#include <string>
-#include <vector>
-
-namespace Catch {
- using exceptionTranslateFunction = std::string(*)();
-
- struct IExceptionTranslator;
- using ExceptionTranslators = std::vector<std::unique_ptr<IExceptionTranslator const>>;
-
- struct IExceptionTranslator {
- virtual ~IExceptionTranslator();
- virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0;
- };
-
- struct IExceptionTranslatorRegistry {
- virtual ~IExceptionTranslatorRegistry();
-
- virtual std::string translateActiveException() const = 0;
- };
-
- class ExceptionTranslatorRegistrar {
- template<typename T>
- class ExceptionTranslator : public IExceptionTranslator {
- public:
-
- ExceptionTranslator( std::string(*translateFunction)( T& ) )
- : m_translateFunction( translateFunction )
- {}
-
- std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const override {
-#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- return "";
-#else
- try {
- if( it == itEnd )
- std::rethrow_exception(std::current_exception());
- else
- return (*it)->translate( it+1, itEnd );
- }
- catch( T& ex ) {
- return m_translateFunction( ex );
- }
-#endif
- }
-
- protected:
- std::string(*m_translateFunction)( T& );
- };
-
- public:
- template<typename T>
- ExceptionTranslatorRegistrar( std::string(*translateFunction)( T& ) ) {
- getMutableRegistryHub().registerTranslator
- ( new ExceptionTranslator<T>( translateFunction ) );
- }
- };
-}
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_TRANSLATE_EXCEPTION2( translatorName, signature ) \
- static std::string translatorName( signature ); \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &translatorName ); } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- static std::string translatorName( signature )
-
-#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION2( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
-
-// end catch_interfaces_exception.h
-// start catch_approx.h
-
-#include <type_traits>
-
-namespace Catch {
-namespace Detail {
-
- class Approx {
- private:
- bool equalityComparisonImpl(double other) const;
- // Validates the new margin (margin >= 0)
- // out-of-line to avoid including stdexcept in the header
- void setMargin(double margin);
- // Validates the new epsilon (0 < epsilon < 1)
- // out-of-line to avoid including stdexcept in the header
- void setEpsilon(double epsilon);
-
- public:
- explicit Approx ( double value );
-
- static Approx custom();
-
- Approx operator-() const;
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- Approx operator()( T const& value ) {
- Approx approx( static_cast<double>(value) );
- approx.m_epsilon = m_epsilon;
- approx.m_margin = m_margin;
- approx.m_scale = m_scale;
- return approx;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- explicit Approx( T const& value ): Approx(static_cast<double>(value))
- {}
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator == ( const T& lhs, Approx const& rhs ) {
- auto lhs_v = static_cast<double>(lhs);
- return rhs.equalityComparisonImpl(lhs_v);
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator == ( Approx const& lhs, const T& rhs ) {
- return operator==( rhs, lhs );
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator != ( T const& lhs, Approx const& rhs ) {
- return !operator==( lhs, rhs );
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator != ( Approx const& lhs, T const& rhs ) {
- return !operator==( rhs, lhs );
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator <= ( T const& lhs, Approx const& rhs ) {
- return static_cast<double>(lhs) < rhs.m_value || lhs == rhs;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator <= ( Approx const& lhs, T const& rhs ) {
- return lhs.m_value < static_cast<double>(rhs) || lhs == rhs;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator >= ( T const& lhs, Approx const& rhs ) {
- return static_cast<double>(lhs) > rhs.m_value || lhs == rhs;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- friend bool operator >= ( Approx const& lhs, T const& rhs ) {
- return lhs.m_value > static_cast<double>(rhs) || lhs == rhs;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- Approx& epsilon( T const& newEpsilon ) {
- double epsilonAsDouble = static_cast<double>(newEpsilon);
- setEpsilon(epsilonAsDouble);
- return *this;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- Approx& margin( T const& newMargin ) {
- double marginAsDouble = static_cast<double>(newMargin);
- setMargin(marginAsDouble);
- return *this;
- }
-
- template <typename T, typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- Approx& scale( T const& newScale ) {
- m_scale = static_cast<double>(newScale);
- return *this;
- }
-
- std::string toString() const;
-
- private:
- double m_epsilon;
- double m_margin;
- double m_scale;
- double m_value;
- };
-} // end namespace Detail
-
-namespace literals {
- Detail::Approx operator "" _a(long double val);
- Detail::Approx operator "" _a(unsigned long long val);
-} // end namespace literals
-
-template<>
-struct StringMaker<Catch::Detail::Approx> {
- static std::string convert(Catch::Detail::Approx const& value);
-};
-
-} // end namespace Catch
-
-// end catch_approx.h
-// start catch_string_manip.h
-
-#include <string>
-#include <iosfwd>
-#include <vector>
-
-namespace Catch {
-
- bool startsWith( std::string const& s, std::string const& prefix );
- bool startsWith( std::string const& s, char prefix );
- bool endsWith( std::string const& s, std::string const& suffix );
- bool endsWith( std::string const& s, char suffix );
- bool contains( std::string const& s, std::string const& infix );
- void toLowerInPlace( std::string& s );
- std::string toLower( std::string const& s );
- //! Returns a new string without whitespace at the start/end
- std::string trim( std::string const& str );
- //! Returns a substring of the original ref without whitespace. Beware lifetimes!
- StringRef trim(StringRef ref);
-
- // !!! Be aware, returns refs into original string - make sure original string outlives them
- std::vector<StringRef> splitStringRef( StringRef str, char delimiter );
- bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis );
-
- struct pluralise {
- pluralise( std::size_t count, std::string const& label );
-
- friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser );
-
- std::size_t m_count;
- std::string m_label;
- };
-}
-
-// end catch_string_manip.h
-#ifndef CATCH_CONFIG_DISABLE_MATCHERS
-// start catch_capture_matchers.h
-
-// start catch_matchers.h
-
-#include <string>
-#include <vector>
-
-namespace Catch {
-namespace Matchers {
- namespace Impl {
-
- template<typename ArgT> struct MatchAllOf;
- template<typename ArgT> struct MatchAnyOf;
- template<typename ArgT> struct MatchNotOf;
-
- class MatcherUntypedBase {
- public:
- MatcherUntypedBase() = default;
- MatcherUntypedBase ( MatcherUntypedBase const& ) = default;
- MatcherUntypedBase& operator = ( MatcherUntypedBase const& ) = delete;
- std::string toString() const;
-
- protected:
- virtual ~MatcherUntypedBase();
- virtual std::string describe() const = 0;
- mutable std::string m_cachedToString;
- };
-
-#ifdef __clang__
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wnon-virtual-dtor"
-#endif
-
- template<typename ObjectT>
- struct MatcherMethod {
- virtual bool match( ObjectT const& arg ) const = 0;
- };
-
-#if defined(__OBJC__)
- // Hack to fix Catch GH issue #1661. Could use id for generic Object support.
- // use of const for Object pointers is very uncommon and under ARC it causes some kind of signature mismatch that breaks compilation
- template<>
- struct MatcherMethod<NSString*> {
- virtual bool match( NSString* arg ) const = 0;
- };
-#endif
-
-#ifdef __clang__
-# pragma clang diagnostic pop
-#endif
-
- template<typename T>
- struct MatcherBase : MatcherUntypedBase, MatcherMethod<T> {
-
- MatchAllOf<T> operator && ( MatcherBase const& other ) const;
- MatchAnyOf<T> operator || ( MatcherBase const& other ) const;
- MatchNotOf<T> operator ! () const;
- };
-
- template<typename ArgT>
- struct MatchAllOf : MatcherBase<ArgT> {
- bool match( ArgT const& arg ) const override {
- for( auto matcher : m_matchers ) {
- if (!matcher->match(arg))
- return false;
- }
- return true;
- }
- std::string describe() const override {
- std::string description;
- description.reserve( 4 + m_matchers.size()*32 );
- description += "( ";
- bool first = true;
- for( auto matcher : m_matchers ) {
- if( first )
- first = false;
- else
- description += " and ";
- description += matcher->toString();
- }
- description += " )";
- return description;
- }
-
- MatchAllOf<ArgT> operator && ( MatcherBase<ArgT> const& other ) {
- auto copy(*this);
- copy.m_matchers.push_back( &other );
- return copy;
- }
-
- std::vector<MatcherBase<ArgT> const*> m_matchers;
- };
- template<typename ArgT>
- struct MatchAnyOf : MatcherBase<ArgT> {
-
- bool match( ArgT const& arg ) const override {
- for( auto matcher : m_matchers ) {
- if (matcher->match(arg))
- return true;
- }
- return false;
- }
- std::string describe() const override {
- std::string description;
- description.reserve( 4 + m_matchers.size()*32 );
- description += "( ";
- bool first = true;
- for( auto matcher : m_matchers ) {
- if( first )
- first = false;
- else
- description += " or ";
- description += matcher->toString();
- }
- description += " )";
- return description;
- }
-
- MatchAnyOf<ArgT> operator || ( MatcherBase<ArgT> const& other ) {
- auto copy(*this);
- copy.m_matchers.push_back( &other );
- return copy;
- }
-
- std::vector<MatcherBase<ArgT> const*> m_matchers;
- };
-
- template<typename ArgT>
- struct MatchNotOf : MatcherBase<ArgT> {
-
- MatchNotOf( MatcherBase<ArgT> const& underlyingMatcher ) : m_underlyingMatcher( underlyingMatcher ) {}
-
- bool match( ArgT const& arg ) const override {
- return !m_underlyingMatcher.match( arg );
- }
-
- std::string describe() const override {
- return "not " + m_underlyingMatcher.toString();
- }
- MatcherBase<ArgT> const& m_underlyingMatcher;
- };
-
- template<typename T>
- MatchAllOf<T> MatcherBase<T>::operator && ( MatcherBase const& other ) const {
- return MatchAllOf<T>() && *this && other;
- }
- template<typename T>
- MatchAnyOf<T> MatcherBase<T>::operator || ( MatcherBase const& other ) const {
- return MatchAnyOf<T>() || *this || other;
- }
- template<typename T>
- MatchNotOf<T> MatcherBase<T>::operator ! () const {
- return MatchNotOf<T>( *this );
- }
-
- } // namespace Impl
-
-} // namespace Matchers
-
-using namespace Matchers;
-using Matchers::Impl::MatcherBase;
-
-} // namespace Catch
-
-// end catch_matchers.h
-// start catch_matchers_exception.hpp
-
-namespace Catch {
-namespace Matchers {
-namespace Exception {
-
-class ExceptionMessageMatcher : public MatcherBase<std::exception> {
- std::string m_message;
-public:
-
- ExceptionMessageMatcher(std::string const& message):
- m_message(message)
- {}
-
- bool match(std::exception const& ex) const override;
-
- std::string describe() const override;
-};
-
-} // namespace Exception
-
-Exception::ExceptionMessageMatcher Message(std::string const& message);
-
-} // namespace Matchers
-} // namespace Catch
-
-// end catch_matchers_exception.hpp
-// start catch_matchers_floating.h
-
-namespace Catch {
-namespace Matchers {
-
- namespace Floating {
-
- enum class FloatingPointKind : uint8_t;
-
- struct WithinAbsMatcher : MatcherBase<double> {
- WithinAbsMatcher(double target, double margin);
- bool match(double const& matchee) const override;
- std::string describe() const override;
- private:
- double m_target;
- double m_margin;
- };
-
- struct WithinUlpsMatcher : MatcherBase<double> {
- WithinUlpsMatcher(double target, uint64_t ulps, FloatingPointKind baseType);
- bool match(double const& matchee) const override;
- std::string describe() const override;
- private:
- double m_target;
- uint64_t m_ulps;
- FloatingPointKind m_type;
- };
-
- // Given IEEE-754 format for floats and doubles, we can assume
- // that float -> double promotion is lossless. Given this, we can
- // assume that if we do the standard relative comparison of
- // |lhs - rhs| <= epsilon * max(fabs(lhs), fabs(rhs)), then we get
- // the same result if we do this for floats, as if we do this for
- // doubles that were promoted from floats.
- struct WithinRelMatcher : MatcherBase<double> {
- WithinRelMatcher(double target, double epsilon);
- bool match(double const& matchee) const override;
- std::string describe() const override;
- private:
- double m_target;
- double m_epsilon;
- };
-
- } // namespace Floating
-
- // The following functions create the actual matcher objects.
- // This allows the types to be inferred
- Floating::WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff);
- Floating::WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff);
- Floating::WithinAbsMatcher WithinAbs(double target, double margin);
- Floating::WithinRelMatcher WithinRel(double target, double eps);
- // defaults epsilon to 100*numeric_limits<double>::epsilon()
- Floating::WithinRelMatcher WithinRel(double target);
- Floating::WithinRelMatcher WithinRel(float target, float eps);
- // defaults epsilon to 100*numeric_limits<float>::epsilon()
- Floating::WithinRelMatcher WithinRel(float target);
-
-} // namespace Matchers
-} // namespace Catch
-
-// end catch_matchers_floating.h
-// start catch_matchers_generic.hpp
-
-#include <functional>
-#include <string>
-
-namespace Catch {
-namespace Matchers {
-namespace Generic {
-
-namespace Detail {
- std::string finalizeDescription(const std::string& desc);
-}
-
-template <typename T>
-class PredicateMatcher : public MatcherBase<T> {
- std::function<bool(T const&)> m_predicate;
- std::string m_description;
-public:
-
- PredicateMatcher(std::function<bool(T const&)> const& elem, std::string const& descr)
- :m_predicate(std::move(elem)),
- m_description(Detail::finalizeDescription(descr))
- {}
-
- bool match( T const& item ) const override {
- return m_predicate(item);
- }
-
- std::string describe() const override {
- return m_description;
- }
-};
-
-} // namespace Generic
-
- // The following functions create the actual matcher objects.
- // The user has to explicitly specify type to the function, because
- // inferring std::function<bool(T const&)> is hard (but possible) and
- // requires a lot of TMP.
- template<typename T>
- Generic::PredicateMatcher<T> Predicate(std::function<bool(T const&)> const& predicate, std::string const& description = "") {
- return Generic::PredicateMatcher<T>(predicate, description);
- }
-
-} // namespace Matchers
-} // namespace Catch
-
-// end catch_matchers_generic.hpp
-// start catch_matchers_string.h
-
-#include <string>
-
-namespace Catch {
-namespace Matchers {
-
- namespace StdString {
-
- struct CasedString
- {
- CasedString( std::string const& str, CaseSensitive::Choice caseSensitivity );
- std::string adjustString( std::string const& str ) const;
- std::string caseSensitivitySuffix() const;
-
- CaseSensitive::Choice m_caseSensitivity;
- std::string m_str;
- };
-
- struct StringMatcherBase : MatcherBase<std::string> {
- StringMatcherBase( std::string const& operation, CasedString const& comparator );
- std::string describe() const override;
-
- CasedString m_comparator;
- std::string m_operation;
- };
-
- struct EqualsMatcher : StringMatcherBase {
- EqualsMatcher( CasedString const& comparator );
- bool match( std::string const& source ) const override;
- };
- struct ContainsMatcher : StringMatcherBase {
- ContainsMatcher( CasedString const& comparator );
- bool match( std::string const& source ) const override;
- };
- struct StartsWithMatcher : StringMatcherBase {
- StartsWithMatcher( CasedString const& comparator );
- bool match( std::string const& source ) const override;
- };
- struct EndsWithMatcher : StringMatcherBase {
- EndsWithMatcher( CasedString const& comparator );
- bool match( std::string const& source ) const override;
- };
-
- struct RegexMatcher : MatcherBase<std::string> {
- RegexMatcher( std::string regex, CaseSensitive::Choice caseSensitivity );
- bool match( std::string const& matchee ) const override;
- std::string describe() const override;
-
- private:
- std::string m_regex;
- CaseSensitive::Choice m_caseSensitivity;
- };
-
- } // namespace StdString
-
- // The following functions create the actual matcher objects.
- // This allows the types to be inferred
-
- StdString::EqualsMatcher Equals( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
- StdString::ContainsMatcher Contains( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
- StdString::EndsWithMatcher EndsWith( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
- StdString::StartsWithMatcher StartsWith( std::string const& str, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
- StdString::RegexMatcher Matches( std::string const& regex, CaseSensitive::Choice caseSensitivity = CaseSensitive::Yes );
-
-} // namespace Matchers
-} // namespace Catch
-
-// end catch_matchers_string.h
-// start catch_matchers_vector.h
-
-#include <algorithm>
-
-namespace Catch {
-namespace Matchers {
-
- namespace Vector {
- template<typename T, typename Alloc>
- struct ContainsElementMatcher : MatcherBase<std::vector<T, Alloc>> {
-
- ContainsElementMatcher(T const &comparator) : m_comparator( comparator) {}
-
- bool match(std::vector<T, Alloc> const &v) const override {
- for (auto const& el : v) {
- if (el == m_comparator) {
- return true;
- }
- }
- return false;
- }
-
- std::string describe() const override {
- return "Contains: " + ::Catch::Detail::stringify( m_comparator );
- }
-
- T const& m_comparator;
- };
-
- template<typename T, typename AllocComp, typename AllocMatch>
- struct ContainsMatcher : MatcherBase<std::vector<T, AllocMatch>> {
-
- ContainsMatcher(std::vector<T, AllocComp> const &comparator) : m_comparator( comparator ) {}
-
- bool match(std::vector<T, AllocMatch> const &v) const override {
- // !TBD: see note in EqualsMatcher
- if (m_comparator.size() > v.size())
- return false;
- for (auto const& comparator : m_comparator) {
- auto present = false;
- for (const auto& el : v) {
- if (el == comparator) {
- present = true;
- break;
- }
- }
- if (!present) {
- return false;
- }
- }
- return true;
- }
- std::string describe() const override {
- return "Contains: " + ::Catch::Detail::stringify( m_comparator );
- }
-
- std::vector<T, AllocComp> const& m_comparator;
- };
-
- template<typename T, typename AllocComp, typename AllocMatch>
- struct EqualsMatcher : MatcherBase<std::vector<T, AllocMatch>> {
-
- EqualsMatcher(std::vector<T, AllocComp> const &comparator) : m_comparator( comparator ) {}
-
- bool match(std::vector<T, AllocMatch> const &v) const override {
- // !TBD: This currently works if all elements can be compared using !=
- // - a more general approach would be via a compare template that defaults
- // to using !=. but could be specialised for, e.g. std::vector<T, Alloc> etc
- // - then just call that directly
- if (m_comparator.size() != v.size())
- return false;
- for (std::size_t i = 0; i < v.size(); ++i)
- if (m_comparator[i] != v[i])
- return false;
- return true;
- }
- std::string describe() const override {
- return "Equals: " + ::Catch::Detail::stringify( m_comparator );
- }
- std::vector<T, AllocComp> const& m_comparator;
- };
-
- template<typename T, typename AllocComp, typename AllocMatch>
- struct ApproxMatcher : MatcherBase<std::vector<T, AllocMatch>> {
-
- ApproxMatcher(std::vector<T, AllocComp> const& comparator) : m_comparator( comparator ) {}
-
- bool match(std::vector<T, AllocMatch> const &v) const override {
- if (m_comparator.size() != v.size())
- return false;
- for (std::size_t i = 0; i < v.size(); ++i)
- if (m_comparator[i] != approx(v[i]))
- return false;
- return true;
- }
- std::string describe() const override {
- return "is approx: " + ::Catch::Detail::stringify( m_comparator );
- }
- template <typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- ApproxMatcher& epsilon( T const& newEpsilon ) {
- approx.epsilon(newEpsilon);
- return *this;
- }
- template <typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- ApproxMatcher& margin( T const& newMargin ) {
- approx.margin(newMargin);
- return *this;
- }
- template <typename = typename std::enable_if<std::is_constructible<double, T>::value>::type>
- ApproxMatcher& scale( T const& newScale ) {
- approx.scale(newScale);
- return *this;
- }
-
- std::vector<T, AllocComp> const& m_comparator;
- mutable Catch::Detail::Approx approx = Catch::Detail::Approx::custom();
- };
-
- template<typename T, typename AllocComp, typename AllocMatch>
- struct UnorderedEqualsMatcher : MatcherBase<std::vector<T, AllocMatch>> {
- UnorderedEqualsMatcher(std::vector<T, AllocComp> const& target) : m_target(target) {}
- bool match(std::vector<T, AllocMatch> const& vec) const override {
- if (m_target.size() != vec.size()) {
- return false;
- }
- return std::is_permutation(m_target.begin(), m_target.end(), vec.begin());
- }
-
- std::string describe() const override {
- return "UnorderedEquals: " + ::Catch::Detail::stringify(m_target);
- }
- private:
- std::vector<T, AllocComp> const& m_target;
- };
-
- } // namespace Vector
-
- // The following functions create the actual matcher objects.
- // This allows the types to be inferred
-
- template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
- Vector::ContainsMatcher<T, AllocComp, AllocMatch> Contains( std::vector<T, AllocComp> const& comparator ) {
- return Vector::ContainsMatcher<T, AllocComp, AllocMatch>( comparator );
- }
-
- template<typename T, typename Alloc = std::allocator<T>>
- Vector::ContainsElementMatcher<T, Alloc> VectorContains( T const& comparator ) {
- return Vector::ContainsElementMatcher<T, Alloc>( comparator );
- }
-
- template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
- Vector::EqualsMatcher<T, AllocComp, AllocMatch> Equals( std::vector<T, AllocComp> const& comparator ) {
- return Vector::EqualsMatcher<T, AllocComp, AllocMatch>( comparator );
- }
-
- template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
- Vector::ApproxMatcher<T, AllocComp, AllocMatch> Approx( std::vector<T, AllocComp> const& comparator ) {
- return Vector::ApproxMatcher<T, AllocComp, AllocMatch>( comparator );
- }
-
- template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
- Vector::UnorderedEqualsMatcher<T, AllocComp, AllocMatch> UnorderedEquals(std::vector<T, AllocComp> const& target) {
- return Vector::UnorderedEqualsMatcher<T, AllocComp, AllocMatch>( target );
- }
-
-} // namespace Matchers
-} // namespace Catch
-
-// end catch_matchers_vector.h
-namespace Catch {
-
- template<typename ArgT, typename MatcherT>
- class MatchExpr : public ITransientExpression {
- ArgT const& m_arg;
- MatcherT m_matcher;
- StringRef m_matcherString;
- public:
- MatchExpr( ArgT const& arg, MatcherT const& matcher, StringRef const& matcherString )
- : ITransientExpression{ true, matcher.match( arg ) },
- m_arg( arg ),
- m_matcher( matcher ),
- m_matcherString( matcherString )
- {}
-
- void streamReconstructedExpression( std::ostream &os ) const override {
- auto matcherAsString = m_matcher.toString();
- os << Catch::Detail::stringify( m_arg ) << ' ';
- if( matcherAsString == Detail::unprintableString )
- os << m_matcherString;
- else
- os << matcherAsString;
- }
- };
-
- using StringMatcher = Matchers::Impl::MatcherBase<std::string>;
-
- void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString );
-
- template<typename ArgT, typename MatcherT>
- auto makeMatchExpr( ArgT const& arg, MatcherT const& matcher, StringRef const& matcherString ) -> MatchExpr<ArgT, MatcherT> {
- return MatchExpr<ArgT, MatcherT>( arg, matcher, matcherString );
- }
-
-} // namespace Catch
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CHECK_THAT( macroName, matcher, resultDisposition, arg ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(arg) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
- INTERNAL_CATCH_TRY { \
- catchAssertionHandler.handleExpr( Catch::makeMatchExpr( arg, matcher, #matcher##_catch_sr ) ); \
- } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS_MATCHES( macroName, exceptionType, resultDisposition, matcher, ... ) \
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(exceptionType) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(__VA_ARGS__ ); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( exceptionType const& ex ) { \
- catchAssertionHandler.handleExpr( Catch::makeMatchExpr( ex, matcher, #matcher##_catch_sr ) ); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleUnexpectedInflightException(); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
-
-// end catch_capture_matchers.h
-#endif
-// start catch_generators.hpp
-
-// start catch_interfaces_generatortracker.h
-
-
-#include <memory>
-
-namespace Catch {
-
- namespace Generators {
- class GeneratorUntypedBase {
- public:
- GeneratorUntypedBase() = default;
- virtual ~GeneratorUntypedBase();
- // Attempts to move the generator to the next element
- //
- // Returns true iff the move succeeded (and a valid element
- // can be retrieved).
- virtual bool next() = 0;
- };
- using GeneratorBasePtr = std::unique_ptr<GeneratorUntypedBase>;
-
- } // namespace Generators
-
- struct IGeneratorTracker {
- virtual ~IGeneratorTracker();
- virtual auto hasGenerator() const -> bool = 0;
- virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0;
- virtual void setGenerator( Generators::GeneratorBasePtr&& generator ) = 0;
- };
-
-} // namespace Catch
-
-// end catch_interfaces_generatortracker.h
-// start catch_enforce.h
-
-#include <exception>
-
-namespace Catch {
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- template <typename Ex>
- [[noreturn]]
- void throw_exception(Ex const& e) {
- throw e;
- }
-#else // ^^ Exceptions are enabled // Exceptions are disabled vv
- [[noreturn]]
- void throw_exception(std::exception const& e);
-#endif
-
- [[noreturn]]
- void throw_logic_error(std::string const& msg);
- [[noreturn]]
- void throw_domain_error(std::string const& msg);
- [[noreturn]]
- void throw_runtime_error(std::string const& msg);
-
-} // namespace Catch;
-
-#define CATCH_MAKE_MSG(...) \
- (Catch::ReusableStringStream() << __VA_ARGS__).str()
-
-#define CATCH_INTERNAL_ERROR(...) \
- Catch::throw_logic_error(CATCH_MAKE_MSG( CATCH_INTERNAL_LINEINFO << ": Internal Catch2 error: " << __VA_ARGS__))
-
-#define CATCH_ERROR(...) \
- Catch::throw_domain_error(CATCH_MAKE_MSG( __VA_ARGS__ ))
-
-#define CATCH_RUNTIME_ERROR(...) \
- Catch::throw_runtime_error(CATCH_MAKE_MSG( __VA_ARGS__ ))
-
-#define CATCH_ENFORCE( condition, ... ) \
- do{ if( !(condition) ) CATCH_ERROR( __VA_ARGS__ ); } while(false)
-
-// end catch_enforce.h
-#include <memory>
-#include <vector>
-#include <cassert>
-
-#include <utility>
-#include <exception>
-
-namespace Catch {
-
-class GeneratorException : public std::exception {
- const char* const m_msg = "";
-
-public:
- GeneratorException(const char* msg):
- m_msg(msg)
- {}
-
- const char* what() const noexcept override final;
-};
-
-namespace Generators {
-
- // !TBD move this into its own location?
- namespace pf{
- template<typename T, typename... Args>
- std::unique_ptr<T> make_unique( Args&&... args ) {
- return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
- }
- }
-
- template<typename T>
- struct IGenerator : GeneratorUntypedBase {
- virtual ~IGenerator() = default;
-
- // Returns the current element of the generator
- //
- // \Precondition The generator is either freshly constructed,
- // or the last call to `next()` returned true
- virtual T const& get() const = 0;
- using type = T;
- };
-
- template<typename T>
- class SingleValueGenerator final : public IGenerator<T> {
- T m_value;
- public:
- SingleValueGenerator(T&& value) : m_value(std::move(value)) {}
-
- T const& get() const override {
- return m_value;
- }
- bool next() override {
- return false;
- }
- };
-
- template<typename T>
- class FixedValuesGenerator final : public IGenerator<T> {
- static_assert(!std::is_same<T, bool>::value,
- "FixedValuesGenerator does not support bools because of std::vector<bool>"
- "specialization, use SingleValue Generator instead.");
- std::vector<T> m_values;
- size_t m_idx = 0;
- public:
- FixedValuesGenerator( std::initializer_list<T> values ) : m_values( values ) {}
-
- T const& get() const override {
- return m_values[m_idx];
- }
- bool next() override {
- ++m_idx;
- return m_idx < m_values.size();
- }
- };
-
- template <typename T>
- class GeneratorWrapper final {
- std::unique_ptr<IGenerator<T>> m_generator;
- public:
- GeneratorWrapper(std::unique_ptr<IGenerator<T>> generator):
- m_generator(std::move(generator))
- {}
- T const& get() const {
- return m_generator->get();
- }
- bool next() {
- return m_generator->next();
- }
- };
-
- template <typename T>
- GeneratorWrapper<T> value(T&& value) {
- return GeneratorWrapper<T>(pf::make_unique<SingleValueGenerator<T>>(std::forward<T>(value)));
- }
- template <typename T>
- GeneratorWrapper<T> values(std::initializer_list<T> values) {
- return GeneratorWrapper<T>(pf::make_unique<FixedValuesGenerator<T>>(values));
- }
-
- template<typename T>
- class Generators : public IGenerator<T> {
- std::vector<GeneratorWrapper<T>> m_generators;
- size_t m_current = 0;
-
- void populate(GeneratorWrapper<T>&& generator) {
- m_generators.emplace_back(std::move(generator));
- }
- void populate(T&& val) {
- m_generators.emplace_back(value(std::forward<T>(val)));
- }
- template<typename U>
- void populate(U&& val) {
- populate(T(std::forward<U>(val)));
- }
- template<typename U, typename... Gs>
- void populate(U&& valueOrGenerator, Gs &&... moreGenerators) {
- populate(std::forward<U>(valueOrGenerator));
- populate(std::forward<Gs>(moreGenerators)...);
- }
-
- public:
- template <typename... Gs>
- Generators(Gs &&... moreGenerators) {
- m_generators.reserve(sizeof...(Gs));
- populate(std::forward<Gs>(moreGenerators)...);
- }
-
- T const& get() const override {
- return m_generators[m_current].get();
- }
-
- bool next() override {
- if (m_current >= m_generators.size()) {
- return false;
- }
- const bool current_status = m_generators[m_current].next();
- if (!current_status) {
- ++m_current;
- }
- return m_current < m_generators.size();
- }
- };
-
- template<typename... Ts>
- GeneratorWrapper<std::tuple<Ts...>> table( std::initializer_list<std::tuple<typename std::decay<Ts>::type...>> tuples ) {
- return values<std::tuple<Ts...>>( tuples );
- }
-
- // Tag type to signal that a generator sequence should convert arguments to a specific type
- template <typename T>
- struct as {};
-
- template<typename T, typename... Gs>
- auto makeGenerators( GeneratorWrapper<T>&& generator, Gs &&... moreGenerators ) -> Generators<T> {
- return Generators<T>(std::move(generator), std::forward<Gs>(moreGenerators)...);
- }
- template<typename T>
- auto makeGenerators( GeneratorWrapper<T>&& generator ) -> Generators<T> {
- return Generators<T>(std::move(generator));
- }
- template<typename T, typename... Gs>
- auto makeGenerators( T&& val, Gs &&... moreGenerators ) -> Generators<T> {
- return makeGenerators( value( std::forward<T>( val ) ), std::forward<Gs>( moreGenerators )... );
- }
- template<typename T, typename U, typename... Gs>
- auto makeGenerators( as<T>, U&& val, Gs &&... moreGenerators ) -> Generators<T> {
- return makeGenerators( value( T( std::forward<U>( val ) ) ), std::forward<Gs>( moreGenerators )... );
- }
-
- auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker&;
-
- template<typename L>
- // Note: The type after -> is weird, because VS2015 cannot parse
- // the expression used in the typedef inside, when it is in
- // return type. Yeah.
- auto generate( StringRef generatorName, SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
- using UnderlyingType = typename decltype(generatorExpression())::type;
-
- IGeneratorTracker& tracker = acquireGeneratorTracker( generatorName, lineInfo );
- if (!tracker.hasGenerator()) {
- tracker.setGenerator(pf::make_unique<Generators<UnderlyingType>>(generatorExpression()));
- }
-
- auto const& generator = static_cast<IGenerator<UnderlyingType> const&>( *tracker.getGenerator() );
- return generator.get();
- }
-
-} // namespace Generators
-} // namespace Catch
-
-#define GENERATE( ... ) \
- Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
- CATCH_INTERNAL_LINEINFO, \
- [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
-#define GENERATE_COPY( ... ) \
- Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
- CATCH_INTERNAL_LINEINFO, \
- [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
-#define GENERATE_REF( ... ) \
- Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
- CATCH_INTERNAL_LINEINFO, \
- [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
-
-// end catch_generators.hpp
-// start catch_generators_generic.hpp
-
-namespace Catch {
-namespace Generators {
-
- template <typename T>
- class TakeGenerator : public IGenerator<T> {
- GeneratorWrapper<T> m_generator;
- size_t m_returned = 0;
- size_t m_target;
- public:
- TakeGenerator(size_t target, GeneratorWrapper<T>&& generator):
- m_generator(std::move(generator)),
- m_target(target)
- {
- assert(target != 0 && "Empty generators are not allowed");
- }
- T const& get() const override {
- return m_generator.get();
- }
- bool next() override {
- ++m_returned;
- if (m_returned >= m_target) {
- return false;
- }
-
- const auto success = m_generator.next();
- // If the underlying generator does not contain enough values
- // then we cut short as well
- if (!success) {
- m_returned = m_target;
- }
- return success;
- }
- };
-
- template <typename T>
- GeneratorWrapper<T> take(size_t target, GeneratorWrapper<T>&& generator) {
- return GeneratorWrapper<T>(pf::make_unique<TakeGenerator<T>>(target, std::move(generator)));
- }
-
- template <typename T, typename Predicate>
- class FilterGenerator : public IGenerator<T> {
- GeneratorWrapper<T> m_generator;
- Predicate m_predicate;
- public:
- template <typename P = Predicate>
- FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator):
- m_generator(std::move(generator)),
- m_predicate(std::forward<P>(pred))
- {
- if (!m_predicate(m_generator.get())) {
- // It might happen that there are no values that pass the
- // filter. In that case we throw an exception.
- auto has_initial_value = next();
- if (!has_initial_value) {
- Catch::throw_exception(GeneratorException("No valid value found in filtered generator"));
- }
- }
- }
-
- T const& get() const override {
- return m_generator.get();
- }
-
- bool next() override {
- bool success = m_generator.next();
- if (!success) {
- return false;
- }
- while (!m_predicate(m_generator.get()) && (success = m_generator.next()) == true);
- return success;
- }
- };
-
- template <typename T, typename Predicate>
- GeneratorWrapper<T> filter(Predicate&& pred, GeneratorWrapper<T>&& generator) {
- return GeneratorWrapper<T>(std::unique_ptr<IGenerator<T>>(pf::make_unique<FilterGenerator<T, Predicate>>(std::forward<Predicate>(pred), std::move(generator))));
- }
-
- template <typename T>
- class RepeatGenerator : public IGenerator<T> {
- static_assert(!std::is_same<T, bool>::value,
- "RepeatGenerator currently does not support bools"
- "because of std::vector<bool> specialization");
- GeneratorWrapper<T> m_generator;
- mutable std::vector<T> m_returned;
- size_t m_target_repeats;
- size_t m_current_repeat = 0;
- size_t m_repeat_index = 0;
- public:
- RepeatGenerator(size_t repeats, GeneratorWrapper<T>&& generator):
- m_generator(std::move(generator)),
- m_target_repeats(repeats)
- {
- assert(m_target_repeats > 0 && "Repeat generator must repeat at least once");
- }
-
- T const& get() const override {
- if (m_current_repeat == 0) {
- m_returned.push_back(m_generator.get());
- return m_returned.back();
- }
- return m_returned[m_repeat_index];
- }
-
- bool next() override {
- // There are 2 basic cases:
- // 1) We are still reading the generator
- // 2) We are reading our own cache
-
- // In the first case, we need to poke the underlying generator.
- // If it happily moves, we are left in that state, otherwise it is time to start reading from our cache
- if (m_current_repeat == 0) {
- const auto success = m_generator.next();
- if (!success) {
- ++m_current_repeat;
- }
- return m_current_repeat < m_target_repeats;
- }
-
- // In the second case, we need to move indices forward and check that we haven't run up against the end
- ++m_repeat_index;
- if (m_repeat_index == m_returned.size()) {
- m_repeat_index = 0;
- ++m_current_repeat;
- }
- return m_current_repeat < m_target_repeats;
- }
- };
-
- template <typename T>
- GeneratorWrapper<T> repeat(size_t repeats, GeneratorWrapper<T>&& generator) {
- return GeneratorWrapper<T>(pf::make_unique<RepeatGenerator<T>>(repeats, std::move(generator)));
- }
-
- template <typename T, typename U, typename Func>
- class MapGenerator : public IGenerator<T> {
- // TBD: provide static assert for mapping function, for friendly error message
- GeneratorWrapper<U> m_generator;
- Func m_function;
- // To avoid returning dangling reference, we have to save the values
- T m_cache;
- public:
- template <typename F2 = Func>
- MapGenerator(F2&& function, GeneratorWrapper<U>&& generator) :
- m_generator(std::move(generator)),
- m_function(std::forward<F2>(function)),
- m_cache(m_function(m_generator.get()))
- {}
-
- T const& get() const override {
- return m_cache;
- }
- bool next() override {
- const auto success = m_generator.next();
- if (success) {
- m_cache = m_function(m_generator.get());
- }
- return success;
- }
- };
-
- template <typename Func, typename U, typename T = FunctionReturnType<Func, U>>
- GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) {
- return GeneratorWrapper<T>(
- pf::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator))
- );
- }
-
- template <typename T, typename U, typename Func>
- GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) {
- return GeneratorWrapper<T>(
- pf::make_unique<MapGenerator<T, U, Func>>(std::forward<Func>(function), std::move(generator))
- );
- }
-
- template <typename T>
- class ChunkGenerator final : public IGenerator<std::vector<T>> {
- std::vector<T> m_chunk;
- size_t m_chunk_size;
- GeneratorWrapper<T> m_generator;
- bool m_used_up = false;
- public:
- ChunkGenerator(size_t size, GeneratorWrapper<T> generator) :
- m_chunk_size(size), m_generator(std::move(generator))
- {
- m_chunk.reserve(m_chunk_size);
- if (m_chunk_size != 0) {
- m_chunk.push_back(m_generator.get());
- for (size_t i = 1; i < m_chunk_size; ++i) {
- if (!m_generator.next()) {
- Catch::throw_exception(GeneratorException("Not enough values to initialize the first chunk"));
- }
- m_chunk.push_back(m_generator.get());
- }
- }
- }
- std::vector<T> const& get() const override {
- return m_chunk;
- }
- bool next() override {
- m_chunk.clear();
- for (size_t idx = 0; idx < m_chunk_size; ++idx) {
- if (!m_generator.next()) {
- return false;
- }
- m_chunk.push_back(m_generator.get());
- }
- return true;
- }
- };
-
- template <typename T>
- GeneratorWrapper<std::vector<T>> chunk(size_t size, GeneratorWrapper<T>&& generator) {
- return GeneratorWrapper<std::vector<T>>(
- pf::make_unique<ChunkGenerator<T>>(size, std::move(generator))
- );
- }
-
-} // namespace Generators
-} // namespace Catch
-
-// end catch_generators_generic.hpp
-// start catch_generators_specific.hpp
-
-// start catch_context.h
-
-#include <memory>
-
-namespace Catch {
-
- struct IResultCapture;
- struct IRunner;
- struct IConfig;
- struct IMutableContext;
-
- using IConfigPtr = std::shared_ptr<IConfig const>;
-
- struct IContext
- {
- virtual ~IContext();
-
- virtual IResultCapture* getResultCapture() = 0;
- virtual IRunner* getRunner() = 0;
- virtual IConfigPtr const& getConfig() const = 0;
- };
-
- struct IMutableContext : IContext
- {
- virtual ~IMutableContext();
- virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
- virtual void setRunner( IRunner* runner ) = 0;
- virtual void setConfig( IConfigPtr const& config ) = 0;
-
- private:
- static IMutableContext *currentContext;
- friend IMutableContext& getCurrentMutableContext();
- friend void cleanUpContext();
- static void createContext();
- };
-
- inline IMutableContext& getCurrentMutableContext()
- {
- if( !IMutableContext::currentContext )
- IMutableContext::createContext();
- // NOLINTNEXTLINE(clang-analyzer-core.uninitialized.UndefReturn)
- return *IMutableContext::currentContext;
- }
-
- inline IContext& getCurrentContext()
- {
- return getCurrentMutableContext();
- }
-
- void cleanUpContext();
-
- class SimplePcg32;
- SimplePcg32& rng();
-}
-
-// end catch_context.h
-// start catch_interfaces_config.h
-
-// start catch_option.hpp
-
-namespace Catch {
-
- // An optional type
- template<typename T>
- class Option {
- public:
- Option() : nullableValue( nullptr ) {}
- Option( T const& _value )
- : nullableValue( new( storage ) T( _value ) )
- {}
- Option( Option const& _other )
- : nullableValue( _other ? new( storage ) T( *_other ) : nullptr )
- {}
-
- ~Option() {
- reset();
- }
-
- Option& operator= ( Option const& _other ) {
- if( &_other != this ) {
- reset();
- if( _other )
- nullableValue = new( storage ) T( *_other );
- }
- return *this;
- }
- Option& operator = ( T const& _value ) {
- reset();
- nullableValue = new( storage ) T( _value );
- return *this;
- }
-
- void reset() {
- if( nullableValue )
- nullableValue->~T();
- nullableValue = nullptr;
- }
-
- T& operator*() { return *nullableValue; }
- T const& operator*() const { return *nullableValue; }
- T* operator->() { return nullableValue; }
- const T* operator->() const { return nullableValue; }
-
- T valueOr( T const& defaultValue ) const {
- return nullableValue ? *nullableValue : defaultValue;
- }
-
- bool some() const { return nullableValue != nullptr; }
- bool none() const { return nullableValue == nullptr; }
-
- bool operator !() const { return nullableValue == nullptr; }
- explicit operator bool() const {
- return some();
- }
-
- private:
- T *nullableValue;
- alignas(alignof(T)) char storage[sizeof(T)];
- };
-
-} // end namespace Catch
-
-// end catch_option.hpp
-#include <chrono>
-#include <iosfwd>
-#include <string>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- enum class Verbosity {
- Quiet = 0,
- Normal,
- High
- };
-
- struct WarnAbout { enum What {
- Nothing = 0x00,
- NoAssertions = 0x01,
- NoTests = 0x02
- }; };
-
- struct ShowDurations { enum OrNot {
- DefaultForReporter,
- Always,
- Never
- }; };
- struct RunTests { enum InWhatOrder {
- InDeclarationOrder,
- InLexicographicalOrder,
- InRandomOrder
- }; };
- struct UseColour { enum YesOrNo {
- Auto,
- Yes,
- No
- }; };
- struct WaitForKeypress { enum When {
- Never,
- BeforeStart = 1,
- BeforeExit = 2,
- BeforeStartAndExit = BeforeStart | BeforeExit
- }; };
-
- class TestSpec;
-
- struct IConfig : NonCopyable {
-
- virtual ~IConfig();
-
- virtual bool allowThrows() const = 0;
- virtual std::ostream& stream() const = 0;
- virtual std::string name() const = 0;
- virtual bool includeSuccessfulResults() const = 0;
- virtual bool shouldDebugBreak() const = 0;
- virtual bool warnAboutMissingAssertions() const = 0;
- virtual bool warnAboutNoTests() const = 0;
- virtual int abortAfter() const = 0;
- virtual bool showInvisibles() const = 0;
- virtual ShowDurations::OrNot showDurations() const = 0;
- virtual double minDuration() const = 0;
- virtual TestSpec const& testSpec() const = 0;
- virtual bool hasTestFilters() const = 0;
- virtual std::vector<std::string> const& getTestsOrTags() const = 0;
- virtual RunTests::InWhatOrder runOrder() const = 0;
- virtual unsigned int rngSeed() const = 0;
- virtual UseColour::YesOrNo useColour() const = 0;
- virtual std::vector<std::string> const& getSectionsToRun() const = 0;
- virtual Verbosity verbosity() const = 0;
-
- virtual bool benchmarkNoAnalysis() const = 0;
- virtual int benchmarkSamples() const = 0;
- virtual double benchmarkConfidenceInterval() const = 0;
- virtual unsigned int benchmarkResamples() const = 0;
- virtual std::chrono::milliseconds benchmarkWarmupTime() const = 0;
- };
-
- using IConfigPtr = std::shared_ptr<IConfig const>;
-}
-
-// end catch_interfaces_config.h
-// start catch_random_number_generator.h
-
-#include <cstdint>
-
-namespace Catch {
-
- // This is a simple implementation of C++11 Uniform Random Number
- // Generator. It does not provide all operators, because Catch2
- // does not use it, but it should behave as expected inside stdlib's
- // distributions.
- // The implementation is based on the PCG family (http://pcg-random.org)
- class SimplePcg32 {
- using state_type = std::uint64_t;
- public:
- using result_type = std::uint32_t;
- static constexpr result_type (min)() {
- return 0;
- }
- static constexpr result_type (max)() {
- return static_cast<result_type>(-1);
- }
-
- // Provide some default initial state for the default constructor
- SimplePcg32():SimplePcg32(0xed743cc4U) {}
-
- explicit SimplePcg32(result_type seed_);
-
- void seed(result_type seed_);
- void discard(uint64_t skip);
-
- result_type operator()();
-
- private:
- friend bool operator==(SimplePcg32 const& lhs, SimplePcg32 const& rhs);
- friend bool operator!=(SimplePcg32 const& lhs, SimplePcg32 const& rhs);
-
- // In theory we also need operator<< and operator>>
- // In practice we do not use them, so we will skip them for now
-
- std::uint64_t m_state;
- // This part of the state determines which "stream" of the numbers
- // is chosen -- we take it as a constant for Catch2, so we only
- // need to deal with seeding the main state.
- // Picked by reading 8 bytes from `/dev/random` :-)
- static const std::uint64_t s_inc = (0x13ed0cc53f939476ULL << 1ULL) | 1ULL;
- };
-
-} // end namespace Catch
-
-// end catch_random_number_generator.h
-#include <random>
-
-namespace Catch {
-namespace Generators {
-
-template <typename Float>
-class RandomFloatingGenerator final : public IGenerator<Float> {
- Catch::SimplePcg32& m_rng;
- std::uniform_real_distribution<Float> m_dist;
- Float m_current_number;
-public:
-
- RandomFloatingGenerator(Float a, Float b):
- m_rng(rng()),
- m_dist(a, b) {
- static_cast<void>(next());
- }
-
- Float const& get() const override {
- return m_current_number;
- }
- bool next() override {
- m_current_number = m_dist(m_rng);
- return true;
- }
-};
-
-template <typename Integer>
-class RandomIntegerGenerator final : public IGenerator<Integer> {
- Catch::SimplePcg32& m_rng;
- std::uniform_int_distribution<Integer> m_dist;
- Integer m_current_number;
-public:
-
- RandomIntegerGenerator(Integer a, Integer b):
- m_rng(rng()),
- m_dist(a, b) {
- static_cast<void>(next());
- }
-
- Integer const& get() const override {
- return m_current_number;
- }
- bool next() override {
- m_current_number = m_dist(m_rng);
- return true;
- }
-};
-
-// TODO: Ideally this would be also constrained against the various char types,
-// but I don't expect users to run into that in practice.
-template <typename T>
-typename std::enable_if<std::is_integral<T>::value && !std::is_same<T, bool>::value,
-GeneratorWrapper<T>>::type
-random(T a, T b) {
- return GeneratorWrapper<T>(
- pf::make_unique<RandomIntegerGenerator<T>>(a, b)
- );
-}
-
-template <typename T>
-typename std::enable_if<std::is_floating_point<T>::value,
-GeneratorWrapper<T>>::type
-random(T a, T b) {
- return GeneratorWrapper<T>(
- pf::make_unique<RandomFloatingGenerator<T>>(a, b)
- );
-}
-
-template <typename T>
-class RangeGenerator final : public IGenerator<T> {
- T m_current;
- T m_end;
- T m_step;
- bool m_positive;
-
-public:
- RangeGenerator(T const& start, T const& end, T const& step):
- m_current(start),
- m_end(end),
- m_step(step),
- m_positive(m_step > T(0))
- {
- assert(m_current != m_end && "Range start and end cannot be equal");
- assert(m_step != T(0) && "Step size cannot be zero");
- assert(((m_positive && m_current <= m_end) || (!m_positive && m_current >= m_end)) && "Step moves away from end");
- }
-
- RangeGenerator(T const& start, T const& end):
- RangeGenerator(start, end, (start < end) ? T(1) : T(-1))
- {}
-
- T const& get() const override {
- return m_current;
- }
-
- bool next() override {
- m_current += m_step;
- return (m_positive) ? (m_current < m_end) : (m_current > m_end);
- }
-};
-
-template <typename T>
-GeneratorWrapper<T> range(T const& start, T const& end, T const& step) {
- static_assert(std::is_arithmetic<T>::value && !std::is_same<T, bool>::value, "Type must be numeric");
- return GeneratorWrapper<T>(pf::make_unique<RangeGenerator<T>>(start, end, step));
-}
-
-template <typename T>
-GeneratorWrapper<T> range(T const& start, T const& end) {
- static_assert(std::is_integral<T>::value && !std::is_same<T, bool>::value, "Type must be an integer");
- return GeneratorWrapper<T>(pf::make_unique<RangeGenerator<T>>(start, end));
-}
-
-template <typename T>
-class IteratorGenerator final : public IGenerator<T> {
- static_assert(!std::is_same<T, bool>::value,
- "IteratorGenerator currently does not support bools"
- "because of std::vector<bool> specialization");
-
- std::vector<T> m_elems;
- size_t m_current = 0;
-public:
- template <typename InputIterator, typename InputSentinel>
- IteratorGenerator(InputIterator first, InputSentinel last):m_elems(first, last) {
- if (m_elems.empty()) {
- Catch::throw_exception(GeneratorException("IteratorGenerator received no valid values"));
- }
- }
-
- T const& get() const override {
- return m_elems[m_current];
- }
-
- bool next() override {
- ++m_current;
- return m_current != m_elems.size();
- }
-};
-
-template <typename InputIterator,
- typename InputSentinel,
- typename ResultType = typename std::iterator_traits<InputIterator>::value_type>
-GeneratorWrapper<ResultType> from_range(InputIterator from, InputSentinel to) {
- return GeneratorWrapper<ResultType>(pf::make_unique<IteratorGenerator<ResultType>>(from, to));
-}
-
-template <typename Container,
- typename ResultType = typename Container::value_type>
-GeneratorWrapper<ResultType> from_range(Container const& cnt) {
- return GeneratorWrapper<ResultType>(pf::make_unique<IteratorGenerator<ResultType>>(cnt.begin(), cnt.end()));
-}
-
-} // namespace Generators
-} // namespace Catch
-
-// end catch_generators_specific.hpp
-
-// These files are included here so the single_include script doesn't put them
-// in the conditionally compiled sections
-// start catch_test_case_info.h
-
-#include <string>
-#include <vector>
-#include <memory>
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-namespace Catch {
-
- struct ITestInvoker;
-
- struct TestCaseInfo {
- enum SpecialProperties{
- None = 0,
- IsHidden = 1 << 1,
- ShouldFail = 1 << 2,
- MayFail = 1 << 3,
- Throws = 1 << 4,
- NonPortable = 1 << 5,
- Benchmark = 1 << 6
- };
-
- TestCaseInfo( std::string const& _name,
- std::string const& _className,
- std::string const& _description,
- std::vector<std::string> const& _tags,
- SourceLineInfo const& _lineInfo );
-
- friend void setTags( TestCaseInfo& testCaseInfo, std::vector<std::string> tags );
-
- bool isHidden() const;
- bool throws() const;
- bool okToFail() const;
- bool expectedToFail() const;
-
- std::string tagsAsString() const;
-
- std::string name;
- std::string className;
- std::string description;
- std::vector<std::string> tags;
- std::vector<std::string> lcaseTags;
- SourceLineInfo lineInfo;
- SpecialProperties properties;
- };
-
- class TestCase : public TestCaseInfo {
- public:
-
- TestCase( ITestInvoker* testCase, TestCaseInfo&& info );
-
- TestCase withName( std::string const& _newName ) const;
-
- void invoke() const;
-
- TestCaseInfo const& getTestCaseInfo() const;
-
- bool operator == ( TestCase const& other ) const;
- bool operator < ( TestCase const& other ) const;
-
- private:
- std::shared_ptr<ITestInvoker> test;
- };
-
- TestCase makeTestCase( ITestInvoker* testCase,
- std::string const& className,
- NameAndTags const& nameAndTags,
- SourceLineInfo const& lineInfo );
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-// end catch_test_case_info.h
-// start catch_interfaces_runner.h
-
-namespace Catch {
-
- struct IRunner {
- virtual ~IRunner();
- virtual bool aborting() const = 0;
- };
-}
-
-// end catch_interfaces_runner.h
-
-#ifdef __OBJC__
-// start catch_objc.hpp
-
-#import <objc/runtime.h>
-
-#include <string>
-
-// NB. Any general catch headers included here must be included
-// in catch.hpp first to make sure they are included by the single
-// header for non obj-usage
-
-///////////////////////////////////////////////////////////////////////////////
-// This protocol is really only here for (self) documenting purposes, since
-// all its methods are optional.
-@protocol OcFixture
-
-@optional
-
--(void) setUp;
--(void) tearDown;
-
-@end
-
-namespace Catch {
-
- class OcMethod : public ITestInvoker {
-
- public:
- OcMethod( Class cls, SEL sel ) : m_cls( cls ), m_sel( sel ) {}
-
- virtual void invoke() const {
- id obj = [[m_cls alloc] init];
-
- performOptionalSelector( obj, @selector(setUp) );
- performOptionalSelector( obj, m_sel );
- performOptionalSelector( obj, @selector(tearDown) );
-
- arcSafeRelease( obj );
- }
- private:
- virtual ~OcMethod() {}
-
- Class m_cls;
- SEL m_sel;
- };
-
- namespace Detail{
-
- inline std::string getAnnotation( Class cls,
- std::string const& annotationName,
- std::string const& testCaseName ) {
- NSString* selStr = [[NSString alloc] initWithFormat:@"Catch_%s_%s", annotationName.c_str(), testCaseName.c_str()];
- SEL sel = NSSelectorFromString( selStr );
- arcSafeRelease( selStr );
- id value = performOptionalSelector( cls, sel );
- if( value )
- return [(NSString*)value UTF8String];
- return "";
- }
- }
-
- inline std::size_t registerTestMethods() {
- std::size_t noTestMethods = 0;
- int noClasses = objc_getClassList( nullptr, 0 );
-
- Class* classes = (CATCH_UNSAFE_UNRETAINED Class *)malloc( sizeof(Class) * noClasses);
- objc_getClassList( classes, noClasses );
-
- for( int c = 0; c < noClasses; c++ ) {
- Class cls = classes[c];
- {
- u_int count;
- Method* methods = class_copyMethodList( cls, &count );
- for( u_int m = 0; m < count ; m++ ) {
- SEL selector = method_getName(methods[m]);
- std::string methodName = sel_getName(selector);
- if( startsWith( methodName, "Catch_TestCase_" ) ) {
- std::string testCaseName = methodName.substr( 15 );
- std::string name = Detail::getAnnotation( cls, "Name", testCaseName );
- std::string desc = Detail::getAnnotation( cls, "Description", testCaseName );
- const char* className = class_getName( cls );
-
- getMutableRegistryHub().registerTest( makeTestCase( new OcMethod( cls, selector ), className, NameAndTags( name.c_str(), desc.c_str() ), SourceLineInfo("",0) ) );
- noTestMethods++;
- }
- }
- free(methods);
- }
- }
- return noTestMethods;
- }
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-
- namespace Matchers {
- namespace Impl {
- namespace NSStringMatchers {
-
- struct StringHolder : MatcherBase<NSString*>{
- StringHolder( NSString* substr ) : m_substr( [substr copy] ){}
- StringHolder( StringHolder const& other ) : m_substr( [other.m_substr copy] ){}
- StringHolder() {
- arcSafeRelease( m_substr );
- }
-
- bool match( NSString* str ) const override {
- return false;
- }
-
- NSString* CATCH_ARC_STRONG m_substr;
- };
-
- struct Equals : StringHolder {
- Equals( NSString* substr ) : StringHolder( substr ){}
-
- bool match( NSString* str ) const override {
- return (str != nil || m_substr == nil ) &&
- [str isEqualToString:m_substr];
- }
-
- std::string describe() const override {
- return "equals string: " + Catch::Detail::stringify( m_substr );
- }
- };
-
- struct Contains : StringHolder {
- Contains( NSString* substr ) : StringHolder( substr ){}
-
- bool match( NSString* str ) const override {
- return (str != nil || m_substr == nil ) &&
- [str rangeOfString:m_substr].location != NSNotFound;
- }
-
- std::string describe() const override {
- return "contains string: " + Catch::Detail::stringify( m_substr );
- }
- };
-
- struct StartsWith : StringHolder {
- StartsWith( NSString* substr ) : StringHolder( substr ){}
-
- bool match( NSString* str ) const override {
- return (str != nil || m_substr == nil ) &&
- [str rangeOfString:m_substr].location == 0;
- }
-
- std::string describe() const override {
- return "starts with: " + Catch::Detail::stringify( m_substr );
- }
- };
- struct EndsWith : StringHolder {
- EndsWith( NSString* substr ) : StringHolder( substr ){}
-
- bool match( NSString* str ) const override {
- return (str != nil || m_substr == nil ) &&
- [str rangeOfString:m_substr].location == [str length] - [m_substr length];
- }
-
- std::string describe() const override {
- return "ends with: " + Catch::Detail::stringify( m_substr );
- }
- };
-
- } // namespace NSStringMatchers
- } // namespace Impl
-
- inline Impl::NSStringMatchers::Equals
- Equals( NSString* substr ){ return Impl::NSStringMatchers::Equals( substr ); }
-
- inline Impl::NSStringMatchers::Contains
- Contains( NSString* substr ){ return Impl::NSStringMatchers::Contains( substr ); }
-
- inline Impl::NSStringMatchers::StartsWith
- StartsWith( NSString* substr ){ return Impl::NSStringMatchers::StartsWith( substr ); }
-
- inline Impl::NSStringMatchers::EndsWith
- EndsWith( NSString* substr ){ return Impl::NSStringMatchers::EndsWith( substr ); }
-
- } // namespace Matchers
-
- using namespace Matchers;
-
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-} // namespace Catch
-
-///////////////////////////////////////////////////////////////////////////////
-#define OC_MAKE_UNIQUE_NAME( root, uniqueSuffix ) root##uniqueSuffix
-#define OC_TEST_CASE2( name, desc, uniqueSuffix ) \
-+(NSString*) OC_MAKE_UNIQUE_NAME( Catch_Name_test_, uniqueSuffix ) \
-{ \
-return @ name; \
-} \
-+(NSString*) OC_MAKE_UNIQUE_NAME( Catch_Description_test_, uniqueSuffix ) \
-{ \
-return @ desc; \
-} \
--(void) OC_MAKE_UNIQUE_NAME( Catch_TestCase_test_, uniqueSuffix )
-
-#define OC_TEST_CASE( name, desc ) OC_TEST_CASE2( name, desc, __LINE__ )
-
-// end catch_objc.hpp
-#endif
-
-// Benchmarking needs the externally-facing parts of reporters to work
-#if defined(CATCH_CONFIG_EXTERNAL_INTERFACES) || defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-// start catch_external_interfaces.h
-
-// start catch_reporter_bases.hpp
-
-// start catch_interfaces_reporter.h
-
-// start catch_config.hpp
-
-// start catch_test_spec_parser.h
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-// start catch_test_spec.h
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wpadded"
-#endif
-
-// start catch_wildcard_pattern.h
-
-namespace Catch
-{
- class WildcardPattern {
- enum WildcardPosition {
- NoWildcard = 0,
- WildcardAtStart = 1,
- WildcardAtEnd = 2,
- WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd
- };
-
- public:
-
- WildcardPattern( std::string const& pattern, CaseSensitive::Choice caseSensitivity );
- virtual ~WildcardPattern() = default;
- virtual bool matches( std::string const& str ) const;
-
- private:
- std::string normaliseString( std::string const& str ) const;
- CaseSensitive::Choice m_caseSensitivity;
- WildcardPosition m_wildcard = NoWildcard;
- std::string m_pattern;
- };
-}
-
-// end catch_wildcard_pattern.h
-#include <string>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- struct IConfig;
-
- class TestSpec {
- class Pattern {
- public:
- explicit Pattern( std::string const& name );
- virtual ~Pattern();
- virtual bool matches( TestCaseInfo const& testCase ) const = 0;
- std::string const& name() const;
- private:
- std::string const m_name;
- };
- using PatternPtr = std::shared_ptr<Pattern>;
-
- class NamePattern : public Pattern {
- public:
- explicit NamePattern( std::string const& name, std::string const& filterString );
- bool matches( TestCaseInfo const& testCase ) const override;
- private:
- WildcardPattern m_wildcardPattern;
- };
-
- class TagPattern : public Pattern {
- public:
- explicit TagPattern( std::string const& tag, std::string const& filterString );
- bool matches( TestCaseInfo const& testCase ) const override;
- private:
- std::string m_tag;
- };
-
- class ExcludedPattern : public Pattern {
- public:
- explicit ExcludedPattern( PatternPtr const& underlyingPattern );
- bool matches( TestCaseInfo const& testCase ) const override;
- private:
- PatternPtr m_underlyingPattern;
- };
-
- struct Filter {
- std::vector<PatternPtr> m_patterns;
-
- bool matches( TestCaseInfo const& testCase ) const;
- std::string name() const;
- };
-
- public:
- struct FilterMatch {
- std::string name;
- std::vector<TestCase const*> tests;
- };
- using Matches = std::vector<FilterMatch>;
- using vectorStrings = std::vector<std::string>;
-
- bool hasFilters() const;
- bool matches( TestCaseInfo const& testCase ) const;
- Matches matchesByFilter( std::vector<TestCase> const& testCases, IConfig const& config ) const;
- const vectorStrings & getInvalidArgs() const;
-
- private:
- std::vector<Filter> m_filters;
- std::vector<std::string> m_invalidArgs;
- friend class TestSpecParser;
- };
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-// end catch_test_spec.h
-// start catch_interfaces_tag_alias_registry.h
-
-#include <string>
-
-namespace Catch {
-
- struct TagAlias;
-
- struct ITagAliasRegistry {
- virtual ~ITagAliasRegistry();
- // Nullptr if not present
- virtual TagAlias const* find( std::string const& alias ) const = 0;
- virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0;
-
- static ITagAliasRegistry const& get();
- };
-
-} // end namespace Catch
-
-// end catch_interfaces_tag_alias_registry.h
-namespace Catch {
-
- class TestSpecParser {
- enum Mode{ None, Name, QuotedName, Tag, EscapedName };
- Mode m_mode = None;
- Mode lastMode = None;
- bool m_exclusion = false;
- std::size_t m_pos = 0;
- std::size_t m_realPatternPos = 0;
- std::string m_arg;
- std::string m_substring;
- std::string m_patternName;
- std::vector<std::size_t> m_escapeChars;
- TestSpec::Filter m_currentFilter;
- TestSpec m_testSpec;
- ITagAliasRegistry const* m_tagAliases = nullptr;
-
- public:
- TestSpecParser( ITagAliasRegistry const& tagAliases );
-
- TestSpecParser& parse( std::string const& arg );
- TestSpec testSpec();
-
- private:
- bool visitChar( char c );
- void startNewMode( Mode mode );
- bool processNoneChar( char c );
- void processNameChar( char c );
- bool processOtherChar( char c );
- void endMode();
- void escape();
- bool isControlChar( char c ) const;
- void saveLastMode();
- void revertBackToLastMode();
- void addFilter();
- bool separate();
-
- // Handles common preprocessing of the pattern for name/tag patterns
- std::string preprocessPattern();
- // Adds the current pattern as a test name
- void addNamePattern();
- // Adds the current pattern as a tag
- void addTagPattern();
-
- inline void addCharToPattern(char c) {
- m_substring += c;
- m_patternName += c;
- m_realPatternPos++;
- }
-
- };
- TestSpec parseTestSpec( std::string const& arg );
-
-} // namespace Catch
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-// end catch_test_spec_parser.h
-// Libstdc++ doesn't like incomplete classes for unique_ptr
-
-#include <memory>
-#include <vector>
-#include <string>
-
-#ifndef CATCH_CONFIG_CONSOLE_WIDTH
-#define CATCH_CONFIG_CONSOLE_WIDTH 80
-#endif
-
-namespace Catch {
-
- struct IStream;
-
- struct ConfigData {
- bool listTests = false;
- bool listTags = false;
- bool listReporters = false;
- bool listTestNamesOnly = false;
-
- bool showSuccessfulTests = false;
- bool shouldDebugBreak = false;
- bool noThrow = false;
- bool showHelp = false;
- bool showInvisibles = false;
- bool filenamesAsTags = false;
- bool libIdentify = false;
-
- int abortAfter = -1;
- unsigned int rngSeed = 0;
-
- bool benchmarkNoAnalysis = false;
- unsigned int benchmarkSamples = 100;
- double benchmarkConfidenceInterval = 0.95;
- unsigned int benchmarkResamples = 100000;
- std::chrono::milliseconds::rep benchmarkWarmupTime = 100;
-
- Verbosity verbosity = Verbosity::Normal;
- WarnAbout::What warnings = WarnAbout::Nothing;
- ShowDurations::OrNot showDurations = ShowDurations::DefaultForReporter;
- double minDuration = -1;
- RunTests::InWhatOrder runOrder = RunTests::InDeclarationOrder;
- UseColour::YesOrNo useColour = UseColour::Auto;
- WaitForKeypress::When waitForKeypress = WaitForKeypress::Never;
-
- std::string outputFilename;
- std::string name;
- std::string processName;
-#ifndef CATCH_CONFIG_DEFAULT_REPORTER
-#define CATCH_CONFIG_DEFAULT_REPORTER "console"
-#endif
- std::string reporterName = CATCH_CONFIG_DEFAULT_REPORTER;
-#undef CATCH_CONFIG_DEFAULT_REPORTER
-
- std::vector<std::string> testsOrTags;
- std::vector<std::string> sectionsToRun;
- };
-
- class Config : public IConfig {
- public:
-
- Config() = default;
- Config( ConfigData const& data );
- virtual ~Config() = default;
-
- std::string const& getFilename() const;
-
- bool listTests() const;
- bool listTestNamesOnly() const;
- bool listTags() const;
- bool listReporters() const;
-
- std::string getProcessName() const;
- std::string const& getReporterName() const;
-
- std::vector<std::string> const& getTestsOrTags() const override;
- std::vector<std::string> const& getSectionsToRun() const override;
-
- TestSpec const& testSpec() const override;
- bool hasTestFilters() const override;
-
- bool showHelp() const;
-
- // IConfig interface
- bool allowThrows() const override;
- std::ostream& stream() const override;
- std::string name() const override;
- bool includeSuccessfulResults() const override;
- bool warnAboutMissingAssertions() const override;
- bool warnAboutNoTests() const override;
- ShowDurations::OrNot showDurations() const override;
- double minDuration() const override;
- RunTests::InWhatOrder runOrder() const override;
- unsigned int rngSeed() const override;
- UseColour::YesOrNo useColour() const override;
- bool shouldDebugBreak() const override;
- int abortAfter() const override;
- bool showInvisibles() const override;
- Verbosity verbosity() const override;
- bool benchmarkNoAnalysis() const override;
- int benchmarkSamples() const override;
- double benchmarkConfidenceInterval() const override;
- unsigned int benchmarkResamples() const override;
- std::chrono::milliseconds benchmarkWarmupTime() const override;
-
- private:
-
- IStream const* openStream();
- ConfigData m_data;
-
- std::unique_ptr<IStream const> m_stream;
- TestSpec m_testSpec;
- bool m_hasTestFilters = false;
- };
-
-} // end namespace Catch
-
-// end catch_config.hpp
-// start catch_assertionresult.h
-
-#include <string>
-
-namespace Catch {
-
- struct AssertionResultData
- {
- AssertionResultData() = delete;
-
- AssertionResultData( ResultWas::OfType _resultType, LazyExpression const& _lazyExpression );
-
- std::string message;
- mutable std::string reconstructedExpression;
- LazyExpression lazyExpression;
- ResultWas::OfType resultType;
-
- std::string reconstructExpression() const;
- };
-
- class AssertionResult {
- public:
- AssertionResult() = delete;
- AssertionResult( AssertionInfo const& info, AssertionResultData const& data );
-
- bool isOk() const;
- bool succeeded() const;
- ResultWas::OfType getResultType() const;
- bool hasExpression() const;
- bool hasMessage() const;
- std::string getExpression() const;
- std::string getExpressionInMacro() const;
- bool hasExpandedExpression() const;
- std::string getExpandedExpression() const;
- std::string getMessage() const;
- SourceLineInfo getSourceInfo() const;
- StringRef getTestMacroName() const;
-
- //protected:
- AssertionInfo m_info;
- AssertionResultData m_resultData;
- };
-
-} // end namespace Catch
-
-// end catch_assertionresult.h
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-// start catch_estimate.hpp
-
- // Statistics estimates
-
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration>
- struct Estimate {
- Duration point;
- Duration lower_bound;
- Duration upper_bound;
- double confidence_interval;
-
- template <typename Duration2>
- operator Estimate<Duration2>() const {
- return { point, lower_bound, upper_bound, confidence_interval };
- }
- };
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_estimate.hpp
-// start catch_outlier_classification.hpp
-
-// Outlier information
-
-namespace Catch {
- namespace Benchmark {
- struct OutlierClassification {
- int samples_seen = 0;
- int low_severe = 0; // more than 3 times IQR below Q1
- int low_mild = 0; // 1.5 to 3 times IQR below Q1
- int high_mild = 0; // 1.5 to 3 times IQR above Q3
- int high_severe = 0; // more than 3 times IQR above Q3
-
- int total() const {
- return low_severe + low_mild + high_mild + high_severe;
- }
- };
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_outlier_classification.hpp
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
-#include <string>
-#include <iosfwd>
-#include <map>
-#include <set>
-#include <memory>
-#include <algorithm>
-
-namespace Catch {
-
- struct ReporterConfig {
- explicit ReporterConfig( IConfigPtr const& _fullConfig );
-
- ReporterConfig( IConfigPtr const& _fullConfig, std::ostream& _stream );
-
- std::ostream& stream() const;
- IConfigPtr fullConfig() const;
-
- private:
- std::ostream* m_stream;
- IConfigPtr m_fullConfig;
- };
-
- struct ReporterPreferences {
- bool shouldRedirectStdOut = false;
- bool shouldReportAllAssertions = false;
- };
-
- template<typename T>
- struct LazyStat : Option<T> {
- LazyStat& operator=( T const& _value ) {
- Option<T>::operator=( _value );
- used = false;
- return *this;
- }
- void reset() {
- Option<T>::reset();
- used = false;
- }
- bool used = false;
- };
-
- struct TestRunInfo {
- TestRunInfo( std::string const& _name );
- std::string name;
- };
- struct GroupInfo {
- GroupInfo( std::string const& _name,
- std::size_t _groupIndex,
- std::size_t _groupsCount );
-
- std::string name;
- std::size_t groupIndex;
- std::size_t groupsCounts;
- };
-
- struct AssertionStats {
- AssertionStats( AssertionResult const& _assertionResult,
- std::vector<MessageInfo> const& _infoMessages,
- Totals const& _totals );
-
- AssertionStats( AssertionStats const& ) = default;
- AssertionStats( AssertionStats && ) = default;
- AssertionStats& operator = ( AssertionStats const& ) = delete;
- AssertionStats& operator = ( AssertionStats && ) = delete;
- virtual ~AssertionStats();
-
- AssertionResult assertionResult;
- std::vector<MessageInfo> infoMessages;
- Totals totals;
- };
-
- struct SectionStats {
- SectionStats( SectionInfo const& _sectionInfo,
- Counts const& _assertions,
- double _durationInSeconds,
- bool _missingAssertions );
- SectionStats( SectionStats const& ) = default;
- SectionStats( SectionStats && ) = default;
- SectionStats& operator = ( SectionStats const& ) = default;
- SectionStats& operator = ( SectionStats && ) = default;
- virtual ~SectionStats();
-
- SectionInfo sectionInfo;
- Counts assertions;
- double durationInSeconds;
- bool missingAssertions;
- };
-
- struct TestCaseStats {
- TestCaseStats( TestCaseInfo const& _testInfo,
- Totals const& _totals,
- std::string const& _stdOut,
- std::string const& _stdErr,
- bool _aborting );
-
- TestCaseStats( TestCaseStats const& ) = default;
- TestCaseStats( TestCaseStats && ) = default;
- TestCaseStats& operator = ( TestCaseStats const& ) = default;
- TestCaseStats& operator = ( TestCaseStats && ) = default;
- virtual ~TestCaseStats();
-
- TestCaseInfo testInfo;
- Totals totals;
- std::string stdOut;
- std::string stdErr;
- bool aborting;
- };
-
- struct TestGroupStats {
- TestGroupStats( GroupInfo const& _groupInfo,
- Totals const& _totals,
- bool _aborting );
- TestGroupStats( GroupInfo const& _groupInfo );
-
- TestGroupStats( TestGroupStats const& ) = default;
- TestGroupStats( TestGroupStats && ) = default;
- TestGroupStats& operator = ( TestGroupStats const& ) = default;
- TestGroupStats& operator = ( TestGroupStats && ) = default;
- virtual ~TestGroupStats();
-
- GroupInfo groupInfo;
- Totals totals;
- bool aborting;
- };
-
- struct TestRunStats {
- TestRunStats( TestRunInfo const& _runInfo,
- Totals const& _totals,
- bool _aborting );
-
- TestRunStats( TestRunStats const& ) = default;
- TestRunStats( TestRunStats && ) = default;
- TestRunStats& operator = ( TestRunStats const& ) = default;
- TestRunStats& operator = ( TestRunStats && ) = default;
- virtual ~TestRunStats();
-
- TestRunInfo runInfo;
- Totals totals;
- bool aborting;
- };
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- struct BenchmarkInfo {
- std::string name;
- double estimatedDuration;
- int iterations;
- int samples;
- unsigned int resamples;
- double clockResolution;
- double clockCost;
- };
-
- template <class Duration>
- struct BenchmarkStats {
- BenchmarkInfo info;
-
- std::vector<Duration> samples;
- Benchmark::Estimate<Duration> mean;
- Benchmark::Estimate<Duration> standardDeviation;
- Benchmark::OutlierClassification outliers;
- double outlierVariance;
-
- template <typename Duration2>
- operator BenchmarkStats<Duration2>() const {
- std::vector<Duration2> samples2;
- samples2.reserve(samples.size());
- std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](Duration d) { return Duration2(d); });
- return {
- info,
- std::move(samples2),
- mean,
- standardDeviation,
- outliers,
- outlierVariance,
- };
- }
- };
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- struct IStreamingReporter {
- virtual ~IStreamingReporter() = default;
-
- // Implementing class must also provide the following static methods:
- // static std::string getDescription();
- // static std::set<Verbosity> getSupportedVerbosities()
-
- virtual ReporterPreferences getPreferences() const = 0;
-
- virtual void noMatchingTestCases( std::string const& spec ) = 0;
-
- virtual void reportInvalidArguments(std::string const&) {}
-
- virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0;
- virtual void testGroupStarting( GroupInfo const& groupInfo ) = 0;
-
- virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0;
- virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- virtual void benchmarkPreparing( std::string const& ) {}
- virtual void benchmarkStarting( BenchmarkInfo const& ) {}
- virtual void benchmarkEnded( BenchmarkStats<> const& ) {}
- virtual void benchmarkFailed( std::string const& ) {}
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0;
-
- // The return value indicates if the messages buffer should be cleared:
- virtual bool assertionEnded( AssertionStats const& assertionStats ) = 0;
-
- virtual void sectionEnded( SectionStats const& sectionStats ) = 0;
- virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0;
- virtual void testGroupEnded( TestGroupStats const& testGroupStats ) = 0;
- virtual void testRunEnded( TestRunStats const& testRunStats ) = 0;
-
- virtual void skipTest( TestCaseInfo const& testInfo ) = 0;
-
- // Default empty implementation provided
- virtual void fatalErrorEncountered( StringRef name );
-
- virtual bool isMulti() const;
- };
- using IStreamingReporterPtr = std::unique_ptr<IStreamingReporter>;
-
- struct IReporterFactory {
- virtual ~IReporterFactory();
- virtual IStreamingReporterPtr create( ReporterConfig const& config ) const = 0;
- virtual std::string getDescription() const = 0;
- };
- using IReporterFactoryPtr = std::shared_ptr<IReporterFactory>;
-
- struct IReporterRegistry {
- using FactoryMap = std::map<std::string, IReporterFactoryPtr>;
- using Listeners = std::vector<IReporterFactoryPtr>;
-
- virtual ~IReporterRegistry();
- virtual IStreamingReporterPtr create( std::string const& name, IConfigPtr const& config ) const = 0;
- virtual FactoryMap const& getFactories() const = 0;
- virtual Listeners const& getListeners() const = 0;
- };
-
-} // end namespace Catch
-
-// end catch_interfaces_reporter.h
-#include <algorithm>
-#include <cstring>
-#include <cfloat>
-#include <cstdio>
-#include <cassert>
-#include <memory>
-#include <ostream>
-
-namespace Catch {
- void prepareExpandedExpression(AssertionResult& result);
-
- // Returns double formatted as %.3f (format expected on output)
- std::string getFormattedDuration( double duration );
-
- //! Should the reporter show
- bool shouldShowDuration( IConfig const& config, double duration );
-
- std::string serializeFilters( std::vector<std::string> const& container );
-
- template<typename DerivedT>
- struct StreamingReporterBase : IStreamingReporter {
-
- StreamingReporterBase( ReporterConfig const& _config )
- : m_config( _config.fullConfig() ),
- stream( _config.stream() )
- {
- m_reporterPrefs.shouldRedirectStdOut = false;
- if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) )
- CATCH_ERROR( "Verbosity level not supported by this reporter" );
- }
-
- ReporterPreferences getPreferences() const override {
- return m_reporterPrefs;
- }
-
- static std::set<Verbosity> getSupportedVerbosities() {
- return { Verbosity::Normal };
- }
-
- ~StreamingReporterBase() override = default;
-
- void noMatchingTestCases(std::string const&) override {}
-
- void reportInvalidArguments(std::string const&) override {}
-
- void testRunStarting(TestRunInfo const& _testRunInfo) override {
- currentTestRunInfo = _testRunInfo;
- }
-
- void testGroupStarting(GroupInfo const& _groupInfo) override {
- currentGroupInfo = _groupInfo;
- }
-
- void testCaseStarting(TestCaseInfo const& _testInfo) override {
- currentTestCaseInfo = _testInfo;
- }
- void sectionStarting(SectionInfo const& _sectionInfo) override {
- m_sectionStack.push_back(_sectionInfo);
- }
-
- void sectionEnded(SectionStats const& /* _sectionStats */) override {
- m_sectionStack.pop_back();
- }
- void testCaseEnded(TestCaseStats const& /* _testCaseStats */) override {
- currentTestCaseInfo.reset();
- }
- void testGroupEnded(TestGroupStats const& /* _testGroupStats */) override {
- currentGroupInfo.reset();
- }
- void testRunEnded(TestRunStats const& /* _testRunStats */) override {
- currentTestCaseInfo.reset();
- currentGroupInfo.reset();
- currentTestRunInfo.reset();
- }
-
- void skipTest(TestCaseInfo const&) override {
- // Don't do anything with this by default.
- // It can optionally be overridden in the derived class.
- }
-
- IConfigPtr m_config;
- std::ostream& stream;
-
- LazyStat<TestRunInfo> currentTestRunInfo;
- LazyStat<GroupInfo> currentGroupInfo;
- LazyStat<TestCaseInfo> currentTestCaseInfo;
-
- std::vector<SectionInfo> m_sectionStack;
- ReporterPreferences m_reporterPrefs;
- };
-
- template<typename DerivedT>
- struct CumulativeReporterBase : IStreamingReporter {
- template<typename T, typename ChildNodeT>
- struct Node {
- explicit Node( T const& _value ) : value( _value ) {}
- virtual ~Node() {}
-
- using ChildNodes = std::vector<std::shared_ptr<ChildNodeT>>;
- T value;
- ChildNodes children;
- };
- struct SectionNode {
- explicit SectionNode(SectionStats const& _stats) : stats(_stats) {}
- virtual ~SectionNode() = default;
-
- bool operator == (SectionNode const& other) const {
- return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo;
- }
- bool operator == (std::shared_ptr<SectionNode> const& other) const {
- return operator==(*other);
- }
-
- SectionStats stats;
- using ChildSections = std::vector<std::shared_ptr<SectionNode>>;
- using Assertions = std::vector<AssertionStats>;
- ChildSections childSections;
- Assertions assertions;
- std::string stdOut;
- std::string stdErr;
- };
-
- struct BySectionInfo {
- BySectionInfo( SectionInfo const& other ) : m_other( other ) {}
- BySectionInfo( BySectionInfo const& other ) : m_other( other.m_other ) {}
- bool operator() (std::shared_ptr<SectionNode> const& node) const {
- return ((node->stats.sectionInfo.name == m_other.name) &&
- (node->stats.sectionInfo.lineInfo == m_other.lineInfo));
- }
- void operator=(BySectionInfo const&) = delete;
-
- private:
- SectionInfo const& m_other;
- };
-
- using TestCaseNode = Node<TestCaseStats, SectionNode>;
- using TestGroupNode = Node<TestGroupStats, TestCaseNode>;
- using TestRunNode = Node<TestRunStats, TestGroupNode>;
-
- CumulativeReporterBase( ReporterConfig const& _config )
- : m_config( _config.fullConfig() ),
- stream( _config.stream() )
- {
- m_reporterPrefs.shouldRedirectStdOut = false;
- if( !DerivedT::getSupportedVerbosities().count( m_config->verbosity() ) )
- CATCH_ERROR( "Verbosity level not supported by this reporter" );
- }
- ~CumulativeReporterBase() override = default;
-
- ReporterPreferences getPreferences() const override {
- return m_reporterPrefs;
- }
-
- static std::set<Verbosity> getSupportedVerbosities() {
- return { Verbosity::Normal };
- }
-
- void testRunStarting( TestRunInfo const& ) override {}
- void testGroupStarting( GroupInfo const& ) override {}
-
- void testCaseStarting( TestCaseInfo const& ) override {}
-
- void sectionStarting( SectionInfo const& sectionInfo ) override {
- SectionStats incompleteStats( sectionInfo, Counts(), 0, false );
- std::shared_ptr<SectionNode> node;
- if( m_sectionStack.empty() ) {
- if( !m_rootSection )
- m_rootSection = std::make_shared<SectionNode>( incompleteStats );
- node = m_rootSection;
- }
- else {
- SectionNode& parentNode = *m_sectionStack.back();
- auto it =
- std::find_if( parentNode.childSections.begin(),
- parentNode.childSections.end(),
- BySectionInfo( sectionInfo ) );
- if( it == parentNode.childSections.end() ) {
- node = std::make_shared<SectionNode>( incompleteStats );
- parentNode.childSections.push_back( node );
- }
- else
- node = *it;
- }
- m_sectionStack.push_back( node );
- m_deepestSection = std::move(node);
- }
-
- void assertionStarting(AssertionInfo const&) override {}
-
- bool assertionEnded(AssertionStats const& assertionStats) override {
- assert(!m_sectionStack.empty());
- // AssertionResult holds a pointer to a temporary DecomposedExpression,
- // which getExpandedExpression() calls to build the expression string.
- // Our section stack copy of the assertionResult will likely outlive the
- // temporary, so it must be expanded or discarded now to avoid calling
- // a destroyed object later.
- prepareExpandedExpression(const_cast<AssertionResult&>( assertionStats.assertionResult ) );
- SectionNode& sectionNode = *m_sectionStack.back();
- sectionNode.assertions.push_back(assertionStats);
- return true;
- }
- void sectionEnded(SectionStats const& sectionStats) override {
- assert(!m_sectionStack.empty());
- SectionNode& node = *m_sectionStack.back();
- node.stats = sectionStats;
- m_sectionStack.pop_back();
- }
- void testCaseEnded(TestCaseStats const& testCaseStats) override {
- auto node = std::make_shared<TestCaseNode>(testCaseStats);
- assert(m_sectionStack.size() == 0);
- node->children.push_back(m_rootSection);
- m_testCases.push_back(node);
- m_rootSection.reset();
-
- assert(m_deepestSection);
- m_deepestSection->stdOut = testCaseStats.stdOut;
- m_deepestSection->stdErr = testCaseStats.stdErr;
- }
- void testGroupEnded(TestGroupStats const& testGroupStats) override {
- auto node = std::make_shared<TestGroupNode>(testGroupStats);
- node->children.swap(m_testCases);
- m_testGroups.push_back(node);
- }
- void testRunEnded(TestRunStats const& testRunStats) override {
- auto node = std::make_shared<TestRunNode>(testRunStats);
- node->children.swap(m_testGroups);
- m_testRuns.push_back(node);
- testRunEndedCumulative();
- }
- virtual void testRunEndedCumulative() = 0;
-
- void skipTest(TestCaseInfo const&) override {}
-
- IConfigPtr m_config;
- std::ostream& stream;
- std::vector<AssertionStats> m_assertions;
- std::vector<std::vector<std::shared_ptr<SectionNode>>> m_sections;
- std::vector<std::shared_ptr<TestCaseNode>> m_testCases;
- std::vector<std::shared_ptr<TestGroupNode>> m_testGroups;
-
- std::vector<std::shared_ptr<TestRunNode>> m_testRuns;
-
- std::shared_ptr<SectionNode> m_rootSection;
- std::shared_ptr<SectionNode> m_deepestSection;
- std::vector<std::shared_ptr<SectionNode>> m_sectionStack;
- ReporterPreferences m_reporterPrefs;
- };
-
- template<char C>
- char const* getLineOfChars() {
- static char line[CATCH_CONFIG_CONSOLE_WIDTH] = {0};
- if( !*line ) {
- std::memset( line, C, CATCH_CONFIG_CONSOLE_WIDTH-1 );
- line[CATCH_CONFIG_CONSOLE_WIDTH-1] = 0;
- }
- return line;
- }
-
- struct TestEventListenerBase : StreamingReporterBase<TestEventListenerBase> {
- TestEventListenerBase( ReporterConfig const& _config );
-
- static std::set<Verbosity> getSupportedVerbosities();
-
- void assertionStarting(AssertionInfo const&) override;
- bool assertionEnded(AssertionStats const&) override;
- };
-
-} // end namespace Catch
-
-// end catch_reporter_bases.hpp
-// start catch_console_colour.h
-
-namespace Catch {
-
- struct Colour {
- enum Code {
- None = 0,
-
- White,
- Red,
- Green,
- Blue,
- Cyan,
- Yellow,
- Grey,
-
- Bright = 0x10,
-
- BrightRed = Bright | Red,
- BrightGreen = Bright | Green,
- LightGrey = Bright | Grey,
- BrightWhite = Bright | White,
- BrightYellow = Bright | Yellow,
-
- // By intention
- FileName = LightGrey,
- Warning = BrightYellow,
- ResultError = BrightRed,
- ResultSuccess = BrightGreen,
- ResultExpectedFailure = Warning,
-
- Error = BrightRed,
- Success = Green,
-
- OriginalExpression = Cyan,
- ReconstructedExpression = BrightYellow,
-
- SecondaryText = LightGrey,
- Headers = White
- };
-
- // Use constructed object for RAII guard
- Colour( Code _colourCode );
- Colour( Colour&& other ) noexcept;
- Colour& operator=( Colour&& other ) noexcept;
- ~Colour();
-
- // Use static method for one-shot changes
- static void use( Code _colourCode );
-
- private:
- bool m_moved = false;
- };
-
- std::ostream& operator << ( std::ostream& os, Colour const& );
-
-} // end namespace Catch
-
-// end catch_console_colour.h
-// start catch_reporter_registrars.hpp
-
-
-namespace Catch {
-
- template<typename T>
- class ReporterRegistrar {
-
- class ReporterFactory : public IReporterFactory {
-
- IStreamingReporterPtr create( ReporterConfig const& config ) const override {
- return std::unique_ptr<T>( new T( config ) );
- }
-
- std::string getDescription() const override {
- return T::getDescription();
- }
- };
-
- public:
-
- explicit ReporterRegistrar( std::string const& name ) {
- getMutableRegistryHub().registerReporter( name, std::make_shared<ReporterFactory>() );
- }
- };
-
- template<typename T>
- class ListenerRegistrar {
-
- class ListenerFactory : public IReporterFactory {
-
- IStreamingReporterPtr create( ReporterConfig const& config ) const override {
- return std::unique_ptr<T>( new T( config ) );
- }
- std::string getDescription() const override {
- return std::string();
- }
- };
-
- public:
-
- ListenerRegistrar() {
- getMutableRegistryHub().registerListener( std::make_shared<ListenerFactory>() );
- }
- };
-}
-
-#if !defined(CATCH_CONFIG_DISABLE)
-
-#define CATCH_REGISTER_REPORTER( name, reporterType ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::ReporterRegistrar<reporterType> catch_internal_RegistrarFor##reporterType( name ); } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
-#define CATCH_REGISTER_LISTENER( listenerType ) \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
- namespace{ Catch::ListenerRegistrar<listenerType> catch_internal_RegistrarFor##listenerType; } \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-#else // CATCH_CONFIG_DISABLE
-
-#define CATCH_REGISTER_REPORTER(name, reporterType)
-#define CATCH_REGISTER_LISTENER(listenerType)
-
-#endif // CATCH_CONFIG_DISABLE
-
-// end catch_reporter_registrars.hpp
-// Allow users to base their work off existing reporters
-// start catch_reporter_compact.h
-
-namespace Catch {
-
- struct CompactReporter : StreamingReporterBase<CompactReporter> {
-
- using StreamingReporterBase::StreamingReporterBase;
-
- ~CompactReporter() override;
-
- static std::string getDescription();
-
- void noMatchingTestCases(std::string const& spec) override;
-
- void assertionStarting(AssertionInfo const&) override;
-
- bool assertionEnded(AssertionStats const& _assertionStats) override;
-
- void sectionEnded(SectionStats const& _sectionStats) override;
-
- void testRunEnded(TestRunStats const& _testRunStats) override;
-
- };
-
-} // end namespace Catch
-
-// end catch_reporter_compact.h
-// start catch_reporter_console.h
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4061) // Not all labels are EXPLICITLY handled in switch
- // Note that 4062 (not all labels are handled
- // and default is missing) is enabled
-#endif
-
-namespace Catch {
- // Fwd decls
- struct SummaryColumn;
- class TablePrinter;
-
- struct ConsoleReporter : StreamingReporterBase<ConsoleReporter> {
- std::unique_ptr<TablePrinter> m_tablePrinter;
-
- ConsoleReporter(ReporterConfig const& config);
- ~ConsoleReporter() override;
- static std::string getDescription();
-
- void noMatchingTestCases(std::string const& spec) override;
-
- void reportInvalidArguments(std::string const&arg) override;
-
- void assertionStarting(AssertionInfo const&) override;
-
- bool assertionEnded(AssertionStats const& _assertionStats) override;
-
- void sectionStarting(SectionInfo const& _sectionInfo) override;
- void sectionEnded(SectionStats const& _sectionStats) override;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void benchmarkPreparing(std::string const& name) override;
- void benchmarkStarting(BenchmarkInfo const& info) override;
- void benchmarkEnded(BenchmarkStats<> const& stats) override;
- void benchmarkFailed(std::string const& error) override;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void testCaseEnded(TestCaseStats const& _testCaseStats) override;
- void testGroupEnded(TestGroupStats const& _testGroupStats) override;
- void testRunEnded(TestRunStats const& _testRunStats) override;
- void testRunStarting(TestRunInfo const& _testRunInfo) override;
- private:
-
- void lazyPrint();
-
- void lazyPrintWithoutClosingBenchmarkTable();
- void lazyPrintRunInfo();
- void lazyPrintGroupInfo();
- void printTestCaseAndSectionHeader();
-
- void printClosedHeader(std::string const& _name);
- void printOpenHeader(std::string const& _name);
-
- // if string has a : in first line will set indent to follow it on
- // subsequent lines
- void printHeaderString(std::string const& _string, std::size_t indent = 0);
-
- void printTotals(Totals const& totals);
- void printSummaryRow(std::string const& label, std::vector<SummaryColumn> const& cols, std::size_t row);
-
- void printTotalsDivider(Totals const& totals);
- void printSummaryDivider();
- void printTestFilters();
-
- private:
- bool m_headerPrinted = false;
- };
-
-} // end namespace Catch
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
-
-// end catch_reporter_console.h
-// start catch_reporter_junit.h
-
-// start catch_xmlwriter.h
-
-#include <vector>
-
-namespace Catch {
- enum class XmlFormatting {
- None = 0x00,
- Indent = 0x01,
- Newline = 0x02,
- };
-
- XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs);
- XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs);
-
- class XmlEncode {
- public:
- enum ForWhat { ForTextNodes, ForAttributes };
-
- XmlEncode( std::string const& str, ForWhat forWhat = ForTextNodes );
-
- void encodeTo( std::ostream& os ) const;
-
- friend std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode );
-
- private:
- std::string m_str;
- ForWhat m_forWhat;
- };
-
- class XmlWriter {
- public:
-
- class ScopedElement {
- public:
- ScopedElement( XmlWriter* writer, XmlFormatting fmt );
-
- ScopedElement( ScopedElement&& other ) noexcept;
- ScopedElement& operator=( ScopedElement&& other ) noexcept;
-
- ~ScopedElement();
-
- ScopedElement& writeText( std::string const& text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent );
-
- template<typename T>
- ScopedElement& writeAttribute( std::string const& name, T const& attribute ) {
- m_writer->writeAttribute( name, attribute );
- return *this;
- }
-
- private:
- mutable XmlWriter* m_writer = nullptr;
- XmlFormatting m_fmt;
- };
-
- XmlWriter( std::ostream& os = Catch::cout() );
- ~XmlWriter();
-
- XmlWriter( XmlWriter const& ) = delete;
- XmlWriter& operator=( XmlWriter const& ) = delete;
-
- XmlWriter& startElement( std::string const& name, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- ScopedElement scopedElement( std::string const& name, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- XmlWriter& endElement(XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- XmlWriter& writeAttribute( std::string const& name, std::string const& attribute );
-
- XmlWriter& writeAttribute( std::string const& name, bool attribute );
-
- template<typename T>
- XmlWriter& writeAttribute( std::string const& name, T const& attribute ) {
- ReusableStringStream rss;
- rss << attribute;
- return writeAttribute( name, rss.str() );
- }
-
- XmlWriter& writeText( std::string const& text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- XmlWriter& writeComment(std::string const& text, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
-
- void writeStylesheetRef( std::string const& url );
-
- XmlWriter& writeBlankLine();
-
- void ensureTagClosed();
-
- private:
-
- void applyFormatting(XmlFormatting fmt);
-
- void writeDeclaration();
-
- void newlineIfNecessary();
-
- bool m_tagIsOpen = false;
- bool m_needsNewline = false;
- std::vector<std::string> m_tags;
- std::string m_indent;
- std::ostream& m_os;
- };
-
-}
-
-// end catch_xmlwriter.h
-namespace Catch {
-
- class JunitReporter : public CumulativeReporterBase<JunitReporter> {
- public:
- JunitReporter(ReporterConfig const& _config);
-
- ~JunitReporter() override;
-
- static std::string getDescription();
-
- void noMatchingTestCases(std::string const& /*spec*/) override;
-
- void testRunStarting(TestRunInfo const& runInfo) override;
-
- void testGroupStarting(GroupInfo const& groupInfo) override;
-
- void testCaseStarting(TestCaseInfo const& testCaseInfo) override;
- bool assertionEnded(AssertionStats const& assertionStats) override;
-
- void testCaseEnded(TestCaseStats const& testCaseStats) override;
-
- void testGroupEnded(TestGroupStats const& testGroupStats) override;
-
- void testRunEndedCumulative() override;
-
- void writeGroup(TestGroupNode const& groupNode, double suiteTime);
-
- void writeTestCase(TestCaseNode const& testCaseNode);
-
- void writeSection(std::string const& className,
- std::string const& rootName,
- SectionNode const& sectionNode);
-
- void writeAssertions(SectionNode const& sectionNode);
- void writeAssertion(AssertionStats const& stats);
-
- XmlWriter xml;
- Timer suiteTimer;
- std::string stdOutForSuite;
- std::string stdErrForSuite;
- unsigned int unexpectedExceptions = 0;
- bool m_okToFail = false;
- };
-
-} // end namespace Catch
-
-// end catch_reporter_junit.h
-// start catch_reporter_xml.h
-
-namespace Catch {
- class XmlReporter : public StreamingReporterBase<XmlReporter> {
- public:
- XmlReporter(ReporterConfig const& _config);
-
- ~XmlReporter() override;
-
- static std::string getDescription();
-
- virtual std::string getStylesheetRef() const;
-
- void writeSourceInfo(SourceLineInfo const& sourceInfo);
-
- public: // StreamingReporterBase
-
- void noMatchingTestCases(std::string const& s) override;
-
- void testRunStarting(TestRunInfo const& testInfo) override;
-
- void testGroupStarting(GroupInfo const& groupInfo) override;
-
- void testCaseStarting(TestCaseInfo const& testInfo) override;
-
- void sectionStarting(SectionInfo const& sectionInfo) override;
-
- void assertionStarting(AssertionInfo const&) override;
-
- bool assertionEnded(AssertionStats const& assertionStats) override;
-
- void sectionEnded(SectionStats const& sectionStats) override;
-
- void testCaseEnded(TestCaseStats const& testCaseStats) override;
-
- void testGroupEnded(TestGroupStats const& testGroupStats) override;
-
- void testRunEnded(TestRunStats const& testRunStats) override;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void benchmarkPreparing(std::string const& name) override;
- void benchmarkStarting(BenchmarkInfo const&) override;
- void benchmarkEnded(BenchmarkStats<> const&) override;
- void benchmarkFailed(std::string const&) override;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- private:
- Timer m_testCaseTimer;
- XmlWriter m_xml;
- int m_sectionDepth = 0;
- };
-
-} // end namespace Catch
-
-// end catch_reporter_xml.h
-
-// end catch_external_interfaces.h
-#endif
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-// start catch_benchmarking_all.hpp
-
-// A proxy header that includes all of the benchmarking headers to allow
-// concise include of the benchmarking features. You should prefer the
-// individual includes in standard use.
-
-// start catch_benchmark.hpp
-
- // Benchmark
-
-// start catch_chronometer.hpp
-
-// User-facing chronometer
-
-
-// start catch_clock.hpp
-
-// Clocks
-
-
-#include <chrono>
-#include <ratio>
-
-namespace Catch {
- namespace Benchmark {
- template <typename Clock>
- using ClockDuration = typename Clock::duration;
- template <typename Clock>
- using FloatDuration = std::chrono::duration<double, typename Clock::period>;
-
- template <typename Clock>
- using TimePoint = typename Clock::time_point;
-
- using default_clock = std::chrono::steady_clock;
-
- template <typename Clock>
- struct now {
- TimePoint<Clock> operator()() const {
- return Clock::now();
- }
- };
-
- using fp_seconds = std::chrono::duration<double, std::ratio<1>>;
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_clock.hpp
-// start catch_optimizer.hpp
-
- // Hinting the optimizer
-
-
-#if defined(_MSC_VER)
-# include <atomic> // atomic_thread_fence
-#endif
-
-namespace Catch {
- namespace Benchmark {
-#if defined(__GNUC__) || defined(__clang__)
- template <typename T>
- inline void keep_memory(T* p) {
- asm volatile("" : : "g"(p) : "memory");
- }
- inline void keep_memory() {
- asm volatile("" : : : "memory");
- }
-
- namespace Detail {
- inline void optimizer_barrier() { keep_memory(); }
- } // namespace Detail
-#elif defined(_MSC_VER)
-
-#pragma optimize("", off)
- template <typename T>
- inline void keep_memory(T* p) {
- // thanks @milleniumbug
- *reinterpret_cast<char volatile*>(p) = *reinterpret_cast<char const volatile*>(p);
- }
- // TODO equivalent keep_memory()
-#pragma optimize("", on)
-
- namespace Detail {
- inline void optimizer_barrier() {
- std::atomic_thread_fence(std::memory_order_seq_cst);
- }
- } // namespace Detail
-
-#endif
-
- template <typename T>
- inline void deoptimize_value(T&& x) {
- keep_memory(&x);
- }
-
- template <typename Fn, typename... Args>
- inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> typename std::enable_if<!std::is_same<void, decltype(fn(args...))>::value>::type {
- deoptimize_value(std::forward<Fn>(fn) (std::forward<Args...>(args...)));
- }
-
- template <typename Fn, typename... Args>
- inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> typename std::enable_if<std::is_same<void, decltype(fn(args...))>::value>::type {
- std::forward<Fn>(fn) (std::forward<Args...>(args...));
- }
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_optimizer.hpp
-// start catch_complete_invoke.hpp
-
-// Invoke with a special case for void
-
-
-#include <type_traits>
-#include <utility>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename T>
- struct CompleteType { using type = T; };
- template <>
- struct CompleteType<void> { struct type {}; };
-
- template <typename T>
- using CompleteType_t = typename CompleteType<T>::type;
-
- template <typename Result>
- struct CompleteInvoker {
- template <typename Fun, typename... Args>
- static Result invoke(Fun&& fun, Args&&... args) {
- return std::forward<Fun>(fun)(std::forward<Args>(args)...);
- }
- };
- template <>
- struct CompleteInvoker<void> {
- template <typename Fun, typename... Args>
- static CompleteType_t<void> invoke(Fun&& fun, Args&&... args) {
- std::forward<Fun>(fun)(std::forward<Args>(args)...);
- return {};
- }
- };
-
- // invoke and not return void :(
- template <typename Fun, typename... Args>
- CompleteType_t<FunctionReturnType<Fun, Args...>> complete_invoke(Fun&& fun, Args&&... args) {
- return CompleteInvoker<FunctionReturnType<Fun, Args...>>::invoke(std::forward<Fun>(fun), std::forward<Args>(args)...);
- }
-
- const std::string benchmarkErrorMsg = "a benchmark failed to run successfully";
- } // namespace Detail
-
- template <typename Fun>
- Detail::CompleteType_t<FunctionReturnType<Fun>> user_code(Fun&& fun) {
- CATCH_TRY{
- return Detail::complete_invoke(std::forward<Fun>(fun));
- } CATCH_CATCH_ALL{
- getResultCapture().benchmarkFailed(translateActiveException());
- CATCH_RUNTIME_ERROR(Detail::benchmarkErrorMsg);
- }
- }
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_complete_invoke.hpp
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- struct ChronometerConcept {
- virtual void start() = 0;
- virtual void finish() = 0;
- virtual ~ChronometerConcept() = default;
- };
- template <typename Clock>
- struct ChronometerModel final : public ChronometerConcept {
- void start() override { started = Clock::now(); }
- void finish() override { finished = Clock::now(); }
-
- ClockDuration<Clock> elapsed() const { return finished - started; }
-
- TimePoint<Clock> started;
- TimePoint<Clock> finished;
- };
- } // namespace Detail
-
- struct Chronometer {
- public:
- template <typename Fun>
- void measure(Fun&& fun) { measure(std::forward<Fun>(fun), is_callable<Fun(int)>()); }
-
- int runs() const { return k; }
-
- Chronometer(Detail::ChronometerConcept& meter, int k)
- : impl(&meter)
- , k(k) {}
-
- private:
- template <typename Fun>
- void measure(Fun&& fun, std::false_type) {
- measure([&fun](int) { return fun(); }, std::true_type());
- }
-
- template <typename Fun>
- void measure(Fun&& fun, std::true_type) {
- Detail::optimizer_barrier();
- impl->start();
- for (int i = 0; i < k; ++i) invoke_deoptimized(fun, i);
- impl->finish();
- Detail::optimizer_barrier();
- }
-
- Detail::ChronometerConcept* impl;
- int k;
- };
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_chronometer.hpp
-// start catch_environment.hpp
-
-// Environment information
-
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration>
- struct EnvironmentEstimate {
- Duration mean;
- OutlierClassification outliers;
-
- template <typename Duration2>
- operator EnvironmentEstimate<Duration2>() const {
- return { mean, outliers };
- }
- };
- template <typename Clock>
- struct Environment {
- using clock_type = Clock;
- EnvironmentEstimate<FloatDuration<Clock>> clock_resolution;
- EnvironmentEstimate<FloatDuration<Clock>> clock_cost;
- };
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_environment.hpp
-// start catch_execution_plan.hpp
-
- // Execution plan
-
-
-// start catch_benchmark_function.hpp
-
- // Dumb std::function implementation for consistent call overhead
-
-
-#include <cassert>
-#include <type_traits>
-#include <utility>
-#include <memory>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename T>
- using Decay = typename std::decay<T>::type;
- template <typename T, typename U>
- struct is_related
- : std::is_same<Decay<T>, Decay<U>> {};
-
- /// We need to reinvent std::function because every piece of code that might add overhead
- /// in a measurement context needs to have consistent performance characteristics so that we
- /// can account for it in the measurement.
- /// Implementations of std::function with optimizations that aren't always applicable, like
- /// small buffer optimizations, are not uncommon.
- /// This is effectively an implementation of std::function without any such optimizations;
- /// it may be slow, but it is consistently slow.
- struct BenchmarkFunction {
- private:
- struct callable {
- virtual void call(Chronometer meter) const = 0;
- virtual callable* clone() const = 0;
- virtual ~callable() = default;
- };
- template <typename Fun>
- struct model : public callable {
- model(Fun&& fun) : fun(std::move(fun)) {}
- model(Fun const& fun) : fun(fun) {}
-
- model<Fun>* clone() const override { return new model<Fun>(*this); }
-
- void call(Chronometer meter) const override {
- call(meter, is_callable<Fun(Chronometer)>());
- }
- void call(Chronometer meter, std::true_type) const {
- fun(meter);
- }
- void call(Chronometer meter, std::false_type) const {
- meter.measure(fun);
- }
-
- Fun fun;
- };
-
- struct do_nothing { void operator()() const {} };
-
- template <typename T>
- BenchmarkFunction(model<T>* c) : f(c) {}
-
- public:
- BenchmarkFunction()
- : f(new model<do_nothing>{ {} }) {}
-
- template <typename Fun,
- typename std::enable_if<!is_related<Fun, BenchmarkFunction>::value, int>::type = 0>
- BenchmarkFunction(Fun&& fun)
- : f(new model<typename std::decay<Fun>::type>(std::forward<Fun>(fun))) {}
-
- BenchmarkFunction(BenchmarkFunction&& that)
- : f(std::move(that.f)) {}
-
- BenchmarkFunction(BenchmarkFunction const& that)
- : f(that.f->clone()) {}
-
- BenchmarkFunction& operator=(BenchmarkFunction&& that) {
- f = std::move(that.f);
- return *this;
- }
-
- BenchmarkFunction& operator=(BenchmarkFunction const& that) {
- f.reset(that.f->clone());
- return *this;
- }
-
- void operator()(Chronometer meter) const { f->call(meter); }
-
- private:
- std::unique_ptr<callable> f;
- };
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_benchmark_function.hpp
-// start catch_repeat.hpp
-
-// repeat algorithm
-
-
-#include <type_traits>
-#include <utility>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Fun>
- struct repeater {
- void operator()(int k) const {
- for (int i = 0; i < k; ++i) {
- fun();
- }
- }
- Fun fun;
- };
- template <typename Fun>
- repeater<typename std::decay<Fun>::type> repeat(Fun&& fun) {
- return { std::forward<Fun>(fun) };
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_repeat.hpp
-// start catch_run_for_at_least.hpp
-
-// Run a function for a minimum amount of time
-
-
-// start catch_measure.hpp
-
-// Measure
-
-
-// start catch_timing.hpp
-
-// Timing
-
-
-#include <tuple>
-#include <type_traits>
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration, typename Result>
- struct Timing {
- Duration elapsed;
- Result result;
- int iterations;
- };
- template <typename Clock, typename Func, typename... Args>
- using TimingOf = Timing<ClockDuration<Clock>, Detail::CompleteType_t<FunctionReturnType<Func, Args...>>>;
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_timing.hpp
-#include <utility>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Clock, typename Fun, typename... Args>
- TimingOf<Clock, Fun, Args...> measure(Fun&& fun, Args&&... args) {
- auto start = Clock::now();
- auto&& r = Detail::complete_invoke(fun, std::forward<Args>(args)...);
- auto end = Clock::now();
- auto delta = end - start;
- return { delta, std::forward<decltype(r)>(r), 1 };
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_measure.hpp
-#include <utility>
-#include <type_traits>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Clock, typename Fun>
- TimingOf<Clock, Fun, int> measure_one(Fun&& fun, int iters, std::false_type) {
- return Detail::measure<Clock>(fun, iters);
- }
- template <typename Clock, typename Fun>
- TimingOf<Clock, Fun, Chronometer> measure_one(Fun&& fun, int iters, std::true_type) {
- Detail::ChronometerModel<Clock> meter;
- auto&& result = Detail::complete_invoke(fun, Chronometer(meter, iters));
-
- return { meter.elapsed(), std::move(result), iters };
- }
-
- template <typename Clock, typename Fun>
- using run_for_at_least_argument_t = typename std::conditional<is_callable<Fun(Chronometer)>::value, Chronometer, int>::type;
-
- struct optimized_away_error : std::exception {
- const char* what() const noexcept override {
- return "could not measure benchmark, maybe it was optimized away";
- }
- };
-
- template <typename Clock, typename Fun>
- TimingOf<Clock, Fun, run_for_at_least_argument_t<Clock, Fun>> run_for_at_least(ClockDuration<Clock> how_long, int seed, Fun&& fun) {
- auto iters = seed;
- while (iters < (1 << 30)) {
- auto&& Timing = measure_one<Clock>(fun, iters, is_callable<Fun(Chronometer)>());
-
- if (Timing.elapsed >= how_long) {
- return { Timing.elapsed, std::move(Timing.result), iters };
- }
- iters *= 2;
- }
- throw optimized_away_error{};
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_run_for_at_least.hpp
-#include <algorithm>
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration>
- struct ExecutionPlan {
- int iterations_per_sample;
- Duration estimated_duration;
- Detail::BenchmarkFunction benchmark;
- Duration warmup_time;
- int warmup_iterations;
-
- template <typename Duration2>
- operator ExecutionPlan<Duration2>() const {
- return { iterations_per_sample, estimated_duration, benchmark, warmup_time, warmup_iterations };
- }
-
- template <typename Clock>
- std::vector<FloatDuration<Clock>> run(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const {
- // warmup a bit
- Detail::run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(warmup_time), warmup_iterations, Detail::repeat(now<Clock>{}));
-
- std::vector<FloatDuration<Clock>> times;
- times.reserve(cfg.benchmarkSamples());
- std::generate_n(std::back_inserter(times), cfg.benchmarkSamples(), [this, env] {
- Detail::ChronometerModel<Clock> model;
- this->benchmark(Chronometer(model, iterations_per_sample));
- auto sample_time = model.elapsed() - env.clock_cost.mean;
- if (sample_time < FloatDuration<Clock>::zero()) sample_time = FloatDuration<Clock>::zero();
- return sample_time / iterations_per_sample;
- });
- return times;
- }
- };
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_execution_plan.hpp
-// start catch_estimate_clock.hpp
-
- // Environment measurement
-
-
-// start catch_stats.hpp
-
-// Statistical analysis tools
-
-
-#include <algorithm>
-#include <functional>
-#include <vector>
-#include <iterator>
-#include <numeric>
-#include <tuple>
-#include <cmath>
-#include <utility>
-#include <cstddef>
-#include <random>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- using sample = std::vector<double>;
-
- double weighted_average_quantile(int k, int q, std::vector<double>::iterator first, std::vector<double>::iterator last);
-
- template <typename Iterator>
- OutlierClassification classify_outliers(Iterator first, Iterator last) {
- std::vector<double> copy(first, last);
-
- auto q1 = weighted_average_quantile(1, 4, copy.begin(), copy.end());
- auto q3 = weighted_average_quantile(3, 4, copy.begin(), copy.end());
- auto iqr = q3 - q1;
- auto los = q1 - (iqr * 3.);
- auto lom = q1 - (iqr * 1.5);
- auto him = q3 + (iqr * 1.5);
- auto his = q3 + (iqr * 3.);
-
- OutlierClassification o;
- for (; first != last; ++first) {
- auto&& t = *first;
- if (t < los) ++o.low_severe;
- else if (t < lom) ++o.low_mild;
- else if (t > his) ++o.high_severe;
- else if (t > him) ++o.high_mild;
- ++o.samples_seen;
- }
- return o;
- }
-
- template <typename Iterator>
- double mean(Iterator first, Iterator last) {
- auto count = last - first;
- double sum = std::accumulate(first, last, 0.);
- return sum / count;
- }
-
- template <typename URng, typename Iterator, typename Estimator>
- sample resample(URng& rng, int resamples, Iterator first, Iterator last, Estimator& estimator) {
- auto n = last - first;
- std::uniform_int_distribution<decltype(n)> dist(0, n - 1);
-
- sample out;
- out.reserve(resamples);
- std::generate_n(std::back_inserter(out), resamples, [n, first, &estimator, &dist, &rng] {
- std::vector<double> resampled;
- resampled.reserve(n);
- std::generate_n(std::back_inserter(resampled), n, [first, &dist, &rng] { return first[dist(rng)]; });
- return estimator(resampled.begin(), resampled.end());
- });
- std::sort(out.begin(), out.end());
- return out;
- }
-
- template <typename Estimator, typename Iterator>
- sample jackknife(Estimator&& estimator, Iterator first, Iterator last) {
- auto n = last - first;
- auto second = std::next(first);
- sample results;
- results.reserve(n);
-
- for (auto it = first; it != last; ++it) {
- std::iter_swap(it, first);
- results.push_back(estimator(second, last));
- }
-
- return results;
- }
-
- inline double normal_cdf(double x) {
- return std::erfc(-x / std::sqrt(2.0)) / 2.0;
- }
-
- double erfc_inv(double x);
-
- double normal_quantile(double p);
-
- template <typename Iterator, typename Estimator>
- Estimate<double> bootstrap(double confidence_level, Iterator first, Iterator last, sample const& resample, Estimator&& estimator) {
- auto n_samples = last - first;
-
- double point = estimator(first, last);
- // Degenerate case with a single sample
- if (n_samples == 1) return { point, point, point, confidence_level };
-
- sample jack = jackknife(estimator, first, last);
- double jack_mean = mean(jack.begin(), jack.end());
- double sum_squares, sum_cubes;
- std::tie(sum_squares, sum_cubes) = std::accumulate(jack.begin(), jack.end(), std::make_pair(0., 0.), [jack_mean](std::pair<double, double> sqcb, double x) -> std::pair<double, double> {
- auto d = jack_mean - x;
- auto d2 = d * d;
- auto d3 = d2 * d;
- return { sqcb.first + d2, sqcb.second + d3 };
- });
-
- double accel = sum_cubes / (6 * std::pow(sum_squares, 1.5));
- int n = static_cast<int>(resample.size());
- double prob_n = std::count_if(resample.begin(), resample.end(), [point](double x) { return x < point; }) / (double)n;
- // degenerate case with uniform samples
- if (prob_n == 0) return { point, point, point, confidence_level };
-
- double bias = normal_quantile(prob_n);
- double z1 = normal_quantile((1. - confidence_level) / 2.);
-
- auto cumn = [n](double x) -> int {
- return std::lround(normal_cdf(x) * n); };
- auto a = [bias, accel](double b) { return bias + b / (1. - accel * b); };
- double b1 = bias + z1;
- double b2 = bias - z1;
- double a1 = a(b1);
- double a2 = a(b2);
- auto lo = std::max(cumn(a1), 0);
- auto hi = std::min(cumn(a2), n - 1);
-
- return { point, resample[lo], resample[hi], confidence_level };
- }
-
- double outlier_variance(Estimate<double> mean, Estimate<double> stddev, int n);
-
- struct bootstrap_analysis {
- Estimate<double> mean;
- Estimate<double> standard_deviation;
- double outlier_variance;
- };
-
- bootstrap_analysis analyse_samples(double confidence_level, int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last);
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_stats.hpp
-#include <algorithm>
-#include <iterator>
-#include <tuple>
-#include <vector>
-#include <cmath>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Clock>
- std::vector<double> resolution(int k) {
- std::vector<TimePoint<Clock>> times;
- times.reserve(k + 1);
- std::generate_n(std::back_inserter(times), k + 1, now<Clock>{});
-
- std::vector<double> deltas;
- deltas.reserve(k);
- std::transform(std::next(times.begin()), times.end(), times.begin(),
- std::back_inserter(deltas),
- [](TimePoint<Clock> a, TimePoint<Clock> b) { return static_cast<double>((a - b).count()); });
-
- return deltas;
- }
-
- const auto warmup_iterations = 10000;
- const auto warmup_time = std::chrono::milliseconds(100);
- const auto minimum_ticks = 1000;
- const auto warmup_seed = 10000;
- const auto clock_resolution_estimation_time = std::chrono::milliseconds(500);
- const auto clock_cost_estimation_time_limit = std::chrono::seconds(1);
- const auto clock_cost_estimation_tick_limit = 100000;
- const auto clock_cost_estimation_time = std::chrono::milliseconds(10);
- const auto clock_cost_estimation_iterations = 10000;
-
- template <typename Clock>
- int warmup() {
- return run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(warmup_time), warmup_seed, &resolution<Clock>)
- .iterations;
- }
- template <typename Clock>
- EnvironmentEstimate<FloatDuration<Clock>> estimate_clock_resolution(int iterations) {
- auto r = run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(clock_resolution_estimation_time), iterations, &resolution<Clock>)
- .result;
- return {
- FloatDuration<Clock>(mean(r.begin(), r.end())),
- classify_outliers(r.begin(), r.end()),
- };
- }
- template <typename Clock>
- EnvironmentEstimate<FloatDuration<Clock>> estimate_clock_cost(FloatDuration<Clock> resolution) {
- auto time_limit = std::min(resolution * clock_cost_estimation_tick_limit, FloatDuration<Clock>(clock_cost_estimation_time_limit));
- auto time_clock = [](int k) {
- return Detail::measure<Clock>([k] {
- for (int i = 0; i < k; ++i) {
- volatile auto ignored = Clock::now();
- (void)ignored;
- }
- }).elapsed;
- };
- time_clock(1);
- int iters = clock_cost_estimation_iterations;
- auto&& r = run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(clock_cost_estimation_time), iters, time_clock);
- std::vector<double> times;
- int nsamples = static_cast<int>(std::ceil(time_limit / r.elapsed));
- times.reserve(nsamples);
- std::generate_n(std::back_inserter(times), nsamples, [time_clock, &r] {
- return static_cast<double>((time_clock(r.iterations) / r.iterations).count());
- });
- return {
- FloatDuration<Clock>(mean(times.begin(), times.end())),
- classify_outliers(times.begin(), times.end()),
- };
- }
-
- template <typename Clock>
- Environment<FloatDuration<Clock>> measure_environment() {
- static Environment<FloatDuration<Clock>>* env = nullptr;
- if (env) {
- return *env;
- }
-
- auto iters = Detail::warmup<Clock>();
- auto resolution = Detail::estimate_clock_resolution<Clock>(iters);
- auto cost = Detail::estimate_clock_cost<Clock>(resolution.mean);
-
- env = new Environment<FloatDuration<Clock>>{ resolution, cost };
- return *env;
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_estimate_clock.hpp
-// start catch_analyse.hpp
-
- // Run and analyse one benchmark
-
-
-// start catch_sample_analysis.hpp
-
-// Benchmark results
-
-
-#include <algorithm>
-#include <vector>
-#include <string>
-#include <iterator>
-
-namespace Catch {
- namespace Benchmark {
- template <typename Duration>
- struct SampleAnalysis {
- std::vector<Duration> samples;
- Estimate<Duration> mean;
- Estimate<Duration> standard_deviation;
- OutlierClassification outliers;
- double outlier_variance;
-
- template <typename Duration2>
- operator SampleAnalysis<Duration2>() const {
- std::vector<Duration2> samples2;
- samples2.reserve(samples.size());
- std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](Duration d) { return Duration2(d); });
- return {
- std::move(samples2),
- mean,
- standard_deviation,
- outliers,
- outlier_variance,
- };
- }
- };
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_sample_analysis.hpp
-#include <algorithm>
-#include <iterator>
-#include <vector>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename Duration, typename Iterator>
- SampleAnalysis<Duration> analyse(const IConfig &cfg, Environment<Duration>, Iterator first, Iterator last) {
- if (!cfg.benchmarkNoAnalysis()) {
- std::vector<double> samples;
- samples.reserve(last - first);
- std::transform(first, last, std::back_inserter(samples), [](Duration d) { return d.count(); });
-
- auto analysis = Catch::Benchmark::Detail::analyse_samples(cfg.benchmarkConfidenceInterval(), cfg.benchmarkResamples(), samples.begin(), samples.end());
- auto outliers = Catch::Benchmark::Detail::classify_outliers(samples.begin(), samples.end());
-
- auto wrap_estimate = [](Estimate<double> e) {
- return Estimate<Duration> {
- Duration(e.point),
- Duration(e.lower_bound),
- Duration(e.upper_bound),
- e.confidence_interval,
- };
- };
- std::vector<Duration> samples2;
- samples2.reserve(samples.size());
- std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](double d) { return Duration(d); });
- return {
- std::move(samples2),
- wrap_estimate(analysis.mean),
- wrap_estimate(analysis.standard_deviation),
- outliers,
- analysis.outlier_variance,
- };
- } else {
- std::vector<Duration> samples;
- samples.reserve(last - first);
-
- Duration mean = Duration(0);
- int i = 0;
- for (auto it = first; it < last; ++it, ++i) {
- samples.push_back(Duration(*it));
- mean += Duration(*it);
- }
- mean /= i;
-
- return {
- std::move(samples),
- Estimate<Duration>{mean, mean, mean, 0.0},
- Estimate<Duration>{Duration(0), Duration(0), Duration(0), 0.0},
- OutlierClassification{},
- 0.0
- };
- }
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-// end catch_analyse.hpp
-#include <algorithm>
-#include <functional>
-#include <string>
-#include <vector>
-#include <cmath>
-
-namespace Catch {
- namespace Benchmark {
- struct Benchmark {
- Benchmark(std::string &&name)
- : name(std::move(name)) {}
-
- template <class FUN>
- Benchmark(std::string &&name, FUN &&func)
- : fun(std::move(func)), name(std::move(name)) {}
-
- template <typename Clock>
- ExecutionPlan<FloatDuration<Clock>> prepare(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const {
- auto min_time = env.clock_resolution.mean * Detail::minimum_ticks;
- auto run_time = std::max(min_time, std::chrono::duration_cast<decltype(min_time)>(cfg.benchmarkWarmupTime()));
- auto&& test = Detail::run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(run_time), 1, fun);
- int new_iters = static_cast<int>(std::ceil(min_time * test.iterations / test.elapsed));
- return { new_iters, test.elapsed / test.iterations * new_iters * cfg.benchmarkSamples(), fun, std::chrono::duration_cast<FloatDuration<Clock>>(cfg.benchmarkWarmupTime()), Detail::warmup_iterations };
- }
-
- template <typename Clock = default_clock>
- void run() {
- IConfigPtr cfg = getCurrentContext().getConfig();
-
- auto env = Detail::measure_environment<Clock>();
-
- getResultCapture().benchmarkPreparing(name);
- CATCH_TRY{
- auto plan = user_code([&] {
- return prepare<Clock>(*cfg, env);
- });
-
- BenchmarkInfo info {
- name,
- plan.estimated_duration.count(),
- plan.iterations_per_sample,
- cfg->benchmarkSamples(),
- cfg->benchmarkResamples(),
- env.clock_resolution.mean.count(),
- env.clock_cost.mean.count()
- };
-
- getResultCapture().benchmarkStarting(info);
-
- auto samples = user_code([&] {
- return plan.template run<Clock>(*cfg, env);
- });
-
- auto analysis = Detail::analyse(*cfg, env, samples.begin(), samples.end());
- BenchmarkStats<FloatDuration<Clock>> stats{ info, analysis.samples, analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance };
- getResultCapture().benchmarkEnded(stats);
-
- } CATCH_CATCH_ALL{
- if (translateActiveException() != Detail::benchmarkErrorMsg) // benchmark errors have been reported, otherwise rethrow.
- std::rethrow_exception(std::current_exception());
- }
- }
-
- // sets lambda to be used in fun *and* executes benchmark!
- template <typename Fun,
- typename std::enable_if<!Detail::is_related<Fun, Benchmark>::value, int>::type = 0>
- Benchmark & operator=(Fun func) {
- fun = Detail::BenchmarkFunction(func);
- run();
- return *this;
- }
-
- explicit operator bool() {
- return true;
- }
-
- private:
- Detail::BenchmarkFunction fun;
- std::string name;
- };
- }
-} // namespace Catch
-
-#define INTERNAL_CATCH_GET_1_ARG(arg1, arg2, ...) arg1
-#define INTERNAL_CATCH_GET_2_ARG(arg1, arg2, ...) arg2
-
-#define INTERNAL_CATCH_BENCHMARK(BenchmarkName, name, benchmarkIndex)\
- if( Catch::Benchmark::Benchmark BenchmarkName{name} ) \
- BenchmarkName = [&](int benchmarkIndex)
-
-#define INTERNAL_CATCH_BENCHMARK_ADVANCED(BenchmarkName, name)\
- if( Catch::Benchmark::Benchmark BenchmarkName{name} ) \
- BenchmarkName = [&]
-
-// end catch_benchmark.hpp
-// start catch_constructor.hpp
-
-// Constructor and destructor helpers
-
-
-#include <type_traits>
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
- template <typename T, bool Destruct>
- struct ObjectStorage
- {
- using TStorage = typename std::aligned_storage<sizeof(T), std::alignment_of<T>::value>::type;
-
- ObjectStorage() : data() {}
-
- ObjectStorage(const ObjectStorage& other)
- {
- new(&data) T(other.stored_object());
- }
-
- ObjectStorage(ObjectStorage&& other)
- {
- new(&data) T(std::move(other.stored_object()));
- }
-
- ~ObjectStorage() { destruct_on_exit<T>(); }
-
- template <typename... Args>
- void construct(Args&&... args)
- {
- new (&data) T(std::forward<Args>(args)...);
- }
-
- template <bool AllowManualDestruction = !Destruct>
- typename std::enable_if<AllowManualDestruction>::type destruct()
- {
- stored_object().~T();
- }
-
- private:
- // If this is a constructor benchmark, destruct the underlying object
- template <typename U>
- void destruct_on_exit(typename std::enable_if<Destruct, U>::type* = 0) { destruct<true>(); }
- // Otherwise, don't
- template <typename U>
- void destruct_on_exit(typename std::enable_if<!Destruct, U>::type* = 0) { }
-
- T& stored_object() {
- return *static_cast<T*>(static_cast<void*>(&data));
- }
-
- T const& stored_object() const {
- return *static_cast<T*>(static_cast<void*>(&data));
- }
-
- TStorage data;
- };
- }
-
- template <typename T>
- using storage_for = Detail::ObjectStorage<T, true>;
-
- template <typename T>
- using destructable_object = Detail::ObjectStorage<T, false>;
- }
-}
-
-// end catch_constructor.hpp
-// end catch_benchmarking_all.hpp
-#endif
-
-#endif // ! CATCH_CONFIG_IMPL_ONLY
-
-#ifdef CATCH_IMPL
-// start catch_impl.hpp
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wweak-vtables"
-#endif
-
-// Keep these here for external reporters
-// start catch_test_case_tracker.h
-
-#include <string>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-namespace TestCaseTracking {
-
- struct NameAndLocation {
- std::string name;
- SourceLineInfo location;
-
- NameAndLocation( std::string const& _name, SourceLineInfo const& _location );
- friend bool operator==(NameAndLocation const& lhs, NameAndLocation const& rhs) {
- return lhs.name == rhs.name
- && lhs.location == rhs.location;
- }
- };
-
- class ITracker;
-
- using ITrackerPtr = std::shared_ptr<ITracker>;
-
- class ITracker {
- NameAndLocation m_nameAndLocation;
-
- public:
- ITracker(NameAndLocation const& nameAndLoc) :
- m_nameAndLocation(nameAndLoc)
- {}
-
- // static queries
- NameAndLocation const& nameAndLocation() const {
- return m_nameAndLocation;
- }
-
- virtual ~ITracker();
-
- // dynamic queries
- virtual bool isComplete() const = 0; // Successfully completed or failed
- virtual bool isSuccessfullyCompleted() const = 0;
- virtual bool isOpen() const = 0; // Started but not complete
- virtual bool hasChildren() const = 0;
- virtual bool hasStarted() const = 0;
-
- virtual ITracker& parent() = 0;
-
- // actions
- virtual void close() = 0; // Successfully complete
- virtual void fail() = 0;
- virtual void markAsNeedingAnotherRun() = 0;
-
- virtual void addChild( ITrackerPtr const& child ) = 0;
- virtual ITrackerPtr findChild( NameAndLocation const& nameAndLocation ) = 0;
- virtual void openChild() = 0;
-
- // Debug/ checking
- virtual bool isSectionTracker() const = 0;
- virtual bool isGeneratorTracker() const = 0;
- };
-
- class TrackerContext {
-
- enum RunState {
- NotStarted,
- Executing,
- CompletedCycle
- };
-
- ITrackerPtr m_rootTracker;
- ITracker* m_currentTracker = nullptr;
- RunState m_runState = NotStarted;
-
- public:
-
- ITracker& startRun();
- void endRun();
-
- void startCycle();
- void completeCycle();
-
- bool completedCycle() const;
- ITracker& currentTracker();
- void setCurrentTracker( ITracker* tracker );
- };
-
- class TrackerBase : public ITracker {
- protected:
- enum CycleState {
- NotStarted,
- Executing,
- ExecutingChildren,
- NeedsAnotherRun,
- CompletedSuccessfully,
- Failed
- };
-
- using Children = std::vector<ITrackerPtr>;
- TrackerContext& m_ctx;
- ITracker* m_parent;
- Children m_children;
- CycleState m_runState = NotStarted;
-
- public:
- TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent );
-
- bool isComplete() const override;
- bool isSuccessfullyCompleted() const override;
- bool isOpen() const override;
- bool hasChildren() const override;
- bool hasStarted() const override {
- return m_runState != NotStarted;
- }
-
- void addChild( ITrackerPtr const& child ) override;
-
- ITrackerPtr findChild( NameAndLocation const& nameAndLocation ) override;
- ITracker& parent() override;
-
- void openChild() override;
-
- bool isSectionTracker() const override;
- bool isGeneratorTracker() const override;
-
- void open();
-
- void close() override;
- void fail() override;
- void markAsNeedingAnotherRun() override;
-
- private:
- void moveToParent();
- void moveToThis();
- };
-
- class SectionTracker : public TrackerBase {
- std::vector<std::string> m_filters;
- std::string m_trimmed_name;
- public:
- SectionTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent );
-
- bool isSectionTracker() const override;
-
- bool isComplete() const override;
-
- static SectionTracker& acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation );
-
- void tryOpen();
-
- void addInitialFilters( std::vector<std::string> const& filters );
- void addNextFilters( std::vector<std::string> const& filters );
- //! Returns filters active in this tracker
- std::vector<std::string> const& getFilters() const;
- //! Returns whitespace-trimmed name of the tracked section
- std::string const& trimmedName() const;
- };
-
-} // namespace TestCaseTracking
-
-using TestCaseTracking::ITracker;
-using TestCaseTracking::TrackerContext;
-using TestCaseTracking::SectionTracker;
-
-} // namespace Catch
-
-// end catch_test_case_tracker.h
-
-// start catch_leak_detector.h
-
-namespace Catch {
-
- struct LeakDetector {
- LeakDetector();
- ~LeakDetector();
- };
-
-}
-// end catch_leak_detector.h
-// Cpp files will be included in the single-header file here
-// start catch_stats.cpp
-
-// Statistical analysis tools
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-
-#include <cassert>
-#include <random>
-
-#if defined(CATCH_CONFIG_USE_ASYNC)
-#include <future>
-#endif
-
-namespace {
- double erf_inv(double x) {
- // Code accompanying the article "Approximating the erfinv function" in GPU Computing Gems, Volume 2
- double w, p;
-
- w = -log((1.0 - x) * (1.0 + x));
-
- if (w < 6.250000) {
- w = w - 3.125000;
- p = -3.6444120640178196996e-21;
- p = -1.685059138182016589e-19 + p * w;
- p = 1.2858480715256400167e-18 + p * w;
- p = 1.115787767802518096e-17 + p * w;
- p = -1.333171662854620906e-16 + p * w;
- p = 2.0972767875968561637e-17 + p * w;
- p = 6.6376381343583238325e-15 + p * w;
- p = -4.0545662729752068639e-14 + p * w;
- p = -8.1519341976054721522e-14 + p * w;
- p = 2.6335093153082322977e-12 + p * w;
- p = -1.2975133253453532498e-11 + p * w;
- p = -5.4154120542946279317e-11 + p * w;
- p = 1.051212273321532285e-09 + p * w;
- p = -4.1126339803469836976e-09 + p * w;
- p = -2.9070369957882005086e-08 + p * w;
- p = 4.2347877827932403518e-07 + p * w;
- p = -1.3654692000834678645e-06 + p * w;
- p = -1.3882523362786468719e-05 + p * w;
- p = 0.0001867342080340571352 + p * w;
- p = -0.00074070253416626697512 + p * w;
- p = -0.0060336708714301490533 + p * w;
- p = 0.24015818242558961693 + p * w;
- p = 1.6536545626831027356 + p * w;
- } else if (w < 16.000000) {
- w = sqrt(w) - 3.250000;
- p = 2.2137376921775787049e-09;
- p = 9.0756561938885390979e-08 + p * w;
- p = -2.7517406297064545428e-07 + p * w;
- p = 1.8239629214389227755e-08 + p * w;
- p = 1.5027403968909827627e-06 + p * w;
- p = -4.013867526981545969e-06 + p * w;
- p = 2.9234449089955446044e-06 + p * w;
- p = 1.2475304481671778723e-05 + p * w;
- p = -4.7318229009055733981e-05 + p * w;
- p = 6.8284851459573175448e-05 + p * w;
- p = 2.4031110387097893999e-05 + p * w;
- p = -0.0003550375203628474796 + p * w;
- p = 0.00095328937973738049703 + p * w;
- p = -0.0016882755560235047313 + p * w;
- p = 0.0024914420961078508066 + p * w;
- p = -0.0037512085075692412107 + p * w;
- p = 0.005370914553590063617 + p * w;
- p = 1.0052589676941592334 + p * w;
- p = 3.0838856104922207635 + p * w;
- } else {
- w = sqrt(w) - 5.000000;
- p = -2.7109920616438573243e-11;
- p = -2.5556418169965252055e-10 + p * w;
- p = 1.5076572693500548083e-09 + p * w;
- p = -3.7894654401267369937e-09 + p * w;
- p = 7.6157012080783393804e-09 + p * w;
- p = -1.4960026627149240478e-08 + p * w;
- p = 2.9147953450901080826e-08 + p * w;
- p = -6.7711997758452339498e-08 + p * w;
- p = 2.2900482228026654717e-07 + p * w;
- p = -9.9298272942317002539e-07 + p * w;
- p = 4.5260625972231537039e-06 + p * w;
- p = -1.9681778105531670567e-05 + p * w;
- p = 7.5995277030017761139e-05 + p * w;
- p = -0.00021503011930044477347 + p * w;
- p = -0.00013871931833623122026 + p * w;
- p = 1.0103004648645343977 + p * w;
- p = 4.8499064014085844221 + p * w;
- }
- return p * x;
- }
-
- double standard_deviation(std::vector<double>::iterator first, std::vector<double>::iterator last) {
- auto m = Catch::Benchmark::Detail::mean(first, last);
- double variance = std::accumulate(first, last, 0., [m](double a, double b) {
- double diff = b - m;
- return a + diff * diff;
- }) / (last - first);
- return std::sqrt(variance);
- }
-
-}
-
-namespace Catch {
- namespace Benchmark {
- namespace Detail {
-
- double weighted_average_quantile(int k, int q, std::vector<double>::iterator first, std::vector<double>::iterator last) {
- auto count = last - first;
- double idx = (count - 1) * k / static_cast<double>(q);
- int j = static_cast<int>(idx);
- double g = idx - j;
- std::nth_element(first, first + j, last);
- auto xj = first[j];
- if (g == 0) return xj;
-
- auto xj1 = *std::min_element(first + (j + 1), last);
- return xj + g * (xj1 - xj);
- }
-
- double erfc_inv(double x) {
- return erf_inv(1.0 - x);
- }
-
- double normal_quantile(double p) {
- static const double ROOT_TWO = std::sqrt(2.0);
-
- double result = 0.0;
- assert(p >= 0 && p <= 1);
- if (p < 0 || p > 1) {
- return result;
- }
-
- result = -erfc_inv(2.0 * p);
- // result *= normal distribution standard deviation (1.0) * sqrt(2)
- result *= /*sd * */ ROOT_TWO;
- // result += normal disttribution mean (0)
- return result;
- }
-
- double outlier_variance(Estimate<double> mean, Estimate<double> stddev, int n) {
- double sb = stddev.point;
- double mn = mean.point / n;
- double mg_min = mn / 2.;
- double sg = std::min(mg_min / 4., sb / std::sqrt(n));
- double sg2 = sg * sg;
- double sb2 = sb * sb;
-
- auto c_max = [n, mn, sb2, sg2](double x) -> double {
- double k = mn - x;
- double d = k * k;
- double nd = n * d;
- double k0 = -n * nd;
- double k1 = sb2 - n * sg2 + nd;
- double det = k1 * k1 - 4 * sg2 * k0;
- return (int)(-2. * k0 / (k1 + std::sqrt(det)));
- };
-
- auto var_out = [n, sb2, sg2](double c) {
- double nc = n - c;
- return (nc / n) * (sb2 - nc * sg2);
- };
-
- return std::min(var_out(1), var_out(std::min(c_max(0.), c_max(mg_min)))) / sb2;
- }
-
- bootstrap_analysis analyse_samples(double confidence_level, int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last) {
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
- CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
- static std::random_device entropy;
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
-
- auto n = static_cast<int>(last - first); // seriously, one can't use integral types without hell in C++
-
- auto mean = &Detail::mean<std::vector<double>::iterator>;
- auto stddev = &standard_deviation;
-
-#if defined(CATCH_CONFIG_USE_ASYNC)
- auto Estimate = [=](double(*f)(std::vector<double>::iterator, std::vector<double>::iterator)) {
- auto seed = entropy();
- return std::async(std::launch::async, [=] {
- std::mt19937 rng(seed);
- auto resampled = resample(rng, n_resamples, first, last, f);
- return bootstrap(confidence_level, first, last, resampled, f);
- });
- };
-
- auto mean_future = Estimate(mean);
- auto stddev_future = Estimate(stddev);
-
- auto mean_estimate = mean_future.get();
- auto stddev_estimate = stddev_future.get();
-#else
- auto Estimate = [=](double(*f)(std::vector<double>::iterator, std::vector<double>::iterator)) {
- auto seed = entropy();
- std::mt19937 rng(seed);
- auto resampled = resample(rng, n_resamples, first, last, f);
- return bootstrap(confidence_level, first, last, resampled, f);
- };
-
- auto mean_estimate = Estimate(mean);
- auto stddev_estimate = Estimate(stddev);
-#endif // CATCH_USE_ASYNC
-
- double outlier_variance = Detail::outlier_variance(mean_estimate, stddev_estimate, n);
-
- return { mean_estimate, stddev_estimate, outlier_variance };
- }
- } // namespace Detail
- } // namespace Benchmark
-} // namespace Catch
-
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-// end catch_stats.cpp
-// start catch_approx.cpp
-
-#include <cmath>
-#include <limits>
-
-namespace {
-
-// Performs equivalent check of std::fabs(lhs - rhs) <= margin
-// But without the subtraction to allow for INFINITY in comparison
-bool marginComparison(double lhs, double rhs, double margin) {
- return (lhs + margin >= rhs) && (rhs + margin >= lhs);
-}
-
-}
-
-namespace Catch {
-namespace Detail {
-
- Approx::Approx ( double value )
- : m_epsilon( std::numeric_limits<float>::epsilon()*100 ),
- m_margin( 0.0 ),
- m_scale( 0.0 ),
- m_value( value )
- {}
-
- Approx Approx::custom() {
- return Approx( 0 );
- }
-
- Approx Approx::operator-() const {
- auto temp(*this);
- temp.m_value = -temp.m_value;
- return temp;
- }
-
- std::string Approx::toString() const {
- ReusableStringStream rss;
- rss << "Approx( " << ::Catch::Detail::stringify( m_value ) << " )";
- return rss.str();
- }
-
- bool Approx::equalityComparisonImpl(const double other) const {
- // First try with fixed margin, then compute margin based on epsilon, scale and Approx's value
- // Thanks to Richard Harris for his help refining the scaled margin value
- return marginComparison(m_value, other, m_margin)
- || marginComparison(m_value, other, m_epsilon * (m_scale + std::fabs(std::isinf(m_value)? 0 : m_value)));
- }
-
- void Approx::setMargin(double newMargin) {
- CATCH_ENFORCE(newMargin >= 0,
- "Invalid Approx::margin: " << newMargin << '.'
- << " Approx::Margin has to be non-negative.");
- m_margin = newMargin;
- }
-
- void Approx::setEpsilon(double newEpsilon) {
- CATCH_ENFORCE(newEpsilon >= 0 && newEpsilon <= 1.0,
- "Invalid Approx::epsilon: " << newEpsilon << '.'
- << " Approx::epsilon has to be in [0, 1]");
- m_epsilon = newEpsilon;
- }
-
-} // end namespace Detail
-
-namespace literals {
- Detail::Approx operator "" _a(long double val) {
- return Detail::Approx(val);
- }
- Detail::Approx operator "" _a(unsigned long long val) {
- return Detail::Approx(val);
- }
-} // end namespace literals
-
-std::string StringMaker<Catch::Detail::Approx>::convert(Catch::Detail::Approx const& value) {
- return value.toString();
-}
-
-} // end namespace Catch
-// end catch_approx.cpp
-// start catch_assertionhandler.cpp
-
-// start catch_debugger.h
-
-namespace Catch {
- bool isDebuggerActive();
-}
-
-#ifdef CATCH_PLATFORM_MAC
-
- #if defined(__i386__) || defined(__x86_64__)
- #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
- #elif defined(__aarch64__)
- #define CATCH_TRAP() __asm__(".inst 0xd4200000")
- #endif
-
-#elif defined(CATCH_PLATFORM_IPHONE)
-
- // use inline assembler
- #if defined(__i386__) || defined(__x86_64__)
- #define CATCH_TRAP() __asm__("int $3")
- #elif defined(__aarch64__)
- #define CATCH_TRAP() __asm__(".inst 0xd4200000")
- #elif defined(__arm__) && !defined(__thumb__)
- #define CATCH_TRAP() __asm__(".inst 0xe7f001f0")
- #elif defined(__arm__) && defined(__thumb__)
- #define CATCH_TRAP() __asm__(".inst 0xde01")
- #endif
-
-#elif defined(CATCH_PLATFORM_LINUX)
- // If we can use inline assembler, do it because this allows us to break
- // directly at the location of the failing check instead of breaking inside
- // raise() called from it, i.e. one stack frame below.
- #if defined(__GNUC__) && (defined(__i386) || defined(__x86_64))
- #define CATCH_TRAP() asm volatile ("int $3") /* NOLINT */
- #else // Fall back to the generic way.
- #include <signal.h>
-
- #define CATCH_TRAP() raise(SIGTRAP)
- #endif
-#elif defined(_MSC_VER)
- #define CATCH_TRAP() __debugbreak()
-#elif defined(__MINGW32__)
- extern "C" __declspec(dllimport) void __stdcall DebugBreak();
- #define CATCH_TRAP() DebugBreak()
-#endif
-
-#ifndef CATCH_BREAK_INTO_DEBUGGER
- #ifdef CATCH_TRAP
- #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }()
- #else
- #define CATCH_BREAK_INTO_DEBUGGER() []{}()
- #endif
-#endif
-
-// end catch_debugger.h
-// start catch_run_context.h
-
-// start catch_fatal_condition.h
-
-// start catch_windows_h_proxy.h
-
-
-#if defined(CATCH_PLATFORM_WINDOWS)
-
-#if !defined(NOMINMAX) && !defined(CATCH_CONFIG_NO_NOMINMAX)
-# define CATCH_DEFINED_NOMINMAX
-# define NOMINMAX
-#endif
-#if !defined(WIN32_LEAN_AND_MEAN) && !defined(CATCH_CONFIG_NO_WIN32_LEAN_AND_MEAN)
-# define CATCH_DEFINED_WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-#endif
-
-#ifdef __AFXDLL
-#include <AfxWin.h>
-#else
-#include <windows.h>
-#endif
-
-#ifdef CATCH_DEFINED_NOMINMAX
-# undef NOMINMAX
-#endif
-#ifdef CATCH_DEFINED_WIN32_LEAN_AND_MEAN
-# undef WIN32_LEAN_AND_MEAN
-#endif
-
-#endif // defined(CATCH_PLATFORM_WINDOWS)
-
-// end catch_windows_h_proxy.h
-#if defined( CATCH_CONFIG_WINDOWS_SEH )
-
-namespace Catch {
-
- struct FatalConditionHandler {
-
- static LONG CALLBACK handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo);
- FatalConditionHandler();
- static void reset();
- ~FatalConditionHandler();
-
- private:
- static bool isSet;
- static ULONG guaranteeSize;
- static PVOID exceptionHandlerHandle;
- };
-
-} // namespace Catch
-
-#elif defined ( CATCH_CONFIG_POSIX_SIGNALS )
-
-#include <signal.h>
-
-namespace Catch {
-
- struct FatalConditionHandler {
-
- static bool isSet;
- static struct sigaction oldSigActions[];
- static stack_t oldSigStack;
- static char altStackMem[];
-
- static void handleSignal( int sig );
-
- FatalConditionHandler();
- ~FatalConditionHandler();
- static void reset();
- };
-
-} // namespace Catch
-
-#else
-
-namespace Catch {
- struct FatalConditionHandler {
- void reset();
- };
-}
-
-#endif
-
-// end catch_fatal_condition.h
-#include <string>
-
-namespace Catch {
-
- struct IMutableContext;
-
- ///////////////////////////////////////////////////////////////////////////
-
- class RunContext : public IResultCapture, public IRunner {
-
- public:
- RunContext( RunContext const& ) = delete;
- RunContext& operator =( RunContext const& ) = delete;
-
- explicit RunContext( IConfigPtr const& _config, IStreamingReporterPtr&& reporter );
-
- ~RunContext() override;
-
- void testGroupStarting( std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount );
- void testGroupEnded( std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount );
-
- Totals runTest(TestCase const& testCase);
-
- IConfigPtr config() const;
- IStreamingReporter& reporter() const;
-
- public: // IResultCapture
-
- // Assertion handlers
- void handleExpr
- ( AssertionInfo const& info,
- ITransientExpression const& expr,
- AssertionReaction& reaction ) override;
- void handleMessage
- ( AssertionInfo const& info,
- ResultWas::OfType resultType,
- StringRef const& message,
- AssertionReaction& reaction ) override;
- void handleUnexpectedExceptionNotThrown
- ( AssertionInfo const& info,
- AssertionReaction& reaction ) override;
- void handleUnexpectedInflightException
- ( AssertionInfo const& info,
- std::string const& message,
- AssertionReaction& reaction ) override;
- void handleIncomplete
- ( AssertionInfo const& info ) override;
- void handleNonExpr
- ( AssertionInfo const &info,
- ResultWas::OfType resultType,
- AssertionReaction &reaction ) override;
-
- bool sectionStarted( SectionInfo const& sectionInfo, Counts& assertions ) override;
-
- void sectionEnded( SectionEndInfo const& endInfo ) override;
- void sectionEndedEarly( SectionEndInfo const& endInfo ) override;
-
- auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& override;
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void benchmarkPreparing( std::string const& name ) override;
- void benchmarkStarting( BenchmarkInfo const& info ) override;
- void benchmarkEnded( BenchmarkStats<> const& stats ) override;
- void benchmarkFailed( std::string const& error ) override;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void pushScopedMessage( MessageInfo const& message ) override;
- void popScopedMessage( MessageInfo const& message ) override;
-
- void emplaceUnscopedMessage( MessageBuilder const& builder ) override;
-
- std::string getCurrentTestName() const override;
-
- const AssertionResult* getLastResult() const override;
-
- void exceptionEarlyReported() override;
-
- void handleFatalErrorCondition( StringRef message ) override;
-
- bool lastAssertionPassed() override;
-
- void assertionPassed() override;
-
- public:
- // !TBD We need to do this another way!
- bool aborting() const final;
-
- private:
-
- void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr );
- void invokeActiveTestCase();
-
- void resetAssertionInfo();
- bool testForMissingAssertions( Counts& assertions );
-
- void assertionEnded( AssertionResult const& result );
- void reportExpr
- ( AssertionInfo const &info,
- ResultWas::OfType resultType,
- ITransientExpression const *expr,
- bool negated );
-
- void populateReaction( AssertionReaction& reaction );
-
- private:
-
- void handleUnfinishedSections();
-
- TestRunInfo m_runInfo;
- IMutableContext& m_context;
- TestCase const* m_activeTestCase = nullptr;
- ITracker* m_testCaseTracker = nullptr;
- Option<AssertionResult> m_lastResult;
-
- IConfigPtr m_config;
- Totals m_totals;
- IStreamingReporterPtr m_reporter;
- std::vector<MessageInfo> m_messages;
- std::vector<ScopedMessage> m_messageScopes; /* Keeps owners of so-called unscoped messages. */
- AssertionInfo m_lastAssertionInfo;
- std::vector<SectionEndInfo> m_unfinishedSections;
- std::vector<ITracker*> m_activeSections;
- TrackerContext m_trackerContext;
- bool m_lastAssertionPassed = false;
- bool m_shouldReportUnexpected = true;
- bool m_includeSuccessfulResults;
- };
-
- void seedRng(IConfig const& config);
- unsigned int rngSeed();
-} // end namespace Catch
-
-// end catch_run_context.h
-namespace Catch {
-
- namespace {
- auto operator <<( std::ostream& os, ITransientExpression const& expr ) -> std::ostream& {
- expr.streamReconstructedExpression( os );
- return os;
- }
- }
-
- LazyExpression::LazyExpression( bool isNegated )
- : m_isNegated( isNegated )
- {}
-
- LazyExpression::LazyExpression( LazyExpression const& other ) : m_isNegated( other.m_isNegated ) {}
-
- LazyExpression::operator bool() const {
- return m_transientExpression != nullptr;
- }
-
- auto operator << ( std::ostream& os, LazyExpression const& lazyExpr ) -> std::ostream& {
- if( lazyExpr.m_isNegated )
- os << "!";
-
- if( lazyExpr ) {
- if( lazyExpr.m_isNegated && lazyExpr.m_transientExpression->isBinaryExpression() )
- os << "(" << *lazyExpr.m_transientExpression << ")";
- else
- os << *lazyExpr.m_transientExpression;
- }
- else {
- os << "{** error - unchecked empty expression requested **}";
- }
- return os;
- }
-
- AssertionHandler::AssertionHandler
- ( StringRef const& macroName,
- SourceLineInfo const& lineInfo,
- StringRef capturedExpression,
- ResultDisposition::Flags resultDisposition )
- : m_assertionInfo{ macroName, lineInfo, capturedExpression, resultDisposition },
- m_resultCapture( getResultCapture() )
- {}
-
- void AssertionHandler::handleExpr( ITransientExpression const& expr ) {
- m_resultCapture.handleExpr( m_assertionInfo, expr, m_reaction );
- }
- void AssertionHandler::handleMessage(ResultWas::OfType resultType, StringRef const& message) {
- m_resultCapture.handleMessage( m_assertionInfo, resultType, message, m_reaction );
- }
-
- auto AssertionHandler::allowThrows() const -> bool {
- return getCurrentContext().getConfig()->allowThrows();
- }
-
- void AssertionHandler::complete() {
- setCompleted();
- if( m_reaction.shouldDebugBreak ) {
-
- // If you find your debugger stopping you here then go one level up on the
- // call-stack for the code that caused it (typically a failed assertion)
-
- // (To go back to the test and change execution, jump over the throw, next)
- CATCH_BREAK_INTO_DEBUGGER();
- }
- if (m_reaction.shouldThrow) {
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- throw Catch::TestFailureException();
-#else
- CATCH_ERROR( "Test failure requires aborting test!" );
-#endif
- }
- }
- void AssertionHandler::setCompleted() {
- m_completed = true;
- }
-
- void AssertionHandler::handleUnexpectedInflightException() {
- m_resultCapture.handleUnexpectedInflightException( m_assertionInfo, Catch::translateActiveException(), m_reaction );
- }
-
- void AssertionHandler::handleExceptionThrownAsExpected() {
- m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
- }
- void AssertionHandler::handleExceptionNotThrownAsExpected() {
- m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
- }
-
- void AssertionHandler::handleUnexpectedExceptionNotThrown() {
- m_resultCapture.handleUnexpectedExceptionNotThrown( m_assertionInfo, m_reaction );
- }
-
- void AssertionHandler::handleThrowingCallSkipped() {
- m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
- }
-
- // This is the overload that takes a string and infers the Equals matcher from it
- // The more general overload, that takes any string matcher, is in catch_capture_matchers.cpp
- void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef const& matcherString ) {
- handleExceptionMatchExpr( handler, Matchers::Equals( str ), matcherString );
- }
-
-} // namespace Catch
-// end catch_assertionhandler.cpp
-// start catch_assertionresult.cpp
-
-namespace Catch {
- AssertionResultData::AssertionResultData(ResultWas::OfType _resultType, LazyExpression const & _lazyExpression):
- lazyExpression(_lazyExpression),
- resultType(_resultType) {}
-
- std::string AssertionResultData::reconstructExpression() const {
-
- if( reconstructedExpression.empty() ) {
- if( lazyExpression ) {
- ReusableStringStream rss;
- rss << lazyExpression;
- reconstructedExpression = rss.str();
- }
- }
- return reconstructedExpression;
- }
-
- AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data )
- : m_info( info ),
- m_resultData( data )
- {}
-
- // Result was a success
- bool AssertionResult::succeeded() const {
- return Catch::isOk( m_resultData.resultType );
- }
-
- // Result was a success, or failure is suppressed
- bool AssertionResult::isOk() const {
- return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition );
- }
-
- ResultWas::OfType AssertionResult::getResultType() const {
- return m_resultData.resultType;
- }
-
- bool AssertionResult::hasExpression() const {
- return !m_info.capturedExpression.empty();
- }
-
- bool AssertionResult::hasMessage() const {
- return !m_resultData.message.empty();
- }
-
- std::string AssertionResult::getExpression() const {
- // Possibly overallocating by 3 characters should be basically free
- std::string expr; expr.reserve(m_info.capturedExpression.size() + 3);
- if (isFalseTest(m_info.resultDisposition)) {
- expr += "!(";
- }
- expr += m_info.capturedExpression;
- if (isFalseTest(m_info.resultDisposition)) {
- expr += ')';
- }
- return expr;
- }
-
- std::string AssertionResult::getExpressionInMacro() const {
- std::string expr;
- if( m_info.macroName.empty() )
- expr = static_cast<std::string>(m_info.capturedExpression);
- else {
- expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 );
- expr += m_info.macroName;
- expr += "( ";
- expr += m_info.capturedExpression;
- expr += " )";
- }
- return expr;
- }
-
- bool AssertionResult::hasExpandedExpression() const {
- return hasExpression() && getExpandedExpression() != getExpression();
- }
-
- std::string AssertionResult::getExpandedExpression() const {
- std::string expr = m_resultData.reconstructExpression();
- return expr.empty()
- ? getExpression()
- : expr;
- }
-
- std::string AssertionResult::getMessage() const {
- return m_resultData.message;
- }
- SourceLineInfo AssertionResult::getSourceInfo() const {
- return m_info.lineInfo;
- }
-
- StringRef AssertionResult::getTestMacroName() const {
- return m_info.macroName;
- }
-
-} // end namespace Catch
-// end catch_assertionresult.cpp
-// start catch_capture_matchers.cpp
-
-namespace Catch {
-
- using StringMatcher = Matchers::Impl::MatcherBase<std::string>;
-
- // This is the general overload that takes a any string matcher
- // There is another overload, in catch_assertionhandler.h/.cpp, that only takes a string and infers
- // the Equals matcher (so the header does not mention matchers)
- void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef const& matcherString ) {
- std::string exceptionMessage = Catch::translateActiveException();
- MatchExpr<std::string, StringMatcher const&> expr( exceptionMessage, matcher, matcherString );
- handler.handleExpr( expr );
- }
-
-} // namespace Catch
-// end catch_capture_matchers.cpp
-// start catch_commandline.cpp
-
-// start catch_commandline.h
-
-// start catch_clara.h
-
-// Use Catch's value for console width (store Clara's off to the side, if present)
-#ifdef CLARA_CONFIG_CONSOLE_WIDTH
-#define CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#undef CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#endif
-#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_CONFIG_CONSOLE_WIDTH-1
-
-#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wweak-vtables"
-#pragma clang diagnostic ignored "-Wexit-time-destructors"
-#pragma clang diagnostic ignored "-Wshadow"
-#endif
-
-// start clara.hpp
-// Copyright 2017 Two Blue Cubes Ltd. All rights reserved.
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// See https://github.com/philsquared/Clara for more details
-
-// Clara v1.1.5
-
-
-#ifndef CATCH_CLARA_CONFIG_CONSOLE_WIDTH
-#define CATCH_CLARA_CONFIG_CONSOLE_WIDTH 80
-#endif
-
-#ifndef CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_CLARA_CONFIG_CONSOLE_WIDTH
-#endif
-
-#ifndef CLARA_CONFIG_OPTIONAL_TYPE
-#ifdef __has_include
-#if __has_include(<optional>) && __cplusplus >= 201703L
-#include <optional>
-#define CLARA_CONFIG_OPTIONAL_TYPE std::optional
-#endif
-#endif
-#endif
-
-// ----------- #included from clara_textflow.hpp -----------
-
-// TextFlowCpp
-//
-// A single-header library for wrapping and laying out basic text, by Phil Nash
-//
-// Distributed under the Boost Software License, Version 1.0. (See accompanying
-// file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-//
-// This project is hosted at https://github.com/philsquared/textflowcpp
-
-
-#include <cassert>
-#include <ostream>
-#include <sstream>
-#include <vector>
-
-#ifndef CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH
-#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH 80
-#endif
-
-namespace Catch {
-namespace clara {
-namespace TextFlow {
-
-inline auto isWhitespace(char c) -> bool {
- static std::string chars = " \t\n\r";
- return chars.find(c) != std::string::npos;
-}
-inline auto isBreakableBefore(char c) -> bool {
- static std::string chars = "[({<|";
- return chars.find(c) != std::string::npos;
-}
-inline auto isBreakableAfter(char c) -> bool {
- static std::string chars = "])}>.,:;*+-=&/\\";
- return chars.find(c) != std::string::npos;
-}
-
-class Columns;
-
-class Column {
- std::vector<std::string> m_strings;
- size_t m_width = CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH;
- size_t m_indent = 0;
- size_t m_initialIndent = std::string::npos;
-
-public:
- class iterator {
- friend Column;
-
- Column const& m_column;
- size_t m_stringIndex = 0;
- size_t m_pos = 0;
-
- size_t m_len = 0;
- size_t m_end = 0;
- bool m_suffix = false;
-
- iterator(Column const& column, size_t stringIndex)
- : m_column(column),
- m_stringIndex(stringIndex) {}
-
- auto line() const -> std::string const& { return m_column.m_strings[m_stringIndex]; }
-
- auto isBoundary(size_t at) const -> bool {
- assert(at > 0);
- assert(at <= line().size());
-
- return at == line().size() ||
- (isWhitespace(line()[at]) && !isWhitespace(line()[at - 1])) ||
- isBreakableBefore(line()[at]) ||
- isBreakableAfter(line()[at - 1]);
- }
-
- void calcLength() {
- assert(m_stringIndex < m_column.m_strings.size());
-
- m_suffix = false;
- auto width = m_column.m_width - indent();
- m_end = m_pos;
- if (line()[m_pos] == '\n') {
- ++m_end;
- }
- while (m_end < line().size() && line()[m_end] != '\n')
- ++m_end;
-
- if (m_end < m_pos + width) {
- m_len = m_end - m_pos;
- } else {
- size_t len = width;
- while (len > 0 && !isBoundary(m_pos + len))
- --len;
- while (len > 0 && isWhitespace(line()[m_pos + len - 1]))
- --len;
-
- if (len > 0) {
- m_len = len;
- } else {
- m_suffix = true;
- m_len = width - 1;
- }
- }
- }
-
- auto indent() const -> size_t {
- auto initial = m_pos == 0 && m_stringIndex == 0 ? m_column.m_initialIndent : std::string::npos;
- return initial == std::string::npos ? m_column.m_indent : initial;
- }
-
- auto addIndentAndSuffix(std::string const &plain) const -> std::string {
- return std::string(indent(), ' ') + (m_suffix ? plain + "-" : plain);
- }
-
- public:
- using difference_type = std::ptrdiff_t;
- using value_type = std::string;
- using pointer = value_type * ;
- using reference = value_type & ;
- using iterator_category = std::forward_iterator_tag;
-
- explicit iterator(Column const& column) : m_column(column) {
- assert(m_column.m_width > m_column.m_indent);
- assert(m_column.m_initialIndent == std::string::npos || m_column.m_width > m_column.m_initialIndent);
- calcLength();
- if (m_len == 0)
- m_stringIndex++; // Empty string
- }
-
- auto operator *() const -> std::string {
- assert(m_stringIndex < m_column.m_strings.size());
- assert(m_pos <= m_end);
- return addIndentAndSuffix(line().substr(m_pos, m_len));
- }
-
- auto operator ++() -> iterator& {
- m_pos += m_len;
- if (m_pos < line().size() && line()[m_pos] == '\n')
- m_pos += 1;
- else
- while (m_pos < line().size() && isWhitespace(line()[m_pos]))
- ++m_pos;
-
- if (m_pos == line().size()) {
- m_pos = 0;
- ++m_stringIndex;
- }
- if (m_stringIndex < m_column.m_strings.size())
- calcLength();
- return *this;
- }
- auto operator ++(int) -> iterator {
- iterator prev(*this);
- operator++();
- return prev;
- }
-
- auto operator ==(iterator const& other) const -> bool {
- return
- m_pos == other.m_pos &&
- m_stringIndex == other.m_stringIndex &&
- &m_column == &other.m_column;
- }
- auto operator !=(iterator const& other) const -> bool {
- return !operator==(other);
- }
- };
- using const_iterator = iterator;
-
- explicit Column(std::string const& text) { m_strings.push_back(text); }
-
- auto width(size_t newWidth) -> Column& {
- assert(newWidth > 0);
- m_width = newWidth;
- return *this;
- }
- auto indent(size_t newIndent) -> Column& {
- m_indent = newIndent;
- return *this;
- }
- auto initialIndent(size_t newIndent) -> Column& {
- m_initialIndent = newIndent;
- return *this;
- }
-
- auto width() const -> size_t { return m_width; }
- auto begin() const -> iterator { return iterator(*this); }
- auto end() const -> iterator { return { *this, m_strings.size() }; }
-
- inline friend std::ostream& operator << (std::ostream& os, Column const& col) {
- bool first = true;
- for (auto line : col) {
- if (first)
- first = false;
- else
- os << "\n";
- os << line;
- }
- return os;
- }
-
- auto operator + (Column const& other)->Columns;
-
- auto toString() const -> std::string {
- std::ostringstream oss;
- oss << *this;
- return oss.str();
- }
-};
-
-class Spacer : public Column {
-
-public:
- explicit Spacer(size_t spaceWidth) : Column("") {
- width(spaceWidth);
- }
-};
-
-class Columns {
- std::vector<Column> m_columns;
-
-public:
-
- class iterator {
- friend Columns;
- struct EndTag {};
-
- std::vector<Column> const& m_columns;
- std::vector<Column::iterator> m_iterators;
- size_t m_activeIterators;
-
- iterator(Columns const& columns, EndTag)
- : m_columns(columns.m_columns),
- m_activeIterators(0) {
- m_iterators.reserve(m_columns.size());
-
- for (auto const& col : m_columns)
- m_iterators.push_back(col.end());
- }
-
- public:
- using difference_type = std::ptrdiff_t;
- using value_type = std::string;
- using pointer = value_type * ;
- using reference = value_type & ;
- using iterator_category = std::forward_iterator_tag;
-
- explicit iterator(Columns const& columns)
- : m_columns(columns.m_columns),
- m_activeIterators(m_columns.size()) {
- m_iterators.reserve(m_columns.size());
-
- for (auto const& col : m_columns)
- m_iterators.push_back(col.begin());
- }
-
- auto operator ==(iterator const& other) const -> bool {
- return m_iterators == other.m_iterators;
- }
- auto operator !=(iterator const& other) const -> bool {
- return m_iterators != other.m_iterators;
- }
- auto operator *() const -> std::string {
- std::string row, padding;
-
- for (size_t i = 0; i < m_columns.size(); ++i) {
- auto width = m_columns[i].width();
- if (m_iterators[i] != m_columns[i].end()) {
- std::string col = *m_iterators[i];
- row += padding + col;
- if (col.size() < width)
- padding = std::string(width - col.size(), ' ');
- else
- padding = "";
- } else {
- padding += std::string(width, ' ');
- }
- }
- return row;
- }
- auto operator ++() -> iterator& {
- for (size_t i = 0; i < m_columns.size(); ++i) {
- if (m_iterators[i] != m_columns[i].end())
- ++m_iterators[i];
- }
- return *this;
- }
- auto operator ++(int) -> iterator {
- iterator prev(*this);
- operator++();
- return prev;
- }
- };
- using const_iterator = iterator;
-
- auto begin() const -> iterator { return iterator(*this); }
- auto end() const -> iterator { return { *this, iterator::EndTag() }; }
-
- auto operator += (Column const& col) -> Columns& {
- m_columns.push_back(col);
- return *this;
- }
- auto operator + (Column const& col) -> Columns {
- Columns combined = *this;
- combined += col;
- return combined;
- }
-
- inline friend std::ostream& operator << (std::ostream& os, Columns const& cols) {
-
- bool first = true;
- for (auto line : cols) {
- if (first)
- first = false;
- else
- os << "\n";
- os << line;
- }
- return os;
- }
-
- auto toString() const -> std::string {
- std::ostringstream oss;
- oss << *this;
- return oss.str();
- }
-};
-
-inline auto Column::operator + (Column const& other) -> Columns {
- Columns cols;
- cols += *this;
- cols += other;
- return cols;
-}
-}
-
-}
-}
-
-// ----------- end of #include from clara_textflow.hpp -----------
-// ........... back in clara.hpp
-
-#include <cctype>
-#include <string>
-#include <memory>
-#include <set>
-#include <algorithm>
-
-#if !defined(CATCH_PLATFORM_WINDOWS) && ( defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) )
-#define CATCH_PLATFORM_WINDOWS
-#endif
-
-namespace Catch { namespace clara {
-namespace detail {
-
- // Traits for extracting arg and return type of lambdas (for single argument lambdas)
- template<typename L>
- struct UnaryLambdaTraits : UnaryLambdaTraits<decltype( &L::operator() )> {};
-
- template<typename ClassT, typename ReturnT, typename... Args>
- struct UnaryLambdaTraits<ReturnT( ClassT::* )( Args... ) const> {
- static const bool isValid = false;
- };
-
- template<typename ClassT, typename ReturnT, typename ArgT>
- struct UnaryLambdaTraits<ReturnT( ClassT::* )( ArgT ) const> {
- static const bool isValid = true;
- using ArgType = typename std::remove_const<typename std::remove_reference<ArgT>::type>::type;
- using ReturnType = ReturnT;
- };
-
- class TokenStream;
-
- // Transport for raw args (copied from main args, or supplied via init list for testing)
- class Args {
- friend TokenStream;
- std::string m_exeName;
- std::vector<std::string> m_args;
-
- public:
- Args( int argc, char const* const* argv )
- : m_exeName(argv[0]),
- m_args(argv + 1, argv + argc) {}
-
- Args( std::initializer_list<std::string> args )
- : m_exeName( *args.begin() ),
- m_args( args.begin()+1, args.end() )
- {}
-
- auto exeName() const -> std::string {
- return m_exeName;
- }
- };
-
- // Wraps a token coming from a token stream. These may not directly correspond to strings as a single string
- // may encode an option + its argument if the : or = form is used
- enum class TokenType {
- Option, Argument
- };
- struct Token {
- TokenType type;
- std::string token;
- };
-
- inline auto isOptPrefix( char c ) -> bool {
- return c == '-'
-#ifdef CATCH_PLATFORM_WINDOWS
- || c == '/'
-#endif
- ;
- }
-
- // Abstracts iterators into args as a stream of tokens, with option arguments uniformly handled
- class TokenStream {
- using Iterator = std::vector<std::string>::const_iterator;
- Iterator it;
- Iterator itEnd;
- std::vector<Token> m_tokenBuffer;
-
- void loadBuffer() {
- m_tokenBuffer.resize( 0 );
-
- // Skip any empty strings
- while( it != itEnd && it->empty() )
- ++it;
-
- if( it != itEnd ) {
- auto const &next = *it;
- if( isOptPrefix( next[0] ) ) {
- auto delimiterPos = next.find_first_of( " :=" );
- if( delimiterPos != std::string::npos ) {
- m_tokenBuffer.push_back( { TokenType::Option, next.substr( 0, delimiterPos ) } );
- m_tokenBuffer.push_back( { TokenType::Argument, next.substr( delimiterPos + 1 ) } );
- } else {
- if( next[1] != '-' && next.size() > 2 ) {
- std::string opt = "- ";
- for( size_t i = 1; i < next.size(); ++i ) {
- opt[1] = next[i];
- m_tokenBuffer.push_back( { TokenType::Option, opt } );
- }
- } else {
- m_tokenBuffer.push_back( { TokenType::Option, next } );
- }
- }
- } else {
- m_tokenBuffer.push_back( { TokenType::Argument, next } );
- }
- }
- }
-
- public:
- explicit TokenStream( Args const &args ) : TokenStream( args.m_args.begin(), args.m_args.end() ) {}
-
- TokenStream( Iterator it, Iterator itEnd ) : it( it ), itEnd( itEnd ) {
- loadBuffer();
- }
-
- explicit operator bool() const {
- return !m_tokenBuffer.empty() || it != itEnd;
- }
-
- auto count() const -> size_t { return m_tokenBuffer.size() + (itEnd - it); }
-
- auto operator*() const -> Token {
- assert( !m_tokenBuffer.empty() );
- return m_tokenBuffer.front();
- }
-
- auto operator->() const -> Token const * {
- assert( !m_tokenBuffer.empty() );
- return &m_tokenBuffer.front();
- }
-
- auto operator++() -> TokenStream & {
- if( m_tokenBuffer.size() >= 2 ) {
- m_tokenBuffer.erase( m_tokenBuffer.begin() );
- } else {
- if( it != itEnd )
- ++it;
- loadBuffer();
- }
- return *this;
- }
- };
-
- class ResultBase {
- public:
- enum Type {
- Ok, LogicError, RuntimeError
- };
-
- protected:
- ResultBase( Type type ) : m_type( type ) {}
- virtual ~ResultBase() = default;
-
- virtual void enforceOk() const = 0;
-
- Type m_type;
- };
-
- template<typename T>
- class ResultValueBase : public ResultBase {
- public:
- auto value() const -> T const & {
- enforceOk();
- return m_value;
- }
-
- protected:
- ResultValueBase( Type type ) : ResultBase( type ) {}
-
- ResultValueBase( ResultValueBase const &other ) : ResultBase( other ) {
- if( m_type == ResultBase::Ok )
- new( &m_value ) T( other.m_value );
- }
-
- ResultValueBase( Type, T const &value ) : ResultBase( Ok ) {
- new( &m_value ) T( value );
- }
-
- auto operator=( ResultValueBase const &other ) -> ResultValueBase & {
- if( m_type == ResultBase::Ok )
- m_value.~T();
- ResultBase::operator=(other);
- if( m_type == ResultBase::Ok )
- new( &m_value ) T( other.m_value );
- return *this;
- }
-
- ~ResultValueBase() override {
- if( m_type == Ok )
- m_value.~T();
- }
-
- union {
- T m_value;
- };
- };
-
- template<>
- class ResultValueBase<void> : public ResultBase {
- protected:
- using ResultBase::ResultBase;
- };
-
- template<typename T = void>
- class BasicResult : public ResultValueBase<T> {
- public:
- template<typename U>
- explicit BasicResult( BasicResult<U> const &other )
- : ResultValueBase<T>( other.type() ),
- m_errorMessage( other.errorMessage() )
- {
- assert( type() != ResultBase::Ok );
- }
-
- template<typename U>
- static auto ok( U const &value ) -> BasicResult { return { ResultBase::Ok, value }; }
- static auto ok() -> BasicResult { return { ResultBase::Ok }; }
- static auto logicError( std::string const &message ) -> BasicResult { return { ResultBase::LogicError, message }; }
- static auto runtimeError( std::string const &message ) -> BasicResult { return { ResultBase::RuntimeError, message }; }
-
- explicit operator bool() const { return m_type == ResultBase::Ok; }
- auto type() const -> ResultBase::Type { return m_type; }
- auto errorMessage() const -> std::string { return m_errorMessage; }
-
- protected:
- void enforceOk() const override {
-
- // Errors shouldn't reach this point, but if they do
- // the actual error message will be in m_errorMessage
- assert( m_type != ResultBase::LogicError );
- assert( m_type != ResultBase::RuntimeError );
- if( m_type != ResultBase::Ok )
- std::abort();
- }
-
- std::string m_errorMessage; // Only populated if resultType is an error
-
- BasicResult( ResultBase::Type type, std::string const &message )
- : ResultValueBase<T>(type),
- m_errorMessage(message)
- {
- assert( m_type != ResultBase::Ok );
- }
-
- using ResultValueBase<T>::ResultValueBase;
- using ResultBase::m_type;
- };
-
- enum class ParseResultType {
- Matched, NoMatch, ShortCircuitAll, ShortCircuitSame
- };
-
- class ParseState {
- public:
-
- ParseState( ParseResultType type, TokenStream const &remainingTokens )
- : m_type(type),
- m_remainingTokens( remainingTokens )
- {}
-
- auto type() const -> ParseResultType { return m_type; }
- auto remainingTokens() const -> TokenStream { return m_remainingTokens; }
-
- private:
- ParseResultType m_type;
- TokenStream m_remainingTokens;
- };
-
- using Result = BasicResult<void>;
- using ParserResult = BasicResult<ParseResultType>;
- using InternalParseResult = BasicResult<ParseState>;
-
- struct HelpColumns {
- std::string left;
- std::string right;
- };
-
- template<typename T>
- inline auto convertInto( std::string const &source, T& target ) -> ParserResult {
- std::stringstream ss;
- ss << source;
- ss >> target;
- if( ss.fail() )
- return ParserResult::runtimeError( "Unable to convert '" + source + "' to destination type" );
- else
- return ParserResult::ok( ParseResultType::Matched );
- }
- inline auto convertInto( std::string const &source, std::string& target ) -> ParserResult {
- target = source;
- return ParserResult::ok( ParseResultType::Matched );
- }
- inline auto convertInto( std::string const &source, bool &target ) -> ParserResult {
- std::string srcLC = source;
- std::transform( srcLC.begin(), srcLC.end(), srcLC.begin(), []( unsigned char c ) { return static_cast<char>( std::tolower(c) ); } );
- if (srcLC == "y" || srcLC == "1" || srcLC == "true" || srcLC == "yes" || srcLC == "on")
- target = true;
- else if (srcLC == "n" || srcLC == "0" || srcLC == "false" || srcLC == "no" || srcLC == "off")
- target = false;
- else
- return ParserResult::runtimeError( "Expected a boolean value but did not recognise: '" + source + "'" );
- return ParserResult::ok( ParseResultType::Matched );
- }
-#ifdef CLARA_CONFIG_OPTIONAL_TYPE
- template<typename T>
- inline auto convertInto( std::string const &source, CLARA_CONFIG_OPTIONAL_TYPE<T>& target ) -> ParserResult {
- T temp;
- auto result = convertInto( source, temp );
- if( result )
- target = std::move(temp);
- return result;
- }
-#endif // CLARA_CONFIG_OPTIONAL_TYPE
-
- struct NonCopyable {
- NonCopyable() = default;
- NonCopyable( NonCopyable const & ) = delete;
- NonCopyable( NonCopyable && ) = delete;
- NonCopyable &operator=( NonCopyable const & ) = delete;
- NonCopyable &operator=( NonCopyable && ) = delete;
- };
-
- struct BoundRef : NonCopyable {
- virtual ~BoundRef() = default;
- virtual auto isContainer() const -> bool { return false; }
- virtual auto isFlag() const -> bool { return false; }
- };
- struct BoundValueRefBase : BoundRef {
- virtual auto setValue( std::string const &arg ) -> ParserResult = 0;
- };
- struct BoundFlagRefBase : BoundRef {
- virtual auto setFlag( bool flag ) -> ParserResult = 0;
- virtual auto isFlag() const -> bool { return true; }
- };
-
- template<typename T>
- struct BoundValueRef : BoundValueRefBase {
- T &m_ref;
-
- explicit BoundValueRef( T &ref ) : m_ref( ref ) {}
-
- auto setValue( std::string const &arg ) -> ParserResult override {
- return convertInto( arg, m_ref );
- }
- };
-
- template<typename T>
- struct BoundValueRef<std::vector<T>> : BoundValueRefBase {
- std::vector<T> &m_ref;
-
- explicit BoundValueRef( std::vector<T> &ref ) : m_ref( ref ) {}
-
- auto isContainer() const -> bool override { return true; }
-
- auto setValue( std::string const &arg ) -> ParserResult override {
- T temp;
- auto result = convertInto( arg, temp );
- if( result )
- m_ref.push_back( temp );
- return result;
- }
- };
-
- struct BoundFlagRef : BoundFlagRefBase {
- bool &m_ref;
-
- explicit BoundFlagRef( bool &ref ) : m_ref( ref ) {}
-
- auto setFlag( bool flag ) -> ParserResult override {
- m_ref = flag;
- return ParserResult::ok( ParseResultType::Matched );
- }
- };
-
- template<typename ReturnType>
- struct LambdaInvoker {
- static_assert( std::is_same<ReturnType, ParserResult>::value, "Lambda must return void or clara::ParserResult" );
-
- template<typename L, typename ArgType>
- static auto invoke( L const &lambda, ArgType const &arg ) -> ParserResult {
- return lambda( arg );
- }
- };
-
- template<>
- struct LambdaInvoker<void> {
- template<typename L, typename ArgType>
- static auto invoke( L const &lambda, ArgType const &arg ) -> ParserResult {
- lambda( arg );
- return ParserResult::ok( ParseResultType::Matched );
- }
- };
-
- template<typename ArgType, typename L>
- inline auto invokeLambda( L const &lambda, std::string const &arg ) -> ParserResult {
- ArgType temp{};
- auto result = convertInto( arg, temp );
- return !result
- ? result
- : LambdaInvoker<typename UnaryLambdaTraits<L>::ReturnType>::invoke( lambda, temp );
- }
-
- template<typename L>
- struct BoundLambda : BoundValueRefBase {
- L m_lambda;
-
- static_assert( UnaryLambdaTraits<L>::isValid, "Supplied lambda must take exactly one argument" );
- explicit BoundLambda( L const &lambda ) : m_lambda( lambda ) {}
-
- auto setValue( std::string const &arg ) -> ParserResult override {
- return invokeLambda<typename UnaryLambdaTraits<L>::ArgType>( m_lambda, arg );
- }
- };
-
- template<typename L>
- struct BoundFlagLambda : BoundFlagRefBase {
- L m_lambda;
-
- static_assert( UnaryLambdaTraits<L>::isValid, "Supplied lambda must take exactly one argument" );
- static_assert( std::is_same<typename UnaryLambdaTraits<L>::ArgType, bool>::value, "flags must be boolean" );
-
- explicit BoundFlagLambda( L const &lambda ) : m_lambda( lambda ) {}
-
- auto setFlag( bool flag ) -> ParserResult override {
- return LambdaInvoker<typename UnaryLambdaTraits<L>::ReturnType>::invoke( m_lambda, flag );
- }
- };
-
- enum class Optionality { Optional, Required };
-
- struct Parser;
-
- class ParserBase {
- public:
- virtual ~ParserBase() = default;
- virtual auto validate() const -> Result { return Result::ok(); }
- virtual auto parse( std::string const& exeName, TokenStream const &tokens) const -> InternalParseResult = 0;
- virtual auto cardinality() const -> size_t { return 1; }
-
- auto parse( Args const &args ) const -> InternalParseResult {
- return parse( args.exeName(), TokenStream( args ) );
- }
- };
-
- template<typename DerivedT>
- class ComposableParserImpl : public ParserBase {
- public:
- template<typename T>
- auto operator|( T const &other ) const -> Parser;
-
- template<typename T>
- auto operator+( T const &other ) const -> Parser;
- };
-
- // Common code and state for Args and Opts
- template<typename DerivedT>
- class ParserRefImpl : public ComposableParserImpl<DerivedT> {
- protected:
- Optionality m_optionality = Optionality::Optional;
- std::shared_ptr<BoundRef> m_ref;
- std::string m_hint;
- std::string m_description;
-
- explicit ParserRefImpl( std::shared_ptr<BoundRef> const &ref ) : m_ref( ref ) {}
-
- public:
- template<typename T>
- ParserRefImpl( T &ref, std::string const &hint )
- : m_ref( std::make_shared<BoundValueRef<T>>( ref ) ),
- m_hint( hint )
- {}
-
- template<typename LambdaT>
- ParserRefImpl( LambdaT const &ref, std::string const &hint )
- : m_ref( std::make_shared<BoundLambda<LambdaT>>( ref ) ),
- m_hint(hint)
- {}
-
- auto operator()( std::string const &description ) -> DerivedT & {
- m_description = description;
- return static_cast<DerivedT &>( *this );
- }
-
- auto optional() -> DerivedT & {
- m_optionality = Optionality::Optional;
- return static_cast<DerivedT &>( *this );
- };
-
- auto required() -> DerivedT & {
- m_optionality = Optionality::Required;
- return static_cast<DerivedT &>( *this );
- };
-
- auto isOptional() const -> bool {
- return m_optionality == Optionality::Optional;
- }
-
- auto cardinality() const -> size_t override {
- if( m_ref->isContainer() )
- return 0;
- else
- return 1;
- }
-
- auto hint() const -> std::string { return m_hint; }
- };
-
- class ExeName : public ComposableParserImpl<ExeName> {
- std::shared_ptr<std::string> m_name;
- std::shared_ptr<BoundValueRefBase> m_ref;
-
- template<typename LambdaT>
- static auto makeRef(LambdaT const &lambda) -> std::shared_ptr<BoundValueRefBase> {
- return std::make_shared<BoundLambda<LambdaT>>( lambda) ;
- }
-
- public:
- ExeName() : m_name( std::make_shared<std::string>( "<executable>" ) ) {}
-
- explicit ExeName( std::string &ref ) : ExeName() {
- m_ref = std::make_shared<BoundValueRef<std::string>>( ref );
- }
-
- template<typename LambdaT>
- explicit ExeName( LambdaT const& lambda ) : ExeName() {
- m_ref = std::make_shared<BoundLambda<LambdaT>>( lambda );
- }
-
- // The exe name is not parsed out of the normal tokens, but is handled specially
- auto parse( std::string const&, TokenStream const &tokens ) const -> InternalParseResult override {
- return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, tokens ) );
- }
-
- auto name() const -> std::string { return *m_name; }
- auto set( std::string const& newName ) -> ParserResult {
-
- auto lastSlash = newName.find_last_of( "\\/" );
- auto filename = ( lastSlash == std::string::npos )
- ? newName
- : newName.substr( lastSlash+1 );
-
- *m_name = filename;
- if( m_ref )
- return m_ref->setValue( filename );
- else
- return ParserResult::ok( ParseResultType::Matched );
- }
- };
-
- class Arg : public ParserRefImpl<Arg> {
- public:
- using ParserRefImpl::ParserRefImpl;
-
- auto parse( std::string const &, TokenStream const &tokens ) const -> InternalParseResult override {
- auto validationResult = validate();
- if( !validationResult )
- return InternalParseResult( validationResult );
-
- auto remainingTokens = tokens;
- auto const &token = *remainingTokens;
- if( token.type != TokenType::Argument )
- return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) );
-
- assert( !m_ref->isFlag() );
- auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() );
-
- auto result = valueRef->setValue( remainingTokens->token );
- if( !result )
- return InternalParseResult( result );
- else
- return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) );
- }
- };
-
- inline auto normaliseOpt( std::string const &optName ) -> std::string {
-#ifdef CATCH_PLATFORM_WINDOWS
- if( optName[0] == '/' )
- return "-" + optName.substr( 1 );
- else
-#endif
- return optName;
- }
-
- class Opt : public ParserRefImpl<Opt> {
- protected:
- std::vector<std::string> m_optNames;
-
- public:
- template<typename LambdaT>
- explicit Opt( LambdaT const &ref ) : ParserRefImpl( std::make_shared<BoundFlagLambda<LambdaT>>( ref ) ) {}
-
- explicit Opt( bool &ref ) : ParserRefImpl( std::make_shared<BoundFlagRef>( ref ) ) {}
-
- template<typename LambdaT>
- Opt( LambdaT const &ref, std::string const &hint ) : ParserRefImpl( ref, hint ) {}
-
- template<typename T>
- Opt( T &ref, std::string const &hint ) : ParserRefImpl( ref, hint ) {}
-
- auto operator[]( std::string const &optName ) -> Opt & {
- m_optNames.push_back( optName );
- return *this;
- }
-
- auto getHelpColumns() const -> std::vector<HelpColumns> {
- std::ostringstream oss;
- bool first = true;
- for( auto const &opt : m_optNames ) {
- if (first)
- first = false;
- else
- oss << ", ";
- oss << opt;
- }
- if( !m_hint.empty() )
- oss << " <" << m_hint << ">";
- return { { oss.str(), m_description } };
- }
-
- auto isMatch( std::string const &optToken ) const -> bool {
- auto normalisedToken = normaliseOpt( optToken );
- for( auto const &name : m_optNames ) {
- if( normaliseOpt( name ) == normalisedToken )
- return true;
- }
- return false;
- }
-
- using ParserBase::parse;
-
- auto parse( std::string const&, TokenStream const &tokens ) const -> InternalParseResult override {
- auto validationResult = validate();
- if( !validationResult )
- return InternalParseResult( validationResult );
-
- auto remainingTokens = tokens;
- if( remainingTokens && remainingTokens->type == TokenType::Option ) {
- auto const &token = *remainingTokens;
- if( isMatch(token.token ) ) {
- if( m_ref->isFlag() ) {
- auto flagRef = static_cast<detail::BoundFlagRefBase*>( m_ref.get() );
- auto result = flagRef->setFlag( true );
- if( !result )
- return InternalParseResult( result );
- if( result.value() == ParseResultType::ShortCircuitAll )
- return InternalParseResult::ok( ParseState( result.value(), remainingTokens ) );
- } else {
- auto valueRef = static_cast<detail::BoundValueRefBase*>( m_ref.get() );
- ++remainingTokens;
- if( !remainingTokens )
- return InternalParseResult::runtimeError( "Expected argument following " + token.token );
- auto const &argToken = *remainingTokens;
- if( argToken.type != TokenType::Argument )
- return InternalParseResult::runtimeError( "Expected argument following " + token.token );
- auto result = valueRef->setValue( argToken.token );
- if( !result )
- return InternalParseResult( result );
- if( result.value() == ParseResultType::ShortCircuitAll )
- return InternalParseResult::ok( ParseState( result.value(), remainingTokens ) );
- }
- return InternalParseResult::ok( ParseState( ParseResultType::Matched, ++remainingTokens ) );
- }
- }
- return InternalParseResult::ok( ParseState( ParseResultType::NoMatch, remainingTokens ) );
- }
-
- auto validate() const -> Result override {
- if( m_optNames.empty() )
- return Result::logicError( "No options supplied to Opt" );
- for( auto const &name : m_optNames ) {
- if( name.empty() )
- return Result::logicError( "Option name cannot be empty" );
-#ifdef CATCH_PLATFORM_WINDOWS
- if( name[0] != '-' && name[0] != '/' )
- return Result::logicError( "Option name must begin with '-' or '/'" );
-#else
- if( name[0] != '-' )
- return Result::logicError( "Option name must begin with '-'" );
-#endif
- }
- return ParserRefImpl::validate();
- }
- };
-
- struct Help : Opt {
- Help( bool &showHelpFlag )
- : Opt([&]( bool flag ) {
- showHelpFlag = flag;
- return ParserResult::ok( ParseResultType::ShortCircuitAll );
- })
- {
- static_cast<Opt &>( *this )
- ("display usage information")
- ["-?"]["-h"]["--help"]
- .optional();
- }
- };
-
- struct Parser : ParserBase {
-
- mutable ExeName m_exeName;
- std::vector<Opt> m_options;
- std::vector<Arg> m_args;
-
- auto operator|=( ExeName const &exeName ) -> Parser & {
- m_exeName = exeName;
- return *this;
- }
-
- auto operator|=( Arg const &arg ) -> Parser & {
- m_args.push_back(arg);
- return *this;
- }
-
- auto operator|=( Opt const &opt ) -> Parser & {
- m_options.push_back(opt);
- return *this;
- }
-
- auto operator|=( Parser const &other ) -> Parser & {
- m_options.insert(m_options.end(), other.m_options.begin(), other.m_options.end());
- m_args.insert(m_args.end(), other.m_args.begin(), other.m_args.end());
- return *this;
- }
-
- template<typename T>
- auto operator|( T const &other ) const -> Parser {
- return Parser( *this ) |= other;
- }
-
- // Forward deprecated interface with '+' instead of '|'
- template<typename T>
- auto operator+=( T const &other ) -> Parser & { return operator|=( other ); }
- template<typename T>
- auto operator+( T const &other ) const -> Parser { return operator|( other ); }
-
- auto getHelpColumns() const -> std::vector<HelpColumns> {
- std::vector<HelpColumns> cols;
- for (auto const &o : m_options) {
- auto childCols = o.getHelpColumns();
- cols.insert( cols.end(), childCols.begin(), childCols.end() );
- }
- return cols;
- }
-
- void writeToStream( std::ostream &os ) const {
- if (!m_exeName.name().empty()) {
- os << "usage:\n" << " " << m_exeName.name() << " ";
- bool required = true, first = true;
- for( auto const &arg : m_args ) {
- if (first)
- first = false;
- else
- os << " ";
- if( arg.isOptional() && required ) {
- os << "[";
- required = false;
- }
- os << "<" << arg.hint() << ">";
- if( arg.cardinality() == 0 )
- os << " ... ";
- }
- if( !required )
- os << "]";
- if( !m_options.empty() )
- os << " options";
- os << "\n\nwhere options are:" << std::endl;
- }
-
- auto rows = getHelpColumns();
- size_t consoleWidth = CATCH_CLARA_CONFIG_CONSOLE_WIDTH;
- size_t optWidth = 0;
- for( auto const &cols : rows )
- optWidth = (std::max)(optWidth, cols.left.size() + 2);
-
- optWidth = (std::min)(optWidth, consoleWidth/2);
-
- for( auto const &cols : rows ) {
- auto row =
- TextFlow::Column( cols.left ).width( optWidth ).indent( 2 ) +
- TextFlow::Spacer(4) +
- TextFlow::Column( cols.right ).width( consoleWidth - 7 - optWidth );
- os << row << std::endl;
- }
- }
-
- friend auto operator<<( std::ostream &os, Parser const &parser ) -> std::ostream& {
- parser.writeToStream( os );
- return os;
- }
-
- auto validate() const -> Result override {
- for( auto const &opt : m_options ) {
- auto result = opt.validate();
- if( !result )
- return result;
- }
- for( auto const &arg : m_args ) {
- auto result = arg.validate();
- if( !result )
- return result;
- }
- return Result::ok();
- }
-
- using ParserBase::parse;
-
- auto parse( std::string const& exeName, TokenStream const &tokens ) const -> InternalParseResult override {
-
- struct ParserInfo {
- ParserBase const* parser = nullptr;
- size_t count = 0;
- };
- const size_t totalParsers = m_options.size() + m_args.size();
- assert( totalParsers < 512 );
- // ParserInfo parseInfos[totalParsers]; // <-- this is what we really want to do
- ParserInfo parseInfos[512];
-
- {
- size_t i = 0;
- for (auto const &opt : m_options) parseInfos[i++].parser = &opt;
- for (auto const &arg : m_args) parseInfos[i++].parser = &arg;
- }
-
- m_exeName.set( exeName );
-
- auto result = InternalParseResult::ok( ParseState( ParseResultType::NoMatch, tokens ) );
- while( result.value().remainingTokens() ) {
- bool tokenParsed = false;
-
- for( size_t i = 0; i < totalParsers; ++i ) {
- auto& parseInfo = parseInfos[i];
- if( parseInfo.parser->cardinality() == 0 || parseInfo.count < parseInfo.parser->cardinality() ) {
- result = parseInfo.parser->parse(exeName, result.value().remainingTokens());
- if (!result)
- return result;
- if (result.value().type() != ParseResultType::NoMatch) {
- tokenParsed = true;
- ++parseInfo.count;
- break;
- }
- }
- }
-
- if( result.value().type() == ParseResultType::ShortCircuitAll )
- return result;
- if( !tokenParsed )
- return InternalParseResult::runtimeError( "Unrecognised token: " + result.value().remainingTokens()->token );
- }
- // !TBD Check missing required options
- return result;
- }
- };
-
- template<typename DerivedT>
- template<typename T>
- auto ComposableParserImpl<DerivedT>::operator|( T const &other ) const -> Parser {
- return Parser() | static_cast<DerivedT const &>( *this ) | other;
- }
-} // namespace detail
-
-// A Combined parser
-using detail::Parser;
-
-// A parser for options
-using detail::Opt;
-
-// A parser for arguments
-using detail::Arg;
-
-// Wrapper for argc, argv from main()
-using detail::Args;
-
-// Specifies the name of the executable
-using detail::ExeName;
-
-// Convenience wrapper for option parser that specifies the help option
-using detail::Help;
-
-// enum of result types from a parse
-using detail::ParseResultType;
-
-// Result type for parser operation
-using detail::ParserResult;
-
-}} // namespace Catch::clara
-
-// end clara.hpp
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-// Restore Clara's value for console width, if present
-#ifdef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
-#define CATCH_CLARA_TEXTFLOW_CONFIG_CONSOLE_WIDTH CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
-#undef CATCH_TEMP_CLARA_CONFIG_CONSOLE_WIDTH
-#endif
-
-// end catch_clara.h
-namespace Catch {
-
- clara::Parser makeCommandLineParser( ConfigData& config );
-
-} // end namespace Catch
-
-// end catch_commandline.h
-#include <fstream>
-#include <ctime>
-
-namespace Catch {
-
- clara::Parser makeCommandLineParser( ConfigData& config ) {
-
- using namespace clara;
-
- auto const setWarning = [&]( std::string const& warning ) {
- auto warningSet = [&]() {
- if( warning == "NoAssertions" )
- return WarnAbout::NoAssertions;
-
- if ( warning == "NoTests" )
- return WarnAbout::NoTests;
-
- return WarnAbout::Nothing;
- }();
-
- if (warningSet == WarnAbout::Nothing)
- return ParserResult::runtimeError( "Unrecognised warning: '" + warning + "'" );
- config.warnings = static_cast<WarnAbout::What>( config.warnings | warningSet );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const loadTestNamesFromFile = [&]( std::string const& filename ) {
- std::ifstream f( filename.c_str() );
- if( !f.is_open() )
- return ParserResult::runtimeError( "Unable to load input file: '" + filename + "'" );
-
- std::string line;
- while( std::getline( f, line ) ) {
- line = trim(line);
- if( !line.empty() && !startsWith( line, '#' ) ) {
- if( !startsWith( line, '"' ) )
- line = '"' + line + '"';
- config.testsOrTags.push_back( line );
- config.testsOrTags.emplace_back( "," );
- }
- }
- //Remove comma in the end
- if(!config.testsOrTags.empty())
- config.testsOrTags.erase( config.testsOrTags.end()-1 );
-
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setTestOrder = [&]( std::string const& order ) {
- if( startsWith( "declared", order ) )
- config.runOrder = RunTests::InDeclarationOrder;
- else if( startsWith( "lexical", order ) )
- config.runOrder = RunTests::InLexicographicalOrder;
- else if( startsWith( "random", order ) )
- config.runOrder = RunTests::InRandomOrder;
- else
- return clara::ParserResult::runtimeError( "Unrecognised ordering: '" + order + "'" );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setRngSeed = [&]( std::string const& seed ) {
- if( seed != "time" )
- return clara::detail::convertInto( seed, config.rngSeed );
- config.rngSeed = static_cast<unsigned int>( std::time(nullptr) );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setColourUsage = [&]( std::string const& useColour ) {
- auto mode = toLower( useColour );
-
- if( mode == "yes" )
- config.useColour = UseColour::Yes;
- else if( mode == "no" )
- config.useColour = UseColour::No;
- else if( mode == "auto" )
- config.useColour = UseColour::Auto;
- else
- return ParserResult::runtimeError( "colour mode must be one of: auto, yes or no. '" + useColour + "' not recognised" );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setWaitForKeypress = [&]( std::string const& keypress ) {
- auto keypressLc = toLower( keypress );
- if (keypressLc == "never")
- config.waitForKeypress = WaitForKeypress::Never;
- else if( keypressLc == "start" )
- config.waitForKeypress = WaitForKeypress::BeforeStart;
- else if( keypressLc == "exit" )
- config.waitForKeypress = WaitForKeypress::BeforeExit;
- else if( keypressLc == "both" )
- config.waitForKeypress = WaitForKeypress::BeforeStartAndExit;
- else
- return ParserResult::runtimeError( "keypress argument must be one of: never, start, exit or both. '" + keypress + "' not recognised" );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setVerbosity = [&]( std::string const& verbosity ) {
- auto lcVerbosity = toLower( verbosity );
- if( lcVerbosity == "quiet" )
- config.verbosity = Verbosity::Quiet;
- else if( lcVerbosity == "normal" )
- config.verbosity = Verbosity::Normal;
- else if( lcVerbosity == "high" )
- config.verbosity = Verbosity::High;
- else
- return ParserResult::runtimeError( "Unrecognised verbosity, '" + verbosity + "'" );
- return ParserResult::ok( ParseResultType::Matched );
- };
- auto const setReporter = [&]( std::string const& reporter ) {
- IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
-
- auto lcReporter = toLower( reporter );
- auto result = factories.find( lcReporter );
-
- if( factories.end() != result )
- config.reporterName = lcReporter;
- else
- return ParserResult::runtimeError( "Unrecognized reporter, '" + reporter + "'. Check available with --list-reporters" );
- return ParserResult::ok( ParseResultType::Matched );
- };
-
- auto cli
- = ExeName( config.processName )
- | Help( config.showHelp )
- | Opt( config.listTests )
- ["-l"]["--list-tests"]
- ( "list all/matching test cases" )
- | Opt( config.listTags )
- ["-t"]["--list-tags"]
- ( "list all/matching tags" )
- | Opt( config.showSuccessfulTests )
- ["-s"]["--success"]
- ( "include successful tests in output" )
- | Opt( config.shouldDebugBreak )
- ["-b"]["--break"]
- ( "break into debugger on failure" )
- | Opt( config.noThrow )
- ["-e"]["--nothrow"]
- ( "skip exception tests" )
- | Opt( config.showInvisibles )
- ["-i"]["--invisibles"]
- ( "show invisibles (tabs, newlines)" )
- | Opt( config.outputFilename, "filename" )
- ["-o"]["--out"]
- ( "output filename" )
- | Opt( setReporter, "name" )
- ["-r"]["--reporter"]
- ( "reporter to use (defaults to console)" )
- | Opt( config.name, "name" )
- ["-n"]["--name"]
- ( "suite name" )
- | Opt( [&]( bool ){ config.abortAfter = 1; } )
- ["-a"]["--abort"]
- ( "abort at first failure" )
- | Opt( [&]( int x ){ config.abortAfter = x; }, "no. failures" )
- ["-x"]["--abortx"]
- ( "abort after x failures" )
- | Opt( setWarning, "warning name" )
- ["-w"]["--warn"]
- ( "enable warnings" )
- | Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" )
- ["-d"]["--durations"]
- ( "show test durations" )
- | Opt( config.minDuration, "seconds" )
- ["-D"]["--min-duration"]
- ( "show test durations for tests taking at least the given number of seconds" )
- | Opt( loadTestNamesFromFile, "filename" )
- ["-f"]["--input-file"]
- ( "load test names to run from a file" )
- | Opt( config.filenamesAsTags )
- ["-#"]["--filenames-as-tags"]
- ( "adds a tag for the filename" )
- | Opt( config.sectionsToRun, "section name" )
- ["-c"]["--section"]
- ( "specify section to run" )
- | Opt( setVerbosity, "quiet|normal|high" )
- ["-v"]["--verbosity"]
- ( "set output verbosity" )
- | Opt( config.listTestNamesOnly )
- ["--list-test-names-only"]
- ( "list all/matching test cases names only" )
- | Opt( config.listReporters )
- ["--list-reporters"]
- ( "list all reporters" )
- | Opt( setTestOrder, "decl|lex|rand" )
- ["--order"]
- ( "test case order (defaults to decl)" )
- | Opt( setRngSeed, "'time'|number" )
- ["--rng-seed"]
- ( "set a specific seed for random numbers" )
- | Opt( setColourUsage, "yes|no" )
- ["--use-colour"]
- ( "should output be colourised" )
- | Opt( config.libIdentify )
- ["--libidentify"]
- ( "report name and version according to libidentify standard" )
- | Opt( setWaitForKeypress, "never|start|exit|both" )
- ["--wait-for-keypress"]
- ( "waits for a keypress before exiting" )
- | Opt( config.benchmarkSamples, "samples" )
- ["--benchmark-samples"]
- ( "number of samples to collect (default: 100)" )
- | Opt( config.benchmarkResamples, "resamples" )
- ["--benchmark-resamples"]
- ( "number of resamples for the bootstrap (default: 100000)" )
- | Opt( config.benchmarkConfidenceInterval, "confidence interval" )
- ["--benchmark-confidence-interval"]
- ( "confidence interval for the bootstrap (between 0 and 1, default: 0.95)" )
- | Opt( config.benchmarkNoAnalysis )
- ["--benchmark-no-analysis"]
- ( "perform only measurements; do not perform any analysis" )
- | Opt( config.benchmarkWarmupTime, "benchmarkWarmupTime" )
- ["--benchmark-warmup-time"]
- ( "amount of time in milliseconds spent on warming up each test (default: 100)" )
- | Arg( config.testsOrTags, "test name|pattern|tags" )
- ( "which test or tests to use" );
-
- return cli;
- }
-
-} // end namespace Catch
-// end catch_commandline.cpp
-// start catch_common.cpp
-
-#include <cstring>
-#include <ostream>
-
-namespace Catch {
-
- bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const noexcept {
- return line == other.line && (file == other.file || std::strcmp(file, other.file) == 0);
- }
- bool SourceLineInfo::operator < ( SourceLineInfo const& other ) const noexcept {
- // We can assume that the same file will usually have the same pointer.
- // Thus, if the pointers are the same, there is no point in calling the strcmp
- return line < other.line || ( line == other.line && file != other.file && (std::strcmp(file, other.file) < 0));
- }
-
- std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) {
-#ifndef __GNUG__
- os << info.file << '(' << info.line << ')';
-#else
- os << info.file << ':' << info.line;
-#endif
- return os;
- }
-
- std::string StreamEndStop::operator+() const {
- return std::string();
- }
-
- NonCopyable::NonCopyable() = default;
- NonCopyable::~NonCopyable() = default;
-
-}
-// end catch_common.cpp
-// start catch_config.cpp
-
-namespace Catch {
-
- Config::Config( ConfigData const& data )
- : m_data( data ),
- m_stream( openStream() )
- {
- // We need to trim filter specs to avoid trouble with superfluous
- // whitespace (esp. important for bdd macros, as those are manually
- // aligned with whitespace).
-
- for (auto& elem : m_data.testsOrTags) {
- elem = trim(elem);
- }
- for (auto& elem : m_data.sectionsToRun) {
- elem = trim(elem);
- }
-
- TestSpecParser parser(ITagAliasRegistry::get());
- if (!m_data.testsOrTags.empty()) {
- m_hasTestFilters = true;
- for (auto const& testOrTags : m_data.testsOrTags) {
- parser.parse(testOrTags);
- }
- }
- m_testSpec = parser.testSpec();
- }
-
- std::string const& Config::getFilename() const {
- return m_data.outputFilename ;
- }
-
- bool Config::listTests() const { return m_data.listTests; }
- bool Config::listTestNamesOnly() const { return m_data.listTestNamesOnly; }
- bool Config::listTags() const { return m_data.listTags; }
- bool Config::listReporters() const { return m_data.listReporters; }
-
- std::string Config::getProcessName() const { return m_data.processName; }
- std::string const& Config::getReporterName() const { return m_data.reporterName; }
-
- std::vector<std::string> const& Config::getTestsOrTags() const { return m_data.testsOrTags; }
- std::vector<std::string> const& Config::getSectionsToRun() const { return m_data.sectionsToRun; }
-
- TestSpec const& Config::testSpec() const { return m_testSpec; }
- bool Config::hasTestFilters() const { return m_hasTestFilters; }
-
- bool Config::showHelp() const { return m_data.showHelp; }
-
- // IConfig interface
- bool Config::allowThrows() const { return !m_data.noThrow; }
- std::ostream& Config::stream() const { return m_stream->stream(); }
- std::string Config::name() const { return m_data.name.empty() ? m_data.processName : m_data.name; }
- bool Config::includeSuccessfulResults() const { return m_data.showSuccessfulTests; }
- bool Config::warnAboutMissingAssertions() const { return !!(m_data.warnings & WarnAbout::NoAssertions); }
- bool Config::warnAboutNoTests() const { return !!(m_data.warnings & WarnAbout::NoTests); }
- ShowDurations::OrNot Config::showDurations() const { return m_data.showDurations; }
- double Config::minDuration() const { return m_data.minDuration; }
- RunTests::InWhatOrder Config::runOrder() const { return m_data.runOrder; }
- unsigned int Config::rngSeed() const { return m_data.rngSeed; }
- UseColour::YesOrNo Config::useColour() const { return m_data.useColour; }
- bool Config::shouldDebugBreak() const { return m_data.shouldDebugBreak; }
- int Config::abortAfter() const { return m_data.abortAfter; }
- bool Config::showInvisibles() const { return m_data.showInvisibles; }
- Verbosity Config::verbosity() const { return m_data.verbosity; }
-
- bool Config::benchmarkNoAnalysis() const { return m_data.benchmarkNoAnalysis; }
- int Config::benchmarkSamples() const { return m_data.benchmarkSamples; }
- double Config::benchmarkConfidenceInterval() const { return m_data.benchmarkConfidenceInterval; }
- unsigned int Config::benchmarkResamples() const { return m_data.benchmarkResamples; }
- std::chrono::milliseconds Config::benchmarkWarmupTime() const { return std::chrono::milliseconds(m_data.benchmarkWarmupTime); }
-
- IStream const* Config::openStream() {
- return Catch::makeStream(m_data.outputFilename);
- }
-
-} // end namespace Catch
-// end catch_config.cpp
-// start catch_console_colour.cpp
-
-#if defined(__clang__)
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wexit-time-destructors"
-#endif
-
-// start catch_errno_guard.h
-
-namespace Catch {
-
- class ErrnoGuard {
- public:
- ErrnoGuard();
- ~ErrnoGuard();
- private:
- int m_oldErrno;
- };
-
-}
-
-// end catch_errno_guard.h
-#include <sstream>
-
-namespace Catch {
- namespace {
-
- struct IColourImpl {
- virtual ~IColourImpl() = default;
- virtual void use( Colour::Code _colourCode ) = 0;
- };
-
- struct NoColourImpl : IColourImpl {
- void use( Colour::Code ) override {}
-
- static IColourImpl* instance() {
- static NoColourImpl s_instance;
- return &s_instance;
- }
- };
-
- } // anon namespace
-} // namespace Catch
-
-#if !defined( CATCH_CONFIG_COLOUR_NONE ) && !defined( CATCH_CONFIG_COLOUR_WINDOWS ) && !defined( CATCH_CONFIG_COLOUR_ANSI )
-# ifdef CATCH_PLATFORM_WINDOWS
-# define CATCH_CONFIG_COLOUR_WINDOWS
-# else
-# define CATCH_CONFIG_COLOUR_ANSI
-# endif
-#endif
-
-#if defined ( CATCH_CONFIG_COLOUR_WINDOWS ) /////////////////////////////////////////
-
-namespace Catch {
-namespace {
-
- class Win32ColourImpl : public IColourImpl {
- public:
- Win32ColourImpl() : stdoutHandle( GetStdHandle(STD_OUTPUT_HANDLE) )
- {
- CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
- GetConsoleScreenBufferInfo( stdoutHandle, &csbiInfo );
- originalForegroundAttributes = csbiInfo.wAttributes & ~( BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY );
- originalBackgroundAttributes = csbiInfo.wAttributes & ~( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY );
- }
-
- void use( Colour::Code _colourCode ) override {
- switch( _colourCode ) {
- case Colour::None: return setTextAttribute( originalForegroundAttributes );
- case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
- case Colour::Red: return setTextAttribute( FOREGROUND_RED );
- case Colour::Green: return setTextAttribute( FOREGROUND_GREEN );
- case Colour::Blue: return setTextAttribute( FOREGROUND_BLUE );
- case Colour::Cyan: return setTextAttribute( FOREGROUND_BLUE | FOREGROUND_GREEN );
- case Colour::Yellow: return setTextAttribute( FOREGROUND_RED | FOREGROUND_GREEN );
- case Colour::Grey: return setTextAttribute( 0 );
-
- case Colour::LightGrey: return setTextAttribute( FOREGROUND_INTENSITY );
- case Colour::BrightRed: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED );
- case Colour::BrightGreen: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN );
- case Colour::BrightWhite: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
- case Colour::BrightYellow: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN );
-
- case Colour::Bright: CATCH_INTERNAL_ERROR( "not a colour" );
-
- default:
- CATCH_ERROR( "Unknown colour requested" );
- }
- }
-
- private:
- void setTextAttribute( WORD _textAttribute ) {
- SetConsoleTextAttribute( stdoutHandle, _textAttribute | originalBackgroundAttributes );
- }
- HANDLE stdoutHandle;
- WORD originalForegroundAttributes;
- WORD originalBackgroundAttributes;
- };
-
- IColourImpl* platformColourInstance() {
- static Win32ColourImpl s_instance;
-
- IConfigPtr config = getCurrentContext().getConfig();
- UseColour::YesOrNo colourMode = config
- ? config->useColour()
- : UseColour::Auto;
- if( colourMode == UseColour::Auto )
- colourMode = UseColour::Yes;
- return colourMode == UseColour::Yes
- ? &s_instance
- : NoColourImpl::instance();
- }
-
-} // end anon namespace
-} // end namespace Catch
-
-#elif defined( CATCH_CONFIG_COLOUR_ANSI ) //////////////////////////////////////
-
-#include <unistd.h>
-
-namespace Catch {
-namespace {
-
- // use POSIX/ ANSI console terminal codes
- // Thanks to Adam Strzelecki for original contribution
- // (http://github.com/nanoant)
- // https://github.com/philsquared/Catch/pull/131
- class PosixColourImpl : public IColourImpl {
- public:
- void use( Colour::Code _colourCode ) override {
- switch( _colourCode ) {
- case Colour::None:
- case Colour::White: return setColour( "[0m" );
- case Colour::Red: return setColour( "[0;31m" );
- case Colour::Green: return setColour( "[0;32m" );
- case Colour::Blue: return setColour( "[0;34m" );
- case Colour::Cyan: return setColour( "[0;36m" );
- case Colour::Yellow: return setColour( "[0;33m" );
- case Colour::Grey: return setColour( "[1;30m" );
-
- case Colour::LightGrey: return setColour( "[0;37m" );
- case Colour::BrightRed: return setColour( "[1;31m" );
- case Colour::BrightGreen: return setColour( "[1;32m" );
- case Colour::BrightWhite: return setColour( "[1;37m" );
- case Colour::BrightYellow: return setColour( "[1;33m" );
-
- case Colour::Bright: CATCH_INTERNAL_ERROR( "not a colour" );
- default: CATCH_INTERNAL_ERROR( "Unknown colour requested" );
- }
- }
- static IColourImpl* instance() {
- static PosixColourImpl s_instance;
- return &s_instance;
- }
-
- private:
- void setColour( const char* _escapeCode ) {
- getCurrentContext().getConfig()->stream()
- << '\033' << _escapeCode;
- }
- };
-
- bool useColourOnPlatform() {
- return
-#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
- !isDebuggerActive() &&
-#endif
-#if !(defined(__DJGPP__) && defined(__STRICT_ANSI__))
- isatty(STDOUT_FILENO)
-#else
- false
-#endif
- ;
- }
- IColourImpl* platformColourInstance() {
- ErrnoGuard guard;
- IConfigPtr config = getCurrentContext().getConfig();
- UseColour::YesOrNo colourMode = config
- ? config->useColour()
- : UseColour::Auto;
- if( colourMode == UseColour::Auto )
- colourMode = useColourOnPlatform()
- ? UseColour::Yes
- : UseColour::No;
- return colourMode == UseColour::Yes
- ? PosixColourImpl::instance()
- : NoColourImpl::instance();
- }
-
-} // end anon namespace
-} // end namespace Catch
-
-#else // not Windows or ANSI ///////////////////////////////////////////////
-
-namespace Catch {
-
- static IColourImpl* platformColourInstance() { return NoColourImpl::instance(); }
-
-} // end namespace Catch
-
-#endif // Windows/ ANSI/ None
-
-namespace Catch {
-
- Colour::Colour( Code _colourCode ) { use( _colourCode ); }
- Colour::Colour( Colour&& other ) noexcept {
- m_moved = other.m_moved;
- other.m_moved = true;
- }
- Colour& Colour::operator=( Colour&& other ) noexcept {
- m_moved = other.m_moved;
- other.m_moved = true;
- return *this;
- }
-
- Colour::~Colour(){ if( !m_moved ) use( None ); }
-
- void Colour::use( Code _colourCode ) {
- static IColourImpl* impl = platformColourInstance();
- // Strictly speaking, this cannot possibly happen.
- // However, under some conditions it does happen (see #1626),
- // and this change is small enough that we can let practicality
- // triumph over purity in this case.
- if (impl != nullptr) {
- impl->use( _colourCode );
- }
- }
-
- std::ostream& operator << ( std::ostream& os, Colour const& ) {
- return os;
- }
-
-} // end namespace Catch
-
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif
-
-// end catch_console_colour.cpp
-// start catch_context.cpp
-
-namespace Catch {
-
- class Context : public IMutableContext, NonCopyable {
-
- public: // IContext
- IResultCapture* getResultCapture() override {
- return m_resultCapture;
- }
- IRunner* getRunner() override {
- return m_runner;
- }
-
- IConfigPtr const& getConfig() const override {
- return m_config;
- }
-
- ~Context() override;
-
- public: // IMutableContext
- void setResultCapture( IResultCapture* resultCapture ) override {
- m_resultCapture = resultCapture;
- }
- void setRunner( IRunner* runner ) override {
- m_runner = runner;
- }
- void setConfig( IConfigPtr const& config ) override {
- m_config = config;
- }
-
- friend IMutableContext& getCurrentMutableContext();
-
- private:
- IConfigPtr m_config;
- IRunner* m_runner = nullptr;
- IResultCapture* m_resultCapture = nullptr;
- };
-
- IMutableContext *IMutableContext::currentContext = nullptr;
-
- void IMutableContext::createContext()
- {
- currentContext = new Context();
- }
-
- void cleanUpContext() {
- delete IMutableContext::currentContext;
- IMutableContext::currentContext = nullptr;
- }
- IContext::~IContext() = default;
- IMutableContext::~IMutableContext() = default;
- Context::~Context() = default;
-
- SimplePcg32& rng() {
- static SimplePcg32 s_rng;
- return s_rng;
- }
-
-}
-// end catch_context.cpp
-// start catch_debug_console.cpp
-
-// start catch_debug_console.h
-
-#include <string>
-
-namespace Catch {
- void writeToDebugConsole( std::string const& text );
-}
-
-// end catch_debug_console.h
-#if defined(CATCH_CONFIG_ANDROID_LOGWRITE)
-#include <android/log.h>
-
- namespace Catch {
- void writeToDebugConsole( std::string const& text ) {
- __android_log_write( ANDROID_LOG_DEBUG, "Catch", text.c_str() );
- }
- }
-
-#elif defined(CATCH_PLATFORM_WINDOWS)
-
- namespace Catch {
- void writeToDebugConsole( std::string const& text ) {
- ::OutputDebugStringA( text.c_str() );
- }
- }
-
-#else
-
- namespace Catch {
- void writeToDebugConsole( std::string const& text ) {
- // !TBD: Need a version for Mac/ XCode and other IDEs
- Catch::cout() << text;
- }
- }
-
-#endif // Platform
-// end catch_debug_console.cpp
-// start catch_debugger.cpp
-
-#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
-
-# include <cassert>
-# include <sys/types.h>
-# include <unistd.h>
-# include <cstddef>
-# include <ostream>
-
-#ifdef __apple_build_version__
- // These headers will only compile with AppleClang (XCode)
- // For other compilers (Clang, GCC, ... ) we need to exclude them
-# include <sys/sysctl.h>
-#endif
-
- namespace Catch {
- #ifdef __apple_build_version__
- // The following function is taken directly from the following technical note:
- // https://developer.apple.com/library/archive/qa/qa1361/_index.html
-
- // Returns true if the current process is being debugged (either
- // running under the debugger or has a debugger attached post facto).
- bool isDebuggerActive(){
- int mib[4];
- struct kinfo_proc info;
- std::size_t size;
-
- // Initialize the flags so that, if sysctl fails for some bizarre
- // reason, we get a predictable result.
-
- info.kp_proc.p_flag = 0;
-
- // Initialize mib, which tells sysctl the info we want, in this case
- // we're looking for information about a specific process ID.
-
- mib[0] = CTL_KERN;
- mib[1] = KERN_PROC;
- mib[2] = KERN_PROC_PID;
- mib[3] = getpid();
-
- // Call sysctl.
-
- size = sizeof(info);
- if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, nullptr, 0) != 0 ) {
- Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n" << std::endl;
- return false;
- }
-
- // We're being debugged if the P_TRACED flag is set.
-
- return ( (info.kp_proc.p_flag & P_TRACED) != 0 );
- }
- #else
- bool isDebuggerActive() {
- // We need to find another way to determine this for non-appleclang compilers on macOS
- return false;
- }
- #endif
- } // namespace Catch
-
-#elif defined(CATCH_PLATFORM_LINUX)
- #include <fstream>
- #include <string>
-
- namespace Catch{
- // The standard POSIX way of detecting a debugger is to attempt to
- // ptrace() the process, but this needs to be done from a child and not
- // this process itself to still allow attaching to this process later
- // if wanted, so is rather heavy. Under Linux we have the PID of the
- // "debugger" (which doesn't need to be gdb, of course, it could also
- // be strace, for example) in /proc/$PID/status, so just get it from
- // there instead.
- bool isDebuggerActive(){
- // Libstdc++ has a bug, where std::ifstream sets errno to 0
- // This way our users can properly assert over errno values
- ErrnoGuard guard;
- std::ifstream in("/proc/self/status");
- for( std::string line; std::getline(in, line); ) {
- static const int PREFIX_LEN = 11;
- if( line.compare(0, PREFIX_LEN, "TracerPid:\t") == 0 ) {
- // We're traced if the PID is not 0 and no other PID starts
- // with 0 digit, so it's enough to check for just a single
- // character.
- return line.length() > PREFIX_LEN && line[PREFIX_LEN] != '0';
- }
- }
-
- return false;
- }
- } // namespace Catch
-#elif defined(_MSC_VER)
- extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
- namespace Catch {
- bool isDebuggerActive() {
- return IsDebuggerPresent() != 0;
- }
- }
-#elif defined(__MINGW32__)
- extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
- namespace Catch {
- bool isDebuggerActive() {
- return IsDebuggerPresent() != 0;
- }
- }
-#else
- namespace Catch {
- bool isDebuggerActive() { return false; }
- }
-#endif // Platform
-// end catch_debugger.cpp
-// start catch_decomposer.cpp
-
-namespace Catch {
-
- ITransientExpression::~ITransientExpression() = default;
-
- void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ) {
- if( lhs.size() + rhs.size() < 40 &&
- lhs.find('\n') == std::string::npos &&
- rhs.find('\n') == std::string::npos )
- os << lhs << " " << op << " " << rhs;
- else
- os << lhs << "\n" << op << "\n" << rhs;
- }
-}
-// end catch_decomposer.cpp
-// start catch_enforce.cpp
-
-#include <stdexcept>
-
-namespace Catch {
-#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER)
- [[noreturn]]
- void throw_exception(std::exception const& e) {
- Catch::cerr() << "Catch will terminate because it needed to throw an exception.\n"
- << "The message was: " << e.what() << '\n';
- std::terminate();
- }
-#endif
-
- [[noreturn]]
- void throw_logic_error(std::string const& msg) {
- throw_exception(std::logic_error(msg));
- }
-
- [[noreturn]]
- void throw_domain_error(std::string const& msg) {
- throw_exception(std::domain_error(msg));
- }
-
- [[noreturn]]
- void throw_runtime_error(std::string const& msg) {
- throw_exception(std::runtime_error(msg));
- }
-
-} // namespace Catch;
-// end catch_enforce.cpp
-// start catch_enum_values_registry.cpp
-// start catch_enum_values_registry.h
-
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- namespace Detail {
-
- std::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int> const& values );
-
- class EnumValuesRegistry : public IMutableEnumValuesRegistry {
-
- std::vector<std::unique_ptr<EnumInfo>> m_enumInfos;
-
- EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values) override;
- };
-
- std::vector<StringRef> parseEnums( StringRef enums );
-
- } // Detail
-
-} // Catch
-
-// end catch_enum_values_registry.h
-
-#include <map>
-#include <cassert>
-
-namespace Catch {
-
- IMutableEnumValuesRegistry::~IMutableEnumValuesRegistry() {}
-
- namespace Detail {
-
- namespace {
- // Extracts the actual name part of an enum instance
- // In other words, it returns the Blue part of Bikeshed::Colour::Blue
- StringRef extractInstanceName(StringRef enumInstance) {
- // Find last occurence of ":"
- size_t name_start = enumInstance.size();
- while (name_start > 0 && enumInstance[name_start - 1] != ':') {
- --name_start;
- }
- return enumInstance.substr(name_start, enumInstance.size() - name_start);
- }
- }
-
- std::vector<StringRef> parseEnums( StringRef enums ) {
- auto enumValues = splitStringRef( enums, ',' );
- std::vector<StringRef> parsed;
- parsed.reserve( enumValues.size() );
- for( auto const& enumValue : enumValues ) {
- parsed.push_back(trim(extractInstanceName(enumValue)));
- }
- return parsed;
- }
-
- EnumInfo::~EnumInfo() {}
-
- StringRef EnumInfo::lookup( int value ) const {
- for( auto const& valueToName : m_values ) {
- if( valueToName.first == value )
- return valueToName.second;
- }
- return "{** unexpected enum value **}"_sr;
- }
-
- std::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
- std::unique_ptr<EnumInfo> enumInfo( new EnumInfo );
- enumInfo->m_name = enumName;
- enumInfo->m_values.reserve( values.size() );
-
- const auto valueNames = Catch::Detail::parseEnums( allValueNames );
- assert( valueNames.size() == values.size() );
- std::size_t i = 0;
- for( auto value : values )
- enumInfo->m_values.emplace_back(value, valueNames[i++]);
-
- return enumInfo;
- }
-
- EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
- m_enumInfos.push_back(makeEnumInfo(enumName, allValueNames, values));
- return *m_enumInfos.back();
- }
-
- } // Detail
-} // Catch
-
-// end catch_enum_values_registry.cpp
-// start catch_errno_guard.cpp
-
-#include <cerrno>
-
-namespace Catch {
- ErrnoGuard::ErrnoGuard():m_oldErrno(errno){}
- ErrnoGuard::~ErrnoGuard() { errno = m_oldErrno; }
-}
-// end catch_errno_guard.cpp
-// start catch_exception_translator_registry.cpp
-
-// start catch_exception_translator_registry.h
-
-#include <vector>
-#include <string>
-#include <memory>
-
-namespace Catch {
-
- class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry {
- public:
- ~ExceptionTranslatorRegistry();
- virtual void registerTranslator( const IExceptionTranslator* translator );
- std::string translateActiveException() const override;
- std::string tryTranslators() const;
-
- private:
- std::vector<std::unique_ptr<IExceptionTranslator const>> m_translators;
- };
-}
-
-// end catch_exception_translator_registry.h
-#ifdef __OBJC__
-#import "Foundation/Foundation.h"
-#endif
-
-namespace Catch {
-
- ExceptionTranslatorRegistry::~ExceptionTranslatorRegistry() {
- }
-
- void ExceptionTranslatorRegistry::registerTranslator( const IExceptionTranslator* translator ) {
- m_translators.push_back( std::unique_ptr<const IExceptionTranslator>( translator ) );
- }
-
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- std::string ExceptionTranslatorRegistry::translateActiveException() const {
- try {
-#ifdef __OBJC__
- // In Objective-C try objective-c exceptions first
- @try {
- return tryTranslators();
- }
- @catch (NSException *exception) {
- return Catch::Detail::stringify( [exception description] );
- }
-#else
- // Compiling a mixed mode project with MSVC means that CLR
- // exceptions will be caught in (...) as well. However, these
- // do not fill-in std::current_exception and thus lead to crash
- // when attempting rethrow.
- // /EHa switch also causes structured exceptions to be caught
- // here, but they fill-in current_exception properly, so
- // at worst the output should be a little weird, instead of
- // causing a crash.
- if (std::current_exception() == nullptr) {
- return "Non C++ exception. Possibly a CLR exception.";
- }
- return tryTranslators();
-#endif
- }
- catch( TestFailureException& ) {
- std::rethrow_exception(std::current_exception());
- }
- catch( std::exception& ex ) {
- return ex.what();
- }
- catch( std::string& msg ) {
- return msg;
- }
- catch( const char* msg ) {
- return msg;
- }
- catch(...) {
- return "Unknown exception";
- }
- }
-
- std::string ExceptionTranslatorRegistry::tryTranslators() const {
- if (m_translators.empty()) {
- std::rethrow_exception(std::current_exception());
- } else {
- return m_translators[0]->translate(m_translators.begin() + 1, m_translators.end());
- }
- }
-
-#else // ^^ Exceptions are enabled // Exceptions are disabled vv
- std::string ExceptionTranslatorRegistry::translateActiveException() const {
- CATCH_INTERNAL_ERROR("Attempted to translate active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
- }
-
- std::string ExceptionTranslatorRegistry::tryTranslators() const {
- CATCH_INTERNAL_ERROR("Attempted to use exception translators under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
- }
-#endif
-
-}
-// end catch_exception_translator_registry.cpp
-// start catch_fatal_condition.cpp
-
-#if defined(__GNUC__)
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
-#endif
-
-#if defined( CATCH_CONFIG_WINDOWS_SEH ) || defined( CATCH_CONFIG_POSIX_SIGNALS )
-
-namespace {
- // Report the error condition
- void reportFatal( char const * const message ) {
- Catch::getCurrentContext().getResultCapture()->handleFatalErrorCondition( message );
- }
-}
-
-#endif // signals/SEH handling
-
-#if defined( CATCH_CONFIG_WINDOWS_SEH )
-
-namespace Catch {
- struct SignalDefs { DWORD id; const char* name; };
-
- // There is no 1-1 mapping between signals and windows exceptions.
- // Windows can easily distinguish between SO and SigSegV,
- // but SigInt, SigTerm, etc are handled differently.
- static SignalDefs signalDefs[] = {
- { static_cast<DWORD>(EXCEPTION_ILLEGAL_INSTRUCTION), "SIGILL - Illegal instruction signal" },
- { static_cast<DWORD>(EXCEPTION_STACK_OVERFLOW), "SIGSEGV - Stack overflow" },
- { static_cast<DWORD>(EXCEPTION_ACCESS_VIOLATION), "SIGSEGV - Segmentation violation signal" },
- { static_cast<DWORD>(EXCEPTION_INT_DIVIDE_BY_ZERO), "Divide by zero error" },
- };
-
- LONG CALLBACK FatalConditionHandler::handleVectoredException(PEXCEPTION_POINTERS ExceptionInfo) {
- for (auto const& def : signalDefs) {
- if (ExceptionInfo->ExceptionRecord->ExceptionCode == def.id) {
- reportFatal(def.name);
- }
- }
- // If its not an exception we care about, pass it along.
- // This stops us from eating debugger breaks etc.
- return EXCEPTION_CONTINUE_SEARCH;
- }
-
- FatalConditionHandler::FatalConditionHandler() {
- isSet = true;
- // 32k seems enough for Catch to handle stack overflow,
- // but the value was found experimentally, so there is no strong guarantee
- guaranteeSize = 32 * 1024;
- exceptionHandlerHandle = nullptr;
- // Register as first handler in current chain
- exceptionHandlerHandle = AddVectoredExceptionHandler(1, handleVectoredException);
- // Pass in guarantee size to be filled
- SetThreadStackGuarantee(&guaranteeSize);
- }
-
- void FatalConditionHandler::reset() {
- if (isSet) {
- RemoveVectoredExceptionHandler(exceptionHandlerHandle);
- SetThreadStackGuarantee(&guaranteeSize);
- exceptionHandlerHandle = nullptr;
- isSet = false;
- }
- }
-
- FatalConditionHandler::~FatalConditionHandler() {
- reset();
- }
-
-bool FatalConditionHandler::isSet = false;
-ULONG FatalConditionHandler::guaranteeSize = 0;
-PVOID FatalConditionHandler::exceptionHandlerHandle = nullptr;
-
-} // namespace Catch
-
-#elif defined( CATCH_CONFIG_POSIX_SIGNALS )
-
-namespace Catch {
-
- struct SignalDefs {
- int id;
- const char* name;
- };
-
- // 32kb for the alternate stack seems to be sufficient. However, this value
- // is experimentally determined, so that's not guaranteed.
- static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
-
- static SignalDefs signalDefs[] = {
- { SIGINT, "SIGINT - Terminal interrupt signal" },
- { SIGILL, "SIGILL - Illegal instruction signal" },
- { SIGFPE, "SIGFPE - Floating point error signal" },
- { SIGSEGV, "SIGSEGV - Segmentation violation signal" },
- { SIGTERM, "SIGTERM - Termination request signal" },
- { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" }
- };
-
- void FatalConditionHandler::handleSignal( int sig ) {
- char const * name = "<unknown signal>";
- for (auto const& def : signalDefs) {
- if (sig == def.id) {
- name = def.name;
- break;
- }
- }
- reset();
- reportFatal(name);
- raise( sig );
- }
-
- FatalConditionHandler::FatalConditionHandler() {
- isSet = true;
- stack_t sigStack;
- sigStack.ss_sp = altStackMem;
- sigStack.ss_size = sigStackSize;
- sigStack.ss_flags = 0;
- sigaltstack(&sigStack, &oldSigStack);
- struct sigaction sa = { };
-
- sa.sa_handler = handleSignal;
- sa.sa_flags = SA_ONSTACK;
- for (std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i) {
- sigaction(signalDefs[i].id, &sa, &oldSigActions[i]);
- }
- }
-
- FatalConditionHandler::~FatalConditionHandler() {
- reset();
- }
-
- void FatalConditionHandler::reset() {
- if( isSet ) {
- // Set signals back to previous values -- hopefully nobody overwrote them in the meantime
- for( std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i ) {
- sigaction(signalDefs[i].id, &oldSigActions[i], nullptr);
- }
- // Return the old stack
- sigaltstack(&oldSigStack, nullptr);
- isSet = false;
- }
- }
-
- bool FatalConditionHandler::isSet = false;
- struct sigaction FatalConditionHandler::oldSigActions[sizeof(signalDefs)/sizeof(SignalDefs)] = {};
- stack_t FatalConditionHandler::oldSigStack = {};
- char FatalConditionHandler::altStackMem[sigStackSize] = {};
-
-} // namespace Catch
-
-#else
-
-namespace Catch {
- void FatalConditionHandler::reset() {}
-}
-
-#endif // signals/SEH handling
-
-#if defined(__GNUC__)
-# pragma GCC diagnostic pop
-#endif
-// end catch_fatal_condition.cpp
-// start catch_generators.cpp
-
-#include <limits>
-#include <set>
-
-namespace Catch {
-
-IGeneratorTracker::~IGeneratorTracker() {}
-
-const char* GeneratorException::what() const noexcept {
- return m_msg;
-}
-
-namespace Generators {
-
- GeneratorUntypedBase::~GeneratorUntypedBase() {}
-
- auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
- return getResultCapture().acquireGeneratorTracker( generatorName, lineInfo );
- }
-
-} // namespace Generators
-} // namespace Catch
-// end catch_generators.cpp
-// start catch_interfaces_capture.cpp
-
-namespace Catch {
- IResultCapture::~IResultCapture() = default;
-}
-// end catch_interfaces_capture.cpp
-// start catch_interfaces_config.cpp
-
-namespace Catch {
- IConfig::~IConfig() = default;
-}
-// end catch_interfaces_config.cpp
-// start catch_interfaces_exception.cpp
-
-namespace Catch {
- IExceptionTranslator::~IExceptionTranslator() = default;
- IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() = default;
-}
-// end catch_interfaces_exception.cpp
-// start catch_interfaces_registry_hub.cpp
-
-namespace Catch {
- IRegistryHub::~IRegistryHub() = default;
- IMutableRegistryHub::~IMutableRegistryHub() = default;
-}
-// end catch_interfaces_registry_hub.cpp
-// start catch_interfaces_reporter.cpp
-
-// start catch_reporter_listening.h
-
-namespace Catch {
-
- class ListeningReporter : public IStreamingReporter {
- using Reporters = std::vector<IStreamingReporterPtr>;
- Reporters m_listeners;
- IStreamingReporterPtr m_reporter = nullptr;
- ReporterPreferences m_preferences;
-
- public:
- ListeningReporter();
-
- void addListener( IStreamingReporterPtr&& listener );
- void addReporter( IStreamingReporterPtr&& reporter );
-
- public: // IStreamingReporter
-
- ReporterPreferences getPreferences() const override;
-
- void noMatchingTestCases( std::string const& spec ) override;
-
- void reportInvalidArguments(std::string const&arg) override;
-
- static std::set<Verbosity> getSupportedVerbosities();
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void benchmarkPreparing(std::string const& name) override;
- void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override;
- void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override;
- void benchmarkFailed(std::string const&) override;
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void testRunStarting( TestRunInfo const& testRunInfo ) override;
- void testGroupStarting( GroupInfo const& groupInfo ) override;
- void testCaseStarting( TestCaseInfo const& testInfo ) override;
- void sectionStarting( SectionInfo const& sectionInfo ) override;
- void assertionStarting( AssertionInfo const& assertionInfo ) override;
-
- // The return value indicates if the messages buffer should be cleared:
- bool assertionEnded( AssertionStats const& assertionStats ) override;
- void sectionEnded( SectionStats const& sectionStats ) override;
- void testCaseEnded( TestCaseStats const& testCaseStats ) override;
- void testGroupEnded( TestGroupStats const& testGroupStats ) override;
- void testRunEnded( TestRunStats const& testRunStats ) override;
-
- void skipTest( TestCaseInfo const& testInfo ) override;
- bool isMulti() const override;
-
- };
-
-} // end namespace Catch
-
-// end catch_reporter_listening.h
-namespace Catch {
-
- ReporterConfig::ReporterConfig( IConfigPtr const& _fullConfig )
- : m_stream( &_fullConfig->stream() ), m_fullConfig( _fullConfig ) {}
-
- ReporterConfig::ReporterConfig( IConfigPtr const& _fullConfig, std::ostream& _stream )
- : m_stream( &_stream ), m_fullConfig( _fullConfig ) {}
-
- std::ostream& ReporterConfig::stream() const { return *m_stream; }
- IConfigPtr ReporterConfig::fullConfig() const { return m_fullConfig; }
-
- TestRunInfo::TestRunInfo( std::string const& _name ) : name( _name ) {}
-
- GroupInfo::GroupInfo( std::string const& _name,
- std::size_t _groupIndex,
- std::size_t _groupsCount )
- : name( _name ),
- groupIndex( _groupIndex ),
- groupsCounts( _groupsCount )
- {}
-
- AssertionStats::AssertionStats( AssertionResult const& _assertionResult,
- std::vector<MessageInfo> const& _infoMessages,
- Totals const& _totals )
- : assertionResult( _assertionResult ),
- infoMessages( _infoMessages ),
- totals( _totals )
- {
- assertionResult.m_resultData.lazyExpression.m_transientExpression = _assertionResult.m_resultData.lazyExpression.m_transientExpression;
-
- if( assertionResult.hasMessage() ) {
- // Copy message into messages list.
- // !TBD This should have been done earlier, somewhere
- MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() );
- builder << assertionResult.getMessage();
- builder.m_info.message = builder.m_stream.str();
-
- infoMessages.push_back( builder.m_info );
- }
- }
-
- AssertionStats::~AssertionStats() = default;
-
- SectionStats::SectionStats( SectionInfo const& _sectionInfo,
- Counts const& _assertions,
- double _durationInSeconds,
- bool _missingAssertions )
- : sectionInfo( _sectionInfo ),
- assertions( _assertions ),
- durationInSeconds( _durationInSeconds ),
- missingAssertions( _missingAssertions )
- {}
-
- SectionStats::~SectionStats() = default;
-
- TestCaseStats::TestCaseStats( TestCaseInfo const& _testInfo,
- Totals const& _totals,
- std::string const& _stdOut,
- std::string const& _stdErr,
- bool _aborting )
- : testInfo( _testInfo ),
- totals( _totals ),
- stdOut( _stdOut ),
- stdErr( _stdErr ),
- aborting( _aborting )
- {}
-
- TestCaseStats::~TestCaseStats() = default;
-
- TestGroupStats::TestGroupStats( GroupInfo const& _groupInfo,
- Totals const& _totals,
- bool _aborting )
- : groupInfo( _groupInfo ),
- totals( _totals ),
- aborting( _aborting )
- {}
-
- TestGroupStats::TestGroupStats( GroupInfo const& _groupInfo )
- : groupInfo( _groupInfo ),
- aborting( false )
- {}
-
- TestGroupStats::~TestGroupStats() = default;
-
- TestRunStats::TestRunStats( TestRunInfo const& _runInfo,
- Totals const& _totals,
- bool _aborting )
- : runInfo( _runInfo ),
- totals( _totals ),
- aborting( _aborting )
- {}
-
- TestRunStats::~TestRunStats() = default;
-
- void IStreamingReporter::fatalErrorEncountered( StringRef ) {}
- bool IStreamingReporter::isMulti() const { return false; }
-
- IReporterFactory::~IReporterFactory() = default;
- IReporterRegistry::~IReporterRegistry() = default;
-
-} // end namespace Catch
-// end catch_interfaces_reporter.cpp
-// start catch_interfaces_runner.cpp
-
-namespace Catch {
- IRunner::~IRunner() = default;
-}
-// end catch_interfaces_runner.cpp
-// start catch_interfaces_testcase.cpp
-
-namespace Catch {
- ITestInvoker::~ITestInvoker() = default;
- ITestCaseRegistry::~ITestCaseRegistry() = default;
-}
-// end catch_interfaces_testcase.cpp
-// start catch_leak_detector.cpp
-
-#ifdef CATCH_CONFIG_WINDOWS_CRTDBG
-#include <crtdbg.h>
-
-namespace Catch {
-
- LeakDetector::LeakDetector() {
- int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
- flag |= _CRTDBG_LEAK_CHECK_DF;
- flag |= _CRTDBG_ALLOC_MEM_DF;
- _CrtSetDbgFlag(flag);
- _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
- _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
- // Change this to leaking allocation's number to break there
- _CrtSetBreakAlloc(-1);
- }
-}
-
-#else
-
- Catch::LeakDetector::LeakDetector() {}
-
-#endif
-
-Catch::LeakDetector::~LeakDetector() {
- Catch::cleanUp();
-}
-// end catch_leak_detector.cpp
-// start catch_list.cpp
-
-// start catch_list.h
-
-#include <set>
-
-namespace Catch {
-
- std::size_t listTests( Config const& config );
-
- std::size_t listTestsNamesOnly( Config const& config );
-
- struct TagInfo {
- void add( std::string const& spelling );
- std::string all() const;
-
- std::set<std::string> spellings;
- std::size_t count = 0;
- };
-
- std::size_t listTags( Config const& config );
-
- std::size_t listReporters();
-
- Option<std::size_t> list( std::shared_ptr<Config> const& config );
-
-} // end namespace Catch
-
-// end catch_list.h
-// start catch_text.h
-
-namespace Catch {
- using namespace clara::TextFlow;
-}
-
-// end catch_text.h
-#include <limits>
-#include <algorithm>
-#include <iomanip>
-
-namespace Catch {
-
- std::size_t listTests( Config const& config ) {
- TestSpec const& testSpec = config.testSpec();
- if( config.hasTestFilters() )
- Catch::cout() << "Matching test cases:\n";
- else {
- Catch::cout() << "All available test cases:\n";
- }
-
- auto matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
- for( auto const& testCaseInfo : matchedTestCases ) {
- Colour::Code colour = testCaseInfo.isHidden()
- ? Colour::SecondaryText
- : Colour::None;
- Colour colourGuard( colour );
-
- Catch::cout() << Column( testCaseInfo.name ).initialIndent( 2 ).indent( 4 ) << "\n";
- if( config.verbosity() >= Verbosity::High ) {
- Catch::cout() << Column( Catch::Detail::stringify( testCaseInfo.lineInfo ) ).indent(4) << std::endl;
- std::string description = testCaseInfo.description;
- if( description.empty() )
- description = "(NO DESCRIPTION)";
- Catch::cout() << Column( description ).indent(4) << std::endl;
- }
- if( !testCaseInfo.tags.empty() )
- Catch::cout() << Column( testCaseInfo.tagsAsString() ).indent( 6 ) << "\n";
- }
-
- if( !config.hasTestFilters() )
- Catch::cout() << pluralise( matchedTestCases.size(), "test case" ) << '\n' << std::endl;
- else
- Catch::cout() << pluralise( matchedTestCases.size(), "matching test case" ) << '\n' << std::endl;
- return matchedTestCases.size();
- }
-
- std::size_t listTestsNamesOnly( Config const& config ) {
- TestSpec const& testSpec = config.testSpec();
- std::size_t matchedTests = 0;
- std::vector<TestCase> matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
- for( auto const& testCaseInfo : matchedTestCases ) {
- matchedTests++;
- if( startsWith( testCaseInfo.name, '#' ) )
- Catch::cout() << '"' << testCaseInfo.name << '"';
- else
- Catch::cout() << testCaseInfo.name;
- if ( config.verbosity() >= Verbosity::High )
- Catch::cout() << "\t@" << testCaseInfo.lineInfo;
- Catch::cout() << std::endl;
- }
- return matchedTests;
- }
-
- void TagInfo::add( std::string const& spelling ) {
- ++count;
- spellings.insert( spelling );
- }
-
- std::string TagInfo::all() const {
- size_t size = 0;
- for (auto const& spelling : spellings) {
- // Add 2 for the brackes
- size += spelling.size() + 2;
- }
-
- std::string out; out.reserve(size);
- for (auto const& spelling : spellings) {
- out += '[';
- out += spelling;
- out += ']';
- }
- return out;
- }
-
- std::size_t listTags( Config const& config ) {
- TestSpec const& testSpec = config.testSpec();
- if( config.hasTestFilters() )
- Catch::cout() << "Tags for matching test cases:\n";
- else {
- Catch::cout() << "All available tags:\n";
- }
-
- std::map<std::string, TagInfo> tagCounts;
-
- std::vector<TestCase> matchedTestCases = filterTests( getAllTestCasesSorted( config ), testSpec, config );
- for( auto const& testCase : matchedTestCases ) {
- for( auto const& tagName : testCase.getTestCaseInfo().tags ) {
- std::string lcaseTagName = toLower( tagName );
- auto countIt = tagCounts.find( lcaseTagName );
- if( countIt == tagCounts.end() )
- countIt = tagCounts.insert( std::make_pair( lcaseTagName, TagInfo() ) ).first;
- countIt->second.add( tagName );
- }
- }
-
- for( auto const& tagCount : tagCounts ) {
- ReusableStringStream rss;
- rss << " " << std::setw(2) << tagCount.second.count << " ";
- auto str = rss.str();
- auto wrapper = Column( tagCount.second.all() )
- .initialIndent( 0 )
- .indent( str.size() )
- .width( CATCH_CONFIG_CONSOLE_WIDTH-10 );
- Catch::cout() << str << wrapper << '\n';
- }
- Catch::cout() << pluralise( tagCounts.size(), "tag" ) << '\n' << std::endl;
- return tagCounts.size();
- }
-
- std::size_t listReporters() {
- Catch::cout() << "Available reporters:\n";
- IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
- std::size_t maxNameLen = 0;
- for( auto const& factoryKvp : factories )
- maxNameLen = (std::max)( maxNameLen, factoryKvp.first.size() );
-
- for( auto const& factoryKvp : factories ) {
- Catch::cout()
- << Column( factoryKvp.first + ":" )
- .indent(2)
- .width( 5+maxNameLen )
- + Column( factoryKvp.second->getDescription() )
- .initialIndent(0)
- .indent(2)
- .width( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen-8 )
- << "\n";
- }
- Catch::cout() << std::endl;
- return factories.size();
- }
-
- Option<std::size_t> list( std::shared_ptr<Config> const& config ) {
- Option<std::size_t> listedCount;
- getCurrentMutableContext().setConfig( config );
- if( config->listTests() )
- listedCount = listedCount.valueOr(0) + listTests( *config );
- if( config->listTestNamesOnly() )
- listedCount = listedCount.valueOr(0) + listTestsNamesOnly( *config );
- if( config->listTags() )
- listedCount = listedCount.valueOr(0) + listTags( *config );
- if( config->listReporters() )
- listedCount = listedCount.valueOr(0) + listReporters();
- return listedCount;
- }
-
-} // end namespace Catch
-// end catch_list.cpp
-// start catch_matchers.cpp
-
-namespace Catch {
-namespace Matchers {
- namespace Impl {
-
- std::string MatcherUntypedBase::toString() const {
- if( m_cachedToString.empty() )
- m_cachedToString = describe();
- return m_cachedToString;
- }
-
- MatcherUntypedBase::~MatcherUntypedBase() = default;
-
- } // namespace Impl
-} // namespace Matchers
-
-using namespace Matchers;
-using Matchers::Impl::MatcherBase;
-
-} // namespace Catch
-// end catch_matchers.cpp
-// start catch_matchers_exception.cpp
-
-namespace Catch {
-namespace Matchers {
-namespace Exception {
-
-bool ExceptionMessageMatcher::match(std::exception const& ex) const {
- return ex.what() == m_message;
-}
-
-std::string ExceptionMessageMatcher::describe() const {
- return "exception message matches \"" + m_message + "\"";
-}
-
-}
-Exception::ExceptionMessageMatcher Message(std::string const& message) {
- return Exception::ExceptionMessageMatcher(message);
-}
-
-// namespace Exception
-} // namespace Matchers
-} // namespace Catch
-// end catch_matchers_exception.cpp
-// start catch_matchers_floating.cpp
-
-// start catch_polyfills.hpp
-
-namespace Catch {
- bool isnan(float f);
- bool isnan(double d);
-}
-
-// end catch_polyfills.hpp
-// start catch_to_string.hpp
-
-#include <string>
-
-namespace Catch {
- template <typename T>
- std::string to_string(T const& t) {
-#if defined(CATCH_CONFIG_CPP11_TO_STRING)
- return std::to_string(t);
-#else
- ReusableStringStream rss;
- rss << t;
- return rss.str();
-#endif
- }
-} // end namespace Catch
-
-// end catch_to_string.hpp
-#include <algorithm>
-#include <cmath>
-#include <cstdlib>
-#include <cstdint>
-#include <cstring>
-#include <sstream>
-#include <type_traits>
-#include <iomanip>
-#include <limits>
-
-namespace Catch {
-namespace {
-
- int32_t convert(float f) {
- static_assert(sizeof(float) == sizeof(int32_t), "Important ULP matcher assumption violated");
- int32_t i;
- std::memcpy(&i, &f, sizeof(f));
- return i;
- }
-
- int64_t convert(double d) {
- static_assert(sizeof(double) == sizeof(int64_t), "Important ULP matcher assumption violated");
- int64_t i;
- std::memcpy(&i, &d, sizeof(d));
- return i;
- }
-
- template <typename FP>
- bool almostEqualUlps(FP lhs, FP rhs, uint64_t maxUlpDiff) {
- // Comparison with NaN should always be false.
- // This way we can rule it out before getting into the ugly details
- if (Catch::isnan(lhs) || Catch::isnan(rhs)) {
- return false;
- }
-
- auto lc = convert(lhs);
- auto rc = convert(rhs);
-
- if ((lc < 0) != (rc < 0)) {
- // Potentially we can have +0 and -0
- return lhs == rhs;
- }
-
- auto ulpDiff = std::abs(lc - rc);
- return static_cast<uint64_t>(ulpDiff) <= maxUlpDiff;
- }
-
-#if defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
-
- float nextafter(float x, float y) {
- return ::nextafterf(x, y);
- }
-
- double nextafter(double x, double y) {
- return ::nextafter(x, y);
- }
-
-#endif // ^^^ CATCH_CONFIG_GLOBAL_NEXTAFTER ^^^
-
-template <typename FP>
-FP step(FP start, FP direction, uint64_t steps) {
- for (uint64_t i = 0; i < steps; ++i) {
-#if defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
- start = Catch::nextafter(start, direction);
-#else
- start = std::nextafter(start, direction);
-#endif
- }
- return start;
-}
-
-// Performs equivalent check of std::fabs(lhs - rhs) <= margin
-// But without the subtraction to allow for INFINITY in comparison
-bool marginComparison(double lhs, double rhs, double margin) {
- return (lhs + margin >= rhs) && (rhs + margin >= lhs);
-}
-
-template <typename FloatingPoint>
-void write(std::ostream& out, FloatingPoint num) {
- out << std::scientific
- << std::setprecision(std::numeric_limits<FloatingPoint>::max_digits10 - 1)
- << num;
-}
-
-} // end anonymous namespace
-
-namespace Matchers {
-namespace Floating {
-
- enum class FloatingPointKind : uint8_t {
- Float,
- Double
- };
-
- WithinAbsMatcher::WithinAbsMatcher(double target, double margin)
- :m_target{ target }, m_margin{ margin } {
- CATCH_ENFORCE(margin >= 0, "Invalid margin: " << margin << '.'
- << " Margin has to be non-negative.");
- }
-
- // Performs equivalent check of std::fabs(lhs - rhs) <= margin
- // But without the subtraction to allow for INFINITY in comparison
- bool WithinAbsMatcher::match(double const& matchee) const {
- return (matchee + m_margin >= m_target) && (m_target + m_margin >= matchee);
- }
-
- std::string WithinAbsMatcher::describe() const {
- return "is within " + ::Catch::Detail::stringify(m_margin) + " of " + ::Catch::Detail::stringify(m_target);
- }
-
- WithinUlpsMatcher::WithinUlpsMatcher(double target, uint64_t ulps, FloatingPointKind baseType)
- :m_target{ target }, m_ulps{ ulps }, m_type{ baseType } {
- CATCH_ENFORCE(m_type == FloatingPointKind::Double
- || m_ulps < (std::numeric_limits<uint32_t>::max)(),
- "Provided ULP is impossibly large for a float comparison.");
- }
-
-#if defined(__clang__)
-#pragma clang diagnostic push
-// Clang <3.5 reports on the default branch in the switch below
-#pragma clang diagnostic ignored "-Wunreachable-code"
-#endif
-
- bool WithinUlpsMatcher::match(double const& matchee) const {
- switch (m_type) {
- case FloatingPointKind::Float:
- return almostEqualUlps<float>(static_cast<float>(matchee), static_cast<float>(m_target), m_ulps);
- case FloatingPointKind::Double:
- return almostEqualUlps<double>(matchee, m_target, m_ulps);
- default:
- CATCH_INTERNAL_ERROR( "Unknown FloatingPointKind value" );
- }
- }
-
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
-
- std::string WithinUlpsMatcher::describe() const {
- std::stringstream ret;
-
- ret << "is within " << m_ulps << " ULPs of ";
-
- if (m_type == FloatingPointKind::Float) {
- write(ret, static_cast<float>(m_target));
- ret << 'f';
- } else {
- write(ret, m_target);
- }
-
- ret << " ([";
- if (m_type == FloatingPointKind::Double) {
- write(ret, step(m_target, static_cast<double>(-INFINITY), m_ulps));
- ret << ", ";
- write(ret, step(m_target, static_cast<double>( INFINITY), m_ulps));
- } else {
- // We have to cast INFINITY to float because of MinGW, see #1782
- write(ret, step(static_cast<float>(m_target), static_cast<float>(-INFINITY), m_ulps));
- ret << ", ";
- write(ret, step(static_cast<float>(m_target), static_cast<float>( INFINITY), m_ulps));
- }
- ret << "])";
-
- return ret.str();
- }
-
- WithinRelMatcher::WithinRelMatcher(double target, double epsilon):
- m_target(target),
- m_epsilon(epsilon){
- CATCH_ENFORCE(m_epsilon >= 0., "Relative comparison with epsilon < 0 does not make sense.");
- CATCH_ENFORCE(m_epsilon < 1., "Relative comparison with epsilon >= 1 does not make sense.");
- }
-
- bool WithinRelMatcher::match(double const& matchee) const {
- const auto relMargin = m_epsilon * (std::max)(std::fabs(matchee), std::fabs(m_target));
- return marginComparison(matchee, m_target,
- std::isinf(relMargin)? 0 : relMargin);
- }
-
- std::string WithinRelMatcher::describe() const {
- Catch::ReusableStringStream sstr;
- sstr << "and " << m_target << " are within " << m_epsilon * 100. << "% of each other";
- return sstr.str();
- }
-
-}// namespace Floating
-
-Floating::WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff) {
- return Floating::WithinUlpsMatcher(target, maxUlpDiff, Floating::FloatingPointKind::Double);
-}
-
-Floating::WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff) {
- return Floating::WithinUlpsMatcher(target, maxUlpDiff, Floating::FloatingPointKind::Float);
-}
-
-Floating::WithinAbsMatcher WithinAbs(double target, double margin) {
- return Floating::WithinAbsMatcher(target, margin);
-}
-
-Floating::WithinRelMatcher WithinRel(double target, double eps) {
- return Floating::WithinRelMatcher(target, eps);
-}
-
-Floating::WithinRelMatcher WithinRel(double target) {
- return Floating::WithinRelMatcher(target, std::numeric_limits<double>::epsilon() * 100);
-}
-
-Floating::WithinRelMatcher WithinRel(float target, float eps) {
- return Floating::WithinRelMatcher(target, eps);
-}
-
-Floating::WithinRelMatcher WithinRel(float target) {
- return Floating::WithinRelMatcher(target, std::numeric_limits<float>::epsilon() * 100);
-}
-
-} // namespace Matchers
-} // namespace Catch
-
-// end catch_matchers_floating.cpp
-// start catch_matchers_generic.cpp
-
-std::string Catch::Matchers::Generic::Detail::finalizeDescription(const std::string& desc) {
- if (desc.empty()) {
- return "matches undescribed predicate";
- } else {
- return "matches predicate: \"" + desc + '"';
- }
-}
-// end catch_matchers_generic.cpp
-// start catch_matchers_string.cpp
-
-#include <regex>
-
-namespace Catch {
-namespace Matchers {
-
- namespace StdString {
-
- CasedString::CasedString( std::string const& str, CaseSensitive::Choice caseSensitivity )
- : m_caseSensitivity( caseSensitivity ),
- m_str( adjustString( str ) )
- {}
- std::string CasedString::adjustString( std::string const& str ) const {
- return m_caseSensitivity == CaseSensitive::No
- ? toLower( str )
- : str;
- }
- std::string CasedString::caseSensitivitySuffix() const {
- return m_caseSensitivity == CaseSensitive::No
- ? " (case insensitive)"
- : std::string();
- }
-
- StringMatcherBase::StringMatcherBase( std::string const& operation, CasedString const& comparator )
- : m_comparator( comparator ),
- m_operation( operation ) {
- }
-
- std::string StringMatcherBase::describe() const {
- std::string description;
- description.reserve(5 + m_operation.size() + m_comparator.m_str.size() +
- m_comparator.caseSensitivitySuffix().size());
- description += m_operation;
- description += ": \"";
- description += m_comparator.m_str;
- description += "\"";
- description += m_comparator.caseSensitivitySuffix();
- return description;
- }
-
- EqualsMatcher::EqualsMatcher( CasedString const& comparator ) : StringMatcherBase( "equals", comparator ) {}
-
- bool EqualsMatcher::match( std::string const& source ) const {
- return m_comparator.adjustString( source ) == m_comparator.m_str;
- }
-
- ContainsMatcher::ContainsMatcher( CasedString const& comparator ) : StringMatcherBase( "contains", comparator ) {}
-
- bool ContainsMatcher::match( std::string const& source ) const {
- return contains( m_comparator.adjustString( source ), m_comparator.m_str );
- }
-
- StartsWithMatcher::StartsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "starts with", comparator ) {}
-
- bool StartsWithMatcher::match( std::string const& source ) const {
- return startsWith( m_comparator.adjustString( source ), m_comparator.m_str );
- }
-
- EndsWithMatcher::EndsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "ends with", comparator ) {}
-
- bool EndsWithMatcher::match( std::string const& source ) const {
- return endsWith( m_comparator.adjustString( source ), m_comparator.m_str );
- }
-
- RegexMatcher::RegexMatcher(std::string regex, CaseSensitive::Choice caseSensitivity): m_regex(std::move(regex)), m_caseSensitivity(caseSensitivity) {}
-
- bool RegexMatcher::match(std::string const& matchee) const {
- auto flags = std::regex::ECMAScript; // ECMAScript is the default syntax option anyway
- if (m_caseSensitivity == CaseSensitive::Choice::No) {
- flags |= std::regex::icase;
- }
- auto reg = std::regex(m_regex, flags);
- return std::regex_match(matchee, reg);
- }
-
- std::string RegexMatcher::describe() const {
- return "matches " + ::Catch::Detail::stringify(m_regex) + ((m_caseSensitivity == CaseSensitive::Choice::Yes)? " case sensitively" : " case insensitively");
- }
-
- } // namespace StdString
-
- StdString::EqualsMatcher Equals( std::string const& str, CaseSensitive::Choice caseSensitivity ) {
- return StdString::EqualsMatcher( StdString::CasedString( str, caseSensitivity) );
- }
- StdString::ContainsMatcher Contains( std::string const& str, CaseSensitive::Choice caseSensitivity ) {
- return StdString::ContainsMatcher( StdString::CasedString( str, caseSensitivity) );
- }
- StdString::EndsWithMatcher EndsWith( std::string const& str, CaseSensitive::Choice caseSensitivity ) {
- return StdString::EndsWithMatcher( StdString::CasedString( str, caseSensitivity) );
- }
- StdString::StartsWithMatcher StartsWith( std::string const& str, CaseSensitive::Choice caseSensitivity ) {
- return StdString::StartsWithMatcher( StdString::CasedString( str, caseSensitivity) );
- }
-
- StdString::RegexMatcher Matches(std::string const& regex, CaseSensitive::Choice caseSensitivity) {
- return StdString::RegexMatcher(regex, caseSensitivity);
- }
-
-} // namespace Matchers
-} // namespace Catch
-// end catch_matchers_string.cpp
-// start catch_message.cpp
-
-// start catch_uncaught_exceptions.h
-
-namespace Catch {
- bool uncaught_exceptions();
-} // end namespace Catch
-
-// end catch_uncaught_exceptions.h
-#include <cassert>
-#include <stack>
-
-namespace Catch {
-
- MessageInfo::MessageInfo( StringRef const& _macroName,
- SourceLineInfo const& _lineInfo,
- ResultWas::OfType _type )
- : macroName( _macroName ),
- lineInfo( _lineInfo ),
- type( _type ),
- sequence( ++globalCount )
- {}
-
- bool MessageInfo::operator==( MessageInfo const& other ) const {
- return sequence == other.sequence;
- }
-
- bool MessageInfo::operator<( MessageInfo const& other ) const {
- return sequence < other.sequence;
- }
-
- // This may need protecting if threading support is added
- unsigned int MessageInfo::globalCount = 0;
-
- ////////////////////////////////////////////////////////////////////////////
-
- Catch::MessageBuilder::MessageBuilder( StringRef const& macroName,
- SourceLineInfo const& lineInfo,
- ResultWas::OfType type )
- :m_info(macroName, lineInfo, type) {}
-
- ////////////////////////////////////////////////////////////////////////////
-
- ScopedMessage::ScopedMessage( MessageBuilder const& builder )
- : m_info( builder.m_info ), m_moved()
- {
- m_info.message = builder.m_stream.str();
- getResultCapture().pushScopedMessage( m_info );
- }
-
- ScopedMessage::ScopedMessage( ScopedMessage&& old )
- : m_info( old.m_info ), m_moved()
- {
- old.m_moved = true;
- }
-
- ScopedMessage::~ScopedMessage() {
- if ( !uncaught_exceptions() && !m_moved ){
- getResultCapture().popScopedMessage(m_info);
- }
- }
-
- Capturer::Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ) {
- auto trimmed = [&] (size_t start, size_t end) {
- while (names[start] == ',' || isspace(static_cast<unsigned char>(names[start]))) {
- ++start;
- }
- while (names[end] == ',' || isspace(static_cast<unsigned char>(names[end]))) {
- --end;
- }
- return names.substr(start, end - start + 1);
- };
- auto skipq = [&] (size_t start, char quote) {
- for (auto i = start + 1; i < names.size() ; ++i) {
- if (names[i] == quote)
- return i;
- if (names[i] == '\\')
- ++i;
- }
- CATCH_INTERNAL_ERROR("CAPTURE parsing encountered unmatched quote");
- };
-
- size_t start = 0;
- std::stack<char> openings;
- for (size_t pos = 0; pos < names.size(); ++pos) {
- char c = names[pos];
- switch (c) {
- case '[':
- case '{':
- case '(':
- // It is basically impossible to disambiguate between
- // comparison and start of template args in this context
-// case '<':
- openings.push(c);
- break;
- case ']':
- case '}':
- case ')':
-// case '>':
- openings.pop();
- break;
- case '"':
- case '\'':
- pos = skipq(pos, c);
- break;
- case ',':
- if (start != pos && openings.empty()) {
- m_messages.emplace_back(macroName, lineInfo, resultType);
- m_messages.back().message = static_cast<std::string>(trimmed(start, pos));
- m_messages.back().message += " := ";
- start = pos;
- }
- }
- }
- assert(openings.empty() && "Mismatched openings");
- m_messages.emplace_back(macroName, lineInfo, resultType);
- m_messages.back().message = static_cast<std::string>(trimmed(start, names.size() - 1));
- m_messages.back().message += " := ";
- }
- Capturer::~Capturer() {
- if ( !uncaught_exceptions() ){
- assert( m_captured == m_messages.size() );
- for( size_t i = 0; i < m_captured; ++i )
- m_resultCapture.popScopedMessage( m_messages[i] );
- }
- }
-
- void Capturer::captureValue( size_t index, std::string const& value ) {
- assert( index < m_messages.size() );
- m_messages[index].message += value;
- m_resultCapture.pushScopedMessage( m_messages[index] );
- m_captured++;
- }
-
-} // end namespace Catch
-// end catch_message.cpp
-// start catch_output_redirect.cpp
-
-// start catch_output_redirect.h
-#ifndef TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H
-#define TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H
-
-#include <cstdio>
-#include <iosfwd>
-#include <string>
-
-namespace Catch {
-
- class RedirectedStream {
- std::ostream& m_originalStream;
- std::ostream& m_redirectionStream;
- std::streambuf* m_prevBuf;
-
- public:
- RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream );
- ~RedirectedStream();
- };
-
- class RedirectedStdOut {
- ReusableStringStream m_rss;
- RedirectedStream m_cout;
- public:
- RedirectedStdOut();
- auto str() const -> std::string;
- };
-
- // StdErr has two constituent streams in C++, std::cerr and std::clog
- // This means that we need to redirect 2 streams into 1 to keep proper
- // order of writes
- class RedirectedStdErr {
- ReusableStringStream m_rss;
- RedirectedStream m_cerr;
- RedirectedStream m_clog;
- public:
- RedirectedStdErr();
- auto str() const -> std::string;
- };
-
- class RedirectedStreams {
- public:
- RedirectedStreams(RedirectedStreams const&) = delete;
- RedirectedStreams& operator=(RedirectedStreams const&) = delete;
- RedirectedStreams(RedirectedStreams&&) = delete;
- RedirectedStreams& operator=(RedirectedStreams&&) = delete;
-
- RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr);
- ~RedirectedStreams();
- private:
- std::string& m_redirectedCout;
- std::string& m_redirectedCerr;
- RedirectedStdOut m_redirectedStdOut;
- RedirectedStdErr m_redirectedStdErr;
- };
-
-#if defined(CATCH_CONFIG_NEW_CAPTURE)
-
- // Windows's implementation of std::tmpfile is terrible (it tries
- // to create a file inside system folder, thus requiring elevated
- // privileges for the binary), so we have to use tmpnam(_s) and
- // create the file ourselves there.
- class TempFile {
- public:
- TempFile(TempFile const&) = delete;
- TempFile& operator=(TempFile const&) = delete;
- TempFile(TempFile&&) = delete;
- TempFile& operator=(TempFile&&) = delete;
-
- TempFile();
- ~TempFile();
-
- std::FILE* getFile();
- std::string getContents();
-
- private:
- std::FILE* m_file = nullptr;
- #if defined(_MSC_VER)
- char m_buffer[L_tmpnam] = { 0 };
- #endif
- };
-
- class OutputRedirect {
- public:
- OutputRedirect(OutputRedirect const&) = delete;
- OutputRedirect& operator=(OutputRedirect const&) = delete;
- OutputRedirect(OutputRedirect&&) = delete;
- OutputRedirect& operator=(OutputRedirect&&) = delete;
-
- OutputRedirect(std::string& stdout_dest, std::string& stderr_dest);
- ~OutputRedirect();
-
- private:
- int m_originalStdout = -1;
- int m_originalStderr = -1;
- TempFile m_stdoutFile;
- TempFile m_stderrFile;
- std::string& m_stdoutDest;
- std::string& m_stderrDest;
- };
-
-#endif
-
-} // end namespace Catch
-
-#endif // TWOBLUECUBES_CATCH_OUTPUT_REDIRECT_H
-// end catch_output_redirect.h
-#include <cstdio>
-#include <cstring>
-#include <fstream>
-#include <sstream>
-#include <stdexcept>
-
-#if defined(CATCH_CONFIG_NEW_CAPTURE)
- #if defined(_MSC_VER)
- #include <io.h> //_dup and _dup2
- #define dup _dup
- #define dup2 _dup2
- #define fileno _fileno
- #else
- #include <unistd.h> // dup and dup2
- #endif
-#endif
-
-namespace Catch {
-
- RedirectedStream::RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream )
- : m_originalStream( originalStream ),
- m_redirectionStream( redirectionStream ),
- m_prevBuf( m_originalStream.rdbuf() )
- {
- m_originalStream.rdbuf( m_redirectionStream.rdbuf() );
- }
-
- RedirectedStream::~RedirectedStream() {
- m_originalStream.rdbuf( m_prevBuf );
- }
-
- RedirectedStdOut::RedirectedStdOut() : m_cout( Catch::cout(), m_rss.get() ) {}
- auto RedirectedStdOut::str() const -> std::string { return m_rss.str(); }
-
- RedirectedStdErr::RedirectedStdErr()
- : m_cerr( Catch::cerr(), m_rss.get() ),
- m_clog( Catch::clog(), m_rss.get() )
- {}
- auto RedirectedStdErr::str() const -> std::string { return m_rss.str(); }
-
- RedirectedStreams::RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr)
- : m_redirectedCout(redirectedCout),
- m_redirectedCerr(redirectedCerr)
- {}
-
- RedirectedStreams::~RedirectedStreams() {
- m_redirectedCout += m_redirectedStdOut.str();
- m_redirectedCerr += m_redirectedStdErr.str();
- }
-
-#if defined(CATCH_CONFIG_NEW_CAPTURE)
-
-#if defined(_MSC_VER)
- TempFile::TempFile() {
- if (tmpnam_s(m_buffer)) {
- CATCH_RUNTIME_ERROR("Could not get a temp filename");
- }
- if (fopen_s(&m_file, m_buffer, "w+")) {
- char buffer[100];
- if (strerror_s(buffer, errno)) {
- CATCH_RUNTIME_ERROR("Could not translate errno to a string");
- }
- CATCH_RUNTIME_ERROR("Could not open the temp file: '" << m_buffer << "' because: " << buffer);
- }
- }
-#else
- TempFile::TempFile() {
- m_file = std::tmpfile();
- if (!m_file) {
- CATCH_RUNTIME_ERROR("Could not create a temp file.");
- }
- }
-
-#endif
-
- TempFile::~TempFile() {
- // TBD: What to do about errors here?
- std::fclose(m_file);
- // We manually create the file on Windows only, on Linux
- // it will be autodeleted
-#if defined(_MSC_VER)
- std::remove(m_buffer);
-#endif
- }
-
- FILE* TempFile::getFile() {
- return m_file;
- }
-
- std::string TempFile::getContents() {
- std::stringstream sstr;
- char buffer[100] = {};
- std::rewind(m_file);
- while (std::fgets(buffer, sizeof(buffer), m_file)) {
- sstr << buffer;
- }
- return sstr.str();
- }
-
- OutputRedirect::OutputRedirect(std::string& stdout_dest, std::string& stderr_dest) :
- m_originalStdout(dup(1)),
- m_originalStderr(dup(2)),
- m_stdoutDest(stdout_dest),
- m_stderrDest(stderr_dest) {
- dup2(fileno(m_stdoutFile.getFile()), 1);
- dup2(fileno(m_stderrFile.getFile()), 2);
- }
-
- OutputRedirect::~OutputRedirect() {
- Catch::cout() << std::flush;
- fflush(stdout);
- // Since we support overriding these streams, we flush cerr
- // even though std::cerr is unbuffered
- Catch::cerr() << std::flush;
- Catch::clog() << std::flush;
- fflush(stderr);
-
- dup2(m_originalStdout, 1);
- dup2(m_originalStderr, 2);
-
- m_stdoutDest += m_stdoutFile.getContents();
- m_stderrDest += m_stderrFile.getContents();
- }
-
-#endif // CATCH_CONFIG_NEW_CAPTURE
-
-} // namespace Catch
-
-#if defined(CATCH_CONFIG_NEW_CAPTURE)
- #if defined(_MSC_VER)
- #undef dup
- #undef dup2
- #undef fileno
- #endif
-#endif
-// end catch_output_redirect.cpp
-// start catch_polyfills.cpp
-
-#include <cmath>
-
-namespace Catch {
-
-#if !defined(CATCH_CONFIG_POLYFILL_ISNAN)
- bool isnan(float f) {
- return std::isnan(f);
- }
- bool isnan(double d) {
- return std::isnan(d);
- }
-#else
- // For now we only use this for embarcadero
- bool isnan(float f) {
- return std::_isnan(f);
- }
- bool isnan(double d) {
- return std::_isnan(d);
- }
-#endif
-
-} // end namespace Catch
-// end catch_polyfills.cpp
-// start catch_random_number_generator.cpp
-
-namespace Catch {
-
-namespace {
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4146) // we negate uint32 during the rotate
-#endif
- // Safe rotr implementation thanks to John Regehr
- uint32_t rotate_right(uint32_t val, uint32_t count) {
- const uint32_t mask = 31;
- count &= mask;
- return (val >> count) | (val << (-count & mask));
- }
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
-
-}
-
- SimplePcg32::SimplePcg32(result_type seed_) {
- seed(seed_);
- }
-
- void SimplePcg32::seed(result_type seed_) {
- m_state = 0;
- (*this)();
- m_state += seed_;
- (*this)();
- }
-
- void SimplePcg32::discard(uint64_t skip) {
- // We could implement this to run in O(log n) steps, but this
- // should suffice for our use case.
- for (uint64_t s = 0; s < skip; ++s) {
- static_cast<void>((*this)());
- }
- }
-
- SimplePcg32::result_type SimplePcg32::operator()() {
- // prepare the output value
- const uint32_t xorshifted = static_cast<uint32_t>(((m_state >> 18u) ^ m_state) >> 27u);
- const auto output = rotate_right(xorshifted, m_state >> 59u);
-
- // advance state
- m_state = m_state * 6364136223846793005ULL + s_inc;
-
- return output;
- }
-
- bool operator==(SimplePcg32 const& lhs, SimplePcg32 const& rhs) {
- return lhs.m_state == rhs.m_state;
- }
-
- bool operator!=(SimplePcg32 const& lhs, SimplePcg32 const& rhs) {
- return lhs.m_state != rhs.m_state;
- }
-}
-// end catch_random_number_generator.cpp
-// start catch_registry_hub.cpp
-
-// start catch_test_case_registry_impl.h
-
-#include <vector>
-#include <set>
-#include <algorithm>
-#include <ios>
-
-namespace Catch {
-
- class TestCase;
- struct IConfig;
-
- std::vector<TestCase> sortTests( IConfig const& config, std::vector<TestCase> const& unsortedTestCases );
-
- bool isThrowSafe( TestCase const& testCase, IConfig const& config );
- bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config );
-
- void enforceNoDuplicateTestCases( std::vector<TestCase> const& functions );
-
- std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config );
- std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config );
-
- class TestRegistry : public ITestCaseRegistry {
- public:
- virtual ~TestRegistry() = default;
-
- virtual void registerTest( TestCase const& testCase );
-
- std::vector<TestCase> const& getAllTests() const override;
- std::vector<TestCase> const& getAllTestsSorted( IConfig const& config ) const override;
-
- private:
- std::vector<TestCase> m_functions;
- mutable RunTests::InWhatOrder m_currentSortOrder = RunTests::InDeclarationOrder;
- mutable std::vector<TestCase> m_sortedFunctions;
- std::size_t m_unnamedCount = 0;
- std::ios_base::Init m_ostreamInit; // Forces cout/ cerr to be initialised
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class TestInvokerAsFunction : public ITestInvoker {
- void(*m_testAsFunction)();
- public:
- TestInvokerAsFunction( void(*testAsFunction)() ) noexcept;
-
- void invoke() const override;
- };
-
- std::string extractClassName( StringRef const& classOrQualifiedMethodName );
-
- ///////////////////////////////////////////////////////////////////////////
-
-} // end namespace Catch
-
-// end catch_test_case_registry_impl.h
-// start catch_reporter_registry.h
-
-#include <map>
-
-namespace Catch {
-
- class ReporterRegistry : public IReporterRegistry {
-
- public:
-
- ~ReporterRegistry() override;
-
- IStreamingReporterPtr create( std::string const& name, IConfigPtr const& config ) const override;
-
- void registerReporter( std::string const& name, IReporterFactoryPtr const& factory );
- void registerListener( IReporterFactoryPtr const& factory );
-
- FactoryMap const& getFactories() const override;
- Listeners const& getListeners() const override;
-
- private:
- FactoryMap m_factories;
- Listeners m_listeners;
- };
-}
-
-// end catch_reporter_registry.h
-// start catch_tag_alias_registry.h
-
-// start catch_tag_alias.h
-
-#include <string>
-
-namespace Catch {
-
- struct TagAlias {
- TagAlias(std::string const& _tag, SourceLineInfo _lineInfo);
-
- std::string tag;
- SourceLineInfo lineInfo;
- };
-
-} // end namespace Catch
-
-// end catch_tag_alias.h
-#include <map>
-
-namespace Catch {
-
- class TagAliasRegistry : public ITagAliasRegistry {
- public:
- ~TagAliasRegistry() override;
- TagAlias const* find( std::string const& alias ) const override;
- std::string expandAliases( std::string const& unexpandedTestSpec ) const override;
- void add( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo );
-
- private:
- std::map<std::string, TagAlias> m_registry;
- };
-
-} // end namespace Catch
-
-// end catch_tag_alias_registry.h
-// start catch_startup_exception_registry.h
-
-#include <vector>
-#include <exception>
-
-namespace Catch {
-
- class StartupExceptionRegistry {
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- public:
- void add(std::exception_ptr const& exception) noexcept;
- std::vector<std::exception_ptr> const& getExceptions() const noexcept;
- private:
- std::vector<std::exception_ptr> m_exceptions;
-#endif
- };
-
-} // end namespace Catch
-
-// end catch_startup_exception_registry.h
-// start catch_singletons.hpp
-
-namespace Catch {
-
- struct ISingleton {
- virtual ~ISingleton();
- };
-
- void addSingleton( ISingleton* singleton );
- void cleanupSingletons();
-
- template<typename SingletonImplT, typename InterfaceT = SingletonImplT, typename MutableInterfaceT = InterfaceT>
- class Singleton : SingletonImplT, public ISingleton {
-
- static auto getInternal() -> Singleton* {
- static Singleton* s_instance = nullptr;
- if( !s_instance ) {
- s_instance = new Singleton;
- addSingleton( s_instance );
- }
- return s_instance;
- }
-
- public:
- static auto get() -> InterfaceT const& {
- return *getInternal();
- }
- static auto getMutable() -> MutableInterfaceT& {
- return *getInternal();
- }
- };
-
-} // namespace Catch
-
-// end catch_singletons.hpp
-namespace Catch {
-
- namespace {
-
- class RegistryHub : public IRegistryHub, public IMutableRegistryHub,
- private NonCopyable {
-
- public: // IRegistryHub
- RegistryHub() = default;
- IReporterRegistry const& getReporterRegistry() const override {
- return m_reporterRegistry;
- }
- ITestCaseRegistry const& getTestCaseRegistry() const override {
- return m_testCaseRegistry;
- }
- IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const override {
- return m_exceptionTranslatorRegistry;
- }
- ITagAliasRegistry const& getTagAliasRegistry() const override {
- return m_tagAliasRegistry;
- }
- StartupExceptionRegistry const& getStartupExceptionRegistry() const override {
- return m_exceptionRegistry;
- }
-
- public: // IMutableRegistryHub
- void registerReporter( std::string const& name, IReporterFactoryPtr const& factory ) override {
- m_reporterRegistry.registerReporter( name, factory );
- }
- void registerListener( IReporterFactoryPtr const& factory ) override {
- m_reporterRegistry.registerListener( factory );
- }
- void registerTest( TestCase const& testInfo ) override {
- m_testCaseRegistry.registerTest( testInfo );
- }
- void registerTranslator( const IExceptionTranslator* translator ) override {
- m_exceptionTranslatorRegistry.registerTranslator( translator );
- }
- void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) override {
- m_tagAliasRegistry.add( alias, tag, lineInfo );
- }
- void registerStartupException() noexcept override {
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- m_exceptionRegistry.add(std::current_exception());
-#else
- CATCH_INTERNAL_ERROR("Attempted to register active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
-#endif
- }
- IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override {
- return m_enumValuesRegistry;
- }
-
- private:
- TestRegistry m_testCaseRegistry;
- ReporterRegistry m_reporterRegistry;
- ExceptionTranslatorRegistry m_exceptionTranslatorRegistry;
- TagAliasRegistry m_tagAliasRegistry;
- StartupExceptionRegistry m_exceptionRegistry;
- Detail::EnumValuesRegistry m_enumValuesRegistry;
- };
- }
-
- using RegistryHubSingleton = Singleton<RegistryHub, IRegistryHub, IMutableRegistryHub>;
-
- IRegistryHub const& getRegistryHub() {
- return RegistryHubSingleton::get();
- }
- IMutableRegistryHub& getMutableRegistryHub() {
- return RegistryHubSingleton::getMutable();
- }
- void cleanUp() {
- cleanupSingletons();
- cleanUpContext();
- }
- std::string translateActiveException() {
- return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException();
- }
-
-} // end namespace Catch
-// end catch_registry_hub.cpp
-// start catch_reporter_registry.cpp
-
-namespace Catch {
-
- ReporterRegistry::~ReporterRegistry() = default;
-
- IStreamingReporterPtr ReporterRegistry::create( std::string const& name, IConfigPtr const& config ) const {
- auto it = m_factories.find( name );
- if( it == m_factories.end() )
- return nullptr;
- return it->second->create( ReporterConfig( config ) );
- }
-
- void ReporterRegistry::registerReporter( std::string const& name, IReporterFactoryPtr const& factory ) {
- m_factories.emplace(name, factory);
- }
- void ReporterRegistry::registerListener( IReporterFactoryPtr const& factory ) {
- m_listeners.push_back( factory );
- }
-
- IReporterRegistry::FactoryMap const& ReporterRegistry::getFactories() const {
- return m_factories;
- }
- IReporterRegistry::Listeners const& ReporterRegistry::getListeners() const {
- return m_listeners;
- }
-
-}
-// end catch_reporter_registry.cpp
-// start catch_result_type.cpp
-
-namespace Catch {
-
- bool isOk( ResultWas::OfType resultType ) {
- return ( resultType & ResultWas::FailureBit ) == 0;
- }
- bool isJustInfo( int flags ) {
- return flags == ResultWas::Info;
- }
-
- ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) {
- return static_cast<ResultDisposition::Flags>( static_cast<int>( lhs ) | static_cast<int>( rhs ) );
- }
-
- bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; }
- bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; }
-
-} // end namespace Catch
-// end catch_result_type.cpp
-// start catch_run_context.cpp
-
-#include <cassert>
-#include <algorithm>
-#include <sstream>
-
-namespace Catch {
-
- namespace Generators {
- struct GeneratorTracker : TestCaseTracking::TrackerBase, IGeneratorTracker {
- GeneratorBasePtr m_generator;
-
- GeneratorTracker( TestCaseTracking::NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
- : TrackerBase( nameAndLocation, ctx, parent )
- {}
- ~GeneratorTracker();
-
- static GeneratorTracker& acquire( TrackerContext& ctx, TestCaseTracking::NameAndLocation const& nameAndLocation ) {
- std::shared_ptr<GeneratorTracker> tracker;
-
- ITracker& currentTracker = ctx.currentTracker();
- // Under specific circumstances, the generator we want
- // to acquire is also the current tracker. If this is
- // the case, we have to avoid looking through current
- // tracker's children, and instead return the current
- // tracker.
- // A case where this check is important is e.g.
- // for (int i = 0; i < 5; ++i) {
- // int n = GENERATE(1, 2);
- // }
- //
- // without it, the code above creates 5 nested generators.
- if (currentTracker.nameAndLocation() == nameAndLocation) {
- auto thisTracker = currentTracker.parent().findChild(nameAndLocation);
- assert(thisTracker);
- assert(thisTracker->isGeneratorTracker());
- tracker = std::static_pointer_cast<GeneratorTracker>(thisTracker);
- } else if ( TestCaseTracking::ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) {
- assert( childTracker );
- assert( childTracker->isGeneratorTracker() );
- tracker = std::static_pointer_cast<GeneratorTracker>( childTracker );
- } else {
- tracker = std::make_shared<GeneratorTracker>( nameAndLocation, ctx, &currentTracker );
- currentTracker.addChild( tracker );
- }
-
- if( !tracker->isComplete() ) {
- tracker->open();
- }
-
- return *tracker;
- }
-
- // TrackerBase interface
- bool isGeneratorTracker() const override { return true; }
- auto hasGenerator() const -> bool override {
- return !!m_generator;
- }
- void close() override {
- TrackerBase::close();
- // If a generator has a child (it is followed by a section)
- // and none of its children have started, then we must wait
- // until later to start consuming its values.
- // This catches cases where `GENERATE` is placed between two
- // `SECTION`s.
- // **The check for m_children.empty cannot be removed**.
- // doing so would break `GENERATE` _not_ followed by `SECTION`s.
- const bool should_wait_for_child = [&]() {
- // No children -> nobody to wait for
- if ( m_children.empty() ) {
- return false;
- }
- // If at least one child started executing, don't wait
- if ( std::find_if(
- m_children.begin(),
- m_children.end(),
- []( TestCaseTracking::ITrackerPtr tracker ) {
- return tracker->hasStarted();
- } ) != m_children.end() ) {
- return false;
- }
-
- // No children have started. We need to check if they _can_
- // start, and thus we should wait for them, or they cannot
- // start (due to filters), and we shouldn't wait for them
- auto* parent = m_parent;
- // This is safe: there is always at least one section
- // tracker in a test case tracking tree
- while ( !parent->isSectionTracker() ) {
- parent = &( parent->parent() );
- }
- assert( parent &&
- "Missing root (test case) level section" );
-
- auto const& parentSection =
- static_cast<SectionTracker&>( *parent );
- auto const& filters = parentSection.getFilters();
- // No filters -> no restrictions on running sections
- if ( filters.empty() ) {
- return true;
- }
-
- for ( auto const& child : m_children ) {
- if ( child->isSectionTracker() &&
- std::find( filters.begin(),
- filters.end(),
- static_cast<SectionTracker&>( *child )
- .trimmedName() ) !=
- filters.end() ) {
- return true;
- }
- }
- return false;
- }();
-
- // This check is a bit tricky, because m_generator->next()
- // has a side-effect, where it consumes generator's current
- // value, but we do not want to invoke the side-effect if
- // this generator is still waiting for any child to start.
- if ( should_wait_for_child ||
- ( m_runState == CompletedSuccessfully &&
- m_generator->next() ) ) {
- m_children.clear();
- m_runState = Executing;
- }
- }
-
- // IGeneratorTracker interface
- auto getGenerator() const -> GeneratorBasePtr const& override {
- return m_generator;
- }
- void setGenerator( GeneratorBasePtr&& generator ) override {
- m_generator = std::move( generator );
- }
- };
- GeneratorTracker::~GeneratorTracker() {}
- }
-
- RunContext::RunContext(IConfigPtr const& _config, IStreamingReporterPtr&& reporter)
- : m_runInfo(_config->name()),
- m_context(getCurrentMutableContext()),
- m_config(_config),
- m_reporter(std::move(reporter)),
- m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal },
- m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions )
- {
- m_context.setRunner(this);
- m_context.setConfig(m_config);
- m_context.setResultCapture(this);
- m_reporter->testRunStarting(m_runInfo);
- }
-
- RunContext::~RunContext() {
- m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, aborting()));
- }
-
- void RunContext::testGroupStarting(std::string const& testSpec, std::size_t groupIndex, std::size_t groupsCount) {
- m_reporter->testGroupStarting(GroupInfo(testSpec, groupIndex, groupsCount));
- }
-
- void RunContext::testGroupEnded(std::string const& testSpec, Totals const& totals, std::size_t groupIndex, std::size_t groupsCount) {
- m_reporter->testGroupEnded(TestGroupStats(GroupInfo(testSpec, groupIndex, groupsCount), totals, aborting()));
- }
-
- Totals RunContext::runTest(TestCase const& testCase) {
- Totals prevTotals = m_totals;
-
- std::string redirectedCout;
- std::string redirectedCerr;
-
- auto const& testInfo = testCase.getTestCaseInfo();
-
- m_reporter->testCaseStarting(testInfo);
-
- m_activeTestCase = &testCase;
-
- ITracker& rootTracker = m_trackerContext.startRun();
- assert(rootTracker.isSectionTracker());
- static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun());
- do {
- m_trackerContext.startCycle();
- m_testCaseTracker = &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo));
- runCurrentTest(redirectedCout, redirectedCerr);
- } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting());
-
- Totals deltaTotals = m_totals.delta(prevTotals);
- if (testInfo.expectedToFail() && deltaTotals.testCases.passed > 0) {
- deltaTotals.assertions.failed++;
- deltaTotals.testCases.passed--;
- deltaTotals.testCases.failed++;
- }
- m_totals.testCases += deltaTotals.testCases;
- m_reporter->testCaseEnded(TestCaseStats(testInfo,
- deltaTotals,
- redirectedCout,
- redirectedCerr,
- aborting()));
-
- m_activeTestCase = nullptr;
- m_testCaseTracker = nullptr;
-
- return deltaTotals;
- }
-
- IConfigPtr RunContext::config() const {
- return m_config;
- }
-
- IStreamingReporter& RunContext::reporter() const {
- return *m_reporter;
- }
-
- void RunContext::assertionEnded(AssertionResult const & result) {
- if (result.getResultType() == ResultWas::Ok) {
- m_totals.assertions.passed++;
- m_lastAssertionPassed = true;
- } else if (!result.isOk()) {
- m_lastAssertionPassed = false;
- if( m_activeTestCase->getTestCaseInfo().okToFail() )
- m_totals.assertions.failedButOk++;
- else
- m_totals.assertions.failed++;
- }
- else {
- m_lastAssertionPassed = true;
- }
-
- // We have no use for the return value (whether messages should be cleared), because messages were made scoped
- // and should be let to clear themselves out.
- static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals)));
-
- if (result.getResultType() != ResultWas::Warning)
- m_messageScopes.clear();
-
- // Reset working state
- resetAssertionInfo();
- m_lastResult = result;
- }
- void RunContext::resetAssertionInfo() {
- m_lastAssertionInfo.macroName = StringRef();
- m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}"_sr;
- }
-
- bool RunContext::sectionStarted(SectionInfo const & sectionInfo, Counts & assertions) {
- ITracker& sectionTracker = SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(sectionInfo.name, sectionInfo.lineInfo));
- if (!sectionTracker.isOpen())
- return false;
- m_activeSections.push_back(&sectionTracker);
-
- m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo;
-
- m_reporter->sectionStarting(sectionInfo);
-
- assertions = m_totals.assertions;
-
- return true;
- }
- auto RunContext::acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
- using namespace Generators;
- GeneratorTracker& tracker = GeneratorTracker::acquire(m_trackerContext,
- TestCaseTracking::NameAndLocation( static_cast<std::string>(generatorName), lineInfo ) );
- m_lastAssertionInfo.lineInfo = lineInfo;
- return tracker;
- }
-
- bool RunContext::testForMissingAssertions(Counts& assertions) {
- if (assertions.total() != 0)
- return false;
- if (!m_config->warnAboutMissingAssertions())
- return false;
- if (m_trackerContext.currentTracker().hasChildren())
- return false;
- m_totals.assertions.failed++;
- assertions.failed++;
- return true;
- }
-
- void RunContext::sectionEnded(SectionEndInfo const & endInfo) {
- Counts assertions = m_totals.assertions - endInfo.prevAssertions;
- bool missingAssertions = testForMissingAssertions(assertions);
-
- if (!m_activeSections.empty()) {
- m_activeSections.back()->close();
- m_activeSections.pop_back();
- }
-
- m_reporter->sectionEnded(SectionStats(endInfo.sectionInfo, assertions, endInfo.durationInSeconds, missingAssertions));
- m_messages.clear();
- m_messageScopes.clear();
- }
-
- void RunContext::sectionEndedEarly(SectionEndInfo const & endInfo) {
- if (m_unfinishedSections.empty())
- m_activeSections.back()->fail();
- else
- m_activeSections.back()->close();
- m_activeSections.pop_back();
-
- m_unfinishedSections.push_back(endInfo);
- }
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void RunContext::benchmarkPreparing(std::string const& name) {
- m_reporter->benchmarkPreparing(name);
- }
- void RunContext::benchmarkStarting( BenchmarkInfo const& info ) {
- m_reporter->benchmarkStarting( info );
- }
- void RunContext::benchmarkEnded( BenchmarkStats<> const& stats ) {
- m_reporter->benchmarkEnded( stats );
- }
- void RunContext::benchmarkFailed(std::string const & error) {
- m_reporter->benchmarkFailed(error);
- }
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void RunContext::pushScopedMessage(MessageInfo const & message) {
- m_messages.push_back(message);
- }
-
- void RunContext::popScopedMessage(MessageInfo const & message) {
- m_messages.erase(std::remove(m_messages.begin(), m_messages.end(), message), m_messages.end());
- }
-
- void RunContext::emplaceUnscopedMessage( MessageBuilder const& builder ) {
- m_messageScopes.emplace_back( builder );
- }
-
- std::string RunContext::getCurrentTestName() const {
- return m_activeTestCase
- ? m_activeTestCase->getTestCaseInfo().name
- : std::string();
- }
-
- const AssertionResult * RunContext::getLastResult() const {
- return &(*m_lastResult);
- }
-
- void RunContext::exceptionEarlyReported() {
- m_shouldReportUnexpected = false;
- }
-
- void RunContext::handleFatalErrorCondition( StringRef message ) {
- // First notify reporter that bad things happened
- m_reporter->fatalErrorEncountered(message);
-
- // Don't rebuild the result -- the stringification itself can cause more fatal errors
- // Instead, fake a result data.
- AssertionResultData tempResult( ResultWas::FatalErrorCondition, { false } );
- tempResult.message = static_cast<std::string>(message);
- AssertionResult result(m_lastAssertionInfo, tempResult);
-
- assertionEnded(result);
-
- handleUnfinishedSections();
-
- // Recreate section for test case (as we will lose the one that was in scope)
- auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
- SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name);
-
- Counts assertions;
- assertions.failed = 1;
- SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false);
- m_reporter->sectionEnded(testCaseSectionStats);
-
- auto const& testInfo = m_activeTestCase->getTestCaseInfo();
-
- Totals deltaTotals;
- deltaTotals.testCases.failed = 1;
- deltaTotals.assertions.failed = 1;
- m_reporter->testCaseEnded(TestCaseStats(testInfo,
- deltaTotals,
- std::string(),
- std::string(),
- false));
- m_totals.testCases.failed++;
- testGroupEnded(std::string(), m_totals, 1, 1);
- m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false));
- }
-
- bool RunContext::lastAssertionPassed() {
- return m_lastAssertionPassed;
- }
-
- void RunContext::assertionPassed() {
- m_lastAssertionPassed = true;
- ++m_totals.assertions.passed;
- resetAssertionInfo();
- m_messageScopes.clear();
- }
-
- bool RunContext::aborting() const {
- return m_totals.assertions.failed >= static_cast<std::size_t>(m_config->abortAfter());
- }
-
- void RunContext::runCurrentTest(std::string & redirectedCout, std::string & redirectedCerr) {
- auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
- SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name);
- m_reporter->sectionStarting(testCaseSection);
- Counts prevAssertions = m_totals.assertions;
- double duration = 0;
- m_shouldReportUnexpected = true;
- m_lastAssertionInfo = { "TEST_CASE"_sr, testCaseInfo.lineInfo, StringRef(), ResultDisposition::Normal };
-
- seedRng(*m_config);
-
- Timer timer;
- CATCH_TRY {
- if (m_reporter->getPreferences().shouldRedirectStdOut) {
-#if !defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
- RedirectedStreams redirectedStreams(redirectedCout, redirectedCerr);
-
- timer.start();
- invokeActiveTestCase();
-#else
- OutputRedirect r(redirectedCout, redirectedCerr);
- timer.start();
- invokeActiveTestCase();
-#endif
- } else {
- timer.start();
- invokeActiveTestCase();
- }
- duration = timer.getElapsedSeconds();
- } CATCH_CATCH_ANON (TestFailureException&) {
- // This just means the test was aborted due to failure
- } CATCH_CATCH_ALL {
- // Under CATCH_CONFIG_FAST_COMPILE, unexpected exceptions under REQUIRE assertions
- // are reported without translation at the point of origin.
- if( m_shouldReportUnexpected ) {
- AssertionReaction dummyReaction;
- handleUnexpectedInflightException( m_lastAssertionInfo, translateActiveException(), dummyReaction );
- }
- }
- Counts assertions = m_totals.assertions - prevAssertions;
- bool missingAssertions = testForMissingAssertions(assertions);
-
- m_testCaseTracker->close();
- handleUnfinishedSections();
- m_messages.clear();
- m_messageScopes.clear();
-
- SectionStats testCaseSectionStats(testCaseSection, assertions, duration, missingAssertions);
- m_reporter->sectionEnded(testCaseSectionStats);
- }
-
- void RunContext::invokeActiveTestCase() {
- FatalConditionHandler fatalConditionHandler; // Handle signals
- m_activeTestCase->invoke();
- fatalConditionHandler.reset();
- }
-
- void RunContext::handleUnfinishedSections() {
- // If sections ended prematurely due to an exception we stored their
- // infos here so we can tear them down outside the unwind process.
- for (auto it = m_unfinishedSections.rbegin(),
- itEnd = m_unfinishedSections.rend();
- it != itEnd;
- ++it)
- sectionEnded(*it);
- m_unfinishedSections.clear();
- }
-
- void RunContext::handleExpr(
- AssertionInfo const& info,
- ITransientExpression const& expr,
- AssertionReaction& reaction
- ) {
- m_reporter->assertionStarting( info );
-
- bool negated = isFalseTest( info.resultDisposition );
- bool result = expr.getResult() != negated;
-
- if( result ) {
- if (!m_includeSuccessfulResults) {
- assertionPassed();
- }
- else {
- reportExpr(info, ResultWas::Ok, &expr, negated);
- }
- }
- else {
- reportExpr(info, ResultWas::ExpressionFailed, &expr, negated );
- populateReaction( reaction );
- }
- }
- void RunContext::reportExpr(
- AssertionInfo const &info,
- ResultWas::OfType resultType,
- ITransientExpression const *expr,
- bool negated ) {
-
- m_lastAssertionInfo = info;
- AssertionResultData data( resultType, LazyExpression( negated ) );
-
- AssertionResult assertionResult{ info, data };
- assertionResult.m_resultData.lazyExpression.m_transientExpression = expr;
-
- assertionEnded( assertionResult );
- }
-
- void RunContext::handleMessage(
- AssertionInfo const& info,
- ResultWas::OfType resultType,
- StringRef const& message,
- AssertionReaction& reaction
- ) {
- m_reporter->assertionStarting( info );
-
- m_lastAssertionInfo = info;
-
- AssertionResultData data( resultType, LazyExpression( false ) );
- data.message = static_cast<std::string>(message);
- AssertionResult assertionResult{ m_lastAssertionInfo, data };
- assertionEnded( assertionResult );
- if( !assertionResult.isOk() )
- populateReaction( reaction );
- }
- void RunContext::handleUnexpectedExceptionNotThrown(
- AssertionInfo const& info,
- AssertionReaction& reaction
- ) {
- handleNonExpr(info, Catch::ResultWas::DidntThrowException, reaction);
- }
-
- void RunContext::handleUnexpectedInflightException(
- AssertionInfo const& info,
- std::string const& message,
- AssertionReaction& reaction
- ) {
- m_lastAssertionInfo = info;
-
- AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) );
- data.message = message;
- AssertionResult assertionResult{ info, data };
- assertionEnded( assertionResult );
- populateReaction( reaction );
- }
-
- void RunContext::populateReaction( AssertionReaction& reaction ) {
- reaction.shouldDebugBreak = m_config->shouldDebugBreak();
- reaction.shouldThrow = aborting() || (m_lastAssertionInfo.resultDisposition & ResultDisposition::Normal);
- }
-
- void RunContext::handleIncomplete(
- AssertionInfo const& info
- ) {
- m_lastAssertionInfo = info;
-
- AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) );
- data.message = "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE";
- AssertionResult assertionResult{ info, data };
- assertionEnded( assertionResult );
- }
- void RunContext::handleNonExpr(
- AssertionInfo const &info,
- ResultWas::OfType resultType,
- AssertionReaction &reaction
- ) {
- m_lastAssertionInfo = info;
-
- AssertionResultData data( resultType, LazyExpression( false ) );
- AssertionResult assertionResult{ info, data };
- assertionEnded( assertionResult );
-
- if( !assertionResult.isOk() )
- populateReaction( reaction );
- }
-
- IResultCapture& getResultCapture() {
- if (auto* capture = getCurrentContext().getResultCapture())
- return *capture;
- else
- CATCH_INTERNAL_ERROR("No result capture instance");
- }
-
- void seedRng(IConfig const& config) {
- if (config.rngSeed() != 0) {
- std::srand(config.rngSeed());
- rng().seed(config.rngSeed());
- }
- }
-
- unsigned int rngSeed() {
- return getCurrentContext().getConfig()->rngSeed();
- }
-
-}
-// end catch_run_context.cpp
-// start catch_section.cpp
-
-namespace Catch {
-
- Section::Section( SectionInfo const& info )
- : m_info( info ),
- m_sectionIncluded( getResultCapture().sectionStarted( m_info, m_assertions ) )
- {
- m_timer.start();
- }
-
- Section::~Section() {
- if( m_sectionIncluded ) {
- SectionEndInfo endInfo{ m_info, m_assertions, m_timer.getElapsedSeconds() };
- if( uncaught_exceptions() )
- getResultCapture().sectionEndedEarly( endInfo );
- else
- getResultCapture().sectionEnded( endInfo );
- }
- }
-
- // This indicates whether the section should be executed or not
- Section::operator bool() const {
- return m_sectionIncluded;
- }
-
-} // end namespace Catch
-// end catch_section.cpp
-// start catch_section_info.cpp
-
-namespace Catch {
-
- SectionInfo::SectionInfo
- ( SourceLineInfo const& _lineInfo,
- std::string const& _name )
- : name( _name ),
- lineInfo( _lineInfo )
- {}
-
-} // end namespace Catch
-// end catch_section_info.cpp
-// start catch_session.cpp
-
-// start catch_session.h
-
-#include <memory>
-
-namespace Catch {
-
- class Session : NonCopyable {
- public:
-
- Session();
- ~Session() override;
-
- void showHelp() const;
- void libIdentify();
-
- int applyCommandLine( int argc, char const * const * argv );
- #if defined(CATCH_CONFIG_WCHAR) && defined(_WIN32) && defined(UNICODE)
- int applyCommandLine( int argc, wchar_t const * const * argv );
- #endif
-
- void useConfigData( ConfigData const& configData );
-
- template<typename CharT>
- int run(int argc, CharT const * const argv[]) {
- if (m_startupExceptions)
- return 1;
- int returnCode = applyCommandLine(argc, argv);
- if (returnCode == 0)
- returnCode = run();
- return returnCode;
- }
-
- int run();
-
- clara::Parser const& cli() const;
- void cli( clara::Parser const& newParser );
- ConfigData& configData();
- Config& config();
- private:
- int runInternal();
-
- clara::Parser m_cli;
- ConfigData m_configData;
- std::shared_ptr<Config> m_config;
- bool m_startupExceptions = false;
- };
-
-} // end namespace Catch
-
-// end catch_session.h
-// start catch_version.h
-
-#include <iosfwd>
-
-namespace Catch {
-
- // Versioning information
- struct Version {
- Version( Version const& ) = delete;
- Version& operator=( Version const& ) = delete;
- Version( unsigned int _majorVersion,
- unsigned int _minorVersion,
- unsigned int _patchNumber,
- char const * const _branchName,
- unsigned int _buildNumber );
-
- unsigned int const majorVersion;
- unsigned int const minorVersion;
- unsigned int const patchNumber;
-
- // buildNumber is only used if branchName is not null
- char const * const branchName;
- unsigned int const buildNumber;
-
- friend std::ostream& operator << ( std::ostream& os, Version const& version );
- };
-
- Version const& libraryVersion();
-}
-
-// end catch_version.h
-#include <cstdlib>
-#include <iomanip>
-#include <set>
-#include <iterator>
-
-namespace Catch {
-
- namespace {
- const int MaxExitCode = 255;
-
- IStreamingReporterPtr createReporter(std::string const& reporterName, IConfigPtr const& config) {
- auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, config);
- CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << "'");
-
- return reporter;
- }
-
- IStreamingReporterPtr makeReporter(std::shared_ptr<Config> const& config) {
- if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()) {
- return createReporter(config->getReporterName(), config);
- }
-
- // On older platforms, returning std::unique_ptr<ListeningReporter>
- // when the return type is std::unique_ptr<IStreamingReporter>
- // doesn't compile without a std::move call. However, this causes
- // a warning on newer platforms. Thus, we have to work around
- // it a bit and downcast the pointer manually.
- auto ret = std::unique_ptr<IStreamingReporter>(new ListeningReporter);
- auto& multi = static_cast<ListeningReporter&>(*ret);
- auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners();
- for (auto const& listener : listeners) {
- multi.addListener(listener->create(Catch::ReporterConfig(config)));
- }
- multi.addReporter(createReporter(config->getReporterName(), config));
- return ret;
- }
-
- class TestGroup {
- public:
- explicit TestGroup(std::shared_ptr<Config> const& config)
- : m_config{config}
- , m_context{config, makeReporter(config)}
- {
- auto const& allTestCases = getAllTestCasesSorted(*m_config);
- m_matches = m_config->testSpec().matchesByFilter(allTestCases, *m_config);
- auto const& invalidArgs = m_config->testSpec().getInvalidArgs();
-
- if (m_matches.empty() && invalidArgs.empty()) {
- for (auto const& test : allTestCases)
- if (!test.isHidden())
- m_tests.emplace(&test);
- } else {
- for (auto const& match : m_matches)
- m_tests.insert(match.tests.begin(), match.tests.end());
- }
- }
-
- Totals execute() {
- auto const& invalidArgs = m_config->testSpec().getInvalidArgs();
- Totals totals;
- m_context.testGroupStarting(m_config->name(), 1, 1);
- for (auto const& testCase : m_tests) {
- if (!m_context.aborting())
- totals += m_context.runTest(*testCase);
- else
- m_context.reporter().skipTest(*testCase);
- }
-
- for (auto const& match : m_matches) {
- if (match.tests.empty()) {
- m_context.reporter().noMatchingTestCases(match.name);
- totals.error = -1;
- }
- }
-
- if (!invalidArgs.empty()) {
- for (auto const& invalidArg: invalidArgs)
- m_context.reporter().reportInvalidArguments(invalidArg);
- }
-
- m_context.testGroupEnded(m_config->name(), totals, 1, 1);
- return totals;
- }
-
- private:
- using Tests = std::set<TestCase const*>;
-
- std::shared_ptr<Config> m_config;
- RunContext m_context;
- Tests m_tests;
- TestSpec::Matches m_matches;
- };
-
- void applyFilenamesAsTags(Catch::IConfig const& config) {
- auto& tests = const_cast<std::vector<TestCase>&>(getAllTestCasesSorted(config));
- for (auto& testCase : tests) {
- auto tags = testCase.tags;
-
- std::string filename = testCase.lineInfo.file;
- auto lastSlash = filename.find_last_of("\\/");
- if (lastSlash != std::string::npos) {
- filename.erase(0, lastSlash);
- filename[0] = '#';
- }
-
- auto lastDot = filename.find_last_of('.');
- if (lastDot != std::string::npos) {
- filename.erase(lastDot);
- }
-
- tags.push_back(std::move(filename));
- setTags(testCase, tags);
- }
- }
-
- } // anon namespace
-
- Session::Session() {
- static bool alreadyInstantiated = false;
- if( alreadyInstantiated ) {
- CATCH_TRY { CATCH_INTERNAL_ERROR( "Only one instance of Catch::Session can ever be used" ); }
- CATCH_CATCH_ALL { getMutableRegistryHub().registerStartupException(); }
- }
-
- // There cannot be exceptions at startup in no-exception mode.
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- const auto& exceptions = getRegistryHub().getStartupExceptionRegistry().getExceptions();
- if ( !exceptions.empty() ) {
- config();
- getCurrentMutableContext().setConfig(m_config);
-
- m_startupExceptions = true;
- Colour colourGuard( Colour::Red );
- Catch::cerr() << "Errors occurred during startup!" << '\n';
- // iterate over all exceptions and notify user
- for ( const auto& ex_ptr : exceptions ) {
- try {
- std::rethrow_exception(ex_ptr);
- } catch ( std::exception const& ex ) {
- Catch::cerr() << Column( ex.what() ).indent(2) << '\n';
- }
- }
- }
-#endif
-
- alreadyInstantiated = true;
- m_cli = makeCommandLineParser( m_configData );
- }
- Session::~Session() {
- Catch::cleanUp();
- }
-
- void Session::showHelp() const {
- Catch::cout()
- << "\nCatch v" << libraryVersion() << "\n"
- << m_cli << std::endl
- << "For more detailed usage please see the project docs\n" << std::endl;
- }
- void Session::libIdentify() {
- Catch::cout()
- << std::left << std::setw(16) << "description: " << "A Catch2 test executable\n"
- << std::left << std::setw(16) << "category: " << "testframework\n"
- << std::left << std::setw(16) << "framework: " << "Catch Test\n"
- << std::left << std::setw(16) << "version: " << libraryVersion() << std::endl;
- }
-
- int Session::applyCommandLine( int argc, char const * const * argv ) {
- if( m_startupExceptions )
- return 1;
-
- auto result = m_cli.parse( clara::Args( argc, argv ) );
- if( !result ) {
- config();
- getCurrentMutableContext().setConfig(m_config);
- Catch::cerr()
- << Colour( Colour::Red )
- << "\nError(s) in input:\n"
- << Column( result.errorMessage() ).indent( 2 )
- << "\n\n";
- Catch::cerr() << "Run with -? for usage\n" << std::endl;
- return MaxExitCode;
- }
-
- if( m_configData.showHelp )
- showHelp();
- if( m_configData.libIdentify )
- libIdentify();
- m_config.reset();
- return 0;
- }
-
-#if defined(CATCH_CONFIG_WCHAR) && defined(_WIN32) && defined(UNICODE)
- int Session::applyCommandLine( int argc, wchar_t const * const * argv ) {
-
- char **utf8Argv = new char *[ argc ];
-
- for ( int i = 0; i < argc; ++i ) {
- int bufSize = WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, nullptr, 0, nullptr, nullptr );
-
- utf8Argv[ i ] = new char[ bufSize ];
-
- WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, utf8Argv[i], bufSize, nullptr, nullptr );
- }
-
- int returnCode = applyCommandLine( argc, utf8Argv );
-
- for ( int i = 0; i < argc; ++i )
- delete [] utf8Argv[ i ];
-
- delete [] utf8Argv;
-
- return returnCode;
- }
-#endif
-
- void Session::useConfigData( ConfigData const& configData ) {
- m_configData = configData;
- m_config.reset();
- }
-
- int Session::run() {
- if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) {
- Catch::cout() << "...waiting for enter/ return before starting" << std::endl;
- static_cast<void>(std::getchar());
- }
- int exitCode = runInternal();
- if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeExit ) != 0 ) {
- Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << std::endl;
- static_cast<void>(std::getchar());
- }
- return exitCode;
- }
-
- clara::Parser const& Session::cli() const {
- return m_cli;
- }
- void Session::cli( clara::Parser const& newParser ) {
- m_cli = newParser;
- }
- ConfigData& Session::configData() {
- return m_configData;
- }
- Config& Session::config() {
- if( !m_config )
- m_config = std::make_shared<Config>( m_configData );
- return *m_config;
- }
-
- int Session::runInternal() {
- if( m_startupExceptions )
- return 1;
-
- if (m_configData.showHelp || m_configData.libIdentify) {
- return 0;
- }
-
- CATCH_TRY {
- config(); // Force config to be constructed
-
- seedRng( *m_config );
-
- if( m_configData.filenamesAsTags )
- applyFilenamesAsTags( *m_config );
-
- // Handle list request
- if( Option<std::size_t> listed = list( m_config ) )
- return static_cast<int>( *listed );
-
- TestGroup tests { m_config };
- auto const totals = tests.execute();
-
- if( m_config->warnAboutNoTests() && totals.error == -1 )
- return 2;
-
- // Note that on unices only the lower 8 bits are usually used, clamping
- // the return value to 255 prevents false negative when some multiple
- // of 256 tests has failed
- return (std::min) (MaxExitCode, (std::max) (totals.error, static_cast<int>(totals.assertions.failed)));
- }
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- catch( std::exception& ex ) {
- Catch::cerr() << ex.what() << std::endl;
- return MaxExitCode;
- }
-#endif
- }
-
-} // end namespace Catch
-// end catch_session.cpp
-// start catch_singletons.cpp
-
-#include <vector>
-
-namespace Catch {
-
- namespace {
- static auto getSingletons() -> std::vector<ISingleton*>*& {
- static std::vector<ISingleton*>* g_singletons = nullptr;
- if( !g_singletons )
- g_singletons = new std::vector<ISingleton*>();
- return g_singletons;
- }
- }
-
- ISingleton::~ISingleton() {}
-
- void addSingleton(ISingleton* singleton ) {
- getSingletons()->push_back( singleton );
- }
- void cleanupSingletons() {
- auto& singletons = getSingletons();
- for( auto singleton : *singletons )
- delete singleton;
- delete singletons;
- singletons = nullptr;
- }
-
-} // namespace Catch
-// end catch_singletons.cpp
-// start catch_startup_exception_registry.cpp
-
-#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
-namespace Catch {
-void StartupExceptionRegistry::add( std::exception_ptr const& exception ) noexcept {
- CATCH_TRY {
- m_exceptions.push_back(exception);
- } CATCH_CATCH_ALL {
- // If we run out of memory during start-up there's really not a lot more we can do about it
- std::terminate();
- }
- }
-
- std::vector<std::exception_ptr> const& StartupExceptionRegistry::getExceptions() const noexcept {
- return m_exceptions;
- }
-
-} // end namespace Catch
-#endif
-// end catch_startup_exception_registry.cpp
-// start catch_stream.cpp
-
-#include <cstdio>
-#include <iostream>
-#include <fstream>
-#include <sstream>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- Catch::IStream::~IStream() = default;
-
- namespace Detail { namespace {
- template<typename WriterF, std::size_t bufferSize=256>
- class StreamBufImpl : public std::streambuf {
- char data[bufferSize];
- WriterF m_writer;
-
- public:
- StreamBufImpl() {
- setp( data, data + sizeof(data) );
- }
-
- ~StreamBufImpl() noexcept {
- StreamBufImpl::sync();
- }
-
- private:
- int overflow( int c ) override {
- sync();
-
- if( c != EOF ) {
- if( pbase() == epptr() )
- m_writer( std::string( 1, static_cast<char>( c ) ) );
- else
- sputc( static_cast<char>( c ) );
- }
- return 0;
- }
-
- int sync() override {
- if( pbase() != pptr() ) {
- m_writer( std::string( pbase(), static_cast<std::string::size_type>( pptr() - pbase() ) ) );
- setp( pbase(), epptr() );
- }
- return 0;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- struct OutputDebugWriter {
-
- void operator()( std::string const&str ) {
- writeToDebugConsole( str );
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class FileStream : public IStream {
- mutable std::ofstream m_ofs;
- public:
- FileStream( StringRef filename ) {
- m_ofs.open( filename.c_str() );
- CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << "'" );
- }
- ~FileStream() override = default;
- public: // IStream
- std::ostream& stream() const override {
- return m_ofs;
- }
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class CoutStream : public IStream {
- mutable std::ostream m_os;
- public:
- // Store the streambuf from cout up-front because
- // cout may get redirected when running tests
- CoutStream() : m_os( Catch::cout().rdbuf() ) {}
- ~CoutStream() override = default;
-
- public: // IStream
- std::ostream& stream() const override { return m_os; }
- };
-
- ///////////////////////////////////////////////////////////////////////////
-
- class DebugOutStream : public IStream {
- std::unique_ptr<StreamBufImpl<OutputDebugWriter>> m_streamBuf;
- mutable std::ostream m_os;
- public:
- DebugOutStream()
- : m_streamBuf( new StreamBufImpl<OutputDebugWriter>() ),
- m_os( m_streamBuf.get() )
- {}
-
- ~DebugOutStream() override = default;
-
- public: // IStream
- std::ostream& stream() const override { return m_os; }
- };
-
- }} // namespace anon::detail
-
- ///////////////////////////////////////////////////////////////////////////
-
- auto makeStream( StringRef const &filename ) -> IStream const* {
- if( filename.empty() )
- return new Detail::CoutStream();
- else if( filename[0] == '%' ) {
- if( filename == "%debug" )
- return new Detail::DebugOutStream();
- else
- CATCH_ERROR( "Unrecognised stream: '" << filename << "'" );
- }
- else
- return new Detail::FileStream( filename );
- }
-
- // This class encapsulates the idea of a pool of ostringstreams that can be reused.
- struct StringStreams {
- std::vector<std::unique_ptr<std::ostringstream>> m_streams;
- std::vector<std::size_t> m_unused;
- std::ostringstream m_referenceStream; // Used for copy state/ flags from
-
- auto add() -> std::size_t {
- if( m_unused.empty() ) {
- m_streams.push_back( std::unique_ptr<std::ostringstream>( new std::ostringstream ) );
- return m_streams.size()-1;
- }
- else {
- auto index = m_unused.back();
- m_unused.pop_back();
- return index;
- }
- }
-
- void release( std::size_t index ) {
- m_streams[index]->copyfmt( m_referenceStream ); // Restore initial flags and other state
- m_unused.push_back(index);
- }
- };
-
- ReusableStringStream::ReusableStringStream()
- : m_index( Singleton<StringStreams>::getMutable().add() ),
- m_oss( Singleton<StringStreams>::getMutable().m_streams[m_index].get() )
- {}
-
- ReusableStringStream::~ReusableStringStream() {
- static_cast<std::ostringstream*>( m_oss )->str("");
- m_oss->clear();
- Singleton<StringStreams>::getMutable().release( m_index );
- }
-
- auto ReusableStringStream::str() const -> std::string {
- return static_cast<std::ostringstream*>( m_oss )->str();
- }
-
- ///////////////////////////////////////////////////////////////////////////
-
-#ifndef CATCH_CONFIG_NOSTDOUT // If you #define this you must implement these functions
- std::ostream& cout() { return std::cout; }
- std::ostream& cerr() { return std::cerr; }
- std::ostream& clog() { return std::clog; }
-#endif
-}
-// end catch_stream.cpp
-// start catch_string_manip.cpp
-
-#include <algorithm>
-#include <ostream>
-#include <cstring>
-#include <cctype>
-#include <vector>
-
-namespace Catch {
-
- namespace {
- char toLowerCh(char c) {
- return static_cast<char>( std::tolower( static_cast<unsigned char>(c) ) );
- }
- }
-
- bool startsWith( std::string const& s, std::string const& prefix ) {
- return s.size() >= prefix.size() && std::equal(prefix.begin(), prefix.end(), s.begin());
- }
- bool startsWith( std::string const& s, char prefix ) {
- return !s.empty() && s[0] == prefix;
- }
- bool endsWith( std::string const& s, std::string const& suffix ) {
- return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin());
- }
- bool endsWith( std::string const& s, char suffix ) {
- return !s.empty() && s[s.size()-1] == suffix;
- }
- bool contains( std::string const& s, std::string const& infix ) {
- return s.find( infix ) != std::string::npos;
- }
- void toLowerInPlace( std::string& s ) {
- std::transform( s.begin(), s.end(), s.begin(), toLowerCh );
- }
- std::string toLower( std::string const& s ) {
- std::string lc = s;
- toLowerInPlace( lc );
- return lc;
- }
- std::string trim( std::string const& str ) {
- static char const* whitespaceChars = "\n\r\t ";
- std::string::size_type start = str.find_first_not_of( whitespaceChars );
- std::string::size_type end = str.find_last_not_of( whitespaceChars );
-
- return start != std::string::npos ? str.substr( start, 1+end-start ) : std::string();
- }
-
- StringRef trim(StringRef ref) {
- const auto is_ws = [](char c) {
- return c == ' ' || c == '\t' || c == '\n' || c == '\r';
- };
- size_t real_begin = 0;
- while (real_begin < ref.size() && is_ws(ref[real_begin])) { ++real_begin; }
- size_t real_end = ref.size();
- while (real_end > real_begin && is_ws(ref[real_end - 1])) { --real_end; }
-
- return ref.substr(real_begin, real_end - real_begin);
- }
-
- bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) {
- bool replaced = false;
- std::size_t i = str.find( replaceThis );
- while( i != std::string::npos ) {
- replaced = true;
- str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() );
- if( i < str.size()-withThis.size() )
- i = str.find( replaceThis, i+withThis.size() );
- else
- i = std::string::npos;
- }
- return replaced;
- }
-
- std::vector<StringRef> splitStringRef( StringRef str, char delimiter ) {
- std::vector<StringRef> subStrings;
- std::size_t start = 0;
- for(std::size_t pos = 0; pos < str.size(); ++pos ) {
- if( str[pos] == delimiter ) {
- if( pos - start > 1 )
- subStrings.push_back( str.substr( start, pos-start ) );
- start = pos+1;
- }
- }
- if( start < str.size() )
- subStrings.push_back( str.substr( start, str.size()-start ) );
- return subStrings;
- }
-
- pluralise::pluralise( std::size_t count, std::string const& label )
- : m_count( count ),
- m_label( label )
- {}
-
- std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) {
- os << pluraliser.m_count << ' ' << pluraliser.m_label;
- if( pluraliser.m_count != 1 )
- os << 's';
- return os;
- }
-
-}
-// end catch_string_manip.cpp
-// start catch_stringref.cpp
-
-#include <algorithm>
-#include <ostream>
-#include <cstring>
-#include <cstdint>
-
-namespace Catch {
- StringRef::StringRef( char const* rawChars ) noexcept
- : StringRef( rawChars, static_cast<StringRef::size_type>(std::strlen(rawChars) ) )
- {}
-
- auto StringRef::c_str() const -> char const* {
- CATCH_ENFORCE(isNullTerminated(), "Called StringRef::c_str() on a non-null-terminated instance");
- return m_start;
- }
- auto StringRef::data() const noexcept -> char const* {
- return m_start;
- }
-
- auto StringRef::substr( size_type start, size_type size ) const noexcept -> StringRef {
- if (start < m_size) {
- return StringRef(m_start + start, (std::min)(m_size - start, size));
- } else {
- return StringRef();
- }
- }
- auto StringRef::operator == ( StringRef const& other ) const noexcept -> bool {
- return m_size == other.m_size
- && (std::memcmp( m_start, other.m_start, m_size ) == 0);
- }
-
- auto operator << ( std::ostream& os, StringRef const& str ) -> std::ostream& {
- return os.write(str.data(), str.size());
- }
-
- auto operator+=( std::string& lhs, StringRef const& rhs ) -> std::string& {
- lhs.append(rhs.data(), rhs.size());
- return lhs;
- }
-
-} // namespace Catch
-// end catch_stringref.cpp
-// start catch_tag_alias.cpp
-
-namespace Catch {
- TagAlias::TagAlias(std::string const & _tag, SourceLineInfo _lineInfo): tag(_tag), lineInfo(_lineInfo) {}
-}
-// end catch_tag_alias.cpp
-// start catch_tag_alias_autoregistrar.cpp
-
-namespace Catch {
-
- RegistrarForTagAliases::RegistrarForTagAliases(char const* alias, char const* tag, SourceLineInfo const& lineInfo) {
- CATCH_TRY {
- getMutableRegistryHub().registerTagAlias(alias, tag, lineInfo);
- } CATCH_CATCH_ALL {
- // Do not throw when constructing global objects, instead register the exception to be processed later
- getMutableRegistryHub().registerStartupException();
- }
- }
-
-}
-// end catch_tag_alias_autoregistrar.cpp
-// start catch_tag_alias_registry.cpp
-
-#include <sstream>
-
-namespace Catch {
-
- TagAliasRegistry::~TagAliasRegistry() {}
-
- TagAlias const* TagAliasRegistry::find( std::string const& alias ) const {
- auto it = m_registry.find( alias );
- if( it != m_registry.end() )
- return &(it->second);
- else
- return nullptr;
- }
-
- std::string TagAliasRegistry::expandAliases( std::string const& unexpandedTestSpec ) const {
- std::string expandedTestSpec = unexpandedTestSpec;
- for( auto const& registryKvp : m_registry ) {
- std::size_t pos = expandedTestSpec.find( registryKvp.first );
- if( pos != std::string::npos ) {
- expandedTestSpec = expandedTestSpec.substr( 0, pos ) +
- registryKvp.second.tag +
- expandedTestSpec.substr( pos + registryKvp.first.size() );
- }
- }
- return expandedTestSpec;
- }
-
- void TagAliasRegistry::add( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) {
- CATCH_ENFORCE( startsWith(alias, "[@") && endsWith(alias, ']'),
- "error: tag alias, '" << alias << "' is not of the form [@alias name].\n" << lineInfo );
-
- CATCH_ENFORCE( m_registry.insert(std::make_pair(alias, TagAlias(tag, lineInfo))).second,
- "error: tag alias, '" << alias << "' already registered.\n"
- << "\tFirst seen at: " << find(alias)->lineInfo << "\n"
- << "\tRedefined at: " << lineInfo );
- }
-
- ITagAliasRegistry::~ITagAliasRegistry() {}
-
- ITagAliasRegistry const& ITagAliasRegistry::get() {
- return getRegistryHub().getTagAliasRegistry();
- }
-
-} // end namespace Catch
-// end catch_tag_alias_registry.cpp
-// start catch_test_case_info.cpp
-
-#include <cctype>
-#include <exception>
-#include <algorithm>
-#include <sstream>
-
-namespace Catch {
-
- namespace {
- TestCaseInfo::SpecialProperties parseSpecialTag( std::string const& tag ) {
- if( startsWith( tag, '.' ) ||
- tag == "!hide" )
- return TestCaseInfo::IsHidden;
- else if( tag == "!throws" )
- return TestCaseInfo::Throws;
- else if( tag == "!shouldfail" )
- return TestCaseInfo::ShouldFail;
- else if( tag == "!mayfail" )
- return TestCaseInfo::MayFail;
- else if( tag == "!nonportable" )
- return TestCaseInfo::NonPortable;
- else if( tag == "!benchmark" )
- return static_cast<TestCaseInfo::SpecialProperties>( TestCaseInfo::Benchmark | TestCaseInfo::IsHidden );
- else
- return TestCaseInfo::None;
- }
- bool isReservedTag( std::string const& tag ) {
- return parseSpecialTag( tag ) == TestCaseInfo::None && tag.size() > 0 && !std::isalnum( static_cast<unsigned char>(tag[0]) );
- }
- void enforceNotReservedTag( std::string const& tag, SourceLineInfo const& _lineInfo ) {
- CATCH_ENFORCE( !isReservedTag(tag),
- "Tag name: [" << tag << "] is not allowed.\n"
- << "Tag names starting with non alphanumeric characters are reserved\n"
- << _lineInfo );
- }
- }
-
- TestCase makeTestCase( ITestInvoker* _testCase,
- std::string const& _className,
- NameAndTags const& nameAndTags,
- SourceLineInfo const& _lineInfo )
- {
- bool isHidden = false;
-
- // Parse out tags
- std::vector<std::string> tags;
- std::string desc, tag;
- bool inTag = false;
- for (char c : nameAndTags.tags) {
- if( !inTag ) {
- if( c == '[' )
- inTag = true;
- else
- desc += c;
- }
- else {
- if( c == ']' ) {
- TestCaseInfo::SpecialProperties prop = parseSpecialTag( tag );
- if( ( prop & TestCaseInfo::IsHidden ) != 0 )
- isHidden = true;
- else if( prop == TestCaseInfo::None )
- enforceNotReservedTag( tag, _lineInfo );
-
- // Merged hide tags like `[.approvals]` should be added as
- // `[.][approvals]`. The `[.]` is added at later point, so
- // we only strip the prefix
- if (startsWith(tag, '.') && tag.size() > 1) {
- tag.erase(0, 1);
- }
- tags.push_back( tag );
- tag.clear();
- inTag = false;
- }
- else
- tag += c;
- }
- }
- if( isHidden ) {
- // Add all "hidden" tags to make them behave identically
- tags.insert( tags.end(), { ".", "!hide" } );
- }
-
- TestCaseInfo info( static_cast<std::string>(nameAndTags.name), _className, desc, tags, _lineInfo );
- return TestCase( _testCase, std::move(info) );
- }
-
- void setTags( TestCaseInfo& testCaseInfo, std::vector<std::string> tags ) {
- std::sort(begin(tags), end(tags));
- tags.erase(std::unique(begin(tags), end(tags)), end(tags));
- testCaseInfo.lcaseTags.clear();
-
- for( auto const& tag : tags ) {
- std::string lcaseTag = toLower( tag );
- testCaseInfo.properties = static_cast<TestCaseInfo::SpecialProperties>( testCaseInfo.properties | parseSpecialTag( lcaseTag ) );
- testCaseInfo.lcaseTags.push_back( lcaseTag );
- }
- testCaseInfo.tags = std::move(tags);
- }
-
- TestCaseInfo::TestCaseInfo( std::string const& _name,
- std::string const& _className,
- std::string const& _description,
- std::vector<std::string> const& _tags,
- SourceLineInfo const& _lineInfo )
- : name( _name ),
- className( _className ),
- description( _description ),
- lineInfo( _lineInfo ),
- properties( None )
- {
- setTags( *this, _tags );
- }
-
- bool TestCaseInfo::isHidden() const {
- return ( properties & IsHidden ) != 0;
- }
- bool TestCaseInfo::throws() const {
- return ( properties & Throws ) != 0;
- }
- bool TestCaseInfo::okToFail() const {
- return ( properties & (ShouldFail | MayFail ) ) != 0;
- }
- bool TestCaseInfo::expectedToFail() const {
- return ( properties & (ShouldFail ) ) != 0;
- }
-
- std::string TestCaseInfo::tagsAsString() const {
- std::string ret;
- // '[' and ']' per tag
- std::size_t full_size = 2 * tags.size();
- for (const auto& tag : tags) {
- full_size += tag.size();
- }
- ret.reserve(full_size);
- for (const auto& tag : tags) {
- ret.push_back('[');
- ret.append(tag);
- ret.push_back(']');
- }
-
- return ret;
- }
-
- TestCase::TestCase( ITestInvoker* testCase, TestCaseInfo&& info ) : TestCaseInfo( std::move(info) ), test( testCase ) {}
-
- TestCase TestCase::withName( std::string const& _newName ) const {
- TestCase other( *this );
- other.name = _newName;
- return other;
- }
-
- void TestCase::invoke() const {
- test->invoke();
- }
-
- bool TestCase::operator == ( TestCase const& other ) const {
- return test.get() == other.test.get() &&
- name == other.name &&
- className == other.className;
- }
-
- bool TestCase::operator < ( TestCase const& other ) const {
- return name < other.name;
- }
-
- TestCaseInfo const& TestCase::getTestCaseInfo() const
- {
- return *this;
- }
-
-} // end namespace Catch
-// end catch_test_case_info.cpp
-// start catch_test_case_registry_impl.cpp
-
-#include <algorithm>
-#include <sstream>
-
-namespace Catch {
-
- namespace {
- struct TestHasher {
- using hash_t = uint64_t;
-
- explicit TestHasher( hash_t hashSuffix ):
- m_hashSuffix{ hashSuffix } {}
-
- uint32_t operator()( TestCase const& t ) const {
- // FNV-1a hash with multiplication fold.
- const hash_t prime = 1099511628211u;
- hash_t hash = 14695981039346656037u;
- for ( const char c : t.name ) {
- hash ^= c;
- hash *= prime;
- }
- hash ^= m_hashSuffix;
- hash *= prime;
- const uint32_t low{ static_cast<uint32_t>( hash ) };
- const uint32_t high{ static_cast<uint32_t>( hash >> 32 ) };
- return low * high;
- }
-
- private:
- hash_t m_hashSuffix;
- };
- } // end unnamed namespace
-
- std::vector<TestCase> sortTests( IConfig const& config, std::vector<TestCase> const& unsortedTestCases ) {
- switch( config.runOrder() ) {
- case RunTests::InDeclarationOrder:
- // already in declaration order
- break;
-
- case RunTests::InLexicographicalOrder: {
- std::vector<TestCase> sorted = unsortedTestCases;
- std::sort( sorted.begin(), sorted.end() );
- return sorted;
- }
-
- case RunTests::InRandomOrder: {
- seedRng( config );
- TestHasher h{ config.rngSeed() };
-
- using hashedTest = std::pair<TestHasher::hash_t, TestCase const*>;
- std::vector<hashedTest> indexed_tests;
- indexed_tests.reserve( unsortedTestCases.size() );
-
- for (auto const& testCase : unsortedTestCases) {
- indexed_tests.emplace_back(h(testCase), &testCase);
- }
-
- std::sort(indexed_tests.begin(), indexed_tests.end(),
- [](hashedTest const& lhs, hashedTest const& rhs) {
- if (lhs.first == rhs.first) {
- return lhs.second->name < rhs.second->name;
- }
- return lhs.first < rhs.first;
- });
-
- std::vector<TestCase> sorted;
- sorted.reserve( indexed_tests.size() );
-
- for (auto const& hashed : indexed_tests) {
- sorted.emplace_back(*hashed.second);
- }
-
- return sorted;
- }
- }
- return unsortedTestCases;
- }
-
- bool isThrowSafe( TestCase const& testCase, IConfig const& config ) {
- return !testCase.throws() || config.allowThrows();
- }
-
- bool matchTest( TestCase const& testCase, TestSpec const& testSpec, IConfig const& config ) {
- return testSpec.matches( testCase ) && isThrowSafe( testCase, config );
- }
-
- void enforceNoDuplicateTestCases( std::vector<TestCase> const& functions ) {
- std::set<TestCase> seenFunctions;
- for( auto const& function : functions ) {
- auto prev = seenFunctions.insert( function );
- CATCH_ENFORCE( prev.second,
- "error: TEST_CASE( \"" << function.name << "\" ) already defined.\n"
- << "\tFirst seen at " << prev.first->getTestCaseInfo().lineInfo << "\n"
- << "\tRedefined at " << function.getTestCaseInfo().lineInfo );
- }
- }
-
- std::vector<TestCase> filterTests( std::vector<TestCase> const& testCases, TestSpec const& testSpec, IConfig const& config ) {
- std::vector<TestCase> filtered;
- filtered.reserve( testCases.size() );
- for (auto const& testCase : testCases) {
- if ((!testSpec.hasFilters() && !testCase.isHidden()) ||
- (testSpec.hasFilters() && matchTest(testCase, testSpec, config))) {
- filtered.push_back(testCase);
- }
- }
- return filtered;
- }
- std::vector<TestCase> const& getAllTestCasesSorted( IConfig const& config ) {
- return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config );
- }
-
- void TestRegistry::registerTest( TestCase const& testCase ) {
- std::string name = testCase.getTestCaseInfo().name;
- if( name.empty() ) {
- ReusableStringStream rss;
- rss << "Anonymous test case " << ++m_unnamedCount;
- return registerTest( testCase.withName( rss.str() ) );
- }
- m_functions.push_back( testCase );
- }
-
- std::vector<TestCase> const& TestRegistry::getAllTests() const {
- return m_functions;
- }
- std::vector<TestCase> const& TestRegistry::getAllTestsSorted( IConfig const& config ) const {
- if( m_sortedFunctions.empty() )
- enforceNoDuplicateTestCases( m_functions );
-
- if( m_currentSortOrder != config.runOrder() || m_sortedFunctions.empty() ) {
- m_sortedFunctions = sortTests( config, m_functions );
- m_currentSortOrder = config.runOrder();
- }
- return m_sortedFunctions;
- }
-
- ///////////////////////////////////////////////////////////////////////////
- TestInvokerAsFunction::TestInvokerAsFunction( void(*testAsFunction)() ) noexcept : m_testAsFunction( testAsFunction ) {}
-
- void TestInvokerAsFunction::invoke() const {
- m_testAsFunction();
- }
-
- std::string extractClassName( StringRef const& classOrQualifiedMethodName ) {
- std::string className(classOrQualifiedMethodName);
- if( startsWith( className, '&' ) )
- {
- std::size_t lastColons = className.rfind( "::" );
- std::size_t penultimateColons = className.rfind( "::", lastColons-1 );
- if( penultimateColons == std::string::npos )
- penultimateColons = 1;
- className = className.substr( penultimateColons, lastColons-penultimateColons );
- }
- return className;
- }
-
-} // end namespace Catch
-// end catch_test_case_registry_impl.cpp
-// start catch_test_case_tracker.cpp
-
-#include <algorithm>
-#include <cassert>
-#include <stdexcept>
-#include <memory>
-#include <sstream>
-
-#if defined(__clang__)
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wexit-time-destructors"
-#endif
-
-namespace Catch {
-namespace TestCaseTracking {
-
- NameAndLocation::NameAndLocation( std::string const& _name, SourceLineInfo const& _location )
- : name( _name ),
- location( _location )
- {}
-
- ITracker::~ITracker() = default;
-
- ITracker& TrackerContext::startRun() {
- m_rootTracker = std::make_shared<SectionTracker>( NameAndLocation( "{root}", CATCH_INTERNAL_LINEINFO ), *this, nullptr );
- m_currentTracker = nullptr;
- m_runState = Executing;
- return *m_rootTracker;
- }
-
- void TrackerContext::endRun() {
- m_rootTracker.reset();
- m_currentTracker = nullptr;
- m_runState = NotStarted;
- }
-
- void TrackerContext::startCycle() {
- m_currentTracker = m_rootTracker.get();
- m_runState = Executing;
- }
- void TrackerContext::completeCycle() {
- m_runState = CompletedCycle;
- }
-
- bool TrackerContext::completedCycle() const {
- return m_runState == CompletedCycle;
- }
- ITracker& TrackerContext::currentTracker() {
- return *m_currentTracker;
- }
- void TrackerContext::setCurrentTracker( ITracker* tracker ) {
- m_currentTracker = tracker;
- }
-
- TrackerBase::TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ):
- ITracker(nameAndLocation),
- m_ctx( ctx ),
- m_parent( parent )
- {}
-
- bool TrackerBase::isComplete() const {
- return m_runState == CompletedSuccessfully || m_runState == Failed;
- }
- bool TrackerBase::isSuccessfullyCompleted() const {
- return m_runState == CompletedSuccessfully;
- }
- bool TrackerBase::isOpen() const {
- return m_runState != NotStarted && !isComplete();
- }
- bool TrackerBase::hasChildren() const {
- return !m_children.empty();
- }
-
- void TrackerBase::addChild( ITrackerPtr const& child ) {
- m_children.push_back( child );
- }
-
- ITrackerPtr TrackerBase::findChild( NameAndLocation const& nameAndLocation ) {
- auto it = std::find_if( m_children.begin(), m_children.end(),
- [&nameAndLocation]( ITrackerPtr const& tracker ){
- return
- tracker->nameAndLocation().location == nameAndLocation.location &&
- tracker->nameAndLocation().name == nameAndLocation.name;
- } );
- return( it != m_children.end() )
- ? *it
- : nullptr;
- }
- ITracker& TrackerBase::parent() {
- assert( m_parent ); // Should always be non-null except for root
- return *m_parent;
- }
-
- void TrackerBase::openChild() {
- if( m_runState != ExecutingChildren ) {
- m_runState = ExecutingChildren;
- if( m_parent )
- m_parent->openChild();
- }
- }
-
- bool TrackerBase::isSectionTracker() const { return false; }
- bool TrackerBase::isGeneratorTracker() const { return false; }
-
- void TrackerBase::open() {
- m_runState = Executing;
- moveToThis();
- if( m_parent )
- m_parent->openChild();
- }
-
- void TrackerBase::close() {
-
- // Close any still open children (e.g. generators)
- while( &m_ctx.currentTracker() != this )
- m_ctx.currentTracker().close();
-
- switch( m_runState ) {
- case NeedsAnotherRun:
- break;
-
- case Executing:
- m_runState = CompletedSuccessfully;
- break;
- case ExecutingChildren:
- if( std::all_of(m_children.begin(), m_children.end(), [](ITrackerPtr const& t){ return t->isComplete(); }) )
- m_runState = CompletedSuccessfully;
- break;
-
- case NotStarted:
- case CompletedSuccessfully:
- case Failed:
- CATCH_INTERNAL_ERROR( "Illogical state: " << m_runState );
-
- default:
- CATCH_INTERNAL_ERROR( "Unknown state: " << m_runState );
- }
- moveToParent();
- m_ctx.completeCycle();
- }
- void TrackerBase::fail() {
- m_runState = Failed;
- if( m_parent )
- m_parent->markAsNeedingAnotherRun();
- moveToParent();
- m_ctx.completeCycle();
- }
- void TrackerBase::markAsNeedingAnotherRun() {
- m_runState = NeedsAnotherRun;
- }
-
- void TrackerBase::moveToParent() {
- assert( m_parent );
- m_ctx.setCurrentTracker( m_parent );
- }
- void TrackerBase::moveToThis() {
- m_ctx.setCurrentTracker( this );
- }
-
- SectionTracker::SectionTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
- : TrackerBase( nameAndLocation, ctx, parent ),
- m_trimmed_name(trim(nameAndLocation.name))
- {
- if( parent ) {
- while( !parent->isSectionTracker() )
- parent = &parent->parent();
-
- SectionTracker& parentSection = static_cast<SectionTracker&>( *parent );
- addNextFilters( parentSection.m_filters );
- }
- }
-
- bool SectionTracker::isComplete() const {
- bool complete = true;
-
- if (m_filters.empty()
- || m_filters[0] == ""
- || std::find(m_filters.begin(), m_filters.end(), m_trimmed_name) != m_filters.end()) {
- complete = TrackerBase::isComplete();
- }
- return complete;
- }
-
- bool SectionTracker::isSectionTracker() const { return true; }
-
- SectionTracker& SectionTracker::acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation ) {
- std::shared_ptr<SectionTracker> section;
-
- ITracker& currentTracker = ctx.currentTracker();
- if( ITrackerPtr childTracker = currentTracker.findChild( nameAndLocation ) ) {
- assert( childTracker );
- assert( childTracker->isSectionTracker() );
- section = std::static_pointer_cast<SectionTracker>( childTracker );
- }
- else {
- section = std::make_shared<SectionTracker>( nameAndLocation, ctx, &currentTracker );
- currentTracker.addChild( section );
- }
- if( !ctx.completedCycle() )
- section->tryOpen();
- return *section;
- }
-
- void SectionTracker::tryOpen() {
- if( !isComplete() )
- open();
- }
-
- void SectionTracker::addInitialFilters( std::vector<std::string> const& filters ) {
- if( !filters.empty() ) {
- m_filters.reserve( m_filters.size() + filters.size() + 2 );
- m_filters.emplace_back(""); // Root - should never be consulted
- m_filters.emplace_back(""); // Test Case - not a section filter
- m_filters.insert( m_filters.end(), filters.begin(), filters.end() );
- }
- }
- void SectionTracker::addNextFilters( std::vector<std::string> const& filters ) {
- if( filters.size() > 1 )
- m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() );
- }
-
- std::vector<std::string> const& SectionTracker::getFilters() const {
- return m_filters;
- }
-
- std::string const& SectionTracker::trimmedName() const {
- return m_trimmed_name;
- }
-
-} // namespace TestCaseTracking
-
-using TestCaseTracking::ITracker;
-using TestCaseTracking::TrackerContext;
-using TestCaseTracking::SectionTracker;
-
-} // namespace Catch
-
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif
-// end catch_test_case_tracker.cpp
-// start catch_test_registry.cpp
-
-namespace Catch {
-
- auto makeTestInvoker( void(*testAsFunction)() ) noexcept -> ITestInvoker* {
- return new(std::nothrow) TestInvokerAsFunction( testAsFunction );
- }
-
- NameAndTags::NameAndTags( StringRef const& name_ , StringRef const& tags_ ) noexcept : name( name_ ), tags( tags_ ) {}
-
- AutoReg::AutoReg( ITestInvoker* invoker, SourceLineInfo const& lineInfo, StringRef const& classOrMethod, NameAndTags const& nameAndTags ) noexcept {
- CATCH_TRY {
- getMutableRegistryHub()
- .registerTest(
- makeTestCase(
- invoker,
- extractClassName( classOrMethod ),
- nameAndTags,
- lineInfo));
- } CATCH_CATCH_ALL {
- // Do not throw when constructing global objects, instead register the exception to be processed later
- getMutableRegistryHub().registerStartupException();
- }
- }
-
- AutoReg::~AutoReg() = default;
-}
-// end catch_test_registry.cpp
-// start catch_test_spec.cpp
-
-#include <algorithm>
-#include <string>
-#include <vector>
-#include <memory>
-
-namespace Catch {
-
- TestSpec::Pattern::Pattern( std::string const& name )
- : m_name( name )
- {}
-
- TestSpec::Pattern::~Pattern() = default;
-
- std::string const& TestSpec::Pattern::name() const {
- return m_name;
- }
-
- TestSpec::NamePattern::NamePattern( std::string const& name, std::string const& filterString )
- : Pattern( filterString )
- , m_wildcardPattern( toLower( name ), CaseSensitive::No )
- {}
-
- bool TestSpec::NamePattern::matches( TestCaseInfo const& testCase ) const {
- return m_wildcardPattern.matches( testCase.name );
- }
-
- TestSpec::TagPattern::TagPattern( std::string const& tag, std::string const& filterString )
- : Pattern( filterString )
- , m_tag( toLower( tag ) )
- {}
-
- bool TestSpec::TagPattern::matches( TestCaseInfo const& testCase ) const {
- return std::find(begin(testCase.lcaseTags),
- end(testCase.lcaseTags),
- m_tag) != end(testCase.lcaseTags);
- }
-
- TestSpec::ExcludedPattern::ExcludedPattern( PatternPtr const& underlyingPattern )
- : Pattern( underlyingPattern->name() )
- , m_underlyingPattern( underlyingPattern )
- {}
-
- bool TestSpec::ExcludedPattern::matches( TestCaseInfo const& testCase ) const {
- return !m_underlyingPattern->matches( testCase );
- }
-
- bool TestSpec::Filter::matches( TestCaseInfo const& testCase ) const {
- return std::all_of( m_patterns.begin(), m_patterns.end(), [&]( PatternPtr const& p ){ return p->matches( testCase ); } );
- }
-
- std::string TestSpec::Filter::name() const {
- std::string name;
- for( auto const& p : m_patterns )
- name += p->name();
- return name;
- }
-
- bool TestSpec::hasFilters() const {
- return !m_filters.empty();
- }
-
- bool TestSpec::matches( TestCaseInfo const& testCase ) const {
- return std::any_of( m_filters.begin(), m_filters.end(), [&]( Filter const& f ){ return f.matches( testCase ); } );
- }
-
- TestSpec::Matches TestSpec::matchesByFilter( std::vector<TestCase> const& testCases, IConfig const& config ) const
- {
- Matches matches( m_filters.size() );
- std::transform( m_filters.begin(), m_filters.end(), matches.begin(), [&]( Filter const& filter ){
- std::vector<TestCase const*> currentMatches;
- for( auto const& test : testCases )
- if( isThrowSafe( test, config ) && filter.matches( test ) )
- currentMatches.emplace_back( &test );
- return FilterMatch{ filter.name(), currentMatches };
- } );
- return matches;
- }
-
- const TestSpec::vectorStrings& TestSpec::getInvalidArgs() const{
- return (m_invalidArgs);
- }
-
-}
-// end catch_test_spec.cpp
-// start catch_test_spec_parser.cpp
-
-namespace Catch {
-
- TestSpecParser::TestSpecParser( ITagAliasRegistry const& tagAliases ) : m_tagAliases( &tagAliases ) {}
-
- TestSpecParser& TestSpecParser::parse( std::string const& arg ) {
- m_mode = None;
- m_exclusion = false;
- m_arg = m_tagAliases->expandAliases( arg );
- m_escapeChars.clear();
- m_substring.reserve(m_arg.size());
- m_patternName.reserve(m_arg.size());
- m_realPatternPos = 0;
-
- for( m_pos = 0; m_pos < m_arg.size(); ++m_pos )
- //if visitChar fails
- if( !visitChar( m_arg[m_pos] ) ){
- m_testSpec.m_invalidArgs.push_back(arg);
- break;
- }
- endMode();
- return *this;
- }
- TestSpec TestSpecParser::testSpec() {
- addFilter();
- return m_testSpec;
- }
- bool TestSpecParser::visitChar( char c ) {
- if( (m_mode != EscapedName) && (c == '\\') ) {
- escape();
- addCharToPattern(c);
- return true;
- }else if((m_mode != EscapedName) && (c == ',') ) {
- return separate();
- }
-
- switch( m_mode ) {
- case None:
- if( processNoneChar( c ) )
- return true;
- break;
- case Name:
- processNameChar( c );
- break;
- case EscapedName:
- endMode();
- addCharToPattern(c);
- return true;
- default:
- case Tag:
- case QuotedName:
- if( processOtherChar( c ) )
- return true;
- break;
- }
-
- m_substring += c;
- if( !isControlChar( c ) ) {
- m_patternName += c;
- m_realPatternPos++;
- }
- return true;
- }
- // Two of the processing methods return true to signal the caller to return
- // without adding the given character to the current pattern strings
- bool TestSpecParser::processNoneChar( char c ) {
- switch( c ) {
- case ' ':
- return true;
- case '~':
- m_exclusion = true;
- return false;
- case '[':
- startNewMode( Tag );
- return false;
- case '"':
- startNewMode( QuotedName );
- return false;
- default:
- startNewMode( Name );
- return false;
- }
- }
- void TestSpecParser::processNameChar( char c ) {
- if( c == '[' ) {
- if( m_substring == "exclude:" )
- m_exclusion = true;
- else
- endMode();
- startNewMode( Tag );
- }
- }
- bool TestSpecParser::processOtherChar( char c ) {
- if( !isControlChar( c ) )
- return false;
- m_substring += c;
- endMode();
- return true;
- }
- void TestSpecParser::startNewMode( Mode mode ) {
- m_mode = mode;
- }
- void TestSpecParser::endMode() {
- switch( m_mode ) {
- case Name:
- case QuotedName:
- return addNamePattern();
- case Tag:
- return addTagPattern();
- case EscapedName:
- revertBackToLastMode();
- return;
- case None:
- default:
- return startNewMode( None );
- }
- }
- void TestSpecParser::escape() {
- saveLastMode();
- m_mode = EscapedName;
- m_escapeChars.push_back(m_realPatternPos);
- }
- bool TestSpecParser::isControlChar( char c ) const {
- switch( m_mode ) {
- default:
- return false;
- case None:
- return c == '~';
- case Name:
- return c == '[';
- case EscapedName:
- return true;
- case QuotedName:
- return c == '"';
- case Tag:
- return c == '[' || c == ']';
- }
- }
-
- void TestSpecParser::addFilter() {
- if( !m_currentFilter.m_patterns.empty() ) {
- m_testSpec.m_filters.push_back( m_currentFilter );
- m_currentFilter = TestSpec::Filter();
- }
- }
-
- void TestSpecParser::saveLastMode() {
- lastMode = m_mode;
- }
-
- void TestSpecParser::revertBackToLastMode() {
- m_mode = lastMode;
- }
-
- bool TestSpecParser::separate() {
- if( (m_mode==QuotedName) || (m_mode==Tag) ){
- //invalid argument, signal failure to previous scope.
- m_mode = None;
- m_pos = m_arg.size();
- m_substring.clear();
- m_patternName.clear();
- m_realPatternPos = 0;
- return false;
- }
- endMode();
- addFilter();
- return true; //success
- }
-
- std::string TestSpecParser::preprocessPattern() {
- std::string token = m_patternName;
- for (std::size_t i = 0; i < m_escapeChars.size(); ++i)
- token = token.substr(0, m_escapeChars[i] - i) + token.substr(m_escapeChars[i] - i + 1);
- m_escapeChars.clear();
- if (startsWith(token, "exclude:")) {
- m_exclusion = true;
- token = token.substr(8);
- }
-
- m_patternName.clear();
- m_realPatternPos = 0;
-
- return token;
- }
-
- void TestSpecParser::addNamePattern() {
- auto token = preprocessPattern();
-
- if (!token.empty()) {
- TestSpec::PatternPtr pattern = std::make_shared<TestSpec::NamePattern>(token, m_substring);
- if (m_exclusion)
- pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern);
- m_currentFilter.m_patterns.push_back(pattern);
- }
- m_substring.clear();
- m_exclusion = false;
- m_mode = None;
- }
-
- void TestSpecParser::addTagPattern() {
- auto token = preprocessPattern();
-
- if (!token.empty()) {
- // If the tag pattern is the "hide and tag" shorthand (e.g. [.foo])
- // we have to create a separate hide tag and shorten the real one
- if (token.size() > 1 && token[0] == '.') {
- token.erase(token.begin());
- TestSpec::PatternPtr pattern = std::make_shared<TestSpec::TagPattern>(".", m_substring);
- if (m_exclusion) {
- pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern);
- }
- m_currentFilter.m_patterns.push_back(pattern);
- }
-
- TestSpec::PatternPtr pattern = std::make_shared<TestSpec::TagPattern>(token, m_substring);
-
- if (m_exclusion) {
- pattern = std::make_shared<TestSpec::ExcludedPattern>(pattern);
- }
- m_currentFilter.m_patterns.push_back(pattern);
- }
- m_substring.clear();
- m_exclusion = false;
- m_mode = None;
- }
-
- TestSpec parseTestSpec( std::string const& arg ) {
- return TestSpecParser( ITagAliasRegistry::get() ).parse( arg ).testSpec();
- }
-
-} // namespace Catch
-// end catch_test_spec_parser.cpp
-// start catch_timer.cpp
-
-#include <chrono>
-
-static const uint64_t nanosecondsInSecond = 1000000000;
-
-namespace Catch {
-
- auto getCurrentNanosecondsSinceEpoch() -> uint64_t {
- return std::chrono::duration_cast<std::chrono::nanoseconds>( std::chrono::high_resolution_clock::now().time_since_epoch() ).count();
- }
-
- namespace {
- auto estimateClockResolution() -> uint64_t {
- uint64_t sum = 0;
- static const uint64_t iterations = 1000000;
-
- auto startTime = getCurrentNanosecondsSinceEpoch();
-
- for( std::size_t i = 0; i < iterations; ++i ) {
-
- uint64_t ticks;
- uint64_t baseTicks = getCurrentNanosecondsSinceEpoch();
- do {
- ticks = getCurrentNanosecondsSinceEpoch();
- } while( ticks == baseTicks );
-
- auto delta = ticks - baseTicks;
- sum += delta;
-
- // If we have been calibrating for over 3 seconds -- the clock
- // is terrible and we should move on.
- // TBD: How to signal that the measured resolution is probably wrong?
- if (ticks > startTime + 3 * nanosecondsInSecond) {
- return sum / ( i + 1u );
- }
- }
-
- // We're just taking the mean, here. To do better we could take the std. dev and exclude outliers
- // - and potentially do more iterations if there's a high variance.
- return sum/iterations;
- }
- }
- auto getEstimatedClockResolution() -> uint64_t {
- static auto s_resolution = estimateClockResolution();
- return s_resolution;
- }
-
- void Timer::start() {
- m_nanoseconds = getCurrentNanosecondsSinceEpoch();
- }
- auto Timer::getElapsedNanoseconds() const -> uint64_t {
- return getCurrentNanosecondsSinceEpoch() - m_nanoseconds;
- }
- auto Timer::getElapsedMicroseconds() const -> uint64_t {
- return getElapsedNanoseconds()/1000;
- }
- auto Timer::getElapsedMilliseconds() const -> unsigned int {
- return static_cast<unsigned int>(getElapsedMicroseconds()/1000);
- }
- auto Timer::getElapsedSeconds() const -> double {
- return getElapsedMicroseconds()/1000000.0;
- }
-
-} // namespace Catch
-// end catch_timer.cpp
-// start catch_tostring.cpp
-
-#if defined(__clang__)
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wexit-time-destructors"
-# pragma clang diagnostic ignored "-Wglobal-constructors"
-#endif
-
-// Enable specific decls locally
-#if !defined(CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER)
-#define CATCH_CONFIG_ENABLE_CHRONO_STRINGMAKER
-#endif
-
-#include <cmath>
-#include <iomanip>
-
-namespace Catch {
-
-namespace Detail {
-
- const std::string unprintableString = "{?}";
-
- namespace {
- const int hexThreshold = 255;
-
- struct Endianness {
- enum Arch { Big, Little };
-
- static Arch which() {
- int one = 1;
- // If the lowest byte we read is non-zero, we can assume
- // that little endian format is used.
- auto value = *reinterpret_cast<char*>(&one);
- return value ? Little : Big;
- }
- };
- }
-
- std::string rawMemoryToString( const void *object, std::size_t size ) {
- // Reverse order for little endian architectures
- int i = 0, end = static_cast<int>( size ), inc = 1;
- if( Endianness::which() == Endianness::Little ) {
- i = end-1;
- end = inc = -1;
- }
-
- unsigned char const *bytes = static_cast<unsigned char const *>(object);
- ReusableStringStream rss;
- rss << "0x" << std::setfill('0') << std::hex;
- for( ; i != end; i += inc )
- rss << std::setw(2) << static_cast<unsigned>(bytes[i]);
- return rss.str();
- }
-}
-
-template<typename T>
-std::string fpToString( T value, int precision ) {
- if (Catch::isnan(value)) {
- return "nan";
- }
-
- ReusableStringStream rss;
- rss << std::setprecision( precision )
- << std::fixed
- << value;
- std::string d = rss.str();
- std::size_t i = d.find_last_not_of( '0' );
- if( i != std::string::npos && i != d.size()-1 ) {
- if( d[i] == '.' )
- i++;
- d = d.substr( 0, i+1 );
- }
- return d;
-}
-
-//// ======================================================= ////
-//
-// Out-of-line defs for full specialization of StringMaker
-//
-//// ======================================================= ////
-
-std::string StringMaker<std::string>::convert(const std::string& str) {
- if (!getCurrentContext().getConfig()->showInvisibles()) {
- return '"' + str + '"';
- }
-
- std::string s("\"");
- for (char c : str) {
- switch (c) {
- case '\n':
- s.append("\\n");
- break;
- case '\t':
- s.append("\\t");
- break;
- default:
- s.push_back(c);
- break;
- }
- }
- s.append("\"");
- return s;
-}
-
-#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
-std::string StringMaker<std::string_view>::convert(std::string_view str) {
- return ::Catch::Detail::stringify(std::string{ str });
-}
-#endif
-
-std::string StringMaker<char const*>::convert(char const* str) {
- if (str) {
- return ::Catch::Detail::stringify(std::string{ str });
- } else {
- return{ "{null string}" };
- }
-}
-std::string StringMaker<char*>::convert(char* str) {
- if (str) {
- return ::Catch::Detail::stringify(std::string{ str });
- } else {
- return{ "{null string}" };
- }
-}
-
-#ifdef CATCH_CONFIG_WCHAR
-std::string StringMaker<std::wstring>::convert(const std::wstring& wstr) {
- std::string s;
- s.reserve(wstr.size());
- for (auto c : wstr) {
- s += (c <= 0xff) ? static_cast<char>(c) : '?';
- }
- return ::Catch::Detail::stringify(s);
-}
-
-# ifdef CATCH_CONFIG_CPP17_STRING_VIEW
-std::string StringMaker<std::wstring_view>::convert(std::wstring_view str) {
- return StringMaker<std::wstring>::convert(std::wstring(str));
-}
-# endif
-
-std::string StringMaker<wchar_t const*>::convert(wchar_t const * str) {
- if (str) {
- return ::Catch::Detail::stringify(std::wstring{ str });
- } else {
- return{ "{null string}" };
- }
-}
-std::string StringMaker<wchar_t *>::convert(wchar_t * str) {
- if (str) {
- return ::Catch::Detail::stringify(std::wstring{ str });
- } else {
- return{ "{null string}" };
- }
-}
-#endif
-
-#if defined(CATCH_CONFIG_CPP17_BYTE)
-#include <cstddef>
-std::string StringMaker<std::byte>::convert(std::byte value) {
- return ::Catch::Detail::stringify(std::to_integer<unsigned long long>(value));
-}
-#endif // defined(CATCH_CONFIG_CPP17_BYTE)
-
-std::string StringMaker<int>::convert(int value) {
- return ::Catch::Detail::stringify(static_cast<long long>(value));
-}
-std::string StringMaker<long>::convert(long value) {
- return ::Catch::Detail::stringify(static_cast<long long>(value));
-}
-std::string StringMaker<long long>::convert(long long value) {
- ReusableStringStream rss;
- rss << value;
- if (value > Detail::hexThreshold) {
- rss << " (0x" << std::hex << value << ')';
- }
- return rss.str();
-}
-
-std::string StringMaker<unsigned int>::convert(unsigned int value) {
- return ::Catch::Detail::stringify(static_cast<unsigned long long>(value));
-}
-std::string StringMaker<unsigned long>::convert(unsigned long value) {
- return ::Catch::Detail::stringify(static_cast<unsigned long long>(value));
-}
-std::string StringMaker<unsigned long long>::convert(unsigned long long value) {
- ReusableStringStream rss;
- rss << value;
- if (value > Detail::hexThreshold) {
- rss << " (0x" << std::hex << value << ')';
- }
- return rss.str();
-}
-
-std::string StringMaker<bool>::convert(bool b) {
- return b ? "true" : "false";
-}
-
-std::string StringMaker<signed char>::convert(signed char value) {
- if (value == '\r') {
- return "'\\r'";
- } else if (value == '\f') {
- return "'\\f'";
- } else if (value == '\n') {
- return "'\\n'";
- } else if (value == '\t') {
- return "'\\t'";
- } else if ('\0' <= value && value < ' ') {
- return ::Catch::Detail::stringify(static_cast<unsigned int>(value));
- } else {
- char chstr[] = "' '";
- chstr[1] = value;
- return chstr;
- }
-}
-std::string StringMaker<char>::convert(char c) {
- return ::Catch::Detail::stringify(static_cast<signed char>(c));
-}
-std::string StringMaker<unsigned char>::convert(unsigned char c) {
- return ::Catch::Detail::stringify(static_cast<char>(c));
-}
-
-std::string StringMaker<std::nullptr_t>::convert(std::nullptr_t) {
- return "nullptr";
-}
-
-int StringMaker<float>::precision = 5;
-
-std::string StringMaker<float>::convert(float value) {
- return fpToString(value, precision) + 'f';
-}
-
-int StringMaker<double>::precision = 10;
-
-std::string StringMaker<double>::convert(double value) {
- return fpToString(value, precision);
-}
-
-std::string ratio_string<std::atto>::symbol() { return "a"; }
-std::string ratio_string<std::femto>::symbol() { return "f"; }
-std::string ratio_string<std::pico>::symbol() { return "p"; }
-std::string ratio_string<std::nano>::symbol() { return "n"; }
-std::string ratio_string<std::micro>::symbol() { return "u"; }
-std::string ratio_string<std::milli>::symbol() { return "m"; }
-
-} // end namespace Catch
-
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif
-
-// end catch_tostring.cpp
-// start catch_totals.cpp
-
-namespace Catch {
-
- Counts Counts::operator - ( Counts const& other ) const {
- Counts diff;
- diff.passed = passed - other.passed;
- diff.failed = failed - other.failed;
- diff.failedButOk = failedButOk - other.failedButOk;
- return diff;
- }
-
- Counts& Counts::operator += ( Counts const& other ) {
- passed += other.passed;
- failed += other.failed;
- failedButOk += other.failedButOk;
- return *this;
- }
-
- std::size_t Counts::total() const {
- return passed + failed + failedButOk;
- }
- bool Counts::allPassed() const {
- return failed == 0 && failedButOk == 0;
- }
- bool Counts::allOk() const {
- return failed == 0;
- }
-
- Totals Totals::operator - ( Totals const& other ) const {
- Totals diff;
- diff.assertions = assertions - other.assertions;
- diff.testCases = testCases - other.testCases;
- return diff;
- }
-
- Totals& Totals::operator += ( Totals const& other ) {
- assertions += other.assertions;
- testCases += other.testCases;
- return *this;
- }
-
- Totals Totals::delta( Totals const& prevTotals ) const {
- Totals diff = *this - prevTotals;
- if( diff.assertions.failed > 0 )
- ++diff.testCases.failed;
- else if( diff.assertions.failedButOk > 0 )
- ++diff.testCases.failedButOk;
- else
- ++diff.testCases.passed;
- return diff;
- }
-
-}
-// end catch_totals.cpp
-// start catch_uncaught_exceptions.cpp
-
-// start catch_config_uncaught_exceptions.hpp
-
-// Copyright Catch2 Authors
-// Distributed under the Boost Software License, Version 1.0.
-// (See accompanying file LICENSE_1_0.txt or copy at
-// https://www.boost.org/LICENSE_1_0.txt)
-
-// SPDX-License-Identifier: BSL-1.0
-
-#ifndef CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP
-#define CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP
-
-#if defined(_MSC_VER)
-# if _MSC_VER >= 1900 // Visual Studio 2015 or newer
-# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
-# endif
-#endif
-
-#include <exception>
-
-#if defined(__cpp_lib_uncaught_exceptions) \
- && !defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
-
-# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
-#endif // __cpp_lib_uncaught_exceptions
-
-#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) \
- && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) \
- && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
-
-# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
-#endif
-
-#endif // CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP
-// end catch_config_uncaught_exceptions.hpp
-#include <exception>
-
-namespace Catch {
- bool uncaught_exceptions() {
-#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
- return false;
-#elif defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
- return std::uncaught_exceptions() > 0;
-#else
- return std::uncaught_exception();
-#endif
- }
-} // end namespace Catch
-// end catch_uncaught_exceptions.cpp
-// start catch_version.cpp
-
-#include <ostream>
-
-namespace Catch {
-
- Version::Version
- ( unsigned int _majorVersion,
- unsigned int _minorVersion,
- unsigned int _patchNumber,
- char const * const _branchName,
- unsigned int _buildNumber )
- : majorVersion( _majorVersion ),
- minorVersion( _minorVersion ),
- patchNumber( _patchNumber ),
- branchName( _branchName ),
- buildNumber( _buildNumber )
- {}
-
- std::ostream& operator << ( std::ostream& os, Version const& version ) {
- os << version.majorVersion << '.'
- << version.minorVersion << '.'
- << version.patchNumber;
- // branchName is never null -> 0th char is \0 if it is empty
- if (version.branchName[0]) {
- os << '-' << version.branchName
- << '.' << version.buildNumber;
- }
- return os;
- }
-
- Version const& libraryVersion() {
- static Version version( 2, 13, 4, "", 0 );
- return version;
- }
-
-}
-// end catch_version.cpp
-// start catch_wildcard_pattern.cpp
-
-namespace Catch {
-
- WildcardPattern::WildcardPattern( std::string const& pattern,
- CaseSensitive::Choice caseSensitivity )
- : m_caseSensitivity( caseSensitivity ),
- m_pattern( normaliseString( pattern ) )
- {
- if( startsWith( m_pattern, '*' ) ) {
- m_pattern = m_pattern.substr( 1 );
- m_wildcard = WildcardAtStart;
- }
- if( endsWith( m_pattern, '*' ) ) {
- m_pattern = m_pattern.substr( 0, m_pattern.size()-1 );
- m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd );
- }
- }
-
- bool WildcardPattern::matches( std::string const& str ) const {
- switch( m_wildcard ) {
- case NoWildcard:
- return m_pattern == normaliseString( str );
- case WildcardAtStart:
- return endsWith( normaliseString( str ), m_pattern );
- case WildcardAtEnd:
- return startsWith( normaliseString( str ), m_pattern );
- case WildcardAtBothEnds:
- return contains( normaliseString( str ), m_pattern );
- default:
- CATCH_INTERNAL_ERROR( "Unknown enum" );
- }
- }
-
- std::string WildcardPattern::normaliseString( std::string const& str ) const {
- return trim( m_caseSensitivity == CaseSensitive::No ? toLower( str ) : str );
- }
-}
-// end catch_wildcard_pattern.cpp
-// start catch_xmlwriter.cpp
-
-#include <iomanip>
-#include <type_traits>
-
-namespace Catch {
-
-namespace {
-
- size_t trailingBytes(unsigned char c) {
- if ((c & 0xE0) == 0xC0) {
- return 2;
- }
- if ((c & 0xF0) == 0xE0) {
- return 3;
- }
- if ((c & 0xF8) == 0xF0) {
- return 4;
- }
- CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered");
- }
-
- uint32_t headerValue(unsigned char c) {
- if ((c & 0xE0) == 0xC0) {
- return c & 0x1F;
- }
- if ((c & 0xF0) == 0xE0) {
- return c & 0x0F;
- }
- if ((c & 0xF8) == 0xF0) {
- return c & 0x07;
- }
- CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered");
- }
-
- void hexEscapeChar(std::ostream& os, unsigned char c) {
- std::ios_base::fmtflags f(os.flags());
- os << "\\x"
- << std::uppercase << std::hex << std::setfill('0') << std::setw(2)
- << static_cast<int>(c);
- os.flags(f);
- }
-
- bool shouldNewline(XmlFormatting fmt) {
- return !!(static_cast<std::underlying_type<XmlFormatting>::type>(fmt & XmlFormatting::Newline));
- }
-
- bool shouldIndent(XmlFormatting fmt) {
- return !!(static_cast<std::underlying_type<XmlFormatting>::type>(fmt & XmlFormatting::Indent));
- }
-
-} // anonymous namespace
-
- XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs) {
- return static_cast<XmlFormatting>(
- static_cast<std::underlying_type<XmlFormatting>::type>(lhs) |
- static_cast<std::underlying_type<XmlFormatting>::type>(rhs)
- );
- }
-
- XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs) {
- return static_cast<XmlFormatting>(
- static_cast<std::underlying_type<XmlFormatting>::type>(lhs) &
- static_cast<std::underlying_type<XmlFormatting>::type>(rhs)
- );
- }
-
- XmlEncode::XmlEncode( std::string const& str, ForWhat forWhat )
- : m_str( str ),
- m_forWhat( forWhat )
- {}
-
- void XmlEncode::encodeTo( std::ostream& os ) const {
- // Apostrophe escaping not necessary if we always use " to write attributes
- // (see: http://www.w3.org/TR/xml/#syntax)
-
- for( std::size_t idx = 0; idx < m_str.size(); ++ idx ) {
- unsigned char c = m_str[idx];
- switch (c) {
- case '<': os << "&lt;"; break;
- case '&': os << "&amp;"; break;
-
- case '>':
- // See: http://www.w3.org/TR/xml/#syntax
- if (idx > 2 && m_str[idx - 1] == ']' && m_str[idx - 2] == ']')
- os << "&gt;";
- else
- os << c;
- break;
-
- case '\"':
- if (m_forWhat == ForAttributes)
- os << "&quot;";
- else
- os << c;
- break;
-
- default:
- // Check for control characters and invalid utf-8
-
- // Escape control characters in standard ascii
- // see http://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0
- if (c < 0x09 || (c > 0x0D && c < 0x20) || c == 0x7F) {
- hexEscapeChar(os, c);
- break;
- }
-
- // Plain ASCII: Write it to stream
- if (c < 0x7F) {
- os << c;
- break;
- }
-
- // UTF-8 territory
- // Check if the encoding is valid and if it is not, hex escape bytes.
- // Important: We do not check the exact decoded values for validity, only the encoding format
- // First check that this bytes is a valid lead byte:
- // This means that it is not encoded as 1111 1XXX
- // Or as 10XX XXXX
- if (c < 0xC0 ||
- c >= 0xF8) {
- hexEscapeChar(os, c);
- break;
- }
-
- auto encBytes = trailingBytes(c);
- // Are there enough bytes left to avoid accessing out-of-bounds memory?
- if (idx + encBytes - 1 >= m_str.size()) {
- hexEscapeChar(os, c);
- break;
- }
- // The header is valid, check data
- // The next encBytes bytes must together be a valid utf-8
- // This means: bitpattern 10XX XXXX and the extracted value is sane (ish)
- bool valid = true;
- uint32_t value = headerValue(c);
- for (std::size_t n = 1; n < encBytes; ++n) {
- unsigned char nc = m_str[idx + n];
- valid &= ((nc & 0xC0) == 0x80);
- value = (value << 6) | (nc & 0x3F);
- }
-
- if (
- // Wrong bit pattern of following bytes
- (!valid) ||
- // Overlong encodings
- (value < 0x80) ||
- (0x80 <= value && value < 0x800 && encBytes > 2) ||
- (0x800 < value && value < 0x10000 && encBytes > 3) ||
- // Encoded value out of range
- (value >= 0x110000)
- ) {
- hexEscapeChar(os, c);
- break;
- }
-
- // If we got here, this is in fact a valid(ish) utf-8 sequence
- for (std::size_t n = 0; n < encBytes; ++n) {
- os << m_str[idx + n];
- }
- idx += encBytes - 1;
- break;
- }
- }
- }
-
- std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode ) {
- xmlEncode.encodeTo( os );
- return os;
- }
-
- XmlWriter::ScopedElement::ScopedElement( XmlWriter* writer, XmlFormatting fmt )
- : m_writer( writer ),
- m_fmt(fmt)
- {}
-
- XmlWriter::ScopedElement::ScopedElement( ScopedElement&& other ) noexcept
- : m_writer( other.m_writer ),
- m_fmt(other.m_fmt)
- {
- other.m_writer = nullptr;
- other.m_fmt = XmlFormatting::None;
- }
- XmlWriter::ScopedElement& XmlWriter::ScopedElement::operator=( ScopedElement&& other ) noexcept {
- if ( m_writer ) {
- m_writer->endElement();
- }
- m_writer = other.m_writer;
- other.m_writer = nullptr;
- m_fmt = other.m_fmt;
- other.m_fmt = XmlFormatting::None;
- return *this;
- }
-
- XmlWriter::ScopedElement::~ScopedElement() {
- if (m_writer) {
- m_writer->endElement(m_fmt);
- }
- }
-
- XmlWriter::ScopedElement& XmlWriter::ScopedElement::writeText( std::string const& text, XmlFormatting fmt ) {
- m_writer->writeText( text, fmt );
- return *this;
- }
-
- XmlWriter::XmlWriter( std::ostream& os ) : m_os( os )
- {
- writeDeclaration();
- }
-
- XmlWriter::~XmlWriter() {
- while (!m_tags.empty()) {
- endElement();
- }
- newlineIfNecessary();
- }
-
- XmlWriter& XmlWriter::startElement( std::string const& name, XmlFormatting fmt ) {
- ensureTagClosed();
- newlineIfNecessary();
- if (shouldIndent(fmt)) {
- m_os << m_indent;
- m_indent += " ";
- }
- m_os << '<' << name;
- m_tags.push_back( name );
- m_tagIsOpen = true;
- applyFormatting(fmt);
- return *this;
- }
-
- XmlWriter::ScopedElement XmlWriter::scopedElement( std::string const& name, XmlFormatting fmt ) {
- ScopedElement scoped( this, fmt );
- startElement( name, fmt );
- return scoped;
- }
-
- XmlWriter& XmlWriter::endElement(XmlFormatting fmt) {
- m_indent = m_indent.substr(0, m_indent.size() - 2);
-
- if( m_tagIsOpen ) {
- m_os << "/>";
- m_tagIsOpen = false;
- } else {
- newlineIfNecessary();
- if (shouldIndent(fmt)) {
- m_os << m_indent;
- }
- m_os << "</" << m_tags.back() << ">";
- }
- m_os << std::flush;
- applyFormatting(fmt);
- m_tags.pop_back();
- return *this;
- }
-
- XmlWriter& XmlWriter::writeAttribute( std::string const& name, std::string const& attribute ) {
- if( !name.empty() && !attribute.empty() )
- m_os << ' ' << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << '"';
- return *this;
- }
-
- XmlWriter& XmlWriter::writeAttribute( std::string const& name, bool attribute ) {
- m_os << ' ' << name << "=\"" << ( attribute ? "true" : "false" ) << '"';
- return *this;
- }
-
- XmlWriter& XmlWriter::writeText( std::string const& text, XmlFormatting fmt) {
- if( !text.empty() ){
- bool tagWasOpen = m_tagIsOpen;
- ensureTagClosed();
- if (tagWasOpen && shouldIndent(fmt)) {
- m_os << m_indent;
- }
- m_os << XmlEncode( text );
- applyFormatting(fmt);
- }
- return *this;
- }
-
- XmlWriter& XmlWriter::writeComment( std::string const& text, XmlFormatting fmt) {
- ensureTagClosed();
- if (shouldIndent(fmt)) {
- m_os << m_indent;
- }
- m_os << "<!--" << text << "-->";
- applyFormatting(fmt);
- return *this;
- }
-
- void XmlWriter::writeStylesheetRef( std::string const& url ) {
- m_os << "<?xml-stylesheet type=\"text/xsl\" href=\"" << url << "\"?>\n";
- }
-
- XmlWriter& XmlWriter::writeBlankLine() {
- ensureTagClosed();
- m_os << '\n';
- return *this;
- }
-
- void XmlWriter::ensureTagClosed() {
- if( m_tagIsOpen ) {
- m_os << '>' << std::flush;
- newlineIfNecessary();
- m_tagIsOpen = false;
- }
- }
-
- void XmlWriter::applyFormatting(XmlFormatting fmt) {
- m_needsNewline = shouldNewline(fmt);
- }
-
- void XmlWriter::writeDeclaration() {
- m_os << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
- }
-
- void XmlWriter::newlineIfNecessary() {
- if( m_needsNewline ) {
- m_os << std::endl;
- m_needsNewline = false;
- }
- }
-}
-// end catch_xmlwriter.cpp
-// start catch_reporter_bases.cpp
-
-#include <cstring>
-#include <cfloat>
-#include <cstdio>
-#include <cassert>
-#include <memory>
-
-namespace Catch {
- void prepareExpandedExpression(AssertionResult& result) {
- result.getExpandedExpression();
- }
-
- // Because formatting using c++ streams is stateful, drop down to C is required
- // Alternatively we could use stringstream, but its performance is... not good.
- std::string getFormattedDuration( double duration ) {
- // Max exponent + 1 is required to represent the whole part
- // + 1 for decimal point
- // + 3 for the 3 decimal places
- // + 1 for null terminator
- const std::size_t maxDoubleSize = DBL_MAX_10_EXP + 1 + 1 + 3 + 1;
- char buffer[maxDoubleSize];
-
- // Save previous errno, to prevent sprintf from overwriting it
- ErrnoGuard guard;
-#ifdef _MSC_VER
- sprintf_s(buffer, "%.3f", duration);
-#else
- std::sprintf(buffer, "%.3f", duration);
-#endif
- return std::string(buffer);
- }
-
- bool shouldShowDuration( IConfig const& config, double duration ) {
- if ( config.showDurations() == ShowDurations::Always ) {
- return true;
- }
- if ( config.showDurations() == ShowDurations::Never ) {
- return false;
- }
- const double min = config.minDuration();
- return min >= 0 && duration >= min;
- }
-
- std::string serializeFilters( std::vector<std::string> const& container ) {
- ReusableStringStream oss;
- bool first = true;
- for (auto&& filter : container)
- {
- if (!first)
- oss << ' ';
- else
- first = false;
-
- oss << filter;
- }
- return oss.str();
- }
-
- TestEventListenerBase::TestEventListenerBase(ReporterConfig const & _config)
- :StreamingReporterBase(_config) {}
-
- std::set<Verbosity> TestEventListenerBase::getSupportedVerbosities() {
- return { Verbosity::Quiet, Verbosity::Normal, Verbosity::High };
- }
-
- void TestEventListenerBase::assertionStarting(AssertionInfo const &) {}
-
- bool TestEventListenerBase::assertionEnded(AssertionStats const &) {
- return false;
- }
-
-} // end namespace Catch
-// end catch_reporter_bases.cpp
-// start catch_reporter_compact.cpp
-
-namespace {
-
-#ifdef CATCH_PLATFORM_MAC
- const char* failedString() { return "FAILED"; }
- const char* passedString() { return "PASSED"; }
-#else
- const char* failedString() { return "failed"; }
- const char* passedString() { return "passed"; }
-#endif
-
- // Colour::LightGrey
- Catch::Colour::Code dimColour() { return Catch::Colour::FileName; }
-
- std::string bothOrAll( std::size_t count ) {
- return count == 1 ? std::string() :
- count == 2 ? "both " : "all " ;
- }
-
-} // anon namespace
-
-namespace Catch {
-namespace {
-// Colour, message variants:
-// - white: No tests ran.
-// - red: Failed [both/all] N test cases, failed [both/all] M assertions.
-// - white: Passed [both/all] N test cases (no assertions).
-// - red: Failed N tests cases, failed M assertions.
-// - green: Passed [both/all] N tests cases with M assertions.
-void printTotals(std::ostream& out, const Totals& totals) {
- if (totals.testCases.total() == 0) {
- out << "No tests ran.";
- } else if (totals.testCases.failed == totals.testCases.total()) {
- Colour colour(Colour::ResultError);
- const std::string qualify_assertions_failed =
- totals.assertions.failed == totals.assertions.total() ?
- bothOrAll(totals.assertions.failed) : std::string();
- out <<
- "Failed " << bothOrAll(totals.testCases.failed)
- << pluralise(totals.testCases.failed, "test case") << ", "
- "failed " << qualify_assertions_failed <<
- pluralise(totals.assertions.failed, "assertion") << '.';
- } else if (totals.assertions.total() == 0) {
- out <<
- "Passed " << bothOrAll(totals.testCases.total())
- << pluralise(totals.testCases.total(), "test case")
- << " (no assertions).";
- } else if (totals.assertions.failed) {
- Colour colour(Colour::ResultError);
- out <<
- "Failed " << pluralise(totals.testCases.failed, "test case") << ", "
- "failed " << pluralise(totals.assertions.failed, "assertion") << '.';
- } else {
- Colour colour(Colour::ResultSuccess);
- out <<
- "Passed " << bothOrAll(totals.testCases.passed)
- << pluralise(totals.testCases.passed, "test case") <<
- " with " << pluralise(totals.assertions.passed, "assertion") << '.';
- }
-}
-
-// Implementation of CompactReporter formatting
-class AssertionPrinter {
-public:
- AssertionPrinter& operator= (AssertionPrinter const&) = delete;
- AssertionPrinter(AssertionPrinter const&) = delete;
- AssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages)
- : stream(_stream)
- , result(_stats.assertionResult)
- , messages(_stats.infoMessages)
- , itMessage(_stats.infoMessages.begin())
- , printInfoMessages(_printInfoMessages) {}
-
- void print() {
- printSourceInfo();
-
- itMessage = messages.begin();
-
- switch (result.getResultType()) {
- case ResultWas::Ok:
- printResultType(Colour::ResultSuccess, passedString());
- printOriginalExpression();
- printReconstructedExpression();
- if (!result.hasExpression())
- printRemainingMessages(Colour::None);
- else
- printRemainingMessages();
- break;
- case ResultWas::ExpressionFailed:
- if (result.isOk())
- printResultType(Colour::ResultSuccess, failedString() + std::string(" - but was ok"));
- else
- printResultType(Colour::Error, failedString());
- printOriginalExpression();
- printReconstructedExpression();
- printRemainingMessages();
- break;
- case ResultWas::ThrewException:
- printResultType(Colour::Error, failedString());
- printIssue("unexpected exception with message:");
- printMessage();
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::FatalErrorCondition:
- printResultType(Colour::Error, failedString());
- printIssue("fatal error condition with message:");
- printMessage();
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::DidntThrowException:
- printResultType(Colour::Error, failedString());
- printIssue("expected exception, got none");
- printExpressionWas();
- printRemainingMessages();
- break;
- case ResultWas::Info:
- printResultType(Colour::None, "info");
- printMessage();
- printRemainingMessages();
- break;
- case ResultWas::Warning:
- printResultType(Colour::None, "warning");
- printMessage();
- printRemainingMessages();
- break;
- case ResultWas::ExplicitFailure:
- printResultType(Colour::Error, failedString());
- printIssue("explicitly");
- printRemainingMessages(Colour::None);
- break;
- // These cases are here to prevent compiler warnings
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- printResultType(Colour::Error, "** internal error **");
- break;
- }
- }
-
-private:
- void printSourceInfo() const {
- Colour colourGuard(Colour::FileName);
- stream << result.getSourceInfo() << ':';
- }
-
- void printResultType(Colour::Code colour, std::string const& passOrFail) const {
- if (!passOrFail.empty()) {
- {
- Colour colourGuard(colour);
- stream << ' ' << passOrFail;
- }
- stream << ':';
- }
- }
-
- void printIssue(std::string const& issue) const {
- stream << ' ' << issue;
- }
-
- void printExpressionWas() {
- if (result.hasExpression()) {
- stream << ';';
- {
- Colour colour(dimColour());
- stream << " expression was:";
- }
- printOriginalExpression();
- }
- }
-
- void printOriginalExpression() const {
- if (result.hasExpression()) {
- stream << ' ' << result.getExpression();
- }
- }
-
- void printReconstructedExpression() const {
- if (result.hasExpandedExpression()) {
- {
- Colour colour(dimColour());
- stream << " for: ";
- }
- stream << result.getExpandedExpression();
- }
- }
-
- void printMessage() {
- if (itMessage != messages.end()) {
- stream << " '" << itMessage->message << '\'';
- ++itMessage;
- }
- }
-
- void printRemainingMessages(Colour::Code colour = dimColour()) {
- if (itMessage == messages.end())
- return;
-
- const auto itEnd = messages.cend();
- const auto N = static_cast<std::size_t>(std::distance(itMessage, itEnd));
-
- {
- Colour colourGuard(colour);
- stream << " with " << pluralise(N, "message") << ':';
- }
-
- while (itMessage != itEnd) {
- // If this assertion is a warning ignore any INFO messages
- if (printInfoMessages || itMessage->type != ResultWas::Info) {
- printMessage();
- if (itMessage != itEnd) {
- Colour colourGuard(dimColour());
- stream << " and";
- }
- continue;
- }
- ++itMessage;
- }
- }
-
-private:
- std::ostream& stream;
- AssertionResult const& result;
- std::vector<MessageInfo> messages;
- std::vector<MessageInfo>::const_iterator itMessage;
- bool printInfoMessages;
-};
-
-} // anon namespace
-
- std::string CompactReporter::getDescription() {
- return "Reports test results on a single line, suitable for IDEs";
- }
-
- void CompactReporter::noMatchingTestCases( std::string const& spec ) {
- stream << "No test cases matched '" << spec << '\'' << std::endl;
- }
-
- void CompactReporter::assertionStarting( AssertionInfo const& ) {}
-
- bool CompactReporter::assertionEnded( AssertionStats const& _assertionStats ) {
- AssertionResult const& result = _assertionStats.assertionResult;
-
- bool printInfoMessages = true;
-
- // Drop out if result was successful and we're not printing those
- if( !m_config->includeSuccessfulResults() && result.isOk() ) {
- if( result.getResultType() != ResultWas::Warning )
- return false;
- printInfoMessages = false;
- }
-
- AssertionPrinter printer( stream, _assertionStats, printInfoMessages );
- printer.print();
-
- stream << std::endl;
- return true;
- }
-
- void CompactReporter::sectionEnded(SectionStats const& _sectionStats) {
- double dur = _sectionStats.durationInSeconds;
- if ( shouldShowDuration( *m_config, dur ) ) {
- stream << getFormattedDuration( dur ) << " s: " << _sectionStats.sectionInfo.name << std::endl;
- }
- }
-
- void CompactReporter::testRunEnded( TestRunStats const& _testRunStats ) {
- printTotals( stream, _testRunStats.totals );
- stream << '\n' << std::endl;
- StreamingReporterBase::testRunEnded( _testRunStats );
- }
-
- CompactReporter::~CompactReporter() {}
-
- CATCH_REGISTER_REPORTER( "compact", CompactReporter )
-
-} // end namespace Catch
-// end catch_reporter_compact.cpp
-// start catch_reporter_console.cpp
-
-#include <cfloat>
-#include <cstdio>
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4061) // Not all labels are EXPLICITLY handled in switch
- // Note that 4062 (not all labels are handled and default is missing) is enabled
-#endif
-
-#if defined(__clang__)
-# pragma clang diagnostic push
-// For simplicity, benchmarking-only helpers are always enabled
-# pragma clang diagnostic ignored "-Wunused-function"
-#endif
-
-namespace Catch {
-
-namespace {
-
-// Formatter impl for ConsoleReporter
-class ConsoleAssertionPrinter {
-public:
- ConsoleAssertionPrinter& operator= (ConsoleAssertionPrinter const&) = delete;
- ConsoleAssertionPrinter(ConsoleAssertionPrinter const&) = delete;
- ConsoleAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages)
- : stream(_stream),
- stats(_stats),
- result(_stats.assertionResult),
- colour(Colour::None),
- message(result.getMessage()),
- messages(_stats.infoMessages),
- printInfoMessages(_printInfoMessages) {
- switch (result.getResultType()) {
- case ResultWas::Ok:
- colour = Colour::Success;
- passOrFail = "PASSED";
- //if( result.hasMessage() )
- if (_stats.infoMessages.size() == 1)
- messageLabel = "with message";
- if (_stats.infoMessages.size() > 1)
- messageLabel = "with messages";
- break;
- case ResultWas::ExpressionFailed:
- if (result.isOk()) {
- colour = Colour::Success;
- passOrFail = "FAILED - but was ok";
- } else {
- colour = Colour::Error;
- passOrFail = "FAILED";
- }
- if (_stats.infoMessages.size() == 1)
- messageLabel = "with message";
- if (_stats.infoMessages.size() > 1)
- messageLabel = "with messages";
- break;
- case ResultWas::ThrewException:
- colour = Colour::Error;
- passOrFail = "FAILED";
- messageLabel = "due to unexpected exception with ";
- if (_stats.infoMessages.size() == 1)
- messageLabel += "message";
- if (_stats.infoMessages.size() > 1)
- messageLabel += "messages";
- break;
- case ResultWas::FatalErrorCondition:
- colour = Colour::Error;
- passOrFail = "FAILED";
- messageLabel = "due to a fatal error condition";
- break;
- case ResultWas::DidntThrowException:
- colour = Colour::Error;
- passOrFail = "FAILED";
- messageLabel = "because no exception was thrown where one was expected";
- break;
- case ResultWas::Info:
- messageLabel = "info";
- break;
- case ResultWas::Warning:
- messageLabel = "warning";
- break;
- case ResultWas::ExplicitFailure:
- passOrFail = "FAILED";
- colour = Colour::Error;
- if (_stats.infoMessages.size() == 1)
- messageLabel = "explicitly with message";
- if (_stats.infoMessages.size() > 1)
- messageLabel = "explicitly with messages";
- break;
- // These cases are here to prevent compiler warnings
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- passOrFail = "** internal error **";
- colour = Colour::Error;
- break;
- }
- }
-
- void print() const {
- printSourceInfo();
- if (stats.totals.assertions.total() > 0) {
- printResultType();
- printOriginalExpression();
- printReconstructedExpression();
- } else {
- stream << '\n';
- }
- printMessage();
- }
-
-private:
- void printResultType() const {
- if (!passOrFail.empty()) {
- Colour colourGuard(colour);
- stream << passOrFail << ":\n";
- }
- }
- void printOriginalExpression() const {
- if (result.hasExpression()) {
- Colour colourGuard(Colour::OriginalExpression);
- stream << " ";
- stream << result.getExpressionInMacro();
- stream << '\n';
- }
- }
- void printReconstructedExpression() const {
- if (result.hasExpandedExpression()) {
- stream << "with expansion:\n";
- Colour colourGuard(Colour::ReconstructedExpression);
- stream << Column(result.getExpandedExpression()).indent(2) << '\n';
- }
- }
- void printMessage() const {
- if (!messageLabel.empty())
- stream << messageLabel << ':' << '\n';
- for (auto const& msg : messages) {
- // If this assertion is a warning ignore any INFO messages
- if (printInfoMessages || msg.type != ResultWas::Info)
- stream << Column(msg.message).indent(2) << '\n';
- }
- }
- void printSourceInfo() const {
- Colour colourGuard(Colour::FileName);
- stream << result.getSourceInfo() << ": ";
- }
-
- std::ostream& stream;
- AssertionStats const& stats;
- AssertionResult const& result;
- Colour::Code colour;
- std::string passOrFail;
- std::string messageLabel;
- std::string message;
- std::vector<MessageInfo> messages;
- bool printInfoMessages;
-};
-
-std::size_t makeRatio(std::size_t number, std::size_t total) {
- std::size_t ratio = total > 0 ? CATCH_CONFIG_CONSOLE_WIDTH * number / total : 0;
- return (ratio == 0 && number > 0) ? 1 : ratio;
-}
-
-std::size_t& findMax(std::size_t& i, std::size_t& j, std::size_t& k) {
- if (i > j && i > k)
- return i;
- else if (j > k)
- return j;
- else
- return k;
-}
-
-struct ColumnInfo {
- enum Justification { Left, Right };
- std::string name;
- int width;
- Justification justification;
-};
-struct ColumnBreak {};
-struct RowBreak {};
-
-class Duration {
- enum class Unit {
- Auto,
- Nanoseconds,
- Microseconds,
- Milliseconds,
- Seconds,
- Minutes
- };
- static const uint64_t s_nanosecondsInAMicrosecond = 1000;
- static const uint64_t s_nanosecondsInAMillisecond = 1000 * s_nanosecondsInAMicrosecond;
- static const uint64_t s_nanosecondsInASecond = 1000 * s_nanosecondsInAMillisecond;
- static const uint64_t s_nanosecondsInAMinute = 60 * s_nanosecondsInASecond;
-
- double m_inNanoseconds;
- Unit m_units;
-
-public:
- explicit Duration(double inNanoseconds, Unit units = Unit::Auto)
- : m_inNanoseconds(inNanoseconds),
- m_units(units) {
- if (m_units == Unit::Auto) {
- if (m_inNanoseconds < s_nanosecondsInAMicrosecond)
- m_units = Unit::Nanoseconds;
- else if (m_inNanoseconds < s_nanosecondsInAMillisecond)
- m_units = Unit::Microseconds;
- else if (m_inNanoseconds < s_nanosecondsInASecond)
- m_units = Unit::Milliseconds;
- else if (m_inNanoseconds < s_nanosecondsInAMinute)
- m_units = Unit::Seconds;
- else
- m_units = Unit::Minutes;
- }
-
- }
-
- auto value() const -> double {
- switch (m_units) {
- case Unit::Microseconds:
- return m_inNanoseconds / static_cast<double>(s_nanosecondsInAMicrosecond);
- case Unit::Milliseconds:
- return m_inNanoseconds / static_cast<double>(s_nanosecondsInAMillisecond);
- case Unit::Seconds:
- return m_inNanoseconds / static_cast<double>(s_nanosecondsInASecond);
- case Unit::Minutes:
- return m_inNanoseconds / static_cast<double>(s_nanosecondsInAMinute);
- default:
- return m_inNanoseconds;
- }
- }
- auto unitsAsString() const -> std::string {
- switch (m_units) {
- case Unit::Nanoseconds:
- return "ns";
- case Unit::Microseconds:
- return "us";
- case Unit::Milliseconds:
- return "ms";
- case Unit::Seconds:
- return "s";
- case Unit::Minutes:
- return "m";
- default:
- return "** internal error **";
- }
-
- }
- friend auto operator << (std::ostream& os, Duration const& duration) -> std::ostream& {
- return os << duration.value() << ' ' << duration.unitsAsString();
- }
-};
-} // end anon namespace
-
-class TablePrinter {
- std::ostream& m_os;
- std::vector<ColumnInfo> m_columnInfos;
- std::ostringstream m_oss;
- int m_currentColumn = -1;
- bool m_isOpen = false;
-
-public:
- TablePrinter( std::ostream& os, std::vector<ColumnInfo> columnInfos )
- : m_os( os ),
- m_columnInfos( std::move( columnInfos ) ) {}
-
- auto columnInfos() const -> std::vector<ColumnInfo> const& {
- return m_columnInfos;
- }
-
- void open() {
- if (!m_isOpen) {
- m_isOpen = true;
- *this << RowBreak();
-
- Columns headerCols;
- Spacer spacer(2);
- for (auto const& info : m_columnInfos) {
- headerCols += Column(info.name).width(static_cast<std::size_t>(info.width - 2));
- headerCols += spacer;
- }
- m_os << headerCols << '\n';
-
- m_os << Catch::getLineOfChars<'-'>() << '\n';
- }
- }
- void close() {
- if (m_isOpen) {
- *this << RowBreak();
- m_os << std::endl;
- m_isOpen = false;
- }
- }
-
- template<typename T>
- friend TablePrinter& operator << (TablePrinter& tp, T const& value) {
- tp.m_oss << value;
- return tp;
- }
-
- friend TablePrinter& operator << (TablePrinter& tp, ColumnBreak) {
- auto colStr = tp.m_oss.str();
- const auto strSize = colStr.size();
- tp.m_oss.str("");
- tp.open();
- if (tp.m_currentColumn == static_cast<int>(tp.m_columnInfos.size() - 1)) {
- tp.m_currentColumn = -1;
- tp.m_os << '\n';
- }
- tp.m_currentColumn++;
-
- auto colInfo = tp.m_columnInfos[tp.m_currentColumn];
- auto padding = (strSize + 1 < static_cast<std::size_t>(colInfo.width))
- ? std::string(colInfo.width - (strSize + 1), ' ')
- : std::string();
- if (colInfo.justification == ColumnInfo::Left)
- tp.m_os << colStr << padding << ' ';
- else
- tp.m_os << padding << colStr << ' ';
- return tp;
- }
-
- friend TablePrinter& operator << (TablePrinter& tp, RowBreak) {
- if (tp.m_currentColumn > 0) {
- tp.m_os << '\n';
- tp.m_currentColumn = -1;
- }
- return tp;
- }
-};
-
-ConsoleReporter::ConsoleReporter(ReporterConfig const& config)
- : StreamingReporterBase(config),
- m_tablePrinter(new TablePrinter(config.stream(),
- [&config]() -> std::vector<ColumnInfo> {
- if (config.fullConfig()->benchmarkNoAnalysis())
- {
- return{
- { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH - 43, ColumnInfo::Left },
- { " samples", 14, ColumnInfo::Right },
- { " iterations", 14, ColumnInfo::Right },
- { " mean", 14, ColumnInfo::Right }
- };
- }
- else
- {
- return{
- { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH - 43, ColumnInfo::Left },
- { "samples mean std dev", 14, ColumnInfo::Right },
- { "iterations low mean low std dev", 14, ColumnInfo::Right },
- { "estimated high mean high std dev", 14, ColumnInfo::Right }
- };
- }
- }())) {}
-ConsoleReporter::~ConsoleReporter() = default;
-
-std::string ConsoleReporter::getDescription() {
- return "Reports test results as plain lines of text";
-}
-
-void ConsoleReporter::noMatchingTestCases(std::string const& spec) {
- stream << "No test cases matched '" << spec << '\'' << std::endl;
-}
-
-void ConsoleReporter::reportInvalidArguments(std::string const&arg){
- stream << "Invalid Filter: " << arg << std::endl;
-}
-
-void ConsoleReporter::assertionStarting(AssertionInfo const&) {}
-
-bool ConsoleReporter::assertionEnded(AssertionStats const& _assertionStats) {
- AssertionResult const& result = _assertionStats.assertionResult;
-
- bool includeResults = m_config->includeSuccessfulResults() || !result.isOk();
-
- // Drop out if result was successful but we're not printing them.
- if (!includeResults && result.getResultType() != ResultWas::Warning)
- return false;
-
- lazyPrint();
-
- ConsoleAssertionPrinter printer(stream, _assertionStats, includeResults);
- printer.print();
- stream << std::endl;
- return true;
-}
-
-void ConsoleReporter::sectionStarting(SectionInfo const& _sectionInfo) {
- m_tablePrinter->close();
- m_headerPrinted = false;
- StreamingReporterBase::sectionStarting(_sectionInfo);
-}
-void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) {
- m_tablePrinter->close();
- if (_sectionStats.missingAssertions) {
- lazyPrint();
- Colour colour(Colour::ResultError);
- if (m_sectionStack.size() > 1)
- stream << "\nNo assertions in section";
- else
- stream << "\nNo assertions in test case";
- stream << " '" << _sectionStats.sectionInfo.name << "'\n" << std::endl;
- }
- double dur = _sectionStats.durationInSeconds;
- if (shouldShowDuration(*m_config, dur)) {
- stream << getFormattedDuration(dur) << " s: " << _sectionStats.sectionInfo.name << std::endl;
- }
- if (m_headerPrinted) {
- m_headerPrinted = false;
- }
- StreamingReporterBase::sectionEnded(_sectionStats);
-}
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-void ConsoleReporter::benchmarkPreparing(std::string const& name) {
- lazyPrintWithoutClosingBenchmarkTable();
-
- auto nameCol = Column(name).width(static_cast<std::size_t>(m_tablePrinter->columnInfos()[0].width - 2));
-
- bool firstLine = true;
- for (auto line : nameCol) {
- if (!firstLine)
- (*m_tablePrinter) << ColumnBreak() << ColumnBreak() << ColumnBreak();
- else
- firstLine = false;
-
- (*m_tablePrinter) << line << ColumnBreak();
- }
-}
-
-void ConsoleReporter::benchmarkStarting(BenchmarkInfo const& info) {
- (*m_tablePrinter) << info.samples << ColumnBreak()
- << info.iterations << ColumnBreak();
- if (!m_config->benchmarkNoAnalysis())
- (*m_tablePrinter) << Duration(info.estimatedDuration) << ColumnBreak();
-}
-void ConsoleReporter::benchmarkEnded(BenchmarkStats<> const& stats) {
- if (m_config->benchmarkNoAnalysis())
- {
- (*m_tablePrinter) << Duration(stats.mean.point.count()) << ColumnBreak();
- }
- else
- {
- (*m_tablePrinter) << ColumnBreak()
- << Duration(stats.mean.point.count()) << ColumnBreak()
- << Duration(stats.mean.lower_bound.count()) << ColumnBreak()
- << Duration(stats.mean.upper_bound.count()) << ColumnBreak() << ColumnBreak()
- << Duration(stats.standardDeviation.point.count()) << ColumnBreak()
- << Duration(stats.standardDeviation.lower_bound.count()) << ColumnBreak()
- << Duration(stats.standardDeviation.upper_bound.count()) << ColumnBreak() << ColumnBreak() << ColumnBreak() << ColumnBreak() << ColumnBreak();
- }
-}
-
-void ConsoleReporter::benchmarkFailed(std::string const& error) {
- Colour colour(Colour::Red);
- (*m_tablePrinter)
- << "Benchmark failed (" << error << ')'
- << ColumnBreak() << RowBreak();
-}
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
-void ConsoleReporter::testCaseEnded(TestCaseStats const& _testCaseStats) {
- m_tablePrinter->close();
- StreamingReporterBase::testCaseEnded(_testCaseStats);
- m_headerPrinted = false;
-}
-void ConsoleReporter::testGroupEnded(TestGroupStats const& _testGroupStats) {
- if (currentGroupInfo.used) {
- printSummaryDivider();
- stream << "Summary for group '" << _testGroupStats.groupInfo.name << "':\n";
- printTotals(_testGroupStats.totals);
- stream << '\n' << std::endl;
- }
- StreamingReporterBase::testGroupEnded(_testGroupStats);
-}
-void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) {
- printTotalsDivider(_testRunStats.totals);
- printTotals(_testRunStats.totals);
- stream << std::endl;
- StreamingReporterBase::testRunEnded(_testRunStats);
-}
-void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) {
- StreamingReporterBase::testRunStarting(_testInfo);
- printTestFilters();
-}
-
-void ConsoleReporter::lazyPrint() {
-
- m_tablePrinter->close();
- lazyPrintWithoutClosingBenchmarkTable();
-}
-
-void ConsoleReporter::lazyPrintWithoutClosingBenchmarkTable() {
-
- if (!currentTestRunInfo.used)
- lazyPrintRunInfo();
- if (!currentGroupInfo.used)
- lazyPrintGroupInfo();
-
- if (!m_headerPrinted) {
- printTestCaseAndSectionHeader();
- m_headerPrinted = true;
- }
-}
-void ConsoleReporter::lazyPrintRunInfo() {
- stream << '\n' << getLineOfChars<'~'>() << '\n';
- Colour colour(Colour::SecondaryText);
- stream << currentTestRunInfo->name
- << " is a Catch v" << libraryVersion() << " host application.\n"
- << "Run with -? for options\n\n";
-
- if (m_config->rngSeed() != 0)
- stream << "Randomness seeded to: " << m_config->rngSeed() << "\n\n";
-
- currentTestRunInfo.used = true;
-}
-void ConsoleReporter::lazyPrintGroupInfo() {
- if (!currentGroupInfo->name.empty() && currentGroupInfo->groupsCounts > 1) {
- printClosedHeader("Group: " + currentGroupInfo->name);
- currentGroupInfo.used = true;
- }
-}
-void ConsoleReporter::printTestCaseAndSectionHeader() {
- assert(!m_sectionStack.empty());
- printOpenHeader(currentTestCaseInfo->name);
-
- if (m_sectionStack.size() > 1) {
- Colour colourGuard(Colour::Headers);
-
- auto
- it = m_sectionStack.begin() + 1, // Skip first section (test case)
- itEnd = m_sectionStack.end();
- for (; it != itEnd; ++it)
- printHeaderString(it->name, 2);
- }
-
- SourceLineInfo lineInfo = m_sectionStack.back().lineInfo;
-
- stream << getLineOfChars<'-'>() << '\n';
- Colour colourGuard(Colour::FileName);
- stream << lineInfo << '\n';
- stream << getLineOfChars<'.'>() << '\n' << std::endl;
-}
-
-void ConsoleReporter::printClosedHeader(std::string const& _name) {
- printOpenHeader(_name);
- stream << getLineOfChars<'.'>() << '\n';
-}
-void ConsoleReporter::printOpenHeader(std::string const& _name) {
- stream << getLineOfChars<'-'>() << '\n';
- {
- Colour colourGuard(Colour::Headers);
- printHeaderString(_name);
- }
-}
-
-// if string has a : in first line will set indent to follow it on
-// subsequent lines
-void ConsoleReporter::printHeaderString(std::string const& _string, std::size_t indent) {
- std::size_t i = _string.find(": ");
- if (i != std::string::npos)
- i += 2;
- else
- i = 0;
- stream << Column(_string).indent(indent + i).initialIndent(indent) << '\n';
-}
-
-struct SummaryColumn {
-
- SummaryColumn( std::string _label, Colour::Code _colour )
- : label( std::move( _label ) ),
- colour( _colour ) {}
- SummaryColumn addRow( std::size_t count ) {
- ReusableStringStream rss;
- rss << count;
- std::string row = rss.str();
- for (auto& oldRow : rows) {
- while (oldRow.size() < row.size())
- oldRow = ' ' + oldRow;
- while (oldRow.size() > row.size())
- row = ' ' + row;
- }
- rows.push_back(row);
- return *this;
- }
-
- std::string label;
- Colour::Code colour;
- std::vector<std::string> rows;
-
-};
-
-void ConsoleReporter::printTotals( Totals const& totals ) {
- if (totals.testCases.total() == 0) {
- stream << Colour(Colour::Warning) << "No tests ran\n";
- } else if (totals.assertions.total() > 0 && totals.testCases.allPassed()) {
- stream << Colour(Colour::ResultSuccess) << "All tests passed";
- stream << " ("
- << pluralise(totals.assertions.passed, "assertion") << " in "
- << pluralise(totals.testCases.passed, "test case") << ')'
- << '\n';
- } else {
-
- std::vector<SummaryColumn> columns;
- columns.push_back(SummaryColumn("", Colour::None)
- .addRow(totals.testCases.total())
- .addRow(totals.assertions.total()));
- columns.push_back(SummaryColumn("passed", Colour::Success)
- .addRow(totals.testCases.passed)
- .addRow(totals.assertions.passed));
- columns.push_back(SummaryColumn("failed", Colour::ResultError)
- .addRow(totals.testCases.failed)
- .addRow(totals.assertions.failed));
- columns.push_back(SummaryColumn("failed as expected", Colour::ResultExpectedFailure)
- .addRow(totals.testCases.failedButOk)
- .addRow(totals.assertions.failedButOk));
-
- printSummaryRow("test cases", columns, 0);
- printSummaryRow("assertions", columns, 1);
- }
-}
-void ConsoleReporter::printSummaryRow(std::string const& label, std::vector<SummaryColumn> const& cols, std::size_t row) {
- for (auto col : cols) {
- std::string value = col.rows[row];
- if (col.label.empty()) {
- stream << label << ": ";
- if (value != "0")
- stream << value;
- else
- stream << Colour(Colour::Warning) << "- none -";
- } else if (value != "0") {
- stream << Colour(Colour::LightGrey) << " | ";
- stream << Colour(col.colour)
- << value << ' ' << col.label;
- }
- }
- stream << '\n';
-}
-
-void ConsoleReporter::printTotalsDivider(Totals const& totals) {
- if (totals.testCases.total() > 0) {
- std::size_t failedRatio = makeRatio(totals.testCases.failed, totals.testCases.total());
- std::size_t failedButOkRatio = makeRatio(totals.testCases.failedButOk, totals.testCases.total());
- std::size_t passedRatio = makeRatio(totals.testCases.passed, totals.testCases.total());
- while (failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH - 1)
- findMax(failedRatio, failedButOkRatio, passedRatio)++;
- while (failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH - 1)
- findMax(failedRatio, failedButOkRatio, passedRatio)--;
-
- stream << Colour(Colour::Error) << std::string(failedRatio, '=');
- stream << Colour(Colour::ResultExpectedFailure) << std::string(failedButOkRatio, '=');
- if (totals.testCases.allPassed())
- stream << Colour(Colour::ResultSuccess) << std::string(passedRatio, '=');
- else
- stream << Colour(Colour::Success) << std::string(passedRatio, '=');
- } else {
- stream << Colour(Colour::Warning) << std::string(CATCH_CONFIG_CONSOLE_WIDTH - 1, '=');
- }
- stream << '\n';
-}
-void ConsoleReporter::printSummaryDivider() {
- stream << getLineOfChars<'-'>() << '\n';
-}
-
-void ConsoleReporter::printTestFilters() {
- if (m_config->testSpec().hasFilters()) {
- Colour guard(Colour::BrightYellow);
- stream << "Filters: " << serializeFilters(m_config->getTestsOrTags()) << '\n';
- }
-}
-
-CATCH_REGISTER_REPORTER("console", ConsoleReporter)
-
-} // end namespace Catch
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
-
-#if defined(__clang__)
-# pragma clang diagnostic pop
-#endif
-// end catch_reporter_console.cpp
-// start catch_reporter_junit.cpp
-
-#include <cassert>
-#include <sstream>
-#include <ctime>
-#include <algorithm>
-
-namespace Catch {
-
- namespace {
- std::string getCurrentTimestamp() {
- // Beware, this is not reentrant because of backward compatibility issues
- // Also, UTC only, again because of backward compatibility (%z is C++11)
- time_t rawtime;
- std::time(&rawtime);
- auto const timeStampSize = sizeof("2017-01-16T17:06:45Z");
-
-#ifdef _MSC_VER
- std::tm timeInfo = {};
- gmtime_s(&timeInfo, &rawtime);
-#else
- std::tm* timeInfo;
- timeInfo = std::gmtime(&rawtime);
-#endif
-
- char timeStamp[timeStampSize];
- const char * const fmt = "%Y-%m-%dT%H:%M:%SZ";
-
-#ifdef _MSC_VER
- std::strftime(timeStamp, timeStampSize, fmt, &timeInfo);
-#else
- std::strftime(timeStamp, timeStampSize, fmt, timeInfo);
-#endif
- return std::string(timeStamp);
- }
-
- std::string fileNameTag(const std::vector<std::string> &tags) {
- auto it = std::find_if(begin(tags),
- end(tags),
- [] (std::string const& tag) {return tag.front() == '#'; });
- if (it != tags.end())
- return it->substr(1);
- return std::string();
- }
- } // anonymous namespace
-
- JunitReporter::JunitReporter( ReporterConfig const& _config )
- : CumulativeReporterBase( _config ),
- xml( _config.stream() )
- {
- m_reporterPrefs.shouldRedirectStdOut = true;
- m_reporterPrefs.shouldReportAllAssertions = true;
- }
-
- JunitReporter::~JunitReporter() {}
-
- std::string JunitReporter::getDescription() {
- return "Reports test results in an XML format that looks like Ant's junitreport target";
- }
-
- void JunitReporter::noMatchingTestCases( std::string const& /*spec*/ ) {}
-
- void JunitReporter::testRunStarting( TestRunInfo const& runInfo ) {
- CumulativeReporterBase::testRunStarting( runInfo );
- xml.startElement( "testsuites" );
- }
-
- void JunitReporter::testGroupStarting( GroupInfo const& groupInfo ) {
- suiteTimer.start();
- stdOutForSuite.clear();
- stdErrForSuite.clear();
- unexpectedExceptions = 0;
- CumulativeReporterBase::testGroupStarting( groupInfo );
- }
-
- void JunitReporter::testCaseStarting( TestCaseInfo const& testCaseInfo ) {
- m_okToFail = testCaseInfo.okToFail();
- }
-
- bool JunitReporter::assertionEnded( AssertionStats const& assertionStats ) {
- if( assertionStats.assertionResult.getResultType() == ResultWas::ThrewException && !m_okToFail )
- unexpectedExceptions++;
- return CumulativeReporterBase::assertionEnded( assertionStats );
- }
-
- void JunitReporter::testCaseEnded( TestCaseStats const& testCaseStats ) {
- stdOutForSuite += testCaseStats.stdOut;
- stdErrForSuite += testCaseStats.stdErr;
- CumulativeReporterBase::testCaseEnded( testCaseStats );
- }
-
- void JunitReporter::testGroupEnded( TestGroupStats const& testGroupStats ) {
- double suiteTime = suiteTimer.getElapsedSeconds();
- CumulativeReporterBase::testGroupEnded( testGroupStats );
- writeGroup( *m_testGroups.back(), suiteTime );
- }
-
- void JunitReporter::testRunEndedCumulative() {
- xml.endElement();
- }
-
- void JunitReporter::writeGroup( TestGroupNode const& groupNode, double suiteTime ) {
- XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" );
-
- TestGroupStats const& stats = groupNode.value;
- xml.writeAttribute( "name", stats.groupInfo.name );
- xml.writeAttribute( "errors", unexpectedExceptions );
- xml.writeAttribute( "failures", stats.totals.assertions.failed-unexpectedExceptions );
- xml.writeAttribute( "tests", stats.totals.assertions.total() );
- xml.writeAttribute( "hostname", "tbd" ); // !TBD
- if( m_config->showDurations() == ShowDurations::Never )
- xml.writeAttribute( "time", "" );
- else
- xml.writeAttribute( "time", suiteTime );
- xml.writeAttribute( "timestamp", getCurrentTimestamp() );
-
- // Write properties if there are any
- if (m_config->hasTestFilters() || m_config->rngSeed() != 0) {
- auto properties = xml.scopedElement("properties");
- if (m_config->hasTestFilters()) {
- xml.scopedElement("property")
- .writeAttribute("name", "filters")
- .writeAttribute("value", serializeFilters(m_config->getTestsOrTags()));
- }
- if (m_config->rngSeed() != 0) {
- xml.scopedElement("property")
- .writeAttribute("name", "random-seed")
- .writeAttribute("value", m_config->rngSeed());
- }
- }
-
- // Write test cases
- for( auto const& child : groupNode.children )
- writeTestCase( *child );
-
- xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite ), XmlFormatting::Newline );
- xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite ), XmlFormatting::Newline );
- }
-
- void JunitReporter::writeTestCase( TestCaseNode const& testCaseNode ) {
- TestCaseStats const& stats = testCaseNode.value;
-
- // All test cases have exactly one section - which represents the
- // test case itself. That section may have 0-n nested sections
- assert( testCaseNode.children.size() == 1 );
- SectionNode const& rootSection = *testCaseNode.children.front();
-
- std::string className = stats.testInfo.className;
-
- if( className.empty() ) {
- className = fileNameTag(stats.testInfo.tags);
- if ( className.empty() )
- className = "global";
- }
-
- if ( !m_config->name().empty() )
- className = m_config->name() + "." + className;
-
- writeSection( className, "", rootSection );
- }
-
- void JunitReporter::writeSection( std::string const& className,
- std::string const& rootName,
- SectionNode const& sectionNode ) {
- std::string name = trim( sectionNode.stats.sectionInfo.name );
- if( !rootName.empty() )
- name = rootName + '/' + name;
-
- if( !sectionNode.assertions.empty() ||
- !sectionNode.stdOut.empty() ||
- !sectionNode.stdErr.empty() ) {
- XmlWriter::ScopedElement e = xml.scopedElement( "testcase" );
- if( className.empty() ) {
- xml.writeAttribute( "classname", name );
- xml.writeAttribute( "name", "root" );
- }
- else {
- xml.writeAttribute( "classname", className );
- xml.writeAttribute( "name", name );
- }
- xml.writeAttribute( "time", ::Catch::Detail::stringify( sectionNode.stats.durationInSeconds ) );
- // This is not ideal, but it should be enough to mimic gtest's
- // junit output.
- // Ideally the JUnit reporter would also handle `skipTest`
- // events and write those out appropriately.
- xml.writeAttribute( "status", "run" );
-
- writeAssertions( sectionNode );
-
- if( !sectionNode.stdOut.empty() )
- xml.scopedElement( "system-out" ).writeText( trim( sectionNode.stdOut ), XmlFormatting::Newline );
- if( !sectionNode.stdErr.empty() )
- xml.scopedElement( "system-err" ).writeText( trim( sectionNode.stdErr ), XmlFormatting::Newline );
- }
- for( auto const& childNode : sectionNode.childSections )
- if( className.empty() )
- writeSection( name, "", *childNode );
- else
- writeSection( className, name, *childNode );
- }
-
- void JunitReporter::writeAssertions( SectionNode const& sectionNode ) {
- for( auto const& assertion : sectionNode.assertions )
- writeAssertion( assertion );
- }
-
- void JunitReporter::writeAssertion( AssertionStats const& stats ) {
- AssertionResult const& result = stats.assertionResult;
- if( !result.isOk() ) {
- std::string elementName;
- switch( result.getResultType() ) {
- case ResultWas::ThrewException:
- case ResultWas::FatalErrorCondition:
- elementName = "error";
- break;
- case ResultWas::ExplicitFailure:
- case ResultWas::ExpressionFailed:
- case ResultWas::DidntThrowException:
- elementName = "failure";
- break;
-
- // We should never see these here:
- case ResultWas::Info:
- case ResultWas::Warning:
- case ResultWas::Ok:
- case ResultWas::Unknown:
- case ResultWas::FailureBit:
- case ResultWas::Exception:
- elementName = "internalError";
- break;
- }
-
- XmlWriter::ScopedElement e = xml.scopedElement( elementName );
-
- xml.writeAttribute( "message", result.getExpression() );
- xml.writeAttribute( "type", result.getTestMacroName() );
-
- ReusableStringStream rss;
- if (stats.totals.assertions.total() > 0) {
- rss << "FAILED" << ":\n";
- if (result.hasExpression()) {
- rss << " ";
- rss << result.getExpressionInMacro();
- rss << '\n';
- }
- if (result.hasExpandedExpression()) {
- rss << "with expansion:\n";
- rss << Column(result.getExpandedExpression()).indent(2) << '\n';
- }
- } else {
- rss << '\n';
- }
-
- if( !result.getMessage().empty() )
- rss << result.getMessage() << '\n';
- for( auto const& msg : stats.infoMessages )
- if( msg.type == ResultWas::Info )
- rss << msg.message << '\n';
-
- rss << "at " << result.getSourceInfo();
- xml.writeText( rss.str(), XmlFormatting::Newline );
- }
- }
-
- CATCH_REGISTER_REPORTER( "junit", JunitReporter )
-
-} // end namespace Catch
-// end catch_reporter_junit.cpp
-// start catch_reporter_listening.cpp
-
-#include <cassert>
-
-namespace Catch {
-
- ListeningReporter::ListeningReporter() {
- // We will assume that listeners will always want all assertions
- m_preferences.shouldReportAllAssertions = true;
- }
-
- void ListeningReporter::addListener( IStreamingReporterPtr&& listener ) {
- m_listeners.push_back( std::move( listener ) );
- }
-
- void ListeningReporter::addReporter(IStreamingReporterPtr&& reporter) {
- assert(!m_reporter && "Listening reporter can wrap only 1 real reporter");
- m_reporter = std::move( reporter );
- m_preferences.shouldRedirectStdOut = m_reporter->getPreferences().shouldRedirectStdOut;
- }
-
- ReporterPreferences ListeningReporter::getPreferences() const {
- return m_preferences;
- }
-
- std::set<Verbosity> ListeningReporter::getSupportedVerbosities() {
- return std::set<Verbosity>{ };
- }
-
- void ListeningReporter::noMatchingTestCases( std::string const& spec ) {
- for ( auto const& listener : m_listeners ) {
- listener->noMatchingTestCases( spec );
- }
- m_reporter->noMatchingTestCases( spec );
- }
-
- void ListeningReporter::reportInvalidArguments(std::string const&arg){
- for ( auto const& listener : m_listeners ) {
- listener->reportInvalidArguments( arg );
- }
- m_reporter->reportInvalidArguments( arg );
- }
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void ListeningReporter::benchmarkPreparing( std::string const& name ) {
- for (auto const& listener : m_listeners) {
- listener->benchmarkPreparing(name);
- }
- m_reporter->benchmarkPreparing(name);
- }
- void ListeningReporter::benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->benchmarkStarting( benchmarkInfo );
- }
- m_reporter->benchmarkStarting( benchmarkInfo );
- }
- void ListeningReporter::benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->benchmarkEnded( benchmarkStats );
- }
- m_reporter->benchmarkEnded( benchmarkStats );
- }
-
- void ListeningReporter::benchmarkFailed( std::string const& error ) {
- for (auto const& listener : m_listeners) {
- listener->benchmarkFailed(error);
- }
- m_reporter->benchmarkFailed(error);
- }
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- void ListeningReporter::testRunStarting( TestRunInfo const& testRunInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->testRunStarting( testRunInfo );
- }
- m_reporter->testRunStarting( testRunInfo );
- }
-
- void ListeningReporter::testGroupStarting( GroupInfo const& groupInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->testGroupStarting( groupInfo );
- }
- m_reporter->testGroupStarting( groupInfo );
- }
-
- void ListeningReporter::testCaseStarting( TestCaseInfo const& testInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->testCaseStarting( testInfo );
- }
- m_reporter->testCaseStarting( testInfo );
- }
-
- void ListeningReporter::sectionStarting( SectionInfo const& sectionInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->sectionStarting( sectionInfo );
- }
- m_reporter->sectionStarting( sectionInfo );
- }
-
- void ListeningReporter::assertionStarting( AssertionInfo const& assertionInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->assertionStarting( assertionInfo );
- }
- m_reporter->assertionStarting( assertionInfo );
- }
-
- // The return value indicates if the messages buffer should be cleared:
- bool ListeningReporter::assertionEnded( AssertionStats const& assertionStats ) {
- for( auto const& listener : m_listeners ) {
- static_cast<void>( listener->assertionEnded( assertionStats ) );
- }
- return m_reporter->assertionEnded( assertionStats );
- }
-
- void ListeningReporter::sectionEnded( SectionStats const& sectionStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->sectionEnded( sectionStats );
- }
- m_reporter->sectionEnded( sectionStats );
- }
-
- void ListeningReporter::testCaseEnded( TestCaseStats const& testCaseStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->testCaseEnded( testCaseStats );
- }
- m_reporter->testCaseEnded( testCaseStats );
- }
-
- void ListeningReporter::testGroupEnded( TestGroupStats const& testGroupStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->testGroupEnded( testGroupStats );
- }
- m_reporter->testGroupEnded( testGroupStats );
- }
-
- void ListeningReporter::testRunEnded( TestRunStats const& testRunStats ) {
- for ( auto const& listener : m_listeners ) {
- listener->testRunEnded( testRunStats );
- }
- m_reporter->testRunEnded( testRunStats );
- }
-
- void ListeningReporter::skipTest( TestCaseInfo const& testInfo ) {
- for ( auto const& listener : m_listeners ) {
- listener->skipTest( testInfo );
- }
- m_reporter->skipTest( testInfo );
- }
-
- bool ListeningReporter::isMulti() const {
- return true;
- }
-
-} // end namespace Catch
-// end catch_reporter_listening.cpp
-// start catch_reporter_xml.cpp
-
-#if defined(_MSC_VER)
-#pragma warning(push)
-#pragma warning(disable:4061) // Not all labels are EXPLICITLY handled in switch
- // Note that 4062 (not all labels are handled
- // and default is missing) is enabled
-#endif
-
-namespace Catch {
- XmlReporter::XmlReporter( ReporterConfig const& _config )
- : StreamingReporterBase( _config ),
- m_xml(_config.stream())
- {
- m_reporterPrefs.shouldRedirectStdOut = true;
- m_reporterPrefs.shouldReportAllAssertions = true;
- }
-
- XmlReporter::~XmlReporter() = default;
-
- std::string XmlReporter::getDescription() {
- return "Reports test results as an XML document";
- }
-
- std::string XmlReporter::getStylesheetRef() const {
- return std::string();
- }
-
- void XmlReporter::writeSourceInfo( SourceLineInfo const& sourceInfo ) {
- m_xml
- .writeAttribute( "filename", sourceInfo.file )
- .writeAttribute( "line", sourceInfo.line );
- }
-
- void XmlReporter::noMatchingTestCases( std::string const& s ) {
- StreamingReporterBase::noMatchingTestCases( s );
- }
-
- void XmlReporter::testRunStarting( TestRunInfo const& testInfo ) {
- StreamingReporterBase::testRunStarting( testInfo );
- std::string stylesheetRef = getStylesheetRef();
- if( !stylesheetRef.empty() )
- m_xml.writeStylesheetRef( stylesheetRef );
- m_xml.startElement( "Catch" );
- if( !m_config->name().empty() )
- m_xml.writeAttribute( "name", m_config->name() );
- if (m_config->testSpec().hasFilters())
- m_xml.writeAttribute( "filters", serializeFilters( m_config->getTestsOrTags() ) );
- if( m_config->rngSeed() != 0 )
- m_xml.scopedElement( "Randomness" )
- .writeAttribute( "seed", m_config->rngSeed() );
- }
-
- void XmlReporter::testGroupStarting( GroupInfo const& groupInfo ) {
- StreamingReporterBase::testGroupStarting( groupInfo );
- m_xml.startElement( "Group" )
- .writeAttribute( "name", groupInfo.name );
- }
-
- void XmlReporter::testCaseStarting( TestCaseInfo const& testInfo ) {
- StreamingReporterBase::testCaseStarting(testInfo);
- m_xml.startElement( "TestCase" )
- .writeAttribute( "name", trim( testInfo.name ) )
- .writeAttribute( "description", testInfo.description )
- .writeAttribute( "tags", testInfo.tagsAsString() );
-
- writeSourceInfo( testInfo.lineInfo );
-
- if ( m_config->showDurations() == ShowDurations::Always )
- m_testCaseTimer.start();
- m_xml.ensureTagClosed();
- }
-
- void XmlReporter::sectionStarting( SectionInfo const& sectionInfo ) {
- StreamingReporterBase::sectionStarting( sectionInfo );
- if( m_sectionDepth++ > 0 ) {
- m_xml.startElement( "Section" )
- .writeAttribute( "name", trim( sectionInfo.name ) );
- writeSourceInfo( sectionInfo.lineInfo );
- m_xml.ensureTagClosed();
- }
- }
-
- void XmlReporter::assertionStarting( AssertionInfo const& ) { }
-
- bool XmlReporter::assertionEnded( AssertionStats const& assertionStats ) {
-
- AssertionResult const& result = assertionStats.assertionResult;
-
- bool includeResults = m_config->includeSuccessfulResults() || !result.isOk();
-
- if( includeResults || result.getResultType() == ResultWas::Warning ) {
- // Print any info messages in <Info> tags.
- for( auto const& msg : assertionStats.infoMessages ) {
- if( msg.type == ResultWas::Info && includeResults ) {
- m_xml.scopedElement( "Info" )
- .writeText( msg.message );
- } else if ( msg.type == ResultWas::Warning ) {
- m_xml.scopedElement( "Warning" )
- .writeText( msg.message );
- }
- }
- }
-
- // Drop out if result was successful but we're not printing them.
- if( !includeResults && result.getResultType() != ResultWas::Warning )
- return true;
-
- // Print the expression if there is one.
- if( result.hasExpression() ) {
- m_xml.startElement( "Expression" )
- .writeAttribute( "success", result.succeeded() )
- .writeAttribute( "type", result.getTestMacroName() );
-
- writeSourceInfo( result.getSourceInfo() );
-
- m_xml.scopedElement( "Original" )
- .writeText( result.getExpression() );
- m_xml.scopedElement( "Expanded" )
- .writeText( result.getExpandedExpression() );
- }
-
- // And... Print a result applicable to each result type.
- switch( result.getResultType() ) {
- case ResultWas::ThrewException:
- m_xml.startElement( "Exception" );
- writeSourceInfo( result.getSourceInfo() );
- m_xml.writeText( result.getMessage() );
- m_xml.endElement();
- break;
- case ResultWas::FatalErrorCondition:
- m_xml.startElement( "FatalErrorCondition" );
- writeSourceInfo( result.getSourceInfo() );
- m_xml.writeText( result.getMessage() );
- m_xml.endElement();
- break;
- case ResultWas::Info:
- m_xml.scopedElement( "Info" )
- .writeText( result.getMessage() );
- break;
- case ResultWas::Warning:
- // Warning will already have been written
- break;
- case ResultWas::ExplicitFailure:
- m_xml.startElement( "Failure" );
- writeSourceInfo( result.getSourceInfo() );
- m_xml.writeText( result.getMessage() );
- m_xml.endElement();
- break;
- default:
- break;
- }
-
- if( result.hasExpression() )
- m_xml.endElement();
-
- return true;
- }
-
- void XmlReporter::sectionEnded( SectionStats const& sectionStats ) {
- StreamingReporterBase::sectionEnded( sectionStats );
- if( --m_sectionDepth > 0 ) {
- XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResults" );
- e.writeAttribute( "successes", sectionStats.assertions.passed );
- e.writeAttribute( "failures", sectionStats.assertions.failed );
- e.writeAttribute( "expectedFailures", sectionStats.assertions.failedButOk );
-
- if ( m_config->showDurations() == ShowDurations::Always )
- e.writeAttribute( "durationInSeconds", sectionStats.durationInSeconds );
-
- m_xml.endElement();
- }
- }
-
- void XmlReporter::testCaseEnded( TestCaseStats const& testCaseStats ) {
- StreamingReporterBase::testCaseEnded( testCaseStats );
- XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResult" );
- e.writeAttribute( "success", testCaseStats.totals.assertions.allOk() );
-
- if ( m_config->showDurations() == ShowDurations::Always )
- e.writeAttribute( "durationInSeconds", m_testCaseTimer.getElapsedSeconds() );
-
- if( !testCaseStats.stdOut.empty() )
- m_xml.scopedElement( "StdOut" ).writeText( trim( testCaseStats.stdOut ), XmlFormatting::Newline );
- if( !testCaseStats.stdErr.empty() )
- m_xml.scopedElement( "StdErr" ).writeText( trim( testCaseStats.stdErr ), XmlFormatting::Newline );
-
- m_xml.endElement();
- }
-
- void XmlReporter::testGroupEnded( TestGroupStats const& testGroupStats ) {
- StreamingReporterBase::testGroupEnded( testGroupStats );
- // TODO: Check testGroupStats.aborting and act accordingly.
- m_xml.scopedElement( "OverallResults" )
- .writeAttribute( "successes", testGroupStats.totals.assertions.passed )
- .writeAttribute( "failures", testGroupStats.totals.assertions.failed )
- .writeAttribute( "expectedFailures", testGroupStats.totals.assertions.failedButOk );
- m_xml.scopedElement( "OverallResultsCases")
- .writeAttribute( "successes", testGroupStats.totals.testCases.passed )
- .writeAttribute( "failures", testGroupStats.totals.testCases.failed )
- .writeAttribute( "expectedFailures", testGroupStats.totals.testCases.failedButOk );
- m_xml.endElement();
- }
-
- void XmlReporter::testRunEnded( TestRunStats const& testRunStats ) {
- StreamingReporterBase::testRunEnded( testRunStats );
- m_xml.scopedElement( "OverallResults" )
- .writeAttribute( "successes", testRunStats.totals.assertions.passed )
- .writeAttribute( "failures", testRunStats.totals.assertions.failed )
- .writeAttribute( "expectedFailures", testRunStats.totals.assertions.failedButOk );
- m_xml.scopedElement( "OverallResultsCases")
- .writeAttribute( "successes", testRunStats.totals.testCases.passed )
- .writeAttribute( "failures", testRunStats.totals.testCases.failed )
- .writeAttribute( "expectedFailures", testRunStats.totals.testCases.failedButOk );
- m_xml.endElement();
- }
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
- void XmlReporter::benchmarkPreparing(std::string const& name) {
- m_xml.startElement("BenchmarkResults")
- .writeAttribute("name", name);
- }
-
- void XmlReporter::benchmarkStarting(BenchmarkInfo const &info) {
- m_xml.writeAttribute("samples", info.samples)
- .writeAttribute("resamples", info.resamples)
- .writeAttribute("iterations", info.iterations)
- .writeAttribute("clockResolution", info.clockResolution)
- .writeAttribute("estimatedDuration", info.estimatedDuration)
- .writeComment("All values in nano seconds");
- }
-
- void XmlReporter::benchmarkEnded(BenchmarkStats<> const& benchmarkStats) {
- m_xml.startElement("mean")
- .writeAttribute("value", benchmarkStats.mean.point.count())
- .writeAttribute("lowerBound", benchmarkStats.mean.lower_bound.count())
- .writeAttribute("upperBound", benchmarkStats.mean.upper_bound.count())
- .writeAttribute("ci", benchmarkStats.mean.confidence_interval);
- m_xml.endElement();
- m_xml.startElement("standardDeviation")
- .writeAttribute("value", benchmarkStats.standardDeviation.point.count())
- .writeAttribute("lowerBound", benchmarkStats.standardDeviation.lower_bound.count())
- .writeAttribute("upperBound", benchmarkStats.standardDeviation.upper_bound.count())
- .writeAttribute("ci", benchmarkStats.standardDeviation.confidence_interval);
- m_xml.endElement();
- m_xml.startElement("outliers")
- .writeAttribute("variance", benchmarkStats.outlierVariance)
- .writeAttribute("lowMild", benchmarkStats.outliers.low_mild)
- .writeAttribute("lowSevere", benchmarkStats.outliers.low_severe)
- .writeAttribute("highMild", benchmarkStats.outliers.high_mild)
- .writeAttribute("highSevere", benchmarkStats.outliers.high_severe);
- m_xml.endElement();
- m_xml.endElement();
- }
-
- void XmlReporter::benchmarkFailed(std::string const &error) {
- m_xml.scopedElement("failed").
- writeAttribute("message", error);
- m_xml.endElement();
- }
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
- CATCH_REGISTER_REPORTER( "xml", XmlReporter )
-
-} // end namespace Catch
-
-#if defined(_MSC_VER)
-#pragma warning(pop)
-#endif
-// end catch_reporter_xml.cpp
-
-namespace Catch {
- LeakDetector leakDetector;
-}
-
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
-
-// end catch_impl.hpp
-#endif
-
-#ifdef CATCH_CONFIG_MAIN
-// start catch_default_main.hpp
-
-#ifndef __OBJC__
-
-#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
-// Standard C/C++ Win32 Unicode wmain entry point
-extern "C" int wmain (int argc, wchar_t * argv[], wchar_t * []) {
-#else
-// Standard C/C++ main entry point
-int main (int argc, char * argv[]) {
-#endif
-
- return Catch::Session().run( argc, argv );
-}
-
-#else // __OBJC__
-
-// Objective-C entry point
-int main (int argc, char * const argv[]) {
-#if !CATCH_ARC_ENABLED
- NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
-#endif
-
- Catch::registerTestMethods();
- int result = Catch::Session().run( argc, (char**)argv );
-
-#if !CATCH_ARC_ENABLED
- [pool drain];
-#endif
-
- return result;
-}
-
-#endif // __OBJC__
-
-// end catch_default_main.hpp
-#endif
-
-#if !defined(CATCH_CONFIG_IMPL_ONLY)
-
-#ifdef CLARA_CONFIG_MAIN_NOT_DEFINED
-# undef CLARA_CONFIG_MAIN
-#endif
-
-#if !defined(CATCH_CONFIG_DISABLE)
-//////
-// If this config identifier is defined then all CATCH macros are prefixed with CATCH_
-#ifdef CATCH_CONFIG_PREFIX_ALL
-
-#define CATCH_REQUIRE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define CATCH_REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
-
-#define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr )
-#define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CATCH_REQUIRE_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::Normal, matcher, expr )
-#endif// CATCH_CONFIG_DISABLE_MATCHERS
-#define CATCH_REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CATCH_REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-
-#define CATCH_CHECK( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
-#define CATCH_CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CATCH_CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
-
-#define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CATCH_CHECK_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define CATCH_CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CATCH_CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
-
-#define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-#define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg )
-#define CATCH_UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "CATCH_UNSCOPED_INFO", msg )
-#define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( "CATCH_WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
-#define CATCH_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_CAPTURE",__VA_ARGS__ )
-
-#define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
-#define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
-#define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
-#define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
-#define CATCH_DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ )
-#define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define CATCH_FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( "CATCH_SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-
-#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
-#else
-#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
-#endif
-
-#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
-#define CATCH_STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__ , #__VA_ARGS__ ); CATCH_SUCCEED( #__VA_ARGS__ )
-#define CATCH_STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); CATCH_SUCCEED( #__VA_ARGS__ )
-#else
-#define CATCH_STATIC_REQUIRE( ... ) CATCH_REQUIRE( __VA_ARGS__ )
-#define CATCH_STATIC_REQUIRE_FALSE( ... ) CATCH_REQUIRE_FALSE( __VA_ARGS__ )
-#endif
-
-// "BDD-style" convenience wrappers
-#define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ )
-#define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
-#define CATCH_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Given: " << desc )
-#define CATCH_AND_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( "And given: " << desc )
-#define CATCH_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " When: " << desc )
-#define CATCH_AND_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And when: " << desc )
-#define CATCH_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Then: " << desc )
-#define CATCH_AND_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And: " << desc )
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-#define CATCH_BENCHMARK(...) \
- INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,))
-#define CATCH_BENCHMARK_ADVANCED(name) \
- INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), name)
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
-// If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required
-#else
-
-#define REQUIRE( ... ) INTERNAL_CATCH_TEST( "REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
-
-#define REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr )
-#define REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "REQUIRE_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::Normal, matcher, expr )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, __VA_ARGS__ )
-
-#define CHECK( ... ) INTERNAL_CATCH_TEST( "CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
-#define CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
-
-#define CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr )
-#define CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CHECK_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
-
-#define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-#define INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg )
-#define UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "UNSCOPED_INFO", msg )
-#define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
-#define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE",__VA_ARGS__ )
-
-#define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
-#define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
-#define REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
-#define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
-#define DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ )
-#define FAIL( ... ) INTERNAL_CATCH_MSG( "FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
-#define FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define SUCCEED( ... ) INTERNAL_CATCH_MSG( "SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
-#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE()
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ )
-#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
-#define TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(__VA_ARGS__)
-#define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#else
-#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) )
-#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ ) )
-#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
-#define TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE( __VA_ARGS__ ) )
-#define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
-#endif
-
-#if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
-#define STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__, #__VA_ARGS__ ); SUCCEED( #__VA_ARGS__ )
-#define STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); SUCCEED( "!(" #__VA_ARGS__ ")" )
-#else
-#define STATIC_REQUIRE( ... ) REQUIRE( __VA_ARGS__ )
-#define STATIC_REQUIRE_FALSE( ... ) REQUIRE_FALSE( __VA_ARGS__ )
-#endif
-
-#endif
-
-#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
-
-// "BDD-style" convenience wrappers
-#define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ )
-#define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
-
-#define GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Given: " << desc )
-#define AND_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( "And given: " << desc )
-#define WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " When: " << desc )
-#define AND_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And when: " << desc )
-#define THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Then: " << desc )
-#define AND_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And: " << desc )
-
-#if defined(CATCH_CONFIG_ENABLE_BENCHMARKING)
-#define BENCHMARK(...) \
- INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,))
-#define BENCHMARK_ADVANCED(name) \
- INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(____C_A_T_C_H____B_E_N_C_H____), name)
-#endif // CATCH_CONFIG_ENABLE_BENCHMARKING
-
-using Catch::Detail::Approx;
-
-#else // CATCH_CONFIG_DISABLE
-
-//////
-// If this config identifier is defined then all CATCH macros are prefixed with CATCH_
-#ifdef CATCH_CONFIG_PREFIX_ALL
-
-#define CATCH_REQUIRE( ... ) (void)(0)
-#define CATCH_REQUIRE_FALSE( ... ) (void)(0)
-
-#define CATCH_REQUIRE_THROWS( ... ) (void)(0)
-#define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) (void)(0)
-#define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) (void)(0)
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
-#endif// CATCH_CONFIG_DISABLE_MATCHERS
-#define CATCH_REQUIRE_NOTHROW( ... ) (void)(0)
-
-#define CATCH_CHECK( ... ) (void)(0)
-#define CATCH_CHECK_FALSE( ... ) (void)(0)
-#define CATCH_CHECKED_IF( ... ) if (__VA_ARGS__)
-#define CATCH_CHECKED_ELSE( ... ) if (!(__VA_ARGS__))
-#define CATCH_CHECK_NOFAIL( ... ) (void)(0)
-
-#define CATCH_CHECK_THROWS( ... ) (void)(0)
-#define CATCH_CHECK_THROWS_AS( expr, exceptionType ) (void)(0)
-#define CATCH_CHECK_THROWS_WITH( expr, matcher ) (void)(0)
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define CATCH_CHECK_NOTHROW( ... ) (void)(0)
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CATCH_CHECK_THAT( arg, matcher ) (void)(0)
-
-#define CATCH_REQUIRE_THAT( arg, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-#define CATCH_INFO( msg ) (void)(0)
-#define CATCH_UNSCOPED_INFO( msg ) (void)(0)
-#define CATCH_WARN( msg ) (void)(0)
-#define CATCH_CAPTURE( msg ) (void)(0)
-
-#define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define CATCH_METHOD_AS_TEST_CASE( method, ... )
-#define CATCH_REGISTER_TEST_CASE( Function, ... ) (void)(0)
-#define CATCH_SECTION( ... )
-#define CATCH_DYNAMIC_SECTION( ... )
-#define CATCH_FAIL( ... ) (void)(0)
-#define CATCH_FAIL_CHECK( ... ) (void)(0)
-#define CATCH_SUCCEED( ... ) (void)(0)
-
-#define CATCH_ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__)
-#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__)
-#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__)
-#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#else
-#define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__) )
-#define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__) )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ ) )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#endif
-
-// "BDD-style" convenience wrappers
-#define CATCH_SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), className )
-#define CATCH_GIVEN( desc )
-#define CATCH_AND_GIVEN( desc )
-#define CATCH_WHEN( desc )
-#define CATCH_AND_WHEN( desc )
-#define CATCH_THEN( desc )
-#define CATCH_AND_THEN( desc )
-
-#define CATCH_STATIC_REQUIRE( ... ) (void)(0)
-#define CATCH_STATIC_REQUIRE_FALSE( ... ) (void)(0)
-
-// If CATCH_CONFIG_PREFIX_ALL is not defined then the CATCH_ prefix is not required
-#else
-
-#define REQUIRE( ... ) (void)(0)
-#define REQUIRE_FALSE( ... ) (void)(0)
-
-#define REQUIRE_THROWS( ... ) (void)(0)
-#define REQUIRE_THROWS_AS( expr, exceptionType ) (void)(0)
-#define REQUIRE_THROWS_WITH( expr, matcher ) (void)(0)
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define REQUIRE_NOTHROW( ... ) (void)(0)
-
-#define CHECK( ... ) (void)(0)
-#define CHECK_FALSE( ... ) (void)(0)
-#define CHECKED_IF( ... ) if (__VA_ARGS__)
-#define CHECKED_ELSE( ... ) if (!(__VA_ARGS__))
-#define CHECK_NOFAIL( ... ) (void)(0)
-
-#define CHECK_THROWS( ... ) (void)(0)
-#define CHECK_THROWS_AS( expr, exceptionType ) (void)(0)
-#define CHECK_THROWS_WITH( expr, matcher ) (void)(0)
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-#define CHECK_NOTHROW( ... ) (void)(0)
-
-#if !defined(CATCH_CONFIG_DISABLE_MATCHERS)
-#define CHECK_THAT( arg, matcher ) (void)(0)
-
-#define REQUIRE_THAT( arg, matcher ) (void)(0)
-#endif // CATCH_CONFIG_DISABLE_MATCHERS
-
-#define INFO( msg ) (void)(0)
-#define UNSCOPED_INFO( msg ) (void)(0)
-#define WARN( msg ) (void)(0)
-#define CAPTURE( msg ) (void)(0)
-
-#define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-#define METHOD_AS_TEST_CASE( method, ... )
-#define REGISTER_TEST_CASE( Function, ... ) (void)(0)
-#define SECTION( ... )
-#define DYNAMIC_SECTION( ... )
-#define FAIL( ... ) (void)(0)
-#define FAIL_CHECK( ... ) (void)(0)
-#define SUCCEED( ... ) (void)(0)
-#define ANON_TEST_CASE() INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ))
-
-#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
-#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__)
-#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__)
-#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__)
-#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#else
-#define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__) )
-#define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__) )
-#define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__ ) )
-#define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ ) )
-#define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
-#endif
-
-#define STATIC_REQUIRE( ... ) (void)(0)
-#define STATIC_REQUIRE_FALSE( ... ) (void)(0)
-
-#endif
-
-#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
-
-// "BDD-style" convenience wrappers
-#define SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ) )
-#define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( ____C_A_T_C_H____T_E_S_T____ ), className )
-
-#define GIVEN( desc )
-#define AND_GIVEN( desc )
-#define WHEN( desc )
-#define AND_WHEN( desc )
-#define THEN( desc )
-#define AND_THEN( desc )
-
-using Catch::Detail::Approx;
-
-#endif
-
-#endif // ! CATCH_CONFIG_IMPL_ONLY
-
-// start catch_reenable_warnings.h
-
-
-#ifdef __clang__
-# ifdef __ICC // icpc defines the __clang__ macro
-# pragma warning(pop)
-# else
-# pragma clang diagnostic pop
-# endif
-#elif defined __GNUC__
-# pragma GCC diagnostic pop
-#endif
-
-// end catch_reenable_warnings.h
-// end catch.hpp
-#endif // TWOBLUECUBES_SINGLE_INCLUDE_CATCH_HPP_INCLUDED
-
diff --git a/3rdparty/bx/3rdparty/catch/catch_amalgamated.cpp b/3rdparty/bx/3rdparty/catch/catch_amalgamated.cpp
new file mode 100644
index 00000000000..ecda2301b3a
--- /dev/null
+++ b/3rdparty/bx/3rdparty/catch/catch_amalgamated.cpp
@@ -0,0 +1,10360 @@
+// Copyright Catch2 Authors
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// https://www.boost.org/LICENSE_1_0.txt)
+
+// SPDX-License-Identifier: BSL-1.0
+
+// Catch v3.1.0
+// Generated: 2022-07-17 20:14:05.885021
+// ----------------------------------------------------------
+// This file is an amalgamation of multiple different files.
+// You probably shouldn't edit it directly.
+// ----------------------------------------------------------
+
+#include "catch_amalgamated.hpp"
+
+
+
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+ ChronometerConcept::~ChronometerConcept() = default;
+ } // namespace Detail
+ } // namespace Benchmark
+} // namespace Catch
+
+
+
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+ BenchmarkFunction::callable::~callable() = default;
+ } // namespace Detail
+ } // namespace Benchmark
+} // namespace Catch
+
+
+
+#include <exception>
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+ struct optimized_away_error : std::exception {
+ const char* what() const noexcept override;
+ };
+
+ const char* optimized_away_error::what() const noexcept {
+ return "could not measure benchmark, maybe it was optimized away";
+ }
+
+ void throw_optimized_away_error() {
+ Catch::throw_exception(optimized_away_error{});
+ }
+
+ } // namespace Detail
+ } // namespace Benchmark
+} // namespace Catch
+
+
+// Adapted from donated nonius code.
+
+
+
+#include <cassert>
+#include <cstddef>
+#include <iterator>
+#include <random>
+
+
+#if defined(CATCH_CONFIG_USE_ASYNC)
+#include <future>
+#endif
+
+namespace {
+
+using Catch::Benchmark::Detail::sample;
+
+ template <typename URng, typename Estimator>
+ sample resample(URng& rng, unsigned int resamples, std::vector<double>::iterator first, std::vector<double>::iterator last, Estimator& estimator) {
+ auto n = static_cast<size_t>(last - first);
+ std::uniform_int_distribution<decltype(n)> dist(0, n - 1);
+
+ sample out;
+ out.reserve(resamples);
+ std::generate_n(std::back_inserter(out), resamples, [n, first, &estimator, &dist, &rng] {
+ std::vector<double> resampled;
+ resampled.reserve(n);
+ std::generate_n(std::back_inserter(resampled), n, [first, &dist, &rng] { return first[static_cast<std::ptrdiff_t>(dist(rng))]; });
+ return estimator(resampled.begin(), resampled.end());
+ });
+ std::sort(out.begin(), out.end());
+ return out;
+ }
+
+
+ double erf_inv(double x) {
+ // Code accompanying the article "Approximating the erfinv function" in GPU Computing Gems, Volume 2
+ double w, p;
+
+ w = -log((1.0 - x) * (1.0 + x));
+
+ if (w < 6.250000) {
+ w = w - 3.125000;
+ p = -3.6444120640178196996e-21;
+ p = -1.685059138182016589e-19 + p * w;
+ p = 1.2858480715256400167e-18 + p * w;
+ p = 1.115787767802518096e-17 + p * w;
+ p = -1.333171662854620906e-16 + p * w;
+ p = 2.0972767875968561637e-17 + p * w;
+ p = 6.6376381343583238325e-15 + p * w;
+ p = -4.0545662729752068639e-14 + p * w;
+ p = -8.1519341976054721522e-14 + p * w;
+ p = 2.6335093153082322977e-12 + p * w;
+ p = -1.2975133253453532498e-11 + p * w;
+ p = -5.4154120542946279317e-11 + p * w;
+ p = 1.051212273321532285e-09 + p * w;
+ p = -4.1126339803469836976e-09 + p * w;
+ p = -2.9070369957882005086e-08 + p * w;
+ p = 4.2347877827932403518e-07 + p * w;
+ p = -1.3654692000834678645e-06 + p * w;
+ p = -1.3882523362786468719e-05 + p * w;
+ p = 0.0001867342080340571352 + p * w;
+ p = -0.00074070253416626697512 + p * w;
+ p = -0.0060336708714301490533 + p * w;
+ p = 0.24015818242558961693 + p * w;
+ p = 1.6536545626831027356 + p * w;
+ } else if (w < 16.000000) {
+ w = sqrt(w) - 3.250000;
+ p = 2.2137376921775787049e-09;
+ p = 9.0756561938885390979e-08 + p * w;
+ p = -2.7517406297064545428e-07 + p * w;
+ p = 1.8239629214389227755e-08 + p * w;
+ p = 1.5027403968909827627e-06 + p * w;
+ p = -4.013867526981545969e-06 + p * w;
+ p = 2.9234449089955446044e-06 + p * w;
+ p = 1.2475304481671778723e-05 + p * w;
+ p = -4.7318229009055733981e-05 + p * w;
+ p = 6.8284851459573175448e-05 + p * w;
+ p = 2.4031110387097893999e-05 + p * w;
+ p = -0.0003550375203628474796 + p * w;
+ p = 0.00095328937973738049703 + p * w;
+ p = -0.0016882755560235047313 + p * w;
+ p = 0.0024914420961078508066 + p * w;
+ p = -0.0037512085075692412107 + p * w;
+ p = 0.005370914553590063617 + p * w;
+ p = 1.0052589676941592334 + p * w;
+ p = 3.0838856104922207635 + p * w;
+ } else {
+ w = sqrt(w) - 5.000000;
+ p = -2.7109920616438573243e-11;
+ p = -2.5556418169965252055e-10 + p * w;
+ p = 1.5076572693500548083e-09 + p * w;
+ p = -3.7894654401267369937e-09 + p * w;
+ p = 7.6157012080783393804e-09 + p * w;
+ p = -1.4960026627149240478e-08 + p * w;
+ p = 2.9147953450901080826e-08 + p * w;
+ p = -6.7711997758452339498e-08 + p * w;
+ p = 2.2900482228026654717e-07 + p * w;
+ p = -9.9298272942317002539e-07 + p * w;
+ p = 4.5260625972231537039e-06 + p * w;
+ p = -1.9681778105531670567e-05 + p * w;
+ p = 7.5995277030017761139e-05 + p * w;
+ p = -0.00021503011930044477347 + p * w;
+ p = -0.00013871931833623122026 + p * w;
+ p = 1.0103004648645343977 + p * w;
+ p = 4.8499064014085844221 + p * w;
+ }
+ return p * x;
+ }
+
+ double standard_deviation(std::vector<double>::iterator first, std::vector<double>::iterator last) {
+ auto m = Catch::Benchmark::Detail::mean(first, last);
+ double variance = std::accumulate( first,
+ last,
+ 0.,
+ [m]( double a, double b ) {
+ double diff = b - m;
+ return a + diff * diff;
+ } ) /
+ ( last - first );
+ return std::sqrt( variance );
+ }
+
+}
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+
+#if defined( __GNUC__ ) || defined( __clang__ )
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+ bool directCompare( double lhs, double rhs ) { return lhs == rhs; }
+#if defined( __GNUC__ ) || defined( __clang__ )
+# pragma GCC diagnostic pop
+#endif
+
+ double weighted_average_quantile(int k, int q, std::vector<double>::iterator first, std::vector<double>::iterator last) {
+ auto count = last - first;
+ double idx = (count - 1) * k / static_cast<double>(q);
+ int j = static_cast<int>(idx);
+ double g = idx - j;
+ std::nth_element(first, first + j, last);
+ auto xj = first[j];
+ if ( directCompare( g, 0 ) ) {
+ return xj;
+ }
+
+ auto xj1 = *std::min_element(first + (j + 1), last);
+ return xj + g * (xj1 - xj);
+ }
+
+
+ double erfc_inv(double x) {
+ return erf_inv(1.0 - x);
+ }
+
+ double normal_quantile(double p) {
+ static const double ROOT_TWO = std::sqrt(2.0);
+
+ double result = 0.0;
+ assert(p >= 0 && p <= 1);
+ if (p < 0 || p > 1) {
+ return result;
+ }
+
+ result = -erfc_inv(2.0 * p);
+ // result *= normal distribution standard deviation (1.0) * sqrt(2)
+ result *= /*sd * */ ROOT_TWO;
+ // result += normal disttribution mean (0)
+ return result;
+ }
+
+
+ double outlier_variance(Estimate<double> mean, Estimate<double> stddev, int n) {
+ double sb = stddev.point;
+ double mn = mean.point / n;
+ double mg_min = mn / 2.;
+ double sg = (std::min)(mg_min / 4., sb / std::sqrt(n));
+ double sg2 = sg * sg;
+ double sb2 = sb * sb;
+
+ auto c_max = [n, mn, sb2, sg2](double x) -> double {
+ double k = mn - x;
+ double d = k * k;
+ double nd = n * d;
+ double k0 = -n * nd;
+ double k1 = sb2 - n * sg2 + nd;
+ double det = k1 * k1 - 4 * sg2 * k0;
+ return static_cast<int>(-2. * k0 / (k1 + std::sqrt(det)));
+ };
+
+ auto var_out = [n, sb2, sg2](double c) {
+ double nc = n - c;
+ return (nc / n) * (sb2 - nc * sg2);
+ };
+
+ return (std::min)(var_out(1), var_out((std::min)(c_max(0.), c_max(mg_min)))) / sb2;
+ }
+
+
+ bootstrap_analysis analyse_samples(double confidence_level, unsigned int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last) {
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
+ static std::random_device entropy;
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
+
+ auto n = static_cast<int>(last - first); // seriously, one can't use integral types without hell in C++
+
+ auto mean = &Detail::mean<std::vector<double>::iterator>;
+ auto stddev = &standard_deviation;
+
+#if defined(CATCH_CONFIG_USE_ASYNC)
+ auto Estimate = [=](double(*f)(std::vector<double>::iterator, std::vector<double>::iterator)) {
+ auto seed = entropy();
+ return std::async(std::launch::async, [=] {
+ std::mt19937 rng(seed);
+ auto resampled = resample(rng, n_resamples, first, last, f);
+ return bootstrap(confidence_level, first, last, resampled, f);
+ });
+ };
+
+ auto mean_future = Estimate(mean);
+ auto stddev_future = Estimate(stddev);
+
+ auto mean_estimate = mean_future.get();
+ auto stddev_estimate = stddev_future.get();
+#else
+ auto Estimate = [=](double(*f)(std::vector<double>::iterator, std::vector<double>::iterator)) {
+ auto seed = entropy();
+ std::mt19937 rng(seed);
+ auto resampled = resample(rng, n_resamples, first, last, f);
+ return bootstrap(confidence_level, first, last, resampled, f);
+ };
+
+ auto mean_estimate = Estimate(mean);
+ auto stddev_estimate = Estimate(stddev);
+#endif // CATCH_USE_ASYNC
+
+ double outlier_variance = Detail::outlier_variance(mean_estimate, stddev_estimate, n);
+
+ return { mean_estimate, stddev_estimate, outlier_variance };
+ }
+ } // namespace Detail
+ } // namespace Benchmark
+} // namespace Catch
+
+
+
+#include <cmath>
+#include <limits>
+
+namespace {
+
+// Performs equivalent check of std::fabs(lhs - rhs) <= margin
+// But without the subtraction to allow for INFINITY in comparison
+bool marginComparison(double lhs, double rhs, double margin) {
+ return (lhs + margin >= rhs) && (rhs + margin >= lhs);
+}
+
+}
+
+namespace Catch {
+
+ Approx::Approx ( double value )
+ : m_epsilon( std::numeric_limits<float>::epsilon()*100. ),
+ m_margin( 0.0 ),
+ m_scale( 0.0 ),
+ m_value( value )
+ {}
+
+ Approx Approx::custom() {
+ return Approx( 0 );
+ }
+
+ Approx Approx::operator-() const {
+ auto temp(*this);
+ temp.m_value = -temp.m_value;
+ return temp;
+ }
+
+
+ std::string Approx::toString() const {
+ ReusableStringStream rss;
+ rss << "Approx( " << ::Catch::Detail::stringify( m_value ) << " )";
+ return rss.str();
+ }
+
+ bool Approx::equalityComparisonImpl(const double other) const {
+ // First try with fixed margin, then compute margin based on epsilon, scale and Approx's value
+ // Thanks to Richard Harris for his help refining the scaled margin value
+ return marginComparison(m_value, other, m_margin)
+ || marginComparison(m_value, other, m_epsilon * (m_scale + std::fabs(std::isinf(m_value)? 0 : m_value)));
+ }
+
+ void Approx::setMargin(double newMargin) {
+ CATCH_ENFORCE(newMargin >= 0,
+ "Invalid Approx::margin: " << newMargin << '.'
+ << " Approx::Margin has to be non-negative.");
+ m_margin = newMargin;
+ }
+
+ void Approx::setEpsilon(double newEpsilon) {
+ CATCH_ENFORCE(newEpsilon >= 0 && newEpsilon <= 1.0,
+ "Invalid Approx::epsilon: " << newEpsilon << '.'
+ << " Approx::epsilon has to be in [0, 1]");
+ m_epsilon = newEpsilon;
+ }
+
+namespace literals {
+ Approx operator "" _a(long double val) {
+ return Approx(val);
+ }
+ Approx operator "" _a(unsigned long long val) {
+ return Approx(val);
+ }
+} // end namespace literals
+
+std::string StringMaker<Catch::Approx>::convert(Catch::Approx const& value) {
+ return value.toString();
+}
+
+} // end namespace Catch
+
+
+
+namespace Catch {
+
+ AssertionResultData::AssertionResultData(ResultWas::OfType _resultType, LazyExpression const & _lazyExpression):
+ lazyExpression(_lazyExpression),
+ resultType(_resultType) {}
+
+ std::string AssertionResultData::reconstructExpression() const {
+
+ if( reconstructedExpression.empty() ) {
+ if( lazyExpression ) {
+ ReusableStringStream rss;
+ rss << lazyExpression;
+ reconstructedExpression = rss.str();
+ }
+ }
+ return reconstructedExpression;
+ }
+
+ AssertionResult::AssertionResult( AssertionInfo const& info, AssertionResultData const& data )
+ : m_info( info ),
+ m_resultData( data )
+ {}
+
+ // Result was a success
+ bool AssertionResult::succeeded() const {
+ return Catch::isOk( m_resultData.resultType );
+ }
+
+ // Result was a success, or failure is suppressed
+ bool AssertionResult::isOk() const {
+ return Catch::isOk( m_resultData.resultType ) || shouldSuppressFailure( m_info.resultDisposition );
+ }
+
+ ResultWas::OfType AssertionResult::getResultType() const {
+ return m_resultData.resultType;
+ }
+
+ bool AssertionResult::hasExpression() const {
+ return !m_info.capturedExpression.empty();
+ }
+
+ bool AssertionResult::hasMessage() const {
+ return !m_resultData.message.empty();
+ }
+
+ std::string AssertionResult::getExpression() const {
+ // Possibly overallocating by 3 characters should be basically free
+ std::string expr; expr.reserve(m_info.capturedExpression.size() + 3);
+ if (isFalseTest(m_info.resultDisposition)) {
+ expr += "!(";
+ }
+ expr += m_info.capturedExpression;
+ if (isFalseTest(m_info.resultDisposition)) {
+ expr += ')';
+ }
+ return expr;
+ }
+
+ std::string AssertionResult::getExpressionInMacro() const {
+ std::string expr;
+ if( m_info.macroName.empty() )
+ expr = static_cast<std::string>(m_info.capturedExpression);
+ else {
+ expr.reserve( m_info.macroName.size() + m_info.capturedExpression.size() + 4 );
+ expr += m_info.macroName;
+ expr += "( ";
+ expr += m_info.capturedExpression;
+ expr += " )";
+ }
+ return expr;
+ }
+
+ bool AssertionResult::hasExpandedExpression() const {
+ return hasExpression() && getExpandedExpression() != getExpression();
+ }
+
+ std::string AssertionResult::getExpandedExpression() const {
+ std::string expr = m_resultData.reconstructExpression();
+ return expr.empty()
+ ? getExpression()
+ : expr;
+ }
+
+ StringRef AssertionResult::getMessage() const {
+ return m_resultData.message;
+ }
+ SourceLineInfo AssertionResult::getSourceInfo() const {
+ return m_info.lineInfo;
+ }
+
+ StringRef AssertionResult::getTestMacroName() const {
+ return m_info.macroName;
+ }
+
+} // end namespace Catch
+
+
+
+namespace {
+ bool provideBazelReporterOutput() {
+#ifdef CATCH_CONFIG_BAZEL_SUPPORT
+ return true;
+#else
+
+# if defined( _MSC_VER )
+ // On Windows getenv throws a warning as there is no input validation,
+ // since the switch is hardcoded, this should not be an issue.
+# pragma warning( push )
+# pragma warning( disable : 4996 )
+# endif
+
+ return std::getenv( "BAZEL_TEST" ) != nullptr;
+
+# if defined( _MSC_VER )
+# pragma warning( pop )
+# endif
+#endif
+ }
+}
+
+namespace Catch {
+
+ bool operator==( ProcessedReporterSpec const& lhs,
+ ProcessedReporterSpec const& rhs ) {
+ return lhs.name == rhs.name &&
+ lhs.outputFilename == rhs.outputFilename &&
+ lhs.colourMode == rhs.colourMode &&
+ lhs.customOptions == rhs.customOptions;
+ }
+
+ Config::Config( ConfigData const& data ):
+ m_data( data ) {
+ // We need to trim filter specs to avoid trouble with superfluous
+ // whitespace (esp. important for bdd macros, as those are manually
+ // aligned with whitespace).
+
+ for (auto& elem : m_data.testsOrTags) {
+ elem = trim(elem);
+ }
+ for (auto& elem : m_data.sectionsToRun) {
+ elem = trim(elem);
+ }
+
+
+ TestSpecParser parser(ITagAliasRegistry::get());
+ if (!m_data.testsOrTags.empty()) {
+ m_hasTestFilters = true;
+ for (auto const& testOrTags : m_data.testsOrTags) {
+ parser.parse(testOrTags);
+ }
+ }
+ m_testSpec = parser.testSpec();
+
+
+ // Insert the default reporter if user hasn't asked for a specfic one
+ if ( m_data.reporterSpecifications.empty() ) {
+ m_data.reporterSpecifications.push_back( {
+#if defined( CATCH_CONFIG_DEFAULT_REPORTER )
+ CATCH_CONFIG_DEFAULT_REPORTER,
+#else
+ "console",
+#endif
+ {}, {}, {}
+ } );
+ }
+
+ if(provideBazelReporterOutput()){
+ // Register a JUnit reporter for Bazel. Bazel sets an environment
+ // variable with the path to XML output. If this file is written to
+ // during test, Bazel will not generate a default XML output.
+ // This allows the XML output file to contain higher level of detail
+ // than what is possible otherwise.
+# if defined( _MSC_VER )
+ // On Windows getenv throws a warning as there is no input validation,
+ // since the key is hardcoded, this should not be an issue.
+# pragma warning( push )
+# pragma warning( disable : 4996 )
+# endif
+ const auto bazelOutputFilePtr = std::getenv( "XML_OUTPUT_FILE" );
+# if defined( _MSC_VER )
+# pragma warning( pop )
+# endif
+ if ( bazelOutputFilePtr != nullptr ) {
+ m_data.reporterSpecifications.push_back(
+ { "junit", std::string( bazelOutputFilePtr ), {}, {} } );
+ }
+ }
+
+
+ // We now fixup the reporter specs to handle default output spec,
+ // default colour spec, etc
+ bool defaultOutputUsed = false;
+ for ( auto const& reporterSpec : m_data.reporterSpecifications ) {
+ // We do the default-output check separately, while always
+ // using the default output below to make the code simpler
+ // and avoid superfluous copies.
+ if ( reporterSpec.outputFile().none() ) {
+ CATCH_ENFORCE( !defaultOutputUsed,
+ "Internal error: cannot use default output for "
+ "multiple reporters" );
+ defaultOutputUsed = true;
+ }
+
+ m_processedReporterSpecs.push_back( ProcessedReporterSpec{
+ reporterSpec.name(),
+ reporterSpec.outputFile() ? *reporterSpec.outputFile()
+ : data.defaultOutputFilename,
+ reporterSpec.colourMode().valueOr( data.defaultColourMode ),
+ reporterSpec.customOptions() } );
+ }
+ }
+
+ Config::~Config() = default;
+
+
+ bool Config::listTests() const { return m_data.listTests; }
+ bool Config::listTags() const { return m_data.listTags; }
+ bool Config::listReporters() const { return m_data.listReporters; }
+ bool Config::listListeners() const { return m_data.listListeners; }
+
+ std::vector<std::string> const& Config::getTestsOrTags() const { return m_data.testsOrTags; }
+ std::vector<std::string> const& Config::getSectionsToRun() const { return m_data.sectionsToRun; }
+
+ std::vector<ReporterSpec> const& Config::getReporterSpecs() const {
+ return m_data.reporterSpecifications;
+ }
+
+ std::vector<ProcessedReporterSpec> const&
+ Config::getProcessedReporterSpecs() const {
+ return m_processedReporterSpecs;
+ }
+
+ TestSpec const& Config::testSpec() const { return m_testSpec; }
+ bool Config::hasTestFilters() const { return m_hasTestFilters; }
+
+ bool Config::showHelp() const { return m_data.showHelp; }
+
+ // IConfig interface
+ bool Config::allowThrows() const { return !m_data.noThrow; }
+ StringRef Config::name() const { return m_data.name.empty() ? m_data.processName : m_data.name; }
+ bool Config::includeSuccessfulResults() const { return m_data.showSuccessfulTests; }
+ bool Config::warnAboutMissingAssertions() const {
+ return !!( m_data.warnings & WarnAbout::NoAssertions );
+ }
+ bool Config::warnAboutUnmatchedTestSpecs() const {
+ return !!( m_data.warnings & WarnAbout::UnmatchedTestSpec );
+ }
+ bool Config::zeroTestsCountAsSuccess() const { return m_data.allowZeroTests; }
+ ShowDurations Config::showDurations() const { return m_data.showDurations; }
+ double Config::minDuration() const { return m_data.minDuration; }
+ TestRunOrder Config::runOrder() const { return m_data.runOrder; }
+ uint32_t Config::rngSeed() const { return m_data.rngSeed; }
+ unsigned int Config::shardCount() const { return m_data.shardCount; }
+ unsigned int Config::shardIndex() const { return m_data.shardIndex; }
+ ColourMode Config::defaultColourMode() const { return m_data.defaultColourMode; }
+ bool Config::shouldDebugBreak() const { return m_data.shouldDebugBreak; }
+ int Config::abortAfter() const { return m_data.abortAfter; }
+ bool Config::showInvisibles() const { return m_data.showInvisibles; }
+ Verbosity Config::verbosity() const { return m_data.verbosity; }
+
+ bool Config::skipBenchmarks() const { return m_data.skipBenchmarks; }
+ bool Config::benchmarkNoAnalysis() const { return m_data.benchmarkNoAnalysis; }
+ unsigned int Config::benchmarkSamples() const { return m_data.benchmarkSamples; }
+ double Config::benchmarkConfidenceInterval() const { return m_data.benchmarkConfidenceInterval; }
+ unsigned int Config::benchmarkResamples() const { return m_data.benchmarkResamples; }
+ std::chrono::milliseconds Config::benchmarkWarmupTime() const { return std::chrono::milliseconds(m_data.benchmarkWarmupTime); }
+
+} // end namespace Catch
+
+
+
+#include <cassert>
+#include <stack>
+
+namespace Catch {
+
+ ////////////////////////////////////////////////////////////////////////////
+
+
+ ScopedMessage::ScopedMessage( MessageBuilder const& builder ):
+ m_info( builder.m_info ) {
+ m_info.message = builder.m_stream.str();
+ getResultCapture().pushScopedMessage( m_info );
+ }
+
+ ScopedMessage::ScopedMessage( ScopedMessage&& old ) noexcept:
+ m_info( CATCH_MOVE( old.m_info ) ) {
+ old.m_moved = true;
+ }
+
+ ScopedMessage::~ScopedMessage() {
+ if ( !uncaught_exceptions() && !m_moved ){
+ getResultCapture().popScopedMessage(m_info);
+ }
+ }
+
+
+ Capturer::Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names ) {
+ auto trimmed = [&] (size_t start, size_t end) {
+ while (names[start] == ',' || isspace(static_cast<unsigned char>(names[start]))) {
+ ++start;
+ }
+ while (names[end] == ',' || isspace(static_cast<unsigned char>(names[end]))) {
+ --end;
+ }
+ return names.substr(start, end - start + 1);
+ };
+ auto skipq = [&] (size_t start, char quote) {
+ for (auto i = start + 1; i < names.size() ; ++i) {
+ if (names[i] == quote)
+ return i;
+ if (names[i] == '\\')
+ ++i;
+ }
+ CATCH_INTERNAL_ERROR("CAPTURE parsing encountered unmatched quote");
+ };
+
+ size_t start = 0;
+ std::stack<char> openings;
+ for (size_t pos = 0; pos < names.size(); ++pos) {
+ char c = names[pos];
+ switch (c) {
+ case '[':
+ case '{':
+ case '(':
+ // It is basically impossible to disambiguate between
+ // comparison and start of template args in this context
+// case '<':
+ openings.push(c);
+ break;
+ case ']':
+ case '}':
+ case ')':
+// case '>':
+ openings.pop();
+ break;
+ case '"':
+ case '\'':
+ pos = skipq(pos, c);
+ break;
+ case ',':
+ if (start != pos && openings.empty()) {
+ m_messages.emplace_back(macroName, lineInfo, resultType);
+ m_messages.back().message = static_cast<std::string>(trimmed(start, pos));
+ m_messages.back().message += " := ";
+ start = pos;
+ }
+ }
+ }
+ assert(openings.empty() && "Mismatched openings");
+ m_messages.emplace_back(macroName, lineInfo, resultType);
+ m_messages.back().message = static_cast<std::string>(trimmed(start, names.size() - 1));
+ m_messages.back().message += " := ";
+ }
+ Capturer::~Capturer() {
+ if ( !uncaught_exceptions() ){
+ assert( m_captured == m_messages.size() );
+ for( size_t i = 0; i < m_captured; ++i )
+ m_resultCapture.popScopedMessage( m_messages[i] );
+ }
+ }
+
+ void Capturer::captureValue( size_t index, std::string const& value ) {
+ assert( index < m_messages.size() );
+ m_messages[index].message += value;
+ m_resultCapture.pushScopedMessage( m_messages[index] );
+ m_captured++;
+ }
+
+} // end namespace Catch
+
+
+
+
+namespace Catch {
+
+ namespace {
+
+ class RegistryHub : public IRegistryHub,
+ public IMutableRegistryHub,
+ private Detail::NonCopyable {
+
+ public: // IRegistryHub
+ RegistryHub() = default;
+ IReporterRegistry const& getReporterRegistry() const override {
+ return m_reporterRegistry;
+ }
+ ITestCaseRegistry const& getTestCaseRegistry() const override {
+ return m_testCaseRegistry;
+ }
+ IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const override {
+ return m_exceptionTranslatorRegistry;
+ }
+ ITagAliasRegistry const& getTagAliasRegistry() const override {
+ return m_tagAliasRegistry;
+ }
+ StartupExceptionRegistry const& getStartupExceptionRegistry() const override {
+ return m_exceptionRegistry;
+ }
+
+ public: // IMutableRegistryHub
+ void registerReporter( std::string const& name, IReporterFactoryPtr factory ) override {
+ m_reporterRegistry.registerReporter( name, CATCH_MOVE(factory) );
+ }
+ void registerListener( Detail::unique_ptr<EventListenerFactory> factory ) override {
+ m_reporterRegistry.registerListener( CATCH_MOVE(factory) );
+ }
+ void registerTest( Detail::unique_ptr<TestCaseInfo>&& testInfo, Detail::unique_ptr<ITestInvoker>&& invoker ) override {
+ m_testCaseRegistry.registerTest( CATCH_MOVE(testInfo), CATCH_MOVE(invoker) );
+ }
+ void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ) override {
+ m_exceptionTranslatorRegistry.registerTranslator( CATCH_MOVE(translator) );
+ }
+ void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) override {
+ m_tagAliasRegistry.add( alias, tag, lineInfo );
+ }
+ void registerStartupException() noexcept override {
+#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+ m_exceptionRegistry.add(std::current_exception());
+#else
+ CATCH_INTERNAL_ERROR("Attempted to register active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
+#endif
+ }
+ IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() override {
+ return m_enumValuesRegistry;
+ }
+
+ private:
+ TestRegistry m_testCaseRegistry;
+ ReporterRegistry m_reporterRegistry;
+ ExceptionTranslatorRegistry m_exceptionTranslatorRegistry;
+ TagAliasRegistry m_tagAliasRegistry;
+ StartupExceptionRegistry m_exceptionRegistry;
+ Detail::EnumValuesRegistry m_enumValuesRegistry;
+ };
+ }
+
+ using RegistryHubSingleton = Singleton<RegistryHub, IRegistryHub, IMutableRegistryHub>;
+
+ IRegistryHub const& getRegistryHub() {
+ return RegistryHubSingleton::get();
+ }
+ IMutableRegistryHub& getMutableRegistryHub() {
+ return RegistryHubSingleton::getMutable();
+ }
+ void cleanUp() {
+ cleanupSingletons();
+ cleanUpContext();
+ }
+ std::string translateActiveException() {
+ return getRegistryHub().getExceptionTranslatorRegistry().translateActiveException();
+ }
+
+
+} // end namespace Catch
+
+
+
+#include <algorithm>
+#include <cassert>
+#include <iomanip>
+#include <set>
+
+namespace Catch {
+
+ namespace {
+ const int MaxExitCode = 255;
+
+ IEventListenerPtr createReporter(std::string const& reporterName, ReporterConfig&& config) {
+ auto reporter = Catch::getRegistryHub().getReporterRegistry().create(reporterName, CATCH_MOVE(config));
+ CATCH_ENFORCE(reporter, "No reporter registered with name: '" << reporterName << '\'');
+
+ return reporter;
+ }
+
+ IEventListenerPtr prepareReporters(Config const* config) {
+ if (Catch::getRegistryHub().getReporterRegistry().getListeners().empty()
+ && config->getProcessedReporterSpecs().size() == 1) {
+ auto const& spec = config->getProcessedReporterSpecs()[0];
+ return createReporter(
+ spec.name,
+ ReporterConfig( config,
+ makeStream( spec.outputFilename ),
+ spec.colourMode,
+ spec.customOptions ) );
+ }
+
+ auto multi = Detail::make_unique<MultiReporter>(config);
+
+ auto const& listeners = Catch::getRegistryHub().getReporterRegistry().getListeners();
+ for (auto const& listener : listeners) {
+ multi->addListener(listener->create(config));
+ }
+
+ std::size_t reporterIdx = 0;
+ for ( auto const& reporterSpec : config->getProcessedReporterSpecs() ) {
+ multi->addReporter( createReporter(
+ reporterSpec.name,
+ ReporterConfig( config,
+ makeStream( reporterSpec.outputFilename ),
+ reporterSpec.colourMode,
+ reporterSpec.customOptions ) ) );
+ reporterIdx++;
+ }
+
+ return multi;
+ }
+
+ class TestGroup {
+ public:
+ explicit TestGroup(IEventListenerPtr&& reporter, Config const* config):
+ m_reporter(reporter.get()),
+ m_config{config},
+ m_context{config, CATCH_MOVE(reporter)} {
+
+ assert( m_config->testSpec().getInvalidSpecs().empty() &&
+ "Invalid test specs should be handled before running tests" );
+
+ auto const& allTestCases = getAllTestCasesSorted(*m_config);
+ auto const& testSpec = m_config->testSpec();
+ if ( !testSpec.hasFilters() ) {
+ for ( auto const& test : allTestCases ) {
+ if ( !test.getTestCaseInfo().isHidden() ) {
+ m_tests.emplace( &test );
+ }
+ }
+ } else {
+ m_matches =
+ testSpec.matchesByFilter( allTestCases, *m_config );
+ for ( auto const& match : m_matches ) {
+ m_tests.insert( match.tests.begin(),
+ match.tests.end() );
+ }
+ }
+
+ m_tests = createShard(m_tests, m_config->shardCount(), m_config->shardIndex());
+ }
+
+ Totals execute() {
+ Totals totals;
+ for (auto const& testCase : m_tests) {
+ if (!m_context.aborting())
+ totals += m_context.runTest(*testCase);
+ else
+ m_reporter->skipTest(testCase->getTestCaseInfo());
+ }
+
+ for (auto const& match : m_matches) {
+ if (match.tests.empty()) {
+ m_unmatchedTestSpecs = true;
+ m_reporter->noMatchingTestCases( match.name );
+ }
+ }
+
+ return totals;
+ }
+
+ bool hadUnmatchedTestSpecs() const {
+ return m_unmatchedTestSpecs;
+ }
+
+
+ private:
+ IEventListener* m_reporter;
+ Config const* m_config;
+ RunContext m_context;
+ std::set<TestCaseHandle const*> m_tests;
+ TestSpec::Matches m_matches;
+ bool m_unmatchedTestSpecs = false;
+ };
+
+ void applyFilenamesAsTags() {
+ for (auto const& testInfo : getRegistryHub().getTestCaseRegistry().getAllInfos()) {
+ testInfo->addFilenameTag();
+ }
+ }
+
+ } // anon namespace
+
+ Session::Session() {
+ static bool alreadyInstantiated = false;
+ if( alreadyInstantiated ) {
+ CATCH_TRY { CATCH_INTERNAL_ERROR( "Only one instance of Catch::Session can ever be used" ); }
+ CATCH_CATCH_ALL { getMutableRegistryHub().registerStartupException(); }
+ }
+
+ // There cannot be exceptions at startup in no-exception mode.
+#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+ const auto& exceptions = getRegistryHub().getStartupExceptionRegistry().getExceptions();
+ if ( !exceptions.empty() ) {
+ config();
+ getCurrentMutableContext().setConfig(m_config.get());
+
+ m_startupExceptions = true;
+ auto errStream = makeStream( "%stderr" );
+ auto colourImpl = makeColourImpl(
+ ColourMode::PlatformDefault, errStream.get() );
+ auto guard = colourImpl->guardColour( Colour::Red );
+ errStream->stream() << "Errors occurred during startup!" << '\n';
+ // iterate over all exceptions and notify user
+ for ( const auto& ex_ptr : exceptions ) {
+ try {
+ std::rethrow_exception(ex_ptr);
+ } catch ( std::exception const& ex ) {
+ errStream->stream() << TextFlow::Column( ex.what() ).indent(2) << '\n';
+ }
+ }
+ }
+#endif
+
+ alreadyInstantiated = true;
+ m_cli = makeCommandLineParser( m_configData );
+ }
+ Session::~Session() {
+ Catch::cleanUp();
+ }
+
+ void Session::showHelp() const {
+ Catch::cout()
+ << "\nCatch2 v" << libraryVersion() << '\n'
+ << m_cli << '\n'
+ << "For more detailed usage please see the project docs\n\n" << std::flush;
+ }
+ void Session::libIdentify() {
+ Catch::cout()
+ << std::left << std::setw(16) << "description: " << "A Catch2 test executable\n"
+ << std::left << std::setw(16) << "category: " << "testframework\n"
+ << std::left << std::setw(16) << "framework: " << "Catch2\n"
+ << std::left << std::setw(16) << "version: " << libraryVersion() << '\n' << std::flush;
+ }
+
+ int Session::applyCommandLine( int argc, char const * const * argv ) {
+ if( m_startupExceptions )
+ return 1;
+
+ auto result = m_cli.parse( Clara::Args( argc, argv ) );
+
+ if( !result ) {
+ config();
+ getCurrentMutableContext().setConfig(m_config.get());
+ auto errStream = makeStream( "%stderr" );
+ auto colour = makeColourImpl( ColourMode::PlatformDefault, errStream.get() );
+
+ errStream->stream()
+ << colour->guardColour( Colour::Red )
+ << "\nError(s) in input:\n"
+ << TextFlow::Column( result.errorMessage() ).indent( 2 )
+ << "\n\n";
+ errStream->stream() << "Run with -? for usage\n\n" << std::flush;
+ return MaxExitCode;
+ }
+
+ if( m_configData.showHelp )
+ showHelp();
+ if( m_configData.libIdentify )
+ libIdentify();
+
+ m_config.reset();
+ return 0;
+ }
+
+#if defined(CATCH_CONFIG_WCHAR) && defined(_WIN32) && defined(UNICODE)
+ int Session::applyCommandLine( int argc, wchar_t const * const * argv ) {
+
+ char **utf8Argv = new char *[ argc ];
+
+ for ( int i = 0; i < argc; ++i ) {
+ int bufSize = WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, nullptr, 0, nullptr, nullptr );
+
+ utf8Argv[ i ] = new char[ bufSize ];
+
+ WideCharToMultiByte( CP_UTF8, 0, argv[i], -1, utf8Argv[i], bufSize, nullptr, nullptr );
+ }
+
+ int returnCode = applyCommandLine( argc, utf8Argv );
+
+ for ( int i = 0; i < argc; ++i )
+ delete [] utf8Argv[ i ];
+
+ delete [] utf8Argv;
+
+ return returnCode;
+ }
+#endif
+
+ void Session::useConfigData( ConfigData const& configData ) {
+ m_configData = configData;
+ m_config.reset();
+ }
+
+ int Session::run() {
+ if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeStart ) != 0 ) {
+ Catch::cout() << "...waiting for enter/ return before starting\n" << std::flush;
+ static_cast<void>(std::getchar());
+ }
+ int exitCode = runInternal();
+ if( ( m_configData.waitForKeypress & WaitForKeypress::BeforeExit ) != 0 ) {
+ Catch::cout() << "...waiting for enter/ return before exiting, with code: " << exitCode << '\n' << std::flush;
+ static_cast<void>(std::getchar());
+ }
+ return exitCode;
+ }
+
+ Clara::Parser const& Session::cli() const {
+ return m_cli;
+ }
+ void Session::cli( Clara::Parser const& newParser ) {
+ m_cli = newParser;
+ }
+ ConfigData& Session::configData() {
+ return m_configData;
+ }
+ Config& Session::config() {
+ if( !m_config )
+ m_config = Detail::make_unique<Config>( m_configData );
+ return *m_config;
+ }
+
+ int Session::runInternal() {
+ if( m_startupExceptions )
+ return 1;
+
+ if (m_configData.showHelp || m_configData.libIdentify) {
+ return 0;
+ }
+
+ if ( m_configData.shardIndex >= m_configData.shardCount ) {
+ Catch::cerr() << "The shard count (" << m_configData.shardCount
+ << ") must be greater than the shard index ("
+ << m_configData.shardIndex << ")\n"
+ << std::flush;
+ return 1;
+ }
+
+ CATCH_TRY {
+ config(); // Force config to be constructed
+
+ seedRng( *m_config );
+
+ if (m_configData.filenamesAsTags) {
+ applyFilenamesAsTags();
+ }
+
+ // Set up global config instance before we start calling into other functions
+ getCurrentMutableContext().setConfig(m_config.get());
+
+ // Create reporter(s) so we can route listings through them
+ auto reporter = prepareReporters(m_config.get());
+
+ auto const& invalidSpecs = m_config->testSpec().getInvalidSpecs();
+ if ( !invalidSpecs.empty() ) {
+ for ( auto const& spec : invalidSpecs ) {
+ reporter->reportInvalidTestSpec( spec );
+ }
+ return 1;
+ }
+
+
+ // Handle list request
+ if (list(*reporter, *m_config)) {
+ return 0;
+ }
+
+ TestGroup tests { CATCH_MOVE(reporter), m_config.get() };
+ auto const totals = tests.execute();
+
+ if ( tests.hadUnmatchedTestSpecs()
+ && m_config->warnAboutUnmatchedTestSpecs() ) {
+ return 3;
+ }
+
+ if ( totals.testCases.total() == 0
+ && !m_config->zeroTestsCountAsSuccess() ) {
+ return 2;
+ }
+
+ // Note that on unices only the lower 8 bits are usually used, clamping
+ // the return value to 255 prevents false negative when some multiple
+ // of 256 tests has failed
+ return (std::min) (MaxExitCode, static_cast<int>(totals.assertions.failed));
+ }
+#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+ catch( std::exception& ex ) {
+ Catch::cerr() << ex.what() << '\n' << std::flush;
+ return MaxExitCode;
+ }
+#endif
+ }
+
+} // end namespace Catch
+
+
+
+
+namespace Catch {
+
+ RegistrarForTagAliases::RegistrarForTagAliases(char const* alias, char const* tag, SourceLineInfo const& lineInfo) {
+ CATCH_TRY {
+ getMutableRegistryHub().registerTagAlias(alias, tag, lineInfo);
+ } CATCH_CATCH_ALL {
+ // Do not throw when constructing global objects, instead register the exception to be processed later
+ getMutableRegistryHub().registerStartupException();
+ }
+ }
+
+}
+
+
+
+#include <cassert>
+#include <cctype>
+#include <algorithm>
+
+namespace Catch {
+
+ namespace {
+ using TCP_underlying_type = uint8_t;
+ static_assert(sizeof(TestCaseProperties) == sizeof(TCP_underlying_type),
+ "The size of the TestCaseProperties is different from the assumed size");
+
+ TestCaseProperties operator|(TestCaseProperties lhs, TestCaseProperties rhs) {
+ return static_cast<TestCaseProperties>(
+ static_cast<TCP_underlying_type>(lhs) | static_cast<TCP_underlying_type>(rhs)
+ );
+ }
+
+ TestCaseProperties& operator|=(TestCaseProperties& lhs, TestCaseProperties rhs) {
+ lhs = static_cast<TestCaseProperties>(
+ static_cast<TCP_underlying_type>(lhs) | static_cast<TCP_underlying_type>(rhs)
+ );
+ return lhs;
+ }
+
+ TestCaseProperties operator&(TestCaseProperties lhs, TestCaseProperties rhs) {
+ return static_cast<TestCaseProperties>(
+ static_cast<TCP_underlying_type>(lhs) & static_cast<TCP_underlying_type>(rhs)
+ );
+ }
+
+ bool applies(TestCaseProperties tcp) {
+ static_assert(static_cast<TCP_underlying_type>(TestCaseProperties::None) == 0,
+ "TestCaseProperties::None must be equal to 0");
+ return tcp != TestCaseProperties::None;
+ }
+
+ TestCaseProperties parseSpecialTag( StringRef tag ) {
+ if( !tag.empty() && tag[0] == '.' )
+ return TestCaseProperties::IsHidden;
+ else if( tag == "!throws"_sr )
+ return TestCaseProperties::Throws;
+ else if( tag == "!shouldfail"_sr )
+ return TestCaseProperties::ShouldFail;
+ else if( tag == "!mayfail"_sr )
+ return TestCaseProperties::MayFail;
+ else if( tag == "!nonportable"_sr )
+ return TestCaseProperties::NonPortable;
+ else if( tag == "!benchmark"_sr )
+ return TestCaseProperties::Benchmark | TestCaseProperties::IsHidden;
+ else
+ return TestCaseProperties::None;
+ }
+ bool isReservedTag( StringRef tag ) {
+ return parseSpecialTag( tag ) == TestCaseProperties::None
+ && tag.size() > 0
+ && !std::isalnum( static_cast<unsigned char>(tag[0]) );
+ }
+ void enforceNotReservedTag( StringRef tag, SourceLineInfo const& _lineInfo ) {
+ CATCH_ENFORCE( !isReservedTag(tag),
+ "Tag name: [" << tag << "] is not allowed.\n"
+ << "Tag names starting with non alphanumeric characters are reserved\n"
+ << _lineInfo );
+ }
+
+ std::string makeDefaultName() {
+ static size_t counter = 0;
+ return "Anonymous test case " + std::to_string(++counter);
+ }
+
+ StringRef extractFilenamePart(StringRef filename) {
+ size_t lastDot = filename.size();
+ while (lastDot > 0 && filename[lastDot - 1] != '.') {
+ --lastDot;
+ }
+ --lastDot;
+
+ size_t nameStart = lastDot;
+ while (nameStart > 0 && filename[nameStart - 1] != '/' && filename[nameStart - 1] != '\\') {
+ --nameStart;
+ }
+
+ return filename.substr(nameStart, lastDot - nameStart);
+ }
+
+ // Returns the upper bound on size of extra tags ([#file]+[.])
+ size_t sizeOfExtraTags(StringRef filepath) {
+ // [.] is 3, [#] is another 3
+ const size_t extras = 3 + 3;
+ return extractFilenamePart(filepath).size() + extras;
+ }
+ } // end unnamed namespace
+
+ bool operator<( Tag const& lhs, Tag const& rhs ) {
+ Detail::CaseInsensitiveLess cmp;
+ return cmp( lhs.original, rhs.original );
+ }
+ bool operator==( Tag const& lhs, Tag const& rhs ) {
+ Detail::CaseInsensitiveEqualTo cmp;
+ return cmp( lhs.original, rhs.original );
+ }
+
+ Detail::unique_ptr<TestCaseInfo>
+ makeTestCaseInfo(StringRef _className,
+ NameAndTags const& nameAndTags,
+ SourceLineInfo const& _lineInfo ) {
+ return Detail::make_unique<TestCaseInfo>(_className, nameAndTags, _lineInfo);
+ }
+
+ TestCaseInfo::TestCaseInfo(StringRef _className,
+ NameAndTags const& _nameAndTags,
+ SourceLineInfo const& _lineInfo):
+ name( _nameAndTags.name.empty() ? makeDefaultName() : _nameAndTags.name ),
+ className( _className ),
+ lineInfo( _lineInfo )
+ {
+ StringRef originalTags = _nameAndTags.tags;
+ // We need to reserve enough space to store all of the tags
+ // (including optional hidden tag and filename tag)
+ auto requiredSize = originalTags.size() + sizeOfExtraTags(_lineInfo.file);
+ backingTags.reserve(requiredSize);
+
+ // We cannot copy the tags directly, as we need to normalize
+ // some tags, so that [.foo] is copied as [.][foo].
+ size_t tagStart = 0;
+ size_t tagEnd = 0;
+ bool inTag = false;
+ for (size_t idx = 0; idx < originalTags.size(); ++idx) {
+ auto c = originalTags[idx];
+ if (c == '[') {
+ assert(!inTag);
+ inTag = true;
+ tagStart = idx;
+ }
+ if (c == ']') {
+ assert(inTag);
+ inTag = false;
+ tagEnd = idx;
+ assert(tagStart < tagEnd);
+
+ // We need to check the tag for special meanings, copy
+ // it over to backing storage and actually reference the
+ // backing storage in the saved tags
+ StringRef tagStr = originalTags.substr(tagStart+1, tagEnd - tagStart - 1);
+ CATCH_ENFORCE(!tagStr.empty(), "Empty tags are not allowed");
+ enforceNotReservedTag(tagStr, lineInfo);
+ properties |= parseSpecialTag(tagStr);
+ // When copying a tag to the backing storage, we need to
+ // check if it is a merged hide tag, such as [.foo], and
+ // if it is, we need to handle it as if it was [foo].
+ if (tagStr.size() > 1 && tagStr[0] == '.') {
+ tagStr = tagStr.substr(1, tagStr.size() - 1);
+ }
+ // We skip over dealing with the [.] tag, as we will add
+ // it later unconditionally and then sort and unique all
+ // the tags.
+ internalAppendTag(tagStr);
+ }
+ (void)inTag; // Silence "set-but-unused" warning in release mode.
+ }
+ // Add [.] if relevant
+ if (isHidden()) {
+ internalAppendTag("."_sr);
+ }
+
+ // Sort and prepare tags
+ std::sort(begin(tags), end(tags));
+ tags.erase(std::unique(begin(tags), end(tags)),
+ end(tags));
+ }
+
+ bool TestCaseInfo::isHidden() const {
+ return applies( properties & TestCaseProperties::IsHidden );
+ }
+ bool TestCaseInfo::throws() const {
+ return applies( properties & TestCaseProperties::Throws );
+ }
+ bool TestCaseInfo::okToFail() const {
+ return applies( properties & (TestCaseProperties::ShouldFail | TestCaseProperties::MayFail ) );
+ }
+ bool TestCaseInfo::expectedToFail() const {
+ return applies( properties & (TestCaseProperties::ShouldFail) );
+ }
+
+ void TestCaseInfo::addFilenameTag() {
+ std::string combined("#");
+ combined += extractFilenamePart(lineInfo.file);
+ internalAppendTag(combined);
+ }
+
+ std::string TestCaseInfo::tagsAsString() const {
+ std::string ret;
+ // '[' and ']' per tag
+ std::size_t full_size = 2 * tags.size();
+ for (const auto& tag : tags) {
+ full_size += tag.original.size();
+ }
+ ret.reserve(full_size);
+ for (const auto& tag : tags) {
+ ret.push_back('[');
+ ret += tag.original;
+ ret.push_back(']');
+ }
+
+ return ret;
+ }
+
+ void TestCaseInfo::internalAppendTag(StringRef tagStr) {
+ backingTags += '[';
+ const auto backingStart = backingTags.size();
+ backingTags += tagStr;
+ const auto backingEnd = backingTags.size();
+ backingTags += ']';
+ tags.emplace_back(StringRef(backingTags.c_str() + backingStart, backingEnd - backingStart));
+ }
+
+ bool operator<( TestCaseInfo const& lhs, TestCaseInfo const& rhs ) {
+ // We want to avoid redoing the string comparisons multiple times,
+ // so we store the result of a three-way comparison before using
+ // it in the actual comparison logic.
+ const auto cmpName = lhs.name.compare( rhs.name );
+ if ( cmpName != 0 ) {
+ return cmpName < 0;
+ }
+ const auto cmpClassName = lhs.className.compare( rhs.className );
+ if ( cmpClassName != 0 ) {
+ return cmpClassName < 0;
+ }
+ return lhs.tags < rhs.tags;
+ }
+
+ TestCaseInfo const& TestCaseHandle::getTestCaseInfo() const {
+ return *m_info;
+ }
+
+} // end namespace Catch
+
+
+
+#include <algorithm>
+#include <string>
+#include <vector>
+
+namespace Catch {
+
+ TestSpec::Pattern::Pattern( std::string const& name )
+ : m_name( name )
+ {}
+
+ TestSpec::Pattern::~Pattern() = default;
+
+ std::string const& TestSpec::Pattern::name() const {
+ return m_name;
+ }
+
+
+ TestSpec::NamePattern::NamePattern( std::string const& name, std::string const& filterString )
+ : Pattern( filterString )
+ , m_wildcardPattern( toLower( name ), CaseSensitive::No )
+ {}
+
+ bool TestSpec::NamePattern::matches( TestCaseInfo const& testCase ) const {
+ return m_wildcardPattern.matches( testCase.name );
+ }
+
+
+ TestSpec::TagPattern::TagPattern( std::string const& tag, std::string const& filterString )
+ : Pattern( filterString )
+ , m_tag( tag )
+ {}
+
+ bool TestSpec::TagPattern::matches( TestCaseInfo const& testCase ) const {
+ return std::find( begin( testCase.tags ),
+ end( testCase.tags ),
+ Tag( m_tag ) ) != end( testCase.tags );
+ }
+
+ bool TestSpec::Filter::matches( TestCaseInfo const& testCase ) const {
+ bool should_use = !testCase.isHidden();
+ for (auto const& pattern : m_required) {
+ should_use = true;
+ if (!pattern->matches(testCase)) {
+ return false;
+ }
+ }
+ for (auto const& pattern : m_forbidden) {
+ if (pattern->matches(testCase)) {
+ return false;
+ }
+ }
+ return should_use;
+ }
+
+ std::string TestSpec::Filter::name() const {
+ std::string name;
+ for (auto const& p : m_required) {
+ name += p->name();
+ }
+ for (auto const& p : m_forbidden) {
+ name += p->name();
+ }
+ return name;
+ }
+
+
+ bool TestSpec::hasFilters() const {
+ return !m_filters.empty();
+ }
+
+ bool TestSpec::matches( TestCaseInfo const& testCase ) const {
+ return std::any_of( m_filters.begin(), m_filters.end(), [&]( Filter const& f ){ return f.matches( testCase ); } );
+ }
+
+ TestSpec::Matches TestSpec::matchesByFilter( std::vector<TestCaseHandle> const& testCases, IConfig const& config ) const
+ {
+ Matches matches( m_filters.size() );
+ std::transform( m_filters.begin(), m_filters.end(), matches.begin(), [&]( Filter const& filter ){
+ std::vector<TestCaseHandle const*> currentMatches;
+ for( auto const& test : testCases )
+ if( isThrowSafe( test, config ) && filter.matches( test.getTestCaseInfo() ) )
+ currentMatches.emplace_back( &test );
+ return FilterMatch{ filter.name(), currentMatches };
+ } );
+ return matches;
+ }
+
+ const TestSpec::vectorStrings& TestSpec::getInvalidSpecs() const {
+ return m_invalidSpecs;
+ }
+
+}
+
+
+
+#include <chrono>
+
+namespace Catch {
+
+ namespace {
+ static auto getCurrentNanosecondsSinceEpoch() -> uint64_t {
+ return std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::high_resolution_clock::now().time_since_epoch()).count();
+ }
+ } // end unnamed namespace
+
+ void Timer::start() {
+ m_nanoseconds = getCurrentNanosecondsSinceEpoch();
+ }
+ auto Timer::getElapsedNanoseconds() const -> uint64_t {
+ return getCurrentNanosecondsSinceEpoch() - m_nanoseconds;
+ }
+ auto Timer::getElapsedMicroseconds() const -> uint64_t {
+ return getElapsedNanoseconds()/1000;
+ }
+ auto Timer::getElapsedMilliseconds() const -> unsigned int {
+ return static_cast<unsigned int>(getElapsedMicroseconds()/1000);
+ }
+ auto Timer::getElapsedSeconds() const -> double {
+ return getElapsedMicroseconds()/1000000.0;
+ }
+
+
+} // namespace Catch
+
+
+
+
+#include <cmath>
+#include <iomanip>
+
+namespace Catch {
+
+namespace Detail {
+
+ namespace {
+ const int hexThreshold = 255;
+
+ struct Endianness {
+ enum Arch { Big, Little };
+
+ static Arch which() {
+ int one = 1;
+ // If the lowest byte we read is non-zero, we can assume
+ // that little endian format is used.
+ auto value = *reinterpret_cast<char*>(&one);
+ return value ? Little : Big;
+ }
+ };
+
+ template<typename T>
+ std::string fpToString(T value, int precision) {
+ if (Catch::isnan(value)) {
+ return "nan";
+ }
+
+ ReusableStringStream rss;
+ rss << std::setprecision(precision)
+ << std::fixed
+ << value;
+ std::string d = rss.str();
+ std::size_t i = d.find_last_not_of('0');
+ if (i != std::string::npos && i != d.size() - 1) {
+ if (d[i] == '.')
+ i++;
+ d = d.substr(0, i + 1);
+ }
+ return d;
+ }
+ } // end unnamed namespace
+
+ std::string convertIntoString(StringRef string, bool escape_invisibles) {
+ std::string ret;
+ // This is enough for the "don't escape invisibles" case, and a good
+ // lower bound on the "escape invisibles" case.
+ ret.reserve(string.size() + 2);
+
+ if (!escape_invisibles) {
+ ret += '"';
+ ret += string;
+ ret += '"';
+ return ret;
+ }
+
+ ret += '"';
+ for (char c : string) {
+ switch (c) {
+ case '\r':
+ ret.append("\\r");
+ break;
+ case '\n':
+ ret.append("\\n");
+ break;
+ case '\t':
+ ret.append("\\t");
+ break;
+ case '\f':
+ ret.append("\\f");
+ break;
+ default:
+ ret.push_back(c);
+ break;
+ }
+ }
+ ret += '"';
+
+ return ret;
+ }
+
+ std::string convertIntoString(StringRef string) {
+ return convertIntoString(string, getCurrentContext().getConfig()->showInvisibles());
+ }
+
+ std::string rawMemoryToString( const void *object, std::size_t size ) {
+ // Reverse order for little endian architectures
+ int i = 0, end = static_cast<int>( size ), inc = 1;
+ if( Endianness::which() == Endianness::Little ) {
+ i = end-1;
+ end = inc = -1;
+ }
+
+ unsigned char const *bytes = static_cast<unsigned char const *>(object);
+ ReusableStringStream rss;
+ rss << "0x" << std::setfill('0') << std::hex;
+ for( ; i != end; i += inc )
+ rss << std::setw(2) << static_cast<unsigned>(bytes[i]);
+ return rss.str();
+ }
+} // end Detail namespace
+
+
+
+//// ======================================================= ////
+//
+// Out-of-line defs for full specialization of StringMaker
+//
+//// ======================================================= ////
+
+std::string StringMaker<std::string>::convert(const std::string& str) {
+ return Detail::convertIntoString( str );
+}
+
+#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
+std::string StringMaker<std::string_view>::convert(std::string_view str) {
+ return Detail::convertIntoString( StringRef( str.data(), str.size() ) );
+}
+#endif
+
+std::string StringMaker<char const*>::convert(char const* str) {
+ if (str) {
+ return Detail::convertIntoString( str );
+ } else {
+ return{ "{null string}" };
+ }
+}
+std::string StringMaker<char*>::convert(char* str) {
+ if (str) {
+ return Detail::convertIntoString( str );
+ } else {
+ return{ "{null string}" };
+ }
+}
+
+#ifdef CATCH_CONFIG_WCHAR
+std::string StringMaker<std::wstring>::convert(const std::wstring& wstr) {
+ std::string s;
+ s.reserve(wstr.size());
+ for (auto c : wstr) {
+ s += (c <= 0xff) ? static_cast<char>(c) : '?';
+ }
+ return ::Catch::Detail::stringify(s);
+}
+
+# ifdef CATCH_CONFIG_CPP17_STRING_VIEW
+std::string StringMaker<std::wstring_view>::convert(std::wstring_view str) {
+ return StringMaker<std::wstring>::convert(std::wstring(str));
+}
+# endif
+
+std::string StringMaker<wchar_t const*>::convert(wchar_t const * str) {
+ if (str) {
+ return ::Catch::Detail::stringify(std::wstring{ str });
+ } else {
+ return{ "{null string}" };
+ }
+}
+std::string StringMaker<wchar_t *>::convert(wchar_t * str) {
+ if (str) {
+ return ::Catch::Detail::stringify(std::wstring{ str });
+ } else {
+ return{ "{null string}" };
+ }
+}
+#endif
+
+#if defined(CATCH_CONFIG_CPP17_BYTE)
+#include <cstddef>
+std::string StringMaker<std::byte>::convert(std::byte value) {
+ return ::Catch::Detail::stringify(std::to_integer<unsigned long long>(value));
+}
+#endif // defined(CATCH_CONFIG_CPP17_BYTE)
+
+std::string StringMaker<int>::convert(int value) {
+ return ::Catch::Detail::stringify(static_cast<long long>(value));
+}
+std::string StringMaker<long>::convert(long value) {
+ return ::Catch::Detail::stringify(static_cast<long long>(value));
+}
+std::string StringMaker<long long>::convert(long long value) {
+ ReusableStringStream rss;
+ rss << value;
+ if (value > Detail::hexThreshold) {
+ rss << " (0x" << std::hex << value << ')';
+ }
+ return rss.str();
+}
+
+std::string StringMaker<unsigned int>::convert(unsigned int value) {
+ return ::Catch::Detail::stringify(static_cast<unsigned long long>(value));
+}
+std::string StringMaker<unsigned long>::convert(unsigned long value) {
+ return ::Catch::Detail::stringify(static_cast<unsigned long long>(value));
+}
+std::string StringMaker<unsigned long long>::convert(unsigned long long value) {
+ ReusableStringStream rss;
+ rss << value;
+ if (value > Detail::hexThreshold) {
+ rss << " (0x" << std::hex << value << ')';
+ }
+ return rss.str();
+}
+
+std::string StringMaker<signed char>::convert(signed char value) {
+ if (value == '\r') {
+ return "'\\r'";
+ } else if (value == '\f') {
+ return "'\\f'";
+ } else if (value == '\n') {
+ return "'\\n'";
+ } else if (value == '\t') {
+ return "'\\t'";
+ } else if ('\0' <= value && value < ' ') {
+ return ::Catch::Detail::stringify(static_cast<unsigned int>(value));
+ } else {
+ char chstr[] = "' '";
+ chstr[1] = value;
+ return chstr;
+ }
+}
+std::string StringMaker<char>::convert(char c) {
+ return ::Catch::Detail::stringify(static_cast<signed char>(c));
+}
+std::string StringMaker<unsigned char>::convert(unsigned char c) {
+ return ::Catch::Detail::stringify(static_cast<char>(c));
+}
+
+int StringMaker<float>::precision = 5;
+
+std::string StringMaker<float>::convert(float value) {
+ return Detail::fpToString(value, precision) + 'f';
+}
+
+int StringMaker<double>::precision = 10;
+
+std::string StringMaker<double>::convert(double value) {
+ return Detail::fpToString(value, precision);
+}
+
+} // end namespace Catch
+
+
+
+namespace Catch {
+
+ Counts Counts::operator - ( Counts const& other ) const {
+ Counts diff;
+ diff.passed = passed - other.passed;
+ diff.failed = failed - other.failed;
+ diff.failedButOk = failedButOk - other.failedButOk;
+ return diff;
+ }
+
+ Counts& Counts::operator += ( Counts const& other ) {
+ passed += other.passed;
+ failed += other.failed;
+ failedButOk += other.failedButOk;
+ return *this;
+ }
+
+ std::uint64_t Counts::total() const {
+ return passed + failed + failedButOk;
+ }
+ bool Counts::allPassed() const {
+ return failed == 0 && failedButOk == 0;
+ }
+ bool Counts::allOk() const {
+ return failed == 0;
+ }
+
+ Totals Totals::operator - ( Totals const& other ) const {
+ Totals diff;
+ diff.assertions = assertions - other.assertions;
+ diff.testCases = testCases - other.testCases;
+ return diff;
+ }
+
+ Totals& Totals::operator += ( Totals const& other ) {
+ assertions += other.assertions;
+ testCases += other.testCases;
+ return *this;
+ }
+
+ Totals Totals::delta( Totals const& prevTotals ) const {
+ Totals diff = *this - prevTotals;
+ if( diff.assertions.failed > 0 )
+ ++diff.testCases.failed;
+ else if( diff.assertions.failedButOk > 0 )
+ ++diff.testCases.failedButOk;
+ else
+ ++diff.testCases.passed;
+ return diff;
+ }
+
+}
+
+
+#include <ostream>
+
+namespace Catch {
+
+ Version::Version
+ ( unsigned int _majorVersion,
+ unsigned int _minorVersion,
+ unsigned int _patchNumber,
+ char const * const _branchName,
+ unsigned int _buildNumber )
+ : majorVersion( _majorVersion ),
+ minorVersion( _minorVersion ),
+ patchNumber( _patchNumber ),
+ branchName( _branchName ),
+ buildNumber( _buildNumber )
+ {}
+
+ std::ostream& operator << ( std::ostream& os, Version const& version ) {
+ os << version.majorVersion << '.'
+ << version.minorVersion << '.'
+ << version.patchNumber;
+ // branchName is never null -> 0th char is \0 if it is empty
+ if (version.branchName[0]) {
+ os << '-' << version.branchName
+ << '.' << version.buildNumber;
+ }
+ return os;
+ }
+
+ Version const& libraryVersion() {
+ static Version version( 3, 1, 0, "", 0 );
+ return version;
+ }
+
+}
+
+
+
+
+namespace Catch {
+
+ const char* GeneratorException::what() const noexcept {
+ return m_msg;
+ }
+
+} // end namespace Catch
+
+
+
+
+namespace Catch {
+
+ IGeneratorTracker::~IGeneratorTracker() = default;
+
+namespace Generators {
+
+namespace Detail {
+
+ [[noreturn]]
+ void throw_generator_exception(char const* msg) {
+ Catch::throw_exception(GeneratorException{ msg });
+ }
+} // end namespace Detail
+
+ GeneratorUntypedBase::~GeneratorUntypedBase() = default;
+
+ auto acquireGeneratorTracker(StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
+ return getResultCapture().acquireGeneratorTracker( generatorName, lineInfo );
+ }
+
+} // namespace Generators
+} // namespace Catch
+
+
+
+
+
+std::uint32_t Catch::Generators::Detail::getSeed() { return sharedRng()(); }
+
+
+
+
+namespace Catch {
+ IResultCapture::~IResultCapture() = default;
+}
+
+
+
+
+namespace Catch {
+ IConfig::~IConfig() = default;
+}
+
+
+
+
+namespace Catch {
+ IExceptionTranslator::~IExceptionTranslator() = default;
+ IExceptionTranslatorRegistry::~IExceptionTranslatorRegistry() = default;
+}
+
+
+
+#include <string>
+
+namespace Catch {
+ namespace Generators {
+
+ bool GeneratorUntypedBase::countedNext() {
+ auto ret = next();
+ if ( ret ) {
+ m_stringReprCache.clear();
+ ++m_currentElementIndex;
+ }
+ return ret;
+ }
+
+ StringRef GeneratorUntypedBase::currentElementAsString() const {
+ if ( m_stringReprCache.empty() ) {
+ m_stringReprCache = stringifyImpl();
+ }
+ return m_stringReprCache;
+ }
+
+ } // namespace Generators
+} // namespace Catch
+
+
+
+
+namespace Catch {
+ IRegistryHub::~IRegistryHub() = default;
+ IMutableRegistryHub::~IMutableRegistryHub() = default;
+}
+
+
+
+#include <algorithm>
+#include <cassert>
+#include <iomanip>
+
+namespace Catch {
+
+ ReporterConfig::ReporterConfig(
+ IConfig const* _fullConfig,
+ Detail::unique_ptr<IStream> _stream,
+ ColourMode colourMode,
+ std::map<std::string, std::string> customOptions ):
+ m_stream( CATCH_MOVE(_stream) ),
+ m_fullConfig( _fullConfig ),
+ m_colourMode( colourMode ),
+ m_customOptions( CATCH_MOVE( customOptions ) ) {}
+
+ Detail::unique_ptr<IStream> ReporterConfig::takeStream() && {
+ assert( m_stream );
+ return CATCH_MOVE( m_stream );
+ }
+ IConfig const * ReporterConfig::fullConfig() const { return m_fullConfig; }
+ ColourMode ReporterConfig::colourMode() const { return m_colourMode; }
+
+ std::map<std::string, std::string> const&
+ ReporterConfig::customOptions() const {
+ return m_customOptions;
+ }
+
+ ReporterConfig::~ReporterConfig() = default;
+
+ AssertionStats::AssertionStats( AssertionResult const& _assertionResult,
+ std::vector<MessageInfo> const& _infoMessages,
+ Totals const& _totals )
+ : assertionResult( _assertionResult ),
+ infoMessages( _infoMessages ),
+ totals( _totals )
+ {
+ assertionResult.m_resultData.lazyExpression.m_transientExpression = _assertionResult.m_resultData.lazyExpression.m_transientExpression;
+
+ if( assertionResult.hasMessage() ) {
+ // Copy message into messages list.
+ // !TBD This should have been done earlier, somewhere
+ MessageBuilder builder( assertionResult.getTestMacroName(), assertionResult.getSourceInfo(), assertionResult.getResultType() );
+ builder << assertionResult.getMessage();
+ builder.m_info.message = builder.m_stream.str();
+
+ infoMessages.push_back( builder.m_info );
+ }
+ }
+
+ SectionStats::SectionStats( SectionInfo const& _sectionInfo,
+ Counts const& _assertions,
+ double _durationInSeconds,
+ bool _missingAssertions )
+ : sectionInfo( _sectionInfo ),
+ assertions( _assertions ),
+ durationInSeconds( _durationInSeconds ),
+ missingAssertions( _missingAssertions )
+ {}
+
+
+ TestCaseStats::TestCaseStats( TestCaseInfo const& _testInfo,
+ Totals const& _totals,
+ std::string const& _stdOut,
+ std::string const& _stdErr,
+ bool _aborting )
+ : testInfo( &_testInfo ),
+ totals( _totals ),
+ stdOut( _stdOut ),
+ stdErr( _stdErr ),
+ aborting( _aborting )
+ {}
+
+
+ TestRunStats::TestRunStats( TestRunInfo const& _runInfo,
+ Totals const& _totals,
+ bool _aborting )
+ : runInfo( _runInfo ),
+ totals( _totals ),
+ aborting( _aborting )
+ {}
+
+ IEventListener::~IEventListener() = default;
+
+} // end namespace Catch
+
+
+
+
+namespace Catch {
+ IReporterFactory::~IReporterFactory() = default;
+ EventListenerFactory::~EventListenerFactory() = default;
+}
+
+
+
+
+namespace Catch {
+ IReporterRegistry::~IReporterRegistry() = default;
+}
+
+
+
+
+namespace Catch {
+ ITestInvoker::~ITestInvoker() = default;
+ ITestCaseRegistry::~ITestCaseRegistry() = default;
+}
+
+
+
+namespace Catch {
+
+ AssertionHandler::AssertionHandler
+ ( StringRef macroName,
+ SourceLineInfo const& lineInfo,
+ StringRef capturedExpression,
+ ResultDisposition::Flags resultDisposition )
+ : m_assertionInfo{ macroName, lineInfo, capturedExpression, resultDisposition },
+ m_resultCapture( getResultCapture() )
+ {}
+
+ void AssertionHandler::handleExpr( ITransientExpression const& expr ) {
+ m_resultCapture.handleExpr( m_assertionInfo, expr, m_reaction );
+ }
+ void AssertionHandler::handleMessage(ResultWas::OfType resultType, StringRef message) {
+ m_resultCapture.handleMessage( m_assertionInfo, resultType, message, m_reaction );
+ }
+
+ auto AssertionHandler::allowThrows() const -> bool {
+ return getCurrentContext().getConfig()->allowThrows();
+ }
+
+ void AssertionHandler::complete() {
+ setCompleted();
+ if( m_reaction.shouldDebugBreak ) {
+
+ // If you find your debugger stopping you here then go one level up on the
+ // call-stack for the code that caused it (typically a failed assertion)
+
+ // (To go back to the test and change execution, jump over the throw, next)
+ CATCH_BREAK_INTO_DEBUGGER();
+ }
+ if (m_reaction.shouldThrow) {
+#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+ throw Catch::TestFailureException();
+#else
+ CATCH_ERROR( "Test failure requires aborting test!" );
+#endif
+ }
+ }
+ void AssertionHandler::setCompleted() {
+ m_completed = true;
+ }
+
+ void AssertionHandler::handleUnexpectedInflightException() {
+ m_resultCapture.handleUnexpectedInflightException( m_assertionInfo, Catch::translateActiveException(), m_reaction );
+ }
+
+ void AssertionHandler::handleExceptionThrownAsExpected() {
+ m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
+ }
+ void AssertionHandler::handleExceptionNotThrownAsExpected() {
+ m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
+ }
+
+ void AssertionHandler::handleUnexpectedExceptionNotThrown() {
+ m_resultCapture.handleUnexpectedExceptionNotThrown( m_assertionInfo, m_reaction );
+ }
+
+ void AssertionHandler::handleThrowingCallSkipped() {
+ m_resultCapture.handleNonExpr(m_assertionInfo, ResultWas::Ok, m_reaction);
+ }
+
+ // This is the overload that takes a string and infers the Equals matcher from it
+ // The more general overload, that takes any string matcher, is in catch_capture_matchers.cpp
+ void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString ) {
+ handleExceptionMatchExpr( handler, Matchers::Equals( str ), matcherString );
+ }
+
+} // namespace Catch
+
+
+
+
+#include <algorithm>
+
+namespace Catch {
+ namespace Detail {
+
+ bool CaseInsensitiveLess::operator()( StringRef lhs,
+ StringRef rhs ) const {
+ return std::lexicographical_compare(
+ lhs.begin(), lhs.end(),
+ rhs.begin(), rhs.end(),
+ []( char l, char r ) { return toLower( l ) < toLower( r ); } );
+ }
+
+ bool
+ CaseInsensitiveEqualTo::operator()( StringRef lhs,
+ StringRef rhs ) const {
+ return std::equal(
+ lhs.begin(), lhs.end(),
+ rhs.begin(), rhs.end(),
+ []( char l, char r ) { return toLower( l ) == toLower( r ); } );
+ }
+
+ } // namespace Detail
+} // namespace Catch
+
+
+
+
+#include <algorithm>
+#include <ostream>
+
+namespace {
+ bool isOptPrefix( char c ) {
+ return c == '-'
+#ifdef CATCH_PLATFORM_WINDOWS
+ || c == '/'
+#endif
+ ;
+ }
+
+ std::string normaliseOpt( std::string const& optName ) {
+#ifdef CATCH_PLATFORM_WINDOWS
+ if ( optName[0] == '/' )
+ return "-" + optName.substr( 1 );
+ else
+#endif
+ return optName;
+ }
+
+} // namespace
+
+namespace Catch {
+ namespace Clara {
+ namespace Detail {
+
+ void TokenStream::loadBuffer() {
+ m_tokenBuffer.clear();
+
+ // Skip any empty strings
+ while ( it != itEnd && it->empty() ) {
+ ++it;
+ }
+
+ if ( it != itEnd ) {
+ auto const& next = *it;
+ if ( isOptPrefix( next[0] ) ) {
+ auto delimiterPos = next.find_first_of( " :=" );
+ if ( delimiterPos != std::string::npos ) {
+ m_tokenBuffer.push_back(
+ { TokenType::Option,
+ next.substr( 0, delimiterPos ) } );
+ m_tokenBuffer.push_back(
+ { TokenType::Argument,
+ next.substr( delimiterPos + 1 ) } );
+ } else {
+ if ( next[1] != '-' && next.size() > 2 ) {
+ std::string opt = "- ";
+ for ( size_t i = 1; i < next.size(); ++i ) {
+ opt[1] = next[i];
+ m_tokenBuffer.push_back(
+ { TokenType::Option, opt } );
+ }
+ } else {
+ m_tokenBuffer.push_back(
+ { TokenType::Option, next } );
+ }
+ }
+ } else {
+ m_tokenBuffer.push_back(
+ { TokenType::Argument, next } );
+ }
+ }
+ }
+
+ TokenStream::TokenStream( Args const& args ):
+ TokenStream( args.m_args.begin(), args.m_args.end() ) {}
+
+ TokenStream::TokenStream( Iterator it_, Iterator itEnd_ ):
+ it( it_ ), itEnd( itEnd_ ) {
+ loadBuffer();
+ }
+
+ TokenStream& TokenStream::operator++() {
+ if ( m_tokenBuffer.size() >= 2 ) {
+ m_tokenBuffer.erase( m_tokenBuffer.begin() );
+ } else {
+ if ( it != itEnd )
+ ++it;
+ loadBuffer();
+ }
+ return *this;
+ }
+
+ ParserResult convertInto( std::string const& source,
+ std::string& target ) {
+ target = source;
+ return ParserResult::ok( ParseResultType::Matched );
+ }
+
+ ParserResult convertInto( std::string const& source,
+ bool& target ) {
+ std::string srcLC = toLower( source );
+
+ if ( srcLC == "y" || srcLC == "1" || srcLC == "true" ||
+ srcLC == "yes" || srcLC == "on" ) {
+ target = true;
+ } else if ( srcLC == "n" || srcLC == "0" || srcLC == "false" ||
+ srcLC == "no" || srcLC == "off" ) {
+ target = false;
+ } else {
+ return ParserResult::runtimeError(
+ "Expected a boolean value but did not recognise: '" +
+ source + '\'' );
+ }
+ return ParserResult::ok( ParseResultType::Matched );
+ }
+
+ size_t ParserBase::cardinality() const { return 1; }
+
+ InternalParseResult ParserBase::parse( Args const& args ) const {
+ return parse( args.exeName(), TokenStream( args ) );
+ }
+
+ ParseState::ParseState( ParseResultType type,
+ TokenStream const& remainingTokens ):
+ m_type( type ), m_remainingTokens( remainingTokens ) {}
+
+ ParserResult BoundFlagRef::setFlag( bool flag ) {
+ m_ref = flag;
+ return ParserResult::ok( ParseResultType::Matched );
+ }
+
+ ResultBase::~ResultBase() = default;
+
+ bool BoundRef::isContainer() const { return false; }
+
+ bool BoundRef::isFlag() const { return false; }
+
+ bool BoundFlagRefBase::isFlag() const { return true; }
+
+} // namespace Detail
+
+ Detail::InternalParseResult Arg::parse(std::string const&,
+ Detail::TokenStream const& tokens) const {
+ auto validationResult = validate();
+ if (!validationResult)
+ return Detail::InternalParseResult(validationResult);
+
+ auto remainingTokens = tokens;
+ auto const& token = *remainingTokens;
+ if (token.type != Detail::TokenType::Argument)
+ return Detail::InternalParseResult::ok(Detail::ParseState(
+ ParseResultType::NoMatch, remainingTokens));
+
+ assert(!m_ref->isFlag());
+ auto valueRef =
+ static_cast<Detail::BoundValueRefBase*>(m_ref.get());
+
+ auto result = valueRef->setValue(remainingTokens->token);
+ if (!result)
+ return Detail::InternalParseResult(result);
+ else
+ return Detail::InternalParseResult::ok(Detail::ParseState(
+ ParseResultType::Matched, ++remainingTokens));
+ }
+
+ Opt::Opt(bool& ref) :
+ ParserRefImpl(std::make_shared<Detail::BoundFlagRef>(ref)) {}
+
+ std::vector<Detail::HelpColumns> Opt::getHelpColumns() const {
+ std::ostringstream oss;
+ bool first = true;
+ for (auto const& opt : m_optNames) {
+ if (first)
+ first = false;
+ else
+ oss << ", ";
+ oss << opt;
+ }
+ if (!m_hint.empty())
+ oss << " <" << m_hint << '>';
+ return { { oss.str(), m_description } };
+ }
+
+ bool Opt::isMatch(std::string const& optToken) const {
+ auto normalisedToken = normaliseOpt(optToken);
+ for (auto const& name : m_optNames) {
+ if (normaliseOpt(name) == normalisedToken)
+ return true;
+ }
+ return false;
+ }
+
+ Detail::InternalParseResult Opt::parse(std::string const&,
+ Detail::TokenStream const& tokens) const {
+ auto validationResult = validate();
+ if (!validationResult)
+ return Detail::InternalParseResult(validationResult);
+
+ auto remainingTokens = tokens;
+ if (remainingTokens &&
+ remainingTokens->type == Detail::TokenType::Option) {
+ auto const& token = *remainingTokens;
+ if (isMatch(token.token)) {
+ if (m_ref->isFlag()) {
+ auto flagRef =
+ static_cast<Detail::BoundFlagRefBase*>(
+ m_ref.get());
+ auto result = flagRef->setFlag(true);
+ if (!result)
+ return Detail::InternalParseResult(result);
+ if (result.value() ==
+ ParseResultType::ShortCircuitAll)
+ return Detail::InternalParseResult::ok(Detail::ParseState(
+ result.value(), remainingTokens));
+ } else {
+ auto valueRef =
+ static_cast<Detail::BoundValueRefBase*>(
+ m_ref.get());
+ ++remainingTokens;
+ if (!remainingTokens)
+ return Detail::InternalParseResult::runtimeError(
+ "Expected argument following " +
+ token.token);
+ auto const& argToken = *remainingTokens;
+ if (argToken.type != Detail::TokenType::Argument)
+ return Detail::InternalParseResult::runtimeError(
+ "Expected argument following " +
+ token.token);
+ const auto result = valueRef->setValue(argToken.token);
+ if (!result)
+ return Detail::InternalParseResult(result);
+ if (result.value() ==
+ ParseResultType::ShortCircuitAll)
+ return Detail::InternalParseResult::ok(Detail::ParseState(
+ result.value(), remainingTokens));
+ }
+ return Detail::InternalParseResult::ok(Detail::ParseState(
+ ParseResultType::Matched, ++remainingTokens));
+ }
+ }
+ return Detail::InternalParseResult::ok(
+ Detail::ParseState(ParseResultType::NoMatch, remainingTokens));
+ }
+
+ Detail::Result Opt::validate() const {
+ if (m_optNames.empty())
+ return Detail::Result::logicError("No options supplied to Opt");
+ for (auto const& name : m_optNames) {
+ if (name.empty())
+ return Detail::Result::logicError(
+ "Option name cannot be empty");
+#ifdef CATCH_PLATFORM_WINDOWS
+ if (name[0] != '-' && name[0] != '/')
+ return Detail::Result::logicError(
+ "Option name must begin with '-' or '/'");
+#else
+ if (name[0] != '-')
+ return Detail::Result::logicError(
+ "Option name must begin with '-'");
+#endif
+ }
+ return ParserRefImpl::validate();
+ }
+
+ ExeName::ExeName() :
+ m_name(std::make_shared<std::string>("<executable>")) {}
+
+ ExeName::ExeName(std::string& ref) : ExeName() {
+ m_ref = std::make_shared<Detail::BoundValueRef<std::string>>(ref);
+ }
+
+ Detail::InternalParseResult
+ ExeName::parse(std::string const&,
+ Detail::TokenStream const& tokens) const {
+ return Detail::InternalParseResult::ok(
+ Detail::ParseState(ParseResultType::NoMatch, tokens));
+ }
+
+ ParserResult ExeName::set(std::string const& newName) {
+ auto lastSlash = newName.find_last_of("\\/");
+ auto filename = (lastSlash == std::string::npos)
+ ? newName
+ : newName.substr(lastSlash + 1);
+
+ *m_name = filename;
+ if (m_ref)
+ return m_ref->setValue(filename);
+ else
+ return ParserResult::ok(ParseResultType::Matched);
+ }
+
+
+
+
+ Parser& Parser::operator|=( Parser const& other ) {
+ m_options.insert( m_options.end(),
+ other.m_options.begin(),
+ other.m_options.end() );
+ m_args.insert(
+ m_args.end(), other.m_args.begin(), other.m_args.end() );
+ return *this;
+ }
+
+ std::vector<Detail::HelpColumns> Parser::getHelpColumns() const {
+ std::vector<Detail::HelpColumns> cols;
+ for ( auto const& o : m_options ) {
+ auto childCols = o.getHelpColumns();
+ cols.insert( cols.end(), childCols.begin(), childCols.end() );
+ }
+ return cols;
+ }
+
+ void Parser::writeToStream( std::ostream& os ) const {
+ if ( !m_exeName.name().empty() ) {
+ os << "usage:\n"
+ << " " << m_exeName.name() << ' ';
+ bool required = true, first = true;
+ for ( auto const& arg : m_args ) {
+ if ( first )
+ first = false;
+ else
+ os << ' ';
+ if ( arg.isOptional() && required ) {
+ os << '[';
+ required = false;
+ }
+ os << '<' << arg.hint() << '>';
+ if ( arg.cardinality() == 0 )
+ os << " ... ";
+ }
+ if ( !required )
+ os << ']';
+ if ( !m_options.empty() )
+ os << " options";
+ os << "\n\nwhere options are:\n";
+ }
+
+ auto rows = getHelpColumns();
+ size_t consoleWidth = CATCH_CONFIG_CONSOLE_WIDTH;
+ size_t optWidth = 0;
+ for ( auto const& cols : rows )
+ optWidth = ( std::max )( optWidth, cols.left.size() + 2 );
+
+ optWidth = ( std::min )( optWidth, consoleWidth / 2 );
+
+ for ( auto const& cols : rows ) {
+ auto row = TextFlow::Column( cols.left )
+ .width( optWidth )
+ .indent( 2 ) +
+ TextFlow::Spacer( 4 ) +
+ TextFlow::Column( cols.right )
+ .width( consoleWidth - 7 - optWidth );
+ os << row << '\n';
+ }
+ }
+
+ Detail::Result Parser::validate() const {
+ for ( auto const& opt : m_options ) {
+ auto result = opt.validate();
+ if ( !result )
+ return result;
+ }
+ for ( auto const& arg : m_args ) {
+ auto result = arg.validate();
+ if ( !result )
+ return result;
+ }
+ return Detail::Result::ok();
+ }
+
+ Detail::InternalParseResult
+ Parser::parse( std::string const& exeName,
+ Detail::TokenStream const& tokens ) const {
+
+ struct ParserInfo {
+ ParserBase const* parser = nullptr;
+ size_t count = 0;
+ };
+ std::vector<ParserInfo> parseInfos;
+ parseInfos.reserve( m_options.size() + m_args.size() );
+ for ( auto const& opt : m_options ) {
+ parseInfos.push_back( { &opt, 0 } );
+ }
+ for ( auto const& arg : m_args ) {
+ parseInfos.push_back( { &arg, 0 } );
+ }
+
+ m_exeName.set( exeName );
+
+ auto result = Detail::InternalParseResult::ok(
+ Detail::ParseState( ParseResultType::NoMatch, tokens ) );
+ while ( result.value().remainingTokens() ) {
+ bool tokenParsed = false;
+
+ for ( auto& parseInfo : parseInfos ) {
+ if ( parseInfo.parser->cardinality() == 0 ||
+ parseInfo.count < parseInfo.parser->cardinality() ) {
+ result = parseInfo.parser->parse(
+ exeName, result.value().remainingTokens() );
+ if ( !result )
+ return result;
+ if ( result.value().type() !=
+ ParseResultType::NoMatch ) {
+ tokenParsed = true;
+ ++parseInfo.count;
+ break;
+ }
+ }
+ }
+
+ if ( result.value().type() == ParseResultType::ShortCircuitAll )
+ return result;
+ if ( !tokenParsed )
+ return Detail::InternalParseResult::runtimeError(
+ "Unrecognised token: " +
+ result.value().remainingTokens()->token );
+ }
+ // !TBD Check missing required options
+ return result;
+ }
+
+ Args::Args(int argc, char const* const* argv) :
+ m_exeName(argv[0]), m_args(argv + 1, argv + argc) {}
+
+ Args::Args(std::initializer_list<std::string> args) :
+ m_exeName(*args.begin()),
+ m_args(args.begin() + 1, args.end()) {}
+
+
+ Help::Help( bool& showHelpFlag ):
+ Opt( [&]( bool flag ) {
+ showHelpFlag = flag;
+ return ParserResult::ok( ParseResultType::ShortCircuitAll );
+ } ) {
+ static_cast<Opt&> ( *this )(
+ "display usage information" )["-?"]["-h"]["--help"]
+ .optional();
+ }
+
+ } // namespace Clara
+} // namespace Catch
+
+
+
+
+#include <fstream>
+#include <string>
+
+namespace Catch {
+
+ Clara::Parser makeCommandLineParser( ConfigData& config ) {
+
+ using namespace Clara;
+
+ auto const setWarning = [&]( std::string const& warning ) {
+ if ( warning == "NoAssertions" ) {
+ config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::NoAssertions);
+ return ParserResult::ok( ParseResultType::Matched );
+ } else if ( warning == "UnmatchedTestSpec" ) {
+ config.warnings = static_cast<WarnAbout::What>(config.warnings | WarnAbout::UnmatchedTestSpec);
+ return ParserResult::ok( ParseResultType::Matched );
+ }
+
+ return ParserResult ::runtimeError(
+ "Unrecognised warning option: '" + warning + '\'' );
+ };
+ auto const loadTestNamesFromFile = [&]( std::string const& filename ) {
+ std::ifstream f( filename.c_str() );
+ if( !f.is_open() )
+ return ParserResult::runtimeError( "Unable to load input file: '" + filename + '\'' );
+
+ std::string line;
+ while( std::getline( f, line ) ) {
+ line = trim(line);
+ if( !line.empty() && !startsWith( line, '#' ) ) {
+ if( !startsWith( line, '"' ) )
+ line = '"' + line + '"';
+ config.testsOrTags.push_back( line );
+ config.testsOrTags.emplace_back( "," );
+ }
+ }
+ //Remove comma in the end
+ if(!config.testsOrTags.empty())
+ config.testsOrTags.erase( config.testsOrTags.end()-1 );
+
+ return ParserResult::ok( ParseResultType::Matched );
+ };
+ auto const setTestOrder = [&]( std::string const& order ) {
+ if( startsWith( "declared", order ) )
+ config.runOrder = TestRunOrder::Declared;
+ else if( startsWith( "lexical", order ) )
+ config.runOrder = TestRunOrder::LexicographicallySorted;
+ else if( startsWith( "random", order ) )
+ config.runOrder = TestRunOrder::Randomized;
+ else
+ return ParserResult::runtimeError( "Unrecognised ordering: '" + order + '\'' );
+ return ParserResult::ok( ParseResultType::Matched );
+ };
+ auto const setRngSeed = [&]( std::string const& seed ) {
+ if( seed == "time" ) {
+ config.rngSeed = generateRandomSeed(GenerateFrom::Time);
+ return ParserResult::ok(ParseResultType::Matched);
+ } else if (seed == "random-device") {
+ config.rngSeed = generateRandomSeed(GenerateFrom::RandomDevice);
+ return ParserResult::ok(ParseResultType::Matched);
+ }
+
+ CATCH_TRY {
+ std::size_t parsedTo = 0;
+ unsigned long parsedSeed = std::stoul(seed, &parsedTo, 0);
+ if (parsedTo != seed.size()) {
+ return ParserResult::runtimeError("Could not parse '" + seed + "' as seed");
+ }
+
+ // TODO: Ideally we could parse unsigned int directly,
+ // but the stdlib doesn't provide helper for that
+ // type. After this is refactored to use fixed size
+ // type, we should check the parsed value is in range
+ // of the underlying type.
+ config.rngSeed = static_cast<unsigned int>(parsedSeed);
+ return ParserResult::ok(ParseResultType::Matched);
+ } CATCH_CATCH_ANON(std::exception const&) {
+ return ParserResult::runtimeError("Could not parse '" + seed + "' as seed");
+ }
+ };
+ auto const setDefaultColourMode = [&]( std::string const& colourMode ) {
+ Optional<ColourMode> maybeMode = Catch::Detail::stringToColourMode(toLower( colourMode ));
+ if ( !maybeMode ) {
+ return ParserResult::runtimeError(
+ "colour mode must be one of: default, ansi, win32, "
+ "or none. '" +
+ colourMode + "' is not recognised" );
+ }
+ auto mode = *maybeMode;
+ if ( !isColourImplAvailable( mode ) ) {
+ return ParserResult::runtimeError(
+ "colour mode '" + colourMode +
+ "' is not supported in this binary" );
+ }
+ config.defaultColourMode = mode;
+ return ParserResult::ok( ParseResultType::Matched );
+ };
+ auto const setWaitForKeypress = [&]( std::string const& keypress ) {
+ auto keypressLc = toLower( keypress );
+ if (keypressLc == "never")
+ config.waitForKeypress = WaitForKeypress::Never;
+ else if( keypressLc == "start" )
+ config.waitForKeypress = WaitForKeypress::BeforeStart;
+ else if( keypressLc == "exit" )
+ config.waitForKeypress = WaitForKeypress::BeforeExit;
+ else if( keypressLc == "both" )
+ config.waitForKeypress = WaitForKeypress::BeforeStartAndExit;
+ else
+ return ParserResult::runtimeError( "keypress argument must be one of: never, start, exit or both. '" + keypress + "' not recognised" );
+ return ParserResult::ok( ParseResultType::Matched );
+ };
+ auto const setVerbosity = [&]( std::string const& verbosity ) {
+ auto lcVerbosity = toLower( verbosity );
+ if( lcVerbosity == "quiet" )
+ config.verbosity = Verbosity::Quiet;
+ else if( lcVerbosity == "normal" )
+ config.verbosity = Verbosity::Normal;
+ else if( lcVerbosity == "high" )
+ config.verbosity = Verbosity::High;
+ else
+ return ParserResult::runtimeError( "Unrecognised verbosity, '" + verbosity + '\'' );
+ return ParserResult::ok( ParseResultType::Matched );
+ };
+ auto const setReporter = [&]( std::string const& userReporterSpec ) {
+ if ( userReporterSpec.empty() ) {
+ return ParserResult::runtimeError( "Received empty reporter spec." );
+ }
+
+ Optional<ReporterSpec> parsed =
+ parseReporterSpec( userReporterSpec );
+ if ( !parsed ) {
+ return ParserResult::runtimeError(
+ "Could not parse reporter spec '" + userReporterSpec +
+ "'" );
+ }
+
+ auto const& reporterSpec = *parsed;
+
+ IReporterRegistry::FactoryMap const& factories =
+ getRegistryHub().getReporterRegistry().getFactories();
+ auto result = factories.find( reporterSpec.name() );
+
+ if ( result == factories.end() ) {
+ return ParserResult::runtimeError(
+ "Unrecognized reporter, '" + reporterSpec.name() +
+ "'. Check available with --list-reporters" );
+ }
+
+
+ const bool hadOutputFile = reporterSpec.outputFile().some();
+ config.reporterSpecifications.push_back( CATCH_MOVE( *parsed ) );
+ // It would be enough to check this only once at the very end, but
+ // there is not a place where we could call this check, so do it
+ // every time it could fail. For valid inputs, this is still called
+ // at most once.
+ if (!hadOutputFile) {
+ int n_reporters_without_file = 0;
+ for (auto const& spec : config.reporterSpecifications) {
+ if (spec.outputFile().none()) {
+ n_reporters_without_file++;
+ }
+ }
+ if (n_reporters_without_file > 1) {
+ return ParserResult::runtimeError( "Only one reporter may have unspecified output file." );
+ }
+ }
+
+ return ParserResult::ok( ParseResultType::Matched );
+ };
+ auto const setShardCount = [&]( std::string const& shardCount ) {
+ CATCH_TRY{
+ std::size_t parsedTo = 0;
+ int64_t parsedCount = std::stoll(shardCount, &parsedTo, 0);
+ if (parsedTo != shardCount.size()) {
+ return ParserResult::runtimeError("Could not parse '" + shardCount + "' as shard count");
+ }
+ if (parsedCount <= 0) {
+ return ParserResult::runtimeError("Shard count must be a positive number");
+ }
+
+ config.shardCount = static_cast<unsigned int>(parsedCount);
+ return ParserResult::ok(ParseResultType::Matched);
+ } CATCH_CATCH_ANON(std::exception const&) {
+ return ParserResult::runtimeError("Could not parse '" + shardCount + "' as shard count");
+ }
+ };
+
+ auto const setShardIndex = [&](std::string const& shardIndex) {
+ CATCH_TRY{
+ std::size_t parsedTo = 0;
+ int64_t parsedIndex = std::stoll(shardIndex, &parsedTo, 0);
+ if (parsedTo != shardIndex.size()) {
+ return ParserResult::runtimeError("Could not parse '" + shardIndex + "' as shard index");
+ }
+ if (parsedIndex < 0) {
+ return ParserResult::runtimeError("Shard index must be a non-negative number");
+ }
+
+ config.shardIndex = static_cast<unsigned int>(parsedIndex);
+ return ParserResult::ok(ParseResultType::Matched);
+ } CATCH_CATCH_ANON(std::exception const&) {
+ return ParserResult::runtimeError("Could not parse '" + shardIndex + "' as shard index");
+ }
+ };
+
+
+ auto cli
+ = ExeName( config.processName )
+ | Help( config.showHelp )
+ | Opt( config.showSuccessfulTests )
+ ["-s"]["--success"]
+ ( "include successful tests in output" )
+ | Opt( config.shouldDebugBreak )
+ ["-b"]["--break"]
+ ( "break into debugger on failure" )
+ | Opt( config.noThrow )
+ ["-e"]["--nothrow"]
+ ( "skip exception tests" )
+ | Opt( config.showInvisibles )
+ ["-i"]["--invisibles"]
+ ( "show invisibles (tabs, newlines)" )
+ | Opt( config.defaultOutputFilename, "filename" )
+ ["-o"]["--out"]
+ ( "default output filename" )
+ | Opt( accept_many, setReporter, "name[::key=value]*" )
+ ["-r"]["--reporter"]
+ ( "reporter to use (defaults to console)" )
+ | Opt( config.name, "name" )
+ ["-n"]["--name"]
+ ( "suite name" )
+ | Opt( [&]( bool ){ config.abortAfter = 1; } )
+ ["-a"]["--abort"]
+ ( "abort at first failure" )
+ | Opt( [&]( int x ){ config.abortAfter = x; }, "no. failures" )
+ ["-x"]["--abortx"]
+ ( "abort after x failures" )
+ | Opt( accept_many, setWarning, "warning name" )
+ ["-w"]["--warn"]
+ ( "enable warnings" )
+ | Opt( [&]( bool flag ) { config.showDurations = flag ? ShowDurations::Always : ShowDurations::Never; }, "yes|no" )
+ ["-d"]["--durations"]
+ ( "show test durations" )
+ | Opt( config.minDuration, "seconds" )
+ ["-D"]["--min-duration"]
+ ( "show test durations for tests taking at least the given number of seconds" )
+ | Opt( loadTestNamesFromFile, "filename" )
+ ["-f"]["--input-file"]
+ ( "load test names to run from a file" )
+ | Opt( config.filenamesAsTags )
+ ["-#"]["--filenames-as-tags"]
+ ( "adds a tag for the filename" )
+ | Opt( config.sectionsToRun, "section name" )
+ ["-c"]["--section"]
+ ( "specify section to run" )
+ | Opt( setVerbosity, "quiet|normal|high" )
+ ["-v"]["--verbosity"]
+ ( "set output verbosity" )
+ | Opt( config.listTests )
+ ["--list-tests"]
+ ( "list all/matching test cases" )
+ | Opt( config.listTags )
+ ["--list-tags"]
+ ( "list all/matching tags" )
+ | Opt( config.listReporters )
+ ["--list-reporters"]
+ ( "list all available reporters" )
+ | Opt( config.listListeners )
+ ["--list-listeners"]
+ ( "list all listeners" )
+ | Opt( setTestOrder, "decl|lex|rand" )
+ ["--order"]
+ ( "test case order (defaults to decl)" )
+ | Opt( setRngSeed, "'time'|'random-device'|number" )
+ ["--rng-seed"]
+ ( "set a specific seed for random numbers" )
+ | Opt( setDefaultColourMode, "ansi|win32|none|default" )
+ ["--colour-mode"]
+ ( "what color mode should be used as default" )
+ | Opt( config.libIdentify )
+ ["--libidentify"]
+ ( "report name and version according to libidentify standard" )
+ | Opt( setWaitForKeypress, "never|start|exit|both" )
+ ["--wait-for-keypress"]
+ ( "waits for a keypress before exiting" )
+ | Opt( config.skipBenchmarks)
+ ["--skip-benchmarks"]
+ ( "disable running benchmarks")
+ | Opt( config.benchmarkSamples, "samples" )
+ ["--benchmark-samples"]
+ ( "number of samples to collect (default: 100)" )
+ | Opt( config.benchmarkResamples, "resamples" )
+ ["--benchmark-resamples"]
+ ( "number of resamples for the bootstrap (default: 100000)" )
+ | Opt( config.benchmarkConfidenceInterval, "confidence interval" )
+ ["--benchmark-confidence-interval"]
+ ( "confidence interval for the bootstrap (between 0 and 1, default: 0.95)" )
+ | Opt( config.benchmarkNoAnalysis )
+ ["--benchmark-no-analysis"]
+ ( "perform only measurements; do not perform any analysis" )
+ | Opt( config.benchmarkWarmupTime, "benchmarkWarmupTime" )
+ ["--benchmark-warmup-time"]
+ ( "amount of time in milliseconds spent on warming up each test (default: 100)" )
+ | Opt( setShardCount, "shard count" )
+ ["--shard-count"]
+ ( "split the tests to execute into this many groups" )
+ | Opt( setShardIndex, "shard index" )
+ ["--shard-index"]
+ ( "index of the group of tests to execute (see --shard-count)" ) |
+ Opt( config.allowZeroTests )
+ ["--allow-running-no-tests"]
+ ( "Treat 'No tests run' as a success" )
+ | Arg( config.testsOrTags, "test name|pattern|tags" )
+ ( "which test or tests to use" );
+
+ return cli;
+ }
+
+} // end namespace Catch
+
+
+#if defined(__clang__)
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wexit-time-destructors"
+#endif
+
+
+
+#include <cassert>
+#include <ostream>
+#include <utility>
+
+namespace Catch {
+
+ ColourImpl::~ColourImpl() = default;
+
+ ColourImpl::ColourGuard ColourImpl::guardColour( Colour::Code colourCode ) {
+ return ColourGuard(colourCode, this );
+ }
+
+ void ColourImpl::ColourGuard::engageImpl( std::ostream& stream ) {
+ assert( &stream == &m_colourImpl->m_stream->stream() &&
+ "Engaging colour guard for different stream than used by the "
+ "parent colour implementation" );
+ static_cast<void>( stream );
+
+ m_engaged = true;
+ m_colourImpl->use( m_code );
+ }
+
+ ColourImpl::ColourGuard::ColourGuard( Colour::Code code,
+ ColourImpl const* colour ):
+ m_colourImpl( colour ), m_code( code ) {
+ }
+ ColourImpl::ColourGuard::ColourGuard( ColourGuard&& rhs ) noexcept:
+ m_colourImpl( rhs.m_colourImpl ),
+ m_code( rhs.m_code ),
+ m_engaged( rhs.m_engaged ) {
+ rhs.m_engaged = false;
+ }
+ ColourImpl::ColourGuard&
+ ColourImpl::ColourGuard::operator=( ColourGuard&& rhs ) noexcept {
+ using std::swap;
+ swap( m_colourImpl, rhs.m_colourImpl );
+ swap( m_code, rhs.m_code );
+ swap( m_engaged, rhs.m_engaged );
+
+ return *this;
+ }
+ ColourImpl::ColourGuard::~ColourGuard() {
+ if ( m_engaged ) {
+ m_colourImpl->use( Colour::None );
+ }
+ }
+
+ ColourImpl::ColourGuard&
+ ColourImpl::ColourGuard::engage( std::ostream& stream ) & {
+ engageImpl( stream );
+ return *this;
+ }
+
+ ColourImpl::ColourGuard&&
+ ColourImpl::ColourGuard::engage( std::ostream& stream ) && {
+ engageImpl( stream );
+ return CATCH_MOVE(*this);
+ }
+
+ namespace {
+ //! A do-nothing implementation of colour, used as fallback for unknown
+ //! platforms, and when the user asks to deactivate all colours.
+ class NoColourImpl : public ColourImpl {
+ public:
+ NoColourImpl( IStream* stream ): ColourImpl( stream ) {}
+
+ private:
+ void use( Colour::Code ) const override {}
+ };
+ } // namespace
+
+
+} // namespace Catch
+
+
+#if defined ( CATCH_CONFIG_COLOUR_WIN32 ) /////////////////////////////////////////
+
+namespace Catch {
+namespace {
+
+ class Win32ColourImpl : public ColourImpl {
+ public:
+ Win32ColourImpl(IStream* stream):
+ ColourImpl(stream) {
+ CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
+ GetConsoleScreenBufferInfo( GetStdHandle( STD_OUTPUT_HANDLE ),
+ &csbiInfo );
+ originalForegroundAttributes = csbiInfo.wAttributes & ~( BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_INTENSITY );
+ originalBackgroundAttributes = csbiInfo.wAttributes & ~( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY );
+ }
+
+ static bool useImplementationForStream(IStream const& stream) {
+ // Win32 text colour APIs can only be used on console streams
+ // We cannot check that the output hasn't been redirected,
+ // so we just check that the original stream is console stream.
+ return stream.isConsole();
+ }
+
+ private:
+ void use( Colour::Code _colourCode ) const override {
+ switch( _colourCode ) {
+ case Colour::None: return setTextAttribute( originalForegroundAttributes );
+ case Colour::White: return setTextAttribute( FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
+ case Colour::Red: return setTextAttribute( FOREGROUND_RED );
+ case Colour::Green: return setTextAttribute( FOREGROUND_GREEN );
+ case Colour::Blue: return setTextAttribute( FOREGROUND_BLUE );
+ case Colour::Cyan: return setTextAttribute( FOREGROUND_BLUE | FOREGROUND_GREEN );
+ case Colour::Yellow: return setTextAttribute( FOREGROUND_RED | FOREGROUND_GREEN );
+ case Colour::Grey: return setTextAttribute( 0 );
+
+ case Colour::LightGrey: return setTextAttribute( FOREGROUND_INTENSITY );
+ case Colour::BrightRed: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED );
+ case Colour::BrightGreen: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN );
+ case Colour::BrightWhite: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_BLUE );
+ case Colour::BrightYellow: return setTextAttribute( FOREGROUND_INTENSITY | FOREGROUND_RED | FOREGROUND_GREEN );
+
+ case Colour::Bright: CATCH_INTERNAL_ERROR( "not a colour" );
+
+ default:
+ CATCH_ERROR( "Unknown colour requested" );
+ }
+ }
+
+ void setTextAttribute( WORD _textAttribute ) const {
+ SetConsoleTextAttribute( GetStdHandle( STD_OUTPUT_HANDLE ),
+ _textAttribute |
+ originalBackgroundAttributes );
+ }
+ WORD originalForegroundAttributes;
+ WORD originalBackgroundAttributes;
+ };
+
+} // end anon namespace
+} // end namespace Catch
+
+#endif // Windows/ ANSI/ None
+
+
+#if defined( CATCH_PLATFORM_LINUX ) || defined( CATCH_PLATFORM_MAC )
+# define CATCH_INTERNAL_HAS_ISATTY
+# include <unistd.h>
+#endif
+
+namespace Catch {
+namespace {
+
+ class ANSIColourImpl : public ColourImpl {
+ public:
+ ANSIColourImpl( IStream* stream ): ColourImpl( stream ) {}
+
+ static bool useImplementationForStream(IStream const& stream) {
+ // This is kinda messy due to trying to support a bunch of
+ // different platforms at once.
+ // The basic idea is that if we are asked to do autodetection (as
+ // opposed to being told to use posixy colours outright), then we
+ // only want to use the colours if we are writing to console.
+ // However, console might be redirected, so we make an attempt at
+ // checking for that on platforms where we know how to do that.
+ bool useColour = stream.isConsole();
+#if defined( CATCH_INTERNAL_HAS_ISATTY ) && \
+ !( defined( __DJGPP__ ) && defined( __STRICT_ANSI__ ) )
+ ErrnoGuard _; // for isatty
+ useColour = useColour && isatty( STDOUT_FILENO );
+# endif
+# if defined( CATCH_PLATFORM_MAC ) || defined( CATCH_PLATFORM_IPHONE )
+ useColour = useColour && !isDebuggerActive();
+# endif
+
+ return useColour;
+ }
+
+ private:
+ void use( Colour::Code _colourCode ) const override {
+ auto setColour = [&out =
+ m_stream->stream()]( char const* escapeCode ) {
+ // The escape sequence must be flushed to console, otherwise
+ // if stdin and stderr are intermixed, we'd get accidentally
+ // coloured output.
+ out << '\033' << escapeCode << std::flush;
+ };
+ switch( _colourCode ) {
+ case Colour::None:
+ case Colour::White: return setColour( "[0m" );
+ case Colour::Red: return setColour( "[0;31m" );
+ case Colour::Green: return setColour( "[0;32m" );
+ case Colour::Blue: return setColour( "[0;34m" );
+ case Colour::Cyan: return setColour( "[0;36m" );
+ case Colour::Yellow: return setColour( "[0;33m" );
+ case Colour::Grey: return setColour( "[1;30m" );
+
+ case Colour::LightGrey: return setColour( "[0;37m" );
+ case Colour::BrightRed: return setColour( "[1;31m" );
+ case Colour::BrightGreen: return setColour( "[1;32m" );
+ case Colour::BrightWhite: return setColour( "[1;37m" );
+ case Colour::BrightYellow: return setColour( "[1;33m" );
+
+ case Colour::Bright: CATCH_INTERNAL_ERROR( "not a colour" );
+ default: CATCH_INTERNAL_ERROR( "Unknown colour requested" );
+ }
+ }
+ };
+
+} // end anon namespace
+} // end namespace Catch
+
+namespace Catch {
+
+ Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode implSelection,
+ IStream* stream ) {
+#if defined( CATCH_CONFIG_COLOUR_WIN32 )
+ if ( implSelection == ColourMode::Win32 ) {
+ return Detail::make_unique<Win32ColourImpl>( stream );
+ }
+#endif
+ if ( implSelection == ColourMode::ANSI ) {
+ return Detail::make_unique<ANSIColourImpl>( stream );
+ }
+ if ( implSelection == ColourMode::None ) {
+ return Detail::make_unique<NoColourImpl>( stream );
+ }
+
+ if ( implSelection == ColourMode::PlatformDefault) {
+#if defined( CATCH_CONFIG_COLOUR_WIN32 )
+ if ( Win32ColourImpl::useImplementationForStream( *stream ) ) {
+ return Detail::make_unique<Win32ColourImpl>( stream );
+ }
+#endif
+ if ( ANSIColourImpl::useImplementationForStream( *stream ) ) {
+ return Detail::make_unique<ANSIColourImpl>( stream );
+ }
+ return Detail::make_unique<NoColourImpl>( stream );
+ }
+
+ CATCH_ERROR( "Could not create colour impl for selection " << static_cast<int>(implSelection) );
+ }
+
+ bool isColourImplAvailable( ColourMode colourSelection ) {
+ switch ( colourSelection ) {
+#if defined( CATCH_CONFIG_COLOUR_WIN32 )
+ case ColourMode::Win32:
+#endif
+ case ColourMode::ANSI:
+ case ColourMode::None:
+ case ColourMode::PlatformDefault:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+
+} // end namespace Catch
+
+#if defined(__clang__)
+# pragma clang diagnostic pop
+#endif
+
+
+
+
+namespace Catch {
+
+ class Context : public IMutableContext, private Detail::NonCopyable {
+
+ public: // IContext
+ IResultCapture* getResultCapture() override {
+ return m_resultCapture;
+ }
+
+ IConfig const* getConfig() const override {
+ return m_config;
+ }
+
+ ~Context() override;
+
+ public: // IMutableContext
+ void setResultCapture( IResultCapture* resultCapture ) override {
+ m_resultCapture = resultCapture;
+ }
+ void setConfig( IConfig const* config ) override {
+ m_config = config;
+ }
+
+ friend IMutableContext& getCurrentMutableContext();
+
+ private:
+ IConfig const* m_config = nullptr;
+ IResultCapture* m_resultCapture = nullptr;
+ };
+
+ IMutableContext *IMutableContext::currentContext = nullptr;
+
+ void IMutableContext::createContext()
+ {
+ currentContext = new Context();
+ }
+
+ void cleanUpContext() {
+ delete IMutableContext::currentContext;
+ IMutableContext::currentContext = nullptr;
+ }
+ IContext::~IContext() = default;
+ IMutableContext::~IMutableContext() = default;
+ Context::~Context() = default;
+
+
+ SimplePcg32& sharedRng() {
+ static SimplePcg32 s_rng;
+ return s_rng;
+ }
+
+}
+
+
+
+
+
+#include <ostream>
+
+#if defined(CATCH_CONFIG_ANDROID_LOGWRITE)
+#include <android/log.h>
+
+ namespace Catch {
+ void writeToDebugConsole( std::string const& text ) {
+ __android_log_write( ANDROID_LOG_DEBUG, "Catch", text.c_str() );
+ }
+ }
+
+#elif defined(CATCH_PLATFORM_WINDOWS)
+
+ namespace Catch {
+ void writeToDebugConsole( std::string const& text ) {
+ ::OutputDebugStringA( text.c_str() );
+ }
+ }
+
+#else
+
+ namespace Catch {
+ void writeToDebugConsole( std::string const& text ) {
+ // !TBD: Need a version for Mac/ XCode and other IDEs
+ Catch::cout() << text;
+ }
+ }
+
+#endif // Platform
+
+
+
+#if defined(CATCH_PLATFORM_MAC) || defined(CATCH_PLATFORM_IPHONE)
+
+# include <cassert>
+# include <sys/types.h>
+# include <unistd.h>
+# include <cstddef>
+# include <ostream>
+
+#ifdef __apple_build_version__
+ // These headers will only compile with AppleClang (XCode)
+ // For other compilers (Clang, GCC, ... ) we need to exclude them
+# include <sys/sysctl.h>
+#endif
+
+ namespace Catch {
+ #ifdef __apple_build_version__
+ // The following function is taken directly from the following technical note:
+ // https://developer.apple.com/library/archive/qa/qa1361/_index.html
+
+ // Returns true if the current process is being debugged (either
+ // running under the debugger or has a debugger attached post facto).
+ bool isDebuggerActive(){
+ int mib[4];
+ struct kinfo_proc info;
+ std::size_t size;
+
+ // Initialize the flags so that, if sysctl fails for some bizarre
+ // reason, we get a predictable result.
+
+ info.kp_proc.p_flag = 0;
+
+ // Initialize mib, which tells sysctl the info we want, in this case
+ // we're looking for information about a specific process ID.
+
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROC;
+ mib[2] = KERN_PROC_PID;
+ mib[3] = getpid();
+
+ // Call sysctl.
+
+ size = sizeof(info);
+ if( sysctl(mib, sizeof(mib) / sizeof(*mib), &info, &size, nullptr, 0) != 0 ) {
+ Catch::cerr() << "\n** Call to sysctl failed - unable to determine if debugger is active **\n\n" << std::flush;
+ return false;
+ }
+
+ // We're being debugged if the P_TRACED flag is set.
+
+ return ( (info.kp_proc.p_flag & P_TRACED) != 0 );
+ }
+ #else
+ bool isDebuggerActive() {
+ // We need to find another way to determine this for non-appleclang compilers on macOS
+ return false;
+ }
+ #endif
+ } // namespace Catch
+
+#elif defined(CATCH_PLATFORM_LINUX)
+ #include <fstream>
+ #include <string>
+
+ namespace Catch{
+ // The standard POSIX way of detecting a debugger is to attempt to
+ // ptrace() the process, but this needs to be done from a child and not
+ // this process itself to still allow attaching to this process later
+ // if wanted, so is rather heavy. Under Linux we have the PID of the
+ // "debugger" (which doesn't need to be gdb, of course, it could also
+ // be strace, for example) in /proc/$PID/status, so just get it from
+ // there instead.
+ bool isDebuggerActive(){
+ // Libstdc++ has a bug, where std::ifstream sets errno to 0
+ // This way our users can properly assert over errno values
+ ErrnoGuard guard;
+ std::ifstream in("/proc/self/status");
+ for( std::string line; std::getline(in, line); ) {
+ static const int PREFIX_LEN = 11;
+ if( line.compare(0, PREFIX_LEN, "TracerPid:\t") == 0 ) {
+ // We're traced if the PID is not 0 and no other PID starts
+ // with 0 digit, so it's enough to check for just a single
+ // character.
+ return line.length() > PREFIX_LEN && line[PREFIX_LEN] != '0';
+ }
+ }
+
+ return false;
+ }
+ } // namespace Catch
+#elif defined(_MSC_VER)
+ extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
+ namespace Catch {
+ bool isDebuggerActive() {
+ return IsDebuggerPresent() != 0;
+ }
+ }
+#elif defined(__MINGW32__)
+ extern "C" __declspec(dllimport) int __stdcall IsDebuggerPresent();
+ namespace Catch {
+ bool isDebuggerActive() {
+ return IsDebuggerPresent() != 0;
+ }
+ }
+#else
+ namespace Catch {
+ bool isDebuggerActive() { return false; }
+ }
+#endif // Platform
+
+
+
+
+namespace Catch {
+
+ ITransientExpression::~ITransientExpression() = default;
+
+ void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs ) {
+ if( lhs.size() + rhs.size() < 40 &&
+ lhs.find('\n') == std::string::npos &&
+ rhs.find('\n') == std::string::npos )
+ os << lhs << ' ' << op << ' ' << rhs;
+ else
+ os << lhs << '\n' << op << '\n' << rhs;
+ }
+}
+
+
+
+#include <stdexcept>
+
+
+namespace Catch {
+#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS) && !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS_CUSTOM_HANDLER)
+ [[noreturn]]
+ void throw_exception(std::exception const& e) {
+ Catch::cerr() << "Catch will terminate because it needed to throw an exception.\n"
+ << "The message was: " << e.what() << '\n';
+ std::terminate();
+ }
+#endif
+
+ [[noreturn]]
+ void throw_logic_error(std::string const& msg) {
+ throw_exception(std::logic_error(msg));
+ }
+
+ [[noreturn]]
+ void throw_domain_error(std::string const& msg) {
+ throw_exception(std::domain_error(msg));
+ }
+
+ [[noreturn]]
+ void throw_runtime_error(std::string const& msg) {
+ throw_exception(std::runtime_error(msg));
+ }
+
+
+
+} // namespace Catch;
+
+
+
+#include <cassert>
+
+namespace Catch {
+
+ IMutableEnumValuesRegistry::~IMutableEnumValuesRegistry() = default;
+
+ namespace Detail {
+
+ namespace {
+ // Extracts the actual name part of an enum instance
+ // In other words, it returns the Blue part of Bikeshed::Colour::Blue
+ StringRef extractInstanceName(StringRef enumInstance) {
+ // Find last occurrence of ":"
+ size_t name_start = enumInstance.size();
+ while (name_start > 0 && enumInstance[name_start - 1] != ':') {
+ --name_start;
+ }
+ return enumInstance.substr(name_start, enumInstance.size() - name_start);
+ }
+ }
+
+ std::vector<StringRef> parseEnums( StringRef enums ) {
+ auto enumValues = splitStringRef( enums, ',' );
+ std::vector<StringRef> parsed;
+ parsed.reserve( enumValues.size() );
+ for( auto const& enumValue : enumValues ) {
+ parsed.push_back(trim(extractInstanceName(enumValue)));
+ }
+ return parsed;
+ }
+
+ EnumInfo::~EnumInfo() {}
+
+ StringRef EnumInfo::lookup( int value ) const {
+ for( auto const& valueToName : m_values ) {
+ if( valueToName.first == value )
+ return valueToName.second;
+ }
+ return "{** unexpected enum value **}"_sr;
+ }
+
+ Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
+ auto enumInfo = Catch::Detail::make_unique<EnumInfo>();
+ enumInfo->m_name = enumName;
+ enumInfo->m_values.reserve( values.size() );
+
+ const auto valueNames = Catch::Detail::parseEnums( allValueNames );
+ assert( valueNames.size() == values.size() );
+ std::size_t i = 0;
+ for( auto value : values )
+ enumInfo->m_values.emplace_back(value, valueNames[i++]);
+
+ return enumInfo;
+ }
+
+ EnumInfo const& EnumValuesRegistry::registerEnum( StringRef enumName, StringRef allValueNames, std::vector<int> const& values ) {
+ m_enumInfos.push_back(makeEnumInfo(enumName, allValueNames, values));
+ return *m_enumInfos.back();
+ }
+
+ } // Detail
+} // Catch
+
+
+
+
+
+#include <cerrno>
+
+namespace Catch {
+ ErrnoGuard::ErrnoGuard():m_oldErrno(errno){}
+ ErrnoGuard::~ErrnoGuard() { errno = m_oldErrno; }
+}
+
+
+
+namespace Catch {
+
+ ExceptionTranslatorRegistry::~ExceptionTranslatorRegistry() {
+ }
+
+ void ExceptionTranslatorRegistry::registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ) {
+ m_translators.push_back( CATCH_MOVE( translator ) );
+ }
+
+#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+ std::string ExceptionTranslatorRegistry::translateActiveException() const {
+ // Compiling a mixed mode project with MSVC means that CLR
+ // exceptions will be caught in (...) as well. However, these do
+ // do not fill-in std::current_exception and thus lead to crash
+ // when attempting rethrow.
+ // /EHa switch also causes structured exceptions to be caught
+ // here, but they fill-in current_exception properly, so
+ // at worst the output should be a little weird, instead of
+ // causing a crash.
+ if ( std::current_exception() == nullptr ) {
+ return "Non C++ exception. Possibly a CLR exception.";
+ }
+
+ // First we try user-registered translators. If none of them can
+ // handle the exception, it will be rethrown handled by our defaults.
+ try {
+ return tryTranslators();
+ }
+ // To avoid having to handle TFE explicitly everywhere, we just
+ // rethrow it so that it goes back up the caller.
+ catch( TestFailureException& ) {
+ std::rethrow_exception(std::current_exception());
+ }
+ catch( std::exception const& ex ) {
+ return ex.what();
+ }
+ catch( std::string const& msg ) {
+ return msg;
+ }
+ catch( const char* msg ) {
+ return msg;
+ }
+ catch(...) {
+ return "Unknown exception";
+ }
+ }
+
+ std::string ExceptionTranslatorRegistry::tryTranslators() const {
+ if (m_translators.empty()) {
+ std::rethrow_exception(std::current_exception());
+ } else {
+ return m_translators[0]->translate(m_translators.begin() + 1, m_translators.end());
+ }
+ }
+
+#else // ^^ Exceptions are enabled // Exceptions are disabled vv
+ std::string ExceptionTranslatorRegistry::translateActiveException() const {
+ CATCH_INTERNAL_ERROR("Attempted to translate active exception under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
+ }
+
+ std::string ExceptionTranslatorRegistry::tryTranslators() const {
+ CATCH_INTERNAL_ERROR("Attempted to use exception translators under CATCH_CONFIG_DISABLE_EXCEPTIONS!");
+ }
+#endif
+
+
+}
+
+
+
+/** \file
+ * This file provides platform specific implementations of FatalConditionHandler
+ *
+ * This means that there is a lot of conditional compilation, and platform
+ * specific code. Currently, Catch2 supports a dummy handler (if no
+ * handler is desired), and 2 platform specific handlers:
+ * * Windows' SEH
+ * * POSIX signals
+ *
+ * Consequently, various pieces of code below are compiled if either of
+ * the platform specific handlers is enabled, or if none of them are
+ * enabled. It is assumed that both cannot be enabled at the same time,
+ * and doing so should cause a compilation error.
+ *
+ * If another platform specific handler is added, the compile guards
+ * below will need to be updated taking these assumptions into account.
+ */
+
+
+
+#include <algorithm>
+
+#if !defined( CATCH_CONFIG_WINDOWS_SEH ) && !defined( CATCH_CONFIG_POSIX_SIGNALS )
+
+namespace Catch {
+
+ // If neither SEH nor signal handling is required, the handler impls
+ // do not have to do anything, and can be empty.
+ void FatalConditionHandler::engage_platform() {}
+ void FatalConditionHandler::disengage_platform() noexcept {}
+ FatalConditionHandler::FatalConditionHandler() = default;
+ FatalConditionHandler::~FatalConditionHandler() = default;
+
+} // end namespace Catch
+
+#endif // !CATCH_CONFIG_WINDOWS_SEH && !CATCH_CONFIG_POSIX_SIGNALS
+
+#if defined( CATCH_CONFIG_WINDOWS_SEH ) && defined( CATCH_CONFIG_POSIX_SIGNALS )
+#error "Inconsistent configuration: Windows' SEH handling and POSIX signals cannot be enabled at the same time"
+#endif // CATCH_CONFIG_WINDOWS_SEH && CATCH_CONFIG_POSIX_SIGNALS
+
+#if defined( CATCH_CONFIG_WINDOWS_SEH ) || defined( CATCH_CONFIG_POSIX_SIGNALS )
+
+namespace {
+ //! Signals fatal error message to the run context
+ void reportFatal( char const * const message ) {
+ Catch::getCurrentContext().getResultCapture()->handleFatalErrorCondition( message );
+ }
+
+ //! Minimal size Catch2 needs for its own fatal error handling.
+ //! Picked empirically, so it might not be sufficient on all
+ //! platforms, and for all configurations.
+ constexpr std::size_t minStackSizeForErrors = 32 * 1024;
+} // end unnamed namespace
+
+#endif // CATCH_CONFIG_WINDOWS_SEH || CATCH_CONFIG_POSIX_SIGNALS
+
+#if defined( CATCH_CONFIG_WINDOWS_SEH )
+
+namespace Catch {
+
+ struct SignalDefs { DWORD id; const char* name; };
+
+ // There is no 1-1 mapping between signals and windows exceptions.
+ // Windows can easily distinguish between SO and SigSegV,
+ // but SigInt, SigTerm, etc are handled differently.
+ static SignalDefs signalDefs[] = {
+ { EXCEPTION_ILLEGAL_INSTRUCTION, "SIGILL - Illegal instruction signal" },
+ { EXCEPTION_STACK_OVERFLOW, "SIGSEGV - Stack overflow" },
+ { EXCEPTION_ACCESS_VIOLATION, "SIGSEGV - Segmentation violation signal" },
+ { EXCEPTION_INT_DIVIDE_BY_ZERO, "Divide by zero error" },
+ };
+
+ static LONG CALLBACK topLevelExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo) {
+ for (auto const& def : signalDefs) {
+ if (ExceptionInfo->ExceptionRecord->ExceptionCode == def.id) {
+ reportFatal(def.name);
+ }
+ }
+ // If its not an exception we care about, pass it along.
+ // This stops us from eating debugger breaks etc.
+ return EXCEPTION_CONTINUE_SEARCH;
+ }
+
+ // Since we do not support multiple instantiations, we put these
+ // into global variables and rely on cleaning them up in outlined
+ // constructors/destructors
+ static LPTOP_LEVEL_EXCEPTION_FILTER previousTopLevelExceptionFilter = nullptr;
+
+
+ // For MSVC, we reserve part of the stack memory for handling
+ // memory overflow structured exception.
+ FatalConditionHandler::FatalConditionHandler() {
+ ULONG guaranteeSize = static_cast<ULONG>(minStackSizeForErrors);
+ if (!SetThreadStackGuarantee(&guaranteeSize)) {
+ // We do not want to fully error out, because needing
+ // the stack reserve should be rare enough anyway.
+ Catch::cerr()
+ << "Failed to reserve piece of stack."
+ << " Stack overflows will not be reported successfully.";
+ }
+ }
+
+ // We do not attempt to unset the stack guarantee, because
+ // Windows does not support lowering the stack size guarantee.
+ FatalConditionHandler::~FatalConditionHandler() = default;
+
+
+ void FatalConditionHandler::engage_platform() {
+ // Register as a the top level exception filter.
+ previousTopLevelExceptionFilter = SetUnhandledExceptionFilter(topLevelExceptionFilter);
+ }
+
+ void FatalConditionHandler::disengage_platform() noexcept {
+ if (SetUnhandledExceptionFilter(previousTopLevelExceptionFilter) != topLevelExceptionFilter) {
+ Catch::cerr()
+ << "Unexpected SEH unhandled exception filter on disengage."
+ << " The filter was restored, but might be rolled back unexpectedly.";
+ }
+ previousTopLevelExceptionFilter = nullptr;
+ }
+
+} // end namespace Catch
+
+#endif // CATCH_CONFIG_WINDOWS_SEH
+
+#if defined( CATCH_CONFIG_POSIX_SIGNALS )
+
+#include <signal.h>
+
+namespace Catch {
+
+ struct SignalDefs {
+ int id;
+ const char* name;
+ };
+
+ static SignalDefs signalDefs[] = {
+ { SIGINT, "SIGINT - Terminal interrupt signal" },
+ { SIGILL, "SIGILL - Illegal instruction signal" },
+ { SIGFPE, "SIGFPE - Floating point error signal" },
+ { SIGSEGV, "SIGSEGV - Segmentation violation signal" },
+ { SIGTERM, "SIGTERM - Termination request signal" },
+ { SIGABRT, "SIGABRT - Abort (abnormal termination) signal" }
+ };
+
+// Older GCCs trigger -Wmissing-field-initializers for T foo = {}
+// which is zero initialization, but not explicit. We want to avoid
+// that.
+#if defined(__GNUC__)
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wmissing-field-initializers"
+#endif
+
+ static char* altStackMem = nullptr;
+ static std::size_t altStackSize = 0;
+ static stack_t oldSigStack{};
+ static struct sigaction oldSigActions[sizeof(signalDefs) / sizeof(SignalDefs)]{};
+
+ static void restorePreviousSignalHandlers() noexcept {
+ // We set signal handlers back to the previous ones. Hopefully
+ // nobody overwrote them in the meantime, and doesn't expect
+ // their signal handlers to live past ours given that they
+ // installed them after ours..
+ for (std::size_t i = 0; i < sizeof(signalDefs) / sizeof(SignalDefs); ++i) {
+ sigaction(signalDefs[i].id, &oldSigActions[i], nullptr);
+ }
+ // Return the old stack
+ sigaltstack(&oldSigStack, nullptr);
+ }
+
+ static void handleSignal( int sig ) {
+ char const * name = "<unknown signal>";
+ for (auto const& def : signalDefs) {
+ if (sig == def.id) {
+ name = def.name;
+ break;
+ }
+ }
+ // We need to restore previous signal handlers and let them do
+ // their thing, so that the users can have the debugger break
+ // when a signal is raised, and so on.
+ restorePreviousSignalHandlers();
+ reportFatal( name );
+ raise( sig );
+ }
+
+ FatalConditionHandler::FatalConditionHandler() {
+ assert(!altStackMem && "Cannot initialize POSIX signal handler when one already exists");
+ if (altStackSize == 0) {
+ altStackSize = std::max(static_cast<size_t>(SIGSTKSZ), minStackSizeForErrors);
+ }
+ altStackMem = new char[altStackSize]();
+ }
+
+ FatalConditionHandler::~FatalConditionHandler() {
+ delete[] altStackMem;
+ // We signal that another instance can be constructed by zeroing
+ // out the pointer.
+ altStackMem = nullptr;
+ }
+
+ void FatalConditionHandler::engage_platform() {
+ stack_t sigStack;
+ sigStack.ss_sp = altStackMem;
+ sigStack.ss_size = altStackSize;
+ sigStack.ss_flags = 0;
+ sigaltstack(&sigStack, &oldSigStack);
+ struct sigaction sa = { };
+
+ sa.sa_handler = handleSignal;
+ sa.sa_flags = SA_ONSTACK;
+ for (std::size_t i = 0; i < sizeof(signalDefs)/sizeof(SignalDefs); ++i) {
+ sigaction(signalDefs[i].id, &sa, &oldSigActions[i]);
+ }
+ }
+
+#if defined(__GNUC__)
+# pragma GCC diagnostic pop
+#endif
+
+
+ void FatalConditionHandler::disengage_platform() noexcept {
+ restorePreviousSignalHandlers();
+ }
+
+} // end namespace Catch
+
+#endif // CATCH_CONFIG_POSIX_SIGNALS
+
+
+
+
+#include <cstring>
+
+namespace Catch {
+ namespace Detail {
+
+ uint32_t convertToBits(float f) {
+ static_assert(sizeof(float) == sizeof(uint32_t), "Important ULP matcher assumption violated");
+ uint32_t i;
+ std::memcpy(&i, &f, sizeof(f));
+ return i;
+ }
+
+ uint64_t convertToBits(double d) {
+ static_assert(sizeof(double) == sizeof(uint64_t), "Important ULP matcher assumption violated");
+ uint64_t i;
+ std::memcpy(&i, &d, sizeof(d));
+ return i;
+ }
+
+ } // end namespace Detail
+} // end namespace Catch
+
+
+
+
+
+#include <cstdio>
+#include <fstream>
+#include <sstream>
+#include <vector>
+
+namespace Catch {
+
+ Catch::IStream::~IStream() = default;
+
+namespace Detail {
+ namespace {
+ template<typename WriterF, std::size_t bufferSize=256>
+ class StreamBufImpl : public std::streambuf {
+ char data[bufferSize];
+ WriterF m_writer;
+
+ public:
+ StreamBufImpl() {
+ setp( data, data + sizeof(data) );
+ }
+
+ ~StreamBufImpl() noexcept override {
+ StreamBufImpl::sync();
+ }
+
+ private:
+ int overflow( int c ) override {
+ sync();
+
+ if( c != EOF ) {
+ if( pbase() == epptr() )
+ m_writer( std::string( 1, static_cast<char>( c ) ) );
+ else
+ sputc( static_cast<char>( c ) );
+ }
+ return 0;
+ }
+
+ int sync() override {
+ if( pbase() != pptr() ) {
+ m_writer( std::string( pbase(), static_cast<std::string::size_type>( pptr() - pbase() ) ) );
+ setp( pbase(), epptr() );
+ }
+ return 0;
+ }
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ struct OutputDebugWriter {
+
+ void operator()( std::string const& str ) {
+ if ( !str.empty() ) {
+ writeToDebugConsole( str );
+ }
+ }
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ class FileStream : public IStream {
+ std::ofstream m_ofs;
+ public:
+ FileStream( std::string const& filename ) {
+ m_ofs.open( filename.c_str() );
+ CATCH_ENFORCE( !m_ofs.fail(), "Unable to open file: '" << filename << '\'' );
+ }
+ ~FileStream() override = default;
+ public: // IStream
+ std::ostream& stream() override {
+ return m_ofs;
+ }
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ class CoutStream : public IStream {
+ std::ostream m_os;
+ public:
+ // Store the streambuf from cout up-front because
+ // cout may get redirected when running tests
+ CoutStream() : m_os( Catch::cout().rdbuf() ) {}
+ ~CoutStream() override = default;
+
+ public: // IStream
+ std::ostream& stream() override { return m_os; }
+ bool isConsole() const override { return true; }
+ };
+
+ class CerrStream : public IStream {
+ std::ostream m_os;
+
+ public:
+ // Store the streambuf from cerr up-front because
+ // cout may get redirected when running tests
+ CerrStream(): m_os( Catch::cerr().rdbuf() ) {}
+ ~CerrStream() override = default;
+
+ public: // IStream
+ std::ostream& stream() override { return m_os; }
+ bool isConsole() const override { return true; }
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ class DebugOutStream : public IStream {
+ Detail::unique_ptr<StreamBufImpl<OutputDebugWriter>> m_streamBuf;
+ std::ostream m_os;
+ public:
+ DebugOutStream()
+ : m_streamBuf( Detail::make_unique<StreamBufImpl<OutputDebugWriter>>() ),
+ m_os( m_streamBuf.get() )
+ {}
+
+ ~DebugOutStream() override = default;
+
+ public: // IStream
+ std::ostream& stream() override { return m_os; }
+ };
+
+ } // unnamed namespace
+} // namespace Detail
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ auto makeStream( std::string const& filename ) -> Detail::unique_ptr<IStream> {
+ if ( filename.empty() || filename == "-" ) {
+ return Detail::make_unique<Detail::CoutStream>();
+ }
+ if( filename[0] == '%' ) {
+ if ( filename == "%debug" ) {
+ return Detail::make_unique<Detail::DebugOutStream>();
+ } else if ( filename == "%stderr" ) {
+ return Detail::make_unique<Detail::CerrStream>();
+ } else if ( filename == "%stdout" ) {
+ return Detail::make_unique<Detail::CoutStream>();
+ } else {
+ CATCH_ERROR( "Unrecognised stream: '" << filename << '\'' );
+ }
+ }
+ return Detail::make_unique<Detail::FileStream>( filename );
+ }
+
+}
+
+
+
+
+namespace Catch {
+
+ auto operator << (std::ostream& os, LazyExpression const& lazyExpr) -> std::ostream& {
+ if (lazyExpr.m_isNegated)
+ os << '!';
+
+ if (lazyExpr) {
+ if (lazyExpr.m_isNegated && lazyExpr.m_transientExpression->isBinaryExpression())
+ os << '(' << *lazyExpr.m_transientExpression << ')';
+ else
+ os << *lazyExpr.m_transientExpression;
+ } else {
+ os << "{** error - unchecked empty expression requested **}";
+ }
+ return os;
+ }
+
+} // namespace Catch
+
+
+
+
+#ifdef CATCH_CONFIG_WINDOWS_CRTDBG
+#include <crtdbg.h>
+
+namespace Catch {
+
+ LeakDetector::LeakDetector() {
+ int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
+ flag |= _CRTDBG_LEAK_CHECK_DF;
+ flag |= _CRTDBG_ALLOC_MEM_DF;
+ _CrtSetDbgFlag(flag);
+ _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE | _CRTDBG_MODE_DEBUG);
+ _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDERR);
+ // Change this to leaking allocation's number to break there
+ _CrtSetBreakAlloc(-1);
+ }
+}
+
+#else // ^^ Windows crt debug heap enabled // Windows crt debug heap disabled vv
+
+ Catch::LeakDetector::LeakDetector() {}
+
+#endif // CATCH_CONFIG_WINDOWS_CRTDBG
+
+Catch::LeakDetector::~LeakDetector() {
+ Catch::cleanUp();
+}
+
+
+
+
+
+namespace Catch {
+ namespace {
+
+ void listTests(IEventListener& reporter, IConfig const& config) {
+ auto const& testSpec = config.testSpec();
+ auto matchedTestCases = filterTests(getAllTestCasesSorted(config), testSpec, config);
+ reporter.listTests(matchedTestCases);
+ }
+
+ void listTags(IEventListener& reporter, IConfig const& config) {
+ auto const& testSpec = config.testSpec();
+ std::vector<TestCaseHandle> matchedTestCases = filterTests(getAllTestCasesSorted(config), testSpec, config);
+
+ std::map<StringRef, TagInfo, Detail::CaseInsensitiveLess> tagCounts;
+ for (auto const& testCase : matchedTestCases) {
+ for (auto const& tagName : testCase.getTestCaseInfo().tags) {
+ auto it = tagCounts.find(tagName.original);
+ if (it == tagCounts.end())
+ it = tagCounts.insert(std::make_pair(tagName.original, TagInfo())).first;
+ it->second.add(tagName.original);
+ }
+ }
+
+ std::vector<TagInfo> infos; infos.reserve(tagCounts.size());
+ for (auto& tagc : tagCounts) {
+ infos.push_back(CATCH_MOVE(tagc.second));
+ }
+
+ reporter.listTags(infos);
+ }
+
+ void listReporters(IEventListener& reporter) {
+ std::vector<ReporterDescription> descriptions;
+
+ IReporterRegistry::FactoryMap const& factories = getRegistryHub().getReporterRegistry().getFactories();
+ descriptions.reserve(factories.size());
+ for (auto const& fac : factories) {
+ descriptions.push_back({ fac.first, fac.second->getDescription() });
+ }
+
+ reporter.listReporters(descriptions);
+ }
+
+ void listListeners(IEventListener& reporter) {
+ std::vector<ListenerDescription> descriptions;
+
+ auto const& factories =
+ getRegistryHub().getReporterRegistry().getListeners();
+ descriptions.reserve( factories.size() );
+ for ( auto const& fac : factories ) {
+ descriptions.push_back( { fac->getName(), fac->getDescription() } );
+ }
+
+ reporter.listListeners( descriptions );
+ }
+
+ } // end anonymous namespace
+
+ void TagInfo::add( StringRef spelling ) {
+ ++count;
+ spellings.insert( spelling );
+ }
+
+ std::string TagInfo::all() const {
+ // 2 per tag for brackets '[' and ']'
+ size_t size = spellings.size() * 2;
+ for (auto const& spelling : spellings) {
+ size += spelling.size();
+ }
+
+ std::string out; out.reserve(size);
+ for (auto const& spelling : spellings) {
+ out += '[';
+ out += spelling;
+ out += ']';
+ }
+ return out;
+ }
+
+ bool list( IEventListener& reporter, Config const& config ) {
+ bool listed = false;
+ if (config.listTests()) {
+ listed = true;
+ listTests(reporter, config);
+ }
+ if (config.listTags()) {
+ listed = true;
+ listTags(reporter, config);
+ }
+ if (config.listReporters()) {
+ listed = true;
+ listReporters(reporter);
+ }
+ if ( config.listListeners() ) {
+ listed = true;
+ listListeners( reporter );
+ }
+ return listed;
+ }
+
+} // end namespace Catch
+
+
+
+namespace Catch {
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
+ static LeakDetector leakDetector;
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
+}
+
+// Allow users of amalgamated .cpp file to remove our main and provide their own.
+#if !defined(CATCH_AMALGAMATED_CUSTOM_MAIN)
+
+#if defined(CATCH_CONFIG_WCHAR) && defined(CATCH_PLATFORM_WINDOWS) && defined(_UNICODE) && !defined(DO_NOT_USE_WMAIN)
+// Standard C/C++ Win32 Unicode wmain entry point
+extern "C" int __cdecl wmain (int argc, wchar_t * argv[], wchar_t * []) {
+#else
+// Standard C/C++ main entry point
+int main (int argc, char * argv[]) {
+#endif
+
+ // We want to force the linker not to discard the global variable
+ // and its constructor, as it (optionally) registers leak detector
+ (void)&Catch::leakDetector;
+
+ return Catch::Session().run( argc, argv );
+}
+
+#endif // !defined(CATCH_AMALGAMATED_CUSTOM_MAIN
+
+
+
+
+namespace Catch {
+
+ MessageInfo::MessageInfo( StringRef _macroName,
+ SourceLineInfo const& _lineInfo,
+ ResultWas::OfType _type )
+ : macroName( _macroName ),
+ lineInfo( _lineInfo ),
+ type( _type ),
+ sequence( ++globalCount )
+ {}
+
+ // This may need protecting if threading support is added
+ unsigned int MessageInfo::globalCount = 0;
+
+} // end namespace Catch
+
+
+
+#include <cstdio>
+#include <cstring>
+#include <sstream>
+
+#if defined(CATCH_CONFIG_NEW_CAPTURE)
+ #if defined(_MSC_VER)
+ #include <io.h> //_dup and _dup2
+ #define dup _dup
+ #define dup2 _dup2
+ #define fileno _fileno
+ #else
+ #include <unistd.h> // dup and dup2
+ #endif
+#endif
+
+
+namespace Catch {
+
+ RedirectedStream::RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream )
+ : m_originalStream( originalStream ),
+ m_redirectionStream( redirectionStream ),
+ m_prevBuf( m_originalStream.rdbuf() )
+ {
+ m_originalStream.rdbuf( m_redirectionStream.rdbuf() );
+ }
+
+ RedirectedStream::~RedirectedStream() {
+ m_originalStream.rdbuf( m_prevBuf );
+ }
+
+ RedirectedStdOut::RedirectedStdOut() : m_cout( Catch::cout(), m_rss.get() ) {}
+ auto RedirectedStdOut::str() const -> std::string { return m_rss.str(); }
+
+ RedirectedStdErr::RedirectedStdErr()
+ : m_cerr( Catch::cerr(), m_rss.get() ),
+ m_clog( Catch::clog(), m_rss.get() )
+ {}
+ auto RedirectedStdErr::str() const -> std::string { return m_rss.str(); }
+
+ RedirectedStreams::RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr)
+ : m_redirectedCout(redirectedCout),
+ m_redirectedCerr(redirectedCerr)
+ {}
+
+ RedirectedStreams::~RedirectedStreams() {
+ m_redirectedCout += m_redirectedStdOut.str();
+ m_redirectedCerr += m_redirectedStdErr.str();
+ }
+
+#if defined(CATCH_CONFIG_NEW_CAPTURE)
+
+#if defined(_MSC_VER)
+ TempFile::TempFile() {
+ if (tmpnam_s(m_buffer)) {
+ CATCH_RUNTIME_ERROR("Could not get a temp filename");
+ }
+ if (fopen_s(&m_file, m_buffer, "w+")) {
+ char buffer[100];
+ if (strerror_s(buffer, errno)) {
+ CATCH_RUNTIME_ERROR("Could not translate errno to a string");
+ }
+ CATCH_RUNTIME_ERROR("Could not open the temp file: '" << m_buffer << "' because: " << buffer);
+ }
+ }
+#else
+ TempFile::TempFile() {
+ m_file = std::tmpfile();
+ if (!m_file) {
+ CATCH_RUNTIME_ERROR("Could not create a temp file.");
+ }
+ }
+
+#endif
+
+ TempFile::~TempFile() {
+ // TBD: What to do about errors here?
+ std::fclose(m_file);
+ // We manually create the file on Windows only, on Linux
+ // it will be autodeleted
+#if defined(_MSC_VER)
+ std::remove(m_buffer);
+#endif
+ }
+
+
+ FILE* TempFile::getFile() {
+ return m_file;
+ }
+
+ std::string TempFile::getContents() {
+ std::stringstream sstr;
+ char buffer[100] = {};
+ std::rewind(m_file);
+ while (std::fgets(buffer, sizeof(buffer), m_file)) {
+ sstr << buffer;
+ }
+ return sstr.str();
+ }
+
+ OutputRedirect::OutputRedirect(std::string& stdout_dest, std::string& stderr_dest) :
+ m_originalStdout(dup(1)),
+ m_originalStderr(dup(2)),
+ m_stdoutDest(stdout_dest),
+ m_stderrDest(stderr_dest) {
+ dup2(fileno(m_stdoutFile.getFile()), 1);
+ dup2(fileno(m_stderrFile.getFile()), 2);
+ }
+
+ OutputRedirect::~OutputRedirect() {
+ Catch::cout() << std::flush;
+ fflush(stdout);
+ // Since we support overriding these streams, we flush cerr
+ // even though std::cerr is unbuffered
+ Catch::cerr() << std::flush;
+ Catch::clog() << std::flush;
+ fflush(stderr);
+
+ dup2(m_originalStdout, 1);
+ dup2(m_originalStderr, 2);
+
+ m_stdoutDest += m_stdoutFile.getContents();
+ m_stderrDest += m_stderrFile.getContents();
+ }
+
+#endif // CATCH_CONFIG_NEW_CAPTURE
+
+} // namespace Catch
+
+#if defined(CATCH_CONFIG_NEW_CAPTURE)
+ #if defined(_MSC_VER)
+ #undef dup
+ #undef dup2
+ #undef fileno
+ #endif
+#endif
+
+
+
+
+#include <cmath>
+
+namespace Catch {
+
+#if !defined(CATCH_CONFIG_POLYFILL_ISNAN)
+ bool isnan(float f) {
+ return std::isnan(f);
+ }
+ bool isnan(double d) {
+ return std::isnan(d);
+ }
+#else
+ // For now we only use this for embarcadero
+ bool isnan(float f) {
+ return std::_isnan(f);
+ }
+ bool isnan(double d) {
+ return std::_isnan(d);
+ }
+#endif
+
+} // end namespace Catch
+
+
+
+namespace Catch {
+
+namespace {
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4146) // we negate uint32 during the rotate
+#endif
+ // Safe rotr implementation thanks to John Regehr
+ uint32_t rotate_right(uint32_t val, uint32_t count) {
+ const uint32_t mask = 31;
+ count &= mask;
+ return (val >> count) | (val << (-count & mask));
+ }
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+
+}
+
+
+ SimplePcg32::SimplePcg32(result_type seed_) {
+ seed(seed_);
+ }
+
+
+ void SimplePcg32::seed(result_type seed_) {
+ m_state = 0;
+ (*this)();
+ m_state += seed_;
+ (*this)();
+ }
+
+ void SimplePcg32::discard(uint64_t skip) {
+ // We could implement this to run in O(log n) steps, but this
+ // should suffice for our use case.
+ for (uint64_t s = 0; s < skip; ++s) {
+ static_cast<void>((*this)());
+ }
+ }
+
+ SimplePcg32::result_type SimplePcg32::operator()() {
+ // prepare the output value
+ const uint32_t xorshifted = static_cast<uint32_t>(((m_state >> 18u) ^ m_state) >> 27u);
+ const auto output = rotate_right(xorshifted, m_state >> 59u);
+
+ // advance state
+ m_state = m_state * 6364136223846793005ULL + s_inc;
+
+ return output;
+ }
+
+ bool operator==(SimplePcg32 const& lhs, SimplePcg32 const& rhs) {
+ return lhs.m_state == rhs.m_state;
+ }
+
+ bool operator!=(SimplePcg32 const& lhs, SimplePcg32 const& rhs) {
+ return lhs.m_state != rhs.m_state;
+ }
+}
+
+
+
+
+
+#include <ctime>
+#include <random>
+
+namespace Catch {
+
+ std::uint32_t generateRandomSeed( GenerateFrom from ) {
+ switch ( from ) {
+ case GenerateFrom::Time:
+ return static_cast<std::uint32_t>( std::time( nullptr ) );
+
+ case GenerateFrom::Default:
+ case GenerateFrom::RandomDevice:
+ // In theory, a platform could have random_device that returns just
+ // 16 bits. That is still some randomness, so we don't care too much
+ return static_cast<std::uint32_t>( std::random_device{}() );
+
+ default:
+ CATCH_ERROR("Unknown generation method");
+ }
+ }
+
+} // end namespace Catch
+
+
+
+
+namespace Catch {
+
+ ReporterRegistry::ReporterRegistry() {
+ // Because it is impossible to move out of initializer list,
+ // we have to add the elements manually
+ m_factories["Automake"] = Detail::make_unique<ReporterFactory<AutomakeReporter>>();
+ m_factories["compact"] = Detail::make_unique<ReporterFactory<CompactReporter>>();
+ m_factories["console"] = Detail::make_unique<ReporterFactory<ConsoleReporter>>();
+ m_factories["JUnit"] = Detail::make_unique<ReporterFactory<JunitReporter>>();
+ m_factories["SonarQube"] = Detail::make_unique<ReporterFactory<SonarQubeReporter>>();
+ m_factories["TAP"] = Detail::make_unique<ReporterFactory<TAPReporter>>();
+ m_factories["TeamCity"] = Detail::make_unique<ReporterFactory<TeamCityReporter>>();
+ m_factories["XML"] = Detail::make_unique<ReporterFactory<XmlReporter>>();
+ }
+
+ ReporterRegistry::~ReporterRegistry() = default;
+
+
+ IEventListenerPtr ReporterRegistry::create( std::string const& name, ReporterConfig&& config ) const {
+ auto it = m_factories.find( name );
+ if( it == m_factories.end() )
+ return nullptr;
+ return it->second->create( CATCH_MOVE(config) );
+ }
+
+ void ReporterRegistry::registerReporter( std::string const& name, IReporterFactoryPtr factory ) {
+ CATCH_ENFORCE( name.find( "::" ) == name.npos,
+ "'::' is not allowed in reporter name: '" + name + '\'' );
+ auto ret = m_factories.emplace(name, CATCH_MOVE(factory));
+ CATCH_ENFORCE( ret.second, "reporter using '" + name + "' as name was already registered" );
+ }
+ void ReporterRegistry::registerListener(
+ Detail::unique_ptr<EventListenerFactory> factory ) {
+ m_listeners.push_back( CATCH_MOVE(factory) );
+ }
+
+ IReporterRegistry::FactoryMap const& ReporterRegistry::getFactories() const {
+ return m_factories;
+ }
+ IReporterRegistry::Listeners const& ReporterRegistry::getListeners() const {
+ return m_listeners;
+ }
+
+}
+
+
+
+
+
+#include <algorithm>
+
+namespace Catch {
+
+ namespace {
+ struct kvPair {
+ StringRef key, value;
+ };
+
+ kvPair splitKVPair(StringRef kvString) {
+ auto splitPos = static_cast<size_t>( std::distance(
+ kvString.begin(),
+ std::find( kvString.begin(), kvString.end(), '=' ) ) );
+
+ return { kvString.substr( 0, splitPos ),
+ kvString.substr( splitPos + 1, kvString.size() ) };
+ }
+ }
+
+ namespace Detail {
+ std::vector<std::string> splitReporterSpec( StringRef reporterSpec ) {
+ static constexpr auto separator = "::";
+ static constexpr size_t separatorSize = 2;
+
+ size_t separatorPos = 0;
+ auto findNextSeparator = [&reporterSpec]( size_t startPos ) {
+ static_assert(
+ separatorSize == 2,
+ "The code below currently assumes 2 char separator" );
+
+ auto currentPos = startPos;
+ do {
+ while ( currentPos < reporterSpec.size() &&
+ reporterSpec[currentPos] != separator[0] ) {
+ ++currentPos;
+ }
+ if ( currentPos + 1 < reporterSpec.size() &&
+ reporterSpec[currentPos + 1] == separator[1] ) {
+ return currentPos;
+ }
+ ++currentPos;
+ } while ( currentPos < reporterSpec.size() );
+
+ return static_cast<size_t>( -1 );
+ };
+
+ std::vector<std::string> parts;
+
+ while ( separatorPos < reporterSpec.size() ) {
+ const auto nextSeparator = findNextSeparator( separatorPos );
+ parts.push_back( static_cast<std::string>( reporterSpec.substr(
+ separatorPos, nextSeparator - separatorPos ) ) );
+
+ if ( nextSeparator == static_cast<size_t>( -1 ) ) {
+ break;
+ }
+ separatorPos = nextSeparator + separatorSize;
+ }
+
+ // Handle a separator at the end.
+ // This is not a valid spec, but we want to do validation in a
+ // centralized place
+ if ( separatorPos == reporterSpec.size() ) {
+ parts.emplace_back();
+ }
+
+ return parts;
+ }
+
+ Optional<ColourMode> stringToColourMode( StringRef colourMode ) {
+ if ( colourMode == "default" ) {
+ return ColourMode::PlatformDefault;
+ } else if ( colourMode == "ansi" ) {
+ return ColourMode::ANSI;
+ } else if ( colourMode == "win32" ) {
+ return ColourMode::Win32;
+ } else if ( colourMode == "none" ) {
+ return ColourMode::None;
+ } else {
+ return {};
+ }
+ }
+ } // namespace Detail
+
+
+ bool operator==( ReporterSpec const& lhs, ReporterSpec const& rhs ) {
+ return lhs.m_name == rhs.m_name &&
+ lhs.m_outputFileName == rhs.m_outputFileName &&
+ lhs.m_colourMode == rhs.m_colourMode &&
+ lhs.m_customOptions == rhs.m_customOptions;
+ }
+
+ Optional<ReporterSpec> parseReporterSpec( StringRef reporterSpec ) {
+ auto parts = Detail::splitReporterSpec( reporterSpec );
+
+ assert( parts.size() > 0 && "Split should never return empty vector" );
+
+ std::map<std::string, std::string> kvPairs;
+ Optional<std::string> outputFileName;
+ Optional<ColourMode> colourMode;
+
+ // First part is always reporter name, so we skip it
+ for ( size_t i = 1; i < parts.size(); ++i ) {
+ auto kv = splitKVPair( parts[i] );
+ auto key = kv.key, value = kv.value;
+
+ if ( key.empty() || value.empty() ) {
+ return {};
+ } else if ( key[0] == 'X' ) {
+ // This is a reporter-specific option, we don't check these
+ // apart from basic sanity checks
+ if ( key.size() == 1 ) {
+ return {};
+ }
+
+ auto ret = kvPairs.emplace( std::string(kv.key), std::string(kv.value) );
+ if ( !ret.second ) {
+ // Duplicated key. We might want to handle this differently,
+ // e.g. by overwriting the existing value?
+ return {};
+ }
+ } else if ( key == "out" ) {
+ // Duplicated key
+ if ( outputFileName ) {
+ return {};
+ }
+ outputFileName = static_cast<std::string>( value );
+ } else if ( key == "colour-mode" ) {
+ // Duplicated key
+ if ( colourMode ) {
+ return {};
+ }
+ colourMode = Detail::stringToColourMode( value );
+ // Parsing failed
+ if ( !colourMode ) {
+ return {};
+ }
+ } else {
+ // Unrecognized option
+ return {};
+ }
+ }
+
+ return ReporterSpec{ CATCH_MOVE( parts[0] ),
+ CATCH_MOVE( outputFileName ),
+ CATCH_MOVE( colourMode ),
+ CATCH_MOVE( kvPairs ) };
+ }
+
+ReporterSpec::ReporterSpec(
+ std::string name,
+ Optional<std::string> outputFileName,
+ Optional<ColourMode> colourMode,
+ std::map<std::string, std::string> customOptions ):
+ m_name( CATCH_MOVE( name ) ),
+ m_outputFileName( CATCH_MOVE( outputFileName ) ),
+ m_colourMode( CATCH_MOVE( colourMode ) ),
+ m_customOptions( CATCH_MOVE( customOptions ) ) {}
+
+} // namespace Catch
+
+
+
+namespace Catch {
+
+ bool isOk( ResultWas::OfType resultType ) {
+ return ( resultType & ResultWas::FailureBit ) == 0;
+ }
+ bool isJustInfo( int flags ) {
+ return flags == ResultWas::Info;
+ }
+
+ ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs ) {
+ return static_cast<ResultDisposition::Flags>( static_cast<int>( lhs ) | static_cast<int>( rhs ) );
+ }
+
+ bool shouldContinueOnFailure( int flags ) { return ( flags & ResultDisposition::ContinueOnFailure ) != 0; }
+ bool shouldSuppressFailure( int flags ) { return ( flags & ResultDisposition::SuppressFail ) != 0; }
+
+} // end namespace Catch
+
+
+
+#include <cstdio>
+#include <sstream>
+#include <vector>
+
+namespace Catch {
+
+ // This class encapsulates the idea of a pool of ostringstreams that can be reused.
+ struct StringStreams {
+ std::vector<Detail::unique_ptr<std::ostringstream>> m_streams;
+ std::vector<std::size_t> m_unused;
+ std::ostringstream m_referenceStream; // Used for copy state/ flags from
+
+ auto add() -> std::size_t {
+ if( m_unused.empty() ) {
+ m_streams.push_back( Detail::make_unique<std::ostringstream>() );
+ return m_streams.size()-1;
+ }
+ else {
+ auto index = m_unused.back();
+ m_unused.pop_back();
+ return index;
+ }
+ }
+
+ void release( std::size_t index ) {
+ m_streams[index]->copyfmt( m_referenceStream ); // Restore initial flags and other state
+ m_unused.push_back(index);
+ }
+ };
+
+ ReusableStringStream::ReusableStringStream()
+ : m_index( Singleton<StringStreams>::getMutable().add() ),
+ m_oss( Singleton<StringStreams>::getMutable().m_streams[m_index].get() )
+ {}
+
+ ReusableStringStream::~ReusableStringStream() {
+ static_cast<std::ostringstream*>( m_oss )->str("");
+ m_oss->clear();
+ Singleton<StringStreams>::getMutable().release( m_index );
+ }
+
+ std::string ReusableStringStream::str() const {
+ return static_cast<std::ostringstream*>( m_oss )->str();
+ }
+
+ void ReusableStringStream::str( std::string const& str ) {
+ static_cast<std::ostringstream*>( m_oss )->str( str );
+ }
+
+
+}
+
+
+
+
+#include <cassert>
+#include <algorithm>
+
+namespace Catch {
+
+ namespace Generators {
+ struct GeneratorTracker : TestCaseTracking::TrackerBase, IGeneratorTracker {
+ GeneratorBasePtr m_generator;
+
+ GeneratorTracker( TestCaseTracking::NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
+ : TrackerBase( nameAndLocation, ctx, parent )
+ {}
+ ~GeneratorTracker() override;
+
+ static GeneratorTracker& acquire( TrackerContext& ctx, TestCaseTracking::NameAndLocation const& nameAndLocation ) {
+ GeneratorTracker* tracker;
+
+ ITracker& currentTracker = ctx.currentTracker();
+ // Under specific circumstances, the generator we want
+ // to acquire is also the current tracker. If this is
+ // the case, we have to avoid looking through current
+ // tracker's children, and instead return the current
+ // tracker.
+ // A case where this check is important is e.g.
+ // for (int i = 0; i < 5; ++i) {
+ // int n = GENERATE(1, 2);
+ // }
+ //
+ // without it, the code above creates 5 nested generators.
+ if ( currentTracker.nameAndLocation() == nameAndLocation ) {
+ auto thisTracker =
+ currentTracker.parent()->findChild( nameAndLocation );
+ assert( thisTracker );
+ assert( thisTracker->isGeneratorTracker() );
+ tracker = static_cast<GeneratorTracker*>( thisTracker );
+ } else if ( ITracker* childTracker =
+ currentTracker.findChild( nameAndLocation ) ) {
+ assert( childTracker );
+ assert( childTracker->isGeneratorTracker() );
+ tracker = static_cast<GeneratorTracker*>( childTracker );
+ } else {
+ auto newTracker =
+ Catch::Detail::make_unique<GeneratorTracker>(
+ nameAndLocation, ctx, &currentTracker );
+ tracker = newTracker.get();
+ currentTracker.addChild( CATCH_MOVE(newTracker) );
+ }
+
+ if( !tracker->isComplete() ) {
+ tracker->open();
+ }
+
+ return *tracker;
+ }
+
+ // TrackerBase interface
+ bool isGeneratorTracker() const override { return true; }
+ auto hasGenerator() const -> bool override {
+ return !!m_generator;
+ }
+ void close() override {
+ TrackerBase::close();
+ // If a generator has a child (it is followed by a section)
+ // and none of its children have started, then we must wait
+ // until later to start consuming its values.
+ // This catches cases where `GENERATE` is placed between two
+ // `SECTION`s.
+ // **The check for m_children.empty cannot be removed**.
+ // doing so would break `GENERATE` _not_ followed by `SECTION`s.
+ const bool should_wait_for_child = [&]() {
+ // No children -> nobody to wait for
+ if ( m_children.empty() ) {
+ return false;
+ }
+ // If at least one child started executing, don't wait
+ if ( std::find_if(
+ m_children.begin(),
+ m_children.end(),
+ []( TestCaseTracking::ITrackerPtr const& tracker ) {
+ return tracker->hasStarted();
+ } ) != m_children.end() ) {
+ return false;
+ }
+
+ // No children have started. We need to check if they _can_
+ // start, and thus we should wait for them, or they cannot
+ // start (due to filters), and we shouldn't wait for them
+ ITracker* parent = m_parent;
+ // This is safe: there is always at least one section
+ // tracker in a test case tracking tree
+ while ( !parent->isSectionTracker() ) {
+ parent = parent->parent();
+ }
+ assert( parent &&
+ "Missing root (test case) level section" );
+
+ auto const& parentSection =
+ static_cast<SectionTracker const&>( *parent );
+ auto const& filters = parentSection.getFilters();
+ // No filters -> no restrictions on running sections
+ if ( filters.empty() ) {
+ return true;
+ }
+
+ for ( auto const& child : m_children ) {
+ if ( child->isSectionTracker() &&
+ std::find(
+ filters.begin(),
+ filters.end(),
+ static_cast<SectionTracker const&>( *child )
+ .trimmedName() ) != filters.end() ) {
+ return true;
+ }
+ }
+ return false;
+ }();
+
+ // This check is a bit tricky, because m_generator->next()
+ // has a side-effect, where it consumes generator's current
+ // value, but we do not want to invoke the side-effect if
+ // this generator is still waiting for any child to start.
+ if ( should_wait_for_child ||
+ ( m_runState == CompletedSuccessfully &&
+ m_generator->countedNext() ) ) {
+ m_children.clear();
+ m_runState = Executing;
+ }
+ }
+
+ // IGeneratorTracker interface
+ auto getGenerator() const -> GeneratorBasePtr const& override {
+ return m_generator;
+ }
+ void setGenerator( GeneratorBasePtr&& generator ) override {
+ m_generator = CATCH_MOVE( generator );
+ }
+ };
+ GeneratorTracker::~GeneratorTracker() = default;
+ }
+
+ RunContext::RunContext(IConfig const* _config, IEventListenerPtr&& reporter)
+ : m_runInfo(_config->name()),
+ m_context(getCurrentMutableContext()),
+ m_config(_config),
+ m_reporter(CATCH_MOVE(reporter)),
+ m_lastAssertionInfo{ StringRef(), SourceLineInfo("",0), StringRef(), ResultDisposition::Normal },
+ m_includeSuccessfulResults( m_config->includeSuccessfulResults() || m_reporter->getPreferences().shouldReportAllAssertions )
+ {
+ m_context.setResultCapture(this);
+ m_reporter->testRunStarting(m_runInfo);
+ }
+
+ RunContext::~RunContext() {
+ m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, aborting()));
+ }
+
+ Totals RunContext::runTest(TestCaseHandle const& testCase) {
+ const Totals prevTotals = m_totals;
+
+ std::string redirectedCout;
+ std::string redirectedCerr;
+
+ auto const& testInfo = testCase.getTestCaseInfo();
+
+ m_reporter->testCaseStarting(testInfo);
+
+ m_activeTestCase = &testCase;
+
+
+ ITracker& rootTracker = m_trackerContext.startRun();
+ assert(rootTracker.isSectionTracker());
+ static_cast<SectionTracker&>(rootTracker).addInitialFilters(m_config->getSectionsToRun());
+
+ // We intentionally only seed the internal RNG once per test case,
+ // before it is first invoked. The reason for that is a complex
+ // interplay of generator/section implementation details and the
+ // Random*Generator types.
+ //
+ // The issue boils down to us needing to seed the Random*Generators
+ // with different seed each, so that they return different sequences
+ // of random numbers. We do this by giving them a number from the
+ // shared RNG instance as their seed.
+ //
+ // However, this runs into an issue if the reseeding happens each
+ // time the test case is entered (as opposed to first time only),
+ // because multiple generators could get the same seed, e.g. in
+ // ```cpp
+ // TEST_CASE() {
+ // auto i = GENERATE(take(10, random(0, 100));
+ // SECTION("A") {
+ // auto j = GENERATE(take(10, random(0, 100));
+ // }
+ // SECTION("B") {
+ // auto k = GENERATE(take(10, random(0, 100));
+ // }
+ // }
+ // ```
+ // `i` and `j` would properly return values from different sequences,
+ // but `i` and `k` would return the same sequence, because their seed
+ // would be the same.
+ // (The reason their seeds would be the same is that the generator
+ // for k would be initialized when the test case is entered the second
+ // time, after the shared RNG instance was reset to the same value
+ // it had when the generator for i was initialized.)
+ seedRng( *m_config );
+
+ uint64_t testRuns = 0;
+ do {
+ m_trackerContext.startCycle();
+ m_testCaseTracker = &SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(testInfo.name, testInfo.lineInfo));
+
+ m_reporter->testCasePartialStarting(testInfo, testRuns);
+
+ const auto beforeRunTotals = m_totals;
+ std::string oneRunCout, oneRunCerr;
+ runCurrentTest(oneRunCout, oneRunCerr);
+ redirectedCout += oneRunCout;
+ redirectedCerr += oneRunCerr;
+
+ const auto singleRunTotals = m_totals.delta(beforeRunTotals);
+ auto statsForOneRun = TestCaseStats(testInfo, singleRunTotals, oneRunCout, oneRunCerr, aborting());
+
+ m_reporter->testCasePartialEnded(statsForOneRun, testRuns);
+ ++testRuns;
+ } while (!m_testCaseTracker->isSuccessfullyCompleted() && !aborting());
+
+ Totals deltaTotals = m_totals.delta(prevTotals);
+ if (testInfo.expectedToFail() && deltaTotals.testCases.passed > 0) {
+ deltaTotals.assertions.failed++;
+ deltaTotals.testCases.passed--;
+ deltaTotals.testCases.failed++;
+ }
+ m_totals.testCases += deltaTotals.testCases;
+ m_reporter->testCaseEnded(TestCaseStats(testInfo,
+ deltaTotals,
+ redirectedCout,
+ redirectedCerr,
+ aborting()));
+
+ m_activeTestCase = nullptr;
+ m_testCaseTracker = nullptr;
+
+ return deltaTotals;
+ }
+
+
+ void RunContext::assertionEnded(AssertionResult const & result) {
+ if (result.getResultType() == ResultWas::Ok) {
+ m_totals.assertions.passed++;
+ m_lastAssertionPassed = true;
+ } else if (!result.succeeded()) {
+ m_lastAssertionPassed = false;
+ if (result.isOk()) {
+ }
+ else if( m_activeTestCase->getTestCaseInfo().okToFail() )
+ m_totals.assertions.failedButOk++;
+ else
+ m_totals.assertions.failed++;
+ }
+ else {
+ m_lastAssertionPassed = true;
+ }
+
+ m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals));
+
+ if (result.getResultType() != ResultWas::Warning)
+ m_messageScopes.clear();
+
+ // Reset working state
+ resetAssertionInfo();
+ m_lastResult = result;
+ }
+ void RunContext::resetAssertionInfo() {
+ m_lastAssertionInfo.macroName = StringRef();
+ m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}"_sr;
+ }
+
+ bool RunContext::sectionStarted(SectionInfo const & sectionInfo, Counts & assertions) {
+ ITracker& sectionTracker = SectionTracker::acquire(m_trackerContext, TestCaseTracking::NameAndLocation(sectionInfo.name, sectionInfo.lineInfo));
+ if (!sectionTracker.isOpen())
+ return false;
+ m_activeSections.push_back(&sectionTracker);
+
+ m_lastAssertionInfo.lineInfo = sectionInfo.lineInfo;
+
+ m_reporter->sectionStarting(sectionInfo);
+
+ assertions = m_totals.assertions;
+
+ return true;
+ }
+ auto RunContext::acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& {
+ using namespace Generators;
+ GeneratorTracker& tracker = GeneratorTracker::acquire(m_trackerContext,
+ TestCaseTracking::NameAndLocation( static_cast<std::string>(generatorName), lineInfo ) );
+ m_lastAssertionInfo.lineInfo = lineInfo;
+ return tracker;
+ }
+
+ bool RunContext::testForMissingAssertions(Counts& assertions) {
+ if (assertions.total() != 0)
+ return false;
+ if (!m_config->warnAboutMissingAssertions())
+ return false;
+ if (m_trackerContext.currentTracker().hasChildren())
+ return false;
+ m_totals.assertions.failed++;
+ assertions.failed++;
+ return true;
+ }
+
+ void RunContext::sectionEnded(SectionEndInfo const & endInfo) {
+ Counts assertions = m_totals.assertions - endInfo.prevAssertions;
+ bool missingAssertions = testForMissingAssertions(assertions);
+
+ if (!m_activeSections.empty()) {
+ m_activeSections.back()->close();
+ m_activeSections.pop_back();
+ }
+
+ m_reporter->sectionEnded(SectionStats(endInfo.sectionInfo, assertions, endInfo.durationInSeconds, missingAssertions));
+ m_messages.clear();
+ m_messageScopes.clear();
+ }
+
+ void RunContext::sectionEndedEarly(SectionEndInfo const & endInfo) {
+ if (m_unfinishedSections.empty())
+ m_activeSections.back()->fail();
+ else
+ m_activeSections.back()->close();
+ m_activeSections.pop_back();
+
+ m_unfinishedSections.push_back(endInfo);
+ }
+
+ void RunContext::benchmarkPreparing( StringRef name ) {
+ m_reporter->benchmarkPreparing(name);
+ }
+ void RunContext::benchmarkStarting( BenchmarkInfo const& info ) {
+ m_reporter->benchmarkStarting( info );
+ }
+ void RunContext::benchmarkEnded( BenchmarkStats<> const& stats ) {
+ m_reporter->benchmarkEnded( stats );
+ }
+ void RunContext::benchmarkFailed( StringRef error ) {
+ m_reporter->benchmarkFailed( error );
+ }
+
+ void RunContext::pushScopedMessage(MessageInfo const & message) {
+ m_messages.push_back(message);
+ }
+
+ void RunContext::popScopedMessage(MessageInfo const & message) {
+ m_messages.erase(std::remove(m_messages.begin(), m_messages.end(), message), m_messages.end());
+ }
+
+ void RunContext::emplaceUnscopedMessage( MessageBuilder const& builder ) {
+ m_messageScopes.emplace_back( builder );
+ }
+
+ std::string RunContext::getCurrentTestName() const {
+ return m_activeTestCase
+ ? m_activeTestCase->getTestCaseInfo().name
+ : std::string();
+ }
+
+ const AssertionResult * RunContext::getLastResult() const {
+ return &(*m_lastResult);
+ }
+
+ void RunContext::exceptionEarlyReported() {
+ m_shouldReportUnexpected = false;
+ }
+
+ void RunContext::handleFatalErrorCondition( StringRef message ) {
+ // First notify reporter that bad things happened
+ m_reporter->fatalErrorEncountered(message);
+
+ // Don't rebuild the result -- the stringification itself can cause more fatal errors
+ // Instead, fake a result data.
+ AssertionResultData tempResult( ResultWas::FatalErrorCondition, { false } );
+ tempResult.message = static_cast<std::string>(message);
+ AssertionResult result(m_lastAssertionInfo, tempResult);
+
+ assertionEnded(result);
+
+ handleUnfinishedSections();
+
+ // Recreate section for test case (as we will lose the one that was in scope)
+ auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
+ SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name);
+
+ Counts assertions;
+ assertions.failed = 1;
+ SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false);
+ m_reporter->sectionEnded(testCaseSectionStats);
+
+ auto const& testInfo = m_activeTestCase->getTestCaseInfo();
+
+ Totals deltaTotals;
+ deltaTotals.testCases.failed = 1;
+ deltaTotals.assertions.failed = 1;
+ m_reporter->testCaseEnded(TestCaseStats(testInfo,
+ deltaTotals,
+ std::string(),
+ std::string(),
+ false));
+ m_totals.testCases.failed++;
+ m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false));
+ }
+
+ bool RunContext::lastAssertionPassed() {
+ return m_lastAssertionPassed;
+ }
+
+ void RunContext::assertionPassed() {
+ m_lastAssertionPassed = true;
+ ++m_totals.assertions.passed;
+ resetAssertionInfo();
+ m_messageScopes.clear();
+ }
+
+ bool RunContext::aborting() const {
+ return m_totals.assertions.failed >= static_cast<std::size_t>(m_config->abortAfter());
+ }
+
+ void RunContext::runCurrentTest(std::string & redirectedCout, std::string & redirectedCerr) {
+ auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
+ SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name);
+ m_reporter->sectionStarting(testCaseSection);
+ Counts prevAssertions = m_totals.assertions;
+ double duration = 0;
+ m_shouldReportUnexpected = true;
+ m_lastAssertionInfo = { "TEST_CASE"_sr, testCaseInfo.lineInfo, StringRef(), ResultDisposition::Normal };
+
+ Timer timer;
+ CATCH_TRY {
+ if (m_reporter->getPreferences().shouldRedirectStdOut) {
+#if !defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
+ RedirectedStreams redirectedStreams(redirectedCout, redirectedCerr);
+
+ timer.start();
+ invokeActiveTestCase();
+#else
+ OutputRedirect r(redirectedCout, redirectedCerr);
+ timer.start();
+ invokeActiveTestCase();
+#endif
+ } else {
+ timer.start();
+ invokeActiveTestCase();
+ }
+ duration = timer.getElapsedSeconds();
+ } CATCH_CATCH_ANON (TestFailureException&) {
+ // This just means the test was aborted due to failure
+ } CATCH_CATCH_ALL {
+ // Under CATCH_CONFIG_FAST_COMPILE, unexpected exceptions under REQUIRE assertions
+ // are reported without translation at the point of origin.
+ if( m_shouldReportUnexpected ) {
+ AssertionReaction dummyReaction;
+ handleUnexpectedInflightException( m_lastAssertionInfo, translateActiveException(), dummyReaction );
+ }
+ }
+ Counts assertions = m_totals.assertions - prevAssertions;
+ bool missingAssertions = testForMissingAssertions(assertions);
+
+ m_testCaseTracker->close();
+ handleUnfinishedSections();
+ m_messages.clear();
+ m_messageScopes.clear();
+
+ SectionStats testCaseSectionStats(testCaseSection, assertions, duration, missingAssertions);
+ m_reporter->sectionEnded(testCaseSectionStats);
+ }
+
+ void RunContext::invokeActiveTestCase() {
+ // We need to engage a handler for signals/structured exceptions
+ // before running the tests themselves, or the binary can crash
+ // without failed test being reported.
+ FatalConditionHandlerGuard _(&m_fatalConditionhandler);
+ // We keep having issue where some compilers warn about an unused
+ // variable, even though the type has non-trivial constructor and
+ // destructor. This is annoying and ugly, but it makes them stfu.
+ (void)_;
+
+ m_activeTestCase->invoke();
+ }
+
+ void RunContext::handleUnfinishedSections() {
+ // If sections ended prematurely due to an exception we stored their
+ // infos here so we can tear them down outside the unwind process.
+ for (auto it = m_unfinishedSections.rbegin(),
+ itEnd = m_unfinishedSections.rend();
+ it != itEnd;
+ ++it)
+ sectionEnded(*it);
+ m_unfinishedSections.clear();
+ }
+
+ void RunContext::handleExpr(
+ AssertionInfo const& info,
+ ITransientExpression const& expr,
+ AssertionReaction& reaction
+ ) {
+ m_reporter->assertionStarting( info );
+
+ bool negated = isFalseTest( info.resultDisposition );
+ bool result = expr.getResult() != negated;
+
+ if( result ) {
+ if (!m_includeSuccessfulResults) {
+ assertionPassed();
+ }
+ else {
+ reportExpr(info, ResultWas::Ok, &expr, negated);
+ }
+ }
+ else {
+ reportExpr(info, ResultWas::ExpressionFailed, &expr, negated );
+ populateReaction( reaction );
+ }
+ }
+ void RunContext::reportExpr(
+ AssertionInfo const &info,
+ ResultWas::OfType resultType,
+ ITransientExpression const *expr,
+ bool negated ) {
+
+ m_lastAssertionInfo = info;
+ AssertionResultData data( resultType, LazyExpression( negated ) );
+
+ AssertionResult assertionResult{ info, data };
+ assertionResult.m_resultData.lazyExpression.m_transientExpression = expr;
+
+ assertionEnded( assertionResult );
+ }
+
+ void RunContext::handleMessage(
+ AssertionInfo const& info,
+ ResultWas::OfType resultType,
+ StringRef message,
+ AssertionReaction& reaction
+ ) {
+ m_reporter->assertionStarting( info );
+
+ m_lastAssertionInfo = info;
+
+ AssertionResultData data( resultType, LazyExpression( false ) );
+ data.message = static_cast<std::string>(message);
+ AssertionResult assertionResult{ m_lastAssertionInfo, data };
+ assertionEnded( assertionResult );
+ if( !assertionResult.isOk() )
+ populateReaction( reaction );
+ }
+ void RunContext::handleUnexpectedExceptionNotThrown(
+ AssertionInfo const& info,
+ AssertionReaction& reaction
+ ) {
+ handleNonExpr(info, Catch::ResultWas::DidntThrowException, reaction);
+ }
+
+ void RunContext::handleUnexpectedInflightException(
+ AssertionInfo const& info,
+ std::string const& message,
+ AssertionReaction& reaction
+ ) {
+ m_lastAssertionInfo = info;
+
+ AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) );
+ data.message = message;
+ AssertionResult assertionResult{ info, data };
+ assertionEnded( assertionResult );
+ populateReaction( reaction );
+ }
+
+ void RunContext::populateReaction( AssertionReaction& reaction ) {
+ reaction.shouldDebugBreak = m_config->shouldDebugBreak();
+ reaction.shouldThrow = aborting() || (m_lastAssertionInfo.resultDisposition & ResultDisposition::Normal);
+ }
+
+ void RunContext::handleIncomplete(
+ AssertionInfo const& info
+ ) {
+ m_lastAssertionInfo = info;
+
+ AssertionResultData data( ResultWas::ThrewException, LazyExpression( false ) );
+ data.message = "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE";
+ AssertionResult assertionResult{ info, data };
+ assertionEnded( assertionResult );
+ }
+ void RunContext::handleNonExpr(
+ AssertionInfo const &info,
+ ResultWas::OfType resultType,
+ AssertionReaction &reaction
+ ) {
+ m_lastAssertionInfo = info;
+
+ AssertionResultData data( resultType, LazyExpression( false ) );
+ AssertionResult assertionResult{ info, data };
+ assertionEnded( assertionResult );
+
+ if( !assertionResult.isOk() )
+ populateReaction( reaction );
+ }
+
+
+ IResultCapture& getResultCapture() {
+ if (auto* capture = getCurrentContext().getResultCapture())
+ return *capture;
+ else
+ CATCH_INTERNAL_ERROR("No result capture instance");
+ }
+
+ void seedRng(IConfig const& config) {
+ sharedRng().seed(config.rngSeed());
+ }
+
+ unsigned int rngSeed() {
+ return getCurrentContext().getConfig()->rngSeed();
+ }
+
+}
+
+
+
+namespace Catch {
+
+ Section::Section( SectionInfo&& info ):
+ m_info( CATCH_MOVE( info ) ),
+ m_sectionIncluded(
+ getResultCapture().sectionStarted( m_info, m_assertions ) ) {
+ // Non-"included" sections will not use the timing information
+ // anyway, so don't bother with the potential syscall.
+ if (m_sectionIncluded) {
+ m_timer.start();
+ }
+ }
+
+ Section::~Section() {
+ if( m_sectionIncluded ) {
+ SectionEndInfo endInfo{ m_info, m_assertions, m_timer.getElapsedSeconds() };
+ if( uncaught_exceptions() )
+ getResultCapture().sectionEndedEarly( endInfo );
+ else
+ getResultCapture().sectionEnded( endInfo );
+ }
+ }
+
+ // This indicates whether the section should be executed or not
+ Section::operator bool() const {
+ return m_sectionIncluded;
+ }
+
+
+} // end namespace Catch
+
+
+
+#include <vector>
+
+namespace Catch {
+
+ namespace {
+ static auto getSingletons() -> std::vector<ISingleton*>*& {
+ static std::vector<ISingleton*>* g_singletons = nullptr;
+ if( !g_singletons )
+ g_singletons = new std::vector<ISingleton*>();
+ return g_singletons;
+ }
+ }
+
+ ISingleton::~ISingleton() = default;
+
+ void addSingleton(ISingleton* singleton ) {
+ getSingletons()->push_back( singleton );
+ }
+ void cleanupSingletons() {
+ auto& singletons = getSingletons();
+ for( auto singleton : *singletons )
+ delete singleton;
+ delete singletons;
+ singletons = nullptr;
+ }
+
+} // namespace Catch
+
+
+
+#include <cstring>
+#include <ostream>
+
+namespace Catch {
+
+ bool SourceLineInfo::operator == ( SourceLineInfo const& other ) const noexcept {
+ return line == other.line && (file == other.file || std::strcmp(file, other.file) == 0);
+ }
+ bool SourceLineInfo::operator < ( SourceLineInfo const& other ) const noexcept {
+ // We can assume that the same file will usually have the same pointer.
+ // Thus, if the pointers are the same, there is no point in calling the strcmp
+ return line < other.line || ( line == other.line && file != other.file && (std::strcmp(file, other.file) < 0));
+ }
+
+ std::ostream& operator << ( std::ostream& os, SourceLineInfo const& info ) {
+#ifndef __GNUG__
+ os << info.file << '(' << info.line << ')';
+#else
+ os << info.file << ':' << info.line;
+#endif
+ return os;
+ }
+
+} // end namespace Catch
+
+
+
+
+namespace Catch {
+#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+ void StartupExceptionRegistry::add( std::exception_ptr const& exception ) noexcept {
+ CATCH_TRY {
+ m_exceptions.push_back(exception);
+ } CATCH_CATCH_ALL {
+ // If we run out of memory during start-up there's really not a lot more we can do about it
+ std::terminate();
+ }
+ }
+
+ std::vector<std::exception_ptr> const& StartupExceptionRegistry::getExceptions() const noexcept {
+ return m_exceptions;
+ }
+#endif
+
+} // end namespace Catch
+
+
+
+
+
+#include <iostream>
+
+namespace Catch {
+
+// If you #define this you must implement these functions
+#if !defined( CATCH_CONFIG_NOSTDOUT )
+ std::ostream& cout() { return std::cout; }
+ std::ostream& cerr() { return std::cerr; }
+ std::ostream& clog() { return std::clog; }
+#endif
+
+} // namespace Catch
+
+
+
+#include <algorithm>
+#include <ostream>
+#include <cstring>
+#include <cctype>
+#include <vector>
+
+namespace Catch {
+
+ bool startsWith( std::string const& s, std::string const& prefix ) {
+ return s.size() >= prefix.size() && std::equal(prefix.begin(), prefix.end(), s.begin());
+ }
+ bool startsWith( StringRef s, char prefix ) {
+ return !s.empty() && s[0] == prefix;
+ }
+ bool endsWith( std::string const& s, std::string const& suffix ) {
+ return s.size() >= suffix.size() && std::equal(suffix.rbegin(), suffix.rend(), s.rbegin());
+ }
+ bool endsWith( std::string const& s, char suffix ) {
+ return !s.empty() && s[s.size()-1] == suffix;
+ }
+ bool contains( std::string const& s, std::string const& infix ) {
+ return s.find( infix ) != std::string::npos;
+ }
+ void toLowerInPlace( std::string& s ) {
+ std::transform( s.begin(), s.end(), s.begin(), []( char c ) {
+ return toLower( c );
+ } );
+ }
+ std::string toLower( std::string const& s ) {
+ std::string lc = s;
+ toLowerInPlace( lc );
+ return lc;
+ }
+ char toLower(char c) {
+ return static_cast<char>(std::tolower(static_cast<unsigned char>(c)));
+ }
+
+ std::string trim( std::string const& str ) {
+ static char const* whitespaceChars = "\n\r\t ";
+ std::string::size_type start = str.find_first_not_of( whitespaceChars );
+ std::string::size_type end = str.find_last_not_of( whitespaceChars );
+
+ return start != std::string::npos ? str.substr( start, 1+end-start ) : std::string();
+ }
+
+ StringRef trim(StringRef ref) {
+ const auto is_ws = [](char c) {
+ return c == ' ' || c == '\t' || c == '\n' || c == '\r';
+ };
+ size_t real_begin = 0;
+ while (real_begin < ref.size() && is_ws(ref[real_begin])) { ++real_begin; }
+ size_t real_end = ref.size();
+ while (real_end > real_begin && is_ws(ref[real_end - 1])) { --real_end; }
+
+ return ref.substr(real_begin, real_end - real_begin);
+ }
+
+ bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis ) {
+ bool replaced = false;
+ std::size_t i = str.find( replaceThis );
+ while( i != std::string::npos ) {
+ replaced = true;
+ str = str.substr( 0, i ) + withThis + str.substr( i+replaceThis.size() );
+ if( i < str.size()-withThis.size() )
+ i = str.find( replaceThis, i+withThis.size() );
+ else
+ i = std::string::npos;
+ }
+ return replaced;
+ }
+
+ std::vector<StringRef> splitStringRef( StringRef str, char delimiter ) {
+ std::vector<StringRef> subStrings;
+ std::size_t start = 0;
+ for(std::size_t pos = 0; pos < str.size(); ++pos ) {
+ if( str[pos] == delimiter ) {
+ if( pos - start > 1 )
+ subStrings.push_back( str.substr( start, pos-start ) );
+ start = pos+1;
+ }
+ }
+ if( start < str.size() )
+ subStrings.push_back( str.substr( start, str.size()-start ) );
+ return subStrings;
+ }
+
+ std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser ) {
+ os << pluraliser.m_count << ' ' << pluraliser.m_label;
+ if( pluraliser.m_count != 1 )
+ os << 's';
+ return os;
+ }
+
+}
+
+
+
+#include <algorithm>
+#include <ostream>
+#include <cstring>
+#include <cstdint>
+
+namespace Catch {
+ StringRef::StringRef( char const* rawChars ) noexcept
+ : StringRef( rawChars, std::strlen(rawChars) )
+ {}
+
+ auto StringRef::operator == ( StringRef other ) const noexcept -> bool {
+ return m_size == other.m_size
+ && (std::memcmp( m_start, other.m_start, m_size ) == 0);
+ }
+
+ bool StringRef::operator<(StringRef rhs) const noexcept {
+ if (m_size < rhs.m_size) {
+ return strncmp(m_start, rhs.m_start, m_size) <= 0;
+ }
+ return strncmp(m_start, rhs.m_start, rhs.m_size) < 0;
+ }
+
+ int StringRef::compare( StringRef rhs ) const {
+ auto cmpResult =
+ strncmp( m_start, rhs.m_start, std::min( m_size, rhs.m_size ) );
+
+ // This means that strncmp found a difference before the strings
+ // ended, and we can return it directly
+ if ( cmpResult != 0 ) {
+ return cmpResult;
+ }
+
+ // If strings are equal up to length, then their comparison results on
+ // their size
+ if ( m_size < rhs.m_size ) {
+ return -1;
+ } else if ( m_size > rhs.m_size ) {
+ return 1;
+ } else {
+ return 0;
+ }
+ }
+
+ auto operator << ( std::ostream& os, StringRef str ) -> std::ostream& {
+ return os.write(str.data(), static_cast<std::streamsize>(str.size()));
+ }
+
+ std::string operator+(StringRef lhs, StringRef rhs) {
+ std::string ret;
+ ret.reserve(lhs.size() + rhs.size());
+ ret += lhs;
+ ret += rhs;
+ return ret;
+ }
+
+ auto operator+=( std::string& lhs, StringRef rhs ) -> std::string& {
+ lhs.append(rhs.data(), rhs.size());
+ return lhs;
+ }
+
+} // namespace Catch
+
+
+
+namespace Catch {
+
+ TagAliasRegistry::~TagAliasRegistry() {}
+
+ TagAlias const* TagAliasRegistry::find( std::string const& alias ) const {
+ auto it = m_registry.find( alias );
+ if( it != m_registry.end() )
+ return &(it->second);
+ else
+ return nullptr;
+ }
+
+ std::string TagAliasRegistry::expandAliases( std::string const& unexpandedTestSpec ) const {
+ std::string expandedTestSpec = unexpandedTestSpec;
+ for( auto const& registryKvp : m_registry ) {
+ std::size_t pos = expandedTestSpec.find( registryKvp.first );
+ if( pos != std::string::npos ) {
+ expandedTestSpec = expandedTestSpec.substr( 0, pos ) +
+ registryKvp.second.tag +
+ expandedTestSpec.substr( pos + registryKvp.first.size() );
+ }
+ }
+ return expandedTestSpec;
+ }
+
+ void TagAliasRegistry::add( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) {
+ CATCH_ENFORCE( startsWith(alias, "[@") && endsWith(alias, ']'),
+ "error: tag alias, '" << alias << "' is not of the form [@alias name].\n" << lineInfo );
+
+ CATCH_ENFORCE( m_registry.insert(std::make_pair(alias, TagAlias(tag, lineInfo))).second,
+ "error: tag alias, '" << alias << "' already registered.\n"
+ << "\tFirst seen at: " << find(alias)->lineInfo << "\n"
+ << "\tRedefined at: " << lineInfo );
+ }
+
+ ITagAliasRegistry::~ITagAliasRegistry() = default;
+
+ ITagAliasRegistry const& ITagAliasRegistry::get() {
+ return getRegistryHub().getTagAliasRegistry();
+ }
+
+} // end namespace Catch
+
+
+
+
+namespace Catch {
+ TestCaseInfoHasher::TestCaseInfoHasher( hash_t seed ): m_seed( seed ) {}
+
+ uint32_t TestCaseInfoHasher::operator()( TestCaseInfo const& t ) const {
+ // FNV-1a hash algorithm that is designed for uniqueness:
+ const hash_t prime = 1099511628211u;
+ hash_t hash = 14695981039346656037u;
+ for ( const char c : t.name ) {
+ hash ^= c;
+ hash *= prime;
+ }
+ for ( const char c : t.className ) {
+ hash ^= c;
+ hash *= prime;
+ }
+ for ( const Tag& tag : t.tags ) {
+ for ( const char c : tag.original ) {
+ hash ^= c;
+ hash *= prime;
+ }
+ }
+ hash ^= m_seed;
+ hash *= prime;
+ const uint32_t low{ static_cast<uint32_t>( hash ) };
+ const uint32_t high{ static_cast<uint32_t>( hash >> 32 ) };
+ return low * high;
+ }
+} // namespace Catch
+
+
+
+
+#include <algorithm>
+#include <set>
+
+namespace Catch {
+
+ std::vector<TestCaseHandle> sortTests( IConfig const& config, std::vector<TestCaseHandle> const& unsortedTestCases ) {
+ switch (config.runOrder()) {
+ case TestRunOrder::Declared:
+ return unsortedTestCases;
+
+ case TestRunOrder::LexicographicallySorted: {
+ std::vector<TestCaseHandle> sorted = unsortedTestCases;
+ std::sort(
+ sorted.begin(),
+ sorted.end(),
+ []( TestCaseHandle const& lhs, TestCaseHandle const& rhs ) {
+ return lhs.getTestCaseInfo() < rhs.getTestCaseInfo();
+ }
+ );
+ return sorted;
+ }
+ case TestRunOrder::Randomized: {
+ seedRng(config);
+ using TestWithHash = std::pair<TestCaseInfoHasher::hash_t, TestCaseHandle>;
+
+ TestCaseInfoHasher h{ config.rngSeed() };
+ std::vector<TestWithHash> indexed_tests;
+ indexed_tests.reserve(unsortedTestCases.size());
+
+ for (auto const& handle : unsortedTestCases) {
+ indexed_tests.emplace_back(h(handle.getTestCaseInfo()), handle);
+ }
+
+ std::sort( indexed_tests.begin(),
+ indexed_tests.end(),
+ []( TestWithHash const& lhs, TestWithHash const& rhs ) {
+ if ( lhs.first == rhs.first ) {
+ return lhs.second.getTestCaseInfo() <
+ rhs.second.getTestCaseInfo();
+ }
+ return lhs.first < rhs.first;
+ } );
+
+ std::vector<TestCaseHandle> randomized;
+ randomized.reserve(indexed_tests.size());
+
+ for (auto const& indexed : indexed_tests) {
+ randomized.push_back(indexed.second);
+ }
+
+ return randomized;
+ }
+ }
+
+ CATCH_INTERNAL_ERROR("Unknown test order value!");
+ }
+
+ bool isThrowSafe( TestCaseHandle const& testCase, IConfig const& config ) {
+ return !testCase.getTestCaseInfo().throws() || config.allowThrows();
+ }
+
+ bool matchTest( TestCaseHandle const& testCase, TestSpec const& testSpec, IConfig const& config ) {
+ return testSpec.matches( testCase.getTestCaseInfo() ) && isThrowSafe( testCase, config );
+ }
+
+ void
+ enforceNoDuplicateTestCases( std::vector<TestCaseHandle> const& tests ) {
+ auto testInfoCmp = []( TestCaseInfo const* lhs,
+ TestCaseInfo const* rhs ) {
+ return *lhs < *rhs;
+ };
+ std::set<TestCaseInfo const*, decltype(testInfoCmp)> seenTests(testInfoCmp);
+ for ( auto const& test : tests ) {
+ const auto infoPtr = &test.getTestCaseInfo();
+ const auto prev = seenTests.insert( infoPtr );
+ CATCH_ENFORCE(
+ prev.second,
+ "error: test case \"" << infoPtr->name << "\", with tags \""
+ << infoPtr->tagsAsString() << "\" already defined.\n"
+ << "\tFirst seen at " << ( *prev.first )->lineInfo << "\n"
+ << "\tRedefined at " << infoPtr->lineInfo );
+ }
+ }
+
+ std::vector<TestCaseHandle> filterTests( std::vector<TestCaseHandle> const& testCases, TestSpec const& testSpec, IConfig const& config ) {
+ std::vector<TestCaseHandle> filtered;
+ filtered.reserve( testCases.size() );
+ for (auto const& testCase : testCases) {
+ if ((!testSpec.hasFilters() && !testCase.getTestCaseInfo().isHidden()) ||
+ (testSpec.hasFilters() && matchTest(testCase, testSpec, config))) {
+ filtered.push_back(testCase);
+ }
+ }
+ return createShard(filtered, config.shardCount(), config.shardIndex());
+ }
+ std::vector<TestCaseHandle> const& getAllTestCasesSorted( IConfig const& config ) {
+ return getRegistryHub().getTestCaseRegistry().getAllTestsSorted( config );
+ }
+
+ void TestRegistry::registerTest(Detail::unique_ptr<TestCaseInfo> testInfo, Detail::unique_ptr<ITestInvoker> testInvoker) {
+ m_handles.emplace_back(testInfo.get(), testInvoker.get());
+ m_viewed_test_infos.push_back(testInfo.get());
+ m_owned_test_infos.push_back(CATCH_MOVE(testInfo));
+ m_invokers.push_back(CATCH_MOVE(testInvoker));
+ }
+
+ std::vector<TestCaseInfo*> const& TestRegistry::getAllInfos() const {
+ return m_viewed_test_infos;
+ }
+
+ std::vector<TestCaseHandle> const& TestRegistry::getAllTests() const {
+ return m_handles;
+ }
+ std::vector<TestCaseHandle> const& TestRegistry::getAllTestsSorted( IConfig const& config ) const {
+ if( m_sortedFunctions.empty() )
+ enforceNoDuplicateTestCases( m_handles );
+
+ if( m_currentSortOrder != config.runOrder() || m_sortedFunctions.empty() ) {
+ m_sortedFunctions = sortTests( config, m_handles );
+ m_currentSortOrder = config.runOrder();
+ }
+ return m_sortedFunctions;
+ }
+
+
+
+ ///////////////////////////////////////////////////////////////////////////
+ void TestInvokerAsFunction::invoke() const {
+ m_testAsFunction();
+ }
+
+} // end namespace Catch
+
+
+
+
+#include <algorithm>
+#include <cassert>
+
+#if defined(__clang__)
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wexit-time-destructors"
+#endif
+
+namespace Catch {
+namespace TestCaseTracking {
+
+ NameAndLocation::NameAndLocation( std::string const& _name, SourceLineInfo const& _location )
+ : name( _name ),
+ location( _location )
+ {}
+
+
+ ITracker::~ITracker() = default;
+
+ void ITracker::markAsNeedingAnotherRun() {
+ m_runState = NeedsAnotherRun;
+ }
+
+ void ITracker::addChild( ITrackerPtr&& child ) {
+ m_children.push_back( CATCH_MOVE(child) );
+ }
+
+ ITracker* ITracker::findChild( NameAndLocation const& nameAndLocation ) {
+ auto it = std::find_if(
+ m_children.begin(),
+ m_children.end(),
+ [&nameAndLocation]( ITrackerPtr const& tracker ) {
+ return tracker->nameAndLocation().location ==
+ nameAndLocation.location &&
+ tracker->nameAndLocation().name == nameAndLocation.name;
+ } );
+ return ( it != m_children.end() ) ? it->get() : nullptr;
+ }
+
+ bool ITracker::isSectionTracker() const { return false; }
+ bool ITracker::isGeneratorTracker() const { return false; }
+
+ bool ITracker::isSuccessfullyCompleted() const {
+ return m_runState == CompletedSuccessfully;
+ }
+
+ bool ITracker::isOpen() const {
+ return m_runState != NotStarted && !isComplete();
+ }
+
+ bool ITracker::hasStarted() const { return m_runState != NotStarted; }
+
+ void ITracker::openChild() {
+ if (m_runState != ExecutingChildren) {
+ m_runState = ExecutingChildren;
+ if (m_parent) {
+ m_parent->openChild();
+ }
+ }
+ }
+
+ ITracker& TrackerContext::startRun() {
+ using namespace std::string_literals;
+ m_rootTracker = Catch::Detail::make_unique<SectionTracker>(
+ NameAndLocation( "{root}"s, CATCH_INTERNAL_LINEINFO ),
+ *this,
+ nullptr );
+ m_currentTracker = nullptr;
+ m_runState = Executing;
+ return *m_rootTracker;
+ }
+
+ void TrackerContext::endRun() {
+ m_rootTracker.reset();
+ m_currentTracker = nullptr;
+ m_runState = NotStarted;
+ }
+
+ void TrackerContext::startCycle() {
+ m_currentTracker = m_rootTracker.get();
+ m_runState = Executing;
+ }
+ void TrackerContext::completeCycle() {
+ m_runState = CompletedCycle;
+ }
+
+ bool TrackerContext::completedCycle() const {
+ return m_runState == CompletedCycle;
+ }
+ ITracker& TrackerContext::currentTracker() {
+ return *m_currentTracker;
+ }
+ void TrackerContext::setCurrentTracker( ITracker* tracker ) {
+ m_currentTracker = tracker;
+ }
+
+
+ TrackerBase::TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent ):
+ ITracker(nameAndLocation, parent),
+ m_ctx( ctx )
+ {}
+
+ bool TrackerBase::isComplete() const {
+ return m_runState == CompletedSuccessfully || m_runState == Failed;
+ }
+
+ void TrackerBase::open() {
+ m_runState = Executing;
+ moveToThis();
+ if( m_parent )
+ m_parent->openChild();
+ }
+
+ void TrackerBase::close() {
+
+ // Close any still open children (e.g. generators)
+ while( &m_ctx.currentTracker() != this )
+ m_ctx.currentTracker().close();
+
+ switch( m_runState ) {
+ case NeedsAnotherRun:
+ break;
+
+ case Executing:
+ m_runState = CompletedSuccessfully;
+ break;
+ case ExecutingChildren:
+ if( std::all_of(m_children.begin(), m_children.end(), [](ITrackerPtr const& t){ return t->isComplete(); }) )
+ m_runState = CompletedSuccessfully;
+ break;
+
+ case NotStarted:
+ case CompletedSuccessfully:
+ case Failed:
+ CATCH_INTERNAL_ERROR( "Illogical state: " << m_runState );
+
+ default:
+ CATCH_INTERNAL_ERROR( "Unknown state: " << m_runState );
+ }
+ moveToParent();
+ m_ctx.completeCycle();
+ }
+ void TrackerBase::fail() {
+ m_runState = Failed;
+ if( m_parent )
+ m_parent->markAsNeedingAnotherRun();
+ moveToParent();
+ m_ctx.completeCycle();
+ }
+
+ void TrackerBase::moveToParent() {
+ assert( m_parent );
+ m_ctx.setCurrentTracker( m_parent );
+ }
+ void TrackerBase::moveToThis() {
+ m_ctx.setCurrentTracker( this );
+ }
+
+ SectionTracker::SectionTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent )
+ : TrackerBase( nameAndLocation, ctx, parent ),
+ m_trimmed_name(trim(nameAndLocation.name))
+ {
+ if( parent ) {
+ while( !parent->isSectionTracker() )
+ parent = parent->parent();
+
+ SectionTracker& parentSection = static_cast<SectionTracker&>( *parent );
+ addNextFilters( parentSection.m_filters );
+ }
+ }
+
+ bool SectionTracker::isComplete() const {
+ bool complete = true;
+
+ if (m_filters.empty()
+ || m_filters[0].empty()
+ || std::find(m_filters.begin(), m_filters.end(), m_trimmed_name) != m_filters.end()) {
+ complete = TrackerBase::isComplete();
+ }
+ return complete;
+ }
+
+ bool SectionTracker::isSectionTracker() const { return true; }
+
+ SectionTracker& SectionTracker::acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation ) {
+ SectionTracker* section;
+
+ ITracker& currentTracker = ctx.currentTracker();
+ if ( ITracker* childTracker =
+ currentTracker.findChild( nameAndLocation ) ) {
+ assert( childTracker );
+ assert( childTracker->isSectionTracker() );
+ section = static_cast<SectionTracker*>( childTracker );
+ } else {
+ auto newSection = Catch::Detail::make_unique<SectionTracker>(
+ nameAndLocation, ctx, &currentTracker );
+ section = newSection.get();
+ currentTracker.addChild( CATCH_MOVE( newSection ) );
+ }
+ if( !ctx.completedCycle() )
+ section->tryOpen();
+ return *section;
+ }
+
+ void SectionTracker::tryOpen() {
+ if( !isComplete() )
+ open();
+ }
+
+ void SectionTracker::addInitialFilters( std::vector<std::string> const& filters ) {
+ if( !filters.empty() ) {
+ m_filters.reserve( m_filters.size() + filters.size() + 2 );
+ m_filters.emplace_back(StringRef{}); // Root - should never be consulted
+ m_filters.emplace_back(StringRef{}); // Test Case - not a section filter
+ m_filters.insert( m_filters.end(), filters.begin(), filters.end() );
+ }
+ }
+ void SectionTracker::addNextFilters( std::vector<StringRef> const& filters ) {
+ if( filters.size() > 1 )
+ m_filters.insert( m_filters.end(), filters.begin()+1, filters.end() );
+ }
+
+ std::vector<StringRef> const& SectionTracker::getFilters() const {
+ return m_filters;
+ }
+
+ StringRef SectionTracker::trimmedName() const {
+ return m_trimmed_name;
+ }
+
+} // namespace TestCaseTracking
+
+} // namespace Catch
+
+#if defined(__clang__)
+# pragma clang diagnostic pop
+#endif
+
+
+
+#include <algorithm>
+#include <iterator>
+
+namespace Catch {
+
+ namespace {
+ StringRef extractClassName( StringRef classOrMethodName ) {
+ if ( !startsWith( classOrMethodName, '&' ) ) {
+ return classOrMethodName;
+ }
+
+ // Remove the leading '&' to avoid having to special case it later
+ const auto methodName =
+ classOrMethodName.substr( 1, classOrMethodName.size() );
+
+ auto reverseStart = std::make_reverse_iterator( methodName.end() );
+ auto reverseEnd = std::make_reverse_iterator( methodName.begin() );
+
+ // We make a simplifying assumption that ":" is only present
+ // in the input as part of "::" from C++ typenames (this is
+ // relatively safe assumption because the input is generated
+ // as stringification of type through preprocessor).
+ auto lastColons = std::find( reverseStart, reverseEnd, ':' ) + 1;
+ auto secondLastColons =
+ std::find( lastColons + 1, reverseEnd, ':' );
+
+ auto const startIdx = reverseEnd - secondLastColons;
+ auto const classNameSize = secondLastColons - lastColons - 1;
+
+ return methodName.substr(
+ static_cast<std::size_t>( startIdx ),
+ static_cast<std::size_t>( classNameSize ) );
+ }
+ } // namespace
+
+ Detail::unique_ptr<ITestInvoker> makeTestInvoker( void(*testAsFunction)() ) {
+ return Detail::make_unique<TestInvokerAsFunction>( testAsFunction );
+ }
+
+ AutoReg::AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept {
+ CATCH_TRY {
+ getMutableRegistryHub()
+ .registerTest(
+ makeTestCaseInfo(
+ extractClassName( classOrMethod ),
+ nameAndTags,
+ lineInfo),
+ CATCH_MOVE(invoker)
+ );
+ } CATCH_CATCH_ALL {
+ // Do not throw when constructing global objects, instead register the exception to be processed later
+ getMutableRegistryHub().registerStartupException();
+ }
+ }
+}
+
+
+
+
+
+namespace Catch {
+
+ TestSpecParser::TestSpecParser( ITagAliasRegistry const& tagAliases ) : m_tagAliases( &tagAliases ) {}
+
+ TestSpecParser& TestSpecParser::parse( std::string const& arg ) {
+ m_mode = None;
+ m_exclusion = false;
+ m_arg = m_tagAliases->expandAliases( arg );
+ m_escapeChars.clear();
+ m_substring.reserve(m_arg.size());
+ m_patternName.reserve(m_arg.size());
+ m_realPatternPos = 0;
+
+ for( m_pos = 0; m_pos < m_arg.size(); ++m_pos )
+ //if visitChar fails
+ if( !visitChar( m_arg[m_pos] ) ){
+ m_testSpec.m_invalidSpecs.push_back(arg);
+ break;
+ }
+ endMode();
+ return *this;
+ }
+ TestSpec TestSpecParser::testSpec() {
+ addFilter();
+ return CATCH_MOVE(m_testSpec);
+ }
+ bool TestSpecParser::visitChar( char c ) {
+ if( (m_mode != EscapedName) && (c == '\\') ) {
+ escape();
+ addCharToPattern(c);
+ return true;
+ }else if((m_mode != EscapedName) && (c == ',') ) {
+ return separate();
+ }
+
+ switch( m_mode ) {
+ case None:
+ if( processNoneChar( c ) )
+ return true;
+ break;
+ case Name:
+ processNameChar( c );
+ break;
+ case EscapedName:
+ endMode();
+ addCharToPattern(c);
+ return true;
+ default:
+ case Tag:
+ case QuotedName:
+ if( processOtherChar( c ) )
+ return true;
+ break;
+ }
+
+ m_substring += c;
+ if( !isControlChar( c ) ) {
+ m_patternName += c;
+ m_realPatternPos++;
+ }
+ return true;
+ }
+ // Two of the processing methods return true to signal the caller to return
+ // without adding the given character to the current pattern strings
+ bool TestSpecParser::processNoneChar( char c ) {
+ switch( c ) {
+ case ' ':
+ return true;
+ case '~':
+ m_exclusion = true;
+ return false;
+ case '[':
+ startNewMode( Tag );
+ return false;
+ case '"':
+ startNewMode( QuotedName );
+ return false;
+ default:
+ startNewMode( Name );
+ return false;
+ }
+ }
+ void TestSpecParser::processNameChar( char c ) {
+ if( c == '[' ) {
+ if( m_substring == "exclude:" )
+ m_exclusion = true;
+ else
+ endMode();
+ startNewMode( Tag );
+ }
+ }
+ bool TestSpecParser::processOtherChar( char c ) {
+ if( !isControlChar( c ) )
+ return false;
+ m_substring += c;
+ endMode();
+ return true;
+ }
+ void TestSpecParser::startNewMode( Mode mode ) {
+ m_mode = mode;
+ }
+ void TestSpecParser::endMode() {
+ switch( m_mode ) {
+ case Name:
+ case QuotedName:
+ return addNamePattern();
+ case Tag:
+ return addTagPattern();
+ case EscapedName:
+ revertBackToLastMode();
+ return;
+ case None:
+ default:
+ return startNewMode( None );
+ }
+ }
+ void TestSpecParser::escape() {
+ saveLastMode();
+ m_mode = EscapedName;
+ m_escapeChars.push_back(m_realPatternPos);
+ }
+ bool TestSpecParser::isControlChar( char c ) const {
+ switch( m_mode ) {
+ default:
+ return false;
+ case None:
+ return c == '~';
+ case Name:
+ return c == '[';
+ case EscapedName:
+ return true;
+ case QuotedName:
+ return c == '"';
+ case Tag:
+ return c == '[' || c == ']';
+ }
+ }
+
+ void TestSpecParser::addFilter() {
+ if( !m_currentFilter.m_required.empty() || !m_currentFilter.m_forbidden.empty() ) {
+ m_testSpec.m_filters.push_back( CATCH_MOVE(m_currentFilter) );
+ m_currentFilter = TestSpec::Filter();
+ }
+ }
+
+ void TestSpecParser::saveLastMode() {
+ lastMode = m_mode;
+ }
+
+ void TestSpecParser::revertBackToLastMode() {
+ m_mode = lastMode;
+ }
+
+ bool TestSpecParser::separate() {
+ if( (m_mode==QuotedName) || (m_mode==Tag) ){
+ //invalid argument, signal failure to previous scope.
+ m_mode = None;
+ m_pos = m_arg.size();
+ m_substring.clear();
+ m_patternName.clear();
+ m_realPatternPos = 0;
+ return false;
+ }
+ endMode();
+ addFilter();
+ return true; //success
+ }
+
+ std::string TestSpecParser::preprocessPattern() {
+ std::string token = m_patternName;
+ for (std::size_t i = 0; i < m_escapeChars.size(); ++i)
+ token = token.substr(0, m_escapeChars[i] - i) + token.substr(m_escapeChars[i] - i + 1);
+ m_escapeChars.clear();
+ if (startsWith(token, "exclude:")) {
+ m_exclusion = true;
+ token = token.substr(8);
+ }
+
+ m_patternName.clear();
+ m_realPatternPos = 0;
+
+ return token;
+ }
+
+ void TestSpecParser::addNamePattern() {
+ auto token = preprocessPattern();
+
+ if (!token.empty()) {
+ if (m_exclusion) {
+ m_currentFilter.m_forbidden.emplace_back(Detail::make_unique<TestSpec::NamePattern>(token, m_substring));
+ } else {
+ m_currentFilter.m_required.emplace_back(Detail::make_unique<TestSpec::NamePattern>(token, m_substring));
+ }
+ }
+ m_substring.clear();
+ m_exclusion = false;
+ m_mode = None;
+ }
+
+ void TestSpecParser::addTagPattern() {
+ auto token = preprocessPattern();
+
+ if (!token.empty()) {
+ // If the tag pattern is the "hide and tag" shorthand (e.g. [.foo])
+ // we have to create a separate hide tag and shorten the real one
+ if (token.size() > 1 && token[0] == '.') {
+ token.erase(token.begin());
+ if (m_exclusion) {
+ m_currentFilter.m_forbidden.emplace_back(Detail::make_unique<TestSpec::TagPattern>(".", m_substring));
+ m_currentFilter.m_forbidden.emplace_back(Detail::make_unique<TestSpec::TagPattern>(token, m_substring));
+ } else {
+ m_currentFilter.m_required.emplace_back(Detail::make_unique<TestSpec::TagPattern>(".", m_substring));
+ m_currentFilter.m_required.emplace_back(Detail::make_unique<TestSpec::TagPattern>(token, m_substring));
+ }
+ }
+ if (m_exclusion) {
+ m_currentFilter.m_forbidden.emplace_back(Detail::make_unique<TestSpec::TagPattern>(token, m_substring));
+ } else {
+ m_currentFilter.m_required.emplace_back(Detail::make_unique<TestSpec::TagPattern>(token, m_substring));
+ }
+ }
+ m_substring.clear();
+ m_exclusion = false;
+ m_mode = None;
+ }
+
+ TestSpec parseTestSpec( std::string const& arg ) {
+ return TestSpecParser( ITagAliasRegistry::get() ).parse( arg ).testSpec();
+ }
+
+} // namespace Catch
+
+
+
+#include <algorithm>
+#include <cstring>
+#include <ostream>
+
+namespace {
+ bool isWhitespace( char c ) {
+ return c == ' ' || c == '\t' || c == '\n' || c == '\r';
+ }
+
+ bool isBreakableBefore( char c ) {
+ static const char chars[] = "[({<|";
+ return std::memchr( chars, c, sizeof( chars ) - 1 ) != nullptr;
+ }
+
+ bool isBreakableAfter( char c ) {
+ static const char chars[] = "])}>.,:;*+-=&/\\";
+ return std::memchr( chars, c, sizeof( chars ) - 1 ) != nullptr;
+ }
+
+ bool isBoundary( std::string const& line, size_t at ) {
+ assert( at > 0 );
+ assert( at <= line.size() );
+
+ return at == line.size() ||
+ ( isWhitespace( line[at] ) && !isWhitespace( line[at - 1] ) ) ||
+ isBreakableBefore( line[at] ) ||
+ isBreakableAfter( line[at - 1] );
+ }
+
+} // namespace
+
+namespace Catch {
+ namespace TextFlow {
+
+ void Column::const_iterator::calcLength() {
+ m_addHyphen = false;
+ m_parsedTo = m_lineStart;
+
+ std::string const& current_line = m_column.m_string;
+ if ( current_line[m_lineStart] == '\n' ) {
+ ++m_parsedTo;
+ }
+
+ const auto maxLineLength = m_column.m_width - indentSize();
+ const auto maxParseTo = std::min(current_line.size(), m_lineStart + maxLineLength);
+ while ( m_parsedTo < maxParseTo &&
+ current_line[m_parsedTo] != '\n' ) {
+ ++m_parsedTo;
+ }
+
+ // If we encountered a newline before the column is filled,
+ // then we linebreak at the newline and consider this line
+ // finished.
+ if ( m_parsedTo < m_lineStart + maxLineLength ) {
+ m_lineLength = m_parsedTo - m_lineStart;
+ } else {
+ // Look for a natural linebreak boundary in the column
+ // (We look from the end, so that the first found boundary is
+ // the right one)
+ size_t newLineLength = maxLineLength;
+ while ( newLineLength > 0 && !isBoundary( current_line, m_lineStart + newLineLength ) ) {
+ --newLineLength;
+ }
+ while ( newLineLength > 0 &&
+ isWhitespace( current_line[m_lineStart + newLineLength - 1] ) ) {
+ --newLineLength;
+ }
+
+ // If we found one, then that is where we linebreak
+ if ( newLineLength > 0 ) {
+ m_lineLength = newLineLength;
+ } else {
+ // Otherwise we have to split text with a hyphen
+ m_addHyphen = true;
+ m_lineLength = maxLineLength - 1;
+ }
+ }
+ }
+
+ size_t Column::const_iterator::indentSize() const {
+ auto initial =
+ m_lineStart == 0 ? m_column.m_initialIndent : std::string::npos;
+ return initial == std::string::npos ? m_column.m_indent : initial;
+ }
+
+ std::string
+ Column::const_iterator::addIndentAndSuffix( size_t position,
+ size_t length ) const {
+ std::string ret;
+ const auto desired_indent = indentSize();
+ ret.reserve( desired_indent + length + m_addHyphen );
+ ret.append( desired_indent, ' ' );
+ ret.append( m_column.m_string, position, length );
+ if ( m_addHyphen ) {
+ ret.push_back( '-' );
+ }
+
+ return ret;
+ }
+
+ Column::const_iterator::const_iterator( Column const& column ): m_column( column ) {
+ assert( m_column.m_width > m_column.m_indent );
+ assert( m_column.m_initialIndent == std::string::npos ||
+ m_column.m_width > m_column.m_initialIndent );
+ calcLength();
+ if ( m_lineLength == 0 ) {
+ m_lineStart = m_column.m_string.size();
+ }
+ }
+
+ std::string Column::const_iterator::operator*() const {
+ assert( m_lineStart <= m_parsedTo );
+ return addIndentAndSuffix( m_lineStart, m_lineLength );
+ }
+
+ Column::const_iterator& Column::const_iterator::operator++() {
+ m_lineStart += m_lineLength;
+ std::string const& current_line = m_column.m_string;
+ if ( m_lineStart < current_line.size() && current_line[m_lineStart] == '\n' ) {
+ m_lineStart += 1;
+ } else {
+ while ( m_lineStart < current_line.size() &&
+ isWhitespace( current_line[m_lineStart] ) ) {
+ ++m_lineStart;
+ }
+ }
+
+ if ( m_lineStart != current_line.size() ) {
+ calcLength();
+ }
+ return *this;
+ }
+
+ Column::const_iterator Column::const_iterator::operator++( int ) {
+ const_iterator prev( *this );
+ operator++();
+ return prev;
+ }
+
+ std::ostream& operator<<( std::ostream& os, Column const& col ) {
+ bool first = true;
+ for ( auto line : col ) {
+ if ( first ) {
+ first = false;
+ } else {
+ os << '\n';
+ }
+ os << line;
+ }
+ return os;
+ }
+
+ Column Spacer( size_t spaceWidth ) {
+ Column ret{ "" };
+ ret.width( spaceWidth );
+ return ret;
+ }
+
+ Columns::iterator::iterator( Columns const& columns, EndTag ):
+ m_columns( columns.m_columns ), m_activeIterators( 0 ) {
+
+ m_iterators.reserve( m_columns.size() );
+ for ( auto const& col : m_columns ) {
+ m_iterators.push_back( col.end() );
+ }
+ }
+
+ Columns::iterator::iterator( Columns const& columns ):
+ m_columns( columns.m_columns ),
+ m_activeIterators( m_columns.size() ) {
+
+ m_iterators.reserve( m_columns.size() );
+ for ( auto const& col : m_columns ) {
+ m_iterators.push_back( col.begin() );
+ }
+ }
+
+ std::string Columns::iterator::operator*() const {
+ std::string row, padding;
+
+ for ( size_t i = 0; i < m_columns.size(); ++i ) {
+ const auto width = m_columns[i].width();
+ if ( m_iterators[i] != m_columns[i].end() ) {
+ std::string col = *m_iterators[i];
+ row += padding;
+ row += col;
+
+ padding.clear();
+ if ( col.size() < width ) {
+ padding.append( width - col.size(), ' ' );
+ }
+ } else {
+ padding.append( width, ' ' );
+ }
+ }
+ return row;
+ }
+
+ Columns::iterator& Columns::iterator::operator++() {
+ for ( size_t i = 0; i < m_columns.size(); ++i ) {
+ if ( m_iterators[i] != m_columns[i].end() ) {
+ ++m_iterators[i];
+ }
+ }
+ return *this;
+ }
+
+ Columns::iterator Columns::iterator::operator++( int ) {
+ iterator prev( *this );
+ operator++();
+ return prev;
+ }
+
+ std::ostream& operator<<( std::ostream& os, Columns const& cols ) {
+ bool first = true;
+ for ( auto line : cols ) {
+ if ( first ) {
+ first = false;
+ } else {
+ os << '\n';
+ }
+ os << line;
+ }
+ return os;
+ }
+
+ Columns Column::operator+( Column const& other ) {
+ Columns cols;
+ cols += *this;
+ cols += other;
+ return cols;
+ }
+
+ Columns& Columns::operator+=( Column const& col ) {
+ m_columns.push_back( col );
+ return *this;
+ }
+
+ Columns Columns::operator+( Column const& col ) {
+ Columns combined = *this;
+ combined += col;
+ return combined;
+ }
+
+ } // namespace TextFlow
+} // namespace Catch
+
+
+
+
+#include <exception>
+
+namespace Catch {
+ bool uncaught_exceptions() {
+#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+ return false;
+#elif defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
+ return std::uncaught_exceptions() > 0;
+#else
+ return std::uncaught_exception();
+#endif
+ }
+} // end namespace Catch
+
+
+
+namespace Catch {
+
+ WildcardPattern::WildcardPattern( std::string const& pattern,
+ CaseSensitive caseSensitivity )
+ : m_caseSensitivity( caseSensitivity ),
+ m_pattern( normaliseString( pattern ) )
+ {
+ if( startsWith( m_pattern, '*' ) ) {
+ m_pattern = m_pattern.substr( 1 );
+ m_wildcard = WildcardAtStart;
+ }
+ if( endsWith( m_pattern, '*' ) ) {
+ m_pattern = m_pattern.substr( 0, m_pattern.size()-1 );
+ m_wildcard = static_cast<WildcardPosition>( m_wildcard | WildcardAtEnd );
+ }
+ }
+
+ bool WildcardPattern::matches( std::string const& str ) const {
+ switch( m_wildcard ) {
+ case NoWildcard:
+ return m_pattern == normaliseString( str );
+ case WildcardAtStart:
+ return endsWith( normaliseString( str ), m_pattern );
+ case WildcardAtEnd:
+ return startsWith( normaliseString( str ), m_pattern );
+ case WildcardAtBothEnds:
+ return contains( normaliseString( str ), m_pattern );
+ default:
+ CATCH_INTERNAL_ERROR( "Unknown enum" );
+ }
+ }
+
+ std::string WildcardPattern::normaliseString( std::string const& str ) const {
+ return trim( m_caseSensitivity == CaseSensitive::No ? toLower( str ) : str );
+ }
+}
+
+
+// Note: swapping these two includes around causes MSVC to error out
+// while in /permissive- mode. No, I don't know why.
+// Tested on VS 2019, 18.{3, 4}.x
+
+#include <iomanip>
+#include <type_traits>
+
+namespace Catch {
+
+namespace {
+
+ size_t trailingBytes(unsigned char c) {
+ if ((c & 0xE0) == 0xC0) {
+ return 2;
+ }
+ if ((c & 0xF0) == 0xE0) {
+ return 3;
+ }
+ if ((c & 0xF8) == 0xF0) {
+ return 4;
+ }
+ CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered");
+ }
+
+ uint32_t headerValue(unsigned char c) {
+ if ((c & 0xE0) == 0xC0) {
+ return c & 0x1F;
+ }
+ if ((c & 0xF0) == 0xE0) {
+ return c & 0x0F;
+ }
+ if ((c & 0xF8) == 0xF0) {
+ return c & 0x07;
+ }
+ CATCH_INTERNAL_ERROR("Invalid multibyte utf-8 start byte encountered");
+ }
+
+ void hexEscapeChar(std::ostream& os, unsigned char c) {
+ std::ios_base::fmtflags f(os.flags());
+ os << "\\x"
+ << std::uppercase << std::hex << std::setfill('0') << std::setw(2)
+ << static_cast<int>(c);
+ os.flags(f);
+ }
+
+ bool shouldNewline(XmlFormatting fmt) {
+ return !!(static_cast<std::underlying_type_t<XmlFormatting>>(fmt & XmlFormatting::Newline));
+ }
+
+ bool shouldIndent(XmlFormatting fmt) {
+ return !!(static_cast<std::underlying_type_t<XmlFormatting>>(fmt & XmlFormatting::Indent));
+ }
+
+} // anonymous namespace
+
+ XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs) {
+ return static_cast<XmlFormatting>(
+ static_cast<std::underlying_type_t<XmlFormatting>>(lhs) |
+ static_cast<std::underlying_type_t<XmlFormatting>>(rhs)
+ );
+ }
+
+ XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs) {
+ return static_cast<XmlFormatting>(
+ static_cast<std::underlying_type_t<XmlFormatting>>(lhs) &
+ static_cast<std::underlying_type_t<XmlFormatting>>(rhs)
+ );
+ }
+
+
+ XmlEncode::XmlEncode( StringRef str, ForWhat forWhat )
+ : m_str( str ),
+ m_forWhat( forWhat )
+ {}
+
+ void XmlEncode::encodeTo( std::ostream& os ) const {
+ // Apostrophe escaping not necessary if we always use " to write attributes
+ // (see: http://www.w3.org/TR/xml/#syntax)
+
+ for( std::size_t idx = 0; idx < m_str.size(); ++ idx ) {
+ unsigned char c = static_cast<unsigned char>(m_str[idx]);
+ switch (c) {
+ case '<': os << "&lt;"; break;
+ case '&': os << "&amp;"; break;
+
+ case '>':
+ // See: http://www.w3.org/TR/xml/#syntax
+ if (idx > 2 && m_str[idx - 1] == ']' && m_str[idx - 2] == ']')
+ os << "&gt;";
+ else
+ os << c;
+ break;
+
+ case '\"':
+ if (m_forWhat == ForAttributes)
+ os << "&quot;";
+ else
+ os << c;
+ break;
+
+ default:
+ // Check for control characters and invalid utf-8
+
+ // Escape control characters in standard ascii
+ // see http://stackoverflow.com/questions/404107/why-are-control-characters-illegal-in-xml-1-0
+ if (c < 0x09 || (c > 0x0D && c < 0x20) || c == 0x7F) {
+ hexEscapeChar(os, c);
+ break;
+ }
+
+ // Plain ASCII: Write it to stream
+ if (c < 0x7F) {
+ os << c;
+ break;
+ }
+
+ // UTF-8 territory
+ // Check if the encoding is valid and if it is not, hex escape bytes.
+ // Important: We do not check the exact decoded values for validity, only the encoding format
+ // First check that this bytes is a valid lead byte:
+ // This means that it is not encoded as 1111 1XXX
+ // Or as 10XX XXXX
+ if (c < 0xC0 ||
+ c >= 0xF8) {
+ hexEscapeChar(os, c);
+ break;
+ }
+
+ auto encBytes = trailingBytes(c);
+ // Are there enough bytes left to avoid accessing out-of-bounds memory?
+ if (idx + encBytes - 1 >= m_str.size()) {
+ hexEscapeChar(os, c);
+ break;
+ }
+ // The header is valid, check data
+ // The next encBytes bytes must together be a valid utf-8
+ // This means: bitpattern 10XX XXXX and the extracted value is sane (ish)
+ bool valid = true;
+ uint32_t value = headerValue(c);
+ for (std::size_t n = 1; n < encBytes; ++n) {
+ unsigned char nc = static_cast<unsigned char>(m_str[idx + n]);
+ valid &= ((nc & 0xC0) == 0x80);
+ value = (value << 6) | (nc & 0x3F);
+ }
+
+ if (
+ // Wrong bit pattern of following bytes
+ (!valid) ||
+ // Overlong encodings
+ (value < 0x80) ||
+ (0x80 <= value && value < 0x800 && encBytes > 2) ||
+ (0x800 < value && value < 0x10000 && encBytes > 3) ||
+ // Encoded value out of range
+ (value >= 0x110000)
+ ) {
+ hexEscapeChar(os, c);
+ break;
+ }
+
+ // If we got here, this is in fact a valid(ish) utf-8 sequence
+ for (std::size_t n = 0; n < encBytes; ++n) {
+ os << m_str[idx + n];
+ }
+ idx += encBytes - 1;
+ break;
+ }
+ }
+ }
+
+ std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode ) {
+ xmlEncode.encodeTo( os );
+ return os;
+ }
+
+ XmlWriter::ScopedElement::ScopedElement( XmlWriter* writer, XmlFormatting fmt )
+ : m_writer( writer ),
+ m_fmt(fmt)
+ {}
+
+ XmlWriter::ScopedElement::ScopedElement( ScopedElement&& other ) noexcept
+ : m_writer( other.m_writer ),
+ m_fmt(other.m_fmt)
+ {
+ other.m_writer = nullptr;
+ other.m_fmt = XmlFormatting::None;
+ }
+ XmlWriter::ScopedElement& XmlWriter::ScopedElement::operator=( ScopedElement&& other ) noexcept {
+ if ( m_writer ) {
+ m_writer->endElement();
+ }
+ m_writer = other.m_writer;
+ other.m_writer = nullptr;
+ m_fmt = other.m_fmt;
+ other.m_fmt = XmlFormatting::None;
+ return *this;
+ }
+
+
+ XmlWriter::ScopedElement::~ScopedElement() {
+ if (m_writer) {
+ m_writer->endElement(m_fmt);
+ }
+ }
+
+ XmlWriter::ScopedElement&
+ XmlWriter::ScopedElement::writeText( StringRef text, XmlFormatting fmt ) {
+ m_writer->writeText( text, fmt );
+ return *this;
+ }
+
+ XmlWriter::ScopedElement&
+ XmlWriter::ScopedElement::writeAttribute( StringRef name,
+ StringRef attribute ) {
+ m_writer->writeAttribute( name, attribute );
+ return *this;
+ }
+
+
+ XmlWriter::XmlWriter( std::ostream& os ) : m_os( os )
+ {
+ writeDeclaration();
+ }
+
+ XmlWriter::~XmlWriter() {
+ while (!m_tags.empty()) {
+ endElement();
+ }
+ newlineIfNecessary();
+ }
+
+ XmlWriter& XmlWriter::startElement( std::string const& name, XmlFormatting fmt ) {
+ ensureTagClosed();
+ newlineIfNecessary();
+ if (shouldIndent(fmt)) {
+ m_os << m_indent;
+ m_indent += " ";
+ }
+ m_os << '<' << name;
+ m_tags.push_back( name );
+ m_tagIsOpen = true;
+ applyFormatting(fmt);
+ return *this;
+ }
+
+ XmlWriter::ScopedElement XmlWriter::scopedElement( std::string const& name, XmlFormatting fmt ) {
+ ScopedElement scoped( this, fmt );
+ startElement( name, fmt );
+ return scoped;
+ }
+
+ XmlWriter& XmlWriter::endElement(XmlFormatting fmt) {
+ m_indent = m_indent.substr(0, m_indent.size() - 2);
+
+ if( m_tagIsOpen ) {
+ m_os << "/>";
+ m_tagIsOpen = false;
+ } else {
+ newlineIfNecessary();
+ if (shouldIndent(fmt)) {
+ m_os << m_indent;
+ }
+ m_os << "</" << m_tags.back() << '>';
+ }
+ m_os << std::flush;
+ applyFormatting(fmt);
+ m_tags.pop_back();
+ return *this;
+ }
+
+ XmlWriter& XmlWriter::writeAttribute( StringRef name,
+ StringRef attribute ) {
+ if( !name.empty() && !attribute.empty() )
+ m_os << ' ' << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << '"';
+ return *this;
+ }
+
+ XmlWriter& XmlWriter::writeAttribute( StringRef name, bool attribute ) {
+ writeAttribute(name, (attribute ? "true"_sr : "false"_sr));
+ return *this;
+ }
+
+ XmlWriter& XmlWriter::writeAttribute( StringRef name,
+ char const* attribute ) {
+ writeAttribute( name, StringRef( attribute ) );
+ return *this;
+ }
+
+ XmlWriter& XmlWriter::writeText( StringRef text, XmlFormatting fmt ) {
+ CATCH_ENFORCE(!m_tags.empty(), "Cannot write text as top level element");
+ if( !text.empty() ){
+ bool tagWasOpen = m_tagIsOpen;
+ ensureTagClosed();
+ if (tagWasOpen && shouldIndent(fmt)) {
+ m_os << m_indent;
+ }
+ m_os << XmlEncode( text, XmlEncode::ForTextNodes );
+ applyFormatting(fmt);
+ }
+ return *this;
+ }
+
+ XmlWriter& XmlWriter::writeComment( StringRef text, XmlFormatting fmt ) {
+ ensureTagClosed();
+ if (shouldIndent(fmt)) {
+ m_os << m_indent;
+ }
+ m_os << "<!-- " << text << " -->";
+ applyFormatting(fmt);
+ return *this;
+ }
+
+ void XmlWriter::writeStylesheetRef( StringRef url ) {
+ m_os << R"(<?xml-stylesheet type="text/xsl" href=")" << url << R"("?>)" << '\n';
+ }
+
+ void XmlWriter::ensureTagClosed() {
+ if( m_tagIsOpen ) {
+ m_os << '>' << std::flush;
+ newlineIfNecessary();
+ m_tagIsOpen = false;
+ }
+ }
+
+ void XmlWriter::applyFormatting(XmlFormatting fmt) {
+ m_needsNewline = shouldNewline(fmt);
+ }
+
+ void XmlWriter::writeDeclaration() {
+ m_os << R"(<?xml version="1.0" encoding="UTF-8"?>)" << '\n';
+ }
+
+ void XmlWriter::newlineIfNecessary() {
+ if( m_needsNewline ) {
+ m_os << '\n' << std::flush;
+ m_needsNewline = false;
+ }
+ }
+}
+
+
+
+
+
+namespace Catch {
+namespace Matchers {
+
+ std::string MatcherUntypedBase::toString() const {
+ if (m_cachedToString.empty()) {
+ m_cachedToString = describe();
+ }
+ return m_cachedToString;
+ }
+
+ MatcherUntypedBase::~MatcherUntypedBase() = default;
+
+} // namespace Matchers
+} // namespace Catch
+
+
+
+
+namespace Catch {
+namespace Matchers {
+
+ std::string IsEmptyMatcher::describe() const {
+ return "is empty";
+ }
+
+ std::string HasSizeMatcher::describe() const {
+ ReusableStringStream sstr;
+ sstr << "has size == " << m_target_size;
+ return sstr.str();
+ }
+
+ IsEmptyMatcher IsEmpty() {
+ return {};
+ }
+
+ HasSizeMatcher SizeIs(std::size_t sz) {
+ return HasSizeMatcher{ sz };
+ }
+
+} // end namespace Matchers
+} // end namespace Catch
+
+
+
+namespace Catch {
+namespace Matchers {
+
+bool ExceptionMessageMatcher::match(std::exception const& ex) const {
+ return ex.what() == m_message;
+}
+
+std::string ExceptionMessageMatcher::describe() const {
+ return "exception message matches \"" + m_message + '"';
+}
+
+ExceptionMessageMatcher Message(std::string const& message) {
+ return ExceptionMessageMatcher(message);
+}
+
+} // namespace Matchers
+} // namespace Catch
+
+
+
+#include <algorithm>
+#include <cmath>
+#include <cstdlib>
+#include <cstdint>
+#include <sstream>
+#include <iomanip>
+#include <limits>
+
+
+namespace Catch {
+namespace {
+
+ template <typename FP>
+ bool almostEqualUlps(FP lhs, FP rhs, uint64_t maxUlpDiff) {
+ // Comparison with NaN should always be false.
+ // This way we can rule it out before getting into the ugly details
+ if (Catch::isnan(lhs) || Catch::isnan(rhs)) {
+ return false;
+ }
+
+ // This should also handle positive and negative zeros, infinities
+ const auto ulpDist = ulpDistance(lhs, rhs);
+
+ return ulpDist <= maxUlpDiff;
+ }
+
+#if defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
+
+ float nextafter(float x, float y) {
+ return ::nextafterf(x, y);
+ }
+
+ double nextafter(double x, double y) {
+ return ::nextafter(x, y);
+ }
+
+#endif // ^^^ CATCH_CONFIG_GLOBAL_NEXTAFTER ^^^
+
+template <typename FP>
+FP step(FP start, FP direction, uint64_t steps) {
+ for (uint64_t i = 0; i < steps; ++i) {
+#if defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
+ start = Catch::nextafter(start, direction);
+#else
+ start = std::nextafter(start, direction);
+#endif
+ }
+ return start;
+}
+
+// Performs equivalent check of std::fabs(lhs - rhs) <= margin
+// But without the subtraction to allow for INFINITY in comparison
+bool marginComparison(double lhs, double rhs, double margin) {
+ return (lhs + margin >= rhs) && (rhs + margin >= lhs);
+}
+
+template <typename FloatingPoint>
+void write(std::ostream& out, FloatingPoint num) {
+ out << std::scientific
+ << std::setprecision(std::numeric_limits<FloatingPoint>::max_digits10 - 1)
+ << num;
+}
+
+} // end anonymous namespace
+
+namespace Matchers {
+namespace Detail {
+
+ enum class FloatingPointKind : uint8_t {
+ Float,
+ Double
+ };
+
+} // end namespace Detail
+
+
+ WithinAbsMatcher::WithinAbsMatcher(double target, double margin)
+ :m_target{ target }, m_margin{ margin } {
+ CATCH_ENFORCE(margin >= 0, "Invalid margin: " << margin << '.'
+ << " Margin has to be non-negative.");
+ }
+
+ // Performs equivalent check of std::fabs(lhs - rhs) <= margin
+ // But without the subtraction to allow for INFINITY in comparison
+ bool WithinAbsMatcher::match(double const& matchee) const {
+ return (matchee + m_margin >= m_target) && (m_target + m_margin >= matchee);
+ }
+
+ std::string WithinAbsMatcher::describe() const {
+ return "is within " + ::Catch::Detail::stringify(m_margin) + " of " + ::Catch::Detail::stringify(m_target);
+ }
+
+
+ WithinUlpsMatcher::WithinUlpsMatcher(double target, uint64_t ulps, Detail::FloatingPointKind baseType)
+ :m_target{ target }, m_ulps{ ulps }, m_type{ baseType } {
+ CATCH_ENFORCE(m_type == Detail::FloatingPointKind::Double
+ || m_ulps < (std::numeric_limits<uint32_t>::max)(),
+ "Provided ULP is impossibly large for a float comparison.");
+ CATCH_ENFORCE( std::numeric_limits<double>::is_iec559,
+ "WithinUlp matcher only supports platforms with "
+ "IEEE-754 compatible floating point representation" );
+ }
+
+#if defined(__clang__)
+#pragma clang diagnostic push
+// Clang <3.5 reports on the default branch in the switch below
+#pragma clang diagnostic ignored "-Wunreachable-code"
+#endif
+
+ bool WithinUlpsMatcher::match(double const& matchee) const {
+ switch (m_type) {
+ case Detail::FloatingPointKind::Float:
+ return almostEqualUlps<float>(static_cast<float>(matchee), static_cast<float>(m_target), m_ulps);
+ case Detail::FloatingPointKind::Double:
+ return almostEqualUlps<double>(matchee, m_target, m_ulps);
+ default:
+ CATCH_INTERNAL_ERROR( "Unknown Detail::FloatingPointKind value" );
+ }
+ }
+
+#if defined(__clang__)
+#pragma clang diagnostic pop
+#endif
+
+ std::string WithinUlpsMatcher::describe() const {
+ std::stringstream ret;
+
+ ret << "is within " << m_ulps << " ULPs of ";
+
+ if (m_type == Detail::FloatingPointKind::Float) {
+ write(ret, static_cast<float>(m_target));
+ ret << 'f';
+ } else {
+ write(ret, m_target);
+ }
+
+ ret << " ([";
+ if (m_type == Detail::FloatingPointKind::Double) {
+ write( ret,
+ step( m_target,
+ -std::numeric_limits<double>::infinity(),
+ m_ulps ) );
+ ret << ", ";
+ write( ret,
+ step( m_target,
+ std::numeric_limits<double>::infinity(),
+ m_ulps ) );
+ } else {
+ // We have to cast INFINITY to float because of MinGW, see #1782
+ write( ret,
+ step( static_cast<float>( m_target ),
+ -std::numeric_limits<float>::infinity(),
+ m_ulps ) );
+ ret << ", ";
+ write( ret,
+ step( static_cast<float>( m_target ),
+ std::numeric_limits<float>::infinity(),
+ m_ulps ) );
+ }
+ ret << "])";
+
+ return ret.str();
+ }
+
+ WithinRelMatcher::WithinRelMatcher(double target, double epsilon):
+ m_target(target),
+ m_epsilon(epsilon){
+ CATCH_ENFORCE(m_epsilon >= 0., "Relative comparison with epsilon < 0 does not make sense.");
+ CATCH_ENFORCE(m_epsilon < 1., "Relative comparison with epsilon >= 1 does not make sense.");
+ }
+
+ bool WithinRelMatcher::match(double const& matchee) const {
+ const auto relMargin = m_epsilon * (std::max)(std::fabs(matchee), std::fabs(m_target));
+ return marginComparison(matchee, m_target,
+ std::isinf(relMargin)? 0 : relMargin);
+ }
+
+ std::string WithinRelMatcher::describe() const {
+ Catch::ReusableStringStream sstr;
+ sstr << "and " << m_target << " are within " << m_epsilon * 100. << "% of each other";
+ return sstr.str();
+ }
+
+
+WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff) {
+ return WithinUlpsMatcher(target, maxUlpDiff, Detail::FloatingPointKind::Double);
+}
+
+WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff) {
+ return WithinUlpsMatcher(target, maxUlpDiff, Detail::FloatingPointKind::Float);
+}
+
+WithinAbsMatcher WithinAbs(double target, double margin) {
+ return WithinAbsMatcher(target, margin);
+}
+
+WithinRelMatcher WithinRel(double target, double eps) {
+ return WithinRelMatcher(target, eps);
+}
+
+WithinRelMatcher WithinRel(double target) {
+ return WithinRelMatcher(target, std::numeric_limits<double>::epsilon() * 100);
+}
+
+WithinRelMatcher WithinRel(float target, float eps) {
+ return WithinRelMatcher(target, eps);
+}
+
+WithinRelMatcher WithinRel(float target) {
+ return WithinRelMatcher(target, std::numeric_limits<float>::epsilon() * 100);
+}
+
+
+} // namespace Matchers
+} // namespace Catch
+
+
+
+
+std::string Catch::Matchers::Detail::finalizeDescription(const std::string& desc) {
+ if (desc.empty()) {
+ return "matches undescribed predicate";
+ } else {
+ return "matches predicate: \"" + desc + '"';
+ }
+}
+
+
+
+namespace Catch {
+ namespace Matchers {
+ std::string AllTrueMatcher::describe() const { return "contains only true"; }
+
+ AllTrueMatcher AllTrue() { return AllTrueMatcher{}; }
+
+ std::string NoneTrueMatcher::describe() const { return "contains no true"; }
+
+ NoneTrueMatcher NoneTrue() { return NoneTrueMatcher{}; }
+
+ std::string AnyTrueMatcher::describe() const { return "contains at least one true"; }
+
+ AnyTrueMatcher AnyTrue() { return AnyTrueMatcher{}; }
+ } // namespace Matchers
+} // namespace Catch
+
+
+
+#include <regex>
+
+namespace Catch {
+namespace Matchers {
+
+ CasedString::CasedString( std::string const& str, CaseSensitive caseSensitivity )
+ : m_caseSensitivity( caseSensitivity ),
+ m_str( adjustString( str ) )
+ {}
+ std::string CasedString::adjustString( std::string const& str ) const {
+ return m_caseSensitivity == CaseSensitive::No
+ ? toLower( str )
+ : str;
+ }
+ StringRef CasedString::caseSensitivitySuffix() const {
+ return m_caseSensitivity == CaseSensitive::Yes
+ ? StringRef()
+ : " (case insensitive)"_sr;
+ }
+
+
+ StringMatcherBase::StringMatcherBase( StringRef operation, CasedString const& comparator )
+ : m_comparator( comparator ),
+ m_operation( operation ) {
+ }
+
+ std::string StringMatcherBase::describe() const {
+ std::string description;
+ description.reserve(5 + m_operation.size() + m_comparator.m_str.size() +
+ m_comparator.caseSensitivitySuffix().size());
+ description += m_operation;
+ description += ": \"";
+ description += m_comparator.m_str;
+ description += '"';
+ description += m_comparator.caseSensitivitySuffix();
+ return description;
+ }
+
+ StringEqualsMatcher::StringEqualsMatcher( CasedString const& comparator ) : StringMatcherBase( "equals"_sr, comparator ) {}
+
+ bool StringEqualsMatcher::match( std::string const& source ) const {
+ return m_comparator.adjustString( source ) == m_comparator.m_str;
+ }
+
+
+ StringContainsMatcher::StringContainsMatcher( CasedString const& comparator ) : StringMatcherBase( "contains"_sr, comparator ) {}
+
+ bool StringContainsMatcher::match( std::string const& source ) const {
+ return contains( m_comparator.adjustString( source ), m_comparator.m_str );
+ }
+
+
+ StartsWithMatcher::StartsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "starts with"_sr, comparator ) {}
+
+ bool StartsWithMatcher::match( std::string const& source ) const {
+ return startsWith( m_comparator.adjustString( source ), m_comparator.m_str );
+ }
+
+
+ EndsWithMatcher::EndsWithMatcher( CasedString const& comparator ) : StringMatcherBase( "ends with"_sr, comparator ) {}
+
+ bool EndsWithMatcher::match( std::string const& source ) const {
+ return endsWith( m_comparator.adjustString( source ), m_comparator.m_str );
+ }
+
+
+
+ RegexMatcher::RegexMatcher(std::string regex, CaseSensitive caseSensitivity): m_regex(CATCH_MOVE(regex)), m_caseSensitivity(caseSensitivity) {}
+
+ bool RegexMatcher::match(std::string const& matchee) const {
+ auto flags = std::regex::ECMAScript; // ECMAScript is the default syntax option anyway
+ if (m_caseSensitivity == CaseSensitive::No) {
+ flags |= std::regex::icase;
+ }
+ auto reg = std::regex(m_regex, flags);
+ return std::regex_match(matchee, reg);
+ }
+
+ std::string RegexMatcher::describe() const {
+ return "matches " + ::Catch::Detail::stringify(m_regex) + ((m_caseSensitivity == CaseSensitive::Yes)? " case sensitively" : " case insensitively");
+ }
+
+
+ StringEqualsMatcher Equals( std::string const& str, CaseSensitive caseSensitivity ) {
+ return StringEqualsMatcher( CasedString( str, caseSensitivity) );
+ }
+ StringContainsMatcher ContainsSubstring( std::string const& str, CaseSensitive caseSensitivity ) {
+ return StringContainsMatcher( CasedString( str, caseSensitivity) );
+ }
+ EndsWithMatcher EndsWith( std::string const& str, CaseSensitive caseSensitivity ) {
+ return EndsWithMatcher( CasedString( str, caseSensitivity) );
+ }
+ StartsWithMatcher StartsWith( std::string const& str, CaseSensitive caseSensitivity ) {
+ return StartsWithMatcher( CasedString( str, caseSensitivity) );
+ }
+
+ RegexMatcher Matches(std::string const& regex, CaseSensitive caseSensitivity) {
+ return RegexMatcher(regex, caseSensitivity);
+ }
+
+} // namespace Matchers
+} // namespace Catch
+
+
+
+namespace Catch {
+namespace Matchers {
+ MatcherGenericBase::~MatcherGenericBase() = default;
+
+ namespace Detail {
+
+ std::string describe_multi_matcher(StringRef combine, std::string const* descriptions_begin, std::string const* descriptions_end) {
+ std::string description;
+ std::size_t combined_size = 4;
+ for ( auto desc = descriptions_begin; desc != descriptions_end; ++desc ) {
+ combined_size += desc->size();
+ }
+ combined_size += static_cast<size_t>(descriptions_end - descriptions_begin - 1) * combine.size();
+
+ description.reserve(combined_size);
+
+ description += "( ";
+ bool first = true;
+ for( auto desc = descriptions_begin; desc != descriptions_end; ++desc ) {
+ if( first )
+ first = false;
+ else
+ description += combine;
+ description += *desc;
+ }
+ description += " )";
+ return description;
+ }
+
+ } // namespace Detail
+} // namespace Matchers
+} // namespace Catch
+
+
+
+
+namespace Catch {
+
+ // This is the general overload that takes a any string matcher
+ // There is another overload, in catch_assertionhandler.h/.cpp, that only takes a string and infers
+ // the Equals matcher (so the header does not mention matchers)
+ void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef matcherString ) {
+ std::string exceptionMessage = Catch::translateActiveException();
+ MatchExpr<std::string, StringMatcher const&> expr( CATCH_MOVE(exceptionMessage), matcher, matcherString );
+ handler.handleExpr( expr );
+ }
+
+} // namespace Catch
+
+
+
+#include <ostream>
+
+namespace Catch {
+
+ AutomakeReporter::~AutomakeReporter() {}
+
+ void AutomakeReporter::testCaseEnded(TestCaseStats const& _testCaseStats) {
+ // Possible values to emit are PASS, XFAIL, SKIP, FAIL, XPASS and ERROR.
+ m_stream << ":test-result: ";
+ if (_testCaseStats.totals.assertions.allPassed()) {
+ m_stream << "PASS";
+ } else if (_testCaseStats.totals.assertions.allOk()) {
+ m_stream << "XFAIL";
+ } else {
+ m_stream << "FAIL";
+ }
+ m_stream << ' ' << _testCaseStats.testInfo->name << '\n';
+ StreamingReporterBase::testCaseEnded(_testCaseStats);
+ }
+
+ void AutomakeReporter::skipTest(TestCaseInfo const& testInfo) {
+ m_stream << ":test-result: SKIP " << testInfo.name << '\n';
+ }
+
+} // end namespace Catch
+
+
+
+
+
+
+namespace Catch {
+ ReporterBase::ReporterBase( ReporterConfig&& config ):
+ IEventListener( config.fullConfig() ),
+ m_wrapped_stream( CATCH_MOVE(config).takeStream() ),
+ m_stream( m_wrapped_stream->stream() ),
+ m_colour( makeColourImpl( config.colourMode(), m_wrapped_stream.get() ) ),
+ m_customOptions( config.customOptions() )
+ {}
+
+ ReporterBase::~ReporterBase() = default;
+
+ void ReporterBase::listReporters(
+ std::vector<ReporterDescription> const& descriptions ) {
+ defaultListReporters(m_stream, descriptions, m_config->verbosity());
+ }
+
+ void ReporterBase::listListeners(
+ std::vector<ListenerDescription> const& descriptions ) {
+ defaultListListeners( m_stream, descriptions );
+ }
+
+ void ReporterBase::listTests(std::vector<TestCaseHandle> const& tests) {
+ defaultListTests(m_stream,
+ m_colour.get(),
+ tests,
+ m_config->hasTestFilters(),
+ m_config->verbosity());
+ }
+
+ void ReporterBase::listTags(std::vector<TagInfo> const& tags) {
+ defaultListTags( m_stream, tags, m_config->hasTestFilters() );
+ }
+
+} // namespace Catch
+
+
+
+
+#include <ostream>
+
+namespace {
+
+ constexpr Catch::StringRef bothOrAll( std::uint64_t count ) {
+ switch (count) {
+ case 1:
+ return Catch::StringRef{};
+ case 2:
+ return "both "_catch_sr;
+ default:
+ return "all "_catch_sr;
+ }
+ }
+
+} // anon namespace
+
+
+namespace Catch {
+namespace {
+
+ // Colour::LightGrey
+ static constexpr Colour::Code compactDimColour = Colour::FileName;
+
+#ifdef CATCH_PLATFORM_MAC
+ static constexpr Catch::StringRef compactFailedString = "FAILED"_sr;
+ static constexpr Catch::StringRef compactPassedString = "PASSED"_sr;
+#else
+ static constexpr Catch::StringRef compactFailedString = "failed"_sr;
+ static constexpr Catch::StringRef compactPassedString = "passed"_sr;
+#endif
+
+// Colour, message variants:
+// - white: No tests ran.
+// - red: Failed [both/all] N test cases, failed [both/all] M assertions.
+// - white: Passed [both/all] N test cases (no assertions).
+// - red: Failed N tests cases, failed M assertions.
+// - green: Passed [both/all] N tests cases with M assertions.
+void printTotals(std::ostream& out, const Totals& totals, ColourImpl* colourImpl) {
+ if (totals.testCases.total() == 0) {
+ out << "No tests ran.";
+ } else if (totals.testCases.failed == totals.testCases.total()) {
+ auto guard = colourImpl->guardColour( Colour::ResultError ).engage( out );
+ const StringRef qualify_assertions_failed =
+ totals.assertions.failed == totals.assertions.total() ?
+ bothOrAll(totals.assertions.failed) : StringRef{};
+ out <<
+ "Failed " << bothOrAll(totals.testCases.failed)
+ << pluralise(totals.testCases.failed, "test case"_sr) << ", "
+ "failed " << qualify_assertions_failed <<
+ pluralise(totals.assertions.failed, "assertion"_sr) << '.';
+ } else if (totals.assertions.total() == 0) {
+ out <<
+ "Passed " << bothOrAll(totals.testCases.total())
+ << pluralise(totals.testCases.total(), "test case"_sr)
+ << " (no assertions).";
+ } else if (totals.assertions.failed) {
+ out << colourImpl->guardColour( Colour::ResultError ) <<
+ "Failed " << pluralise(totals.testCases.failed, "test case"_sr) << ", "
+ "failed " << pluralise(totals.assertions.failed, "assertion"_sr) << '.';
+ } else {
+ out << colourImpl->guardColour( Colour::ResultSuccess ) <<
+ "Passed " << bothOrAll(totals.testCases.passed)
+ << pluralise(totals.testCases.passed, "test case"_sr) <<
+ " with " << pluralise(totals.assertions.passed, "assertion"_sr) << '.';
+ }
+}
+
+// Implementation of CompactReporter formatting
+class AssertionPrinter {
+public:
+ AssertionPrinter& operator= (AssertionPrinter const&) = delete;
+ AssertionPrinter(AssertionPrinter const&) = delete;
+ AssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, bool _printInfoMessages, ColourImpl* colourImpl_)
+ : stream(_stream)
+ , result(_stats.assertionResult)
+ , messages(_stats.infoMessages)
+ , itMessage(_stats.infoMessages.begin())
+ , printInfoMessages(_printInfoMessages)
+ , colourImpl(colourImpl_)
+ {}
+
+ void print() {
+ printSourceInfo();
+
+ itMessage = messages.begin();
+
+ switch (result.getResultType()) {
+ case ResultWas::Ok:
+ printResultType(Colour::ResultSuccess, compactPassedString);
+ printOriginalExpression();
+ printReconstructedExpression();
+ if (!result.hasExpression())
+ printRemainingMessages(Colour::None);
+ else
+ printRemainingMessages();
+ break;
+ case ResultWas::ExpressionFailed:
+ if (result.isOk())
+ printResultType(Colour::ResultSuccess, compactFailedString + " - but was ok"_sr);
+ else
+ printResultType(Colour::Error, compactFailedString);
+ printOriginalExpression();
+ printReconstructedExpression();
+ printRemainingMessages();
+ break;
+ case ResultWas::ThrewException:
+ printResultType(Colour::Error, compactFailedString);
+ printIssue("unexpected exception with message:");
+ printMessage();
+ printExpressionWas();
+ printRemainingMessages();
+ break;
+ case ResultWas::FatalErrorCondition:
+ printResultType(Colour::Error, compactFailedString);
+ printIssue("fatal error condition with message:");
+ printMessage();
+ printExpressionWas();
+ printRemainingMessages();
+ break;
+ case ResultWas::DidntThrowException:
+ printResultType(Colour::Error, compactFailedString);
+ printIssue("expected exception, got none");
+ printExpressionWas();
+ printRemainingMessages();
+ break;
+ case ResultWas::Info:
+ printResultType(Colour::None, "info"_sr);
+ printMessage();
+ printRemainingMessages();
+ break;
+ case ResultWas::Warning:
+ printResultType(Colour::None, "warning"_sr);
+ printMessage();
+ printRemainingMessages();
+ break;
+ case ResultWas::ExplicitFailure:
+ printResultType(Colour::Error, compactFailedString);
+ printIssue("explicitly");
+ printRemainingMessages(Colour::None);
+ break;
+ // These cases are here to prevent compiler warnings
+ case ResultWas::Unknown:
+ case ResultWas::FailureBit:
+ case ResultWas::Exception:
+ printResultType(Colour::Error, "** internal error **");
+ break;
+ }
+ }
+
+private:
+ void printSourceInfo() const {
+ stream << colourImpl->guardColour( Colour::FileName )
+ << result.getSourceInfo() << ':';
+ }
+
+ void printResultType(Colour::Code colour, StringRef passOrFail) const {
+ if (!passOrFail.empty()) {
+ stream << colourImpl->guardColour(colour) << ' ' << passOrFail;
+ stream << ':';
+ }
+ }
+
+ void printIssue(char const* issue) const {
+ stream << ' ' << issue;
+ }
+
+ void printExpressionWas() {
+ if (result.hasExpression()) {
+ stream << ';';
+ {
+ stream << colourImpl->guardColour(compactDimColour) << " expression was:";
+ }
+ printOriginalExpression();
+ }
+ }
+
+ void printOriginalExpression() const {
+ if (result.hasExpression()) {
+ stream << ' ' << result.getExpression();
+ }
+ }
+
+ void printReconstructedExpression() const {
+ if (result.hasExpandedExpression()) {
+ stream << colourImpl->guardColour(compactDimColour) << " for: ";
+ stream << result.getExpandedExpression();
+ }
+ }
+
+ void printMessage() {
+ if (itMessage != messages.end()) {
+ stream << " '" << itMessage->message << '\'';
+ ++itMessage;
+ }
+ }
+
+ void printRemainingMessages(Colour::Code colour = compactDimColour) {
+ if (itMessage == messages.end())
+ return;
+
+ const auto itEnd = messages.cend();
+ const auto N = static_cast<std::size_t>(std::distance(itMessage, itEnd));
+
+ stream << colourImpl->guardColour( colour ) << " with "
+ << pluralise( N, "message"_sr ) << ':';
+
+ while (itMessage != itEnd) {
+ // If this assertion is a warning ignore any INFO messages
+ if (printInfoMessages || itMessage->type != ResultWas::Info) {
+ printMessage();
+ if (itMessage != itEnd) {
+ stream << colourImpl->guardColour(compactDimColour) << " and";
+ }
+ continue;
+ }
+ ++itMessage;
+ }
+ }
+
+private:
+ std::ostream& stream;
+ AssertionResult const& result;
+ std::vector<MessageInfo> messages;
+ std::vector<MessageInfo>::const_iterator itMessage;
+ bool printInfoMessages;
+ ColourImpl* colourImpl;
+};
+
+} // anon namespace
+
+ std::string CompactReporter::getDescription() {
+ return "Reports test results on a single line, suitable for IDEs";
+ }
+
+ void CompactReporter::noMatchingTestCases( StringRef unmatchedSpec ) {
+ m_stream << "No test cases matched '" << unmatchedSpec << "'\n";
+ }
+
+ void CompactReporter::testRunStarting( TestRunInfo const& ) {
+ if ( m_config->testSpec().hasFilters() ) {
+ m_stream << m_colour->guardColour( Colour::BrightYellow )
+ << "Filters: "
+ << serializeFilters( m_config->getTestsOrTags() )
+ << '\n';
+ }
+ m_stream << "RNG seed: " << m_config->rngSeed() << '\n';
+ }
+
+ void CompactReporter::assertionEnded( AssertionStats const& _assertionStats ) {
+ AssertionResult const& result = _assertionStats.assertionResult;
+
+ bool printInfoMessages = true;
+
+ // Drop out if result was successful and we're not printing those
+ if( !m_config->includeSuccessfulResults() && result.isOk() ) {
+ if( result.getResultType() != ResultWas::Warning )
+ return;
+ printInfoMessages = false;
+ }
+
+ AssertionPrinter printer( m_stream, _assertionStats, printInfoMessages, m_colour.get() );
+ printer.print();
+
+ m_stream << '\n' << std::flush;
+ }
+
+ void CompactReporter::sectionEnded(SectionStats const& _sectionStats) {
+ double dur = _sectionStats.durationInSeconds;
+ if ( shouldShowDuration( *m_config, dur ) ) {
+ m_stream << getFormattedDuration( dur ) << " s: " << _sectionStats.sectionInfo.name << '\n' << std::flush;
+ }
+ }
+
+ void CompactReporter::testRunEnded( TestRunStats const& _testRunStats ) {
+ printTotals( m_stream, _testRunStats.totals, m_colour.get() );
+ m_stream << "\n\n" << std::flush;
+ StreamingReporterBase::testRunEnded( _testRunStats );
+ }
+
+ CompactReporter::~CompactReporter() {}
+
+} // end namespace Catch
+
+
+
+
+#include <cstdio>
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4061) // Not all labels are EXPLICITLY handled in switch
+ // Note that 4062 (not all labels are handled and default is missing) is enabled
+#endif
+
+#if defined(__clang__)
+# pragma clang diagnostic push
+// For simplicity, benchmarking-only helpers are always enabled
+# pragma clang diagnostic ignored "-Wunused-function"
+#endif
+
+
+
+namespace Catch {
+
+namespace {
+
+// Formatter impl for ConsoleReporter
+class ConsoleAssertionPrinter {
+public:
+ ConsoleAssertionPrinter& operator= (ConsoleAssertionPrinter const&) = delete;
+ ConsoleAssertionPrinter(ConsoleAssertionPrinter const&) = delete;
+ ConsoleAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, ColourImpl* colourImpl_, bool _printInfoMessages)
+ : stream(_stream),
+ stats(_stats),
+ result(_stats.assertionResult),
+ colour(Colour::None),
+ message(result.getMessage()),
+ messages(_stats.infoMessages),
+ colourImpl(colourImpl_),
+ printInfoMessages(_printInfoMessages) {
+ switch (result.getResultType()) {
+ case ResultWas::Ok:
+ colour = Colour::Success;
+ passOrFail = "PASSED"_sr;
+ //if( result.hasMessage() )
+ if (_stats.infoMessages.size() == 1)
+ messageLabel = "with message";
+ if (_stats.infoMessages.size() > 1)
+ messageLabel = "with messages";
+ break;
+ case ResultWas::ExpressionFailed:
+ if (result.isOk()) {
+ colour = Colour::Success;
+ passOrFail = "FAILED - but was ok"_sr;
+ } else {
+ colour = Colour::Error;
+ passOrFail = "FAILED"_sr;
+ }
+ if (_stats.infoMessages.size() == 1)
+ messageLabel = "with message";
+ if (_stats.infoMessages.size() > 1)
+ messageLabel = "with messages";
+ break;
+ case ResultWas::ThrewException:
+ colour = Colour::Error;
+ passOrFail = "FAILED"_sr;
+ messageLabel = "due to unexpected exception with ";
+ if (_stats.infoMessages.size() == 1)
+ messageLabel += "message";
+ if (_stats.infoMessages.size() > 1)
+ messageLabel += "messages";
+ break;
+ case ResultWas::FatalErrorCondition:
+ colour = Colour::Error;
+ passOrFail = "FAILED"_sr;
+ messageLabel = "due to a fatal error condition";
+ break;
+ case ResultWas::DidntThrowException:
+ colour = Colour::Error;
+ passOrFail = "FAILED"_sr;
+ messageLabel = "because no exception was thrown where one was expected";
+ break;
+ case ResultWas::Info:
+ messageLabel = "info";
+ break;
+ case ResultWas::Warning:
+ messageLabel = "warning";
+ break;
+ case ResultWas::ExplicitFailure:
+ passOrFail = "FAILED"_sr;
+ colour = Colour::Error;
+ if (_stats.infoMessages.size() == 1)
+ messageLabel = "explicitly with message";
+ if (_stats.infoMessages.size() > 1)
+ messageLabel = "explicitly with messages";
+ break;
+ // These cases are here to prevent compiler warnings
+ case ResultWas::Unknown:
+ case ResultWas::FailureBit:
+ case ResultWas::Exception:
+ passOrFail = "** internal error **"_sr;
+ colour = Colour::Error;
+ break;
+ }
+ }
+
+ void print() const {
+ printSourceInfo();
+ if (stats.totals.assertions.total() > 0) {
+ printResultType();
+ printOriginalExpression();
+ printReconstructedExpression();
+ } else {
+ stream << '\n';
+ }
+ printMessage();
+ }
+
+private:
+ void printResultType() const {
+ if (!passOrFail.empty()) {
+ stream << colourImpl->guardColour(colour) << passOrFail << ":\n";
+ }
+ }
+ void printOriginalExpression() const {
+ if (result.hasExpression()) {
+ stream << colourImpl->guardColour( Colour::OriginalExpression )
+ << " " << result.getExpressionInMacro() << '\n';
+ }
+ }
+ void printReconstructedExpression() const {
+ if (result.hasExpandedExpression()) {
+ stream << "with expansion:\n";
+ stream << colourImpl->guardColour( Colour::ReconstructedExpression )
+ << TextFlow::Column( result.getExpandedExpression() )
+ .indent( 2 )
+ << '\n';
+ }
+ }
+ void printMessage() const {
+ if (!messageLabel.empty())
+ stream << messageLabel << ':' << '\n';
+ for (auto const& msg : messages) {
+ // If this assertion is a warning ignore any INFO messages
+ if (printInfoMessages || msg.type != ResultWas::Info)
+ stream << TextFlow::Column(msg.message).indent(2) << '\n';
+ }
+ }
+ void printSourceInfo() const {
+ stream << colourImpl->guardColour( Colour::FileName )
+ << result.getSourceInfo() << ": ";
+ }
+
+ std::ostream& stream;
+ AssertionStats const& stats;
+ AssertionResult const& result;
+ Colour::Code colour;
+ StringRef passOrFail;
+ std::string messageLabel;
+ std::string message;
+ std::vector<MessageInfo> messages;
+ ColourImpl* colourImpl;
+ bool printInfoMessages;
+};
+
+std::size_t makeRatio( std::uint64_t number, std::uint64_t total ) {
+ const auto ratio = total > 0 ? CATCH_CONFIG_CONSOLE_WIDTH * number / total : 0;
+ return (ratio == 0 && number > 0) ? 1 : static_cast<std::size_t>(ratio);
+}
+
+std::size_t& findMax( std::size_t& i, std::size_t& j, std::size_t& k ) {
+ if (i > j && i > k)
+ return i;
+ else if (j > k)
+ return j;
+ else
+ return k;
+}
+
+enum class Justification { Left, Right };
+
+struct ColumnInfo {
+ std::string name;
+ std::size_t width;
+ Justification justification;
+};
+struct ColumnBreak {};
+struct RowBreak {};
+
+class Duration {
+ enum class Unit {
+ Auto,
+ Nanoseconds,
+ Microseconds,
+ Milliseconds,
+ Seconds,
+ Minutes
+ };
+ static const uint64_t s_nanosecondsInAMicrosecond = 1000;
+ static const uint64_t s_nanosecondsInAMillisecond = 1000 * s_nanosecondsInAMicrosecond;
+ static const uint64_t s_nanosecondsInASecond = 1000 * s_nanosecondsInAMillisecond;
+ static const uint64_t s_nanosecondsInAMinute = 60 * s_nanosecondsInASecond;
+
+ double m_inNanoseconds;
+ Unit m_units;
+
+public:
+ explicit Duration(double inNanoseconds, Unit units = Unit::Auto)
+ : m_inNanoseconds(inNanoseconds),
+ m_units(units) {
+ if (m_units == Unit::Auto) {
+ if (m_inNanoseconds < s_nanosecondsInAMicrosecond)
+ m_units = Unit::Nanoseconds;
+ else if (m_inNanoseconds < s_nanosecondsInAMillisecond)
+ m_units = Unit::Microseconds;
+ else if (m_inNanoseconds < s_nanosecondsInASecond)
+ m_units = Unit::Milliseconds;
+ else if (m_inNanoseconds < s_nanosecondsInAMinute)
+ m_units = Unit::Seconds;
+ else
+ m_units = Unit::Minutes;
+ }
+
+ }
+
+ auto value() const -> double {
+ switch (m_units) {
+ case Unit::Microseconds:
+ return m_inNanoseconds / static_cast<double>(s_nanosecondsInAMicrosecond);
+ case Unit::Milliseconds:
+ return m_inNanoseconds / static_cast<double>(s_nanosecondsInAMillisecond);
+ case Unit::Seconds:
+ return m_inNanoseconds / static_cast<double>(s_nanosecondsInASecond);
+ case Unit::Minutes:
+ return m_inNanoseconds / static_cast<double>(s_nanosecondsInAMinute);
+ default:
+ return m_inNanoseconds;
+ }
+ }
+ StringRef unitsAsString() const {
+ switch (m_units) {
+ case Unit::Nanoseconds:
+ return "ns"_sr;
+ case Unit::Microseconds:
+ return "us"_sr;
+ case Unit::Milliseconds:
+ return "ms"_sr;
+ case Unit::Seconds:
+ return "s"_sr;
+ case Unit::Minutes:
+ return "m"_sr;
+ default:
+ return "** internal error **"_sr;
+ }
+
+ }
+ friend auto operator << (std::ostream& os, Duration const& duration) -> std::ostream& {
+ return os << duration.value() << ' ' << duration.unitsAsString();
+ }
+};
+} // end anon namespace
+
+class TablePrinter {
+ std::ostream& m_os;
+ std::vector<ColumnInfo> m_columnInfos;
+ ReusableStringStream m_oss;
+ int m_currentColumn = -1;
+ bool m_isOpen = false;
+
+public:
+ TablePrinter( std::ostream& os, std::vector<ColumnInfo> columnInfos )
+ : m_os( os ),
+ m_columnInfos( CATCH_MOVE( columnInfos ) ) {}
+
+ auto columnInfos() const -> std::vector<ColumnInfo> const& {
+ return m_columnInfos;
+ }
+
+ void open() {
+ if (!m_isOpen) {
+ m_isOpen = true;
+ *this << RowBreak();
+
+ TextFlow::Columns headerCols;
+ auto spacer = TextFlow::Spacer(2);
+ for (auto const& info : m_columnInfos) {
+ assert(info.width > 2);
+ headerCols += TextFlow::Column(info.name).width(info.width - 2);
+ headerCols += spacer;
+ }
+ m_os << headerCols << '\n';
+
+ m_os << lineOfChars('-') << '\n';
+ }
+ }
+ void close() {
+ if (m_isOpen) {
+ *this << RowBreak();
+ m_os << '\n' << std::flush;
+ m_isOpen = false;
+ }
+ }
+
+ template<typename T>
+ friend TablePrinter& operator << (TablePrinter& tp, T const& value) {
+ tp.m_oss << value;
+ return tp;
+ }
+
+ friend TablePrinter& operator << (TablePrinter& tp, ColumnBreak) {
+ auto colStr = tp.m_oss.str();
+ const auto strSize = colStr.size();
+ tp.m_oss.str("");
+ tp.open();
+ if (tp.m_currentColumn == static_cast<int>(tp.m_columnInfos.size() - 1)) {
+ tp.m_currentColumn = -1;
+ tp.m_os << '\n';
+ }
+ tp.m_currentColumn++;
+
+ auto colInfo = tp.m_columnInfos[tp.m_currentColumn];
+ auto padding = (strSize + 1 < colInfo.width)
+ ? std::string(colInfo.width - (strSize + 1), ' ')
+ : std::string();
+ if (colInfo.justification == Justification::Left)
+ tp.m_os << colStr << padding << ' ';
+ else
+ tp.m_os << padding << colStr << ' ';
+ return tp;
+ }
+
+ friend TablePrinter& operator << (TablePrinter& tp, RowBreak) {
+ if (tp.m_currentColumn > 0) {
+ tp.m_os << '\n';
+ tp.m_currentColumn = -1;
+ }
+ return tp;
+ }
+};
+
+ConsoleReporter::ConsoleReporter(ReporterConfig&& config):
+ StreamingReporterBase( CATCH_MOVE( config ) ),
+ m_tablePrinter(Detail::make_unique<TablePrinter>(m_stream,
+ [&config]() -> std::vector<ColumnInfo> {
+ if (config.fullConfig()->benchmarkNoAnalysis())
+ {
+ return{
+ { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH - 43, Justification::Left },
+ { " samples", 14, Justification::Right },
+ { " iterations", 14, Justification::Right },
+ { " mean", 14, Justification::Right }
+ };
+ }
+ else
+ {
+ return{
+ { "benchmark name", CATCH_CONFIG_CONSOLE_WIDTH - 43, Justification::Left },
+ { "samples mean std dev", 14, Justification::Right },
+ { "iterations low mean low std dev", 14, Justification::Right },
+ { "estimated high mean high std dev", 14, Justification::Right }
+ };
+ }
+ }())) {}
+ConsoleReporter::~ConsoleReporter() = default;
+
+std::string ConsoleReporter::getDescription() {
+ return "Reports test results as plain lines of text";
+}
+
+void ConsoleReporter::noMatchingTestCases( StringRef unmatchedSpec ) {
+ m_stream << "No test cases matched '" << unmatchedSpec << "'\n";
+}
+
+void ConsoleReporter::reportInvalidTestSpec( StringRef arg ) {
+ m_stream << "Invalid Filter: " << arg << '\n';
+}
+
+void ConsoleReporter::assertionStarting(AssertionInfo const&) {}
+
+void ConsoleReporter::assertionEnded(AssertionStats const& _assertionStats) {
+ AssertionResult const& result = _assertionStats.assertionResult;
+
+ bool includeResults = m_config->includeSuccessfulResults() || !result.isOk();
+
+ // Drop out if result was successful but we're not printing them.
+ if (!includeResults && result.getResultType() != ResultWas::Warning)
+ return;
+
+ lazyPrint();
+
+ ConsoleAssertionPrinter printer(m_stream, _assertionStats, m_colour.get(), includeResults);
+ printer.print();
+ m_stream << '\n' << std::flush;
+}
+
+void ConsoleReporter::sectionStarting(SectionInfo const& _sectionInfo) {
+ m_tablePrinter->close();
+ m_headerPrinted = false;
+ StreamingReporterBase::sectionStarting(_sectionInfo);
+}
+void ConsoleReporter::sectionEnded(SectionStats const& _sectionStats) {
+ m_tablePrinter->close();
+ if (_sectionStats.missingAssertions) {
+ lazyPrint();
+ auto guard =
+ m_colour->guardColour( Colour::ResultError ).engage( m_stream );
+ if (m_sectionStack.size() > 1)
+ m_stream << "\nNo assertions in section";
+ else
+ m_stream << "\nNo assertions in test case";
+ m_stream << " '" << _sectionStats.sectionInfo.name << "'\n\n" << std::flush;
+ }
+ double dur = _sectionStats.durationInSeconds;
+ if (shouldShowDuration(*m_config, dur)) {
+ m_stream << getFormattedDuration(dur) << " s: " << _sectionStats.sectionInfo.name << '\n' << std::flush;
+ }
+ if (m_headerPrinted) {
+ m_headerPrinted = false;
+ }
+ StreamingReporterBase::sectionEnded(_sectionStats);
+}
+
+void ConsoleReporter::benchmarkPreparing( StringRef name ) {
+ lazyPrintWithoutClosingBenchmarkTable();
+
+ auto nameCol = TextFlow::Column( static_cast<std::string>( name ) )
+ .width( m_tablePrinter->columnInfos()[0].width - 2 );
+
+ bool firstLine = true;
+ for (auto line : nameCol) {
+ if (!firstLine)
+ (*m_tablePrinter) << ColumnBreak() << ColumnBreak() << ColumnBreak();
+ else
+ firstLine = false;
+
+ (*m_tablePrinter) << line << ColumnBreak();
+ }
+}
+
+void ConsoleReporter::benchmarkStarting(BenchmarkInfo const& info) {
+ (*m_tablePrinter) << info.samples << ColumnBreak()
+ << info.iterations << ColumnBreak();
+ if (!m_config->benchmarkNoAnalysis())
+ (*m_tablePrinter) << Duration(info.estimatedDuration) << ColumnBreak();
+}
+void ConsoleReporter::benchmarkEnded(BenchmarkStats<> const& stats) {
+ if (m_config->benchmarkNoAnalysis())
+ {
+ (*m_tablePrinter) << Duration(stats.mean.point.count()) << ColumnBreak();
+ }
+ else
+ {
+ (*m_tablePrinter) << ColumnBreak()
+ << Duration(stats.mean.point.count()) << ColumnBreak()
+ << Duration(stats.mean.lower_bound.count()) << ColumnBreak()
+ << Duration(stats.mean.upper_bound.count()) << ColumnBreak() << ColumnBreak()
+ << Duration(stats.standardDeviation.point.count()) << ColumnBreak()
+ << Duration(stats.standardDeviation.lower_bound.count()) << ColumnBreak()
+ << Duration(stats.standardDeviation.upper_bound.count()) << ColumnBreak() << ColumnBreak() << ColumnBreak() << ColumnBreak() << ColumnBreak();
+ }
+}
+
+void ConsoleReporter::benchmarkFailed( StringRef error ) {
+ auto guard = m_colour->guardColour( Colour::Red ).engage( m_stream );
+ (*m_tablePrinter)
+ << "Benchmark failed (" << error << ')'
+ << ColumnBreak() << RowBreak();
+}
+
+void ConsoleReporter::testCaseEnded(TestCaseStats const& _testCaseStats) {
+ m_tablePrinter->close();
+ StreamingReporterBase::testCaseEnded(_testCaseStats);
+ m_headerPrinted = false;
+}
+void ConsoleReporter::testRunEnded(TestRunStats const& _testRunStats) {
+ printTotalsDivider(_testRunStats.totals);
+ printTotals(_testRunStats.totals);
+ m_stream << '\n' << std::flush;
+ StreamingReporterBase::testRunEnded(_testRunStats);
+}
+void ConsoleReporter::testRunStarting(TestRunInfo const& _testInfo) {
+ StreamingReporterBase::testRunStarting(_testInfo);
+ if ( m_config->testSpec().hasFilters() ) {
+ m_stream << m_colour->guardColour( Colour::BrightYellow ) << "Filters: "
+ << serializeFilters( m_config->getTestsOrTags() ) << '\n';
+ }
+ m_stream << "Randomness seeded to: " << m_config->rngSeed() << '\n';
+}
+
+void ConsoleReporter::lazyPrint() {
+
+ m_tablePrinter->close();
+ lazyPrintWithoutClosingBenchmarkTable();
+}
+
+void ConsoleReporter::lazyPrintWithoutClosingBenchmarkTable() {
+
+ if ( !m_testRunInfoPrinted ) {
+ lazyPrintRunInfo();
+ }
+ if (!m_headerPrinted) {
+ printTestCaseAndSectionHeader();
+ m_headerPrinted = true;
+ }
+}
+void ConsoleReporter::lazyPrintRunInfo() {
+ m_stream << '\n'
+ << lineOfChars( '~' ) << '\n'
+ << m_colour->guardColour( Colour::SecondaryText )
+ << currentTestRunInfo.name << " is a Catch2 v" << libraryVersion()
+ << " host application.\n"
+ << "Run with -? for options\n\n";
+
+ m_testRunInfoPrinted = true;
+}
+void ConsoleReporter::printTestCaseAndSectionHeader() {
+ assert(!m_sectionStack.empty());
+ printOpenHeader(currentTestCaseInfo->name);
+
+ if (m_sectionStack.size() > 1) {
+ auto guard = m_colour->guardColour( Colour::Headers ).engage( m_stream );
+
+ auto
+ it = m_sectionStack.begin() + 1, // Skip first section (test case)
+ itEnd = m_sectionStack.end();
+ for (; it != itEnd; ++it)
+ printHeaderString(it->name, 2);
+ }
+
+ SourceLineInfo lineInfo = m_sectionStack.back().lineInfo;
+
+
+ m_stream << lineOfChars( '-' ) << '\n'
+ << m_colour->guardColour( Colour::FileName ) << lineInfo << '\n'
+ << lineOfChars( '.' ) << "\n\n"
+ << std::flush;
+}
+
+void ConsoleReporter::printClosedHeader(std::string const& _name) {
+ printOpenHeader(_name);
+ m_stream << lineOfChars('.') << '\n';
+}
+void ConsoleReporter::printOpenHeader(std::string const& _name) {
+ m_stream << lineOfChars('-') << '\n';
+ {
+ auto guard = m_colour->guardColour( Colour::Headers ).engage( m_stream );
+ printHeaderString(_name);
+ }
+}
+
+void ConsoleReporter::printHeaderString(std::string const& _string, std::size_t indent) {
+ // We want to get a bit fancy with line breaking here, so that subsequent
+ // lines start after ":" if one is present, e.g.
+ // ```
+ // blablabla: Fancy
+ // linebreaking
+ // ```
+ // but we also want to avoid problems with overly long indentation causing
+ // the text to take up too many lines, e.g.
+ // ```
+ // blablabla: F
+ // a
+ // n
+ // c
+ // y
+ // .
+ // .
+ // .
+ // ```
+ // So we limit the prefix indentation check to first quarter of the possible
+ // width
+ std::size_t idx = _string.find( ": " );
+ if ( idx != std::string::npos && idx < CATCH_CONFIG_CONSOLE_WIDTH / 4 ) {
+ idx += 2;
+ } else {
+ idx = 0;
+ }
+ m_stream << TextFlow::Column( _string )
+ .indent( indent + idx )
+ .initialIndent( indent )
+ << '\n';
+}
+
+struct SummaryColumn {
+
+ SummaryColumn( std::string _label, Colour::Code _colour )
+ : label( CATCH_MOVE( _label ) ),
+ colour( _colour ) {}
+ SummaryColumn addRow( std::uint64_t count ) {
+ ReusableStringStream rss;
+ rss << count;
+ std::string row = rss.str();
+ for (auto& oldRow : rows) {
+ while (oldRow.size() < row.size())
+ oldRow = ' ' + oldRow;
+ while (oldRow.size() > row.size())
+ row = ' ' + row;
+ }
+ rows.push_back(row);
+ return *this;
+ }
+
+ std::string label;
+ Colour::Code colour;
+ std::vector<std::string> rows;
+
+};
+
+void ConsoleReporter::printTotals( Totals const& totals ) {
+ if (totals.testCases.total() == 0) {
+ m_stream << m_colour->guardColour( Colour::Warning )
+ << "No tests ran\n";
+ } else if (totals.assertions.total() > 0 && totals.testCases.allPassed()) {
+ m_stream << m_colour->guardColour( Colour::ResultSuccess )
+ << "All tests passed";
+ m_stream << " ("
+ << pluralise(totals.assertions.passed, "assertion"_sr) << " in "
+ << pluralise(totals.testCases.passed, "test case"_sr) << ')'
+ << '\n';
+ } else {
+
+ std::vector<SummaryColumn> columns;
+ columns.push_back(SummaryColumn("", Colour::None)
+ .addRow(totals.testCases.total())
+ .addRow(totals.assertions.total()));
+ columns.push_back(SummaryColumn("passed", Colour::Success)
+ .addRow(totals.testCases.passed)
+ .addRow(totals.assertions.passed));
+ columns.push_back(SummaryColumn("failed", Colour::ResultError)
+ .addRow(totals.testCases.failed)
+ .addRow(totals.assertions.failed));
+ columns.push_back(SummaryColumn("failed as expected", Colour::ResultExpectedFailure)
+ .addRow(totals.testCases.failedButOk)
+ .addRow(totals.assertions.failedButOk));
+
+ printSummaryRow("test cases"_sr, columns, 0);
+ printSummaryRow("assertions"_sr, columns, 1);
+ }
+}
+void ConsoleReporter::printSummaryRow(StringRef label, std::vector<SummaryColumn> const& cols, std::size_t row) {
+ for (auto col : cols) {
+ std::string const& value = col.rows[row];
+ if (col.label.empty()) {
+ m_stream << label << ": ";
+ if ( value != "0" ) {
+ m_stream << value;
+ } else {
+ m_stream << m_colour->guardColour( Colour::Warning )
+ << "- none -";
+ }
+ } else if (value != "0") {
+ m_stream << m_colour->guardColour( Colour::LightGrey ) << " | "
+ << m_colour->guardColour( col.colour ) << value << ' '
+ << col.label;
+ }
+ }
+ m_stream << '\n';
+}
+
+void ConsoleReporter::printTotalsDivider(Totals const& totals) {
+ if (totals.testCases.total() > 0) {
+ std::size_t failedRatio = makeRatio(totals.testCases.failed, totals.testCases.total());
+ std::size_t failedButOkRatio = makeRatio(totals.testCases.failedButOk, totals.testCases.total());
+ std::size_t passedRatio = makeRatio(totals.testCases.passed, totals.testCases.total());
+ while (failedRatio + failedButOkRatio + passedRatio < CATCH_CONFIG_CONSOLE_WIDTH - 1)
+ findMax(failedRatio, failedButOkRatio, passedRatio)++;
+ while (failedRatio + failedButOkRatio + passedRatio > CATCH_CONFIG_CONSOLE_WIDTH - 1)
+ findMax(failedRatio, failedButOkRatio, passedRatio)--;
+
+ m_stream << m_colour->guardColour( Colour::Error )
+ << std::string( failedRatio, '=' )
+ << m_colour->guardColour( Colour::ResultExpectedFailure )
+ << std::string( failedButOkRatio, '=' );
+ if ( totals.testCases.allPassed() ) {
+ m_stream << m_colour->guardColour( Colour::ResultSuccess )
+ << std::string( passedRatio, '=' );
+ } else {
+ m_stream << m_colour->guardColour( Colour::Success )
+ << std::string( passedRatio, '=' );
+ }
+ } else {
+ m_stream << m_colour->guardColour( Colour::Warning )
+ << std::string( CATCH_CONFIG_CONSOLE_WIDTH - 1, '=' );
+ }
+ m_stream << '\n';
+}
+void ConsoleReporter::printSummaryDivider() {
+ m_stream << lineOfChars('-') << '\n';
+}
+
+} // end namespace Catch
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
+
+#if defined(__clang__)
+# pragma clang diagnostic pop
+#endif
+
+
+
+
+#include <algorithm>
+#include <cassert>
+
+namespace Catch {
+ namespace {
+ struct BySectionInfo {
+ BySectionInfo( SectionInfo const& other ): m_other( other ) {}
+ BySectionInfo( BySectionInfo const& other ):
+ m_other( other.m_other ) {}
+ bool operator()(
+ Detail::unique_ptr<CumulativeReporterBase::SectionNode> const&
+ node ) const {
+ return (
+ ( node->stats.sectionInfo.name == m_other.name ) &&
+ ( node->stats.sectionInfo.lineInfo == m_other.lineInfo ) );
+ }
+ void operator=( BySectionInfo const& ) = delete;
+
+ private:
+ SectionInfo const& m_other;
+ };
+
+ } // namespace
+
+ namespace Detail {
+ AssertionOrBenchmarkResult::AssertionOrBenchmarkResult(
+ AssertionStats const& assertion ):
+ m_assertion( assertion ) {}
+
+ AssertionOrBenchmarkResult::AssertionOrBenchmarkResult(
+ BenchmarkStats<> const& benchmark ):
+ m_benchmark( benchmark ) {}
+
+ bool AssertionOrBenchmarkResult::isAssertion() const {
+ return m_assertion.some();
+ }
+ bool AssertionOrBenchmarkResult::isBenchmark() const {
+ return m_benchmark.some();
+ }
+
+ AssertionStats const& AssertionOrBenchmarkResult::asAssertion() const {
+ assert(m_assertion.some());
+
+ return *m_assertion;
+ }
+ BenchmarkStats<> const& AssertionOrBenchmarkResult::asBenchmark() const {
+ assert(m_benchmark.some());
+
+ return *m_benchmark;
+ }
+
+ }
+
+ CumulativeReporterBase::~CumulativeReporterBase() = default;
+
+ void CumulativeReporterBase::benchmarkEnded(BenchmarkStats<> const& benchmarkStats) {
+ m_sectionStack.back()->assertionsAndBenchmarks.emplace_back(benchmarkStats);
+ }
+
+ void
+ CumulativeReporterBase::sectionStarting( SectionInfo const& sectionInfo ) {
+ SectionStats incompleteStats( sectionInfo, Counts(), 0, false );
+ SectionNode* node;
+ if ( m_sectionStack.empty() ) {
+ if ( !m_rootSection ) {
+ m_rootSection =
+ Detail::make_unique<SectionNode>( incompleteStats );
+ }
+ node = m_rootSection.get();
+ } else {
+ SectionNode& parentNode = *m_sectionStack.back();
+ auto it = std::find_if( parentNode.childSections.begin(),
+ parentNode.childSections.end(),
+ BySectionInfo( sectionInfo ) );
+ if ( it == parentNode.childSections.end() ) {
+ auto newNode =
+ Detail::make_unique<SectionNode>( incompleteStats );
+ node = newNode.get();
+ parentNode.childSections.push_back( CATCH_MOVE( newNode ) );
+ } else {
+ node = it->get();
+ }
+ }
+
+ m_deepestSection = node;
+ m_sectionStack.push_back( node );
+ }
+
+ void CumulativeReporterBase::assertionEnded(
+ AssertionStats const& assertionStats ) {
+ assert( !m_sectionStack.empty() );
+ // AssertionResult holds a pointer to a temporary DecomposedExpression,
+ // which getExpandedExpression() calls to build the expression string.
+ // Our section stack copy of the assertionResult will likely outlive the
+ // temporary, so it must be expanded or discarded now to avoid calling
+ // a destroyed object later.
+ if ( m_shouldStoreFailedAssertions &&
+ !assertionStats.assertionResult.isOk() ) {
+ static_cast<void>(
+ assertionStats.assertionResult.getExpandedExpression() );
+ }
+ if ( m_shouldStoreSuccesfulAssertions &&
+ assertionStats.assertionResult.isOk() ) {
+ static_cast<void>(
+ assertionStats.assertionResult.getExpandedExpression() );
+ }
+ SectionNode& sectionNode = *m_sectionStack.back();
+ sectionNode.assertionsAndBenchmarks.emplace_back( assertionStats );
+ }
+
+ void CumulativeReporterBase::sectionEnded( SectionStats const& sectionStats ) {
+ assert( !m_sectionStack.empty() );
+ SectionNode& node = *m_sectionStack.back();
+ node.stats = sectionStats;
+ m_sectionStack.pop_back();
+ }
+
+ void CumulativeReporterBase::testCaseEnded(
+ TestCaseStats const& testCaseStats ) {
+ auto node = Detail::make_unique<TestCaseNode>( testCaseStats );
+ assert( m_sectionStack.size() == 0 );
+ node->children.push_back( CATCH_MOVE(m_rootSection) );
+ m_testCases.push_back( CATCH_MOVE(node) );
+
+ assert( m_deepestSection );
+ m_deepestSection->stdOut = testCaseStats.stdOut;
+ m_deepestSection->stdErr = testCaseStats.stdErr;
+ }
+
+
+ void CumulativeReporterBase::testRunEnded( TestRunStats const& testRunStats ) {
+ assert(!m_testRun && "CumulativeReporterBase assumes there can only be one test run");
+ m_testRun = Detail::make_unique<TestRunNode>( testRunStats );
+ m_testRun->children.swap( m_testCases );
+ testRunEndedCumulative();
+ }
+
+ bool CumulativeReporterBase::SectionNode::hasAnyAssertions() const {
+ return std::any_of(
+ assertionsAndBenchmarks.begin(),
+ assertionsAndBenchmarks.end(),
+ []( Detail::AssertionOrBenchmarkResult const& res ) {
+ return res.isAssertion();
+ } );
+ }
+
+} // end namespace Catch
+
+
+
+
+namespace Catch {
+
+ void EventListenerBase::fatalErrorEncountered( StringRef ) {}
+
+ void EventListenerBase::benchmarkPreparing( StringRef ) {}
+ void EventListenerBase::benchmarkStarting( BenchmarkInfo const& ) {}
+ void EventListenerBase::benchmarkEnded( BenchmarkStats<> const& ) {}
+ void EventListenerBase::benchmarkFailed( StringRef ) {}
+
+ void EventListenerBase::assertionStarting( AssertionInfo const& ) {}
+
+ void EventListenerBase::assertionEnded( AssertionStats const& ) {}
+ void EventListenerBase::listReporters(
+ std::vector<ReporterDescription> const& ) {}
+ void EventListenerBase::listListeners(
+ std::vector<ListenerDescription> const& ) {}
+ void EventListenerBase::listTests( std::vector<TestCaseHandle> const& ) {}
+ void EventListenerBase::listTags( std::vector<TagInfo> const& ) {}
+ void EventListenerBase::noMatchingTestCases( StringRef ) {}
+ void EventListenerBase::reportInvalidTestSpec( StringRef ) {}
+ void EventListenerBase::testRunStarting( TestRunInfo const& ) {}
+ void EventListenerBase::testCaseStarting( TestCaseInfo const& ) {}
+ void EventListenerBase::testCasePartialStarting(TestCaseInfo const&, uint64_t) {}
+ void EventListenerBase::sectionStarting( SectionInfo const& ) {}
+ void EventListenerBase::sectionEnded( SectionStats const& ) {}
+ void EventListenerBase::testCasePartialEnded(TestCaseStats const&, uint64_t) {}
+ void EventListenerBase::testCaseEnded( TestCaseStats const& ) {}
+ void EventListenerBase::testRunEnded( TestRunStats const& ) {}
+ void EventListenerBase::skipTest( TestCaseInfo const& ) {}
+} // namespace Catch
+
+
+
+
+#include <algorithm>
+#include <cfloat>
+#include <cstdio>
+#include <ostream>
+#include <iomanip>
+
+namespace Catch {
+
+ namespace {
+ void listTestNamesOnly(std::ostream& out,
+ std::vector<TestCaseHandle> const& tests) {
+ for (auto const& test : tests) {
+ auto const& testCaseInfo = test.getTestCaseInfo();
+
+ if (startsWith(testCaseInfo.name, '#')) {
+ out << '"' << testCaseInfo.name << '"';
+ } else {
+ out << testCaseInfo.name;
+ }
+
+ out << '\n';
+ }
+ out << std::flush;
+ }
+ } // end unnamed namespace
+
+
+ // Because formatting using c++ streams is stateful, drop down to C is
+ // required Alternatively we could use stringstream, but its performance
+ // is... not good.
+ std::string getFormattedDuration( double duration ) {
+ // Max exponent + 1 is required to represent the whole part
+ // + 1 for decimal point
+ // + 3 for the 3 decimal places
+ // + 1 for null terminator
+ const std::size_t maxDoubleSize = DBL_MAX_10_EXP + 1 + 1 + 3 + 1;
+ char buffer[maxDoubleSize];
+
+ // Save previous errno, to prevent sprintf from overwriting it
+ ErrnoGuard guard;
+#ifdef _MSC_VER
+ size_t printedLength = static_cast<size_t>(
+ sprintf_s( buffer, "%.3f", duration ) );
+#else
+ size_t printedLength = static_cast<size_t>(
+ std::snprintf( buffer, maxDoubleSize, "%.3f", duration ) );
+#endif
+ return std::string( buffer, printedLength );
+ }
+
+ bool shouldShowDuration( IConfig const& config, double duration ) {
+ if ( config.showDurations() == ShowDurations::Always ) {
+ return true;
+ }
+ if ( config.showDurations() == ShowDurations::Never ) {
+ return false;
+ }
+ const double min = config.minDuration();
+ return min >= 0 && duration >= min;
+ }
+
+ std::string serializeFilters( std::vector<std::string> const& filters ) {
+ // We add a ' ' separator between each filter
+ size_t serialized_size = filters.size() - 1;
+ for (auto const& filter : filters) {
+ serialized_size += filter.size();
+ }
+
+ std::string serialized;
+ serialized.reserve(serialized_size);
+ bool first = true;
+
+ for (auto const& filter : filters) {
+ if (!first) {
+ serialized.push_back(' ');
+ }
+ first = false;
+ serialized.append(filter);
+ }
+
+ return serialized;
+ }
+
+ std::ostream& operator<<( std::ostream& out, lineOfChars value ) {
+ for ( size_t idx = 0; idx < CATCH_CONFIG_CONSOLE_WIDTH - 1; ++idx ) {
+ out.put( value.c );
+ }
+ return out;
+ }
+
+ void
+ defaultListReporters( std::ostream& out,
+ std::vector<ReporterDescription> const& descriptions,
+ Verbosity verbosity ) {
+ out << "Available reporters:\n";
+ const auto maxNameLen =
+ std::max_element( descriptions.begin(),
+ descriptions.end(),
+ []( ReporterDescription const& lhs,
+ ReporterDescription const& rhs ) {
+ return lhs.name.size() < rhs.name.size();
+ } )
+ ->name.size();
+
+ for ( auto const& desc : descriptions ) {
+ if ( verbosity == Verbosity::Quiet ) {
+ out << TextFlow::Column( desc.name )
+ .indent( 2 )
+ .width( 5 + maxNameLen )
+ << '\n';
+ } else {
+ out << TextFlow::Column( desc.name + ':' )
+ .indent( 2 )
+ .width( 5 + maxNameLen ) +
+ TextFlow::Column( desc.description )
+ .initialIndent( 0 )
+ .indent( 2 )
+ .width( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen - 8 )
+ << '\n';
+ }
+ }
+ out << '\n' << std::flush;
+ }
+
+ void defaultListListeners( std::ostream& out,
+ std::vector<ListenerDescription> const& descriptions ) {
+ out << "Registered listeners:\n";
+
+ if(descriptions.empty()) {
+ return;
+ }
+
+ const auto maxNameLen =
+ std::max_element( descriptions.begin(),
+ descriptions.end(),
+ []( ListenerDescription const& lhs,
+ ListenerDescription const& rhs ) {
+ return lhs.name.size() < rhs.name.size();
+ } )
+ ->name.size();
+
+ for ( auto const& desc : descriptions ) {
+ out << TextFlow::Column( static_cast<std::string>( desc.name ) +
+ ':' )
+ .indent( 2 )
+ .width( maxNameLen + 5 ) +
+ TextFlow::Column( desc.description )
+ .initialIndent( 0 )
+ .indent( 2 )
+ .width( CATCH_CONFIG_CONSOLE_WIDTH - maxNameLen - 8 )
+ << '\n';
+ }
+
+ out << '\n' << std::flush;
+ }
+
+ void defaultListTags( std::ostream& out,
+ std::vector<TagInfo> const& tags,
+ bool isFiltered ) {
+ if ( isFiltered ) {
+ out << "Tags for matching test cases:\n";
+ } else {
+ out << "All available tags:\n";
+ }
+
+ for ( auto const& tagCount : tags ) {
+ ReusableStringStream rss;
+ rss << " " << std::setw( 2 ) << tagCount.count << " ";
+ auto str = rss.str();
+ auto wrapper = TextFlow::Column( tagCount.all() )
+ .initialIndent( 0 )
+ .indent( str.size() )
+ .width( CATCH_CONFIG_CONSOLE_WIDTH - 10 );
+ out << str << wrapper << '\n';
+ }
+ out << pluralise(tags.size(), "tag"_sr) << "\n\n" << std::flush;
+ }
+
+ void defaultListTests(std::ostream& out, ColourImpl* streamColour, std::vector<TestCaseHandle> const& tests, bool isFiltered, Verbosity verbosity) {
+ // We special case this to provide the equivalent of old
+ // `--list-test-names-only`, which could then be used by the
+ // `--input-file` option.
+ if (verbosity == Verbosity::Quiet) {
+ listTestNamesOnly(out, tests);
+ return;
+ }
+
+ if (isFiltered) {
+ out << "Matching test cases:\n";
+ } else {
+ out << "All available test cases:\n";
+ }
+
+ for (auto const& test : tests) {
+ auto const& testCaseInfo = test.getTestCaseInfo();
+ Colour::Code colour = testCaseInfo.isHidden()
+ ? Colour::SecondaryText
+ : Colour::None;
+ auto colourGuard = streamColour->guardColour( colour ).engage( out );
+
+ out << TextFlow::Column(testCaseInfo.name).indent(2) << '\n';
+ if (verbosity >= Verbosity::High) {
+ out << TextFlow::Column(Catch::Detail::stringify(testCaseInfo.lineInfo)).indent(4) << '\n';
+ }
+ if (!testCaseInfo.tags.empty() &&
+ verbosity > Verbosity::Quiet) {
+ out << TextFlow::Column(testCaseInfo.tagsAsString()).indent(6) << '\n';
+ }
+ }
+
+ if (isFiltered) {
+ out << pluralise(tests.size(), "matching test case"_sr);
+ } else {
+ out << pluralise(tests.size(), "test case"_sr);
+ }
+ out << "\n\n" << std::flush;
+ }
+
+} // namespace Catch
+
+
+
+
+#include <cassert>
+#include <ctime>
+#include <algorithm>
+#include <iomanip>
+
+namespace Catch {
+
+ namespace {
+ std::string getCurrentTimestamp() {
+ time_t rawtime;
+ std::time(&rawtime);
+
+ std::tm timeInfo = {};
+#if defined (_MSC_VER) || defined (__MINGW32__)
+ gmtime_s(&timeInfo, &rawtime);
+#else
+ gmtime_r(&rawtime, &timeInfo);
+#endif
+
+ auto const timeStampSize = sizeof("2017-01-16T17:06:45Z");
+ char timeStamp[timeStampSize];
+ const char * const fmt = "%Y-%m-%dT%H:%M:%SZ";
+
+ std::strftime(timeStamp, timeStampSize, fmt, &timeInfo);
+
+ return std::string(timeStamp, timeStampSize - 1);
+ }
+
+ std::string fileNameTag(std::vector<Tag> const& tags) {
+ auto it = std::find_if(begin(tags),
+ end(tags),
+ [] (Tag const& tag) {
+ return tag.original.size() > 0
+ && tag.original[0] == '#'; });
+ if (it != tags.end()) {
+ return static_cast<std::string>(
+ it->original.substr(1, it->original.size() - 1)
+ );
+ }
+ return std::string();
+ }
+
+ // Formats the duration in seconds to 3 decimal places.
+ // This is done because some genius defined Maven Surefire schema
+ // in a way that only accepts 3 decimal places, and tools like
+ // Jenkins use that schema for validation JUnit reporter output.
+ std::string formatDuration( double seconds ) {
+ ReusableStringStream rss;
+ rss << std::fixed << std::setprecision( 3 ) << seconds;
+ return rss.str();
+ }
+
+ static void normalizeNamespaceMarkers(std::string& str) {
+ std::size_t pos = str.find( "::" );
+ while ( pos != str.npos ) {
+ str.replace( pos, 2, "." );
+ pos += 1;
+ pos = str.find( "::", pos );
+ }
+ }
+
+ } // anonymous namespace
+
+ JunitReporter::JunitReporter( ReporterConfig&& _config )
+ : CumulativeReporterBase( CATCH_MOVE(_config) ),
+ xml( m_stream )
+ {
+ m_preferences.shouldRedirectStdOut = true;
+ m_preferences.shouldReportAllAssertions = true;
+ m_shouldStoreSuccesfulAssertions = false;
+ }
+
+ std::string JunitReporter::getDescription() {
+ return "Reports test results in an XML format that looks like Ant's junitreport target";
+ }
+
+ void JunitReporter::testRunStarting( TestRunInfo const& runInfo ) {
+ CumulativeReporterBase::testRunStarting( runInfo );
+ xml.startElement( "testsuites" );
+ suiteTimer.start();
+ stdOutForSuite.clear();
+ stdErrForSuite.clear();
+ unexpectedExceptions = 0;
+ }
+
+ void JunitReporter::testCaseStarting( TestCaseInfo const& testCaseInfo ) {
+ m_okToFail = testCaseInfo.okToFail();
+ }
+
+ void JunitReporter::assertionEnded( AssertionStats const& assertionStats ) {
+ if( assertionStats.assertionResult.getResultType() == ResultWas::ThrewException && !m_okToFail )
+ unexpectedExceptions++;
+ CumulativeReporterBase::assertionEnded( assertionStats );
+ }
+
+ void JunitReporter::testCaseEnded( TestCaseStats const& testCaseStats ) {
+ stdOutForSuite += testCaseStats.stdOut;
+ stdErrForSuite += testCaseStats.stdErr;
+ CumulativeReporterBase::testCaseEnded( testCaseStats );
+ }
+
+ void JunitReporter::testRunEndedCumulative() {
+ const auto suiteTime = suiteTimer.getElapsedSeconds();
+ writeRun( *m_testRun, suiteTime );
+ xml.endElement();
+ }
+
+ void JunitReporter::writeRun( TestRunNode const& testRunNode, double suiteTime ) {
+ XmlWriter::ScopedElement e = xml.scopedElement( "testsuite" );
+
+ TestRunStats const& stats = testRunNode.value;
+ xml.writeAttribute( "name"_sr, stats.runInfo.name );
+ xml.writeAttribute( "errors"_sr, unexpectedExceptions );
+ xml.writeAttribute( "failures"_sr, stats.totals.assertions.failed-unexpectedExceptions );
+ xml.writeAttribute( "tests"_sr, stats.totals.assertions.total() );
+ xml.writeAttribute( "hostname"_sr, "tbd"_sr ); // !TBD
+ if( m_config->showDurations() == ShowDurations::Never )
+ xml.writeAttribute( "time"_sr, ""_sr );
+ else
+ xml.writeAttribute( "time"_sr, formatDuration( suiteTime ) );
+ xml.writeAttribute( "timestamp"_sr, getCurrentTimestamp() );
+
+ // Write properties
+ {
+ auto properties = xml.scopedElement("properties");
+ xml.scopedElement("property")
+ .writeAttribute("name"_sr, "random-seed"_sr)
+ .writeAttribute("value"_sr, m_config->rngSeed());
+ if (m_config->hasTestFilters()) {
+ xml.scopedElement("property")
+ .writeAttribute("name"_sr, "filters"_sr)
+ .writeAttribute("value"_sr, serializeFilters(m_config->getTestsOrTags()));
+ }
+ }
+
+ // Write test cases
+ for( auto const& child : testRunNode.children )
+ writeTestCase( *child );
+
+ xml.scopedElement( "system-out" ).writeText( trim( stdOutForSuite ), XmlFormatting::Newline );
+ xml.scopedElement( "system-err" ).writeText( trim( stdErrForSuite ), XmlFormatting::Newline );
+ }
+
+ void JunitReporter::writeTestCase( TestCaseNode const& testCaseNode ) {
+ TestCaseStats const& stats = testCaseNode.value;
+
+ // All test cases have exactly one section - which represents the
+ // test case itself. That section may have 0-n nested sections
+ assert( testCaseNode.children.size() == 1 );
+ SectionNode const& rootSection = *testCaseNode.children.front();
+
+ std::string className =
+ static_cast<std::string>( stats.testInfo->className );
+
+ if( className.empty() ) {
+ className = fileNameTag(stats.testInfo->tags);
+ if ( className.empty() ) {
+ className = "global";
+ }
+ }
+
+ if ( !m_config->name().empty() )
+ className = static_cast<std::string>(m_config->name()) + '.' + className;
+
+ normalizeNamespaceMarkers(className);
+
+ writeSection( className, "", rootSection, stats.testInfo->okToFail() );
+ }
+
+ void JunitReporter::writeSection( std::string const& className,
+ std::string const& rootName,
+ SectionNode const& sectionNode,
+ bool testOkToFail) {
+ std::string name = trim( sectionNode.stats.sectionInfo.name );
+ if( !rootName.empty() )
+ name = rootName + '/' + name;
+
+ if( sectionNode.hasAnyAssertions()
+ || !sectionNode.stdOut.empty()
+ || !sectionNode.stdErr.empty() ) {
+ XmlWriter::ScopedElement e = xml.scopedElement( "testcase" );
+ if( className.empty() ) {
+ xml.writeAttribute( "classname"_sr, name );
+ xml.writeAttribute( "name"_sr, "root"_sr );
+ }
+ else {
+ xml.writeAttribute( "classname"_sr, className );
+ xml.writeAttribute( "name"_sr, name );
+ }
+ xml.writeAttribute( "time"_sr, formatDuration( sectionNode.stats.durationInSeconds ) );
+ // This is not ideal, but it should be enough to mimic gtest's
+ // junit output.
+ // Ideally the JUnit reporter would also handle `skipTest`
+ // events and write those out appropriately.
+ xml.writeAttribute( "status"_sr, "run"_sr );
+
+ if (sectionNode.stats.assertions.failedButOk) {
+ xml.scopedElement("skipped")
+ .writeAttribute("message", "TEST_CASE tagged with !mayfail");
+ }
+
+ writeAssertions( sectionNode );
+
+
+ if( !sectionNode.stdOut.empty() )
+ xml.scopedElement( "system-out" ).writeText( trim( sectionNode.stdOut ), XmlFormatting::Newline );
+ if( !sectionNode.stdErr.empty() )
+ xml.scopedElement( "system-err" ).writeText( trim( sectionNode.stdErr ), XmlFormatting::Newline );
+ }
+ for( auto const& childNode : sectionNode.childSections )
+ if( className.empty() )
+ writeSection( name, "", *childNode, testOkToFail );
+ else
+ writeSection( className, name, *childNode, testOkToFail );
+ }
+
+ void JunitReporter::writeAssertions( SectionNode const& sectionNode ) {
+ for (auto const& assertionOrBenchmark : sectionNode.assertionsAndBenchmarks) {
+ if (assertionOrBenchmark.isAssertion()) {
+ writeAssertion(assertionOrBenchmark.asAssertion());
+ }
+ }
+ }
+
+ void JunitReporter::writeAssertion( AssertionStats const& stats ) {
+ AssertionResult const& result = stats.assertionResult;
+ if( !result.isOk() ) {
+ std::string elementName;
+ switch( result.getResultType() ) {
+ case ResultWas::ThrewException:
+ case ResultWas::FatalErrorCondition:
+ elementName = "error";
+ break;
+ case ResultWas::ExplicitFailure:
+ case ResultWas::ExpressionFailed:
+ case ResultWas::DidntThrowException:
+ elementName = "failure";
+ break;
+
+ // We should never see these here:
+ case ResultWas::Info:
+ case ResultWas::Warning:
+ case ResultWas::Ok:
+ case ResultWas::Unknown:
+ case ResultWas::FailureBit:
+ case ResultWas::Exception:
+ elementName = "internalError";
+ break;
+ }
+
+ XmlWriter::ScopedElement e = xml.scopedElement( elementName );
+
+ xml.writeAttribute( "message"_sr, result.getExpression() );
+ xml.writeAttribute( "type"_sr, result.getTestMacroName() );
+
+ ReusableStringStream rss;
+ if (stats.totals.assertions.total() > 0) {
+ rss << "FAILED" << ":\n";
+ if (result.hasExpression()) {
+ rss << " ";
+ rss << result.getExpressionInMacro();
+ rss << '\n';
+ }
+ if (result.hasExpandedExpression()) {
+ rss << "with expansion:\n";
+ rss << TextFlow::Column(result.getExpandedExpression()).indent(2) << '\n';
+ }
+ } else {
+ rss << '\n';
+ }
+
+ if( !result.getMessage().empty() )
+ rss << result.getMessage() << '\n';
+ for( auto const& msg : stats.infoMessages )
+ if( msg.type == ResultWas::Info )
+ rss << msg.message << '\n';
+
+ rss << "at " << result.getSourceInfo();
+ xml.writeText( rss.str(), XmlFormatting::Newline );
+ }
+ }
+
+} // end namespace Catch
+
+
+
+
+#include <ostream>
+
+namespace Catch {
+ void MultiReporter::updatePreferences(IEventListener const& reporterish) {
+ m_preferences.shouldRedirectStdOut |=
+ reporterish.getPreferences().shouldRedirectStdOut;
+ m_preferences.shouldReportAllAssertions |=
+ reporterish.getPreferences().shouldReportAllAssertions;
+ }
+
+ void MultiReporter::addListener( IEventListenerPtr&& listener ) {
+ updatePreferences(*listener);
+ m_reporterLikes.insert(m_reporterLikes.begin() + m_insertedListeners, CATCH_MOVE(listener) );
+ ++m_insertedListeners;
+ }
+
+ void MultiReporter::addReporter( IEventListenerPtr&& reporter ) {
+ updatePreferences(*reporter);
+
+ // We will need to output the captured stdout if there are reporters
+ // that do not want it captured.
+ // We do not consider listeners, because it is generally assumed that
+ // listeners are output-transparent, even though they can ask for stdout
+ // capture to do something with it.
+ m_haveNoncapturingReporters |= !reporter->getPreferences().shouldRedirectStdOut;
+
+ // Reporters can always be placed to the back without breaking the
+ // reporting order
+ m_reporterLikes.push_back( CATCH_MOVE( reporter ) );
+ }
+
+ void MultiReporter::noMatchingTestCases( StringRef unmatchedSpec ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->noMatchingTestCases( unmatchedSpec );
+ }
+ }
+
+ void MultiReporter::fatalErrorEncountered( StringRef error ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->fatalErrorEncountered( error );
+ }
+ }
+
+ void MultiReporter::reportInvalidTestSpec( StringRef arg ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->reportInvalidTestSpec( arg );
+ }
+ }
+
+ void MultiReporter::benchmarkPreparing( StringRef name ) {
+ for (auto& reporterish : m_reporterLikes) {
+ reporterish->benchmarkPreparing(name);
+ }
+ }
+ void MultiReporter::benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->benchmarkStarting( benchmarkInfo );
+ }
+ }
+ void MultiReporter::benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->benchmarkEnded( benchmarkStats );
+ }
+ }
+
+ void MultiReporter::benchmarkFailed( StringRef error ) {
+ for (auto& reporterish : m_reporterLikes) {
+ reporterish->benchmarkFailed(error);
+ }
+ }
+
+ void MultiReporter::testRunStarting( TestRunInfo const& testRunInfo ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->testRunStarting( testRunInfo );
+ }
+ }
+
+ void MultiReporter::testCaseStarting( TestCaseInfo const& testInfo ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->testCaseStarting( testInfo );
+ }
+ }
+
+ void
+ MultiReporter::testCasePartialStarting( TestCaseInfo const& testInfo,
+ uint64_t partNumber ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->testCasePartialStarting( testInfo, partNumber );
+ }
+ }
+
+ void MultiReporter::sectionStarting( SectionInfo const& sectionInfo ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->sectionStarting( sectionInfo );
+ }
+ }
+
+ void MultiReporter::assertionStarting( AssertionInfo const& assertionInfo ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->assertionStarting( assertionInfo );
+ }
+ }
+
+ // The return value indicates if the messages buffer should be cleared:
+ void MultiReporter::assertionEnded( AssertionStats const& assertionStats ) {
+ const bool reportByDefault =
+ assertionStats.assertionResult.getResultType() != ResultWas::Ok ||
+ m_config->includeSuccessfulResults();
+
+ for ( auto & reporterish : m_reporterLikes ) {
+ if ( reportByDefault ||
+ reporterish->getPreferences().shouldReportAllAssertions ) {
+ reporterish->assertionEnded( assertionStats );
+ }
+ }
+ }
+
+ void MultiReporter::sectionEnded( SectionStats const& sectionStats ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->sectionEnded( sectionStats );
+ }
+ }
+
+ void MultiReporter::testCasePartialEnded( TestCaseStats const& testStats,
+ uint64_t partNumber ) {
+ if ( m_preferences.shouldRedirectStdOut &&
+ m_haveNoncapturingReporters ) {
+ if ( !testStats.stdOut.empty() ) {
+ Catch::cout() << testStats.stdOut << std::flush;
+ }
+ if ( !testStats.stdErr.empty() ) {
+ Catch::cerr() << testStats.stdErr << std::flush;
+ }
+ }
+
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->testCasePartialEnded( testStats, partNumber );
+ }
+ }
+
+ void MultiReporter::testCaseEnded( TestCaseStats const& testCaseStats ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->testCaseEnded( testCaseStats );
+ }
+ }
+
+ void MultiReporter::testRunEnded( TestRunStats const& testRunStats ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->testRunEnded( testRunStats );
+ }
+ }
+
+
+ void MultiReporter::skipTest( TestCaseInfo const& testInfo ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->skipTest( testInfo );
+ }
+ }
+
+ void MultiReporter::listReporters(std::vector<ReporterDescription> const& descriptions) {
+ for (auto& reporterish : m_reporterLikes) {
+ reporterish->listReporters(descriptions);
+ }
+ }
+
+ void MultiReporter::listListeners(
+ std::vector<ListenerDescription> const& descriptions ) {
+ for ( auto& reporterish : m_reporterLikes ) {
+ reporterish->listListeners( descriptions );
+ }
+ }
+
+ void MultiReporter::listTests(std::vector<TestCaseHandle> const& tests) {
+ for (auto& reporterish : m_reporterLikes) {
+ reporterish->listTests(tests);
+ }
+ }
+
+ void MultiReporter::listTags(std::vector<TagInfo> const& tags) {
+ for (auto& reporterish : m_reporterLikes) {
+ reporterish->listTags(tags);
+ }
+ }
+
+} // end namespace Catch
+
+
+
+
+
+namespace Catch {
+ namespace Detail {
+
+ void registerReporterImpl( std::string const& name,
+ IReporterFactoryPtr reporterPtr ) {
+ CATCH_TRY {
+ getMutableRegistryHub().registerReporter(
+ name, CATCH_MOVE( reporterPtr ) );
+ }
+ CATCH_CATCH_ALL {
+ // Do not throw when constructing global objects, instead
+ // register the exception to be processed later
+ getMutableRegistryHub().registerStartupException();
+ }
+ }
+
+ } // namespace Detail
+} // namespace Catch
+
+
+
+
+#include <map>
+
+namespace Catch {
+
+ namespace {
+ std::string createRngSeedString(uint32_t seed) {
+ ReusableStringStream sstr;
+ sstr << "rng-seed=" << seed;
+ return sstr.str();
+ }
+ }
+
+ void SonarQubeReporter::testRunStarting(TestRunInfo const& testRunInfo) {
+ CumulativeReporterBase::testRunStarting(testRunInfo);
+
+ xml.writeComment( createRngSeedString( m_config->rngSeed() ) );
+ xml.startElement("testExecutions");
+ xml.writeAttribute("version"_sr, '1');
+ }
+
+ void SonarQubeReporter::writeRun( TestRunNode const& runNode ) {
+ std::map<std::string, std::vector<TestCaseNode const*>> testsPerFile;
+
+ for ( auto const& child : runNode.children ) {
+ testsPerFile[child->value.testInfo->lineInfo.file].push_back(
+ child.get() );
+ }
+
+ for ( auto const& kv : testsPerFile ) {
+ writeTestFile( kv.first, kv.second );
+ }
+ }
+
+ void SonarQubeReporter::writeTestFile(std::string const& filename, std::vector<TestCaseNode const*> const& testCaseNodes) {
+ XmlWriter::ScopedElement e = xml.scopedElement("file");
+ xml.writeAttribute("path"_sr, filename);
+
+ for (auto const& child : testCaseNodes)
+ writeTestCase(*child);
+ }
+
+ void SonarQubeReporter::writeTestCase(TestCaseNode const& testCaseNode) {
+ // All test cases have exactly one section - which represents the
+ // test case itself. That section may have 0-n nested sections
+ assert(testCaseNode.children.size() == 1);
+ SectionNode const& rootSection = *testCaseNode.children.front();
+ writeSection("", rootSection, testCaseNode.value.testInfo->okToFail());
+ }
+
+ void SonarQubeReporter::writeSection(std::string const& rootName, SectionNode const& sectionNode, bool okToFail) {
+ std::string name = trim(sectionNode.stats.sectionInfo.name);
+ if (!rootName.empty())
+ name = rootName + '/' + name;
+
+ if ( sectionNode.hasAnyAssertions()
+ || !sectionNode.stdOut.empty()
+ || !sectionNode.stdErr.empty() ) {
+ XmlWriter::ScopedElement e = xml.scopedElement("testCase");
+ xml.writeAttribute("name"_sr, name);
+ xml.writeAttribute("duration"_sr, static_cast<long>(sectionNode.stats.durationInSeconds * 1000));
+
+ writeAssertions(sectionNode, okToFail);
+ }
+
+ for (auto const& childNode : sectionNode.childSections)
+ writeSection(name, *childNode, okToFail);
+ }
+
+ void SonarQubeReporter::writeAssertions(SectionNode const& sectionNode, bool okToFail) {
+ for (auto const& assertionOrBenchmark : sectionNode.assertionsAndBenchmarks) {
+ if (assertionOrBenchmark.isAssertion()) {
+ writeAssertion(assertionOrBenchmark.asAssertion(), okToFail);
+ }
+ }
+ }
+
+ void SonarQubeReporter::writeAssertion(AssertionStats const& stats, bool okToFail) {
+ AssertionResult const& result = stats.assertionResult;
+ if (!result.isOk()) {
+ std::string elementName;
+ if (okToFail) {
+ elementName = "skipped";
+ } else {
+ switch (result.getResultType()) {
+ case ResultWas::ThrewException:
+ case ResultWas::FatalErrorCondition:
+ elementName = "error";
+ break;
+ case ResultWas::ExplicitFailure:
+ elementName = "failure";
+ break;
+ case ResultWas::ExpressionFailed:
+ elementName = "failure";
+ break;
+ case ResultWas::DidntThrowException:
+ elementName = "failure";
+ break;
+
+ // We should never see these here:
+ case ResultWas::Info:
+ case ResultWas::Warning:
+ case ResultWas::Ok:
+ case ResultWas::Unknown:
+ case ResultWas::FailureBit:
+ case ResultWas::Exception:
+ elementName = "internalError";
+ break;
+ }
+ }
+
+ XmlWriter::ScopedElement e = xml.scopedElement(elementName);
+
+ ReusableStringStream messageRss;
+ messageRss << result.getTestMacroName() << '(' << result.getExpression() << ')';
+ xml.writeAttribute("message"_sr, messageRss.str());
+
+ ReusableStringStream textRss;
+ if (stats.totals.assertions.total() > 0) {
+ textRss << "FAILED:\n";
+ if (result.hasExpression()) {
+ textRss << '\t' << result.getExpressionInMacro() << '\n';
+ }
+ if (result.hasExpandedExpression()) {
+ textRss << "with expansion:\n\t" << result.getExpandedExpression() << '\n';
+ }
+ }
+
+ if (!result.getMessage().empty())
+ textRss << result.getMessage() << '\n';
+
+ for (auto const& msg : stats.infoMessages)
+ if (msg.type == ResultWas::Info)
+ textRss << msg.message << '\n';
+
+ textRss << "at " << result.getSourceInfo();
+ xml.writeText(textRss.str(), XmlFormatting::Newline);
+ }
+ }
+
+} // end namespace Catch
+
+
+
+namespace Catch {
+
+ StreamingReporterBase::~StreamingReporterBase() = default;
+
+ void
+ StreamingReporterBase::testRunStarting( TestRunInfo const& _testRunInfo ) {
+ currentTestRunInfo = _testRunInfo;
+ }
+
+ void StreamingReporterBase::testRunEnded( TestRunStats const& ) {
+ currentTestCaseInfo = nullptr;
+ }
+
+} // end namespace Catch
+
+
+
+#include <algorithm>
+#include <iterator>
+#include <ostream>
+
+namespace Catch {
+
+ namespace {
+ // Yes, this has to be outside the class and namespaced by naming.
+ // Making older compiler happy is hard.
+ static constexpr StringRef tapFailedString = "not ok"_sr;
+ static constexpr StringRef tapPassedString = "ok"_sr;
+ static constexpr Colour::Code tapDimColour = Colour::FileName;
+
+ class TapAssertionPrinter {
+ public:
+ TapAssertionPrinter& operator= (TapAssertionPrinter const&) = delete;
+ TapAssertionPrinter(TapAssertionPrinter const&) = delete;
+ TapAssertionPrinter(std::ostream& _stream, AssertionStats const& _stats, std::size_t _counter, ColourImpl* colour_)
+ : stream(_stream)
+ , result(_stats.assertionResult)
+ , messages(_stats.infoMessages)
+ , itMessage(_stats.infoMessages.begin())
+ , printInfoMessages(true)
+ , counter(_counter)
+ , colourImpl( colour_ ) {}
+
+ void print() {
+ itMessage = messages.begin();
+
+ switch (result.getResultType()) {
+ case ResultWas::Ok:
+ printResultType(tapPassedString);
+ printOriginalExpression();
+ printReconstructedExpression();
+ if (!result.hasExpression())
+ printRemainingMessages(Colour::None);
+ else
+ printRemainingMessages();
+ break;
+ case ResultWas::ExpressionFailed:
+ if (result.isOk()) {
+ printResultType(tapPassedString);
+ } else {
+ printResultType(tapFailedString);
+ }
+ printOriginalExpression();
+ printReconstructedExpression();
+ if (result.isOk()) {
+ printIssue(" # TODO");
+ }
+ printRemainingMessages();
+ break;
+ case ResultWas::ThrewException:
+ printResultType(tapFailedString);
+ printIssue("unexpected exception with message:"_sr);
+ printMessage();
+ printExpressionWas();
+ printRemainingMessages();
+ break;
+ case ResultWas::FatalErrorCondition:
+ printResultType(tapFailedString);
+ printIssue("fatal error condition with message:"_sr);
+ printMessage();
+ printExpressionWas();
+ printRemainingMessages();
+ break;
+ case ResultWas::DidntThrowException:
+ printResultType(tapFailedString);
+ printIssue("expected exception, got none"_sr);
+ printExpressionWas();
+ printRemainingMessages();
+ break;
+ case ResultWas::Info:
+ printResultType("info"_sr);
+ printMessage();
+ printRemainingMessages();
+ break;
+ case ResultWas::Warning:
+ printResultType("warning"_sr);
+ printMessage();
+ printRemainingMessages();
+ break;
+ case ResultWas::ExplicitFailure:
+ printResultType(tapFailedString);
+ printIssue("explicitly"_sr);
+ printRemainingMessages(Colour::None);
+ break;
+ // These cases are here to prevent compiler warnings
+ case ResultWas::Unknown:
+ case ResultWas::FailureBit:
+ case ResultWas::Exception:
+ printResultType("** internal error **"_sr);
+ break;
+ }
+ }
+
+ private:
+ void printResultType(StringRef passOrFail) const {
+ if (!passOrFail.empty()) {
+ stream << passOrFail << ' ' << counter << " -";
+ }
+ }
+
+ void printIssue(StringRef issue) const {
+ stream << ' ' << issue;
+ }
+
+ void printExpressionWas() {
+ if (result.hasExpression()) {
+ stream << ';';
+ stream << colourImpl->guardColour( tapDimColour )
+ << " expression was:";
+ printOriginalExpression();
+ }
+ }
+
+ void printOriginalExpression() const {
+ if (result.hasExpression()) {
+ stream << ' ' << result.getExpression();
+ }
+ }
+
+ void printReconstructedExpression() const {
+ if (result.hasExpandedExpression()) {
+ stream << colourImpl->guardColour( tapDimColour ) << " for: ";
+
+ std::string expr = result.getExpandedExpression();
+ std::replace(expr.begin(), expr.end(), '\n', ' ');
+ stream << expr;
+ }
+ }
+
+ void printMessage() {
+ if (itMessage != messages.end()) {
+ stream << " '" << itMessage->message << '\'';
+ ++itMessage;
+ }
+ }
+
+ void printRemainingMessages(Colour::Code colour = tapDimColour) {
+ if (itMessage == messages.end()) {
+ return;
+ }
+
+ // using messages.end() directly (or auto) yields compilation error:
+ std::vector<MessageInfo>::const_iterator itEnd = messages.end();
+ const std::size_t N = static_cast<std::size_t>(std::distance(itMessage, itEnd));
+
+ stream << colourImpl->guardColour( colour ) << " with "
+ << pluralise( N, "message"_sr ) << ':';
+
+ for (; itMessage != itEnd; ) {
+ // If this assertion is a warning ignore any INFO messages
+ if (printInfoMessages || itMessage->type != ResultWas::Info) {
+ stream << " '" << itMessage->message << '\'';
+ if (++itMessage != itEnd) {
+ stream << colourImpl->guardColour(tapDimColour) << " and";
+ }
+ }
+ }
+ }
+
+ private:
+ std::ostream& stream;
+ AssertionResult const& result;
+ std::vector<MessageInfo> messages;
+ std::vector<MessageInfo>::const_iterator itMessage;
+ bool printInfoMessages;
+ std::size_t counter;
+ ColourImpl* colourImpl;
+ };
+
+ } // End anonymous namespace
+
+ void TAPReporter::testRunStarting( TestRunInfo const& ) {
+ m_stream << "# rng-seed: " << m_config->rngSeed() << '\n';
+ }
+
+ void TAPReporter::noMatchingTestCases( StringRef unmatchedSpec ) {
+ m_stream << "# No test cases matched '" << unmatchedSpec << "'\n";
+ }
+
+ void TAPReporter::assertionEnded(AssertionStats const& _assertionStats) {
+ ++counter;
+
+ m_stream << "# " << currentTestCaseInfo->name << '\n';
+ TapAssertionPrinter printer(m_stream, _assertionStats, counter, m_colour.get());
+ printer.print();
+
+ m_stream << '\n' << std::flush;
+ }
+
+ void TAPReporter::testRunEnded(TestRunStats const& _testRunStats) {
+ m_stream << "1.." << _testRunStats.totals.assertions.total();
+ if (_testRunStats.totals.testCases.total() == 0) {
+ m_stream << " # Skipped: No tests ran.";
+ }
+ m_stream << "\n\n" << std::flush;
+ StreamingReporterBase::testRunEnded(_testRunStats);
+ }
+
+
+
+
+} // end namespace Catch
+
+
+
+
+#include <cassert>
+#include <ostream>
+
+namespace Catch {
+
+ namespace {
+ // if string has a : in first line will set indent to follow it on
+ // subsequent lines
+ void printHeaderString(std::ostream& os, std::string const& _string, std::size_t indent = 0) {
+ std::size_t i = _string.find(": ");
+ if (i != std::string::npos)
+ i += 2;
+ else
+ i = 0;
+ os << TextFlow::Column(_string)
+ .indent(indent + i)
+ .initialIndent(indent) << '\n';
+ }
+
+ std::string escape(StringRef str) {
+ std::string escaped = static_cast<std::string>(str);
+ replaceInPlace(escaped, "|", "||");
+ replaceInPlace(escaped, "'", "|'");
+ replaceInPlace(escaped, "\n", "|n");
+ replaceInPlace(escaped, "\r", "|r");
+ replaceInPlace(escaped, "[", "|[");
+ replaceInPlace(escaped, "]", "|]");
+ return escaped;
+ }
+ } // end anonymous namespace
+
+
+ TeamCityReporter::~TeamCityReporter() {}
+
+ void TeamCityReporter::testRunStarting( TestRunInfo const& runInfo ) {
+ m_stream << "##teamcity[testSuiteStarted name='" << escape( runInfo.name )
+ << "']\n";
+ }
+
+ void TeamCityReporter::testRunEnded( TestRunStats const& runStats ) {
+ m_stream << "##teamcity[testSuiteFinished name='"
+ << escape( runStats.runInfo.name ) << "']\n";
+ }
+
+ void TeamCityReporter::assertionEnded(AssertionStats const& assertionStats) {
+ AssertionResult const& result = assertionStats.assertionResult;
+ if (!result.isOk()) {
+
+ ReusableStringStream msg;
+ if (!m_headerPrintedForThisSection)
+ printSectionHeader(msg.get());
+ m_headerPrintedForThisSection = true;
+
+ msg << result.getSourceInfo() << '\n';
+
+ switch (result.getResultType()) {
+ case ResultWas::ExpressionFailed:
+ msg << "expression failed";
+ break;
+ case ResultWas::ThrewException:
+ msg << "unexpected exception";
+ break;
+ case ResultWas::FatalErrorCondition:
+ msg << "fatal error condition";
+ break;
+ case ResultWas::DidntThrowException:
+ msg << "no exception was thrown where one was expected";
+ break;
+ case ResultWas::ExplicitFailure:
+ msg << "explicit failure";
+ break;
+
+ // We shouldn't get here because of the isOk() test
+ case ResultWas::Ok:
+ case ResultWas::Info:
+ case ResultWas::Warning:
+ CATCH_ERROR("Internal error in TeamCity reporter");
+ // These cases are here to prevent compiler warnings
+ case ResultWas::Unknown:
+ case ResultWas::FailureBit:
+ case ResultWas::Exception:
+ CATCH_ERROR("Not implemented");
+ }
+ if (assertionStats.infoMessages.size() == 1)
+ msg << " with message:";
+ if (assertionStats.infoMessages.size() > 1)
+ msg << " with messages:";
+ for (auto const& messageInfo : assertionStats.infoMessages)
+ msg << "\n \"" << messageInfo.message << '"';
+
+
+ if (result.hasExpression()) {
+ msg <<
+ "\n " << result.getExpressionInMacro() << "\n"
+ "with expansion:\n"
+ " " << result.getExpandedExpression() << '\n';
+ }
+
+ if (currentTestCaseInfo->okToFail()) {
+ msg << "- failure ignore as test marked as 'ok to fail'\n";
+ m_stream << "##teamcity[testIgnored"
+ << " name='" << escape(currentTestCaseInfo->name) << '\''
+ << " message='" << escape(msg.str()) << '\''
+ << "]\n";
+ } else {
+ m_stream << "##teamcity[testFailed"
+ << " name='" << escape(currentTestCaseInfo->name) << '\''
+ << " message='" << escape(msg.str()) << '\''
+ << "]\n";
+ }
+ }
+ m_stream.flush();
+ }
+
+ void TeamCityReporter::testCaseStarting(TestCaseInfo const& testInfo) {
+ m_testTimer.start();
+ StreamingReporterBase::testCaseStarting(testInfo);
+ m_stream << "##teamcity[testStarted name='"
+ << escape(testInfo.name) << "']\n";
+ m_stream.flush();
+ }
+
+ void TeamCityReporter::testCaseEnded(TestCaseStats const& testCaseStats) {
+ StreamingReporterBase::testCaseEnded(testCaseStats);
+ auto const& testCaseInfo = *testCaseStats.testInfo;
+ if (!testCaseStats.stdOut.empty())
+ m_stream << "##teamcity[testStdOut name='"
+ << escape(testCaseInfo.name)
+ << "' out='" << escape(testCaseStats.stdOut) << "']\n";
+ if (!testCaseStats.stdErr.empty())
+ m_stream << "##teamcity[testStdErr name='"
+ << escape(testCaseInfo.name)
+ << "' out='" << escape(testCaseStats.stdErr) << "']\n";
+ m_stream << "##teamcity[testFinished name='"
+ << escape(testCaseInfo.name) << "' duration='"
+ << m_testTimer.getElapsedMilliseconds() << "']\n";
+ m_stream.flush();
+ }
+
+ void TeamCityReporter::printSectionHeader(std::ostream& os) {
+ assert(!m_sectionStack.empty());
+
+ if (m_sectionStack.size() > 1) {
+ os << lineOfChars('-') << '\n';
+
+ std::vector<SectionInfo>::const_iterator
+ it = m_sectionStack.begin() + 1, // Skip first section (test case)
+ itEnd = m_sectionStack.end();
+ for (; it != itEnd; ++it)
+ printHeaderString(os, it->name);
+ os << lineOfChars('-') << '\n';
+ }
+
+ SourceLineInfo lineInfo = m_sectionStack.front().lineInfo;
+
+ os << lineInfo << '\n';
+ os << lineOfChars('.') << "\n\n";
+ }
+
+} // end namespace Catch
+
+
+
+
+#if defined(_MSC_VER)
+#pragma warning(push)
+#pragma warning(disable:4061) // Not all labels are EXPLICITLY handled in switch
+ // Note that 4062 (not all labels are handled
+ // and default is missing) is enabled
+#endif
+
+namespace Catch {
+ XmlReporter::XmlReporter( ReporterConfig&& _config )
+ : StreamingReporterBase( CATCH_MOVE(_config) ),
+ m_xml(m_stream)
+ {
+ m_preferences.shouldRedirectStdOut = true;
+ m_preferences.shouldReportAllAssertions = true;
+ }
+
+ XmlReporter::~XmlReporter() = default;
+
+ std::string XmlReporter::getDescription() {
+ return "Reports test results as an XML document";
+ }
+
+ std::string XmlReporter::getStylesheetRef() const {
+ return std::string();
+ }
+
+ void XmlReporter::writeSourceInfo( SourceLineInfo const& sourceInfo ) {
+ m_xml
+ .writeAttribute( "filename"_sr, sourceInfo.file )
+ .writeAttribute( "line"_sr, sourceInfo.line );
+ }
+
+ void XmlReporter::testRunStarting( TestRunInfo const& testInfo ) {
+ StreamingReporterBase::testRunStarting( testInfo );
+ std::string stylesheetRef = getStylesheetRef();
+ if( !stylesheetRef.empty() )
+ m_xml.writeStylesheetRef( stylesheetRef );
+ m_xml.startElement("Catch2TestRun")
+ .writeAttribute("name"_sr, m_config->name())
+ .writeAttribute("rng-seed"_sr, m_config->rngSeed())
+ .writeAttribute("catch2-version"_sr, libraryVersion());
+ if (m_config->testSpec().hasFilters())
+ m_xml.writeAttribute( "filters"_sr, serializeFilters( m_config->getTestsOrTags() ) );
+ }
+
+ void XmlReporter::testCaseStarting( TestCaseInfo const& testInfo ) {
+ StreamingReporterBase::testCaseStarting(testInfo);
+ m_xml.startElement( "TestCase" )
+ .writeAttribute( "name"_sr, trim( testInfo.name ) )
+ .writeAttribute( "tags"_sr, testInfo.tagsAsString() );
+
+ writeSourceInfo( testInfo.lineInfo );
+
+ if ( m_config->showDurations() == ShowDurations::Always )
+ m_testCaseTimer.start();
+ m_xml.ensureTagClosed();
+ }
+
+ void XmlReporter::sectionStarting( SectionInfo const& sectionInfo ) {
+ StreamingReporterBase::sectionStarting( sectionInfo );
+ if( m_sectionDepth++ > 0 ) {
+ m_xml.startElement( "Section" )
+ .writeAttribute( "name"_sr, trim( sectionInfo.name ) );
+ writeSourceInfo( sectionInfo.lineInfo );
+ m_xml.ensureTagClosed();
+ }
+ }
+
+ void XmlReporter::assertionStarting( AssertionInfo const& ) { }
+
+ void XmlReporter::assertionEnded( AssertionStats const& assertionStats ) {
+
+ AssertionResult const& result = assertionStats.assertionResult;
+
+ bool includeResults = m_config->includeSuccessfulResults() || !result.isOk();
+
+ if( includeResults || result.getResultType() == ResultWas::Warning ) {
+ // Print any info messages in <Info> tags.
+ for( auto const& msg : assertionStats.infoMessages ) {
+ if( msg.type == ResultWas::Info && includeResults ) {
+ m_xml.scopedElement( "Info" )
+ .writeText( msg.message );
+ } else if ( msg.type == ResultWas::Warning ) {
+ m_xml.scopedElement( "Warning" )
+ .writeText( msg.message );
+ }
+ }
+ }
+
+ // Drop out if result was successful but we're not printing them.
+ if( !includeResults && result.getResultType() != ResultWas::Warning )
+ return;
+
+
+ // Print the expression if there is one.
+ if( result.hasExpression() ) {
+ m_xml.startElement( "Expression" )
+ .writeAttribute( "success"_sr, result.succeeded() )
+ .writeAttribute( "type"_sr, result.getTestMacroName() );
+
+ writeSourceInfo( result.getSourceInfo() );
+
+ m_xml.scopedElement( "Original" )
+ .writeText( result.getExpression() );
+ m_xml.scopedElement( "Expanded" )
+ .writeText( result.getExpandedExpression() );
+ }
+
+ // And... Print a result applicable to each result type.
+ switch( result.getResultType() ) {
+ case ResultWas::ThrewException:
+ m_xml.startElement( "Exception" );
+ writeSourceInfo( result.getSourceInfo() );
+ m_xml.writeText( result.getMessage() );
+ m_xml.endElement();
+ break;
+ case ResultWas::FatalErrorCondition:
+ m_xml.startElement( "FatalErrorCondition" );
+ writeSourceInfo( result.getSourceInfo() );
+ m_xml.writeText( result.getMessage() );
+ m_xml.endElement();
+ break;
+ case ResultWas::Info:
+ m_xml.scopedElement( "Info" )
+ .writeText( result.getMessage() );
+ break;
+ case ResultWas::Warning:
+ // Warning will already have been written
+ break;
+ case ResultWas::ExplicitFailure:
+ m_xml.startElement( "Failure" );
+ writeSourceInfo( result.getSourceInfo() );
+ m_xml.writeText( result.getMessage() );
+ m_xml.endElement();
+ break;
+ default:
+ break;
+ }
+
+ if( result.hasExpression() )
+ m_xml.endElement();
+ }
+
+ void XmlReporter::sectionEnded( SectionStats const& sectionStats ) {
+ StreamingReporterBase::sectionEnded( sectionStats );
+ if( --m_sectionDepth > 0 ) {
+ XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResults" );
+ e.writeAttribute( "successes"_sr, sectionStats.assertions.passed );
+ e.writeAttribute( "failures"_sr, sectionStats.assertions.failed );
+ e.writeAttribute( "expectedFailures"_sr, sectionStats.assertions.failedButOk );
+
+ if ( m_config->showDurations() == ShowDurations::Always )
+ e.writeAttribute( "durationInSeconds"_sr, sectionStats.durationInSeconds );
+
+ m_xml.endElement();
+ }
+ }
+
+ void XmlReporter::testCaseEnded( TestCaseStats const& testCaseStats ) {
+ StreamingReporterBase::testCaseEnded( testCaseStats );
+ XmlWriter::ScopedElement e = m_xml.scopedElement( "OverallResult" );
+ e.writeAttribute( "success"_sr, testCaseStats.totals.assertions.allOk() );
+
+ if ( m_config->showDurations() == ShowDurations::Always )
+ e.writeAttribute( "durationInSeconds"_sr, m_testCaseTimer.getElapsedSeconds() );
+
+ if( !testCaseStats.stdOut.empty() )
+ m_xml.scopedElement( "StdOut" ).writeText( trim( testCaseStats.stdOut ), XmlFormatting::Newline );
+ if( !testCaseStats.stdErr.empty() )
+ m_xml.scopedElement( "StdErr" ).writeText( trim( testCaseStats.stdErr ), XmlFormatting::Newline );
+
+ m_xml.endElement();
+ }
+
+ void XmlReporter::testRunEnded( TestRunStats const& testRunStats ) {
+ StreamingReporterBase::testRunEnded( testRunStats );
+ m_xml.scopedElement( "OverallResults" )
+ .writeAttribute( "successes"_sr, testRunStats.totals.assertions.passed )
+ .writeAttribute( "failures"_sr, testRunStats.totals.assertions.failed )
+ .writeAttribute( "expectedFailures"_sr, testRunStats.totals.assertions.failedButOk );
+ m_xml.scopedElement( "OverallResultsCases")
+ .writeAttribute( "successes"_sr, testRunStats.totals.testCases.passed )
+ .writeAttribute( "failures"_sr, testRunStats.totals.testCases.failed )
+ .writeAttribute( "expectedFailures"_sr, testRunStats.totals.testCases.failedButOk );
+ m_xml.endElement();
+ }
+
+ void XmlReporter::benchmarkPreparing( StringRef name ) {
+ m_xml.startElement("BenchmarkResults")
+ .writeAttribute("name"_sr, name);
+ }
+
+ void XmlReporter::benchmarkStarting(BenchmarkInfo const &info) {
+ m_xml.writeAttribute("samples"_sr, info.samples)
+ .writeAttribute("resamples"_sr, info.resamples)
+ .writeAttribute("iterations"_sr, info.iterations)
+ .writeAttribute("clockResolution"_sr, info.clockResolution)
+ .writeAttribute("estimatedDuration"_sr, info.estimatedDuration)
+ .writeComment("All values in nano seconds"_sr);
+ }
+
+ void XmlReporter::benchmarkEnded(BenchmarkStats<> const& benchmarkStats) {
+ m_xml.startElement("mean")
+ .writeAttribute("value"_sr, benchmarkStats.mean.point.count())
+ .writeAttribute("lowerBound"_sr, benchmarkStats.mean.lower_bound.count())
+ .writeAttribute("upperBound"_sr, benchmarkStats.mean.upper_bound.count())
+ .writeAttribute("ci"_sr, benchmarkStats.mean.confidence_interval);
+ m_xml.endElement();
+ m_xml.startElement("standardDeviation")
+ .writeAttribute("value"_sr, benchmarkStats.standardDeviation.point.count())
+ .writeAttribute("lowerBound"_sr, benchmarkStats.standardDeviation.lower_bound.count())
+ .writeAttribute("upperBound"_sr, benchmarkStats.standardDeviation.upper_bound.count())
+ .writeAttribute("ci"_sr, benchmarkStats.standardDeviation.confidence_interval);
+ m_xml.endElement();
+ m_xml.startElement("outliers")
+ .writeAttribute("variance"_sr, benchmarkStats.outlierVariance)
+ .writeAttribute("lowMild"_sr, benchmarkStats.outliers.low_mild)
+ .writeAttribute("lowSevere"_sr, benchmarkStats.outliers.low_severe)
+ .writeAttribute("highMild"_sr, benchmarkStats.outliers.high_mild)
+ .writeAttribute("highSevere"_sr, benchmarkStats.outliers.high_severe);
+ m_xml.endElement();
+ m_xml.endElement();
+ }
+
+ void XmlReporter::benchmarkFailed(StringRef error) {
+ m_xml.scopedElement("failed").
+ writeAttribute("message"_sr, error);
+ m_xml.endElement();
+ }
+
+ void XmlReporter::listReporters(std::vector<ReporterDescription> const& descriptions) {
+ auto outerTag = m_xml.scopedElement("AvailableReporters");
+ for (auto const& reporter : descriptions) {
+ auto inner = m_xml.scopedElement("Reporter");
+ m_xml.startElement("Name", XmlFormatting::Indent)
+ .writeText(reporter.name, XmlFormatting::None)
+ .endElement(XmlFormatting::Newline);
+ m_xml.startElement("Description", XmlFormatting::Indent)
+ .writeText(reporter.description, XmlFormatting::None)
+ .endElement(XmlFormatting::Newline);
+ }
+ }
+
+ void XmlReporter::listListeners(std::vector<ListenerDescription> const& descriptions) {
+ auto outerTag = m_xml.scopedElement( "RegisteredListeners" );
+ for ( auto const& listener : descriptions ) {
+ auto inner = m_xml.scopedElement( "Listener" );
+ m_xml.startElement( "Name", XmlFormatting::Indent )
+ .writeText( listener.name, XmlFormatting::None )
+ .endElement( XmlFormatting::Newline );
+ m_xml.startElement( "Description", XmlFormatting::Indent )
+ .writeText( listener.description, XmlFormatting::None )
+ .endElement( XmlFormatting::Newline );
+ }
+ }
+
+ void XmlReporter::listTests(std::vector<TestCaseHandle> const& tests) {
+ auto outerTag = m_xml.scopedElement("MatchingTests");
+ for (auto const& test : tests) {
+ auto innerTag = m_xml.scopedElement("TestCase");
+ auto const& testInfo = test.getTestCaseInfo();
+ m_xml.startElement("Name", XmlFormatting::Indent)
+ .writeText(testInfo.name, XmlFormatting::None)
+ .endElement(XmlFormatting::Newline);
+ m_xml.startElement("ClassName", XmlFormatting::Indent)
+ .writeText(testInfo.className, XmlFormatting::None)
+ .endElement(XmlFormatting::Newline);
+ m_xml.startElement("Tags", XmlFormatting::Indent)
+ .writeText(testInfo.tagsAsString(), XmlFormatting::None)
+ .endElement(XmlFormatting::Newline);
+
+ auto sourceTag = m_xml.scopedElement("SourceInfo");
+ m_xml.startElement("File", XmlFormatting::Indent)
+ .writeText(testInfo.lineInfo.file, XmlFormatting::None)
+ .endElement(XmlFormatting::Newline);
+ m_xml.startElement("Line", XmlFormatting::Indent)
+ .writeText(std::to_string(testInfo.lineInfo.line), XmlFormatting::None)
+ .endElement(XmlFormatting::Newline);
+ }
+ }
+
+ void XmlReporter::listTags(std::vector<TagInfo> const& tags) {
+ auto outerTag = m_xml.scopedElement("TagsFromMatchingTests");
+ for (auto const& tag : tags) {
+ auto innerTag = m_xml.scopedElement("Tag");
+ m_xml.startElement("Count", XmlFormatting::Indent)
+ .writeText(std::to_string(tag.count), XmlFormatting::None)
+ .endElement(XmlFormatting::Newline);
+ auto aliasTag = m_xml.scopedElement("Aliases");
+ for (auto const& alias : tag.spellings) {
+ m_xml.startElement("Alias", XmlFormatting::Indent)
+ .writeText(alias, XmlFormatting::None)
+ .endElement(XmlFormatting::Newline);
+ }
+ }
+ }
+
+} // end namespace Catch
+
+#if defined(_MSC_VER)
+#pragma warning(pop)
+#endif
diff --git a/3rdparty/bx/3rdparty/catch/catch_amalgamated.hpp b/3rdparty/bx/3rdparty/catch/catch_amalgamated.hpp
new file mode 100644
index 00000000000..757e10c5ac5
--- /dev/null
+++ b/3rdparty/bx/3rdparty/catch/catch_amalgamated.hpp
@@ -0,0 +1,12233 @@
+// Copyright Catch2 Authors
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// https://www.boost.org/LICENSE_1_0.txt)
+
+// SPDX-License-Identifier: BSL-1.0
+
+// Catch v3.1.0
+// Generated: 2022-07-17 20:14:04.055157
+// ----------------------------------------------------------
+// This file is an amalgamation of multiple different files.
+// You probably shouldn't edit it directly.
+// ----------------------------------------------------------
+#ifndef CATCH_AMALGAMATED_HPP_INCLUDED
+#define CATCH_AMALGAMATED_HPP_INCLUDED
+
+
+/** \file
+ * This is a convenience header for Catch2. It includes **all** of Catch2 headers.
+ *
+ * Generally the Catch2 users should use specific includes they need,
+ * but this header can be used instead for ease-of-experimentation, or
+ * just plain convenience, at the cost of (significantly) increased
+ * compilation times.
+ *
+ * When a new header is added to either the top level folder, or to the
+ * corresponding internal subfolder, it should be added here. Headers
+ * added to the various subparts (e.g. matchers, generators, etc...),
+ * should go their respective catch-all headers.
+ */
+
+#ifndef CATCH_ALL_HPP_INCLUDED
+#define CATCH_ALL_HPP_INCLUDED
+
+
+
+/** \file
+ * This is a convenience header for Catch2's benchmarking. It includes
+ * **all** of Catch2 headers related to benchmarking.
+ *
+ * Generally the Catch2 users should use specific includes they need,
+ * but this header can be used instead for ease-of-experimentation, or
+ * just plain convenience, at the cost of (significantly) increased
+ * compilation times.
+ *
+ * When a new header is added to either the `benchmark` folder, or to
+ * the corresponding internal (detail) subfolder, it should be added here.
+ */
+
+#ifndef CATCH_BENCHMARK_ALL_HPP_INCLUDED
+#define CATCH_BENCHMARK_ALL_HPP_INCLUDED
+
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_BENCHMARK_HPP_INCLUDED
+#define CATCH_BENCHMARK_HPP_INCLUDED
+
+
+
+#ifndef CATCH_INTERFACES_CONFIG_HPP_INCLUDED
+#define CATCH_INTERFACES_CONFIG_HPP_INCLUDED
+
+
+
+#ifndef CATCH_NONCOPYABLE_HPP_INCLUDED
+#define CATCH_NONCOPYABLE_HPP_INCLUDED
+
+namespace Catch {
+ namespace Detail {
+
+ //! Deriving classes become noncopyable and nonmovable
+ class NonCopyable {
+ NonCopyable( NonCopyable const& ) = delete;
+ NonCopyable( NonCopyable&& ) = delete;
+ NonCopyable& operator=( NonCopyable const& ) = delete;
+ NonCopyable& operator=( NonCopyable&& ) = delete;
+
+ protected:
+ NonCopyable() noexcept = default;
+ };
+
+ } // namespace Detail
+} // namespace Catch
+
+#endif // CATCH_NONCOPYABLE_HPP_INCLUDED
+
+
+#ifndef CATCH_STRINGREF_HPP_INCLUDED
+#define CATCH_STRINGREF_HPP_INCLUDED
+
+#include <cstddef>
+#include <string>
+#include <iosfwd>
+#include <cassert>
+
+namespace Catch {
+
+ /// A non-owning string class (similar to the forthcoming std::string_view)
+ /// Note that, because a StringRef may be a substring of another string,
+ /// it may not be null terminated.
+ class StringRef {
+ public:
+ using size_type = std::size_t;
+ using const_iterator = const char*;
+
+ private:
+ static constexpr char const* const s_empty = "";
+
+ char const* m_start = s_empty;
+ size_type m_size = 0;
+
+ public: // construction
+ constexpr StringRef() noexcept = default;
+
+ StringRef( char const* rawChars ) noexcept;
+
+ constexpr StringRef( char const* rawChars, size_type size ) noexcept
+ : m_start( rawChars ),
+ m_size( size )
+ {}
+
+ StringRef( std::string const& stdString ) noexcept
+ : m_start( stdString.c_str() ),
+ m_size( stdString.size() )
+ {}
+
+ explicit operator std::string() const {
+ return std::string(m_start, m_size);
+ }
+
+ public: // operators
+ auto operator == ( StringRef other ) const noexcept -> bool;
+ auto operator != (StringRef other) const noexcept -> bool {
+ return !(*this == other);
+ }
+
+ constexpr auto operator[] ( size_type index ) const noexcept -> char {
+ assert(index < m_size);
+ return m_start[index];
+ }
+
+ bool operator<(StringRef rhs) const noexcept;
+
+ public: // named queries
+ constexpr auto empty() const noexcept -> bool {
+ return m_size == 0;
+ }
+ constexpr auto size() const noexcept -> size_type {
+ return m_size;
+ }
+
+ // Returns a substring of [start, start + length).
+ // If start + length > size(), then the substring is [start, start + size()).
+ // If start > size(), then the substring is empty.
+ constexpr StringRef substr(size_type start, size_type length) const noexcept {
+ if (start < m_size) {
+ const auto shortened_size = m_size - start;
+ return StringRef(m_start + start, (shortened_size < length) ? shortened_size : length);
+ } else {
+ return StringRef();
+ }
+ }
+
+ // Returns the current start pointer. May not be null-terminated.
+ constexpr char const* data() const noexcept {
+ return m_start;
+ }
+
+ constexpr const_iterator begin() const { return m_start; }
+ constexpr const_iterator end() const { return m_start + m_size; }
+
+
+ friend std::string& operator += (std::string& lhs, StringRef sr);
+ friend std::ostream& operator << (std::ostream& os, StringRef sr);
+ friend std::string operator+(StringRef lhs, StringRef rhs);
+
+ /**
+ * Provides a three-way comparison with rhs
+ *
+ * Returns negative number if lhs < rhs, 0 if lhs == rhs, and a positive
+ * number if lhs > rhs
+ */
+ int compare( StringRef rhs ) const;
+ };
+
+
+ constexpr auto operator ""_sr( char const* rawChars, std::size_t size ) noexcept -> StringRef {
+ return StringRef( rawChars, size );
+ }
+} // namespace Catch
+
+constexpr auto operator ""_catch_sr( char const* rawChars, std::size_t size ) noexcept -> Catch::StringRef {
+ return Catch::StringRef( rawChars, size );
+}
+
+#endif // CATCH_STRINGREF_HPP_INCLUDED
+
+#include <chrono>
+#include <iosfwd>
+#include <string>
+#include <vector>
+
+namespace Catch {
+
+ enum class Verbosity {
+ Quiet = 0,
+ Normal,
+ High
+ };
+
+ struct WarnAbout { enum What {
+ Nothing = 0x00,
+ //! A test case or leaf section did not run any assertions
+ NoAssertions = 0x01,
+ //! A command line test spec matched no test cases
+ UnmatchedTestSpec = 0x02,
+ }; };
+
+ enum class ShowDurations {
+ DefaultForReporter,
+ Always,
+ Never
+ };
+ enum class TestRunOrder {
+ Declared,
+ LexicographicallySorted,
+ Randomized
+ };
+ enum class ColourMode : std::uint8_t {
+ //! Let Catch2 pick implementation based on platform detection
+ PlatformDefault,
+ //! Use ANSI colour code escapes
+ ANSI,
+ //! Use Win32 console colour API
+ Win32,
+ //! Don't use any colour
+ None
+ };
+ struct WaitForKeypress { enum When {
+ Never,
+ BeforeStart = 1,
+ BeforeExit = 2,
+ BeforeStartAndExit = BeforeStart | BeforeExit
+ }; };
+
+ class TestSpec;
+ class IStream;
+
+ class IConfig : public Detail::NonCopyable {
+ public:
+ virtual ~IConfig();
+
+ virtual bool allowThrows() const = 0;
+ virtual StringRef name() const = 0;
+ virtual bool includeSuccessfulResults() const = 0;
+ virtual bool shouldDebugBreak() const = 0;
+ virtual bool warnAboutMissingAssertions() const = 0;
+ virtual bool warnAboutUnmatchedTestSpecs() const = 0;
+ virtual bool zeroTestsCountAsSuccess() const = 0;
+ virtual int abortAfter() const = 0;
+ virtual bool showInvisibles() const = 0;
+ virtual ShowDurations showDurations() const = 0;
+ virtual double minDuration() const = 0;
+ virtual TestSpec const& testSpec() const = 0;
+ virtual bool hasTestFilters() const = 0;
+ virtual std::vector<std::string> const& getTestsOrTags() const = 0;
+ virtual TestRunOrder runOrder() const = 0;
+ virtual uint32_t rngSeed() const = 0;
+ virtual unsigned int shardCount() const = 0;
+ virtual unsigned int shardIndex() const = 0;
+ virtual ColourMode defaultColourMode() const = 0;
+ virtual std::vector<std::string> const& getSectionsToRun() const = 0;
+ virtual Verbosity verbosity() const = 0;
+
+ virtual bool skipBenchmarks() const = 0;
+ virtual bool benchmarkNoAnalysis() const = 0;
+ virtual unsigned int benchmarkSamples() const = 0;
+ virtual double benchmarkConfidenceInterval() const = 0;
+ virtual unsigned int benchmarkResamples() const = 0;
+ virtual std::chrono::milliseconds benchmarkWarmupTime() const = 0;
+ };
+}
+
+#endif // CATCH_INTERFACES_CONFIG_HPP_INCLUDED
+
+
+#ifndef CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
+#define CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
+
+// Detect a number of compiler features - by compiler
+// The following features are defined:
+//
+// CATCH_CONFIG_WINDOWS_SEH : is Windows SEH supported?
+// CATCH_CONFIG_POSIX_SIGNALS : are POSIX signals supported?
+// CATCH_CONFIG_DISABLE_EXCEPTIONS : Are exceptions enabled?
+// ****************
+// Note to maintainers: if new toggles are added please document them
+// in configuration.md, too
+// ****************
+
+// In general each macro has a _NO_<feature name> form
+// (e.g. CATCH_CONFIG_NO_POSIX_SIGNALS) which disables the feature.
+// Many features, at point of detection, define an _INTERNAL_ macro, so they
+// can be combined, en-mass, with the _NO_ forms later.
+
+
+
+#ifndef CATCH_PLATFORM_HPP_INCLUDED
+#define CATCH_PLATFORM_HPP_INCLUDED
+
+// See e.g.:
+// https://opensource.apple.com/source/CarbonHeaders/CarbonHeaders-18.1/TargetConditionals.h.auto.html
+#ifdef __APPLE__
+# include <TargetConditionals.h>
+# if (defined(TARGET_OS_OSX) && TARGET_OS_OSX == 1) || \
+ (defined(TARGET_OS_MAC) && TARGET_OS_MAC == 1)
+# define CATCH_PLATFORM_MAC
+# elif (defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE == 1)
+# define CATCH_PLATFORM_IPHONE
+# endif
+
+#elif defined(linux) || defined(__linux) || defined(__linux__)
+# define CATCH_PLATFORM_LINUX
+
+#elif defined(WIN32) || defined(__WIN32__) || defined(_WIN32) || defined(_MSC_VER) || defined(__MINGW32__)
+# define CATCH_PLATFORM_WINDOWS
+#endif
+
+#endif // CATCH_PLATFORM_HPP_INCLUDED
+
+#ifdef __cplusplus
+
+# if (__cplusplus >= 201402L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L)
+# define CATCH_CPP14_OR_GREATER
+# endif
+
+# if (__cplusplus >= 201703L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
+# define CATCH_CPP17_OR_GREATER
+# endif
+
+#endif
+
+// Only GCC compiler should be used in this block, so other compilers trying to
+// mask themselves as GCC should be ignored.
+#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && !defined(__CUDACC__) && !defined(__LCC__)
+# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic push" )
+# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "GCC diagnostic pop" )
+
+// This only works on GCC 9+. so we have to also add a global suppression of Wparentheses
+// for older versions of GCC.
+# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
+ _Pragma( "GCC diagnostic ignored \"-Wparentheses\"" )
+
+# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ _Pragma( "GCC diagnostic ignored \"-Wunused-variable\"" )
+
+# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__)
+
+#endif
+
+#if defined(__CUDACC__) && !defined(__clang__)
+# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "nv_diagnostic push" )
+# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "nv_diagnostic pop" )
+# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS _Pragma( "nv_diag_suppress 177" )
+#endif
+
+// clang-cl defines _MSC_VER as well as __clang__, which could cause the
+// start/stop internal suppression macros to be double defined.
+#if defined(__clang__) && !defined(_MSC_VER)
+
+# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic push" )
+# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION _Pragma( "clang diagnostic pop" )
+
+#endif // __clang__ && !_MSC_VER
+
+#if defined(__clang__)
+
+// As of this writing, IBM XL's implementation of __builtin_constant_p has a bug
+// which results in calls to destructors being emitted for each temporary,
+// without a matching initialization. In practice, this can result in something
+// like `std::string::~string` being called on an uninitialized value.
+//
+// For example, this code will likely segfault under IBM XL:
+// ```
+// REQUIRE(std::string("12") + "34" == "1234")
+// ```
+//
+// Similarly, NVHPC's implementation of `__builtin_constant_p` has a bug which
+// results in calls to the immediately evaluated lambda expressions to be
+// reported as unevaluated lambdas.
+// https://developer.nvidia.com/nvidia_bug/3321845.
+//
+// Therefore, `CATCH_INTERNAL_IGNORE_BUT_WARN` is not implemented.
+# if !defined(__ibmxl__) && !defined(__CUDACC__) && !defined( __NVCOMPILER )
+# define CATCH_INTERNAL_IGNORE_BUT_WARN(...) (void)__builtin_constant_p(__VA_ARGS__) /* NOLINT(cppcoreguidelines-pro-type-vararg, hicpp-vararg) */
+# endif
+
+
+# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ _Pragma( "clang diagnostic ignored \"-Wexit-time-destructors\"" ) \
+ _Pragma( "clang diagnostic ignored \"-Wglobal-constructors\"")
+
+# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
+ _Pragma( "clang diagnostic ignored \"-Wparentheses\"" )
+
+# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ _Pragma( "clang diagnostic ignored \"-Wunused-variable\"" )
+
+# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
+ _Pragma( "clang diagnostic ignored \"-Wgnu-zero-variadic-macro-arguments\"" )
+
+# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
+ _Pragma( "clang diagnostic ignored \"-Wunused-template\"" )
+
+#endif // __clang__
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Assume that non-Windows platforms support posix signals by default
+#if !defined(CATCH_PLATFORM_WINDOWS)
+ #define CATCH_INTERNAL_CONFIG_POSIX_SIGNALS
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// We know some environments not to support full POSIX signals
+#if defined(__CYGWIN__) || defined(__QNX__) || defined(__EMSCRIPTEN__) || defined(__DJGPP__)
+ #define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
+#endif
+
+#ifdef __OS400__
+# define CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// Android somehow still does not support std::to_string
+#if defined(__ANDROID__)
+# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// Not all Windows environments support SEH properly
+#if defined(__MINGW32__)
+# define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// PS4
+#if defined(__ORBIS__)
+# define CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+// Cygwin
+#ifdef __CYGWIN__
+
+// Required for some versions of Cygwin to declare gettimeofday
+// see: http://stackoverflow.com/questions/36901803/gettimeofday-not-declared-in-this-scope-cygwin
+# define _BSD_SOURCE
+// some versions of cygwin (most) do not support std::to_string. Use the libstd check.
+// https://gcc.gnu.org/onlinedocs/gcc-4.8.2/libstdc++/api/a01053_source.html line 2812-2813
+# if !((__cplusplus >= 201103L) && defined(_GLIBCXX_USE_C99) \
+ && !defined(_GLIBCXX_HAVE_BROKEN_VSWPRINTF))
+
+# define CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING
+
+# endif
+#endif // __CYGWIN__
+
+////////////////////////////////////////////////////////////////////////////////
+// Visual C++
+#if defined(_MSC_VER)
+
+# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION __pragma( warning(push) )
+# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION __pragma( warning(pop) )
+
+// Universal Windows platform does not support SEH
+// Or console colours (or console at all...)
+# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
+# define CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32
+# else
+# define CATCH_INTERNAL_CONFIG_WINDOWS_SEH
+# endif
+
+// MSVC traditional preprocessor needs some workaround for __VA_ARGS__
+// _MSVC_TRADITIONAL == 0 means new conformant preprocessor
+// _MSVC_TRADITIONAL == 1 means old traditional non-conformant preprocessor
+# if !defined(__clang__) // Handle Clang masquerading for msvc
+# if !defined(_MSVC_TRADITIONAL) || (defined(_MSVC_TRADITIONAL) && _MSVC_TRADITIONAL)
+# define CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+# endif // MSVC_TRADITIONAL
+# endif // __clang__
+
+#endif // _MSC_VER
+
+#if defined(_REENTRANT) || defined(_MSC_VER)
+// Enable async processing, as -pthread is specified or no additional linking is required
+# define CATCH_INTERNAL_CONFIG_USE_ASYNC
+#endif // _MSC_VER
+
+////////////////////////////////////////////////////////////////////////////////
+// Check if we are compiled with -fno-exceptions or equivalent
+#if defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND)
+# define CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED
+#endif
+
+
+////////////////////////////////////////////////////////////////////////////////
+// Embarcadero C++Build
+#if defined(__BORLANDC__)
+ #define CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN
+#endif
+
+////////////////////////////////////////////////////////////////////////////////
+
+// RTX is a special version of Windows that is real time.
+// This means that it is detected as Windows, but does not provide
+// the same set of capabilities as real Windows does.
+#if defined(UNDER_RTSS) || defined(RTX64_BUILD)
+ #define CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH
+ #define CATCH_INTERNAL_CONFIG_NO_ASYNC
+ #define CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32
+#endif
+
+#if !defined(_GLIBCXX_USE_C99_MATH_TR1)
+#define CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER
+#endif
+
+// Various stdlib support checks that require __has_include
+#if defined(__has_include)
+ // Check if string_view is available and usable
+ #if __has_include(<string_view>) && defined(CATCH_CPP17_OR_GREATER)
+ # define CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW
+ #endif
+
+ // Check if optional is available and usable
+ # if __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
+ # define CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL
+ # endif // __has_include(<optional>) && defined(CATCH_CPP17_OR_GREATER)
+
+ // Check if byte is available and usable
+ # if __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
+ # include <cstddef>
+ # if defined(__cpp_lib_byte) && (__cpp_lib_byte > 0)
+ # define CATCH_INTERNAL_CONFIG_CPP17_BYTE
+ # endif
+ # endif // __has_include(<cstddef>) && defined(CATCH_CPP17_OR_GREATER)
+
+ // Check if variant is available and usable
+ # if __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
+ # if defined(__clang__) && (__clang_major__ < 8)
+ // work around clang bug with libstdc++ https://bugs.llvm.org/show_bug.cgi?id=31852
+ // fix should be in clang 8, workaround in libstdc++ 8.2
+ # include <ciso646>
+ # if defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
+ # define CATCH_CONFIG_NO_CPP17_VARIANT
+ # else
+ # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
+ # endif // defined(__GLIBCXX__) && defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE < 9)
+ # else
+ # define CATCH_INTERNAL_CONFIG_CPP17_VARIANT
+ # endif // defined(__clang__) && (__clang_major__ < 8)
+ # endif // __has_include(<variant>) && defined(CATCH_CPP17_OR_GREATER)
+#endif // defined(__has_include)
+
+
+#if defined(CATCH_INTERNAL_CONFIG_WINDOWS_SEH) && !defined(CATCH_CONFIG_NO_WINDOWS_SEH) && !defined(CATCH_CONFIG_WINDOWS_SEH) && !defined(CATCH_INTERNAL_CONFIG_NO_WINDOWS_SEH)
+# define CATCH_CONFIG_WINDOWS_SEH
+#endif
+// This is set by default, because we assume that unix compilers are posix-signal-compatible by default.
+#if defined(CATCH_INTERNAL_CONFIG_POSIX_SIGNALS) && !defined(CATCH_INTERNAL_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_NO_POSIX_SIGNALS) && !defined(CATCH_CONFIG_POSIX_SIGNALS)
+# define CATCH_CONFIG_POSIX_SIGNALS
+#endif
+
+#if !defined(CATCH_INTERNAL_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_NO_CPP11_TO_STRING) && !defined(CATCH_CONFIG_CPP11_TO_STRING)
+# define CATCH_CONFIG_CPP11_TO_STRING
+#endif
+
+#if defined(CATCH_INTERNAL_CONFIG_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_NO_CPP17_OPTIONAL) && !defined(CATCH_CONFIG_CPP17_OPTIONAL)
+# define CATCH_CONFIG_CPP17_OPTIONAL
+#endif
+
+#if defined(CATCH_INTERNAL_CONFIG_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_NO_CPP17_STRING_VIEW) && !defined(CATCH_CONFIG_CPP17_STRING_VIEW)
+# define CATCH_CONFIG_CPP17_STRING_VIEW
+#endif
+
+#if defined(CATCH_INTERNAL_CONFIG_CPP17_VARIANT) && !defined(CATCH_CONFIG_NO_CPP17_VARIANT) && !defined(CATCH_CONFIG_CPP17_VARIANT)
+# define CATCH_CONFIG_CPP17_VARIANT
+#endif
+
+#if defined(CATCH_INTERNAL_CONFIG_CPP17_BYTE) && !defined(CATCH_CONFIG_NO_CPP17_BYTE) && !defined(CATCH_CONFIG_CPP17_BYTE)
+# define CATCH_CONFIG_CPP17_BYTE
+#endif
+
+
+#if defined(CATCH_CONFIG_EXPERIMENTAL_REDIRECT)
+# define CATCH_INTERNAL_CONFIG_NEW_CAPTURE
+#endif
+
+#if defined(CATCH_INTERNAL_CONFIG_NEW_CAPTURE) && !defined(CATCH_INTERNAL_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NO_NEW_CAPTURE) && !defined(CATCH_CONFIG_NEW_CAPTURE)
+# define CATCH_CONFIG_NEW_CAPTURE
+#endif
+
+#if !defined( CATCH_INTERNAL_CONFIG_EXCEPTIONS_ENABLED ) && \
+ !defined( CATCH_CONFIG_DISABLE_EXCEPTIONS ) && \
+ !defined( CATCH_CONFIG_NO_DISABLE_EXCEPTIONS )
+# define CATCH_CONFIG_DISABLE_EXCEPTIONS
+#endif
+
+#if defined(CATCH_INTERNAL_CONFIG_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_NO_POLYFILL_ISNAN) && !defined(CATCH_CONFIG_POLYFILL_ISNAN)
+# define CATCH_CONFIG_POLYFILL_ISNAN
+#endif
+
+#if defined(CATCH_INTERNAL_CONFIG_USE_ASYNC) && !defined(CATCH_INTERNAL_CONFIG_NO_ASYNC) && !defined(CATCH_CONFIG_NO_USE_ASYNC) && !defined(CATCH_CONFIG_USE_ASYNC)
+# define CATCH_CONFIG_USE_ASYNC
+#endif
+
+#if defined(CATCH_INTERNAL_CONFIG_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_NO_GLOBAL_NEXTAFTER) && !defined(CATCH_CONFIG_GLOBAL_NEXTAFTER)
+# define CATCH_CONFIG_GLOBAL_NEXTAFTER
+#endif
+
+
+// Even if we do not think the compiler has that warning, we still have
+// to provide a macro that can be used by the code.
+#if !defined(CATCH_INTERNAL_START_WARNINGS_SUPPRESSION)
+# define CATCH_INTERNAL_START_WARNINGS_SUPPRESSION
+#endif
+#if !defined(CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION)
+# define CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
+#endif
+#if !defined(CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS)
+# define CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS
+#endif
+#if !defined(CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS)
+# define CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS
+#endif
+#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS)
+# define CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS
+#endif
+#if !defined(CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS)
+# define CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS
+#endif
+
+// The goal of this macro is to avoid evaluation of the arguments, but
+// still have the compiler warn on problems inside...
+#if !defined(CATCH_INTERNAL_IGNORE_BUT_WARN)
+# define CATCH_INTERNAL_IGNORE_BUT_WARN(...)
+#endif
+
+#if defined(__APPLE__) && defined(__apple_build_version__) && (__clang_major__ < 10)
+# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
+#elif defined(__clang__) && (__clang_major__ < 5)
+# undef CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
+#endif
+
+#if !defined(CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS)
+# define CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS
+#endif
+
+#if defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+#define CATCH_TRY if ((true))
+#define CATCH_CATCH_ALL if ((false))
+#define CATCH_CATCH_ANON(type) if ((false))
+#else
+#define CATCH_TRY try
+#define CATCH_CATCH_ALL catch (...)
+#define CATCH_CATCH_ANON(type) catch (type)
+#endif
+
+#if defined(CATCH_INTERNAL_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_NO_TRADITIONAL_MSVC_PREPROCESSOR) && !defined(CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR)
+#define CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+#endif
+
+#if defined( CATCH_PLATFORM_WINDOWS ) && \
+ !defined( CATCH_CONFIG_COLOUR_WIN32 ) && \
+ !defined( CATCH_CONFIG_NO_COLOUR_WIN32 ) && \
+ !defined( CATCH_INTERNAL_CONFIG_NO_COLOUR_WIN32 )
+# define CATCH_CONFIG_COLOUR_WIN32
+#endif
+
+
+#endif // CATCH_COMPILER_CAPABILITIES_HPP_INCLUDED
+
+
+#ifndef CATCH_CONTEXT_HPP_INCLUDED
+#define CATCH_CONTEXT_HPP_INCLUDED
+
+namespace Catch {
+
+ class IResultCapture;
+ class IConfig;
+
+ class IContext {
+ public:
+ virtual ~IContext(); // = default
+
+ virtual IResultCapture* getResultCapture() = 0;
+ virtual IConfig const* getConfig() const = 0;
+ };
+
+ class IMutableContext : public IContext {
+ public:
+ ~IMutableContext() override; // = default
+ virtual void setResultCapture( IResultCapture* resultCapture ) = 0;
+ virtual void setConfig( IConfig const* config ) = 0;
+
+ private:
+ static IMutableContext *currentContext;
+ friend IMutableContext& getCurrentMutableContext();
+ friend void cleanUpContext();
+ static void createContext();
+ };
+
+ inline IMutableContext& getCurrentMutableContext()
+ {
+ if( !IMutableContext::currentContext )
+ IMutableContext::createContext();
+ // NOLINTNEXTLINE(clang-analyzer-core.uninitialized.UndefReturn)
+ return *IMutableContext::currentContext;
+ }
+
+ inline IContext& getCurrentContext()
+ {
+ return getCurrentMutableContext();
+ }
+
+ void cleanUpContext();
+
+ class SimplePcg32;
+ SimplePcg32& sharedRng();
+}
+
+#endif // CATCH_CONTEXT_HPP_INCLUDED
+
+
+#ifndef CATCH_INTERFACES_REPORTER_HPP_INCLUDED
+#define CATCH_INTERFACES_REPORTER_HPP_INCLUDED
+
+
+
+#ifndef CATCH_SECTION_INFO_HPP_INCLUDED
+#define CATCH_SECTION_INFO_HPP_INCLUDED
+
+
+
+#ifndef CATCH_MOVE_AND_FORWARD_HPP_INCLUDED
+#define CATCH_MOVE_AND_FORWARD_HPP_INCLUDED
+
+#include <type_traits>
+
+//! Replacement for std::move with better compile time performance
+#define CATCH_MOVE(...) static_cast<std::remove_reference_t<decltype(__VA_ARGS__)>&&>(__VA_ARGS__)
+
+//! Replacement for std::forward with better compile time performance
+#define CATCH_FORWARD(...) static_cast<decltype(__VA_ARGS__)&&>(__VA_ARGS__)
+
+#endif // CATCH_MOVE_AND_FORWARD_HPP_INCLUDED
+
+
+#ifndef CATCH_SOURCE_LINE_INFO_HPP_INCLUDED
+#define CATCH_SOURCE_LINE_INFO_HPP_INCLUDED
+
+#include <cstddef>
+#include <iosfwd>
+
+namespace Catch {
+
+ struct SourceLineInfo {
+
+ SourceLineInfo() = delete;
+ constexpr SourceLineInfo( char const* _file, std::size_t _line ) noexcept:
+ file( _file ),
+ line( _line )
+ {}
+
+ bool operator == ( SourceLineInfo const& other ) const noexcept;
+ bool operator < ( SourceLineInfo const& other ) const noexcept;
+
+ char const* file;
+ std::size_t line;
+
+ friend std::ostream& operator << (std::ostream& os, SourceLineInfo const& info);
+ };
+}
+
+#define CATCH_INTERNAL_LINEINFO \
+ ::Catch::SourceLineInfo( __FILE__, static_cast<std::size_t>( __LINE__ ) )
+
+#endif // CATCH_SOURCE_LINE_INFO_HPP_INCLUDED
+
+
+#ifndef CATCH_TOTALS_HPP_INCLUDED
+#define CATCH_TOTALS_HPP_INCLUDED
+
+#include <cstdint>
+
+namespace Catch {
+
+ struct Counts {
+ Counts operator - ( Counts const& other ) const;
+ Counts& operator += ( Counts const& other );
+
+ std::uint64_t total() const;
+ bool allPassed() const;
+ bool allOk() const;
+
+ std::uint64_t passed = 0;
+ std::uint64_t failed = 0;
+ std::uint64_t failedButOk = 0;
+ };
+
+ struct Totals {
+
+ Totals operator - ( Totals const& other ) const;
+ Totals& operator += ( Totals const& other );
+
+ Totals delta( Totals const& prevTotals ) const;
+
+ Counts assertions;
+ Counts testCases;
+ };
+}
+
+#endif // CATCH_TOTALS_HPP_INCLUDED
+
+#include <string>
+
+namespace Catch {
+
+ struct SectionInfo {
+ // The last argument is ignored, so that people can write
+ // SECTION("ShortName", "Proper description that is long") and
+ // still use the `-c` flag comfortably.
+ SectionInfo( SourceLineInfo const& _lineInfo, std::string _name,
+ const char* const = nullptr ):
+ name(CATCH_MOVE(_name)),
+ lineInfo(_lineInfo)
+ {}
+
+ std::string name;
+ SourceLineInfo lineInfo;
+ };
+
+ struct SectionEndInfo {
+ SectionInfo sectionInfo;
+ Counts prevAssertions;
+ double durationInSeconds;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_SECTION_INFO_HPP_INCLUDED
+
+
+#ifndef CATCH_ASSERTION_RESULT_HPP_INCLUDED
+#define CATCH_ASSERTION_RESULT_HPP_INCLUDED
+
+
+
+#ifndef CATCH_ASSERTION_INFO_HPP_INCLUDED
+#define CATCH_ASSERTION_INFO_HPP_INCLUDED
+
+
+
+#ifndef CATCH_RESULT_TYPE_HPP_INCLUDED
+#define CATCH_RESULT_TYPE_HPP_INCLUDED
+
+namespace Catch {
+
+ // ResultWas::OfType enum
+ struct ResultWas { enum OfType {
+ Unknown = -1,
+ Ok = 0,
+ Info = 1,
+ Warning = 2,
+
+ FailureBit = 0x10,
+
+ ExpressionFailed = FailureBit | 1,
+ ExplicitFailure = FailureBit | 2,
+
+ Exception = 0x100 | FailureBit,
+
+ ThrewException = Exception | 1,
+ DidntThrowException = Exception | 2,
+
+ FatalErrorCondition = 0x200 | FailureBit
+
+ }; };
+
+ bool isOk( ResultWas::OfType resultType );
+ bool isJustInfo( int flags );
+
+
+ // ResultDisposition::Flags enum
+ struct ResultDisposition { enum Flags {
+ Normal = 0x01,
+
+ ContinueOnFailure = 0x02, // Failures fail test, but execution continues
+ FalseTest = 0x04, // Prefix expression with !
+ SuppressFail = 0x08 // Failures are reported but do not fail the test
+ }; };
+
+ ResultDisposition::Flags operator | ( ResultDisposition::Flags lhs, ResultDisposition::Flags rhs );
+
+ bool shouldContinueOnFailure( int flags );
+ inline bool isFalseTest( int flags ) { return ( flags & ResultDisposition::FalseTest ) != 0; }
+ bool shouldSuppressFailure( int flags );
+
+} // end namespace Catch
+
+#endif // CATCH_RESULT_TYPE_HPP_INCLUDED
+
+namespace Catch {
+
+ struct AssertionInfo {
+ // AssertionInfo() = delete;
+
+ StringRef macroName;
+ SourceLineInfo lineInfo;
+ StringRef capturedExpression;
+ ResultDisposition::Flags resultDisposition;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_ASSERTION_INFO_HPP_INCLUDED
+
+
+#ifndef CATCH_LAZY_EXPR_HPP_INCLUDED
+#define CATCH_LAZY_EXPR_HPP_INCLUDED
+
+#include <iosfwd>
+
+namespace Catch {
+
+ class ITransientExpression;
+
+ class LazyExpression {
+ friend class AssertionHandler;
+ friend struct AssertionStats;
+ friend class RunContext;
+
+ ITransientExpression const* m_transientExpression = nullptr;
+ bool m_isNegated;
+ public:
+ LazyExpression( bool isNegated ):
+ m_isNegated(isNegated)
+ {}
+ LazyExpression(LazyExpression const& other) = default;
+ LazyExpression& operator = ( LazyExpression const& ) = delete;
+
+ explicit operator bool() const {
+ return m_transientExpression != nullptr;
+ }
+
+ friend auto operator << ( std::ostream& os, LazyExpression const& lazyExpr ) -> std::ostream&;
+ };
+
+} // namespace Catch
+
+#endif // CATCH_LAZY_EXPR_HPP_INCLUDED
+
+#include <string>
+
+namespace Catch {
+
+ struct AssertionResultData
+ {
+ AssertionResultData() = delete;
+
+ AssertionResultData( ResultWas::OfType _resultType, LazyExpression const& _lazyExpression );
+
+ std::string message;
+ mutable std::string reconstructedExpression;
+ LazyExpression lazyExpression;
+ ResultWas::OfType resultType;
+
+ std::string reconstructExpression() const;
+ };
+
+ class AssertionResult {
+ public:
+ AssertionResult() = delete;
+ AssertionResult( AssertionInfo const& info, AssertionResultData const& data );
+
+ bool isOk() const;
+ bool succeeded() const;
+ ResultWas::OfType getResultType() const;
+ bool hasExpression() const;
+ bool hasMessage() const;
+ std::string getExpression() const;
+ std::string getExpressionInMacro() const;
+ bool hasExpandedExpression() const;
+ std::string getExpandedExpression() const;
+ StringRef getMessage() const;
+ SourceLineInfo getSourceInfo() const;
+ StringRef getTestMacroName() const;
+
+ //protected:
+ AssertionInfo m_info;
+ AssertionResultData m_resultData;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_ASSERTION_RESULT_HPP_INCLUDED
+
+
+#ifndef CATCH_MESSAGE_INFO_HPP_INCLUDED
+#define CATCH_MESSAGE_INFO_HPP_INCLUDED
+
+
+
+#ifndef CATCH_INTERFACES_CAPTURE_HPP_INCLUDED
+#define CATCH_INTERFACES_CAPTURE_HPP_INCLUDED
+
+#include <string>
+#include <chrono>
+
+
+namespace Catch {
+
+ class AssertionResult;
+ struct AssertionInfo;
+ struct SectionInfo;
+ struct SectionEndInfo;
+ struct MessageInfo;
+ struct MessageBuilder;
+ struct Counts;
+ struct AssertionReaction;
+ struct SourceLineInfo;
+
+ class ITransientExpression;
+ class IGeneratorTracker;
+
+ struct BenchmarkInfo;
+ template <typename Duration = std::chrono::duration<double, std::nano>>
+ struct BenchmarkStats;
+
+ class IResultCapture {
+ public:
+ virtual ~IResultCapture();
+
+ virtual bool sectionStarted( SectionInfo const& sectionInfo,
+ Counts& assertions ) = 0;
+ virtual void sectionEnded( SectionEndInfo const& endInfo ) = 0;
+ virtual void sectionEndedEarly( SectionEndInfo const& endInfo ) = 0;
+
+ virtual auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& = 0;
+
+ virtual void benchmarkPreparing( StringRef name ) = 0;
+ virtual void benchmarkStarting( BenchmarkInfo const& info ) = 0;
+ virtual void benchmarkEnded( BenchmarkStats<> const& stats ) = 0;
+ virtual void benchmarkFailed( StringRef error ) = 0;
+
+ virtual void pushScopedMessage( MessageInfo const& message ) = 0;
+ virtual void popScopedMessage( MessageInfo const& message ) = 0;
+
+ virtual void emplaceUnscopedMessage( MessageBuilder const& builder ) = 0;
+
+ virtual void handleFatalErrorCondition( StringRef message ) = 0;
+
+ virtual void handleExpr
+ ( AssertionInfo const& info,
+ ITransientExpression const& expr,
+ AssertionReaction& reaction ) = 0;
+ virtual void handleMessage
+ ( AssertionInfo const& info,
+ ResultWas::OfType resultType,
+ StringRef message,
+ AssertionReaction& reaction ) = 0;
+ virtual void handleUnexpectedExceptionNotThrown
+ ( AssertionInfo const& info,
+ AssertionReaction& reaction ) = 0;
+ virtual void handleUnexpectedInflightException
+ ( AssertionInfo const& info,
+ std::string const& message,
+ AssertionReaction& reaction ) = 0;
+ virtual void handleIncomplete
+ ( AssertionInfo const& info ) = 0;
+ virtual void handleNonExpr
+ ( AssertionInfo const &info,
+ ResultWas::OfType resultType,
+ AssertionReaction &reaction ) = 0;
+
+
+
+ virtual bool lastAssertionPassed() = 0;
+ virtual void assertionPassed() = 0;
+
+ // Deprecated, do not use:
+ virtual std::string getCurrentTestName() const = 0;
+ virtual const AssertionResult* getLastResult() const = 0;
+ virtual void exceptionEarlyReported() = 0;
+ };
+
+ IResultCapture& getResultCapture();
+}
+
+#endif // CATCH_INTERFACES_CAPTURE_HPP_INCLUDED
+
+#include <string>
+
+namespace Catch {
+
+ struct MessageInfo {
+ MessageInfo( StringRef _macroName,
+ SourceLineInfo const& _lineInfo,
+ ResultWas::OfType _type );
+
+ StringRef macroName;
+ std::string message;
+ SourceLineInfo lineInfo;
+ ResultWas::OfType type;
+ unsigned int sequence;
+
+ bool operator == (MessageInfo const& other) const {
+ return sequence == other.sequence;
+ }
+ bool operator < (MessageInfo const& other) const {
+ return sequence < other.sequence;
+ }
+ private:
+ static unsigned int globalCount;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_MESSAGE_INFO_HPP_INCLUDED
+
+
+#ifndef CATCH_UNIQUE_PTR_HPP_INCLUDED
+#define CATCH_UNIQUE_PTR_HPP_INCLUDED
+
+#include <cassert>
+#include <type_traits>
+
+
+namespace Catch {
+namespace Detail {
+ /**
+ * A reimplementation of `std::unique_ptr` for improved compilation performance
+ *
+ * Does not support arrays nor custom deleters.
+ */
+ template <typename T>
+ class unique_ptr {
+ T* m_ptr;
+ public:
+ constexpr unique_ptr(std::nullptr_t = nullptr):
+ m_ptr{}
+ {}
+ explicit constexpr unique_ptr(T* ptr):
+ m_ptr(ptr)
+ {}
+
+ template <typename U, typename = std::enable_if_t<std::is_base_of<T, U>::value>>
+ unique_ptr(unique_ptr<U>&& from):
+ m_ptr(from.release())
+ {}
+
+ template <typename U, typename = std::enable_if_t<std::is_base_of<T, U>::value>>
+ unique_ptr& operator=(unique_ptr<U>&& from) {
+ reset(from.release());
+
+ return *this;
+ }
+
+ unique_ptr(unique_ptr const&) = delete;
+ unique_ptr& operator=(unique_ptr const&) = delete;
+
+ unique_ptr(unique_ptr&& rhs) noexcept:
+ m_ptr(rhs.m_ptr) {
+ rhs.m_ptr = nullptr;
+ }
+ unique_ptr& operator=(unique_ptr&& rhs) noexcept {
+ reset(rhs.release());
+
+ return *this;
+ }
+
+ ~unique_ptr() {
+ delete m_ptr;
+ }
+
+ T& operator*() {
+ assert(m_ptr);
+ return *m_ptr;
+ }
+ T const& operator*() const {
+ assert(m_ptr);
+ return *m_ptr;
+ }
+ T* operator->() noexcept {
+ assert(m_ptr);
+ return m_ptr;
+ }
+ T const* operator->() const noexcept {
+ assert(m_ptr);
+ return m_ptr;
+ }
+
+ T* get() { return m_ptr; }
+ T const* get() const { return m_ptr; }
+
+ void reset(T* ptr = nullptr) {
+ delete m_ptr;
+ m_ptr = ptr;
+ }
+
+ T* release() {
+ auto temp = m_ptr;
+ m_ptr = nullptr;
+ return temp;
+ }
+
+ explicit operator bool() const {
+ return m_ptr;
+ }
+
+ friend void swap(unique_ptr& lhs, unique_ptr& rhs) {
+ auto temp = lhs.m_ptr;
+ lhs.m_ptr = rhs.m_ptr;
+ rhs.m_ptr = temp;
+ }
+ };
+
+ //! Specialization to cause compile-time error for arrays
+ template <typename T>
+ class unique_ptr<T[]>;
+
+ template <typename T, typename... Args>
+ unique_ptr<T> make_unique(Args&&... args) {
+ return unique_ptr<T>(new T(CATCH_FORWARD(args)...));
+ }
+
+
+} // end namespace Detail
+} // end namespace Catch
+
+#endif // CATCH_UNIQUE_PTR_HPP_INCLUDED
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_ESTIMATE_HPP_INCLUDED
+#define CATCH_ESTIMATE_HPP_INCLUDED
+
+namespace Catch {
+ namespace Benchmark {
+ template <typename Duration>
+ struct Estimate {
+ Duration point;
+ Duration lower_bound;
+ Duration upper_bound;
+ double confidence_interval;
+
+ template <typename Duration2>
+ operator Estimate<Duration2>() const {
+ return { point, lower_bound, upper_bound, confidence_interval };
+ }
+ };
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_ESTIMATE_HPP_INCLUDED
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_OUTLIER_CLASSIFICATION_HPP_INCLUDED
+#define CATCH_OUTLIER_CLASSIFICATION_HPP_INCLUDED
+
+namespace Catch {
+ namespace Benchmark {
+ struct OutlierClassification {
+ int samples_seen = 0;
+ int low_severe = 0; // more than 3 times IQR below Q1
+ int low_mild = 0; // 1.5 to 3 times IQR below Q1
+ int high_mild = 0; // 1.5 to 3 times IQR above Q3
+ int high_severe = 0; // more than 3 times IQR above Q3
+
+ int total() const {
+ return low_severe + low_mild + high_mild + high_severe;
+ }
+ };
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_OUTLIERS_CLASSIFICATION_HPP_INCLUDED
+
+
+#include <map>
+#include <string>
+#include <vector>
+#include <iosfwd>
+
+namespace Catch {
+
+ struct ReporterDescription;
+ struct ListenerDescription;
+ struct TagInfo;
+ struct TestCaseInfo;
+ class TestCaseHandle;
+ class IConfig;
+ class IStream;
+ enum class ColourMode : std::uint8_t;
+
+ struct ReporterConfig {
+ ReporterConfig( IConfig const* _fullConfig,
+ Detail::unique_ptr<IStream> _stream,
+ ColourMode colourMode,
+ std::map<std::string, std::string> customOptions );
+
+ ReporterConfig( ReporterConfig&& ) = default;
+ ReporterConfig& operator=( ReporterConfig&& ) = default;
+ ~ReporterConfig(); // = default
+
+ Detail::unique_ptr<IStream> takeStream() &&;
+ IConfig const* fullConfig() const;
+ ColourMode colourMode() const;
+ std::map<std::string, std::string> const& customOptions() const;
+
+ private:
+ Detail::unique_ptr<IStream> m_stream;
+ IConfig const* m_fullConfig;
+ ColourMode m_colourMode;
+ std::map<std::string, std::string> m_customOptions;
+ };
+
+ struct TestRunInfo {
+ constexpr TestRunInfo(StringRef _name) : name(_name) {}
+ StringRef name;
+ };
+
+ struct AssertionStats {
+ AssertionStats( AssertionResult const& _assertionResult,
+ std::vector<MessageInfo> const& _infoMessages,
+ Totals const& _totals );
+
+ AssertionStats( AssertionStats const& ) = default;
+ AssertionStats( AssertionStats && ) = default;
+ AssertionStats& operator = ( AssertionStats const& ) = delete;
+ AssertionStats& operator = ( AssertionStats && ) = delete;
+
+ AssertionResult assertionResult;
+ std::vector<MessageInfo> infoMessages;
+ Totals totals;
+ };
+
+ struct SectionStats {
+ SectionStats( SectionInfo const& _sectionInfo,
+ Counts const& _assertions,
+ double _durationInSeconds,
+ bool _missingAssertions );
+
+ SectionInfo sectionInfo;
+ Counts assertions;
+ double durationInSeconds;
+ bool missingAssertions;
+ };
+
+ struct TestCaseStats {
+ TestCaseStats( TestCaseInfo const& _testInfo,
+ Totals const& _totals,
+ std::string const& _stdOut,
+ std::string const& _stdErr,
+ bool _aborting );
+
+ TestCaseInfo const * testInfo;
+ Totals totals;
+ std::string stdOut;
+ std::string stdErr;
+ bool aborting;
+ };
+
+ struct TestRunStats {
+ TestRunStats( TestRunInfo const& _runInfo,
+ Totals const& _totals,
+ bool _aborting );
+
+ TestRunInfo runInfo;
+ Totals totals;
+ bool aborting;
+ };
+
+
+ struct BenchmarkInfo {
+ std::string name;
+ double estimatedDuration;
+ int iterations;
+ unsigned int samples;
+ unsigned int resamples;
+ double clockResolution;
+ double clockCost;
+ };
+
+ template <class Duration>
+ struct BenchmarkStats {
+ BenchmarkInfo info;
+
+ std::vector<Duration> samples;
+ Benchmark::Estimate<Duration> mean;
+ Benchmark::Estimate<Duration> standardDeviation;
+ Benchmark::OutlierClassification outliers;
+ double outlierVariance;
+
+ template <typename Duration2>
+ operator BenchmarkStats<Duration2>() const {
+ std::vector<Duration2> samples2;
+ samples2.reserve(samples.size());
+ for (auto const& sample : samples) {
+ samples2.push_back(Duration2(sample));
+ }
+ return {
+ info,
+ CATCH_MOVE(samples2),
+ mean,
+ standardDeviation,
+ outliers,
+ outlierVariance,
+ };
+ }
+ };
+
+ //! By setting up its preferences, a reporter can modify Catch2's behaviour
+ //! in some regards, e.g. it can request Catch2 to capture writes to
+ //! stdout/stderr during test execution, and pass them to the reporter.
+ struct ReporterPreferences {
+ //! Catch2 should redirect writes to stdout and pass them to the
+ //! reporter
+ bool shouldRedirectStdOut = false;
+ //! Catch2 should call `Reporter::assertionEnded` even for passing
+ //! assertions
+ bool shouldReportAllAssertions = false;
+ };
+
+ /**
+ * The common base for all reporters and event listeners
+ *
+ * Implementing classes must also implement:
+ *
+ * //! User-friendly description of the reporter/listener type
+ * static std::string getDescription()
+ *
+ * Generally shouldn't be derived from by users of Catch2 directly,
+ * instead they should derive from one of the utility bases that
+ * derive from this class.
+ */
+ class IEventListener {
+ protected:
+ //! Derived classes can set up their preferences here
+ ReporterPreferences m_preferences;
+ //! The test run's config as filled in from CLI and defaults
+ IConfig const* m_config;
+
+ public:
+ IEventListener( IConfig const* config ): m_config( config ) {}
+
+ virtual ~IEventListener(); // = default;
+
+ // Implementing class must also provide the following static methods:
+ // static std::string getDescription();
+
+ ReporterPreferences const& getPreferences() const {
+ return m_preferences;
+ }
+
+ //! Called when no test cases match provided test spec
+ virtual void noMatchingTestCases( StringRef unmatchedSpec ) = 0;
+ //! Called for all invalid test specs from the cli
+ virtual void reportInvalidTestSpec( StringRef invalidArgument ) = 0;
+
+ /**
+ * Called once in a testing run before tests are started
+ *
+ * Not called if tests won't be run (e.g. only listing will happen)
+ */
+ virtual void testRunStarting( TestRunInfo const& testRunInfo ) = 0;
+
+ //! Called _once_ for each TEST_CASE, no matter how many times it is entered
+ virtual void testCaseStarting( TestCaseInfo const& testInfo ) = 0;
+ //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections)
+ virtual void testCasePartialStarting( TestCaseInfo const& testInfo, uint64_t partNumber ) = 0;
+ //! Called when a `SECTION` is being entered. Not called for skipped sections
+ virtual void sectionStarting( SectionInfo const& sectionInfo ) = 0;
+
+ //! Called when user-code is being probed before the actual benchmark runs
+ virtual void benchmarkPreparing( StringRef benchmarkName ) = 0;
+ //! Called after probe but before the user-code is being benchmarked
+ virtual void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) = 0;
+ //! Called with the benchmark results if benchmark successfully finishes
+ virtual void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) = 0;
+ //! Called if running the benchmarks fails for any reason
+ virtual void benchmarkFailed( StringRef benchmarkName ) = 0;
+
+ //! Called before assertion success/failure is evaluated
+ virtual void assertionStarting( AssertionInfo const& assertionInfo ) = 0;
+
+ //! Called after assertion was fully evaluated
+ virtual void assertionEnded( AssertionStats const& assertionStats ) = 0;
+
+ //! Called after a `SECTION` has finished running
+ virtual void sectionEnded( SectionStats const& sectionStats ) = 0;
+ //! Called _every time_ a TEST_CASE is entered, including repeats (due to sections)
+ virtual void testCasePartialEnded(TestCaseStats const& testCaseStats, uint64_t partNumber ) = 0;
+ //! Called _once_ for each TEST_CASE, no matter how many times it is entered
+ virtual void testCaseEnded( TestCaseStats const& testCaseStats ) = 0;
+ /**
+ * Called once after all tests in a testing run are finished
+ *
+ * Not called if tests weren't run (e.g. only listings happened)
+ */
+ virtual void testRunEnded( TestRunStats const& testRunStats ) = 0;
+
+ //! Called with test cases that are skipped due to the test run aborting
+ virtual void skipTest( TestCaseInfo const& testInfo ) = 0;
+
+ //! Called if a fatal error (signal/structured exception) occured
+ virtual void fatalErrorEncountered( StringRef error ) = 0;
+
+ //! Writes out information about provided reporters using reporter-specific format
+ virtual void listReporters(std::vector<ReporterDescription> const& descriptions) = 0;
+ //! Writes out the provided listeners descriptions using reporter-specific format
+ virtual void listListeners(std::vector<ListenerDescription> const& descriptions) = 0;
+ //! Writes out information about provided tests using reporter-specific format
+ virtual void listTests(std::vector<TestCaseHandle> const& tests) = 0;
+ //! Writes out information about the provided tags using reporter-specific format
+ virtual void listTags(std::vector<TagInfo> const& tags) = 0;
+ };
+ using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
+
+} // end namespace Catch
+
+#endif // CATCH_INTERFACES_REPORTER_HPP_INCLUDED
+
+
+#ifndef CATCH_UNIQUE_NAME_HPP_INCLUDED
+#define CATCH_UNIQUE_NAME_HPP_INCLUDED
+
+
+
+
+/** \file
+ * Wrapper for the CONFIG configuration option
+ *
+ * When generating internal unique names, there are two options. Either
+ * we mix in the current line number, or mix in an incrementing number.
+ * We prefer the latter, using `__COUNTER__`, but users might want to
+ * use the former.
+ */
+
+#ifndef CATCH_CONFIG_COUNTER_HPP_INCLUDED
+#define CATCH_CONFIG_COUNTER_HPP_INCLUDED
+
+#if ( !defined(__JETBRAINS_IDE__) || __JETBRAINS_IDE__ >= 20170300L )
+ #define CATCH_INTERNAL_CONFIG_COUNTER
+#endif
+
+#if defined( CATCH_INTERNAL_CONFIG_COUNTER ) && \
+ !defined( CATCH_CONFIG_NO_COUNTER ) && \
+ !defined( CATCH_CONFIG_COUNTER )
+# define CATCH_CONFIG_COUNTER
+#endif
+
+
+#endif // CATCH_CONFIG_COUNTER_HPP_INCLUDED
+#define INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line ) name##line
+#define INTERNAL_CATCH_UNIQUE_NAME_LINE( name, line ) INTERNAL_CATCH_UNIQUE_NAME_LINE2( name, line )
+#ifdef CATCH_CONFIG_COUNTER
+# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __COUNTER__ )
+#else
+# define INTERNAL_CATCH_UNIQUE_NAME( name ) INTERNAL_CATCH_UNIQUE_NAME_LINE( name, __LINE__ )
+#endif
+
+#endif // CATCH_UNIQUE_NAME_HPP_INCLUDED
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_CHRONOMETER_HPP_INCLUDED
+#define CATCH_CHRONOMETER_HPP_INCLUDED
+
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_CLOCK_HPP_INCLUDED
+#define CATCH_CLOCK_HPP_INCLUDED
+
+#include <chrono>
+#include <ratio>
+
+namespace Catch {
+ namespace Benchmark {
+ template <typename Clock>
+ using ClockDuration = typename Clock::duration;
+ template <typename Clock>
+ using FloatDuration = std::chrono::duration<double, typename Clock::period>;
+
+ template <typename Clock>
+ using TimePoint = typename Clock::time_point;
+
+ using default_clock = std::chrono::steady_clock;
+
+ template <typename Clock>
+ struct now {
+ TimePoint<Clock> operator()() const {
+ return Clock::now();
+ }
+ };
+
+ using fp_seconds = std::chrono::duration<double, std::ratio<1>>;
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_CLOCK_HPP_INCLUDED
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_OPTIMIZER_HPP_INCLUDED
+#define CATCH_OPTIMIZER_HPP_INCLUDED
+
+#if defined(_MSC_VER)
+# include <atomic> // atomic_thread_fence
+#endif
+
+
+#include <type_traits>
+
+namespace Catch {
+ namespace Benchmark {
+#if defined(__GNUC__) || defined(__clang__)
+ template <typename T>
+ inline void keep_memory(T* p) {
+ asm volatile("" : : "g"(p) : "memory");
+ }
+ inline void keep_memory() {
+ asm volatile("" : : : "memory");
+ }
+
+ namespace Detail {
+ inline void optimizer_barrier() { keep_memory(); }
+ } // namespace Detail
+#elif defined(_MSC_VER)
+
+#pragma optimize("", off)
+ template <typename T>
+ inline void keep_memory(T* p) {
+ // thanks @milleniumbug
+ *reinterpret_cast<char volatile*>(p) = *reinterpret_cast<char const volatile*>(p);
+ }
+ // TODO equivalent keep_memory()
+#pragma optimize("", on)
+
+ namespace Detail {
+ inline void optimizer_barrier() {
+ std::atomic_thread_fence(std::memory_order_seq_cst);
+ }
+ } // namespace Detail
+
+#endif
+
+ template <typename T>
+ inline void deoptimize_value(T&& x) {
+ keep_memory(&x);
+ }
+
+ template <typename Fn, typename... Args>
+ inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> std::enable_if_t<!std::is_same<void, decltype(fn(args...))>::value> {
+ deoptimize_value(CATCH_FORWARD(fn) (CATCH_FORWARD(args)...));
+ }
+
+ template <typename Fn, typename... Args>
+ inline auto invoke_deoptimized(Fn&& fn, Args&&... args) -> std::enable_if_t<std::is_same<void, decltype(fn(args...))>::value> {
+ CATCH_FORWARD(fn) (CATCH_FORWARD(args)...);
+ }
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_OPTIMIZER_HPP_INCLUDED
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_COMPLETE_INVOKE_HPP_INCLUDED
+#define CATCH_COMPLETE_INVOKE_HPP_INCLUDED
+
+
+
+#ifndef CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED
+#define CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED
+
+namespace Catch {
+
+ //! Used to signal that an assertion macro failed
+ struct TestFailureException{};
+
+} // namespace Catch
+
+#endif // CATCH_TEST_FAILURE_EXCEPTION_HPP_INCLUDED
+
+
+#ifndef CATCH_META_HPP_INCLUDED
+#define CATCH_META_HPP_INCLUDED
+
+#include <type_traits>
+
+namespace Catch {
+ template<typename T>
+ struct always_false : std::false_type {};
+
+ template <typename> struct true_given : std::true_type {};
+ struct is_callable_tester {
+ template <typename Fun, typename... Args>
+ true_given<decltype(std::declval<Fun>()(std::declval<Args>()...))> static test(int);
+ template <typename...>
+ std::false_type static test(...);
+ };
+
+ template <typename T>
+ struct is_callable;
+
+ template <typename Fun, typename... Args>
+ struct is_callable<Fun(Args...)> : decltype(is_callable_tester::test<Fun, Args...>(0)) {};
+
+
+#if defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703
+ // std::result_of is deprecated in C++17 and removed in C++20. Hence, it is
+ // replaced with std::invoke_result here.
+ template <typename Func, typename... U>
+ using FunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::invoke_result_t<Func, U...>>>;
+#else
+ template <typename Func, typename... U>
+ using FunctionReturnType = std::remove_reference_t<std::remove_cv_t<std::result_of_t<Func(U...)>>>;
+#endif
+
+} // namespace Catch
+
+namespace mpl_{
+ struct na;
+}
+
+#endif // CATCH_META_HPP_INCLUDED
+
+
+#ifndef CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED
+#define CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED
+
+
+#include <string>
+
+namespace Catch {
+
+ class TestCaseHandle;
+ struct TestCaseInfo;
+ class ITestCaseRegistry;
+ class IExceptionTranslatorRegistry;
+ class IExceptionTranslator;
+ class IReporterRegistry;
+ class IReporterFactory;
+ class ITagAliasRegistry;
+ class ITestInvoker;
+ class IMutableEnumValuesRegistry;
+ struct SourceLineInfo;
+
+ class StartupExceptionRegistry;
+ class EventListenerFactory;
+
+ using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
+
+ class IRegistryHub {
+ public:
+ virtual ~IRegistryHub(); // = default
+
+ virtual IReporterRegistry const& getReporterRegistry() const = 0;
+ virtual ITestCaseRegistry const& getTestCaseRegistry() const = 0;
+ virtual ITagAliasRegistry const& getTagAliasRegistry() const = 0;
+ virtual IExceptionTranslatorRegistry const& getExceptionTranslatorRegistry() const = 0;
+
+
+ virtual StartupExceptionRegistry const& getStartupExceptionRegistry() const = 0;
+ };
+
+ class IMutableRegistryHub {
+ public:
+ virtual ~IMutableRegistryHub(); // = default
+ virtual void registerReporter( std::string const& name, IReporterFactoryPtr factory ) = 0;
+ virtual void registerListener( Detail::unique_ptr<EventListenerFactory> factory ) = 0;
+ virtual void registerTest(Detail::unique_ptr<TestCaseInfo>&& testInfo, Detail::unique_ptr<ITestInvoker>&& invoker) = 0;
+ virtual void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator ) = 0;
+ virtual void registerTagAlias( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo ) = 0;
+ virtual void registerStartupException() noexcept = 0;
+ virtual IMutableEnumValuesRegistry& getMutableEnumValuesRegistry() = 0;
+ };
+
+ IRegistryHub const& getRegistryHub();
+ IMutableRegistryHub& getMutableRegistryHub();
+ void cleanUp();
+ std::string translateActiveException();
+
+}
+
+#endif // CATCH_INTERFACES_REGISTRY_HUB_HPP_INCLUDED
+
+#include <type_traits>
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+ template <typename T>
+ struct CompleteType { using type = T; };
+ template <>
+ struct CompleteType<void> { struct type {}; };
+
+ template <typename T>
+ using CompleteType_t = typename CompleteType<T>::type;
+
+ template <typename Result>
+ struct CompleteInvoker {
+ template <typename Fun, typename... Args>
+ static Result invoke(Fun&& fun, Args&&... args) {
+ return CATCH_FORWARD(fun)(CATCH_FORWARD(args)...);
+ }
+ };
+ template <>
+ struct CompleteInvoker<void> {
+ template <typename Fun, typename... Args>
+ static CompleteType_t<void> invoke(Fun&& fun, Args&&... args) {
+ CATCH_FORWARD(fun)(CATCH_FORWARD(args)...);
+ return {};
+ }
+ };
+
+ // invoke and not return void :(
+ template <typename Fun, typename... Args>
+ CompleteType_t<FunctionReturnType<Fun, Args...>> complete_invoke(Fun&& fun, Args&&... args) {
+ return CompleteInvoker<FunctionReturnType<Fun, Args...>>::invoke(CATCH_FORWARD(fun), CATCH_FORWARD(args)...);
+ }
+
+ } // namespace Detail
+
+ template <typename Fun>
+ Detail::CompleteType_t<FunctionReturnType<Fun>> user_code(Fun&& fun) {
+ return Detail::complete_invoke(CATCH_FORWARD(fun));
+ }
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_COMPLETE_INVOKE_HPP_INCLUDED
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+ struct ChronometerConcept {
+ virtual void start() = 0;
+ virtual void finish() = 0;
+ virtual ~ChronometerConcept(); // = default;
+
+ ChronometerConcept() = default;
+ ChronometerConcept(ChronometerConcept const&) = default;
+ ChronometerConcept& operator=(ChronometerConcept const&) = default;
+ };
+ template <typename Clock>
+ struct ChronometerModel final : public ChronometerConcept {
+ void start() override { started = Clock::now(); }
+ void finish() override { finished = Clock::now(); }
+
+ ClockDuration<Clock> elapsed() const { return finished - started; }
+
+ TimePoint<Clock> started;
+ TimePoint<Clock> finished;
+ };
+ } // namespace Detail
+
+ struct Chronometer {
+ public:
+ template <typename Fun>
+ void measure(Fun&& fun) { measure(CATCH_FORWARD(fun), is_callable<Fun(int)>()); }
+
+ int runs() const { return repeats; }
+
+ Chronometer(Detail::ChronometerConcept& meter, int repeats_)
+ : impl(&meter)
+ , repeats(repeats_) {}
+
+ private:
+ template <typename Fun>
+ void measure(Fun&& fun, std::false_type) {
+ measure([&fun](int) { return fun(); }, std::true_type());
+ }
+
+ template <typename Fun>
+ void measure(Fun&& fun, std::true_type) {
+ Detail::optimizer_barrier();
+ impl->start();
+ for (int i = 0; i < repeats; ++i) invoke_deoptimized(fun, i);
+ impl->finish();
+ Detail::optimizer_barrier();
+ }
+
+ Detail::ChronometerConcept* impl;
+ int repeats;
+ };
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_CHRONOMETER_HPP_INCLUDED
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_ENVIRONMENT_HPP_INCLUDED
+#define CATCH_ENVIRONMENT_HPP_INCLUDED
+
+
+namespace Catch {
+ namespace Benchmark {
+ template <typename Duration>
+ struct EnvironmentEstimate {
+ Duration mean;
+ OutlierClassification outliers;
+
+ template <typename Duration2>
+ operator EnvironmentEstimate<Duration2>() const {
+ return { mean, outliers };
+ }
+ };
+ template <typename Clock>
+ struct Environment {
+ using clock_type = Clock;
+ EnvironmentEstimate<FloatDuration<Clock>> clock_resolution;
+ EnvironmentEstimate<FloatDuration<Clock>> clock_cost;
+ };
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_ENVIRONMENT_HPP_INCLUDED
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_EXECUTION_PLAN_HPP_INCLUDED
+#define CATCH_EXECUTION_PLAN_HPP_INCLUDED
+
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_BENCHMARK_FUNCTION_HPP_INCLUDED
+#define CATCH_BENCHMARK_FUNCTION_HPP_INCLUDED
+
+
+#include <type_traits>
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+ template <typename T, typename U>
+ struct is_related
+ : std::is_same<std::decay_t<T>, std::decay_t<U>> {};
+
+ /// We need to reinvent std::function because every piece of code that might add overhead
+ /// in a measurement context needs to have consistent performance characteristics so that we
+ /// can account for it in the measurement.
+ /// Implementations of std::function with optimizations that aren't always applicable, like
+ /// small buffer optimizations, are not uncommon.
+ /// This is effectively an implementation of std::function without any such optimizations;
+ /// it may be slow, but it is consistently slow.
+ struct BenchmarkFunction {
+ private:
+ struct callable {
+ virtual void call(Chronometer meter) const = 0;
+ virtual Catch::Detail::unique_ptr<callable> clone() const = 0;
+ virtual ~callable(); // = default;
+
+ callable() = default;
+ callable(callable const&) = default;
+ callable& operator=(callable const&) = default;
+ };
+ template <typename Fun>
+ struct model : public callable {
+ model(Fun&& fun_) : fun(CATCH_MOVE(fun_)) {}
+ model(Fun const& fun_) : fun(fun_) {}
+
+ Catch::Detail::unique_ptr<callable> clone() const override {
+ return Catch::Detail::make_unique<model<Fun>>( *this );
+ }
+
+ void call(Chronometer meter) const override {
+ call(meter, is_callable<Fun(Chronometer)>());
+ }
+ void call(Chronometer meter, std::true_type) const {
+ fun(meter);
+ }
+ void call(Chronometer meter, std::false_type) const {
+ meter.measure(fun);
+ }
+
+ Fun fun;
+ };
+
+ struct do_nothing { void operator()() const {} };
+
+ template <typename T>
+ BenchmarkFunction(model<T>* c) : f(c) {}
+
+ public:
+ BenchmarkFunction()
+ : f(new model<do_nothing>{ {} }) {}
+
+ template <typename Fun,
+ std::enable_if_t<!is_related<Fun, BenchmarkFunction>::value, int> = 0>
+ BenchmarkFunction(Fun&& fun)
+ : f(new model<std::decay_t<Fun>>(CATCH_FORWARD(fun))) {}
+
+ BenchmarkFunction( BenchmarkFunction&& that ) noexcept:
+ f( CATCH_MOVE( that.f ) ) {}
+
+ BenchmarkFunction(BenchmarkFunction const& that)
+ : f(that.f->clone()) {}
+
+ BenchmarkFunction&
+ operator=( BenchmarkFunction&& that ) noexcept {
+ f = CATCH_MOVE( that.f );
+ return *this;
+ }
+
+ BenchmarkFunction& operator=(BenchmarkFunction const& that) {
+ f = that.f->clone();
+ return *this;
+ }
+
+ void operator()(Chronometer meter) const { f->call(meter); }
+
+ private:
+ Catch::Detail::unique_ptr<callable> f;
+ };
+ } // namespace Detail
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_BENCHMARK_FUNCTION_HPP_INCLUDED
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_REPEAT_HPP_INCLUDED
+#define CATCH_REPEAT_HPP_INCLUDED
+
+#include <type_traits>
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+ template <typename Fun>
+ struct repeater {
+ void operator()(int k) const {
+ for (int i = 0; i < k; ++i) {
+ fun();
+ }
+ }
+ Fun fun;
+ };
+ template <typename Fun>
+ repeater<std::decay_t<Fun>> repeat(Fun&& fun) {
+ return { CATCH_FORWARD(fun) };
+ }
+ } // namespace Detail
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_REPEAT_HPP_INCLUDED
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED
+#define CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED
+
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_MEASURE_HPP_INCLUDED
+#define CATCH_MEASURE_HPP_INCLUDED
+
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_TIMING_HPP_INCLUDED
+#define CATCH_TIMING_HPP_INCLUDED
+
+
+#include <type_traits>
+
+namespace Catch {
+ namespace Benchmark {
+ template <typename Duration, typename Result>
+ struct Timing {
+ Duration elapsed;
+ Result result;
+ int iterations;
+ };
+ template <typename Clock, typename Func, typename... Args>
+ using TimingOf = Timing<ClockDuration<Clock>, Detail::CompleteType_t<FunctionReturnType<Func, Args...>>>;
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_TIMING_HPP_INCLUDED
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+ template <typename Clock, typename Fun, typename... Args>
+ TimingOf<Clock, Fun, Args...> measure(Fun&& fun, Args&&... args) {
+ auto start = Clock::now();
+ auto&& r = Detail::complete_invoke(fun, CATCH_FORWARD(args)...);
+ auto end = Clock::now();
+ auto delta = end - start;
+ return { delta, CATCH_FORWARD(r), 1 };
+ }
+ } // namespace Detail
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_MEASURE_HPP_INCLUDED
+
+#include <type_traits>
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+ template <typename Clock, typename Fun>
+ TimingOf<Clock, Fun, int> measure_one(Fun&& fun, int iters, std::false_type) {
+ return Detail::measure<Clock>(fun, iters);
+ }
+ template <typename Clock, typename Fun>
+ TimingOf<Clock, Fun, Chronometer> measure_one(Fun&& fun, int iters, std::true_type) {
+ Detail::ChronometerModel<Clock> meter;
+ auto&& result = Detail::complete_invoke(fun, Chronometer(meter, iters));
+
+ return { meter.elapsed(), CATCH_MOVE(result), iters };
+ }
+
+ template <typename Clock, typename Fun>
+ using run_for_at_least_argument_t = std::conditional_t<is_callable<Fun(Chronometer)>::value, Chronometer, int>;
+
+
+ [[noreturn]]
+ void throw_optimized_away_error();
+
+ template <typename Clock, typename Fun>
+ TimingOf<Clock, Fun, run_for_at_least_argument_t<Clock, Fun>>
+ run_for_at_least(ClockDuration<Clock> how_long,
+ const int initial_iterations,
+ Fun&& fun) {
+ auto iters = initial_iterations;
+ while (iters < (1 << 30)) {
+ auto&& Timing = measure_one<Clock>(fun, iters, is_callable<Fun(Chronometer)>());
+
+ if (Timing.elapsed >= how_long) {
+ return { Timing.elapsed, CATCH_MOVE(Timing.result), iters };
+ }
+ iters *= 2;
+ }
+ throw_optimized_away_error();
+ }
+ } // namespace Detail
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_RUN_FOR_AT_LEAST_HPP_INCLUDED
+
+#include <algorithm>
+#include <iterator>
+
+namespace Catch {
+ namespace Benchmark {
+ template <typename Duration>
+ struct ExecutionPlan {
+ int iterations_per_sample;
+ Duration estimated_duration;
+ Detail::BenchmarkFunction benchmark;
+ Duration warmup_time;
+ int warmup_iterations;
+
+ template <typename Duration2>
+ operator ExecutionPlan<Duration2>() const {
+ return { iterations_per_sample, estimated_duration, benchmark, warmup_time, warmup_iterations };
+ }
+
+ template <typename Clock>
+ std::vector<FloatDuration<Clock>> run(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const {
+ // warmup a bit
+ Detail::run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(warmup_time), warmup_iterations, Detail::repeat(now<Clock>{}));
+
+ std::vector<FloatDuration<Clock>> times;
+ times.reserve(cfg.benchmarkSamples());
+ std::generate_n(std::back_inserter(times), cfg.benchmarkSamples(), [this, env] {
+ Detail::ChronometerModel<Clock> model;
+ this->benchmark(Chronometer(model, iterations_per_sample));
+ auto sample_time = model.elapsed() - env.clock_cost.mean;
+ if (sample_time < FloatDuration<Clock>::zero()) sample_time = FloatDuration<Clock>::zero();
+ return sample_time / iterations_per_sample;
+ });
+ return times;
+ }
+ };
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_EXECUTION_PLAN_HPP_INCLUDED
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_ESTIMATE_CLOCK_HPP_INCLUDED
+#define CATCH_ESTIMATE_CLOCK_HPP_INCLUDED
+
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_STATS_HPP_INCLUDED
+#define CATCH_STATS_HPP_INCLUDED
+
+
+#include <algorithm>
+#include <vector>
+#include <numeric>
+#include <tuple>
+#include <cmath>
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+ using sample = std::vector<double>;
+
+ // Used when we know we want == comparison of two doubles
+ // to centralize warning suppression
+ bool directCompare( double lhs, double rhs );
+
+ double weighted_average_quantile(int k, int q, std::vector<double>::iterator first, std::vector<double>::iterator last);
+
+ template <typename Iterator>
+ OutlierClassification classify_outliers(Iterator first, Iterator last) {
+ std::vector<double> copy(first, last);
+
+ auto q1 = weighted_average_quantile(1, 4, copy.begin(), copy.end());
+ auto q3 = weighted_average_quantile(3, 4, copy.begin(), copy.end());
+ auto iqr = q3 - q1;
+ auto los = q1 - (iqr * 3.);
+ auto lom = q1 - (iqr * 1.5);
+ auto him = q3 + (iqr * 1.5);
+ auto his = q3 + (iqr * 3.);
+
+ OutlierClassification o;
+ for (; first != last; ++first) {
+ auto&& t = *first;
+ if (t < los) ++o.low_severe;
+ else if (t < lom) ++o.low_mild;
+ else if (t > his) ++o.high_severe;
+ else if (t > him) ++o.high_mild;
+ ++o.samples_seen;
+ }
+ return o;
+ }
+
+ template <typename Iterator>
+ double mean(Iterator first, Iterator last) {
+ auto count = last - first;
+ double sum = std::accumulate(first, last, 0.);
+ return sum / static_cast<double>(count);
+ }
+
+ template <typename Estimator, typename Iterator>
+ sample jackknife(Estimator&& estimator, Iterator first, Iterator last) {
+ auto n = static_cast<size_t>(last - first);
+ auto second = first;
+ ++second;
+ sample results;
+ results.reserve(n);
+
+ for (auto it = first; it != last; ++it) {
+ std::iter_swap(it, first);
+ results.push_back(estimator(second, last));
+ }
+
+ return results;
+ }
+
+ inline double normal_cdf(double x) {
+ return std::erfc(-x / std::sqrt(2.0)) / 2.0;
+ }
+
+ double erfc_inv(double x);
+
+ double normal_quantile(double p);
+
+ template <typename Iterator, typename Estimator>
+ Estimate<double> bootstrap(double confidence_level, Iterator first, Iterator last, sample const& resample, Estimator&& estimator) {
+ auto n_samples = last - first;
+
+ double point = estimator(first, last);
+ // Degenerate case with a single sample
+ if (n_samples == 1) return { point, point, point, confidence_level };
+
+ sample jack = jackknife(estimator, first, last);
+ double jack_mean = mean(jack.begin(), jack.end());
+ double sum_squares, sum_cubes;
+ std::tie(sum_squares, sum_cubes) = std::accumulate(jack.begin(), jack.end(), std::make_pair(0., 0.), [jack_mean](std::pair<double, double> sqcb, double x) -> std::pair<double, double> {
+ auto d = jack_mean - x;
+ auto d2 = d * d;
+ auto d3 = d2 * d;
+ return { sqcb.first + d2, sqcb.second + d3 };
+ });
+
+ double accel = sum_cubes / (6 * std::pow(sum_squares, 1.5));
+ long n = static_cast<long>(resample.size());
+ double prob_n = std::count_if(resample.begin(), resample.end(), [point](double x) { return x < point; }) / static_cast<double>(n);
+ // degenerate case with uniform samples
+ if ( directCompare( prob_n, 0. ) ) {
+ return { point, point, point, confidence_level };
+ }
+
+ double bias = normal_quantile(prob_n);
+ double z1 = normal_quantile((1. - confidence_level) / 2.);
+
+ auto cumn = [n]( double x ) -> long {
+ return std::lround( normal_cdf( x ) * static_cast<double>(n) );
+ };
+ auto a = [bias, accel](double b) { return bias + b / (1. - accel * b); };
+ double b1 = bias + z1;
+ double b2 = bias - z1;
+ double a1 = a(b1);
+ double a2 = a(b2);
+ auto lo = static_cast<size_t>((std::max)(cumn(a1), 0l));
+ auto hi = static_cast<size_t>((std::min)(cumn(a2), n - 1));
+
+ return { point, resample[lo], resample[hi], confidence_level };
+ }
+
+ double outlier_variance(Estimate<double> mean, Estimate<double> stddev, int n);
+
+ struct bootstrap_analysis {
+ Estimate<double> mean;
+ Estimate<double> standard_deviation;
+ double outlier_variance;
+ };
+
+ bootstrap_analysis analyse_samples(double confidence_level, unsigned int n_resamples, std::vector<double>::iterator first, std::vector<double>::iterator last);
+ } // namespace Detail
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_STATS_HPP_INCLUDED
+
+#include <algorithm>
+#include <iterator>
+#include <vector>
+#include <cmath>
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+ template <typename Clock>
+ std::vector<double> resolution(int k) {
+ std::vector<TimePoint<Clock>> times;
+ times.reserve(static_cast<size_t>(k + 1));
+ std::generate_n(std::back_inserter(times), k + 1, now<Clock>{});
+
+ std::vector<double> deltas;
+ deltas.reserve(static_cast<size_t>(k));
+ std::transform(std::next(times.begin()), times.end(), times.begin(),
+ std::back_inserter(deltas),
+ [](TimePoint<Clock> a, TimePoint<Clock> b) { return static_cast<double>((a - b).count()); });
+
+ return deltas;
+ }
+
+ const auto warmup_iterations = 10000;
+ const auto warmup_time = std::chrono::milliseconds(100);
+ const auto minimum_ticks = 1000;
+ const auto warmup_seed = 10000;
+ const auto clock_resolution_estimation_time = std::chrono::milliseconds(500);
+ const auto clock_cost_estimation_time_limit = std::chrono::seconds(1);
+ const auto clock_cost_estimation_tick_limit = 100000;
+ const auto clock_cost_estimation_time = std::chrono::milliseconds(10);
+ const auto clock_cost_estimation_iterations = 10000;
+
+ template <typename Clock>
+ int warmup() {
+ return run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(warmup_time), warmup_seed, &resolution<Clock>)
+ .iterations;
+ }
+ template <typename Clock>
+ EnvironmentEstimate<FloatDuration<Clock>> estimate_clock_resolution(int iterations) {
+ auto r = run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(clock_resolution_estimation_time), iterations, &resolution<Clock>)
+ .result;
+ return {
+ FloatDuration<Clock>(mean(r.begin(), r.end())),
+ classify_outliers(r.begin(), r.end()),
+ };
+ }
+ template <typename Clock>
+ EnvironmentEstimate<FloatDuration<Clock>> estimate_clock_cost(FloatDuration<Clock> resolution) {
+ auto time_limit = (std::min)(
+ resolution * clock_cost_estimation_tick_limit,
+ FloatDuration<Clock>(clock_cost_estimation_time_limit));
+ auto time_clock = [](int k) {
+ return Detail::measure<Clock>([k] {
+ for (int i = 0; i < k; ++i) {
+ volatile auto ignored = Clock::now();
+ (void)ignored;
+ }
+ }).elapsed;
+ };
+ time_clock(1);
+ int iters = clock_cost_estimation_iterations;
+ auto&& r = run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(clock_cost_estimation_time), iters, time_clock);
+ std::vector<double> times;
+ int nsamples = static_cast<int>(std::ceil(time_limit / r.elapsed));
+ times.reserve(static_cast<size_t>(nsamples));
+ std::generate_n(std::back_inserter(times), nsamples, [time_clock, &r] {
+ return static_cast<double>((time_clock(r.iterations) / r.iterations).count());
+ });
+ return {
+ FloatDuration<Clock>(mean(times.begin(), times.end())),
+ classify_outliers(times.begin(), times.end()),
+ };
+ }
+
+ template <typename Clock>
+ Environment<FloatDuration<Clock>> measure_environment() {
+#if defined(__clang__)
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wexit-time-destructors"
+#endif
+ static Catch::Detail::unique_ptr<Environment<FloatDuration<Clock>>> env;
+#if defined(__clang__)
+# pragma clang diagnostic pop
+#endif
+ if (env) {
+ return *env;
+ }
+
+ auto iters = Detail::warmup<Clock>();
+ auto resolution = Detail::estimate_clock_resolution<Clock>(iters);
+ auto cost = Detail::estimate_clock_cost<Clock>(resolution.mean);
+
+ env = Catch::Detail::make_unique<Environment<FloatDuration<Clock>>>( Environment<FloatDuration<Clock>>{resolution, cost} );
+ return *env;
+ }
+ } // namespace Detail
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_ESTIMATE_CLOCK_HPP_INCLUDED
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_ANALYSE_HPP_INCLUDED
+#define CATCH_ANALYSE_HPP_INCLUDED
+
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_SAMPLE_ANALYSIS_HPP_INCLUDED
+#define CATCH_SAMPLE_ANALYSIS_HPP_INCLUDED
+
+
+#include <algorithm>
+#include <vector>
+#include <iterator>
+
+namespace Catch {
+ namespace Benchmark {
+ template <typename Duration>
+ struct SampleAnalysis {
+ std::vector<Duration> samples;
+ Estimate<Duration> mean;
+ Estimate<Duration> standard_deviation;
+ OutlierClassification outliers;
+ double outlier_variance;
+
+ template <typename Duration2>
+ operator SampleAnalysis<Duration2>() const {
+ std::vector<Duration2> samples2;
+ samples2.reserve(samples.size());
+ std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](Duration d) { return Duration2(d); });
+ return {
+ CATCH_MOVE(samples2),
+ mean,
+ standard_deviation,
+ outliers,
+ outlier_variance,
+ };
+ }
+ };
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_SAMPLE_ANALYSIS_HPP_INCLUDED
+
+#include <algorithm>
+#include <iterator>
+#include <vector>
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+ template <typename Duration, typename Iterator>
+ SampleAnalysis<Duration> analyse(const IConfig &cfg, Environment<Duration>, Iterator first, Iterator last) {
+ if (!cfg.benchmarkNoAnalysis()) {
+ std::vector<double> samples;
+ samples.reserve(static_cast<size_t>(last - first));
+ std::transform(first, last, std::back_inserter(samples), [](Duration d) { return d.count(); });
+
+ auto analysis = Catch::Benchmark::Detail::analyse_samples(cfg.benchmarkConfidenceInterval(), cfg.benchmarkResamples(), samples.begin(), samples.end());
+ auto outliers = Catch::Benchmark::Detail::classify_outliers(samples.begin(), samples.end());
+
+ auto wrap_estimate = [](Estimate<double> e) {
+ return Estimate<Duration> {
+ Duration(e.point),
+ Duration(e.lower_bound),
+ Duration(e.upper_bound),
+ e.confidence_interval,
+ };
+ };
+ std::vector<Duration> samples2;
+ samples2.reserve(samples.size());
+ std::transform(samples.begin(), samples.end(), std::back_inserter(samples2), [](double d) { return Duration(d); });
+ return {
+ CATCH_MOVE(samples2),
+ wrap_estimate(analysis.mean),
+ wrap_estimate(analysis.standard_deviation),
+ outliers,
+ analysis.outlier_variance,
+ };
+ } else {
+ std::vector<Duration> samples;
+ samples.reserve(static_cast<size_t>(last - first));
+
+ Duration mean = Duration(0);
+ int i = 0;
+ for (auto it = first; it < last; ++it, ++i) {
+ samples.push_back(Duration(*it));
+ mean += Duration(*it);
+ }
+ mean /= i;
+
+ return {
+ CATCH_MOVE(samples),
+ Estimate<Duration>{mean, mean, mean, 0.0},
+ Estimate<Duration>{Duration(0), Duration(0), Duration(0), 0.0},
+ OutlierClassification{},
+ 0.0
+ };
+ }
+ }
+ } // namespace Detail
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_ANALYSE_HPP_INCLUDED
+
+#include <algorithm>
+#include <functional>
+#include <string>
+#include <vector>
+#include <cmath>
+
+namespace Catch {
+ namespace Benchmark {
+ struct Benchmark {
+ Benchmark(std::string&& benchmarkName)
+ : name(CATCH_MOVE(benchmarkName)) {}
+
+ template <class FUN>
+ Benchmark(std::string&& benchmarkName , FUN &&func)
+ : fun(CATCH_MOVE(func)), name(CATCH_MOVE(benchmarkName)) {}
+
+ template <typename Clock>
+ ExecutionPlan<FloatDuration<Clock>> prepare(const IConfig &cfg, Environment<FloatDuration<Clock>> env) const {
+ auto min_time = env.clock_resolution.mean * Detail::minimum_ticks;
+ auto run_time = std::max(min_time, std::chrono::duration_cast<decltype(min_time)>(cfg.benchmarkWarmupTime()));
+ auto&& test = Detail::run_for_at_least<Clock>(std::chrono::duration_cast<ClockDuration<Clock>>(run_time), 1, fun);
+ int new_iters = static_cast<int>(std::ceil(min_time * test.iterations / test.elapsed));
+ return { new_iters, test.elapsed / test.iterations * new_iters * cfg.benchmarkSamples(), fun, std::chrono::duration_cast<FloatDuration<Clock>>(cfg.benchmarkWarmupTime()), Detail::warmup_iterations };
+ }
+
+ template <typename Clock = default_clock>
+ void run() {
+ auto const* cfg = getCurrentContext().getConfig();
+
+ auto env = Detail::measure_environment<Clock>();
+
+ getResultCapture().benchmarkPreparing(name);
+ CATCH_TRY{
+ auto plan = user_code([&] {
+ return prepare<Clock>(*cfg, env);
+ });
+
+ BenchmarkInfo info {
+ name,
+ plan.estimated_duration.count(),
+ plan.iterations_per_sample,
+ cfg->benchmarkSamples(),
+ cfg->benchmarkResamples(),
+ env.clock_resolution.mean.count(),
+ env.clock_cost.mean.count()
+ };
+
+ getResultCapture().benchmarkStarting(info);
+
+ auto samples = user_code([&] {
+ return plan.template run<Clock>(*cfg, env);
+ });
+
+ auto analysis = Detail::analyse(*cfg, env, samples.begin(), samples.end());
+ BenchmarkStats<FloatDuration<Clock>> stats{ info, analysis.samples, analysis.mean, analysis.standard_deviation, analysis.outliers, analysis.outlier_variance };
+ getResultCapture().benchmarkEnded(stats);
+ } CATCH_CATCH_ANON (TestFailureException) {
+ getResultCapture().benchmarkFailed("Benchmark failed due to failed assertion"_sr);
+ } CATCH_CATCH_ALL{
+ getResultCapture().benchmarkFailed(translateActiveException());
+ // We let the exception go further up so that the
+ // test case is marked as failed.
+ std::rethrow_exception(std::current_exception());
+ }
+ }
+
+ // sets lambda to be used in fun *and* executes benchmark!
+ template <typename Fun, std::enable_if_t<!Detail::is_related<Fun, Benchmark>::value, int> = 0>
+ Benchmark & operator=(Fun func) {
+ auto const* cfg = getCurrentContext().getConfig();
+ if (!cfg->skipBenchmarks()) {
+ fun = Detail::BenchmarkFunction(func);
+ run();
+ }
+ return *this;
+ }
+
+ explicit operator bool() {
+ return true;
+ }
+
+ private:
+ Detail::BenchmarkFunction fun;
+ std::string name;
+ };
+ }
+} // namespace Catch
+
+#define INTERNAL_CATCH_GET_1_ARG(arg1, arg2, ...) arg1
+#define INTERNAL_CATCH_GET_2_ARG(arg1, arg2, ...) arg2
+
+#define INTERNAL_CATCH_BENCHMARK(BenchmarkName, name, benchmarkIndex)\
+ if( Catch::Benchmark::Benchmark BenchmarkName{name} ) \
+ BenchmarkName = [&](int benchmarkIndex)
+
+#define INTERNAL_CATCH_BENCHMARK_ADVANCED(BenchmarkName, name)\
+ if( Catch::Benchmark::Benchmark BenchmarkName{name} ) \
+ BenchmarkName = [&]
+
+#if defined(CATCH_CONFIG_PREFIX_ALL)
+
+#define CATCH_BENCHMARK(...) \
+ INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,))
+#define CATCH_BENCHMARK_ADVANCED(name) \
+ INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), name)
+
+#else
+
+#define BENCHMARK(...) \
+ INTERNAL_CATCH_BENCHMARK(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), INTERNAL_CATCH_GET_1_ARG(__VA_ARGS__,,), INTERNAL_CATCH_GET_2_ARG(__VA_ARGS__,,))
+#define BENCHMARK_ADVANCED(name) \
+ INTERNAL_CATCH_BENCHMARK_ADVANCED(INTERNAL_CATCH_UNIQUE_NAME(CATCH2_INTERNAL_BENCHMARK_), name)
+
+#endif
+
+#endif // CATCH_BENCHMARK_HPP_INCLUDED
+
+
+// Adapted from donated nonius code.
+
+#ifndef CATCH_CONSTRUCTOR_HPP_INCLUDED
+#define CATCH_CONSTRUCTOR_HPP_INCLUDED
+
+
+#include <type_traits>
+
+namespace Catch {
+ namespace Benchmark {
+ namespace Detail {
+ template <typename T, bool Destruct>
+ struct ObjectStorage
+ {
+ ObjectStorage() = default;
+
+ ObjectStorage(const ObjectStorage& other)
+ {
+ new(&data) T(other.stored_object());
+ }
+
+ ObjectStorage(ObjectStorage&& other)
+ {
+ new(data) T(CATCH_MOVE(other.stored_object()));
+ }
+
+ ~ObjectStorage() { destruct_on_exit<T>(); }
+
+ template <typename... Args>
+ void construct(Args&&... args)
+ {
+ new (data) T(CATCH_FORWARD(args)...);
+ }
+
+ template <bool AllowManualDestruction = !Destruct>
+ std::enable_if_t<AllowManualDestruction> destruct()
+ {
+ stored_object().~T();
+ }
+
+ private:
+ // If this is a constructor benchmark, destruct the underlying object
+ template <typename U>
+ void destruct_on_exit(std::enable_if_t<Destruct, U>* = nullptr) { destruct<true>(); }
+ // Otherwise, don't
+ template <typename U>
+ void destruct_on_exit(std::enable_if_t<!Destruct, U>* = nullptr) { }
+
+ T& stored_object() {
+ return *static_cast<T*>(static_cast<void*>(data));
+ }
+
+ T const& stored_object() const {
+ return *static_cast<T const*>(static_cast<void const*>(data));
+ }
+
+
+ alignas( T ) unsigned char data[sizeof( T )]{};
+ };
+ } // namespace Detail
+
+ template <typename T>
+ using storage_for = Detail::ObjectStorage<T, true>;
+
+ template <typename T>
+ using destructable_object = Detail::ObjectStorage<T, false>;
+ } // namespace Benchmark
+} // namespace Catch
+
+#endif // CATCH_CONSTRUCTOR_HPP_INCLUDED
+
+#endif // CATCH_BENCHMARK_ALL_HPP_INCLUDED
+
+
+#ifndef CATCH_APPROX_HPP_INCLUDED
+#define CATCH_APPROX_HPP_INCLUDED
+
+
+
+#ifndef CATCH_TOSTRING_HPP_INCLUDED
+#define CATCH_TOSTRING_HPP_INCLUDED
+
+
+#include <vector>
+#include <cstddef>
+#include <type_traits>
+#include <string>
+#include <string.h>
+
+
+
+
+/** \file
+ * Wrapper for the WCHAR configuration option
+ *
+ * We want to support platforms that do not provide `wchar_t`, so we
+ * sometimes have to disable providing wchar_t overloads through Catch2,
+ * e.g. the StringMaker specialization for `std::wstring`.
+ */
+
+#ifndef CATCH_CONFIG_WCHAR_HPP_INCLUDED
+#define CATCH_CONFIG_WCHAR_HPP_INCLUDED
+
+// We assume that WCHAR should be enabled by default, and only disabled
+// for a shortlist (so far only DJGPP) of compilers.
+
+#if defined(__DJGPP__)
+# define CATCH_INTERNAL_CONFIG_NO_WCHAR
+#endif // __DJGPP__
+
+#if !defined( CATCH_INTERNAL_CONFIG_NO_WCHAR ) && \
+ !defined( CATCH_CONFIG_NO_WCHAR ) && \
+ !defined( CATCH_CONFIG_WCHAR )
+# define CATCH_CONFIG_WCHAR
+#endif
+
+#endif // CATCH_CONFIG_WCHAR_HPP_INCLUDED
+
+
+#ifndef CATCH_REUSABLE_STRING_STREAM_HPP_INCLUDED
+#define CATCH_REUSABLE_STRING_STREAM_HPP_INCLUDED
+
+
+#include <iosfwd>
+#include <cstddef>
+#include <ostream>
+#include <string>
+
+namespace Catch {
+
+ class ReusableStringStream : Detail::NonCopyable {
+ std::size_t m_index;
+ std::ostream* m_oss;
+ public:
+ ReusableStringStream();
+ ~ReusableStringStream();
+
+ //! Returns the serialized state
+ std::string str() const;
+ //! Sets internal state to `str`
+ void str(std::string const& str);
+
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic push
+// Old versions of GCC do not understand -Wnonnull-compare
+#pragma GCC diagnostic ignored "-Wpragmas"
+// Streaming a function pointer triggers Waddress and Wnonnull-compare
+// on GCC, because it implicitly converts it to bool and then decides
+// that the check it uses (a? true : false) is tautological and cannot
+// be null...
+#pragma GCC diagnostic ignored "-Waddress"
+#pragma GCC diagnostic ignored "-Wnonnull-compare"
+#endif
+
+ template<typename T>
+ auto operator << ( T const& value ) -> ReusableStringStream& {
+ *m_oss << value;
+ return *this;
+ }
+
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif
+ auto get() -> std::ostream& { return *m_oss; }
+ };
+}
+
+#endif // CATCH_REUSABLE_STRING_STREAM_HPP_INCLUDED
+
+
+#ifndef CATCH_VOID_TYPE_HPP_INCLUDED
+#define CATCH_VOID_TYPE_HPP_INCLUDED
+
+
+namespace Catch {
+ namespace Detail {
+
+ template <typename...>
+ struct make_void { using type = void; };
+
+ template <typename... Ts>
+ using void_t = typename make_void<Ts...>::type;
+
+ } // namespace Detail
+} // namespace Catch
+
+
+#endif // CATCH_VOID_TYPE_HPP_INCLUDED
+
+
+#ifndef CATCH_INTERFACES_ENUM_VALUES_REGISTRY_HPP_INCLUDED
+#define CATCH_INTERFACES_ENUM_VALUES_REGISTRY_HPP_INCLUDED
+
+
+#include <vector>
+
+namespace Catch {
+
+ namespace Detail {
+ struct EnumInfo {
+ StringRef m_name;
+ std::vector<std::pair<int, StringRef>> m_values;
+
+ ~EnumInfo();
+
+ StringRef lookup( int value ) const;
+ };
+ } // namespace Detail
+
+ class IMutableEnumValuesRegistry {
+ public:
+ virtual ~IMutableEnumValuesRegistry(); // = default;
+
+ virtual Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values ) = 0;
+
+ template<typename E>
+ Detail::EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::initializer_list<E> values ) {
+ static_assert(sizeof(int) >= sizeof(E), "Cannot serialize enum to int");
+ std::vector<int> intValues;
+ intValues.reserve( values.size() );
+ for( auto enumValue : values )
+ intValues.push_back( static_cast<int>( enumValue ) );
+ return registerEnum( enumName, allEnums, intValues );
+ }
+ };
+
+} // Catch
+
+#endif // CATCH_INTERFACES_ENUM_VALUES_REGISTRY_HPP_INCLUDED
+
+#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
+#include <string_view>
+#endif
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4180) // We attempt to stream a function (address) by const&, which MSVC complains about but is harmless
+#endif
+
+// We need a dummy global operator<< so we can bring it into Catch namespace later
+struct Catch_global_namespace_dummy{};
+std::ostream& operator<<(std::ostream&, Catch_global_namespace_dummy);
+
+namespace Catch {
+ // Bring in global namespace operator<< for ADL lookup in
+ // `IsStreamInsertable` below.
+ using ::operator<<;
+
+ namespace Detail {
+
+
+ constexpr StringRef unprintableString = "{?}"_sr;
+
+ //! Encases `string in quotes, and optionally escapes invisibles
+ std::string convertIntoString( StringRef string, bool escapeInvisibles );
+
+ //! Encases `string` in quotes, and escapes invisibles if user requested
+ //! it via CLI
+ std::string convertIntoString( StringRef string );
+
+ std::string rawMemoryToString( const void *object, std::size_t size );
+
+ template<typename T>
+ std::string rawMemoryToString( const T& object ) {
+ return rawMemoryToString( &object, sizeof(object) );
+ }
+
+ template<typename T>
+ class IsStreamInsertable {
+ template<typename Stream, typename U>
+ static auto test(int)
+ -> decltype(std::declval<Stream&>() << std::declval<U>(), std::true_type());
+
+ template<typename, typename>
+ static auto test(...)->std::false_type;
+
+ public:
+ static const bool value = decltype(test<std::ostream, const T&>(0))::value;
+ };
+
+ template<typename E>
+ std::string convertUnknownEnumToString( E e );
+
+ template<typename T>
+ std::enable_if_t<
+ !std::is_enum<T>::value && !std::is_base_of<std::exception, T>::value,
+ std::string> convertUnstreamable( T const& ) {
+ return std::string(Detail::unprintableString);
+ }
+ template<typename T>
+ std::enable_if_t<
+ !std::is_enum<T>::value && std::is_base_of<std::exception, T>::value,
+ std::string> convertUnstreamable(T const& ex) {
+ return ex.what();
+ }
+
+
+ template<typename T>
+ std::enable_if_t<
+ std::is_enum<T>::value,
+ std::string> convertUnstreamable( T const& value ) {
+ return convertUnknownEnumToString( value );
+ }
+
+#if defined(_MANAGED)
+ //! Convert a CLR string to a utf8 std::string
+ template<typename T>
+ std::string clrReferenceToString( T^ ref ) {
+ if (ref == nullptr)
+ return std::string("null");
+ auto bytes = System::Text::Encoding::UTF8->GetBytes(ref->ToString());
+ cli::pin_ptr<System::Byte> p = &bytes[0];
+ return std::string(reinterpret_cast<char const *>(p), bytes->Length);
+ }
+#endif
+
+ } // namespace Detail
+
+
+ // If we decide for C++14, change these to enable_if_ts
+ template <typename T, typename = void>
+ struct StringMaker {
+ template <typename Fake = T>
+ static
+ std::enable_if_t<::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>
+ convert(const Fake& value) {
+ ReusableStringStream rss;
+ // NB: call using the function-like syntax to avoid ambiguity with
+ // user-defined templated operator<< under clang.
+ rss.operator<<(value);
+ return rss.str();
+ }
+
+ template <typename Fake = T>
+ static
+ std::enable_if_t<!::Catch::Detail::IsStreamInsertable<Fake>::value, std::string>
+ convert( const Fake& value ) {
+#if !defined(CATCH_CONFIG_FALLBACK_STRINGIFIER)
+ return Detail::convertUnstreamable(value);
+#else
+ return CATCH_CONFIG_FALLBACK_STRINGIFIER(value);
+#endif
+ }
+ };
+
+ namespace Detail {
+
+ // This function dispatches all stringification requests inside of Catch.
+ // Should be preferably called fully qualified, like ::Catch::Detail::stringify
+ template <typename T>
+ std::string stringify(const T& e) {
+ return ::Catch::StringMaker<std::remove_cv_t<std::remove_reference_t<T>>>::convert(e);
+ }
+
+ template<typename E>
+ std::string convertUnknownEnumToString( E e ) {
+ return ::Catch::Detail::stringify(static_cast<std::underlying_type_t<E>>(e));
+ }
+
+#if defined(_MANAGED)
+ template <typename T>
+ std::string stringify( T^ e ) {
+ return ::Catch::StringMaker<T^>::convert(e);
+ }
+#endif
+
+ } // namespace Detail
+
+ // Some predefined specializations
+
+ template<>
+ struct StringMaker<std::string> {
+ static std::string convert(const std::string& str);
+ };
+
+#ifdef CATCH_CONFIG_CPP17_STRING_VIEW
+ template<>
+ struct StringMaker<std::string_view> {
+ static std::string convert(std::string_view str);
+ };
+#endif
+
+ template<>
+ struct StringMaker<char const *> {
+ static std::string convert(char const * str);
+ };
+ template<>
+ struct StringMaker<char *> {
+ static std::string convert(char * str);
+ };
+
+#if defined(CATCH_CONFIG_WCHAR)
+ template<>
+ struct StringMaker<std::wstring> {
+ static std::string convert(const std::wstring& wstr);
+ };
+
+# ifdef CATCH_CONFIG_CPP17_STRING_VIEW
+ template<>
+ struct StringMaker<std::wstring_view> {
+ static std::string convert(std::wstring_view str);
+ };
+# endif
+
+ template<>
+ struct StringMaker<wchar_t const *> {
+ static std::string convert(wchar_t const * str);
+ };
+ template<>
+ struct StringMaker<wchar_t *> {
+ static std::string convert(wchar_t * str);
+ };
+#endif // CATCH_CONFIG_WCHAR
+
+ template<size_t SZ>
+ struct StringMaker<char[SZ]> {
+ static std::string convert(char const* str) {
+ // Note that `strnlen` is not actually part of standard C++,
+ // but both POSIX and Windows cstdlib provide it.
+ return Detail::convertIntoString(
+ StringRef( str, strnlen( str, SZ ) ) );
+ }
+ };
+ template<size_t SZ>
+ struct StringMaker<signed char[SZ]> {
+ static std::string convert(signed char const* str) {
+ // See the plain `char const*` overload
+ auto reinterpreted = reinterpret_cast<char const*>(str);
+ return Detail::convertIntoString(
+ StringRef(reinterpreted, strnlen(reinterpreted, SZ)));
+ }
+ };
+ template<size_t SZ>
+ struct StringMaker<unsigned char[SZ]> {
+ static std::string convert(unsigned char const* str) {
+ // See the plain `char const*` overload
+ auto reinterpreted = reinterpret_cast<char const*>(str);
+ return Detail::convertIntoString(
+ StringRef(reinterpreted, strnlen(reinterpreted, SZ)));
+ }
+ };
+
+#if defined(CATCH_CONFIG_CPP17_BYTE)
+ template<>
+ struct StringMaker<std::byte> {
+ static std::string convert(std::byte value);
+ };
+#endif // defined(CATCH_CONFIG_CPP17_BYTE)
+ template<>
+ struct StringMaker<int> {
+ static std::string convert(int value);
+ };
+ template<>
+ struct StringMaker<long> {
+ static std::string convert(long value);
+ };
+ template<>
+ struct StringMaker<long long> {
+ static std::string convert(long long value);
+ };
+ template<>
+ struct StringMaker<unsigned int> {
+ static std::string convert(unsigned int value);
+ };
+ template<>
+ struct StringMaker<unsigned long> {
+ static std::string convert(unsigned long value);
+ };
+ template<>
+ struct StringMaker<unsigned long long> {
+ static std::string convert(unsigned long long value);
+ };
+
+ template<>
+ struct StringMaker<bool> {
+ static std::string convert(bool b) {
+ using namespace std::string_literals;
+ return b ? "true"s : "false"s;
+ }
+ };
+
+ template<>
+ struct StringMaker<char> {
+ static std::string convert(char c);
+ };
+ template<>
+ struct StringMaker<signed char> {
+ static std::string convert(signed char c);
+ };
+ template<>
+ struct StringMaker<unsigned char> {
+ static std::string convert(unsigned char c);
+ };
+
+ template<>
+ struct StringMaker<std::nullptr_t> {
+ static std::string convert(std::nullptr_t) {
+ using namespace std::string_literals;
+ return "nullptr"s;
+ }
+ };
+
+ template<>
+ struct StringMaker<float> {
+ static std::string convert(float value);
+ static int precision;
+ };
+
+ template<>
+ struct StringMaker<double> {
+ static std::string convert(double value);
+ static int precision;
+ };
+
+ template <typename T>
+ struct StringMaker<T*> {
+ template <typename U>
+ static std::string convert(U* p) {
+ if (p) {
+ return ::Catch::Detail::rawMemoryToString(p);
+ } else {
+ return "nullptr";
+ }
+ }
+ };
+
+ template <typename R, typename C>
+ struct StringMaker<R C::*> {
+ static std::string convert(R C::* p) {
+ if (p) {
+ return ::Catch::Detail::rawMemoryToString(p);
+ } else {
+ return "nullptr";
+ }
+ }
+ };
+
+#if defined(_MANAGED)
+ template <typename T>
+ struct StringMaker<T^> {
+ static std::string convert( T^ ref ) {
+ return ::Catch::Detail::clrReferenceToString(ref);
+ }
+ };
+#endif
+
+ namespace Detail {
+ template<typename InputIterator, typename Sentinel = InputIterator>
+ std::string rangeToString(InputIterator first, Sentinel last) {
+ ReusableStringStream rss;
+ rss << "{ ";
+ if (first != last) {
+ rss << ::Catch::Detail::stringify(*first);
+ for (++first; first != last; ++first)
+ rss << ", " << ::Catch::Detail::stringify(*first);
+ }
+ rss << " }";
+ return rss.str();
+ }
+ }
+
+} // namespace Catch
+
+//////////////////////////////////////////////////////
+// Separate std-lib types stringification, so it can be selectively enabled
+// This means that we do not bring in their headers
+
+#if defined(CATCH_CONFIG_ENABLE_ALL_STRINGMAKERS)
+# define CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
+# define CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
+# define CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
+# define CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
+#endif
+
+// Separate std::pair specialization
+#if defined(CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER)
+#include <utility>
+namespace Catch {
+ template<typename T1, typename T2>
+ struct StringMaker<std::pair<T1, T2> > {
+ static std::string convert(const std::pair<T1, T2>& pair) {
+ ReusableStringStream rss;
+ rss << "{ "
+ << ::Catch::Detail::stringify(pair.first)
+ << ", "
+ << ::Catch::Detail::stringify(pair.second)
+ << " }";
+ return rss.str();
+ }
+ };
+}
+#endif // CATCH_CONFIG_ENABLE_PAIR_STRINGMAKER
+
+#if defined(CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_OPTIONAL)
+#include <optional>
+namespace Catch {
+ template<typename T>
+ struct StringMaker<std::optional<T> > {
+ static std::string convert(const std::optional<T>& optional) {
+ if (optional.has_value()) {
+ return ::Catch::Detail::stringify(*optional);
+ } else {
+ return "{ }";
+ }
+ }
+ };
+}
+#endif // CATCH_CONFIG_ENABLE_OPTIONAL_STRINGMAKER
+
+// Separate std::tuple specialization
+#if defined(CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER)
+#include <tuple>
+namespace Catch {
+ namespace Detail {
+ template<
+ typename Tuple,
+ std::size_t N = 0,
+ bool = (N < std::tuple_size<Tuple>::value)
+ >
+ struct TupleElementPrinter {
+ static void print(const Tuple& tuple, std::ostream& os) {
+ os << (N ? ", " : " ")
+ << ::Catch::Detail::stringify(std::get<N>(tuple));
+ TupleElementPrinter<Tuple, N + 1>::print(tuple, os);
+ }
+ };
+
+ template<
+ typename Tuple,
+ std::size_t N
+ >
+ struct TupleElementPrinter<Tuple, N, false> {
+ static void print(const Tuple&, std::ostream&) {}
+ };
+
+ }
+
+
+ template<typename ...Types>
+ struct StringMaker<std::tuple<Types...>> {
+ static std::string convert(const std::tuple<Types...>& tuple) {
+ ReusableStringStream rss;
+ rss << '{';
+ Detail::TupleElementPrinter<std::tuple<Types...>>::print(tuple, rss.get());
+ rss << " }";
+ return rss.str();
+ }
+ };
+}
+#endif // CATCH_CONFIG_ENABLE_TUPLE_STRINGMAKER
+
+#if defined(CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER) && defined(CATCH_CONFIG_CPP17_VARIANT)
+#include <variant>
+namespace Catch {
+ template<>
+ struct StringMaker<std::monostate> {
+ static std::string convert(const std::monostate&) {
+ return "{ }";
+ }
+ };
+
+ template<typename... Elements>
+ struct StringMaker<std::variant<Elements...>> {
+ static std::string convert(const std::variant<Elements...>& variant) {
+ if (variant.valueless_by_exception()) {
+ return "{valueless variant}";
+ } else {
+ return std::visit(
+ [](const auto& value) {
+ return ::Catch::Detail::stringify(value);
+ },
+ variant
+ );
+ }
+ }
+ };
+}
+#endif // CATCH_CONFIG_ENABLE_VARIANT_STRINGMAKER
+
+namespace Catch {
+ // Import begin/ end from std here
+ using std::begin;
+ using std::end;
+
+ namespace Detail {
+ template <typename T, typename = void>
+ struct is_range_impl : std::false_type {};
+
+ template <typename T>
+ struct is_range_impl<T, void_t<decltype(begin(std::declval<T>()))>> : std::true_type {};
+ } // namespace Detail
+
+ template <typename T>
+ struct is_range : Detail::is_range_impl<T> {};
+
+#if defined(_MANAGED) // Managed types are never ranges
+ template <typename T>
+ struct is_range<T^> {
+ static const bool value = false;
+ };
+#endif
+
+ template<typename Range>
+ std::string rangeToString( Range const& range ) {
+ return ::Catch::Detail::rangeToString( begin( range ), end( range ) );
+ }
+
+ // Handle vector<bool> specially
+ template<typename Allocator>
+ std::string rangeToString( std::vector<bool, Allocator> const& v ) {
+ ReusableStringStream rss;
+ rss << "{ ";
+ bool first = true;
+ for( bool b : v ) {
+ if( first )
+ first = false;
+ else
+ rss << ", ";
+ rss << ::Catch::Detail::stringify( b );
+ }
+ rss << " }";
+ return rss.str();
+ }
+
+ template<typename R>
+ struct StringMaker<R, std::enable_if_t<is_range<R>::value && !::Catch::Detail::IsStreamInsertable<R>::value>> {
+ static std::string convert( R const& range ) {
+ return rangeToString( range );
+ }
+ };
+
+ template <typename T, size_t SZ>
+ struct StringMaker<T[SZ]> {
+ static std::string convert(T const(&arr)[SZ]) {
+ return rangeToString(arr);
+ }
+ };
+
+
+} // namespace Catch
+
+// Separate std::chrono::duration specialization
+#include <ctime>
+#include <ratio>
+#include <chrono>
+
+
+namespace Catch {
+
+template <class Ratio>
+struct ratio_string {
+ static std::string symbol() {
+ Catch::ReusableStringStream rss;
+ rss << '[' << Ratio::num << '/'
+ << Ratio::den << ']';
+ return rss.str();
+ }
+};
+
+template <>
+struct ratio_string<std::atto> {
+ static char symbol() { return 'a'; }
+};
+template <>
+struct ratio_string<std::femto> {
+ static char symbol() { return 'f'; }
+};
+template <>
+struct ratio_string<std::pico> {
+ static char symbol() { return 'p'; }
+};
+template <>
+struct ratio_string<std::nano> {
+ static char symbol() { return 'n'; }
+};
+template <>
+struct ratio_string<std::micro> {
+ static char symbol() { return 'u'; }
+};
+template <>
+struct ratio_string<std::milli> {
+ static char symbol() { return 'm'; }
+};
+
+ ////////////
+ // std::chrono::duration specializations
+ template<typename Value, typename Ratio>
+ struct StringMaker<std::chrono::duration<Value, Ratio>> {
+ static std::string convert(std::chrono::duration<Value, Ratio> const& duration) {
+ ReusableStringStream rss;
+ rss << duration.count() << ' ' << ratio_string<Ratio>::symbol() << 's';
+ return rss.str();
+ }
+ };
+ template<typename Value>
+ struct StringMaker<std::chrono::duration<Value, std::ratio<1>>> {
+ static std::string convert(std::chrono::duration<Value, std::ratio<1>> const& duration) {
+ ReusableStringStream rss;
+ rss << duration.count() << " s";
+ return rss.str();
+ }
+ };
+ template<typename Value>
+ struct StringMaker<std::chrono::duration<Value, std::ratio<60>>> {
+ static std::string convert(std::chrono::duration<Value, std::ratio<60>> const& duration) {
+ ReusableStringStream rss;
+ rss << duration.count() << " m";
+ return rss.str();
+ }
+ };
+ template<typename Value>
+ struct StringMaker<std::chrono::duration<Value, std::ratio<3600>>> {
+ static std::string convert(std::chrono::duration<Value, std::ratio<3600>> const& duration) {
+ ReusableStringStream rss;
+ rss << duration.count() << " h";
+ return rss.str();
+ }
+ };
+
+ ////////////
+ // std::chrono::time_point specialization
+ // Generic time_point cannot be specialized, only std::chrono::time_point<system_clock>
+ template<typename Clock, typename Duration>
+ struct StringMaker<std::chrono::time_point<Clock, Duration>> {
+ static std::string convert(std::chrono::time_point<Clock, Duration> const& time_point) {
+ return ::Catch::Detail::stringify(time_point.time_since_epoch()) + " since epoch";
+ }
+ };
+ // std::chrono::time_point<system_clock> specialization
+ template<typename Duration>
+ struct StringMaker<std::chrono::time_point<std::chrono::system_clock, Duration>> {
+ static std::string convert(std::chrono::time_point<std::chrono::system_clock, Duration> const& time_point) {
+ auto converted = std::chrono::system_clock::to_time_t(time_point);
+
+#ifdef _MSC_VER
+ std::tm timeInfo = {};
+ gmtime_s(&timeInfo, &converted);
+#else
+ std::tm* timeInfo = std::gmtime(&converted);
+#endif
+
+ auto const timeStampSize = sizeof("2017-01-16T17:06:45Z");
+ char timeStamp[timeStampSize];
+ const char * const fmt = "%Y-%m-%dT%H:%M:%SZ";
+
+#ifdef _MSC_VER
+ std::strftime(timeStamp, timeStampSize, fmt, &timeInfo);
+#else
+ std::strftime(timeStamp, timeStampSize, fmt, timeInfo);
+#endif
+ return std::string(timeStamp, timeStampSize - 1);
+ }
+ };
+}
+
+
+#define INTERNAL_CATCH_REGISTER_ENUM( enumName, ... ) \
+namespace Catch { \
+ template<> struct StringMaker<enumName> { \
+ static std::string convert( enumName value ) { \
+ static const auto& enumInfo = ::Catch::getMutableRegistryHub().getMutableEnumValuesRegistry().registerEnum( #enumName, #__VA_ARGS__, { __VA_ARGS__ } ); \
+ return static_cast<std::string>(enumInfo.lookup( static_cast<int>( value ) )); \
+ } \
+ }; \
+}
+
+#define CATCH_REGISTER_ENUM( enumName, ... ) INTERNAL_CATCH_REGISTER_ENUM( enumName, __VA_ARGS__ )
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+
+#endif // CATCH_TOSTRING_HPP_INCLUDED
+
+#include <type_traits>
+
+namespace Catch {
+
+ class Approx {
+ private:
+ bool equalityComparisonImpl(double other) const;
+ // Sets and validates the new margin (margin >= 0)
+ void setMargin(double margin);
+ // Sets and validates the new epsilon (0 < epsilon < 1)
+ void setEpsilon(double epsilon);
+
+ public:
+ explicit Approx ( double value );
+
+ static Approx custom();
+
+ Approx operator-() const;
+
+ template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ Approx operator()( T const& value ) const {
+ Approx approx( static_cast<double>(value) );
+ approx.m_epsilon = m_epsilon;
+ approx.m_margin = m_margin;
+ approx.m_scale = m_scale;
+ return approx;
+ }
+
+ template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ explicit Approx( T const& value ): Approx(static_cast<double>(value))
+ {}
+
+
+ template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ friend bool operator == ( const T& lhs, Approx const& rhs ) {
+ auto lhs_v = static_cast<double>(lhs);
+ return rhs.equalityComparisonImpl(lhs_v);
+ }
+
+ template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ friend bool operator == ( Approx const& lhs, const T& rhs ) {
+ return operator==( rhs, lhs );
+ }
+
+ template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ friend bool operator != ( T const& lhs, Approx const& rhs ) {
+ return !operator==( lhs, rhs );
+ }
+
+ template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ friend bool operator != ( Approx const& lhs, T const& rhs ) {
+ return !operator==( rhs, lhs );
+ }
+
+ template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ friend bool operator <= ( T const& lhs, Approx const& rhs ) {
+ return static_cast<double>(lhs) < rhs.m_value || lhs == rhs;
+ }
+
+ template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ friend bool operator <= ( Approx const& lhs, T const& rhs ) {
+ return lhs.m_value < static_cast<double>(rhs) || lhs == rhs;
+ }
+
+ template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ friend bool operator >= ( T const& lhs, Approx const& rhs ) {
+ return static_cast<double>(lhs) > rhs.m_value || lhs == rhs;
+ }
+
+ template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ friend bool operator >= ( Approx const& lhs, T const& rhs ) {
+ return lhs.m_value > static_cast<double>(rhs) || lhs == rhs;
+ }
+
+ template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ Approx& epsilon( T const& newEpsilon ) {
+ const auto epsilonAsDouble = static_cast<double>(newEpsilon);
+ setEpsilon(epsilonAsDouble);
+ return *this;
+ }
+
+ template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ Approx& margin( T const& newMargin ) {
+ const auto marginAsDouble = static_cast<double>(newMargin);
+ setMargin(marginAsDouble);
+ return *this;
+ }
+
+ template <typename T, typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ Approx& scale( T const& newScale ) {
+ m_scale = static_cast<double>(newScale);
+ return *this;
+ }
+
+ std::string toString() const;
+
+ private:
+ double m_epsilon;
+ double m_margin;
+ double m_scale;
+ double m_value;
+ };
+
+namespace literals {
+ Approx operator ""_a(long double val);
+ Approx operator ""_a(unsigned long long val);
+} // end namespace literals
+
+template<>
+struct StringMaker<Catch::Approx> {
+ static std::string convert(Catch::Approx const& value);
+};
+
+} // end namespace Catch
+
+#endif // CATCH_APPROX_HPP_INCLUDED
+
+
+#ifndef CATCH_CONFIG_HPP_INCLUDED
+#define CATCH_CONFIG_HPP_INCLUDED
+
+
+
+#ifndef CATCH_TEST_SPEC_HPP_INCLUDED
+#define CATCH_TEST_SPEC_HPP_INCLUDED
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpadded"
+#endif
+
+
+
+#ifndef CATCH_WILDCARD_PATTERN_HPP_INCLUDED
+#define CATCH_WILDCARD_PATTERN_HPP_INCLUDED
+
+
+
+#ifndef CATCH_CASE_SENSITIVE_HPP_INCLUDED
+#define CATCH_CASE_SENSITIVE_HPP_INCLUDED
+
+namespace Catch {
+
+ enum class CaseSensitive { Yes, No };
+
+} // namespace Catch
+
+#endif // CATCH_CASE_SENSITIVE_HPP_INCLUDED
+
+#include <string>
+
+namespace Catch
+{
+ class WildcardPattern {
+ enum WildcardPosition {
+ NoWildcard = 0,
+ WildcardAtStart = 1,
+ WildcardAtEnd = 2,
+ WildcardAtBothEnds = WildcardAtStart | WildcardAtEnd
+ };
+
+ public:
+
+ WildcardPattern( std::string const& pattern, CaseSensitive caseSensitivity );
+ bool matches( std::string const& str ) const;
+
+ private:
+ std::string normaliseString( std::string const& str ) const;
+ CaseSensitive m_caseSensitivity;
+ WildcardPosition m_wildcard = NoWildcard;
+ std::string m_pattern;
+ };
+}
+
+#endif // CATCH_WILDCARD_PATTERN_HPP_INCLUDED
+
+#include <string>
+#include <vector>
+
+namespace Catch {
+
+ class IConfig;
+ struct TestCaseInfo;
+ class TestCaseHandle;
+
+ class TestSpec {
+
+ class Pattern {
+ public:
+ explicit Pattern( std::string const& name );
+ virtual ~Pattern();
+ virtual bool matches( TestCaseInfo const& testCase ) const = 0;
+ std::string const& name() const;
+ private:
+ std::string const m_name;
+ };
+
+ class NamePattern : public Pattern {
+ public:
+ explicit NamePattern( std::string const& name, std::string const& filterString );
+ bool matches( TestCaseInfo const& testCase ) const override;
+ private:
+ WildcardPattern m_wildcardPattern;
+ };
+
+ class TagPattern : public Pattern {
+ public:
+ explicit TagPattern( std::string const& tag, std::string const& filterString );
+ bool matches( TestCaseInfo const& testCase ) const override;
+ private:
+ std::string m_tag;
+ };
+
+ struct Filter {
+ std::vector<Detail::unique_ptr<Pattern>> m_required;
+ std::vector<Detail::unique_ptr<Pattern>> m_forbidden;
+
+ bool matches( TestCaseInfo const& testCase ) const;
+ std::string name() const;
+ };
+
+ public:
+ struct FilterMatch {
+ std::string name;
+ std::vector<TestCaseHandle const*> tests;
+ };
+ using Matches = std::vector<FilterMatch>;
+ using vectorStrings = std::vector<std::string>;
+
+ bool hasFilters() const;
+ bool matches( TestCaseInfo const& testCase ) const;
+ Matches matchesByFilter( std::vector<TestCaseHandle> const& testCases, IConfig const& config ) const;
+ const vectorStrings & getInvalidSpecs() const;
+
+ private:
+ std::vector<Filter> m_filters;
+ std::vector<std::string> m_invalidSpecs;
+ friend class TestSpecParser;
+ };
+}
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+#endif // CATCH_TEST_SPEC_HPP_INCLUDED
+
+
+#ifndef CATCH_OPTIONAL_HPP_INCLUDED
+#define CATCH_OPTIONAL_HPP_INCLUDED
+
+#include <cassert>
+
+namespace Catch {
+
+ // An optional type
+ template<typename T>
+ class Optional {
+ public:
+ Optional() : nullableValue( nullptr ) {}
+ Optional( T const& _value )
+ : nullableValue( new( storage ) T( _value ) )
+ {}
+ Optional( Optional const& _other )
+ : nullableValue( _other ? new( storage ) T( *_other ) : nullptr )
+ {}
+
+ ~Optional() {
+ reset();
+ }
+
+ Optional& operator= ( Optional const& _other ) {
+ if( &_other != this ) {
+ reset();
+ if( _other )
+ nullableValue = new( storage ) T( *_other );
+ }
+ return *this;
+ }
+ Optional& operator = ( T const& _value ) {
+ reset();
+ nullableValue = new( storage ) T( _value );
+ return *this;
+ }
+
+ void reset() {
+ if( nullableValue )
+ nullableValue->~T();
+ nullableValue = nullptr;
+ }
+
+ T& operator*() {
+ assert(nullableValue);
+ return *nullableValue;
+ }
+ T const& operator*() const {
+ assert(nullableValue);
+ return *nullableValue;
+ }
+ T* operator->() {
+ assert(nullableValue);
+ return nullableValue;
+ }
+ const T* operator->() const {
+ assert(nullableValue);
+ return nullableValue;
+ }
+
+ T valueOr( T const& defaultValue ) const {
+ return nullableValue ? *nullableValue : defaultValue;
+ }
+
+ bool some() const { return nullableValue != nullptr; }
+ bool none() const { return nullableValue == nullptr; }
+
+ bool operator !() const { return nullableValue == nullptr; }
+ explicit operator bool() const {
+ return some();
+ }
+
+ friend bool operator==(Optional const& a, Optional const& b) {
+ if (a.none() && b.none()) {
+ return true;
+ } else if (a.some() && b.some()) {
+ return *a == *b;
+ } else {
+ return false;
+ }
+ }
+ friend bool operator!=(Optional const& a, Optional const& b) {
+ return !( a == b );
+ }
+
+ private:
+ T *nullableValue;
+ alignas(alignof(T)) char storage[sizeof(T)];
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_OPTIONAL_HPP_INCLUDED
+
+
+#ifndef CATCH_RANDOM_SEED_GENERATION_HPP_INCLUDED
+#define CATCH_RANDOM_SEED_GENERATION_HPP_INCLUDED
+
+#include <cstdint>
+
+namespace Catch {
+
+ enum class GenerateFrom {
+ Time,
+ RandomDevice,
+ //! Currently equivalent to RandomDevice, but can change at any point
+ Default
+ };
+
+ std::uint32_t generateRandomSeed(GenerateFrom from);
+
+} // end namespace Catch
+
+#endif // CATCH_RANDOM_SEED_GENERATION_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED
+#define CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED
+
+
+
+#ifndef CATCH_CONSOLE_COLOUR_HPP_INCLUDED
+#define CATCH_CONSOLE_COLOUR_HPP_INCLUDED
+
+
+#include <iosfwd>
+#include <cstdint>
+
+namespace Catch {
+
+ enum class ColourMode : std::uint8_t;
+ class IStream;
+
+ struct Colour {
+ enum Code {
+ None = 0,
+
+ White,
+ Red,
+ Green,
+ Blue,
+ Cyan,
+ Yellow,
+ Grey,
+
+ Bright = 0x10,
+
+ BrightRed = Bright | Red,
+ BrightGreen = Bright | Green,
+ LightGrey = Bright | Grey,
+ BrightWhite = Bright | White,
+ BrightYellow = Bright | Yellow,
+
+ // By intention
+ FileName = LightGrey,
+ Warning = BrightYellow,
+ ResultError = BrightRed,
+ ResultSuccess = BrightGreen,
+ ResultExpectedFailure = Warning,
+
+ Error = BrightRed,
+ Success = Green,
+
+ OriginalExpression = Cyan,
+ ReconstructedExpression = BrightYellow,
+
+ SecondaryText = LightGrey,
+ Headers = White
+ };
+ };
+
+ class ColourImpl {
+ protected:
+ //! The associated stream of this ColourImpl instance
+ IStream* m_stream;
+ public:
+ ColourImpl( IStream* stream ): m_stream( stream ) {}
+
+ //! RAII wrapper around writing specific colour of text using specific
+ //! colour impl into a stream.
+ class ColourGuard {
+ ColourImpl const* m_colourImpl;
+ Colour::Code m_code;
+ bool m_engaged = false;
+
+ public:
+ //! Does **not** engage the guard/start the colour
+ ColourGuard( Colour::Code code,
+ ColourImpl const* colour );
+
+ ColourGuard( ColourGuard const& rhs ) = delete;
+ ColourGuard& operator=( ColourGuard const& rhs ) = delete;
+
+ ColourGuard( ColourGuard&& rhs ) noexcept;
+ ColourGuard& operator=( ColourGuard&& rhs ) noexcept;
+
+ //! Removes colour _if_ the guard was engaged
+ ~ColourGuard();
+
+ /**
+ * Explicitly engages colour for given stream.
+ *
+ * The API based on operator<< should be preferred.
+ */
+ ColourGuard& engage( std::ostream& stream ) &;
+ /**
+ * Explicitly engages colour for given stream.
+ *
+ * The API based on operator<< should be preferred.
+ */
+ ColourGuard&& engage( std::ostream& stream ) &&;
+
+ private:
+ //! Engages the guard and starts using colour
+ friend std::ostream& operator<<( std::ostream& lhs,
+ ColourGuard& guard ) {
+ guard.engageImpl( lhs );
+ return lhs;
+ }
+ //! Engages the guard and starts using colour
+ friend std::ostream& operator<<( std::ostream& lhs,
+ ColourGuard&& guard) {
+ guard.engageImpl( lhs );
+ return lhs;
+ }
+
+ void engageImpl( std::ostream& stream );
+
+ };
+
+ virtual ~ColourImpl(); // = default
+ /**
+ * Creates a guard object for given colour and this colour impl
+ *
+ * **Important:**
+ * the guard starts disengaged, and has to be engaged explicitly.
+ */
+ ColourGuard guardColour( Colour::Code colourCode );
+
+ private:
+ virtual void use( Colour::Code colourCode ) const = 0;
+ };
+
+ //! Provides ColourImpl based on global config and target compilation platform
+ Detail::unique_ptr<ColourImpl> makeColourImpl( ColourMode colourSelection,
+ IStream* stream );
+
+ //! Checks if specific colour impl has been compiled into the binary
+ bool isColourImplAvailable( ColourMode colourSelection );
+
+} // end namespace Catch
+
+#endif // CATCH_CONSOLE_COLOUR_HPP_INCLUDED
+
+#include <map>
+#include <string>
+#include <vector>
+
+namespace Catch {
+
+ enum class ColourMode : std::uint8_t;
+
+ namespace Detail {
+ //! Splits the reporter spec into reporter name and kv-pair options
+ std::vector<std::string> splitReporterSpec( StringRef reporterSpec );
+
+ Optional<ColourMode> stringToColourMode( StringRef colourMode );
+ }
+
+ /**
+ * Structured reporter spec that a reporter can be created from
+ *
+ * Parsing has been validated, but semantics have not. This means e.g.
+ * that the colour mode is known to Catch2, but it might not be
+ * compiled into the binary, and the output filename might not be
+ * openable.
+ */
+ class ReporterSpec {
+ std::string m_name;
+ Optional<std::string> m_outputFileName;
+ Optional<ColourMode> m_colourMode;
+ std::map<std::string, std::string> m_customOptions;
+
+ friend bool operator==( ReporterSpec const& lhs,
+ ReporterSpec const& rhs );
+ friend bool operator!=( ReporterSpec const& lhs,
+ ReporterSpec const& rhs ) {
+ return !( lhs == rhs );
+ }
+
+ public:
+ ReporterSpec(
+ std::string name,
+ Optional<std::string> outputFileName,
+ Optional<ColourMode> colourMode,
+ std::map<std::string, std::string> customOptions );
+
+ std::string const& name() const { return m_name; }
+
+ Optional<std::string> const& outputFile() const {
+ return m_outputFileName;
+ }
+
+ Optional<ColourMode> const& colourMode() const { return m_colourMode; }
+
+ std::map<std::string, std::string> const& customOptions() const {
+ return m_customOptions;
+ }
+ };
+
+ /**
+ * Parses provided reporter spec string into
+ *
+ * Returns empty optional on errors, e.g.
+ * * field that is not first and not a key+value pair
+ * * duplicated keys in kv pair
+ * * unknown catch reporter option
+ * * empty key/value in an custom kv pair
+ * * ...
+ */
+ Optional<ReporterSpec> parseReporterSpec( StringRef reporterSpec );
+
+}
+
+#endif // CATCH_REPORTER_SPEC_PARSER_HPP_INCLUDED
+
+#include <chrono>
+#include <map>
+#include <string>
+#include <vector>
+
+namespace Catch {
+
+ class IStream;
+
+ /**
+ * `ReporterSpec` but with the defaults filled in.
+ *
+ * Like `ReporterSpec`, the semantics are unchecked.
+ */
+ struct ProcessedReporterSpec {
+ std::string name;
+ std::string outputFilename;
+ ColourMode colourMode;
+ std::map<std::string, std::string> customOptions;
+ friend bool operator==( ProcessedReporterSpec const& lhs,
+ ProcessedReporterSpec const& rhs );
+ friend bool operator!=( ProcessedReporterSpec const& lhs,
+ ProcessedReporterSpec const& rhs ) {
+ return !( lhs == rhs );
+ }
+ };
+
+ struct ConfigData {
+
+ bool listTests = false;
+ bool listTags = false;
+ bool listReporters = false;
+ bool listListeners = false;
+
+ bool showSuccessfulTests = false;
+ bool shouldDebugBreak = false;
+ bool noThrow = false;
+ bool showHelp = false;
+ bool showInvisibles = false;
+ bool filenamesAsTags = false;
+ bool libIdentify = false;
+ bool allowZeroTests = false;
+
+ int abortAfter = -1;
+ uint32_t rngSeed = generateRandomSeed(GenerateFrom::Default);
+
+ unsigned int shardCount = 1;
+ unsigned int shardIndex = 0;
+
+ bool skipBenchmarks = false;
+ bool benchmarkNoAnalysis = false;
+ unsigned int benchmarkSamples = 100;
+ double benchmarkConfidenceInterval = 0.95;
+ unsigned int benchmarkResamples = 100000;
+ std::chrono::milliseconds::rep benchmarkWarmupTime = 100;
+
+ Verbosity verbosity = Verbosity::Normal;
+ WarnAbout::What warnings = WarnAbout::Nothing;
+ ShowDurations showDurations = ShowDurations::DefaultForReporter;
+ double minDuration = -1;
+ TestRunOrder runOrder = TestRunOrder::Declared;
+ ColourMode defaultColourMode = ColourMode::PlatformDefault;
+ WaitForKeypress::When waitForKeypress = WaitForKeypress::Never;
+
+ std::string defaultOutputFilename;
+ std::string name;
+ std::string processName;
+ std::vector<ReporterSpec> reporterSpecifications;
+
+ std::vector<std::string> testsOrTags;
+ std::vector<std::string> sectionsToRun;
+ };
+
+
+ class Config : public IConfig {
+ public:
+
+ Config() = default;
+ Config( ConfigData const& data );
+ ~Config() override; // = default in the cpp file
+
+ bool listTests() const;
+ bool listTags() const;
+ bool listReporters() const;
+ bool listListeners() const;
+
+ std::vector<ReporterSpec> const& getReporterSpecs() const;
+ std::vector<ProcessedReporterSpec> const&
+ getProcessedReporterSpecs() const;
+
+ std::vector<std::string> const& getTestsOrTags() const override;
+ std::vector<std::string> const& getSectionsToRun() const override;
+
+ TestSpec const& testSpec() const override;
+ bool hasTestFilters() const override;
+
+ bool showHelp() const;
+
+ // IConfig interface
+ bool allowThrows() const override;
+ StringRef name() const override;
+ bool includeSuccessfulResults() const override;
+ bool warnAboutMissingAssertions() const override;
+ bool warnAboutUnmatchedTestSpecs() const override;
+ bool zeroTestsCountAsSuccess() const override;
+ ShowDurations showDurations() const override;
+ double minDuration() const override;
+ TestRunOrder runOrder() const override;
+ uint32_t rngSeed() const override;
+ unsigned int shardCount() const override;
+ unsigned int shardIndex() const override;
+ ColourMode defaultColourMode() const override;
+ bool shouldDebugBreak() const override;
+ int abortAfter() const override;
+ bool showInvisibles() const override;
+ Verbosity verbosity() const override;
+ bool skipBenchmarks() const override;
+ bool benchmarkNoAnalysis() const override;
+ unsigned int benchmarkSamples() const override;
+ double benchmarkConfidenceInterval() const override;
+ unsigned int benchmarkResamples() const override;
+ std::chrono::milliseconds benchmarkWarmupTime() const override;
+
+ private:
+ ConfigData m_data;
+ std::vector<ProcessedReporterSpec> m_processedReporterSpecs;
+ TestSpec m_testSpec;
+ bool m_hasTestFilters = false;
+ };
+} // end namespace Catch
+
+#endif // CATCH_CONFIG_HPP_INCLUDED
+
+
+#ifndef CATCH_MESSAGE_HPP_INCLUDED
+#define CATCH_MESSAGE_HPP_INCLUDED
+
+
+
+#ifndef CATCH_STREAM_END_STOP_HPP_INCLUDED
+#define CATCH_STREAM_END_STOP_HPP_INCLUDED
+
+
+namespace Catch {
+
+ // Use this in variadic streaming macros to allow
+ // << +StreamEndStop
+ // as well as
+ // << stuff +StreamEndStop
+ struct StreamEndStop {
+ StringRef operator+() const { return StringRef(); }
+
+ template <typename T>
+ friend T const& operator+( T const& value, StreamEndStop ) {
+ return value;
+ }
+ };
+
+} // namespace Catch
+
+#endif // CATCH_STREAM_END_STOP_HPP_INCLUDED
+
+#include <string>
+#include <vector>
+
+namespace Catch {
+
+ struct SourceLineInfo;
+
+ struct MessageStream {
+
+ template<typename T>
+ MessageStream& operator << ( T const& value ) {
+ m_stream << value;
+ return *this;
+ }
+
+ ReusableStringStream m_stream;
+ };
+
+ struct MessageBuilder : MessageStream {
+ MessageBuilder( StringRef macroName,
+ SourceLineInfo const& lineInfo,
+ ResultWas::OfType type ):
+ m_info(macroName, lineInfo, type) {}
+
+
+ template<typename T>
+ MessageBuilder& operator << ( T const& value ) {
+ m_stream << value;
+ return *this;
+ }
+
+ MessageInfo m_info;
+ };
+
+ class ScopedMessage {
+ public:
+ explicit ScopedMessage( MessageBuilder const& builder );
+ ScopedMessage( ScopedMessage& duplicate ) = delete;
+ ScopedMessage( ScopedMessage&& old ) noexcept;
+ ~ScopedMessage();
+
+ MessageInfo m_info;
+ bool m_moved = false;
+ };
+
+ class Capturer {
+ std::vector<MessageInfo> m_messages;
+ IResultCapture& m_resultCapture = getResultCapture();
+ size_t m_captured = 0;
+ public:
+ Capturer( StringRef macroName, SourceLineInfo const& lineInfo, ResultWas::OfType resultType, StringRef names );
+
+ Capturer(Capturer const&) = delete;
+ Capturer& operator=(Capturer const&) = delete;
+
+ ~Capturer();
+
+ void captureValue( size_t index, std::string const& value );
+
+ template<typename T>
+ void captureValues( size_t index, T const& value ) {
+ captureValue( index, Catch::Detail::stringify( value ) );
+ }
+
+ template<typename T, typename... Ts>
+ void captureValues( size_t index, T const& value, Ts const&... values ) {
+ captureValue( index, Catch::Detail::stringify(value) );
+ captureValues( index+1, values... );
+ }
+ };
+
+} // end namespace Catch
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_MSG( macroName, messageType, resultDisposition, ... ) \
+ do { \
+ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::StringRef(), resultDisposition ); \
+ catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \
+ INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+ } while( false )
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_CAPTURE( varName, macroName, ... ) \
+ Catch::Capturer varName( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info, #__VA_ARGS__ ); \
+ varName.captureValues( 0, __VA_ARGS__ )
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_INFO( macroName, log ) \
+ Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log )
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_UNSCOPED_INFO( macroName, log ) \
+ Catch::getResultCapture().emplaceUnscopedMessage( Catch::MessageBuilder( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info ) << log )
+
+
+#if defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
+
+ #define CATCH_INFO( msg ) INTERNAL_CATCH_INFO( "CATCH_INFO", msg )
+ #define CATCH_UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "CATCH_UNSCOPED_INFO", msg )
+ #define CATCH_WARN( msg ) INTERNAL_CATCH_MSG( "CATCH_WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
+ #define CATCH_CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CATCH_CAPTURE", __VA_ARGS__ )
+
+#elif defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
+
+ #define CATCH_INFO( msg ) (void)(0)
+ #define CATCH_UNSCOPED_INFO( msg ) (void)(0)
+ #define CATCH_WARN( msg ) (void)(0)
+ #define CATCH_CAPTURE( ... ) (void)(0)
+
+#elif !defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
+
+ #define INFO( msg ) INTERNAL_CATCH_INFO( "INFO", msg )
+ #define UNSCOPED_INFO( msg ) INTERNAL_CATCH_UNSCOPED_INFO( "UNSCOPED_INFO", msg )
+ #define WARN( msg ) INTERNAL_CATCH_MSG( "WARN", Catch::ResultWas::Warning, Catch::ResultDisposition::ContinueOnFailure, msg )
+ #define CAPTURE( ... ) INTERNAL_CATCH_CAPTURE( INTERNAL_CATCH_UNIQUE_NAME(capturer), "CAPTURE", __VA_ARGS__ )
+
+#elif !defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
+
+ #define INFO( msg ) (void)(0)
+ #define UNSCOPED_INFO( msg ) (void)(0)
+ #define WARN( msg ) (void)(0)
+ #define CAPTURE( ... ) (void)(0)
+
+#endif // end of user facing macro declarations
+
+
+
+
+#endif // CATCH_MESSAGE_HPP_INCLUDED
+
+
+#ifndef CATCH_SESSION_HPP_INCLUDED
+#define CATCH_SESSION_HPP_INCLUDED
+
+
+
+#ifndef CATCH_COMMANDLINE_HPP_INCLUDED
+#define CATCH_COMMANDLINE_HPP_INCLUDED
+
+
+
+#ifndef CATCH_CLARA_HPP_INCLUDED
+#define CATCH_CLARA_HPP_INCLUDED
+
+#if defined( __clang__ )
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wweak-vtables"
+# pragma clang diagnostic ignored "-Wshadow"
+# pragma clang diagnostic ignored "-Wdeprecated"
+#endif
+
+#if defined( __GNUC__ )
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wsign-conversion"
+#endif
+
+#ifndef CLARA_CONFIG_OPTIONAL_TYPE
+# ifdef __has_include
+# if __has_include( <optional>) && __cplusplus >= 201703L
+# include <optional>
+# define CLARA_CONFIG_OPTIONAL_TYPE std::optional
+# endif
+# endif
+#endif
+
+
+#include <cassert>
+#include <memory>
+#include <ostream>
+#include <sstream>
+#include <string>
+#include <type_traits>
+#include <vector>
+
+namespace Catch {
+ namespace Clara {
+
+ class Args;
+ class Parser;
+
+ // enum of result types from a parse
+ enum class ParseResultType {
+ Matched,
+ NoMatch,
+ ShortCircuitAll,
+ ShortCircuitSame
+ };
+
+ struct accept_many_t {};
+ constexpr accept_many_t accept_many {};
+
+ namespace Detail {
+ struct fake_arg {
+ template <typename T>
+ operator T();
+ };
+
+ template <typename F, typename = void>
+ struct is_unary_function : std::false_type {};
+
+ template <typename F>
+ struct is_unary_function<
+ F,
+ Catch::Detail::void_t<decltype(
+ std::declval<F>()( fake_arg() ) )
+ >
+ > : std::true_type {};
+
+ // Traits for extracting arg and return type of lambdas (for single
+ // argument lambdas)
+ template <typename L>
+ struct UnaryLambdaTraits
+ : UnaryLambdaTraits<decltype( &L::operator() )> {};
+
+ template <typename ClassT, typename ReturnT, typename... Args>
+ struct UnaryLambdaTraits<ReturnT ( ClassT::* )( Args... ) const> {
+ static const bool isValid = false;
+ };
+
+ template <typename ClassT, typename ReturnT, typename ArgT>
+ struct UnaryLambdaTraits<ReturnT ( ClassT::* )( ArgT ) const> {
+ static const bool isValid = true;
+ using ArgType = std::remove_const_t<std::remove_reference_t<ArgT>>;
+ using ReturnType = ReturnT;
+ };
+
+ class TokenStream;
+
+ // Wraps a token coming from a token stream. These may not directly
+ // correspond to strings as a single string may encode an option +
+ // its argument if the : or = form is used
+ enum class TokenType { Option, Argument };
+ struct Token {
+ TokenType type;
+ std::string token;
+ };
+
+ // Abstracts iterators into args as a stream of tokens, with option
+ // arguments uniformly handled
+ class TokenStream {
+ using Iterator = std::vector<std::string>::const_iterator;
+ Iterator it;
+ Iterator itEnd;
+ std::vector<Token> m_tokenBuffer;
+
+ void loadBuffer();
+
+ public:
+ explicit TokenStream( Args const& args );
+ TokenStream( Iterator it, Iterator itEnd );
+
+ explicit operator bool() const {
+ return !m_tokenBuffer.empty() || it != itEnd;
+ }
+
+ size_t count() const {
+ return m_tokenBuffer.size() + ( itEnd - it );
+ }
+
+ Token operator*() const {
+ assert( !m_tokenBuffer.empty() );
+ return m_tokenBuffer.front();
+ }
+
+ Token const* operator->() const {
+ assert( !m_tokenBuffer.empty() );
+ return &m_tokenBuffer.front();
+ }
+
+ TokenStream& operator++();
+ };
+
+ //! Denotes type of a parsing result
+ enum class ResultType {
+ Ok, ///< No errors
+ LogicError, ///< Error in user-specified arguments for
+ ///< construction
+ RuntimeError ///< Error in parsing inputs
+ };
+
+ class ResultBase {
+ protected:
+ ResultBase( ResultType type ): m_type( type ) {}
+ virtual ~ResultBase(); // = default;
+
+
+ ResultBase(ResultBase const&) = default;
+ ResultBase& operator=(ResultBase const&) = default;
+ ResultBase(ResultBase&&) = default;
+ ResultBase& operator=(ResultBase&&) = default;
+
+ virtual void enforceOk() const = 0;
+
+ ResultType m_type;
+ };
+
+ template <typename T> class ResultValueBase : public ResultBase {
+ public:
+ auto value() const -> T const& {
+ enforceOk();
+ return m_value;
+ }
+
+ protected:
+ ResultValueBase( ResultType type ): ResultBase( type ) {}
+
+ ResultValueBase( ResultValueBase const& other ):
+ ResultBase( other ) {
+ if ( m_type == ResultType::Ok )
+ new ( &m_value ) T( other.m_value );
+ }
+
+ ResultValueBase( ResultType, T const& value ): ResultBase( ResultType::Ok ) {
+ new ( &m_value ) T( value );
+ }
+
+ auto operator=( ResultValueBase const& other )
+ -> ResultValueBase& {
+ if ( m_type == ResultType::Ok )
+ m_value.~T();
+ ResultBase::operator=( other );
+ if ( m_type == ResultType::Ok )
+ new ( &m_value ) T( other.m_value );
+ return *this;
+ }
+
+ ~ResultValueBase() override {
+ if ( m_type == ResultType::Ok )
+ m_value.~T();
+ }
+
+ union {
+ T m_value;
+ };
+ };
+
+ template <> class ResultValueBase<void> : public ResultBase {
+ protected:
+ using ResultBase::ResultBase;
+ };
+
+ template <typename T = void>
+ class BasicResult : public ResultValueBase<T> {
+ public:
+ template <typename U>
+ explicit BasicResult( BasicResult<U> const& other ):
+ ResultValueBase<T>( other.type() ),
+ m_errorMessage( other.errorMessage() ) {
+ assert( type() != ResultType::Ok );
+ }
+
+ template <typename U>
+ static auto ok( U const& value ) -> BasicResult {
+ return { ResultType::Ok, value };
+ }
+ static auto ok() -> BasicResult { return { ResultType::Ok }; }
+ static auto logicError( std::string&& message )
+ -> BasicResult {
+ return { ResultType::LogicError, CATCH_MOVE(message) };
+ }
+ static auto runtimeError( std::string&& message )
+ -> BasicResult {
+ return { ResultType::RuntimeError, CATCH_MOVE(message) };
+ }
+
+ explicit operator bool() const {
+ return m_type == ResultType::Ok;
+ }
+ auto type() const -> ResultType { return m_type; }
+ auto errorMessage() const -> std::string const& {
+ return m_errorMessage;
+ }
+
+ protected:
+ void enforceOk() const override {
+
+ // Errors shouldn't reach this point, but if they do
+ // the actual error message will be in m_errorMessage
+ assert( m_type != ResultType::LogicError );
+ assert( m_type != ResultType::RuntimeError );
+ if ( m_type != ResultType::Ok )
+ std::abort();
+ }
+
+ std::string
+ m_errorMessage; // Only populated if resultType is an error
+
+ BasicResult( ResultType type,
+ std::string&& message ):
+ ResultValueBase<T>( type ), m_errorMessage( CATCH_MOVE(message) ) {
+ assert( m_type != ResultType::Ok );
+ }
+
+ using ResultValueBase<T>::ResultValueBase;
+ using ResultBase::m_type;
+ };
+
+ class ParseState {
+ public:
+ ParseState( ParseResultType type,
+ TokenStream const& remainingTokens );
+
+ ParseResultType type() const { return m_type; }
+ TokenStream const& remainingTokens() const {
+ return m_remainingTokens;
+ }
+
+ private:
+ ParseResultType m_type;
+ TokenStream m_remainingTokens;
+ };
+
+ using Result = BasicResult<void>;
+ using ParserResult = BasicResult<ParseResultType>;
+ using InternalParseResult = BasicResult<ParseState>;
+
+ struct HelpColumns {
+ std::string left;
+ std::string right;
+ };
+
+ template <typename T>
+ ParserResult convertInto( std::string const& source, T& target ) {
+ std::stringstream ss( source );
+ ss >> target;
+ if ( ss.fail() ) {
+ return ParserResult::runtimeError(
+ "Unable to convert '" + source +
+ "' to destination type" );
+ } else {
+ return ParserResult::ok( ParseResultType::Matched );
+ }
+ }
+ ParserResult convertInto( std::string const& source,
+ std::string& target );
+ ParserResult convertInto( std::string const& source, bool& target );
+
+#ifdef CLARA_CONFIG_OPTIONAL_TYPE
+ template <typename T>
+ auto convertInto( std::string const& source,
+ CLARA_CONFIG_OPTIONAL_TYPE<T>& target )
+ -> ParserResult {
+ T temp;
+ auto result = convertInto( source, temp );
+ if ( result )
+ target = CATCH_MOVE( temp );
+ return result;
+ }
+#endif // CLARA_CONFIG_OPTIONAL_TYPE
+
+ struct BoundRef : Catch::Detail::NonCopyable {
+ virtual ~BoundRef() = default;
+ virtual bool isContainer() const;
+ virtual bool isFlag() const;
+ };
+ struct BoundValueRefBase : BoundRef {
+ virtual auto setValue( std::string const& arg )
+ -> ParserResult = 0;
+ };
+ struct BoundFlagRefBase : BoundRef {
+ virtual auto setFlag( bool flag ) -> ParserResult = 0;
+ bool isFlag() const override;
+ };
+
+ template <typename T> struct BoundValueRef : BoundValueRefBase {
+ T& m_ref;
+
+ explicit BoundValueRef( T& ref ): m_ref( ref ) {}
+
+ ParserResult setValue( std::string const& arg ) override {
+ return convertInto( arg, m_ref );
+ }
+ };
+
+ template <typename T>
+ struct BoundValueRef<std::vector<T>> : BoundValueRefBase {
+ std::vector<T>& m_ref;
+
+ explicit BoundValueRef( std::vector<T>& ref ): m_ref( ref ) {}
+
+ auto isContainer() const -> bool override { return true; }
+
+ auto setValue( std::string const& arg )
+ -> ParserResult override {
+ T temp;
+ auto result = convertInto( arg, temp );
+ if ( result )
+ m_ref.push_back( temp );
+ return result;
+ }
+ };
+
+ struct BoundFlagRef : BoundFlagRefBase {
+ bool& m_ref;
+
+ explicit BoundFlagRef( bool& ref ): m_ref( ref ) {}
+
+ ParserResult setFlag( bool flag ) override;
+ };
+
+ template <typename ReturnType> struct LambdaInvoker {
+ static_assert(
+ std::is_same<ReturnType, ParserResult>::value,
+ "Lambda must return void or clara::ParserResult" );
+
+ template <typename L, typename ArgType>
+ static auto invoke( L const& lambda, ArgType const& arg )
+ -> ParserResult {
+ return lambda( arg );
+ }
+ };
+
+ template <> struct LambdaInvoker<void> {
+ template <typename L, typename ArgType>
+ static auto invoke( L const& lambda, ArgType const& arg )
+ -> ParserResult {
+ lambda( arg );
+ return ParserResult::ok( ParseResultType::Matched );
+ }
+ };
+
+ template <typename ArgType, typename L>
+ auto invokeLambda( L const& lambda, std::string const& arg )
+ -> ParserResult {
+ ArgType temp{};
+ auto result = convertInto( arg, temp );
+ return !result ? result
+ : LambdaInvoker<typename UnaryLambdaTraits<
+ L>::ReturnType>::invoke( lambda, temp );
+ }
+
+ template <typename L> struct BoundLambda : BoundValueRefBase {
+ L m_lambda;
+
+ static_assert(
+ UnaryLambdaTraits<L>::isValid,
+ "Supplied lambda must take exactly one argument" );
+ explicit BoundLambda( L const& lambda ): m_lambda( lambda ) {}
+
+ auto setValue( std::string const& arg )
+ -> ParserResult override {
+ return invokeLambda<typename UnaryLambdaTraits<L>::ArgType>(
+ m_lambda, arg );
+ }
+ };
+
+ template <typename L> struct BoundManyLambda : BoundLambda<L> {
+ explicit BoundManyLambda( L const& lambda ): BoundLambda<L>( lambda ) {}
+ bool isContainer() const override { return true; }
+ };
+
+ template <typename L> struct BoundFlagLambda : BoundFlagRefBase {
+ L m_lambda;
+
+ static_assert(
+ UnaryLambdaTraits<L>::isValid,
+ "Supplied lambda must take exactly one argument" );
+ static_assert(
+ std::is_same<typename UnaryLambdaTraits<L>::ArgType,
+ bool>::value,
+ "flags must be boolean" );
+
+ explicit BoundFlagLambda( L const& lambda ):
+ m_lambda( lambda ) {}
+
+ auto setFlag( bool flag ) -> ParserResult override {
+ return LambdaInvoker<typename UnaryLambdaTraits<
+ L>::ReturnType>::invoke( m_lambda, flag );
+ }
+ };
+
+ enum class Optionality { Optional, Required };
+
+ class ParserBase {
+ public:
+ virtual ~ParserBase() = default;
+ virtual auto validate() const -> Result { return Result::ok(); }
+ virtual auto parse( std::string const& exeName,
+ TokenStream const& tokens ) const
+ -> InternalParseResult = 0;
+ virtual size_t cardinality() const;
+
+ InternalParseResult parse( Args const& args ) const;
+ };
+
+ template <typename DerivedT>
+ class ComposableParserImpl : public ParserBase {
+ public:
+ template <typename T>
+ auto operator|( T const& other ) const -> Parser;
+ };
+
+ // Common code and state for Args and Opts
+ template <typename DerivedT>
+ class ParserRefImpl : public ComposableParserImpl<DerivedT> {
+ protected:
+ Optionality m_optionality = Optionality::Optional;
+ std::shared_ptr<BoundRef> m_ref;
+ std::string m_hint;
+ std::string m_description;
+
+ explicit ParserRefImpl( std::shared_ptr<BoundRef> const& ref ):
+ m_ref( ref ) {}
+
+ public:
+ template <typename LambdaT>
+ ParserRefImpl( accept_many_t,
+ LambdaT const& ref,
+ std::string const& hint ):
+ m_ref( std::make_shared<BoundManyLambda<LambdaT>>( ref ) ),
+ m_hint( hint ) {}
+
+ template <typename T,
+ typename = typename std::enable_if_t<
+ !Detail::is_unary_function<T>::value>>
+ ParserRefImpl( T& ref, std::string const& hint ):
+ m_ref( std::make_shared<BoundValueRef<T>>( ref ) ),
+ m_hint( hint ) {}
+
+ template <typename LambdaT,
+ typename = typename std::enable_if_t<
+ Detail::is_unary_function<LambdaT>::value>>
+ ParserRefImpl( LambdaT const& ref, std::string const& hint ):
+ m_ref( std::make_shared<BoundLambda<LambdaT>>( ref ) ),
+ m_hint( hint ) {}
+
+ auto operator()( std::string const& description ) -> DerivedT& {
+ m_description = description;
+ return static_cast<DerivedT&>( *this );
+ }
+
+ auto optional() -> DerivedT& {
+ m_optionality = Optionality::Optional;
+ return static_cast<DerivedT&>( *this );
+ }
+
+ auto required() -> DerivedT& {
+ m_optionality = Optionality::Required;
+ return static_cast<DerivedT&>( *this );
+ }
+
+ auto isOptional() const -> bool {
+ return m_optionality == Optionality::Optional;
+ }
+
+ auto cardinality() const -> size_t override {
+ if ( m_ref->isContainer() )
+ return 0;
+ else
+ return 1;
+ }
+
+ std::string const& hint() const { return m_hint; }
+ };
+
+ } // namespace detail
+
+
+ // A parser for arguments
+ class Arg : public Detail::ParserRefImpl<Arg> {
+ public:
+ using ParserRefImpl::ParserRefImpl;
+ using ParserBase::parse;
+
+ Detail::InternalParseResult
+ parse(std::string const&,
+ Detail::TokenStream const& tokens) const override;
+ };
+
+ // A parser for options
+ class Opt : public Detail::ParserRefImpl<Opt> {
+ protected:
+ std::vector<std::string> m_optNames;
+
+ public:
+ template <typename LambdaT>
+ explicit Opt(LambdaT const& ref) :
+ ParserRefImpl(
+ std::make_shared<Detail::BoundFlagLambda<LambdaT>>(ref)) {}
+
+ explicit Opt(bool& ref);
+
+ template <typename LambdaT,
+ typename = typename std::enable_if_t<
+ Detail::is_unary_function<LambdaT>::value>>
+ Opt( LambdaT const& ref, std::string const& hint ):
+ ParserRefImpl( ref, hint ) {}
+
+ template <typename LambdaT>
+ Opt( accept_many_t, LambdaT const& ref, std::string const& hint ):
+ ParserRefImpl( accept_many, ref, hint ) {}
+
+ template <typename T,
+ typename = typename std::enable_if_t<
+ !Detail::is_unary_function<T>::value>>
+ Opt( T& ref, std::string const& hint ):
+ ParserRefImpl( ref, hint ) {}
+
+ auto operator[](std::string const& optName) -> Opt& {
+ m_optNames.push_back(optName);
+ return *this;
+ }
+
+ std::vector<Detail::HelpColumns> getHelpColumns() const;
+
+ bool isMatch(std::string const& optToken) const;
+
+ using ParserBase::parse;
+
+ Detail::InternalParseResult
+ parse(std::string const&,
+ Detail::TokenStream const& tokens) const override;
+
+ Detail::Result validate() const override;
+ };
+
+ // Specifies the name of the executable
+ class ExeName : public Detail::ComposableParserImpl<ExeName> {
+ std::shared_ptr<std::string> m_name;
+ std::shared_ptr<Detail::BoundValueRefBase> m_ref;
+
+ public:
+ ExeName();
+ explicit ExeName(std::string& ref);
+
+ template <typename LambdaT>
+ explicit ExeName(LambdaT const& lambda) : ExeName() {
+ m_ref = std::make_shared<Detail::BoundLambda<LambdaT>>(lambda);
+ }
+
+ // The exe name is not parsed out of the normal tokens, but is
+ // handled specially
+ Detail::InternalParseResult
+ parse(std::string const&,
+ Detail::TokenStream const& tokens) const override;
+
+ std::string const& name() const { return *m_name; }
+ Detail::ParserResult set(std::string const& newName);
+ };
+
+
+ // A Combined parser
+ class Parser : Detail::ParserBase {
+ mutable ExeName m_exeName;
+ std::vector<Opt> m_options;
+ std::vector<Arg> m_args;
+
+ public:
+
+ auto operator|=(ExeName const& exeName) -> Parser& {
+ m_exeName = exeName;
+ return *this;
+ }
+
+ auto operator|=(Arg const& arg) -> Parser& {
+ m_args.push_back(arg);
+ return *this;
+ }
+
+ auto operator|=(Opt const& opt) -> Parser& {
+ m_options.push_back(opt);
+ return *this;
+ }
+
+ Parser& operator|=(Parser const& other);
+
+ template <typename T>
+ auto operator|(T const& other) const -> Parser {
+ return Parser(*this) |= other;
+ }
+
+ std::vector<Detail::HelpColumns> getHelpColumns() const;
+
+ void writeToStream(std::ostream& os) const;
+
+ friend auto operator<<(std::ostream& os, Parser const& parser)
+ -> std::ostream& {
+ parser.writeToStream(os);
+ return os;
+ }
+
+ Detail::Result validate() const override;
+
+ using ParserBase::parse;
+ Detail::InternalParseResult
+ parse(std::string const& exeName,
+ Detail::TokenStream const& tokens) const override;
+ };
+
+ // Transport for raw args (copied from main args, or supplied via
+ // init list for testing)
+ class Args {
+ friend Detail::TokenStream;
+ std::string m_exeName;
+ std::vector<std::string> m_args;
+
+ public:
+ Args(int argc, char const* const* argv);
+ Args(std::initializer_list<std::string> args);
+
+ std::string const& exeName() const { return m_exeName; }
+ };
+
+
+ // Convenience wrapper for option parser that specifies the help option
+ struct Help : Opt {
+ Help(bool& showHelpFlag);
+ };
+
+ // Result type for parser operation
+ using Detail::ParserResult;
+
+ namespace Detail {
+ template <typename DerivedT>
+ template <typename T>
+ Parser
+ ComposableParserImpl<DerivedT>::operator|(T const& other) const {
+ return Parser() | static_cast<DerivedT const&>(*this) | other;
+ }
+ }
+
+ } // namespace Clara
+} // namespace Catch
+
+#if defined( __clang__ )
+# pragma clang diagnostic pop
+#endif
+
+#if defined( __GNUC__ )
+# pragma GCC diagnostic pop
+#endif
+
+#endif // CATCH_CLARA_HPP_INCLUDED
+
+namespace Catch {
+
+ struct ConfigData;
+
+ Clara::Parser makeCommandLineParser( ConfigData& config );
+
+} // end namespace Catch
+
+#endif // CATCH_COMMANDLINE_HPP_INCLUDED
+
+namespace Catch {
+
+ class Session : Detail::NonCopyable {
+ public:
+
+ Session();
+ ~Session();
+
+ void showHelp() const;
+ void libIdentify();
+
+ int applyCommandLine( int argc, char const * const * argv );
+ #if defined(CATCH_CONFIG_WCHAR) && defined(_WIN32) && defined(UNICODE)
+ int applyCommandLine( int argc, wchar_t const * const * argv );
+ #endif
+
+ void useConfigData( ConfigData const& configData );
+
+ template<typename CharT>
+ int run(int argc, CharT const * const argv[]) {
+ if (m_startupExceptions)
+ return 1;
+ int returnCode = applyCommandLine(argc, argv);
+ if (returnCode == 0)
+ returnCode = run();
+ return returnCode;
+ }
+
+ int run();
+
+ Clara::Parser const& cli() const;
+ void cli( Clara::Parser const& newParser );
+ ConfigData& configData();
+ Config& config();
+ private:
+ int runInternal();
+
+ Clara::Parser m_cli;
+ ConfigData m_configData;
+ Detail::unique_ptr<Config> m_config;
+ bool m_startupExceptions = false;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_SESSION_HPP_INCLUDED
+
+
+#ifndef CATCH_TAG_ALIAS_HPP_INCLUDED
+#define CATCH_TAG_ALIAS_HPP_INCLUDED
+
+
+#include <string>
+
+namespace Catch {
+
+ struct TagAlias {
+ TagAlias(std::string const& _tag, SourceLineInfo _lineInfo):
+ tag(_tag),
+ lineInfo(_lineInfo)
+ {}
+
+ std::string tag;
+ SourceLineInfo lineInfo;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_TAG_ALIAS_HPP_INCLUDED
+
+
+#ifndef CATCH_TAG_ALIAS_AUTOREGISTRAR_HPP_INCLUDED
+#define CATCH_TAG_ALIAS_AUTOREGISTRAR_HPP_INCLUDED
+
+
+namespace Catch {
+
+ struct RegistrarForTagAliases {
+ RegistrarForTagAliases( char const* alias, char const* tag, SourceLineInfo const& lineInfo );
+ };
+
+} // end namespace Catch
+
+#define CATCH_REGISTER_TAG_ALIAS( alias, spec ) \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ namespace{ Catch::RegistrarForTagAliases INTERNAL_CATCH_UNIQUE_NAME( AutoRegisterTagAlias )( alias, spec, CATCH_INTERNAL_LINEINFO ); } \
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
+
+#endif // CATCH_TAG_ALIAS_AUTOREGISTRAR_HPP_INCLUDED
+
+
+#ifndef CATCH_TEMPLATE_TEST_MACROS_HPP_INCLUDED
+#define CATCH_TEMPLATE_TEST_MACROS_HPP_INCLUDED
+
+// We need this suppression to leak, because it took until GCC 10
+// for the front end to handle local suppression via _Pragma properly
+// inside templates (so `TEMPLATE_TEST_CASE` and co).
+// **THIS IS DIFFERENT FOR STANDARD TESTS, WHERE GCC 9 IS SUFFICIENT**
+#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && __GNUC__ < 10
+#pragma GCC diagnostic ignored "-Wparentheses"
+#endif
+
+
+
+
+#ifndef CATCH_TEST_MACROS_HPP_INCLUDED
+#define CATCH_TEST_MACROS_HPP_INCLUDED
+
+
+
+#ifndef CATCH_TEST_MACRO_IMPL_HPP_INCLUDED
+#define CATCH_TEST_MACRO_IMPL_HPP_INCLUDED
+
+
+
+#ifndef CATCH_ASSERTION_HANDLER_HPP_INCLUDED
+#define CATCH_ASSERTION_HANDLER_HPP_INCLUDED
+
+
+
+#ifndef CATCH_DECOMPOSER_HPP_INCLUDED
+#define CATCH_DECOMPOSER_HPP_INCLUDED
+
+
+#include <iosfwd>
+
+#ifdef _MSC_VER
+#pragma warning(push)
+#pragma warning(disable:4389) // '==' : signed/unsigned mismatch
+#pragma warning(disable:4018) // more "signed/unsigned mismatch"
+#pragma warning(disable:4312) // Converting int to T* using reinterpret_cast (issue on x64 platform)
+#pragma warning(disable:4180) // qualifier applied to function type has no meaning
+#pragma warning(disable:4800) // Forcing result to true or false
+#endif
+
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wsign-compare"
+#elif defined __GNUC__
+# pragma GCC diagnostic push
+# pragma GCC diagnostic ignored "-Wsign-compare"
+#endif
+
+namespace Catch {
+
+ class ITransientExpression {
+ bool m_isBinaryExpression;
+ bool m_result;
+
+ public:
+ auto isBinaryExpression() const -> bool { return m_isBinaryExpression; }
+ auto getResult() const -> bool { return m_result; }
+ virtual void streamReconstructedExpression( std::ostream &os ) const = 0;
+
+ ITransientExpression( bool isBinaryExpression, bool result )
+ : m_isBinaryExpression( isBinaryExpression ),
+ m_result( result )
+ {}
+
+ ITransientExpression() = default;
+ ITransientExpression(ITransientExpression const&) = default;
+ ITransientExpression& operator=(ITransientExpression const&) = default;
+
+ // We don't actually need a virtual destructor, but many static analysers
+ // complain if it's not here :-(
+ virtual ~ITransientExpression(); // = default;
+
+ friend std::ostream& operator<<(std::ostream& out, ITransientExpression const& expr) {
+ expr.streamReconstructedExpression(out);
+ return out;
+ }
+ };
+
+ void formatReconstructedExpression( std::ostream &os, std::string const& lhs, StringRef op, std::string const& rhs );
+
+ template<typename LhsT, typename RhsT>
+ class BinaryExpr : public ITransientExpression {
+ LhsT m_lhs;
+ StringRef m_op;
+ RhsT m_rhs;
+
+ void streamReconstructedExpression( std::ostream &os ) const override {
+ formatReconstructedExpression
+ ( os, Catch::Detail::stringify( m_lhs ), m_op, Catch::Detail::stringify( m_rhs ) );
+ }
+
+ public:
+ BinaryExpr( bool comparisonResult, LhsT lhs, StringRef op, RhsT rhs )
+ : ITransientExpression{ true, comparisonResult },
+ m_lhs( lhs ),
+ m_op( op ),
+ m_rhs( rhs )
+ {}
+
+ template<typename T>
+ auto operator && ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
+ static_assert(always_false<T>::value,
+ "chained comparisons are not supported inside assertions, "
+ "wrap the expression inside parentheses, or decompose it");
+ }
+
+ template<typename T>
+ auto operator || ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
+ static_assert(always_false<T>::value,
+ "chained comparisons are not supported inside assertions, "
+ "wrap the expression inside parentheses, or decompose it");
+ }
+
+ template<typename T>
+ auto operator == ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
+ static_assert(always_false<T>::value,
+ "chained comparisons are not supported inside assertions, "
+ "wrap the expression inside parentheses, or decompose it");
+ }
+
+ template<typename T>
+ auto operator != ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
+ static_assert(always_false<T>::value,
+ "chained comparisons are not supported inside assertions, "
+ "wrap the expression inside parentheses, or decompose it");
+ }
+
+ template<typename T>
+ auto operator > ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
+ static_assert(always_false<T>::value,
+ "chained comparisons are not supported inside assertions, "
+ "wrap the expression inside parentheses, or decompose it");
+ }
+
+ template<typename T>
+ auto operator < ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
+ static_assert(always_false<T>::value,
+ "chained comparisons are not supported inside assertions, "
+ "wrap the expression inside parentheses, or decompose it");
+ }
+
+ template<typename T>
+ auto operator >= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
+ static_assert(always_false<T>::value,
+ "chained comparisons are not supported inside assertions, "
+ "wrap the expression inside parentheses, or decompose it");
+ }
+
+ template<typename T>
+ auto operator <= ( T ) const -> BinaryExpr<LhsT, RhsT const&> const {
+ static_assert(always_false<T>::value,
+ "chained comparisons are not supported inside assertions, "
+ "wrap the expression inside parentheses, or decompose it");
+ }
+ };
+
+ template<typename LhsT>
+ class UnaryExpr : public ITransientExpression {
+ LhsT m_lhs;
+
+ void streamReconstructedExpression( std::ostream &os ) const override {
+ os << Catch::Detail::stringify( m_lhs );
+ }
+
+ public:
+ explicit UnaryExpr( LhsT lhs )
+ : ITransientExpression{ false, static_cast<bool>(lhs) },
+ m_lhs( lhs )
+ {}
+ };
+
+
+ // Specialised comparison functions to handle equality comparisons between ints and pointers (NULL deduces as an int)
+ template<typename LhsT, typename RhsT>
+ auto compareEqual( LhsT const& lhs, RhsT const& rhs ) -> bool { return static_cast<bool>(lhs == rhs); }
+ template<typename T>
+ auto compareEqual( T* const& lhs, int rhs ) -> bool { return lhs == reinterpret_cast<void const*>( rhs ); }
+ template<typename T>
+ auto compareEqual( T* const& lhs, long rhs ) -> bool { return lhs == reinterpret_cast<void const*>( rhs ); }
+ template<typename T>
+ auto compareEqual( int lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) == rhs; }
+ template<typename T>
+ auto compareEqual( long lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) == rhs; }
+
+ template<typename LhsT, typename RhsT>
+ auto compareNotEqual( LhsT const& lhs, RhsT&& rhs ) -> bool { return static_cast<bool>(lhs != rhs); }
+ template<typename T>
+ auto compareNotEqual( T* const& lhs, int rhs ) -> bool { return lhs != reinterpret_cast<void const*>( rhs ); }
+ template<typename T>
+ auto compareNotEqual( T* const& lhs, long rhs ) -> bool { return lhs != reinterpret_cast<void const*>( rhs ); }
+ template<typename T>
+ auto compareNotEqual( int lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) != rhs; }
+ template<typename T>
+ auto compareNotEqual( long lhs, T* const& rhs ) -> bool { return reinterpret_cast<void const*>( lhs ) != rhs; }
+
+
+ template<typename LhsT>
+ class ExprLhs {
+ LhsT m_lhs;
+ public:
+ explicit ExprLhs( LhsT lhs ) : m_lhs( lhs ) {}
+
+ template<typename RhsT, std::enable_if_t<!std::is_arithmetic<std::remove_reference_t<RhsT>>::value, int> = 0>
+ friend auto operator == ( ExprLhs && lhs, RhsT && rhs ) -> BinaryExpr<LhsT, RhsT const&> {
+ return { compareEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "=="_sr, rhs };
+ }
+ template<typename RhsT, std::enable_if_t<std::is_arithmetic<RhsT>::value, int> = 0>
+ friend auto operator == ( ExprLhs && lhs, RhsT rhs ) -> BinaryExpr<LhsT, RhsT> {
+ return { compareEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "=="_sr, rhs };
+ }
+
+ template<typename RhsT, std::enable_if_t<!std::is_arithmetic<std::remove_reference_t<RhsT>>::value, int> = 0>
+ friend auto operator != ( ExprLhs && lhs, RhsT && rhs ) -> BinaryExpr<LhsT, RhsT const&> {
+ return { compareNotEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "!="_sr, rhs };
+ }
+ template<typename RhsT, std::enable_if_t<std::is_arithmetic<RhsT>::value, int> = 0>
+ friend auto operator != ( ExprLhs && lhs, RhsT rhs ) -> BinaryExpr<LhsT, RhsT> {
+ return { compareNotEqual( lhs.m_lhs, rhs ), lhs.m_lhs, "!="_sr, rhs };
+ }
+
+ #define CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(op) \
+ template<typename RhsT, std::enable_if_t<!std::is_arithmetic<std::remove_reference_t<RhsT>>::value, int> = 0> \
+ friend auto operator op ( ExprLhs && lhs, RhsT && rhs ) -> BinaryExpr<LhsT, RhsT const&> { \
+ return { static_cast<bool>(lhs.m_lhs op rhs), lhs.m_lhs, #op##_sr, rhs }; \
+ } \
+ template<typename RhsT, std::enable_if_t<std::is_arithmetic<RhsT>::value, int> = 0> \
+ friend auto operator op ( ExprLhs && lhs, RhsT rhs ) -> BinaryExpr<LhsT, RhsT> { \
+ return { static_cast<bool>(lhs.m_lhs op rhs), lhs.m_lhs, #op##_sr, rhs }; \
+ }
+
+ CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(<)
+ CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(>)
+ CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(<=)
+ CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(>=)
+ CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(|)
+ CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(&)
+ CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR(^)
+
+ #undef CATCH_INTERNAL_DEFINE_EXPRESSION_OPERATOR
+
+ template<typename RhsT>
+ friend auto operator && ( ExprLhs &&, RhsT && ) -> BinaryExpr<LhsT, RhsT const&> {
+ static_assert(always_false<RhsT>::value,
+ "operator&& is not supported inside assertions, "
+ "wrap the expression inside parentheses, or decompose it");
+ }
+
+ template<typename RhsT>
+ friend auto operator || ( ExprLhs &&, RhsT && ) -> BinaryExpr<LhsT, RhsT const&> {
+ static_assert(always_false<RhsT>::value,
+ "operator|| is not supported inside assertions, "
+ "wrap the expression inside parentheses, or decompose it");
+ }
+
+ auto makeUnaryExpr() const -> UnaryExpr<LhsT> {
+ return UnaryExpr<LhsT>{ m_lhs };
+ }
+ };
+
+ struct Decomposer {
+ template<typename T, std::enable_if_t<!std::is_arithmetic<std::remove_reference_t<T>>::value, int> = 0>
+ friend auto operator <= ( Decomposer &&, T && lhs ) -> ExprLhs<T const&> {
+ return ExprLhs<const T&>{ lhs };
+ }
+
+ template<typename T, std::enable_if_t<std::is_arithmetic<T>::value, int> = 0>
+ friend auto operator <= ( Decomposer &&, T value ) -> ExprLhs<T> {
+ return ExprLhs<T>{ value };
+ }
+ };
+
+} // end namespace Catch
+
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif
+#ifdef __clang__
+# pragma clang diagnostic pop
+#elif defined __GNUC__
+# pragma GCC diagnostic pop
+#endif
+
+#endif // CATCH_DECOMPOSER_HPP_INCLUDED
+
+#include <string>
+
+namespace Catch {
+
+ class IResultCapture;
+
+ struct AssertionReaction {
+ bool shouldDebugBreak = false;
+ bool shouldThrow = false;
+ };
+
+ class AssertionHandler {
+ AssertionInfo m_assertionInfo;
+ AssertionReaction m_reaction;
+ bool m_completed = false;
+ IResultCapture& m_resultCapture;
+
+ public:
+ AssertionHandler
+ ( StringRef macroName,
+ SourceLineInfo const& lineInfo,
+ StringRef capturedExpression,
+ ResultDisposition::Flags resultDisposition );
+ ~AssertionHandler() {
+ if ( !m_completed ) {
+ m_resultCapture.handleIncomplete( m_assertionInfo );
+ }
+ }
+
+
+ template<typename T>
+ void handleExpr( ExprLhs<T> const& expr ) {
+ handleExpr( expr.makeUnaryExpr() );
+ }
+ void handleExpr( ITransientExpression const& expr );
+
+ void handleMessage(ResultWas::OfType resultType, StringRef message);
+
+ void handleExceptionThrownAsExpected();
+ void handleUnexpectedExceptionNotThrown();
+ void handleExceptionNotThrownAsExpected();
+ void handleThrowingCallSkipped();
+ void handleUnexpectedInflightException();
+
+ void complete();
+ void setCompleted();
+
+ // query
+ auto allowThrows() const -> bool;
+ };
+
+ void handleExceptionMatchExpr( AssertionHandler& handler, std::string const& str, StringRef matcherString );
+
+} // namespace Catch
+
+#endif // CATCH_ASSERTION_HANDLER_HPP_INCLUDED
+
+// We need this suppression to leak, because it took until GCC 10
+// for the front end to handle local suppression via _Pragma properly
+#if defined(__GNUC__) && !defined(__clang__) && !defined(__ICC) && __GNUC__ <= 9
+ #pragma GCC diagnostic ignored "-Wparentheses"
+#endif
+
+#if !defined(CATCH_CONFIG_DISABLE)
+
+#if !defined(CATCH_CONFIG_DISABLE_STRINGIFICATION)
+ #define CATCH_INTERNAL_STRINGIFY(...) #__VA_ARGS__
+#else
+ #define CATCH_INTERNAL_STRINGIFY(...) "Disabled by CATCH_CONFIG_DISABLE_STRINGIFICATION"
+#endif
+
+#if defined(CATCH_CONFIG_FAST_COMPILE) || defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+
+///////////////////////////////////////////////////////////////////////////////
+// Another way to speed-up compilation is to omit local try-catch for REQUIRE*
+// macros.
+#define INTERNAL_CATCH_TRY
+#define INTERNAL_CATCH_CATCH( capturer )
+
+#else // CATCH_CONFIG_FAST_COMPILE
+
+#define INTERNAL_CATCH_TRY try
+#define INTERNAL_CATCH_CATCH( handler ) catch(...) { handler.handleUnexpectedInflightException(); }
+
+#endif
+
+#define INTERNAL_CATCH_REACT( handler ) handler.complete();
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_TEST( macroName, resultDisposition, ... ) \
+ do { /* NOLINT(bugprone-infinite-loop) */ \
+ /* The expression should not be evaluated, but warnings should hopefully be checked */ \
+ CATCH_INTERNAL_IGNORE_BUT_WARN(__VA_ARGS__); \
+ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
+ INTERNAL_CATCH_TRY { \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
+ catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
+ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
+ INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+ } while( (void)0, (false) && static_cast<const bool&>( !!(__VA_ARGS__) ) ) // the expression here is never evaluated at runtime but it forces the compiler to give it a look
+ // The double negation silences MSVC's C4800 warning, the static_cast forces short-circuit evaluation if the type has overloaded &&.
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_IF( macroName, resultDisposition, ... ) \
+ INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
+ if( Catch::getResultCapture().lastAssertionPassed() )
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_ELSE( macroName, resultDisposition, ... ) \
+ INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
+ if( !Catch::getResultCapture().lastAssertionPassed() )
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_NO_THROW( macroName, resultDisposition, ... ) \
+ do { \
+ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition ); \
+ try { \
+ static_cast<void>(__VA_ARGS__); \
+ catchAssertionHandler.handleExceptionNotThrownAsExpected(); \
+ } \
+ catch( ... ) { \
+ catchAssertionHandler.handleUnexpectedInflightException(); \
+ } \
+ INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+ } while( false )
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_THROWS( macroName, resultDisposition, ... ) \
+ do { \
+ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__), resultDisposition); \
+ if( catchAssertionHandler.allowThrows() ) \
+ try { \
+ static_cast<void>(__VA_ARGS__); \
+ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
+ } \
+ catch( ... ) { \
+ catchAssertionHandler.handleExceptionThrownAsExpected(); \
+ } \
+ else \
+ catchAssertionHandler.handleThrowingCallSkipped(); \
+ INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+ } while( false )
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_THROWS_AS( macroName, exceptionType, resultDisposition, expr ) \
+ do { \
+ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(expr) ", " CATCH_INTERNAL_STRINGIFY(exceptionType), resultDisposition ); \
+ if( catchAssertionHandler.allowThrows() ) \
+ try { \
+ static_cast<void>(expr); \
+ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
+ } \
+ catch( exceptionType const& ) { \
+ catchAssertionHandler.handleExceptionThrownAsExpected(); \
+ } \
+ catch( ... ) { \
+ catchAssertionHandler.handleUnexpectedInflightException(); \
+ } \
+ else \
+ catchAssertionHandler.handleThrowingCallSkipped(); \
+ INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+ } while( false )
+
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Although this is matcher-based, it can be used with just a string
+#define INTERNAL_CATCH_THROWS_STR_MATCHES( macroName, resultDisposition, matcher, ... ) \
+ do { \
+ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
+ if( catchAssertionHandler.allowThrows() ) \
+ try { \
+ static_cast<void>(__VA_ARGS__); \
+ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
+ } \
+ catch( ... ) { \
+ Catch::handleExceptionMatchExpr( catchAssertionHandler, matcher, #matcher##_catch_sr ); \
+ } \
+ else \
+ catchAssertionHandler.handleThrowingCallSkipped(); \
+ INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+ } while( false )
+
+#endif // CATCH_CONFIG_DISABLE
+
+#endif // CATCH_TEST_MACRO_IMPL_HPP_INCLUDED
+
+
+#ifndef CATCH_SECTION_HPP_INCLUDED
+#define CATCH_SECTION_HPP_INCLUDED
+
+
+
+#ifndef CATCH_TIMER_HPP_INCLUDED
+#define CATCH_TIMER_HPP_INCLUDED
+
+#include <cstdint>
+
+namespace Catch {
+
+ class Timer {
+ uint64_t m_nanoseconds = 0;
+ public:
+ void start();
+ auto getElapsedNanoseconds() const -> uint64_t;
+ auto getElapsedMicroseconds() const -> uint64_t;
+ auto getElapsedMilliseconds() const -> unsigned int;
+ auto getElapsedSeconds() const -> double;
+ };
+
+} // namespace Catch
+
+#endif // CATCH_TIMER_HPP_INCLUDED
+
+namespace Catch {
+
+ class Section : Detail::NonCopyable {
+ public:
+ Section( SectionInfo&& info );
+ ~Section();
+
+ // This indicates whether the section should be executed or not
+ explicit operator bool() const;
+
+ private:
+ SectionInfo m_info;
+
+ Counts m_assertions;
+ bool m_sectionIncluded;
+ Timer m_timer;
+ };
+
+} // end namespace Catch
+
+#define INTERNAL_CATCH_SECTION( ... ) \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, __VA_ARGS__ ) ) \
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
+
+#define INTERNAL_CATCH_DYNAMIC_SECTION( ... ) \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ if( Catch::Section const& INTERNAL_CATCH_UNIQUE_NAME( catch_internal_Section ) = Catch::SectionInfo( CATCH_INTERNAL_LINEINFO, (Catch::ReusableStringStream() << __VA_ARGS__).str() ) ) \
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
+
+#endif // CATCH_SECTION_HPP_INCLUDED
+
+
+#ifndef CATCH_TEST_REGISTRY_HPP_INCLUDED
+#define CATCH_TEST_REGISTRY_HPP_INCLUDED
+
+
+
+#ifndef CATCH_INTERFACES_TESTCASE_HPP_INCLUDED
+#define CATCH_INTERFACES_TESTCASE_HPP_INCLUDED
+
+#include <vector>
+
+namespace Catch {
+
+ class TestSpec;
+ struct TestCaseInfo;
+
+ class ITestInvoker {
+ public:
+ virtual void invoke () const = 0;
+ virtual ~ITestInvoker(); // = default
+ };
+
+ class TestCaseHandle;
+ class IConfig;
+
+ class ITestCaseRegistry {
+ public:
+ virtual ~ITestCaseRegistry(); // = default
+ // TODO: this exists only for adding filenames to test cases -- let's expose this in a saner way later
+ virtual std::vector<TestCaseInfo* > const& getAllInfos() const = 0;
+ virtual std::vector<TestCaseHandle> const& getAllTests() const = 0;
+ virtual std::vector<TestCaseHandle> const& getAllTestsSorted( IConfig const& config ) const = 0;
+ };
+
+ bool isThrowSafe( TestCaseHandle const& testCase, IConfig const& config );
+ bool matchTest( TestCaseHandle const& testCase, TestSpec const& testSpec, IConfig const& config );
+ std::vector<TestCaseHandle> filterTests( std::vector<TestCaseHandle> const& testCases, TestSpec const& testSpec, IConfig const& config );
+ std::vector<TestCaseHandle> const& getAllTestCasesSorted( IConfig const& config );
+
+}
+
+#endif // CATCH_INTERFACES_TESTCASE_HPP_INCLUDED
+
+
+#ifndef CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED
+#define CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED
+
+#define INTERNAL_CATCH_EXPAND1( param ) INTERNAL_CATCH_EXPAND2( param )
+#define INTERNAL_CATCH_EXPAND2( ... ) INTERNAL_CATCH_NO##__VA_ARGS__
+#define INTERNAL_CATCH_DEF( ... ) INTERNAL_CATCH_DEF __VA_ARGS__
+#define INTERNAL_CATCH_NOINTERNAL_CATCH_DEF
+
+#define INTERNAL_CATCH_REMOVE_PARENS( ... ) \
+ INTERNAL_CATCH_EXPAND1( INTERNAL_CATCH_DEF __VA_ARGS__ )
+
+#endif // CATCH_PREPROCESSOR_REMOVE_PARENS_HPP_INCLUDED
+
+// GCC 5 and older do not properly handle disabling unused-variable warning
+// with a _Pragma. This means that we have to leak the suppression to the
+// user code as well :-(
+#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 5
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#endif
+
+
+
+namespace Catch {
+
+template<typename C>
+class TestInvokerAsMethod : public ITestInvoker {
+ void (C::*m_testAsMethod)();
+public:
+ TestInvokerAsMethod( void (C::*testAsMethod)() ) noexcept : m_testAsMethod( testAsMethod ) {}
+
+ void invoke() const override {
+ C obj;
+ (obj.*m_testAsMethod)();
+ }
+};
+
+Detail::unique_ptr<ITestInvoker> makeTestInvoker( void(*testAsFunction)() );
+
+template<typename C>
+Detail::unique_ptr<ITestInvoker> makeTestInvoker( void (C::*testAsMethod)() ) {
+ return Detail::make_unique<TestInvokerAsMethod<C>>( testAsMethod );
+}
+
+struct NameAndTags {
+ constexpr NameAndTags( StringRef name_ = StringRef(),
+ StringRef tags_ = StringRef() ) noexcept:
+ name( name_ ), tags( tags_ ) {}
+ StringRef name;
+ StringRef tags;
+};
+
+struct AutoReg : Detail::NonCopyable {
+ AutoReg( Detail::unique_ptr<ITestInvoker> invoker, SourceLineInfo const& lineInfo, StringRef classOrMethod, NameAndTags const& nameAndTags ) noexcept;
+};
+
+} // end namespace Catch
+
+#if defined(CATCH_CONFIG_DISABLE)
+ #define INTERNAL_CATCH_TESTCASE_NO_REGISTRATION( TestName, ... ) \
+ static inline void TestName()
+ #define INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION( TestName, ClassName, ... ) \
+ namespace{ \
+ struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \
+ void test(); \
+ }; \
+ } \
+ void TestName::test()
+#endif
+
+ ///////////////////////////////////////////////////////////////////////////////
+ #define INTERNAL_CATCH_TESTCASE2( TestName, ... ) \
+ static void TestName(); \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &TestName ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
+ static void TestName()
+ #define INTERNAL_CATCH_TESTCASE( ... ) \
+ INTERNAL_CATCH_TESTCASE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__ )
+
+ ///////////////////////////////////////////////////////////////////////////////
+ #define INTERNAL_CATCH_METHOD_AS_TEST_CASE( QualifiedMethod, ... ) \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ namespace{ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( &QualifiedMethod ), CATCH_INTERNAL_LINEINFO, "&" #QualifiedMethod, Catch::NameAndTags{ __VA_ARGS__ } ); } /* NOLINT */ \
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
+
+ ///////////////////////////////////////////////////////////////////////////////
+ #define INTERNAL_CATCH_TEST_CASE_METHOD2( TestName, ClassName, ... )\
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ namespace{ \
+ struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName) { \
+ void test(); \
+ }; \
+ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar ) ( Catch::makeTestInvoker( &TestName::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \
+ } \
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
+ void TestName::test()
+ #define INTERNAL_CATCH_TEST_CASE_METHOD( ClassName, ... ) \
+ INTERNAL_CATCH_TEST_CASE_METHOD2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), ClassName, __VA_ARGS__ )
+
+ ///////////////////////////////////////////////////////////////////////////////
+ #define INTERNAL_CATCH_REGISTER_TESTCASE( Function, ... ) \
+ do { \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ Catch::AutoReg INTERNAL_CATCH_UNIQUE_NAME( autoRegistrar )( Catch::makeTestInvoker( Function ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ __VA_ARGS__ } ); /* NOLINT */ \
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
+ } while(false)
+
+
+#endif // CATCH_TEST_REGISTRY_HPP_INCLUDED
+
+
+// All of our user-facing macros support configuration toggle, that
+// forces them to be defined prefixed with CATCH_. We also like to
+// support another toggle that can minimize (disable) their implementation.
+// Given this, we have 4 different configuration options below
+
+#if defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
+
+ #define CATCH_REQUIRE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
+ #define CATCH_REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
+
+ #define CATCH_REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ )
+ #define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr )
+ #define CATCH_REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CATCH_REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, __VA_ARGS__ )
+
+ #define CATCH_CHECK( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+ #define CATCH_CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
+ #define CATCH_CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CATCH_CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
+ #define CATCH_CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CATCH_CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
+ #define CATCH_CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CATCH_CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
+
+ #define CATCH_CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CATCH_CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+ #define CATCH_CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CATCH_CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr )
+ #define CATCH_CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CATCH_CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+
+ #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
+ #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #define CATCH_METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
+ #define CATCH_REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
+ #define CATCH_SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
+ #define CATCH_DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ )
+ #define CATCH_FAIL( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
+ #define CATCH_FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "CATCH_FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+ #define CATCH_SUCCEED( ... ) INTERNAL_CATCH_MSG( "CATCH_SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+
+
+ #if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
+ #define CATCH_STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__ , #__VA_ARGS__ ); CATCH_SUCCEED( #__VA_ARGS__ )
+ #define CATCH_STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); CATCH_SUCCEED( #__VA_ARGS__ )
+ #define CATCH_STATIC_CHECK( ... ) static_assert( __VA_ARGS__ , #__VA_ARGS__ ); CATCH_SUCCEED( #__VA_ARGS__ )
+ #define CATCH_STATIC_CHECK_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); CATCH_SUCCEED( #__VA_ARGS__ )
+ #else
+ #define CATCH_STATIC_REQUIRE( ... ) CATCH_REQUIRE( __VA_ARGS__ )
+ #define CATCH_STATIC_REQUIRE_FALSE( ... ) CATCH_REQUIRE_FALSE( __VA_ARGS__ )
+ #define CATCH_STATIC_CHECK( ... ) CATCH_CHECK( __VA_ARGS__ )
+ #define CATCH_STATIC_CHECK_FALSE( ... ) CATCH_CHECK_FALSE( __VA_ARGS__ )
+ #endif
+
+
+ // "BDD-style" convenience wrappers
+ #define CATCH_SCENARIO( ... ) CATCH_TEST_CASE( "Scenario: " __VA_ARGS__ )
+ #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
+ #define CATCH_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Given: " << desc )
+ #define CATCH_AND_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( "And given: " << desc )
+ #define CATCH_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " When: " << desc )
+ #define CATCH_AND_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And when: " << desc )
+ #define CATCH_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Then: " << desc )
+ #define CATCH_AND_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And: " << desc )
+
+#elif defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE) // ^^ prefixed, implemented | vv prefixed, disabled
+
+ #define CATCH_REQUIRE( ... ) (void)(0)
+ #define CATCH_REQUIRE_FALSE( ... ) (void)(0)
+
+ #define CATCH_REQUIRE_THROWS( ... ) (void)(0)
+ #define CATCH_REQUIRE_THROWS_AS( expr, exceptionType ) (void)(0)
+ #define CATCH_REQUIRE_NOTHROW( ... ) (void)(0)
+
+ #define CATCH_CHECK( ... ) (void)(0)
+ #define CATCH_CHECK_FALSE( ... ) (void)(0)
+ #define CATCH_CHECKED_IF( ... ) if (__VA_ARGS__)
+ #define CATCH_CHECKED_ELSE( ... ) if (!(__VA_ARGS__))
+ #define CATCH_CHECK_NOFAIL( ... ) (void)(0)
+
+ #define CATCH_CHECK_THROWS( ... ) (void)(0)
+ #define CATCH_CHECK_THROWS_AS( expr, exceptionType ) (void)(0)
+ #define CATCH_CHECK_NOTHROW( ... ) (void)(0)
+
+ #define CATCH_TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ))
+ #define CATCH_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ))
+ #define CATCH_METHOD_AS_TEST_CASE( method, ... )
+ #define CATCH_REGISTER_TEST_CASE( Function, ... ) (void)(0)
+ #define CATCH_SECTION( ... )
+ #define CATCH_DYNAMIC_SECTION( ... )
+ #define CATCH_FAIL( ... ) (void)(0)
+ #define CATCH_FAIL_CHECK( ... ) (void)(0)
+ #define CATCH_SUCCEED( ... ) (void)(0)
+
+ #define CATCH_STATIC_REQUIRE( ... ) (void)(0)
+ #define CATCH_STATIC_REQUIRE_FALSE( ... ) (void)(0)
+ #define CATCH_STATIC_CHECK( ... ) (void)(0)
+ #define CATCH_STATIC_CHECK_FALSE( ... ) (void)(0)
+
+ // "BDD-style" convenience wrappers
+ #define CATCH_SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ))
+ #define CATCH_SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), className )
+ #define CATCH_GIVEN( desc )
+ #define CATCH_AND_GIVEN( desc )
+ #define CATCH_WHEN( desc )
+ #define CATCH_AND_WHEN( desc )
+ #define CATCH_THEN( desc )
+ #define CATCH_AND_THEN( desc )
+
+#elif !defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE) // ^^ prefixed, disabled | vv unprefixed, implemented
+
+ #define REQUIRE( ... ) INTERNAL_CATCH_TEST( "REQUIRE", Catch::ResultDisposition::Normal, __VA_ARGS__ )
+ #define REQUIRE_FALSE( ... ) INTERNAL_CATCH_TEST( "REQUIRE_FALSE", Catch::ResultDisposition::Normal | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
+
+ #define REQUIRE_THROWS( ... ) INTERNAL_CATCH_THROWS( "REQUIRE_THROWS", Catch::ResultDisposition::Normal, __VA_ARGS__ )
+ #define REQUIRE_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "REQUIRE_THROWS_AS", exceptionType, Catch::ResultDisposition::Normal, expr )
+ #define REQUIRE_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "REQUIRE_NOTHROW", Catch::ResultDisposition::Normal, __VA_ARGS__ )
+
+ #define CHECK( ... ) INTERNAL_CATCH_TEST( "CHECK", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+ #define CHECK_FALSE( ... ) INTERNAL_CATCH_TEST( "CHECK_FALSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::FalseTest, __VA_ARGS__ )
+ #define CHECKED_IF( ... ) INTERNAL_CATCH_IF( "CHECKED_IF", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
+ #define CHECKED_ELSE( ... ) INTERNAL_CATCH_ELSE( "CHECKED_ELSE", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
+ #define CHECK_NOFAIL( ... ) INTERNAL_CATCH_TEST( "CHECK_NOFAIL", Catch::ResultDisposition::ContinueOnFailure | Catch::ResultDisposition::SuppressFail, __VA_ARGS__ )
+
+ #define CHECK_THROWS( ... ) INTERNAL_CATCH_THROWS( "CHECK_THROWS", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+ #define CHECK_THROWS_AS( expr, exceptionType ) INTERNAL_CATCH_THROWS_AS( "CHECK_THROWS_AS", exceptionType, Catch::ResultDisposition::ContinueOnFailure, expr )
+ #define CHECK_NOTHROW( ... ) INTERNAL_CATCH_NO_THROW( "CHECK_NOTHROW", Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+
+ #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE( __VA_ARGS__ )
+ #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #define METHOD_AS_TEST_CASE( method, ... ) INTERNAL_CATCH_METHOD_AS_TEST_CASE( method, __VA_ARGS__ )
+ #define REGISTER_TEST_CASE( Function, ... ) INTERNAL_CATCH_REGISTER_TESTCASE( Function, __VA_ARGS__ )
+ #define SECTION( ... ) INTERNAL_CATCH_SECTION( __VA_ARGS__ )
+ #define DYNAMIC_SECTION( ... ) INTERNAL_CATCH_DYNAMIC_SECTION( __VA_ARGS__ )
+ #define FAIL( ... ) INTERNAL_CATCH_MSG( "FAIL", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::Normal, __VA_ARGS__ )
+ #define FAIL_CHECK( ... ) INTERNAL_CATCH_MSG( "FAIL_CHECK", Catch::ResultWas::ExplicitFailure, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+ #define SUCCEED( ... ) INTERNAL_CATCH_MSG( "SUCCEED", Catch::ResultWas::Ok, Catch::ResultDisposition::ContinueOnFailure, __VA_ARGS__ )
+
+
+ #if !defined(CATCH_CONFIG_RUNTIME_STATIC_REQUIRE)
+ #define STATIC_REQUIRE( ... ) static_assert( __VA_ARGS__, #__VA_ARGS__ ); SUCCEED( #__VA_ARGS__ )
+ #define STATIC_REQUIRE_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); SUCCEED( "!(" #__VA_ARGS__ ")" )
+ #define STATIC_CHECK( ... ) static_assert( __VA_ARGS__, #__VA_ARGS__ ); SUCCEED( #__VA_ARGS__ )
+ #define STATIC_CHECK_FALSE( ... ) static_assert( !(__VA_ARGS__), "!(" #__VA_ARGS__ ")" ); SUCCEED( "!(" #__VA_ARGS__ ")" )
+ #else
+ #define STATIC_REQUIRE( ... ) REQUIRE( __VA_ARGS__ )
+ #define STATIC_REQUIRE_FALSE( ... ) REQUIRE_FALSE( __VA_ARGS__ )
+ #define STATIC_CHECK( ... ) CHECK( __VA_ARGS__ )
+ #define STATIC_CHECK_FALSE( ... ) CHECK_FALSE( __VA_ARGS__ )
+ #endif
+
+ // "BDD-style" convenience wrappers
+ #define SCENARIO( ... ) TEST_CASE( "Scenario: " __VA_ARGS__ )
+ #define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TEST_CASE_METHOD( className, "Scenario: " __VA_ARGS__ )
+ #define GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Given: " << desc )
+ #define AND_GIVEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( "And given: " << desc )
+ #define WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " When: " << desc )
+ #define AND_WHEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And when: " << desc )
+ #define THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " Then: " << desc )
+ #define AND_THEN( desc ) INTERNAL_CATCH_DYNAMIC_SECTION( " And: " << desc )
+
+#elif !defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE) // ^^ unprefixed, implemented | vv unprefixed, disabled
+
+ #define REQUIRE( ... ) (void)(0)
+ #define REQUIRE_FALSE( ... ) (void)(0)
+
+ #define REQUIRE_THROWS( ... ) (void)(0)
+ #define REQUIRE_THROWS_AS( expr, exceptionType ) (void)(0)
+ #define REQUIRE_NOTHROW( ... ) (void)(0)
+
+ #define CHECK( ... ) (void)(0)
+ #define CHECK_FALSE( ... ) (void)(0)
+ #define CHECKED_IF( ... ) if (__VA_ARGS__)
+ #define CHECKED_ELSE( ... ) if (!(__VA_ARGS__))
+ #define CHECK_NOFAIL( ... ) (void)(0)
+
+ #define CHECK_THROWS( ... ) (void)(0)
+ #define CHECK_THROWS_AS( expr, exceptionType ) (void)(0)
+ #define CHECK_NOTHROW( ... ) (void)(0)
+
+ #define TEST_CASE( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), __VA_ARGS__)
+ #define TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ))
+ #define METHOD_AS_TEST_CASE( method, ... )
+ #define REGISTER_TEST_CASE( Function, ... ) (void)(0)
+ #define SECTION( ... )
+ #define DYNAMIC_SECTION( ... )
+ #define FAIL( ... ) (void)(0)
+ #define FAIL_CHECK( ... ) (void)(0)
+ #define SUCCEED( ... ) (void)(0)
+
+ #define STATIC_REQUIRE( ... ) (void)(0)
+ #define STATIC_REQUIRE_FALSE( ... ) (void)(0)
+ #define STATIC_CHECK( ... ) (void)(0)
+ #define STATIC_CHECK_FALSE( ... ) (void)(0)
+
+ // "BDD-style" convenience wrappers
+ #define SCENARIO( ... ) INTERNAL_CATCH_TESTCASE_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ) )
+ #define SCENARIO_METHOD( className, ... ) INTERNAL_CATCH_TESTCASE_METHOD_NO_REGISTRATION(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEST_ ), className )
+
+ #define GIVEN( desc )
+ #define AND_GIVEN( desc )
+ #define WHEN( desc )
+ #define AND_WHEN( desc )
+ #define THEN( desc )
+ #define AND_THEN( desc )
+
+#endif // ^^ unprefixed, disabled
+
+// end of user facing macros
+
+#endif // CATCH_TEST_MACROS_HPP_INCLUDED
+
+
+#ifndef CATCH_TEMPLATE_TEST_REGISTRY_HPP_INCLUDED
+#define CATCH_TEMPLATE_TEST_REGISTRY_HPP_INCLUDED
+
+
+
+#ifndef CATCH_PREPROCESSOR_HPP_INCLUDED
+#define CATCH_PREPROCESSOR_HPP_INCLUDED
+
+
+#if defined(__GNUC__)
+// We need to silence "empty __VA_ARGS__ warning", and using just _Pragma does not work
+#pragma GCC system_header
+#endif
+
+
+#define CATCH_RECURSION_LEVEL0(...) __VA_ARGS__
+#define CATCH_RECURSION_LEVEL1(...) CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(CATCH_RECURSION_LEVEL0(__VA_ARGS__)))
+#define CATCH_RECURSION_LEVEL2(...) CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(CATCH_RECURSION_LEVEL1(__VA_ARGS__)))
+#define CATCH_RECURSION_LEVEL3(...) CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(CATCH_RECURSION_LEVEL2(__VA_ARGS__)))
+#define CATCH_RECURSION_LEVEL4(...) CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(CATCH_RECURSION_LEVEL3(__VA_ARGS__)))
+#define CATCH_RECURSION_LEVEL5(...) CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(CATCH_RECURSION_LEVEL4(__VA_ARGS__)))
+
+#ifdef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+#define INTERNAL_CATCH_EXPAND_VARGS(...) __VA_ARGS__
+// MSVC needs more evaluations
+#define CATCH_RECURSION_LEVEL6(...) CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(CATCH_RECURSION_LEVEL5(__VA_ARGS__)))
+#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL6(CATCH_RECURSION_LEVEL6(__VA_ARGS__))
+#else
+#define CATCH_RECURSE(...) CATCH_RECURSION_LEVEL5(__VA_ARGS__)
+#endif
+
+#define CATCH_REC_END(...)
+#define CATCH_REC_OUT
+
+#define CATCH_EMPTY()
+#define CATCH_DEFER(id) id CATCH_EMPTY()
+
+#define CATCH_REC_GET_END2() 0, CATCH_REC_END
+#define CATCH_REC_GET_END1(...) CATCH_REC_GET_END2
+#define CATCH_REC_GET_END(...) CATCH_REC_GET_END1
+#define CATCH_REC_NEXT0(test, next, ...) next CATCH_REC_OUT
+#define CATCH_REC_NEXT1(test, next) CATCH_DEFER ( CATCH_REC_NEXT0 ) ( test, next, 0)
+#define CATCH_REC_NEXT(test, next) CATCH_REC_NEXT1(CATCH_REC_GET_END test, next)
+
+#define CATCH_REC_LIST0(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ )
+#define CATCH_REC_LIST1(f, x, peek, ...) , f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0) ) ( f, peek, __VA_ARGS__ )
+#define CATCH_REC_LIST2(f, x, peek, ...) f(x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1) ) ( f, peek, __VA_ARGS__ )
+
+#define CATCH_REC_LIST0_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ )
+#define CATCH_REC_LIST1_UD(f, userdata, x, peek, ...) , f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST0_UD) ) ( f, userdata, peek, __VA_ARGS__ )
+#define CATCH_REC_LIST2_UD(f, userdata, x, peek, ...) f(userdata, x) CATCH_DEFER ( CATCH_REC_NEXT(peek, CATCH_REC_LIST1_UD) ) ( f, userdata, peek, __VA_ARGS__ )
+
+// Applies the function macro `f` to each of the remaining parameters, inserts commas between the results,
+// and passes userdata as the first parameter to each invocation,
+// e.g. CATCH_REC_LIST_UD(f, x, a, b, c) evaluates to f(x, a), f(x, b), f(x, c)
+#define CATCH_REC_LIST_UD(f, userdata, ...) CATCH_RECURSE(CATCH_REC_LIST2_UD(f, userdata, __VA_ARGS__, ()()(), ()()(), ()()(), 0))
+
+#define CATCH_REC_LIST(f, ...) CATCH_RECURSE(CATCH_REC_LIST2(f, __VA_ARGS__, ()()(), ()()(), ()()(), 0))
+
+#define INTERNAL_CATCH_STRINGIZE(...) INTERNAL_CATCH_STRINGIZE2(__VA_ARGS__)
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+#define INTERNAL_CATCH_STRINGIZE2(...) #__VA_ARGS__
+#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param))
+#else
+// MSVC is adding extra space and needs another indirection to expand INTERNAL_CATCH_NOINTERNAL_CATCH_DEF
+#define INTERNAL_CATCH_STRINGIZE2(...) INTERNAL_CATCH_STRINGIZE3(__VA_ARGS__)
+#define INTERNAL_CATCH_STRINGIZE3(...) #__VA_ARGS__
+#define INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS(param) (INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_REMOVE_PARENS(param)) + 1)
+#endif
+
+#define INTERNAL_CATCH_MAKE_NAMESPACE2(...) ns_##__VA_ARGS__
+#define INTERNAL_CATCH_MAKE_NAMESPACE(name) INTERNAL_CATCH_MAKE_NAMESPACE2(name)
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS_GEN(__VA_ARGS__)>())
+#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__))
+#else
+#define INTERNAL_CATCH_MAKE_TYPE_LIST2(...) INTERNAL_CATCH_EXPAND_VARGS(decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS_GEN(__VA_ARGS__)>()))
+#define INTERNAL_CATCH_MAKE_TYPE_LIST(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_MAKE_TYPE_LIST2(INTERNAL_CATCH_REMOVE_PARENS(__VA_ARGS__)))
+#endif
+
+#define INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(...)\
+ CATCH_REC_LIST(INTERNAL_CATCH_MAKE_TYPE_LIST,__VA_ARGS__)
+
+#define INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_0) INTERNAL_CATCH_REMOVE_PARENS(_0)
+#define INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_0, _1) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_1_ARG(_1)
+#define INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_0, _1, _2) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_2_ARG(_1, _2)
+#define INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_0, _1, _2, _3) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_3_ARG(_1, _2, _3)
+#define INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_0, _1, _2, _3, _4) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_4_ARG(_1, _2, _3, _4)
+#define INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_0, _1, _2, _3, _4, _5) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_5_ARG(_1, _2, _3, _4, _5)
+#define INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_0, _1, _2, _3, _4, _5, _6) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_6_ARG(_1, _2, _3, _4, _5, _6)
+#define INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_0, _1, _2, _3, _4, _5, _6, _7) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_7_ARG(_1, _2, _3, _4, _5, _6, _7)
+#define INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_8_ARG(_1, _2, _3, _4, _5, _6, _7, _8)
+#define INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_9_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9)
+#define INTERNAL_CATCH_REMOVE_PARENS_11_ARG(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) INTERNAL_CATCH_REMOVE_PARENS(_0), INTERNAL_CATCH_REMOVE_PARENS_10_ARG(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10)
+
+#define INTERNAL_CATCH_VA_NARGS_IMPL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N
+
+#define INTERNAL_CATCH_TYPE_GEN\
+ template<typename...> struct TypeList {};\
+ template<typename...Ts>\
+ constexpr auto get_wrapper() noexcept -> TypeList<Ts...> { return {}; }\
+ template<template<typename...> class...> struct TemplateTypeList{};\
+ template<template<typename...> class...Cs>\
+ constexpr auto get_wrapper() noexcept -> TemplateTypeList<Cs...> { return {}; }\
+ template<typename...>\
+ struct append;\
+ template<typename...>\
+ struct rewrap;\
+ template<template<typename...> class, typename...>\
+ struct create;\
+ template<template<typename...> class, typename>\
+ struct convert;\
+ \
+ template<typename T> \
+ struct append<T> { using type = T; };\
+ template< template<typename...> class L1, typename...E1, template<typename...> class L2, typename...E2, typename...Rest>\
+ struct append<L1<E1...>, L2<E2...>, Rest...> { using type = typename append<L1<E1...,E2...>, Rest...>::type; };\
+ template< template<typename...> class L1, typename...E1, typename...Rest>\
+ struct append<L1<E1...>, TypeList<mpl_::na>, Rest...> { using type = L1<E1...>; };\
+ \
+ template< template<typename...> class Container, template<typename...> class List, typename...elems>\
+ struct rewrap<TemplateTypeList<Container>, List<elems...>> { using type = TypeList<Container<elems...>>; };\
+ template< template<typename...> class Container, template<typename...> class List, class...Elems, typename...Elements>\
+ struct rewrap<TemplateTypeList<Container>, List<Elems...>, Elements...> { using type = typename append<TypeList<Container<Elems...>>, typename rewrap<TemplateTypeList<Container>, Elements...>::type>::type; };\
+ \
+ template<template <typename...> class Final, template< typename...> class...Containers, typename...Types>\
+ struct create<Final, TemplateTypeList<Containers...>, TypeList<Types...>> { using type = typename append<Final<>, typename rewrap<TemplateTypeList<Containers>, Types...>::type...>::type; };\
+ template<template <typename...> class Final, template <typename...> class List, typename...Ts>\
+ struct convert<Final, List<Ts...>> { using type = typename append<Final<>,TypeList<Ts>...>::type; };
+
+#define INTERNAL_CATCH_NTTP_1(signature, ...)\
+ template<INTERNAL_CATCH_REMOVE_PARENS(signature)> struct Nttp{};\
+ template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
+ constexpr auto get_wrapper() noexcept -> Nttp<__VA_ARGS__> { return {}; } \
+ template<template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...> struct NttpTemplateTypeList{};\
+ template<template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...Cs>\
+ constexpr auto get_wrapper() noexcept -> NttpTemplateTypeList<Cs...> { return {}; } \
+ \
+ template< template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class Container, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class List, INTERNAL_CATCH_REMOVE_PARENS(signature)>\
+ struct rewrap<NttpTemplateTypeList<Container>, List<__VA_ARGS__>> { using type = TypeList<Container<__VA_ARGS__>>; };\
+ template< template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class Container, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class List, INTERNAL_CATCH_REMOVE_PARENS(signature), typename...Elements>\
+ struct rewrap<NttpTemplateTypeList<Container>, List<__VA_ARGS__>, Elements...> { using type = typename append<TypeList<Container<__VA_ARGS__>>, typename rewrap<NttpTemplateTypeList<Container>, Elements...>::type>::type; };\
+ template<template <typename...> class Final, template<INTERNAL_CATCH_REMOVE_PARENS(signature)> class...Containers, typename...Types>\
+ struct create<Final, NttpTemplateTypeList<Containers...>, TypeList<Types...>> { using type = typename append<Final<>, typename rewrap<NttpTemplateTypeList<Containers>, Types...>::type...>::type; };
+
+#define INTERNAL_CATCH_DECLARE_SIG_TEST0(TestName)
+#define INTERNAL_CATCH_DECLARE_SIG_TEST1(TestName, signature)\
+ template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
+ static void TestName()
+#define INTERNAL_CATCH_DECLARE_SIG_TEST_X(TestName, signature, ...)\
+ template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
+ static void TestName()
+
+#define INTERNAL_CATCH_DEFINE_SIG_TEST0(TestName)
+#define INTERNAL_CATCH_DEFINE_SIG_TEST1(TestName, signature)\
+ template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
+ static void TestName()
+#define INTERNAL_CATCH_DEFINE_SIG_TEST_X(TestName, signature,...)\
+ template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
+ static void TestName()
+
+#define INTERNAL_CATCH_NTTP_REGISTER0(TestFunc, signature)\
+ template<typename Type>\
+ void reg_test(TypeList<Type>, Catch::NameAndTags nameAndTags)\
+ {\
+ Catch::AutoReg( Catch::makeTestInvoker(&TestFunc<Type>), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), nameAndTags);\
+ }
+
+#define INTERNAL_CATCH_NTTP_REGISTER(TestFunc, signature, ...)\
+ template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
+ void reg_test(Nttp<__VA_ARGS__>, Catch::NameAndTags nameAndTags)\
+ {\
+ Catch::AutoReg( Catch::makeTestInvoker(&TestFunc<__VA_ARGS__>), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), nameAndTags);\
+ }
+
+#define INTERNAL_CATCH_NTTP_REGISTER_METHOD0(TestName, signature, ...)\
+ template<typename Type>\
+ void reg_test(TypeList<Type>, Catch::StringRef className, Catch::NameAndTags nameAndTags)\
+ {\
+ Catch::AutoReg( Catch::makeTestInvoker(&TestName<Type>::test), CATCH_INTERNAL_LINEINFO, className, nameAndTags);\
+ }
+
+#define INTERNAL_CATCH_NTTP_REGISTER_METHOD(TestName, signature, ...)\
+ template<INTERNAL_CATCH_REMOVE_PARENS(signature)>\
+ void reg_test(Nttp<__VA_ARGS__>, Catch::StringRef className, Catch::NameAndTags nameAndTags)\
+ {\
+ Catch::AutoReg( Catch::makeTestInvoker(&TestName<__VA_ARGS__>::test), CATCH_INTERNAL_LINEINFO, className, nameAndTags);\
+ }
+
+#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD0(TestName, ClassName)
+#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD1(TestName, ClassName, signature)\
+ template<typename TestType> \
+ struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName)<TestType> { \
+ void test();\
+ }
+
+#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X(TestName, ClassName, signature, ...)\
+ template<INTERNAL_CATCH_REMOVE_PARENS(signature)> \
+ struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName)<__VA_ARGS__> { \
+ void test();\
+ }
+
+#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD0(TestName)
+#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD1(TestName, signature)\
+ template<typename TestType> \
+ void INTERNAL_CATCH_MAKE_NAMESPACE(TestName)::TestName<TestType>::test()
+#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X(TestName, signature, ...)\
+ template<INTERNAL_CATCH_REMOVE_PARENS(signature)> \
+ void INTERNAL_CATCH_MAKE_NAMESPACE(TestName)::TestName<__VA_ARGS__>::test()
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+#define INTERNAL_CATCH_NTTP_0
+#define INTERNAL_CATCH_NTTP_GEN(...) INTERNAL_CATCH_VA_NARGS_IMPL(__VA_ARGS__, INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1(__VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_1( __VA_ARGS__),INTERNAL_CATCH_NTTP_1( __VA_ARGS__), INTERNAL_CATCH_NTTP_0)
+#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD1, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD0)(TestName, __VA_ARGS__)
+#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD1, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD0)(TestName, ClassName, __VA_ARGS__)
+#define INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD0, INTERNAL_CATCH_NTTP_REGISTER_METHOD0)(TestName, __VA_ARGS__)
+#define INTERNAL_CATCH_NTTP_REG_GEN(TestFunc, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER0, INTERNAL_CATCH_NTTP_REGISTER0)(TestFunc, __VA_ARGS__)
+#define INTERNAL_CATCH_DEFINE_SIG_TEST(TestName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DEFINE_SIG_TEST1, INTERNAL_CATCH_DEFINE_SIG_TEST0)(TestName, __VA_ARGS__)
+#define INTERNAL_CATCH_DECLARE_SIG_TEST(TestName, ...) INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DECLARE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST1, INTERNAL_CATCH_DECLARE_SIG_TEST0)(TestName, __VA_ARGS__)
+#define INTERNAL_CATCH_REMOVE_PARENS_GEN(...) INTERNAL_CATCH_VA_NARGS_IMPL(__VA_ARGS__, INTERNAL_CATCH_REMOVE_PARENS_11_ARG,INTERNAL_CATCH_REMOVE_PARENS_10_ARG,INTERNAL_CATCH_REMOVE_PARENS_9_ARG,INTERNAL_CATCH_REMOVE_PARENS_8_ARG,INTERNAL_CATCH_REMOVE_PARENS_7_ARG,INTERNAL_CATCH_REMOVE_PARENS_6_ARG,INTERNAL_CATCH_REMOVE_PARENS_5_ARG,INTERNAL_CATCH_REMOVE_PARENS_4_ARG,INTERNAL_CATCH_REMOVE_PARENS_3_ARG,INTERNAL_CATCH_REMOVE_PARENS_2_ARG,INTERNAL_CATCH_REMOVE_PARENS_1_ARG)(__VA_ARGS__)
+#else
+#define INTERNAL_CATCH_NTTP_0(signature)
+#define INTERNAL_CATCH_NTTP_GEN(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL(__VA_ARGS__, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_1,INTERNAL_CATCH_NTTP_1, INTERNAL_CATCH_NTTP_0)( __VA_ARGS__))
+#define INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD1, INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD0)(TestName, __VA_ARGS__))
+#define INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X,INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD_X, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD1, INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD0)(TestName, ClassName, __VA_ARGS__))
+#define INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD, INTERNAL_CATCH_NTTP_REGISTER_METHOD0, INTERNAL_CATCH_NTTP_REGISTER_METHOD0)(TestName, __VA_ARGS__))
+#define INTERNAL_CATCH_NTTP_REG_GEN(TestFunc, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER, INTERNAL_CATCH_NTTP_REGISTER0, INTERNAL_CATCH_NTTP_REGISTER0)(TestFunc, __VA_ARGS__))
+#define INTERNAL_CATCH_DEFINE_SIG_TEST(TestName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DEFINE_SIG_TEST1, INTERNAL_CATCH_DEFINE_SIG_TEST0)(TestName, __VA_ARGS__))
+#define INTERNAL_CATCH_DECLARE_SIG_TEST(TestName, ...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL( "dummy", __VA_ARGS__, INTERNAL_CATCH_DECLARE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DEFINE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X,INTERNAL_CATCH_DECLARE_SIG_TEST_X, INTERNAL_CATCH_DECLARE_SIG_TEST1, INTERNAL_CATCH_DECLARE_SIG_TEST0)(TestName, __VA_ARGS__))
+#define INTERNAL_CATCH_REMOVE_PARENS_GEN(...) INTERNAL_CATCH_EXPAND_VARGS(INTERNAL_CATCH_VA_NARGS_IMPL(__VA_ARGS__, INTERNAL_CATCH_REMOVE_PARENS_11_ARG,INTERNAL_CATCH_REMOVE_PARENS_10_ARG,INTERNAL_CATCH_REMOVE_PARENS_9_ARG,INTERNAL_CATCH_REMOVE_PARENS_8_ARG,INTERNAL_CATCH_REMOVE_PARENS_7_ARG,INTERNAL_CATCH_REMOVE_PARENS_6_ARG,INTERNAL_CATCH_REMOVE_PARENS_5_ARG,INTERNAL_CATCH_REMOVE_PARENS_4_ARG,INTERNAL_CATCH_REMOVE_PARENS_3_ARG,INTERNAL_CATCH_REMOVE_PARENS_2_ARG,INTERNAL_CATCH_REMOVE_PARENS_1_ARG)(__VA_ARGS__))
+#endif
+
+#endif // CATCH_PREPROCESSOR_HPP_INCLUDED
+
+
+// GCC 5 and older do not properly handle disabling unused-variable warning
+// with a _Pragma. This means that we have to leak the suppression to the
+// user code as well :-(
+#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 5
+#pragma GCC diagnostic ignored "-Wunused-variable"
+#endif
+
+#if defined(CATCH_CONFIG_DISABLE)
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( TestName, TestFunc, Name, Tags, Signature, ... ) \
+ INTERNAL_CATCH_DEFINE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature))
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( TestNameClass, TestName, ClassName, Name, Tags, Signature, ... ) \
+ namespace{ \
+ namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
+ INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
+ } \
+ } \
+ INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))
+
+ #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ )
+ #else
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(Name, Tags, ...) \
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
+ #endif
+
+ #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ )
+ #else
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(Name, Tags, Signature, ...) \
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) )
+ #endif
+
+ #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
+ #else
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION( ClassName, Name, Tags,... ) \
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
+ #endif
+
+ #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
+ #else
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION( ClassName, Name, Tags, Signature, ... ) \
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
+ #endif
+#endif
+
+
+ ///////////////////////////////////////////////////////////////////////////////
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_2(TestName, TestFunc, Name, Tags, Signature, ... )\
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ INTERNAL_CATCH_DECLARE_SIG_TEST(TestFunc, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
+ namespace {\
+ namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){\
+ INTERNAL_CATCH_TYPE_GEN\
+ INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
+ INTERNAL_CATCH_NTTP_REG_GEN(TestFunc,INTERNAL_CATCH_REMOVE_PARENS(Signature))\
+ template<typename...Types> \
+ struct TestName{\
+ TestName(){\
+ size_t index = 0; \
+ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
+ using expander = size_t[];\
+ (void)expander{(reg_test(Types{}, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \
+ }\
+ };\
+ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
+ TestName<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>();\
+ return 0;\
+ }();\
+ }\
+ }\
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
+ INTERNAL_CATCH_DEFINE_SIG_TEST(TestFunc,INTERNAL_CATCH_REMOVE_PARENS(Signature))
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ )
+#else
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE(Name, Tags, ...) \
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename TestType, __VA_ARGS__ ) )
+#endif
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ )
+#else
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG(Name, Tags, Signature, ...) \
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) )
+#endif
+
+ #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(TestName, TestFuncName, Name, Tags, Signature, TmplTypes, TypesList) \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ template<typename TestType> static void TestFuncName(); \
+ namespace {\
+ namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName) { \
+ INTERNAL_CATCH_TYPE_GEN \
+ INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature)) \
+ template<typename... Types> \
+ struct TestName { \
+ void reg_tests() { \
+ size_t index = 0; \
+ using expander = size_t[]; \
+ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
+ constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
+ constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
+ (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFuncName<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + '<' + std::string(types_list[index % num_types]) + '>', Tags } ), index++)... };/* NOLINT */\
+ } \
+ }; \
+ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
+ using TestInit = typename create<TestName, decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>()), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type; \
+ TestInit t; \
+ t.reg_tests(); \
+ return 0; \
+ }(); \
+ } \
+ } \
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
+ template<typename TestType> \
+ static void TestFuncName()
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\
+ INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T,__VA_ARGS__)
+#else
+ #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE(Name, Tags, ...)\
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, typename T, __VA_ARGS__ ) )
+#endif
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\
+ INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2(INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__)
+#else
+ #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG(Name, Tags, Signature, ...)\
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, Signature, __VA_ARGS__ ) )
+#endif
+
+ #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2(TestName, TestFunc, Name, Tags, TmplList)\
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ template<typename TestType> static void TestFunc(); \
+ namespace {\
+ namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){\
+ INTERNAL_CATCH_TYPE_GEN\
+ template<typename... Types> \
+ struct TestName { \
+ void reg_tests() { \
+ size_t index = 0; \
+ using expander = size_t[]; \
+ (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestFunc<Types> ), CATCH_INTERNAL_LINEINFO, Catch::StringRef(), Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */\
+ } \
+ };\
+ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){ \
+ using TestInit = typename convert<TestName, TmplList>::type; \
+ TestInit t; \
+ t.reg_tests(); \
+ return 0; \
+ }(); \
+ }}\
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
+ template<typename TestType> \
+ static void TestFunc()
+
+ #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(Name, Tags, TmplList) \
+ INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), Name, Tags, TmplList )
+
+
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, Signature, ... ) \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ namespace {\
+ namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){ \
+ INTERNAL_CATCH_TYPE_GEN\
+ INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
+ INTERNAL_CATCH_DECLARE_SIG_TEST_METHOD(TestName, ClassName, INTERNAL_CATCH_REMOVE_PARENS(Signature));\
+ INTERNAL_CATCH_NTTP_REG_METHOD_GEN(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))\
+ template<typename...Types> \
+ struct TestNameClass{\
+ TestNameClass(){\
+ size_t index = 0; \
+ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, __VA_ARGS__)};\
+ using expander = size_t[];\
+ (void)expander{(reg_test(Types{}, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index]), Tags } ), index++)... };/* NOLINT */ \
+ }\
+ };\
+ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
+ TestNameClass<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(__VA_ARGS__)>();\
+ return 0;\
+ }();\
+ }\
+ }\
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
+ INTERNAL_CATCH_DEFINE_SIG_TEST_METHOD(TestName, INTERNAL_CATCH_REMOVE_PARENS(Signature))
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ )
+#else
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( ClassName, Name, Tags,... ) \
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, typename T, __VA_ARGS__ ) )
+#endif
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \
+ INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ )
+#else
+ #define INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... ) \
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_CLASS_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ) , ClassName, Name, Tags, Signature, __VA_ARGS__ ) )
+#endif
+
+ #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2(TestNameClass, TestName, ClassName, Name, Tags, Signature, TmplTypes, TypesList)\
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_ZERO_VARIADIC_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ template<typename TestType> \
+ struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \
+ void test();\
+ };\
+ namespace {\
+ namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestNameClass) {\
+ INTERNAL_CATCH_TYPE_GEN \
+ INTERNAL_CATCH_NTTP_GEN(INTERNAL_CATCH_REMOVE_PARENS(Signature))\
+ template<typename...Types>\
+ struct TestNameClass{\
+ void reg_tests(){\
+ std::size_t index = 0;\
+ using expander = std::size_t[];\
+ constexpr char const* tmpl_types[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TmplTypes))};\
+ constexpr char const* types_list[] = {CATCH_REC_LIST(INTERNAL_CATCH_STRINGIZE_WITHOUT_PARENS, INTERNAL_CATCH_REMOVE_PARENS(TypesList))};\
+ constexpr auto num_types = sizeof(types_list) / sizeof(types_list[0]);\
+ (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(tmpl_types[index / num_types]) + '<' + std::string(types_list[index % num_types]) + '>', Tags } ), index++)... };/* NOLINT */ \
+ }\
+ };\
+ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
+ using TestInit = typename create<TestNameClass, decltype(get_wrapper<INTERNAL_CATCH_REMOVE_PARENS(TmplTypes)>()), TypeList<INTERNAL_CATCH_MAKE_TYPE_LISTS_FROM_TYPES(INTERNAL_CATCH_REMOVE_PARENS(TypesList))>>::type;\
+ TestInit t;\
+ t.reg_tests();\
+ return 0;\
+ }(); \
+ }\
+ }\
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
+ template<typename TestType> \
+ void TestName<TestType>::test()
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\
+ INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, typename T, __VA_ARGS__ )
+#else
+ #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( ClassName, Name, Tags, ... )\
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, typename T,__VA_ARGS__ ) )
+#endif
+
+#ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... )\
+ INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, Signature, __VA_ARGS__ )
+#else
+ #define INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( ClassName, Name, Tags, Signature, ... )\
+ INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, Signature,__VA_ARGS__ ) )
+#endif
+
+ #define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( TestNameClass, TestName, ClassName, Name, Tags, TmplList) \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_TEMPLATE_WARNINGS \
+ CATCH_INTERNAL_SUPPRESS_UNUSED_VARIABLE_WARNINGS \
+ template<typename TestType> \
+ struct TestName : INTERNAL_CATCH_REMOVE_PARENS(ClassName <TestType>) { \
+ void test();\
+ };\
+ namespace {\
+ namespace INTERNAL_CATCH_MAKE_NAMESPACE(TestName){ \
+ INTERNAL_CATCH_TYPE_GEN\
+ template<typename...Types>\
+ struct TestNameClass{\
+ void reg_tests(){\
+ size_t index = 0;\
+ using expander = size_t[];\
+ (void)expander{(Catch::AutoReg( Catch::makeTestInvoker( &TestName<Types>::test ), CATCH_INTERNAL_LINEINFO, #ClassName, Catch::NameAndTags{ Name " - " + std::string(INTERNAL_CATCH_STRINGIZE(TmplList)) + " - " + std::to_string(index), Tags } ), index++)... };/* NOLINT */ \
+ }\
+ };\
+ static int INTERNAL_CATCH_UNIQUE_NAME( globalRegistrar ) = [](){\
+ using TestInit = typename convert<TestNameClass, TmplList>::type;\
+ TestInit t;\
+ t.reg_tests();\
+ return 0;\
+ }(); \
+ }}\
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
+ template<typename TestType> \
+ void TestName<TestType>::test()
+
+#define INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD(ClassName, Name, Tags, TmplList) \
+ INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD_2( INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), INTERNAL_CATCH_UNIQUE_NAME( CATCH2_INTERNAL_TEMPLATE_TEST_ ), ClassName, Name, Tags, TmplList )
+
+
+#endif // CATCH_TEMPLATE_TEST_REGISTRY_HPP_INCLUDED
+
+
+#if defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
+
+ #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
+ #define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ )
+ #define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
+ #define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
+ #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ )
+ #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
+ #define CATCH_TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(__VA_ARGS__)
+ #define CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #else
+ #define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) )
+ #define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ ) )
+ #define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
+ #define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
+ #define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) )
+ #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ ) )
+ #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
+ #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
+ #define CATCH_TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE( __VA_ARGS__ ) )
+ #define CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
+ #endif
+
+#elif defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
+
+ #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__)
+ #define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__)
+ #define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__)
+ #define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ )
+ #else
+ #define CATCH_TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__) )
+ #define CATCH_TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__) )
+ #define CATCH_TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__ ) )
+ #define CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ ) )
+ #endif
+
+ // When disabled, these can be shared between proper preprocessor and MSVC preprocessor
+ #define CATCH_TEMPLATE_PRODUCT_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
+ #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
+ #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #define CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #define CATCH_TEMPLATE_LIST_TEST_CASE( ... ) CATCH_TEMPLATE_TEST_CASE(__VA_ARGS__)
+ #define CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+
+#elif !defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
+
+ #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ )
+ #define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ )
+ #define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
+ #define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ )
+ #define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ )
+ #define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ )
+ #define TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE(__VA_ARGS__)
+ #define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #else
+ #define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE( __VA_ARGS__ ) )
+ #define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG( __VA_ARGS__ ) )
+ #define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
+ #define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
+ #define TEMPLATE_PRODUCT_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE( __VA_ARGS__ ) )
+ #define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_SIG( __VA_ARGS__ ) )
+ #define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
+ #define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, __VA_ARGS__ ) )
+ #define TEMPLATE_LIST_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE( __VA_ARGS__ ) )
+ #define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_LIST_TEST_CASE_METHOD( className, __VA_ARGS__ ) )
+ #endif
+
+#elif !defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
+
+ #ifndef CATCH_CONFIG_TRADITIONAL_MSVC_PREPROCESSOR
+ #define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__)
+ #define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__)
+ #define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__)
+ #define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ )
+ #else
+ #define TEMPLATE_TEST_CASE( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_NO_REGISTRATION(__VA_ARGS__) )
+ #define TEMPLATE_TEST_CASE_SIG( ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_SIG_NO_REGISTRATION(__VA_ARGS__) )
+ #define TEMPLATE_TEST_CASE_METHOD( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_NO_REGISTRATION(className, __VA_ARGS__ ) )
+ #define TEMPLATE_TEST_CASE_METHOD_SIG( className, ... ) INTERNAL_CATCH_EXPAND_VARGS( INTERNAL_CATCH_TEMPLATE_TEST_CASE_METHOD_SIG_NO_REGISTRATION(className, __VA_ARGS__ ) )
+ #endif
+
+ // When disabled, these can be shared between proper preprocessor and MSVC preprocessor
+ #define TEMPLATE_PRODUCT_TEST_CASE( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
+ #define TEMPLATE_PRODUCT_TEST_CASE_SIG( ... ) TEMPLATE_TEST_CASE( __VA_ARGS__ )
+ #define TEMPLATE_PRODUCT_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #define TEMPLATE_PRODUCT_TEST_CASE_METHOD_SIG( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+ #define TEMPLATE_LIST_TEST_CASE( ... ) TEMPLATE_TEST_CASE(__VA_ARGS__)
+ #define TEMPLATE_LIST_TEST_CASE_METHOD( className, ... ) TEMPLATE_TEST_CASE_METHOD( className, __VA_ARGS__ )
+
+#endif // end of user facing macro declarations
+
+
+#endif // CATCH_TEMPLATE_TEST_MACROS_HPP_INCLUDED
+
+
+#ifndef CATCH_TEST_CASE_INFO_HPP_INCLUDED
+#define CATCH_TEST_CASE_INFO_HPP_INCLUDED
+
+
+
+#include <string>
+#include <vector>
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpadded"
+#endif
+
+namespace Catch {
+
+ /**
+ * A **view** of a tag string that provides case insensitive comparisons
+ *
+ * Note that in Catch2 internals, the square brackets around tags are
+ * not a part of tag's representation, so e.g. "[cool-tag]" is represented
+ * as "cool-tag" internally.
+ */
+ struct Tag {
+ constexpr Tag(StringRef original_):
+ original(original_)
+ {}
+ StringRef original;
+
+ friend bool operator< ( Tag const& lhs, Tag const& rhs );
+ friend bool operator==( Tag const& lhs, Tag const& rhs );
+ };
+
+ class ITestInvoker;
+
+ enum class TestCaseProperties : uint8_t {
+ None = 0,
+ IsHidden = 1 << 1,
+ ShouldFail = 1 << 2,
+ MayFail = 1 << 3,
+ Throws = 1 << 4,
+ NonPortable = 1 << 5,
+ Benchmark = 1 << 6
+ };
+
+ /**
+ * Various metadata about the test case.
+ *
+ * A test case is uniquely identified by its (class)name and tags
+ * combination, with source location being ignored, and other properties
+ * being determined from tags.
+ *
+ * Tags are kept sorted.
+ */
+ struct TestCaseInfo : Detail::NonCopyable {
+
+ TestCaseInfo(StringRef _className,
+ NameAndTags const& _tags,
+ SourceLineInfo const& _lineInfo);
+
+ bool isHidden() const;
+ bool throws() const;
+ bool okToFail() const;
+ bool expectedToFail() const;
+
+ // Adds the tag(s) with test's filename (for the -# flag)
+ void addFilenameTag();
+
+ //! Orders by name, classname and tags
+ friend bool operator<( TestCaseInfo const& lhs,
+ TestCaseInfo const& rhs );
+
+
+ std::string tagsAsString() const;
+
+ std::string name;
+ StringRef className;
+ private:
+ std::string backingTags;
+ // Internally we copy tags to the backing storage and then add
+ // refs to this storage to the tags vector.
+ void internalAppendTag(StringRef tagString);
+ public:
+ std::vector<Tag> tags;
+ SourceLineInfo lineInfo;
+ TestCaseProperties properties = TestCaseProperties::None;
+ };
+
+ /**
+ * Wrapper over the test case information and the test case invoker
+ *
+ * Does not own either, and is specifically made to be cheap
+ * to copy around.
+ */
+ class TestCaseHandle {
+ TestCaseInfo* m_info;
+ ITestInvoker* m_invoker;
+ public:
+ TestCaseHandle(TestCaseInfo* info, ITestInvoker* invoker) :
+ m_info(info), m_invoker(invoker) {}
+
+ void invoke() const {
+ m_invoker->invoke();
+ }
+
+ TestCaseInfo const& getTestCaseInfo() const;
+ };
+
+ Detail::unique_ptr<TestCaseInfo>
+ makeTestCaseInfo( StringRef className,
+ NameAndTags const& nameAndTags,
+ SourceLineInfo const& lineInfo );
+}
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+#endif // CATCH_TEST_CASE_INFO_HPP_INCLUDED
+
+
+#ifndef CATCH_TRANSLATE_EXCEPTION_HPP_INCLUDED
+#define CATCH_TRANSLATE_EXCEPTION_HPP_INCLUDED
+
+
+
+#ifndef CATCH_INTERFACES_EXCEPTION_HPP_INCLUDED
+#define CATCH_INTERFACES_EXCEPTION_HPP_INCLUDED
+
+
+#include <string>
+#include <vector>
+
+namespace Catch {
+ using exceptionTranslateFunction = std::string(*)();
+
+ class IExceptionTranslator;
+ using ExceptionTranslators = std::vector<Detail::unique_ptr<IExceptionTranslator const>>;
+
+ class IExceptionTranslator {
+ public:
+ virtual ~IExceptionTranslator(); // = default
+ virtual std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const = 0;
+ };
+
+ class IExceptionTranslatorRegistry {
+ public:
+ virtual ~IExceptionTranslatorRegistry(); // = default
+ virtual std::string translateActiveException() const = 0;
+ };
+
+} // namespace Catch
+
+#endif // CATCH_INTERFACES_EXCEPTION_HPP_INCLUDED
+
+#include <exception>
+
+namespace Catch {
+
+ class ExceptionTranslatorRegistrar {
+ template<typename T>
+ class ExceptionTranslator : public IExceptionTranslator {
+ public:
+
+ ExceptionTranslator( std::string(*translateFunction)( T const& ) )
+ : m_translateFunction( translateFunction )
+ {}
+
+ std::string translate( ExceptionTranslators::const_iterator it, ExceptionTranslators::const_iterator itEnd ) const override {
+#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+ try {
+ if( it == itEnd )
+ std::rethrow_exception(std::current_exception());
+ else
+ return (*it)->translate( it+1, itEnd );
+ }
+ catch( T const& ex ) {
+ return m_translateFunction( ex );
+ }
+#else
+ return "You should never get here!";
+#endif
+ }
+
+ protected:
+ std::string(*m_translateFunction)( T const& );
+ };
+
+ public:
+ template<typename T>
+ ExceptionTranslatorRegistrar( std::string(*translateFunction)( T const& ) ) {
+ getMutableRegistryHub().registerTranslator(
+ Detail::make_unique<ExceptionTranslator<T>>(translateFunction)
+ );
+ }
+ };
+
+} // namespace Catch
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_TRANSLATE_EXCEPTION2( translatorName, signature ) \
+ static std::string translatorName( signature ); \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ namespace{ Catch::ExceptionTranslatorRegistrar INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionRegistrar )( &translatorName ); } \
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
+ static std::string translatorName( signature )
+
+#define INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION2( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
+
+#if defined(CATCH_CONFIG_DISABLE)
+ #define INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( translatorName, signature) \
+ static std::string translatorName( signature )
+#endif
+
+
+// This macro is always prefixed
+#if !defined(CATCH_CONFIG_DISABLE)
+#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION( signature )
+#else
+#define CATCH_TRANSLATE_EXCEPTION( signature ) INTERNAL_CATCH_TRANSLATE_EXCEPTION_NO_REG( INTERNAL_CATCH_UNIQUE_NAME( catch_internal_ExceptionTranslator ), signature )
+#endif
+
+
+#endif // CATCH_TRANSLATE_EXCEPTION_HPP_INCLUDED
+
+
+#ifndef CATCH_VERSION_HPP_INCLUDED
+#define CATCH_VERSION_HPP_INCLUDED
+
+#include <iosfwd>
+
+namespace Catch {
+
+ // Versioning information
+ struct Version {
+ Version( Version const& ) = delete;
+ Version& operator=( Version const& ) = delete;
+ Version( unsigned int _majorVersion,
+ unsigned int _minorVersion,
+ unsigned int _patchNumber,
+ char const * const _branchName,
+ unsigned int _buildNumber );
+
+ unsigned int const majorVersion;
+ unsigned int const minorVersion;
+ unsigned int const patchNumber;
+
+ // buildNumber is only used if branchName is not null
+ char const * const branchName;
+ unsigned int const buildNumber;
+
+ friend std::ostream& operator << ( std::ostream& os, Version const& version );
+ };
+
+ Version const& libraryVersion();
+}
+
+#endif // CATCH_VERSION_HPP_INCLUDED
+
+
+#ifndef CATCH_VERSION_MACROS_HPP_INCLUDED
+#define CATCH_VERSION_MACROS_HPP_INCLUDED
+
+#define CATCH_VERSION_MAJOR 3
+#define CATCH_VERSION_MINOR 1
+#define CATCH_VERSION_PATCH 0
+
+#endif // CATCH_VERSION_MACROS_HPP_INCLUDED
+
+
+/** \file
+ * This is a convenience header for Catch2's Generator support. It includes
+ * **all** of Catch2 headers related to generators.
+ *
+ * Generally the Catch2 users should use specific includes they need,
+ * but this header can be used instead for ease-of-experimentation, or
+ * just plain convenience, at the cost of (significantly) increased
+ * compilation times.
+ *
+ * When a new header is added to either the `generators` folder,
+ * or to the corresponding internal subfolder, it should be added here.
+ */
+
+#ifndef CATCH_GENERATORS_ALL_HPP_INCLUDED
+#define CATCH_GENERATORS_ALL_HPP_INCLUDED
+
+
+
+#ifndef CATCH_GENERATOR_EXCEPTION_HPP_INCLUDED
+#define CATCH_GENERATOR_EXCEPTION_HPP_INCLUDED
+
+#include <exception>
+
+namespace Catch {
+
+ // Exception type to be thrown when a Generator runs into an error,
+ // e.g. it cannot initialize the first return value based on
+ // runtime information
+ class GeneratorException : public std::exception {
+ const char* const m_msg = "";
+
+ public:
+ GeneratorException(const char* msg):
+ m_msg(msg)
+ {}
+
+ const char* what() const noexcept override final;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_GENERATOR_EXCEPTION_HPP_INCLUDED
+
+
+#ifndef CATCH_GENERATORS_HPP_INCLUDED
+#define CATCH_GENERATORS_HPP_INCLUDED
+
+
+
+#ifndef CATCH_INTERFACES_GENERATORTRACKER_HPP_INCLUDED
+#define CATCH_INTERFACES_GENERATORTRACKER_HPP_INCLUDED
+
+
+#include <string>
+
+namespace Catch {
+
+ namespace Generators {
+ class GeneratorUntypedBase {
+ // Caches result from `toStringImpl`, assume that when it is an
+ // empty string, the cache is invalidated.
+ mutable std::string m_stringReprCache;
+
+ // Counts based on `next` returning true
+ std::size_t m_currentElementIndex = 0;
+
+ /**
+ * Attempts to move the generator to the next element
+ *
+ * Returns true iff the move succeeded (and a valid element
+ * can be retrieved).
+ */
+ virtual bool next() = 0;
+
+ //! Customization point for `currentElementAsString`
+ virtual std::string stringifyImpl() const = 0;
+
+ public:
+ GeneratorUntypedBase() = default;
+ // Generation of copy ops is deprecated (and Clang will complain)
+ // if there is a user destructor defined
+ GeneratorUntypedBase(GeneratorUntypedBase const&) = default;
+ GeneratorUntypedBase& operator=(GeneratorUntypedBase const&) = default;
+
+ virtual ~GeneratorUntypedBase(); // = default;
+
+ /**
+ * Attempts to move the generator to the next element
+ *
+ * Serves as a non-virtual interface to `next`, so that the
+ * top level interface can provide sanity checking and shared
+ * features.
+ *
+ * As with `next`, returns true iff the move succeeded and
+ * the generator has new valid element to provide.
+ */
+ bool countedNext();
+
+ std::size_t currentElementIndex() const { return m_currentElementIndex; }
+
+ /**
+ * Returns generator's current element as user-friendly string.
+ *
+ * By default returns string equivalent to calling
+ * `Catch::Detail::stringify` on the current element, but generators
+ * can customize their implementation as needed.
+ *
+ * Not thread-safe due to internal caching.
+ *
+ * The returned ref is valid only until the generator instance
+ * is destructed, or it moves onto the next element, whichever
+ * comes first.
+ */
+ StringRef currentElementAsString() const;
+ };
+ using GeneratorBasePtr = Catch::Detail::unique_ptr<GeneratorUntypedBase>;
+
+ } // namespace Generators
+
+ class IGeneratorTracker {
+ public:
+ virtual ~IGeneratorTracker(); // = default;
+ virtual auto hasGenerator() const -> bool = 0;
+ virtual auto getGenerator() const -> Generators::GeneratorBasePtr const& = 0;
+ virtual void setGenerator( Generators::GeneratorBasePtr&& generator ) = 0;
+ };
+
+} // namespace Catch
+
+#endif // CATCH_INTERFACES_GENERATORTRACKER_HPP_INCLUDED
+
+#include <vector>
+#include <tuple>
+
+namespace Catch {
+
+namespace Generators {
+
+namespace Detail {
+
+ //! Throws GeneratorException with the provided message
+ [[noreturn]]
+ void throw_generator_exception(char const * msg);
+
+} // end namespace detail
+
+ template<typename T>
+ class IGenerator : public GeneratorUntypedBase {
+ std::string stringifyImpl() const override {
+ return ::Catch::Detail::stringify( get() );
+ }
+
+ public:
+ ~IGenerator() override = default;
+ IGenerator() = default;
+ IGenerator(IGenerator const&) = default;
+ IGenerator& operator=(IGenerator const&) = default;
+
+
+ // Returns the current element of the generator
+ //
+ // \Precondition The generator is either freshly constructed,
+ // or the last call to `next()` returned true
+ virtual T const& get() const = 0;
+ using type = T;
+ };
+
+ template <typename T>
+ using GeneratorPtr = Catch::Detail::unique_ptr<IGenerator<T>>;
+
+ template <typename T>
+ class GeneratorWrapper final {
+ GeneratorPtr<T> m_generator;
+ public:
+ //! Takes ownership of the passed pointer.
+ GeneratorWrapper(IGenerator<T>* generator):
+ m_generator(generator) {}
+ GeneratorWrapper(GeneratorPtr<T> generator):
+ m_generator(CATCH_MOVE(generator)) {}
+
+ T const& get() const {
+ return m_generator->get();
+ }
+ bool next() {
+ return m_generator->countedNext();
+ }
+ };
+
+
+ template<typename T>
+ class SingleValueGenerator final : public IGenerator<T> {
+ T m_value;
+ public:
+ SingleValueGenerator(T const& value) :
+ m_value(value)
+ {}
+ SingleValueGenerator(T&& value):
+ m_value(CATCH_MOVE(value))
+ {}
+
+ T const& get() const override {
+ return m_value;
+ }
+ bool next() override {
+ return false;
+ }
+ };
+
+ template<typename T>
+ class FixedValuesGenerator final : public IGenerator<T> {
+ static_assert(!std::is_same<T, bool>::value,
+ "FixedValuesGenerator does not support bools because of std::vector<bool>"
+ "specialization, use SingleValue Generator instead.");
+ std::vector<T> m_values;
+ size_t m_idx = 0;
+ public:
+ FixedValuesGenerator( std::initializer_list<T> values ) : m_values( values ) {}
+
+ T const& get() const override {
+ return m_values[m_idx];
+ }
+ bool next() override {
+ ++m_idx;
+ return m_idx < m_values.size();
+ }
+ };
+
+ template <typename T, typename DecayedT = std::decay_t<T>>
+ GeneratorWrapper<DecayedT> value( T&& value ) {
+ return GeneratorWrapper<DecayedT>(
+ Catch::Detail::make_unique<SingleValueGenerator<DecayedT>>(
+ CATCH_FORWARD( value ) ) );
+ }
+ template <typename T>
+ GeneratorWrapper<T> values(std::initializer_list<T> values) {
+ return GeneratorWrapper<T>(Catch::Detail::make_unique<FixedValuesGenerator<T>>(values));
+ }
+
+ template<typename T>
+ class Generators : public IGenerator<T> {
+ std::vector<GeneratorWrapper<T>> m_generators;
+ size_t m_current = 0;
+
+ void add_generator( GeneratorWrapper<T>&& generator ) {
+ m_generators.emplace_back( CATCH_MOVE( generator ) );
+ }
+ void add_generator( T const& val ) {
+ m_generators.emplace_back( value( val ) );
+ }
+ void add_generator( T&& val ) {
+ m_generators.emplace_back( value( CATCH_MOVE( val ) ) );
+ }
+ template <typename U>
+ std::enable_if_t<!std::is_same<std::decay_t<U>, T>::value>
+ add_generator( U&& val ) {
+ add_generator( T( CATCH_FORWARD( val ) ) );
+ }
+
+ template <typename U> void add_generators( U&& valueOrGenerator ) {
+ add_generator( CATCH_FORWARD( valueOrGenerator ) );
+ }
+
+ template <typename U, typename... Gs>
+ void add_generators( U&& valueOrGenerator, Gs&&... moreGenerators ) {
+ add_generator( CATCH_FORWARD( valueOrGenerator ) );
+ add_generators( CATCH_FORWARD( moreGenerators )... );
+ }
+
+ public:
+ template <typename... Gs>
+ Generators(Gs &&... moreGenerators) {
+ m_generators.reserve(sizeof...(Gs));
+ add_generators(CATCH_FORWARD(moreGenerators)...);
+ }
+
+ T const& get() const override {
+ return m_generators[m_current].get();
+ }
+
+ bool next() override {
+ if (m_current >= m_generators.size()) {
+ return false;
+ }
+ const bool current_status = m_generators[m_current].next();
+ if (!current_status) {
+ ++m_current;
+ }
+ return m_current < m_generators.size();
+ }
+ };
+
+
+ template <typename... Ts>
+ GeneratorWrapper<std::tuple<std::decay_t<Ts>...>>
+ table( std::initializer_list<std::tuple<std::decay_t<Ts>...>> tuples ) {
+ return values<std::tuple<Ts...>>( tuples );
+ }
+
+ // Tag type to signal that a generator sequence should convert arguments to a specific type
+ template <typename T>
+ struct as {};
+
+ template<typename T, typename... Gs>
+ auto makeGenerators( GeneratorWrapper<T>&& generator, Gs &&... moreGenerators ) -> Generators<T> {
+ return Generators<T>(CATCH_MOVE(generator), CATCH_FORWARD(moreGenerators)...);
+ }
+ template<typename T>
+ auto makeGenerators( GeneratorWrapper<T>&& generator ) -> Generators<T> {
+ return Generators<T>(CATCH_MOVE(generator));
+ }
+ template<typename T, typename... Gs>
+ auto makeGenerators( T&& val, Gs &&... moreGenerators ) -> Generators<std::decay_t<T>> {
+ return makeGenerators( value( CATCH_FORWARD( val ) ), CATCH_FORWARD( moreGenerators )... );
+ }
+ template<typename T, typename U, typename... Gs>
+ auto makeGenerators( as<T>, U&& val, Gs &&... moreGenerators ) -> Generators<T> {
+ return makeGenerators( value( T( CATCH_FORWARD( val ) ) ), CATCH_FORWARD( moreGenerators )... );
+ }
+
+ auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker&;
+
+ template<typename L>
+ // Note: The type after -> is weird, because VS2015 cannot parse
+ // the expression used in the typedef inside, when it is in
+ // return type. Yeah.
+ auto generate( StringRef generatorName, SourceLineInfo const& lineInfo, L const& generatorExpression ) -> decltype(std::declval<decltype(generatorExpression())>().get()) {
+ using UnderlyingType = typename decltype(generatorExpression())::type;
+
+ IGeneratorTracker& tracker = acquireGeneratorTracker( generatorName, lineInfo );
+ if (!tracker.hasGenerator()) {
+ tracker.setGenerator(Catch::Detail::make_unique<Generators<UnderlyingType>>(generatorExpression()));
+ }
+
+ auto const& generator = static_cast<IGenerator<UnderlyingType> const&>( *tracker.getGenerator() );
+ return generator.get();
+ }
+
+} // namespace Generators
+} // namespace Catch
+
+#define GENERATE( ... ) \
+ Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
+ CATCH_INTERNAL_LINEINFO, \
+ [ ]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
+#define GENERATE_COPY( ... ) \
+ Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
+ CATCH_INTERNAL_LINEINFO, \
+ [=]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
+#define GENERATE_REF( ... ) \
+ Catch::Generators::generate( INTERNAL_CATCH_STRINGIZE(INTERNAL_CATCH_UNIQUE_NAME(generator)), \
+ CATCH_INTERNAL_LINEINFO, \
+ [&]{ using namespace Catch::Generators; return makeGenerators( __VA_ARGS__ ); } ) //NOLINT(google-build-using-namespace)
+
+#endif // CATCH_GENERATORS_HPP_INCLUDED
+
+
+#ifndef CATCH_GENERATORS_ADAPTERS_HPP_INCLUDED
+#define CATCH_GENERATORS_ADAPTERS_HPP_INCLUDED
+
+
+#include <cassert>
+
+namespace Catch {
+namespace Generators {
+
+ template <typename T>
+ class TakeGenerator final : public IGenerator<T> {
+ GeneratorWrapper<T> m_generator;
+ size_t m_returned = 0;
+ size_t m_target;
+ public:
+ TakeGenerator(size_t target, GeneratorWrapper<T>&& generator):
+ m_generator(CATCH_MOVE(generator)),
+ m_target(target)
+ {
+ assert(target != 0 && "Empty generators are not allowed");
+ }
+ T const& get() const override {
+ return m_generator.get();
+ }
+ bool next() override {
+ ++m_returned;
+ if (m_returned >= m_target) {
+ return false;
+ }
+
+ const auto success = m_generator.next();
+ // If the underlying generator does not contain enough values
+ // then we cut short as well
+ if (!success) {
+ m_returned = m_target;
+ }
+ return success;
+ }
+ };
+
+ template <typename T>
+ GeneratorWrapper<T> take(size_t target, GeneratorWrapper<T>&& generator) {
+ return GeneratorWrapper<T>(Catch::Detail::make_unique<TakeGenerator<T>>(target, CATCH_MOVE(generator)));
+ }
+
+
+ template <typename T, typename Predicate>
+ class FilterGenerator final : public IGenerator<T> {
+ GeneratorWrapper<T> m_generator;
+ Predicate m_predicate;
+ public:
+ template <typename P = Predicate>
+ FilterGenerator(P&& pred, GeneratorWrapper<T>&& generator):
+ m_generator(CATCH_MOVE(generator)),
+ m_predicate(CATCH_FORWARD(pred))
+ {
+ if (!m_predicate(m_generator.get())) {
+ // It might happen that there are no values that pass the
+ // filter. In that case we throw an exception.
+ auto has_initial_value = next();
+ if (!has_initial_value) {
+ Detail::throw_generator_exception("No valid value found in filtered generator");
+ }
+ }
+ }
+
+ T const& get() const override {
+ return m_generator.get();
+ }
+
+ bool next() override {
+ bool success = m_generator.next();
+ if (!success) {
+ return false;
+ }
+ while (!m_predicate(m_generator.get()) && (success = m_generator.next()) == true);
+ return success;
+ }
+ };
+
+
+ template <typename T, typename Predicate>
+ GeneratorWrapper<T> filter(Predicate&& pred, GeneratorWrapper<T>&& generator) {
+ return GeneratorWrapper<T>(Catch::Detail::make_unique<FilterGenerator<T, Predicate>>(CATCH_FORWARD(pred), CATCH_MOVE(generator)));
+ }
+
+ template <typename T>
+ class RepeatGenerator final : public IGenerator<T> {
+ static_assert(!std::is_same<T, bool>::value,
+ "RepeatGenerator currently does not support bools"
+ "because of std::vector<bool> specialization");
+ GeneratorWrapper<T> m_generator;
+ mutable std::vector<T> m_returned;
+ size_t m_target_repeats;
+ size_t m_current_repeat = 0;
+ size_t m_repeat_index = 0;
+ public:
+ RepeatGenerator(size_t repeats, GeneratorWrapper<T>&& generator):
+ m_generator(CATCH_MOVE(generator)),
+ m_target_repeats(repeats)
+ {
+ assert(m_target_repeats > 0 && "Repeat generator must repeat at least once");
+ }
+
+ T const& get() const override {
+ if (m_current_repeat == 0) {
+ m_returned.push_back(m_generator.get());
+ return m_returned.back();
+ }
+ return m_returned[m_repeat_index];
+ }
+
+ bool next() override {
+ // There are 2 basic cases:
+ // 1) We are still reading the generator
+ // 2) We are reading our own cache
+
+ // In the first case, we need to poke the underlying generator.
+ // If it happily moves, we are left in that state, otherwise it is time to start reading from our cache
+ if (m_current_repeat == 0) {
+ const auto success = m_generator.next();
+ if (!success) {
+ ++m_current_repeat;
+ }
+ return m_current_repeat < m_target_repeats;
+ }
+
+ // In the second case, we need to move indices forward and check that we haven't run up against the end
+ ++m_repeat_index;
+ if (m_repeat_index == m_returned.size()) {
+ m_repeat_index = 0;
+ ++m_current_repeat;
+ }
+ return m_current_repeat < m_target_repeats;
+ }
+ };
+
+ template <typename T>
+ GeneratorWrapper<T> repeat(size_t repeats, GeneratorWrapper<T>&& generator) {
+ return GeneratorWrapper<T>(Catch::Detail::make_unique<RepeatGenerator<T>>(repeats, CATCH_MOVE(generator)));
+ }
+
+ template <typename T, typename U, typename Func>
+ class MapGenerator final : public IGenerator<T> {
+ // TBD: provide static assert for mapping function, for friendly error message
+ GeneratorWrapper<U> m_generator;
+ Func m_function;
+ // To avoid returning dangling reference, we have to save the values
+ T m_cache;
+ public:
+ template <typename F2 = Func>
+ MapGenerator(F2&& function, GeneratorWrapper<U>&& generator) :
+ m_generator(CATCH_MOVE(generator)),
+ m_function(CATCH_FORWARD(function)),
+ m_cache(m_function(m_generator.get()))
+ {}
+
+ T const& get() const override {
+ return m_cache;
+ }
+ bool next() override {
+ const auto success = m_generator.next();
+ if (success) {
+ m_cache = m_function(m_generator.get());
+ }
+ return success;
+ }
+ };
+
+ template <typename Func, typename U, typename T = FunctionReturnType<Func, U>>
+ GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) {
+ return GeneratorWrapper<T>(
+ Catch::Detail::make_unique<MapGenerator<T, U, Func>>(CATCH_FORWARD(function), CATCH_MOVE(generator))
+ );
+ }
+
+ template <typename T, typename U, typename Func>
+ GeneratorWrapper<T> map(Func&& function, GeneratorWrapper<U>&& generator) {
+ return GeneratorWrapper<T>(
+ Catch::Detail::make_unique<MapGenerator<T, U, Func>>(CATCH_FORWARD(function), CATCH_MOVE(generator))
+ );
+ }
+
+ template <typename T>
+ class ChunkGenerator final : public IGenerator<std::vector<T>> {
+ std::vector<T> m_chunk;
+ size_t m_chunk_size;
+ GeneratorWrapper<T> m_generator;
+ bool m_used_up = false;
+ public:
+ ChunkGenerator(size_t size, GeneratorWrapper<T> generator) :
+ m_chunk_size(size), m_generator(CATCH_MOVE(generator))
+ {
+ m_chunk.reserve(m_chunk_size);
+ if (m_chunk_size != 0) {
+ m_chunk.push_back(m_generator.get());
+ for (size_t i = 1; i < m_chunk_size; ++i) {
+ if (!m_generator.next()) {
+ Detail::throw_generator_exception("Not enough values to initialize the first chunk");
+ }
+ m_chunk.push_back(m_generator.get());
+ }
+ }
+ }
+ std::vector<T> const& get() const override {
+ return m_chunk;
+ }
+ bool next() override {
+ m_chunk.clear();
+ for (size_t idx = 0; idx < m_chunk_size; ++idx) {
+ if (!m_generator.next()) {
+ return false;
+ }
+ m_chunk.push_back(m_generator.get());
+ }
+ return true;
+ }
+ };
+
+ template <typename T>
+ GeneratorWrapper<std::vector<T>> chunk(size_t size, GeneratorWrapper<T>&& generator) {
+ return GeneratorWrapper<std::vector<T>>(
+ Catch::Detail::make_unique<ChunkGenerator<T>>(size, CATCH_MOVE(generator))
+ );
+ }
+
+} // namespace Generators
+} // namespace Catch
+
+
+#endif // CATCH_GENERATORS_ADAPTERS_HPP_INCLUDED
+
+
+#ifndef CATCH_GENERATORS_RANDOM_HPP_INCLUDED
+#define CATCH_GENERATORS_RANDOM_HPP_INCLUDED
+
+
+
+#ifndef CATCH_RANDOM_NUMBER_GENERATOR_HPP_INCLUDED
+#define CATCH_RANDOM_NUMBER_GENERATOR_HPP_INCLUDED
+
+#include <cstdint>
+
+namespace Catch {
+
+ // This is a simple implementation of C++11 Uniform Random Number
+ // Generator. It does not provide all operators, because Catch2
+ // does not use it, but it should behave as expected inside stdlib's
+ // distributions.
+ // The implementation is based on the PCG family (http://pcg-random.org)
+ class SimplePcg32 {
+ using state_type = std::uint64_t;
+ public:
+ using result_type = std::uint32_t;
+ static constexpr result_type (min)() {
+ return 0;
+ }
+ static constexpr result_type (max)() {
+ return static_cast<result_type>(-1);
+ }
+
+ // Provide some default initial state for the default constructor
+ SimplePcg32():SimplePcg32(0xed743cc4U) {}
+
+ explicit SimplePcg32(result_type seed_);
+
+ void seed(result_type seed_);
+ void discard(uint64_t skip);
+
+ result_type operator()();
+
+ private:
+ friend bool operator==(SimplePcg32 const& lhs, SimplePcg32 const& rhs);
+ friend bool operator!=(SimplePcg32 const& lhs, SimplePcg32 const& rhs);
+
+ // In theory we also need operator<< and operator>>
+ // In practice we do not use them, so we will skip them for now
+
+
+ std::uint64_t m_state;
+ // This part of the state determines which "stream" of the numbers
+ // is chosen -- we take it as a constant for Catch2, so we only
+ // need to deal with seeding the main state.
+ // Picked by reading 8 bytes from `/dev/random` :-)
+ static const std::uint64_t s_inc = (0x13ed0cc53f939476ULL << 1ULL) | 1ULL;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_RANDOM_NUMBER_GENERATOR_HPP_INCLUDED
+
+#include <random>
+
+namespace Catch {
+namespace Generators {
+namespace Detail {
+ // Returns a suitable seed for a random floating generator based off
+ // the primary internal rng. It does so by taking current value from
+ // the rng and returning it as the seed.
+ std::uint32_t getSeed();
+}
+
+template <typename Float>
+class RandomFloatingGenerator final : public IGenerator<Float> {
+ Catch::SimplePcg32 m_rng;
+ std::uniform_real_distribution<Float> m_dist;
+ Float m_current_number;
+public:
+ RandomFloatingGenerator( Float a, Float b, std::uint32_t seed ):
+ m_rng(seed),
+ m_dist(a, b) {
+ static_cast<void>(next());
+ }
+
+ Float const& get() const override {
+ return m_current_number;
+ }
+ bool next() override {
+ m_current_number = m_dist(m_rng);
+ return true;
+ }
+};
+
+template <typename Integer>
+class RandomIntegerGenerator final : public IGenerator<Integer> {
+ Catch::SimplePcg32 m_rng;
+ std::uniform_int_distribution<Integer> m_dist;
+ Integer m_current_number;
+public:
+ RandomIntegerGenerator( Integer a, Integer b, std::uint32_t seed ):
+ m_rng(seed),
+ m_dist(a, b) {
+ static_cast<void>(next());
+ }
+
+ Integer const& get() const override {
+ return m_current_number;
+ }
+ bool next() override {
+ m_current_number = m_dist(m_rng);
+ return true;
+ }
+};
+
+template <typename T>
+std::enable_if_t<std::is_integral<T>::value, GeneratorWrapper<T>>
+random(T a, T b) {
+ static_assert(
+ !std::is_same<T, char>::value &&
+ !std::is_same<T, int8_t>::value &&
+ !std::is_same<T, uint8_t>::value &&
+ !std::is_same<T, signed char>::value &&
+ !std::is_same<T, unsigned char>::value &&
+ !std::is_same<T, bool>::value,
+ "The requested type is not supported by the underlying random distributions from std" );
+ return GeneratorWrapper<T>(
+ Catch::Detail::make_unique<RandomIntegerGenerator<T>>(a, b, Detail::getSeed())
+ );
+}
+
+template <typename T>
+std::enable_if_t<std::is_floating_point<T>::value,
+GeneratorWrapper<T>>
+random(T a, T b) {
+ return GeneratorWrapper<T>(
+ Catch::Detail::make_unique<RandomFloatingGenerator<T>>(a, b, Detail::getSeed())
+ );
+}
+
+
+} // namespace Generators
+} // namespace Catch
+
+
+#endif // CATCH_GENERATORS_RANDOM_HPP_INCLUDED
+
+
+#ifndef CATCH_GENERATORS_RANGE_HPP_INCLUDED
+#define CATCH_GENERATORS_RANGE_HPP_INCLUDED
+
+
+#include <iterator>
+#include <type_traits>
+
+namespace Catch {
+namespace Generators {
+
+
+template <typename T>
+class RangeGenerator final : public IGenerator<T> {
+ T m_current;
+ T m_end;
+ T m_step;
+ bool m_positive;
+
+public:
+ RangeGenerator(T const& start, T const& end, T const& step):
+ m_current(start),
+ m_end(end),
+ m_step(step),
+ m_positive(m_step > T(0))
+ {
+ assert(m_current != m_end && "Range start and end cannot be equal");
+ assert(m_step != T(0) && "Step size cannot be zero");
+ assert(((m_positive && m_current <= m_end) || (!m_positive && m_current >= m_end)) && "Step moves away from end");
+ }
+
+ RangeGenerator(T const& start, T const& end):
+ RangeGenerator(start, end, (start < end) ? T(1) : T(-1))
+ {}
+
+ T const& get() const override {
+ return m_current;
+ }
+
+ bool next() override {
+ m_current += m_step;
+ return (m_positive) ? (m_current < m_end) : (m_current > m_end);
+ }
+};
+
+template <typename T>
+GeneratorWrapper<T> range(T const& start, T const& end, T const& step) {
+ static_assert(std::is_arithmetic<T>::value && !std::is_same<T, bool>::value, "Type must be numeric");
+ return GeneratorWrapper<T>(Catch::Detail::make_unique<RangeGenerator<T>>(start, end, step));
+}
+
+template <typename T>
+GeneratorWrapper<T> range(T const& start, T const& end) {
+ static_assert(std::is_integral<T>::value && !std::is_same<T, bool>::value, "Type must be an integer");
+ return GeneratorWrapper<T>(Catch::Detail::make_unique<RangeGenerator<T>>(start, end));
+}
+
+
+template <typename T>
+class IteratorGenerator final : public IGenerator<T> {
+ static_assert(!std::is_same<T, bool>::value,
+ "IteratorGenerator currently does not support bools"
+ "because of std::vector<bool> specialization");
+
+ std::vector<T> m_elems;
+ size_t m_current = 0;
+public:
+ template <typename InputIterator, typename InputSentinel>
+ IteratorGenerator(InputIterator first, InputSentinel last):m_elems(first, last) {
+ if (m_elems.empty()) {
+ Detail::throw_generator_exception("IteratorGenerator received no valid values");
+ }
+ }
+
+ T const& get() const override {
+ return m_elems[m_current];
+ }
+
+ bool next() override {
+ ++m_current;
+ return m_current != m_elems.size();
+ }
+};
+
+template <typename InputIterator,
+ typename InputSentinel,
+ typename ResultType = typename std::iterator_traits<InputIterator>::value_type>
+GeneratorWrapper<ResultType> from_range(InputIterator from, InputSentinel to) {
+ return GeneratorWrapper<ResultType>(Catch::Detail::make_unique<IteratorGenerator<ResultType>>(from, to));
+}
+
+template <typename Container,
+ typename ResultType = typename Container::value_type>
+GeneratorWrapper<ResultType> from_range(Container const& cnt) {
+ return GeneratorWrapper<ResultType>(Catch::Detail::make_unique<IteratorGenerator<ResultType>>(cnt.begin(), cnt.end()));
+}
+
+
+} // namespace Generators
+} // namespace Catch
+
+
+#endif // CATCH_GENERATORS_RANGE_HPP_INCLUDED
+
+#endif // CATCH_GENERATORS_ALL_HPP_INCLUDED
+
+
+/** \file
+ * This is a convenience header for Catch2's interfaces. It includes
+ * **all** of Catch2 headers related to interfaces.
+ *
+ * Generally the Catch2 users should use specific includes they need,
+ * but this header can be used instead for ease-of-experimentation, or
+ * just plain convenience, at the cost of somewhat increased compilation
+ * times.
+ *
+ * When a new header is added to either the `interfaces` folder, or to
+ * the corresponding internal subfolder, it should be added here.
+ */
+
+
+#ifndef CATCH_INTERFACES_ALL_HPP_INCLUDED
+#define CATCH_INTERFACES_ALL_HPP_INCLUDED
+
+
+
+#ifndef CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED
+#define CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED
+
+
+#include <string>
+
+namespace Catch {
+
+ struct ReporterConfig;
+ class IConfig;
+ class IEventListener;
+ using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
+
+
+ class IReporterFactory {
+ public:
+ virtual ~IReporterFactory(); // = default
+
+ virtual IEventListenerPtr
+ create( ReporterConfig&& config ) const = 0;
+ virtual std::string getDescription() const = 0;
+ };
+ using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
+
+ class EventListenerFactory {
+ public:
+ virtual ~EventListenerFactory(); // = default
+ virtual IEventListenerPtr create( IConfig const* config ) const = 0;
+ //! Return a meaningful name for the listener, e.g. its type name
+ virtual StringRef getName() const = 0;
+ //! Return listener's description if available
+ virtual std::string getDescription() const = 0;
+ };
+} // namespace Catch
+
+#endif // CATCH_INTERFACES_REPORTER_FACTORY_HPP_INCLUDED
+
+
+#ifndef CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED
+#define CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED
+
+
+
+#ifndef CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED
+#define CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED
+
+
+namespace Catch {
+ namespace Detail {
+ //! Provides case-insensitive `op<` semantics when called
+ struct CaseInsensitiveLess {
+ bool operator()( StringRef lhs,
+ StringRef rhs ) const;
+ };
+
+ //! Provides case-insensitive `op==` semantics when called
+ struct CaseInsensitiveEqualTo {
+ bool operator()( StringRef lhs,
+ StringRef rhs ) const;
+ };
+
+ } // namespace Detail
+} // namespace Catch
+
+#endif // CATCH_CASE_INSENSITIVE_COMPARISONS_HPP_INCLUDED
+
+#include <string>
+#include <vector>
+#include <map>
+
+namespace Catch {
+
+ class IConfig;
+
+ class IEventListener;
+ using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
+ class IReporterFactory;
+ using IReporterFactoryPtr = Detail::unique_ptr<IReporterFactory>;
+ struct ReporterConfig;
+ class EventListenerFactory;
+
+ class IReporterRegistry {
+ public:
+ using FactoryMap = std::map<std::string, IReporterFactoryPtr, Detail::CaseInsensitiveLess>;
+ using Listeners = std::vector<Detail::unique_ptr<EventListenerFactory>>;
+
+ virtual ~IReporterRegistry(); // = default
+ virtual IEventListenerPtr create( std::string const& name, ReporterConfig&& config ) const = 0;
+ virtual FactoryMap const& getFactories() const = 0;
+ virtual Listeners const& getListeners() const = 0;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_INTERFACES_REPORTER_REGISTRY_HPP_INCLUDED
+
+
+#ifndef CATCH_INTERFACES_TAG_ALIAS_REGISTRY_HPP_INCLUDED
+#define CATCH_INTERFACES_TAG_ALIAS_REGISTRY_HPP_INCLUDED
+
+#include <string>
+
+namespace Catch {
+
+ struct TagAlias;
+
+ class ITagAliasRegistry {
+ public:
+ virtual ~ITagAliasRegistry(); // = default
+ // Nullptr if not present
+ virtual TagAlias const* find( std::string const& alias ) const = 0;
+ virtual std::string expandAliases( std::string const& unexpandedTestSpec ) const = 0;
+
+ static ITagAliasRegistry const& get();
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_INTERFACES_TAG_ALIAS_REGISTRY_HPP_INCLUDED
+
+#endif // CATCH_INTERFACES_ALL_HPP_INCLUDED
+
+
+
+/** \file
+ * Wrapper for ANDROID_LOGWRITE configuration option
+ *
+ * We want to default to enabling it when compiled for android, but
+ * users of the library should also be able to disable it if they want
+ * to.
+ */
+
+#ifndef CATCH_CONFIG_ANDROID_LOGWRITE_HPP_INCLUDED
+#define CATCH_CONFIG_ANDROID_LOGWRITE_HPP_INCLUDED
+
+
+#if defined(__ANDROID__)
+# define CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE
+#endif
+
+
+#if defined( CATCH_INTERNAL_CONFIG_ANDROID_LOGWRITE ) && \
+ !defined( CATCH_CONFIG_NO_ANDROID_LOGWRITE ) && \
+ !defined( CATCH_CONFIG_ANDROID_LOGWRITE )
+# define CATCH_CONFIG_ANDROID_LOGWRITE
+#endif
+
+#endif // CATCH_CONFIG_ANDROID_LOGWRITE_HPP_INCLUDED
+
+
+
+/** \file
+ * Wrapper for UNCAUGHT_EXCEPTIONS configuration option
+ *
+ * For some functionality, Catch2 requires to know whether there is
+ * an active exception. Because `std::uncaught_exception` is deprecated
+ * in C++17, we want to use `std::uncaught_exceptions` if possible.
+ */
+
+#ifndef CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
+#define CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
+
+#if defined(_MSC_VER)
+# if _MSC_VER >= 1900 // Visual Studio 2015 or newer
+# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
+# endif
+#endif
+
+
+#include <exception>
+
+#if defined(__cpp_lib_uncaught_exceptions) \
+ && !defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
+
+# define CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
+#endif // __cpp_lib_uncaught_exceptions
+
+
+#if defined(CATCH_INTERNAL_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS) \
+ && !defined(CATCH_CONFIG_NO_CPP17_UNCAUGHT_EXCEPTIONS) \
+ && !defined(CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS)
+
+# define CATCH_CONFIG_CPP17_UNCAUGHT_EXCEPTIONS
+#endif
+
+
+#endif // CATCH_CONFIG_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
+
+
+#ifndef CATCH_CONSOLE_WIDTH_HPP_INCLUDED
+#define CATCH_CONSOLE_WIDTH_HPP_INCLUDED
+
+// This include must be kept so that user's configured value for CONSOLE_WIDTH
+// is used before we attempt to provide a default value
+
+#ifndef CATCH_CONFIG_CONSOLE_WIDTH
+#define CATCH_CONFIG_CONSOLE_WIDTH 80
+#endif
+
+#endif // CATCH_CONSOLE_WIDTH_HPP_INCLUDED
+
+
+#ifndef CATCH_CONTAINER_NONMEMBERS_HPP_INCLUDED
+#define CATCH_CONTAINER_NONMEMBERS_HPP_INCLUDED
+
+
+#include <cstddef>
+#include <initializer_list>
+
+// We want a simple polyfill over `std::empty`, `std::size` and so on
+// for C++14 or C++ libraries with incomplete support.
+// We also have to handle that MSVC std lib will happily provide these
+// under older standards.
+#if defined(CATCH_CPP17_OR_GREATER) || defined(_MSC_VER)
+
+// We are already using this header either way, so there shouldn't
+// be much additional overhead in including it to get the feature
+// test macros
+#include <string>
+
+# if !defined(__cpp_lib_nonmember_container_access)
+# define CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS
+# endif
+
+#else
+#define CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS
+#endif
+
+
+
+namespace Catch {
+namespace Detail {
+
+#if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS)
+ template <typename Container>
+ constexpr auto empty(Container const& cont) -> decltype(cont.empty()) {
+ return cont.empty();
+ }
+ template <typename T, std::size_t N>
+ constexpr bool empty(const T (&)[N]) noexcept {
+ // GCC < 7 does not support the const T(&)[] parameter syntax
+ // so we have to ignore the length explicitly
+ (void)N;
+ return false;
+ }
+ template <typename T>
+ constexpr bool empty(std::initializer_list<T> list) noexcept {
+ return list.size() > 0;
+ }
+
+
+ template <typename Container>
+ constexpr auto size(Container const& cont) -> decltype(cont.size()) {
+ return cont.size();
+ }
+ template <typename T, std::size_t N>
+ constexpr std::size_t size(const T(&)[N]) noexcept {
+ return N;
+ }
+#endif // CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS
+
+} // end namespace Detail
+} // end namespace Catch
+
+
+
+#endif // CATCH_CONTAINER_NONMEMBERS_HPP_INCLUDED
+
+
+#ifndef CATCH_DEBUG_CONSOLE_HPP_INCLUDED
+#define CATCH_DEBUG_CONSOLE_HPP_INCLUDED
+
+#include <string>
+
+namespace Catch {
+ void writeToDebugConsole( std::string const& text );
+}
+
+#endif // CATCH_DEBUG_CONSOLE_HPP_INCLUDED
+
+
+#ifndef CATCH_DEBUGGER_HPP_INCLUDED
+#define CATCH_DEBUGGER_HPP_INCLUDED
+
+
+namespace Catch {
+ bool isDebuggerActive();
+}
+
+#ifdef CATCH_PLATFORM_MAC
+
+ #if defined(__i386__) || defined(__x86_64__)
+ #define CATCH_TRAP() __asm__("int $3\n" : : ) /* NOLINT */
+ #elif defined(__aarch64__)
+ #define CATCH_TRAP() __asm__(".inst 0xd43e0000")
+ #endif
+
+#elif defined(CATCH_PLATFORM_IPHONE)
+
+ // use inline assembler
+ #if defined(__i386__) || defined(__x86_64__)
+ #define CATCH_TRAP() __asm__("int $3")
+ #elif defined(__aarch64__)
+ #define CATCH_TRAP() __asm__(".inst 0xd4200000")
+ #elif defined(__arm__) && !defined(__thumb__)
+ #define CATCH_TRAP() __asm__(".inst 0xe7f001f0")
+ #elif defined(__arm__) && defined(__thumb__)
+ #define CATCH_TRAP() __asm__(".inst 0xde01")
+ #endif
+
+#elif defined(CATCH_PLATFORM_LINUX)
+ // If we can use inline assembler, do it because this allows us to break
+ // directly at the location of the failing check instead of breaking inside
+ // raise() called from it, i.e. one stack frame below.
+ #if defined(__GNUC__) && (defined(__i386) || defined(__x86_64))
+ #define CATCH_TRAP() asm volatile ("int $3") /* NOLINT */
+ #else // Fall back to the generic way.
+ #include <signal.h>
+
+ #define CATCH_TRAP() raise(SIGTRAP)
+ #endif
+#elif defined(_MSC_VER)
+ #define CATCH_TRAP() __debugbreak()
+#elif defined(__MINGW32__)
+ extern "C" __declspec(dllimport) void __stdcall DebugBreak();
+ #define CATCH_TRAP() DebugBreak()
+#endif
+
+#ifndef CATCH_BREAK_INTO_DEBUGGER
+ #ifdef CATCH_TRAP
+ #define CATCH_BREAK_INTO_DEBUGGER() []{ if( Catch::isDebuggerActive() ) { CATCH_TRAP(); } }()
+ #else
+ #define CATCH_BREAK_INTO_DEBUGGER() []{}()
+ #endif
+#endif
+
+#endif // CATCH_DEBUGGER_HPP_INCLUDED
+
+
+#ifndef CATCH_ENFORCE_HPP_INCLUDED
+#define CATCH_ENFORCE_HPP_INCLUDED
+
+
+#include <exception>
+
+namespace Catch {
+#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+ template <typename Ex>
+ [[noreturn]]
+ void throw_exception(Ex const& e) {
+ throw e;
+ }
+#else // ^^ Exceptions are enabled // Exceptions are disabled vv
+ [[noreturn]]
+ void throw_exception(std::exception const& e);
+#endif
+
+ [[noreturn]]
+ void throw_logic_error(std::string const& msg);
+ [[noreturn]]
+ void throw_domain_error(std::string const& msg);
+ [[noreturn]]
+ void throw_runtime_error(std::string const& msg);
+
+} // namespace Catch;
+
+#define CATCH_MAKE_MSG(...) \
+ (Catch::ReusableStringStream() << __VA_ARGS__).str()
+
+#define CATCH_INTERNAL_ERROR(...) \
+ Catch::throw_logic_error(CATCH_MAKE_MSG( CATCH_INTERNAL_LINEINFO << ": Internal Catch2 error: " << __VA_ARGS__))
+
+#define CATCH_ERROR(...) \
+ Catch::throw_domain_error(CATCH_MAKE_MSG( __VA_ARGS__ ))
+
+#define CATCH_RUNTIME_ERROR(...) \
+ Catch::throw_runtime_error(CATCH_MAKE_MSG( __VA_ARGS__ ))
+
+#define CATCH_ENFORCE( condition, ... ) \
+ do{ if( !(condition) ) CATCH_ERROR( __VA_ARGS__ ); } while(false)
+
+
+#endif // CATCH_ENFORCE_HPP_INCLUDED
+
+
+#ifndef CATCH_ENUM_VALUES_REGISTRY_HPP_INCLUDED
+#define CATCH_ENUM_VALUES_REGISTRY_HPP_INCLUDED
+
+
+#include <vector>
+
+namespace Catch {
+
+ namespace Detail {
+
+ Catch::Detail::unique_ptr<EnumInfo> makeEnumInfo( StringRef enumName, StringRef allValueNames, std::vector<int> const& values );
+
+ class EnumValuesRegistry : public IMutableEnumValuesRegistry {
+
+ std::vector<Catch::Detail::unique_ptr<EnumInfo>> m_enumInfos;
+
+ EnumInfo const& registerEnum( StringRef enumName, StringRef allEnums, std::vector<int> const& values) override;
+ };
+
+ std::vector<StringRef> parseEnums( StringRef enums );
+
+ } // Detail
+
+} // Catch
+
+#endif // CATCH_ENUM_VALUES_REGISTRY_HPP_INCLUDED
+
+
+#ifndef CATCH_ERRNO_GUARD_HPP_INCLUDED
+#define CATCH_ERRNO_GUARD_HPP_INCLUDED
+
+namespace Catch {
+
+ //! Simple RAII class that stores the value of `errno`
+ //! at construction and restores it at destruction.
+ class ErrnoGuard {
+ public:
+ // Keep these outlined to avoid dragging in macros from <cerrno>
+
+ ErrnoGuard();
+ ~ErrnoGuard();
+ private:
+ int m_oldErrno;
+ };
+
+}
+
+#endif // CATCH_ERRNO_GUARD_HPP_INCLUDED
+
+
+#ifndef CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED
+#define CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED
+
+
+#include <vector>
+#include <string>
+
+namespace Catch {
+
+ class ExceptionTranslatorRegistry : public IExceptionTranslatorRegistry {
+ public:
+ ~ExceptionTranslatorRegistry() override;
+ void registerTranslator( Detail::unique_ptr<IExceptionTranslator>&& translator );
+ std::string translateActiveException() const override;
+ std::string tryTranslators() const;
+
+ private:
+ ExceptionTranslators m_translators;
+ };
+}
+
+#endif // CATCH_EXCEPTION_TRANSLATOR_REGISTRY_HPP_INCLUDED
+
+
+#ifndef CATCH_FATAL_CONDITION_HANDLER_HPP_INCLUDED
+#define CATCH_FATAL_CONDITION_HANDLER_HPP_INCLUDED
+
+
+#include <cassert>
+
+namespace Catch {
+
+ /**
+ * Wrapper for platform-specific fatal error (signals/SEH) handlers
+ *
+ * Tries to be cooperative with other handlers, and not step over
+ * other handlers. This means that unknown structured exceptions
+ * are passed on, previous signal handlers are called, and so on.
+ *
+ * Can only be instantiated once, and assumes that once a signal
+ * is caught, the binary will end up terminating. Thus, there
+ */
+ class FatalConditionHandler {
+ bool m_started = false;
+
+ // Install/disengage implementation for specific platform.
+ // Should be if-defed to work on current platform, can assume
+ // engage-disengage 1:1 pairing.
+ void engage_platform();
+ void disengage_platform() noexcept;
+ public:
+ // Should also have platform-specific implementations as needed
+ FatalConditionHandler();
+ ~FatalConditionHandler();
+
+ void engage() {
+ assert(!m_started && "Handler cannot be installed twice.");
+ m_started = true;
+ engage_platform();
+ }
+
+ void disengage() noexcept {
+ assert(m_started && "Handler cannot be uninstalled without being installed first");
+ m_started = false;
+ disengage_platform();
+ }
+ };
+
+ //! Simple RAII guard for (dis)engaging the FatalConditionHandler
+ class FatalConditionHandlerGuard {
+ FatalConditionHandler* m_handler;
+ public:
+ FatalConditionHandlerGuard(FatalConditionHandler* handler):
+ m_handler(handler) {
+ m_handler->engage();
+ }
+ ~FatalConditionHandlerGuard() {
+ m_handler->disengage();
+ }
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_FATAL_CONDITION_HANDLER_HPP_INCLUDED
+
+
+#ifndef CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED
+#define CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED
+
+
+
+#ifndef CATCH_POLYFILLS_HPP_INCLUDED
+#define CATCH_POLYFILLS_HPP_INCLUDED
+
+namespace Catch {
+ bool isnan(float f);
+ bool isnan(double d);
+}
+
+#endif // CATCH_POLYFILLS_HPP_INCLUDED
+
+#include <cassert>
+#include <cmath>
+#include <cstdint>
+#include <utility>
+#include <limits>
+
+namespace Catch {
+ namespace Detail {
+
+ uint32_t convertToBits(float f);
+ uint64_t convertToBits(double d);
+
+ } // end namespace Detail
+
+
+
+#if defined( __GNUC__ ) || defined( __clang__ )
+# pragma GCC diagnostic push
+ // We do a bunch of direct compensations of floating point numbers,
+ // because we know what we are doing and actually do want the direct
+ // comparison behaviour.
+# pragma GCC diagnostic ignored "-Wfloat-equal"
+#endif
+
+ /**
+ * Calculates the ULP distance between two floating point numbers
+ *
+ * The ULP distance of two floating point numbers is the count of
+ * valid floating point numbers representable between them.
+ *
+ * There are some exceptions between how this function counts the
+ * distance, and the interpretation of the standard as implemented.
+ * by e.g. `nextafter`. For this function it always holds that:
+ * * `(x == y) => ulpDistance(x, y) == 0` (so `ulpDistance(-0, 0) == 0`)
+ * * `ulpDistance(maxFinite, INF) == 1`
+ * * `ulpDistance(x, -x) == 2 * ulpDistance(x, 0)`
+ *
+ * \pre `!isnan( lhs )`
+ * \pre `!isnan( rhs )`
+ * \pre floating point numbers are represented in IEEE-754 format
+ */
+ template <typename FP>
+ uint64_t ulpDistance( FP lhs, FP rhs ) {
+ assert( std::numeric_limits<FP>::is_iec559 &&
+ "ulpDistance assumes IEEE-754 format for floating point types" );
+ assert( !Catch::isnan( lhs ) &&
+ "Distance between NaN and number is not meaningful" );
+ assert( !Catch::isnan( rhs ) &&
+ "Distance between NaN and number is not meaningful" );
+
+ // We want X == Y to imply 0 ULP distance even if X and Y aren't
+ // bit-equal (-0 and 0), or X - Y != 0 (same sign infinities).
+ if ( lhs == rhs ) { return 0; }
+
+ // We need a properly typed positive zero for type inference.
+ static constexpr FP positive_zero{};
+
+ // We want to ensure that +/- 0 is always represented as positive zero
+ if ( lhs == positive_zero ) { lhs = positive_zero; }
+ if ( rhs == positive_zero ) { rhs = positive_zero; }
+
+ // If arguments have different signs, we can handle them by summing
+ // how far are they from 0 each.
+ if ( std::signbit( lhs ) != std::signbit( rhs ) ) {
+ return ulpDistance( std::abs( lhs ), positive_zero ) +
+ ulpDistance( std::abs( rhs ), positive_zero );
+ }
+
+ // When both lhs and rhs are of the same sign, we can just
+ // read the numbers bitwise as integers, and then subtract them
+ // (assuming IEEE).
+ uint64_t lc = Detail::convertToBits( lhs );
+ uint64_t rc = Detail::convertToBits( rhs );
+
+ // The ulp distance between two numbers is symmetric, so to avoid
+ // dealing with overflows we want the bigger converted number on the lhs
+ if ( lc < rc ) {
+ std::swap( lc, rc );
+ }
+
+ return lc - rc;
+ }
+
+#if defined( __GNUC__ ) || defined( __clang__ )
+# pragma GCC diagnostic pop
+#endif
+
+
+} // end namespace Catch
+
+#endif // CATCH_FLOATING_POINT_HELPERS_HPP_INCLUDED
+
+
+#ifndef CATCH_ISTREAM_HPP_INCLUDED
+#define CATCH_ISTREAM_HPP_INCLUDED
+
+
+#include <iosfwd>
+#include <cstddef>
+#include <ostream>
+#include <string>
+
+namespace Catch {
+
+ class IStream {
+ public:
+ virtual ~IStream(); // = default
+ virtual std::ostream& stream() = 0;
+ /**
+ * Best guess on whether the instance is writing to a console (e.g. via stdout/stderr)
+ *
+ * This is useful for e.g. Win32 colour support, because the Win32
+ * API manipulates console directly, unlike POSIX escape codes,
+ * that can be written anywhere.
+ *
+ * Due to variety of ways to change where the stdout/stderr is
+ * _actually_ being written, users should always assume that
+ * the answer might be wrong.
+ */
+ virtual bool isConsole() const { return false; }
+ };
+
+ /**
+ * Creates a stream wrapper that writes to specific file.
+ *
+ * Also recognizes 4 special filenames
+ * * `-` for stdout
+ * * `%stdout` for stdout
+ * * `%stderr` for stderr
+ * * `%debug` for platform specific debugging output
+ *
+ * \throws if passed an unrecognized %-prefixed stream
+ */
+ auto makeStream( std::string const& filename ) -> Detail::unique_ptr<IStream>;
+
+}
+
+#endif // CATCH_STREAM_HPP_INCLUDED
+
+
+#ifndef CATCH_LEAK_DETECTOR_HPP_INCLUDED
+#define CATCH_LEAK_DETECTOR_HPP_INCLUDED
+
+namespace Catch {
+
+ struct LeakDetector {
+ LeakDetector();
+ ~LeakDetector();
+ };
+
+}
+#endif // CATCH_LEAK_DETECTOR_HPP_INCLUDED
+
+
+#ifndef CATCH_LIST_HPP_INCLUDED
+#define CATCH_LIST_HPP_INCLUDED
+
+
+#include <set>
+#include <string>
+
+
+namespace Catch {
+
+ class IEventListener;
+ class Config;
+
+
+ struct ReporterDescription {
+ std::string name, description;
+ };
+ struct ListenerDescription {
+ StringRef name;
+ std::string description;
+ };
+
+ struct TagInfo {
+ void add(StringRef spelling);
+ std::string all() const;
+
+ std::set<StringRef> spellings;
+ std::size_t count = 0;
+ };
+
+ bool list( IEventListener& reporter, Config const& config );
+
+} // end namespace Catch
+
+#endif // CATCH_LIST_HPP_INCLUDED
+
+
+#ifndef CATCH_OUTPUT_REDIRECT_HPP_INCLUDED
+#define CATCH_OUTPUT_REDIRECT_HPP_INCLUDED
+
+
+#include <cstdio>
+#include <iosfwd>
+#include <string>
+
+namespace Catch {
+
+ class RedirectedStream {
+ std::ostream& m_originalStream;
+ std::ostream& m_redirectionStream;
+ std::streambuf* m_prevBuf;
+
+ public:
+ RedirectedStream( std::ostream& originalStream, std::ostream& redirectionStream );
+ ~RedirectedStream();
+ };
+
+ class RedirectedStdOut {
+ ReusableStringStream m_rss;
+ RedirectedStream m_cout;
+ public:
+ RedirectedStdOut();
+ auto str() const -> std::string;
+ };
+
+ // StdErr has two constituent streams in C++, std::cerr and std::clog
+ // This means that we need to redirect 2 streams into 1 to keep proper
+ // order of writes
+ class RedirectedStdErr {
+ ReusableStringStream m_rss;
+ RedirectedStream m_cerr;
+ RedirectedStream m_clog;
+ public:
+ RedirectedStdErr();
+ auto str() const -> std::string;
+ };
+
+ class RedirectedStreams {
+ public:
+ RedirectedStreams(RedirectedStreams const&) = delete;
+ RedirectedStreams& operator=(RedirectedStreams const&) = delete;
+ RedirectedStreams(RedirectedStreams&&) = delete;
+ RedirectedStreams& operator=(RedirectedStreams&&) = delete;
+
+ RedirectedStreams(std::string& redirectedCout, std::string& redirectedCerr);
+ ~RedirectedStreams();
+ private:
+ std::string& m_redirectedCout;
+ std::string& m_redirectedCerr;
+ RedirectedStdOut m_redirectedStdOut;
+ RedirectedStdErr m_redirectedStdErr;
+ };
+
+#if defined(CATCH_CONFIG_NEW_CAPTURE)
+
+ // Windows's implementation of std::tmpfile is terrible (it tries
+ // to create a file inside system folder, thus requiring elevated
+ // privileges for the binary), so we have to use tmpnam(_s) and
+ // create the file ourselves there.
+ class TempFile {
+ public:
+ TempFile(TempFile const&) = delete;
+ TempFile& operator=(TempFile const&) = delete;
+ TempFile(TempFile&&) = delete;
+ TempFile& operator=(TempFile&&) = delete;
+
+ TempFile();
+ ~TempFile();
+
+ std::FILE* getFile();
+ std::string getContents();
+
+ private:
+ std::FILE* m_file = nullptr;
+ #if defined(_MSC_VER)
+ char m_buffer[L_tmpnam] = { 0 };
+ #endif
+ };
+
+
+ class OutputRedirect {
+ public:
+ OutputRedirect(OutputRedirect const&) = delete;
+ OutputRedirect& operator=(OutputRedirect const&) = delete;
+ OutputRedirect(OutputRedirect&&) = delete;
+ OutputRedirect& operator=(OutputRedirect&&) = delete;
+
+
+ OutputRedirect(std::string& stdout_dest, std::string& stderr_dest);
+ ~OutputRedirect();
+
+ private:
+ int m_originalStdout = -1;
+ int m_originalStderr = -1;
+ TempFile m_stdoutFile;
+ TempFile m_stderrFile;
+ std::string& m_stdoutDest;
+ std::string& m_stderrDest;
+ };
+
+#endif
+
+} // end namespace Catch
+
+#endif // CATCH_OUTPUT_REDIRECT_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_REGISTRY_HPP_INCLUDED
+#define CATCH_REPORTER_REGISTRY_HPP_INCLUDED
+
+
+#include <map>
+
+namespace Catch {
+
+ class ReporterRegistry : public IReporterRegistry {
+ public:
+
+ ReporterRegistry();
+ ~ReporterRegistry() override; // = default, out of line to allow fwd decl
+
+ IEventListenerPtr create( std::string const& name, ReporterConfig&& config ) const override;
+
+ void registerReporter( std::string const& name, IReporterFactoryPtr factory );
+ void registerListener( Detail::unique_ptr<EventListenerFactory> factory );
+
+ FactoryMap const& getFactories() const override;
+ Listeners const& getListeners() const override;
+
+ private:
+ FactoryMap m_factories;
+ Listeners m_listeners;
+ };
+}
+
+#endif // CATCH_REPORTER_REGISTRY_HPP_INCLUDED
+
+
+#ifndef CATCH_RUN_CONTEXT_HPP_INCLUDED
+#define CATCH_RUN_CONTEXT_HPP_INCLUDED
+
+
+
+#ifndef CATCH_TEST_CASE_TRACKER_HPP_INCLUDED
+#define CATCH_TEST_CASE_TRACKER_HPP_INCLUDED
+
+
+#include <string>
+#include <vector>
+
+namespace Catch {
+namespace TestCaseTracking {
+
+ struct NameAndLocation {
+ std::string name;
+ SourceLineInfo location;
+
+ NameAndLocation( std::string const& _name, SourceLineInfo const& _location );
+ friend bool operator==(NameAndLocation const& lhs, NameAndLocation const& rhs) {
+ return lhs.name == rhs.name
+ && lhs.location == rhs.location;
+ }
+ };
+
+ class ITracker;
+
+ using ITrackerPtr = Catch::Detail::unique_ptr<ITracker>;
+
+ class ITracker {
+ NameAndLocation m_nameAndLocation;
+
+ using Children = std::vector<ITrackerPtr>;
+
+ protected:
+ enum CycleState {
+ NotStarted,
+ Executing,
+ ExecutingChildren,
+ NeedsAnotherRun,
+ CompletedSuccessfully,
+ Failed
+ };
+
+ ITracker* m_parent = nullptr;
+ Children m_children;
+ CycleState m_runState = NotStarted;
+
+ public:
+ ITracker( NameAndLocation const& nameAndLoc, ITracker* parent ):
+ m_nameAndLocation( nameAndLoc ),
+ m_parent( parent )
+ {}
+
+
+ // static queries
+ NameAndLocation const& nameAndLocation() const {
+ return m_nameAndLocation;
+ }
+ ITracker* parent() const {
+ return m_parent;
+ }
+
+ virtual ~ITracker(); // = default
+
+
+ // dynamic queries
+
+ //! Returns true if tracker run to completion (successfully or not)
+ virtual bool isComplete() const = 0;
+ //! Returns true if tracker run to completion succesfully
+ bool isSuccessfullyCompleted() const;
+ //! Returns true if tracker has started but hasn't been completed
+ bool isOpen() const;
+ //! Returns true iff tracker has started
+ bool hasStarted() const;
+
+ // actions
+ virtual void close() = 0; // Successfully complete
+ virtual void fail() = 0;
+ void markAsNeedingAnotherRun();
+
+ //! Register a nested ITracker
+ void addChild( ITrackerPtr&& child );
+ /**
+ * Returns ptr to specific child if register with this tracker.
+ *
+ * Returns nullptr if not found.
+ */
+ ITracker* findChild( NameAndLocation const& nameAndLocation );
+ //! Have any children been added?
+ bool hasChildren() const {
+ return !m_children.empty();
+ }
+
+
+ //! Marks tracker as executing a child, doing se recursively up the tree
+ void openChild();
+
+ /**
+ * Returns true if the instance is a section tracker
+ *
+ * Subclasses should override to true if they are, replaces RTTI
+ * for internal debug checks.
+ */
+ virtual bool isSectionTracker() const;
+ /**
+ * Returns true if the instance is a generator tracker
+ *
+ * Subclasses should override to true if they are, replaces RTTI
+ * for internal debug checks.
+ */
+ virtual bool isGeneratorTracker() const;
+ };
+
+ class TrackerContext {
+
+ enum RunState {
+ NotStarted,
+ Executing,
+ CompletedCycle
+ };
+
+ ITrackerPtr m_rootTracker;
+ ITracker* m_currentTracker = nullptr;
+ RunState m_runState = NotStarted;
+
+ public:
+
+ ITracker& startRun();
+ void endRun();
+
+ void startCycle();
+ void completeCycle();
+
+ bool completedCycle() const;
+ ITracker& currentTracker();
+ void setCurrentTracker( ITracker* tracker );
+ };
+
+ class TrackerBase : public ITracker {
+ protected:
+
+ TrackerContext& m_ctx;
+
+ public:
+ TrackerBase( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent );
+
+ bool isComplete() const override;
+
+ void open();
+
+ void close() override;
+ void fail() override;
+
+ private:
+ void moveToParent();
+ void moveToThis();
+ };
+
+ class SectionTracker : public TrackerBase {
+ std::vector<StringRef> m_filters;
+ std::string m_trimmed_name;
+ public:
+ SectionTracker( NameAndLocation const& nameAndLocation, TrackerContext& ctx, ITracker* parent );
+
+ bool isSectionTracker() const override;
+
+ bool isComplete() const override;
+
+ static SectionTracker& acquire( TrackerContext& ctx, NameAndLocation const& nameAndLocation );
+
+ void tryOpen();
+
+ void addInitialFilters( std::vector<std::string> const& filters );
+ void addNextFilters( std::vector<StringRef> const& filters );
+ //! Returns filters active in this tracker
+ std::vector<StringRef> const& getFilters() const;
+ //! Returns whitespace-trimmed name of the tracked section
+ StringRef trimmedName() const;
+ };
+
+} // namespace TestCaseTracking
+
+using TestCaseTracking::ITracker;
+using TestCaseTracking::TrackerContext;
+using TestCaseTracking::SectionTracker;
+
+} // namespace Catch
+
+#endif // CATCH_TEST_CASE_TRACKER_HPP_INCLUDED
+
+#include <string>
+
+namespace Catch {
+
+ class IMutableContext;
+ class IGeneratorTracker;
+ class IConfig;
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ class RunContext : public IResultCapture {
+
+ public:
+ RunContext( RunContext const& ) = delete;
+ RunContext& operator =( RunContext const& ) = delete;
+
+ explicit RunContext( IConfig const* _config, IEventListenerPtr&& reporter );
+
+ ~RunContext() override;
+
+ Totals runTest(TestCaseHandle const& testCase);
+
+ public: // IResultCapture
+
+ // Assertion handlers
+ void handleExpr
+ ( AssertionInfo const& info,
+ ITransientExpression const& expr,
+ AssertionReaction& reaction ) override;
+ void handleMessage
+ ( AssertionInfo const& info,
+ ResultWas::OfType resultType,
+ StringRef message,
+ AssertionReaction& reaction ) override;
+ void handleUnexpectedExceptionNotThrown
+ ( AssertionInfo const& info,
+ AssertionReaction& reaction ) override;
+ void handleUnexpectedInflightException
+ ( AssertionInfo const& info,
+ std::string const& message,
+ AssertionReaction& reaction ) override;
+ void handleIncomplete
+ ( AssertionInfo const& info ) override;
+ void handleNonExpr
+ ( AssertionInfo const &info,
+ ResultWas::OfType resultType,
+ AssertionReaction &reaction ) override;
+
+ bool sectionStarted( SectionInfo const& sectionInfo, Counts& assertions ) override;
+
+ void sectionEnded( SectionEndInfo const& endInfo ) override;
+ void sectionEndedEarly( SectionEndInfo const& endInfo ) override;
+
+ auto acquireGeneratorTracker( StringRef generatorName, SourceLineInfo const& lineInfo ) -> IGeneratorTracker& override;
+
+ void benchmarkPreparing( StringRef name ) override;
+ void benchmarkStarting( BenchmarkInfo const& info ) override;
+ void benchmarkEnded( BenchmarkStats<> const& stats ) override;
+ void benchmarkFailed( StringRef error ) override;
+
+ void pushScopedMessage( MessageInfo const& message ) override;
+ void popScopedMessage( MessageInfo const& message ) override;
+
+ void emplaceUnscopedMessage( MessageBuilder const& builder ) override;
+
+ std::string getCurrentTestName() const override;
+
+ const AssertionResult* getLastResult() const override;
+
+ void exceptionEarlyReported() override;
+
+ void handleFatalErrorCondition( StringRef message ) override;
+
+ bool lastAssertionPassed() override;
+
+ void assertionPassed() override;
+
+ public:
+ // !TBD We need to do this another way!
+ bool aborting() const;
+
+ private:
+
+ void runCurrentTest( std::string& redirectedCout, std::string& redirectedCerr );
+ void invokeActiveTestCase();
+
+ void resetAssertionInfo();
+ bool testForMissingAssertions( Counts& assertions );
+
+ void assertionEnded( AssertionResult const& result );
+ void reportExpr
+ ( AssertionInfo const &info,
+ ResultWas::OfType resultType,
+ ITransientExpression const *expr,
+ bool negated );
+
+ void populateReaction( AssertionReaction& reaction );
+
+ private:
+
+ void handleUnfinishedSections();
+
+ TestRunInfo m_runInfo;
+ IMutableContext& m_context;
+ TestCaseHandle const* m_activeTestCase = nullptr;
+ ITracker* m_testCaseTracker = nullptr;
+ Optional<AssertionResult> m_lastResult;
+
+ IConfig const* m_config;
+ Totals m_totals;
+ IEventListenerPtr m_reporter;
+ std::vector<MessageInfo> m_messages;
+ std::vector<ScopedMessage> m_messageScopes; /* Keeps owners of so-called unscoped messages. */
+ AssertionInfo m_lastAssertionInfo;
+ std::vector<SectionEndInfo> m_unfinishedSections;
+ std::vector<ITracker*> m_activeSections;
+ TrackerContext m_trackerContext;
+ FatalConditionHandler m_fatalConditionhandler;
+ bool m_lastAssertionPassed = false;
+ bool m_shouldReportUnexpected = true;
+ bool m_includeSuccessfulResults;
+ };
+
+ void seedRng(IConfig const& config);
+ unsigned int rngSeed();
+} // end namespace Catch
+
+#endif // CATCH_RUN_CONTEXT_HPP_INCLUDED
+
+
+#ifndef CATCH_SHARDING_HPP_INCLUDED
+#define CATCH_SHARDING_HPP_INCLUDED
+
+
+#include <cmath>
+
+namespace Catch {
+
+ template<typename Container>
+ Container createShard(Container const& container, std::size_t const shardCount, std::size_t const shardIndex) {
+ assert(shardCount > shardIndex);
+
+ if (shardCount == 1) {
+ return container;
+ }
+
+ const std::size_t totalTestCount = container.size();
+
+ const std::size_t shardSize = totalTestCount / shardCount;
+ const std::size_t leftoverTests = totalTestCount % shardCount;
+
+ const std::size_t startIndex = shardIndex * shardSize + (std::min)(shardIndex, leftoverTests);
+ const std::size_t endIndex = (shardIndex + 1) * shardSize + (std::min)(shardIndex + 1, leftoverTests);
+
+ auto startIterator = std::next(container.begin(), static_cast<std::ptrdiff_t>(startIndex));
+ auto endIterator = std::next(container.begin(), static_cast<std::ptrdiff_t>(endIndex));
+
+ return Container(startIterator, endIterator);
+ }
+
+}
+
+#endif // CATCH_SHARDING_HPP_INCLUDED
+
+
+#ifndef CATCH_SINGLETONS_HPP_INCLUDED
+#define CATCH_SINGLETONS_HPP_INCLUDED
+
+namespace Catch {
+
+ struct ISingleton {
+ virtual ~ISingleton(); // = default
+ };
+
+
+ void addSingleton( ISingleton* singleton );
+ void cleanupSingletons();
+
+
+ template<typename SingletonImplT, typename InterfaceT = SingletonImplT, typename MutableInterfaceT = InterfaceT>
+ class Singleton : SingletonImplT, public ISingleton {
+
+ static auto getInternal() -> Singleton* {
+ static Singleton* s_instance = nullptr;
+ if( !s_instance ) {
+ s_instance = new Singleton;
+ addSingleton( s_instance );
+ }
+ return s_instance;
+ }
+
+ public:
+ static auto get() -> InterfaceT const& {
+ return *getInternal();
+ }
+ static auto getMutable() -> MutableInterfaceT& {
+ return *getInternal();
+ }
+ };
+
+} // namespace Catch
+
+#endif // CATCH_SINGLETONS_HPP_INCLUDED
+
+
+#ifndef CATCH_STARTUP_EXCEPTION_REGISTRY_HPP_INCLUDED
+#define CATCH_STARTUP_EXCEPTION_REGISTRY_HPP_INCLUDED
+
+
+#include <vector>
+#include <exception>
+
+namespace Catch {
+
+ class StartupExceptionRegistry {
+#if !defined(CATCH_CONFIG_DISABLE_EXCEPTIONS)
+ public:
+ void add(std::exception_ptr const& exception) noexcept;
+ std::vector<std::exception_ptr> const& getExceptions() const noexcept;
+ private:
+ std::vector<std::exception_ptr> m_exceptions;
+#endif
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_STARTUP_EXCEPTION_REGISTRY_HPP_INCLUDED
+
+
+
+#ifndef CATCH_STDSTREAMS_HPP_INCLUDED
+#define CATCH_STDSTREAMS_HPP_INCLUDED
+
+#include <iosfwd>
+
+namespace Catch {
+
+ std::ostream& cout();
+ std::ostream& cerr();
+ std::ostream& clog();
+
+} // namespace Catch
+
+#endif
+
+
+#ifndef CATCH_STRING_MANIP_HPP_INCLUDED
+#define CATCH_STRING_MANIP_HPP_INCLUDED
+
+
+#include <string>
+#include <iosfwd>
+#include <vector>
+
+namespace Catch {
+
+ bool startsWith( std::string const& s, std::string const& prefix );
+ bool startsWith( StringRef s, char prefix );
+ bool endsWith( std::string const& s, std::string const& suffix );
+ bool endsWith( std::string const& s, char suffix );
+ bool contains( std::string const& s, std::string const& infix );
+ void toLowerInPlace( std::string& s );
+ std::string toLower( std::string const& s );
+ char toLower( char c );
+ //! Returns a new string without whitespace at the start/end
+ std::string trim( std::string const& str );
+ //! Returns a substring of the original ref without whitespace. Beware lifetimes!
+ StringRef trim(StringRef ref);
+
+ // !!! Be aware, returns refs into original string - make sure original string outlives them
+ std::vector<StringRef> splitStringRef( StringRef str, char delimiter );
+ bool replaceInPlace( std::string& str, std::string const& replaceThis, std::string const& withThis );
+
+ /**
+ * Helper for streaming a "count [maybe-plural-of-label]" human-friendly string
+ *
+ * Usage example:
+ * ```cpp
+ * std::cout << "Found " << pluralise(count, "error") << '\n';
+ * ```
+ *
+ * **Important:** The provided string must outlive the instance
+ */
+ class pluralise {
+ std::uint64_t m_count;
+ StringRef m_label;
+
+ public:
+ constexpr pluralise(std::uint64_t count, StringRef label):
+ m_count(count),
+ m_label(label)
+ {}
+
+ friend std::ostream& operator << ( std::ostream& os, pluralise const& pluraliser );
+ };
+}
+
+#endif // CATCH_STRING_MANIP_HPP_INCLUDED
+
+
+#ifndef CATCH_TAG_ALIAS_REGISTRY_HPP_INCLUDED
+#define CATCH_TAG_ALIAS_REGISTRY_HPP_INCLUDED
+
+
+#include <map>
+#include <string>
+
+namespace Catch {
+ struct SourceLineInfo;
+
+ class TagAliasRegistry : public ITagAliasRegistry {
+ public:
+ ~TagAliasRegistry() override;
+ TagAlias const* find( std::string const& alias ) const override;
+ std::string expandAliases( std::string const& unexpandedTestSpec ) const override;
+ void add( std::string const& alias, std::string const& tag, SourceLineInfo const& lineInfo );
+
+ private:
+ std::map<std::string, TagAlias> m_registry;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_TAG_ALIAS_REGISTRY_HPP_INCLUDED
+
+
+#ifndef CATCH_TEST_CASE_INFO_HASHER_HPP_INCLUDED
+#define CATCH_TEST_CASE_INFO_HASHER_HPP_INCLUDED
+
+#include <cstdint>
+
+namespace Catch {
+
+ struct TestCaseInfo;
+
+ class TestCaseInfoHasher {
+ public:
+ using hash_t = std::uint64_t;
+ TestCaseInfoHasher( hash_t seed );
+ uint32_t operator()( TestCaseInfo const& t ) const;
+
+ private:
+ hash_t m_seed;
+ };
+
+} // namespace Catch
+
+#endif /* CATCH_TEST_CASE_INFO_HASHER_HPP_INCLUDED */
+
+
+#ifndef CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED
+#define CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED
+
+
+#include <vector>
+
+namespace Catch {
+
+ class TestCaseHandle;
+ class IConfig;
+ class TestSpec;
+
+ std::vector<TestCaseHandle> sortTests( IConfig const& config, std::vector<TestCaseHandle> const& unsortedTestCases );
+
+ bool isThrowSafe( TestCaseHandle const& testCase, IConfig const& config );
+ bool matchTest( TestCaseHandle const& testCase, TestSpec const& testSpec, IConfig const& config );
+
+ void enforceNoDuplicateTestCases( std::vector<TestCaseHandle> const& functions );
+
+ std::vector<TestCaseHandle> filterTests( std::vector<TestCaseHandle> const& testCases, TestSpec const& testSpec, IConfig const& config );
+ std::vector<TestCaseHandle> const& getAllTestCasesSorted( IConfig const& config );
+
+ class TestRegistry : public ITestCaseRegistry {
+ public:
+ ~TestRegistry() override = default;
+
+ void registerTest( Detail::unique_ptr<TestCaseInfo> testInfo, Detail::unique_ptr<ITestInvoker> testInvoker );
+
+ std::vector<TestCaseInfo*> const& getAllInfos() const override;
+ std::vector<TestCaseHandle> const& getAllTests() const override;
+ std::vector<TestCaseHandle> const& getAllTestsSorted( IConfig const& config ) const override;
+
+ private:
+ std::vector<Detail::unique_ptr<TestCaseInfo>> m_owned_test_infos;
+ // Keeps a materialized vector for `getAllInfos`.
+ // We should get rid of that eventually (see interface note)
+ std::vector<TestCaseInfo*> m_viewed_test_infos;
+
+ std::vector<Detail::unique_ptr<ITestInvoker>> m_invokers;
+ std::vector<TestCaseHandle> m_handles;
+ mutable TestRunOrder m_currentSortOrder = TestRunOrder::Declared;
+ mutable std::vector<TestCaseHandle> m_sortedFunctions;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+
+ class TestInvokerAsFunction final : public ITestInvoker {
+ using TestType = void(*)();
+ TestType m_testAsFunction;
+ public:
+ TestInvokerAsFunction(TestType testAsFunction) noexcept:
+ m_testAsFunction(testAsFunction) {}
+
+ void invoke() const override;
+ };
+
+ ///////////////////////////////////////////////////////////////////////////
+
+
+} // end namespace Catch
+
+
+#endif // CATCH_TEST_CASE_REGISTRY_IMPL_HPP_INCLUDED
+
+
+#ifndef CATCH_TEST_SPEC_PARSER_HPP_INCLUDED
+#define CATCH_TEST_SPEC_PARSER_HPP_INCLUDED
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpadded"
+#endif
+
+
+#include <vector>
+#include <string>
+
+namespace Catch {
+
+ class ITagAliasRegistry;
+
+ class TestSpecParser {
+ enum Mode{ None, Name, QuotedName, Tag, EscapedName };
+ Mode m_mode = None;
+ Mode lastMode = None;
+ bool m_exclusion = false;
+ std::size_t m_pos = 0;
+ std::size_t m_realPatternPos = 0;
+ std::string m_arg;
+ std::string m_substring;
+ std::string m_patternName;
+ std::vector<std::size_t> m_escapeChars;
+ TestSpec::Filter m_currentFilter;
+ TestSpec m_testSpec;
+ ITagAliasRegistry const* m_tagAliases = nullptr;
+
+ public:
+ TestSpecParser( ITagAliasRegistry const& tagAliases );
+
+ TestSpecParser& parse( std::string const& arg );
+ TestSpec testSpec();
+
+ private:
+ bool visitChar( char c );
+ void startNewMode( Mode mode );
+ bool processNoneChar( char c );
+ void processNameChar( char c );
+ bool processOtherChar( char c );
+ void endMode();
+ void escape();
+ bool isControlChar( char c ) const;
+ void saveLastMode();
+ void revertBackToLastMode();
+ void addFilter();
+ bool separate();
+
+ // Handles common preprocessing of the pattern for name/tag patterns
+ std::string preprocessPattern();
+ // Adds the current pattern as a test name
+ void addNamePattern();
+ // Adds the current pattern as a tag
+ void addTagPattern();
+
+ inline void addCharToPattern(char c) {
+ m_substring += c;
+ m_patternName += c;
+ m_realPatternPos++;
+ }
+
+ };
+ TestSpec parseTestSpec( std::string const& arg );
+
+} // namespace Catch
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+#endif // CATCH_TEST_SPEC_PARSER_HPP_INCLUDED
+
+
+#ifndef CATCH_TEXTFLOW_HPP_INCLUDED
+#define CATCH_TEXTFLOW_HPP_INCLUDED
+
+#include <cassert>
+#include <string>
+#include <vector>
+
+namespace Catch {
+ namespace TextFlow {
+
+ class Columns;
+
+ /**
+ * Represents a column of text with specific width and indentation
+ *
+ * When written out to a stream, it will perform linebreaking
+ * of the provided text so that the written lines fit within
+ * target width.
+ */
+ class Column {
+ // String to be written out
+ std::string m_string;
+ // Width of the column for linebreaking
+ size_t m_width = CATCH_CONFIG_CONSOLE_WIDTH - 1;
+ // Indentation of other lines (including first if initial indent is unset)
+ size_t m_indent = 0;
+ // Indentation of the first line
+ size_t m_initialIndent = std::string::npos;
+
+ public:
+ /**
+ * Iterates "lines" in `Column` and return sthem
+ */
+ class const_iterator {
+ friend Column;
+ struct EndTag {};
+
+ Column const& m_column;
+ // Where does the current line start?
+ size_t m_lineStart = 0;
+ // How long should the current line be?
+ size_t m_lineLength = 0;
+ // How far have we checked the string to iterate?
+ size_t m_parsedTo = 0;
+ // Should a '-' be appended to the line?
+ bool m_addHyphen = false;
+
+ const_iterator( Column const& column, EndTag ):
+ m_column( column ), m_lineStart( m_column.m_string.size() ) {}
+
+ // Calculates the length of the current line
+ void calcLength();
+
+ // Returns current indention width
+ size_t indentSize() const;
+
+ // Creates an indented and (optionally) suffixed string from
+ // current iterator position, indentation and length.
+ std::string addIndentAndSuffix( size_t position,
+ size_t length ) const;
+
+ public:
+ using difference_type = std::ptrdiff_t;
+ using value_type = std::string;
+ using pointer = value_type*;
+ using reference = value_type&;
+ using iterator_category = std::forward_iterator_tag;
+
+ explicit const_iterator( Column const& column );
+
+ std::string operator*() const;
+
+ const_iterator& operator++();
+ const_iterator operator++( int );
+
+ bool operator==( const_iterator const& other ) const {
+ return m_lineStart == other.m_lineStart && &m_column == &other.m_column;
+ }
+ bool operator!=( const_iterator const& other ) const {
+ return !operator==( other );
+ }
+ };
+ using iterator = const_iterator;
+
+ explicit Column( std::string const& text ): m_string( text ) {}
+
+ Column& width( size_t newWidth ) {
+ assert( newWidth > 0 );
+ m_width = newWidth;
+ return *this;
+ }
+ Column& indent( size_t newIndent ) {
+ m_indent = newIndent;
+ return *this;
+ }
+ Column& initialIndent( size_t newIndent ) {
+ m_initialIndent = newIndent;
+ return *this;
+ }
+
+ size_t width() const { return m_width; }
+ const_iterator begin() const { return const_iterator( *this ); }
+ const_iterator end() const { return { *this, const_iterator::EndTag{} }; }
+
+ friend std::ostream& operator<<( std::ostream& os,
+ Column const& col );
+
+ Columns operator+( Column const& other );
+ };
+
+ //! Creates a column that serves as an empty space of specific width
+ Column Spacer( size_t spaceWidth );
+
+ class Columns {
+ std::vector<Column> m_columns;
+
+ public:
+ class iterator {
+ friend Columns;
+ struct EndTag {};
+
+ std::vector<Column> const& m_columns;
+ std::vector<Column::const_iterator> m_iterators;
+ size_t m_activeIterators;
+
+ iterator( Columns const& columns, EndTag );
+
+ public:
+ using difference_type = std::ptrdiff_t;
+ using value_type = std::string;
+ using pointer = value_type*;
+ using reference = value_type&;
+ using iterator_category = std::forward_iterator_tag;
+
+ explicit iterator( Columns const& columns );
+
+ auto operator==( iterator const& other ) const -> bool {
+ return m_iterators == other.m_iterators;
+ }
+ auto operator!=( iterator const& other ) const -> bool {
+ return m_iterators != other.m_iterators;
+ }
+ std::string operator*() const;
+ iterator& operator++();
+ iterator operator++( int );
+ };
+ using const_iterator = iterator;
+
+ iterator begin() const { return iterator( *this ); }
+ iterator end() const { return { *this, iterator::EndTag() }; }
+
+ Columns& operator+=( Column const& col );
+ Columns operator+( Column const& col );
+
+ friend std::ostream& operator<<( std::ostream& os,
+ Columns const& cols );
+ };
+
+ } // namespace TextFlow
+} // namespace Catch
+#endif // CATCH_TEXTFLOW_HPP_INCLUDED
+
+
+#ifndef CATCH_TO_STRING_HPP_INCLUDED
+#define CATCH_TO_STRING_HPP_INCLUDED
+
+#include <string>
+
+
+namespace Catch {
+ template <typename T>
+ std::string to_string(T const& t) {
+#if defined(CATCH_CONFIG_CPP11_TO_STRING)
+ return std::to_string(t);
+#else
+ ReusableStringStream rss;
+ rss << t;
+ return rss.str();
+#endif
+ }
+} // end namespace Catch
+
+#endif // CATCH_TO_STRING_HPP_INCLUDED
+
+
+#ifndef CATCH_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
+#define CATCH_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
+
+namespace Catch {
+ bool uncaught_exceptions();
+} // end namespace Catch
+
+#endif // CATCH_UNCAUGHT_EXCEPTIONS_HPP_INCLUDED
+
+
+#ifndef CATCH_WINDOWS_H_PROXY_HPP_INCLUDED
+#define CATCH_WINDOWS_H_PROXY_HPP_INCLUDED
+
+
+#if defined(CATCH_PLATFORM_WINDOWS)
+
+// We might end up with the define made globally through the compiler,
+// and we don't want to trigger warnings for this
+#if !defined(NOMINMAX)
+# define NOMINMAX
+#endif
+#if !defined(WIN32_LEAN_AND_MEAN)
+# define WIN32_LEAN_AND_MEAN
+#endif
+
+#ifdef __AFXDLL
+#include <AfxWin.h>
+#else
+#include <windows.h>
+#endif
+
+#endif // defined(CATCH_PLATFORM_WINDOWS)
+
+#endif // CATCH_WINDOWS_H_PROXY_HPP_INCLUDED
+
+
+#ifndef CATCH_XMLWRITER_HPP_INCLUDED
+#define CATCH_XMLWRITER_HPP_INCLUDED
+
+
+#include <iosfwd>
+#include <vector>
+
+namespace Catch {
+ enum class XmlFormatting {
+ None = 0x00,
+ Indent = 0x01,
+ Newline = 0x02,
+ };
+
+ XmlFormatting operator | (XmlFormatting lhs, XmlFormatting rhs);
+ XmlFormatting operator & (XmlFormatting lhs, XmlFormatting rhs);
+
+ /**
+ * Helper for XML-encoding text (escaping angle brackets, quotes, etc)
+ *
+ * Note: doesn't take ownership of passed strings, and thus the
+ * encoded string must outlive the encoding instance.
+ */
+ class XmlEncode {
+ public:
+ enum ForWhat { ForTextNodes, ForAttributes };
+
+ XmlEncode( StringRef str, ForWhat forWhat = ForTextNodes );
+
+ void encodeTo( std::ostream& os ) const;
+
+ friend std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode );
+
+ private:
+ StringRef m_str;
+ ForWhat m_forWhat;
+ };
+
+ class XmlWriter {
+ public:
+
+ class ScopedElement {
+ public:
+ ScopedElement( XmlWriter* writer, XmlFormatting fmt );
+
+ ScopedElement( ScopedElement&& other ) noexcept;
+ ScopedElement& operator=( ScopedElement&& other ) noexcept;
+
+ ~ScopedElement();
+
+ ScopedElement&
+ writeText( StringRef text,
+ XmlFormatting fmt = XmlFormatting::Newline |
+ XmlFormatting::Indent );
+
+ ScopedElement& writeAttribute( StringRef name,
+ StringRef attribute );
+ template <typename T,
+ // Without this SFINAE, this overload is a better match
+ // for `std::string`, `char const*`, `char const[N]` args.
+ // While it would still work, it would cause code bloat
+ // and multiple iteration over the strings
+ typename = typename std::enable_if_t<
+ !std::is_convertible<T, StringRef>::value>>
+ ScopedElement& writeAttribute( StringRef name,
+ T const& attribute ) {
+ m_writer->writeAttribute( name, attribute );
+ return *this;
+ }
+
+ private:
+ XmlWriter* m_writer = nullptr;
+ XmlFormatting m_fmt;
+ };
+
+ XmlWriter( std::ostream& os );
+ ~XmlWriter();
+
+ XmlWriter( XmlWriter const& ) = delete;
+ XmlWriter& operator=( XmlWriter const& ) = delete;
+
+ XmlWriter& startElement( std::string const& name, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
+
+ ScopedElement scopedElement( std::string const& name, XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
+
+ XmlWriter& endElement(XmlFormatting fmt = XmlFormatting::Newline | XmlFormatting::Indent);
+
+ //! The attribute content is XML-encoded
+ XmlWriter& writeAttribute( StringRef name, StringRef attribute );
+
+ //! Writes the attribute as "true/false"
+ XmlWriter& writeAttribute( StringRef name, bool attribute );
+
+ //! The attribute content is XML-encoded
+ XmlWriter& writeAttribute( StringRef name, char const* attribute );
+
+ //! The attribute value must provide op<<(ostream&, T). The resulting
+ //! serialization is XML-encoded
+ template <typename T,
+ // Without this SFINAE, this overload is a better match
+ // for `std::string`, `char const*`, `char const[N]` args.
+ // While it would still work, it would cause code bloat
+ // and multiple iteration over the strings
+ typename = typename std::enable_if_t<
+ !std::is_convertible<T, StringRef>::value>>
+ XmlWriter& writeAttribute( StringRef name, T const& attribute ) {
+ ReusableStringStream rss;
+ rss << attribute;
+ return writeAttribute( name, rss.str() );
+ }
+
+ //! Writes escaped `text` in a element
+ XmlWriter& writeText( StringRef text,
+ XmlFormatting fmt = XmlFormatting::Newline |
+ XmlFormatting::Indent );
+
+ //! Writes XML comment as "<!-- text -->"
+ XmlWriter& writeComment( StringRef text,
+ XmlFormatting fmt = XmlFormatting::Newline |
+ XmlFormatting::Indent );
+
+ void writeStylesheetRef( StringRef url );
+
+ void ensureTagClosed();
+
+ private:
+
+ void applyFormatting(XmlFormatting fmt);
+
+ void writeDeclaration();
+
+ void newlineIfNecessary();
+
+ bool m_tagIsOpen = false;
+ bool m_needsNewline = false;
+ std::vector<std::string> m_tags;
+ std::string m_indent;
+ std::ostream& m_os;
+ };
+
+}
+
+#endif // CATCH_XMLWRITER_HPP_INCLUDED
+
+
+/** \file
+ * This is a convenience header for Catch2's Matcher support. It includes
+ * **all** of Catch2 headers related to matchers.
+ *
+ * Generally the Catch2 users should use specific includes they need,
+ * but this header can be used instead for ease-of-experimentation, or
+ * just plain convenience, at the cost of increased compilation times.
+ *
+ * When a new header is added to either the `matchers` folder, or to
+ * the corresponding internal subfolder, it should be added here.
+ */
+
+#ifndef CATCH_MATCHERS_ALL_HPP_INCLUDED
+#define CATCH_MATCHERS_ALL_HPP_INCLUDED
+
+
+
+#ifndef CATCH_MATCHERS_HPP_INCLUDED
+#define CATCH_MATCHERS_HPP_INCLUDED
+
+
+
+#ifndef CATCH_MATCHERS_IMPL_HPP_INCLUDED
+#define CATCH_MATCHERS_IMPL_HPP_INCLUDED
+
+
+namespace Catch {
+
+ template<typename ArgT, typename MatcherT>
+ class MatchExpr : public ITransientExpression {
+ ArgT && m_arg;
+ MatcherT const& m_matcher;
+ StringRef m_matcherString;
+ public:
+ MatchExpr( ArgT && arg, MatcherT const& matcher, StringRef matcherString )
+ : ITransientExpression{ true, matcher.match( arg ) }, // not forwarding arg here on purpose
+ m_arg( CATCH_FORWARD(arg) ),
+ m_matcher( matcher ),
+ m_matcherString( matcherString )
+ {}
+
+ void streamReconstructedExpression( std::ostream& os ) const override {
+ os << Catch::Detail::stringify( m_arg )
+ << ' '
+ << m_matcher.toString();
+ }
+ };
+
+ namespace Matchers {
+ template <typename ArgT>
+ class MatcherBase;
+ }
+
+ using StringMatcher = Matchers::MatcherBase<std::string>;
+
+ void handleExceptionMatchExpr( AssertionHandler& handler, StringMatcher const& matcher, StringRef matcherString );
+
+ template<typename ArgT, typename MatcherT>
+ auto makeMatchExpr( ArgT && arg, MatcherT const& matcher, StringRef matcherString ) -> MatchExpr<ArgT, MatcherT> {
+ return MatchExpr<ArgT, MatcherT>( CATCH_FORWARD(arg), matcher, matcherString );
+ }
+
+} // namespace Catch
+
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CHECK_THAT( macroName, matcher, resultDisposition, arg ) \
+ do { \
+ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(arg) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
+ INTERNAL_CATCH_TRY { \
+ catchAssertionHandler.handleExpr( Catch::makeMatchExpr( arg, matcher, #matcher##_catch_sr ) ); \
+ } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
+ INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+ } while( false )
+
+
+///////////////////////////////////////////////////////////////////////////////
+#define INTERNAL_CATCH_THROWS_MATCHES( macroName, exceptionType, resultDisposition, matcher, ... ) \
+ do { \
+ Catch::AssertionHandler catchAssertionHandler( macroName##_catch_sr, CATCH_INTERNAL_LINEINFO, CATCH_INTERNAL_STRINGIFY(__VA_ARGS__) ", " CATCH_INTERNAL_STRINGIFY(exceptionType) ", " CATCH_INTERNAL_STRINGIFY(matcher), resultDisposition ); \
+ if( catchAssertionHandler.allowThrows() ) \
+ try { \
+ static_cast<void>(__VA_ARGS__ ); \
+ catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
+ } \
+ catch( exceptionType const& ex ) { \
+ catchAssertionHandler.handleExpr( Catch::makeMatchExpr( ex, matcher, #matcher##_catch_sr ) ); \
+ } \
+ catch( ... ) { \
+ catchAssertionHandler.handleUnexpectedInflightException(); \
+ } \
+ else \
+ catchAssertionHandler.handleThrowingCallSkipped(); \
+ INTERNAL_CATCH_REACT( catchAssertionHandler ) \
+ } while( false )
+
+
+#endif // CATCH_MATCHERS_IMPL_HPP_INCLUDED
+
+#include <string>
+#include <vector>
+
+namespace Catch {
+namespace Matchers {
+
+ class MatcherUntypedBase {
+ public:
+ MatcherUntypedBase() = default;
+
+ MatcherUntypedBase(MatcherUntypedBase const&) = default;
+ MatcherUntypedBase(MatcherUntypedBase&&) = default;
+
+ MatcherUntypedBase& operator = (MatcherUntypedBase const&) = delete;
+ MatcherUntypedBase& operator = (MatcherUntypedBase&&) = delete;
+
+ std::string toString() const;
+
+ protected:
+ virtual ~MatcherUntypedBase(); // = default;
+ virtual std::string describe() const = 0;
+ mutable std::string m_cachedToString;
+ };
+
+
+ template<typename T>
+ class MatcherBase : public MatcherUntypedBase {
+ public:
+ virtual bool match( T const& arg ) const = 0;
+ };
+
+ namespace Detail {
+
+ template<typename ArgT>
+ class MatchAllOf final : public MatcherBase<ArgT> {
+ std::vector<MatcherBase<ArgT> const*> m_matchers;
+
+ public:
+ MatchAllOf() = default;
+ MatchAllOf(MatchAllOf const&) = delete;
+ MatchAllOf& operator=(MatchAllOf const&) = delete;
+ MatchAllOf(MatchAllOf&&) = default;
+ MatchAllOf& operator=(MatchAllOf&&) = default;
+
+
+ bool match( ArgT const& arg ) const override {
+ for( auto matcher : m_matchers ) {
+ if (!matcher->match(arg))
+ return false;
+ }
+ return true;
+ }
+ std::string describe() const override {
+ std::string description;
+ description.reserve( 4 + m_matchers.size()*32 );
+ description += "( ";
+ bool first = true;
+ for( auto matcher : m_matchers ) {
+ if( first )
+ first = false;
+ else
+ description += " and ";
+ description += matcher->toString();
+ }
+ description += " )";
+ return description;
+ }
+
+ friend MatchAllOf operator&& (MatchAllOf&& lhs, MatcherBase<ArgT> const& rhs) {
+ lhs.m_matchers.push_back(&rhs);
+ return CATCH_MOVE(lhs);
+ }
+ friend MatchAllOf operator&& (MatcherBase<ArgT> const& lhs, MatchAllOf&& rhs) {
+ rhs.m_matchers.insert(rhs.m_matchers.begin(), &lhs);
+ return CATCH_MOVE(rhs);
+ }
+ };
+
+ //! lvalue overload is intentionally deleted, users should
+ //! not be trying to compose stored composition matchers
+ template<typename ArgT>
+ MatchAllOf<ArgT> operator&& (MatchAllOf<ArgT> const& lhs, MatcherBase<ArgT> const& rhs) = delete;
+ //! lvalue overload is intentionally deleted, users should
+ //! not be trying to compose stored composition matchers
+ template<typename ArgT>
+ MatchAllOf<ArgT> operator&& (MatcherBase<ArgT> const& lhs, MatchAllOf<ArgT> const& rhs) = delete;
+
+ template<typename ArgT>
+ class MatchAnyOf final : public MatcherBase<ArgT> {
+ std::vector<MatcherBase<ArgT> const*> m_matchers;
+ public:
+ MatchAnyOf() = default;
+ MatchAnyOf(MatchAnyOf const&) = delete;
+ MatchAnyOf& operator=(MatchAnyOf const&) = delete;
+ MatchAnyOf(MatchAnyOf&&) = default;
+ MatchAnyOf& operator=(MatchAnyOf&&) = default;
+
+ bool match( ArgT const& arg ) const override {
+ for( auto matcher : m_matchers ) {
+ if (matcher->match(arg))
+ return true;
+ }
+ return false;
+ }
+ std::string describe() const override {
+ std::string description;
+ description.reserve( 4 + m_matchers.size()*32 );
+ description += "( ";
+ bool first = true;
+ for( auto matcher : m_matchers ) {
+ if( first )
+ first = false;
+ else
+ description += " or ";
+ description += matcher->toString();
+ }
+ description += " )";
+ return description;
+ }
+
+ friend MatchAnyOf operator|| (MatchAnyOf&& lhs, MatcherBase<ArgT> const& rhs) {
+ lhs.m_matchers.push_back(&rhs);
+ return CATCH_MOVE(lhs);
+ }
+ friend MatchAnyOf operator|| (MatcherBase<ArgT> const& lhs, MatchAnyOf&& rhs) {
+ rhs.m_matchers.insert(rhs.m_matchers.begin(), &lhs);
+ return CATCH_MOVE(rhs);
+ }
+ };
+
+ //! lvalue overload is intentionally deleted, users should
+ //! not be trying to compose stored composition matchers
+ template<typename ArgT>
+ MatchAnyOf<ArgT> operator|| (MatchAnyOf<ArgT> const& lhs, MatcherBase<ArgT> const& rhs) = delete;
+ //! lvalue overload is intentionally deleted, users should
+ //! not be trying to compose stored composition matchers
+ template<typename ArgT>
+ MatchAnyOf<ArgT> operator|| (MatcherBase<ArgT> const& lhs, MatchAnyOf<ArgT> const& rhs) = delete;
+
+ template<typename ArgT>
+ class MatchNotOf final : public MatcherBase<ArgT> {
+ MatcherBase<ArgT> const& m_underlyingMatcher;
+
+ public:
+ explicit MatchNotOf( MatcherBase<ArgT> const& underlyingMatcher ):
+ m_underlyingMatcher( underlyingMatcher )
+ {}
+
+ bool match( ArgT const& arg ) const override {
+ return !m_underlyingMatcher.match( arg );
+ }
+
+ std::string describe() const override {
+ return "not " + m_underlyingMatcher.toString();
+ }
+ };
+
+ } // namespace Detail
+
+ template <typename T>
+ Detail::MatchAllOf<T> operator&& (MatcherBase<T> const& lhs, MatcherBase<T> const& rhs) {
+ return Detail::MatchAllOf<T>{} && lhs && rhs;
+ }
+ template <typename T>
+ Detail::MatchAnyOf<T> operator|| (MatcherBase<T> const& lhs, MatcherBase<T> const& rhs) {
+ return Detail::MatchAnyOf<T>{} || lhs || rhs;
+ }
+
+ template <typename T>
+ Detail::MatchNotOf<T> operator! (MatcherBase<T> const& matcher) {
+ return Detail::MatchNotOf<T>{ matcher };
+ }
+
+
+} // namespace Matchers
+} // namespace Catch
+
+
+#if defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
+ #define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
+ #define CATCH_REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CATCH_REQUIRE_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::Normal, matcher, expr )
+
+ #define CATCH_CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CATCH_CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
+ #define CATCH_CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CATCH_CHECK_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
+
+ #define CATCH_CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
+ #define CATCH_REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CATCH_REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
+
+#elif defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
+
+ #define CATCH_REQUIRE_THROWS_WITH( expr, matcher ) (void)(0)
+ #define CATCH_REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
+
+ #define CATCH_CHECK_THROWS_WITH( expr, matcher ) (void)(0)
+ #define CATCH_CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
+
+ #define CATCH_CHECK_THAT( arg, matcher ) (void)(0)
+ #define CATCH_REQUIRE_THAT( arg, matcher ) (void)(0)
+
+#elif !defined(CATCH_CONFIG_PREFIX_ALL) && !defined(CATCH_CONFIG_DISABLE)
+
+ #define REQUIRE_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "REQUIRE_THROWS_WITH", Catch::ResultDisposition::Normal, matcher, expr )
+ #define REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "REQUIRE_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::Normal, matcher, expr )
+
+ #define CHECK_THROWS_WITH( expr, matcher ) INTERNAL_CATCH_THROWS_STR_MATCHES( "CHECK_THROWS_WITH", Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
+ #define CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) INTERNAL_CATCH_THROWS_MATCHES( "CHECK_THROWS_MATCHES", exceptionType, Catch::ResultDisposition::ContinueOnFailure, matcher, expr )
+
+ #define CHECK_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "CHECK_THAT", matcher, Catch::ResultDisposition::ContinueOnFailure, arg )
+ #define REQUIRE_THAT( arg, matcher ) INTERNAL_CHECK_THAT( "REQUIRE_THAT", matcher, Catch::ResultDisposition::Normal, arg )
+
+#elif !defined(CATCH_CONFIG_PREFIX_ALL) && defined(CATCH_CONFIG_DISABLE)
+
+ #define REQUIRE_THROWS_WITH( expr, matcher ) (void)(0)
+ #define REQUIRE_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
+
+ #define CHECK_THROWS_WITH( expr, matcher ) (void)(0)
+ #define CHECK_THROWS_MATCHES( expr, exceptionType, matcher ) (void)(0)
+
+ #define CHECK_THAT( arg, matcher ) (void)(0)
+ #define REQUIRE_THAT( arg, matcher ) (void)(0)
+
+#endif // end of user facing macro declarations
+
+#endif // CATCH_MATCHERS_HPP_INCLUDED
+
+
+#ifndef CATCH_MATCHERS_CONTAINER_PROPERTIES_HPP_INCLUDED
+#define CATCH_MATCHERS_CONTAINER_PROPERTIES_HPP_INCLUDED
+
+
+
+#ifndef CATCH_MATCHERS_TEMPLATED_HPP_INCLUDED
+#define CATCH_MATCHERS_TEMPLATED_HPP_INCLUDED
+
+
+#include <array>
+#include <algorithm>
+#include <string>
+#include <type_traits>
+
+namespace Catch {
+namespace Matchers {
+ class MatcherGenericBase : public MatcherUntypedBase {
+ public:
+ MatcherGenericBase() = default;
+ ~MatcherGenericBase() override; // = default;
+
+ MatcherGenericBase(MatcherGenericBase&) = default;
+ MatcherGenericBase(MatcherGenericBase&&) = default;
+
+ MatcherGenericBase& operator=(MatcherGenericBase const&) = delete;
+ MatcherGenericBase& operator=(MatcherGenericBase&&) = delete;
+ };
+
+
+ namespace Detail {
+ template<std::size_t N, std::size_t M>
+ std::array<void const*, N + M> array_cat(std::array<void const*, N> && lhs, std::array<void const*, M> && rhs) {
+ std::array<void const*, N + M> arr{};
+ std::copy_n(lhs.begin(), N, arr.begin());
+ std::copy_n(rhs.begin(), M, arr.begin() + N);
+ return arr;
+ }
+
+ template<std::size_t N>
+ std::array<void const*, N+1> array_cat(std::array<void const*, N> && lhs, void const* rhs) {
+ std::array<void const*, N+1> arr{};
+ std::copy_n(lhs.begin(), N, arr.begin());
+ arr[N] = rhs;
+ return arr;
+ }
+
+ template<std::size_t N>
+ std::array<void const*, N+1> array_cat(void const* lhs, std::array<void const*, N> && rhs) {
+ std::array<void const*, N + 1> arr{ {lhs} };
+ std::copy_n(rhs.begin(), N, arr.begin() + 1);
+ return arr;
+ }
+
+#if defined( __cpp_lib_logical_traits ) && __cpp_lib_logical_traits >= 201510
+
+ using std::conjunction;
+
+#else // __cpp_lib_logical_traits
+
+ template<typename... Cond>
+ struct conjunction : std::true_type {};
+
+ template<typename Cond, typename... Rest>
+ struct conjunction<Cond, Rest...> : std::integral_constant<bool, Cond::value && conjunction<Rest...>::value> {};
+
+#endif // __cpp_lib_logical_traits
+
+ template<typename T>
+ using is_generic_matcher = std::is_base_of<
+ Catch::Matchers::MatcherGenericBase,
+ std::remove_cv_t<std::remove_reference_t<T>>
+ >;
+
+ template<typename... Ts>
+ using are_generic_matchers = conjunction<is_generic_matcher<Ts>...>;
+
+ template<typename T>
+ using is_matcher = std::is_base_of<
+ Catch::Matchers::MatcherUntypedBase,
+ std::remove_cv_t<std::remove_reference_t<T>>
+ >;
+
+
+ template<std::size_t N, typename Arg>
+ bool match_all_of(Arg&&, std::array<void const*, N> const&, std::index_sequence<>) {
+ return true;
+ }
+
+ template<typename T, typename... MatcherTs, std::size_t N, typename Arg, std::size_t Idx, std::size_t... Indices>
+ bool match_all_of(Arg&& arg, std::array<void const*, N> const& matchers, std::index_sequence<Idx, Indices...>) {
+ return static_cast<T const*>(matchers[Idx])->match(arg) && match_all_of<MatcherTs...>(arg, matchers, std::index_sequence<Indices...>{});
+ }
+
+
+ template<std::size_t N, typename Arg>
+ bool match_any_of(Arg&&, std::array<void const*, N> const&, std::index_sequence<>) {
+ return false;
+ }
+
+ template<typename T, typename... MatcherTs, std::size_t N, typename Arg, std::size_t Idx, std::size_t... Indices>
+ bool match_any_of(Arg&& arg, std::array<void const*, N> const& matchers, std::index_sequence<Idx, Indices...>) {
+ return static_cast<T const*>(matchers[Idx])->match(arg) || match_any_of<MatcherTs...>(arg, matchers, std::index_sequence<Indices...>{});
+ }
+
+ std::string describe_multi_matcher(StringRef combine, std::string const* descriptions_begin, std::string const* descriptions_end);
+
+ template<typename... MatcherTs, std::size_t... Idx>
+ std::string describe_multi_matcher(StringRef combine, std::array<void const*, sizeof...(MatcherTs)> const& matchers, std::index_sequence<Idx...>) {
+ std::array<std::string, sizeof...(MatcherTs)> descriptions {{
+ static_cast<MatcherTs const*>(matchers[Idx])->toString()...
+ }};
+
+ return describe_multi_matcher(combine, descriptions.data(), descriptions.data() + descriptions.size());
+ }
+
+
+ template<typename... MatcherTs>
+ class MatchAllOfGeneric final : public MatcherGenericBase {
+ public:
+ MatchAllOfGeneric(MatchAllOfGeneric const&) = delete;
+ MatchAllOfGeneric& operator=(MatchAllOfGeneric const&) = delete;
+ MatchAllOfGeneric(MatchAllOfGeneric&&) = default;
+ MatchAllOfGeneric& operator=(MatchAllOfGeneric&&) = default;
+
+ MatchAllOfGeneric(MatcherTs const&... matchers) : m_matchers{ {std::addressof(matchers)...} } {}
+ explicit MatchAllOfGeneric(std::array<void const*, sizeof...(MatcherTs)> matchers) : m_matchers{matchers} {}
+
+ template<typename Arg>
+ bool match(Arg&& arg) const {
+ return match_all_of<MatcherTs...>(arg, m_matchers, std::index_sequence_for<MatcherTs...>{});
+ }
+
+ std::string describe() const override {
+ return describe_multi_matcher<MatcherTs...>(" and "_sr, m_matchers, std::index_sequence_for<MatcherTs...>{});
+ }
+
+ // Has to be public to enable the concatenating operators
+ // below, because they are not friend of the RHS, only LHS,
+ // and thus cannot access private fields of RHS
+ std::array<void const*, sizeof...( MatcherTs )> m_matchers;
+
+
+ //! Avoids type nesting for `GenericAllOf && GenericAllOf` case
+ template<typename... MatchersRHS>
+ friend
+ MatchAllOfGeneric<MatcherTs..., MatchersRHS...> operator && (
+ MatchAllOfGeneric<MatcherTs...>&& lhs,
+ MatchAllOfGeneric<MatchersRHS...>&& rhs) {
+ return MatchAllOfGeneric<MatcherTs..., MatchersRHS...>{array_cat(CATCH_MOVE(lhs.m_matchers), CATCH_MOVE(rhs.m_matchers))};
+ }
+
+ //! Avoids type nesting for `GenericAllOf && some matcher` case
+ template<typename MatcherRHS>
+ friend std::enable_if_t<is_matcher<MatcherRHS>::value,
+ MatchAllOfGeneric<MatcherTs..., MatcherRHS>> operator && (
+ MatchAllOfGeneric<MatcherTs...>&& lhs,
+ MatcherRHS const& rhs) {
+ return MatchAllOfGeneric<MatcherTs..., MatcherRHS>{array_cat(CATCH_MOVE(lhs.m_matchers), static_cast<void const*>(&rhs))};
+ }
+
+ //! Avoids type nesting for `some matcher && GenericAllOf` case
+ template<typename MatcherLHS>
+ friend std::enable_if_t<is_matcher<MatcherLHS>::value,
+ MatchAllOfGeneric<MatcherLHS, MatcherTs...>> operator && (
+ MatcherLHS const& lhs,
+ MatchAllOfGeneric<MatcherTs...>&& rhs) {
+ return MatchAllOfGeneric<MatcherLHS, MatcherTs...>{array_cat(static_cast<void const*>(std::addressof(lhs)), CATCH_MOVE(rhs.m_matchers))};
+ }
+ };
+
+
+ template<typename... MatcherTs>
+ class MatchAnyOfGeneric final : public MatcherGenericBase {
+ public:
+ MatchAnyOfGeneric(MatchAnyOfGeneric const&) = delete;
+ MatchAnyOfGeneric& operator=(MatchAnyOfGeneric const&) = delete;
+ MatchAnyOfGeneric(MatchAnyOfGeneric&&) = default;
+ MatchAnyOfGeneric& operator=(MatchAnyOfGeneric&&) = default;
+
+ MatchAnyOfGeneric(MatcherTs const&... matchers) : m_matchers{ {std::addressof(matchers)...} } {}
+ explicit MatchAnyOfGeneric(std::array<void const*, sizeof...(MatcherTs)> matchers) : m_matchers{matchers} {}
+
+ template<typename Arg>
+ bool match(Arg&& arg) const {
+ return match_any_of<MatcherTs...>(arg, m_matchers, std::index_sequence_for<MatcherTs...>{});
+ }
+
+ std::string describe() const override {
+ return describe_multi_matcher<MatcherTs...>(" or "_sr, m_matchers, std::index_sequence_for<MatcherTs...>{});
+ }
+
+
+ // Has to be public to enable the concatenating operators
+ // below, because they are not friend of the RHS, only LHS,
+ // and thus cannot access private fields of RHS
+ std::array<void const*, sizeof...( MatcherTs )> m_matchers;
+
+ //! Avoids type nesting for `GenericAnyOf || GenericAnyOf` case
+ template<typename... MatchersRHS>
+ friend MatchAnyOfGeneric<MatcherTs..., MatchersRHS...> operator || (
+ MatchAnyOfGeneric<MatcherTs...>&& lhs,
+ MatchAnyOfGeneric<MatchersRHS...>&& rhs) {
+ return MatchAnyOfGeneric<MatcherTs..., MatchersRHS...>{array_cat(CATCH_MOVE(lhs.m_matchers), CATCH_MOVE(rhs.m_matchers))};
+ }
+
+ //! Avoids type nesting for `GenericAnyOf || some matcher` case
+ template<typename MatcherRHS>
+ friend std::enable_if_t<is_matcher<MatcherRHS>::value,
+ MatchAnyOfGeneric<MatcherTs..., MatcherRHS>> operator || (
+ MatchAnyOfGeneric<MatcherTs...>&& lhs,
+ MatcherRHS const& rhs) {
+ return MatchAnyOfGeneric<MatcherTs..., MatcherRHS>{array_cat(CATCH_MOVE(lhs.m_matchers), static_cast<void const*>(std::addressof(rhs)))};
+ }
+
+ //! Avoids type nesting for `some matcher || GenericAnyOf` case
+ template<typename MatcherLHS>
+ friend std::enable_if_t<is_matcher<MatcherLHS>::value,
+ MatchAnyOfGeneric<MatcherLHS, MatcherTs...>> operator || (
+ MatcherLHS const& lhs,
+ MatchAnyOfGeneric<MatcherTs...>&& rhs) {
+ return MatchAnyOfGeneric<MatcherLHS, MatcherTs...>{array_cat(static_cast<void const*>(std::addressof(lhs)), CATCH_MOVE(rhs.m_matchers))};
+ }
+ };
+
+
+ template<typename MatcherT>
+ class MatchNotOfGeneric final : public MatcherGenericBase {
+ MatcherT const& m_matcher;
+
+ public:
+ MatchNotOfGeneric(MatchNotOfGeneric const&) = delete;
+ MatchNotOfGeneric& operator=(MatchNotOfGeneric const&) = delete;
+ MatchNotOfGeneric(MatchNotOfGeneric&&) = default;
+ MatchNotOfGeneric& operator=(MatchNotOfGeneric&&) = default;
+
+ explicit MatchNotOfGeneric(MatcherT const& matcher) : m_matcher{matcher} {}
+
+ template<typename Arg>
+ bool match(Arg&& arg) const {
+ return !m_matcher.match(arg);
+ }
+
+ std::string describe() const override {
+ return "not " + m_matcher.toString();
+ }
+
+ //! Negating negation can just unwrap and return underlying matcher
+ friend MatcherT const& operator ! (MatchNotOfGeneric<MatcherT> const& matcher) {
+ return matcher.m_matcher;
+ }
+ };
+ } // namespace Detail
+
+
+ // compose only generic matchers
+ template<typename MatcherLHS, typename MatcherRHS>
+ std::enable_if_t<Detail::are_generic_matchers<MatcherLHS, MatcherRHS>::value, Detail::MatchAllOfGeneric<MatcherLHS, MatcherRHS>>
+ operator && (MatcherLHS const& lhs, MatcherRHS const& rhs) {
+ return { lhs, rhs };
+ }
+
+ template<typename MatcherLHS, typename MatcherRHS>
+ std::enable_if_t<Detail::are_generic_matchers<MatcherLHS, MatcherRHS>::value, Detail::MatchAnyOfGeneric<MatcherLHS, MatcherRHS>>
+ operator || (MatcherLHS const& lhs, MatcherRHS const& rhs) {
+ return { lhs, rhs };
+ }
+
+ //! Wrap provided generic matcher in generic negator
+ template<typename MatcherT>
+ std::enable_if_t<Detail::is_generic_matcher<MatcherT>::value, Detail::MatchNotOfGeneric<MatcherT>>
+ operator ! (MatcherT const& matcher) {
+ return Detail::MatchNotOfGeneric<MatcherT>{matcher};
+ }
+
+
+ // compose mixed generic and non-generic matchers
+ template<typename MatcherLHS, typename ArgRHS>
+ std::enable_if_t<Detail::is_generic_matcher<MatcherLHS>::value, Detail::MatchAllOfGeneric<MatcherLHS, MatcherBase<ArgRHS>>>
+ operator && (MatcherLHS const& lhs, MatcherBase<ArgRHS> const& rhs) {
+ return { lhs, rhs };
+ }
+
+ template<typename ArgLHS, typename MatcherRHS>
+ std::enable_if_t<Detail::is_generic_matcher<MatcherRHS>::value, Detail::MatchAllOfGeneric<MatcherBase<ArgLHS>, MatcherRHS>>
+ operator && (MatcherBase<ArgLHS> const& lhs, MatcherRHS const& rhs) {
+ return { lhs, rhs };
+ }
+
+ template<typename MatcherLHS, typename ArgRHS>
+ std::enable_if_t<Detail::is_generic_matcher<MatcherLHS>::value, Detail::MatchAnyOfGeneric<MatcherLHS, MatcherBase<ArgRHS>>>
+ operator || (MatcherLHS const& lhs, MatcherBase<ArgRHS> const& rhs) {
+ return { lhs, rhs };
+ }
+
+ template<typename ArgLHS, typename MatcherRHS>
+ std::enable_if_t<Detail::is_generic_matcher<MatcherRHS>::value, Detail::MatchAnyOfGeneric<MatcherBase<ArgLHS>, MatcherRHS>>
+ operator || (MatcherBase<ArgLHS> const& lhs, MatcherRHS const& rhs) {
+ return { lhs, rhs };
+ }
+
+} // namespace Matchers
+} // namespace Catch
+
+#endif // CATCH_MATCHERS_TEMPLATED_HPP_INCLUDED
+
+namespace Catch {
+ namespace Matchers {
+
+ class IsEmptyMatcher final : public MatcherGenericBase {
+ public:
+ template <typename RangeLike>
+ bool match(RangeLike&& rng) const {
+#if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS)
+ using Catch::Detail::empty;
+#else
+ using std::empty;
+#endif
+ return empty(rng);
+ }
+
+ std::string describe() const override;
+ };
+
+ class HasSizeMatcher final : public MatcherGenericBase {
+ std::size_t m_target_size;
+ public:
+ explicit HasSizeMatcher(std::size_t target_size):
+ m_target_size(target_size)
+ {}
+
+ template <typename RangeLike>
+ bool match(RangeLike&& rng) const {
+#if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS)
+ using Catch::Detail::size;
+#else
+ using std::size;
+#endif
+ return size(rng) == m_target_size;
+ }
+
+ std::string describe() const override;
+ };
+
+ template <typename Matcher>
+ class SizeMatchesMatcher final : public MatcherGenericBase {
+ Matcher m_matcher;
+ public:
+ explicit SizeMatchesMatcher(Matcher m):
+ m_matcher(CATCH_MOVE(m))
+ {}
+
+ template <typename RangeLike>
+ bool match(RangeLike&& rng) const {
+#if defined(CATCH_CONFIG_POLYFILL_NONMEMBER_CONTAINER_ACCESS)
+ using Catch::Detail::size;
+#else
+ using std::size;
+#endif
+ return m_matcher.match(size(rng));
+ }
+
+ std::string describe() const override {
+ return "size matches " + m_matcher.describe();
+ }
+ };
+
+
+ //! Creates a matcher that accepts empty ranges/containers
+ IsEmptyMatcher IsEmpty();
+ //! Creates a matcher that accepts ranges/containers with specific size
+ HasSizeMatcher SizeIs(std::size_t sz);
+ template <typename Matcher>
+ std::enable_if_t<Detail::is_matcher<Matcher>::value,
+ SizeMatchesMatcher<Matcher>> SizeIs(Matcher&& m) {
+ return SizeMatchesMatcher<Matcher>{CATCH_FORWARD(m)};
+ }
+
+ } // end namespace Matchers
+} // end namespace Catch
+
+#endif // CATCH_MATCHERS_CONTAINER_PROPERTIES_HPP_INCLUDED
+
+
+#ifndef CATCH_MATCHERS_CONTAINS_HPP_INCLUDED
+#define CATCH_MATCHERS_CONTAINS_HPP_INCLUDED
+
+
+#include <algorithm>
+#include <functional>
+
+namespace Catch {
+ namespace Matchers {
+ //! Matcher for checking that an element in range is equal to specific element
+ template <typename T, typename Equality>
+ class ContainsElementMatcher final : public MatcherGenericBase {
+ T m_desired;
+ Equality m_eq;
+ public:
+ template <typename T2, typename Equality2>
+ ContainsElementMatcher(T2&& target, Equality2&& predicate):
+ m_desired(CATCH_FORWARD(target)),
+ m_eq(CATCH_FORWARD(predicate))
+ {}
+
+ std::string describe() const override {
+ return "contains element " + Catch::Detail::stringify(m_desired);
+ }
+
+ template <typename RangeLike>
+ bool match(RangeLike&& rng) const {
+ using std::begin; using std::end;
+
+ return end(rng) != std::find_if(begin(rng), end(rng),
+ [&](auto const& elem) {
+ return m_eq(elem, m_desired);
+ });
+ }
+ };
+
+ //! Meta-matcher for checking that an element in a range matches a specific matcher
+ template <typename Matcher>
+ class ContainsMatcherMatcher final : public MatcherGenericBase {
+ Matcher m_matcher;
+ public:
+ // Note that we do a copy+move to avoid having to SFINAE this
+ // constructor (and also avoid some perfect forwarding failure
+ // cases)
+ ContainsMatcherMatcher(Matcher matcher):
+ m_matcher(CATCH_MOVE(matcher))
+ {}
+
+ template <typename RangeLike>
+ bool match(RangeLike&& rng) const {
+ for (auto&& elem : rng) {
+ if (m_matcher.match(elem)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ std::string describe() const override {
+ return "contains element matching " + m_matcher.describe();
+ }
+ };
+
+ /**
+ * Creates a matcher that checks whether a range contains a specific element.
+ *
+ * Uses `std::equal_to` to do the comparison
+ */
+ template <typename T>
+ std::enable_if_t<!Detail::is_matcher<T>::value,
+ ContainsElementMatcher<T, std::equal_to<>>> Contains(T&& elem) {
+ return { CATCH_FORWARD(elem), std::equal_to<>{} };
+ }
+
+ //! Creates a matcher that checks whether a range contains element matching a matcher
+ template <typename Matcher>
+ std::enable_if_t<Detail::is_matcher<Matcher>::value,
+ ContainsMatcherMatcher<Matcher>> Contains(Matcher&& matcher) {
+ return { CATCH_FORWARD(matcher) };
+ }
+
+ /**
+ * Creates a matcher that checks whether a range contains a specific element.
+ *
+ * Uses `eq` to do the comparisons
+ */
+ template <typename T, typename Equality>
+ ContainsElementMatcher<T, Equality> Contains(T&& elem, Equality&& eq) {
+ return { CATCH_FORWARD(elem), CATCH_FORWARD(eq) };
+ }
+
+ }
+}
+
+#endif // CATCH_MATCHERS_CONTAINS_HPP_INCLUDED
+
+
+#ifndef CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
+#define CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
+
+
+namespace Catch {
+namespace Matchers {
+
+class ExceptionMessageMatcher final : public MatcherBase<std::exception> {
+ std::string m_message;
+public:
+
+ ExceptionMessageMatcher(std::string const& message):
+ m_message(message)
+ {}
+
+ bool match(std::exception const& ex) const override;
+
+ std::string describe() const override;
+};
+
+//! Creates a matcher that checks whether a std derived exception has the provided message
+ExceptionMessageMatcher Message(std::string const& message);
+
+} // namespace Matchers
+} // namespace Catch
+
+#endif // CATCH_MATCHERS_EXCEPTION_HPP_INCLUDED
+
+
+#ifndef CATCH_MATCHERS_FLOATING_POINT_HPP_INCLUDED
+#define CATCH_MATCHERS_FLOATING_POINT_HPP_INCLUDED
+
+
+namespace Catch {
+namespace Matchers {
+
+ namespace Detail {
+ enum class FloatingPointKind : uint8_t;
+ }
+
+ class WithinAbsMatcher final : public MatcherBase<double> {
+ public:
+ WithinAbsMatcher(double target, double margin);
+ bool match(double const& matchee) const override;
+ std::string describe() const override;
+ private:
+ double m_target;
+ double m_margin;
+ };
+
+ class WithinUlpsMatcher final : public MatcherBase<double> {
+ public:
+ WithinUlpsMatcher( double target,
+ uint64_t ulps,
+ Detail::FloatingPointKind baseType );
+ bool match(double const& matchee) const override;
+ std::string describe() const override;
+ private:
+ double m_target;
+ uint64_t m_ulps;
+ Detail::FloatingPointKind m_type;
+ };
+
+ // Given IEEE-754 format for floats and doubles, we can assume
+ // that float -> double promotion is lossless. Given this, we can
+ // assume that if we do the standard relative comparison of
+ // |lhs - rhs| <= epsilon * max(fabs(lhs), fabs(rhs)), then we get
+ // the same result if we do this for floats, as if we do this for
+ // doubles that were promoted from floats.
+ class WithinRelMatcher final : public MatcherBase<double> {
+ public:
+ WithinRelMatcher( double target, double epsilon );
+ bool match(double const& matchee) const override;
+ std::string describe() const override;
+ private:
+ double m_target;
+ double m_epsilon;
+ };
+
+ //! Creates a matcher that accepts doubles within certain ULP range of target
+ WithinUlpsMatcher WithinULP(double target, uint64_t maxUlpDiff);
+ //! Creates a matcher that accepts floats within certain ULP range of target
+ WithinUlpsMatcher WithinULP(float target, uint64_t maxUlpDiff);
+ //! Creates a matcher that accepts numbers within certain range of target
+ WithinAbsMatcher WithinAbs(double target, double margin);
+
+ //! Creates a matcher that accepts doubles within certain relative range of target
+ WithinRelMatcher WithinRel(double target, double eps);
+ //! Creates a matcher that accepts doubles within 100*DBL_EPS relative range of target
+ WithinRelMatcher WithinRel(double target);
+ //! Creates a matcher that accepts doubles within certain relative range of target
+ WithinRelMatcher WithinRel(float target, float eps);
+ //! Creates a matcher that accepts floats within 100*FLT_EPS relative range of target
+ WithinRelMatcher WithinRel(float target);
+
+} // namespace Matchers
+} // namespace Catch
+
+#endif // CATCH_MATCHERS_FLOATING_POINT_HPP_INCLUDED
+
+
+#ifndef CATCH_MATCHERS_PREDICATE_HPP_INCLUDED
+#define CATCH_MATCHERS_PREDICATE_HPP_INCLUDED
+
+
+#include <string>
+
+namespace Catch {
+namespace Matchers {
+
+namespace Detail {
+ std::string finalizeDescription(const std::string& desc);
+} // namespace Detail
+
+template <typename T, typename Predicate>
+class PredicateMatcher final : public MatcherBase<T> {
+ Predicate m_predicate;
+ std::string m_description;
+public:
+
+ PredicateMatcher(Predicate&& elem, std::string const& descr)
+ :m_predicate(CATCH_FORWARD(elem)),
+ m_description(Detail::finalizeDescription(descr))
+ {}
+
+ bool match( T const& item ) const override {
+ return m_predicate(item);
+ }
+
+ std::string describe() const override {
+ return m_description;
+ }
+};
+
+ /**
+ * Creates a matcher that calls delegates `match` to the provided predicate.
+ *
+ * The user has to explicitly specify the argument type to the matcher
+ */
+ template<typename T, typename Pred>
+ PredicateMatcher<T, Pred> Predicate(Pred&& predicate, std::string const& description = "") {
+ static_assert(is_callable<Pred(T)>::value, "Predicate not callable with argument T");
+ static_assert(std::is_same<bool, FunctionReturnType<Pred, T>>::value, "Predicate does not return bool");
+ return PredicateMatcher<T, Pred>(CATCH_FORWARD(predicate), description);
+ }
+
+} // namespace Matchers
+} // namespace Catch
+
+#endif // CATCH_MATCHERS_PREDICATE_HPP_INCLUDED
+
+
+#ifndef CATCH_MATCHERS_QUANTIFIERS_HPP_INCLUDED
+#define CATCH_MATCHERS_QUANTIFIERS_HPP_INCLUDED
+
+
+namespace Catch {
+ namespace Matchers {
+ // Matcher for checking that all elements in range matches a given matcher.
+ template <typename Matcher>
+ class AllMatchMatcher final : public MatcherGenericBase {
+ Matcher m_matcher;
+ public:
+ AllMatchMatcher(Matcher matcher):
+ m_matcher(CATCH_MOVE(matcher))
+ {}
+
+ std::string describe() const override {
+ return "all match " + m_matcher.describe();
+ }
+
+ template <typename RangeLike>
+ bool match(RangeLike&& rng) const {
+ for (auto&& elem : rng) {
+ if (!m_matcher.match(elem)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ };
+
+ // Matcher for checking that no element in range matches a given matcher.
+ template <typename Matcher>
+ class NoneMatchMatcher final : public MatcherGenericBase {
+ Matcher m_matcher;
+ public:
+ NoneMatchMatcher(Matcher matcher):
+ m_matcher(CATCH_MOVE(matcher))
+ {}
+
+ std::string describe() const override {
+ return "none match " + m_matcher.describe();
+ }
+
+ template <typename RangeLike>
+ bool match(RangeLike&& rng) const {
+ for (auto&& elem : rng) {
+ if (m_matcher.match(elem)) {
+ return false;
+ }
+ }
+ return true;
+ }
+ };
+
+ // Matcher for checking that at least one element in range matches a given matcher.
+ template <typename Matcher>
+ class AnyMatchMatcher final : public MatcherGenericBase {
+ Matcher m_matcher;
+ public:
+ AnyMatchMatcher(Matcher matcher):
+ m_matcher(CATCH_MOVE(matcher))
+ {}
+
+ std::string describe() const override {
+ return "any match " + m_matcher.describe();
+ }
+
+ template <typename RangeLike>
+ bool match(RangeLike&& rng) const {
+ for (auto&& elem : rng) {
+ if (m_matcher.match(elem)) {
+ return true;
+ }
+ }
+ return false;
+ }
+ };
+
+ // Matcher for checking that all elements in range are true.
+ class AllTrueMatcher final : public MatcherGenericBase {
+ public:
+ std::string describe() const override;
+
+ template <typename RangeLike>
+ bool match(RangeLike&& rng) const {
+ for (auto&& elem : rng) {
+ if (!elem) {
+ return false;
+ }
+ }
+ return true;
+ }
+ };
+
+ // Matcher for checking that no element in range is true.
+ class NoneTrueMatcher final : public MatcherGenericBase {
+ public:
+ std::string describe() const override;
+
+ template <typename RangeLike>
+ bool match(RangeLike&& rng) const {
+ for (auto&& elem : rng) {
+ if (elem) {
+ return false;
+ }
+ }
+ return true;
+ }
+ };
+
+ // Matcher for checking that any element in range is true.
+ class AnyTrueMatcher final : public MatcherGenericBase {
+ public:
+ std::string describe() const override;
+
+ template <typename RangeLike>
+ bool match(RangeLike&& rng) const {
+ for (auto&& elem : rng) {
+ if (elem) {
+ return true;
+ }
+ }
+ return false;
+ }
+ };
+
+ // Creates a matcher that checks whether all elements in a range match a matcher
+ template <typename Matcher>
+ AllMatchMatcher<Matcher> AllMatch(Matcher&& matcher) {
+ return { CATCH_FORWARD(matcher) };
+ }
+
+ // Creates a matcher that checks whether no element in a range matches a matcher.
+ template <typename Matcher>
+ NoneMatchMatcher<Matcher> NoneMatch(Matcher&& matcher) {
+ return { CATCH_FORWARD(matcher) };
+ }
+
+ // Creates a matcher that checks whether any element in a range matches a matcher.
+ template <typename Matcher>
+ AnyMatchMatcher<Matcher> AnyMatch(Matcher&& matcher) {
+ return { CATCH_FORWARD(matcher) };
+ }
+
+ // Creates a matcher that checks whether all elements in a range are true
+ AllTrueMatcher AllTrue();
+
+ // Creates a matcher that checks whether no element in a range is true
+ NoneTrueMatcher NoneTrue();
+
+ // Creates a matcher that checks whether any element in a range is true
+ AnyTrueMatcher AnyTrue();
+ }
+}
+
+#endif // CATCH_MATCHERS_QUANTIFIERS_HPP_INCLUDED
+
+
+#ifndef CATCH_MATCHERS_STRING_HPP_INCLUDED
+#define CATCH_MATCHERS_STRING_HPP_INCLUDED
+
+
+#include <string>
+
+namespace Catch {
+namespace Matchers {
+
+ struct CasedString {
+ CasedString( std::string const& str, CaseSensitive caseSensitivity );
+ std::string adjustString( std::string const& str ) const;
+ StringRef caseSensitivitySuffix() const;
+
+ CaseSensitive m_caseSensitivity;
+ std::string m_str;
+ };
+
+ class StringMatcherBase : public MatcherBase<std::string> {
+ protected:
+ CasedString m_comparator;
+ StringRef m_operation;
+
+ public:
+ StringMatcherBase( StringRef operation,
+ CasedString const& comparator );
+ std::string describe() const override;
+ };
+
+ class StringEqualsMatcher final : public StringMatcherBase {
+ public:
+ StringEqualsMatcher( CasedString const& comparator );
+ bool match( std::string const& source ) const override;
+ };
+ class StringContainsMatcher final : public StringMatcherBase {
+ public:
+ StringContainsMatcher( CasedString const& comparator );
+ bool match( std::string const& source ) const override;
+ };
+ class StartsWithMatcher final : public StringMatcherBase {
+ public:
+ StartsWithMatcher( CasedString const& comparator );
+ bool match( std::string const& source ) const override;
+ };
+ class EndsWithMatcher final : public StringMatcherBase {
+ public:
+ EndsWithMatcher( CasedString const& comparator );
+ bool match( std::string const& source ) const override;
+ };
+
+ class RegexMatcher final : public MatcherBase<std::string> {
+ std::string m_regex;
+ CaseSensitive m_caseSensitivity;
+
+ public:
+ RegexMatcher( std::string regex, CaseSensitive caseSensitivity );
+ bool match( std::string const& matchee ) const override;
+ std::string describe() const override;
+ };
+
+ //! Creates matcher that accepts strings that are exactly equal to `str`
+ StringEqualsMatcher Equals( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes );
+ //! Creates matcher that accepts strings that contain `str`
+ StringContainsMatcher ContainsSubstring( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes );
+ //! Creates matcher that accepts strings that _end_ with `str`
+ EndsWithMatcher EndsWith( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes );
+ //! Creates matcher that accepts strings that _start_ with `str`
+ StartsWithMatcher StartsWith( std::string const& str, CaseSensitive caseSensitivity = CaseSensitive::Yes );
+ //! Creates matcher that accepts strings matching `regex`
+ RegexMatcher Matches( std::string const& regex, CaseSensitive caseSensitivity = CaseSensitive::Yes );
+
+} // namespace Matchers
+} // namespace Catch
+
+#endif // CATCH_MATCHERS_STRING_HPP_INCLUDED
+
+
+#ifndef CATCH_MATCHERS_VECTOR_HPP_INCLUDED
+#define CATCH_MATCHERS_VECTOR_HPP_INCLUDED
+
+
+#include <algorithm>
+
+namespace Catch {
+namespace Matchers {
+
+ template<typename T, typename Alloc>
+ class VectorContainsElementMatcher final : public MatcherBase<std::vector<T, Alloc>> {
+ T const& m_comparator;
+
+ public:
+ VectorContainsElementMatcher(T const& comparator):
+ m_comparator(comparator)
+ {}
+
+ bool match(std::vector<T, Alloc> const& v) const override {
+ for (auto const& el : v) {
+ if (el == m_comparator) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ std::string describe() const override {
+ return "Contains: " + ::Catch::Detail::stringify( m_comparator );
+ }
+ };
+
+ template<typename T, typename AllocComp, typename AllocMatch>
+ class ContainsMatcher final : public MatcherBase<std::vector<T, AllocMatch>> {
+ std::vector<T, AllocComp> const& m_comparator;
+
+ public:
+ ContainsMatcher(std::vector<T, AllocComp> const& comparator):
+ m_comparator( comparator )
+ {}
+
+ bool match(std::vector<T, AllocMatch> const& v) const override {
+ // !TBD: see note in EqualsMatcher
+ if (m_comparator.size() > v.size())
+ return false;
+ for (auto const& comparator : m_comparator) {
+ auto present = false;
+ for (const auto& el : v) {
+ if (el == comparator) {
+ present = true;
+ break;
+ }
+ }
+ if (!present) {
+ return false;
+ }
+ }
+ return true;
+ }
+ std::string describe() const override {
+ return "Contains: " + ::Catch::Detail::stringify( m_comparator );
+ }
+ };
+
+ template<typename T, typename AllocComp, typename AllocMatch>
+ class EqualsMatcher final : public MatcherBase<std::vector<T, AllocMatch>> {
+ std::vector<T, AllocComp> const& m_comparator;
+
+ public:
+ EqualsMatcher(std::vector<T, AllocComp> const& comparator):
+ m_comparator( comparator )
+ {}
+
+ bool match(std::vector<T, AllocMatch> const& v) const override {
+ // !TBD: This currently works if all elements can be compared using !=
+ // - a more general approach would be via a compare template that defaults
+ // to using !=. but could be specialised for, e.g. std::vector<T> etc
+ // - then just call that directly
+ if (m_comparator.size() != v.size())
+ return false;
+ for (std::size_t i = 0; i < v.size(); ++i)
+ if (m_comparator[i] != v[i])
+ return false;
+ return true;
+ }
+ std::string describe() const override {
+ return "Equals: " + ::Catch::Detail::stringify( m_comparator );
+ }
+ };
+
+ template<typename T, typename AllocComp, typename AllocMatch>
+ class ApproxMatcher final : public MatcherBase<std::vector<T, AllocMatch>> {
+ std::vector<T, AllocComp> const& m_comparator;
+ mutable Catch::Approx approx = Catch::Approx::custom();
+
+ public:
+ ApproxMatcher(std::vector<T, AllocComp> const& comparator):
+ m_comparator( comparator )
+ {}
+
+ bool match(std::vector<T, AllocMatch> const& v) const override {
+ if (m_comparator.size() != v.size())
+ return false;
+ for (std::size_t i = 0; i < v.size(); ++i)
+ if (m_comparator[i] != approx(v[i]))
+ return false;
+ return true;
+ }
+ std::string describe() const override {
+ return "is approx: " + ::Catch::Detail::stringify( m_comparator );
+ }
+ template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ ApproxMatcher& epsilon( T const& newEpsilon ) {
+ approx.epsilon(static_cast<double>(newEpsilon));
+ return *this;
+ }
+ template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ ApproxMatcher& margin( T const& newMargin ) {
+ approx.margin(static_cast<double>(newMargin));
+ return *this;
+ }
+ template <typename = std::enable_if_t<std::is_constructible<double, T>::value>>
+ ApproxMatcher& scale( T const& newScale ) {
+ approx.scale(static_cast<double>(newScale));
+ return *this;
+ }
+ };
+
+ template<typename T, typename AllocComp, typename AllocMatch>
+ class UnorderedEqualsMatcher final : public MatcherBase<std::vector<T, AllocMatch>> {
+ std::vector<T, AllocComp> const& m_target;
+
+ public:
+ UnorderedEqualsMatcher(std::vector<T, AllocComp> const& target):
+ m_target(target)
+ {}
+ bool match(std::vector<T, AllocMatch> const& vec) const override {
+ if (m_target.size() != vec.size()) {
+ return false;
+ }
+ return std::is_permutation(m_target.begin(), m_target.end(), vec.begin());
+ }
+
+ std::string describe() const override {
+ return "UnorderedEquals: " + ::Catch::Detail::stringify(m_target);
+ }
+ };
+
+
+ // The following functions create the actual matcher objects.
+ // This allows the types to be inferred
+
+ //! Creates a matcher that matches vectors that contain all elements in `comparator`
+ template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
+ ContainsMatcher<T, AllocComp, AllocMatch> Contains( std::vector<T, AllocComp> const& comparator ) {
+ return ContainsMatcher<T, AllocComp, AllocMatch>(comparator);
+ }
+
+ //! Creates a matcher that matches vectors that contain `comparator` as an element
+ template<typename T, typename Alloc = std::allocator<T>>
+ VectorContainsElementMatcher<T, Alloc> VectorContains( T const& comparator ) {
+ return VectorContainsElementMatcher<T, Alloc>(comparator);
+ }
+
+ //! Creates a matcher that matches vectors that are exactly equal to `comparator`
+ template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
+ EqualsMatcher<T, AllocComp, AllocMatch> Equals( std::vector<T, AllocComp> const& comparator ) {
+ return EqualsMatcher<T, AllocComp, AllocMatch>(comparator);
+ }
+
+ //! Creates a matcher that matches vectors that `comparator` as an element
+ template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
+ ApproxMatcher<T, AllocComp, AllocMatch> Approx( std::vector<T, AllocComp> const& comparator ) {
+ return ApproxMatcher<T, AllocComp, AllocMatch>(comparator);
+ }
+
+ //! Creates a matcher that matches vectors that is equal to `target` modulo permutation
+ template<typename T, typename AllocComp = std::allocator<T>, typename AllocMatch = AllocComp>
+ UnorderedEqualsMatcher<T, AllocComp, AllocMatch> UnorderedEquals(std::vector<T, AllocComp> const& target) {
+ return UnorderedEqualsMatcher<T, AllocComp, AllocMatch>(target);
+ }
+
+} // namespace Matchers
+} // namespace Catch
+
+#endif // CATCH_MATCHERS_VECTOR_HPP_INCLUDED
+
+#endif // CATCH_MATCHERS_ALL_HPP_INCLUDED
+
+
+/** \file
+ * This is a convenience header for Catch2's Reporter support. It includes
+ * **all** of Catch2 headers related to reporters, including all reporters.
+ *
+ * Generally the Catch2 users should use specific includes they need,
+ * but this header can be used instead for ease-of-experimentation, or
+ * just plain convenience, at the cost of (significantly) increased
+ * compilation times.
+ *
+ * When a new header (reporter) is added to either the `reporter` folder,
+ * or to the corresponding internal subfolder, it should be added here.
+ */
+
+#ifndef CATCH_REPORTERS_ALL_HPP_INCLUDED
+#define CATCH_REPORTERS_ALL_HPP_INCLUDED
+
+
+
+#ifndef CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
+#define CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
+
+
+
+#ifndef CATCH_REPORTER_STREAMING_BASE_HPP_INCLUDED
+#define CATCH_REPORTER_STREAMING_BASE_HPP_INCLUDED
+
+
+
+#ifndef CATCH_REPORTER_COMMON_BASE_HPP_INCLUDED
+#define CATCH_REPORTER_COMMON_BASE_HPP_INCLUDED
+
+
+#include <map>
+#include <string>
+
+namespace Catch {
+ class ColourImpl;
+
+ /**
+ * This is the base class for all reporters.
+ *
+ * If are writing a reporter, you must derive from this type, or one
+ * of the helper reporter bases that are derived from this type.
+ *
+ * ReporterBase centralizes handling of various common tasks in reporters,
+ * like storing the right stream for the reporters to write to, and
+ * providing the default implementation of the different listing events.
+ */
+ class ReporterBase : public IEventListener {
+ protected:
+ //! The stream wrapper as passed to us by outside code
+ Detail::unique_ptr<IStream> m_wrapped_stream;
+ //! Cached output stream from `m_wrapped_stream` to reduce
+ //! number of indirect calls needed to write output.
+ std::ostream& m_stream;
+ //! Colour implementation this reporter was configured for
+ Detail::unique_ptr<ColourImpl> m_colour;
+ //! The custom reporter options user passed down to the reporter
+ std::map<std::string, std::string> m_customOptions;
+
+ public:
+ ReporterBase( ReporterConfig&& config );
+ ~ReporterBase() override; // = default;
+
+ /**
+ * Provides a simple default listing of reporters.
+ *
+ * Should look roughly like the reporter listing in v2 and earlier
+ * versions of Catch2.
+ */
+ void listReporters(
+ std::vector<ReporterDescription> const& descriptions ) override;
+ /**
+ * Provides a simple default listing of listeners
+ *
+ * Looks similarly to listing of reporters, but with listener type
+ * instead of reporter name.
+ */
+ void listListeners(
+ std::vector<ListenerDescription> const& descriptions ) override;
+ /**
+ * Provides a simple default listing of tests.
+ *
+ * Should look roughly like the test listing in v2 and earlier versions
+ * of Catch2. Especially supports low-verbosity listing that mimics the
+ * old `--list-test-names-only` output.
+ */
+ void listTests( std::vector<TestCaseHandle> const& tests ) override;
+ /**
+ * Provides a simple default listing of tags.
+ *
+ * Should look roughly like the tag listing in v2 and earlier versions
+ * of Catch2.
+ */
+ void listTags( std::vector<TagInfo> const& tags ) override;
+ };
+} // namespace Catch
+
+#endif // CATCH_REPORTER_COMMON_BASE_HPP_INCLUDED
+
+#include <vector>
+
+namespace Catch {
+
+ class StreamingReporterBase : public ReporterBase {
+ public:
+ // GCC5 compat: we cannot use inherited constructor, because it
+ // doesn't implement backport of P0136
+ StreamingReporterBase(ReporterConfig&& _config):
+ ReporterBase(CATCH_MOVE(_config))
+ {}
+ ~StreamingReporterBase() override;
+
+ void benchmarkPreparing( StringRef ) override {}
+ void benchmarkStarting( BenchmarkInfo const& ) override {}
+ void benchmarkEnded( BenchmarkStats<> const& ) override {}
+ void benchmarkFailed( StringRef ) override {}
+
+ void fatalErrorEncountered( StringRef /*error*/ ) override {}
+ void noMatchingTestCases( StringRef /*unmatchedSpec*/ ) override {}
+ void reportInvalidTestSpec( StringRef /*invalidArgument*/ ) override {}
+
+ void testRunStarting( TestRunInfo const& _testRunInfo ) override;
+
+ void testCaseStarting(TestCaseInfo const& _testInfo) override {
+ currentTestCaseInfo = &_testInfo;
+ }
+ void testCasePartialStarting( TestCaseInfo const&, uint64_t ) override {}
+ void sectionStarting(SectionInfo const& _sectionInfo) override {
+ m_sectionStack.push_back(_sectionInfo);
+ }
+
+ void assertionStarting( AssertionInfo const& ) override {}
+ void assertionEnded( AssertionStats const& ) override {}
+
+ void sectionEnded(SectionStats const& /* _sectionStats */) override {
+ m_sectionStack.pop_back();
+ }
+ void testCasePartialEnded( TestCaseStats const&, uint64_t ) override {}
+ void testCaseEnded(TestCaseStats const& /* _testCaseStats */) override {
+ currentTestCaseInfo = nullptr;
+ }
+ void testRunEnded( TestRunStats const& /* _testRunStats */ ) override;
+
+ void skipTest(TestCaseInfo const&) override {
+ // Don't do anything with this by default.
+ // It can optionally be overridden in the derived class.
+ }
+
+ protected:
+ TestRunInfo currentTestRunInfo{ "test run has not started yet"_sr };
+ TestCaseInfo const* currentTestCaseInfo = nullptr;
+
+ //! Stack of all _active_ sections in the _current_ test case
+ std::vector<SectionInfo> m_sectionStack;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_REPORTER_STREAMING_BASE_HPP_INCLUDED
+
+#include <string>
+
+namespace Catch {
+
+ class AutomakeReporter final : public StreamingReporterBase {
+ public:
+ // GCC5 compat: we cannot use inherited constructor, because it
+ // doesn't implement backport of P0136
+ AutomakeReporter(ReporterConfig&& _config):
+ StreamingReporterBase(CATCH_MOVE(_config))
+ {}
+ ~AutomakeReporter() override;
+
+ static std::string getDescription() {
+ using namespace std::string_literals;
+ return "Reports test results in the format of Automake .trs files"s;
+ }
+
+ void testCaseEnded(TestCaseStats const& _testCaseStats) override;
+ void skipTest(TestCaseInfo const& testInfo) override;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_REPORTER_AUTOMAKE_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_COMPACT_HPP_INCLUDED
+#define CATCH_REPORTER_COMPACT_HPP_INCLUDED
+
+
+
+
+namespace Catch {
+
+ class CompactReporter final : public StreamingReporterBase {
+ public:
+ using StreamingReporterBase::StreamingReporterBase;
+
+ ~CompactReporter() override;
+
+ static std::string getDescription();
+
+ void noMatchingTestCases( StringRef unmatchedSpec ) override;
+
+ void testRunStarting( TestRunInfo const& _testInfo ) override;
+
+ void assertionEnded(AssertionStats const& _assertionStats) override;
+
+ void sectionEnded(SectionStats const& _sectionStats) override;
+
+ void testRunEnded(TestRunStats const& _testRunStats) override;
+
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_REPORTER_COMPACT_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_CONSOLE_HPP_INCLUDED
+#define CATCH_REPORTER_CONSOLE_HPP_INCLUDED
+
+
+namespace Catch {
+ // Fwd decls
+ struct SummaryColumn;
+ class TablePrinter;
+
+ class ConsoleReporter final : public StreamingReporterBase {
+ Detail::unique_ptr<TablePrinter> m_tablePrinter;
+
+ public:
+ ConsoleReporter(ReporterConfig&& config);
+ ~ConsoleReporter() override;
+ static std::string getDescription();
+
+ void noMatchingTestCases( StringRef unmatchedSpec ) override;
+ void reportInvalidTestSpec( StringRef arg ) override;
+
+ void assertionStarting(AssertionInfo const&) override;
+
+ void assertionEnded(AssertionStats const& _assertionStats) override;
+
+ void sectionStarting(SectionInfo const& _sectionInfo) override;
+ void sectionEnded(SectionStats const& _sectionStats) override;
+
+ void benchmarkPreparing( StringRef name ) override;
+ void benchmarkStarting(BenchmarkInfo const& info) override;
+ void benchmarkEnded(BenchmarkStats<> const& stats) override;
+ void benchmarkFailed( StringRef error ) override;
+
+ void testCaseEnded(TestCaseStats const& _testCaseStats) override;
+ void testRunEnded(TestRunStats const& _testRunStats) override;
+ void testRunStarting(TestRunInfo const& _testRunInfo) override;
+
+ private:
+ void lazyPrint();
+
+ void lazyPrintWithoutClosingBenchmarkTable();
+ void lazyPrintRunInfo();
+ void printTestCaseAndSectionHeader();
+
+ void printClosedHeader(std::string const& _name);
+ void printOpenHeader(std::string const& _name);
+
+ // if string has a : in first line will set indent to follow it on
+ // subsequent lines
+ void printHeaderString(std::string const& _string, std::size_t indent = 0);
+
+
+ void printTotals(Totals const& totals);
+ void printSummaryRow(StringRef label, std::vector<SummaryColumn> const& cols, std::size_t row);
+
+ void printTotalsDivider(Totals const& totals);
+ void printSummaryDivider();
+
+ bool m_headerPrinted = false;
+ bool m_testRunInfoPrinted = false;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_REPORTER_CONSOLE_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_CUMULATIVE_BASE_HPP_INCLUDED
+#define CATCH_REPORTER_CUMULATIVE_BASE_HPP_INCLUDED
+
+
+#include <string>
+#include <vector>
+
+namespace Catch {
+
+ namespace Detail {
+
+ //! Represents either an assertion or a benchmark result to be handled by cumulative reporter later
+ class AssertionOrBenchmarkResult {
+ // This should really be a variant, but this is much faster
+ // to write and the data layout here is already terrible
+ // enough that we do not have to care about the object size.
+ Optional<AssertionStats> m_assertion;
+ Optional<BenchmarkStats<>> m_benchmark;
+ public:
+ AssertionOrBenchmarkResult(AssertionStats const& assertion);
+ AssertionOrBenchmarkResult(BenchmarkStats<> const& benchmark);
+
+ bool isAssertion() const;
+ bool isBenchmark() const;
+
+ AssertionStats const& asAssertion() const;
+ BenchmarkStats<> const& asBenchmark() const;
+ };
+ }
+
+ /**
+ * Utility base for reporters that need to handle all results at once
+ *
+ * It stores tree of all test cases, sections and assertions, and after the
+ * test run is finished, calls into `testRunEndedCumulative` to pass the
+ * control to the deriving class.
+ *
+ * If you are deriving from this class and override any testing related
+ * member functions, you should first call into the base's implementation to
+ * avoid breaking the tree construction.
+ *
+ * Due to the way this base functions, it has to expand assertions up-front,
+ * even if they are later unused (e.g. because the deriving reporter does
+ * not report successful assertions, or because the deriving reporter does
+ * not use assertion expansion at all). Derived classes can use two
+ * customization points, `m_shouldStoreSuccesfulAssertions` and
+ * `m_shouldStoreFailedAssertions`, to disable the expansion and gain extra
+ * performance. **Accessing the assertion expansions if it wasn't stored is
+ * UB.**
+ */
+ class CumulativeReporterBase : public ReporterBase {
+ public:
+ template<typename T, typename ChildNodeT>
+ struct Node {
+ explicit Node( T const& _value ) : value( _value ) {}
+
+ using ChildNodes = std::vector<Detail::unique_ptr<ChildNodeT>>;
+ T value;
+ ChildNodes children;
+ };
+ struct SectionNode {
+ explicit SectionNode(SectionStats const& _stats) : stats(_stats) {}
+
+ bool operator == (SectionNode const& other) const {
+ return stats.sectionInfo.lineInfo == other.stats.sectionInfo.lineInfo;
+ }
+
+ bool hasAnyAssertions() const;
+
+ SectionStats stats;
+ std::vector<Detail::unique_ptr<SectionNode>> childSections;
+ std::vector<Detail::AssertionOrBenchmarkResult> assertionsAndBenchmarks;
+ std::string stdOut;
+ std::string stdErr;
+ };
+
+
+ using TestCaseNode = Node<TestCaseStats, SectionNode>;
+ using TestRunNode = Node<TestRunStats, TestCaseNode>;
+
+ // GCC5 compat: we cannot use inherited constructor, because it
+ // doesn't implement backport of P0136
+ CumulativeReporterBase(ReporterConfig&& _config):
+ ReporterBase(CATCH_MOVE(_config))
+ {}
+ ~CumulativeReporterBase() override;
+
+ void benchmarkPreparing( StringRef ) override {}
+ void benchmarkStarting( BenchmarkInfo const& ) override {}
+ void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override;
+ void benchmarkFailed( StringRef ) override {}
+
+ void noMatchingTestCases( StringRef ) override {}
+ void reportInvalidTestSpec( StringRef ) override {}
+ void fatalErrorEncountered( StringRef /*error*/ ) override {}
+
+ void testRunStarting( TestRunInfo const& ) override {}
+
+ void testCaseStarting( TestCaseInfo const& ) override {}
+ void testCasePartialStarting( TestCaseInfo const&, uint64_t ) override {}
+ void sectionStarting( SectionInfo const& sectionInfo ) override;
+
+ void assertionStarting( AssertionInfo const& ) override {}
+
+ void assertionEnded( AssertionStats const& assertionStats ) override;
+ void sectionEnded( SectionStats const& sectionStats ) override;
+ void testCasePartialEnded( TestCaseStats const&, uint64_t ) override {}
+ void testCaseEnded( TestCaseStats const& testCaseStats ) override;
+ void testRunEnded( TestRunStats const& testRunStats ) override;
+ //! Customization point: called after last test finishes (testRunEnded has been handled)
+ virtual void testRunEndedCumulative() = 0;
+
+ void skipTest(TestCaseInfo const&) override {}
+
+ protected:
+ //! Should the cumulative base store the assertion expansion for succesful assertions?
+ bool m_shouldStoreSuccesfulAssertions = true;
+ //! Should the cumulative base store the assertion expansion for failed assertions?
+ bool m_shouldStoreFailedAssertions = true;
+
+ // We need lazy construction here. We should probably refactor it
+ // later, after the events are redone.
+ //! The root node of the test run tree.
+ Detail::unique_ptr<TestRunNode> m_testRun;
+
+ private:
+ // Note: We rely on pointer identity being stable, which is why
+ // we store pointers to the nodes rather than the values.
+ std::vector<Detail::unique_ptr<TestCaseNode>> m_testCases;
+ // Root section of the _current_ test case
+ Detail::unique_ptr<SectionNode> m_rootSection;
+ // Deepest section of the _current_ test case
+ SectionNode* m_deepestSection = nullptr;
+ // Stack of _active_ sections in the _current_ test case
+ std::vector<SectionNode*> m_sectionStack;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_REPORTER_CUMULATIVE_BASE_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_EVENT_LISTENER_HPP_INCLUDED
+#define CATCH_REPORTER_EVENT_LISTENER_HPP_INCLUDED
+
+
+namespace Catch {
+
+ /**
+ * Base class to simplify implementing listeners.
+ *
+ * Provides empty default implementation for all IEventListener member
+ * functions, so that a listener implementation can pick which
+ * member functions it actually cares about.
+ */
+ class EventListenerBase : public IEventListener {
+ public:
+ using IEventListener::IEventListener;
+
+ void reportInvalidTestSpec( StringRef unmatchedSpec ) override;
+ void fatalErrorEncountered( StringRef error ) override;
+
+ void benchmarkPreparing( StringRef name ) override;
+ void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override;
+ void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override;
+ void benchmarkFailed( StringRef error ) override;
+
+ void assertionStarting( AssertionInfo const& assertionInfo ) override;
+ void assertionEnded( AssertionStats const& assertionStats ) override;
+
+ void listReporters(
+ std::vector<ReporterDescription> const& descriptions ) override;
+ void listListeners(
+ std::vector<ListenerDescription> const& descriptions ) override;
+ void listTests( std::vector<TestCaseHandle> const& tests ) override;
+ void listTags( std::vector<TagInfo> const& tagInfos ) override;
+
+ void noMatchingTestCases( StringRef unmatchedSpec ) override;
+ void testRunStarting( TestRunInfo const& testRunInfo ) override;
+ void testCaseStarting( TestCaseInfo const& testInfo ) override;
+ void testCasePartialStarting( TestCaseInfo const& testInfo,
+ uint64_t partNumber ) override;
+ void sectionStarting( SectionInfo const& sectionInfo ) override;
+ void sectionEnded( SectionStats const& sectionStats ) override;
+ void testCasePartialEnded( TestCaseStats const& testCaseStats,
+ uint64_t partNumber ) override;
+ void testCaseEnded( TestCaseStats const& testCaseStats ) override;
+ void testRunEnded( TestRunStats const& testRunStats ) override;
+ void skipTest( TestCaseInfo const& testInfo ) override;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_REPORTER_EVENT_LISTENER_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_HELPERS_HPP_INCLUDED
+#define CATCH_REPORTER_HELPERS_HPP_INCLUDED
+
+#include <iosfwd>
+#include <string>
+#include <vector>
+
+
+namespace Catch {
+
+ class IConfig;
+ class TestCaseHandle;
+ class ColourImpl;
+
+ // Returns double formatted as %.3f (format expected on output)
+ std::string getFormattedDuration( double duration );
+
+ //! Should the reporter show duration of test given current configuration?
+ bool shouldShowDuration( IConfig const& config, double duration );
+
+ std::string serializeFilters( std::vector<std::string> const& filters );
+
+ struct lineOfChars {
+ char c;
+ constexpr lineOfChars( char c_ ): c( c_ ) {}
+
+ friend std::ostream& operator<<( std::ostream& out, lineOfChars value );
+ };
+
+ /**
+ * Lists reporter descriptions to the provided stream in user-friendly
+ * format
+ *
+ * Used as the default listing implementation by the first party reporter
+ * bases. The output should be backwards compatible with the output of
+ * Catch2 v2 binaries.
+ */
+ void
+ defaultListReporters( std::ostream& out,
+ std::vector<ReporterDescription> const& descriptions,
+ Verbosity verbosity );
+
+ /**
+ * Lists listeners descriptions to the provided stream in user-friendly
+ * format
+ */
+ void defaultListListeners( std::ostream& out,
+ std::vector<ListenerDescription> const& descriptions );
+
+ /**
+ * Lists tag information to the provided stream in user-friendly format
+ *
+ * Used as the default listing implementation by the first party reporter
+ * bases. The output should be backwards compatible with the output of
+ * Catch2 v2 binaries.
+ */
+ void defaultListTags( std::ostream& out, std::vector<TagInfo> const& tags, bool isFiltered );
+
+ /**
+ * Lists test case information to the provided stream in user-friendly
+ * format
+ *
+ * Used as the default listing implementation by the first party reporter
+ * bases. The output is backwards compatible with the output of Catch2
+ * v2 binaries, and also supports the format specific to the old
+ * `--list-test-names-only` option, for people who used it in integrations.
+ */
+ void defaultListTests( std::ostream& out,
+ ColourImpl* streamColour,
+ std::vector<TestCaseHandle> const& tests,
+ bool isFiltered,
+ Verbosity verbosity );
+
+} // end namespace Catch
+
+#endif // CATCH_REPORTER_HELPERS_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_JUNIT_HPP_INCLUDED
+#define CATCH_REPORTER_JUNIT_HPP_INCLUDED
+
+
+
+namespace Catch {
+
+ class JunitReporter final : public CumulativeReporterBase {
+ public:
+ JunitReporter(ReporterConfig&& _config);
+
+ ~JunitReporter() override = default;
+
+ static std::string getDescription();
+
+ void testRunStarting(TestRunInfo const& runInfo) override;
+
+ void testCaseStarting(TestCaseInfo const& testCaseInfo) override;
+ void assertionEnded(AssertionStats const& assertionStats) override;
+
+ void testCaseEnded(TestCaseStats const& testCaseStats) override;
+
+ void testRunEndedCumulative() override;
+
+ private:
+ void writeRun(TestRunNode const& testRunNode, double suiteTime);
+
+ void writeTestCase(TestCaseNode const& testCaseNode);
+
+ void writeSection( std::string const& className,
+ std::string const& rootName,
+ SectionNode const& sectionNode,
+ bool testOkToFail );
+
+ void writeAssertions(SectionNode const& sectionNode);
+ void writeAssertion(AssertionStats const& stats);
+
+ XmlWriter xml;
+ Timer suiteTimer;
+ std::string stdOutForSuite;
+ std::string stdErrForSuite;
+ unsigned int unexpectedExceptions = 0;
+ bool m_okToFail = false;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_REPORTER_JUNIT_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_MULTI_HPP_INCLUDED
+#define CATCH_REPORTER_MULTI_HPP_INCLUDED
+
+
+namespace Catch {
+
+ class MultiReporter final : public IEventListener {
+ /*
+ * Stores all added reporters and listeners
+ *
+ * All Listeners are stored before all reporters, and individual
+ * listeners/reporters are stored in order of insertion.
+ */
+ std::vector<IEventListenerPtr> m_reporterLikes;
+ bool m_haveNoncapturingReporters = false;
+
+ // Keep track of how many listeners we have already inserted,
+ // so that we can insert them into the main vector at the right place
+ size_t m_insertedListeners = 0;
+
+ void updatePreferences(IEventListener const& reporterish);
+
+ public:
+ using IEventListener::IEventListener;
+
+ void addListener( IEventListenerPtr&& listener );
+ void addReporter( IEventListenerPtr&& reporter );
+
+ public: // IEventListener
+
+ void noMatchingTestCases( StringRef unmatchedSpec ) override;
+ void fatalErrorEncountered( StringRef error ) override;
+ void reportInvalidTestSpec( StringRef arg ) override;
+
+ void benchmarkPreparing( StringRef name ) override;
+ void benchmarkStarting( BenchmarkInfo const& benchmarkInfo ) override;
+ void benchmarkEnded( BenchmarkStats<> const& benchmarkStats ) override;
+ void benchmarkFailed( StringRef error ) override;
+
+ void testRunStarting( TestRunInfo const& testRunInfo ) override;
+ void testCaseStarting( TestCaseInfo const& testInfo ) override;
+ void testCasePartialStarting(TestCaseInfo const& testInfo, uint64_t partNumber) override;
+ void sectionStarting( SectionInfo const& sectionInfo ) override;
+ void assertionStarting( AssertionInfo const& assertionInfo ) override;
+
+ void assertionEnded( AssertionStats const& assertionStats ) override;
+ void sectionEnded( SectionStats const& sectionStats ) override;
+ void testCasePartialEnded(TestCaseStats const& testInfo, uint64_t partNumber) override;
+ void testCaseEnded( TestCaseStats const& testCaseStats ) override;
+ void testRunEnded( TestRunStats const& testRunStats ) override;
+
+ void skipTest( TestCaseInfo const& testInfo ) override;
+
+ void listReporters(std::vector<ReporterDescription> const& descriptions) override;
+ void listListeners(std::vector<ListenerDescription> const& descriptions) override;
+ void listTests(std::vector<TestCaseHandle> const& tests) override;
+ void listTags(std::vector<TagInfo> const& tags) override;
+
+
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_REPORTER_MULTI_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_REGISTRARS_HPP_INCLUDED
+#define CATCH_REPORTER_REGISTRARS_HPP_INCLUDED
+
+
+#include <type_traits>
+
+namespace Catch {
+
+ namespace Detail {
+
+ template <typename T, typename = void>
+ struct has_description : std::false_type {};
+
+ template <typename T>
+ struct has_description<
+ T,
+ void_t<decltype( T::getDescription() )>>
+ : std::true_type {};
+
+ //! Indirection for reporter registration, so that the error handling is
+ //! independent on the reporter's concrete type
+ void registerReporterImpl( std::string const& name,
+ IReporterFactoryPtr reporterPtr );
+
+ } // namespace Detail
+
+ class IEventListener;
+ using IEventListenerPtr = Detail::unique_ptr<IEventListener>;
+
+ template <typename T>
+ class ReporterFactory : public IReporterFactory {
+
+ IEventListenerPtr create( ReporterConfig&& config ) const override {
+ return Detail::make_unique<T>( CATCH_MOVE(config) );
+ }
+
+ std::string getDescription() const override {
+ return T::getDescription();
+ }
+ };
+
+
+ template<typename T>
+ class ReporterRegistrar {
+ public:
+ explicit ReporterRegistrar( std::string const& name ) {
+ registerReporterImpl( name,
+ Detail::make_unique<ReporterFactory<T>>() );
+ }
+ };
+
+ template<typename T>
+ class ListenerRegistrar {
+
+ class TypedListenerFactory : public EventListenerFactory {
+ StringRef m_listenerName;
+
+ std::string getDescriptionImpl( std::true_type ) const {
+ return T::getDescription();
+ }
+
+ std::string getDescriptionImpl( std::false_type ) const {
+ return "(No description provided)";
+ }
+
+ public:
+ TypedListenerFactory( StringRef listenerName ):
+ m_listenerName( listenerName ) {}
+
+ IEventListenerPtr create( IConfig const* config ) const override {
+ return Detail::make_unique<T>( config );
+ }
+
+ StringRef getName() const override {
+ return m_listenerName;
+ }
+
+ std::string getDescription() const override {
+ return getDescriptionImpl( Detail::has_description<T>{} );
+ }
+ };
+
+ public:
+ ListenerRegistrar(StringRef listenerName) {
+ getMutableRegistryHub().registerListener( Detail::make_unique<TypedListenerFactory>(listenerName) );
+ }
+ };
+}
+
+#if !defined(CATCH_CONFIG_DISABLE)
+
+# define CATCH_REGISTER_REPORTER( name, reporterType ) \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ namespace { \
+ Catch::ReporterRegistrar<reporterType> INTERNAL_CATCH_UNIQUE_NAME( \
+ catch_internal_RegistrarFor )( name ); \
+ } \
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
+
+# define CATCH_REGISTER_LISTENER( listenerType ) \
+ CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
+ CATCH_INTERNAL_SUPPRESS_GLOBALS_WARNINGS \
+ namespace { \
+ Catch::ListenerRegistrar<listenerType> INTERNAL_CATCH_UNIQUE_NAME( \
+ catch_internal_RegistrarFor )( #listenerType ); \
+ } \
+ CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION
+
+#else // CATCH_CONFIG_DISABLE
+
+#define CATCH_REGISTER_REPORTER(name, reporterType)
+#define CATCH_REGISTER_LISTENER(listenerType)
+
+#endif // CATCH_CONFIG_DISABLE
+
+#endif // CATCH_REPORTER_REGISTRARS_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_SONARQUBE_HPP_INCLUDED
+#define CATCH_REPORTER_SONARQUBE_HPP_INCLUDED
+
+
+
+namespace Catch {
+
+ class SonarQubeReporter final : public CumulativeReporterBase {
+ public:
+ SonarQubeReporter(ReporterConfig&& config)
+ : CumulativeReporterBase(CATCH_MOVE(config))
+ , xml(m_stream) {
+ m_preferences.shouldRedirectStdOut = true;
+ m_preferences.shouldReportAllAssertions = true;
+ m_shouldStoreSuccesfulAssertions = false;
+ }
+
+ ~SonarQubeReporter() override = default;
+
+ static std::string getDescription() {
+ using namespace std::string_literals;
+ return "Reports test results in the Generic Test Data SonarQube XML format"s;
+ }
+
+ void testRunStarting( TestRunInfo const& testRunInfo ) override;
+
+ void testRunEndedCumulative() override {
+ writeRun( *m_testRun );
+ xml.endElement();
+ }
+
+ void writeRun( TestRunNode const& groupNode );
+
+ void writeTestFile(std::string const& filename, std::vector<TestCaseNode const*> const& testCaseNodes);
+
+ void writeTestCase(TestCaseNode const& testCaseNode);
+
+ void writeSection(std::string const& rootName, SectionNode const& sectionNode, bool okToFail);
+
+ void writeAssertions(SectionNode const& sectionNode, bool okToFail);
+
+ void writeAssertion(AssertionStats const& stats, bool okToFail);
+
+ private:
+ XmlWriter xml;
+ };
+
+
+} // end namespace Catch
+
+#endif // CATCH_REPORTER_SONARQUBE_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_TAP_HPP_INCLUDED
+#define CATCH_REPORTER_TAP_HPP_INCLUDED
+
+
+namespace Catch {
+
+ class TAPReporter final : public StreamingReporterBase {
+ public:
+ TAPReporter( ReporterConfig&& config ):
+ StreamingReporterBase( CATCH_MOVE(config) ) {
+ m_preferences.shouldReportAllAssertions = true;
+ }
+ ~TAPReporter() override = default;
+
+ static std::string getDescription() {
+ using namespace std::string_literals;
+ return "Reports test results in TAP format, suitable for test harnesses"s;
+ }
+
+ void testRunStarting( TestRunInfo const& testInfo ) override;
+
+ void noMatchingTestCases( StringRef unmatchedSpec ) override;
+
+ void assertionEnded(AssertionStats const& _assertionStats) override;
+
+ void testRunEnded(TestRunStats const& _testRunStats) override;
+
+ private:
+ std::size_t counter = 0;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_REPORTER_TAP_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_TEAMCITY_HPP_INCLUDED
+#define CATCH_REPORTER_TEAMCITY_HPP_INCLUDED
+
+
+#include <cstring>
+
+#ifdef __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wpadded"
+#endif
+
+namespace Catch {
+
+ class TeamCityReporter final : public StreamingReporterBase {
+ public:
+ TeamCityReporter( ReporterConfig&& _config )
+ : StreamingReporterBase( CATCH_MOVE(_config) )
+ {
+ m_preferences.shouldRedirectStdOut = true;
+ }
+
+ ~TeamCityReporter() override;
+
+ static std::string getDescription() {
+ using namespace std::string_literals;
+ return "Reports test results as TeamCity service messages"s;
+ }
+
+ void testRunStarting( TestRunInfo const& groupInfo ) override;
+ void testRunEnded( TestRunStats const& testGroupStats ) override;
+
+
+ void assertionEnded(AssertionStats const& assertionStats) override;
+
+ void sectionStarting(SectionInfo const& sectionInfo) override {
+ m_headerPrintedForThisSection = false;
+ StreamingReporterBase::sectionStarting( sectionInfo );
+ }
+
+ void testCaseStarting(TestCaseInfo const& testInfo) override;
+
+ void testCaseEnded(TestCaseStats const& testCaseStats) override;
+
+ private:
+ void printSectionHeader(std::ostream& os);
+
+ bool m_headerPrintedForThisSection = false;
+ Timer m_testTimer;
+ };
+
+} // end namespace Catch
+
+#ifdef __clang__
+# pragma clang diagnostic pop
+#endif
+
+#endif // CATCH_REPORTER_TEAMCITY_HPP_INCLUDED
+
+
+#ifndef CATCH_REPORTER_XML_HPP_INCLUDED
+#define CATCH_REPORTER_XML_HPP_INCLUDED
+
+
+
+
+namespace Catch {
+ class XmlReporter : public StreamingReporterBase {
+ public:
+ XmlReporter(ReporterConfig&& _config);
+
+ ~XmlReporter() override;
+
+ static std::string getDescription();
+
+ virtual std::string getStylesheetRef() const;
+
+ void writeSourceInfo(SourceLineInfo const& sourceInfo);
+
+ public: // StreamingReporterBase
+
+ void testRunStarting(TestRunInfo const& testInfo) override;
+
+ void testCaseStarting(TestCaseInfo const& testInfo) override;
+
+ void sectionStarting(SectionInfo const& sectionInfo) override;
+
+ void assertionStarting(AssertionInfo const&) override;
+
+ void assertionEnded(AssertionStats const& assertionStats) override;
+
+ void sectionEnded(SectionStats const& sectionStats) override;
+
+ void testCaseEnded(TestCaseStats const& testCaseStats) override;
+
+ void testRunEnded(TestRunStats const& testRunStats) override;
+
+ void benchmarkPreparing( StringRef name ) override;
+ void benchmarkStarting(BenchmarkInfo const&) override;
+ void benchmarkEnded(BenchmarkStats<> const&) override;
+ void benchmarkFailed( StringRef error ) override;
+
+ void listReporters(std::vector<ReporterDescription> const& descriptions) override;
+ void listListeners(std::vector<ListenerDescription> const& descriptions) override;
+ void listTests(std::vector<TestCaseHandle> const& tests) override;
+ void listTags(std::vector<TagInfo> const& tags) override;
+
+ private:
+ Timer m_testCaseTimer;
+ XmlWriter m_xml;
+ int m_sectionDepth = 0;
+ };
+
+} // end namespace Catch
+
+#endif // CATCH_REPORTER_XML_HPP_INCLUDED
+
+#endif // CATCH_REPORTERS_ALL_HPP_INCLUDED
+
+#endif // CATCH_ALL_HPP_INCLUDED
+#endif // CATCH_AMALGAMATED_HPP_INCLUDED
diff --git a/3rdparty/bx/LICENSE b/3rdparty/bx/LICENSE
index 9fbd22dcba1..e21e5d5f338 100644
--- a/3rdparty/bx/LICENSE
+++ b/3rdparty/bx/LICENSE
@@ -1,4 +1,4 @@
-Copyright 2010-2021 Branimir Karadzic
+Copyright 2010-2022 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/3rdparty/bx/README.md b/3rdparty/bx/README.md
index 16d74f16ac5..849b7ee1c74 100644
--- a/3rdparty/bx/README.md
+++ b/3rdparty/bx/README.md
@@ -22,7 +22,7 @@ https://github.com/bkaradzic/bx
<img align="right" src="http://opensource.org/trademarks/opensource/OSI-Approved-License-100x137.png">
</a>
- Copyright 2010-2021 Branimir Karadzic
+ Copyright 2010-2022 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/3rdparty/bx/include/bx/allocator.h b/3rdparty/bx/include/bx/allocator.h
index 94d7835da8a..925441ee5ec 100644
--- a/3rdparty/bx/include/bx/allocator.h
+++ b/3rdparty/bx/include/bx/allocator.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_ALLOCATOR_H_HEADER_GUARD
@@ -31,9 +31,14 @@
#define BX_NEW(_allocator, _type) BX_PLACEMENT_NEW(BX_ALLOC(_allocator, sizeof(_type) ), _type)
#define BX_ALIGNED_NEW(_allocator, _type, _align) BX_PLACEMENT_NEW(BX_ALIGNED_ALLOC(_allocator, sizeof(_type), _align), _type)
-#define BX_PLACEMENT_NEW(_ptr, _type) ::new(bx::PlacementNewTag(), _ptr) _type
+#define BX_PLACEMENT_NEW(_ptr, _type) ::new(bx::PlacementNew, _ptr) _type
-namespace bx { struct PlacementNewTag {}; }
+namespace bx
+{
+ struct PlacementNewTag {};
+ constexpr PlacementNewTag PlacementNew;
+
+} // namespace bx
void* operator new(size_t, bx::PlacementNewTag, void* _ptr);
void operator delete(void*, bx::PlacementNewTag, void*) throw();
@@ -47,13 +52,20 @@ namespace bx
///
virtual ~AllocatorI() = 0;
- /// Allocates, resizes memory block, or frees memory.
+ /// Allocates, resizes, or frees memory block.
///
- /// @param[in] _ptr If _ptr is NULL new block will be allocated.
+ /// @remark
+ /// - Allocate memory block: _ptr == NULL && size > 0
+ /// - Resize memory block: _ptr != NULL && size > 0
+ /// - Free memory block: _ptr != NULL && size == 0
+ ///
+ /// @param[in] _ptr If _ptr is NULL new block will be allocated. If _ptr is not-NULL, and
+ /// _size is not 0, memory block will be resized.
/// @param[in] _size If _ptr is set, and _size is 0, memory will be freed.
/// @param[in] _align Alignment.
/// @param[in] _file Debug file path info.
/// @param[in] _line Debug file line info.
+ ///
virtual void* realloc(
void* _ptr
, size_t _size
@@ -83,9 +95,6 @@ namespace bx
) override;
};
- /// Check if pointer is aligned. _align must be power of two.
- bool isAligned(const void* _ptr, size_t _align);
-
/// Aligns pointer to nearest next aligned address. _align must be power of two.
void* alignPtr(
void* _ptr
diff --git a/3rdparty/bx/include/bx/bounds.h b/3rdparty/bx/include/bx/bounds.h
new file mode 100644
index 00000000000..12201b45f92
--- /dev/null
+++ b/3rdparty/bx/include/bx/bounds.h
@@ -0,0 +1,526 @@
+/*
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#ifndef BX_BOUNDS_H_HEADER_GUARD
+#define BX_BOUNDS_H_HEADER_GUARD
+
+#include <bx/math.h>
+
+namespace bx
+{
+ ///
+ struct Line
+ {
+ Vec3 pos = init::None;
+ Vec3 dir = init::None;
+ };
+
+ ///
+ struct LineSegment
+ {
+ Vec3 pos = init::None;
+ Vec3 end = init::None;
+ };
+
+ ///
+ struct Aabb
+ {
+ Vec3 min = init::None;
+ Vec3 max = init::None;
+ };
+
+ ///
+ struct Capsule
+ {
+ Vec3 pos = init::None;
+ Vec3 end = init::None;
+ float radius;
+ };
+
+ ///
+ struct Cone
+ {
+ Vec3 pos = init::None;
+ Vec3 end = init::None;
+ float radius;
+ };
+
+ ///
+ struct Cylinder
+ {
+ Vec3 pos = init::None;
+ Vec3 end = init::None;
+ float radius;
+ };
+
+ ///
+ struct Disk
+ {
+ Vec3 center = init::None;
+ Vec3 normal = init::None;
+ float radius;
+ };
+
+ ///
+ struct Obb
+ {
+ float mtx[16];
+ };
+
+ ///
+ struct Sphere
+ {
+ Vec3 center = init::None;
+ float radius;
+ };
+
+ ///
+ struct Triangle
+ {
+ Vec3 v0 = init::None;
+ Vec3 v1 = init::None;
+ Vec3 v2 = init::None;
+ };
+
+ ///
+ struct Ray
+ {
+ Vec3 pos = init::None;
+ Vec3 dir = init::None;
+ };
+
+ ///
+ struct Hit
+ {
+ Vec3 pos = init::None;
+ Plane plane = init::None;
+ };
+
+ ///
+ struct Interval
+ {
+ ///
+ Interval(float _val);
+
+ ///
+ Interval(float _min, float _max);
+
+ ///
+ void set(float _val);
+
+ ///
+ void setCenter(float _val);
+
+ ///
+ void expand(float _val);
+
+ float min;
+ float max;
+ };
+
+ ///
+ Vec3 getPointAt(const Ray& _ray, float _t);
+
+ ///
+ Vec3 getPointAt(const Line& _line, float _t);
+
+ ///
+ Vec3 getPointAt(const LineSegment& _line, float _t);
+
+ ///
+ Vec3 getCenter(const Aabb& _aabb);
+
+ ///
+ Vec3 getExtents(const Aabb& _aabb);
+
+ ///
+ Vec3 getCenter(const Triangle& _triangle);
+
+ ///
+ void toAabb(Aabb& _outAabb, const Vec3& _extents);
+
+ ///
+ void toAabb(Aabb& _outAabb, const Vec3& _center, const Vec3& _extents);
+
+ /// Convert cylinder to axis aligned bounding box.
+ void toAabb(Aabb& _outAabb, const Cylinder& _cylinder);
+
+ /// Convert disk to axis aligned bounding box.
+ void toAabb(Aabb& _outAabb, const Disk& _disk);
+
+ /// Convert oriented bounding box to axis aligned bounding box.
+ void toAabb(Aabb& _outAabb, const Obb& _obb);
+
+ /// Convert sphere to axis aligned bounding box.
+ void toAabb(Aabb& _outAabb, const Sphere& _sphere);
+
+ /// Convert triangle to axis aligned bounding box.
+ void toAabb(Aabb& _outAabb, const Triangle& _triangle);
+
+ /// Calculate axis aligned bounding box.
+ void toAabb(Aabb& _outAabb, const void* _vertices, uint32_t _numVertices, uint32_t _stride);
+
+ /// Transform vertices and calculate axis aligned bounding box.
+ void toAabb(Aabb& _outAabb, const float* _mtx, const void* _vertices, uint32_t _numVertices, uint32_t _stride);
+
+ /// Expand AABB.
+ void aabbExpand(Aabb& _outAabb, float _factor);
+
+ /// Expand AABB with xyz.
+ void aabbExpand(Aabb& _outAabb, const Vec3& _pos);
+
+ /// Calculate surface area of axis aligned bounding box.
+ float calcAreaAabb(const Aabb& _aabb);
+
+ /// Convert axis aligned bounding box to oriented bounding box.
+ void toObb(Obb& _outObb, const Aabb& _aabb);
+
+ /// Calculate oriented bounding box.
+ void calcObb(Obb& _outObb, const void* _vertices, uint32_t _numVertices, uint32_t _stride, uint32_t _steps = 17);
+
+ /// Calculate maximum bounding sphere.
+ void calcMaxBoundingSphere(Sphere& _outSphere, const void* _vertices, uint32_t _numVertices, uint32_t _stride);
+
+ /// Calculate minimum bounding sphere.
+ void calcMinBoundingSphere(Sphere& _outSphere, const void* _vertices, uint32_t _numVertices, uint32_t _stride, float _step = 0.01f);
+
+ /// Returns 6 (near, far, left, right, top, bottom) planes representing frustum planes.
+ void buildFrustumPlanes(Plane* _outPlanes, const float* _viewProj);
+
+ /// Returns point from 3 intersecting planes.
+ Vec3 intersectPlanes(const Plane& _pa, const Plane& _pb, const Plane& _pc);
+
+ /// Make screen space ray from x, y coordinate and inverse view-projection matrix.
+ Ray makeRay(float _x, float _y, const float* _invVp);
+
+ /// Intersect ray / AABB.
+ bool intersect(const Ray& _ray, const Aabb& _aabb, Hit* _hit = NULL);
+
+ /// Intersect ray / OBB.
+ bool intersect(const Ray& _ray, const Obb& _obb, Hit* _hit = NULL);
+
+ /// Intersect ray / cylinder.
+ bool intersect(const Ray& _ray, const Cylinder& _cylinder, Hit* _hit = NULL);
+
+ /// Intersect ray / capsule.
+ bool intersect(const Ray& _ray, const Capsule& _capsule, Hit* _hit = NULL);
+
+ /// Intersect ray / cone.
+ bool intersect(const Ray& _ray, const Cone& _cone, Hit* _hit = NULL);
+
+ /// Intersect ray / disk.
+ bool intersect(const Ray& _ray, const Disk& _disk, Hit* _hit = NULL);
+
+ /// Intersect ray / plane.
+ bool intersect(const Ray& _ray, const Plane& _plane, Hit* _hit = NULL);
+
+ /// Intersect ray / plane.
+ bool intersect(const Ray& _ray, const Plane& _plane, bool _doublesided, Hit* _hit = NULL);
+
+ /// Intersect ray / sphere.
+ bool intersect(const Ray& _ray, const Sphere& _sphere, Hit* _hit = NULL);
+
+ /// Intersect ray / triangle.
+ bool intersect(const Ray& _ray, const Triangle& _triangle, Hit* _hit = NULL);
+
+ ///
+ Vec3 closestPoint(const Line& _line, const Vec3& _point);
+
+ ///
+ Vec3 closestPoint(const LineSegment& _line, const Vec3& _point);
+
+ ///
+ Vec3 closestPoint(const Plane& _plane, const Vec3& _point);
+
+ ///
+ Vec3 closestPoint(const Aabb& _aabb, const Vec3& _point);
+
+ ///
+ Vec3 closestPoint(const Obb& _obb, const Vec3& _point);
+
+ ///
+ Vec3 closestPoint(const Triangle& _triangle, const Vec3& _point);
+
+ ///
+ bool overlap(const Interval& _interval, float _pos);
+
+ ///
+ bool overlap(const Interval& _intervalA, const Interval& _intervalB);
+
+ ///
+ bool overlap(const Aabb& _aabb, const Vec3& _pos);
+
+ ///
+ bool overlap(const Aabb& _aabb, const Sphere& _sphere);
+
+ ///
+ bool overlap(const Aabb& _aabbA, const Aabb& _aabbB);
+
+ ///
+ bool overlap(const Aabb& _aabb, const Plane& _plane);
+
+ ///
+ bool overlap(const Aabb& _aabb, const Triangle& _triangle);
+
+ ///
+ bool overlap(const Aabb& _aabb, const Cylinder& _cylinder);
+
+ ///
+ bool overlap(const Aabb& _aabb, const Capsule& _capsule);
+
+ ///
+ bool overlap(const Aabb& _aabb, const Cone& _cone);
+
+ ///
+ bool overlap(const Aabb& _aabb, const Disk& _disk);
+
+ ///
+ bool overlap(const Aabb& _aabb, const Obb& _obb);
+
+ ///
+ bool overlap(const Capsule& _capsule, const Vec3& _pos);
+
+ ///
+ bool overlap(const Capsule& _capsule, const Sphere& _sphere);
+
+ ///
+ bool overlap(const Capsule& _capsule, const Aabb& _aabb);
+
+ ///
+ bool overlap(const Capsule& _capsule, const Plane& _plane);
+
+ ///
+ bool overlap(const Capsule& _capsule, const Triangle& _triangle);
+
+ ///
+ bool overlap(const Capsule& _capsule, const Cylinder& _cylinder);
+
+ ///
+ bool overlap(const Capsule& _capsuleA, const Capsule& _capsuleB);
+
+ ///
+ bool overlap(const Capsule& _capsule, const Cone& _cone);
+
+ ///
+ bool overlap(const Capsule& _capsule, const Disk& _disk);
+
+ ///
+ bool overlap(const Capsule& _capsule, const Obb& _obb);
+
+ ///
+ bool overlap(const Cone& _cone, const Vec3& _pos);
+
+ ///
+ bool overlap(const Cone& _cone, const Sphere& _sphere);
+
+ ///
+ bool overlap(const Cone& _cone, const Aabb& _aabb);
+
+ ///
+ bool overlap(const Cone& _cone, const Plane& _plane);
+
+ ///
+ bool overlap(const Cone& _cone, const Triangle& _triangle);
+
+ ///
+ bool overlap(const Cone& _cone, const Cylinder& _cylinder);
+
+ ///
+ bool overlap(const Cone& _cone, const Capsule& _capsule);
+
+ ///
+ bool overlap(const Cone& _coneA, const Cone& _coneB);
+
+ ///
+ bool overlap(const Cone& _cone, const Disk& _disk);
+
+ ///
+ bool overlap(const Cone& _cone, const Obb& _obb);
+
+ ///
+ bool overlap(const Cylinder& _cylinder, const Vec3& _pos);
+
+ ///
+ bool overlap(const Cylinder& _cylinder, const Sphere& _sphere);
+
+ ///
+ bool overlap(const Cylinder& _cylinder, const Aabb& _aabb);
+
+ ///
+ bool overlap(const Cylinder& _cylinder, const Plane& _plane);
+
+ ///
+ bool overlap(const Cylinder& _cylinder, const Triangle& _triangle);
+
+ ///
+ bool overlap(const Cylinder& _cylinderA, const Cylinder& _cylinderB);
+
+ ///
+ bool overlap(const Cylinder& _cylinder, const Capsule& _capsule);
+
+ ///
+ bool overlap(const Cylinder& _cylinder, const Cone& _cone);
+
+ ///
+ bool overlap(const Cylinder& _cylinder, const Disk& _disk);
+
+ ///
+ bool overlap(const Cylinder& _cylinder, const Obb& _obb);
+
+ ///
+ bool overlap(const Disk& _disk, const Vec3& _pos);
+
+ ///
+ bool overlap(const Disk& _disk, const Sphere& _sphere);
+
+ ///
+ bool overlap(const Disk& _disk, const Aabb& _aabb);
+
+ ///
+ bool overlap(const Disk& _disk, const Plane& _plane);
+
+ ///
+ bool overlap(const Disk& _disk, const Triangle& _triangle);
+
+ ///
+ bool overlap(const Disk& _disk, const Cylinder& _cylinder);
+
+ ///
+ bool overlap(const Disk& _disk, const Capsule& _capsule);
+
+ ///
+ bool overlap(const Disk& _disk, const Cone& _cone);
+
+ ///
+ bool overlap(const Disk& _diskA, const Disk& _diskB);
+
+ ///
+ bool overlap(const Disk& _disk, const Obb& _obb);
+
+ ///
+ bool overlap(const Obb& _obb, const Vec3& _pos);
+
+ ///
+ bool overlap(const Obb& _obb, const Sphere& _sphere);
+
+ ///
+ bool overlap(const Obb& _obb, const Aabb& _aabb);
+
+ ///
+ bool overlap(const Obb& _obb, const Plane& _plane);
+
+ ///
+ bool overlap(const Obb& _obb, const Triangle& _triangle);
+
+ ///
+ bool overlap(const Obb& _obb, const Cylinder& _cylinder);
+
+ ///
+ bool overlap(const Obb& _obb, const Capsule& _capsule);
+
+ ///
+ bool overlap(const Obb& _obb, const Cone& _cone);
+
+ ///
+ bool overlap(const Obb& _obb, const Disk& _disk);
+
+ ///
+ bool overlap(const Obb& _obbA, const Obb& _obbB);
+
+ ///
+ bool overlap(const Plane& _plane, const Vec3& _pos);
+
+ ///
+ bool overlap(const Plane& _plane, const Sphere& _sphere);
+
+ ///
+ bool overlap(const Plane& _plane, const Aabb& _aabb);
+
+ ///
+ bool overlap(const Plane& _planeA, const Plane& _planeB);
+
+ ///
+ bool overlap(const Plane& _plane, const Triangle& _triangle);
+
+ ///
+ bool overlap(const Plane& _plane, const Cylinder& _cylinder);
+
+ ///
+ bool overlap(const Plane& _plane, const Capsule& _capsule);
+
+ ///
+ bool overlap(const Plane& _plane, const Cone& _cone);
+
+ ///
+ bool overlap(const Plane& _plane, const Disk& _disk);
+
+ ///
+ bool overlap(const Plane& _plane, const Obb& _obb);
+
+ ///
+ bool overlap(const Sphere& _sphere, const Vec3& _pos);
+
+ ///
+ bool overlap(const Sphere& _sphereA, const Sphere& _sphereB);
+
+ ///
+ bool overlap(const Sphere& _sphere, const Aabb& _aabb);
+
+ ///
+ bool overlap(const Sphere& _sphere, const Plane& _plane);
+
+ ///
+ bool overlap(const Sphere& _sphere, const Triangle& _triangle);
+
+ ///
+ bool overlap(const Sphere& _sphere, const Cylinder& _cylinder);
+
+ ///
+ bool overlap(const Sphere& _sphere, const Capsule& _capsule);
+
+ ///
+ bool overlap(const Sphere& _sphere, const Cone& _cone);
+
+ ///
+ bool overlap(const Sphere& _sphere, const Disk& _disk);
+
+ ///
+ bool overlap(const Sphere& _sphere, const Obb& _obb);
+
+ ///
+ bool overlap(const Triangle& _triangle, const Vec3& _pos);
+
+ ///
+ bool overlap(const Triangle& _triangle, const Sphere& _sphere);
+
+ ///
+ bool overlap(const Triangle& _triangle, const Aabb& _aabb);
+
+ ///
+ bool overlap(const Triangle& _triangle, const Plane& _plane);
+
+ ///
+ bool overlap(const Triangle& _triangleA, const Triangle& _triangleB);
+
+ ///
+ bool overlap(const Triangle& _triangle, const Cylinder& _cylinder);
+
+ ///
+ bool overlap(const Triangle& _triangle, const Capsule& _capsule);
+
+ ///
+ bool overlap(const Triangle& _triangle, const Cone& _cone);
+
+ ///
+ bool overlap(const Triangle& _triangle, const Disk& _disk);
+
+ ///
+ bool overlap(const Triangle& _triangle, const Obb& _obb);
+
+} // namespace bx
+
+#include "inline/bounds.inl"
+
+#endif // BX_BOUNDS_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/bx.h b/3rdparty/bx/include/bx/bx.h
index 36f40aab493..fb032a57fc6 100644
--- a/3rdparty/bx/include/bx/bx.h
+++ b/3rdparty/bx/include/bx/bx.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_H_HEADER_GUARD
@@ -14,12 +14,19 @@
#include "platform.h"
#include "config.h"
+#include "constants.h"
#include "macros.h"
+#include "debug.h"
+#include "typetraits.h"
///
#define BX_COUNTOF(_x) sizeof(bx::CountOfRequireArrayArgumentT(_x) )
///
+#define BX_OFFSETOF(_type, _member) \
+ (reinterpret_cast<ptrdiff_t>(&(reinterpret_cast<_type*>(16)->_member) )-ptrdiff_t(16) )
+
+///
#if BX_COMPILER_MSVC
# define BX_IGNORE_C4127(_x) bx::ignoreC4127(!!(_x) )
#else
@@ -31,17 +38,38 @@
namespace bx
{
- constexpr int32_t kExitSuccess = 0;
- constexpr int32_t kExitFailure = 1;
-
- ///
- template<class Ty>
- constexpr bool isTriviallyCopyable();
+ /// Arithmetic type `Ty` limits.
+ template<typename Ty, bool SignT = isSigned<Ty>()>
+ struct LimitsT;
/// Find the address of an object of a class that has an overloaded unary ampersand (&) operator.
- template <class Ty>
+ template<typename Ty>
Ty* addressOf(Ty& _a);
+ /// Find the address of an object of a class that has an overloaded unary ampersand (&) operator.
+ template<typename Ty>
+ const Ty* addressOf(const Ty& _a);
+
+ /// Returns typed pointer from typeless pointer offseted.
+ ///
+ /// @param[in] _ptr Pointer to get offset from.
+ /// @param[in] _offsetInBytes Offset from pointer in bytes.
+ ///
+ /// @returns Typed pointer from typeless pointer offseted.
+ ///
+ template<typename Ty>
+ Ty* addressOf(void* _ptr, ptrdiff_t _offsetInBytes = 0);
+
+ /// Returns typed pointer from typeless pointer offseted.
+ ///
+ /// @param[in] _ptr Pointer to get offset from.
+ /// @param[in] _offsetInBytes Offset from pointer in bytes.
+ ///
+ /// @returns Typed pointer from typeless pointer offseted.
+ ///
+ template<typename Ty>
+ const Ty* addressOf(const void* _ptr, ptrdiff_t _offsetInBytes = 0);
+
/// Swap two values.
template<typename Ty>
void swap(Ty& _a, Ty& _b);
@@ -49,31 +77,39 @@ namespace bx
/// Swap memory.
void swap(void* _a, void* _b, size_t _numBytes);
- /// Returns minimum of two values.
+ /// Returns numeric minimum of type.
template<typename Ty>
- constexpr Ty min(const Ty& _a, const Ty& _b);
+ constexpr Ty min();
- /// Returns maximum of two values.
+ /// Returns numeric maximum of type.
template<typename Ty>
- constexpr Ty max(const Ty& _a, const Ty& _b);
+ constexpr Ty max();
- /// Returns minimum of three values.
+ /// Returns minimum of two values.
template<typename Ty>
- constexpr Ty min(const Ty& _a, const Ty& _b, const Ty& _c);
+ constexpr Ty min(const Ty& _a, const TypeIdentityType<Ty>& _b);
- /// Returns maximum of three values.
+ /// Returns maximum of two values.
template<typename Ty>
- constexpr Ty max(const Ty& _a, const Ty& _b, const Ty& _c);
+ constexpr Ty max(const Ty& _a, const TypeIdentityType<Ty>& _b);
- /// Returns middle of three values.
- template<typename Ty>
- constexpr Ty mid(const Ty& _a, const Ty& _b, const Ty& _c);
+ /// Returns minimum of three or more values.
+ template<typename Ty, typename... Args>
+ constexpr Ty min(const Ty& _a, const TypeIdentityType<Ty>& _b, const Args&... _args);
+
+ /// Returns maximum of three or more values.
+ template<typename Ty, typename... Args>
+ constexpr Ty max(const Ty& _a, const TypeIdentityType<Ty>& _b, const Args&... _args);
+
+ /// Returns middle of three or more values.
+ template<typename Ty, typename... Args>
+ constexpr Ty mid(const Ty& _a, const TypeIdentityType<Ty>& _b, const Args&... _args);
/// Returns clamped value between min/max.
template<typename Ty>
- constexpr Ty clamp(const Ty& _a, const Ty& _min, const Ty& _max);
+ constexpr Ty clamp(const Ty& _a, const TypeIdentityType<Ty>& _min, const TypeIdentityType<Ty>& _max);
- /// Returns true if value is power of 2.
+ /// Returns true if value `_a` is power of 2.
template<typename Ty>
constexpr bool isPowerOf2(Ty _a);
@@ -94,7 +130,7 @@ namespace bx
/// @param _src Source pointer.
/// @param _srcStride Source stride.
/// @param _stride Number of bytes per stride to copy.
- /// @param _num Number of strides.
+ /// @param _numStrides Number of strides.
///
/// @remark Source and destination memory blocks must not overlap.
///
@@ -104,12 +140,31 @@ namespace bx
, const void* _src
, uint32_t _srcStride
, uint32_t _stride
- , uint32_t _num
+ , uint32_t _numStrides
);
+ /// Copy memory block.
+ ///
+ /// @param _dst Destination pointer.
+ /// @param _src Source pointer.
+ /// @param _numBytes Number of bytes to copy.
+ ///
+ /// @remark If source and destination memory blocks overlap memory will be copied in reverse
+ /// order.
///
void memMove(void* _dst, const void* _src, size_t _numBytes);
+ /// Copy strided memory block.
+ ///
+ /// @param _dst Destination pointer.
+ /// @param _dstStride Destination stride.
+ /// @param _src Source pointer.
+ /// @param _srcStride Source stride.
+ /// @param _stride Number of bytes per stride to copy.
+ /// @param _numStrides Number of strides.
+ ///
+ /// @remark If source and destination memory blocks overlap memory will be copied in reverse
+ /// order.
///
void memMove(
void* _dst
@@ -117,34 +172,73 @@ namespace bx
, const void* _src
, uint32_t _srcStride
, uint32_t _stride
- , uint32_t _num
+ , uint32_t _numStrides
);
+ /// Fill memory block to specified value `_ch`.
+ ///
+ /// @param _dst Destination pointer.
+ /// @param _ch Fill value.
+ /// @param _numBytes Number of bytes to copy.
///
void memSet(void* _dst, uint8_t _ch, size_t _numBytes);
+ /// Fill strided memory block to specified value `_ch`.
+ ///
+ /// @param _dst Destination pointer.
+ /// @param _dstStride Destination stride.
+ /// @param _ch Fill value.
+ /// @param _stride Number of bytes per stride to copy.
+ /// @param _numStrides Number of strides.
///
- void memSet(void* _dst, uint32_t _dstStride, uint8_t _ch, uint32_t _stride, uint32_t _num);
+ void memSet(
+ void* _dst
+ , uint32_t _dstStride
+ , uint8_t _ch
+ , uint32_t _stride
+ , uint32_t _numStrides
+ );
+ /// Compare two memory blocks.
+ ///
+ /// @param _lhs Pointer to memory block.
+ /// @param _rhs Pointer to memory block.
+ /// @param _numBytes Number of bytes to compare.
+ ///
+ /// @returns 0 if two blocks are identical, positive value if first different byte in `_lhs` is
+ /// greater than corresponding byte in `_rhs`.
///
int32_t memCmp(const void* _lhs, const void* _rhs, size_t _numBytes);
+ /// Gather data scattered through memory into linear memory block.
+ ///
+ /// @param _dst Destination pointer.
+ /// @param _src Source pointer.
+ /// @param _stride Number of bytes per stride to copy.
+ /// @param _numStrides Number of strides.
///
void gather(
void* _dst
, const void* _src
, uint32_t _srcStride
, uint32_t _stride
- , uint32_t _num
+ , uint32_t _numStrides
);
+ /// Scatter data from linear memory block through memory.
+ ///
+ /// @param _dst Destination pointer.
+ /// @param _dstStride Destination stride.
+ /// @param _src Source pointer.
+ /// @param _stride Number of bytes per stride to copy.
+ /// @param _numStrides Number of strides.
///
void scatter(
void* _dst
, uint32_t _dstStride
, const void* _src
, uint32_t _stride
- , uint32_t _num
+ , uint32_t _numStrides
);
} // namespace bx
diff --git a/3rdparty/bx/include/bx/commandline.h b/3rdparty/bx/include/bx/commandline.h
index 48815ddccce..10adb88cd58 100644
--- a/3rdparty/bx/include/bx/commandline.h
+++ b/3rdparty/bx/include/bx/commandline.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_COMMANDLINE_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/config.h b/3rdparty/bx/include/bx/config.h
index 9a9670731a8..4e32ccf23b3 100644
--- a/3rdparty/bx/include/bx/config.h
+++ b/3rdparty/bx/include/bx/config.h
@@ -1,16 +1,18 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_CONFIG_H_HEADER_GUARD
#define BX_CONFIG_H_HEADER_GUARD
-#include "bx.h"
+#ifndef BX_CONFIG_DEBUG
+# error "BX_CONFIG_DEBUG must be defined in build script!"
+#endif // BX_CONFIG_DEBUG
#ifndef BX_CONFIG_ALLOCATOR_DEBUG
-# define BX_CONFIG_ALLOCATOR_DEBUG 0
-#endif // BX_CONFIG_DEBUG_ALLOC
+# define BX_CONFIG_ALLOCATOR_DEBUG BX_CONFIG_DEBUG
+#endif // BX_CONFIG_ALLOCATOR_DEBUG
#ifndef BX_CONFIG_SUPPORTS_THREADING
# define BX_CONFIG_SUPPORTS_THREADING !(0 \
diff --git a/3rdparty/bx/include/bx/constants.h b/3rdparty/bx/include/bx/constants.h
new file mode 100644
index 00000000000..14c4cdbb35f
--- /dev/null
+++ b/3rdparty/bx/include/bx/constants.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
+ */
+
+#ifndef BX_CONSTANTS_H_HEADER_GUARD
+#define BX_CONSTANTS_H_HEADER_GUARD
+
+namespace bx
+{
+ /// Used to return successful execution of a program code.
+ constexpr int32_t kExitSuccess = 0;
+
+ /// Used to return unsuccessful execution of a program code.
+ constexpr int32_t kExitFailure = 1;
+
+ /// The ratio of a circle's circumference to its diameter,
+ constexpr float kPi = 3.1415926535897932384626433832795f;
+
+ /// The ratio of a circle's circumference to its radius. Pi multiplied by 2, or Tau. pi*2
+ constexpr float kPi2 = 6.2831853071795864769252867665590f;
+
+ /// The reciprocal of pi. 1/pi
+ constexpr float kInvPi = 1.0f/kPi;
+
+ /// Pi divided by two. pi/2
+ constexpr float kPiHalf = 1.5707963267948966192313216916398f;
+
+ /// Pi divided by four. pi/4
+ constexpr float kPiQuarter = 0.7853981633974483096156608458199f;
+
+ /// The square root of two. sqrt(2)
+ constexpr float kSqrt2 = 1.4142135623730950488016887242097f;
+
+ /// ln(10)
+ constexpr float kLogNat10 = 2.3025850929940456840179914546844f;
+
+ /// The logarithm of the e to base 2. ln(kE) / ln(2)
+ constexpr float kInvLogNat2 = 1.4426950408889634073599246810019f;
+
+ /// The natural logarithm of the 2. ln(2)
+ constexpr float kLogNat2Hi = 0.6931471805599453094172321214582f;
+
+ ///
+ constexpr float kLogNat2Lo = 1.90821492927058770002e-10f;
+
+ /// The base of natural logarithms. e(1)
+ constexpr float kE = 2.7182818284590452353602874713527f;
+
+ ///
+ constexpr float kNearZero = 1.0f/float(1 << 28);
+
+ /// Smallest normalized positive floating-point number.
+ constexpr float kFloatSmallest = 1.175494351e-38f;
+
+ /// Maximum representable floating-point number.
+ constexpr float kFloatLargest = 3.402823466e+38f;
+
+ /// Smallest normalized positive double-precision floating-point number.
+ constexpr double kDoubleSmallest = 2.2250738585072014e-308;
+
+ /// Largest representable double-precision floating-point number.
+ constexpr double kDoubleLargest = 1.7976931348623158e+308;
+
+ ///
+ extern const float kInfinity;
+
+} // namespace bx
+
+#endif // BX_CONSTANTS_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/cpu.h b/3rdparty/bx/include/bx/cpu.h
index 20f6a5fd970..dc3a544bca0 100644
--- a/3rdparty/bx/include/bx/cpu.h
+++ b/3rdparty/bx/include/bx/cpu.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_CPU_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/debug.h b/3rdparty/bx/include/bx/debug.h
index d8cf15e0690..3a0719c32ee 100644
--- a/3rdparty/bx/include/bx/debug.h
+++ b/3rdparty/bx/include/bx/debug.h
@@ -1,15 +1,17 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_DEBUG_H_HEADER_GUARD
#define BX_DEBUG_H_HEADER_GUARD
-#include "string.h"
+#include "bx.h"
namespace bx
{
+ class StringView;
+
///
void debugBreak();
diff --git a/3rdparty/bx/include/bx/easing.h b/3rdparty/bx/include/bx/easing.h
index 3aa44ca0a20..05ee40e788c 100644
--- a/3rdparty/bx/include/bx/easing.h
+++ b/3rdparty/bx/include/bx/easing.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_EASING_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/endian.h b/3rdparty/bx/include/bx/endian.h
index 9eeb0ef19e5..559e4bab453 100644
--- a/3rdparty/bx/include/bx/endian.h
+++ b/3rdparty/bx/include/bx/endian.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_ENDIAN_H_HEADER_GUARD
@@ -28,13 +28,13 @@ namespace bx
///
uint64_t endianSwap(uint64_t _in);
- /// Input argument is encoded as little endian, convert it if neccessary
- /// depending on host CPU endianess.
+ /// Input argument is encoded as little endian, convert it if necessary
+ /// depending on host CPU endianness.
template <typename Ty>
Ty toLittleEndian(const Ty _in);
- /// Input argument is encoded as big endian, convert it if neccessary
- /// depending on host CPU endianess.
+ /// Input argument is encoded as big endian, convert it if necessary
+ /// depending on host CPU endianness.
template <typename Ty>
Ty toBigEndian(const Ty _in);
diff --git a/3rdparty/bx/include/bx/error.h b/3rdparty/bx/include/bx/error.h
index d00d8af4b48..a44a3a8d8cb 100644
--- a/3rdparty/bx/include/bx/error.h
+++ b/3rdparty/bx/include/bx/error.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_ERROR_H_HEADER_GUARD
@@ -38,7 +38,6 @@ namespace bx
{
BX_CLASS(Error
, NO_COPY
- , NO_ASSIGNMENT
);
public:
@@ -71,12 +70,42 @@ namespace bx
uint32_t m_code;
};
+ /// Do nothing even if error is set.
+ class ErrorIgnore : public Error
+ {
+ public:
+ ///
+ operator Error*();
+ };
+
+ /// In debug build assert if error is set.
+ class ErrorAssert : public Error
+ {
+ public:
+ ///
+ ~ErrorAssert();
+
+ ///
+ operator Error*();
+ };
+
+ /// Exit application if error is set.
+ class ErrorFatal : public Error
+ {
+ public:
+ ///
+ ~ErrorFatal();
+
+ ///
+ operator Error*();
+ };
+
///
class ErrorScope
{
BX_CLASS(ErrorScope
+ , NO_DEFAULT_CTOR
, NO_COPY
- , NO_ASSIGNMENT
);
public:
diff --git a/3rdparty/bx/include/bx/file.h b/3rdparty/bx/include/bx/file.h
index e692224131c..88def0e0054 100644
--- a/3rdparty/bx/include/bx/file.h
+++ b/3rdparty/bx/include/bx/file.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_FILE_H_HEADER_GUARD
@@ -124,19 +124,19 @@ namespace bx
/// Creates a directory named `_filePath`.
///
- bool make(const FilePath& _filePath, Error* _err = NULL);
+ bool make(const FilePath& _filePath, Error* _err = bx::ErrorIgnore{});
/// Creates a directory named `_filePath` along with all necessary parents.
///
- bool makeAll(const FilePath& _filePath, Error* _err = NULL);
+ bool makeAll(const FilePath& _filePath, Error* _err = bx::ErrorIgnore{});
/// Removes file or directory.
///
- bool remove(const FilePath& _filePath, Error* _err = NULL);
+ bool remove(const FilePath& _filePath, Error* _err = bx::ErrorIgnore{});
- /// Removes file or directory recursivelly.
+ /// Removes file or directory recursively.
///
- bool removeAll(const FilePath& _filePath, Error* _err = NULL);
+ bool removeAll(const FilePath& _filePath, Error* _err = bx::ErrorIgnore{});
} // namespace bx
diff --git a/3rdparty/bx/include/bx/filepath.h b/3rdparty/bx/include/bx/filepath.h
index 3de0ce0d4fc..464799e2166 100644
--- a/3rdparty/bx/include/bx/filepath.h
+++ b/3rdparty/bx/include/bx/filepath.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_FILEPATH_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/float4x4_t.h b/3rdparty/bx/include/bx/float4x4_t.h
index 893029cc290..54bc492aece 100644
--- a/3rdparty/bx/include/bx/float4x4_t.h
+++ b/3rdparty/bx/include/bx/float4x4_t.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_FLOAT4X4_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/handlealloc.h b/3rdparty/bx/include/bx/handlealloc.h
index 92a9d8671ed..f7335e452ca 100644
--- a/3rdparty/bx/include/bx/handlealloc.h
+++ b/3rdparty/bx/include/bx/handlealloc.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_HANDLE_ALLOC_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/hash.h b/3rdparty/bx/include/bx/hash.h
index 42d76e1a681..cb6fe18764f 100644
--- a/3rdparty/bx/include/bx/hash.h
+++ b/3rdparty/bx/include/bx/hash.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_HASH_H_HEADER_GUARD
@@ -11,95 +11,99 @@
namespace bx
{
- /// MurmurHash2 was written by Austin Appleby, and is placed in the public
- /// domain. The author hereby disclaims copyright to this source code.
- ///
- class HashMurmur2A
+ /// 32-bit Adler checksum hash.
+ class HashAdler32
{
public:
///
- void begin(uint32_t _seed = 0);
+ void begin();
+
+ ///
+ void add(const void* _data, int32_t _len);
+
+ ///
+ void add(const char* _data);
///
- void add(const void* _data, int _len);
+ void add(const StringView& _data);
///
template<typename Ty>
- void add(Ty _value);
+ void add(const Ty& _data);
///
uint32_t end();
private:
- ///
- void addAligned(const void* _data, int _len);
+ uint32_t m_a;
+ uint32_t m_b;
+ };
- ///
- void addUnaligned(const void* _data, int _len);
+ /// 32-bit cyclic redundancy checksum hash.
+ class HashCrc32
+ {
+ public:
+ enum Enum
+ {
+ Ieee, //!< 0xedb88320
+ Castagnoli, //!< 0x82f63b78
+ Koopman, //!< 0xeb31d82e
- ///
- static void readUnaligned(const void* _data, uint32_t& _out);
+ Count
+ };
///
- void mixTail(const uint8_t*& _data, int& _len);
+ void begin(Enum _type = Ieee);
- uint32_t m_hash;
- uint32_t m_tail;
- uint32_t m_count;
- uint32_t m_size;
- };
+ ///
+ void add(const void* _data, int32_t _len);
- ///
- class HashAdler32
- {
- public:
///
- void begin();
+ void add(const char* _data);
///
- void add(const void* _data, int _len);
+ void add(const StringView& _data);
///
template<typename Ty>
- void add(Ty _value);
+ void add(const Ty& _data);
///
uint32_t end();
private:
- uint32_t m_a;
- uint32_t m_b;
+ const uint32_t* m_table;
+ uint32_t m_hash;
};
- ///
- class HashCrc32
+ /// 32-bit multiply and rotate hash.
+ class HashMurmur2A
{
public:
- enum Enum
- {
- Ieee, //!< 0xedb88320
- Castagnoli, //!< 0x82f63b78
- Koopman, //!< 0xeb31d82e
+ ///
+ void begin(uint32_t _seed = 0);
- Count
- };
+ ///
+ void add(const void* _data, int32_t _len);
///
- void begin(Enum _type = Ieee);
+ void add(const char* _data);
///
- void add(const void* _data, int _len);
+ void add(const StringView& _data);
///
template<typename Ty>
- void add(Ty _value);
+ void add(const Ty& _data);
///
uint32_t end();
private:
- const uint32_t* m_table;
uint32_t m_hash;
+ uint32_t m_tail;
+ uint32_t m_count;
+ uint32_t m_size;
};
///
@@ -107,16 +111,16 @@ namespace bx
uint32_t hash(const void* _data, uint32_t _size);
///
- template<typename HashT, typename Ty>
- uint32_t hash(const Ty& _data);
+ template<typename HashT>
+ uint32_t hash(const char* _data);
///
template<typename HashT>
uint32_t hash(const StringView& _data);
///
- template<typename HashT>
- uint32_t hash(const char* _data);
+ template<typename HashT, typename Ty>
+ uint32_t hash(const Ty& _data);
} // namespace bx
diff --git a/3rdparty/bx/include/bx/inline/allocator.inl b/3rdparty/bx/include/bx/inline/allocator.inl
index 8e5085fa4a7..82788d1fedd 100644
--- a/3rdparty/bx/include/bx/inline/allocator.inl
+++ b/3rdparty/bx/include/bx/inline/allocator.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_ALLOCATOR_H_HEADER_GUARD
@@ -49,7 +49,7 @@ namespace bx
inline void* alignedAlloc(AllocatorI* _allocator, size_t _size, size_t _align, const char* _file, uint32_t _line)
{
- const size_t align = max(_align, sizeof(uint32_t) );;
+ const size_t align = max(_align, sizeof(uint32_t) );
const size_t total = _size + align;
uint8_t* ptr = (uint8_t*)alloc(_allocator, total, 0, _file, _line);
uint8_t* aligned = (uint8_t*)alignPtr(ptr, sizeof(uint32_t), align);
diff --git a/3rdparty/bx/include/bx/inline/bounds.inl b/3rdparty/bx/include/bx/inline/bounds.inl
new file mode 100644
index 00000000000..1ecc59a8f18
--- /dev/null
+++ b/3rdparty/bx/include/bx/inline/bounds.inl
@@ -0,0 +1,257 @@
+/*
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#ifndef BX_BOUNDS_H_HEADER_GUARD
+# error "Must be included from bounds.h!"
+#endif // BX_BOUNDS_H_HEADER_GUARD
+
+namespace bx
+{
+ inline Interval::Interval(float _val)
+ : min(_val)
+ , max(_val)
+ {
+ }
+
+ inline Interval::Interval(float _min, float _max)
+ : min(_min)
+ , max(_max)
+ {
+ }
+
+ inline void Interval::set(float _val)
+ {
+ min = _val;
+ max = _val;
+ }
+
+ inline void Interval::setCenter(float _val)
+ {
+ const float extents = (max - min) * 0.5f;
+ min = _val - extents;
+ max = _val + extents;
+ }
+
+ inline void Interval::expand(float _val)
+ {
+ min = bx::min(min, _val);
+ max = bx::max(max, _val);
+ }
+
+ inline Vec3 getPointAt(const Ray& _ray, float _t)
+ {
+ return mad(_ray.dir, _t, _ray.pos);
+ }
+
+ inline Vec3 getPointAt(const Line& _line, float _t)
+ {
+ return mad(_line.dir, _t, _line.pos);
+ }
+
+ inline Vec3 getPointAt(const LineSegment& _line, float _t)
+ {
+ return lerp(_line.pos, _line.end, _t);
+ }
+
+ inline bool intersect(const Ray& _ray, const Plane& _plane, Hit* _hit)
+ {
+ return intersect(_ray, _plane, false, _hit);
+ }
+
+ inline bool overlap(const Interval& _interval, float _t)
+ {
+ return _t > _interval.min
+ && _t < _interval.max
+ ;
+ }
+
+ inline bool overlap(const Interval& _intervalA, const Interval& _intervalB)
+ {
+ return _intervalA.max > _intervalB.min
+ && _intervalB.max > _intervalA.min
+ ;
+ }
+
+ inline bool overlap(const Aabb& _aabb, const Sphere& _sphere)
+ {
+ return overlap(_sphere, _aabb);
+ }
+
+ inline bool overlap(const Aabb& _aabb, const Cylinder& _cylinder)
+ {
+ return overlap(_cylinder, _aabb);
+ }
+
+ inline bool overlap(const Capsule& _capsule, const Sphere& _sphere)
+ {
+ return overlap(_sphere, _capsule);
+ }
+
+ inline bool overlap(const Capsule& _capsule, const Aabb& _aabb)
+ {
+ return overlap(_aabb, _capsule);
+ }
+
+ inline bool overlap(const Capsule& _capsule, const Triangle& _triangle)
+ {
+ return overlap(_triangle, _capsule);
+ }
+
+ inline bool overlap(const Capsule& _capsule, const Cone& _cone)
+ {
+ return overlap(_cone, _capsule);
+ }
+
+ inline bool overlap(const Capsule& _capsule, const Cylinder& _cylinder)
+ {
+ return overlap(_cylinder, _capsule);
+ }
+
+ inline bool overlap(const Capsule& _capsule, const Disk& _disk)
+ {
+ return overlap(_disk, _capsule);
+ }
+
+ inline bool overlap(const Capsule& _capsule, const Obb& _obb)
+ {
+ return overlap(_obb, _capsule);
+ }
+
+ inline bool overlap(const Cone& _cone, const Sphere& _sphere)
+ {
+ return overlap(_sphere, _cone);
+ }
+
+ inline bool overlap(const Cone& _cone, const Aabb& _aabb)
+ {
+ return overlap(_aabb, _cone);
+ }
+
+ inline bool overlap(const Cone& _cone, const Plane& _plane)
+ {
+ return overlap(_plane, _cone);
+ }
+
+ inline bool overlap(const Cone& _cone, const Triangle& _triangle)
+ {
+ return overlap(_triangle, _cone);
+ }
+
+ inline bool overlap(const Cylinder& _cylinder, const Triangle& _triangle)
+ {
+ return overlap(_triangle, _cylinder);
+ }
+
+ inline bool overlap(const Cylinder& _cylinder, const Cone& _cone)
+ {
+ return overlap(_cone, _cylinder);
+ }
+
+ inline bool overlap(const Disk& _disk, const Sphere& _sphere)
+ {
+ return overlap(_sphere, _disk);
+ }
+
+ inline bool overlap(const Disk& _disk, const Aabb& _aabb)
+ {
+ return overlap(_aabb, _disk);
+ }
+
+ inline bool overlap(const Disk& _disk, const Triangle& _triangle)
+ {
+ return overlap(_triangle, _disk);
+ }
+
+ inline bool overlap(const Disk& _disk, const Cylinder& _cylinder)
+ {
+ return overlap(_cylinder, _disk);
+ }
+
+ inline bool overlap(const Disk& _disk, const Cone& _cone)
+ {
+ return overlap(_cone, _disk);
+ }
+
+ inline bool overlap(const Obb& _obb, const Sphere& _sphere)
+ {
+ return overlap(_sphere, _obb);
+ }
+
+ inline bool overlap(const Obb& _obb, const Aabb& _aabb)
+ {
+ return overlap(_aabb, _obb);
+ }
+
+ inline bool overlap(const Obb& _obb, const Triangle& _triangle)
+ {
+ return overlap(_triangle, _obb);
+ }
+
+ inline bool overlap(const Obb& _obb, const Cylinder& _cylinder)
+ {
+ return overlap(_cylinder, _obb);
+ }
+
+ inline bool overlap(const Obb& _obb, const Cone& _cone)
+ {
+ return overlap(_cone, _obb);
+ }
+
+ inline bool overlap(const Obb& _obb, const Disk& _disk)
+ {
+ return overlap(_disk, _obb);
+ }
+
+ inline bool overlap(const Plane& _plane, const Sphere& _sphere)
+ {
+ return overlap(_sphere, _plane);
+ }
+
+ inline bool overlap(const Plane& _plane, const Aabb& _aabb)
+ {
+ return overlap(_aabb, _plane);
+ }
+
+ inline bool overlap(const Plane& _plane, const Triangle& _triangle)
+ {
+ return overlap(_triangle, _plane);
+ }
+
+ inline bool overlap(const Plane& _plane, const Cylinder& _cylinder)
+ {
+ return overlap(_cylinder, _plane);
+ }
+
+ inline bool overlap(const Plane& _plane, const Capsule& _capsule)
+ {
+ return overlap(_capsule, _plane);
+ }
+
+ inline bool overlap(const Plane& _plane, const Disk& _disk)
+ {
+ return overlap(_disk, _plane);
+ }
+
+ inline bool overlap(const Plane& _plane, const Obb& _obb)
+ {
+ return overlap(_obb, _plane);
+ }
+
+ inline bool overlap(const Sphere& _sphere, const Cylinder& _cylinder)
+ {
+ return overlap(_cylinder, _sphere);
+ }
+
+ inline bool overlap(const Triangle& _triangle, const Sphere& _sphere)
+ {
+ return overlap(_sphere, _triangle);
+ }
+
+ inline bool overlap(const Triangle& _triangle, const Aabb& _aabb)
+ {
+ return overlap(_aabb, _triangle);
+ }
+
+} // namespace bx
diff --git a/3rdparty/bx/include/bx/inline/bx.inl b/3rdparty/bx/include/bx/inline/bx.inl
index fc527ec79ce..3c651854281 100644
--- a/3rdparty/bx/include/bx/inline/bx.inl
+++ b/3rdparty/bx/include/bx/inline/bx.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_H_HEADER_GUARD
@@ -12,8 +12,8 @@ namespace bx
// Reference(S):
// - https://web.archive.org/web/20181115035420/http://cnicholson.net/2011/01/stupid-c-tricks-a-better-sizeof_array/
//
- template<typename Ty, size_t Num>
- char(&CountOfRequireArrayArgumentT(const Ty(&)[Num]))[Num];
+ template<typename Ty, size_t NumT>
+ char (&CountOfRequireArrayArgumentT(const Ty (&)[NumT]) )[NumT];
template<bool B>
struct isEnabled
@@ -27,16 +27,20 @@ namespace bx
return _x;
}
- template<class Ty>
- inline constexpr bool isTriviallyCopyable()
+ template<typename Ty>
+ inline Ty* addressOf(Ty& _a)
{
- return __is_trivially_copyable(Ty);
+ return reinterpret_cast<Ty*>(
+ &const_cast<char&>(
+ reinterpret_cast<const volatile char&>(_a)
+ )
+ );
}
- template<class Ty>
- inline Ty* addressOf(Ty& _a)
+ template<typename Ty>
+ inline const Ty* addressOf(const Ty& _a)
{
- return reinterpret_cast<Ty*>(
+ return reinterpret_cast<const Ty*>(
&const_cast<char&>(
reinterpret_cast<const volatile char&>(_a)
)
@@ -44,43 +48,95 @@ namespace bx
}
template<typename Ty>
- inline void swap(Ty& _a, Ty& _b)
+ inline Ty* addressOf(void* _ptr, ptrdiff_t _offsetInBytes)
{
- Ty tmp = _a; _a = _b; _b = tmp;
+ return (Ty*)( (uint8_t*)_ptr + _offsetInBytes);
}
template<typename Ty>
- inline constexpr Ty min(const Ty& _a, const Ty& _b)
+ inline const Ty* addressOf(const void* _ptr, ptrdiff_t _offsetInBytes)
{
- return _a < _b ? _a : _b;
+ return (const Ty*)( (const uint8_t*)_ptr + _offsetInBytes);
}
template<typename Ty>
- inline constexpr Ty max(const Ty& _a, const Ty& _b)
+ inline void swap(Ty& _a, Ty& _b)
{
- return _a > _b ? _a : _b;
+ Ty tmp = move(_a); _a = move(_b); _b = move(tmp);
}
template<typename Ty>
- inline constexpr Ty min(const Ty& _a, const Ty& _b, const Ty& _c)
+ struct LimitsT<Ty, true>
{
- return min(min(_a, _b), _c);
+ static constexpr Ty max = ( ( (Ty(1) << ( (sizeof(Ty) * 8) - 2) ) - Ty(1) ) << 1) | Ty(1);
+ static constexpr Ty min = -max - Ty(1);
+ };
+
+ template<typename Ty>
+ struct LimitsT<Ty, false>
+ {
+ static constexpr Ty min = 0;
+ static constexpr Ty max = Ty(-1);
+ };
+
+ template<>
+ struct LimitsT<float, true>
+ {
+ static constexpr float min = -kFloatLargest;
+ static constexpr float max = kFloatLargest;
+ };
+
+ template<>
+ struct LimitsT<double, true>
+ {
+ static constexpr double min = -kDoubleLargest;
+ static constexpr double max = kDoubleLargest;
+ };
+
+ template<typename Ty>
+ inline constexpr Ty max()
+ {
+ return bx::LimitsT<Ty>::max;
}
template<typename Ty>
- inline constexpr Ty max(const Ty& _a, const Ty& _b, const Ty& _c)
+ inline constexpr Ty min()
{
- return max(max(_a, _b), _c);
+ return bx::LimitsT<Ty>::min;
+ }
+
+ template<typename Ty>
+ inline constexpr Ty min(const Ty& _a, const TypeIdentityType<Ty>& _b)
+ {
+ return _a < _b ? _a : _b;
}
template<typename Ty>
- inline constexpr Ty mid(const Ty& _a, const Ty& _b, const Ty& _c)
+ inline constexpr Ty max(const Ty& _a, const TypeIdentityType<Ty>& _b)
+ {
+ return _a > _b ? _a : _b;
+ }
+
+ template<typename Ty, typename... Args>
+ inline constexpr Ty min(const Ty& _a, const TypeIdentityType<Ty>& _b, const Args&... _args)
+ {
+ return min(min(_a, _b), _args...);
+ }
+
+ template<typename Ty, typename... Args>
+ inline constexpr Ty max(const Ty& _a, const TypeIdentityType<Ty>& _b, const Args&... _args)
+ {
+ return max(max(_a, _b), _args...);
+ }
+
+ template<typename Ty, typename... Args>
+ inline constexpr Ty mid(const Ty& _a, const TypeIdentityType<Ty>& _b, const Args&... _args)
{
- return max(min(_a, _b), min(max(_a, _b), _c) );
+ return max(min(_a, _b), min(max(_a, _b), _args...) );
}
template<typename Ty>
- inline constexpr Ty clamp(const Ty& _a, const Ty& _min, const Ty& _max)
+ inline constexpr Ty clamp(const Ty& _a, const TypeIdentityType<Ty>& _min, const TypeIdentityType<Ty>& _max)
{
return max(min(_a, _max), _min);
}
diff --git a/3rdparty/bx/include/bx/inline/cpu.inl b/3rdparty/bx/include/bx/inline/cpu.inl
index f02fc177175..756aa175682 100644
--- a/3rdparty/bx/include/bx/inline/cpu.inl
+++ b/3rdparty/bx/include/bx/inline/cpu.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_CPU_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/easing.inl b/3rdparty/bx/include/bx/inline/easing.inl
index 18bbe943091..c484337a776 100644
--- a/3rdparty/bx/include/bx/inline/easing.inl
+++ b/3rdparty/bx/include/bx/inline/easing.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_EASING_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/endian.inl b/3rdparty/bx/include/bx/inline/endian.inl
index de0f7abf945..eef5e08e7c2 100644
--- a/3rdparty/bx/include/bx/inline/endian.inl
+++ b/3rdparty/bx/include/bx/inline/endian.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_ENDIAN_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/error.inl b/3rdparty/bx/include/bx/inline/error.inl
index 382c624990a..1379a6cb950 100644
--- a/3rdparty/bx/include/bx/inline/error.inl
+++ b/3rdparty/bx/include/bx/inline/error.inl
@@ -1,12 +1,14 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_ERROR_H_HEADER_GUARD
# error "Must be included from bx/error!"
#endif // BX_ERROR_H_HEADER_GUARD
+#include <bx/debug.h>
+
namespace bx
{
inline Error::Error()
@@ -59,10 +61,47 @@ namespace bx
return _rhs.code != m_code;
}
+ inline ErrorIgnore::operator Error*()
+ {
+ return this;
+ }
+
+ inline ErrorAssert::~ErrorAssert()
+ {
+ BX_ASSERT(isOk(), "Error: 0x%08x `%S`"
+ , get().code
+ , &getMessage()
+ );
+ }
+
+ inline ErrorFatal::operator Error*()
+ {
+ return this;
+ }
+
+ inline ErrorFatal::~ErrorFatal()
+ {
+ if (!isOk() )
+ {
+ printf("Error: 0x%08x `%S`"
+ , get().code
+ , &getMessage()
+ );
+
+ exit(kExitFailure);
+ }
+ }
+
+ inline ErrorAssert::operator Error*()
+ {
+ return this;
+ }
+
inline ErrorScope::ErrorScope(Error* _err, const StringView& _name)
: m_err(_err)
, m_name(_name)
{
+ BX_UNUSED(m_err);
BX_ASSERT(NULL != _err, "_err can't be NULL");
}
@@ -70,20 +109,17 @@ namespace bx
{
if (m_name.isEmpty() )
{
- BX_ASSERT(m_err->isOk(), "Error: 0x%08x `%.*s`"
+ BX_ASSERT(m_err->isOk(), "Error: 0x%08x `%S`"
, m_err->get().code
- , m_err->getMessage().getLength()
- , m_err->getMessage().getPtr()
+ , &m_err->getMessage()
);
}
else
{
- BX_ASSERT(m_err->isOk(), "Error: %.*s - 0x%08x `%.*s`"
- , m_name.getLength()
- , m_name.getPtr()
+ BX_ASSERT(m_err->isOk(), "Error: %S - 0x%08x `%S`"
+ , &m_name
, m_err->get().code
- , m_err->getMessage().getLength()
- , m_err->getMessage().getPtr()
+ , &m_err->getMessage()
);
}
}
diff --git a/3rdparty/bx/include/bx/inline/float4x4_t.inl b/3rdparty/bx/include/bx/inline/float4x4_t.inl
index 6a3bfb6d90a..3860d033ecb 100644
--- a/3rdparty/bx/include/bx/inline/float4x4_t.inl
+++ b/3rdparty/bx/include/bx/inline/float4x4_t.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_FLOAT4X4_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/handlealloc.inl b/3rdparty/bx/include/bx/inline/handlealloc.inl
index 4579e05ba43..7051692587b 100644
--- a/3rdparty/bx/include/bx/inline/handlealloc.inl
+++ b/3rdparty/bx/include/bx/inline/handlealloc.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_HANDLE_ALLOC_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/hash.inl b/3rdparty/bx/include/bx/inline/hash.inl
index 6b2ebcc8de0..bad8ba0b5e1 100644
--- a/3rdparty/bx/include/bx/inline/hash.inl
+++ b/3rdparty/bx/include/bx/inline/hash.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_HASH_H_HEADER_GUARD
@@ -9,171 +9,89 @@
namespace bx
{
-#define MURMUR_M 0x5bd1e995
-#define MURMUR_R 24
-#define mmix(_h, _k) { _k *= MURMUR_M; _k ^= _k >> MURMUR_R; _k *= MURMUR_M; _h *= MURMUR_M; _h ^= _k; }
-
- inline void HashMurmur2A::begin(uint32_t _seed)
+ inline void HashAdler32::begin()
{
- m_hash = _seed;
- m_tail = 0;
- m_count = 0;
- m_size = 0;
+ m_a = 1;
+ m_b = 0;
}
- inline void HashMurmur2A::add(const void* _data, int _len)
+ inline void HashAdler32::add(const void* _data, int32_t _len)
{
- if (BX_UNLIKELY(!isAligned(_data, 4) ) )
- {
- addUnaligned(_data, _len);
- return;
- }
-
- addAligned(_data, _len);
- }
+ constexpr uint32_t kModAdler = 65521;
- inline void HashMurmur2A::addAligned(const void* _data, int _len)
- {
const uint8_t* data = (const uint8_t*)_data;
- m_size += _len;
-
- mixTail(data, _len);
-
- while(_len >= 4)
+ for (; _len != 0; --_len)
{
- uint32_t kk = *(uint32_t*)data;
-
- mmix(m_hash, kk);
-
- data += 4;
- _len -= 4;
+ m_a = (m_a + *data++) % kModAdler;
+ m_b = (m_b + m_a ) % kModAdler;
}
-
- mixTail(data, _len);
}
- inline void HashMurmur2A::addUnaligned(const void* _data, int _len)
+ inline void HashAdler32::add(const char* _data)
{
- const uint8_t* data = (const uint8_t*)_data;
- m_size += _len;
-
- mixTail(data, _len);
-
- while(_len >= 4)
- {
- uint32_t kk;
- readUnaligned(data, kk);
-
- mmix(m_hash, kk);
-
- data += 4;
- _len -= 4;
- }
+ return add(StringView(_data) );
+ }
- mixTail(data, _len);
+ inline void HashAdler32::add(const StringView& _data)
+ {
+ return add(_data.getPtr(), _data.getLength() );
}
template<typename Ty>
- inline void HashMurmur2A::add(Ty _value)
+ inline void HashAdler32::add(const Ty& _data)
{
- add(&_value, sizeof(Ty) );
+ add(&_data, sizeof(Ty) );
}
- inline uint32_t HashMurmur2A::end()
+ inline uint32_t HashAdler32::end()
{
- mmix(m_hash, m_tail);
- mmix(m_hash, m_size);
-
- m_hash ^= m_hash >> 13;
- m_hash *= MURMUR_M;
- m_hash ^= m_hash >> 15;
-
- return m_hash;
+ return m_a | (m_b<<16);
}
- inline void HashMurmur2A::readUnaligned(const void* _data, uint32_t& _out)
+ inline void HashCrc32::add(const char* _data)
{
- const uint8_t* data = (const uint8_t*)_data;
- if (BX_ENABLED(BX_CPU_ENDIAN_BIG) )
- {
- _out = 0
- | data[0]<<24
- | data[1]<<16
- | data[2]<<8
- | data[3]
- ;
- }
- else
- {
- _out = 0
- | data[0]
- | data[1]<<8
- | data[2]<<16
- | data[3]<<24
- ;
- }
+ return add(StringView(_data) );
}
- inline void HashMurmur2A::mixTail(const uint8_t*& _data, int& _len)
+ inline void HashCrc32::add(const StringView& _data)
{
- while( _len && ((_len<4) || m_count) )
- {
- m_tail |= (*_data++) << (m_count * 8);
-
- m_count++;
- _len--;
-
- if(m_count == 4)
- {
- mmix(m_hash, m_tail);
- m_tail = 0;
- m_count = 0;
- }
- }
+ return add(_data.getPtr(), _data.getLength() );
}
-#undef MURMUR_M
-#undef MURMUR_R
-#undef mmix
-
- inline void HashAdler32::begin()
+ template<typename Ty>
+ inline void HashCrc32::add(const Ty& _data)
{
- m_a = 1;
- m_b = 0;
+ add(&_data, sizeof(Ty) );
}
- inline void HashAdler32::add(const void* _data, int _len)
+ inline uint32_t HashCrc32::end()
{
- const uint32_t kModAdler = 65521;
- const uint8_t* data = (const uint8_t*)_data;
- for (; _len != 0; --_len)
- {
- m_a = (m_a + *data++) % kModAdler;
- m_b = (m_b + m_a ) % kModAdler;
- }
+ m_hash ^= UINT32_MAX;
+ return m_hash;
}
- template<typename Ty>
- inline void HashAdler32::add(Ty _value)
+ inline void HashMurmur2A::begin(uint32_t _seed)
{
- add(&_value, sizeof(Ty) );
+ m_hash = _seed;
+ m_tail = 0;
+ m_count = 0;
+ m_size = 0;
}
- inline uint32_t HashAdler32::end()
+ inline void HashMurmur2A::add(const char* _data)
{
- return m_a | (m_b<<16);
+ return add(StringView(_data) );
}
- template<typename Ty>
- inline void HashCrc32::add(Ty _value)
+ inline void HashMurmur2A::add(const StringView& _data)
{
- add(&_value, sizeof(Ty) );
+ return add(_data.getPtr(), _data.getLength() );
}
- inline uint32_t HashCrc32::end()
+ template<typename Ty>
+ inline void HashMurmur2A::add(const Ty& _data)
{
- m_hash ^= UINT32_MAX;
- return m_hash;
+ add(&_data, sizeof(Ty) );
}
template<typename HashT>
@@ -181,15 +99,14 @@ namespace bx
{
HashT hh;
hh.begin();
- hh.add(_data, (int)_size);
+ hh.add(_data, (int32_t)_size);
return hh.end();
}
- template<typename HashT, typename Ty>
- inline uint32_t hash(const Ty& _data)
+ template<typename HashT>
+ inline uint32_t hash(const char* _data)
{
- BX_STATIC_ASSERT(isTriviallyCopyable<Ty>() );
- return hash<HashT>(&_data, sizeof(Ty) );
+ return hash<HashT>(StringView(_data) );
}
template<typename HashT>
@@ -198,10 +115,11 @@ namespace bx
return hash<HashT>(_data.getPtr(), _data.getLength() );
}
- template<typename HashT>
- inline uint32_t hash(const char* _data)
+ template<typename HashT, typename Ty>
+ inline uint32_t hash(const Ty& _data)
{
- return hash<HashT>(StringView(_data) );
+ BX_STATIC_ASSERT(isTriviallyCopyable<Ty>() );
+ return hash<HashT>(&_data, sizeof(Ty) );
}
} // namespace bx
diff --git a/3rdparty/bx/include/bx/inline/math.inl b/3rdparty/bx/include/bx/inline/math.inl
index 6699a73bf55..df433fc6e67 100644
--- a/3rdparty/bx/include/bx/inline/math.inl
+++ b/3rdparty/bx/include/bx/inline/math.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
// FPU math lib
@@ -101,12 +101,9 @@ namespace bx
if (_a < 0.0f)
{
const float fr = fract(-_a);
- const float result = -_a - fr;
+ const float tr = trunc(-_a);
- return -(0.0f != fr
- ? result + 1.0f
- : result)
- ;
+ return -tr - float(0.0f != fr);
}
return _a - fract(_a);
@@ -138,7 +135,7 @@ namespace bx
inline BX_CONSTEXPR_FUNC float sign(float _a)
{
- return _a < 0.0f ? -1.0f : 1.0f;
+ return float( (0.0f < _a) - (0.0f > _a) );
}
inline BX_CONSTEXPR_FUNC float abs(float _a)
@@ -316,7 +313,7 @@ namespace bx
return _a - _b * floor(_a / _b);
}
- inline BX_CONSTEXPR_FUNC bool equal(float _a, float _b, float _epsilon)
+ inline BX_CONSTEXPR_FUNC bool isEqual(float _a, float _b, float _epsilon)
{
// Reference(s):
// - Floating-point tolerances revisited
@@ -327,12 +324,12 @@ namespace bx
return lhs <= rhs;
}
- inline BX_CONST_FUNC bool equal(const float* _a, const float* _b, uint32_t _num, float _epsilon)
+ inline BX_CONST_FUNC bool isEqual(const float* _a, const float* _b, uint32_t _num, float _epsilon)
{
- bool result = equal(_a[0], _b[0], _epsilon);
+ bool result = isEqual(_a[0], _b[0], _epsilon);
for (uint32_t ii = 1; result && ii < _num; ++ii)
{
- result = equal(_a[ii], _b[ii], _epsilon);
+ result = isEqual(_a[ii], _b[ii], _epsilon);
}
return result;
}
@@ -409,18 +406,18 @@ namespace bx
memCopy(_ptr, &_a, sizeof(Ty) );
}
- inline Vec3::Vec3(init::NoneType)
+ inline Vec3::Vec3(init::NoneTag)
{
}
- constexpr Vec3::Vec3(init::ZeroType)
+ constexpr Vec3::Vec3(init::ZeroTag)
: x(0.0f)
, y(0.0f)
, z(0.0f)
{
}
- constexpr Vec3::Vec3(init::IdentityType)
+ constexpr Vec3::Vec3(init::IdentityTag)
: x(0.0f)
, y(0.0f)
, z(0.0f)
@@ -441,18 +438,18 @@ namespace bx
{
}
- inline Plane::Plane(init::NoneType)
+ inline Plane::Plane(init::NoneTag)
: normal(init::None)
{
}
- constexpr Plane::Plane(init::ZeroType)
+ constexpr Plane::Plane(init::ZeroTag)
: normal(init::Zero)
, dist(0.0f)
{
}
- constexpr Plane::Plane(init::IdentityType)
+ constexpr Plane::Plane(init::IdentityTag)
: normal(0.0f, 1.0f, 0.0f)
, dist(0.0f)
{
@@ -464,11 +461,11 @@ namespace bx
{
}
- inline Quaternion::Quaternion(init::NoneType)
+ inline Quaternion::Quaternion(init::NoneTag)
{
}
- constexpr Quaternion::Quaternion(init::ZeroType)
+ constexpr Quaternion::Quaternion(init::ZeroTag)
: x(0.0f)
, y(0.0f)
, z(0.0f)
@@ -476,7 +473,7 @@ namespace bx
{
}
- constexpr Quaternion::Quaternion(init::IdentityType)
+ constexpr Quaternion::Quaternion(init::IdentityTag)
: x(0.0f)
, y(0.0f)
, z(0.0f)
@@ -592,6 +589,16 @@ namespace bx
return mul(_a, rcp(_b) );
}
+ inline BX_CONSTEXPR_FUNC Vec3 nms(const Vec3 _a, const float _b, const Vec3 _c)
+ {
+ return sub(_c, mul(_a, _b) );
+ }
+
+ inline BX_CONSTEXPR_FUNC Vec3 nms(const Vec3 _a, const Vec3 _b, const Vec3 _c)
+ {
+ return sub(_c, mul(_a, _b) );
+ }
+
inline BX_CONSTEXPR_FUNC Vec3 mad(const Vec3 _a, const float _b, const Vec3 _c)
{
return add(mul(_a, _b), _c);
@@ -690,6 +697,14 @@ namespace bx
};
}
+ inline BX_CONSTEXPR_FUNC bool isEqual(const Vec3 _a, const Vec3 _b, float _epsilon)
+ {
+ return isEqual(_a.x, _b.x, _epsilon)
+ && isEqual(_a.y, _b.y, _epsilon)
+ && isEqual(_a.z, _b.z, _epsilon)
+ ;
+ }
+
inline void calcTangentFrame(Vec3& _outT, Vec3& _outB, const Vec3 _n)
{
const float nx = _n.x;
@@ -891,6 +906,24 @@ namespace bx
return normalize(qq);
}
+ inline BX_CONST_FUNC Quaternion fromEuler(const Vec3 _euler)
+ {
+ const float sx = sin(_euler.x * 0.5f);
+ const float cx = cos(_euler.x * 0.5f);
+ const float sy = sin(_euler.y * 0.5f);
+ const float cy = cos(_euler.y * 0.5f);
+ const float sz = sin(_euler.z * 0.5f);
+ const float cz = cos(_euler.z * 0.5f);
+
+ return
+ {
+ sx * cy * cz - cx * sy * sz,
+ cx * sy * cz + sx * cy * sz,
+ cx * cy * sz - sx * sy * cz,
+ cx * cy * cz + sx * sy * sz,
+ };
+ }
+
inline BX_CONST_FUNC Vec3 toEuler(const Quaternion _a)
{
const float xx = _a.x;
@@ -960,7 +993,7 @@ namespace bx
};
}
- inline BX_CONST_FUNC Quaternion rotateAxis(const Vec3 _axis, float _angle)
+ inline BX_CONST_FUNC Quaternion fromAxisAngle(const Vec3 _axis, float _angle)
{
const float ha = _angle * 0.5f;
const float sa = sin(ha);
@@ -974,6 +1007,24 @@ namespace bx
};
}
+ inline void toAxisAngle(Vec3& _outAxis, float& _outAngle, const Quaternion _a)
+ {
+ const float ww = _a.w;
+ const float sa = sqrt(1.0f - square(ww) );
+
+ _outAngle = 2.0f * acos(ww);
+
+ if (0.001f > sa)
+ {
+ _outAxis = { _a.x, _a.y, _a.z };
+ return;
+ }
+
+ const float invSa = 1.0f/sa;
+
+ _outAxis = { _a.x * invSa, _a.y * invSa, _a.z * invSa };
+ }
+
inline BX_CONST_FUNC Quaternion rotateX(float _ax)
{
const float hx = _ax * 0.5f;
@@ -1013,6 +1064,15 @@ namespace bx
};
}
+ inline BX_CONSTEXPR_FUNC bool isEqual(const Quaternion _a, const Quaternion _b, float _epsilon)
+ {
+ return isEqual(_a.x, _b.x, _epsilon)
+ && isEqual(_a.y, _b.y, _epsilon)
+ && isEqual(_a.z, _b.z, _epsilon)
+ && isEqual(_a.w, _b.w, _epsilon)
+ ;
+ }
+
inline void mtxIdentity(float* _result)
{
memSet(_result, 0, sizeof(float)*16);
@@ -1079,12 +1139,12 @@ namespace bx
_result[15] = 1.0f;
}
- inline void mtxQuat(float* _result, const Quaternion& _quat)
+ inline void mtxFromQuaternion(float* _result, const Quaternion& _rotation)
{
- const float qx = _quat.x;
- const float qy = _quat.y;
- const float qz = _quat.z;
- const float qw = _quat.w;
+ const float qx = _rotation.x;
+ const float qy = _rotation.y;
+ const float qz = _rotation.z;
+ const float qw = _rotation.w;
const float x2 = qx + qx;
const float y2 = qy + qy;
@@ -1120,24 +1180,12 @@ namespace bx
_result[15] = 1.0f;
}
- inline void mtxQuatTranslation(float* _result, const Quaternion& _quat, const Vec3& _translation)
+ inline void mtxFromQuaternion(float* _result, const Quaternion& _rotation, const Vec3& _translation)
{
- mtxQuat(_result, _quat);
+ mtxFromQuaternion(_result, _rotation);
store(&_result[12], neg(mulXyz0(_translation, _result) ) );
}
- inline void mtxQuatTranslationHMD(float* _result, const Quaternion& _quat, const Vec3& _translation)
- {
- const Quaternion quat =
- {
- -_quat.x,
- -_quat.y,
- _quat.z,
- _quat.w,
- };
- mtxQuatTranslation(_result, quat, _translation);
- }
-
inline Vec3 mul(const Vec3& _vec, const float* _mat)
{
Vec3 result(init::None);
@@ -1231,11 +1279,18 @@ namespace bx
_outPlane.dist = -dot(_normal, _pos);
}
- inline float distance(const Plane& _plane, const Vec3& _pos)
+ inline BX_CONSTEXPR_FUNC float distance(const Plane& _plane, const Vec3& _pos)
{
return dot(_plane.normal, _pos) + _plane.dist;
}
+ inline BX_CONSTEXPR_FUNC bool isEqual(const Plane& _a, const Plane& _b, float _epsilon)
+ {
+ return isEqual(_a.normal, _b.normal, _epsilon)
+ && isEqual(_a.dist, _b.dist, _epsilon)
+ ;
+ }
+
inline BX_CONST_FUNC float toLinear(float _a)
{
const float lo = _a / 12.92f;
diff --git a/3rdparty/bx/include/bx/inline/mpscqueue.inl b/3rdparty/bx/include/bx/inline/mpscqueue.inl
index c05d8eb8c52..72747b1bfba 100644
--- a/3rdparty/bx/include/bx/inline/mpscqueue.inl
+++ b/3rdparty/bx/include/bx/inline/mpscqueue.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_MPSCQUEUE_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/mutex.inl b/3rdparty/bx/include/bx/inline/mutex.inl
index 6d06f522707..007317ebccd 100644
--- a/3rdparty/bx/include/bx/inline/mutex.inl
+++ b/3rdparty/bx/include/bx/inline/mutex.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_MUTEX_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/os.inl b/3rdparty/bx/include/bx/inline/os.inl
index 3c7eee96a44..736b1fc83e1 100644
--- a/3rdparty/bx/include/bx/inline/os.inl
+++ b/3rdparty/bx/include/bx/inline/os.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/pixelformat.inl b/3rdparty/bx/include/bx/inline/pixelformat.inl
index 7985b32a088..0c6a334b4da 100644
--- a/3rdparty/bx/include/bx/inline/pixelformat.inl
+++ b/3rdparty/bx/include/bx/inline/pixelformat.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_PIXEL_FORMAT_H_HEADER_GUARD
@@ -823,8 +823,8 @@ namespace bx
memCopy(_dst, _src, 16);
}
- // R5G6B5
- inline void packR5G6B5(void* _dst, const float* _src)
+ // B5G6R5
+ inline void packB5G6R5(void* _dst, const float* _src)
{
*( (uint16_t*)_dst) = 0
| uint16_t(toUnorm(_src[0], 31.0f)<<11)
@@ -833,7 +833,7 @@ namespace bx
;
}
- inline void unpackR5G6B5(float* _dst, const void* _src)
+ inline void unpackB5G6R5(float* _dst, const void* _src)
{
uint16_t packed = *( (const uint16_t*)_src);
_dst[0] = float( ( (packed>>11) & 0x1f) ) / 31.0f;
@@ -842,6 +842,25 @@ namespace bx
_dst[3] = 1.0f;
}
+ // R5G6B5
+ inline void packR5G6B5(void* _dst, const float* _src)
+ {
+ *( (uint16_t*)_dst) = 0
+ | uint16_t(toUnorm(_src[0], 31.0f) )
+ | uint16_t(toUnorm(_src[1], 63.0f)<< 5)
+ | uint16_t(toUnorm(_src[2], 31.0f)<<11)
+ ;
+ }
+
+ inline void unpackR5G6B5(float* _dst, const void* _src)
+ {
+ uint16_t packed = *( (const uint16_t*)_src);
+ _dst[0] = float( ( (packed ) & 0x1f) ) / 31.0f;
+ _dst[1] = float( ( (packed>> 5) & 0x3f) ) / 63.0f;
+ _dst[2] = float( ( (packed>>11) & 0x1f) ) / 31.0f;
+ _dst[3] = 1.0f;
+ }
+
// RGBA4
inline void packRgba4(void* _dst, const float* _src)
{
@@ -862,7 +881,7 @@ namespace bx
_dst[3] = float( ( (packed>>12) & 0xf) ) / 15.0f;
}
- // RGBA4
+ // BGRA4
inline void packBgra4(void* _dst, const float* _src)
{
*( (uint16_t*)_dst) = 0
@@ -899,7 +918,7 @@ namespace bx
_dst[0] = float( ( (packed ) & 0x1f) ) / 31.0f;
_dst[1] = float( ( (packed>> 5) & 0x1f) ) / 31.0f;
_dst[2] = float( ( (packed>>10) & 0x1f) ) / 31.0f;
- _dst[3] = float( ( (packed>>14) & 0x1) );
+ _dst[3] = float( ( (packed>>15) & 0x1) );
}
// BGR5A1
@@ -919,7 +938,7 @@ namespace bx
_dst[0] = float( ( (packed>>10) & 0x1f) ) / 31.0f;
_dst[1] = float( ( (packed>> 5) & 0x1f) ) / 31.0f;
_dst[2] = float( ( (packed ) & 0x1f) ) / 31.0f;
- _dst[3] = float( ( (packed>>14) & 0x1) );
+ _dst[3] = float( ( (packed>>15) & 0x1) );
}
// RGB10A2
@@ -947,8 +966,8 @@ namespace bx
{
*( (uint32_t*)_dst) = 0
| ( (halfFromFloat(_src[0])>> 4) & 0x7ff)
- | ( (halfFromFloat(_src[0])<< 7) & 0x3ff800)
- | ( (halfFromFloat(_src[0])<<17) & 0xffc00000)
+ | ( (halfFromFloat(_src[1])<< 7) & 0x3ff800)
+ | ( (halfFromFloat(_src[2])<<17) & 0xffc00000)
;
}
diff --git a/3rdparty/bx/include/bx/inline/readerwriter.inl b/3rdparty/bx/include/bx/inline/readerwriter.inl
index 27f848423bb..fa9300b7a2d 100644
--- a/3rdparty/bx/include/bx/inline/readerwriter.inl
+++ b/3rdparty/bx/include/bx/inline/readerwriter.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_READERWRITER_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/ringbuffer.inl b/3rdparty/bx/include/bx/inline/ringbuffer.inl
index d4ec68239b8..1c1b7ec44d0 100644
--- a/3rdparty/bx/include/bx/inline/ringbuffer.inl
+++ b/3rdparty/bx/include/bx/inline/ringbuffer.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_RINGBUFFER_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/rng.inl b/3rdparty/bx/include/bx/inline/rng.inl
index 0aebbf101c3..123461ddf7d 100644
--- a/3rdparty/bx/include/bx/inline/rng.inl
+++ b/3rdparty/bx/include/bx/inline/rng.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_RNG_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/simd128_langext.inl b/3rdparty/bx/include/bx/inline/simd128_langext.inl
index f007de35cd6..6b94e6125af 100644
--- a/3rdparty/bx/include/bx/inline/simd128_langext.inl
+++ b/3rdparty/bx/include/bx/inline/simd128_langext.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SIMD_T_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/simd128_neon.inl b/3rdparty/bx/include/bx/inline/simd128_neon.inl
index d71ffb6969e..0ba98920da7 100644
--- a/3rdparty/bx/include/bx/inline/simd128_neon.inl
+++ b/3rdparty/bx/include/bx/inline/simd128_neon.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SIMD_T_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/simd128_ref.inl b/3rdparty/bx/include/bx/inline/simd128_ref.inl
index 28c525a3168..b0a97b0e627 100644
--- a/3rdparty/bx/include/bx/inline/simd128_ref.inl
+++ b/3rdparty/bx/include/bx/inline/simd128_ref.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SIMD_T_H_HEADER_GUARD
@@ -136,10 +136,10 @@ BX_SIMD128_IMPLEMENT_TEST(xyzw , 0xf)
BX_SIMD_FORCE_INLINE simd128_ref_t simd_shuf_AxBy(simd128_ref_t _a, simd128_ref_t _b)
{
simd128_ref_t result;
- result.uxyzw[0] = _a.uxyzw[1];
- result.uxyzw[1] = _b.uxyzw[1];
- result.uxyzw[2] = _a.uxyzw[0];
- result.uxyzw[3] = _b.uxyzw[0];
+ result.uxyzw[0] = _b.uxyzw[0];
+ result.uxyzw[1] = _a.uxyzw[0];
+ result.uxyzw[2] = _b.uxyzw[1];
+ result.uxyzw[3] = _a.uxyzw[1];
return result;
}
diff --git a/3rdparty/bx/include/bx/inline/simd128_sse.inl b/3rdparty/bx/include/bx/inline/simd128_sse.inl
index 8f6586b71f0..c8c2a475e34 100644
--- a/3rdparty/bx/include/bx/inline/simd128_sse.inl
+++ b/3rdparty/bx/include/bx/inline/simd128_sse.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SIMD_T_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/simd128_swizzle.inl b/3rdparty/bx/include/bx/inline/simd128_swizzle.inl
index b1ff9a0d183..34ac39b7e57 100644
--- a/3rdparty/bx/include/bx/inline/simd128_swizzle.inl
+++ b/3rdparty/bx/include/bx/inline/simd128_swizzle.inl
@@ -1,6 +1,6 @@
/*
* Copyright 2010-2015 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SIMD_T_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/simd256_avx.inl b/3rdparty/bx/include/bx/inline/simd256_avx.inl
index c29a899d996..1dce947c79b 100644
--- a/3rdparty/bx/include/bx/inline/simd256_avx.inl
+++ b/3rdparty/bx/include/bx/inline/simd256_avx.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SIMD_T_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/simd256_ref.inl b/3rdparty/bx/include/bx/inline/simd256_ref.inl
index f5202bca42f..f27204780b3 100644
--- a/3rdparty/bx/include/bx/inline/simd256_ref.inl
+++ b/3rdparty/bx/include/bx/inline/simd256_ref.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SIMD_T_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/simd_ni.inl b/3rdparty/bx/include/bx/inline/simd_ni.inl
index ad648826ddb..579bb0bc21f 100644
--- a/3rdparty/bx/include/bx/inline/simd_ni.inl
+++ b/3rdparty/bx/include/bx/inline/simd_ni.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
namespace bx
diff --git a/3rdparty/bx/include/bx/inline/sort.inl b/3rdparty/bx/include/bx/inline/sort.inl
index 928f1cbdcd0..ed72c3a3293 100644
--- a/3rdparty/bx/include/bx/inline/sort.inl
+++ b/3rdparty/bx/include/bx/inline/sort.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SORT_H_HEADER_GUARD
@@ -9,6 +9,108 @@
namespace bx
{
+ template<typename Ty>
+ inline int32_t compareAscending(const void* _lhs, const void* _rhs)
+ {
+ const Ty lhs = *static_cast<const Ty*>(_lhs);
+ const Ty rhs = *static_cast<const Ty*>(_rhs);
+ return (lhs > rhs) - (lhs < rhs);
+ }
+
+ template<typename Ty>
+ inline int32_t compareDescending(const void* _lhs, const void* _rhs)
+ {
+ return compareAscending<Ty>(_rhs, _lhs);
+ }
+
+ template<>
+ inline int32_t compareAscending<const char*>(const void* _lhs, const void* _rhs)
+ {
+ return strCmp(*(const char**)_lhs, *(const char**)_rhs);
+ }
+
+ template<>
+ inline int32_t compareAscending<StringView>(const void* _lhs, const void* _rhs)
+ {
+ return strCmp(*(const StringView*)_lhs, *(const StringView*)_rhs);
+ }
+
+ template<typename Ty>
+ inline void quickSort(void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn)
+ {
+ BX_STATIC_ASSERT(isTriviallyMoveAssignable<Ty>(), "Element type must be trivially move assignable");
+ quickSort(_data, _num, _stride, _fn);
+ }
+
+ template<typename Ty>
+ inline void quickSort(Ty* _data, uint32_t _num, const ComparisonFn _fn)
+ {
+ BX_STATIC_ASSERT(isTriviallyMoveAssignable<Ty>(), "Element type must be trivially move assignable");
+ quickSort( (void*)_data, _num, sizeof(Ty), _fn);
+ }
+
+ template<typename Ty>
+ inline uint32_t unique(void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn)
+ {
+ BX_STATIC_ASSERT(isTriviallyMoveAssignable<Ty>(), "Element type must be trivially move assignable");
+ return unique(_data, _num, _stride, _fn);
+ }
+
+ template<typename Ty>
+ inline uint32_t unique(Ty* _data, uint32_t _num, const ComparisonFn _fn)
+ {
+ BX_STATIC_ASSERT(isTriviallyMoveAssignable<Ty>(), "Element type must be trivially move assignable");
+ return unique( (void*)_data, _num, sizeof(Ty), _fn);
+ }
+
+ template<typename Ty>
+ inline uint32_t lowerBound(const Ty& _key, const Ty* _data, uint32_t _num, const ComparisonFn _fn)
+ {
+ return lowerBound( (const void*)&_key, _data, _num, sizeof(Ty), _fn);
+ }
+
+ template<typename Ty>
+ inline uint32_t lowerBound(const Ty& _key, const void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn)
+ {
+ return lowerBound( (const void*)&_key, _data, _num, _stride, _fn);
+ }
+
+ template<typename Ty>
+ inline uint32_t upperBound(const Ty& _key, const Ty* _data, uint32_t _num, const ComparisonFn _fn)
+ {
+ return upperBound( (const void*)&_key, _data, _num, sizeof(Ty), _fn);
+ }
+
+ template<typename Ty>
+ inline uint32_t upperBound(const Ty& _key, const void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn)
+ {
+ return upperBound( (const void*)&_key, _data, _num, _stride, _fn);
+ }
+
+ template<typename Ty>
+ inline bool isSorted(const Ty* _data, uint32_t _num, const ComparisonFn _fn)
+ {
+ return isSorted(_data, _num, sizeof(Ty), _fn);
+ }
+
+ template<typename Ty>
+ inline bool isSorted(const void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn)
+ {
+ return isSorted(_data, _num, _stride, _fn);
+ }
+
+ template<typename Ty>
+ inline int32_t binarySearch(const Ty& _key, const Ty* _data, uint32_t _num, const ComparisonFn _fn)
+ {
+ return binarySearch( (const void*)&_key, _data, _num, sizeof(Ty), _fn);
+ }
+
+ template<typename Ty>
+ inline int32_t binarySearch(const Ty& _key, const void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn)
+ {
+ return binarySearch( (const void*)&_key, _data, _num, _stride, _fn);
+ }
+
namespace radix_sort_detail
{
constexpr uint32_t kBits = 11;
@@ -81,6 +183,8 @@ done:
template <typename Ty>
inline void radixSort(uint32_t* _keys, uint32_t* _tempKeys, Ty* _values, Ty* _tempValues, uint32_t _size)
{
+ BX_STATIC_ASSERT(isTriviallyMoveAssignable<Ty>(), "Sort element type must be trivially move assignable");
+
uint32_t* keys = _keys;
uint32_t* tempKeys = _tempKeys;
Ty* values = _values;
@@ -215,6 +319,8 @@ done:
template <typename Ty>
inline void radixSort(uint64_t* _keys, uint64_t* _tempKeys, Ty* _values, Ty* _tempValues, uint32_t _size)
{
+ BX_STATIC_ASSERT(isTriviallyMoveAssignable<Ty>(), "Sort element type must be trivially move assignable");
+
uint64_t* keys = _keys;
uint64_t* tempKeys = _tempKeys;
Ty* values = _values;
diff --git a/3rdparty/bx/include/bx/inline/spscqueue.inl b/3rdparty/bx/include/bx/inline/spscqueue.inl
index 80d316e62a3..9db8b748d70 100644
--- a/3rdparty/bx/include/bx/inline/spscqueue.inl
+++ b/3rdparty/bx/include/bx/inline/spscqueue.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SPSCQUEUE_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/inline/string.inl b/3rdparty/bx/include/bx/inline/string.inl
index e049b0c343b..a696f342ff3 100644
--- a/3rdparty/bx/include/bx/inline/string.inl
+++ b/3rdparty/bx/include/bx/inline/string.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_STRING_H_HEADER_GUARD
@@ -37,22 +37,6 @@ namespace bx
va_end(argList);
}
- template <typename Ty>
- inline Ty replaceAll(const Ty& _str, const char* _from, const char* _to)
- {
- Ty str = _str;
- typename Ty::size_type startPos = 0;
- const typename Ty::size_type fromLen = strLen(_from);
- const typename Ty::size_type toLen = strLen(_to);
- while ( (startPos = str.find(_from, startPos) ) != Ty::npos)
- {
- str.replace(startPos, fromLen, _to);
- startPos += toLen;
- }
-
- return str;
- }
-
inline StringView::StringView()
{
clear();
@@ -75,21 +59,11 @@ namespace bx
return *this;
}
- inline StringView::StringView(char* _ptr)
- {
- set(_ptr, INT32_MAX);
- }
-
inline StringView::StringView(const char* _ptr)
{
set(_ptr, INT32_MAX);
}
- inline StringView::StringView(char* _ptr, int32_t _len)
- {
- set(_ptr, _len);
- }
-
inline StringView::StringView(const char* _ptr, int32_t _len)
{
set(_ptr, _len);
@@ -100,17 +74,6 @@ namespace bx
set(_ptr, _term);
}
- template<typename Ty>
- inline StringView::StringView(const Ty& _container)
- {
- set(_container);
- }
-
- inline void StringView::set(char* _ptr)
- {
- set(_ptr, INT32_MAX);
- }
-
inline void StringView::set(const char* _ptr)
{
set(_ptr, INT32_MAX);
@@ -124,6 +87,7 @@ namespace bx
{
m_len = INT32_MAX == _len ? strLen(_ptr) : _len;
m_ptr = _ptr;
+ m_0terminated = INT32_MAX == _len;
}
}
@@ -132,12 +96,6 @@ namespace bx
set(_ptr, int32_t(_term-_ptr) );
}
- template<typename Ty>
- inline void StringView::set(const Ty& _container)
- {
- set(_container.data(), int32_t(_container.length() ) );
- }
-
inline void StringView::set(const StringView& _str, int32_t _start, int32_t _len)
{
const int32_t start = min(_start, _str.m_len);
@@ -149,6 +107,7 @@ namespace bx
{
m_ptr = "";
m_len = 0;
+ m_0terminated = true;
}
inline const char* StringView::getPtr() const
@@ -171,36 +130,46 @@ namespace bx
return m_len;
}
+ inline bool StringView::is0Terminated() const
+ {
+ return m_0terminated;
+ }
+
template<bx::AllocatorI** AllocatorT>
inline StringT<AllocatorT>::StringT()
: StringView()
+ , m_capacity(0)
{
+ clear();
}
template<bx::AllocatorI** AllocatorT>
inline StringT<AllocatorT>::StringT(const StringT<AllocatorT>& _rhs)
: StringView()
+ , m_capacity(0)
{
set(_rhs);
}
template<bx::AllocatorI** AllocatorT>
- inline StringT<AllocatorT>& StringT<AllocatorT>::operator=(const StringT<AllocatorT>& _rhs)
+ inline StringT<AllocatorT>::StringT(const StringView& _rhs)
+ : StringView()
+ , m_capacity(0)
{
set(_rhs);
- return *this;
}
template<bx::AllocatorI** AllocatorT>
- inline StringT<AllocatorT>::StringT(const StringView& _rhs)
+ inline StringT<AllocatorT>::~StringT()
{
- set(_rhs);
+ clear();
}
template<bx::AllocatorI** AllocatorT>
- inline StringT<AllocatorT>::~StringT()
+ inline StringT<AllocatorT>& StringT<AllocatorT>::operator=(const StringT<AllocatorT>& _rhs)
{
- clear();
+ set(_rhs);
+ return *this;
}
template<bx::AllocatorI** AllocatorT>
@@ -215,13 +184,22 @@ namespace bx
{
if (0 != _str.getLength() )
{
- int32_t old = m_len;
- int32_t len = m_len + strLen(_str);
- char* ptr = (char*)BX_REALLOC(*AllocatorT, 0 != m_len ? const_cast<char*>(m_ptr) : NULL, len+1);
+ const int32_t old = m_len;
+ const int32_t len = m_len + _str.getLength();
+
+ char* ptr = const_cast<char*>(m_ptr);
+
+ if (len+1 > m_capacity)
+ {
+ const int32_t capacity = alignUp(len+1, 256);
+ ptr = (char*)BX_REALLOC(*AllocatorT, 0 != m_capacity ? ptr : NULL, capacity);
+
+ *const_cast<char**>(&m_ptr) = ptr;
+ m_capacity = capacity;
+ }
+
m_len = len;
strCopy(ptr + old, len-old+1, _str);
-
- *const_cast<char**>(&m_ptr) = ptr;
}
}
@@ -234,11 +212,14 @@ namespace bx
template<bx::AllocatorI** AllocatorT>
inline void StringT<AllocatorT>::clear()
{
- if (0 != m_len)
+ m_0terminated = true;
+
+ if (0 != m_capacity)
{
BX_FREE(*AllocatorT, const_cast<char*>(m_ptr) );
StringView::clear();
+ m_capacity = 0;
}
}
@@ -308,4 +289,24 @@ namespace bx
;
}
+ inline StringView strTrimPrefix(const StringView& _str, const StringView& _prefix)
+ {
+ if (hasPrefix(_str, _prefix) )
+ {
+ return StringView(_str.getPtr() + _prefix.getLength(), _str.getTerm() );
+ }
+
+ return _str;
+ }
+
+ inline StringView strTrimSuffix(const StringView& _str, const StringView& _suffix)
+ {
+ if (hasSuffix(_str, _suffix) )
+ {
+ return StringView(_str.getPtr(), _str.getTerm() - _suffix.getLength() );
+ }
+
+ return _str;
+ }
+
} // namespace bx
diff --git a/3rdparty/bx/include/bx/inline/typetraits.inl b/3rdparty/bx/include/bx/inline/typetraits.inl
new file mode 100644
index 00000000000..3af6a05143b
--- /dev/null
+++ b/3rdparty/bx/include/bx/inline/typetraits.inl
@@ -0,0 +1,462 @@
+/*
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
+ */
+
+#ifndef BX_TYPETRAITS_H_HEADER_GUARD
+# error "Must be included from bx/typetraits.h!"
+#endif // BX_TYPETRAITS_H_HEADER_GUARD
+
+namespace bx
+{
+ // Reference(s):
+ //
+ // - GCC type traits compiler intrisics
+ // https://gcc.gnu.org/onlinedocs/gcc-11.1.0/gcc/Type-Traits.html
+ //
+ // - Clang type trait primitives
+ // https://clang.llvm.org/docs/LanguageExtensions.html#type-trait-primitives
+
+ //---
+ template<typename Ty, Ty ValueT>
+ struct IntegralConstantT
+ {
+ using ValueType = Ty;
+ static constexpr Ty value = ValueT;
+ };
+
+ template<bool BoolT>
+ using BoolConstantT = IntegralConstantT<bool, BoolT>;
+ using FalseConstant = BoolConstantT<false>;
+ using TrueConstant = BoolConstantT<true >;
+
+ //---
+ template<typename Ty> struct TypeIdentityT { using Type = Ty; };
+ template<typename Ty> using TypeIdentityType = typename TypeIdentityT<Ty>::Type;
+
+ //---
+ template<bool BoolT, typename Ty, typename Uy> struct ConditionalT { using Type = Ty; };
+ template< typename Ty, typename Uy> struct ConditionalT<false, Ty, Uy> { using Type = Uy; };
+ template<bool BoolT, typename Ty, typename Uy> using ConditionalType = typename ConditionalT<BoolT, Ty, Uy>::Type;
+
+ //---
+ template<bool BoolT, typename Ty = void> struct EnableIfT { };
+ template< typename Ty > struct EnableIfT<true, Ty> { using Type = Ty; };
+ template<bool BoolT, typename Ty > using EnableIfType = typename EnableIfT<BoolT, Ty>::Type;
+
+ //---
+ template<typename Ty> struct AddLvalueReferenceT { using Type = Ty&; };
+ template<typename Ty> struct AddLvalueReferenceT<Ty&> { using Type = Ty&; };
+ template<> struct AddLvalueReferenceT< void> { using Type = void; };
+ template<> struct AddLvalueReferenceT<const void> { using Type = const void; };
+ template<> struct AddLvalueReferenceT<volatile void> { using Type = volatile void; };
+ template<> struct AddLvalueReferenceT<const volatile void> { using Type = const volatile void; };
+ template<typename Ty> using AddLvalueReferenceType = typename AddLvalueReferenceT<Ty>::Type;
+
+ //---
+ template<typename Ty> struct AddRvalueReferenceT { using Type = Ty&&; };
+ template<typename Ty> struct AddRvalueReferenceT<Ty&> { using Type = Ty&; };
+ template<> struct AddRvalueReferenceT< void> { using Type = void; };
+ template<> struct AddRvalueReferenceT<const void> { using Type = const void; };
+ template<> struct AddRvalueReferenceT<volatile void> { using Type = volatile void; };
+ template<> struct AddRvalueReferenceT<const volatile void> { using Type = const volatile void; };
+ template<typename Ty> using AddRvalueReferenceType = typename AddRvalueReferenceT<Ty>::Type;
+
+ //---
+ template<typename Ty> struct RemoveReferenceT { using Type = Ty; };
+ template<typename Ty> struct RemoveReferenceT<Ty&> { using Type = Ty; };
+ template<typename Ty> struct RemoveReferenceT<Ty&&> { using Type = Ty; };
+ template<typename Ty> using RemoveReferenceType = typename RemoveReferenceT<Ty>::Type;
+
+ //---
+ template<typename Ty> struct AddPointerT { using Type = TypeIdentityType<RemoveReferenceType<Ty>*>; };
+ template<typename Ty> using AddPointerType = typename AddPointerT<Ty>::Type;
+
+ //---
+ template<typename Ty> struct RemovePointerT { using Type = Ty; };
+ template<typename Ty> struct RemovePointerT< Ty* > { using Type = Ty; };
+ template<typename Ty> struct RemovePointerT< const Ty* > { using Type = Ty; };
+ template<typename Ty> struct RemovePointerT< volatile Ty* > { using Type = Ty; };
+ template<typename Ty> struct RemovePointerT<const volatile Ty* > { using Type = Ty; };
+ template<typename Ty> struct RemovePointerT<const volatile Ty* const > { using Type = Ty; };
+ template<typename Ty> struct RemovePointerT< Ty* const > { using Type = Ty; };
+ template<typename Ty> struct RemovePointerT< Ty* volatile> { using Type = Ty; };
+ template<typename Ty> struct RemovePointerT< Ty* const volatile> { using Type = Ty; };
+ template<typename Ty> using RemovePointerType = typename RemovePointerT<Ty>::Type;
+
+ //---
+ template<typename Ty> struct AddCvT { using Type = const volatile Ty; };
+ template<typename Ty> using AddCvType = typename AddCvT<Ty>::Type;
+
+ //---
+ template<typename Ty> struct RemoveCvT { using Type = Ty; };
+ template<typename Ty> struct RemoveCvT<const Ty> { using Type = Ty; };
+ template<typename Ty> struct RemoveCvT<volatile Ty> { using Type = Ty; };
+ template<typename Ty> struct RemoveCvT<const volatile Ty> { using Type = Ty; };
+ template<typename Ty> using RemoveCvType = typename RemoveCvT<Ty>::Type;
+
+ //---
+ template<typename Ty> struct AddConstT { using Type = const Ty; };
+ template<typename Ty> using AddConstType = typename AddConstT<Ty>::Type;
+
+ //---
+ template<typename Ty> struct RemoveConstT { using Type = Ty; };
+ template<typename Ty> struct RemoveConstT<const Ty> { using Type = Ty; };
+ template<typename Ty> using RemoveConstType = typename RemoveConstT<Ty>::Type;
+
+ //---
+ template<typename Ty> struct AddVolatileT { using Type = volatile Ty; };
+ template<typename Ty> using AddVolatileType = typename AddVolatileT<Ty>::Type;
+
+ //---
+ template<typename Ty> struct RemoveVolatileT { using Type = Ty; };
+ template<typename Ty> struct RemoveVolatileT<volatile Ty> { using Type = Ty; };
+ template<typename Ty> using RemoveVolatileType = typename RemoveVolatileT<Ty>::Type;
+
+ //---
+
+ template<typename Ty> struct IsBoundedArrayT : FalseConstant {};
+ template<typename Ty, size_t SizeT> struct IsBoundedArrayT<Ty[SizeT]> : TrueConstant {};
+
+ template<typename Ty>
+ inline constexpr bool isBoundedArray()
+ {
+ return IsBoundedArrayT<Ty>::value;
+ }
+
+ template<typename Ty> struct IsUnboundedArrayT : FalseConstant {};
+ template<typename Ty> struct IsUnboundedArrayT<Ty[]> : TrueConstant {};
+
+ template<typename Ty>
+ inline constexpr bool isUnboundedArray()
+ {
+ return IsUnboundedArrayT<Ty>::value;
+ }
+
+ template<typename Ty>
+ inline constexpr bool isArray()
+ {
+ return isBoundedArray<Ty>()
+ || isUnboundedArray<Ty>()
+ ;
+ }
+
+ template<typename Ty>
+ inline constexpr bool isEnum()
+ {
+ return !!__is_enum(Ty);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isUnion()
+ {
+ return !!__is_union(Ty);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isAbstract()
+ {
+ return !!__is_abstract(Ty);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isAggregate()
+ {
+ return !!__is_aggregate(Ty);
+ }
+
+ template<typename BaseT, typename DerivedT>
+ inline constexpr bool isBaseOf()
+ {
+ return !!__is_base_of(BaseT, DerivedT);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isPolymorphic()
+ {
+ return !!__is_polymorphic(Ty);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isDestructorVirtual()
+ {
+ return __has_virtual_destructor(Ty);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isClass()
+ {
+ return !!__is_class(Ty);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isFinal()
+ {
+ return !!__is_final(Ty);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isEmpty()
+ {
+ return !!__is_empty(Ty);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isStandardLayout()
+ {
+ return !!__is_standard_layout(Ty);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isTrivial()
+ {
+ return !!__is_trivial(Ty);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isPod()
+ {
+ return isStandardLayout<Ty>()
+ && isTrivial<Ty>()
+ ;
+ }
+
+ template<typename Ty, typename FromT>
+ inline constexpr bool isAssignable()
+ {
+ return !!__is_assignable(Ty, FromT);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isCopyAssignable()
+ {
+ return isAssignable<
+ AddLvalueReferenceType<Ty>
+ , AddLvalueReferenceType<const Ty>
+ >();
+ }
+
+ template<typename Ty>
+ inline constexpr bool isMoveAssignable()
+ {
+ return isAssignable<
+ AddLvalueReferenceType<Ty>
+ , AddRvalueReferenceType<Ty>
+ >();
+ }
+
+ template<typename Ty, typename FromT>
+ inline constexpr bool isTriviallyAssignable()
+ {
+ return !!__is_trivially_assignable(Ty, FromT);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isTriviallyCopyAssignable()
+ {
+ return isTriviallyAssignable<
+ AddLvalueReferenceType<Ty>
+ , AddRvalueReferenceType<const Ty>
+ >();
+ }
+
+ template<typename Ty>
+ inline constexpr bool isTriviallyMoveAssignable()
+ {
+ return isTriviallyAssignable<
+ AddLvalueReferenceType<Ty>
+ , AddRvalueReferenceType<Ty>
+ >();
+ }
+
+ template<typename Ty, typename... ArgsT>
+ inline constexpr bool isConstructible()
+ {
+ return !!__is_constructible(Ty, ArgsT...);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isCopyConstructible()
+ {
+ return isConstructible<Ty, AddLvalueReferenceType<Ty>>();
+ }
+
+ template<typename Ty>
+ inline constexpr bool isMoveConstructible()
+ {
+ return isConstructible<Ty, AddRvalueReferenceType<Ty>>();
+ }
+
+ template<typename Ty, typename... ArgsT>
+ inline constexpr bool isTriviallyConstructible()
+ {
+ return !!__is_trivially_constructible(Ty, ArgsT...);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isTriviallyCopyConstructible()
+ {
+ return isTriviallyConstructible<Ty, AddLvalueReferenceType<Ty>>();
+ }
+
+ template<typename Ty>
+ inline constexpr bool isTriviallyMoveConstructible()
+ {
+ return isTriviallyConstructible<Ty, AddRvalueReferenceType<Ty>>();
+ }
+
+ template<typename Ty>
+ inline constexpr bool isTriviallyCopyable()
+ {
+ return !!__is_trivially_copyable(Ty);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isTriviallyDestructible()
+ {
+#if BX_COMPILER_GCC
+ return !!__has_trivial_destructor(Ty);
+#else
+ return !!__is_trivially_destructible(Ty);
+#endif // BX_COMPILER_GCC
+ }
+
+ template<typename Ty> struct IsConstT : FalseConstant {};
+ template<typename Ty> struct IsConstT<const Ty> : TrueConstant {};
+
+ template<typename Ty>
+ inline constexpr bool isConst()
+ {
+ return IsConstT<Ty>::value;
+ }
+
+ template<typename Ty> struct IsVolatileT : FalseConstant {};
+ template<typename Ty> struct IsVolatileT<volatile Ty> : TrueConstant {};
+
+ template<typename Ty>
+ inline constexpr bool isVolatile()
+ {
+ return IsVolatileT<Ty>::value;
+ }
+
+ template<typename Ty> struct IsLvalueReferenceT : FalseConstant {};
+ template<typename Ty> struct IsLvalueReferenceT<Ty&> : TrueConstant {};
+
+ template<typename Ty>
+ inline constexpr bool isLvalueReference()
+ {
+ return IsLvalueReferenceT<Ty>::value;
+ }
+
+ template<typename Ty> struct IsRvalueReferenceT : FalseConstant {};
+ template<typename Ty> struct IsRvalueReferenceT<Ty&&> : TrueConstant {};
+
+ template<typename Ty>
+ inline constexpr bool isRvalueReference()
+ {
+ return IsRvalueReferenceT<Ty>::value;
+ }
+
+ template<typename Ty>
+ inline constexpr bool isReference()
+ {
+ return isLvalueReference<Ty>()
+ || isRvalueReference<Ty>()
+ ;
+ }
+
+ template<typename Ty> struct IsPointerT : FalseConstant {};
+ template<typename Ty> struct IsPointerT<Ty*> : TrueConstant {};
+ template<typename Ty> struct IsPointerT<Ty* const> : TrueConstant {};
+ template<typename Ty> struct IsPointerT<Ty* volatile> : TrueConstant {};
+ template<typename Ty> struct IsPointerT<Ty* const volatile> : TrueConstant {};
+
+ template<typename Ty>
+ inline constexpr bool isPointer()
+ {
+ return IsPointerT<Ty>::value;
+ }
+
+ template<typename Ty>
+ inline constexpr bool isSigned()
+ {
+ return Ty(-1) < Ty(0);
+ }
+
+ template<typename Ty>
+ inline constexpr bool isUnsigned()
+ {
+ return Ty(-1) > Ty(0);
+ }
+
+ template<typename Ty> struct IsIntegerT : FalseConstant {};
+ template<> struct IsIntegerT<bool > : TrueConstant {};
+ template<> struct IsIntegerT<char > : TrueConstant {};
+ template<> struct IsIntegerT<char16_t > : TrueConstant {};
+ template<> struct IsIntegerT<char32_t > : TrueConstant {};
+ template<> struct IsIntegerT<wchar_t > : TrueConstant {};
+ template<> struct IsIntegerT< signed char > : TrueConstant {};
+ template<> struct IsIntegerT<unsigned char > : TrueConstant {};
+ template<> struct IsIntegerT< short > : TrueConstant {};
+ template<> struct IsIntegerT<unsigned short > : TrueConstant {};
+ template<> struct IsIntegerT< int > : TrueConstant {};
+ template<> struct IsIntegerT<unsigned int > : TrueConstant {};
+ template<> struct IsIntegerT< long > : TrueConstant {};
+ template<> struct IsIntegerT<unsigned long > : TrueConstant {};
+ template<> struct IsIntegerT< long long> : TrueConstant {};
+ template<> struct IsIntegerT<unsigned long long> : TrueConstant {};
+
+ template<typename Ty>
+ inline constexpr bool isInteger()
+ {
+ return IsIntegerT<Ty>::value;
+ }
+
+ template<typename Ty> struct IsFloatingPointT : FalseConstant {};
+ template<> struct IsFloatingPointT<float > : TrueConstant {};
+ template<> struct IsFloatingPointT< double> : TrueConstant {};
+ template<> struct IsFloatingPointT<long double> : TrueConstant {};
+
+ template<typename Ty>
+ inline constexpr bool isFloatingPoint()
+ {
+ return IsFloatingPointT<Ty>::value;
+ }
+
+ template<typename Ty>
+ inline constexpr bool isArithmetic()
+ {
+ return isInteger<Ty>()
+ || isFloatingPoint<Ty>()
+ ;
+ }
+
+ template<typename Ty, typename Uy> struct IsSameT : FalseConstant {};
+ template<typename Ty> struct IsSameT<Ty, Ty> : TrueConstant {};
+
+ template<typename Ty, typename Uy>
+ inline constexpr bool isSame()
+ {
+ return IsSameT<Ty, Uy>::value;
+ }
+
+ template<typename Ty>
+ inline constexpr RemoveReferenceType<Ty>&& move(Ty&& _a)
+ {
+ return static_cast<RemoveReferenceType<Ty>&&>(_a);
+ }
+
+ template<typename Ty>
+ inline constexpr Ty&& forward(RemoveReferenceType<Ty>& _a)
+ {
+ return static_cast<Ty&&>(_a);
+ }
+
+ template<typename Ty>
+ inline constexpr Ty&& forward(RemoveReferenceType<Ty>&& _a)
+ {
+ BX_STATIC_ASSERT(!isLvalueReference<Ty>(), "Can not forward an Rvalue as an Lvalue.");
+ return static_cast<Ty&&>(_a);
+ }
+
+} // namespace bx
diff --git a/3rdparty/bx/include/bx/inline/uint32_t.inl b/3rdparty/bx/include/bx/inline/uint32_t.inl
index c2965c53bc2..5cd3c2103ba 100644
--- a/3rdparty/bx/include/bx/inline/uint32_t.inl
+++ b/3rdparty/bx/include/bx/inline/uint32_t.inl
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
// Copyright 2006 Mike Acton <macton@gmail.com>
@@ -336,7 +336,7 @@ namespace bx
}
template<>
- inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(uint64_t _val)
+ inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(unsigned long long _val)
{
#if BX_COMPILER_GCC || BX_COMPILER_CLANG
return __builtin_popcountll(_val);
@@ -344,12 +344,18 @@ namespace bx
const uint32_t lo = uint32_t(_val&UINT32_MAX);
const uint32_t hi = uint32_t(_val>>32);
- const uint32_t total = uint32_cntbits(lo)
- + uint32_cntbits(hi);
- return total;
+ return uint32_cntbits(lo)
+ + uint32_cntbits(hi)
+ ;
#endif // BX_COMPILER_*
}
+ template<>
+ inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(unsigned long _val)
+ {
+ return uint32_cntbits<unsigned long long>(_val);
+ }
+
template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(uint8_t _val) { return uint32_cntbits<uint32_t>(_val); }
template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(int8_t _val) { return uint32_cntbits<uint8_t >(_val); }
template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntbits(uint16_t _val) { return uint32_cntbits<uint32_t>(_val); }
@@ -381,7 +387,7 @@ namespace bx
}
template<>
- inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(uint64_t _val)
+ inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(unsigned long long _val)
{
#if BX_COMPILER_GCC || BX_COMPILER_CLANG
return 0 == _val ? 64 : __builtin_clzll(_val);
@@ -393,6 +399,12 @@ namespace bx
#endif // BX_COMPILER_*
}
+ template<>
+ inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(unsigned long _val)
+ {
+ return uint32_cntlz<unsigned long long>(_val);
+ }
+
template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(uint8_t _val) { return uint32_cntlz<uint32_t>(_val)-24; }
template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(int8_t _val) { return uint32_cntlz<uint8_t >(_val); }
template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cntlz(uint16_t _val) { return uint32_cntlz<uint32_t>(_val)-16; }
@@ -416,7 +428,7 @@ namespace bx
}
template<>
- inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(uint64_t _val)
+ inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(unsigned long long _val)
{
#if BX_COMPILER_GCC || BX_COMPILER_CLANG
return 0 == _val ? 64 : __builtin_ctzll(_val);
@@ -428,6 +440,12 @@ namespace bx
#endif // BX_COMPILER_*
}
+ template<>
+ inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(unsigned long _val)
+ {
+ return uint32_cnttz<unsigned long long>(_val);
+ }
+
template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(uint8_t _val) { return bx::min(8u, uint32_cnttz<uint32_t>(_val) ); }
template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(int8_t _val) { return uint32_cnttz<uint8_t >(_val); }
template<> inline BX_CONSTEXPR_FUNC uint32_t uint32_cnttz(uint16_t _val) { return bx::min(16u, uint32_cnttz<uint32_t>(_val) ); }
@@ -687,66 +705,67 @@ namespace bx
return result;
}
- template <typename Ty>
- inline bool isAligned(Ty _a, int32_t _align)
+ template<typename Ty>
+ inline BX_CONSTEXPR_FUNC bool isAligned(Ty _a, int32_t _align)
{
const Ty mask = Ty(_align - 1);
return 0 == (_a & mask);
}
- template <typename Ty>
- inline bool isAligned(const Ty* _ptr, int32_t _align)
+ template<typename Ty>
+ inline BX_CONSTEXPR_FUNC bool isAligned(Ty* _ptr, int32_t _align)
{
union { const void* ptr; uintptr_t addr; } un = { _ptr };
return isAligned(un.addr, _align);
}
- template <typename Ty>
- inline bool isAligned(Ty* _ptr, int32_t _align)
+ template<typename Ty>
+ inline BX_CONSTEXPR_FUNC bool isAligned(const Ty* _ptr, int32_t _align)
{
- return isAligned( (const void*)_ptr, _align);
+ union { const void* ptr; uintptr_t addr; } un = { _ptr };
+ return isAligned(un.addr, _align);
}
- template <typename Ty>
- inline Ty alignDown(Ty _a, int32_t _align)
+ template<typename Ty>
+ inline BX_CONSTEXPR_FUNC Ty alignDown(Ty _a, int32_t _align)
{
const Ty mask = Ty(_align - 1);
return Ty(_a & ~mask);
}
- template <typename Ty>
- inline Ty* alignDown(Ty* _ptr, int32_t _align)
+ template<typename Ty>
+ inline BX_CONSTEXPR_FUNC Ty* alignDown(Ty* _ptr, int32_t _align)
{
union { Ty* ptr; uintptr_t addr; } un = { _ptr };
un.addr = alignDown(un.addr, _align);
return un.ptr;
}
- template <typename Ty>
- inline const Ty* alignDown(const Ty* _ptr, int32_t _align)
+ template<typename Ty>
+ inline BX_CONSTEXPR_FUNC const Ty* alignDown(const Ty* _ptr, int32_t _align)
{
union { const Ty* ptr; uintptr_t addr; } un = { _ptr };
un.addr = alignDown(un.addr, _align);
return un.ptr;
}
- template <typename Ty>
- inline Ty alignUp(Ty _a, int32_t _align)
+ template<typename Ty>
+ inline BX_CONSTEXPR_FUNC Ty alignUp(Ty _a, int32_t _align)
{
const Ty mask = Ty(_align - 1);
return Ty( (_a + mask) & ~mask);
}
- template <typename Ty>
- inline Ty* alignUp(Ty* _ptr, int32_t _align)
+ template<typename Ty>
+ inline BX_CONSTEXPR_FUNC Ty* alignUp(Ty* _ptr, int32_t _align)
{
union { Ty* ptr; uintptr_t addr; } un = { _ptr };
un.addr = alignUp(un.addr, _align);
return un.ptr;
}
- template <typename Ty>
- inline const Ty* alignUp(const Ty* _ptr, int32_t _align)
+ template<typename Ty>
+ inline BX_CONSTEXPR_FUNC const Ty* alignUp(const Ty* _ptr, int32_t _align)
{
union { const Ty* ptr; uintptr_t addr; } un = { _ptr };
un.addr = alignUp(un.addr, _align);
diff --git a/3rdparty/bx/include/bx/macros.h b/3rdparty/bx/include/bx/macros.h
index 0d13cc96948..dab1ba7013a 100644
--- a/3rdparty/bx/include/bx/macros.h
+++ b/3rdparty/bx/include/bx/macros.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_H_HEADER_GUARD
@@ -66,7 +66,7 @@
# define BX_UNLIKELY(_x) __builtin_expect(!!(_x), 0)
# define BX_NO_INLINE __attribute__( (noinline) )
# define BX_NO_RETURN __attribute__( (noreturn) )
-# define BX_CONST_FUNC __attribute__( (const) )
+# define BX_CONST_FUNC __attribute__( (pure) )
# if BX_COMPILER_GCC >= 70000
# define BX_FALLTHROUGH __attribute__( (fallthrough) )
@@ -109,11 +109,7 @@
/// The return value of the function is solely a function of the arguments.
///
-#if __cplusplus < 201402
-# define BX_CONSTEXPR_FUNC BX_CONST_FUNC
-#else
-# define BX_CONSTEXPR_FUNC constexpr BX_CONST_FUNC
-#endif // __cplusplus < 201402
+#define BX_CONSTEXPR_FUNC constexpr BX_CONST_FUNC
///
#define BX_STATIC_ASSERT(_condition, ...) static_assert(_condition, "" __VA_ARGS__)
@@ -201,16 +197,24 @@
# define BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC(_x)
#endif // BX_COMPILER_
-///
+/// No default constructor.
#define BX_CLASS_NO_DEFAULT_CTOR(_class) \
- private: _class()
+ _class() = delete
-#define BX_CLASS_NO_COPY(_class) \
- private: _class(const _class& _rhs)
+/// No copy constructor.
+#define BX_CLASS_NO_COPY_CTOR(_class) \
+ _class(const _class& _rhs) = delete
-#define BX_CLASS_NO_ASSIGNMENT(_class) \
- private: _class& operator=(const _class& _rhs)
+/// No copy assignment operator.
+#define BX_CLASS_NO_COPY_ASSIGNMENT(_class) \
+ _class& operator=(const _class& _rhs) = delete
+/// No copy construcor, and copy assignment operator.
+#define BX_CLASS_NO_COPY(_class) \
+ BX_CLASS_NO_COPY_CTOR(_class); \
+ BX_CLASS_NO_COPY_ASSIGNMENT(_class)
+
+///
#define BX_CLASS_ALLOCATOR(_class) \
public: void* operator new(size_t _size); \
public: void operator delete(void* _ptr); \
@@ -229,17 +233,51 @@
#endif // BX_COMPILER_MSVC
#ifndef BX_ASSERT
-# define BX_ASSERT(_condition, ...) BX_NOOP()
+# if BX_CONFIG_DEBUG
+# define BX_ASSERT _BX_ASSERT
+# else
+# define BX_ASSERT(_condition, ...) BX_NOOP()
+# endif // BX_CONFIG_DEBUG
#endif // BX_ASSERT
#ifndef BX_TRACE
-# define BX_TRACE(...) BX_NOOP()
+# if BX_CONFIG_DEBUG
+# define BX_TRACE _BX_TRACE
+# else
+# define BX_TRACE(...) BX_NOOP()
+# endif // BX_CONFIG_DEBUG
#endif // BX_TRACE
#ifndef BX_WARN
-# define BX_WARN(_condition, ...) BX_NOOP()
+# if BX_CONFIG_DEBUG
+# define BX_WARN _BX_WARN
+# else
+# define BX_WARN(_condition, ...) BX_NOOP()
+# endif // BX_CONFIG_DEBUG
#endif // BX_ASSERT
+#define _BX_TRACE(_format, ...) \
+ BX_MACRO_BLOCK_BEGIN \
+ bx::debugPrintf(__FILE__ "(" BX_STRINGIZE(__LINE__) "): BX " _format "\n", ##__VA_ARGS__); \
+ BX_MACRO_BLOCK_END
+
+#define _BX_WARN(_condition, _format, ...) \
+ BX_MACRO_BLOCK_BEGIN \
+ if (!BX_IGNORE_C4127(_condition) ) \
+ { \
+ BX_TRACE("WARN " _format, ##__VA_ARGS__); \
+ } \
+ BX_MACRO_BLOCK_END
+
+#define _BX_ASSERT(_condition, _format, ...) \
+ BX_MACRO_BLOCK_BEGIN \
+ if (!BX_IGNORE_C4127(_condition) ) \
+ { \
+ BX_TRACE("ASSERT " _format, ##__VA_ARGS__); \
+ bx::debugBreak(); \
+ } \
+ BX_MACRO_BLOCK_END
+
// static_assert sometimes causes unused-local-typedef...
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG("-Wunused-local-typedef")
diff --git a/3rdparty/bx/include/bx/maputil.h b/3rdparty/bx/include/bx/maputil.h
index 9b61d49cd8f..712e2331e0a 100644
--- a/3rdparty/bx/include/bx/maputil.h
+++ b/3rdparty/bx/include/bx/maputil.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_MAPUTIL_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/math.h b/3rdparty/bx/include/bx/math.h
index ee4aa292276..a02549b5fe8 100644
--- a/3rdparty/bx/include/bx/math.h
+++ b/3rdparty/bx/include/bx/math.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_MATH_H_HEADER_GUARD
@@ -11,27 +11,11 @@
namespace bx
{
- constexpr float kPi = 3.1415926535897932384626433832795f;
- constexpr float kPi2 = 6.2831853071795864769252867665590f;
- constexpr float kInvPi = 1.0f/kPi;
- constexpr float kPiHalf = 1.5707963267948966192313216916398f;
- constexpr float kPiQuarter = 0.7853981633974483096156608458199f;
- constexpr float kSqrt2 = 1.4142135623730950488016887242097f;
- constexpr float kLogNat10 = 2.3025850929940456840179914546844f;
- constexpr float kInvLogNat2 = 1.4426950408889634073599246810019f;
- constexpr float kLogNat2Hi = 0.6931471805599453094172321214582f;
- constexpr float kLogNat2Lo = 1.90821492927058770002e-10f;
- constexpr float kE = 2.7182818284590452353602874713527f;
- constexpr float kNearZero = 1.0f/float(1 << 28);
- constexpr float kFloatMin = 1.175494e-38f;
- constexpr float kFloatMax = 3.402823e+38f;
- extern const float kInfinity;
-
///
typedef float (*LerpFn)(float _a, float _b, float _t);
///
- struct Handness
+ struct Handedness
{
enum Enum
{
@@ -55,18 +39,18 @@ namespace bx
{
/// Fields are left uninitialized.
///
- struct NoneType {};
- constexpr NoneType None;
+ struct NoneTag {};
+ constexpr NoneTag None;
/// Fields are initialized to zero.
///
- struct ZeroType {};
- constexpr ZeroType Zero;
+ struct ZeroTag {};
+ constexpr ZeroTag Zero;
/// Fields are initialized to identity value.
///
- struct IdentityType {};
- constexpr IdentityType Identity;
+ struct IdentityTag {};
+ constexpr IdentityTag Identity;
}
///
@@ -75,13 +59,13 @@ namespace bx
Vec3() = delete;
///
- Vec3(init::NoneType);
+ Vec3(init::NoneTag);
///
- constexpr Vec3(init::ZeroType);
+ constexpr Vec3(init::ZeroTag);
///
- constexpr Vec3(init::IdentityType);
+ constexpr Vec3(init::IdentityTag);
///
explicit constexpr Vec3(float _v);
@@ -98,13 +82,13 @@ namespace bx
Plane() = delete;
///
- Plane(init::NoneType);
+ Plane(init::NoneTag);
///
- constexpr Plane(init::ZeroType);
+ constexpr Plane(init::ZeroTag);
///
- constexpr Plane(init::IdentityType);
+ constexpr Plane(init::IdentityTag);
///
constexpr Plane(Vec3 _normal, float _dist);
@@ -119,13 +103,13 @@ namespace bx
Quaternion() = delete;
///
- Quaternion(init::NoneType);
+ Quaternion(init::NoneTag);
///
- constexpr Quaternion(init::ZeroType);
+ constexpr Quaternion(init::ZeroTag);
///
- constexpr Quaternion(init::IdentityType);
+ constexpr Quaternion(init::IdentityTag);
///
constexpr Quaternion(float _x, float _y, float _z, float _w);
@@ -205,7 +189,11 @@ namespace bx
///
BX_CONSTEXPR_FUNC float invLerp(float _a, float _b, float _value);
- /// Returns the sign of _a.
+ /// Extracts the sign of value `_a`.
+ ///
+ /// @param[in] _a Value.
+ ///
+ /// @returns -1 if `_a` less than zero, 0 if `_a` is equal to 0, or +1 if `_a` is greater than zero.
///
BX_CONSTEXPR_FUNC float sign(float _a);
@@ -253,7 +241,7 @@ namespace bx
///
BX_CONST_FUNC float atan(float _a);
- /// Retruns the inverse tangent of _y/_x.
+ /// Returns the inverse tangent of _y/_x.
///
BX_CONST_FUNC float atan2(float _y, float _x);
@@ -304,15 +292,15 @@ namespace bx
///
BX_CONSTEXPR_FUNC float fract(float _a);
- /// Returns result of negated multiply-sub operation -(_a * _b - _c).
+ /// Returns result of negated multiply-sub operation -(_a * _b - _c) -> _c - _a * _b.
///
BX_CONSTEXPR_FUNC float nms(float _a, float _b, float _c);
- /// Returns resul of addition (_a + _b).
+ /// Returns result of addition (_a + _b).
///
BX_CONSTEXPR_FUNC float add(float _a, float _b);
- /// Returns resul of subtracion (_a - _b).
+ /// Returns result of subtracion (_a - _b).
///
BX_CONSTEXPR_FUNC float sub(float _a, float _b);
@@ -333,10 +321,10 @@ namespace bx
BX_CONST_FUNC float mod(float _a, float _b);
///
- BX_CONSTEXPR_FUNC bool equal(float _a, float _b, float _epsilon);
+ BX_CONSTEXPR_FUNC bool isEqual(float _a, float _b, float _epsilon);
///
- BX_CONST_FUNC bool equal(const float* _a, const float* _b, uint32_t _num, float _epsilon);
+ BX_CONST_FUNC bool isEqual(const float* _a, const float* _b, uint32_t _num, float _epsilon);
///
BX_CONST_FUNC float wrap(float _a, float _wrap);
@@ -407,6 +395,14 @@ namespace bx
///
BX_CONSTEXPR_FUNC Vec3 div(const Vec3 _a, float _b);
+ /// Returns result of negated multiply-sub operation -(_a * _b - _c) -> _c - _a * _b.
+ ///
+ BX_CONSTEXPR_FUNC Vec3 nms(const Vec3 _a, const float _b, const Vec3 _c);
+
+ /// Returns result of negated multiply-sub operation -(_a * _b - _c) -> _c - _a * _b.
+ ///
+ BX_CONSTEXPR_FUNC Vec3 nms(const Vec3 _a, const Vec3 _b, const Vec3 _c);
+
///
BX_CONSTEXPR_FUNC Vec3 mad(const Vec3 _a, const float _b, const Vec3 _c);
@@ -448,6 +444,9 @@ namespace bx
BX_CONSTEXPR_FUNC Vec3 rcp(const Vec3 _a);
///
+ BX_CONSTEXPR_FUNC bool isEqual(const Vec3 _a, const Vec3 _b, float _epsilon);
+
+ ///
void calcTangentFrame(Vec3& _outT, Vec3& _outB, const Vec3 _n);
///
@@ -490,6 +489,9 @@ namespace bx
BX_CONSTEXPR_FUNC Quaternion lerp(const Quaternion _a, const Quaternion _b, float _t);
///
+ BX_CONST_FUNC Quaternion fromEuler(const Vec3 _euler);
+
+ ///
BX_CONST_FUNC Vec3 toEuler(const Quaternion _a);
///
@@ -502,7 +504,10 @@ namespace bx
BX_CONST_FUNC Vec3 toZAxis(const Quaternion _a);
///
- BX_CONST_FUNC Quaternion rotateAxis(const Vec3 _axis, float _angle);
+ BX_CONST_FUNC Quaternion fromAxisAngle(const Vec3 _axis, float _angle);
+
+ ///
+ void toAxisAngle(Vec3& _outAxis, float& _outAngle, const Quaternion _a);
///
BX_CONST_FUNC Quaternion rotateX(float _ax);
@@ -514,6 +519,9 @@ namespace bx
BX_CONST_FUNC Quaternion rotateZ(float _az);
///
+ BX_CONSTEXPR_FUNC bool isEqual(const Quaternion _a, const Quaternion _b, float _epsilon);
+
+ ///
void mtxIdentity(float* _result);
///
@@ -543,13 +551,10 @@ namespace bx
);
///
- void mtxQuat(float* _result, const Quaternion& _quat);
+ void mtxFromQuaternion(float* _result, const Quaternion& _rotation);
///
- void mtxQuatTranslation(float* _result, const Quaternion& _quat, const Vec3& _translation);
-
- ///
- void mtxQuatTranslationHMD(float* _result, const Quaternion& _quat, const Vec3& _translation);
+ void mtxFromQuaternion(float* _result, const Quaternion& _rotation, const Vec3& _translation);
///
void mtxLookAt(
@@ -557,7 +562,7 @@ namespace bx
, const Vec3& _eye
, const Vec3& _at
, const Vec3& _up = { 0.0f, 1.0f, 0.0f }
- , Handness::Enum _handness = Handness::Left
+ , Handedness::Enum _handedness = Handedness::Left
);
///
@@ -570,7 +575,7 @@ namespace bx
, float _near
, float _far
, bool _homogeneousNdc
- , Handness::Enum _handness = Handness::Left
+ , Handedness::Enum _handedness = Handedness::Left
);
///
@@ -580,7 +585,7 @@ namespace bx
, float _near
, float _far
, bool _homogeneousNdc
- , Handness::Enum _handness = Handness::Left
+ , Handedness::Enum _handedness = Handedness::Left
);
///
@@ -591,7 +596,7 @@ namespace bx
, float _near
, float _far
, bool _homogeneousNdc
- , Handness::Enum _handness = Handness::Left
+ , Handedness::Enum _handedness = Handedness::Left
);
///
@@ -600,7 +605,7 @@ namespace bx
, const float _fov[4]
, float _near
, bool _homogeneousNdc
- , Handness::Enum _handness = Handness::Left
+ , Handedness::Enum _handedness = Handedness::Left
, NearFar::Enum _nearFar = NearFar::Default
);
@@ -613,7 +618,7 @@ namespace bx
, float _rt
, float _near
, bool _homogeneousNdc
- , Handness::Enum _handness = Handness::Left
+ , Handedness::Enum _handedness = Handedness::Left
, NearFar::Enum _nearFar = NearFar::Default
);
@@ -624,7 +629,7 @@ namespace bx
, float _aspect
, float _near
, bool _homogeneousNdc
- , Handness::Enum _handness = Handness::Left
+ , Handedness::Enum _handedness = Handedness::Left
, NearFar::Enum _nearFar = NearFar::Default
);
@@ -639,7 +644,7 @@ namespace bx
, float _far
, float _offset
, bool _homogeneousNdc
- , Handness::Enum _handness = Handness::Left
+ , Handedness::Enum _handedness = Handedness::Left
);
///
@@ -714,7 +719,10 @@ namespace bx
void calcPlane(Plane& _outPlane, const Vec3& _normal, const Vec3& _pos);
///
- float distance(const Plane& _plane, const Vec3& _pos);
+ BX_CONSTEXPR_FUNC float distance(const Plane& _plane, const Vec3& _pos);
+
+ ///
+ BX_CONSTEXPR_FUNC bool isEqual(const Plane& _a, const Plane& _b, float _epsilon);
///
void calcLinearFit2D(float _result[2], const void* _points, uint32_t _stride, uint32_t _numPoints);
diff --git a/3rdparty/bx/include/bx/mpscqueue.h b/3rdparty/bx/include/bx/mpscqueue.h
index f738c22dbef..7bb083b173e 100644
--- a/3rdparty/bx/include/bx/mpscqueue.h
+++ b/3rdparty/bx/include/bx/mpscqueue.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_MPSCQUEUE_H_HEADER_GUARD
@@ -17,8 +17,8 @@ namespace bx
class MpScUnboundedQueueT
{
BX_CLASS(MpScUnboundedQueueT
+ , NO_DEFAULT_CTOR
, NO_COPY
- , NO_ASSIGNMENT
);
public:
@@ -47,8 +47,8 @@ namespace bx
class MpScUnboundedBlockingQueue
{
BX_CLASS(MpScUnboundedBlockingQueue
+ , NO_DEFAULT_CTOR
, NO_COPY
- , NO_ASSIGNMENT
);
public:
diff --git a/3rdparty/bx/include/bx/mutex.h b/3rdparty/bx/include/bx/mutex.h
index ef9337bdc99..4713b5da500 100644
--- a/3rdparty/bx/include/bx/mutex.h
+++ b/3rdparty/bx/include/bx/mutex.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_MUTEX_H_HEADER_GUARD
@@ -15,7 +15,6 @@ namespace bx
{
BX_CLASS(Mutex
, NO_COPY
- , NO_ASSIGNMENT
);
public:
@@ -41,7 +40,6 @@ namespace bx
BX_CLASS(MutexScope
, NO_DEFAULT_CTOR
, NO_COPY
- , NO_ASSIGNMENT
);
public:
diff --git a/3rdparty/bx/include/bx/os.h b/3rdparty/bx/include/bx/os.h
index f2102810b14..4de2f6d8b8d 100644
--- a/3rdparty/bx/include/bx/os.h
+++ b/3rdparty/bx/include/bx/os.h
@@ -1,12 +1,11 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_OS_H_HEADER_GUARD
#define BX_OS_H_HEADER_GUARD
-#include "debug.h"
#include "filepath.h"
#if BX_PLATFORM_OSX
@@ -56,6 +55,9 @@ namespace bx
///
void* exec(const char* const* _argv);
+ ///
+ BX_NO_RETURN void exit(int32_t _exitCode);
+
} // namespace bx
#include "inline/os.inl"
diff --git a/3rdparty/bx/include/bx/pixelformat.h b/3rdparty/bx/include/bx/pixelformat.h
index 3895e85b31e..c556b014e56 100644
--- a/3rdparty/bx/include/bx/pixelformat.h
+++ b/3rdparty/bx/include/bx/pixelformat.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_PIXEL_FORMAT_H_HEADER_GUARD
@@ -209,6 +209,10 @@ namespace bx
void packRgba32F(void* _dst, const float* _src);
void unpackRgba32F(float* _dst, const void* _src);
+ // B5G6R5
+ void packB5G6R5(void* _dst, const float* _src);
+ void unpackB5G6R5(float* _dst, const void* _src);
+
// R5G6B5
void packR5G6B5(void* _dst, const float* _src);
void unpackR5G6B5(float* _dst, const void* _src);
@@ -217,7 +221,7 @@ namespace bx
void packRgba4(void* _dst, const float* _src);
void unpackRgba4(float* _dst, const void* _src);
- // RGBA4
+ // BGRA4
void packBgra4(void* _dst, const float* _src);
void unpackBgra4(float* _dst, const void* _src);
diff --git a/3rdparty/bx/include/bx/platform.h b/3rdparty/bx/include/bx/platform.h
index b255636e5ba..f14f9b680bf 100644
--- a/3rdparty/bx/include/bx/platform.h
+++ b/3rdparty/bx/include/bx/platform.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_PLATFORM_H_HEADER_GUARD
@@ -16,7 +16,7 @@
#define BX_COMPILER_GCC 0
#define BX_COMPILER_MSVC 0
-// Endianess
+// Endianness
#define BX_CPU_ENDIAN_BIG 0
#define BX_CPU_ENDIAN_LITTLE 0
@@ -37,14 +37,16 @@
#define BX_CRT_MSVC 0
#define BX_CRT_NEWLIB 0
-#ifndef BX_CRT_MUSL
-# define BX_CRT_MUSL 0
-#endif // BX_CRT_MUSL
-
#ifndef BX_CRT_NONE
# define BX_CRT_NONE 0
#endif // BX_CRT_NONE
+// Language standard version
+#define BX_LANGUAGE_CPP14 201402L
+#define BX_LANGUAGE_CPP17 201703L
+#define BX_LANGUAGE_CPP20 202002L
+#define BX_LANGUAGE_CPP23 202207L
+
// Platform
#define BX_PLATFORM_ANDROID 0
#define BX_PLATFORM_BSD 0
@@ -253,7 +255,6 @@
&& !BX_CRT_LIBCXX \
&& !BX_CRT_MINGW \
&& !BX_CRT_MSVC \
- && !BX_CRT_MUSL \
&& !BX_CRT_NEWLIB
# undef BX_CRT_NONE
# define BX_CRT_NONE 1
@@ -342,7 +343,9 @@
BX_STRINGIZE(__clang_minor__) "." \
BX_STRINGIZE(__clang_patchlevel__)
#elif BX_COMPILER_MSVC
-# if BX_COMPILER_MSVC >= 1920 // Visual Studio 2019
+# if BX_COMPILER_MSVC >= 1930 // Visual Studio 2022
+# define BX_COMPILER_NAME "MSVC 17.0"
+# elif BX_COMPILER_MSVC >= 1920 // Visual Studio 2019
# define BX_COMPILER_NAME "MSVC 16.0"
# elif BX_COMPILER_MSVC >= 1910 // Visual Studio 2017
# define BX_COMPILER_NAME "MSVC 15.0"
@@ -429,8 +432,6 @@
# define BX_CRT_NAME "Clang C Library"
#elif BX_CRT_NEWLIB
# define BX_CRT_NAME "Newlib"
-#elif BX_CRT_MUSL
-# define BX_CRT_NAME "musl libc"
#elif BX_CRT_NONE
# define BX_CRT_NAME "None"
#else
@@ -443,17 +444,15 @@
# define BX_ARCH_NAME "64-bit"
#endif // BX_ARCH_
-#if BX_COMPILER_MSVC
-# define BX_CPP_NAME "C++MsvcUnknown"
-#elif defined(__cplusplus)
-# if __cplusplus < 201103L
-# error "Pre-C++11 compiler is not supported!"
-# elif __cplusplus < 201402L
-# define BX_CPP_NAME "C++11"
-# elif __cplusplus < 201703L
+#if defined(__cplusplus)
+# if __cplusplus < BX_LANGUAGE_CPP14
+# error "C++14 standard support is required to build."
+# elif __cplusplus < BX_LANGUAGE_CPP17
# define BX_CPP_NAME "C++14"
-# elif __cplusplus < 201704L
+# elif __cplusplus < BX_LANGUAGE_CPP20
# define BX_CPP_NAME "C++17"
+# elif __cplusplus < BX_LANGUAGE_CPP23
+# define BX_CPP_NAME "C++20"
# else
// See: https://gist.github.com/bkaradzic/2e39896bc7d8c34e042b#orthodox-c
# define BX_CPP_NAME "C++WayTooModern"
diff --git a/3rdparty/bx/include/bx/process.h b/3rdparty/bx/include/bx/process.h
index 9c5ee0403a2..e963b90e309 100644
--- a/3rdparty/bx/include/bx/process.h
+++ b/3rdparty/bx/include/bx/process.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_PROCESS_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/readerwriter.h b/3rdparty/bx/include/bx/readerwriter.h
index 45265b2c112..01e1d1ca2a8 100644
--- a/3rdparty/bx/include/bx/readerwriter.h
+++ b/3rdparty/bx/include/bx/readerwriter.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_READERWRITER_H_HEADER_GUARD
@@ -81,7 +81,7 @@ namespace bx
virtual ~ReaderOpenI() = 0;
///
- virtual bool open(const FilePath& _filePath, Error* _err) = 0;
+ virtual bool open(const FilePath& _filePath, Error* _err = ErrorIgnore{}) = 0;
};
/// Open for writing interface.
@@ -91,7 +91,7 @@ namespace bx
virtual ~WriterOpenI() = 0;
///
- virtual bool open(const FilePath& _filePath, bool _append, Error* _err) = 0;
+ virtual bool open(const FilePath& _filePath, bool _append = false, Error* _err = ErrorIgnore{}) = 0;
};
/// Open process interface.
@@ -101,7 +101,7 @@ namespace bx
virtual ~ProcessOpenI() = 0;
///
- virtual bool open(const FilePath& _filePath, const StringView& _args, Error* _err) = 0;
+ virtual bool open(const FilePath& _filePath, const StringView& _args, Error* _err = ErrorIgnore{}) = 0;
};
/// Closer interface.
@@ -174,7 +174,7 @@ namespace bx
uint32_t m_size;
};
- /// Sizer writer. Dummy writter that only counts number of bytes written into it.
+ /// Sizer writer. Dummy writer that only counts number of bytes written into it.
class SizerWriter : public WriterSeekerI
{
public:
@@ -265,25 +265,25 @@ namespace bx
};
/// Read data.
- int32_t read(ReaderI* _reader, void* _data, int32_t _size, Error* _err = NULL);
+ int32_t read(ReaderI* _reader, void* _data, int32_t _size, Error* _err);
/// Read value.
template<typename Ty>
- int32_t read(ReaderI* _reader, Ty& _value, Error* _err = NULL);
+ int32_t read(ReaderI* _reader, Ty& _value, Error* _err);
- /// Read value and converts it to host endianess. _fromLittleEndian specifies
- /// underlying stream endianess.
+ /// Read value and converts it to host endianness. _fromLittleEndian specifies
+ /// underlying stream endianness.
template<typename Ty>
- int32_t readHE(ReaderI* _reader, Ty& _value, bool _fromLittleEndian, Error* _err = NULL);
+ int32_t readHE(ReaderI* _reader, Ty& _value, bool _fromLittleEndian, Error* _err);
/// Write data.
- int32_t write(WriterI* _writer, const void* _data, int32_t _size, Error* _err = NULL);
+ int32_t write(WriterI* _writer, const void* _data, int32_t _size, Error* _err);
/// Write C string.
- int32_t write(WriterI* _writer, const char* _str, Error* _err = NULL);
+ int32_t write(WriterI* _writer, const char* _str, Error* _err);
/// Write string view.
- int32_t write(WriterI* _writer, const StringView& _str, Error* _err = NULL);
+ int32_t write(WriterI* _writer, const StringView& _str, Error* _err);
/// Write formatted string.
int32_t write(WriterI* _writer, const StringView& _format, va_list _argList, Error* _err);
@@ -295,19 +295,19 @@ namespace bx
int32_t write(WriterI* _writer, Error* _err, const char* _format, ...);
/// Write repeat the same value.
- int32_t writeRep(WriterI* _writer, uint8_t _byte, int32_t _size, Error* _err = NULL);
+ int32_t writeRep(WriterI* _writer, uint8_t _byte, int32_t _size, Error* _err);
/// Write value.
template<typename Ty>
- int32_t write(WriterI* _writer, const Ty& _value, Error* _err = NULL);
+ int32_t write(WriterI* _writer, const Ty& _value, Error* _err);
/// Write value as little endian.
template<typename Ty>
- int32_t writeLE(WriterI* _writer, const Ty& _value, Error* _err = NULL);
+ int32_t writeLE(WriterI* _writer, const Ty& _value, Error* _err);
/// Write value as big endian.
template<typename Ty>
- int32_t writeBE(WriterI* _writer, const Ty& _value, Error* _err = NULL);
+ int32_t writeBE(WriterI* _writer, const Ty& _value, Error* _err);
/// Skip _offset bytes forward.
int64_t skip(SeekerI* _seeker, int64_t _offset);
@@ -322,26 +322,26 @@ namespace bx
int64_t getRemain(SeekerI* _seeker);
/// Peek data.
- int32_t peek(ReaderSeekerI* _reader, void* _data, int32_t _size, Error* _err = NULL);
+ int32_t peek(ReaderSeekerI* _reader, void* _data, int32_t _size, Error* _err);
/// Peek value.
template<typename Ty>
- int32_t peek(ReaderSeekerI* _reader, Ty& _value, Error* _err = NULL);
+ int32_t peek(ReaderSeekerI* _reader, Ty& _value, Error* _err);
/// Align reader stream.
- int32_t align(ReaderSeekerI* _reader, uint32_t _alignment, Error* _err = NULL);
+ int32_t align(ReaderSeekerI* _reader, uint32_t _alignment, Error* _err);
/// Align writer stream (pads stream with zeros).
- int32_t align(WriterSeekerI* _writer, uint32_t _alignment, Error* _err = NULL);
+ int32_t align(WriterSeekerI* _writer, uint32_t _alignment, Error* _err);
/// Open for read.
- bool open(ReaderOpenI* _reader, const FilePath& _filePath, Error* _err = NULL);
+ bool open(ReaderOpenI* _reader, const FilePath& _filePath, Error* _err = ErrorIgnore{});
/// Open for write.
- bool open(WriterOpenI* _writer, const FilePath& _filePath, bool _append = false, Error* _err = NULL);
+ bool open(WriterOpenI* _writer, const FilePath& _filePath, bool _append = false, Error* _err = ErrorIgnore{});
/// Open process.
- bool open(ProcessOpenI* _process, const FilePath& _filePath, const StringView& _args, Error* _err = NULL);
+ bool open(ProcessOpenI* _process, const FilePath& _filePath, const StringView& _args, Error* _err = ErrorIgnore{});
/// Close.
void close(CloserI* _reader);
diff --git a/3rdparty/bx/include/bx/ringbuffer.h b/3rdparty/bx/include/bx/ringbuffer.h
index 112c7c13ba7..84eefddc85f 100644
--- a/3rdparty/bx/include/bx/ringbuffer.h
+++ b/3rdparty/bx/include/bx/ringbuffer.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_RINGBUFFER_H_HEADER_GUARD
@@ -16,8 +16,8 @@ namespace bx
class RingBufferControl
{
BX_CLASS(RingBufferControl
+ , NO_DEFAULT_CTOR
, NO_COPY
- , NO_ASSIGNMENT
);
public:
@@ -55,8 +55,8 @@ namespace bx
class SpScRingBufferControl
{
BX_CLASS(SpScRingBufferControl
+ , NO_DEFAULT_CTOR
, NO_COPY
- , NO_ASSIGNMENT
);
public:
@@ -97,7 +97,6 @@ namespace bx
BX_CLASS(ReadRingBufferT
, NO_DEFAULT_CTOR
, NO_COPY
- , NO_ASSIGNMENT
);
public:
@@ -140,7 +139,6 @@ namespace bx
BX_CLASS(WriteRingBufferT
, NO_DEFAULT_CTOR
, NO_COPY
- , NO_ASSIGNMENT
);
public:
diff --git a/3rdparty/bx/include/bx/rng.h b/3rdparty/bx/include/bx/rng.h
index b8b4a457edc..0266eff8326 100644
--- a/3rdparty/bx/include/bx/rng.h
+++ b/3rdparty/bx/include/bx/rng.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_RNG_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/semaphore.h b/3rdparty/bx/include/bx/semaphore.h
index 3e0fa49f918..7748bc8e289 100644
--- a/3rdparty/bx/include/bx/semaphore.h
+++ b/3rdparty/bx/include/bx/semaphore.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SEM_H_HEADER_GUARD
@@ -15,7 +15,6 @@ namespace bx
{
BX_CLASS(Semaphore
, NO_COPY
- , NO_ASSIGNMENT
);
public:
diff --git a/3rdparty/bx/include/bx/settings.h b/3rdparty/bx/include/bx/settings.h
index e5dbc8ac68d..76e4fc3901d 100644
--- a/3rdparty/bx/include/bx/settings.h
+++ b/3rdparty/bx/include/bx/settings.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SETTINGS_H_HEADER_GUARD
@@ -51,10 +51,10 @@ namespace bx
};
///
- int32_t read(ReaderSeekerI* _reader, Settings& _settings, Error* _err = NULL);
+ int32_t read(ReaderSeekerI* _reader, Settings& _settings, Error* _err);
///
- int32_t write(WriterI* _writer, const Settings& _settings, Error* _err = NULL);
+ int32_t write(WriterI* _writer, const Settings& _settings, Error* _err);
} // namespace bx
diff --git a/3rdparty/bx/include/bx/simd_t.h b/3rdparty/bx/include/bx/simd_t.h
index c804c990118..f2be8f6d0ae 100644
--- a/3rdparty/bx/include/bx/simd_t.h
+++ b/3rdparty/bx/include/bx/simd_t.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SIMD_T_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/sort.h b/3rdparty/bx/include/bx/sort.h
index bd4c2b17d80..cee84bfdb63 100644
--- a/3rdparty/bx/include/bx/sort.h
+++ b/3rdparty/bx/include/bx/sort.h
@@ -1,18 +1,52 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SORT_H_HEADER_GUARD
#define BX_SORT_H_HEADER_GUARD
#include "bx.h"
+#include "math.h"
+#include "string.h"
namespace bx
{
+ /// The function compares the `_lhs` and `_rhs` values.
+ ///
+ /// @returns Returns value:
+ /// - less than zero if `_lhs` is less than `_rhs`
+ /// - zero if `_lhs` is equivalent to `_rhs`
+ /// - greater than zero if `_lhs` is greater than `_rhs`
///
typedef int32_t (*ComparisonFn)(const void* _lhs, const void* _rhs);
+ /// The function compares the `_lhs` and `_rhs` values.
+ ///
+ /// @returns Returns value:
+ /// - less than zero if `_lhs` is less than `_rhs`
+ /// - zero if `_lhs` is equivalent to `_rhs`
+ /// - greater than zero if `_lhs` is greater than `_rhs`
+ ///
+ template<typename Ty>
+ int32_t compareAscending(const void* _lhs, const void* _rhs);
+
+ /// The function compares the `_lhs` and `_rhs` values.
+ ///
+ /// @returns Returns value:
+ /// - less than zero if `_lhs` is greated than `_rhs`
+ /// - zero if `_lhs` is equivalent to `_rhs`
+ /// - greater than zero if `_lhs` is less than `_rhs`
+ ///
+ template<typename Ty>
+ int32_t compareDescending(const void* _lhs, const void* _rhs);
+
+ /// Performs sort (Quick Sort algorithm).
+ ///
+ /// @param _data Pointer to array data.
+ /// @param _num Number of elements.
+ /// @param _stride Element stride in bytes.
+ /// @param _fn Comparison function.
///
void quickSort(
void* _data
@@ -21,6 +55,245 @@ namespace bx
, const ComparisonFn _fn
);
+ /// Performs sort (Quick Sort algorithm).
+ ///
+ /// @param _data Pointer to array data.
+ /// @param _num Number of elements.
+ /// @param _stride Element stride in bytes.
+ /// @param _fn Comparison function.
+ ///
+ template<typename Ty>
+ void quickSort(void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn = compareAscending<Ty>);
+
+ /// Performs sort (Quick Sort algorithm).
+ ///
+ /// @param _data Pointer to array data.
+ /// @param _num Number of elements.
+ /// @param _fn Comparison function.
+ ///
+ template<typename Ty>
+ void quickSort(Ty* _data, uint32_t _num, const ComparisonFn _fn = compareAscending<Ty>);
+
+ /// Performs reordering of duplicate elements in the array in the way that unique elements
+ /// are sorted to the front of array, and duplicates are after the return value index.
+ ///
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _stride Element stride in bytes.
+ /// @param _fn Comparison function.
+ ///
+ /// @remarks Array must be sorted!
+ ///
+ /// @returns Returns the count of unique elements.
+ ///
+ uint32_t unique(void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn);
+
+ /// Performs reordering of duplicate elements in the array in the way that unique elements
+ /// are sorted to the front of array, and duplicates are after the return value index.
+ ///
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _stride Element stride in bytes.
+ /// @param _fn Comparison function.
+ ///
+ /// @remarks Array must be sorted!
+ ///
+ /// @returns Returns the count of unique elements.
+ ///
+ template<typename Ty>
+ uint32_t unique(void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn = compareAscending<Ty>);
+
+ /// Performs reordering of duplicate elements in the array in the way that unique elements
+ /// are sorted to the front of array, and duplicates are after the return value index.
+ ///
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _fn Comparison function.
+ ///
+ /// @remarks Array must be sorted!
+ ///
+ /// @returns Returns the count of unique elements.
+ ///
+ template<typename Ty>
+ uint32_t unique(Ty* _data, uint32_t _num, const ComparisonFn _fn = compareAscending<Ty>);
+
+ /// Performs check if array is sorted.
+ ///
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _stride Element stride in bytes.
+ /// @param _fn Comparison function.
+ ///
+ /// @returns Returns `true` if array is sorted, otherwise returns `false`.
+ ///
+ bool isSorted(
+ const void* _data
+ , uint32_t _num
+ , uint32_t _stride
+ , const ComparisonFn _fn
+ );
+
+ /// Performs check if array is sorted.
+ ///
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _stride Element stride in bytes.
+ /// @param _fn Comparison function.
+ ///
+ /// @returns Returns `true` if array is sorted, otherwise returns `false`.
+ ///
+ template<typename Ty>
+ bool isSorted(const void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn = compareAscending<Ty>);
+
+ /// Performs check if array is sorted.
+ ///
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _fn Comparison function.
+ ///
+ /// @returns Returns `true` if array is sorted, otherwise returns `false`.
+ ///
+ template<typename Ty>
+ bool isSorted(const Ty* _data, uint32_t _num, const ComparisonFn _fn = compareAscending<Ty>);
+
+ /// Returns an index to the first element greater or equal than the `_key` value.
+ ///
+ /// @param _key Pointer to the key to search for.
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _stride Element stride in bytes.
+ /// @param _fn Comparison function.
+ ///
+ /// @remarks Array must be sorted!
+ ///
+ /// @returns Returns an index to the first element greater or equal than the `_key` value.
+ ///
+ uint32_t lowerBound(const void* _key, const void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn);
+
+ /// Returns an index to the first element greater or equal than the `_key` value.
+ ///
+ /// @param _key Pointer to the key to search for.
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _fn Comparison function.
+ ///
+ /// @remarks Array must be sorted!
+ ///
+ /// @returns Returns an index to the first element greater or equal than the `_key` value.
+ ///
+ template<typename Ty>
+ uint32_t lowerBound(const Ty& _key, const Ty* _data, uint32_t _num, const ComparisonFn _fn = compareAscending<Ty>);
+
+ /// Returns an index to the first element greater or equal than the `_key` value.
+ ///
+ /// @param _key Pointer to the key to search for.
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _stride Element stride in bytes.
+ /// @param _fn Comparison function.
+ ///
+ /// @remarks Array must be sorted!
+ ///
+ /// @returns Returns an index to the first element greater or equal than the `_key` value.
+ ///
+ template<typename Ty>
+ uint32_t lowerBound(const Ty& _key, const void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn = compareAscending<Ty>);
+
+ /// Returns an index to the first element greater than the `_key` value.
+ ///
+ /// @param _key Pointer to the key to search for.
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _stride Element stride in bytes.
+ /// @param _fn Comparison function.
+ ///
+ /// @remarks Array must be sorted!
+ ///
+ /// @returns Returns an index to the first element greater than the `_key` value.
+ ///
+ uint32_t upperBound(const void* _key, const void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn);
+
+ /// Returns an index to the first element greater than the `_key` value.
+ ///
+ /// @param _key Pointer to the key to search for.
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _fn Comparison function.
+ ///
+ /// @remarks Array must be sorted!
+ ///
+ /// @returns Returns an index to the first element greater than the `_key` value.
+ ///
+ template<typename Ty>
+ uint32_t upperBound(const Ty& _key, const Ty* _data, uint32_t _num, const ComparisonFn _fn = compareAscending<Ty>);
+
+ /// Returns an index to the first element greater than the `_key` value.
+ ///
+ /// @param _key Pointer to the key to search for.
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _stride Element stride in bytes.
+ /// @param _fn Comparison function.
+ ///
+ /// @remarks Array must be sorted!
+ ///
+ /// @returns Returns an index to the first element greater than the `_key` value.
+ ///
+ template<typename Ty>
+ uint32_t upperBound(const Ty& _key, const void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn = compareAscending<Ty>);
+
+ /// Performs binary search of a sorted array.
+ ///
+ /// @param _key Pointer to the key to search for.
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _stride Element stride in bytes.
+ /// @param _fn Comparison function.
+ ///
+ /// @remarks Array must be sorted!
+ ///
+ /// @returns Returns positive value index of element if found, or negative number that is bitwise
+ /// complement (~) of the index of the next element that's larger than item.
+ ///
+ int32_t binarySearch(
+ const void* _key
+ , const void* _data
+ , uint32_t _num
+ , uint32_t _stride
+ , const ComparisonFn _fn
+ );
+
+ /// Performs binary search of a sorted array.
+ ///
+ /// @param _key Pointer to the key to search for.
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _fn Comparison function.
+ ///
+ /// @remarks Array must be sorted!
+ ///
+ /// @returns Returns positive value index of element if found, or negative number that is bitwise
+ /// complement (~) of the index of the next element that's larger than item.
+ ///
+ template<typename Ty>
+ int32_t binarySearch(const Ty& _key, const Ty* _data, uint32_t _num, const ComparisonFn _fn = compareAscending<Ty>);
+
+ /// Performs binary search of a sorted array.
+ ///
+ /// @param _key Pointer to the key to search for.
+ /// @param _data Pointer to sorted array data.
+ /// @param _num Number of elements.
+ /// @param _stride Element stride in bytes.
+ /// @param _fn Comparison function.
+ ///
+ /// @remarks Array must be sorted!
+ ///
+ /// @returns Returns positive value index of element if found, or negative number that is bitwise
+ /// complement (~) of the index of the next element that's larger than item.
+ ///
+ template<typename Ty>
+ int32_t binarySearch(const Ty& _key, const void* _data, uint32_t _num, uint32_t _stride = sizeof(Ty), const ComparisonFn _fn = compareAscending<Ty>);
+
///
void radixSort(
uint32_t* _keys
diff --git a/3rdparty/bx/include/bx/spscqueue.h b/3rdparty/bx/include/bx/spscqueue.h
index e4381b0443c..eaa8cd23b91 100644
--- a/3rdparty/bx/include/bx/spscqueue.h
+++ b/3rdparty/bx/include/bx/spscqueue.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_SPSCQUEUE_H_HEADER_GUARD
@@ -16,8 +16,8 @@ namespace bx
class SpScUnboundedQueue
{
BX_CLASS(SpScUnboundedQueue
+ , NO_DEFAULT_CTOR
, NO_COPY
- , NO_ASSIGNMENT
);
public:
@@ -57,8 +57,8 @@ namespace bx
class SpScUnboundedQueueT
{
BX_CLASS(SpScUnboundedQueueT
+ , NO_DEFAULT_CTOR
, NO_COPY
- , NO_ASSIGNMENT
);
public:
@@ -86,8 +86,8 @@ namespace bx
class SpScBlockingUnboundedQueue
{
BX_CLASS(SpScBlockingUnboundedQueue
+ , NO_DEFAULT_CTOR
, NO_COPY
- , NO_ASSIGNMENT
);
public:
@@ -116,8 +116,8 @@ namespace bx
class SpScBlockingUnboundedQueueT
{
BX_CLASS(SpScBlockingUnboundedQueueT
+ , NO_DEFAULT_CTOR
, NO_COPY
- , NO_ASSIGNMENT
);
public:
diff --git a/3rdparty/bx/include/bx/string.h b/3rdparty/bx/include/bx/string.h
index edb257a6f32..d6629dc31eb 100644
--- a/3rdparty/bx/include/bx/string.h
+++ b/3rdparty/bx/include/bx/string.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_STRING_H_HEADER_GUARD
@@ -38,28 +38,15 @@ namespace bx
StringView& operator=(const StringView& _rhs);
///
- StringView(char* _ptr);
-
- ///
StringView(const char* _ptr);
///
- StringView(char* _ptr, int32_t _len);
-
- ///
StringView(const char* _ptr, int32_t _len);
///
StringView(const char* _ptr, const char* _term);
///
- template<typename Ty>
- explicit StringView(const Ty& _container);
-
- ///
- void set(char* _ptr);
-
- ///
void set(const char* _ptr);
///
@@ -72,10 +59,6 @@ namespace bx
void set(const StringView& _str, int32_t _start = 0, int32_t _len = INT32_MAX);
///
- template<typename Ty>
- void set(const Ty& _container);
-
- ///
void clear();
/// Returns pointer to non-terminated string.
@@ -91,15 +74,19 @@ namespace bx
///
const char* getTerm() const;
- ///
+ /// Returns `true` if string is empty.
bool isEmpty() const;
- ///
+ /// Returns string length.
int32_t getLength() const;
+ /// Returns `true` if string is zero terminated.
+ bool is0Terminated() const;
+
protected:
const char* m_ptr;
int32_t m_len;
+ bool m_0terminated;
};
/// ASCII string
@@ -114,15 +101,15 @@ namespace bx
StringT(const StringT<AllocatorT>& _rhs);
///
- StringT<AllocatorT>& operator=(const StringT<AllocatorT>& _rhs);
-
- ///
StringT(const StringView& _rhs);
///
~StringT();
///
+ StringT<AllocatorT>& operator=(const StringT<AllocatorT>& _rhs);
+
+ ///
void set(const StringView& _str);
///
@@ -137,21 +124,24 @@ namespace bx
/// Returns zero-terminated C string pointer.
///
const char* getCPtr() const;
+
+ protected:
+ int32_t m_capacity;
};
- /// Retruns true if character is part of space set.
+ /// Returns true if character is part of space set.
bool isSpace(char _ch);
/// Returns true if string view contains only space characters.
bool isSpace(const StringView& _str);
- /// Retruns true if character is uppercase.
+ /// Returns true if character is uppercase.
bool isUpper(char _ch);
/// Returns true if string view contains only uppercase characters.
bool isUpper(const StringView& _str);
- /// Retruns true if character is lowercase.
+ /// Returns true if character is lowercase.
bool isLower(char _ch);
/// Returns true if string view contains only lowercase characters.
@@ -160,19 +150,19 @@ namespace bx
/// Returns true if character is part of alphabet set.
bool isAlpha(char _ch);
- /// Retruns true if string view contains only alphabet characters.
+ /// Returns true if string view contains only alphabet characters.
bool isAlpha(const StringView& _str);
/// Returns true if character is part of numeric set.
bool isNumeric(char _ch);
- /// Retruns true if string view contains only numeric characters.
+ /// Returns true if string view contains only numeric characters.
bool isNumeric(const StringView& _str);
/// Returns true if character is part of alpha numeric set.
bool isAlphaNum(char _ch);
- /// Returns true if string view contains only alpha-numeric characters.
+ /// Returns true if string view contains only alphanumeric characters.
bool isAlphaNum(const StringView& _str);
/// Returns true if character is part of hexadecimal set.
@@ -187,7 +177,7 @@ namespace bx
/// Returns true if string vieww contains only printable characters.
bool isPrint(const StringView& _str);
- /// Retruns lower case character representing _ch.
+ /// Returns lower case character representing _ch.
char toLower(char _ch);
/// Lower case string in place assuming length passed is valid.
@@ -224,7 +214,7 @@ namespace bx
/// including zero terminator. Copy will be terminated with '\0'.
int32_t strCopy(char* _dst, int32_t _dstSize, const StringView& _str, int32_t _num = INT32_MAX);
- /// Concatinate string.
+ /// Concatenate string.
int32_t strCat(char* _dst, int32_t _dstSize, const StringView& _str, int32_t _num = INT32_MAX);
/// Test whether the string _str begins with prefix.
@@ -266,10 +256,16 @@ namespace bx
/// Returns string view with whitespace characters trimmed from left and right.
StringView strTrimSpace(const StringView& _str);
+ /// Returns string view with prefix trimmed.
+ StringView strTrimPrefix(const StringView& _str, const StringView& _prefix);
+
+ /// Returns string view with suffix trimmed.
+ StringView strTrimSuffix(const StringView& _str, const StringView& _suffix);
+
/// Find new line. Returns pointer after new line terminator.
StringView strFindNl(const StringView& _str);
- /// Find end of line. Retuns pointer to new line terminator.
+ /// Find end of line. Returns pointer to new line terminator.
StringView strFindEol(const StringView& _str);
/// Returns StringView of word or empty.
@@ -314,10 +310,6 @@ namespace bx
template <typename Ty>
void stringPrintf(Ty& _out, const char* _format, ...);
- /// Replace all instances of substring.
- template <typename Ty>
- Ty replaceAll(const Ty& _str, const char* _from, const char* _to);
-
/// Convert size in bytes to human readable string kibi units.
int32_t prettify(char* _out, int32_t _count, uint64_t _value, Units::Enum _units = Units::Kibi);
@@ -359,7 +351,7 @@ namespace bx
{
public:
///
- LineReader(const bx::StringView& _str);
+ LineReader(const StringView& _str);
///
void reset();
@@ -374,8 +366,8 @@ namespace bx
uint32_t getLine() const;
private:
- const bx::StringView m_str;
- bx::StringView m_curr;
+ const StringView m_str;
+ StringView m_curr;
uint32_t m_line;
};
diff --git a/3rdparty/bx/include/bx/thread.h b/3rdparty/bx/include/bx/thread.h
index 10d11cbfd1f..25a18070b24 100644
--- a/3rdparty/bx/include/bx/thread.h
+++ b/3rdparty/bx/include/bx/thread.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_THREAD_H_HEADER_GUARD
@@ -21,7 +21,6 @@ namespace bx
{
BX_CLASS(Thread
, NO_COPY
- , NO_ASSIGNMENT
);
public:
diff --git a/3rdparty/bx/include/bx/timer.h b/3rdparty/bx/include/bx/timer.h
index 3ff8ed5e747..c860777c510 100644
--- a/3rdparty/bx/include/bx/timer.h
+++ b/3rdparty/bx/include/bx/timer.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_TIMER_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/typetraits.h b/3rdparty/bx/include/bx/typetraits.h
new file mode 100644
index 00000000000..9c301f617ea
--- /dev/null
+++ b/3rdparty/bx/include/bx/typetraits.h
@@ -0,0 +1,285 @@
+/*
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
+ */
+
+#ifndef BX_TYPETRAITS_H_HEADER_GUARD
+#define BX_TYPETRAITS_H_HEADER_GUARD
+
+namespace bx
+{
+ /// Returns true if type `Ty` is array type with known bound, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isBoundedArray();
+
+ /// Returns true if type `Ty` is array type with unknown bound, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isUnboundedArray();
+
+ /// Returns true if type `Ty` is array type (bounded, or unbounded array), otherwise returns false.
+ template<typename Ty>
+ constexpr bool isArray();
+
+ /// Returns true if type `Ty` is enumeration type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isEnum();
+
+ /// Returns true if type `Ty` is union type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isUnion();
+
+ /// Returns true if type `Ty` is non-union class type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isClass();
+
+ /// Returns true if type `Ty` is abstract class type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isAbstract();
+
+ /// Returns true if type `Ty` is aggregate class type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isAggregate();
+
+ /// Returns true if type `DerivedT` is derived from `BaseT` type, or if both are the same
+ /// non-union type, otherwise returns false.
+ template<typename BaseT, typename DerivedT>
+ constexpr bool isBaseOf();
+
+ /// Returns true if type `Ty` is polymorphic class (if it has virtual function table) type,
+ /// otherwise returns false.
+ template<typename Ty>
+ constexpr bool isPolymorphic();
+
+ /// Returns true if type `Ty` has virtual destructor, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isDestructorVirtual();
+
+ /// Returns true if type `Ty` is class type with final specifier, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isFinal();
+
+ /// Returns true if type `Ty` is non-union class type with no non-static
+ /// members (a.k.a. sizeof(Ty) is zero), otherwise returns false.
+ template<typename Ty>
+ constexpr bool isEmpty();
+
+ /// Returns true if type `Ty` is standard-layout type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isStandardLayout();
+
+ /// Returns true if type `Ty` is trivial type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isTrivial();
+
+ /// Returns true if type `Ty` is POD (standard-layout, and trivial type), otherwise returns false.
+ template<typename Ty>
+ constexpr bool isPod();
+
+ /// Returns true if type `FromT` can be assigned to type `Ty`, otherwise returns false.
+ template<typename Ty, typename FromT>
+ constexpr bool isAssignable();
+
+ /// Returns true if type `Ty` has copy assignment operator, otherwise returns false.
+ template<typename Ty, typename Uy>
+ constexpr bool isCopyAssignable();
+
+ /// Returns true if type `Ty` has move assignment operator, otherwise returns false.
+ template<typename Ty, typename Uy>
+ constexpr bool isMoveAssignable();
+
+ /// Returns true if type `FromT` can be trivially assigned to type `Ty`, otherwise returns false.
+ template<typename Ty, typename FromT>
+ constexpr bool isTriviallyAssignable();
+
+ /// Returns true if type `Ty` is trivially copy-assignable type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isTriviallyCopyAssignable();
+
+ /// Returns true if type `Ty` is trivially move-assignable type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isTriviallyMoveAssignable();
+
+ /// Returns true if type `Ty` is constructible when the specified argument types are used,
+ /// otherwise returns false.
+ template<typename Ty, typename... ArgsT>
+ constexpr bool isConstructible();
+
+ /// Returns true if type `Ty` has copy constructor, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isCopyConstructible();
+
+ /// Returns true if type `Ty` has move constructor, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isMoveConstructible();
+
+ /// Returns true if type `Ty` is trivially constructible when the specified argument types are used,
+ /// otherwise returns false.
+ template<typename T, typename... ArgsT>
+ constexpr bool isTriviallyConstructible();
+
+ /// Returns true if type `Ty` has trivial copy constructor, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isTriviallyCopyConstructible();
+
+ /// Returns true if type `Ty` has trivial move constructor, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isTriviallyMoveConstructible();
+
+ /// Returns true if type `Ty` is trivially copyable / POD type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isTriviallyCopyable();
+
+ /// Returns true if type `Ty` has trivial destructor, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isTriviallyDestructible();
+
+ /// Returns true if type `Ty` is const-qualified type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isConst();
+
+ /// Returns true if type `Ty` is volatile-qualified type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isVolatile();
+
+ /// Returns true if type `Ty` is an reference type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isReference();
+
+ /// Returns true if type `Ty` is an Lvalue reference type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isLvalueReference();
+
+ /// Returns true if type `Ty` is an Rvalue reference type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isRvalueReference();
+
+ /// Returns true if type `Ty` is an pointer type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isPointer();
+
+ /// Returns true if type `Ty` is signed integer or floating-point type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isSigned();
+
+ /// Returns true if type `Ty` is unsigned integer type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isUnsigned();
+
+ /// Returns true if type `Ty` is integer type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isInteger();
+
+ /// Returns true if type `Ty` is floating-point type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isFloatingPoint();
+
+ /// Returns true if type `Ty` is arithmetic type, otherwise returns false.
+ template<typename Ty>
+ constexpr bool isArithmetic();
+
+ /// Returns true if type `Ty` and type `Uy` are the same type, otherwise returns false.
+ template<typename Ty, typename Uy>
+ constexpr bool isSame();
+
+} // namespace bx
+
+#include "inline/typetraits.inl"
+
+namespace bx
+{
+ /// Compile-time constant of specified type `Ty` with specified value `ValueT`.
+ template<typename Ty, Ty ValueT>
+ struct IntegralConstantT;
+
+ /// Alias of IntegralConstantT<bool, bool ValueT>.
+ template<bool BoolT>
+ using BoolConstantT = IntegralConstantT<bool, BoolT>;
+
+ /// Alias of BoolConstantT<bool, false>.
+ using FalseConstant = BoolConstantT<false>;
+
+ /// Alias of BoolConstantT<bool, true>.
+ using TrueConstant = BoolConstantT<true>;
+
+ /// Provides the member `Type` that names `Ty`.
+ template<typename Ty>
+ using TypeIdentityType = typename TypeIdentityT<Ty>::Type;
+
+ /// Conditionally selects `Ty` if `BoolT` is true, otherwise selects `Uy` type.
+ template<bool BoolT, typename Ty, typename Uy>
+ using ConditionalType = typename ConditionalT<BoolT, Ty, Uy>::Type;
+
+ /// If `BoolT` condition is true it provides `Ty` as `Type`, otherwise `Type` is undefined.
+ template<bool BoolT, typename Ty>
+ using EnableIfType = typename EnableIfT<BoolT, Ty>::Type;
+
+ /// If `Ty` is an object type or a function type that has no cv- or ref- qualifier, provides
+ /// a member `Type` which is `Ty&`. If `Ty` is an Rvalue reference to some type `Uy`, then
+ /// type is `Uy&`, otherwise type is `Ty`.
+ template<typename Ty>
+ using AddLvalueReferenceType = typename AddLvalueReferenceT<Ty>::Type;
+
+ /// If `Ty` is an object type or a function type that has no cv- or ref- qualifier, provides
+ /// a member `Type` which is `Ty&&`, otherwise type is `Ty`.
+ template<typename Ty>
+ using AddRvalueReferenceType = typename AddRvalueReferenceT<Ty>::Type;
+
+ /// If the type `Ty` is a reference type, provides the member typedef `Type`
+ /// which is the type referred to by `Ty`, otherwise type is `Ty`.
+ template<typename Ty>
+ using RemoveReferenceType = typename RemoveReferenceT<Ty>::Type;
+
+ /// If the type `Ty` is a reference type, provides the member typedef `Type`
+ /// which is a pointer to the referred type.
+ template<typename Ty>
+ using AddPointerType = typename AddPointerT<Ty>::Type;
+
+ /// If the type `Ty` is a pointer type, provides the member typedef `Type`
+ /// which is the type pointed to by `Ty`, otherwise type is `Ty`.
+ template<typename Ty>
+ using RemovePointerType = typename RemovePointerT<Ty>::Type;
+
+ /// Adds both `const`, and `volatile` to type `Ty`.
+ template<typename Ty>
+ using AddCvType = typename AddCvT<Ty>::Type;
+
+ /// Removes the topmost `const`, or the topmost `volatile`, or both, from type `Ty` if present.
+ template<typename Ty>
+ using RemoveCvType = typename RemoveCvT<Ty>::Type;
+
+ /// Adds `const` to type `Ty`.
+ template<typename Ty>
+ using AddConstType = typename AddConstT<Ty>::Type;
+
+ /// Removes the topmost `const` from type `Ty` if present.
+ template<typename Ty>
+ using RemoveConstType = typename RemoveConstT<Ty>::Type;
+
+ /// Adds `volatile` to type `Ty`.
+ template<typename Ty>
+ using AddVolatileType = typename AddVolatileT<Ty>::Type;
+
+ /// Removes the topmost `volatile` from type `Ty` if present.
+ template<typename Ty>
+ using RemoveVolatileType = typename RemoveVolatileT<Ty>::Type;
+
+ /// Removes reference from type `Ty` if present.
+ template<typename Ty>
+ constexpr RemoveReferenceType<Ty>&& move(Ty&& _a);
+
+ /// Forwards Lvalues as either Lvalues or as Rvalues.
+ template<typename Ty>
+ constexpr Ty&& forward(RemoveReferenceType<Ty>& _type);
+
+ /// Forwards Rvalues as Rvalues and prohibits forwarding of Rvalues as Lvalues.
+ template<typename Ty>
+ constexpr Ty&& forward(RemoveReferenceT<Ty>&& _type);
+
+ /// Converts any type `Ty` to a reference type, making it possible to use member functions
+ /// in decltype expressions without the need to go through constructors.
+ template<typename Ty>
+ AddRvalueReferenceType<Ty> declVal();
+
+} // namespace bx
+
+#endif // BX_TYPETRAITS_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/bx/uint32_t.h b/3rdparty/bx/include/bx/uint32_t.h
index 6053cdfdab6..cff793e0d2c 100644
--- a/3rdparty/bx/include/bx/uint32_t.h
+++ b/3rdparty/bx/include/bx/uint32_t.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_UINT32_T_H_HEADER_GUARD
@@ -252,40 +252,40 @@ namespace bx
BX_CONSTEXPR_FUNC uint32_t strideAlign(uint32_t _offset, uint32_t _stride);
///
- template <typename Ty>
- bool isAligned(Ty _a, int32_t _align);
+ template<typename Ty>
+ BX_CONSTEXPR_FUNC bool isAligned(Ty _a, int32_t _align);
///
- template <typename Ty>
- bool isAligned(void* _ptr, int32_t _align);
+ template<typename Ty>
+ BX_CONSTEXPR_FUNC bool isAligned(Ty* _ptr, int32_t _align);
///
- template <typename Ty>
- bool isAligned(const void* _ptr, int32_t _align);
+ template<typename Ty>
+ BX_CONSTEXPR_FUNC bool isAligned(const Ty* _ptr, int32_t _align);
///
- template <typename Ty>
- Ty alignDown(Ty _a, int32_t _align);
+ template<typename Ty>
+ BX_CONSTEXPR_FUNC Ty alignDown(Ty _a, int32_t _align);
///
- template <typename Ty>
- Ty* alignDown(Ty* _ptr, int32_t _align);
+ template<typename Ty>
+ BX_CONSTEXPR_FUNC Ty* alignDown(Ty* _ptr, int32_t _align);
///
- template <typename Ty>
- const Ty* alignDown(const Ty* _ptr, int32_t _align);
+ template<typename Ty>
+ BX_CONSTEXPR_FUNC const Ty* alignDown(const Ty* _ptr, int32_t _align);
///
- template <typename Ty>
- Ty alignUp(Ty _a, int32_t _align);
+ template<typename Ty>
+ BX_CONSTEXPR_FUNC Ty alignUp(Ty _a, int32_t _align);
///
- template <typename Ty>
- Ty* alignUp(Ty* _ptr, int32_t _align);
+ template<typename Ty>
+ BX_CONSTEXPR_FUNC Ty* alignUp(Ty* _ptr, int32_t _align);
///
- template <typename Ty>
- const Ty* alignUp(const Ty* _ptr, int32_t _align);
+ template<typename Ty>
+ BX_CONSTEXPR_FUNC const Ty* alignUp(const Ty* _ptr, int32_t _align);
/// Convert float to half-float.
///
diff --git a/3rdparty/bx/include/bx/url.h b/3rdparty/bx/include/bx/url.h
index 769b3c8db84..b2b45405fe3 100644
--- a/3rdparty/bx/include/bx/url.h
+++ b/3rdparty/bx/include/bx/url.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef BX_URL_H_HEADER_GUARD
diff --git a/3rdparty/bx/include/compat/linux/sal.h b/3rdparty/bx/include/compat/linux/sal.h
new file mode 100644
index 00000000000..23c9fc084c0
--- /dev/null
+++ b/3rdparty/bx/include/compat/linux/sal.h
@@ -0,0 +1 @@
+#include "../mingw/salieri.h"
diff --git a/3rdparty/bx/include/compat/mingw/salieri.h b/3rdparty/bx/include/compat/mingw/salieri.h
index 06d72075c3f..5942b397f32 100644
--- a/3rdparty/bx/include/compat/mingw/salieri.h
+++ b/3rdparty/bx/include/compat/mingw/salieri.h
@@ -1598,6 +1598,22 @@
# define SALIERI_DEFINED_String_length
#endif
+#if defined(_In_count_) && defined(SALIERI_DEFINED_In_count_)
+# undef _In_count_
+#endif
+#if !defined(_In_count_)
+# define _In_count_(param)
+# define SALIERI_DEFINED_In_count_
+#endif
+
+#if defined(_In_opt_count_) && defined(SALIERI_DEFINED_In_opt_count_)
+# undef _In_opt_count_
+#endif
+#if !defined(_In_opt_count_)
+# define _In_opt_count_(param)
+# define SALIERI_DEFINED_In_opt_count_
+#endif
+
#if defined(SALIERI_VERSION)
# undef SALIERI_VERSION
#endif
diff --git a/3rdparty/bx/makefile b/3rdparty/bx/makefile
index 43675305b7f..e9b00eb6331 100644
--- a/3rdparty/bx/makefile
+++ b/3rdparty/bx/makefile
@@ -1,6 +1,6 @@
#
-# Copyright 2011-2021 Branimir Karadzic. All rights reserved.
-# License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+# Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+# License: https://github.com/bkaradzic/bx/blob/master/LICENSE
#
GENIE=../bx/tools/bin/$(OS)/genie
@@ -96,6 +96,14 @@ osx-x64-release: .build/projects/gmake-osx-x64
make -C .build/projects/gmake-osx config=release
osx-x64: osx-x64-debug osx-x64-release
+.build/projects/gmake-osx-arm64:
+ $(GENIE) --gcc=osx-arm64 gmake
+osx-arm64-debug: .build/projects/gmake-osx-arm64
+ make -C .build/projects/gmake-osx-arm64 config=debug
+osx-arm64-release: .build/projects/gmake-osx-arm64
+ make -C .build/projects/gmake-osx-arm64 config=release
+osx-arm64: osx-arm64-debug osx-arm64-release
+
.build/projects/gmake-ios-arm:
$(GENIE) --gcc=ios-arm gmake
ios-arm-debug: .build/projects/gmake-ios-arm
diff --git a/3rdparty/bx/scripts/bin2c.lua b/3rdparty/bx/scripts/bin2c.lua
index 3ebc0014629..9e9e4866964 100644
--- a/3rdparty/bx/scripts/bin2c.lua
+++ b/3rdparty/bx/scripts/bin2c.lua
@@ -1,23 +1,17 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bx/blob/master/LICENSE
--
project "bin2c"
kind "ConsoleApp"
- includedirs {
- "../include",
- }
-
files {
"../tools/bin2c/**.cpp",
"../tools/bin2c/**.h",
}
- links {
- "bx",
- }
+ using_bx()
configuration { "mingw-*" }
targetextension ".exe"
@@ -26,6 +20,10 @@ project "bin2c"
links {
"pthread",
}
+ configuration { "osx-*" }
+ linkoptions {
+ "-framework Foundation"
+ }
configuration { "vs20* or mingw*" }
links {
diff --git a/3rdparty/bx/scripts/bx.lua b/3rdparty/bx/scripts/bx.lua
index 1e54ac521fc..1bb5dc43d4b 100644
--- a/3rdparty/bx/scripts/bx.lua
+++ b/3rdparty/bx/scripts/bx.lua
@@ -1,6 +1,6 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bx/blob/master/LICENSE
--
local function userdefines()
@@ -15,6 +15,28 @@ local function userdefines()
return defines
end
+function using_bx()
+ includedirs {
+ path.join(BX_DIR, "include"),
+ }
+
+ links {
+ "bx",
+ }
+
+ configuration { "Debug" }
+ defines {
+ "BX_CONFIG_DEBUG=1",
+ }
+
+ configuration { "Release" }
+ defines {
+ "BX_CONFIG_DEBUG=0",
+ }
+
+ configuration {}
+end
+
project "bx"
kind "StaticLib"
@@ -32,11 +54,6 @@ project "bx"
defines (userdefines())
- configuration { "Debug" }
- defines {
- "BX_CONFIG_DEBUG=1",
- }
-
configuration { "linux-*" }
buildoptions {
"-fPIC",
@@ -47,6 +64,7 @@ project "bx"
if _OPTIONS["with-amalgamated"] then
excludes {
path.join(BX_DIR, "src/allocator.cpp"),
+ path.join(BX_DIR, "src/bounds.cpp"),
path.join(BX_DIR, "src/bx.cpp"),
path.join(BX_DIR, "src/commandline.cpp"),
path.join(BX_DIR, "src/crtnone.cpp"),
@@ -74,4 +92,14 @@ project "bx"
}
end
+ configuration { "Debug" }
+ defines {
+ "BX_CONFIG_DEBUG=1",
+ }
+
+ configuration { "Release" }
+ defines {
+ "BX_CONFIG_DEBUG=0",
+ }
+
configuration {}
diff --git a/3rdparty/bx/scripts/genie.lua b/3rdparty/bx/scripts/genie.lua
index 8801b224ad2..5a7b3281bd9 100644
--- a/3rdparty/bx/scripts/genie.lua
+++ b/3rdparty/bx/scripts/genie.lua
@@ -1,6 +1,6 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bx/blob/master/LICENSE
--
newoption {
@@ -51,19 +51,21 @@ project "bx.test"
}
includedirs {
- path.join(BX_DIR, "include"),
BX_THIRD_PARTY_DIR,
}
+ defines {
+ "CATCH_AMALGAMATED_CUSTOM_MAIN",
+ }
+
files {
+ path.join(BX_DIR, "3rdparty/catch/catch_amalgamated.cpp"),
path.join(BX_DIR, "tests/*_test.cpp"),
path.join(BX_DIR, "tests/*.h"),
path.join(BX_DIR, "tests/dbg.*"),
}
- links {
- "bx",
- }
+ using_bx()
configuration { "vs* or mingw*" }
links {
@@ -131,6 +133,16 @@ project "bx.bench"
"Cocoa.framework",
}
+ configuration { "Debug" }
+ defines {
+ "BX_CONFIG_DEBUG=1",
+ }
+
+ configuration { "Release" }
+ defines {
+ "BX_CONFIG_DEBUG=0",
+ }
+
configuration {}
strip()
diff --git a/3rdparty/bx/scripts/lemon.lua b/3rdparty/bx/scripts/lemon.lua
index b488896055d..fd51b88a67c 100644
--- a/3rdparty/bx/scripts/lemon.lua
+++ b/3rdparty/bx/scripts/lemon.lua
@@ -1,6 +1,6 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bx/blob/master/LICENSE
--
project "lemon"
diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua
index cb91d3ac750..964e58e3793 100644
--- a/3rdparty/bx/scripts/toolchain.lua
+++ b/3rdparty/bx/scripts/toolchain.lua
@@ -1,6 +1,6 @@
--
--- Copyright 2010-2021 Branimir Karadzic. All rights reserved.
--- License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+-- Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+-- License: https://github.com/bkaradzic/bx/blob/master/LICENSE
--
local bxDir = path.getabsolute("..")
@@ -42,6 +42,21 @@ local function crtNone()
configuration {}
end
+local android = {};
+
+local function androidToolchainRoot()
+ if android.toolchainRoot == nil then
+ local hostTags = {
+ windows = "windows-x86_64",
+ linux = "linux-x86_64",
+ macosx = "darwin-x86_64"
+ }
+ android.toolchainRoot = "$(ANDROID_NDK_ROOT)/toolchains/llvm/prebuilt/" .. hostTags[os.get()]
+ end
+
+ return android.toolchainRoot;
+end
+
function toolchain(_buildDir, _libDir)
newoption {
@@ -52,16 +67,17 @@ function toolchain(_buildDir, _libDir)
{ "android-arm", "Android - ARM" },
{ "android-arm64", "Android - ARM64" },
{ "android-x86", "Android - x86" },
+ { "android-x86_64", "Android - x86_64" },
{ "wasm2js", "Emscripten/Wasm2JS" },
{ "wasm", "Emscripten/Wasm" },
{ "freebsd", "FreeBSD" },
{ "linux-gcc", "Linux (GCC compiler)" },
{ "linux-gcc-afl", "Linux (GCC + AFL fuzzer)" },
- { "linux-gcc-6", "Linux (GCC-6 compiler)" },
{ "linux-clang", "Linux (Clang compiler)" },
{ "linux-clang-afl", "Linux (Clang + AFL fuzzer)" },
- { "linux-mips-gcc", "Linux (MIPS, GCC compiler)" },
{ "linux-arm-gcc", "Linux (ARM, GCC compiler)" },
+ { "linux-ppc64le-gcc", "Linux (PPC64LE, GCC compiler)" },
+ { "linux-ppc64le-clang", "Linux (PPC64LE, Clang compiler)" },
{ "ios-arm", "iOS - ARM" },
{ "ios-arm64", "iOS - ARM64" },
{ "ios-simulator", "iOS - Simulator" },
@@ -84,13 +100,7 @@ function toolchain(_buildDir, _libDir)
value = "toolset",
description = "Choose VS toolset",
allowed = {
- { "vs2012-clang", "Clang 3.6" },
- { "vs2013-clang", "Clang 3.6" },
- { "vs2015-clang", "Clang 3.9" },
{ "vs2017-clang", "Clang with MS CodeGen" },
- { "vs2012-xp", "Visual Studio 2012 targeting XP" },
- { "vs2013-xp", "Visual Studio 2013 targeting XP" },
- { "vs2015-xp", "Visual Studio 2015 targeting XP" },
{ "vs2017-xp", "Visual Studio 2017 targeting XP" },
{ "winstore100", "Universal Windows App 10.0" },
{ "durango", "Durango" },
@@ -112,7 +122,7 @@ function toolchain(_buildDir, _libDir)
newoption {
trigger = "with-android",
value = "#",
- description = "Set Android platform version (default: android-14).",
+ description = "Set Android platform version (default: android-24).",
}
newoption {
@@ -165,9 +175,9 @@ function toolchain(_buildDir, _libDir)
os.exit(1)
end
- local androidPlatform = "android-24"
+ local androidApiLevel = 24
if _OPTIONS["with-android"] then
- androidPlatform = "android-" .. _OPTIONS["with-android"]
+ androidApiLevel = _OPTIONS["with-android"]
end
local iosPlatform = ""
@@ -185,9 +195,11 @@ function toolchain(_buildDir, _libDir)
tvosPlatform = _OPTIONS["with-tvos"]
end
- local windowsPlatform = string.gsub(os.getenv("WindowsSDKVersion") or "8.1", "\\", "")
+ local windowsPlatform = nil
if _OPTIONS["with-windows"] then
windowsPlatform = _OPTIONS["with-windows"]
+ elseif nil ~= os.getenv("WindowsSDKVersion") then
+ windowsPlatform = string.gsub(os.getenv("WindowsSDKVersion"), "\\", "")
end
local compiler32bit = false
@@ -208,49 +220,17 @@ function toolchain(_buildDir, _libDir)
os.exit(1)
end
- if "android-arm" == _OPTIONS["gcc"] then
-
- if not os.getenv("ANDROID_NDK_ARM")
- or not os.getenv("ANDROID_NDK_CLANG")
- or not os.getenv("ANDROID_NDK_ROOT") then
- print("Set ANDROID_NDK_CLANG, ANDROID_NDK_ARM, and ANDROID_NDK_ROOT environment variables.")
- end
-
- premake.gcc.cc = "$(ANDROID_NDK_CLANG)/bin/clang"
- premake.gcc.cxx = "$(ANDROID_NDK_CLANG)/bin/clang++"
- premake.gcc.ar = "$(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-ar"
-
- premake.gcc.llvm = true
- location (path.join(_buildDir, "projects", _ACTION .. "-android-arm"))
-
- elseif "android-arm64" == _OPTIONS["gcc"] then
-
- if not os.getenv("ANDROID_NDK_ARM64")
- or not os.getenv("ANDROID_NDK_CLANG")
- or not os.getenv("ANDROID_NDK_ROOT") then
- print("Set ANDROID_NDK_CLANG, ANDROID_NDK_ARM64, and ANDROID_NDK_ROOT environment variables.")
- end
+ if "android-arm" == _OPTIONS["gcc"]
+ or "android-arm64" == _OPTIONS["gcc"]
+ or "android-x86" == _OPTIONS["gcc"]
+ or "android-x86_64" == _OPTIONS["gcc"] then
- premake.gcc.cc = "$(ANDROID_NDK_CLANG)/bin/clang"
- premake.gcc.cxx = "$(ANDROID_NDK_CLANG)/bin/clang++"
- premake.gcc.ar = "$(ANDROID_NDK_ARM64)/bin/aarch64-linux-android-ar"
+ premake.gcc.cc = androidToolchainRoot() .. "/bin/clang"
+ premake.gcc.cxx = androidToolchainRoot() .. "/bin/clang++"
+ premake.gcc.ar = androidToolchainRoot() .. "/bin/llvm-ar"
premake.gcc.llvm = true
- location (path.join(_buildDir, "projects", _ACTION .. "-android-arm64"))
-
- elseif "android-x86" == _OPTIONS["gcc"] then
-
- if not os.getenv("ANDROID_NDK_X86")
- or not os.getenv("ANDROID_NDK_CLANG")
- or not os.getenv("ANDROID_NDK_ROOT") then
- print("Set ANDROID_NDK_CLANG, ANDROID_NDK_X86, and ANDROID_NDK_ROOT environment variables.")
- end
-
- premake.gcc.cc = "$(ANDROID_NDK_CLANG)/bin/clang"
- premake.gcc.cxx = "$(ANDROID_NDK_CLANG)/bin/clang++"
- premake.gcc.ar = "$(ANDROID_NDK_X86)/bin/i686-linux-android-ar"
- premake.gcc.llvm = true
- location (path.join(_buildDir, "projects", _ACTION .. "-android-x86"))
+ location (path.join(_buildDir, "projects", _ACTION .. "-" .. _OPTIONS["gcc"]))
elseif "wasm2js" == _OPTIONS["gcc"] or "wasm" == _OPTIONS["gcc"] then
@@ -308,12 +288,6 @@ function toolchain(_buildDir, _libDir)
premake.gcc.ar = "ar"
location (path.join(_buildDir, "projects", _ACTION .. "-linux"))
- elseif "linux-gcc-6" == _OPTIONS["gcc"] then
- premake.gcc.cc = "gcc-6"
- premake.gcc.cxx = "g++-6"
- premake.gcc.ar = "ar"
- location (path.join(_buildDir, "projects", _ACTION .. "-linux"))
-
elseif "linux-clang" == _OPTIONS["gcc"] then
premake.gcc.cc = "clang"
premake.gcc.cxx = "clang++"
@@ -326,12 +300,19 @@ function toolchain(_buildDir, _libDir)
premake.gcc.ar = "ar"
location (path.join(_buildDir, "projects", _ACTION .. "-linux-clang"))
- elseif "linux-mips-gcc" == _OPTIONS["gcc"] then
- location (path.join(_buildDir, "projects", _ACTION .. "-linux-mips-gcc"))
-
elseif "linux-arm-gcc" == _OPTIONS["gcc"] then
location (path.join(_buildDir, "projects", _ACTION .. "-linux-arm-gcc"))
+ elseif "linux-ppc64le-gcc" == _OPTIONS["gcc"] then
+ location (path.join(_buildDir, "projects", _ACTION .. "-linux-ppc64le-gcc"))
+
+ elseif "linux-ppc64le-clang" == _OPTIONS["gcc"] then
+ premake.gcc.cc = "clang"
+ premake.gcc.cxx = "clang++"
+ premake.gcc.ar = "ar"
+ premake.gcc.llvm = true
+ location (path.join(_buildDir, "projects", _ACTION .. "-linux-ppc64le-clang"))
+
elseif "mingw-gcc" == _OPTIONS["gcc"] then
if not os.getenv("MINGW") then
print("Set MINGW environment variable.")
@@ -402,22 +383,20 @@ function toolchain(_buildDir, _libDir)
location (path.join(_buildDir, "projects", _ACTION .. "-riscv"))
end
- elseif _ACTION == "vs2012"
- or _ACTION == "vs2013"
- or _ACTION == "vs2015"
- or _ACTION == "vs2017"
+ elseif _ACTION == "vs2017"
or _ACTION == "vs2019"
+ or _ACTION == "vs2022"
then
local action = premake.action.current()
- action.vstudio.windowsTargetPlatformVersion = windowsPlatform
- action.vstudio.windowsTargetPlatformMinVersion = windowsPlatform
+ if nil ~= windowsPlatform then
+ action.vstudio.windowsTargetPlatformVersion = windowsPlatform
+ action.vstudio.windowsTargetPlatformMinVersion = windowsPlatform
+ end
if (_ACTION .. "-clang") == _OPTIONS["vs"] then
if "vs2017-clang" == _OPTIONS["vs"] then
premake.vstudio.toolset = "v141_clang_c2"
- elseif "vs2015-clang" == _OPTIONS["vs"] then
- premake.vstudio.toolset = "LLVM-vs2014"
else
premake.vstudio.toolset = ("LLVM-" .. _ACTION)
end
@@ -448,22 +427,6 @@ function toolchain(_buildDir, _libDir)
platforms { "Orbis" }
location (path.join(_buildDir, "projects", _ACTION .. "-orbis"))
- elseif ("vs2012-xp") == _OPTIONS["vs"] then
- premake.vstudio.toolset = ("v110_xp")
- location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
-
- elseif "vs2013-xp" == _OPTIONS["vs"] then
- premake.vstudio.toolset = ("v120_xp")
- location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
-
- elseif "vs2015-xp" == _OPTIONS["vs"] then
- premake.vstudio.toolset = ("v140_xp")
- location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
-
- elseif "vs2015-xp" == _OPTIONS["vs"] then
- premake.vstudio.toolset = ("v141_xp")
- location (path.join(_buildDir, "projects", _ACTION .. "-xp"))
-
end
elseif _ACTION and _ACTION:match("^xcode.+$") then
@@ -533,9 +496,9 @@ function toolchain(_buildDir, _libDir)
}
targetsuffix "Release"
- configuration { "qbs" }
- flags {
- "ExtraWarnings",
+ configuration { "*-clang" }
+ buildoptions {
+ "-Wno-tautological-constant-compare",
}
configuration { "vs*", "x32" }
@@ -559,14 +522,12 @@ function toolchain(_buildDir, _libDir)
"/wd4201", -- warning C4201: nonstandard extension used: nameless struct/union
"/wd4324", -- warning C4324: '': structure was padded due to alignment specifier
"/Ob2", -- The Inline Function Expansion
+ "/Zc:__cplusplus", -- Enable updated __cplusplus macro
}
linkoptions {
"/ignore:4221", -- LNK4221: This object file does not define any previously undefined public symbols, so it will not be used by any link operation that consumes this library
}
- configuration { "vs2008" }
- includedirs { path.join(bxDir, "include/compat/msvc/pre1600") }
-
configuration { "x32", "vs*" }
targetdir (path.join(_buildDir, "win32_" .. _ACTION, "bin"))
objdir (path.join(_buildDir, "win32_" .. _ACTION, "obj"))
@@ -698,20 +659,8 @@ function toolchain(_buildDir, _libDir)
}
buildoptions { "-m64" }
- configuration { "linux-clang" }
-
- configuration { "linux-gcc-6" }
- buildoptions {
--- "-fno-omit-frame-pointer",
--- "-fsanitize=address",
--- "-fsanitize=undefined",
--- "-fsanitize=float-divide-by-zero",
--- "-fsanitize=float-cast-overflow",
- }
- links {
--- "asan",
--- "ubsan",
- }
+ configuration { "linux-*" }
+ includedirs { path.join(bxDir, "include/compat/linux") }
configuration { "linux-gcc" }
buildoptions {
@@ -777,22 +726,6 @@ function toolchain(_buildDir, _libDir)
"-m64",
}
- configuration { "linux-mips-gcc" }
- targetdir (path.join(_buildDir, "linux32_mips_gcc/bin"))
- objdir (path.join(_buildDir, "linux32_mips_gcc/obj"))
- libdirs { path.join(_libDir, "lib/linux32_mips_gcc") }
- buildoptions {
- "-Wunused-value",
- "-Wundef",
- }
- links {
- "rt",
- "dl",
- }
- linkoptions {
- "-Wl,--gc-sections",
- }
-
configuration { "linux-arm-gcc" }
targetdir (path.join(_buildDir, "linux32_arm_gcc/bin"))
objdir (path.join(_buildDir, "linux32_arm_gcc/obj"))
@@ -814,14 +747,6 @@ function toolchain(_buildDir, _libDir)
flags {
"NoImportLib",
}
- includedirs {
- "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/include",
- "${ANDROID_NDK_ROOT}/sysroot/usr/include",
- "$(ANDROID_NDK_ROOT)/sources/android/native_app_glue",
- }
- linkoptions {
- "-nostdlib",
- }
links {
"c",
"dl",
@@ -829,9 +754,11 @@ function toolchain(_buildDir, _libDir)
"android",
"log",
"c++_shared",
- "gcc",
}
buildoptions {
+ "--gcc-toolchain=" .. androidToolchainRoot(),
+ "--sysroot=" .. androidToolchainRoot() .. "/sysroot",
+ "-DANDROID",
"-fPIC",
"-no-canonical-prefixes",
"-Wa,--noexecstack",
@@ -841,6 +768,8 @@ function toolchain(_buildDir, _libDir)
"-Wundef",
}
linkoptions {
+ "--gcc-toolchain=" .. androidToolchainRoot(),
+ "--sysroot=" .. androidToolchainRoot() .. "/sysroot",
"-no-canonical-prefixes",
"-Wl,--no-undefined",
"-Wl,-z,noexecstack",
@@ -851,85 +780,50 @@ function toolchain(_buildDir, _libDir)
configuration { "android-arm" }
targetdir (path.join(_buildDir, "android-arm/bin"))
objdir (path.join(_buildDir, "android-arm/obj"))
- libdirs {
- "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a",
- }
- includedirs {
- "$(ANDROID_NDK_ROOT)/sysroot/usr/include/arm-linux-androideabi",
- }
buildoptions {
- "-gcc-toolchain $(ANDROID_NDK_ARM)",
- "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm"),
- "-target armv7-none-linux-androideabi",
+ "--target=armv7-none-linux-android" .. androidApiLevel,
"-mthumb",
"-march=armv7-a",
"-mfloat-abi=softfp",
"-mfpu=neon",
- "-Wunused-value",
- "-Wundef",
}
linkoptions {
- "-gcc-toolchain $(ANDROID_NDK_ARM)",
- "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm"),
- path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm/usr/lib/crtbegin_so.o"),
- path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm/usr/lib/crtend_so.o"),
- "-target armv7-none-linux-androideabi",
+ "--target=armv7-none-linux-android" .. androidApiLevel,
"-march=armv7-a",
}
configuration { "android-arm64" }
targetdir (path.join(_buildDir, "android-arm64/bin"))
objdir (path.join(_buildDir, "android-arm64/obj"))
- libdirs {
- "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/arm64-v8a",
- }
- includedirs {
- "$(ANDROID_NDK_ROOT)/sysroot/usr/include/aarch64-linux-android",
- }
buildoptions {
- "-gcc-toolchain $(ANDROID_NDK_ARM64)",
- "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm64"),
- "-target aarch64-none-linux-androideabi",
- "-march=armv8-a",
- "-Wunused-value",
- "-Wundef",
+ "--target=aarch64-none-linux-android" .. androidApiLevel,
}
linkoptions {
- "-gcc-toolchain $(ANDROID_NDK_ARM64)",
- "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm64"),
- path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm64/usr/lib/crtbegin_so.o"),
- path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-arm64/usr/lib/crtend_so.o"),
- "-target aarch64-none-linux-androideabi",
- "-march=armv8-a",
+ "--target=aarch64-none-linux-android" .. androidApiLevel,
}
configuration { "android-x86" }
targetdir (path.join(_buildDir, "android-x86/bin"))
objdir (path.join(_buildDir, "android-x86/obj"))
- libdirs {
- "$(ANDROID_NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/x86",
- }
- includedirs {
- "$(ANDROID_NDK_ROOT)/sysroot/usr/include/x86_64-linux-android",
- }
buildoptions {
- "-gcc-toolchain $(ANDROID_NDK_X86)",
- "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86"),
- "-target i686-none-linux-android",
- "-march=i686",
+ "--target=i686-none-linux-android" .. androidApiLevel,
"-mtune=atom",
"-mstackrealign",
"-msse3",
"-mfpmath=sse",
- "-Wunused-value",
- "-Wundef",
}
linkoptions {
- "-gcc-toolchain $(ANDROID_NDK_X86)",
- "--sysroot=" .. path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86"),
- path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86/usr/lib/crtbegin_so.o"),
- path.join("$(ANDROID_NDK_ROOT)/platforms", androidPlatform, "arch-x86/usr/lib/crtend_so.o"),
- "-target i686-none-linux-android",
+ "--target=i686-none-linux-android" .. androidApiLevel,
+ }
+
+ configuration { "android-x86_64" }
+ targetdir (path.join(_buildDir, "android-x86_64/bin"))
+ objdir (path.join(_buildDir, "android-x86_64/obj"))
+ buildoptions {
+ "--target=x86_64-none-linux-android" .. androidApiLevel,
+ }
+ linkoptions {
+ "--target=x86_64-none-linux-android" .. androidApiLevel,
}
configuration { "wasm*" }
@@ -939,15 +833,40 @@ function toolchain(_buildDir, _libDir)
}
linkoptions {
- "-s MAX_WEBGL_VERSION=2"
+ "-s MAX_WEBGL_VERSION=2",
+ }
+
+ configuration { "linux-ppc64le*" }
+ buildoptions {
+ "-fsigned-char",
+ "-Wunused-value",
+ "-Wundef",
+ "-mcpu=power8",
+ }
+ links {
+ "rt",
+ "dl",
+ }
+ linkoptions {
+ "-Wl,--gc-sections",
}
+ configuration { "linux-ppc64le-gcc" }
+ targetdir (path.join(_buildDir, "linux_ppc64le_gcc/bin"))
+ objdir (path.join(_buildDir, "linux_ppc64le_gcc/obj"))
+ libdirs { path.join(_libDir, "lib/linux_ppc64le_gcc") }
+
+ configuration { "linux-ppc64le-clang" }
+ targetdir (path.join(_buildDir, "linux_ppc64le_clang/bin"))
+ objdir (path.join(_buildDir, "linux_ppc64le_clang/obj"))
+ libdirs { path.join(_libDir, "lib/linux_ppc64le_clang") }
+
configuration { "wasm2js" }
targetdir (path.join(_buildDir, "wasm2js/bin"))
objdir (path.join(_buildDir, "wasm2js/obj"))
libdirs { path.join(_libDir, "lib/wasm2js") }
linkoptions {
- "-s WASM=0"
+ "-s WASM=0",
}
configuration { "wasm" }
@@ -1222,22 +1141,10 @@ end
function strip()
- configuration { "android-arm", "Release" }
- postbuildcommands {
- "$(SILENT) echo Stripping symbols.",
- "$(SILENT) $(ANDROID_NDK_ARM)/bin/arm-linux-androideabi-strip -s \"$(TARGET)\""
- }
-
- configuration { "android-arm64", "Release" }
- postbuildcommands {
- "$(SILENT) echo Stripping symbols.",
- "$(SILENT) $(ANDROID_NDK_ARM64)/bin/aarch64-linux-android-strip -s \"$(TARGET)\""
- }
-
- configuration { "android-x86", "Release" }
+ configuration { "android-*", "Release" }
postbuildcommands {
"$(SILENT) echo Stripping symbols.",
- "$(SILENT) $(ANDROID_NDK_X86)/bin/i686-linux-android-strip -s \"$(TARGET)\""
+ "$(SILENT) " .. androidToolchainRoot() .. "/bin/llvm-strip -s \"$(TARGET)\""
}
configuration { "linux-* or rpi", "Release" }
diff --git a/3rdparty/bx/src/allocator.cpp b/3rdparty/bx/src/allocator.cpp
index 0bcf2cd43c7..203631f6009 100644
--- a/3rdparty/bx/src/allocator.cpp
+++ b/3rdparty/bx/src/allocator.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/allocator.h>
#include <malloc.h>
@@ -38,7 +37,7 @@ namespace bx
BX_UNUSED(_file, _line);
_aligned_free(_ptr);
# else
- bx::alignedFree(this, _ptr, _align, _file, _line);
+ alignedFree(this, _ptr, _align, _file, _line);
# endif // BX_
}
@@ -55,7 +54,7 @@ namespace bx
BX_UNUSED(_file, _line);
return _aligned_malloc(_size, _align);
# else
- return bx::alignedAlloc(this, _size, _align, _file, _line);
+ return alignedAlloc(this, _size, _align, _file, _line);
# endif // BX_
}
@@ -68,7 +67,7 @@ namespace bx
BX_UNUSED(_file, _line);
return _aligned_realloc(_ptr, _size, _align);
# else
- return bx::alignedRealloc(this, _ptr, _size, _align, _file, _line);
+ return alignedRealloc(this, _ptr, _size, _align, _file, _line);
# endif // BX_
}
diff --git a/3rdparty/bx/src/amalgamated.cpp b/3rdparty/bx/src/amalgamated.cpp
index 4aeac822870..037418a5717 100644
--- a/3rdparty/bx/src/amalgamated.cpp
+++ b/3rdparty/bx/src/amalgamated.cpp
@@ -1,9 +1,10 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "allocator.cpp"
+#include "bounds.cpp"
#include "bx.cpp"
#include "commandline.cpp"
#include "crtnone.cpp"
diff --git a/3rdparty/bx/src/bounds.cpp b/3rdparty/bx/src/bounds.cpp
new file mode 100644
index 00000000000..d7068fe42b0
--- /dev/null
+++ b/3rdparty/bx/src/bounds.cpp
@@ -0,0 +1,2039 @@
+/*
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
+ */
+
+#include <bx/rng.h>
+#include <bx/math.h>
+#include <bx/bounds.h>
+
+namespace bx
+{
+ Vec3 getCenter(const Aabb& _aabb)
+ {
+ return mul(add(_aabb.min, _aabb.max), 0.5f);
+ }
+
+ Vec3 getExtents(const Aabb& _aabb)
+ {
+ return mul(sub(_aabb.max, _aabb.min), 0.5f);
+ }
+
+ Vec3 getCenter(const Triangle& _triangle)
+ {
+ return mul(add(add(_triangle.v0, _triangle.v1), _triangle.v2), 1.0f/3.0f);
+ }
+
+ void toAabb(Aabb& _outAabb, const Vec3& _extents)
+ {
+ _outAabb.min = neg(_extents);
+ _outAabb.max = _extents;
+ }
+
+ void toAabb(Aabb& _outAabb, const Vec3& _center, const Vec3& _extents)
+ {
+ _outAabb.min = sub(_center, _extents);
+ _outAabb.max = add(_center, _extents);
+ }
+
+ void toAabb(Aabb& _outAabb, const Cylinder& _cylinder)
+ {
+ // Reference(s):
+ // - https://web.archive.org/web/20181113055756/http://iquilezles.org/www/articles/diskbbox/diskbbox.htm
+ //
+ const Vec3 axis = sub(_cylinder.end, _cylinder.pos);
+ const Vec3 asq = mul(axis, axis);
+ const Vec3 nsq = mul(asq, 1.0f/dot(axis, axis) );
+ const Vec3 tmp = sub(Vec3(1.0f), nsq);
+
+ const float inv = 1.0f/(tmp.x*tmp.y*tmp.z);
+
+ const Vec3 extent =
+ {
+ _cylinder.radius * tmp.x * sqrt( (nsq.x + nsq.y * nsq.z) * inv),
+ _cylinder.radius * tmp.y * sqrt( (nsq.y + nsq.z * nsq.x) * inv),
+ _cylinder.radius * tmp.z * sqrt( (nsq.z + nsq.x * nsq.y) * inv),
+ };
+
+ const Vec3 minP = sub(_cylinder.pos, extent);
+ const Vec3 minE = sub(_cylinder.end, extent);
+ const Vec3 maxP = add(_cylinder.pos, extent);
+ const Vec3 maxE = add(_cylinder.end, extent);
+
+ _outAabb.min = min(minP, minE);
+ _outAabb.max = max(maxP, maxE);
+ }
+
+ void toAabb(Aabb& _outAabb, const Disk& _disk)
+ {
+ // Reference(s):
+ // - https://web.archive.org/web/20181113055756/http://iquilezles.org/www/articles/diskbbox/diskbbox.htm
+ //
+ const Vec3 nsq = mul(_disk.normal, _disk.normal);
+ const Vec3 one = { 1.0f, 1.0f, 1.0f };
+ const Vec3 tmp = sub(one, nsq);
+ const float inv = 1.0f / (tmp.x*tmp.y*tmp.z);
+
+ const Vec3 extent =
+ {
+ _disk.radius * tmp.x * sqrt( (nsq.x + nsq.y * nsq.z) * inv),
+ _disk.radius * tmp.y * sqrt( (nsq.y + nsq.z * nsq.x) * inv),
+ _disk.radius * tmp.z * sqrt( (nsq.z + nsq.x * nsq.y) * inv),
+ };
+
+ _outAabb.min = sub(_disk.center, extent);
+ _outAabb.max = add(_disk.center, extent);
+ }
+
+ void toAabb(Aabb& _outAabb, const Obb& _obb)
+ {
+ Vec3 xyz = { 1.0f, 1.0f, 1.0f };
+ Vec3 tmp = mul(xyz, _obb.mtx);
+
+ _outAabb.min = tmp;
+ _outAabb.max = tmp;
+
+ for (uint32_t ii = 1; ii < 8; ++ii)
+ {
+ xyz.x = ii & 1 ? -1.0f : 1.0f;
+ xyz.y = ii & 2 ? -1.0f : 1.0f;
+ xyz.z = ii & 4 ? -1.0f : 1.0f;
+ tmp = mul(xyz, _obb.mtx);
+
+ _outAabb.min = min(_outAabb.min, tmp);
+ _outAabb.max = max(_outAabb.max, tmp);
+ }
+ }
+
+ void toAabb(Aabb& _outAabb, const Sphere& _sphere)
+ {
+ const float radius = _sphere.radius;
+ _outAabb.min = sub(_sphere.center, radius);
+ _outAabb.max = add(_sphere.center, radius);
+ }
+
+ void toAabb(Aabb& _outAabb, const Triangle& _triangle)
+ {
+ _outAabb.min = min(_triangle.v0, _triangle.v1, _triangle.v2);
+ _outAabb.max = max(_triangle.v0, _triangle.v1, _triangle.v2);
+ }
+
+ void aabbTransformToObb(Obb& _obb, const Aabb& _aabb, const float* _mtx)
+ {
+ toObb(_obb, _aabb);
+ float result[16];
+ mtxMul(result, _obb.mtx, _mtx);
+ memCopy(_obb.mtx, result, sizeof(result) );
+ }
+
+ void toAabb(Aabb& _outAabb, const void* _vertices, uint32_t _numVertices, uint32_t _stride)
+ {
+ Vec3 mn(init::None);
+ Vec3 mx(init::None);
+ uint8_t* vertex = (uint8_t*)_vertices;
+
+ mn = mx = load<Vec3>(vertex);
+ vertex += _stride;
+
+ for (uint32_t ii = 1; ii < _numVertices; ++ii)
+ {
+ const Vec3 pos = load<Vec3>(vertex);
+ vertex += _stride;
+
+ mn = min(pos, mn);
+ mx = max(pos, mx);
+ }
+
+ _outAabb.min = mn;
+ _outAabb.max = mx;
+ }
+
+ void toAabb(Aabb& _outAabb, const float* _mtx, const void* _vertices, uint32_t _numVertices, uint32_t _stride)
+ {
+ Vec3 mn(init::None);
+ Vec3 mx(init::None);
+ uint8_t* vertex = (uint8_t*)_vertices;
+ mn = mx = mul(load<Vec3>(vertex), _mtx);
+
+ vertex += _stride;
+
+ for (uint32_t ii = 1; ii < _numVertices; ++ii)
+ {
+ Vec3 pos = mul(load<Vec3>(vertex), _mtx);
+ vertex += _stride;
+
+ mn = min(pos, mn);
+ mx = max(pos, mx);
+ }
+
+ _outAabb.min = mn;
+ _outAabb.max = mx;
+ }
+
+ float calcAreaAabb(const Aabb& _aabb)
+ {
+ const float ww = _aabb.max.x - _aabb.min.x;
+ const float hh = _aabb.max.y - _aabb.min.y;
+ const float dd = _aabb.max.z - _aabb.min.z;
+ return 2.0f * (ww*hh + ww*dd + hh*dd);
+ }
+
+ void aabbExpand(Aabb& _outAabb, float _factor)
+ {
+ _outAabb.min.x -= _factor;
+ _outAabb.min.y -= _factor;
+ _outAabb.min.z -= _factor;
+ _outAabb.max.x += _factor;
+ _outAabb.max.y += _factor;
+ _outAabb.max.z += _factor;
+ }
+
+ void aabbExpand(Aabb& _outAabb, const Vec3& _pos)
+ {
+ _outAabb.min = min(_outAabb.min, _pos);
+ _outAabb.max = max(_outAabb.max, _pos);
+ }
+
+ void toObb(Obb& _outObb, const Aabb& _aabb)
+ {
+ memSet(_outObb.mtx, 0, sizeof(_outObb.mtx) );
+ _outObb.mtx[ 0] = (_aabb.max.x - _aabb.min.x) * 0.5f;
+ _outObb.mtx[ 5] = (_aabb.max.y - _aabb.min.y) * 0.5f;
+ _outObb.mtx[10] = (_aabb.max.z - _aabb.min.z) * 0.5f;
+ _outObb.mtx[12] = (_aabb.min.x + _aabb.max.x) * 0.5f;
+ _outObb.mtx[13] = (_aabb.min.y + _aabb.max.y) * 0.5f;
+ _outObb.mtx[14] = (_aabb.min.z + _aabb.max.z) * 0.5f;
+ _outObb.mtx[15] = 1.0f;
+ }
+
+ void calcObb(Obb& _outObb, const void* _vertices, uint32_t _numVertices, uint32_t _stride, uint32_t _steps)
+ {
+ Aabb aabb;
+ toAabb(aabb, _vertices, _numVertices, _stride);
+ float minArea = calcAreaAabb(aabb);
+
+ Obb best;
+ toObb(best, aabb);
+
+ float angleStep = float(kPiHalf/_steps);
+ float ax = 0.0f;
+ float mtx[16];
+
+ for (uint32_t ii = 0; ii < _steps; ++ii)
+ {
+ float ay = 0.0f;
+
+ for (uint32_t jj = 0; jj < _steps; ++jj)
+ {
+ float az = 0.0f;
+
+ for (uint32_t kk = 0; kk < _steps; ++kk)
+ {
+ mtxRotateXYZ(mtx, ax, ay, az);
+
+ float mtxT[16];
+ mtxTranspose(mtxT, mtx);
+ toAabb(aabb, mtxT, _vertices, _numVertices, _stride);
+
+ float area = calcAreaAabb(aabb);
+ if (area < minArea)
+ {
+ minArea = area;
+ aabbTransformToObb(best, aabb, mtx);
+ }
+
+ az += angleStep;
+ }
+
+ ay += angleStep;
+ }
+
+ ax += angleStep;
+ }
+
+ memCopy(&_outObb, &best, sizeof(Obb) );
+ }
+
+ void calcMaxBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _numVertices, uint32_t _stride)
+ {
+ Aabb aabb;
+ toAabb(aabb, _vertices, _numVertices, _stride);
+
+ Vec3 center = getCenter(aabb);
+
+ float maxDistSq = 0.0f;
+ uint8_t* vertex = (uint8_t*)_vertices;
+
+ for (uint32_t ii = 0; ii < _numVertices; ++ii)
+ {
+ const Vec3& pos = load<Vec3>(vertex);
+ vertex += _stride;
+
+ const Vec3 tmp = sub(pos, center);
+ const float distSq = dot(tmp, tmp);
+ maxDistSq = max(distSq, maxDistSq);
+ }
+
+ _sphere.center = center;
+ _sphere.radius = sqrt(maxDistSq);
+ }
+
+ void calcMinBoundingSphere(Sphere& _sphere, const void* _vertices, uint32_t _numVertices, uint32_t _stride, float _step)
+ {
+ RngMwc rng;
+
+ uint8_t* vertex = (uint8_t*)_vertices;
+
+ Vec3 center(init::None);
+ float* position = (float*)&vertex[0];
+ center.x = position[0];
+ center.y = position[1];
+ center.z = position[2];
+
+ position = (float*)&vertex[1*_stride];
+ center.x += position[0];
+ center.y += position[1];
+ center.z += position[2];
+
+ center.x *= 0.5f;
+ center.y *= 0.5f;
+ center.z *= 0.5f;
+
+ float xx = position[0] - center.x;
+ float yy = position[1] - center.y;
+ float zz = position[2] - center.z;
+ float maxDistSq = xx*xx + yy*yy + zz*zz;
+
+ float radiusStep = _step * 0.37f;
+
+ bool done;
+ do
+ {
+ done = true;
+ for (uint32_t ii = 0, index = rng.gen()%_numVertices; ii < _numVertices; ++ii, index = (index + 1)%_numVertices)
+ {
+ position = (float*)&vertex[index*_stride];
+
+ xx = position[0] - center.x;
+ yy = position[1] - center.y;
+ zz = position[2] - center.z;
+ float distSq = xx*xx + yy*yy + zz*zz;
+
+ if (distSq > maxDistSq)
+ {
+ done = false;
+
+ center.x += xx * radiusStep;
+ center.y += yy * radiusStep;
+ center.z += zz * radiusStep;
+ maxDistSq = lerp(maxDistSq, distSq, _step);
+
+ break;
+ }
+ }
+
+ } while (!done);
+
+ _sphere.center = center;
+ _sphere.radius = sqrt(maxDistSq);
+ }
+
+ void buildFrustumPlanes(Plane* _result, const float* _viewProj)
+ {
+ const float xw = _viewProj[ 3];
+ const float yw = _viewProj[ 7];
+ const float zw = _viewProj[11];
+ const float ww = _viewProj[15];
+
+ const float xz = _viewProj[ 2];
+ const float yz = _viewProj[ 6];
+ const float zz = _viewProj[10];
+ const float wz = _viewProj[14];
+
+ Plane& near = _result[0];
+ Plane& far = _result[1];
+ Plane& left = _result[2];
+ Plane& right = _result[3];
+ Plane& top = _result[4];
+ Plane& bottom = _result[5];
+
+ near.normal.x = xw - xz;
+ near.normal.y = yw - yz;
+ near.normal.z = zw - zz;
+ near.dist = ww - wz;
+
+ far.normal.x = xw + xz;
+ far.normal.y = yw + yz;
+ far.normal.z = zw + zz;
+ far.dist = ww + wz;
+
+ const float xx = _viewProj[ 0];
+ const float yx = _viewProj[ 4];
+ const float zx = _viewProj[ 8];
+ const float wx = _viewProj[12];
+
+ left.normal.x = xw - xx;
+ left.normal.y = yw - yx;
+ left.normal.z = zw - zx;
+ left.dist = ww - wx;
+
+ right.normal.x = xw + xx;
+ right.normal.y = yw + yx;
+ right.normal.z = zw + zx;
+ right.dist = ww + wx;
+
+ const float xy = _viewProj[ 1];
+ const float yy = _viewProj[ 5];
+ const float zy = _viewProj[ 9];
+ const float wy = _viewProj[13];
+
+ top.normal.x = xw + xy;
+ top.normal.y = yw + yy;
+ top.normal.z = zw + zy;
+ top.dist = ww + wy;
+
+ bottom.normal.x = xw - xy;
+ bottom.normal.y = yw - yy;
+ bottom.normal.z = zw - zy;
+ bottom.dist = ww - wy;
+
+ Plane* plane = _result;
+ for (uint32_t ii = 0; ii < 6; ++ii)
+ {
+ const float invLen = 1.0f/length(plane->normal);
+ plane->normal = normalize(plane->normal);
+ plane->dist *= invLen;
+ ++plane;
+ }
+ }
+
+ Ray makeRay(float _x, float _y, const float* _invVp)
+ {
+ Ray ray;
+
+ const Vec3 near = { _x, _y, 0.0f };
+ ray.pos = mulH(near, _invVp);
+
+ const Vec3 far = { _x, _y, 1.0f };
+ Vec3 tmp = mulH(far, _invVp);
+
+ const Vec3 dir = sub(tmp, ray.pos);
+ ray.dir = normalize(dir);
+
+ return ray;
+ }
+
+ bool intersect(const Ray& _ray, const Aabb& _aabb, Hit* _hit)
+ {
+ const Vec3 invDir = rcp(_ray.dir);
+ const Vec3 tmp0 = sub(_aabb.min, _ray.pos);
+ const Vec3 t0 = mul(tmp0, invDir);
+ const Vec3 tmp1 = sub(_aabb.max, _ray.pos);
+ const Vec3 t1 = mul(tmp1, invDir);
+
+ const Vec3 mn = min(t0, t1);
+ const Vec3 mx = max(t0, t1);
+
+ const float tmin = max(mn.x, mn.y, mn.z);
+ const float tmax = min(mx.x, mx.y, mx.z);
+
+ if (0.0f > tmax
+ || tmin > tmax)
+ {
+ return false;
+ }
+
+ if (NULL != _hit)
+ {
+ _hit->plane.normal.x = float( (t1.x == tmin) - (t0.x == tmin) );
+ _hit->plane.normal.y = float( (t1.y == tmin) - (t0.y == tmin) );
+ _hit->plane.normal.z = float( (t1.z == tmin) - (t0.z == tmin) );
+
+ _hit->plane.dist = tmin;
+ _hit->pos = getPointAt(_ray, tmin);
+ }
+
+ return true;
+ }
+
+ static constexpr Aabb kUnitAabb =
+ {
+ { -1.0f, -1.0f, -1.0f },
+ { 1.0f, 1.0f, 1.0f },
+ };
+
+ bool intersect(const Ray& _ray, const Obb& _obb, Hit* _hit)
+ {
+ Aabb aabb;
+ toAabb(aabb, _obb);
+
+ if (!intersect(_ray, aabb) )
+ {
+ return false;
+ }
+
+ float mtxInv[16];
+ mtxInverse(mtxInv, _obb.mtx);
+
+ Ray obbRay;
+ obbRay.pos = mul(_ray.pos, mtxInv);
+ obbRay.dir = mulXyz0(_ray.dir, mtxInv);
+
+ if (intersect(obbRay, kUnitAabb, _hit) )
+ {
+ if (NULL != _hit)
+ {
+ _hit->pos = mul(_hit->pos, _obb.mtx);
+
+ const Vec3 tmp = mulXyz0(_hit->plane.normal, _obb.mtx);
+ _hit->plane.normal = normalize(tmp);
+ }
+
+ return true;
+ }
+
+ return false;
+ }
+
+ bool intersect(const Ray& _ray, const Disk& _disk, Hit* _hit)
+ {
+ Plane plane(_disk.normal, -dot(_disk.center, _disk.normal) );
+
+ Hit tmpHit;
+ _hit = NULL != _hit ? _hit : &tmpHit;
+
+ if (intersect(_ray, plane, _hit) )
+ {
+ const Vec3 tmp = sub(_disk.center, _hit->pos);
+ return dot(tmp, tmp) <= square(_disk.radius);
+ }
+
+ return false;
+ }
+
+ static bool intersect(const Ray& _ray, const Cylinder& _cylinder, bool _capsule, Hit* _hit)
+ {
+ Vec3 axis = sub(_cylinder.end, _cylinder.pos);
+ const Vec3 rc = sub(_ray.pos, _cylinder.pos);
+ const Vec3 dxa = cross(_ray.dir, axis);
+
+ const float len = length(dxa);
+ const Vec3 normal = normalize(dxa);
+ const float dist = abs(dot(rc, normal) );
+
+ if (dist > _cylinder.radius)
+ {
+ return false;
+ }
+
+ Vec3 vo = cross(rc, axis);
+ const float t0 = -dot(vo, normal) / len;
+
+ vo = normalize(cross(normal, axis) );
+
+ const float rsq = square(_cylinder.radius);
+ const float ddoto = dot(_ray.dir, vo);
+ const float ss = t0 - abs(sqrt(rsq - square(dist) ) / ddoto);
+
+ if (0.0f > ss)
+ {
+ return false;
+ }
+
+ const Vec3 point = getPointAt(_ray, ss);
+
+ const float axisLen = length(axis);
+ axis = normalize(axis);
+ const float pdota = dot(_cylinder.pos, axis);
+ const float height = dot(point, axis) - pdota;
+
+ if (0.0f < height
+ && axisLen > height)
+ {
+ if (NULL != _hit)
+ {
+ const float t1 = height / axisLen;
+ const Vec3 pointOnAxis = lerp(_cylinder.pos, _cylinder.end, t1);
+
+ _hit->pos = point;
+
+ const Vec3 tmp = sub(point, pointOnAxis);
+ _hit->plane.normal = normalize(tmp);
+
+ _hit->plane.dist = ss;
+ }
+
+ return true;
+ }
+
+ if (_capsule)
+ {
+ const float rdota = dot(_ray.pos, axis);
+ const float pp = rdota - pdota;
+ const float t1 = pp / axisLen;
+
+ const Vec3 pointOnAxis = lerp(_cylinder.pos, _cylinder.end, t1);
+ const Vec3 axisToRay = sub(_ray.pos, pointOnAxis);
+
+ if (_cylinder.radius < length(axisToRay)
+ && 0.0f > ss)
+ {
+ return false;
+ }
+
+ Sphere sphere;
+ sphere.radius = _cylinder.radius;
+
+ sphere.center = 0.0f >= height
+ ? _cylinder.pos
+ : _cylinder.end
+ ;
+
+ return intersect(_ray, sphere, _hit);
+ }
+
+ Plane plane(init::None);
+ Vec3 pos(init::None);
+
+ if (0.0f >= height)
+ {
+ plane.normal = neg(axis);
+ pos = _cylinder.pos;
+ }
+ else
+ {
+ plane.normal = axis;
+ pos = _cylinder.end;
+ }
+
+ plane.dist = -dot(pos, plane.normal);
+
+ Hit tmpHit;
+ _hit = NULL != _hit ? _hit : &tmpHit;
+
+ if (intersect(_ray, plane, _hit) )
+ {
+ const Vec3 tmp = sub(pos, _hit->pos);
+ return dot(tmp, tmp) <= rsq;
+ }
+
+ return false;
+ }
+
+ bool intersect(const Ray& _ray, const Cylinder& _cylinder, Hit* _hit)
+ {
+ return intersect(_ray, _cylinder, false, _hit);
+ }
+
+ bool intersect(const Ray& _ray, const Capsule& _capsule, Hit* _hit)
+ {
+ BX_STATIC_ASSERT(sizeof(Capsule) == sizeof(Cylinder) );
+ return intersect(_ray, *( (const Cylinder*)&_capsule), true, _hit);
+ }
+
+ bool intersect(const Ray& _ray, const Cone& _cone, Hit* _hit)
+ {
+ const Vec3 axis = sub(_cone.pos, _cone.end);
+
+ const float len = length(axis);
+ const Vec3 normal = normalize(axis);
+
+ Disk disk;
+ disk.center = _cone.pos;
+ disk.normal = normal;
+ disk.radius = _cone.radius;
+
+ Hit tmpInt;
+ Hit* out = NULL != _hit ? _hit : &tmpInt;
+ bool hit = intersect(_ray, disk, out);
+
+ const Vec3 ro = sub(_ray.pos, _cone.end);
+
+ const float hyp = sqrt(square(_cone.radius) + square(len) );
+ const float cosaSq = square(len/hyp);
+ const float ndoto = dot(normal, ro);
+ const float ndotd = dot(normal, _ray.dir);
+
+ const float aa = square(ndotd) - cosaSq;
+ const float bb = 2.0f * (ndotd*ndoto - dot(_ray.dir, ro)*cosaSq);
+ const float cc = square(ndoto) - dot(ro, ro)*cosaSq;
+
+ float det = bb*bb - 4.0f*aa*cc;
+
+ if (0.0f > det)
+ {
+ return hit;
+ }
+
+ det = sqrt(det);
+ const float invA2 = 1.0f / (2.0f*aa);
+ const float t1 = (-bb - det) * invA2;
+ const float t2 = (-bb + det) * invA2;
+
+ float tt = t1;
+ if (0.0f > t1
+ || (0.0f < t2 && t2 < t1) )
+ {
+ tt = t2;
+ }
+
+ if (0.0f > tt)
+ {
+ return hit;
+ }
+
+ const Vec3 hitPos = getPointAt(_ray, tt);
+ const Vec3 point = sub(hitPos, _cone.end);
+
+ const float hh = dot(normal, point);
+
+ if (0.0f > hh
+ || len < hh)
+ {
+ return hit;
+ }
+
+ if (NULL != _hit)
+ {
+ if (!hit
+ || tt < _hit->plane.dist)
+ {
+ _hit->plane.dist = tt;
+ _hit->pos = hitPos;
+
+ const float scale = hh / dot(point, point);
+ const Vec3 pointScaled = mul(point, scale);
+
+ const Vec3 tmp = sub(pointScaled, normal);
+ _hit->plane.normal = normalize(tmp);
+ }
+ }
+
+ return true;
+ }
+
+ bool intersect(const Ray& _ray, const Plane& _plane, bool _doublesided, Hit* _hit)
+ {
+ const float dist = distance(_plane, _ray.pos);
+ const float ndotd = dot(_ray.dir, _plane.normal);
+
+ if (!_doublesided
+ && (0.0f > dist || 0.0f < ndotd) )
+ {
+ return false;
+ }
+
+ if (NULL != _hit)
+ {
+ _hit->plane.normal = _plane.normal;
+
+ float tt = -dist/ndotd;
+ _hit->plane.dist = tt;
+ _hit->pos = getPointAt(_ray, tt);
+ }
+
+ return true;
+ }
+
+ bool intersect(const Ray& _ray, const Sphere& _sphere, Hit* _hit)
+ {
+ const Vec3 rs = sub(_ray.pos, _sphere.center);
+
+ const float bb = dot(rs, _ray.dir);
+ if (0.0f < bb)
+ {
+ return false;
+ }
+
+ const float aa = dot(_ray.dir, _ray.dir);
+ const float cc = dot(rs, rs) - square(_sphere.radius);
+
+ const float discriminant = bb*bb - aa*cc;
+
+ if (0.0f >= discriminant)
+ {
+ return false;
+ }
+
+ const float sqrtDiscriminant = sqrt(discriminant);
+ const float invA = 1.0f / aa;
+ const float tt = -(bb + sqrtDiscriminant)*invA;
+
+ if (0.0f >= tt)
+ {
+ return false;
+ }
+
+ if (NULL != _hit)
+ {
+ _hit->plane.dist = tt;
+
+ const Vec3 point = getPointAt(_ray, tt);
+ _hit->pos = point;
+
+ const Vec3 tmp = sub(point, _sphere.center);
+ _hit->plane.normal = normalize(tmp);
+ }
+
+ return true;
+ }
+
+ bool intersect(const Ray& _ray, const Triangle& _triangle, Hit* _hit)
+ {
+ const Vec3 edge10 = sub(_triangle.v1, _triangle.v0);
+ const Vec3 edge02 = sub(_triangle.v0, _triangle.v2);
+ const Vec3 normal = cross(edge02, edge10);
+ const Vec3 vo = sub(_triangle.v0, _ray.pos);
+ const Vec3 dxo = cross(_ray.dir, vo);
+ const float det = dot(normal, _ray.dir);
+
+ if (0.0f < det)
+ {
+ return false;
+ }
+
+ const float invDet = 1.0f/det;
+ const float bz = dot(dxo, edge02) * invDet;
+ const float by = dot(dxo, edge10) * invDet;
+ const float bx = 1.0f - by - bz;
+
+ if (0.0f > bx
+ || 0.0f > by
+ || 0.0f > bz)
+ {
+ return false;
+ }
+
+ if (NULL != _hit)
+ {
+ _hit->plane.normal = normalize(normal);
+
+ const float tt = dot(normal, vo) * invDet;
+ _hit->plane.dist = tt;
+ _hit->pos = getPointAt(_ray, tt);
+ }
+
+ return true;
+ }
+
+ Vec3 barycentric(const Triangle& _triangle, const Vec3& _pos)
+ {
+ const Vec3 v0 = sub(_triangle.v1, _triangle.v0);
+ const Vec3 v1 = sub(_triangle.v2, _triangle.v0);
+ const Vec3 v2 = sub(_pos, _triangle.v0);
+
+ const float dot00 = dot(v0, v0);
+ const float dot01 = dot(v0, v1);
+ const float dot02 = dot(v0, v2);
+ const float dot11 = dot(v1, v1);
+ const float dot12 = dot(v1, v2);
+
+ const float invDenom = 1.0f/(dot00*dot11 - square(dot01) );
+
+ const float vv = (dot11*dot02 - dot01*dot12)*invDenom;
+ const float ww = (dot00*dot12 - dot01*dot02)*invDenom;
+ const float uu = 1.0f - vv - ww;
+
+ return { uu, vv, ww };
+ }
+
+ Vec3 cartesian(const Triangle& _triangle, const Vec3& _uvw)
+ {
+ const Vec3 b0 = mul(_triangle.v0, _uvw.x);
+ const Vec3 b1 = mul(_triangle.v1, _uvw.y);
+ const Vec3 b2 = mul(_triangle.v2, _uvw.z);
+
+ return add(add(b0, b1), b2);
+ }
+
+ void calcPlane(Plane& _outPlane, const Disk& _disk)
+ {
+ calcPlane(_outPlane, _disk.normal, _disk.center);
+ }
+
+ void calcPlane(Plane& _outPlane, const Triangle& _triangle)
+ {
+ calcPlane(_outPlane, _triangle.v0, _triangle.v1, _triangle.v2);
+ }
+
+ float projectToAxis(const Vec3& _axis, const Vec3& _point)
+ {
+ return dot(_axis, _point);
+ }
+
+ Interval projectToAxis(const Vec3& _axis, const Vec3* _points, uint32_t _num)
+ {
+ Interval interval(projectToAxis(_axis, _points[0]) );
+
+ for (uint32_t ii = 1; ii < _num; ++ii)
+ {
+ interval.expand(projectToAxis(_axis, _points[ii]) );
+ }
+
+ return interval;
+ }
+
+ Interval projectToAxis(const Vec3& _axis, const Aabb& _aabb)
+ {
+ const float extent = abs(projectToAxis(abs(_axis), getExtents(_aabb) ) );
+ const float center = projectToAxis( _axis , getCenter (_aabb) );
+ return
+ {
+ center - extent,
+ center + extent,
+ };
+ }
+
+ Interval projectToAxis(const Vec3& _axis, const Triangle& _triangle)
+ {
+ const float a0 = projectToAxis(_axis, _triangle.v0);
+ const float a1 = projectToAxis(_axis, _triangle.v1);
+ const float a2 = projectToAxis(_axis, _triangle.v2);
+ return
+ {
+ min(a0, a1, a2),
+ max(a0, a1, a2),
+ };
+ }
+
+ struct Srt
+ {
+ Quaternion rotation = init::Identity;
+ Vec3 translation = init::Zero;
+ Vec3 scale = init::Zero;
+ };
+
+ Srt toSrt(const Aabb& _aabb)
+ {
+ return { init::Identity, getCenter(_aabb), getExtents(_aabb) };
+ }
+
+ Srt toSrt(const void* _mtx)
+ {
+ Srt result;
+
+ const float* mtx = (const float*)_mtx;
+
+ result.translation = { mtx[12], mtx[13], mtx[14] };
+
+ float xx = mtx[ 0];
+ float xy = mtx[ 1];
+ float xz = mtx[ 2];
+ float yx = mtx[ 4];
+ float yy = mtx[ 5];
+ float yz = mtx[ 6];
+ float zx = mtx[ 8];
+ float zy = mtx[ 9];
+ float zz = mtx[10];
+
+ result.scale =
+ {
+ sqrt(xx*xx + xy*xy + xz*xz),
+ sqrt(yx*yx + yy*yy + yz*yz),
+ sqrt(zx*zx + zy*zy + zz*zz),
+ };
+
+ const Vec3 invScale = rcp(result.scale);
+
+ xx *= invScale.x;
+ xy *= invScale.x;
+ xz *= invScale.x;
+ yx *= invScale.y;
+ yy *= invScale.y;
+ yz *= invScale.y;
+ zx *= invScale.z;
+ zy *= invScale.z;
+ zz *= invScale.z;
+
+ const float trace = xx + yy + zz;
+
+ if (0.0f < trace)
+ {
+ const float invS = 0.5f * rsqrt(trace + 1.0f);
+ result.rotation =
+ {
+ (yz - zy) * invS,
+ (zx - xz) * invS,
+ (xy - yx) * invS,
+ 0.25f / invS,
+ };
+ }
+ else
+ {
+ if (xx > yy
+ && xx > zz)
+ {
+ const float invS = 0.5f * sqrt(max(1.0f + xx - yy - zz, 1e-8f) );
+ result.rotation =
+ {
+ 0.25f / invS,
+ (xy + yx) * invS,
+ (xz + zx) * invS,
+ (yz - zy) * invS,
+ };
+ }
+ else if (yy > zz)
+ {
+ const float invS = 0.5f * sqrt(max(1.0f + yy - xx - zz, 1e-8f) );
+ result.rotation =
+ {
+ (xy + yx) * invS,
+ 0.25f / invS,
+ (yz + zy) * invS,
+ (zx - xz) * invS,
+ };
+ }
+ else
+ {
+ const float invS = 0.5f * sqrt(max(1.0f + zz - xx - yy, 1e-8f) );
+ result.rotation =
+ {
+ (xz + zx) * invS,
+ (yz + zy) * invS,
+ 0.25f / invS,
+ (xy - yx) * invS,
+ };
+ }
+ }
+
+ return result;
+ }
+
+ void mtxFromSrt(float* _outMtx, const Srt& _srt)
+ {
+ mtxFromQuaternion(_outMtx, _srt.rotation);
+
+ store<Vec3>(&_outMtx[0], mul(load<Vec3>(&_outMtx[0]), _srt.scale.x) );
+ store<Vec3>(&_outMtx[4], mul(load<Vec3>(&_outMtx[4]), _srt.scale.y) );
+ store<Vec3>(&_outMtx[8], mul(load<Vec3>(&_outMtx[8]), _srt.scale.z) );
+
+ store<Vec3>(&_outMtx[12], _srt.translation);
+ }
+
+ bool isNearZero(float _v)
+ {
+ return isEqual(_v, 0.0f, 0.00001f);
+ }
+
+ bool isNearZero(const Vec3& _v)
+ {
+ return isNearZero(dot(_v, _v) );
+ }
+
+ bool intersect(Line& _outLine, const Plane& _planeA, const Plane& _planeB)
+ {
+ const Vec3 axb = cross(_planeA.normal, _planeB.normal);
+ const float denom = dot(axb, axb);
+
+ if (isNearZero(denom) )
+ {
+ return false;
+ }
+
+ const Vec3 bxaxb = cross(_planeB.normal, axb);
+ const Vec3 axbxa = cross(axb, _planeA.normal);
+ const Vec3 tmp0 = mul(bxaxb, _planeA.dist);
+ const Vec3 tmp1 = mul(axbxa, _planeB.dist);
+ const Vec3 tmp2 = add(tmp0, tmp1);
+
+ _outLine.pos = mul(tmp2, -1.0f/denom);
+ _outLine.dir = normalize(axb);
+
+ return true;
+ }
+
+ Vec3 intersectPlanes(const Plane& _pa, const Plane& _pb, const Plane& _pc)
+ {
+ const Vec3 axb = cross(_pa.normal, _pb.normal);
+ const Vec3 bxc = cross(_pb.normal, _pc.normal);
+ const Vec3 cxa = cross(_pc.normal, _pa.normal);
+ const Vec3 tmp0 = mul(bxc, _pa.dist);
+ const Vec3 tmp1 = mul(cxa, _pb.dist);
+ const Vec3 tmp2 = mul(axb, _pc.dist);
+ const Vec3 tmp3 = add(tmp0, tmp1);
+ const Vec3 tmp4 = add(tmp3, tmp2);
+
+ const float denom = dot(_pa.normal, bxc);
+ const Vec3 result = mul(tmp4, -1.0f/denom);
+
+ return result;
+ }
+
+ bool intersect(float& _outTa, float& _outTb, const LineSegment& _a, const LineSegment& _b)
+ {
+ // Reference(s):
+ //
+ // - The shortest line between two lines in 3D
+ // https://web.archive.org/web/20120309093234/http://paulbourke.net/geometry/lineline3d/
+
+ const Vec3 bd = sub(_b.end, _b.pos);
+ if (isNearZero(bd) )
+ {
+ return false;
+ }
+
+ const Vec3 ad = sub(_a.end, _a.pos);
+ if (isNearZero(ad) )
+ {
+ return false;
+ }
+
+ const Vec3 ab = sub(_a.pos, _b.pos);
+
+ const float d0 = projectToAxis(ab, bd);
+ const float d1 = projectToAxis(ad, bd);
+ const float d2 = projectToAxis(ab, ad);
+ const float d3 = projectToAxis(bd, bd);
+ const float d4 = projectToAxis(ad, ad);
+
+ const float denom = d4*d3 - square(d1);
+
+ float ta = 0.0f;
+
+ if (!isNearZero(denom) )
+ {
+ ta = (d0*d1 - d2*d3)/denom;
+ }
+
+ _outTa = ta;
+ _outTb = (d0+d1*ta)/d3;
+
+ return true;
+ }
+
+ bool intersect(const LineSegment& _a, const LineSegment& _b)
+ {
+ float ta, tb;
+ if (!intersect(ta, tb, _a, _b) )
+ {
+ return false;
+ }
+
+ return 0.0f >= ta
+ && 1.0f <= ta
+ && 0.0f >= tb
+ && 1.0f <= tb
+ ;
+ }
+
+ bool intersect(const LineSegment& _line, const Plane& _plane, Hit* _hit)
+ {
+ const float dist = distance(_plane, _line.pos);
+ const float flip = sign(dist);
+ const Vec3 dir = normalize(sub(_line.end, _line.pos) );
+ const float ndotd = dot(dir, _plane.normal);
+ const float tt = -dist/ndotd;
+ const float len = length(sub(_line.end, _line.pos) );
+
+ if (tt < 0.0f || tt > len)
+ {
+ return false;
+ }
+
+ if (NULL != _hit)
+ {
+ _hit->pos = mad(dir, tt, _line.pos);
+
+ _hit->plane.normal = mul(_plane.normal, flip);
+ _hit->plane.dist = -dot(_hit->plane.normal, _hit->pos);
+ }
+
+ return true;
+ }
+
+ float distance(const Plane& _plane, const LineSegment& _line)
+ {
+ const float pd = distance(_plane, _line.pos);
+ const float ed = distance(_plane, _line.end);
+ return min(max(pd*ed, 0.0f), abs(pd), abs(ed) );
+ }
+
+ Vec3 closestPoint(const Line& _line, const Vec3& _point)
+ {
+ const float tt = projectToAxis(_line.dir, sub(_point, _line.pos) );
+ return getPointAt(_line, tt);
+ }
+
+ Vec3 closestPoint(const LineSegment& _line, const Vec3& _point, float& _outT)
+ {
+ const Vec3 axis = sub(_line.end, _line.pos);
+ const float lengthSq = dot(axis, axis);
+ const float tt = clamp(projectToAxis(axis, sub(_point, _line.pos) ) / lengthSq, 0.0f, 1.0f);
+ _outT = tt;
+ return mad(axis, tt, _line.pos);
+ }
+
+ Vec3 closestPoint(const LineSegment& _line, const Vec3& _point)
+ {
+ float ignored;
+ return closestPoint(_line, _point, ignored);
+ }
+
+ Vec3 closestPoint(const Plane& _plane, const Vec3& _point)
+ {
+ const float dist = distance(_plane, _point);
+ return sub(_point, mul(_plane.normal, dist) );
+ }
+
+ Vec3 closestPoint(const Aabb& _aabb, const Vec3& _point)
+ {
+ return clamp(_point, _aabb.min, _aabb.max);
+ }
+
+ Vec3 closestPoint(const Obb& _obb, const Vec3& _point)
+ {
+ const Srt srt = toSrt(_obb.mtx);
+
+ Aabb aabb;
+ toAabb(aabb, srt.scale);
+
+ const Quaternion invRotation = invert(srt.rotation);
+ const Vec3 obbSpacePos = mul(sub(_point, srt.translation), srt.rotation);
+ const Vec3 pos = closestPoint(aabb, obbSpacePos);
+
+ return add(mul(pos, invRotation), srt.translation);
+ }
+
+ Vec3 closestPoint(const Triangle& _triangle, const Vec3& _point)
+ {
+ Plane plane(init::None);
+ calcPlane(plane, _triangle);
+
+ const Vec3 pos = closestPoint(plane, _point);
+ const Vec3 uvw = barycentric(_triangle, pos);
+
+ return cartesian(_triangle, clamp<Vec3>(uvw, Vec3(0.0f), Vec3(1.0f) ) );
+ }
+
+ bool overlap(const Aabb& _aabb, const Vec3& _pos)
+ {
+ const Vec3 ac = getCenter(_aabb);
+ const Vec3 ae = getExtents(_aabb);
+ const Vec3 abc = abs(sub(ac, _pos) );
+
+ return abc.x <= ae.x
+ && abc.y <= ae.y
+ && abc.z <= ae.z
+ ;
+ }
+
+ bool overlap(const Aabb& _aabbA, const Aabb& _aabbB)
+ {
+ return true
+ && overlap(Interval{_aabbA.min.x, _aabbA.max.x}, Interval{_aabbB.min.x, _aabbB.max.x})
+ && overlap(Interval{_aabbA.min.y, _aabbA.max.y}, Interval{_aabbB.min.y, _aabbB.max.y})
+ && overlap(Interval{_aabbA.min.z, _aabbA.max.z}, Interval{_aabbB.min.z, _aabbB.max.z})
+ ;
+ }
+
+ bool overlap(const Aabb& _aabb, const Plane& _plane)
+ {
+ const Vec3 center = getCenter(_aabb);
+ const float dist = distance(_plane, center);
+
+ const Vec3 extents = getExtents(_aabb);
+ const Vec3 normal = abs(_plane.normal);
+ const float radius = dot(extents, normal);
+
+ return abs(dist) <= radius;
+ }
+
+ static constexpr Vec3 kAxis[] =
+ {
+ { 1.0f, 0.0f, 0.0f },
+ { 0.0f, 1.0f, 0.0f },
+ { 0.0f, 0.0f, 1.0f },
+ };
+
+ bool overlap(const Aabb& _aabb, const Triangle& _triangle)
+ {
+ Aabb triAabb;
+ toAabb(triAabb, _triangle);
+
+ if (!overlap(_aabb, triAabb) )
+ {
+ return false;
+ }
+
+ Plane plane(init::None);
+ calcPlane(plane, _triangle);
+
+ if (!overlap(_aabb, plane) )
+ {
+ return false;
+ }
+
+ const Vec3 center = getCenter(_aabb);
+ const Vec3 v0 = sub(_triangle.v0, center);
+ const Vec3 v1 = sub(_triangle.v1, center);
+ const Vec3 v2 = sub(_triangle.v2, center);
+
+ const Vec3 edge[] =
+ {
+ sub(v1, v0),
+ sub(v2, v1),
+ sub(v0, v2),
+ };
+
+ for (uint32_t ii = 0; ii < 3; ++ii)
+ {
+ for (uint32_t jj = 0; jj < 3; ++jj)
+ {
+ const Vec3 axis = cross(kAxis[ii], edge[jj]);
+
+ const Interval aabbR = projectToAxis(axis, _aabb);
+ const Interval triR = projectToAxis(axis, _triangle);
+
+ if (!overlap(aabbR, triR) )
+ {
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ bool overlap(const Aabb& _aabb, const Capsule& _capsule)
+ {
+ const Vec3 pos = closestPoint(LineSegment{_capsule.pos, _capsule.end}, getCenter(_aabb) );
+ return overlap(_aabb, Sphere{pos, _capsule.radius});
+ }
+
+ bool overlap(const Aabb& _aabb, const Cone& _cone)
+ {
+ float tt;
+ const Vec3 pos = closestPoint(LineSegment{_cone.pos, _cone.end}, getCenter(_aabb), tt);
+ return overlap(_aabb, Sphere{pos, lerp(_cone.radius, 0.0f, tt)});
+ }
+
+ bool overlap(const Aabb& _aabb, const Disk& _disk)
+ {
+ if (!overlap(_aabb, Sphere{_disk.center, _disk.radius}) )
+ {
+ return false;
+ }
+
+ Plane plane(init::None);
+ calcPlane(plane, _disk.normal, _disk.center);
+
+ return overlap(_aabb, plane);
+ }
+
+ static void calcObbVertices(
+ Vec3* _outVertices
+ , const Vec3& _axisX
+ , const Vec3& _axisY
+ , const Vec3& _axisZ
+ , const Vec3& _pos
+ , const Vec3& _scale
+ )
+ {
+ const Vec3 ax = mul(_axisX, _scale.x);
+ const Vec3 ay = mul(_axisY, _scale.y);
+ const Vec3 az = mul(_axisZ, _scale.z);
+
+ const Vec3 ppx = add(_pos, ax);
+ const Vec3 pmx = sub(_pos, ax);
+ const Vec3 ypz = add(ay, az);
+ const Vec3 ymz = sub(ay, az);
+
+ _outVertices[0] = sub(pmx, ymz);
+ _outVertices[1] = sub(ppx, ymz);
+ _outVertices[2] = add(ppx, ymz);
+ _outVertices[3] = add(pmx, ymz);
+ _outVertices[4] = sub(pmx, ypz);
+ _outVertices[5] = sub(ppx, ypz);
+ _outVertices[6] = add(ppx, ypz);
+ _outVertices[7] = add(pmx, ypz);
+ }
+
+ static bool overlaps(const Vec3& _axis, const Vec3* _vertsA, const Vec3* _vertsB)
+ {
+ Interval ia = projectToAxis(_axis, _vertsA, 8);
+ Interval ib = projectToAxis(_axis, _vertsB, 8);
+
+ return overlap(ia, ib);
+ }
+
+ static bool overlap(const Srt& _srtA, const Srt& _srtB)
+ {
+ const Vec3 ax = toXAxis(_srtA.rotation);
+ const Vec3 ay = toYAxis(_srtA.rotation);
+ const Vec3 az = toZAxis(_srtA.rotation);
+
+ const Vec3 bx = toXAxis(_srtB.rotation);
+ const Vec3 by = toYAxis(_srtB.rotation);
+ const Vec3 bz = toZAxis(_srtB.rotation);
+
+ Vec3 vertsA[8] = { init::None, init::None, init::None, init::None, init::None, init::None, init::None, init::None };
+ calcObbVertices(vertsA, ax, ay, az, init::Zero, _srtA.scale);
+
+ Vec3 vertsB[8] = { init::None, init::None, init::None, init::None, init::None, init::None, init::None, init::None };
+ calcObbVertices(vertsB, bx, by, bz, sub(_srtB.translation, _srtA.translation), _srtB.scale);
+
+ return overlaps(ax, vertsA, vertsB)
+ && overlaps(ay, vertsA, vertsB)
+ && overlaps(az, vertsA, vertsB)
+ && overlaps(bx, vertsA, vertsB)
+ && overlaps(by, vertsA, vertsB)
+ && overlaps(bz, vertsA, vertsB)
+ && overlaps(cross(ax, bx), vertsA, vertsB)
+ && overlaps(cross(ax, by), vertsA, vertsB)
+ && overlaps(cross(ax, bz), vertsA, vertsB)
+ && overlaps(cross(ay, bx), vertsA, vertsB)
+ && overlaps(cross(ay, by), vertsA, vertsB)
+ && overlaps(cross(ay, bz), vertsA, vertsB)
+ && overlaps(cross(az, bx), vertsA, vertsB)
+ && overlaps(cross(az, by), vertsA, vertsB)
+ && overlaps(cross(az, bz), vertsA, vertsB)
+ ;
+ }
+
+ bool overlap(const Aabb& _aabb, const Obb& _obb)
+ {
+ const Srt srtA = toSrt(_aabb);
+ const Srt srtB = toSrt(_obb.mtx);
+
+ return overlap(srtA, srtB);
+ }
+
+ bool overlap(const Capsule& _capsule, const Vec3& _pos)
+ {
+ const Vec3 pos = closestPoint(LineSegment{_capsule.pos, _capsule.end}, _pos);
+ return overlap(Sphere{pos, _capsule.radius}, _pos);
+ }
+
+ bool overlap(const Capsule& _capsule, const Plane& _plane)
+ {
+ return distance(_plane, LineSegment{_capsule.pos, _capsule.end}) <= _capsule.radius;
+ }
+
+ bool overlap(const Capsule& _capsuleA, const Capsule& _capsuleB)
+ {
+ float ta, tb;
+ if (!intersect(ta, tb, {_capsuleA.pos, _capsuleA.end}, {_capsuleB.pos, _capsuleB.end}) )
+ {
+ return false;
+ }
+
+ if (0.0f <= ta
+ && 1.0f >= ta
+ && 0.0f <= tb
+ && 1.0f >= tb)
+ {
+ const Vec3 ad = sub(_capsuleA.end, _capsuleA.pos);
+ const Vec3 bd = sub(_capsuleB.end, _capsuleB.pos);
+
+ return overlap(
+ Sphere{mad(ad, ta, _capsuleA.pos), _capsuleA.radius}
+ , Sphere{mad(bd, tb, _capsuleB.pos), _capsuleB.radius}
+ );
+ }
+
+ if (0.0f <= ta
+ && 1.0f >= ta)
+ {
+ return overlap(_capsuleA, Sphere{0.0f >= tb ? _capsuleB.pos : _capsuleB.end, _capsuleB.radius});
+ }
+
+ if (0.0f <= tb
+ && 1.0f >= tb)
+ {
+ return overlap(_capsuleB, Sphere{0.0f >= ta ? _capsuleA.pos : _capsuleA.end, _capsuleA.radius});
+ }
+
+ const Vec3 pa = 0.0f > ta ? _capsuleA.pos : _capsuleA.end;
+ const Vec3 pb = 0.0f > tb ? _capsuleB.pos : _capsuleB.end;
+ const Vec3 closestA = closestPoint(LineSegment{_capsuleA.pos, _capsuleA.end}, pb);
+ const Vec3 closestB = closestPoint(LineSegment{_capsuleB.pos, _capsuleB.end}, pa);
+
+ if (dot(closestA, pb) <= dot(closestB, pa) )
+ {
+ return overlap(_capsuleA, Sphere{closestB, _capsuleB.radius});
+ }
+
+ return overlap(_capsuleB, Sphere{closestA, _capsuleA.radius});
+ }
+
+ bool overlap(const Cone& _cone, const Vec3& _pos)
+ {
+ float tt;
+ const Vec3 pos = closestPoint(LineSegment{_cone.pos, _cone.end}, _pos, tt);
+ return overlap(Disk{pos, normalize(sub(_cone.end, _cone.pos) ), lerp(_cone.radius, 0.0f, tt)}, _pos);
+ }
+
+ bool overlap(const Cone& _cone, const Cylinder& _cylinder)
+ {
+ BX_UNUSED(_cone, _cylinder);
+ return false;
+ }
+
+ bool overlap(const Cone& _cone, const Capsule& _capsule)
+ {
+ BX_UNUSED(_cone, _capsule);
+ return false;
+ }
+
+ bool overlap(const Cone& _coneA, const Cone& _coneB)
+ {
+ BX_UNUSED(_coneA, _coneB);
+ return false;
+ }
+
+ bool overlap(const Cone& _cone, const Disk& _disk)
+ {
+ BX_UNUSED(_cone, _disk);
+ return false;
+ }
+
+ bool overlap(const Cone& _cone, const Obb& _obb)
+ {
+ BX_UNUSED(_cone, _obb);
+ return false;
+ }
+
+ bool overlap(const Cylinder& _cylinder, const Vec3& _pos)
+ {
+ const Vec3 pos = closestPoint(LineSegment{_cylinder.pos, _cylinder.end}, _pos);
+ return overlap(Disk{pos, normalize(sub(_cylinder.end, _cylinder.pos) ), _cylinder.radius}, _pos);
+ }
+
+ bool overlap(const Cylinder& _cylinder, const Sphere& _sphere)
+ {
+ const Vec3 pos = closestPoint(LineSegment{_cylinder.pos, _cylinder.end}, _sphere.center);
+ return overlap(Disk{pos, normalize(sub(_cylinder.end, _cylinder.pos) ), _cylinder.radius}, _sphere);
+ }
+
+ bool overlap(const Cylinder& _cylinder, const Aabb& _aabb)
+ {
+ const Vec3 pos = closestPoint(LineSegment{_cylinder.pos, _cylinder.end}, getCenter(_aabb) );
+ return overlap(Disk{pos, normalize(sub(_cylinder.end, _cylinder.pos) ), _cylinder.radius}, _aabb);
+ }
+
+ bool overlap(const Cylinder& _cylinder, const Plane& _plane)
+ {
+ BX_UNUSED(_cylinder, _plane);
+ return false;
+ }
+
+ bool overlap(const Cylinder& _cylinderA, const Cylinder& _cylinderB)
+ {
+ BX_UNUSED(_cylinderA, _cylinderB);
+ return false;
+ }
+
+ bool overlap(const Cylinder& _cylinder, const Capsule& _capsule)
+ {
+ BX_UNUSED(_cylinder, _capsule);
+ return false;
+ }
+
+ bool overlap(const Cylinder& _cylinder, const Disk& _disk)
+ {
+ BX_UNUSED(_cylinder, _disk);
+ return false;
+ }
+
+ bool overlap(const Cylinder& _cylinder, const Obb& _obb)
+ {
+ BX_UNUSED(_cylinder, _obb);
+ return false;
+ }
+
+ bool overlap(const Disk& _disk, const Vec3& _pos)
+ {
+ Plane plane(init::None);
+ calcPlane(plane, _disk.normal, _disk.center);
+
+ if (!isNearZero(distance(plane, _pos) ) )
+ {
+ return false;
+ }
+
+ return distanceSq(_disk.center, _pos) <= square(_disk.radius);
+ }
+
+ bool overlap(const Disk& _disk, const Plane& _plane)
+ {
+ Plane plane(init::None);
+ calcPlane(plane, _disk.normal, _disk.center);
+
+ if (!overlap(plane, _plane) )
+ {
+ return false;
+ }
+
+ return overlap(_plane, Sphere{_disk.center, _disk.radius});
+ }
+
+ bool overlap(const Disk& _disk, const Capsule& _capsule)
+ {
+ if (!overlap(_capsule, Sphere{_disk.center, _disk.radius}) )
+ {
+ return false;
+ }
+
+ Plane plane(init::None);
+ calcPlane(plane, _disk.normal, _disk.center);
+
+ return overlap(_capsule, plane);
+ }
+
+ bool overlap(const Disk& _diskA, const Disk& _diskB)
+ {
+ Plane planeA(init::None);
+ calcPlane(planeA, _diskA.normal, _diskA.center);
+
+ Plane planeB(init::None);
+ calcPlane(planeB, _diskB);
+
+ Line line;
+
+ if (!intersect(line, planeA, planeB) )
+ {
+ return false;
+ }
+
+ const Vec3 pa = closestPoint(line, _diskA.center);
+ const Vec3 pb = closestPoint(line, _diskB.center);
+
+ const float lenA = distance(pa, _diskA.center);
+ const float lenB = distance(pb, _diskB.center);
+
+ return sqrt(square(_diskA.radius) - square(lenA) )
+ + sqrt(square(_diskB.radius) - square(lenB) )
+ >= distance(pa, pb)
+ ;
+ }
+
+ bool overlap(const Disk& _disk, const Obb& _obb)
+ {
+ if (!overlap(_obb, Sphere{_disk.center, _disk.radius}) )
+ {
+ return false;
+ }
+
+ Plane plane(init::None);
+ calcPlane(plane, _disk.normal, _disk.center);
+
+ return overlap(_obb, plane);
+ }
+
+ bool overlap(const Obb& _obb, const Vec3& _pos)
+ {
+ const Srt srt = toSrt(_obb.mtx);
+
+ Aabb aabb;
+ toAabb(aabb, srt.scale);
+
+ const Quaternion invRotation = invert(srt.rotation);
+ const Vec3 pos = mul(sub(_pos, srt.translation), invRotation);
+
+ return overlap(aabb, pos);
+ }
+
+ bool overlap(const Obb& _obb, const Plane& _plane)
+ {
+ const Srt srt = toSrt(_obb.mtx);
+
+ const Quaternion invRotation = invert(srt.rotation);
+ const Vec3 axis =
+ {
+ projectToAxis(_plane.normal, mul(Vec3{1.0f, 0.0f, 0.0f}, invRotation) ),
+ projectToAxis(_plane.normal, mul(Vec3{0.0f, 1.0f, 0.0f}, invRotation) ),
+ projectToAxis(_plane.normal, mul(Vec3{0.0f, 0.0f, 1.0f}, invRotation) ),
+ };
+
+ const float dist = abs(distance(_plane, srt.translation) );
+ const float radius = dot(srt.scale, abs(axis) );
+
+ return dist <= radius;
+ }
+
+ bool overlap(const Obb& _obb, const Capsule& _capsule)
+ {
+ const Srt srt = toSrt(_obb.mtx);
+
+ Aabb aabb;
+ toAabb(aabb, srt.scale);
+
+ const Quaternion invRotation = invert(srt.rotation);
+
+ const Capsule capsule =
+ {
+ mul(sub(_capsule.pos, srt.translation), invRotation),
+ mul(sub(_capsule.end, srt.translation), invRotation),
+ _capsule.radius,
+ };
+
+ return overlap(aabb, capsule);
+ }
+
+ bool overlap(const Obb& _obbA, const Obb& _obbB)
+ {
+ const Srt srtA = toSrt(_obbA.mtx);
+ const Srt srtB = toSrt(_obbB.mtx);
+
+ return overlap(srtA, srtB);
+ }
+
+ bool overlap(const Plane& _plane, const LineSegment& _line)
+ {
+ return isNearZero(distance(_plane, _line) );
+ }
+
+ bool overlap(const Plane& _plane, const Vec3& _pos)
+ {
+ return isNearZero(distance(_plane, _pos) );
+ }
+
+ bool overlap(const Plane& _planeA, const Plane& _planeB)
+ {
+ const Vec3 dir = cross(_planeA.normal, _planeB.normal);
+ const float len = length(dir);
+
+ return !isNearZero(len);
+ }
+
+ bool overlap(const Plane& _plane, const Cone& _cone)
+ {
+ const Vec3 axis = sub(_cone.pos, _cone.end);
+ const float len = length(axis);
+ const Vec3 dir = normalize(axis);
+
+ const Vec3 v1 = cross(_plane.normal, dir);
+ const Vec3 v2 = cross(v1, dir);
+
+ const float bb = len;
+ const float aa = _cone.radius;
+ const float cc = sqrt(square(aa) + square(bb) );
+
+ const Vec3 pos = add(add(_cone.end
+ , mul(dir, len * bb/cc) )
+ , mul(v2, len * aa/cc)
+ );
+
+ return overlap(_plane, LineSegment{pos, _cone.end});
+ }
+
+ bool overlap(const Sphere& _sphere, const Vec3& _pos)
+ {
+ const float distSq = distanceSq(_sphere.center, _pos);
+ const float radiusSq = square(_sphere.radius);
+ return distSq <= radiusSq;
+ }
+
+ bool overlap(const Sphere& _sphereA, const Sphere& _sphereB)
+ {
+ const float distSq = distanceSq(_sphereA.center, _sphereB.center);
+ const float radiusSq = square(_sphereA.radius + _sphereB.radius);
+ return distSq <= radiusSq;
+ }
+
+ bool overlap(const Sphere& _sphere, const Aabb& _aabb)
+ {
+ const Vec3 pos = closestPoint(_aabb, _sphere.center);
+ return overlap(_sphere, pos);
+ }
+
+ bool overlap(const Sphere& _sphere, const Plane& _plane)
+ {
+ return abs(distance(_plane, _sphere.center) ) <= _sphere.radius;
+ }
+
+ bool overlap(const Sphere& _sphere, const Triangle& _triangle)
+ {
+ Plane plane(init::None);
+ calcPlane(plane, _triangle);
+
+ if (!overlap(_sphere, plane) )
+ {
+ return false;
+ }
+
+ const Vec3 pos = closestPoint(plane, _sphere.center);
+ const Vec3 uvw = barycentric(_triangle, pos);
+ const float nr = -_sphere.radius;
+
+ return uvw.x >= nr
+ && uvw.y >= nr
+ && uvw.z >= nr
+ ;
+ }
+
+ bool overlap(const Sphere& _sphere, const Capsule& _capsule)
+ {
+ const Vec3 pos = closestPoint(LineSegment{_capsule.pos, _capsule.end}, _sphere.center);
+ return overlap(_sphere, Sphere{pos, _capsule.radius});
+ }
+
+ bool overlap(const Sphere& _sphere, const Cone& _cone)
+ {
+ float tt;
+ const Vec3 pos = closestPoint(LineSegment{_cone.pos, _cone.end}, _sphere.center, tt);
+ return overlap(_sphere, Sphere{pos, lerp(_cone.radius, 0.0f, tt)});
+ }
+
+ bool overlap(const Sphere& _sphere, const Disk& _disk)
+ {
+ if (!overlap(_sphere, Sphere{_disk.center, _disk.radius}) )
+ {
+ return false;
+ }
+
+ Plane plane(init::None);
+ calcPlane(plane, _disk.normal, _disk.center);
+
+ return overlap(_sphere, plane);
+ }
+
+ bool overlap(const Sphere& _sphere, const Obb& _obb)
+ {
+ const Vec3 pos = closestPoint(_obb, _sphere.center);
+ return overlap(_sphere, pos);
+ }
+
+ bool overlap(const Triangle& _triangle, const Vec3& _pos)
+ {
+ const Vec3 uvw = barycentric(_triangle, _pos);
+
+ return uvw.x >= 0.0f
+ && uvw.y >= 0.0f
+ && uvw.z >= 0.0f
+ ;
+ }
+
+ bool overlap(const Triangle& _triangle, const Plane& _plane)
+ {
+ const float dist0 = distance(_plane, _triangle.v0);
+ const float dist1 = distance(_plane, _triangle.v1);
+ const float dist2 = distance(_plane, _triangle.v2);
+
+ const float minDist = min(dist0, dist1, dist2);
+ const float maxDist = max(dist0, dist1, dist2);
+
+ return 0.0f > minDist
+ && 0.0f < maxDist
+ ;
+ }
+
+ inline bool overlap(const Triangle& _triangleA, const Triangle& _triangleB, const Vec3& _axis)
+ {
+ const Interval ia = projectToAxis(_axis, _triangleA);
+ const Interval ib = projectToAxis(_axis, _triangleB);
+ return overlap(ia, ib);
+ }
+
+ bool overlap(const Triangle& _triangleA, const Triangle& _triangleB)
+ {
+ const Vec3 baA = sub(_triangleA.v1, _triangleA.v0);
+ const Vec3 cbA = sub(_triangleA.v2, _triangleA.v1);
+ const Vec3 acA = sub(_triangleA.v0, _triangleA.v2);
+
+ const Vec3 baB = sub(_triangleB.v1, _triangleB.v0);
+ const Vec3 cbB = sub(_triangleB.v2, _triangleB.v1);
+ const Vec3 acB = sub(_triangleB.v0, _triangleB.v2);
+
+ return overlap(_triangleA, _triangleB, cross(baA, cbA) )
+ && overlap(_triangleA, _triangleB, cross(baB, cbB) )
+ && overlap(_triangleA, _triangleB, cross(baB, baA) )
+ && overlap(_triangleA, _triangleB, cross(baB, cbA) )
+ && overlap(_triangleA, _triangleB, cross(baB, acA) )
+ && overlap(_triangleA, _triangleB, cross(cbB, baA) )
+ && overlap(_triangleA, _triangleB, cross(cbB, cbA) )
+ && overlap(_triangleA, _triangleB, cross(cbB, acA) )
+ && overlap(_triangleA, _triangleB, cross(acB, baA) )
+ && overlap(_triangleA, _triangleB, cross(acB, cbA) )
+ && overlap(_triangleA, _triangleB, cross(acB, acA) )
+ ;
+ }
+
+ template<typename Ty>
+ bool overlap(const Triangle& _triangle, const Ty& _ty)
+ {
+ Plane plane(init::None);
+ calcPlane(plane, _triangle);
+
+ plane.normal = neg(plane.normal);
+ plane.dist = -plane.dist;
+
+ const LineSegment line =
+ {
+ _ty.pos,
+ _ty.end,
+ };
+
+ Hit hit;
+ if (intersect(line, plane, &hit) )
+ {
+ return true;
+ }
+
+ const Vec3 pos = closestPoint(plane, hit.pos);
+ const Vec3 uvw = barycentric(_triangle, pos);
+
+ const float nr = -_ty.radius;
+
+ if (uvw.x >= nr
+ && uvw.y >= nr
+ && uvw.z >= nr)
+ {
+ return true;
+ }
+
+ const LineSegment ab = LineSegment{_triangle.v0, _triangle.v1};
+ const LineSegment bc = LineSegment{_triangle.v1, _triangle.v2};
+ const LineSegment ca = LineSegment{_triangle.v2, _triangle.v0};
+
+ float ta0 = 0.0f, tb0 = 0.0f;
+ const bool i0 = intersect(ta0, tb0, ab, line);
+
+ float ta1, tb1;
+ const bool i1 = intersect(ta1, tb1, bc, line);
+
+ float ta2, tb2;
+ const bool i2 = intersect(ta2, tb2, ca, line);
+
+ if (!i0
+ || !i1
+ || !i2)
+ {
+ return false;
+ }
+
+ ta0 = clamp(ta0, 0.0f, 1.0f);
+ ta1 = clamp(ta1, 0.0f, 1.0f);
+ ta2 = clamp(ta2, 0.0f, 1.0f);
+ tb0 = clamp(tb0, 0.0f, 1.0f);
+ tb1 = clamp(tb1, 0.0f, 1.0f);
+ tb2 = clamp(tb2, 0.0f, 1.0f);
+
+ const Vec3 pa0 = getPointAt(ab, ta0);
+ const Vec3 pa1 = getPointAt(bc, ta1);
+ const Vec3 pa2 = getPointAt(ca, ta2);
+
+ const Vec3 pb0 = getPointAt(line, tb0);
+ const Vec3 pb1 = getPointAt(line, tb1);
+ const Vec3 pb2 = getPointAt(line, tb2);
+
+ const float d0 = distanceSq(pa0, pb0);
+ const float d1 = distanceSq(pa1, pb1);
+ const float d2 = distanceSq(pa2, pb2);
+
+ if (d0 <= d1
+ && d0 <= d2)
+ {
+ return overlap(_ty, pa0);
+ }
+ else if (d1 <= d2)
+ {
+ return overlap(_ty, pa1);
+ }
+
+ return overlap(_ty, pa2);
+ }
+
+ bool overlap(const Triangle& _triangle, const Cylinder& _cylinder)
+ {
+ return overlap<Cylinder>(_triangle, _cylinder);
+ }
+
+ bool overlap(const Triangle& _triangle, const Capsule& _capsule)
+ {
+ return overlap<Capsule>(_triangle, _capsule);
+ }
+
+ bool overlap(const Triangle& _triangle, const Cone& _cone)
+ {
+ const LineSegment ab = LineSegment{_triangle.v0, _triangle.v1};
+ const LineSegment bc = LineSegment{_triangle.v1, _triangle.v2};
+ const LineSegment ca = LineSegment{_triangle.v2, _triangle.v0};
+
+ const LineSegment line =
+ {
+ _cone.pos,
+ _cone.end,
+ };
+
+ float ta0 = 0.0f, tb0 = 0.0f;
+ const bool i0 = intersect(ta0, tb0, ab, line);
+
+ float ta1, tb1;
+ const bool i1 = intersect(ta1, tb1, bc, line);
+
+ float ta2, tb2;
+ const bool i2 = intersect(ta2, tb2, ca, line);
+
+ if (!i0
+ || !i1
+ || !i2)
+ {
+ return false;
+ }
+
+ ta0 = clamp(ta0, 0.0f, 1.0f);
+ ta1 = clamp(ta1, 0.0f, 1.0f);
+ ta2 = clamp(ta2, 0.0f, 1.0f);
+ tb0 = clamp(tb0, 0.0f, 1.0f);
+ tb1 = clamp(tb1, 0.0f, 1.0f);
+ tb2 = clamp(tb2, 0.0f, 1.0f);
+
+ const Vec3 pa0 = getPointAt(ab, ta0);
+ const Vec3 pa1 = getPointAt(bc, ta1);
+ const Vec3 pa2 = getPointAt(ca, ta2);
+
+ const Vec3 pb0 = getPointAt(line, tb0);
+ const Vec3 pb1 = getPointAt(line, tb1);
+ const Vec3 pb2 = getPointAt(line, tb2);
+
+ const float d0 = distanceSq(pa0, pb0);
+ const float d1 = distanceSq(pa1, pb1);
+ const float d2 = distanceSq(pa2, pb2);
+
+ if (d0 <= d1
+ && d0 <= d2)
+ {
+ return overlap(_cone, pa0);
+ }
+ else if (d1 <= d2)
+ {
+ return overlap(_cone, pa1);
+ }
+
+ return overlap(_cone, pa2);
+ }
+
+ bool overlap(const Triangle& _triangle, const Disk& _disk)
+ {
+ if (!overlap(_triangle, Sphere{_disk.center, _disk.radius}) )
+ {
+ return false;
+ }
+
+ Plane plane(init::None);
+ calcPlane(plane, _disk.normal, _disk.center);
+
+ return overlap(_triangle, plane);
+ }
+
+ bool overlap(const Triangle& _triangle, const Obb& _obb)
+ {
+ const Srt srt = toSrt(_obb.mtx);
+
+ Aabb aabb;
+ toAabb(aabb, srt.scale);
+
+ const Quaternion invRotation = invert(srt.rotation);
+
+ const Triangle triangle =
+ {
+ mul(sub(_triangle.v0, srt.translation), invRotation),
+ mul(sub(_triangle.v1, srt.translation), invRotation),
+ mul(sub(_triangle.v2, srt.translation), invRotation),
+ };
+
+ return overlap(triangle, aabb);
+ }
+
+} // namespace bx
diff --git a/3rdparty/bx/src/bx.cpp b/3rdparty/bx/src/bx.cpp
index d6bdbf026c3..45b4d7528a7 100644
--- a/3rdparty/bx/src/bx.cpp
+++ b/3rdparty/bx/src/bx.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/debug.h>
#include <bx/readerwriter.h>
@@ -50,20 +49,20 @@ namespace bx
, const void* _src
, uint32_t _srcStride
, uint32_t _stride
- , uint32_t _num
+ , uint32_t _numStrides
)
{
if (_stride == _srcStride
&& _stride == _dstStride)
{
- memCopy(_dst, _src, _stride*_num);
+ memCopy(_dst, _src, _stride*_numStrides);
return;
}
const uint8_t* src = (const uint8_t*)_src;
uint8_t* dst = (uint8_t*)_dst;
- for (uint32_t ii = 0; ii < _num; ++ii, src += _srcStride, dst += _dstStride)
+ for (uint32_t ii = 0; ii < _numStrides; ++ii, src += _srcStride, dst += _dstStride)
{
memCopy(dst, src, _stride);
}
@@ -108,20 +107,20 @@ namespace bx
, const void* _src
, uint32_t _srcStride
, uint32_t _stride
- , uint32_t _num
+ , uint32_t _numStrides
)
{
if (_stride == _srcStride
&& _stride == _dstStride)
{
- memMove(_dst, _src, _stride*_num);
+ memMove(_dst, _src, _stride*_numStrides);
return;
}
const uint8_t* src = (const uint8_t*)_src;
uint8_t* dst = (uint8_t*)_dst;
- for (uint32_t ii = 0; ii < _num; ++ii, src += _srcStride, dst += _dstStride)
+ for (uint32_t ii = 0; ii < _numStrides; ++ii, src += _srcStride, dst += _dstStride)
{
memMove(dst, src, _stride);
}
@@ -186,15 +185,15 @@ namespace bx
}
///
- void gather(void* _dst, const void* _src, uint32_t _srcStride, uint32_t _stride, uint32_t _num)
+ void gather(void* _dst, const void* _src, uint32_t _srcStride, uint32_t _stride, uint32_t _numStrides)
{
- memMove(_dst, _stride, _src, _srcStride, _stride, _num);
+ memMove(_dst, _stride, _src, _srcStride, _stride, _numStrides);
}
///
- void scatter(void* _dst, uint32_t _dstStride, const void* _src, uint32_t _stride, uint32_t _num)
+ void scatter(void* _dst, uint32_t _dstStride, const void* _src, uint32_t _stride, uint32_t _numStrides)
{
- memMove(_dst, _dstStride, _src, _stride, _num, _stride);
+ memMove(_dst, _dstStride, _src, _stride, _stride, _numStrides);
}
} // namespace bx
diff --git a/3rdparty/bx/src/bx_p.h b/3rdparty/bx/src/bx_p.h
deleted file mode 100644
index d44901c58ee..00000000000
--- a/3rdparty/bx/src/bx_p.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
- */
-
-#ifndef BX_P_H_HEADER_GUARD
-#define BX_P_H_HEADER_GUARD
-
-#ifndef BX_CONFIG_DEBUG
-# define BX_CONFIG_DEBUG 0
-#endif // BX_CONFIG_DEBUG
-
-#if BX_CONFIG_DEBUG
-# define BX_TRACE _BX_TRACE
-# define BX_WARN _BX_WARN
-# define BX_ASSERT _BX_ASSERT
-# define BX_CONFIG_ALLOCATOR_DEBUG 1
-#endif // BX_CONFIG_DEBUG
-
-#define _BX_TRACE(_format, ...) \
- BX_MACRO_BLOCK_BEGIN \
- bx::debugPrintf(__FILE__ "(" BX_STRINGIZE(__LINE__) "): BX " _format "\n", ##__VA_ARGS__); \
- BX_MACRO_BLOCK_END
-
-#define _BX_WARN(_condition, _format, ...) \
- BX_MACRO_BLOCK_BEGIN \
- if (!BX_IGNORE_C4127(_condition) ) \
- { \
- BX_TRACE("WARN " _format, ##__VA_ARGS__); \
- } \
- BX_MACRO_BLOCK_END
-
-#define _BX_ASSERT(_condition, _format, ...) \
- BX_MACRO_BLOCK_BEGIN \
- if (!BX_IGNORE_C4127(_condition) ) \
- { \
- BX_TRACE("CHECK " _format, ##__VA_ARGS__); \
- bx::debugBreak(); \
- } \
- BX_MACRO_BLOCK_END
-
-#include <bx/bx.h>
-#include <bx/debug.h>
-
-#endif // BX_P_H_HEADER_GUARD
diff --git a/3rdparty/bx/src/commandline.cpp b/3rdparty/bx/src/commandline.cpp
index 2ff57f6dbd1..ca31636ca76 100644
--- a/3rdparty/bx/src/commandline.cpp
+++ b/3rdparty/bx/src/commandline.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/commandline.h>
#include <bx/string.h>
@@ -47,7 +46,7 @@ namespace bx
if ('"' == *curr)
{
term = '"';
- ++curr; // skip begining quote
+ ++curr; // skip beginning quote
}
else
{
diff --git a/3rdparty/bx/src/crtnone.cpp b/3rdparty/bx/src/crtnone.cpp
index 7852f374f44..6abdeeeb67f 100644
--- a/3rdparty/bx/src/crtnone.cpp
+++ b/3rdparty/bx/src/crtnone.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/debug.h>
#include <bx/file.h>
#include <bx/math.h>
@@ -338,6 +337,12 @@ extern "C" int fscanf(FILE* _stream, const char* _format, ...)
return -1;
}
+extern "C" int __isoc99_fscanf(FILE* _stream, const char* _format, ...)
+{
+ BX_UNUSED(_stream, _format);
+ return -1;
+}
+
FILE * stdout;
extern "C" FILE* fopen(const char* _filename, const char* _mode)
@@ -601,6 +606,11 @@ extern "C" void free(void* _ptr)
crt0::realloc(_ptr, 0);
}
+extern "C" void exit(int _exitCode)
+{
+ crt0::exit(_exitCode);
+}
+
#endif // BX_PLATFORM_*
extern "C" void abort(void)
@@ -621,6 +631,10 @@ void operator delete(void*)
{
}
+void operator delete(void*, size_t)
+{
+}
+
extern "C" void __cxa_pure_virtual(void)
{
}
diff --git a/3rdparty/bx/src/debug.cpp b/3rdparty/bx/src/debug.cpp
index b02e53f1380..8bbf1e6d122 100644
--- a/3rdparty/bx/src/debug.cpp
+++ b/3rdparty/bx/src/debug.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/debug.h>
#include <bx/string.h> // isPrint
#include <bx/readerwriter.h> // WriterI
diff --git a/3rdparty/bx/src/dtoa.cpp b/3rdparty/bx/src/dtoa.cpp
index 99b27a5a36c..a36314ed98d 100644
--- a/3rdparty/bx/src/dtoa.cpp
+++ b/3rdparty/bx/src/dtoa.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/cpu.h>
#include <bx/math.h>
#include <bx/string.h>
@@ -1120,7 +1119,7 @@ namespace bx
bool fromString(int32_t* _out, const StringView& _str)
{
- StringView str = bx::strLTrimSpace(_str);
+ StringView str = strLTrimSpace(_str);
const char* ptr = str.getPtr();
const char* term = str.getTerm();
diff --git a/3rdparty/bx/src/easing.cpp b/3rdparty/bx/src/easing.cpp
index ec4c4517196..38f35ec2cad 100644
--- a/3rdparty/bx/src/easing.cpp
+++ b/3rdparty/bx/src/easing.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/easing.h>
namespace bx
diff --git a/3rdparty/bx/src/file.cpp b/3rdparty/bx/src/file.cpp
index c47eb37a0b6..dab862006ae 100644
--- a/3rdparty/bx/src/file.cpp
+++ b/3rdparty/bx/src/file.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/file.h>
#ifndef BX_CONFIG_CRT_FILE_READER_WRITER
@@ -280,7 +279,7 @@ namespace bx
return false;
}
- m_fd = crt0::open(_filePath.get(), crt0::Open::Read, 0);
+ m_fd = crt0::open(_filePath.getCPtr(), crt0::Open::Read, 0);
if (0 >= m_fd)
{
@@ -361,7 +360,7 @@ namespace bx
return false;
}
- m_fd = crt0::open(_filePath.get(), _append ? crt0::Open::Append : crt0::Open::Write, 0600);
+ m_fd = crt0::open(_filePath.getCPtr(), _append ? crt0::Open::Append : crt0::Open::Write, 0600);
if (0 >= m_fd)
{
@@ -923,7 +922,7 @@ namespace bx
Error err;
DirectoryReader dr;
- if (!bx::open(&dr, _filePath) )
+ if (!open(&dr, _filePath, &err) )
{
BX_ERROR_SET(_err, kErrorNotDirectory, "File already exist, and is not directory.");
return false;
@@ -931,7 +930,7 @@ namespace bx
while (err.isOk() )
{
- bx::read(&dr, fi, &err);
+ read(&dr, fi, &err);
if (err.isOk() )
{
@@ -951,7 +950,7 @@ namespace bx
}
}
- bx::close(&dr);
+ close(&dr);
return remove(_filePath, _err);
}
diff --git a/3rdparty/bx/src/filepath.cpp b/3rdparty/bx/src/filepath.cpp
index 14b34782705..892bf80e48c 100644
--- a/3rdparty/bx/src/filepath.cpp
+++ b/3rdparty/bx/src/filepath.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/file.h>
#include <bx/os.h>
#include <bx/readerwriter.h>
diff --git a/3rdparty/bx/src/hash.cpp b/3rdparty/bx/src/hash.cpp
index bdef60796c0..0fcfaaca6c9 100644
--- a/3rdparty/bx/src/hash.cpp
+++ b/3rdparty/bx/src/hash.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/hash.h>
namespace bx
@@ -134,7 +133,7 @@ void HashCrc32::begin(Enum _type)
m_table = s_crcTable[_type];
}
-void HashCrc32::add(const void* _data, int _len)
+void HashCrc32::add(const void* _data, int32_t _len)
{
const uint8_t* data = (const uint8_t*)_data;
@@ -148,4 +147,122 @@ void HashCrc32::add(const void* _data, int _len)
m_hash = hash;
}
+struct HashMurmur2APod
+{
+ uint32_t m_hash;
+ uint32_t m_tail;
+ uint32_t m_count;
+ uint32_t m_size;
+};
+BX_STATIC_ASSERT(sizeof(HashMurmur2A) == sizeof(HashMurmur2APod) );
+
+BX_FORCE_INLINE void mmix(uint32_t& _h, uint32_t& _k)
+{
+ constexpr uint32_t kMurmurMul = 0x5bd1e995;
+ constexpr uint32_t kMurmurRightShift = 24;
+
+ _k *= kMurmurMul;
+ _k ^= _k >> kMurmurRightShift;
+ _k *= kMurmurMul;
+ _h *= kMurmurMul;
+ _h ^= _k;
+}
+
+static void mixTail(HashMurmur2APod& _self, const uint8_t*& _data, int32_t& _len)
+{
+ while (_len
+ && ( (_len<4) || _self.m_count)
+ )
+ {
+ _self.m_tail |= (*_data++) << (_self.m_count * 8);
+
+ _self.m_count++;
+ _len--;
+
+ if (_self.m_count == 4)
+ {
+ mmix(_self.m_hash, _self.m_tail);
+ _self.m_tail = 0;
+ _self.m_count = 0;
+ }
+ }
+}
+
+BX_FORCE_INLINE uint32_t readAligned(const uint8_t* _data)
+{
+ return *(uint32_t*)_data;
+}
+
+BX_FORCE_INLINE uint32_t readUnaligned(const uint8_t* _data)
+{
+ if (BX_ENABLED(BX_CPU_ENDIAN_BIG) )
+ {
+ return 0
+ | _data[0]<<24
+ | _data[1]<<16
+ | _data[2]<<8
+ | _data[3]
+ ;
+ }
+ else
+ {
+ return 0
+ | _data[0]
+ | _data[1]<<8
+ | _data[2]<<16
+ | _data[3]<<24
+ ;
+ }
+}
+
+typedef uint32_t (*ReadDataFn)(const uint8_t* _data);
+
+template<ReadDataFn FnT>
+static void addData(HashMurmur2APod& _self, const uint8_t* _data, int32_t _len)
+{
+ while (_len >= 4)
+ {
+ uint32_t kk = FnT(_data);
+
+ mmix(_self.m_hash, kk);
+
+ _data += 4;
+ _len -= 4;
+ }
+
+ mixTail(_self, _data, _len);
+}
+
+void HashMurmur2A::add(const void* _data, int32_t _len)
+{
+ HashMurmur2APod& self = *(HashMurmur2APod*)this;
+
+ const uint8_t* data = (const uint8_t*)_data;
+
+ m_size += _len;
+ mixTail(self, data, _len);
+
+ if (BX_UNLIKELY(!isAligned(data, 4) ) )
+ {
+ addData<readUnaligned>(self, data, _len);
+ return;
+ }
+
+ addData<readAligned>(self, data, _len);
+}
+
+uint32_t HashMurmur2A::end()
+{
+ constexpr uint32_t kMurmurMul = 0x5bd1e995;
+
+ mmix(m_hash, m_tail);
+ mmix(m_hash, m_size);
+
+ m_hash ^= m_hash >> 13;
+ m_hash *= kMurmurMul;
+ m_hash ^= m_hash >> 15;
+
+ return m_hash;
+}
+
} // namespace bx
diff --git a/3rdparty/bx/src/math.cpp b/3rdparty/bx/src/math.cpp
index 71f96c5ac20..8975d5bed25 100644
--- a/3rdparty/bx/src/math.cpp
+++ b/3rdparty/bx/src/math.cpp
@@ -1,12 +1,13 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/math.h>
#include <bx/uint32_t.h>
+#include <bx/string.h>
+
namespace bx
{
const float kInfinity = bitsToFloat(UINT32_C(0x7f800000) );
@@ -113,7 +114,7 @@ namespace bx
if (maxaxy == 0.0f)
{
- return 0.0f*sign(_y);
+ return _y < 0.0f ? -0.0f : 0.0f;
}
const float mxy = minaxy / maxaxy;
@@ -126,7 +127,7 @@ namespace bx
const float tmp5 = tmp4 * mxy;
const float tmp6 = ay > ax ? kPiHalf - tmp5 : tmp5;
const float tmp7 = _x < 0.0f ? kPi - tmp6 : tmp6;
- const float result = sign(_y)*tmp7;
+ const float result = _y < 0.0f ? -tmp7 : tmp7;
return result;
}
@@ -239,10 +240,10 @@ namespace bx
return result;
}
- void mtxLookAt(float* _result, const Vec3& _eye, const Vec3& _at, const Vec3& _up, Handness::Enum _handness)
+ void mtxLookAt(float* _result, const Vec3& _eye, const Vec3& _at, const Vec3& _up, Handedness::Enum _handedness)
{
const Vec3 view = normalize(
- Handness::Right == _handness
+ Handedness::Right == _handedness
? sub(_eye, _at)
: sub(_at, _eye)
);
@@ -269,7 +270,7 @@ namespace bx
_result[15] = 1.0f;
}
- static void mtxProjXYWH(float* _result, float _x, float _y, float _width, float _height, float _near, float _far, bool _homogeneousNdc, Handness::Enum _handness)
+ static void mtxProjXYWH(float* _result, float _x, float _y, float _width, float _height, float _near, float _far, bool _homogeneousNdc, Handedness::Enum _handedness)
{
const float diff = _far-_near;
const float aa = _homogeneousNdc ? ( _far+_near)/diff : _far/diff;
@@ -278,14 +279,14 @@ namespace bx
memSet(_result, 0, sizeof(float)*16);
_result[ 0] = _width;
_result[ 5] = _height;
- _result[ 8] = (Handness::Right == _handness) ? _x : -_x;
- _result[ 9] = (Handness::Right == _handness) ? _y : -_y;
- _result[10] = (Handness::Right == _handness) ? -aa : aa;
- _result[11] = (Handness::Right == _handness) ? -1.0f : 1.0f;
+ _result[ 8] = (Handedness::Right == _handedness) ? _x : -_x;
+ _result[ 9] = (Handedness::Right == _handedness) ? _y : -_y;
+ _result[10] = (Handedness::Right == _handedness) ? -aa : aa;
+ _result[11] = (Handedness::Right == _handedness) ? -1.0f : 1.0f;
_result[14] = -bb;
}
- void mtxProj(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, float _far, bool _homogeneousNdc, Handness::Enum _handness)
+ void mtxProj(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, float _far, bool _homogeneousNdc, Handedness::Enum _handedness)
{
const float invDiffRl = 1.0f/(_rt - _lt);
const float invDiffUd = 1.0f/(_ut - _dt);
@@ -293,22 +294,22 @@ namespace bx
const float height = 2.0f*_near * invDiffUd;
const float xx = (_rt + _lt) * invDiffRl;
const float yy = (_ut + _dt) * invDiffUd;
- mtxProjXYWH(_result, xx, yy, width, height, _near, _far, _homogeneousNdc, _handness);
+ mtxProjXYWH(_result, xx, yy, width, height, _near, _far, _homogeneousNdc, _handedness);
}
- void mtxProj(float* _result, const float _fov[4], float _near, float _far, bool _homogeneousNdc, Handness::Enum _handness)
+ void mtxProj(float* _result, const float _fov[4], float _near, float _far, bool _homogeneousNdc, Handedness::Enum _handedness)
{
- mtxProj(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _far, _homogeneousNdc, _handness);
+ mtxProj(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _far, _homogeneousNdc, _handedness);
}
- void mtxProj(float* _result, float _fovy, float _aspect, float _near, float _far, bool _homogeneousNdc, Handness::Enum _handness)
+ void mtxProj(float* _result, float _fovy, float _aspect, float _near, float _far, bool _homogeneousNdc, Handedness::Enum _handedness)
{
const float height = 1.0f/tan(toRad(_fovy)*0.5f);
const float width = height * 1.0f/_aspect;
- mtxProjXYWH(_result, 0.0f, 0.0f, width, height, _near, _far, _homogeneousNdc, _handness);
+ mtxProjXYWH(_result, 0.0f, 0.0f, width, height, _near, _far, _homogeneousNdc, _handedness);
}
- static void mtxProjInfXYWH(float* _result, float _x, float _y, float _width, float _height, float _near, bool _homogeneousNdc, Handness::Enum _handness, NearFar::Enum _nearFar)
+ static void mtxProjInfXYWH(float* _result, float _x, float _y, float _width, float _height, float _near, bool _homogeneousNdc, Handedness::Enum _handedness, NearFar::Enum _nearFar)
{
float aa;
float bb;
@@ -326,14 +327,14 @@ namespace bx
memSet(_result, 0, sizeof(float)*16);
_result[ 0] = _width;
_result[ 5] = _height;
- _result[ 8] = (Handness::Right == _handness) ? _x : -_x;
- _result[ 9] = (Handness::Right == _handness) ? _y : -_y;
- _result[10] = (Handness::Right == _handness) ? -aa : aa;
- _result[11] = (Handness::Right == _handness) ? -1.0f : 1.0f;
+ _result[ 8] = (Handedness::Right == _handedness) ? _x : -_x;
+ _result[ 9] = (Handedness::Right == _handedness) ? _y : -_y;
+ _result[10] = (Handedness::Right == _handedness) ? -aa : aa;
+ _result[11] = (Handedness::Right == _handedness) ? -1.0f : 1.0f;
_result[14] = -bb;
}
- void mtxProjInf(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, bool _homogeneousNdc, Handness::Enum _handness, NearFar::Enum _nearFar)
+ void mtxProjInf(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, bool _homogeneousNdc, Handedness::Enum _handedness, NearFar::Enum _nearFar)
{
const float invDiffRl = 1.0f/(_rt - _lt);
const float invDiffUd = 1.0f/(_ut - _dt);
@@ -341,22 +342,22 @@ namespace bx
const float height = 2.0f*_near * invDiffUd;
const float xx = (_rt + _lt) * invDiffRl;
const float yy = (_ut + _dt) * invDiffUd;
- mtxProjInfXYWH(_result, xx, yy, width, height, _near, _homogeneousNdc, _handness, _nearFar);
+ mtxProjInfXYWH(_result, xx, yy, width, height, _near, _homogeneousNdc, _handedness, _nearFar);
}
- void mtxProjInf(float* _result, const float _fov[4], float _near, bool _homogeneousNdc, Handness::Enum _handness, NearFar::Enum _nearFar)
+ void mtxProjInf(float* _result, const float _fov[4], float _near, bool _homogeneousNdc, Handedness::Enum _handedness, NearFar::Enum _nearFar)
{
- mtxProjInf(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _homogeneousNdc, _handness, _nearFar);
+ mtxProjInf(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _homogeneousNdc, _handedness, _nearFar);
}
- void mtxProjInf(float* _result, float _fovy, float _aspect, float _near, bool _homogeneousNdc, Handness::Enum _handness, NearFar::Enum _nearFar)
+ void mtxProjInf(float* _result, float _fovy, float _aspect, float _near, bool _homogeneousNdc, Handedness::Enum _handedness, NearFar::Enum _nearFar)
{
const float height = 1.0f/tan(toRad(_fovy)*0.5f);
const float width = height * 1.0f/_aspect;
- mtxProjInfXYWH(_result, 0.0f, 0.0f, width, height, _near, _homogeneousNdc, _handness, _nearFar);
+ mtxProjInfXYWH(_result, 0.0f, 0.0f, width, height, _near, _homogeneousNdc, _handedness, _nearFar);
}
- void mtxOrtho(float* _result, float _left, float _right, float _bottom, float _top, float _near, float _far, float _offset, bool _homogeneousNdc, Handness::Enum _handness)
+ void mtxOrtho(float* _result, float _left, float _right, float _bottom, float _top, float _near, float _far, float _offset, bool _homogeneousNdc, Handedness::Enum _handedness)
{
const float aa = 2.0f/(_right - _left);
const float bb = 2.0f/(_top - _bottom);
@@ -371,7 +372,7 @@ namespace bx
memSet(_result, 0, sizeof(float)*16);
_result[ 0] = aa;
_result[ 5] = bb;
- _result[10] = Handness::Right == _handness ? -cc : cc;
+ _result[10] = Handedness::Right == _handedness ? -cc : cc;
_result[12] = dd + _offset;
_result[13] = ee;
_result[14] = ff;
diff --git a/3rdparty/bx/src/mutex.cpp b/3rdparty/bx/src/mutex.cpp
index b3e9677e62b..0ef8597a8aa 100644
--- a/3rdparty/bx/src/mutex.cpp
+++ b/3rdparty/bx/src/mutex.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/mutex.h>
#if BX_CONFIG_SUPPORTS_THREADING
@@ -18,11 +17,15 @@
|| BX_PLATFORM_IOS \
|| BX_PLATFORM_OSX \
|| BX_PLATFORM_PS4 \
- || BX_PLATFORM_RPI
+ || BX_PLATFORM_RPI \
+ || BX_PLATFORM_NX
# include <pthread.h>
#elif BX_PLATFORM_WINDOWS \
|| BX_PLATFORM_WINRT \
|| BX_PLATFORM_XBOXONE
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif // WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <errno.h>
#endif // BX_PLATFORM_
@@ -56,12 +59,12 @@ namespace bx
{
uint32_t* futex = (uint32_t*)m_internal;
- if (State::Unlocked == bx::atomicCompareAndSwap<uint32_t>(futex, State::Unlocked, State::Locked) )
+ if (State::Unlocked == atomicCompareAndSwap<uint32_t>(futex, State::Unlocked, State::Locked) )
{
return;
}
- while (State::Unlocked != bx::atomicCompareAndSwap<uint32_t>(futex, State::Locked, State::Contested) )
+ while (State::Unlocked != atomicCompareAndSwap<uint32_t>(futex, State::Locked, State::Contested) )
{
crt0::futexWait(futex, State::Contested);
}
@@ -71,7 +74,7 @@ namespace bx
{
uint32_t* futex = (uint32_t*)m_internal;
- if (State::Contested == bx::atomicCompareAndSwap<uint32_t>(futex, State::Locked, State::Unlocked) )
+ if (State::Contested == atomicCompareAndSwap<uint32_t>(futex, State::Locked, State::Unlocked) )
{
crt0::futexWake(futex, State::Locked);
}
diff --git a/3rdparty/bx/src/os.cpp b/3rdparty/bx/src/os.cpp
index 12586aa8862..99394579b72 100644
--- a/3rdparty/bx/src/os.cpp
+++ b/3rdparty/bx/src/os.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/string.h>
#include <bx/os.h>
#include <bx/uint32_t.h>
@@ -15,6 +14,9 @@
#endif // BX_CRT_MSVC
#if BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif // WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <psapi.h>
#elif BX_PLATFORM_ANDROID \
@@ -183,12 +185,19 @@ namespace bx
BX_UNUSED(_filePath);
return NULL;
#else
- return ::dlopen(_filePath.getCPtr(), RTLD_LOCAL|RTLD_LAZY);
+ void* so = ::dlopen(_filePath.getCPtr(), RTLD_LOCAL|RTLD_LAZY);
+ BX_WARN(NULL != so, "dlopen failed: \"%s\".", ::dlerror() );
+ return so;
#endif // BX_PLATFORM_
}
void dlclose(void* _handle)
{
+ if (NULL == _handle)
+ {
+ return;
+ }
+
#if BX_PLATFORM_WINDOWS
::FreeLibrary( (HMODULE)_handle);
#elif BX_PLATFORM_EMSCRIPTEN \
@@ -206,7 +215,7 @@ namespace bx
{
const int32_t symbolMax = _symbol.getLength()+1;
char* symbol = (char*)alloca(symbolMax);
- bx::strCopy(symbol, symbolMax, _symbol);
+ strCopy(symbol, symbolMax, _symbol);
#if BX_PLATFORM_WINDOWS
return (void*)::GetProcAddress( (HMODULE)_handle, symbol);
@@ -226,7 +235,7 @@ namespace bx
{
const int32_t nameMax = _name.getLength()+1;
char* name = (char*)alloca(nameMax);
- bx::strCopy(name, nameMax, _name);
+ strCopy(name, nameMax, _name);
#if BX_PLATFORM_WINDOWS
DWORD len = ::GetEnvironmentVariableA(name, _out, *_inOutSize);
@@ -264,14 +273,14 @@ namespace bx
{
const int32_t nameMax = _name.getLength()+1;
char* name = (char*)alloca(nameMax);
- bx::strCopy(name, nameMax, _name);
+ strCopy(name, nameMax, _name);
char* value = NULL;
if (!_value.isEmpty() )
{
int32_t valueMax = _value.getLength()+1;
value = (char*)alloca(valueMax);
- bx::strCopy(value, valueMax, _value);
+ strCopy(value, valueMax, _value);
}
#if BX_PLATFORM_WINDOWS
@@ -341,7 +350,7 @@ namespace bx
int32_t len = 0;
for(uint32_t ii = 0; NULL != _argv[ii]; ++ii)
{
- len += snprintf(&temp[len], bx::uint32_imax(0, total-len)
+ len += snprintf(&temp[len], uint32_imax(0, total-len)
, "%s "
, _argv[ii]
);
@@ -370,4 +379,9 @@ namespace bx
#endif // BX_PLATFORM_LINUX || BX_PLATFORM_HURD
}
+ void exit(int32_t _exitCode)
+ {
+ ::exit(_exitCode);
+ }
+
} // namespace bx
diff --git a/3rdparty/bx/src/process.cpp b/3rdparty/bx/src/process.cpp
index 8dc2a6b0717..8afa1feb230 100644
--- a/3rdparty/bx/src/process.cpp
+++ b/3rdparty/bx/src/process.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/process.h>
#include <stdio.h>
diff --git a/3rdparty/bx/src/semaphore.cpp b/3rdparty/bx/src/semaphore.cpp
index 3e3083d3254..787b913a8d8 100644
--- a/3rdparty/bx/src/semaphore.cpp
+++ b/3rdparty/bx/src/semaphore.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/semaphore.h>
#if BX_CONFIG_SUPPORTS_THREADING
@@ -20,6 +19,9 @@
#elif BX_PLATFORM_WINDOWS \
|| BX_PLATFORM_WINRT \
|| BX_PLATFORM_XBOXONE
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif // WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <limits.h>
# if BX_PLATFORM_XBOXONE
diff --git a/3rdparty/bx/src/settings.cpp b/3rdparty/bx/src/settings.cpp
index daed2f1b90a..7f16eeee10f 100644
--- a/3rdparty/bx/src/settings.cpp
+++ b/3rdparty/bx/src/settings.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/settings.h>
namespace
diff --git a/3rdparty/bx/src/sort.cpp b/3rdparty/bx/src/sort.cpp
index ce1b3e3a8a4..31ad8c795f4 100644
--- a/3rdparty/bx/src/sort.cpp
+++ b/3rdparty/bx/src/sort.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/sort.h>
namespace bx
@@ -52,5 +51,124 @@ namespace bx
quickSortR(pivot, _data, _num, _stride, _fn);
}
+ bool isSorted(const void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn)
+ {
+ const uint8_t* data = (uint8_t*)_data;
+
+ for (uint32_t ii = 1; ii < _num; ++ii)
+ {
+ int32_t result = _fn(&data[(ii-1)*_stride], &data[ii*_stride]);
+
+ if (0 < result)
+ {
+ return false;
+ }
+ }
+
+ return true;
+ }
+
+ uint32_t unique(void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn)
+ {
+ if (0 == _num)
+ {
+ return 0;
+ }
+
+ uint8_t* data = (uint8_t*)_data;
+
+ uint32_t last = 0;
+
+ for (uint32_t ii = 1; ii < _num; ++ii)
+ {
+ int32_t result = _fn(&data[last*_stride], &data[ii*_stride]);
+ BX_ASSERT(0 >= result, "Performing unique on non-sorted array (ii %d, last %d)!", ii, last);
+
+ if (0 > result)
+ {
+ last++;
+ swap(&data[last*_stride], &data[ii*_stride], _stride);
+ }
+ }
+
+ return last+1;
+ }
+
+ uint32_t lowerBound(const void* _key, const void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn)
+ {
+ uint32_t offset = 0;
+ const uint8_t* data = (uint8_t*)_data;
+
+ for (uint32_t ll = _num; offset < ll;)
+ {
+ const uint32_t idx = (offset + ll) / 2;
+
+ int32_t result = _fn(_key, &data[idx * _stride]);
+
+ if (result <= 0)
+ {
+ ll = idx;
+ }
+ else
+ {
+ offset = idx + 1;
+ }
+ }
+
+ return offset;
+ }
+
+ uint32_t upperBound(const void* _key, const void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn)
+ {
+ uint32_t offset = 0;
+ const uint8_t* data = (uint8_t*)_data;
+
+ for (uint32_t ll = _num; offset < ll;)
+ {
+ const uint32_t idx = (offset + ll) / 2;
+
+ int32_t result = _fn(_key, &data[idx * _stride]);
+
+ if (result < 0)
+ {
+ ll = idx;
+ }
+ else
+ {
+ offset = idx + 1;
+ }
+ }
+
+ return offset;
+ }
+
+ int32_t binarySearch(const void* _key, const void* _data, uint32_t _num, uint32_t _stride, const ComparisonFn _fn)
+ {
+ uint32_t offset = 0;
+ const uint8_t* data = (uint8_t*)_data;
+
+ for (uint32_t ll = _num; offset < ll;)
+ {
+ const uint32_t idx = (offset + ll) / 2;
+
+ int32_t result = _fn(_key, &data[idx * _stride]);
+
+ if (result < 0)
+ {
+ ll = idx;
+ }
+ else if (result > 0)
+ {
+ offset = idx + 1;
+ }
+ else
+ {
+ return idx;
+ }
+ }
+
+ return ~offset;
+ }
+
} // namespace bx
diff --git a/3rdparty/bx/src/string.cpp b/3rdparty/bx/src/string.cpp
index 0c5f06d0301..94429ebd21d 100644
--- a/3rdparty/bx/src/string.cpp
+++ b/3rdparty/bx/src/string.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/allocator.h>
#include <bx/file.h>
#include <bx/hash.h>
@@ -135,7 +134,7 @@ namespace bx
{
for (int32_t ii = 0; ii < _len; ++ii)
{
- *_inOutStr = toLower(*_inOutStr);
+ _inOutStr[ii] = toLower(_inOutStr[ii]);
}
}
@@ -154,7 +153,7 @@ namespace bx
{
for (int32_t ii = 0; ii < _len; ++ii)
{
- *_inOutStr = toUpper(*_inOutStr);
+ _inOutStr[ii] = toUpper(_inOutStr[ii]);
}
}
@@ -413,7 +412,7 @@ namespace bx
++ptr;
--stringLen;
- // Search pattern lenght can't be longer than the string.
+ // Search pattern length can't be longer than the string.
if (findLen > stringLen)
{
return NULL;
@@ -481,7 +480,7 @@ namespace bx
}
}
- return _str;
+ return StringView(_str.getTerm(), _str.getTerm() );
}
StringView strLTrimSpace(const StringView& _str)
@@ -524,7 +523,9 @@ namespace bx
{
return StringView(ptr, ii + 1);
}
- }
+ }
+
+ return StringView(_str.getPtr(), _str.getPtr());
}
return _str;
@@ -543,6 +544,8 @@ namespace bx
return StringView(ptr, ii + 1);
}
}
+
+ return StringView(_str.getPtr(), _str.getPtr());
}
return _str;
@@ -813,6 +816,11 @@ namespace bx
return write(_writer, _str, _param.prec, _param, _err);
}
+ static int32_t write(WriterI* _writer, const StringView& _str, const Param& _param, Error* _err)
+ {
+ return write(_writer, _str.getPtr(), min(_param.prec, _str.getLength() ), _param, _err);
+ }
+
static int32_t write(WriterI* _writer, int32_t _i, const Param& _param, Error* _err)
{
char str[33];
@@ -875,30 +883,39 @@ namespace bx
return 0;
}
- if (_param.upper)
- {
- toUpperUnsafe(str, len);
- }
-
const char* dot = strFind(str, INT32_MAX, '.');
if (NULL != dot)
{
- const int32_t prec = INT32_MAX == _param.prec ? 6 : _param.prec;
- const int32_t precLen = int32_t(
- dot
- + uint32_min(prec + _param.spec, 1)
- + prec
- - str
- );
- if (precLen > len)
+ const int32_t prec = INT32_MAX == _param.prec ? 6 : _param.prec;
+ const char* strEnd = str + len;
+ const char* exponent = strFind(str, INT32_MAX, 'e');
+ const char* fracEnd = NULL != exponent ? exponent : strEnd;
+
+ char* fracBegin = &str[dot - str + min(prec + _param.spec, 1)];
+ const int32_t curPrec = int32_t(fracEnd - fracBegin);
+
+ // Move exponent to its final location after trimming or adding extra 0s.
+ if (fracEnd != strEnd)
+ {
+ const int32_t exponentLen = int32_t(strEnd - fracEnd);
+ char* finalExponentPtr = &fracBegin[prec];
+ memMove(finalExponentPtr, fracEnd, exponentLen);
+
+ finalExponentPtr[exponentLen] = '\0';
+ len = int32_t(&finalExponentPtr[exponentLen] - str);
+ }
+ else
{
- for (int32_t ii = len; ii < precLen; ++ii)
+ len = (int32_t)(fracBegin + prec - str);
+ }
+
+ if (curPrec < prec)
+ {
+ for (int32_t ii = curPrec; ii < prec; ++ii)
{
- str[ii] = '0';
+ fracBegin[ii] = '0';
}
- str[precLen] = '\0';
}
- len = precLen;
}
return write(_writer, str, len, _param, _err);
@@ -939,17 +956,22 @@ namespace bx
}
else if ('%' == ch)
{
- // %[flags][width][.precision][length sub-specifier]specifier
- read(&reader, ch);
+ // %[Flags][Width][.Precision][Leegth]Type
+ read(&reader, ch, &err);
Param param;
- // flags
- while (' ' == ch
+ // Reference(s):
+ // - Flags field
+ // https://en.wikipedia.org/wiki/Printf_format_string#Flags_field
+ //
+ while (err.isOk()
+ && ( ' ' == ch
|| '-' == ch
|| '+' == ch
|| '0' == ch
|| '#' == ch)
+ )
{
switch (ch)
{
@@ -961,7 +983,7 @@ namespace bx
case '#': param.spec = true; break;
}
- read(&reader, ch);
+ read(&reader, ch, &err);
}
if (param.left)
@@ -969,10 +991,13 @@ namespace bx
param.fill = ' ';
}
- // width
+ // Reference(s):
+ // - Width field
+ // https://en.wikipedia.org/wiki/Printf_format_string#Width_field
+ //
if ('*' == ch)
{
- read(&reader, ch);
+ read(&reader, ch, &err);
param.width = va_arg(_argList, int32_t);
if (0 > param.width)
@@ -984,49 +1009,57 @@ namespace bx
}
else
{
- while (isNumeric(ch) )
+ while (err.isOk()
+ && isNumeric(ch) )
{
param.width = param.width * 10 + ch - '0';
- read(&reader, ch);
+ read(&reader, ch, &err);
}
}
- // .precision
+ // Reference(s):
+ // - Precision field
+ // https://en.wikipedia.org/wiki/Printf_format_string#Precision_field
if ('.' == ch)
{
- read(&reader, ch);
+ read(&reader, ch, &err);
if ('*' == ch)
{
- read(&reader, ch);
+ read(&reader, ch, &err);
param.prec = va_arg(_argList, int32_t);
}
else
{
param.prec = 0;
- while (isNumeric(ch) )
+ while (err.isOk()
+ && isNumeric(ch) )
{
param.prec = param.prec * 10 + ch - '0';
- read(&reader, ch);
+ read(&reader, ch, &err);
}
}
}
- // length sub-specifier
- while ('h' == ch
+ // Reference(s):
+ // - Length field
+ // https://en.wikipedia.org/wiki/Printf_format_string#Length_field
+ while (err.isOk()
+ && ( 'h' == ch
|| 'I' == ch
|| 'l' == ch
|| 'j' == ch
|| 't' == ch
|| 'z' == ch)
+ )
{
switch (ch)
{
default: break;
case 'j': param.bits = sizeof(intmax_t )*8; break;
- case 't': param.bits = sizeof(size_t )*8; break;
- case 'z': param.bits = sizeof(ptrdiff_t)*8; break;
+ case 't': param.bits = sizeof(ptrdiff_t)*8; break;
+ case 'z': param.bits = sizeof(size_t )*8; break;
case 'h': case 'I': case 'l':
switch (ch)
@@ -1036,14 +1069,14 @@ namespace bx
default: break;
}
- read(&reader, ch);
+ read(&reader, ch, &err);
switch (ch)
{
case 'h': param.bits = sizeof(signed char )*8; break;
case 'l': param.bits = sizeof(long long int)*8; break;
case '3':
case '6':
- read(&reader, ch);
+ read(&reader, ch, &err);
switch (ch)
{
case '2': param.bits = sizeof(int32_t)*8; break;
@@ -1057,11 +1090,18 @@ namespace bx
break;
}
- read(&reader, ch);
+ read(&reader, ch, &err);
+ }
+
+ if (!err.isOk() )
+ {
+ break;
}
- // specifier
- switch (toLower(ch) )
+ // Reference(s):
+ // - Type field
+ // https://en.wikipedia.org/wiki/Printf_format_string#Type_field
+ switch (ch)
{
case 'c':
size += write(_writer, char(va_arg(_argList, int32_t) ), param, _err);
@@ -1071,6 +1111,10 @@ namespace bx
size += write(_writer, va_arg(_argList, const char*), param, _err);
break;
+ case 'S':
+ size += write(_writer, *va_arg(_argList, const StringView*), param, _err);
+ break;
+
case 'o':
param.base = 8;
switch (param.bits)
@@ -1091,8 +1135,11 @@ namespace bx
break;
case 'e':
+ case 'E':
case 'f':
+ case 'F':
case 'g':
+ case 'G':
param.upper = isUpper(ch);
size += write(_writer, va_arg(_argList, double), param, _err);
break;
@@ -1102,6 +1149,7 @@ namespace bx
break;
case 'x':
+ case 'X':
param.base = 16;
param.upper = isUpper(ch);
switch (param.bits)
@@ -1120,6 +1168,10 @@ namespace bx
}
break;
+ case 'n':
+ *va_arg(_argList, int32_t*) = size;
+ break;
+
default:
size += write(_writer, ch, _err);
break;
diff --git a/3rdparty/bx/src/thread.cpp b/3rdparty/bx/src/thread.cpp
index 17ace0927e7..f5e5f81bc21 100644
--- a/3rdparty/bx/src/thread.cpp
+++ b/3rdparty/bx/src/thread.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/os.h>
#include <bx/thread.h>
@@ -22,11 +21,12 @@
|| BX_PLATFORM_IOS \
|| BX_PLATFORM_OSX \
|| BX_PLATFORM_PS4 \
- || BX_PLATFORM_RPI
+ || BX_PLATFORM_RPI \
+ || BX_PLATFORM_NX
# include <pthread.h>
-# if defined(__FreeBSD__)
+# if BX_PLATFORM_BSD
# include <pthread_np.h>
-# endif
+# endif // BX_PLATFORM_BSD
# if BX_PLATFORM_LINUX && (BX_CRT_GLIBC < 21200)
# include <sys/prctl.h>
# endif // BX_PLATFORM_
@@ -34,6 +34,9 @@
|| BX_PLATFORM_WINRT \
|| BX_PLATFORM_XBOXONE \
|| BX_PLATFORM_WINRT
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif // WIN32_LEAN_AND_MEAN
# include <windows.h>
# include <limits.h>
# include <errno.h>
@@ -264,7 +267,7 @@ namespace bx
if (NULL != SetThreadDescription)
{
- uint32_t length = (uint32_t)bx::strLen(_name)+1;
+ uint32_t length = (uint32_t)strLen(_name)+1;
uint32_t size = length*sizeof(wchar_t);
wchar_t* name = (wchar_t*)alloca(size);
mbstowcs(name, _name, size-2);
diff --git a/3rdparty/bx/src/timer.cpp b/3rdparty/bx/src/timer.cpp
index 45806b10777..faecf822e10 100644
--- a/3rdparty/bx/src/timer.cpp
+++ b/3rdparty/bx/src/timer.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#include "bx_p.h"
#include <bx/timer.h>
#if BX_CRT_NONE
@@ -13,6 +12,9 @@
#elif BX_PLATFORM_EMSCRIPTEN
# include <emscripten.h>
#elif BX_PLATFORM_WINDOWS || BX_PLATFORM_XBOXONE || BX_PLATFORM_WINRT
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif // WIN32_LEAN_AND_MEAN
# include <windows.h>
#else
# include <sys/time.h> // gettimeofday
diff --git a/3rdparty/bx/src/url.cpp b/3rdparty/bx/src/url.cpp
index ce02bd35bd8..5421fd01a47 100644
--- a/3rdparty/bx/src/url.cpp
+++ b/3rdparty/bx/src/url.cpp
@@ -1,9 +1,8 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
* License: https://github.com/bkaradzic/bnet#license-bsd-2-clause
*/
-#include "bx_p.h"
#include <bx/url.h>
namespace bx
diff --git a/3rdparty/bx/tests/allocator_test.cpp b/3rdparty/bx/tests/allocator_test.cpp
new file mode 100644
index 00000000000..635d01a3175
--- /dev/null
+++ b/3rdparty/bx/tests/allocator_test.cpp
@@ -0,0 +1,78 @@
+/*
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
+ */
+
+#include "test.h"
+
+#include <bx/allocator.h>
+
+struct MockNonFreeingAllocator : public bx::AllocatorI
+{
+ MockNonFreeingAllocator()
+ : m_sbrk(1)
+ {
+ }
+
+ ~MockNonFreeingAllocator() override
+ {
+ }
+
+ void* realloc(void* _ptr, size_t _size, size_t _align, const char* _file, uint32_t _line) override
+ {
+ BX_ASSERT(_ptr == NULL, "MockNonFreeingAllocator can't realloc or free.");
+ BX_ASSERT(m_sbrk + _size < BX_COUNTOF(m_storage), "");
+ BX_UNUSED(_ptr, _file, _line);
+
+ const uint32_t sbrk = bx::alignUp(m_sbrk, bx::max(_align, 1) );
+ m_sbrk = sbrk + _size;
+
+ return &m_storage[sbrk];
+ }
+
+ uint32_t m_sbrk;
+ BX_ALIGN_DECL(256, uint8_t) m_storage[0x10000];
+};
+
+bool testAlignment(size_t _expected, void* _ptr)
+{
+ bool aligned = bx::isAligned(_ptr, _expected);
+// BX_TRACE("%p, %d", _ptr, _expected);
+ BX_WARN(aligned, "%p not aligned to %d bytes.", _ptr, _expected);
+ return aligned;
+}
+
+TEST_CASE("Allocator", "")
+{
+ MockNonFreeingAllocator mnfa;
+
+ REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(2, bx::alloc (&mnfa, 1, 2 ) ) );
+ REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(4, bx::alloc (&mnfa, 1, 4 ) ) );
+ REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(8, bx::alloc (&mnfa, 1, 8 ) ) );
+ REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(16, bx::alloc (&mnfa, 1, 16 ) ) );
+ REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(32, bx::alloc (&mnfa, 1, 32 ) ) );
+ REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(64, bx::alloc (&mnfa, 1, 64 ) ) );
+ REQUIRE(testAlignment(1, bx::alloc (&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(128, bx::alloc (&mnfa, 1, 128) ) );
+
+ REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(2, bx::alignedAlloc(&mnfa, 1, 2 ) ) );
+ REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(4, bx::alignedAlloc(&mnfa, 1, 4 ) ) );
+ REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(8, bx::alignedAlloc(&mnfa, 1, 8 ) ) );
+ REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(16, bx::alignedAlloc(&mnfa, 1, 16 ) ) );
+ REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(32, bx::alignedAlloc(&mnfa, 1, 32 ) ) );
+ REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(64, bx::alignedAlloc(&mnfa, 1, 64 ) ) );
+ REQUIRE(testAlignment(1, bx::alignedAlloc(&mnfa, 1, 1 ) ) );
+ REQUIRE(testAlignment(128, bx::alignedAlloc(&mnfa, 1, 128) ) );
+}
diff --git a/3rdparty/bx/tests/atomic_test.cpp b/3rdparty/bx/tests/atomic_test.cpp
index 43d87b63589..a4278f3138f 100644
--- a/3rdparty/bx/tests/atomic_test.cpp
+++ b/3rdparty/bx/tests/atomic_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
diff --git a/3rdparty/bx/tests/crt_test.cpp b/3rdparty/bx/tests/crt_test.cpp
index d40270641b8..68476a12cfa 100644
--- a/3rdparty/bx/tests/crt_test.cpp
+++ b/3rdparty/bx/tests/crt_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
@@ -23,14 +23,14 @@ TEST_CASE("memSet", "")
TEST_CASE("memMove", "")
{
- const char* orignal = "xxxxabvgd";
+ const char* original = "xxxxabvgd";
char str[] = { 'x', 'x', 'x', 'x', 'a', 'b', 'v', 'g', 'd' };
bx::memMove(&str[4], &str[4], 0);
- REQUIRE(0 == bx::memCmp(str, orignal, 9) );
+ REQUIRE(0 == bx::memCmp(str, original, 9) );
bx::memMove(&str[4], &str[4], 5);
- REQUIRE(0 == bx::memCmp(str, orignal, 9) );
+ REQUIRE(0 == bx::memCmp(str, original, 9) );
bx::memMove(str, &str[4], 5);
REQUIRE(0 == bx::memCmp(str, "abvgd", 5) );
@@ -39,5 +39,20 @@ TEST_CASE("memMove", "")
REQUIRE(str[4] == 'a' );
bx::memSet(str, 'x', 4);
- REQUIRE(0 == bx::memCmp(str, orignal, 9) );
+ REQUIRE(0 == bx::memCmp(str, original, 9) );
+}
+
+TEST_CASE("scatter/gather", "")
+{
+ const char* str = "a\0b\0v\0g\0d";
+
+ char tmp0[64];
+ bx::gather(tmp0, str, 2, 1, 5);
+ REQUIRE(0 == bx::memCmp(tmp0, "abvgd", 5) );
+
+ char tmp1[64];
+ bx::scatter(tmp1, 2, tmp0, 1, 5);
+ bx::memSet(&tmp1[1], 2, 0, 1, 5);
+ REQUIRE(0 == bx::memCmp(tmp1, str, 5) );
+
}
diff --git a/3rdparty/bx/tests/dbg.h b/3rdparty/bx/tests/dbg.h
index 880b0188de4..9aee6bb77a4 100644
--- a/3rdparty/bx/tests/dbg.h
+++ b/3rdparty/bx/tests/dbg.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#ifndef DBG_H_HEADER_GUARD
diff --git a/3rdparty/bx/tests/easing_test.cpp b/3rdparty/bx/tests/easing_test.cpp
index ff0a81934c8..44f6f7f987e 100644
--- a/3rdparty/bx/tests/easing_test.cpp
+++ b/3rdparty/bx/tests/easing_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
@@ -42,7 +42,7 @@ TEST_CASE("easing", "")
if (vv >= ys
&& vv < ye)
{
- bx::write(writer, "*");
+ bx::write(writer, &err, "*");
break;
}
}
diff --git a/3rdparty/bx/tests/filepath_test.cpp b/3rdparty/bx/tests/filepath_test.cpp
index afd46f6bf58..7484c48eab8 100644
--- a/3rdparty/bx/tests/filepath_test.cpp
+++ b/3rdparty/bx/tests/filepath_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
diff --git a/3rdparty/bx/tests/handle_bench.cpp b/3rdparty/bx/tests/handle_bench.cpp
index a7c88a864b8..f6f1b203fc5 100644
--- a/3rdparty/bx/tests/handle_bench.cpp
+++ b/3rdparty/bx/tests/handle_bench.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include <bx/timer.h>
diff --git a/3rdparty/bx/tests/handle_test.cpp b/3rdparty/bx/tests/handle_test.cpp
index 80ff28cda01..0d91e51883d 100644
--- a/3rdparty/bx/tests/handle_test.cpp
+++ b/3rdparty/bx/tests/handle_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
diff --git a/3rdparty/bx/tests/hash_test.cpp b/3rdparty/bx/tests/hash_test.cpp
index 56556e9d91e..cc827aee0fc 100644
--- a/3rdparty/bx/tests/hash_test.cpp
+++ b/3rdparty/bx/tests/hash_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
@@ -29,19 +29,22 @@ void makeCrcTable(uint32_t _poly)
struct HashTest
{
- uint32_t crc32;
+ uint32_t crc32[bx::HashCrc32::Count];
uint32_t adler32;
+ uint32_t murmur2a;
const char* input;
};
const HashTest s_hashTest[] =
{
- { 0, 1, "" },
- { 0xe8b7be43, 0x00620062, "a" },
- { 0x9e83486d, 0x012600c4, "ab" },
- { 0xc340daab, 0x06060205, "abvgd" },
- { 0x07642fe2, 0x020a00d6, "1389" },
- { 0x26d75737, 0x04530139, "555333" },
+ // Crc32 | Adler32 | Murmur2A | Input
+ // Ieee Castagnoli Koopman | | |
+ { { 0, 0, 0 }, 1, 0, "" },
+ { { 0xe8b7be43, 0xc1d04330, 0x0da2aa8a }, 0x00620062, 0x0803888b, "a" },
+ { { 0x9e83486d, 0xe2a22936, 0x31ec935a }, 0x012600c4, 0x618515af, "ab" },
+ { { 0xc340daab, 0x49e1b6e3, 0x945a1e78 }, 0x06060205, 0x94e3dc4d, "abvgd" },
+ { { 0x07642fe2, 0x45a04162, 0x3d4bf72d }, 0x020a00d6, 0xe602fc07, "1389" },
+ { { 0x26d75737, 0xb73d7b80, 0xd524eb40 }, 0x04530139, 0x58d37863, "555333" },
};
TEST_CASE("HashCrc32", "")
@@ -58,10 +61,13 @@ TEST_CASE("HashCrc32", "")
{
const HashTest& test = s_hashTest[ii];
- bx::HashCrc32 hash;
- hash.begin();
- hash.add(test.input, bx::strLen(test.input) );
- REQUIRE(test.crc32 == hash.end() );
+ for (uint32_t jj = 0; jj < bx::HashCrc32::Count; ++jj)
+ {
+ bx::HashCrc32 hash;
+ hash.begin(bx::HashCrc32::Enum(jj) );
+ hash.add(test.input, bx::strLen(test.input) );
+ REQUIRE(test.crc32[jj] == hash.end() );
+ }
}
}
@@ -77,3 +83,82 @@ TEST_CASE("HashAdler32", "")
REQUIRE(test.adler32 == hash.end() );
}
}
+
+/*-----------------------------------------------------------------------------
+// MurmurHash2A, by Austin Appleby
+//
+// This is a variant of MurmurHash2 modified to use the Merkle-Damgard
+// construction. Bulk speed should be identical to Murmur2, small-key speed
+// will be 10%-20% slower due to the added overhead at the end of the hash.
+//
+// This variant fixes a minor issue where null keys were more likely to
+// collide with each other than expected, and also makes the function
+// more amenable to incremental implementations.
+*/
+
+#define mmix(h,k) { k *= m; k ^= k >> r; k *= m; h *= m; h ^= k; }
+
+uint32_t MurmurHash2A(const void * key, int len, uint32_t seed = 0)
+{
+ const uint32_t m = 0x5bd1e995;
+ const int r = 24;
+ uint32_t l = len;
+
+ const unsigned char * data = (const unsigned char *)key;
+
+ uint32_t h = seed;
+
+ while(len >= 4)
+ {
+ uint32_t k = *(uint32_t*)data;
+
+ mmix(h,k);
+
+ data += 4;
+ len -= 4;
+ }
+
+ uint32_t t = 0;
+
+ switch(len)
+ {
+ case 3: t ^= data[2] << 16; BX_FALLTHROUGH;
+ case 2: t ^= data[1] << 8; BX_FALLTHROUGH;
+ case 1: t ^= data[0];
+ };
+
+ mmix(h,t);
+ mmix(h,l);
+
+ h ^= h >> 13;
+ h *= m;
+ h ^= h >> 15;
+
+ return h;
+}
+
+TEST_CASE("HashMurmur2A", "")
+{
+ uint32_t seed = 0;
+
+ for (uint32_t ii = 0; ii < BX_COUNTOF(s_hashTest); ++ii)
+ {
+ const HashTest& test = s_hashTest[ii];
+
+ bx::HashMurmur2A hash;
+ hash.begin(seed);
+ hash.add(test.input, bx::strLen(test.input) );
+ REQUIRE(test.murmur2a == hash.end() );
+
+ REQUIRE(test.murmur2a == MurmurHash2A(test.input, bx::strLen(test.input), seed) );
+ }
+}
+
+TEST_CASE("HashMurmur2A-Separate-Add", "")
+{
+ bx::HashMurmur2A hash;
+ hash.begin();
+ hash.add("0123456789");
+ hash.add("abvgd012345");
+ REQUIRE(MurmurHash2A("0123456789abvgd012345", 21) == hash.end() );
+}
diff --git a/3rdparty/bx/tests/macros_test.cpp b/3rdparty/bx/tests/macros_test.cpp
index afcc75788bd..75081b95d70 100644
--- a/3rdparty/bx/tests/macros_test.cpp
+++ b/3rdparty/bx/tests/macros_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
@@ -13,7 +13,6 @@ BX_STATIC_ASSERT(false
|| BX_CRT_LIBCXX
|| BX_CRT_MINGW
|| BX_CRT_MSVC
- || BX_CRT_MUSL
|| BX_CRT_NEWLIB
);
@@ -48,4 +47,30 @@ TEST(macros)
CHECK_EQUAL(6, BX_VA_ARGS_COUNT(1, 2, 3, 4, 5, 6) );
CHECK_EQUAL(0, bx::strCmp(BX_STRINGIZE(TEST 1234 %^&*), "TEST 1234 %^&*") );
+
+ {
+ struct PodStruct { int32_t x, y, z; };
+ CHECK_EQUAL(0, BX_OFFSETOF(PodStruct, x) );
+ CHECK_EQUAL(4, BX_OFFSETOF(PodStruct, y) );
+ CHECK_EQUAL(8, BX_OFFSETOF(PodStruct, z) );
+ }
+
+ {
+ union PodUnion { int32_t x, y, z; };
+ CHECK_EQUAL(BX_OFFSETOF(PodUnion, x), BX_OFFSETOF(PodUnion, y) );
+ CHECK_EQUAL(BX_OFFSETOF(PodUnion, y), BX_OFFSETOF(PodUnion, z) );
+ }
+
+ {
+ struct NonPodStruct { NonPodStruct() { } int32_t x, y, z; };
+ CHECK_EQUAL(0, BX_OFFSETOF(NonPodStruct, x) );
+ CHECK_EQUAL(4, BX_OFFSETOF(NonPodStruct, y) );
+ CHECK_EQUAL(8, BX_OFFSETOF(NonPodStruct, z) );
+ }
+
+ {
+ union NonPodUnion { NonPodUnion() { } int32_t x, y, z; };
+ CHECK_EQUAL(BX_OFFSETOF(NonPodUnion, x), BX_OFFSETOF(NonPodUnion, y) );
+ CHECK_EQUAL(BX_OFFSETOF(NonPodUnion, y), BX_OFFSETOF(NonPodUnion, z) );
+ }
}
diff --git a/3rdparty/bx/tests/main_test.cpp b/3rdparty/bx/tests/main_test.cpp
index 251d45cb142..93ee589e601 100644
--- a/3rdparty/bx/tests/main_test.cpp
+++ b/3rdparty/bx/tests/main_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
diff --git a/3rdparty/bx/tests/math_bench.cpp b/3rdparty/bx/tests/math_bench.cpp
index 7a9fb9af613..488369cad4e 100644
--- a/3rdparty/bx/tests/math_bench.cpp
+++ b/3rdparty/bx/tests/math_bench.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include <bx/math.h>
diff --git a/3rdparty/bx/tests/math_test.cpp b/3rdparty/bx/tests/math_test.cpp
index fa3a00d6e4c..511655940df 100644
--- a/3rdparty/bx/tests/math_test.cpp
+++ b/3rdparty/bx/tests/math_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
@@ -8,6 +8,8 @@
#include <bx/file.h>
#include <math.h>
+#include <stdint.h> // intXX_t
+#include <limits.h> // UCHAR_*
#if !BX_COMPILER_MSVC || BX_COMPILER_MSVC >= 1800
TEST_CASE("isFinite, isInfinite, isNan", "")
@@ -63,6 +65,7 @@ TEST_CASE("log2", "")
TEST_CASE("libm", "")
{
bx::WriterI* writer = bx::getNullOut();
+ bx::Error err;
REQUIRE(1389.0f == bx::abs(-1389.0f) );
REQUIRE(1389.0f == bx::abs( 1389.0f) );
@@ -70,7 +73,6 @@ TEST_CASE("libm", "")
REQUIRE( 0.0f == bx::abs( 0.0f) );
REQUIRE(389.0f == bx::mod(1389.0f, 1000.0f) );
- REQUIRE(bx::isNan(bx::mod(0.0f, 0.0f) ) );
REQUIRE( 13.0f == bx::floor( 13.89f) );
REQUIRE(-14.0f == bx::floor(-13.89f) );
@@ -79,17 +81,15 @@ TEST_CASE("libm", "")
REQUIRE( 13.0f == bx::trunc( 13.89f) );
REQUIRE(-13.0f == bx::trunc(-13.89f) );
- REQUIRE(bx::equal( 0.89f, bx::fract( 13.89f), 0.000001f) );
- REQUIRE(bx::equal(-0.89f, bx::fract(-13.89f), 0.000001f) );
-
- bx::Error err;
+ REQUIRE(bx::isEqual( 0.89f, bx::fract( 13.89f), 0.000001f) );
+ REQUIRE(bx::isEqual(-0.89f, bx::fract(-13.89f), 0.000001f) );
for (int32_t yy = -10; yy < 10; ++yy)
{
for (float xx = -100.0f; xx < 100.0f; xx += 0.1f)
{
bx::write(writer, &err, "ldexp(%f, %d) == %f (expected: %f)\n", xx, yy, bx::ldexp(xx, yy), ::ldexpf(xx, yy) );
- REQUIRE(bx::equal(bx::ldexp(xx, yy), ::ldexpf(xx, yy), 0.00001f) );
+ REQUIRE(bx::isEqual(bx::ldexp(xx, yy), ::ldexpf(xx, yy), 0.00001f) );
}
}
@@ -97,85 +97,116 @@ TEST_CASE("libm", "")
{
bx::write(writer, &err, "exp(%f) == %f (expected: %f)\n", xx, bx::exp(xx), ::expf(xx) );
REQUIRE(err.isOk() );
- REQUIRE(bx::equal(bx::exp(xx), ::expf(xx), 0.00001f) );
+ REQUIRE(bx::isEqual(bx::exp(xx), ::expf(xx), 0.00001f) );
}
for (float xx = 0.0f; xx < 100.0f; xx += 0.1f)
{
bx::write(writer, &err, "rsqrt(%f) == %f (expected: %f)\n", xx, bx::rsqrt(xx), 1.0f/::sqrtf(xx) );
REQUIRE(err.isOk() );
- REQUIRE(bx::equal(bx::rsqrt(xx), 1.0f/::sqrtf(xx), 0.00001f) );
+ REQUIRE(bx::isEqual(bx::rsqrt(xx), 1.0f/::sqrtf(xx), 0.00001f) );
+ }
+
+ for (float xx = 0.0f; xx < 1000000.0f; xx += 1000.f)
+ {
+ bx::write(writer, &err, "sqrt(%f) == %f (expected: %f)\n", xx, bx::sqrt(xx), ::sqrtf(xx) );
+ REQUIRE(err.isOk() );
+ REQUIRE(bx::isEqual(bx::sqrt(xx), ::sqrtf(xx), 0.00001f) );
}
for (float xx = 0.0f; xx < 100.0f; xx += 0.1f)
{
bx::write(writer, &err, "sqrt(%f) == %f (expected: %f)\n", xx, bx::sqrt(xx), ::sqrtf(xx) );
REQUIRE(err.isOk() );
- REQUIRE(bx::equal(bx::sqrt(xx), ::sqrtf(xx), 0.00001f) );
+ REQUIRE(bx::isEqual(bx::sqrt(xx), ::sqrtf(xx), 0.00001f) );
}
for (float xx = -100.0f; xx < 100.0f; xx += 0.1f)
{
bx::write(writer, &err, "pow(1.389f, %f) == %f (expected: %f)\n", xx, bx::pow(1.389f, xx), ::powf(1.389f, xx) );
REQUIRE(err.isOk() );
- REQUIRE(bx::equal(bx::pow(1.389f, xx), ::powf(1.389f, xx), 0.00001f) );
+ REQUIRE(bx::isEqual(bx::pow(1.389f, xx), ::powf(1.389f, xx), 0.00001f) );
}
for (float xx = -1.0f; xx < 1.0f; xx += 0.001f)
{
bx::write(writer, &err, "asin(%f) == %f (expected: %f)\n", xx, bx::asin(xx), ::asinf(xx) );
REQUIRE(err.isOk() );
- REQUIRE(bx::equal(bx::asin(xx), ::asinf(xx), 0.0001f) );
+ REQUIRE(bx::isEqual(bx::asin(xx), ::asinf(xx), 0.0001f) );
}
for (float xx = -100.0f; xx < 100.0f; xx += 0.1f)
{
bx::write(writer, &err, "sin(%f) == %f (expected: %f)\n", xx, bx::sin(xx), ::sinf(xx) );
REQUIRE(err.isOk() );
- REQUIRE(bx::equal(bx::sin(xx), ::sinf(xx), 0.00001f) );
+ REQUIRE(bx::isEqual(bx::sin(xx), ::sinf(xx), 0.00001f) );
+ }
+
+ for (float xx = -bx::kPi2; xx < bx::kPi2; xx += 0.0001f)
+ {
+ bx::write(writer, &err, "sin(%f) == %f (expected: %f)\n", xx, bx::sin(xx), ::sinf(xx) );
+ REQUIRE(err.isOk() );
+ REQUIRE(bx::isEqual(bx::sin(xx), ::sinf(xx), 0.00001f) );
}
for (float xx = -1.0f; xx < 1.0f; xx += 0.1f)
{
bx::write(writer, &err, "sinh(%f) == %f (expected: %f)\n", xx, bx::sinh(xx), ::sinhf(xx) );
REQUIRE(err.isOk() );
- REQUIRE(bx::equal(bx::sinh(xx), ::sinhf(xx), 0.00001f) );
+ REQUIRE(bx::isEqual(bx::sinh(xx), ::sinhf(xx), 0.00001f) );
}
for (float xx = -1.0f; xx < 1.0f; xx += 0.001f)
{
bx::write(writer, &err, "acos(%f) == %f (expected: %f\n)", xx, bx::acos(xx), ::acosf(xx) );
REQUIRE(err.isOk() );
- REQUIRE(bx::equal(bx::acos(xx), ::acosf(xx), 0.0001f) );
+ REQUIRE(bx::isEqual(bx::acos(xx), ::acosf(xx), 0.0001f) );
}
for (float xx = -100.0f; xx < 100.0f; xx += 0.1f)
{
bx::write(writer, &err, "cos(%f) == %f (expected: %f)\n", xx, bx::cos(xx), ::cosf(xx) );
REQUIRE(err.isOk() );
- REQUIRE(bx::equal(bx::cos(xx), ::cosf(xx), 0.00001f) );
+ REQUIRE(bx::isEqual(bx::cos(xx), ::cosf(xx), 0.00001f) );
+ }
+
+ for (float xx = -bx::kPi2; xx < bx::kPi2; xx += 0.0001f)
+ {
+ bx::write(writer, &err, "cos(%f) == %f (expected: %f)\n", xx, bx::cos(xx), ::cosf(xx) );
+ REQUIRE(err.isOk() );
+ REQUIRE(bx::isEqual(bx::cos(xx), ::cosf(xx), 0.00001f) );
}
for (float xx = -100.0f; xx < 100.0f; xx += 0.1f)
{
bx::write(writer, &err, "tan(%f) == %f (expected: %f)\n", xx, bx::tan(xx), ::tanf(xx) );
REQUIRE(err.isOk() );
- REQUIRE(bx::equal(bx::tan(xx), ::tanf(xx), 0.001f) );
+ REQUIRE(bx::isEqual(bx::tan(xx), ::tanf(xx), 0.001f) );
}
for (float xx = -1.0f; xx < 1.0f; xx += 0.1f)
{
bx::write(writer, &err, "tanh(%f) == %f (expected: %f\n", xx, bx::tanh(xx), ::tanhf(xx) );
REQUIRE(err.isOk() );
- REQUIRE(bx::equal(bx::tanh(xx), ::tanhf(xx), 0.00001f) );
+ REQUIRE(bx::isEqual(bx::tanh(xx), ::tanhf(xx), 0.00001f) );
}
for (float xx = -100.0f; xx < 100.0f; xx += 0.1f)
{
bx::write(writer, &err, "atan(%f) == %f (expected: %f)\n", xx, bx::atan(xx), ::atanf(xx) );
REQUIRE(err.isOk() );
- REQUIRE(bx::equal(bx::atan(xx), ::atanf(xx), 0.00001f) );
+ REQUIRE(bx::isEqual(bx::atan(xx), ::atanf(xx), 0.00001f) );
}
+}
+
+TEST_CASE("atan2", "")
+{
+ bx::WriterI* writer = bx::getNullOut();
+ bx::Error err;
+
+ REQUIRE(bx::isEqual(bx::atan2(0.0f, 0.0f), ::atan2f(0.0f, 0.0f), 0.00001f) );
+ REQUIRE(bx::isEqual(bx::atan2(0.0f, 1.0f), ::atan2f(0.0f, 1.0f), 0.00001f) );
+ REQUIRE(bx::isEqual(bx::atan2(0.0f, -1.0f), ::atan2f(0.0f, -1.0f), 0.00001f) );
for (float yy = -100.0f; yy < 100.0f; yy += 0.1f)
{
@@ -183,11 +214,16 @@ TEST_CASE("libm", "")
{
bx::write(writer, &err, "atan2(%f, %f) == %f (expected: %f)\n", yy, xx, bx::atan2(yy, xx), ::atan2f(yy, xx) );
REQUIRE(err.isOk() );
- REQUIRE(bx::equal(bx::atan2(yy, xx), ::atan2f(yy, xx), 0.00001f) );
+ REQUIRE(bx::isEqual(bx::atan2(yy, xx), ::atan2f(yy, xx), 0.00001f) );
}
}
+}
- REQUIRE(bx::equal(bx::atan2(0.0f, 0.0f), ::atan2f(0.0f, 0.0f), 0.00001f) );
+TEST_CASE("sign", "")
+{
+ REQUIRE(-1 == bx::sign(-0.1389f) );
+ REQUIRE( 0 == bx::sign( 0.0000f) );
+ REQUIRE( 1 == bx::sign( 0.1389f) );
}
TEST_CASE("ToBits", "")
@@ -205,7 +241,7 @@ TEST_CASE("lerp", "")
void mtxCheck(const float* _a, const float* _b)
{
- if (!bx::equal(_a, _b, 16, 0.01f) )
+ if (!bx::isEqual(_a, _b, 16, 0.01f) )
{
DBG("\n"
"A:\n"
@@ -228,7 +264,7 @@ void mtxCheck(const float* _a, const float* _b)
, _b[12], _b[13], _b[14], _b[15]
);
- CHECK(false);
+ REQUIRE(false);
}
}
@@ -238,7 +274,13 @@ TEST_CASE("quaternion", "")
float mtx[16];
bx::Quaternion quat = bx::init::Identity;
- bx::mtxQuat(mtxQ, quat);
+ bx::Quaternion q2 = bx::init::None;
+
+ bx::Vec3 axis = bx::init::None;
+ bx::Vec3 euler = bx::init::None;
+ float angle;
+
+ bx::mtxFromQuaternion(mtxQ, quat);
bx::mtxIdentity(mtx);
mtxCheck(mtxQ, mtx);
@@ -246,27 +288,87 @@ TEST_CASE("quaternion", "")
float ay = bx::kPi/13.0f;
float az = bx::kPi/7.0f;
- quat = bx::rotateX(ax);
- bx::mtxQuat(mtxQ, quat);
- bx::mtxRotateX(mtx, ax);
- mtxCheck(mtxQ, mtx);
+ { // x
+ quat = bx::rotateX(ax);
+ bx::mtxFromQuaternion(mtxQ, quat);
+ bx::mtxRotateX(mtx, ax);
+ mtxCheck(mtxQ, mtx);
- bx::Vec3 euler = bx::toEuler(quat);
- CHECK(bx::equal(euler.x, ax, 0.001f) );
+ bx::toAxisAngle(axis, angle, quat);
+ REQUIRE(bx::isEqual(axis, bx::Vec3{1.0f, 0.0f, 0.0f}, 0.01f) );
+ REQUIRE(bx::isEqual(angle, ax, 0.01f) );
- quat = bx::rotateY(ay);
- bx::mtxQuat(mtxQ, quat);
- bx::mtxRotateY(mtx, ay);
- mtxCheck(mtxQ, mtx);
+ euler = bx::toEuler(quat);
+ REQUIRE(bx::isEqual(euler.x, ax, 0.001f) );
+ q2 = bx::fromEuler(euler);
+ REQUIRE(bx::isEqual(quat, q2, 0.001f) );
+ }
- euler = bx::toEuler(quat);
- CHECK(bx::equal(euler.y, ay, 0.001f) );
+ { // y
+ quat = bx::rotateY(ay);
+ bx::mtxFromQuaternion(mtxQ, quat);
+ bx::mtxRotateY(mtx, ay);
+ mtxCheck(mtxQ, mtx);
- quat = bx::rotateZ(az);
- bx::mtxQuat(mtxQ, quat);
- bx::mtxRotateZ(mtx, az);
- mtxCheck(mtxQ, mtx);
+ bx::toAxisAngle(axis, angle, quat);
+ REQUIRE(bx::isEqual(axis, bx::Vec3{0.0f, 1.0f, 0.0f}, 0.01f) );
+ REQUIRE(bx::isEqual(angle, ay, 0.01f) );
+ euler = bx::toEuler(quat);
+ REQUIRE(bx::isEqual(euler.y, ay, 0.001f) );
+ q2 = bx::fromEuler(euler);
+ REQUIRE(bx::isEqual(quat, q2, 0.001f) );
+
+ }
+
+ { // z
+ quat = bx::rotateZ(az);
+ bx::mtxFromQuaternion(mtxQ, quat);
+ bx::mtxRotateZ(mtx, az);
+ mtxCheck(mtxQ, mtx);
+
+ bx::toAxisAngle(axis, angle, quat);
+ REQUIRE(bx::isEqual(axis, bx::Vec3{0.0f, 0.0f, 1.0f}, 0.01f) );
+ REQUIRE(bx::isEqual(angle, az, 0.01f) );
+
+ euler = bx::toEuler(quat);
+ REQUIRE(bx::isEqual(euler.z, az, 0.001f) );
+ q2 = bx::fromEuler(euler);
+ REQUIRE(bx::isEqual(quat, q2, 0.001f) );
+ }
+}
+
+TEST_CASE("limits", "")
+{
+ STATIC_REQUIRE(bx::LimitsT<int8_t>::min == INT8_MIN);
+ STATIC_REQUIRE(bx::LimitsT<int8_t>::max == INT8_MAX);
+
+ STATIC_REQUIRE(bx::LimitsT<signed char>::min == CHAR_MIN);
+ STATIC_REQUIRE(bx::LimitsT<signed char>::max == CHAR_MAX);
+
+ STATIC_REQUIRE(bx::LimitsT<unsigned char>::min == 0);
+ STATIC_REQUIRE(bx::LimitsT<unsigned char>::max == UCHAR_MAX);
+
+ STATIC_REQUIRE(bx::LimitsT<int16_t>::min == INT16_MIN);
+ STATIC_REQUIRE(bx::LimitsT<int16_t>::max == INT16_MAX);
+
+ STATIC_REQUIRE(bx::LimitsT<uint16_t>::min == 0);
+ STATIC_REQUIRE(bx::LimitsT<uint16_t>::max == UINT16_MAX);
+
+ STATIC_REQUIRE(bx::LimitsT<int32_t>::min == INT32_MIN);
+ STATIC_REQUIRE(bx::LimitsT<int32_t>::max == INT32_MAX);
+
+ STATIC_REQUIRE(bx::LimitsT<uint32_t>::min == 0);
+ STATIC_REQUIRE(bx::LimitsT<uint32_t>::max == UINT32_MAX);
+
+ STATIC_REQUIRE(bx::LimitsT<int64_t>::min == INT64_MIN);
+ STATIC_REQUIRE(bx::LimitsT<int64_t>::max == INT64_MAX);
+
+ STATIC_REQUIRE(bx::LimitsT<uint64_t>::min == 0);
+ STATIC_REQUIRE(bx::LimitsT<uint64_t>::max == UINT64_MAX);
+
+ STATIC_REQUIRE(bx::LimitsT<float>::min == std::numeric_limits<float>::lowest() );
+ STATIC_REQUIRE(bx::LimitsT<float>::max == std::numeric_limits<float>::max() );
- euler = bx::toEuler(quat);
- CHECK(bx::equal(euler.z, az, 0.001f) );
+ STATIC_REQUIRE(bx::LimitsT<double>::min == std::numeric_limits<double>::lowest() );
+ STATIC_REQUIRE(bx::LimitsT<double>::max == std::numeric_limits<double>::max() );
}
diff --git a/3rdparty/bx/tests/nlalloc_test.cpp b/3rdparty/bx/tests/nlalloc_test.cpp
deleted file mode 100644
index dd44b3bacaf..00000000000
--- a/3rdparty/bx/tests/nlalloc_test.cpp
+++ /dev/null
@@ -1,229 +0,0 @@
-/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
- */
-
-#include "test.h"
-#include <bx/sort.h>
-#include <bx/allocator.h>
-
-bx::DefaultAllocator g_allocator0;
-
-struct TinyStlAllocator
-{
- static void* static_allocate(size_t _bytes)
- {
- return BX_ALLOC(&g_allocator0, _bytes);
- }
-
- static void static_deallocate(void* _ptr, size_t /*_bytes*/)
- {
- if (NULL != _ptr)
- {
- BX_FREE(&g_allocator0, _ptr);
- }
- }
-};
-
-#define TINYSTL_ALLOCATOR ::TinyStlAllocator
-#include <tinystl/vector.h>
-
-namespace stl = tinystl;
-
-namespace bx
-{
- struct Blk
- {
- static constexpr uint64_t kInvalid = UINT64_MAX;
-
- Blk()
- : ptr(kInvalid)
- , size(0)
- {
- }
-
- Blk(uint64_t _ptr, uint32_t _size)
- : ptr(_ptr)
- , size(_size)
- {
- }
-
- uint64_t ptr;
- uint32_t size;
- };
-
- inline bool operator<(const Blk& _lhs, const Blk& _rhs)
- {
- return _lhs.ptr < _rhs.ptr;
- }
-
- inline bool isValid(const Blk& _blk)
- {
- return Blk::kInvalid != _blk.ptr;
- }
-
- // First-fit non-local allocator.
- class NonLocalAllocator
- {
- public:
- static constexpr uint32_t kMinBlockSize = 16u;
-
- NonLocalAllocator()
- {
- reset();
- }
-
- ~NonLocalAllocator()
- {
- }
-
- void reset()
- {
- m_free.clear();
- m_used = 0;
- }
-
- void add(const Blk& _blk)
- {
- m_free.push_back(_blk);
- }
-
- Blk remove()
- {
- BX_ASSERT(0 == m_used, "");
-
- if (0 < m_free.size() )
- {
- Blk freeBlock = m_free.back();
- m_free.pop_back();
- return freeBlock;
- }
-
- return Blk{};
- }
-
- Blk alloc(uint32_t _size)
- {
- _size = max(_size, kMinBlockSize);
-
- for (FreeList::iterator it = m_free.begin(), itEnd = m_free.end(); it != itEnd; ++it)
- {
- if (it->size >= _size)
- {
- const uint64_t ptr = it->ptr;
-
- if (it->size != _size)
- {
- it->size -= _size;
- it->ptr += _size;
- }
- else
- {
- m_free.erase(it);
- }
-
- m_used += _size;
-
- return Blk{ ptr, _size };
- }
- }
-
- // there is no block large enough.
- return Blk{};
- }
-
- void free(const Blk& _blk)
- {
- BX_ASSERT(isValid(_blk), "Freeing invalid block!");
-
- m_used -= _blk.size;
-
- FreeList::iterator it = m_free.begin();
- FreeList::iterator itEnd = m_free.end();
- for (; it != itEnd; ++it)
- {
- if ( (_blk.ptr + _blk.size) == it->ptr)
- {
- it->ptr = _blk.ptr;
- it->size += _blk.size;
- break;
- }
-
- if (_blk.ptr > it->ptr)
- {
- m_free.insert(it, _blk);
- break;
- }
- }
-
- if (it == itEnd)
- {
- m_free.push_back(_blk);
- }
- }
-
- uint32_t getUsed() const
- {
- return m_used;
- }
-
- private:
- typedef stl::vector<Blk> FreeList;
- FreeList m_free;
- uint32_t m_used;
- };
-
- constexpr uint32_t NonLocalAllocator::kMinBlockSize;
-
-} // namespace bx
-
-TEST_CASE("nlalloc")
-{
- bx::NonLocalAllocator nla;
-
- bx::Blk blk;
-
- blk = nla.alloc(100);
- REQUIRE(!isValid(blk) );
- nla.add(bx::Blk{0x1000, 1024});
-
- blk = nla.alloc(1024);
- REQUIRE(isValid(blk) );
-
- bx::Blk blk2 = nla.alloc(1);
- REQUIRE(!isValid(blk2) );
-
- nla.free(blk);
- REQUIRE(0 == nla.getUsed() );
-
- {
- bx::Blk blk3 = nla.alloc(123);
- REQUIRE(isValid(blk3) );
-
- bx::Blk blk4 = nla.alloc(134);
- REQUIRE(isValid(blk4) );
-
- bx::Blk blk5 = nla.alloc(145);
- REQUIRE(isValid(blk5) );
-
- bx::Blk blk6 = nla.alloc(156);
- REQUIRE(isValid(blk6) );
-
- bx::Blk blk7 = nla.alloc(167);
- REQUIRE(isValid(blk7) );
-
- nla.free(blk3);
- nla.free(blk5);
- nla.free(blk7);
- nla.free(blk4);
- nla.free(blk6);
- REQUIRE(0 == nla.getUsed() );
- }
-
- blk2 = nla.alloc(1);
- REQUIRE(isValid(blk2) );
- REQUIRE(bx::NonLocalAllocator::kMinBlockSize == nla.getUsed() );
-
- nla.free(blk2);
- REQUIRE(0 == nla.getUsed() );
-}
diff --git a/3rdparty/bx/tests/os_test.cpp b/3rdparty/bx/tests/os_test.cpp
index 5d72aa68af7..6f1151558c3 100644
--- a/3rdparty/bx/tests/os_test.cpp
+++ b/3rdparty/bx/tests/os_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
@@ -14,15 +14,19 @@ TEST_CASE("getProcessMemoryUsed", "")
// DBG("bx::getProcessMemoryUsed %d", bx::getProcessMemoryUsed() );
}
+#if BX_CONFIG_SUPPORTS_THREADING
+
TEST_CASE("semaphore_timeout", "")
{
bx::Semaphore sem;
- int64_t start = bx::getHPCounter();
- bool ok = sem.wait(900);
- int64_t elapsed = bx::getHPCounter() - start;
+ int64_t start = bx::getHPCounter();
+ bool ok = sem.wait(900);
+ int64_t elapsed = bx::getHPCounter() - start;
int64_t frequency = bx::getHPFrequency();
- double ms = double(elapsed) / double(frequency) * 1000;
- printf("%f\n", ms);
+ double ms = double(elapsed) / double(frequency) * 1000;
+ bx::printf("%f\n", ms);
REQUIRE(!ok);
}
+
+#endif // BX_CONFIG_SUPPORTS_THREADING
diff --git a/3rdparty/bx/tests/queue_test.cpp b/3rdparty/bx/tests/queue_test.cpp
index b68fe5fc66f..253b52667f0 100644
--- a/3rdparty/bx/tests/queue_test.cpp
+++ b/3rdparty/bx/tests/queue_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
diff --git a/3rdparty/bx/tests/readerwriter_test.cpp b/3rdparty/bx/tests/readerwriter_test.cpp
index b82238a53a5..96e77a0a098 100644
--- a/3rdparty/bx/tests/readerwriter_test.cpp
+++ b/3rdparty/bx/tests/readerwriter_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
diff --git a/3rdparty/bx/tests/ringbuffer_test.cpp b/3rdparty/bx/tests/ringbuffer_test.cpp
index cc2ac02920b..11629fc6c14 100644
--- a/3rdparty/bx/tests/ringbuffer_test.cpp
+++ b/3rdparty/bx/tests/ringbuffer_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
diff --git a/3rdparty/bx/tests/rng_test.cpp b/3rdparty/bx/tests/rng_test.cpp
index 3b13284a6a2..a06b7747f17 100644
--- a/3rdparty/bx/tests/rng_test.cpp
+++ b/3rdparty/bx/tests/rng_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
diff --git a/3rdparty/bx/tests/run_test.cpp b/3rdparty/bx/tests/run_test.cpp
index 91f40c6b89f..b2b43d8fede 100644
--- a/3rdparty/bx/tests/run_test.cpp
+++ b/3rdparty/bx/tests/run_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#define CATCH_CONFIG_RUNNER
@@ -17,5 +17,15 @@ int runAllTests(int _argc, const char* _argv[])
", Time: " __TIME__
", C++: " BX_CPP_NAME
);
- return Catch::Session().run(_argc, _argv);
+
+ using namespace Catch;
+
+ Session session;
+
+ ConfigData config;
+ config.defaultColourMode = BX_PLATFORM_EMSCRIPTEN ? ColourMode::None : ColourMode::PlatformDefault;
+
+ session.useConfigData(config);
+
+ return session.run(_argc, _argv);
}
diff --git a/3rdparty/bx/tests/settings_test.cpp b/3rdparty/bx/tests/settings_test.cpp
index 85b72c44eb6..46fa3ad6c9a 100644
--- a/3rdparty/bx/tests/settings_test.cpp
+++ b/3rdparty/bx/tests/settings_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
@@ -21,9 +21,9 @@ TEST_CASE("Settings", "")
settings.set("test/foo/bar/abvgd", "1389");
bx::FileWriter writer;
- if (bx::open(&writer, filePath) )
+ if (bx::open(&writer, filePath, false, bx::ErrorIgnore{}) )
{
- bx::write(&writer, settings);
+ bx::write(&writer, settings, bx::ErrorIgnore{});
bx::close(&writer);
}
@@ -37,9 +37,9 @@ TEST_CASE("Settings", "")
settings.clear();
bx::FileReader reader;
- if (bx::open(&reader, filePath) )
+ if (bx::open(&reader, filePath, bx::ErrorIgnore{}) )
{
- bx::read(&reader, settings);
+ bx::read(&reader, settings, bx::ErrorIgnore{});
bx::close(&reader);
}
diff --git a/3rdparty/bx/tests/simd_bench.cpp b/3rdparty/bx/tests/simd_bench.cpp
index 50ea99f9706..668a8df6120 100644
--- a/3rdparty/bx/tests/simd_bench.cpp
+++ b/3rdparty/bx/tests/simd_bench.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include <bx/allocator.h>
diff --git a/3rdparty/bx/tests/simd_test.cpp b/3rdparty/bx/tests/simd_test.cpp
index 39459dcf9a4..65cbfb7bd3c 100644
--- a/3rdparty/bx/tests/simd_test.cpp
+++ b/3rdparty/bx/tests/simd_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
@@ -162,10 +162,10 @@ void simd_check_float(
, _0, _1, _2, _3
);
- CHECK(bx::equal(c.f[0], _0, 0.0001f) );
- CHECK(bx::equal(c.f[1], _1, 0.0001f) );
- CHECK(bx::equal(c.f[2], _2, 0.0001f) );
- CHECK(bx::equal(c.f[3], _3, 0.0001f) );
+ CHECK(bx::isEqual(c.f[0], _0, 0.0001f) );
+ CHECK(bx::isEqual(c.f[1], _1, 0.0001f) );
+ CHECK(bx::isEqual(c.f[2], _2, 0.0001f) );
+ CHECK(bx::isEqual(c.f[3], _3, 0.0001f) );
}
void simd_check_float(
@@ -189,14 +189,14 @@ void simd_check_float(
, _0, _1, _2, _3, _4, _5, _6, _7
);
- CHECK(bx::equal(c.f[0], _0, 0.0001f) );
- CHECK(bx::equal(c.f[1], _1, 0.0001f) );
- CHECK(bx::equal(c.f[2], _2, 0.0001f) );
- CHECK(bx::equal(c.f[3], _3, 0.0001f) );
- CHECK(bx::equal(c.f[4], _4, 0.0001f) );
- CHECK(bx::equal(c.f[5], _5, 0.0001f) );
- CHECK(bx::equal(c.f[6], _6, 0.0001f) );
- CHECK(bx::equal(c.f[7], _7, 0.0001f) );
+ CHECK(bx::isEqual(c.f[0], _0, 0.0001f) );
+ CHECK(bx::isEqual(c.f[1], _1, 0.0001f) );
+ CHECK(bx::isEqual(c.f[2], _2, 0.0001f) );
+ CHECK(bx::isEqual(c.f[3], _3, 0.0001f) );
+ CHECK(bx::isEqual(c.f[4], _4, 0.0001f) );
+ CHECK(bx::isEqual(c.f[5], _5, 0.0001f) );
+ CHECK(bx::isEqual(c.f[6], _6, 0.0001f) );
+ CHECK(bx::isEqual(c.f[7], _7, 0.0001f) );
}
void simd_check_string(const char* _str, bx::simd128_t _a)
diff --git a/3rdparty/bx/tests/sort_test.cpp b/3rdparty/bx/tests/sort_test.cpp
index dc565aeaf33..4abb76db334 100644
--- a/3rdparty/bx/tests/sort_test.cpp
+++ b/3rdparty/bx/tests/sort_test.cpp
@@ -1,14 +1,15 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
+#include <bx/bx.h>
#include <bx/sort.h>
#include <bx/string.h>
#include <bx/rng.h>
-TEST_CASE("quickSort", "")
+TEST_CASE("sort-quickSort", "")
{
const char* str[] =
{
@@ -18,19 +19,43 @@ TEST_CASE("quickSort", "")
"jagoda",
};
- bx::quickSort(str, BX_COUNTOF(str), sizeof(void*)
- , [](const void* _lhs, const void* _rhs)
- {
- const char* lhs = *(const char**)_lhs;
- const char* rhs = *(const char**)_rhs;
- return bx::strCmp(lhs, rhs);
- });
+ REQUIRE(!bx::isSorted(str, BX_COUNTOF(str) ) );
+
+ bx::quickSort(str, BX_COUNTOF(str) );
REQUIRE(0 == bx::strCmp(str[0], "jabuka") );
REQUIRE(0 == bx::strCmp(str[1], "jagoda") );
REQUIRE(0 == bx::strCmp(str[2], "kruska") );
REQUIRE(0 == bx::strCmp(str[3], "malina") );
+ REQUIRE(bx::isSorted(str, BX_COUNTOF(str) ) );
+
+ auto bsearchStrCmpFn = [](const void* _lhs, const void* _rhs)
+ {
+ const char* lhs = (const char*)_lhs;
+ const char* rhs = *(const char**)_rhs;
+ return bx::strCmp(lhs, rhs);
+ };
+
+ REQUIRE(~4 == bx::binarySearch("sljiva", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+ REQUIRE( 0 == bx::binarySearch("jabuka", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+ REQUIRE( 1 == bx::binarySearch("jagoda", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+ REQUIRE( 2 == bx::binarySearch("kruska", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+ REQUIRE( 3 == bx::binarySearch("malina", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+ REQUIRE(~3 == bx::binarySearch("kupina", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+
+ REQUIRE( 0 == bx::lowerBound("jabuka", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+ REQUIRE( 1 == bx::upperBound("jabuka", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+
+ REQUIRE( 1 == bx::lowerBound("jagoda", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+ REQUIRE( 2 == bx::upperBound("jagoda", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+
+ REQUIRE( 2 == bx::lowerBound("kruska", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+ REQUIRE( 3 == bx::upperBound("kruska", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+
+ REQUIRE( 3 == bx::lowerBound("malina", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+ REQUIRE( 4 == bx::upperBound("malina", str, BX_COUNTOF(str), sizeof(str[0]), bsearchStrCmpFn) );
+
int8_t byte[128];
bx::RngMwc rng;
for (uint32_t ii = 0; ii < BX_COUNTOF(byte); ++ii)
@@ -38,16 +63,105 @@ TEST_CASE("quickSort", "")
byte[ii] = rng.gen()&0xff;
}
- bx::quickSort(byte, BX_COUNTOF(byte), 1
- , [](const void* _lhs, const void* _rhs)
- {
- int8_t lhs = *(const int8_t*)_lhs;
- int8_t rhs = *(const int8_t*)_rhs;
- return lhs - rhs;
- });
+ REQUIRE(!bx::isSorted(byte, BX_COUNTOF(byte) ) );
+
+ bx::quickSort(byte, BX_COUNTOF(byte) );
for (uint32_t ii = 1; ii < BX_COUNTOF(byte); ++ii)
{
REQUIRE(byte[ii-1] <= byte[ii]);
}
+
+ REQUIRE(bx::isSorted(byte, BX_COUNTOF(byte) ) );
+}
+
+TEST_CASE("sort-unique", "")
+{
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 | 14
+ int32_t test[] = { 100, 101, 101, 101, 103, 104, 105, 105, 105, 106, 106, 107, 108, 109 };
+ REQUIRE(bx::isSorted(test, BX_COUNTOF(test) ) );
+
+ REQUIRE(0 == bx::unique(test, 0) );
+ REQUIRE(1 == bx::unique(test, 1) );
+
+ REQUIRE(2 == bx::unique(test, 4) );
+ bx::quickSort(test, BX_COUNTOF(test) );
+
+ REQUIRE(3 == bx::unique(test, 5) );
+ bx::quickSort(test, BX_COUNTOF(test) );
+
+ uint32_t last = bx::unique(test, BX_COUNTOF(test) );
+ REQUIRE(9 == last);
+
+ REQUIRE(9 == bx::unique(test, last) );
+}
+
+TEST_CASE("sort-lower/upperBound int32_t", "")
+{
+ // 0 1 2 3 4 5 6 7 8 9 10 11 12 13 | 14
+ const int32_t test[] = { 100, 101, 101, 101, 103, 104, 105, 105, 105, 106, 106, 107, 108, 109 };
+ REQUIRE(bx::isSorted(test, BX_COUNTOF(test) ) );
+
+ const uint32_t resultLowerBound[] = { 0, 1, 4, 4, 5, 6, 9, 11, 12, 13 };
+ const uint32_t resultUpperBound[] = { 1, 4, 4, 5, 6, 9, 11, 12, 13, 14 };
+
+ STATIC_REQUIRE(10 == BX_COUNTOF(resultLowerBound) );
+ STATIC_REQUIRE(10 == BX_COUNTOF(resultUpperBound) );
+
+ for (int32_t key = test[0], keyMax = test[BX_COUNTOF(test)-1], ii = 0; key <= keyMax; ++key, ++ii)
+ {
+ REQUIRE(resultLowerBound[ii] == bx::lowerBound(key, test, BX_COUNTOF(test) ) );
+ REQUIRE(resultUpperBound[ii] == bx::upperBound(key, test, BX_COUNTOF(test) ) );
+ }
+}
+
+template<typename Ty>
+int32_t compareAscendingTest(const Ty& _lhs, const Ty& _rhs)
+{
+ return bx::compareAscending<Ty>(&_lhs, &_rhs);
+}
+
+template<typename Ty>
+int32_t compareDescendingTest(const Ty& _lhs, const Ty& _rhs)
+{
+ return bx::compareDescending<Ty>(&_lhs, &_rhs);
+}
+
+template<typename Ty>
+void compareTest(const Ty& _min, const Ty& _max)
+{
+ REQUIRE(_min < _max);
+
+ REQUIRE(-1 == compareAscendingTest<Ty>(bx::min<Ty>(), bx::max<Ty>() ) );
+ REQUIRE(-1 == compareAscendingTest<Ty>(Ty(0), bx::max<Ty>() ) );
+ REQUIRE( 0 == compareAscendingTest<Ty>(bx::min<Ty>(), bx::min<Ty>() ) );
+ REQUIRE( 0 == compareAscendingTest<Ty>(bx::max<Ty>(), bx::max<Ty>() ) );
+ REQUIRE( 1 == compareAscendingTest<Ty>(bx::max<Ty>(), Ty(0) ) );
+ REQUIRE( 1 == compareAscendingTest<Ty>(bx::max<Ty>(), bx::min<Ty>() ) );
+
+ REQUIRE(-1 == compareAscendingTest<Ty>(_min, _max) );
+ REQUIRE( 0 == compareAscendingTest<Ty>(_min, _min) );
+ REQUIRE( 0 == compareAscendingTest<Ty>(_max, _max) );
+ REQUIRE( 1 == compareAscendingTest<Ty>(_max, _min) );
+
+ REQUIRE( 1 == compareDescendingTest<Ty>(_min, _max) );
+ REQUIRE( 0 == compareDescendingTest<Ty>(_min, _min) );
+ REQUIRE( 0 == compareDescendingTest<Ty>(_max, _max) );
+ REQUIRE(-1 == compareDescendingTest<Ty>(_max, _min) );
+}
+
+TEST_CASE("sort-ComparisonFn", "")
+{
+ compareTest< int8_t>( -13, 89);
+ compareTest<int16_t>(-1389, 1389);
+ compareTest<int32_t>(-1389, 1389);
+ compareTest<int64_t>(-1389, 1389);
+
+ compareTest< uint8_t>( 13, 89);
+ compareTest<uint16_t>( 13, 1389);
+ compareTest<uint32_t>( 13, 1389);
+ compareTest<uint64_t>( 13, 1389);
+
+ compareTest< float>(-13.89f, 1389.0f);
+ compareTest<double>(-13.89f, 1389.0f);
}
diff --git a/3rdparty/bx/tests/string_test.cpp b/3rdparty/bx/tests/string_test.cpp
index 48ee8d83b9a..cbcb50e8b5a 100644
--- a/3rdparty/bx/tests/string_test.cpp
+++ b/3rdparty/bx/tests/string_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
@@ -16,7 +16,7 @@ TEST_CASE("stringPrintfTy", "")
{
std::string test;
bx::stringPrintf(test, "printf into std::string.");
- REQUIRE(0 == bx::strCmp(bx::StringView(test), "printf into std::string.") );
+ REQUIRE(0 == bx::strCmp(bx::StringView(test.data(), int32_t(test.length() ) ), "printf into std::string.") );
}
TEST_CASE("prettify", "")
@@ -333,6 +333,7 @@ TEST_CASE("toString double", "")
REQUIRE(testToString(-270.000000, "-270.0") );
REQUIRE(testToString(2.225073858507201e-308, "2.225073858507201e-308") );
REQUIRE(testToString(-79.39773355813419, "-79.39773355813419") );
+ REQUIRE(testToString(-1.234567e-9, "-1.234567e-9") );
}
template<typename Ty>
@@ -474,12 +475,26 @@ TEST_CASE("StringView", "")
TEST_CASE("Trim", "")
{
+ REQUIRE(bx::strLTrim("a", "a").isEmpty() );
+ REQUIRE(0 == bx::strCmp(bx::strLTrim("aba", "a"), "ba") );
+
+ REQUIRE(bx::strRTrim("a", "a").isEmpty() );
+ REQUIRE(0 == bx::strCmp(bx::strRTrim("aba", "a"), "ab") );
+
+ REQUIRE(bx::strTrim("a", "a").isEmpty() );
+ REQUIRE(0 == bx::strCmp(bx::strTrim("aba", "a"), "b") );
+
REQUIRE(0 == bx::strCmp(bx::strLTrim("abvgd", "ab"), "vgd") );
- REQUIRE(0 == bx::strCmp(bx::strLTrim("abvgd", "vagbd"), "abvgd") );
+
+ REQUIRE(0 == bx::strCmp(bx::strLTrim("abvgd", "vagbd"), "") );
+ REQUIRE(0 == bx::strCmp(bx::strTrimPrefix("abvgd", "vagbd"), "abvgd") );
+
REQUIRE(0 == bx::strCmp(bx::strLTrim("abvgd", "vgd"), "abvgd") );
REQUIRE(0 == bx::strCmp(bx::strLTrim("/555333/podmac/", "/"), "555333/podmac/") );
- REQUIRE(0 == bx::strCmp(bx::strRTrim("abvgd", "vagbd"), "abvgd") );
+ REQUIRE(0 == bx::strCmp(bx::strRTrim("abvgd", "vagbd"), "") );
+ REQUIRE(0 == bx::strCmp(bx::strTrimSuffix("abvgd", "vagbd"), "abvgd") );
+
REQUIRE(0 == bx::strCmp(bx::strRTrim("abvgd", "abv"), "abvgd") );
REQUIRE(0 == bx::strCmp(bx::strRTrim("/555333/podmac/", "/"), "/555333/podmac") );
@@ -500,6 +515,10 @@ TEST_CASE("TrimSpace", "")
REQUIRE(bx::strRTrimSpace("").isEmpty() );
REQUIRE(bx::strTrimSpace( "").isEmpty() );
+ REQUIRE(bx::strLTrimSpace("\n").isEmpty() );
+ REQUIRE(bx::strRTrimSpace("\n").isEmpty() );
+ REQUIRE(bx::strTrimSpace( "\n").isEmpty() );
+
const bx::StringView t0("1389");
const bx::StringView t1(" 1389");
const bx::StringView t2("1389 ");
@@ -536,16 +555,48 @@ TEST_CASE("strFindBlock", "")
REQUIRE(19 == result.getLength() );
}
-TEST_CASE("hasPrefix", "")
+TEST_CASE("prefix", "")
{
REQUIRE( bx::hasPrefix("abvgd-1389.0", "abv") );
REQUIRE(!bx::hasPrefix("abvgd-1389.0", "bvg") );
REQUIRE( bx::hasPrefix("abvgd-1389.0", "") );
+
+ REQUIRE(0 == bx::strCmp(bx::strTrimPrefix("abvgd-1389.0", "abv"), "gd-1389.0") );
+ REQUIRE(0 == bx::strCmp(bx::strTrimPrefix("abvgd-1389.0", "xyz"), "abvgd-1389.0") );
}
-TEST_CASE("hasSuffix", "")
+TEST_CASE("suffix", "")
{
REQUIRE( bx::hasSuffix("abvgd-1389.0", "389.0") );
REQUIRE(!bx::hasSuffix("abvgd-1389.0", "1389") );
REQUIRE( bx::hasSuffix("abvgd-1389.0", "") );
+
+ REQUIRE(0 == bx::strCmp(bx::strTrimSuffix("abvgd-1389.0", "389.0"), "abvgd-1") );
+ REQUIRE(0 == bx::strCmp(bx::strTrimSuffix("abvgd-1389.0", "xyz"), "abvgd-1389.0") );
+}
+
+TEST_CASE("0terminated", "")
+{
+ const bx::StringView t0("1389");
+ REQUIRE(t0.is0Terminated() );
+ const bx::StringView t1(strTrimPrefix(t0, "13") );
+ REQUIRE(!t1.is0Terminated() );
+ const bx::StringView t2(strTrimSuffix(t0, "89") );
+ REQUIRE(!t2.is0Terminated() );
+
+ bx::DefaultAllocator crt;
+ g_allocator = &crt;
+
+ typedef bx::StringT<&g_allocator> String;
+
+ String st;
+ REQUIRE(st.is0Terminated() );
+
+ st = strTrimPrefix(t0, "13");
+ REQUIRE(2 == st.getLength() );
+ REQUIRE(st.is0Terminated() );
+
+ st = strTrimSuffix(t0, "89");
+ REQUIRE(2 == st.getLength() );
+ REQUIRE(st.is0Terminated() );
}
diff --git a/3rdparty/bx/tests/test.h b/3rdparty/bx/tests/test.h
index 88c39f8f5b7..7157174de59 100644
--- a/3rdparty/bx/tests/test.h
+++ b/3rdparty/bx/tests/test.h
@@ -1,16 +1,16 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
-#ifndef __TEST_H__
-#define __TEST_H__
+#ifndef BX_TEST_H_HEADER_GUARD
+#define BX_TEST_H_HEADER_GUARD
#include <bx/bx.h>
BX_PRAGMA_DIAGNOSTIC_PUSH();
BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4312); // warning C4312 : 'reinterpret_cast' : conversion from 'int' to 'const char *' of greater size
-#include <catch/catch.hpp>
+#include <catch/catch_amalgamated.hpp>
BX_PRAGMA_DIAGNOSTIC_POP();
#define TEST(_x) TEST_CASE(#_x, "")
@@ -18,4 +18,4 @@ BX_PRAGMA_DIAGNOSTIC_POP();
#include "dbg.h"
-#endif // __TEST_H__
+#endif // BX_TEST_H_HEADER_GUARD
diff --git a/3rdparty/bx/tests/thread_test.cpp b/3rdparty/bx/tests/thread_test.cpp
index 3c935fa6323..b517eac069f 100644
--- a/3rdparty/bx/tests/thread_test.cpp
+++ b/3rdparty/bx/tests/thread_test.cpp
@@ -1,11 +1,13 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
#include <bx/thread.h>
+#if BX_CONFIG_SUPPORTS_THREADING
+
bx::DefaultAllocator s_allocator;
bx::MpScUnboundedBlockingQueue<void> s_mpsc(&s_allocator);
@@ -69,3 +71,5 @@ TEST_CASE("MpScUnboundedBlockingQueue", "")
REQUIRE(result == 0x1389);
}
+
+#endif // BX_CONFIG_SUPPORTS_THREADING
diff --git a/3rdparty/bx/tests/tokenizecmd_test.cpp b/3rdparty/bx/tests/tokenizecmd_test.cpp
index 569d14898c7..6490a750f7c 100644
--- a/3rdparty/bx/tests/tokenizecmd_test.cpp
+++ b/3rdparty/bx/tests/tokenizecmd_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2012-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2012-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
diff --git a/3rdparty/bx/tests/typetraits_test.cpp b/3rdparty/bx/tests/typetraits_test.cpp
new file mode 100644
index 00000000000..aef3e084731
--- /dev/null
+++ b/3rdparty/bx/tests/typetraits_test.cpp
@@ -0,0 +1,688 @@
+/*
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
+ */
+
+#include "test.h"
+#include <bx/typetraits.h>
+
+struct TestClass { };
+struct TestClassFinal final { };
+struct TestClassMember { int32_t x; };
+struct TestClassMemberPrivate { int32_t x; private: int32_t y; };
+struct TestClassStaticOnly { static int32_t x; };
+struct TestClassCtor { TestClassCtor (const TestClassCtor&) {} };
+struct TestClassDefaultCtor { TestClassDefaultCtor (const TestClassDefaultCtor&) = default; };
+struct TestClassDefaultDtor { ~TestClassDefaultDtor () = default; };
+struct TestClassVirtualDtor { virtual ~TestClassVirtualDtor () = default; };
+struct TestClassAbstractBase { virtual ~TestClassAbstractBase() = 0; };
+struct TestClassPolymorphic { virtual int32_t x() { return 1389; } };
+struct TestClassDerivedA /* */
+ : TestClass { };
+struct TestClassDerivedB /* */
+ : TestClassDerivedA { };
+struct TestClassDerivedX /* */
+ : TestClassVirtualDtor { };
+union TestUnionEmpty { };
+union TestUnion { int32_t x; float y; };
+enum TestEnumEmpty { };
+enum TestEnum { Enum };
+
+TEST_CASE("type-traits isReference", "")
+{
+ STATIC_REQUIRE(!bx::isReference<TestClass >() );
+ STATIC_REQUIRE( bx::isReference<TestClass& >() );
+ STATIC_REQUIRE( bx::isReference<TestClass&& >() );
+ STATIC_REQUIRE(!bx::isReference<long >() );
+ STATIC_REQUIRE( bx::isReference<long& >() );
+ STATIC_REQUIRE( bx::isReference<long&& >() );
+ STATIC_REQUIRE(!bx::isReference<double* >() );
+ STATIC_REQUIRE( bx::isReference<double*& >() );
+ STATIC_REQUIRE( bx::isReference<double*&& >() );;
+}
+
+TEST_CASE("type-traits isLvalueReference", "")
+{
+ STATIC_REQUIRE(!bx::isLvalueReference<TestClass >() );
+ STATIC_REQUIRE( bx::isLvalueReference<TestClass& >() );
+ STATIC_REQUIRE(!bx::isLvalueReference<TestClass&& >() );
+ STATIC_REQUIRE(!bx::isLvalueReference<long >() );
+ STATIC_REQUIRE( bx::isLvalueReference<long& >() );
+ STATIC_REQUIRE(!bx::isLvalueReference<long&& >() );
+ STATIC_REQUIRE(!bx::isLvalueReference<double* >() );
+ STATIC_REQUIRE( bx::isLvalueReference<double*& >() );
+ STATIC_REQUIRE(!bx::isLvalueReference<double*&& >() );;
+}
+
+TEST_CASE("type-traits isRvalueReference", "")
+{
+ STATIC_REQUIRE(!bx::isRvalueReference<TestClass >() );
+ STATIC_REQUIRE(!bx::isRvalueReference<TestClass& >() );
+ STATIC_REQUIRE( bx::isRvalueReference<TestClass&& >() );
+ STATIC_REQUIRE(!bx::isRvalueReference<long >() );
+ STATIC_REQUIRE(!bx::isRvalueReference<long& >() );
+ STATIC_REQUIRE( bx::isRvalueReference<long&& >() );
+ STATIC_REQUIRE(!bx::isRvalueReference<double* >() );
+ STATIC_REQUIRE(!bx::isRvalueReference<double*& >() );
+ STATIC_REQUIRE( bx::isRvalueReference<double*&& >() );;
+}
+
+TEST_CASE("type-traits isPointer", "")
+{
+ STATIC_REQUIRE(!bx::isPointer<TestClass >() );
+ STATIC_REQUIRE(!bx::isPointer<TestClass& >() );
+ STATIC_REQUIRE( bx::isPointer<TestClass* >() );
+ STATIC_REQUIRE( bx::isPointer<TestClass const * volatile >() );
+ STATIC_REQUIRE(!bx::isPointer<int32_t >() );
+ STATIC_REQUIRE( bx::isPointer<int32_t* >() );
+ STATIC_REQUIRE(!bx::isPointer<int32_t[1389] >() );
+}
+
+TEST_CASE("type-traits AddLvalueReferenceT", "")
+{
+ STATIC_REQUIRE( bx::isSame<bx::AddLvalueReferenceType<TestClass >, TestClass& >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddLvalueReferenceType<TestClass& >, TestClass& >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddLvalueReferenceType<TestClass&&>, TestClass& >() );
+
+ STATIC_REQUIRE( bx::isLvalueReference<bx::AddLvalueReferenceType<TestClass> >() );
+ STATIC_REQUIRE( bx::isLvalueReference<bx::AddLvalueReferenceType<TestClass&> >() );
+ STATIC_REQUIRE( bx::isLvalueReference<bx::AddLvalueReferenceType<TestClass&&> >() );
+}
+
+TEST_CASE("type-traits AddRvalueReferenceT", "")
+{
+ STATIC_REQUIRE( bx::isSame<bx::AddRvalueReferenceType<TestClass >, TestClass&& >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddRvalueReferenceType<TestClass& >, TestClass& >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddRvalueReferenceType<TestClass&&>, TestClass&& >() );
+
+ STATIC_REQUIRE( bx::isRvalueReference<bx::AddRvalueReferenceType<TestClass> >() );
+ STATIC_REQUIRE(!bx::isRvalueReference<bx::AddRvalueReferenceType<TestClass&> >() );
+ STATIC_REQUIRE( bx::isRvalueReference<bx::AddRvalueReferenceType<TestClass&&> >() );
+}
+
+TEST_CASE("type-traits RemoveReferenceT", "")
+{
+ STATIC_REQUIRE( bx::isSame<bx::RemoveReferenceType<TestClass >, TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveReferenceType<TestClass& >, TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveReferenceType<TestClass&&>, TestClass >() );
+
+ STATIC_REQUIRE(!bx::isReference<bx::RemoveReferenceType<TestClass> >() );
+ STATIC_REQUIRE(!bx::isReference<bx::RemoveReferenceType<TestClass&> >() );
+ STATIC_REQUIRE(!bx::isReference<bx::RemoveReferenceType<TestClass&&> >() );
+}
+
+TEST_CASE("type-traits AddPointerT", "")
+{
+ STATIC_REQUIRE( bx::isSame<bx::AddPointerType<TestClass >, TestClass* >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddPointerType<TestClass* >, TestClass** >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddPointerType<TestClass& >, TestClass* >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddPointerType<TestClass**>, TestClass*** >() );
+
+ STATIC_REQUIRE( bx::isPointer<bx::AddPointerType<TestClass> >() );
+ STATIC_REQUIRE( bx::isPointer<bx::AddPointerType<TestClass*> >() );
+ STATIC_REQUIRE( bx::isPointer<bx::AddPointerType<TestClass&> >() );
+ STATIC_REQUIRE( bx::isPointer<bx::AddPointerType<TestClass**> >() );
+}
+
+TEST_CASE("type-traits RemovePointerT", "")
+{
+ STATIC_REQUIRE( bx::isSame<bx::RemovePointerType<TestClass >, TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemovePointerType<TestClass* >, TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemovePointerType<TestClass**>, TestClass* >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemovePointerType<bx::RemovePointerType<TestClass**>>, TestClass >() );
+
+ STATIC_REQUIRE(!bx::isPointer<bx::RemovePointerType<TestClass> >() );
+ STATIC_REQUIRE(!bx::isPointer<bx::RemovePointerType<TestClass*> >() );
+ STATIC_REQUIRE( bx::isPointer<bx::RemovePointerType<TestClass**> >() );
+ STATIC_REQUIRE(!bx::isPointer<bx::RemovePointerType<bx::RemovePointerType<TestClass**>> >() );
+}
+
+TEST_CASE("type-traits AddConstT", "")
+{
+ STATIC_REQUIRE( bx::isSame<bx::AddConstType< TestClass >, const TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddConstType<const TestClass >, const TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddConstType< volatile TestClass >, const volatile TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddConstType<const volatile TestClass >, const volatile TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddConstType<const volatile TestClass*>, const volatile TestClass* const >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddConstType<TestClass* const volatile>, TestClass* const volatile >() );
+}
+
+TEST_CASE("type-traits RemoveConstT", "")
+{
+ STATIC_REQUIRE( bx::isSame<bx::RemoveConstType< TestClass >, TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveConstType<const TestClass >, TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveConstType< volatile TestClass >, volatile TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveConstType<const volatile TestClass >, volatile TestClass >() );
+ STATIC_REQUIRE(!bx::isSame<bx::RemoveConstType<const volatile TestClass*>, volatile TestClass*>() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveConstType<TestClass* const volatile>, TestClass* volatile>() );
+}
+
+TEST_CASE("type-traits AddVolatileT", "")
+{
+ STATIC_REQUIRE( bx::isSame<bx::AddVolatileType< TestClass >, volatile TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddVolatileType<const TestClass >, const volatile TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddVolatileType< volatile TestClass >, volatile TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddVolatileType<const volatile TestClass >, const volatile TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddVolatileType<const volatile TestClass*>, const volatile TestClass* volatile >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddVolatileType<TestClass* const volatile>, TestClass* const volatile >() );
+}
+
+TEST_CASE("type-traits RemoveVolatileT", "")
+{
+ STATIC_REQUIRE( bx::isSame<bx::RemoveVolatileType< TestClass >, TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveVolatileType<const TestClass >, const TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveVolatileType< volatile TestClass >, TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveVolatileType<const volatile TestClass >, const TestClass >() );
+ STATIC_REQUIRE(!bx::isSame<bx::RemoveVolatileType<const volatile TestClass*>, const TestClass* >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveVolatileType<TestClass* const volatile>, TestClass* const >() );
+}
+
+TEST_CASE("type-traits AddCvT", "")
+{
+ STATIC_REQUIRE( bx::isSame<bx::AddCvType< TestClass >, const volatile TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddCvType<const TestClass >, const volatile TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddCvType< volatile TestClass >, const volatile TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddCvType<const volatile TestClass >, const volatile TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddCvType<const volatile TestClass*>, const volatile TestClass* const volatile >() );
+ STATIC_REQUIRE( bx::isSame<bx::AddCvType<TestClass* const volatile>, TestClass* const volatile >() );
+}
+
+TEST_CASE("type-traits RemoveCvT", "")
+{
+ STATIC_REQUIRE( bx::isSame<bx::RemoveCvType< TestClass >, TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveCvType<const TestClass >, TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveCvType< volatile TestClass >, TestClass >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveCvType<const volatile TestClass >, TestClass >() );
+ STATIC_REQUIRE(!bx::isSame<bx::RemoveCvType<const volatile TestClass*>, TestClass* >() );
+ STATIC_REQUIRE( bx::isSame<bx::RemoveCvType<TestClass* const volatile>, TestClass* >() );
+}
+
+TEST_CASE("type-traits isTriviallyCopyable", "")
+{
+ STATIC_REQUIRE( bx::isTriviallyCopyable<int32_t >() );
+ STATIC_REQUIRE( bx::isTriviallyCopyable<TestClass >() );
+ STATIC_REQUIRE(!bx::isTriviallyCopyable<TestClassCtor >() );
+ STATIC_REQUIRE( bx::isTriviallyCopyable<TestClassDefaultCtor >() );
+ STATIC_REQUIRE( bx::isTriviallyCopyable<TestClassDefaultDtor >() );
+ STATIC_REQUIRE(!bx::isTriviallyCopyable<TestClassVirtualDtor >() );
+}
+
+TEST_CASE("type-traits isTriviallyConstructible", "")
+{
+ STATIC_REQUIRE( bx::isTriviallyConstructible<int32_t >() );
+ STATIC_REQUIRE( bx::isTriviallyConstructible<TestClass >() );
+ STATIC_REQUIRE(!bx::isTriviallyConstructible<TestClassCtor >() );
+ STATIC_REQUIRE(!bx::isTriviallyConstructible<TestClassDefaultCtor >() );
+ STATIC_REQUIRE( bx::isTriviallyConstructible<TestClassDefaultDtor >() );
+ STATIC_REQUIRE(!bx::isTriviallyConstructible<TestClassVirtualDtor >() );
+}
+
+TEST_CASE("type-traits isTriviallyDestructible", "")
+{
+ STATIC_REQUIRE( bx::isTriviallyDestructible<int32_t >() );
+ STATIC_REQUIRE( bx::isTriviallyDestructible<TestClass >() );
+ STATIC_REQUIRE( bx::isTriviallyDestructible<TestClassCtor >() );
+ STATIC_REQUIRE( bx::isTriviallyDestructible<TestClassDefaultCtor >() );
+ STATIC_REQUIRE( bx::isTriviallyDestructible<TestClassDefaultDtor >() );
+ STATIC_REQUIRE(!bx::isTriviallyDestructible<TestClassVirtualDtor >() );
+}
+
+TEST_CASE("type-traits isSigned", "")
+{
+ STATIC_REQUIRE(!bx::isSigned<bool >() );
+ STATIC_REQUIRE( bx::isSigned<char >() );
+ STATIC_REQUIRE( bx::isSigned<signed char >() );
+ STATIC_REQUIRE(!bx::isSigned<unsigned char >() );
+ STATIC_REQUIRE( bx::isSigned<short >() );
+ STATIC_REQUIRE(!bx::isSigned<unsigned short >() );
+ STATIC_REQUIRE( bx::isSigned<int >() );
+ STATIC_REQUIRE(!bx::isSigned<unsigned int >() );
+ STATIC_REQUIRE( bx::isSigned<long >() );
+ STATIC_REQUIRE(!bx::isSigned<unsigned long >() );
+ STATIC_REQUIRE( bx::isSigned<long long >() );
+ STATIC_REQUIRE(!bx::isSigned<unsigned long long >() );
+ STATIC_REQUIRE( bx::isSigned<long long int >() );
+ STATIC_REQUIRE(!bx::isSigned<unsigned long long int >() );
+
+ STATIC_REQUIRE( bx::isSigned<int8_t >() );
+ STATIC_REQUIRE(!bx::isSigned<uint8_t >() );
+ STATIC_REQUIRE( bx::isSigned<int16_t >() );
+ STATIC_REQUIRE(!bx::isSigned<uint16_t >() );
+ STATIC_REQUIRE( bx::isSigned<int32_t >() );
+ STATIC_REQUIRE(!bx::isSigned<uint32_t >() );
+ STATIC_REQUIRE( bx::isSigned<int64_t >() );
+ STATIC_REQUIRE(!bx::isSigned<uint64_t >() );
+ STATIC_REQUIRE( bx::isSigned<intmax_t >() );
+ STATIC_REQUIRE(!bx::isSigned<uintmax_t >() );
+ STATIC_REQUIRE(!bx::isSigned<uintptr_t >() );
+ STATIC_REQUIRE( bx::isSigned<ptrdiff_t >() );
+ STATIC_REQUIRE(!bx::isSigned<size_t >() );
+
+ STATIC_REQUIRE( bx::isSigned<float >() );
+ STATIC_REQUIRE( bx::isSigned<double >() );
+ STATIC_REQUIRE( bx::isSigned<long double >() );
+}
+
+TEST_CASE("type-traits isUnsigned", "")
+{
+ STATIC_REQUIRE( bx::isUnsigned<bool >() );
+ STATIC_REQUIRE(!bx::isUnsigned<char >() );
+ STATIC_REQUIRE(!bx::isUnsigned<signed char >() );
+ STATIC_REQUIRE( bx::isUnsigned<unsigned char >() );
+ STATIC_REQUIRE(!bx::isUnsigned<short >() );
+ STATIC_REQUIRE( bx::isUnsigned<unsigned short >() );
+ STATIC_REQUIRE(!bx::isUnsigned<int >() );
+ STATIC_REQUIRE( bx::isUnsigned<unsigned int >() );
+ STATIC_REQUIRE(!bx::isUnsigned<long >() );
+ STATIC_REQUIRE( bx::isUnsigned<unsigned long >() );
+ STATIC_REQUIRE(!bx::isUnsigned<long long >() );
+ STATIC_REQUIRE( bx::isUnsigned<unsigned long long >() );
+ STATIC_REQUIRE(!bx::isUnsigned<long long int >() );
+ STATIC_REQUIRE( bx::isUnsigned<unsigned long long int >() );
+
+ STATIC_REQUIRE(!bx::isUnsigned<int8_t >() );
+ STATIC_REQUIRE( bx::isUnsigned<uint8_t >() );
+ STATIC_REQUIRE(!bx::isUnsigned<int16_t >() );
+ STATIC_REQUIRE( bx::isUnsigned<uint16_t >() );
+ STATIC_REQUIRE(!bx::isUnsigned<int32_t >() );
+ STATIC_REQUIRE( bx::isUnsigned<uint32_t >() );
+ STATIC_REQUIRE(!bx::isUnsigned<int64_t >() );
+ STATIC_REQUIRE( bx::isUnsigned<uint64_t >() );
+ STATIC_REQUIRE(!bx::isUnsigned<intmax_t >() );
+ STATIC_REQUIRE( bx::isUnsigned<uintmax_t >() );
+ STATIC_REQUIRE( bx::isUnsigned<uintptr_t >() );
+ STATIC_REQUIRE(!bx::isUnsigned<ptrdiff_t >() );
+ STATIC_REQUIRE( bx::isUnsigned<size_t >() );
+
+ STATIC_REQUIRE(!bx::isUnsigned<float >() );
+ STATIC_REQUIRE(!bx::isUnsigned<double >() );
+ STATIC_REQUIRE(!bx::isUnsigned<long double >() );
+}
+
+TEST_CASE("type-traits isInteger", "")
+{
+ STATIC_REQUIRE( bx::isInteger<bool >() );
+ STATIC_REQUIRE( bx::isInteger<char >() );
+ STATIC_REQUIRE( bx::isInteger<signed char >() );
+ STATIC_REQUIRE( bx::isInteger<unsigned char >() );
+ STATIC_REQUIRE( bx::isInteger<short >() );
+ STATIC_REQUIRE( bx::isInteger<unsigned short >() );
+ STATIC_REQUIRE( bx::isInteger<int >() );
+ STATIC_REQUIRE( bx::isInteger<unsigned int >() );
+ STATIC_REQUIRE( bx::isInteger<long >() );
+ STATIC_REQUIRE( bx::isInteger<unsigned long >() );
+ STATIC_REQUIRE( bx::isInteger<long long >() );
+ STATIC_REQUIRE( bx::isInteger<unsigned long long >() );
+ STATIC_REQUIRE( bx::isInteger<long long int >() );
+ STATIC_REQUIRE( bx::isInteger<unsigned long long int >() );
+
+ STATIC_REQUIRE( bx::isInteger<int8_t >() );
+ STATIC_REQUIRE( bx::isInteger<uint8_t >() );
+ STATIC_REQUIRE( bx::isInteger<int16_t >() );
+ STATIC_REQUIRE( bx::isInteger<uint16_t >() );
+ STATIC_REQUIRE( bx::isInteger<int32_t >() );
+ STATIC_REQUIRE( bx::isInteger<uint32_t >() );
+ STATIC_REQUIRE( bx::isInteger<int64_t >() );
+ STATIC_REQUIRE( bx::isInteger<uint64_t >() );
+ STATIC_REQUIRE( bx::isInteger<intmax_t >() );
+ STATIC_REQUIRE( bx::isInteger<uintmax_t >() );
+ STATIC_REQUIRE( bx::isInteger<uintptr_t >() );
+ STATIC_REQUIRE( bx::isInteger<ptrdiff_t >() );
+ STATIC_REQUIRE( bx::isInteger<size_t >() );
+
+ STATIC_REQUIRE(!bx::isInteger<float >() );
+ STATIC_REQUIRE(!bx::isInteger<double >() );
+ STATIC_REQUIRE(!bx::isInteger<long double >() );
+
+ STATIC_REQUIRE(!bx::isInteger<TestClass >() );
+ STATIC_REQUIRE(!bx::isInteger<TestClassCtor >() );
+ STATIC_REQUIRE(!bx::isInteger<TestClassDefaultCtor >() );
+ STATIC_REQUIRE(!bx::isInteger<TestClassDefaultDtor >() );
+ STATIC_REQUIRE(!bx::isInteger<TestClassVirtualDtor >() );
+}
+
+TEST_CASE("type-traits isFloatingPoint", "")
+{
+ STATIC_REQUIRE(!bx::isFloatingPoint<bool >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<char >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<signed char >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<unsigned char >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<short >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<unsigned short >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<int >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<unsigned int >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<long >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<unsigned long >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<long long >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<unsigned long long >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<long long int >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<unsigned long long int >() );
+
+ STATIC_REQUIRE(!bx::isFloatingPoint<int8_t >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<uint8_t >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<int16_t >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<uint16_t >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<int32_t >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<uint32_t >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<int64_t >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<uint64_t >() );
+
+ STATIC_REQUIRE(!bx::isFloatingPoint<intmax_t >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<uintmax_t >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<uintptr_t >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<ptrdiff_t >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<size_t >() );
+
+ STATIC_REQUIRE( bx::isFloatingPoint<float >() );
+ STATIC_REQUIRE( bx::isFloatingPoint<double >() );
+ STATIC_REQUIRE( bx::isFloatingPoint<long double >() );
+
+ STATIC_REQUIRE(!bx::isFloatingPoint<TestClass >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<TestClassCtor >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<TestClassDefaultCtor >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<TestClassDefaultDtor >() );
+ STATIC_REQUIRE(!bx::isFloatingPoint<TestClassVirtualDtor >() );
+}
+
+TEST_CASE("type-traits isArithmetic", "")
+{
+ STATIC_REQUIRE( bx::isArithmetic<bool >() );
+ STATIC_REQUIRE( bx::isArithmetic<char >() );
+ STATIC_REQUIRE( bx::isArithmetic<signed char >() );
+ STATIC_REQUIRE( bx::isArithmetic<unsigned char >() );
+ STATIC_REQUIRE( bx::isArithmetic<short >() );
+ STATIC_REQUIRE( bx::isArithmetic<unsigned short >() );
+ STATIC_REQUIRE( bx::isArithmetic<int >() );
+ STATIC_REQUIRE( bx::isArithmetic<unsigned int >() );
+ STATIC_REQUIRE( bx::isArithmetic<long >() );
+ STATIC_REQUIRE( bx::isArithmetic<unsigned long >() );
+ STATIC_REQUIRE( bx::isArithmetic<long long >() );
+ STATIC_REQUIRE( bx::isArithmetic<unsigned long long >() );
+ STATIC_REQUIRE( bx::isArithmetic<long long int >() );
+ STATIC_REQUIRE( bx::isArithmetic<unsigned long long int >() );
+
+ STATIC_REQUIRE( bx::isArithmetic<int8_t >() );
+ STATIC_REQUIRE( bx::isArithmetic<uint8_t >() );
+ STATIC_REQUIRE( bx::isArithmetic<int16_t >() );
+ STATIC_REQUIRE( bx::isArithmetic<uint16_t >() );
+ STATIC_REQUIRE( bx::isArithmetic<int32_t >() );
+ STATIC_REQUIRE( bx::isArithmetic<uint32_t >() );
+ STATIC_REQUIRE( bx::isArithmetic<int64_t >() );
+ STATIC_REQUIRE( bx::isArithmetic<uint64_t >() );
+ STATIC_REQUIRE( bx::isArithmetic<intmax_t >() );
+ STATIC_REQUIRE( bx::isArithmetic<uintmax_t >() );
+ STATIC_REQUIRE( bx::isArithmetic<uintptr_t >() );
+ STATIC_REQUIRE( bx::isArithmetic<ptrdiff_t >() );
+ STATIC_REQUIRE( bx::isArithmetic<size_t >() );
+
+ STATIC_REQUIRE( bx::isArithmetic<float >() );
+ STATIC_REQUIRE( bx::isArithmetic<double >() );
+ STATIC_REQUIRE( bx::isArithmetic<long double >() );
+
+ STATIC_REQUIRE(!bx::isArithmetic<TestClass >() );
+ STATIC_REQUIRE(!bx::isArithmetic<TestClassCtor >() );
+ STATIC_REQUIRE(!bx::isArithmetic<TestClassDefaultCtor >() );
+ STATIC_REQUIRE(!bx::isArithmetic<TestClassDefaultDtor >() );
+ STATIC_REQUIRE(!bx::isArithmetic<TestClassVirtualDtor >() );
+}
+
+TEST_CASE("type-traits isBoundedArray", "")
+{
+ STATIC_REQUIRE(!bx::isBoundedArray<TestClass >() );
+ STATIC_REQUIRE(!bx::isBoundedArray<TestClass[] >() );
+ STATIC_REQUIRE( bx::isBoundedArray<TestClass[1389] >() );
+ STATIC_REQUIRE(!bx::isBoundedArray<float >() );
+ STATIC_REQUIRE(!bx::isBoundedArray<int >() );
+ STATIC_REQUIRE(!bx::isBoundedArray<int[] >() );
+ STATIC_REQUIRE( bx::isBoundedArray<int[1389] >() );
+}
+
+TEST_CASE("type-traits isUnboundedArray", "")
+{
+ STATIC_REQUIRE(!bx::isUnboundedArray<TestClass >() );
+ STATIC_REQUIRE( bx::isUnboundedArray<TestClass[] >() );
+ STATIC_REQUIRE(!bx::isUnboundedArray<TestClass[1389] >() );
+ STATIC_REQUIRE(!bx::isUnboundedArray<float >() );
+ STATIC_REQUIRE(!bx::isUnboundedArray<int32_t >() );
+ STATIC_REQUIRE( bx::isUnboundedArray<int32_t[] >() );
+ STATIC_REQUIRE(!bx::isUnboundedArray<int32_t[1389] >() );
+}
+
+TEST_CASE("type-traits isArray", "")
+{
+ STATIC_REQUIRE(!bx::isArray<TestClass >() );
+ STATIC_REQUIRE( bx::isArray<TestClass[] >() );
+ STATIC_REQUIRE( bx::isArray<TestClass[1389] >() );
+ STATIC_REQUIRE(!bx::isArray<float >() );
+ STATIC_REQUIRE(!bx::isArray<int32_t >() );
+ STATIC_REQUIRE( bx::isArray<int32_t[] >() );
+ STATIC_REQUIRE( bx::isArray<int32_t[1389] >() );
+ STATIC_REQUIRE( bx::isArray<TestUnion[] >() );
+}
+
+TEST_CASE("type-traits isEnum", "")
+{
+ STATIC_REQUIRE(!bx::isEnum<TestClass >() );
+ STATIC_REQUIRE(!bx::isEnum<TestUnion >() );
+ STATIC_REQUIRE(!bx::isEnum<TestUnionEmpty >() );
+ STATIC_REQUIRE(!bx::isEnum<TestUnion[] >() );
+ STATIC_REQUIRE(!bx::isEnum<int32_t[] >() );
+ STATIC_REQUIRE( bx::isEnum<TestEnumEmpty >() );
+ STATIC_REQUIRE( bx::isEnum<TestEnum >() );
+}
+
+TEST_CASE("type-traits isUnion", "")
+{
+ STATIC_REQUIRE(!bx::isUnion<TestClass >() );
+ STATIC_REQUIRE( bx::isUnion<TestUnion >() );
+ STATIC_REQUIRE( bx::isUnion<TestUnionEmpty >() );
+ STATIC_REQUIRE(!bx::isUnion<TestUnion[] >() );
+ STATIC_REQUIRE(!bx::isUnion<int32_t[] >() );
+ STATIC_REQUIRE(!bx::isUnion<TestEnumEmpty >() );
+ STATIC_REQUIRE(!bx::isUnion<TestEnum >() );
+}
+
+TEST_CASE("type-traits isClass", "")
+{
+ STATIC_REQUIRE( bx::isClass<TestClass >() );
+ STATIC_REQUIRE( bx::isClass<TestClassFinal >() );
+ STATIC_REQUIRE( bx::isClass<TestClassCtor >() );
+ STATIC_REQUIRE( bx::isClass<TestClassMember >() );
+ STATIC_REQUIRE( bx::isClass<TestClassMemberPrivate >() );
+ STATIC_REQUIRE( bx::isClass<TestClassStaticOnly >() );
+ STATIC_REQUIRE( bx::isClass<TestClassDefaultCtor >() );
+ STATIC_REQUIRE( bx::isClass<TestClassDefaultDtor >() );
+ STATIC_REQUIRE( bx::isClass<TestClassVirtualDtor >() );
+ STATIC_REQUIRE( bx::isClass<TestClassAbstractBase >() );
+ STATIC_REQUIRE( bx::isClass<TestClassDerivedA >() );
+ STATIC_REQUIRE( bx::isClass<TestClassDerivedB >() );
+ STATIC_REQUIRE(!bx::isClass<TestUnion >() );
+ STATIC_REQUIRE(!bx::isClass<TestUnion[] >() );
+ STATIC_REQUIRE(!bx::isClass<int32_t[] >() );
+}
+
+TEST_CASE("type-traits isFinal", "")
+{
+ STATIC_REQUIRE(!bx::isFinal<TestClass >() );
+ STATIC_REQUIRE( bx::isFinal<TestClassFinal >() );
+ STATIC_REQUIRE(!bx::isFinal<TestClassCtor >() );
+ STATIC_REQUIRE(!bx::isFinal<TestClassMember >() );
+ STATIC_REQUIRE(!bx::isFinal<TestClassMemberPrivate >() );
+ STATIC_REQUIRE(!bx::isFinal<TestClassStaticOnly >() );
+ STATIC_REQUIRE(!bx::isFinal<TestClassDefaultCtor >() );
+ STATIC_REQUIRE(!bx::isFinal<TestClassDefaultDtor >() );
+ STATIC_REQUIRE(!bx::isFinal<TestClassVirtualDtor >() );
+ STATIC_REQUIRE(!bx::isFinal<TestClassAbstractBase >() );
+ STATIC_REQUIRE(!bx::isFinal<TestClassPolymorphic >() );
+ STATIC_REQUIRE(!bx::isFinal<TestClassDerivedA >() );
+ STATIC_REQUIRE(!bx::isFinal<TestClassDerivedB >() );
+ STATIC_REQUIRE(!bx::isFinal<TestUnion >() );
+ STATIC_REQUIRE(!bx::isFinal<TestUnionEmpty >() );
+ STATIC_REQUIRE(!bx::isFinal<TestUnion[] >() );
+ STATIC_REQUIRE(!bx::isFinal<int32_t[] >() );
+}
+
+TEST_CASE("type-traits isEmpty", "")
+{
+ STATIC_REQUIRE( bx::isEmpty<TestClass >() );
+ STATIC_REQUIRE( bx::isEmpty<TestClassFinal >() );
+ STATIC_REQUIRE( bx::isEmpty<TestClassCtor >() );
+ STATIC_REQUIRE( bx::isEmpty<TestClassDefaultCtor >() );
+ STATIC_REQUIRE( bx::isEmpty<TestClassDefaultDtor >() );
+ STATIC_REQUIRE(!bx::isEmpty<TestClassVirtualDtor >() );
+ STATIC_REQUIRE(!bx::isEmpty<TestClassAbstractBase >() );
+ STATIC_REQUIRE(!bx::isEmpty<TestClassPolymorphic >() );
+ STATIC_REQUIRE(!bx::isEmpty<TestUnion >() );
+ STATIC_REQUIRE(!bx::isEmpty<TestUnionEmpty >() );
+ STATIC_REQUIRE(!bx::isEmpty<TestUnion[] >() );
+ STATIC_REQUIRE(!bx::isEmpty<int32_t[] >() );
+}
+
+TEST_CASE("type-traits isStandardLayout", "")
+{
+ STATIC_REQUIRE( bx::isStandardLayout<TestClass >() );
+ STATIC_REQUIRE( bx::isStandardLayout<TestClassFinal >() );
+ STATIC_REQUIRE( bx::isStandardLayout<TestClassCtor >() );
+ STATIC_REQUIRE( bx::isStandardLayout<TestClassMember >() );
+ STATIC_REQUIRE(!bx::isStandardLayout<TestClassMemberPrivate >() );
+ STATIC_REQUIRE( bx::isStandardLayout<TestClassStaticOnly >() );
+ STATIC_REQUIRE( bx::isStandardLayout<TestClassDefaultCtor >() );
+ STATIC_REQUIRE( bx::isStandardLayout<TestClassDefaultDtor >() );
+ STATIC_REQUIRE(!bx::isStandardLayout<TestClassVirtualDtor >() );
+ STATIC_REQUIRE(!bx::isStandardLayout<TestClassAbstractBase >() );
+ STATIC_REQUIRE(!bx::isStandardLayout<TestClassPolymorphic >() );
+ STATIC_REQUIRE( bx::isStandardLayout<TestClassDerivedA >() );
+ STATIC_REQUIRE( bx::isStandardLayout<TestClassDerivedB >() );
+ STATIC_REQUIRE( bx::isStandardLayout<TestUnion >() );
+ STATIC_REQUIRE( bx::isStandardLayout<TestUnionEmpty >() );
+ STATIC_REQUIRE( bx::isStandardLayout<TestUnion[] >() );
+ STATIC_REQUIRE( bx::isStandardLayout<int32_t[] >() );
+}
+
+TEST_CASE("type-traits isTrivial", "")
+{
+ STATIC_REQUIRE( bx::isTrivial<TestClass >() );
+ STATIC_REQUIRE( bx::isTrivial<TestClassFinal >() );
+ STATIC_REQUIRE(!bx::isTrivial<TestClassCtor >() );
+ STATIC_REQUIRE( bx::isTrivial<TestClassMember >() );
+ STATIC_REQUIRE( bx::isTrivial<TestClassMemberPrivate >() );
+ STATIC_REQUIRE( bx::isTrivial<TestClassStaticOnly >() );
+ STATIC_REQUIRE(!bx::isTrivial<TestClassDefaultCtor >() );
+ STATIC_REQUIRE( bx::isTrivial<TestClassDefaultDtor >() );
+ STATIC_REQUIRE(!bx::isTrivial<TestClassVirtualDtor >() );
+ STATIC_REQUIRE(!bx::isTrivial<TestClassAbstractBase >() );
+ STATIC_REQUIRE(!bx::isTrivial<TestClassPolymorphic >() );
+ STATIC_REQUIRE( bx::isTrivial<TestClassDerivedA >() );
+ STATIC_REQUIRE( bx::isTrivial<TestClassDerivedB >() );
+ STATIC_REQUIRE( bx::isTrivial<TestUnion >() );
+ STATIC_REQUIRE( bx::isTrivial<TestUnionEmpty >() );
+ STATIC_REQUIRE( bx::isTrivial<TestUnion[] >() );
+ STATIC_REQUIRE( bx::isTrivial<int32_t[] >() );
+}
+
+TEST_CASE("type-traits isPod", "")
+{
+ STATIC_REQUIRE( bx::isPod<TestClass >() );
+ STATIC_REQUIRE( bx::isPod<TestClassFinal >() );
+ STATIC_REQUIRE(!bx::isPod<TestClassCtor >() );
+ STATIC_REQUIRE( bx::isPod<TestClassMember >() );
+ STATIC_REQUIRE(!bx::isPod<TestClassMemberPrivate >() );
+ STATIC_REQUIRE( bx::isPod<TestClassStaticOnly >() );
+ STATIC_REQUIRE(!bx::isPod<TestClassDefaultCtor >() );
+ STATIC_REQUIRE( bx::isPod<TestClassDefaultDtor >() );
+ STATIC_REQUIRE(!bx::isPod<TestClassVirtualDtor >() );
+ STATIC_REQUIRE(!bx::isPod<TestClassPolymorphic >() );
+ STATIC_REQUIRE(!bx::isPod<TestClassAbstractBase >() );
+ STATIC_REQUIRE( bx::isPod<TestClassDerivedA >() );
+ STATIC_REQUIRE( bx::isPod<TestClassDerivedB >() );
+ STATIC_REQUIRE( bx::isPod<TestUnion >() );
+ STATIC_REQUIRE( bx::isPod<TestUnionEmpty >() );
+ STATIC_REQUIRE( bx::isPod<TestUnion[] >() );
+ STATIC_REQUIRE( bx::isPod<int32_t[] >() );
+}
+
+TEST_CASE("type-traits isPolymorphic", "")
+{
+ STATIC_REQUIRE(!bx::isPolymorphic<TestClass >() );
+ STATIC_REQUIRE(!bx::isPolymorphic<TestClassFinal >() );
+ STATIC_REQUIRE(!bx::isPolymorphic<TestClassCtor >() );
+ STATIC_REQUIRE(!bx::isPolymorphic<TestClassMember >() );
+ STATIC_REQUIRE(!bx::isPolymorphic<TestClassMemberPrivate >() );
+ STATIC_REQUIRE(!bx::isPolymorphic<TestClassStaticOnly >() );
+ STATIC_REQUIRE(!bx::isPolymorphic<TestClassDefaultCtor >() );
+ STATIC_REQUIRE(!bx::isPolymorphic<TestClassDefaultDtor >() );
+ STATIC_REQUIRE( bx::isPolymorphic<TestClassVirtualDtor >() );
+ STATIC_REQUIRE( bx::isPolymorphic<TestClassAbstractBase >() );
+ STATIC_REQUIRE( bx::isPolymorphic<TestClassPolymorphic >() );
+ STATIC_REQUIRE(!bx::isPolymorphic<TestClassDerivedA >() );
+ STATIC_REQUIRE(!bx::isPolymorphic<TestClassDerivedB >() );
+ STATIC_REQUIRE( bx::isPolymorphic<TestClassDerivedX >() );
+ STATIC_REQUIRE(!bx::isPolymorphic<TestUnion >() );
+ STATIC_REQUIRE(!bx::isPolymorphic<TestUnionEmpty >() );
+ STATIC_REQUIRE(!bx::isPolymorphic<TestUnion[] >() );
+ STATIC_REQUIRE(!bx::isPolymorphic<int32_t[] >() );
+}
+
+TEST_CASE("type-traits isDestructorVirtual", "")
+{
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestClass >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestClassFinal >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestClassCtor >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestClassMember >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestClassMemberPrivate >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestClassStaticOnly >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestClassDefaultCtor >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestClassDefaultDtor >() );
+ STATIC_REQUIRE( bx::isDestructorVirtual<TestClassVirtualDtor >() );
+ STATIC_REQUIRE( bx::isDestructorVirtual<TestClassAbstractBase >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestClassPolymorphic >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestClassDerivedA >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestClassDerivedB >() );
+ STATIC_REQUIRE( bx::isDestructorVirtual<TestClassDerivedX >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestUnion >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestUnionEmpty >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<TestUnion[] >() );
+ STATIC_REQUIRE(!bx::isDestructorVirtual<int32_t[] >() );
+}
+
+TEST_CASE("type-traits isBaseOf", "")
+{
+ STATIC_REQUIRE( bx::isBaseOf<TestClass, TestClass >() );
+ STATIC_REQUIRE( bx::isBaseOf<TestClass, TestClassDerivedA >() );
+ STATIC_REQUIRE( bx::isBaseOf<TestClass, TestClassDerivedB >() );
+ STATIC_REQUIRE(!bx::isBaseOf<TestClass, TestClassFinal >() );
+ STATIC_REQUIRE(!bx::isBaseOf<TestClassDerivedB, TestClassDerivedA >() );
+ STATIC_REQUIRE(!bx::isBaseOf<TestClassDerivedB, TestClassDerivedX >() );
+ STATIC_REQUIRE(!bx::isBaseOf<int32_t, int32_t >() );
+}
+
+TEST_CASE("type-traits isAggregate", "")
+{
+ STATIC_REQUIRE( bx::isAggregate<TestClass >() );
+ STATIC_REQUIRE( bx::isAggregate<TestClassFinal >() );
+ STATIC_REQUIRE(!bx::isAggregate<TestClassCtor >() );
+ STATIC_REQUIRE( bx::isAggregate<TestClassMember >() );
+ STATIC_REQUIRE(!bx::isAggregate<TestClassMemberPrivate >() );
+ STATIC_REQUIRE( bx::isAggregate<TestClassStaticOnly >() );
+#if __cplusplus < BX_LANGUAGE_CPP20
+ STATIC_REQUIRE( bx::isAggregate<TestClassDefaultCtor >() );
+#else
+ STATIC_REQUIRE(!bx::isAggregate<TestClassDefaultCtor >() );
+#endif
+ STATIC_REQUIRE( bx::isAggregate<TestClassDefaultDtor >() );
+ STATIC_REQUIRE(!bx::isAggregate<TestClassVirtualDtor >() );
+ STATIC_REQUIRE(!bx::isAggregate<TestClassAbstractBase >() );
+ STATIC_REQUIRE(!bx::isAggregate<TestClassPolymorphic >() );
+#if __cplusplus < BX_LANGUAGE_CPP17
+ STATIC_REQUIRE(!bx::isAggregate<TestClassDerivedA >() );
+ STATIC_REQUIRE(!bx::isAggregate<TestClassDerivedB >() );
+#else
+ STATIC_REQUIRE( bx::isAggregate<TestClassDerivedA >() );
+ STATIC_REQUIRE( bx::isAggregate<TestClassDerivedB >() );
+#endif
+ STATIC_REQUIRE(!bx::isAggregate<TestClassDerivedX >() );
+ STATIC_REQUIRE( bx::isAggregate<TestUnion >() );
+ STATIC_REQUIRE( bx::isAggregate<TestUnionEmpty >() );
+ STATIC_REQUIRE( bx::isAggregate<TestUnion[] >() );
+ STATIC_REQUIRE( bx::isAggregate<int32_t[] >() );
+}
diff --git a/3rdparty/bx/tests/uint32_test.cpp b/3rdparty/bx/tests/uint32_test.cpp
index 663ac3f1dd1..572bcdf4880 100644
--- a/3rdparty/bx/tests/uint32_test.cpp
+++ b/3rdparty/bx/tests/uint32_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
@@ -39,7 +39,7 @@ TEST_CASE("uint32_cnt")
REQUIRE(16 == bx::uint32_cnttz<uint16_t>(0) );
REQUIRE( 0 == bx::uint32_cnttz<uint32_t>(1) );
REQUIRE(32 == bx::uint32_cnttz<uint32_t>(0) );
- REQUIRE(31 == bx::uint32_cnttz<uint32_t>(1<<31) );
+ REQUIRE(31 == bx::uint32_cnttz<uint32_t>(1u<<31) );
REQUIRE( 0 == bx::uint32_cnttz<uint64_t>(1) );
REQUIRE(64 == bx::uint32_cnttz<uint64_t>(0) );
diff --git a/3rdparty/bx/tests/url_test.cpp b/3rdparty/bx/tests/url_test.cpp
index c0a9f62d1b4..a488ae9e545 100644
--- a/3rdparty/bx/tests/url_test.cpp
+++ b/3rdparty/bx/tests/url_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
diff --git a/3rdparty/bx/tests/vsnprintf_test.cpp b/3rdparty/bx/tests/vsnprintf_test.cpp
index 8d09210825f..de7649b74f5 100644
--- a/3rdparty/bx/tests/vsnprintf_test.cpp
+++ b/3rdparty/bx/tests/vsnprintf_test.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2010-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2010-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include "test.h"
@@ -72,9 +72,67 @@ TEST_CASE("vsnprintf f")
REQUIRE(test("0001.500", "%08.3f", 1.5) );
REQUIRE(test("+001.500", "%+08.3f", 1.5) );
REQUIRE(test("-001.500", "%+08.3f", -1.5) );
- REQUIRE(test("0.003906", "%f", 0.00390625) );
REQUIRE(test("0.0039", "%.4f", 0.00390625) );
+ REQUIRE(test("0.003906", "%f", 0.00390625) );
+ REQUIRE(test("-1.234567e-9", "%f", -1.234567e-9) );
+
+ REQUIRE(test("-1e-9", "%.0f", -1.234567e-9) );
+ REQUIRE(test("-1.2e-9", "%.1f", -1.234567e-9) );
+ REQUIRE(test("-1.23e-9", "%.2f", -1.234567e-9) );
+ REQUIRE(test("-1.234e-9", "%.3f", -1.234567e-9) );
+ REQUIRE(test("-1.2345e-9", "%.4f", -1.234567e-9) );
+ REQUIRE(test("-1.23456e-9", "%.5f", -1.234567e-9) );
+ REQUIRE(test("-1.234567e-9", "%.6f", -1.234567e-9) );
+ REQUIRE(test("-1.2345670e-9", "%.7f", -1.234567e-9) );
+ REQUIRE(test("-1.23456700e-9", "%.8f", -1.234567e-9) );
+ REQUIRE(test("-1.234567000e-9", "%.9f", -1.234567e-9) );
+ REQUIRE(test("-1.2345670000e-9", "%.10f", -1.234567e-9) );
+
+ REQUIRE(test("3.141592", "%f", 3.1415926535897932) );
+ REQUIRE(test("3.141592", "%F", 3.1415926535897932) );
+ REQUIRE(test("3", "%.0f", 3.1415926535897932) );
+ REQUIRE(test("3.1", "%.1f", 3.1415926535897932) );
+ REQUIRE(test("3.14", "%.2f", 3.1415926535897932) );
+ REQUIRE(test("3.141", "%.3f", 3.1415926535897932) );
+ REQUIRE(test("3.1415", "%.4f", 3.1415926535897932) );
+ REQUIRE(test("3.14159", "%.5f", 3.1415926535897932) );
+ REQUIRE(test("3.141592", "%.6f", 3.1415926535897932) );
+ REQUIRE(test("3.1415926", "%.7f", 3.1415926535897932) );
+ REQUIRE(test("3.14159265", "%.8f", 3.1415926535897932) );
+ REQUIRE(test("3.141592653", "%.9f", 3.1415926535897932) );
+ REQUIRE(test("3.1415926535", "%.10f", 3.1415926535897932) );
+ REQUIRE(test("3.14159265358", "%.11f", 3.1415926535897932) );
+ REQUIRE(test("3.141592653589", "%.12f", 3.1415926535897932) );
+ REQUIRE(test("3.1415926535897", "%.13f", 3.1415926535897932) );
+ REQUIRE(test("3.14159265358979", "%.14f", 3.1415926535897932) );
+ REQUIRE(test("3.141592653589793", "%.15f", 3.1415926535897932) );
+ REQUIRE(test("3.1415926535897930", "%.16f", 3.1415926535897932) );
+ REQUIRE(test("3.1415926535897930", "%.16F", 3.1415926535897932) );
+
+ REQUIRE(test("-3.141592e-9", "%f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.141592E-9", "%F", -3.1415926535897932e-9) );
+ REQUIRE(test("-3e-9", "%.0f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.1e-9", "%.1f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.14e-9", "%.2f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.141e-9", "%.3f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.1415e-9", "%.4f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.14159e-9", "%.5f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.141592e-9", "%.6f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.1415926e-9", "%.7f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.14159265e-9", "%.8f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.141592653e-9", "%.9f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.1415926535e-9", "%.10f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.14159265358e-9", "%.11f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.141592653589e-9", "%.12f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.1415926535897e-9", "%.13f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.14159265358979e-9", "%.14f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.141592653589793e-9", "%.15f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.1415926535897930e-9", "%.16f", -3.1415926535897932e-9) );
+ REQUIRE(test("-3.1415926535897930E-9", "%.16F", -3.1415926535897932e-9) );
+
+ REQUIRE(test("1e-12", "%f", 1e-12));
+
REQUIRE(test("0.00390625", "%.8f", 0.00390625) );
REQUIRE(test("-0.00390625", "%.8f", -0.00390625) );
REQUIRE(test("1.50000000000000000", "%.17f", 1.5) );
@@ -179,6 +237,29 @@ TEST_CASE("vsnprintf s")
REQUIRE(test("(null)", "%s", NULL) );
}
+TEST_CASE("vsnprintf t")
+{
+ size_t size = size_t(-1);
+
+ REQUIRE(test("-1", "%td", size) );
+
+ REQUIRE(test("3221225472", "%td", size_t(3221225472) ) );
+}
+
+TEST_CASE("vsnprintf n")
+{
+ char temp[64];
+
+ int32_t p0, p1, p2;
+ bx::snprintf(temp, sizeof(temp), "%n", &p0);
+ REQUIRE(0 == p0);
+
+ bx::snprintf(temp, sizeof(temp), "01%n23%n45%n", &p0, &p1, &p2);
+ REQUIRE(2 == p0);
+ REQUIRE(4 == p1);
+ REQUIRE(6 == p2);
+}
+
TEST_CASE("vsnprintf g")
{
REQUIRE(test(" 0.01", "%7.2g", .01) );
@@ -208,6 +289,11 @@ TEST_CASE("vsnprintf")
, hello.getLength(), hello.getPtr()
, world.getLength(), world.getPtr()
) );
+
+ REQUIRE(test("hello, world!", "%S, %S!"
+ , &hello
+ , &world
+ ) );
}
TEST_CASE("vsnprintf write")
@@ -224,3 +310,15 @@ TEST_CASE("vsnprintf write")
bx::StringView str(tmp, len);
REQUIRE(0 == bx::strCmp(str, "1389") );
}
+
+TEST_CASE("snprintf invalid")
+{
+ char temp[64];
+ REQUIRE(0 == bx::snprintf(temp, sizeof(temp), "%", 1) );
+ REQUIRE(0 == bx::snprintf(temp, sizeof(temp), "%-", 1) );
+ REQUIRE(0 == bx::snprintf(temp, sizeof(temp), "%-0", 1) );
+ REQUIRE(0 == bx::snprintf(temp, sizeof(temp), "%-03", 1) );
+ REQUIRE(0 == bx::snprintf(temp, sizeof(temp), "%-03.", 1) );
+ REQUIRE(0 == bx::snprintf(temp, sizeof(temp), "%-03.0", 1) );
+ REQUIRE(0 == bx::snprintf(temp, sizeof(temp), "%-03.0t", 1) );
+}
diff --git a/3rdparty/bx/tools/bin/darwin/genie b/3rdparty/bx/tools/bin/darwin/genie
index d12f53ec4c1..db20768b961 100755
--- a/3rdparty/bx/tools/bin/darwin/genie
+++ b/3rdparty/bx/tools/bin/darwin/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/darwin/lempar.c b/3rdparty/bx/tools/bin/darwin/lempar.c
index da81ddd4bc0..5e2024fffb0 100644
--- a/3rdparty/bx/tools/bin/darwin/lempar.c
+++ b/3rdparty/bx/tools/bin/darwin/lempar.c
@@ -13,7 +13,7 @@
**
** The "lemon" program processes an LALR(1) input grammar file, then uses
** this template to construct a parser. The "lemon" program inserts text
-** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the
+** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the
** interstitial "-" characters) contained in this template is changed into
** the value of the %name directive from the grammar. Otherwise, the content
** of this template is copied straight through into the generate parser
diff --git a/3rdparty/bx/tools/bin/linux/bin2c b/3rdparty/bx/tools/bin/linux/bin2c
index 39015b9b40e..a79a17d9182 100755
--- a/3rdparty/bx/tools/bin/linux/bin2c
+++ b/3rdparty/bx/tools/bin/linux/bin2c
Binary files differ
diff --git a/3rdparty/bx/tools/bin/linux/genie b/3rdparty/bx/tools/bin/linux/genie
index 996d64acd06..f7bc6a12336 100755
--- a/3rdparty/bx/tools/bin/linux/genie
+++ b/3rdparty/bx/tools/bin/linux/genie
Binary files differ
diff --git a/3rdparty/bx/tools/bin/linux/lemon b/3rdparty/bx/tools/bin/linux/lemon
index be869ab1886..6c5e3bdcdff 100755
--- a/3rdparty/bx/tools/bin/linux/lemon
+++ b/3rdparty/bx/tools/bin/linux/lemon
Binary files differ
diff --git a/3rdparty/bx/tools/bin/linux/lempar.c b/3rdparty/bx/tools/bin/linux/lempar.c
index da81ddd4bc0..5e2024fffb0 100644
--- a/3rdparty/bx/tools/bin/linux/lempar.c
+++ b/3rdparty/bx/tools/bin/linux/lempar.c
@@ -13,7 +13,7 @@
**
** The "lemon" program processes an LALR(1) input grammar file, then uses
** this template to construct a parser. The "lemon" program inserts text
-** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the
+** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the
** interstitial "-" characters) contained in this template is changed into
** the value of the %name directive from the grammar. Otherwise, the content
** of this template is copied straight through into the generate parser
diff --git a/3rdparty/bx/tools/bin/windows/genie.exe b/3rdparty/bx/tools/bin/windows/genie.exe
index cd5ebbb2eed..f6304b1f4cf 100644
--- a/3rdparty/bx/tools/bin/windows/genie.exe
+++ b/3rdparty/bx/tools/bin/windows/genie.exe
Binary files differ
diff --git a/3rdparty/bx/tools/bin/windows/lempar.c b/3rdparty/bx/tools/bin/windows/lempar.c
index da81ddd4bc0..5e2024fffb0 100644
--- a/3rdparty/bx/tools/bin/windows/lempar.c
+++ b/3rdparty/bx/tools/bin/windows/lempar.c
@@ -13,7 +13,7 @@
**
** The "lemon" program processes an LALR(1) input grammar file, then uses
** this template to construct a parser. The "lemon" program inserts text
-** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the
+** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the
** interstitial "-" characters) contained in this template is changed into
** the value of the %name directive from the grammar. Otherwise, the content
** of this template is copied straight through into the generate parser
diff --git a/3rdparty/bx/tools/bin2c/bin2c.cpp b/3rdparty/bx/tools/bin2c/bin2c.cpp
index 066d9e25f8d..8d152ff6b80 100644
--- a/3rdparty/bx/tools/bin2c/bin2c.cpp
+++ b/3rdparty/bx/tools/bin2c/bin2c.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bx#license-bsd-2-clause
+ * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bx/blob/master/LICENSE
*/
#include <bx/allocator.h>
@@ -196,8 +196,8 @@ void help(const char* _error = NULL)
bx::write(stdOut, &err
, "bin2c, binary to C\n"
- "Copyright 2011-2021 Branimir Karadzic. All rights reserved.\n"
- "License: https://github.com/bkaradzic/bx#license-bsd-2-clause\n\n"
+ "Copyright 2011-2022 Branimir Karadzic. All rights reserved.\n"
+ "License: https://github.com/bkaradzic/bx/blob/master/LICENSE\n\n"
);
bx::write(stdOut, &err
@@ -252,14 +252,14 @@ int main(int _argc, const char* _argv[])
bx::DefaultAllocator allocator;
data = BX_ALLOC(&allocator, size);
- bx::read(&fr, data, size);
+ bx::read(&fr, data, size, bx::ErrorAssert{});
bx::close(&fr);
bx::FileWriter fw;
if (bx::open(&fw, outFilePath) )
{
Bin2cWriter writer(&allocator, name);
- bx::write(&writer, data, size);
+ bx::write(&writer, data, size, bx::ErrorAssert{});
writer.output(&fw);
bx::close(&fw);
diff --git a/3rdparty/bx/tools/lemon/lemon.c b/3rdparty/bx/tools/lemon/lemon.c
index acc5450c993..acf2483ef23 100644
--- a/3rdparty/bx/tools/lemon/lemon.c
+++ b/3rdparty/bx/tools/lemon/lemon.c
@@ -980,7 +980,7 @@ PRIVATE void buildshifts(struct lemon *lemp, struct state *stp)
struct symbol *bsp; /* Symbol following the dot in configuration "bcfp" */
struct state *newstp; /* A pointer to a successor state */
- /* Each configuration becomes complete after it contibutes to a successor
+ /* Each configuration becomes complete after it contributes to a successor
** state. Initially, all configurations are incomplete */
for(cfp=stp->cfp; cfp; cfp=cfp->next) cfp->status = INCOMPLETE;
@@ -1819,7 +1819,7 @@ static char *merge(
**
** Return Value:
** A pointer to the head of a sorted list containing the elements
-** orginally in list.
+** originally in list.
**
** Side effects:
** The "next" pointers for elements in list are changed.
@@ -3266,7 +3266,7 @@ void ReportOutput(struct lemon *lemp)
}
/* Search for the file "name" which is in the same directory as
-** the exacutable */
+** the executable */
PRIVATE char *pathsearch(char *argv0, char *name, int modemask)
{
const char *pathlist;
diff --git a/3rdparty/bx/tools/lemon/lempar.c b/3rdparty/bx/tools/lemon/lempar.c
index da81ddd4bc0..5e2024fffb0 100644
--- a/3rdparty/bx/tools/lemon/lempar.c
+++ b/3rdparty/bx/tools/lemon/lempar.c
@@ -13,7 +13,7 @@
**
** The "lemon" program processes an LALR(1) input grammar file, then uses
** this template to construct a parser. The "lemon" program inserts text
-** at each "%%" line. Also, any "P-a-r-s-e" identifer prefix (without the
+** at each "%%" line. Also, any "P-a-r-s-e" identifier prefix (without the
** interstitial "-" characters) contained in this template is changed into
** the value of the %name directive from the grammar. Otherwise, the content
** of this template is copied straight through into the generate parser
diff --git a/bgfx/shaders/essl/chains/blurs/vs_smart-blur.bin b/bgfx/shaders/essl/chains/blurs/vs_smart-blur.bin
index e86eea6c306..6da4fd9aff5 100644
--- a/bgfx/shaders/essl/chains/blurs/vs_smart-blur.bin
+++ b/bgfx/shaders/essl/chains/blurs/vs_smart-blur.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/crt-geom/vs_crt-geom.bin b/bgfx/shaders/essl/chains/crt-geom/vs_crt-geom.bin
index 8b00a619974..f4937704765 100644
--- a/bgfx/shaders/essl/chains/crt-geom/vs_crt-geom.bin
+++ b/bgfx/shaders/essl/chains/crt-geom/vs_crt-geom.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/crt-geom/vs_gaussx.bin b/bgfx/shaders/essl/chains/crt-geom/vs_gaussx.bin
index 8ea683c8084..de4daef1de4 100644
--- a/bgfx/shaders/essl/chains/crt-geom/vs_gaussx.bin
+++ b/bgfx/shaders/essl/chains/crt-geom/vs_gaussx.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/crt-geom/vs_gaussy.bin b/bgfx/shaders/essl/chains/crt-geom/vs_gaussy.bin
index 09fcd8b2eee..5eedf525fc3 100644
--- a/bgfx/shaders/essl/chains/crt-geom/vs_gaussy.bin
+++ b/bgfx/shaders/essl/chains/crt-geom/vs_gaussy.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/crt-geom/vs_lowpass.bin b/bgfx/shaders/essl/chains/crt-geom/vs_lowpass.bin
index bc5ab06b9d6..66e13380893 100644
--- a/bgfx/shaders/essl/chains/crt-geom/vs_lowpass.bin
+++ b/bgfx/shaders/essl/chains/crt-geom/vs_lowpass.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/crt-geom/vs_mipmap8.bin b/bgfx/shaders/essl/chains/crt-geom/vs_mipmap8.bin
index 622040615b0..12d231e054c 100644
--- a/bgfx/shaders/essl/chains/crt-geom/vs_mipmap8.bin
+++ b/bgfx/shaders/essl/chains/crt-geom/vs_mipmap8.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/crt-geom/vs_phosphor_apply.bin b/bgfx/shaders/essl/chains/crt-geom/vs_phosphor_apply.bin
index 622040615b0..12d231e054c 100644
--- a/bgfx/shaders/essl/chains/crt-geom/vs_phosphor_apply.bin
+++ b/bgfx/shaders/essl/chains/crt-geom/vs_phosphor_apply.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/crt-geom/vs_phosphor_update.bin b/bgfx/shaders/essl/chains/crt-geom/vs_phosphor_update.bin
index 622040615b0..12d231e054c 100644
--- a/bgfx/shaders/essl/chains/crt-geom/vs_phosphor_update.bin
+++ b/bgfx/shaders/essl/chains/crt-geom/vs_phosphor_update.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/crt/vs_crt-caligari.bin b/bgfx/shaders/essl/chains/crt/vs_crt-caligari.bin
index cde2b518c70..7f29e02fbc1 100644
--- a/bgfx/shaders/essl/chains/crt/vs_crt-caligari.bin
+++ b/bgfx/shaders/essl/chains/crt/vs_crt-caligari.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/default/vs_blit.bin b/bgfx/shaders/essl/chains/default/vs_blit.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/default/vs_blit.bin
+++ b/bgfx/shaders/essl/chains/default/vs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/eagle/vs_eagle.bin b/bgfx/shaders/essl/chains/eagle/vs_eagle.bin
index f4a5fa32205..8e4d2e7584a 100644
--- a/bgfx/shaders/essl/chains/eagle/vs_eagle.bin
+++ b/bgfx/shaders/essl/chains/eagle/vs_eagle.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/vs_chroma.bin b/bgfx/shaders/essl/chains/hlsl/vs_chroma.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/hlsl/vs_chroma.bin
+++ b/bgfx/shaders/essl/chains/hlsl/vs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/vs_color.bin b/bgfx/shaders/essl/chains/hlsl/vs_color.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/hlsl/vs_color.bin
+++ b/bgfx/shaders/essl/chains/hlsl/vs_color.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/vs_deconverge.bin b/bgfx/shaders/essl/chains/hlsl/vs_deconverge.bin
index 983ce29eb9f..4c572a54e83 100644
--- a/bgfx/shaders/essl/chains/hlsl/vs_deconverge.bin
+++ b/bgfx/shaders/essl/chains/hlsl/vs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/vs_defocus.bin b/bgfx/shaders/essl/chains/hlsl/vs_defocus.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/hlsl/vs_defocus.bin
+++ b/bgfx/shaders/essl/chains/hlsl/vs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/vs_distortion.bin b/bgfx/shaders/essl/chains/hlsl/vs_distortion.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/hlsl/vs_distortion.bin
+++ b/bgfx/shaders/essl/chains/hlsl/vs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/vs_ntsc_decode.bin b/bgfx/shaders/essl/chains/hlsl/vs_ntsc_decode.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/hlsl/vs_ntsc_decode.bin
+++ b/bgfx/shaders/essl/chains/hlsl/vs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/vs_ntsc_encode.bin b/bgfx/shaders/essl/chains/hlsl/vs_ntsc_encode.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/hlsl/vs_ntsc_encode.bin
+++ b/bgfx/shaders/essl/chains/hlsl/vs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/vs_phosphor.bin b/bgfx/shaders/essl/chains/hlsl/vs_phosphor.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/hlsl/vs_phosphor.bin
+++ b/bgfx/shaders/essl/chains/hlsl/vs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/vs_post.bin b/bgfx/shaders/essl/chains/hlsl/vs_post.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/hlsl/vs_post.bin
+++ b/bgfx/shaders/essl/chains/hlsl/vs_post.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/vs_prescale.bin b/bgfx/shaders/essl/chains/hlsl/vs_prescale.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/hlsl/vs_prescale.bin
+++ b/bgfx/shaders/essl/chains/hlsl/vs_prescale.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hlsl/vs_scanline.bin b/bgfx/shaders/essl/chains/hlsl/vs_scanline.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/hlsl/vs_scanline.bin
+++ b/bgfx/shaders/essl/chains/hlsl/vs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hqx/vs_hq2x.bin b/bgfx/shaders/essl/chains/hqx/vs_hq2x.bin
index a88fde24850..25725587f13 100644
--- a/bgfx/shaders/essl/chains/hqx/vs_hq2x.bin
+++ b/bgfx/shaders/essl/chains/hqx/vs_hq2x.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hqx/vs_hq3x.bin b/bgfx/shaders/essl/chains/hqx/vs_hq3x.bin
index a88fde24850..25725587f13 100644
--- a/bgfx/shaders/essl/chains/hqx/vs_hq3x.bin
+++ b/bgfx/shaders/essl/chains/hqx/vs_hq3x.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/hqx/vs_hq4x.bin b/bgfx/shaders/essl/chains/hqx/vs_hq4x.bin
index a88fde24850..25725587f13 100644
--- a/bgfx/shaders/essl/chains/hqx/vs_hq4x.bin
+++ b/bgfx/shaders/essl/chains/hqx/vs_hq4x.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/lcd-grid/vs_lcd-grid.bin b/bgfx/shaders/essl/chains/lcd-grid/vs_lcd-grid.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/lcd-grid/vs_lcd-grid.bin
+++ b/bgfx/shaders/essl/chains/lcd-grid/vs_lcd-grid.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/lcd-grid/vs_persistence.bin b/bgfx/shaders/essl/chains/lcd-grid/vs_persistence.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/lcd-grid/vs_persistence.bin
+++ b/bgfx/shaders/essl/chains/lcd-grid/vs_persistence.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/misc/vs_blit.bin b/bgfx/shaders/essl/chains/misc/vs_blit.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/misc/vs_blit.bin
+++ b/bgfx/shaders/essl/chains/misc/vs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/misc/vs_bob-and-ghost-deinterlace.bin b/bgfx/shaders/essl/chains/misc/vs_bob-and-ghost-deinterlace.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/misc/vs_bob-and-ghost-deinterlace.bin
+++ b/bgfx/shaders/essl/chains/misc/vs_bob-and-ghost-deinterlace.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/misc/vs_deposterize-pass0.bin b/bgfx/shaders/essl/chains/misc/vs_deposterize-pass0.bin
index d25156a0428..27afec7f504 100644
--- a/bgfx/shaders/essl/chains/misc/vs_deposterize-pass0.bin
+++ b/bgfx/shaders/essl/chains/misc/vs_deposterize-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/misc/vs_deposterize-pass1.bin b/bgfx/shaders/essl/chains/misc/vs_deposterize-pass1.bin
index d0ebc506074..df197c5b244 100644
--- a/bgfx/shaders/essl/chains/misc/vs_deposterize-pass1.bin
+++ b/bgfx/shaders/essl/chains/misc/vs_deposterize-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/misc/vs_lut.bin b/bgfx/shaders/essl/chains/misc/vs_lut.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/misc/vs_lut.bin
+++ b/bgfx/shaders/essl/chains/misc/vs_lut.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/misc/vs_saturation.bin b/bgfx/shaders/essl/chains/misc/vs_saturation.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/misc/vs_saturation.bin
+++ b/bgfx/shaders/essl/chains/misc/vs_saturation.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/pillarbox_left_horizontal/vs_gaussian.bin b/bgfx/shaders/essl/chains/pillarbox_left_horizontal/vs_gaussian.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/pillarbox_left_horizontal/vs_gaussian.bin
+++ b/bgfx/shaders/essl/chains/pillarbox_left_horizontal/vs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/pillarbox_left_horizontal/vs_offset_sat.bin b/bgfx/shaders/essl/chains/pillarbox_left_horizontal/vs_offset_sat.bin
index a34fc8e578e..3e39066c78f 100644
--- a/bgfx/shaders/essl/chains/pillarbox_left_horizontal/vs_offset_sat.bin
+++ b/bgfx/shaders/essl/chains/pillarbox_left_horizontal/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/pillarbox_left_vertical/vs_gaussian.bin b/bgfx/shaders/essl/chains/pillarbox_left_vertical/vs_gaussian.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/pillarbox_left_vertical/vs_gaussian.bin
+++ b/bgfx/shaders/essl/chains/pillarbox_left_vertical/vs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/pillarbox_left_vertical/vs_offset_sat.bin b/bgfx/shaders/essl/chains/pillarbox_left_vertical/vs_offset_sat.bin
index 85b0a7e8b8c..74a20c09d78 100644
--- a/bgfx/shaders/essl/chains/pillarbox_left_vertical/vs_offset_sat.bin
+++ b/bgfx/shaders/essl/chains/pillarbox_left_vertical/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/pillarbox_right_horizontal/vs_gaussian.bin b/bgfx/shaders/essl/chains/pillarbox_right_horizontal/vs_gaussian.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/pillarbox_right_horizontal/vs_gaussian.bin
+++ b/bgfx/shaders/essl/chains/pillarbox_right_horizontal/vs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/pillarbox_right_horizontal/vs_offset_sat.bin b/bgfx/shaders/essl/chains/pillarbox_right_horizontal/vs_offset_sat.bin
index c74d60f130b..17a63b1bae3 100644
--- a/bgfx/shaders/essl/chains/pillarbox_right_horizontal/vs_offset_sat.bin
+++ b/bgfx/shaders/essl/chains/pillarbox_right_horizontal/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/pillarbox_right_vertical/vs_gaussian.bin b/bgfx/shaders/essl/chains/pillarbox_right_vertical/vs_gaussian.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/pillarbox_right_vertical/vs_gaussian.bin
+++ b/bgfx/shaders/essl/chains/pillarbox_right_vertical/vs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/pillarbox_right_vertical/vs_offset_sat.bin b/bgfx/shaders/essl/chains/pillarbox_right_vertical/vs_offset_sat.bin
index c92e8f92655..9d258c4cfd1 100644
--- a/bgfx/shaders/essl/chains/pillarbox_right_vertical/vs_offset_sat.bin
+++ b/bgfx/shaders/essl/chains/pillarbox_right_vertical/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/unfiltered/vs_blit.bin b/bgfx/shaders/essl/chains/unfiltered/vs_blit.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/unfiltered/vs_blit.bin
+++ b/bgfx/shaders/essl/chains/unfiltered/vs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/warp/vs_dilation-horizontal-fast.bin b/bgfx/shaders/essl/chains/warp/vs_dilation-horizontal-fast.bin
index 1225ca9668d..3405decb75a 100644
--- a/bgfx/shaders/essl/chains/warp/vs_dilation-horizontal-fast.bin
+++ b/bgfx/shaders/essl/chains/warp/vs_dilation-horizontal-fast.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin
index 71e70385f6d..e23bf2b4d3b 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin
index 71e70385f6d..e23bf2b4d3b 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin
index 71e70385f6d..e23bf2b4d3b 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass0.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass0.bin
index e0d1a64e286..7d157bd2d37 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass0.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass1.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass1.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass1.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass2.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass2.bin
index 71e70385f6d..e23bf2b4d3b 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass2.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass3.bin b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass3.bin
index 71e70385f6d..e23bf2b4d3b 100644
--- a/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass3.bin
+++ b/bgfx/shaders/essl/chains/xbr/super-xbr/vs_super-xbr-pass3.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv1-noblend.bin b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv1-noblend.bin
index 9f543a073c6..57820d03cc4 100644
--- a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv1-noblend.bin
+++ b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv1-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-3d.bin b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-3d.bin
index 68a782cd511..ee025338acc 100644
--- a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-3d.bin
+++ b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-3d.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-fast.bin b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-fast.bin
index e86eea6c306..6da4fd9aff5 100644
--- a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-fast.bin
+++ b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-fast.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-noblend.bin b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-noblend.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-noblend.bin
+++ b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2.bin b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2.bin
+++ b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv2.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv3-noblend.bin b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv3-noblend.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv3-noblend.bin
+++ b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv3-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv3.bin b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv3.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/vs_xbr-lv3.bin
+++ b/bgfx/shaders/essl/chains/xbr/vs_xbr-lv3.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin
index 633ce06b34a..1dfa088d72c 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin
index 633ce06b34a..1dfa088d72c 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin
index 633ce06b34a..1dfa088d72c 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin b/bgfx/shaders/essl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin b/bgfx/shaders/essl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin
index e284f232596..e45c1263514 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin b/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin
index d468793594e..bf784dea828 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin b/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin
index 81002a6e749..193e810feb3 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin b/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin
index 34b05538592..c824984c918 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin
Binary files differ
diff --git a/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin b/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin
index 34b05538592..c824984c918 100644
--- a/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin
+++ b/bgfx/shaders/essl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin
Binary files differ
diff --git a/bgfx/shaders/essl/vs_gui.bin b/bgfx/shaders/essl/vs_gui.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/vs_gui.bin
+++ b/bgfx/shaders/essl/vs_gui.bin
Binary files differ
diff --git a/bgfx/shaders/essl/vs_screen.bin b/bgfx/shaders/essl/vs_screen.bin
index a5c50707ab0..7380389b0b5 100644
--- a/bgfx/shaders/essl/vs_screen.bin
+++ b/bgfx/shaders/essl/vs_screen.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/blurs/vs_smart-blur.bin b/bgfx/shaders/glsl/chains/blurs/vs_smart-blur.bin
index 6bfd170d7dd..4bf1ba8d28e 100644
--- a/bgfx/shaders/glsl/chains/blurs/vs_smart-blur.bin
+++ b/bgfx/shaders/glsl/chains/blurs/vs_smart-blur.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/crt-geom/vs_crt-geom.bin b/bgfx/shaders/glsl/chains/crt-geom/vs_crt-geom.bin
index 45cbd0653d5..0a4d144520c 100644
--- a/bgfx/shaders/glsl/chains/crt-geom/vs_crt-geom.bin
+++ b/bgfx/shaders/glsl/chains/crt-geom/vs_crt-geom.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/crt-geom/vs_gaussx.bin b/bgfx/shaders/glsl/chains/crt-geom/vs_gaussx.bin
index e8991da8526..0372683f08a 100644
--- a/bgfx/shaders/glsl/chains/crt-geom/vs_gaussx.bin
+++ b/bgfx/shaders/glsl/chains/crt-geom/vs_gaussx.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/crt-geom/vs_gaussy.bin b/bgfx/shaders/glsl/chains/crt-geom/vs_gaussy.bin
index 0db77bad36f..b9336babcc6 100644
--- a/bgfx/shaders/glsl/chains/crt-geom/vs_gaussy.bin
+++ b/bgfx/shaders/glsl/chains/crt-geom/vs_gaussy.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/crt-geom/vs_lowpass.bin b/bgfx/shaders/glsl/chains/crt-geom/vs_lowpass.bin
index 9dd6776ff27..6d73a87d76d 100644
--- a/bgfx/shaders/glsl/chains/crt-geom/vs_lowpass.bin
+++ b/bgfx/shaders/glsl/chains/crt-geom/vs_lowpass.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/crt-geom/vs_mipmap8.bin b/bgfx/shaders/glsl/chains/crt-geom/vs_mipmap8.bin
index 16e5c5872fb..aae3bb598c8 100644
--- a/bgfx/shaders/glsl/chains/crt-geom/vs_mipmap8.bin
+++ b/bgfx/shaders/glsl/chains/crt-geom/vs_mipmap8.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_apply.bin b/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_apply.bin
index 16e5c5872fb..aae3bb598c8 100644
--- a/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_apply.bin
+++ b/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_apply.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_update.bin b/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_update.bin
index 16e5c5872fb..aae3bb598c8 100644
--- a/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_update.bin
+++ b/bgfx/shaders/glsl/chains/crt-geom/vs_phosphor_update.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/crt/vs_crt-caligari.bin b/bgfx/shaders/glsl/chains/crt/vs_crt-caligari.bin
index 4a32bb9444c..9a28092bb5d 100644
--- a/bgfx/shaders/glsl/chains/crt/vs_crt-caligari.bin
+++ b/bgfx/shaders/glsl/chains/crt/vs_crt-caligari.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/default/vs_blit.bin b/bgfx/shaders/glsl/chains/default/vs_blit.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/default/vs_blit.bin
+++ b/bgfx/shaders/glsl/chains/default/vs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/eagle/vs_eagle.bin b/bgfx/shaders/glsl/chains/eagle/vs_eagle.bin
index e48b2aabc7b..c57ff15c514 100644
--- a/bgfx/shaders/glsl/chains/eagle/vs_eagle.bin
+++ b/bgfx/shaders/glsl/chains/eagle/vs_eagle.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/vs_chroma.bin b/bgfx/shaders/glsl/chains/hlsl/vs_chroma.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/hlsl/vs_chroma.bin
+++ b/bgfx/shaders/glsl/chains/hlsl/vs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/vs_color.bin b/bgfx/shaders/glsl/chains/hlsl/vs_color.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/hlsl/vs_color.bin
+++ b/bgfx/shaders/glsl/chains/hlsl/vs_color.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/vs_deconverge.bin b/bgfx/shaders/glsl/chains/hlsl/vs_deconverge.bin
index a9d0484bf45..c7b0fbd1334 100644
--- a/bgfx/shaders/glsl/chains/hlsl/vs_deconverge.bin
+++ b/bgfx/shaders/glsl/chains/hlsl/vs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/vs_defocus.bin b/bgfx/shaders/glsl/chains/hlsl/vs_defocus.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/hlsl/vs_defocus.bin
+++ b/bgfx/shaders/glsl/chains/hlsl/vs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/vs_distortion.bin b/bgfx/shaders/glsl/chains/hlsl/vs_distortion.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/hlsl/vs_distortion.bin
+++ b/bgfx/shaders/glsl/chains/hlsl/vs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/vs_ntsc_decode.bin b/bgfx/shaders/glsl/chains/hlsl/vs_ntsc_decode.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/hlsl/vs_ntsc_decode.bin
+++ b/bgfx/shaders/glsl/chains/hlsl/vs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/vs_ntsc_encode.bin b/bgfx/shaders/glsl/chains/hlsl/vs_ntsc_encode.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/hlsl/vs_ntsc_encode.bin
+++ b/bgfx/shaders/glsl/chains/hlsl/vs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/vs_phosphor.bin b/bgfx/shaders/glsl/chains/hlsl/vs_phosphor.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/hlsl/vs_phosphor.bin
+++ b/bgfx/shaders/glsl/chains/hlsl/vs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/vs_post.bin b/bgfx/shaders/glsl/chains/hlsl/vs_post.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/hlsl/vs_post.bin
+++ b/bgfx/shaders/glsl/chains/hlsl/vs_post.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/vs_prescale.bin b/bgfx/shaders/glsl/chains/hlsl/vs_prescale.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/hlsl/vs_prescale.bin
+++ b/bgfx/shaders/glsl/chains/hlsl/vs_prescale.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hlsl/vs_scanline.bin b/bgfx/shaders/glsl/chains/hlsl/vs_scanline.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/hlsl/vs_scanline.bin
+++ b/bgfx/shaders/glsl/chains/hlsl/vs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hqx/vs_hq2x.bin b/bgfx/shaders/glsl/chains/hqx/vs_hq2x.bin
index d77a069eaae..3b49858aaae 100644
--- a/bgfx/shaders/glsl/chains/hqx/vs_hq2x.bin
+++ b/bgfx/shaders/glsl/chains/hqx/vs_hq2x.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hqx/vs_hq3x.bin b/bgfx/shaders/glsl/chains/hqx/vs_hq3x.bin
index d77a069eaae..3b49858aaae 100644
--- a/bgfx/shaders/glsl/chains/hqx/vs_hq3x.bin
+++ b/bgfx/shaders/glsl/chains/hqx/vs_hq3x.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/hqx/vs_hq4x.bin b/bgfx/shaders/glsl/chains/hqx/vs_hq4x.bin
index d77a069eaae..3b49858aaae 100644
--- a/bgfx/shaders/glsl/chains/hqx/vs_hq4x.bin
+++ b/bgfx/shaders/glsl/chains/hqx/vs_hq4x.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/lcd-grid/vs_lcd-grid.bin b/bgfx/shaders/glsl/chains/lcd-grid/vs_lcd-grid.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/lcd-grid/vs_lcd-grid.bin
+++ b/bgfx/shaders/glsl/chains/lcd-grid/vs_lcd-grid.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/lcd-grid/vs_persistence.bin b/bgfx/shaders/glsl/chains/lcd-grid/vs_persistence.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/lcd-grid/vs_persistence.bin
+++ b/bgfx/shaders/glsl/chains/lcd-grid/vs_persistence.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/misc/vs_blit.bin b/bgfx/shaders/glsl/chains/misc/vs_blit.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/misc/vs_blit.bin
+++ b/bgfx/shaders/glsl/chains/misc/vs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/misc/vs_bob-and-ghost-deinterlace.bin b/bgfx/shaders/glsl/chains/misc/vs_bob-and-ghost-deinterlace.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/misc/vs_bob-and-ghost-deinterlace.bin
+++ b/bgfx/shaders/glsl/chains/misc/vs_bob-and-ghost-deinterlace.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/misc/vs_deposterize-pass0.bin b/bgfx/shaders/glsl/chains/misc/vs_deposterize-pass0.bin
index 2fe1d9d0ad2..dc4de3c6180 100644
--- a/bgfx/shaders/glsl/chains/misc/vs_deposterize-pass0.bin
+++ b/bgfx/shaders/glsl/chains/misc/vs_deposterize-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/misc/vs_deposterize-pass1.bin b/bgfx/shaders/glsl/chains/misc/vs_deposterize-pass1.bin
index 584c340ac7b..f2e45c7597e 100644
--- a/bgfx/shaders/glsl/chains/misc/vs_deposterize-pass1.bin
+++ b/bgfx/shaders/glsl/chains/misc/vs_deposterize-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/misc/vs_lut.bin b/bgfx/shaders/glsl/chains/misc/vs_lut.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/misc/vs_lut.bin
+++ b/bgfx/shaders/glsl/chains/misc/vs_lut.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/misc/vs_saturation.bin b/bgfx/shaders/glsl/chains/misc/vs_saturation.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/misc/vs_saturation.bin
+++ b/bgfx/shaders/glsl/chains/misc/vs_saturation.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/vs_gaussian.bin b/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/vs_gaussian.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/vs_gaussian.bin
+++ b/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/vs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/vs_offset_sat.bin b/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/vs_offset_sat.bin
index 9c3746c588a..84424e6932f 100644
--- a/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/vs_offset_sat.bin
+++ b/bgfx/shaders/glsl/chains/pillarbox_left_horizontal/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/pillarbox_left_vertical/vs_gaussian.bin b/bgfx/shaders/glsl/chains/pillarbox_left_vertical/vs_gaussian.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/pillarbox_left_vertical/vs_gaussian.bin
+++ b/bgfx/shaders/glsl/chains/pillarbox_left_vertical/vs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/pillarbox_left_vertical/vs_offset_sat.bin b/bgfx/shaders/glsl/chains/pillarbox_left_vertical/vs_offset_sat.bin
index c1230751309..4bb07d3450e 100644
--- a/bgfx/shaders/glsl/chains/pillarbox_left_vertical/vs_offset_sat.bin
+++ b/bgfx/shaders/glsl/chains/pillarbox_left_vertical/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/vs_gaussian.bin b/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/vs_gaussian.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/vs_gaussian.bin
+++ b/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/vs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/vs_offset_sat.bin b/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/vs_offset_sat.bin
index 79bd90edd9a..746d1889a28 100644
--- a/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/vs_offset_sat.bin
+++ b/bgfx/shaders/glsl/chains/pillarbox_right_horizontal/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/pillarbox_right_vertical/vs_gaussian.bin b/bgfx/shaders/glsl/chains/pillarbox_right_vertical/vs_gaussian.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/pillarbox_right_vertical/vs_gaussian.bin
+++ b/bgfx/shaders/glsl/chains/pillarbox_right_vertical/vs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/pillarbox_right_vertical/vs_offset_sat.bin b/bgfx/shaders/glsl/chains/pillarbox_right_vertical/vs_offset_sat.bin
index 456b1e1ec75..0cbd2dd2e4a 100644
--- a/bgfx/shaders/glsl/chains/pillarbox_right_vertical/vs_offset_sat.bin
+++ b/bgfx/shaders/glsl/chains/pillarbox_right_vertical/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/unfiltered/vs_blit.bin b/bgfx/shaders/glsl/chains/unfiltered/vs_blit.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/unfiltered/vs_blit.bin
+++ b/bgfx/shaders/glsl/chains/unfiltered/vs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/warp/vs_dilation-horizontal-fast.bin b/bgfx/shaders/glsl/chains/warp/vs_dilation-horizontal-fast.bin
index 9171c2cd4af..8792c6d7ba1 100644
--- a/bgfx/shaders/glsl/chains/warp/vs_dilation-horizontal-fast.bin
+++ b/bgfx/shaders/glsl/chains/warp/vs_dilation-horizontal-fast.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin
index 2d3d16927da..97ebcd0eb83 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin
index 2d3d16927da..97ebcd0eb83 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin
index 2d3d16927da..97ebcd0eb83 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass0.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass0.bin
index 8c28ee320eb..ecb736ea059 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass0.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass1.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass1.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass1.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass2.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass2.bin
index 2d3d16927da..97ebcd0eb83 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass2.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass3.bin b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass3.bin
index 2d3d16927da..97ebcd0eb83 100644
--- a/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass3.bin
+++ b/bgfx/shaders/glsl/chains/xbr/super-xbr/vs_super-xbr-pass3.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv1-noblend.bin b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv1-noblend.bin
index fa07f3422f4..18ac829b813 100644
--- a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv1-noblend.bin
+++ b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv1-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-3d.bin b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-3d.bin
index d1435087810..840bb5cee10 100644
--- a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-3d.bin
+++ b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-3d.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-fast.bin b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-fast.bin
index 6bfd170d7dd..4bf1ba8d28e 100644
--- a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-fast.bin
+++ b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-fast.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-noblend.bin b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-noblend.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-noblend.bin
+++ b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2.bin b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2.bin
+++ b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv2.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv3-noblend.bin b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv3-noblend.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv3-noblend.bin
+++ b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv3-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv3.bin b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv3.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv3.bin
+++ b/bgfx/shaders/glsl/chains/xbr/vs_xbr-lv3.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin
index 04ef8babc5b..0563d087f04 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin
index 04ef8babc5b..0563d087f04 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin
index 04ef8babc5b..0563d087f04 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin b/bgfx/shaders/glsl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin b/bgfx/shaders/glsl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin
index d25f99cca64..56f0f312289 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin b/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin
index 9e376462860..08f49353339 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin b/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin
index 8409d9ea2e2..1cead719165 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin b/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin
index 317cbeb14ce..ce1deefb2d4 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin b/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin
index 317cbeb14ce..ce1deefb2d4 100644
--- a/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin
+++ b/bgfx/shaders/glsl/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/vs_gui.bin b/bgfx/shaders/glsl/vs_gui.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/vs_gui.bin
+++ b/bgfx/shaders/glsl/vs_gui.bin
Binary files differ
diff --git a/bgfx/shaders/glsl/vs_screen.bin b/bgfx/shaders/glsl/vs_screen.bin
index e6df7bddf31..3800bd3be65 100644
--- a/bgfx/shaders/glsl/vs_screen.bin
+++ b/bgfx/shaders/glsl/vs_screen.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/blurs/fs_smart-blur.bin b/bgfx/shaders/metal/chains/blurs/fs_smart-blur.bin
index f563b28b8c4..12bb319baa7 100644
--- a/bgfx/shaders/metal/chains/blurs/fs_smart-blur.bin
+++ b/bgfx/shaders/metal/chains/blurs/fs_smart-blur.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom-deluxe.bin b/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom-deluxe.bin
index e6204e106a6..bf5015ba647 100644
--- a/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom-deluxe.bin
+++ b/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom-deluxe.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom.bin b/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom.bin
index e0f7de26e9c..8da81640e8a 100644
--- a/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom.bin
+++ b/bgfx/shaders/metal/chains/crt-geom/fs_crt-geom.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_gaussx.bin b/bgfx/shaders/metal/chains/crt-geom/fs_gaussx.bin
index c911e1cf9fd..42ed26c98fb 100644
--- a/bgfx/shaders/metal/chains/crt-geom/fs_gaussx.bin
+++ b/bgfx/shaders/metal/chains/crt-geom/fs_gaussx.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_gaussy.bin b/bgfx/shaders/metal/chains/crt-geom/fs_gaussy.bin
index 7f62f62ded0..116f974c38f 100644
--- a/bgfx/shaders/metal/chains/crt-geom/fs_gaussy.bin
+++ b/bgfx/shaders/metal/chains/crt-geom/fs_gaussy.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_lowpass.bin b/bgfx/shaders/metal/chains/crt-geom/fs_lowpass.bin
index ebe74220d3c..6051416b617 100644
--- a/bgfx/shaders/metal/chains/crt-geom/fs_lowpass.bin
+++ b/bgfx/shaders/metal/chains/crt-geom/fs_lowpass.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_mipmap8.bin b/bgfx/shaders/metal/chains/crt-geom/fs_mipmap8.bin
index ae559d1ae1a..cc33a49c79f 100644
--- a/bgfx/shaders/metal/chains/crt-geom/fs_mipmap8.bin
+++ b/bgfx/shaders/metal/chains/crt-geom/fs_mipmap8.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_phosphor_apply.bin b/bgfx/shaders/metal/chains/crt-geom/fs_phosphor_apply.bin
index d9458615046..d61f4a1d536 100644
--- a/bgfx/shaders/metal/chains/crt-geom/fs_phosphor_apply.bin
+++ b/bgfx/shaders/metal/chains/crt-geom/fs_phosphor_apply.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/crt-geom/fs_phosphor_update.bin b/bgfx/shaders/metal/chains/crt-geom/fs_phosphor_update.bin
index 239ee761e21..02b777e4fb3 100644
--- a/bgfx/shaders/metal/chains/crt-geom/fs_phosphor_update.bin
+++ b/bgfx/shaders/metal/chains/crt-geom/fs_phosphor_update.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/crt-geom/vs_crt-geom.bin b/bgfx/shaders/metal/chains/crt-geom/vs_crt-geom.bin
index 856744f5deb..384123124d8 100644
--- a/bgfx/shaders/metal/chains/crt-geom/vs_crt-geom.bin
+++ b/bgfx/shaders/metal/chains/crt-geom/vs_crt-geom.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/crt-geom/vs_lowpass.bin b/bgfx/shaders/metal/chains/crt-geom/vs_lowpass.bin
index b2f17433686..12f6d160d12 100644
--- a/bgfx/shaders/metal/chains/crt-geom/vs_lowpass.bin
+++ b/bgfx/shaders/metal/chains/crt-geom/vs_lowpass.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/crt/fs_crt-caligari.bin b/bgfx/shaders/metal/chains/crt/fs_crt-caligari.bin
index a9ee9c384e2..7f288e320b4 100644
--- a/bgfx/shaders/metal/chains/crt/fs_crt-caligari.bin
+++ b/bgfx/shaders/metal/chains/crt/fs_crt-caligari.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/crt/vs_crt-caligari.bin b/bgfx/shaders/metal/chains/crt/vs_crt-caligari.bin
index 293f1684184..fe697aedd6a 100644
--- a/bgfx/shaders/metal/chains/crt/vs_crt-caligari.bin
+++ b/bgfx/shaders/metal/chains/crt/vs_crt-caligari.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/eagle/fs_eagle.bin b/bgfx/shaders/metal/chains/eagle/fs_eagle.bin
index 62614a7bf7a..e34af3b1d38 100644
--- a/bgfx/shaders/metal/chains/eagle/fs_eagle.bin
+++ b/bgfx/shaders/metal/chains/eagle/fs_eagle.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/eagle/vs_eagle.bin b/bgfx/shaders/metal/chains/eagle/vs_eagle.bin
index 8ff3413b8d0..c9bc2774304 100644
--- a/bgfx/shaders/metal/chains/eagle/vs_eagle.bin
+++ b/bgfx/shaders/metal/chains/eagle/vs_eagle.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_chroma.bin b/bgfx/shaders/metal/chains/hlsl/fs_chroma.bin
index f38e3438304..6e4f8349dc4 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_chroma.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_color.bin b/bgfx/shaders/metal/chains/hlsl/fs_color.bin
index 1a62b2b8fbf..be4ae19d966 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_color.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_color.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_defocus.bin b/bgfx/shaders/metal/chains/hlsl/fs_defocus.bin
index f1ea3d3dac3..b112662ca3e 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_defocus.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin b/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin
index e00e792cc23..b3e00f3f613 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_ntsc_decode.bin b/bgfx/shaders/metal/chains/hlsl/fs_ntsc_decode.bin
index fa870162521..15269a510c3 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_ntsc_decode.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_ntsc_encode.bin b/bgfx/shaders/metal/chains/hlsl/fs_ntsc_encode.bin
index 1d321320e02..50e6d6e09f2 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_ntsc_encode.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_post.bin b/bgfx/shaders/metal/chains/hlsl/fs_post.bin
index f0e3ece7131..bc3b0c24e08 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_post.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_post.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin b/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin
index dfedfdb31cf..49f2a795d4f 100644
--- a/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin
+++ b/bgfx/shaders/metal/chains/hlsl/fs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hlsl/vs_deconverge.bin b/bgfx/shaders/metal/chains/hlsl/vs_deconverge.bin
index 481fa4c8eab..bfd7b719f2c 100644
--- a/bgfx/shaders/metal/chains/hlsl/vs_deconverge.bin
+++ b/bgfx/shaders/metal/chains/hlsl/vs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hqx/fs_hq2x.bin b/bgfx/shaders/metal/chains/hqx/fs_hq2x.bin
index 1a14db421da..052f41c3523 100644
--- a/bgfx/shaders/metal/chains/hqx/fs_hq2x.bin
+++ b/bgfx/shaders/metal/chains/hqx/fs_hq2x.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hqx/fs_hq3x.bin b/bgfx/shaders/metal/chains/hqx/fs_hq3x.bin
index 4c9522caba5..0f5fa27a58e 100644
--- a/bgfx/shaders/metal/chains/hqx/fs_hq3x.bin
+++ b/bgfx/shaders/metal/chains/hqx/fs_hq3x.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/hqx/fs_hq4x.bin b/bgfx/shaders/metal/chains/hqx/fs_hq4x.bin
index 9baf78a396a..76053f5f8d4 100644
--- a/bgfx/shaders/metal/chains/hqx/fs_hq4x.bin
+++ b/bgfx/shaders/metal/chains/hqx/fs_hq4x.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/lcd-grid/fs_lcd-grid.bin b/bgfx/shaders/metal/chains/lcd-grid/fs_lcd-grid.bin
index a662e0fc0ec..a86dd0edbd7 100644
--- a/bgfx/shaders/metal/chains/lcd-grid/fs_lcd-grid.bin
+++ b/bgfx/shaders/metal/chains/lcd-grid/fs_lcd-grid.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/misc/fs_blit_palette16.bin b/bgfx/shaders/metal/chains/misc/fs_blit_palette16.bin
index a4c3d3f0d09..a6701cc09a4 100644
--- a/bgfx/shaders/metal/chains/misc/fs_blit_palette16.bin
+++ b/bgfx/shaders/metal/chains/misc/fs_blit_palette16.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/misc/fs_blit_yuy16.bin b/bgfx/shaders/metal/chains/misc/fs_blit_yuy16.bin
index d2532152483..9a71b948211 100644
--- a/bgfx/shaders/metal/chains/misc/fs_blit_yuy16.bin
+++ b/bgfx/shaders/metal/chains/misc/fs_blit_yuy16.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/misc/fs_bob-and-ghost-deinterlace.bin b/bgfx/shaders/metal/chains/misc/fs_bob-and-ghost-deinterlace.bin
index 6fb99942dae..46d8d32da5f 100644
--- a/bgfx/shaders/metal/chains/misc/fs_bob-and-ghost-deinterlace.bin
+++ b/bgfx/shaders/metal/chains/misc/fs_bob-and-ghost-deinterlace.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/misc/fs_lut.bin b/bgfx/shaders/metal/chains/misc/fs_lut.bin
index 8a52d38f700..33fca4b4825 100644
--- a/bgfx/shaders/metal/chains/misc/fs_lut.bin
+++ b/bgfx/shaders/metal/chains/misc/fs_lut.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/pillarbox_left_horizontal/fs_gaussian.bin b/bgfx/shaders/metal/chains/pillarbox_left_horizontal/fs_gaussian.bin
index cd8e4b61847..1374975936e 100644
--- a/bgfx/shaders/metal/chains/pillarbox_left_horizontal/fs_gaussian.bin
+++ b/bgfx/shaders/metal/chains/pillarbox_left_horizontal/fs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/pillarbox_left_horizontal/vs_offset_sat.bin b/bgfx/shaders/metal/chains/pillarbox_left_horizontal/vs_offset_sat.bin
index 9917f197ba3..db5979513ba 100644
--- a/bgfx/shaders/metal/chains/pillarbox_left_horizontal/vs_offset_sat.bin
+++ b/bgfx/shaders/metal/chains/pillarbox_left_horizontal/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/pillarbox_left_vertical/fs_gaussian.bin b/bgfx/shaders/metal/chains/pillarbox_left_vertical/fs_gaussian.bin
index cd8e4b61847..1374975936e 100644
--- a/bgfx/shaders/metal/chains/pillarbox_left_vertical/fs_gaussian.bin
+++ b/bgfx/shaders/metal/chains/pillarbox_left_vertical/fs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/pillarbox_left_vertical/vs_offset_sat.bin b/bgfx/shaders/metal/chains/pillarbox_left_vertical/vs_offset_sat.bin
index 00834cb6133..f0d8b85ab57 100644
--- a/bgfx/shaders/metal/chains/pillarbox_left_vertical/vs_offset_sat.bin
+++ b/bgfx/shaders/metal/chains/pillarbox_left_vertical/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/pillarbox_right_horizontal/fs_gaussian.bin b/bgfx/shaders/metal/chains/pillarbox_right_horizontal/fs_gaussian.bin
index cd8e4b61847..1374975936e 100644
--- a/bgfx/shaders/metal/chains/pillarbox_right_horizontal/fs_gaussian.bin
+++ b/bgfx/shaders/metal/chains/pillarbox_right_horizontal/fs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/pillarbox_right_horizontal/vs_offset_sat.bin b/bgfx/shaders/metal/chains/pillarbox_right_horizontal/vs_offset_sat.bin
index 943cbb4694b..0aad7dc91f3 100644
--- a/bgfx/shaders/metal/chains/pillarbox_right_horizontal/vs_offset_sat.bin
+++ b/bgfx/shaders/metal/chains/pillarbox_right_horizontal/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/pillarbox_right_vertical/fs_gaussian.bin b/bgfx/shaders/metal/chains/pillarbox_right_vertical/fs_gaussian.bin
index cd8e4b61847..1374975936e 100644
--- a/bgfx/shaders/metal/chains/pillarbox_right_vertical/fs_gaussian.bin
+++ b/bgfx/shaders/metal/chains/pillarbox_right_vertical/fs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/pillarbox_right_vertical/vs_offset_sat.bin b/bgfx/shaders/metal/chains/pillarbox_right_vertical/vs_offset_sat.bin
index c2c94954410..64eb030edea 100644
--- a/bgfx/shaders/metal/chains/pillarbox_right_vertical/vs_offset_sat.bin
+++ b/bgfx/shaders/metal/chains/pillarbox_right_vertical/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/warp/fs_dilation-horizontal-fast.bin b/bgfx/shaders/metal/chains/warp/fs_dilation-horizontal-fast.bin
index dc2f302bbc5..073b93520eb 100644
--- a/bgfx/shaders/metal/chains/warp/fs_dilation-horizontal-fast.bin
+++ b/bgfx/shaders/metal/chains/warp/fs_dilation-horizontal-fast.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv1-noblend.bin b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv1-noblend.bin
index efc4ae71e36..6281cb5f796 100644
--- a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv1-noblend.bin
+++ b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv1-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-3d.bin b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-3d.bin
index 0ccca0a5afd..ac770590899 100644
--- a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-3d.bin
+++ b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-3d.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-fast.bin b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-fast.bin
index 2c717b14887..400fa7d737e 100644
--- a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-fast.bin
+++ b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-fast.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-noblend.bin b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-noblend.bin
index ce55872fe7c..ef1e9256736 100644
--- a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-noblend.bin
+++ b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2.bin b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2.bin
index b7024449493..02bdaf3ce60 100644
--- a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2.bin
+++ b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv2.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3-noblend.bin b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3-noblend.bin
index fd6201476ab..52040c38094 100644
--- a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3-noblend.bin
+++ b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3.bin b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3.bin
index 81f407aca67..b0136182f5a 100644
--- a/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3.bin
+++ b/bgfx/shaders/metal/chains/xbr/fs_xbr-lv3.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_custom-jinc2-sharper.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_custom-jinc2-sharper.bin
index d5bfab475a5..5dc0f470501 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_custom-jinc2-sharper.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_custom-jinc2-sharper.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.bin
index 03b361fd7bc..cdf970be979 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.bin
index cdfbb6212f6..53c5894c894 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.bin
index 6ceee850da7..321440dd984 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.bin
index fcc70b277fa..a78970cd384 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.bin
index b018da1d755..aa10744a2c1 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.bin
index d7b05c1b640..400a81c88b9 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.bin
index 03b361fd7bc..cdf970be979 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.bin
index d5712bf6607..b14f3453a90 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.bin
index 49638136297..8e6bc26fce2 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.bin
index 44e1e4c7e5b..c4d7b254e9d 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.bin
index 37f12a449a9..bc644aeea71 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.bin
index 62d8857e0a8..09eea8da25e 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass0.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass0.bin
index 9e98bf1b338..dd6d2a8a8c5 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass0.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass1.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass1.bin
index c601e0e025d..b144ae905b4 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass1.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass2.bin b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass2.bin
index ce75ba1719a..faa878a8106 100644
--- a/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass2.bin
+++ b/bgfx/shaders/metal/chains/xbr/super-xbr/fs_super-xbr-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv1-noblend.bin b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv1-noblend.bin
index 41491eb8c64..2b1a3ec0d82 100644
--- a/bgfx/shaders/metal/chains/xbr/vs_xbr-lv1-noblend.bin
+++ b/bgfx/shaders/metal/chains/xbr/vs_xbr-lv1-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.bin
index ac716eada4d..ce7a02b70ad 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.bin
index afc3ec7d817..a578d21bfb0 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.bin
index f236ce7b7b3..cf4db949111 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.bin
index 1e1b9edb5f7..2f9b611eaf9 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.bin
index cdb360f0689..3953be9de4b 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.bin
index ac13ee0e83f..f87e2fb5631 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.bin
index f95ec11f8be..5432dc109a5 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.bin b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.bin
index 9aa48cc2e96..9f6c272d79d 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.bin
index 9a61fedfdec..10d04ba603a 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.bin
index 5bce5be60ca..ac59319c745 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.bin
index 49bd9a6763a..308194bea71 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.bin
index 05cca361035..2bc945a7f13 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.bin
index f63bff79173..043e01a4500 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.bin
index 79bf4132d7f..ed6a8b25105 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.bin
index dbecf557cf9..c59b2e838b3 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.bin
index acd535aa91b..c4a3abd3c78 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.bin
index 14db56aab1f..0dcf7252668 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.bin b/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.bin
index e4a8e266df0..101b26465e2 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.bin b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.bin
index 9871c124c84..859bc624f13 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.bin b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.bin
index fb8f08d5a75..b9d10295b25 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.bin b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.bin
index 89c937b5bb7..2ef4dac6da1 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.bin
Binary files differ
diff --git a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.bin b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.bin
index 22219acee39..7aef0225561 100644
--- a/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.bin
+++ b/bgfx/shaders/metal/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/blurs/fs_smart-blur.bin b/bgfx/shaders/spirv/chains/blurs/fs_smart-blur.bin
index 0cdf5f76c8c..93fe363c96b 100644
--- a/bgfx/shaders/spirv/chains/blurs/fs_smart-blur.bin
+++ b/bgfx/shaders/spirv/chains/blurs/fs_smart-blur.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/blurs/vs_smart-blur.bin b/bgfx/shaders/spirv/chains/blurs/vs_smart-blur.bin
index 05c71985f18..2a9584f62dd 100644
--- a/bgfx/shaders/spirv/chains/blurs/vs_smart-blur.bin
+++ b/bgfx/shaders/spirv/chains/blurs/vs_smart-blur.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom-deluxe.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom-deluxe.bin
index 75dfa85cec7..d1294df79f9 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom-deluxe.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom-deluxe.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom.bin
index 14a47c07920..712e3625792 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/fs_crt-geom.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_gaussx.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_gaussx.bin
index 5e324863b83..e60e999d61e 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/fs_gaussx.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/fs_gaussx.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_gaussy.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_gaussy.bin
index 632ca0c6283..ccb7b712ecc 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/fs_gaussy.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/fs_gaussy.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_lowpass.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_lowpass.bin
index ede0048399c..c8231a11e7d 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/fs_lowpass.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/fs_lowpass.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_mipmap8.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_mipmap8.bin
index 8bf4e68ab29..8ab4a6ae508 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/fs_mipmap8.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/fs_mipmap8.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_apply.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_apply.bin
index 621366b0e5d..ff0c2ec9cf8 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_apply.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_apply.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_update.bin b/bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_update.bin
index ce6d213507e..fb9216b0a2d 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_update.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/fs_phosphor_update.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_crt-geom.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_crt-geom.bin
index 9809de00382..f0075fd0eee 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/vs_crt-geom.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/vs_crt-geom.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_gaussx.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_gaussx.bin
index 83ede7de2a3..386197c82da 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/vs_gaussx.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/vs_gaussx.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_gaussy.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_gaussy.bin
index 74766849f04..2fce758cf26 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/vs_gaussy.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/vs_gaussy.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_lowpass.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_lowpass.bin
index 2e903ada0c7..32e06663dd4 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/vs_lowpass.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/vs_lowpass.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_mipmap8.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_mipmap8.bin
index d08591bf0c2..2ed1f77a862 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/vs_mipmap8.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/vs_mipmap8.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_apply.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_apply.bin
index d08591bf0c2..2ed1f77a862 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_apply.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_apply.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_update.bin b/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_update.bin
index d08591bf0c2..2ed1f77a862 100644
--- a/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_update.bin
+++ b/bgfx/shaders/spirv/chains/crt-geom/vs_phosphor_update.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt/fs_crt-caligari.bin b/bgfx/shaders/spirv/chains/crt/fs_crt-caligari.bin
index 61c9e373503..e051a621ebd 100644
--- a/bgfx/shaders/spirv/chains/crt/fs_crt-caligari.bin
+++ b/bgfx/shaders/spirv/chains/crt/fs_crt-caligari.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/crt/vs_crt-caligari.bin b/bgfx/shaders/spirv/chains/crt/vs_crt-caligari.bin
index 67257c9e4a0..bf12ac2d0c8 100644
--- a/bgfx/shaders/spirv/chains/crt/vs_crt-caligari.bin
+++ b/bgfx/shaders/spirv/chains/crt/vs_crt-caligari.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/default/fs_blit.bin b/bgfx/shaders/spirv/chains/default/fs_blit.bin
index bd2282f9504..15d578c9b9c 100644
--- a/bgfx/shaders/spirv/chains/default/fs_blit.bin
+++ b/bgfx/shaders/spirv/chains/default/fs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/default/vs_blit.bin b/bgfx/shaders/spirv/chains/default/vs_blit.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/default/vs_blit.bin
+++ b/bgfx/shaders/spirv/chains/default/vs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/eagle/fs_eagle.bin b/bgfx/shaders/spirv/chains/eagle/fs_eagle.bin
index 29deae1778c..d2968b93961 100644
--- a/bgfx/shaders/spirv/chains/eagle/fs_eagle.bin
+++ b/bgfx/shaders/spirv/chains/eagle/fs_eagle.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/eagle/vs_eagle.bin b/bgfx/shaders/spirv/chains/eagle/vs_eagle.bin
index 3f3ee8938dc..c18d0f948c6 100644
--- a/bgfx/shaders/spirv/chains/eagle/vs_eagle.bin
+++ b/bgfx/shaders/spirv/chains/eagle/vs_eagle.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_chroma.bin b/bgfx/shaders/spirv/chains/hlsl/fs_chroma.bin
index ef496bbef42..b02c5df0f74 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_chroma.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_color.bin b/bgfx/shaders/spirv/chains/hlsl/fs_color.bin
index c2b9af2eae5..fcc3fd5d9f8 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_color.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_color.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_deconverge.bin b/bgfx/shaders/spirv/chains/hlsl/fs_deconverge.bin
index 840e518e76f..444392a44ba 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_deconverge.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_defocus.bin b/bgfx/shaders/spirv/chains/hlsl/fs_defocus.bin
index 1c06c28626b..1935a70f032 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_defocus.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_distortion.bin b/bgfx/shaders/spirv/chains/hlsl/fs_distortion.bin
index 1181d1cad76..9756dcc43df 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_distortion.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_decode.bin b/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_decode.bin
index fd0589e91a7..eb7e5bed4ec 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_decode.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_encode.bin b/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_encode.bin
index 132abea6893..282a4756bd2 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_encode.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_phosphor.bin b/bgfx/shaders/spirv/chains/hlsl/fs_phosphor.bin
index c6917fad840..aeb36e7269c 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_phosphor.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_post.bin b/bgfx/shaders/spirv/chains/hlsl/fs_post.bin
index 7c92588f180..f804b6635ca 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_post.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_post.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_prescale.bin b/bgfx/shaders/spirv/chains/hlsl/fs_prescale.bin
index 85c2e236688..1308bf702da 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_prescale.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_prescale.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/fs_scanline.bin b/bgfx/shaders/spirv/chains/hlsl/fs_scanline.bin
index 893759daf08..2a4b0a345b9 100644
--- a/bgfx/shaders/spirv/chains/hlsl/fs_scanline.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/fs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_chroma.bin b/bgfx/shaders/spirv/chains/hlsl/vs_chroma.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_chroma.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_chroma.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_color.bin b/bgfx/shaders/spirv/chains/hlsl/vs_color.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_color.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_color.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_deconverge.bin b/bgfx/shaders/spirv/chains/hlsl/vs_deconverge.bin
index 312c3021bf0..ed52ee7e605 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_deconverge.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_deconverge.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_defocus.bin b/bgfx/shaders/spirv/chains/hlsl/vs_defocus.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_defocus.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_defocus.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_distortion.bin b/bgfx/shaders/spirv/chains/hlsl/vs_distortion.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_distortion.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_distortion.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.bin b/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_decode.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.bin b/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_ntsc_encode.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_phosphor.bin b/bgfx/shaders/spirv/chains/hlsl/vs_phosphor.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_phosphor.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_phosphor.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_post.bin b/bgfx/shaders/spirv/chains/hlsl/vs_post.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_post.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_post.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_prescale.bin b/bgfx/shaders/spirv/chains/hlsl/vs_prescale.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_prescale.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_prescale.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hlsl/vs_scanline.bin b/bgfx/shaders/spirv/chains/hlsl/vs_scanline.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/hlsl/vs_scanline.bin
+++ b/bgfx/shaders/spirv/chains/hlsl/vs_scanline.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hqx/fs_hq2x.bin b/bgfx/shaders/spirv/chains/hqx/fs_hq2x.bin
index 25f68d14c4e..bd01bde66c2 100644
--- a/bgfx/shaders/spirv/chains/hqx/fs_hq2x.bin
+++ b/bgfx/shaders/spirv/chains/hqx/fs_hq2x.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hqx/fs_hq3x.bin b/bgfx/shaders/spirv/chains/hqx/fs_hq3x.bin
index 2235b39920a..433c2c164c4 100644
--- a/bgfx/shaders/spirv/chains/hqx/fs_hq3x.bin
+++ b/bgfx/shaders/spirv/chains/hqx/fs_hq3x.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hqx/fs_hq4x.bin b/bgfx/shaders/spirv/chains/hqx/fs_hq4x.bin
index 80d604041bf..88a276ea5d9 100644
--- a/bgfx/shaders/spirv/chains/hqx/fs_hq4x.bin
+++ b/bgfx/shaders/spirv/chains/hqx/fs_hq4x.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hqx/vs_hq2x.bin b/bgfx/shaders/spirv/chains/hqx/vs_hq2x.bin
index c886a5535cd..9387e8c197e 100644
--- a/bgfx/shaders/spirv/chains/hqx/vs_hq2x.bin
+++ b/bgfx/shaders/spirv/chains/hqx/vs_hq2x.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hqx/vs_hq3x.bin b/bgfx/shaders/spirv/chains/hqx/vs_hq3x.bin
index c886a5535cd..9387e8c197e 100644
--- a/bgfx/shaders/spirv/chains/hqx/vs_hq3x.bin
+++ b/bgfx/shaders/spirv/chains/hqx/vs_hq3x.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/hqx/vs_hq4x.bin b/bgfx/shaders/spirv/chains/hqx/vs_hq4x.bin
index c886a5535cd..9387e8c197e 100644
--- a/bgfx/shaders/spirv/chains/hqx/vs_hq4x.bin
+++ b/bgfx/shaders/spirv/chains/hqx/vs_hq4x.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/lcd-grid/fs_lcd-grid.bin b/bgfx/shaders/spirv/chains/lcd-grid/fs_lcd-grid.bin
index 8f3fb3db565..1e53a6a3f8d 100644
--- a/bgfx/shaders/spirv/chains/lcd-grid/fs_lcd-grid.bin
+++ b/bgfx/shaders/spirv/chains/lcd-grid/fs_lcd-grid.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/lcd-grid/fs_persistence.bin b/bgfx/shaders/spirv/chains/lcd-grid/fs_persistence.bin
index e1bc4660a11..16f747f6427 100644
--- a/bgfx/shaders/spirv/chains/lcd-grid/fs_persistence.bin
+++ b/bgfx/shaders/spirv/chains/lcd-grid/fs_persistence.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/lcd-grid/vs_lcd-grid.bin b/bgfx/shaders/spirv/chains/lcd-grid/vs_lcd-grid.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/lcd-grid/vs_lcd-grid.bin
+++ b/bgfx/shaders/spirv/chains/lcd-grid/vs_lcd-grid.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/lcd-grid/vs_persistence.bin b/bgfx/shaders/spirv/chains/lcd-grid/vs_persistence.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/lcd-grid/vs_persistence.bin
+++ b/bgfx/shaders/spirv/chains/lcd-grid/vs_persistence.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/fs_blit.bin b/bgfx/shaders/spirv/chains/misc/fs_blit.bin
index bd2282f9504..15d578c9b9c 100644
--- a/bgfx/shaders/spirv/chains/misc/fs_blit.bin
+++ b/bgfx/shaders/spirv/chains/misc/fs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/fs_blit_bcg.bin b/bgfx/shaders/spirv/chains/misc/fs_blit_bcg.bin
index 604fa538c36..d10025e67dd 100644
--- a/bgfx/shaders/spirv/chains/misc/fs_blit_bcg.bin
+++ b/bgfx/shaders/spirv/chains/misc/fs_blit_bcg.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/fs_blit_palette16.bin b/bgfx/shaders/spirv/chains/misc/fs_blit_palette16.bin
index cd464ab3b48..e5a3f317dd5 100644
--- a/bgfx/shaders/spirv/chains/misc/fs_blit_palette16.bin
+++ b/bgfx/shaders/spirv/chains/misc/fs_blit_palette16.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/fs_blit_rgb32.bin b/bgfx/shaders/spirv/chains/misc/fs_blit_rgb32.bin
index 970cf19f949..1edd76348cf 100644
--- a/bgfx/shaders/spirv/chains/misc/fs_blit_rgb32.bin
+++ b/bgfx/shaders/spirv/chains/misc/fs_blit_rgb32.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/fs_blit_yuy16.bin b/bgfx/shaders/spirv/chains/misc/fs_blit_yuy16.bin
index d97029a2dd4..c4a372f9a7b 100644
--- a/bgfx/shaders/spirv/chains/misc/fs_blit_yuy16.bin
+++ b/bgfx/shaders/spirv/chains/misc/fs_blit_yuy16.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/fs_bob-and-ghost-deinterlace.bin b/bgfx/shaders/spirv/chains/misc/fs_bob-and-ghost-deinterlace.bin
index 5532a728c9b..6cbea4bb7c3 100644
--- a/bgfx/shaders/spirv/chains/misc/fs_bob-and-ghost-deinterlace.bin
+++ b/bgfx/shaders/spirv/chains/misc/fs_bob-and-ghost-deinterlace.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/fs_deposterize-pass0.bin b/bgfx/shaders/spirv/chains/misc/fs_deposterize-pass0.bin
index f5ec17cd7d6..d011a02918d 100644
--- a/bgfx/shaders/spirv/chains/misc/fs_deposterize-pass0.bin
+++ b/bgfx/shaders/spirv/chains/misc/fs_deposterize-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/fs_deposterize-pass1.bin b/bgfx/shaders/spirv/chains/misc/fs_deposterize-pass1.bin
index ff5b61b3a08..003deae7ac8 100644
--- a/bgfx/shaders/spirv/chains/misc/fs_deposterize-pass1.bin
+++ b/bgfx/shaders/spirv/chains/misc/fs_deposterize-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/fs_lut.bin b/bgfx/shaders/spirv/chains/misc/fs_lut.bin
index ccf2f5b8380..8a6a938e0ac 100644
--- a/bgfx/shaders/spirv/chains/misc/fs_lut.bin
+++ b/bgfx/shaders/spirv/chains/misc/fs_lut.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/fs_saturation.bin b/bgfx/shaders/spirv/chains/misc/fs_saturation.bin
index 473f43b4cd9..97be921f649 100644
--- a/bgfx/shaders/spirv/chains/misc/fs_saturation.bin
+++ b/bgfx/shaders/spirv/chains/misc/fs_saturation.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/vs_blit.bin b/bgfx/shaders/spirv/chains/misc/vs_blit.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/misc/vs_blit.bin
+++ b/bgfx/shaders/spirv/chains/misc/vs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/vs_bob-and-ghost-deinterlace.bin b/bgfx/shaders/spirv/chains/misc/vs_bob-and-ghost-deinterlace.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/misc/vs_bob-and-ghost-deinterlace.bin
+++ b/bgfx/shaders/spirv/chains/misc/vs_bob-and-ghost-deinterlace.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass0.bin b/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass0.bin
index ed5cc2b572e..d8017922e51 100644
--- a/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass0.bin
+++ b/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass1.bin b/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass1.bin
index 37e283167cf..667da07e71e 100644
--- a/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass1.bin
+++ b/bgfx/shaders/spirv/chains/misc/vs_deposterize-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/vs_lut.bin b/bgfx/shaders/spirv/chains/misc/vs_lut.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/misc/vs_lut.bin
+++ b/bgfx/shaders/spirv/chains/misc/vs_lut.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/misc/vs_saturation.bin b/bgfx/shaders/spirv/chains/misc/vs_saturation.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/misc/vs_saturation.bin
+++ b/bgfx/shaders/spirv/chains/misc/vs_saturation.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/fs_gaussian.bin b/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/fs_gaussian.bin
index 5dfb7d26143..535248944eb 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/fs_gaussian.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/fs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/fs_offset_sat.bin b/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/fs_offset_sat.bin
index 473f43b4cd9..97be921f649 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/fs_offset_sat.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/fs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_gaussian.bin b/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_gaussian.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_gaussian.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_offset_sat.bin b/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_offset_sat.bin
index 154a82ea0e7..9810f826948 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_offset_sat.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_left_horizontal/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_left_vertical/fs_gaussian.bin b/bgfx/shaders/spirv/chains/pillarbox_left_vertical/fs_gaussian.bin
index 5dfb7d26143..535248944eb 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_left_vertical/fs_gaussian.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_left_vertical/fs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_left_vertical/fs_offset_sat.bin b/bgfx/shaders/spirv/chains/pillarbox_left_vertical/fs_offset_sat.bin
index 473f43b4cd9..97be921f649 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_left_vertical/fs_offset_sat.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_left_vertical/fs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_gaussian.bin b/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_gaussian.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_gaussian.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_offset_sat.bin b/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_offset_sat.bin
index e435accec29..a4a89bb041a 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_offset_sat.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_left_vertical/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/fs_gaussian.bin b/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/fs_gaussian.bin
index 5dfb7d26143..535248944eb 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/fs_gaussian.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/fs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/fs_offset_sat.bin b/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/fs_offset_sat.bin
index 473f43b4cd9..97be921f649 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/fs_offset_sat.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/fs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_gaussian.bin b/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_gaussian.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_gaussian.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_offset_sat.bin b/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_offset_sat.bin
index b8ede3084c8..447093dde11 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_offset_sat.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_right_horizontal/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_right_vertical/fs_gaussian.bin b/bgfx/shaders/spirv/chains/pillarbox_right_vertical/fs_gaussian.bin
index 5dfb7d26143..535248944eb 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_right_vertical/fs_gaussian.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_right_vertical/fs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_right_vertical/fs_offset_sat.bin b/bgfx/shaders/spirv/chains/pillarbox_right_vertical/fs_offset_sat.bin
index 473f43b4cd9..97be921f649 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_right_vertical/fs_offset_sat.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_right_vertical/fs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_gaussian.bin b/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_gaussian.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_gaussian.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_gaussian.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_offset_sat.bin b/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_offset_sat.bin
index 5ce1bee182b..d11ed4ca88e 100644
--- a/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_offset_sat.bin
+++ b/bgfx/shaders/spirv/chains/pillarbox_right_vertical/vs_offset_sat.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/unfiltered/fs_blit.bin b/bgfx/shaders/spirv/chains/unfiltered/fs_blit.bin
index bd2282f9504..15d578c9b9c 100644
--- a/bgfx/shaders/spirv/chains/unfiltered/fs_blit.bin
+++ b/bgfx/shaders/spirv/chains/unfiltered/fs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/unfiltered/vs_blit.bin b/bgfx/shaders/spirv/chains/unfiltered/vs_blit.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/unfiltered/vs_blit.bin
+++ b/bgfx/shaders/spirv/chains/unfiltered/vs_blit.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/warp/fs_dilation-horizontal-fast.bin b/bgfx/shaders/spirv/chains/warp/fs_dilation-horizontal-fast.bin
index 16933523c18..e75b7a7561f 100644
--- a/bgfx/shaders/spirv/chains/warp/fs_dilation-horizontal-fast.bin
+++ b/bgfx/shaders/spirv/chains/warp/fs_dilation-horizontal-fast.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/warp/vs_dilation-horizontal-fast.bin b/bgfx/shaders/spirv/chains/warp/vs_dilation-horizontal-fast.bin
index 0224a7d62f2..23b146622cb 100644
--- a/bgfx/shaders/spirv/chains/warp/vs_dilation-horizontal-fast.bin
+++ b/bgfx/shaders/spirv/chains/warp/vs_dilation-horizontal-fast.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv1-noblend.bin b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv1-noblend.bin
index dbccdd9e573..ba1791e4622 100644
--- a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv1-noblend.bin
+++ b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv1-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-3d.bin b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-3d.bin
index 8f1741d40fc..1663d499e57 100644
--- a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-3d.bin
+++ b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-3d.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-fast.bin b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-fast.bin
index 8dbf6eba08b..dca6eaaa9f0 100644
--- a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-fast.bin
+++ b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-fast.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-noblend.bin b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-noblend.bin
index 60adacc1927..9ec8971c159 100644
--- a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-noblend.bin
+++ b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2.bin b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2.bin
index acaca9356d0..e94f560a4d5 100644
--- a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv3-noblend.bin b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv3-noblend.bin
index d906368a00d..16133405678 100644
--- a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv3-noblend.bin
+++ b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv3-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv3.bin b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv3.bin
index be8406dd8f8..321319cf7fa 100644
--- a/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv3.bin
+++ b/bgfx/shaders/spirv/chains/xbr/fs_xbr-lv3.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_custom-jinc2-sharper.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_custom-jinc2-sharper.bin
index ee3d569eb14..de23708cb5f 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_custom-jinc2-sharper.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_custom-jinc2-sharper.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.bin
index 9fe7c65e117..da1d7f3c74e 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.bin
index 517efba5699..cbad6a85287 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.bin
index 43fa63096d6..4e6ca8007b4 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-2xbr-3d-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.bin
index 1acddbee5f1..5be4eb98978 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.bin
index d298e481bb7..b6ab2d7cc7d 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.bin
index caae1467446..0c14908a344 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass1f.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.bin
index 9fe7c65e117..da1d7f3c74e 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.bin
index 17fc1a7bffa..37fba069a81 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.bin
index ceee529068a..b9cc4865dba 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-4xbr-3d-pass3f.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.bin
index 1ea9c0339ec..0d3f4470d5a 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.bin
index 977c0d88e6b..7f18e49b45b 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.bin
index b1226447c45..a07d18e0b29 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-fast-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass0.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass0.bin
index 3cf88d21c3c..c43483fe6cd 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass1.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass1.bin
index 42379d12d25..714d531b2b4 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass2.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass2.bin
index 675b91fce28..a2d1dd10658 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/fs_super-xbr-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_custom-jinc2-sharper.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin
index 70eec70280e..40761797c56 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-2xbr-3d-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin
index 70eec70280e..40761797c56 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass1f.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin
index 70eec70280e..40761797c56 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-4xbr-3d-pass3f.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-fast-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass0.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass0.bin
index 4c73b770ead..f967fec69dc 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass1.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass1.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass2.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass2.bin
index 70eec70280e..40761797c56 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass3.bin b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass3.bin
index 70eec70280e..40761797c56 100644
--- a/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass3.bin
+++ b/bgfx/shaders/spirv/chains/xbr/super-xbr/vs_super-xbr-pass3.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv1-noblend.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv1-noblend.bin
index 3b25339c462..6e75ff5493a 100644
--- a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv1-noblend.bin
+++ b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv1-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-3d.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-3d.bin
index 96c155b644f..5ef41af60f4 100644
--- a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-3d.bin
+++ b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-3d.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-fast.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-fast.bin
index 05c71985f18..2a9584f62dd 100644
--- a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-fast.bin
+++ b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-fast.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-noblend.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-noblend.bin
index ce604a3dce5..6ff1b372a0e 100644
--- a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-noblend.bin
+++ b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2.bin
index ce604a3dce5..6ff1b372a0e 100644
--- a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3-noblend.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3-noblend.bin
index ce604a3dce5..6ff1b372a0e 100644
--- a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3-noblend.bin
+++ b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3-noblend.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3.bin b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3.bin
index ce604a3dce5..6ff1b372a0e 100644
--- a/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3.bin
+++ b/bgfx/shaders/spirv/chains/xbr/vs_xbr-lv3.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.bin
index 4864d069aea..06ce96bb91c 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-sharp.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.bin
index c314b999c6f..33661990a72 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.bin
index faee6f9167e..47f08cabd09 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.bin
index 0a0944fb6fe..8bdf77b9842 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.bin
index 84277db29f5..0644e1cd4fb 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.bin
index 8bf9d8aa9f6..55d4aa3a431 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v4b.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.bin
index 37d69b2e0b8..d022161222d 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid-v5-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.bin
index cd2fab4e016..f147a2acd94 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/fs_2xbr-hybrid.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin
index 1c2b24fe073..d3daa19310f 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-sharp.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin
index 1c2b24fe073..d3daa19310f 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin
index 1c2b24fe073..d3daa19310f 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin
index 1c2b24fe073..d3daa19310f 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin
index 1c2b24fe073..d3daa19310f 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin
index 1c2b24fe073..d3daa19310f 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v4b.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin
index 1c2b24fe073..d3daa19310f 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid-v5-gamma.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin
index 1c2b24fe073..d3daa19310f 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-hybrid/vs_2xbr-hybrid.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.bin
index f5e262da827..6dd7f8b54ed 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-a-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.bin
index b038103f0d0..781e3ae41d9 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.bin
index 74c45605ff3..f492fa56970 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-accuracy-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.bin
index 609f77c823c..8b5f042c82e 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-b-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.bin
index feaa73fc363..b6dedda81af 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-c-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.bin
index f883e82cead..a4230b21c1b 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.bin
index c25aa10b2eb..95786a3b5a5 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-noblend-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.bin
index a58e8ab6c4a..515def907ac 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/fs_xbr-lv2-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin
index ce604a3dce5..6ff1b372a0e 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-a-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin
index ce604a3dce5..6ff1b372a0e 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin
index f11e3e311ed..4c3cc75e37d 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-accuracy-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin
index ce604a3dce5..6ff1b372a0e 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-b-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin
index ce604a3dce5..6ff1b372a0e 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-c-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin
index ce604a3dce5..6ff1b372a0e 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-d-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin
index f11e3e311ed..4c3cc75e37d 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-noblend-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin
index f11e3e311ed..4c3cc75e37d 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv2-multipass/vs_xbr-lv2-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.bin
index 507c66d0b33..81440f49d5d 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.bin
index d49ef457934..5144cefc233 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/fs_xbr-lv3-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin
index ce604a3dce5..6ff1b372a0e 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass0.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin
index 03fa407141a..b880786f8a4 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-lv3-multipass/vs_xbr-lv3-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.bin
index d7f59052863..a2a4e4017e9 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.bin b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.bin
index ea1a4383cc1..ea558eea172 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.bin b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.bin
index a380a45b089..46cf0c8af11 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass3.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.bin b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.bin
index 94bce43f60e..0597a7c6955 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/fs_xbr-mlv4-pass4.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin
index 3877770dd6e..14c40d9e628 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass1.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin
index ce604a3dce5..6ff1b372a0e 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass2.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin
index fb686af8084..c347029fcf7 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass3.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin
index 79cbfeaeca2..fad1c265ba9 100644
--- a/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin
+++ b/bgfx/shaders/spirv/chains/xbr/xbr-mlv4-multipass/vs_xbr-mlv4-pass4.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/fs_gui.bin b/bgfx/shaders/spirv/fs_gui.bin
index bd2282f9504..15d578c9b9c 100644
--- a/bgfx/shaders/spirv/fs_gui.bin
+++ b/bgfx/shaders/spirv/fs_gui.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/fs_screen.bin b/bgfx/shaders/spirv/fs_screen.bin
index bd2282f9504..15d578c9b9c 100644
--- a/bgfx/shaders/spirv/fs_screen.bin
+++ b/bgfx/shaders/spirv/fs_screen.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/vs_gui.bin b/bgfx/shaders/spirv/vs_gui.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/vs_gui.bin
+++ b/bgfx/shaders/spirv/vs_gui.bin
Binary files differ
diff --git a/bgfx/shaders/spirv/vs_screen.bin b/bgfx/shaders/spirv/vs_screen.bin
index 45e3c83f46c..cb5fd46391f 100644
--- a/bgfx/shaders/spirv/vs_screen.bin
+++ b/bgfx/shaders/spirv/vs_screen.bin
Binary files differ
diff --git a/scripts/src/3rdparty.lua b/scripts/src/3rdparty.lua
index 77707c5d5b2..b2322b7c655 100644
--- a/scripts/src/3rdparty.lua
+++ b/scripts/src/3rdparty.lua
@@ -1117,6 +1117,7 @@ project "bx"
"__STDC_LIMIT_MACROS",
"__STDC_FORMAT_MACROS",
"__STDC_CONSTANT_MACROS",
+ "BX_CONFIG_DEBUG=0",
}
configuration { "vs*" }
@@ -1143,6 +1144,11 @@ project "bx"
MAME_DIR .. "3rdparty/bx/include/compat/freebsd",
}
+ configuration { "linux*" }
+ includedirs {
+ MAME_DIR .. "3rdparty/bx/include/compat/linux",
+ }
+
configuration { }
includedirs {
@@ -1211,9 +1217,18 @@ project "bimg"
MAME_DIR .. "3rdparty/bx/include/compat/freebsd",
}
+ configuration { "linux*" }
+ includedirs {
+ MAME_DIR .. "3rdparty/bx/include/compat/linux",
+ }
+
configuration { "gmake or ninja" }
buildoptions {
"-Wno-unused-but-set-variable",
+ "-Wno-undef",
+ }
+ buildoptions_c {
+ "-Wno-strict-prototypes",
}
configuration { }
@@ -1230,29 +1245,44 @@ project "bimg"
"__STDC_LIMIT_MACROS",
"__STDC_FORMAT_MACROS",
"__STDC_CONSTANT_MACROS",
+ "BX_CONFIG_DEBUG=0",
}
includedirs {
MAME_DIR .. "3rdparty/bimg/include",
- MAME_DIR .. "3rdparty/bimg/3rdparty/astc-codec",
- MAME_DIR .. "3rdparty/bimg/3rdparty/astc-codec/include",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/include",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/tinyexr/deps/miniz",
}
files {
MAME_DIR .. "3rdparty/bimg/src/image.cpp",
MAME_DIR .. "3rdparty/bimg/src/image_gnf.cpp",
- MAME_DIR .. "3rdparty/bimg/3rdparty/astc-codec/src/decoder/astc_file.cc",
- MAME_DIR .. "3rdparty/bimg/3rdparty/astc-codec/src/decoder/codec.cc",
- MAME_DIR .. "3rdparty/bimg/3rdparty/astc-codec/src/decoder/endpoint_codec.cc",
- MAME_DIR .. "3rdparty/bimg/3rdparty/astc-codec/src/decoder/footprint.cc",
- MAME_DIR .. "3rdparty/bimg/3rdparty/astc-codec/src/decoder/integer_sequence_codec.cc",
- MAME_DIR .. "3rdparty/bimg/3rdparty/astc-codec/src/decoder/intermediate_astc_block.cc",
- MAME_DIR .. "3rdparty/bimg/3rdparty/astc-codec/src/decoder/logical_astc_block.cc",
- MAME_DIR .. "3rdparty/bimg/3rdparty/astc-codec/src/decoder/partition.cc",
- MAME_DIR .. "3rdparty/bimg/3rdparty/astc-codec/src/decoder/physical_astc_block.cc",
- MAME_DIR .. "3rdparty/bimg/3rdparty/astc-codec/src/decoder/quantization.cc",
- MAME_DIR .. "3rdparty/bimg/3rdparty/astc-codec/src/decoder/weight_infill.cc",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_averages_and_directions.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_block_sizes.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_color_quantize.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_color_unquantize.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_compress_symbolic.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_compute_variance.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_decompress_symbolic.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_diagnostic_trace.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_entry.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_find_best_partitioning.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_ideal_endpoints_and_weights.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_image.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_integer_sequence.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_mathlib_softfloat.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_partition_tables.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_percentile_tables.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_pick_best_endpoint_format.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_platform_isa_detection.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_quantization.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_symbolic_physical.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_weight_align.cpp",
+ MAME_DIR .. "3rdparty/bimg/3rdparty/astc-encoder/source/astcenc_weight_quant_xfer_tables.cpp",
+
+ MAME_DIR .. "3rdparty/bimg/3rdparty/tinyexr/deps/miniz/miniz.c",
}
@@ -1287,7 +1317,7 @@ end
MAME_DIR .. "3rdparty/bgfx/3rdparty",
MAME_DIR .. "3rdparty/bx/include",
MAME_DIR .. "3rdparty/bimg/include",
- MAME_DIR .. "3rdparty/bgfx/3rdparty/dxsdk/include",
+ MAME_DIR .. "3rdparty/bgfx/3rdparty/directx-headers/include/directx",
MAME_DIR .. "3rdparty/bgfx/3rdparty/khronos",
}
@@ -1320,6 +1350,12 @@ end
MAME_DIR .. "3rdparty/bx/include/compat/freebsd",
}
+ configuration { "linux*" }
+ includedirs {
+ MAME_DIR .. "3rdparty/bgfx/3rdparty/directx-headers/include/wsl/stubs",
+ MAME_DIR .. "3rdparty/bx/include/compat/linux",
+ }
+
configuration { "gmake or ninja" }
buildoptions {
"-Wno-uninitialized",
@@ -1371,6 +1407,7 @@ end
"__STDC_LIMIT_MACROS",
"__STDC_FORMAT_MACROS",
"__STDC_CONSTANT_MACROS",
+ "BX_CONFIG_DEBUG=0",
"BGFX_CONFIG_MAX_FRAME_BUFFERS=128",
}
diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua
index 3c0da69f3c6..d1769833efa 100644
--- a/scripts/src/osd/modules.lua
+++ b/scripts/src/osd/modules.lua
@@ -174,6 +174,7 @@ function osdmodulesbuild()
"__STDC_LIMIT_MACROS",
"__STDC_FORMAT_MACROS",
"__STDC_CONSTANT_MACROS",
+ "BX_CONFIG_DEBUG=0",
}
files {
diff --git a/scripts/src/osd/sdl.lua b/scripts/src/osd/sdl.lua
index f8d698a0b51..a110cce6f4f 100644
--- a/scripts/src/osd/sdl.lua
+++ b/scripts/src/osd/sdl.lua
@@ -266,6 +266,7 @@ if BASE_TARGETOS=="unix" then
linkoptions {
"-framework QuartzCore",
"-framework OpenGL",
+ "-framework IOKit",
}
diff --git a/src/osd/modules/debugger/debugimgui.cpp b/src/osd/modules/debugger/debugimgui.cpp
index 5f087f70a2e..6221b435f2f 100644
--- a/src/osd/modules/debugger/debugimgui.cpp
+++ b/src/osd/modules/debugger/debugimgui.cpp
@@ -203,6 +203,7 @@ private:
file_entry* m_selected_file;
int m_format_sel;
char m_path[1024]; // path text field buffer
+ std::unordered_map<input_item_id,ImGuiKey> m_mapping;
};
// globals
@@ -350,10 +351,11 @@ void debug_imgui::handle_keys()
for(input_item_id id = ITEM_ID_A; id <= ITEM_ID_CANCEL; ++id)
{
- if(m_machine->input().code_pressed(input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, id)))
- io.KeysDown[id] = true;
- else
- io.KeysDown[id] = false;
+ if(m_machine->input().code_pressed(input_code(DEVICE_CLASS_KEYBOARD, 0, ITEM_CLASS_SWITCH, ITEM_MODIFIER_NONE, id))) {
+ if (m_mapping.count(id)) io.AddKeyEvent(m_mapping[id], true);
+ } else {
+ if (m_mapping.count(id)) io.AddKeyEvent(m_mapping[id], false);
+ }
}
m_key_char = 0;
@@ -372,9 +374,9 @@ void debug_imgui::handle_keys()
}
// global keys
- if(ImGui::IsKeyPressed(ITEM_ID_F3,false))
+ if(ImGui::IsKeyPressed(ImGuiKey_F3,false))
{
- if(ImGui::IsKeyDown(ITEM_ID_LSHIFT))
+ if(ImGui::IsKeyDown(ImGuiKey_LeftShift))
m_machine->schedule_hard_reset();
else
{
@@ -383,44 +385,44 @@ void debug_imgui::handle_keys()
}
}
- if(ImGui::IsKeyPressed(ITEM_ID_F5,false))
+ if(ImGui::IsKeyPressed(ImGuiKey_F5,false))
{
m_machine->debugger().console().get_visible_cpu()->debug()->go();
m_running = true;
}
- if(ImGui::IsKeyPressed(ITEM_ID_F6,false))
+ if(ImGui::IsKeyPressed(ImGuiKey_F6,false))
{
m_machine->debugger().console().get_visible_cpu()->debug()->go_next_device();
m_running = true;
}
- if(ImGui::IsKeyPressed(ITEM_ID_F7,false))
+ if(ImGui::IsKeyPressed(ImGuiKey_F7,false))
{
m_machine->debugger().console().get_visible_cpu()->debug()->go_interrupt();
m_running = true;
}
- if(ImGui::IsKeyPressed(ITEM_ID_F8,false))
+ if(ImGui::IsKeyPressed(ImGuiKey_F8,false))
m_machine->debugger().console().get_visible_cpu()->debug()->go_vblank();
- if(ImGui::IsKeyPressed(ITEM_ID_F9,false))
+ if(ImGui::IsKeyPressed(ImGuiKey_F9,false))
m_machine->debugger().console().get_visible_cpu()->debug()->single_step_out();
- if(ImGui::IsKeyPressed(ITEM_ID_F10,false))
+ if(ImGui::IsKeyPressed(ImGuiKey_F10,false))
m_machine->debugger().console().get_visible_cpu()->debug()->single_step_over();
- if(ImGui::IsKeyPressed(ITEM_ID_F11,false))
+ if(ImGui::IsKeyPressed(ImGuiKey_F11,false))
m_machine->debugger().console().get_visible_cpu()->debug()->single_step();
- if(ImGui::IsKeyPressed(ITEM_ID_F12,false))
+ if(ImGui::IsKeyPressed(ImGuiKey_F12,false))
{
m_machine->debugger().console().get_visible_cpu()->debug()->go();
m_hide = true;
}
- if(ImGui::IsKeyPressed(ITEM_ID_D,false) && ImGui::IsKeyDown(ITEM_ID_LCONTROL))
+ if(ImGui::IsKeyPressed(ImGuiKey_D,false) && ImGui::IsKeyDown(ImGuiKey_LeftCtrl))
add_disasm(++m_win_count);
- if(ImGui::IsKeyPressed(ITEM_ID_M,false) && ImGui::IsKeyDown(ITEM_ID_LCONTROL))
+ if(ImGui::IsKeyPressed(ImGuiKey_M,false) && ImGui::IsKeyDown(ImGuiKey_LeftCtrl))
add_memory(++m_win_count);
- if(ImGui::IsKeyPressed(ITEM_ID_B,false) && ImGui::IsKeyDown(ITEM_ID_LCONTROL))
+ if(ImGui::IsKeyPressed(ImGuiKey_B,false) && ImGui::IsKeyDown(ImGuiKey_LeftCtrl))
add_bpoints(++m_win_count);
- if(ImGui::IsKeyPressed(ITEM_ID_W,false) && ImGui::IsKeyDown(ITEM_ID_LCONTROL))
+ if(ImGui::IsKeyPressed(ImGuiKey_W,false) && ImGui::IsKeyDown(ImGuiKey_LeftCtrl))
add_wpoints(++m_win_count);
- if(ImGui::IsKeyPressed(ITEM_ID_L,false) && ImGui::IsKeyDown(ITEM_ID_LCONTROL))
+ if(ImGui::IsKeyPressed(ImGuiKey_L,false) && ImGui::IsKeyDown(ImGuiKey_LeftCtrl))
add_log(++m_win_count);
}
@@ -443,38 +445,38 @@ void debug_imgui::handle_keys_views()
return;
// pass keypresses to debug view with focus
- if(ImGui::IsKeyPressed(ITEM_ID_UP))
+ if(ImGui::IsKeyPressed(ImGuiKey_UpArrow))
focus_view->view->process_char(DCH_UP);
- if(ImGui::IsKeyPressed(ITEM_ID_DOWN))
+ if(ImGui::IsKeyPressed(ImGuiKey_DownArrow))
focus_view->view->process_char(DCH_DOWN);
- if(ImGui::IsKeyPressed(ITEM_ID_LEFT))
+ if(ImGui::IsKeyPressed(ImGuiKey_LeftArrow))
{
- if(ImGui::IsKeyDown(ITEM_ID_LCONTROL))
+ if(ImGui::IsKeyDown(ImGuiKey_LeftCtrl))
focus_view->view->process_char(DCH_CTRLLEFT);
else
focus_view->view->process_char(DCH_LEFT);
}
- if(ImGui::IsKeyPressed(ITEM_ID_RIGHT))
+ if(ImGui::IsKeyPressed(ImGuiKey_RightArrow))
{
- if(ImGui::IsKeyDown(ITEM_ID_LCONTROL))
+ if(ImGui::IsKeyDown(ImGuiKey_LeftCtrl))
focus_view->view->process_char(DCH_CTRLRIGHT);
else
focus_view->view->process_char(DCH_RIGHT);
}
- if(ImGui::IsKeyPressed(ITEM_ID_PGUP))
+ if(ImGui::IsKeyPressed(ImGuiKey_PageUp))
focus_view->view->process_char(DCH_PUP);
- if(ImGui::IsKeyPressed(ITEM_ID_PGDN))
+ if(ImGui::IsKeyPressed(ImGuiKey_PageDown))
focus_view->view->process_char(DCH_PDOWN);
- if(ImGui::IsKeyPressed(ITEM_ID_HOME))
+ if(ImGui::IsKeyPressed(ImGuiKey_Home))
{
- if(ImGui::IsKeyDown(ITEM_ID_LCONTROL))
+ if(ImGui::IsKeyDown(ImGuiKey_LeftCtrl))
focus_view->view->process_char(DCH_CTRLHOME);
else
focus_view->view->process_char(DCH_HOME);
}
- if(ImGui::IsKeyPressed(ITEM_ID_END))
+ if(ImGui::IsKeyPressed(ImGuiKey_End))
{
- if(ImGui::IsKeyDown(ITEM_ID_LCONTROL))
+ if(ImGui::IsKeyDown(ImGuiKey_LeftCtrl))
focus_view->view->process_char(DCH_CTRLEND);
else
focus_view->view->process_char(DCH_END);
@@ -551,6 +553,8 @@ int debug_imgui::history_set(ImGuiInputTextCallbackData* data)
if(history_pos < view_main_console->console_history.size())
history_pos++;
break;
+ default:
+ break;
}
if(history_pos == view_main_console->console_history.size())
@@ -1464,26 +1468,39 @@ void debug_imgui::init_debugger(running_machine &machine)
m_has_images = true;
// map keys to ImGui inputs
- io.KeyMap[ImGuiKey_A] = ITEM_ID_A;
- io.KeyMap[ImGuiKey_C] = ITEM_ID_C;
- io.KeyMap[ImGuiKey_V] = ITEM_ID_V;
- io.KeyMap[ImGuiKey_X] = ITEM_ID_X;
- io.KeyMap[ImGuiKey_C] = ITEM_ID_C;
- io.KeyMap[ImGuiKey_Y] = ITEM_ID_Y;
- io.KeyMap[ImGuiKey_Z] = ITEM_ID_Z;
- io.KeyMap[ImGuiKey_Backspace] = ITEM_ID_BACKSPACE;
- io.KeyMap[ImGuiKey_Delete] = ITEM_ID_DEL;
- io.KeyMap[ImGuiKey_Tab] = ITEM_ID_TAB;
- io.KeyMap[ImGuiKey_PageUp] = ITEM_ID_PGUP;
- io.KeyMap[ImGuiKey_PageDown] = ITEM_ID_PGDN;
- io.KeyMap[ImGuiKey_Home] = ITEM_ID_HOME;
- io.KeyMap[ImGuiKey_End] = ITEM_ID_END;
- io.KeyMap[ImGuiKey_Escape] = ITEM_ID_ESC;
- io.KeyMap[ImGuiKey_Enter] = ITEM_ID_ENTER;
- io.KeyMap[ImGuiKey_LeftArrow] = ITEM_ID_LEFT;
- io.KeyMap[ImGuiKey_RightArrow] = ITEM_ID_RIGHT;
- io.KeyMap[ImGuiKey_UpArrow] = ITEM_ID_UP;
- io.KeyMap[ImGuiKey_DownArrow] = ITEM_ID_DOWN;
+ m_mapping[ITEM_ID_A] = ImGuiKey_A;
+ m_mapping[ITEM_ID_C] = ImGuiKey_C;
+ m_mapping[ITEM_ID_V] = ImGuiKey_V;
+ m_mapping[ITEM_ID_X] = ImGuiKey_X;
+ m_mapping[ITEM_ID_Y] = ImGuiKey_Y;
+ m_mapping[ITEM_ID_Z] = ImGuiKey_Z;
+ m_mapping[ITEM_ID_D] = ImGuiKey_D;
+ m_mapping[ITEM_ID_M] = ImGuiKey_M;
+ m_mapping[ITEM_ID_B] = ImGuiKey_B;
+ m_mapping[ITEM_ID_W] = ImGuiKey_W;
+ m_mapping[ITEM_ID_L] = ImGuiKey_L;
+ m_mapping[ITEM_ID_BACKSPACE] = ImGuiKey_Backspace;
+ m_mapping[ITEM_ID_DEL] = ImGuiKey_Delete;
+ m_mapping[ITEM_ID_TAB] = ImGuiKey_Tab;
+ m_mapping[ITEM_ID_PGUP] = ImGuiKey_PageUp;
+ m_mapping[ITEM_ID_PGDN] = ImGuiKey_PageDown;
+ m_mapping[ITEM_ID_HOME] = ImGuiKey_Home;
+ m_mapping[ITEM_ID_END] = ImGuiKey_End;
+ m_mapping[ITEM_ID_ESC] = ImGuiKey_Escape;
+ m_mapping[ITEM_ID_ENTER] = ImGuiKey_Enter;
+ m_mapping[ITEM_ID_LEFT] = ImGuiKey_LeftArrow;
+ m_mapping[ITEM_ID_RIGHT] = ImGuiKey_RightArrow;
+ m_mapping[ITEM_ID_UP] = ImGuiKey_UpArrow;
+ m_mapping[ITEM_ID_DOWN] = ImGuiKey_DownArrow;
+ m_mapping[ITEM_ID_F3] = ImGuiKey_F3;
+ m_mapping[ITEM_ID_F5] = ImGuiKey_F5;
+ m_mapping[ITEM_ID_F6] = ImGuiKey_F6;
+ m_mapping[ITEM_ID_F7] = ImGuiKey_F7;
+ m_mapping[ITEM_ID_F8] = ImGuiKey_F8;
+ m_mapping[ITEM_ID_F9] = ImGuiKey_F9;
+ m_mapping[ITEM_ID_F10] = ImGuiKey_F10;
+ m_mapping[ITEM_ID_F11] = ImGuiKey_F11;
+ m_mapping[ITEM_ID_F12] = ImGuiKey_F12;
// set key delay and repeat rates
io.KeyRepeatDelay = 0.400f;
diff --git a/src/osd/modules/render/bgfx/chainmanager.cpp b/src/osd/modules/render/bgfx/chainmanager.cpp
index 2ae3d9a3daf..3d5e3f6a482 100644
--- a/src/osd/modules/render/bgfx/chainmanager.cpp
+++ b/src/osd/modules/render/bgfx/chainmanager.cpp
@@ -181,8 +181,9 @@ bgfx_chain* chain_manager::load_chain(std::string name, uint32_t screen_index)
int32_t size(bx::getSize(&reader));
+ bx::ErrorAssert err;
char* data = new char[size + 1];
- bx::read(&reader, reinterpret_cast<void*>(data), size);
+ bx::read(&reader, reinterpret_cast<void*>(data), size, &err);
bx::close(&reader);
data[size] = 0;
diff --git a/src/osd/modules/render/bgfx/effectmanager.cpp b/src/osd/modules/render/bgfx/effectmanager.cpp
index 33e056b45fe..ba86e00adf0 100644
--- a/src/osd/modules/render/bgfx/effectmanager.cpp
+++ b/src/osd/modules/render/bgfx/effectmanager.cpp
@@ -43,9 +43,10 @@ static bool prepare_effect_document(std::string &name, osd_options &options, rap
return false;
}
+ bx::ErrorAssert err;
int32_t size (bx::getSize(&reader));
char* data = new char[size + 1];
- bx::read(&reader, reinterpret_cast<void*>(data), size);
+ bx::read(&reader, reinterpret_cast<void*>(data), size, &err);
bx::close(&reader);
data[size] = 0;
diff --git a/src/osd/modules/render/bgfx/shadermanager.cpp b/src/osd/modules/render/bgfx/shadermanager.cpp
index 11e298a4e7a..aafd704a30c 100644
--- a/src/osd/modules/render/bgfx/shadermanager.cpp
+++ b/src/osd/modules/render/bgfx/shadermanager.cpp
@@ -65,11 +65,12 @@ bool shader_manager::is_shader_present(osd_options &options, std::string name)
std::string shader_path = make_path_string(options, name);
std::string file_name = shader_path + name + ".bin";
bx::FileReader reader;
+ bx::ErrorAssert err;
if (bx::open(&reader, file_name.c_str()))
{
uint32_t expected_size(bx::getSize(&reader));
uint8_t *data = new uint8_t[expected_size];
- uint32_t read_size = (uint32_t)bx::read(&reader, data, expected_size);
+ uint32_t read_size = (uint32_t)bx::read(&reader, data, expected_size, &err);
delete [] data;
bx::close(&reader);
@@ -127,9 +128,10 @@ const bgfx::Memory* shader_manager::load_mem(std::string name)
bx::FileReader reader;
if (bx::open(&reader, name.c_str()))
{
+ bx::ErrorAssert err;
uint32_t size(bx::getSize(&reader));
const bgfx::Memory* mem = bgfx::alloc(size + 1);
- bx::read(&reader, mem->data, size);
+ bx::read(&reader, mem->data, size, &err);
bx::close(&reader);
mem->data[mem->size - 1] = '\0';